summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2009-01-08 17:26:35 +0000
committerRafael H. Schloming <rhs@apache.org>2009-01-08 17:26:35 +0000
commite030dc3157335a42db2740a826481982b151a7d5 (patch)
treed64300423484f1b36b269e3511b40acd9a5e0c91
parent6d805baf1313c532c4777788e09c3604cbe0d975 (diff)
downloadqpid-python-e030dc3157335a42db2740a826481982b151a7d5.tar.gz
removed accidental branch
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/M4-RCs@732767 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--M4-RCs/.gitignore77
-rw-r--r--M4-RCs/qpid/KEYS152
-rw-r--r--M4-RCs/qpid/LICENSE7
-rw-r--r--M4-RCs/qpid/NOTICE8
-rw-r--r--M4-RCs/qpid/bin/LICENSE206
-rw-r--r--M4-RCs/qpid/bin/NOTICE8
-rwxr-xr-xM4-RCs/qpid/bin/mvn-deploy-qpid-java.sh71
-rwxr-xr-xM4-RCs/qpid/bin/release.sh75
-rwxr-xr-xM4-RCs/qpid/bin/set_svn_properties.sh133
-rw-r--r--M4-RCs/qpid/buildtools/LICENSE206
-rw-r--r--M4-RCs/qpid/buildtools/NOTICE8
-rw-r--r--M4-RCs/qpid/buildtools/buildCreator/build.config37
-rwxr-xr-xM4-RCs/qpid/buildtools/buildCreator/buildCreator.py1444
-rw-r--r--M4-RCs/qpid/buildtools/buildCreator/qpid.build55
-rw-r--r--M4-RCs/qpid/cc/LICENSE206
-rw-r--r--M4-RCs/qpid/cc/NOTICE8
-rw-r--r--M4-RCs/qpid/cc/README84
-rw-r--r--M4-RCs/qpid/cc/config.properties25
-rw-r--r--M4-RCs/qpid/cc/config.xml37
-rw-r--r--M4-RCs/qpid/cc/config/bdbstore-cpp-trunk.xml54
-rw-r--r--M4-RCs/qpid/cc/config/cpp-perftests.xml63
-rw-r--r--M4-RCs/qpid/cc/config/cpp-trunk.xml59
-rw-r--r--M4-RCs/qpid/cc/config/dotnet-trunk.xml63
-rw-r--r--M4-RCs/qpid/cc/config/example-automation.xml58
-rw-r--r--M4-RCs/qpid/cc/config/java-jmstck.xml63
-rw-r--r--M4-RCs/qpid/cc/config/java-perftests.xml72
-rw-r--r--M4-RCs/qpid/cc/config/java-trunk.xml142
-rw-r--r--M4-RCs/qpid/cc/config/java/cpp.noprefetch.testprofile4
-rw-r--r--M4-RCs/qpid/cc/config/java/cpp.testprofile3
-rw-r--r--M4-RCs/qpid/cc/config/java/jndi.properties42
-rw-r--r--M4-RCs/qpid/cc/dashboard-config.xml31
-rwxr-xr-xM4-RCs/qpid/cc/scripts/bdbstorecppbuild.sh24
-rw-r--r--M4-RCs/qpid/cc/scripts/build.xml30
-rwxr-xr-xM4-RCs/qpid/cc/scripts/check_examples.sh69
-rwxr-xr-xM4-RCs/qpid/cc/scripts/cppbuild-perftests.sh23
-rwxr-xr-xM4-RCs/qpid/cc/scripts/cppbuild.sh21
-rw-r--r--M4-RCs/qpid/cc/scripts/dotnetbuild.sh21
-rwxr-xr-xM4-RCs/qpid/cc/scripts/javaconfig.sh27
-rw-r--r--M4-RCs/qpid/cc/scripts/javajmstck.sh80
-rwxr-xr-xM4-RCs/qpid/cc/scripts/javareport.sh25
-rw-r--r--M4-RCs/qpid/cc/scripts/runbroker.sh42
-rw-r--r--M4-RCs/qpid/cc/scripts/stopbroker.sh31
-rwxr-xr-xM4-RCs/qpid/cc/scripts/verify100
-rwxr-xr-xM4-RCs/qpid/cc/scripts/verify_all166
-rw-r--r--M4-RCs/qpid/cpp/DESIGN78
-rw-r--r--M4-RCs/qpid/cpp/INSTALL335
-rw-r--r--M4-RCs/qpid/cpp/INSTALL-WINDOWS127
-rw-r--r--M4-RCs/qpid/cpp/LICENSE234
-rw-r--r--M4-RCs/qpid/cpp/Makefile.am34
-rw-r--r--M4-RCs/qpid/cpp/NOTICE21
-rw-r--r--M4-RCs/qpid/cpp/README38
-rw-r--r--M4-RCs/qpid/cpp/RELEASE_NOTES21
-rw-r--r--M4-RCs/qpid/cpp/SSL71
-rw-r--r--M4-RCs/qpid/cpp/boost-1.32-support/Makefile11
-rw-r--r--M4-RCs/qpid/cpp/boost-1.32-support/README8
-rw-r--r--M4-RCs/qpid/cpp/boost-1.32-support/boost.tar.gzbin99495 -> 0 bytes
-rw-r--r--M4-RCs/qpid/cpp/boost-1.32-support/main.patch25
-rw-r--r--M4-RCs/qpid/cpp/boost-1.32-support/supressions107
-rwxr-xr-xM4-RCs/qpid/cpp/bootstrap27
-rwxr-xr-xM4-RCs/qpid/cpp/build-aux/compile142
-rwxr-xr-xM4-RCs/qpid/cpp/build-aux/config.guess1501
-rwxr-xr-xM4-RCs/qpid/cpp/build-aux/config.rpath614
-rwxr-xr-xM4-RCs/qpid/cpp/build-aux/config.sub1619
-rwxr-xr-xM4-RCs/qpid/cpp/build-aux/depcomp584
-rwxr-xr-xM4-RCs/qpid/cpp/build-aux/install-sh507
-rwxr-xr-xM4-RCs/qpid/cpp/build-aux/ltmain.sh6892
-rwxr-xr-xM4-RCs/qpid/cpp/build-aux/mdate-sh201
-rwxr-xr-xM4-RCs/qpid/cpp/build-aux/missing367
-rw-r--r--M4-RCs/qpid/cpp/configure.ac393
-rw-r--r--M4-RCs/qpid/cpp/docs/api/Makefile.am40
-rw-r--r--M4-RCs/qpid/cpp/docs/api/developer.doxygen.in1241
-rw-r--r--M4-RCs/qpid/cpp/docs/api/doxygen.css494
-rw-r--r--M4-RCs/qpid/cpp/docs/api/doxygen_mainpage.h131
-rw-r--r--M4-RCs/qpid/cpp/docs/api/footer.html25
-rw-r--r--M4-RCs/qpid/cpp/docs/api/header.html27
-rw-r--r--M4-RCs/qpid/cpp/docs/api/stylesheet.css494
-rw-r--r--M4-RCs/qpid/cpp/docs/api/tabs.css123
-rw-r--r--M4-RCs/qpid/cpp/docs/api/user.doxygen.in1219
-rw-r--r--M4-RCs/qpid/cpp/docs/man/Makefile.am47
-rw-r--r--M4-RCs/qpid/cpp/docs/man/qpidd.x46
-rw-r--r--M4-RCs/qpid/cpp/etc/Makefile.am59
-rw-r--r--M4-RCs/qpid/cpp/etc/emacs/qpid-c++-mode.el226
-rw-r--r--M4-RCs/qpid/cpp/etc/qpidc.conf23
-rwxr-xr-xM4-RCs/qpid/cpp/etc/qpidd103
-rw-r--r--M4-RCs/qpid/cpp/etc/qpidd.conf23
-rw-r--r--M4-RCs/qpid/cpp/etc/sasl2/qpidd.conf42
-rw-r--r--M4-RCs/qpid/cpp/examples/Makefile.am49
-rw-r--r--M4-RCs/qpid/cpp/examples/README114
-rw-r--r--M4-RCs/qpid/cpp/examples/README.verify26
-rw-r--r--M4-RCs/qpid/cpp/examples/direct/Makefile.am47
-rw-r--r--M4-RCs/qpid/cpp/examples/direct/declare_queues.cpp85
-rw-r--r--M4-RCs/qpid/cpp/examples/direct/direct_producer.cpp110
-rw-r--r--M4-RCs/qpid/cpp/examples/direct/listener.cpp110
-rw-r--r--M4-RCs/qpid/cpp/examples/direct/verify23
-rw-r--r--M4-RCs/qpid/cpp/examples/direct/verify.in15
-rw-r--r--M4-RCs/qpid/cpp/examples/direct/verify_cpp_python4
-rw-r--r--M4-RCs/qpid/cpp/examples/direct/verify_cpp_python.in14
-rw-r--r--M4-RCs/qpid/cpp/examples/direct/verify_python_cpp5
-rw-r--r--M4-RCs/qpid/cpp/examples/direct/verify_python_cpp.in15
-rw-r--r--M4-RCs/qpid/cpp/examples/failover/Makefile.am40
-rw-r--r--M4-RCs/qpid/cpp/examples/failover/declare_queues.cpp61
-rw-r--r--M4-RCs/qpid/cpp/examples/failover/replaying_sender.cpp97
-rw-r--r--M4-RCs/qpid/cpp/examples/failover/resuming_receiver.cpp127
-rw-r--r--M4-RCs/qpid/cpp/examples/fanout/Makefile.am47
-rw-r--r--M4-RCs/qpid/cpp/examples/fanout/fanout_producer.cpp106
-rw-r--r--M4-RCs/qpid/cpp/examples/fanout/listener.cpp126
-rw-r--r--M4-RCs/qpid/cpp/examples/fanout/verify25
-rw-r--r--M4-RCs/qpid/cpp/examples/fanout/verify.in43
-rw-r--r--M4-RCs/qpid/cpp/examples/fanout/verify_cpp_python7
-rw-r--r--M4-RCs/qpid/cpp/examples/fanout/verify_cpp_python.in27
-rw-r--r--M4-RCs/qpid/cpp/examples/fanout/verify_python_cpp7
-rw-r--r--M4-RCs/qpid/cpp/examples/fanout/verify_python_cpp.in29
-rw-r--r--M4-RCs/qpid/cpp/examples/makedist.mk22
-rw-r--r--M4-RCs/qpid/cpp/examples/pub-sub/Makefile.am48
-rw-r--r--M4-RCs/qpid/cpp/examples/pub-sub/topic_listener.cpp174
-rw-r--r--M4-RCs/qpid/cpp/examples/pub-sub/topic_publisher.cpp130
-rw-r--r--M4-RCs/qpid/cpp/examples/pub-sub/verify23
-rw-r--r--M4-RCs/qpid/cpp/examples/pub-sub/verify.in59
-rw-r--r--M4-RCs/qpid/cpp/examples/pub-sub/verify_cpp_python6
-rw-r--r--M4-RCs/qpid/cpp/examples/pub-sub/verify_cpp_python.in55
-rw-r--r--M4-RCs/qpid/cpp/examples/pub-sub/verify_python_cpp6
-rw-r--r--M4-RCs/qpid/cpp/examples/pub-sub/verify_python_cpp.in59
-rw-r--r--M4-RCs/qpid/cpp/examples/qmf-agent/Makefile85
-rw-r--r--M4-RCs/qpid/cpp/examples/qmf-agent/example.cpp200
-rw-r--r--M4-RCs/qpid/cpp/examples/qmf-agent/schema.xml64
-rw-r--r--M4-RCs/qpid/cpp/examples/qmf-console/Makefile.am41
-rw-r--r--M4-RCs/qpid/cpp/examples/qmf-console/console.cpp150
-rw-r--r--M4-RCs/qpid/cpp/examples/qmf-console/ping.cpp129
-rw-r--r--M4-RCs/qpid/cpp/examples/qmf-console/printevents.cpp105
-rw-r--r--M4-RCs/qpid/cpp/examples/request-response/Makefile.am48
-rw-r--r--M4-RCs/qpid/cpp/examples/request-response/client.cpp164
-rw-r--r--M4-RCs/qpid/cpp/examples/request-response/server.cpp162
-rw-r--r--M4-RCs/qpid/cpp/examples/request-response/verify24
-rw-r--r--M4-RCs/qpid/cpp/examples/request-response/verify.in19
-rw-r--r--M4-RCs/qpid/cpp/examples/request-response/verify_cpp_python6
-rw-r--r--M4-RCs/qpid/cpp/examples/request-response/verify_cpp_python.in15
-rw-r--r--M4-RCs/qpid/cpp/examples/request-response/verify_python_cpp5
-rw-r--r--M4-RCs/qpid/cpp/examples/request-response/verify_python_cpp.in18
-rwxr-xr-xM4-RCs/qpid/cpp/examples/verify107
-rwxr-xr-xM4-RCs/qpid/cpp/examples/verify_all53
-rw-r--r--M4-RCs/qpid/cpp/examples/xml-exchange/Makefile.am47
-rw-r--r--M4-RCs/qpid/cpp/examples/xml-exchange/README53
-rw-r--r--M4-RCs/qpid/cpp/examples/xml-exchange/declare_queues.cpp99
-rw-r--r--M4-RCs/qpid/cpp/examples/xml-exchange/listener.cpp108
-rw-r--r--M4-RCs/qpid/cpp/examples/xml-exchange/xml_producer.cpp114
-rw-r--r--M4-RCs/qpid/cpp/m4/clock_time.m430
-rw-r--r--M4-RCs/qpid/cpp/m4/compiler-flags.m423
-rw-r--r--M4-RCs/qpid/cpp/m4/cppunit.m489
-rw-r--r--M4-RCs/qpid/cpp/m4/extensions.m459
-rw-r--r--M4-RCs/qpid/cpp/m4/python.m4168
-rwxr-xr-xM4-RCs/qpid/cpp/make-dist105
-rw-r--r--M4-RCs/qpid/cpp/managementgen/Makefile.am36
-rwxr-xr-xM4-RCs/qpid/cpp/managementgen/qmf-gen95
-rw-r--r--M4-RCs/qpid/cpp/managementgen/qmfgen/__init__.py19
-rwxr-xr-xM4-RCs/qpid/cpp/managementgen/qmfgen/generate.py369
-rw-r--r--M4-RCs/qpid/cpp/managementgen/qmfgen/management-types.xml56
-rwxr-xr-xM4-RCs/qpid/cpp/managementgen/qmfgen/schema.py1339
-rw-r--r--M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Args.h42
-rw-r--r--M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Class.cpp181
-rw-r--r--M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Class.h105
-rw-r--r--M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Event.cpp77
-rw-r--r--M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Event.h59
-rw-r--r--M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Makefile.mk40
-rw-r--r--M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Package.cpp32
-rw-r--r--M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Package.h41
-rwxr-xr-xM4-RCs/qpid/cpp/qpid-autotools-install205
-rwxr-xr-xM4-RCs/qpid/cpp/qpid-config.in98
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/0-10/allsegmenttypes.rb52
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/0-10/exceptions.rb73
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/0-10/handlers.rb47
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/0-10/specification.rb389
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/0-10/typecode.rb117
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/MethodBodyDefaultVisitor.rb53
-rw-r--r--M4-RCs/qpid/cpp/rubygen/README17
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/amqpgen.rb545
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/cppgen.rb449
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb45
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/framing.0-10/MethodBodyDefaultVisitor.rb53
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/framing.0-10/MethodHolder.rb118
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/framing.0-10/Operations.rb121
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/framing.0-10/OperationsInvoker.rb116
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/framing.0-10/Proxy.rb107
-rw-r--r--M4-RCs/qpid/cpp/rubygen/framing.0-10/Session.rb408
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/framing.0-10/all_method_bodies.rb39
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/framing.0-10/constants.rb201
-rw-r--r--M4-RCs/qpid/cpp/rubygen/framing.0-10/frame_body_lists.rb49
-rw-r--r--M4-RCs/qpid/cpp/rubygen/framing.0-10/structs.rb611
-rwxr-xr-xM4-RCs/qpid/cpp/rubygen/generate125
-rw-r--r--M4-RCs/qpid/cpp/src/Makefile.am715
-rw-r--r--M4-RCs/qpid/cpp/src/MaxMethodBodySize.vcproj396
-rw-r--r--M4-RCs/qpid/cpp/src/acl.mk34
-rw-r--r--M4-RCs/qpid/cpp/src/broker.vcproj1280
-rw-r--r--M4-RCs/qpid/cpp/src/client.vcproj574
-rw-r--r--M4-RCs/qpid/cpp/src/cluster.mk75
-rw-r--r--M4-RCs/qpid/cpp/src/common.vcproj1870
-rwxr-xr-xM4-RCs/qpid/cpp/src/generate.sh67
-rw-r--r--M4-RCs/qpid/cpp/src/posix/QpiddBroker.cpp168
-rwxr-xr-xM4-RCs/qpid/cpp/src/prof39
-rw-r--r--M4-RCs/qpid/cpp/src/protocol_gen.mak28
-rw-r--r--M4-RCs/qpid/cpp/src/qmf.mk31
-rw-r--r--M4-RCs/qpid/cpp/src/qmfc.mk51
-rw-r--r--M4-RCs/qpid/cpp/src/qmfconsole.vcproj418
-rw-r--r--M4-RCs/qpid/cpp/src/qpid.sln72
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Address.cpp58
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/Address.h85
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/DataDir.cpp49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/DataDir.h50
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Exception.cpp55
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Exception.h93
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/InlineAllocator.h84
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/InlineVector.h68
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Modules.cpp78
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Modules.h43
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Msg.h61
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Options.cpp468
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Options.h257
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Plugin.cpp80
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Plugin.h118
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/RangeSet.h330
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/RefCounted.h59
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/RefCountedBuffer.cpp53
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/RefCountedBuffer.h89
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Serializer.h197
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/SessionId.cpp47
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/SessionId.h59
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/SessionState.cpp278
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/SessionState.h219
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/SharedObject.h55
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/StringUtils.cpp50
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/StringUtils.h43
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Url.cpp212
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/Url.h92
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/Version.h44
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/acl/Acl.cpp164
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/acl/Acl.h85
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/acl/AclData.cpp162
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/acl/AclData.h73
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/acl/AclPlugin.cpp101
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/acl/AclReader.cpp511
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/acl/AclReader.h117
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/acl/management-schema.xml44
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgent.h162
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgentImpl.cpp906
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgentImpl.h237
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Array.cpp34
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Array.h124
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Body.h55
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Codec.h213
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Command.h62
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/CommmandPacker.h60
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp138
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Connection.h76
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Control.h70
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Decimal.h51
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Exception.h96
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/FrameHeader.cpp50
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/FrameHeader.h90
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Header.cpp34
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Header.h53
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Holder.h103
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Map.cpp66
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Map.h188
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Packer.h195
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SerializableString.h62
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp316
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.h114
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct.h60
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct32.cpp36
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct32.h64
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Unit.cpp65
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Unit.h82
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnitHandler.h35
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownStruct.cpp34
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownStruct.h55
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownType.cpp56
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownType.h87
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/apply.h86
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/built_in_types.h171
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/amqp_0_10/complex_types.cpp84
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/assert.cpp45
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/assert.h38
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/AclModule.h257
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Bridge.cpp294
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Bridge.h105
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Broker.cpp450
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Broker.h229
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/BrokerSingleton.cpp36
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/BrokerSingleton.h52
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Connection.cpp271
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Connection.h127
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/ConnectionFactory.cpp56
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/ConnectionFactory.h50
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp222
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/ConnectionHandler.h95
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/ConnectionState.h100
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/ConnectionToken.h40
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Consumer.h53
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Daemon.cpp212
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Daemon.h82
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Deliverable.h44
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DeliverableMessage.cpp43
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DeliverableMessage.h45
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DeliveryAdapter.h53
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DeliveryId.h35
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp214
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DeliveryRecord.h141
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DirectExchange.cpp190
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DirectExchange.h65
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DtxAck.cpp59
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DtxAck.h48
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DtxBuffer.cpp83
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DtxBuffer.h56
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DtxManager.cpp171
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DtxManager.h74
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DtxTimeout.cpp35
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DtxTimeout.h48
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp177
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/DtxWorkRecord.h79
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Exchange.cpp270
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Exchange.h178
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp109
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/ExchangeRegistry.h90
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/FanOutExchange.cpp148
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/FanOutExchange.h65
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/HandlerImpl.h53
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/HeadersExchange.cpp226
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/HeadersExchange.h88
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/IncompleteMessageList.cpp81
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/IncompleteMessageList.h57
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Link.cpp398
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Link.h136
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/LinkRegistry.cpp252
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/LinkRegistry.h123
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Message.cpp369
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Message.h185
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/MessageAdapter.cpp70
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/MessageAdapter.h58
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/MessageBuilder.cpp128
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/MessageBuilder.h57
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/MessageStore.h199
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp174
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/MessageStoreModule.h85
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/NameGenerator.cpp32
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/NameGenerator.h39
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/NullMessageStore.cpp166
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/NullMessageStore.h88
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/OwnershipToken.h38
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Persistable.h63
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/PersistableConfig.h45
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/PersistableExchange.h45
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/PersistableMessage.cpp143
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/PersistableMessage.h116
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/PersistableQueue.h87
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Queue.cpp900
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Queue.h287
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/QueueBindings.cpp46
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/QueueBindings.h61
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/QueueCleaner.cpp52
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/QueueCleaner.h57
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/QueueListeners.cpp73
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/QueueListeners.h68
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/QueuePolicy.cpp297
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/QueuePolicy.h109
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/QueueRegistry.cpp107
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/QueueRegistry.h134
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/QueuedMessage.h46
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RateTracker.cpp51
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RateTracker.h57
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoverableConfig.h45
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoverableExchange.h50
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoverableMessage.h58
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoverableQueue.h59
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoverableTransaction.h49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoveredDequeue.cpp40
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoveredDequeue.h57
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoveredEnqueue.cpp40
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoveredEnqueue.h58
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManager.h61
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp253
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.h59
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp337
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SaslAuthenticator.h55
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SemanticState.cpp669
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SemanticState.h232
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SessionAdapter.cpp749
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SessionAdapter.h260
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SessionContext.h52
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SessionHandler.cpp101
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SessionHandler.h81
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SessionManager.cpp104
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SessionManager.h87
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SessionState.cpp271
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SessionState.h144
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SignalHandler.cpp48
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/SignalHandler.h47
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/System.cpp82
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/System.h49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Timer.cpp104
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Timer.h79
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/TopicExchange.cpp313
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/TopicExchange.h110
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/TransactionalStore.h60
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/TxAccept.cpp99
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/TxAccept.h83
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/TxBuffer.cpp80
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/TxBuffer.h118
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/TxOp.h46
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/TxOpVisitor.h100
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/TxPublish.cpp80
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/TxPublish.h89
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Vhost.cpp48
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/Vhost.h49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/posix/BrokerDefaults.cpp30
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/windows/BrokerDefaults.cpp30
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/broker/windows/SaslAuthenticator.cpp175
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/AckMode.h53
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/AsyncSession.h38
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Bounds.cpp71
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Bounds.h49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/ChainableFrameHandler.h47
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Completion.h71
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Connection.cpp145
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Connection.h185
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/ConnectionAccess.h41
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/ConnectionHandler.cpp226
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/ConnectionHandler.h116
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/ConnectionImpl.cpp201
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/ConnectionImpl.h99
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/ConnectionSettings.cpp54
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/ConnectionSettings.h118
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Connector.cpp413
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Connector.h73
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Demux.cpp132
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Demux.h102
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Dispatcher.cpp144
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Dispatcher.h82
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Execution.h53
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/FailoverListener.cpp115
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/FailoverListener.h59
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/FailoverManager.cpp119
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/FailoverManager.h134
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/FlowControl.h75
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Future.cpp45
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Future.h64
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/FutureCompletion.cpp48
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/FutureCompletion.h49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/FutureResult.cpp43
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/FutureResult.h47
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Handle.h61
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/HandleAccess.h41
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/HandlePrivate.h61
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/LoadPlugins.cpp49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/LocalQueue.cpp77
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/LocalQueue.h115
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Message.cpp71
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Message.h151
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/MessageListener.cpp24
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/MessageListener.h100
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/MessageReplayTracker.cpp80
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/MessageReplayTracker.h73
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/QueueOptions.cpp116
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/QueueOptions.h104
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/RdmaConnector.cpp428
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Results.cpp76
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Results.h56
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Session.h39
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10.cpp77
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10.h118
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10Access.h42
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/SessionImpl.cpp695
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/SessionImpl.h219
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/SslConnector.cpp399
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/StateManager.cpp68
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/StateManager.h47
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Subscription.cpp50
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/Subscription.h113
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/SubscriptionImpl.cpp149
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/SubscriptionImpl.h109
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/SubscriptionManager.cpp140
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/SubscriptionManager.h293
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/SubscriptionSettings.h92
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/client/TypedResult.h65
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Cluster.cpp548
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Cluster.h230
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/ClusterLeaveException.h35
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/ClusterMap.cpp173
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/ClusterMap.h99
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp106
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Connection.cpp370
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Connection.h177
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp82
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionCodec.h80
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionMap.h90
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Cpg.cpp197
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Cpg.h169
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Dispatchable.h52
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/DumpClient.cpp369
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/DumpClient.h101
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Event.cpp89
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Event.h87
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/FailoverExchange.cpp99
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/FailoverExchange.h68
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Multicaster.cpp84
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Multicaster.h71
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/NoOpConnectionOutputHandler.h47
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp121
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/OutputInterceptor.h75
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/ProxyInputHandler.h57
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Quorum.h32
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_cman.cpp49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_cman.h50
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_null.h37
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/WriteEstimate.cpp64
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/WriteEstimate.h69
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/management-schema.xml57
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/cluster/types.h84
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Agent.cpp30
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Agent.h57
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Broker.cpp300
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Broker.h130
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/ClassKey.cpp104
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/ClassKey.h65
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/ConsoleListener.h96
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Event.cpp205
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Event.h83
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Object.cpp383
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Object.h119
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/ObjectId.cpp52
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/ObjectId.h60
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Package.cpp41
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Package.h76
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Schema.cpp155
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Schema.h105
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/SequenceManager.cpp48
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/SequenceManager.h53
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/SessionManager.cpp462
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/SessionManager.h199
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Value.cpp168
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/console/Value.h207
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQBody.cpp64
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQBody.h78
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQCommandControlBody.h70
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQContentBody.cpp44
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQContentBody.h53
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQDataBlock.h42
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQFrame.cpp124
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQFrame.h128
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQHeaderBody.cpp63
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQHeaderBody.h108
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.cpp29
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.h46
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp28
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQMethodBody.h72
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AMQP_HighestVersion.h40
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AccumulatedAck.cpp164
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/AccumulatedAck.h76
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Array.cpp129
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Array.h96
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Blob.cpp31
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Blob.h197
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/BodyHandler.cpp55
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/BodyHandler.h56
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/BodyHolder.cpp76
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/BodyHolder.h88
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Buffer.cpp319
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Buffer.h135
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/ChannelHandler.h53
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Endian.cpp52
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Endian.h46
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/FieldTable.cpp240
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/FieldTable.h120
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/FieldValue.cpp180
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/FieldValue.h320
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/FrameDecoder.cpp68
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/FrameDecoder.h44
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/FrameDefaultVisitor.h60
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/FrameHandler.h33
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/FrameSet.cpp90
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/FrameSet.h107
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Handler.h101
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/HeaderProperties.h44
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/InitiationHandler.cpp24
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/InitiationHandler.h41
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/InputHandler.h41
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Invoker.h86
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/MethodContent.h40
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/ModelMethod.h49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/OutputHandler.h42
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/ProtocolInitiation.cpp66
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/ProtocolInitiation.h58
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/ProtocolVersion.cpp44
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/ProtocolVersion.h57
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Proxy.cpp42
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Proxy.h54
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/SendContent.cpp69
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/SendContent.h55
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumber.cpp110
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumber.h75
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumberSet.cpp89
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumberSet.h68
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/SequenceSet.cpp100
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/SequenceSet.h68
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/StructHelper.h56
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/TemplateVisitor.h89
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/TransferContent.cpp102
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/TransferContent.h63
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/TypeFilter.h51
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Uuid.cpp61
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Uuid.h88
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/Visitor.h92
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/amqp_framing.h32
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/amqp_types.h63
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/amqp_types_full.h38
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/frame_functors.h116
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/framing/variant.h91
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/Helpers.h79
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/Logger.cpp168
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/Logger.h113
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/Options.cpp107
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/Options.h49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/OstreamOutput.cpp41
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/OstreamOutput.h41
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/Selector.cpp67
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/Selector.h70
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/SinkOptions.h64
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/Statement.cpp83
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/Statement.h121
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/posix/SinkOptions.cpp211
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/posix/SinkOptions.h64
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/windows/SinkOptions.cpp148
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/log/windows/SinkOptions.h54
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/management/Args.h44
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/management/Manageable.cpp48
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/management/Manageable.h71
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/management/ManagementBroker.cpp1138
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/management/ManagementBroker.h235
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/management/ManagementEvent.h49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/management/ManagementExchange.cpp72
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/management/ManagementExchange.h62
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/management/ManagementObject.cpp183
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/management/ManagementObject.h188
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/memory.h32
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/pointer_to_other.h62
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/ptr_map.h57
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/shared_ptr.h51
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ActivityTimer.h106
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/AggregateOutput.cpp73
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/AggregateOutput.h65
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/AsynchIO.h152
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp199
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/AsynchIOHandler.h79
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/AtomicCount.h52
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue.h34
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue_gcc.h68
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue_mutex.h83
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/BlockingQueue.h125
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Condition.h33
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ConnectionCodec.h78
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ConnectionInputHandler.h44
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ConnectionInputHandlerFactory.h54
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ConnectionOutputHandler.h43
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ConnectionOutputHandlerPtr.h55
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/CopyOnWriteArray.h126
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/DeletionManager.h138
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/DispatchHandle.cpp409
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/DispatchHandle.h146
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Dispatcher.cpp59
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Dispatcher.h43
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ExceptionHolder.h75
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/FileSysDir.h62
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Fork.h24
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/IOHandle.h59
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/IntegerTypes.h31
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/LockFile.h80
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/LockPtr.h89
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Monitor.h49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Mutex.h91
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/OutputControl.h42
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/OutputTask.h48
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/PollableCondition.h28
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/PollableQueue.h152
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Poller.h109
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ProtocolFactory.h58
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp356
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Runnable.cpp32
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Runnable.h50
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ScopedIncrement.h67
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Semaphore.h67
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Shlib.cpp38
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Shlib.h75
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ShutdownHandler.h37
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Socket.h110
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/SslPlugin.cpp184
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/StateMonitor.h78
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/StrError.h35
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/SystemInfo.h79
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp146
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Thread.h62
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Time.h168
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/TimeoutHandler.h39
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/Waitable.h114
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/apr/APRBase.cpp89
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/apr/APRBase.h74
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/apr/APRPool.cpp41
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/apr/APRPool.h50
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/apr/Condition.h84
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/apr/Mutex.h124
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/apr/Shlib.cpp49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/apr/Socket.cpp114
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/apr/Thread.cpp34
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/apr/Thread.h106
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/apr/Time.cpp36
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp371
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp595
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/Condition.h86
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/posix/FileSysDir.cpp54
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/Fork.cpp127
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/Fork.h82
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/IOHandle.cpp42
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/posix/IntegerTypes.h26
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/posix/LockFile.cpp89
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/Mutex.cpp46
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/Mutex.h158
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/PollableCondition.cpp96
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/PollableCondition.h56
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/PrivatePosix.h52
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/Shlib.cpp59
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/Socket.cpp264
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/StrError.cpp41
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp109
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/Thread.cpp75
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/Time.cpp110
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/posix/Time.h34
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/posix/check.h49
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaClient.cpp207
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp617
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h222
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaServer.cpp167
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_exception.h65
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_factories.cpp64
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_factories.h69
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.cpp183
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.h498
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/solaris/ECFPoller.cpp301
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslHandler.cpp181
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslHandler.h76
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslIo.cpp433
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslIo.h167
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslSocket.cpp279
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslSocket.h117
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ssl/check.cpp72
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ssl/check.h53
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ssl/util.cpp118
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/ssl/util.h50
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/uuid.h28
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp741
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/AsynchIoResult.h185
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/Condition.h80
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/windows/FileSysDir.cpp53
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/IOHandle.cpp42
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/IntegerTypes.h40
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/IoHandlePrivate.h52
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/IocpDispatcher.cpp54
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp176
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/LockFile.cpp83
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/Mutex.h188
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/windows/Shlib.cpp53
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/Socket.cpp329
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/StrError.cpp47
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/SystemInfo.cpp160
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/Thread.cpp88
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/windows/Time.cpp90
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/windows/Time.h36
-rwxr-xr-xM4-RCs/qpid/cpp/src/qpid/sys/windows/check.h48
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/windows/uuid.cpp54
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/sys/windows/uuid.h41
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/xml/XmlBinding.h37
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/xml/XmlExchange.cpp263
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/xml/XmlExchange.h88
-rw-r--r--M4-RCs/qpid/cpp/src/qpid/xml/XmlExchangePlugin.cpp67
-rw-r--r--M4-RCs/qpid/cpp/src/qpidd.cpp83
-rw-r--r--M4-RCs/qpid/cpp/src/qpidd.h70
-rw-r--r--M4-RCs/qpid/cpp/src/ssl.mk64
-rw-r--r--M4-RCs/qpid/cpp/src/tests/.valgrind.supp203
-rw-r--r--M4-RCs/qpid/cpp/src/tests/AccumulatedAckTest.cpp232
-rw-r--r--M4-RCs/qpid/cpp/src/tests/Array.cpp79
-rw-r--r--M4-RCs/qpid/cpp/src/tests/AsyncCompletion.cpp100
-rw-r--r--M4-RCs/qpid/cpp/src/tests/AtomicValue.cpp49
-rw-r--r--M4-RCs/qpid/cpp/src/tests/BasicP2PTest.cpp66
-rw-r--r--M4-RCs/qpid/cpp/src/tests/BasicP2PTest.h46
-rw-r--r--M4-RCs/qpid/cpp/src/tests/BasicPubSubTest.cpp121
-rw-r--r--M4-RCs/qpid/cpp/src/tests/BasicPubSubTest.h51
-rw-r--r--M4-RCs/qpid/cpp/src/tests/Blob.cpp128
-rw-r--r--M4-RCs/qpid/cpp/src/tests/BrokerFixture.h130
-rw-r--r--M4-RCs/qpid/cpp/src/tests/ClientSessionTest.cpp452
-rw-r--r--M4-RCs/qpid/cpp/src/tests/ConnectionOptions.h54
-rw-r--r--M4-RCs/qpid/cpp/src/tests/ConsoleTest.cpp43
-rw-r--r--M4-RCs/qpid/cpp/src/tests/DeliveryRecordTest.cpp62
-rw-r--r--M4-RCs/qpid/cpp/src/tests/DispatcherTest.cpp128
-rw-r--r--M4-RCs/qpid/cpp/src/tests/DtxWorkRecordTest.cpp189
-rw-r--r--M4-RCs/qpid/cpp/src/tests/ExchangeTest.cpp284
-rw-r--r--M4-RCs/qpid/cpp/src/tests/FieldTable.cpp178
-rw-r--r--M4-RCs/qpid/cpp/src/tests/FieldValue.cpp90
-rw-r--r--M4-RCs/qpid/cpp/src/tests/ForkedBroker.h122
-rw-r--r--M4-RCs/qpid/cpp/src/tests/Frame.cpp80
-rw-r--r--M4-RCs/qpid/cpp/src/tests/FramingTest.cpp151
-rw-r--r--M4-RCs/qpid/cpp/src/tests/HeaderTest.cpp110
-rw-r--r--M4-RCs/qpid/cpp/src/tests/HeadersExchangeTest.cpp115
-rw-r--r--M4-RCs/qpid/cpp/src/tests/IncompleteMessageList.cpp128
-rw-r--r--M4-RCs/qpid/cpp/src/tests/InlineAllocator.cpp63
-rw-r--r--M4-RCs/qpid/cpp/src/tests/InlineVector.cpp119
-rw-r--r--M4-RCs/qpid/cpp/src/tests/Makefile.am245
-rw-r--r--M4-RCs/qpid/cpp/src/tests/ManagementTest.cpp85
-rw-r--r--M4-RCs/qpid/cpp/src/tests/MessageBuilderTest.cpp224
-rw-r--r--M4-RCs/qpid/cpp/src/tests/MessageReplayTracker.cpp99
-rw-r--r--M4-RCs/qpid/cpp/src/tests/MessageTest.cpp90
-rw-r--r--M4-RCs/qpid/cpp/src/tests/MessageUtils.h55
-rw-r--r--M4-RCs/qpid/cpp/src/tests/PollerTest.cpp164
-rw-r--r--M4-RCs/qpid/cpp/src/tests/QueueOptionsTest.cpp98
-rw-r--r--M4-RCs/qpid/cpp/src/tests/QueuePolicyTest.cpp274
-rw-r--r--M4-RCs/qpid/cpp/src/tests/QueueRegistryTest.cpp94
-rw-r--r--M4-RCs/qpid/cpp/src/tests/QueueTest.cpp501
-rw-r--r--M4-RCs/qpid/cpp/src/tests/README54
-rw-r--r--M4-RCs/qpid/cpp/src/tests/RangeSet.cpp141
-rw-r--r--M4-RCs/qpid/cpp/src/tests/RefCounted.cpp50
-rw-r--r--M4-RCs/qpid/cpp/src/tests/SequenceNumberTest.cpp205
-rw-r--r--M4-RCs/qpid/cpp/src/tests/SequenceSet.cpp140
-rw-r--r--M4-RCs/qpid/cpp/src/tests/SessionState.cpp300
-rw-r--r--M4-RCs/qpid/cpp/src/tests/Shlib.cpp60
-rw-r--r--M4-RCs/qpid/cpp/src/tests/SimpleTestCaseBase.cpp87
-rw-r--r--M4-RCs/qpid/cpp/src/tests/SimpleTestCaseBase.h89
-rw-r--r--M4-RCs/qpid/cpp/src/tests/SocketProxy.h143
-rw-r--r--M4-RCs/qpid/cpp/src/tests/StringUtils.cpp77
-rw-r--r--M4-RCs/qpid/cpp/src/tests/TestCase.h64
-rw-r--r--M4-RCs/qpid/cpp/src/tests/TestMessageStore.h58
-rw-r--r--M4-RCs/qpid/cpp/src/tests/TestOptions.h79
-rw-r--r--M4-RCs/qpid/cpp/src/tests/TimerTest.cpp120
-rw-r--r--M4-RCs/qpid/cpp/src/tests/TopicExchangeTest.cpp167
-rw-r--r--M4-RCs/qpid/cpp/src/tests/TxBufferTest.cpp176
-rw-r--r--M4-RCs/qpid/cpp/src/tests/TxMocks.h229
-rw-r--r--M4-RCs/qpid/cpp/src/tests/TxPublishTest.cpp94
-rw-r--r--M4-RCs/qpid/cpp/src/tests/Url.cpp67
-rw-r--r--M4-RCs/qpid/cpp/src/tests/Uuid.cpp79
-rw-r--r--M4-RCs/qpid/cpp/src/tests/XmlClientSessionTest.cpp221
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/acl.py459
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/ais_check56
-rw-r--r--M4-RCs/qpid/cpp/src/tests/ais_test.cpp23
-rw-r--r--M4-RCs/qpid/cpp/src/tests/allSegmentTypes.h128
-rw-r--r--M4-RCs/qpid/cpp/src/tests/amqp_0_10/Map.cpp98
-rw-r--r--M4-RCs/qpid/cpp/src/tests/amqp_0_10/ProxyTemplate.cpp49
-rw-r--r--M4-RCs/qpid/cpp/src/tests/amqp_0_10/apply.cpp99
-rw-r--r--M4-RCs/qpid/cpp/src/tests/amqp_0_10/handlers.cpp125
-rw-r--r--M4-RCs/qpid/cpp/src/tests/amqp_0_10/serialize.cpp429
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/benchmark95
-rw-r--r--M4-RCs/qpid/cpp/src/tests/client_test.cpp149
-rw-r--r--M4-RCs/qpid/cpp/src/tests/cluster.mk41
-rw-r--r--M4-RCs/qpid/cpp/src/tests/cluster_test.cpp648
-rw-r--r--M4-RCs/qpid/cpp/src/tests/config.null1
-rw-r--r--M4-RCs/qpid/cpp/src/tests/consume.cpp119
-rw-r--r--M4-RCs/qpid/cpp/src/tests/declare_queues.cpp69
-rw-r--r--M4-RCs/qpid/cpp/src/tests/dlclose_noop.c30
-rw-r--r--M4-RCs/qpid/cpp/src/tests/echotest.cpp150
-rw-r--r--M4-RCs/qpid/cpp/src/tests/exception_test.cpp121
-rw-r--r--M4-RCs/qpid/cpp/src/tests/failover_soak.cpp654
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/fanout_perftest22
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/federated_topic_test130
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/federation.py505
-rw-r--r--M4-RCs/qpid/cpp/src/tests/header_test.cpp59
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/header_test.py86
-rw-r--r--M4-RCs/qpid/cpp/src/tests/interop_runner.cpp251
-rw-r--r--M4-RCs/qpid/cpp/src/tests/latencytest.cpp432
-rw-r--r--M4-RCs/qpid/cpp/src/tests/logging.cpp366
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/multiq_perftest22
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/perfdist87
-rw-r--r--M4-RCs/qpid/cpp/src/tests/perftest.cpp701
-rw-r--r--M4-RCs/qpid/cpp/src/tests/policy.acl1
-rw-r--r--M4-RCs/qpid/cpp/src/tests/publish.cpp128
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/python_tests39
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/quick_perftest22
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/quick_topictest30
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/quick_txtest22
-rw-r--r--M4-RCs/qpid/cpp/src/tests/receiver.cpp129
-rw-r--r--M4-RCs/qpid/cpp/src/tests/replaying_sender.cpp131
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/restart_cluster38
-rw-r--r--M4-RCs/qpid/cpp/src/tests/resuming_receiver.cpp163
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/run-unit-tests48
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/run_acl_tests64
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/run_failover_soak56
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/run_federation_tests52
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/run_header_test37
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/run_perftest28
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/run_test78
-rw-r--r--M4-RCs/qpid/cpp/src/tests/sender.cpp100
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/shared_perftest22
-rw-r--r--M4-RCs/qpid/cpp/src/tests/shlibtest.cpp28
-rw-r--r--M4-RCs/qpid/cpp/src/tests/ssl.mk23
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/ssl_test71
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/start_broker24
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/start_cluster46
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/start_cluster_hosts70
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/stop_broker41
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/stop_cluster33
-rw-r--r--M4-RCs/qpid/cpp/src/tests/test_tools.h94
-rw-r--r--M4-RCs/qpid/cpp/src/tests/topic_listener.cpp202
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/topic_perftest22
-rw-r--r--M4-RCs/qpid/cpp/src/tests/topic_publisher.cpp224
-rwxr-xr-xM4-RCs/qpid/cpp/src/tests/topictest61
-rw-r--r--M4-RCs/qpid/cpp/src/tests/txjob.cpp95
-rw-r--r--M4-RCs/qpid/cpp/src/tests/txshift.cpp185
-rw-r--r--M4-RCs/qpid/cpp/src/tests/txtest.cpp329
-rw-r--r--M4-RCs/qpid/cpp/src/tests/unit_test.cpp23
-rw-r--r--M4-RCs/qpid/cpp/src/tests/unit_test.h86
-rw-r--r--M4-RCs/qpid/cpp/src/tests/vg_check24
-rw-r--r--M4-RCs/qpid/cpp/src/windows/QpiddBroker.cpp89
-rw-r--r--M4-RCs/qpid/cpp/src/xml.mk28
-rwxr-xr-xM4-RCs/qpid/cpp/versions12
-rw-r--r--M4-RCs/qpid/cpp/xml/cluster.xml143
-rw-r--r--M4-RCs/qpid/cpp/xml/extra.xml926
-rw-r--r--M4-RCs/qpid/dotnet/LICENSE.txt757
-rw-r--r--M4-RCs/qpid/dotnet/NOTICE.txt32
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs56
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj83
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/SimpleByteBufferTests.cs333
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/SlicedByteBufferTests.cs133
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/default.build48
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs41
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs42
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer/ByteBuffer.cs982
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer/ByteBufferHexDumper.cs79
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer/IByteBufferAllocator.cs50
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs53
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer/Qpid.Buffer.csproj77
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer/SimpleByteBuffer.cs120
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer/SimpleByteBufferAllocator.cs58
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer/SlicedByteBuffer.cs86
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Buffer/default.build46
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/App.config34
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/BrokerDetails/BrokerDetailsTest.cs65
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/Channel/ChannelMessageCreationTests.cs79
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/Messages/MessageFactoryRegistryTests.cs114
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/Properties/AssemblyInfo.cs53
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj158
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs66
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/default.build64
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/interop/TopicListener.cs211
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs208
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit-licence.txt23
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dllbin45056 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/log4net.config68
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Tests/url/ConnectionUrlTest.cs446
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.cs135
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketTransport.cs121
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/ByteChannel.cs63
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Properties/AssemblyInfo.cs53
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj92
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.mdp30
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQAuthenticationException.cs39
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQConnection.cs873
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs38
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQDestination.cs234
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQNoConsumersException.cs45
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQNoRouteException.cs46
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs322
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/AmqChannel.cs1198
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs477
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/BasicMessageProducer.cs405
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Closeable.cs83
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Configuration/AuthenticationConfigurationSectionHandler.cs84
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/ConnectionTuneParameters.cs83
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs42
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverHandler.cs175
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverState.cs31
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverSupport.cs55
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/BasicDeliverMethodHandler.cs42
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/BasicReturnMethodHandler.cs44
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs68
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseMethodHandler.cs68
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseOkHandler.cs41
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionOpenOkMethodHandler.cs35
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionRedirectMethodHandler.cs68
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionSecureMethodHandler.cs60
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.cs144
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionTuneMethodHandler.cs63
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/QueueDeleteOkMethodHandler.cs44
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/QueuePurgeOkMethodHandler.cs44
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AMQMessage.cs58
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AMQMessageFactory.cs73
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs694
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/IMessageFactory.cs52
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/MessageFactoryRegistry.cs129
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs353
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessageFactory.cs75
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs233
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessage.cs115
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs40
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs57
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/UnprocessedMessage.cs57
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQMethodEvent.cs76
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs318
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs267
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/DefaultTimeouts.cs47
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/IConnectionCloser.cs27
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/IProtocolListener.cs36
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/BlockingMethodFrameListener.cs110
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/IAMQMethodListener.cs46
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/SpecificMethodFrameListener.cs42
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/ProtocolWriter.cs107
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/QpidConnectionInfo.cs504
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/CallbackHandlerRegistry.cs127
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/IAMQCallbackHandler.cs35
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/UsernamePasswordCallbackHandler.cs56
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/SslOptions.cs81
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQState.cs35
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQStateChangedEvent.cs52
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQStateManager.cs251
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IAMQStateListener.cs29
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IStateAwareMethodListener.cs31
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IStateListener.cs33
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs74
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/State/StateWaiter.cs121
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/AMQProtocolProvider.cs47
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/AmqpChannel.cs111
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IByteChannel.cs71
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolChannel.cs32
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolWriter.cs29
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IStreamFilter.cs38
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/ITransport.cs32
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IoHandler.cs322
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/ProtocolDecoderOutput.cs60
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/SingleProtocolEncoderOutput.cs40
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/BlockingSocketTransport.cs150
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ByteChannel.cs92
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ISocketConnector.cs34
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SocketConnector.cs71
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SslSocketConnector.cs107
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Client/Util/FlowControlQueue.cs98
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Properties/AssemblyInfo.cs52
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/Qpid.Client.csproj102
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/default.build52
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/qms/BrokerInfo.cs55
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/qms/ConnectionInfo.cs63
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/qms/FailoverPolicy.cs315
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/qms/UrlSyntaxException.cs134
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverMethod.cs78
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverRoundRobin.cs255
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverSingleServer.cs147
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs152
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs387
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs56
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs32
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs48
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs32
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs29
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolCodecFactory.cs37
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolDecoder.cs41
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolDecoderOutput.cs35
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolEncoder.cs41
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolEncoderOutput.cs37
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs53
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolCodecException.cs49
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolDecoderException.cs70
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolEncoderException.cs49
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/Qpid.Codec.csproj82
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs44
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs43
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Codec/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common.Tests/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid.Common.Tests.csproj87
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Collections/TestConsumerProducerQueue.cs85
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Collections/TestLinkedHashtable.cs83
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Framing/TestAMQType.cs270
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Framing/TestEncodingUtils.cs60
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common.Tests/default.build52
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/AMQChannelClosedException.cs40
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/AMQConnectionClosedException.cs51
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/AMQDisconnectedException.cs45
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/AMQException.cs149
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/AMQInvalidArgumentException.cs46
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/AMQInvalidRoutingKeyException.cs46
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/AMQUndeliveredException.cs59
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/AssemblySettings.cs160
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Collections/BlockingQueue.cs95
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Collections/ConsumerProducerQueue.cs113
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Collections/LinkedBlockingQueue.cs384
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Collections/LinkedHashtable.cs327
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Collections/SynchronousQueue.cs375
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQDataBlockDecoder.cs155
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQDataBlockEncoder.cs65
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQFrame.cs107
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQFrameDecodingException.cs59
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQMethodBody.cs93
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQMethodBodyFactory.cs45
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQProtocolHeaderException.cs39
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQType.cs700
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQTypeMap.cs75
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQTypedValue.cs76
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/BasicContentHeaderProperties.cs290
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/CompositeAMQDataBlock.cs85
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentBody.cs100
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentBodyFactory.cs53
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderBody.cs118
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderBodyFactory.cs53
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderPropertiesFactory.cs63
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/EncodingUtils.cs460
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/FieldTable.cs633
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/HeartbeatBody.cs64
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/HeartbeatBodyFactory.cs32
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/IBody.cs63
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/IBodyFactory.cs38
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/IContentHeaderProperties.cs65
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/IDataBlock.cs47
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/IEncodableAMQDataBlock.cs31
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Framing/ProtocolInitiation.cs158
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Properties/AssemblyInfo.cs52
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Protocol/AMQConstant.cs100
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/Qpid.Common.csproj104
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/amqp.xml3929
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/build.xml95
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/default.build49
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net-licence.txt201
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net.dllbin266240 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net.xml28676
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/lib/saxon/saxon-licence.txt471
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/lib/saxon/saxon8.jarbin3118502 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/lib/seclib-1.0.0/Org.Mentalis.Security.dllbin184320 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/lib/seclib-1.0.0/seclib-license.txt13
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/resources/registry.template4
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/csharp.xsl251
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/framing.xsl65
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/java.xsl230
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare1.xsl109
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare2.xsl68
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare3.xsl64
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/readme.txt52
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/registry.xsl33
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/utils.xsl185
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/Properties/AssemblyInfo.cs53
-rwxr-xr-xM4-RCs/qpid/dotnet/Qpid.Integration.Tests/Qpid.Integration.Tests.csproj124
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/README.txt3
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/default.build69
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.cs39
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.csx39
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/AssertionBase.csx65
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/BrokerLifecycleAware.csx67
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CauseFailure.csx41
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CauseFailureUserPrompt.csx63
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.cs102
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.csx103
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CircuitEnd.csx86
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CircuitEndBase.csx146
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/ExceptionMonitor.csx184
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.cs282
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.csx272
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/LocalCircuitFactory.csx301
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/MessageMonitor.csx102
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/MessagingTestConfigProperties.csx652
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/NotApplicableAssertion.csx111
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.cs65
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.csx72
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/README.txt3
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.cs80
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.csx88
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.cs84
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.csx82
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestModel.cs657
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestUtils.csx188
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/alljava.csx7851
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchFailureException.csx45
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchThread.csx117
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchronizer.csx66
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/LocalClockSynchronizer.csx70
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/UDPClockSynchronizer.csx453
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClient.csx493
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClientCircuitEnd.csx312
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClientControlledTest.csx104
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalCircuitImpl.csx290
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalPublisherImpl.csx164
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalReceiverImpl.csx137
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/BaseCircuitFactory.csx128
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.cs85
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.csx99
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interactive/FailoverTest.cs397
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interactive/SendReceiveTest.cs181
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/InteropClientTestCase.cs87
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase1DummyRun.cs89
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase2BasicP2P.cs205
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase3BasicPubSub.cs244
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestClient.cs379
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/log4net.config69
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/old/ServiceProvidingClient.tmp150
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/old/ServiceRequestingClient.tmp182
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/BaseMessagingTestFixture.cs261
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ChannelQueueTest.cs237
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/CommitRollbackTest.cs261
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ConnectionTest.cs73
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/DurableSubscriptionTest.cs166
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/HeadersExchangeTest.cs282
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/MandatoryMessageTest.cs149
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs167
-rwxr-xr-xM4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/Qpid.Integration.Tests.csproj63
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/SslConnectionTest.cs64
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/SustainedTest.cs109
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/AcknowledgeMode.cs42
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/ChannelLimitReachedException.cs60
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/DeliveryMode.cs28
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/ExchangeClassConstants.cs29
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/ExchangeNameDefaults.cs42
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/IBytesMessage.cs63
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/IChannel.cs252
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/ICloseable.cs38
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/IConnection.cs55
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/IConnectionFactory.cs28
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/IConnectionListener.cs59
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/IFieldTable.cs42
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/IHeaders.cs67
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/IMessage.cs97
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/IMessageConsumer.cs79
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/IMessagePublisher.cs92
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/ITextMessage.cs27
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs105
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/MessageNotReadableException.cs39
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/MessageNotWritableException.cs38
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/MessagePublisherBuilder.cs91
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/Properties/AssemblyInfo.cs56
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/Qpid.Messaging.csproj115
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/QpidException.cs43
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/ResourceAllocationException.cs39
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Messaging/default.build45
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.NET.FxCop16755
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.NET.sln96
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/App.config33
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/AnonymousSaslClientTests.cs72
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/CramMD5SaslClientTests.cs90
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/DigestSaslClientTests.cs249
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/ExternalSaslClientTests.cs71
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/PlainSaslClientTests.cs88
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Properties/AssemblyInfo.cs56
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Qpid.Sasl.Tests.csproj86
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/SaslTests.cs133
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/TestClientFactory.cs75
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/default.build52
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/Callbacks.cs106
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/Configuration/SaslConfiguration.cs90
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/Configuration/SaslConfigurationSectionHandler.cs84
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/DefaultClientFactory.cs95
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslCallbackHandler.cs35
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslClient.cs42
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslClientFactory.cs40
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/MD5HMAC.cs115
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/AnonymousSaslClient.cs69
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/CramMD5SaslClient.cs91
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/DigestSaslClient.cs576
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/ExternalSaslClient.cs69
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/PlainSaslClient.cs81
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/Properties/AssemblyInfo.cs57
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/Qpid.Sasl.csproj73
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/Sasl.cs115
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/SaslClient.cs145
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/SaslException.cs56
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/SaslProperties.cs42
-rw-r--r--M4-RCs/qpid/dotnet/Qpid.Sasl/default.build45
-rw-r--r--M4-RCs/qpid/dotnet/README.txt68
-rw-r--r--M4-RCs/qpid/dotnet/RELEASE_NOTES.txt26
-rw-r--r--M4-RCs/qpid/dotnet/TestClient/Program.cs30
-rw-r--r--M4-RCs/qpid/dotnet/TestClient/Properties/AssemblyInfo.cs53
-rw-r--r--M4-RCs/qpid/dotnet/TestClient/TestClient.csproj115
-rw-r--r--M4-RCs/qpid/dotnet/TestClient/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/TopicListener/Program.cs30
-rw-r--r--M4-RCs/qpid/dotnet/TopicListener/Properties/AssemblyInfo.cs53
-rw-r--r--M4-RCs/qpid/dotnet/TopicListener/TopicListener.csproj115
-rw-r--r--M4-RCs/qpid/dotnet/TopicListener/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/TopicPublisher/Program.cs30
-rw-r--r--M4-RCs/qpid/dotnet/TopicPublisher/Properties/AssemblyInfo.cs53
-rw-r--r--M4-RCs/qpid/dotnet/TopicPublisher/TopicPublisher.csproj111
-rw-r--r--M4-RCs/qpid/dotnet/TopicPublisher/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/build-framing.bat23
-rwxr-xr-xM4-RCs/qpid/dotnet/build-mono3
-rw-r--r--M4-RCs/qpid/dotnet/build-msbuild.bat22
-rwxr-xr-xM4-RCs/qpid/dotnet/build-nant-release55
-rw-r--r--M4-RCs/qpid/dotnet/build-nant.bat22
-rw-r--r--M4-RCs/qpid/dotnet/client-010/LICENSE.txt757
-rw-r--r--M4-RCs/qpid/dotnet/client-010/NOTICE.txt32
-rw-r--r--M4-RCs/qpid/dotnet/client-010/README.txt67
-rw-r--r--M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/Excel.exe.config12
-rw-r--r--M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs290
-rw-r--r--M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj67
-rw-r--r--M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/Properties/AssemblyInfo.cs56
-rw-r--r--M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj61
-rw-r--r--M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs44
-rw-r--r--M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs56
-rw-r--r--M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj57
-rw-r--r--M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/Program.cs55
-rw-r--r--M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/client-010/addins/README.txt29
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/Client.csproj55
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/Properties/AssemblyInfo.cs56
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client.sln104
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client.suobin572416 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client/Client.cs145
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client/ClientConnectionDelegate.cs97
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client/ClientInterface.cs59
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client/ClientSession.cs110
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client/ClientSessionDelegate.cs55
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client/ClosedListenerInterface.cs29
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client/ErrorCode.cs140
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client/IMessage.cs48
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client/Message.cs131
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs31
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/default.build46
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Binary.cs129
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Binding.cs34
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Channel.cs174
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs41
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/ClientDelegate.cs35
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Connection.cs172
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/ConnectionDelegate.cs108
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Field.cs75
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Future.cs38
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Header.cs83
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Method.cs150
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolDelegate.cs37
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolError.cs86
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolEvent.cs42
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolHeader.cs125
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Range.cs117
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/RangeSet.cs150
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/ReceivedPayload.cs43
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Receiver.cs38
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Sender.cs32
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Session.cs522
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/SessionDelegate.cs126
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/Struct.cs122
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/codec/AbstractDecoder.cs392
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/codec/AbstractEncoder.cs583
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/codec/Decoder.cs65
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/codec/Encodable.cs37
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/codec/Encoder.cs62
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/codec/MSDecoder.cs82
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/codec/MSEncoder.cs141
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/exception/ConnectionException.cs49
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs41
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/exception/ProtocolVersionException.cs59
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/exception/SessionClosedException.cs38
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/exception/SessionException.cs45
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/exception/TransportException.cs46
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/Assembler.cs282
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/Disassembler.cs222
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/Frame.cs143
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/IIoSender.cs28
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/InputHandler.cs282
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/NetworkDelegate.cs40
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/NetworkEvent.cs32
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IIoTransport.cs57
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoReceiver.cs189
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoSSLTransport.cs194
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoSender.cs134
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoTransport.cs143
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/util/ByteEncoder.cs193
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/util/CircularBuffer.cs132
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/util/Functions.cs41
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/util/Logger.cs114
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/util/ResultFuture.cs80
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/util/Serial.cs94
-rw-r--r--M4-RCs/qpid/dotnet/client-010/client/transport/util/UUID.cs88
-rw-r--r--M4-RCs/qpid/dotnet/client-010/default.build274
-rw-r--r--M4-RCs/qpid/dotnet/client-010/demo/Demo.csproj84
-rw-r--r--M4-RCs/qpid/dotnet/client-010/demo/Program.cs117
-rw-r--r--M4-RCs/qpid/dotnet/client-010/demo/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/client-010/demo/Properties/Resources.Designer.cs63
-rw-r--r--M4-RCs/qpid/dotnet/client-010/demo/Properties/Resources.resx117
-rw-r--r--M4-RCs/qpid/dotnet/client-010/demo/Properties/Settings.Designer.cs26
-rw-r--r--M4-RCs/qpid/dotnet/client-010/demo/Properties/Settings.settings7
-rw-r--r--M4-RCs/qpid/dotnet/client-010/demo/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/Listener.cs112
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/example-direct-Listener.csproj59
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/Producer.cs87
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/example-direct-producer.csproj59
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify37
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify.in14
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_cpp_dotnet10
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_cpp_dotnet.in14
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_cpp10
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_cpp.in15
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_java15
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_java.in20
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_python10
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_python.in14
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_java_dotnet15
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_java_dotnet.in29
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_python_dotnet10
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/direct/verify_python_dotnet.in14
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/Listener.cs121
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/example-fanout-Listener.csproj59
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/Producer.cs84
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/example-fanout-Producer.csproj59
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify36
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify.in14
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_cpp_dotnet11
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_cpp_dotnet.in14
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_cpp12
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_cpp.in15
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_java16
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_java.in19
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_python11
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_python.in14
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_java_dotnet16
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_java_dotnet.in29
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_python_dotnet11
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_python_dotnet.in14
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/Listener.cs138
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/example-pub-sub-Listener.csproj59
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/Publisher.cs93
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/example-pub-sub-Publisher.csproj59
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify36
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify.in95
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_cpp_dotnet12
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_cpp_dotnet.in55
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_cpp11
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_cpp.in99
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_java15
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_java.in95
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_python11
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_python.in95
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_java_dotnet15
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_java_dotnet.in95
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_python_dotnet11
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_python_dotnet.in55
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/Client.cs137
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/example-request-response-Client.csproj59
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/Server.cs136
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/default.build47
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/example-request-response-Server.csproj59
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify36
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify.in16
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_cpp_dotnet12
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_cpp_dotnet.in17
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_cpp12
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_cpp.in18
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_java16
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_java.in21
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_python12
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_python.in17
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_java_dotnet15
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_java_dotnet.in36
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_python_dotnet12
-rw-r--r--M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_python_dotnet.in12
-rw-r--r--M4-RCs/qpid/dotnet/client-010/gentool/Composite.tpl294
-rw-r--r--M4-RCs/qpid/dotnet/client-010/gentool/Constant.tpl37
-rw-r--r--M4-RCs/qpid/dotnet/client-010/gentool/Enum.tpl38
-rw-r--r--M4-RCs/qpid/dotnet/client-010/gentool/Invoker.tpl67
-rw-r--r--M4-RCs/qpid/dotnet/client-010/gentool/MethodDelegate.tpl35
-rw-r--r--M4-RCs/qpid/dotnet/client-010/gentool/Option.tpl42
-rw-r--r--M4-RCs/qpid/dotnet/client-010/gentool/StructFactory.tpl64
-rw-r--r--M4-RCs/qpid/dotnet/client-010/gentool/Type.tpl103
-rw-r--r--M4-RCs/qpid/dotnet/client-010/gentool/build.xml52
-rw-r--r--M4-RCs/qpid/dotnet/client-010/gentool/codegen85
-rw-r--r--M4-RCs/qpid/dotnet/client-010/gentool/dotnetgenutil.py273
-rw-r--r--M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net-licence.txt201
-rw-r--r--M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net.dllbin266240 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net.xml28676
-rw-r--r--M4-RCs/qpid/dotnet/client-010/lib/nunit/nunit-licence.txt23
-rw-r--r--M4-RCs/qpid/dotnet/client-010/lib/nunit/nunit.framework.dllbin45056 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/client-010/lib/plossum/C5-License.txt27
-rw-r--r--M4-RCs/qpid/dotnet/client-010/lib/plossum/C5.dllbin274432 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/client-010/lib/plossum/Plossum CommandLine.dllbin98304 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/client-010/lib/plossum/license.txt28
-rw-r--r--M4-RCs/qpid/dotnet/client-010/log.xml46
-rw-r--r--M4-RCs/qpid/dotnet/client-010/perftest/PerfTest.cs705
-rw-r--r--M4-RCs/qpid/dotnet/client-010/perftest/Properties/AssemblyInfo.cs54
-rw-r--r--M4-RCs/qpid/dotnet/client-010/perftest/README.txt38
-rw-r--r--M4-RCs/qpid/dotnet/client-010/perftest/default.build50
-rw-r--r--M4-RCs/qpid/dotnet/client-010/perftest/perftest.csproj67
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/Properties/AssemblyInfo.cs56
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/Test.csproj75
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/default.build55
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/interop/Admin.cs90
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/interop/ApplicationHeaders.cs83
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/interop/Message.cs179
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/interop/TestCase.cs117
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/test.config31
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/transport/util/ByteEncoderTest.cs106
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/transport/util/CircularBufferTest.cs89
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/transport/util/ResultFutureTest.cs103
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/transport/util/SerialTest.cs75
-rw-r--r--M4-RCs/qpid/dotnet/client-010/test/transport/util/UUIDTest.cs41
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/Properties/AssemblyInfo.cs57
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/ConfigDemo.suobin23552 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/Demo.suobin33280 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.Designer.cs185
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.cs96
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.resx123
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Program.cs41
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/AssemblyInfo.cs57
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Resources.Designer.cs92
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Resources.resx117
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Settings.Designer.cs51
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Settings.settings7
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/wcBookingClient.csproj103
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Booking.cs62
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/IBooking.cs43
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Order.cs45
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Program.cs98
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Properties/AssemblyInfo.cs57
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Receipt.cs46
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/wcfBookingServer.csproj77
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/App.config56
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/HelloClient.cs36
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/IHelloService.cs33
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Program.cs48
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Properties/AssemblyInfo.cs57
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/wcfHelloClient.csproj65
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/App.config64
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/HelloService.cs34
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/IHelloService.cs32
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/Program.cs47
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/Properties/AssemblyInfo.cs57
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/wcfHelloServer.csproj67
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/IUpperCase.cs31
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/Program.cs113
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/Properties/AssemblyInfo.cs57
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/QpidBindingConfigurationElement.cs205
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/UpperCase.cs33
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/wcfRPC.csproj73
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/CommunicationOperation.cs31
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/QpidBinding.cs185
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelBase.cs167
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelFactory.cs74
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelListener.cs79
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelListenerBase.cs111
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/QpidInputChannel.cs218
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/QpidInputChannelBase.cs101
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/QpidOutputChannel.cs89
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/QpidOutputChannelBase.cs77
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/QpidTransportBindingElement.cs186
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/model/QpidTransportElement.cs183
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/wcf.csproj59
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/wcf.sln50
-rw-r--r--M4-RCs/qpid/dotnet/client-010/wcf/wcf.suobin105984 -> 0 bytes
-rw-r--r--M4-RCs/qpid/dotnet/default.build252
-rw-r--r--M4-RCs/qpid/etc/LICENSE206
-rw-r--r--M4-RCs/qpid/etc/NOTICE8
-rw-r--r--M4-RCs/qpid/etc/svn-auto-props77
-rw-r--r--M4-RCs/qpid/gentools/LICENSE202
-rw-r--r--M4-RCs/qpid/gentools/NOTICE2
-rw-r--r--M4-RCs/qpid/gentools/README61
-rw-r--r--M4-RCs/qpid/gentools/README.txt102
-rwxr-xr-xM4-RCs/qpid/gentools/build37
-rw-r--r--M4-RCs/qpid/gentools/build.xml43
-rw-r--r--M4-RCs/qpid/gentools/lib/LICENSE0
-rw-r--r--M4-RCs/qpid/gentools/lib/NOTICE0
-rw-r--r--M4-RCs/qpid/gentools/lib/README.txt0
-rw-r--r--M4-RCs/qpid/gentools/lib/velocity-1.4.jarbin361173 -> 0 bytes
-rw-r--r--M4-RCs/qpid/gentools/lib/velocity-dep-1.4.jarbin517761 -> 0 bytes
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpClass.java197
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java29
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpConstant.java191
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java152
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomain.java89
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java128
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java62
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpField.java269
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java452
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java77
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethod.java351
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java36
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpModel.java132
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOrdinalFieldMap.java96
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java76
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOverloadedParameterMap.java29
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpParseException.java30
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpTemplateException.java30
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpTypeMappingException.java30
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpVersion.java72
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java79
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/BitFieldGenerateMethod.java29
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/CommandGenerateMethod.java26
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/ConsolidatedField.java120
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/CppGenerator.java1716
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/DotnetGenerator.java382
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/GenerateMethod.java27
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Generator.java857
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/JavaGenerator.java1826
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/LanguageConverter.java42
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Main.java301
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/MangledGenerateMethod.java26
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/NodeAware.java47
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Printable.java28
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionClass.java103
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionField.java68
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionMethod.java154
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionModel.java71
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/TargetDirectoryException.java30
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Utils.java159
-rw-r--r--M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/VersionConsistencyCheck.java26
-rw-r--r--M4-RCs/qpid/gentools/templ.cpp/method/MethodBodyClass.h.tmpl112
-rw-r--r--M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientOperations.h.tmpl82
-rw-r--r--M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientProxy.cpp.tmpl52
-rw-r--r--M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientProxy.h.tmpl75
-rw-r--r--M4-RCs/qpid/gentools/templ.cpp/model/AMQP_Constants.h.tmpl34
-rw-r--r--M4-RCs/qpid/gentools/templ.cpp/model/AMQP_HighestVersion.h.tmpl42
-rw-r--r--M4-RCs/qpid/gentools/templ.cpp/model/AMQP_MethodVersionMap.cpp.tmpl62
-rw-r--r--M4-RCs/qpid/gentools/templ.cpp/model/AMQP_MethodVersionMap.h.tmpl57
-rw-r--r--M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerOperations.h.tmpl83
-rw-r--r--M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerProxy.cpp.tmpl51
-rw-r--r--M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerProxy.h.tmpl74
-rw-r--r--M4-RCs/qpid/gentools/templ.java/PropertyContentHeaderClass.tmpl208
-rw-r--r--M4-RCs/qpid/gentools/templ.java/method/version/MethodBodyClass.vm190
-rw-r--r--M4-RCs/qpid/gentools/templ.java/model/ProtocolVersionListClass.vm148
-rw-r--r--M4-RCs/qpid/gentools/templ.java/model/version/AmqpConstantsClass.vm37
-rw-r--r--M4-RCs/qpid/gentools/templ.java/model/version/MethodRegistryClass.vm145
-rw-r--r--M4-RCs/qpid/gentools/xml-src/amqp-0.10.test.xml4241
-rw-r--r--M4-RCs/qpid/gentools/xml-src/amqp-0.8.test.xml3959
-rw-r--r--M4-RCs/qpid/gentools/xml-src/amqp-0.9.test.xml4282
-rw-r--r--M4-RCs/qpid/gentools/xml-src/cluster-0.9.test.xml59
-rw-r--r--M4-RCs/qpid/java/010ExcludeList57
-rw-r--r--M4-RCs/qpid/java/010ExcludeList-noPrefetch61
-rw-r--r--M4-RCs/qpid/java/010ExcludeList-store64
-rw-r--r--M4-RCs/qpid/java/08ExcludeList8
-rw-r--r--M4-RCs/qpid/java/08ExcludeList-nonvm29
-rw-r--r--M4-RCs/qpid/java/ExcludeList8
-rw-r--r--M4-RCs/qpid/java/KEYS0
-rw-r--r--M4-RCs/qpid/java/XAExcludeList3
-rw-r--r--M4-RCs/qpid/java/broker-plugins/MANIFEST.MF14
-rw-r--r--M4-RCs/qpid/java/broker-plugins/build.xml29
-rw-r--r--M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/Activator.java48
-rw-r--r--M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/diagnostic/DiagnosticExchange.java219
-rw-r--r--M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/diagnostic/DiagnosticExchangeType.java57
-rw-r--r--M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/example/TestExchange.java118
-rw-r--r--M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/example/TestExchangeType.java57
-rwxr-xr-xM4-RCs/qpid/java/broker/bin/msTool.sh60
-rwxr-xr-xM4-RCs/qpid/java/broker/bin/qpid-passwd35
-rwxr-xr-xM4-RCs/qpid/java/broker/bin/qpid-server37
-rwxr-xr-xM4-RCs/qpid/java/broker/bin/qpid-server-bdb.bat22
-rwxr-xr-xM4-RCs/qpid/java/broker/bin/qpid-server.bat203
-rwxr-xr-xM4-RCs/qpid/java/broker/bin/qpid.start21
-rwxr-xr-xM4-RCs/qpid/java/broker/bin/qpid.stop178
-rwxr-xr-xM4-RCs/qpid/java/broker/bin/qpid.stopall27
-rw-r--r--M4-RCs/qpid/java/broker/build.xml57
-rw-r--r--M4-RCs/qpid/java/broker/etc/access19
-rw-r--r--M4-RCs/qpid/java/broker/etc/acl.config.xml231
-rw-r--r--M4-RCs/qpid/java/broker/etc/config.xml133
-rw-r--r--M4-RCs/qpid/java/broker/etc/debug.log4j.xml114
-rw-r--r--M4-RCs/qpid/java/broker/etc/jmxremote.access23
-rw-r--r--M4-RCs/qpid/java/broker/etc/log4j.xml98
-rw-r--r--M4-RCs/qpid/java/broker/etc/md5passwd21
-rw-r--r--M4-RCs/qpid/java/broker/etc/mstool-log4j.xml54
-rw-r--r--M4-RCs/qpid/java/broker/etc/passwd22
-rw-r--r--M4-RCs/qpid/java/broker/etc/passwdVhost19
-rw-r--r--M4-RCs/qpid/java/broker/etc/persistent_config.xml115
-rw-r--r--M4-RCs/qpid/java/broker/etc/qpid-server.conf25
-rw-r--r--M4-RCs/qpid/java/broker/etc/qpid-server.conf.jpp49
-rw-r--r--M4-RCs/qpid/java/broker/etc/qpid.passwd23
-rw-r--r--M4-RCs/qpid/java/broker/etc/transient_config.xml112
-rw-r--r--M4-RCs/qpid/java/broker/etc/virtualhosts.xml123
-rwxr-xr-xM4-RCs/qpid/java/broker/python-test.xml56
-rw-r--r--M4-RCs/qpid/java/broker/src/main/grammar/SelectorParser.jj621
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/log4j.properties24
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java1007
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/configuration/Configuration.java188
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java239
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java913
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ConsumerTagNotUniqueException.java25
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ExtractResendAndRequeue.java108
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java554
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ManagedChannel.java68
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java79
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.java148
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMap.java81
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java232
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/Configurator.java118
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java286
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java73
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java38
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java215
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java113
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java139
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java253
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java98
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java40
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java45
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java51
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeType.java35
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java224
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java219
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java350
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java99
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java98
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/MessageRouter.java41
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java49
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java670
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderKey.java40
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderKeyDictionary.java50
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderMatcherResult.java25
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeadersMatcherDFAState.java339
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeadersParser.java439
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherDFAState.java295
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherResult.java25
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicParser.java613
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWord.java54
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWordDictionary.java63
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java275
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java106
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java41
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java601
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ConstantExpression.java211
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java38
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManager.java39
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java67
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java56
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java122
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/MessageFilter.java30
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java42
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java268
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java77
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java369
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XPathExpression.java127
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XQueryExpression.java58
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XalanXPathEvaluator.java103
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/AbstractFlowCreditManager.java62
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java77
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java44
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java44
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java79
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java76
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java185
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/AccessRequestHandler.java61
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicAckMethodHandler.java67
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicCancelMethodHandler.java74
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java168
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java187
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java101
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicQosHandler.java58
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverMethodHandler.java73
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverSyncMethodHandler.java75
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java125
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseHandler.java77
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseOkHandler.java53
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelFlowHandler.java66
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelOpenHandler.java103
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseMethodHandler.java72
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseOkMethodHandler.java63
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java99
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionSecureOkMethodHandler.java124
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java164
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionTuneOkMethodHandler.java54
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java178
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeclareHandler.java116
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeleteHandler.java71
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/OnCurrentThreadExecutor.java34
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java139
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java209
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java124
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueuePurgeHandler.java119
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueUnbindHandler.java134
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl.java566
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl_0_9.java164
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl_8_0.java86
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxCommitHandler.java78
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxRollbackHandler.java77
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxSelectHandler.java63
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/UnexpectedMethodException.java33
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/jms/JmsConsumer.java110
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQManagedObject.java97
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java191
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java224
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java41
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java39
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java38
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanIntrospector.java388
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java239
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java43
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java37
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/Managable.java34
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java98
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObject.java58
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObjectRegistry.java48
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagementConfiguration.java30
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/NoopManagedObjectRegistry.java60
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverter.java57
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverterRegistry.java61
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java284
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_9/ProtocolOutputConverterImpl.java391
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Activator.java44
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java145
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java859
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java46
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java280
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPProtocolProvider.java52
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java207
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java306
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java51
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/HeartbeatConfig.java67
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java135
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java46
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java482
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessageHandle.java79
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java71
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java216
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java78
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java479
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AsyncDeliveryConfig.java56
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java71
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java84
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java82
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java50
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/Filterable.java33
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/InMemoryMessageHandle.java157
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java319
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java245
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java52
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageHandleFactory.java46
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageMetaData.java92
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java47
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java138
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/PriorityQueueList.java169
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java184
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java388
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryIterator.java30
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryList.java34
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryListFactory.java26
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueNotificationListener.java27
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java43
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java1604
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryList.java178
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java127
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/UnauthorizedAccessException.java45
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java219
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java313
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java140
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java88
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLManager.java161
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLPlugin.java58
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessResult.java65
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessRights.java63
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Accessable.java27
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Permission.java37
-rwxr-xr-xM4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/PrincipalPermissions.java579
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/VirtualHostAccess.java68
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBean.java473
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/UserManagement.java118
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/AllowAll.java68
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/DenyAll.java57
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/SimpleXML.java342
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java63
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java499
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java235
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/HashedUser.java134
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java240
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java100
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java34
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.java164
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java48
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java38
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java246
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java76
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/JCAProvider.java46
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java123
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePrincipal.java44
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java38
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java132
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java60
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java50
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java105
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java61
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java71
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java38
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java151
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java60
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQState.java36
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java263
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java52
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/StateAwareMethodListener.java35
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/StateListener.java30
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java1463
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java234
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java276
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreClosedException.java36
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoreContext.java71
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/ClientDeliveryMethod.java29
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/RecordDeliveryMethod.java28
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java96
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionFactory.java59
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionFactoryImpl.java103
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java617
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionList.java247
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ConnectorConfiguration.java118
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java705
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/LocalTransactionalContext.java293
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/NonTransactionalContext.java213
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/StoreMessageOperation.java58
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TransactionalContext.java179
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TxnBuffer.java109
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TxnOp.java55
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/CircularBuffer.java131
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/ConcurrentLinkedQueueNoSize.java38
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/LoggingProxy.java105
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java84
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java44
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java339
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java70
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java652
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/AbstractCommand.java66
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Clear.java85
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Command.java36
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Copy.java55
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Dump.java302
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Help.java98
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/List.java314
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Load.java94
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Move.java206
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Purge.java67
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Quit.java54
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Select.java233
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Show.java515
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/security/Passwd.java81
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/CommandParser.java51
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/Console.java90
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleCommandParser.java121
-rw-r--r--M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleConsole.java363
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/ExtractResendAndRequeueTest.java255
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/RunBrokerWithCommand.java132
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/SelectorParserTest.java128
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/AcknowledgeTest.java120
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java50
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java108
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java595
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java145
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java199
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/InternalTestProtocolSession.java180
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java295
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQPriorityQueueTest.java107
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java377
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java85
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java349
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQMessage.java49
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQMessageHandle.java37
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java313
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockMessagePublishInfo.java52
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java197
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java432
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java59
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java120
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBeanTest.java152
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabaseTest.java337
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/HashedUserTest.java95
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslServerTestCase.java66
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/TestPrincipalDatabase.java86
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/amqplain/AMQPlainSaslServerTest.java43
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerTest.java39
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreShutdownTest.java81
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java644
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java92
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java180
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/QueueBrowserUsesNoAckTest.java77
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java209
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java88
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java123
-rw-r--r--M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/util/MockChannel.java43
-rw-r--r--M4-RCs/qpid/java/build.deps104
-rw-r--r--M4-RCs/qpid/java/build.xml223
-rwxr-xr-xM4-RCs/qpid/java/clean-dir25
-rw-r--r--M4-RCs/qpid/java/client-java14/README.txt33
-rw-r--r--M4-RCs/qpid/java/client-java14/etc/sasl.properties20
-rw-r--r--M4-RCs/qpid/java/client-java14/src/main/assembly/client-java14-bin.xml74
-rw-r--r--M4-RCs/qpid/java/client-java14/src/main/assembly/jar-with-dependencies.xml104
-rw-r--r--M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/ClientFactoryImpl.java343
-rw-r--r--M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java347
-rw-r--r--M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java275
-rw-r--r--M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/Provider.java61
-rw-r--r--M4-RCs/qpid/java/client-java14/src/test/java/org/apache/qpid/test/integration/client/ConnectionTest.java66
-rw-r--r--M4-RCs/qpid/java/client/build.xml48
-rw-r--r--M4-RCs/qpid/java/client/example/bin/README.txt11
-rw-r--r--M4-RCs/qpid/java/client/example/bin/set_classpath.bat50
-rwxr-xr-xM4-RCs/qpid/java/client/example/bin/set_classpath.sh83
-rw-r--r--M4-RCs/qpid/java/client/example/bin/verify_all59
-rw-r--r--M4-RCs/qpid/java/client/example/build.xml27
-rw-r--r--M4-RCs/qpid/java/client/example/source-jar.xml35
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/README.txt17
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/log4j.xml49
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/DeclareQueue.java55
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/DirectProducer.java67
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/Listener.java103
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/DeclareQueue.java55
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/FannoutProducer.java66
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/Listener.java103
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/pubsub/TopicListener.java112
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/pubsub/TopicPublisher.java80
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Consumer.java152
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Listener.java208
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Producer.java138
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/direct.properties27
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify34
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify.in35
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_cpp_java10
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_cpp_java.in20
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_cpp10
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_cpp.in30
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_python9
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_python.in29
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_python_java10
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_python_java.in20
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Consumer.java165
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Listener.java201
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Producer.java113
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/fanout.properties33
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify36
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify.in70
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_cpp_java13
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_cpp_java.in55
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_cpp13
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_cpp.in58
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_python13
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_python.in55
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_python_java13
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_python_java.in55
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/Listener.java214
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/Publisher.java133
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/pubsub.properties36
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify33
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify.in95
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_cpp_java10
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_cpp_java.in55
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_cpp10
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_cpp.in99
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_python10
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_python.in95
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_python_java10
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_python_java.in55
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/Client.java153
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/Server.java163
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/requestResponse.properties27
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify34
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify.in38
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_cpp_java12
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_cpp_java.in22
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_cpp12
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_cpp.in35
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_python11
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_python.in34
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_python_java11
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_python_java.in18
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/transacted/QueueToTopic.java259
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/transacted/transacted.properties31
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageDispatcher.java163
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageFactory.java138
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java29
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorMessageDispatcher.java141
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorPublisher.java105
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java181
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java32
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Client.java72
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/ConnectionSetup.java123
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Publisher.java81
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Subscriber.java98
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java29
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.java29
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/FileUtils.java168
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.java81
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/Statics.java57
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/example.properties39
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/simple/reqresp/Client.java263
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/simple/reqresp/Server.java236
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java139
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriptionWrapper.java47
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java182
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/SubscriptionWrapper.java46
-rw-r--r--M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/transport/ExistingSocketConnectorDemo.java171
-rwxr-xr-xM4-RCs/qpid/java/client/example/src/main/java/runSample.sh72
-rw-r--r--M4-RCs/qpid/java/client/src/main/grammar/SelectorParser.jj609
-rwxr-xr-xM4-RCs/qpid/java/client/src/main/java/client.bnd6
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/client.log4j33
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/mina/transport/socket/nio/ExistingSocketConnector.java478
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java47
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java390
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java1454
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate.java50
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java269
-rwxr-xr-xM4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_9.java32
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_8_0.java287
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java552
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionURL.java294
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java507
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java54
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java40
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java40
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java165
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java137
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java204
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java2908
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSessionAdapter.java26
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSessionDirtyException.java42
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java850
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java565
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java69
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryTopic.java72
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java151
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java226
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQUndefinedDestination.java40
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java1079
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java409
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_8.java85
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java561
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java186
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_8.java207
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/Closeable.java83
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/ConnectionTuneParameters.java72
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java66
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/DispatcherCallback.java36
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/JMSAMQException.java65
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/JmsNotImplementedException.java31
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/MessageConsumerPair.java43
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java97
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QueueReceiverAdaptor.java115
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.java228
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/SSLConfiguration.java61
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TemporaryDestination.java38
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java205
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TopicSubscriberAdaptor.java132
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XAConnectionImpl.java78
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java529
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java159
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java78
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java49
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java256
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverNoopSupport.java75
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java49
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java104
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java64
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java47
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/AccessRequestOkMethodHandler.java50
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicCancelOkMethodHandler.java55
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicDeliverMethodHandler.java54
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicReturnMethodHandler.java58
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java110
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseOkMethodHandler.java49
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowMethodHandler.java51
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowOkMethodHandler.java52
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl.java529
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_0_9.java153
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_8_0.java85
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionCloseMethodHandler.java106
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java49
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionRedirectMethodHandler.java71
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionSecureMethodHandler.java70
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java232
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java83
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ExchangeBoundOkMethodHandler.java57
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/QueueDeleteOkMethodHandler.java57
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate.java138
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegateFactory.java54
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java972
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_8.java567
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java149
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesTypedMessage.java802
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java534
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java187
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/CloseConsumerMessage.java43
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/FiledTableSupport.java56
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessage.java390
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessageFactory.java44
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSHeaderAdapter.java552
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java513
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessageFactory.java42
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java177
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessageFactory.java41
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java206
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessageFactory.java40
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessage.java185
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessageFactory.java42
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageConverter.java195
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactory.java47
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java173
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/ReturnMessage.java47
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java53
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage_0_10.java53
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage_0_8.java163
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQIoTransportProtocolSession.java146
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java856
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java545
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java136
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatConfig.java61
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatDiagnostics.java121
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/ProtocolBufferMonitorFilter.java115
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/AMQCallbackHandler.java30
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.java231
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.properties22
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.java210
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.properties20
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/JCAProvider.java72
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/UsernameHashedPasswordCallbackHandler.java102
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/UsernamePasswordCallbackHandler.java60
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClient.java105
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClientFactory.java63
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/crammd5hashed/CRAMMD5HashedSaslClientFactory.java72
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQMethodNotImplementedException.java32
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQState.java60
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateChangedEvent.java48
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateListener.java26
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java199
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/StateAwareMethodListener.java38
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.java129
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/listener/SpecificMethodFrameListener.java41
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java59
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java43
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/ITransportConnection.java32
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.java131
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java335
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/VmPipeTransportConnection.java62
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java244
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser_0_10.java423
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/util/BlockingWaiter.java348
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java125
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java60
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ArithmeticExpression.java268
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/BinaryExpression.java103
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/BooleanExpression.java33
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ComparisonExpression.java589
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ConstantExpression.java204
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/Expression.java34
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/JMSSelectorFilter.java70
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/LogicExpression.java108
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/MessageFilter.java27
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/PropertyExpression.java279
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/UnaryExpression.java321
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/BrokerDetails.java103
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ChannelLimitReachedException.java46
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Connection.java69
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ConnectionListener.java58
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.java94
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java314
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Message.java30
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/MessageConsumer.java27
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/MessageProducer.java57
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Session.java101
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/TopicSubscriber.java32
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverMethod.java76
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java273
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java166
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/Example.properties40
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/NameParserImpl.java37
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java359
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/ReadOnlyContext.java527
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/naming/ReadOnlyContext.java509
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/naming/jndi.properties40
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/JMSTestCase.java135
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/MessagePartListener.java46
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/ByteBufferMessage.java190
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/MessageListener.java34
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/MessagePartListenerAdapter.java88
-rw-r--r--M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/njms/ExceptionHelper.java60
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java185
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindQueue.java213
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindTopic.java212
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/README.txt11
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/cluster/Client.java129
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/BasicDeliverTest.java277
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/Client.java133
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/Server.java103
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java35
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/AbstractConfig.java69
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java29
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/Connector.java40
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/ConnectorConfig.java28
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java111
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/flow/ChannelFlowTest.java112
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargePublisher.java196
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargeSubscriber.java167
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/Listener.java117
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/MessageFactory.java175
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/Publisher.java133
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Bind.java273
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Lookup.java196
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Unbind.java166
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/latency/LatencyTest.java153
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/AcceptorTest.java102
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/BlockingAcceptorTest.java93
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/WriterTest.java271
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/multiconsumer/AMQTest.java269
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestPublisher.java176
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestSubscriber.java122
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/client/connection/TestManyConnections.java95
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/PropertiesFileInitialContextFactoryTest.java153
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/example.properties38
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Config.java243
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Listener.java141
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/MessageFactory.java155
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Publisher.java175
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Config.java110
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Ping.java45
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Pong.java45
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Relay.java127
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Start.java44
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceProvider.java151
-rw-r--r--M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceRequestingClient.java185
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java125
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/AMQQueueTest.java42
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/MockAMQConnection.java94
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/message/TestMessageHelper.java46
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java297
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/MockIoSession.java312
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableKeyEnumeratorTest.java96
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTablePropertyTest.java62
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java99
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java97
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/NoCloseOKStateManager.java65
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java532
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java185
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/BytesMessageTest.java569
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/MapMessageTest.java383
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/StreamMessageTest.java623
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/TextMessageTest.java300
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.java140
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/NonQpidMessage.java411
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java171
-rw-r--r--M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/tests.properties45
-rw-r--r--M4-RCs/qpid/java/client/test/bin/IBM-JNDI-Setup.bat69
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/IBM-JNDI-Setup.sh27
-rw-r--r--M4-RCs/qpid/java/client/test/bin/IBM-Publisher.bat62
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/IBM-Publisher.sh22
-rw-r--r--M4-RCs/qpid/java/client/test/bin/IBM-PutGet.bat62
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/IBM-PutGet.sh21
-rw-r--r--M4-RCs/qpid/java/client/test/bin/IBM-README.txt19
-rw-r--r--M4-RCs/qpid/java/client/test/bin/IBM-Receiver.bat62
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/IBM-Receiver.sh22
-rw-r--r--M4-RCs/qpid/java/client/test/bin/IBM-Sender.bat62
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/IBM-Sender.sh22
-rw-r--r--M4-RCs/qpid/java/client/test/bin/IBM-Subscriber.bat62
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/IBM-Subscriber.sh22
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/headersListener.sh22
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/headersListenerGroup.sh25
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/headersPublisher.sh22
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/run_many.sh30
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/serviceProvidingClient.sh24
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/serviceRequestingClient.sh27
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/testService.sh22
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/topicListener.sh23
-rwxr-xr-xM4-RCs/qpid/java/client/test/bin/topicPublisher.sh22
-rw-r--r--M4-RCs/qpid/java/client/test/etc/ApacheDS.properties24
-rw-r--r--M4-RCs/qpid/java/client/test/example_build.xml104
-rw-r--r--M4-RCs/qpid/java/common.xml268
-rw-r--r--M4-RCs/qpid/java/common/Composite.tpl336
-rw-r--r--M4-RCs/qpid/java/common/Constant.tpl35
-rw-r--r--M4-RCs/qpid/java/common/Enum.tpl57
-rw-r--r--M4-RCs/qpid/java/common/Invoker.tpl73
-rw-r--r--M4-RCs/qpid/java/common/MethodDelegate.tpl37
-rw-r--r--M4-RCs/qpid/java/common/Option.tpl41
-rw-r--r--M4-RCs/qpid/java/common/StructFactory.tpl60
-rw-r--r--M4-RCs/qpid/java/common/Type.tpl84
-rwxr-xr-xM4-RCs/qpid/java/common/bin/qpid-run264
-rw-r--r--M4-RCs/qpid/java/common/build.xml104
-rwxr-xr-xM4-RCs/qpid/java/common/codegen89
-rw-r--r--M4-RCs/qpid/java/common/etc/qpid-run.conf25
-rw-r--r--M4-RCs/qpid/java/common/etc/qpid-run.conf.dev26
-rw-r--r--M4-RCs/qpid/java/common/genutil.py255
-rw-r--r--M4-RCs/qpid/java/common/protocol-version.xml70
-rw-r--r--M4-RCs/qpid/java/common/readme.txt4
-rwxr-xr-xM4-RCs/qpid/java/common/src/main/java/common.bnd6
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/log4j.properties31
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/FixedSizeByteBufferAllocator.java467
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/support/DefaultIoFuture.java227
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/support/IoServiceListenerSupport.java351
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/WriteBufferFullExeception.java48
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/WriteBufferLimitFilterBuilder.java272
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/codec/OurCumulativeProtocolDecoder.java197
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/codec/QpidProtocolCodecFilter.java440
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketAcceptor.java547
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketConnector.java486
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketFilterChain.java67
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketIoProcessor.java1026
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketSessionConfigImpl.java240
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketSessionImpl.java488
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/vmpipe/QpidVmPipeConnector.java151
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java41
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java59
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java44
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java70
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java65
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java39
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQException.java122
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java45
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java39
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQPInvalidClassException.java39
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQProtocolException.java38
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java39
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java54
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java43
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java50
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/BrokerDetails.java138
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/BrokerDetailsImpl.java264
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java54
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ErrorCode.java123
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/QpidConfig.java111
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/QpidException.java58
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/SecurityHelper.java71
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/SerialException.java40
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyBroker.java188
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyClient.java106
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyExchange.java154
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/api/Message.java126
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQCodecFactory.java77
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java271
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQEncoder.java66
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/AMQPFilterTypes.java61
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/ClientProperties.java52
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java190
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/Configured.java44
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java43
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyUtils.java164
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java250
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java65
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java40
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.java63
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java120
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockEncoder.java61
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java125
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java47
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java83
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java45
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyImpl.java96
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java30
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodFactory.java90
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java39
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolHeaderException.java41
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolInstanceException.java39
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolVersionException.java39
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java776
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortStringTokenizer.java31
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQType.java795
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypeMap.java48
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.java116
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java834
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/BodyFactory.java31
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/CommonContentHeaderProperties.java81
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/CompositeAMQDataBlock.java78
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/Content.java26
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java121
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java48
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java131
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java50
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java60
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java59
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/DeferredDataBlock.java50
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodableAMQDataBlock.java35
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java1033
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java1187
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTableFactory.java38
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java79
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBodyFactory.java31
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java195
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/SmallCompositeAMQDataBlock.java98
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java198
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/AbstractMethodConverter.java47
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ContentChunk.java32
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfo.java38
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java32
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java32
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AMQMethodBody_0_9.java209
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java172
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java209
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java151
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/Event.java155
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/Job.java192
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java491
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteJobQueue.java432
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteRunnable.java27
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteThreadModel.java102
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.java172
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java236
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java95
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java70
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQProtocolWriter.java43
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java64
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java53
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/AMQPCallbackHandler.java28
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/CallbackHandlerRegistry.java94
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/DynamicSaslRegistrar.java80
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/JCAProvider.java44
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/UsernamePasswordCallbackHandler.java60
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/amqplain/AmqPlainSaslClient.java105
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/amqplain/AmqPlainSaslClientFactory.java62
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.java195
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Binary.java145
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Binding.java36
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java138
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java505
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java98
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionException.java70
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionListener.java38
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Echo.java71
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Field.java83
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Future.java37
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Header.java92
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Method.java180
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolDelegate.java40
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolError.java83
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolEvent.java40
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java116
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolVersionException.java62
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Range.java125
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSet.java147
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Receiver.java38
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Result.java30
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Sender.java38
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SenderException.java52
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java154
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java799
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionClosedException.java49
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDelegate.java149
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionException.java61
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionListener.java40
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Sink.java136
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Struct.java142
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/TransportException.java51
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractDecoder.java470
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java620
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBDecoder.java144
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBEncoder.java323
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Decoder.java283
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encodable.java44
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encoder.java282
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Assembler.java226
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ConnectionBinding.java83
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java239
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Frame.java151
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/InputHandler.java204
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkDelegate.java42
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkEvent.java34
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/InputHandler_0_9.java130
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoAcceptor.java92
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java145
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java286
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoTransport.java229
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaHandler.java274
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaSender.java81
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioHandler.java140
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioSender.java121
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLReceiver.java179
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java197
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java97
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Logger.java130
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/SliceIterator.java59
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Waiter.java63
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java236
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURL.java59
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java466
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java173
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/URLSyntaxException.java97
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java689
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedMessageQueueAtomicSize.java258
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueAtomicSize.java70
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueNoSize.java38
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java316
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/MessageQueue.java43
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/NameUUIDGen.java59
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/PrettyPrintingUtils.java75
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/PropertiesUtils.java200
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/RandomUUIDGen.java39
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/Serial.java108
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java94
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/UUIDGen.java36
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/UUIDs.java59
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/AlreadyUnblockedException.java34
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueue.java122
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueueBase.java834
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BooleanLatch.java128
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/Capacity.java35
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/Condition.java50
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchBuffer.java50
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchException.java52
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchQueue.java48
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchRecord.java74
-rw-r--r--M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchRef.java51
-rw-r--r--M4-RCs/qpid/java/common/src/main/resources/org/apache/qpid/ssl/qpid.certbin756 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/mina/SocketIOTest/IOWriterClient.java396
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/mina/SocketIOTest/IOWriterServer.java157
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/AMQExceptionTest.java106
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java109
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java188
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java960
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java111
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/session/TestSession.java277
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java385
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/GenTest.java44
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/RangeSetTest.java238
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java554
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java522
-rw-r--r--M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/SerialTest.java82
-rw-r--r--M4-RCs/qpid/java/common/templates/method/MethodBodyInterface.vm62
-rw-r--r--M4-RCs/qpid/java/common/templates/method/version/MethodBodyClass.vm209
-rw-r--r--M4-RCs/qpid/java/common/templates/model/ClientMethodDispatcherInterface.vm56
-rw-r--r--M4-RCs/qpid/java/common/templates/model/MethodDispatcherInterface.vm39
-rw-r--r--M4-RCs/qpid/java/common/templates/model/MethodRegistryClass.vm104
-rw-r--r--M4-RCs/qpid/java/common/templates/model/ProtocolVersionListClass.vm178
-rw-r--r--M4-RCs/qpid/java/common/templates/model/ServerMethodDispatcherInterface.vm56
-rw-r--r--M4-RCs/qpid/java/common/templates/model/version/AmqpConstantsClass.vm37
-rw-r--r--M4-RCs/qpid/java/common/templates/model/version/ClientMethodDispatcherInterface.vm55
-rw-r--r--M4-RCs/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm43
-rw-r--r--M4-RCs/qpid/java/common/templates/model/version/MethodRegistryClass.vm193
-rw-r--r--M4-RCs/qpid/java/common/templates/model/version/ServerMethodDispatcherInterface.vm55
-rw-r--r--M4-RCs/qpid/java/common/templating.py119
-rw-r--r--M4-RCs/qpid/java/cpp.async.testprofile3
-rw-r--r--M4-RCs/qpid/java/cpp.cluster.testprofile5
-rw-r--r--M4-RCs/qpid/java/cpp.noprefetch.testprofile4
-rw-r--r--M4-RCs/qpid/java/cpp.testprofile3
-rw-r--r--M4-RCs/qpid/java/default-longrunning.testprofile1
-rw-r--r--M4-RCs/qpid/java/default.testprofile25
-rw-r--r--M4-RCs/qpid/java/doc/AMQBlazeDetailedDesign.vsdbin120320 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/doc/FramingClassDiagram.vsdbin206848 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/doc/broker-overview.diabin1263 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/etc/coding_standards.xml138
-rw-r--r--M4-RCs/qpid/java/etc/license_header.txt20
-rw-r--r--M4-RCs/qpid/java/etc/log4j.xml61
-rw-r--r--M4-RCs/qpid/java/integrationtests/README.txt13
-rwxr-xr-xM4-RCs/qpid/java/integrationtests/bin/interoptests.py180
-rw-r--r--M4-RCs/qpid/java/integrationtests/build.xml28
-rw-r--r--M4-RCs/qpid/java/integrationtests/docs/RunningSustainedTests.txt17
-rw-r--r--M4-RCs/qpid/java/integrationtests/jar-with-dependencies.xml47
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java135
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java209
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java239
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase4P2PMessageSize.java214
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase5PubSubMessageSize.java243
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java84
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java90
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java88
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase4P2PMessageSize.java193
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase5PubSubMessageSize.java193
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java906
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java126
-rw-r--r--M4-RCs/qpid/java/integrationtests/src/resources/sustained-log4j.xml69
-rw-r--r--M4-RCs/qpid/java/java.testprofile5
-rw-r--r--M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/IsolatedClassLoader.java113
-rw-r--r--M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/TKTestRunnerMojo.java274
-rw-r--r--M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/TKTestScriptGenMojo.java148
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/build.xml26
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/DefaultThreadFactory.java48
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/PossibleDeadlockException.java46
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/TestRunnable.java239
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/ThreadTestCoordinator.java486
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/ThreadTestExample.java145
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/package.html28
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestCase.java303
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java170
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/BaseThrottle.java98
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/BatchedThrottle.java94
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/DurationTestDecorator.java205
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/InstrumentedTest.java66
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/NullResultPrinter.java92
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java172
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ScaledTestDecorator.java375
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SetupTaskAware.java55
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SetupTaskHandler.java92
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ShutdownHookable.java42
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SleepThrottle.java81
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TKTestResult.java625
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TKTestRunner.java694
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TestRunnerImprovedErrorHandling.java131
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TestThreadAware.java49
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/Throttle.java73
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TimingController.java175
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TimingControllerAware.java43
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/WrappedSuiteTestDecorator.java134
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/CSVTestListener.java532
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/ConsoleTestListener.java264
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/TKTestListener.java132
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/XMLTestListener.java400
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/package.html27
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/package.html33
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/CommandLineParser.java787
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/ContextualProperties.java494
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/MathUtils.java428
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/ParsedProperties.java390
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/SizeOf.java94
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/StackQueue.java131
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/TestContextProperties.java202
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/TestUtils.java54
-rw-r--r--M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/package.html27
-rw-r--r--M4-RCs/qpid/java/lib/backport-util-concurrent-2.2.jarbin326319 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/bnd-0.0.249.jarbin255605 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/cobertura/README.txt9
-rw-r--r--M4-RCs/qpid/java/lib/com.ibm.icu_3.4.4.jarbin3255246 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/commons-cli-1.0.jarbin30117 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/commons-codec-1.3.jarbin46725 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/commons-collections-3.2.jarbin571259 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/commons-configuration-1.2.jarbin163822 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/commons-lang-2.2.jarbin243016 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/commons-logging-1.0.4.jarbin38015 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/commons-pool-1.4.jarbin87077 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/geronimo-jms_1.1_spec-1.0.jarbin28211 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/geronimo-servlet_2.5_spec-1.2.jarbin70593 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/javacc.jarbin378781 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/jline-0.9.94.jarbin87325 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/junit-3.8.1.jarbin121070 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/junit-4.4.jarbin161477 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/jython-2.2-rc2.jarbin1203486 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/jython-lib.jarbin1570006 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/log4j-1.2.12.jarbin358085 -> 0 bytes
-rwxr-xr-xM4-RCs/qpid/java/lib/mina-core-1.0.1.jarbin313338 -> 0 bytes
-rwxr-xr-xM4-RCs/qpid/java/lib/mina-filter-ssl-1.0.1.jarbin28950 -> 0 bytes
-rwxr-xr-xM4-RCs/qpid/java/lib/org.apache.felix.framework-1.0.0.jarbin320272 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.core.commands_3.2.0.jarbin89522 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.core.contenttype_3.2.0.jarbin76141 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.core.expressions_3.2.0.jarbin66023 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.core.jobs_3.2.0.jarbin74797 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.core.runtime.compatibility.auth_3.2.0.jarbin18733 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.core.runtime.compatibility.registry_3.2.0.jarbin7887 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.core.runtime_3.2.0.jarbin76627 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.common_3.2.0.jarbin79780 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/ECLIPSE.RSAbin3487 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/ECLIPSE.SF17
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/MANIFEST.MF25
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/eclipse.inf3
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/about.html28
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/eclipse_1115.sobin118028 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/launcher.carbon.macosx.properties12
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/ECLIPSE.SF17
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/MANIFEST.MF25
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/eclipse.inf3
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/about.html28
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/launcher.gtk.linux.x86.properties12
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jarbin43682 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.preferences_3.2.0.jarbin91662 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.equinox.registry_3.2.0.jarbin143841 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.help_3.2.0.jarbin115440 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.jdt.launching.macosx_3.1.100.v20080422.jarbin61174 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.jface_3.2.0.jarbin813664 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jarbin997883 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.swt.carbon.macosx_3.4.1.v3449c.jarbin1852007 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.swt.gtk.linux.x86_3.4.1.v3449c.jarbin2006608 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.swt.win32.win32.x86_3.2.0.jarbin1553273 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.swt_3.4.1.v3449c.jarbin15807 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.ui.forms_3.2.0.jarbin235372 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.ui.workbench_3.2.1.jarbin3076013 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/org.eclipse.ui_3.2.0.jarbin124376 -> 0 bytes
-rwxr-xr-xM4-RCs/qpid/java/lib/org.osgi.core_1.0.0.jarbin60929 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/slf4j-api-1.4.0.jarbin13095 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/slf4j-log4j12-1.4.0.jarbin7132 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/lib/xalan-2.7.0.jarbin2730442 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/log4j-test.xml53
-rw-r--r--M4-RCs/qpid/java/management/client/README.txt117
-rwxr-xr-xM4-RCs/qpid/java/management/client/bin/qman31
-rw-r--r--M4-RCs/qpid/java/management/client/build.xml66
-rw-r--r--M4-RCs/qpid/java/management/client/doc/man/qman17
-rw-r--r--M4-RCs/qpid/java/management/client/etc/qman-config.xml47
-rw-r--r--M4-RCs/qpid/java/management/client/etc/qman.log4j30
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java119
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Names.java57
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Protocol.java47
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/AccessModeMapping.java83
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerAlreadyConnectedException.java53
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java270
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionDataParser.java137
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionException.java42
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configuration.java383
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/ConfigurationException.java51
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configurator.java287
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/IParser.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/MessageHandlerMapping.java90
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/QpidDatasource.java249
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Tag.java51
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/TypeMapping.java90
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownAccessCodeException.java53
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownBrokerException.java43
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownTypeCodeException.java53
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/BaseMessageHandler.java54
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/ContentIndicationMessageHandler.java114
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/IMessageHandler.java52
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/ConfigurationMessageHandler.java57
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/EventContentMessageHandler.java51
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/HeartBeatIndicationMessageHandler.java39
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/IMethodInvocationListener.java41
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/InstrumentationMessageHandler.java57
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/InvocationResult.java157
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/MethodOrEventDataTransferObject.java68
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/MethodResponseMessageHandler.java106
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/SchemaResponseMessageHandler.java217
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/AccessMode.java33
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/Direction.java33
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/DomainModel.java239
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/IValidator.java38
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/InvocationEvent.java76
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/JmxService.java348
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/MissingFeatureAttributesException.java35
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidArgument.java82
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidAttribute.java105
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidClass.java768
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidEntity.java158
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidEvent.java456
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidFeature.java88
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidFeatureBuilder.java454
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidMethod.java147
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidPackage.java279
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidProperty.java295
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidStatistic.java34
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/UnableToBuildFeatureException.java51
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/ValidationException.java105
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/AbsTime.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Binary.java151
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Boolean.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/DeltaTime.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Double.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Float.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int16.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int32.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int64.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int8.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Map.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/ObjectReference.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Str16.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Str8.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Type.java101
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint16.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint32.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint64.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint8.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uuid.java46
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/BrokerMessageListener.java177
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/ManagementClient.java231
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/MessageTokenizer.java152
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/MethodInvocationException.java50
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QMan.java365
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QpidService.java360
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/SequenceNumberGenerator.java41
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/StartupFailureException.java42
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/UnableToComplyException.java31
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/AmqpCoDec.java178
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/ManagementMessage.java189
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/MethodInvocationRequestMessage.java161
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/SchemaRequestMessage.java68
-rw-r--r--M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/servlet/QManServlet.java66
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/TestConstants.java64
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/ConfigurationTest.java229
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/ConfiguratorTest.java164
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/MappingParsersTest.java79
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/handler/base/ContentIndicationMessageHandlerTest.java59
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/BaseDomainModelTestCase.java44
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/BaseQpidFeatureBuilderTestCase.java96
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/DomainModelTest.java55
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/OptionalPropertiesTest.java187
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidClassTest.java408
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidEventTest.java293
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidMethodBuilderTest.java147
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidNumberPropertyTest.java171
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidPackageTest.java53
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidPropertyBuilderTest.java269
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidStatisticBuilderTest.java159
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidStringPropertyTest.java127
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/type/BinaryTest.java59
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/services/BrokerMessageListenerTest.java241
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/services/MessageTokenizerTest.java140
-rw-r--r--M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/online/BaseOnlineTestCase.java58
-rw-r--r--M4-RCs/qpid/java/management/client/web.xml32
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/META-INF/MANIFEST.MF21
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/README.txt21
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc.bat55
-rwxr-xr-xM4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc.sh75
-rwxr-xr-xM4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh26
-rwxr-xr-xM4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh21
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/build-release-common.properties38
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/build-release-linux-gtk-x86.properties34
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/build-release-macosx.properties40
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/build-release-macosx.xml91
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/build-release-win32-win32-x86.properties34
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/build-release.xml152
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/build.xml88
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/Thumbs.dbbin97280 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/add.gifbin318 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/delete.gifbin143 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/icon_ClosedFolder.gifbin160 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/icon_OpenFolder.gifbin152 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/mbean_view.pngbin2046 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/notifications.gifbin104 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidConnections.gifbin168 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc.gifbin1225 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc16.gifbin928 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc32.bmpbin1139 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc32.gifbin1139 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/reconnect.gifbin327 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/refresh.gifbin182 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/splash.bmpbin207078 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/icons/stop.gifbin215 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/plugin.properties20
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/plugin.xml223
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Activator.java84
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Application.java63
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationActionBarAdvisor.java96
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java136
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchAdvisor.java46
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java65
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java140
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java132
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedObject.java40
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedServer.java103
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java46
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java172
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java146
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java326
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java56
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java51
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java260
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java53
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java50
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/VersionAction.java94
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/InfoRequiredException.java36
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/ManagementConsoleException.java31
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java77
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientNotificationListener.java41
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXManagedObject.java48
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java714
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java466
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/AttributeData.java96
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java118
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationInfoModel.java51
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java101
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java110
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationDataModel.java72
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ParameterData.java95
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/CRAMMD5HashedSaslClientFactory.java60
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/ClientSaslFactory.java54
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/JCAProvider.java56
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/PlainSaslClient.java203
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/SaslProvider.java35
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UserPasswordCallbackHandler.java73
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UsernameHashedPasswordCallbackHandler.java82
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java936
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ConnectionTypeTabControl.java59
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ExchangeTypeTabControl.java60
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/INotificationViewer.java32
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java336
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java545
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java1253
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java427
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NumberVerifyListener.java46
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java903
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/QueueTypeTabControl.java296
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java102
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java126
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java483
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java593
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/.eclipseproduct23
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/eclipse.exebin180224 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/eclipse.ini23
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/icons/Console.icnsbin51007 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/license.eclipse.txt88
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Configuration/config.ini30
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Info.plist31
-rwxr-xr-xM4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/eclipsebin59200 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/eclipse.ini14
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF19
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/startup.jarbin33049 -> 0 bytes
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini27
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/unix/eclipse.ini11
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini26
-rw-r--r--M4-RCs/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.java126
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/Guide.txt143
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/LICENSE225
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/NOTICE12
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/README64
-rwxr-xr-xM4-RCs/qpid/java/management/tools/qpid-cli/bin/qpid-cli35
-rwxr-xr-xM4-RCs/qpid/java/management/tools/qpid-cli/bin/qpid-cli.bat27
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/build.xml31
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/report.property26
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Command.java62
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandConstants.java50
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecusionEngine.java88
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java194
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java76
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java71
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java180
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Command.java113
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commanddelete.java228
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandhelp.java73
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandinfo.java259
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandlist.java296
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandmove.java294
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java276
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java284
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/AllObjects.java44
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ConnectionObject.java54
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ExchangeObject.java53
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ObjectNames.java477
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/QueueObject.java86
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/UserManagementObject.java45
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/VirtualHostObject.java53
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOption.java112
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionConstants.java53
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionParser.java218
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfigProperty.java47
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfiguration.java148
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXinfo.java72
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/AllTest.java80
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java51
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecusionEngine.java90
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java101
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java106
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestReportGenerator.java50
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java99
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java99
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java95
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java100
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java100
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java96
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java99
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java93
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java105
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java103
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java51
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java106
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java102
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java88
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java85
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java100
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java51
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java85
-rw-r--r--M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java53
-rw-r--r--M4-RCs/qpid/java/module.xml542
-rw-r--r--M4-RCs/qpid/java/perftests/RunningPerformanceTests.txt141
-rwxr-xr-xM4-RCs/qpid/java/perftests/bin/run_many.sh30
-rwxr-xr-xM4-RCs/qpid/java/perftests/bin/topicListener.sh32
-rwxr-xr-xM4-RCs/qpid/java/perftests/bin/topicPublisher.sh31
-rw-r--r--M4-RCs/qpid/java/perftests/build.xml329
-rw-r--r--M4-RCs/qpid/java/perftests/dist-zip.xml45
-rw-r--r--M4-RCs/qpid/java/perftests/etc/jndi/activemq.properties20
-rw-r--r--M4-RCs/qpid/java/perftests/etc/jndi/failovertest.properties19
-rw-r--r--M4-RCs/qpid/java/perftests/etc/jndi/perftests.properties19
-rw-r--r--M4-RCs/qpid/java/perftests/etc/jndi/swiftmq.properties20
-rw-r--r--M4-RCs/qpid/java/perftests/etc/perftests.log4j46
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-1.sh21
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-2.sh21
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-3.sh21
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-4.sh21
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-5.sh21
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-6.sh21
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/Connections.sh20
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/JobQueue.sh20
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/Latency.sh21
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/MessageSize.sh20
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/PT-Qpid-13.sh42
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/PT-Qpid-14.sh41
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/Reliability.sh20
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/RunAll.sh25
-rw-r--r--M4-RCs/qpid/java/perftests/etc/scripts/Test-ActiveMQ.sh32
-rw-r--r--M4-RCs/qpid/java/perftests/etc/scripts/Test-SwiftMQ.sh30
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/Throughput.sh20
-rwxr-xr-xM4-RCs/qpid/java/perftests/etc/scripts/sendAndWaitClient.sh22
-rw-r--r--M4-RCs/qpid/java/perftests/generate-scripts74
-rw-r--r--M4-RCs/qpid/java/perftests/jar-with-dependencies.xml91
-rw-r--r--M4-RCs/qpid/java/perftests/scripts.xml328
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java120
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java35
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java69
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java29
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/Connector.java40
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java28
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java112
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Config.java243
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Listener.java141
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/MessageFactory.java153
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Publisher.java175
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java292
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java107
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java452
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingLatencyTestPerf.java311
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java93
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingTestPerf.java196
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java453
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java1718
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongTestPerf.java251
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/test/testcases/MessageThroughputPerf.java199
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Config.java326
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java303
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java157
-rw-r--r--M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java186
-rw-r--r--M4-RCs/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java100
-rw-r--r--M4-RCs/qpid/java/release-docs/RELEASE_NOTES.txt35
-rw-r--r--M4-RCs/qpid/java/resources/LICENSE731
-rw-r--r--M4-RCs/qpid/java/resources/NOTICE48
-rw-r--r--M4-RCs/qpid/java/resources/README40
-rw-r--r--M4-RCs/qpid/java/systests/build.xml30
-rw-r--r--M4-RCs/qpid/java/systests/etc/bin/fail.py88
-rwxr-xr-xM4-RCs/qpid/java/systests/etc/bin/testclients.sh23
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java125
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java152
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java252
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerImmediatePrefetch.java44
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java245
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerTest.java179
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java103
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/ResetMessageListenerTest.java229
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/message/NonQpidObjectMessage.java236
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java92
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java262
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java562
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java106
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/MessagingTestConfigProperties.java308
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java320
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java154
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java236
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/plugins/PluginTest.java54
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java124
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.java70
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MockIoSession.java297
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java420
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java262
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java276
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java235
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java258
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java227
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.java213
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java656
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java155
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java297
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestMemoryMessageStore.java51
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java169
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java306
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/AveragedRun.java66
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/RunStats.java57
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/TimedRun.java52
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java95
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java164
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java209
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java537
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserClientAckTest.java37
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserDupsOkTest.java34
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserNoAckTest.java36
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserPreAckTest.java35
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTransactedTest.java34
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java272
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/MessageToStringTest.java251
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java125
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitTimeoutDelayTest.java72
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/AMQPPublisher.java54
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Assertion.java39
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/AssertionBase.java66
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/BrokerLifecycleAware.java70
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CauseFailure.java42
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CauseFailureUserPrompt.java65
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Circuit.java109
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java91
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEndBase.java152
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/DropInTest.java51
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java205
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java285
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java31
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkTestContext.java48
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalAMQPCircuitFactory.java168
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalCircuitFactory.java316
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessageIdentityVector.java167
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessageMonitor.java105
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessagingTestConfigProperties.java685
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/NotApplicableAssertion.java112
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Publisher.java74
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Receiver.java92
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestCaseVector.java88
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestClientDetails.java86
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestUtils.java192
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchFailureException.java45
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchThread.java124
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchronizer.java69
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/LocalClockSynchronizer.java73
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockReference.java165
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockSynchronizer.java463
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java469
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedPublisherImpl.java95
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedReceiverImpl.java95
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/TestClientCircuitEnd.java324
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java539
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java166
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java244
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java209
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/OptOutTestCase.java69
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java497
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClientControlledTest.java108
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/listeners/XMLTestListener.java399
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalAMQPPublisherImpl.java133
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalCircuitImpl.java306
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalPublisherImpl.java170
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalReceiverImpl.java144
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/package.html43
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/AMQPFeatureDecorator.java96
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureDecorator.java95
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java70
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java135
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java136
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java102
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java198
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java152
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/FailoverTest.java119
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/ImmediateMessageTest.java303
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/MandatoryMessageTest.java321
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/RollbackTest.java132
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/TTLTest.java151
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java160
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java331
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/BytesMessageTest.java282
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/FieldTableMessageTest.java163
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java104
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java184
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MapMessageTest.java1271
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java230
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.java278
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java408
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PubSubTwoConnectionTest.java75
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ReceiveTest.java82
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/SelectorTest.java306
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/SessionStartTest.java115
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/TextMessageTest.java248
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/close/CloseTest.java70
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java251
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQSessionTest.java110
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java241
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java418
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java81
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java108
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java158
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java286
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ExceptionListenerTest.java62
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/Client.java133
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java69
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/Service.java94
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/ServiceCreator.java112
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/SpecialQueue.java46
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java335
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/protocol/AMQProtocolSessionTest.java120
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java258
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java142
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java372
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java69
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ct/DurableSubscriberTest.java167
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java89
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java135
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/StreamMessageTest.java161
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8En4
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Jp4
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java122
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java416
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java76
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java419
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java572
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactedTest.java348
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/AbstractXATestCase.java132
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/FaultTest.java385
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/QueueTest.java657
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/TopicTest.java1711
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ConversationFactory.java480
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java93
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidClientConnection.java289
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidClientConnectionHelper.java295
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java597
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ReflectionUtils.java228
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ReflectionUtilsException.java44
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/protocol/TestIoSession.java104
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/util/ClasspathScanner.java234
-rw-r--r--M4-RCs/qpid/java/systests/src/main/java/systests.log4j28
-rw-r--r--M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/exchange/HeadersExchangePerformanceTest.java184
-rw-r--r--M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/protocol/TestProtocolInitiation.java266
-rw-r--r--M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueueConcurrentPerfTest.java49
-rw-r--r--M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueuePerfTest.java258
-rw-r--r--M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/SendPerfTest.java181
-rw-r--r--M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/util/ConcurrentTest.java79
-rw-r--r--M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/test/unit/ack/DisconnectAndRedeliverTest.java215
-rw-r--r--M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/BaseTask.java74
-rw-r--r--M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Foreach.java84
-rw-r--r--M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Map.java94
-rw-r--r--M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Require.java80
-rw-r--r--M4-RCs/qpid/java/test-provider.properties38
-rw-r--r--M4-RCs/qpid/java/testkit/README153
-rw-r--r--M4-RCs/qpid/java/testkit/bin/perf_report.sh100
-rw-r--r--M4-RCs/qpid/java/testkit/bin/run_pub.sh24
-rw-r--r--M4-RCs/qpid/java/testkit/bin/run_soak_client.sh70
-rw-r--r--M4-RCs/qpid/java/testkit/bin/run_sub.sh25
-rw-r--r--M4-RCs/qpid/java/testkit/bin/setenv.sh49
-rw-r--r--M4-RCs/qpid/java/testkit/bin/soak_report.sh161
-rw-r--r--M4-RCs/qpid/java/testkit/build.xml27
-rw-r--r--M4-RCs/qpid/java/testkit/etc/jndi.properties35
-rw-r--r--M4-RCs/qpid/java/testkit/etc/test.log4j28
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/MessageFactory.java64
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/LatencyTest.java332
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfBase.java102
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfConsumer.java248
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfProducer.java207
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/TestParams.java160
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/BaseTest.java152
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/MultiThreadedConsumer.java153
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/MultiThreadedProducer.java166
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/ResourceLeakTest.java138
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/SimpleConsumer.java134
-rw-r--r--M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/SimpleProducer.java146
-rw-r--r--M4-RCs/qpid/java/tools/bin/qpid-bench35
-rw-r--r--M4-RCs/qpid/java/tools/build.xml27
-rw-r--r--M4-RCs/qpid/java/tools/src/main/java/org/apache/qpid/tools/JNDICheck.java200
-rw-r--r--M4-RCs/qpid/java/tools/src/main/java/org/apache/qpid/tools/QpidBench.java857
-rwxr-xr-xM4-RCs/qpid/python/LICENSE.txt203
-rw-r--r--M4-RCs/qpid/python/NOTICE.txt20
-rw-r--r--M4-RCs/qpid/python/README.txt56
-rw-r--r--M4-RCs/qpid/python/RELEASE_NOTES17
-rwxr-xr-xM4-RCs/qpid/python/amqp-doc80
-rwxr-xr-xM4-RCs/qpid/python/commands/qpid-config391
-rwxr-xr-xM4-RCs/qpid/python/commands/qpid-printevents74
-rwxr-xr-xM4-RCs/qpid/python/commands/qpid-queue-stats144
-rwxr-xr-xM4-RCs/qpid/python/commands/qpid-route514
-rwxr-xr-xM4-RCs/qpid/python/commands/qpid-tool195
-rw-r--r--M4-RCs/qpid/python/cpp_failing_0-10.txt0
-rw-r--r--M4-RCs/qpid/python/cpp_failing_0-8.txt0
-rw-r--r--M4-RCs/qpid/python/cpp_failing_0-9.txt4
-rw-r--r--M4-RCs/qpid/python/doc/test-requirements.txt29
-rwxr-xr-xM4-RCs/qpid/python/examples/direct/declare_queues.py76
-rwxr-xr-xM4-RCs/qpid/python/examples/direct/direct_consumer.py94
-rwxr-xr-xM4-RCs/qpid/python/examples/direct/direct_producer.py73
-rwxr-xr-xM4-RCs/qpid/python/examples/direct/listener.py109
-rw-r--r--M4-RCs/qpid/python/examples/direct/verify22
-rw-r--r--M4-RCs/qpid/python/examples/direct/verify.in14
-rwxr-xr-xM4-RCs/qpid/python/examples/fanout/fanout_consumer.py99
-rwxr-xr-xM4-RCs/qpid/python/examples/fanout/fanout_producer.py72
-rwxr-xr-xM4-RCs/qpid/python/examples/fanout/listener.py117
-rw-r--r--M4-RCs/qpid/python/examples/fanout/verify24
-rw-r--r--M4-RCs/qpid/python/examples/fanout/verify.in27
-rwxr-xr-xM4-RCs/qpid/python/examples/pubsub/topic_publisher.py92
-rwxr-xr-xM4-RCs/qpid/python/examples/pubsub/topic_subscriber.py154
-rw-r--r--M4-RCs/qpid/python/examples/pubsub/verify23
-rw-r--r--M4-RCs/qpid/python/examples/pubsub/verify.in55
-rwxr-xr-xM4-RCs/qpid/python/examples/request-response/client.py131
-rwxr-xr-xM4-RCs/qpid/python/examples/request-response/server.py110
-rw-r--r--M4-RCs/qpid/python/examples/request-response/verify24
-rw-r--r--M4-RCs/qpid/python/examples/request-response/verify.in14
-rwxr-xr-xM4-RCs/qpid/python/examples/xml-exchange/declare_queues.py90
-rwxr-xr-xM4-RCs/qpid/python/examples/xml-exchange/listener.py105
-rw-r--r--M4-RCs/qpid/python/examples/xml-exchange/verify22
-rw-r--r--M4-RCs/qpid/python/examples/xml-exchange/verify.in15
-rwxr-xr-xM4-RCs/qpid/python/examples/xml-exchange/xml_consumer.py96
-rwxr-xr-xM4-RCs/qpid/python/examples/xml-exchange/xml_producer.py92
-rwxr-xr-xM4-RCs/qpid/python/hello-world64
-rw-r--r--M4-RCs/qpid/python/java_failing_0-8.txt2
-rw-r--r--M4-RCs/qpid/python/java_failing_0-9.txt18
-rw-r--r--M4-RCs/qpid/python/mllib/__init__.py65
-rw-r--r--M4-RCs/qpid/python/mllib/dom.py295
-rw-r--r--M4-RCs/qpid/python/mllib/parsers.py139
-rw-r--r--M4-RCs/qpid/python/mllib/transforms.py164
-rw-r--r--M4-RCs/qpid/python/models/fedsim/__init__.py19
-rw-r--r--M4-RCs/qpid/python/models/fedsim/fedsim.py434
-rw-r--r--M4-RCs/qpid/python/models/fedsim/testBig.py88
-rw-r--r--M4-RCs/qpid/python/models/fedsim/testRing.py48
-rw-r--r--M4-RCs/qpid/python/models/fedsim/testStar.py65
-rw-r--r--M4-RCs/qpid/python/models/fedsim/testStarAdd.py56
-rwxr-xr-xM4-RCs/qpid/python/pal2py274
-rwxr-xr-xM4-RCs/qpid/python/perftest113
-rw-r--r--M4-RCs/qpid/python/qmf/__init__.py18
-rw-r--r--M4-RCs/qpid/python/qmf/console.py1625
-rw-r--r--M4-RCs/qpid/python/qpid/__init__.py84
-rw-r--r--M4-RCs/qpid/python/qpid/assembler.py118
-rw-r--r--M4-RCs/qpid/python/qpid/client.py225
-rw-r--r--M4-RCs/qpid/python/qpid/codec.py590
-rw-r--r--M4-RCs/qpid/python/qpid/codec010.py301
-rw-r--r--M4-RCs/qpid/python/qpid/compat.py28
-rw-r--r--M4-RCs/qpid/python/qpid/connection.py218
-rw-r--r--M4-RCs/qpid/python/qpid/connection08.py493
-rw-r--r--M4-RCs/qpid/python/qpid/content.py58
-rw-r--r--M4-RCs/qpid/python/qpid/datatypes.py349
-rw-r--r--M4-RCs/qpid/python/qpid/delegate.py53
-rw-r--r--M4-RCs/qpid/python/qpid/delegates.py162
-rw-r--r--M4-RCs/qpid/python/qpid/disp.py79
-rw-r--r--M4-RCs/qpid/python/qpid/exceptions.py21
-rw-r--r--M4-RCs/qpid/python/qpid/framer.py159
-rw-r--r--M4-RCs/qpid/python/qpid/invoker.py48
-rw-r--r--M4-RCs/qpid/python/qpid/log.py28
-rw-r--r--M4-RCs/qpid/python/qpid/management.py913
-rw-r--r--M4-RCs/qpid/python/qpid/managementdata.py753
-rw-r--r--M4-RCs/qpid/python/qpid/message.py74
-rw-r--r--M4-RCs/qpid/python/qpid/packer.py36
-rw-r--r--M4-RCs/qpid/python/qpid/peer.py465
-rw-r--r--M4-RCs/qpid/python/qpid/queue.py86
-rw-r--r--M4-RCs/qpid/python/qpid/reference.py117
-rw-r--r--M4-RCs/qpid/python/qpid/session.py379
-rw-r--r--M4-RCs/qpid/python/qpid/spec.py59
-rw-r--r--M4-RCs/qpid/python/qpid/spec010.py693
-rw-r--r--M4-RCs/qpid/python/qpid/spec08.py504
-rw-r--r--M4-RCs/qpid/python/qpid/testlib.py392
-rw-r--r--M4-RCs/qpid/python/qpid/util.py117
-rw-r--r--M4-RCs/qpid/python/qpid_config.py23
-rwxr-xr-xM4-RCs/qpid/python/rule2test108
-rwxr-xr-xM4-RCs/qpid/python/run-tests35
-rwxr-xr-xM4-RCs/qpid/python/server80
-rwxr-xr-xM4-RCs/qpid/python/server01072
-rw-r--r--M4-RCs/qpid/python/setup.py25
-rw-r--r--M4-RCs/qpid/python/tests/__init__.py30
-rw-r--r--M4-RCs/qpid/python/tests/assembler.py78
-rw-r--r--M4-RCs/qpid/python/tests/codec.py607
-rw-r--r--M4-RCs/qpid/python/tests/codec010.py120
-rw-r--r--M4-RCs/qpid/python/tests/connection.py215
-rw-r--r--M4-RCs/qpid/python/tests/datatypes.py257
-rw-r--r--M4-RCs/qpid/python/tests/framer.py95
-rw-r--r--M4-RCs/qpid/python/tests/queue.py71
-rw-r--r--M4-RCs/qpid/python/tests/spec.py74
-rw-r--r--M4-RCs/qpid/python/tests/spec010.py84
-rw-r--r--M4-RCs/qpid/python/tests_0-10/__init__.py30
-rw-r--r--M4-RCs/qpid/python/tests_0-10/alternate_exchange.py150
-rw-r--r--M4-RCs/qpid/python/tests_0-10/broker.py93
-rw-r--r--M4-RCs/qpid/python/tests_0-10/dtx.py775
-rw-r--r--M4-RCs/qpid/python/tests_0-10/example.py95
-rw-r--r--M4-RCs/qpid/python/tests_0-10/exchange.py416
-rw-r--r--M4-RCs/qpid/python/tests_0-10/management.py240
-rw-r--r--M4-RCs/qpid/python/tests_0-10/message.py847
-rw-r--r--M4-RCs/qpid/python/tests_0-10/persistence.py67
-rw-r--r--M4-RCs/qpid/python/tests_0-10/query.py235
-rw-r--r--M4-RCs/qpid/python/tests_0-10/queue.py366
-rw-r--r--M4-RCs/qpid/python/tests_0-10/tx.py265
-rw-r--r--M4-RCs/qpid/python/tests_0-8/__init__.py20
-rw-r--r--M4-RCs/qpid/python/tests_0-8/basic.py395
-rw-r--r--M4-RCs/qpid/python/tests_0-8/broker.py104
-rw-r--r--M4-RCs/qpid/python/tests_0-8/example.py94
-rw-r--r--M4-RCs/qpid/python/tests_0-8/exchange.py327
-rw-r--r--M4-RCs/qpid/python/tests_0-8/queue.py255
-rw-r--r--M4-RCs/qpid/python/tests_0-8/testlib.py66
-rw-r--r--M4-RCs/qpid/python/tests_0-8/tx.py209
-rw-r--r--M4-RCs/qpid/python/tests_0-9/__init__.py20
-rw-r--r--M4-RCs/qpid/python/tests_0-9/basic.py396
-rw-r--r--M4-RCs/qpid/python/tests_0-9/broker.py133
-rw-r--r--M4-RCs/qpid/python/tests_0-9/dtx.py587
-rw-r--r--M4-RCs/qpid/python/tests_0-9/example.py94
-rw-r--r--M4-RCs/qpid/python/tests_0-9/exchange.py327
-rw-r--r--M4-RCs/qpid/python/tests_0-9/execution.py29
-rw-r--r--M4-RCs/qpid/python/tests_0-9/message.py657
-rw-r--r--M4-RCs/qpid/python/tests_0-9/query.py224
-rw-r--r--M4-RCs/qpid/python/tests_0-9/queue.py340
-rw-r--r--M4-RCs/qpid/python/tests_0-9/testlib.py66
-rw-r--r--M4-RCs/qpid/python/tests_0-9/tx.py188
-rw-r--r--M4-RCs/qpid/review/LICENSE206
-rw-r--r--M4-RCs/qpid/review/NOTICE8
-rwxr-xr-xM4-RCs/qpid/review/agenda.py65
-rw-r--r--M4-RCs/qpid/review/jiraRSS2wiki.xsl37
-rw-r--r--M4-RCs/qpid/review/svnlog2wiki.xsl31
-rwxr-xr-xM4-RCs/qpid/ruby/LICENSE.txt203
-rw-r--r--M4-RCs/qpid/ruby/NOTICE.txt19
-rw-r--r--M4-RCs/qpid/ruby/README.txt22
-rw-r--r--M4-RCs/qpid/ruby/RELEASE_NOTES15
-rw-r--r--M4-RCs/qpid/ruby/Rakefile88
-rw-r--r--M4-RCs/qpid/ruby/examples/hello-world.rb59
-rw-r--r--M4-RCs/qpid/ruby/examples/qmf-libvirt.rb80
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid.rb41
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/assembler.rb148
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/client.rb136
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/codec.rb455
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/codec08.rb265
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/config.rb33
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/connection.rb221
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/connection08.rb252
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/datatypes.rb353
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/delegates.rb204
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/fields.rb49
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/framer.rb195
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/invoker.rb65
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/packer.rb33
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/peer.rb289
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/qmf.rb1603
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/queue.rb101
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/session.rb458
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/spec.rb183
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/spec010.rb485
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/spec08.rb190
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/test.rb35
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/traverse.rb64
-rw-r--r--M4-RCs/qpid/ruby/lib/qpid/util.rb75
-rw-r--r--M4-RCs/qpid/ruby/tests/assembler.rb78
-rw-r--r--M4-RCs/qpid/ruby/tests/codec010.rb122
-rw-r--r--M4-RCs/qpid/ruby/tests/connection.rb235
-rw-r--r--M4-RCs/qpid/ruby/tests/datatypes.rb224
-rw-r--r--M4-RCs/qpid/ruby/tests/framer.rb99
-rw-r--r--M4-RCs/qpid/ruby/tests/qmf.rb187
-rw-r--r--M4-RCs/qpid/ruby/tests/queue.rb80
-rw-r--r--M4-RCs/qpid/ruby/tests/spec010.rb80
-rw-r--r--M4-RCs/qpid/ruby/tests/util.rb72
-rw-r--r--M4-RCs/qpid/ruby/tests_0-8/basic.rb69
-rw-r--r--M4-RCs/qpid/ruby/tests_0-8/channel.rb48
-rw-r--r--M4-RCs/qpid/specs/LICENSE325
-rw-r--r--M4-RCs/qpid/specs/NOTICE7
-rw-r--r--M4-RCs/qpid/specs/amqp-dtx-preview.0-9.xml1077
-rw-r--r--M4-RCs/qpid/specs/amqp-errata.0-9.xml44
-rw-r--r--M4-RCs/qpid/specs/amqp-nogen.0-9.xml42
-rw-r--r--M4-RCs/qpid/specs/amqp.0-10-preview.xml7170
-rw-r--r--M4-RCs/qpid/specs/amqp.0-10-qpid-errata.xml6652
-rw-r--r--M4-RCs/qpid/specs/amqp.0-10.dtd246
-rw-r--r--M4-RCs/qpid/specs/amqp.0-10.xml6652
-rw-r--r--M4-RCs/qpid/specs/amqp.0-8.xml3998
-rw-r--r--M4-RCs/qpid/specs/amqp.0-9.xml5249
-rw-r--r--M4-RCs/qpid/specs/cluster.0-8.xml59
-rw-r--r--M4-RCs/qpid/specs/management-schema.xml331
3501 files changed, 0 insertions, 607536 deletions
diff --git a/M4-RCs/.gitignore b/M4-RCs/.gitignore
deleted file mode 100644
index 2cf167f374..0000000000
--- a/M4-RCs/.gitignore
+++ /dev/null
@@ -1,77 +0,0 @@
-#Python
-*.pyc
-*.out
-#CPP
-*.o
-*.la
-*.lo
-.dirstamp
-Makefile*
-config\.*
-configure
-.deps
-.libs
-autom4te.cache
-qpid/cpp/examples/direct/declare_queues
-qpid/cpp/examples/direct/direct_producer
-qpid/cpp/examples/direct/listener
-qpid/cpp/examples/fanout/fanout_producer
-qpid/cpp/examples/fanout/listener
-qpid/cpp/examples/pub-sub/topic_listener
-qpid/cpp/examples/pub-sub/topic_publisher
-qpid/cpp/examples/request-response/client
-qpid/cpp/examples/request-response/server
-qpid/cpp/src/tests/client_test
-qpid/cpp/src/tests/consume
-qpid/cpp/src/tests/latencytest
-qpid/cpp/src/tests/perftest
-qpid/cpp/src/tests/publish
-qpid/cpp/src/tests/qpidd.log
-qpid/cpp/src/tests/qpidd.port
-qpid/cpp/src/tests/topic_listener
-qpid/cpp/src/tests/topic_publisher
-qpid/cpp/src/tests/txtest
-qpid/cpp/src/tests/unit_test
-aclocal.m4
-developer.doxygen
-user.doxygen
-qpidd.1
-qpid/cpp/libtool
-qpidc.spec
-qpid/cpp/src/gen/
-*.mk
-mgen.timestamp
-MaxMethodBodySize.h
-qpidd
-rgen.timestamp
-*.pcl
-qpid/cpp/managementgen/management-types.xml
-
-#Java
-*.class
-velocity.log
-qpid/java/build
-release
-.classpath
-.project
-.settings
-generated/
-target
-# Intellij Project files
-*.iml
-*.ipr
-*.iws
-# Emacs
-*~
-# Microsoft Visual Studio artifacts
-*.vcproj.*.*.user
-*.ncb
-*.suo
-*.ilk
-*.pdb
-# Windows build results
-*.exe
-*.lib
-*.dll
-# MacOS File
-.DS_Store
diff --git a/M4-RCs/qpid/KEYS b/M4-RCs/qpid/KEYS
deleted file mode 100644
index 361c0c566c..0000000000
--- a/M4-RCs/qpid/KEYS
+++ /dev/null
@@ -1,152 +0,0 @@
-pub 2048R/18806464 2006-11-14
-uid Rajith Attapattu <rajith@apache.org>
-sig 3 18806464 2006-11-14 Rajith Attapattu <rajith@apache.org>
-uid Rajith Attapattu <rajith77@gmail.com>
-sig 3 18806464 2006-11-14 Rajith Attapattu <rajith@apache.org>
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.2.1 (GNU/Linux)
-
-mQELBEVaPcABCAC+iLSVxk/TZ2i5Kq4KhdYdBdpXizwRsKdCq9m9DwD20yke0rZL
-067ka5z4gA2prOUUCJ51G/CFhDgngiK0awnhcMgdNZzMQoOIJC044qgRLeg12IvI
-bzdtzK+DknPW3MC5QbmuJiozBPokyhyHR/C+889f2lR8OTjSGagLwjtHf0oEuEn4
-RdTBWWzNZclKe4J6UIbi3VG5kgUmThCm12TmtABmJmXpeNl3wpyYNPxZkU1huKNl
-Pi0Buu1SroWoIlwR8n2DNvDIU8PvzmtrfZoDBMopC1a6lBiZX9tKwZLUDb28AgaB
-XelJ+L+nkaoLjbNgNxGRMT7N99hWXsOcWlUVAAYptCVSYWppdGggQXR0YXBhdHR1
-IDxyYWppdGg3N0BnbWFpbC5jb20+iQE2BBMBAgAgBQJFWj3AAhsDBgsJCAcDAgQV
-AggDBBYCAwECHgECF4AACgkQdt2xaBiAZGS/AQf/fCrR7bLqAhiI9ojuOgTfwzRv
-9Hf3FcNdRCnVzmRFzE4WGHSG7R92xLL8avtiPEdC7p80d3+bf+QKGSJ/Ym4a0JqE
-KeX08brWOtIfQQK7wd7UgCJ3ufWcbQgnHzhgc7oY00FZAmQfv8TF8Uxqpe6dKXep
-4S3RN1c9ygg643ey7u85knAk+rs1OevZ+xl/IsLN6rSnQ1B8uIJUCct8+5YuGxd7
-VHCAgDEri0zf7+CMWxVpOJgcegn9Iy8rfmif8BUs0620xvNRha03of2UQZau0WzB
-MIMkSgOUhSBdsYNYe8TU9SfJGXabB4R6xDimMDbOXs75ypQMoPiEsf9urx7T6rQk
-UmFqaXRoIEF0dGFwYXR0dSA8cmFqaXRoQGFwYWNoZS5vcmc+iQE2BBMBAgAgBQJF
-Wj7qAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQdt2xaBiAZGQEYQf/SocY
-SONVEePlZtFlLmsebZLZ8sn+HZBPepcJf81eK7YdXcca7QSeY3Q6vwshbfZsUOJZ
-fu+6gaD1MnPtBLF4RWjLBW1OOmxLJPtv5bNifjciuhuvRgBA7y3xWenfNgV4FeKk
-qX8ArRYJQVgy7X5Lv3ccbXcaNq6ajT2xDi0krMkn0TtU1vdkDSK56PRzAwWxA/X+
-4MKQZF/6964or2rz91iX2OnylEj38q+F7/dOaasD/EZpjAh8nipqVBVL3Rcy2gFy
-7EkTao4tOSo1JVrHW7lgfEBxKVSrgHyhnSxx3Z773edp2qnjZPAcv0qiEawszhkI
-vIuNSo3oTbrOW9w2tA==
-=FCqB
------END PGP PUBLIC KEY BLOCK-----
-pub 1024D/8004C922 2008-04-01 [expires: 2018-03-30]
-uid Aidan Skinner <aidan@skinner.me.uk>
-sig 3 8004C922 2008-04-01 Aidan Skinner <aidan@skinner.me.uk>
-sub 2048g/A1375A8A 2008-04-01 [expires: 2018-03-30]
-sig 8004C922 2008-04-01 Aidan Skinner <aidan@skinner.me.uk>
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.6 (GNU/Linux)
-
-mQGiBEfypHkRBAC0tGJGaJnreJa5eF4KWLxEuPm6zuTrw7V8FRh4Wx7SlSE8XH0O
-08BMAUHWsVDaiAUwGIcnbADpZjPV70ChbRVgasA3p0d5Bf8koRd5clb9cb/+ayg9
-r6sybOEuKLEHL8Va/TCea4ANWWzn2EPUjM6CntipSSTsM4idXo9HtFr8AwCgncYV
-iHncPMTpCc73mbmhpNJrQCsEAJpeZn8Eqy/WvOIxUfsRwM9DI54eu5oEyw1PyDoj
-0Wks5OroPprOaC8wIwI/WWjmNZnGvYsq6ZwEs3EhM5PKRNkOuiu5JwRRDgkaHQaf
-xoxoY6Tn74DT19qGDngf76jLgMCO7/Amqe90rlJNXGwkGHdsA33ItRYcjebtWVIQ
-QgXEA/49akjY/tc4XGsj+QiwhPEYX0/BSdo9CkaeuEpeTDLY7/guzxTeUGALorTW
-PYDH5ie8XZqwyEsz6yFDMk3hoNsrX0Y+gH/mpQVqox4dXCCWPF7bDvNZ/W7uJ5dS
-dwYhHjZ0hvDDhW3VEFlQVEllrBYKQDVNPhZeOcgyLCifsdJXWLQjQWlkYW4gU2tp
-bm5lciA8YWlkYW5Ac2tpbm5lci5tZS51az6IZgQTEQIAJgUCR/KkeQIbAwUJEswD
-AAYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJEG+eB3yABMkiQLQAn3NFZrGrzW8W
-1s8YnrAAxJ6xWFfFAJ9FkR159MVTHaJGAIzn0Iq9eLDUqrkCDQRH8qSPEAgA22Cf
-Xspnd5mqQD6FfWUbZAO6AQ0ehwprA/q3PqdAAtQXbJYRzmuIIwrb50Md7FEwCIWt
-FS0wtbSfPTtDE+C4P93r5K87U0Xg/o4MundjoPjeCGNsTYicpewdlS2WcdWl2BJI
-+G5yPLhq2/vTI8Sg2sCpktunEFw/g/BzsigbJhsSC63NV8LyHBhbBELifFySwWh/
-ZzPCpXbdxzUdwwi7P57+n/DsmfjbXe0okr2QQL4EtDapqvcwnSlz9c4hNw9ku/m9
-YMiQMKRSmtG/ymH7u8F1CZRurvOaaFFbaoWhSZF7nnUH6H4z5HY+aNbufXa0Ffpb
-kTZqLD6amvrTr6NIbwADBQf+Pn2PkGHhSrF1CWQBDNJC0n/vqnc48QxcGoN0Lu02
-Rj0/UNwVKRFy6VGLBEfyxR08ZWi2EkvlYm+VGyv+wQlfAhwyDBHAEVE+j3lWq90+
-B1Pnf5j5p1vRfKCkAWFddILJUoh8fQKUinZdoAWZf3Qn10HoIkAoYw+wo7xIvwch
-/zIpq45n24W/iDcKAggJ3fl6gO7+Hkttig3nbcaQ0xDi/XwkBP4cUqnvwka2E3Bu
-5KiFKc8cdy4mtYrqiDDZ0EZLr7Hx/3uy8kaIzdsep/g0xKOka6Xs10XG3Sg8vDmv
-OEhlDHlTkVF8WpxsabDOselYSu6kURiLKkgHvrUe4OM+SohPBBgRAgAPBQJH8qSP
-AhsMBQkSzAMAAAoJEG+eB3yABMkih7YAoIwSenHROUBAj/ZU9qttReAoUPeLAKCT
-9JRkXdhK2IGqlgc4N0sfZqdx/w==
-=wO1+
------END PGP PUBLIC KEY BLOCK-----
-pub 1024D/7F403EB4 2008-08-29 [expires: 2018-08-27]
-uid Martin Ritchie <ritchiem@apache.org>
-sig 3 7F403EB4 2008-08-29 Martin Ritchie <ritchiem@apache.org>
-sub 2048g/4BFD39DC 2008-08-29 [expires: 2018-08-27]
-sig 7F403EB4 2008-08-29 Martin Ritchie <ritchiem@apache.org>
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.8 (Darwin)
-
-mQGiBEi4S7ARBAC2oG706u3Qf0CF6QO4eJ8mATiz+P2CV8Y6sGWWyxqYtGM0B6Mg
-HLUKJ+1nF7y1qnG3zf8SPj8709fVQyW3XoCivDZKL3JZe8eujM8lfdTnblsId3QF
-IK2Q4O6Sjx5xEb8yS1hocj13+7vD4ADcsaxJL8BGXBhA+VMzz6pCxN0FawCggtWK
-jugwOdtmOmFhhR/bEBo7FysD/iI+2y5atlr8vkQRXQgvIFs9oj6Tp+vFzgcv8nfj
-MIuDq9hywzL+sUUNHEr0YW3wfX5K0A30eSOKWiPt4Cvt082iu0voFr1Dmq8FeuyY
-gjZ4cRvOB4UcKwGbCyDfVPE0Uz6v8MnNJikEC8FP8vLJ1LyylrSNXyh9GNg9t5rf
-gfw6A/9VnkM/OrtkHHreK8drBtG8vL/Wd5HoR/rzlIFNw3dQYlqZ7QxGKkuI48j8
-96INl0hhxy3R5aq/dFIk45ke0nuIeOZLn9p4WCu8+CeGQQjeDHuxKhFmDUFv1Wvd
-S9mpQ/sUBm1xG7RK89eTKF2IUOClqmoSeQBUvwTmkHg+xSnI77QkTWFydGluIFJp
-dGNoaWUgPHJpdGNoaWVtQGFwYWNoZS5vcmc+iGYEExECACYFAki4S7ACGwMFCRLM
-AwAGCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRD+YIfJf0A+tGzTAJ999RE6+ypv
-cCBBk8s23TW5+UKMlwCfXqw3vGBVqEDqws8OHUK/LYKbkbK5Ag0ESLhLsBAIAIf7
-UwpIIpV7FUL/ufwuTO2ZW61ly32jb+2REPYXCdgisd/xOSbHrndA8MflOYoGOty5
-fsxHzcAQ2YrmV09B8XBVwKeRuKX2HgI5ukjSMtFL3ZaqXG+4KqWxO6XyX9DcJGA7
-6W8Fd92R+7FCaM/NLuWPhHZyDws8E6GkldnzPP+eo6wX2frwkiJHOKP/NP4urBsz
-JhL0tpLVffpLw3BVOBPpcB9FZB2IiLjLh7ouvtpxkSsfoiMR4dob+7fxO4WVVsFi
-f2QNmxUxGWRCwnVVUGQor1i6MFE/0rMbypjIXxCLzSkq2IqRExLAEQGZP35mztzb
-F6TCj/+3QAqYcn2idQ8AAwUIAITEFeXVRSLIpl0le9AF1MyzadGdxdRHiGqYLyuc
-wqqRuAOuYvTf48FGuUKqlwchzdUSwYN3xezO3s4C7AnWfXm44wPARs6gqCMgWRng
-LLDqFi5UEvyzBO7a9I/B0JuTLCzOVOyVlUxFOie6E1/rHimG3RUKibwqWUVdI1ho
-do7LBig3wAaxshjwtVSapDlY0eRq+NVLXIlteKdSFCNSwKX+pWoGq2aIuj3dQ20B
-ogVE18L6sGzM5A/cPQTGk9pabhGpxVZNn4Bri2Qjd5RSGbSy89SIyFgheFA9RLC3
-dAt70Rs4ce0euqimkKR7Ciijcg9THWRtE2yU1RKxGUvprsiITwQYEQIADwUCSLhL
-sAIbDAUJEswDAAAKCRD+YIfJf0A+tPj4AJ9sALGRq8Qkzc2opTXhdzQiqqidXQCb
-B0qGS98nQKt60WWG/5k7wPJcbys=
-=0W1W
------END PGP PUBLIC KEY BLOCK-----
-pub 1024D/F947EB65 2008-11-15
- Key fingerprint = 6248 903F C80E C609 4F9E 7CC7 EE47 2841 F947 EB65
-uid Rafael H. Schloming (CODE SIGNING KEY) <rhs@apache.org>
-sig 3 F947EB65 2008-11-15 Rafael H. Schloming (CODE SIGNING KEY) <rhs@apache.org>
-sub 4096g/079367FE 2008-11-15
-sig F947EB65 2008-11-15 Rafael H. Schloming (CODE SIGNING KEY) <rhs@apache.org>
-
------BEGIN PGP PUBLIC KEY BLOCK-----
-Version: GnuPG v1.4.7 (GNU/Linux)
-
-mQGiBEkeOBMRBAC++lIdguyJ+qXv/TCPuYIfAkfvwrzSush6iOT8vdJIj4YS4CHM
-qsrcU+ujIQMQx/kG3h/baYlkKKrMXVE2sc1WkzwkR4KXDe8NfDZVSyxVafq1JOHe
-kW0VYpaL4F6UIXumRI5B+LBoBF9LpcolvgbLA3X5z5mCw+cgYWpE9vghIwCgkE8c
-acp6KRxfBn+puvJEOhyY7sED/RxImMlW3ACp6MqCigKW182mjBQGOivRNeZpaOWn
-Z0b1rWNO64DAsNALTQqsoJbddWwi35bHV9YhA8i1d0OkSowS83m5M6j1i/1A+yny
-Vp3XB/Oc+LLGqNYsRcI3t1P/DtoDDi+qmFKBvNccsTIbrfXrNSH9KaHDoHF8He0G
-NcuiA/9c2Yx81qrAa3nY2BaEUU3EB6nPtD2rZXOR3HL0C6p4LLZLvbxtZs5AKj1f
-loN9cipJWBZozd4IHrhDAOvfwE58VOZXJ2zrp9WlZ2fLtMXa9a/IWwMsiupOYh8G
-mqKoqdEKqDGTl1Now2GlzTAXrha+p8r6TPBc+dT0iwKMWSu8z7Q3UmFmYWVsIEgu
-IFNjaGxvbWluZyAoQ09ERSBTSUdOSU5HIEtFWSkgPHJoc0BhcGFjaGUub3JnPohg
-BBMRAgAgBQJJHjgTAhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AACgkQ7kcoQflH
-62WtIQCfRHdJlaXrdPjCKVg/EcWGmn1JP68An3Oj64ygDeY1ahNG5F4hNXS4I1dl
-uQQNBEkeOBMQEADj1WCB8ej2gboO96tZL3hWAoVt2JxzjH94I7xnv6fCcYLc8k1w
-KawrCOnDlCzqSxXePoMwCkUIbFWMOXO7/GFFl/I75Tna+Sb/6BRqS9C2yJZImuHC
-i4wC7ZXJSKoxHycAkZjhChl57o/EM3Eth2nBq8ZJ05nfU4IpRDXRLBd9CgQbyNs4
-rqYnY4hfwKIeUK6gijj+YaqAMTsu31xRwIjAwh+FJJxX0YZZbE3D3hUdtfUW925o
-KIcYUtQRgp9dPllFBPscCXfvYix7o03Wxd3MQdfjLugSL8bU8ANdzxc74ePTV0p3
-bL8KsG62YguNA3n6fXHZQagNxyhCGa51R12saOmj7tKTCX9aKhs4tq+bQAfw/49G
-NsRGJEtvNlWzWr3EhNHoKdVSpvVC5uj87+RUEKrupeZX9u0D3Sm7pS2v2AxxlldH
-sW2eOCy23O6XTdGnbG9skKEAuszHXN2NZWJBEVoLYCXP7gxuA2KWOMNcxerfrhR9
-dyOBQcaelHKC1roBgVuIg3rlH1CKv6KINWRsRWkFiCrPE/RXCcdTuaiE9Ss3bdAp
-7B7RBA1xvCr1Lj4ICHCfo4JtymQOSQRkqq3reoBk2IOXvdTkZ3B3tbWtASM2H5Ww
-7kCHZZ1OT9saBPNXHaV/vx9QGRjAb72AWwYBqNazhVSVDyfeQuf0tkEV6wADBQ/9
-ExGBMgxTZGvf2LzmDqu+dItGtXG3EIi4Lh91Biyx8S21p7KtwY7HTCx18JneoRlJ
-HLLNrtF3Rp7gVDuxEJN5F9q7dUlRnFAz0Z8eXf8fSQCUvjmuP2V/iHPyfHhHPNm+
-KcjLQP5H3WfIYsC7sEFufkvQFdyccQnm66V33NlBrTEfJE2HFjCdAh4nsEkpjdxZ
-m774c2rWGX8IhzfwmqJj09P9SPjY5l/I+JOLeU0PSdru9Gon+z07GdRTCIRdQsXR
-uNYXbRGBdYmV/QdlP08B8NRQnNjusNVEawJQo84aZlut1LgX0k9bL8s+1Sepr04A
-yb+fJ7reMoxvkTyG6riIYTXr/OpVSqCNO0h477E/myCftGzn30OGzTEgxaCWSYLE
-2jWK/kqLtUcthrwYf4Ksmio083ZlNkNBmlJUYHMr8djCCL2xl0V/miJRnu/3/z7O
-QzMUrOqfMX2xran5x4B75GzvTwYJsEyixHcq6vI19KWCG5KsksFwaFBQ3kvyNc/0
-Oar1FnK597ynPadwGISEzK1jSRZp0cIJKUlrwsm9crS+rWp8Z1gHflhEPVHw7Lp5
-BFcqC3gxzxJBBgnckNZzP8IEiTykz0E0F2qsqLstEfsIERQbqXU2VhEO3UDKKuEX
-34hJx+wJxaGsFPeWHwVYD4fOdQo6W1oyFG8C3JQvJHGISQQYEQIACQUCSR44EwIb
-DAAKCRDuRyhB+UfrZRj/AKCF05jpImxWnTE3NFcKOQs80r1wLQCfaYGsG9UW0OyG
-uzHMwWjy3fI5vO8=
-=7jSO
------END PGP PUBLIC KEY BLOCK-----
diff --git a/M4-RCs/qpid/LICENSE b/M4-RCs/qpid/LICENSE
deleted file mode 100644
index 5f84a6564b..0000000000
--- a/M4-RCs/qpid/LICENSE
+++ /dev/null
@@ -1,7 +0,0 @@
-Please see the individual LICENSE files for each language
-cpp/LICENSE
-dotnet/LICENSE.txt
-gentools/lib/LICENSE
-java/resources/LICENSE
-python/LICENSE.txt
-ruby/LICENSE.txt
diff --git a/M4-RCs/qpid/NOTICE b/M4-RCs/qpid/NOTICE
deleted file mode 100644
index ff65d299a9..0000000000
--- a/M4-RCs/qpid/NOTICE
+++ /dev/null
@@ -1,8 +0,0 @@
-Please see the individual NOTICE files for each language:
-
-cpp/NOTICE
-dotnet/NOTICE.txt
-gentools/lib/NOTICE
-java/resources/NOTICE
-python/NOTICE.txt
-ruby/NOTICE.txt
diff --git a/M4-RCs/qpid/bin/LICENSE b/M4-RCs/qpid/bin/LICENSE
deleted file mode 100644
index bc46b77047..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/bin/NOTICE b/M4-RCs/qpid/bin/NOTICE
deleted file mode 100644
index 05f39ba176..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/bin/mvn-deploy-qpid-java.sh b/M4-RCs/qpid/bin/mvn-deploy-qpid-java.sh
deleted file mode 100755
index 3c2a9fd05f..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/bin/release.sh b/M4-RCs/qpid/bin/release.sh
deleted file mode 100755
index a5211bef57..0000000000
--- a/M4-RCs/qpid/bin/release.sh
+++ /dev/null
@@ -1,75 +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.
-#
-#
-# Script to pull together an Apache Release
-#
-
-SVN=$1
-REV=$2
-VER=$3
-
-if [ -z "$SVN" -o -z "$REV" -o -z "$VER" ]; then
- echo "Usage: release.sh <svn-path> <svn-revision> <version>"
- exit 1
-fi
-
-set -xe
-
-URL=https://svn.apache.org/repos/asf/qpid/${SVN}
-
-svn export -r ${REV} ${URL} qpid-${VER}
-
-mkdir artifacts
-
-echo ${URL} ${REV} > artifacts/qpid-${VER}.svnversion
-
-tar -czf artifacts/qpid-${VER}.tar.gz qpid-${VER}
-tar -czf artifacts/qpid-ruby-${VER}.tar.gz qpid-${VER}/ruby qpid-${VER}/specs
-tar -czf artifacts/qpid-python-${VER}.tar.gz qpid-${VER}/python qpid-${VER}/specs
-
-cd qpid-${VER}/cpp
-./bootstrap
-./configure
-make dist -j2
-
-cd ../java
-ant build release
-
-cd ../dotnet
-cd Qpid.Common
-ant
-cd ..
-./build-nant-release mono-2.0
-
-cd client-010/gentool
-ant
-cd ..
-nant -t:mono-2.0 release-pkg
-
-cd ../../../
-cp qpid-${VER}/java/release/*.tar.gz artifacts/qpid-java-${VER}.tar.gz
-cp qpid-${VER}/cpp/*.tar.gz artifacts/qpid-cpp-${VER}.tar.gz
-cp qpid-${VER}/dotnet/bin/mono-2.0/release/*.zip artifacts/qpid-dotnet-0-8-${VER}.zip
-cp qpid-${VER}/dotnet/client-010/bin/mono-2.0/debug/*.zip artifacts/qpid-dotnet-0-10-${VER}.zip
-
-cd artifacts
-sha1sum *.zip *.gz *.svnversion > SHA1SUM
-for i in `find . | egrep 'jar$|pom$|gz$|zip$|svnversion$|SHA1SUM'`; do gpg --sign --armor --detach $i; done;
diff --git a/M4-RCs/qpid/bin/set_svn_properties.sh b/M4-RCs/qpid/bin/set_svn_properties.sh
deleted file mode 100755
index cc29490eea..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/buildtools/LICENSE b/M4-RCs/qpid/buildtools/LICENSE
deleted file mode 100644
index bc46b77047..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/buildtools/NOTICE b/M4-RCs/qpid/buildtools/NOTICE
deleted file mode 100644
index 5813a7a09a..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/buildtools/buildCreator/build.config b/M4-RCs/qpid/buildtools/buildCreator/build.config
deleted file mode 100644
index cb45e99a6e..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/buildtools/buildCreator/buildCreator.py b/M4-RCs/qpid/buildtools/buildCreator/buildCreator.py
deleted file mode 100755
index 0db3250179..0000000000
--- a/M4-RCs/qpid/buildtools/buildCreator/buildCreator.py
+++ /dev/null
@@ -1,1444 +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=ZIP_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 + " -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')
- 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)
-
- 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 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):
- substitution += "\n " + ECHO_BIN + " -n '" + sourceDependency + ":" \
- + getType(s) + ":' >> " + filename
- substitution += "\n" + getVersionCommand(s) + " >>" + filename
- 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 (source.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\tPREFIX: " + \
- getValue(patch.getElementsByTagName(PATH)[0]) + "\" >> " + 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 = command+" -r"+revision
- 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+" "+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/M4-RCs/qpid/buildtools/buildCreator/qpid.build b/M4-RCs/qpid/buildtools/buildCreator/qpid.build
deleted file mode 100644
index f55025dc8d..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/cc/LICENSE b/M4-RCs/qpid/cc/LICENSE
deleted file mode 100644
index bc46b77047..0000000000
--- a/M4-RCs/qpid/cc/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/M4-RCs/qpid/cc/NOTICE b/M4-RCs/qpid/cc/NOTICE
deleted file mode 100644
index 05f39ba176..0000000000
--- a/M4-RCs/qpid/cc/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/M4-RCs/qpid/cc/README b/M4-RCs/qpid/cc/README
deleted file mode 100644
index 8d1286f6d7..0000000000
--- a/M4-RCs/qpid/cc/README
+++ /dev/null
@@ -1,84 +0,0 @@
-******************
-Prerequisites
-******************
-Check out the source
-see http://cwiki.apache.org/qpid/building.html
-
-******************
-Install CruiseControl
-******************
-
-Download CruiseControl from: http://cruisecontrol.sourceforge.net/
-
- * Unzip the release to a directory, for example ~/cruisecontrol-bin-2.7.2
- * Check that the scripts cruisecontrol-bin-2.7.2/cruisecontrol.sh and cruisecontrol-bin-2.7.2/apache-ant-1.7.0/bin/ant have execution permission.
- * Make sure your directory ~/.ant/lib contains the following jars:
- o The ant jar files that can be found in cruisecontrol-bin-2.7.2/apache-ant-1.7.0/lib/
- o xalan-2.7.0.jar
-
-******************
-Set system variables
-******************
-
-Prior to use CruiseControl you'll need to set three system variables:
-Variable Value
-CC_HOME path to your qpid project, for example /home/foo/projects/qpid
-CPPSTORE_HOME path to your C++ store, for example /home/foo/projects/bdbstore-cpp
-NANT_HOME path to the nant directory -- only required for .net client --
- (nant can be downloaded from http://nant.sourceforge.net/)
-
-Edit the file CC_HOME/config.properties and set the properties so to match your system requirements.
-Notes
- * the cpp store can be checked out from: https://svn.jboss.org/repos/rhmessaging/store/trunk/cpp
- * Only unix scrips are currently provided
- *
-
-
-******************
-Installing Mono
-******************
-For building the .net client on a Linux platform you need to install Mono.
-Mono website is: http://www.mono-project.com/Main_Page
-Here are the instruction for a RHEL5 platform:
-
-Create the file "/etc/yum.repos.d/mono.repo" and add the following lines:
-
-[Mono]
-name=Mono Stack (RHEL_5)
-type=rpm-md
-baseurl=http://download.opensuse.org/repositories/Mono/RHEL_5/
-gpgcheck=1
-gpgkey=http://download.opensuse.org/repositories/Mono/RHEL_5/repodata/repomd.xml.key
-enabled=1
-
-Enter the following command to install Mono:
-
-# yum install mono-complete
-
-
-******************
-Running CruiseControl
-******************
-
-Run cruisecontrol-bin-2.7.2/cruisecontrol.sh from CC_HOME/cc
-
-******************
-Running the Sun java TCK
-******************
-
-If you wish to run the Sun JMS TCK, follow those two steps:
-* Extract the TCK
-* (As required by the TCK) Set TS_HOME to the location where the JMS TCK has been installed.
-
-******************
-Projects
-******************
-
-Project Description
-qpid-cpp-trunk Builds and tests the C++ broker
-qpid-cpp-trunk-perftests Runs the C++ performance tests
-qpid-java-trunk Builds and runs the Java tests with an 0.8 inVM broker, a c++ broker without prefetch and a c++ broker with pre-fetch
-bdbstore-cpp-trunk Builds the C++ store (required for the Java tests)
-example-automation Runs all the example combinations for python, C++ and java
-java-perftests Runs the java performance tests
-java-jmstck Runs the java jms tck (see running the tck) \ No newline at end of file
diff --git a/M4-RCs/qpid/cc/config.properties b/M4-RCs/qpid/cc/config.properties
deleted file mode 100644
index 82329722cc..0000000000
--- a/M4-RCs/qpid/cc/config.properties
+++ /dev/null
@@ -1,25 +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.
-#
-#
-
-mail.subject=CC Report for
-mail.host=localhost
-mail.returnaddress=my-email
-mail.list=list
diff --git a/M4-RCs/qpid/cc/config.xml b/M4-RCs/qpid/cc/config.xml
deleted file mode 100644
index ba89acc511..0000000000
--- a/M4-RCs/qpid/cc/config.xml
+++ /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.
--->
-
-<cruisecontrol>
- <!-- Load environment variables -->
- <property environment="env" toupper="true"/>
-
- <!-- Set a collection of global properties from the properties file "config.properties" -->
- <property file="${env.CC_HOME}/cc/config.properties"/>
-
- <include.projects file="./config/cpp-trunk.xml"/>
- <include.projects file="./config/java-trunk.xml"/>
- <include.projects file="./config/dotnet-trunk.xml"/>
- <include.projects file="./config/bdbstore-cpp-trunk.xml"/>
- <include.projects file="./config/cpp-perftests.xml"/>
- <include.projects file="./config/example-automation.xml"/>
- <include.projects file="./config/java-perftests.xml"/>
- <include.projects file="./config/java-jmstck.xml"/>
-</cruisecontrol>
-
-
diff --git a/M4-RCs/qpid/cc/config/bdbstore-cpp-trunk.xml b/M4-RCs/qpid/cc/config/bdbstore-cpp-trunk.xml
deleted file mode 100644
index 254af62170..0000000000
--- a/M4-RCs/qpid/cc/config/bdbstore-cpp-trunk.xml
+++ /dev/null
@@ -1,54 +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.
--->
-<cruisecontrol>
- <project name="bdbstore-cpp-trunk"
- buildafterfailed="false">
-
- <listeners>
- <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
- </listeners>
-
- <bootstrappers>
- <svnbootstrapper localWorkingCopy="${env.CPPSTORE_HOME}"/>
- </bootstrappers>
-
- <modificationset quietperiod="30">
- <buildstatus logdir="${env.CC_HOME}/cc/logs/qpid-cpp-trunk/"/>
- <svn localWorkingCopy="${env.CPPSTORE_HOME}"/>
- </modificationset>
-
- <schedule interval="3600">
- <exec timeout="1800"
- command="/bin/bash"
- args="${env.CC_HOME}/cc/scripts/bdbstorecppbuild.sh"
- workingdir="${env.CPPSTORE_HOME}"/>
- </schedule>
-
- <publishers>
- <email subjectprefix="${mail.subject}: ${project.name}" mailhost="${mail.host}"
- returnaddress="${mail.returnaddress}"
- buildresultsurl="http://${env.HOSTNAME}:8080/buildresults/${project.name}"
- skipusers="false"
- reportsuccess="fixes"
- spamwhilebroken="true">
- <always address="${mail.list}"/>
- </email>
- </publishers>
- </project>
-</cruisecontrol>
diff --git a/M4-RCs/qpid/cc/config/cpp-perftests.xml b/M4-RCs/qpid/cc/config/cpp-perftests.xml
deleted file mode 100644
index 8a5079b60b..0000000000
--- a/M4-RCs/qpid/cc/config/cpp-perftests.xml
+++ /dev/null
@@ -1,63 +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.
--->
-
-<cruisecontrol>
-
- <project name="qpid-cpp-trunk-perftests"
- buildafterfailed="false">
-
- <listeners>
- <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
- </listeners>
-
- <bootstrappers>
- <svnbootstrapper localWorkingCopy="../cpp" />
- <svnbootstrapper localWorkingCopy="../specs" />
- <svnbootstrapper localWorkingCopy="../python" />
- </bootstrappers>
-
- <modificationset quietperiod="30">
- <alwaysbuild />
- </modificationset>
-
- <schedule>
- <ant target="cpp-perftests"
- uselogger="false"
- time="0000"
- timeout="3600"
- antworkingdir="scripts">
- </ant>
- </schedule>
-
- <publishers>
- <!--
- <email subjectprefix="CC report fro ${project.name}" mailhost="localhost"
- returnaddress="my_email"
- buildresultsurl="http://my_host:8080/buildresults/${project.name}"
- skipusers="false"
- reportsuccess="fixes"
- spamwhilebroken="true">
- <always address="email"/>
- <map alias="name" address="email"/>
- </email>
- -->
- </publishers>
-
- </project>
-</cruisecontrol>
diff --git a/M4-RCs/qpid/cc/config/cpp-trunk.xml b/M4-RCs/qpid/cc/config/cpp-trunk.xml
deleted file mode 100644
index 56e1d2bb54..0000000000
--- a/M4-RCs/qpid/cc/config/cpp-trunk.xml
+++ /dev/null
@@ -1,59 +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.
--->
-<cruisecontrol>
- <project name="qpid-cpp-trunk"
- buildafterfailed="false">
-
- <listeners>
- <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
- </listeners>
-
- <bootstrappers>
- <svnbootstrapper localWorkingCopy="../bin" />
- <svnbootstrapper localWorkingCopy="../cpp" />
- <svnbootstrapper localWorkingCopy="../specs" />
- <svnbootstrapper localWorkingCopy="../python" />
- </bootstrappers>
-
- <modificationset quietperiod="30">
- <svn localWorkingCopy="../bin"/>
- <svn localWorkingCopy="../cpp"/>
- <svn localWorkingCopy="../specs"/>
- <svn localWorkingCopy="../python"/>
- </modificationset>
-
- <schedule interval="3600">
- <exec timeout="1800"
- command="/bin/bash"
- args="../cc/scripts/cppbuild.sh"
- workingdir="../cpp" />
- </schedule>
-
- <publishers>
- <email subjectprefix="${mail.subject}: ${project.name}" mailhost="${mail.host}"
- returnaddress="${mail.returnaddress}"
- buildresultsurl="http://${env.HOSTNAME}:8080/buildresults/${project.name}"
- skipusers="false"
- reportsuccess="fixes"
- spamwhilebroken="true">
- <always address="${mail.list}"/>
- </email>
- </publishers>
- </project>
-</cruisecontrol>
diff --git a/M4-RCs/qpid/cc/config/dotnet-trunk.xml b/M4-RCs/qpid/cc/config/dotnet-trunk.xml
deleted file mode 100644
index 0d922967e4..0000000000
--- a/M4-RCs/qpid/cc/config/dotnet-trunk.xml
+++ /dev/null
@@ -1,63 +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.
--->
-<cruisecontrol>
- <project name="qpid-dotnet-trunk"
- buildafterfailed="false">
-
- <listeners>
- <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
- </listeners>
-
- <bootstrappers>
- <svnbootstrapper localWorkingCopy="../bin" />
- <svnbootstrapper localWorkingCopy="../dotnet/client-010" />
- <svnbootstrapper localWorkingCopy="../specs" />
- </bootstrappers>
-
- <modificationset quietperiod="30">
- <svn localWorkingCopy="../bin"/>
- <svn localWorkingCopy="../dotnet/client-010"/>
- <svn localWorkingCopy="../specs"/>
- </modificationset>
-
- <schedule interval="3600">
- <!-- generates code from specs -->
- <ant target="build"
- uselogger="false"
- antworkingdir="../dotnet/client-010/gentool">
- </ant>
-
- <exec timeout="1800"
- command="/bin/bash"
- args="../cc/scripts/dotnetbuild.sh"
- workingdir="../dotnet/client-010" />
- </schedule>
-
- <publishers>
- <email subjectprefix="${mail.subject}: ${project.name}" mailhost="${mail.host}"
- returnaddress="${mail.returnaddress}"
- buildresultsurl="http://${env.HOSTNAME}:8080/buildresults/${project.name}"
- skipusers="false"
- reportsuccess="fixes"
- spamwhilebroken="true">
- <always address="${mail.list}"/>
- </email>
- </publishers>
- </project>
-</cruisecontrol>
diff --git a/M4-RCs/qpid/cc/config/example-automation.xml b/M4-RCs/qpid/cc/config/example-automation.xml
deleted file mode 100644
index 52dd135c24..0000000000
--- a/M4-RCs/qpid/cc/config/example-automation.xml
+++ /dev/null
@@ -1,58 +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.
--->
-<cruisecontrol>
- <project name="qpid-example-automation"
- buildafterfailed="false">
-
- <listeners>
- <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
- </listeners>
-
- <modificationset quietperiod="30">
- <buildstatus logdir="logs/qpid-cpp-trunk/"/>
- <buildstatus logdir="logs/qpid-java-trunk/"/>
- <buildstatus logdir="logs/bdbstore-cpp-trunk/"/>
- </modificationset>
-
- <schedule interval="3600">
- <exec timeout="1800"
- command="/bin/bash"
- args="${env.CC_HOME}/cc/scripts/check_examples.sh"
- errorstr="FAILED"
- workingdir="./"/>
- </schedule>
-
- <publishers>
- <artifactspublisher dest="artifacts/${project.name}"
- file="${env.CC_HOME}/broker.log"/>
- <artifactspublisher dest="artifacts/${project.name}"
- file="${env.CC_HOME}/script.log"/>
-
-
- <email subjectprefix="${mail.subject}: ${project.name}" mailhost="${mail.host}"
- returnaddress="${mail.returnaddress}"
- buildresultsurl="http://${env.HOSTNAME}:8080/buildresults/${project.name}"
- skipusers="false"
- reportsuccess="fixes"
- spamwhilebroken="true">
- <always address="${mail.list}"/>
- </email>
- </publishers>
- </project>
-</cruisecontrol>
diff --git a/M4-RCs/qpid/cc/config/java-jmstck.xml b/M4-RCs/qpid/cc/config/java-jmstck.xml
deleted file mode 100644
index 2b10b0c5b5..0000000000
--- a/M4-RCs/qpid/cc/config/java-jmstck.xml
+++ /dev/null
@@ -1,63 +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.
--->
-
-<cruisecontrol>
- <project name="qpid-java-jmstck"
- buildafterfailed="false">
-
- <listeners>
- <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
- </listeners>
-
- <modificationset quietperiod="30">
- <buildstatus logdir="logs/qpid-cpp-trunk/"/>
- <buildstatus logdir="logs/qpid-java-trunk/"/>
- </modificationset>
-
- <schedule>
- <ant target="tck"
- uselogger="false"
- time="0000"
- timeout="3600"
- antworkingdir="scripts">
- </ant>
- </schedule>
-
- <publishers>
- <artifactspublisher dest="artifacts/${project.name}"
- file="${env.TS_HOME}/tck1.log"/>
- <artifactspublisher dest="artifacts/${project.name}"
- file="${env.TS_HOME}/tck2.log"/>
-
- <onfailure>
- <artifactspublisher dest="artifacts/${project.name}"
- file="${env.CC_HOME}/jmstck-broker.log"/>
- </onfailure>
-
- <email subjectprefix="RHEL5/64" mailhost="localhost"
- returnaddress="qpid-test-cruisecontrol@qpid-test.lab.bos.redhat.com"
- buildresultsurl="http://qpid-test.lab.bos.redhat.com:8080/buildresults/${project.name}"
- skipusers="false"
- reportsuccess="fixes"
- spamwhilebroken="true">
- <always address="amqp-list@redhat.com"/>
- </email>
- </publishers>
- </project>
-</cruisecontrol>
diff --git a/M4-RCs/qpid/cc/config/java-perftests.xml b/M4-RCs/qpid/cc/config/java-perftests.xml
deleted file mode 100644
index 45e1b14b9f..0000000000
--- a/M4-RCs/qpid/cc/config/java-perftests.xml
+++ /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.
--->
-
-<cruisecontrol>
- <project name="qpid-java-perftests"
- buildafterfailed="false">
-
- <listeners>
- <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
- </listeners>
-
- <bootstrappers>
- <svnbootstrapper localWorkingCopy="../java/perftests"/>
- </bootstrappers>
-
- <modificationset quietperiod="30">
- <buildstatus logdir="logs/qpid-cpp-trunk/"/>
- <buildstatus logdir="logs/qpid-java-trunk/"/>
- <svn localWorkingCopy="../java/perftests"/>
- </modificationset>
-
- <schedule interval="3600">
- <composite>
- <!-- 0.10 C++ broker -->
- <exec timeout="1800"
- command="/bin/bash"
- args="../cc/scripts/runbroker.sh"
- workingdir="../java"/>
- <ant target="all-tests"
- uselogger="false"
- antworkingdir="../java/perftests">
- <jvmarg arg="-Xmx1024m"/>
- </ant>
- <exec timeout="1800"
- command="/bin/bash"
- args="../cc/scripts/stopbroker.sh"
- workingdir="../java"/>
- </composite>
- </schedule>
-
- <publishers>
- <artifactspublisher dest="artifacts/${project.name}"
- subdirectory="results"
- dir="../java/perftests/results"/>
-
- <email subjectprefix="${mail.subject}: ${project.name}" mailhost="${mail.host}"
- returnaddress="${mail.returnaddress}"
- buildresultsurl="http://${env.HOSTNAME}:8080/buildresults/${project.name}"
- skipusers="false"
- reportsuccess="fixes"
- spamwhilebroken="true">
- <always address="${mail.list}"/>
- </email>
- </publishers>
- </project>
-</cruisecontrol>
diff --git a/M4-RCs/qpid/cc/config/java-trunk.xml b/M4-RCs/qpid/cc/config/java-trunk.xml
deleted file mode 100644
index 99f469725b..0000000000
--- a/M4-RCs/qpid/cc/config/java-trunk.xml
+++ /dev/null
@@ -1,142 +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.
--->
-
-<cruisecontrol>
- <project name="qpid-java-trunk"
- buildafterfailed="false">
-
- <listeners>
- <currentbuildstatuslistener file="logs/${project.name}/status.txt"/>
- </listeners>
-
- <bootstrappers>
- <svnbootstrapper localWorkingCopy="../java"/>
- <svnbootstrapper localWorkingCopy="../gentools"/>
- </bootstrappers>
-
- <modificationset quietperiod="30">
- <buildstatus logdir="logs/qpid-cpp-trunk/"/>
- <buildstatus logdir="logs/bdbstore-cpp-trunk/"/>
- <svn localWorkingCopy="../java"/>
- <svn localWorkingCopy="../gentools"/>
- </modificationset>
-
- <schedule interval="3600">
- <composite>
-
- <exec timeout="1800"
- command="/bin/bash"
- args="../cc/scripts/javaconfig.sh"
- workingdir="../java"/>
- <!-- in VM 0.8 -->
- <ant target="clean test"
- uselogger="false"
- antworkingdir="../java">
- <jvmarg arg="-Xmx1024m"/>
- </ant>
-
- <ant target="report"
- uselogger="false"
- antworkingdir="../java">
- <jvmarg arg="-Xmx1024m"/>
- </ant>
- <exec timeout="1800"
- command="/bin/bash"
- args="../cc/scripts/javareport.sh 08"
- workingdir="../java"/>
-
- <!-- cpp -->
- <ant target="test"
- uselogger="false"
- antworkingdir="../java">
- <jvmarg arg="-Xmx1024m"/>
- <property name="profile" value="cpp"/>
- </ant>
- <ant target="report"
- uselogger="false"
- antworkingdir="../java">
- <jvmarg arg="-Xmx1024m"/>
- </ant>
- <exec timeout="1800"
- command="/bin/bash"
- args="../cc/scripts/javareport.sh cpp"
- workingdir="../java"/>
-
- <!-- cpp no prefetch -->
- <ant target="test"
- uselogger="false"
- antworkingdir="../java">
- <jvmarg arg="-Xmx1024m"/>
- <property name="profile" value="cpp.noprefetch"/>
- </ant>
- <ant target="report"
- uselogger="false"
- antworkingdir="../java">
- <jvmarg arg="-Xmx1024m"/>
- </ant>
- <exec timeout="1800"
- command="/bin/bash"
- args="../cc/scripts/javareport.sh cpp-noprefetch"
- workingdir="../java"/>
-
- <!-- make the release
- <ant target="release"
- uselogger="false"
- antworkingdir="../java">
- <jvmarg arg="-Xmx1024m"/>
- </ant>
- -->
- </composite>
- </schedule>
-
- <publishers>
- <onfailure>
- <antpublisher target="report"
- uselogger="false"
- antworkingdir="../java">
- <jvmarg arg="-Xmx1024m"/>
- </antpublisher>
- </onfailure>
- <artifactspublisher dest="artifacts/${project.name}"
- subdirectory="report_08"
- dir="../java/build/report_08"/>
-
- <artifactspublisher dest="artifacts/${project.name}"
- subdirectory="report_cpp"
- dir="../java/build/report_cpp"/>
-
- <artifactspublisher dest="artifacts/${project.name}"
- subdirectory="report_cpp-noprefetch"
- dir="../java/build/report_cpp-noprefetch"/>
-
- <artifactspublisher dest="artifacts/${project.name}"
- subdirectory="report-fault"
- dir="../java/build/report"/>
-
- <email subjectprefix="${mail.subject}: ${project.name}" mailhost="${mail.host}"
- returnaddress="${mail.returnaddress}"
- buildresultsurl="http://${env.HOSTNAME}:8080/buildresults/${project.name}"
- skipusers="false"
- reportsuccess="fixes"
- spamwhilebroken="true">
- <always address="${mail.list}"/>
- </email>
- </publishers>
- </project>
-</cruisecontrol>
diff --git a/M4-RCs/qpid/cc/config/java/cpp.noprefetch.testprofile b/M4-RCs/qpid/cc/config/java/cpp.noprefetch.testprofile
deleted file mode 100644
index 694451e551..0000000000
--- a/M4-RCs/qpid/cc/config/java/cpp.noprefetch.testprofile
+++ /dev/null
@@ -1,4 +0,0 @@
-broker.version=0-10
-broker=${project.root}/../cpp/src/qpidd --data-dir ${build.data} -t --load-module store_home/lib/.libs/libbdbstore.so --auth no --no-module-dir
-max_prefetch=0
-test.excludesfile=${project.root}/010ExcludeList-noPrefetch \ No newline at end of file
diff --git a/M4-RCs/qpid/cc/config/java/cpp.testprofile b/M4-RCs/qpid/cc/config/java/cpp.testprofile
deleted file mode 100644
index 7dcf75bac9..0000000000
--- a/M4-RCs/qpid/cc/config/java/cpp.testprofile
+++ /dev/null
@@ -1,3 +0,0 @@
-broker.version=0-10
-broker=${project.root}/../cpp/src/qpidd --data-dir ${build.data} -t --load-module store_home/lib/.libs/libbdbstore.so --auth no --no-module-dir
-test.excludesfile=${project.root}/010ExcludeList-store
diff --git a/M4-RCs/qpid/cc/config/java/jndi.properties b/M4-RCs/qpid/cc/config/java/jndi.properties
deleted file mode 100644
index 9340163622..0000000000
--- a/M4-RCs/qpid/cc/config/java/jndi.properties
+++ /dev/null
@@ -1,42 +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.
-#
-#
-
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-
-connectionfactory.QueueConnectionFactory = amqp://username:password@topicClientid/test?brokerlist='tcp://localhost:qpid_port'
-connectionfactory.TopicConnectionFactory = amqp://username:password@topicClientid/test?brokerlist='tcp://localhost:qpid_port'
-connectionfactory.jms/DURABLE_SUB_CONNECTION_FACTORY = amqp://username:password@duralbeTopicClientid/test?brokerlist='tcp://localhost:qpid_port'
-connectionfactory.jms/MyTopicConnectionFactory = amqp://username:password@myTopicClientid/test?brokerlist='tcp://localhost:qpid_port'
-connectionfactory.jms/TopicConnectionFactory = amqp://username:password@jmsTopicClientid/test?brokerlist='tcp://localhost:qpid_port'
-
-queue.MY_QUEUE=MY_QUEUE
-queue.MY_QUEUE2=MY_QUEUE2
-queue.testQ0=testQ0
-queue.testQ1=testQ1
-queue.testQ2=testQ2
-queue.testQueue2=testQueue2
-queue.Q2=Q2
-
-topic.MY_TOPIC=MY_TOPIC
-topic.MY_TOPIC1=MY_TOPIC1
-
-destination.direct = direct://amq.direct//directQueue
-
diff --git a/M4-RCs/qpid/cc/dashboard-config.xml b/M4-RCs/qpid/cc/dashboard-config.xml
deleted file mode 100644
index 9304322853..0000000000
--- a/M4-RCs/qpid/cc/dashboard-config.xml
+++ /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.
--->
-
- <dashboard>
- <buildloop
- logsdir="logs/"
- artifactsdir="artifacts" />
- <features allowforcebuild="true"/>
- <trackingtool projectname="cc" baseurl="http://localhost:8080/" keywords="QPID"/>
- <subtabs>
- <subtab class="net.sourceforge.cruisecontrol.dashboard.widgets.ErrorsAndWarningsMessagesWidget" />
- </subtabs>
-</dashboard>
-
diff --git a/M4-RCs/qpid/cc/scripts/bdbstorecppbuild.sh b/M4-RCs/qpid/cc/scripts/bdbstorecppbuild.sh
deleted file mode 100755
index 3385c8d2f4..0000000000
--- a/M4-RCs/qpid/cc/scripts/bdbstorecppbuild.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-###########################################################
-#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.
-###########################################################
-
-if [ -f Makefile ]; then
- make distclean
-fi
- ./bootstrap && ./configure CXXFLAGS="-O3 -DNDEBUG" --with-qpid-checkout=$CC_HOME && make
diff --git a/M4-RCs/qpid/cc/scripts/build.xml b/M4-RCs/qpid/cc/scripts/build.xml
deleted file mode 100644
index 2144020017..0000000000
--- a/M4-RCs/qpid/cc/scripts/build.xml
+++ /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.
--->
-
-<project name="run-tests" default="cpp-perftests" basedir=".">
-
- <target name="cpp-perftests">
- <exec executable="./cppbuild-perftests.sh" failonerror="true"/>
- </target>
-
- <target name="tck">
- <exec executable="./javajmstck.sh"/>
- </target>
-
-</project>
diff --git a/M4-RCs/qpid/cc/scripts/check_examples.sh b/M4-RCs/qpid/cc/scripts/check_examples.sh
deleted file mode 100755
index c10936b36c..0000000000
--- a/M4-RCs/qpid/cc/scripts/check_examples.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-###########################################################
-#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.
-###########################################################
-
-runVerifyScript()
-{
- echo "-----------<Run verify scripts>-------------"
- $CC_HOME/cc/scripts/verify_all
- echo "-----------</Run verify scripts>------------"
- echo ""
-}
-
-cleanup()
-{
-rm -f $CC_HOME/script.log
-rm -f $CC_HOME/status.log
-rm -f $CC_HOME/broker.log
-}
-
-checkErrors()
-{
-if test `cat $CC_HOME/script.log | grep -c 'FAIL'` -gt 0
-then
- echo "FAILED"
- printErrors > $CC_HOME/status.log
-fi
-}
-
-printErrors(){
- echo "<desc>The following scripts had failures"
- cat CC_HOME/script.log | awk '{
- script = ""
- while ((getline) == 1)
- {
- if ($1 == "script:")
- {
- script = $0
- }
- if ($1 == "FAIL")
- {
- print substr(script,9)
- }
- }}'
- echo "</desc>"
-}
-
-echo "*************************************"
-echo "Example Automation "
-echo ""
-cleanup
-runVerifyScript
-checkErrors
-echo "*************************************"
diff --git a/M4-RCs/qpid/cc/scripts/cppbuild-perftests.sh b/M4-RCs/qpid/cc/scripts/cppbuild-perftests.sh
deleted file mode 100755
index 782a472175..0000000000
--- a/M4-RCs/qpid/cc/scripts/cppbuild-perftests.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-###########################################################
-#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.
-###########################################################
-
-cd $CC_HOME/cpp
-svn stat --no-ignore | awk '/^[I?]/{print $2}' | xargs rm -r
-./bootstrap && ./configure CXXFLAGS="-O3 -DNDEBUG" && make -j4 all && cd src/tests && make -j4 check
diff --git a/M4-RCs/qpid/cc/scripts/cppbuild.sh b/M4-RCs/qpid/cc/scripts/cppbuild.sh
deleted file mode 100755
index b63feb7141..0000000000
--- a/M4-RCs/qpid/cc/scripts/cppbuild.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash -x
-###########################################################
-#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.
-###########################################################
-
-make distclean && ./bootstrap && ./configure && make \ No newline at end of file
diff --git a/M4-RCs/qpid/cc/scripts/dotnetbuild.sh b/M4-RCs/qpid/cc/scripts/dotnetbuild.sh
deleted file mode 100644
index 51d2110757..0000000000
--- a/M4-RCs/qpid/cc/scripts/dotnetbuild.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash -x
-###########################################################
-#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.
-###########################################################
-
-mono $NANT_HOME/bin/NAnt.exe test \ No newline at end of file
diff --git a/M4-RCs/qpid/cc/scripts/javaconfig.sh b/M4-RCs/qpid/cc/scripts/javaconfig.sh
deleted file mode 100755
index 7a1a3a1a7d..0000000000
--- a/M4-RCs/qpid/cc/scripts/javaconfig.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-###########################################################
-#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.
-###########################################################
-
-# copy the profiles
-sed "s#store_home#$CPPSTORE_HOME#g" $CC_HOME/cc/config/java/cpp.noprefetch.testprofile > "$CC_HOME/java/"/cpp.noprefetch.testprofile
-sed "s#store_home#$CPPSTORE_HOME#g" $CC_HOME/cc/config/java/cpp.testprofile > "$CC_HOME/java"/cpp.testprofile
-QPID_JARS=`find "$CC_HOME/java/build/lib" -name '*.jar' | tr '\n' ":"`
-QPID_JARS=local.classes=$QPID_JARS
-sed "s#local.classes=.*#$QPID_JARS#g" $TS_HOME/bin/build.properties > "$TS_HOME/bin"/build.properties-new
-mv $TS_HOME/bin/build.properties-new $TS_HOME/bin/build.properties \ No newline at end of file
diff --git a/M4-RCs/qpid/cc/scripts/javajmstck.sh b/M4-RCs/qpid/cc/scripts/javajmstck.sh
deleted file mode 100644
index 9d279ed38e..0000000000
--- a/M4-RCs/qpid/cc/scripts/javajmstck.sh
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-cleanup(){
- echo "kill any existing broker instance"
- stopBroker
- rm -rf $CC_HOME/jmstck-data/*
-}
-
-runBroker(){
- echo "******************************************************"
- echo "Starting C++ broker"
- ulimit -c unlimited
- $CC_HOME/cpp/src/qpidd -t -d --data-dir $CC_HOME/jmstck-data --load-module=$CPPSTORE_HOME/lib/.libs/libbdbstore.so --port 0 --auth no --log-output $CC_HOME/jmstck-broker.log --no-module-dir
- export QPID_PORT=`grep "Listening on TCP port" $CC_HOME/jmstck-broker.log | tail -n 1 | awk '{print $8}'`
- echo " broker running on port: " $QPID_PORT
- echo "******************************************************"
- sed "s/qpid_port/$QPID_PORT/g" $CC_HOME/cc/config/java/jndi.properties > "$TS_HOME/classes"/jndi.properties
-}
-
-runTck(){
- echo "******************************************************"
- echo "Starting the TCK for the $1 iteration"
- echo "******************************************************"
- cd $TS_HOME/bin
- $TS_HOME/bin/tsant runclient -Dwork.dir=work -Dreport.dir=report 2&>1 > $TS_HOME/tck$1.log
- echo "******************************************************"
- echo "TCK finished the $1 iteration"
- echo "******************************************************"
-}
-
-printResults(){
- TESTS_STR=`grep -a "\[java\] Completed running [0-9]* tests" $TS_HOME/tck$1.log`
- PASSED_STR=`grep -a "\[java\] Number of Tests Passed =" $TS_HOME/tck$1.log`
- FAILED_STR=`grep -a "Some tests did not pass" $TS_HOME/tck$1.log`
- echo "-----------------------------------------"
- echo "TCK run #$1 results:"
- echo $TESTS_STR
- echo $PASSED_STR
- echo $FAILED_STR
- if [ "$FAILED_STR" != "" ]; then
- echo "SOME TCK FAILURES DETECTED: "
- fi
- echo "------------------------------------------"
-}
-
-stopBroker(){
- echo "************************"
- echo "Stopping the C++ broker"
- echo "************************"
- $CC_HOME/cpp/src/qpidd -q -p $QPID_PORT
-}
-
-cleanup
-counter=0
-runBroker
-for j in 1 2
-do
- counter=`expr $counter + 1`
- runTck $counter
- printResults $counter
-done
-cleanup
diff --git a/M4-RCs/qpid/cc/scripts/javareport.sh b/M4-RCs/qpid/cc/scripts/javareport.sh
deleted file mode 100755
index 2b2469d31d..0000000000
--- a/M4-RCs/qpid/cc/scripts/javareport.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-###########################################################
-#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.
-###########################################################
-cd "$CC_HOME/java/build"
-pwd
-if [[ -d report_$1 ]]; then rm -fr report_$1; fi
-if [[ -d report ]]; then mv report report_$1; fi
-rm -rf ./results/*
-rm -rf ./data/* \ No newline at end of file
diff --git a/M4-RCs/qpid/cc/scripts/runbroker.sh b/M4-RCs/qpid/cc/scripts/runbroker.sh
deleted file mode 100644
index 43d9b39056..0000000000
--- a/M4-RCs/qpid/cc/scripts/runbroker.sh
+++ /dev/null
@@ -1,42 +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.
-###########################################################
-
-cleanup()
-{
- echo "******************************************************"
- echo "Cleanup"
- echo "******************************************************"
- for PID in `ps aux | grep 'qpidd'|grep 'broker.log'|grep -v 'grep'|awk '{ print $2 }'`
- do
- kill -9 $PID
- done
-}
-
-run_broker()
-{
- echo "******************************************************"
- echo "Starting C++ broker"
- echo "******************************************************"
- echo ""
- $CC_HOME/cpp/src/qpidd -t -d --auth no --no-data-dir --log-output $CC_HOME/broker.log
-}
-
-cleanup
-run_broker \ No newline at end of file
diff --git a/M4-RCs/qpid/cc/scripts/stopbroker.sh b/M4-RCs/qpid/cc/scripts/stopbroker.sh
deleted file mode 100644
index f5839e141f..0000000000
--- a/M4-RCs/qpid/cc/scripts/stopbroker.sh
+++ /dev/null
@@ -1,31 +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.
-###########################################################
-
-
-stop_broker()
-{
- echo "******************************************************"
- echo "Stopping the C++ broker"
- echo "******************************************************"
- echo ""
- $CC_HOME/cpp/src/qpidd -q
-}
-
-stop_broker \ No newline at end of file
diff --git a/M4-RCs/qpid/cc/scripts/verify b/M4-RCs/qpid/cc/scripts/verify
deleted file mode 100755
index 35191b17c9..0000000000
--- a/M4-RCs/qpid/cc/scripts/verify
+++ /dev/null
@@ -1,100 +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.
-###########################################################
-
-export DOTNET_EXAMPLES=$CC_HOME/dotnet/client-010/bin/mono-2.0/debug
-export CLASSPATH=`find "$CC_HOME/java/build/lib" -name '*.jar' | tr '\n' ":"`
-export CPP=$CC_HOME/cpp/examples
-export JAVA=$CC_HOME/java/client/example/src/main/java
-export PYTHONPATH=$CC_HOME/python/
-export PYTHON_EXAMPLES=$CC_HOME/python/examples
-
-cleanup() {
- test -n "$QPIDD" && $QPIDD -q # Private broker
- kill %% > /dev/null 2>&1 # Leftover background jobs
-}
-
-trap cleanup EXIT
-
-ARGS="${QPID_HOST:-localhost} $QPID_PORT"
-
-outfile() {
- file=$1
- while [ -f $file.out ]; do file="${file}X"; done
- echo $file.out
- }
-
-fail() { test -n "$*" && echo $* 1>&2 ; FAIL=1; return 1; }
-
-client()
-{
- "$@" $ARGS > `outfile $*` || fail;
-}
-
-clients() { for cmd in "$@"; do client $cmd; done; }
-
-waitfor() { until grep -a -l "$2" $1 >/dev/null 2>&1 ; do sleep 1 ; done ; }
-
-background() {
- pattern=$1; shift
- out=`outfile $*`
- eval "$* $ARGS > $out &" || { fail; return 1; }
- waitfor $out "$pattern"
-}
-
-name() {
- for x in $*; do name="$name `basename $x`"; done
- echo $name;
-}
-
-outputs() {
- wait 2> /dev/null # Wait for all backgroud processes to complete
- rm -f $script.out
- for f in "$@"; do
- { echo "==== `name $f`"; eval "cat $f"; } >> $script.out || fail
- rm -rf `echo $f| awk '{ print $1 }'`
- done
-}
-
-verify() {
- FAIL=
- if [ -d $1 ]; then dir=$1; script=verify;
- else dir=`dirname $1`; script=`basename $1`; fi
- cd $dir || return 1
- rm -f *.out
- echo "Running: $dir/$script"
- { source ./$script && diff -ac $script.out $script.in ; } || fail
- test -z "$FAIL" && rm -f *.out
- return $FAIL
-}
-
-HEX="[a-fA-F0-9]"
-remove_uuid() {
- sed "s/$HEX\{8\}-$HEX\{4\}-$HEX\{4\}-$HEX\{4\}-$HEX\{12\}//g" $*
-}
-remove_uuid64() {
- sed 's/[-A-Za-z0-9_]\{22\}==//g' $*
-}
-
-
-for example in "$@"; do
- echo "Running: $example "
- if ( verify $example; ) then echo "PASS"; else echo "FAIL"; RET=1; fi
- done
-exit $RET
diff --git a/M4-RCs/qpid/cc/scripts/verify_all b/M4-RCs/qpid/cc/scripts/verify_all
deleted file mode 100755
index 8d3ec669a7..0000000000
--- a/M4-RCs/qpid/cc/scripts/verify_all
+++ /dev/null
@@ -1,166 +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.
-###########################################################
-
-cleanup()
-{
- echo "******************************************************"
- echo "Cleanup"
- echo "******************************************************"
- for PID in `ps aux | grep 'qpidd'|grep 'broker.log'|grep -v 'grep'|awk '{ print $2 }'`
- do
- kill -9 $PID
- done
-}
-
-run_broker()
-{
- echo "******************************************************"
- echo "Starting C++ broker"
- echo "******************************************************"
- echo ""
- $CC_HOME/cpp/src/qpidd -t -d --auth no --no-data-dir --log-to-file $CC_HOME/broker.log
-}
-
-stop_broker()
-{
- echo "******************************************************"
- echo "Stopping the C++ broker"
- echo "******************************************************"
- echo ""
- $CC_HOME/cpp/src/qpidd -q
-}
-
-verify()
-{
- #echo "arg " $2 " path: " $1
- for dir in $(find $1 -mindepth 1 -maxdepth 1 -type d -not -name '*.svn' -not -name $3 )
- do
- echo $dir
- for script in $(find $dir -mindepth 1 -maxdepth 1 -type f -name $2 -not -name '*.*')
- do
- # echo "script:" $script
- cleanup
- run_broker
- $CC_HOME/cc/scripts/verify $script >> $CC_HOME/script.log 2>&1
- killall 'verify'
- stop_broker
- done
-done
-}
-
-run_python_python()
-{
-echo "-----------<Running Python/Python combination>---------"
-verify $CC_HOME/python/examples "verify" "xml-exchange"
-echo "-----------</Running Python/Python combination>---------"
-echo ""
-}
-
-
-run_cpp_cpp()
-{
-echo "-----------<Running C++/C++ combination>---------"
-verify $CC_HOME/cpp/examples "verify" "*.svn"
-echo "-----------</Running C++/C++ combination>--------"
-echo ""
-}
-
-run_python_cpp_comb()
-{
-echo "-----------<Running Python/C++ combination>---------"
-verify $CC_HOME/cpp/examples "verify_cpp_python" "*.svn"
-verify $CC_HOME/cpp/examples "verify_python_cpp" "*.svn"
-echo "-----------</Running Python/C++ combination>--------"
-echo ""
-}
-
-
-run_java_java()
-{
-echo "-----------<Running Java/Java combination>---------"
-verify $CC_HOME/java/client/example/src/main/java/org/apache/qpid/example/jmsexample "verify" "*.svn"
-echo "-----------</Running Java/Java combination>--------"
-echo ""
-}
-
-run_java_cpp_comb()
-{
-echo "-----------<Running Java/C++ combination>---------"
-verify $CC_HOME/java/client/example/src/main/java/org/apache/qpid/example/jmsexample "verify_java_cpp" "*.svn"
-verify $CC_HOME/java/client/example/src/main/java/org/apache/qpid/example/jmsexample "verify_cpp_java" "*.svn"
-echo "-----------</Running Java/C++ combination>--------"
-echo ""
-}
-
-run_java_python_comb()
-{
-echo "-----------<Running Java/Python combination>---------"
-verify $CC_HOME/java/client/example/src/main/java/org/apache/qpid/example/jmsexample "verify_java_python" "*.svn"
-verify $CC_HOME/java/client/example/src/main/java/org/apache/qpid/example/jmsexample "verify_python_java" "*.svn"
-echo "-----------</Running Java/Python combination>--------"
-echo ""
-}
-
-run_dotnet_dotnet()
-{
-echo "-----------<Running .Net/.Net combination>---------"
-verify $CC_HOME/dotnet/client-010/examples/ "verify" "*.svn"
-echo "-----------</Running .Net/.Net combination>--------"
-echo ""
-}
-
-run_cpp_dotnet()
-{
-echo "-----------<Running C++/.Net combination>---------"
-verify $CC_HOME/dotnet/client-010/examples/ "verify_cpp_dotnet" "*.svn"
-verify $CC_HOME/dotnet/client-010/examples/ "verify_dotnet_cpp" "*.svn"
-echo "-----------</Running C++/.Net combination>--------"
-echo ""
-}
-
-run_java_dotnet()
-{
-echo "-----------<Running Java/.Net combination>---------"
-verify $CC_HOME/dotnet/client-010/examples/ "verify_java_dotnet" "*.svn"
-verify $CC_HOME/dotnet/client-010/examples/ "verify_dotnet_java" "*.svn"
-echo "-----------</Running Java/.Net combination>--------"
-echo ""
-}
-
-run_python_dotnet()
-{
-echo "-----------<Running Python/.Net combination>---------"
-verify $CC_HOME/dotnet/client-010/examples/ "verify_python_dotnet" "*.svn"
-verify $CC_HOME/dotnet/client-010/examples/ "verify_dotnet_python" "*.svn"
-echo "-----------</Running Python/.Net combination>--------"
-echo ""
-}
-
-
-run_python_python
-run_python_cpp_comb
-run_cpp_cpp
-run_java_java
-run_java_cpp_comb
-run_java_python_comb
-run_dotnet_dotnet
-run_cpp_dotnet
-run_java_dotnet
-run_python_dotnet \ No newline at end of file
diff --git a/M4-RCs/qpid/cpp/DESIGN b/M4-RCs/qpid/cpp/DESIGN
deleted file mode 100644
index c814f1c53d..0000000000
--- a/M4-RCs/qpid/cpp/DESIGN
+++ /dev/null
@@ -1,78 +0,0 @@
-Qpid C++ AMQP implementation
-=============================
-
-= Project layout =
-
-For Build system design see comment at start of Makefile.
-
-Project contains:
- * Client library (lib/libqpid_client): src/qpid/client
- * Broker library (lib/libqpid_broker): src/qpid/broker
- * Common classes
- * src/qpid/framing: wire encoding/decoding
- * src/qpid/sys: io, threading etc
- * src/qpid/Exception.cpp, QpidError.cpp: Exception classes.
- * Qpid Daemon (bin/qpidd): src/qpidd.cpp
-
-Unit tests in test/unit: each *Test.cpp builds a CppUnit plugin.
-
-Client tests in test/client: each *.cpp builds a test executable.
-
-Test utilities: test/include
-
-= Client Design =
-
-The client module is primarily concerned with presenting the
-functionality offered by AMQP to users through a simple API that
-nevertheless allows all the protocol functionality to be exploited.
-[Note: it is currently nothing like complete in this regard!]
-
-The code in the client module is concerned with the logic of the AMQP
-protocol and interacts with the lower level transport issues through
-the InputHandler and OutputHandler abstractions defined in
-common/framing. It uses these in conjunction with the Connector
-interface, defined in common/io, for establishing a connection to the
-broker and interacting with it through the sending and receiving of
-messages represented by AMQFrame (defined in common/framing).
-
-The Connector implementation is responsible for connection set up,
-threading strategy and getting data on and off the wire. It delegates
-to the framing module for encode/decode operations. The interface
-between the io and the framing modules is primarily through the Buffer
-and AMQFrame classes.
-
-A Buffer allows 'raw' data to be read or written in terms of the AMQP
-defined 'types' (octet, short, long, long long, short string, long
-string, field table etc.). AMQP is defined in terms frames with
-specific bodies and the frame (as well as these different bodies) are
-defined in terms of these 'types'. The AMQFrame class allows a frame
-to be decoded by reading from the supplied buffer, or it allows a
-particular frame to be constructed and then encoded by writing to the
-supplied buffer. The io layer can then access the raw data that
-'backs' the buffer to either out it on the wire or to populate it from
-the wire.
-
-One minor exception to this is the protocol initiation. AMQP defines
-a protocol 'header', that is not a frame, and is sent by a client to
-intiate a connection. The Connector allows (indeed requires) such a
-frame to be passed in to initialise the connection (the Acceptor, when
-defined, will allow an InitiationHandler to be set allowing the broker
-to hook into the connection initiation). In order to remove
-duplication, the ProtocolInitiation class and the AMQFrame class both
-implement a AMQDataBlock class that defines the encode and decode
-methods. This allows both types to be treated generically for the
-purposes of encoding. In decoding, the context determines which type
-is expected and should be used for decoding (this is only relevant to
-the broker).
-
-
-
-
- --------api--------
- Client Impl ...............uses.....
-input handler --> --------- --------- <-- output handler .
- A | .
- | | framing utils
- | V .
- ------------------- <-- connector .
- IO Layer ................uses....
diff --git a/M4-RCs/qpid/cpp/INSTALL b/M4-RCs/qpid/cpp/INSTALL
deleted file mode 100644
index 1760ae2706..0000000000
--- a/M4-RCs/qpid/cpp/INSTALL
+++ /dev/null
@@ -1,335 +0,0 @@
- Installing Qpid/C++
- ===================
-
-Table of Contents
-=================
-1. Introduction
-
-2. Prerequisites
- 2.1. What to Install
- 2.2. How to Install
- 2.2.1. Using Package Management Tools
- 2.2.2. From Source
- a. openais
- b. boost
- c. autotools
- 2.3. Important Environment Variable Settings
-
-3. Building from a Source Distribution
-4. Building a Repository Working Copy
-5. Portability
-6. Tests
-7. Doxygen
-8. Troubleshooting
-
-
-1. Introduction
-===============
-Note that the daemon and client API can be installed separately.
-
-This document describes how to build the Qpid/C++ broker and client, either
-from a checkout of the source or from a source distribution, on Linux/UNIX.
-Please see INSTALL-WINDOWS for information on building on Windows.
-
-This also explains how to install the required prerequisites for Qpid/C++.
-
-
-2. Prerequisites
-================
-We prefer to avoid spending time accommodating older versions of these
-packages, so please make sure that you have the latest stable versions.
-Known version numbers for a succesfull build are given in brackets, take
-these as a recommended minimum version. Older unix versions, for example,
-Redhat Linux 3, will almost certainly require some packages to be upgraded.
-
-
-2.1. What to Install
-====================
-The following libraries and header files must be installed to build
-a source distribution:
- * boost <http://www.boost.org> (1.35)(*)
- * e2fsprogs <http://e2fsprogs.sourceforge.net/> (1.39)
- * pkgconfig <http://pkgconfig.freedesktop.org/wiki/> (0.21)
-
-(*) earlier versions of boost e.g. 1.33 also work and there is a patch
-to get 1.32 working in the svn tree though that is only recommended as
-a last resort.
-
-Optional cluster functionality requires:
- * openais <http://openais.org/> (0.80.3)
-
-Optional XML exchange requires:
- * xqilla <http://xqilla.sourceforge.net/HomePage> (2.0.0)
- * xerces-c <http://xerces.apache.org/xerces-c/> (2.7.0)
-
-Optional SSL support requires:
-* nss <http://www.mozilla.org/projects/security/pki/nss/>
-* nspr <http://www.mozilla.org/projects/nspr/>
-
-Qpid has been built using the GNU C++ compiler:
- * gcc <http://gcc.gnu.org/> (3.4.6)
-
-If you want to build directly from the SVN repository you will need
-all of the above plus:
-
- * GNU make <http://www.gnu.org/software/make/> (3.8.0)
- * autoconf <http://www.gnu.org/software/autoconf/> (2.61)
- * automake <http://www.gnu.org/software/automake/> (1.9.6)
- * help2man <http://www.gnu.org/software/help2man/> (1.36.4)
- * libtool <http://www.gnu.org/software/libtool/> (1.5.22)
- * doxygen <ftp://ftp.stack.nl/pub/users/dimitri/> (1.5.1)
- * graphviz <http://www.graphviz.org/> (2.12)
- * ruby 1.8 <http://www.ruby-lang.org> (1.8.4)
-
-
-NOTE: make sure to install the related '-devel' packages also!
-
-
-2.2. How to Install
-===================
-
-2.2.1. Using Package Management Tools
-=====================================
-
-On linux most packages can be installed using your distribution's
-package management tool. For example on Fedora:
-
- # yum install boost-devel e2fsprogs-devel pkgconfig gcc-c++ make autoconf automake ruby libtool help2man doxygen graphviz
-
-The optional clustering packages changed name in Fedora 10. On Fedora 9 or earlier:
- # yum install openais-devel cman-devel
-On Fedora 10 or later
- # yum install corosync-devel cmanlib-devel
-
-Follow the manual installation instruction below for any packages not
-available through your distributions packaging tool.
-
-2.2.2. From Source
-==================
-Required dependencies can be installed and built from source distributions.
-It is recommended that you create a directory to install them to, for example,
-~/qpid-tools.
-
- To build and install the dependency pakcages:
-
- 1. Unzip and untar them and cd to the untared directory.
- 2. do:
- # ./configure --prefix=~/qpid-tools
- # make install
-
-The exceptions are openais and boost.
-
-a. openais
-==========
-
-If ais is shipped with you platform and you have 0.80.3-x or later, skip
-builing ais
-
-To build ais: Unpack the source distribution and do:
- # make
- # sudo make install DESTDIR=
- # sudo ldconfig
-
-This will install in the standard places (/usr/lib, /usr/include etc.)
-
-Configuring ais:
-
-Edit /etc/ais/openais.conf and modify the "bindnetaddr" setting
-to your hosts IP address. Do not use 127.0.0.1.
-
-Make sure the UDP port set for mcastport in openais.conf (5405 by
-default) is not blocked by your firewall. Disable the firewall or
-configure it to allow this port for UDP.
-
-Finally start the ais daemon (must be done as root):
- # sudo /sbin/aisexec
-
-Note that to run the AIS tests your primary group must be "ais". You
-can change your primary group with the usermod command or set it
-temporarily with the newgrp command.
-
-Troubleshooting tips:
-
-If aisexec goes into a loop printing "entering GATHER state", verify
-your firewall is allowing UDP traffic on the mcastport set in
-openais.conf.
-
-If aisexec reports "got nodejoin message 127.0.0.1" verify the
-bindnetaddr in openais.conf is an active local IP address. ifconfig
-will list local addresses.
-
-When aisexec is working correctly, the start-up log messages will end
-with "entering OPERATIONAL state." and "got nodejoin message <ip
-address>" where <ip address> is the local IP address specified for
-bindnetaddr in openais.conf.
-
-For further info on openais http://openais.org/
-
-b. boost
-========
- 1. Unpack boost-jam.
- 2. Add bjam in the unpacked directory to your path.
- 3. Unpack boost and cd to the boost untarred directory.
- 4. do:
-
- # bjam toolset=gcc variant=release threading=single link=shared \
- --layout=system --prefix=~/qpid-tools install
-
-c. autotools
-============
-If you don't have sufficiently up-to-date autotools you can get the
-latest by running the script qpid-autotools-install.
-
-1. Decide where you would like to install the tools. It should be in a
- local directory so that you do not need root privileges. (Suggest
- $HOME/qpid-tools.) Create an empty directory.
-2. Modify your environment variable PATH to ensure that the bin directory
- within this directory comes first in the PATH string:
- PATH=$HOME/qpid-tools/bin:$PATH
-3. Set PKG_CONFIG_PATH=$HOME/qpid-tools/lib/pkgconfig:/usr/lib/pkgconfig
- (or if it already exists, make sure that the above path to your
- qpid-tools directory is first).
-4. Run the install utility from the cpp directory:
- ./qpid-autotools-install --prefix=$HOME/qpid-tools --skip-check
- (Note that --prefix will only accept an absolute path, so don't use
- ~/qpid-tools.) The utility will download, compile and install the
- required tools into the qpid-tools directory (this may take a little
- time). Watch for any notices about paths at the end of the install -
- this means that your environment is not correct - see steps 2 and 3
- above.
- NOTE: If you omit the --skip-check option, the check of the build
- can add up to an hour to what is normally a few minutes of install
- time.
-5. Perform a check: from the command-line run "which automake" and
- ensure that it finds the automake in your qpid-tools directory. If not,
- check that the build completed normally and your environment.
-6. (Optional) If having the build artifacts lying around bothers you, delete
- the (hidden) build directory cpp/.build-auto-tools.
-
-To see help, run ./qpid-autotools-install --help.
-
-
-2.3. Important Environment Variable Settings
-============================================
-Ensure that all the build tools are available on your path, when they are
-manually installed to non-standard locations. For example:
-
- # export PATH=~/qpid-tools/bin:$PATH
-
-Ensure that pkg-config is set up correctly. For example:
-
- # export PKG_CONFIG_PATH=~/qpid-tools/lib/pkgconfig:/usr/local/pkgconfig
- # export PKG_CONFIG=~/qpid-tools/bin/pkg-config
-
-Ensure that the boost libraries are made available on the gcc library path.
-For example:
-
- # export CXXFLAGS=-I~/qpid-tools/include/boost-1_33_1
-
-
-3. Building from a Source Distribution
-======================================
-In the distribution directory
-
-Build and install with:
-
- # ./configure --prefix=<install_location>
- # make all
- # make install
-
-To build and test everything:
-
- # make
- # make check
-
-This builds in the source tree. You can have multiple builds in the
-same working copy with different configuration. For example you can do
-the following to build twice, once for debug, the other with
-optimization:
-
- # make distclean
- # mkdir .build-dbg .build-opt
- # (cd .build-opt ../configure --prefix=/tmp/x && make && make check)
- # (cd .build-dbg ../configure CXXFLAGS=-g --prefix=/tmp/x \
- && make && make check)
-
-
-4. Building a Repository Working Copy
-=====================================
-To get the source code from the subversion repository (trunk) do:
-
- # svn checkout https://svn.apache.org/repos/asf/incubator/qpid/trunk/.
-
-To build a fresh checkout:
-
-Cd to qpid/cpp subdirectory. Before running make on a fresh checkout do:
-
- # ./bootstrap
-
-This generates config, makefiles and the like - check the script for
-details. You only need to do this once, "make" will keep everything up
-to date thereafter (including re-generating configuration & Makefiles
-if the automake templates change etc.)
-
-If you are developing code yourself, or if you want to help
-us keep the code as tight and robust as possible, consider enabling
-the use of valgrind. If you configure like this:
-
- # ./configure --enable-valgrind
-
-That will arrange (assuming you have valgrind installed) for "make check"
-to run tests via valgrind. That makes the tests run more slowly, but
-helps detect certain types of bugs, as well as memory leaks. If you run
-"make check" and valgrind detects a leak that is not listed as being
-"ignorable-for-now", the test script in question will fail. However,
-recording whether a leak is ignorable is not easy, when the stack
-signature, libraries, compiler, O/S, architecture, etc., may all vary,
-so if you see a new leak, try to figure out if it's one you can fix
-before adding it to the list.
-
-Now follow instruction for building from a source distribution in step (3).
-
-
-5. Portability
-==============
-All system calls are abstracted by classes under lib/common/sys. This
-provides an object-oriented C++ API and contains platform-specific
-code.
-
-These wrappers are mainly inline by-value classes so they impose no
-run-time penalty compared do direct system calls.
-
-Initially we will have a full linux implementation and a portable
-implementation sufficient for the client using the APR portability
-library. The implementations may change in future but the interface
-for qpid code outside the qpid/sys namespace should remain stable.
-
-
-6. Tests
-========
-See src/tests/README for details.
-
-
-7. Doxygen
-==========
-Doxygen generates documentation in several formats from source code
-using special comments. You can use javadoc style comments if you know
-javadoc, if you don't or want to know the fully story on doxygen
-markup see http://www.stack.nl/~dimitri/doxygen/
-
-Even even if the code is completely uncommented, doxygen generates
-UML-esque dependency diagrams that are ''extremely'' useful in navigating
-around the code, especially for newcomers.
-
-To try it out "make doxygen" then open doxygen/html/index.html.
-
-
-8. Troubleshooting
-==================
-When building, get the following on configure
- configure: error: Package requirements (apr-1 >= 1.2.2) were not met:
-
- No package 'apr-1' found
-
-The following has not been set
- export PKG_CONFIG_PATH=$HOME/qpid-tools/lib/pkgconfig:/usr/lib/pkgconfig
diff --git a/M4-RCs/qpid/cpp/INSTALL-WINDOWS b/M4-RCs/qpid/cpp/INSTALL-WINDOWS
deleted file mode 100644
index 3ac76509f3..0000000000
--- a/M4-RCs/qpid/cpp/INSTALL-WINDOWS
+++ /dev/null
@@ -1,127 +0,0 @@
- Installing Qpid/C++ on Windows
- ==============================
-
-Table of Contents
-=================
-1. Introduction
-
-2. Prerequisites
- 2.1. What to Install
- 2.2. Important Environment Variable Settings
-
-3. Building from a Source Distribution
-4. Building a Repository Working Copy
-5. Tests
-6. Doxygen
-7. Troubleshooting
-
-
-1. Introduction
-===============
-Note that the daemon and client API can be built and installed separately.
-They both link against a common library.
-
-This document describes how to build the Qpid/C++ broker and client, either
-from a checkout of the source or from a source distribution, on Windows using
-Microsoft Visual Studio 2008 (VC9).
-
-Please see INSTALL for information on building on Linux/UNIX.
-
-
-2. Prerequisites
-================
-We prefer to avoid spending time accommodating older versions of these
-packages, so please make sure that you have the latest stable versions.
-Known version numbers for a succesful build are given in brackets, take
-these as a recommended minimum version.
-
-2.1. What to Install
-====================
-
-The following libraries and header files must be installed to build
-a source distribution:
- * boost <http://www.boost.org> (1.35)(*)
-
-(*) earlier versions of boost e.g. 1.33 also work
-
-If you want to build directly from the SVN repository you will need
-all of the above plus:
-
- * python <http://www.python.org> (2.5.2)
- * ruby <http://www.ruby-lang.org> (1.8.4)
-
-2.2. Important Environment Variable Settings
-============================================
-Ensure that all the build tools are available on your path, when they are
-manually installed to non-standard locations. For example:
-
- # set PATH=C:\python25;%PATH%
-
-It is also necessary to set BOOST_ROOT to refer to the base of your Boost
-installation. The Visual Studio build projects refer to it. For example:
-
- # set BOOST_ROOT=C:\Program Files\boost\boost_1_35_0
-
-
-3. Building from a Source Distribution
-======================================
-The Qpid client/broker, examples, and tests are built with separate
-Visual Studio solution files. The procedure for all three is the same.
-
-Start the Visual Studio IDE and open the desired solution. They are located
-under the distribution directory in the following places:
-
-- broker/client: src/qpid.sln
-- examples: src/examples/examples.sln
-- tests: src/tests/tests.sln
-
-Open the desired solution, select Debug/Release, and build.
-You can build both Release and Debug in the same directory.
-
-How to easily test????
-
-
-4. Building a Repository Working Copy
-=====================================
-To get the source code from the subversion repository (trunk) do:
-
- # svn checkout https://svn.apache.org/repos/asf/incubator/qpid/trunk/.
-
-A large portion of the source code is generated using some contained
-scripts. The generated code is included in source distributions; however,
-when building a repository working copy this code must be generated.
-To generate the code and build a fresh checkout:
-
- Open a Visual Studio Command Prompt window
- cd to the qpid\cpp\src directory
- nmake /f protocol_gen.mak
-
-Now follow instruction for building from a source distribution in step (3).
-
-
-5. Tests
-========
-See src/tests/README for details.
-
-
-6. Doxygen
-==========
-Doxygen generates documentation in several formats from source code
-using special comments. You can use javadoc style comments if you know
-javadoc, if you don't or want to know the fully story on doxygen
-markup see http://www.stack.nl/~dimitri/doxygen/
-
-Even even if the code is completely uncommented, doxygen generates
-UML-esque dependency diagrams that are ''extremely'' useful in navigating
-around the code, especially for newcomers.
-
-There's no Windows script for generating the Doxygen documentation. You
-can either obtain the documentation in a source distribution or, if you
-are using a repository working copy, you will need to generate it on
-Linux. To try it out "make doxygen" then open doxygen/html/index.html.
-
-
-7. Troubleshooting
-==================
-
-There are currently two JIRAs open against Windows.
diff --git a/M4-RCs/qpid/cpp/LICENSE b/M4-RCs/qpid/cpp/LICENSE
deleted file mode 100644
index cff2a5e25d..0000000000
--- a/M4-RCs/qpid/cpp/LICENSE
+++ /dev/null
@@ -1,234 +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.
-
-=========================================================================
-== Boost License ==
-=========================================================================
-
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-
diff --git a/M4-RCs/qpid/cpp/Makefile.am b/M4-RCs/qpid/cpp/Makefile.am
deleted file mode 100644
index 059e0183a3..0000000000
--- a/M4-RCs/qpid/cpp/Makefile.am
+++ /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.
-#
-
-AUTOMAKE_OPTIONS = 1.9.2 foreign
-ACLOCAL_AMFLAGS = -I m4
-
-EXTRA_DIST = \
- LICENSE NOTICE README SSL RELEASE_NOTES DESIGN \
- xml/cluster.xml INSTALL-WINDOWS
-
-SUBDIRS = managementgen etc src docs/api docs/man examples
-
-# Update libtool, if needed.
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
-
-
-
diff --git a/M4-RCs/qpid/cpp/NOTICE b/M4-RCs/qpid/cpp/NOTICE
deleted file mode 100644
index 5de355a56c..0000000000
--- a/M4-RCs/qpid/cpp/NOTICE
+++ /dev/null
@@ -1,21 +0,0 @@
-=========================================================================
-== NOTICE file corresponding to the section 4 d of ==
-== the Apache License, Version 2.0, ==
-== in this case for the Apache Qpid distribution. ==
-=========================================================================
-
-This product includes software developed by the Apache Software Foundation
-(http://www.apache.org/).
-
-Please read the LICENSE file present in the root directory of this
-distribution.
-
-Aside from contributions to the Apache Qpid project, this software also
-includes (binary only):
- - None at this time
-
-Project requires, not packaged:
- * boost version 1.33.1 or later under the Boost Software License, and
- can be downloaded from http://www.boost.org
- - Included in most OS platforms by default.
-
diff --git a/M4-RCs/qpid/cpp/README b/M4-RCs/qpid/cpp/README
deleted file mode 100644
index 58a6bd97cd..0000000000
--- a/M4-RCs/qpid/cpp/README
+++ /dev/null
@@ -1,38 +0,0 @@
- Qpid/C++
- ========
-
-Table of Contents
-=================
-1. Introduction
-2. Available Documentation
-3. Quick start
-
-
-1. Introduction
-===============
-Qpid/C++ is a C++ implementation of the AMQP protcol described at
-http://amqp.org/
-
-This release of Qpid/C++ implements the AMQP 0-10.
-It will not inter-operate with AMQP 0-8/0-9 implementations.
-
-For additional software or information on the Qpid project go to:
-http://cwiki.apache.org/qpid/
-
-
-2. Available Documentation
-==========================
- - INSTALL - How to install Qpid/C++.
- - SSL - How to setup SSL
- - RELEASE_NOTES - Release notes.
- - DESIGN - Qpid/C++ implementation.
- - LICENSE - Apache license.
- - NOTICE - Corresponds to the section 4 d of
- the Apache License, Version 2.0.
-
-3. Quick start
-==============
-If you are impatient to get on, ./configure && make will usually be
-sifficient to compile. Running make check will run tests, make install
-will install the client and daemon. For more detailed information,
-please see the INSTALL notes.
diff --git a/M4-RCs/qpid/cpp/RELEASE_NOTES b/M4-RCs/qpid/cpp/RELEASE_NOTES
deleted file mode 100644
index b861503f9d..0000000000
--- a/M4-RCs/qpid/cpp/RELEASE_NOTES
+++ /dev/null
@@ -1,21 +0,0 @@
-Apache Qpid C++ M4 Release Notes
---------------------------------
-
-The Qpid M4 release of the c++ client and broker support the 0-10
-version of the AMQP specification. You can access this specification
-from:
-
-http://jira.amqp.org/confluence/display/AMQP/Download
-
-Notable additions for the M$ release includes, the c++ client API had improvements done to make it more user friendly. The c++ broker has a windows port, acl support, SSL support, performance enhancements and clustering (experimental).
-
-Please note that due to c++ client API changes, it is likely that programs written against the M3 client will not compile.
-You will need to change to the new API thats described at http://qpid.apache.org/docs/api/html/
-
-For full details of Qpid c++ capabilities, as they currently stand,
-see our project documentation at:
-
-http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=28284
-
-Please take time to go through the README file provided with the
-distro to get a good understanding about build system etc.
diff --git a/M4-RCs/qpid/cpp/SSL b/M4-RCs/qpid/cpp/SSL
deleted file mode 100644
index 4f80e77479..0000000000
--- a/M4-RCs/qpid/cpp/SSL
+++ /dev/null
@@ -1,71 +0,0 @@
- Using SSL
- =========
-
-SSL support for Qpid-C++, based on Mozilla's Network Security Services
-library, is provided as two loadable modules: one for the client
-(sslconnector.so), one for the broker (ssl.so). Either these libraries
-should be present in the relevant module directory or the
-'load-module' option (or QPID_LOAD_MODULE environment variable) is
-used to ensure they are loaded.
-
-Broker side SSL Settings (note you can get these by qpidd --help
-providing the ssl.so module is loaded):
-
-SSL Settings:
- --ssl-use-export-policy Use NSS export policy
- --ssl-cert-password-file PATH File containing password to use for
- accessing certificate database
- --ssl-cert-db PATH Path to directory containing certificate
- database
- --ssl-cert-name NAME (thinkpad) Name of the certificate to use
- --ssl-port PORT (5671) Port on which to listen for SSL
- connections
- --ssl-require-client-authentication Forces clients to authenticate in order
- to establish an SSL connection
-
-
-The first four of these are also available as client options (where
-they must either be in the client config file or set as environment
-variables e.g. QPID_SSL_CERT_DB).
-
-To run either the broker or client you need ssl-cert-db-path to point
-to the directory where relevant certificate and key databases can be
-found.
-
-Certificate databases are set up using certutil (included in the
-nss-tools package on fedora). See the NSS site for examples[1] and
-full details[2].
-
-For a simple testing you can set up a single db with a single self
-signed certificate. E.g (with myhost and mydomain replaced by the
-hostname and domainname of the machine in question respectively):
-
- mkdir test_cert_db
- certutil -N -d test_cert_db -f cert.password
- certutil -S -d test_cert_db -n "myhost.mydomain" \
- -s "CN=myhost.mydomain" -t "CT,," -x \
- -f cert.password -z /usr/bin/certutil
-
-Here cert.password is a file with a password in it that will be needed
-for accessing the created db.
-
-The daemon can then be started with something like the following:
-
-./src/qpidd --auth no --load-module src/.libs/ssl.so \
- --ssl-cert-db ./test_cert_db \
- --ssl-cert-password-file ./cert.password \
- --ssl-cert-name myhost.mydomain
-
-then for client set:
-
-QPID_LOAD_MODULE=./src/.libs/sslconnector.so
-QPID_SSL_CERT_DB=./test_cert_db
-
-and run e.g.
-
-./src/tests/perftest --count 10000 -P ssl --port 5671 \
- --broker myhost.mydomain
-
-
-[1] http://www.mozilla.org/projects/security/pki/nss/ref/ssl/gtstd.html
-[2] http://www.mozilla.org/projects/security/pki/nss/tools/certutil.html
diff --git a/M4-RCs/qpid/cpp/boost-1.32-support/Makefile b/M4-RCs/qpid/cpp/boost-1.32-support/Makefile
deleted file mode 100644
index f0907f7fda..0000000000
--- a/M4-RCs/qpid/cpp/boost-1.32-support/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-.PHONY: default apply
-
-default:
- @echo "Run 'make apply' to patch the source"
-
-apply: main.patch ../src/boost
- patch -d .. -p0 < main.patch
- cat supressions >> ../src/tests/.valgrind.supp
-
-../src/boost: boost.tar.gz
- tar -C .. -xvzf boost.tar.gz
diff --git a/M4-RCs/qpid/cpp/boost-1.32-support/README b/M4-RCs/qpid/cpp/boost-1.32-support/README
deleted file mode 100644
index 3c0edc8697..0000000000
--- a/M4-RCs/qpid/cpp/boost-1.32-support/README
+++ /dev/null
@@ -1,8 +0,0 @@
-For example:
-
-$ cd qpid/cpp/boost-1.32-support # The directory containing this file
-$ make apply
-[Some untarring and patching]
-$ cd ..
-
-And then build using the normal methods.
diff --git a/M4-RCs/qpid/cpp/boost-1.32-support/boost.tar.gz b/M4-RCs/qpid/cpp/boost-1.32-support/boost.tar.gz
deleted file mode 100644
index 7f97622681..0000000000
--- a/M4-RCs/qpid/cpp/boost-1.32-support/boost.tar.gz
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/cpp/boost-1.32-support/main.patch b/M4-RCs/qpid/cpp/boost-1.32-support/main.patch
deleted file mode 100644
index 952c0e7aad..0000000000
--- a/M4-RCs/qpid/cpp/boost-1.32-support/main.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-Index: configure.ac
-===================================================================
---- configure.ac (revision 718931)
-+++ configure.ac (working copy)
-@@ -66,7 +66,6 @@
- # -Wunreachable-code -Wpadded -Winline
- # -Wshadow - warns about boost headers.
- if test "${enableval}" = yes; then
-- gl_COMPILER_FLAGS(-Werror)
- gl_COMPILER_FLAGS(-pedantic)
- gl_COMPILER_FLAGS(-Wall)
- gl_COMPILER_FLAGS(-Wextra)
-Index: src/Makefile.am
-===================================================================
---- src/Makefile.am (revision 718931)
-+++ src/Makefile.am (working copy)
-@@ -37,7 +37,7 @@
- qpid/broker/windows/BrokerDefaults.cpp \
- qpid/broker/windows/SaslAuthenticator.cpp
-
--EXTRA_DIST= $(platform_dist) $(rgen_srcs) $(windows_dist)
-+EXTRA_DIST= $(platform_dist) $(rgen_srcs) $(windows_dist) $(top_srcdir)/src/boost
-
- ## Generated code
-
diff --git a/M4-RCs/qpid/cpp/boost-1.32-support/supressions b/M4-RCs/qpid/cpp/boost-1.32-support/supressions
deleted file mode 100644
index 5b5c81036b..0000000000
--- a/M4-RCs/qpid/cpp/boost-1.32-support/supressions
+++ /dev/null
@@ -1,107 +0,0 @@
-{
- RHEL4 -- we think Boost is responsible for these leaks.
- Memcheck:Leak
- fun:_Znwm
- fun:_ZN5boost15program_options??options_description*
-}
-
-{
- RHEL4 -- we think Boost is responsible for these leaks.
- Memcheck:Leak
- fun:_Znwm
- fun:_ZN5boost9unit_test9test_case*
-}
-
-{
- RHEL4 -- we think Boost is responsible for these leaks.
- Memcheck:Leak
- fun:calloc
- fun:_dlerror_run
- fun:dlopen@@GLIBC_2.2.5
- fun:_ZN4qpid3sys5Shlib4loadEPKc
- fun:_Z9testShlibv
- fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor8functionEv
- obj:/usr/lib64/libboost_unit_test_framework.so.1.32.0
- fun:_ZN5boost17execution_monitor7executeEbi
- fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor21execute_and_translateEPNS0_9test_caseEMS3_FvvEi
- fun:_ZN5boost9unit_test9test_case3runEv
- fun:_ZN5boost9unit_test10test_suite6do_runEv
- fun:_ZN5boost9unit_test9test_case3runEv
- fun:main
-}
-
-{
- RHEL4 -- we think Boost is responsible for these leaks.
- Memcheck:Leak
- fun:calloc
- fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.2.5
- fun:_ZN4qpid6broker5Timer5startEv
- fun:_ZN4qpid6broker5TimerC1Ev
- fun:_ZN4qpid6broker10DtxManagerC1Ev
-}
-
-{
- INVESTIGATE
- Memcheck:Leak
- fun:calloc
- fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.2.5
- fun:_ZN4qpid6client9Connector4initEv
- fun:_ZN4qpid6client14ConnectionImpl4openERKSsiS3_S3_S3_
-}
-
-{
- INVESTIGATE
- Memcheck:Param
- write(buf)
- obj:/lib64/tls/libc-2.3.4.so
- fun:_ZNK4qpid3sys6Socket5writeEPKvm
- fun:_ZN4qpid3sys8AsynchIO9writeableERNS0_14DispatchHandleE
-}
-
-{
- INVESTIGATE
- Memcheck:Leak
- fun:calloc
- fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.2.5
- fun:_ZN4qpid6broker5Timer5startEv
- fun:_ZN4qpid6broker5TimerC1Ev
- fun:_ZN4qpid6broker10DtxManagerC1Ev
-}
-{
- RHEL4 (and FC5)
- Memcheck:Leak
- fun:calloc
- fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.2.5
- fun:_ZN4qpid3sys13ThreadPrivateC1EPNS0_8RunnableE
- fun:_ZN4qpid3sys6ThreadC1EPNS0_8RunnableE
- fun:_ZN4qpid6client9Connector4initEv
-}
-{
- INVESTIGATE
- Memcheck:Param
- futex(utime)
- fun:__lll_mutex_unlock_wake
-}
-{
- SAME ISSUE, NEW OCCURENCE
- Memcheck:Leak
- fun:calloc
- fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.2.5
- fun:_ZN4qpid3sys13ThreadPrivateC1EPNS0_8RunnableE
- fun:_ZN4qpid3sys6ThreadC1EPNS0_8RunnableE
- fun:_ZN4qpid6broker5Timer5startEv
- fun:_ZN4qpid6broker5TimerC1Ev
- fun:_ZN4qpid6broker12LinkRegistryC1EPNS0_6BrokerE
-}
-{
- <insert a suppression name here>
- Memcheck:Param
- socketcall.sendto(msg)
- fun:send
- fun:get_mapping
-}
diff --git a/M4-RCs/qpid/cpp/bootstrap b/M4-RCs/qpid/cpp/bootstrap
deleted file mode 100755
index 2dc8f91b30..0000000000
--- a/M4-RCs/qpid/cpp/bootstrap
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-set -e
-aclocal -I m4
-autoheader
-libtoolize --automake
-
-# Create initial Makefile fragments that will force make to generate
-# the real ones.
-cat > src/rubygen.mk <<EOF
-\$(srcdir)/rubygen.mk: force
- \$(rgen_cmd)
-EOF
-cat > src/managementgen.mk <<EOF
-\$(srcdir)/managementgen.mk: force
- \$(mgen_cmd)
-EOF
-
-
-automake
-autoconf
-
-if [ "$1" = "-build" -o "$1" = "--build" ] ; then
- shift
- ./configure "$@"
- make
- make check
-fi
diff --git a/M4-RCs/qpid/cpp/build-aux/compile b/M4-RCs/qpid/cpp/build-aux/compile
deleted file mode 100755
index 1b1d232169..0000000000
--- a/M4-RCs/qpid/cpp/build-aux/compile
+++ /dev/null
@@ -1,142 +0,0 @@
-#! /bin/sh
-# Wrapper for compilers which do not understand `-c -o'.
-
-scriptversion=2005-05-14.22
-
-# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
-# Written by Tom Tromey <tromey@cygnus.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-case $1 in
- '')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: compile [--help] [--version] PROGRAM [ARGS]
-
-Wrapper for compilers which do not understand `-c -o'.
-Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
-arguments, and rename the output as expected.
-
-If you are trying to build a whole package this is not the
-right script to run: please start by reading the file `INSTALL'.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "compile $scriptversion"
- exit $?
- ;;
-esac
-
-ofile=
-cfile=
-eat=
-
-for arg
-do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as `compile cc -o foo foo.c'.
- # So we strip `-o arg' only if arg is an object.
- eat=1
- case $2 in
- *.o | *.obj)
- ofile=$2
- ;;
- *)
- set x "$@" -o "$2"
- shift
- ;;
- esac
- ;;
- *.c)
- cfile=$1
- set x "$@" "$1"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
-done
-
-if test -z "$ofile" || test -z "$cfile"; then
- # If no `-o' option was seen then we might have been invoked from a
- # pattern rule where we don't need one. That is ok -- this is a
- # normal compilation that the losing compiler can handle. If no
- # `.c' file was seen then we are probably linking. That is also
- # ok.
- exec "$@"
-fi
-
-# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
-
-# Create the lock directory.
-# Note: use `[/.-]' here to ensure that we don't use the same name
-# that we are using for the .o file. Also, base the name on the expected
-# object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
-while true; do
- if mkdir "$lockdir" >/dev/null 2>&1; then
- break
- fi
- sleep 1
-done
-# FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir '$lockdir'; exit 1" 1 2 15
-
-# Run the compile.
-"$@"
-ret=$?
-
-if test -f "$cofile"; then
- mv "$cofile" "$ofile"
-elif test -f "${cofile}bj"; then
- mv "${cofile}bj" "$ofile"
-fi
-
-rmdir "$lockdir"
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/M4-RCs/qpid/cpp/build-aux/config.guess b/M4-RCs/qpid/cpp/build-aux/config.guess
deleted file mode 100755
index c93201a4d2..0000000000
--- a/M4-RCs/qpid/cpp/build-aux/config.guess
+++ /dev/null
@@ -1,1501 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
-
-timestamp='2006-11-08'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner <per@bothner.com>.
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
-#
-# The plan is that this can be called by configure scripts if you
-# don't specify an explicit build system type.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep __ELF__ >/dev/null
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:SunOS:5.*:*)
- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep __LP64__ >/dev/null
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- case ${UNAME_MACHINE} in
- pc98)
- echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- i*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- x86:Interix*:[3456]*)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- EM64T:Interix*:[3456]* | authenticamd:Interix*:[3456]*)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- arm*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- cris:Linux:*:*)
- echo cris-axis-linux-gnu
- exit ;;
- crisv32:Linux:*:*)
- echo crisv32-axis-linux-gnu
- exit ;;
- frv:Linux:*:*)
- echo frv-unknown-linux-gnu
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- mips:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips
- #undef mipsel
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mipsel
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef mips64
- #undef mips64el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=mips64el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=mips64
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^CPU/{
- s: ::g
- p
- }'`"
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
- ;;
- or32:Linux:*:*)
- echo or32-unknown-linux-gnu
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
- esac
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
- exit ;;
- x86_64:Linux:*:*)
- echo x86_64-unknown-linux-gnu
- exit ;;
- i*86:Linux:*:*)
- # The BFD linker knows what the default object file format is, so
- # first see if it will tell us. cd to the root directory to prevent
- # problems with other programs or directories called `ld' in the path.
- # Set LC_ALL=C to ensure ld outputs messages in English.
- ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
- | sed -ne '/supported targets:/!d
- s/[ ][ ]*/ /g
- s/.*supported targets: *//
- s/ .*//
- p'`
- case "$ld_supported_targets" in
- elf32-i386)
- TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
- ;;
- a.out-i386-linux)
- echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit ;;
- coff-i386)
- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit ;;
- "")
- # Either a pre-BFD a.out linker (linux-gnuoldld) or
- # one that does not give us useful --help.
- echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit ;;
- esac
- # Determine whether the default compiler is a.out or elf
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #ifdef __ELF__
- # ifdef __GLIBC__
- # if __GLIBC__ >= 2
- LIBC=gnu
- # else
- LIBC=gnulibc1
- # endif
- # else
- LIBC=gnulibc1
- # endif
- #else
- #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
- LIBC=gnu
- #else
- LIBC=gnuaout
- #endif
- #endif
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
- /^LIBC/{
- s: ::g
- p
- }'`"
- test x"${LIBC}" != x && {
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit
- }
- test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
- ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i386.
- echo i386-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
-esac
-
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
- if (version < 4)
- printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
- else
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
-and
- http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/M4-RCs/qpid/cpp/build-aux/config.rpath b/M4-RCs/qpid/cpp/build-aux/config.rpath
deleted file mode 100755
index c492a93b66..0000000000
--- a/M4-RCs/qpid/cpp/build-aux/config.rpath
+++ /dev/null
@@ -1,614 +0,0 @@
-#! /bin/sh
-# Output a system dependent set of variables, describing how to set the
-# run time search path of shared libraries in an executable.
-#
-# Copyright 1996-2006 Free Software Foundation, Inc.
-# Taken from GNU libtool, 2001
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This file is free software; the Free Software Foundation gives
-# unlimited permission to copy and/or distribute it, with or without
-# modifications, as long as this notice is preserved.
-#
-# The first argument passed to this file is the canonical host specification,
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
-# should be set by the caller.
-#
-# The set of defined variables is at the end of this script.
-
-# Known limitations:
-# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
-# than 256 bytes, otherwise the compiler driver will dump core. The only
-# known workaround is to choose shorter directory names for the build
-# directory and/or the installation directory.
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-shrext=.so
-
-host="$1"
-host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-# Code taken from libtool.m4's _LT_CC_BASENAME.
-
-for cc_temp in $CC""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
-
-# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
-
-wl=
-if test "$GCC" = yes; then
- wl='-Wl,'
-else
- case "$host_os" in
- aix*)
- wl='-Wl,'
- ;;
- darwin*)
- case $cc_basename in
- xlc*)
- wl='-Wl,'
- ;;
- esac
- ;;
- mingw* | pw32* | os2*)
- ;;
- hpux9* | hpux10* | hpux11*)
- wl='-Wl,'
- ;;
- irix5* | irix6* | nonstopux*)
- wl='-Wl,'
- ;;
- newsos6)
- ;;
- linux*)
- case $cc_basename in
- icc* | ecc*)
- wl='-Wl,'
- ;;
- pgcc | pgf77 | pgf90)
- wl='-Wl,'
- ;;
- ccc*)
- wl='-Wl,'
- ;;
- como)
- wl='-lopt='
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- wl='-Wl,'
- ;;
- esac
- ;;
- esac
- ;;
- osf3* | osf4* | osf5*)
- wl='-Wl,'
- ;;
- sco3.2v5*)
- ;;
- solaris*)
- wl='-Wl,'
- ;;
- sunos4*)
- wl='-Qoption ld '
- ;;
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- wl='-Wl,'
- ;;
- sysv4*MP*)
- ;;
- unicos*)
- wl='-Wl,'
- ;;
- uts4*)
- ;;
- esac
-fi
-
-# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
-
-hardcode_libdir_flag_spec=
-hardcode_libdir_separator=
-hardcode_direct=no
-hardcode_minus_L=no
-
-case "$host_os" in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
-esac
-
-ld_shlibs=yes
-if test "$with_gnu_ld" = yes; then
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- # Unlike libtool, we use -rpath here, not --rpath, since the documented
- # option of GNU ld is called -rpath, not --rpath.
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- case "$host_os" in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- ld_shlibs=no
- fi
- ;;
- amigaos*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we cannot use
- # them.
- ld_shlibs=no
- ;;
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- :
- else
- ld_shlibs=no
- fi
- ;;
- cygwin* | mingw* | pw32*)
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec='-L$libdir'
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- :
- else
- ld_shlibs=no
- fi
- ;;
- interix3*)
- hardcode_direct=no
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- :
- else
- ld_shlibs=no
- fi
- ;;
- netbsd*)
- ;;
- solaris*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- :
- else
- ld_shlibs=no
- fi
- ;;
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs=no
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
- else
- ld_shlibs=no
- fi
- ;;
- esac
- ;;
- sunos4*)
- hardcode_direct=yes
- ;;
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- :
- else
- ld_shlibs=no
- fi
- ;;
- esac
- if test "$ld_shlibs" = no; then
- hardcode_libdir_flag_spec=
- fi
-else
- case "$host_os" in
- aix3*)
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L=yes
- if test "$GCC" = yes; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct=unsupported
- fi
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- else
- aix_use_runtimelinking=no
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
- fi
- hardcode_direct=yes
- hardcode_libdir_separator=':'
- if test "$GCC" = yes; then
- case $host_os in aix4.[012]|aix4.[012].*)
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- hardcode_direct=yes
- else
- # We have old collect2
- hardcode_direct=unsupported
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
- fi
- ;;
- esac
- fi
- # Begin _LT_AC_SYS_LIBPATH_AIX.
- echo 'int main () { return 0; }' > conftest.c
- ${CC} ${LDFLAGS} conftest.c -o conftest
- aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
- if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
- fi
- if test -z "$aix_libpath"; then
- aix_libpath="/usr/lib:/lib"
- fi
- rm -f conftest.c conftest
- # End _LT_AC_SYS_LIBPATH_AIX.
- if test "$aix_use_runtimelinking" = yes; then
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
- else
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- fi
- fi
- ;;
- amigaos*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
- ;;
- bsdi[45]*)
- ;;
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec=' '
- libext=lib
- ;;
- darwin* | rhapsody*)
- hardcode_direct=no
- if test "$GCC" = yes ; then
- :
- else
- case $cc_basename in
- xlc*)
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
- fi
- ;;
- dgux*)
- hardcode_libdir_flag_spec='-L$libdir'
- ;;
- freebsd1*)
- ld_shlibs=no
- ;;
- freebsd2.2*)
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- ;;
- freebsd2*)
- hardcode_direct=yes
- hardcode_minus_L=yes
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- ;;
- hpux9*)
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- hpux10*)
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- fi
- ;;
- hpux11*)
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_separator=:
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct=no
- ;;
- *)
- hardcode_direct=yes
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- esac
- fi
- ;;
- irix5* | irix6* | nonstopux*)
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
- netbsd*)
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- ;;
- newsos6)
- hardcode_direct=yes
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
- openbsd*)
- hardcode_direct=yes
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- else
- case "$host_os" in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
- os2*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- osf3*)
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
- osf4* | osf5*)
- if test "$GCC" = yes; then
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- else
- # Both cc and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec='-rpath $libdir'
- fi
- hardcode_libdir_separator=:
- ;;
- solaris*)
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- sunos4*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=yes
- hardcode_minus_L=yes
- ;;
- sysv4)
- case $host_vendor in
- sni)
- hardcode_direct=yes # is this really true???
- ;;
- siemens)
- hardcode_direct=no
- ;;
- motorola)
- hardcode_direct=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- ;;
- sysv4.3*)
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- ld_shlibs=yes
- fi
- ;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
- ;;
- sysv5* | sco3.2v5* | sco5v6*)
- hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
- hardcode_libdir_separator=':'
- ;;
- uts4*)
- hardcode_libdir_flag_spec='-L$libdir'
- ;;
- *)
- ld_shlibs=no
- ;;
- esac
-fi
-
-# Check dynamic linker characteristics
-# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
-libname_spec='lib$name'
-case "$host_os" in
- aix3*)
- ;;
- aix4* | aix5*)
- ;;
- amigaos*)
- ;;
- beos*)
- ;;
- bsdi[45]*)
- ;;
- cygwin* | mingw* | pw32*)
- shrext=.dll
- ;;
- darwin* | rhapsody*)
- shrext=.dylib
- ;;
- dgux*)
- ;;
- freebsd1*)
- ;;
- kfreebsd*-gnu)
- ;;
- freebsd* | dragonfly*)
- ;;
- gnu*)
- ;;
- hpux9* | hpux10* | hpux11*)
- case $host_cpu in
- ia64*)
- shrext=.so
- ;;
- hppa*64*)
- shrext=.sl
- ;;
- *)
- shrext=.sl
- ;;
- esac
- ;;
- interix3*)
- ;;
- irix5* | irix6* | nonstopux*)
- case "$host_os" in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
- *) libsuff= shlibsuff= ;;
- esac
- ;;
- esac
- ;;
- linux*oldld* | linux*aout* | linux*coff*)
- ;;
- linux*)
- ;;
- knetbsd*-gnu)
- ;;
- netbsd*)
- ;;
- newsos6)
- ;;
- nto-qnx*)
- ;;
- openbsd*)
- ;;
- os2*)
- libname_spec='$name'
- shrext=.dll
- ;;
- osf3* | osf4* | osf5*)
- ;;
- solaris*)
- ;;
- sunos4*)
- ;;
- sysv4 | sysv4.3*)
- ;;
- sysv4*MP*)
- ;;
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- ;;
- uts4*)
- ;;
-esac
-
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
-shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
-escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
-
-LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
-
-# How to pass a linker flag through the compiler.
-wl="$escaped_wl"
-
-# Static library suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally "so").
-shlibext="$shlibext"
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator="$hardcode_libdir_separator"
-
-# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct="$hardcode_direct"
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L="$hardcode_minus_L"
-
-EOF
diff --git a/M4-RCs/qpid/cpp/build-aux/config.sub b/M4-RCs/qpid/cpp/build-aux/config.sub
deleted file mode 100755
index 7ccee73057..0000000000
--- a/M4-RCs/qpid/cpp/build-aux/config.sub
+++ /dev/null
@@ -1,1619 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
-# Inc.
-
-timestamp='2006-11-07'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
-# 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Please send patches to <config-patches@gnu.org>. Submit a context
-# diff and a properly formatted ChangeLog entry.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
- uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray)
- os=
- basic_machine=$1
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64vr | mips64vrel \
- | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | mt \
- | msp430 \
- | nios | nios2 \
- | ns16k | ns32k \
- | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
- | pyramid \
- | score \
- | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu | strongarm \
- | tahoe | thumb | tic4x | tic80 | tron \
- | v850 | v850e \
- | we32k \
- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
- | z8k)
- basic_machine=$basic_machine-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12)
- # Motorola 68HC11/12.
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nios-* | nios2-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
- | pyramid-* \
- | romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
- | tahoe-* | thumb-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tron-* \
- | v850-* | v850e-* | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
- | xstormy16-* | xtensa-* \
- | ymp-* \
- | z8k-*)
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16c)
- basic_machine=cr16c-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
-# I'm not sure what "Sysv32" means. Should this be sysv3.2?
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc) basic_machine=powerpc-unknown
- ;;
- ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tic54x | c54x*)
- basic_machine=tic54x-unknown
- os=-coff
- ;;
- tic55x | c55x*)
- basic_machine=tic55x-unknown
- os=-coff
- ;;
- tic6x | c6x*)
- basic_machine=tic6x-unknown
- os=-coff
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* \
- | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -kaos*)
- os=-kaos
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- # This also exists in the configure program, but was not the
- # default.
- # os=-sunos4
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/M4-RCs/qpid/cpp/build-aux/depcomp b/M4-RCs/qpid/cpp/build-aux/depcomp
deleted file mode 100755
index ca5ea4e1ef..0000000000
--- a/M4-RCs/qpid/cpp/build-aux/depcomp
+++ /dev/null
@@ -1,584 +0,0 @@
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2006-10-15.18
-
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
-# Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
-
-case $1 in
- '')
- echo "$0: No command. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by `PROGRAMS ARGS'.
- object Object file output by `PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputing dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit $?
- ;;
-esac
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am. Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
- for arg
- do
- case $arg in
- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
- *) set fnord "$@" "$arg" ;;
- esac
- shift # fnord
- shift # $arg
- done
- "$@"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say).
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
-## The second -e expression handles DOS-style file names with drive letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the `deleted header file' problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
- tr ' ' '
-' < "$tmpdepfile" |
-## Some versions of gcc put a space before the `:'. On the theory
-## that the space means something, we add a space to the output as
-## well.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
-
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like `#:fec' to the end of the
- # dependency line.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
- tr '
-' ' ' >> $depfile
- echo >> $depfile
-
- # The second pass generates a dummy entry for each header file.
- tr ' ' '
-' < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> $depfile
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts `$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
- tmpdepfile="$stripped.u"
- if test "$libtool" = yes; then
- "$@" -Wc,-M
- else
- "$@" -M
- fi
- stat=$?
-
- if test -f "$tmpdepfile"; then :
- else
- stripped=`echo "$stripped" | sed 's,^.*/,,'`
- tmpdepfile="$stripped.u"
- fi
-
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
-
- if test -f "$tmpdepfile"; then
- outname="$stripped.o"
- # Each line is of the form `foo.o: dependent.h'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
- sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
- else
- # The sourcefile does not contain any dependencies, so just
- # store a dummy comment line, to avoid errors with the Makefile
- # "include basename.Plo" scheme.
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-icc)
- # Intel's C compiler understands `-MD -MF file'. However on
- # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
- # ICC 7.0 will fill foo.d with something like
- # foo.o: sub/foo.c
- # foo.o: sub/foo.h
- # which is wrong. We want:
- # sub/foo.o: sub/foo.c
- # sub/foo.o: sub/foo.h
- # sub/foo.c:
- # sub/foo.h:
- # ICC 7.1 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using \ :
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
-
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
- sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp2)
- # The "hp" stanza above does not work with aCC (C++) and HP's ia64
- # compilers, which have integrated preprocessors. The correct option
- # to use with these is +Maked; it writes dependencies to a file named
- # 'foo.d', which lands next to the object file, wherever that
- # happens to be.
- # Much of this is similar to the tru64 case; see comments there.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir.libs/$base.d
- "$@" -Wc,+Maked
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- "$@" +Maked
- fi
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
- # Add `dependent.h:' lines.
- sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile" "$tmpdepfile2"
- ;;
-
-tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in `foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
- test "x$dir" = "x$object" && dir=
- base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-
- if test "$libtool" = yes; then
- # With Tru64 cc, shared objects can also be used to make a
- # static library. This mechanism is used in libtool 1.4 series to
- # handle both shared and static libraries in a single compilation.
- # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
- #
- # With libtool 1.5 this exception was removed, and libtool now
- # generates 2 separate objects for the 2 libraries. These two
- # compilations output dependencies in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
- tmpdepfile2=$dir$base.o.d # libtool 1.5
- tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
- tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.o.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- tmpdepfile4=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -eq 0; then :
- else
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
- # That's a tab and a space in the [].
- sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
- else
- echo "#dummy" > "$depfile"
- fi
- rm -f "$tmpdepfile"
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for `:'
- # in the target name. This is to cope with DOS-style filenames:
- # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
- "$@" $dashmflag |
- sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- tr ' ' '
-' < "$tmpdepfile" | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- "$@" || exit $?
- # Remove any Libtool call
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
- # X makedepend
- shift
- cleared=no
- for arg in "$@"; do
- case $cleared in
- no)
- set ""; shift
- cleared=yes ;;
- esac
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift ;;
- # Strip any option that makedepend may not understand. Remove
- # the object too, otherwise makedepend will parse it as a source file.
- -*|$object)
- ;;
- *)
- set fnord "$@" "$arg"; shift ;;
- esac
- done
- obj_suffix="`echo $object | sed 's/^.*\././'`"
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- sed '1,2d' "$tmpdepfile" | tr ' ' '
-' | \
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test $1 != '--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove `-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- "$@" -E |
- sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
- sed '$ s: \\$::' > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o,
- # because we must use -o when running libtool.
- "$@" || exit $?
- IFS=" "
- for arg
- do
- case "$arg" in
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
- esac
- done
- "$@" -E |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
- echo " " >> "$depfile"
- . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/M4-RCs/qpid/cpp/build-aux/install-sh b/M4-RCs/qpid/cpp/build-aux/install-sh
deleted file mode 100755
index 4fbbae7b7f..0000000000
--- a/M4-RCs/qpid/cpp/build-aux/install-sh
+++ /dev/null
@@ -1,507 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2006-10-14.15
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-nl='
-'
-IFS=" "" $nl"
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-posix_glob=
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chmodcmd=$chmodprog
-chowncmd=
-chgrpcmd=
-stripcmd=
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=
-dst=
-dir_arg=
-dstarg=
-no_target_directory=
-
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
--c (ignored)
--d create directories instead of installing files.
--g GROUP $chgrpprog installed files to GROUP.
--m MODE $chmodprog installed files to MODE.
--o USER $chownprog installed files to USER.
--s $stripprog installed files.
--t DIRECTORY install into DIRECTORY.
--T report an error if DSTFILE is a directory.
---help display this help and exit.
---version display version info and exit.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
- case $1 in
- -c) shift
- continue;;
-
- -d) dir_arg=true
- shift
- continue;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift
- shift
- continue;;
-
- --help) echo "$usage"; exit $?;;
-
- -m) mode=$2
- shift
- shift
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- continue;;
-
- -o) chowncmd="$chownprog $2"
- shift
- shift
- continue;;
-
- -s) stripcmd=$stripprog
- shift
- continue;;
-
- -t) dstarg=$2
- shift
- shift
- continue;;
-
- -T) no_target_directory=true
- shift
- continue;;
-
- --version) echo "$0 $scriptversion"; exit $?;;
-
- --) shift
- break;;
-
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
-
- *) break;;
- esac
-done
-
-if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
- # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dstarg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dstarg"
- shift # fnord
- fi
- shift # arg
- dstarg=$arg
- done
-fi
-
-if test $# -eq 0; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call `install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
-
-if test -z "$dir_arg"; then
- trap '(exit $?); exit' 1 2 13 15
-
- # Set umask so as not to create temps with too-generous modes.
- # However, 'strip' requires both read and write access to temps.
- case $mode in
- # Optimize common cases.
- *644) cp_umask=133;;
- *755) cp_umask=22;;
-
- *[0-7])
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw='% 200'
- fi
- cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
- *)
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw=,u+rw
- fi
- cp_umask=$mode$u_plus_rw;;
- esac
-fi
-
-for src
-do
- # Protect names starting with `-'.
- case $src in
- -*) src=./$src ;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- dstdir=$dst
- test -d "$dstdir"
- dstdir_status=$?
- else
-
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dstarg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
-
- dst=$dstarg
- # Protect names starting with `-'.
- case $dst in
- -*) dst=./$dst ;;
- esac
-
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dstarg: Is a directory" >&2
- exit 1
- fi
- dstdir=$dst
- dst=$dstdir/`basename "$src"`
- dstdir_status=0
- else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
- test -d "$dstdir"
- dstdir_status=$?
- fi
- fi
-
- obsolete_mkdir_used=false
-
- if test $dstdir_status != 0; then
- case $posix_mkdir in
- '')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writeable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
- esac
-
- if
- $posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
- )
- then :
- else
-
- # The umask is ridiculous, or mkdir does not conform to POSIX,
- # or it failed possibly due to a race condition. Create the
- # directory the slow way, step by step, checking for races as we go.
-
- case $dstdir in
- /*) prefix=/ ;;
- -*) prefix=./ ;;
- *) prefix= ;;
- esac
-
- case $posix_glob in
- '')
- if (set -f) 2>/dev/null; then
- posix_glob=true
- else
- posix_glob=false
- fi ;;
- esac
-
- oIFS=$IFS
- IFS=/
- $posix_glob && set -f
- set fnord $dstdir
- shift
- $posix_glob && set +f
- IFS=$oIFS
-
- prefixes=
-
- for d
- do
- test -z "$d" && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
- done
-
- if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
- fi
- fi
- fi
-
- if test -n "$dir_arg"; then
- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
- else
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
- # Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # Now rename the file to the real destination.
- { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
- || {
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
-
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- if test -f "$dst"; then
- $doit $rmcmd -f "$dst" 2>/dev/null \
- || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
- && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
- || {
- echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- else
- :
- fi
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- } || exit 1
-
- trap '' 0
- fi
-done
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/M4-RCs/qpid/cpp/build-aux/ltmain.sh b/M4-RCs/qpid/cpp/build-aux/ltmain.sh
deleted file mode 100755
index 69aab477aa..0000000000
--- a/M4-RCs/qpid/cpp/build-aux/ltmain.sh
+++ /dev/null
@@ -1,6892 +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.
-#
-#
-
-# ltmain.sh - Provide generalized library-building support services.
-# NOTE: Changing this file will not affect anything until you rerun configure.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-basename="s,^.*/,,g"
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-# The name of this program:
-progname=`echo "$progpath" | $SED $basename`
-modename="$progname"
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-
-PROGRAM=ltmain.sh
-PACKAGE=libtool
-VERSION="1.5.22 Debian 1.5.22-4"
-TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes.
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-# Check that we have a working $echo.
-if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X$1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell, and then maybe $echo will work.
- exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit $EXIT_SUCCESS
-fi
-
-default_mode=
-help="Try \`$progname --help' for more information."
-magic="%%%MAGIC variable%%%"
-mkdir="mkdir"
-mv="mv -f"
-rm="rm -f"
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- SP2NL='tr \040 \012'
- NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- SP2NL='tr \100 \n'
- NL2SP='tr \r\n \100\100'
- ;;
-esac
-
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-# We save the old values to restore during execute mode.
-if test "${LC_ALL+set}" = set; then
- save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
-fi
-if test "${LANG+set}" = set; then
- save_LANG="$LANG"; LANG=C; export LANG
-fi
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-
-if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- $echo "$modename: not configured to build any kind of library" 1>&2
- $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
- exit $EXIT_FAILURE
-fi
-
-# Global variables.
-mode=$default_mode
-nonopt=
-prev=
-prevopt=
-run=
-show="$echo"
-show_help=
-execute_dlfiles=
-duplicate_deps=no
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-
-#####################################
-# Shell function definitions:
-# This seems to be the best place for them
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible. If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
- my_template="${TMPDIR-/tmp}/${1-$progname}"
-
- if test "$run" = ":"; then
- # Return a directory name, but don't create it in dry-run mode
- my_tmpdir="${my_template}-$$"
- else
-
- # If mktemp works, use that first and foremost
- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
- if test ! -d "$my_tmpdir"; then
- # Failing that, at least try and use $RANDOM to avoid a race
- my_tmpdir="${my_template}-${RANDOM-0}$$"
-
- save_mktempdir_umask=`umask`
- umask 0077
- $mkdir "$my_tmpdir"
- umask $save_mktempdir_umask
- fi
-
- # If we're not in dry-run mode, bomb out on failure
- test -d "$my_tmpdir" || {
- $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
- exit $EXIT_FAILURE
- }
- fi
-
- $echo "X$my_tmpdir" | $Xsed
-}
-
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-func_win32_libid ()
-{
- win32_libid_type="unknown"
- win32_fileres=`file -L $1 2>/dev/null`
- case $win32_fileres in
- *ar\ archive\ import\ library*) # definitely import
- win32_libid_type="x86 archive import"
- ;;
- *ar\ archive*) # could be an import, or static
- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
- $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
- win32_nmres=`eval $NM -f posix -A $1 | \
- $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
- case $win32_nmres in
- import*) win32_libid_type="x86 archive import";;
- *) win32_libid_type="x86 archive static";;
- esac
- fi
- ;;
- *DLL*)
- win32_libid_type="x86 DLL"
- ;;
- *executable*) # but shell scripts are "executable" too...
- case $win32_fileres in
- *MS\ Windows\ PE\ Intel*)
- win32_libid_type="x86 DLL"
- ;;
- esac
- ;;
- esac
- $echo $win32_libid_type
-}
-
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
- if test -n "$available_tags" && test -z "$tagname"; then
- CC_quoted=
- for arg in $CC; do
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- CC_quoted="$CC_quoted $arg"
- done
- case $@ in
- # Blanks in the command may have been stripped by the calling shell,
- # but not from the CC environment variable when configure was run.
- " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
- # Blanks at the start of $base_compile will cause this to fail
- # if we don't check for them as well.
- *)
- for z in $available_tags; do
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
- # Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
- CC_quoted=
- for arg in $CC; do
- # Double-quote args containing other shell metacharacters.
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- CC_quoted="$CC_quoted $arg"
- done
- case "$@ " in
- " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
- # The compiler in the base compile command matches
- # the one in the tagged configuration.
- # Assume this is the tagged configuration we want.
- tagname=$z
- break
- ;;
- esac
- fi
- done
- # If $tagname still isn't set, then no tagged configuration
- # was found and let the user know that the "--tag" command
- # line option must be used.
- if test -z "$tagname"; then
- $echo "$modename: unable to infer tagged configuration"
- $echo "$modename: specify a tag with \`--tag'" 1>&2
- exit $EXIT_FAILURE
-# else
-# $echo "$modename: using $tagname tagged configuration"
- fi
- ;;
- esac
- fi
-}
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
- f_ex_an_ar_dir="$1"; shift
- f_ex_an_ar_oldlib="$1"
-
- $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
- $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
- if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
- exit $EXIT_FAILURE
- fi
-}
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
- my_gentop="$1"; shift
- my_oldlibs=${1+"$@"}
- my_oldobjs=""
- my_xlib=""
- my_xabs=""
- my_xdir=""
- my_status=""
-
- $show "${rm}r $my_gentop"
- $run ${rm}r "$my_gentop"
- $show "$mkdir $my_gentop"
- $run $mkdir "$my_gentop"
- my_status=$?
- if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
- exit $my_status
- fi
-
- for my_xlib in $my_oldlibs; do
- # Extract the objects.
- case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
- *) my_xabs=`pwd`"/$my_xlib" ;;
- esac
- my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
- my_xdir="$my_gentop/$my_xlib"
-
- $show "${rm}r $my_xdir"
- $run ${rm}r "$my_xdir"
- $show "$mkdir $my_xdir"
- $run $mkdir "$my_xdir"
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
- exit $exit_status
- fi
- case $host in
- *-darwin*)
- $show "Extracting $my_xabs"
- # Do not bother doing anything if just a dry run
- if test -z "$run"; then
- darwin_orig_dir=`pwd`
- cd $my_xdir || exit $?
- darwin_archive=$my_xabs
- darwin_curdir=`pwd`
- darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
- darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
- if test -n "$darwin_arches"; then
- darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
- darwin_arch=
- $show "$darwin_base_archive has multiple architectures $darwin_arches"
- for darwin_arch in $darwin_arches ; do
- mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- func_extract_an_archive "`pwd`" "${darwin_base_archive}"
- cd "$darwin_curdir"
- $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
- done # $darwin_arches
- ## Okay now we have a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
- darwin_file=
- darwin_files=
- for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
- lipo -create -output "$darwin_file" $darwin_files
- done # $darwin_filelist
- ${rm}r unfat-$$
- cd "$darwin_orig_dir"
- else
- cd "$darwin_orig_dir"
- func_extract_an_archive "$my_xdir" "$my_xabs"
- fi # $darwin_arches
- fi # $run
- ;;
- *)
- func_extract_an_archive "$my_xdir" "$my_xabs"
- ;;
- esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
- done
- func_extract_archives_result="$my_oldobjs"
-}
-# End of Shell function definitions
-#####################################
-
-# Darwin sucks
-eval std_shrext=\"$shrext_cmds\"
-
-disable_libs=no
-
-# Parse our command line options once, thoroughly.
-while test "$#" -gt 0
-do
- arg="$1"
- shift
-
- case $arg in
- -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
- *) optarg= ;;
- esac
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- execute_dlfiles)
- execute_dlfiles="$execute_dlfiles $arg"
- ;;
- tag)
- tagname="$arg"
- preserve_args="${preserve_args}=$arg"
-
- # Check whether tagname contains only valid characters
- case $tagname in
- *[!-_A-Za-z0-9,/]*)
- $echo "$progname: invalid tag name: $tagname" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- case $tagname in
- CC)
- # Don't test for the "default" C tag, as we know, it's there, but
- # not specially marked.
- ;;
- *)
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
- taglist="$taglist $tagname"
- # Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
- else
- $echo "$progname: ignoring unknown tag $tagname" 1>&2
- fi
- ;;
- esac
- ;;
- *)
- eval "$prev=\$arg"
- ;;
- esac
-
- prev=
- prevopt=
- continue
- fi
-
- # Have we seen a non-optional argument yet?
- case $arg in
- --help)
- show_help=yes
- ;;
-
- --version)
- $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
- $echo
- $echo "Copyright (C) 2005 Free Software Foundation, Inc."
- $echo "This is free software; see the source for copying conditions. There is NO"
- $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
- exit $?
- ;;
-
- --config)
- ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
- # Now print the configurations for the tags.
- for tagname in $taglist; do
- ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
- done
- exit $?
- ;;
-
- --debug)
- $echo "$progname: enabling shell trace mode"
- set -x
- preserve_args="$preserve_args $arg"
- ;;
-
- --dry-run | -n)
- run=:
- ;;
-
- --features)
- $echo "host: $host"
- if test "$build_libtool_libs" = yes; then
- $echo "enable shared libraries"
- else
- $echo "disable shared libraries"
- fi
- if test "$build_old_libs" = yes; then
- $echo "enable static libraries"
- else
- $echo "disable static libraries"
- fi
- exit $?
- ;;
-
- --finish) mode="finish" ;;
-
- --mode) prevopt="--mode" prev=mode ;;
- --mode=*) mode="$optarg" ;;
-
- --preserve-dup-deps) duplicate_deps="yes" ;;
-
- --quiet | --silent)
- show=:
- preserve_args="$preserve_args $arg"
- ;;
-
- --tag)
- prevopt="--tag"
- prev=tag
- preserve_args="$preserve_args --tag"
- ;;
- --tag=*)
- set tag "$optarg" ${1+"$@"}
- shift
- prev=tag
- preserve_args="$preserve_args --tag"
- ;;
-
- -dlopen)
- prevopt="-dlopen"
- prev=execute_dlfiles
- ;;
-
- -*)
- $echo "$modename: unrecognized option \`$arg'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
-
- *)
- nonopt="$arg"
- break
- ;;
- esac
-done
-
-if test -n "$prevopt"; then
- $echo "$modename: option \`$prevopt' requires an argument" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
-fi
-
-case $disable_libs in
-no)
- ;;
-shared)
- build_libtool_libs=no
- build_old_libs=yes
- ;;
-static)
- build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
- ;;
-esac
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end. This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-if test -z "$show_help"; then
-
- # Infer the operation mode.
- if test -z "$mode"; then
- $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
- $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
- case $nonopt in
- *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
- mode=link
- for arg
- do
- case $arg in
- -c)
- mode=compile
- break
- ;;
- esac
- done
- ;;
- *db | *dbx | *strace | *truss)
- mode=execute
- ;;
- *install*|cp|mv)
- mode=install
- ;;
- *rm)
- mode=uninstall
- ;;
- *)
- # If we have no mode, but dlfiles were specified, then do execute mode.
- test -n "$execute_dlfiles" && mode=execute
-
- # Just use the default operation mode.
- if test -z "$mode"; then
- if test -n "$nonopt"; then
- $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
- else
- $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
- fi
- fi
- ;;
- esac
- fi
-
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$execute_dlfiles" && test "$mode" != execute; then
- $echo "$modename: unrecognized option \`-dlopen'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$modename --help --mode=$mode' for more information."
-
- # These modes are in order of execution frequency so that they run quickly.
- case $mode in
- # libtool compile mode
- compile)
- modename="$modename: compile"
- # Get the compilation command and the source file.
- base_compile=
- srcfile="$nonopt" # always keep a non-empty value in "srcfile"
- suppress_opt=yes
- suppress_output=
- arg_mode=normal
- libobj=
- later=
-
- for arg
- do
- case $arg_mode in
- arg )
- # do not "continue". Instead, add this to base_compile
- lastarg="$arg"
- arg_mode=normal
- ;;
-
- target )
- libobj="$arg"
- arg_mode=normal
- continue
- ;;
-
- normal )
- # Accept any command-line options.
- case $arg in
- -o)
- if test -n "$libobj" ; then
- $echo "$modename: you cannot specify \`-o' more than once" 1>&2
- exit $EXIT_FAILURE
- fi
- arg_mode=target
- continue
- ;;
-
- -static | -prefer-pic | -prefer-non-pic)
- later="$later $arg"
- continue
- ;;
-
- -no-suppress)
- suppress_opt=no
- continue
- ;;
-
- -Xcompiler)
- arg_mode=arg # the next one goes into the "base_compile" arg list
- continue # The current "srcfile" will either be retained or
- ;; # replaced later. I would guess that would be a bug.
-
- -Wc,*)
- args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
- lastarg=
- save_ifs="$IFS"; IFS=','
- for arg in $args; do
- IFS="$save_ifs"
-
- # Double-quote args containing other shell metacharacters.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- lastarg="$lastarg $arg"
- done
- IFS="$save_ifs"
- lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
-
- # Add the arguments to base_compile.
- base_compile="$base_compile $lastarg"
- continue
- ;;
-
- * )
- # Accept the current argument as the source file.
- # The previous "srcfile" becomes the current argument.
- #
- lastarg="$srcfile"
- srcfile="$arg"
- ;;
- esac # case $arg
- ;;
- esac # case $arg_mode
-
- # Aesthetically quote the previous argument.
- lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
-
- case $lastarg in
- # Double-quote args containing other shell metacharacters.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, and some SunOS ksh mistreat backslash-escaping
- # in scan sets (worked around with variable expansion),
- # and furthermore cannot handle '|' '&' '(' ')' in scan sets
- # at all, so we specify them separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- lastarg="\"$lastarg\""
- ;;
- esac
-
- base_compile="$base_compile $lastarg"
- done # for arg
-
- case $arg_mode in
- arg)
- $echo "$modename: you must specify an argument for -Xcompile"
- exit $EXIT_FAILURE
- ;;
- target)
- $echo "$modename: you must specify a target with \`-o'" 1>&2
- exit $EXIT_FAILURE
- ;;
- *)
- # Get the name of the library object.
- [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
- ;;
- esac
-
- # Recognize several different file suffixes.
- # If the user specifies -o file.o, it is replaced with file.lo
- xform='[cCFSifmso]'
- case $libobj in
- *.ada) xform=ada ;;
- *.adb) xform=adb ;;
- *.ads) xform=ads ;;
- *.asm) xform=asm ;;
- *.c++) xform=c++ ;;
- *.cc) xform=cc ;;
- *.ii) xform=ii ;;
- *.class) xform=class ;;
- *.cpp) xform=cpp ;;
- *.cxx) xform=cxx ;;
- *.f90) xform=f90 ;;
- *.for) xform=for ;;
- *.java) xform=java ;;
- esac
-
- libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
-
- case $libobj in
- *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
- *)
- $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- func_infer_tag $base_compile
-
- for arg in $later; do
- case $arg in
- -static)
- build_old_libs=yes
- continue
- ;;
-
- -prefer-pic)
- pic_mode=yes
- continue
- ;;
-
- -prefer-non-pic)
- pic_mode=no
- continue
- ;;
- esac
- done
-
- qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
- case $qlibobj in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qlibobj="\"$qlibobj\"" ;;
- esac
- test "X$libobj" != "X$qlibobj" \
- && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
- && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
- objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
- xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$obj"; then
- xdir=
- else
- xdir=$xdir/
- fi
- lobj=${xdir}$objdir/$objname
-
- if test -z "$base_compile"; then
- $echo "$modename: you must specify a compilation command" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Delete any leftover library objects.
- if test "$build_old_libs" = yes; then
- removelist="$obj $lobj $libobj ${libobj}T"
- else
- removelist="$lobj $libobj ${libobj}T"
- fi
-
- $run $rm $removelist
- trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
-
- # On Cygwin there's no "real" PIC flag so we must build both object types
- case $host_os in
- cygwin* | mingw* | pw32* | os2*)
- pic_mode=default
- ;;
- esac
- if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
- # non-PIC code in shared libraries is not supported
- pic_mode=default
- fi
-
- # Calculate the filename of the output object if compiler does
- # not support -o with -c
- if test "$compiler_c_o" = no; then
- output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
- lockfile="$output_obj.lock"
- removelist="$removelist $output_obj $lockfile"
- trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
- else
- output_obj=
- need_locks=no
- lockfile=
- fi
-
- # Lock this critical section if it is needed
- # We use this script file to make the link, it avoids creating a new file
- if test "$need_locks" = yes; then
- until $run ln "$progpath" "$lockfile" 2>/dev/null; do
- $show "Waiting for $lockfile to be removed"
- sleep 2
- done
- elif test "$need_locks" = warn; then
- if test -f "$lockfile"; then
- $echo "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
- $echo "$srcfile" > "$lockfile"
- fi
-
- if test -n "$fix_srcfile_path"; then
- eval srcfile=\"$fix_srcfile_path\"
- fi
- qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
- case $qsrcfile in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qsrcfile="\"$qsrcfile\"" ;;
- esac
-
- $run $rm "$libobj" "${libobj}T"
-
- # Create a libtool object file (analogous to a ".la" file),
- # but don't create it if we're doing a dry run.
- test -z "$run" && cat > ${libobj}T <<EOF
-# $libobj - a libtool object file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-EOF
-
- # Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
- # Without this assignment, base_compile gets emptied.
- fbsd_hideous_sh_bug=$base_compile
-
- if test "$pic_mode" != no; then
- command="$base_compile $qsrcfile $pic_flag"
- else
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- fi
-
- if test ! -d "${xdir}$objdir"; then
- $show "$mkdir ${xdir}$objdir"
- $run $mkdir ${xdir}$objdir
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
- exit $exit_status
- fi
- fi
-
- if test -z "$output_obj"; then
- # Place PIC objects in $objdir
- command="$command -o $lobj"
- fi
-
- $run $rm "$lobj" "$output_obj"
-
- $show "$command"
- if $run eval "$command"; then :
- else
- test -n "$output_obj" && $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed, then go on to compile the next one
- if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
- $show "$mv $output_obj $lobj"
- if $run $mv $output_obj $lobj; then :
- else
- error=$?
- $run $rm $removelist
- exit $error
- fi
- fi
-
- # Append the name of the PIC object to the libtool object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object='$objdir/$objname'
-
-EOF
-
- # Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
- suppress_output=' >/dev/null 2>&1'
- fi
- else
- # No PIC object so indicate it doesn't exist in the libtool
- # object file.
- test -z "$run" && cat >> ${libobj}T <<EOF
-pic_object=none
-
-EOF
- fi
-
- # Only build a position-dependent object if we build old libraries.
- if test "$build_old_libs" = yes; then
- if test "$pic_mode" != yes; then
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- else
- command="$base_compile $qsrcfile $pic_flag"
- fi
- if test "$compiler_c_o" = yes; then
- command="$command -o $obj"
- fi
-
- # Suppress compiler output if we already did a PIC compilation.
- command="$command$suppress_output"
- $run $rm "$obj" "$output_obj"
- $show "$command"
- if $run eval "$command"; then :
- else
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $echo "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $run $rm $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed
- if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
- $show "$mv $output_obj $obj"
- if $run $mv $output_obj $obj; then :
- else
- error=$?
- $run $rm $removelist
- exit $error
- fi
- fi
-
- # Append the name of the non-PIC object the libtool object file.
- # Only append if the libtool object file exists.
- test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object='$objname'
-
-EOF
- else
- # Append the name of the non-PIC object the libtool object file.
- # Only append if the libtool object file exists.
- test -z "$run" && cat >> ${libobj}T <<EOF
-# Name of the non-PIC object.
-non_pic_object=none
-
-EOF
- fi
-
- $run $mv "${libobj}T" "${libobj}"
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- $run $rm "$lockfile"
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- # libtool link mode
- link | relink)
- modename="$modename: link"
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- # It is impossible to link a dll without this setting, and
- # we shouldn't force the makefile maintainer to figure out
- # which system we are compiling for in order to pass an extra
- # flag for every libtool invocation.
- # allow_undefined=no
-
- # FIXME: Unfortunately, there are problems with the above when trying
- # to make a dll which has undefined symbols, in which case not
- # even a static library is built. For now, we need to specify
- # -no-undefined on the libtool link line when we can be certain
- # that all symbols are satisfied, otherwise we get a static library.
- allow_undefined=yes
- ;;
- *)
- allow_undefined=yes
- ;;
- esac
- libtool_args="$nonopt"
- base_compile="$nonopt $@"
- compile_command="$nonopt"
- finalize_command="$nonopt"
-
- compile_rpath=
- finalize_rpath=
- compile_shlibpath=
- finalize_shlibpath=
- convenience=
- old_convenience=
- deplibs=
- old_deplibs=
- compiler_flags=
- linker_flags=
- dllsearchpath=
- lib_search_path=`pwd`
- inst_prefix_dir=
-
- avoid_version=no
- dlfiles=
- dlprefiles=
- dlself=no
- export_dynamic=no
- export_symbols=
- export_symbols_regex=
- generated=
- libobjs=
- ltlibs=
- module=no
- no_install=no
- objs=
- non_pic_objects=
- notinst_path= # paths that contain not-installed libtool libraries
- precious_files_regex=
- prefer_static_libs=no
- preload=no
- prev=
- prevarg=
- release=
- rpath=
- xrpath=
- perm_rpath=
- temp_rpath=
- thread_safe=no
- vinfo=
- vinfo_number=no
-
- func_infer_tag $base_compile
-
- # We need to know -static, to get the right output filenames.
- for arg
- do
- case $arg in
- -all-static | -static)
- if test "X$arg" = "X-all-static"; then
- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
- fi
- if test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- else
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=built
- fi
- build_libtool_libs=no
- build_old_libs=yes
- break
- ;;
- esac
- done
-
- # See if our shared archives depend on static archives.
- test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
- # Go through the arguments, transforming them on the way.
- while test "$#" -gt 0; do
- arg="$1"
- shift
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
- ;;
- *) qarg=$arg ;;
- esac
- libtool_args="$libtool_args $qarg"
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- output)
- compile_command="$compile_command @OUTPUT@"
- finalize_command="$finalize_command @OUTPUT@"
- ;;
- esac
-
- case $prev in
- dlfiles|dlprefiles)
- if test "$preload" = no; then
- # Add the symbol object into the linking commands.
- compile_command="$compile_command @SYMFILE@"
- finalize_command="$finalize_command @SYMFILE@"
- preload=yes
- fi
- case $arg in
- *.la | *.lo) ;; # We handle these cases below.
- force)
- if test "$dlself" = no; then
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- self)
- if test "$prev" = dlprefiles; then
- dlself=yes
- elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
- dlself=yes
- else
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- *)
- if test "$prev" = dlfiles; then
- dlfiles="$dlfiles $arg"
- else
- dlprefiles="$dlprefiles $arg"
- fi
- prev=
- continue
- ;;
- esac
- ;;
- expsyms)
- export_symbols="$arg"
- if test ! -f "$arg"; then
- $echo "$modename: symbol file \`$arg' does not exist"
- exit $EXIT_FAILURE
- fi
- prev=
- continue
- ;;
- expsyms_regex)
- export_symbols_regex="$arg"
- prev=
- continue
- ;;
- inst_prefix)
- inst_prefix_dir="$arg"
- prev=
- continue
- ;;
- precious_regex)
- precious_files_regex="$arg"
- prev=
- continue
- ;;
- release)
- release="-$arg"
- prev=
- continue
- ;;
- objectlist)
- if test -f "$arg"; then
- save_arg=$arg
- moreargs=
- for fil in `cat $save_arg`
- do
-# moreargs="$moreargs $fil"
- arg=$fil
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- # If there is no directory component, then add one.
- case $arg in
- */* | *\\*) . $arg ;;
- *) . ./$arg ;;
- esac
-
- if test -z "$pic_object" || \
- test -z "$non_pic_object" ||
- test "$pic_object" = none && \
- test "$non_pic_object" = none; then
- $echo "$modename: cannot find name of object for \`$arg'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
- prev=
- fi
-
- # A PIC object.
- libobjs="$libobjs $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- non_pic_objects="$non_pic_objects $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if test -z "$run"; then
- $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
- exit $EXIT_FAILURE
- else
- # Dry-run case.
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
- libobjs="$libobjs $pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- fi
- done
- else
- $echo "$modename: link input file \`$save_arg' does not exist"
- exit $EXIT_FAILURE
- fi
- arg=$save_arg
- prev=
- continue
- ;;
- rpath | xrpath)
- # We need an absolute path.
- case $arg in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- $echo "$modename: only absolute run-paths are allowed" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- if test "$prev" = rpath; then
- case "$rpath " in
- *" $arg "*) ;;
- *) rpath="$rpath $arg" ;;
- esac
- else
- case "$xrpath " in
- *" $arg "*) ;;
- *) xrpath="$xrpath $arg" ;;
- esac
- fi
- prev=
- continue
- ;;
- xcompiler)
- compiler_flags="$compiler_flags $qarg"
- prev=
- compile_command="$compile_command $qarg"
- finalize_command="$finalize_command $qarg"
- continue
- ;;
- xlinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $wl$qarg"
- prev=
- compile_command="$compile_command $wl$qarg"
- finalize_command="$finalize_command $wl$qarg"
- continue
- ;;
- xcclinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $qarg"
- prev=
- compile_command="$compile_command $qarg"
- finalize_command="$finalize_command $qarg"
- continue
- ;;
- shrext)
- shrext_cmds="$arg"
- prev=
- continue
- ;;
- darwin_framework|darwin_framework_skip)
- test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- prev=
- continue
- ;;
- *)
- eval "$prev=\"\$arg\""
- prev=
- continue
- ;;
- esac
- fi # test -n "$prev"
-
- prevarg="$arg"
-
- case $arg in
- -all-static)
- if test -n "$link_static_flag"; then
- compile_command="$compile_command $link_static_flag"
- finalize_command="$finalize_command $link_static_flag"
- fi
- continue
- ;;
-
- -allow-undefined)
- # FIXME: remove this flag sometime in the future.
- $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
- continue
- ;;
-
- -avoid-version)
- avoid_version=yes
- continue
- ;;
-
- -dlopen)
- prev=dlfiles
- continue
- ;;
-
- -dlpreopen)
- prev=dlprefiles
- continue
- ;;
-
- -export-dynamic)
- export_dynamic=yes
- continue
- ;;
-
- -export-symbols | -export-symbols-regex)
- if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- $echo "$modename: more than one -exported-symbols argument is not allowed"
- exit $EXIT_FAILURE
- fi
- if test "X$arg" = "X-export-symbols"; then
- prev=expsyms
- else
- prev=expsyms_regex
- fi
- continue
- ;;
-
- -framework|-arch|-isysroot)
- case " $CC " in
- *" ${arg} ${1} "* | *" ${arg} ${1} "*)
- prev=darwin_framework_skip ;;
- *) compiler_flags="$compiler_flags $arg"
- prev=darwin_framework ;;
- esac
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- continue
- ;;
-
- -inst-prefix-dir)
- prev=inst_prefix
- continue
- ;;
-
- # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
- # so, if we see these flags be careful not to treat them like -L
- -L[A-Z][A-Z]*:*)
- case $with_gcc/$host in
- no/*-*-irix* | /*-*-irix*)
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- ;;
- esac
- continue
- ;;
-
- -L*)
- dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
- absdir="$dir"
- notinst_path="$notinst_path $dir"
- fi
- dir="$absdir"
- ;;
- esac
- case "$deplibs " in
- *" -L$dir "*) ;;
- *)
- deplibs="$deplibs -L$dir"
- lib_search_path="$lib_search_path $dir"
- ;;
- esac
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$dir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$dir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
- esac
- ;;
- esac
- continue
- ;;
-
- -l*)
- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
- # These systems don't actually have a C or math library (as such)
- continue
- ;;
- *-*-os2*)
- # These systems don't actually have a C library (as such)
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C and math libraries are in the System framework
- deplibs="$deplibs -framework System"
- continue
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- test "X$arg" = "X-lc" && continue
- ;;
- esac
- elif test "X$arg" = "X-lc_r"; then
- case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc_r directly, use -pthread flag.
- continue
- ;;
- esac
- fi
- deplibs="$deplibs $arg"
- continue
- ;;
-
- # Tru64 UNIX uses -model [arg] to determine the layout of C++
- # classes, name mangling, and exception handling.
- -model)
- compile_command="$compile_command $arg"
- compiler_flags="$compiler_flags $arg"
- finalize_command="$finalize_command $arg"
- prev=xcompiler
- continue
- ;;
-
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
- compiler_flags="$compiler_flags $arg"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- continue
- ;;
-
- -module)
- module=yes
- continue
- ;;
-
- # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
- # -r[0-9][0-9]* specifies the processor on the SGI compiler
- # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
- # +DA*, +DD* enable 64-bit mode on the HP compiler
- # -q* pass through compiler args for the IBM compiler
- # -m* pass through architecture-specific compiler args for GCC
- # -m*, -t[45]*, -txscale* pass through architecture-specific
- # compiler args for GCC
- # -pg pass through profiling flag for GCC
- # @file GCC response files
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
- -t[45]*|-txscale*|@*)
-
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- compiler_flags="$compiler_flags $arg"
- continue
- ;;
-
- -shrext)
- prev=shrext
- continue
- ;;
-
- -no-fast-install)
- fast_install=no
- continue
- ;;
-
- -no-install)
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- # The PATH hackery in wrapper scripts is required on Windows
- # in order for the loader to find any dlls it needs.
- $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
- $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
- fast_install=no
- ;;
- *) no_install=yes ;;
- esac
- continue
- ;;
-
- -no-undefined)
- allow_undefined=no
- continue
- ;;
-
- -objectlist)
- prev=objectlist
- continue
- ;;
-
- -o) prev=output ;;
-
- -precious-files-regex)
- prev=precious_regex
- continue
- ;;
-
- -release)
- prev=release
- continue
- ;;
-
- -rpath)
- prev=rpath
- continue
- ;;
-
- -R)
- prev=xrpath
- continue
- ;;
-
- -R*)
- dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- $echo "$modename: only absolute run-paths are allowed" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
- esac
- continue
- ;;
-
- -static)
- # The effects of -static are defined in a previous loop.
- # We used to do the same as -all-static on platforms that
- # didn't have a PIC flag, but the assumption that the effects
- # would be equivalent was wrong. It would break on at least
- # Digital Unix and AIX.
- continue
- ;;
-
- -thread-safe)
- thread_safe=yes
- continue
- ;;
-
- -version-info)
- prev=vinfo
- continue
- ;;
- -version-number)
- prev=vinfo
- vinfo_number=yes
- continue
- ;;
-
- -Wc,*)
- args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- case $flag in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- flag="\"$flag\""
- ;;
- esac
- arg="$arg $wl$flag"
- compiler_flags="$compiler_flags $flag"
- done
- IFS="$save_ifs"
- arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
- ;;
-
- -Wl,*)
- args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- case $flag in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- flag="\"$flag\""
- ;;
- esac
- arg="$arg $wl$flag"
- compiler_flags="$compiler_flags $wl$flag"
- linker_flags="$linker_flags $flag"
- done
- IFS="$save_ifs"
- arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
- ;;
-
- -Xcompiler)
- prev=xcompiler
- continue
- ;;
-
- -Xlinker)
- prev=xlinker
- continue
- ;;
-
- -XCClinker)
- prev=xcclinker
- continue
- ;;
-
- # Some other compiler flag.
- -* | +*)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- ;;
-
- *.$objext)
- # A standard object.
- objs="$objs $arg"
- ;;
-
- *.lo)
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- # If there is no directory component, then add one.
- case $arg in
- */* | *\\*) . $arg ;;
- *) . ./$arg ;;
- esac
-
- if test -z "$pic_object" || \
- test -z "$non_pic_object" ||
- test "$pic_object" = none && \
- test "$non_pic_object" = none; then
- $echo "$modename: cannot find name of object for \`$arg'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
- prev=
- fi
-
- # A PIC object.
- libobjs="$libobjs $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- non_pic_objects="$non_pic_objects $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if test -z "$run"; then
- $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
- exit $EXIT_FAILURE
- else
- # Dry-run case.
-
- # Extract subdirectory from the argument.
- xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$arg"; then
- xdir=
- else
- xdir="$xdir/"
- fi
-
- pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
- non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
- libobjs="$libobjs $pic_object"
- non_pic_objects="$non_pic_objects $non_pic_object"
- fi
- fi
- ;;
-
- *.$libext)
- # An archive.
- deplibs="$deplibs $arg"
- old_deplibs="$old_deplibs $arg"
- continue
- ;;
-
- *.la)
- # A libtool-controlled library.
-
- if test "$prev" = dlfiles; then
- # This library was specified with -dlopen.
- dlfiles="$dlfiles $arg"
- prev=
- elif test "$prev" = dlprefiles; then
- # The library was specified with -dlpreopen.
- dlprefiles="$dlprefiles $arg"
- prev=
- else
- deplibs="$deplibs $arg"
- fi
- continue
- ;;
-
- # Some other compiler argument.
- *)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- ;;
- esac # arg
-
- # Now actually substitute the argument into the commands.
- if test -n "$arg"; then
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- fi
- done # argument parsing loop
-
- if test -n "$prev"; then
- $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- compile_command="$compile_command $arg"
- finalize_command="$finalize_command $arg"
- fi
-
- oldlibs=
- # calculate the name of the file, without its directory
- outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
- libobjs_save="$libobjs"
-
- if test -n "$shlibpath_var"; then
- # get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
- else
- shlib_search_path=
- fi
- eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
- eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
- output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$output_objdir" = "X$output"; then
- output_objdir="$objdir"
- else
- output_objdir="$output_objdir/$objdir"
- fi
- # Create the object directory.
- if test ! -d "$output_objdir"; then
- $show "$mkdir $output_objdir"
- $run $mkdir $output_objdir
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
- exit $exit_status
- fi
- fi
-
- # Determine the type of output
- case $output in
- "")
- $echo "$modename: you must specify an output file" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
- *.$libext) linkmode=oldlib ;;
- *.lo | *.$objext) linkmode=obj ;;
- *.la) linkmode=lib ;;
- *) linkmode=prog ;; # Anything else should be a program.
- esac
-
- case $host in
- *cygwin* | *mingw* | *pw32*)
- # don't eliminate duplications in $postdeps and $predeps
- duplicate_compiler_generated_deps=yes
- ;;
- *)
- duplicate_compiler_generated_deps=$duplicate_deps
- ;;
- esac
- specialdeplibs=
-
- libs=
- # Find all interdependent deplibs by searching for libraries
- # that are linked more than once (e.g. -la -lb -la)
- for deplib in $deplibs; do
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- libs="$libs $deplib"
- done
-
- if test "$linkmode" = lib; then
- libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
- # Compute libraries that are listed more than once in $predeps
- # $postdeps and mark them as special (i.e., whose duplicates are
- # not to be eliminated).
- pre_post_deps=
- if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
- for pre_post_dep in $predeps $postdeps; do
- case "$pre_post_deps " in
- *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
- esac
- pre_post_deps="$pre_post_deps $pre_post_dep"
- done
- fi
- pre_post_deps=
- fi
-
- deplibs=
- newdependency_libs=
- newlib_search_path=
- need_relink=no # whether we're linking any uninstalled libtool libraries
- notinst_deplibs= # not-installed libtool libraries
- case $linkmode in
- lib)
- passes="conv link"
- for file in $dlfiles $dlprefiles; do
- case $file in
- *.la) ;;
- *)
- $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- done
- ;;
- prog)
- compile_deplibs=
- finalize_deplibs=
- alldeplibs=no
- newdlfiles=
- newdlprefiles=
- passes="conv scan dlopen dlpreopen link"
- ;;
- *) passes="conv"
- ;;
- esac
- for pass in $passes; do
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan"; then
- libs="$deplibs"
- deplibs=
- fi
- if test "$linkmode" = prog; then
- case $pass in
- dlopen) libs="$dlfiles" ;;
- dlpreopen) libs="$dlprefiles" ;;
- link)
- libs="$deplibs %DEPLIBS%"
- test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
- ;;
- esac
- fi
- if test "$pass" = dlopen; then
- # Collect dlpreopened libraries
- save_deplibs="$deplibs"
- deplibs=
- fi
- for deplib in $libs; do
- lib=
- found=no
- case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- compiler_flags="$compiler_flags $deplib"
- fi
- continue
- ;;
- -l*)
- if test "$linkmode" != lib && test "$linkmode" != prog; then
- $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
- continue
- fi
- name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
- for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
- for search_ext in .la $std_shrext .so .a; do
- # Search the libtool library
- lib="$searchdir/lib${name}${search_ext}"
- if test -f "$lib"; then
- if test "$search_ext" = ".la"; then
- found=yes
- else
- found=no
- fi
- break 2
- fi
- done
- done
- if test "$found" != yes; then
- # deplib doesn't seem to be a libtool library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- else # deplib is a libtool library
- # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
- # We need to do some special things here, and not later.
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $deplib "*)
- if (${SED} -e '2q' $lib |
- grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- library_names=
- old_library=
- case $lib in
- */* | *\\*) . $lib ;;
- *) . ./$lib ;;
- esac
- for l in $old_library $library_names; do
- ll="$l"
- done
- if test "X$ll" = "X$old_library" ; then # only static version available
- found=no
- ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$ladir" = "X$lib" && ladir="."
- lib=$ladir/$old_library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- fi
- fi
- ;;
- *) ;;
- esac
- fi
- fi
- ;; # -l
- -L*)
- case $linkmode in
- lib)
- deplibs="$deplib $deplibs"
- test "$pass" = conv && continue
- newdependency_libs="$deplib $newdependency_libs"
- newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
- ;;
- prog)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- if test "$pass" = scan; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
- ;;
- *)
- $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
- ;;
- esac # linkmode
- continue
- ;; # -L
- -R*)
- if test "$pass" = link; then
- dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
- # Make sure the xrpath contains only unique directories.
- case "$xrpath " in
- *" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
- esac
- fi
- deplibs="$deplib $deplibs"
- continue
- ;;
- *.la) lib="$deplib" ;;
- *.$libext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- case $linkmode in
- lib)
- valid_a_lib=no
- case $deplibs_check_method in
- match_pattern*)
- set dummy $deplibs_check_method
- match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
- if eval $echo \"$deplib\" 2>/dev/null \
- | $SED 10q \
- | $EGREP "$match_pattern_regex" > /dev/null; then
- valid_a_lib=yes
- fi
- ;;
- pass_all)
- valid_a_lib=yes
- ;;
- esac
- if test "$valid_a_lib" != yes; then
- $echo
- $echo "*** Warning: Trying to link with static lib archive $deplib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because the file extensions .$libext of this argument makes me believe"
- $echo "*** that it is just a static archive that I should not used here."
- else
- $echo
- $echo "*** Warning: Linking the shared library $output against the"
- $echo "*** static library $deplib is not portable!"
- deplibs="$deplib $deplibs"
- fi
- continue
- ;;
- prog)
- if test "$pass" != link; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- continue
- ;;
- esac # linkmode
- ;; # *.$libext
- *.lo | *.$objext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- elif test "$linkmode" = prog; then
- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- # If there is no dlopen support or we're linking statically,
- # we need to preload.
- newdlprefiles="$newdlprefiles $deplib"
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- newdlfiles="$newdlfiles $deplib"
- fi
- fi
- continue
- ;;
- %DEPLIBS%)
- alldeplibs=yes
- continue
- ;;
- esac # case $deplib
- if test "$found" = yes || test -f "$lib"; then :
- else
- $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Check to see that this really is a libtool archive.
- if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
- else
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
-
- ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$ladir" = "X$lib" && ladir="."
-
- dlname=
- dlopen=
- dlpreopen=
- libdir=
- library_names=
- old_library=
- # If the library was installed with an old release of libtool,
- # it will not redefine variables installed, or shouldnotlink
- installed=yes
- shouldnotlink=no
- avoidtemprpath=
-
-
- # Read the .la file
- case $lib in
- */* | *\\*) . $lib ;;
- *) . ./$lib ;;
- esac
-
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan" ||
- { test "$linkmode" != prog && test "$linkmode" != lib; }; then
- test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
- test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
- fi
-
- if test "$pass" = conv; then
- # Only check for convenience libraries
- deplibs="$lib $deplibs"
- if test -z "$libdir"; then
- if test -z "$old_library"; then
- $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- # It is a libtool convenience library, so add in its objects.
- convenience="$convenience $ladir/$objdir/$old_library"
- old_convenience="$old_convenience $ladir/$objdir/$old_library"
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done
- elif test "$linkmode" != prog && test "$linkmode" != lib; then
- $echo "$modename: \`$lib' is not a convenience library" 1>&2
- exit $EXIT_FAILURE
- fi
- continue
- fi # $pass = conv
-
-
- # Get the name of the library we link against.
- linklib=
- for l in $old_library $library_names; do
- linklib="$l"
- done
- if test -z "$linklib"; then
- $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # This library was specified with -dlopen.
- if test "$pass" = dlopen; then
- if test -z "$libdir"; then
- $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- if test -z "$dlname" ||
- test "$dlopen_support" != yes ||
- test "$build_libtool_libs" = no; then
- # If there is no dlname, no dlopen support or we're linking
- # statically, we need to preload. We also need to preload any
- # dependent libraries so libltdl's deplib preloader doesn't
- # bomb out in the load deplibs phase.
- dlprefiles="$dlprefiles $lib $dependency_libs"
- else
- newdlfiles="$newdlfiles $lib"
- fi
- continue
- fi # $pass = dlopen
-
- # We need an absolute path.
- case $ladir in
- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
- *)
- abs_ladir=`cd "$ladir" && pwd`
- if test -z "$abs_ladir"; then
- $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
- $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
- abs_ladir="$ladir"
- fi
- ;;
- esac
- laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
-
- # Find the relevant object directory and library name.
- if test "X$installed" = Xyes; then
- if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- $echo "$modename: warning: library \`$lib' was moved." 1>&2
- dir="$ladir"
- absdir="$abs_ladir"
- libdir="$abs_ladir"
- else
- dir="$libdir"
- absdir="$libdir"
- fi
- test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
- else
- if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- dir="$ladir"
- absdir="$abs_ladir"
- # Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
- else
- dir="$ladir/$objdir"
- absdir="$abs_ladir/$objdir"
- # Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
- fi
- fi # $installed = yes
- name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
-
- # This library was specified with -dlpreopen.
- if test "$pass" = dlpreopen; then
- if test -z "$libdir"; then
- $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
- exit $EXIT_FAILURE
- fi
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- newdlprefiles="$newdlprefiles $dir/$old_library"
- # Otherwise, use the dlname, so that lt_dlopen finds it.
- elif test -n "$dlname"; then
- newdlprefiles="$newdlprefiles $dir/$dlname"
- else
- newdlprefiles="$newdlprefiles $dir/$linklib"
- fi
- fi # $pass = dlpreopen
-
- if test -z "$libdir"; then
- # Link the convenience library
- if test "$linkmode" = lib; then
- deplibs="$dir/$old_library $deplibs"
- elif test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$dir/$old_library $compile_deplibs"
- finalize_deplibs="$dir/$old_library $finalize_deplibs"
- else
- deplibs="$lib $deplibs" # used for prog,scan pass
- fi
- continue
- fi
-
-
- if test "$linkmode" = prog && test "$pass" != link; then
- newlib_search_path="$newlib_search_path $ladir"
- deplibs="$lib $deplibs"
-
- linkalldeplibs=no
- if test "$link_all_deplibs" != no || test -z "$library_names" ||
- test "$build_libtool_libs" = no; then
- linkalldeplibs=yes
- fi
-
- tmp_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
- esac
- # Need to link against all dependency_libs?
- if test "$linkalldeplibs" = yes; then
- deplibs="$deplib $deplibs"
- else
- # Need to hardcode shared library paths
- # or/and link against static libraries
- newdependency_libs="$deplib $newdependency_libs"
- fi
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done # for deplib
- continue
- fi # $linkmode = prog...
-
- if test "$linkmode,$pass" = "prog,link"; then
- if test -n "$library_names" &&
- { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
- # We need to hardcode the library path
- if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
- # Make sure the rpath contains only unique directories.
- case "$temp_rpath " in
- *" $dir "*) ;;
- *" $absdir "*) ;;
- *) temp_rpath="$temp_rpath $absdir" ;;
- esac
- fi
-
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
- esac
- ;;
- esac
- fi # $linkmode,$pass = prog,link...
-
- if test "$alldeplibs" = yes &&
- { test "$deplibs_check_method" = pass_all ||
- { test "$build_libtool_libs" = yes &&
- test -n "$library_names"; }; }; then
- # We only need to search for static libraries
- continue
- fi
- fi
-
- link_static=no # Whether the deplib will be linked statically
- use_static_libs=$prefer_static_libs
- if test "$use_static_libs" = built && test "$installed" = yes ; then
- use_static_libs=no
- fi
- if test -n "$library_names" &&
- { test "$use_static_libs" = no || test -z "$old_library"; }; then
- if test "$installed" = no; then
- notinst_deplibs="$notinst_deplibs $lib"
- need_relink=yes
- fi
- # This is a shared library
-
- # Warn about portability, can't link against -module's on
- # some systems (darwin)
- if test "$shouldnotlink" = yes && test "$pass" = link ; then
- $echo
- if test "$linkmode" = prog; then
- $echo "*** Warning: Linking the executable $output against the loadable module"
- else
- $echo "*** Warning: Linking the shared library $output against the loadable module"
- fi
- $echo "*** $linklib is not portable!"
- fi
- if test "$linkmode" = lib &&
- test "$hardcode_into_libs" = yes; then
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
- esac
- ;;
- esac
- fi
-
- if test -n "$old_archive_from_expsyms_cmds"; then
- # figure out the soname
- set dummy $library_names
- realname="$2"
- shift; shift
- libname=`eval \\$echo \"$libname_spec\"`
- # use dlname if we got it. it's perfectly good, no?
- if test -n "$dlname"; then
- soname="$dlname"
- elif test -n "$soname_spec"; then
- # bleh windows
- case $host in
- *cygwin* | mingw*)
- major=`expr $current - $age`
- versuffix="-$major"
- ;;
- esac
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
-
- # Make a new name for the extract_expsyms_cmds to use
- soroot="$soname"
- soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
- newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
-
- # If the library has no export list, then create one now
- if test -f "$output_objdir/$soname-def"; then :
- else
- $show "extracting exported symbol list from \`$soname'"
- save_ifs="$IFS"; IFS='~'
- cmds=$extract_expsyms_cmds
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
-
- # Create $newlib
- if test -f "$output_objdir/$newlib"; then :; else
- $show "generating import library for \`$soname'"
- save_ifs="$IFS"; IFS='~'
- cmds=$old_archive_from_expsyms_cmds
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
- # make sure the library variables are pointing to the new library
- dir=$output_objdir
- linklib=$newlib
- fi # test -n "$old_archive_from_expsyms_cmds"
-
- if test "$linkmode" = prog || test "$mode" != relink; then
- add_shlibpath=
- add_dir=
- add=
- lib_linked=yes
- case $hardcode_action in
- immediate | unsupported)
- if test "$hardcode_direct" = no; then
- add="$dir/$linklib"
- case $host in
- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- *-*-sysv4*uw2*) add_dir="-L$dir" ;;
- *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- *-*-unixware7*) add_dir="-L$dir" ;;
- *-*-darwin* )
- # if the lib is a module then we can not link against
- # it, someone is ignoring the new warnings I added
- if /usr/bin/file -L $add 2> /dev/null |
- $EGREP ": [^:]* bundle" >/dev/null ; then
- $echo "** Warning, lib $linklib is a module, not a shared library"
- if test -z "$old_library" ; then
- $echo
- $echo "** And there doesn't seem to be a static archive available"
- $echo "** The link will probably fail, sorry"
- else
- add="$dir/$old_library"
- fi
- fi
- esac
- elif test "$hardcode_minus_L" = no; then
- case $host in
- *-*-sunos*) add_shlibpath="$dir" ;;
- esac
- add_dir="-L$dir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = no; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- relink)
- if test "$hardcode_direct" = yes; then
- add="$dir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$dir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- *) lib_linked=no ;;
- esac
-
- if test "$lib_linked" != yes; then
- $echo "$modename: configuration error: unsupported hardcode properties"
- exit $EXIT_FAILURE
- fi
-
- if test -n "$add_shlibpath"; then
- case :$compile_shlibpath: in
- *":$add_shlibpath:"*) ;;
- *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
- esac
- fi
- if test "$linkmode" = prog; then
- test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
- test -n "$add" && compile_deplibs="$add $compile_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- if test "$hardcode_direct" != yes && \
- test "$hardcode_minus_L" != yes && \
- test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- esac
- fi
- fi
- fi
-
- if test "$linkmode" = prog || test "$mode" = relink; then
- add_shlibpath=
- add_dir=
- add=
- # Finalize command for both is simple: just hardcode it.
- if test "$hardcode_direct" = yes; then
- add="$libdir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- esac
- add="-l$name"
- elif test "$hardcode_automatic" = yes; then
- if test -n "$inst_prefix_dir" &&
- test -f "$inst_prefix_dir$libdir/$linklib" ; then
- add="$inst_prefix_dir$libdir/$linklib"
- else
- add="$libdir/$linklib"
- fi
- else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- fi
-
- if test "$linkmode" = prog; then
- test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
- test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- fi
- fi
- elif test "$linkmode" = prog; then
- # Here we assume that one of hardcode_direct or hardcode_minus_L
- # is not unsupported. This is valid on all known static and
- # shared platforms.
- if test "$hardcode_direct" != unsupported; then
- test -n "$old_library" && linklib="$old_library"
- compile_deplibs="$dir/$linklib $compile_deplibs"
- finalize_deplibs="$dir/$linklib $finalize_deplibs"
- else
- compile_deplibs="-l$name -L$dir $compile_deplibs"
- finalize_deplibs="-l$name -L$dir $finalize_deplibs"
- fi
- elif test "$build_libtool_libs" = yes; then
- # Not a shared library
- if test "$deplibs_check_method" != pass_all; then
- # We're trying link a shared library against a static one
- # but the system doesn't support it.
-
- # Just print a warning and add the library to dependency_libs so
- # that the program can be linked against the static library.
- $echo
- $echo "*** Warning: This system can not link to static lib archive $lib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have."
- if test "$module" = yes; then
- $echo "*** But as you try to build a module library, libtool will still create "
- $echo "*** a static module, that should work as long as the dlopening application"
- $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
- if test -z "$global_symbol_pipe"; then
- $echo
- $echo "*** However, this would only work if libtool was able to extract symbol"
- $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- $echo "*** not find such a program. So, this module is probably useless."
- $echo "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- else
- deplibs="$dir/$old_library $deplibs"
- link_static=yes
- fi
- fi # link shared/static library?
-
- if test "$linkmode" = lib; then
- if test -n "$dependency_libs" &&
- { test "$hardcode_into_libs" != yes ||
- test "$build_old_libs" = yes ||
- test "$link_static" = yes; }; then
- # Extract -R from dependency_libs
- temp_deplibs=
- for libdir in $dependency_libs; do
- case $libdir in
- -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
- case " $xrpath " in
- *" $temp_xrpath "*) ;;
- *) xrpath="$xrpath $temp_xrpath";;
- esac;;
- *) temp_deplibs="$temp_deplibs $libdir";;
- esac
- done
- dependency_libs="$temp_deplibs"
- fi
-
- newlib_search_path="$newlib_search_path $absdir"
- # Link against this library
- test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
- # ... and its dependency_libs
- tmp_libs=
- for deplib in $dependency_libs; do
- newdependency_libs="$deplib $newdependency_libs"
- if test "X$duplicate_deps" = "Xyes" ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done
-
- if test "$link_all_deplibs" != no; then
- # Add the search paths of all dependency libraries
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) path="$deplib" ;;
- *.la)
- dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
- test "X$dir" = "X$deplib" && dir="."
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
- absdir="$dir"
- fi
- ;;
- esac
- if grep "^installed=no" $deplib > /dev/null; then
- path="$absdir/$objdir"
- else
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- if test -z "$libdir"; then
- $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- if test "$absdir" != "$libdir"; then
- $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
- fi
- path="$absdir"
- fi
- depdepl=
- case $host in
- *-*-darwin*)
- # we do not want to link against static libs,
- # but need to link against shared
- eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- if test -n "$deplibrary_names" ; then
- for tmp in $deplibrary_names ; do
- depdepl=$tmp
- done
- if test -f "$path/$depdepl" ; then
- depdepl="$path/$depdepl"
- fi
- # do not add paths which are already there
- case " $newlib_search_path " in
- *" $path "*) ;;
- *) newlib_search_path="$newlib_search_path $path";;
- esac
- fi
- path=""
- ;;
- *)
- path="-L$path"
- ;;
- esac
- ;;
- -l*)
- case $host in
- *-*-darwin*)
- # Again, we only want to link against shared libraries
- eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
- for tmp in $newlib_search_path ; do
- if test -f "$tmp/lib$tmp_libs.dylib" ; then
- eval depdepl="$tmp/lib$tmp_libs.dylib"
- break
- fi
- done
- path=""
- ;;
- *) continue ;;
- esac
- ;;
- *) continue ;;
- esac
- case " $deplibs " in
- *" $path "*) ;;
- *) deplibs="$path $deplibs" ;;
- esac
- case " $deplibs " in
- *" $depdepl "*) ;;
- *) deplibs="$depdepl $deplibs" ;;
- esac
- done
- fi # link_all_deplibs != no
- fi # linkmode = lib
- done # for deplib in $libs
- dependency_libs="$newdependency_libs"
- if test "$pass" = dlpreopen; then
- # Link the dlpreopened libraries before other libraries
- for deplib in $save_deplibs; do
- deplibs="$deplib $deplibs"
- done
- fi
- if test "$pass" != dlopen; then
- if test "$pass" != conv; then
- # Make sure lib_search_path contains only unique directories.
- lib_search_path=
- for dir in $newlib_search_path; do
- case "$lib_search_path " in
- *" $dir "*) ;;
- *) lib_search_path="$lib_search_path $dir" ;;
- esac
- done
- newlib_search_path=
- fi
-
- if test "$linkmode,$pass" != "prog,link"; then
- vars="deplibs"
- else
- vars="compile_deplibs finalize_deplibs"
- fi
- for var in $vars dependency_libs; do
- # Add libraries to $var in reverse order
- eval tmp_libs=\"\$$var\"
- new_libs=
- for deplib in $tmp_libs; do
- # FIXME: Pedantically, this is the right thing to do, so
- # that some nasty dependency loop isn't accidentally
- # broken:
- #new_libs="$deplib $new_libs"
- # Pragmatically, this seems to cause very few problems in
- # practice:
- case $deplib in
- -L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
- *)
- # And here is the reason: when a library appears more
- # than once as an explicit dependence of a library, or
- # is implicitly linked in more than once by the
- # compiler, it is considered special, and multiple
- # occurrences thereof are not removed. Compare this
- # with having the same library being listed as a
- # dependency of multiple other libraries: in this case,
- # we know (pedantically, we assume) the library does not
- # need to be listed more than once, so we keep only the
- # last copy. This is not always right, but it is rare
- # enough that we require users that really mean to play
- # such unportable linking tricks to link the library
- # using -Wl,-lname, so that libtool does not consider it
- # for duplicate removal.
- case " $specialdeplibs " in
- *" $deplib "*) new_libs="$deplib $new_libs" ;;
- *)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$deplib $new_libs" ;;
- esac
- ;;
- esac
- ;;
- esac
- done
- tmp_libs=
- for deplib in $new_libs; do
- case $deplib in
- -L*)
- case " $tmp_libs " in
- *" $deplib "*) ;;
- *) tmp_libs="$tmp_libs $deplib" ;;
- esac
- ;;
- *) tmp_libs="$tmp_libs $deplib" ;;
- esac
- done
- eval $var=\"$tmp_libs\"
- done # for var
- fi
- # Last step: remove runtime libs from dependency_libs
- # (they stay in deplibs)
- tmp_libs=
- for i in $dependency_libs ; do
- case " $predeps $postdeps $compiler_lib_search_path " in
- *" $i "*)
- i=""
- ;;
- esac
- if test -n "$i" ; then
- tmp_libs="$tmp_libs $i"
- fi
- done
- dependency_libs=$tmp_libs
- done # for pass
- if test "$linkmode" = prog; then
- dlfiles="$newdlfiles"
- dlprefiles="$newdlprefiles"
- fi
-
- case $linkmode in
- oldlib)
- if test -n "$deplibs"; then
- $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
- fi
-
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
- fi
-
- if test -n "$rpath"; then
- $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
- fi
-
- if test -n "$xrpath"; then
- $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
- fi
-
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
- fi
-
- if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
- fi
-
- # Now set the variables for building old libraries.
- build_libtool_libs=no
- oldlibs="$output"
- objs="$objs$old_deplibs"
- ;;
-
- lib)
- # Make sure we only generate libraries of the form `libNAME.la'.
- case $outputname in
- lib*)
- name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- ;;
- *)
- if test "$module" = no; then
- $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
- if test "$need_lib_prefix" != no; then
- # Add the "lib" prefix for modules if required
- name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- else
- libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
- fi
- ;;
- esac
-
- if test -n "$objs"; then
- if test "$deplibs_check_method" != pass_all; then
- $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
- exit $EXIT_FAILURE
- else
- $echo
- $echo "*** Warning: Linking the shared library $output against the non-libtool"
- $echo "*** objects $objs is not portable!"
- libobjs="$libobjs $objs"
- fi
- fi
-
- if test "$dlself" != no; then
- $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
- fi
-
- set dummy $rpath
- if test "$#" -gt 2; then
- $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
- fi
- install_libdir="$2"
-
- oldlibs=
- if test -z "$rpath"; then
- if test "$build_libtool_libs" = yes; then
- # Building a libtool convenience library.
- # Some compilers have problems with a `.al' extension so
- # convenience libraries should have the same extension an
- # archive normally would.
- oldlibs="$output_objdir/$libname.$libext $oldlibs"
- build_libtool_libs=convenience
- build_old_libs=yes
- fi
-
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
- fi
- else
-
- # Parse the version information argument.
- save_ifs="$IFS"; IFS=':'
- set dummy $vinfo 0 0 0
- IFS="$save_ifs"
-
- if test -n "$8"; then
- $echo "$modename: too many parameters to \`-version-info'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # convert absolute version numbers to libtool ages
- # this retains compatibility with .la files and attempts
- # to make the code below a bit more comprehensible
-
- case $vinfo_number in
- yes)
- number_major="$2"
- number_minor="$3"
- number_revision="$4"
- #
- # There are really only two kinds -- those that
- # use the current revision as the major version
- # and those that subtract age and use age as
- # a minor version. But, then there is irix
- # which has an extra 1 added just for fun
- #
- case $version_type in
- darwin|linux|osf|windows)
- current=`expr $number_major + $number_minor`
- age="$number_minor"
- revision="$number_revision"
- ;;
- freebsd-aout|freebsd-elf|sunos)
- current="$number_major"
- revision="$number_minor"
- age="0"
- ;;
- irix|nonstopux)
- current=`expr $number_major + $number_minor - 1`
- age="$number_minor"
- revision="$number_minor"
- ;;
- *)
- $echo "$modename: unknown library version type \`$version_type'" 1>&2
- $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- ;;
- no)
- current="$2"
- revision="$3"
- age="$4"
- ;;
- esac
-
- # Check that each of the things are valid numbers.
- case $current in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- case $revision in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- case $age in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- if test "$age" -gt "$current"; then
- $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
- $echo "$modename: \`$vinfo' is not valid version information" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Calculate the version variables.
- major=
- versuffix=
- verstring=
- case $version_type in
- none) ;;
-
- darwin)
- # Like Linux, but with the current version available in
- # verstring for coding it into the library header
- major=.`expr $current - $age`
- versuffix="$major.$age.$revision"
- # Darwin ld doesn't like 0 for these options...
- minor_current=`expr $current + 1`
- verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
- ;;
-
- freebsd-aout)
- major=".$current"
- versuffix=".$current.$revision";
- ;;
-
- freebsd-elf)
- major=".$current"
- versuffix=".$current";
- ;;
-
- irix | nonstopux)
- major=`expr $current - $age + 1`
-
- case $version_type in
- nonstopux) verstring_prefix=nonstopux ;;
- *) verstring_prefix=sgi ;;
- esac
- verstring="$verstring_prefix$major.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$revision
- while test "$loop" -ne 0; do
- iface=`expr $revision - $loop`
- loop=`expr $loop - 1`
- verstring="$verstring_prefix$major.$iface:$verstring"
- done
-
- # Before this point, $major must not contain `.'.
- major=.$major
- versuffix="$major.$revision"
- ;;
-
- linux)
- major=.`expr $current - $age`
- versuffix="$major.$age.$revision"
- ;;
-
- osf)
- major=.`expr $current - $age`
- versuffix=".$current.$age.$revision"
- verstring="$current.$age.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$age
- while test "$loop" -ne 0; do
- iface=`expr $current - $loop`
- loop=`expr $loop - 1`
- verstring="$verstring:${iface}.0"
- done
-
- # Make executables depend on our current version.
- verstring="$verstring:${current}.0"
- ;;
-
- sunos)
- major=".$current"
- versuffix=".$current.$revision"
- ;;
-
- windows)
- # Use '-' rather than '.', since we only want one
- # extension on DOS 8.3 filesystems.
- major=`expr $current - $age`
- versuffix="-$major"
- ;;
-
- *)
- $echo "$modename: unknown library version type \`$version_type'" 1>&2
- $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- # Clear the version info if we defaulted, and they specified a release.
- if test -z "$vinfo" && test -n "$release"; then
- major=
- case $version_type in
- darwin)
- # we can't check for "0.0" in archive_cmds due to quoting
- # problems, so we reset it completely
- verstring=
- ;;
- *)
- verstring="0.0"
- ;;
- esac
- if test "$need_version" = no; then
- versuffix=
- else
- versuffix=".0.0"
- fi
- fi
-
- # Remove version info from name if versioning should be avoided
- if test "$avoid_version" = yes && test "$need_version" = no; then
- major=
- versuffix=
- verstring=""
- fi
-
- # Check to see if the archive will have undefined symbols.
- if test "$allow_undefined" = yes; then
- if test "$allow_undefined_flag" = unsupported; then
- $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
- build_libtool_libs=no
- build_old_libs=yes
- fi
- else
- # Don't allow undefined symbols.
- allow_undefined_flag="$no_undefined_flag"
- fi
- fi
-
- if test "$mode" != relink; then
- # Remove our outputs, but don't remove object files since they
- # may have been created when compiling PIC objects.
- removelist=
- tempremovelist=`$echo "$output_objdir/*"`
- for p in $tempremovelist; do
- case $p in
- *.$objext)
- ;;
- $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
- if test "X$precious_files_regex" != "X"; then
- if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
- then
- continue
- fi
- fi
- removelist="$removelist $p"
- ;;
- *) ;;
- esac
- done
- if test -n "$removelist"; then
- $show "${rm}r $removelist"
- $run ${rm}r $removelist
- fi
- fi
-
- # Now set the variables for building old libraries.
- if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
- oldlibs="$oldlibs $output_objdir/$libname.$libext"
-
- # Transform .lo files to .o files.
- oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
- fi
-
- # Eliminate all temporary directories.
- for path in $notinst_path; do
- lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
- deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
- dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
- done
-
- if test -n "$xrpath"; then
- # If the user specified any rpath flags, then add them.
- temp_xrpath=
- for libdir in $xrpath; do
- temp_xrpath="$temp_xrpath -R$libdir"
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
- esac
- done
- if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
- dependency_libs="$temp_xrpath $dependency_libs"
- fi
- fi
-
- # Make sure dlfiles contains only unique files that won't be dlpreopened
- old_dlfiles="$dlfiles"
- dlfiles=
- for lib in $old_dlfiles; do
- case " $dlprefiles $dlfiles " in
- *" $lib "*) ;;
- *) dlfiles="$dlfiles $lib" ;;
- esac
- done
-
- # Make sure dlprefiles contains only unique files
- old_dlprefiles="$dlprefiles"
- dlprefiles=
- for lib in $old_dlprefiles; do
- case "$dlprefiles " in
- *" $lib "*) ;;
- *) dlprefiles="$dlprefiles $lib" ;;
- esac
- done
-
- if test "$build_libtool_libs" = yes; then
- if test -n "$rpath"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
- # these systems don't actually have a c library (as such)!
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C library is in the System framework
- deplibs="$deplibs -framework System"
- ;;
- *-*-netbsd*)
- # Don't link with libc until the a.out ld.so is fixed.
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- ;;
- *)
- # Add libc to deplibs on all other systems if necessary.
- if test "$build_libtool_need_lc" = "yes"; then
- deplibs="$deplibs -lc"
- fi
- ;;
- esac
- fi
-
- # Transform deplibs into only deplibs that can be linked in shared.
- name_save=$name
- libname_save=$libname
- release_save=$release
- versuffix_save=$versuffix
- major_save=$major
- # I'm not sure if I'm treating the release correctly. I think
- # release should show up in the -l (ie -lgmp5) so we don't want to
- # add it in twice. Is that correct?
- release=""
- versuffix=""
- major=""
- newdeplibs=
- droppeddeps=no
- case $deplibs_check_method in
- pass_all)
- # Don't check for shared/static. Everything works.
- # This might be a little naive. We might want to check
- # whether the library exists or not. But this is on
- # osf3 & osf4 and I'm not really sure... Just
- # implementing what was already the behavior.
- newdeplibs=$deplibs
- ;;
- test_compile)
- # This code stresses the "libraries are programs" paradigm to its
- # limits. Maybe even breaks it. We compile a program, linking it
- # against the deplibs as a proxy for the library. Then we can check
- # whether they linked in statically or dynamically with ldd.
- $rm conftest.c
- cat > conftest.c <<EOF
- int main() { return 0; }
-EOF
- $rm conftest
- $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
- if test "$?" -eq 0 ; then
- ldd_output=`ldd conftest`
- for i in $deplibs; do
- name=`expr $i : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" -ne "0"; then
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning: dynamic linker does not accept needed library $i."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which I believe you do not have"
- $echo "*** because a test_compile did reveal that the linker did not use it for"
- $echo "*** its dynamic dependency list that programs get resolved with at runtime."
- fi
- fi
- else
- newdeplibs="$newdeplibs $i"
- fi
- done
- else
- # Error occurred in the first compile. Let's try to salvage
- # the situation: Compile a separate program for each library.
- for i in $deplibs; do
- name=`expr $i : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" != "0"; then
- $rm conftest
- $LTCC $LTCFLAGS -o conftest conftest.c $i
- # Did it work?
- if test "$?" -eq 0 ; then
- ldd_output=`ldd conftest`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning: dynamic linker does not accept needed library $i."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because a test_compile did reveal that the linker did not use this one"
- $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
- fi
- fi
- else
- droppeddeps=yes
- $echo
- $echo "*** Warning! Library $i is needed by this library but I was not able to"
- $echo "*** make it link in! You will probably need to install it or some"
- $echo "*** library that it depends on before this library will be fully"
- $echo "*** functional. Installing it before continuing would be even better."
- fi
- else
- newdeplibs="$newdeplibs $i"
- fi
- done
- fi
- ;;
- file_magic*)
- set dummy $deplibs_check_method
- file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
- for a_deplib in $deplibs; do
- name=`expr $a_deplib : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" != "0"; then
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- # Follow soft links.
- if ls -lLd "$potent_lib" 2>/dev/null \
- | grep " -> " >/dev/null; then
- continue
- fi
- # The statement above tries to avoid entering an
- # endless loop below, in case of cyclic links.
- # We might still enter an endless loop, since a link
- # loop can be closed while we follow links,
- # but so what?
- potlib="$potent_lib"
- while test -h "$potlib" 2>/dev/null; do
- potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
- case $potliblink in
- [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
- esac
- done
- if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
- | ${SED} 10q \
- | $EGREP "$file_magic_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- $echo
- $echo "*** Warning: linker path does not have real file for library $a_deplib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $echo "*** with $libname but no candidates were found. (...for file magic test)"
- else
- $echo "*** with $libname and none of the candidates passed a file format test"
- $echo "*** using a file magic. Last file checked: $potlib"
- fi
- fi
- else
- # Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
- fi
- done # Gone through all deplibs.
- ;;
- match_pattern*)
- set dummy $deplibs_check_method
- match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
- for a_deplib in $deplibs; do
- name=`expr $a_deplib : '-l\(.*\)'`
- # If $name is empty we are operating on a -L argument.
- if test -n "$name" && test "$name" != "0"; then
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval \\$echo \"$libname_spec\"`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- potlib="$potent_lib" # see symlink-check above in file_magic test
- if eval $echo \"$potent_lib\" 2>/dev/null \
- | ${SED} 10q \
- | $EGREP "$match_pattern_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- $echo
- $echo "*** Warning: linker path does not have real file for library $a_deplib."
- $echo "*** I have the capability to make that library automatically link in when"
- $echo "*** you link to this library. But I can only do this if you have a"
- $echo "*** shared version of the library, which you do not appear to have"
- $echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
- else
- $echo "*** with $libname and none of the candidates passed a file format test"
- $echo "*** using a regex pattern. Last file checked: $potlib"
- fi
- fi
- else
- # Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
- fi
- done # Gone through all deplibs.
- ;;
- none | unknown | *)
- newdeplibs=""
- tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
- -e 's/ -[LR][^ ]*//g'`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- for i in $predeps $postdeps ; do
- # can't use Xsed below, because $i might contain '/'
- tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
- done
- fi
- if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
- | grep . >/dev/null; then
- $echo
- if test "X$deplibs_check_method" = "Xnone"; then
- $echo "*** Warning: inter-library dependencies are not supported in this platform."
- else
- $echo "*** Warning: inter-library dependencies are not known to be supported."
- fi
- $echo "*** All declared inter-library dependencies are being dropped."
- droppeddeps=yes
- fi
- ;;
- esac
- versuffix=$versuffix_save
- major=$major_save
- release=$release_save
- libname=$libname_save
- name=$name_save
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library is the System framework
- newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
- ;;
- esac
-
- if test "$droppeddeps" = yes; then
- if test "$module" = yes; then
- $echo
- $echo "*** Warning: libtool could not satisfy all declared inter-library"
- $echo "*** dependencies of module $libname. Therefore, libtool will create"
- $echo "*** a static module, that should work as long as the dlopening"
- $echo "*** application is linked with the -dlopen flag."
- if test -z "$global_symbol_pipe"; then
- $echo
- $echo "*** However, this would only work if libtool was able to extract symbol"
- $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- $echo "*** not find such a program. So, this module is probably useless."
- $echo "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- else
- $echo "*** The inter-library dependencies that have been dropped here will be"
- $echo "*** automatically added whenever a program is linked with this library"
- $echo "*** or is declared to -dlopen it."
-
- if test "$allow_undefined" = no; then
- $echo
- $echo "*** Since this library must not contain undefined symbols,"
- $echo "*** because either the platform does not support them or"
- $echo "*** it was explicitly requested with -no-undefined,"
- $echo "*** libtool will only create a static version of it."
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- fi
- fi
- # Done checking deplibs!
- deplibs=$newdeplibs
- fi
-
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $deplibs " in
- *" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- done
- deplibs="$new_libs"
-
-
- # All the library-specific variables (install_libdir is set above).
- library_names=
- old_library=
- dlname=
-
- # Test again, we may have decided not to build it any more
- if test "$build_libtool_libs" = yes; then
- if test "$hardcode_into_libs" = yes; then
- # Hardcode the library paths
- hardcode_libdirs=
- dep_rpath=
- rpath="$finalize_rpath"
- test "$mode" != relink && rpath="$compile_rpath$rpath"
- for libdir in $rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- dep_rpath="$dep_rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- if test -n "$hardcode_libdir_flag_spec_ld"; then
- eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
- else
- eval dep_rpath=\"$hardcode_libdir_flag_spec\"
- fi
- fi
- if test -n "$runpath_var" && test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- rpath="$rpath$dir:"
- done
- eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
- fi
- test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
- fi
-
- shlibpath="$finalize_shlibpath"
- test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
- if test -n "$shlibpath"; then
- eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
- fi
-
- # Get the real and link names of the library.
- eval shared_ext=\"$shrext_cmds\"
- eval library_names=\"$library_names_spec\"
- set dummy $library_names
- realname="$2"
- shift; shift
-
- if test -n "$soname_spec"; then
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
- if test -z "$dlname"; then
- dlname=$soname
- fi
-
- lib="$output_objdir/$realname"
- linknames=
- for link
- do
- linknames="$linknames $link"
- done
-
- # Use standard objects if they are pic
- test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- $show "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $run $rm $export_symbols
- cmds=$export_symbols_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- if len=`expr "X$cmd" : ".*"` &&
- test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- $show "$cmd"
- $run eval "$cmd" || exit $?
- skipped_export=false
- else
- # The command line is too long to execute in one step.
- $show "using reloadable object file for export list..."
- skipped_export=:
- # Break out early, otherwise skipped_export may be
- # set to false by a later but shorter cmd.
- break
- fi
- done
- IFS="$save_ifs"
- if test -n "$export_symbols_regex"; then
- $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
- $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- $show "$mv \"${export_symbols}T\" \"$export_symbols\""
- $run eval '$mv "${export_symbols}T" "$export_symbols"'
- fi
- fi
- fi
-
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
- fi
-
- tmp_deplibs=
- for test_deplib in $deplibs; do
- case " $convenience " in
- *" $test_deplib "*) ;;
- *)
- tmp_deplibs="$tmp_deplibs $test_deplib"
- ;;
- esac
- done
- deplibs="$tmp_deplibs"
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- else
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $convenience
- libobjs="$libobjs $func_extract_archives_result"
- fi
- fi
-
- if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
- eval flag=\"$thread_safe_flag_spec\"
- linker_flags="$linker_flags $flag"
- fi
-
- # Make a backup of the uninstalled library when relinking
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
- fi
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- eval test_cmds=\"$module_expsym_cmds\"
- cmds=$module_expsym_cmds
- else
- eval test_cmds=\"$module_cmds\"
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- eval test_cmds=\"$archive_expsym_cmds\"
- cmds=$archive_expsym_cmds
- else
- eval test_cmds=\"$archive_cmds\"
- cmds=$archive_cmds
- fi
- fi
-
- if test "X$skipped_export" != "X:" &&
- len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- :
- else
- # The command line is too long to link in one step, link piecewise.
- $echo "creating reloadable object files..."
-
- # Save the value of $output and $libobjs because we want to
- # use them later. If we have whole_archive_flag_spec, we
- # want to use save_libobjs as it was before
- # whole_archive_flag_spec was expanded, because we can't
- # assume the linker understands whole_archive_flag_spec.
- # This may have to be revisited, in case too many
- # convenience libraries get linked in and end up exceeding
- # the spec.
- if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- fi
- save_output=$output
- output_la=`$echo "X$output" | $Xsed -e "$basename"`
-
- # Clear the reloadable object creation command queue and
- # initialize k to one.
- test_cmds=
- concat_cmds=
- objlist=
- delfiles=
- last_robj=
- k=1
- output=$output_objdir/$output_la-${k}.$objext
- # Loop over the list of objects to be linked.
- for obj in $save_libobjs
- do
- eval test_cmds=\"$reload_cmds $objlist $last_robj\"
- if test "X$objlist" = X ||
- { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- test "$len" -le "$max_cmd_len"; }; then
- objlist="$objlist $obj"
- else
- # The command $test_cmds is almost too long, add a
- # command to the queue.
- if test "$k" -eq 1 ; then
- # The first file doesn't have a previous command to add.
- eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
- else
- # All subsequent reloadable object files will link in
- # the last one created.
- eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
- fi
- last_robj=$output_objdir/$output_la-${k}.$objext
- k=`expr $k + 1`
- output=$output_objdir/$output_la-${k}.$objext
- objlist=$obj
- len=1
- fi
- done
- # Handle the remaining objects by creating one last
- # reloadable object file. All subsequent reloadable object
- # files will link in the last one created.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
-
- if ${skipped_export-false}; then
- $show "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $run $rm $export_symbols
- libobjs=$output
- # Append the command to create the export file.
- eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
- fi
-
- # Set up a command to remove the reloadable object files
- # after they are used.
- i=0
- while test "$i" -lt "$k"
- do
- i=`expr $i + 1`
- delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
- done
-
- $echo "creating a temporary reloadable object file: $output"
-
- # Loop through the commands generated above and execute them.
- save_ifs="$IFS"; IFS='~'
- for cmd in $concat_cmds; do
- IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
-
- libobjs=$output
- # Restore the value of output.
- output=$save_output
-
- if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- fi
- # Expand the library linking commands again to reset the
- # value of $libobjs for piecewise linking.
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- cmds=$module_expsym_cmds
- else
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- cmds=$archive_expsym_cmds
- else
- cmds=$archive_cmds
- fi
- fi
-
- # Append the command to remove the reloadable object files
- # to the just-reset $cmds.
- eval cmds=\"\$cmds~\$rm $delfiles\"
- fi
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
-
- if test -n "$convenience"; then
- if test -z "$whole_archive_flag_spec"; then
- $show "${rm}r $gentop"
- $run ${rm}r "$gentop"
- fi
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- # Create links to the real library.
- for linkname in $linknames; do
- if test "$realname" != "$linkname"; then
- $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
- $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
- fi
- done
-
- # If -module or -export-dynamic was specified, set the dlname.
- if test "$module" = yes || test "$export_dynamic" = yes; then
- # On all known operating systems, these are identical.
- dlname="$soname"
- fi
- fi
- ;;
-
- obj)
- if test -n "$deplibs"; then
- $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
- fi
-
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
- fi
-
- if test -n "$rpath"; then
- $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
- fi
-
- if test -n "$xrpath"; then
- $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
- fi
-
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
- fi
-
- case $output in
- *.lo)
- if test -n "$objs$old_deplibs"; then
- $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
- exit $EXIT_FAILURE
- fi
- libobj="$output"
- obj=`$echo "X$output" | $Xsed -e "$lo2o"`
- ;;
- *)
- libobj=
- obj="$output"
- ;;
- esac
-
- # Delete the old objects.
- $run $rm $obj $libobj
-
- # Objects from convenience libraries. This assumes
- # single-version convenience libraries. Whenever we create
- # different ones for PIC/non-PIC, this we'll have to duplicate
- # the extraction.
- reload_conv_objs=
- gentop=
- # reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec
- wl=
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec"; then
- eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
- else
- gentop="$output_objdir/${obj}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $convenience
- reload_conv_objs="$reload_objs $func_extract_archives_result"
- fi
- fi
-
- # Create the old-style object.
- reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
-
- output="$obj"
- cmds=$reload_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
-
- # Exit if we aren't doing a library object file.
- if test -z "$libobj"; then
- if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- if test "$build_libtool_libs" != yes; then
- if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
- fi
-
- # Create an invalid libtool object if no PIC, so that we don't
- # accidentally link it into a program.
- # $show "echo timestamp > $libobj"
- # $run eval "echo timestamp > $libobj" || exit $?
- exit $EXIT_SUCCESS
- fi
-
- if test -n "$pic_flag" || test "$pic_mode" != default; then
- # Only do commands if we really have different PIC objects.
- reload_objs="$libobjs $reload_conv_objs"
- output="$libobj"
- cmds=$reload_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- fi
-
- if test -n "$gentop"; then
- $show "${rm}r $gentop"
- $run ${rm}r $gentop
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- prog)
- case $host in
- *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
- esac
- if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
- fi
-
- if test -n "$release"; then
- $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
- fi
-
- if test "$preload" = yes; then
- if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
- test "$dlopen_self_static" = unknown; then
- $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
- fi
- fi
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library is the System framework
- compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
- finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
- ;;
- esac
-
- case $host in
- *darwin*)
- # Don't allow lazy linking, it breaks C++ global constructors
- if test "$tagname" = CXX ; then
- compile_command="$compile_command ${wl}-bind_at_load"
- finalize_command="$finalize_command ${wl}-bind_at_load"
- fi
- ;;
- esac
-
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $compile_deplibs " in
- *" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $compile_deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- done
- compile_deplibs="$new_libs"
-
-
- compile_command="$compile_command $compile_deplibs"
- finalize_command="$finalize_command $finalize_deplibs"
-
- if test -n "$rpath$xrpath"; then
- # If the user specified any rpath flags, then add them.
- for libdir in $rpath $xrpath; do
- # This is the magic to use -rpath.
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
- esac
- done
- fi
-
- # Now hardcode the library paths
- rpath=
- hardcode_libdirs=
- for libdir in $compile_rpath $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
- esac
- fi
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
- testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$libdir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$libdir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
- esac
- ;;
- esac
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- compile_rpath="$rpath"
-
- rpath=
- hardcode_libdirs=
- for libdir in $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$finalize_perm_rpath " in
- *" $libdir "*) ;;
- *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- finalize_rpath="$rpath"
-
- if test -n "$libobjs" && test "$build_old_libs" = yes; then
- # Transform all the library objects into standard objects.
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- fi
-
- dlsyms=
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- if test -n "$NM" && test -n "$global_symbol_pipe"; then
- dlsyms="${outputname}S.c"
- else
- $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
- fi
- fi
-
- if test -n "$dlsyms"; then
- case $dlsyms in
- "") ;;
- *.c)
- # Discover the nlist of each of the dlfiles.
- nlist="$output_objdir/${outputname}.nm"
-
- $show "$rm $nlist ${nlist}S ${nlist}T"
- $run $rm "$nlist" "${nlist}S" "${nlist}T"
-
- # Parse the name list into a source file.
- $show "creating $output_objdir/$dlsyms"
-
- test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
-/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
-/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-/* Prevent the only kind of declaration conflicts we can make. */
-#define lt_preloaded_symbols some_other_symbol
-
-/* External symbol declarations for the compiler. */\
-"
-
- if test "$dlself" = yes; then
- $show "generating symbol list for \`$output'"
-
- test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
-
- # Add our own program objects to the symbol list.
- progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- for arg in $progfiles; do
- $show "extracting global C symbols from \`$arg'"
- $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -n "$exclude_expsyms"; then
- $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
- $run eval '$mv "$nlist"T "$nlist"'
- fi
-
- if test -n "$export_symbols_regex"; then
- $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
- $run eval '$mv "$nlist"T "$nlist"'
- fi
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- export_symbols="$output_objdir/$outputname.exp"
- $run $rm $export_symbols
- $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
- case $host in
- *cygwin* | *mingw* )
- $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- else
- $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
- $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
- $run eval 'mv "$nlist"T "$nlist"'
- case $host in
- *cygwin* | *mingw* )
- $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- fi
- fi
-
- for arg in $dlprefiles; do
- $show "extracting global C symbols from \`$arg'"
- name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
- $run eval '$echo ": $name " >> "$nlist"'
- $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -z "$run"; then
- # Make sure we have at least an empty file.
- test -f "$nlist" || : > "$nlist"
-
- if test -n "$exclude_expsyms"; then
- $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
- $mv "$nlist"T "$nlist"
- fi
-
- # Try sorting and uniquifying the output.
- if grep -v "^: " < "$nlist" |
- if sort -k 3 </dev/null >/dev/null 2>&1; then
- sort -k 3
- else
- sort +2
- fi |
- uniq > "$nlist"S; then
- :
- else
- grep -v "^: " < "$nlist" > "$nlist"S
- fi
-
- if test -f "$nlist"S; then
- eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
- else
- $echo '/* NONE */' >> "$output_objdir/$dlsyms"
- fi
-
- $echo >> "$output_objdir/$dlsyms" "\
-
-#undef lt_preloaded_symbols
-
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-"
-
- case $host in
- *cygwin* | *mingw* )
- $echo >> "$output_objdir/$dlsyms" "\
-/* DATA imports from DLLs on WIN32 can't be const, because
- runtime relocations are performed -- see ld's documentation
- on pseudo-relocs */
-struct {
-"
- ;;
- * )
- $echo >> "$output_objdir/$dlsyms" "\
-const struct {
-"
- ;;
- esac
-
-
- $echo >> "$output_objdir/$dlsyms" "\
- const char *name;
- lt_ptr address;
-}
-lt_preloaded_symbols[] =
-{\
-"
-
- eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
-
- $echo >> "$output_objdir/$dlsyms" "\
- {0, (lt_ptr) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
- fi
-
- pic_flag_for_symtable=
- case $host in
- # compiling the symbol table file with pic_flag works around
- # a FreeBSD bug that causes programs to crash when -lm is
- # linked before any other PIC object. But we must not use
- # pic_flag when linking with -static. The problem exists in
- # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
- case "$compile_command " in
- *" -static "*) ;;
- *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
- esac;;
- *-*-hpux*)
- case "$compile_command " in
- *" -static "*) ;;
- *) pic_flag_for_symtable=" $pic_flag";;
- esac
- esac
-
- # Now compile the dynamic symbol file.
- $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
- $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
-
- # Clean up the generated files.
- $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
- $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
-
- # Transform the symbol file into the correct name.
- case $host in
- *cygwin* | *mingw* )
- if test -f "$output_objdir/${outputname}.def" ; then
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
- else
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- fi
- ;;
- * )
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- ;;
- esac
- ;;
- *)
- $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- else
- # We keep going just in case the user didn't refer to
- # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
- # really was required.
-
- # Nullify the symbol file.
- compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
- fi
-
- if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
- # Replace the output file specification.
- compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
- link_command="$compile_command$compile_rpath"
-
- # We have no uninstalled library dependencies, so finalize right now.
- $show "$link_command"
- $run eval "$link_command"
- exit_status=$?
-
- # Delete the generated files.
- if test -n "$dlsyms"; then
- $show "$rm $output_objdir/${outputname}S.${objext}"
- $run $rm "$output_objdir/${outputname}S.${objext}"
- fi
-
- exit $exit_status
- fi
-
- if test -n "$shlibpath_var"; then
- # We should set the shlibpath_var
- rpath=
- for dir in $temp_rpath; do
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*)
- # Absolute path.
- rpath="$rpath$dir:"
- ;;
- *)
- # Relative path: add a thisdir entry.
- rpath="$rpath\$thisdir/$dir:"
- ;;
- esac
- done
- temp_rpath="$rpath"
- fi
-
- if test -n "$compile_shlibpath$finalize_shlibpath"; then
- compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
- fi
- if test -n "$finalize_shlibpath"; then
- finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
- fi
-
- compile_var=
- finalize_var=
- if test -n "$runpath_var"; then
- if test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- rpath="$rpath$dir:"
- done
- compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- if test -n "$finalize_perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $finalize_perm_rpath; do
- rpath="$rpath$dir:"
- done
- finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- fi
-
- if test "$no_install" = yes; then
- # We don't need to create a wrapper script.
- link_command="$compile_var$compile_command$compile_rpath"
- # Replace the output file specification.
- link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
- # Delete the old output file.
- $run $rm $output
- # Link the executable and exit
- $show "$link_command"
- $run eval "$link_command" || exit $?
- exit $EXIT_SUCCESS
- fi
-
- if test "$hardcode_action" = relink; then
- # Fast installation is not supported
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
-
- $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
- $echo "$modename: \`$output' will be relinked during installation" 1>&2
- else
- if test "$fast_install" != no; then
- link_command="$finalize_var$compile_command$finalize_rpath"
- if test "$fast_install" = yes; then
- relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
- else
- # fast_install is set to needless
- relink_command=
- fi
- else
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
- fi
- fi
-
- # Replace the output file specification.
- link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
- # Delete the old output files.
- $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
- $show "$link_command"
- $run eval "$link_command" || exit $?
-
- # Now create the wrapper script.
- $show "creating $output"
-
- # Quote the relink command for shipping.
- if test -n "$relink_command"; then
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
- relink_command="$var=\"$var_value\"; export $var; $relink_command"
- fi
- done
- relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
- fi
-
- # Quote $echo for shipping.
- if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
- case $progpath in
- [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
- *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
- esac
- qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
- else
- qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
- fi
-
- # Only actually do things if our run command is non-null.
- if test -z "$run"; then
- # win32 will think the script is a binary if it has
- # a .exe suffix, so we strip it off here.
- case $output in
- *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
- esac
- # test for cygwin because mv fails w/o .exe extensions
- case $host in
- *cygwin*)
- exeext=.exe
- outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
- *) exeext= ;;
- esac
- case $host in
- *cygwin* | *mingw* )
- output_name=`basename $output`
- output_path=`dirname $output`
- cwrappersource="$output_path/$objdir/lt-$output_name.c"
- cwrapper="$output_path/$output_name.exe"
- $rm $cwrappersource $cwrapper
- trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
- cat > $cwrappersource <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-
- The $output program cannot be directly executed until all the libtool
- libraries that it depends on are installed.
-
- This wrapper executable should never be moved out of the build directory.
- If it is, it will not operate correctly.
-
- Currently, it simply execs the wrapper *script* "/bin/sh $output",
- but could eventually absorb all of the scripts functionality and
- exec $objdir/$outputname directly.
-*/
-EOF
- cat >> $cwrappersource<<"EOF"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/stat.h>
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# ifndef DIR_SEPARATOR_2
-# define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-# define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
- if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-/* -DDEBUG is fairly common in CFLAGS. */
-#undef DEBUG
-#if defined DEBUGWRAPPER
-# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
-#else
-# define DEBUG(format, ...)
-#endif
-
-const char *program_name = NULL;
-
-void * xmalloc (size_t num);
-char * xstrdup (const char *string);
-const char * base_name (const char *name);
-char * find_executable(const char *wrapper);
-int check_executable(const char *path);
-char * strendzap(char *str, const char *pat);
-void lt_fatal (const char *message, ...);
-
-int
-main (int argc, char *argv[])
-{
- char **newargz;
- int i;
-
- program_name = (char *) xstrdup (base_name (argv[0]));
- DEBUG("(main) argv[0] : %s\n",argv[0]);
- DEBUG("(main) program_name : %s\n",program_name);
- newargz = XMALLOC(char *, argc+2);
-EOF
-
- cat >> $cwrappersource <<EOF
- newargz[0] = (char *) xstrdup("$SHELL");
-EOF
-
- cat >> $cwrappersource <<"EOF"
- newargz[1] = find_executable(argv[0]);
- if (newargz[1] == NULL)
- lt_fatal("Couldn't find %s", argv[0]);
- DEBUG("(main) found exe at : %s\n",newargz[1]);
- /* we know the script has the same name, without the .exe */
- /* so make sure newargz[1] doesn't end in .exe */
- strendzap(newargz[1],".exe");
- for (i = 1; i < argc; i++)
- newargz[i+1] = xstrdup(argv[i]);
- newargz[argc+1] = NULL;
-
- for (i=0; i<argc+1; i++)
- {
- DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
- ;
- }
-
-EOF
-
- case $host_os in
- mingw*)
- cat >> $cwrappersource <<EOF
- execv("$SHELL",(char const **)newargz);
-EOF
- ;;
- *)
- cat >> $cwrappersource <<EOF
- execv("$SHELL",newargz);
-EOF
- ;;
- esac
-
- cat >> $cwrappersource <<"EOF"
- return 127;
-}
-
-void *
-xmalloc (size_t num)
-{
- void * p = (void *) malloc (num);
- if (!p)
- lt_fatal ("Memory exhausted");
-
- return p;
-}
-
-char *
-xstrdup (const char *string)
-{
- return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
-;
-}
-
-const char *
-base_name (const char *name)
-{
- const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- /* Skip over the disk name in MSDOS pathnames. */
- if (isalpha ((unsigned char)name[0]) && name[1] == ':')
- name += 2;
-#endif
-
- for (base = name; *name; name++)
- if (IS_DIR_SEPARATOR (*name))
- base = name + 1;
- return base;
-}
-
-int
-check_executable(const char * path)
-{
- struct stat st;
-
- DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
- if ((!path) || (!*path))
- return 0;
-
- if ((stat (path, &st) >= 0) &&
- (
- /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
-#if defined (S_IXOTH)
- ((st.st_mode & S_IXOTH) == S_IXOTH) ||
-#endif
-#if defined (S_IXGRP)
- ((st.st_mode & S_IXGRP) == S_IXGRP) ||
-#endif
- ((st.st_mode & S_IXUSR) == S_IXUSR))
- )
- return 1;
- else
- return 0;
-}
-
-/* Searches for the full path of the wrapper. Returns
- newly allocated full path name if found, NULL otherwise */
-char *
-find_executable (const char* wrapper)
-{
- int has_slash = 0;
- const char* p;
- const char* p_next;
- /* static buffer for getcwd */
- char tmp[LT_PATHMAX + 1];
- int tmp_len;
- char* concat_name;
-
- DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
-
- if ((wrapper == NULL) || (*wrapper == '\0'))
- return NULL;
-
- /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
- {
- concat_name = xstrdup (wrapper);
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- }
- else
- {
-#endif
- if (IS_DIR_SEPARATOR (wrapper[0]))
- {
- concat_name = xstrdup (wrapper);
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- }
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- }
-#endif
-
- for (p = wrapper; *p; p++)
- if (*p == '/')
- {
- has_slash = 1;
- break;
- }
- if (!has_slash)
- {
- /* no slashes; search PATH */
- const char* path = getenv ("PATH");
- if (path != NULL)
- {
- for (p = path; *p; p = p_next)
- {
- const char* q;
- size_t p_len;
- for (q = p; *q; q++)
- if (IS_PATH_SEPARATOR(*q))
- break;
- p_len = q - p;
- p_next = (*q == '\0' ? q : q + 1);
- if (p_len == 0)
- {
- /* empty path: current directory */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal ("getcwd failed");
- tmp_len = strlen(tmp);
- concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
- }
- else
- {
- concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
- memcpy (concat_name, p, p_len);
- concat_name[p_len] = '/';
- strcpy (concat_name + p_len + 1, wrapper);
- }
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- }
- }
- /* not found in PATH; assume curdir */
- }
- /* Relative path | not found in path: prepend cwd */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal ("getcwd failed");
- tmp_len = strlen(tmp);
- concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
-
- if (check_executable(concat_name))
- return concat_name;
- XFREE(concat_name);
- return NULL;
-}
-
-char *
-strendzap(char *str, const char *pat)
-{
- size_t len, patlen;
-
- assert(str != NULL);
- assert(pat != NULL);
-
- len = strlen(str);
- patlen = strlen(pat);
-
- if (patlen <= len)
- {
- str += len - patlen;
- if (strcmp(str, pat) == 0)
- *str = '\0';
- }
- return str;
-}
-
-static void
-lt_error_core (int exit_status, const char * mode,
- const char * message, va_list ap)
-{
- fprintf (stderr, "%s: %s: ", program_name, mode);
- vfprintf (stderr, message, ap);
- fprintf (stderr, ".\n");
-
- if (exit_status >= 0)
- exit (exit_status);
-}
-
-void
-lt_fatal (const char *message, ...)
-{
- va_list ap;
- va_start (ap, message);
- lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
- va_end (ap);
-}
-EOF
- # we should really use a build-platform specific compiler
- # here, but OTOH, the wrappers (shell script and this C one)
- # are only useful if you want to execute the "real" binary.
- # Since the "real" binary is built for $host, then this
- # wrapper might as well be built for $host, too.
- $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
- ;;
- esac
- $rm $output
- trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
-
- $echo > $output "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
-sed_quote_subst='$sed_quote_subst'
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
- # install mode needs the following variable:
- notinst_deplibs='$notinst_deplibs'
-else
- # When we are sourced in execute mode, \$file and \$echo are already set.
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- echo=\"$qecho\"
- file=\"\$0\"
- # Make sure echo works.
- if test \"X\$1\" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
- elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
- # Yippee, \$echo works!
- :
- else
- # Restart under the correct shell, and then maybe \$echo will work.
- exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
- fi
- fi\
-"
- $echo >> $output "\
-
- # Find the directory that this script lives in.
- thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
- test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
- # Follow symbolic links until we get to the real thisdir.
- file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
- while test -n \"\$file\"; do
- destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
-
- # If there was a directory component, then change thisdir.
- if test \"x\$destdir\" != \"x\$file\"; then
- case \"\$destdir\" in
- [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
- *) thisdir=\"\$thisdir/\$destdir\" ;;
- esac
- fi
-
- file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
- file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
- done
-
- # Try to get the absolute directory name.
- absdir=\`cd \"\$thisdir\" && pwd\`
- test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
- if test "$fast_install" = yes; then
- $echo >> $output "\
- program=lt-'$outputname'$exeext
- progdir=\"\$thisdir/$objdir\"
-
- if test ! -f \"\$progdir/\$program\" || \\
- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
- test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
- file=\"\$\$-\$program\"
-
- if test ! -d \"\$progdir\"; then
- $mkdir \"\$progdir\"
- else
- $rm \"\$progdir/\$file\"
- fi"
-
- $echo >> $output "\
-
- # relink executable if necessary
- if test -n \"\$relink_command\"; then
- if relink_command_output=\`eval \$relink_command 2>&1\`; then :
- else
- $echo \"\$relink_command_output\" >&2
- $rm \"\$progdir/\$file\"
- exit $EXIT_FAILURE
- fi
- fi
-
- $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
- { $rm \"\$progdir/\$program\";
- $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
- $rm \"\$progdir/\$file\"
- fi"
- else
- $echo >> $output "\
- program='$outputname'
- progdir=\"\$thisdir/$objdir\"
-"
- fi
-
- $echo >> $output "\
-
- if test -f \"\$progdir/\$program\"; then"
-
- # Export our shlibpath_var if we have one.
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- $echo >> $output "\
- # Add our own library path to $shlibpath_var
- $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
- # Some systems cannot cope with colon-terminated $shlibpath_var
- # The second colon is a workaround for a bug in BeOS R4 sed
- $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
-
- export $shlibpath_var
-"
- fi
-
- # fixup the dll searchpath if we need to.
- if test -n "$dllsearchpath"; then
- $echo >> $output "\
- # Add the dll search path components to the executable PATH
- PATH=$dllsearchpath:\$PATH
-"
- fi
-
- $echo >> $output "\
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- # Run the actual program with our arguments.
-"
- case $host in
- # Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2*)
- $echo >> $output "\
- exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
- ;;
-
- *)
- $echo >> $output "\
- exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
- ;;
- esac
- $echo >> $output "\
- \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
- exit $EXIT_FAILURE
- fi
- else
- # The program doesn't exist.
- \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
- \$echo \"This script is just a wrapper for \$program.\" 1>&2
- $echo \"See the $PACKAGE documentation for more information.\" 1>&2
- exit $EXIT_FAILURE
- fi
-fi\
-"
- chmod +x $output
- fi
- exit $EXIT_SUCCESS
- ;;
- esac
-
- # See if we need to build an old-fashioned archive.
- for oldlib in $oldlibs; do
-
- if test "$build_libtool_libs" = convenience; then
- oldobjs="$libobjs_save"
- addlibs="$convenience"
- build_libtool_libs=no
- else
- if test "$build_libtool_libs" = module; then
- oldobjs="$libobjs_save"
- build_libtool_libs=no
- else
- oldobjs="$old_deplibs $non_pic_objects"
- fi
- addlibs="$old_convenience"
- fi
-
- if test -n "$addlibs"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $addlibs
- oldobjs="$oldobjs $func_extract_archives_result"
- fi
-
- # Do each command in the archive commands.
- if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
- cmds=$old_archive_from_new_cmds
- else
- # POSIX demands no paths to be encoded in archives. We have
- # to avoid creating archives with duplicate basenames if we
- # might have to extract them afterwards, e.g., when creating a
- # static archive out of a convenience library, or when linking
- # the entirety of a libtool archive into another (currently
- # not supported by libtool).
- if (for obj in $oldobjs
- do
- $echo "X$obj" | $Xsed -e 's%^.*/%%'
- done | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- $echo "copying selected object files to avoid basename conflicts..."
-
- if test -z "$gentop"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- $show "${rm}r $gentop"
- $run ${rm}r "$gentop"
- $show "$mkdir $gentop"
- $run $mkdir "$gentop"
- exit_status=$?
- if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
- exit $exit_status
- fi
- fi
-
- save_oldobjs=$oldobjs
- oldobjs=
- counter=1
- for obj in $save_oldobjs
- do
- objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
- case " $oldobjs " in
- " ") oldobjs=$obj ;;
- *[\ /]"$objbase "*)
- while :; do
- # Make sure we don't pick an alternate name that also
- # overlaps.
- newobj=lt$counter-$objbase
- counter=`expr $counter + 1`
- case " $oldobjs " in
- *[\ /]"$newobj "*) ;;
- *) if test ! -f "$gentop/$newobj"; then break; fi ;;
- esac
- done
- $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
- $run ln "$obj" "$gentop/$newobj" ||
- $run cp "$obj" "$gentop/$newobj"
- oldobjs="$oldobjs $gentop/$newobj"
- ;;
- *) oldobjs="$oldobjs $obj" ;;
- esac
- done
- fi
-
- eval cmds=\"$old_archive_cmds\"
-
- if len=`expr "X$cmds" : ".*"` &&
- test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- cmds=$old_archive_cmds
- else
- # the command line is too long to link in one step, link in parts
- $echo "using piecewise archive linking..."
- save_RANLIB=$RANLIB
- RANLIB=:
- objlist=
- concat_cmds=
- save_oldobjs=$oldobjs
-
- # Is there a better way of finding the last object in the list?
- for obj in $save_oldobjs
- do
- last_oldobj=$obj
- done
- for obj in $save_oldobjs
- do
- oldobjs="$objlist $obj"
- objlist="$objlist $obj"
- eval test_cmds=\"$old_archive_cmds\"
- if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
- test "$len" -le "$max_cmd_len"; then
- :
- else
- # the above command should be used before it gets too long
- oldobjs=$objlist
- if test "$obj" = "$last_oldobj" ; then
- RANLIB=$save_RANLIB
- fi
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
- objlist=
- fi
- done
- RANLIB=$save_RANLIB
- oldobjs=$objlist
- if test "X$oldobjs" = "X" ; then
- eval cmds=\"\$concat_cmds\"
- else
- eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
- fi
- fi
- fi
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- eval cmd=\"$cmd\"
- IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- done
-
- if test -n "$generated"; then
- $show "${rm}r$generated"
- $run ${rm}r$generated
- fi
-
- # Now create the libtool archive.
- case $output in
- *.la)
- old_library=
- test "$build_old_libs" = yes && old_library="$libname.$libext"
- $show "creating $output"
-
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
- relink_command="$var=\"$var_value\"; export $var; $relink_command"
- fi
- done
- # Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
- if test "$hardcode_automatic" = yes ; then
- relink_command=
- fi
-
-
- # Only create the output if not a dry run.
- if test -z "$run"; then
- for installed in no yes; do
- if test "$installed" = yes; then
- if test -z "$install_libdir"; then
- break
- fi
- output="$output_objdir/$outputname"i
- # Replace all uninstalled libtool libraries with the installed ones
- newdependency_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- *.la)
- name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- if test -z "$libdir"; then
- $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- newdependency_libs="$newdependency_libs $libdir/$name"
- ;;
- *) newdependency_libs="$newdependency_libs $deplib" ;;
- esac
- done
- dependency_libs="$newdependency_libs"
- newdlfiles=
- for lib in $dlfiles; do
- name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- if test -z "$libdir"; then
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- newdlfiles="$newdlfiles $libdir/$name"
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- if test -z "$libdir"; then
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- exit $EXIT_FAILURE
- fi
- newdlprefiles="$newdlprefiles $libdir/$name"
- done
- dlprefiles="$newdlprefiles"
- else
- newdlfiles=
- for lib in $dlfiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- newdlfiles="$newdlfiles $abs"
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- newdlprefiles="$newdlprefiles $abs"
- done
- dlprefiles="$newdlprefiles"
- fi
- $rm $output
- # place dlname in correct position for cygwin
- tdlname=$dlname
- case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- esac
- $echo > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
- if test "$installed" = no && test "$need_relink" = yes; then
- $echo >> $output "\
-relink_command=\"$relink_command\""
- fi
- done
- fi
-
- # Do a symbolic link so that the libtool archive can be found in
- # LD_LIBRARY_PATH before the program is installed.
- $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
- $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
- ;;
- esac
- exit $EXIT_SUCCESS
- ;;
-
- # libtool install mode
- install)
- modename="$modename: install"
-
- # There may be an optional sh(1) argument at the beginning of
- # install_prog (especially on Windows NT).
- if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
- # Allow the use of GNU shtool's install command.
- $echo "X$nonopt" | grep shtool > /dev/null; then
- # Aesthetically quote it.
- arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- install_prog="$arg "
- arg="$1"
- shift
- else
- install_prog=
- arg=$nonopt
- fi
-
- # The real first argument should be the name of the installation program.
- # Aesthetically quote it.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- install_prog="$install_prog$arg"
-
- # We need to accept at least all the BSD install flags.
- dest=
- files=
- opts=
- prev=
- install_type=
- isdir=no
- stripme=
- for arg
- do
- if test -n "$dest"; then
- files="$files $dest"
- dest=$arg
- continue
- fi
-
- case $arg in
- -d) isdir=yes ;;
- -f)
- case " $install_prog " in
- *[\\\ /]cp\ *) ;;
- *) prev=$arg ;;
- esac
- ;;
- -g | -m | -o) prev=$arg ;;
- -s)
- stripme=" -s"
- continue
- ;;
- -*)
- ;;
- *)
- # If the previous option needed an argument, then skip it.
- if test -n "$prev"; then
- prev=
- else
- dest=$arg
- continue
- fi
- ;;
- esac
-
- # Aesthetically quote the argument.
- arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- install_prog="$install_prog $arg"
- done
-
- if test -z "$install_prog"; then
- $echo "$modename: you must specify an install program" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test -n "$prev"; then
- $echo "$modename: the \`$prev' option requires an argument" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test -z "$files"; then
- if test -z "$dest"; then
- $echo "$modename: no file or destination specified" 1>&2
- else
- $echo "$modename: you must specify a destination" 1>&2
- fi
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Strip any trailing slash from the destination.
- dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
-
- # Check to see that the destination is a directory.
- test -d "$dest" && isdir=yes
- if test "$isdir" = yes; then
- destdir="$dest"
- destname=
- else
- destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
- test "X$destdir" = "X$dest" && destdir=.
- destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
-
- # Not a directory, so check to see that there is only one file specified.
- set dummy $files
- if test "$#" -gt 2; then
- $echo "$modename: \`$dest' is not a directory" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
- fi
- case $destdir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- for file in $files; do
- case $file in
- *.lo) ;;
- *)
- $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
- done
- ;;
- esac
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- staticlibs=
- future_libdirs=
- current_libdirs=
- for file in $files; do
-
- # Do each installation.
- case $file in
- *.$libext)
- # Do the static libraries later.
- staticlibs="$staticlibs $file"
- ;;
-
- *.la)
- # Check to see that this really is a libtool archive.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
- else
- $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- library_names=
- old_library=
- relink_command=
- # If there is no directory component, then add one.
- case $file in
- */* | *\\*) . $file ;;
- *) . ./$file ;;
- esac
-
- # Add the libdir to current_libdirs if it is the destination.
- if test "X$destdir" = "X$libdir"; then
- case "$current_libdirs " in
- *" $libdir "*) ;;
- *) current_libdirs="$current_libdirs $libdir" ;;
- esac
- else
- # Note the libdir as a future libdir.
- case "$future_libdirs " in
- *" $libdir "*) ;;
- *) future_libdirs="$future_libdirs $libdir" ;;
- esac
- fi
-
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
- test "X$dir" = "X$file/" && dir=
- dir="$dir$objdir"
-
- if test -n "$relink_command"; then
- # Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
-
- # Don't allow the user to place us outside of our expected
- # location b/c this prevents finding dependent libraries that
- # are installed to the same prefix.
- # At present, this check doesn't affect windows .dll's that
- # are installed into $libdir/../bin (currently, that works fine)
- # but it's something to keep an eye on.
- if test "$inst_prefix_dir" = "$destdir"; then
- $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
- exit $EXIT_FAILURE
- fi
-
- if test -n "$inst_prefix_dir"; then
- # Stick the inst_prefix_dir data into the link command.
- relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
- else
- relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
- fi
-
- $echo "$modename: warning: relinking \`$file'" 1>&2
- $show "$relink_command"
- if $run eval "$relink_command"; then :
- else
- $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
- exit $EXIT_FAILURE
- fi
- fi
-
- # See the names of the shared library.
- set dummy $library_names
- if test -n "$2"; then
- realname="$2"
- shift
- shift
-
- srcname="$realname"
- test -n "$relink_command" && srcname="$realname"T
-
- # Install the shared library and build the symlinks.
- $show "$install_prog $dir/$srcname $destdir/$realname"
- $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
- if test -n "$stripme" && test -n "$striplib"; then
- $show "$striplib $destdir/$realname"
- $run eval "$striplib $destdir/$realname" || exit $?
- fi
-
- if test "$#" -gt 0; then
- # Delete the old symlinks, and create new ones.
- # Try `ln -sf' first, because the `ln' binary might depend on
- # the symlink we replace! Solaris /bin/ln does not understand -f,
- # so we also need to try rm && ln -s.
- for linkname
- do
- if test "$linkname" != "$realname"; then
- $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
- $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
- fi
- done
- fi
-
- # Do each command in the postinstall commands.
- lib="$destdir/$realname"
- cmds=$postinstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
- fi
-
- # Install the pseudo-library for information purposes.
- name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- instname="$dir/$name"i
- $show "$install_prog $instname $destdir/$name"
- $run eval "$install_prog $instname $destdir/$name" || exit $?
-
- # Maybe install the static library, too.
- test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
- ;;
-
- *.lo)
- # Install (i.e. copy) a libtool object.
-
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- destfile="$destdir/$destfile"
- fi
-
- # Deduce the name of the destination old-style object file.
- case $destfile in
- *.lo)
- staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
- ;;
- *.$objext)
- staticdest="$destfile"
- destfile=
- ;;
- *)
- $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- # Install the libtool object if requested.
- if test -n "$destfile"; then
- $show "$install_prog $file $destfile"
- $run eval "$install_prog $file $destfile" || exit $?
- fi
-
- # Install the old object if enabled.
- if test "$build_old_libs" = yes; then
- # Deduce the name of the old-style object file.
- staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
-
- $show "$install_prog $staticobj $staticdest"
- $run eval "$install_prog \$staticobj \$staticdest" || exit $?
- fi
- exit $EXIT_SUCCESS
- ;;
-
- *)
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- destfile="$destdir/$destfile"
- fi
-
- # If the file is missing, and there is a .exe on the end, strip it
- # because it is most likely a libtool script we actually want to
- # install
- stripped_ext=""
- case $file in
- *.exe)
- if test ! -f "$file"; then
- file=`$echo $file|${SED} 's,.exe$,,'`
- stripped_ext=".exe"
- fi
- ;;
- esac
-
- # Do a test to see if this is really a libtool program.
- case $host in
- *cygwin*|*mingw*)
- wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
- ;;
- *)
- wrapper=$file
- ;;
- esac
- if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
- notinst_deplibs=
- relink_command=
-
- # Note that it is not necessary on cygwin/mingw to append a dot to
- # foo even if both foo and FILE.exe exist: automatic-append-.exe
- # behavior happens only for exec(3), not for open(2)! Also, sourcing
- # `FILE.' does not work on cygwin managed mounts.
- #
- # If there is no directory component, then add one.
- case $wrapper in
- */* | *\\*) . ${wrapper} ;;
- *) . ./${wrapper} ;;
- esac
-
- # Check the variables that should have been set.
- if test -z "$notinst_deplibs"; then
- $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
- exit $EXIT_FAILURE
- fi
-
- finalize=yes
- for lib in $notinst_deplibs; do
- # Check to see that each library is installed.
- libdir=
- if test -f "$lib"; then
- # If there is no directory component, then add one.
- case $lib in
- */* | *\\*) . $lib ;;
- *) . ./$lib ;;
- esac
- fi
- libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
- if test -n "$libdir" && test ! -f "$libfile"; then
- $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
- finalize=no
- fi
- done
-
- relink_command=
- # Note that it is not necessary on cygwin/mingw to append a dot to
- # foo even if both foo and FILE.exe exist: automatic-append-.exe
- # behavior happens only for exec(3), not for open(2)! Also, sourcing
- # `FILE.' does not work on cygwin managed mounts.
- #
- # If there is no directory component, then add one.
- case $wrapper in
- */* | *\\*) . ${wrapper} ;;
- *) . ./${wrapper} ;;
- esac
-
- outputname=
- if test "$fast_install" = no && test -n "$relink_command"; then
- if test "$finalize" = yes && test -z "$run"; then
- tmpdir=`func_mktempdir`
- file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
- outputname="$tmpdir/$file"
- # Replace the output file specification.
- relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
-
- $show "$relink_command"
- if $run eval "$relink_command"; then :
- else
- $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
- ${rm}r "$tmpdir"
- continue
- fi
- file="$outputname"
- else
- $echo "$modename: warning: cannot relink \`$file'" 1>&2
- fi
- else
- # Install the binary that we compiled earlier.
- file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
- fi
- fi
-
- # remove .exe since cygwin /usr/bin/install will append another
- # one anyway
- case $install_prog,$host in
- */usr/bin/install*,*cygwin*)
- case $file:$destfile in
- *.exe:*.exe)
- # this is ok
- ;;
- *.exe:*)
- destfile=$destfile.exe
- ;;
- *:*.exe)
- destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
- ;;
- esac
- ;;
- esac
- $show "$install_prog$stripme $file $destfile"
- $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
- test -n "$outputname" && ${rm}r "$tmpdir"
- ;;
- esac
- done
-
- for file in $staticlibs; do
- name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
-
- # Set up the ranlib parameters.
- oldlib="$destdir/$name"
-
- $show "$install_prog $file $oldlib"
- $run eval "$install_prog \$file \$oldlib" || exit $?
-
- if test -n "$stripme" && test -n "$old_striplib"; then
- $show "$old_striplib $oldlib"
- $run eval "$old_striplib $oldlib" || exit $?
- fi
-
- # Do each command in the postinstall commands.
- cmds=$old_postinstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || exit $?
- done
- IFS="$save_ifs"
- done
-
- if test -n "$future_libdirs"; then
- $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
- fi
-
- if test -n "$current_libdirs"; then
- # Maybe just do a dry run.
- test -n "$run" && current_libdirs=" -n$current_libdirs"
- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
- else
- exit $EXIT_SUCCESS
- fi
- ;;
-
- # libtool finish mode
- finish)
- modename="$modename: finish"
- libdirs="$nonopt"
- admincmds=
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- for dir
- do
- libdirs="$libdirs $dir"
- done
-
- for libdir in $libdirs; do
- if test -n "$finish_cmds"; then
- # Do each command in the finish commands.
- cmds=$finish_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd" || admincmds="$admincmds
- $cmd"
- done
- IFS="$save_ifs"
- fi
- if test -n "$finish_eval"; then
- # Do the single finish_eval.
- eval cmds=\"$finish_eval\"
- $run eval "$cmds" || admincmds="$admincmds
- $cmds"
- fi
- done
- fi
-
- # Exit here if they wanted silent mode.
- test "$show" = : && exit $EXIT_SUCCESS
-
- $echo "X----------------------------------------------------------------------" | $Xsed
- $echo "Libraries have been installed in:"
- for libdir in $libdirs; do
- $echo " $libdir"
- done
- $echo
- $echo "If you ever happen to want to link against installed libraries"
- $echo "in a given directory, LIBDIR, you must either use libtool, and"
- $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
- $echo "flag during linking and do at least one of the following:"
- if test -n "$shlibpath_var"; then
- $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
- $echo " during execution"
- fi
- if test -n "$runpath_var"; then
- $echo " - add LIBDIR to the \`$runpath_var' environment variable"
- $echo " during linking"
- fi
- if test -n "$hardcode_libdir_flag_spec"; then
- libdir=LIBDIR
- eval flag=\"$hardcode_libdir_flag_spec\"
-
- $echo " - use the \`$flag' linker flag"
- fi
- if test -n "$admincmds"; then
- $echo " - have your system administrator run these commands:$admincmds"
- fi
- if test -f /etc/ld.so.conf; then
- $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
- fi
- $echo
- $echo "See any operating system documentation about shared libraries for"
- $echo "more information, such as the ld(1) and ld.so(8) manual pages."
- $echo "X----------------------------------------------------------------------" | $Xsed
- exit $EXIT_SUCCESS
- ;;
-
- # libtool execute mode
- execute)
- modename="$modename: execute"
-
- # The first argument is the command name.
- cmd="$nonopt"
- if test -z "$cmd"; then
- $echo "$modename: you must specify a COMMAND" 1>&2
- $echo "$help"
- exit $EXIT_FAILURE
- fi
-
- # Handle -dlopen flags immediately.
- for file in $execute_dlfiles; do
- if test ! -f "$file"; then
- $echo "$modename: \`$file' is not a file" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- dir=
- case $file in
- *.la)
- # Check to see that this really is a libtool archive.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
- else
- $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Read the libtool library.
- dlname=
- library_names=
-
- # If there is no directory component, then add one.
- case $file in
- */* | *\\*) . $file ;;
- *) . ./$file ;;
- esac
-
- # Skip this library if it cannot be dlopened.
- if test -z "$dlname"; then
- # Warn if it was a shared library.
- test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
- continue
- fi
-
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- test "X$dir" = "X$file" && dir=.
-
- if test -f "$dir/$objdir/$dlname"; then
- dir="$dir/$objdir"
- else
- $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
- exit $EXIT_FAILURE
- fi
- ;;
-
- *.lo)
- # Just add the directory containing the .lo file.
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- test "X$dir" = "X$file" && dir=.
- ;;
-
- *)
- $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
- continue
- ;;
- esac
-
- # Get the absolute pathname.
- absdir=`cd "$dir" && pwd`
- test -n "$absdir" && dir="$absdir"
-
- # Now add the directory to shlibpath_var.
- if eval "test -z \"\$$shlibpath_var\""; then
- eval "$shlibpath_var=\"\$dir\""
- else
- eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
- fi
- done
-
- # This variable tells wrapper scripts just to set shlibpath_var
- # rather than running their programs.
- libtool_execute_magic="$magic"
-
- # Check if any of the arguments is a wrapper script.
- args=
- for file
- do
- case $file in
- -*) ;;
- *)
- # Do a test to see if this is really a libtool program.
- if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- # If there is no directory component, then add one.
- case $file in
- */* | *\\*) . $file ;;
- *) . ./$file ;;
- esac
-
- # Transform arg to wrapped name.
- file="$progdir/$program"
- fi
- ;;
- esac
- # Quote arguments (to preserve shell metacharacters).
- file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
- args="$args \"$file\""
- done
-
- if test -z "$run"; then
- if test -n "$shlibpath_var"; then
- # Export the shlibpath_var.
- eval "export $shlibpath_var"
- fi
-
- # Restore saved environment variables
- if test "${save_LC_ALL+set}" = set; then
- LC_ALL="$save_LC_ALL"; export LC_ALL
- fi
- if test "${save_LANG+set}" = set; then
- LANG="$save_LANG"; export LANG
- fi
-
- # Now prepare to actually exec the command.
- exec_cmd="\$cmd$args"
- else
- # Display what would be done.
- if test -n "$shlibpath_var"; then
- eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
- $echo "export $shlibpath_var"
- fi
- $echo "$cmd$args"
- exit $EXIT_SUCCESS
- fi
- ;;
-
- # libtool clean and uninstall mode
- clean | uninstall)
- modename="$modename: $mode"
- rm="$nonopt"
- files=
- rmforce=
- exit_status=0
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- for arg
- do
- case $arg in
- -f) rm="$rm $arg"; rmforce=yes ;;
- -*) rm="$rm $arg" ;;
- *) files="$files $arg" ;;
- esac
- done
-
- if test -z "$rm"; then
- $echo "$modename: you must specify an RM program" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- rmdirs=
-
- origobjdir="$objdir"
- for file in $files; do
- dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$dir" = "X$file"; then
- dir=.
- objdir="$origobjdir"
- else
- objdir="$dir/$origobjdir"
- fi
- name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- test "$mode" = uninstall && objdir="$dir"
-
- # Remember objdir for removal later, being careful to avoid duplicates
- if test "$mode" = clean; then
- case " $rmdirs " in
- *" $objdir "*) ;;
- *) rmdirs="$rmdirs $objdir" ;;
- esac
- fi
-
- # Don't error if the file doesn't exist and rm -f was used.
- if (test -L "$file") >/dev/null 2>&1 \
- || (test -h "$file") >/dev/null 2>&1 \
- || test -f "$file"; then
- :
- elif test -d "$file"; then
- exit_status=1
- continue
- elif test "$rmforce" = yes; then
- continue
- fi
-
- rmfiles="$file"
-
- case $name in
- *.la)
- # Possibly a libtool archive, so verify it.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- . $dir/$name
-
- # Delete the libtool libraries and symlinks.
- for n in $library_names; do
- rmfiles="$rmfiles $objdir/$n"
- done
- test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-
- case "$mode" in
- clean)
- case " $library_names " in
- # " " in the beginning catches empty $dlname
- *" $dlname "*) ;;
- *) rmfiles="$rmfiles $objdir/$dlname" ;;
- esac
- test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
- ;;
- uninstall)
- if test -n "$library_names"; then
- # Do each command in the postuninstall commands.
- cmds=$postuninstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd"
- if test "$?" -ne 0 && test "$rmforce" != yes; then
- exit_status=1
- fi
- done
- IFS="$save_ifs"
- fi
-
- if test -n "$old_library"; then
- # Do each command in the old_postuninstall commands.
- cmds=$old_postuninstall_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $show "$cmd"
- $run eval "$cmd"
- if test "$?" -ne 0 && test "$rmforce" != yes; then
- exit_status=1
- fi
- done
- IFS="$save_ifs"
- fi
- # FIXME: should reinstall the best remaining shared library.
- ;;
- esac
- fi
- ;;
-
- *.lo)
- # Possibly a libtool object, so verify it.
- if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
-
- # Read the .lo file
- . $dir/$name
-
- # Add PIC object to the list of files to remove.
- if test -n "$pic_object" \
- && test "$pic_object" != none; then
- rmfiles="$rmfiles $dir/$pic_object"
- fi
-
- # Add non-PIC object to the list of files to remove.
- if test -n "$non_pic_object" \
- && test "$non_pic_object" != none; then
- rmfiles="$rmfiles $dir/$non_pic_object"
- fi
- fi
- ;;
-
- *)
- if test "$mode" = clean ; then
- noexename=$name
- case $file in
- *.exe)
- file=`$echo $file|${SED} 's,.exe$,,'`
- noexename=`$echo $name|${SED} 's,.exe$,,'`
- # $file with .exe has already been added to rmfiles,
- # add $file without .exe
- rmfiles="$rmfiles $file"
- ;;
- esac
- # Do a test to see if this is a libtool program.
- if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- relink_command=
- . $dir/$noexename
-
- # note $name still contains .exe if it was in $file originally
- # as does the version of $file that was added into $rmfiles
- rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
- if test "$fast_install" = yes && test -n "$relink_command"; then
- rmfiles="$rmfiles $objdir/lt-$name"
- fi
- if test "X$noexename" != "X$name" ; then
- rmfiles="$rmfiles $objdir/lt-${noexename}.c"
- fi
- fi
- fi
- ;;
- esac
- $show "$rm $rmfiles"
- $run $rm $rmfiles || exit_status=1
- done
- objdir="$origobjdir"
-
- # Try to remove the ${objdir}s in the directories where we deleted files
- for dir in $rmdirs; do
- if test -d "$dir"; then
- $show "rmdir $dir"
- $run rmdir $dir >/dev/null 2>&1
- fi
- done
-
- exit $exit_status
- ;;
-
- "")
- $echo "$modename: you must specify a MODE" 1>&2
- $echo "$generic_help" 1>&2
- exit $EXIT_FAILURE
- ;;
- esac
-
- if test -z "$exec_cmd"; then
- $echo "$modename: invalid operation mode \`$mode'" 1>&2
- $echo "$generic_help" 1>&2
- exit $EXIT_FAILURE
- fi
-fi # test -z "$show_help"
-
-if test -n "$exec_cmd"; then
- eval exec $exec_cmd
- exit $EXIT_FAILURE
-fi
-
-# We need to display help for each of the modes.
-case $mode in
-"") $echo \
-"Usage: $modename [OPTION]... [MODE-ARG]...
-
-Provide generalized library-building support services.
-
- --config show all configuration variables
- --debug enable verbose shell tracing
--n, --dry-run display commands without modifying any files
- --features display basic configuration information and exit
- --finish same as \`--mode=finish'
- --help display this help message and exit
- --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
- --quiet same as \`--silent'
- --silent don't print informational messages
- --tag=TAG use configuration variables from tag TAG
- --version print version information
-
-MODE must be one of the following:
-
- clean remove files from the build directory
- compile compile a source file into a libtool object
- execute automatically set library path, then run a program
- finish complete the installation of libtool libraries
- install install libraries or executables
- link create a library or an executable
- uninstall remove libraries from an installed directory
-
-MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
-a more detailed description of MODE.
-
-Report bugs to <bug-libtool@gnu.org>."
- exit $EXIT_SUCCESS
- ;;
-
-clean)
- $echo \
-"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
- ;;
-
-compile)
- $echo \
-"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
- -o OUTPUT-FILE set the output file name to OUTPUT-FILE
- -prefer-pic try to building PIC objects only
- -prefer-non-pic try to building non-PIC objects only
- -static always build a \`.o' file suitable for static linking
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
- ;;
-
-execute)
- $echo \
-"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
- -dlopen FILE add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
- ;;
-
-finish)
- $echo \
-"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges. Use
-the \`--dry-run' option if you just want to see what would be executed."
- ;;
-
-install)
- $echo \
-"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command. The first component should be
-either the \`install' or \`cp' program.
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
- ;;
-
-link)
- $echo \
-"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
- -all-static do not do any dynamic linking at all
- -avoid-version do not add a version suffix if possible
- -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
- -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
- -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
- -export-symbols SYMFILE
- try to export only the symbols listed in SYMFILE
- -export-symbols-regex REGEX
- try to export only the symbols matching REGEX
- -LLIBDIR search LIBDIR for required installed libraries
- -lNAME OUTPUT-FILE requires the installed library libNAME
- -module build a library that can dlopened
- -no-fast-install disable the fast-install mode
- -no-install link a not-installable executable
- -no-undefined declare that a library does not refer to external symbols
- -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
- -objectlist FILE Use a list of object files found in FILE to specify objects
- -precious-files-regex REGEX
- don't remove output files matching REGEX
- -release RELEASE specify package release information
- -rpath LIBDIR the created library will eventually be installed in LIBDIR
- -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -static do not do any dynamic linking of libtool libraries
- -version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename. Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
- ;;
-
-uninstall)
- $echo \
-"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
- ;;
-
-*)
- $echo "$modename: invalid operation mode \`$mode'" 1>&2
- $echo "$help" 1>&2
- exit $EXIT_FAILURE
- ;;
-esac
-
-$echo
-$echo "Try \`$modename --help' for more information about other modes."
-
-exit $?
-
-# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries. Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them. This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration. But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-disable_libs=shared
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-disable_libs=static
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
diff --git a/M4-RCs/qpid/cpp/build-aux/mdate-sh b/M4-RCs/qpid/cpp/build-aux/mdate-sh
deleted file mode 100755
index cd916c0a34..0000000000
--- a/M4-RCs/qpid/cpp/build-aux/mdate-sh
+++ /dev/null
@@ -1,201 +0,0 @@
-#!/bin/sh
-# Get modification time of a file or directory and pretty-print it.
-
-scriptversion=2005-06-29.22
-
-# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005 Free Software
-# Foundation, Inc.
-# written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-case $1 in
- '')
- echo "$0: No file. Try \`$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: mdate-sh [--help] [--version] FILE
-
-Pretty-print the modification time of FILE.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "mdate-sh $scriptversion"
- exit $?
- ;;
-esac
-
-# Prevent date giving response in another language.
-LANG=C
-export LANG
-LC_ALL=C
-export LC_ALL
-LC_TIME=C
-export LC_TIME
-
-# GNU ls changes its time format in response to the TIME_STYLE
-# variable. Since we cannot assume `unset' works, revert this
-# variable to its documented default.
-if test "${TIME_STYLE+set}" = set; then
- TIME_STYLE=posix-long-iso
- export TIME_STYLE
-fi
-
-save_arg1=$1
-
-# Find out how to get the extended ls output of a file or directory.
-if ls -L /dev/null 1>/dev/null 2>&1; then
- ls_command='ls -L -l -d'
-else
- ls_command='ls -l -d'
-fi
-
-# A `ls -l' line looks as follows on OS/2.
-# drwxrwx--- 0 Aug 11 2001 foo
-# This differs from Unix, which adds ownership information.
-# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
-#
-# To find the date, we split the line on spaces and iterate on words
-# until we find a month. This cannot work with files whose owner is a
-# user named `Jan', or `Feb', etc. However, it's unlikely that `/'
-# will be owned by a user whose name is a month. So we first look at
-# the extended ls output of the root directory to decide how many
-# words should be skipped to get the date.
-
-# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
-set x`ls -l -d /`
-
-# Find which argument is the month.
-month=
-command=
-until test $month
-do
- shift
- # Add another shift to the command.
- command="$command shift;"
- case $1 in
- Jan) month=January; nummonth=1;;
- Feb) month=February; nummonth=2;;
- Mar) month=March; nummonth=3;;
- Apr) month=April; nummonth=4;;
- May) month=May; nummonth=5;;
- Jun) month=June; nummonth=6;;
- Jul) month=July; nummonth=7;;
- Aug) month=August; nummonth=8;;
- Sep) month=September; nummonth=9;;
- Oct) month=October; nummonth=10;;
- Nov) month=November; nummonth=11;;
- Dec) month=December; nummonth=12;;
- esac
-done
-
-# Get the extended ls output of the file or directory.
-set dummy x`eval "$ls_command \"\$save_arg1\""`
-
-# Remove all preceding arguments
-eval $command
-
-# Because of the dummy argument above, month is in $2.
-#
-# On a POSIX system, we should have
-#
-# $# = 5
-# $1 = file size
-# $2 = month
-# $3 = day
-# $4 = year or time
-# $5 = filename
-#
-# On Darwin 7.7.0 and 7.6.0, we have
-#
-# $# = 4
-# $1 = day
-# $2 = month
-# $3 = year or time
-# $4 = filename
-
-# Get the month.
-case $2 in
- Jan) month=January; nummonth=1;;
- Feb) month=February; nummonth=2;;
- Mar) month=March; nummonth=3;;
- Apr) month=April; nummonth=4;;
- May) month=May; nummonth=5;;
- Jun) month=June; nummonth=6;;
- Jul) month=July; nummonth=7;;
- Aug) month=August; nummonth=8;;
- Sep) month=September; nummonth=9;;
- Oct) month=October; nummonth=10;;
- Nov) month=November; nummonth=11;;
- Dec) month=December; nummonth=12;;
-esac
-
-case $3 in
- ???*) day=$1;;
- *) day=$3; shift;;
-esac
-
-# Here we have to deal with the problem that the ls output gives either
-# the time of day or the year.
-case $3 in
- *:*) set `date`; eval year=\$$#
- case $2 in
- Jan) nummonthtod=1;;
- Feb) nummonthtod=2;;
- Mar) nummonthtod=3;;
- Apr) nummonthtod=4;;
- May) nummonthtod=5;;
- Jun) nummonthtod=6;;
- Jul) nummonthtod=7;;
- Aug) nummonthtod=8;;
- Sep) nummonthtod=9;;
- Oct) nummonthtod=10;;
- Nov) nummonthtod=11;;
- Dec) nummonthtod=12;;
- esac
- # For the first six month of the year the time notation can also
- # be used for files modified in the last year.
- if (expr $nummonth \> $nummonthtod) > /dev/null;
- then
- year=`expr $year - 1`
- fi;;
- *) year=$3;;
-esac
-
-# The result.
-echo $day $month $year
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/M4-RCs/qpid/cpp/build-aux/missing b/M4-RCs/qpid/cpp/build-aux/missing
deleted file mode 100755
index 1c8ff7049d..0000000000
--- a/M4-RCs/qpid/cpp/build-aux/missing
+++ /dev/null
@@ -1,367 +0,0 @@
-#! /bin/sh
-# Common stub for a few missing GNU programs while installing.
-
-scriptversion=2006-05-10.23
-
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
-# Free Software Foundation, Inc.
-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301, USA.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-if test $# -eq 0; then
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
-fi
-
-run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
-
-# In the cases where this matters, `missing' is being run in the
-# srcdir already.
-if test -f configure.ac; then
- configure_ac=configure.ac
-else
- configure_ac=configure.in
-fi
-
-msg="missing on your system"
-
-case $1 in
---run)
- # Try to run requested program, and just exit if it succeeds.
- run=
- shift
- "$@" && exit 0
- # Exit code 63 means version mismatch. This often happens
- # when the user try to use an ancient version of a tool on
- # a file that requires a minimum version. In this case we
- # we should proceed has if the program had been absent, or
- # if --run hadn't been passed.
- if test $? = 63; then
- run=:
- msg="probably too old"
- fi
- ;;
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
-error status if there is no known handling for PROGRAM.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
- --run try to run the given command, and emulate it if it fails
-
-Supported PROGRAM values:
- aclocal touch file \`aclocal.m4'
- autoconf touch file \`configure'
- autoheader touch file \`config.h.in'
- autom4te touch the output file, or create a stub one
- automake touch all \`Makefile.in' files
- bison create \`y.tab.[ch]', if possible, from existing .[ch]
- flex create \`lex.yy.c', if possible, from existing .c
- help2man touch the output file
- lex create \`lex.yy.c', if possible, from existing .c
- makeinfo touch the output file
- tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]
-
-Send bug reports to <bug-automake@gnu.org>."
- exit $?
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit $?
- ;;
-
- -*)
- echo 1>&2 "$0: Unknown \`$1' option"
- echo 1>&2 "Try \`$0 --help' for more information"
- exit 1
- ;;
-
-esac
-
-# Now exit if we have it, but it failed. Also exit now if we
-# don't have it and --version was passed (most likely to detect
-# the program).
-case $1 in
- lex|yacc)
- # Not GNU programs, they don't have --version.
- ;;
-
- tar)
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- exit 1
- fi
- ;;
-
- *)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
- # Could not run --version or --help. This is probably someone
- # running `$TOOL --version' or `$TOOL --help' to check whether
- # $TOOL exists and not knowing $TOOL uses missing.
- exit 1
- fi
- ;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case $1 in
- aclocal*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acinclude.m4' or \`${configure_ac}'. You might want
- to install the \`Automake' and \`Perl' packages. Grab them from
- any GNU archive site."
- touch aclocal.m4
- ;;
-
- autoconf)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`${configure_ac}'. You might want to install the
- \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
- archive site."
- touch configure
- ;;
-
- autoheader)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`acconfig.h' or \`${configure_ac}'. You might want
- to install the \`Autoconf' and \`GNU m4' packages. Grab them
- from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
- test -z "$files" && files="config.h"
- touch_files=
- for f in $files; do
- case $f in
- *:*) touch_files="$touch_files "`echo "$f" |
- sed -e 's/^[^:]*://' -e 's/:.*//'`;;
- *) touch_files="$touch_files $f.in";;
- esac
- done
- touch $touch_files
- ;;
-
- automake*)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
- You might want to install the \`Automake' and \`Perl' packages.
- Grab them from any GNU archive site."
- find . -type f -name Makefile.am -print |
- sed 's/\.am$/.in/' |
- while read f; do touch "$f"; done
- ;;
-
- autom4te)
- echo 1>&2 "\
-WARNING: \`$1' is needed, but is $msg.
- You might have modified some files without having the
- proper tools for further handling them.
- You can get \`$1' as part of \`Autoconf' from any GNU
- archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo "#! /bin/sh"
- echo "# Created by GNU Automake missing as a replacement of"
- echo "# $ $@"
- echo "exit 0"
- chmod +x $file
- exit 1
- fi
- ;;
-
- bison|yacc)
- echo 1>&2 "\
-WARNING: \`$1' $msg. You should only need it if
- you modified a \`.y' file. You may need the \`Bison' package
- in order for those modifications to take effect. You can get
- \`Bison' from any GNU archive site."
- rm -f y.tab.c y.tab.h
- if test $# -ne 1; then
- eval LASTARG="\${$#}"
- case $LASTARG in
- *.y)
- SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.c
- fi
- SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" y.tab.h
- fi
- ;;
- esac
- fi
- if test ! -f y.tab.h; then
- echo >y.tab.h
- fi
- if test ! -f y.tab.c; then
- echo 'main() { return 0; }' >y.tab.c
- fi
- ;;
-
- lex|flex)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.l' file. You may need the \`Flex' package
- in order for those modifications to take effect. You can get
- \`Flex' from any GNU archive site."
- rm -f lex.yy.c
- if test $# -ne 1; then
- eval LASTARG="\${$#}"
- case $LASTARG in
- *.l)
- SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if test -f "$SRCFILE"; then
- cp "$SRCFILE" lex.yy.c
- fi
- ;;
- esac
- fi
- if test ! -f lex.yy.c; then
- echo 'main() { return 0; }' >lex.yy.c
- fi
- ;;
-
- help2man)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a dependency of a manual page. You may need the
- \`Help2man' package in order for those modifications to take
- effect. You can get \`Help2man' from any GNU archive site."
-
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -f "$file"; then
- touch $file
- else
- test -z "$file" || exec >$file
- echo ".ab help2man is required to generate this page"
- exit 1
- fi
- ;;
-
- makeinfo)
- echo 1>&2 "\
-WARNING: \`$1' is $msg. You should only need it if
- you modified a \`.texi' or \`.texinfo' file, or any other file
- indirectly affecting the aspect of the manual. The spurious
- call might also be the consequence of using a buggy \`make' (AIX,
- DU, IRIX). You might want to install the \`Texinfo' package or
- the \`GNU make' package. Grab either from any GNU archive site."
- # The file to touch is that specified with -o ...
- file=`echo "$*" | sed -n "$sed_output"`
- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
- if test -z "$file"; then
- # ... or it is the one specified with @setfilename ...
- infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '
- /^@setfilename/{
- s/.* \([^ ]*\) *$/\1/
- p
- q
- }' $infile`
- # ... or it is derived from the source name (dir/f.texi becomes f.info)
- test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
- fi
- # If the file does not exist, the user really needs makeinfo;
- # let's fail without touching anything.
- test -f $file || exit 1
- touch $file
- ;;
-
- tar)
- shift
-
- # We have already tried tar in the generic part.
- # Look for gnutar/gtar before invocation to avoid ugly error
- # messages.
- if (gnutar --version > /dev/null 2>&1); then
- gnutar "$@" && exit 0
- fi
- if (gtar --version > /dev/null 2>&1); then
- gtar "$@" && exit 0
- fi
- firstarg="$1"
- if shift; then
- case $firstarg in
- *o*)
- firstarg=`echo "$firstarg" | sed s/o//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- case $firstarg in
- *h*)
- firstarg=`echo "$firstarg" | sed s/h//`
- tar "$firstarg" "$@" && exit 0
- ;;
- esac
- fi
-
- echo 1>&2 "\
-WARNING: I can't seem to be able to run \`tar' with the given arguments.
- You may want to install GNU tar or Free paxutils, or check the
- command line arguments."
- exit 1
- ;;
-
- *)
- echo 1>&2 "\
-WARNING: \`$1' is needed, and is $msg.
- You might have modified some files without having the
- proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequisites for installing
- this package. You may also peek at any GNU archive site, in case
- some other package would contain this missing \`$1' program."
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/M4-RCs/qpid/cpp/configure.ac b/M4-RCs/qpid/cpp/configure.ac
deleted file mode 100644
index 4fe143bedf..0000000000
--- a/M4-RCs/qpid/cpp/configure.ac
+++ /dev/null
@@ -1,393 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-dnl
-dnl This file is free software; as a special exception the author gives
-dnl unlimited permission to copy and/or distribute it, with or without
-dnl modifications, as long as this notice is preserved.
-dnl
-dnl This program is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
-dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-dnl
-dnl When updating the name/version number here, also update it in
-dnl src/qpid/Version.h
-
-AC_INIT([qpidc], [0.4], [qpid-dev@incubator.apache.org])
-AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects])
-
-# Minimum Autoconf version required.
-AC_PREREQ(2.59)
-
-AC_CONFIG_HEADERS([src/config.h])
-
-AC_PROG_CC_STDC
-AM_PROG_CC_C_O
-AC_PROG_CXX
-AC_USE_SYSTEM_EXTENSIONS
-AC_LANG([C++])
-
-# Check for optional use of help2man
-AC_CHECK_PROG([HELP2MAN], [help2man], [help2man])
-AC_ARG_WITH([help2man],
- [AS_HELP_STRING([--with-help2man], [Use help2man to generate man pages.])],
- [case "$withval" in
- yes) test -z "$HELP2MAN" && AC_MSG_ERROR([help2man not found.]) ;;
- no) HELP2MAN="" ;;
- *) AC_MSG_ERROR([Bad value ${withval} for --with-help2man.]) ;;
- esac])
-AM_CONDITIONAL([HAVE_HELP2MAN], [test -n "$HELP2MAN"])
-
-# Check for optional use of doxygen
-AC_CHECK_PROG([DOXYGEN], [doxygen], [doxygen])
-AC_ARG_WITH([doxygen],
- [AS_HELP_STRING([--with-doxygen], [Use doxygen to generate API documentation.])],
- [case "$withval" in
- yes) test -z "$DOXYGEN" && AC_MSG_ERROR([doxygen not found.]) ;;
- no) DOXYGEN="" ;;
- *) AC_MSG_ERROR([Bad value ${withval} for --with-doxygen.]) ;;
- esac])
-AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"])
-
-AC_ARG_ENABLE(warnings,
-[ --enable-warnings turn on lots of compiler warnings (recommended)],
-[case "${enableval}" in
- yes|no) ;;
- *) AC_MSG_ERROR([bad value ${enableval} for warnings option]) ;;
- esac],
- [enableval=yes])
-
-# Set up for gcc as compiler
-if test x$GXX = xyes; then
- # Warnings: Enable as many as possible, keep the code clean. Please
- # do not disable warnings or remove -Werror without discussing on
- # qpid-dev list.
- #
- # The following warnings are deliberately omitted, they warn on valid code.
- # -Wunreachable-code -Wpadded -Winline
- # -Wshadow - warns about boost headers.
- if test "${enableval}" = yes; then
- gl_COMPILER_FLAGS(-Werror)
- gl_COMPILER_FLAGS(-pedantic)
- gl_COMPILER_FLAGS(-Wall)
- gl_COMPILER_FLAGS(-Wextra)
- gl_COMPILER_FLAGS(-Wno-shadow)
- gl_COMPILER_FLAGS(-Wpointer-arith)
- gl_COMPILER_FLAGS(-Wcast-qual)
- gl_COMPILER_FLAGS(-Wcast-align)
- gl_COMPILER_FLAGS(-Wno-long-long)
- gl_COMPILER_FLAGS(-Wvolatile-register-var)
- gl_COMPILER_FLAGS(-Winvalid-pch)
- gl_COMPILER_FLAGS(-Wno-system-headers)
- gl_COMPILER_FLAGS(-Woverloaded-virtual)
- AC_SUBST([WARNING_CFLAGS], [$COMPILER_FLAGS])
- AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
- COMPILER_FLAGS=
- fi
-else
- AC_CHECK_DECL([__SUNPRO_CC], [SUNCC=yes], [SUNCC=no])
-
- # Set up for sun CC compiler
- if test x$SUNCC = xno; then
- if test "${enableval}" = yes; then
- WARNING_FLAGS=+w
- fi
- CXXFLAGS="$CXXFLAGS -library=stlport4 -mt"
- LD="$CXX"
- LDFLAGS="$LDFLAGS -library=stlport4 -mt"
- fi
-fi
-
-AC_DISABLE_STATIC
-AC_PROG_LIBTOOL
-AC_SUBST([LIBTOOL_DEPS])
-
-# For libraries (libcommon) that use dlopen, dlerror, etc.,
-# test whether we need to link with -ldl.
-gl_saved_libs=$LIBS
- AC_SEARCH_LIBS(dlopen, [dl],
- [test "$ac_cv_search_dlopen" = "none required" ||
- LIB_DLOPEN=$ac_cv_search_dlopen])
- AC_SUBST([LIB_DLOPEN])
-LIBS=$gl_saved_libs
-
-# Set the argument to be used in "libtool -version-info ARG".
-QPID_CURRENT=1
-QPID_REVISION=0
-QPID_AGE=1
-LIBTOOL_VERSION_INFO_ARG=$QPID_CURRENT:$QPID_REVISION:$QPID_AGE
-AC_SUBST(LIBTOOL_VERSION_INFO_ARG)
-
-gl_CLOCK_TIME
-
-# Enable Valgrind
-AC_ARG_ENABLE([valgrind],
- [AS_HELP_STRING([--enable-valgrind],
- [run valgrind memory checker on tests, if available (default yes)])],
- [case $enableval in
- yes|no) enable_VALGRIND=$enableval;;
- *) AC_MSG_ERROR([Invalid value for --enable-valgrind: $enableval]);;
- esac],
- [enable_VALGRIND=yes]
-)
-
-# We use valgrind for the tests. See if it's available.
-# Check for it unconditionally, so we don't have to duplicate its
-# use of AC_SUBST([VALGRIND]).
-AC_CHECK_PROG([VALGRIND], [valgrind], [valgrind])
-test "$enable_VALGRIND" = no && VALGRIND=
-
-# If rpmlint is available we'll run it when building RPMs.
-AC_CHECK_PROG([RPMLINT], [rpmlint], [rpmlint])
-AM_CONDITIONAL([HAS_RPMLINT], [test -n "$RPMLINT"])
-
-# Code generation: generated code is included in the distribution
-# so code generation is only required in an svn checkout.
-# It requires several external tools and files, which we check for here.
-
-AC_CHECK_PROG([RUBY], [ruby], [ruby])
-test -n "$RUBY" && generate=yes
-test -z "$RUBY" && AC_MSG_ERROR([Missing ruby installation (try "yum install ruby").])
-
-specdir=`pwd`/$srcdir/../specs
-AMQP_FINAL_XML=$specdir/amqp.0-10-qpid-errata.xml
-AC_SUBST(AMQP_FINAL_XML)
-AM_CONDITIONAL([GENERATE], [ls $AMQP_FINAL_XML >/dev/null])
-
-# URL and download URL for the package.
-URL=http://rhm.et.redhat.com/qpidc
-AC_SUBST(URL)
-DOWNLOAD_URL=http://rhm.et.redhat.com/download
-AC_SUBST(DOWNLOAD_URL)
-
-# Check for headers from required devel kits.
-AC_CHECK_HEADERS([boost/shared_ptr.hpp uuid/uuid.h],,
- AC_MSG_ERROR([Missing required header files.]))
-
-# Check for optional cluster requirements.
-tmp_LIBS=$LIBS
-LDFLAGS="$LDFLAGS -L/usr/lib/openais -L/usr/lib64/openais -L/usr/lib/corosync -L/usr/lib64/corosync"
-AC_CHECK_LIB([cpg],[cpg_local_get],[have_libcpg=yes],)
-AC_CHECK_HEADERS([openais/cpg.h corosync/cpg.h],[have_cpg_h=yes],)
-AC_ARG_WITH([cpg],
- [AS_HELP_STRING([--with-cpg], [Build with CPG support for clustering.])],
- [case "${withval}" in
- yes) # yes - require dependencies
- test x$have_libcpg = xyes || AC_MSG_ERROR([libcpg not found, install openais-devel or corosync-devel])
- test x$have_cpg_h = xyes || AC_MSG_ERROR([cpg.h not found, install openais-devel or corosync-devel])
- with_cpg=yes
- ;;
- no) with_cpg=no ;;
- *) AC_MSG_ERROR([Bad value ${withval} for --with-cpg option]) ;;
- esac],
- [ # not specified - use if present
- test x$have_libcpg = xyes -a x$have_cpg_h = xyes && with_cpg=yes
- ]
-)
-AM_CONDITIONAL([HAVE_LIBCPG], [test x$with_cpg = xyes])
-
-AC_CHECK_LIB([cman],[cman_is_quorate],have_libcman=yes,)
-AC_CHECK_HEADERS([libcman.h],have_libcman_h=yes,)
-AC_ARG_WITH([libcman],
- [AS_HELP_STRING([--with-libcman], [Integration with libcman quorum service.])],
- [case "${withval}" in
- yes) # yes - require dependencies
- test x$have_libcman = xyes || AC_MSG_ERROR([libcman not found, install cman-devel or cmanlib-devel])
- test x$have_libcman_h = xyes || AC_MSG_ERROR([libcman.h not found, install cman-devel or cmanlib-devel])
- with_libcman=yes
- ;;
- no) with_libcman=no ;;
- *) AC_MSG_ERROR([Bad value ${withval} for --with-libcman option]) ;;
- esac],
- [ # not specified - use if present and we're using with_cpg
- test x$have_libcman = xyes -a x$have_libcman_h = xyes -a x$with_cpg = xyes && with_libcman=yes
- ]
-)
-AM_CONDITIONAL([HAVE_LIBCMAN], [test x$with_libcman = xyes])
-
-LIBS=$tmp_LIBS
-
-# Setup --with-sasl/--without-sasl as arguments to configure
-AC_ARG_WITH([sasl],
- [AS_HELP_STRING([--with-sasl], [Build with SASL authentication support])],
- [WANT_SASL="$withval"],
- [WANT_SASL=check])
-
-# Make sure --with-sasl/--without-sasl were only give yes|no|check
-AS_IF([test "x$WANT_SASL" != xyes -a \
- "x$WANT_SASL" != xno -a \
- "x$WANT_SASL" != xcheck],
- [AC_MSG_ERROR([Bad value for --with-sasl: $withval])])
-
-# If we weren't explicitly asked /not/ to test, i.e. not given --without-sasl
-have_sasl=no
-AS_IF([test "x$WANT_SASL" != xno],
- # Perform tests for headers and libraries. Remember, AC_CHECK_LIB
- # will give you some useful default behavior, e.g. setup LDFLAGS, if
- # you do not give it a second argument, so try not to
- [AC_CHECK_HEADER([sasl/sasl.h], , [HAVE_SASL_H=no])
- tmp_LIBS=$LIBS
- AC_CHECK_LIB([sasl2], [sasl_checkpass], , [HAVE_SASL_LIB=no])
- # Remove from LIBS, we will link it explicitly in make files.
- LIBS=$tmp_LIBS
- # If any of the tests failed
- AS_IF([test "x$HAVE_SASL_H" = xno -o \
- "x$HAVE_SASL_LIB" = xno],
- # And we were given --with, then fail
- [AS_IF([test "x$WANT_SASL" = xyes],
- [AC_MSG_ERROR([sasl requested but not available])])],
- # Otherwise, no tests failed, setup AC_SUBST/AC_DEFINE/vars for AM_CONDITIONALs
- [AC_DEFINE([BROKER_SASL_NAME], ["qpidd"],
- [The SASL app name for the qpid Broker])
- AC_DEFINE([HAVE_SASL], [1], [Enable if libsasl is present])
- have_sasl=yes])])
-AM_CONDITIONAL([HAVE_SASL], [test "x$have_sasl" = xyes])
-
-
-# Setup --with-xml/--without-xml as arguments to configure
-use_xml=yes
-want_xml=check
-AC_ARG_WITH([xml],
- [AS_HELP_STRING([--with-xml], [Build with XML Exchange])],
- [want_xml=$withval])
-
-case $want_xml in
- yes|no|check) ;;
- *) AC_MSG_ERROR([Bad value for --with-xml: $withval]) ;;
-esac
-
-test $want_xml = no && use_xml=no
-
-# If the user doesn't say not to use XML, see if it's available.
-if test $use_xml != no; then
- # Then see if XQilla is available
- tmp_LIBS=$LIBS
- AC_CHECK_LIB([xerces-c], [_init], , [use_xml=no])
- AC_CHECK_HEADER([xercesc/framework/MemBufInputSource.hpp], , [use_xml=no])
- AC_CHECK_HEADER([xqilla/xqilla-simple.hpp], , [use_xml=no])
- AC_CHECK_LIB([xqilla], [_init], , [use_xml=no])
- # Remove from LIBS, we will link it explicitly in make files.
- LIBS=$tmp_LIBS
-
- # If XQilla is not available, yet specifically requested, die.
- test $use_xml:$want_xml = no:yes &&
- AC_MSG_ERROR([XML Exchange requested, but XQilla or Xerces-C not available])
-
- # Else XQilla is available - use it to build
- test $use_xml = yes &&
- AC_DEFINE([HAVE_XML], [1], [Compile-in XML Exchange support.])
-fi
-
-AM_CONDITIONAL([HAVE_XML], [test $use_xml = yes])
-
-# Setup --with-rdma/--without-rdma as arguments to configure
-tmp_LIBS=$LIBS
-AC_ARG_WITH([rdma],
- [AS_HELP_STRING([--with-rdma], [Build with support for Remote DMA protocols])],
- [case ${withval} in
- yes)
- with_RDMA=yes
- AC_CHECK_LIB([ibverbs],[ibv_create_qp],,[AC_MSG_ERROR([libibverbs not found])])
- AC_CHECK_LIB([rdmacm],[rdma_create_id],,[AC_MSG_ERROR([librdmacm not found])])
- AC_CHECK_HEADERS([infiniband/verbs.h],,[AC_MSG_ERROR([ibverbs header files not found])])
- AC_CHECK_HEADERS([rdma/rdma_cma.h],,[AC_MSG_ERROR([rdma_cm header files not found])])
- ;;
- no)
- with_RDMA=no
- ;;
- *)
- AC_MSG_ERROR([Bad value for --with-rdma: ${withval}])
- ;;
- esac],
- [
- with_RDMA=yes
- AC_CHECK_LIB([ibverbs],[ibv_create_qp],,[with_RDMA=no])
- AC_CHECK_LIB([rdmacm],[rdma_create_id],,[with_RDMA=no])
- AC_CHECK_HEADERS([infiniband/verbs.h],,[with_RDMA=no])
- AC_CHECK_HEADERS([rdma/rdma_cma.h],,[with_RDMA=no])
- ]
-)
-# Remove from LIBS, we will link it explicitly in make files.
-LIBS=$tmp_LIBS
-AM_CONDITIONAL([RDMA], [test x$with_RDMA = xyes])
-
-# Setup --with-ssl/--without-ssl as arguments to configure
-tmp_LIBS=$LIBS
-AC_ARG_WITH([ssl],
- [AS_HELP_STRING([--with-ssl], [Build with support for SSL])],
- [case ${withval} in
- yes)
- with_SSL=yes
- PKG_CHECK_MODULES([SSL], [nspr],,[AC_MSG_ERROR([nspr not found])])
- PKG_CHECK_MODULES([SSL], [nss],,[AC_MSG_ERROR([nss not found])])
- ;;
- no)
- with_SSL=no
- ;;
- *)
- AC_MSG_ERROR([Bad value for --with-ssl: ${withval}])
- ;;
- esac],
- [
- with_SSL=yes
- PKG_CHECK_MODULES([SSL], [nspr],,[with_SSL=no])
- PKG_CHECK_MODULES([SSL], [nss],,[with_SSL=no])
- ]
-)
-# Remove from LIBS, we will link it explicitly in make files.
-LIBS=$tmp_LIBS
-AM_CONDITIONAL([SSL], [test x$with_SSL = xyes])
-
-
-poller=no
-AC_ARG_WITH([poller],
- [AS_HELP_STRING([--with-poller], [The low level poller implementation: poll/solaris-ecf/epoll])],
- [case ${withval} in
- poll)
- AC_CHECK_HEADERS([sys/poll.h],[poller=no],[AC_MSG_ERROR([Can't find poll.h header file for poll])])
- ;;
- solaris-ecf)
- AC_CHECK_HEADERS([port.h],[poller=solaris-ecf],[AC_MSG_ERROR([Can't find port.h header file for solaris-ecf])])
- ;;
- epoll)
- AC_CHECK_HEADERS([sys/epoll.h],[poller=epoll],[AC_MSG_ERROR([Can't find epoll.h header file for epoll])])
- ;;
- esac],
- [
- AC_CHECK_HEADERS([sys/poll.h],[poller=no],)
- AC_CHECK_HEADERS([port.h],[poller=solaris-ecf],)
- AC_CHECK_HEADERS([sys/epoll.h],[poller=epoll],)
- ]
-)
-
-AM_CONDITIONAL([HAVE_ECF], [test x$poller = xsolaris-ecf])
-AM_CONDITIONAL([HAVE_EPOLL], [test x$poller = xepoll])
-
-#Filter not implemented or invalid mechanisms
-if test $poller = xno; then
- AC_MSG_ERROR([Polling mechanism not implemented for $host])
-fi
-
-AM_PATH_PYTHON()
-
-# Files to generate
-AC_CONFIG_FILES([
- Makefile
- examples/Makefile
- examples/direct/Makefile
- examples/fanout/Makefile
- examples/pub-sub/Makefile
- examples/request-response/Makefile
- examples/failover/Makefile
- examples/xml-exchange/Makefile
- examples/qmf-console/Makefile
- managementgen/Makefile
- etc/Makefile
- src/Makefile
- src/tests/Makefile
- docs/man/Makefile
- docs/api/Makefile
- docs/api/user.doxygen
- docs/api/developer.doxygen
- ])
-AC_OUTPUT
-
diff --git a/M4-RCs/qpid/cpp/docs/api/Makefile.am b/M4-RCs/qpid/cpp/docs/api/Makefile.am
deleted file mode 100644
index 66169d5caf..0000000000
--- a/M4-RCs/qpid/cpp/docs/api/Makefile.am
+++ /dev/null
@@ -1,40 +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.
-#
-#
-# Run doxygen to generate HTML doc.
-# Generate dependency files so its rebuilt only when needed.
-#
-
-# TODO aconway 2007-04-12: html should have a
-# dependency on source/header files.
-
-if HAVE_DOXYGEN
-
-EXTRA_DIST = html user.doxygen developer.doxygen html.timestamp
-
-html: html.timestamp
-
-html.timestamp:
- doxygen user.doxygen
- touch $@
-
-clean-local:
- rm -rf html html-dev html.timestamp
-
-endif
diff --git a/M4-RCs/qpid/cpp/docs/api/developer.doxygen.in b/M4-RCs/qpid/cpp/docs/api/developer.doxygen.in
deleted file mode 100644
index 46970d5465..0000000000
--- a/M4-RCs/qpid/cpp/docs/api/developer.doxygen.in
+++ /dev/null
@@ -1,1241 +0,0 @@
- # ----------------------------------------------------------------
-# Doxygen settings for Qpid developer documentation.
-#
-# ----------------------------------------------------------------
-
-# Doxyfile 1.4.6
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME = Qpid
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER = 0
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = .
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
-# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
-# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
-# Swedish, and Ukrainian.
-
-OUTPUT_LANGUAGE = English
-
-# This tag can be used to specify the encoding used in the generated output.
-# The encoding is not always determined by the language that is chosen,
-# but also whether or not the output is meant for Windows or non-Windows users.
-# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
-# forces the Windows encoding (this is the default for the Windows binary),
-# whereas setting the tag to NO uses a Unix-style encoding (the default for
-# all platforms other than Windows).
-
-USE_WINDOWS_ENCODING = NO
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = YES # was NO - jwr
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH = ../../src ../../
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = YES
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like the Qt-style comments (thus requiring an
-# explicit @brief command for a brief description.
-
-JAVADOC_AUTOBRIEF = YES
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = YES # was NO
-
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen
-# will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member
-# documentation.
-
-DETAILS_AT_TOP = YES # was NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for Java.
-# For instance, namespaces will be presented as packages, qualified scopes
-# will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
-# include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO # was YES
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = NO # was YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO # was YES
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = YES
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = NO
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from the
-# version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = YES
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE = doxygen.log
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT = @abs_top_srcdir@/src
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-
-
-FILE_PATTERNS = *.h *.cpp
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE = test
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output. If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES (the default)
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES (the default)
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = NO
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html-dev
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
-# generated containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
-# probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader. This is useful
-# if you want to understand what is going on. On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = NO
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = YES
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = YES
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
-# generate a call dependency graph for every global function or class method.
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
-# large images.
-
-MAX_DOT_GRAPH_WIDTH = 1024
-
-# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
-# (in pixels) of the graphs generated by dot. If a graph becomes larger than
-# this value, doxygen will try to truncate the graph, so that it fits within
-# the specified constraint. Beware that most browsers cannot cope with very
-# large images.
-
-MAX_DOT_GRAPH_HEIGHT = 1024
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that a graph may be further truncated if the graph's
-# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
-# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
-# the graph is not depth-constrained.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, which results in a white background.
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE = YES
diff --git a/M4-RCs/qpid/cpp/docs/api/doxygen.css b/M4-RCs/qpid/cpp/docs/api/doxygen.css
deleted file mode 100644
index 3292768f0c..0000000000
--- a/M4-RCs/qpid/cpp/docs/api/doxygen.css
+++ /dev/null
@@ -1,494 +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.
- *
- */
-
-BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
- font-family: Geneva, Arial, Helvetica, sans-serif;
-}
-BODY,TD {
- font-size: 90%;
-}
-H1 {
- text-align: center;
- font-size: 160%;
-}
-H2 {
- font-size: 120%;
-}
-H3 {
- font-size: 100%;
-}
-CAPTION {
- font-weight: bold
-}
-DIV.qindex {
- width: 100%;
- background-color: #e8eef2;
- border: 1px solid #84b0c7;
- text-align: center;
- margin: 2px;
- padding: 2px;
- line-height: 140%;
-}
-DIV.navpath {
- width: 100%;
- background-color: #e8eef2;
- border: 1px solid #84b0c7;
- text-align: center;
- margin: 2px;
- padding: 2px;
- line-height: 140%;
-}
-DIV.navtab {
- background-color: #e8eef2;
- border: 1px solid #84b0c7;
- text-align: center;
- margin: 2px;
- margin-right: 15px;
- padding: 2px;
-}
-TD.navtab {
- font-size: 70%;
-}
-A.qindex {
- text-decoration: none;
- font-weight: bold;
- color: #1A419D;
-}
-A.qindex:visited {
- text-decoration: none;
- font-weight: bold;
- color: #1A419D
-}
-A.qindex:hover {
- text-decoration: none;
- background-color: #ddddff;
-}
-A.qindexHL {
- text-decoration: none;
- font-weight: bold;
- background-color: #6666cc;
- color: #ffffff;
- border: 1px double #9295C2;
-}
-A.qindexHL:hover {
- text-decoration: none;
- background-color: #6666cc;
- color: #ffffff;
-}
-A.qindexHL:visited {
- text-decoration: none;
- background-color: #6666cc;
- color: #ffffff
-}
-A.el {
- text-decoration: none;
- font-weight: bold
-}
-A.elRef {
- font-weight: bold
-}
-A.code:link {
- text-decoration: none;
- font-weight: normal;
- color: #0000FF
-}
-A.code:visited {
- text-decoration: none;
- font-weight: normal;
- color: #0000FF
-}
-A.codeRef:link {
- font-weight: normal;
- color: #0000FF
-}
-A.codeRef:visited {
- font-weight: normal;
- color: #0000FF
-}
-A:hover {
- text-decoration: none;
- background-color: #f2f2ff
-}
-DL.el {
- margin-left: -1cm
-}
-.fragment {
- font-family: monospace, fixed;
- font-size: 95%;
-}
-PRE.fragment {
- border: 1px solid #CCCCCC;
- background-color: #f5f5f5;
- margin-top: 4px;
- margin-bottom: 4px;
- margin-left: 2px;
- margin-right: 8px;
- padding-left: 6px;
- padding-right: 6px;
- padding-top: 4px;
- padding-bottom: 4px;
-}
-DIV.ah {
- background-color: black;
- font-weight: bold;
- color: #ffffff;
- margin-bottom: 3px;
- margin-top: 3px
-}
-
-DIV.groupHeader {
- margin-left: 16px;
- margin-top: 12px;
- margin-bottom: 6px;
- font-weight: bold;
-}
-DIV.groupText {
- margin-left: 16px;
- font-style: italic;
- font-size: 90%
-}
-BODY {
- background: white;
- color: black;
- margin-right: 20px;
- margin-left: 20px;
-}
-TD.indexkey {
- background-color: #e8eef2;
- font-weight: bold;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px;
- border: 1px solid #CCCCCC;
-}
-TD.indexvalue {
- background-color: #e8eef2;
- font-style: italic;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px;
- border: 1px solid #CCCCCC;
-}
-TR.memlist {
- background-color: #f0f0f0;
-}
-P.formulaDsp {
- text-align: center;
-}
-IMG.formulaDsp {
-}
-IMG.formulaInl {
- vertical-align: middle;
-}
-SPAN.keyword { color: #008000 }
-SPAN.keywordtype { color: #604020 }
-SPAN.keywordflow { color: #e08000 }
-SPAN.comment { color: #800000 }
-SPAN.preprocessor { color: #806020 }
-SPAN.stringliteral { color: #002080 }
-SPAN.charliteral { color: #008080 }
-SPAN.vhdldigit { color: #ff00ff }
-SPAN.vhdlchar { color: #000000 }
-SPAN.vhdlkeyword { color: #700070 }
-SPAN.vhdllogic { color: #ff0000 }
-
-.mdescLeft {
- padding: 0px 8px 4px 8px;
- font-size: 80%;
- font-style: italic;
- background-color: #FAFAFA;
- border-top: 1px none #E0E0E0;
- border-right: 1px none #E0E0E0;
- border-bottom: 1px none #E0E0E0;
- border-left: 1px none #E0E0E0;
- margin: 0px;
-}
-.mdescRight {
- padding: 0px 8px 4px 8px;
- font-size: 80%;
- font-style: italic;
- background-color: #FAFAFA;
- border-top: 1px none #E0E0E0;
- border-right: 1px none #E0E0E0;
- border-bottom: 1px none #E0E0E0;
- border-left: 1px none #E0E0E0;
- margin: 0px;
-}
-.memItemLeft {
- padding: 1px 0px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: solid;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memItemRight {
- padding: 1px 8px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: solid;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memTemplItemLeft {
- padding: 1px 0px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: none;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memTemplItemRight {
- padding: 1px 8px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: none;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memTemplParams {
- padding: 1px 0px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: solid;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- color: #606060;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.search {
- color: #003399;
- font-weight: bold;
-}
-FORM.search {
- margin-bottom: 0px;
- margin-top: 0px;
-}
-INPUT.search {
- font-size: 75%;
- color: #000080;
- font-weight: normal;
- background-color: #e8eef2;
-}
-TD.tiny {
- font-size: 75%;
-}
-a {
- color: #1A41A8;
-}
-a:visited {
- color: #2A3798;
-}
-.dirtab {
- padding: 4px;
- border-collapse: collapse;
- border: 1px solid #84b0c7;
-}
-TH.dirtab {
- background: #e8eef2;
- font-weight: bold;
-}
-HR {
- height: 1px;
- border: none;
- border-top: 1px solid black;
-}
-
-/* Style for detailed member documentation */
-.memtemplate {
- font-size: 80%;
- color: #606060;
- font-weight: normal;
- margin-left: 3px;
-}
-.memnav {
- background-color: #e8eef2;
- border: 1px solid #84b0c7;
- text-align: center;
- margin: 2px;
- margin-right: 15px;
- padding: 2px;
-}
-.memitem {
- padding: 4px;
- background-color: #eef3f5;
- border-width: 1px;
- border-style: solid;
- border-color: #dedeee;
- -moz-border-radius: 8px 8px 8px 8px;
-}
-.memname {
- white-space: nowrap;
- font-weight: bold;
-}
-.memdoc{
- padding-left: 10px;
-}
-.memproto {
- background-color: #d5e1e8;
- width: 100%;
- border-width: 1px;
- border-style: solid;
- border-color: #84b0c7;
- font-weight: bold;
- -moz-border-radius: 8px 8px 8px 8px;
-}
-.paramkey {
- text-align: right;
-}
-.paramtype {
- white-space: nowrap;
-}
-.paramname {
- color: #602020;
- font-style: italic;
- white-space: nowrap;
-}
-/* End Styling for detailed member documentation */
-
-/* for the tree view */
-.ftvtree {
- font-family: sans-serif;
- margin:0.5em;
-}
-/* these are for tree view when used as main index */
-.directory {
- font-size: 9pt;
- font-weight: bold;
-}
-.directory h3 {
- margin: 0px;
- margin-top: 1em;
- font-size: 11pt;
-}
-
-/* The following two styles can be used to replace the root node title */
-/* with an image of your choice. Simply uncomment the next two styles, */
-/* specify the name of your image and be sure to set 'height' to the */
-/* proper pixel height of your image. */
-
-/* .directory h3.swap { */
-/* height: 61px; */
-/* background-repeat: no-repeat; */
-/* background-image: url("yourimage.gif"); */
-/* } */
-/* .directory h3.swap span { */
-/* display: none; */
-/* } */
-
-.directory > h3 {
- margin-top: 0;
-}
-.directory p {
- margin: 0px;
- white-space: nowrap;
-}
-.directory div {
- display: none;
- margin: 0px;
-}
-.directory img {
- vertical-align: -30%;
-}
-/* these are for tree view when not used as main index */
-.directory-alt {
- font-size: 100%;
- font-weight: bold;
-}
-.directory-alt h3 {
- margin: 0px;
- margin-top: 1em;
- font-size: 11pt;
-}
-.directory-alt > h3 {
- margin-top: 0;
-}
-.directory-alt p {
- margin: 0px;
- white-space: nowrap;
-}
-.directory-alt div {
- display: none;
- margin: 0px;
-}
-.directory-alt img {
- vertical-align: -30%;
-}
-
diff --git a/M4-RCs/qpid/cpp/docs/api/doxygen_mainpage.h b/M4-RCs/qpid/cpp/docs/api/doxygen_mainpage.h
deleted file mode 100644
index cb59cfa260..0000000000
--- a/M4-RCs/qpid/cpp/docs/api/doxygen_mainpage.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.
- *
- */
-
-// This header file is just for doxygen documentation purposes.
-
-/** \mainpage Qpid C++ API Reference
- *
- * <h2>Messaging Client API classes</h2>
- * <ul>
- * <li><p>\ref clientapi</p></li>
- * </ul>
- *
- * <h2>Code for common tasks</h2>
- *
- * <ul><li><p>Includes and Namespaces</p>
- * <pre> \#include <qpid/client/Connection.h>
- * \#include <qpid/client/Session.h>
- * \#include <qpid/client/Message.h>
- * \#include <qpid/client/SubscriptionManager.h>
- *
- *
- * using namespace qpid::client;
- * using namespace qpid::framing;</pre></li>
- *
- * <li><p>Opening and closing connections and sessions</p>
- * <pre> Connection connection;
- * try {
- * connection.open(host, port);
- * Session session = connection.newSession();
- * ...
- * connection.close();
- * return 0;
- * } catch(const std::exception& error) {
- * std::cout << error.what() << std::endl;
- * }
- * return 1;</pre>
- *
- *
- * <li><p>Declaring and binding queues:</p>
- *
- * <pre> session.queueDeclare(arg::queue="message_queue");
- * session.exchangeBind(arg::exchange="amq.direct", arg::queue="message_queue", arg::bindingKey="routing_key");</pre></li>
- *
- * <li><p>Sending a message:</p>
- *
- * <pre> message.getDeliveryProperties().setRoutingKey("routing_key");
- * message.setData("Hi, Mom!");
- * session.messageTransfer(arg::content=message, arg::destination="amq.direct");</pre></li>
- *
- * <li><p>Sending a message (asynchronous):</p>
- *
- * <pre> ##include <qpid/client/AsyncSession.h>
- * async(session).messageTransfer(arg::content=message, arg::destination="amq.direct");
- * ...
- * session.sync();</pre></li>
- *
- *
- * <li><p>Replying to a message:</p>
- * <pre> Message request, response;
- * ...
- * if (request.getMessageProperties().hasReplyTo()) {
- * string routingKey = request.getMessageProperties().getReplyTo().getRoutingKey();
- * string exchange = request.getMessageProperties().getReplyTo().getExchange();
- * response.getDeliveryProperties().setRoutingKey(routingKey);
- * messageTransfer(arg::content=response, arg::destination=exchange);
- * }
- * </pre></li>
- *
- * <li><p>A message listener:</p>
- *
- * <pre> class Listener : public MessageListener{
- * private:
- * SubscriptionManager& subscriptions;
- * public:
- * Listener(SubscriptionManager& subscriptions);
- * virtual void received(Message& message);
- * };
- *
- * void Listener::received(Message& message) {
- * std::cout << "Message: " << message.getData() << std::endl;
- * if (endCondition(message)) {
- * subscriptions.cancel(message.getDestination());
- * }
- * }</pre></li>
- *
- * <li><p>Using a message listener with a subscription manager:</p>
- *
- * <pre> SubscriptionManager subscriptions(session);
- *
- * Listener listener(subscriptions);
- * subscriptions.subscribe(listener, "message_queue");
- * subscriptions.run();</pre></li>
- *
- * <li><p>Using a LocalQueue with a subscription manager</p>
- *
- * <pre> SubscriptionManager subscriptions(session);
- *
- * LocalQueue local_queue;
- * subscriptions.subscribe(local_queue, string("message_queue"));
- *
- * Message message;
- * for (int i=0; i<10; i++) {
- * local_queue.get(message, 10000);
- * std::cout << message.getData() << std::endl;
- * }</pre></li><ul>
- *
- *
- */
-
-/**
- * \defgroup clientapi Qpid C++ Client API
- *
- */
diff --git a/M4-RCs/qpid/cpp/docs/api/footer.html b/M4-RCs/qpid/cpp/docs/api/footer.html
deleted file mode 100644
index c243486c87..0000000000
--- a/M4-RCs/qpid/cpp/docs/api/footer.html
+++ /dev/null
@@ -1,25 +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.
-
--->
-
-<hr size="1"><address style="text-align: right;"><small>
-Generated on $datetime for $projectname by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> $doxygenversion</small></address>
-</body>
-</html>
diff --git a/M4-RCs/qpid/cpp/docs/api/header.html b/M4-RCs/qpid/cpp/docs/api/header.html
deleted file mode 100644
index 724bd23899..0000000000
--- a/M4-RCs/qpid/cpp/docs/api/header.html
+++ /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.
-
--->
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
-<title>$title</title>
-<link href="$relpath$doxygen.css" rel="stylesheet" type="text/css">
-<link href="$relpath$tabs.css" rel="stylesheet" type="text/css">
-</head><body>
diff --git a/M4-RCs/qpid/cpp/docs/api/stylesheet.css b/M4-RCs/qpid/cpp/docs/api/stylesheet.css
deleted file mode 100644
index 3292768f0c..0000000000
--- a/M4-RCs/qpid/cpp/docs/api/stylesheet.css
+++ /dev/null
@@ -1,494 +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.
- *
- */
-
-BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
- font-family: Geneva, Arial, Helvetica, sans-serif;
-}
-BODY,TD {
- font-size: 90%;
-}
-H1 {
- text-align: center;
- font-size: 160%;
-}
-H2 {
- font-size: 120%;
-}
-H3 {
- font-size: 100%;
-}
-CAPTION {
- font-weight: bold
-}
-DIV.qindex {
- width: 100%;
- background-color: #e8eef2;
- border: 1px solid #84b0c7;
- text-align: center;
- margin: 2px;
- padding: 2px;
- line-height: 140%;
-}
-DIV.navpath {
- width: 100%;
- background-color: #e8eef2;
- border: 1px solid #84b0c7;
- text-align: center;
- margin: 2px;
- padding: 2px;
- line-height: 140%;
-}
-DIV.navtab {
- background-color: #e8eef2;
- border: 1px solid #84b0c7;
- text-align: center;
- margin: 2px;
- margin-right: 15px;
- padding: 2px;
-}
-TD.navtab {
- font-size: 70%;
-}
-A.qindex {
- text-decoration: none;
- font-weight: bold;
- color: #1A419D;
-}
-A.qindex:visited {
- text-decoration: none;
- font-weight: bold;
- color: #1A419D
-}
-A.qindex:hover {
- text-decoration: none;
- background-color: #ddddff;
-}
-A.qindexHL {
- text-decoration: none;
- font-weight: bold;
- background-color: #6666cc;
- color: #ffffff;
- border: 1px double #9295C2;
-}
-A.qindexHL:hover {
- text-decoration: none;
- background-color: #6666cc;
- color: #ffffff;
-}
-A.qindexHL:visited {
- text-decoration: none;
- background-color: #6666cc;
- color: #ffffff
-}
-A.el {
- text-decoration: none;
- font-weight: bold
-}
-A.elRef {
- font-weight: bold
-}
-A.code:link {
- text-decoration: none;
- font-weight: normal;
- color: #0000FF
-}
-A.code:visited {
- text-decoration: none;
- font-weight: normal;
- color: #0000FF
-}
-A.codeRef:link {
- font-weight: normal;
- color: #0000FF
-}
-A.codeRef:visited {
- font-weight: normal;
- color: #0000FF
-}
-A:hover {
- text-decoration: none;
- background-color: #f2f2ff
-}
-DL.el {
- margin-left: -1cm
-}
-.fragment {
- font-family: monospace, fixed;
- font-size: 95%;
-}
-PRE.fragment {
- border: 1px solid #CCCCCC;
- background-color: #f5f5f5;
- margin-top: 4px;
- margin-bottom: 4px;
- margin-left: 2px;
- margin-right: 8px;
- padding-left: 6px;
- padding-right: 6px;
- padding-top: 4px;
- padding-bottom: 4px;
-}
-DIV.ah {
- background-color: black;
- font-weight: bold;
- color: #ffffff;
- margin-bottom: 3px;
- margin-top: 3px
-}
-
-DIV.groupHeader {
- margin-left: 16px;
- margin-top: 12px;
- margin-bottom: 6px;
- font-weight: bold;
-}
-DIV.groupText {
- margin-left: 16px;
- font-style: italic;
- font-size: 90%
-}
-BODY {
- background: white;
- color: black;
- margin-right: 20px;
- margin-left: 20px;
-}
-TD.indexkey {
- background-color: #e8eef2;
- font-weight: bold;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px;
- border: 1px solid #CCCCCC;
-}
-TD.indexvalue {
- background-color: #e8eef2;
- font-style: italic;
- padding-right : 10px;
- padding-top : 2px;
- padding-left : 10px;
- padding-bottom : 2px;
- margin-left : 0px;
- margin-right : 0px;
- margin-top : 2px;
- margin-bottom : 2px;
- border: 1px solid #CCCCCC;
-}
-TR.memlist {
- background-color: #f0f0f0;
-}
-P.formulaDsp {
- text-align: center;
-}
-IMG.formulaDsp {
-}
-IMG.formulaInl {
- vertical-align: middle;
-}
-SPAN.keyword { color: #008000 }
-SPAN.keywordtype { color: #604020 }
-SPAN.keywordflow { color: #e08000 }
-SPAN.comment { color: #800000 }
-SPAN.preprocessor { color: #806020 }
-SPAN.stringliteral { color: #002080 }
-SPAN.charliteral { color: #008080 }
-SPAN.vhdldigit { color: #ff00ff }
-SPAN.vhdlchar { color: #000000 }
-SPAN.vhdlkeyword { color: #700070 }
-SPAN.vhdllogic { color: #ff0000 }
-
-.mdescLeft {
- padding: 0px 8px 4px 8px;
- font-size: 80%;
- font-style: italic;
- background-color: #FAFAFA;
- border-top: 1px none #E0E0E0;
- border-right: 1px none #E0E0E0;
- border-bottom: 1px none #E0E0E0;
- border-left: 1px none #E0E0E0;
- margin: 0px;
-}
-.mdescRight {
- padding: 0px 8px 4px 8px;
- font-size: 80%;
- font-style: italic;
- background-color: #FAFAFA;
- border-top: 1px none #E0E0E0;
- border-right: 1px none #E0E0E0;
- border-bottom: 1px none #E0E0E0;
- border-left: 1px none #E0E0E0;
- margin: 0px;
-}
-.memItemLeft {
- padding: 1px 0px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: solid;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memItemRight {
- padding: 1px 8px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: solid;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memTemplItemLeft {
- padding: 1px 0px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: none;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memTemplItemRight {
- padding: 1px 8px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: none;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.memTemplParams {
- padding: 1px 0px 0px 8px;
- margin: 4px;
- border-top-width: 1px;
- border-right-width: 1px;
- border-bottom-width: 1px;
- border-left-width: 1px;
- border-top-color: #E0E0E0;
- border-right-color: #E0E0E0;
- border-bottom-color: #E0E0E0;
- border-left-color: #E0E0E0;
- border-top-style: solid;
- border-right-style: none;
- border-bottom-style: none;
- border-left-style: none;
- color: #606060;
- background-color: #FAFAFA;
- font-size: 80%;
-}
-.search {
- color: #003399;
- font-weight: bold;
-}
-FORM.search {
- margin-bottom: 0px;
- margin-top: 0px;
-}
-INPUT.search {
- font-size: 75%;
- color: #000080;
- font-weight: normal;
- background-color: #e8eef2;
-}
-TD.tiny {
- font-size: 75%;
-}
-a {
- color: #1A41A8;
-}
-a:visited {
- color: #2A3798;
-}
-.dirtab {
- padding: 4px;
- border-collapse: collapse;
- border: 1px solid #84b0c7;
-}
-TH.dirtab {
- background: #e8eef2;
- font-weight: bold;
-}
-HR {
- height: 1px;
- border: none;
- border-top: 1px solid black;
-}
-
-/* Style for detailed member documentation */
-.memtemplate {
- font-size: 80%;
- color: #606060;
- font-weight: normal;
- margin-left: 3px;
-}
-.memnav {
- background-color: #e8eef2;
- border: 1px solid #84b0c7;
- text-align: center;
- margin: 2px;
- margin-right: 15px;
- padding: 2px;
-}
-.memitem {
- padding: 4px;
- background-color: #eef3f5;
- border-width: 1px;
- border-style: solid;
- border-color: #dedeee;
- -moz-border-radius: 8px 8px 8px 8px;
-}
-.memname {
- white-space: nowrap;
- font-weight: bold;
-}
-.memdoc{
- padding-left: 10px;
-}
-.memproto {
- background-color: #d5e1e8;
- width: 100%;
- border-width: 1px;
- border-style: solid;
- border-color: #84b0c7;
- font-weight: bold;
- -moz-border-radius: 8px 8px 8px 8px;
-}
-.paramkey {
- text-align: right;
-}
-.paramtype {
- white-space: nowrap;
-}
-.paramname {
- color: #602020;
- font-style: italic;
- white-space: nowrap;
-}
-/* End Styling for detailed member documentation */
-
-/* for the tree view */
-.ftvtree {
- font-family: sans-serif;
- margin:0.5em;
-}
-/* these are for tree view when used as main index */
-.directory {
- font-size: 9pt;
- font-weight: bold;
-}
-.directory h3 {
- margin: 0px;
- margin-top: 1em;
- font-size: 11pt;
-}
-
-/* The following two styles can be used to replace the root node title */
-/* with an image of your choice. Simply uncomment the next two styles, */
-/* specify the name of your image and be sure to set 'height' to the */
-/* proper pixel height of your image. */
-
-/* .directory h3.swap { */
-/* height: 61px; */
-/* background-repeat: no-repeat; */
-/* background-image: url("yourimage.gif"); */
-/* } */
-/* .directory h3.swap span { */
-/* display: none; */
-/* } */
-
-.directory > h3 {
- margin-top: 0;
-}
-.directory p {
- margin: 0px;
- white-space: nowrap;
-}
-.directory div {
- display: none;
- margin: 0px;
-}
-.directory img {
- vertical-align: -30%;
-}
-/* these are for tree view when not used as main index */
-.directory-alt {
- font-size: 100%;
- font-weight: bold;
-}
-.directory-alt h3 {
- margin: 0px;
- margin-top: 1em;
- font-size: 11pt;
-}
-.directory-alt > h3 {
- margin-top: 0;
-}
-.directory-alt p {
- margin: 0px;
- white-space: nowrap;
-}
-.directory-alt div {
- display: none;
- margin: 0px;
-}
-.directory-alt img {
- vertical-align: -30%;
-}
-
diff --git a/M4-RCs/qpid/cpp/docs/api/tabs.css b/M4-RCs/qpid/cpp/docs/api/tabs.css
deleted file mode 100644
index 56f0e04564..0000000000
--- a/M4-RCs/qpid/cpp/docs/api/tabs.css
+++ /dev/null
@@ -1,123 +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.
- *
- */
-
-/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */
-
-DIV.tabs
-{
- float : left;
- width : 100%;
- background : url("tab_b.gif") repeat-x bottom;
- margin-bottom : 4px;
-}
-
-DIV.tabs UL
-{
- margin : 0px;
- padding-left : 10px;
- list-style : none;
-}
-
-DIV.tabs LI, DIV.tabs FORM
-{
- display : inline;
- margin : 0px;
- padding : 0px;
-}
-
-DIV.tabs FORM
-{
- float : right;
-}
-
-DIV.tabs A
-{
- float : left;
- background : url("tab_r.gif") no-repeat right top;
- border-bottom : 1px solid #84B0C7;
- font-size : x-small;
- font-weight : bold;
- text-decoration : none;
-}
-
-DIV.tabs A:hover
-{
- background-position: 100% -150px;
-}
-
-DIV.tabs A:link, DIV.tabs A:visited,
-DIV.tabs A:active, DIV.tabs A:hover
-{
- color: #1A419D;
-}
-
-DIV.tabs SPAN
-{
- float : left;
- display : block;
- background : url("tab_l.gif") no-repeat left top;
- padding : 5px 9px;
- white-space : nowrap;
-}
-
-DIV.tabs INPUT
-{
- float : right;
- display : inline;
- font-size : 1em;
-}
-
-DIV.tabs TD
-{
- font-size : x-small;
- font-weight : bold;
- text-decoration : none;
-}
-
-
-
-/* Commented Backslash Hack hides rule from IE5-Mac \*/
-DIV.tabs SPAN {float : none;}
-/* End IE5-Mac hack */
-
-DIV.tabs A:hover SPAN
-{
- background-position: 0% -150px;
-}
-
-DIV.tabs LI.current A
-{
- background-position: 100% -150px;
- border-width : 0px;
-}
-
-DIV.tabs LI.current SPAN
-{
- background-position: 0% -150px;
- padding-bottom : 6px;
-}
-
-DIV.navpath
-{
- background : none;
- border : none;
- border-bottom : 1px solid #84B0C7;
-}
diff --git a/M4-RCs/qpid/cpp/docs/api/user.doxygen.in b/M4-RCs/qpid/cpp/docs/api/user.doxygen.in
deleted file mode 100644
index a4e269549e..0000000000
--- a/M4-RCs/qpid/cpp/docs/api/user.doxygen.in
+++ /dev/null
@@ -1,1219 +0,0 @@
-# ----------------------------------------------------------------
-# Doxygen settings for Qpid user documentation.
-#
-# Note: Only public members of classes that are part of the public API
-# should be documented here. For complete developer documentation use
-# the developer.doxygen configuration.
-# ----------------------------------------------------------------
-
-# Doxyfile 1.4.6
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME = "Qpid C++ Client API"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-# PROJECT_NUMBER = 0
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = .
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
-# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
-# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
-# Swedish, and Ukrainian.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH = ../../src/ ../..
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = YES
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like the Qt-style comments (thus requiring an
-# explicit @brief command for a brief description.
-
-JAVADOC_AUTOBRIEF = YES
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen
-# will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member
-# documentation.
-
-DETAILS_AT_TOP = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for Java.
-# For instance, namespaces will be presented as packages, qualified scopes
-# will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
-# include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = NO
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO # jwr 2008-11-25
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = YES
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = YES
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from the
-# version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = NO
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE = doxygen.log
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-# INPUT = ../../src/qpid ../../src/gen/qpid
-INPUT = ../../src/qpid/client ../../src/qpid/framing ../../src/gen/qpid/client . ../../src/gen/qpid/framing
-
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-
-
-FILE_PATTERNS = *.h
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = NO
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE = test tests broker amqp_0_10 log sys cluster management
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output. If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = YES
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES (the default)
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES (the default)
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = YES
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER = ./header.html
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER = ./footer.html
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
-# generated containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
-# probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader. This is useful
-# if you want to understand what is going on. On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED = BOOST_PARAMETER_MEMFUN
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = YES
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = YES
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
-# generate a call dependency graph for every global function or class method.
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that a graph may be further truncated if the graph's
-# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
-# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
-# the graph is not depth-constrained.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, which results in a white background.
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE = NO
diff --git a/M4-RCs/qpid/cpp/docs/man/Makefile.am b/M4-RCs/qpid/cpp/docs/man/Makefile.am
deleted file mode 100644
index 7db6b5f193..0000000000
--- a/M4-RCs/qpid/cpp/docs/man/Makefile.am
+++ /dev/null
@@ -1,47 +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.
-#
-dist_man_MANS = qpidd.1
-
-man_aux = $(dist_man_MANS:.1=.x)
-EXTRA_DIST = $(man_aux)
-DISTCLEANFILES = $(dist_man_MANS)
-CLEANFILES=qpidd.1
-
-dist-hook: $(man_aux)
-
-# Depend on configure.ac to get version number changes.
-$(dist_man_MANS): $(top_srcdir)/configure.ac
-
-if HAVE_HELP2MAN
-
-SUFFIXES = .x .1
-qpidd.1: $(srcdir)/qpidd.x $(top_builddir)/src/qpidd
-.x.1:
- @rm -f $@
- @echo "Updating man page $@"
- $(HELP2MAN) --no-info --include=$(srcdir)/$*.x --output=$@-t ../../src/$*
- @chmod a-w $@-t
- @mv $@-t $@
-else
-qpidd.1:
- @echo "Warning: help2man not available, man page lacks options."
- @cp $(srcdir)/qpidd.x $@
-endif
-
-
diff --git a/M4-RCs/qpid/cpp/docs/man/qpidd.x b/M4-RCs/qpid/cpp/docs/man/qpidd.x
deleted file mode 100644
index 9f1b465701..0000000000
--- a/M4-RCs/qpid/cpp/docs/man/qpidd.x
+++ /dev/null
@@ -1,46 +0,0 @@
-[NAME]
-
-qpidd \- the Qpid AMQP Broker Daemon
-
-[SYNOPSIS]
-
-qpidd [options]
-
-[DESCRIPTION]
-
-An AMQP broker daemon that stores, routes and forwards messages using
-the Advanced Message Queueing Protocol (AMQP).
-
-[OPTIONS]
-
-Options may be specified via command line, environment variable or configuration file. See FILES and ENVIRONMENT below for details.
-
-[FILES]
-.I /etc/qpidd.conf
-.RS
-Default configuration file.
-.RE
-
-Configuration file settings are over-ridden by command line or environment variable settings. '--config <file>' or 'export QPID_CONFIG=<file>' specifies an alternate file.
-
-Each line is a name=value pair. Blank lines and lines beginning with # are ignored. For example:
-
- # My qpidd configuration file.
- port=6000
- max-connections=10
- log-to-stdout=yes
- log-to-file=/tmp/qpidd.log
-
-[ENVIRONMENT]
-.I QPID_<option>
-.RS
-There is an environment variable for each option.
-.RE
-
-The environment variable is the option name in uppercase, prefixed with QPID_ and '.' or '-' are replaced with '_'. Environment settings are over-ridden by command line settings. For example:
-
- export QPID_PORT=6000
- export QPID_MAX_CONNECTIONS=10
- export QPID_LOG_TO_FILE=/tmp/qpidd.log
-
-
diff --git a/M4-RCs/qpid/cpp/etc/Makefile.am b/M4-RCs/qpid/cpp/etc/Makefile.am
deleted file mode 100644
index 5df3a1ae2e..0000000000
--- a/M4-RCs/qpid/cpp/etc/Makefile.am
+++ /dev/null
@@ -1,59 +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.
-#
-SASL_CONF = sasl2/qpidd.conf
-
-EXTRA_DIST = \
- $(SASL_CONF) \
- qpidd qpidd.conf qpidc.conf
-
-confdir=$(sysconfdir)/qpid
-nobase_conf_DATA=\
- qpidc.conf
-
-nobase_sysconf_DATA = \
- qpidd.conf
-
-if HAVE_SASL
-SASL_DB = qpidd.sasldb
-
-nobase_sysconf_DATA += \
- $(SASL_CONF)
-
-sasldbdir = $(localstatedir)/lib/qpidd
-sasldb_DATA = $(SASL_DB)
-
-# Setup the default sasldb file with a single user, guest, with an
-# obvious password. This user and password are the default for many
-# clients.
-#
-# The realm specified by -u is very important, and QPID is the default
-# for the broker so we use it here. The realm is important because it
-# defaults to the local hostname of the machine running the
-# broker. This may not seem to bad at first glance, but it means that
-# the sasldb has to be tailored to each machine that would be running
-# a broker, and if the machine ever changed its name the
-# authentication would stop working until the sasldb was updated. For
-# these reasons we always want the broker to specify a realm where its
-# users live, and we want the users to exist in that realm as well.
-$(SASL_DB):
- echo guest | /usr/sbin/saslpasswd2 -c -p -f $(SASL_DB) -u QPID guest
-
-CLEANFILES=$(SASL_DB)
-
-endif
diff --git a/M4-RCs/qpid/cpp/etc/emacs/qpid-c++-mode.el b/M4-RCs/qpid/cpp/etc/emacs/qpid-c++-mode.el
deleted file mode 100644
index 102966f86b..0000000000
--- a/M4-RCs/qpid/cpp/etc/emacs/qpid-c++-mode.el
+++ /dev/null
@@ -1,226 +0,0 @@
-;;; qpid-c++-mode.el --- Qpid specific c++-mode customizations.
-
-;;
-;; 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.
-;;
-
-;;;=====================================================================
-;;; Commentary:
-;;
-;; C++ customizations to make c++ mode follow the Qpid style guidelines,
-;; along with some other handy functions to generate initial starting point
-;; .h and .cpp files etc.
-;;
-;; I have this in my .emacs:
-;; (add-to-list 'auto-mode-alist '("\\.h$" . c++-mode))
-;; (require 'qpid-c++-mode)
-;;
-;; Written by Alan Conway: aconway@redhat.com
-;;
-;; For latest version, check
-;; http://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/cpp/etc/emacs/qpid-c++.el
-;;
-
-(require 'cc-mode)
-
-;; Increment the version number if you change this file.
-(defconst qpid-c++-version "1.00" "Qpid C++ style support version number.")
-
-(defun qpid-c++-version ()
- "Echo the current version of qpid-c++-mode in the minibuffer."
- (interactive)
- (message "Using qpid-c++-mode version %s" qpid-c++-version))
-
-(defun qpid-c++-mode ()
- "Qpid C++ mode customizations"
- (c-add-style "qpid-c++"
- '("gnu"
- (indent-tabs-mode . nil)
- (c-basic-offset . 4)
- (c-offsets-alist .
- ((statement-case-intro . *)
- (statement-case-open . *)
- (substatement-open . 0)
- (case-label . *)
- (access-label . /)
- (friend . /)
- (arglist-intro . +)
- (arglist-cont . 0)
- (arglist-close . 0)
- (inline-open . 0)
- (brace-list-open . 0)
- (innamespace . 0)
- ))) )
- (c-set-style "qpid-c++")
- (setq c-hungry-delete-key t)
- (setq c-tab-always-indent t)
- (setq c-hanging-braces-alist '((substatement-open . (after))
- (extern-lang-open . (after))
- (defun-open . (after))
- (class-open . (after))
- (block-open . (after))
-
- (inline-open . (after))
- (defun-block-intro . (after))
- (inclass . (after))
- (topmost-intro . (after))
-
- (brace-list-open)
- (brace-list-close)
- (namespace-open)
- ))
- (setq c-hanging-colons-alist '((member-init-intro)
- (inher-intro)
- (case-label)
- (label)
- (access-label)))
- (setq mode-name "Qpid C++"))
-
-
-(defun copyright ()
- (interactive)
- (insert "/*
- *
- * 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.
- *
- */"))
-
-(defun indent-buffer ()
- (interactive)
- (indent-region (point-min) (point-max) nil))
-
-(defun path-to-namespace (path)
- (replace-regexp-in-string "/" "::" (replace-regexp-in-string "/$" "" path)))
-
-(defun src-subpath (path)
- (if (string-match "/src/\\(.*\\)$" path) (match-string 1 path) ""))
-
-(defun namespace-for-file (file)
- (path-to-namespace (src-subpath (file-name-directory file))))
-
-(defun cpp-guard-for-file (file)
- (upcase (replace-regexp-in-string "[/.-]" "_" (src-subpath file))))
-
-(defun ask-for-namespace ()
- (read-from-minibuffer "Namespace: " (namespace-for-file (buffer-file-name))))
-
-;;; Generate starting point code for new files
-
-(defun insert-ns-open (namespaces)
- (mapcar (lambda (ns) (insert "namespace " ns " {\n")) namespaces))
-
-(defun insert-ns-close (namespaces)
- (mapcar (lambda (ns) (insert "}")) namespaces)
- (insert " // namespace " (mapconcat 'identity namespaces "::") "\n"))
-
-(defun ns-around-region (namespace)
- (interactive (list (ask-for-namespace)))
- (save-excursion
- (let ((namespaces (split-string namespace "::")))
- (if (< (mark) (point)) (exchange-point-and-mark))
- (insert "\n")
- (insert-ns-open namespaces)
- (goto-char (mark))
- (insert "\n")
- (insert-ns-close namespaces))))
-
-(defun insert-class.h (class namespaces)
- "Insert class skeleton in .h file"
- (insert-ns-open namespaces)
- (insert "\n"
- "/**\n *\n */\n"
- " class " class "\n"
- " {\n public:\nprivate:\n};\n"
- )
- (insert-ns-close namespaces))
-
-(defun insert-platform.h (class namespaces)
- "Insert platform #include for platform class."
- (insert "#include <qpid/sys/platform.h>\n"
- "#include QPID_PLATFORM_H(" class ".h)\n"))
-
-(defun .h (namespace &optional content)
- "Initialize a .h file with Qpid copyright etc."
- (interactive (list (ask-for-namespace)))
- (copyright)
- (let ((content (or content 'insert-class.h))
- (class (file-name-nondirectory
- (file-name-sans-extension(buffer-file-name))))
- (namespaces (split-string namespace "::")))
-
- (insert "\n")
- (apply content class namespaces nil)
- (insert "\n"))
- (previous-line 1)
- (beginning-of-line)
- (indent-buffer)
- (save-excursion (cpp-guard)))
-
-(defun .cpp (namespace)
- "Initialize an empty .cpp file with Qpid copyright etc."
- (interactive (list (ask-for-namespace)))
- (copyright)
- (insert "\n#include \"" (file-name-sans-extension
- (file-name-nondirectory buffer-file-name))
- ".h\"\n\n")
- (let ((namespaces (split-string namespace "::")))
- (insert-ns-open namespaces)
- (insert-ns-close namespaces))
- (indent-buffer))
-
-(defun cpp-guard ()
- "Insert C preprocessor macro guard to prevent file rescanning.
-The guard macro is defined from the name of the immediate containing
-directory and the name of the file."
- (interactive)
- (let ((name (cpp-guard-for-file (buffer-file-name))))
- (goto-char (point-min))
- (save-excursion
- (if (looking-at "#ifndef .*\n#define .*\n\n")
- (let ((ifndef (match-data 0)))
- (goto-char (point-max))
- (previous-line 1)
- (beginning-of-line)
- (if (looking-at "#endif")
- (progn
- (kill-line 1)
- (kill-region (car ifndef) (cadr ifndef)))))))
- (insert "#ifndef " name "\n#define " name "\n\n")
- (goto-char (point-max))
- (beginning-of-line)
- (insert (format "#endif /*!%s*/\n" name))))
-
-(add-hook 'c++-mode-hook 'qpid-c++-mode)
-
-(provide 'qpid-c++-mode)
-
-
diff --git a/M4-RCs/qpid/cpp/etc/qpidc.conf b/M4-RCs/qpid/cpp/etc/qpidc.conf
deleted file mode 100644
index 588999c074..0000000000
--- a/M4-RCs/qpid/cpp/etc/qpidc.conf
+++ /dev/null
@@ -1,23 +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.
-#
-# Configuration file for the qpid c++ client library. Entries are of
-# the form:
-# name=value
-#
-# (Note: no spaces on either side of '=')
diff --git a/M4-RCs/qpid/cpp/etc/qpidd b/M4-RCs/qpid/cpp/etc/qpidd
deleted file mode 100755
index f168430069..0000000000
--- a/M4-RCs/qpid/cpp/etc/qpidd
+++ /dev/null
@@ -1,103 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-#
-# qpidd Startup script for the Qpid messaging daemon.
-#
-
-### BEGIN INIT INFO
-# Provides: qpidd
-# Required-Start: $local_fs
-# Required-Stop: $local_fs
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: start or stop qpidd
-# Description: Qpidd is an AMQP broker. It receives, stores, routes and forwards messages using the AMQP protcol.
-### END INIT INFO
-
-# chkconfig: - 85 15
-# description: Qpidd is an AMQP broker. It receives, stores, routes and forwards messages using the AMQP protcol.
-# processname: qpidd
-
-prog=qpidd
-lockfile=/var/lock/subsys/$prog
-pidfile=/var/run/qpidd.pid
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-if [ -f /etc/sysconfig/$prog ] ; then
- . /etc/sysconfig/$prog
-fi
-
-RETVAL=0
-
-start() {
- echo -n $"Starting Qpid AMQP daemon: "
- daemon --pidfile $pidfile --check $prog --user qpidd /usr/sbin/$prog --daemon --pid-dir /var/run/qpidd --data-dir /var/lib/qpidd $QPIDD_OPTIONS
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && touch $lockfile
- if [ $RETVAL = 0 ]; then
- touch $pidfile
- chown qpidd.qpidd $pidfile
- runuser -s /bin/sh qpidd -c "/usr/sbin/$prog --check --pid-dir /var/run/qpidd > $pidfile"
- fi
- return $RETVAL
-}
-
-stop() {
- echo -n $"Stopping Qpid AMQP daemon: "
- killproc -p ${pidfile} $prog
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
-}
-
-reload() {
- echo 1>&2 $"$0: reload not supported"
- exit 3
-}
-
-restart() {
- stop
- start
-}
-
-# See how we were called.
-case "$1" in
- start|stop|restart|reload)
- $1
- ;;
- status)
- status $prog
- RETVAL=$?
- ;;
- force-reload)
- restart
- ;;
- try-restart)
- [ -e $lockfile ] && restart || :
- ;;
- *)
- echo 1>&2 $"Usage: $0 {start|stop|restart|condrestart|status}"
- exit 1
-esac
-
-exit $RETVAL
diff --git a/M4-RCs/qpid/cpp/etc/qpidd.conf b/M4-RCs/qpid/cpp/etc/qpidd.conf
deleted file mode 100644
index d5d9344281..0000000000
--- a/M4-RCs/qpid/cpp/etc/qpidd.conf
+++ /dev/null
@@ -1,23 +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.
-#
-# Configuration file for qpidd. Entries are of the form:
-# name=value
-#
-# (Note: no spaces on either side of '='). Using default settings:
-# "qpidd --help" or "man qpidd" for more details.
diff --git a/M4-RCs/qpid/cpp/etc/sasl2/qpidd.conf b/M4-RCs/qpid/cpp/etc/sasl2/qpidd.conf
deleted file mode 100644
index 05bfbdd5a9..0000000000
--- a/M4-RCs/qpid/cpp/etc/sasl2/qpidd.conf
+++ /dev/null
@@ -1,42 +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 configuation allows for either SASL PLAIN or ANONYMOUS
-# authentication. The PLAIN authentication is done on a
-# username+password, which is stored in the sasldb_path
-# file. Usernames and passwords can be added to the file using the
-# command:
-#
-# saslpasswd2 -f /var/lib/qpidd/qpidd.sasldb -u <REALM> <USER>
-#
-# The REALM is important and should be the same as the --auth-realm
-# option to the broker. This lets the broker properly find the user in
-# the sasldb file.
-#
-# Existing user accounts may be listed with:
-#
-# sasldblistusers2 -f /var/lib/qpidd/qpidd.sasldb
-#
-# NOTE: The sasldb file must be readable by the user running the qpidd
-# daemon, and should be readable only by that user.
-#
-mech_list: plain anonymous
-pwcheck_method: auxprop
-auxprop_plugin: sasldb
-sasldb_path: /var/lib/qpidd/qpidd.sasldb
diff --git a/M4-RCs/qpid/cpp/examples/Makefile.am b/M4-RCs/qpid/cpp/examples/Makefile.am
deleted file mode 100644
index 29a101425c..0000000000
--- a/M4-RCs/qpid/cpp/examples/Makefile.am
+++ /dev/null
@@ -1,49 +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.
-#
-SUBDIRS = direct fanout pub-sub request-response failover qmf-console
-if HAVE_XML
- SUBDIRS += xml-exchange
- broker_args = "--no-module-dir --data-dir \"\" --auth no --load-module $(top_builddir)/src/.libs/xml.so"
-endif
-if !HAVE_XML
- exclude_examples_regexp="xml" # Exclude XML examples.
- broker_args = "--no-module-dir --data-dir \"\" --auth no"
-endif
-
-MAKEDIST=.libs/Makefile
-SUBMAKE=' for d in $(SUBDIRS) ; do $$(MAKE) -C $$$$d $$@ ; done'
-$(MAKEDIST): Makefile
- mkdir -p .libs
- @$(ECHO) all: > $(MAKEDIST)
- @$(ECHO) $(SUBMAKE) >> $(MAKEDIST)
- @$(ECHO) clean: >> $(MAKEDIST)
- @$(ECHO) $(SUBMAKE) >> $(MAKEDIST)
-
-examplesdir=$(pkgdatadir)/examples
-examples_DATA = README $(MAKEDIST)
-
-EXTRA_DIST = $(examples_DATA) README.verify verify verify_all
-
-# For older versions of automake
-abs_top_srcdir = @abs_top_srcdir@
-
-# Verify the examples in the buid tree.
-check-local:
- $(srcdir)/verify_all $(abs_top_srcdir)/.. $(top_builddir)/src/qpidd $(broker_args) $(exclude_examples_regexp)
-
diff --git a/M4-RCs/qpid/cpp/examples/README b/M4-RCs/qpid/cpp/examples/README
deleted file mode 100644
index 50f0c07089..0000000000
--- a/M4-RCs/qpid/cpp/examples/README
+++ /dev/null
@@ -1,114 +0,0 @@
-= Qpid C++ Examples =
-
-Apache Qpid Examples in C++ are found inside this directory, they are
-based on the 0-10 version of the AMQP specification (see amqp.org for
-details). A short description on each example is found below.
-
-Please note that you will have to start the Qpid broker on port 5672,
-on your localhost (127.0.0.1) before running these examples. However,
-it is possible to alternatively specify the host and port when running
-each example.
-
- Ex:- ./declare_queues 127.0.0.1 5673
-
-The qpid C++ broker (known as qpidd) is found
-- if installed, installed as /usr/sbin/qpidd
-- in /path-to-qpid-source/cpp/src/
-
-== Direct ==
-
-This is an example on how to create Point-to-Point applications using Qpid. This
-example contains three main components.
-
- 1. declare_queues
- This will bind a queue to the amq.direct exchange, so that the messages sent
- to the amq.direct exchange, with a given routing key (routing_key) are
- delivered to a specific queue (message_queue).
-
- 2. direct_producer
- Publishes messages to the amq.direct exchange using the given routing key
- (routing_key) discussed above.
-
- 3. listener
- Uses a message listener to listen messages from a specific queue
- (message_queue) as discussed above.
-
-In order to run this example,
-
-On Linux:
- # ./declare_queues
- # ./direct_producer
- # ./listener
-
-== Fanout ==
-
-This is an example on how to create Fanout exchange applications using Qpid.
-This example has two components unlike the previous. This is because Fanout
-exchange not needing a routing key to be specified.
-
- 1. fanout_producer
- Publishes a message to the amq.fanout exchange, without using a routing key.
-
- 2. listener
- Uses a message listener to listen messages from the amq.fanout exchange.
-
-Another difference between the above example and this example is that in the
-above example there is no requirement for the listener to be activated before
-the messages being published. However, in this example, it is required that a
-listener be active before the messages being published, if not they will be
-lost.
-
-In order to run this example,
-
-On Linux:
- # ./listener
- # ./fanout_producer
-
-== Publisher/Subscriber ==
-
-Showing The ability to create topic Publishers and Subscribers using Qpid is
-the main objective of this example. It is required that you subscribe first,
-before publishing any message due to the construction of this example. There
-are two main applications in this.
-
- 1. topic_publisher
- This application is used to publish messages to the amq.topic exchange using
- multipart routing keys, usa.weather, europe.weather, usa.news and europe.news.
-
- 2. topic_listener
- This application is used to subscribe to several private queues, such as usa,
- europe, weather and news. In here, each private queue created is bound to the
- amq.topic exchange using bindings that match the corresponding parts of the
- multipart routing keys.
- Ex:- #.news will retrieve news irrespective of destination.
-
-This example also shows the use of the 'control' routing key which is used by
-control messages.
-
-In order to run this example,
-
-On Linux:
- # ./topic_listener
- # ./topic_publisher
-
-== Request/Response ==
-
-This example shows a simple server that will accept string from a client and
-convert them to upper case and send them back to the client. This too has two
-main application like the previous sample.
-
- 1. client
- This sends lines of poetry to the server.
-
- 2. server
- This is a simple service that will convert incoming strings to upper case and
- send the result to amq.direct exchange on which the client listens. It uses the
- request's reply_to property as the response's routing key.
-
-In order to run this example,
-
-On Linux:
- # ./server
- # ./client
-
-
diff --git a/M4-RCs/qpid/cpp/examples/README.verify b/M4-RCs/qpid/cpp/examples/README.verify
deleted file mode 100644
index d15adce58d..0000000000
--- a/M4-RCs/qpid/cpp/examples/README.verify
+++ /dev/null
@@ -1,26 +0,0 @@
-= Qpid C++ Examples =
-
-For more information read examples/README.
-
-== The Verify All Script ==
-
-The verify_all script will run C++ examples against itself and against the
-Python examples. The success of the script is determined by comparing its output
-against what is expected.
-
-=== Arguments ===
-
-The verify_all script expects the path to Qpid trunk as an argument, in order to
-setup the environment for Python examples.
-
-== The Verify Script ==
-
-The verify script is capable of running one or many scripts designed to verify
-the success of Qpid examples. The verify script is utilized by the verify_all
-scripts.
-
-=== Verifying an individual example ===
-
-This will require you using the verify script, and providing the necessary sub
-script(s) it will utilize in the process. Please note that it is your
-responsibility to setup the necessary environment for the verification process
diff --git a/M4-RCs/qpid/cpp/examples/direct/Makefile.am b/M4-RCs/qpid/cpp/examples/direct/Makefile.am
deleted file mode 100644
index 07431f6fe4..0000000000
--- a/M4-RCs/qpid/cpp/examples/direct/Makefile.am
+++ /dev/null
@@ -1,47 +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.
-#
-examplesdir=$(pkgdatadir)/examples/direct
-
-include $(top_srcdir)/examples/makedist.mk
-
-noinst_PROGRAMS=direct_producer listener declare_queues
-direct_producer_SOURCES=direct_producer.cpp
-direct_producer_LDADD=$(CLIENT_LIB)
-
-listener_SOURCES=listener.cpp
-listener_LDADD=$(CLIENT_LIB)
-
-declare_queues_SOURCES=declare_queues.cpp
-declare_queues_LDADD=$(CLIENT_LIB)
-
-examples_DATA= \
- direct_producer.cpp \
- listener.cpp \
- declare_queues.cpp \
- $(MAKEDIST)
-
-EXTRA_DIST= \
- $(examples_DATA) \
- verify \
- verify.in \
- verify_cpp_python \
- verify_cpp_python.in \
- verify_python_cpp \
- verify_python_cpp.in
-
diff --git a/M4-RCs/qpid/cpp/examples/direct/declare_queues.cpp b/M4-RCs/qpid/cpp/examples/direct/declare_queues.cpp
deleted file mode 100644
index 9a51d1982b..0000000000
--- a/M4-RCs/qpid/cpp/examples/direct/declare_queues.cpp
+++ /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.
- *
- */
-
-
-/**
- * declare_queues.cpp
- *
- * This program is one of three programs designed to be used
- * together.
- *
- * declare_queues.cpp: (this program):
- *
- * Creates a queue named "message_queue" on a broker, binding the
- * queue to the "amq.direct" exchange, using the routing key
- * "routing_key".
- *
- * direct_producer.cpp
- *
- * Publishes to the "amq.direct" exchange, specifying the routing
- * key "routing_key"
- *
- * listener.cpp
- *
- * Reads from the "message_queue" queue on the broker using a
- * message listener.
- *
- */
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
- Connection connection;
-
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
-
- //--------- Main body of program --------------------------------------------
-
- // Create a queue named "message_queue", and route all messages whose
- // routing key is "routing_key" to this newly created queue.
-
- session.queueDeclare(arg::queue="message_queue");
- session.exchangeBind(arg::exchange="amq.direct", arg::queue="message_queue", arg::bindingKey="routing_key");
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-
-}
-
-
-
diff --git a/M4-RCs/qpid/cpp/examples/direct/direct_producer.cpp b/M4-RCs/qpid/cpp/examples/direct/direct_producer.cpp
deleted file mode 100644
index 7cca1955cf..0000000000
--- a/M4-RCs/qpid/cpp/examples/direct/direct_producer.cpp
+++ /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.
- *
- */
-
-/**
- * direct_producer.cpp:
- *
- * This program is one of three programs designed to be used
- * together.
- *
- * create_queues.cpp:
- *
- * Creates a queue named "message_queue" on a broker, binding the
- * queue to the "amq.direct" exchange, using the routing key
- * "routing_key".
- *
- * direct_producer.cpp (this program):
- *
- * Publishes to the "amq.direct" exchange, specifying the routing
- * key "routing_key"
- *
- * listener.cpp
- *
- * Reads from the "message_queue" queue on the broker using a
- * message listener.
- *
- */
-
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/AsyncSession.h>
-#include <qpid/client/Message.h>
-
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-#include <sstream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using std::stringstream;
-using std::string;
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
- int count = argc>3 ? atoi(argv[3]) : 10;
-
- Connection connection;
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
- //--------- Main body of program --------------------------------------------
-
- // The routing key is a message property. We will use the same
- // routing key for each message, so we'll set this property
- // just once. (In most simple cases, there is no need to set
- // other message properties.)
-
- Message message;
- message.getDeliveryProperties().setRoutingKey("routing_key");
-
- // Now send some messages ...
-
- for (int i=0; i<count; i++) {
- stringstream message_data;
- message_data << "Message " << i;
-
- message.setData(message_data.str());
- session.messageTransfer(arg::content=message, arg::destination="amq.direct");
- }
-
- // And send a final message to indicate termination.
-
- message.setData("That's all, folks!");
- session.messageTransfer(arg::content=message, arg::destination="amq.direct");
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/examples/direct/listener.cpp b/M4-RCs/qpid/cpp/examples/direct/listener.cpp
deleted file mode 100644
index 55229df8a3..0000000000
--- a/M4-RCs/qpid/cpp/examples/direct/listener.cpp
+++ /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.
- *
- */
-
-/**
- * listener.cpp:
- *
- * This program is one of three programs designed to be used
- * together.
- *
- * create_queues.cpp:
- *
- * Creates a queue named "message_queue" on a broker, binding the
- * queue to the "amq.direct" exchange, using the routing key
- * "routing_key".
- *
- * direct_producer.cpp
- *
- * Publishes to the "amq.direct" exchange, specifying the routing
- * key "routing_key"
- *
- * listener.cpp (this program):
- *
- * Reads from the "message_queue" queue on the broker using a
- * message listener.
- */
-
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/MessageListener.h>
-#include <qpid/client/SubscriptionManager.h>
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-
-class Listener : public MessageListener{
- private:
- SubscriptionManager& subscriptions;
- public:
- Listener(SubscriptionManager& subscriptions);
- virtual void received(Message& message);
-};
-
-Listener::Listener(SubscriptionManager& subs) : subscriptions(subs)
-{}
-
-void Listener::received(Message& message) {
- std::cout << "Message: " << message.getData() << std::endl;
- if (message.getData() == "That's all, folks!") {
- std::cout << "Shutting down listener for " << message.getDestination()
- << std::endl;
- subscriptions.cancel(message.getDestination());
- }
-}
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
-
- Connection connection;
-
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
- //--------- Main body of program --------------------------------------------
-
- SubscriptionManager subscriptions(session);
- // Create a listener and subscribe it to the queue named "message_queue"
- Listener listener(subscriptions);
- subscriptions.subscribe(listener, "message_queue");
- // Receive messages until the subscription is cancelled
- // by Listener::received()
- subscriptions.run();
-
- //---------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/examples/direct/verify b/M4-RCs/qpid/cpp/examples/direct/verify
deleted file mode 100644
index f598bacc1f..0000000000
--- a/M4-RCs/qpid/cpp/examples/direct/verify
+++ /dev/null
@@ -1,23 +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.
-#
-
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-clients ./declare_queues ./direct_producer ./listener
-outputs ./declare_queues.out ./direct_producer.out ./listener.out
diff --git a/M4-RCs/qpid/cpp/examples/direct/verify.in b/M4-RCs/qpid/cpp/examples/direct/verify.in
deleted file mode 100644
index d1e95f1151..0000000000
--- a/M4-RCs/qpid/cpp/examples/direct/verify.in
+++ /dev/null
@@ -1,15 +0,0 @@
-==== declare_queues.out
-==== direct_producer.out
-==== listener.out
-Message: Message 0
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: That's all, folks!
-Shutting down listener for message_queue
diff --git a/M4-RCs/qpid/cpp/examples/direct/verify_cpp_python b/M4-RCs/qpid/cpp/examples/direct/verify_cpp_python
deleted file mode 100644
index 4dc445ba27..0000000000
--- a/M4-RCs/qpid/cpp/examples/direct/verify_cpp_python
+++ /dev/null
@@ -1,4 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/direct
-clients ./declare_queues ./direct_producer $py/direct_consumer.py
-outputs ./declare_queues.out ./direct_producer.out $py/direct_consumer.py.out
diff --git a/M4-RCs/qpid/cpp/examples/direct/verify_cpp_python.in b/M4-RCs/qpid/cpp/examples/direct/verify_cpp_python.in
deleted file mode 100644
index 1a329be59a..0000000000
--- a/M4-RCs/qpid/cpp/examples/direct/verify_cpp_python.in
+++ /dev/null
@@ -1,14 +0,0 @@
-==== declare_queues.out
-==== direct_producer.out
-==== direct_consumer.py.out
-Message 0
-Message 1
-Message 2
-Message 3
-Message 4
-Message 5
-Message 6
-Message 7
-Message 8
-Message 9
-That's all, folks!
diff --git a/M4-RCs/qpid/cpp/examples/direct/verify_python_cpp b/M4-RCs/qpid/cpp/examples/direct/verify_python_cpp
deleted file mode 100644
index fe4893e120..0000000000
--- a/M4-RCs/qpid/cpp/examples/direct/verify_python_cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/direct
-clients $py/declare_queues.py $py/direct_producer.py ./listener
-outputs $py/declare_queues.py.out $py/direct_producer.py.out ./listener.out
-
diff --git a/M4-RCs/qpid/cpp/examples/direct/verify_python_cpp.in b/M4-RCs/qpid/cpp/examples/direct/verify_python_cpp.in
deleted file mode 100644
index 6f35255b18..0000000000
--- a/M4-RCs/qpid/cpp/examples/direct/verify_python_cpp.in
+++ /dev/null
@@ -1,15 +0,0 @@
-==== declare_queues.py.out
-==== direct_producer.py.out
-==== listener.out
-Message: message 0
-Message: message 1
-Message: message 2
-Message: message 3
-Message: message 4
-Message: message 5
-Message: message 6
-Message: message 7
-Message: message 8
-Message: message 9
-Message: That's all, folks!
-Shutting down listener for message_queue
diff --git a/M4-RCs/qpid/cpp/examples/failover/Makefile.am b/M4-RCs/qpid/cpp/examples/failover/Makefile.am
deleted file mode 100644
index c41f26eaba..0000000000
--- a/M4-RCs/qpid/cpp/examples/failover/Makefile.am
+++ /dev/null
@@ -1,40 +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.
-#
-examplesdir=$(pkgdatadir)/examples/failover
-
-include $(top_srcdir)/examples/makedist.mk
-
-noinst_PROGRAMS=declare_queues resuming_receiver replaying_sender
-
-declare_queues_SOURCES=declare_queues.cpp
-declare_queues_LDADD=$(CLIENT_LIB)
-
-resuming_receiver_SOURCES=resuming_receiver.cpp
-resuming_receiver_LDADD=$(CLIENT_LIB)
-
-replaying_sender_SOURCES=replaying_sender.cpp
-replaying_sender_LDADD=$(CLIENT_LIB)
-
-examples_DATA= \
- declare_queues.cpp \
- resuming_receiver.cpp \
- replaying_sender.cpp \
- $(MAKEDIST)
-
-# FIXME aconway 2008-10-10: add verify scripts.
diff --git a/M4-RCs/qpid/cpp/examples/failover/declare_queues.cpp b/M4-RCs/qpid/cpp/examples/failover/declare_queues.cpp
deleted file mode 100644
index a677870c53..0000000000
--- a/M4-RCs/qpid/cpp/examples/failover/declare_queues.cpp
+++ /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.
- *
- */
-
-#include <qpid/client/FailoverManager.h>
-#include <qpid/client/Session.h>
-#include <qpid/Exception.h>
-
-#include <cstdlib>
-#include <iostream>
-
-using namespace qpid::client;
-
-using namespace std;
-
-int main(int argc, char ** argv)
-{
- ConnectionSettings settings;
- if (argc > 1) settings.host = argv[1];
- if (argc > 2) settings.port = atoi(argv[2]);
-
- FailoverManager connection(settings);
- try {
- bool complete = false;
- while (!complete) {
- Session session = connection.connect().newSession();
- try {
- session.queueDeclare(arg::queue="message_queue");
- complete = true;
- } catch (const qpid::TransportFailure&) {}
- }
- connection.close();
- return 0;
- } catch (const std::exception& error) {
- std::cout << "Failed:" << error.what() << std::endl;
- return 1;
- }
-
-}
-
-
-
-
-
diff --git a/M4-RCs/qpid/cpp/examples/failover/replaying_sender.cpp b/M4-RCs/qpid/cpp/examples/failover/replaying_sender.cpp
deleted file mode 100644
index 22a7e1ebd3..0000000000
--- a/M4-RCs/qpid/cpp/examples/failover/replaying_sender.cpp
+++ /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.
- *
- */
-
-#include <qpid/client/FailoverManager.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/AsyncSession.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/MessageReplayTracker.h>
-#include <qpid/Exception.h>
-
-#include <iostream>
-#include <sstream>
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using namespace std;
-
-class Sender : public FailoverManager::Command
-{
- public:
- Sender(const std::string& queue, uint count);
- void execute(AsyncSession& session, bool isRetry);
- uint getSent();
- private:
- MessageReplayTracker sender;
- const uint count;
- uint sent;
- Message message;
-
-};
-
-Sender::Sender(const std::string& queue, uint count_) : sender(10), count(count_), sent(0)
-{
- message.getDeliveryProperties().setRoutingKey(queue);
-}
-
-void Sender::execute(AsyncSession& session, bool isRetry)
-{
- if (isRetry) sender.replay(session);
- else sender.init(session);
- while (sent < count) {
- stringstream message_data;
- message_data << ++sent;
- message.setData(message_data.str());
- message.getHeaders().setInt("sn", sent);
- sender.send(message);
- if (count > 1000 && !(sent % 1000)) {
- std::cout << "sent " << sent << " of " << count << std::endl;
- }
- }
- message.setData("That's all, folks!");
- sender.send(message);
-}
-
-uint Sender::getSent()
-{
- return sent;
-}
-
-int main(int argc, char ** argv)
-{
- ConnectionSettings settings;
- if (argc > 1) settings.host = argv[1];
- if (argc > 2) settings.port = atoi(argv[2]);
-
- FailoverManager connection(settings);
- Sender sender("message_queue", argc > 3 ? atoi(argv[3]) : 1000);
- try {
- connection.execute(sender);
- std::cout << "Sent " << sender.getSent() << " messages." << std::endl;
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << "Failed: " << error.what() << std::endl;
- }
- return 1;
-}
diff --git a/M4-RCs/qpid/cpp/examples/failover/resuming_receiver.cpp b/M4-RCs/qpid/cpp/examples/failover/resuming_receiver.cpp
deleted file mode 100644
index d1886ce861..0000000000
--- a/M4-RCs/qpid/cpp/examples/failover/resuming_receiver.cpp
+++ /dev/null
@@ -1,127 +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 <qpid/client/FailoverManager.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/SubscriptionManager.h>
-
-#include <iostream>
-#include <fstream>
-
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using namespace std;
-
-
-class Listener : public MessageListener,
- public FailoverManager::Command,
- public FailoverManager::ReconnectionStrategy
-{
- public:
- Listener();
- void received(Message& message);
- void execute(AsyncSession& session, bool isRetry);
- void check();
- void editUrlList(std::vector<Url>& urls);
- private:
- Subscription subscription;
- uint count;
- uint skipped;
- uint lastSn;
- bool gaps;
-};
-
-Listener::Listener() : count(0), skipped(0), lastSn(0), gaps(false) {}
-
-void Listener::received(Message & message)
-{
- if (message.getData() == "That's all, folks!") {
- std::cout << "Shutting down listener for " << message.getDestination()
- << std::endl;
-
- std::cout << "Listener received " << count << " messages (" << skipped << " skipped)" << std::endl;
- subscription.cancel();
- } else {
- uint sn = message.getHeaders().getAsInt("sn");
- if (lastSn < sn) {
- if (sn - lastSn > 1) {
- std::cout << "Error: gap in sequence between " << lastSn << " and " << sn << std::endl;
- gaps = true;
- }
- lastSn = sn;
- ++count;
- } else {
- ++skipped;
- }
- }
-}
-
-void Listener::check()
-{
- if (gaps) throw Exception("Detected gaps in sequence; messages appear to have been lost.");
-}
-
-void Listener::execute(AsyncSession& session, bool isRetry)
-{
- if (isRetry) {
- std::cout << "Resuming from " << count << std::endl;
- }
- SubscriptionManager subs(session);
- subscription = subs.subscribe(*this, "message_queue");
- subs.run();
-}
-
-void Listener::editUrlList(std::vector<Url>& urls)
-{
- /**
- * A more realistic algorithm would be to search through the list
- * for prefered hosts and ensure they come first in the list.
- */
- if (urls.size() > 1) std::rotate(urls.begin(), urls.begin() + 1, urls.end());
-}
-
-int main(int argc, char ** argv)
-{
- ConnectionSettings settings;
- if (argc > 1) settings.host = argv[1];
- if (argc > 2) settings.port = atoi(argv[2]);
-
- Listener listener;
- FailoverManager connection(settings, &listener);
-
- try {
- connection.execute(listener);
- connection.close();
- listener.check();
- std::cout << "Completed without error." << std::endl;
- return 0;
- } catch(const std::exception& error) {
- std::cout << "Failure: " << error.what() << std::endl;
- }
- return 1;
-}
-
-
-
diff --git a/M4-RCs/qpid/cpp/examples/fanout/Makefile.am b/M4-RCs/qpid/cpp/examples/fanout/Makefile.am
deleted file mode 100644
index 6cbf2c93ad..0000000000
--- a/M4-RCs/qpid/cpp/examples/fanout/Makefile.am
+++ /dev/null
@@ -1,47 +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.
-#
-examplesdir=$(pkgdatadir)/examples/fanout
-
-include $(top_srcdir)/examples/makedist.mk
-
-noinst_PROGRAMS=fanout_producer listener
-fanout_producer_SOURCES=fanout_producer.cpp
-fanout_producer_LDADD=$(CLIENT_LIB)
-
-listener_SOURCES=listener.cpp
-listener_LDADD=$(CLIENT_LIB)
-
-examples_DATA= \
- fanout_producer.cpp \
- listener.cpp \
- $(MAKEDIST)
-
-EXTRA_DIST= \
- $(examples_DATA) \
- verify \
- verify.in \
- verify_cpp_python \
- verify_cpp_python.in \
- verify_python_cpp \
- verify_python_cpp.in
-
-
-
-
-
diff --git a/M4-RCs/qpid/cpp/examples/fanout/fanout_producer.cpp b/M4-RCs/qpid/cpp/examples/fanout/fanout_producer.cpp
deleted file mode 100644
index fb16f7e8b1..0000000000
--- a/M4-RCs/qpid/cpp/examples/fanout/fanout_producer.cpp
+++ /dev/null
@@ -1,106 +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.
- *
- */
-
-
-/**
- * fanout_producer.cpp:
- *
- * This program is one of two programs designed to be used
- * together.
- *
- * fanout_producer.cpp (this program):
- *
- * Publishes messages to the "amq.fanout" exchange.
- *
- * listener.cpp
- *
- * Creates a private queue, binds it to the "amq.fanout"
- * exchange, and reads messages from its queue as they
- * arrive. Messages sent before the listener binds the queue are
- * not received.
- *
- * Multiple listeners can run at the same time.
- *
- */
-
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/AsyncSession.h>
-#include <qpid/client/Message.h>
-
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-#include <sstream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using std::stringstream;
-using std::string;
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
-
- Connection connection;
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
- //--------- Main body of program --------------------------------------------
-
- // Unlike topic exchanges and direct exchanges, a fanout
- // exchange need not set a routing key.
-
- Message message;
-
- // Now send some messages ...
-
- for (int i=0; i<10; i++) {
- stringstream message_data;
- message_data << "Message " << i;
-
- message.setData(message_data.str());
- // Asynchronous transfer sends messages as quickly as
- // possible without waiting for confirmation.
- async(session).messageTransfer(arg::content=message, arg::destination="amq.fanout");
- }
-
- // And send a final message to indicate termination.
-
- message.setData("That's all, folks!");
- session.messageTransfer(arg::content=message, arg::destination="amq.fanout");
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/examples/fanout/listener.cpp b/M4-RCs/qpid/cpp/examples/fanout/listener.cpp
deleted file mode 100644
index b6050ef728..0000000000
--- a/M4-RCs/qpid/cpp/examples/fanout/listener.cpp
+++ /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.
- *
- */
-
-
-/**
- * listener.cpp
- *
- * This program is one of two programs designed to be used
- * together.
- *
- * fanout_producer.cpp
- *
- * Publishes messages to the "amq.fanout" exchange.
- *
- * listener.cpp (this program)
- *
- * Creates a private queue, binds it to the "amq.fanout"
- * exchange, and reads messages from its queue as they
- * arrive. Messages sent before the listener binds the queue are
- * not received.
- *
- * Multiple listeners can run at the same time.
- *
- */
-
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/MessageListener.h>
-#include <qpid/client/SubscriptionManager.h>
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-
-class Listener : public MessageListener{
- private:
- SubscriptionManager& subscriptions;
- public:
- Listener(SubscriptionManager& subscriptions);
- virtual void received(Message& message);
-};
-
-Listener::Listener(SubscriptionManager& subs) : subscriptions(subs)
-{}
-
-void Listener::received(Message& message) {
- std::cout << "Message: " << message.getData() << std::endl;
- if (message.getData() == "That's all, folks!") {
- std::cout << "Shutting down listener for " << message.getDestination()
- << std::endl;
- subscriptions.cancel(message.getDestination());
- }
-}
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
-
- Connection connection;
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
- //--------- Main body of program --------------------------------------------
-
- // Each client creates its own private queue, using the
- // session id to guarantee a unique name. It then routes
- // all messages from the fanout exchange to its own queue
- // by binding to the queue.
- //
- // The binding specifies a binding key, but for a fanout
- // exchange, the binding key is optional and is not used
- // for routing decisions. It can be useful for tracking
- // messages and routing in logs.
-
- std::string myQueue=session.getId().getName();
- session.queueDeclare(arg::queue=myQueue, arg::exclusive=true,
- arg::autoDelete=true);
-
- session.exchangeBind(arg::exchange="amq.fanout", arg::queue=myQueue, arg::bindingKey="my-key");
-
- // Create a listener and subscribe it to my queue.
- SubscriptionManager subscriptions(session);
- Listener listener(subscriptions);
- subscriptions.subscribe(listener, myQueue);
-
- // Receive messages until the subscription is cancelled
- // by Listener::received()
- std::cout << "Listening" << std::endl;
- subscriptions.run();
-
- //---------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/examples/fanout/verify b/M4-RCs/qpid/cpp/examples/fanout/verify
deleted file mode 100644
index 2eaadff56b..0000000000
--- a/M4-RCs/qpid/cpp/examples/fanout/verify
+++ /dev/null
@@ -1,25 +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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-background "Listening" ./listener
-background "Listening" ./listener
-background "Listening" ./listener
-clients ./fanout_producer
-outputs ./fanout_producer.out "./listener.out | remove_uuid" "./listenerX.out | remove_uuid" "./listenerXX.out | remove_uuid"
diff --git a/M4-RCs/qpid/cpp/examples/fanout/verify.in b/M4-RCs/qpid/cpp/examples/fanout/verify.in
deleted file mode 100644
index 8f8612ce67..0000000000
--- a/M4-RCs/qpid/cpp/examples/fanout/verify.in
+++ /dev/null
@@ -1,43 +0,0 @@
-==== fanout_producer.out
-==== listener.out | remove_uuid
-Listening
-Message: Message 0
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: That's all, folks!
-Shutting down listener for
-==== listenerX.out | remove_uuid
-Listening
-Message: Message 0
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: That's all, folks!
-Shutting down listener for
-==== listenerXX.out | remove_uuid
-Listening
-Message: Message 0
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: That's all, folks!
-Shutting down listener for
diff --git a/M4-RCs/qpid/cpp/examples/fanout/verify_cpp_python b/M4-RCs/qpid/cpp/examples/fanout/verify_cpp_python
deleted file mode 100644
index 6a1ba7ad7d..0000000000
--- a/M4-RCs/qpid/cpp/examples/fanout/verify_cpp_python
+++ /dev/null
@@ -1,7 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/fanout
-background "Subscribed" $py/fanout_consumer.py
-background "Subscribed" $py/fanout_consumer.py
-clients ./fanout_producer
-outputs ./fanout_producer.out "$py/fanout_consumer.py.out | remove_uuid" "$py/fanout_consumer.pyX.out | remove_uuid"
-
diff --git a/M4-RCs/qpid/cpp/examples/fanout/verify_cpp_python.in b/M4-RCs/qpid/cpp/examples/fanout/verify_cpp_python.in
deleted file mode 100644
index 21bafe06de..0000000000
--- a/M4-RCs/qpid/cpp/examples/fanout/verify_cpp_python.in
+++ /dev/null
@@ -1,27 +0,0 @@
-==== fanout_producer.out
-==== fanout_consumer.py.out | remove_uuid
-Subscribed to queue
-Message 0
-Message 1
-Message 2
-Message 3
-Message 4
-Message 5
-Message 6
-Message 7
-Message 8
-Message 9
-That's all, folks!
-==== fanout_consumer.pyX.out | remove_uuid
-Subscribed to queue
-Message 0
-Message 1
-Message 2
-Message 3
-Message 4
-Message 5
-Message 6
-Message 7
-Message 8
-Message 9
-That's all, folks!
diff --git a/M4-RCs/qpid/cpp/examples/fanout/verify_python_cpp b/M4-RCs/qpid/cpp/examples/fanout/verify_python_cpp
deleted file mode 100644
index d9b3361523..0000000000
--- a/M4-RCs/qpid/cpp/examples/fanout/verify_python_cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/fanout
-background "Listening" ./listener
-background "Listening" ./listener
-clients $py/fanout_producer.py
-outputs $py/fanout_producer.py.out "./listener.out | remove_uuid" "./listenerX.out | remove_uuid"
-
diff --git a/M4-RCs/qpid/cpp/examples/fanout/verify_python_cpp.in b/M4-RCs/qpid/cpp/examples/fanout/verify_python_cpp.in
deleted file mode 100644
index 8f9e959053..0000000000
--- a/M4-RCs/qpid/cpp/examples/fanout/verify_python_cpp.in
+++ /dev/null
@@ -1,29 +0,0 @@
-==== fanout_producer.py.out
-==== listener.out | remove_uuid
-Listening
-Message: message 0
-Message: message 1
-Message: message 2
-Message: message 3
-Message: message 4
-Message: message 5
-Message: message 6
-Message: message 7
-Message: message 8
-Message: message 9
-Message: That's all, folks!
-Shutting down listener for
-==== listenerX.out | remove_uuid
-Listening
-Message: message 0
-Message: message 1
-Message: message 2
-Message: message 3
-Message: message 4
-Message: message 5
-Message: message 6
-Message: message 7
-Message: message 8
-Message: message 9
-Message: That's all, folks!
-Shutting down listener for
diff --git a/M4-RCs/qpid/cpp/examples/makedist.mk b/M4-RCs/qpid/cpp/examples/makedist.mk
deleted file mode 100644
index 4345378983..0000000000
--- a/M4-RCs/qpid/cpp/examples/makedist.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-# Settings to build the examples in automake
-AM_CXXFLAGS = $(WARNING_CFLAGS)
-INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/gen -I$(top_builddir)/src -I$(top_builddir)/src/gen
-CLIENT_LIB=$(top_builddir)/src/libqpidclient.la
-CONSOLE_LIB=$(top_builddir)/src/libqmfconsole.la
-MAKELDFLAG ?= qpidclient
-
-# Generate a simple non-automake Makefile for distribution.
-MAKEDIST=.libs/Makefile
-
-$(MAKEDIST): Makefile
- mkdir -p .libs
- @$(ECHO) CXX=$(CXX) > $(MAKEDIST)
- @$(ECHO) CXXFLAGS=$(CXXFLAGS) >> $(MAKEDIST)
- @$(ECHO) LDFLAGS=-l$(MAKELDFLAG) >> $(MAKEDIST)
- @$(ECHO) >> $(MAKEDIST)
- @$(ECHO) all: $(noinst_PROGRAMS) >> $(MAKEDIST)
- @$(ECHO) >> $(MAKEDIST)
- @$(ECHO) clean: >> $(MAKEDIST)
- @$(ECHO) " rm -f $(noinst_PROGRAMS)" >> $(MAKEDIST)
-
-
diff --git a/M4-RCs/qpid/cpp/examples/pub-sub/Makefile.am b/M4-RCs/qpid/cpp/examples/pub-sub/Makefile.am
deleted file mode 100644
index bdbf0f8d20..0000000000
--- a/M4-RCs/qpid/cpp/examples/pub-sub/Makefile.am
+++ /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.
-#
-examplesdir=$(pkgdatadir)/examples/pub-sub
-
-include $(top_srcdir)/examples/makedist.mk
-
-noinst_PROGRAMS=topic_listener topic_publisher
-
-topic_listener_SOURCES=topic_listener.cpp
-topic_listener_LDADD=$(CLIENT_LIB)
-
-topic_publisher_SOURCES=topic_publisher.cpp
-topic_publisher_LDADD=$(CLIENT_LIB)
-
-examples_DATA= \
- topic_listener.cpp \
- topic_publisher.cpp \
- $(MAKEDIST)
-
-EXTRA_DIST= \
- $(examples_DATA) \
- verify \
- verify.in \
- verify_cpp_python \
- verify_cpp_python.in \
- verify_python_cpp \
- verify_python_cpp.in
-
-
-
-
-
diff --git a/M4-RCs/qpid/cpp/examples/pub-sub/topic_listener.cpp b/M4-RCs/qpid/cpp/examples/pub-sub/topic_listener.cpp
deleted file mode 100644
index fe0280cb7e..0000000000
--- a/M4-RCs/qpid/cpp/examples/pub-sub/topic_listener.cpp
+++ /dev/null
@@ -1,174 +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.
- *
- */
-
-/**
- * topic_listener.cpp:
- *
- * This program is one of two programs designed to be used
- * together. These programs implement a publish-subscribe example
- * using the "amq.topic" exchange.
- *
- * topic_publisher.cpp
- *
- * Sends messages to the "amq.topic" exchange, using the
- * multipart routing keys "usa.news", "usa.weather",
- * "europe.news", and "europe.weather".
- *
- * topic_listener.cpp (this program)
- *
- * Creates private queues for "news", "weather", "usa", and
- * "europe", binding them to the amq.topic exchange using
- * bindings that match the corresponding parts of the multipart
- * routing keys.
- *
- * Multiple listeners can be run at the same time.
- *
- */
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/MessageListener.h>
-#include <qpid/client/SubscriptionManager.h>
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-
-class Listener : public MessageListener {
- private:
- Session& session;
- SubscriptionManager subscriptions;
- public:
- Listener(Session& session);
- virtual void prepareQueue(std::string queue, std::string exchange, std::string routing_key);
- virtual void received(Message& message);
- virtual void listen();
- ~Listener() { };
-};
-
-
-/*
- * Listener::Listener
- *
- * Subscribe to the queue, route it to a client destination for the
- * listener. (The destination name merely identifies the destination
- * in the listener, you can use any name as long as you use the same
- * name for the listener).
- */
-
-Listener::Listener(Session& session) :
- session(session),
- subscriptions(session)
-{
-}
-
-
-void Listener::prepareQueue(std::string queue, std::string exchange, std::string routing_key) {
-
- /* Create a unique queue name for this consumer by concatenating
- * the queue name parameter with the Session ID.
- */
-
- queue += session.getId().getName();
- std::cout << "Declaring queue: " << queue << std::endl;
-
- /* Declare an exclusive queue on the broker
- */
-
- session.queueDeclare(arg::queue=queue, arg::exclusive=true, arg::autoDelete=true);
-
- /* Route messages to the new queue if they match the routing key.
- *
- * Also route any messages to with the "control" routing key to
- * this queue so we know when it's time to stop. A publisher sends
- * a message with the content "That's all, Folks!", using the
- * "control" routing key, when it is finished.
- */
-
- session.exchangeBind(arg::exchange=exchange, arg::queue=queue, arg::bindingKey=routing_key);
- session.exchangeBind(arg::exchange=exchange, arg::queue=queue, arg::bindingKey="control");
-
- /*
- * subscribe to the queue using the subscription manager.
- */
-
- std::cout << "Subscribing to queue " << queue << std::endl;
- subscriptions.subscribe(*this, queue);
-}
-
-void Listener::received(Message& message) {
- std::cout << "Message: " << message.getData() << " from " << message.getDestination() << std::endl;
-
- if (message.getData() == "That's all, folks!") {
- std::cout << "Shutting down listener for " << message.getDestination() << std::endl;
- subscriptions.cancel(message.getDestination());
- }
-}
-
-void Listener::listen() {
- // Receive messages
- subscriptions.run();
-}
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
- std::string exchange = argc>3 ? argv[3] : "amq.topic";
- Connection connection;
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
- //--------- Main body of program --------------------------------------------
-
- // Create a listener for the session
-
- Listener listener(session);
-
- // Subscribe to messages on the queues we are interested in
-
- listener.prepareQueue("usa", exchange, "usa.#");
- listener.prepareQueue("europe", exchange, "europe.#");
- listener.prepareQueue("news", exchange, "#.news");
- listener.prepareQueue("weather", exchange, "#.weather");
-
- std::cout << "Listening for messages ..." << std::endl;
-
- // Give up control and receive messages
- listener.listen();
-
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/examples/pub-sub/topic_publisher.cpp b/M4-RCs/qpid/cpp/examples/pub-sub/topic_publisher.cpp
deleted file mode 100644
index 72ba572f75..0000000000
--- a/M4-RCs/qpid/cpp/examples/pub-sub/topic_publisher.cpp
+++ /dev/null
@@ -1,130 +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.
- *
- */
-
-/**
- * topic_publisher.cpp:
- *
- * This program is one of two programs designed to be used
- * together. These programs implement a publish-subscribe example
- * using the "amq.topic" exchange.
- *
- * topic_publisher.cpp (this program)
- *
- * Sends messages to the "amq.topic" exchange, using the
- * multipart routing keys "usa.news", "usa.weather",
- * "europe.news", and "europe.weather".
- *
- * topic_listener.cpp
- *
- * Creates private queues for "news", "weather", "usa", and
- * "europe", binding them to the amq.topic exchange using
- * bindings that match the corresponding parts of the multipart
- * routing keys.
- *
- * Multiple listeners can be run at the same time.
- *
- */
-
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/AsyncSession.h>
-#include <qpid/client/Message.h>
-
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-#include <sstream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using std::stringstream;
-using std::string;
-
-void publish_messages(Session& session, string routing_key)
-{
- Message message;
-
- // Set the routing key once, we'll use the same routing key for all
- // messages.
-
- message.getDeliveryProperties().setRoutingKey(routing_key);
- for (int i=0; i<5; i++) {
- stringstream message_data;
- message_data << "Message " << i;
-
- message.setData(message_data.str());
- // Asynchronous transfer sends messages as quickly as
- // possible without waiting for confirmation.
- async(session).messageTransfer(arg::content=message, arg::destination="amq.topic");
- }
-
-}
-
-/*
- * no_more_messages()
- *
- * Send a message to indicate that no more messages are coming.
- * Use the 'control' routing key (see comments in topic_config_queues.cpp).
- *
- */
-
-void no_more_messages(Session& session)
-{
- Message message;
-
- message.getDeliveryProperties().setRoutingKey("control");
- message.setData("That's all, folks!");
- session.messageTransfer(arg::content=message, arg::destination="amq.topic");
-}
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
-
- Connection connection;
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
- //--------- Main body of program --------------------------------------------
-
- publish_messages(session, "usa.news");
- publish_messages(session, "usa.weather");
- publish_messages(session, "europe.news");
- publish_messages(session, "europe.weather");
-
- no_more_messages(session);
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/examples/pub-sub/verify b/M4-RCs/qpid/cpp/examples/pub-sub/verify
deleted file mode 100644
index 528d2f401e..0000000000
--- a/M4-RCs/qpid/cpp/examples/pub-sub/verify
+++ /dev/null
@@ -1,23 +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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-background "Listening" ./topic_listener
-clients ./topic_publisher
-outputs ./topic_publisher.out "topic_listener.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/cpp/examples/pub-sub/verify.in b/M4-RCs/qpid/cpp/examples/pub-sub/verify.in
deleted file mode 100644
index 6413c5c788..0000000000
--- a/M4-RCs/qpid/cpp/examples/pub-sub/verify.in
+++ /dev/null
@@ -1,59 +0,0 @@
-==== topic_publisher.out
-==== topic_listener.out | remove_uuid | sort
-Declaring queue: europe
-Declaring queue: news
-Declaring queue: usa
-Declaring queue: weather
-Listening for messages ...
-Message: Message 0 from europe
-Message: Message 0 from europe
-Message: Message 0 from news
-Message: Message 0 from news
-Message: Message 0 from usa
-Message: Message 0 from usa
-Message: Message 0 from weather
-Message: Message 0 from weather
-Message: Message 1 from europe
-Message: Message 1 from europe
-Message: Message 1 from news
-Message: Message 1 from news
-Message: Message 1 from usa
-Message: Message 1 from usa
-Message: Message 1 from weather
-Message: Message 1 from weather
-Message: Message 2 from europe
-Message: Message 2 from europe
-Message: Message 2 from news
-Message: Message 2 from news
-Message: Message 2 from usa
-Message: Message 2 from usa
-Message: Message 2 from weather
-Message: Message 2 from weather
-Message: Message 3 from europe
-Message: Message 3 from europe
-Message: Message 3 from news
-Message: Message 3 from news
-Message: Message 3 from usa
-Message: Message 3 from usa
-Message: Message 3 from weather
-Message: Message 3 from weather
-Message: Message 4 from europe
-Message: Message 4 from europe
-Message: Message 4 from news
-Message: Message 4 from news
-Message: Message 4 from usa
-Message: Message 4 from usa
-Message: Message 4 from weather
-Message: Message 4 from weather
-Message: That's all, folks! from europe
-Message: That's all, folks! from news
-Message: That's all, folks! from usa
-Message: That's all, folks! from weather
-Shutting down listener for europe
-Shutting down listener for news
-Shutting down listener for usa
-Shutting down listener for weather
-Subscribing to queue europe
-Subscribing to queue news
-Subscribing to queue usa
-Subscribing to queue weather
diff --git a/M4-RCs/qpid/cpp/examples/pub-sub/verify_cpp_python b/M4-RCs/qpid/cpp/examples/pub-sub/verify_cpp_python
deleted file mode 100644
index f6c6850981..0000000000
--- a/M4-RCs/qpid/cpp/examples/pub-sub/verify_cpp_python
+++ /dev/null
@@ -1,6 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/pubsub
-background "Queues created" $py/topic_subscriber.py
-clients ./topic_publisher
-outputs ./topic_publisher.out "$py/topic_subscriber.py.out | remove_uuid | sort"
-
diff --git a/M4-RCs/qpid/cpp/examples/pub-sub/verify_cpp_python.in b/M4-RCs/qpid/cpp/examples/pub-sub/verify_cpp_python.in
deleted file mode 100644
index 951d9ad9dd..0000000000
--- a/M4-RCs/qpid/cpp/examples/pub-sub/verify_cpp_python.in
+++ /dev/null
@@ -1,55 +0,0 @@
-==== topic_publisher.out
-==== topic_subscriber.py.out | remove_uuid | sort
-Message 0
-Message 0
-Message 0
-Message 0
-Message 0
-Message 0
-Message 0
-Message 0
-Message 1
-Message 1
-Message 1
-Message 1
-Message 1
-Message 1
-Message 1
-Message 1
-Message 2
-Message 2
-Message 2
-Message 2
-Message 2
-Message 2
-Message 2
-Message 2
-Message 3
-Message 3
-Message 3
-Message 3
-Message 3
-Message 3
-Message 3
-Message 3
-Message 4
-Message 4
-Message 4
-Message 4
-Message 4
-Message 4
-Message 4
-Message 4
-Messages on 'europe' queue:
-Messages on 'news' queue:
-Messages on 'usa' queue:
-Messages on 'weather' queue:
-Queues created - please start the topic producer
-Subscribing local queue 'local_europe' to europe-'
-Subscribing local queue 'local_news' to news-'
-Subscribing local queue 'local_usa' to usa-'
-Subscribing local queue 'local_weather' to weather-'
-That's all, folks!
-That's all, folks!
-That's all, folks!
-That's all, folks!
diff --git a/M4-RCs/qpid/cpp/examples/pub-sub/verify_python_cpp b/M4-RCs/qpid/cpp/examples/pub-sub/verify_python_cpp
deleted file mode 100644
index 2ddaad58c2..0000000000
--- a/M4-RCs/qpid/cpp/examples/pub-sub/verify_python_cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/pubsub
-background "Listening" ./topic_listener
-clients $py/topic_publisher.py
-outputs $py/topic_publisher.py.out "topic_listener.out | remove_uuid | sort"
-
diff --git a/M4-RCs/qpid/cpp/examples/pub-sub/verify_python_cpp.in b/M4-RCs/qpid/cpp/examples/pub-sub/verify_python_cpp.in
deleted file mode 100644
index 52e8db9d72..0000000000
--- a/M4-RCs/qpid/cpp/examples/pub-sub/verify_python_cpp.in
+++ /dev/null
@@ -1,59 +0,0 @@
-==== topic_publisher.py.out
-==== topic_listener.out | remove_uuid | sort
-Declaring queue: europe
-Declaring queue: news
-Declaring queue: usa
-Declaring queue: weather
-Listening for messages ...
-Message: europe.news 0 from europe
-Message: europe.news 0 from news
-Message: europe.news 1 from europe
-Message: europe.news 1 from news
-Message: europe.news 2 from europe
-Message: europe.news 2 from news
-Message: europe.news 3 from europe
-Message: europe.news 3 from news
-Message: europe.news 4 from europe
-Message: europe.news 4 from news
-Message: europe.weather 0 from europe
-Message: europe.weather 0 from weather
-Message: europe.weather 1 from europe
-Message: europe.weather 1 from weather
-Message: europe.weather 2 from europe
-Message: europe.weather 2 from weather
-Message: europe.weather 3 from europe
-Message: europe.weather 3 from weather
-Message: europe.weather 4 from europe
-Message: europe.weather 4 from weather
-Message: That's all, folks! from europe
-Message: That's all, folks! from news
-Message: That's all, folks! from usa
-Message: That's all, folks! from weather
-Message: usa.news 0 from news
-Message: usa.news 0 from usa
-Message: usa.news 1 from news
-Message: usa.news 1 from usa
-Message: usa.news 2 from news
-Message: usa.news 2 from usa
-Message: usa.news 3 from news
-Message: usa.news 3 from usa
-Message: usa.news 4 from news
-Message: usa.news 4 from usa
-Message: usa.weather 0 from usa
-Message: usa.weather 0 from weather
-Message: usa.weather 1 from usa
-Message: usa.weather 1 from weather
-Message: usa.weather 2 from usa
-Message: usa.weather 2 from weather
-Message: usa.weather 3 from usa
-Message: usa.weather 3 from weather
-Message: usa.weather 4 from usa
-Message: usa.weather 4 from weather
-Shutting down listener for europe
-Shutting down listener for news
-Shutting down listener for usa
-Shutting down listener for weather
-Subscribing to queue europe
-Subscribing to queue news
-Subscribing to queue usa
-Subscribing to queue weather
diff --git a/M4-RCs/qpid/cpp/examples/qmf-agent/Makefile b/M4-RCs/qpid/cpp/examples/qmf-agent/Makefile
deleted file mode 100644
index 4c5daa6888..0000000000
--- a/M4-RCs/qpid/cpp/examples/qmf-agent/Makefile
+++ /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.
-#
-
-SRC_DIR = .
-QPID_DIR = ../../..
-SCHEMA_FILE = $(SRC_DIR)/schema.xml
-GEN_DIR = $(SRC_DIR)/gen
-OUT_FILE = $(SRC_DIR)/qmf-agent
-
-CC = gcc
-LIB_DIR = $(QPID_DIR)/cpp/src/.libs
-CC_INCLUDES = -I$(SRC_DIR) -I$(QPID_DIR)/cpp/src -I$(QPID_DIR)/cpp/src/gen -I$(GEN_DIR)
-CC_FLAGS = -g -O3
-LD_FLAGS = -lqmfagent -L$(LIB_DIR)
-SPEC_DIR = $(QPID_DIR)/specs
-MGEN_DIR = $(QPID_DIR)/cpp/managementgen
-MGEN = $(MGEN_DIR)/qmf-gen
-
-vpath %.cpp $(SRC_DIR):$(GEN_DIR)
-vpath %.d $(OBJ_DIR)
-vpath %.o $(OBJ_DIR)
-
-cpps = $(wildcard $(SRC_DIR)/*.cpp)
-cpps += $(wildcard $(GEN_DIR)/qmf/org/apache/qpid/agent/example/*.cpp)
-deps = $(addsuffix .d, $(basename $(cpps)))
-objects = $(addsuffix .o, $(basename $(cpps)))
-
-.PHONY: all clean gen
-
-#==========================================================
-# Pass 0: generate source files from schema
-ifeq ($(MAKELEVEL), 0)
-
-all: gen
- @$(MAKE)
-
-gen:
- $(MGEN) -o $(GEN_DIR)/qmf $(SCHEMA_FILE)
-
-clean:
- rm -rf $(GEN_DIR) $(OUT_FILE) *.d *.o
-
-
-#==========================================================
-# Pass 1: generate dependencies
-else ifeq ($(MAKELEVEL), 1)
-
-all: $(deps)
- @$(MAKE)
-
-%.d : %.cpp
- $(CC) -M $(CC_FLAGS) $(CC_INCLUDES) $< > $@
-
-
-#==========================================================
-# Pass 2: build project
-else ifeq ($(MAKELEVEL), 2)
-
-$(OUT_FILE) : $(objects)
- $(CC) -o $(OUT_FILE) $(CC_FLAGS) $(LD_FLAGS) $(objects)
-
-include $(deps)
-
-%.o : %.cpp
- $(CC) -c $(CC_FLAGS) $(CC_INCLUDES) -o $@ $<
-
-endif
-
-
diff --git a/M4-RCs/qpid/cpp/examples/qmf-agent/example.cpp b/M4-RCs/qpid/cpp/examples/qmf-agent/example.cpp
deleted file mode 100644
index 4dec014370..0000000000
--- a/M4-RCs/qpid/cpp/examples/qmf-agent/example.cpp
+++ /dev/null
@@ -1,200 +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 <qpid/management/Manageable.h>
-#include <qpid/management/ManagementObject.h>
-#include <qpid/agent/ManagementAgent.h>
-#include <qpid/sys/Mutex.h>
-#include "qmf/org/apache/qpid/agent/example/Parent.h"
-#include "qmf/org/apache/qpid/agent/example/Child.h"
-#include "qmf/org/apache/qpid/agent/example/ArgsParentCreate_child.h"
-#include "qmf/org/apache/qpid/agent/example/EventChildCreated.h"
-#include "qmf/org/apache/qpid/agent/example/Package.h"
-
-#include <signal.h>
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-#include <sstream>
-
-using namespace std;
-using qpid::management::ManagementAgent;
-using qpid::management::ManagementObject;
-using qpid::management::Manageable;
-using qpid::management::Args;
-using qpid::sys::Mutex;
-namespace _qmf = qmf::org::apache::qpid::agent::example;
-
-class ChildClass;
-
-//==============================================================
-// CoreClass is the operational class that corresponds to the
-// "Parent" class in the management schema.
-//==============================================================
-class CoreClass : public Manageable
-{
- string name;
- ManagementAgent* agent;
- _qmf::Parent* mgmtObject;
- std::vector<ChildClass*> children;
- Mutex vectorLock;
-
-public:
-
- CoreClass(ManagementAgent* agent, string _name);
- ~CoreClass() { mgmtObject->resourceDestroy(); }
-
- ManagementObject* GetManagementObject(void) const
- { return mgmtObject; }
-
- void doLoop();
- status_t ManagementMethod (uint32_t methodId, Args& args, string& text);
-};
-
-class ChildClass : public Manageable
-{
- string name;
- _qmf::Child* mgmtObject;
-
-public:
-
- ChildClass(ManagementAgent* agent, CoreClass* parent, string name);
- ~ChildClass() { mgmtObject->resourceDestroy(); }
-
- ManagementObject* GetManagementObject(void) const
- { return mgmtObject; }
-
- void doWork()
- {
- mgmtObject->inc_count(2);
- }
-};
-
-CoreClass::CoreClass(ManagementAgent* _agent, string _name) : name(_name), agent(_agent)
-{
- static uint64_t persistId = 0x111222333444555LL;
- mgmtObject = new _qmf::Parent(agent, this, name);
-
- agent->addObject(mgmtObject, persistId++);
- mgmtObject->set_state("IDLE");
-}
-
-void CoreClass::doLoop()
-{
- // Periodically bump a counter to provide a changing statistical value
- while (1) {
- sleep(1);
- mgmtObject->inc_count();
- mgmtObject->set_state("IN_LOOP");
-
- {
- Mutex::ScopedLock _lock(vectorLock);
-
- for (std::vector<ChildClass*>::iterator iter = children.begin();
- iter != children.end();
- iter++) {
- (*iter)->doWork();
- }
- }
- }
-}
-
-Manageable::status_t CoreClass::ManagementMethod(uint32_t methodId, Args& args, string& /*text*/)
-{
- Mutex::ScopedLock _lock(vectorLock);
-
- switch (methodId) {
- case _qmf::Parent::METHOD_CREATE_CHILD:
- _qmf::ArgsParentCreate_child& ioArgs = (_qmf::ArgsParentCreate_child&) args;
-
- ChildClass *child = new ChildClass(agent, this, ioArgs.i_name);
- ioArgs.o_childRef = child->GetManagementObject()->getObjectId();
-
- children.push_back(child);
-
- agent->raiseEvent(_qmf::EventChildCreated(ioArgs.i_name));
-
- return STATUS_OK;
- }
-
- return STATUS_NOT_IMPLEMENTED;
-}
-
-ChildClass::ChildClass(ManagementAgent* agent, CoreClass* parent, string name)
-{
- mgmtObject = new _qmf::Child(agent, this, parent, name);
-
- agent->addObject(mgmtObject);
-}
-
-
-//==============================================================
-// Main program
-//==============================================================
-
-ManagementAgent::Singleton* singleton;
-
-void shutdown(int)
-{
- delete singleton;
- exit(0);
-}
-
-int main_int(int argc, char** argv)
-{
- singleton = new ManagementAgent::Singleton();
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
- qpid::client::ConnectionSettings settings;
-
- settings.host = host;
- settings.port = port;
-
- signal(SIGINT, shutdown);
-
- // Create the qmf management agent
- ManagementAgent* agent = singleton->getInstance();
-
- // Register the Qmf_example schema with the agent
- _qmf::Package packageInit(agent);
-
- // Start the agent. It will attempt to make a connection to the
- // management broker
- agent->init(settings, 5, false, ".magentdata");
-
- // Allocate some core objects
- CoreClass core1(agent, "Example Core Object #1");
- CoreClass core2(agent, "Example Core Object #2");
- CoreClass core3(agent, "Example Core Object #3");
-
- core1.doLoop();
-}
-
-int main(int argc, char** argv)
-{
- try {
- return main_int(argc, argv);
- } catch(std::exception& e) {
- cout << "Top Level Exception: " << e.what() << endl;
- }
-}
-
diff --git a/M4-RCs/qpid/cpp/examples/qmf-agent/schema.xml b/M4-RCs/qpid/cpp/examples/qmf-agent/schema.xml
deleted file mode 100644
index 1bf701a655..0000000000
--- a/M4-RCs/qpid/cpp/examples/qmf-agent/schema.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<schema package="org.apache.qpid.agent.example">
-
-<!--
- 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.
--->
-
- <!--
- ===============================================================
- Parent
- ===============================================================
- -->
- <class name="Parent">
-
- This class represents a parent object
-
- <property name="name" type="sstr" access="RC" index="y"/>
-
- <statistic name="state" type="sstr" desc="Operational state of the link"/>
- <statistic name="count" type="count64" unit="tick" desc="Counter that increases monotonically"/>
-
- <method name="create_child" desc="Create child object">
- <arg name="name" dir="I" type="sstr"/>
- <arg name="childRef" dir="O" type="objId"/>
- </method>
- </class>
-
-
- <!--
- ===============================================================
- Child
- ===============================================================
- -->
- <class name="Child">
- <property name="ParentRef" type="objId" references="Parent" access="RC" index="y" parentRef="y"/>
- <property name="name" type="sstr" access="RC" index="y"/>
-
- <statistic name="count" type="count64" unit="tick" desc="Counter that increases monotonically"/>
-
- <method name="delete"/>
- </class>
-
- <eventArguments>
- <arg name="childName" type="sstr"/>
- </eventArguments>
-
- <event name="ChildCreated" args="childName"/>
- <event name="ChildDestroyed" args="childName"/>
-</schema>
-
diff --git a/M4-RCs/qpid/cpp/examples/qmf-console/Makefile.am b/M4-RCs/qpid/cpp/examples/qmf-console/Makefile.am
deleted file mode 100644
index e115fc0fb0..0000000000
--- a/M4-RCs/qpid/cpp/examples/qmf-console/Makefile.am
+++ /dev/null
@@ -1,41 +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.
-#
-
-examplesdir=$(pkgdatadir)/examples/qmf-console
-
-MAKELDFLAG = qmfconsole
-include $(top_srcdir)/examples/makedist.mk
-
-noinst_PROGRAMS=console printevents ping
-
-console_SOURCES=console.cpp
-console_LDADD=$(CONSOLE_LIB)
-
-printevents_SOURCES=printevents.cpp
-printevents_LDADD=$(CONSOLE_LIB)
-
-ping_SOURCES=ping.cpp
-ping_LDADD=$(CONSOLE_LIB)
-
-examples_DATA= \
- console.cpp \
- printevents.cpp \
- ping.cpp \
- $(MAKEDIST)
-
diff --git a/M4-RCs/qpid/cpp/examples/qmf-console/console.cpp b/M4-RCs/qpid/cpp/examples/qmf-console/console.cpp
deleted file mode 100644
index 5700d5556f..0000000000
--- a/M4-RCs/qpid/cpp/examples/qmf-console/console.cpp
+++ /dev/null
@@ -1,150 +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 "qpid/console/ConsoleListener.h"
-#include "qpid/console/SessionManager.h"
-
-using namespace std;
-using namespace qpid::console;
-
-class Listener : public ConsoleListener {
-public:
- ~Listener() {}
-
- void brokerConnected(const Broker& broker) {
- cout << "brokerConnected: " << broker << endl;
- }
-
- void brokerDisconnected(const Broker& broker) {
- cout << "brokerDisconnected: " << broker << endl;
- }
-
- void newPackage(const std::string& name) {
- cout << "newPackage: " << name << endl;
- }
-
- void newClass(const ClassKey& classKey) {
- cout << "newClass: key=" << classKey << endl;
- }
-
- void newAgent(const Agent& agent) {
- cout << "newAgent: " << agent << endl;
- }
-
- void delAgent(const Agent& agent) {
- cout << "delAgent: " << agent << endl;
- }
-
- void objectProps(Broker& broker, Object& object) {
- cout << "objectProps: broker=" << broker << " object=" << object << endl;
- }
-
- void objectStats(Broker& broker, Object& object) {
- cout << "objectStats: broker=" << broker << " object=" << object << endl;
- }
-
- void event(Event& event) {
- cout << "event: " << event << endl;
- }
-};
-
-
-//==============================================================
-// Main program
-//==============================================================
-int main_int(int /*argc*/, char** /*argv*/)
-{
- //Listener listener;
- qpid::client::ConnectionSettings settings;
-
- cout << "Creating SessionManager" << endl;
- SessionManager sm;
- cout << "Adding broker" << endl;
- Broker* broker;
-
- broker = sm.addBroker(settings);
-
- cout << "Package List:" << endl;
- vector<string> packages;
- sm.getPackages(packages);
- for (vector<string>::iterator iter = packages.begin(); iter != packages.end(); iter++) {
- cout << " " << *iter << endl;
- SessionManager::KeyVector classKeys;
- sm.getClasses(classKeys, *iter);
- for (SessionManager::KeyVector::iterator cIter = classKeys.begin();
- cIter != classKeys.end(); cIter++)
- cout << " " << *cIter << endl;
- }
-
- Object::Vector list;
- cout << "getting exchanges..." << endl;
- sm.getObjects(list, "exchange");
- cout << " returned " << list.size() << " elements" << endl;
-
- for (Object::Vector::iterator i = list.begin(); i != list.end(); i++) {
- cout << "exchange: " << *i << endl;
- }
-
- list.clear();
- cout << "getting queues..." << endl;
- sm.getObjects(list, "queue");
- cout << " returned " << list.size() << " elements" << endl;
-
- for (Object::Vector::iterator i = list.begin(); i != list.end(); i++) {
- cout << "queue: " << *i << endl;
- cout << " bindingCount=" << i->attrUint("bindingCount") << endl;
- cout << " arguments=" << i->attrMap("arguments") << endl;
- }
-
- list.clear();
- sm.getObjects(list, "broker");
- if (list.size() == 1) {
- Object& broker = *list.begin();
-
- cout << "Broker: " << broker << endl;
-
- Object::AttributeMap args;
- MethodResponse result;
- args.addUint("sequence", 1);
- args.addString("body", "Testing...");
-
- cout << "Call echo method..." << endl;
- broker.invokeMethod("echo", args, result);
- cout << "Result: code=" << result.code << " text=" << result.text << endl;
- for (Object::AttributeMap::iterator aIter = result.arguments.begin();
- aIter != result.arguments.end(); aIter++) {
- cout << " Output Arg: " << aIter->first << " => " << aIter->second->str() << endl;
- }
- }
-
- sm.delBroker(broker);
- return 0;
-}
-
-int main(int argc, char** argv)
-{
- try {
- return main_int(argc, argv);
- } catch(std::exception& e) {
- cout << "Top Level Exception: " << e.what() << endl;
- }
-}
-
diff --git a/M4-RCs/qpid/cpp/examples/qmf-console/ping.cpp b/M4-RCs/qpid/cpp/examples/qmf-console/ping.cpp
deleted file mode 100644
index debca7428a..0000000000
--- a/M4-RCs/qpid/cpp/examples/qmf-console/ping.cpp
+++ /dev/null
@@ -1,129 +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 "qpid/console/SessionManager.h"
-
-using namespace std;
-using namespace qpid::console;
-
-//==============================================================
-// Main program
-//==============================================================
-int main_int(int /*argc*/, char** /*argv*/)
-{
- //
- // Declare connection settings for the messaging broker. The settings default to
- // localhost:5672 with user guest (password guest). Refer to the header file
- // <qpid/client/ConnectionSettings.h> for full details.
- //
- qpid::client::ConnectionSettings connSettings;
-
- //
- // Declare the (optional) session manager settings. Override the default timeout
- // for methods calls to be 2 seconds.
- //
- SessionManager::Settings smSettings;
- smSettings.methodTimeout = 2;
-
- //
- // Declare the console session manager. With a null listener argument, it defaults to
- // synchronous-only access mode.
- //
- SessionManager sm(0, smSettings);
-
- //
- // Add a broker connection to the session manager.
- //
- Broker* broker = sm.addBroker(connSettings);
-
- uint32_t count = 5; // The number of echo requests we will send to the broker.
- Object::Vector list; // A container for holding objects retrieved from the broker.
-
- //
- // Query for a list of 'broker' objects from the Management Database
- //
- sm.getObjects(list, "broker");
-
- //
- // We expect one object (since we are connected to only one broker)
- //
- if (list.size() == 1) {
- Object& brokerObject = *(list.begin());
-
- for (uint32_t iter = 0; iter < count; iter++) {
- //
- // Declare a container for arguments to be sent with the "echo" method
- // that we will invoke on the remote "broker" object.
- //
- Object::AttributeMap args;
-
- //
- // Declare a container for the result of the method invocation.
- //
- MethodResponse result;
-
- //
- // Set the values of the input arguments.
- //
- args.addUint("sequence", iter);
- args.addString("body", "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
-
- cout << "Ping Broker: " << broker->getUrl() << "... ";
- cout.flush();
-
- //
- // Invoke the method. This is a synchronous operation that will block until
- // the method completes and returns a result.
- //
- brokerObject.invokeMethod("echo", args, result);
-
- //
- // result.code is the return code (0 => Success)
- // result.text is the return text
- // result.arguments is a container (of type Object::AttributeMap) that holds
- // the output arguments (if any) from the method.
- //
- cout << "Result: code=" << result.code << " text=" << result.text;
- if (result.code == 0)
- cout << " seq=" << result.arguments["sequence"]->asUint();
- cout << endl;
-
- if (result.code == 0 && iter < count - 1)
- ::sleep(1);
- }
- }
-
- //
- // Disconnect the broker from the session manager.
- //
- sm.delBroker(broker);
- return 0;
-}
-
-int main(int argc, char** argv)
-{
- try {
- return main_int(argc, argv);
- } catch(std::exception& e) {
- cout << "Top Level Exception: " << e.what() << endl;
- }
-}
-
diff --git a/M4-RCs/qpid/cpp/examples/qmf-console/printevents.cpp b/M4-RCs/qpid/cpp/examples/qmf-console/printevents.cpp
deleted file mode 100644
index bbec2c1af0..0000000000
--- a/M4-RCs/qpid/cpp/examples/qmf-console/printevents.cpp
+++ /dev/null
@@ -1,105 +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 "qpid/console/ConsoleListener.h"
-#include "qpid/console/SessionManager.h"
-#include "qpid/sys/Time.h"
-
-using namespace std;
-using namespace qpid::console;
-
-//
-// Define a listener class to receive asynchronous events.
-//
-class Listener : public ConsoleListener {
-public:
- void brokerConnected(const Broker& broker) {
- cout << qpid::sys::now() << " NOTIC qpid-printevents:brokerConnected broker=" <<
- broker.getUrl() << endl;
- }
-
- void brokerDisconnected(const Broker& broker) {
- cout << qpid::sys::now() << " NOTIC qpid-printevents:brokerDisonnected broker=" <<
- broker.getUrl() << endl;
- }
-
- void event(Event& event) {
- cout << event << endl;
- }
-};
-
-
-//==============================================================
-// Main program
-//==============================================================
-int main_int(int /*argc*/, char** /*argv*/)
-{
- //
- // Declare an instance of our listener.
- //
- Listener listener;
-
- //
- // Declare connection settings for the messaging broker. The settings default to
- // localhost:5672 with user guest (password guest). Refer to the header file
- // <qpid/client/ConnectionSettings.h> for full details.
- //
- qpid::client::ConnectionSettings connSettings;
-
- //
- // Declare the (optional) session manager settings. Disable the reception of
- // object updates and heartbeats. Note that by disabling the reception of things
- // we don't need, we don't unnecessarily use network bandwidth.
- //
- SessionManager::Settings smSettings;
- smSettings.rcvObjects = false;
- smSettings.rcvHeartbeats = false;
-
- //
- // Declare the console session manager.
- //
- SessionManager sm(&listener, smSettings);
-
- //
- // Add a broker connection to the session manager. If desired, multiple brokers may
- // be connected.
- //
- Broker* broker = sm.addBroker(connSettings);
-
- //
- // Sleep indefinitely while asynchronous events are handled by the listener.
- //
- for (;;)
- ::sleep(1);
-
- sm.delBroker(broker);
- return 0;
-}
-
-int main(int argc, char** argv)
-{
- try {
- return main_int(argc, argv);
- } catch(std::exception& e) {
- cout << "Top Level Exception: " << e.what() << endl;
- }
-}
-
diff --git a/M4-RCs/qpid/cpp/examples/request-response/Makefile.am b/M4-RCs/qpid/cpp/examples/request-response/Makefile.am
deleted file mode 100644
index 8fb95f24fc..0000000000
--- a/M4-RCs/qpid/cpp/examples/request-response/Makefile.am
+++ /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.
-#
-examplesdir=$(pkgdatadir)/examples/request-response
-
-include $(top_srcdir)/examples/makedist.mk
-
-noinst_PROGRAMS=client server
-
-client_SOURCES=client.cpp
-client_LDADD=$(CLIENT_LIB)
-
-server_SOURCES=server.cpp
-server_LDADD=$(CLIENT_LIB)
-
-examples_DATA= \
- server.cpp \
- client.cpp \
- $(MAKEDIST)
-
-EXTRA_DIST= \
- $(examples_DATA) \
- verify \
- verify.in \
- verify_cpp_python \
- verify_cpp_python.in \
- verify_python_cpp \
- verify_python_cpp.in
-
-
-
-
-
diff --git a/M4-RCs/qpid/cpp/examples/request-response/client.cpp b/M4-RCs/qpid/cpp/examples/request-response/client.cpp
deleted file mode 100644
index b1f8d0b587..0000000000
--- a/M4-RCs/qpid/cpp/examples/request-response/client.cpp
+++ /dev/null
@@ -1,164 +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.
- *
- */
-
-
-/**
- * client.cpp
- *
- * This program is one of two programs that illustrate the
- * request/response pattern.
- *
- *
- * client.cpp (this program)
- *
- * A client application that sends messages to the "amq.direct"
- * exchange, using the routing key "request" to route messages to
- * the server.
- *
- * Each instance of the client creates its own private response
- * queue, binding it to the "amq.direct" exchange using it's
- * session identifier as the routing key, and places its session
- * identifier in the "reply-to" property of each message it sends.
- *
- *
- * server.cpp
- *
- * A service that accepts messages from a request queue, converts
- * their content to upper case, and sends the result to the
- * original sender.
- *
- * This program creates a request queue, binds it to "amq.direct"
- * using the routing key "request", then receives messages from
- * the request queue. Each incoming message is converted to upper
- * case, then sent to the "amq.direct" exchange using the
- * request's reply-to property as the routing key for the
- * response.
- *
- *
- */
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/MessageListener.h>
-#include <qpid/client/SubscriptionManager.h>
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-#include <sstream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using std::stringstream;
-using std::string;
-
-class Listener : public MessageListener{
- private:
- SubscriptionManager& subscriptions;
- int counter;
- public:
- Listener(SubscriptionManager& subscriptions);
- virtual void received(Message& message);
-};
-
-Listener::Listener(SubscriptionManager& subs) : subscriptions(subs), counter(0)
-{}
-
-void Listener::received(Message& message) {
- std::cout << "Response: " << message.getData() << std::endl;
-
- ++ counter;
- if (counter > 3) {
- std::cout << "Shutting down listener for " << message.getDestination() << std::endl;
- subscriptions.cancel(message.getDestination());
- }
-}
-
-
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
- Connection connection;
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
- //--------- Main body of program --------------------------------------------
-
- // Create a response queue so the server can send us responses
- // to our requests. Use the client's session ID as the name
- // of the response queue.
-
- stringstream response_queue;
- response_queue << "client" << session.getId().getName();
-
- // Use the name of the response queue as the routing key
-
- session.queueDeclare(arg::queue=response_queue.str());
- session.exchangeBind(arg::exchange="amq.direct", arg::queue=response_queue.str(), arg::bindingKey=response_queue.str());
-
- // Each client sends the name of their own response queue so
- // the service knows where to route messages.
-
- Message request;
- request.getDeliveryProperties().setRoutingKey("request");
- request.getMessageProperties().setReplyTo(ReplyTo("amq.direct", response_queue.str()));
-
- // Create a listener for the response queue and listen for response messages.
- std::cout << "Activating response queue listener for: " << response_queue.str() << std::endl;
- SubscriptionManager subscriptions(session);
- Listener listener(subscriptions);
- subscriptions.subscribe(listener, response_queue.str());
-
- // Now send some requests ...
-
- string s[] = {
- "Twas brillig, and the slithy toves",
- "Did gire and gymble in the wabe.",
- "All mimsy were the borogroves,",
- "And the mome raths outgrabe."
- };
-
-
- for (int i=0; i<4; i++) {
- request.setData(s[i]);
- session.messageTransfer(arg::content=request, arg::destination="amq.direct");
- std::cout << "Request: " << s[i] << std::endl;
- }
-
- std::cout << "Waiting for all responses to arrive ..." << std::endl;
- subscriptions.run();
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/examples/request-response/server.cpp b/M4-RCs/qpid/cpp/examples/request-response/server.cpp
deleted file mode 100644
index 2d62638dff..0000000000
--- a/M4-RCs/qpid/cpp/examples/request-response/server.cpp
+++ /dev/null
@@ -1,162 +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.
- *
- */
-
-
-/**
- * server.cpp
- *
- * This program is one of two programs that illustrate the
- * request/response pattern.
- *
- *
- * client.cpp
- *
- * A client application that sends messages to the "amq.direct"
- * exchange, using the routing key "request" to route messages to
- * the server.
- *
- * Each instance of the client creates its own private response
- * queue, binding it to the "amq.direct" exchange using it's
- * session identifier as the routing key, and places its session
- * identifier in the "reply-to" property of each message it sends.
- *
- *
- * server.cpp (this program)
- *
- * A service that accepts messages from a request queue, converts
- * their content to upper case, and sends the result to the
- * original sender.
- *
- * This program creates a request queue, binds it to "amq.direct"
- * using the routing key "request", then receives messages from
- * the request queue. Each incoming message is converted to upper
- * case, then sent to the "amq.direct" exchange using the
- * request's reply-to property as the routing key for the
- * response.
- *
- *
- */
-
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-
-#include <qpid/client/AsyncSession.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/MessageListener.h>
-#include <qpid/client/SubscriptionManager.h>
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-#include <sstream>
-#include <string>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-using std::stringstream;
-using std::string;
-
-class Listener : public MessageListener{
- private:
- SubscriptionManager& subscriptions;
- AsyncSession asyncSession;
- public:
- Listener(SubscriptionManager& subscriptions, Session& session);
- virtual void received(Message& message);
-};
-
-Listener::Listener(SubscriptionManager& subs, Session& session)
- : subscriptions(subs), asyncSession(session)
-{}
-
-void Listener::received(Message& request) {
- Message response;
-
- // Get routing key for response from the request's replyTo property
- string routingKey;
-
- if (request.getMessageProperties().hasReplyTo()) {
- routingKey = request.getMessageProperties().getReplyTo().getRoutingKey();
- } else {
- std::cout << "Error: " << "No routing key for request (" << request.getData() << ")" << std::endl;
- return;
- }
-
- std::cout << "Request: " << request.getData() << " (" <<routingKey << ")" << std::endl;
-
- // Transform message content to upper case
- std::string s = request.getData();
- std::transform (s.begin(), s.end(), s.begin(), toupper);
- response.setData(s);
-
- // Send it back to the user
- response.getDeliveryProperties().setRoutingKey(routingKey);
-
- // Asynchronous transfer sends messages as quickly as
- // possible without waiting for confirmation.
- asyncSession.messageTransfer(arg::content=response, arg::destination="amq.direct");
-}
-
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
- Connection connection;
-
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
- //--------- Main body of program --------------------------------------------
-
-
- // Create a request queue for clients to use when making
- // requests.
- string request_queue = "request";
-
- // Use the name of the request queue as the routing key
- session.queueDeclare(arg::queue=request_queue);
- session.exchangeBind(arg::exchange="amq.direct", arg::queue=request_queue, arg::bindingKey=request_queue);
-
- // Create a listener and subscribe it to the request_queue
- std::cout << "Activating request queue listener for: " << request_queue << std::endl;
- SubscriptionManager subscriptions(session);
- Listener listener(subscriptions, session);
- subscriptions.subscribe(listener, request_queue);
- // Deliver messages until the subscription is cancelled
- // by Listener::received()
-
- std::cout << "Waiting for requests" << std::endl;
- subscriptions.run();
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/examples/request-response/verify b/M4-RCs/qpid/cpp/examples/request-response/verify
deleted file mode 100644
index dee82413e7..0000000000
--- a/M4-RCs/qpid/cpp/examples/request-response/verify
+++ /dev/null
@@ -1,24 +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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-background "Waiting" ./server
-clients ./client
-kill %% # Must kill the server.
-outputs "./client.out | remove_uuid" "server.out | remove_uuid"
diff --git a/M4-RCs/qpid/cpp/examples/request-response/verify.in b/M4-RCs/qpid/cpp/examples/request-response/verify.in
deleted file mode 100644
index 7925dc5671..0000000000
--- a/M4-RCs/qpid/cpp/examples/request-response/verify.in
+++ /dev/null
@@ -1,19 +0,0 @@
-==== client.out | remove_uuid
-Activating response queue listener for: client
-Request: Twas brillig, and the slithy toves
-Request: Did gire and gymble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
-Waiting for all responses to arrive ...
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GIRE AND GYMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-Shutting down listener for client
-==== server.out | remove_uuid
-Activating request queue listener for: request
-Waiting for requests
-Request: Twas brillig, and the slithy toves (client)
-Request: Did gire and gymble in the wabe. (client)
-Request: All mimsy were the borogroves, (client)
-Request: And the mome raths outgrabe. (client)
diff --git a/M4-RCs/qpid/cpp/examples/request-response/verify_cpp_python b/M4-RCs/qpid/cpp/examples/request-response/verify_cpp_python
deleted file mode 100644
index 867af3a92b..0000000000
--- a/M4-RCs/qpid/cpp/examples/request-response/verify_cpp_python
+++ /dev/null
@@ -1,6 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-background "Request server running" $PYTHON_EXAMPLES/request-response/server.py
-clients ./client
-sleep 1
-kill %% # Must kill the server.
-outputs "./client.out | remove_uuid" "$PYTHON_EXAMPLES/request-response/server.py.out | remove_uuid"
diff --git a/M4-RCs/qpid/cpp/examples/request-response/verify_cpp_python.in b/M4-RCs/qpid/cpp/examples/request-response/verify_cpp_python.in
deleted file mode 100644
index a032293d9b..0000000000
--- a/M4-RCs/qpid/cpp/examples/request-response/verify_cpp_python.in
+++ /dev/null
@@ -1,15 +0,0 @@
-==== client.out | remove_uuid
-Activating response queue listener for: client
-Request: Twas brillig, and the slithy toves
-Request: Did gire and gymble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
-Waiting for all responses to arrive ...
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GIRE AND GYMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-Shutting down listener for client
-==== server.py.out | remove_uuid
-Request server running - run your client now.
-(Times out after 100 seconds ...)
diff --git a/M4-RCs/qpid/cpp/examples/request-response/verify_python_cpp b/M4-RCs/qpid/cpp/examples/request-response/verify_python_cpp
deleted file mode 100644
index d6f0fa7152..0000000000
--- a/M4-RCs/qpid/cpp/examples/request-response/verify_python_cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-background "Waiting" ./server
-clients $PYTHON_EXAMPLES/request-response/client.py
-kill %% # Must kill the server.
-outputs "$PYTHON_EXAMPLES/request-response/client.py.out | remove_uuid" "server.out | remove_uuid"
diff --git a/M4-RCs/qpid/cpp/examples/request-response/verify_python_cpp.in b/M4-RCs/qpid/cpp/examples/request-response/verify_python_cpp.in
deleted file mode 100644
index 1500134619..0000000000
--- a/M4-RCs/qpid/cpp/examples/request-response/verify_python_cpp.in
+++ /dev/null
@@ -1,18 +0,0 @@
-==== client.py.out | remove_uuid
-Request: Twas brillig, and the slithy toves
-Request: Did gyre and gimble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
-Messages on queue: reply_to:
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GYRE AND GIMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-No more messages!
-==== server.out | remove_uuid
-Activating request queue listener for: request
-Waiting for requests
-Request: Twas brillig, and the slithy toves (reply_to:)
-Request: Did gyre and gimble in the wabe. (reply_to:)
-Request: All mimsy were the borogroves, (reply_to:)
-Request: And the mome raths outgrabe. (reply_to:)
diff --git a/M4-RCs/qpid/cpp/examples/verify b/M4-RCs/qpid/cpp/examples/verify
deleted file mode 100755
index 08dcf327a7..0000000000
--- a/M4-RCs/qpid/cpp/examples/verify
+++ /dev/null
@@ -1,107 +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.
-#
-
-
-# Driver script to verify installed examples (also used for build tests.)
-#
-# Usage: verify example_dir [ example_dir ...]
-# Where each example_dir must contain a verify sub-script to include.
-#
-# If $QPIDD is set, run a private QPIDD and use it.
-# If $QPID_HOST or $QPID_PORT are set, use them to connect.
-#
-
-QPID_DATA_DIR=
-export QPID_DATA_DIR
-
-cleanup() {
- test -n "$QPIDD" && $QPIDD -q # Private broker
- kill %% > /dev/null 2>&1 # Leftover background jobs
-}
-
-trap cleanup EXIT
-
-ARGS="${QPID_HOST:-localhost} $QPID_PORT"
-
-outfile() {
- file=$1
- while [ -f $file.out ]; do file="${file}X"; done
- echo $file.out
- }
-
-fail() { test -n "$*" && echo $* 1>&2 ; FAIL=1; return 1; }
-
-client() { "$@" $ARGS > `outfile $*` || fail; }
-
-clients() { for cmd in "$@"; do client $cmd; done; }
-
-waitfor() { until grep -a -l "$2" $1 >/dev/null 2>&1 ; do sleep 1 ; done ; }
-
-background() {
- pattern=$1; shift
- out=`outfile $*`
- eval "$* $ARGS > $out &" || { fail; return 1; }
- waitfor $out "$pattern"
-}
-
-name() {
- for x in $*; do name="$name `basename $x`"; done
- echo $name;
-}
-
-outputs() {
- wait 2> /dev/null # Wait for all backgroud processes to complete
- rm -f $script.out
- for f in "$@"; do
- { echo "==== `name $f`"; eval "cat $f"; } >> $script.out || fail
- done
-}
-
-verify() {
- FAIL=
- if [ -d $1 ]; then dir=$1; script=verify;
- else dir=`dirname $1`; script=`basename $1`; fi
- cd $dir || return 1
- rm -f *.out
- { source ./$script && diff -ac $script.out $script.in ; } || fail
- test -z "$FAIL" && rm -f *.out
- return $FAIL
-}
-
-HEX="[a-fA-F0-9]"
-remove_uuid() {
- sed "s/$HEX\{8\}-$HEX\{4\}-$HEX\{4\}-$HEX\{4\}-$HEX\{12\}//g" $*
-}
-remove_uuid64() {
- sed 's/[-A-Za-z0-9_]\{22\}==//g' $*
-}
-
-# Start private broker if QPIDD is set.
-if [ -n "$QPIDD" ] ; then
- export QPID_PORT=`$QPIDD -dp0` || { echo "Cannot start $QPIDD" ; exit 1; }
- trap "$QPIDD -q" EXIT
-fi
-
-for example in "$@"; do
- echo "== $example "
- if ( verify $example; ) then echo "PASS"; else echo "FAIL"; RET=1; fi
- done
-exit $RET
diff --git a/M4-RCs/qpid/cpp/examples/verify_all b/M4-RCs/qpid/cpp/examples/verify_all
deleted file mode 100755
index d2bc9b67d1..0000000000
--- a/M4-RCs/qpid/cpp/examples/verify_all
+++ /dev/null
@@ -1,53 +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.
-#
-
-# Verify all C++/python example combinations.
-#
-
-verify=`dirname $0`/verify
-topsrcdir=$1
-qpidd=$2
-broker_args=$3
-exclude_regexp=$4
-python=${QPID_PYTHON_DIR:-$topsrcdir/python}
-
-trap "$qpidd -q" exit
-QPID_PORT=`$qpidd -dp0 $broker_args` || { echo "Can't run qpidd" ; exit 1; }
-PYTHON_EXAMPLES=$python/examples
-PYTHONPATH=$python:$PYTHONPATH
-export QPID_PORT PYTHON_EXAMPLES PYTHONPATH
-
-test -d $PYTHON_EXAMPLES || echo "WARNING: No python examples. $PYTHON_EXAMPLES not found."
-find="find"
-test -d $PYTHON_EXAMPLES && find="$find $PYTHON_EXAMPLES"
-find="$find -mindepth 2 -name verify"
-test -d $PYTHON_EXAMPLES && \
- find="$find -o -name verify_cpp_python -o -name verify_python_cpp"
-all_examples=`$find`
-
-if test -z "$exclude_regexp"; then
- run_examples=$all_examples
-else
- for f in $all_examples; do
- { cat $f | grep $exclude_regexp > /dev/null ; } || run_examples="$run_examples $f"
- done
-fi
-$verify $run_examples
diff --git a/M4-RCs/qpid/cpp/examples/xml-exchange/Makefile.am b/M4-RCs/qpid/cpp/examples/xml-exchange/Makefile.am
deleted file mode 100644
index 0f99aea44e..0000000000
--- a/M4-RCs/qpid/cpp/examples/xml-exchange/Makefile.am
+++ /dev/null
@@ -1,47 +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.
-#
-examplesdir=$(pkgdatadir)/examples/xml-exchange
-
-include $(top_srcdir)/examples/makedist.mk
-
-noinst_PROGRAMS=declare_queues xml_producer listener
-
-declare_queues_SOURCES=declare_queues.cpp
-declare_queues_LDADD=$(CLIENT_LIB)
-
-xml_producer_SOURCES=xml_producer.cpp
-xml_producer_LDADD=$(CLIENT_LIB)
-
-listener_SOURCES=listener.cpp
-listener_LDADD=$(CLIENT_LIB)
-
-EXTRA_DIST= \
- README
-
-examples_DATA= \
- $(EXTRA_DIST) \
- declare_queues.cpp \
- listener.cpp \
- xml_producer.cpp \
- $(MAKEDIST)
-
-
-
-
-
diff --git a/M4-RCs/qpid/cpp/examples/xml-exchange/README b/M4-RCs/qpid/cpp/examples/xml-exchange/README
deleted file mode 100644
index 85caebe352..0000000000
--- a/M4-RCs/qpid/cpp/examples/xml-exchange/README
+++ /dev/null
@@ -1,53 +0,0 @@
-This example shows how to program a simple application
-using the XML Exchange.
-
-[Note: The XML Exchange is not a standard AMQP exchange type. To run
-this example you need to have a broker that has support for the xml
-exchange. If you are compiling the broker from source please refer to
-the INSTALL notes from qpid.]
-
-To run the example, execute the programs in the
-following order:
-
-1 ./declare_queues
-2 ./listener
-3 ./message_producer (in a separate window)
-
-The XML Exchange must be explicitly declared. Bindings
-are established using queries in XQuery. These queries
-can reference message content, message application
-properties (which are declared as external variables
-in the XQuery), or both.
-
-Once this is done, message producers publish to the
-exchange using the exchange name and a routing key,
-just as for other exchange types. Message consumers
-read from the queues to which messages are routed.
-If a message does not have XML content, or is
-missing message application properties needed by
-the query, the query is not routed.
-
-Queries can use message application headers to
-provide functionality similar to JMS selectors.
-If a query does not use the content of a message,
-the message content is not parsed, and need not
-be XML.
-
-The XQuery processor, XQilla, does path-based
-document projection, so once the portion of
-a document needed to evaluate a query has
-been read, it stops parsing the document.
-Suppose a long document has a header section.
-You can indicate in the query that only
-one header section needs to be queried,
-and there is no need to parse the entire
-document to see if there are further header
-sections, using a path like this:
-
-./message/header[1]/date
-
-If you used a path like this, all children
-of the message element would be read to
-see if there are further headers:
-
-./message/header/date
diff --git a/M4-RCs/qpid/cpp/examples/xml-exchange/declare_queues.cpp b/M4-RCs/qpid/cpp/examples/xml-exchange/declare_queues.cpp
deleted file mode 100644
index d3a0f539b6..0000000000
--- a/M4-RCs/qpid/cpp/examples/xml-exchange/declare_queues.cpp
+++ /dev/null
@@ -1,99 +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.
- *
- */
-
-
-/**
- *
- * declare_queues.cpp
- *
- * This is one of three programs used to implement XML-based content
- * routing in C++.
- *
- * declare_queues.cpp (this program)
- *
- * Creates a queue named "message_qaueue" on the broker,
- * declares an XML Exchange, subscribes the queue to the XML
- * Exchange using an XQuery in the binding, then exits.
- *
- * xml_producer.cpp
- *
- * Publishes messages to the XML Exchange.
- *
- * listener.cpp
- *
- * Reads messages from the "message_queue" queue.
- */
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using std::string;
-
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
- Connection connection;
-
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
-
- //--------- Main body of program --------------------------------------------
-
- // Set up queues, bind them with queries. Note that the XML exchange
- // is not in the AMQP specification, so it is called "xml", not "amq.xml".
- // Note that the XML exchange is not predeclared in Qpid, it must
- // be declared by the application.
-
- session.queueDeclare(arg::queue="message_queue");
- session.exchangeDeclare(arg::exchange="xml", arg::type="xml");
-
- // Application message properties are mapped to external variables
- // in the XQuery. An XML Exchange can query message properties much
- // like JMS, query the XML content of the message, or both.
-
- FieldTable binding;
- binding.setString("xquery", "declare variable $control external;"
- "./message/id mod 2 = 1 or $control = 'end'");
- session.exchangeBind(arg::exchange="xml", arg::queue="message_queue", arg::bindingKey="content_feed", arg::arguments=binding);
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-
-}
-
-
-
diff --git a/M4-RCs/qpid/cpp/examples/xml-exchange/listener.cpp b/M4-RCs/qpid/cpp/examples/xml-exchange/listener.cpp
deleted file mode 100644
index 02b722c745..0000000000
--- a/M4-RCs/qpid/cpp/examples/xml-exchange/listener.cpp
+++ /dev/null
@@ -1,108 +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.
- *
- */
-
-
-/**
- *
- * listener.cpp
- *
- * This is one of three programs used to implement XML-based content
- * routing in C++.
- *
- * declare_queues.cpp
- *
- * Creates a queue named "message_qaueue" on the broker,
- * declares an XML Exchange, subscribes the queue to the XML
- * Exchange using an XQuery in the binding, then exits.
- *
- * xml_producer.cpp
- *
- * Publishes messages to the XML Exchange.
- *
- * listener.cpp (this program)
- *
- * Reads messages from the "message_queue" queue.
- */
-
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/SubscriptionManager.h>
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-
-class Listener : public MessageListener{
- private:
- SubscriptionManager& subscriptions;
- public:
- Listener(SubscriptionManager& subscriptions);
- virtual void received(Message& message);
-};
-
-Listener::Listener(SubscriptionManager& subs) : subscriptions(subs)
-{}
-
-void Listener::received(Message& message) {
- std::cout << "Message: " << message.getData() << std::endl;
- if (message.getHeaders().getAsString("control") == "end") {
- std::cout << "Shutting down listener for " << message.getDestination()
- << std::endl;
- subscriptions.cancel(message.getDestination());
- }
-}
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
-
- Connection connection;
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
- //--------- Main body of program --------------------------------------------
-
- SubscriptionManager subscriptions(session);
- // Create a listener and subscribe it to the queue named "message_queue"
- Listener listener(subscriptions);
- subscriptions.subscribe(listener, "message_queue");
- // Receive messages until the subscription is cancelled
- // by Listener::received()
- subscriptions.run();
-
- //---------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/examples/xml-exchange/xml_producer.cpp b/M4-RCs/qpid/cpp/examples/xml-exchange/xml_producer.cpp
deleted file mode 100644
index 5cb75d0087..0000000000
--- a/M4-RCs/qpid/cpp/examples/xml-exchange/xml_producer.cpp
+++ /dev/null
@@ -1,114 +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.
- *
- */
-
-
-/**
- *
- * xml_producer.cpp
- *
- * This is one of three programs used to implement XML-based content
- * routing in C++.
- *
- * declare_queues.cpp
- *
- * Creates a queue named "message_qaueue" on the broker,
- * declares an XML Exchange, subscribes the queue to the XML
- * Exchange using an XQuery in the binding, then exits.
- *
- * xml_producer.cpp (this program)
- *
- * Publishes messages to the XML Exchange.
- *
- * listener.cpp
- *
- * Reads messages from the "message_queue" queue.
- */
-
-
-#include <qpid/client/Connection.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/AsyncSession.h>
-#include <qpid/client/Message.h>
-
-
-#include <unistd.h>
-#include <cstdlib>
-#include <iostream>
-
-#include <sstream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using std::stringstream;
-using std::string;
-
-int main(int argc, char** argv) {
- const char* host = argc>1 ? argv[1] : "127.0.0.1";
- int port = argc>2 ? atoi(argv[2]) : 5672;
- Connection connection;
- Message message;
- try {
- connection.open(host, port);
- Session session = connection.newSession();
-
- //--------- Main body of program --------------------------------------------
-
- // Publish some XML messages. Use the control property to
- // indicate when we are finished.
- //
- // In the XML exchange, the routing key and the name of
- // the query match.
-
- message.getDeliveryProperties().setRoutingKey("content_feed");
- message.getHeaders().setString("control","continue");
-
- // Now send some messages ...
-
- for (int i=0; i<10; i++) {
- stringstream message_data;
- message_data << "<message><id>" << i << "</id></message>";
-
- std::cout << "Message data: " << message_data.str() << std::endl;
-
- message.setData(message_data.str());
- // Asynchronous transfer sends messages as quickly as
- // possible without waiting for confirmation.
- async(session).messageTransfer(arg::content=message, arg::destination="xml");
- }
-
- // And send a final message to indicate termination.
-
- message.getHeaders().setString("control","end");
- message.setData("<end>That's all, folks!</end>");
- session.messageTransfer(arg::content=message, arg::destination="xml");
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/m4/clock_time.m4 b/M4-RCs/qpid/cpp/m4/clock_time.m4
deleted file mode 100644
index 227a5978e5..0000000000
--- a/M4-RCs/qpid/cpp/m4/clock_time.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-# clock_time.m4 serial 8
-dnl Copyright (C) 2002-2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Check for clock_gettime and clock_settime, and set LIB_CLOCK_GETTIME.
-# For a program named, say foo, you should add a line like the following
-# in the corresponding Makefile.am file:
-# foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
-
-AC_DEFUN([gl_CLOCK_TIME],
-[
- dnl Persuade glibc and Solaris <time.h> to declare these functions.
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
- # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
- # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
-
- # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
- # programs in the package would end up linked with that potentially-shared
- # library, inducing unnecessary run-time overhead.
- gl_saved_libs=$LIBS
- AC_SEARCH_LIBS(clock_gettime, [rt posix4],
- [test "$ac_cv_search_clock_gettime" = "none required" ||
- LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
- AC_SUBST([LIB_CLOCK_GETTIME])
- AC_CHECK_FUNCS(clock_gettime clock_settime)
- LIBS=$gl_saved_libs
-])
diff --git a/M4-RCs/qpid/cpp/m4/compiler-flags.m4 b/M4-RCs/qpid/cpp/m4/compiler-flags.m4
deleted file mode 100644
index 01cb728f02..0000000000
--- a/M4-RCs/qpid/cpp/m4/compiler-flags.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-# serial 3
-# Find valid warning flags for the C Compiler. -*-Autoconf-*-
-dnl Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl Written by Jesse Thilo.
-
-AC_DEFUN([gl_COMPILER_FLAGS],
- [AC_MSG_CHECKING(whether compiler accepts $1)
- AC_SUBST(COMPILER_FLAGS)
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $1"
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS $1"
- AC_TRY_COMPILE(,
- [int x;],
- COMPILER_FLAGS="$COMPILER_FLAGS $1"
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
- CFLAGS="$ac_save_CFLAGS"
- CXXFLAGS="$ac_save_CXXFLAGS"
- ])
diff --git a/M4-RCs/qpid/cpp/m4/cppunit.m4 b/M4-RCs/qpid/cpp/m4/cppunit.m4
deleted file mode 100644
index f009086f9d..0000000000
--- a/M4-RCs/qpid/cpp/m4/cppunit.m4
+++ /dev/null
@@ -1,89 +0,0 @@
-dnl
-dnl AM_PATH_CPPUNIT(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl
-AC_DEFUN([AM_PATH_CPPUNIT],
-[
-
-AC_ARG_WITH(cppunit-prefix,[ --with-cppunit-prefix=PFX Prefix where CppUnit is installed (optional)],
- cppunit_config_prefix="$withval", cppunit_config_prefix="")
-AC_ARG_WITH(cppunit-exec-prefix,[ --with-cppunit-exec-prefix=PFX Exec prefix where CppUnit is installed (optional)],
- cppunit_config_exec_prefix="$withval", cppunit_config_exec_prefix="")
-
- if test x$cppunit_config_exec_prefix != x ; then
- cppunit_config_args="$cppunit_config_args --exec-prefix=$cppunit_config_exec_prefix"
- if test x${CPPUNIT_CONFIG+set} != xset ; then
- CPPUNIT_CONFIG=$cppunit_config_exec_prefix/bin/cppunit-config
- fi
- fi
- if test x$cppunit_config_prefix != x ; then
- cppunit_config_args="$cppunit_config_args --prefix=$cppunit_config_prefix"
- if test x${CPPUNIT_CONFIG+set} != xset ; then
- CPPUNIT_CONFIG=$cppunit_config_prefix/bin/cppunit-config
- fi
- fi
-
- AC_PATH_PROG(CPPUNIT_CONFIG, cppunit-config, no)
- cppunit_version_min=$1
-
- AC_MSG_CHECKING(for Cppunit - version >= $cppunit_version_min)
- no_cppunit=""
- if test "$CPPUNIT_CONFIG" = "no" ; then
- AC_MSG_RESULT(no)
- no_cppunit=yes
- else
- CPPUNIT_CFLAGS=`$CPPUNIT_CONFIG --cflags`
- CPPUNIT_LIBS=`$CPPUNIT_CONFIG --libs`
- cppunit_version=`$CPPUNIT_CONFIG --version`
-
- cppunit_major_version=`echo $cppunit_version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- cppunit_minor_version=`echo $cppunit_version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- cppunit_micro_version=`echo $cppunit_version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-
- cppunit_major_min=`echo $cppunit_version_min | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- if test "x${cppunit_major_min}" = "x" ; then
- cppunit_major_min=0
- fi
-
- cppunit_minor_min=`echo $cppunit_version_min | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- if test "x${cppunit_minor_min}" = "x" ; then
- cppunit_minor_min=0
- fi
-
- cppunit_micro_min=`echo $cppunit_version_min | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
- if test "x${cppunit_micro_min}" = "x" ; then
- cppunit_micro_min=0
- fi
-
- cppunit_version_proper=`expr \
- $cppunit_major_version \> $cppunit_major_min \| \
- $cppunit_major_version \= $cppunit_major_min \& \
- $cppunit_minor_version \> $cppunit_minor_min \| \
- $cppunit_major_version \= $cppunit_major_min \& \
- $cppunit_minor_version \= $cppunit_minor_min \& \
- $cppunit_micro_version \>= $cppunit_micro_min `
-
- if test "$cppunit_version_proper" = "1" ; then
- AC_MSG_RESULT([$cppunit_major_version.$cppunit_minor_version.$cppunit_micro_version])
- else
- AC_MSG_RESULT(no)
- no_cppunit=yes
- fi
- fi
-
- if test "x$no_cppunit" = x ; then
- ifelse([$2], , :, [$2])
- else
- CPPUNIT_CFLAGS=""
- CPPUNIT_LIBS=""
- ifelse([$3], , :, [$3])
- fi
-
- AC_SUBST(CPPUNIT_CFLAGS)
- AC_SUBST(CPPUNIT_LIBS)
-])
diff --git a/M4-RCs/qpid/cpp/m4/extensions.m4 b/M4-RCs/qpid/cpp/m4/extensions.m4
deleted file mode 100644
index fe7398b046..0000000000
--- a/M4-RCs/qpid/cpp/m4/extensions.m4
+++ /dev/null
@@ -1,59 +0,0 @@
-# serial 5 -*- Autoconf -*-
-# Enable extensions on systems that normally disable them.
-
-# Copyright (C) 2003, 2006, 2008 Free Software Foundation, Inc.
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
-# Autoconf. Perhaps we can remove this once we can assume Autoconf
-# 2.61 or later everywhere, but since CVS Autoconf mutates rapidly
-# enough in this area it's likely we'll need to redefine
-# AC_USE_SYSTEM_EXTENSIONS for quite some time.
-
-# AC_USE_SYSTEM_EXTENSIONS
-# ------------------------
-# Enable extensions on systems that normally disable them,
-# typically due to standards-conformance issues.
-m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [], [
-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
-[
- AC_BEFORE([$0], [AC_COMPILE_IFELSE])
- AC_BEFORE([$0], [AC_RUN_IFELSE])
-
- AC_REQUIRE([AC_GNU_SOURCE])
- AC_REQUIRE([AC_AIX])
- AC_REQUIRE([AC_MINIX])
-
- AH_VERBATIM([__EXTENSIONS__],
-[/* Enable extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif])
- AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
- [ac_cv_safe_to_define___extensions__],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([
-# define __EXTENSIONS__ 1
- AC_INCLUDES_DEFAULT])],
- [ac_cv_safe_to_define___extensions__=yes],
- [ac_cv_safe_to_define___extensions__=no])])
- test $ac_cv_safe_to_define___extensions__ = yes &&
- AC_DEFINE([__EXTENSIONS__])
- AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
- AC_DEFINE([_TANDEM_SOURCE])
-])])
-
-# gl_USE_SYSTEM_EXTENSIONS
-# ------------------------
-# Enable extensions on systems that normally disable them,
-# typically due to standards-conformance issues.
-AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
- [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
diff --git a/M4-RCs/qpid/cpp/m4/python.m4 b/M4-RCs/qpid/cpp/m4/python.m4
deleted file mode 100644
index 229fd5547b..0000000000
--- a/M4-RCs/qpid/cpp/m4/python.m4
+++ /dev/null
@@ -1,168 +0,0 @@
-## ------------------------ -*- Autoconf -*-
-## Python file handling
-## From Andrew Dalke
-## Updated by James Henstridge
-## ------------------------
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# ---------------------------------------------------------------------------
-# Adds support for distributing Python modules and packages. To
-# install modules, copy them to $(pythondir), using the python_PYTHON
-# automake variable. To install a package with the same name as the
-# automake package, install to $(pkgpythondir), or use the
-# pkgpython_PYTHON automake variable.
-#
-# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
-# locations to install python extension modules (shared libraries).
-# Another macro is required to find the appropriate flags to compile
-# extension modules.
-#
-# If your package is configured with a different prefix to python,
-# users will have to add the install directory to the PYTHONPATH
-# environment variable, or create a .pth file (see the python
-# documentation for details).
-#
-# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
-# cause an error if the version of python installed on the system
-# doesn't meet the requirement. MINIMUM-VERSION should consist of
-# numbers and dots only.
-AC_DEFUN([AM_PATH_PYTHON],
- [
- dnl Find a Python interpreter. Python versions prior to 1.5 are not
- dnl supported because the default installation locations changed from
- dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages
- dnl in 1.5.
- m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
- [python python2 python2.5 python2.4 python2.3 python2.2 dnl
-python2.1 python2.0 python1.6 python1.5])
-
- m4_if([$1],[],[
- dnl No version check is needed.
- # Find any Python interpreter.
- if test -z "$PYTHON"; then
- AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
- fi
- am_display_PYTHON=python
- ], [
- dnl A version check is needed.
- if test -n "$PYTHON"; then
- # If the user set $PYTHON, use it and don't search something else.
- AC_MSG_CHECKING([whether $PYTHON version >= $1])
- AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_ERROR(too old)])
- am_display_PYTHON=$PYTHON
- else
- # Otherwise, try each interpreter until we find one that satisfies
- # VERSION.
- AC_CACHE_CHECK([for a Python interpreter with version >= $1],
- [am_cv_pathless_PYTHON],[
- for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
- test "$am_cv_pathless_PYTHON" = none && break
- AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
- done])
- # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
- if test "$am_cv_pathless_PYTHON" = none; then
- PYTHON=:
- else
- AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
- fi
- am_display_PYTHON=$am_cv_pathless_PYTHON
- fi
- ])
-
- if test "$PYTHON" = :; then
- dnl Run any user-specified action, or abort.
- m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
- else
-
- dnl Query Python for its version number. Getting [:3] seems to be
- dnl the best way to do this; it's what "site.py" does in the standard
- dnl library.
-
- AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
- [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`])
- AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
-
- dnl Use the values of $prefix and $exec_prefix for the corresponding
- dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
- dnl distinct variables so they can be overridden if need be. However,
- dnl general consensus is that you shouldn't need this ability.
-
- AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
- AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
-
- dnl At times (like when building shared libraries) you may want
- dnl to know which OS platform Python thinks this is.
-
- AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
- [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`])
- AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
-
-
- dnl Set up 4 directories:
-
- dnl pythondir -- where to install python scripts. This is the
- dnl site-packages directory, not the python standard library
- dnl directory like in previous automake betas. This behavior
- dnl is more consistent with lispdir.m4 for example.
- dnl Query distutils for this directory. distutils does not exist in
- dnl Python 1.5, so we fall back to the hardcoded directory if it
- dnl doesn't work.
- AC_CACHE_CHECK([for $am_display_PYTHON script directory],
- [am_cv_python_pythondir],
- [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null ||
- echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`])
- AC_SUBST([pythondir], [$am_cv_python_pythondir])
-
- dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
- dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
- dnl more consistent with the rest of automake.
-
- AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
-
- dnl pyexecdir -- directory for installing python extension modules
- dnl (shared libraries)
- dnl Query distutils for this directory. distutils does not exist in
- dnl Python 1.5, so we fall back to the hardcoded directory if it
- dnl doesn't work.
- AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
- [am_cv_python_pyexecdir],
- [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null ||
- echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`])
- AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
-
- dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
-
- AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
-
- dnl Run any user-specified action.
- $2
- fi
-
-])
-
-
-# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-# ---------------------------------------------------------------------------
-# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
-# Run ACTION-IF-FALSE otherwise.
-# This test uses sys.hexversion instead of the string equivalent (first
-# word of sys.version), in order to cope with versions such as 2.2c1.
-# hexversion has been introduced in Python 1.5.2; it's probably not
-# worth to support older versions (1.5.1 was released on October 31, 1998).
-AC_DEFUN([AM_PYTHON_CHECK_VERSION],
- [prog="import sys, string
-# split strings by '.' and convert to numeric. Append some zeros
-# because we need at least 4 digits for the hex conversion.
-minver = map(int, string.split('$2', '.')) + [[0, 0, 0]]
-minverhex = 0
-for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
-sys.exit(sys.hexversion < minverhex)"
- AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
diff --git a/M4-RCs/qpid/cpp/make-dist b/M4-RCs/qpid/cpp/make-dist
deleted file mode 100755
index a0c02402e5..0000000000
--- a/M4-RCs/qpid/cpp/make-dist
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/bin/bash
-
-#
-#
-# 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.
-#
-
-
-#
-# Temporary hack for producing a binary dev distribution.
-# Includes regular stuff from 'make install' + examples and headers.
-#
-# TODO: Also include debug libraries.
-#
-
-Usage() {
- echo "usage: $0 [release-version]
- release-version e.g. 1.0M1 (defaults to the svn revision)" >&2
- exit 2
-}
-
-if [[ $# -eq 1 ]]; then
- [[ $1 == "-?" ]] && Usage
- version=$1
-elif [[ $# -ne 0 ]]; then
- Usage
-else
- # Default the version to the svn revision
- if which svn >/dev/null 2>&1; then
- svnRevision=$(svn info | grep ^Revision: | awk '{print $2}')
- version=r${svnRevision}
- else
- echo "You need to have svn in your PATH or specify a release-version"
- exit 2
- fi
-fi
-
-releaseName=qpid-cpp-dev-${version}-$(uname -s)-$(uname -p)
-releaseDir=release/$releaseName
-
-if [[ -d $releaseDir ]]; then
- echo "$releaseDir already exists"
- exit 2
-fi
-
-# Copy bin.
-mkdir -p $releaseDir/bin
-cp -r src/.libs/* ${releaseDir}/bin
-
-# Copy libs.
-mkdir -p $releaseDir/lib
-cp lib/broker/.libs/lib* lib/common/.libs/lib* lib/client/.libs/lib* \
- $releaseDir/lib
-
-# Copy gen include files.
-find gen -name \*.h | while read file; do
- destFile=${releaseDir}/include/$file
- baseDir=$(dirname $destFile)
- mkdir -p $baseDir
- cp $file $destFile
-done
-
-# Copy in lib include files.
-(
- cd lib; find . -name \*.h | while read file; do
- destFile=../${releaseDir}/include/$file
- baseDir=$(dirname $destFile)
- mkdir -p $baseDir
- cp $file $destFile
- done
-)
-
-# Copy non-cppunit tests as examples.
-mkdir -p $releaseDir/examples
-for file in tests/*.cpp; do
- if grep CppUnit $file >/dev/null; then
- echo Skipping cppunit file $file
- else
- cp $file $releaseDir/examples
- fi
-done
-
-# Copy Makefile and README for examples.
-cp tests/examples.Makefile $releaseDir/examples/Makefile
-cp tests/examples.README $releaseDir/examples/README
-
-cd release
-tar=$releaseName.tar
-tar cvf $tar $releaseName
-bzip2 $tar
diff --git a/M4-RCs/qpid/cpp/managementgen/Makefile.am b/M4-RCs/qpid/cpp/managementgen/Makefile.am
deleted file mode 100644
index da7277b255..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/Makefile.am
+++ /dev/null
@@ -1,36 +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.
-#
-qmfpythondir = $(pythondir)
-dist_bin_SCRIPTS = \
- qmf-gen
-nobase_qmfpython_DATA = \
- qmfgen/__init__.py \
- qmfgen/generate.py \
- qmfgen/schema.py \
- qmfgen/templates/Args.h \
- qmfgen/templates/Class.cpp \
- qmfgen/templates/Class.h \
- qmfgen/templates/Event.cpp \
- qmfgen/templates/Event.h \
- qmfgen/templates/Makefile.mk \
- qmfgen/templates/Package.cpp \
- qmfgen/templates/Package.h \
- qmfgen/management-types.xml
-
-EXTRA_DIST = $(nobase_qmfpython_DATA)
diff --git a/M4-RCs/qpid/cpp/managementgen/qmf-gen b/M4-RCs/qpid/cpp/managementgen/qmf-gen
deleted file mode 100755
index 15fbdadfb4..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmf-gen
+++ /dev/null
@@ -1,95 +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.
-#
-#
-
-
-#
-# 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
-import os
-from qmfgen.schema import SchemaPackage, SchemaClass
-from qmfgen.generate import Generator
-from optparse import OptionParser
-
-dataPath = os.path.dirname(Generator.getModulePath())
-defaultTypeFile = dataPath + "/management-types.xml"
-defaultTemplateDir = dataPath + "/templates"
-
-# Set command line options
-usage = "usage: %prog [options] schema-document..."
-parser = OptionParser(usage=usage)
-parser.add_option("-o", "--outputdir", dest="outputdir", metavar="DIR", default="./",
- help="Output directory")
-parser.add_option("-m", "--makefile", dest="makefile", metavar="FILE",
- help="Makefile fragment")
-parser.add_option("-t", "--typefile", dest="typefile", metavar="FILE", default=defaultTypeFile,
- help="Override type descriptor file")
-parser.add_option("-d", "--templatedir", dest="templatedir", metavar="DIR", default=defaultTemplateDir,
- help="Override template directory")
-parser.add_option("-p", "--gen-prefix", dest="genprefix", default="",
- help="Prefix for generated files in make dependencies")
-parser.add_option("-q", "--qpid-broker", dest="qpidbroker", default=False, action="store_true",
- help="Generate makefile for Qpid broker")
-
-(opts, args) = parser.parse_args()
-
-typefile = opts.typefile
-templatedir = opts.templatedir
-outdir = opts.outputdir
-gen = Generator(outdir, templatedir)
-
-if len(args) == 0:
- print "no input files"
- parser.exit()
-
-for schemafile in args:
- package = SchemaPackage(typefile, schemafile, opts)
-
- gen.setPackage (package.packageName)
- gen.makeClassFiles ("Class.h", package)
- gen.makeClassFiles ("Class.cpp", package)
- gen.makeMethodFiles ("Args.h", package)
- gen.makeEventFiles ("Event.h", package)
- gen.makeEventFiles ("Event.cpp", package)
- gen.makePackageFile ("Package.h", package)
- gen.makePackageFile ("Package.cpp", package)
-
-if opts.makefile != None:
- args = {}
- args["qpidbroker"] = opts.qpidbroker
- args["genprefix"] = opts.genprefix
- gen.makeSingleFile("Makefile.mk", opts.makefile, force=True, vars=args)
diff --git a/M4-RCs/qpid/cpp/managementgen/qmfgen/__init__.py b/M4-RCs/qpid/cpp/managementgen/qmfgen/__init__.py
deleted file mode 100644
index 63a3f41f28..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/__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/M4-RCs/qpid/cpp/managementgen/qmfgen/generate.py b/M4-RCs/qpid/cpp/managementgen/qmfgen/generate.py
deleted file mode 100755
index 35e222ebad..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/generate.py
+++ /dev/null
@@ -1,369 +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 xml.dom.minidom import parse, parseString, Node
-from cStringIO import StringIO
-from stat import *
-from errno import *
-import os
-import os.path
-import filecmp
-
-class Template:
- """
- Expandable File Template - This class is instantiated each time a
- template is to be expanded. It is instantiated with the "filename"
- which is the full path to the template file and the "handler" which
- is an object that is responsible for storing variables (setVariable),
- checking conditions (testCondition), and expanding tags (substHandler).
- """
- def __init__ (self, filename, handler):
- self.filename = filename
- self.handler = handler
- self.handler.initExpansion ()
- self.writing = True
-
- def expandLine (self, line, stream, object):
- cursor = 0
- while 1:
- sub = line.find ("/*MGEN:", cursor)
- if sub == -1:
- if self.writing:
- stream.write (line[cursor:len (line)])
- return
-
- subend = line.find("*/", sub)
- if self.writing:
- stream.write (line[cursor:sub])
- cursor = subend + 2
-
- tag = line[sub:subend]
-
- if tag[7:10] == "IF(":
- close = tag.find(")")
- if close == -1:
- raise ValueError ("Missing ')' on condition")
- cond = tag[10:close]
- dotPos = cond.find (".")
- if dotPos == -1:
- raise ValueError ("Invalid condition tag: %s" % cond)
- tagObject = cond[0:dotPos]
- tagName = cond[dotPos + 1 : len(cond)]
- if not self.handler.testCondition(object, tagObject, tagName):
- self.writing = False
-
- elif tag[7:12] == "ENDIF":
- self.writing = True
-
- else:
- equalPos = tag.find ("=")
- if equalPos == -1:
- dotPos = tag.find (".")
- if dotPos == -1:
- raise ValueError ("Invalid tag: %s" % tag)
- tagObject = tag[7:dotPos]
- tagName = tag[dotPos + 1:len (tag)]
- if self.writing:
- self.handler.substHandler (object, stream, tagObject, tagName)
- else:
- tagKey = tag[7:equalPos]
- tagVal = tag[equalPos + 1:len (tag)]
- if self.writing:
- self.handler.setVariable (tagKey, tagVal)
-
- def expand (self, object):
- fd = open (self.filename)
- stream = StringIO ()
-
- for line in fd:
- self.expandLine (line, stream, object)
- fd.close ()
-
- return stream
-
-
-class Makefile:
- """ Object representing a makefile fragment """
- def __init__ (self, filelists, templateFiles, packagelist):
- self.filelists = filelists
- self.templateFiles = templateFiles
- self.packagelist = packagelist
-
- def genGenSources (self, stream, variables):
- mdir = variables["mgenDir"]
- sdir = variables["specDir"]
- stream.write (mdir + "/qmf-gen \\\n")
- stream.write (" " + mdir + "/qmfgen/generate.py \\\n")
- stream.write (" " + mdir + "/qmfgen/schema.py \\\n")
- stream.write (" " + mdir + "/qmfgen/management-types.xml \\\n")
- stream.write (" " + sdir + "/management-schema.xml \\\n")
- first = True
- for template in self.templateFiles:
- if first:
- first = False
- stream.write (" ")
- else:
- stream.write (" \\\n ")
- stream.write (mdir + "/qmfgen/templates/" + template)
-
- def genGenCppFiles (self, stream, variables):
- first = True
- for file in self.filelists["cpp"]:
- if first:
- first = False
- else:
- stream.write (" \\\n ")
- stream.write (file)
-
- def genGenHFiles (self, stream, variables):
- first = True
- for file in self.filelists["h"]:
- if first:
- first = False
- else:
- stream.write (" \\\n ")
- stream.write (file)
-
- def genGeneratedFiles(self, stream, variables):
- first = True
- extensions = ("h", "cpp")
- for ext in extensions:
- for file in self.filelists[ext]:
- if first:
- first = False
- else:
- stream.write(" \\\n ")
- if "genprefix" in variables:
- prefix = variables["genprefix"]
- if prefix != "":
- stream.write(prefix + "/")
- stream.write(file)
-
- def genHeaderInstalls (self, stream, variables):
- for package in self.packagelist:
- name = "_".join(package.split("/"))
- stream.write(name + "dir = $(includedir)/qmf/" + package + "\n")
- stream.write("dist_" + name + "_HEADERS = ")
- first = True
- for file in self.filelists["h"]:
- if file.find("gen/qmf/" + package) == 0:
- if first:
- first = False
- else:
- stream.write (" \\\n ")
- stream.write(file)
- stream.write("\n\n")
-
- def testQpidBroker(self, variables):
- if "qpidbroker" in variables:
- return variables["qpidbroker"]
- return False
-
-
-class Generator:
- """
- This class manages code generation using template files. It is instantiated
- once for an entire code generation session.
- """
- def createPath (self, path):
- exists = True
- try:
- mode = os.stat (path)[ST_MODE]
- except OSError, (err,text):
- if err == ENOENT or err == ESRCH:
- exists = False
- else:
- raise
- if exists and not S_ISDIR (mode):
- raise ValueError ("path is not directory: %s" % path)
- if not exists:
- pair = os.path.split (path)
- if pair[0] != '':
- self.createPath (pair[0])
- os.mkdir (path)
-
- def normalize (self, path):
- newpath = os.path.normcase (os.path.normpath (path))
- self.createPath (newpath)
- return newpath + "/"
-
- def __init__ (self, destDir, templateDir):
- self.dest = self.normalize (destDir)
- self.input = self.normalize (templateDir)
- self.packagePath = self.dest
- self.filelists = {}
- self.filelists["h"] = []
- self.filelists["cpp"] = []
- self.filelists["mk"] = []
- self.packagelist = []
- self.templateFiles = []
- self.variables = {}
-
- def setPackage (self, packageName):
- path = "/".join(packageName.split("."))
- self.packagelist.append(path)
- self.packagePath = self.normalize(self.dest + path)
-
- def genDisclaimer (self, stream, variables):
- prefix = variables["commentPrefix"]
- stream.write (prefix + " This source file was created by a code generator.\n")
- stream.write (prefix + " Please do not edit.")
-
- def fileExt (self, path):
- dot = path.rfind (".")
- if dot == -1:
- return ""
- return path[dot + 1:]
-
- def writeIfChanged (self, stream, target, force=False):
- ext = self.fileExt (target)
- self.filelists[ext].append (target)
- tempFile = self.packagePath + "gen.tmp"
- fd = open (tempFile, "w")
- fd.write (stream.getvalue ())
- fd.close ()
-
- try:
- if not force and filecmp.cmp (target, tempFile):
- os.remove (tempFile)
- return
- except:
- pass
-
- try:
- os.remove (target)
- except:
- pass
-
- os.rename (tempFile, target)
- print "Generated:", target
-
- def targetPackageFile (self, schema, templateFile):
- dot = templateFile.find(".")
- if dot == -1:
- raise ValueError ("Invalid template file name %s" % templateFile)
- extension = templateFile[dot:len (templateFile)]
- path = self.packagePath + "Package" + extension
- return path
-
- def targetClassFile (self, _class, templateFile):
- dot = templateFile.find(".")
- if dot == -1:
- raise ValueError ("Invalid template file name %s" % templateFile)
- extension = templateFile[dot:len (templateFile)]
- path = self.packagePath + _class.getNameCap () + extension
- return path
-
- def targetEventFile (self, event, templateFile):
- dot = templateFile.find(".")
- if dot == -1:
- raise ValueError ("Invalid template file name %s" % templateFile)
- extension = templateFile[dot:len (templateFile)]
- path = self.packagePath + "Event" + event.getNameCap () + extension
- return path
-
- def targetMethodFile (self, method, templateFile):
- """ Return the file name for a method file """
- dot = templateFile.rfind(".")
- if dot == -1:
- raise ValueError ("Invalid template file name %s" % templateFile)
- extension = templateFile[dot:]
- path = self.packagePath + "Args" + method.getFullName () + extension
- return path
-
- def initExpansion (self):
- self.variables = {}
-
- def substHandler (self, object, stream, tagObject, tag):
- if tagObject == "Root":
- obj = "self"
- else:
- obj = "object" # MUST be the same as the 2nd formal parameter
-
- call = obj + ".gen" + tag + "(stream, self.variables)"
- eval (call)
-
- def testCondition (self, object, tagObject, tag):
- if tagObject == "Root":
- obj = "self"
- else:
- obj = "object" # MUST be the same as the 2nd formal parameter
-
- call = obj + ".test" + tag + "(self.variables)"
- return eval (call)
-
- def setVariable (self, key, value):
- self.variables[key] = value
-
- def makeClassFiles (self, templateFile, schema, force=False):
- """ Generate an expanded template per schema class """
- classes = schema.getClasses ()
- template = Template (self.input + templateFile, self)
- self.templateFiles.append (templateFile)
- for _class in classes:
- target = self.targetClassFile (_class, templateFile)
- stream = template.expand (_class)
- self.writeIfChanged (stream, target, force)
-
- def makeEventFiles (self, templateFile, schema, force=False):
- """ Generate an expanded template per schema event """
- events = schema.getEvents()
- template = Template (self.input + templateFile, self)
- self.templateFiles.append (templateFile)
- for event in events:
- target = self.targetEventFile(event, templateFile)
- stream = template.expand(event)
- self.writeIfChanged(stream, target, force)
-
- def makeMethodFiles (self, templateFile, schema, force=False):
- """ Generate an expanded template per method-with-arguments """
- classes = schema.getClasses ()
- template = Template (self.input + templateFile, self)
- self.templateFiles.append (templateFile)
- for _class in classes:
- methods = _class.getMethods ()
- for method in methods:
- if method.getArgCount () > 0:
- target = self.targetMethodFile (method, templateFile)
- stream = template.expand (method)
- self.writeIfChanged (stream, target, force)
-
- def makePackageFile (self, templateFile, schema, force=False):
- """ Generate a package-specific file """
- template = Template (self.input + templateFile, self)
- self.templateFiles.append (templateFile)
- target = self.targetPackageFile (schema, templateFile)
- stream = template.expand (schema)
- self.writeIfChanged (stream, target, force)
-
- def makeSingleFile (self, templateFile, target, force=False, vars=None):
- """ Generate a single expanded template """
- makefile = Makefile (self.filelists, self.templateFiles, self.packagelist)
- template = Template (self.input + templateFile, self)
- if vars:
- for arg in vars:
- self.setVariable(arg, vars[arg])
- self.templateFiles.append (templateFile)
- stream = template.expand (makefile)
- self.writeIfChanged (stream, target, force)
-
- def getModulePath():
- return __file__
-
- getModulePath = staticmethod(getModulePath)
diff --git a/M4-RCs/qpid/cpp/managementgen/qmfgen/management-types.xml b/M4-RCs/qpid/cpp/managementgen/qmfgen/management-types.xml
deleted file mode 100644
index 626880afb3..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/management-types.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<schema-types>
-
-<!--
- 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.
--->
-
-<type name="objId" base="REF" cpp="::qpid::management::ObjectId" encode="#.encode(@)" decode="#.decode(@)" accessor="direct" init="::qpid::management::ObjectId()" byRef="y"/>
-<type name="uint8" base="U8" cpp="uint8_t" encode="@.putOctet(#)" decode="# = @.getOctet()" accessor="direct" init="0"/>
-<type name="uint16" base="U16" cpp="uint16_t" encode="@.putShort(#)" decode="# = @.getShort()" accessor="direct" init="0"/>
-<type name="uint32" base="U32" cpp="uint32_t" encode="@.putLong(#)" decode="# = @.getLong()" accessor="direct" init="0"/>
-<type name="uint64" base="U64" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" accessor="direct" init="0"/>
-<type name="int8" base="S8" cpp="int8_t" encode="@.putInt8(#)" decode="# = @.getInt8()" accessor="direct" init="0"/>
-<type name="int16" base="S16" cpp="int16_t" encode="@.putInt16(#)" decode="# = @.getInt16()" accessor="direct" init="0"/>
-<type name="int32" base="S32" cpp="int32_t" encode="@.putInt32(#)" decode="# = @.getInt32()" accessor="direct" init="0"/>
-<type name="int64" base="S64" cpp="int64_t" encode="@.putInt64(#)" decode="# = @.getInt64()" accessor="direct" init="0"/>
-<type name="bool" base="BOOL" cpp="uint8_t" encode="@.putOctet(#?1:0)" decode="# = @.getOctet()==1" accessor="direct" init="0"/>
-<type name="sstr" base="SSTR" cpp="std::string" encode="@.putShortString(#)" decode="@.getShortString(#)" accessor="direct" init='""' byRef="y"/>
-<type name="lstr" base="LSTR" cpp="std::string" encode="@.putMediumString(#)" decode="@.getMediumString(#)" accessor="direct" init='""' byRef="y"/>
-<type name="absTime" base="ABSTIME" cpp="int64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" accessor="direct" init="0"/>
-<type name="deltaTime" base="DELTATIME" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" accessor="direct" init="0"/>
-<type name="float" base="FLOAT" cpp="float" encode="@.putFloat(#)" decode="# = @.getFloat()" accessor="direct" init="0."/>
-<type name="double" base="DOUBLE" cpp="double" encode="@.putDouble(#)" decode="# = @.getDouble()" accessor="direct" init="0."/>
-<type name="uuid" base="UUID" cpp="::qpid::framing::Uuid" encode="#.encode(@)" decode="#.decode(@)" accessor="direct" init="::qpid::framing::Uuid()" byRef="y"/>
-<type name="map" base="FTABLE" cpp="::qpid::framing::FieldTable" encode="#.encode(@)" decode="#.decode(@)" accessor="direct" init="::qpid::framing::FieldTable()" byRef="y"/>
-
-<type name="hilo8" base="U8" cpp="uint8_t" encode="@.putOctet(#)" decode="# = @.getOctet()" style="wm" accessor="counter" init="0"/>
-<type name="hilo16" base="U16" cpp="uint16_t" encode="@.putShort(#)" decode="# = @.getShort()" style="wm" accessor="counter" init="0"/>
-<type name="hilo32" base="U32" cpp="uint32_t" encode="@.putLong(#)" decode="# = @.getLong()" style="wm" accessor="counter" init="0"/>
-<type name="hilo64" base="U64" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" style="wm" accessor="counter" init="0"/>
-
-<type name="count8" base="U8" cpp="uint8_t" encode="@.putOctet(#)" decode="# = @.getOctet()" accessor="counter" init="0" perThread="y"/>
-<type name="count16" base="U16" cpp="uint16_t" encode="@.putShort(#)" decode="# = @.getShort()" accessor="counter" init="0" perThread="y"/>
-<type name="count32" base="U32" cpp="uint32_t" encode="@.putLong(#)" decode="# = @.getLong()" accessor="counter" init="0" perThread="y"/>
-<type name="count64" base="U64" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" accessor="counter" init="0" perThread="y"/>
-
-<!-- Min/Max/Average statistics -->
-<type name="mma32" base="U32" cpp="uint32_t" encode="@.putLong(#)" decode="# = @.getLong()" style="mma" accessor="direct" init="0" perThread="y"/>
-<type name="mma64" base="U64" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" style="mma" accessor="direct" init="0" perThread="y"/>
-<type name="mmaTime" base="DELTATIME" cpp="uint64_t" encode="@.putLongLong(#)" decode="# = @.getLongLong()" style="mma" accessor="direct" init="0" perThread="y"/>
-
-</schema-types>
diff --git a/M4-RCs/qpid/cpp/managementgen/qmfgen/schema.py b/M4-RCs/qpid/cpp/managementgen/qmfgen/schema.py
deleted file mode 100755
index 69823d6de0..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/schema.py
+++ /dev/null
@@ -1,1339 +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 xml.dom.minidom import parse, parseString, Node
-from cStringIO import StringIO
-import md5
-
-class Hash:
- """ Manage the hash of an XML sub-tree """
- def __init__(self, node):
- self.md5Sum = md5.new()
- self._compute(node)
-
- def addSubHash(self, hash):
- """ Use this method to add the hash of a dependend-on XML fragment that is not in the sub-tree """
- self.md5Sum.update(hash.getDigest())
-
- def getDigest(self):
- return self.md5Sum.digest()
-
- def _compute(self, node):
- attrs = node.attributes
- self.md5Sum.update(node.nodeName)
-
- for idx in range(attrs.length):
- self.md5Sum.update(attrs.item(idx).nodeName)
- self.md5Sum.update(attrs.item(idx).nodeValue)
-
- for child in node.childNodes:
- if child.nodeType == Node.ELEMENT_NODE:
- self._compute(child)
-
-
-#=====================================================================================
-#
-#=====================================================================================
-class SchemaType:
- def __init__ (self, node):
- self.name = None
- self.base = None
- self.cpp = None
- self.encode = None
- self.decode = None
- self.style = "normal"
- self.accessor = None
- self.init = "0"
- self.perThread = False
- self.byRef = False
-
- attrs = node.attributes
- for idx in range (attrs.length):
- key = attrs.item(idx).nodeName
- val = attrs.item(idx).nodeValue
- if key == 'name':
- self.name = val
-
- elif key == 'base':
- self.base = val
-
- elif key == 'cpp':
- self.cpp = val
-
- elif key == 'encode':
- self.encode = val
-
- elif key == 'decode':
- self.decode = val
-
- elif key == 'style':
- self.style = val
-
- elif key == 'accessor':
- self.accessor = val
-
- elif key == 'init':
- self.init = val
-
- elif key == 'perThread':
- if val != 'y':
- raise ValueError ("Expected 'y' in perThread attribute")
- self.perThread = True
-
- elif key == 'byRef':
- if val != 'y':
- raise ValueError ("Expected 'y' in byRef attribute")
- self.byRef = True
-
- else:
- raise ValueError ("Unknown attribute in type '%s'" % key)
-
- if self.name == None or self.base == None or self.cpp == None or \
- self.encode == None or self.decode == None:
- raise ValueError ("Missing required attribute(s) in type")
-
- if self.byRef:
- self.asArg = "const " + self.cpp + "&"
- else:
- self.asArg = self.cpp
-
- def getName (self):
- return self.name
-
- def genAccessor (self, stream, varName, changeFlag = None, optional = False):
- if self.perThread:
- prefix = "getThreadStats()->"
- if self.style == "wm":
- raise ValueError ("'wm' style types can't be per-thread")
- else:
- prefix = ""
- if self.accessor == "direct":
- stream.write (" inline void set_" + varName + " (" + self.asArg + " val) {\n");
- if not self.perThread:
- stream.write (" ::qpid::sys::Mutex::ScopedLock mutex(accessLock);\n")
- if self.style != "mma":
- stream.write (" " + prefix + varName + " = val;\n")
- if optional:
- stream.write (" presenceMask[presenceByte_%s] |= presenceMask_%s;\n" % (varName, varName))
- if self.style == "wm":
- stream.write (" if (" + varName + "Low > val)\n")
- stream.write (" " + varName + "Low = val;\n")
- stream.write (" if (" + varName + "High < val)\n")
- stream.write (" " + varName + "High = val;\n")
- if self.style == "mma":
- stream.write (" " + prefix + varName + "Count++;\n")
- stream.write (" " + prefix + varName + "Total += val;\n")
- stream.write (" if (" + prefix + varName + "Min > val)\n")
- stream.write (" " + prefix + varName + "Min = val;\n")
- stream.write (" if (" + prefix + varName + "Max < val)\n")
- stream.write (" " + prefix + varName + "Max = val;\n")
- if changeFlag != None:
- stream.write (" " + changeFlag + " = true;\n")
- stream.write (" }\n")
- if self.style != "mma":
- stream.write (" inline " + self.asArg + " get_" + varName + "() {\n");
- if not self.perThread:
- stream.write (" ::qpid::sys::Mutex::ScopedLock mutex(accessLock);\n")
- stream.write (" return " + prefix + varName + ";\n")
- stream.write (" }\n")
- if optional:
- stream.write (" inline void clr_" + varName + "() {\n")
- stream.write (" presenceMask[presenceByte_%s] &= ~presenceMask_%s;\n" % (varName, varName))
- if changeFlag != None:
- stream.write (" " + changeFlag + " = true;\n")
- stream.write (" }\n")
- stream.write (" inline bool isSet_" + varName + "() {\n")
- stream.write (" return (presenceMask[presenceByte_%s] & presenceMask_%s) != 0;\n" % (varName, varName))
- stream.write (" }\n")
- elif self.accessor == "counter":
- stream.write (" inline void inc_" + varName + " (" + self.asArg + " by = 1) {\n");
- if not self.perThread:
- stream.write (" ::qpid::sys::Mutex::ScopedLock mutex(accessLock);\n")
- stream.write (" " + prefix + varName + " += by;\n")
- if self.style == "wm":
- stream.write (" if (" + varName + "High < " + varName + ")\n")
- stream.write (" " + varName + "High = " + varName + ";\n")
- if changeFlag != None:
- stream.write (" " + changeFlag + " = true;\n")
- stream.write (" }\n");
- stream.write (" inline void dec_" + varName + " (" + self.asArg + " by = 1) {\n");
- if not self.perThread:
- stream.write (" ::qpid::sys::Mutex::ScopedLock mutex(accessLock);\n")
- stream.write (" " + prefix + varName + " -= by;\n")
- if self.style == "wm":
- stream.write (" if (" + varName + "Low > " + varName + ")\n")
- stream.write (" " + varName + "Low = " + varName + ";\n")
- if changeFlag != None:
- stream.write (" " + changeFlag + " = true;\n")
- stream.write (" }\n");
-
- def genHiLoStatResets (self, stream, varName):
- if self.style == "wm":
- stream.write (" " + varName + "High = " + varName + ";\n")
- stream.write (" " + varName + "Low = " + varName + ";\n")
- if self.style == "mma":
- stream.write (" " + varName + "Count = 0;\n")
- stream.write (" " + varName + "Total = 0;\n")
- stream.write (" " + varName + "Min = std::numeric_limits<" + self.type.type.cpp + ">::max();\n")
- stream.write (" " + varName + "Max = std::numeric_limits<" + self.type.type.cpp + ">::min();\n")
-
- def genPerThreadHiLoStatResets (self, stream, varName, cpptype):
- if self.style == "mma":
- stream.write (" threadStats->" + varName + "Count = 0;\n")
- stream.write (" threadStats->" + varName + "Total = 0;\n")
- stream.write (" threadStats->" + varName + "Min = std::numeric_limits<" + cpptype + ">::max();\n")
- stream.write (" threadStats->" + varName + "Max = std::numeric_limits<" + cpptype + ">::min();\n")
-
- def genWrite (self, stream, varName, indent=" "):
- if self.style != "mma":
- stream.write (indent + self.encode.replace ("@", "buf").replace ("#", varName) + ";\n")
- if self.style == "wm":
- stream.write (indent + self.encode.replace ("@", "buf") \
- .replace ("#", varName + "High") + ";\n")
- stream.write (indent + self.encode.replace ("@", "buf") \
- .replace ("#", varName + "Low") + ";\n")
- if self.style == "mma":
- stream.write (indent + self.encode.replace ("@", "buf") \
- .replace ("#", varName + "Count") + ";\n")
- stream.write (indent + self.encode.replace ("@", "buf") \
- .replace ("#", varName + "Count ? " + varName + "Min : 0") + ";\n")
- stream.write (indent + self.encode.replace ("@", "buf") \
- .replace ("#", varName + "Max") + ";\n")
- stream.write (indent + self.encode.replace ("@", "buf") \
- .replace ("#", varName + "Count ? " + varName + "Total / " +
- varName + "Count : 0") + ";\n")
-
-
- def getReadCode (self, varName, bufName):
- result = self.decode.replace ("@", bufName).replace ("#", varName)
- return result
-
- def getWriteCode (self, varName, bufName):
- result = self.encode.replace ("@", bufName).replace ("#", varName)
- return result
-
-#=====================================================================================
-#
-#=====================================================================================
-class TypeSpec:
- def __init__ (self, file):
- self.types = {}
- dom = parse (file)
- document = dom.documentElement
- if document.tagName != 'schema-types':
- raise ValueError ("Expected 'schema-types' in type file")
-
- for child in document.childNodes:
- if child.nodeType == Node.ELEMENT_NODE:
- if child.nodeName == 'type':
- stype = SchemaType (child)
- self.types[stype.getName ()] = stype
- else:
- raise ValueError ("Unknown type tag '%s'" % child.nodeName)
-
- def getType (self, name):
- return self.types[name]
-
-
-#=====================================================================================
-#
-#=====================================================================================
-class Type:
- def __init__ (self, name, typespec):
- self.type = typespec.getType (name)
-
-#=====================================================================================
-#
-#=====================================================================================
-class SchemaProperty:
- def __init__ (self, node, typespec):
- self.name = None
- self.type = None
- self.ref = None
- self.access = "RO"
- self.isIndex = 0
- self.isParentRef = 0
- self.isGeneralRef = 0
- self.isOptional = 0
- self.unit = None
- self.min = None
- self.max = None
- self.maxLen = None
- self.desc = None
-
- attrs = node.attributes
- for idx in range (attrs.length):
- key = attrs.item(idx).nodeName
- val = attrs.item(idx).nodeValue
- if key == 'name':
- self.name = makeValidCppSymbol(val)
-
- elif key == 'type':
- self.type = Type (val, typespec)
- if self.type.type.accessor != 'direct':
- raise ValueError ("Class properties must have a type with a direct accessor")
-
- elif key == 'references':
- self.ref = val
-
- elif key == 'access':
- self.access = val
-
- elif key == 'index':
- if val != 'y':
- raise ValueError ("Expected 'y' in index attribute")
- self.isIndex = 1
-
- elif key == 'parentRef':
- if val != 'y':
- raise ValueError ("Expected 'y' in parentRef attribute")
- self.isParentRef = 1
-
- elif key == 'isGeneralReference':
- if val != 'y':
- raise ValueError ("Expected 'y' in isGeneralReference attribute")
- self.isGeneralRef = 1
-
- elif key == 'optional':
- if val != 'y':
- raise ValueError ("Expected 'y' in optional attribute")
- self.isOptional = 1
-
- elif key == 'unit':
- self.unit = val
-
- elif key == 'min':
- self.min = val
-
- elif key == 'max':
- self.max = val
-
- elif key == 'maxlen':
- self.maxLen = val
-
- elif key == 'desc':
- self.desc = val
-
- else:
- raise ValueError ("Unknown attribute in property '%s'" % key)
-
- if self.access == "RC" and self.isOptional == 1:
- raise ValueError ("Properties with ReadCreate access must not be optional (%s)" % self.name)
-
- if self.name == None:
- raise ValueError ("Missing 'name' attribute in property")
- if self.type == None:
- raise ValueError ("Missing 'type' attribute in property")
-
- def getName (self):
- return self.name
-
- def isConstructorArg (self):
- if self.access == "RC" and self.isParentRef == 0:
- return 1
- return 0
-
- def genDeclaration (self, stream, prefix=" "):
- stream.write (prefix + self.type.type.cpp + " " + self.name + ";\n")
-
- def genFormalParam (self, stream, variables):
- stream.write (self.type.type.asArg + " _" + self.name)
-
- def genAccessor (self, stream):
- self.type.type.genAccessor (stream, self.name, "configChanged", self.isOptional == 1)
-
- def genInitialize (self, stream, prefix="", indent=" "):
- val = self.type.type.init
- stream.write (indent + prefix + self.name + " = " + val + ";\n")
-
- def genSchema (self, stream):
- stream.write (" ft.clear();\n")
- stream.write (" ft.setString (NAME, \"" + self.name + "\");\n")
- stream.write (" ft.setInt (TYPE, TYPE_" + self.type.type.base +");\n")
- stream.write (" ft.setInt (ACCESS, ACCESS_" + self.access + ");\n")
- stream.write (" ft.setInt (IS_INDEX, " + str (self.isIndex) + ");\n")
- stream.write (" ft.setInt (IS_OPTIONAL, " + str (self.isOptional) + ");\n")
- if self.unit != None:
- stream.write (" ft.setString (UNIT, \"" + self.unit + "\");\n")
- if self.min != None:
- stream.write (" ft.setInt (MIN, " + self.min + ");\n")
- if self.max != None:
- stream.write (" ft.setInt (MAX, " + self.max + ");\n")
- if self.maxLen != None:
- stream.write (" ft.setInt (MAXLEN, " + self.maxLen + ");\n")
- if self.desc != None:
- stream.write (" ft.setString (DESC, \"" + self.desc + "\");\n")
- stream.write (" buf.put (ft);\n\n")
-
- def genWrite (self, stream):
- indent = " "
- if self.isOptional:
- stream.write(" if (presenceMask[presenceByte_%s] & presenceMask_%s) {\n" % (self.name, self.name))
- indent = " "
- self.type.type.genWrite (stream, self.name, indent)
- if self.isOptional:
- stream.write(" }\n")
-
-
-#=====================================================================================
-#
-#=====================================================================================
-class SchemaStatistic:
- def __init__ (self, node, typespec):
- self.name = None
- self.type = None
- self.unit = None
- self.desc = None
- self.assign = None
-
- attrs = node.attributes
- for idx in range (attrs.length):
- key = attrs.item(idx).nodeName
- val = attrs.item(idx).nodeValue
- if key == 'name':
- self.name = makeValidCppSymbol(val)
-
- elif key == 'type':
- self.type = Type (val, typespec)
-
- elif key == 'unit':
- self.unit = val
-
- elif key == 'desc':
- self.desc = val
-
- elif key == 'assign':
- self.assign = val
-
- else:
- raise ValueError ("Unknown attribute in statistic '%s'" % key)
-
- if self.name == None:
- raise ValueError ("Missing 'name' attribute in statistic")
- if self.type == None:
- raise ValueError ("Missing 'type' attribute in statistic")
-
- def getName (self):
- return self.name
-
- def genDeclaration (self, stream, prefix=" "):
- if self.type.type.style != "mma":
- stream.write (prefix + self.type.type.cpp + " " + self.name + ";\n")
- if self.type.type.style == 'wm':
- stream.write (prefix + self.type.type.cpp + " " + self.name + "High;\n")
- stream.write (prefix + self.type.type.cpp + " " + self.name + "Low;\n")
- if self.type.type.style == "mma":
- stream.write (prefix + self.type.type.cpp + " " + self.name + "Count;\n")
- stream.write (prefix + "uint64_t " + self.name + "Total;\n")
- stream.write (prefix + self.type.type.cpp + " " + self.name + "Min;\n")
- stream.write (prefix + self.type.type.cpp + " " + self.name + "Max;\n")
-
- def genAccessor (self, stream):
- self.type.type.genAccessor (stream, self.name, "instChanged")
-
- def genHiLoStatResets (self, stream):
- self.type.type.genHiLoStatResets (stream, self.name)
-
- def genPerThreadHiLoStatResets (self, stream):
- self.type.type.genPerThreadHiLoStatResets (stream, self.name, self.type.type.cpp)
-
- def genSchemaText (self, stream, name, desc):
- stream.write (" ft.clear();\n")
- stream.write (" ft.setString (NAME, \"" + name + "\");\n")
- stream.write (" ft.setInt (TYPE, TYPE_" + self.type.type.base +");\n")
- if self.unit != None:
- stream.write (" ft.setString (UNIT, \"" + self.unit + "\");\n")
- if desc != None:
- stream.write (" ft.setString (DESC, \"" + desc + "\");\n")
- stream.write (" buf.put (ft);\n\n")
-
- def genSchema (self, stream):
- if self.type.type.style != "mma":
- self.genSchemaText (stream, self.name, self.desc)
- if self.type.type.style == "wm":
- descHigh = self.desc
- descLow = self.desc
- if self.desc != None:
- descHigh = descHigh + " (High)"
- descLow = descLow + " (Low)"
- self.genSchemaText (stream, self.name + "High", descHigh)
- self.genSchemaText (stream, self.name + "Low", descLow)
- if self.type.type.style == "mma":
- descCount = self.desc
- descMin = self.desc
- descMax = self.desc
- descAverage = self.desc
- if self.desc != None:
- descCount = descCount + " (Samples)"
- descMin = descMin + " (Min)"
- descMax = descMax + " (Max)"
- descAverage = descAverage + " (Average)"
- self.genSchemaText (stream, self.name + "Samples", descCount)
- self.genSchemaText (stream, self.name + "Min", descMin)
- self.genSchemaText (stream, self.name + "Max", descMax)
- self.genSchemaText (stream, self.name + "Average", descAverage)
-
- def genAssign (self, stream):
- if self.assign != None:
- if self.type.type.perThread:
- prefix = " threadStats->"
- else:
- prefix = ""
- stream.write (" " + prefix + self.name + " = (" + self.type.type.cpp +
- ") (" + self.assign + ");\n")
-
- def genWrite (self, stream):
- if self.type.type.perThread:
- self.type.type.genWrite (stream, "totals." + self.name)
- else:
- self.type.type.genWrite (stream, self.name)
-
- def genInitialize (self, stream, prefix="", indent=" "):
- val = self.type.type.init
- if self.type.type.style != "mma":
- stream.write (indent + prefix + self.name + " = " + val + ";\n")
- if self.type.type.style == "wm":
- stream.write (indent + prefix + self.name + "High = " + val + ";\n")
- stream.write (indent + prefix + self.name + "Low = " + val + ";\n")
- if self.type.type.style == "mma":
- stream.write (indent + prefix + self.name + "Count = 0;\n")
- stream.write (indent + prefix + self.name + "Min = std::numeric_limits<" + self.type.type.cpp + ">::max();\n")
- stream.write (indent + prefix + self.name + "Max = std::numeric_limits<" + self.type.type.cpp + ">::min();\n")
- stream.write (indent + prefix + self.name + "Total = 0;\n")
-
- def genInitializeTotalPerThreadStats (self, stream):
- if self.type.type.style == "mma":
- stream.write (" totals->" + self.name + "Count = 0;\n")
- stream.write (" totals->" + self.name + "Min = std::numeric_limits<" + self.type.type.cpp + ">::max();\n")
- stream.write (" totals->" + self.name + "Max = std::numeric_limits<" + self.type.type.cpp + ">::min();\n")
- stream.write (" totals->" + self.name + "Total = 0;\n")
- else:
- stream.write (" totals->" + self.name + " = 0;\n")
-
- def genAggregatePerThreadStats (self, stream):
- if self.type.type.style == "mma":
- stream.write (" totals->%sCount += threadStats->%sCount;\n" % (self.name, self.name))
- stream.write (" if (totals->%sMin > threadStats->%sMin)\n" % (self.name, self.name))
- stream.write (" totals->%sMin = threadStats->%sMin;\n" % (self.name, self.name))
- stream.write (" if (totals->%sMax < threadStats->%sMax)\n" % (self.name, self.name))
- stream.write (" totals->%sMax = threadStats->%sMax;\n" % (self.name, self.name))
- stream.write (" totals->%sTotal += threadStats->%sTotal;\n" % (self.name, self.name))
- else:
- stream.write (" totals->%s += threadStats->%s;\n" % (self.name, self.name))
-
-#=====================================================================================
-#
-#=====================================================================================
-class SchemaArg:
- def __init__ (self, node, typespec):
- self.name = None
- self.type = None
- self.unit = None
- self.dir = "I"
- self.min = None
- self.max = None
- self.maxLen = None
- self.desc = None
- self.default = None
- self.hash = Hash(node)
-
- attrs = node.attributes
- for idx in range (attrs.length):
- key = attrs.item(idx).nodeName
- val = attrs.item(idx).nodeValue
- if key == 'name':
- self.name = makeValidCppSymbol(val)
-
- elif key == 'type':
- self.type = Type (val, typespec)
-
- elif key == 'unit':
- self.unit = val
-
- elif key == 'dir':
- self.dir = val.upper ()
-
- elif key == 'min':
- self.min = val
-
- elif key == 'max':
- self.max = val
-
- elif key == 'maxlen':
- self.maxLen = val
-
- elif key == 'desc':
- self.desc = val
-
- elif key == 'default':
- self.default = val
-
- else:
- raise ValueError ("Unknown attribute in arg '%s'" % key)
-
- if self.name == None:
- raise ValueError ("Missing 'name' attribute in arg")
- if self.type == None:
- raise ValueError ("Missing 'type' attribute in arg")
-
- def getName (self):
- return self.name
-
- def getDir (self):
- return self.dir
-
- def genSchema (self, stream, event=False):
- stream.write (" ft.clear();\n")
- stream.write (" ft.setString (NAME, \"" + self.name + "\");\n")
- stream.write (" ft.setInt (TYPE, TYPE_" + self.type.type.base +");\n")
- if (not event):
- stream.write (" ft.setString (DIR, \"" + self.dir + "\");\n")
- if self.unit != None:
- stream.write (" ft.setString (UNIT, \"" + self.unit + "\");\n")
- if not event:
- if self.min != None:
- stream.write (" ft.setInt (MIN, " + self.min + ");\n")
- if self.max != None:
- stream.write (" ft.setInt (MAX, " + self.max + ");\n")
- if self.maxLen != None:
- stream.write (" ft.setInt (MAXLEN, " + self.maxLen + ");\n")
- if self.default != None:
- stream.write (" ft.setString (DEFAULT, \"" + self.default + "\");\n")
- if self.desc != None:
- stream.write (" ft.setString (DESC, \"" + self.desc + "\");\n")
- stream.write (" buf.put (ft);\n\n")
-
- def genFormalParam (self, stream, variables):
- stream.write ("%s _%s" % (self.type.type.asArg, self.name))
-
-#=====================================================================================
-#
-#=====================================================================================
-class SchemaMethod:
- def __init__ (self, parent, node, typespec):
- self.parent = parent
- self.name = None
- self.desc = None
- self.args = []
-
- attrs = node.attributes
- for idx in range (attrs.length):
- key = attrs.item(idx).nodeName
- val = attrs.item(idx).nodeValue
- if key == 'name':
- self.name = makeValidCppSymbol(val)
-
- elif key == 'desc':
- self.desc = val
-
- else:
- raise ValueError ("Unknown attribute in method '%s'" % key)
-
- for child in node.childNodes:
- if child.nodeType == Node.ELEMENT_NODE:
- if child.nodeName == 'arg':
- arg = SchemaArg (child, typespec)
- self.args.append (arg)
- else:
- raise ValueError ("Unknown method tag '%s'" % child.nodeName)
-
- def getName (self):
- return self.name
-
- def getFullName (self):
- return capitalize(self.parent.getName()) + self.name[0:1].upper() +\
- self.name[1:]
-
- def getArgCount (self):
- return len (self.args)
-
- #===================================================================================
- # Code Generation Functions. The names of these functions (minus the leading "gen")
- # match the substitution keywords in the template files.
- #===================================================================================
- def genNameUpper (self, stream, variables):
- stream.write (self.getFullName ().upper ())
-
- def genNameCamel (self, stream, variables):
- stream.write (self.getFullName ())
-
- def genOpenNamespaces (self, stream, variables):
- self.parent.genOpenNamespaces(stream, variables)
-
- def genCloseNamespaces (self, stream, variables):
- self.parent.genCloseNamespaces(stream, variables)
-
- def genArguments (self, stream, variables):
- for arg in self.args:
- ctype = arg.type.type.cpp
- dirTag = arg.dir.lower() + "_"
- stream.write (" " + ctype + " " + dirTag + arg.getName () + ";\n")
-
- def genNamePackageLower (self, stream, variables):
- self.parent.genNamePackageLower(stream, variables)
-
- def genSchema (self, stream, variables):
- stream.write (" ft.clear();\n")
- stream.write (" ft.setString (NAME, \"" + self.name + "\");\n")
- stream.write (" ft.setInt (ARGCOUNT, " + str (len (self.args)) + ");\n")
- if self.desc != None:
- stream.write (" ft.setString (DESC, \"" + self.desc + "\");\n")
- stream.write (" buf.put (ft);\n\n")
- for arg in self.args:
- arg.genSchema (stream)
-
-#=====================================================================================
-#
-#=====================================================================================
-class SchemaEvent:
- def __init__ (self, package, node, typespec, argset):
- self.packageName = package
- self.name = None
- self.desc = None
- self.sevText = "inform"
- self.args = []
- self.hash = Hash(node)
-
- attrs = node.attributes
- for idx in range (attrs.length):
- key = attrs.item(idx).nodeName
- val = attrs.item(idx).nodeValue
- if key == 'name':
- self.name = val
-
- elif key == 'desc':
- self.desc = val
-
- elif key == 'sev':
- self.sevText = val
-
- elif key == 'args':
- list = val.replace(" ", "").split(",")
- for item in list:
- if item not in argset.args:
- raise Exception("undefined argument '%s' in event" % item)
- self.args.append(argset.args[item])
- self.hash.addSubHash(argset.args[item].hash)
-
- else:
- raise ValueError ("Unknown attribute in event '%s'" % key)
-
- if self.sevText == "emerg" : self.sev = 0
- elif self.sevText == "alert" : self.sev = 1
- elif self.sevText == "crit" : self.sev = 2
- elif self.sevText == "error" : self.sev = 3
- elif self.sevText == "warn" : self.sev = 4
- elif self.sevText == "notice" : self.sev = 5
- elif self.sevText == "inform" : self.sev = 6
- elif self.sevText == "debug" : self.sev = 7
- else:
- raise ValueError("Unknown severity '%s' in event '%s'" % (self.sevText, self.name))
-
- def getName (self):
- return self.name
-
- def getNameCap(self):
- return capitalize(self.name)
-
- def getFullName (self):
- return capitalize(self.package + capitalize(self.name))
-
- def getArgCount (self):
- return len (self.args)
-
- def genArgCount (self, stream, variables):
- stream.write("%d" % len(self.args))
-
- def genArgDeclarations(self, stream, variables):
- for arg in self.args:
- if arg.type.type.byRef:
- ref = "&"
- else:
- ref = ""
- stream.write(" const %s%s %s;\n" % (arg.type.type.cpp, ref, arg.name))
-
- def genCloseNamespaces (self, stream, variables):
- for item in self.packageName.split("."):
- stream.write ("}")
-
- def genConstructorArgs(self, stream, variables):
- pre = ""
- for arg in self.args:
- if arg.type.type.byRef:
- ref = "&"
- else:
- ref = ""
- stream.write("%sconst %s%s _%s" % (pre, arg.type.type.cpp, ref, arg.name))
- pre = ",\n "
-
- def genConstructorInits(self, stream, variables):
- pre = ""
- for arg in self.args:
- stream.write("%s%s(_%s)" % (pre, arg.name, arg.name))
- pre = ",\n "
-
- def genName(self, stream, variables):
- stream.write(self.name)
-
- def genNameCap(self, stream, variables):
- stream.write(capitalize(self.name))
-
- def genNamespace (self, stream, variables):
- stream.write("::".join(self.packageName.split(".")))
-
- def genNameLower(self, stream, variables):
- stream.write(self.name.lower())
-
- def genNameUpper(self, stream, variables):
- stream.write(self.name.upper())
-
- def genNamePackageLower(self, stream, variables):
- stream.write(self.packageName.lower())
-
- def genOpenNamespaces (self, stream, variables):
- for item in self.packageName.split("."):
- stream.write ("namespace %s {\n" % item)
-
- def genSeverity(self, stream, variables):
- stream.write("%d" % self.sev)
-
- def genArgEncodes(self, stream, variables):
- for arg in self.args:
- stream.write(" " + arg.type.type.encode.replace("@", "buf").replace("#", arg.name) + ";\n")
-
- def genArgSchema(self, stream, variables):
- for arg in self.args:
- arg.genSchema(stream, True)
-
- def genSchemaMD5(self, stream, variables):
- sum = self.hash.getDigest()
- for idx in range (len (sum)):
- if idx != 0:
- stream.write (",")
- stream.write (hex (ord (sum[idx])))
-
-
-class SchemaClass:
- def __init__ (self, package, node, typespec, fragments, options):
- self.packageName = package
- self.properties = []
- self.statistics = []
- self.methods = []
- self.events = []
- self.options = options
- self.hash = Hash(node)
-
- attrs = node.attributes
- self.name = makeValidCppSymbol(attrs['name'].nodeValue)
-
- children = node.childNodes
- for child in children:
- if child.nodeType == Node.ELEMENT_NODE:
- if child.nodeName == 'property':
- sub = SchemaProperty (child, typespec)
- self.properties.append (sub)
-
- elif child.nodeName == 'statistic':
- sub = SchemaStatistic (child, typespec)
- self.statistics.append (sub)
-
- elif child.nodeName == 'method':
- sub = SchemaMethod (self, child, typespec)
- self.methods.append (sub)
-
- elif child.nodeName == 'group':
- self.expandFragment (child, fragments)
-
- else:
- raise ValueError ("Unknown class tag '%s'" % child.nodeName)
-
- # Adjust the 'assign' attributes for each statistic
- for stat in self.statistics:
- if stat.assign != None and stat.type.type.perThread:
- stat.assign = self.adjust (stat.assign, self.statistics)
-
- def adjust (self, text, statistics):
- result = text
- start = 0
- while True:
- next = None
- for stat in statistics:
- pos = result.find (stat.name, start)
- if pos != -1 and (next == None or pos < next[0]):
- next = (pos, stat.name)
- if next == None:
- return result
- pos = next[0]
- result = result[0:pos] + "threadStats->" + result[pos:]
- start = pos + 9 + len(next[1])
-
- def expandFragment (self, node, fragments):
- attrs = node.attributes
- name = attrs['name'].nodeValue
- for fragment in fragments:
- if fragment.name == name:
- self.hash.addSubHash(fragment.hash)
- for config in fragment.properties:
- self.properties.append (config)
- for inst in fragment.statistics:
- self.statistics.append (inst)
- for method in fragment.methods:
- self.methods.append (method)
- for event in fragment.events:
- self.events.append (event)
- return
- raise ValueError ("Undefined group '%s'" % name)
-
- def getName (self):
- return self.name
-
- def getNameCap (self):
- return capitalize(self.name)
-
- def getMethods (self):
- return self.methods
-
- def getEvents (self):
- return self.events
-
- def getPackageNameCap (self):
- return capitalize(self.packageName)
-
- #===================================================================================
- # Code Generation Functions. The names of these functions (minus the leading "gen")
- # match the substitution keywords in the template files.
- #===================================================================================
- def testExistOptionals (self, variables):
- for prop in self.properties:
- if prop.isOptional == 1:
- return True
- return False
-
- def testExistPerThreadStats (self, variables):
- for inst in self.statistics:
- if inst.type.type.perThread:
- return True
- return False
-
- def testExistPerThreadAssign (self, variables):
- for inst in self.statistics:
- if inst.type.type.perThread and inst.assign != None:
- return True
- return False
-
- def testExistPerThreadResets (self, variables):
- for inst in self.statistics:
- if inst.type.type.perThread and inst.type.type.style == "mma":
- return True
- return False
-
- def testNoStatistics (self, variables):
- return len (self.statistics) == 0
-
- def genAccessorMethods (self, stream, variables):
- for config in self.properties:
- if config.access != "RC":
- config.genAccessor (stream)
- for inst in self.statistics:
- if inst.assign == None:
- inst.genAccessor (stream)
-
- def genCloseNamespaces (self, stream, variables):
- for item in self.packageName.split("."):
- stream.write ("}")
-
- def genConfigCount (self, stream, variables):
- stream.write ("%d" % len (self.properties))
-
- def genConfigDeclarations (self, stream, variables):
- for element in self.properties:
- element.genDeclaration (stream)
-
- def genConstructorArgs (self, stream, variables):
- # Constructor args are config elements with read-create access
- result = ""
- for element in self.properties:
- if element.isConstructorArg ():
- stream.write (", ")
- element.genFormalParam (stream, variables)
-
- def genConstructorInits (self, stream, variables):
- for element in self.properties:
- if element.isConstructorArg ():
- stream.write ("," + element.getName () + "(_" + element.getName () + ")")
-
- def genDoMethodArgs (self, stream, variables):
- methodCount = 0
- inArgCount = 0
- for method in self.methods:
- methodCount = methodCount + 1
- for arg in method.args:
- if arg.getDir () == "I" or arg.getDir () == "IO":
- inArgCount = inArgCount + 1
-
- if methodCount == 0:
- stream.write ("string&, Buffer&, Buffer& outBuf")
- else:
- if inArgCount == 0:
- stream.write ("string& methodName, Buffer&, Buffer& outBuf")
- else:
- stream.write ("string& methodName, Buffer& inBuf, Buffer& outBuf")
-
- def genHiLoStatResets (self, stream, variables):
- for inst in self.statistics:
- if not inst.type.type.perThread:
- inst.genHiLoStatResets (stream)
-
- def genPerThreadHiLoStatResets (self, stream, variables):
- for inst in self.statistics:
- if inst.type.type.perThread:
- inst.genPerThreadHiLoStatResets (stream)
-
- def genInitializeElements (self, stream, variables):
- for prop in self.properties:
- if not prop.isConstructorArg() and not prop.isParentRef:
- prop.genInitialize(stream)
- for inst in self.statistics:
- if not inst.type.type.perThread:
- inst.genInitialize (stream)
-
- def genInitializePerThreadElements (self, stream, variables):
- for inst in self.statistics:
- if inst.type.type.perThread:
- inst.genInitialize (stream, "threadStats->", " ")
-
- def genInitializeTotalPerThreadStats (self, stream, variables):
- for inst in self.statistics:
- if inst.type.type.perThread:
- inst.genInitializeTotalPerThreadStats (stream)
-
- def genAggregatePerThreadStats (self, stream, variables):
- for inst in self.statistics:
- if inst.type.type.perThread:
- inst.genAggregatePerThreadStats (stream)
-
- def genInstCount (self, stream, variables):
- count = 0
- for inst in self.statistics:
- count = count + 1
- if inst.type.type.style == "wm":
- count = count + 2
- if inst.type.type.style == "mma":
- count = count + 3
- stream.write ("%d" % count)
-
- def genInstDeclarations (self, stream, variables):
- for element in self.statistics:
- if not element.type.type.perThread:
- element.genDeclaration (stream)
-
- def genPerThreadDeclarations (self, stream, variables):
- for element in self.statistics:
- if element.type.type.perThread:
- element.genDeclaration (stream, " ")
-
- def genNamespace (self, stream, variables):
- stream.write("::".join(self.packageName.split(".")))
-
- def genMethodArgIncludes (self, stream, variables):
- for method in self.methods:
- if method.getArgCount () > 0:
- stream.write ("#include \"Args" + method.getFullName () + ".h\"\n")
-
- def genMethodCount (self, stream, variables):
- stream.write ("%d" % len (self.methods))
-
- def genMethodHandlers (self, stream, variables):
- for method in self.methods:
- stream.write ("\n if (methodName == \"" + method.getName () + "\") {\n")
- if method.getArgCount () == 0:
- stream.write (" ::qpid::management::ArgsNone ioArgs;\n")
- else:
- stream.write (" Args" + method.getFullName () + " ioArgs;\n")
- for arg in method.args:
- if arg.getDir () == "I" or arg.getDir () == "IO":
- stream.write (" " +\
- arg.type.type.getReadCode ("ioArgs." +\
- arg.dir.lower () + "_" +\
- arg.name, "inBuf") + ";\n")
-
- stream.write (" status = coreObject->ManagementMethod (METHOD_" +\
- method.getName().upper() + ", ioArgs, text);\n")
- stream.write (" outBuf.putLong (status);\n")
- stream.write (" outBuf.putMediumString(::qpid::management::Manageable::StatusText (status, text));\n")
- for arg in method.args:
- if arg.getDir () == "O" or arg.getDir () == "IO":
- stream.write (" " +\
- arg.type.type.getWriteCode ("ioArgs." +\
- arg.dir.lower () + "_" +\
- arg.name, "outBuf") + ";\n")
- stream.write (" return;\n }\n")
-
- def genOpenNamespaces (self, stream, variables):
- for item in self.packageName.split("."):
- stream.write ("namespace %s {\n" % item)
-
- def genPresenceMaskBytes (self, stream, variables):
- count = 0
- for prop in self.properties:
- if prop.isOptional == 1:
- count += 1
- if count == 0:
- stream.write("0")
- else:
- stream.write (str(((count - 1) / 8) + 1))
-
- def genPresenceMaskConstants (self, stream, variables):
- count = 0
- for prop in self.properties:
- if prop.isOptional == 1:
- stream.write(" static const uint8_t presenceByte_%s = %d;\n" % (prop.name, count / 8))
- stream.write(" static const uint8_t presenceMask_%s = %d;\n" % (prop.name, 1 << (count % 8)))
- count += 1
-
- def genPropertySchema (self, stream, variables):
- for prop in self.properties:
- prop.genSchema (stream)
-
- def genSetGeneralReferenceDeclaration (self, stream, variables):
- for prop in self.properties:
- if prop.isGeneralRef:
- stream.write ("void setReference(::qpid::management::ObjectId objectId) { " + prop.name + " = objectId; }\n")
-
- def genStatisticSchema (self, stream, variables):
- for stat in self.statistics:
- stat.genSchema (stream)
-
- def genMethodIdDeclarations (self, stream, variables):
- number = 1
- for method in self.methods:
- stream.write (" static const uint32_t METHOD_" + method.getName().upper() +\
- " = %d;\n" % number)
- number = number + 1
-
- def genMethodSchema (self, stream, variables):
- for method in self.methods:
- method.genSchema (stream, variables)
-
- def genNameCap (self, stream, variables):
- stream.write (capitalize(self.name))
-
- def genNameLower (self, stream, variables):
- stream.write (self.name.lower ())
-
- def genNamePackageCap (self, stream, variables):
- stream.write (self.getPackageNameCap ())
-
- def genNamePackageLower (self, stream, variables):
- stream.write (self.packageName.lower ())
-
- def genNameUpper (self, stream, variables):
- stream.write (self.name.upper ())
-
- def genParentArg (self, stream, variables):
- for config in self.properties:
- if config.isParentRef == 1:
- stream.write (", ::qpid::management::Manageable* _parent")
- return
-
- def genParentRefAssignment (self, stream, variables):
- for config in self.properties:
- if config.isParentRef == 1:
- stream.write (config.getName () + \
- " = _parent->GetManagementObject ()->getObjectId ();")
- return
-
- def genSchemaMD5 (self, stream, variables):
- sum = self.hash.getDigest()
- for idx in range (len (sum)):
- if idx != 0:
- stream.write (",")
- stream.write (hex (ord (sum[idx])))
-
- def genAssign (self, stream, variables):
- for inst in self.statistics:
- if not inst.type.type.perThread:
- inst.genAssign (stream)
-
- def genPerThreadAssign (self, stream, variables):
- for inst in self.statistics:
- if inst.type.type.perThread:
- inst.genAssign (stream)
-
- def genWriteProperties (self, stream, variables):
- for prop in self.properties:
- prop.genWrite (stream)
-
- def genWriteStatistics (self, stream, variables):
- for stat in self.statistics:
- stat.genWrite (stream)
-
-
-class SchemaEventArgs:
- def __init__(self, package, node, typespec, fragments, options):
- self.packageName = package
- self.options = options
- self.args = {}
-
- children = node.childNodes
- for child in children:
- if child.nodeType == Node.ELEMENT_NODE:
- if child.nodeName == 'arg':
- arg = SchemaArg(child, typespec)
- self.args[arg.name] = arg
- else:
- raise Exception("Unknown tag '%s' in <eventArguments>" % child.nodeName)
-
-class SchemaPackage:
- def __init__ (self, typefile, schemafile, options):
-
- self.classes = []
- self.fragments = []
- self.typespec = TypeSpec (typefile)
- self.eventArgSet = None
- self.events = []
-
- dom = parse (schemafile)
- document = dom.documentElement
- if document.tagName != 'schema':
- raise ValueError ("Expected 'schema' node")
- attrs = document.attributes
- pname = attrs['package'].nodeValue
- namelist = pname.split('.')
- self.packageName = ".".join(namelist)
-
- children = document.childNodes
- for child in children:
- if child.nodeType == Node.ELEMENT_NODE:
- if child.nodeName == 'class':
- cls = SchemaClass (self.packageName, child, self.typespec,
- self.fragments, options)
- self.classes.append (cls)
-
- elif child.nodeName == 'group':
- cls = SchemaClass (self.packageName, child, self.typespec,
- self.fragments, options)
- self.fragments.append (cls)
-
- elif child.nodeName == 'eventArguments':
- if self.eventArgSet:
- raise Exception("Only one <eventArguments> may appear in a package")
- self.eventArgSet = SchemaEventArgs(self.packageName, child, self.typespec, self.fragments, options)
-
- elif child.nodeName == 'event':
- event = SchemaEvent(self.packageName, child, self.typespec, self.eventArgSet)
- self.events.append(event)
-
- else:
- raise ValueError ("Unknown schema tag '%s'" % child.nodeName)
-
- def getPackageName (self):
- return self.packageName
-
- def getPackageNameCap (self):
- return capitalize(self.packageName)
-
- def getPackageNameLower (self):
- return self.packageName.lower()
-
- def getClasses (self):
- return self.classes
-
- def getEvents(self):
- return self.events
-
- def genCloseNamespaces (self, stream, variables):
- for item in self.packageName.split("."):
- stream.write ("}")
-
- def genNamespace (self, stream, variables):
- stream.write("::".join(self.packageName.split(".")))
-
- def genOpenNamespaces (self, stream, variables):
- for item in self.packageName.split("."):
- stream.write ("namespace %s {\n" % item)
-
- def genPackageNameUpper (self, stream, variables):
- up = "_".join(self.packageName.split("."))
- stream.write (up.upper())
-
- def genNamePackageLower (self, stream, variables):
- stream.write (self.packageName.lower ())
-
- def genClassIncludes (self, stream, variables):
- for _class in self.classes:
- stream.write ("#include \"")
- _class.genNameCap (stream, variables)
- stream.write (".h\"\n")
- for _event in self.events:
- stream.write ("#include \"Event")
- _event.genNameCap(stream, variables)
- stream.write (".h\"\n")
-
- def genClassRegisters(self, stream, variables):
- for _class in self.classes:
- stream.write(" ")
- _class.genNameCap(stream, variables)
- stream.write("::registerSelf(agent);\n")
- for _event in self.events:
- stream.write(" Event")
- _event.genNameCap(stream, variables)
- stream.write("::registerSelf(agent);\n")
-
-
-#=====================================================================================
-# Utility Functions
-#=====================================================================================
-
-# Create a valid C++ symbol from the input string so that it can be
-# used in generated C++ source. For instance, change "qpid.mgmt" to
-# "qpidMgmt".
-#
-# Input: Raw string (str) to process
-# Output: String (str) suitable for use as a C++ symbol
-#
-# Limitations: Currently, only strips periods ('.') from strings,
-# eventually should strip :'s and ,'s and ''s, oh my!
-def makeValidCppSymbol(input):
- output = str()
- capitalize = False
-
- for char in input:
- skip = False
-
- if char == ".":
- capitalize = True
- skip = True
-
- if not skip:
- output += capitalize and char.upper() or char
-
- capitalize = False
-
- return output
-
-# Capitalize a string by /only/ forcing the first character to be
-# uppercase. The rest of the string is left alone. This is different
-# from str.capitalize(), which forces the first character to uppercase
-# and the rest to lowercase.
-#
-# Input: A string (str) to capitalize
-# Output: A string (str) with the first character as uppercase
-def capitalize(input):
- return input[0].upper() + input[1:]
diff --git a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Args.h b/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Args.h
deleted file mode 100644
index 074ccf9940..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Args.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*MGEN:commentPrefix=//*/
-#ifndef _ARGS_/*MGEN:Method.NameUpper*/_
-#define _ARGS_/*MGEN:Method.NameUpper*/_
-
-//
-// 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.
-//
-
-/*MGEN:Root.Disclaimer*/
-
-#include "qpid/management/Args.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/Uuid.h"
-#include <string>
-
-namespace qmf {
-/*MGEN:Method.OpenNamespaces*/
-
- class Args/*MGEN:Method.NameCamel*/ : public ::qpid::management::Args
-{
- public:
-/*MGEN:Method.Arguments*/
-};
-
-}/*MGEN:Method.CloseNamespaces*/
-
-#endif /*!_ARGS_/*MGEN:Method.NameUpper*/_*/
diff --git a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Class.cpp b/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Class.cpp
deleted file mode 100644
index 247e1090ff..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Class.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/*MGEN:commentPrefix=//*/
-//
-// 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.
-//
-
-/*MGEN:Root.Disclaimer*/
-
-#include "qpid/log/Statement.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/management/Manageable.h"
-#include "qpid/agent/ManagementAgent.h"
-#include "/*MGEN:Class.NameCap*/.h"
-/*MGEN:Class.MethodArgIncludes*/
-
-using namespace qmf::/*MGEN:Class.Namespace*/;
-using namespace qpid::framing;
-using qpid::management::ManagementAgent;
-using qpid::management::Manageable;
-using qpid::management::ManagementObject;
-using qpid::management::Args;
-using std::string;
-
-string /*MGEN:Class.NameCap*/::packageName = string ("/*MGEN:Class.NamePackageLower*/");
-string /*MGEN:Class.NameCap*/::className = string ("/*MGEN:Class.NameLower*/");
-uint8_t /*MGEN:Class.NameCap*/::md5Sum[16] =
- {/*MGEN:Class.SchemaMD5*/};
-
-/*MGEN:Class.NameCap*/::/*MGEN:Class.NameCap*/ (ManagementAgent* _agent, Manageable* _core/*MGEN:Class.ParentArg*//*MGEN:Class.ConstructorArgs*/) :
- ManagementObject(_agent, _core)/*MGEN:Class.ConstructorInits*/
-{
- /*MGEN:Class.ParentRefAssignment*/
-/*MGEN:Class.InitializeElements*/
-/*MGEN:IF(Class.ExistOptionals)*/
- // Optional properties start out not-present
- for (uint8_t idx = 0; idx < /*MGEN:Class.PresenceMaskBytes*/; idx++)
- presenceMask[idx] = 0;
-/*MGEN:ENDIF*/
-/*MGEN:IF(Class.ExistPerThreadStats)*/
- maxThreads = agent->getMaxThreads();
- perThreadStatsArray = new struct PerThreadStats*[maxThreads];
- for (int idx = 0; idx < maxThreads; idx++)
- perThreadStatsArray[idx] = 0;
-/*MGEN:ENDIF*/
-}
-
-/*MGEN:Class.NameCap*/::~/*MGEN:Class.NameCap*/ ()
-{
-/*MGEN:IF(Class.ExistPerThreadStats)*/
- for (int idx = 0; idx < maxThreads; idx++)
- if (perThreadStatsArray[idx] != 0)
- delete perThreadStatsArray[idx];
- delete[] perThreadStatsArray;
-/*MGEN:ENDIF*/
-}
-
-namespace {
- const string NAME("name");
- const string TYPE("type");
- const string ACCESS("access");
- const string IS_INDEX("index");
- const string IS_OPTIONAL("optional");
- const string UNIT("unit");
- const string MIN("min");
- const string MAX("max");
- const string MAXLEN("maxlen");
- const string DESC("desc");
- const string ARGCOUNT("argCount");
- const string ARGS("args");
- const string DIR("dir");
- const string DEFAULT("default");
-}
-
-void /*MGEN:Class.NameCap*/::registerSelf(ManagementAgent* agent)
-{
- agent->registerClass(packageName, className, md5Sum, writeSchema);
-}
-
-void /*MGEN:Class.NameCap*/::writeSchema (Buffer& buf)
-{
- FieldTable ft;
-
- // Schema class header:
- buf.putOctet (CLASS_KIND_TABLE);
- buf.putShortString (packageName); // Package Name
- buf.putShortString (className); // Class Name
- buf.putBin128 (md5Sum); // Schema Hash
- buf.putShort (/*MGEN:Class.ConfigCount*/); // Config Element Count
- buf.putShort (/*MGEN:Class.InstCount*/); // Inst Element Count
- buf.putShort (/*MGEN:Class.MethodCount*/); // Method Count
-
- // Properties
-/*MGEN:Class.PropertySchema*/
- // Statistics
-/*MGEN:Class.StatisticSchema*/
- // Methods
-/*MGEN:Class.MethodSchema*/
-}
-
-/*MGEN:IF(Class.ExistPerThreadStats)*/
-void /*MGEN:Class.NameCap*/::aggregatePerThreadStats(struct PerThreadStats* totals)
-{
-/*MGEN:Class.InitializeTotalPerThreadStats*/
- for (int idx = 0; idx < maxThreads; idx++) {
- struct PerThreadStats* threadStats = perThreadStatsArray[idx];
- if (threadStats != 0) {
-/*MGEN:Class.AggregatePerThreadStats*/
- }
- }
-}
-/*MGEN:ENDIF*/
-
-void /*MGEN:Class.NameCap*/::writeProperties (Buffer& buf)
-{
- ::qpid::sys::Mutex::ScopedLock mutex(accessLock);
- configChanged = false;
-
- writeTimestamps (buf);
-/*MGEN:IF(Class.ExistOptionals)*/
- for (uint8_t idx = 0; idx < /*MGEN:Class.PresenceMaskBytes*/; idx++)
- buf.putOctet(presenceMask[idx]);
-/*MGEN:ENDIF*/
-/*MGEN:Class.WriteProperties*/
-}
-
-void /*MGEN:Class.NameCap*/::writeStatistics (Buffer& buf, bool skipHeaders)
-{
- ::qpid::sys::Mutex::ScopedLock mutex(accessLock);
- instChanged = false;
-/*MGEN:IF(Class.ExistPerThreadAssign)*/
- for (int idx = 0; idx < maxThreads; idx++) {
- struct PerThreadStats* threadStats = perThreadStatsArray[idx];
- if (threadStats != 0) {
-/*MGEN:Class.PerThreadAssign*/
- }
- }
-/*MGEN:ENDIF*/
-/*MGEN:IF(Class.ExistPerThreadStats)*/
- struct PerThreadStats totals;
- aggregatePerThreadStats(&totals);
-/*MGEN:ENDIF*/
-/*MGEN:Class.Assign*/
- if (!skipHeaders)
- writeTimestamps (buf);
-/*MGEN:Class.WriteStatistics*/
-
- // Maintenance of hi-lo statistics
-/*MGEN:Class.HiLoStatResets*/
-/*MGEN:IF(Class.ExistPerThreadResets)*/
- for (int idx = 0; idx < maxThreads; idx++) {
- struct PerThreadStats* threadStats = perThreadStatsArray[idx];
- if (threadStats != 0) {
-/*MGEN:Class.PerThreadHiLoStatResets*/
- }
- }
-/*MGEN:ENDIF*/
-}
-
-void /*MGEN:Class.NameCap*/::doMethod (/*MGEN:Class.DoMethodArgs*/)
-{
- Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
- std::string text;
-
-/*MGEN:Class.MethodHandlers*/
- outBuf.putLong(status);
- outBuf.putShortString(Manageable::StatusText(status, text));
-}
diff --git a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Class.h b/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Class.h
deleted file mode 100644
index 0bf9911895..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Class.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*MGEN:commentPrefix=//*/
-#ifndef _MANAGEMENT_/*MGEN:Class.NameUpper*/_
-#define _MANAGEMENT_/*MGEN:Class.NameUpper*/_
-
-//
-// 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.
-//
-
-/*MGEN:Root.Disclaimer*/
-
-#include "qpid/management/ManagementObject.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/Uuid.h"
-
-namespace qmf {
-/*MGEN:Class.OpenNamespaces*/
-
-class /*MGEN:Class.NameCap*/ : public ::qpid::management::ManagementObject
-{
- private:
-
- static std::string packageName;
- static std::string className;
- static uint8_t md5Sum[16];
-/*MGEN:IF(Class.ExistOptionals)*/
- uint8_t presenceMask[/*MGEN:Class.PresenceMaskBytes*/];
-/*MGEN:Class.PresenceMaskConstants*/
-/*MGEN:ENDIF*/
-
- // Properties
-/*MGEN:Class.ConfigDeclarations*/
- // Statistics
-/*MGEN:Class.InstDeclarations*/
-/*MGEN:IF(Class.ExistPerThreadStats)*/
- // Per-Thread Statistics
- struct PerThreadStats {
-/*MGEN:Class.PerThreadDeclarations*/
- };
-
- struct PerThreadStats** perThreadStatsArray;
-
- inline struct PerThreadStats* getThreadStats() {
- int idx = getThreadIndex();
- struct PerThreadStats* threadStats = perThreadStatsArray[idx];
- if (threadStats == 0) {
- threadStats = new(PerThreadStats);
- perThreadStatsArray[idx] = threadStats;
-/*MGEN:Class.InitializePerThreadElements*/
- }
- return threadStats;
- }
-
- void aggregatePerThreadStats(struct PerThreadStats*);
-/*MGEN:ENDIF*/
- // Private Methods
- static void writeSchema(::qpid::framing::Buffer& buf);
- void writeProperties(::qpid::framing::Buffer& buf);
- void writeStatistics(::qpid::framing::Buffer& buf,
- bool skipHeaders = false);
- void doMethod(std::string& methodName,
- ::qpid::framing::Buffer& inBuf,
- ::qpid::framing::Buffer& outBuf);
- writeSchemaCall_t getWriteSchemaCall() { return writeSchema; }
-/*MGEN:IF(Class.NoStatistics)*/
- // Stub for getInstChanged. There are no statistics in this class.
- bool getInstChanged() { return false; }
- bool hasInst() { return false; }
-/*MGEN:ENDIF*/
- public:
-
- /*MGEN:Class.NameCap*/(::qpid::management::ManagementAgent* agent,
- ::qpid::management::Manageable* coreObject/*MGEN:Class.ParentArg*//*MGEN:Class.ConstructorArgs*/);
- ~/*MGEN:Class.NameCap*/();
-
- /*MGEN:Class.SetGeneralReferenceDeclaration*/
-
- static void registerSelf(::qpid::management::ManagementAgent* agent);
- std::string& getPackageName() const { return packageName; }
- std::string& getClassName() const { return className; }
- uint8_t* getMd5Sum() const { return md5Sum; }
-
- // Method IDs
-/*MGEN:Class.MethodIdDeclarations*/
- // Accessor Methods
-/*MGEN:Class.AccessorMethods*/
-};
-
-}/*MGEN:Class.CloseNamespaces*/
-
-#endif /*!_MANAGEMENT_/*MGEN:Class.NameUpper*/_*/
diff --git a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Event.cpp b/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Event.cpp
deleted file mode 100644
index cdb40c6d79..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Event.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*MGEN:commentPrefix=//*/
-//
-// 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.
-//
-
-/*MGEN:Root.Disclaimer*/
-
-#include "qpid/log/Statement.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/management/Manageable.h"
-#include "qpid/agent/ManagementAgent.h"
-#include "Event/*MGEN:Event.NameCap*/.h"
-
-using namespace qmf::/*MGEN:Event.Namespace*/;
-using namespace qpid::framing;
-using qpid::management::ManagementAgent;
-using qpid::management::Manageable;
-using qpid::management::ManagementObject;
-using qpid::management::Args;
-using std::string;
-
-string Event/*MGEN:Event.NameCap*/::packageName = string ("/*MGEN:Event.NamePackageLower*/");
-string Event/*MGEN:Event.NameCap*/::eventName = string ("/*MGEN:Event.Name*/");
-uint8_t Event/*MGEN:Event.NameCap*/::md5Sum[16] =
- {/*MGEN:Event.SchemaMD5*/};
-
-Event/*MGEN:Event.NameCap*/::Event/*MGEN:Event.NameCap*/ (/*MGEN:Event.ConstructorArgs*/) :
- /*MGEN:Event.ConstructorInits*/
-{}
-
-namespace {
- const string NAME("name");
- const string TYPE("type");
- const string DESC("desc");
- const string ARGCOUNT("argCount");
- const string ARGS("args");
-}
-
-void Event/*MGEN:Event.NameCap*/::registerSelf(ManagementAgent* agent)
-{
- agent->registerEvent(packageName, eventName, md5Sum, writeSchema);
-}
-
-void Event/*MGEN:Event.NameCap*/::writeSchema (Buffer& buf)
-{
- FieldTable ft;
-
- // Schema class header:
- buf.putOctet (CLASS_KIND_EVENT);
- buf.putShortString (packageName); // Package Name
- buf.putShortString (eventName); // Event Name
- buf.putBin128 (md5Sum); // Schema Hash
- buf.putShort (/*MGEN:Event.ArgCount*/); // Argument Count
-
- // Arguments
-/*MGEN:Event.ArgSchema*/
-}
-
-void Event/*MGEN:Event.NameCap*/::encode(::qpid::framing::Buffer& buf) const
-{
-/*MGEN:Event.ArgEncodes*/
-}
diff --git a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Event.h b/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Event.h
deleted file mode 100644
index b5c2a211d1..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Event.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*MGEN:commentPrefix=//*/
-#ifndef _MANAGEMENT_/*MGEN:Event.NameUpper*/_
-#define _MANAGEMENT_/*MGEN:Event.NameUpper*/_
-
-//
-// 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.
-//
-
-/*MGEN:Root.Disclaimer*/
-
-#include "qpid/management/ManagementEvent.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/Uuid.h"
-
-namespace qmf {
-/*MGEN:Event.OpenNamespaces*/
-
-class Event/*MGEN:Event.NameCap*/ : public ::qpid::management::ManagementEvent
-{
- private:
- static void writeSchema (::qpid::framing::Buffer& buf);
- static std::string packageName;
- static std::string eventName;
- static uint8_t md5Sum[16];
-
-/*MGEN:Event.ArgDeclarations*/
-
- public:
- writeSchemaCall_t getWriteSchemaCall(void) { return writeSchema; }
-
- Event/*MGEN:Event.NameCap*/(/*MGEN:Event.ConstructorArgs*/);
- ~Event/*MGEN:Event.NameCap*/() {};
-
- static void registerSelf(::qpid::management::ManagementAgent* agent);
- std::string& getPackageName() const { return packageName; }
- std::string& getEventName() const { return eventName; }
- uint8_t* getMd5Sum() const { return md5Sum; }
- uint8_t getSeverity() const { return /*MGEN:Event.Severity*/; }
- void encode(::qpid::framing::Buffer& buffer) const;
-};
-
-}/*MGEN:Event.CloseNamespaces*/
-
-#endif /*!_MANAGEMENT_/*MGEN:Event.NameUpper*/_*/
diff --git a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Makefile.mk b/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Makefile.mk
deleted file mode 100644
index 2b32c7c0f2..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Makefile.mk
+++ /dev/null
@@ -1,40 +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.
-#
-/*MGEN:commentPrefix=#*/
-/*MGEN:Root.Disclaimer*/
-/*MGEN:IF(Makefile.QpidBroker)*/
-/*MGEN:mgenDir=$(mgen_dir)*/
-/*MGEN:specDir=$(top_srcdir)/../specs*/
-
-mgen_generator=/*MGEN:Makefile.GenSources*/
-
-mgen_broker_cpp=/*MGEN:Makefile.GenCppFiles*/
-
-# Header file install rules.
-/*MGEN:Makefile.HeaderInstalls*/
-if GENERATE
-$(srcdir)/managementgen.mk: $(mgen_generator)
- $(mgen_cmd)
-
-$(mgen_generator):
-endif
-/*MGEN:ENDIF*/
-
-qmfgen_sources=/*MGEN:Makefile.GeneratedFiles*/
-
diff --git a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Package.cpp b/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Package.cpp
deleted file mode 100644
index f6bd7f4654..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Package.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*MGEN:commentPrefix=//*/
-//
-// 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.
-//
-
-/*MGEN:Root.Disclaimer*/
-
-#include "Package.h"
-/*MGEN:Schema.ClassIncludes*/
-
-using namespace qmf::/*MGEN:Schema.Namespace*/;
-
-Package::Package (::qpid::management::ManagementAgent* agent)
-{
-/*MGEN:Schema.ClassRegisters*/
-}
-
diff --git a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Package.h b/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Package.h
deleted file mode 100644
index 0ad7060b9e..0000000000
--- a/M4-RCs/qpid/cpp/managementgen/qmfgen/templates/Package.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*MGEN:commentPrefix=//*/
-#ifndef _MANAGEMENT_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_
-#define _MANAGEMENT_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_
-
-//
-// 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.
-//
-
-/*MGEN:Root.Disclaimer*/
-
-#include "qpid/agent/ManagementAgent.h"
-
-namespace qmf {
-/*MGEN:Class.OpenNamespaces*/
-
-class Package
-{
- public:
- Package (::qpid::management::ManagementAgent* agent);
- ~Package () {}
-};
-
-}/*MGEN:Class.CloseNamespaces*/
-
-
-#endif /*!_MANAGEMENT_PACKAGE_/*MGEN:Schema.PackageNameUpper*/_*/
diff --git a/M4-RCs/qpid/cpp/qpid-autotools-install b/M4-RCs/qpid/cpp/qpid-autotools-install
deleted file mode 100755
index 7fab3d0e9d..0000000000
--- a/M4-RCs/qpid/cpp/qpid-autotools-install
+++ /dev/null
@@ -1,205 +0,0 @@
-#!/bin/sh
-# Written by Jim Meyering
-
-VERSION='2007-07-10 09:09' # UTC
-
-prog_name=`basename $0`
-die () { echo "$prog_name: $*" >&2; exit 1; }
-
-tarballs='
- http://pkgconfig.freedesktop.org/releases/pkg-config-0.21.tar.gz
- ftp://ftp.gnu.org/gnu/m4/m4-1.4.10.tar.gz
- ftp://ftp.gnu.org/gnu/automake/automake-1.10.tar.gz
- ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz
- ftp://ftp.gnu.org/gnu/libtool/libtool-1.5.24.tar.gz
-'
-
-usage() {
- echo >&2 "\
-Usage: $0 [OPTION]...
-Download, build, and install some tools.
-
-Options:
- --prefix=PREFIX install tools under specified directory
- --skip-check do not run "make check" (this can save 50+ min)
- --help display this help and exit
-
-For example, to install programs into \$HOME/qpid-tools/bin, run this command:
-
- $prog_name --prefix=\$HOME/qpid-tools
-
-If you've already verified that your system/environment can build working
-versions of these tools, you can make this script complete in just a
-minute or two (rather than about an hour if you let all "make check"
-tests run) by invoking it like this:
-
- $prog_name --prefix=\$HOME/qpid-tools --skip-check
-
-"
-}
-
-# Get the listed tarballs into the current directory.
-get_sources()
-{
- case `wget --help` in
- *'--no-cache'*)
- WGET_COMMAND='wget -nv --no-cache';;
- *'--cache=on/off'*)
- WGET_COMMAND='wget -nv --cache=off';;
- *'--non-verbose'*)
- WGET_COMMAND='wget -nv';;
- *)
- die 'no wget program found; please install it and try again';;
- esac
-
- # Download the each tar-ball along with its signature, if there is one.
- pkgs=
- for t in $(echo $tarballs); do
- base=$(basename $t)
- pkgs="$pkgs $base"
- test -f $base || $WGET_COMMAND $t
-
- # pkg-config has no .sig file.
- case $base in pkg-config*) continue;; esac
-
- test -f $base.sig || $WGET_COMMAND $t.sig
- # Verify each signature.
- gpg --quiet --verify --trust-model=always \
- --trusted-key=32419B785D0CDCFC \
- --trusted-key=3859C03B2E236E47 \
- --trusted-key=B93F60C6B5C4CE13 \
- --trusted-key=F382AE19F4850180 \
- $base.sig > /dev/null 2>&1 \
- || echo "info: not verifying GPG signature for $base" 1>&2
- done
-
- printf 'verifying package SHA1 checksums...' 1>&2
- sha1sum -c --warn --status <<EOF || die "checksum mismatch"
-69f37c509a4757d747b6f4c091d209ab3984d62f autoconf-2.61.tar.gz
-69dc02b083b9a609b28fc4db129fef6a83ed2339 automake-1.10.tar.gz
-b4c994f1bf4a76d2b0c1d0a6f54d16598c15f3db libtool-1.5.24.tar.gz
-26d47c893722d683308f5d9fc172a11d5b2ad8a9 m4-1.4.10.tar.gz
-b2508ba8404cad46ec42f6f58cbca43ae59d715f pkg-config-0.21.tar.gz
-EOF
- printf 'ok\n' 1>&2
- echo $pkgs
-}
-
-#################################################################
-set -e
-
-# Parse options.
-
-make_check=yes
-prefix=
-
-for option
-do
- case $option in
- --help) usage; exit;;
- --skip-check) make_check=no;;
- --prefix=*) prefix=`expr "$option" : '--prefix=\(.*\)'`;;
- *) die "$option: unknown option";;
- esac
-done
-
-test -n "$prefix" \
- || die "you must specify a --prefix"
-
-case $prefix in
- /*) ;;
- *) die 'invalid prefix: '"$prefix"': it must be an absolute name';;
-esac
-
-# Don't run as root.
-# Make sure id -u succeeds.
-my_uid=`id -u`
-test $? = 0 || {
- echo "$0: cannot run \`id -u'" 1>&2
- (exit 1); exit 1
-}
-test $my_uid = 0 && die "please don't run this program as root"
-
-# Ensure that prefix is not /usr/bin or /bin, /sbin, etc.
-case $prefix in
- /bin|/sbin|/usr/bin|/usr/sbin)
- die "don't set PREFIX to a system directory";;
- *) ;;
-esac
-
-# Create a build directory, then cd into it for the rest....
-tmpdir=.build-auto-tools
-mkdir -p $tmpdir
-cd $tmpdir
-
-pkgs=$(get_sources)
-
-for pkg in $pkgs; do
- echo building/installing $pkg...
- dir=$(basename $pkg .tar.gz)
- rm -rf dir
- gzip -dc $pkg|tar xf -
- cd $dir
- ./configure CFLAGS=-O2 LDFLAGS=-s --prefix=$prefix > makerr-config 2>&1
- make -j1 > makerr-build 2>&1
- if test "$make_check" = yes; then
- case $pkg in
- automake*) expected_duration_minutes=40;;
- autoconf*) expected_duration_minutes=15;;
- # libtool*) expected_duration_minutes=3;;
- *);;
- esac
- test -n "$expected_duration_minutes" \
- && echo "running 'make check' for $pkg; NB: this can take over" \
- "$expected_duration_minutes minutes"
- case $pkg in
- # In this package, the check-requires-private test fails.
- # Change the Makefile so it skips that test.
- pkg-config-0.21.tar.gz)
- perl -pi.bak -e 's/check-requires-private //' check/Makefile;;
-
- esac
- make -j1 check > makerr-check 2>&1
- fi
- make -j1 install > makerr-install 2>&1
- echo done at $(date +%Y-%m-%d.%T)
- cd ..
-done
-
-# Without checks (and with existing tarballs), it takes just one minute.
-# Including all checks, it takes nearly an hour on an AMD64/3400+
-
-case $PKG_CONFIG_PATH in
- $prefix/lib/pkgconfig:/usr/lib/pkgconfig)
- echo 'Good! your PKG_CONFIG_PATH envvar is already set';;
- *) cat <<EOF;;
-**************************************************************************
-Be sure that PKG_CONFIG_PATH is set in your environment, e.g.,
-PKG_CONFIG_PATH=$prefix/lib/pkgconfig:/usr/lib/pkgconfig
-**************************************************************************
-EOF
-esac
-
-case $PATH in
- "$prefix/bin:"*) echo 'Good! your PATH is fine';;
- *) cat <<EOF;;
-**************************************************************************
-Be sure that "$prefix/bin" is earlier in your PATH than /bin, /usr/bin, etc.
-**************************************************************************
-EOF
-esac
-
-cat <<EOF
-**************************************************************************
-You may want to remove the tool build directory:
-rm -rf $tmpdir
-**************************************************************************
-EOF
-
-## Local Variables:
-## eval: (add-hook 'write-file-hooks 'time-stamp)
-## time-stamp-start: "VERSION='"
-## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
-## time-stamp-time-zone: "UTC"
-## time-stamp-end: "' # UTC"
-## End:
diff --git a/M4-RCs/qpid/cpp/qpid-config.in b/M4-RCs/qpid/cpp/qpid-config.in
deleted file mode 100755
index 5a65767a8c..0000000000
--- a/M4-RCs/qpid/cpp/qpid-config.in
+++ /dev/null
@@ -1,98 +0,0 @@
-#!/bin/sh
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-exec_prefix_set=no
-includedir=@includedir@
-
-usage()
-{
- cat <<EOF
-Usage: qpid-config [OPTION] ...
-
-Generic options
- --version output Qpid version information.
- --help display this help and exit.
-
-Compilation support options
- --cflags print pre-processor and compiler flags
- --libs print library linking information
-
-Install directories Qpid was configured to
- --prefix[=DIR]
- --exec-prefix[=DIR]
-
-EOF
- exit $1
-}
-
-if test $# -eq 0; then
- usage 1 1>&2
-fi
-
-while test $# -gt 0; do
- case "$1" in
- -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) optarg= ;;
- esac
-
- case $1 in
- --prefix=*)
- prefix=$optarg
- if test $exec_prefix_set = no ; then
- exec_prefix=$optarg
- fi
- ;;
- --prefix)
- echo_prefix=yes
- ;;
- --exec-prefix=*)
- exec_prefix=$optarg
- exec_prefix_set=yes
- ;;
- --exec-prefix)
- echo_exec_prefix=yes
- ;;
- --version)
- echo @QPID_VERSION@
- ;;
- --help)
- usage 0
- ;;
- --cflags)
- echo_cflags=yes
- ;;
- --libs)
- echo_libs=yes
- ;;
- *)
- usage 1 1>&2
- ;;
- esac
- shift
-done
-
-if test "$echo_prefix" = "yes"; then
- echo $prefix
-fi
-
-if test "$echo_exec_prefix" = "yes"; then
- echo $exec_prefix
-fi
-
-if test "$echo_cflags" = "yes"; then
- if test "$includedir" != "/usr/include" ; then
- echo -I$includedir
- fi
-fi
-
-if test "$echo_libs" = "yes"; then
- if test @libdir@ != /usr/lib ; then
- my_linker_flags="-L@libdir@"
- fi
- echo ${my_linker_flags} -lqpidcommon
-fi
-
-
-
-
diff --git a/M4-RCs/qpid/cpp/rubygen/0-10/allsegmenttypes.rb b/M4-RCs/qpid/cpp/rubygen/0-10/allsegmenttypes.rb
deleted file mode 100755
index 26363d6a1f..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/0-10/allsegmenttypes.rb
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-class GenAllSegmentTypes < CppGen
- def initialize(outdir, amqp)
- super(outdir, amqp)
- end
-
- def generate
- h_file("tests/allSegmentTypes.h") {
- include "qpid/amqp_0_10/specification.h"
- include "qpid/amqp_0_10/Header.h"
- include "qpid/amqp_0_10/Body.h"
- genl
- genl "using namespace qpid::amqp_0_10;"
- genl
- scope("template <class Op> size_t allSegmentTypes(Op& op) {"){
- genl "op(Header());"
- genl "op(Body());"
- n = 2;
- @amqp.classes.each { |c|
- c.commands.each { |s| genl "op(CommandHolder(#{c.nsname}::#{s.classname}()));" }
- c.controls.each { |s| genl "op(ControlHolder(#{c.nsname}::#{s.classname}()));" }
- n += 2
- }
- genl "return #{n};"
- }
- }
- end
-end
-
-GenAllSegmentTypes.new($outdir, $amqp).generate();
-
diff --git a/M4-RCs/qpid/cpp/rubygen/0-10/exceptions.rb b/M4-RCs/qpid/cpp/rubygen/0-10/exceptions.rb
deleted file mode 100755
index 02e3a5d547..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/0-10/exceptions.rb
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-class GenExceptions < CppGen
-
- def initialize(outdir, amqp)
- super(outdir, amqp)
- @ns="qpid::amqp_#{@amqp.version.bars}"
- @dir="qpid/amqp_#{@amqp.version.bars}"
- end
-
- def exceptions_for_enum(enum, base, ns, suffix="")
- enum.choices.each { |c|
- name=c.name.typename+suffix+"Exception"
- genl
- doxygen_comment { genl c.doc }
- struct(name, "public #{base}") {
- genl "#{name}(const std::string& msg=std::string())"
- genl " : #{base}(#{ns}::#{c.name.shout}, msg) {}"
- protected
- genl "std::string getPrefix() const { return \"#{name}\"; }"
- }
- }
- end
-
- def gen_exceptions()
- h_file("#{@dir}/exceptions") {
- include "qpid/amqp_0_10/Exception"
- namespace("#{@ns}") {
- error_code = @amqp.class_("execution").domain("error-code").enum
- exceptions_for_enum(error_code, "SessionAbortedException", "execution")
- genl
-
- detach_code = @amqp.class_("session").domain("detach-code").enum
- exceptions_for_enum(detach_code, "SessionDetachedException", "session", "Detached")
-
- genl
- exceptions_for_enum(detach_code, "SessionExpiredException", "session", "Expired")
- genl
-
- close_code = @amqp.class_("connection").domain("close-code").enum
- exceptions_for_enum(close_code, "ConnectionException", "connection")
- }
- }
- end
-
- def generate()
- gen_exceptions
- end
-end
-
-GenExceptions.new($outdir, $amqp).generate();
-
-
diff --git a/M4-RCs/qpid/cpp/rubygen/0-10/handlers.rb b/M4-RCs/qpid/cpp/rubygen/0-10/handlers.rb
deleted file mode 100755
index db4fdc871b..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/0-10/handlers.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-class GenHandlers < CppGen
- def initialize(outdir, amqp)
- super(outdir, amqp)
- @ns="qpid::amqp_#{@amqp.version.bars}"
- @dir="qpid/amqp_#{@amqp.version.bars}"
- end
-
- def action_handler(type, actions)
- genl
- bases=actions.map { |a| "public #{a.fqclassname}::Handler" }
- struct("#{type}Handler", *bases) { }
- end
-
- def generate()
- h_file("#{@dir}/handlers.h") {
- include "specification"
- namespace("#{@ns}") {
- action_handler "Command", @amqp.collect_all(AmqpCommand)
- action_handler "Control", @amqp.collect_all(AmqpControl)
- }
- }
- end
-end
-
-GenHandlers.new($outdir, $amqp).generate()
diff --git a/M4-RCs/qpid/cpp/rubygen/0-10/specification.rb b/M4-RCs/qpid/cpp/rubygen/0-10/specification.rb
deleted file mode 100755
index e27ad00231..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/0-10/specification.rb
+++ /dev/null
@@ -1,389 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-
-# Dummy element representing an unknown struct type.
-class UnknownStruct
- def visitable?() true end
- def fqclassname() "UnknownStruct" end
-end
-
-# Dummy element representing a session.header field
-class SessionHeaderField
- def amqp2cpp() "session::Header" end
- def cppname() "sessionHeader" end
- def name() "session-header" end
-end
-
-class Specification < CppGen
- def initialize(outdir, amqp)
- super(outdir, amqp)
- @ns="qpid::amqp_#{@amqp.version.bars}"
- @dir="qpid/amqp_#{@amqp.version.bars}"
- end
-
- # domains
-
- def domain_h(d)
- genl
- typename=d.name.typename
- if d.enum
- scope("enum #{typename} {", "};") {
- genl d.enum.choices.map { |c|
- "#{c.name.constname} = #{c.value}" }.join(",\n")
- }
- scope("inline SerializeAs<#{typename}, uint8_t> serializable(#{typename}& e) {") {
- genl "return SerializeAs<#{typename}, uint8_t>(e);"
- }
- else
- genl "typedef #{d.amqp2cpp} #{typename};"
- end
- end
-
- def visitable?(x) x.code and x.size=="4" end
-
- # Used by structs, commands and controls.
- def action_struct_h(x, base, consts, &block)
- genl
- base = visitable?(x) ? ["public #{base}"] : []
- struct(x.classname, *base) {
- x.fields.each { |f| genl "#{f.amqp2cpp} #{f.cppname};" }
- genl
- genl "static const char* NAME;"
- consts.each {
- |c| genl "static const uint8_t #{c.upcase}=#{(x.send c) or 0};"
- }
- genl "static const uint8_t CLASS_CODE=#{x.containing_class.nsname}::CODE;"
- genl "static const char* CLASS_NAME;"
- ctor_decl("explicit #{x.classname}", x.parameters(true))
-
- if visitable? x
- genl "void accept(Visitor&);"
- genl "void accept(ConstVisitor&) const;"
- end
-
- if (x.fields.empty?)
- genl "template <class S> void serialize(S&) {}"
- else
- scope("template <class S> void serialize(S& s) {") {
- gen "s"; x.fields.each { |f| gen "(#{f.cppname})"}; genl ";"
- }
- end
- genl
- yield if block
- }
- case x
- when AmqpCommand then packer = "CommandPacker"
- when AmqpControl then packer = "Packer"
- when AmqpStruct then packer = "SizedPacker"
- end
- genl "inline #{packer}<#{x.classname}> serializable(#{x.classname}& x) { return #{packer}<#{x.classname}>(x); }" unless x.respond_to? :pack and x.pack == "0"
- genl "std::ostream& operator << (std::ostream&, const #{x.classname}&);"
- genl "bool operator==(const #{x.classname}&, const #{x.classname}&);"
- end
-
- def action_struct_cpp(x, &block)
- genl
- genl "const char* #{x.classname}::NAME=\"#{x.fqname}\";"
- genl "const char* #{x.classname}::CLASS_NAME=#{x.containing_class.nsname}::NAME;"
- genl
- ctor=x.classname+"::"+x.classname
- ctor_defn(ctor, x.parameters, x.initializers) {}
-
- if visitable? x
- genl "void #{x.classname}::accept(Visitor& v) { v.visit(*this); }"
- genl "void #{x.classname}::accept(ConstVisitor& v) const { v.visit(*this); }"
- end
- genl
- scope("std::ostream& operator << (std::ostream& o, const #{x.classname}&#{"x" unless x.fields.empty?}) {") {
- genl "o << \"#{x.fqname}[\";";
- x.fields.each{ |f| genl "o << \" #{f.name}=\" << x.#{f.cppname};" }
- genl "o << \"]\";"
- genl "return o;"
- }
- yield if block
- end
-
- # structs
-
- def struct_h(s) action_struct_h(s, "Struct", ["size","pack","code"]); end
- def struct_cpp(s) action_struct_cpp(s) end
-
- # command and control
-
- def action_h(a)
- action_struct_h(a, a.base, ["code"]) {
- struct("Handler") {
- scope("void #{a.funcname}(", ");") {
- genl a.parameters.join(",\n")
- }
- }
- function_defn("template <class T> void invoke", ["T& target"], "const") {
- genl "target.#{a.funcname}(#{a.values.join(', ')} );"
- }
- }
- end
-
- def action_cpp(a)
- action_struct_cpp(a) {
- scope("void #{a.classname}::Handler::#{a.funcname}(", ")") {
- genl a.unused_parameters.join(",\n")
- }
- scope {
- genl "assert(0);"
- genl "throw NotImplementedException(QPID_MSG(\"#{a.fqname} not implemented.\"));"
- }
- }
- end
-
- # Types that must be generated early because they are used by other types.
- def pregenerate?(x) not @amqp.used_by[x.fqname].empty?; end
-
- def pregenerate_class?(c)
- c.children.select{ |t| (t.is_a? AmqpStruct or t.is_a? AmqpDomain) and pregenerate? t}
- end
-
- # Typedefs, enums and forward declarations for classes.
- def gen_specification_fwd()
- h_file("#{@dir}/specification_fwd") {
- include "#{@dir}/built_in_types"
- namespace(@ns) {
- # Top level
- @amqp.domains.each { |d|
- # segment-type and track are are built in
- domain_h d unless ["track","segment-type"].include?(d.name)
- }
- each_class_ns { |c|
- genl "const uint8_t CODE=#{c.code};" # class code
- genl "extern const char* NAME;"
- c.each_descendant { |x|
- case x
- when AmqpDomain then domain_h x
- when AmqpStruct then genl "class #{x.classname};"
- when AmqpAction then genl "class #{x.classname};"
- end
- }
- }
- }
- }
- end
-
- # Generate struct definitions into a separate header file so the
- # can be included by StructHolder.h without circularity.
- def gen_structs()
- h_file("#{@dir}/structs") {
- include "#{@dir}/specification_fwd"
- include "#{@dir}/Map.h"
- include "#{@dir}/Array.h"
- include "#{@dir}/Struct.h"
- include "#{@dir}/UnknownStruct.h"
- include "#{@dir}/Packer.h"
- namespace(@ns) {
- each_class_ns { |c|
- c.collect_all(AmqpStruct).each { |s| struct_h s }
- }
- }
- }
-
- cpp_file("#{@dir}/structs") {
- include "#{@dir}/structs"
- include "#{@dir}/StructHolder"
- namespace(@ns) {
- each_class_ns { |c|
- c.collect_all(AmqpStruct).each { |s| struct_cpp(s) }
- }
- }
- }
- end
-
- # Generate the specification files
- def gen_specification()
- h_file("#{@dir}/specification") {
- include "#{@dir}/specification_fwd.h"
- include "#{@dir}/Map.h"
- include "#{@dir}/Array.h"
- include "#{@dir}/UnknownType.h"
- include "#{@dir}/Struct32"
- include "#{@dir}/Control.h"
- include "#{@dir}/Command.h"
- include "#{@dir}/Packer.h"
- include "<iosfwd>"
- namespace(@ns) {
- each_class_ns { |c|
- c.collect_all(AmqpAction).each { |a| action_h a }
- }
- }}
-
- cpp_file("#{@dir}/specification") {
- include "#{@dir}/specification"
- include "#{@dir}/exceptions"
- include "<iostream>"
- ["Command","Control", "Struct"].each { |x| include "#{@dir}/Apply#{x}" }
- namespace(@ns) {
- each_class_ns { |c|
- genl "const char* NAME=\"#{c.fqname}\";"
- c.actions.each { |a| action_cpp a}
- }
- }
- }
- end
-
- def gen_proxy()
- h_file("#{@dir}/ProxyTemplate.h") {
- include "#{@dir}/specification"
- namespace(@ns) {
- genl "template <class F, class R=typename F::result_type>"
- cpp_class("ProxyTemplate") {
- public
- genl "ProxyTemplate(F f=F()) : functor(f) {}"
- @amqp.classes.each { |c|
- c.actions.each { |a|
- genl
- function_defn("R #{a.funcname}", a.parameters) {
- var=a.name.funcname
- args = a.arguments.empty? ? "" : "("+a.arguments.join(", ")+")"
- genl("#{a.fqclassname} #{var}#{args};")
- genl "return functor(#{var});"
- }
- }
- }
- private
- genl "F functor;"
- }
- }
- }
- end
-
- def visitor_interface_h(base, subs, is_const)
- name="#{is_const ? 'Const' : ''}#{base}Visitor"
- const=is_const ? "const " : ""
- struct(name) {
- genl "virtual ~#{name}() {}"
- genl "typedef #{const}#{base} BaseType;"
- subs.each{ |s|
- genl "virtual void visit(#{const}#{s.fqclassname}&) = 0;"
- }}
- end
-
- def visitor_impl(base, subs, is_const)
- name="#{is_const ? 'Const' : ''}#{base}Visitor"
- const=is_const ? "const " : ""
- genl "template <class F>"
- struct("ApplyVisitor<#{name}, F>", "public ApplyVisitorBase<#{name}, F>") {
- subs.each{ |s|
- genl "virtual void visit(#{const}#{s.fqclassname}& x) { this->invoke(x); }"
- }}
- end
-
- def gen_visitor(base, subs)
- h_file("#{@dir}/#{base}Visitor.h") {
- include base=="Struct" ? "#{@dir}/structs" : "#{@dir}/specification"
- namespace("#{@ns}") {
- visitor_interface_h(base, subs, false)
- visitor_interface_h(base, subs, true)
- }}
-
- h_file("#{@dir}/Apply#{base}.h") {
- include "#{@dir}/#{base}Visitor.h"
- include "#{@dir}/apply.h"
- namespace("#{@ns}") {
- visitor_impl(base, subs, false)
- visitor_impl(base, subs, true)
- }
- }
- end
-
- def gen_holder(base, subs)
- name=base+"Holder"
- h_file("#{@dir}/#{name}") {
- include "#{@dir}/Apply#{base}"
- include "#{@dir}/Holder"
- include base=="Struct" ? "#{@dir}/structs" : "#{@dir}/specification"
- namespace(@ns){
- namespace("#{base.downcase}_max") {
- genl "static const size_t MAX000=0;"
- last="MAX000"
- subs.each { |s|
- sizeof="sizeof(#{s.fqclassname})"
- genl "static const size_t #{last.succ} = #{sizeof} > #{last} ? #{sizeof} : #{last};"
- last.succ!
- }
- genl "static const int MAX=#{last};"
- }
- holder_base="amqp_0_10::Holder<#{name}, #{base}, #{base.downcase}_max::MAX>"
- struct("#{name}", "public #{holder_base}") {
- genl "#{name}() {}"
- genl "template <class T> explicit #{name}(const T& t) : #{holder_base}(t) {}"
- genl "using #{holder_base}::operator=;"
- genl "void set(uint8_t classCode, uint8_t code);"
- }
- genl
- genl "std::ostream& operator<<(std::ostream& o, const #{name}& h);"
- }
- }
-
- cpp_file("#{@dir}/#{name}") {
- include "#{name}"
- include "exceptions.h"
- namespace(@ns) {
- genl "using framing::in_place;"
- genl
- scope("void #{name}::set(uint8_t classCode, uint8_t code) {") {
- genl "uint16_t key=(classCode<<8)+code;"
- scope ("switch(key) {") {
- subs.each { |s|
- genl "case 0x#{s.full_code.to_s(16)}: *this=in_place<#{s.fqclassname}>(); break;" unless (s.is_a? UnknownStruct)
- }
- genl "default: "
- indent {
- if (base=="Struct")
- genl "*this=in_place<UnknownStruct>(classCode, code);"
- else
- genl "throw CommandInvalidException(QPID_MSG(\"Invalid class-#{base.downcase} key \" << std::hex << key));"
- end
- }
- }
- }
- genl
- genl "std::ostream& operator<<(std::ostream& o, const #{name}& h) { return h.get() ? (o << *h.get()) : (o << \"<empty #{name}>\"); }"
- }
- }
- end
-
- def gen_visitable(base, subs)
- subs << UnknownStruct.new if base=="Struct" # Extra case for unknown structs.
- gen_holder(base, subs)
- gen_visitor(base, subs)
- end
-
- def generate
- gen_specification_fwd
- gen_specification
- gen_proxy
- gen_structs
- gen_visitable("Command", @amqp.collect_all(AmqpCommand))
- gen_visitable("Control", @amqp.collect_all(AmqpControl))
- gen_visitable("Struct", @amqp.collect_all(AmqpStruct).select { |s| s.code})
- end
-end
-
-Specification.new($outdir, $amqp).generate();
diff --git a/M4-RCs/qpid/cpp/rubygen/0-10/typecode.rb b/M4-RCs/qpid/cpp/rubygen/0-10/typecode.rb
deleted file mode 100755
index 0ab9c4be5d..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/0-10/typecode.rb
+++ /dev/null
@@ -1,117 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-class TypeCode < CppGen
- def initialize(outdir, amqp)
- super(outdir, amqp)
- @ns="qpid::amqp_#{@amqp.version.bars}"
- @dir="qpid/amqp_#{@amqp.version.bars}"
- @types = @amqp.collect_all(AmqpType).select { |t| t.code }
-
- end
-
- def type_for_code_h()
- h_file("#{@dir}/TypeForCode") {
- include "#{@dir}/built_in_types.h"
- include "#{@dir}/UnknownType.h"
- namespace(@ns) {
- genl
- genl "template <uint8_t Code> struct TypeForCode;"
- genl
- @types.each { |t|
- genl "template <> struct TypeForCode<#{t.code}> { typedef #{t.typename} type; };"
- }
- genl
- genl "template <class V> typename V::result_type"
- scope("apply_visitor(V& visitor, uint8_t code) {") {
- scope("switch (code) {", "}") {
- @types.each { |t|
- genl "case #{t.code}: return visitor((#{t.typename}*)0);"
- }
- genl "default: return visitor((UnknownType*)0);"
- }
- }
- genl
- genl "std::string typeName(uint8_t code);"
- }
- }
- end
-
- def type_for_code_cpp()
- cpp_file("#{@dir}/TypeForCode") {
- include "<string>"
- include "<sstream>"
- namespace(@ns) {
- namespace("") {
- struct("Names") {
- scope("Names() {") {
- scope("for (int i =0; i < 256; ++i) {") {
- genl "std::ostringstream os;"
- genl "os << \"UnknownType<\" << i << \">\";"
- genl "names[i] = os.str();"
- }
- @types.each { |t| genl "names[#{t.code}] = \"#{t.name}\";" }
- }
- genl "std::string names[256];"
- }
- genl "Names names;"
- }
- genl "std::string typeName(uint8_t code) { return names.names[code]; }"
- }}
- end
-
- def code_for_type_h()
- name="#{@dir}/CodeForType"
- h_file(name) {
- include "#{@dir}/built_in_types.h"
-
- namespace(@ns) {
- genl
- genl "template <class T> struct CodeForType;"
- genl
- @types.each { |t|
- genl "template <> struct CodeForType<#{t.typename}> { static const uint8_t value; };"
- }
- genl
- genl "template <class T> uint8_t codeFor(const T&) { return CodeForType<T>::value; }"
- }
- }
-
- cpp_file(name) {
- include name
- namespace(@ns) {
- @types.each { |t|
- genl "const uint8_t CodeForType<#{t.typename}>::value=#{t.code};"
- }
- }
- }
- end
-
- def generate
- type_for_code_h
- type_for_code_cpp
- code_for_type_h
- end
-end
-
-TypeCode.new($outdir, $amqp).generate();
-
diff --git a/M4-RCs/qpid/cpp/rubygen/MethodBodyDefaultVisitor.rb b/M4-RCs/qpid/cpp/rubygen/MethodBodyDefaultVisitor.rb
deleted file mode 100755
index 4f9b369117..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/MethodBodyDefaultVisitor.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-class MethodBodyDefaultVisitorGen < CppGen
-
- def initialize(outdir, amqp)
- super(outdir, amqp)
- set_classname("qpid::framing::MethodBodyDefaultVisitor")
- end
-
- def generate()
- h_file(@filename) {
- include "qpid/framing/MethodBodyConstVisitor"
- namespace(@namespace) {
- genl
- cpp_class(@classname, "public MethodBodyConstVisitor") {
- genl "public:"
- genl "virtual void defaultVisit() = 0;"
- @amqp.methods_.each { |m|
- genl "virtual void visit(const #{m.body_name}&);" }
- }}}
-
- cpp_file(@filename) {
- include(@filename)
- namespace(@namespace) {
- @amqp.methods_.each { |m|
- genl "void #{@classname}::visit(const #{m.body_name}&) { defaultVisit(); }"
- }}}
- end
-end
-
-MethodBodyDefaultVisitorGen.new($outdir, $amqp).generate();
-
diff --git a/M4-RCs/qpid/cpp/rubygen/README b/M4-RCs/qpid/cpp/rubygen/README
deleted file mode 100644
index a1fd6cfec8..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/README
+++ /dev/null
@@ -1,17 +0,0 @@
-RUBY CODE GENERATOR
-
-Run ./generate for usage.
-Examples in samples/
-
-For example:
- ./generate . ../../specs/amqp.0-9.xml samples/Proxy.rb
-will generate
-
-
-
-
-
-
-
-
-
diff --git a/M4-RCs/qpid/cpp/rubygen/amqpgen.rb b/M4-RCs/qpid/cpp/rubygen/amqpgen.rb
deleted file mode 100755
index b77ab09ac0..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/amqpgen.rb
+++ /dev/null
@@ -1,545 +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.
-#
-# Generic AMQP code generation library.
-#
-# TODO aconway 2008-02-21:
-#
-# The amqp_attr_reader and amqp_child_reader for each Amqp* class
-# should correspond exactly to ampq.dtd. Currently they are more
-# permissive so we can parse 0-10 preview and 0-10 final XML.
-#
-# Code marked with "# preview" should be removed/modified when final 0-10
-# is complete and we are ready to remove preview-related code.
-#
-
-require 'delegate'
-require 'rexml/document'
-require 'pathname'
-include REXML
-
-# Handy String functions for converting names.
-class String
- # Convert to CapitalizedForm.
- def caps() gsub( /(^|\W)(\w)/ ) { |m| $2.upcase } end
-
- # Convert to underbar_separated_form.
- def bars() tr('- .','_'); end
-
- # Convert to ALL_UPPERCASE_FORM
- def shout() bars.upcase; end
-
- # Convert to lowerCaseCapitalizedForm
- def lcaps() gsub( /\W(\w)/ ) { |m| $1.upcase } end
-
- def plural() self + (/[xs]$/ === self ? 'es' : 's'); end
-end
-
-# Sort an array by name.
-module Enumerable
- def sort_by_name() sort { |a,b| a.name <=> b.name }; end
-end
-
-# Add functions similar to attr_reader for AMQP attributes/children.
-# Symbols that are ruby Object function names (e.g. class) get
-# an "_" suffix.
-class Module
- # Add trailing _ to avoid conflict with Object methods.
- def mangle(sym)
- (Object.method_defined? sym) ? (sym.to_s+"_").intern : sym
- end
-
- # Add attribute reader for XML attribute.
- def amqp_attr_reader(*attrs)
- attrs.each { |a|
- case a
- when Symbol
- define_method(mangle(a)) {
- @amqp_attr_reader||={ }
- @amqp_attr_reader[a] ||= xml.attributes[a.to_s]
- }
- when Hash
- a.each { |attr, default|
- define_method(mangle(attr)) {
- @amqp_attr_reader||={ }
- value = xml.attributes[attr.to_s]
- if value
- @amqp_attr_reader[attr] ||= value
- else
- @amqp_attr_reader[attr] ||= default
- end
- }
- }
- end
- }
- end
-
- # Add 2 child readers:
- # elname(name) == child('elname',name)
- # elnames() == children('elname')
- def amqp_child_reader(*element_names)
- element_names.each { |e|
- define_method(mangle(e)) { |name| child(e.to_s, name) }
- define_method(mangle(e.to_s.plural)) { children(e.to_s) } }
- end
-
- # When there can only be one child instance
- def amqp_single_child_reader(*element_names)
- element_names.each { |e|
- define_method(mangle(e)) { children(e.to_s)[0] } }
- end
-end
-
-# An AmqpElement contains an XML element and provides a convenient
-# API to access AMQP data.
-#
-# NB: AmqpElements cache values from XML, they assume that
-# the XML model does not change after the AmqpElement has
-# been created.
-class AmqpElement
-
- def wrap(xml)
- return nil if ["assert","rule"].include? xml.name
- eval("Amqp"+xml.name.caps).new(xml, self) or raise "nil wrapper"
- end
-
- public
-
- def initialize(xml, parent)
- @xml, @parent=xml, parent
- @children=xml.elements.map { |e| wrap e }.compact
- @cache_child={}
- @cache_child_named={}
- @cache_children={}
- @cache_children[nil]=@children
- end
-
- attr_reader :parent, :xml, :children, :doc
- amqp_attr_reader :name, :label
-
- # List of children of type elname, or all children if elname
- # not specified.
- def children(elname=nil)
- if elname
- @cache_children[elname] ||= @children.select { |c| elname==c.xml.name }
- else
- @children
- end
- end
-
- def each_descendant(&block)
- yield self
- @children.each { |c| c.each_descendant(&block) }
- end
-
- def collect_all(amqp_type)
- collect=[]
- each_descendant { |d| collect << d if d.is_a? amqp_type }
- collect
- end
-
- # Look up child of type elname with attribute name.
- def child(elname, name)
- @cache_child[[elname,name]] ||= children(elname).find { |c| c.name==name }
- end
-
- # Look up any child with name
- def child_named(name)
- @cache_child_named[name] ||= @children.find { |c| c.name==name }
- end
-
- # The root <amqp> element.
- def root() @root ||=parent ? parent.root : self; end
-
- def to_s() "#<#{self.class}(#{fqname})>"; end
- def inspect() to_s; end
-
- # Text of doc child if there is one.
- def doc() d=xml.elements["doc"]; d and d.text; end
-
- def fqname()
- throw "fqname: #{self} #{parent.fqname} has no name" unless name
- p=parent && parent.fqname
- p ? p+"."+name : name;
- end
-
- def containing_class()
- return self if is_a? AmqpClass
- return parent && parent.containing_class
- end
-
- # 0-10 array domains are missing element type information, add it here.
- ArrayTypes={
- "str16-array" => "str-16",
- "amqp-host-array" => "connection.amqp-host-url",
- "command-fragments" => "session.command-fragment",
- "in-doubt" => "dtx.xid",
- "tx-publish" => "str-8",
- "queues" => "str-8"
- }
-
- def array_type(name)
- return ArrayTypes[name] if ArrayTypes[name]
- raise "Missing ArrayType entry for " + name
- end
-
-end
-
-class AmqpResponse < AmqpElement
- def initialize(xml, parent) super; end
- def fqname() (parent ? parent.dotted_name+"." : "") + "response"; end
-end
-
-class AmqpDoc < AmqpElement
- def initialize(xml,parent) super; end
- def text() @xml.text end
-end
-
-class AmqpChoice < AmqpElement
- def initialize(xml,parent) super; end
- amqp_attr_reader :name, :value
-end
-
-class AmqpEnum < AmqpElement
- def initialize(xml,parent) super; end
- amqp_child_reader :choice
-end
-
-class AmqpDomain < AmqpElement
- def initialize(xml, parent)
- super
- root.used_by[uses].push(fqname) if uses and uses.index('.')
- end
-
- amqp_attr_reader :type
- amqp_single_child_reader :struct # preview
- amqp_single_child_reader :enum
-
- def uses() type_=="array" ? ArrayTypes[name] : type_; end
-end
-
-class AmqpException < AmqpElement
- def initialize(xml, amqp) super; end;
- amqp_attr_reader :error_code
-end
-
-class AmqpField < AmqpElement
- def initialize(xml, amqp)
- super;
- root.used_by[type_].push(parent.fqname) if type_ and type_.index('.')
- end
- amqp_single_child_reader :struct # preview
- amqp_child_reader :exception
- amqp_attr_reader :type, :default, :code, :required
-end
-
-class AmqpChassis < AmqpElement # preview
- def initialize(xml, parent) super; end
- amqp_attr_reader :implement
-end
-
-class AmqpConstant < AmqpElement
- def initialize(xml, parent) super; end
- amqp_attr_reader :value, :class
-end
-
-class AmqpResult < AmqpElement
- def initialize(xml, parent) super; end
- amqp_single_child_reader :struct # preview
- amqp_attr_reader :type
- def name() "result"; end
-end
-
-class AmqpEntry < AmqpElement
- def initialize(xml,parent) super; end
- amqp_attr_reader :type
-end
-
-class AmqpHeader < AmqpElement
- def initialize(xml,parent) super; end
- amqp_child_reader :entry
- amqp_attr_reader :required
-end
-
-class AmqpBody < AmqpElement
- def initialize(xml,parent) super; end
- amqp_attr_reader :required
-end
-
-class AmqpSegments < AmqpElement
- def initialize(xml,parent) super; end
- amqp_child_reader :header, :body
-end
-
-class AmqpStruct < AmqpElement
- def initialize(xml, parent) super; end
- amqp_attr_reader :type # preview
- amqp_attr_reader :size, :code, :pack
- amqp_child_reader :field
-
- def result?() parent.xml.name == "result"; end
- def domain?() parent.xml.name == "domain"; end
-end
-
-class AmqpMethod < AmqpElement
- def initialize(xml, parent) super; end
-
- amqp_attr_reader :content, :index, :synchronous
- amqp_child_reader :field, :chassis,:response
- amqp_single_child_reader :result
-
- def on_chassis?(chassis) child("chassis", chassis); end
- def on_client?() on_chassis? "client"; end
- def on_server?() on_chassis? "server"; end
-end
-
-# preview: Map command/control to preview method.
-class AmqpFakeMethod < AmqpMethod
- def initialize(action)
- super(action.xml, action.parent);
- @action=action
- end
-
- def content() return "1" if @action.is_a? AmqpCommand and @action.segments end
- def index() @action.code end
- def code() @action.code end
- def synchronous() end # FIXME aconway 2008-04-10: ???
- def on_chassis?(chassis)
- @action.received_by?(chassis)
- end
- def pack() "2" end # Encode pack=2, size=4 struct
- def size() "4" end
-end
-
-class AmqpImplement < AmqpElement
- def initialize(xml,amqp) super; end
- amqp_attr_reader :handle, :send
-end
-
-class AmqpRole < AmqpElement
- def initialize(xml,amqp) super; end
- amqp_attr_reader :implement
-end
-
-# Base class for command and control.
-class AmqpAction < AmqpElement
- def initialize(xml,amqp) super; end
- amqp_child_reader :implement, :field, :response
- amqp_attr_reader :code
- def implement?(role)
- # we can't use xpath for this because it triggers a bug in some
- # versions of ruby, including version 1.8.6.110
- xml.elements.each {|el|
- return true if el.name == "implement" and el.attributes["role"] == role
- }
- return false
- end
- def received_by?(client_or_server)
- return (implement?(client_or_server) or implement?("sender") or implement?("receiver"))
- end
- def pack() "2" end
- def size() "4" end # Encoded as a size 4 Struct
-end
-
-class AmqpControl < AmqpAction
- def initialize(xml,amqp) super; end
-end
-
-class AmqpCommand < AmqpAction
- def initialize(xml,amqp) super; end
- amqp_child_reader :exception
- amqp_single_child_reader :result, :segments
-end
-
-class AmqpClass < AmqpElement
- def initialize(xml,amqp) super; end
-
- amqp_attr_reader :index # preview
-
- amqp_child_reader :struct, :domain, :control, :command, :role, :method
- amqp_attr_reader :code
-
- def actions() controls+commands; end
-
- # preview - command/control as methods
- def methods_()
- return (controls + commands).map { |a| AmqpFakeMethod.new(a) }
- end
-
- def method(name)
- a = (command(name) or control(name))
- return AmqpFakeMethod.new(a)
- end
-
- # chassis should be "client" or "server"
- def methods_on(chassis) # preview
- @methods_on ||= { }
- @methods_on[chassis] ||= methods_.select { |m| m.on_chassis? chassis }
- end
-
- # FIXME aconway 2008-04-11:
- def l4?() # preview
- !["connection", "session", "execution"].include?(name) && !control?
- end
-
- # FIXME aconway 2008-04-11:
- def control?()
- ["connection", "session"].include?(name)
- end
-end
-
-class AmqpType < AmqpElement
- def initialize(xml,amqp) super; end
- amqp_attr_reader :code, :fixed_width, :variable_width
-end
-
-class AmqpXref < AmqpElement
- def initialize(xml,amqp) super; end
-end
-
-# AMQP root element.
-class AmqpRoot < AmqpElement
- amqp_attr_reader :major, :minor, :port, :comment
- amqp_child_reader :doc, :type, :struct, :domain, :constant, :class
-
- def get_root(x)
- case x
- when Element then x
- when Document then x.root
- else Document.new(x).root
- end
- end
-
- # Initialize with output directory and spec files from ARGV.
- def initialize(*specs)
- raise "No XML spec files." if specs.empty?
- xml=get_root(specs.shift)
- specs.each { |s| xml_merge(xml, get_root(s)) }
- @used_by=Hash.new{ |h,k| h[k]=[] }
- super(xml, nil)
- end
-
- attr_reader :used_by
-
- def merge(root) xml_merge(xml, root.xml); end
-
- def version() major + "-" + minor; end
-
- def methods_() classes.map { |c| c.methods_ }.flatten; end
-
- #preview
- # Return all methods on chassis for all classes.
- def methods_on(chassis)
- @methods_on ||= { }
- @methods_on[chassis] ||= classes.map { |c| c.methods_on(chassis) }.flatten
- end
-
- def fqname() nil; end
-
- private
-
- # Merge contents of elements.
- def xml_merge(to,from)
- from.elements.each { |from_child|
- tag,name = from_child.name, from_child.attributes["name"]
- to_child=to.elements["./#{tag}[@name='#{name}']"]
- to_child ? xml_merge(to_child, from_child) : to.add(from_child.deep_clone) }
- end
-end
-
-# Collect information about generated files.
-class GenFiles
- @@files =[]
- def GenFiles.add(f) @@files << f; end
- def GenFiles.get() @@files; end
-end
-
-# Base class for code generators.
-# Supports setting a per-line prefix, useful for e.g. indenting code.
-#
-class Generator
- # Takes directory for output or "-", meaning print file names that
- # would be generated.
- def initialize (outdir, amqp)
- @amqp=amqp
- @outdir=outdir
- @prefix=[''] # For indentation or comments.
- @indentstr=' ' # One indent level.
- @outdent=2
- Pathname.new(@outdir).mkpath unless @outdir=="-"
- end
-
- # Create a new file, set @out.
- def file(file, &block)
- GenFiles.add file
- if (@outdir != "-")
- @path=Pathname.new "#{@outdir}/#{file}"
- @path.parent.mkpath
- @out=String.new # Generate in memory first
- if block then yield; endfile; end
- end
- end
-
- def endfile()
- if @outdir != "-"
- if @path.exist? and @path.read == @out
- puts "Skipped #{@path} - unchanged" # Dont generate if unchanged
- else
- @path.open('w') { |f| f << @out }
- puts "Generated #{@path}"
- end
- end
- end
-
- # Append multi-line string to generated code, prefixing each line.
- def gen(str)
- str.each_line { |line|
- @out << @prefix.last unless @midline
- @out << line
- @midline = nil
- }
- # Note if we stopped mid-line
- @midline = /[^\n]\z/ === str
- end
-
- # Append str + '\n' to generated code.
- def genl(str="") gen str+"\n"; end
-
- # Generate code with added prefix.
- def prefix(add, &block)
- @prefix.push @prefix.last+add
- if block then yield; endprefix; end
- end
-
- def endprefix()
- @prefix.pop
- end
-
- # Generate indented code
- def indent(n=1,&block) prefix(@indentstr * n,&block); end
- alias :endindent :endprefix
-
- # Generate outdented code
- def outdent(&block)
- @prefix.push @prefix.last[0...-2]
- if block then yield; endprefix; end
- end
- alias :endoutdent :endprefix
-
- attr_accessor :out
-end
-
diff --git a/M4-RCs/qpid/cpp/rubygen/cppgen.rb b/M4-RCs/qpid/cpp/rubygen/cppgen.rb
deleted file mode 100755
index 7818e1c4b0..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/cppgen.rb
+++ /dev/null
@@ -1,449 +0,0 @@
-#!/usr/bin/ruby
-#
-# General purpose C++ code generation.
-#
-require 'amqpgen'
-require 'set'
-
-Copyright=<<EOS
-/*
- *
- * 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 file was automatically generated from the AMQP specification.
-/// Do not edit.
-///
-
-
-EOS
-
-CppKeywords = Set.new(["and", "and_eq", "asm", "auto", "bitand",
- "bitor", "bool", "break", "case", "catch", "char",
- "class", "compl", "const", "const_cast", "continue",
- "default", "delete", "do", "DomainInfo", "double",
- "dynamic_cast", "else", "enum", "explicit", "extern",
- "false", "float", "for", "friend", "goto", "if",
- "inline", "int", "long", "mutable", "namespace", "new",
- "not", "not_eq", "operator", "or", "or_eq", "private",
- "protected", "public", "register", "reinterpret_cast",
- "return", "short", "signed", "sizeof", "static",
- "static_cast", "struct", "switch", "template", "this",
- "throw", "true", "try", "typedef", "typeid",
- "typename", "union", "unsigned", "using", "virtual",
- "void", "volatile", "wchar_t", "while", "xor",
- "xor_eq"])
-# Names that need a trailing "_" to avoid clashes.
-CppMangle = CppKeywords+Set.new(["string"])
-
-class String
- def cppsafe() CppMangle.include?(self) ? self+"_" : self; end
-
- def amqp2cpp()
- path=split(".")
- name=path.pop
- return name.typename if path.empty?
- path.map! { |n| n.nsname }
- return (path << name.caps.cppsafe).join("::")
- end
-
- def typename() caps.cppsafe; end
- def nsname() bars.cppsafe; end
- def constname() shout.cppsafe; end
- def funcname() lcaps.cppsafe; end
- def varname() lcaps.cppsafe; end
-end
-
-# preview: Hold information about a C++ type.
-#
-# new mapping does not use CppType,
-# Each amqp type corresponds exactly by dotted name
-# to a type, domain or struct, which in turns
-# corresponds by name to a C++ type or typedef.
-# (see String.amqp2cpp)
-#
-class CppType
- def initialize(name) @name=@param=@ret=name; end
- attr_reader :name, :param, :ret, :code
-
- def retref() @ret="#{name}&"; self; end
- def retcref() @ret="const #{name}&"; self; end
- def passcref() @param="const #{name}&"; self; end
- def code(str) @code=str; self; end
- def defval(str) @defval=str; self; end
- def encoded() @code end
- def ret_by_val() @name; end
-
- def encode(value, buffer)
- @code ? "#{buffer}.put#{@code}(#{value});" : "#{value}.encode(#{buffer});"
- end
-
- def decode(value,buffer)
- if @code
- if /&$/===param then
- "#{buffer}.get#{@code}(#{value});"
- else
- "#{value} = #{buffer}.get#{@code}();"
- end
- else
- "#{value}.decode(#{buffer});"
- end
- end
-
- def default_value()
- return @defval ||= "#{name}()"
- end
-
- def to_s() name; end;
-end
-
-class AmqpRoot
- # preview; map 0-10 types to preview code generator types
- @@typemap = {
- "bit"=> CppType.new("bool").code("Octet").defval("false"),
- "boolean"=> CppType.new("bool").code("Octet").defval("false"),
- "uint8"=>CppType.new("uint8_t").code("Octet").defval("0"),
- "uint16"=>CppType.new("uint16_t").code("Short").defval("0"),
- "uint32"=>CppType.new("uint32_t").code("Long").defval("0"),
- "uint64"=>CppType.new("uint64_t").code("LongLong").defval("0"),
- "datetime"=>CppType.new("uint64_t").code("LongLong").defval("0"),
- "str8"=>CppType.new("string").passcref.retcref.code("ShortString"),
- "str16"=>CppType.new("string").passcref.retcref.code("MediumString"),
- "str32"=>CppType.new("string").passcref.retcref.code("LongString"),
- "vbin8"=>CppType.new("string").passcref.retcref.code("ShortString"),
- "vbin16"=>CppType.new("string").passcref.retcref.code("MediumString"),
- "vbin32"=>CppType.new("string").passcref.retcref.code("LongString"),
- "map"=>CppType.new("FieldTable").passcref.retcref,
- "array"=>CppType.new("Array").passcref.retcref,
- "sequence-no"=>CppType.new("SequenceNumber").passcref,
- "sequence-set"=>CppType.new("SequenceSet").passcref.retcref,
- "struct32"=>CppType.new("string").passcref.retcref.code("LongString"),
- "uuid"=>CppType.new("Uuid").passcref.retcref,
- "byte-ranges"=>CppType.new("ByteRanges").passcref.retcref
- }
-
- # preview: map amqp types to preview cpp types.
- def lookup_cpptype(t) t = @@typemap[t] and return t end
-end
-
-
-class AmqpElement
- # convert my amqp type_ attribute to a C++ type.
- def amqp2cpp()
- return "ArrayDomain<#{array_type(name).amqp2cpp}> " if type_=="array"
- return type_.amqp2cpp
- end
-
- # Does this object have a type-like child named name?
- def typechild(name)
- child = domain(name) if respond_to? :domain
- child = struct(name) if not child and respond_to? :struct
- child = type_(name) if not child and respond_to? :type_
- child
- end
-
- # dotted name to a type object
- def dotted_typechild(name)
- names=name.split('.')
- context = self
- while context and names.size > 1
- context = context.child_named(names.shift)
- end
- return context.typechild(names[0]) if context
- end
-
- # preview mapping - type_ attribute to C++ type
- def lookup_cpptype(name)
- if t = root.lookup_cpptype(name) then return t
- elsif c = containing_class.typechild(name) then return c.cpptype
- elsif c= root.dotted_typechild(name) then return c.cpptype
- else raise "Cannot resolve type-name #{name} from #{self}"
- end
- end
-
- def containing_class()
- return self if is_a? AmqpClass
- return parent && parent.containing_class
- end
-end
-
-
-class AmqpField
- def struct?()
- c=containing_class
- c.struct(type_)
- end
- def cpptype() lookup_cpptype(type_) or raise "no cpptype #{type_} for field #{self}" end
- def cppname() name.lcaps.cppsafe; end
- def bit?() type_ == "bit"; end
- def signature() cpptype.param+" "+cppname; end
-
- def fqtypename()
- unless type_.index(".")
- c=containing_class
- return c.domain(type_).fqtypename if c.domain(type_)
- return c.struct(type_).fqclassname if c.struct(type_)
- end
- return amqp2cpp
- end
- def paramtype()
- /^(int|uint|char|boolean|bit)/ === type_ ? fqtypename : "const #{fqtypename}&"
- end
- def param_default() "=#{fqtypename}()" end
-
- # Default value is normally the C++ default but over-ridden in specific cases
- def default_value()
- defval = cpptype.default_value;
- if name == "accept-mode" and parent.name == "transfer" then defval = "1"; end
- return defval
- end
-end
-
-class AmqpMethod
- def cppname() name.lcaps.cppsafe; end
- def param_names() fields.map { |f| f.cppname }; end
- def signature() fields.map { |f| f.signature }; end
- def classname() parent.name; end
- def body_name()
- classname().caps+name.caps+"Body"
- end
- def cpp_pack_type() root.lookup_cpptype("uint16") end
-end
-
-module AmqpHasFields
- def parameters(with_default=nil)
- fields.map { |f|
- "#{f.paramtype} #{f.cppname}_#{f.param_default if with_default}"
- }
- end
- def unused_parameters() fields.map { |f| "#{f.paramtype} /*#{f.cppname}_*/"} end
- def arguments() fields.map { |f| "#{f.cppname}_"} end
- def values() fields.map { |f| "#{f.cppname}"} end
- def initializers() fields.map { |f| "#{f.cppname}(#{f.cppname}_)"} end
-end
-
-class AmqpAction
- def classname() name.typename; end
- def funcname() parent.name.funcname + name.caps; end
- def fqclassname() parent.name+"::"+classname; end
- def full_code() (containing_class.code.hex << 8)+code.hex; end
- include AmqpHasFields
-end
-
-class AmqpType
- def cpptype() root.lookup_cpptype(name) end # preview
- def typename() name.typename; end # new mapping
- def fixed?() fixed_width; end
-end
-
-class AmqpCommand < AmqpAction
- def base() "Command"; end
-end
-
-class AmqpControl < AmqpAction
- def base() "Control"; end
-end
-
-class AmqpClass
- def cppname() name.caps; end # preview
- def nsname() name.nsname; end
-end
-
-class AmqpDomain
- # preview
- def cpptype() lookup_cpptype(type_) end
- def cppname() name.caps; end
-
- # new mapping
- def fqtypename()
- return containing_class.nsname+"::"+name.typename if containing_class
- name.typename
- end
-end
-
-class AmqpResult
- # preview
- def cpptype()
- if type_ then lookup_cpptype(type_)
- else CppType.new(parent.parent.name.caps+parent.name.caps+"Result").passcref
- end
- end
-end
-
-class AmqpStruct
- include AmqpHasFields
-
- @@pack_types={ "1"=>"uint8", "2"=>"uint16", "4"=>"uint32"}
- def cpp_pack_type() # preview
- root.lookup_cpptype(@@pack_types[pack])
- end
- def cpptype() CppType.new(cppname).passcref.retcref end
- #def cppname() containing_class.cppname+name.caps; end
- def cppname()
- if parent.kind_of? AmqpResult
- parent.parent.parent.name.caps+parent.parent.name.caps+"Result"
- else
- name.caps
- end
- end
- def fqclassname() containing_class.nsname+"::"+name.typename; end
- def classname() name.typename; end
- def full_code() (containing_class.code.hex << 8)+code.hex; end
-end
-
-class CppGen < Generator
- def initialize(outdir, *specs)
- super(outdir,*specs)
- # need to sort classes for dependencies
- @actions=[] # Stack of end-scope actions
- end
-
- # Write a header file.
- def h_file(path, &block)
- path = (/\.h$/ === path ? path : path+".h")
- guard=path.upcase.tr('./-','_')
- file(path) {
- gen "#ifndef #{guard}\n"
- gen "#define #{guard}\n"
- gen Copyright
- yield
- gen "#endif /*!#{guard}*/\n"
- }
- end
-
- # Write a .cpp file.
- def cpp_file(path, &block)
- path = (/\.cpp$/ === path ? path : path+".cpp")
- file(path) do
- gen Copyright
- yield
- end
- end
-
- def include(header)
- header+=".h" unless /(\.h|[">])$/===header
- header="\"#{header}\"" unless /(^<.*>$)|(^".*"$)/===header
- genl "#include #{header}"
- end
-
- def scope(open="{",close="}", &block)
- genl open
- indent &block
- genl close
- end
-
- def namespace(name, &block)
- genl
- names = name.split("::")
- names.each { |n| genl "namespace #{n} {" }
- genl "namespace {" if (names.empty?)
- genl
- yield
- genl
- genl('}'*([names.size, 1].max)+" // namespace "+name)
- genl
- end
-
- def struct_class(type, name, bases, &block)
- gen "#{type} #{name}"
- if (!bases.empty?)
- genl ":"
- indent { gen "#{bases.join(",\n")}" }
- end
- genl
- scope("{","};", &block)
- end
-
- def struct(name, *bases, &block)
- struct_class("struct", name, bases, &block);
- end
- def cpp_class(name, *bases, &block)
- struct_class("class", name, bases, &block);
- end
-
- def typedef(type, name) genl "typedef #{type} #{name};\n"; end
-
- def variant(types) "boost::variant<#{types.join(", ")}>"; end
- def variantl(types) "boost::variant<#{types.join(", \n")}>"; end
- def blank_variant(types) variant(["boost::blank"]+types); end
- def tuple(types) "boost::tuple<#{types.join(', ')}>"; end
-
- def public() outdent { genl "public:" } end
- def private() outdent { genl "private:" } end
- def protected() outdent { genl "protected:" } end
-
- # Returns [namespace, classname, filename]
- def parse_classname(full_cname)
- names=full_cname.split("::")
- return names[0..-2].join('::'), names[-1], names.join("/")
- end
-
- def doxygen_comment(&block)
- genl "/**"
- prefix(" * ",&block)
- genl " */"
- end
-
- # Generate code in namespace for each class
- def each_class_ns()
- @amqp.classes.each { |c| namespace(c.nsname) { yield c } }
- end
-
- def signature(ret_name, params, trailer="")
- if params.size <= 1
- genl ret_name+"(#{params})"+trailer
- else
- scope(ret_name+"(",")"+trailer) { genl params.join(",\n") }
- end
- end
-
- def function_decl(ret_name, params=[], trailer="")
- signature(ret_name, params, trailer+";")
- end
-
- def function_defn(ret_name, params=[], trailer="")
- genl
- signature(ret_name, params, trailer)
- scope() { yield }
- end
-
- def ctor_decl(name, params=[]) function_decl(name, params); end
-
- def ctor_defn(name, params=[], inits=[])
- signature(name, params, inits.empty? ? "" : " :")
- indent { gen inits.join(",\n") } if not inits.empty?
- scope() { yield }
- end
-
- def function_call(name, params=[], trailer="")
- gen name
- list "(",params, ")"
- gen trailer
- end
-end
-
-# Fully-qualified class name
-class FqClass < Struct.new(:fqname,:namespace,:name,:file)
- def initialize(fqclass)
- names=fqclass.split "::"
- super(fqclass, names[0..-2].join('::'), names[-1], names.join("/"))
- end
-end
-
diff --git a/M4-RCs/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb b/M4-RCs/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb
deleted file mode 100755
index d784e589df..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/framing.0-10/MethodBodyConstVisitor.rb
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-class MethodBodyConstVisitorGen < CppGen
-
- def initialize(outdir, amqp)
- super(outdir, amqp)
- @namespace="qpid::framing"
- @classname="MethodBodyConstVisitor"
- @filename="qpid/framing/MethodBodyConstVisitor"
- end
-
- def generate()
- h_file("#{@filename}") {
- namespace(@namespace) {
- @amqp.methods_.each { |m| genl "class #{m.body_name};" }
- cpp_class("MethodBodyConstVisitor") {
- genl "public:"
- genl "virtual ~MethodBodyConstVisitor() {}"
- @amqp.methods_.each { |m| genl "virtual void visit(const #{m.body_name}&) = 0;" }
- }}}
- end
-end
-
-MethodBodyConstVisitorGen.new($outdir, $amqp).generate();
-
diff --git a/M4-RCs/qpid/cpp/rubygen/framing.0-10/MethodBodyDefaultVisitor.rb b/M4-RCs/qpid/cpp/rubygen/framing.0-10/MethodBodyDefaultVisitor.rb
deleted file mode 100755
index 92bd10c9dd..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/framing.0-10/MethodBodyDefaultVisitor.rb
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-class MethodBodyDefaultVisitorGen < CppGen
-
- def initialize(outdir, amqp)
- super(outdir, amqp)
- @namespace, @classname, @filename = parse_classname("qpid::framing::MethodBodyDefaultVisitor")
- end
-
- def generate()
- h_file(@filename) {
- include "qpid/framing/MethodBodyConstVisitor"
- namespace(@namespace) {
- genl "class AMQMethodBody;"
- cpp_class(@classname, "public MethodBodyConstVisitor") {
- genl "public:"
- genl "virtual void defaultVisit(const AMQMethodBody&) = 0;"
- @amqp.methods_.each { |m|
- genl "virtual void visit(const #{m.body_name}&);" }
- }}}
-
- cpp_file(@filename) {
- include(@filename)
- include("all_method_bodies.h")
- namespace(@namespace) {
- @amqp.methods_.each { |m|
- genl "void #{@classname}::visit(const #{m.body_name}& b) { defaultVisit(b); }"
- }}}
- end
-end
-
-MethodBodyDefaultVisitorGen.new($outdir, $amqp).generate();
-
diff --git a/M4-RCs/qpid/cpp/rubygen/framing.0-10/MethodHolder.rb b/M4-RCs/qpid/cpp/rubygen/framing.0-10/MethodHolder.rb
deleted file mode 100755
index a2801d0907..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/framing.0-10/MethodHolder.rb
+++ /dev/null
@@ -1,118 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-class MethodHolderGen < CppGen
-
- def initialize(outdir, amqp)
- super(outdir, amqp)
- @namespace="qpid::framing"
- @classname="BodyHolder"
- @filename="qpid/framing/BodyHolder"
- end
-
- def gen_max_size()
- # Generate program to generate MaxSize.h
- cpp_file("generate_MaxMethodBodySize_h") {
- include "qpid/framing/AMQHeaderBody"
- include "qpid/framing/AMQContentBody"
- include "qpid/framing/AMQHeartbeatBody"
- @amqp.methods_.each { |m| include "qpid/framing/#{m.body_name}" }
- genl
- include "<algorithm>"
- include "<fstream>"
- genl
- genl "using namespace std;"
- genl "using namespace qpid::framing;"
- genl
- scope("int main(int, char** argv) {") {
- genl "size_t maxSize=0;"
- genl "maxSize=max(maxSize, sizeof(AMQHeaderBody));"
- genl "maxSize=max(maxSize, sizeof(AMQContentBody));"
- genl "maxSize=max(maxSize, sizeof(AMQHeartbeatBody));"
- @amqp.methods_.each { |m|
- genl "maxSize=max(maxSize, sizeof(#{m.body_name}));" }
- gen <<EOS
-ofstream out("qpid/framing/MaxMethodBodySize.h");
-out << "// GENERATED CODE: generated by " << argv[0] << endl;
-out << "namespace qpid{ namespace framing { " << endl;
-out << "const size_t MAX_METHOD_BODY_SIZE=" << maxSize << ";" << endl;
-out << "}}" << endl;
-EOS
- }
- }
- end
-
- def gen_construct
- cpp_file(@filename+"_gen") {
- include @filename
- include "qpid/framing/AMQHeaderBody"
- include "qpid/framing/AMQContentBody"
- include "qpid/framing/AMQHeartbeatBody"
- @amqp.methods_.each { |m| include "qpid/framing/#{m.body_name}" }
- include "qpid/framing/FrameDefaultVisitor.h"
- include "qpid/Exception.h"
- genl
- namespace(@namespace) {
- scope("void #{@classname}::setMethod(ClassId c, MethodId m) {") {
- scope("switch (c) {") {
- @amqp.classes.each { |c|
- scope("case #{c.code}: switch(m) {") {
- c.methods_.each { |m|
- genl "case #{m.code}: blob = in_place<#{m.body_name}>(); break;"
- }
- genl "default: throw Exception(QPID_MSG(\"Invalid method id \" << int(m) << \" for class #{c.name} \"));"
- }
- genl "break;"
- }
- genl "default: throw Exception(QPID_MSG(\"Invalid class id \" << int(c)));"
- }
- }
-
- struct("CopyVisitor", "public FrameDefaultVisitor") {
- genl "using FrameDefaultVisitor::visit;"
- genl "using FrameDefaultVisitor::defaultVisit;"
- genl "BodyHolder& holder;"
- genl "CopyVisitor(BodyHolder& h) : holder(h) {}"
- ["Header", "Content", "Heartbeat"].each { |type|
- genl "void visit(const AMQ#{type}Body& x) { holder=x; }"
- }
- @amqp.methods_.each { |m|
- genl "void visit(const #{m.body_name}& x) { holder=x; }"
- }
- genl "void defaultVisit(const AMQBody&) { assert(0); }"
- }
- genl
-
- scope("void BodyHolder::setBody(const AMQBody& b) {") {
- genl "CopyVisitor cv(*this); b.accept(cv);"
- }
- }}
- end
-
- def generate
- gen_max_size
- gen_construct
- end
-end
-
-MethodHolderGen.new($outdir, $amqp).generate();
-
diff --git a/M4-RCs/qpid/cpp/rubygen/framing.0-10/Operations.rb b/M4-RCs/qpid/cpp/rubygen/framing.0-10/Operations.rb
deleted file mode 100755
index c217926a66..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/framing.0-10/Operations.rb
+++ /dev/null
@@ -1,121 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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.
-#
-# Usage: output_directory xml_spec_file [xml_spec_file...]
-#
-$: << '..'
-require 'cppgen'
-require 'fileutils'
-require 'etc'
-require 'pathname'
-
-class OperationsGen < CppGen
-
- def initialize(chassis, outdir, amqp)
- super(outdir, amqp)
- @chassis=chassis
- @classname="AMQP_#{@chassis.caps}Operations"
- end
-
- def handler_method (m)
- return_type = m.result ? m.result.cpptype.ret_by_val : "void"
- gen "\nvirtual #{return_type} #{m.cppname}("
- gen m.signature.join(",\n")
- gen ") = 0;\n"
- end
-
- def handler_classname(c) c.name.caps+"Handler"; end
-
- def methods_on(parent, chassis)
- chassis == "all" ? parent.methods_ : parent.methods_on(chassis)
- end
-
- def handler_class(c)
- m = methods_on(c,@chassis)
- if (not m.empty?)
- handlerclass=handler_classname c
- gen <<EOS
-// ==================== class #{handlerclass} ====================
-class #{handlerclass} {
- // Constructors and destructors
- public:
- class Invoker; // Declared in #{@chassis.caps}Invoker
-
- #{handlerclass}(){};
- virtual ~#{handlerclass}() {}
- // Protocol methods
-EOS
- m.each { |m| handler_method(m) if !m.content() }
- gen <<EOS
-}; // class #{handlerclass}
-
-
-EOS
- end
- end
-
- def handler_get(c)
- m = methods_on(c,@chassis)
- if (not m.empty?)
- handlerclass=handler_classname c
- gen "virtual #{handlerclass}* get#{handlerclass}() = 0;\n"
- end
- end
-
- def generate()
- h_file("qpid/framing/#{@classname}.h") {
- gen <<EOS
-#include <sstream>
-#include "qpid/framing/ProtocolVersion.h"
-#include "qpid/framing/amqp_structs.h"
-
-namespace qpid {
-namespace framing {
-
-class AMQMethodBody;
-
-class #{@classname} {
- public:
- class Invoker; // Declared in #{@chassis.caps}Invoker
-
- virtual ~#{@classname}() {}
-
- virtual ProtocolVersion getVersion() const = 0;
-
- // Inner classes
-EOS
- indent { @amqp.classes.each { |c| handler_class(c) } }
- gen <<EOS
-
- // Method handler get methods
-
-EOS
- indent { @amqp.classes.each { |c| handler_get(c) } }
- gen <<EOS
-}; /* class #{@classname} */
-}}
-EOS
-}
- end
-end
-
-OperationsGen.new("client",ARGV[0], $amqp).generate()
-OperationsGen.new("server",ARGV[0], $amqp).generate()
-OperationsGen.new("all",ARGV[0], $amqp).generate()
-
diff --git a/M4-RCs/qpid/cpp/rubygen/framing.0-10/OperationsInvoker.rb b/M4-RCs/qpid/cpp/rubygen/framing.0-10/OperationsInvoker.rb
deleted file mode 100755
index b751f61d36..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/framing.0-10/OperationsInvoker.rb
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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.
-#
-# Usage: output_directory xml_spec_file [xml_spec_file...]
-#
-$: << '..'
-require 'cppgen'
-
-class OperationsInvokerGen < CppGen
- def initialize(chassis, outdir, amqp)
- super(outdir, amqp)
- @chassis=chassis
- @ops="AMQP_#{@chassis.caps}Operations"
- @classname="#{@ops}::Invoker"
- @filename="qpid/framing/#{@chassis.caps}Invoker"
- end
-
- def methods_on(parent, chassis)
- chassis == "all" ? parent.methods_ : parent.methods_on(chassis)
- end
-
- def handler(c) "#{@ops}::#{c.cppname}Handler"; end
- def getter(c) "get#{c.cppname}Handler"; end
- def invoker(c) "#{handler(c)}::Invoker"; end
- def visit_methods(c) methods_on(c, @chassis).select { |m| !m.content } end
-
-
- def handler_visits_cpp(c)
- visit_methods(c).each { |m|
- scope("void #{invoker(c)}::visit(const #{m.body_name}& body) {") {
- if (m.result)
- genl "this->encode(body.invoke(target), result.result);"
- else
- genl "body.invoke(target);"
- end
- genl "result.handled=true;"
- }
- }
- end
-
- def ops_visits_cpp()
- @amqp.classes.each { |c|
- visit_methods(c).each { |m|
- scope("void #{@classname}::visit(const #{m.body_name}& body) {") {
- genl "#{handler(c)}::Invoker invoker(*target.#{getter(c)}());"
- genl "body.accept(invoker);"
- genl "result=invoker.getResult();"
- }
- }
- }
- end
-
- def invoker_h(invoker, target, methods)
- return if methods.empty?
- genl
- cpp_class(invoker, "public qpid::framing::Invoker") {
- genl "#{target}& target;"
- public
- genl("Invoker(#{target}& target_) : target(target_) {}")
- genl "using MethodBodyDefaultVisitor::visit;"
- methods.each { |m| genl "void visit(const #{m.body_name}& body);" }
- }
- end
-
- def generate()
- h_file(@filename) {
- include "qpid/framing/#{@ops}"
- include "qpid/framing/Invoker.h"
- namespace("qpid::framing") {
- # AMQP_*Operations invoker.
- methods=@amqp.classes.map { |c| visit_methods(c).to_a }.flatten
- invoker_h(@classname, @ops, methods)
-
- # AMQP_*Operations::*Handler invokers.
- @amqp.classes.each { |c|
- invoker_h(invoker(c), handler(c), visit_methods(c))
- }
- }
- }
-
- cpp_file(@filename) {
- include @filename
- @amqp.classes.each { |c|
- visit_methods(c).each { |m|
- include "qpid/framing/#{m.body_name}"
- }}
- namespace("qpid::framing") {
- ops_visits_cpp
- @amqp.classes.each { |c|
- next if visit_methods(c).empty?
- handler_visits_cpp(c)
- }
- }
- }
- end
-end
-
-OperationsInvokerGen.new("client",ARGV[0], $amqp).generate()
-OperationsInvokerGen.new("server",ARGV[0], $amqp).generate()
-OperationsInvokerGen.new("all",ARGV[0], $amqp).generate()
diff --git a/M4-RCs/qpid/cpp/rubygen/framing.0-10/Proxy.rb b/M4-RCs/qpid/cpp/rubygen/framing.0-10/Proxy.rb
deleted file mode 100755
index e647a8da0b..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/framing.0-10/Proxy.rb
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-class ProxyGen < CppGen
-
- def initialize(chassis, outdir, amqp)
- super(outdir, amqp)
- @chassis=chassis
- @classname="AMQP_#{@chassis.caps}Proxy"
- @filename="qpid/framing/#{@classname}"
- end
-
- def methods_on(parent, chassis)
- chassis == "all" ? parent.methods_ : parent.methods_on(chassis)
- end
-
- def proxy_member(c) c.name.lcaps+"Proxy"; end
-
- def inner_class_decl(c)
- cname=c.name.caps
- cpp_class(cname, "Proxy") {
- gen <<EOS
-public:
-#{cname}(FrameHandler& f) : Proxy(f) {}
-static #{cname}& get(#{@classname}& proxy) { return proxy.get#{cname}(); }
-EOS
- methods_on(c, @chassis).each { |m|
- genl "virtual void #{m.cppname}(#{m.signature.join(",\n ")});"
- genl
- }}
- end
-
- def inner_class_defn(c)
- cname=c.cppname
- methods_on(c, @chassis).each { |m|
- genl "void #{@classname}::#{cname}::#{m.cppname}(#{m.signature.join(", ")})"
- scope {
- params=(["getVersion()"]+m.param_names).join(", ")
- genl "send(#{m.body_name}(#{params}));"
- }}
- end
-
- def generate
- # .h file
- h_file(@filename) {
- include "qpid/framing/Proxy.h"
- include "qpid/framing/Array.h"
- include "qpid/framing/amqp_types.h"
- include "qpid/framing/amqp_structs.h"
- namespace("qpid::framing") {
- cpp_class(@classname, "public Proxy") {
- public
- genl "#{@classname}(FrameHandler& out);"
- genl
- @amqp.classes.each { |c|
- inner_class_decl(c)
- genl
- genl "#{c.cppname}& get#{c.cppname}() { return #{proxy_member(c)}; }"
- genl
- }
- private
- @amqp.classes.each{ |c| gen c.cppname+" "+proxy_member(c)+";\n" }
- }}}
-
- # .cpp file
- cpp_file(@filename) {
- include "<sstream>"
- include "#{@classname}.h"
- include "qpid/framing/amqp_types_full.h"
- methods_on(@amqp, @chassis).each {
- |m| include "qpid/framing/"+m.body_name
- }
- genl
- namespace("qpid::framing") {
- genl "#{@classname}::#{@classname}(FrameHandler& f) :"
- gen " Proxy(f)"
- @amqp.classes.each { |c| gen ",\n "+proxy_member(c)+"(f)" }
- genl "{}\n"
- @amqp.classes.each { |c| inner_class_defn(c) }
- }}
- end
-end
-
-
-ProxyGen.new("client", $outdir, $amqp).generate;
-ProxyGen.new("server", $outdir, $amqp).generate;
-ProxyGen.new("all", $outdir, $amqp).generate;
-
diff --git a/M4-RCs/qpid/cpp/rubygen/framing.0-10/Session.rb b/M4-RCs/qpid/cpp/rubygen/framing.0-10/Session.rb
deleted file mode 100644
index 5dd2a91a56..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/framing.0-10/Session.rb
+++ /dev/null
@@ -1,408 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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.
-#
-# Usage: output_directory xml_spec_file [xml_spec_file...]
-#
-$: << '..'
-require 'cppgen'
-
-class CppGen
- def session_methods(sync_default)
- excludes = ["connection", "session", "file", "stream"]
- gen_methods=@amqp.methods_on(@chassis).reject { |m|
- excludes.include? m.parent.name or m.body_name.include?("010")
- }
- gen_methods.each { |m| m.set_sync_default(sync_default) }
- end
-
-
- # Generates a doxygen comment for AmqpMethod m.
- def doxygen(m)
- doxygen_comment {
- genl m.doc
- genl
- m.fields_c.each { |f|
- genl "@param #{f.cppname}"
- genl f.doc if f.doc
- genl
- }
- }
- end
-end
-
-# Sync vs. async APIs
-module SyncAsync
- def sync_prefix() @async ? "Async" : "" end
- def sync_adjective() @async ? "asynchronous" : "synchronous" end
- def sync_convert() @async ? "async" : "sync" end
-
-
- def decl_ctor_opeq()
- genl
- genl "#{@classname}();"
- genl "#{@classname}(const #{@version_base}& other);"
- genl "#{@classname}& operator=(const #{@version_base}& other);"
- end
-
- def defn_ctor_opeq(inline="")
- genl
- genl "#{inline} #{@classname}::#{@classname}() {}"
- scope("#{inline} #{@classname}::#{@classname}(const #{@version_base}& other) {") {
- genl "*this = other;"
- }
- scope("#{inline} #{@classname}& #{@classname}::operator=(const #{@version_base}& other) {") {
- genl "impl = static_cast<const #{@classname}&>(other).impl;"
- genl "return *this;"
- }
- end
-
- def sync_default() !@async end
-end
-
-class ContentField # For extra content parameters
- def cppname() "content" end
- def signature() "const MethodContent& content" end
- def sig_default() signature+"="+"DefaultContent(std::string())" end
- def unpack() "p[arg::content|DefaultContent(std::string())]"; end
- def doc() "Message content"; end
-end
-
-class SyncField # For extra sync parameters
- def initialize(default_value) @default_value=default_value ? "true" : "false" end
- def cppname() "sync" end
- def signature() "bool sync" end
- def sig_default() signature+"="+@default_value end
- def unpack() "p[arg::sync|#{@default_value}]"; end
- def doc() "If true the broker will respond with completion status as soon as possible."; end
-end
-
-class AmqpField
- def unpack() "p[arg::#{cppname}|#{default_value}]"; end
- def sig_default() signature+"="+default_value; end
-end
-
-class AmqpMethod
- def set_sync_default(sync_default) @sync_default=sync_default end
- def fields_c() result = fields + (content ? [ContentField.new] : []) + [SyncField.new(@sync_default)] end
- def param_names_c() fields_c.map { |f| f.cppname} end
- def signature_c() fields_c.map { |f| f.signature }; end
- def sig_c_default() fields_c.map { |f| f.sig_default }; end
- def argpack_name() "#{parent.cppname}#{name.caps}Parameters"; end
- def argpack_type()
- "boost::parameter::parameters<" +
- fields_c.map { |f| "arg::keyword_tags::"+f.cppname }.join(',') +
- ">"
- end
-
- def return_type(async)
- if (async)
- return "TypedResult<qpid::framing::#{result.cpptype.ret_by_val}>" if (result)
- return "Completion"
- else
- return "qpid::framing::#{result.cpptype.ret_by_val}" if (result)
- return "void"
- end
- end
-
- def session_function() "#{parent.name.lcaps}#{name.caps}"; end
-end
-
-class SessionNoKeywordGen < CppGen
- include SyncAsync
-
- def initialize(outdir, amqp, async)
- super(outdir, amqp)
- @async=async
- @chassis="server"
- @namespace,@classname,@file=
- parse_classname "qpid::client::no_keyword::#{sync_prefix}Session_#{@amqp.version.bars}"
- @version_base="SessionBase_#{@amqp.major}_#{@amqp.minor}"
- end
-
- def generate()
- h_file(@file) {
- include "qpid/client/#{@version_base}.h"
- namespace(@namespace) {
- doxygen_comment {
- genl "AMQP #{@amqp.version} #{sync_adjective} session API."
- genl @amqp.class_("session").doc
- # FIXME aconway 2008-05-23: additional doc on sync/async use.
- }
- cpp_class(@classname, "public #{@version_base}") {
- public
- decl_ctor_opeq()
- session_methods(sync_default).each { |m|
- genl
- doxygen(m)
- args=m.sig_c_default.join(", ")
- genl "#{m.return_type(@async)} #{m.session_function}(#{args});"
- }
- }
- }}
-
- cpp_file(@file) {
- include @classname
- include "qpid/framing/all_method_bodies.h"
- namespace(@namespace) {
- genl "using namespace framing;"
- session_methods(sync_default).each { |m|
- genl
- sig=m.signature_c.join(", ")
- func="#{@classname}::#{m.session_function}"
- scope("#{m.return_type(@async)} #{func}(#{sig}) {") {
- args=(["ProtocolVersion(#{@amqp.major},#{@amqp.minor})"]+m.param_names).join(", ")
- genl "#{m.body_name} body(#{args});";
- genl "body.setSync(sync);"
- sendargs="body"
- sendargs << ", content" if m.content
- async_retval="#{m.return_type(true)}(impl->send(#{sendargs}), impl)"
- if @async then
- genl "return #{async_retval};"
- else
- if m.result
- genl "return #{async_retval}.get();"
- else
- genl "#{async_retval}.wait();"
- end
- end
- }}
- defn_ctor_opeq()
- }}
- end
-end
-
-class SessionGen < CppGen
- include SyncAsync
-
- def initialize(outdir, amqp, async)
- super(outdir, amqp)
- @async=async
- @chassis="server"
- session="#{sync_prefix}Session_#{@amqp.version.bars}"
- @base="no_keyword::#{session}"
- @fqclass=FqClass.new "qpid::client::#{session}"
- @classname=@fqclass.name
- @fqbase=FqClass.new("qpid::client::#{@base}")
- @version_base="SessionBase_#{@amqp.major}_#{@amqp.minor}"
- end
-
- def gen_keyword_decl(m)
- return if m.fields_c.empty? # Inherited function will do.
- scope("BOOST_PARAMETER_MEMFUN(#{m.return_type(@async)}, #{m.session_function}, 0, #{m.fields_c.size}, #{m.argpack_name}) {") {
- scope("return #{@base}::#{m.session_function}(",");") {
- gen m.fields_c.map { |f| f.unpack() }.join(",\n")
- }
- }
- genl
- end
-
- def generate()
- keyword_methods=session_methods(sync_default).reject { |m| m.fields_c.empty? }
- max_arity = keyword_methods.map{ |m| m.fields_c.size }.max
-
- h_file("qpid/client/arg.h") {
- # Generate keyword tag declarations.
- genl "#define BOOST_PARAMETER_MAX_ARITY #{max_arity}"
- include "<boost/parameter.hpp>"
- namespace("qpid::client::arg") {
- keyword_methods.map{ |m| m.param_names_c }.flatten.uniq.each { |k|
- genl "BOOST_PARAMETER_KEYWORD(keyword_tags, #{k})"
- }}
- }
-
- h_file(@fqclass.file) {
- include @fqbase.file
- include "qpid/client/arg"
- namespace("qpid::client") {
- # Doxygen comment.
- doxygen_comment {
- genl "AMQP #{@amqp.version} session API with keyword arguments."
- genl <<EOS
-This class provides the same set of functions as #{@base}, but also
-allows parameters be passed using keywords. The keyword is the
-parameter name in the namespace "arg".
-
-For example given the normal function "foo(int x=0, int y=0, int z=0)"
-you could call it in either of the following ways:
-
-@code
-session.foo(1,2,3); // Normal no keywords
-session.foo(arg::z=3, arg::x=1); // Keywords and a default
-@endcode
-
-The keyword functions are easy to use but their declarations are hard
-to read. You may find it easier to read the documentation for #{@base}
-which provides the same set of functions using normal non-keyword
-declarations.
-
-\\ingroup clientapi
-
-
-\\details
-
-<h2>Publishing Messages</h2>
-<ul>
-<li><p>messageTransfer()</p>
-<pre>session.messageTransfer(arg::content=message, arg::destination="amq.topic");</pre></li>
-<li><p>messageTransfer() &mdash; asynchronous</p>
-<pre>#include &lt;qpid/client/AsyncSession.h>
-
-for (int i=0; i&lt;10; i++) {
- message.setData(message_data.str());
- async(session).messageTransfer(arg::content=message, arg::destination="amq.direct");
-}
-
-session.sync();
-</pre>
-</li>
-</ul>
-
-<h2>Exchanges</h2>
-<ul>
-<li><p>exchangeBind()</p>
-<pre>session.exchangeBind(arg::exchange="amq.topic", arg::queue=queue, arg::bindingKey=routing_key);</pre>
-</li>
-<li><p>exchangeUnbind()</p>
-<pre>session.exchangeUnBind(arg::exchange="amq.topic", arg::queue=queue, arg::bindingKey=routing_key);</pre></li>
-<li><p>exchangeBound()</p>
-<pre>if (session.exchangeBound(arg::exchange="amq.topic", arg::queue=queue, arg::bindingKey=rk)){...}</pre>
-<pre>if (session.exchangeBound(arg::exchange="amq.topic", arg::queue=queue)){...}</pre>
-</li>
-<li><p>exchangeDeclare()</p>
-<pre>session.exchangeDeclare(arg::exchange="my.topic", arg::type="topic");</pre>
-<pre>session.exchangeDeclare(arg::exchange="xml", arg::type="xml");</pre>
-</li>
-<li><p>exchangeDelete()</p>
-<pre>session.exchangeDeclare(arg::exchange="my.topic");</pre>
-<pre>session.exchangeDeclare(arg::exchange="xml", arg::ifUnused=true);</pre>
-</li>
-<li><p>exchangeQuery()</p>
-<pre>ExchangeQueryResult eqr = session.exchangeQuery(arg::exchange="my.topic");</pre></li>
-</ul>
-
-
-<h2>Configuring exchanges in session.exchangeDeclare</h2>
-
-<pre>arg::durable=true</pre>
-<p>Default: false.</p>
-<p>If durable=true, an exchange remains active even if the server is restarted. If durable=false, an exchange is purged when a server restarts.</p>
-
-<pre>arg::autoDelete=true</pre>
-<p>Default: false.</p>
-<p>If autoDelete=true, deleting the last binding for an exchange also deletes the exchange.</p>
-
-<pre>arg::alternatExchange="my.exchange"</pre>
-<p>Default: none.</p>
-<p>If an alternate exchange is specified, messages that can not be delivered to any queue are sent to the alternate exchange.</p>
-
-<h2>Queues</h2>
-<ul>
-<li><p>queueDeclare()</p>
-<pre>session.queueDeclare(arg::queue="message_queue");</pre>
-</li>
-<li><p>queueDelete()</p>
-<pre>session.queueDelete(arg::queue="message_queue");</pre></li>
-<li><p>queuePurge()</p>
-<pre>session.queuePurge(arg::queue="message_queue");</pre></li>
-<li><p>queueQuery()</p>
-<pre>QueueQueryResult qqr = session.queueQuery(arg::queue="message_queue");</pre></li>
-</ul>
-
-
-<h2>Configuring queues with session.queueDeclare</h2>
-<pre>arg::durable=true</pre>
-<p>Default: false.</p>
-<p>If durable=true, a queue remains active if the server is restarted. If durable=false, a queue and its contents are lost when a server restarts.</p>
-<br/>
-
-<pre>arg::autoDelete=true</pre>
-<p>Default: false.</p>
-<p>If autoDelete=true, the queue is deleted when the last active Subscription to the Queue is canceled.</p>
-<br/>
-
-<pre>arg::exclusive=true</pre>
-<p>Default: false.</p>
-<p>If exclusive=true, only the Session that created a queue can access it.</p>
-<br/>
-
-<pre>arg::alternateExchange="my.exchange"</pre>
-<p>Default: none. </p>
-<p>If an alternate exchange is specified, messages are routed to it if (1) they are rejected by a client, or (2) they remain on the queue when it is deleted.</p>
-<br/>
-
-
-<h2>Accepting, Acquiring, Rejecting, or Releasing Messages</h2>
-<ul>
-<li><p>messageAccept() &mdash; acknowledges messages</p>
-<pre>SequenceSet tobeAccepted;
-toAccepted.add(msg.getId());
-session.messageAccept(toBeAccepted);</pre>
-</li>
-<li><p>messageAcquire()</p>
-<pre>SequenceSet tobeAcquired;
-toBeAcquired.add(msg.getId());
-session.messageAcquire(toBeAcquired);</pre>
-</li>
-<li><p>messageReject()</p>
-<pre>SequenceSet tobeRejected;
-toRejected.add(msg.getId());
-session.messageReject(toBeRejected);</pre>
-</li>
-<li><p>messageRelease()</p>
-<pre>SequenceSet tobeReleased;
-toReleased.add(msg.getId());
-session.messageRelease(toBeReleased);</pre></li>
-</ul>
-
-<h2>Transactions</h2>
-<ul>
-<li><p>txSelect()</p>
-<pre>session.txSelect();</pre>
-</li>
-<li><p>txCommit()</p>
-<pre>session.txSelect();</pre></li>
-<li><p>txRollback()</p>
-<pre>session.txRollback();</pre></li>
-</ul>
-
-
-EOS
- }
- # Session class.
- cpp_class(@classname,"public #{@base}") {
- public
- decl_ctor_opeq()
- private
- keyword_methods.each { |m| typedef m.argpack_type, m.argpack_name }
- genl "friend class Connection;"
- public
- keyword_methods.each { |m| gen_keyword_decl(m) }
- }
- genl "/** Conversion to #{@classname} from another session type */"
- genl "inline #{@classname} #{sync_convert}(const #{@version_base}& other) { return #{@clasname}(other); }"
- defn_ctor_opeq("inline")
- }}
- end
-end
-
-SessionNoKeywordGen.new(ARGV[0], $amqp, true).generate()
-SessionNoKeywordGen.new(ARGV[0], $amqp, false).generate()
-SessionGen.new(ARGV[0], $amqp, true).generate()
-SessionGen.new(ARGV[0], $amqp, false).generate()
-
diff --git a/M4-RCs/qpid/cpp/rubygen/framing.0-10/all_method_bodies.rb b/M4-RCs/qpid/cpp/rubygen/framing.0-10/all_method_bodies.rb
deleted file mode 100755
index 4c7fccfff5..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/framing.0-10/all_method_bodies.rb
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-class AllMethodBodiesGen < CppGen
-
- def initialize(outdir, amqp)
- super(outdir, amqp)
- @namespace="qpid::framing"
- @filename="qpid/framing/all_method_bodies"
- end
-
- def generate()
- h_file(@filename) {
- @amqp.methods_.each { |m| include "qpid/framing/"+m.body_name }
- }
- end
-end
-
-AllMethodBodiesGen.new($outdir, $amqp).generate();
-
diff --git a/M4-RCs/qpid/cpp/rubygen/framing.0-10/constants.rb b/M4-RCs/qpid/cpp/rubygen/framing.0-10/constants.rb
deleted file mode 100755
index d07c84e63a..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/framing.0-10/constants.rb
+++ /dev/null
@@ -1,201 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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 .. in load path
-require 'cppgen'
-
-class ConstantsGen < CppGen
-
- def initialize(outdir, amqp)
- super(outdir, amqp)
- @namespace="qpid::framing"
- @dir="qpid/framing"
- end
-
- def constants_h()
- h_file("#{@dir}/constants") {
- namespace(@namespace) {
- # Constants for class/method names.
- scope("enum AmqpConstant {","};") {
- l=[]
- l.concat @amqp.constants.map { |c| "#{c.name.shout}=#{c.value}" }
- @amqp.classes.each { |c|
- l << "#{c.name.shout}_CLASS_ID=#{c.code}"
- l.concat c.methods_.map { |m|
- "#{c.name.shout}_#{m.name.shout}_METHOD_ID=#{m.code}" }
- }
- genl l.join(",\n")
- }
- }
- }
- end
-
- def typecode_enum(t) "TYPE_CODE_#{t.name.shout}" end
-
- def typecode_h_cpp
- path="#{@dir}/TypeCode"
- h_file(path) {
- include("<iosfwd>")
- include("\"qpid/sys/IntegerTypes.h\"")
- namespace(@namespace) {
- scope("enum TypeCode {", "};") {
- genl @amqp.types.map { |t| "#{typecode_enum t} = #{t.code}" if t.code }.compact.join(",\n")
- }
- genl <<EOS
-
-/** True if t is a valid TypeCode value */
-bool isTypeCode(uint8_t t);
-
-/** Throw exception if not a valid TypeCode */
-TypeCode typeCode(uint8_t);
-
-/**@return 0 if t is not a valid enum TypeCode value. */
-const char* typeName(TypeCode t);
-
-std::ostream& operator<<(std::ostream&, TypeCode);
-EOS
- }
- }
-
- cpp_file(path) {
- include(path);
- include("qpid/Exception.h")
- include("<ostream>")
- namespace(@namespace) {
- scope("const char* typeName(TypeCode t) {") {
- scope("switch (t) {") {
- @amqp.types.each { |t| genl "case #{typecode_enum t}: return \"#{t.name}\";" if t.code }
- genl "default: break;"
- }
- genl "return 0;";
- }
- genl <<EOS
-
-bool isTypeCode(uint8_t t) { return typeName(TypeCode(t)); }
-
-TypeCode typeCode(uint8_t t) {
- if (!isTypeCode(t)) throw Exception(QPID_MSG("Invalid TypeCode " << t));
- return TypeCode(t);
-}
-
-std::ostream& operator<<(std::ostream& o, TypeCode t) {
- if (isTypeCode(t)) return o << typeName(t);
- else return o << "Invalid TypeCode " << t;
-}
-EOS
- }
- }
- end
-
- def enum_h()
- h_file("#{@dir}/enum") {
- # Constants for enum domains.
- namespace(@namespace) {
- @amqp.domains.each { |d| declare_enum(d.enum) if d.enum }
- @amqp.classes.each { |c|
- enums=c.collect_all(AmqpEnum)
- if !enums.empty? then
- namespace(c.nsname) { enums.each { |e| declare_enum(e) } }
- end
- }
- }
- }
- end
-
- def declare_enum(enum)
- # Generated like this: enum containing_class::Foo { FOO_X, FOO_Y; }
- name="#{enum.parent.name.caps}"
- prefix=enum.parent.name.shout+"_"
- scope("enum #{name} {","};") {
- genl enum.choices.collect { |c| "#{prefix}#{c.name.shout}=#{c.value}" }.join(",\n")
- }
- end
-
- def declare_exception(c, base, package, enum)
- name=c.name.caps+"Exception"
- value="#{package}::#{enum.parent.name.shout}_#{c.name.shout}"
- genl
- doxygen_comment { genl c.doc }
- struct(c.name.caps+"Exception", base) {
- genl "std::string getPrefix() const { return \"#{c.name}\"; }"
- genl "#{c.name.caps}Exception(const std::string& msg=std::string()) : #{base}(#{value}, \"\"+msg) {}"
- }
- end
-
- def declare_exceptions(class_name, domain_name, base)
- enum = @amqp.class_(class_name).domain(domain_name).enum
- enum.choices.each { |c| declare_exception(c, base, class_name, enum) unless c.name == "normal" }
- genl
- genl "sys::ExceptionHolder create#{base}(int code, const std::string& text);"
- end
-
- def create_exception(class_name, domain_name, base, invalid)
- scope("sys::ExceptionHolder create#{base}(int code, const std::string& text) {") {
- genl "sys::ExceptionHolder holder;"
- scope("switch (code) {") {
- enum = @amqp.class_(class_name).domain(domain_name).enum
- enum.choices.each { |c|
- assign = "holder = new #{c.name.caps}Exception(text); " unless c.name == "normal"
- genl "case #{c.value}: #{assign}break;"
- }
- genl "default: holder = new #{invalid}(QPID_MSG(\"Bad #{enum.parent.name}: \" << code << \": \" << text));"
- }
- genl "return holder;"
- }
- end
-
- def reply_exceptions_h()
- h_file("#{@dir}/reply_exceptions") {
- include "qpid/Exception"
- include "qpid/sys/ExceptionHolder"
- include "enum"
- namespace(@namespace) {
- declare_exceptions("execution", "error-code", "SessionException")
- declare_exceptions("connection", "close-code", "ConnectionException")
- declare_exceptions("session", "detach-code", "ChannelException")
- }
- }
- end
-
- def reply_exceptions_cpp()
- cpp_file("#{@dir}/reply_exceptions") {
- include "#{@dir}/reply_exceptions"
- include "<sstream>"
- include "<assert.h>"
- namespace("qpid::framing") {
- create_exception("execution", "error-code", "SessionException", "InvalidArgumentException")
- # FIXME aconway 2008-10-07: there are no good exception codes in 0-10 for an invalid code.
- # The following choices are arbitrary.
- create_exception("connection", "close-code", "ConnectionException", "FramingErrorException")
- create_exception("session", "detach-code", "ChannelException", "NotAttachedException")
- }
- }
- end
-
- def generate()
- constants_h
- enum_h
- reply_exceptions_h
- reply_exceptions_cpp
- typecode_h_cpp
- end
-end
-
-ConstantsGen.new($outdir, $amqp).generate();
-
diff --git a/M4-RCs/qpid/cpp/rubygen/framing.0-10/frame_body_lists.rb b/M4-RCs/qpid/cpp/rubygen/framing.0-10/frame_body_lists.rb
deleted file mode 100644
index 541fddbca2..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/framing.0-10/frame_body_lists.rb
+++ /dev/null
@@ -1,49 +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 .. in load path
-require 'cppgen'
-
-class FrameBodyListsGen < CppGen
-
- def initialize(outdir, amqp)
- super(outdir, amqp);
- end
-
- def generate
- h_file("qpid/framing/frame_body_lists.h") {
- gen <<EOS
-/**@file
- * Macro lists of frame body classes, used to generate Visitors
- */
-EOS
- gen "#define METHOD_BODIES() "
- @amqp.methods_.each { |m| gen "\\\n (#{m.body_name}) " }
- gen <<EOS
-
-
-#define OTHER_BODIES() (AMQContentBody)(AMQHeaderBody)(AMQHeartbeatBody))
-
-EOS
- }
- end
-end
-
-FrameBodyListsGen.new(ARGV[0], $amqp).generate;
-
-
diff --git a/M4-RCs/qpid/cpp/rubygen/framing.0-10/structs.rb b/M4-RCs/qpid/cpp/rubygen/framing.0-10/structs.rb
deleted file mode 100644
index eb935d06b4..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/framing.0-10/structs.rb
+++ /dev/null
@@ -1,611 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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.
-#
-# Usage: output_directory xml_spec_file [xml_spec_file...]
-#
-$: << '..'
-require 'cppgen'
-
-class StructGen < CppGen
-
- def initialize(outdir, amqp)
- super(outdir, amqp)
- end
-
- SizeMap={
- "Octet"=>1,
- "Short"=>2,
- "Long"=>4,
- "LongLong"=>8,
- "int8"=>1,
- "int16"=>2,
- "int32"=>4,
- "int64"=>8,
- "uint8"=>1,
- "uint16"=>2,
- "uint32"=>4,
- "uint64"=>8,
- "timestamp"=>8
- }
-
- StringSizeMap={
- "LongString"=>4,
- "MediumString"=>2,
- "ShortString"=>1
- }
-
- SizeType={
- 1=>"Octet",
- 2=>"Short",
- 4=>"Long",
- 8=>"LongLong"
- }
-
- ValueTypes=["uint8_t", "uint16_t", "uint32_t", "uint64_t"]
-
- def is_packed(s) s.pack and s.pack != "0" end
-
- def execution_header?(s)
- s.is_a? AmqpMethod and not s.parent.control?
- # s.kind_of? AmqpMethod and s.parent.name.include?("010") and not s.parent.control?
- end
-
- def has_bitfields_only(s)
- s.fields.select {|f| f.type_ != "bit"}.empty?
- end
-
- def default_initialisation(s)
- params = s.fields.select {|f| ValueTypes.include?(f.cpptype.name) || (!is_packed(s) && f.type_ == "bit")}
- strings = params.collect {|f| "#{f.cppname}(#{f.default_value})"}
- strings << "flags(0)" if (is_packed(s))
- if strings.empty?
- return ""
- else
- return " : " + strings.join(", ")
- end
- end
-
- def printable_form(f)
- if (f.cpptype.name == "uint8_t")
- return "(int) " + f.cppname
- elsif (f.type_ == "bit")
- return "get#{f.name.caps}()"
- else
- return f.cppname
- end
- end
-
- def flag_mask(s, i)
- pos = s.pack.to_i*8 - 8 - (i/8)*8 + (i % 8)
- return "(1 << #{pos})"
- end
-
- def encode_packed_struct(s)
- genl s.cpp_pack_type.encode('flags', 'buffer')
- process_packed_fields(s) { |f, i| encode_packed_field(s, f, i) unless f.type_ == "bit" }
- end
-
- def decode_packed_struct(s)
- genl "#{s.cpp_pack_type.decode('flags', 'buffer')}"
- process_packed_fields(s) { |f, i| decode_packed_field(s, f, i) unless f.type_ == "bit" }
- end
-
- def size_packed_struct(s)
- genl "total += #{s.pack};"
- process_packed_fields(s) { |f, i| size_packed_field(s, f, i) unless f.type_ == "bit" }
- end
-
- def print_packed_struct(s)
- process_packed_fields(s) { |f, i| print_packed_field(s, f, i) }
- end
-
- def encode_packed_field(s, f, i)
- genl "if (flags & #{flag_mask(s, i)})"
- indent { genl f.cpptype.encode(f.cppname,"buffer") }
- end
-
- def decode_packed_field(s, f, i)
- genl "if (flags & #{flag_mask(s, i)})"
- indent { genl f.cpptype.decode(f.cppname,"buffer") }
- end
-
- def size_packed_field(s, f, i)
- genl "if (flags & #{flag_mask(s, i)})"
- indent { generate_size(f, []) }
- end
-
- def print_packed_field(s, f, i)
- classname = s.cppname
- if (s.kind_of? AmqpMethod)
- classname = s.body_name
- end
- genl "if (flags & #{flag_mask(s, i)})"
- indent {
- unless (classname == "ConnectionStartOkBody" && f.name == "response")
- genl "out << \"#{f.name}=\" << #{printable_form(f)} << \"; \";"
- else
- genl "out << \"response=\" << \"xxxxxx\" << \"; \";"
- end
- }
- end
-
- def generate_encode(f, combined)
- if (f.type_ == "bit")
- genl "uint8_t #{f.cppname}_bits = #{f.cppname};"
- count = 0
- combined.each { |c| genl "#{f.cppname}_bits |= #{c.cppname} << #{count += 1};" }
- genl "buffer.putOctet(#{f.cppname}_bits);"
- else
- genl f.cpptype.encode(f.cppname,"buffer")
- end
- end
-
- def generate_decode(f, combined)
- if (f.type_ == "bit")
- genl "uint8_t #{f.cppname}_bits = buffer.getOctet();"
- genl "#{f.cppname} = 1 & #{f.cppname}_bits;"
- count = 0
- combined.each { |c| genl "#{c.cppname} = (1 << #{count += 1}) & #{f.cppname}_bits;" }
- else
- genl f.cpptype.decode(f.cppname,"buffer")
- end
- end
-
- def generate_size(f, combined)
- if (f.type_ == "bit")
- names = ([f] + combined).collect {|g| g.cppname}
- genl "total += 1;//#{names.join(", ")}"
- else
- size = SizeMap[f.cpptype.encoded]
- if (size)
- genl "total += #{size};//#{f.cppname}"
- elsif (f.cpptype.name == "SequenceNumberSet")
- genl "total += #{f.cppname}.encodedSize();"
- elsif (size = StringSizeMap[f.cpptype.encoded])
- genl "total += #{size} + #{f.cppname}.size();"
- else
- genl "total += #{f.cppname}.encodedSize();"
- end
- end
- end
-
- def process_packed_fields(s)
- s.fields.each { |f| yield f, s.fields.index(f) }
- end
-
- def process_fields(s)
- last = nil
- count = 0
- bits = []
- s.fields.each {
- |f| if (last and last.bit? and f.bit? and count < 7)
- count += 1
- bits << f
- else
- if (last and last.bit?)
- yield last, bits
- count = 0
- bits = []
- end
- if (not f.bit?)
- yield f
- end
- last = f
- end
- }
- if (last and last.bit?)
- yield last, bits
- end
- end
-
- def all_fields_via_accessors(s)
- s.fields.collect { |f| "get#{f.name.caps}()" }.join(", ")
- end
-
- def methodbody_extra_defs(s)
- if (s.parent.control?)
- genl "virtual uint8_t type() const { return 0;/*control segment*/ }"
- end
-
-
- gen <<EOS
- typedef #{s.result ? s.result.cpptype.name : 'void'} ResultType;
-
- template <class T> ResultType invoke(T& invocable) const {
- return invocable.#{s.cppname}(#{all_fields_via_accessors(s)});
- }
-
- using AMQMethodBody::accept;
- void accept(MethodBodyConstVisitor& v) const { v.visit(*this); }
-
- ClassId amqpClassId() const { return CLASS_ID; }
- MethodId amqpMethodId() const { return METHOD_ID; }
- bool isContentBearing() const { return #{s.content ? "true" : "false" }; }
- bool resultExpected() const { return #{s.result ? "true" : "false"}; }
- bool responseExpected() const { return #{s.responses().empty? ? "false" : "true"}; }
-EOS
- end
-
- def define_constructor(name, s)
- if (s.fields.size > 0)
- genl "#{name}("
- if (s.kind_of? AmqpMethod)
- indent {gen "ProtocolVersion, "}
- end
- indent { gen s.fields.collect { |f| "#{f.cpptype.param} _#{f.cppname}" }.join(",\n") }
- genl ") : "
- if (is_packed(s))
- initialisers = s.fields.select { |f| f.type_ != "bit"}.collect { |f| "#{f.cppname}(_#{f.cppname})"}
-
- initialisers << "flags(0)"
- indent { gen initialisers.join(",\n") }
- genl "{"
- indent {
- process_packed_fields(s) { |f, i| genl "set#{f.name.caps}(_#{f.cppname});" if f.type_ == "bit"}
- process_packed_fields(s) { |f, i| genl "flags |= #{flag_mask(s, i)};" unless f.type_ == "bit"}
- }
- genl "}"
- else
- indent { gen s.fields.collect { |f| " #{f.cppname}(_#{f.cppname})" }.join(",\n") }
- genl "{}"
- end
- end
- #default constructors:
- if (s.kind_of? AmqpMethod)
- genl "#{name}(ProtocolVersion=ProtocolVersion()) #{default_initialisation(s)} {}"
- end
- if (s.kind_of? AmqpStruct)
- genl "#{name}() #{default_initialisation(s)} {}"
- end
- end
-
- def define_packed_field_accessors(s, f, i)
- if (s.kind_of? AmqpMethod)
- define_packed_field_accessors_for_method(s, f, i)
- else
- define_packed_field_accessors_for_struct(s, f, i)
- end
- end
-
- def define_packed_field_accessors_for_struct(s, f, i)
- if (f.type_ == "bit")
- genl "void #{s.cppname}::set#{f.name.caps}(#{f.cpptype.param} _#{f.cppname}) {"
- indent {
- genl "if (_#{f.cppname}) flags |= #{flag_mask(s, i)};"
- genl "else flags &= ~#{flag_mask(s, i)};"
- }
- genl "}"
- genl "#{f.cpptype.ret} #{s.cppname}::get#{f.name.caps}() const { return flags & #{flag_mask(s, i)}; }"
- else
- genl "void #{s.cppname}::set#{f.name.caps}(#{f.cpptype.param} _#{f.cppname}) {"
- indent {
- genl "#{f.cppname} = _#{f.cppname};"
- genl "flags |= #{flag_mask(s, i)};"
- }
- genl "}"
- genl "#{f.cpptype.ret} #{s.cppname}::get#{f.name.caps}() const { return #{f.cppname}; }"
- if (f.cpptype.name == "FieldTable")
- genl "#{f.cpptype.name}& #{s.cppname}::get#{f.name.caps}() {"
- indent {
- genl "flags |= #{flag_mask(s, i)};"#treat the field table as having been 'set'
- genl "return #{f.cppname};"
- }
- genl "}"
- end
- genl "bool #{s.cppname}::has#{f.name.caps}() const { return flags & #{flag_mask(s, i)}; }"
- genl "void #{s.cppname}::clear#{f.name.caps}Flag() { flags &= ~#{flag_mask(s, i)}; }"
- end
- genl ""
- end
-
- def define_packed_field_accessors_for_method(s, f, i)
- if (f.type_ == "bit")
- genl "void #{s.body_name}::set#{f.name.caps}(#{f.cpptype.param} _#{f.cppname}) {"
- indent {
- genl "if (_#{f.cppname}) flags |= #{flag_mask(s, i)};"
- genl "else flags &= ~#{flag_mask(s, i)};"
- }
- genl "}"
- genl "#{f.cpptype.ret} #{s.body_name}::get#{f.name.caps}() const { return flags & #{flag_mask(s, i)}; }"
- else
- genl "void #{s.body_name}::set#{f.name.caps}(#{f.cpptype.param} _#{f.cppname}) {"
- indent {
- genl "#{f.cppname} = _#{f.cppname};"
- genl "flags |= #{flag_mask(s, i)};"
- }
- genl "}"
- genl "#{f.cpptype.ret} #{s.body_name}::get#{f.name.caps}() const { return #{f.cppname}; }"
- if (f.cpptype.name == "FieldTable")
- genl "#{f.cpptype.name}& #{s.body_name}::get#{f.name.caps}() {"
- indent {
- genl "flags |= #{flag_mask(s, i)};"#treat the field table as having been 'set'
- genl "return #{f.cppname};"
- }
- genl "}"
- end
- genl "bool #{s.body_name}::has#{f.name.caps}() const { return flags & #{flag_mask(s, i)}; }"
- genl "void #{s.body_name}::clear#{f.name.caps}Flag() { flags &= ~#{flag_mask(s, i)}; }"
- end
- genl ""
- end
-
- def define_packed_accessors(s)
- process_packed_fields(s) { |f, i| define_packed_field_accessors(s, f, i) }
- end
-
- def declare_packed_accessors(f)
- genl "void set#{f.name.caps}(#{f.cpptype.param} _#{f.cppname});";
- genl "#{f.cpptype.ret} get#{f.name.caps}() const;"
- if (f.cpptype.name == "FieldTable")
- genl "#{f.cpptype.name}& get#{f.name.caps}();"
- end
- if (f.type_ != "bit")
- #extra 'accessors' for packed fields:
- genl "bool has#{f.name.caps}() const;"
- genl "void clear#{f.name.caps}Flag();"
- end
- end
-
- def define_accessors(f)
- genl "void set#{f.name.caps}(#{f.cpptype.param} _#{f.cppname}) { #{f.cppname} = _#{f.cppname}; }"
- genl "#{f.cpptype.ret} get#{f.name.caps}() const { return #{f.cppname}; }"
- if (f.cpptype.name == "FieldTable")
- genl "#{f.cpptype.name}& get#{f.name.caps}() { return #{f.cppname}; }"
- end
- end
-
- def define_struct(s)
- classname = s.cppname
- inheritance = ""
- if (s.kind_of? AmqpMethod)
- classname = s.body_name
- if (execution_header?(s))
- inheritance = ": public ModelMethod"
- else
- inheritance = ": public AMQMethodBody"
- end
- end
-
- h_file("qpid/framing/#{classname}.h") {
- if (s.kind_of? AmqpMethod)
- gen <<EOS
-#include "qpid/framing/AMQMethodBody.h"
-#include "qpid/framing/AMQP_ServerOperations.h"
-#include "qpid/framing/MethodBodyConstVisitor.h"
-EOS
- end
- include "qpid/framing/ModelMethod.h" if (execution_header?(s))
-
- s.fields.each { |f| include "qpid/framing/#{f.cpptype.name}" if f.struct?}
-
- gen <<EOS
-
-#include <ostream>
-#include "qpid/framing/amqp_types_full.h"
-
-namespace qpid {
-namespace framing {
-
-class #{classname} #{inheritance} {
-EOS
- if (is_packed(s))
- indent { s.fields.each { |f| genl "#{f.cpptype.name} #{f.cppname};" unless f.type_ == "bit"} }
- indent {
- genl "#{s.cpp_pack_type.name} flags;"
- }
- else
- indent { s.fields.each { |f| genl "#{f.cpptype.name} #{f.cppname};" } }
- end
- genl "public:"
- if (s.kind_of? AmqpMethod)
- indent { genl "static const ClassId CLASS_ID = #{s.parent.code};" }
- indent { genl "static const MethodId METHOD_ID = #{s.code};" }
- end
-
- if (s.kind_of? AmqpStruct)
- if (s.code)
- indent { genl "static const uint16_t TYPE = #{s.full_code};" }
- end
- end
-
- indent {
- define_constructor(classname, s)
- genl ""
- if (is_packed(s))
- s.fields.each { |f| declare_packed_accessors(f) }
- else
- s.fields.each { |f| define_accessors(f) }
- end
- }
- if (s.kind_of? AmqpMethod)
- methodbody_extra_defs(s)
- end
- if (s.kind_of? AmqpStruct)
- indent {genl "friend std::ostream& operator<<(std::ostream&, const #{classname}&);" }
- end
-
- gen <<EOS
- void encode(Buffer&) const;
- void decode(Buffer&, uint32_t=0);
- void encodeStructBody(Buffer&) const;
- void decodeStructBody(Buffer&, uint32_t=0);
- uint32_t encodedSize() const;
- uint32_t bodySize() const;
- void print(std::ostream& out) const;
-}; /* class #{classname} */
-
-}}
-EOS
- }
- cpp_file("qpid/framing/#{classname}.cpp") {
- if (is_packed(s) || s.fields.size > 0 || execution_header?(s))
- buffer = "buffer"
- else
- buffer = "/*buffer*/"
- end
- gen <<EOS
-#include "#{classname}.h"
-
-#include "reply_exceptions.h"
-
-using namespace qpid::framing;
-
-EOS
-
- if (is_packed(s))
- define_packed_accessors(s)
- end
- gen <<EOS
-void #{classname}::encodeStructBody(Buffer& #{buffer}) const
-{
-EOS
- if (execution_header?(s))
- genl "encodeHeader(buffer);"
- end
-
- if (is_packed(s))
- indent {encode_packed_struct(s)}
- else
- indent { process_fields(s) { |f, combined| generate_encode(f, combined) } }
- end
- gen <<EOS
-}
-
-void #{classname}::encode(Buffer& buffer) const
-{
-EOS
- indent {
- if (s.kind_of? AmqpStruct)
- if (s.code)
- genl "buffer.put#{SizeType[s.size.to_i]}(bodySize() + 2/*typecode*/);" if s.size and s.size.to_i != 0
- genl "buffer.putShort(TYPE);"
- else
- genl "buffer.put#{SizeType[s.size.to_i]}(bodySize());" if s.size and s.size.to_i != 0
- end
- end
- genl "encodeStructBody(buffer);"
- }
- gen <<EOS
-}
-
-void #{classname}::decodeStructBody(Buffer& #{buffer}, uint32_t /*size*/)
-{
-EOS
- if (execution_header?(s))
- genl "decodeHeader(buffer);"
- end
-
- if (is_packed(s))
- indent {decode_packed_struct(s)}
- else
- indent { process_fields(s) { |f, combined| generate_decode(f, combined) } }
- end
- gen <<EOS
-}
-
-void #{classname}::decode(Buffer& buffer, uint32_t /*size*/)
-{
-EOS
- indent {
- if (s.kind_of? AmqpStruct)
- genl "buffer.get#{SizeType[s.size.to_i]}();" if s.size and s.size.to_i != 0
- genl "if (TYPE != buffer.getShort()) throw FramingErrorException(\"Bad type code for struct\");" if s.code
- end
- genl "decodeStructBody(buffer);"
- }
- gen <<EOS
-}
-
-uint32_t #{classname}::bodySize() const
-{
- uint32_t total = 0;
-EOS
- if (execution_header?(s))
- genl "total += headerSize();"
- end
-
- if (is_packed(s))
- indent {size_packed_struct(s)}
- else
- indent { process_fields(s) { |f, combined| generate_size(f, combined) } }
- end
- gen <<EOS
- return total;
-}
-
-uint32_t #{classname}::encodedSize() const {
- uint32_t total = bodySize();
-EOS
- if (s.kind_of? AmqpStruct)
- genl "total += #{s.size}/*size field*/;" if s.size
- genl "total += 2/*typecode*/;" if s.code
- end
- gen <<EOS
- return total;
-}
-
-void #{classname}::print(std::ostream& out) const
-{
- out << "{#{classname}: ";
-EOS
- if (is_packed(s))
- indent {print_packed_struct(s)}
- else
- copy = Array.new(s.fields)
- f = copy.shift
-
- indent {
- genl "out << \"#{f.name}=\" << #{printable_form(f)};" if f
- copy.each { |f| genl "out << \"; #{f.name}=\" << #{printable_form(f)};" }
- }
- end
- gen <<EOS
- out << "}";
-}
-EOS
-
- if (s.kind_of? AmqpStruct)
- gen <<EOS
-namespace qpid{
-namespace framing{
-
- std::ostream& operator<<(std::ostream& out, const #{classname}& s)
- {
- s.print(out);
- return out;
- }
-
-}
-}
-EOS
- end
-}
- end
-
- def generate()
- structs = @amqp.collect_all(AmqpStruct).select { |s| not ["command-fragment"].include?(s.name) }
- structs.each { |s| define_struct(s) }
- @amqp.methods_.each { |m| define_struct(m) }
- #generate a single include file containing the list of structs for convenience
- h_file("qpid/framing/amqp_structs.h") { structs.each { |s| genl "#include \"#{s.cppname}.h\"" } }
- end
-end
-
-StructGen.new(ARGV[0], $amqp).generate()
-
diff --git a/M4-RCs/qpid/cpp/rubygen/generate b/M4-RCs/qpid/cpp/rubygen/generate
deleted file mode 100755
index 836626cd7a..0000000000
--- a/M4-RCs/qpid/cpp/rubygen/generate
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/env ruby
-#
-# 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.
-#
-require 'pathname'
-require 'amqpgen'
-
-#
-# Run a set of code generation templates.
-#
-if ARGV.size < 3
- puts <<EOS
-Usage: #{ARGV[0]} OUTDIR SPEC.xml [ ... ] TEMPLATE.rb [ ... ]
-or: #{ARGV[0]} OUTDIR SPEC.xml [ ... ] all [ makefragment.mk ]
-
-Parse all SPEC.xml files to create an AMQP model, run each TEMPLATE
-putting the resulting files under OUTDIR. Prints a list of files
-generated to standard output.
-
-If OUTDIR is '-' then just prints file list without generating files.
-EOS
- exit 1
-end
-
-# Create array of specs by version
-def parse_specs(files)
- lists=Hash.new { |h,k| h[k]=[] }
- files.each { |f|
- spec=AmqpRoot.new(File.new(f))
- lists[spec.version] << spec
- }
- specs={}
- lists.each_pair { |k,l|
- specs[k] = l.size==1 ? l.first : AmqpRoot.new(*l.map { |s| s.xml})
- }
- return specs
-end
-
-gendir=File.dirname(__FILE__)
-
-# Run selected templates
-if ARGV.any? { |arg| arg=="all" }
- templates=Dir["#{gendir}/*/*.rb"]
-else
- templates=ARGV.grep(/\.rb$/)
- ARGV.each { |arg|
- d=File.join gendir,arg
- templates += Dir["#{d}/*.rb"] if File.directory? d
- }
-end
-
-$outdir=ARGV[0]
-$models=parse_specs(ARGV.grep(/\.xml$/))
-templates.each { |t|
- ver=Pathname.new(t).dirname.basename.to_s.split('.')[-1]
- $amqp=$models[ver]
- if $amqp
- load t
- else
- puts "Warning: skipping #{t}, no spec file for version #{ver}."
- end
-}
-
-def make_continue(lines) lines.join(" \\\n "); end
-
-# Generate makefile
-makefile=ARGV.grep(/.mk$/)[0]
-if makefile
- dir=Dir.getwd
- Dir.chdir File.dirname(__FILE__)
- generator_files=Dir["**/*.rb"] << File.basename(__FILE__)
- Dir.chdir dir
- rgen_generator=generator_files.map{ |f| "$(rgen_dir)/#{f}" }
- rgen_srcs=GenFiles.get.map{ |f| "#{$outdir}/#{f}" }
- rgen_subdirs={}
- rgen_srcs.each { |src|
- if src.match(%r{#{$outdir}/qpid/([^/]+)/})
- subdir=$1
- rgen_subdirs[subdir] ||= []
- rgen_subdirs[subdir] << src
- end
- }
- File.open(makefile, 'w') { |out|
- out << <<EOS
-# Generated makefile fragment.
-# Including makefile defines $(rgen_dir) $(rgen_cmd) and $(specs).
-
-rgen_generator=#{make_continue rgen_generator}
-EOS
- rgen_subdirs.each_key { |subdir|
- out << "\nrgen_#{subdir}_srcs = #{make_continue(rgen_subdirs[subdir])}\n"
- }
- out << <<EOS
-rgen_srcs=#{make_continue rgen_srcs}
-
-# Header file install rules.
-EOS
- ["amqp_0_10", "framing", "client/no_keyword","client", "broker"].each { |ns|
- dir="qpid/#{ns}"
- dir_ = dir.tr("/", "_")
- regex=%r|#{dir}/[^/]+\.h$|
- out << <<EOS
-#{dir_}dir = $(includedir)/#{dir}
-dist_#{dir_}_HEADERS = #{make_continue rgen_srcs.grep(regex)}
-
-EOS
- }
- }
-end
-
diff --git a/M4-RCs/qpid/cpp/src/Makefile.am b/M4-RCs/qpid/cpp/src/Makefile.am
deleted file mode 100644
index 114de01d44..0000000000
--- a/M4-RCs/qpid/cpp/src/Makefile.am
+++ /dev/null
@@ -1,715 +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.
-#
-
-SUBDIRS = . tests
-
-# The Windows-only sources are not compiled using this Makefile, but
-# are listed here to ensure they're included in releases. They are built
-# using Visual Studio solutions/projects.
-windows_dist = \
- qpid.sln \
- broker.vcproj \
- common.vcproj \
- client.vcproj \
- MaxMethodBodySize.vcproj \
- qmfconsole.vcproj \
- protocol_gen.mak \
- qpid/log/windows/SinkOptions.cpp \
- qpid/log/windows/SinkOptions.h \
- qpid/sys/windows/check.h \
- qpid/sys/windows/AsynchIO.cpp \
- qpid/sys/windows/AsynchIoResult.h \
- qpid/sys/windows/Condition.h \
- qpid/sys/windows/FileSysDir.cpp \
- qpid/sys/windows/IntegerTypes.h \
- qpid/sys/windows/IocpDispatcher.cpp \
- qpid/sys/windows/IocpPoller.cpp \
- qpid/sys/windows/IOHandle.cpp \
- qpid/sys/windows/IoHandlePrivate.h \
- qpid/sys/windows/LockFile.cpp \
- qpid/sys/windows/Mutex.h \
- qpid/sys/windows/Shlib.cpp \
- qpid/sys/windows/Socket.cpp \
- qpid/sys/windows/StrError.cpp \
- qpid/sys/windows/SystemInfo.cpp \
- qpid/sys/windows/Thread.cpp \
- qpid/sys/windows/Time.cpp \
- qpid/sys/windows/Time.h \
- qpid/sys/windows/uuid.cpp \
- qpid/sys/windows/uuid.h \
- windows/QpiddBroker.cpp \
- qpid/broker/windows/BrokerDefaults.cpp \
- qpid/broker/windows/SaslAuthenticator.cpp
-
-EXTRA_DIST= $(platform_dist) $(rgen_srcs) $(windows_dist)
-
-## Generated code
-
-# Note: generated soure and makefiles included in distribution so a
-# distribution can be built without code generation tools and XML
-# sources.
-
-# This phony target is needed by generated makefile fragments:
-force:
-
-if GENERATE
-
-# AMQP_FINAL_XML is defined in ../configure.ac
-amqp_0_10_xml=@AMQP_FINAL_XML@
-specs=$(amqp_0_10_xml) $(top_srcdir)/xml/cluster.xml
-
-# Ruby generator.
-rgen_dir=$(top_srcdir)/rubygen
-rgen_cmd=ruby -I $(rgen_dir) $(rgen_dir)/generate gen $(specs) all $(srcdir)/rubygen.mk
-
-$(rgen_srcs) $(srcdir)/rubygen.mk: rgen.timestamp
-rgen.timestamp: $(rgen_generator) $(specs)
- $(rgen_cmd); touch $@
-$(rgen_generator):
-
-# Management generator.
-mgen_dir=$(top_srcdir)/managementgen
-mgen_cmd=$(mgen_dir)/qmf-gen -m $(srcdir)/managementgen.mk -q -o gen/qmf \
- $(top_srcdir)/../specs/management-schema.xml \
- $(srcdir)/qpid/acl/management-schema.xml \
- $(srcdir)/qpid/cluster/management-schema.xml
-
-$(srcdir)/managementgen.mk $(mgen_broker_cpp) $(dist_qpid_management_HEADERS): mgen.timestamp
-mgen.timestamp: $(mgen_generator)
- $(mgen_cmd); touch $@
-$(mgen_generator):
-
-endif # GENERATE
-
-include $(srcdir)/rubygen.mk
-include $(srcdir)/managementgen.mk
-
-# Code generated by C++
-noinst_PROGRAMS=generate_MaxMethodBodySize_h
-generate_MaxMethodBodySize_h_SOURCES=gen/generate_MaxMethodBodySize_h.cpp
-qpid/framing/MaxMethodBodySize.h: generate_MaxMethodBodySize_h
- ./generate_MaxMethodBodySize_h
-BUILT_SOURCES=qpid/framing/MaxMethodBodySize.h
-DISTCLEANFILES=qpid/framing/MaxMethodBodySize.h
-
-## Compiler flags
-AM_CXXFLAGS = $(WARNING_CFLAGS)
-AM_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO_ARG)
-INCLUDES = -Igen -I$(srcdir)/gen
-
-## Automake macros to build libraries and executables.
-qpidd_CXXFLAGS = $(AM_CXXFLAGS) -DMODULE_DIR=\"$(dmoduledir)\" -DCONF_FILE=\"$(sysconfdir)/qpidd.conf\"
-libqpidclient_la_CXXFLAGS = $(AM_CXXFLAGS) -DMODULE_DIR=\"$(cmoduledir)\" -DCONF_FILE=\"$(confdir)/qpidc.conf\"
-
-qpidd_LDADD = \
- libqpidbroker.la \
- libqpidcommon.la
-
-posix_qpidd_src = posix/QpiddBroker.cpp
-
-sbin_PROGRAMS = qpidd
-qpidd_SOURCES = qpidd.cpp qpidd.h $(posix_qpidd_src)
-
-posix_plat_src = \
- qpid/log/posix/SinkOptions.cpp \
- qpid/sys/posix/IOHandle.cpp \
- qpid/sys/posix/Socket.cpp \
- qpid/sys/posix/AsynchIO.cpp \
- qpid/sys/posix/FileSysDir.cpp \
- qpid/sys/posix/LockFile.cpp \
- qpid/sys/posix/Time.cpp \
- qpid/sys/posix/Thread.cpp \
- qpid/sys/posix/Shlib.cpp \
- qpid/sys/posix/SystemInfo.cpp \
- qpid/sys/posix/Mutex.cpp \
- qpid/sys/posix/Fork.cpp \
- qpid/sys/posix/StrError.cpp \
- qpid/sys/posix/PollableCondition.cpp
-
-posix_plat_hdr = \
- qpid/log/posix/SinkOptions.h \
- qpid/sys/posix/check.h \
- qpid/sys/posix/Condition.h \
- qpid/sys/posix/PrivatePosix.h \
- qpid/sys/posix/Mutex.h \
- qpid/sys/posix/Fork.h \
- qpid/sys/posix/PollableCondition.h \
- qpid/sys/posix/IntegerTypes.h \
- qpid/sys/posix/Time.h
-
-if HAVE_EPOLL
- poller = qpid/sys/epoll/EpollPoller.cpp
-endif
-
-if HAVE_ECF
- poller = qpid/sys/solaris/ECFPoller.cpp
-endif
-
-platform_src = $(posix_plat_src) $(poller)
-platform_hdr = $(posix_plat_hdr)
-
-posix_broker_src = \
- qpid/broker/posix/BrokerDefaults.cpp
-
-lib_LTLIBRARIES = libqpidcommon.la libqpidbroker.la libqpidclient.la
-
-# Definitions for client and daemon plugins
-PLUGINLDFLAGS=-no-undefined -module -avoid-version
-confdir=$(sysconfdir)/qpid
-dmoduledir=$(libdir)/qpid/daemon
-cmoduledir=$(libdir)/qpid/client
-dmodule_LTLIBRARIES =
-cmodule_LTLIBRARIES =
-
-include cluster.mk
-include acl.mk
-include qmf.mk
-include qmfc.mk
-if HAVE_XML
-include xml.mk
-endif
-
-if RDMA
-
-# RDMA (Infiniband) protocol code
-librdmawrap_la_SOURCES = \
- qpid/sys/rdma/rdma_exception.h \
- qpid/sys/rdma/rdma_factories.cpp \
- qpid/sys/rdma/rdma_factories.h \
- qpid/sys/rdma/RdmaIO.cpp \
- qpid/sys/rdma/RdmaIO.h \
- qpid/sys/rdma/rdma_wrap.cpp \
- qpid/sys/rdma/rdma_wrap.h
-librdmawrap_la_LIBADD = \
- libqpidcommon.la \
- -lrdmacm \
- -libverbs
-librdmawrap_la_CXXFLAGS = \
- $(AM_CXXFLAGS) -Wno-missing-field-initializers
-lib_LTLIBRARIES += \
- librdmawrap.la
-librdmawrap_la_LDFLAGS = \
- -no-undefined
-
-rdma_la_SOURCES = \
- qpid/sys/RdmaIOPlugin.cpp
-rdma_la_LIBADD = \
- libqpidbroker.la \
- librdmawrap.la
-rdma_la_LDFLAGS = $(PLUGINLDFLAGS)
-rdma_la_CXXFLAGS = \
- $(AM_CXXFLAGS) -Wno-missing-field-initializers
-dmodule_LTLIBRARIES += \
- rdma.la
-
-rdmaconnector_la_SOURCES = \
- qpid/client/RdmaConnector.cpp
-rdmaconnector_la_LIBADD = \
- libqpidclient.la \
- librdmawrap.la
-rdmaconnector_la_LDFLAGS = $(PLUGINLDFLAGS)
-rdmaconnector_la_CXXFLAGS = \
- $(AM_CXXFLAGS) -Wno-missing-field-initializers
-cmodule_LTLIBRARIES += \
- rdmaconnector.la
-
-# RDMA test/sample programs
-noinst_PROGRAMS += RdmaServer RdmaClient
-RdmaServer_SOURCES = qpid/sys/rdma/RdmaServer.cpp
-RdmaServer_LDADD = \
- librdmawrap.la libqpidcommon.la
-RdmaClient_SOURCES = qpid/sys/rdma/RdmaClient.cpp
-RdmaClient_CXXFLAGS = \
- $(AM_CXXFLAGS) -Wno-missing-field-initializers
-RdmaClient_LDADD = \
- librdmawrap.la libqpidcommon.la
-
-endif
-
-if SSL
-include ssl.mk
-endif
-
-# New 0-10 codec, to be integrated in future.
-# libqpidamqp_0_10_la_SOURCES=
-EXTRA_DIST +=\
- $(rgen_amqp_0_10_srcs) \
- qpid/amqp_0_10/apply.h \
- qpid/amqp_0_10/built_in_types.h \
- qpid/amqp_0_10/complex_types.cpp \
- qpid/amqp_0_10/Array.h \
- qpid/amqp_0_10/Array.cpp \
- qpid/amqp_0_10/Body.h \
- qpid/amqp_0_10/Command.h \
- qpid/amqp_0_10/CommmandPacker.h \
- qpid/amqp_0_10/Control.h \
- qpid/amqp_0_10/Header.h \
- qpid/amqp_0_10/Header.cpp \
- qpid/amqp_0_10/FrameHeader.h \
- qpid/amqp_0_10/FrameHeader.cpp \
- qpid/amqp_0_10/Holder.h \
- qpid/amqp_0_10/Codec.h \
- qpid/amqp_0_10/Packer.h \
- qpid/amqp_0_10/Decimal.h \
- qpid/amqp_0_10/SerializableString.h \
- qpid/amqp_0_10/Map.h \
- qpid/amqp_0_10/Map.cpp \
- qpid/amqp_0_10/Struct.h \
- qpid/amqp_0_10/Struct32.h \
- qpid/amqp_0_10/Struct32.cpp \
- qpid/amqp_0_10/Unit.h \
- qpid/amqp_0_10/Unit.cpp \
- qpid/amqp_0_10/UnitHandler.h \
- qpid/amqp_0_10/UnknownType.h \
- qpid/amqp_0_10/UnknownType.cpp \
- qpid/amqp_0_10/UnknownStruct.h \
- qpid/amqp_0_10/UnknownStruct.cpp
-
-libqpidcommon_la_LIBADD = \
- -lboost_program_options \
- -lboost_filesystem \
- -luuid \
- $(LIB_DLOPEN) \
- $(LIB_CLOCK_GETTIME)
-
-libqpidcommon_la_SOURCES = \
- $(rgen_framing_srcs) \
- $(platform_src) \
- qpid/assert.cpp qpid/assert.h \
- qpid/pointer_to_other.h \
- qpid/Address.cpp \
- qpid/DataDir.cpp \
- qpid/Exception.cpp \
- qpid/Modules.cpp \
- qpid/Options.cpp \
- qpid/Plugin.cpp \
- qpid/RefCountedBuffer.h \
- qpid/RefCountedBuffer.cpp \
- qpid/Serializer.h \
- qpid/SessionState.h \
- qpid/SessionState.cpp \
- qpid/SessionId.cpp \
- qpid/StringUtils.cpp \
- qpid/Url.cpp \
- qpid/amqp_0_10/SessionHandler.h \
- qpid/amqp_0_10/SessionHandler.cpp \
- qpid/framing/AccumulatedAck.cpp \
- qpid/framing/AMQBody.cpp \
- qpid/framing/AMQMethodBody.cpp \
- qpid/framing/AMQContentBody.cpp \
- qpid/framing/AMQFrame.cpp \
- qpid/framing/AMQHeaderBody.cpp \
- qpid/framing/AMQHeartbeatBody.cpp \
- qpid/framing/Array.cpp \
- qpid/framing/BodyHolder.cpp \
- qpid/framing/BodyHandler.cpp \
- qpid/framing/Buffer.cpp \
- qpid/framing/Endian.cpp \
- qpid/framing/FieldTable.cpp \
- qpid/framing/FieldValue.cpp \
- qpid/framing/FrameSet.cpp \
- qpid/framing/FrameDecoder.cpp \
- qpid/framing/ProtocolInitiation.cpp \
- qpid/framing/ProtocolVersion.cpp \
- qpid/framing/SendContent.cpp \
- qpid/framing/SequenceNumber.cpp \
- qpid/framing/SequenceNumberSet.cpp \
- qpid/framing/SequenceSet.cpp \
- qpid/framing/Proxy.cpp \
- qpid/framing/Uuid.cpp \
- qpid/framing/AMQP_HighestVersion.h \
- qpid/framing/Blob.cpp \
- qpid/framing/MaxMethodBodySize.h \
- qpid/framing/TransferContent.cpp \
- qpid/log/Logger.cpp \
- qpid/log/Options.cpp \
- qpid/log/OstreamOutput.cpp \
- qpid/log/Selector.cpp \
- qpid/log/Statement.cpp \
- qpid/management/Manageable.cpp \
- qpid/management/ManagementObject.cpp \
- qpid/sys/AggregateOutput.cpp \
- qpid/sys/AsynchIOHandler.cpp \
- qpid/sys/Dispatcher.cpp \
- qpid/sys/DispatchHandle.cpp \
- qpid/sys/PollableCondition.h \
- qpid/sys/PollableQueue.h \
- qpid/sys/Runnable.cpp \
- qpid/sys/Shlib.cpp
-
-libqpidbroker_la_LIBADD = libqpidcommon.la -luuid
-if HAVE_SASL
-libqpidbroker_la_LIBADD += -lsasl2
-endif
-
-libqpidbroker_la_SOURCES = \
- $(mgen_broker_cpp) \
- $(posix_broker_src) \
- qpid/amqp_0_10/Connection.h \
- qpid/amqp_0_10/Connection.cpp \
- qpid/broker/Broker.cpp \
- qpid/broker/BrokerSingleton.cpp \
- qpid/broker/Exchange.cpp \
- qpid/broker/Queue.cpp \
- qpid/broker/QueueCleaner.cpp \
- qpid/broker/QueueListeners.cpp \
- qpid/broker/PersistableMessage.cpp \
- qpid/broker/Bridge.cpp \
- qpid/broker/Connection.cpp \
- qpid/broker/ConnectionHandler.cpp \
- qpid/broker/ConnectionFactory.cpp \
- qpid/broker/Daemon.cpp \
- qpid/broker/DeliverableMessage.cpp \
- qpid/broker/DeliveryRecord.cpp \
- qpid/broker/DirectExchange.cpp \
- qpid/broker/DtxAck.cpp \
- qpid/broker/DtxBuffer.cpp \
- qpid/broker/DtxManager.cpp \
- qpid/broker/DtxTimeout.cpp \
- qpid/broker/DtxWorkRecord.cpp \
- qpid/broker/ExchangeRegistry.cpp \
- qpid/broker/FanOutExchange.cpp \
- qpid/broker/HeadersExchange.cpp \
- qpid/broker/IncompleteMessageList.cpp \
- qpid/broker/Link.cpp \
- qpid/broker/LinkRegistry.cpp \
- qpid/broker/Message.cpp \
- qpid/broker/MessageAdapter.cpp \
- qpid/broker/MessageBuilder.cpp \
- qpid/broker/MessageStoreModule.cpp \
- qpid/broker/NameGenerator.cpp \
- qpid/broker/NullMessageStore.cpp \
- qpid/broker/QueueBindings.cpp \
- qpid/broker/QueuePolicy.cpp \
- qpid/broker/QueueRegistry.cpp \
- qpid/broker/RateTracker.cpp \
- qpid/broker/RecoveryManagerImpl.cpp \
- qpid/broker/RecoveredEnqueue.cpp \
- qpid/broker/RecoveredDequeue.cpp \
- qpid/broker/SaslAuthenticator.cpp \
- qpid/broker/SemanticState.h \
- qpid/broker/SemanticState.cpp \
- qpid/broker/SessionAdapter.cpp \
- qpid/broker/SessionState.h \
- qpid/broker/SessionState.cpp \
- qpid/broker/SessionManager.h \
- qpid/broker/SessionManager.cpp \
- qpid/broker/SessionContext.h \
- qpid/broker/SessionHandler.h \
- qpid/broker/SessionHandler.cpp \
- qpid/broker/SignalHandler.h \
- qpid/broker/SignalHandler.cpp \
- qpid/broker/System.cpp \
- qpid/broker/Timer.cpp \
- qpid/broker/TopicExchange.cpp \
- qpid/broker/TxAccept.cpp \
- qpid/broker/TxBuffer.cpp \
- qpid/broker/TxPublish.cpp \
- qpid/broker/Vhost.cpp \
- qpid/management/ManagementBroker.cpp \
- qpid/management/ManagementExchange.cpp \
- qpid/sys/TCPIOPlugin.cpp
-
-libqpidclient_la_LIBADD = libqpidcommon.la -luuid
-
-libqpidclient_la_SOURCES = \
- $(rgen_client_srcs) \
- qpid/client/Bounds.cpp \
- qpid/client/Connection.cpp \
- qpid/client/ConnectionHandler.cpp \
- qpid/client/ConnectionImpl.cpp \
- qpid/client/ConnectionSettings.cpp \
- qpid/client/Connector.cpp \
- qpid/client/Demux.cpp \
- qpid/client/Dispatcher.cpp \
- qpid/client/FailoverManager.cpp \
- qpid/client/FailoverListener.h \
- qpid/client/FailoverListener.cpp \
- qpid/client/Future.cpp \
- qpid/client/FutureCompletion.cpp \
- qpid/client/FutureResult.cpp \
- qpid/client/HandlePrivate.h \
- qpid/client/LoadPlugins.cpp \
- qpid/client/LocalQueue.cpp \
- qpid/client/Message.cpp \
- qpid/client/MessageListener.cpp \
- qpid/client/MessageReplayTracker.cpp \
- qpid/client/QueueOptions.cpp \
- qpid/client/Results.cpp \
- qpid/client/SessionBase_0_10.cpp \
- qpid/client/SessionBase_0_10.h \
- qpid/client/SessionBase_0_10Access.h \
- qpid/client/ConnectionAccess.h \
- qpid/client/SessionImpl.cpp \
- qpid/client/StateManager.cpp \
- qpid/client/Subscription.cpp \
- qpid/client/SubscriptionImpl.cpp \
- qpid/client/SubscriptionManager.cpp
-
-nobase_include_HEADERS = \
- $(platform_hdr) \
- qpid/amqp_0_10/apply.h \
- qpid/assert.h \
- qpid/Address.h \
- qpid/DataDir.h \
- qpid/Exception.h \
- qpid/sys/ExceptionHolder.h \
- qpid/amqp_0_10/Exception.h \
- qpid/Modules.h \
- qpid/Msg.h \
- qpid/Options.h \
- qpid/Plugin.h \
- qpid/ptr_map.h \
- qpid/RangeSet.h \
- qpid/RefCounted.h \
- qpid/SessionId.h \
- qpid/SessionState.h \
- qpid/SharedObject.h \
- qpid/StringUtils.h \
- qpid/Url.h \
- qpid/InlineVector.h \
- qpid/InlineAllocator.h \
- qpid/memory.h \
- qpid/shared_ptr.h \
- qpid/Version.h \
- qpid/agent/ManagementAgent.h \
- qpid/agent/ManagementAgentImpl.h \
- qpid/broker/Broker.h \
- qpid/broker/AclModule.h \
- qpid/broker/SessionAdapter.h \
- qpid/broker/Exchange.h \
- qpid/broker/Queue.h \
- qpid/broker/QueueListeners.h \
- qpid/broker/QueueCleaner.h \
- qpid/broker/BrokerSingleton.h \
- qpid/broker/Bridge.h \
- qpid/broker/Connection.h \
- qpid/broker/ConnectionState.h \
- qpid/broker/ConnectionFactory.h \
- qpid/broker/ConnectionHandler.h \
- qpid/broker/ConnectionToken.h \
- qpid/broker/OwnershipToken.h \
- qpid/broker/Consumer.h \
- qpid/broker/Daemon.h \
- qpid/broker/Deliverable.h \
- qpid/broker/DeliverableMessage.h \
- qpid/broker/DeliveryAdapter.h \
- qpid/broker/DeliveryId.h \
- qpid/broker/DeliveryRecord.h \
- qpid/broker/DirectExchange.h \
- qpid/broker/DtxAck.h \
- qpid/broker/DtxBuffer.h \
- qpid/broker/DtxManager.h \
- qpid/broker/DtxTimeout.h \
- qpid/broker/DtxWorkRecord.h \
- qpid/broker/ExchangeRegistry.h \
- qpid/broker/FanOutExchange.h \
- qpid/broker/HandlerImpl.h \
- qpid/broker/HeadersExchange.h \
- qpid/broker/IncompleteMessageList.h \
- qpid/broker/Link.h \
- qpid/broker/LinkRegistry.h \
- qpid/broker/Message.h \
- qpid/broker/MessageAdapter.h \
- qpid/broker/MessageBuilder.h \
- qpid/broker/MessageStore.h \
- qpid/broker/MessageStoreModule.h \
- qpid/broker/NameGenerator.h \
- qpid/broker/NullMessageStore.h \
- qpid/broker/Persistable.h \
- qpid/broker/PersistableConfig.h \
- qpid/broker/PersistableExchange.h \
- qpid/broker/PersistableMessage.h \
- qpid/broker/PersistableQueue.h \
- qpid/broker/QueueBindings.h \
- qpid/broker/QueuedMessage.h \
- qpid/broker/QueuePolicy.h \
- qpid/broker/QueueRegistry.h \
- qpid/broker/RateTracker.h \
- qpid/broker/RecoverableConfig.h \
- qpid/broker/RecoverableExchange.h \
- qpid/broker/RecoverableMessage.h \
- qpid/broker/RecoverableQueue.h \
- qpid/broker/RecoverableTransaction.h \
- qpid/broker/RecoveredDequeue.h \
- qpid/broker/RecoveredEnqueue.h \
- qpid/broker/RecoveryManager.h \
- qpid/broker/RecoveryManagerImpl.h \
- qpid/broker/SaslAuthenticator.h \
- qpid/broker/SessionAdapter.h \
- qpid/broker/SessionManager.h \
- qpid/broker/System.h \
- qpid/broker/Timer.h \
- qpid/broker/TopicExchange.h \
- qpid/broker/TransactionalStore.h \
- qpid/broker/TxAccept.h \
- qpid/broker/TxBuffer.h \
- qpid/broker/TxOp.h \
- qpid/broker/TxOpVisitor.h \
- qpid/broker/TxPublish.h \
- qpid/broker/Vhost.h \
- qpid/client/AckMode.h \
- qpid/client/Bounds.h \
- qpid/client/ChainableFrameHandler.h \
- qpid/client/Completion.h \
- qpid/client/Connection.h \
- qpid/client/ConnectionHandler.h \
- qpid/client/ConnectionImpl.h \
- qpid/client/ConnectionSettings.h \
- qpid/client/Connector.h \
- qpid/client/Demux.h \
- qpid/client/Dispatcher.h \
- qpid/client/Execution.h \
- qpid/client/FailoverManager.h \
- qpid/client/Subscription.h \
- qpid/client/SubscriptionImpl.h \
- qpid/client/SubscriptionSettings.h \
- qpid/client/FlowControl.h \
- qpid/client/Future.h \
- qpid/client/FutureCompletion.h \
- qpid/client/FutureResult.h \
- qpid/client/Handle.h \
- qpid/client/LocalQueue.h \
- qpid/client/QueueOptions.h \
- qpid/client/Message.h \
- qpid/client/MessageListener.h \
- qpid/client/MessageReplayTracker.h \
- qpid/client/Results.h \
- qpid/client/SessionBase_0_10.h \
- qpid/client/Session.h \
- qpid/client/SessionImpl.h \
- qpid/client/AsyncSession.h \
- qpid/client/StateManager.h \
- qpid/client/SubscriptionManager.h \
- qpid/client/TypedResult.h \
- qpid/framing/AMQBody.h \
- qpid/framing/AMQCommandControlBody.h \
- qpid/framing/AMQContentBody.h \
- qpid/framing/AMQDataBlock.h \
- qpid/framing/AMQFrame.h \
- qpid/framing/AMQHeaderBody.h \
- qpid/framing/AMQHeartbeatBody.h \
- qpid/framing/AMQMethodBody.h \
- qpid/framing/AMQP_HighestVersion.h \
- qpid/framing/AccumulatedAck.h \
- qpid/framing/Array.h \
- qpid/framing/Blob.h \
- qpid/framing/BodyHandler.h \
- qpid/framing/BodyHolder.h \
- qpid/framing/Buffer.h \
- qpid/framing/ChannelHandler.h \
- qpid/framing/Endian.h \
- qpid/framing/FieldTable.h \
- qpid/framing/FieldValue.h \
- qpid/framing/FrameDefaultVisitor.h \
- qpid/framing/FrameDecoder.h \
- qpid/framing/FrameHandler.h \
- qpid/framing/FrameSet.h \
- qpid/framing/Handler.h \
- qpid/framing/HeaderProperties.h \
- qpid/framing/Invoker.h \
- qpid/framing/InputHandler.h \
- qpid/framing/InitiationHandler.h \
- qpid/framing/MethodContent.h \
- qpid/framing/MaxMethodBodySize.h \
- qpid/framing/ModelMethod.h \
- qpid/framing/OutputHandler.h \
- qpid/framing/ProtocolInitiation.h \
- qpid/framing/ProtocolVersion.h \
- qpid/framing/Proxy.h \
- qpid/framing/SendContent.h \
- qpid/framing/SequenceNumber.h \
- qpid/framing/SequenceSet.h \
- qpid/framing/SequenceNumberSet.h \
- qpid/framing/StructHelper.h \
- qpid/framing/TransferContent.h \
- qpid/framing/TypeFilter.h \
- qpid/framing/Uuid.h \
- qpid/framing/Visitor.h \
- qpid/framing/amqp_framing.h \
- qpid/framing/amqp_types.h \
- qpid/framing/amqp_types_full.h \
- qpid/framing/frame_functors.h \
- qpid/framing/variant.h \
- qpid/log/Helpers.h \
- qpid/log/Options.h \
- qpid/log/Logger.h \
- qpid/log/OstreamOutput.h \
- qpid/log/Selector.h \
- qpid/log/SinkOptions.h \
- qpid/log/Statement.h \
- qpid/management/Args.h \
- qpid/management/Manageable.h \
- qpid/management/ManagementBroker.h \
- qpid/management/ManagementEvent.h \
- qpid/management/ManagementExchange.h \
- qpid/management/ManagementObject.h \
- qpid/sys/AggregateOutput.h \
- qpid/sys/AsynchIO.h \
- qpid/sys/AsynchIOHandler.h \
- qpid/sys/AtomicCount.h \
- qpid/sys/AtomicValue.h \
- qpid/sys/AtomicValue_gcc.h \
- qpid/sys/AtomicValue_mutex.h \
- qpid/sys/BlockingQueue.h \
- qpid/sys/CopyOnWriteArray.h \
- qpid/sys/Condition.h \
- qpid/sys/ConnectionCodec.h \
- qpid/sys/ConnectionInputHandler.h \
- qpid/sys/ConnectionInputHandlerFactory.h \
- qpid/sys/ConnectionOutputHandler.h \
- qpid/sys/ConnectionOutputHandlerPtr.h \
- qpid/sys/DeletionManager.h \
- qpid/sys/Dispatcher.h \
- qpid/sys/DispatchHandle.h \
- qpid/sys/FileSysDir.h \
- qpid/sys/IntegerTypes.h \
- qpid/sys/IOHandle.h \
- qpid/sys/LockFile.h \
- qpid/sys/LockPtr.h \
- qpid/sys/Monitor.h \
- qpid/sys/Mutex.h \
- qpid/sys/OutputControl.h \
- qpid/sys/OutputTask.h \
- qpid/sys/Poller.h \
- qpid/sys/ProtocolFactory.h \
- qpid/sys/Runnable.h \
- qpid/sys/Fork.h \
- qpid/sys/ScopedIncrement.h \
- qpid/sys/Semaphore.h \
- qpid/sys/SystemInfo.h \
- qpid/sys/Shlib.h \
- qpid/sys/ShutdownHandler.h \
- qpid/sys/Socket.h \
- qpid/sys/StateMonitor.h \
- qpid/sys/StrError.h \
- qpid/sys/Waitable.h \
- qpid/sys/Thread.h \
- qpid/sys/Time.h \
- qpid/sys/TimeoutHandler.h \
- qpid/sys/uuid.h
-
-# Force build of qpidd during dist phase so help2man will work.
-dist-hook: $(BUILT_SOURCES)
- $(MAKE) qpidd
-
-# Create the default data directory
-install-data-local:
- $(mkinstalldirs) $(DESTDIR)/$(localstatedir)/lib/qpidd
-
diff --git a/M4-RCs/qpid/cpp/src/MaxMethodBodySize.vcproj b/M4-RCs/qpid/cpp/src/MaxMethodBodySize.vcproj
deleted file mode 100644
index 1b1cf67433..0000000000
--- a/M4-RCs/qpid/cpp/src/MaxMethodBodySize.vcproj
+++ /dev/null
@@ -1,396 +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="MaxMethodBodySize"
- ProjectGUID="{CB5C939B-FECA-1BAD-BB9C-8C3A688E2823}"
- RootNamespace="MaxMethodBodySize"
- Keyword="Win32Proj"
- SignManifests="true"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Static_Debug"
- IntermediateDirectory="Static_Debug\MaxMethodBodySize\I386"
- ConfigurationType="1"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;NOMINMAX"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;NOMINMAX"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies=""
- OutputFile="$(OutDir)\generate_MaxMethodBodySize_h.exe"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="$(OutDir)\generate_MaxMethodBodySize_h"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Static_Release"
- IntermediateDirectory="Static_Release\MaxMethodBodySize\I386"
- ConfigurationType="1"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;NOMINMAX"
- RuntimeLibrary="0"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;NOMINMAX"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies=""
- OutputFile="$(OutDir)\generate_MaxMethodBodySize_h.exe"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="$(OutDir)\generate_MaxMethodBodySize_h"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="Static_Debug"
- IntermediateDirectory="Static_Debug\MaxMethodBodySize\AMD64"
- ConfigurationType="1"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;NOMINMAX"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;NOMINMAX;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/machine:AMD64"
- AdditionalDependencies=""
- OutputFile="$(OutDir)\generate_MaxMethodBodySize_h.exe"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="$(OutDir)\generate_MaxMethodBodySize_h"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="Static_Release"
- IntermediateDirectory="Static_Release\MaxMethodBodySize\AMD64"
- ConfigurationType="1"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;NOMINMAX"
- RuntimeLibrary="0"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;NOMINMAX;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/machine:AMD64"
- AdditionalDependencies=""
- OutputFile="$(OutDir)\generate_MaxMethodBodySize_h.exe"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="$(OutDir)\generate_MaxMethodBodySize_h"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;cxx;cc;C;c">
- <File
- RelativePath="gen\generate_MaxMethodBodySize_h.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hh">
- <File
- RelativePath="qpidd.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/M4-RCs/qpid/cpp/src/acl.mk b/M4-RCs/qpid/cpp/src/acl.mk
deleted file mode 100644
index 2b3ab4dfd9..0000000000
--- a/M4-RCs/qpid/cpp/src/acl.mk
+++ /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.
-#
-#
-# acl library makefile fragment, to be included in Makefile.am
-#
-dmodule_LTLIBRARIES += acl.la
-
-acl_la_SOURCES = \
- qpid/acl/Acl.cpp \
- qpid/acl/Acl.h \
- qpid/acl/AclData.cpp \
- qpid/acl/AclData.h \
- qpid/acl/AclPlugin.cpp \
- qpid/acl/AclReader.cpp \
- qpid/acl/AclReader.h
-
-acl_la_LIBADD = libqpidbroker.la
-acl_la_LDFLAGS = $(PLUGINLDFLAGS)
diff --git a/M4-RCs/qpid/cpp/src/broker.vcproj b/M4-RCs/qpid/cpp/src/broker.vcproj
deleted file mode 100644
index aaa7c0ce54..0000000000
--- a/M4-RCs/qpid/cpp/src/broker.vcproj
+++ /dev/null
@@ -1,1280 +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="broker"
- ProjectGUID="{09613D48-FECA-1BAD-9D20-8C37688E2823}"
- RootNamespace="broker"
- Keyword="Win32Proj"
- SignManifests="true"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="Static_Debug"
- IntermediateDirectory="Static_Debug\broker\I386"
- ConfigurationType="1"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800;4290;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="qpidcommonsd.lib ws2_32.lib secur32.lib rpcrt4.lib"
- OutputFile="$(OutDir)\qpidbroker.exe"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="Static_Release"
- IntermediateDirectory="Static_Release\broker\I386"
- ConfigurationType="1"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- RuntimeLibrary="0"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800;4290;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="qpidcommons.lib ws2_32.lib secur32.lib rpcrt4.lib"
- OutputFile="$(OutDir)\qpidbroker.exe"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="Static_Debug"
- IntermediateDirectory="Static_Debug\broker\AMD64"
- ConfigurationType="1"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800;4290;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/machine:AMD64"
- AdditionalDependencies="qpidcommonsd.lib ws2_32.lib secur32.lib rpcrt4.lib"
- OutputFile="$(OutDir)\qpidbroker.exe"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib"
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="Static_Release"
- IntermediateDirectory="Static_Release\broker\AMD64"
- ConfigurationType="1"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- RuntimeLibrary="0"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800;4290;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions="/machine:AMD64"
- AdditionalDependencies="qpidcommons.lib ws2_32.lib secur32.lib rpcrt4.lib"
- OutputFile="$(OutDir)\qpidbroker.exe"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories=".;$(BOOST_ROOT)\lib"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;cxx;cc;C;c">
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\Acl.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\EventAllow.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\EventDeny.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\EventFileLoaded.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\EventFileLoadFailed.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\Package.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Agent.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Binding.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Bridge.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Broker.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Connection.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventBind.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventBrokerLinkDown.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventBrokerLinkUp.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventClientConnect.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventClientConnectFail.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventClientDisconnect.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventExchangeDeclare.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventExchangeDelete.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventQueueDeclare.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventQueueDelete.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventSubscribe.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventUnbind.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventUnsubscribe.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Exchange.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Link.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Package.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Queue.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Session.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\System.cpp">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Vhost.cpp">
- </File>
- <File
- RelativePath="qpid\amqp_0_10\Connection.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\amqp_0_10\Connection.h">
- </File>
- <File
- RelativePath="qpid\broker\Bridge.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\broker\Broker.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\broker\BrokerSingleton.cpp">
- </File>
- <File
- RelativePath="qpid\broker\Connection.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)3.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)3.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)3.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)3.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\broker\ConnectionFactory.cpp">
- </File>
- <File
- RelativePath="qpid\broker\ConnectionHandler.cpp">
- </File>
- <File
- RelativePath="qpid\broker\DeliverableMessage.cpp">
- </File>
- <File
- RelativePath="qpid\broker\DeliveryRecord.cpp">
- </File>
- <File
- RelativePath="qpid\broker\DirectExchange.cpp">
- </File>
- <File
- RelativePath="qpid\broker\DtxAck.cpp">
- </File>
- <File
- RelativePath="qpid\broker\DtxBuffer.cpp">
- </File>
- <File
- RelativePath="qpid\broker\DtxManager.cpp">
- </File>
- <File
- RelativePath="qpid\broker\DtxTimeout.cpp">
- </File>
- <File
- RelativePath="qpid\broker\DtxWorkRecord.cpp">
- </File>
- <File
- RelativePath="qpid\broker\Exchange.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\broker\ExchangeRegistry.cpp">
- </File>
- <File
- RelativePath="qpid\broker\FanOutExchange.cpp">
- </File>
- <File
- RelativePath="qpid\broker\HeadersExchange.cpp">
- </File>
- <File
- RelativePath="qpid\broker\IncompleteMessageList.cpp">
- </File>
- <File
- RelativePath="qpid\broker\Link.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\broker\LinkRegistry.cpp">
- </File>
- <File
- RelativePath="qpid\broker\Message.cpp">
- </File>
- <File
- RelativePath="qpid\broker\MessageAdapter.cpp">
- </File>
- <File
- RelativePath="qpid\broker\MessageBuilder.cpp">
- </File>
- <File
- RelativePath="qpid\broker\MessageStoreModule.cpp">
- </File>
- <File
- RelativePath="qpid\broker\NameGenerator.cpp">
- </File>
- <File
- RelativePath="qpid\broker\NullMessageStore.cpp">
- </File>
- <File
- RelativePath="qpid\broker\PersistableMessage.cpp">
- </File>
- <File
- RelativePath="qpid\broker\Queue.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\broker\QueueBindings.cpp">
- </File>
- <File
- RelativePath="qpid\broker\QueueCleaner.cpp">
- </File>
- <File
- RelativePath="qpid\broker\QueueListeners.cpp">
- </File>
- <File
- RelativePath="qpid\broker\QueuePolicy.cpp">
- </File>
- <File
- RelativePath="qpid\broker\QueueRegistry.cpp">
- </File>
- <File
- RelativePath="qpid\broker\RateTracker.cpp">
- </File>
- <File
- RelativePath="qpid\broker\RecoveredDequeue.cpp">
- </File>
- <File
- RelativePath="qpid\broker\RecoveredEnqueue.cpp">
- </File>
- <File
- RelativePath="qpid\broker\RecoveryManagerImpl.cpp">
- </File>
- <File
- RelativePath="qpid\broker\SemanticState.cpp">
- </File>
- <File
- RelativePath="qpid\broker\SemanticState.h">
- </File>
- <File
- RelativePath="qpid\broker\SessionAdapter.cpp">
- </File>
- <File
- RelativePath="qpid\broker\SessionContext.h">
- </File>
- <File
- RelativePath="qpid\broker\SessionHandler.cpp">
- </File>
- <File
- RelativePath="qpid\broker\SessionHandler.h">
- </File>
- <File
- RelativePath="qpid\broker\SessionManager.cpp">
- </File>
- <File
- RelativePath="qpid\broker\SessionManager.h">
- </File>
- <File
- RelativePath="qpid\broker\SessionState.cpp">
- </File>
- <File
- RelativePath="qpid\broker\SessionState.h">
- </File>
- <File
- RelativePath="qpid\broker\System.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\broker\Timer.cpp">
- </File>
- <File
- RelativePath="qpid\broker\TopicExchange.cpp">
- </File>
- <File
- RelativePath="qpid\broker\TxAccept.cpp">
- </File>
- <File
- RelativePath="qpid\broker\TxBuffer.cpp">
- </File>
- <File
- RelativePath="qpid\broker\TxPublish.cpp">
- </File>
- <File
- RelativePath="qpid\broker\Vhost.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\broker\windows\BrokerDefaults.cpp">
- </File>
- <File
- RelativePath="qpid\broker\windows\SaslAuthenticator.cpp">
- </File>
- <File
- RelativePath="qpid\management\ManagementBroker.cpp">
- </File>
- <File
- RelativePath="qpid\management\ManagementExchange.cpp">
- </File>
- <File
- RelativePath="qpid\sys\TCPIOPlugin.cpp">
- </File>
- <File
- RelativePath="qpidd.cpp">
- </File>
- <File
- RelativePath="windows\QpiddBroker.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hh">
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\Acl.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\EventAllow.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\EventDeny.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\EventFileLoaded.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\EventFileLoadFailed.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\acl\Package.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Agent.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\ArgsBrokerConnect.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\ArgsBrokerEcho.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\ArgsBrokerQueueMoveMessages.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\ArgsLinkBridge.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\ArgsQueuePurge.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Binding.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Bridge.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Broker.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Connection.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventBind.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventBrokerLinkDown.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventBrokerLinkUp.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventClientConnect.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventClientConnectFail.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventClientDisconnect.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventExchangeDeclare.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventExchangeDelete.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventQueueDeclare.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventQueueDelete.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventSubscribe.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventUnbind.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\EventUnsubscribe.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Exchange.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Link.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Package.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Queue.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Session.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\System.h">
- </File>
- <File
- RelativePath="gen\qmf\org\apache\qpid\broker\Vhost.h">
- </File>
- <File
- RelativePath="qpid\amqp_0_10\Connection.h">
- </File>
- <File
- RelativePath="qpid\broker\AclModule.h">
- </File>
- <File
- RelativePath="qpid\broker\Bridge.h">
- </File>
- <File
- RelativePath="qpid\broker\Broker.h">
- </File>
- <File
- RelativePath="qpid\broker\BrokerSingleton.h">
- </File>
- <File
- RelativePath="qpid\broker\Connection.h">
- </File>
- <File
- RelativePath="qpid\broker\ConnectionFactory.h">
- </File>
- <File
- RelativePath="qpid\broker\ConnectionHandler.h">
- </File>
- <File
- RelativePath="qpid\broker\ConnectionState.h">
- </File>
- <File
- RelativePath="qpid\broker\ConnectionToken.h">
- </File>
- <File
- RelativePath="qpid\broker\Consumer.h">
- </File>
- <File
- RelativePath="qpid\broker\Daemon.h">
- </File>
- <File
- RelativePath="qpid\broker\Deliverable.h">
- </File>
- <File
- RelativePath="qpid\broker\DeliverableMessage.h">
- </File>
- <File
- RelativePath="qpid\broker\DeliveryAdapter.h">
- </File>
- <File
- RelativePath="qpid\broker\DeliveryId.h">
- </File>
- <File
- RelativePath="qpid\broker\DeliveryRecord.h">
- </File>
- <File
- RelativePath="qpid\broker\DeliveryToken.h">
- </File>
- <File
- RelativePath="qpid\broker\DirectExchange.h">
- </File>
- <File
- RelativePath="qpid\broker\DtxAck.h">
- </File>
- <File
- RelativePath="qpid\broker\DtxBuffer.h">
- </File>
- <File
- RelativePath="qpid\broker\DtxManager.h">
- </File>
- <File
- RelativePath="qpid\broker\DtxTimeout.h">
- </File>
- <File
- RelativePath="qpid\broker\DtxWorkRecord.h">
- </File>
- <File
- RelativePath="qpid\broker\Exchange.h">
- </File>
- <File
- RelativePath="qpid\broker\ExchangeRegistry.h">
- </File>
- <File
- RelativePath="qpid\broker\FanOutExchange.h">
- </File>
- <File
- RelativePath="qpid\broker\HandlerImpl.h">
- </File>
- <File
- RelativePath="qpid\broker\HeadersExchange.h">
- </File>
- <File
- RelativePath="qpid\broker\IncompleteMessageList.h">
- </File>
- <File
- RelativePath="qpid\broker\Link.h">
- </File>
- <File
- RelativePath="qpid\broker\LinkRegistry.h">
- </File>
- <File
- RelativePath="qpid\broker\Message.h">
- </File>
- <File
- RelativePath="qpid\broker\MessageAdapter.h">
- </File>
- <File
- RelativePath="qpid\broker\MessageBuilder.h">
- </File>
- <File
- RelativePath="qpid\broker\MessageDelivery.h">
- </File>
- <File
- RelativePath="qpid\broker\MessageStore.h">
- </File>
- <File
- RelativePath="qpid\broker\MessageStoreModule.h">
- </File>
- <File
- RelativePath="qpid\broker\NameGenerator.h">
- </File>
- <File
- RelativePath="qpid\broker\NullMessageStore.h">
- </File>
- <File
- RelativePath="qpid\broker\OwnershipToken.h">
- </File>
- <File
- RelativePath="qpid\broker\Persistable.h">
- </File>
- <File
- RelativePath="qpid\broker\PersistableConfig.h">
- </File>
- <File
- RelativePath="qpid\broker\PersistableExchange.h">
- </File>
- <File
- RelativePath="qpid\broker\PersistableMessage.h">
- </File>
- <File
- RelativePath="qpid\broker\PersistableQueue.h">
- </File>
- <File
- RelativePath="qpid\broker\Queue.h">
- </File>
- <File
- RelativePath="qpid\broker\QueueBindings.h">
- </File>
- <File
- RelativePath="qpid\broker\QueueCleaner.h">
- </File>
- <File
- RelativePath="qpid\broker\QueueListeners.h">
- </File>
- <File
- RelativePath="qpid\broker\QueueMessage.h">
- </File>
- <File
- RelativePath="qpid\broker\QueuePolicy.h">
- </File>
- <File
- RelativePath="qpid\broker\QueueRegistry.h">
- </File>
- <File
- RelativePath="qpid\broker\RateTracker.h">
- </File>
- <File
- RelativePath="qpid\broker\RecoverableConfig.h">
- </File>
- <File
- RelativePath="qpid\broker\RecoverableExchange.h">
- </File>
- <File
- RelativePath="qpid\broker\RecoverableMessage.h">
- </File>
- <File
- RelativePath="qpid\broker\RecoverableQueue.h">
- </File>
- <File
- RelativePath="qpid\broker\RecoverableTransaction.h">
- </File>
- <File
- RelativePath="qpid\broker\RecoveredDequeue.h">
- </File>
- <File
- RelativePath="qpid\broker\RecoveredEnqueue.h">
- </File>
- <File
- RelativePath="qpid\broker\RecoveryManager.h">
- </File>
- <File
- RelativePath="qpid\broker\RecoveryManagerImpl.h">
- </File>
- <File
- RelativePath="qpid\broker\SaslAuthenticator.h">
- </File>
- <File
- RelativePath="qpid\broker\SemanticState.h">
- </File>
- <File
- RelativePath="qpid\broker\SessionAdapter.h">
- </File>
- <File
- RelativePath="qpid\broker\SessionContext.h">
- </File>
- <File
- RelativePath="qpid\broker\SessionHandler.h">
- </File>
- <File
- RelativePath="qpid\broker\SessionManager.h">
- </File>
- <File
- RelativePath="qpid\broker\SessionState.h">
- </File>
- <File
- RelativePath="qpid\broker\SignalHandler.h">
- </File>
- <File
- RelativePath="qpid\broker\System.h">
- </File>
- <File
- RelativePath="qpid\broker\Timer.h">
- </File>
- <File
- RelativePath="qpid\broker\TopicExchange.h">
- </File>
- <File
- RelativePath="qpid\broker\TransactionalStore.h">
- </File>
- <File
- RelativePath="qpid\broker\TxAccept.h">
- </File>
- <File
- RelativePath="qpid\broker\TxBuffer.h">
- </File>
- <File
- RelativePath="qpid\broker\TxOp.h">
- </File>
- <File
- RelativePath="qpid\broker\TxOpVisitor.h">
- </File>
- <File
- RelativePath="qpid\broker\TxPublish.h">
- </File>
- <File
- RelativePath="qpid\broker\Vhost.h">
- </File>
- <File
- RelativePath="qpid\management\Args.h">
- </File>
- <File
- RelativePath="qpid\management\Manageable.h">
- </File>
- <File
- RelativePath="qpid\management\ManagementBroker.h">
- </File>
- <File
- RelativePath="qpid\management\ManagementExchange.h">
- </File>
- <File
- RelativePath="qpid\management\ManagementObject.h">
- </File>
- <File
- RelativePath="qpidd.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/M4-RCs/qpid/cpp/src/client.vcproj b/M4-RCs/qpid/cpp/src/client.vcproj
deleted file mode 100644
index a2d02e9ffc..0000000000
--- a/M4-RCs/qpid/cpp/src/client.vcproj
+++ /dev/null
@@ -1,574 +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="client"
- ProjectGUID="{6961DBA3-FECA-1BAD-F396-8C39688E2823}"
- RootNamespace="client"
- Keyword="Win32Proj"
- SignManifests="true"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="."
- IntermediateDirectory="Static_Debug\client\I386"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;CONF_FILE=\&quot;qpidc.conf\&quot;;MODULE_DIR=\&quot;.\&quot;;NOMINMAX;WIN32_LEAN_AND_MEAN"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;CONF_FILE=\&quot;qpidc.conf\&quot;;MODULE_DIR=\&quot;.\&quot;;NOMINMAX;WIN32_LEAN_AND_MEAN"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qpidclientsd.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="."
- IntermediateDirectory="Static_Release\client\I386"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;CONF_FILE=\&quot;qpidc.conf\&quot;;MODULE_DIR=\&quot;.\&quot;;NOMINMAX;WIN32_LEAN_AND_MEAN"
- RuntimeLibrary="0"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;CONF_FILE=\&quot;qpidc.conf\&quot;;MODULE_DIR=\&quot;.\&quot;;NOMINMAX;WIN32_LEAN_AND_MEAN"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qpidclients.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="."
- IntermediateDirectory="Static_Debug\client\AMD64"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;CONF_FILE=\&quot;qpidc.conf\&quot;;MODULE_DIR=\&quot;.\&quot;;NOMINMAX;WIN32_LEAN_AND_MEAN"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;CONF_FILE=\&quot;qpidc.conf\&quot;;MODULE_DIR=\&quot;.\&quot;;NOMINMAX;WIN32_LEAN_AND_MEAN;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qpidclientsd.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="."
- IntermediateDirectory="Static_Release\client\AMD64"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;CONF_FILE=\&quot;qpidc.conf\&quot;;MODULE_DIR=\&quot;.\&quot;;NOMINMAX;WIN32_LEAN_AND_MEAN"
- RuntimeLibrary="0"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;CONF_FILE=\&quot;qpidc.conf\&quot;;MODULE_DIR=\&quot;.\&quot;;NOMINMAX;WIN32_LEAN_AND_MEAN;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qpidclients.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;cxx;cc;C;c">
- <File
- RelativePath="gen\qpid\client\no_keyword\AsyncSession_0_10.cpp">
- </File>
- <File
- RelativePath="gen\qpid\client\no_keyword\Session_0_10.cpp">
- </File>
- <File
- RelativePath="qpid\client\Bounds.cpp">
- </File>
- <File
- RelativePath="qpid\client\Connection.cpp">
- </File>
- <File
- RelativePath="qpid\client\ConnectionAccess.h">
- </File>
- <File
- RelativePath="qpid\client\ConnectionHandler.cpp">
- </File>
- <File
- RelativePath="qpid\client\ConnectionImpl.cpp">
- </File>
- <File
- RelativePath="qpid\client\ConnectionSettings.cpp">
- </File>
- <File
- RelativePath="qpid\client\Connector.cpp">
- </File>
- <File
- RelativePath="qpid\client\Demux.cpp">
- </File>
- <File
- RelativePath="qpid\client\Dispatcher.cpp">
- </File>
- <File
- RelativePath="qpid\client\FailoverListener.cpp">
- </File>
- <File
- RelativePath="qpid\client\FailoverListener.h">
- </File>
- <File
- RelativePath="qpid\client\FailoverManager.cpp">
- </File>
- <File
- RelativePath="qpid\client\Future.cpp">
- </File>
- <File
- RelativePath="qpid\client\FutureCompletion.cpp">
- </File>
- <File
- RelativePath="qpid\client\FutureResult.cpp">
- </File>
- <File
- RelativePath="qpid\client\LoadPlugins.cpp">
- </File>
- <File
- RelativePath="qpid\client\LocalQueue.cpp">
- </File>
- <File
- RelativePath="qpid\client\Message.cpp">
- </File>
- <File
- RelativePath="qpid\client\MessageListener.cpp">
- </File>
- <File
- RelativePath="qpid\client\MessageReplayTracker.cpp">
- </File>
- <File
- RelativePath="qpid\client\QueueOptions.cpp">
- </File>
- <File
- RelativePath="qpid\client\Results.cpp">
- </File>
- <File
- RelativePath="qpid\client\SessionBase_0_10.cpp">
- </File>
- <File
- RelativePath="qpid\client\SessionBase_0_10.h">
- </File>
- <File
- RelativePath="qpid\client\SessionBase_0_10Access.h">
- </File>
- <File
- RelativePath="qpid\client\SessionImpl.cpp">
- </File>
- <File
- RelativePath="qpid\client\StateManager.cpp">
- </File>
- <File
- RelativePath="qpid\client\Subscription.cpp">
- </File>
- <File
- RelativePath="qpid\client\SubscriptionImpl.cpp">
- </File>
- <File
- RelativePath="qpid\client\SubscriptionManager.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hh">
- <File
- RelativePath="gen\qpid\client\arg.h">
- </File>
- <File
- RelativePath="gen\qpid\client\AsyncSession_0_10.h">
- </File>
- <File
- RelativePath="gen\qpid\client\no_keyword\AsyncSession_0_10.h">
- </File>
- <File
- RelativePath="gen\qpid\client\no_keyword\Session_0_10.h">
- </File>
- <File
- RelativePath="gen\qpid\client\Session_0_10.h">
- </File>
- <File
- RelativePath="qpid\client\AckMode.h">
- </File>
- <File
- RelativePath="qpid\client\AckPolicy.h">
- </File>
- <File
- RelativePath="qpid\client\AsyncSession.h">
- </File>
- <File
- RelativePath="qpid\client\Bounds.h">
- </File>
- <File
- RelativePath="qpid\client\ChainableFrameHandler.h">
- </File>
- <File
- RelativePath="qpid\client\Completion.h">
- </File>
- <File
- RelativePath="qpid\client\Connection.h">
- </File>
- <File
- RelativePath="qpid\client\ConnectionAccess.h">
- </File>
- <File
- RelativePath="qpid\client\ConnectionHandler.h">
- </File>
- <File
- RelativePath="qpid\client\ConnectionImpl.h">
- </File>
- <File
- RelativePath="qpid\client\ConnectionSettings.h">
- </File>
- <File
- RelativePath="qpid\client\Connector.h">
- </File>
- <File
- RelativePath="qpid\client\Demux.h">
- </File>
- <File
- RelativePath="qpid\client\Dispatcher.h">
- </File>
- <File
- RelativePath="qpid\client\Execution.h">
- </File>
- <File
- RelativePath="qpid\client\FailoverListener.h">
- </File>
- <File
- RelativePath="qpid\client\FailoverManager.h">
- </File>
- <File
- RelativePath="qpid\client\FlowControl.h">
- </File>
- <File
- RelativePath="qpid\client\Future.h">
- </File>
- <File
- RelativePath="qpid\client\FutureCompletion.h">
- </File>
- <File
- RelativePath="qpid\client\FutureResult.h">
- </File>
- <File
- RelativePath="qpid\client\LocalQueue.h">
- </File>
- <File
- RelativePath="qpid\client\Message.h">
- </File>
- <File
- RelativePath="qpid\client\MessageListener.h">
- </File>
- <File
- RelativePath="qpid\client\MessageReplayTracker.h">
- </File>
- <File
- RelativePath="qpid\client\QueueOptions.h">
- </File>
- <File
- RelativePath="qpid\client\Results.h">
- </File>
- <File
- RelativePath="qpid\client\Session.h">
- </File>
- <File
- RelativePath="qpid\client\SessionBase_0_10.h">
- </File>
- <File
- RelativePath="qpid\client\SessionBase_0_10Access.h">
- </File>
- <File
- RelativePath="qpid\client\SessionImpl.h">
- </File>
- <File
- RelativePath="qpid\client\StateManager.h">
- </File>
- <File
- RelativePath="qpid\client\Subscription.h">
- </File>
- <File
- RelativePath="qpid\client\SubscriptionImpl.h">
- </File>
- <File
- RelativePath="qpid\client\SubscriptionManager.h">
- </File>
- <File
- RelativePath="qpid\client\SubscriptionSettings.h">
- </File>
- <File
- RelativePath="qpid\client\TypedResult.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/M4-RCs/qpid/cpp/src/cluster.mk b/M4-RCs/qpid/cpp/src/cluster.mk
deleted file mode 100644
index 5005004023..0000000000
--- a/M4-RCs/qpid/cpp/src/cluster.mk
+++ /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.
-#
-#
-# Cluster library makefile fragment, to be included in Makefile.am
-#
-
-# Optional CMAN support
-
-# Distribute all sources.
-EXTRA_DIST += qpid/cluster/Quorum_cman.h qpid/cluster/Quorum_cman.cpp qpid/cluster/Quorum_null.h
-
-if HAVE_LIBCMAN
-CMAN_SOURCES = qpid/cluster/Quorum_cman.h qpid/cluster/Quorum_cman.cpp
-libcman = -lcman
-else
-CMAN_SOURCES = qpid/cluster/Quorum_null.h
-endif
-
-if HAVE_LIBCPG
-
-dmodule_LTLIBRARIES += cluster.la
-
-cluster_la_SOURCES = \
- $(CMAN_SOURCES) \
- qpid/cluster/types.h \
- qpid/cluster/Cluster.cpp \
- qpid/cluster/Cluster.h \
- qpid/cluster/Cpg.cpp \
- qpid/cluster/Cpg.h \
- qpid/cluster/Dispatchable.h \
- qpid/cluster/ClusterPlugin.cpp \
- qpid/cluster/ConnectionCodec.h \
- qpid/cluster/ConnectionCodec.cpp \
- qpid/cluster/Connection.h \
- qpid/cluster/Connection.cpp \
- qpid/cluster/ConnectionMap.h \
- qpid/cluster/NoOpConnectionOutputHandler.h \
- qpid/cluster/WriteEstimate.h \
- qpid/cluster/WriteEstimate.cpp \
- qpid/cluster/OutputInterceptor.h \
- qpid/cluster/OutputInterceptor.cpp \
- qpid/cluster/ProxyInputHandler.h \
- qpid/cluster/Event.h \
- qpid/cluster/Event.cpp \
- qpid/cluster/DumpClient.h \
- qpid/cluster/DumpClient.cpp \
- qpid/cluster/ClusterMap.h \
- qpid/cluster/ClusterMap.cpp \
- qpid/cluster/FailoverExchange.h \
- qpid/cluster/FailoverExchange.cpp \
- qpid/cluster/Multicaster.h \
- qpid/cluster/Multicaster.cpp \
- qpid/cluster/ClusterLeaveException.h \
- qpid/cluster/Quorum.h
-
-cluster_la_LIBADD= -lcpg $(libcman) libqpidbroker.la libqpidclient.la
-cluster_la_LDFLAGS = $(PLUGINLDFLAGS)
-
-endif # HAVE_LIBCPG
diff --git a/M4-RCs/qpid/cpp/src/common.vcproj b/M4-RCs/qpid/cpp/src/common.vcproj
deleted file mode 100644
index 39429078f3..0000000000
--- a/M4-RCs/qpid/cpp/src/common.vcproj
+++ /dev/null
@@ -1,1870 +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="common"
- ProjectGUID="{C961EF23-FECA-1BAD-BB9C-8C3A688E2823}"
- RootNamespace="common"
- Keyword="Win32Proj"
- SignManifests="true"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="."
- IntermediateDirectory="Static_Debug\common\I386"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qpidcommonsd.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="."
- IntermediateDirectory="Static_Release\common\I386"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- RuntimeLibrary="0"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qpidcommons.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="."
- IntermediateDirectory="Static_Debug\common\AMD64"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qpidcommonsd.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="."
- IntermediateDirectory="Static_Release\common\AMD64"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS"
- RuntimeLibrary="0"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_SCL_SECURE_NO_WARNINGS;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qpidcommons.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;cxx;cc;C;c">
- <File
- RelativePath="gen\qpid\framing\AllInvoker.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\AMQP_AllProxy.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\AMQP_ClientProxy.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\AMQP_ServerProxy.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\BodyHolder_gen.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClientInvoker.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConfigChangeBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionAccumulatedAckBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionConsumerStateBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionDeliverCloseBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionDeliverDoOutputBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionDeliveryRecordBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionExchangeBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionMembershipBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionQueueBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionQueuePositionBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionSessionStateBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionShadowReadyBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxAcceptBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxDequeueBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxEndBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxEnqueueBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxPublishBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxStartBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterDumpOfferBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterDumpRequestBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterReadyBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterShutdownBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionCloseBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionCloseOkBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionHeartbeatBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionOpenBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionOpenOkBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionRedirectBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionSecureBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionSecureOkBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionStartBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionStartOkBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionTuneBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionTuneOkBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DeliveryProperties.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxCommitBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxEndBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxForgetBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxGetTimeoutBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxGetTimeoutResult.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxPrepareBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxRecoverBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxRecoverResult.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxRollbackBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxSelectBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxSetTimeoutBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxStartBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeBindBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeBoundBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeBoundResult.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeDeclareBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeDeleteBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeQueryBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeQueryResult.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeUnbindBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExecutionExceptionBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExecutionResultBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExecutionSyncBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileAckBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileCancelBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileConsumeBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileConsumeOkBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileDeliverBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileOpenBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileOpenOkBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileProperties.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FilePublishBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileQosBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileQosOkBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileRejectBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileReturnBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileStageBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\FragmentProperties.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\Header.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageAcceptBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageAcquireBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageAcquireResult.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageCancelBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageFlowBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageFlushBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageProperties.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageRejectBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageReleaseBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageResumeBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageResumeResult.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageSetFlowModeBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageStopBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageSubscribeBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageTransferBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\MethodBodyDefaultVisitor.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\QueueDeclareBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\QueueDeleteBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\QueuePurgeBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\QueueQueryBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\QueueQueryResult.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\reply_exceptions.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ReplyTo.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\ServerInvoker.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionAttachBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionAttachedBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionCommandPointBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionCompletedBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionConfirmedBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionDetachBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionDetachedBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionExpectedBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionFlushBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionGapBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionKnownCompletedBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionRequestTimeoutBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionTimeoutBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamCancelBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamConsumeBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamConsumeOkBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamDeliverBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamProperties.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamPublishBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamQosBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamQosOkBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamReturnBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\TxCommitBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\TxRollbackBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\TxSelectBody.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\TypeCode.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\XaResult.cpp">
- </File>
- <File
- RelativePath="gen\qpid\framing\Xid.cpp">
- </File>
- <File
- RelativePath="qpid\Address.cpp">
- </File>
- <File
- RelativePath="qpid\amqp_0_10\SessionHandler.cpp">
- </File>
- <File
- RelativePath="qpid\amqp_0_10\SessionHandler.h">
- </File>
- <File
- RelativePath="qpid\assert.cpp">
- </File>
- <File
- RelativePath="qpid\assert.h">
- </File>
- <File
- RelativePath="qpid\DataDir.cpp">
- </File>
- <File
- RelativePath="qpid\Exception.cpp">
- </File>
- <File
- RelativePath="qpid\framing\AccumulatedAck.cpp">
- </File>
- <File
- RelativePath="qpid\framing\AMQBody.cpp">
- </File>
- <File
- RelativePath="qpid\framing\AMQContentBody.cpp">
- </File>
- <File
- RelativePath="qpid\framing\AMQFrame.cpp">
- </File>
- <File
- RelativePath="qpid\framing\AMQHeaderBody.cpp">
- </File>
- <File
- RelativePath="qpid\framing\AMQHeartbeatBody.cpp">
- </File>
- <File
- RelativePath="qpid\framing\AMQMethodBody.cpp">
- </File>
- <File
- RelativePath="qpid\framing\AMQP_HighestVersion.h">
- </File>
- <File
- RelativePath="qpid\framing\Array.cpp">
- </File>
- <File
- RelativePath="qpid\framing\Blob.cpp">
- </File>
- <File
- RelativePath="qpid\framing\BodyHandler.cpp">
- </File>
- <File
- RelativePath="qpid\framing\BodyHolder.cpp">
- </File>
- <File
- RelativePath="qpid\framing\Buffer.cpp">
- </File>
- <File
- RelativePath="qpid\framing\Endian.cpp">
- </File>
- <File
- RelativePath="qpid\framing\FieldTable.cpp">
- </File>
- <File
- RelativePath="qpid\framing\FieldValue.cpp">
- </File>
- <File
- RelativePath="qpid\framing\FrameDecoder.cpp">
- </File>
- <File
- RelativePath="qpid\framing\FrameSet.cpp">
- </File>
- <File
- RelativePath="qpid\framing\MaxMethodBodySize.h">
- </File>
- <File
- RelativePath="qpid\framing\ProtocolInitiation.cpp">
- </File>
- <File
- RelativePath="qpid\framing\ProtocolVersion.cpp">
- </File>
- <File
- RelativePath="qpid\framing\Proxy.cpp">
- </File>
- <File
- RelativePath="qpid\framing\SendContent.cpp">
- </File>
- <File
- RelativePath="qpid\framing\SequenceNumber.cpp">
- </File>
- <File
- RelativePath="qpid\framing\SequenceNumberSet.cpp">
- </File>
- <File
- RelativePath="qpid\framing\SequenceSet.cpp">
- </File>
- <File
- RelativePath="qpid\framing\TransferContent.cpp">
- </File>
- <File
- RelativePath="qpid\framing\Uuid.cpp">
- </File>
- <File
- RelativePath="qpid\log\Logger.cpp">
- </File>
- <File
- RelativePath="qpid\log\Options.cpp">
- </File>
- <File
- RelativePath="qpid\log\OstreamOutput.cpp">
- </File>
- <File
- RelativePath="qpid\log\Selector.cpp">
- </File>
- <File
- RelativePath="qpid\log\Statement.cpp">
- </File>
- <File
- RelativePath="qpid\log\windows\SinkOptions.cpp">
- </File>
- <File
- RelativePath="qpid\management\Manageable.cpp">
- </File>
- <File
- RelativePath="qpid\management\ManagementObject.cpp">
- </File>
- <File
- RelativePath="qpid\Modules.cpp">
- </File>
- <File
- RelativePath="qpid\Options.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\Plugin.cpp">
- </File>
- <File
- RelativePath="qpid\pointer_to_other.h">
- </File>
- <File
- RelativePath="qpid\RefCountedBuffer.cpp">
- </File>
- <File
- RelativePath="qpid\RefCountedBuffer.h">
- </File>
- <File
- RelativePath="qpid\Serializer.h">
- </File>
- <File
- RelativePath="qpid\SessionId.cpp">
- </File>
- <File
- RelativePath="qpid\SessionState.cpp">
- </File>
- <File
- RelativePath="qpid\SessionState.h">
- </File>
- <File
- RelativePath="qpid\StringUtils.cpp">
- </File>
- <File
- RelativePath="qpid\sys\AggregateOutput.cpp">
- </File>
- <File
- RelativePath="qpid\sys\AsynchIOHandler.cpp">
- </File>
- <File
- RelativePath="qpid\sys\PollableCondition.h">
- </File>
- <File
- RelativePath="qpid\sys\PollableQueue.h">
- </File>
- <File
- RelativePath="qpid\sys\Runnable.cpp">
- </File>
- <File
- RelativePath="qpid\sys\Shlib.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\AsynchIO.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\FileSysDir.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\IocpDispatcher.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\IocpPoller.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\IOHandle.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\LockFile.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\Shlib.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\sys\windows\Socket.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\StrError.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\SystemInfo.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\Thread.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\Time.cpp">
- </File>
- <File
- RelativePath="qpid\sys\windows\uuid.cpp">
- <FileConfiguration
- Name="Debug|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64">
- <Tool
- Name="VCCLCompilerTool"
- ObjectFile="$(IntDir)\$(InputName)2.obj"/>
- </FileConfiguration>
- </File>
- <File
- RelativePath="qpid\Url.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hh">
- <File
- RelativePath="gen\qpid\framing\all_method_bodies.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\AllInvoker.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\AMQP_AllOperations.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\AMQP_AllProxy.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\AMQP_ClientOperations.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\AMQP_ClientProxy.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\AMQP_ServerOperations.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\AMQP_ServerProxy.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\amqp_structs.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClientInvoker.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConfigChangeBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionAccumulatedAckBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionConsumerStateBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionDeliverCloseBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionDeliverDoOutputBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionDeliveryRecordBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionExchangeBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionMembershipBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionQueueBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionQueuePositionBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionSessionStateBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionShadowReadyBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxAcceptBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxDequeueBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxEndBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxEnqueueBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxPublishBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterConnectionTxStartBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterDumpOfferBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterDumpRequestBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterReadyBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ClusterShutdownBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionCloseBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionCloseOkBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionHeartbeatBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionOpenBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionOpenOkBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionRedirectBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionSecureBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionSecureOkBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionStartBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionStartOkBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionTuneBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ConnectionTuneOkBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\constants.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DeliveryProperties.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxCommitBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxEndBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxForgetBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxGetTimeoutBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxGetTimeoutResult.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxPrepareBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxRecoverBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxRecoverResult.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxRollbackBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxSelectBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxSetTimeoutBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\DtxStartBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\enum.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeBindBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeBoundBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeBoundResult.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeDeclareBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeDeleteBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeQueryBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeQueryResult.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExchangeUnbindBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExecutionExceptionBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExecutionResultBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ExecutionSyncBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileAckBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileCancelBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileConsumeBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileConsumeOkBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileDeliverBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileOpenBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileOpenOkBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileProperties.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FilePublishBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileQosBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileQosOkBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileRejectBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileReturnBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FileStageBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\FragmentProperties.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\frame_body_lists.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\Header.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageAcceptBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageAcquireBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageAcquireResult.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageCancelBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageFlowBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageFlushBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageProperties.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageRejectBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageReleaseBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageResumeBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageResumeResult.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageSetFlowModeBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageStopBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageSubscribeBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MessageTransferBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MethodBodyConstVisitor.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\MethodBodyDefaultVisitor.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\QueueDeclareBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\QueueDeleteBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\QueuePurgeBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\QueueQueryBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\QueueQueryResult.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\reply_exceptions.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ReplyTo.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\ServerInvoker.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionAttachBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionAttachedBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionCommandPointBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionCompletedBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionConfirmedBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionDetachBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionDetachedBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionExpectedBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionFlushBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionGapBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionKnownCompletedBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionRequestTimeoutBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\SessionTimeoutBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamCancelBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamConsumeBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamConsumeOkBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamDeliverBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamProperties.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamPublishBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamQosBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamQosOkBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\StreamReturnBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\TxCommitBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\TxRollbackBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\TxSelectBody.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\TypeCode.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\XaResult.h">
- </File>
- <File
- RelativePath="gen\qpid\framing\Xid.h">
- </File>
- <File
- RelativePath="qpid\Address.h">
- </File>
- <File
- RelativePath="qpid\amqp_0_10\apply.h">
- </File>
- <File
- RelativePath="qpid\amqp_0_10\Exception.h">
- </File>
- <File
- RelativePath="qpid\amqp_0_10\SessionHandler.h">
- </File>
- <File
- RelativePath="qpid\assert.h">
- </File>
- <File
- RelativePath="qpid\DataDir.h">
- </File>
- <File
- RelativePath="qpid\Exception.h">
- </File>
- <File
- RelativePath="qpid\framing\AccumulatedAck.h">
- </File>
- <File
- RelativePath="qpid\framing\AMQBody.h">
- </File>
- <File
- RelativePath="qpid\framing\AMQCommandControlBody.h">
- </File>
- <File
- RelativePath="qpid\framing\AMQContentBody.h">
- </File>
- <File
- RelativePath="qpid\framing\AMQDataBlock.h">
- </File>
- <File
- RelativePath="qpid\framing\AMQFrame.h">
- </File>
- <File
- RelativePath="qpid\framing\AMQHeaderBody.h">
- </File>
- <File
- RelativePath="qpid\framing\AMQHeartbeatBody.h">
- </File>
- <File
- RelativePath="qpid\framing\AMQMethodBody.h">
- </File>
- <File
- RelativePath="qpid\framing\amqp_framing.h">
- </File>
- <File
- RelativePath="qpid\framing\AMQP_HighestVersion.h">
- </File>
- <File
- RelativePath="qpid\framing\amqp_types.h">
- </File>
- <File
- RelativePath="qpid\framing\amqp_types_full.h">
- </File>
- <File
- RelativePath="qpid\framing\Array.h">
- </File>
- <File
- RelativePath="qpid\framing\Blob.h">
- </File>
- <File
- RelativePath="qpid\framing\BodyHandler.h">
- </File>
- <File
- RelativePath="qpid\framing\BodyHolder.h">
- </File>
- <File
- RelativePath="qpid\framing\Buffer.h">
- </File>
- <File
- RelativePath="qpid\framing\ChannelHandler.h">
- </File>
- <File
- RelativePath="qpid\framing\Endian.h">
- </File>
- <File
- RelativePath="qpid\framing\FieldTable.h">
- </File>
- <File
- RelativePath="qpid\framing\FieldValue.h">
- </File>
- <File
- RelativePath="qpid\framing\frame_functors.h">
- </File>
- <File
- RelativePath="qpid\framing\FrameDecoder.h">
- </File>
- <File
- RelativePath="qpid\framing\FrameDefaultVisitor.h">
- </File>
- <File
- RelativePath="qpid\framing\FrameHandler.h">
- </File>
- <File
- RelativePath="qpid\framing\FrameSet.h">
- </File>
- <File
- RelativePath="qpid\framing\Handler.h">
- </File>
- <File
- RelativePath="qpid\framing\HeaderProperties.h">
- </File>
- <File
- RelativePath="qpid\framing\InitiationHandler.h">
- </File>
- <File
- RelativePath="qpid\framing\InputHandler.h">
- </File>
- <File
- RelativePath="qpid\framing\Invoker.h">
- </File>
- <File
- RelativePath="qpid\framing\MaxMethodBodySize.h">
- </File>
- <File
- RelativePath="qpid\framing\MethodContent.h">
- </File>
- <File
- RelativePath="qpid\framing\ModelMethod.h">
- </File>
- <File
- RelativePath="qpid\framing\OutputHandler.h">
- </File>
- <File
- RelativePath="qpid\framing\ProtocolInitiation.h">
- </File>
- <File
- RelativePath="qpid\framing\ProtocolVersion.h">
- </File>
- <File
- RelativePath="qpid\framing\Proxy.h">
- </File>
- <File
- RelativePath="qpid\framing\SendContent.h">
- </File>
- <File
- RelativePath="qpid\framing\SequenceNumber.h">
- </File>
- <File
- RelativePath="qpid\framing\SequenceNumberSet.h">
- </File>
- <File
- RelativePath="qpid\framing\SequenceSet.h">
- </File>
- <File
- RelativePath="qpid\framing\StructHelper.h">
- </File>
- <File
- RelativePath="qpid\framing\TransferContent.h">
- </File>
- <File
- RelativePath="qpid\framing\TypeFilter.h">
- </File>
- <File
- RelativePath="qpid\framing\Uuid.h">
- </File>
- <File
- RelativePath="qpid\framing\variant.h qpid\log\Helpers.h">
- </File>
- <File
- RelativePath="qpid\framing\Visitor.h">
- </File>
- <File
- RelativePath="qpid\InlineAllocator.h">
- </File>
- <File
- RelativePath="qpid\InlineVector.h">
- </File>
- <File
- RelativePath="qpid\log\Logger.h">
- </File>
- <File
- RelativePath="qpid\log\Options.h">
- </File>
- <File
- RelativePath="qpid\log\OstreamOutput.h">
- </File>
- <File
- RelativePath="qpid\log\Selector.h">
- </File>
- <File
- RelativePath="qpid\log\SinkOptions.h">
- </File>
- <File
- RelativePath="qpid\log\Statement.h">
- </File>
- <File
- RelativePath="qpid\log\windows\SinkOptions.h">
- </File>
- <File
- RelativePath="qpid\management\Manageable.h">
- </File>
- <File
- RelativePath="qpid\management\ManagementObject.h">
- </File>
- <File
- RelativePath="qpid\memory.h">
- </File>
- <File
- RelativePath="qpid\Modules.h">
- </File>
- <File
- RelativePath="qpid\Msg.h">
- </File>
- <File
- RelativePath="qpid\Options.h">
- </File>
- <File
- RelativePath="qpid\Plugin.h">
- </File>
- <File
- RelativePath="qpid\pointer_to_other.h">
- </File>
- <File
- RelativePath="qpid\ptr_map.h">
- </File>
- <File
- RelativePath="qpid\RangeSet.h">
- </File>
- <File
- RelativePath="qpid\RefCounted.h">
- </File>
- <File
- RelativePath="qpid\RefCountedBuffer.h">
- </File>
- <File
- RelativePath="qpid\Serializer.h">
- </File>
- <File
- RelativePath="qpid\SessionId.h">
- </File>
- <File
- RelativePath="qpid\SessionState.h">
- </File>
- <File
- RelativePath="qpid\shared_ptr.h">
- </File>
- <File
- RelativePath="qpid\SharedObject.h">
- </File>
- <File
- RelativePath="qpid\StringUtils.h">
- </File>
- <File
- RelativePath="qpid\sys\AggregateOutput.h">
- </File>
- <File
- RelativePath="qpid\sys\AsynchIO.h">
- </File>
- <File
- RelativePath="qpid\sys\AsynchIOHandler.h">
- </File>
- <File
- RelativePath="qpid\sys\AtomicCount.h">
- </File>
- <File
- RelativePath="qpid\sys\AtomicValue.h">
- </File>
- <File
- RelativePath="qpid\sys\BlockingQueue.h">
- </File>
- <File
- RelativePath="qpid\sys\Condition.h">
- </File>
- <File
- RelativePath="qpid\sys\ConnectionCodec.h">
- </File>
- <File
- RelativePath="qpid\sys\ConnectionInputHandler.h">
- </File>
- <File
- RelativePath="qpid\sys\ConnectionInputHandlerFactory.h">
- </File>
- <File
- RelativePath="qpid\sys\ConnectionOutputHandler.h">
- </File>
- <File
- RelativePath="qpid\sys\ConnectionOutputHandlerPtr.h">
- </File>
- <File
- RelativePath="qpid\sys\CopyOnWriteArray.h">
- </File>
- <File
- RelativePath="qpid\sys\DeletionManager.h">
- </File>
- <File
- RelativePath="qpid\sys\Dispatcher.h">
- </File>
- <File
- RelativePath="qpid\sys\ExceptionHolder.h">
- </File>
- <File
- RelativePath="qpid\sys\FileSysDir.h">
- </File>
- <File
- RelativePath="qpid\sys\IntegerTypes.h">
- </File>
- <File
- RelativePath="qpid\sys\IOHandle.h">
- </File>
- <File
- RelativePath="qpid\sys\LockFile.h">
- </File>
- <File
- RelativePath="qpid\sys\LockPtr.h">
- </File>
- <File
- RelativePath="qpid\sys\Monitor.h">
- </File>
- <File
- RelativePath="qpid\sys\Mutex.h">
- </File>
- <File
- RelativePath="qpid\sys\OutputControl.h">
- </File>
- <File
- RelativePath="qpid\sys\OutputTask.h">
- </File>
- <File
- RelativePath="qpid\sys\PollableCondition.h">
- </File>
- <File
- RelativePath="qpid\sys\PollableQueue.h">
- </File>
- <File
- RelativePath="qpid\sys\Poller.h">
- </File>
- <File
- RelativePath="qpid\sys\ProtocolFactory.h">
- </File>
- <File
- RelativePath="qpid\sys\Runnable.h">
- </File>
- <File
- RelativePath="qpid\sys\ScopedIncrement.h">
- </File>
- <File
- RelativePath="qpid\sys\Semaphore.h">
- </File>
- <File
- RelativePath="qpid\sys\Shlib.h">
- </File>
- <File
- RelativePath="qpid\sys\ShutdownHandler.h">
- </File>
- <File
- RelativePath="qpid\sys\Socket.h">
- </File>
- <File
- RelativePath="qpid\sys\StateMonitor.h">
- </File>
- <File
- RelativePath="qpid\sys\StrError.h">
- </File>
- <File
- RelativePath="qpid\sys\SystemInfo.h">
- </File>
- <File
- RelativePath="qpid\sys\Thread.h">
- </File>
- <File
- RelativePath="qpid\sys\Time.h">
- </File>
- <File
- RelativePath="qpid\sys\TimeoutHandler.h">
- </File>
- <File
- RelativePath="qpid\sys\uuid.h">
- </File>
- <File
- RelativePath="qpid\sys\Waitable.h">
- </File>
- <File
- RelativePath="qpid\sys\windows\AsynchIoResult.h">
- </File>
- <File
- RelativePath="qpid\sys\windows\check.h">
- </File>
- <File
- RelativePath="qpid\sys\windows\Condition.h">
- </File>
- <File
- RelativePath="qpid\sys\windows\IntegerTypes.h">
- </File>
- <File
- RelativePath="qpid\sys\windows\IoHandlePrivate.h">
- </File>
- <File
- RelativePath="qpid\sys\windows\Mutex.h">
- </File>
- <File
- RelativePath="qpid\sys\windows\Time.h">
- </File>
- <File
- RelativePath="qpid\sys\windows\uuid.h">
- </File>
- <File
- RelativePath="qpid\Url.h">
- </File>
- <File
- RelativePath="qpid\Version.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/M4-RCs/qpid/cpp/src/generate.sh b/M4-RCs/qpid/cpp/src/generate.sh
deleted file mode 100755
index 581a45ff7f..0000000000
--- a/M4-RCs/qpid/cpp/src/generate.sh
+++ /dev/null
@@ -1,67 +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.
-#
-
-# Generate code from AMQP specification.
-# specs and gentools_dir are set by Makefile
-#
-set -e
-
-test -z "$JAVA" && JAVA=java ;
-test -z "$JAVAC" && JAVAC=javac ;
-
-srcdir=`dirname $0`
-checkspecs() {
- for s in $specs; do test -f $s || return 1; done
- return 0
-}
-
-# Can we generate code?
-if { test -d $gentools_dir && checkspecs &&
- which $JAVA && which $JAVAC; } > /dev/null;
-then
- echo "Generating code."
- mkdir -p gen/qpid/framing
- ( cd $gentools_dir/src && $JAVAC `find -name '*.java' -print` ; )
- $JAVA -cp $gentools_dir/src org.apache.qpid.gentools.Main \
- -c -o gen/qpid/framing -t $gentools_dir/templ.cpp $specs
- GENERATED=yes
-fi
-
-# Print a Makefile variable assignment.
-make_assign() {
- echo -n "$1 = "; shift
- prefix=$1; shift
- for f in $*; do echo "\\" ; echo -n " $prefix$f "; done
- echo
-}
-
-# Generate a Makefile fragment
-(
- make_assign "generated_cpp" "" `find gen -name '*.cpp' -print`
- make_assign "generated_h" "" `find gen -name '*.h' -print`
- if test x$GENERATED = xyes; then
- make_assign "generator" "" $specs \
- `find ../gentools \( -name '*.java' -o -name '*.tmpl' \) -print`
- fi
-) > generate.mk-t
-mv generate.mk-t $srcdir/generate.mk
-
-
-
diff --git a/M4-RCs/qpid/cpp/src/posix/QpiddBroker.cpp b/M4-RCs/qpid/cpp/src/posix/QpiddBroker.cpp
deleted file mode 100644
index ba1ef640df..0000000000
--- a/M4-RCs/qpid/cpp/src/posix/QpiddBroker.cpp
+++ /dev/null
@@ -1,168 +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 "qpidd.h"
-#include "qpid/Exception.h"
-#include "qpid/broker/Broker.h"
-#include "qpid/broker/Daemon.h"
-#include "qpid/broker/SignalHandler.h"
-#include "qpid/log/Logger.h"
-
-#include <iostream>
-#include <signal.h>
-#include <unistd.h>
-#include <sys/utsname.h>
-
-using namespace std;
-using namespace qpid;
-using qpid::broker::Broker;
-using qpid::broker::Daemon;
-
-BootstrapOptions::BootstrapOptions(const char* argv0)
- : qpid::Options("Options"),
- common("", CONF_FILE),
- module(MODULE_DIR),
- log(argv0)
-{
- add(common);
- add(module);
- add(log);
-}
-
-namespace {
-const std::string TCP = "tcp";
-}
-
-struct DaemonOptions : public qpid::Options {
- bool daemon;
- bool quit;
- bool check;
- int wait;
- std::string piddir;
- std::string transport;
-
- DaemonOptions() : qpid::Options("Daemon options"), daemon(false), quit(false), check(false), wait(10), transport(TCP)
- {
- char *home = ::getenv("HOME");
-
- if (home == 0)
- piddir += "/tmp";
- else
- piddir += home;
- piddir += "/.qpidd";
-
- addOptions()
- ("daemon,d", optValue(daemon), "Run as a daemon. Logs to syslog by default in this mode.")
- ("transport", optValue(transport, "TRANSPORT"), "The transport for which to return the port")
- ("pid-dir", optValue(piddir, "DIR"), "Directory where port-specific PID file is stored")
- ("wait,w", optValue(wait, "SECONDS"), "Sets the maximum wait time to initialize the daemon. If the daemon fails to initialize, prints an error and returns 1")
- ("check,c", optValue(check), "Prints the daemon's process ID to stdout and returns 0 if the daemon is running, otherwise returns 1")
- ("quit,q", optValue(quit), "Tells the daemon to shut down");
- }
-};
-
-struct QpiddPosixOptions : public QpiddOptionsPrivate {
- DaemonOptions daemon;
- QpiddOptions *parent;
-
- QpiddPosixOptions(QpiddOptions *parent_) : parent(parent_) {
- parent->add(daemon);
- }
-};
-
-QpiddOptions::QpiddOptions(const char* argv0)
- : qpid::Options("Options"),
- common("", CONF_FILE),
- module(MODULE_DIR),
- log(argv0)
-{
- add(common);
- add(module);
- add(broker);
- add(log);
-
- platform.reset(new QpiddPosixOptions(this));
- qpid::Plugin::addOptions(*this);
-}
-
-void QpiddOptions::usage() const {
- cout << "Usage: qpidd [OPTIONS]" << endl << endl << *this << endl;
-}
-
-struct QpiddDaemon : public Daemon {
- QpiddPosixOptions *options;
-
- QpiddDaemon(std::string pidDir, QpiddPosixOptions *opts)
- : Daemon(pidDir), options(opts) {}
-
- /** Code for parent process */
- void parent() {
- uint16_t port = wait(options->daemon.wait);
- if (options->parent->broker.port == 0 || options->daemon.transport != TCP)
- cout << port << endl;
- }
-
- /** Code for forked child process */
- void child() {
- boost::intrusive_ptr<Broker> brokerPtr(new Broker(options->parent->broker));
- qpid::broker::SignalHandler::setBroker(brokerPtr);
- uint16_t port=brokerPtr->getPort(options->daemon.transport);
- ready(port); // Notify parent.
- brokerPtr->run();
- }
-};
-
-int QpiddBroker::execute (QpiddOptions *options) {
- // Options that affect a running daemon.
- QpiddPosixOptions *myOptions =
- static_cast<QpiddPosixOptions *>(options->platform.get());
- if (myOptions == 0)
- throw Exception("Internal error obtaining platform options");
-
- if (myOptions->daemon.check || myOptions->daemon.quit) {
- pid_t pid = Daemon::getPid(myOptions->daemon.piddir,
- options->broker.port);
- if (pid < 0)
- return 1;
- if (myOptions->daemon.check)
- cout << pid << endl;
- if (myOptions->daemon.quit && kill(pid, SIGINT) < 0)
- throw Exception("Failed to stop daemon: " + qpid::sys::strError(errno));
- return 0;
- }
-
- // Starting the broker.
- if (myOptions->daemon.daemon) {
- // For daemon mode replace default stderr with syslog.
- options->log.sinkOptions->detached();
- qpid::log::Logger::instance().configure(options->log);
- // Fork the daemon
- QpiddDaemon d(myOptions->daemon.piddir, myOptions);
- d.fork(); // Broker is stared in QpiddDaemon::child()
- }
- else { // Non-daemon broker.
- boost::intrusive_ptr<Broker> brokerPtr(new Broker(options->broker));
- broker::SignalHandler::setBroker(brokerPtr);
- if (options->broker.port == 0 || myOptions->daemon.transport != TCP)
- cout << uint16_t(brokerPtr->getPort(myOptions->daemon.transport)) << endl;
- brokerPtr->run();
- }
- return 0;
-}
diff --git a/M4-RCs/qpid/cpp/src/prof b/M4-RCs/qpid/cpp/src/prof
deleted file mode 100755
index acfbaff2d4..0000000000
--- a/M4-RCs/qpid/cpp/src/prof
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-#
-#
-# 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.
-#
-#
-
-
-rm /var/lib/oprofile/oprofiled.log
-
-opcontrol --reset
-opcontrol --setup --no-vmlinux --separate=library
-opcontrol --start
-# -- Do stuff here --
-./qpidd
-# -- End of stuff --
-opcontrol --stop
-opcontrol --dump
-opcontrol --shutdown
-opreport -l ./.libs/lt-qpidd > stats.txt
-opannotate --source --output-dir=qpidd-prof ./.libs/lt-qpidd
-
-# clear the relusts
-#opcontrol --reset
diff --git a/M4-RCs/qpid/cpp/src/protocol_gen.mak b/M4-RCs/qpid/cpp/src/protocol_gen.mak
deleted file mode 100644
index 5c61eb90d5..0000000000
--- a/M4-RCs/qpid/cpp/src/protocol_gen.mak
+++ /dev/null
@@ -1,28 +0,0 @@
-# This nmake file generates the Qpid protocol files from the AMQP XML spec
-# and the management sources from the management XML specs.
-#
-# The Visual Studio projects assume the existence of the generated files.
-# The generated files are valid in Apache-released kits but must be generated
-# using this makefile for Windows developers working from the source
-# repository.
-
-specdir = ..\..\specs
-specs = $(specdir)\amqp.0-10-qpid-errata.xml ..\xml\cluster.xml
-
-rgen_dir=..\rubygen
-
-mgen_dir=..\managementgen
-mgmt_specs=$(specdir)\management-schema.xml \
- .\qpid\acl\management-schema.xml \
- .\qpid\cluster\management-schema.xml
-
-all: rubygen.mk gen\generate_MaxMethodBodySize_h.cpp managementgen.mk
-
-rubygen.mk gen\generate_MaxMethodBodySize_h.cpp: $(specs)
- ruby -I $(rgen_dir) $(rgen_dir)\generate gen $(specs) all rubygen.mk
-
-# Management code generation... uses Python
-
-managementgen.mk: $(mgmt_specs)
- python $(mgen_dir)\qmf-gen -m managementgen.mk -o gen\qmf $(mgmt_specs)
-
diff --git a/M4-RCs/qpid/cpp/src/qmf.mk b/M4-RCs/qpid/cpp/src/qmf.mk
deleted file mode 100644
index a825971d51..0000000000
--- a/M4-RCs/qpid/cpp/src/qmf.mk
+++ /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.
-#
-
-#
-# qmf agent library makefile fragment, to be included in Makefile.am
-#
-lib_LTLIBRARIES += libqmfagent.la
-
-libqmfagent_la_SOURCES = \
- qpid/agent/ManagementAgent.h \
- qpid/agent/ManagementAgentImpl.cpp \
- qpid/agent/ManagementAgentImpl.h
-
-libqmfagent_la_LIBADD = libqpidclient.la
-
diff --git a/M4-RCs/qpid/cpp/src/qmfc.mk b/M4-RCs/qpid/cpp/src/qmfc.mk
deleted file mode 100644
index 089ac2dcd9..0000000000
--- a/M4-RCs/qpid/cpp/src/qmfc.mk
+++ /dev/null
@@ -1,51 +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.
-#
-
-#
-# qmf console library makefile fragment, to be included in Makefile.am
-#
-lib_LTLIBRARIES += libqmfconsole.la
-
-libqmfconsole_la_SOURCES = \
- qpid/console/Agent.h \
- qpid/console/Agent.cpp \
- qpid/console/Broker.h \
- qpid/console/Broker.cpp \
- qpid/console/ClassKey.h \
- qpid/console/ClassKey.cpp \
- qpid/console/ConsoleListener.h \
- qpid/console/Event.h \
- qpid/console/Event.cpp \
- qpid/console/Object.h \
- qpid/console/Object.cpp \
- qpid/console/ObjectId.h \
- qpid/console/ObjectId.cpp \
- qpid/console/Package.h \
- qpid/console/Package.cpp \
- qpid/console/Schema.h \
- qpid/console/Schema.cpp \
- qpid/console/SequenceManager.h \
- qpid/console/SequenceManager.cpp \
- qpid/console/SessionManager.h \
- qpid/console/SessionManager.cpp \
- qpid/console/Value.h \
- qpid/console/Value.cpp
-
-libqmfconsole_la_LIBADD = libqpidclient.la
-
diff --git a/M4-RCs/qpid/cpp/src/qmfconsole.vcproj b/M4-RCs/qpid/cpp/src/qmfconsole.vcproj
deleted file mode 100644
index a9dd414c0f..0000000000
--- a/M4-RCs/qpid/cpp/src/qmfconsole.vcproj
+++ /dev/null
@@ -1,418 +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="qmfconsole"
- ProjectGUID="{C95DE177-FECA-1BAD-5EDC-8FFA4564ADCF}"
- RootNamespace="qmfconsole"
- Keyword="Win32Proj"
- SignManifests="true"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="."
- IntermediateDirectory="Static_Debug\qmfconsole\I386"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qmfconsolesd.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="."
- IntermediateDirectory="Static_Release\qmfconsole\I386"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;NOMINMAX;WIN32_LEAN_AND_MEAN"
- RuntimeLibrary="0"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qmfconsoles.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="."
- IntermediateDirectory="Static_Debug\qmfconsole\AMD64"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;NOMINMAX;WIN32_LEAN_AND_MEAN"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DebugInformationFormat="3"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qmfconsolesd.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="."
- IntermediateDirectory="Static_Release\qmfconsole\AMD64"
- ConfigurationType="4"
- CharacterSet="0"
-
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- AdditionalOptions=""
- AdditionalIncludeDirectories=""
- TypeLibraryName="$(InputName).tlb"
- HeaderFileName="$(InputName).h"
- InterfaceIdentifierFileName="$(InputName)_i.c"
- ProxyFileName="$(InputName)_p.c"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_CRT_NONSTDC_NO_WARNINGS;_AMD64_;_WIN64;NOMINMAX;WIN32_LEAN_AND_MEAN"
- RuntimeLibrary="0"
- RuntimeTypeInfo="true"
- WarningLevel="3"
- Detect64BitPortabilityProblems="false"
- DisableSpecificWarnings="4244;4800;4355"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;NOMINMAX;WIN32_LEAN_AND_MEAN;_WIN64"
- Culture="1033"
- AdditionalIncludeDirectories="$(BOOST_ROOT)\include\$(BOOST_VERSION),$(BOOST_ROOT)\.,.,gen"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- OutputFile=".\qmfconsoles.lib"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;cxx;cc;C;c">
- <File
- RelativePath="qpid\console\Agent.cpp">
- </File>
- <File
- RelativePath="qpid\console\Broker.cpp">
- </File>
- <File
- RelativePath="qpid\console\ClassKey.cpp">
- </File>
- <File
- RelativePath="qpid\console\Object.cpp">
- </File>
- <File
- RelativePath="qpid\console\ObjectId.cpp">
- </File>
- <File
- RelativePath="qpid\console\Package.cpp">
- </File>
- <File
- RelativePath="qpid\console\Schema.cpp">
- </File>
- <File
- RelativePath="qpid\console\SequenceManager.cpp">
- </File>
- <File
- RelativePath="qpid\console\SessionManager.cpp">
- </File>
- <File
- RelativePath="qpid\console\Value.cpp">
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hh">
- <File
- RelativePath="qpid\console\Agent.h">
- </File>
- <File
- RelativePath="qpid\console\Broker.h">
- </File>
- <File
- RelativePath="qpid\console\ClassKey.h">
- </File>
- <File
- RelativePath="qpid\console\ConsoleListener.h">
- </File>
- <File
- RelativePath="qpid\console\Event.h">
- </File>
- <File
- RelativePath="qpid\console\Object.h">
- </File>
- <File
- RelativePath="qpid\console\ObjectId.h">
- </File>
- <File
- RelativePath="qpid\console\Package.h">
- </File>
- <File
- RelativePath="qpid\console\Schema.h">
- </File>
- <File
- RelativePath="qpid\console\SequenceManager.h">
- </File>
- <File
- RelativePath="qpid\console\SessionManager.h">
- </File>
- <File
- RelativePath="qpid\console\Value.h">
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/M4-RCs/qpid/cpp/src/qpid.sln b/M4-RCs/qpid/cpp/src/qpid.sln
deleted file mode 100644
index 8e886cf7a4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid.sln
+++ /dev/null
@@ -1,72 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-# $Id: VC9WorkspaceCreator.pm 1439 2008-07-10 14:31:19Z elliott_c $
-#
-# This file was generated by MPC. Any changes made directly to
-# this file will be lost the next time it is generated.
-#
-# MPC Command:
-# C:\ace\MPC\mwc.pl -type vc9 -features boost=1 -static qpid.mwc
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MaxMethodBodySize", "MaxMethodBodySize.vcproj", "{CB5C939B-FECA-1BAD-BB9C-8C3A688E2823}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "broker", "broker.vcproj", "{09613D48-FECA-1BAD-9D20-8C37688E2823}"
- ProjectSection(ProjectDependencies) = postProject
- {C961EF23-FECA-1BAD-BB9C-8C3A688E2823} = {C961EF23-FECA-1BAD-BB9C-8C3A688E2823}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "client.vcproj", "{6961DBA3-FECA-1BAD-F396-8C39688E2823}"
- ProjectSection(ProjectDependencies) = postProject
- {C961EF23-FECA-1BAD-BB9C-8C3A688E2823} = {C961EF23-FECA-1BAD-BB9C-8C3A688E2823}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "common.vcproj", "{C961EF23-FECA-1BAD-BB9C-8C3A688E2823}"
- ProjectSection(ProjectDependencies) = postProject
- {CB5C939B-FECA-1BAD-BB9C-8C3A688E2823} = {CB5C939B-FECA-1BAD-BB9C-8C3A688E2823}
- EndProjectSection
-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
- {CB5C939B-FECA-1BAD-BB9C-8C3A688E2823}.Debug|Win32.ActiveCfg = Debug|Win32
- {CB5C939B-FECA-1BAD-BB9C-8C3A688E2823}.Debug|Win32.Build.0 = Debug|Win32
- {CB5C939B-FECA-1BAD-BB9C-8C3A688E2823}.Debug|x64.ActiveCfg = Debug|x64
- {CB5C939B-FECA-1BAD-BB9C-8C3A688E2823}.Debug|x64.Build.0 = Debug|x64
- {CB5C939B-FECA-1BAD-BB9C-8C3A688E2823}.Release|Win32.ActiveCfg = Release|Win32
- {CB5C939B-FECA-1BAD-BB9C-8C3A688E2823}.Release|Win32.Build.0 = Release|Win32
- {CB5C939B-FECA-1BAD-BB9C-8C3A688E2823}.Release|x64.ActiveCfg = Release|x64
- {CB5C939B-FECA-1BAD-BB9C-8C3A688E2823}.Release|x64.Build.0 = Release|x64
- {09613D48-FECA-1BAD-9D20-8C37688E2823}.Debug|Win32.ActiveCfg = Debug|Win32
- {09613D48-FECA-1BAD-9D20-8C37688E2823}.Debug|Win32.Build.0 = Debug|Win32
- {09613D48-FECA-1BAD-9D20-8C37688E2823}.Debug|x64.ActiveCfg = Debug|x64
- {09613D48-FECA-1BAD-9D20-8C37688E2823}.Debug|x64.Build.0 = Debug|x64
- {09613D48-FECA-1BAD-9D20-8C37688E2823}.Release|Win32.ActiveCfg = Release|Win32
- {09613D48-FECA-1BAD-9D20-8C37688E2823}.Release|Win32.Build.0 = Release|Win32
- {09613D48-FECA-1BAD-9D20-8C37688E2823}.Release|x64.ActiveCfg = Release|x64
- {09613D48-FECA-1BAD-9D20-8C37688E2823}.Release|x64.Build.0 = Release|x64
- {6961DBA3-FECA-1BAD-F396-8C39688E2823}.Debug|Win32.ActiveCfg = Debug|Win32
- {6961DBA3-FECA-1BAD-F396-8C39688E2823}.Debug|Win32.Build.0 = Debug|Win32
- {6961DBA3-FECA-1BAD-F396-8C39688E2823}.Debug|x64.ActiveCfg = Debug|x64
- {6961DBA3-FECA-1BAD-F396-8C39688E2823}.Debug|x64.Build.0 = Debug|x64
- {6961DBA3-FECA-1BAD-F396-8C39688E2823}.Release|Win32.ActiveCfg = Release|Win32
- {6961DBA3-FECA-1BAD-F396-8C39688E2823}.Release|Win32.Build.0 = Release|Win32
- {6961DBA3-FECA-1BAD-F396-8C39688E2823}.Release|x64.ActiveCfg = Release|x64
- {6961DBA3-FECA-1BAD-F396-8C39688E2823}.Release|x64.Build.0 = Release|x64
- {C961EF23-FECA-1BAD-BB9C-8C3A688E2823}.Debug|Win32.ActiveCfg = Debug|Win32
- {C961EF23-FECA-1BAD-BB9C-8C3A688E2823}.Debug|Win32.Build.0 = Debug|Win32
- {C961EF23-FECA-1BAD-BB9C-8C3A688E2823}.Debug|x64.ActiveCfg = Debug|x64
- {C961EF23-FECA-1BAD-BB9C-8C3A688E2823}.Debug|x64.Build.0 = Debug|x64
- {C961EF23-FECA-1BAD-BB9C-8C3A688E2823}.Release|Win32.ActiveCfg = Release|Win32
- {C961EF23-FECA-1BAD-BB9C-8C3A688E2823}.Release|Win32.Build.0 = Release|Win32
- {C961EF23-FECA-1BAD-BB9C-8C3A688E2823}.Release|x64.ActiveCfg = Release|x64
- {C961EF23-FECA-1BAD-BB9C-8C3A688E2823}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/M4-RCs/qpid/cpp/src/qpid/Address.cpp b/M4-RCs/qpid/cpp/src/qpid/Address.cpp
deleted file mode 100644
index ac8c7f30b1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Address.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Address.h"
-
-#include <ostream>
-
-using namespace std;
-
-namespace qpid {
-
-TcpAddress::TcpAddress(const std::string& h, uint16_t p): host(h), port(p) {}
-
-struct AddressOstreamVisitor : public boost::static_visitor<ostream&> {
- ostream& out;
- AddressOstreamVisitor(ostream& o) : out(o) {}
- template <class T> ostream& operator()(const T& data) { return out << data; }
-};
-
-ostream& operator<<(ostream& os, const Address& addr) {
- AddressOstreamVisitor visitor(os);
- return boost::apply_visitor(visitor, addr.value);
-}
-
-bool operator==(const TcpAddress& x, const TcpAddress& y) {
- return y.host==x.host && y.port == x.port;
-}
-
-ostream& operator<<(ostream& os, const TcpAddress& a) {
- return os << "tcp:" << a.host << ":" << a.port;
-}
-
-ExampleAddress::ExampleAddress(const char c) : data(c) {}
-
-bool operator==(const ExampleAddress& x, const ExampleAddress& y) {
- return x.data == y.data;
-}
-
-ostream& operator<<(ostream& os, const ExampleAddress& ex) {
- return os << "example:" << ex.data;
-}
-
-} // namespace qpid
diff --git a/M4-RCs/qpid/cpp/src/qpid/Address.h b/M4-RCs/qpid/cpp/src/qpid/Address.h
deleted file mode 100755
index 9669985165..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Address.h
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef QPID_ADDRESS_H
-#define QPID_ADDRESS_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/sys/IntegerTypes.h"
-
-#include <boost/variant.hpp>
-#include <iosfwd>
-#include <string>
-#include <vector>
-
-namespace qpid {
-
-/** TCP address of a broker - host:port */
-struct TcpAddress {
- static const uint16_t DEFAULT_PORT=5672;
- explicit TcpAddress(const std::string& host_=std::string(),uint16_t port_=DEFAULT_PORT);
- std::string host;
- uint16_t port;
-};
-bool operator==(const TcpAddress& x, const TcpAddress& y);
-std::ostream& operator<<(std::ostream& os, const TcpAddress& a);
-
-/**@internal Not a real address type, this is a placeholder to
- * demonstrate and validate multi-protocol Urls for unit tests and
- * developer education only. An example address holds just a char.
- */
-struct ExampleAddress {
- explicit ExampleAddress(char data);
- char data;
-};
-bool operator==(const ExampleAddress& x, const ExampleAddress& y);
-std::ostream& operator<<(std::ostream& os, const ExampleAddress& a);
-
-/**
- * Contains the address of an AMQP broker. Can any supported type of
- * broker address. Currently only TcpAddress is supported.
- */
-struct Address {
-public:
- Address(const Address& a) : value(a.value) {}
- Address(const TcpAddress& tcp) : value(tcp) {}
- Address(const ExampleAddress& eg) : value(eg) {} ///<@internal
-
- template <class AddressType> Address& operator=(const AddressType& t) { value=t; return *this; }
-
- /** Get the address of type AddressType.
- *@return AddressType* pointing to the contained address or 0 if
- *contained address is not of type AddressType.
- */
- template <class AddressType> AddressType* get() { return boost::get<AddressType>(&value); }
-
- /** Get the address of type AddressType.
- *@return AddressType* pointing to the contained address or 0 if
- *contained address is not of type AddressType.
- */
- template <class AddressType> const AddressType* get() const { return boost::get<AddressType>(&value); }
-
-private:
- boost::variant<TcpAddress,ExampleAddress> value;
- friend std::ostream& operator<<(std::ostream& os, const Address& addr);
-};
-
-
-
-} // namespace qpid
-
-#endif /*!QPID_ADDRESS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/DataDir.cpp b/M4-RCs/qpid/cpp/src/qpid/DataDir.cpp
deleted file mode 100644
index 4d61d22219..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/DataDir.cpp
+++ /dev/null
@@ -1,49 +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 "Exception.h"
-#include "DataDir.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/FileSysDir.h"
-
-namespace qpid {
-
-DataDir::DataDir (std::string path) :
- enabled (!path.empty ()),
- dirPath (path)
-{
- if (!enabled)
- {
- QPID_LOG (info, "No data directory - Disabling persistent configuration");
- return;
- }
-
- sys::FileSysDir dir(dirPath);
- if (!dir.exists())
- dir.mkdir();
- std::string lockFileName(path);
- lockFileName += "/lock";
- lockFile = std::auto_ptr<sys::LockFile>(new sys::LockFile(lockFileName, true));
-}
-
-DataDir::~DataDir () {}
-
-} // namespace qpid
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/DataDir.h b/M4-RCs/qpid/cpp/src/qpid/DataDir.h
deleted file mode 100644
index 6b45d8747b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/DataDir.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef QPID_DATADIR_H
-#define QPID_DATADIR_H
-
-/*
- * 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 <string>
-#include <memory>
-#include "qpid/sys/LockFile.h"
-
-namespace qpid {
-
-/**
- * DataDir class.
- */
-class DataDir
-{
- const bool enabled;
- const std::string dirPath;
- std::auto_ptr<qpid::sys::LockFile> lockFile;
-
- public:
-
- DataDir (std::string path);
- ~DataDir ();
-
- bool isEnabled() { return enabled; }
- const std::string& getPath() { return dirPath; }
-};
-
-} // namespace qpid
-
-#endif /*!QPID_DATADIR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/Exception.cpp b/M4-RCs/qpid/cpp/src/qpid/Exception.cpp
deleted file mode 100644
index 05d1a26f57..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Exception.cpp
+++ /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.
- *
- */
-
-#include "qpid/log/Statement.h"
-#include "Exception.h"
-#include <typeinfo>
-#include <assert.h>
-#include <string.h>
-
-namespace qpid {
-
-Exception::Exception(const std::string& msg) throw() : message(msg) {
- QPID_LOG_IF(debug, !msg.empty(), "Exception constructed: " << message);
-}
-
-Exception::~Exception() throw() {}
-
-std::string Exception::getPrefix() const { return ""; }
-
-std::string Exception::getMessage() const { return message; }
-
-const char* Exception::what() const throw() {
- // Construct the what string the first time it is needed.
- if (whatStr.empty()) {
- whatStr = getPrefix();
- if (!whatStr.empty()) whatStr += ": ";
- whatStr += message;
- }
- return whatStr.c_str();
-}
-
-ClosedException::ClosedException(const std::string& msg)
- : Exception(msg) {}
-
-std::string ClosedException::getPrefix() const { return "Closed"; }
-
-} // namespace qpid
diff --git a/M4-RCs/qpid/cpp/src/qpid/Exception.h b/M4-RCs/qpid/cpp/src/qpid/Exception.h
deleted file mode 100644
index 86bf8fbc4a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Exception.h
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef _Exception_
-#define _Exception_
-
-/*
- *
- * 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 "qpid/framing/amqp_types.h"
-#include "qpid/framing/constants.h"
-#include "qpid/framing/enum.h"
-#include "qpid/sys/StrError.h"
-#include "qpid/Msg.h"
-
-#include <memory>
-#include <string>
-#include <errno.h>
-
-namespace qpid
-{
-
-/**
- * Base class for Qpid runtime exceptions.
- */
-class Exception : public std::exception
-{
- public:
- explicit Exception(const std::string& message=std::string()) throw();
- virtual ~Exception() throw();
- virtual const char* what() const throw(); // prefix: message
- virtual std::string getMessage() const; // Unprefixed message
- virtual std::string getPrefix() const; // Prefix
-
- private:
- std::string message;
- mutable std::string whatStr;
-};
-
-/** Exception that includes an errno message. */
-struct ErrnoException : public Exception {
- ErrnoException(const std::string& msg, int err) : Exception(msg+": "+qpid::sys::strError(err)) {}
- ErrnoException(const std::string& msg) : Exception(msg+": "+qpid::sys::strError(errno)) {}
-};
-
-struct SessionException : public Exception {
- const framing::execution::ErrorCode code;
- SessionException(framing::execution::ErrorCode code_, const std::string& message)
- : Exception(message), code(code_) {}
-};
-
-struct ChannelException : public Exception {
- const framing::session::DetachCode code;
- ChannelException(framing::session::DetachCode _code, const std::string& message)
- : Exception(message), code(_code) {}
-};
-
-struct ConnectionException : public Exception {
- const framing::connection::CloseCode code;
- ConnectionException(framing::connection::CloseCode _code, const std::string& message)
- : Exception(message), code(_code) {}
-};
-
-struct ClosedException : public Exception {
- ClosedException(const std::string& msg=std::string());
- std::string getPrefix() const;
-};
-
-/**
- * Exception representing transport failure
- */
-struct TransportFailure : public Exception {
- TransportFailure(const std::string& msg=std::string()) : Exception(msg) {}
-};
-
-} // namespace qpid
-
-#endif /*!_Exception_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/InlineAllocator.h b/M4-RCs/qpid/cpp/src/qpid/InlineAllocator.h
deleted file mode 100644
index bf2f570599..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/InlineAllocator.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef QPID_INLINEALLOCATOR_H
-#define QPID_INLINEALLOCATOR_H
-
-/*
- *
- * 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 <memory>
-#include <assert.h>
-#include <boost/type_traits/type_with_alignment.hpp>
-#include <boost/type_traits/alignment_of.hpp>
-
-namespace qpid {
-
-/**
- * An allocator that has inline storage for up to Max objects
- * of type BaseAllocator::value_type.
- */
-template <class BaseAllocator, size_t Max>
-class InlineAllocator : public BaseAllocator {
- public:
- typedef typename BaseAllocator::pointer pointer;
- typedef typename BaseAllocator::size_type size_type;
- typedef typename BaseAllocator::value_type value_type;
-
- InlineAllocator() : allocated(false) {}
- InlineAllocator(const InlineAllocator& x) : BaseAllocator(x), allocated(false) {}
-
- pointer allocate(size_type n) {
- if (n <= Max && !allocated) {
- allocated=true;
- return reinterpret_cast<value_type*>(address());
- }
- else
- return BaseAllocator::allocate(n, 0);
- }
-
- void deallocate(pointer p, size_type n) {
- if (p == address()) {
- assert(allocated);
- allocated=false;
- }
- else
- BaseAllocator::deallocate(p, n);
- }
-
- template<typename T1>
- struct rebind {
- typedef typename BaseAllocator::template rebind<T1>::other BaseOther;
- typedef InlineAllocator<BaseOther, Max> other;
- };
-
- private:
- // POD object with alignment and size to hold Max value_types.
- static const size_t ALIGNMENT=boost::alignment_of<value_type>::value;
- typedef typename boost::type_with_alignment<ALIGNMENT>::type Aligner;
- union Store {
- Aligner aligner_;
- char sizer_[sizeof(value_type)*Max];
- } store;
- value_type* address() { return reinterpret_cast<value_type*>(&store); }
- bool allocated;
-};
-
-} // namespace qpid
-
-#endif /*!QPID_INLINEALLOCATOR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/InlineVector.h b/M4-RCs/qpid/cpp/src/qpid/InlineVector.h
deleted file mode 100644
index 551b9912e7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/InlineVector.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef QPID_INLINEVECTOR_H
-#define QPID_INLINEVECTOR_H
-
-/*
- *
- * 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 "InlineAllocator.h"
-#include <vector>
-
-namespace qpid {
-
-/**
- * A vector that stores up to Max elements in inline storage,
- * otherwise uses normal vector allocation.
- *
- * NOTE: depends on some non-standard but highly probably assumptions
- * about how std::vector uses its allocator, they are true for g++.
- * - default constructor does not allocate.
- * - reserve(N) does not allocate more than N elements.
- * - vector never re-allocates when size() < capacity()
- */
-template <class T, size_t Max, class Alloc=std::allocator<T> >
-class InlineVector : public std::vector<T, InlineAllocator<Alloc, Max> >
-{
- typedef std::vector<T, InlineAllocator<Alloc, Max> > Base;
- public:
- typedef typename Base::allocator_type allocator_type;
- typedef typename Base::value_type value_type;
- typedef typename Base::size_type size_type;
-
- explicit InlineVector(const allocator_type& a=allocator_type()) : Base(a) {
- this->reserve(Max);
- }
-
- explicit InlineVector(size_type n, const value_type& x = value_type(),
- const allocator_type& a=allocator_type()) : Base(a)
- {
- this->reserve(std::max(n, Max));
- this->insert(this->end(), n, x);
- }
-
- InlineVector(const InlineVector& x) : Base() {
- this->reserve(std::max(x.size(), Max));
- *this = x;
- }
-};
-
-} // namespace qpid
-
-#endif /*!QPID_INLINEVECTOR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/Modules.cpp b/M4-RCs/qpid/cpp/src/qpid/Modules.cpp
deleted file mode 100644
index 1b802f0019..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Modules.cpp
+++ /dev/null
@@ -1,78 +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 "Modules.h"
-#include "Exception.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/Shlib.h"
-
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-
-namespace fs=boost::filesystem;
-
-namespace qpid {
-
-ModuleOptions::ModuleOptions(const std::string& defaultModuleDir)
- : qpid::Options("Module options"), loadDir(defaultModuleDir), noLoad(false)
-{
- addOptions()
- ("module-dir", optValue(loadDir, "DIR"), "Load all shareable modules in this directory")
- ("load-module", optValue(load, "FILE"), "Specifies additional module(s) to be loaded")
- ("no-module-dir", optValue(noLoad), "Don't load modules from module directory");
-}
-
-void tryShlib(const char* libname, bool noThrow) {
- try {
- sys::Shlib shlib(libname);
- QPID_LOG (info, "Loaded Module: " << libname);
- }
- catch (const std::exception& /*e*/) {
- if (!noThrow)
- throw;
- }
-}
-
-void loadModuleDir (std::string dirname, bool isDefault)
-{
- fs::path dirPath (dirname, fs::native);
-
- if (!fs::exists (dirPath))
- {
- if (isDefault)
- return;
- throw Exception ("Directory not found: " + dirname);
- }
- if (!fs::is_directory(dirPath))
- {
- throw Exception ("Invalid value for module-dir: " + dirname + " is not a directory");
- }
-
- fs::directory_iterator endItr;
- for (fs::directory_iterator itr (dirPath); itr != endItr; ++itr)
- {
- if (!fs::is_directory(*itr) &&
- itr->string().find (".so") == itr->string().length() - 3)
- tryShlib (itr->string().data(), true);
- }
-}
-
-} // namespace qpid
diff --git a/M4-RCs/qpid/cpp/src/qpid/Modules.h b/M4-RCs/qpid/cpp/src/qpid/Modules.h
deleted file mode 100644
index 2a3b24f359..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Modules.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef QPID_MODULES_H
-#define QPID_MODULES_H
-
-/*
- *
- * 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 "Options.h"
-#include <string>
-#include <vector>
-
-namespace qpid {
-
-struct ModuleOptions : public qpid::Options {
- std::string loadDir;
- std::vector<std::string> load;
- bool noLoad;
- ModuleOptions(const std::string& defaultModuleDir);
-};
-
-void tryShlib(const char* libname, bool noThrow);
-void loadModuleDir (std::string dirname, bool isDefault);
-
-} // namespace qpid
-
-#endif /*!QPID_MODULES_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/Msg.h b/M4-RCs/qpid/cpp/src/qpid/Msg.h
deleted file mode 100644
index 7214db611f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Msg.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef QPID_MSG_H
-#define QPID_MSG_H
-
-/*
- *
- * 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 <sstream>
-#include <iostream>
-
-namespace qpid {
-
-/** A simple wrapper for std::ostringstream that allows
- * in place construction of a message and automatic conversion
- * to string.
- * E.g.
- *@code
- * void foo(const std::string&);
- * foo(Msg() << "hello " << 32);
- *@endcode
- * Will construct the string "hello 32" and pass it to foo()
- */
-struct Msg {
- std::ostringstream os;
- Msg() {}
- Msg(const Msg& m) : os(m.str()) {}
- std::string str() const { return os.str(); }
- operator std::string() const { return str(); }
-};
-
-template <class T> const Msg& operator<<(const Msg& m, const T& t) {
- const_cast<std::ostringstream&>(m.os)<<t; return m;
-}
-
-inline std::ostream& operator<<(std::ostream& o, const Msg& m) {
- return o<<m.str();
-}
-
-/** Construct a message using operator << and append (file:line) */
-#define QPID_MSG(message) ::qpid::Msg() << message << " (" << __FILE__ << ":" << __LINE__ << ")"
-
-} // namespace qpid
-
-#endif /*!QPID_MSG_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/Options.cpp b/M4-RCs/qpid/cpp/src/qpid/Options.cpp
deleted file mode 100644
index e521b1220a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Options.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Options.h"
-#include "qpid/Exception.h"
-
-#include <boost/bind.hpp>
-
-#include <fstream>
-#include <algorithm>
-#include <iostream>
-
-namespace qpid {
-
-using namespace std;
-
-
-/*
- * ---------------------------------------------
- * Explanation for Boost 103200 conditional code
- * ---------------------------------------------
- *
- * Please see large comment in Options.h .
- *
- */
-
-#if ( BOOST_VERSION == 103200 )
-std::vector<std::string> Options::long_names;
-std::vector<std::string> Options::short_names;
-#endif
-
-
-
-
-namespace {
-
-struct EnvOptMapper {
- static bool matchChar(char env, char opt) {
- return (env==toupper(opt)) || (strchr("-.", opt) && env=='_');
- }
-
- static bool matchStr(const string& env, boost::shared_ptr<po::option_description> desc) {
- return std::equal(env.begin(), env.end(), desc->long_name().begin(), &matchChar);
- }
-
- static bool matchCase(const string& env, boost::shared_ptr<po::option_description> desc) {
- return env == desc->long_name();
- }
-
- EnvOptMapper(const Options& o) : opts(o) {}
-
- string operator()(const string& envVar) {
- static const std::string prefix("QPID_");
- if (envVar.substr(0, prefix.size()) == prefix) {
- string env = envVar.substr(prefix.size());
-#if (BOOST_VERSION >= 103300)
- typedef const std::vector< boost::shared_ptr<po::option_description> > OptDescs;
- OptDescs::const_iterator i =
- find_if(opts.options().begin(), opts.options().end(), boost::bind(matchStr, env, _1));
- if (i != opts.options().end())
- return (*i)->long_name();
-#else
- /*
- * For Boost version 103200 and below.
- *
- * In Boost version 103200, the options_description::options member,
- * used above, is private. So what I will do here is use the
- * count() funtion, which returns a 1 or 0 indicating presence or
- * absence of the environment variable.
- *
- * If it is present, I will return its name. Env vars do not have
- * short and long forms, so the name is synonymous with the long
- * name. (This would not work for command line args.)
- * And if it's absent -- an empty string.
- */
-
-
- /*
- * The env vars come in unaltered, i.e. QPID_FOO, but the
- * options are stored normalized as "qpid-foo". Change the
- * local variable "env" so it can be found by "opts".
- */
- for (std::string::iterator i = env.begin(); i != env.end(); ++i)
- {
- *i = (*i == '_')
- ? '-'
- : ::tolower(*i);
- }
-
- if ( opts.count(env.c_str()) > 0 )
- {
- return env.c_str();
- }
- else
- {
- return string();
- }
-#endif
- }
- return string();
- }
-
-
- bool
- isComment ( string const & str )
- {
- size_t i = str.find_first_not_of ( " \t" );
-
- if ( i == string::npos )
- return true;
-
- return str[i] == '#';
- }
-
-
- string configFileLine (string& line) {
-
- if ( isComment ( line ) )
- return string();
-
- size_t pos = line.find ('=');
- if (pos == string::npos)
- return string();
- string key = line.substr (0, pos);
-#if (BOOST_VERSION >= 103300)
- typedef const std::vector< boost::shared_ptr<po::option_description> > OptDescs;
- OptDescs::const_iterator i =
- find_if(opts.options().begin(), opts.options().end(), boost::bind(matchCase, key, _1));
- if (i != opts.options().end())
- return string (line) + "\n";
- else
- return string();
-#else
- // Use 'count' to see if this option exists. Using 'find' will SEGV or hang
- // if the option has not been defined yet.
- if ( opts.count(key.c_str()) > 0 )
- return string ( line ) + "\n";
- else
- return string ( );
-#endif
- }
-
- const Options& opts;
-};
-
-}
-std::string prettyArg(const std::string& name, const std::string& value) {
- return value.empty() ? name+" " : name+" ("+value+") ";
-}
-
-Options::Options(const string& name) :
- po::options_description(name)
-
-#if ( BOOST_VERSION == 103200 )
- , m_less_easy(this, this)
-#endif
-{
-}
-
-
-
-
-
-void Options::parse(int argc, char const* const* argv, const std::string& configFile, bool allowUnknown)
-{
- string defaultConfigFile = configFile; // May be changed by env/cmdline
- string parsing;
- try {
- po::variables_map vm;
- parsing="command line options";
- if (argc > 0 && argv != 0) {
- if (allowUnknown) {
-#if (BOOST_VERSION >= 103300)
- // This hideous workaround is required because boost 1.33 has a bug
- // that causes 'allow_unregistered' to not work.
- po::command_line_parser clp = po::command_line_parser(argc, const_cast<char**>(argv)).
- options(*this).allow_unregistered();
- po::parsed_options opts = clp.run();
- po::parsed_options filtopts = clp.run();
- filtopts.options.clear ();
- for (std::vector< po::basic_option<char> >::iterator i = opts.options.begin();
- i != opts.options.end(); i++)
- if (!i->unregistered)
- filtopts.options.push_back (*i);
- po::store(filtopts, vm);
-
-#elif ( BOOST_VERSION == 103200 )
-
- /*
- * "Tokenize" the argv to get rid of equals signs.
- */
- vector<string> tokenized_argv;
- vector<string>::iterator iter;
-
- for ( int i = 0; i < argc; ++ i )
- {
- string s = argv[i];
- size_t equals_pos = s.find_first_of ( '=' );
-
- if ( string::npos == equals_pos ) // There's no equals sign. This is a token.
- {
- tokenized_argv.push_back(s);
- }
- else
- {
- // Two tokens -- before and after the equals position.
- tokenized_argv.push_back ( s.substr(0, equals_pos) );
- tokenized_argv.push_back ( s.substr(equals_pos+1) );
- }
- }
-
-
- /*
- * Now "filter" the tokenized argv, to get rid of all
- * unrecognized options. Because Boost 103200 has no
- * facility for dealing gracefully with "unregistered"
- * options.
- */
- vector<string> filtered_argv;
- vector<string>::iterator the_end = tokenized_argv.end();
-
- // The program-name gets in for free...
- iter = tokenized_argv.begin();
- filtered_argv.push_back ( * iter );
- ++ iter;
-
- // ...but all other args get checked.
- while ( iter < the_end )
- {
- /*
- * If this is an argument that is registered,
- * copy it to filtered_argv and also copy all
- * of its arguments.
- */
- if ( is_registered_option ( * iter ) )
- {
- // Store this recognized arg.
- filtered_argv.push_back ( * iter );
- ++ iter;
-
- // Copy all values for the above arg.
- // Args are tokens that do not start with a minus.
- while ( (iter < the_end) && ((* iter)[0] != '-') )
- {
- filtered_argv.push_back ( * iter );
- ++ iter;
- }
- }
- else
- {
- // Skip this unrecognized arg.
- ++ iter;
-
- // Copy all values for the above arg.
- // Values are tokens that do not start with a minus.
- while ( (iter < the_end) && ( '-' != (*iter)[0] ) )
- {
- ++ iter;
- }
- }
- }
-
- // Make an array of temporary C strings, because
- // the interface I can use wants it that way.
- int new_argc = filtered_argv.size();
- char ** new_argv = new char * [ new_argc ];
- int i = 0;
-
- // cout << "NEW ARGV: |";
- for ( iter = filtered_argv.begin();
- iter < filtered_argv.end();
- ++ iter, ++ i
- )
- {
- new_argv[i] = strdup( (* iter).c_str() );
- // cout << " " << new_argv[i] ;
- }
- // cout << "|\n";
-
-
- // Use the array of C strings.
- po::basic_parsed_options<char> bpo = po::parse_command_line(new_argc, const_cast<char**>(new_argv), *this);
- po::store(bpo, vm);
-
-
- // Now free the temporary C strings.
- for ( i = 0; i < new_argc; ++ i )
- {
- free ( new_argv[i] );
- }
- delete[] new_argv;
-
-#endif
- }
- else
- po::store(po::parse_command_line(argc, const_cast<char**>(argv), *this), vm);
- }
- parsing="environment variables";
- po::store(po::parse_environment(*this, EnvOptMapper(*this)), vm);
- po::notify(vm); // configFile may be updated from arg/env options.
- if (!configFile.empty()) {
- parsing="configuration file "+configFile;
- ifstream conf(configFile.c_str());
- if (conf.good()) {
- // Remove this hack when we get a stable version of boost that
- // can allow unregistered options in config files.
- EnvOptMapper mapper(*this);
- stringstream filtered;
-
- while (!conf.eof()) {
- string line;
- getline (conf, line);
- filtered << mapper.configFileLine (line);
- }
-
- po::store(po::parse_config_file(filtered, *this), vm);
- // End of hack
- }
- else {
- // No error if default configfile is missing/unreadable
- // but complain for non-default config file.
- if (configFile != defaultConfigFile)
- throw Exception("cannot read configuration file "
- +configFile);
- }
- }
- po::notify(vm);
- }
- catch (const std::exception& e) {
- ostringstream msg;
- msg << "Error in " << parsing << ": " << e.what() << endl;
-#if (BOOST_VERSION >= 103300)
- if (find_nothrow("help", false))
- msg << "Use --help to see valid options" << endl;
-#endif
- throw Exception(msg.str());
- }
-}
-
-CommonOptions::CommonOptions(const string& name, const string& configfile)
- : Options(name), config(configfile)
-{
- addOptions()
- ("help,h", optValue(help), "Displays the help message")
- ("version,v", optValue(version), "Displays version information")
- ("config", optValue(config, "FILE"), "Reads configuration from FILE");
-}
-
-
-
-
-#if ( BOOST_VERSION == 103200 )
-options_description_less_easy_init&
-options_description_less_easy_init::operator()(char const * name,
- char const * description)
-{
- // Snoop on the arguments....
- owner->register_names ( name );
- // ... then call parent function explicitly.
- po::options_description_easy_init::operator() ( name, description );
- return * this;
-}
-
-
-options_description_less_easy_init&
-options_description_less_easy_init::operator()(char const * name,
- const po::value_semantic* s)
-{
- // Snoop on the arguments....
- owner->register_names ( name );
- // ... then call parent function explicitly.
- po::options_description_easy_init::operator() ( name, s );
- return * this;
-}
-
-
-options_description_less_easy_init&
-options_description_less_easy_init::operator()(const char* name,
- const po::value_semantic* s,
- const char* description)
-{
- // Snoop on the arguments....
- owner->register_names ( name );
- // ... then call parent function explicitly.
- po::options_description_easy_init::operator() ( name, s, description );
- return * this;
-}
-
-
-
-
-
-void
-Options::register_names ( std::string s )
-{
-
- std::string::size_type comma_pos = s.find_first_of ( ',' );
-
- if ( std::string::npos == comma_pos )
- {
- // There is no short-name.
- long_names.push_back ( s );
- }
- else
- {
- std::string long_name = s.substr(0, comma_pos),
- short_name = s.substr(comma_pos+1);
- long_names .push_back ( long_name );
- short_names.push_back ( short_name );
- }
-
- /*
- * There is no way to tell when the adding of new options is finished,
- * so I re-sort after each one.
- */
- std::sort ( long_names .begin(), long_names .end() );
- std::sort ( short_names.begin(), short_names.end() );
-}
-
-
-
-
-
-bool
-Options::is_registered_option ( std::string s )
-{
- std::string without_dashes = s.substr ( s.find_first_not_of ( '-' ) );
- std::vector<std::string>::iterator i;
-
- // Look among the long names.
- i = std::find ( long_names.begin(),
- long_names.end(),
- without_dashes
- );
- if ( i != long_names.end() )
- return true;
-
- // Look among the short names.
- i = std::find ( short_names.begin(),
- short_names.end(),
- without_dashes
- );
- if ( i != short_names.end() )
- return true;
-
-
- return false;
-}
-#endif
-
-
-} // namespace qpid
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/Options.h b/M4-RCs/qpid/cpp/src/qpid/Options.h
deleted file mode 100644
index cb86d27241..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Options.h
+++ /dev/null
@@ -1,257 +0,0 @@
-#ifndef QPID_COMMONOPTIONS_H
-#define QPID_COMMONOPTIONS_H
-
-/*
- *
- * 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 "qpid/Exception.h"
-#include <boost/program_options.hpp>
-#include <boost/format.hpp>
-#include <sstream>
-#include <iterator>
-#include <algorithm>
-#include <string>
-
-
-namespace qpid {
-namespace po=boost::program_options;
-
-
-
-///@internal
-std::string prettyArg(const std::string&, const std::string&);
-
-/** @internal Normally only constructed by optValue() */
-template <class T>
-class OptionValue : public po::typed_value<T> {
- public:
- OptionValue(T& value, const std::string& arg)
- : po::typed_value<T>(&value), argName(arg) {}
- std::string name() const { return argName; }
-
- private:
- std::string argName;
-};
-
-
-/** Create an option value.
- * name, value appear after the option name in help like this:
- * <name> (=<value>)
- * T must support operator <<.
- *@see Options for example of use.
- */
-template<class T>
-po::value_semantic* optValue(T& value, const char* name) {
- std::string valstr(boost::lexical_cast<std::string>(value));
- return new OptionValue<T>(value, prettyArg(name, valstr));
-}
-
-/** Create a vector value. Multiple occurences of the option are
- * accumulated into the vector
- */
-template <class T>
-po::value_semantic* optValue(std::vector<T>& value, const char* name) {
- using namespace std;
- ostringstream os;
- copy(value.begin(), value.end(), ostream_iterator<T>(os, " "));
- string val=os.str();
- if (!val.empty())
- val.erase(val.end()-1); // Remove trailing " "
- return (new OptionValue<vector<T> >(value, prettyArg(name, val)));
-}
-
-/** Create a boolean switch value. Presence of the option sets the value. */
-inline po::value_semantic* optValue(bool& value) { return po::bool_switch(&value); }
-
-/**
- * Base class for options.
- * Example of use:
- @code
- struct MySubOptions : public Options {
- int x;
- string y;
- MySubOptions() : Options("Sub options") {
- addOptions()
- ("x", optValue(x,"XUNIT"), "Option X")
- ("y", optValue(y, "YUNIT"), "Option Y");
- }
- };
-
- struct MyOptions : public Options {
- bool z;
- vector<string> foo;
- MySubOptions subOptions;
- MyOptions() : Options("My Options") {
- addOptions()
- ("z", boolSwitch(z), "Option Z")
- ("foo", optValue(foo), "Multiple option foo");
- add(subOptions);
- }
-
- main(int argc, char** argv) {
- Options opts;
- opts.parse(argc, char** argv);
- // Use values
- dosomething(opts.subOptions.x);
- if (error)
- cout << opts << end; // Help message.
- }
-
- @endcode
- */
-
-
-
-
-/*
- * ---------------------------------------------
- * Explanation for Boost 103200 conditional code
- * ---------------------------------------------
- *
- * This boost version has an implementation of the program_options library
- * that has no provision for allowing unregistered options to pass by.
- *
- * But that means that, if you have a program that loads optional modules
- * after start-up, and those modules each have their own set of options,
- * then if you parse the command line too soon, you will get spurious
- * reports of unrecognized options -- and the program will exit!
- *
- * And we must process the command-line before module-loading, because we
- * need to look at the "bootstrap" options.
- *
- * This conditional code:
- *
- * 1. implements it's own functor class, derived from the Boost
- * "options_description_easy_init" class. This functor is used
- * to process added options and do the functor chaining, so that
- * I can snoop on the arguments before doing an explicit call
- * to its parent.
- *
- * 2. It implements two static vectors, one to hold long names, and
- * one for short names, so that options declared by modules are
- * not forgotten when their options_description goes out of scope.
- *
- * I will be thrilled to personally delete this code if we ever decide
- * that qpid doesn't really need to support this antique version of Boost.
- *
- */
-
-#if ( BOOST_VERSION == 103200 )
-struct Options;
-
-
-struct
-options_description_less_easy_init
- : public po::options_description_easy_init
-{
- options_description_less_easy_init ( Options * my_owner,
- po::options_description * my_parents_owner
- )
- : po::options_description_easy_init(my_parents_owner)
- {
- owner = my_owner;
- }
-
-
- options_description_less_easy_init&
- operator()(char const * name,
- char const * description);
-
-
- options_description_less_easy_init&
- operator()(char const * name,
- const po::value_semantic* s);
-
-
- options_description_less_easy_init&
- operator()(const char* name,
- const po::value_semantic* s,
- const char* description);
-
-
- Options * owner;
-};
-#endif
-
-
-
-
-
-
-struct Options : public po::options_description {
-
- struct Exception : public qpid::Exception {
- Exception(const std::string& msg) : qpid::Exception(msg) {}
- };
-
- Options(const std::string& name=std::string());
-
- /**
- * Parses options from argc/argv, environment variables and config file.
- * Note the filename argument can reference an options variable that
- * is updated by argc/argv or environment variable parsing.
- */
- void parse(int argc, char const* const* argv,
- const std::string& configfile=std::string(),
- bool allowUnknown = false);
-
-
- #if ( BOOST_VERSION == 103200 )
- options_description_less_easy_init m_less_easy;
-
- options_description_less_easy_init addOptions() {
- return m_less_easy;
- }
-
- bool
- is_registered_option ( std::string s );
-
- void
- register_names ( std::string s );
-
- static std::vector<std::string> long_names;
- static std::vector<std::string> short_names;
- #else
- boost::program_options::options_description_easy_init addOptions() {
- return add_options();
- }
- #endif
-};
-
-
-
-/**
- * Standard options for configuration
- */
-struct CommonOptions : public Options {
- CommonOptions(const std::string& name=std::string(),
- const std::string& configfile=std::string());
- bool help;
- bool version;
- std::string config;
-};
-
-
-
-
-} // namespace qpid
-
-#endif /*!QPID_COMMONOPTIONS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/Plugin.cpp b/M4-RCs/qpid/cpp/src/qpid/Plugin.cpp
deleted file mode 100644
index e4b76db28a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Plugin.cpp
+++ /dev/null
@@ -1,80 +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 "Plugin.h"
-#include "qpid/Options.h"
-#include <boost/bind.hpp>
-#include <algorithm>
-
-namespace qpid {
-
-namespace {
-
-Plugin::Plugins& thePlugins() {
- // This is a single threaded singleton implementation so
- // it is important to be sure that the first use of this
- // singleton is when the program is still single threaded
- static Plugin::Plugins plugins;
- return plugins;
-}
-
-void invoke(boost::function<void()> f) { f(); }
-
-} // namespace
-
-Plugin::Target::~Target() { finalize(); }
-
-void Plugin::Target::finalize() {
- for_each(finalizers.begin(), finalizers.end(), invoke);
- finalizers.clear();
-}
-
-void Plugin::Target::addFinalizer(const boost::function<void()>& f) {
- finalizers.push_back(f);
-}
-
-Plugin::Plugin() {
- // Register myself.
- thePlugins().push_back(this);
-}
-
-Plugin::~Plugin() {}
-
-Options* Plugin::getOptions() { return 0; }
-
-const Plugin::Plugins& Plugin::getPlugins() { return thePlugins(); }
-
-namespace {
-template <class F> void each_plugin(const F& f) {
- std::for_each(Plugin::getPlugins().begin(), Plugin::getPlugins().end(), f);
-}
-}
-
-void Plugin::addOptions(Options& opts) {
- for (Plugins::const_iterator i = getPlugins().begin(); i != getPlugins().end(); ++i) {
- if ((*i)->getOptions())
- opts.add(*(*i)->getOptions());
- }
-}
-
-void Plugin::earlyInitAll(Target& t) { each_plugin(boost::bind(&Plugin::earlyInitialize, _1, boost::ref(t))); }
-void Plugin::initializeAll(Target& t) { each_plugin(boost::bind(&Plugin::initialize, _1, boost::ref(t))); }
-
-} // namespace qpid
diff --git a/M4-RCs/qpid/cpp/src/qpid/Plugin.h b/M4-RCs/qpid/cpp/src/qpid/Plugin.h
deleted file mode 100644
index 50d8e01227..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Plugin.h
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef QPID_PLUGIN_H
-#define QPID_PLUGIN_H
-
-/*
- * 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 <boost/noncopyable.hpp>
-#include <boost/function.hpp>
-#include <vector>
-
-/**@file Generic plug-in framework. */
-
-namespace qpid {
-struct Options;
-
-/**
- * Plug-in base class.
- */
-class Plugin : private boost::noncopyable {
- public:
- typedef std::vector<Plugin*> Plugins;
-
- /**
- * Base interface for targets that can receive plug-ins.
- * Also allows plug-ins to attach a a function to be called
- * when the target is 'finalized'.
- */
- class Target : private boost::noncopyable
- {
- public:
- /** Calls finalize() if not already called. */
- virtual ~Target();
-
- /** Run all the finalizers */
- void finalize();
-
- /** Add a function to run when finalize() is called */
- void addFinalizer(const boost::function<void()>&);
-
- private:
- std::vector<boost::function<void()> > finalizers;
- };
-
- /**
- * Constructor registers the plug-in to appear in getPlugins().
- *
- * A concrete Plugin is instantiated as a global or static
- * member variable in a library so it is registered during
- * initialization when the library is loaded.
- */
- Plugin();
-
- virtual ~Plugin();
-
- /**
- * Configuration options for the plugin.
- * Then will be updated during option parsing by the host program.
- *
- * @return An options group or 0 for no options. Default returns 0.
- * Plugin retains ownership of return value.
- */
- virtual Options* getOptions();
-
- /**
- * Initialize Plugin functionality on a Target, called before
- * initializing the target.
- *
- * Plugins should ignore targets they don't recognize.
- *
- * Called before the target itself is initialized.
- */
- virtual void earlyInitialize(Target&) = 0;
-
- /**
- * Initialize Plugin functionality on a Target. Called after
- * initializing the target.
- *
- * Plugins should ignore targets they don't recognize.
- *
- * Called after the target is fully initialized.
- */
- virtual void initialize(Target&) = 0;
-
- /** List of registered Plugin objects.
- * Caller must not delete plugin pointers.
- */
- static const Plugins& getPlugins();
-
- /** Call earlyInitialize() on all registered plugins */
- static void earlyInitAll(Target&);
-
- /** Call initialize() on all registered plugins */
- static void initializeAll(Target&);
-
- /** For each registered plugin, add plugin.getOptions() to opts. */
- static void addOptions(Options& opts);
-};
-
-} // namespace qpid
-
-#endif /*!QPID_PLUGIN_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/RangeSet.h b/M4-RCs/qpid/cpp/src/qpid/RangeSet.h
deleted file mode 100644
index 1ba4fbbcef..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/RangeSet.h
+++ /dev/null
@@ -1,330 +0,0 @@
-#ifndef QPID_RANGESET_H
-#define QPID_RANGESET_H
-
-/*
- *
- * 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 "qpid/InlineVector.h"
-#include <boost/iterator/iterator_facade.hpp>
-#include <boost/operators.hpp>
-#include <boost/bind.hpp>
-#include <algorithm>
-#include <numeric>
-
-namespace qpid {
-
-/** A range of values, used in RangeSet.
- * Range(begin, end) includes begin but excludes end.
- * Range::makeClosed(first,last) includes both first and last.
- */
-template <class T>
-class Range {
- public:
- static Range makeClosed(const T& first, T last) { return Range(first, ++last); }
-
- Range() : begin_(), end_() {}
- explicit Range(const T& t) : begin_(t), end_(t) { ++end_; }
- Range(const T& b, const T& e) : begin_(b), end_(e) { assert(b <= e); }
-
- T begin() const { return begin_; }
- /** End of _open_ range, i.e. !contains(end()) */
- T end() const { return end_; }
-
- T first() const { assert(!empty()); return begin_; }
- /** Last in closed range, i.e. contains(end()) */
- T last() const { assert(!empty()); T ret=end_; return --ret; }
-
- void begin(const T& t) { begin_ = t; }
- void end(const T& t) { end_ = t; }
- size_t size() const { return end_ - begin_; }
- bool empty() const { return begin_ == end_; }
-
- bool contains(const T& x) const { return begin_ <= x && x < end_; }
- bool contains(const Range& r) const { return begin_ <= r.begin_ && r.end_ <= end_; }
- bool strictContains(const Range& r) const { return begin_ < r.begin_ && r.end_ < end_; }
-
- bool operator==(const Range& x) { return begin_ == x.begin_ && end_== x.end_; }
-
- bool operator<(const T& t) const { return end_ < t; }
- bool operator<(const Range<T>& r) const { return end_ < r.begin_; }
-
- /** touching ranges can be merged into a single range. */
- bool touching(const Range& r) const {
- return std::max(begin_, r.begin_) <= std::min(end_, r.end_);
- }
-
- /** @pre touching */
- void merge(const Range& r) {
- assert(touching(r));
- begin_ = std::min(begin_, r.begin_);
- end_ = std::max(end_, r.end_);
- }
-
- operator bool() const { return !empty(); }
-
- template <class S> void serialize(S& s) { s(begin_)(end_); }
-
- private:
- T begin_, end_;
-};
-
-
-/**
- * A set implemented as a list of [begin, end) ranges.
- * T must be LessThanComparable and Incrementable.
- * RangeSet only provides const iterators.
- */
-template <class T>
-class RangeSet
- : boost::additive1<RangeSet<T>,
- boost::additive2<RangeSet<T>, Range<T>,
- boost::additive2<RangeSet<T>, T> > >
-{
- typedef InlineVector<Range<T>, 3> Ranges; // TODO aconway 2008-04-21: what's the optimial inlined value?
-
- public:
-
- class iterator : public boost::iterator_facade<
- iterator,
- const T,
- boost::forward_traversal_tag>
- {
- public:
- iterator() : ranges(), iter(), value() {}
-
- private:
- typedef typename Ranges::const_iterator RangesIter;
- iterator(const Ranges& r, const RangesIter& i, const T& t)
- : ranges(&r), iter(i), value(t) {}
-
- void increment();
- bool equal(const iterator& i) const;
- const T& dereference() const { return value; }
-
- const Ranges* ranges;
- RangesIter iter;
- T value;
-
- friend class RangeSet<T>;
- friend class boost::iterator_core_access;
- };
-
- typedef iterator const_iterator;
-
- RangeSet() {}
- explicit RangeSet(const Range<T>& r) { *this += r; }
- RangeSet(const T& a, const T& b) { *this += Range<T>(a,b); }
-
- bool contiguous() const { return ranges.size() <= 1; }
-
- bool contains(const T& t) const;
- bool contains(const Range<T>&) const;
-
- /**@pre contiguous() */
- Range<T> toRange() const;
-
- bool operator==(const RangeSet<T>&) const;
-
- void addRange (const Range<T>&);
- void addSet (const RangeSet<T>&);
-
- RangeSet<T>& operator+=(const T& t) { return *this += Range<T>(t); }
- RangeSet<T>& operator+=(const Range<T>& r) { addRange(r); return *this; }
- RangeSet<T>& operator+=(const RangeSet<T>& s) { addSet(s); return *this; }
-
- void removeRange (const Range<T>&);
- void removeSet (const RangeSet<T>&);
-
- RangeSet<T>& operator-=(const T& t) { return *this -= Range<T>(t); }
- RangeSet<T>& operator-=(const Range<T>& r) { removeRange(r); return *this; }
- RangeSet<T>& operator-=(const RangeSet<T>& s) { removeSet(s); return *this; }
-
- T front() const { return ranges.front().begin(); }
- T back() const { return ranges.back().end(); }
-
- // Iterate over elements in the set.
- iterator begin() const;
- iterator end() const;
-
- // Iterate over ranges in the set.
- typedef typename Ranges::const_iterator RangeIterator;
- RangeIterator rangesBegin() const { return ranges.begin(); }
- RangeIterator rangesEnd() const { return ranges.end(); }
- size_t rangesSize() const { return ranges.size(); }
-
- // The difference between the start and end of this range set
- uint32_t span() const;
-
- size_t size() const;
- bool empty() const { return ranges.empty(); }
- void clear() { ranges.clear(); }
-
- /** Return the largest contiguous range containing x.
- * Returns the empty range [x,x) if x is not in the set.
- */
- Range<T> rangeContaining(const T&) const;
-
- template <class S> void serialize(S& s) { s.split(*this); s(ranges.begin(), ranges.end()); }
- template <class S> void encode(S& s) const { s(uint16_t(ranges.size()*sizeof(Range<T>))); }
- template <class S> void decode(S& s) { uint16_t sz; s(sz); ranges.resize(sz/sizeof(Range<T>)); }
-
- private:
- static size_t accumulateSize(size_t s, const Range<T>& r) { return s+r.size(); }
- Ranges ranges;
-
- template <class U> friend std::ostream& operator<<(std::ostream& o, const RangeSet<U>& r);
-
- friend class iterator;
-};
-
-template <class T>
-std::ostream& operator<<(std::ostream& o, const Range<T>& r) {
- return o << "[" << r.begin() << "," << r.end() << ")";
-}
-
-template <class T>
-std::ostream& operator<<(std::ostream& o, const RangeSet<T>& rs) {
- std::ostream_iterator<Range<T> > i(o, " ");
- o << "{ ";
- std::copy(rs.ranges.begin(), rs.ranges.end(), i);
- return o << "}";
-}
-
-template <class T>
-bool RangeSet<T>::contains(const T& t) const {
- typename Ranges::const_iterator i =
- std::lower_bound(ranges.begin(), ranges.end(), Range<T>(t));
- return i != ranges.end() && i->contains(t);
-}
-
-template <class T>
-bool RangeSet<T>::contains(const Range<T>& r) const {
- typename Ranges::const_iterator i =
- std::lower_bound(ranges.begin(), ranges.end(), r);
- return i != ranges.end() && i->contains(r);
-}
-
-template <class T> void RangeSet<T>::addRange(const Range<T>& r) {
- if (r.empty()) return;
- typename Ranges::iterator i =
- std::lower_bound(ranges.begin(), ranges.end(), r);
- if (i == ranges.end() || !i->touching(r))
- ranges.insert(i, r);
- else {
- i->merge(r);
- typename Ranges::iterator j = i;
- if (++j != ranges.end() && i->touching(*j)) {
- i->merge(*j);
- ranges.erase(j);
- }
- }
-}
-
-
-template <class T> void RangeSet<T>::addSet(const RangeSet<T>& s) {
- typedef RangeSet<T>& (RangeSet<T>::*RangeSetRangeOp)(const Range<T>&);
- std::for_each(s.ranges.begin(), s.ranges.end(),
- boost::bind((RangeSetRangeOp)&RangeSet<T>::operator+=, this, _1));
-}
-
-template <class T> void RangeSet<T>::removeRange(const Range<T>& r) {
- if (r.empty()) return;
- typename Ranges::iterator i,j;
- i = std::lower_bound(ranges.begin(), ranges.end(), r);
- if (i == ranges.end() || i->begin() >= r.end())
- return; // Outside of set
- if (*i == r) // Erase i
- ranges.erase(i);
- else if (i->strictContains(r)) { // Split i
- Range<T> i1(i->begin(), r.begin());
- Range<T> i2(r.end(), i->end());
- *i = i2;
- ranges.insert(i, i1);
- } else {
- if (i->begin() < r.begin()) { // Truncate i
- i->end(r.begin());
- ++i;
- }
- for (j = i; j != ranges.end() && r.contains(*j); ++j)
- ; // Ranges to erase.
- if (j != ranges.end() && j->end() > r.end())
- j->begin(r.end()); // Truncate j
- ranges.erase(i,j);
- }
-}
-
-template <class T> void RangeSet<T>::removeSet(const RangeSet<T>& r) {
- std::for_each(
- r.ranges.begin(), r.ranges.end(),
- boost::bind(&RangeSet<T>::removeRange, this, _1));
-}
-
-template <class T> Range<T> RangeSet<T>::toRange() const {
- assert(contiguous());
- return empty() ? Range<T>() : ranges.front();
-}
-
-template <class T> void RangeSet<T>::iterator::increment() {
- assert(ranges && iter != ranges->end());
- if (!iter->contains(++value)) {
- ++iter;
- if (iter == ranges->end())
- *this=iterator(); // end() iterator
- else
- value=iter->begin();
- }
-}
-
-template <class T> bool RangeSet<T>::operator==(const RangeSet<T>& r) const {
- return ranges.size() == r.ranges.size() && std::equal(ranges.begin(), ranges.end(), r.ranges.begin());
-}
-
-template <class T> typename RangeSet<T>::iterator RangeSet<T>::begin() const {
- return empty() ? end() : iterator(ranges, ranges.begin(), front());
-}
-
-template <class T> typename RangeSet<T>::iterator RangeSet<T>::end() const {
- return iterator();
-}
-
-template <class T> bool RangeSet<T>::iterator::equal(const iterator& i) const {
- return ranges==i.ranges && (ranges==0 || value==i.value);
-}
-
-template <class T> Range<T> RangeSet<T>::rangeContaining(const T& t) const {
- typename Ranges::const_iterator i =
- std::lower_bound(ranges.begin(), ranges.end(), Range<T>(t));
- return (i != ranges.end() && i->contains(t)) ? *i : Range<T>(t,t);
-}
-
-template <class T> uint32_t RangeSet<T>::span() const {
- if (ranges.empty()) return 0;
- return ranges.back().last() - ranges.front().first();
-}
-
-template <class T> size_t RangeSet<T>::size() const {
- return std::accumulate(rangesBegin(), rangesEnd(), 0, &RangeSet<T>::accumulateSize);
-}
-
-} // namespace qpid
-
-
-#endif /*!QPID_RANGESET_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/RefCounted.h b/M4-RCs/qpid/cpp/src/qpid/RefCounted.h
deleted file mode 100644
index 10b5e4afcc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/RefCounted.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef QPID_REFCOUNTED_H
-#define QPID_REFCOUNTED_H
-
-/*
- *
- * 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 <boost/utility.hpp>
-#include <boost/detail/atomic_count.hpp>
-
-namespace qpid {
-
-/**
- * Reference-counted base class.
- * Note: this class isn't copyable - you must copy the intrusive_ptr that points
- * to the class that has mixed this in not the class itself (as that would sidestep
- * the reference counting)
- */
-class RefCounted : boost::noncopyable {
- mutable boost::detail::atomic_count count;
-
-public:
- RefCounted() : count(0) {}
- void addRef() const { ++count; }
- void release() const { if (--count==0) delete this; }
- long refCount() { return count; }
-
-protected:
- virtual ~RefCounted() {};
-};
-
-
-} // namespace qpid
-
-// intrusive_ptr support.
-namespace boost {
-inline void intrusive_ptr_add_ref(const qpid::RefCounted* p) { p->addRef(); }
-inline void intrusive_ptr_release(const qpid::RefCounted* p) { p->release(); }
-}
-
-
-#endif /*!QPID_REFCOUNTED_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/RefCountedBuffer.cpp b/M4-RCs/qpid/cpp/src/qpid/RefCountedBuffer.cpp
deleted file mode 100644
index 57ef48ac42..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/RefCountedBuffer.cpp
+++ /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.
- *
- */
-
-#include "RefCountedBuffer.h"
-#include <new>
-
-namespace qpid {
-
-RefCountedBuffer::RefCountedBuffer() : count(0) {}
-
-void RefCountedBuffer::destroy() const {
- this->~RefCountedBuffer();
- ::delete[] reinterpret_cast<const char*>(this);
-}
-
-char* RefCountedBuffer::addr() const {
- return const_cast<char*>(reinterpret_cast<const char*>(this)+sizeof(RefCountedBuffer));
-}
-
-RefCountedBuffer::pointer RefCountedBuffer::create(size_t n) {
- char* store=::new char[n+sizeof(RefCountedBuffer)];
- new(store) RefCountedBuffer;
- return pointer(reinterpret_cast<RefCountedBuffer*>(store));
-}
-
-RefCountedBuffer::pointer::pointer() {}
-RefCountedBuffer::pointer::pointer(RefCountedBuffer* x) : p(x) {}
-RefCountedBuffer::pointer::pointer(const pointer& x) : p(x.p) {}
-RefCountedBuffer::pointer::~pointer() {}
-RefCountedBuffer::pointer& RefCountedBuffer::pointer::operator=(const RefCountedBuffer::pointer& x) { p = x.p; return *this; }
-
-char* RefCountedBuffer::pointer::cp() const { return p ? p->get() : 0; }
-} // namespace qpid
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/RefCountedBuffer.h b/M4-RCs/qpid/cpp/src/qpid/RefCountedBuffer.h
deleted file mode 100644
index c332325378..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/RefCountedBuffer.h
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef QPID_REFCOUNTEDBUFFER_H
-#define QPID_REFCOUNTEDBUFFER_H
-
-/*
- *
- * 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 <boost/utility.hpp>
-#include <boost/detail/atomic_count.hpp>
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
-// FIXME aconway 2008-09-06: easy to add alignment
-/**
- * Reference-counted byte buffer.
- * No alignment guarantees.
- */
-class RefCountedBuffer : boost::noncopyable {
- mutable boost::detail::atomic_count count;
- RefCountedBuffer();
- void destroy() const;
- char* addr() const;
-
-public:
- /** Smart char pointer to a reference counted buffer */
- class pointer {
- boost::intrusive_ptr<RefCountedBuffer> p;
- char* cp() const;
- pointer(RefCountedBuffer* x);
- friend class RefCountedBuffer;
-
- public:
- pointer();
- pointer(const pointer&);
- ~pointer();
- pointer& operator=(const pointer&);
-
- char* get() { return cp(); }
- operator char*() { return cp(); }
- char& operator*() { return *cp(); }
- char& operator[](size_t i) { return cp()[i]; }
-
- const char* get() const { return cp(); }
- operator const char*() const { return cp(); }
- const char& operator*() const { return *cp(); }
- const char& operator[](size_t i) const { return cp()[i]; }
- };
-
- /** Create a reference counted buffer of size n */
- static pointer create(size_t n);
-
- /** Get a pointer to the start of the buffer. */
- char* get() { return addr(); }
- const char* get() const { return addr(); }
- char& operator[](size_t i) { return get()[i]; }
- const char& operator[](size_t i) const { return get()[i]; }
-
- void addRef() const { ++count; }
- void release() const { if (--count==0) destroy(); }
- long refCount() { return count; }
-};
-
-} // namespace qpid
-
-// intrusive_ptr support.
-namespace boost {
-inline void intrusive_ptr_add_ref(const qpid::RefCountedBuffer* p) { p->addRef(); }
-inline void intrusive_ptr_release(const qpid::RefCountedBuffer* p) { p->release(); }
-}
-
-
-#endif /*!QPID_REFCOUNTEDBUFFER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/Serializer.h b/M4-RCs/qpid/cpp/src/qpid/Serializer.h
deleted file mode 100644
index a8ded9f5e0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Serializer.h
+++ /dev/null
@@ -1,197 +0,0 @@
-#ifndef QPID_SERIALIZER_H
-#define QPID_SERIALIZER_H
-
-/*
- *
- * 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 <limits>
-#include <algorithm>
-#include "qpid/Exception.h" // FIXME aconway 2008-04-03: proper exception class.
-
-namespace qpid {
-
-/**
- * Overload for types that do not provide a serialize() member.
- * It should retrun a wrapper holding a reference to t that implements
- * serialize()
- */
-template <class T> T& serializable(T& t) { return t; }
-
-/** Serialize std::pair */
-template <class T, class U> struct SerializablePair {
- std::pair<T,U>& value;
- SerializablePair(std::pair<T,U>& x) : value(x) {}
- template <class S> void serialize(S& s) { s(value.first)(value.second); }
-};
-
-template <class T, class U>
-SerializablePair<T,U> serializable(std::pair<T,U>& p) {
- return SerializablePair<T,U>(p);
-}
-
-/**
- * Base class for all serializers.
- * Derived serializers inherit from either Encoder or Decoder.
- * Serializers can be used as functors or static_visitors.
- */
-template <class Derived> class Serializer {
- public:
- /** Temporarily set a lower relative limit on the serializer */
- class ScopedLimit {
- public:
- ScopedLimit(Serializer& s, size_t l)
- : serializer(s), save(serializer.setLimit(l)) {}
-
- ~ScopedLimit() { serializer.setAbsLimit(save); }
-
- private:
- Serializer& serializer;
- size_t save;
- };
-
- static size_t maxLimit() { return std::numeric_limits<size_t>::max(); }
-
- Serializer() : bytes(0), limit(maxLimit()) {}
-
- typedef Derived& result_type; // unary functor requirement.
-
- /** Wrapper functor to pass serializer functors by reference. */
- template <class S> struct Ref {
- typedef typename S::result_type result_type;
- S& s;
- Ref(S& ss) : s(ss) {}
- template <class T> result_type operator()(T& x) { return s(x); }
- template <class T> result_type operator()(const T& x) { return s(x); }
- };
-
- /** Reference wrapper to pass serializers by reference,
- * e.g. to std:: functions that take functors.
- */
- template <class S> static Ref<S> ref(S& s) { return Ref<S>(s); }
-
- /** Generic rule to serialize an iterator range */
- template <class Iter> Derived& operator()(Iter begin, Iter end) {
- std::for_each(begin, end, ref(this->self()));
- return self();
- }
-
- /** Set limit relative to current position.
- * @return old absolute limit.
- */
- size_t setLimit(size_t n) {
- size_t l=limit;
- limit = bytes+n;
- return l;
- }
-
- /** Get the max number of bytes that can be processed under the
- * current limit.
- */
- size_t bytesRemaining() const {
- return limit - bytes;
- }
- /** Set absolute limit. */
- void setAbsLimit(size_t n) {
- limit = n;
- if (bytes > limit)
- throw Exception("Framing error: data overrun"); // FIXME aconway 2008-04-03: proper exception.
- }
-
- protected:
- Derived& self() { return *static_cast<Derived*>(this); }
- void addBytes(size_t n) {
- size_t newBytes=bytes+n;
- if (newBytes > limit)
- throw Exception("Framing error: data overrun"); // FIXME aconway 2008-04-03: proper exception.
- bytes = newBytes;
- }
-
- private:
- void checkLimit() {
- }
-
- size_t bytes; // how many bytes serialized.
- size_t limit; // bytes may not exceed this limit.
-};
-
-/**
- * Base class for encoders, provides generic encode functions.
- *
- * A derived encoder must provide operator(const T&) to encode all
- * primitive types T.
- */
-template <class Derived> class EncoderBase : public Serializer<Derived> {
- public:
- using Serializer<Derived>::operator();
- using Serializer<Derived>::self;
-
- /** Default op() for non-primitive types. */
- template <class T> Derived& operator()(const T& t) {
- serializable(const_cast<T&>(t)).serialize(self()); return self();
- }
-
- /** Split serialize() into encode()/decode() */
- template <class T> Derived& split(const T& t) {
- t.encode(self()); return self();
- }
-};
-
-/**
- * Base class for decoders, provides generic decode functions.
- *
- * A derived encoder must provide operator(T&) to encode all
- * primitive types T.
- */
-template <class Derived> class DecoderBase : public Serializer<Derived> {
- public:
- using Serializer<Derived>::operator();
- using Serializer<Derived>::self;
-
- /** Default op() for non-primitive types. */
- template <class T> Derived& operator()(T& t) {
-
- serializable(t).serialize(self()); return self();
- }
-
- /** Split serialize() into encode()/decode() */
- template <class T> Derived& split(T& t) {
- t.decode(self()); return self();
- }
-};
-
-/** Serialize a type by converting it to/from another type.
- * To serialize type Foo by converting to/from type Bar create
- * a serializable() overload like this:
- *
- * SerializeAs<Foo,Bar> serializable(Foo& t) { return SerializeAs<Foo,Bar>(t); }
- */
-template <class Type, class AsType>
-struct SerializeAs {
- Type& value;
- SerializeAs(Type & t) : value(t) {}
- template <class S> void serialize(S& s) { s.split(*this); }
- template <class S> void encode(S& s) const { s(AsType(value)); }
- template <class S> void decode(S& s) { AsType x; s(x); value=Type(x); }
-};
-
-} // namespace qpid
-
-#endif /*!QPID_SERIALIZER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/SessionId.cpp b/M4-RCs/qpid/cpp/src/qpid/SessionId.cpp
deleted file mode 100644
index fce6619f5d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/SessionId.cpp
+++ /dev/null
@@ -1,47 +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 "SessionId.h"
-#include <sstream>
-
-namespace qpid {
-
-SessionId::SessionId(const std::string& u, const std::string& n) : userId(u), name(n) {}
-
-bool SessionId::operator<(const SessionId& id) const {
- return userId < id.userId || (userId == id.userId && name < id.name);
-}
-
-bool SessionId::operator==(const SessionId& id) const {
- return id.name == name && id.userId == userId;
-}
-
-std::ostream& operator<<(std::ostream& o, const SessionId& id) {
- return o << id.getName() << "@" << id.getUserId();
-}
-
-std::string SessionId::str() const {
- std::ostringstream o;
- o << *this;
- return o.str();
-}
-
-} // namespace qpid
diff --git a/M4-RCs/qpid/cpp/src/qpid/SessionId.h b/M4-RCs/qpid/cpp/src/qpid/SessionId.h
deleted file mode 100644
index 291c42a2bb..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/SessionId.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef QPID_SESSIONID_H
-#define QPID_SESSIONID_H
-
-/*
- *
- * 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 <boost/operators.hpp>
-#include <string>
-
-namespace qpid {
-
-/** Identifier for a session.
- * There are two parts to a session identifier:
- *
- * getUserId() returns the authentication principal associated with
- * the session's connection.
- *
- * getName() returns the session name.
- *
- * The name must be unique among sessions with the same authentication
- * principal.
- */
-class SessionId : boost::totally_ordered1<SessionId> {
- std::string userId;
- std::string name;
- public:
- SessionId(const std::string& userId=std::string(), const std::string& name=std::string());
- std::string getUserId() const { return userId; }
- std::string getName() const { return name; }
- bool operator<(const SessionId&) const ;
- bool operator==(const SessionId& id) const;
- // Convert to a string
- std::string str() const;
-};
-
-std::ostream& operator<<(std::ostream&, const SessionId&);
-
-
-} // namespace qpid
-
-#endif /*!QPID_SESSIONID_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/SessionState.cpp b/M4-RCs/qpid/cpp/src/qpid/SessionState.cpp
deleted file mode 100644
index ac75b5c5ff..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/SessionState.cpp
+++ /dev/null
@@ -1,278 +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 "SessionState.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/framing/AMQMethodBody.h"
-#include "qpid/framing/enum.h"
-#include "qpid/log/Statement.h"
-#include <boost/bind.hpp>
-#include <numeric>
-
-namespace qpid {
-using framing::AMQFrame;
-using framing::NotImplementedException;
-using framing::InvalidArgumentException;
-using framing::IllegalStateException;
-using framing::ResourceLimitExceededException;
-using framing::InternalErrorException;
-using framing::FramingErrorException;
-
-namespace {
-bool isControl(const AMQFrame& f) {
- return f.getMethod() && f.getMethod()->type() == framing::SEGMENT_TYPE_CONTROL;
-}
-bool isCommand(const AMQFrame& f) {
- return f.getMethod() && f.getMethod()->type() == framing::SEGMENT_TYPE_COMMAND;
-}
-} // namespace
-
-SessionPoint::SessionPoint(SequenceNumber c, uint64_t o) : command(c), offset(o) {}
-
-// TODO aconway 2008-05-22: Do complete frame sequence validity check here,
-// currently duplicated betwen broker and client session impl.
-//
-void SessionPoint::advance(const AMQFrame& f) {
- if (isControl(f)) return; // Ignore controls.
- if (f.isFirstSegment() && f.isFirstFrame()) {
- if (offset != 0)
- throw FramingErrorException(QPID_MSG("Unexpected command start frame."));
- if (!isCommand(f))
- throw FramingErrorException(
- QPID_MSG("Command start frame has invalid type" << f.getBody()->type()));
- if (f.isLastSegment() && f.isLastFrame())
- ++command; // Single-frame command.
- else
- offset += f.encodedSize();
- }
- else { // continuation frame for partial command
- if (offset == 0)
- throw FramingErrorException(QPID_MSG("Unexpected command continuation frame."));
- if (f.isLastSegment() && f.isLastFrame()) {
- ++command;
- offset = 0;
- }
- else {
- // TODO aconway 2008-04-24: if we go to support for partial
- // command replay, then it may be better to record the unframed
- // data size in a command point rather than the framed size so
- // that the relationship of fragment offsets to the replay
- // list can be computed more easily.
- //
- offset += f.encodedSize();
- }
- }
-}
-
-bool SessionPoint::operator<(const SessionPoint& x) const {
- return command < x.command || (command == x.command && offset < x.offset);
-}
-
-bool SessionPoint::operator==(const SessionPoint& x) const {
- return command == x.command && offset == x.offset;
-}
-
-
-SessionState::SendState::SendState() : unflushedSize(), replaySize(), bytesSinceKnownCompleted() {}
-
-SessionState::ReceiveState::ReceiveState() : bytesSinceKnownCompleted() {}
-
-SessionPoint SessionState::senderGetCommandPoint() { return sender.sendPoint; }
-SequenceSet SessionState::senderGetIncomplete() const { return sender.incomplete; }
-SessionPoint SessionState::senderGetReplayPoint() const { return sender.replayPoint; }
-
-SessionState::ReplayRange SessionState::senderExpected(const SessionPoint& expect) {
- if (expect < sender.replayPoint || sender.sendPoint < expect)
- throw InvalidArgumentException(QPID_MSG(getId() << ": expected command-point out of range."));
- QPID_LOG(debug, getId() << ": sender expected point moved to " << expect);
- ReplayList::iterator i = sender.replayList.begin();
- SessionPoint p = sender.replayPoint;
- while (i != sender.replayList.end() && p.command < expect.command)
- p.advance(*i++);
- assert(p.command == expect.command);
- return boost::make_iterator_range(i, sender.replayList.end());
-}
-
-void SessionState::senderRecord(const AMQFrame& f) {
- if (isControl(f)) return; // Ignore control frames.
- QPID_LOG_IF(debug, f.getMethod(), getId() << ": sent cmd " << sender.sendPoint.command << ": " << *f.getMethod());
- stateful = true;
- if (timeout) sender.replayList.push_back(f);
- sender.unflushedSize += f.encodedSize();
- sender.bytesSinceKnownCompleted += f.encodedSize();
- sender.replaySize += f.encodedSize();
- sender.incomplete += sender.sendPoint.command;
- sender.sendPoint.advance(f);
- if (config.replayHardLimit && config.replayHardLimit < sender.replaySize)
- throw ResourceLimitExceededException("Replay buffer exceeeded hard limit");
-}
-
-static const uint32_t SPONTANEOUS_REQUEST_INTERVAL = 65536;
-
-bool SessionState::senderNeedFlush() const {
- return (sender.sendPoint.command % SPONTANEOUS_REQUEST_INTERVAL == 0) ||
- (config.replayFlushLimit && sender.unflushedSize >= config.replayFlushLimit);
-}
-
-void SessionState::senderRecordFlush() {
- sender.flushPoint = sender.sendPoint;
- sender.unflushedSize = 0;
-}
-
-bool SessionState::senderNeedKnownCompleted() const {
- return config.replayFlushLimit && sender.bytesSinceKnownCompleted >= config.replayFlushLimit;
-}
-
-void SessionState::senderRecordKnownCompleted() {
- sender.bytesSinceKnownCompleted = 0;
-}
-
-void SessionState::senderConfirmed(const SessionPoint& confirmed) {
- if (confirmed > sender.sendPoint)
- throw InvalidArgumentException(QPID_MSG(getId() << ": confirmed < " << confirmed << " but only sent < " << sender.sendPoint));
- QPID_LOG(debug, getId() << ": sender confirmed point moved to " << confirmed);
- ReplayList::iterator i = sender.replayList.begin();
- while (i != sender.replayList.end() && sender.replayPoint.command < confirmed.command) {
- sender.replayPoint.advance(*i);
- assert(sender.replayPoint <= sender.sendPoint);
- sender.replaySize -= i->encodedSize();
- if (sender.replayPoint > sender.flushPoint)
- sender.unflushedSize -= i->encodedSize();
- ++i;
- }
- if (sender.replayPoint > sender.flushPoint)
- sender.flushPoint = sender.replayPoint;
- sender.replayList.erase(sender.replayList.begin(), i);
- assert(sender.replayPoint.offset == 0);
-}
-
-void SessionState::senderCompleted(const SequenceSet& commands) {
- if (commands.empty()) return;
- QPID_LOG(debug, getId() << ": sender marked completed: " << commands);
- sender.incomplete -= commands;
- // Completion implies confirmation but we don't handle out-of-order
- // confirmation, so confirm up to the end of the first contiguous range of commands.
- senderConfirmed(SessionPoint(commands.rangesBegin()->end()));
-}
-
-void SessionState::receiverSetCommandPoint(const SessionPoint& point) {
- if (hasState() && point > receiver.received)
- throw InvalidArgumentException(QPID_MSG(getId() << ": Command-point out of range."));
- QPID_LOG(debug, getId() << ": receiver command-point set to: " << point);
- receiver.expected = point;
- if (receiver.expected > receiver.received)
- receiver.received = receiver.expected;
-}
-
-bool SessionState::receiverRecord(const AMQFrame& f) {
- if (isControl(f)) return true; // Ignore control frames.
- stateful = true;
- receiver.expected.advance(f);
- receiver.bytesSinceKnownCompleted += f.encodedSize();
- bool firstTime = receiver.expected > receiver.received;
- if (firstTime) {
- receiver.received = receiver.expected;
- receiver.incomplete += receiverGetCurrent();
- }
- QPID_LOG_IF(debug, f.getMethod(), getId() << ": recv cmd " << receiverGetCurrent() << ": " << *f.getMethod());
- QPID_LOG_IF(debug, !firstTime, "Ignoring duplicate frame: " << receiverGetCurrent() << ": " << f);
- return firstTime;
-}
-
-void SessionState::receiverCompleted(SequenceNumber command, bool cumulative) {
- assert(receiver.incomplete.contains(command)); // Internal error to complete command twice.
- SequenceNumber first =cumulative ? receiver.incomplete.front() : command;
- SequenceNumber last = command;
- receiver.unknownCompleted.add(first, last);
- receiver.incomplete.remove(first, last);
- QPID_LOG(debug, getId() << ": receiver marked completed: " << command
- << " incomplete: " << receiver.incomplete
- << " unknown-completed: " << receiver.unknownCompleted);
-}
-
-void SessionState::receiverKnownCompleted(const SequenceSet& commands) {
- if (!commands.empty() && commands.back() > receiver.received.command)
- throw InvalidArgumentException(QPID_MSG(getId() << ": Known-completed has invalid commands."));
- receiver.bytesSinceKnownCompleted=0;
- receiver.unknownCompleted -= commands;
- QPID_LOG(debug, getId() << ": receiver known completed: " << commands << " unknown: " << receiver.unknownCompleted);
-}
-
-bool SessionState::receiverNeedKnownCompleted() const {
- return (receiver.expected.command % SPONTANEOUS_REQUEST_INTERVAL == 0) ||
- (config.replayFlushLimit && receiver.bytesSinceKnownCompleted >= config.replayFlushLimit);
-}
-
-const SessionPoint& SessionState::receiverGetExpected() const { return receiver.expected; }
-const SessionPoint& SessionState::receiverGetReceived() const { return receiver.received; }
-const SequenceSet& SessionState::receiverGetUnknownComplete() const { return receiver.unknownCompleted; }
-const SequenceSet& SessionState::receiverGetIncomplete() const { return receiver.incomplete; }
-
-SequenceNumber SessionState::receiverGetCurrent() const {
- SequenceNumber current = receiver.expected.command;
- if (receiver.expected.offset == 0)
- --current;
- return current;
-}
-
-SessionState::Configuration::Configuration(size_t flush, size_t hard) :
- replayFlushLimit(flush), replayHardLimit(hard) {}
-
-SessionState::SessionState(const SessionId& i, const Configuration& c)
- : id(i), timeout(), config(c), stateful()
-{
- QPID_LOG(debug, "SessionState::SessionState " << id << ": " << this);
-}
-
-bool SessionState::hasState() const { return stateful; }
-
-SessionState::~SessionState() {}
-
-std::ostream& operator<<(std::ostream& o, const SessionPoint& p) {
- return o << "(" << p.command.getValue() << "+" << p.offset << ")";
-}
-
-void SessionState::setState(
- const SequenceNumber& replayStart,
- const SequenceNumber& sendCommandPoint,
- const SequenceSet& sentIncomplete,
- const SequenceNumber& expected,
- const SequenceNumber& received,
- const SequenceSet& unknownCompleted,
- const SequenceSet& receivedIncomplete
-)
-{
- sender.replayPoint = replayStart;
- sender.flushPoint = sendCommandPoint;
- sender.sendPoint = sendCommandPoint;
- sender.unflushedSize = 0;
- sender.replaySize = 0; // Replay list will be updated separately.
- sender.incomplete = sentIncomplete;
- sender.bytesSinceKnownCompleted = 0;
-
- receiver.expected = expected;
- receiver.received = received;
- receiver.unknownCompleted = unknownCompleted;
- receiver.incomplete = receivedIncomplete;
- receiver.bytesSinceKnownCompleted = 0;
-}
-
-} // namespace qpid
diff --git a/M4-RCs/qpid/cpp/src/qpid/SessionState.h b/M4-RCs/qpid/cpp/src/qpid/SessionState.h
deleted file mode 100644
index bf4ff6d326..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/SessionState.h
+++ /dev/null
@@ -1,219 +0,0 @@
-#ifndef QPID_SESSIONSTATE_H
-#define QPID_SESSIONSTATE_H
-
-/*
- *
- * 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 <qpid/SessionId.h>
-#include <qpid/framing/SequenceNumber.h>
-#include <qpid/framing/SequenceSet.h>
-#include <qpid/framing/AMQFrame.h>
-#include <qpid/framing/FrameHandler.h>
-#include <boost/operators.hpp>
-#include <boost/range/iterator_range.hpp>
-#include <vector>
-#include <iosfwd>
-
-namespace qpid {
-using framing::SequenceNumber;
-using framing::SequenceSet;
-
-/** A point in the session. Points to command id + offset */
-struct SessionPoint : boost::totally_ordered1<SessionPoint> {
- SessionPoint(SequenceNumber command = 0, uint64_t offset = 0);
-
- SequenceNumber command;
- uint64_t offset;
-
- /** Advance past frame f */
- void advance(const framing::AMQFrame& f);
-
- bool operator<(const SessionPoint&) const;
- bool operator==(const SessionPoint&) const;
-};
-
-std::ostream& operator<<(std::ostream&, const SessionPoint&);
-
-/**
- * Support for session idempotence barrier and resume as defined in
- * AMQP 0-10.
- *
- * We only issue/use contiguous confirmations, out-of-order confirmation
- * is ignored. Out of order completion is fully supported.
- *
- * Raises NotImplemented if the command point is set greater than the
- * max currently received command data, either explicitly via
- * session.command-point or implicitly via session.gap.
- *
- * Partial replay is not supported, replay always begins on a command
- * boundary, and we never confirm partial commands.
- *
- * The SessionPoint data structure does store offsets so this class
- * could be extended to support partial replay without
- * source-incompatbile API changes.
- */
-class SessionState {
- typedef std::vector<framing::AMQFrame> ReplayList;
-
- public:
-
- typedef boost::iterator_range<ReplayList::iterator> ReplayRange;
-
- struct Configuration {
- Configuration(size_t flush=1024*1024, size_t hard=0);
- size_t replayFlushLimit; // Flush when the replay list >= N bytes. 0 disables.
- size_t replayHardLimit; // Kill session if replay list > N bytes. 0 disables.
- };
-
- SessionState(const SessionId& =SessionId(), const Configuration& =Configuration());
-
- virtual ~SessionState();
-
- bool hasState() const;
-
- const SessionId& getId() const { return id; }
-
- uint32_t getTimeout() const { return timeout; }
- void setTimeout(uint32_t seconds) { timeout = seconds; }
-
- bool operator==(const SessionId& other) const { return id == other; }
- bool operator==(const SessionState& other) const { return id == other.id; }
-
- // ==== Functions for sender state.
-
- /** Record frame f for replay. Should not be called during replay. */
- virtual void senderRecord(const framing::AMQFrame& f);
-
- /** @return true if we should send flush for confirmed and completed commands. */
- virtual bool senderNeedFlush() const;
-
- /** Called when flush for confirmed and completed commands is sent to peer. */
- virtual void senderRecordFlush();
-
- /** True if we should reply to the next incoming completed command */
- virtual bool senderNeedKnownCompleted() const;
-
- /** Called when knownCompleted is sent to peer. */
- virtual void senderRecordKnownCompleted();
-
- /** Called when the peer confirms up to comfirmed. */
- virtual void senderConfirmed(const SessionPoint& confirmed);
-
- /** Called when the peer indicates commands completed */
- virtual void senderCompleted(const SequenceSet& commands);
-
- /** Point from which the next new (not replayed) data will be sent. */
- virtual SessionPoint senderGetCommandPoint();
-
- /** Set of outstanding incomplete commands */
- virtual SequenceSet senderGetIncomplete() const;
-
- /** Point from which we can replay. */
- virtual SessionPoint senderGetReplayPoint() const;
-
- /** Peer expecting commands from this point.
- *@return Range of frames to be replayed.
- */
- virtual ReplayRange senderExpected(const SessionPoint& expected);
-
- // ==== Functions for receiver state
-
- /** Set the command point. */
- virtual void receiverSetCommandPoint(const SessionPoint& point);
-
- /** Returns true if frame should be be processed, false if it is a duplicate. */
- virtual bool receiverRecord(const framing::AMQFrame& f);
-
- /** Command completed locally */
- virtual void receiverCompleted(SequenceNumber command, bool cumulative=false);
-
- /** Peer has indicated commands are known completed */
- virtual void receiverKnownCompleted(const SequenceSet& commands);
-
- /** True if the next completed control should set the timely-reply argument
- * to request a knonw-completed response.
- */
- virtual bool receiverNeedKnownCompleted() const;
-
- /** Get the incoming command point */
- virtual const SessionPoint& receiverGetExpected() const;
-
- /** Get the received high-water-mark, may be > getExpected() during replay */
- virtual const SessionPoint& receiverGetReceived() const;
-
- /** Completed received commands that the peer may not know about. */
- virtual const SequenceSet& receiverGetUnknownComplete() const;
-
- /** Incomplete received commands. */
- virtual const SequenceSet& receiverGetIncomplete() const;
-
- /** ID of the command currently being handled. */
- virtual SequenceNumber receiverGetCurrent() const;
-
- /** Set the state variables, used to create a session that will resume
- * from some previously established point.
- */
- virtual void setState(
- const SequenceNumber& replayStart,
- const SequenceNumber& sendCommandPoint,
- const SequenceSet& sentIncomplete,
- const SequenceNumber& expected,
- const SequenceNumber& received,
- const SequenceSet& unknownCompleted,
- const SequenceSet& receivedIncomplete
- );
-
- private:
-
- struct SendState {
- SendState();
- // invariant: replayPoint <= flushPoint <= sendPoint
- SessionPoint replayPoint; // Can replay from this point
- SessionPoint flushPoint; // Point of last flush
- SessionPoint sendPoint; // Send from this point
- ReplayList replayList; // Starts from replayPoint.
- size_t unflushedSize; // Un-flushed bytes in replay list.
- size_t replaySize; // Total bytes in replay list.
- SequenceSet incomplete; // Commands sent and not yet completed.
- size_t bytesSinceKnownCompleted; // Bytes sent since we last issued a knownCompleted.
- } sender;
-
- struct ReceiveState {
- ReceiveState();
- SessionPoint expected; // Expected from here
- SessionPoint received; // Received to here. Invariant: expected <= received.
- SequenceSet unknownCompleted; // Received & completed, may not not known-complete by peer.
- SequenceSet incomplete; // Incomplete received commands.
- size_t bytesSinceKnownCompleted; // Bytes sent since we last issued a knownCompleted.
- } receiver;
-
- SessionId id;
- uint32_t timeout;
- Configuration config;
- bool stateful;
-};
-
-inline bool operator==(const SessionId& id, const SessionState& s) { return s == id; }
-
-} // namespace qpid
-
-
-#endif /*!QPID_SESSIONSTATE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/SharedObject.h b/M4-RCs/qpid/cpp/src/qpid/SharedObject.h
deleted file mode 100644
index 852a036ab9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/SharedObject.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef _SharedObject_
-#define _SharedObject_
-
-/*
- *
- * 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 <boost/shared_ptr.hpp>
-#include <boost/noncopyable.hpp>
-
-namespace qpid {
- /**
- * Template to enforce shared object conventions.
- * Shared object classes should inherit : public qpid::SharedObject
- * That ensures Foo:
- * - has typedef boost::shared_ptr<T> shared_ptr
- * - has virtual destructor
- * - is boost::noncopyable (no default copy or assign)
- * - has a protected default constructor.
- *
- * Shared objects should not have public constructors.
- * Make constructors protected and provide public statc create()
- * functions that return a shared_ptr.
- */
- template <class T>
- class SharedObject : private boost::noncopyable
- {
- public:
- typedef boost::shared_ptr<T> shared_ptr;
-
- virtual ~SharedObject() {};
-
- protected:
- SharedObject() {}
- };
-}
-
-#endif /*!_SharedObject_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/StringUtils.cpp b/M4-RCs/qpid/cpp/src/qpid/StringUtils.cpp
deleted file mode 100644
index 17eb141e12..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/StringUtils.cpp
+++ /dev/null
@@ -1,50 +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 "StringUtils.h"
-
-namespace qpid {
-
-using std::string;
-using std::vector;
-
-void split(vector<string>& out, const string& in, const string& delims)
-{
- string::size_type start = in.find_first_not_of(delims);
- if (start == string::npos) return;
-
- string::size_type end = in.find_first_of(delims, start);
- while (end != string::npos) {
- out.push_back(in.substr(start, end - start));
- start = in.find_first_not_of(delims, end);
- if (start == string::npos) return;
- end = in.find_first_of(delims, start);
- }
- out.push_back(in.substr(start));
-}
-
-vector<string> split(const string& in, const string& delims)
-{
- vector<string> out;
- split(out, in, delims);
- return out;
-}
-
-} // namespace qpid
diff --git a/M4-RCs/qpid/cpp/src/qpid/StringUtils.h b/M4-RCs/qpid/cpp/src/qpid/StringUtils.h
deleted file mode 100644
index 3120e43334..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/StringUtils.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef QPID_STRINGUTILS_H
-#define QPID_STRINGUTILS_H
-
-/*
- *
- * 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 <string>
-#include <vector>
-
-namespace qpid {
-
-/**
- * Split 'in' into words using delimiters in 'delims' and put
- * resulting strings into 'out' vector.
- */
-void split(std::vector<std::string>& out, const std::string& in, const std::string& delims);
-/**
- * Split 'in' into words using delimiters in 'delims' and return the
- * resulting strings in a vector.
- */
-std::vector<std::string> split(const std::string& in, const std::string& delims);
-
-} // namespace qpid
-
-#endif /*!QPID_STRINGUTILS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/Url.cpp b/M4-RCs/qpid/cpp/src/qpid/Url.cpp
deleted file mode 100644
index f831167dd8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Url.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/Url.h"
-#include "qpid/Exception.h"
-#include "qpid/Msg.h"
-#include "qpid/sys/SystemInfo.h"
-#include "qpid/sys/StrError.h"
-
-#include <boost/lexical_cast.hpp>
-
-#include <algorithm>
-
-#include <string.h>
-
-using namespace std;
-using boost::lexical_cast;
-
-namespace qpid {
-
-Url::Invalid::Invalid(const string& s) : Exception(s) {}
-
-Url Url::getHostNameUrl(uint16_t port) {
- TcpAddress address(std::string(), port);
- if (!sys::SystemInfo::getLocalHostname(address))
- throw Url::Invalid(QPID_MSG("Cannot get host name: " << qpid::sys::strError(errno)));
- return Url(address);
-}
-
-Url Url::getIpAddressesUrl(uint16_t port) {
- Url url;
- sys::SystemInfo::getLocalIpAddresses(port, url);
- return url;
-}
-
-string Url::str() const {
- if (cache.empty() && !this->empty()) {
- ostringstream os;
- os << *this;
- cache = os.str();
- }
- return cache;
-}
-
-ostream& operator<<(ostream& os, const Url& url) {
- Url::const_iterator i = url.begin();
- os << "amqp:";
- if (i!=url.end()) {
- os << *i++;
- while (i != url.end())
- os << "," << *i++;
- }
- return os;
-}
-
-
-/** Simple recursive-descent parser for url grammar in AMQP 0-10 spec:
-
- amqp_url = "amqp:" prot_addr_list
- prot_addr_list = [prot_addr ","]* prot_addr
- prot_addr = tcp_prot_addr | tls_prot_addr
-
- tcp_prot_addr = tcp_id tcp_addr
- tcp_id = "tcp:" | ""
- tcp_addr = [host [":" port] ]
- host = <as per http://www.ietf.org/rfc/rfc3986.txt>
- port = number]]>
-*/
-class UrlParser {
- public:
- UrlParser(Url& u, const char* s) : url(u), text(s), end(s+strlen(s)), i(s) {}
- bool parse() { return literal("amqp:") && list(&UrlParser::protAddr, &UrlParser::comma) && i == end; }
-
- private:
- typedef bool (UrlParser::*Rule)();
-
- bool comma() { return literal(","); }
-
- // NOTE: tcpAddr must be last since it is allowed to omit it's tcp: tag.
- bool protAddr() { return exampleAddr() || tcpAddr(); }
-
- bool tcpAddr() {
- TcpAddress addr;
- literal("tcp:"); // Don't check result, allowed to be absent.
- return addIf(host(addr.host) && (literal(":") ? port(addr.port) : true), addr);
- }
-
- // Placeholder address type till we have multiple address types. Address is a single char.
- bool exampleAddr () {
- if (literal("example:") && i < end) {
- ExampleAddress ex(*i++);
- url.push_back(ex);
- return true;
- }
- return false;
- }
-
- // FIXME aconway 2008-11-20: this does not implement http://www.ietf.org/rfc/rfc3986.txt.
- // Works for DNS names and ipv4 literals but won't handle ipv6.
- bool host(string& h) {
- const char* start=i;
- while (unreserved() || pctEncoded())
- ;
- if (start == i) h = LOCALHOST; // Default
- else h.assign(start, i);
- return true;
- }
-
- bool unreserved() { return (::isalnum(*i) || ::strchr("-._~", *i)) && advance(); }
-
- bool pctEncoded() { return literal("%") && hexDigit() && hexDigit(); }
-
- bool hexDigit() { return i < end && ::strchr("01234567890abcdefABCDEF", *i) && advance(); }
-
- bool port(uint16_t& p) { return decimalInt(p); }
-
- template <class AddrType> bool addIf(bool ok, const AddrType& addr) { if (ok) url.push_back(addr); return ok; }
-
- template <class IntType> bool decimalInt(IntType& n) {
- const char* start = i;
- while (decDigit())
- ;
- try {
- n = lexical_cast<IntType>(string(start, i));
- return true;
- } catch(...) { return false; }
- }
-
- bool decDigit() { return i < end && ::isdigit(*i) && advance(); }
-
- bool literal(const char* s) {
- int n = ::strlen(s);
- if (n <= end-i && equal(s, s+n, i)) return advance(n);
- return false;
- };
-
- bool noop() { return true; }
-
- /** List of item, separated by separator, with min & max bounds. */
- bool list(Rule item, Rule separator, size_t min=0, size_t max=UNLIMITED) {
- assert(max > 0);
- assert(max >= min);
- if (!(this->*item)()) return min == 0; // Empty list.
- size_t n = 1;
- while (n < max && i < end) {
- if (!(this->*separator)()) break;
- if (i == end || !(this->*item)()) return false; // Separator with no item.
- ++n;
- }
- return n >= min;
- }
-
- /** List of items with no separator */
- bool list(Rule item, size_t min=0, size_t max=UNLIMITED) { return list(item, &UrlParser::noop, min, max); }
-
- bool advance(size_t n=1) {
- if (i+n > end) return false;
- i += n;
- return true;
- }
-
- static const size_t UNLIMITED = size_t(~1);
- static const std::string LOCALHOST;
-
- Url& url;
- const char* text;
- const char* end;
- const char* i;
-};
-
-const string UrlParser::LOCALHOST("127.0.0.1");
-
-void Url::parse(const char* url) {
- parseNoThrow(url);
- if (empty())
- throw Url::Invalid(QPID_MSG("Invalid URL: " << url));
-}
-
-void Url::parseNoThrow(const char* url) {
- cache.clear();
- if (!UrlParser(*this, url).parse())
- clear();
-}
-
-void Url::throwIfEmpty() const {
- if (empty())
- throw Url::Invalid("URL contains no addresses");
-}
-
-std::istream& operator>>(std::istream& is, Url& url) {
- std::string s;
- is >> s;
- url.parse(s);
- return is;
-}
-
-} // namespace qpid
diff --git a/M4-RCs/qpid/cpp/src/qpid/Url.h b/M4-RCs/qpid/cpp/src/qpid/Url.h
deleted file mode 100644
index 07ca46e70c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Url.h
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef QPID_URL_H
-#define QPID_URL_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/Address.h"
-#include "qpid/Exception.h"
-#include <string>
-#include <vector>
-#include <new>
-#include <ostream>
-
-namespace qpid {
-
-std::ostream& operator<<(std::ostream& os, const TcpAddress& a);
-
-/** An AMQP URL contains a list of addresses */
-struct Url : public std::vector<Address> {
-
- /** Url with the hostname as returned by gethostname(2) */
- static Url getHostNameUrl(uint16_t port);
-
- /** Url with local IP address(es), may be more than one address
- * on a multi-homed host. */
- static Url getIpAddressesUrl(uint16_t port);
-
- struct Invalid : public Exception { Invalid(const std::string& s); };
-
- /** Convert to string form. */
- std::string str() const;
-
- /** Empty URL. */
- Url() {}
-
- /** URL containing a single address */
- explicit Url(const Address& addr) { push_back(addr); }
-
- /** Parse url, throw Invalid if invalid. */
- explicit Url(const std::string& url) { parse(url.c_str()); }
-
- /** Parse url, throw Invalid if invalid. */
- explicit Url(const char* url) { parse(url); }
-
- Url& operator=(const Url& u) { this->std::vector<Address>::operator=(u); cache=u.cache; return *this; }
- Url& operator=(const char* s) { parse(s); return *this; }
- Url& operator=(const std::string& s) { parse(s); return *this; }
-
- /** Throw Invalid if the URL does not contain any addresses. */
- void throwIfEmpty() const;
-
- /** Replace contents with parsed URL as defined in
- * https://wiki.108.redhat.com/jira/browse/AMQP-95
- *@exception Invalid if the url is invalid.
- */
- void parse(const char* url);
- void parse(const std::string& url) { parse(url.c_str()); }
-
- /** Replace contesnts with parsed URL as defined in
- * https://wiki.108.redhat.com/jira/browse/AMQP-95
- * url.empty() will be true if url is invalid.
- */
- void parseNoThrow(const char* url);
-
- private:
- mutable std::string cache; // cache string form for efficiency.
-};
-
-inline bool operator==(const Url& a, const Url& b) { return a.str()==b.str(); }
-inline bool operator!=(const Url& a, const Url& b) { return a.str()!=b.str(); }
-
-std::ostream& operator<<(std::ostream& os, const Url& url);
-std::istream& operator>>(std::istream& is, Url& url);
-
-} // namespace qpid
-
-#endif /*!QPID_URL_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/Version.h b/M4-RCs/qpid/cpp/src/qpid/Version.h
deleted file mode 100755
index 9bd561b7a9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/Version.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef QPID_VERSION_H
-#define QPID_VERSION_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <string>
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-namespace qpid {
-#ifdef HAVE_CONFIG_H
- const std::string product = PACKAGE_NAME;
- const std::string version = PACKAGE_VERSION;
-# if HAVE_SASL
- const std::string saslName = BROKER_SASL_NAME;
-# else
- const std::string saslName = "qpidd-no-sasl";
-# endif
-#else
- const std::string product = "qpidc";
- const std::string version = "0.3";
- const std::string saslName = "qpid-broker";
-#endif
-}
-
-#endif /*!QPID_VERSION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/acl/Acl.cpp b/M4-RCs/qpid/cpp/src/qpid/acl/Acl.cpp
deleted file mode 100644
index 238ab9df6c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/acl/Acl.cpp
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/acl/Acl.h"
-#include "qpid/acl/AclData.h"
-
-#include "qpid/broker/Broker.h"
-#include "qpid/Plugin.h"
-#include "qpid/Options.h"
-#include "qpid/shared_ptr.h"
-#include "qpid/log/Logger.h"
-#include "qmf/org/apache/qpid/acl/Package.h"
-#include "qmf/org/apache/qpid/acl/EventAllow.h"
-#include "qmf/org/apache/qpid/acl/EventDeny.h"
-#include "qmf/org/apache/qpid/acl/EventFileLoaded.h"
-#include "qmf/org/apache/qpid/acl/EventFileLoadFailed.h"
-
-#include <map>
-
-#include <boost/utility/in_place_factory.hpp>
-
-using namespace std;
-using namespace qpid::acl;
-using qpid::management::ManagementAgent;
-using qpid::management::ManagementObject;
-using qpid::management::Manageable;
-using qpid::management::Args;
-namespace _qmf = qmf::org::apache::qpid::acl;
-
-Acl::Acl (AclValues& av, broker::Broker& b): aclValues(av), broker(&b), transferAcl(false)
-{
-
- agent = ManagementAgent::Singleton::getInstance();
-
- if (agent != 0){
- _qmf::Package packageInit(agent);
- mgmtObject = new _qmf::Acl (agent, this, broker);
- agent->addObject (mgmtObject);
- }
-
- std::string errorString;
- if (!readAclFile(errorString)){
- throw Exception("Could not read ACL file " + errorString);
- if (mgmtObject!=0) mgmtObject->set_enforcingAcl(0);
- }
- QPID_LOG(info, "ACL Plugin loaded");
- if (mgmtObject!=0) mgmtObject->set_enforcingAcl(1);
-}
-
- bool Acl::authorise(const std::string& id, const Action& action, const ObjectType& objType, const std::string& name, std::map<Property, std::string>* params)
- {
- boost::shared_ptr<AclData> dataLocal = data; //rcu copy
-
- // add real ACL check here...
- AclResult aclreslt = dataLocal->lookup(id,action,objType,name,params);
-
-
- return result(aclreslt, id, action, objType, name);
- }
-
- bool Acl::authorise(const std::string& id, const Action& action, const ObjectType& objType, const std::string& ExchangeName, const std::string& RoutingKey)
- {
- boost::shared_ptr<AclData> dataLocal = data; //rcu copy
-
- // only use dataLocal here...
- AclResult aclreslt = dataLocal->lookup(id,action,objType,ExchangeName,RoutingKey);
-
- return result(aclreslt, id, action, objType, ExchangeName);
- }
-
-
- bool Acl::result(const AclResult& aclreslt, const std::string& id, const Action& action, const ObjectType& objType, const std::string& name)
- {
- switch (aclreslt)
- {
- case ALLOWLOG:
- QPID_LOG(info, "ACL Allow id:" << id <<" action:" << AclHelper::getActionStr(action) <<
- " ObjectType:" << AclHelper::getObjectTypeStr(objType) << " Name:" << name );
- agent->raiseEvent(_qmf::EventAllow(id, AclHelper::getActionStr(action),
- AclHelper::getObjectTypeStr(objType),
- name, framing::FieldTable()));
- case ALLOW:
- return true;
- case DENY:
- if (mgmtObject!=0) mgmtObject->inc_aclDenyCount();
- return false;
- case DENYLOG:
- if (mgmtObject!=0) mgmtObject->inc_aclDenyCount();
- default:
- QPID_LOG(info, "ACL Deny id:" << id << " action:" << AclHelper::getActionStr(action) << " ObjectType:" << AclHelper::getObjectTypeStr(objType) << " Name:" << name);
- agent->raiseEvent(_qmf::EventDeny(id, AclHelper::getActionStr(action),
- AclHelper::getObjectTypeStr(objType),
- name, framing::FieldTable()));
- return false;
- }
- return false;
- }
-
- bool Acl::readAclFile(std::string& errorText)
- {
- // only set transferAcl = true if a rule implies the use of ACL on transfer, else keep false for permormance reasons.
- return readAclFile(aclValues.aclFile, errorText);
- }
-
- bool Acl::readAclFile(std::string& aclFile, std::string& errorText) {
- boost::shared_ptr<AclData> d(new AclData);
- AclReader ar;
- if (ar.read(aclFile, d)){
- agent->raiseEvent(_qmf::EventFileLoadFailed("", ar.getError()));
- errorText = ar.getError();
- QPID_LOG(error,ar.getError());
- return false;
- }
-
- data = d;
- transferAcl = data->transferAcl; // any transfer ACL
- if (mgmtObject!=0){
- mgmtObject->set_transferAcl(transferAcl?1:0);
- mgmtObject->set_policyFile(aclFile);
- sys::AbsTime now = sys::AbsTime::now();
- int64_t ns = sys::Duration(now);
- mgmtObject->set_lastAclLoad(ns);
- agent->raiseEvent(_qmf::EventFileLoaded(""));
- }
- return true;
- }
-
- Acl::~Acl(){}
-
- ManagementObject* Acl::GetManagementObject(void) const
- {
- return (ManagementObject*) mgmtObject;
- }
-
- Manageable::status_t Acl::ManagementMethod (uint32_t methodId, Args& /*args*/, string& text)
- {
- Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
- QPID_LOG (debug, "Queue::ManagementMethod [id=" << methodId << "]");
-
- switch (methodId)
- {
- case _qmf::Acl::METHOD_RELOADACLFILE :
- readAclFile(text);
- status = Manageable::STATUS_USER;
- break;
- }
-
- return status;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/acl/Acl.h b/M4-RCs/qpid/cpp/src/qpid/acl/Acl.h
deleted file mode 100644
index 2a522bc56d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/acl/Acl.h
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef QPID_ACL_ACL_H
-#define QPID_ACL_ACL_H
-
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-
-
-#include "qpid/acl/AclReader.h"
-#include "qpid/shared_ptr.h"
-#include "qpid/RefCounted.h"
-#include "qpid/broker/AclModule.h"
-#include "qpid/management/Manageable.h"
-#include "qpid/agent/ManagementAgent.h"
-#include "qmf/org/apache/qpid/acl/Acl.h"
-
-#include <map>
-#include <string>
-
-
-namespace qpid {
-namespace broker {
-class Broker;
-}
-
-namespace acl {
-
-struct AclValues {
- std::string aclFile;
-};
-
-
-class Acl : public broker::AclModule, public RefCounted, public management::Manageable
-{
-
-private:
- acl::AclValues aclValues;
- broker::Broker* broker;
- bool transferAcl;
- boost::shared_ptr<AclData> data;
- qmf::org::apache::qpid::acl::Acl* mgmtObject; // mgnt owns lifecycle
- qpid::management::ManagementAgent* agent;
-
-public:
- Acl (AclValues& av, broker::Broker& b);
-
- void initialize();
-
- inline virtual bool doTransferAcl() {return transferAcl;};
-
- // create specilied authorise methods for cases that need faster matching as needed.
- virtual bool authorise(const std::string& id, const Action& action, const ObjectType& objType, const std::string& name, std::map<Property, std::string>* params=0);
- virtual bool authorise(const std::string& id, const Action& action, const ObjectType& objType, const std::string& ExchangeName,const std::string& RoutingKey);
-
- virtual ~Acl();
-private:
- bool result(const AclResult& aclreslt, const std::string& id, const Action& action, const ObjectType& objType, const std::string& name);
- bool readAclFile(std::string& errorText);
- bool readAclFile(std::string& aclFile, std::string& errorText);
- virtual qpid::management::ManagementObject* GetManagementObject(void) const;
- virtual management::Manageable::status_t ManagementMethod (uint32_t methodId, management::Args& args, std::string& text);
-
-};
-
-
-
-}} // namespace qpid::acl
-
-#endif // QPID_ACL_ACL_H
diff --git a/M4-RCs/qpid/cpp/src/qpid/acl/AclData.cpp b/M4-RCs/qpid/cpp/src/qpid/acl/AclData.cpp
deleted file mode 100644
index d2a55c0027..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/acl/AclData.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/acl/AclData.h"
-#include "qpid/log/Statement.h"
-
-
-namespace qpid {
-namespace acl {
-
-AclData::AclData():decisionMode(qpid::acl::DENY),transferAcl(false)
-{
- for (unsigned int cnt=0; cnt< qpid::acl::ACTIONSIZE; cnt++){
- actionList[cnt]=0;
- }
-
-}
-
-void AclData::clear ()
-{
- for (unsigned int cnt=0; cnt< qpid::acl::ACTIONSIZE; cnt++){
- if (actionList[cnt]){
- for (unsigned int cnt1=0; cnt1< qpid::acl::OBJECTSIZE; cnt1++)
- delete actionList[cnt][cnt1];
- }
- delete[] actionList[cnt];
- }
-
-}
-
-bool AclData::matchProp(const std::string & src, const std::string& src1)
-{
- // allow wildcard on the end of strings...
- if (src.data()[src.size()-1]=='*') {
- return (src.compare(0, src.size()-1, src1, 0,src.size()-1 ) == 0);
- } else {
- return (src.compare(src1)==0) ;
- }
-}
-
-AclResult AclData::lookup(const std::string& id, const Action& action, const ObjectType& objType, const std::string& name, std::map<Property, std::string>* params)
-{
- AclResult aclresult = decisionMode;
-
- if (actionList[action] && actionList[action][objType]){
- AclData::actObjItr itrRule = actionList[action][objType]->find(id);
- if (itrRule == actionList[action][objType]->end())
- itrRule = actionList[action][objType]->find("*");
- if (itrRule != actionList[action][objType]->end() ) {
-
- //loop the vector
- for (ruleSetItr i=itrRule->second.begin(); i<itrRule->second.end(); i++) {
-
- // loop the names looking for match
- bool match =true;
- for (propertyMapItr pMItr = i->props.begin(); (pMItr != i->props.end()) && match; pMItr++)
- {
- //match name is exists first
- if (pMItr->first == acl::PROP_NAME){
- if (!matchProp(pMItr->second, name)){
- match= false;
- }
- }else if (params){ //match pMItr against params
- propertyMapItr paramItr = params->find (pMItr->first);
- if (paramItr == params->end()){
- match = false;
- }else if (!matchProp(paramItr->second, pMItr->second)){
- match = false;
- }
- }
- }
- if (match) return getACLResult(i->logOnly, i->log);
- }
- }
- }
- return aclresult;
-}
-
-AclResult AclData::lookup(const std::string& id, const Action& action, const ObjectType& objType, const std::string& /*Exchange*/ name, const std::string& RoutingKey)
-{
- AclResult aclresult = decisionMode;
-
- if (actionList[action] && actionList[action][objType]){
- AclData::actObjItr itrRule = actionList[action][objType]->find(id);
- if (itrRule == actionList[action][objType]->end())
- itrRule = actionList[action][objType]->find("*");
- if (itrRule != actionList[action][objType]->end() ) {
-
- //loop the vector
- for (ruleSetItr i=itrRule->second.begin(); i<itrRule->second.end(); i++) {
-
- // loop the names looking for match
- bool match =true;
- for (propertyMapItr pMItr = i->props.begin(); (pMItr != i->props.end()) && match; pMItr++)
- {
- //match name is exists first
- if (pMItr->first == acl::PROP_NAME){
- if (!matchProp(pMItr->second, name)){
- match= false;
- }
- }else if (pMItr->first == acl::PROP_ROUTINGKEY){
- if (!matchProp(pMItr->second, RoutingKey)){
- match= false;
- }
- }
- }
- if (match) return getACLResult(i->logOnly, i->log);
- }
- }
- }
- return aclresult;
-
-}
-
-
-AclResult AclData::getACLResult(bool logOnly, bool log)
-{
- switch (decisionMode)
- {
- case qpid::acl::ALLOWLOG:
- case qpid::acl::ALLOW:
- if (logOnly) return qpid::acl::ALLOWLOG;
- if (log)
- return qpid::acl::DENYLOG;
- else
- return qpid::acl::DENY;
-
-
- case qpid::acl::DENYLOG:
- case qpid::acl::DENY:
- if (logOnly) return qpid::acl::DENYLOG;
- if (log)
- return qpid::acl::ALLOWLOG;
- else
- return qpid::acl::ALLOW;
- }
-
- QPID_LOG(error, "ACL Decision Failed, setting DENY");
- return qpid::acl::DENY;
-}
-
-AclData::~AclData()
-{
- clear();
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/acl/AclData.h b/M4-RCs/qpid/cpp/src/qpid/acl/AclData.h
deleted file mode 100644
index 249c3523eb..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/acl/AclData.h
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef QPID_ACL_ACLDATA_H
-#define QPID_ACL_ACLDATA_H
-
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/broker/AclModule.h"
-#include <vector>
-
-
-namespace qpid {
-namespace acl {
-
-class AclData {
-
-
-public:
-
- typedef std::map<qpid::acl::Property, std::string> propertyMap;
- typedef propertyMap::const_iterator propertyMapItr;
- struct rule {
-
- bool log;
- bool logOnly; // this is a rule is to log only
-
- // key value map
- //??
- propertyMap props;
-
-
- rule (propertyMap& p):log(false),logOnly(false),props(p) {};
- };
- typedef std::vector<rule> ruleSet;
- typedef ruleSet::const_iterator ruleSetItr;
- typedef std::map<std::string, ruleSet > actionObject; // user
- typedef actionObject::iterator actObjItr;
- typedef actionObject* aclAction;
-
- // Action*[] -> Object*[] -> map<user -> set<Rule> >
- aclAction* actionList[qpid::acl::ACTIONSIZE];
- qpid::acl::AclResult decisionMode; // determines if the rule set is an deny or accept basis.
- bool transferAcl;
-
- AclResult lookup(const std::string& id, const Action& action, const ObjectType& objType, const std::string& name, std::map<Property, std::string>* params=0);
- AclResult lookup(const std::string& id, const Action& action, const ObjectType& objType, const std::string& ExchangeName, const std::string& RoutingKey);
- AclResult getACLResult(bool logOnly, bool log);
-
- bool matchProp(const std::string & src, const std::string& src1);
- void clear ();
-
- AclData();
- virtual ~AclData();
-};
-
-}} // namespace qpid::acl
-
-#endif // QPID_ACL_ACLDATA_H
diff --git a/M4-RCs/qpid/cpp/src/qpid/acl/AclPlugin.cpp b/M4-RCs/qpid/cpp/src/qpid/acl/AclPlugin.cpp
deleted file mode 100644
index 7310139041..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/acl/AclPlugin.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <sstream>
-#include "qpid/acl/Acl.h"
-#include "qpid/broker/Broker.h"
-#include "qpid/Plugin.h"
-#include "qpid/Options.h"
-#include "qpid/shared_ptr.h"
-#include "qpid/log/Statement.h"
-
-#include <boost/utility/in_place_factory.hpp>
-
-namespace qpid {
-namespace acl {
-
-using namespace std;
-
-/** Note separating options from values to work around boost version differences.
- * Old boost takes a reference to options objects, but new boost makes a copy.
- * New boost allows a shared_ptr but that's not compatible with old boost.
- */
-struct AclOptions : public Options {
- AclValues& values;
-
- AclOptions(AclValues& v) : Options("ACL Options"), values(v) {
- addOptions()
- ("acl-file", optValue(values.aclFile, "FILE"), "The policy file to load from, loaded from data dir");
- }
-};
-
-struct AclPlugin : public Plugin {
-
- AclValues values;
- AclOptions options;
- boost::intrusive_ptr<Acl> acl;
-
- AclPlugin() : options(values) {}
-
- Options* getOptions() { return &options; }
-
- void init(broker::Broker& b) {
- if (values.aclFile.empty()){
- QPID_LOG(info, "Policy file not specified. ACL Disabled, no ACL checking being done!");
- return;
- }
-
- if (acl) throw Exception("ACL plugin cannot be initialized twice in one process.");
-
- if (values.aclFile.at(0) == '/')
- {
- values.aclFile = values.aclFile;
- }
- else
- {
- std::ostringstream oss;
- oss << b.getDataDir().getPath() << "/" << values.aclFile;
- values.aclFile = oss.str();
- }
-
- acl = new Acl(values, b);
- b.setAcl(acl.get());
- b.addFinalizer(boost::bind(&AclPlugin::shutdown, this));
- }
-
- template <class T> bool init(Plugin::Target& target) {
- T* t = dynamic_cast<T*>(&target);
- if (t) init(*t);
- return t;
- }
-
- void earlyInitialize(Plugin::Target&) {}
-
- void initialize(Plugin::Target& target) {
- init<broker::Broker>(target);
- }
-
- void shutdown() { acl = 0; }
-};
-
-static AclPlugin instance; // Static initialization.
-
-// For test purposes.
-boost::intrusive_ptr<Acl> getGlobalAcl() { return instance.acl; }
-
-}} // namespace qpid::acl
diff --git a/M4-RCs/qpid/cpp/src/qpid/acl/AclReader.cpp b/M4-RCs/qpid/cpp/src/qpid/acl/AclReader.cpp
deleted file mode 100644
index c407339390..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/acl/AclReader.cpp
+++ /dev/null
@@ -1,511 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/acl/AclReader.h"
-
-#include <cctype>
-#include <cstring>
-#include <fstream>
-#include <sstream>
-#include "qpid/log/Statement.h"
-#include "qpid/Exception.h"
-
-#include <iomanip> // degug
-#include <iostream> // debug
-
-#define ACL_FORMAT_ERR_LOG_PREFIX "ACL format error: " << fileName << ":" << lineNumber << ": "
-
-namespace qpid {
-namespace acl {
-
-AclReader::aclRule::aclRule(const AclResult r, const std::string n, const groupMap& groups) : res(r), actionAll(true), objStatus(NONE) {
- processName(n, groups);
-}
-AclReader::aclRule::aclRule(const AclResult r, const std::string n, const groupMap& groups, const Action a) : res(r), actionAll(false), action(a), objStatus(NONE) {
- processName(n, groups);
-}
-
-void AclReader::aclRule::setObjectType(const ObjectType o) {
- objStatus = VALUE;
- object = o;
-}
-
-void AclReader::aclRule::setObjectTypeAll() {
- objStatus = ALL;
-}
-
-bool AclReader::aclRule::addProperty(const Property p, const std::string v) {
- return props.insert(propNvPair(p, v)).second;
-}
-
-bool AclReader::aclRule::validate(const AclHelper::objectMapPtr& /*validationMap*/) {
- // TODO - invalid rules won't ever be called in real life...
- return true;
-}
-
-// Debug aid
-std::string AclReader::aclRule::toString() {
- std::ostringstream oss;
- oss << AclHelper::getAclResultStr(res) << " [";
- for (nsCitr itr = names.begin(); itr != names.end(); itr++) {
- if (itr != names.begin()) oss << ", ";
- oss << *itr;
- }
- oss << "]";
- if (actionAll) {
- oss << " *";
- } else {
- oss << " " << AclHelper::getActionStr(action);
- }
- if (objStatus == ALL) {
- oss << " *";
- } else if (objStatus == VALUE) {
- oss << " " << AclHelper::getObjectTypeStr(object);
- }
- for (pmCitr i=props.begin(); i!=props.end(); i++) {
- oss << " " << AclHelper::getPropertyStr(i->first) << "=" << i->second;
- }
- return oss.str();
-}
-
-void AclReader::loadDecisionData( boost::shared_ptr<AclData> d )
-{
- d->clear();
- QPID_LOG(debug, "ACL Load Rules");
- int cnt = rules.size();
- bool foundmode = false;
- for (rlCitr i=rules.end()-1; cnt; i--,cnt--) {
- QPID_LOG(debug, "ACL Processing " << std::setfill(' ') << std::setw(2) << cnt << " " << (*i)->toString());
-
- if (!foundmode && (*i)->actionAll && (*i)->names.size()==1 && (*((*i)->names.begin())).compare("*")==0 ){
- d->decisionMode = (*i)->res;
- QPID_LOG(debug, "ACL FoundMode " << AclHelper::getAclResultStr(d->decisionMode));
- foundmode=true;
- }else{
- AclData::rule rule((*i)->props);
- bool addrule= true;
-
- switch ((*i)->res)
- {
- case qpid::acl::ALLOWLOG:
- rule.log = true;
- if (d->decisionMode == qpid::acl::ALLOW || d->decisionMode == qpid::acl::ALLOWLOG)
- rule.logOnly = true;
- break;
- case qpid::acl::ALLOW:
- if (d->decisionMode == qpid::acl::ALLOW || d->decisionMode == qpid::acl::ALLOWLOG)
- addrule = false;
- break;
- case qpid::acl::DENYLOG:
- rule.log = true;
- if (d->decisionMode == qpid::acl::DENY || d->decisionMode == qpid::acl::DENYLOG)
- rule.logOnly = true;
- break;
- case qpid::acl::DENY:
- if (d->decisionMode == qpid::acl::DENY || d->decisionMode == qpid::acl::DENYLOG)
- addrule = false;
- break;
- default:
- throw Exception("Invalid ACL Result loading rules.");
- }
-
-
- // Action -> Object -> map<user -> set<Rule> >
- if (addrule){
- for (int acnt= ((*i)->actionAll?0:(*i)->action);
- acnt< acl::ACTIONSIZE; (*i)->actionAll?acnt++:acnt=acl::ACTIONSIZE ) {
-
- if (acnt == acl::ACT_PUBLISH) d->transferAcl = true; // we have transfer ACL
-
- QPID_LOG(debug, "ACL Adding action:" << AclHelper::getActionStr((Action)acnt) );
-
- //find the Action, create if not exist
- if (d->actionList[acnt]==NULL) {
- d->actionList[acnt] = new AclData::aclAction[qpid::acl::OBJECTSIZE];
- for (int j=0;j<qpid::acl::OBJECTSIZE; j++)
- d->actionList[acnt][j] = NULL;
- }
-
- // optimize this loop to limit to valid options only!!
- for (int ocnt= ((*i)->objStatus!=aclRule::VALUE ?0:(*i)->object);
- ocnt< acl::OBJECTSIZE;
- (*i)->objStatus!=aclRule::VALUE?ocnt++:ocnt=acl::OBJECTSIZE ) {
-
- QPID_LOG(debug, "ACL Adding object:" << AclHelper::getObjectTypeStr((ObjectType)ocnt) );
-
- //find the Object, create if not exist
- if (d->actionList[acnt][ocnt] == NULL)
- d->actionList[acnt][ocnt] = new AclData::actionObject;
-
- // add users and Rule to object set
- bool allNames=false;
- // check to see if names.begin is '*'
- if ( (*(*i)->names.begin()).compare("*")==0 ) allNames = true;
-
- for (nsCitr itr = (allNames?names.begin():(*i)->names.begin());
- itr != (allNames?names.end():(*i)->names.end()); itr++) {
- AclData::actObjItr itrRule = d->actionList[acnt][ocnt]->find(*itr);
- if (itrRule == d->actionList[acnt][ocnt]->end()) {
- QPID_LOG(debug, "ACL Adding rule & user:" << *itr);
- AclData::ruleSet rSet;
- rSet.push_back(rule);
- d->actionList[acnt][ocnt]->insert(make_pair( std::string(*itr) , rSet) );
- }else{
-
- // TODO add code to check for dead rules
- // allow peter create queue name=tmp <-- dead rule!!
- // allow peter create queue
-
- itrRule->second.push_back(rule);
- QPID_LOG(debug, "ACL Adding rule to user:" << *itr);
- }
- }
-
- }
-
- }
- }else{
- QPID_LOG(debug, "ACL Skipping based on Mode:" << AclHelper::getAclResultStr(d->decisionMode) );
- }
- }
-
- }
-
-
-}
-
-
-
-
-void AclReader::aclRule::processName(const std::string& name, const groupMap& groups) {
- if (name.compare("all") == 0) {
- names.insert("*");
- } else {
- gmCitr itr = groups.find(name);
- if (itr == groups.end()) {
- names.insert(name);
- } else {
- names.insert(itr->second->begin(), itr->second->end());
- }
- }
-}
-
-AclReader::AclReader() : lineNumber(0), contFlag(false), validationMap(new AclHelper::objectMap) {
- AclHelper::loadValidationMap(validationMap);
- names.insert("*");
-}
-
-AclReader::~AclReader() {}
-
-std::string AclReader::getError() {
- return errorStream.str();
-}
-
-int AclReader::read(const std::string& fn, boost::shared_ptr<AclData> d) {
- fileName = fn;
- lineNumber = 0;
- char buff[1024];
- std::ifstream ifs(fn.c_str(), std::ios_base::in);
- if (!ifs.good()) {
- errorStream << "Unable to open ACL file \"" << fn << "\": eof=" << (ifs.eof()?"T":"F") << "; fail=" << (ifs.fail()?"T":"F") << "; bad=" << (ifs.bad()?"T":"F");
- return -1;
- }
- try {
- bool err = false;
- while (ifs.good()) {
- ifs.getline(buff, 1024);
- lineNumber++;
- if (std::strlen(buff) > 0 && buff[0] != '#') // Ignore blank lines and comments
- err |= !processLine(buff);
- }
- if (!ifs.eof())
- {
- errorStream << "Unable to read ACL file \"" << fn << "\": eof=" << (ifs.eof()?"T":"F") << "; fail=" << (ifs.fail()?"T":"F") << "; bad=" << (ifs.bad()?"T":"F");
- ifs.close();
- return -2;
- }
- ifs.close();
- if (err) return -3;
- QPID_LOG(notice, "Read ACL file \"" << fn << "\"");
- } catch (const std::exception& e) {
- errorStream << "Unable to read ACL file \"" << fn << "\": " << e.what();
- ifs.close();
- return -4;
- } catch (...) {
- errorStream << "Unable to read ACL file \"" << fn << "\": Unknown exception";
- ifs.close();
- return -5;
- }
- printNames();
- printRules();
- loadDecisionData(d);
-
- return 0;
-}
-
-bool AclReader::processLine(char* line) {
- bool ret = false;
- std::vector<std::string> toks;
-
- // Check for continuation
- char* contCharPtr = std::strrchr(line, '\\');
- bool cont = contCharPtr != 0;
- if (cont) *contCharPtr = 0;
-
- int numToks = tokenize(line, toks);
- if (numToks && (toks[0].compare("group") == 0 || contFlag)) {
- ret = processGroupLine(toks, cont);
- } else if (numToks && toks[0].compare("acl") == 0) {
- ret = processAclLine(toks);
- } else {
- // Check for whitespace only line, ignore these
- bool ws = true;
- for (unsigned i=0; i<std::strlen(line) && ws; i++) {
- if (!std::isspace(line[i])) ws = false;
- }
- if (ws) {
- ret = true;
- } else {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Non-continuation line must start with \"group\" or \"acl\".";
- ret = false;
- }
- }
- contFlag = cont;
- return ret;
-}
-
-int AclReader::tokenize(char* line, std::vector<std::string>& toks) {
- const char* tokChars = " \t\n\f\v\r";
- int cnt = 0;
- char* cp = std::strtok(line, tokChars);
- while (cp != 0) {
- toks.push_back(std::string(cp));
- cnt++;
- cp = std::strtok(0, tokChars);
- }
- return cnt;
-}
-
-// Return true if the line is successfully processed without errors
-// If cont is true, then groupName must be set to the continuation group name
-bool AclReader::processGroupLine(tokList& toks, const bool cont) {
- const unsigned toksSize = toks.size();
- if (contFlag) {
- gmCitr citr = groups.find(groupName);
- for (unsigned i = 0; i < toksSize; i++) {
- if (!checkName(toks[i])) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Name \"" << toks[i] << "\" contains illegal characters.";
- return false;
- }
- addName(toks[i], citr->second);
- }
- } else {
- if (toksSize < (cont ? 2 : 3)) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Insufficient tokens for group definition.";
- return false;
- }
- if (!checkName(toks[1])) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Group name \"" << toks[1] << "\" contains illegal characters.";
- return false;
- }
- gmCitr citr = addGroup(toks[1]);
- if (citr == groups.end()) return false;
- for (unsigned i = 2; i < toksSize; i++) {
- if (!checkName(toks[i])) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Name \"" << toks[i] << "\" contains illegal characters.";
- return false;
- }
- addName(toks[i], citr->second);
- }
- }
- return true;
-}
-
-// Return true if sucessfully added group
-AclReader::gmCitr AclReader::addGroup(const std::string& newGroupName) {
- gmCitr citr = groups.find(newGroupName);
- if (citr != groups.end()) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Duplicate group name \"" << newGroupName << "\".";
- return groups.end();
- }
- groupPair p(newGroupName, nameSetPtr(new nameSet));
- gmRes res = groups.insert(p);
- assert(res.second);
- groupName = newGroupName;
- return res.first;
-}
-
-void AclReader::addName(const std::string& name, nameSetPtr groupNameSet) {
- gmCitr citr = groups.find(name);
- if (citr != groups.end() && citr->first != name){
- // This is a previously defined group: add all the names in that group to this group
- groupNameSet->insert(citr->second->begin(), citr->second->end());
- } else {
- // Not a known group name
- groupNameSet->insert(name);
- addName(name);
- }
-}
-
-void AclReader::addName(const std::string& name) {
- names.insert(name);
-}
-
-// Debug aid
-void AclReader::printNames() const {
- QPID_LOG(debug, "Group list: " << groups.size() << " groups found:" );
- std::string tmp;
- for (gmCitr i=groups.begin(); i!= groups.end(); i++) {
- tmp += " \"";
- tmp += i->first;
- tmp += "\":";
- for (nsCitr j=i->second->begin(); j!=i->second->end(); j++) {
- tmp += " ";
- tmp += *j;
- }
- QPID_LOG(debug, tmp);
- tmp.clear();
- }
- QPID_LOG(debug, "Name list: " << names.size() << " names found:" );
- tmp.clear();
- for (nsCitr k=names.begin(); k!=names.end(); k++) {
- tmp += " ";
- tmp += *k;
- }
- QPID_LOG(debug, tmp);
-}
-
-bool AclReader::processAclLine(tokList& toks) {
- const unsigned toksSize = toks.size();
- if (toksSize < 4) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Insufficient tokens for acl definition.";
- return false;
- }
-
- AclResult res;
- try {
- res = AclHelper::getAclResult(toks[1]);
- } catch (...) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Unknown ACL permission \"" << toks[1] << "\".";
- return false;
- }
-
- bool actionAllFlag = toks[3].compare("all") == 0;
- bool userAllFlag = toks[2].compare("all") == 0;
- Action action;
- if (actionAllFlag) {
-
- if (userAllFlag && toksSize > 4) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Tokens found after action \"all\".";
- return false;
- }
- action = ACT_CONSUME; // dummy; compiler must initialize action for this code path
- } else {
- try {
- action = AclHelper::getAction(toks[3]);
- } catch (...) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Unknown action \"" << toks[3] << "\".";
- return false;
- }
- }
-
- // Create rule obj; then add object (if any) and properties (if any)
- aclRulePtr rule;
- if (actionAllFlag) {
- rule.reset(new aclRule(res, toks[2], groups));
- } else {
- rule.reset(new aclRule(res, toks[2], groups, action));
- }
-
- if (toksSize >= 5) { // object name-value pair
- if (toks[4].compare("all") == 0) {
- rule->setObjectTypeAll();
- } else {
- try {
- rule->setObjectType(AclHelper::getObjectType(toks[4]));
- } catch (...) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Unknown object \"" << toks[4] << "\".";
- return false;
- }
- }
- }
-
- if (toksSize >= 6) { // property name-value pair(s)
- for (unsigned i=5; i<toksSize; i++) {
- nvPair propNvp = splitNameValuePair(toks[i]);
- if (propNvp.second.size() == 0) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Badly formed property name-value pair \"" << propNvp.first << "\". (Must be name=value)";
- return false;
- }
- Property prop;
- try {
- prop = AclHelper::getProperty(propNvp.first);
- } catch (...) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Unknown property \"" << propNvp.first << "\".";
- return false;
- }
- rule->addProperty(prop, propNvp.second);
- }
- }
- // Check if name (toks[2]) is group; if not, add as name of individual
- if (toks[2].compare("all") != 0) {
- if (groups.find(toks[2]) == groups.end()) {
- addName(toks[2]);
- }
- }
-
- // If rule validates, add to rule list
- if (!rule->validate(validationMap)) {
- errorStream << ACL_FORMAT_ERR_LOG_PREFIX << "Invalid object/action/property combination.";
- return false;
- }
- rules.push_back(rule);
-
- return true;
-}
-
-// Debug aid
-void AclReader::printRules() const {
- QPID_LOG(debug, "Rule list: " << rules.size() << " ACL rules found:");
- int cnt = 0;
- for (rlCitr i=rules.begin(); i<rules.end(); i++,cnt++) {
- QPID_LOG(debug, " " << std::setfill(' ') << std::setw(2) << cnt << " " << (*i)->toString());
- }
-}
-
-// Static function
-// Return true if the name is well-formed (ie contains legal characters)
-bool AclReader::checkName(const std::string& name) {
- for (unsigned i=0; i<name.size(); i++) {
- const char ch = name.at(i);
- if (!std::isalnum(ch) && ch != '-' && ch != '_' && ch != '@') return false;
- }
- return true;
-}
-
-// Static function
-// Split name-value pair around '=' char of the form "name=value"
-AclReader::nvPair AclReader::splitNameValuePair(const std::string& nvpString) {
- std::size_t pos = nvpString.find("=");
- if (pos == std::string::npos || pos == nvpString.size() - 1) {
- return nvPair(nvpString, "");
- }
- return nvPair(nvpString.substr(0, pos), nvpString.substr(pos+1));
-}
-
-}} // namespace qpid::acl
diff --git a/M4-RCs/qpid/cpp/src/qpid/acl/AclReader.h b/M4-RCs/qpid/cpp/src/qpid/acl/AclReader.h
deleted file mode 100644
index d85dbeef6b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/acl/AclReader.h
+++ /dev/null
@@ -1,117 +0,0 @@
-#ifndef QPID_ACL_ACLREADER_H
-#define QPID_ACL_ACLREADER_H
-
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <boost/shared_ptr.hpp>
-#include <map>
-#include <set>
-#include <string>
-#include <vector>
-#include <sstream>
-#include "qpid/acl/AclData.h"
-#include "qpid/broker/AclModule.h"
-
-namespace qpid {
-namespace acl {
-
-class AclReader {
- typedef std::set<std::string> nameSet;
- typedef nameSet::const_iterator nsCitr;
- typedef boost::shared_ptr<nameSet> nameSetPtr;
-
- typedef std::pair<std::string, nameSetPtr> groupPair;
- typedef std::map<std::string, nameSetPtr> groupMap;
- typedef groupMap::const_iterator gmCitr;
- typedef std::pair<gmCitr, bool> gmRes;
-
- typedef std::pair<Property, std::string> propNvPair;
- typedef std::map<Property, std::string> propMap;
- typedef propMap::const_iterator pmCitr;
-
- class aclRule {
- public:
- enum objectStatus {NONE, VALUE, ALL};
- AclResult res;
- nameSet names;
- bool actionAll; // True if action is set to keyword "all"
- Action action; // Ignored if action is set to keyword "all"
- objectStatus objStatus;
- ObjectType object; // Ignored for all status values except VALUE
- propMap props;
- public:
- aclRule(const AclResult r, const std::string n, const groupMap& groups); // action = "all"
- aclRule(const AclResult r, const std::string n, const groupMap& groups, const Action a);
- void setObjectType(const ObjectType o);
- void setObjectTypeAll();
- bool addProperty(const Property p, const std::string v);
- bool validate(const AclHelper::objectMapPtr& validationMap);
- std::string toString(); // debug aid
- private:
- void processName(const std::string& name, const groupMap& groups);
- };
- typedef boost::shared_ptr<aclRule> aclRulePtr;
- typedef std::vector<aclRulePtr> ruleList;
- typedef ruleList::const_iterator rlCitr;
-
- typedef std::vector<std::string> tokList;
- typedef tokList::const_iterator tlCitr;
-
- typedef std::set<std::string> keywordSet;
- typedef keywordSet::const_iterator ksCitr;
- typedef std::pair<std::string, std::string> nvPair; // Name-Value pair
-
- std::string fileName;
- int lineNumber;
- bool contFlag;
- std::string groupName;
- nameSet names;
- groupMap groups;
- ruleList rules;
- AclHelper::objectMapPtr validationMap;
- std::ostringstream errorStream;
-
- public:
- AclReader();
- virtual ~AclReader();
- int read(const std::string& fn, boost::shared_ptr<AclData> d);
- std::string getError();
-
- private:
- bool processLine(char* line);
- void loadDecisionData( boost::shared_ptr<AclData> d);
- int tokenize(char* line, tokList& toks);
-
- bool processGroupLine(tokList& toks, const bool cont);
- gmCitr addGroup(const std::string& groupName);
- void addName(const std::string& name, nameSetPtr groupNameSet);
- void addName(const std::string& name);
- void printNames() const; // debug aid
-
- bool processAclLine(tokList& toks);
- void printRules() const; // debug aid
-
- static bool checkName(const std::string& name);
- static nvPair splitNameValuePair(const std::string& nvpString);
-};
-
-}} // namespace qpid::acl
-
-#endif // QPID_ACL_ACLREADER_H
diff --git a/M4-RCs/qpid/cpp/src/qpid/acl/management-schema.xml b/M4-RCs/qpid/cpp/src/qpid/acl/management-schema.xml
deleted file mode 100644
index f4637253d0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/acl/management-schema.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<schema package="org.apache.qpid.acl">
-
-<!--
- * Copyright (c) 2008 The Apache Software Foundation
- *
- * 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.
--->
-
- <class name="Acl">
- <property name="brokerRef" type="objId" references="org.apache.qpid.broker:Broker" access="RO" index="y" parentRef="y"/>
- <property name="policyFile" type="sstr" access="RO" desc="Name of the policy file"/>
- <property name="enforcingAcl" type="bool" access="RO" desc="Currently Enforcing ACL"/>
- <property name="transferAcl" type="bool" access="RO" desc="Any transfer ACL rules in force"/>
- <property name="lastAclLoad" type="absTime" access="RO" desc="Timestamp of last successful load of ACL"/>
- <statistic name="aclDenyCount" type="count64" unit="request" desc="Number of ACL requests denied"/>
-
- <method name="reloadACLFile" desc="Reload the ACL file"/>
- </class>
-
- <eventArguments>
- <arg name="action" type="sstr"/>
- <arg name="arguments" type="map"/>
- <arg name="objectName" type="sstr"/>
- <arg name="objectType" type="sstr"/>
- <arg name="reason" type="sstr"/>
- <arg name="userId" type="sstr"/>
- </eventArguments>
-
- <event name="allow" sev="inform" args="userId, action, objectType, objectName, arguments"/>
- <event name="deny" sev="notice" args="userId, action, objectType, objectName, arguments"/>
- <event name="fileLoaded" sev="inform" args="userId"/>
- <event name="fileLoadFailed" sev="error" args="userId, reason"/>
-
-</schema>
diff --git a/M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgent.h b/M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgent.h
deleted file mode 100644
index c94291c9e7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgent.h
+++ /dev/null
@@ -1,162 +0,0 @@
-#ifndef _qpid_agent_ManagementAgent_
-#define _qpid_agent_ManagementAgent_
-
-//
-// 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 "qpid/management/ManagementObject.h"
-#include "qpid/management/ManagementEvent.h"
-#include "qpid/management/Manageable.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/client/ConnectionSettings.h"
-
-namespace qpid {
-namespace management {
-
-class ManagementAgent
-{
- public:
-
- class Singleton {
- public:
- Singleton(bool disableManagement = false);
- ~Singleton();
- static ManagementAgent* getInstance();
- private:
- static sys::Mutex lock;
- static bool disabled;
- static int refCount;
- static ManagementAgent* agent;
- };
-
- typedef enum {
- SEV_EMERG = 0,
- SEV_ALERT = 1,
- SEV_CRIT = 2,
- SEV_ERROR = 3,
- SEV_WARN = 4,
- SEV_NOTE = 5,
- SEV_INFO = 6,
- SEV_DEBUG = 7,
- SEV_DEFAULT = 8
- } severity_t;
-
- ManagementAgent() {}
- virtual ~ManagementAgent() {}
-
- virtual int getMaxThreads() = 0;
-
- // Connect to a management broker
- //
- // brokerHost - Hostname or IP address (dotted-quad) of broker.
- //
- // brokerPort - TCP port of broker.
- //
- // intervalSeconds - The interval (in seconds) that this agent shall use
- // between broadcast updates to the broker.
- //
- // useExternalThread - If true, the thread of control used for callbacks
- // must be supplied by the user of the object (via the
- // pollCallbacks method).
- //
- // If false, callbacks shall be invoked on the management
- // agent's thread. In this case, the callback implementations
- // MUST be thread safe.
- //
- // storeFile - File where this process has read and write access. This
- // file shall be used to store persistent state.
- //
- virtual void init(const std::string& brokerHost = "localhost",
- uint16_t brokerPort = 5672,
- uint16_t intervalSeconds = 10,
- bool useExternalThread = false,
- const std::string& storeFile = "",
- const std::string& uid = "guest",
- const std::string& pwd = "guest",
- const std::string& mech = "PLAIN",
- const std::string& proto = "tcp") = 0;
-
- virtual void init(const client::ConnectionSettings& settings,
- uint16_t intervalSeconds = 10,
- bool useExternalThread = false,
- const std::string& storeFile = "") = 0;
-
- // Register a schema with the management agent. This is normally called by the
- // package initializer generated by the management code generator.
- //
- virtual void
- registerClass(const std::string& packageName,
- const std::string& className,
- uint8_t* md5Sum,
- management::ManagementObject::writeSchemaCall_t schemaCall) = 0;
-
- virtual void
- registerEvent(const std::string& packageName,
- const std::string& eventName,
- uint8_t* md5Sum,
- management::ManagementEvent::writeSchemaCall_t schemaCall) = 0;
-
- // Add a management object to the agent. Once added, this object shall be visible
- // in the greater management context.
- //
- // Please note that ManagementObject instances are not explicitly deleted from
- // the management agent. When the core object represented by a management object
- // is deleted, the "resourceDestroy" method on the management object must be called.
- // It will then be reclaimed in due course by the management agent.
- //
- // Once a ManagementObject instance is added to the agent, the agent then owns the
- // instance. The caller MUST NOT free the resources of the instance at any time.
- // When it is no longer needed, invoke its "resourceDestroy" method and discard the
- // pointer. This allows the management agent to report the deletion of the object
- // in an orderly way.
- //
- virtual ObjectId addObject(ManagementObject* objectPtr, uint64_t persistId = 0) = 0;
-
- //
- //
- virtual void raiseEvent(const ManagementEvent& event,
- severity_t severity = SEV_DEFAULT) = 0;
-
- // If "useExternalThread" was set to true in init, this method must
- // be called to provide a thread for any pending method calls that have arrived.
- // The method calls for ManagementObject instances shall be invoked synchronously
- // during the execution of this method.
- //
- // callLimit may optionally be used to limit the number of callbacks invoked.
- // if 0, no limit is imposed.
- //
- // The return value is the number of callbacks that remain queued after this
- // call is complete. It can be used to determine whether or not further calls
- // to pollCallbacks are necessary to clear the backlog. If callLimit is zero,
- // the return value will also be zero.
- //
- virtual uint32_t pollCallbacks(uint32_t callLimit = 0) = 0;
-
- // If "useExternalThread" was set to true in the constructor, this method provides
- // a standard file descriptor that can be used in a select statement to signal that
- // there are method callbacks ready (i.e. that "pollCallbacks" will result in at
- // least one method call). When this fd is ready-for-read, pollCallbacks may be
- // invoked. Calling pollCallbacks shall reset the ready-to-read state of the fd.
- //
- virtual int getSignalFd() = 0;
-};
-
-}}
-
-#endif /*!_qpid_agent_ManagementAgent_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgentImpl.cpp b/M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgentImpl.cpp
deleted file mode 100644
index 1e2f4cdd78..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgentImpl.cpp
+++ /dev/null
@@ -1,906 +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 "qpid/management/Manageable.h"
-#include "qpid/management/ManagementObject.h"
-#include "qpid/log/Statement.h"
-#include "ManagementAgentImpl.h"
-#include <list>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <iostream>
-#include <fstream>
-
-
-using namespace qpid::client;
-using namespace qpid::framing;
-using namespace qpid::management;
-using namespace qpid::sys;
-using namespace std;
-using std::stringstream;
-using std::ofstream;
-using std::ifstream;
-using std::string;
-using std::cout;
-using std::endl;
-
-Mutex ManagementAgent::Singleton::lock;
-bool ManagementAgent::Singleton::disabled = false;
-ManagementAgent* ManagementAgent::Singleton::agent = 0;
-int ManagementAgent::Singleton::refCount = 0;
-
-ManagementAgent::Singleton::Singleton(bool disableManagement)
-{
- Mutex::ScopedLock _lock(lock);
- if (disableManagement && !disabled) {
- disabled = true;
- assert(refCount == 0); // can't disable after agent has been allocated
- }
- if (refCount == 0 && !disabled)
- agent = new ManagementAgentImpl();
- refCount++;
-}
-
-ManagementAgent::Singleton::~Singleton()
-{
- Mutex::ScopedLock _lock(lock);
- refCount--;
- if (refCount == 0 && !disabled) {
- delete agent;
- agent = 0;
- }
-}
-
-ManagementAgent* ManagementAgent::Singleton::getInstance()
-{
- return agent;
-}
-
-const string ManagementAgentImpl::storeMagicNumber("MA02");
-
-ManagementAgentImpl::ManagementAgentImpl() :
- extThread(false), writeFd(-1), readFd(-1),
- initialized(false), connected(false), lastFailure("never connected"),
- clientWasAdded(true), requestedBrokerBank(0), requestedAgentBank(0),
- assignedBrokerBank(0), assignedAgentBank(0), bootSequence(0),
- connThreadBody(*this), connThread(connThreadBody),
- pubThreadBody(*this), pubThread(pubThreadBody)
-{
-}
-
-ManagementAgentImpl::~ManagementAgentImpl()
-{
- connThreadBody.close();
-
- // If the thread is doing work on the connection, we must wait for it to
- // complete before shutting down.
- if (!connThreadBody.isSleeping()) {
- connThread.join();
- }
-
- // Release the memory associated with stored management objects.
- {
- Mutex::ScopedLock lock(agentLock);
-
- moveNewObjectsLH();
- for (ManagementObjectMap::iterator iter = managementObjects.begin ();
- iter != managementObjects.end ();
- iter++) {
- ManagementObject* object = iter->second;
- delete object;
- }
- managementObjects.clear();
- }
-}
-
-void ManagementAgentImpl::init(const string& brokerHost,
- uint16_t brokerPort,
- uint16_t intervalSeconds,
- bool useExternalThread,
- const string& _storeFile,
- const string& uid,
- const string& pwd,
- const string& mech,
- const string& proto)
-{
- client::ConnectionSettings settings;
- settings.protocol = proto;
- settings.host = brokerHost;
- settings.port = brokerPort;
- settings.username = uid;
- settings.password = pwd;
- settings.mechanism = mech;
- init(settings, intervalSeconds, useExternalThread, _storeFile);
-}
-
-void ManagementAgentImpl::init(const client::ConnectionSettings& settings,
- uint16_t intervalSeconds,
- bool useExternalThread,
- const std::string& _storeFile)
-{
- interval = intervalSeconds;
- extThread = useExternalThread;
- storeFile = _storeFile;
- nextObjectId = 1;
-
- QPID_LOG(info, "QMF Agent Initialized: broker=" << settings.host << ":" << settings.port <<
- " interval=" << intervalSeconds << " storeFile=" << _storeFile);
- connectionSettings = settings;
-
- // TODO: Abstract the socket calls for portability
- if (extThread) {
- int pair[2];
- int result = socketpair(PF_LOCAL, SOCK_STREAM, 0, pair);
- if (result == -1) {
- return;
- }
- writeFd = pair[0];
- readFd = pair[1];
-
- // Set the readFd to non-blocking
- int flags = fcntl(readFd, F_GETFL);
- fcntl(readFd, F_SETFL, flags | O_NONBLOCK);
- }
-
- retrieveData();
- bootSequence++;
- if ((bootSequence & 0xF000) != 0)
- bootSequence = 1;
- storeData(true);
-
- initialized = true;
-}
-
-void ManagementAgentImpl::registerClass(const string& packageName,
- const string& className,
- uint8_t* md5Sum,
- management::ManagementObject::writeSchemaCall_t schemaCall)
-{
- Mutex::ScopedLock lock(agentLock);
- PackageMap::iterator pIter = findOrAddPackage(packageName);
- addClassLocal(ManagementItem::CLASS_KIND_TABLE, pIter, className, md5Sum, schemaCall);
-}
-
-void ManagementAgentImpl::registerEvent(const string& packageName,
- const string& eventName,
- uint8_t* md5Sum,
- management::ManagementObject::writeSchemaCall_t schemaCall)
-{
- Mutex::ScopedLock lock(agentLock);
- PackageMap::iterator pIter = findOrAddPackage(packageName);
- addClassLocal(ManagementItem::CLASS_KIND_EVENT, pIter, eventName, md5Sum, schemaCall);
-}
-
-ObjectId ManagementAgentImpl::addObject(ManagementObject* object,
- uint64_t persistId)
-{
- Mutex::ScopedLock lock(addLock);
- uint16_t sequence = persistId ? 0 : bootSequence;
- uint64_t objectNum = persistId ? persistId : nextObjectId++;
-
- ObjectId objectId(&attachment, 0, sequence, objectNum);
-
- // TODO: fix object-id handling
- object->setObjectId(objectId);
- newManagementObjects[objectId] = object;
- return objectId;
-}
-
-void ManagementAgentImpl::raiseEvent(const ManagementEvent& event, severity_t severity)
-{
- Mutex::ScopedLock lock(agentLock);
- Buffer outBuffer(eventBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
- uint8_t sev = (severity == SEV_DEFAULT) ? event.getSeverity() : (uint8_t) severity;
- stringstream key;
-
- key << "console.event." << assignedBrokerBank << "." << assignedAgentBank << "." <<
- event.getPackageName() << "." << event.getEventName();
-
- encodeHeader(outBuffer, 'e');
- outBuffer.putShortString(event.getPackageName());
- outBuffer.putShortString(event.getEventName());
- outBuffer.putBin128(event.getMd5Sum());
- outBuffer.putLongLong(uint64_t(Duration(now())));
- outBuffer.putOctet(sev);
- event.encode(outBuffer);
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- connThreadBody.sendBuffer(outBuffer, outLen, "qpid.management", key.str());
-}
-
-uint32_t ManagementAgentImpl::pollCallbacks(uint32_t callLimit)
-{
- Mutex::ScopedLock lock(agentLock);
-
- for (uint32_t idx = 0; callLimit == 0 || idx < callLimit; idx++) {
- if (methodQueue.empty())
- break;
-
- QueuedMethod* item = methodQueue.front();
- methodQueue.pop_front();
- {
- Mutex::ScopedUnlock unlock(agentLock);
- Buffer inBuffer(const_cast<char*>(item->body.c_str()), item->body.size());
- invokeMethodRequest(inBuffer, item->sequence, item->replyTo);
- delete item;
- }
- }
-
- uint8_t rbuf[100];
- while (read(readFd, rbuf, 100) > 0) ; // Consume all signaling bytes
- return methodQueue.size();
-}
-
-int ManagementAgentImpl::getSignalFd(void)
-{
- return readFd;
-}
-
-void ManagementAgentImpl::startProtocol()
-{
- char rawbuffer[512];
- Buffer buffer(rawbuffer, 512);
-
- connected = true;
- encodeHeader(buffer, 'A');
- buffer.putShortString("RemoteAgent [C++]");
- systemId.encode (buffer);
- buffer.putLong(requestedBrokerBank);
- buffer.putLong(requestedAgentBank);
- uint32_t length = buffer.getPosition();
- buffer.reset();
- connThreadBody.sendBuffer(buffer, length, "qpid.management", "broker");
- QPID_LOG(trace, "SENT AttachRequest: reqBroker=" << requestedBrokerBank <<
- " reqAgent=" << requestedAgentBank);
-}
-
-void ManagementAgentImpl::storeData(bool requested)
-{
- if (!storeFile.empty()) {
- ofstream outFile(storeFile.c_str());
- uint32_t brokerBankToWrite = requested ? requestedBrokerBank : assignedBrokerBank;
- uint32_t agentBankToWrite = requested ? requestedAgentBank : assignedAgentBank;
-
- if (outFile.good()) {
- outFile << storeMagicNumber << " " << brokerBankToWrite << " " <<
- agentBankToWrite << " " << bootSequence << endl;
- outFile.close();
- }
- }
-}
-
-void ManagementAgentImpl::retrieveData()
-{
- if (!storeFile.empty()) {
- ifstream inFile(storeFile.c_str());
- string mn;
-
- if (inFile.good()) {
- inFile >> mn;
- if (mn == storeMagicNumber) {
- inFile >> requestedBrokerBank;
- inFile >> requestedAgentBank;
- inFile >> bootSequence;
- }
- inFile.close();
- }
- }
-}
-
-void ManagementAgentImpl::sendCommandComplete(string replyToKey, uint32_t sequence,
- uint32_t code, string text)
-{
- Buffer outBuffer(outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 'z', sequence);
- outBuffer.putLong(code);
- outBuffer.putShortString(text);
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- connThreadBody.sendBuffer(outBuffer, outLen, "amq.direct", replyToKey);
- QPID_LOG(trace, "SENT CommandComplete: seq=" << sequence << " code=" << code << " text=" << text);
-}
-
-void ManagementAgentImpl::handleAttachResponse(Buffer& inBuffer)
-{
- Mutex::ScopedLock lock(agentLock);
-
- assignedBrokerBank = inBuffer.getLong();
- assignedAgentBank = inBuffer.getLong();
-
- QPID_LOG(trace, "RCVD AttachResponse: broker=" << assignedBrokerBank << " agent=" << assignedAgentBank);
-
- if ((assignedBrokerBank != requestedBrokerBank) ||
- (assignedAgentBank != requestedAgentBank)) {
- if (requestedAgentBank == 0) {
- QPID_LOG(notice, "Initial object-id bank assigned: " << assignedBrokerBank << "." <<
- assignedAgentBank);
- } else {
- QPID_LOG(warning, "Collision in object-id! New bank assigned: " << assignedBrokerBank <<
- "." << assignedAgentBank);
- }
- storeData();
- requestedBrokerBank = assignedBrokerBank;
- requestedAgentBank = assignedAgentBank;
- }
-
- attachment.setBanks(assignedBrokerBank, assignedAgentBank);
-
- // Bind to qpid.management to receive commands
- connThreadBody.bindToBank(assignedBrokerBank, assignedAgentBank);
-
- // Send package indications for all local packages
- for (PackageMap::iterator pIter = packages.begin();
- pIter != packages.end();
- pIter++) {
- Buffer outBuffer(outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 'p');
- encodePackageIndication(outBuffer, pIter);
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- connThreadBody.sendBuffer(outBuffer, outLen, "qpid.management", "broker");
-
- // Send class indications for all local classes
- ClassMap cMap = pIter->second;
- for (ClassMap::iterator cIter = cMap.begin(); cIter != cMap.end(); cIter++) {
- outBuffer.reset();
- encodeHeader(outBuffer, 'q');
- encodeClassIndication(outBuffer, pIter, cIter);
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- connThreadBody.sendBuffer(outBuffer, outLen, "qpid.management", "broker");
- }
- }
-}
-
-void ManagementAgentImpl::handleSchemaRequest(Buffer& inBuffer, uint32_t sequence)
-{
- Mutex::ScopedLock lock(agentLock);
- string packageName;
- SchemaClassKey key;
-
- inBuffer.getShortString(packageName);
- inBuffer.getShortString(key.name);
- inBuffer.getBin128(key.hash);
-
- QPID_LOG(trace, "RCVD SchemaRequest: package=" << packageName << " class=" << key.name);
-
- PackageMap::iterator pIter = packages.find(packageName);
- if (pIter != packages.end()) {
- ClassMap& cMap = pIter->second;
- ClassMap::iterator cIter = cMap.find(key);
- if (cIter != cMap.end()) {
- SchemaClass& schema = cIter->second;
- Buffer outBuffer(outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 's', sequence);
- schema.writeSchemaCall(outBuffer);
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- connThreadBody.sendBuffer(outBuffer, outLen, "qpid.management", "broker");
-
- QPID_LOG(trace, "SENT SchemaInd: package=" << packageName << " class=" << key.name);
- }
- }
-}
-
-void ManagementAgentImpl::handleConsoleAddedIndication()
-{
- Mutex::ScopedLock lock(agentLock);
- clientWasAdded = true;
-
- QPID_LOG(trace, "RCVD ConsoleAddedInd");
-}
-
-void ManagementAgentImpl::invokeMethodRequest(Buffer& inBuffer, uint32_t sequence, string replyTo)
-{
- string methodName;
- string packageName;
- string className;
- uint8_t hash[16];
- Buffer outBuffer(outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- ObjectId objId(inBuffer);
- inBuffer.getShortString(packageName);
- inBuffer.getShortString(className);
- inBuffer.getBin128(hash);
- inBuffer.getShortString(methodName);
-
- encodeHeader(outBuffer, 'm', sequence);
-
- ManagementObjectMap::iterator iter = managementObjects.find(objId);
- if (iter == managementObjects.end() || iter->second->isDeleted()) {
- outBuffer.putLong (Manageable::STATUS_UNKNOWN_OBJECT);
- outBuffer.putMediumString(Manageable::StatusText(Manageable::STATUS_UNKNOWN_OBJECT));
- } else {
- if ((iter->second->getPackageName() != packageName) ||
- (iter->second->getClassName() != className)) {
- outBuffer.putLong (Manageable::STATUS_INVALID_PARAMETER);
- outBuffer.putMediumString(Manageable::StatusText (Manageable::STATUS_INVALID_PARAMETER));
- }
- else
- try {
- outBuffer.record();
- iter->second->doMethod(methodName, inBuffer, outBuffer);
- } catch(exception& e) {
- outBuffer.restore();
- outBuffer.putLong(Manageable::STATUS_EXCEPTION);
- outBuffer.putMediumString(e.what());
- }
- }
-
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- connThreadBody.sendBuffer(outBuffer, outLen, "amq.direct", replyTo);
-}
-
-void ManagementAgentImpl::handleGetQuery(Buffer& inBuffer, uint32_t sequence, string replyTo)
-{
- FieldTable ft;
- FieldTable::ValuePtr value;
-
- moveNewObjectsLH();
-
- ft.decode(inBuffer);
-
- QPID_LOG(trace, "RCVD GetQuery: map=" << ft);
-
- value = ft.get("_class");
- if (value.get() == 0 || !value->convertsTo<string>()) {
- value = ft.get("_objectid");
- if (value.get() == 0 || !value->convertsTo<string>())
- return;
-
- ObjectId selector(value->get<string>());
- ManagementObjectMap::iterator iter = managementObjects.find(selector);
- if (iter != managementObjects.end()) {
- ManagementObject* object = iter->second;
- Buffer outBuffer (outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 'g', sequence);
- object->writeProperties(outBuffer);
- object->writeStatistics(outBuffer, true);
- outLen = MA_BUFFER_SIZE - outBuffer.available ();
- outBuffer.reset ();
- connThreadBody.sendBuffer(outBuffer, outLen, "amq.direct", replyTo);
-
- QPID_LOG(trace, "SENT ObjectInd");
- }
- sendCommandComplete(replyTo, sequence);
- return;
- }
-
- string className(value->get<string>());
-
- for (ManagementObjectMap::iterator iter = managementObjects.begin();
- iter != managementObjects.end();
- iter++) {
- ManagementObject* object = iter->second;
- if (object->getClassName() == className) {
- Buffer outBuffer(outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 'g', sequence);
- object->writeProperties(outBuffer);
- object->writeStatistics(outBuffer, true);
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- connThreadBody.sendBuffer(outBuffer, outLen, "amq.direct", replyTo);
-
- QPID_LOG(trace, "SENT ObjectInd");
- }
- }
-
- sendCommandComplete(replyTo, sequence);
-}
-
-void ManagementAgentImpl::handleMethodRequest(Buffer& inBuffer, uint32_t sequence, string replyTo)
-{
- if (extThread) {
- Mutex::ScopedLock lock(agentLock);
- string body;
-
- inBuffer.getRawData(body, inBuffer.available());
- methodQueue.push_back(new QueuedMethod(sequence, replyTo, body));
- write(writeFd, "X", 1);
- } else {
- invokeMethodRequest(inBuffer, sequence, replyTo);
- }
-
- QPID_LOG(trace, "RCVD MethodRequest");
-}
-
-void ManagementAgentImpl::received(Message& msg)
-{
- string data = msg.getData();
- Buffer inBuffer(const_cast<char*>(data.c_str()), data.size());
- uint8_t opcode;
- uint32_t sequence;
- string replyToKey;
-
- framing::MessageProperties p = msg.getMessageProperties();
- if (p.hasReplyTo()) {
- const framing::ReplyTo& rt = p.getReplyTo();
- replyToKey = rt.getRoutingKey();
- }
-
- if (checkHeader(inBuffer, &opcode, &sequence))
- {
- if (opcode == 'a') handleAttachResponse(inBuffer);
- else if (opcode == 'S') handleSchemaRequest(inBuffer, sequence);
- else if (opcode == 'x') handleConsoleAddedIndication();
- else if (opcode == 'G') handleGetQuery(inBuffer, sequence, replyToKey);
- else if (opcode == 'M') handleMethodRequest(inBuffer, sequence, replyToKey);
- }
-}
-
-void ManagementAgentImpl::encodeHeader(Buffer& buf, uint8_t opcode, uint32_t seq)
-{
- buf.putOctet('A');
- buf.putOctet('M');
- buf.putOctet('2');
- buf.putOctet(opcode);
- buf.putLong (seq);
-}
-
-bool ManagementAgentImpl::checkHeader(Buffer& buf, uint8_t *opcode, uint32_t *seq)
-{
- if (buf.getSize() < 8)
- return false;
-
- uint8_t h1 = buf.getOctet();
- uint8_t h2 = buf.getOctet();
- uint8_t h3 = buf.getOctet();
-
- *opcode = buf.getOctet();
- *seq = buf.getLong();
-
- return h1 == 'A' && h2 == 'M' && h3 == '2';
-}
-
-ManagementAgentImpl::PackageMap::iterator ManagementAgentImpl::findOrAddPackage(const string& name)
-{
- PackageMap::iterator pIter = packages.find(name);
- if (pIter != packages.end())
- return pIter;
-
- // No such package found, create a new map entry.
- pair<PackageMap::iterator, bool> result =
- packages.insert(pair<string, ClassMap>(name, ClassMap()));
-
- if (connected) {
- // Publish a package-indication message
- Buffer outBuffer(outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 'p');
- encodePackageIndication(outBuffer, result.first);
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- connThreadBody.sendBuffer(outBuffer, outLen, "qpid.management", "schema.package");
- }
-
- return result.first;
-}
-
-void ManagementAgentImpl::moveNewObjectsLH()
-{
- Mutex::ScopedLock lock(addLock);
- for (ManagementObjectMap::iterator iter = newManagementObjects.begin();
- iter != newManagementObjects.end();
- iter++)
- managementObjects[iter->first] = iter->second;
- newManagementObjects.clear();
-}
-
-void ManagementAgentImpl::addClassLocal(uint8_t classKind,
- PackageMap::iterator pIter,
- const string& className,
- uint8_t* md5Sum,
- management::ManagementObject::writeSchemaCall_t schemaCall)
-{
- SchemaClassKey key;
- ClassMap& cMap = pIter->second;
-
- key.name = className;
- memcpy(&key.hash, md5Sum, 16);
-
- ClassMap::iterator cIter = cMap.find(key);
- if (cIter != cMap.end())
- return;
-
- // No such class found, create a new class with local information.
- cMap.insert(pair<SchemaClassKey, SchemaClass>(key, SchemaClass(schemaCall, classKind)));
-}
-
-void ManagementAgentImpl::encodePackageIndication(Buffer& buf,
- PackageMap::iterator pIter)
-{
- buf.putShortString((*pIter).first);
-
- QPID_LOG(trace, "SENT PackageInd: package=" << (*pIter).first);
-}
-
-void ManagementAgentImpl::encodeClassIndication(Buffer& buf,
- PackageMap::iterator pIter,
- ClassMap::iterator cIter)
-{
- SchemaClassKey key = (*cIter).first;
-
- buf.putOctet((*cIter).second.kind);
- buf.putShortString((*pIter).first);
- buf.putShortString(key.name);
- buf.putBin128(key.hash);
-
- QPID_LOG(trace, "SENT ClassInd: package=" << (*pIter).first << " class=" << key.name);
-}
-
-void ManagementAgentImpl::periodicProcessing()
-{
-#define BUFSIZE 65536
- Mutex::ScopedLock lock(agentLock);
- char msgChars[BUFSIZE];
- uint32_t contentSize;
- list<pair<ObjectId, ManagementObject*> > deleteList;
-
- if (!connected)
- return;
-
- moveNewObjectsLH();
-
- //
- // Clear the been-here flag on all objects in the map.
- //
- for (ManagementObjectMap::iterator iter = managementObjects.begin();
- iter != managementObjects.end();
- iter++) {
- ManagementObject* object = iter->second;
- object->setFlags(0);
- if (clientWasAdded) {
- object->setForcePublish(true);
- }
- }
-
- clientWasAdded = false;
-
- //
- // Process the entire object map.
- //
- for (ManagementObjectMap::iterator baseIter = managementObjects.begin();
- baseIter != managementObjects.end();
- baseIter++) {
- ManagementObject* baseObject = baseIter->second;
-
- //
- // Skip until we find a base object requiring a sent message.
- //
- if (baseObject->getFlags() == 1 ||
- (!baseObject->getConfigChanged() &&
- !baseObject->getInstChanged() &&
- !baseObject->getForcePublish() &&
- !baseObject->isDeleted()))
- continue;
-
- Buffer msgBuffer(msgChars, BUFSIZE);
- for (ManagementObjectMap::iterator iter = baseIter;
- iter != managementObjects.end();
- iter++) {
- ManagementObject* object = iter->second;
- if (baseObject->isSameClass(*object) && object->getFlags() == 0) {
- object->setFlags(1);
- if (object->getConfigChanged() || object->getInstChanged())
- object->setUpdateTime();
-
- if (object->getConfigChanged() || object->getForcePublish() || object->isDeleted()) {
- encodeHeader(msgBuffer, 'c');
- object->writeProperties(msgBuffer);
- }
-
- if (object->hasInst() && (object->getInstChanged() || object->getForcePublish())) {
- encodeHeader(msgBuffer, 'i');
- object->writeStatistics(msgBuffer);
- }
-
- if (object->isDeleted())
- deleteList.push_back(pair<ObjectId, ManagementObject*>(iter->first, object));
- object->setForcePublish(false);
-
- if (msgBuffer.available() < (BUFSIZE / 2))
- break;
- }
- }
-
- contentSize = BUFSIZE - msgBuffer.available();
- if (contentSize > 0) {
- msgBuffer.reset();
- stringstream key;
- key << "console.obj." << assignedBrokerBank << "." << assignedAgentBank << "." <<
- baseObject->getPackageName() << "." << baseObject->getClassName();
- connThreadBody.sendBuffer(msgBuffer, contentSize, "qpid.management", key.str());
- }
- }
-
- // Delete flagged objects
- for (list<pair<ObjectId, ManagementObject*> >::reverse_iterator iter = deleteList.rbegin();
- iter != deleteList.rend();
- iter++) {
- delete iter->second;
- managementObjects.erase(iter->first);
- }
-
- deleteList.clear();
-
- {
- Buffer msgBuffer(msgChars, BUFSIZE);
- encodeHeader(msgBuffer, 'h');
- msgBuffer.putLongLong(uint64_t(Duration(now())));
- stringstream key;
- key << "console.heartbeat." << assignedBrokerBank << "." << assignedAgentBank;
-
- contentSize = BUFSIZE - msgBuffer.available();
- msgBuffer.reset();
- connThreadBody.sendBuffer(msgBuffer, contentSize, "qpid.management", key.str());
- }
-}
-
-void ManagementAgentImpl::ConnectionThread::run()
-{
- static const int delayMin(1);
- static const int delayMax(128);
- static const int delayFactor(2);
- int delay(delayMin);
- string dest("qmfagent");
-
- sessionId.generate();
- queueName << "qmfagent-" << sessionId;
-
- while (true) {
- try {
- if (agent.initialized) {
- QPID_LOG(debug, "QMF Agent attempting to connect to the broker...");
- connection.open(agent.connectionSettings);
- session = connection.newSession(queueName.str());
- subscriptions = new client::SubscriptionManager(session);
-
- session.queueDeclare(arg::queue=queueName.str(), arg::autoDelete=true,
- arg::exclusive=true);
- session.exchangeBind(arg::exchange="amq.direct", arg::queue=queueName.str(),
- arg::bindingKey=queueName.str());
-
- subscriptions->subscribe(agent, queueName.str(), dest);
- QPID_LOG(info, "Connection established with broker");
- {
- Mutex::ScopedLock _lock(connLock);
- if (shutdown)
- return;
- operational = true;
- agent.startProtocol();
- try {
- Mutex::ScopedUnlock _unlock(connLock);
- subscriptions->run();
- } catch (exception) {}
-
- QPID_LOG(warning, "Connection to the broker has been lost");
-
- operational = false;
- agent.connected = false;
- }
- delay = delayMin;
- connection.close();
- delete subscriptions;
- subscriptions = 0;
- }
- } catch (exception &e) {
- if (delay < delayMax)
- delay *= delayFactor;
- QPID_LOG(debug, "Connection failed: exception=" << e.what());
- }
-
- {
- Mutex::ScopedLock _lock(connLock);
- if (shutdown)
- return;
- sleeping = true;
- {
- Mutex::ScopedUnlock _unlock(connLock);
- ::sleep(delay);
- }
- sleeping = false;
- if (shutdown)
- return;
- }
- }
-}
-
-ManagementAgentImpl::ConnectionThread::~ConnectionThread()
-{
-}
-
-void ManagementAgentImpl::ConnectionThread::sendBuffer(Buffer& buf,
- uint32_t length,
- const string& exchange,
- const string& routingKey)
-{
- {
- Mutex::ScopedLock _lock(connLock);
- if (!operational)
- return;
- }
-
- Message msg;
- string data;
-
- buf.getRawData(data, length);
- msg.getDeliveryProperties().setRoutingKey(routingKey);
- msg.getMessageProperties().setReplyTo(ReplyTo("amq.direct", queueName.str()));
- msg.setData(data);
- try {
- session.messageTransfer(arg::content=msg, arg::destination=exchange);
- } catch(exception& e) {
- QPID_LOG(error, "Exception caught in sendBuffer: " << e.what());
- // Bounce the connection
- if (subscriptions)
- subscriptions->stop();
- }
-}
-
-void ManagementAgentImpl::ConnectionThread::bindToBank(uint32_t brokerBank, uint32_t agentBank)
-{
- stringstream key;
- key << "agent." << brokerBank << "." << agentBank;
- session.exchangeBind(arg::exchange="qpid.management", arg::queue=queueName.str(),
- arg::bindingKey=key.str());
-}
-
-void ManagementAgentImpl::ConnectionThread::close()
-{
- {
- Mutex::ScopedLock _lock(connLock);
- shutdown = true;
- }
- if (subscriptions)
- subscriptions->stop();
-}
-
-bool ManagementAgentImpl::ConnectionThread::isSleeping() const
-{
- Mutex::ScopedLock _lock(connLock);
- return sleeping;
-}
-
-
-void ManagementAgentImpl::PublishThread::run()
-{
- while (true) {
- ::sleep(agent.getInterval());
- agent.periodicProcessing();
- }
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgentImpl.h b/M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgentImpl.h
deleted file mode 100644
index 53eb690ba8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/agent/ManagementAgentImpl.h
+++ /dev/null
@@ -1,237 +0,0 @@
-#ifndef _qpid_agent_ManagementAgentImpl_
-#define _qpid_agent_ManagementAgentImpl_
-
-//
-// 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 "ManagementAgent.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/ConnectionSettings.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/client/Session.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/MessageListener.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/sys/Runnable.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/framing/Uuid.h"
-#include <iostream>
-#include <sstream>
-#include <deque>
-
-namespace qpid {
-namespace management {
-
-class ManagementAgentImpl : public ManagementAgent, public client::MessageListener
-{
- public:
-
- ManagementAgentImpl();
- virtual ~ManagementAgentImpl();
-
- //
- // Methods from ManagementAgent
- //
- int getMaxThreads() { return 1; }
- void init(const std::string& brokerHost = "localhost",
- uint16_t brokerPort = 5672,
- uint16_t intervalSeconds = 10,
- bool useExternalThread = false,
- const std::string& storeFile = "",
- const std::string& uid = "guest",
- const std::string& pwd = "guest",
- const std::string& mech = "PLAIN",
- const std::string& proto = "tcp");
- void init(const client::ConnectionSettings& settings,
- uint16_t intervalSeconds = 10,
- bool useExternalThread = false,
- const std::string& storeFile = "");
- bool isConnected() { return connected; }
- std::string& getLastFailure() { return lastFailure; }
- void registerClass(const std::string& packageName,
- const std::string& className,
- uint8_t* md5Sum,
- management::ManagementObject::writeSchemaCall_t schemaCall);
- void registerEvent(const std::string& packageName,
- const std::string& eventName,
- uint8_t* md5Sum,
- management::ManagementObject::writeSchemaCall_t schemaCall);
- ObjectId addObject(management::ManagementObject* objectPtr, uint64_t persistId = 0);
- void raiseEvent(const management::ManagementEvent& event, severity_t severity = SEV_DEFAULT);
- uint32_t pollCallbacks(uint32_t callLimit = 0);
- int getSignalFd();
-
- uint16_t getInterval() { return interval; }
- void periodicProcessing();
-
- private:
-
- struct SchemaClassKey {
- std::string name;
- uint8_t hash[16];
- };
-
- struct SchemaClassKeyComp {
- bool operator() (const SchemaClassKey& lhs, const SchemaClassKey& rhs) const
- {
- if (lhs.name != rhs.name)
- return lhs.name < rhs.name;
- else
- for (int i = 0; i < 16; i++)
- if (lhs.hash[i] != rhs.hash[i])
- return lhs.hash[i] < rhs.hash[i];
- return false;
- }
- };
-
- struct SchemaClass {
- management::ManagementObject::writeSchemaCall_t writeSchemaCall;
- uint8_t kind;
-
- SchemaClass(const management::ManagementObject::writeSchemaCall_t call,
- const uint8_t _kind) : writeSchemaCall(call), kind(_kind) {}
- };
-
- struct QueuedMethod {
- QueuedMethod(uint32_t _seq, std::string _reply, std::string _body) :
- sequence(_seq), replyTo(_reply), body(_body) {}
-
- uint32_t sequence;
- std::string replyTo;
- std::string body;
- };
-
- typedef std::deque<QueuedMethod*> MethodQueue;
- typedef std::map<SchemaClassKey, SchemaClass, SchemaClassKeyComp> ClassMap;
- typedef std::map<std::string, ClassMap> PackageMap;
-
- PackageMap packages;
- AgentAttachment attachment;
- management::ManagementObjectMap managementObjects;
- management::ManagementObjectMap newManagementObjects;
- MethodQueue methodQueue;
-
- void received (client::Message& msg);
-
- uint16_t interval;
- bool extThread;
- int writeFd;
- int readFd;
- uint64_t nextObjectId;
- std::string storeFile;
- sys::Mutex agentLock;
- sys::Mutex addLock;
- framing::Uuid systemId;
- client::ConnectionSettings connectionSettings;
- bool initialized;
- bool connected;
- std::string lastFailure;
-
- bool clientWasAdded;
- uint32_t requestedBrokerBank;
- uint32_t requestedAgentBank;
- uint32_t assignedBrokerBank;
- uint32_t assignedAgentBank;
- uint16_t bootSequence;
-
- static const uint8_t DEBUG_OFF = 0;
- static const uint8_t DEBUG_CONN = 1;
- static const uint8_t DEBUG_PROTO = 2;
- static const uint8_t DEBUG_PUBLISH = 3;
-
-# define MA_BUFFER_SIZE 65536
- char outputBuffer[MA_BUFFER_SIZE];
- char eventBuffer[MA_BUFFER_SIZE];
-
- friend class ConnectionThread;
- class ConnectionThread : public sys::Runnable
- {
- bool operational;
- ManagementAgentImpl& agent;
- framing::Uuid sessionId;
- client::Connection connection;
- client::Session session;
- client::SubscriptionManager* subscriptions;
- std::stringstream queueName;
- mutable sys::Mutex connLock;
- bool shutdown;
- bool sleeping;
- void run();
- public:
- ConnectionThread(ManagementAgentImpl& _agent) :
- operational(false), agent(_agent), subscriptions(0),
- shutdown(false), sleeping(false) {}
- ~ConnectionThread();
- void sendBuffer(qpid::framing::Buffer& buf,
- uint32_t length,
- const std::string& exchange,
- const std::string& routingKey);
- void bindToBank(uint32_t brokerBank, uint32_t agentBank);
- void close();
- bool isSleeping() const;
- };
-
- class PublishThread : public sys::Runnable
- {
- ManagementAgentImpl& agent;
- void run();
- public:
- PublishThread(ManagementAgentImpl& _agent) : agent(_agent) {}
- };
-
- ConnectionThread connThreadBody;
- sys::Thread connThread;
- PublishThread pubThreadBody;
- sys::Thread pubThread;
-
- static const std::string storeMagicNumber;
-
- void startProtocol();
- void storeData(bool requested=false);
- void retrieveData();
- PackageMap::iterator findOrAddPackage(const std::string& name);
- void moveNewObjectsLH();
- void addClassLocal (uint8_t classKind,
- PackageMap::iterator pIter,
- const std::string& className,
- uint8_t* md5Sum,
- management::ManagementObject::writeSchemaCall_t schemaCall);
- void encodePackageIndication (framing::Buffer& buf,
- PackageMap::iterator pIter);
- void encodeClassIndication (framing::Buffer& buf,
- PackageMap::iterator pIter,
- ClassMap::iterator cIter);
- void encodeHeader (framing::Buffer& buf, uint8_t opcode, uint32_t seq = 0);
- bool checkHeader (framing::Buffer& buf, uint8_t *opcode, uint32_t *seq);
- void sendCommandComplete (std::string replyToKey, uint32_t sequence,
- uint32_t code = 0, std::string text = std::string("OK"));
- void handleAttachResponse (qpid::framing::Buffer& inBuffer);
- void handlePackageRequest (qpid::framing::Buffer& inBuffer);
- void handleClassQuery (qpid::framing::Buffer& inBuffer);
- void handleSchemaRequest (qpid::framing::Buffer& inBuffer, uint32_t sequence);
- void invokeMethodRequest (qpid::framing::Buffer& inBuffer, uint32_t sequence, std::string replyTo);
- void handleGetQuery (qpid::framing::Buffer& inBuffer, uint32_t sequence, std::string replyTo);
- void handleMethodRequest (qpid::framing::Buffer& inBuffer, uint32_t sequence, std::string replyTo);
- void handleConsoleAddedIndication();
-};
-
-}}
-
-#endif /*!_qpid_agent_ManagementAgentImpl_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Array.cpp b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Array.cpp
deleted file mode 100644
index 380e0f1f36..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Array.cpp
+++ /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.
- *
- */
-#include "Array.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-std::ostream& operator<<(std::ostream& o, const Array& a) {
- std::ostream_iterator<UnknownType> i(o, " ");
- o << "Array<" << typeName(a.getType()) << "[";
- std::copy(a.begin(), a.end(), i);
- o << "]";
- return o;
-}
-
-}} // namespace qpid::amqp_0_10
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Array.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Array.h
deleted file mode 100644
index 6e8a419df7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Array.h
+++ /dev/null
@@ -1,124 +0,0 @@
-#ifndef QPID_AMQP_0_10_ARRAY_H
-#define QPID_AMQP_0_10_ARRAY_H
-
-/*
- *
- * 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 "qpid/amqp_0_10/TypeForCode.h"
-#include "qpid/amqp_0_10/CodeForType.h"
-#include "qpid/amqp_0_10/UnknownType.h"
-#include "qpid/amqp_0_10/exceptions.h"
-#include "qpid/amqp_0_10/Codec.h"
-#include <vector>
-#include <ostream>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-template <class T> class ArrayDomain : public std::vector<T> {
- public:
- template <class S> void serialize(S& s) { s.split(*this); }
-
- template <class S> void encode(S& s) const {
- s(contentSize())(CodeForType<T>::value)(uint32_t(this->size()));
- s(this->begin(), this->end());
- }
-
- void encode(Codec::Size& s) const { s.raw(0, contentSize() + 4/*size*/); }
-
- template <class S> void decode(S& s) {
- uint32_t size; uint8_t type; uint32_t count;
- s(size);
- typename S::ScopedLimit l(s, size);
- s(type);
- if (type != CodeForType<T>::value)
- throw InvalidArgumentException(QPID_MSG("Array domain expected type " << CodeForType<T>::value << " but found " << type));
- s(count);
- this->resize(count);
- s(this->begin(), this->end());
- }
-
- private:
- uint32_t contentSize() const {
- return Codec::size(this->begin(), this->end()) + sizeof(uint32_t) /*count*/ + sizeof(uint8_t) /*type*/;
- }
-};
-
-template <class T>
-std::ostream& operator<<(std::ostream& o, const ArrayDomain<T>& ad) {
- std::ostream_iterator<T> i(o, " ");
- o << "Array<" << typeName(CodeForType<T>::value) << ">[";
- std::copy(ad.begin(), ad.end(), i);
- o << "]";
- return o;
-}
-
-/** A non-domain array is represented as and array of UnknownType.
- * Special case templat.
- */
-template<> class ArrayDomain<UnknownType> : public std::vector<UnknownType> {
- public:
- ArrayDomain(uint8_t type_=0) : type(type_) {}
-
- template <class S> void serialize(S& s) { s.split(*this); }
-
- template <class S> void encode(S& s) const {
- s(contentSize())(type)(uint32_t(this->size()));
- s(this->begin(), this->end());
- }
-
- void encode(Codec::Size& s) const { s.raw(0, contentSize() + 4/*size*/); }
-
- template <class S> void decode(S& s) {
- uint32_t size; uint32_t count;
- s(size);
- typename S::ScopedLimit l(s, size);
- s(type)(count);
- this->clear();
- this->resize(count, UnknownType(type));
- s(this->begin(), this->end());
- }
-
- uint8_t getType() const { return type; }
-
- private:
- uint32_t contentSize() const {
- return Codec::size(this->begin(), this->end()) + sizeof(uint32_t) /*count*/ + sizeof(uint8_t) /*type*/;
- }
- uint8_t type;
-};
-
-std::ostream& operator<<(std::ostream& o, const Array& a);
-
-// FIXME aconway 2008-04-08: hack to supress encoding of
-// command-fragments and in-doubt as there is a problem with the spec
-// (command-fragments does not have a one byte type code.)
-namespace session { class CommandFragment; }
-namespace dtx { class Xid; }
-
-template <> struct ArrayDomain<session::CommandFragment> : public Void {};
-template <> struct ArrayDomain<dtx::Xid> : public Void {};
-inline std::ostream& operator<<(std::ostream& o, const ArrayDomain<session::CommandFragment>&) { return o; }
-inline std::ostream& operator<<(std::ostream& o, const ArrayDomain<dtx::Xid>&) { return o; }
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_ARRAY_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Body.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Body.h
deleted file mode 100644
index c96931551c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Body.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef QPID_AMQP_0_10_BODY_H
-#define QPID_AMQP_0_10_BODY_H
-
-/*
- *
- * 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 <string>
-#include <ostream>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-/** Holds data from a body frame. */
-class Body {
- public:
- Body() {}
- Body(size_t size_) : str(size_, '\0') {}
- Body(const char* data_, size_t size_) : str(data_, size_) {}
-
- size_t size() const { return str.size(); };
- const char* data() const { return str.data(); }
- char* data() { return const_cast<char*>(str.data()); }
-
- template <class S> void serialize(S& s) { s.raw(data(), size()); }
-
- private:
- std::string str;
-
- friend std::ostream& operator<<(std::ostream&, const Body&);
-};
-
-inline std::ostream& operator<<(std::ostream& o, const Body& b) {
- return o << b.str.substr(0, 16) << "... (" << b.size() << ")";
-}
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_BODY_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Codec.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Codec.h
deleted file mode 100644
index 5cad5cf4ed..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Codec.h
+++ /dev/null
@@ -1,213 +0,0 @@
-#ifndef QPID_AMQP_0_10_CODEC_H
-#define QPID_AMQP_0_10_CODEC_H
-
-/*
- *
- * 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 "built_in_types.h"
-#include "qpid/Serializer.h"
-#include <boost/type_traits/is_integral.hpp>
-#include <boost/type_traits/is_float.hpp>
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/detail/endian.hpp>
-#include <boost/static_assert.hpp>
-#include <iterator>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-template <class T> void reverse(T& t) {
- char*p =reinterpret_cast<char*>(&t);
- std::reverse(p, p+sizeof(T));
-}
-
-#ifdef BOOST_LITTLE_ENDIAN
-template <class T> void bigEndian(T& t) { reverse(t); }
-template <class T> void littleEndian(T&) {}
-#else
-template <class T> void littleEndian(T& t) { reverse(t); }
-template <class T> void bigEndian(T&) {}
-#endif
-
-/**
- * AMQP 0-10 encoding and decoding.
- */
-struct Codec {
- /** Encode to an output byte iterator */
- template <class OutIter>
- class Encoder : public EncoderBase<Encoder<OutIter> >
- {
- public:
- typedef EncoderBase<Encoder<OutIter> > Base;
- typedef OutIter Iterator;
-
- Encoder(OutIter o, size_t limit=Base::maxLimit()) : out(o) {
- this->setLimit(limit);
- }
-
- using EncoderBase<Encoder<OutIter> >::operator();
-
- Encoder& operator()(bool x) { raw(x); return *this;}
- Encoder& operator()(char x) { raw(x); return *this; }
- Encoder& operator()(int8_t x) { raw(x); return *this; }
- Encoder& operator()(uint8_t x) { raw(x); return *this; }
-
- Encoder& operator()(int16_t x) { return networkByteOrder(x); }
- Encoder& operator()(int32_t x) { return networkByteOrder(x); }
- Encoder& operator()(int64_t x) { return networkByteOrder(x); }
-
- Encoder& operator()(uint16_t x) { return networkByteOrder(x); }
- Encoder& operator()(uint32_t x) { return networkByteOrder(x); }
- Encoder& operator()(uint64_t x) { return networkByteOrder(x); }
-
- Encoder& operator()(float x) { return networkByteOrder(x); }
- Encoder& operator()(double x) { return networkByteOrder(x); }
-
- void raw(const void* p, size_t n) {
- this->addBytes(n);
- out = std::copy((const char*)p, (const char*)p+n, out);
- }
-
- void raw(char b) { this->addBytes(1); *out++=b; }
-
- template <class T> Encoder& littleEnd(T x) {
- littleEndian(x); raw(&x, sizeof(x)); return *this;
- }
-
- OutIter pos() const { return out; }
-
- private:
-
- template <class T> Encoder& networkByteOrder(T x) {
- bigEndian(x); raw(&x, sizeof(x)); return *this;
- }
-
- OutIter out;
- };
-
- template <class InIter>
- class Decoder : public DecoderBase<Decoder<InIter> > {
- public:
- typedef DecoderBase<Decoder<InIter> > Base;
- typedef InIter Iterator;
-
- Decoder(InIter i, size_t limit=Base::maxLimit()) : in(i) {
- this->setLimit(limit);
- }
-
- using DecoderBase<Decoder<InIter> >::operator();
-
- // FIXME aconway 2008-03-10: wrong encoding, need packing support
- Decoder& operator()(bool& x) { raw((char&)x); return *this; }
-
- Decoder& operator()(char& x) { raw((char&)x); return *this; }
- Decoder& operator()(int8_t& x) { raw((char&)x); return *this; }
- Decoder& operator()(uint8_t& x) { raw((char&)x); return *this; }
-
- Decoder& operator()(int16_t& x) { return networkByteOrder(x); }
- Decoder& operator()(int32_t& x) { return networkByteOrder(x); }
- Decoder& operator()(int64_t& x) { return networkByteOrder(x); }
-
- Decoder& operator()(uint16_t& x) { return networkByteOrder(x); }
- Decoder& operator()(uint32_t& x) { return networkByteOrder(x); }
- Decoder& operator()(uint64_t& x) { return networkByteOrder(x); }
-
- Decoder& operator()(float& x) { return networkByteOrder(x); }
- Decoder& operator()(double& x) { return networkByteOrder(x); }
-
- void raw(void *p, size_t n) {
- this->addBytes(n);
- std::copy(in, in+n, (char*)p);
- std::advance(in, n);
- }
-
- void raw(char &b) { this->addBytes(1); b=*in++; }
-
- template <class T> Decoder& littleEnd(T& x) {
- raw(&x, sizeof(x)); littleEndian(x); return *this;
- }
-
- InIter pos() const { return in; }
-
- private:
-
- template <class T> Decoder& networkByteOrder(T& x) {
- raw(&x, sizeof(x)); bigEndian(x); return *this;
- }
-
- InIter in;
- };
-
-
- class Size : public EncoderBase<Size> {
- public:
- Size() : size(0) {}
-
- operator size_t() const { return size; }
-
- using EncoderBase<Size>::operator();
-
- // FIXME aconway 2008-03-10: wrong encoding, need packing support
- Size& operator()(bool x) { size += sizeof(x); return *this; }
-
- Size& operator()(char x) { size += sizeof(x); return *this; }
- Size& operator()(int8_t x) { size += sizeof(x); return *this; }
- Size& operator()(uint8_t x) { size += sizeof(x); return *this; }
-
- Size& operator()(int16_t x) { size += sizeof(x); return *this; }
- Size& operator()(int32_t x) { size += sizeof(x); return *this; }
- Size& operator()(int64_t x) { size += sizeof(x); return *this; }
-
- Size& operator()(uint16_t x) { size += sizeof(x); return *this; }
- Size& operator()(uint32_t x) { size += sizeof(x); return *this; }
- Size& operator()(uint64_t x) { size += sizeof(x); return *this; }
-
- Size& operator()(float x) { size += sizeof(x); return *this; }
- Size& operator()(double x) { size += sizeof(x); return *this; }
-
- // FIXME aconway 2008-04-03: optimize op()(Iter,Iter)
- // for Iter with fixed-size value_type:
- // distance(begin,end)*sizeof(value_type)
-
- void raw(const void*, size_t n){ size += n; }
-
- template <class T> Size& littleEnd(T) { size+= sizeof(T); return *this; }
-
- private:
- size_t size;
- };
-
- // FIXME aconway 2008-03-11: rename to encoder(), decoder()
- template <class InIter> static Decoder<InIter> decode(const InIter &i) {
- return Decoder<InIter>(i);
- }
-
- template <class OutIter> static Encoder<OutIter> encode(OutIter i) {
- return Encoder<OutIter>(i);
- }
-
- template <class T> static size_t size(const T& x) { return Size()(x); }
- template <class Iter> static size_t size(const Iter& a, const Iter& z) { return Size()(a,z); }
-};
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_CODEC_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Command.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Command.h
deleted file mode 100644
index 0fe023e520..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Command.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef QPID_AMQP_0_10_COMMAND_H
-#define QPID_AMQP_0_10_COMMAND_H
-
-/*
- *
- * 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 "Control.h"
-#include "qpid/amqp_0_10/structs.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-struct CommandVisitor;
-struct ConstCommandVisitor;
-struct CommandHolder;
-struct Command
- : public Action,
- public Visitable<CommandVisitor, ConstCommandVisitor, CommandHolder>
-{
- using Action::getCommand;
- Command* getCommand() { return this; }
- uint8_t getCode() const;
- uint8_t getClassCode() const;
- const char* getName() const;
- const char* getClassName() const;
-
- session::Header sessionHeader;
-};
-
-std::ostream& operator<<(std::ostream&, const Command&);
-
-template <class T>
-struct CommandPacker : Packer<T> {
- CommandPacker(T& t) : Packer<T>(t) {}
-
- template <class S> void serialize(S& s) {
- s(this->data.sessionHeader);
- Packer<T>::serialize(s);
- }
-};
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_COMMAND_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/CommmandPacker.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/CommmandPacker.h
deleted file mode 100644
index 51ebfe8186..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/CommmandPacker.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef QPID_AMQP_0_10_COMMMANDPACKER_H
-#define QPID_AMQP_0_10_COMMMANDPACKER_H
-
-/*
- *
- * 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 "qpid/amqp_0_10/structs.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-/**
- * Packer for commands - serialize session.header before pack bits.
- */
-template <class T>
-class CommmandPacker : public Packer<T>
-{
- public:
- CommmandPacker(T& t) : Packer<T>(t) {}
- template <class S> void serialize(S& s) { s.split(*this); }
-
- template <class S> void encode(S& s) const {
- s.sessionHeader(
- Packer<T>::encode(s);
- }
-
- template <class S> void decode(S& s) {
- Bits bits;
- s.littleEnd(bits);
- PackedDecoder<S, Bits> decode(s, bits);
- data.serialize(decode);
- }
-
-
- protected:
- T& data;
-
-
-};
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_COMMMANDPACKER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp
deleted file mode 100644
index 5b14d60ff5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Connection.cpp
+++ /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.
- *
- */
-#include "Connection.h"
-#include "qpid/log/Statement.h"
-#include "qpid/amqp_0_10/exceptions.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/Buffer.h"
-#include "qpid/framing/ProtocolInitiation.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-using sys::Mutex;
-
-Connection::Connection(sys::OutputControl& o, const std::string& id, bool _isClient)
- : frameQueueClosed(false), output(o), identifier(id), initialized(false), isClient(_isClient), buffered(0)
-{}
-
-void Connection::setInputHandler(std::auto_ptr<sys::ConnectionInputHandler> c) {
- connection = c;
-}
-
-size_t Connection::decode(const char* buffer, size_t size) {
- framing::Buffer in(const_cast<char*>(buffer), size);
- if (isClient && !initialized) {
- //read in protocol header
- framing::ProtocolInitiation pi;
- if (pi.decode(in)) {
- //TODO: check the version is correct
- QPID_LOG(trace, "RECV " << identifier << " INIT(" << pi << ")");
- }
- initialized = true;
- }
- framing::AMQFrame frame;
- while(frame.decode(in)) {
- QPID_LOG(trace, "RECV [" << identifier << "]: " << frame);
- connection->received(frame);
- }
- return in.getPosition();
-}
-
-bool Connection::canEncode() {
- if (!frameQueueClosed) connection->doOutput();
- Mutex::ScopedLock l(frameQueueLock);
- return (!isClient && !initialized) || !frameQueue.empty();
-}
-
-bool Connection::isClosed() const {
- Mutex::ScopedLock l(frameQueueLock);
- return frameQueueClosed;
-}
-
-size_t Connection::encode(const char* buffer, size_t size) {
- { // Swap frameQueue data into workQueue to avoid holding lock while we encode.
- Mutex::ScopedLock l(frameQueueLock);
- assert(workQueue.empty());
- workQueue.swap(frameQueue);
- }
- framing::Buffer out(const_cast<char*>(buffer), size);
- if (!isClient && !initialized) {
- framing::ProtocolInitiation pi(getVersion());
- pi.encode(out);
- initialized = true;
- QPID_LOG(trace, "SENT " << identifier << " INIT(" << pi << ")");
- }
- size_t frameSize=0;
- size_t encoded=0;
- while (!workQueue.empty() && ((frameSize=workQueue.front().encodedSize()) <= out.available())) {
- workQueue.front().encode(out);
- QPID_LOG(trace, "SENT [" << identifier << "]: " << workQueue.front());
- workQueue.pop_front();
- encoded += frameSize;
- if (workQueue.empty() && out.available() > 0) connection->doOutput();
- }
- assert(workQueue.empty() || workQueue.front().encodedSize() <= size);
- if (!workQueue.empty() && workQueue.front().encodedSize() > size)
- throw InternalErrorException(QPID_MSG("Frame too large for buffer."));
- {
- Mutex::ScopedLock l(frameQueueLock);
- buffered -= encoded;
- // Put back any frames we did not encode.
- frameQueue.insert(frameQueue.begin(), workQueue.begin(), workQueue.end());
- workQueue.clear();
- }
- return out.getPosition();
-}
-
-void Connection::activateOutput() { output.activateOutput(); }
-void Connection::giveReadCredit(int32_t credit) { output.giveReadCredit(credit); }
-
-void Connection::close() {
- // Close the output queue.
- Mutex::ScopedLock l(frameQueueLock);
- frameQueueClosed = true;
-}
-
-void Connection::closed() {
- connection->closed();
-}
-
-void Connection::send(framing::AMQFrame& f) {
- {
- Mutex::ScopedLock l(frameQueueLock);
- if (!frameQueueClosed)
- frameQueue.push_back(f);
- buffered += f.encodedSize();
- }
- activateOutput();
-}
-
-framing::ProtocolVersion Connection::getVersion() const {
- return framing::ProtocolVersion(0,10);
-}
-
-size_t Connection::getBuffered() const {
- Mutex::ScopedLock l(frameQueueLock);
- return buffered;
-}
-
-}} // namespace qpid::amqp_0_10
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Connection.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Connection.h
deleted file mode 100644
index 743a7de3aa..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Connection.h
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef QPID_AMQP_0_10_CONNECTION_H
-#define QPID_AMQP_0_10_CONNECTION_H
-
-/*
- *
- * 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 "qpid/framing/AMQFrame.h"
-#include "qpid/sys/ConnectionCodec.h"
-#include "qpid/sys/ConnectionInputHandler.h"
-#include "qpid/sys/ConnectionOutputHandler.h"
-#include "qpid/sys/Mutex.h"
-#include <boost/intrusive_ptr.hpp>
-#include <memory>
-#include <deque>
-
-namespace qpid {
-
-namespace sys {
-class ConnectionInputHandlerFactory;
-}
-
-namespace amqp_0_10 {
-
-class Connection : public sys::ConnectionCodec,
- public sys::ConnectionOutputHandler
-{
- typedef std::deque<framing::AMQFrame> FrameQueue;
-
- FrameQueue frameQueue;
- FrameQueue workQueue;
- bool frameQueueClosed;
- mutable sys::Mutex frameQueueLock;
- sys::OutputControl& output;
- std::auto_ptr<sys::ConnectionInputHandler> connection;
- std::string identifier;
- bool initialized;
- bool isClient;
- size_t buffered;
-
- public:
- Connection(sys::OutputControl&, const std::string& id, bool isClient);
- void setInputHandler(std::auto_ptr<sys::ConnectionInputHandler> c);
- size_t decode(const char* buffer, size_t size);
- size_t encode(const char* buffer, size_t size);
- bool isClosed() const;
- bool canEncode();
- void activateOutput();
- void giveReadCredit(int32_t);
- void closed(); // connection closed by peer.
- void close(); // closing from this end.
- void send(framing::AMQFrame&);
- framing::ProtocolVersion getVersion() const;
- size_t getBuffered() const;
-};
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_CONNECTION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Control.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Control.h
deleted file mode 100644
index 226f6f92a6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Control.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef QPID_AMQP_0_10_CONTROL_H
-#define QPID_AMQP_0_10_CONTROL_H
-
-/*
- *
- * 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 "Struct.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-struct Command;
-struct Control;
-
-struct Action { // Base for commands & controls
- virtual ~Action() {}
- virtual Command* getCommand() { return 0; }
- virtual Control* getControl() { return 0; }
-
- virtual const Command* getCommand() const {
- return const_cast<Action*>(this)->getCommand();
- }
- virtual const Control* getControl() const {
- return const_cast<Action*>(this)->getControl();
- }
- static const uint8_t SIZE=0;
- static const uint8_t PACK=2;
-};
-
-struct ControlVisitor;
-struct ConstControlVisitor;
-struct ControlHolder;
-struct Control
- : public Action,
- public Visitable<ControlVisitor, ConstControlVisitor, ControlHolder>
-{
- using Action::getControl;
- Control* getControl() { return this; }
- uint8_t getCode() const;
- uint8_t getClassCode() const;
- const char* getName() const;
- const char* getClassName() const;
-};
-std::ostream& operator<<(std::ostream&, const Control&);
-
-template <SegmentType E> struct ActionType;
-template <> struct ActionType<CONTROL> { typedef Control type; };
-template <> struct ActionType<COMMAND> { typedef Command type; };
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_CONTROL_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Decimal.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Decimal.h
deleted file mode 100644
index 50fc457c76..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Decimal.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef TESTS_DECIMAL_H
-#define TESTS_DECIMAL_H
-
-/*
- *
- * 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 <ostream>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-template <class E, class M> struct Decimal {
- E exponent;
- M mantissa;
-
- Decimal(E exp=0, M man=0) : exponent(exp), mantissa(man) {}
-
- bool operator==(const Decimal& d) const {
- return exponent == d.exponent && mantissa == d.mantissa;
- }
-
- // TODO aconway 2008-02-20: We could provide arithmetic operators
- // if anybody really cares about this type.
-
- template <class S> void serialize(S& s) { s(exponent)(mantissa); }
-};
-
-template<class E, class M>
-inline std::ostream& operator<<(std::ostream& o, const Decimal<E,M>& d) {
- return o << "Decimal{" << d.mantissa << "/10^" << (int)d.exponent << "}";
-}
-}}
-
-#endif /*!TESTS_DECIMAL_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Exception.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Exception.h
deleted file mode 100644
index 6d526c1706..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Exception.h
+++ /dev/null
@@ -1,96 +0,0 @@
-#ifndef QPID_AMQP_0_10_EXCEPTION_H
-#define QPID_AMQP_0_10_EXCEPTION_H
-
-/*
- *
- * 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 "qpid/Exception.h"
-#include "qpid/amqp_0_10/specification_fwd.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-/**
- * Raised when the connection is unexpectedly closed. Sessions with
- * non-0 timeout may be available for re-attachment on another connection.
- */
-struct ConnectionException : public qpid::Exception {
- // FIXME aconway 2008-04-04: Merge qpid::ConnectionException
- // into this when the old code is removed.
- typedef connection::CloseCode Code;
- ConnectionException(Code c, const std::string m)
- : qpid::Exception(m), code(c) {}
- Code code;
-};
-
-/**
- * Raised when a session is unexpectedly detached for any reason, or
- * if an attempt is made to use a session that is not attached.
- */
-struct SessionException : public qpid::Exception {
- // FIXME aconway 2008-04-04: should not have a code at this level.
- // Leave in place till old preview code is gone.
- SessionException(int /*code*/, const std::string& msg) : qpid::Exception(msg) {}
-};
-
-/** Raised when the state of a session has been destroyed */
-struct SessionDestroyedException : public SessionException {
- // FIXME aconway 2008-04-04: should not have a code at this level.
- // Leave in place till old preview code is gone.
- SessionDestroyedException(int code, const std::string& msg) : SessionException(code, msg){}
-};
-
-/** Raised when a session is destroyed due to an execution.exception */
-struct SessionAbortedException : public SessionDestroyedException {
- typedef execution::ErrorCode Code;
- SessionAbortedException(Code c, const std::string m)
- : SessionDestroyedException(c, m), code(c) {}
- Code code;
-};
-
-/**
- * Raised when a session with 0 timeout is unexpectedly detached
- * and therefore expires and is destroyed.
- */
-struct SessionExpiredException : public SessionDestroyedException {
- typedef session::DetachCode Code;
- SessionExpiredException(Code c, const std::string m)
- : SessionDestroyedException(c, m), code(c) {}
- Code code;
-};
-
-/**
- * Raised when a session with non-0 timeout is unexpectedly detached
- * or if an attempt is made to use a session that is not attached.
- *
- * The session is not necessarily destroyed, it may be possible to
- * re-attach.
- */
-struct SessionDetachedException : public SessionException {
- typedef session::DetachCode Code;
- SessionDetachedException(Code c, const std::string m)
- : SessionException(c, m), code(c) {}
- Code code;
-};
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_EXCEPTION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/FrameHeader.cpp b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/FrameHeader.cpp
deleted file mode 100644
index f1a59b9e27..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/FrameHeader.cpp
+++ /dev/null
@@ -1,50 +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 "FrameHeader.h"
-#include <ios>
-#include <iomanip>
-#include <ostream>
-
-using namespace std;
-
-namespace qpid {
-namespace amqp_0_10 {
-
-bool FrameHeader::operator==(const FrameHeader& x) const {
- return flags == x.flags &&
- type == x.type &&
- size == x.size &&
- track == x.track &&
- channel == x.channel;
-}
-
-std::ostream& operator<<(std::ostream& o, const FrameHeader& f) {
- std::ios::fmtflags saveFlags = o.flags();
- return o << "Frame["
- << "flags=" << std::hex << std::showbase << int(f.getFlags()) << std::setiosflags(saveFlags)
- << " type=" << f.getType()
- << " size=" << f.getSize()
- << " track=" << int(f.getTrack())
- << " channel=" << f.getChannel()
- << "]";
-}
-
-}} // namespace qpid::amqp_0_10
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/FrameHeader.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/FrameHeader.h
deleted file mode 100644
index b2f0619f9b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/FrameHeader.h
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef QPID_AMQP_0_10_FRAMEHEADER_H
-#define QPID_AMQP_0_10_FRAMEHEADER_H
-
-/*
- *
- * 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 "qpid/amqp_0_10/built_in_types.h"
-#include <boost/shared_array.hpp>
-#include <string.h>
-#include <assert.h>
-#include <iosfwd>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-enum FrameFlags { FIRST_SEGMENT=8, LAST_SEGMENT=4, FIRST_FRAME=2, LAST_FRAME=1 };
-
-class FrameHeader {
- public:
- static const size_t SIZE=12;
- static uint8_t trackFor(SegmentType type) { return type == 0 ? 0 : 1; }
-
- FrameHeader(uint8_t flags_=0, SegmentType type_=SegmentType(), uint16_t size_=0, uint8_t track_=0, uint16_t channel_=0)
- : flags(flags_), type(type_), size(size_), track(track_), channel(channel_)
- {}
-
- uint8_t getFlags() const { return flags; }
- SegmentType getType() const { return type; }
- /** @return size total size of of frame, including frame header. */
- uint16_t getSize() const { return size; }
- /** @return size of frame data, excluding frame header. */
- uint16_t getDataSize() const { return size - SIZE; }
- uint8_t getTrack() const { return track; }
- uint16_t getChannel() const { return channel; }
-
- void setFlags(uint8_t flags_) { flags=flags_; }
- /** Also sets the track. There is no setTrack() */
- void setType(SegmentType type_) { type=type_; track=trackFor(type); }
- /** @param size total size of of frame, including frame header. */
- void setSize(uint16_t size_) { size = size_; }
- /** @param size size of frame data, excluding frame header. */
- void setDataSize(uint16_t size_) { size = size_+SIZE; }
- void setChannel(uint8_t channel_) { channel=channel_; }
-
- bool allFlags(uint8_t f) const { return (flags & f) == f; }
- bool anyFlags(uint8_t f) const { return (flags & f); }
-
- void raiseFlags(uint8_t f) { flags |= f; }
- void clearFlags(uint8_t f) { flags &= ~f; }
-
- bool isComplete() const { return allFlags(FIRST_FRAME | LAST_FRAME); }
-
- bool operator==(const FrameHeader&) const;
-
- template <class S> void serialize(S& s) {
- uint8_t pad8=0; uint32_t pad32=0;
- s(flags)(type)(size)(pad8)(track)(channel)(pad32);
- }
-
- private:
- uint8_t flags;
- SegmentType type;
- uint16_t size;
- uint8_t track;
- uint16_t channel;
-};
-
-std::ostream& operator<<(std::ostream&, const FrameHeader&);
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_FRAMEHEADER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Header.cpp b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Header.cpp
deleted file mode 100644
index 669c960e7f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Header.cpp
+++ /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.
- *
- */
-#include "Header.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-std::ostream& operator<<(std::ostream& o, const Header& h) {
- o << "Header[";
- std::ostream_iterator<Struct32> i(o, " ");
- std::copy(h.begin(), h.end(), i);
- o << "]";
- return o;
-}
-
-}} // namespace qpid::amqp_0_10
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Header.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Header.h
deleted file mode 100644
index 0ce6ad9135..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Header.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef QPID_AMQP_0_10_HEADER_H
-#define QPID_AMQP_0_10_HEADER_H
-
-/*
- *
- * 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 "qpid/amqp_0_10/built_in_types.h"
-#include "qpid/amqp_0_10/Struct32.h"
-#include <vector>
-#include <ostream>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-class Header : public std::vector<Struct32> {
- public:
- Header() {}
-
- template <class S> void serialize(S& s) { s.split(*this); }
- template <class S> void encode(S& s) const { s(this->begin(), this->end()); }
- template <class S> void decode(S& s);
-};
-
-template <class S> void Header::decode(S& s) {
- this->clear();
- while (s.bytesRemaining() > 0) {
- this->push_back(Struct32());
- s(this->back());
- }
-}
-
-std::ostream& operator<<(std::ostream& o, const Header&);
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_HEADER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Holder.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Holder.h
deleted file mode 100644
index 8712db6c86..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Holder.h
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef QPID_AMQP_0_10_HOLDER_H
-#define QPID_AMQP_0_10_HOLDER_H
-
-/*
- *
- * 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 "qpid/framing/Blob.h"
-#include "apply.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-using framing::in_place;
-
-template <class Invokable> struct InvokeVisitor {
- typedef void result_type;
- Invokable& target;
- InvokeVisitor(Invokable& i) : target(i) {}
-
- template <class Action>
- void operator()(const Action& action) { action.invoke(target); }
-};
-
-template <class DerivedHolder, class BaseHeld, size_t Size>
-class Holder : public framing::Blob<Size, BaseHeld> {
- typedef framing::Blob<Size, BaseHeld> Base;
-
- public:
-
- Holder() {}
- template <class T> explicit Holder(const T& value) : Base(value) {}
-
- using Base::operator=;
- Holder& operator=(const BaseHeld& rhs);
-
- uint8_t getCode() const { return this->get()->getCode(); }
- uint8_t getClassCode() const { return this->get()->getClassCode(); }
-
- template <class Invokable> void invoke(Invokable& i) const {
- InvokeVisitor<Invokable> v(i);
- apply(v, *this->get());
- }
-
- template <class S> void encode(S& s) const {
- s(getClassCode())(getCode());
- }
-
- template <class S> void decode(S& s) {
- uint8_t code, classCode;
- s(classCode)(code);
- static_cast<DerivedHolder*>(this)->set(classCode, code);
- }
-
- template <class S> void serialize(S& s) {
- s.split(*this);
- qpid::amqp_0_10::apply(s, *this->get());
- }
-
- template <class T> T* getIf() {
- return (getClassCode()==T::CLASS_CODE && getCode()==T::CODE) ? static_cast<T*>(this->get()) : 0;
- }
-
- template <class T> const T* getIf() const {
- return (getClassCode()==T::CLASS_CODE && getCode()==T::CODE) ? static_cast<T*>(this->get()) : 0;
- }
-
- private:
- struct Assign : public ApplyFunctor<void> {
- Holder& holder;
- Assign(Holder& x) : holder(x) {}
- template <class T> void operator()(const T& rhs) { holder=rhs; }
- };
-};
-
-template <class D, class B, size_t S>
-Holder<D,B,S>& Holder<D,B,S>::operator=(const B& rhs) {
- Assign assign(*this);
- qpid::amqp_0_10::apply(assign, rhs);
- return *this;
-}
-
-
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_HOLDER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Map.cpp b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Map.cpp
deleted file mode 100644
index b517b8baba..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Map.cpp
+++ /dev/null
@@ -1,66 +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 "Map.h"
-#include "qpid/amqp_0_10/Struct32.h"
-#include "qpid/amqp_0_10/Array.h"
-#include <ostream>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-MapValue::MapValue() : code(codeFor(uint8_t(0))), blob(in_place<uint8_t>(0)) {}
-
-MapValue::MapValue(const MapValue& x) : code(x.code), blob(x.blob) {}
-
-bool MapValue::operator==(const MapValue& x) const {
- return code == x.code; // FIXME aconway 2008-04-01: incomplete
-}
-
-struct OstreamVisitor : public MapValue::Visitor<std::ostream&> {
- std::ostream& out;
- OstreamVisitor(std::ostream& o) : out(o) {}
- template <class T> std::ostream& operator()(const T& t) {
- return out << t;
- }
-};
-
-std::ostream& operator<<(std::ostream& o, const MapValue& m) {
- o << typeName(m.getCode()) << ":";
- const_cast<MapValue&>(m).apply_visitor(OstreamVisitor(o));
- return o;
-}
-
-std::ostream& operator<<(std::ostream& o, const Map::value_type& v) {
- return o << v.first << "=" << v.second;
-}
-std::ostream& operator<<(std::ostream& o, const Map& map) {
- o << "map[";
- std::ostream_iterator<Map::value_type> i(o, " ");
- std::copy(map.begin(), map.end(), i);
- return o << "]";
-}
-
-uint32_t Map::contentSize() const {
- // FIXME aconway 2008-04-03: preview to 0-10 mapping: +4 for count.
- return /*4 +*/ Codec::Size()(begin(), end());
-}
-
-}} // namespace qpid::amqp_0_10
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Map.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Map.h
deleted file mode 100644
index 4093b1a0aa..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Map.h
+++ /dev/null
@@ -1,188 +0,0 @@
-#ifndef QPID_AMQP_0_10_MAP_H
-#define QPID_AMQP_0_10_MAP_H
-
-/*
- *
- * 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 ang
- * "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 "qpid/Exception.h"
-#include "qpid/amqp_0_10/built_in_types.h"
-#include "qpid/amqp_0_10/UnknownType.h"
-#include "qpid/amqp_0_10/CodeForType.h"
-#include "qpid/amqp_0_10/TypeForCode.h"
-#include "qpid/amqp_0_10/Codec.h"
-#include "qpid/framing/Blob.h"
-#include <map>
-#include <string>
-#include <iosfwd>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-class Map;
-
-class MapValue {
- public:
- struct BadTypeException : public Exception {};
-
- template <class R> struct Visitor { typedef R result_type; };
-
- MapValue();
- MapValue(const MapValue& x);
- template <class T> explicit MapValue(const T& t);
- template <class T> MapValue& operator=(const T& t);
-
- template <class T> T* get();
- template <class T> const T* get() const;
-
- template <class V> typename V::result_type apply_visitor(V&);
- template <class V> typename V::result_type apply_visitor(const V&);
-
- uint8_t getCode() const { return code; }
-
- bool operator==(const MapValue&) const;
-
- template <class S> void serialize(S& s) { s(code); s.split(*this); }
- template <class S> void encode(S& s) const {
- const_cast<MapValue*>(this)->apply_visitor(s);
- }
- template <class S> void decode(S& s) {
- DecodeVisitor<S> dv(blob, s);
- qpid::amqp_0_10::apply_visitor(dv, code);
- }
-
-
- private:
- // TODO aconway 2008-04-15: Estimate required size, we will get a
- // compile error from static_assert in Blob.h if the estimate is too
- // low. We can't use sizeof() directly because #include Struct32.h
- // creates a circular dependency. Needs a better solution.
- static const size_t SIZE=256;
- typedef framing::Blob<SIZE> Blob;
-
- template <class V> struct VisitVisitor;
- template <class T> struct GetVisitor;
- template <class D> struct DecodeVisitor;
-
- uint8_t code;
- Blob blob;
-};
-
-class Map : public std::map<Str8, MapValue> {
- public:
- template <class S> void serialize(S& s) { s.split(*this); }
- template <class S> void encode(S& s) const;
- // Shortcut calculation for size.
- void encode(Codec::Size& s) const { s.raw(0, contentSize() + 4/*size*/); }
-
- template <class S> void decode(S& s);
-
- private:
- uint32_t contentSize() const;
-};
-
-std::ostream& operator<<(std::ostream&, const MapValue&);
-std::ostream& operator<<(std::ostream&, const Map::value_type&);
-std::ostream& operator<<(std::ostream&, const Map&);
-
-using framing::in_place;
-
-template <class T> MapValue::MapValue(const T& t) : code(codeFor(t)), blob(in_place<t>()) {}
-
-template <class T> MapValue& MapValue::operator=(const T& t) {
- code=codeFor(t);
- blob=t;
- return *this;
-}
-
-template <class V> struct MapValue::VisitVisitor {
- typedef typename V::result_type result_type;
- V& visitor;
- Blob& blob;
- VisitVisitor(V& v, Blob& b) : visitor(v), blob(b) {}
-
- template <class T> result_type operator()(T*) {
- return visitor(*reinterpret_cast<T*>(blob.get()));
- }
-};
-
-template <class V> typename V::result_type MapValue::apply_visitor(V& v) {
- VisitVisitor<V> visitor(v, blob);
- return qpid::amqp_0_10::apply_visitor(visitor, code);
-}
-
-template <class R> struct MapValue::GetVisitor {
- typedef R* result_type;
- const MapValue::Blob& blob;
-
- GetVisitor(const MapValue::Blob& b) : blob(b) {}
-
- R* operator()(R& r) { return &r; }
- template <class T> R* operator()(T&) { return 0; }
-};
-
-template <class D> struct MapValue::DecodeVisitor {
- typedef void result_type;
- MapValue::Blob& blob;
- D& decoder;
- DecodeVisitor(Blob& b, D& d) : blob(b), decoder(d) {}
-
- template <class T> void operator()(T*) {
- T t;
- decoder(t);
- blob = t;
- }
-};
-
-template <class T> T* MapValue::get() { return apply_visitor(GetVisitor<T>(blob)); }
-template <class T> const T* MapValue::get() const { return apply_visitor(GetVisitor<const T>()); }
-
-template <class V> typename V::result_type MapValue::apply_visitor(const V& v) {
- return apply_visitor(const_cast<V&>(v));
-}
-
-template <class S> void Map::encode(S& s) const {
- // FIXME aconway 2008-04-03: replace preview mapping with 0-10 mapping:
- // s(contentSize())(uint32_t(size())); // size, count
- s(contentSize());
- for (const_iterator i = begin(); i != end(); ++i)
- s(i->first)(i->second); // key (type value)
-}
-
-template <class S> void Map::decode(S& s) {
- uint32_t decodedSize /*, count*/;
- // FIXME aconway 2008-04-03: replace preview mapping with 0-10 mapping:
- // s(contentSize())(uint32_t(size())); // size, count
- // s(decodedSize)(count);
- s(decodedSize);
- typename S::ScopedLimit l(s, decodedSize); // Make sure we don't overrun.
- // FIXME aconway 2008-04-03: replace preview with 0-10:
- // for ( ; count > 0; --count) {
- while (s.bytesRemaining() > 0) {
- key_type k; MapValue v;
- s(k)(v);
- insert(value_type(k,v));
- }
-}
-
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_MAP_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Packer.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Packer.h
deleted file mode 100644
index c38e3a7efa..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Packer.h
+++ /dev/null
@@ -1,195 +0,0 @@
-#ifndef QPID_PACKER_H
-#define QPID_PACKER_H
-
-/*
- *
- * 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 <boost/optional.hpp>
-#include <boost/none.hpp>
-#include "qpid/amqp_0_10/built_in_types.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-/** Serialization for optional values */
-template <class T> struct SerializableOptional {
- boost::optional<T>& optional;
- SerializableOptional(boost::optional<T>& x) : optional(x) {}
- template <class S> void serialize(S& s) {
- if (optional)
- s(*optional);
- }
-};
-
-}}
-
-
-namespace boost { // For argument dependent lookup.
-
-template <class T>
-qpid::amqp_0_10::SerializableOptional<T> serializable(boost::optional<T>& x) {
- return qpid::amqp_0_10::SerializableOptional<T>(x);
-}
-
-} // namespace boost
-
-namespace qpid {
-namespace amqp_0_10 {
-
-/** "Encoder" that encodes a struct as a set of bit flags
- * for all non-empty members.
- */
-class PackBits {
- public:
- PackBits() : bit(1), bits(0) {}
-
- void setBit(bool b) { if (b) bits |= bit; bit <<= 1; }
- uint32_t getBits() { return bits; }
-
- /** The bit is always set for non-optional values. */
- template <class T>
- PackBits& operator()(const T&) { setBit(1); return *this; }
-
- /** For optional values the bit is set if the value is present. */
- template <class T> PackBits& operator()(const boost::optional<T>& opt) {
- setBit(opt); return *this;
- }
-
- /** Bits are special optional values */
- PackBits& operator()(Bit b) { setBit(b); return *this; }
-
- private:
- uint32_t bit;
- uint32_t bits;
-};
-
-/** Bit mask to encode a packable struct */
-template<class T> uint32_t packBits(const T& t) {
- PackBits pack;
- const_cast<T&>(t).serialize(pack);
- return pack.getBits();
-}
-
-/** Decode members enabled by Bits */
-template <class Decoder, class Bits>
-class PackedDecoder {
- public:
- PackedDecoder(Decoder& d, Bits b) : decode(d), bits(b) {}
-
- template <class T> PackedDecoder& operator()(T& t) {
- if (bits & 1)
- decode(t);
- else
- t = T();
- // FIXME aconway 2008-04-10: When we have all optionals
- // represented by boost::optional the line above should be:
- // throw CommandInvalidException("A required value was omitted.");
- bits >>= 1;
- return *this;
- }
-
- template <class T> PackedDecoder& operator()(boost::optional<T>& opt) {
- if (bits & 1) {
- opt = T();
- decode(*opt);
- }
- else
- opt = boost::none;
- bits >>= 1;
- return *this;
- }
-
- private:
- Decoder& decode;
- Bits bits;
-};
-
-/** Metafunction to compute type to contain pack bits. */
-template <int Bytes> struct UintOfSize;
-template <> struct UintOfSize<1> { typedef uint8_t type; };
-template <> struct UintOfSize<2> { typedef uint16_t type; };
-template <> struct UintOfSize<4> { typedef uint32_t type; };
-
-/**
- * Helper to serialize packed structs.
- */
-template <class T> class Packer
-{
- public:
- typedef typename UintOfSize<T::PACK>::type Bits;
-
- Packer(T& t) : data(t) {}
-
- template <class S> void serialize(S& s) { s.split(*this); }
-
- template <class S> void encode(S& s) const {
- Bits bits = packBits(data);
- s.littleEnd(bits);
- data.serialize(s);
- }
-
- template <class S> void decode(S& s) {
- Bits bits;
- s.littleEnd(bits);
- PackedDecoder<S, Bits> decode(s, bits);
- data.serialize(decode);
- }
-
-
- protected:
- T& data;
-};
-
-template <class T, uint8_t=T::SIZE> struct SizedPacker : public Packer<T> {
- typedef typename UintOfSize<T::SIZE>::type Size;
-
- SizedPacker(T& t) : Packer<T>(t) {}
-
- template <class S> void serialize(S& s) {
- s.split(*this);
- }
-
- template <class S> void encode(S& s) const {
- Codec::Size sizer;
- this->data.serialize(sizer);
- Size size=size_t(sizer)+T::PACK; // Size with pack bits.
- s(size);
- Packer<T>::encode(s);
- }
-
- template <class S> void decode(S& s) {
- Size size;
- s(size);
- typename S::ScopedLimit l(s, size);
- Packer<T>::decode(s);
- }
-
-};
-
-template <class T> struct SizedPacker<T,0> : public Packer<T> {
- SizedPacker(T& t) : Packer<T>(t) {}
-};
-
-}} // namespace qpid::amqp_0_10
-
-
-
-#endif /*!QPID_PACKER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SerializableString.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SerializableString.h
deleted file mode 100644
index 485b7ca6a8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SerializableString.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef QPID_AMQP_0_10_SERIALIZABLESTRING_H
-#define QPID_AMQP_0_10_SERIALIZABLESTRING_H
-
-/*
- *
- * 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 qpid {
-namespace amqp_0_10 {
-
-/** Template for length-prefixed strings/arrays.
- * Unique parameter allows creation of distinct SerializableString
- * types with the smae T/SizeType
- */
-template <class T, class SizeType, int Unique=0>
-struct SerializableString : public std::basic_string<T> {
- SerializableString() {}
- template <class U> SerializableString(const U& u) : std::basic_string<T>(u) {}
- template <class I> SerializableString(const I& i, const I& j) : std::basic_string<T>(i,j) {}
-
- using std::basic_string<T>::operator=;
-
- template <class S> void serialize(S& s) { s.split(*this); }
-
- template <class S> void encode(S& s) const {
- s(SizeType(this->size()))(this->begin(), this->end());
- }
-
- template <class S> void decode(S& s) {
- SizeType newSize;
- s(newSize);
- this->resize(newSize);
- s(this->begin(), this->end());
- }
-};
-
-// TODO aconway 2008-02-29: separate ostream ops
-template <class T, class SizeType>
-std::ostream& operator<<(std::ostream& o, const SerializableString<T,SizeType>& s) {
- const std::basic_string<T> str(s);
- return o << str.c_str(); // TODO aconway 2008-02-29: why doesn't o<<str work?
-}
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_SERIALIZABLESTRING_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp
deleted file mode 100644
index 0e57e4b3f1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.cpp
+++ /dev/null
@@ -1,316 +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 "SessionHandler.h"
-#include "qpid/SessionState.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/framing/AllInvoker.h"
-#include "qpid/framing/enum.h"
-#include "qpid/log/Statement.h"
-
-
-#include <boost/bind.hpp>
-
-namespace qpid {
-namespace amqp_0_10 {
-using namespace framing;
-using namespace std;
-
-SessionHandler::SessionHandler(FrameHandler* out, ChannelId ch)
- : channel(ch, out), peer(channel), ignoring(false), sendReady(), receiveReady() {}
-
-SessionHandler::~SessionHandler() {}
-
-namespace {
-bool isSessionControl(AMQMethodBody* m) {
- return m &&
- m->amqpClassId() == SESSION_CLASS_ID;
-}
-bool isSessionDetachedControl(AMQMethodBody* m) {
- return isSessionControl(m) &&
- m->amqpMethodId() == SESSION_DETACHED_METHOD_ID;
-}
-
-session::DetachCode convert(uint8_t code) {
- switch(code) {
- case 0: return session::DETACH_CODE_NORMAL;
- case 1: return session::DETACH_CODE_SESSION_BUSY;
- case 2: return session::DETACH_CODE_TRANSPORT_BUSY;
- case 3: return session::DETACH_CODE_NOT_ATTACHED;
- case 4: default: return session::DETACH_CODE_UNKNOWN_IDS;
- }
-}
-
-} // namespace
-
-void SessionHandler::checkAttached() {
- if (!getState())
- throw NotAttachedException(
- QPID_MSG("Channel " << channel.get() << " is not attached"));
- assert(getInHandler());
- assert(channel.next);
-}
-
-void SessionHandler::invoke(const AMQMethodBody& m) {
- framing::invoke(*this, m);
-}
-
-void SessionHandler::handleIn(AMQFrame& f) {
- // Note on channel states: a channel is attached if session != 0
- AMQMethodBody* m = f.getBody()->getMethod();
- try {
- if (ignoring && !isSessionDetachedControl(m))
- return;
- else if (isSessionControl(m))
- invoke(*m);
- else {
- checkAttached();
- if (!receiveReady)
- throw IllegalStateException(QPID_MSG(getState()->getId() << ": Not ready to receive data"));
- if (!getState()->receiverRecord(f))
- return; // Ignore duplicates.
- if (getState()->receiverNeedKnownCompleted())
- sendCompletion();
- getInHandler()->handle(f);
- }
- }
- catch(const SessionException& e) {
- QPID_LOG(error, "Execution exception: " << e.what());
- framing::AMQP_AllProxy::Execution execution(channel);
- AMQMethodBody* m = f.getMethod();
- SequenceNumber commandId;
- if (getState()) commandId = getState()->receiverGetCurrent();
- execution.exception(e.code, commandId, m ? m->amqpClassId() : 0, m ? m->amqpMethodId() : 0, 0, e.what(), FieldTable());
- detaching();
- sendDetach();
- }
- catch(const ChannelException& e){
- QPID_LOG(error, "Channel exception: " << e.what());
- peer.detached(name, e.code);
- }
- catch(const ConnectionException& e) {
- QPID_LOG(error, "Connection exception: " << e.what());
- connectionException(e.code, e.getMessage());
- }
- catch(const std::exception& e) {
- QPID_LOG(error, "Unexpected exception: " << e.what());
- connectionException(connection::CLOSE_CODE_FRAMING_ERROR, e.what());
- }
-}
-
-namespace {
-bool isControl(const AMQFrame& f) {
- return f.getMethod() && f.getMethod()->type() == framing::SEGMENT_TYPE_CONTROL;
-}
-bool isCommand(const AMQFrame& f) {
- return f.getMethod() && f.getMethod()->type() == framing::SEGMENT_TYPE_COMMAND;
-}
-} // namespace
-
-void SessionHandler::handleOut(AMQFrame& f) {
- checkAttached();
- if (!sendReady)
- throw IllegalStateException(QPID_MSG(getState()->getId() << ": Not ready to send data"));
- getState()->senderRecord(f);
- if (isCommand(f) && getState()->senderNeedFlush()) {
- peer.flush(false, false, true);
- getState()->senderRecordFlush();
- }
- channel.handle(f);
-}
-
-void SessionHandler::checkName(const std::string& name) {
- checkAttached();
- if (name != getState()->getId().getName())
- throw InvalidArgumentException(
- QPID_MSG("Incorrect session name: " << name
- << ", expecting: " << getState()->getId().getName()));
-}
-
-void SessionHandler::attach(const std::string& name_, bool force) {
- // Save the name for possible session-busy exception. Session-busy
- // can be thrown before we have attached the handler to a valid
- // SessionState, and in that case we need the name to send peer.detached
- name = name_;
- if (getState() && name == getState()->getId().getName())
- return; // Idempotent
- if (getState())
- throw TransportBusyException(
- QPID_MSG("Channel " << channel.get() << " already attached to " << getState()->getId()));
- setState(name, force);
- QPID_LOG(debug, "Attached channel " << channel.get() << " to " << getState()->getId());
- peer.attached(name);
- if (getState()->hasState())
- peer.flush(true, true, true);
- else
- sendCommandPoint(getState()->senderGetCommandPoint());
-}
-
-void SessionHandler::attached(const std::string& name) {
- checkName(name);
-}
-
-void SessionHandler::detach(const std::string& name) {
- checkName(name);
- peer.detached(name, session::DETACH_CODE_NORMAL);
- handleDetach();
-}
-
-void SessionHandler::detached(const std::string& name, uint8_t code) {
- checkName(name);
- ignoring = false;
- if (code != session::DETACH_CODE_NORMAL)
- channelException(convert(code), "session.detached from peer.");
- else {
- handleDetach();
- }
-}
-
-void SessionHandler::handleDetach() {
- sendReady = receiveReady = false;
-}
-
-void SessionHandler::requestTimeout(uint32_t t) {
- checkAttached();
- getState()->setTimeout(t);
- peer.timeout(t);
-}
-
-void SessionHandler::timeout(uint32_t t) {
- checkAttached();
- getState()->setTimeout(t);
-}
-
-void SessionHandler::commandPoint(const SequenceNumber& id, uint64_t offset) {
- checkAttached();
- getState()->receiverSetCommandPoint(SessionPoint(id, offset));
- if (!receiveReady) {
- receiveReady = true;
- readyToReceive();
- }
-}
-
-void SessionHandler::expected(const SequenceSet& commands, const Array& /*fragments*/) {
- checkAttached();
- if (getState()->hasState()) { // Replay
- if (commands.empty()) throw IllegalStateException(
- QPID_MSG(getState()->getId() << ": has state but client is attaching as new session."));
- // TODO aconway 2008-05-12: support replay of partial commands.
- // Here we always round down to the last command boundary.
- SessionPoint expectedPoint = commands.empty() ? SequenceNumber(0) : SessionPoint(commands.front(),0);
- SessionState::ReplayRange replay = getState()->senderExpected(expectedPoint);
- sendCommandPoint(expectedPoint);
- std::for_each(replay.begin(), replay.end(), out); // replay
- }
- else
- sendCommandPoint(getState()->senderGetCommandPoint());
-}
-
-void SessionHandler::confirmed(const SequenceSet& commands, const Array& /*fragments*/) {
- checkAttached();
- // Ignore non-contiguous confirmations.
- if (!commands.empty() && commands.front() >= getState()->senderGetReplayPoint())
- getState()->senderConfirmed(commands.rangesBegin()->last());
-}
-
-void SessionHandler::completed(const SequenceSet& commands, bool timelyReply) {
- checkAttached();
- getState()->senderCompleted(commands);
- if (getState()->senderNeedKnownCompleted() || timelyReply) {
- peer.knownCompleted(commands);
- getState()->senderRecordKnownCompleted();
- }
-}
-
-void SessionHandler::knownCompleted(const SequenceSet& commands) {
- checkAttached();
- getState()->receiverKnownCompleted(commands);
-}
-
-void SessionHandler::flush(bool expected, bool confirmed, bool completed) {
- checkAttached();
- if (expected) {
- SequenceSet expectSet;
- if (getState()->hasState())
- expectSet.add(getState()->receiverGetExpected().command);
- peer.expected(expectSet, Array());
- }
- if (confirmed) {
- SequenceSet confirmSet;
- if (!getState()->receiverGetUnknownComplete().empty())
- confirmSet.add(getState()->receiverGetUnknownComplete().front(),
- getState()->receiverGetReceived().command);
- peer.confirmed(confirmSet, Array());
- }
- if (completed)
- peer.completed(getState()->receiverGetUnknownComplete(), true);
-}
-
-void SessionHandler::gap(const SequenceSet& /*commands*/) {
- throw NotImplementedException("session.gap not supported");
-}
-
-void SessionHandler::sendDetach()
-{
- checkAttached();
- ignoring = true;
- peer.detach(getState()->getId().getName());
-}
-
-void SessionHandler::sendCompletion() {
- checkAttached();
- const SequenceSet& c = getState()->receiverGetUnknownComplete();
- peer.completed(c, getState()->receiverNeedKnownCompleted());
-}
-
-void SessionHandler::sendAttach(bool force) {
- checkAttached();
- QPID_LOG(debug, "SessionHandler::sendAttach attach id=" << getState()->getId());
- peer.attach(getState()->getId().getName(), force);
- if (getState()->hasState())
- peer.flush(true, true, true);
- else
- sendCommandPoint(getState()->senderGetCommandPoint());
-}
-
-void SessionHandler::sendCommandPoint(const SessionPoint& point) {
- peer.commandPoint(point.command, point.offset);
- if (!sendReady) {
- sendReady = true;
- readyToSend();
- }
-}
-
-void SessionHandler::sendTimeout(uint32_t t) {
- checkAttached();
- peer.requestTimeout(t);
-}
-
-void SessionHandler::sendFlush() {
- peer.flush(false, true, true);
-}
-
-bool SessionHandler::ready() const {
- return sendReady && receiveReady;
-}
-
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.h
deleted file mode 100644
index 016de454cc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/SessionHandler.h
+++ /dev/null
@@ -1,114 +0,0 @@
-#ifndef QPID_AMQP_0_10_SESSIONHANDLER_H
-#define QPID_AMQP_0_10_SESSIONHANDLER_H
-
-/*
- *
- * 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 "qpid/framing/ChannelHandler.h"
-#include "qpid/framing/AMQP_AllProxy.h"
-#include "qpid/framing/AMQP_AllOperations.h"
-#include "qpid/SessionState.h"
-
-namespace qpid {
-
-
-namespace amqp_0_10 {
-
-/**
- * Base SessionHandler with logic common to both client and broker.
- *
- * A SessionHandler is associated with a channel and can be attached
- * to a session state.
- */
-
-class SessionHandler : public framing::AMQP_AllOperations::SessionHandler,
- public framing::FrameHandler::InOutHandler
-{
- public:
- SessionHandler(framing::FrameHandler* out=0, uint16_t channel=0);
- ~SessionHandler();
-
- void setChannel(uint16_t ch) { channel = ch; }
- uint16_t getChannel() const { return channel.get(); }
-
- void setOutHandler(framing::FrameHandler& h) { channel.next = &h; }
-
- virtual SessionState* getState() = 0;
- virtual framing::FrameHandler* getInHandler() = 0;
-
- // Non-protocol methods, called locally to initiate some action.
- void sendDetach();
- void sendCompletion();
- void sendAttach(bool force);
- void sendTimeout(uint32_t t);
- void sendFlush();
-
- /** True if the handler is ready to send and receive */
- bool ready() const;
-
- // Protocol methods
- void attach(const std::string& name, bool force);
- void attached(const std::string& name);
- void detach(const std::string& name);
- void detached(const std::string& name, uint8_t code);
-
- void requestTimeout(uint32_t t);
- void timeout(uint32_t t);
-
- void commandPoint(const framing::SequenceNumber& id, uint64_t offset);
- void expected(const framing::SequenceSet& commands, const framing::Array& fragments);
- void confirmed(const framing::SequenceSet& commands,const framing::Array& fragments);
- void completed(const framing::SequenceSet& commands, bool timelyReply);
- void knownCompleted(const framing::SequenceSet& commands);
- void flush(bool expected, bool confirmed, bool completed);
- void gap(const framing::SequenceSet& commands);
-
- protected:
- virtual void invoke(const framing::AMQMethodBody& m);
-
- virtual void setState(const std::string& sessionName, bool force) = 0;
- virtual void channelException(framing::session::DetachCode code, const std::string& msg) = 0;
- virtual void connectionException(framing::connection::CloseCode code, const std::string& msg) = 0;
- virtual void detaching() = 0;
-
- // Notification of events
- virtual void readyToSend() {}
- virtual void readyToReceive() {}
-
- virtual void handleDetach();
- virtual void handleIn(framing::AMQFrame&);
- virtual void handleOut(framing::AMQFrame&);
-
- void checkAttached();
- void checkName(const std::string& name);
-
- framing::ChannelHandler channel;
- framing::AMQP_AllProxy::Session peer;
- bool ignoring;
- bool sendReady, receiveReady;
- std::string name;
-
- private:
- void sendCommandPoint(const SessionPoint&);
-};
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_SESSIONHANDLER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct.h
deleted file mode 100644
index c0cea09c60..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef QPID_AMQP_0_10_STRUCT_H
-#define QPID_AMQP_0_10_STRUCT_H
-
-/*
- *
- * 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 "built_in_types.h"
-#include <iosfwd>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-// Base classes for complex types.
-
-template <class V, class CV, class H> struct Visitable {
- typedef V Visitor;
- typedef CV ConstVisitor;
- typedef H Holder;
-
- virtual ~Visitable() {}
- virtual void accept(Visitor&) = 0;
- virtual void accept(ConstVisitor&) const = 0;
-};
-
-
-// Note: only coded structs inherit from Struct.
-struct StructVisitor;
-struct ConstStructVisitor;
-struct StructHolder;
-struct Struct
- : public Visitable<StructVisitor, ConstStructVisitor, StructHolder>
-{
- uint8_t getCode() const;
- uint8_t getPack() const;
- uint8_t getSize() const;
- uint8_t getClassCode() const;
-};
-std::ostream& operator<<(std::ostream&, const Struct&);
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_STRUCT_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct32.cpp b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct32.cpp
deleted file mode 100644
index 541f02bcc4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct32.cpp
+++ /dev/null
@@ -1,36 +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 "Struct32.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-Struct32::Struct32() {
- // FIXME aconway 2008-04-16: this is only here to force a valid
- // default-constructed Struct32 for serialize tests, clean up.
- *this = in_place<message::MessageResumeResult>();
-}
-
-std::ostream& operator<<(std::ostream& o, const Struct32& s) {
- return o << static_cast<const StructHolder&>(s);
-}
-
-}} // namespace qpid::amqp_0_10
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct32.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct32.h
deleted file mode 100644
index 2ed73e0b4c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Struct32.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef QPID_AMQP_0_10_STRUCT32_H
-#define QPID_AMQP_0_10_STRUCT32_H
-
-/*
- *
- * 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 "qpid/amqp_0_10/StructHolder.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-class Struct32 : public StructHolder
-{
- public:
- Struct32();
-
- template <class T> explicit Struct32(const T& t) : StructHolder(t) {}
-
- template <class S> void serialize(S& s) { s.split(*this); }
-
- using StructHolder::operator=;
-
- template <class S> void encode(S& s) const {
- s(contentSize());
- const_cast<Struct32*>(this)->StructHolder::serialize(s);
- }
-
- template <class S> void decode(S& s) {
- uint32_t contentSz;
- s(contentSz);
- typename S::ScopedLimit l(s, contentSz);
- StructHolder::serialize(s);
- }
-
- private:
- uint32_t contentSize() const {
- return Codec::size(static_cast<const StructHolder&>(*this));
- }
-
-};
-
-std::ostream& operator<<(std::ostream&, const Struct32&);
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_STRUCT32_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Unit.cpp b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Unit.cpp
deleted file mode 100644
index 75ea1c1b30..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Unit.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 "Unit.h"
-#include "Codec.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-void Unit::updateVariant() {
- switch (header.getType()) {
- case CONTROL: variant=ControlHolder(); break;
- case COMMAND: variant=CommandHolder(); break;
- case HEADER: variant=Header(); break;
- case BODY: variant=Body(header.getDataSize()); break;
- default: assert(0); // FIXME aconway 2008-04-14: exception?
- }
-}
-
-struct GetTypeVisitor : public boost::static_visitor<SegmentType> {
- SegmentType operator()(const CommandHolder& ) const { return COMMAND; }
- SegmentType operator()(const ControlHolder& ) const { return CONTROL; }
- SegmentType operator()(const Header& ) const { return HEADER; }
- SegmentType operator()(const Body&) const { return BODY; }
-};
-
-struct GetFlagsVisitor : public boost::static_visitor<uint8_t> {
- uint8_t operator()(const CommandHolder& ) const { return FIRST_FRAME|LAST_FRAME|FIRST_SEGMENT; }
- uint8_t operator()(const ControlHolder& ) const { return FIRST_FRAME|LAST_FRAME|FIRST_SEGMENT; }
- uint8_t operator()(const Header& ) const { return FIRST_FRAME|LAST_FRAME; }
- uint8_t operator()(const Body&) const { return 0; }
-};
-
-void Unit::updateHeader(uint8_t flags) {
- GetFlagsVisitor flagger;
- header.setFlags(flags | variant.apply_visitor(flagger));
- GetTypeVisitor getter;
- header.setType(variant.apply_visitor(getter));
- header.setDataSize(Codec::size(*this));
- // track automatically set from type.
- // no channel specified at this point.
-}
-
-std::ostream& operator<<(std::ostream& o, const Unit& u) {
- return o << u.getHeader() << " " << u.variant.type().name() << "[" << u.variant << "]";
-}
-
-}} // namespace qpid::amqp_0_10
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Unit.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Unit.h
deleted file mode 100644
index 0229e07419..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/Unit.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef QPID_AMQP_0_10_UNIT_H
-#define QPID_AMQP_0_10_UNIT_H
-
-/*
- *
- * 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 "qpid/amqp_0_10/ControlHolder.h"
-#include "qpid/amqp_0_10/CommandHolder.h"
-#include "qpid/amqp_0_10/Header.h"
-#include "qpid/amqp_0_10/Body.h"
-#include "qpid/amqp_0_10/FrameHeader.h"
-
-#include <boost/variant.hpp>
-#include <ostream>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-/**
- * A Unit contains a frame header and associated value.
- * For all types except BODY the frame header is for a complete segment.
- */
-class Unit {
- public:
- explicit Unit(const FrameHeader& h=FrameHeader()) : header(h) { updateVariant(); }
-
- /**
- *@param flags: is ORed with the required flags for type T.
- */
- template <class T>
- explicit Unit(const T& t, uint8_t flags=0) : variant(t) { updateHeader(flags); }
-
- void setHeader(FrameHeader& h) { header = h; updateVariant(); }
- const FrameHeader& getHeader() const { return header; }
-
- template<class T> const T* get() const { return boost::get<T>(&variant); }
- template<class T> T* get() { return boost::get<T>(&variant); }
- template<class T> Unit& operator=(const T& t) { variant=t; return *this; }
-
- template <class V> typename V::result_type applyVisitor(V& v) const {
- variant.apply_visitor(v);
- }
-
- template <class S> void serialize(S& s) { variant.apply_visitor(s); s.split(*this); }
- template <class S> void encode(S&) const {}
- template <class S> void decode(S&) { updateHeader(header.getFlags()); }
-
- private:
- typedef boost::variant<ControlHolder, CommandHolder, Header, Body> Variant;
-
- void updateHeader(uint8_t flags);
- void updateVariant();
-
- Variant variant;
- FrameHeader header;
-
- friend std::ostream& operator<<(std::ostream& o, const Unit& u);
-};
-
-std::ostream& operator<<(std::ostream& o, const Unit& u);
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_UNIT_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnitHandler.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnitHandler.h
deleted file mode 100644
index 93a8ce573a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnitHandler.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef QPID_AMQP_0_10_UNITHANDLER_H
-#define QPID_AMQP_0_10_UNITHANDLER_H
-
-/*
- *
- * 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 "qpid/framing/Handler.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-class Unit;
-typedef framing::Handler<const Unit&> UnitHandler;
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_UNITHANDLER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownStruct.cpp b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownStruct.cpp
deleted file mode 100644
index 35445054c9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownStruct.cpp
+++ /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.
- *
- */
-
-#include "qpid/amqp_0_10/StructVisitor.h"
-#include "qpid/amqp_0_10/UnknownStruct.h"
-
-namespace qpid {
-namespace amqp_0_10 {
-
-void UnknownStruct::accept(Visitor& v) { v.visit(*this); }
-void UnknownStruct::accept(ConstVisitor& v) const { v.visit(*this); }
-std::ostream& operator<<(std::ostream& o, const UnknownStruct& u) {
- return o << "UnknownStruct[class=" << u.getClassCode() << " code=" << u.getCode() << "]";
-}
-
-}} // namespace qpid::amqp_0_10
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownStruct.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownStruct.h
deleted file mode 100644
index 1c66d8e6af..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownStruct.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef QPID_AMQP_0_10_UNKNOWNSTRUCT_H
-#define QPID_AMQP_0_10_UNKNOWNSTRUCT_H
-
-/*
- *
- * 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 "qpid/amqp_0_10/Struct.h"
-#include <string>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-class UnknownStruct : public Struct {
- public:
- static const uint8_t SIZE=4;
- static const uint8_t PACK=2;
-
- template <class S> void serialize(S& s) { s.split(*this); s(data.begin(), data.end()); }
- template <class S> void encode(S&) const { }
- template <class S> void decode(S& s) { data.resize(s.bytesRemaining()); }
-
- UnknownStruct(uint8_t cc=0, uint8_t c=0) : classCode(cc), code(c) {}
- void accept(Visitor&);
- void accept(ConstVisitor&) const;
-
- uint8_t getClassCode() const { return classCode; }
- uint8_t getCode() const { return code; }
-
- private:
- uint8_t classCode, code;
- std::string data;
-};
-
-std::ostream& operator<<(std::ostream&, const UnknownStruct&);
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_UNKNOWNSTRUCT_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownType.cpp b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownType.cpp
deleted file mode 100644
index 844891d732..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownType.cpp
+++ /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.
- *
- */
-#include "UnknownType.h"
-#include <boost/range/iterator_range.hpp>
-#include <ostream>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-UnknownType::Width UnknownType::WidthTable[16] = {
- { 1, 0 },
- { 2, 0 },
- { 4, 0 },
- { 8, 0 },
- { 16, 0 },
- { 32, 0 },
- { 64, 0 },
- { 128, 0 },
- { 0, 1 },
- { 0, 2 },
- { 0, 4 },
- { -1, -1 }, // Invalid
- { 5, 0 },
- { 9, 0 },
- { -1, -1 }, // Invalid
- { 0, 0 }
-};
-
-int UnknownType::fixed() const { return WidthTable[code>>4].fixed; }
-int UnknownType::variable() const { return WidthTable[code>>4].variable; }
-UnknownType::UnknownType(uint8_t c) : code(c) { data.resize(fixed()); }
-
-std::ostream& operator<<(std::ostream& o, const UnknownType& u) {
- return o << boost::make_iterator_range(u.begin(), u.end()) << std::endl;
-}
-
-}} // namespace qpid::amqp_0_10
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownType.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownType.h
deleted file mode 100644
index 1e4aa04bf4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/UnknownType.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef QPID_AMQP_0_10_UNKNOWNTYPE_H
-#define QPID_AMQP_0_10_UNKNOWNTYPE_H
-
-/*
- *
- * 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 <vector>
-#include <iosfwd>
-#include <stdint.h>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-/** Encode/decode an unknown type based on typecode. */
-class UnknownType {
- public:
- UnknownType(uint8_t code=0);
- uint8_t getCode() const { return code; }
- /** Size of fixed type or 0 if not fixed/0-length. -1 invalid */
- int fixed() const;
- /** Bytes in size type for variable width. -1 invalid */
- int variable() const;
-
- typedef std::vector<char>::const_iterator const_iterator;
- const_iterator begin() const { return data.begin(); }
- const_iterator end() const { return data.end(); }
- size_t size() const { return data.size(); }
-
- template <class S> void serialize(S& s) { s.split(*this); }
- template <class S> void encode(S& s) const;
- template <class S> void decode(S& s);
-
- private:
- uint8_t code;
- struct Width { int fixed; int variable; };
- static Width WidthTable[16];
-
- std::vector<char> data;
-};
-
-template <class S> void UnknownType::encode(S& s) const {
- switch (variable()) {
- case 0: break;
- case 1: s(uint8_t(data.size())); break;
- case 2: s(uint16_t(data.size())); break;
- case 4: s(uint32_t(data.size())); break;
- }
- s(data.begin(), data.end());
-}
-
-template <class S> void UnknownType::decode(S& s) {
- uint32_t s8;
- uint32_t s16;
- uint32_t s32;
- switch (variable()) {
- case 0: break;
- case 1: s(s8); data.resize(s8); break;
- case 2: s(s16); data.resize(s16); break;
- case 4: s(s32); data.resize(s32); break;
- }
- s(data.begin(), data.end());
-}
-
-inline uint8_t codeFor(const UnknownType& u) { return u.getCode(); }
-
-std::ostream& operator<<(std::ostream&, const UnknownType&);
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_UNKNOWNTYPE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/apply.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/apply.h
deleted file mode 100644
index f32b3482ef..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/apply.h
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef QPID_AMQP_0_10_APPLY_H
-#define QPID_AMQP_0_10_APPLY_H
-
-/*
- *
- * 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 <boost/optional.hpp>
-
-namespace qpid {
-namespace amqp_0_10 {
-
-template <class F, class R=typename F::result_type> struct FunctionAndResult {
- F* functor;
- boost::optional<R> result;
-
- FunctionAndResult() : functor(0) {}
- template <class T> void invoke(T& t) { result=(*functor)(t); }
- template <class T> void invoke(const T& t) { result=(*functor)(t); }
- R getResult() { return *result; }
-};
-
-// void result is special case.
-template <class F> struct FunctionAndResult<F, void> {
- F* functor;
-
- FunctionAndResult() : functor(0) {}
- template <class T> void invoke(T& t) { (*functor)(t); }
- void getResult() {}
-};
-
-// Metafunction returning correct abstract visitor for Visitable type.
-template <class Visitable> struct VisitorType {
- typedef typename Visitable::Visitor type;
-};
-template <class Visitable> struct VisitorType<const Visitable> {
- typedef typename Visitable::ConstVisitor type;
-};
-
-template <class Visitor, class F>
-struct ApplyVisitorBase : public Visitor, public FunctionAndResult<F> {};
-
-// Specialize for each visitor type
-template <class Visitable, class F> struct ApplyVisitor;
-
-/** Apply a functor to a visitable object.
- * The functor can have operator() overloads for each visitable type
- * and/or templated operator().
- */
-template <class F, class Visitable>
-typename F::result_type apply(F& functor, Visitable& visitable) {
- ApplyVisitor<typename VisitorType<Visitable>::type, F> visitor;
- visitor.functor=&functor;
- visitable.accept(visitor);
- return visitor.getResult();
-}
-
-template <class F, class Visitable>
-typename F::result_type apply(const F& functor, Visitable& visitable) {
- ApplyVisitor<typename VisitorType<Visitable>::type, const F> visitor;
- visitor.functor=&functor;
- visitable.accept(visitor);
- return visitor.getResult();
-}
-
-template <class R> struct ApplyFunctor { typedef R result_type; };
-
-}} // namespace qpid::amqp_0_10
-
-#endif /*!QPID_AMQP_0_10_APPLY_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/built_in_types.h b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/built_in_types.h
deleted file mode 100644
index 196e02a302..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/built_in_types.h
+++ /dev/null
@@ -1,171 +0,0 @@
-#ifndef QPID_AMQP_0_10_BUILT_IN_TYPES_H
-#define QPID_AMQP_0_10_BUILT_IN_TYPES_H
-/*
- *
- * 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 "qpid/Serializer.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/sys/IntegerTypes.h"
-#include "qpid/sys/Time.h"
-#include "Decimal.h"
-#include "SerializableString.h"
-#include <boost/array.hpp>
-#include <boost/range/iterator_range.hpp>
-#include <string>
-#include <ostream>
-#include <vector>
-
-/**@file Mapping from built-in AMQP types to C++ types */
-
-namespace qpid {
-
-namespace framing {
-class SequenceNumber;
-class SequenceSet;
-}
-
-namespace amqp_0_10 {
-
-/** Wrapper that behaves like type T but is a distinct type for
- * overloading purposes. Unique allows multiple distinc wrappers.
- */
-template <class T, int Unique=0> struct Wrapper {
- T value;
- Wrapper() {}
- Wrapper(const T& x) : value(x) {}
- Wrapper& operator=(const T& x) { value=x; return *this; }
- operator T&() { return value; }
- operator const T&() const { return value; }
- template <class S> void serialize(S& s) { s(value); }
-};
-
-template<class T>
-inline std::ostream& operator<<(std::ostream& o, const Wrapper<T>& w) {
- return o << w.value;
-}
-
-/** Void type */
-struct Void { template <class S> void serialize(S&) {} };
-inline std::ostream& operator<<(std::ostream& o, const Void&) { return o; }
-
-/** Bit is a presence indicator - an optional value with no encoding. */
-struct Bit : public Wrapper<bool> {
- Bit(bool b=false) : Wrapper<bool>(b) {}
- using Wrapper<bool>::operator=;
- template <class S> void serialize(S& s) { s.split(*this); }
- template <class S> void encode(S&) const { }
- template <class S> void decode(S&) { *this = true; }
-};
-
-inline std::ostream& operator<<(std::ostream& o, const Bit& b) {
- return o << bool(b);
-}
-
-// Fixed size types
-typedef bool Boolean;
-typedef char Char;
-typedef int8_t Int8;
-typedef int16_t Int16;
-typedef int32_t Int32;
-typedef int64_t Int64;
-typedef uint8_t Uint8;
-typedef uint16_t Uint16;
-typedef uint32_t Uint32;
-typedef uint64_t Uint64;
-typedef Wrapper<uint32_t> CharUtf32;
-
-template <size_t N> struct Bin : public boost::array<char, N> {
- template <class S> void serialize(S& s) { s.raw(this->begin(), this->size()); }
-};
-
-template <size_t N> std::ostream& operator<<(std::ostream& o, const Bin<N>& b) {
- return o << boost::make_iterator_range(b.begin(), b.end());
-}
-
-template <> struct Bin<1> : public boost::array<char, 1> {
- Bin(char c=0) { this->front() = c; }
- operator char() { return this->front(); }
- template <class S> void serialize(S& s) { s(front()); }
-};
-
-typedef Bin<1> Bin8;
-typedef Bin<128> Bin1024;
-typedef Bin<16> Bin128;
-typedef Bin<2> Bin16;
-typedef Bin<32> Bin256;
-typedef Bin<4> Bin32;
-typedef Bin<5> Bin40;
-typedef Bin<64> Bin512;
-typedef Bin<8> Bin64;
-typedef Bin<9> Bin72;
-
-typedef double Double;
-typedef float Float;
-typedef framing::SequenceNumber SequenceNo;
-using framing::Uuid;
-typedef sys::AbsTime Datetime;
-
-typedef Decimal<Uint8, Int32> Dec32;
-typedef Decimal<Uint8, Int64> Dec64;
-
-// Variable width types
-
-typedef SerializableString<Uint8, Uint8> Vbin8;
-typedef SerializableString<char, Uint8, 1> Str8Latin;
-typedef SerializableString<char, Uint8> Str8;
-typedef SerializableString<Uint16, Uint8> Str8Utf16;
-
-typedef SerializableString<Uint8, Uint16> Vbin16;
-typedef SerializableString<char, Uint16, 1> Str16Latin;
-typedef SerializableString<char, Uint16> Str16;
-typedef SerializableString<Uint16, Uint16> Str16Utf16;
-
-typedef SerializableString<Uint8, Uint32> Vbin32;
-
-typedef framing::SequenceSet SequenceSet;
-
-// Forward declare class types.
-class Map;
-class Struct32;
-class UnknownType;
-
-template <class T> struct ArrayDomain;
-typedef ArrayDomain<UnknownType> Array;
-
-// FIXME aconway 2008-04-08: TODO
-struct ByteRanges { template <class S> void serialize(S&) {} };
-struct List { template <class S> void serialize(S&) {} };
-
-// FIXME aconway 2008-03-10: dummy ostream operators
-inline std::ostream& operator<<(std::ostream& o, const ByteRanges&) { return o; }
-inline std::ostream& operator<<(std::ostream& o, const SequenceSet&) { return o; }
-inline std::ostream& operator<<(std::ostream& o, const List&) { return o; }
-
-enum SegmentType { CONTROL, COMMAND, HEADER, BODY };
-
-inline SerializeAs<SegmentType, uint8_t> serializable(SegmentType& st) {
- return SerializeAs<SegmentType, uint8_t>(st);
-}
-
-
-}} // namespace qpid::amqp_0_10
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/complex_types.cpp b/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/complex_types.cpp
deleted file mode 100644
index 656d363ba6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/amqp_0_10/complex_types.cpp
+++ /dev/null
@@ -1,84 +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 "qpid/amqp_0_10/UnknownStruct.h"
-#include "qpid/amqp_0_10/ApplyCommand.h"
-#include "qpid/amqp_0_10/ApplyControl.h"
-#include "qpid/amqp_0_10/ApplyStruct.h"
-#include "qpid/amqp_0_10/apply.h"
-#include <iostream>
-
-namespace qpid {
-namespace amqp_0_10 {
-// Functors for getting static values from a visitable base type.
-
-#define QPID_STATIC_VALUE_GETTER(NAME, TYPE, VALUE) \
- struct NAME : public ApplyFunctor<TYPE> { \
- template <class T> TYPE operator()(const T&) const { return T::VALUE; }\
- }
-
-QPID_STATIC_VALUE_GETTER(GetCode, uint8_t, CODE);
-QPID_STATIC_VALUE_GETTER(GetSize, uint8_t, SIZE);
-QPID_STATIC_VALUE_GETTER(GetPack, uint8_t, PACK);
-QPID_STATIC_VALUE_GETTER(GetClassCode, uint8_t, CLASS_CODE);
-QPID_STATIC_VALUE_GETTER(GetName, const char*, NAME);
-QPID_STATIC_VALUE_GETTER(GetClassName, const char*, CLASS_NAME);
-
-
-uint8_t Command::getCode() const { return apply(GetCode(), *this); }
-uint8_t Command::getClassCode() const { return apply(GetClassCode(), *this); }
-const char* Command::getName() const { return apply(GetName(), *this); }
-const char* Command::getClassName() const { return apply(GetClassName(), *this); }
-
-uint8_t Control::getCode() const { return apply(GetCode(), *this); }
-uint8_t Control::getClassCode() const { return apply(GetClassCode(), *this); }
-const char* Control::getName() const { return apply(GetName(), *this); }
-const char* Control::getClassName() const { return apply(GetClassName(), *this); }
-
-// Special cases for UnknownStruct
-struct GetStructCode : public GetCode {
- using GetCode::operator();
- uint8_t operator()(const UnknownStruct& u) const { return u.getCode(); }
-};
-
-struct GetStructClassCode : public GetClassCode {
- using GetClassCode::operator();
- uint8_t operator()(const UnknownStruct& u) const { return u.getClassCode(); }
-};
-
-uint8_t Struct::getCode() const { return apply(GetStructCode(), *this); }
-uint8_t Struct::getClassCode() const { return apply(GetStructClassCode(), *this); }
-uint8_t Struct::getPack() const { return apply(GetPack(), *this); }
-uint8_t Struct::getSize() const { return apply(GetSize(), *this); }
-
-struct PrintVisitor {
- typedef std::ostream& result_type;
- std::ostream& out;
- PrintVisitor(std::ostream& o) : out(o) {}
- template <class T> result_type operator()(const T& t) const { return out << t; }
-};
-
-std::ostream& operator<<(std::ostream& o, const Command& x) { return apply(PrintVisitor(o), x); }
-std::ostream& operator<<(std::ostream& o, const Control& x) { return apply(PrintVisitor(o), x); }
-std::ostream& operator<<(std::ostream& o, const Struct& x) { return apply(PrintVisitor(o), x); }
-
-}} // namespace qpid::amqp_0_10
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/assert.cpp b/M4-RCs/qpid/cpp/src/qpid/assert.cpp
deleted file mode 100644
index 5d039da528..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/assert.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef QPID_ASSERT_CPP
-#define QPID_ASSERT_CPP
-
-/*
- *
- * 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 <sstream>
-#include <iostream>
-#include "qpid/framing/reply_exceptions.h"
-#include <stdlib.h>
-
-namespace qpid {
-
-void assert_fail(char const * expr, char const * function, char const * file, long line) {
- std::ostringstream msg;
- msg << "Internal error: " << expr << " in function " << function
- << "(" << file << ":" << line << ")";
-#ifdef NDEBUG
- throw framing::InternalErrorException(msg.str());
-#else
- std::cerr << msg << std::endl;
- abort();
-#endif
-}
-
-} // namespace qpid
-
-#endif /*!QPID_ASSERT_CPP*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/assert.h b/M4-RCs/qpid/cpp/src/qpid/assert.h
deleted file mode 100644
index 49e7c5355d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/assert.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef QPID_ASSERT_H
-#define QPID_ASSERT_H
-
-/*
- *
- * 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 <boost/current_function.hpp>
-
-/**
- * Abort if !expr in debug mode, throw an exception if NDEBUG is set.
- */
-#define QPID_ASSERT(expr) ((expr) ? static_cast<void>(0) : ::qpid::assert_fail(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
-
-namespace qpid {
-
-void assert_fail(char const * expr, char const * function, char const * file, long line);
-
-} // namespace qpid
-
-#endif /*!QPID_ASSERT_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/AclModule.h b/M4-RCs/qpid/cpp/src/qpid/broker/AclModule.h
deleted file mode 100644
index 4bb6ca12b4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/AclModule.h
+++ /dev/null
@@ -1,257 +0,0 @@
-#ifndef QPID_ACLMODULE_ACL_H
-#define QPID_ACLMODULE_ACL_H
-
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-
-
-#include "qpid/shared_ptr.h"
-#include "qpid/RefCounted.h"
-#include <map>
-#include <set>
-#include <string>
-
-
-namespace qpid {
-
-namespace acl {
-
-enum ObjectType {OBJ_QUEUE, OBJ_EXCHANGE, OBJ_BROKER, OBJ_LINK,
- OBJ_METHOD, OBJECTSIZE}; // OBJECTSIZE must be last in list
-enum Action {ACT_CONSUME, ACT_PUBLISH, ACT_CREATE, ACT_ACCESS, ACT_BIND,
- ACT_UNBIND, ACT_DELETE, ACT_PURGE, ACT_UPDATE,
- ACTIONSIZE}; // ACTIONSIZE must be last in list
-enum Property {PROP_NAME, PROP_DURABLE, PROP_OWNER, PROP_ROUTINGKEY,
- PROP_PASSIVE, PROP_AUTODELETE, PROP_EXCLUSIVE, PROP_TYPE,
- PROP_ALTERNATE, PROP_QUEUENAME, PROP_SCHEMAPACKAGE,
- PROP_SCHEMACLASS};
-enum AclResult {ALLOW, ALLOWLOG, DENY, DENYLOG};
-
-} // namespace acl
-
-namespace broker {
-
-
-class AclModule
-{
-
-public:
-
- // effienty turn off ACL on message transfer.
- virtual bool doTransferAcl()=0;
-
- virtual bool authorise(const std::string& id, const acl::Action& action, const acl::ObjectType& objType, const std::string& name,
- std::map<acl::Property, std::string>* params=0)=0;
- virtual bool authorise(const std::string& id, const acl::Action& action, const acl::ObjectType& objType, const std::string& ExchangeName,
- const std::string& RoutingKey)=0;
- // create specilied authorise methods for cases that need faster matching as needed.
-
- virtual ~AclModule() {};
-};
-
-} // namespace broker
-
-namespace acl {
-
-class AclHelper {
- private:
- AclHelper(){}
- public:
- static inline ObjectType getObjectType(const std::string& str) {
- if (str.compare("queue") == 0) return OBJ_QUEUE;
- if (str.compare("exchange") == 0) return OBJ_EXCHANGE;
- if (str.compare("broker") == 0) return OBJ_BROKER;
- if (str.compare("link") == 0) return OBJ_LINK;
- if (str.compare("method") == 0) return OBJ_METHOD;
- throw str;
- }
- static inline std::string getObjectTypeStr(const ObjectType o) {
- switch (o) {
- case OBJ_QUEUE: return "queue";
- case OBJ_EXCHANGE: return "exchange";
- case OBJ_BROKER: return "broker";
- case OBJ_LINK: return "link";
- case OBJ_METHOD: return "method";
- default: assert(false); // should never get here
- }
- return "";
- }
- static inline Action getAction(const std::string& str) {
- if (str.compare("consume") == 0) return ACT_CONSUME;
- if (str.compare("publish") == 0) return ACT_PUBLISH;
- if (str.compare("create") == 0) return ACT_CREATE;
- if (str.compare("access") == 0) return ACT_ACCESS;
- if (str.compare("bind") == 0) return ACT_BIND;
- if (str.compare("unbind") == 0) return ACT_UNBIND;
- if (str.compare("delete") == 0) return ACT_DELETE;
- if (str.compare("purge") == 0) return ACT_PURGE;
- if (str.compare("update") == 0) return ACT_UPDATE;
- throw str;
- }
- static inline std::string getActionStr(const Action a) {
- switch (a) {
- case ACT_CONSUME: return "consume";
- case ACT_PUBLISH: return "publish";
- case ACT_CREATE: return "create";
- case ACT_ACCESS: return "access";
- case ACT_BIND: return "bind";
- case ACT_UNBIND: return "unbind";
- case ACT_DELETE: return "delete";
- case ACT_PURGE: return "purge";
- case ACT_UPDATE: return "update";
- default: assert(false); // should never get here
- }
- return "";
- }
- static inline Property getProperty(const std::string& str) {
- if (str.compare("name") == 0) return PROP_NAME;
- if (str.compare("durable") == 0) return PROP_DURABLE;
- if (str.compare("owner") == 0) return PROP_OWNER;
- if (str.compare("routingkey") == 0) return PROP_ROUTINGKEY;
- if (str.compare("passive") == 0) return PROP_PASSIVE;
- if (str.compare("autodelete") == 0) return PROP_AUTODELETE;
- if (str.compare("exclusive") == 0) return PROP_EXCLUSIVE;
- if (str.compare("type") == 0) return PROP_TYPE;
- if (str.compare("alternate") == 0) return PROP_ALTERNATE;
- if (str.compare("queuename") == 0) return PROP_QUEUENAME;
- if (str.compare("schemapackage") == 0) return PROP_SCHEMAPACKAGE;
- if (str.compare("schemaclass") == 0) return PROP_SCHEMACLASS;
- throw str;
- }
- static inline std::string getPropertyStr(const Property p) {
- switch (p) {
- case PROP_NAME: return "name";
- case PROP_DURABLE: return "durable";
- case PROP_OWNER: return "owner";
- case PROP_ROUTINGKEY: return "routingkey";
- case PROP_PASSIVE: return "passive";
- case PROP_AUTODELETE: return "autodelete";
- case PROP_EXCLUSIVE: return "exclusive";
- case PROP_TYPE: return "type";
- case PROP_ALTERNATE: return "alternate";
- case PROP_QUEUENAME: return "queuename";
- case PROP_SCHEMAPACKAGE: return "schemapackage";
- case PROP_SCHEMACLASS: return "schemaclass";
- default: assert(false); // should never get here
- }
- return "";
- }
- static inline AclResult getAclResult(const std::string& str) {
- if (str.compare("allow") == 0) return ALLOW;
- if (str.compare("allow-log") == 0) return ALLOWLOG;
- if (str.compare("deny") == 0) return DENY;
- if (str.compare("deny-log") == 0) return DENYLOG;
- throw str;
- }
- static inline std::string getAclResultStr(const AclResult r) {
- switch (r) {
- case ALLOW: return "allow";
- case ALLOWLOG: return "allow-log";
- case DENY: return "deny";
- case DENYLOG: return "deny-log";
- default: assert(false); // should never get here
- }
- return "";
- }
-
- typedef std::set<Property> propSet;
- typedef boost::shared_ptr<propSet> propSetPtr;
- typedef std::pair<Action, propSetPtr> actionPair;
- typedef std::map<Action, propSetPtr> actionMap;
- typedef boost::shared_ptr<actionMap> actionMapPtr;
- typedef std::pair<ObjectType, actionMapPtr> objectPair;
- typedef std::map<ObjectType, actionMapPtr> objectMap;
- typedef objectMap::const_iterator omCitr;
- typedef boost::shared_ptr<objectMap> objectMapPtr;
-
- // This map contains the legal combinations of object/action/properties found in an ACL file
- static void loadValidationMap(objectMapPtr& map) {
- if (!map.get()) return;
- map->clear();
- propSetPtr p0; // empty ptr, used for no properties
-
- // == Exchanges ==
-
- propSetPtr p1(new propSet);
- p1->insert(PROP_TYPE);
- p1->insert(PROP_ALTERNATE);
- p1->insert(PROP_PASSIVE);
- p1->insert(PROP_DURABLE);
-
- propSetPtr p2(new propSet);
- p2->insert(PROP_ROUTINGKEY);
-
- propSetPtr p3(new propSet);
- p3->insert(PROP_QUEUENAME);
- p3->insert(PROP_ROUTINGKEY);
-
- actionMapPtr a0(new actionMap);
- a0->insert(actionPair(ACT_CREATE, p1));
- a0->insert(actionPair(ACT_DELETE, p0));
- a0->insert(actionPair(ACT_ACCESS, p0));
- a0->insert(actionPair(ACT_BIND, p2));
- a0->insert(actionPair(ACT_UNBIND, p2));
- a0->insert(actionPair(ACT_ACCESS, p3));
- a0->insert(actionPair(ACT_PUBLISH, p0));
-
- map->insert(objectPair(OBJ_EXCHANGE, a0));
-
- // == Queues ==
-
- propSetPtr p4(new propSet);
- p3->insert(PROP_ALTERNATE);
- p3->insert(PROP_PASSIVE);
- p3->insert(PROP_DURABLE);
- p3->insert(PROP_EXCLUSIVE);
- p3->insert(PROP_AUTODELETE);
-
- actionMapPtr a1(new actionMap);
- a1->insert(actionPair(ACT_ACCESS, p0));
- a1->insert(actionPair(ACT_CREATE, p4));
- a1->insert(actionPair(ACT_PURGE, p0));
- a1->insert(actionPair(ACT_DELETE, p0));
- a1->insert(actionPair(ACT_CONSUME, p0));
-
- map->insert(objectPair(OBJ_QUEUE, a1));
-
- // == Links ==
-
- actionMapPtr a2(new actionMap);
- a2->insert(actionPair(ACT_CREATE, p0));
-
- map->insert(objectPair(OBJ_LINK, a2));
-
- // == Method ==
-
- propSetPtr p5(new propSet);
- p5->insert(PROP_SCHEMAPACKAGE);
- p5->insert(PROP_SCHEMACLASS);
-
- actionMapPtr a4(new actionMap);
- a4->insert(actionPair(ACT_ACCESS, p5));
-
- map->insert(objectPair(OBJ_METHOD, a4));
- }
-};
-
-
-}} // namespace qpid::acl
-
-#endif // QPID_ACLMODULE_ACL_H
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Bridge.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/Bridge.cpp
deleted file mode 100644
index f9cb7ccd3c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Bridge.cpp
+++ /dev/null
@@ -1,294 +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 "Bridge.h"
-#include "ConnectionState.h"
-#include "Connection.h"
-#include "LinkRegistry.h"
-
-#include "qpid/agent/ManagementAgent.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/log/Statement.h"
-#include <iostream>
-
-using qpid::framing::FieldTable;
-using qpid::framing::Uuid;
-using qpid::framing::Buffer;
-using qpid::management::ManagementAgent;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-namespace
-{
-const std::string qpidFedOp("qpid.fed.op");
-const std::string qpidFedTags("qpid.fed.tags");
-const std::string qpidFedOrigin("qpid.fed.origin");
-
-const std::string fedOpBind("B");
-const std::string fedOpUnbind("U");
-const std::string fedOpReorigin("R");
-const std::string fedOpHello("H");
-}
-
-namespace qpid {
-namespace broker {
-
-void Bridge::PushHandler::handle(framing::AMQFrame& frame)
-{
- conn->received(frame);
-}
-
-Bridge::Bridge(Link* _link, framing::ChannelId _id, CancellationListener l,
- const _qmf::ArgsLinkBridge& _args) :
- link(_link), id(_id), args(_args), mgmtObject(0),
- listener(l), name(Uuid(true).str()), queueName("bridge_queue_"), persistenceId(0)
-{
- std::stringstream title;
- title << id << "_" << link->getBroker()->getFederationTag();
- queueName += title.str();
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent != 0) {
- mgmtObject = new _qmf::Bridge
- (agent, this, link, id, args.i_durable, args.i_src, args.i_dest,
- args.i_key, args.i_srcIsQueue, args.i_srcIsLocal,
- args.i_tag, args.i_excludes, args.i_dynamic);
- if (!args.i_durable)
- agent->addObject(mgmtObject);
- }
-}
-
-Bridge::~Bridge()
-{
- mgmtObject->resourceDestroy();
-}
-
-void Bridge::create(ConnectionState& c)
-{
- connState = &c;
- if (args.i_srcIsLocal) {
- if (args.i_dynamic)
- throw Exception("Dynamic routing not supported for push routes");
- // Point the bridging commands at the local connection handler
- Connection* conn = dynamic_cast<Connection*>(&c);
- if (conn == 0)
- return;
- pushHandler.reset(new PushHandler(conn));
- channelHandler.reset(new framing::ChannelHandler(id, pushHandler.get()));
- } else {
- // Point the bridging commands at the remote peer broker
- channelHandler.reset(new framing::ChannelHandler(id, &(connState->getOutput())));
- }
-
- session.reset(new framing::AMQP_ServerProxy::Session(*channelHandler));
- peer.reset(new framing::AMQP_ServerProxy(*channelHandler));
-
- session->attach(name, false);
- session->commandPoint(0,0);
-
- if (args.i_srcIsQueue) {
- peer->getMessage().subscribe(args.i_src, args.i_dest, 1, 0, false, "", 0, FieldTable());
- peer->getMessage().flow(args.i_dest, 0, 0xFFFFFFFF);
- peer->getMessage().flow(args.i_dest, 1, 0xFFFFFFFF);
- } else {
- FieldTable queueSettings;
-
- if (args.i_tag.size()) {
- queueSettings.setString("qpid.trace.id", args.i_tag);
- } else {
- const string& peerTag = connState->getFederationPeerTag();
- if (peerTag.size())
- queueSettings.setString("qpid.trace.id", peerTag);
- }
-
- if (args.i_excludes.size()) {
- queueSettings.setString("qpid.trace.exclude", args.i_excludes);
- } else {
- const string& localTag = link->getBroker()->getFederationTag();
- if (localTag.size())
- queueSettings.setString("qpid.trace.exclude", localTag);
- }
-
- bool durable = false;//should this be an arg, or would be use srcIsQueue for durable queues?
- bool autoDelete = !durable;//auto delete transient queues?
- peer->getQueue().declare(queueName, "", false, durable, true, autoDelete, queueSettings);
- if (!args.i_dynamic)
- peer->getExchange().bind(queueName, args.i_src, args.i_key, FieldTable());
- peer->getMessage().subscribe(queueName, args.i_dest, 1, 0, false, "", 0, FieldTable());
- peer->getMessage().flow(args.i_dest, 0, 0xFFFFFFFF);
- peer->getMessage().flow(args.i_dest, 1, 0xFFFFFFFF);
-
- if (args.i_dynamic) {
- Exchange::shared_ptr exchange = link->getBroker()->getExchanges().get(args.i_src);
- if (exchange.get() == 0)
- throw Exception("Exchange not found for dynamic route");
- exchange->registerDynamicBridge(this);
- }
- }
-}
-
-void Bridge::cancel()
-{
- peer->getMessage().cancel(args.i_dest);
- peer->getSession().detach(name);
- if (args.i_dynamic) {
- Exchange::shared_ptr exchange = link->getBroker()->getExchanges().get(args.i_src);
- if (exchange.get() != 0)
- exchange->removeDynamicBridge(this);
- }
-}
-
-void Bridge::destroy()
-{
- listener(this);
-}
-
-void Bridge::setPersistenceId(uint64_t id) const
-{
- if (mgmtObject != 0 && persistenceId == 0) {
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- agent->addObject (mgmtObject, id);
- }
- persistenceId = id;
-}
-
-const string& Bridge::getName() const
-{
- return name;
-}
-
-Bridge::shared_ptr Bridge::decode(LinkRegistry& links, Buffer& buffer)
-{
- string host;
- uint16_t port;
- string src;
- string dest;
- string key;
- string id;
- string excludes;
-
- buffer.getShortString(host);
- port = buffer.getShort();
- bool durable(buffer.getOctet());
- buffer.getShortString(src);
- buffer.getShortString(dest);
- buffer.getShortString(key);
- bool is_queue(buffer.getOctet());
- bool is_local(buffer.getOctet());
- buffer.getShortString(id);
- buffer.getShortString(excludes);
- bool dynamic(buffer.getOctet());
-
- return links.declare(host, port, durable, src, dest, key,
- is_queue, is_local, id, excludes, dynamic).first;
-}
-
-void Bridge::encode(Buffer& buffer) const
-{
- buffer.putShortString(string("bridge"));
- buffer.putShortString(link->getHost());
- buffer.putShort(link->getPort());
- buffer.putOctet(args.i_durable ? 1 : 0);
- buffer.putShortString(args.i_src);
- buffer.putShortString(args.i_dest);
- buffer.putShortString(args.i_key);
- buffer.putOctet(args.i_srcIsQueue ? 1 : 0);
- buffer.putOctet(args.i_srcIsLocal ? 1 : 0);
- buffer.putShortString(args.i_tag);
- buffer.putShortString(args.i_excludes);
- buffer.putOctet(args.i_dynamic ? 1 : 0);
-}
-
-uint32_t Bridge::encodedSize() const
-{
- return link->getHost().size() + 1 // short-string (host)
- + 7 // short-string ("bridge")
- + 2 // port
- + 1 // durable
- + args.i_src.size() + 1
- + args.i_dest.size() + 1
- + args.i_key.size() + 1
- + 1 // srcIsQueue
- + 1 // srcIsLocal
- + args.i_tag.size() + 1
- + args.i_excludes.size() + 1
- + 1; // dynamic
-}
-
-management::ManagementObject* Bridge::GetManagementObject (void) const
-{
- return (management::ManagementObject*) mgmtObject;
-}
-
-management::Manageable::status_t Bridge::ManagementMethod(uint32_t methodId,
- management::Args& /*args*/,
- string&)
-{
- if (methodId == _qmf::Bridge::METHOD_CLOSE) {
- //notify that we are closed
- destroy();
- return management::Manageable::STATUS_OK;
- } else {
- return management::Manageable::STATUS_UNKNOWN_METHOD;
- }
-}
-
-void Bridge::propagateBinding(const string& key, const string& tagList,
- const string& op, const string& origin)
-{
- const string& localTag = link->getBroker()->getFederationTag();
- const string& peerTag = connState->getFederationPeerTag();
-
- if (tagList.find(peerTag) == tagList.npos) {
- FieldTable bindArgs;
- string newTagList(tagList + string(tagList.empty() ? "" : ",") + localTag);
-
- bindArgs.setString(qpidFedOp, op);
- bindArgs.setString(qpidFedTags, newTagList);
- if (origin.empty())
- bindArgs.setString(qpidFedOrigin, localTag);
- else
- bindArgs.setString(qpidFedOrigin, origin);
-
- peer->getExchange().bind(queueName, args.i_src, key, bindArgs);
- }
-}
-
-void Bridge::sendReorigin()
-{
- FieldTable bindArgs;
-
- bindArgs.setString(qpidFedOp, fedOpReorigin);
- bindArgs.setString(qpidFedTags, link->getBroker()->getFederationTag());
-
- peer->getExchange().bind(queueName, args.i_src, args.i_key, bindArgs);
-}
-
-bool Bridge::containsLocalTag(const string& tagList) const
-{
- const string& localTag = link->getBroker()->getFederationTag();
- return (tagList.find(localTag) != tagList.npos);
-}
-
-const string& Bridge::getLocalTag() const
-{
- return link->getBroker()->getFederationTag();
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Bridge.h b/M4-RCs/qpid/cpp/src/qpid/broker/Bridge.h
deleted file mode 100644
index c530a5d696..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Bridge.h
+++ /dev/null
@@ -1,105 +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.
- *
- */
-#ifndef _Bridge_
-#define _Bridge_
-
-#include "PersistableConfig.h"
-#include "qpid/framing/AMQP_ServerProxy.h"
-#include "qpid/framing/ChannelHandler.h"
-#include "qpid/framing/Buffer.h"
-#include "qpid/framing/FrameHandler.h"
-#include "qpid/management/Manageable.h"
-#include "Exchange.h"
-#include "qmf/org/apache/qpid/broker/ArgsLinkBridge.h"
-#include "qmf/org/apache/qpid/broker/Bridge.h"
-
-#include <boost/function.hpp>
-#include <memory>
-
-namespace qpid {
-namespace broker {
-
-class Connection;
-class ConnectionState;
-class Link;
-class LinkRegistry;
-
-class Bridge : public PersistableConfig, public management::Manageable, public Exchange::DynamicBridge
-{
-public:
- typedef boost::shared_ptr<Bridge> shared_ptr;
- typedef boost::function<void(Bridge*)> CancellationListener;
-
- Bridge(Link* link, framing::ChannelId id, CancellationListener l,
- const qmf::org::apache::qpid::broker::ArgsLinkBridge& args);
- ~Bridge();
-
- void create(ConnectionState& c);
- void cancel();
- void destroy();
- bool isDurable() { return args.i_durable; }
-
- management::ManagementObject* GetManagementObject() const;
- management::Manageable::status_t ManagementMethod(uint32_t methodId,
- management::Args& args,
- std::string& text);
-
- // PersistableConfig:
- void setPersistenceId(uint64_t id) const;
- uint64_t getPersistenceId() const { return persistenceId; }
- uint32_t encodedSize() const;
- void encode(framing::Buffer& buffer) const;
- const std::string& getName() const;
- static Bridge::shared_ptr decode(LinkRegistry& links, framing::Buffer& buffer);
-
- // Exchange::DynamicBridge methods
- void propagateBinding(const std::string& key, const std::string& tagList, const std::string& op, const std::string& origin);
- void sendReorigin();
- bool containsLocalTag(const std::string& tagList) const;
- const std::string& getLocalTag() const;
-
-private:
- struct PushHandler : framing::FrameHandler {
- PushHandler(Connection* c) { conn = c; }
- void handle(framing::AMQFrame& frame);
- Connection* conn;
- };
-
- std::auto_ptr<PushHandler> pushHandler;
- std::auto_ptr<framing::ChannelHandler> channelHandler;
- std::auto_ptr<framing::AMQP_ServerProxy::Session> session;
- std::auto_ptr<framing::AMQP_ServerProxy> peer;
-
- Link* link;
- framing::ChannelId id;
- qmf::org::apache::qpid::broker::ArgsLinkBridge args;
- qmf::org::apache::qpid::broker::Bridge* mgmtObject;
- CancellationListener listener;
- std::string name;
- std::string queueName;
- mutable uint64_t persistenceId;
- ConnectionState* connState;
-};
-
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Broker.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/Broker.cpp
deleted file mode 100644
index 64be104b98..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Broker.cpp
+++ /dev/null
@@ -1,450 +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 "Broker.h"
-#include "DirectExchange.h"
-#include "FanOutExchange.h"
-#include "HeadersExchange.h"
-#include "MessageStoreModule.h"
-#include "NullMessageStore.h"
-#include "RecoveryManagerImpl.h"
-#include "SaslAuthenticator.h"
-#include "TopicExchange.h"
-#include "Link.h"
-
-#include "qmf/org/apache/qpid/broker/Package.h"
-#include "qmf/org/apache/qpid/broker/ArgsBrokerEcho.h"
-#include "qmf/org/apache/qpid/broker/ArgsBrokerQueueMoveMessages.h"
-#include "qpid/management/ManagementExchange.h"
-#include "qpid/log/Statement.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/ProtocolInitiation.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/sys/ProtocolFactory.h"
-#include "qpid/sys/Poller.h"
-#include "qpid/sys/Dispatcher.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/sys/Time.h"
-#include "qpid/sys/ConnectionInputHandler.h"
-#include "qpid/sys/ConnectionInputHandlerFactory.h"
-#include "qpid/sys/TimeoutHandler.h"
-#include "qpid/sys/SystemInfo.h"
-#include "qpid/Address.h"
-#include "qpid/Url.h"
-#include "qpid/Version.h"
-
-#include <boost/bind.hpp>
-
-#include <iostream>
-#include <memory>
-#include <stdlib.h>
-
-using qpid::sys::ProtocolFactory;
-using qpid::sys::Poller;
-using qpid::sys::Dispatcher;
-using qpid::sys::Thread;
-using qpid::framing::FrameHandler;
-using qpid::framing::ChannelId;
-using qpid::management::ManagementBroker;
-using qpid::management::ManagementObject;
-using qpid::management::Manageable;
-using qpid::management::Args;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-namespace qpid {
-namespace broker {
-
-Broker::Options::Options(const std::string& name) :
- qpid::Options(name),
- noDataDir(0),
- port(DEFAULT_PORT),
- workerThreads(5),
- maxConnections(500),
- connectionBacklog(10),
- stagingThreshold(5000000),
- enableMgmt(1),
- mgmtPubInterval(10),
- queueCleanInterval(60*10),//10 minutes
- auth(SaslAuthenticator::available()),
- realm("QPID"),
- replayFlushLimit(0),
- replayHardLimit(0),
- queueLimit(100*1048576/*100M default limit*/),
- tcpNoDelay(false),
- requireEncrypted(false)
-{
- int c = sys::SystemInfo::concurrency();
- workerThreads=c+1;
- char *home = ::getenv("HOME");
-
- if (home == 0)
- dataDir += DEFAULT_DATA_DIR_LOCATION;
- else
- dataDir += home;
- dataDir += DEFAULT_DATA_DIR_NAME;
-
- addOptions()
- ("data-dir", optValue(dataDir,"DIR"), "Directory to contain persistent data generated by the broker")
- ("no-data-dir", optValue(noDataDir), "Don't use a data directory. No persistent configuration will be loaded or stored")
- ("port,p", optValue(port,"PORT"), "Tells the broker to listen on PORT")
- ("worker-threads", optValue(workerThreads, "N"), "Sets the broker thread pool size")
- ("max-connections", optValue(maxConnections, "N"), "Sets the maximum allowed connections")
- ("connection-backlog", optValue(connectionBacklog, "N"), "Sets the connection backlog limit for the server socket")
- ("staging-threshold", optValue(stagingThreshold, "N"), "Stages messages over N bytes to disk")
- ("mgmt-enable,m", optValue(enableMgmt,"yes|no"), "Enable Management")
- ("mgmt-pub-interval", optValue(mgmtPubInterval, "SECONDS"), "Management Publish Interval")
- ("queue-purge-interval", optValue(queueCleanInterval, "SECONDS"),
- "Interval between attempts to purge any expired messages from queues")
- ("auth", optValue(auth, "yes|no"), "Enable authentication, if disabled all incoming connections will be trusted")
- ("realm", optValue(realm, "REALM"), "Use the given realm when performing authentication")
- ("default-queue-limit", optValue(queueLimit, "BYTES"), "Default maximum size for queues (in bytes)")
- ("tcp-nodelay", optValue(tcpNoDelay), "Set TCP_NODELAY on TCP connections")
- ("require-encryption", optValue(requireEncrypted), "Only accept connections that are encrypted");
-}
-
-const std::string empty;
-const std::string amq_direct("amq.direct");
-const std::string amq_topic("amq.topic");
-const std::string amq_fanout("amq.fanout");
-const std::string amq_match("amq.match");
-const std::string qpid_management("qpid.management");
-
-Broker::Broker(const Broker::Options& conf) :
- poller(new Poller),
- config(conf),
- managementAgentSingleton(!config.enableMgmt),
- store(0),
- acl(0),
- dataDir(conf.noDataDir ? std::string() : conf.dataDir),
- links(this),
- factory(new ConnectionFactory(*this)),
- dtxManager(timer),
- sessionManager(
- qpid::SessionState::Configuration(
- conf.replayFlushLimit*1024, // convert kb to bytes.
- conf.replayHardLimit*1024),
- *this),
- queueCleaner(queues, timer),
- getKnownBrokers(boost::bind(&Broker::getKnownBrokersImpl, this))
-{
- if (conf.enableMgmt) {
- QPID_LOG(info, "Management enabled");
- managementAgent = managementAgentSingleton.getInstance();
- ((ManagementBroker*) managementAgent)->configure
- (dataDir.isEnabled() ? dataDir.getPath() : string(),
- conf.mgmtPubInterval, this, conf.workerThreads + 3);
- _qmf::Package packageInitializer(managementAgent);
-
- System* system = new System (dataDir.isEnabled() ? dataDir.getPath() : string());
- systemObject = System::shared_ptr(system);
-
- mgmtObject = new _qmf::Broker(managementAgent, this, system, conf.port);
- mgmtObject->set_workerThreads(conf.workerThreads);
- mgmtObject->set_maxConns(conf.maxConnections);
- mgmtObject->set_connBacklog(conf.connectionBacklog);
- mgmtObject->set_stagingThreshold(conf.stagingThreshold);
- mgmtObject->set_mgmtPubInterval(conf.mgmtPubInterval);
- mgmtObject->set_version(qpid::version);
- if (dataDir.isEnabled())
- mgmtObject->set_dataDir(dataDir.getPath());
- else
- mgmtObject->clr_dataDir();
-
- managementAgent->addObject(mgmtObject, 0x1000000000000002LL);
-
- // Since there is currently no support for virtual hosts, a placeholder object
- // representing the implied single virtual host is added here to keep the
- // management schema correct.
- Vhost* vhost = new Vhost(this);
- vhostObject = Vhost::shared_ptr(vhost);
- framing::Uuid uuid(((ManagementBroker*) managementAgent)->getUuid());
- federationTag = uuid.str();
- vhostObject->setFederationTag(federationTag);
-
- queues.setParent(vhost);
- exchanges.setParent(vhost);
- links.setParent(vhost);
- } else {
- // Management is disabled so there is no broker management ID.
- // Create a unique uuid to use as the federation tag.
- framing::Uuid uuid(true);
- federationTag = uuid.str();
- }
-
- QueuePolicy::setDefaultMaxSize(conf.queueLimit);
-
- // Early-Initialize plugins
- const Plugin::Plugins& plugins=Plugin::getPlugins();
- for (Plugin::Plugins::const_iterator i = plugins.begin();
- i != plugins.end();
- i++)
- (*i)->earlyInitialize(*this);
-
- // If no plugin store module registered itself, set up the null store.
- if (store.get() == 0)
- setStore (new NullMessageStore());
-
- exchanges.declare(empty, DirectExchange::typeName); // Default exchange.
-
- if (store.get() != 0) {
- RecoveryManagerImpl recoverer(queues, exchanges, links, dtxManager,
- conf.stagingThreshold);
- store->recover(recoverer);
- }
-
- //ensure standard exchanges exist (done after recovery from store)
- declareStandardExchange(amq_direct, DirectExchange::typeName);
- declareStandardExchange(amq_topic, TopicExchange::typeName);
- declareStandardExchange(amq_fanout, FanOutExchange::typeName);
- declareStandardExchange(amq_match, HeadersExchange::typeName);
-
- if(conf.enableMgmt) {
- exchanges.declare(qpid_management, ManagementExchange::typeName);
- Exchange::shared_ptr mExchange = exchanges.get (qpid_management);
- Exchange::shared_ptr dExchange = exchanges.get (amq_direct);
- ((ManagementBroker*) managementAgent)->setExchange (mExchange, dExchange);
- dynamic_pointer_cast<ManagementExchange>(mExchange)->setManagmentAgent
- ((ManagementBroker*) managementAgent);
- }
- else
- QPID_LOG(info, "Management not enabled");
-
- /**
- * SASL setup, can fail and terminate startup
- */
- if (conf.auth) {
- SaslAuthenticator::init(qpid::saslName);
- QPID_LOG(info, "SASL enabled");
- }
-
- // Initialize plugins
- for (Plugin::Plugins::const_iterator i = plugins.begin();
- i != plugins.end();
- i++)
- (*i)->initialize(*this);
-
- if (conf.queueCleanInterval) {
- queueCleaner.start(conf.queueCleanInterval * qpid::sys::TIME_SEC);
- }
-
- //initialize known broker urls (TODO: add support for urls for other transports (SSL, RDMA)):
- boost::shared_ptr<ProtocolFactory> factory = getProtocolFactory(TCP_TRANSPORT);
- if (factory) {
- knownBrokers.push_back ( qpid::Url::getIpAddressesUrl ( factory->getPort() ) );
- }
-}
-
-void Broker::declareStandardExchange(const std::string& name, const std::string& type)
-{
- bool storeEnabled = store.get() != NULL;
- std::pair<Exchange::shared_ptr, bool> status = exchanges.declare(name, type, storeEnabled);
- if (status.second && storeEnabled) {
- store->create(*status.first, framing::FieldTable ());
- }
-}
-
-
-boost::intrusive_ptr<Broker> Broker::create(int16_t port)
-{
- Options config;
- config.port=port;
- return create(config);
-}
-
-boost::intrusive_ptr<Broker> Broker::create(const Options& opts)
-{
- return boost::intrusive_ptr<Broker>(new Broker(opts));
-}
-
-void Broker::setStore (MessageStore* _store)
-{
- store.reset(new MessageStoreModule (_store));
- queues.setStore (store.get());
- dtxManager.setStore (store.get());
- links.setStore (store.get());
-}
-
-void Broker::run() {
- accept();
- QPID_LOG(notice, "Broker running");
- Dispatcher d(poller);
- int numIOThreads = config.workerThreads;
- std::vector<Thread> t(numIOThreads-1);
-
- // Run n-1 io threads
- for (int i=0; i<numIOThreads-1; ++i)
- t[i] = Thread(d);
-
- // Run final thread
- d.run();
-
- // Now wait for n-1 io threads to exit
- for (int i=0; i<numIOThreads-1; ++i) {
- t[i].join();
- }
-}
-
-void Broker::shutdown() {
- // NB: this function must be async-signal safe, it must not
- // call any function that is not async-signal safe.
- // Any unsafe shutdown actions should be done in the destructor.
- poller->shutdown();
-}
-
-Broker::~Broker() {
- shutdown();
- finalize(); // Finalize any plugins.
- if (config.auth)
- SaslAuthenticator::fini();
- QPID_LOG(notice, "Shut down");
-}
-
-ManagementObject* Broker::GetManagementObject(void) const
-{
- return (ManagementObject*) mgmtObject;
-}
-
-Manageable* Broker::GetVhostObject(void) const
-{
- return vhostObject.get();
-}
-
-Manageable::status_t Broker::ManagementMethod (uint32_t methodId,
- Args& args,
- string&)
-{
- Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
-
- QPID_LOG (debug, "Broker::ManagementMethod [id=" << methodId << "]");
-
- switch (methodId)
- {
- case _qmf::Broker::METHOD_ECHO :
- status = Manageable::STATUS_OK;
- break;
- case _qmf::Broker::METHOD_CONNECT : {
- _qmf::ArgsBrokerConnect& hp=
- dynamic_cast<_qmf::ArgsBrokerConnect&>(args);
-
- string transport = hp.i_transport.empty() ? TCP_TRANSPORT : hp.i_transport;
- if (!getProtocolFactory(transport)) {
- QPID_LOG(error, "Transport '" << transport << "' not supported");
- return Manageable::STATUS_NOT_IMPLEMENTED;
- }
- std::pair<Link::shared_ptr, bool> response =
- links.declare (hp.i_host, hp.i_port, transport, hp.i_durable,
- hp.i_authMechanism, hp.i_username, hp.i_password);
- if (hp.i_durable && response.second)
- store->create(*response.first);
- status = Manageable::STATUS_OK;
- break;
- }
- case _qmf::Broker::METHOD_QUEUEMOVEMESSAGES : {
- _qmf::ArgsBrokerQueueMoveMessages& moveArgs=
- dynamic_cast<_qmf::ArgsBrokerQueueMoveMessages&>(args);
- if (queueMoveMessages(moveArgs.i_srcQueue, moveArgs.i_destQueue, moveArgs.i_qty))
- status = Manageable::STATUS_OK;
- else
- return Manageable::STATUS_INVALID_PARAMETER;
- break;
- }
- default:
- status = Manageable::STATUS_NOT_IMPLEMENTED;
- break;
- }
-
- return status;
-}
-
-boost::shared_ptr<ProtocolFactory> Broker::getProtocolFactory(const std::string& name) const {
- ProtocolFactoryMap::const_iterator i
- = name.empty() ? protocolFactories.begin() : protocolFactories.find(name);
- if (i == protocolFactories.end()) return boost::shared_ptr<ProtocolFactory>();
- else return i->second;
-}
-
-uint16_t Broker::getPort(const std::string& name) const {
- boost::shared_ptr<ProtocolFactory> factory = getProtocolFactory(name);
- if (factory) {
- return factory->getPort();
- } else {
- throw NoSuchTransportException(QPID_MSG("No such transport: '" << name << "'"));
- }
-}
-
-void Broker::registerProtocolFactory(const std::string& name, ProtocolFactory::shared_ptr protocolFactory) {
- protocolFactories[name] = protocolFactory;
-}
-
-void Broker::accept() {
- for (ProtocolFactoryMap::const_iterator i = protocolFactories.begin(); i != protocolFactories.end(); i++) {
- i->second->accept(poller, factory.get());
- }
-}
-
-void Broker::connect(
- const std::string& host, uint16_t port, const std::string& transport,
- boost::function2<void, int, std::string> failed,
- sys::ConnectionCodec::Factory* f)
-{
- boost::shared_ptr<ProtocolFactory> pf = getProtocolFactory(transport);
- if (pf) pf->connect(poller, host, port, f ? f : factory.get(), failed);
- else throw NoSuchTransportException(QPID_MSG("Unsupported transport type: " << transport));
-}
-
-void Broker::connect(
- const Url& url,
- boost::function2<void, int, std::string> failed,
- sys::ConnectionCodec::Factory* f)
-{
- url.throwIfEmpty();
- const TcpAddress* addr=url[0].get<TcpAddress>();
- connect(addr->host, addr->port, TCP_TRANSPORT, failed, f);
-}
-
-uint32_t Broker::queueMoveMessages(
- const std::string& srcQueue,
- const std::string& destQueue,
- uint32_t qty)
-{
- Queue::shared_ptr src_queue = queues.find(srcQueue);
- if (!src_queue)
- return 0;
- Queue::shared_ptr dest_queue = queues.find(destQueue);
- if (!dest_queue)
- return 0;
-
- return src_queue->move(dest_queue, qty);
-}
-
-
-boost::shared_ptr<sys::Poller> Broker::getPoller() { return poller; }
-
-std::vector<Url>
-Broker::getKnownBrokersImpl()
-{
- return knownBrokers;
-}
-
-const std::string Broker::TCP_TRANSPORT("tcp");
-
-}} // namespace qpid::broker
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Broker.h b/M4-RCs/qpid/cpp/src/qpid/broker/Broker.h
deleted file mode 100644
index c64bfa8a9f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Broker.h
+++ /dev/null
@@ -1,229 +0,0 @@
-#ifndef _Broker_
-#define _Broker_
-
-/*
- *
- * 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 "ConnectionFactory.h"
-#include "ConnectionToken.h"
-#include "DirectExchange.h"
-#include "DtxManager.h"
-#include "ExchangeRegistry.h"
-#include "MessageStore.h"
-#include "QueueRegistry.h"
-#include "LinkRegistry.h"
-#include "SessionManager.h"
-#include "QueueCleaner.h"
-#include "Vhost.h"
-#include "System.h"
-#include "Timer.h"
-#include "qpid/management/Manageable.h"
-#include "qpid/management/ManagementBroker.h"
-#include "qmf/org/apache/qpid/broker/Broker.h"
-#include "qmf/org/apache/qpid/broker/ArgsBrokerConnect.h"
-#include "qpid/Options.h"
-#include "qpid/Plugin.h"
-#include "qpid/DataDir.h"
-#include "qpid/framing/FrameHandler.h"
-#include "qpid/framing/OutputHandler.h"
-#include "qpid/framing/ProtocolInitiation.h"
-#include "qpid/sys/Runnable.h"
-#include "qpid/RefCounted.h"
-#include "AclModule.h"
-
-#include <boost/intrusive_ptr.hpp>
-#include <string>
-#include <vector>
-
-namespace qpid {
-
-namespace sys {
- class ProtocolFactory;
- class Poller;
-}
-
-struct Url;
-
-namespace broker {
-
-static const uint16_t DEFAULT_PORT=5672;
-
-struct NoSuchTransportException : qpid::Exception
-{
- NoSuchTransportException(const std::string& s) : Exception(s) {}
- virtual ~NoSuchTransportException() throw() {}
-};
-
-/**
- * A broker instance.
- */
-class Broker : public sys::Runnable, public Plugin::Target,
- public management::Manageable, public RefCounted
-{
- public:
-
- struct Options : public qpid::Options {
- static const std::string DEFAULT_DATA_DIR_LOCATION;
- static const std::string DEFAULT_DATA_DIR_NAME;
-
- Options(const std::string& name="Broker Options");
-
- bool noDataDir;
- std::string dataDir;
- uint16_t port;
- int workerThreads;
- int maxConnections;
- int connectionBacklog;
- uint64_t stagingThreshold;
- bool enableMgmt;
- uint16_t mgmtPubInterval;
- uint16_t queueCleanInterval;
- bool auth;
- std::string realm;
- size_t replayFlushLimit;
- size_t replayHardLimit;
- uint queueLimit;
- bool tcpNoDelay;
- bool requireEncrypted;
- };
-
- private:
- typedef std::map<std::string, boost::shared_ptr<sys::ProtocolFactory> > ProtocolFactoryMap;
-
- boost::shared_ptr<sys::Poller> poller;
- Options config;
- management::ManagementAgent::Singleton managementAgentSingleton;
- ProtocolFactoryMap protocolFactories;
- std::auto_ptr<MessageStore> store;
- AclModule* acl;
- DataDir dataDir;
-
- QueueRegistry queues;
- ExchangeRegistry exchanges;
- LinkRegistry links;
- boost::shared_ptr<sys::ConnectionCodec::Factory> factory;
- Timer timer;
- DtxManager dtxManager;
- SessionManager sessionManager;
- management::ManagementAgent* managementAgent;
- qmf::org::apache::qpid::broker::Broker* mgmtObject;
- Vhost::shared_ptr vhostObject;
- System::shared_ptr systemObject;
- QueueCleaner queueCleaner;
-
- void declareStandardExchange(const std::string& name, const std::string& type);
-
- std::vector<Url> knownBrokers;
- std::vector<Url> getKnownBrokersImpl();
- std::string federationTag;
-
- public:
-
-
- virtual ~Broker();
-
- Broker(const Options& configuration);
- static boost::intrusive_ptr<Broker> create(const Options& configuration);
- static boost::intrusive_ptr<Broker> create(int16_t port = DEFAULT_PORT);
-
- /**
- * Return listening port. If called before bind this is
- * the configured port. If called after it is the actual
- * port, which will be different if the configured port is
- * 0.
- */
- virtual uint16_t getPort(const std::string& name) const;
-
- /**
- * Run the broker. Implements Runnable::run() so the broker
- * can be run in a separate thread.
- */
- virtual void run();
-
- /** Shut down the broker */
- virtual void shutdown();
-
- void setStore (MessageStore*);
- MessageStore& getStore() { return *store; }
- void setAcl (AclModule* _acl) {acl = _acl;}
- AclModule* getAcl() { return acl; }
- QueueRegistry& getQueues() { return queues; }
- ExchangeRegistry& getExchanges() { return exchanges; }
- LinkRegistry& getLinks() { return links; }
- uint64_t getStagingThreshold() { return config.stagingThreshold; }
- DtxManager& getDtxManager() { return dtxManager; }
- DataDir& getDataDir() { return dataDir; }
- Options& getOptions() { return config; }
-
- SessionManager& getSessionManager() { return sessionManager; }
- const std::string& getFederationTag() const { return federationTag; }
-
- management::ManagementObject* GetManagementObject (void) const;
- management::Manageable* GetVhostObject (void) const;
- management::Manageable::status_t ManagementMethod (uint32_t methodId,
- management::Args& args,
- std::string& text);
-
- /** Add to the broker's protocolFactorys */
- void registerProtocolFactory(const std::string& name, boost::shared_ptr<sys::ProtocolFactory>);
-
- /** Accept connections */
- void accept();
-
- /** Create a connection to another broker. */
- void connect(const std::string& host, uint16_t port,
- const std::string& transport,
- boost::function2<void, int, std::string> failed,
- sys::ConnectionCodec::Factory* =0);
- /** Create a connection to another broker. */
- void connect(const Url& url,
- boost::function2<void, int, std::string> failed,
- sys::ConnectionCodec::Factory* =0);
-
- /** Move messages from one queue to another.
- A zero quantity means to move all messages
- */
- uint32_t queueMoveMessages( const std::string& srcQueue,
- const std::string& destQueue,
- uint32_t qty);
-
- // TODO: There isn't a single ProtocolFactory so the use of the following needs to be fixed
- // For the present just return the first ProtocolFactory registered.
- boost::shared_ptr<sys::ProtocolFactory> getProtocolFactory(const std::string& name = TCP_TRANSPORT) const;
-
- /** Expose poller so plugins can register their descriptors. */
- boost::shared_ptr<sys::Poller> getPoller();
-
- boost::shared_ptr<sys::ConnectionCodec::Factory> getConnectionFactory() { return factory; }
- void setConnectionFactory(boost::shared_ptr<sys::ConnectionCodec::Factory> f) { factory = f; }
-
- Timer& getTimer() { return timer; }
-
- boost::function<std::vector<Url> ()> getKnownBrokers;
-
- static const std::string TCP_TRANSPORT;
-};
-
-}}
-
-
-
-#endif /*!_Broker_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/BrokerSingleton.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/BrokerSingleton.cpp
deleted file mode 100644
index 5ba8c9d1e1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/BrokerSingleton.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "BrokerSingleton.h"
-
-namespace qpid {
-namespace broker {
-
-BrokerSingleton::BrokerSingleton() {
- if (broker.get() == 0)
- broker = Broker::create();
- boost::intrusive_ptr<Broker>::operator=(broker);
-}
-
-BrokerSingleton::~BrokerSingleton() {
- broker->shutdown();
-}
-
-boost::intrusive_ptr<Broker> BrokerSingleton::broker;
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/BrokerSingleton.h b/M4-RCs/qpid/cpp/src/qpid/broker/BrokerSingleton.h
deleted file mode 100644
index 22b707506b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/BrokerSingleton.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef _broker_BrokerSingleton_h
-#define _broker_BrokerSingleton_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Broker.h"
-
-namespace qpid {
-namespace broker {
-
-/**
- * BrokerSingleton is a smart pointer to a process-wide singleton broker
- * started on an os-chosen port. The broker starts the first time
- * an instance of BrokerSingleton is created and runs untill the process exits.
- *
- * Useful for unit tests that want to share a broker between multiple
- * tests to reduce overhead of starting/stopping a broker for every test.
- *
- * Tests that need a new broker can create it directly.
- *
- * THREAD UNSAFE.
- */
-class BrokerSingleton : public boost::intrusive_ptr<Broker>
-{
- public:
- BrokerSingleton();
- ~BrokerSingleton();
- private:
- static boost::intrusive_ptr<Broker> broker;
-};
-
-}} // namespace qpid::broker
-
-
-
-#endif /*!_broker_BrokerSingleton_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Connection.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/Connection.cpp
deleted file mode 100644
index f0b9980861..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Connection.cpp
+++ /dev/null
@@ -1,271 +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 "Connection.h"
-#include "SessionState.h"
-#include "Bridge.h"
-
-#include "qpid/log/Statement.h"
-#include "qpid/ptr_map.h"
-#include "qpid/framing/AMQP_ClientProxy.h"
-#include "qpid/framing/enum.h"
-#include "qmf/org/apache/qpid/broker/EventClientConnect.h"
-#include "qmf/org/apache/qpid/broker/EventClientDisconnect.h"
-
-#include <boost/bind.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
-
-#include <algorithm>
-#include <iostream>
-#include <assert.h>
-
-using namespace qpid::sys;
-using namespace qpid::framing;
-using namespace qpid::sys;
-using qpid::ptr_map_ptr;
-using qpid::management::ManagementAgent;
-using qpid::management::ManagementObject;
-using qpid::management::Manageable;
-using qpid::management::Args;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-namespace qpid {
-namespace broker {
-
-Connection::Connection(ConnectionOutputHandler* out_, Broker& broker_, const std::string& mgmtId_, bool isLink_) :
- ConnectionState(out_, broker_),
- adapter(*this, isLink_),
- isLink(isLink_),
- mgmtClosing(false),
- mgmtId(mgmtId_),
- mgmtObject(0),
- links(broker_.getLinks()),
- agent(0)
-{
- Manageable* parent = broker.GetVhostObject();
-
- if (isLink)
- links.notifyConnection(mgmtId, this);
-
- if (parent != 0)
- {
- agent = ManagementAgent::Singleton::getInstance();
-
-
- // TODO set last bool true if system connection
- if (agent != 0)
- mgmtObject = new _qmf::Connection(agent, this, parent, mgmtId, !isLink, false);
- agent->addObject(mgmtObject);
- ConnectionState::setUrl(mgmtId);
- }
-}
-
-void Connection::requestIOProcessing(boost::function0<void> callback)
-{
- ioCallback = callback;
- out.activateOutput();
-}
-
-Connection::~Connection()
-{
- if (mgmtObject != 0) {
- mgmtObject->resourceDestroy();
- if (!isLink)
- agent->raiseEvent(_qmf::EventClientDisconnect(mgmtId, ConnectionState::getUserId()));
- }
- if (isLink)
- links.notifyClosed(mgmtId);
-}
-
-void Connection::received(framing::AMQFrame& frame) {
- if (frame.getChannel() == 0 && frame.getMethod()) {
- adapter.handle(frame);
- } else {
- getChannel(frame.getChannel()).in(frame);
- }
-
- if (isLink)
- recordFromServer(frame);
- else
- recordFromClient(frame);
-}
-
-void Connection::recordFromServer(framing::AMQFrame& frame)
-{
- if (mgmtObject != 0)
- {
- mgmtObject->inc_framesToClient();
- mgmtObject->inc_bytesToClient(frame.encodedSize());
- }
-}
-
-void Connection::recordFromClient(framing::AMQFrame& frame)
-{
- if (mgmtObject != 0)
- {
- mgmtObject->inc_framesFromClient();
- mgmtObject->inc_bytesFromClient(frame.encodedSize());
- }
-}
-
-string Connection::getAuthMechanism()
-{
- if (!isLink)
- return string("ANONYMOUS");
-
- return links.getAuthMechanism(mgmtId);
-}
-
-string Connection::getAuthCredentials()
-{
- if (!isLink)
- return string();
-
- if (mgmtObject != 0)
- {
- if (links.getAuthMechanism(mgmtId) == "ANONYMOUS")
- mgmtObject->set_authIdentity("anonymous");
- else
- mgmtObject->set_authIdentity(links.getAuthIdentity(mgmtId));
- }
-
- return links.getAuthCredentials(mgmtId);
-}
-
-void Connection::notifyConnectionForced(const string& text)
-{
- if (isLink)
- links.notifyConnectionForced(mgmtId, text);
-}
-
-void Connection::setUserId(const string& userId)
-{
- ConnectionState::setUserId(userId);
- if (mgmtObject != 0) {
- mgmtObject->set_authIdentity(userId);
- agent->raiseEvent(_qmf::EventClientConnect(mgmtId, userId));
- }
-}
-
-void Connection::setFederationLink(bool b)
-{
- ConnectionState::setFederationLink(b);
- if (mgmtObject != 0)
- mgmtObject->set_federationLink(b);
-}
-
-void Connection::close(connection::CloseCode code, const string& text)
-{
- QPID_LOG_IF(error, code != connection::CLOSE_CODE_NORMAL, "Connection " << mgmtId << " closed by error: " << text << "(" << code << ")");
- adapter.close(code, text);
- //make sure we delete dangling pointers from outputTasks before deleting sessions
- outputTasks.removeAll();
- channels.clear();
- getOutput().close();
-}
-
-// Send a close to the client but keep the channels. Used by cluster.
-void Connection::sendClose() {
- adapter.close(connection::CLOSE_CODE_NORMAL, "OK");
- getOutput().close();
-}
-
-void Connection::idleOut(){}
-
-void Connection::idleIn(){}
-
-void Connection::closed(){ // Physically closed, suspend open sessions.
- try {
- while (!channels.empty())
- ptr_map_ptr(channels.begin())->handleDetach();
- while (!exclusiveQueues.empty()) {
- Queue::shared_ptr q(exclusiveQueues.front());
- q->releaseExclusiveOwnership();
- if (q->canAutoDelete()) {
- Queue::tryAutoDelete(broker, q);
- }
- exclusiveQueues.erase(exclusiveQueues.begin());
- }
- } catch(std::exception& e) {
- QPID_LOG(error, QPID_MSG("While closing connection: " << e.what()));
- assert(0);
- }
-}
-
-bool Connection::hasOutput() { return outputTasks.hasOutput(); }
-
-bool Connection::doOutput() {
- try{
- if (ioCallback)
- ioCallback(); // Lend the IO thread for management processing
- ioCallback = 0;
-
- if (mgmtClosing)
- close(connection::CLOSE_CODE_CONNECTION_FORCED, "Closed by Management Request");
- else
- //then do other output as needed:
- return outputTasks.doOutput();
- }catch(ConnectionException& e){
- close(e.code, e.getMessage());
- }catch(std::exception& e){
- close(connection::CLOSE_CODE_CONNECTION_FORCED, e.what());
- }
- return false;
-}
-
-void Connection::closeChannel(uint16_t id) {
- ChannelMap::iterator i = channels.find(id);
- if (i != channels.end()) channels.erase(i);
-}
-
-SessionHandler& Connection::getChannel(ChannelId id) {
- ChannelMap::iterator i=channels.find(id);
- if (i == channels.end()) {
- i = channels.insert(id, new SessionHandler(*this, id)).first;
- }
- return *ptr_map_ptr(i);
-}
-
-ManagementObject* Connection::GetManagementObject(void) const
-{
- return (ManagementObject*) mgmtObject;
-}
-
-Manageable::status_t Connection::ManagementMethod(uint32_t methodId, Args&, string&)
-{
- Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
-
- QPID_LOG(debug, "Connection::ManagementMethod [id=" << methodId << "]");
-
- switch (methodId)
- {
- case _qmf::Connection::METHOD_CLOSE :
- mgmtClosing = true;
- if (mgmtObject != 0) mgmtObject->set_closing(1);
- out.activateOutput();
- status = Manageable::STATUS_OK;
- break;
- }
-
- return status;
-}
-
-}}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Connection.h b/M4-RCs/qpid/cpp/src/qpid/broker/Connection.h
deleted file mode 100644
index 350ed2c07f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Connection.h
+++ /dev/null
@@ -1,127 +0,0 @@
-#ifndef QPID_BROKER_CONNECTION_H
-#define QPID_BROKER_CONNECTION_H
-
-/*
- *
- * 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 <memory>
-#include <sstream>
-#include <vector>
-
-#include <boost/ptr_container/ptr_map.hpp>
-
-#include "Broker.h"
-#include "ConnectionHandler.h"
-#include "ConnectionState.h"
-#include "SessionHandler.h"
-#include "qmf/org/apache/qpid/broker/Connection.h"
-#include "qpid/Exception.h"
-#include "qpid/RefCounted.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/AMQP_ClientProxy.h"
-#include "qpid/framing/AMQP_ServerOperations.h"
-#include "qpid/framing/ProtocolVersion.h"
-#include "qpid/agent/ManagementAgent.h"
-#include "qpid/management/Manageable.h"
-#include "qpid/ptr_map.h"
-#include "qpid/sys/AggregateOutput.h"
-#include "qpid/sys/ConnectionInputHandler.h"
-#include "qpid/sys/ConnectionOutputHandler.h"
-#include "qpid/sys/Socket.h"
-#include "qpid/sys/TimeoutHandler.h"
-
-#include <boost/ptr_container/ptr_map.hpp>
-#include <boost/bind.hpp>
-
-#include <algorithm>
-
-namespace qpid {
-namespace broker {
-
-class LinkRegistry;
-
-class Connection : public sys::ConnectionInputHandler,
- public ConnectionState,
- public RefCounted
-{
- public:
- Connection(sys::ConnectionOutputHandler* out, Broker& broker, const std::string& mgmtId, bool isLink = false);
- ~Connection ();
-
- /** Get the SessionHandler for channel. Create if it does not already exist */
- SessionHandler& getChannel(framing::ChannelId channel);
-
- /** Close the connection */
- void close(framing::connection::CloseCode code, const string& text);
-
- // ConnectionInputHandler methods
- void received(framing::AMQFrame& frame);
- void idleOut();
- void idleIn();
- bool hasOutput();
- bool doOutput();
- void closed();
-
- void closeChannel(framing::ChannelId channel);
-
- // Manageable entry points
- management::ManagementObject* GetManagementObject (void) const;
- management::Manageable::status_t
- ManagementMethod (uint32_t methodId, management::Args& args, std::string&);
-
- void requestIOProcessing (boost::function0<void>);
- void recordFromServer (framing::AMQFrame& frame);
- void recordFromClient (framing::AMQFrame& frame);
- std::string getAuthMechanism();
- std::string getAuthCredentials();
- void notifyConnectionForced(const std::string& text);
- void setUserId(const string& uid);
- const std::string& getUserId() const { return ConnectionState::getUserId(); }
- const std::string& getMgmtId() const { return mgmtId; }
- management::ManagementAgent* getAgent() const { return agent; }
- void setFederationLink(bool b);
-
- template <class F> void eachSessionHandler(F f) {
- for (ChannelMap::iterator i = channels.begin(); i != channels.end(); ++i)
- f(*ptr_map_ptr(i));
- }
-
- void sendClose();
-
- private:
- typedef boost::ptr_map<framing::ChannelId, SessionHandler> ChannelMap;
- typedef std::vector<Queue::shared_ptr>::iterator queue_iterator;
-
- ChannelMap channels;
- framing::AMQP_ClientProxy::Connection* client;
- ConnectionHandler adapter;
- bool isLink;
- bool mgmtClosing;
- const std::string mgmtId;
- boost::function0<void> ioCallback;
- qmf::org::apache::qpid::broker::Connection* mgmtObject;
- LinkRegistry& links;
- management::ManagementAgent* agent;
-};
-
-}}
-
-#endif /*!QPID_BROKER_CONNECTION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionFactory.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionFactory.cpp
deleted file mode 100644
index e6d8c49055..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionFactory.cpp
+++ /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.
- *
- */
-#include "ConnectionFactory.h"
-#include "qpid/framing/ProtocolVersion.h"
-#include "qpid/amqp_0_10/Connection.h"
-#include "qpid/broker/Connection.h"
-
-namespace qpid {
-namespace broker {
-
-using framing::ProtocolVersion;
-typedef std::auto_ptr<amqp_0_10::Connection> ConnectionPtr;
-typedef std::auto_ptr<sys::ConnectionInputHandler> InputPtr;
-
-ConnectionFactory::ConnectionFactory(Broker& b) : broker(b) {}
-
-ConnectionFactory::~ConnectionFactory() {}
-
-sys::ConnectionCodec*
-ConnectionFactory::create(ProtocolVersion v, sys::OutputControl& out, const std::string& id) {
- if (v == ProtocolVersion(0, 10)) {
- ConnectionPtr c(new amqp_0_10::Connection(out, id, false));
- c->setInputHandler(InputPtr(new broker::Connection(c.get(), broker, id, false)));
- return c.release();
- }
- return 0;
-}
-
-sys::ConnectionCodec*
-ConnectionFactory::create(sys::OutputControl& out, const std::string& id) {
- // used to create connections from one broker to another
- ConnectionPtr c(new amqp_0_10::Connection(out, id, true));
- c->setInputHandler(InputPtr(new broker::Connection(c.get(), broker, id, true)));
- return c.release();
-}
-
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionFactory.h b/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionFactory.h
deleted file mode 100644
index c61da81024..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionFactory.h
+++ /dev/null
@@ -1,50 +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.
- *
- */
-#ifndef _ConnectionFactory_
-#define _ConnectionFactory_
-
-#include "qpid/sys/ConnectionCodec.h"
-
-namespace qpid {
-namespace broker {
-class Broker;
-
-class ConnectionFactory : public sys::ConnectionCodec::Factory
-{
- public:
- ConnectionFactory(Broker& b);
-
- virtual ~ConnectionFactory();
-
- sys::ConnectionCodec*
- create(framing::ProtocolVersion, sys::OutputControl&, const std::string& id);
-
- sys::ConnectionCodec*
- create(sys::OutputControl&, const std::string& id);
-
- private:
- Broker& broker;
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
deleted file mode 100644
index 7386ce7229..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionHandler.cpp
+++ /dev/null
@@ -1,222 +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 "ConnectionHandler.h"
-#include "Connection.h"
-#include "qpid/framing/ClientInvoker.h"
-#include "qpid/framing/ServerInvoker.h"
-#include "qpid/framing/enum.h"
-#include "qpid/log/Statement.h"
-#include "qpid/Url.h"
-#include "AclModule.h"
-#include "qmf/org/apache/qpid/broker/EventClientConnectFail.h"
-
-using namespace qpid;
-using namespace qpid::broker;
-using namespace qpid::framing;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-namespace
-{
-const std::string ANONYMOUS = "ANONYMOUS";
-const std::string PLAIN = "PLAIN";
-const std::string en_US = "en_US";
-const std::string QPID_FED_LINK = "qpid.fed_link";
-const std::string QPID_FED_TAG = "qpid.federation_tag";
-}
-
-void ConnectionHandler::close(connection::CloseCode code, const string& text)
-{
- handler->client.close(code, text);
-}
-
-void ConnectionHandler::handle(framing::AMQFrame& frame)
-{
- AMQMethodBody* method=frame.getBody()->getMethod();
- try{
- bool handled = false;
- if (handler->serverMode) {
- handled = invoke(static_cast<AMQP_ServerOperations::ConnectionHandler&>(*handler.get()), *method);
- } else {
- handled = invoke(static_cast<AMQP_ClientOperations::ConnectionHandler&>(*handler.get()), *method);
- }
- if (!handled) {
- handler->connection.getChannel(frame.getChannel()).in(frame);
- }
-
- }catch(ConnectionException& e){
- handler->client.close(e.code, e.what());
- }catch(std::exception& e){
- handler->client.close(541/*internal error*/, e.what());
- }
-}
-
-ConnectionHandler::ConnectionHandler(Connection& connection, bool isClient) : handler(new Handler(connection, isClient)) {}
-
-ConnectionHandler::Handler::Handler(Connection& c, bool isClient) :
- client(c.getOutput()), server(c.getOutput()),
- connection(c), serverMode(!isClient), acl(0)
-{
- if (serverMode) {
-
- acl = connection.getBroker().getAcl();
-
- FieldTable properties;
- Array mechanisms(0x95);
-
- properties.setString(QPID_FED_TAG, connection.getBroker().getFederationTag());
-
- authenticator = SaslAuthenticator::createAuthenticator(c);
- authenticator->getMechanisms(mechanisms);
-
- Array locales(0x95);
- boost::shared_ptr<FieldValue> l(new Str16Value(en_US));
- locales.add(l);
- client.start(properties, mechanisms, locales);
- }
-}
-
-
-ConnectionHandler::Handler::~Handler() {}
-
-
-void ConnectionHandler::Handler::startOk(const framing::FieldTable& clientProperties,
- const string& mechanism,
- const string& response,
- const string& /*locale*/)
-{
- try {
- authenticator->start(mechanism, response);
- } catch (std::exception& /*e*/) {
- management::ManagementAgent* agent = connection.getAgent();
- if (agent) {
- string error;
- string uid;
- authenticator->getError(error);
- authenticator->getUid(uid);
- agent->raiseEvent(_qmf::EventClientConnectFail(connection.getMgmtId(), uid, error));
- }
- throw;
- }
- connection.setFederationLink(clientProperties.get(QPID_FED_LINK));
- connection.setFederationPeerTag(clientProperties.getAsString(QPID_FED_TAG));
- if (connection.isFederationLink()) {
- if (acl && !acl->authorise(connection.getUserId(),acl::ACT_CREATE,acl::OBJ_LINK,"")){
- client.close(framing::connection::CLOSE_CODE_CONNECTION_FORCED,"ACL denied creating a federation link");
- return;
- }
- QPID_LOG(info, "Connection is a federation link");
- }
-}
-
-void ConnectionHandler::Handler::secureOk(const string& response)
-{
- try {
- authenticator->step(response);
- } catch (std::exception& /*e*/) {
- management::ManagementAgent* agent = connection.getAgent();
- if (agent) {
- string error;
- string uid;
- authenticator->getError(error);
- authenticator->getUid(uid);
- agent->raiseEvent(_qmf::EventClientConnectFail(connection.getMgmtId(), uid, error));
- }
- throw;
- }
-}
-
-void ConnectionHandler::Handler::tuneOk(uint16_t /*channelmax*/,
- uint16_t framemax, uint16_t heartbeat)
-{
- connection.setFrameMax(framemax);
- connection.setHeartbeat(heartbeat);
-}
-
-void ConnectionHandler::Handler::open(const string& /*virtualHost*/,
- const framing::Array& /*capabilities*/, bool /*insist*/)
-{
- std::vector<Url> urls = connection.broker.getKnownBrokers();
- framing::Array array(0x95); // str16 array
- for (std::vector<Url>::iterator i = urls.begin(); i < urls.end(); ++i)
- array.add(boost::shared_ptr<Str16Value>(new Str16Value(i->str())));
- client.openOk(array);
-}
-
-
-void ConnectionHandler::Handler::close(uint16_t replyCode, const string& replyText)
-{
- if (replyCode != 200) {
- QPID_LOG(warning, "Client closed connection with " << replyCode << ": " << replyText);
- }
-
- if (replyCode == framing::connection::CLOSE_CODE_CONNECTION_FORCED)
- connection.notifyConnectionForced(replyText);
-
- client.closeOk();
- connection.getOutput().close();
-}
-
-void ConnectionHandler::Handler::closeOk(){
- connection.getOutput().close();
-}
-
-
-void ConnectionHandler::Handler::start(const FieldTable& serverProperties,
- const framing::Array& /*mechanisms*/,
- const framing::Array& /*locales*/)
-{
- string mechanism = connection.getAuthMechanism();
- string response = connection.getAuthCredentials();
-
- connection.setFederationPeerTag(serverProperties.getAsString(QPID_FED_TAG));
-
- FieldTable ft;
- ft.setInt(QPID_FED_LINK,1);
- ft.setString(QPID_FED_TAG, connection.getBroker().getFederationTag());
- server.startOk(ft, mechanism, response, en_US);
-}
-
-void ConnectionHandler::Handler::secure(const string& /*challenge*/)
-{
- server.secureOk("");
-}
-
-void ConnectionHandler::Handler::tune(uint16_t channelMax,
- uint16_t frameMax,
- uint16_t /*heartbeatMin*/,
- uint16_t heartbeatMax)
-{
- connection.setFrameMax(frameMax);
- connection.setHeartbeat(heartbeatMax);
- server.tuneOk(channelMax, frameMax, heartbeatMax);
- server.open("/", Array(), true);
-}
-
-void ConnectionHandler::Handler::openOk(const framing::Array& /*knownHosts*/)
-{
-}
-
-void ConnectionHandler::Handler::redirect(const string& /*host*/, const framing::Array& /*knownHosts*/)
-{
-
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionHandler.h b/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionHandler.h
deleted file mode 100644
index d3d5965dfc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionHandler.h
+++ /dev/null
@@ -1,95 +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.
- *
- */
-#ifndef _ConnectionAdapter_
-#define _ConnectionAdapter_
-
-#include <memory>
-#include "SaslAuthenticator.h"
-#include "qpid/framing/amqp_types.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/AMQP_ClientOperations.h"
-#include "qpid/framing/AMQP_ClientProxy.h"
-#include "qpid/framing/AMQP_ServerOperations.h"
-#include "qpid/framing/AMQP_ServerProxy.h"
-#include "qpid/framing/enum.h"
-#include "qpid/framing/FrameHandler.h"
-#include "qpid/framing/ProtocolInitiation.h"
-#include "qpid/framing/ProtocolVersion.h"
-#include "qpid/Exception.h"
-#include "AclModule.h"
-
-namespace qpid {
-namespace broker {
-
-class Connection;
-
-class ConnectionHandler : public framing::FrameHandler
-{
- struct Handler : public framing::AMQP_ServerOperations::ConnectionHandler,
- public framing::AMQP_ClientOperations::ConnectionHandler
- {
- framing::AMQP_ClientProxy::Connection client;
- framing::AMQP_ServerProxy::Connection server;
- Connection& connection;
- bool serverMode;
- std::auto_ptr<SaslAuthenticator> authenticator;
- AclModule* acl;
-
- Handler(Connection& connection, bool isClient);
- ~Handler();
- void startOk(const qpid::framing::FieldTable& clientProperties,
- const std::string& mechanism, const std::string& response,
- const std::string& locale);
- void secureOk(const std::string& response);
- void tuneOk(uint16_t channelMax, uint16_t frameMax, uint16_t heartbeat);
- void heartbeat() {}
- void open(const std::string& virtualHost,
- const framing::Array& capabilities, bool insist);
- void close(uint16_t replyCode, const std::string& replyText);
- void closeOk();
-
-
- void start(const qpid::framing::FieldTable& serverProperties,
- const framing::Array& mechanisms,
- const framing::Array& locales);
-
- void secure(const std::string& challenge);
-
- void tune(uint16_t channelMax,
- uint16_t frameMax,
- uint16_t heartbeatMin,
- uint16_t heartbeatMax);
-
- void openOk(const framing::Array& knownHosts);
-
- void redirect(const std::string& host, const framing::Array& knownHosts);
- };
- std::auto_ptr<Handler> handler;
- public:
- ConnectionHandler(Connection& connection, bool isClient);
- void close(framing::connection::CloseCode code, const std::string& text);
- void handle(framing::AMQFrame& frame);
-};
-
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionState.h b/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionState.h
deleted file mode 100644
index fd69157dbd..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionState.h
+++ /dev/null
@@ -1,100 +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.
- *
- */
-#ifndef _ConnectionState_
-#define _ConnectionState_
-
-#include <vector>
-
-#include "qpid/sys/AggregateOutput.h"
-#include "qpid/sys/ConnectionOutputHandlerPtr.h"
-#include "qpid/framing/ProtocolVersion.h"
-#include "qpid/management/Manageable.h"
-#include "Broker.h"
-
-namespace qpid {
-namespace broker {
-
-class ConnectionState : public ConnectionToken, public management::Manageable
-{
- protected:
- sys::ConnectionOutputHandlerPtr out;
-
- public:
- ConnectionState(qpid::sys::ConnectionOutputHandler* o, Broker& b) :
- out(o),
- broker(b),
- outputTasks(out),
- framemax(65535),
- heartbeat(0),
- stagingThreshold(broker.getStagingThreshold()),
- federationLink(true)
- {}
-
-
-
- virtual ~ConnectionState () {}
-
- uint32_t getFrameMax() const { return framemax; }
- uint16_t getHeartbeat() const { return heartbeat; }
- uint64_t getStagingThreshold() const { return stagingThreshold; }
-
- void setFrameMax(uint32_t fm) { framemax = fm; }
- void setHeartbeat(uint16_t hb) { heartbeat = hb; }
- void setStagingThreshold(uint64_t st) { stagingThreshold = st; }
-
- virtual void setUserId(const string& uid) { userId = uid; }
- const string& getUserId() const { return userId; }
-
- void setUrl(const string& _url) { url = _url; }
- const string& getUrl() const { return url; }
-
- void setFederationLink(bool b) { federationLink = b; }
- bool isFederationLink() const { return federationLink; }
- void setFederationPeerTag(const string& tag) { federationPeerTag = string(tag); }
- const string& getFederationPeerTag() const { return federationPeerTag; }
-
- Broker& getBroker() { return broker; }
-
- Broker& broker;
- std::vector<Queue::shared_ptr> exclusiveQueues;
-
- //contained output tasks
- sys::AggregateOutput outputTasks;
-
- sys::ConnectionOutputHandlerPtr& getOutput() { return out; }
- framing::ProtocolVersion getVersion() const { return version; }
-
- void setOutputHandler(qpid::sys::ConnectionOutputHandler* o) { out.set(o); }
-
- protected:
- framing::ProtocolVersion version;
- uint32_t framemax;
- uint16_t heartbeat;
- uint64_t stagingThreshold;
- string userId;
- string url;
- bool federationLink;
- string federationPeerTag;
-};
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionToken.h b/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionToken.h
deleted file mode 100644
index 0e3b301897..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/ConnectionToken.h
+++ /dev/null
@@ -1,40 +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.
- *
- */
-#ifndef _ConnectionToken_
-#define _ConnectionToken_
-
-#include "OwnershipToken.h"
-namespace qpid {
- namespace broker {
- /**
- * An empty interface allowing opaque implementations of some
- * form of token to identify a connection.
- */
- class ConnectionToken : public OwnershipToken {
- public:
- virtual bool isLocal(const ConnectionToken* t) const { return this == t; }
- virtual ~ConnectionToken(){}
- };
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Consumer.h b/M4-RCs/qpid/cpp/src/qpid/broker/Consumer.h
deleted file mode 100644
index 5de00668b3..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Consumer.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.
- *
- */
-#ifndef _Consumer_
-#define _Consumer_
-
-#include "Message.h"
-#include "QueuedMessage.h"
-#include "OwnershipToken.h"
-
-namespace qpid {
-namespace broker {
-
-class Queue;
-
-class Consumer {
- const bool acquires;
- public:
- typedef boost::shared_ptr<Consumer> shared_ptr;
-
- framing::SequenceNumber position;
-
- Consumer(bool preAcquires = true) : acquires(preAcquires) {}
- bool preAcquires() const { return acquires; }
- virtual bool deliver(QueuedMessage& msg) = 0;
- virtual void notify() = 0;
- virtual bool filter(boost::intrusive_ptr<Message>) { return true; }
- virtual bool accept(boost::intrusive_ptr<Message>) { return true; }
- virtual OwnershipToken* getSession() = 0;
- virtual ~Consumer(){}
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Daemon.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/Daemon.cpp
deleted file mode 100644
index 88eb8fc1cd..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Daemon.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-#include "Daemon.h"
-#include "qpid/log/Statement.h"
-#include "qpid/Exception.h"
-#include "qpid/sys/LockFile.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-namespace qpid {
-namespace broker {
-
-using namespace std;
-using qpid::sys::LockFile;
-
-Daemon::Daemon(std::string _pidDir) : pidDir(_pidDir) {
- struct stat s;
- pid = -1;
- pipeFds[0] = pipeFds[1] = -1;
-
- if (::stat(pidDir.c_str(), &s)) {
- if (errno == ENOENT) {
- if (::mkdir(pidDir.c_str(), 0755))
- throw Exception ("Can't create PID directory: " + pidDir);
- }
- else
- throw Exception ("PID directory not found: " + pidDir);
- }
-}
-
-string Daemon::pidFile(string pidDir, uint16_t port) {
- ostringstream path;
- path << pidDir << "/qpidd." << port << ".pid";
- return path.str();
-}
-
-/*
- * Rewritten using low-level IO, for compatibility
- * with earlier Boost versions, i.e. 103200.
- */
-void Daemon::fork()
-{
- if(::pipe(pipeFds) < 0) throw ErrnoException("Can't create pipe");
- if ((pid = ::fork()) < 0) throw ErrnoException("Daemon fork failed");
- if (pid == 0) { // Child
- try {
- QPID_LOG(debug, "Forked daemon child process");
-
- // File descriptors
- if(::close(pipeFds[0])<0) throw ErrnoException("Cannot close read pipe");
- if(::close(0)<0) throw ErrnoException("Cannot close stdin");
- if(::close(1)<0) throw ErrnoException("Cannot close stdout");
- if(::close(2)<0) throw ErrnoException("Cannot close stderr");
- int fd=::open("/dev/null",O_RDWR); // stdin
- if(fd != 0) throw ErrnoException("Cannot re-open stdin");
- if(::dup(fd)<0) throw ErrnoException("Cannot re-open stdout");
- if(::dup(fd)<0) throw ErrnoException("Cannot re-open stderror");
-
- // Misc
- if(setsid()<0) throw ErrnoException("Cannot set session ID");
- if(chdir(pidDir.c_str()) < 0) throw ErrnoException("Cannot change directory to "+pidDir);
- umask(027);
-
- // Child behavior
- child();
- }
- catch (const exception& e) {
- QPID_LOG(critical, "Daemon startup failed: " << e.what());
- uint16_t port = 0;
- write(pipeFds[1], &port, sizeof(uint16_t));
-
- std::string pipeFailureMessage = e.what();
- write ( pipeFds[1],
- pipeFailureMessage.c_str(),
- strlen(pipeFailureMessage.c_str())
- );
- }
- }
- else { // Parent
- close(pipeFds[1]); // Write side.
- parent();
- }
-}
-
-Daemon::~Daemon() {
- if (!lockFile.empty())
- unlink(lockFile.c_str());
-}
-
-uint16_t Daemon::wait(int timeout) { // parent waits for child.
- try {
- errno = 0;
- struct timeval tv;
- tv.tv_sec = timeout;
- tv.tv_usec = 0;
-
- /*
- * Rewritten using low-level IO, for compatibility
- * with earlier Boost versions, i.e. 103200.
- */
- fd_set fds;
- FD_ZERO(&fds);
- FD_SET(pipeFds[0], &fds);
- int n=select(FD_SETSIZE, &fds, 0, 0, &tv);
- if(n==0) throw Exception("Timed out waiting for daemon");
- if(n<0) throw ErrnoException("Error waiting for daemon");
- uint16_t port = 0;
- /*
- * Read the child's port number from the pipe.
- */
- int desired_read = sizeof(uint16_t);
- if ( desired_read > ::read(pipeFds[0], & port, desired_read) )
- throw Exception("Cannot read from child process.");
-
- /*
- * If the port number is 0, the child has put an error message
- * on the pipe. Get it and throw it.
- */
- if ( 0 == port ) {
- // Skip whitespace
- char c = ' ';
- while ( isspace(c) ) {
- if ( 1 > ::read(pipeFds[0], &c, 1) )
- throw Exception("Child port == 0, and no error message on pipe.");
- }
-
- // Get Message
- string errmsg;
- do {
- errmsg += c;
- } while (::read(pipeFds[0], &c, 1));
- throw Exception("Daemon startup failed"+
- (errmsg.empty() ? string(".") : ": " + errmsg));
- }
- return port;
- }
- catch (const std::exception& e) {
- // Print directly to cerr. The caller will catch and log the
- // exception, but in the case of a daemon parent process we
- // also need to be sure the error goes to stderr. A
- // dameon's logging configuration normally does not log to
- // stderr.
- std::cerr << e.what() << endl;
- throw;
- }
-}
-
-
-/*
- * When the child is ready, it writes its pid to the
- * lockfile and its port number on the pipe back to
- * its parent process. This indicates that the
- * child has successfully daemonized. When the parent
- * hears the good news, it ill exit.
- */
-void Daemon::ready(uint16_t port) { // child
- lockFile = pidFile(pidDir, port);
- LockFile lf(lockFile, true);
-
- /*
- * Write the PID to the lockfile.
- */
- lf.writePid();
-
- /*
- * Write the port number to the parent.
- */
- int desired_write = sizeof(uint16_t);
- if ( desired_write > ::write(pipeFds[1], & port, desired_write) ) {
- throw Exception("Error writing to parent." );
- }
-
- QPID_LOG(debug, "Daemon ready on port: " << port);
-}
-
-/*
- * The parent process reads the child's pid
- * from the lockfile.
- */
-pid_t Daemon::getPid(string _pidDir, uint16_t port) {
- string name = pidFile(_pidDir, port);
- LockFile lf(name, false);
- pid_t pid = lf.readPid();
- if (kill(pid, 0) < 0 && errno != EPERM) {
- unlink(name.c_str());
- throw Exception("Removing stale lock file "+name);
- }
- return pid;
-}
-
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Daemon.h b/M4-RCs/qpid/cpp/src/qpid/broker/Daemon.h
deleted file mode 100644
index 98468debb7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Daemon.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef _broker_Daemon_h
-#define _broker_Daemon_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <string>
-#include <boost/scoped_ptr.hpp>
-#include <boost/function.hpp>
-#include <boost/noncopyable.hpp>
-
-namespace qpid {
-namespace broker {
-
-/**
- * Tools for forking and managing a daemon process.
- * NB: Only one Daemon instance is allowed in a process.
- */
-class Daemon : private boost::noncopyable
-{
- public:
- /** Check daemon is running on port, throw exception if not */
- static pid_t getPid(std::string pidDir, uint16_t port);
-
- Daemon(std::string pidDir);
-
- virtual ~Daemon();
-
- /**
- * Fork a daemon process.
- * Call parent() in the parent process, child() in the child.
- */
- void fork();
-
- protected:
-
- /** Called in parent process */
- virtual void parent() = 0;
-
- /** Called in child process */
- virtual void child() = 0;
-
- /** Call from parent(): wait for child to indicate it is ready.
- * @timeout in seconds to wait for response.
- * @return port passed by child to ready().
- */
- uint16_t wait(int timeout);
-
- /** Call from child(): Notify the parent we are ready and write the
- * PID file.
- *@param port returned by parent call to wait().
- */
- void ready(uint16_t port);
-
- private:
- static std::string pidFile(std::string pidDir, uint16_t port);
-
- pid_t pid;
- int pipeFds[2];
- int lockFileFd;
- std::string lockFile;
- std::string pidDir;
-};
-
-}} // namespace qpid::broker
-
-#endif /*!_broker_Daemon_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Deliverable.h b/M4-RCs/qpid/cpp/src/qpid/broker/Deliverable.h
deleted file mode 100644
index e0ceeb2408..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Deliverable.h
+++ /dev/null
@@ -1,44 +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.
- *
- */
-#ifndef _Deliverable_
-#define _Deliverable_
-
-#include "Queue.h"
-#include "Message.h"
-
-namespace qpid {
- namespace broker {
- class Deliverable{
- public:
- bool delivered;
- Deliverable() : delivered(false) {}
-
- virtual Message& getMessage() = 0;
-
- virtual void deliverTo(const boost::shared_ptr<Queue>& queue) = 0;
- virtual uint64_t contentSize() { return 0; }
- virtual ~Deliverable(){}
- };
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DeliverableMessage.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/DeliverableMessage.cpp
deleted file mode 100644
index 5fff54b329..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DeliverableMessage.cpp
+++ /dev/null
@@ -1,43 +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 "DeliverableMessage.h"
-
-using namespace qpid::broker;
-
-DeliverableMessage::DeliverableMessage(const boost::intrusive_ptr<Message>& _msg) : msg(_msg)
-{
-}
-
-void DeliverableMessage::deliverTo(const boost::shared_ptr<Queue>& queue)
-{
- queue->deliver(msg);
- delivered = true;
-}
-
-Message& DeliverableMessage::getMessage()
-{
- return *msg;
-}
-
-uint64_t DeliverableMessage::contentSize ()
-{
- return msg->contentSize ();
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DeliverableMessage.h b/M4-RCs/qpid/cpp/src/qpid/broker/DeliverableMessage.h
deleted file mode 100644
index f5db473c22..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DeliverableMessage.h
+++ /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.
- *
- */
-#ifndef _DeliverableMessage_
-#define _DeliverableMessage_
-
-#include "Deliverable.h"
-#include "Queue.h"
-#include "Message.h"
-
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
- namespace broker {
- class DeliverableMessage : public Deliverable{
- boost::intrusive_ptr<Message> msg;
- public:
- DeliverableMessage(const boost::intrusive_ptr<Message>& msg);
- virtual void deliverTo(const boost::shared_ptr<Queue>& queue);
- Message& getMessage();
- uint64_t contentSize();
- virtual ~DeliverableMessage(){}
- };
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryAdapter.h b/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryAdapter.h
deleted file mode 100644
index 0e9d7d3929..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryAdapter.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.
- *
- */
-#ifndef _DeliveryAdapter_
-#define _DeliveryAdapter_
-
-#include "DeliveryId.h"
-#include "Message.h"
-#include "qpid/framing/amqp_types.h"
-
-namespace qpid {
-namespace broker {
-
-class DeliveryRecord;
-
-/**
- * The intention behind this interface is to separate the generic
- * handling of some form of message delivery to clients that is
- * contained in the version independent Channel class from the
- * details required for a particular situation or
- * version. i.e. where the existing adapters allow (through
- * supporting the generated interface for a version of the
- * protocol) inputs of a channel to be adapted to the version
- * independent part, this does the same for the outputs.
- */
-class DeliveryAdapter
-{
- public:
- virtual void deliver(DeliveryRecord&) = 0;
- virtual ~DeliveryAdapter(){}
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryId.h b/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryId.h
deleted file mode 100644
index 05b19f032e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryId.h
+++ /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.
- *
- */
-#ifndef _DeliveryId_
-#define _DeliveryId_
-
-#include "qpid/framing/SequenceNumber.h"
-#include "qpid/framing/SequenceNumberSet.h"
-
-namespace qpid {
-namespace broker {
-
- typedef framing::SequenceNumber DeliveryId;
- typedef framing::SequenceNumberSet DeliveryIds;
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
deleted file mode 100644
index b0c060aea5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
+++ /dev/null
@@ -1,214 +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 "DeliveryRecord.h"
-#include "DeliverableMessage.h"
-#include "SemanticState.h"
-#include "Exchange.h"
-#include "qpid/log/Statement.h"
-#include "qpid/framing/FrameHandler.h"
-#include "qpid/framing/MessageTransferBody.h"
-
-using namespace qpid;
-using namespace qpid::broker;
-using std::string;
-
-DeliveryRecord::DeliveryRecord(const QueuedMessage& _msg,
- const Queue::shared_ptr& _queue,
- const std::string& _tag,
- bool _acquired,
- bool accepted,
- bool _windowing,
- uint32_t _credit) : msg(_msg),
- queue(_queue),
- tag(_tag),
- acquired(_acquired),
- acceptExpected(!accepted),
- cancelled(false),
- completed(false),
- ended(accepted),
- windowing(_windowing),
- credit(msg.payload ? msg.payload->getRequiredCredit() : _credit)
-{}
-
-void DeliveryRecord::setEnded()
-{
- ended = true;
- //reset msg pointer, don't need to hold on to it anymore
- msg.payload = boost::intrusive_ptr<Message>();
-
- QPID_LOG(debug, "DeliveryRecord::setEnded() id=" << id);
-}
-
-bool DeliveryRecord::matches(DeliveryId tag) const{
- return id == tag;
-}
-
-bool DeliveryRecord::matchOrAfter(DeliveryId tag) const{
- return matches(tag) || after(tag);
-}
-
-bool DeliveryRecord::after(DeliveryId tag) const{
- return id > tag;
-}
-
-bool DeliveryRecord::coveredBy(const framing::SequenceSet* const range) const{
- return range->contains(id);
-}
-
-void DeliveryRecord::redeliver(SemanticState* const session) {
- if (!ended) {
- if(cancelled){
- //if subscription was cancelled, requeue it (waiting for
- //final confirmation for AMQP WG on this case)
- requeue();
- }else{
- msg.payload->redeliver();//mark as redelivered
- session->deliver(*this);
- }
- }
-}
-
-void DeliveryRecord::deliver(framing::FrameHandler& h, DeliveryId deliveryId, uint16_t framesize)
-{
- id = deliveryId;
- if (msg.payload->getRedelivered()){
- msg.payload->getProperties<framing::DeliveryProperties>()->setRedelivered(true);
- }
-
- framing::AMQFrame method(framing::in_place<framing::MessageTransferBody>(framing::ProtocolVersion(), tag, acceptExpected ? 0 : 1, acquired ? 0 : 1));
- method.setEof(false);
- h.handle(method);
- msg.payload->sendHeader(h, framesize);
- msg.payload->sendContent(*queue, h, framesize);
-}
-
-void DeliveryRecord::requeue() const
-{
- if (acquired && !ended) {
- msg.payload->redeliver();
- queue->requeue(msg);
- }
-}
-
-void DeliveryRecord::release(bool setRedelivered)
-{
- if (acquired && !ended) {
- if (setRedelivered) msg.payload->redeliver();
- queue->requeue(msg);
- acquired = false;
- setEnded();
- } else {
- QPID_LOG(debug, "Ignoring release for " << id << " acquired=" << acquired << ", ended =" << ended);
- }
-}
-
-void DeliveryRecord::complete()
-{
- completed = true;
-}
-
-void DeliveryRecord::accept(TransactionContext* ctxt) {
- if (acquired && !ended) {
- queue->dequeue(ctxt, msg);
- setEnded();
- QPID_LOG(debug, "Accepted " << id);
- }
-}
-
-void DeliveryRecord::dequeue(TransactionContext* ctxt) const{
- if (acquired && !ended) {
- queue->dequeue(ctxt, msg);
- }
-}
-
-void DeliveryRecord::committed() const{
- queue->dequeueCommitted(msg);
-}
-
-void DeliveryRecord::reject()
-{
- Exchange::shared_ptr alternate = queue->getAlternateExchange();
- if (alternate) {
- DeliverableMessage delivery(msg.payload);
- alternate->route(delivery, msg.payload->getRoutingKey(), msg.payload->getApplicationHeaders());
- QPID_LOG(info, "Routed rejected message from " << queue->getName() << " to "
- << alternate->getName());
- } else {
- //just drop it
- QPID_LOG(info, "Dropping rejected message from " << queue->getName());
- }
-}
-
-uint32_t DeliveryRecord::getCredit() const
-{
- return credit;
-}
-
-void DeliveryRecord::acquire(DeliveryIds& results) {
- if (queue->acquire(msg)) {
- acquired = true;
- results.push_back(id);
- } else {
- QPID_LOG(info, "Message already acquired " << id.getValue());
- }
-}
-
-void DeliveryRecord::cancel(const std::string& cancelledTag)
-{
- if (tag == cancelledTag)
- cancelled = true;
-}
-
-AckRange DeliveryRecord::findRange(DeliveryRecords& records, DeliveryId first, DeliveryId last)
-{
- ack_iterator start = find_if(records.begin(), records.end(), boost::bind(&DeliveryRecord::matchOrAfter, _1, first));
- ack_iterator end = start;
-
- if (start != records.end()) {
- if (first == last) {
- //just acked single element (move end past it)
- ++end;
- } else {
- //need to find end (position it just after the last record in range)
- end = find_if(start, records.end(), boost::bind(&DeliveryRecord::after, _1, last));
- }
- }
- return AckRange(start, end);
-}
-
-
-namespace qpid {
-namespace broker {
-
-std::ostream& operator<<(std::ostream& out, const DeliveryRecord& r)
-{
- out << "{" << "id=" << r.id.getValue();
- out << ", tag=" << r.tag << "}";
- out << ", queue=" << r.queue->getName() << "}";
- return out;
-}
-
-bool operator<(const DeliveryRecord& a, const DeliveryRecord& b)
-{
- return a.id < b.id;
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryRecord.h b/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryRecord.h
deleted file mode 100644
index d7ccab0726..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DeliveryRecord.h
+++ /dev/null
@@ -1,141 +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.
- *
- */
-#ifndef _DeliveryRecord_
-#define _DeliveryRecord_
-
-#include <algorithm>
-#include <list>
-#include <vector>
-#include <ostream>
-#include "qpid/framing/SequenceSet.h"
-#include "Queue.h"
-#include "QueuedMessage.h"
-#include "DeliveryId.h"
-#include "Message.h"
-
-namespace qpid {
-namespace broker {
-class SemanticState;
-class DeliveryRecord;
-
-typedef std::list<DeliveryRecord> DeliveryRecords;
-typedef std::list<DeliveryRecord>::iterator ack_iterator;
-
-struct AckRange
-{
- ack_iterator start;
- ack_iterator end;
- AckRange(ack_iterator _start, ack_iterator _end) : start(_start), end(_end) {}
-};
-
-
-/**
- * Record of a delivery for which an ack is outstanding.
- */
-class DeliveryRecord
-{
- QueuedMessage msg;
- mutable Queue::shared_ptr queue;
- const std::string tag;
- DeliveryId id;
- bool acquired;
- bool acceptExpected;
- bool cancelled;
-
- bool completed;
- bool ended;
- const bool windowing;
-
- /**
- * Record required credit on construction as the pointer to the
- * message may be reset once we no longer need to deliver it
- * (e.g. when it is accepted), but we will still need to be able
- * to reallocate credit when it is completed (which could happen
- * after that).
- */
- const uint32_t credit;
-
- public:
- DeliveryRecord(
- const QueuedMessage& msg,
- const Queue::shared_ptr& queue,
- const std::string& tag,
- bool acquired,
- bool accepted,
- bool windowing,
- uint32_t credit=0 // Only used if msg is empty.
- );
-
- bool matches(DeliveryId tag) const;
- bool matchOrAfter(DeliveryId tag) const;
- bool after(DeliveryId tag) const;
- bool coveredBy(const framing::SequenceSet* const range) const;
-
- void dequeue(TransactionContext* ctxt = 0) const;
- void requeue() const;
- void release(bool setRedelivered);
- void reject();
- void cancel(const std::string& tag);
- void redeliver(SemanticState* const);
- void acquire(DeliveryIds& results);
- void complete();
- void accept(TransactionContext* ctxt);
- void setEnded();
- void committed() const;
-
- bool isAcquired() const { return acquired; }
- bool isComplete() const { return completed; }
- bool isRedundant() const { return ended && (!windowing || completed); }
- bool isCancelled() const { return cancelled; }
- bool isAccepted() const { return !acceptExpected; }
- bool isEnded() const { return ended; }
- bool isWindowing() const { return windowing; }
-
- uint32_t getCredit() const;
- const std::string& getTag() const { return tag; }
-
- void deliver(framing::FrameHandler& h, DeliveryId deliveryId, uint16_t framesize);
- void setId(DeliveryId _id) { id = _id; }
-
- static AckRange findRange(DeliveryRecords& records, DeliveryId first, DeliveryId last);
- const QueuedMessage& getMessage() const { return msg; }
- framing::SequenceNumber getId() const { return id; }
- Queue::shared_ptr getQueue() const { return queue; }
- friend bool operator<(const DeliveryRecord&, const DeliveryRecord&);
- friend std::ostream& operator<<(std::ostream&, const DeliveryRecord&);
-};
-
-struct AcquireFunctor
-{
- DeliveryIds& results;
-
- AcquireFunctor(DeliveryIds& _results) : results(_results) {}
-
- void operator()(DeliveryRecord& record)
- {
- record.acquire(results);
- }
-};
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DirectExchange.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/DirectExchange.cpp
deleted file mode 100644
index 2eb488de67..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DirectExchange.cpp
+++ /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.
- *
- */
-#include "qpid/log/Statement.h"
-#include "DirectExchange.h"
-#include <iostream>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-using qpid::management::Manageable;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-namespace
-{
-const std::string qpidFedOp("qpid.fed.op");
-const std::string qpidFedTags("qpid.fed.tags");
-const std::string qpidFedOrigin("qpid.fed.origin");
-
-const std::string fedOpBind("B");
-const std::string fedOpUnbind("U");
-const std::string fedOpReorigin("R");
-const std::string fedOpHello("H");
-}
-
-DirectExchange::DirectExchange(const string& _name, Manageable* _parent) : Exchange(_name, _parent)
-{
- if (mgmtExchange != 0)
- mgmtExchange->set_type(typeName);
-}
-
-DirectExchange::DirectExchange(const string& _name, bool _durable,
- const FieldTable& _args, Manageable* _parent) :
- Exchange(_name, _durable, _args, _parent)
-{
- if (mgmtExchange != 0)
- mgmtExchange->set_type(typeName);
-}
-
-bool DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* args)
-{
- string fedOp(args ? args->getAsString(qpidFedOp) : fedOpBind);
- string fedTags(args ? args->getAsString(qpidFedTags) : "");
- string fedOrigin(args ? args->getAsString(qpidFedOrigin) : "");
- bool propagate = false;
-
- if (args == 0 || fedOp.empty() || fedOp == fedOpBind) {
- Mutex::ScopedLock l(lock);
- Binding::shared_ptr b(new Binding(routingKey, queue, this, FieldTable(), fedOrigin));
- BoundKey& bk = bindings[routingKey];
- if (bk.queues.add_unless(b, MatchQueue(queue))) {
- propagate = bk.fedBinding.addOrigin(fedOrigin);
- if (mgmtExchange != 0) {
- mgmtExchange->inc_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->inc_bindingCount();
- }
- } else {
- return false;
- }
- } else if (fedOp == fedOpUnbind) {
- Mutex::ScopedLock l(lock);
- BoundKey& bk = bindings[routingKey];
- propagate = bk.fedBinding.delOrigin(fedOrigin);
- if (bk.fedBinding.count() == 0)
- unbind(queue, routingKey, 0);
- } else if (fedOp == fedOpReorigin) {
- for (std::map<string, BoundKey>::iterator iter = bindings.begin();
- iter != bindings.end(); iter++) {
- const BoundKey& bk = iter->second;
- if (bk.fedBinding.hasLocal()) {
- propagateFedOp(iter->first, string(), fedOpBind, string());
- }
- }
- }
-
- routeIVE();
- if (propagate)
- propagateFedOp(routingKey, fedTags, fedOp, fedOrigin);
- return true;
-}
-
-bool DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* /*args*/)
-{
- bool propagate = false;
-
- {
- Mutex::ScopedLock l(lock);
- BoundKey& bk = bindings[routingKey];
- if (bk.queues.remove_if(MatchQueue(queue))) {
- propagate = bk.fedBinding.delOrigin();
- if (mgmtExchange != 0) {
- mgmtExchange->dec_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->dec_bindingCount();
- }
- } else {
- return false;
- }
- }
-
- if (propagate)
- propagateFedOp(routingKey, string(), fedOpUnbind, string());
- return true;
-}
-
-void DirectExchange::route(Deliverable& msg, const string& routingKey, const FieldTable* /*args*/)
-{
- PreRoute pr(msg, this);
- Queues::ConstPtr p;
- {
- Mutex::ScopedLock l(lock);
- p = bindings[routingKey].queues.snapshot();
- }
- int count(0);
-
- if (p) {
- for(std::vector<Binding::shared_ptr>::const_iterator i = p->begin(); i != p->end(); i++, count++) {
- msg.deliverTo((*i)->queue);
- if ((*i)->mgmtBinding != 0)
- (*i)->mgmtBinding->inc_msgMatched();
- }
- }
-
- if(!count){
- QPID_LOG(info, "DirectExchange " << getName() << " could not route message with key " << routingKey
- << "; no matching binding found");
- if (mgmtExchange != 0) {
- mgmtExchange->inc_msgDrops();
- mgmtExchange->inc_byteDrops(msg.contentSize());
- }
- } else {
- if (mgmtExchange != 0) {
- mgmtExchange->inc_msgRoutes(count);
- mgmtExchange->inc_byteRoutes(count * msg.contentSize());
- }
- }
-
- if (mgmtExchange != 0) {
- mgmtExchange->inc_msgReceives();
- mgmtExchange->inc_byteReceives(msg.contentSize());
- }
-}
-
-
-bool DirectExchange::isBound(Queue::shared_ptr queue, const string* const routingKey, const FieldTable* const)
-{
- Mutex::ScopedLock l(lock);
- if (routingKey) {
- Bindings::iterator i = bindings.find(*routingKey);
-
- if (i == bindings.end())
- return false;
- if (!queue)
- return true;
-
- Queues::ConstPtr p = i->second.queues.snapshot();
- return p && std::find_if(p->begin(), p->end(), MatchQueue(queue)) != p->end();
- } else if (!queue) {
- //if no queue or routing key is specified, just report whether any bindings exist
- return bindings.size() > 0;
- } else {
- for (Bindings::iterator i = bindings.begin(); i != bindings.end(); i++) {
- Queues::ConstPtr p = i->second.queues.snapshot();
- if (p && std::find_if(p->begin(), p->end(), MatchQueue(queue)) != p->end()) return true;
- }
- return false;
- }
-
- return false;
-}
-
-DirectExchange::~DirectExchange() {}
-
-const std::string DirectExchange::typeName("direct");
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DirectExchange.h b/M4-RCs/qpid/cpp/src/qpid/broker/DirectExchange.h
deleted file mode 100644
index ba60469df8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DirectExchange.h
+++ /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.
- *
- */
-#ifndef _DirectExchange_
-#define _DirectExchange_
-
-#include <map>
-#include <vector>
-#include "Exchange.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/sys/CopyOnWriteArray.h"
-#include "qpid/sys/Mutex.h"
-#include "Queue.h"
-
-namespace qpid {
-namespace broker {
-class DirectExchange : public virtual Exchange {
- typedef qpid::sys::CopyOnWriteArray<Binding::shared_ptr> Queues;
- struct BoundKey {
- Queues queues;
- FedBinding fedBinding;
- };
- typedef std::map<string, BoundKey> Bindings;
- Bindings bindings;
- qpid::sys::Mutex lock;
-
-public:
- static const std::string typeName;
-
- DirectExchange(const std::string& name, management::Manageable* parent = 0);
- DirectExchange(const string& _name, bool _durable,
- const qpid::framing::FieldTable& _args, management::Manageable* parent = 0);
-
- virtual std::string getType() const { return typeName; }
-
- virtual bool bind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args);
- virtual bool unbind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args);
- virtual void route(Deliverable& msg, const std::string& routingKey, const qpid::framing::FieldTable* args);
- virtual bool isBound(Queue::shared_ptr queue, const string* const routingKey, const qpid::framing::FieldTable* const args);
-
- virtual ~DirectExchange();
-
- virtual bool supportsDynamicBinding() { return true; }
-};
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DtxAck.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/DtxAck.cpp
deleted file mode 100644
index bc7d662afb..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DtxAck.cpp
+++ /dev/null
@@ -1,59 +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 "DtxAck.h"
-#include "qpid/log/Statement.h"
-
-using std::bind1st;
-using std::bind2nd;
-using std::mem_fun_ref;
-using namespace qpid::broker;
-
-DtxAck::DtxAck(const qpid::framing::SequenceSet& acked, std::list<DeliveryRecord>& unacked)
-{
- remove_copy_if(unacked.begin(), unacked.end(), inserter(pending, pending.end()),
- not1(bind2nd(mem_fun_ref(&DeliveryRecord::coveredBy), &acked)));
-}
-
-bool DtxAck::prepare(TransactionContext* ctxt) throw()
-{
- try{
- //record dequeue in the store
- for (ack_iterator i = pending.begin(); i != pending.end(); i++) {
- i->dequeue(ctxt);
- }
- return true;
- }catch(...){
- QPID_LOG(error, "Failed to prepare");
- return false;
- }
-}
-
-void DtxAck::commit() throw()
-{
- for_each(pending.begin(), pending.end(), mem_fun_ref(&DeliveryRecord::committed));
- pending.clear();
-}
-
-void DtxAck::rollback() throw()
-{
- for_each(pending.begin(), pending.end(), mem_fun_ref(&DeliveryRecord::requeue));
- pending.clear();
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DtxAck.h b/M4-RCs/qpid/cpp/src/qpid/broker/DtxAck.h
deleted file mode 100644
index d43532906a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DtxAck.h
+++ /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.
- *
- */
-#ifndef _DtxAck_
-#define _DtxAck_
-
-#include <algorithm>
-#include <functional>
-#include <list>
-#include "qpid/framing/SequenceSet.h"
-#include "DeliveryRecord.h"
-#include "TxOp.h"
-
-namespace qpid {
- namespace broker {
- class DtxAck : public TxOp{
- std::list<DeliveryRecord> pending;
-
- public:
- DtxAck(const framing::SequenceSet& acked, std::list<DeliveryRecord>& unacked);
- virtual bool prepare(TransactionContext* ctxt) throw();
- virtual void commit() throw();
- virtual void rollback() throw();
- virtual ~DtxAck(){}
- virtual void accept(TxOpConstVisitor& visitor) const { visitor(*this); }
- };
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DtxBuffer.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/DtxBuffer.cpp
deleted file mode 100644
index 29a07ea6d9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DtxBuffer.cpp
+++ /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.
- *
- */
-#include "DtxBuffer.h"
-
-using namespace qpid::broker;
-using qpid::sys::Mutex;
-
-DtxBuffer::DtxBuffer(const std::string& _xid)
- : xid(_xid), ended(false), suspended(false), failed(false), expired(false) {}
-
-DtxBuffer::~DtxBuffer() {}
-
-void DtxBuffer::markEnded()
-{
- Mutex::ScopedLock locker(lock);
- ended = true;
-}
-
-bool DtxBuffer::isEnded()
-{
- Mutex::ScopedLock locker(lock);
- return ended;
-}
-
-void DtxBuffer::setSuspended(bool isSuspended)
-{
- suspended = isSuspended;
-}
-
-bool DtxBuffer::isSuspended()
-{
- return suspended;
-}
-
-void DtxBuffer::fail()
-{
- Mutex::ScopedLock locker(lock);
- rollback();
- failed = true;
- ended = true;
-}
-
-bool DtxBuffer::isRollbackOnly()
-{
- Mutex::ScopedLock locker(lock);
- return failed;
-}
-
-const std::string& DtxBuffer::getXid()
-{
- return xid;
-}
-
-void DtxBuffer::timedout()
-{
- Mutex::ScopedLock locker(lock);
- expired = true;
- fail();
-}
-
-bool DtxBuffer::isExpired()
-{
- Mutex::ScopedLock locker(lock);
- return expired;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DtxBuffer.h b/M4-RCs/qpid/cpp/src/qpid/broker/DtxBuffer.h
deleted file mode 100644
index b302632037..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DtxBuffer.h
+++ /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.
- *
- */
-#ifndef _DtxBuffer_
-#define _DtxBuffer_
-
-#include "TxBuffer.h"
-#include "qpid/sys/Mutex.h"
-
-namespace qpid {
- namespace broker {
- class DtxBuffer : public TxBuffer{
- sys::Mutex lock;
- const std::string xid;
- bool ended;
- bool suspended;
- bool failed;
- bool expired;
-
- public:
- typedef boost::shared_ptr<DtxBuffer> shared_ptr;
-
- DtxBuffer(const std::string& xid = "");
- ~DtxBuffer();
- void markEnded();
- bool isEnded();
- void setSuspended(bool suspended);
- bool isSuspended();
- void fail();
- bool isRollbackOnly();
- void timedout();
- bool isExpired();
- const std::string& getXid();
- };
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DtxManager.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/DtxManager.cpp
deleted file mode 100644
index f4494fccc6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DtxManager.cpp
+++ /dev/null
@@ -1,171 +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 "DtxManager.h"
-#include "DtxTimeout.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/log/Statement.h"
-#include "qpid/ptr_map.h"
-
-#include <boost/format.hpp>
-#include <iostream>
-
-using boost::intrusive_ptr;
-using qpid::sys::Mutex;
-using qpid::ptr_map_ptr;
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-DtxManager::DtxManager(Timer& t) : store(0), timer(t) {}
-
-DtxManager::~DtxManager() {}
-
-void DtxManager::start(const std::string& xid, DtxBuffer::shared_ptr ops)
-{
- createWork(xid)->add(ops);
-}
-
-void DtxManager::join(const std::string& xid, DtxBuffer::shared_ptr ops)
-{
- getWork(xid)->add(ops);
-}
-
-void DtxManager::recover(const std::string& xid, std::auto_ptr<TPCTransactionContext> txn, DtxBuffer::shared_ptr ops)
-{
- createWork(xid)->recover(txn, ops);
-}
-
-bool DtxManager::prepare(const std::string& xid)
-{
- QPID_LOG(debug, "preparing: " << xid);
- try {
- return getWork(xid)->prepare();
- } catch (DtxTimeoutException& e) {
- remove(xid);
- throw e;
- }
-}
-
-bool DtxManager::commit(const std::string& xid, bool onePhase)
-{
- QPID_LOG(debug, "committing: " << xid);
- try {
- bool result = getWork(xid)->commit(onePhase);
- remove(xid);
- return result;
- } catch (DtxTimeoutException& e) {
- remove(xid);
- throw e;
- }
-}
-
-void DtxManager::rollback(const std::string& xid)
-{
- QPID_LOG(debug, "rolling back: " << xid);
- try {
- getWork(xid)->rollback();
- remove(xid);
- } catch (DtxTimeoutException& e) {
- remove(xid);
- throw e;
- }
-}
-
-DtxWorkRecord* DtxManager::getWork(const std::string& xid)
-{
- Mutex::ScopedLock locker(lock);
- WorkMap::iterator i = work.find(xid);
- if (i == work.end()) {
- throw NotFoundException(QPID_MSG("Unrecognised xid " << xid));
- }
- return ptr_map_ptr(i);
-}
-
-void DtxManager::remove(const std::string& xid)
-{
- Mutex::ScopedLock locker(lock);
- WorkMap::iterator i = work.find(xid);
- if (i == work.end()) {
- throw NotFoundException(QPID_MSG("Unrecognised xid " << xid));
- } else {
- work.erase(i);
- }
-}
-
-DtxWorkRecord* DtxManager::createWork(std::string xid)
-{
- Mutex::ScopedLock locker(lock);
- WorkMap::iterator i = work.find(xid);
- if (i != work.end()) {
- throw NotAllowedException(QPID_MSG("Xid " << xid << " is already known (use 'join' to add work to an existing xid)"));
- } else {
- return ptr_map_ptr(work.insert(xid, new DtxWorkRecord(xid, store)).first);
- }
-}
-
-void DtxManager::setTimeout(const std::string& xid, uint32_t secs)
-{
- DtxWorkRecord* record = getWork(xid);
- intrusive_ptr<DtxTimeout> timeout = record->getTimeout();
- if (timeout.get()) {
- if (timeout->timeout == secs) return;//no need to do anything further if timeout hasn't changed
- timeout->cancelled = true;
- }
- timeout = intrusive_ptr<DtxTimeout>(new DtxTimeout(secs, *this, xid));
- record->setTimeout(timeout);
- timer.add(boost::static_pointer_cast<TimerTask>(timeout));
-
-}
-
-uint32_t DtxManager::getTimeout(const std::string& xid)
-{
- intrusive_ptr<DtxTimeout> timeout = getWork(xid)->getTimeout();
- return !timeout ? 0 : timeout->timeout;
-}
-
-void DtxManager::timedout(const std::string& xid)
-{
- Mutex::ScopedLock locker(lock);
- WorkMap::iterator i = work.find(xid);
- if (i == work.end()) {
- QPID_LOG(warning, "Transaction timeout failed: no record for xid");
- } else {
- ptr_map_ptr(i)->timedout();
- //TODO: do we want to have a timed task to cleanup, or can we rely on an explicit completion?
- //timer.add(intrusive_ptr<TimerTask>(new DtxCleanup(60*30/*30 mins*/, *this, xid)));
- }
-}
-
-DtxManager::DtxCleanup::DtxCleanup(uint32_t _timeout, DtxManager& _mgr, const std::string& _xid)
- : TimerTask(qpid::sys::Duration(_timeout * qpid::sys::TIME_SEC)), mgr(_mgr), xid(_xid) {}
-
-void DtxManager::DtxCleanup::fire()
-{
- try {
- mgr.remove(xid);
- } catch (ConnectionException& /*e*/) {
- //assume it was explicitly cleaned up after a call to prepare, commit or rollback
- }
-}
-
-void DtxManager::setStore (TransactionalStore* _store)
-{
- store = _store;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DtxManager.h b/M4-RCs/qpid/cpp/src/qpid/broker/DtxManager.h
deleted file mode 100644
index a61e8610f0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DtxManager.h
+++ /dev/null
@@ -1,74 +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.
- *
- */
-#ifndef _DtxManager_
-#define _DtxManager_
-
-#include <boost/ptr_container/ptr_map.hpp>
-#include "DtxBuffer.h"
-#include "DtxWorkRecord.h"
-#include "Timer.h"
-#include "TransactionalStore.h"
-#include "qpid/framing/amqp_types.h"
-#include "qpid/sys/Mutex.h"
-
-namespace qpid {
-namespace broker {
-
-class DtxManager{
- typedef boost::ptr_map<std::string, DtxWorkRecord> WorkMap;
-
- struct DtxCleanup : public TimerTask
- {
- DtxManager& mgr;
- const std::string& xid;
-
- DtxCleanup(uint32_t timeout, DtxManager& mgr, const std::string& xid);
- void fire();
- };
-
- WorkMap work;
- TransactionalStore* store;
- qpid::sys::Mutex lock;
- Timer& timer;
-
- void remove(const std::string& xid);
- DtxWorkRecord* getWork(const std::string& xid);
- DtxWorkRecord* createWork(std::string xid);
-
-public:
- DtxManager(Timer&);
- ~DtxManager();
- void start(const std::string& xid, DtxBuffer::shared_ptr work);
- void join(const std::string& xid, DtxBuffer::shared_ptr work);
- void recover(const std::string& xid, std::auto_ptr<TPCTransactionContext> txn, DtxBuffer::shared_ptr work);
- bool prepare(const std::string& xid);
- bool commit(const std::string& xid, bool onePhase);
- void rollback(const std::string& xid);
- void setTimeout(const std::string& xid, uint32_t secs);
- uint32_t getTimeout(const std::string& xid);
- void timedout(const std::string& xid);
- void setStore(TransactionalStore* store);
-};
-
-}
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DtxTimeout.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/DtxTimeout.cpp
deleted file mode 100644
index 8e0a7741c4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DtxTimeout.cpp
+++ /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.
- *
- */
-#include "DtxTimeout.h"
-#include "DtxManager.h"
-#include "qpid/sys/Time.h"
-
-using namespace qpid::broker;
-
-DtxTimeout::DtxTimeout(uint32_t _timeout, DtxManager& _mgr, const std::string& _xid)
- : TimerTask(qpid::sys::Duration(_timeout * qpid::sys::TIME_SEC)), timeout(_timeout), mgr(_mgr), xid(_xid)
-{
-}
-
-void DtxTimeout::fire()
-{
- mgr.timedout(xid);
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DtxTimeout.h b/M4-RCs/qpid/cpp/src/qpid/broker/DtxTimeout.h
deleted file mode 100644
index 6e949eab0d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DtxTimeout.h
+++ /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.
- *
- */
-#ifndef _DtxTimeout_
-#define _DtxTimeout_
-
-#include "qpid/Exception.h"
-#include "Timer.h"
-
-namespace qpid {
-namespace broker {
-
-class DtxManager;
-
-struct DtxTimeoutException : public Exception {};
-
-struct DtxTimeout : public TimerTask
-{
- const uint32_t timeout;
- DtxManager& mgr;
- const std::string xid;
-
- DtxTimeout(uint32_t timeout, DtxManager& mgr, const std::string& xid);
- void fire();
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp
deleted file mode 100644
index cc79813dab..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DtxWorkRecord.cpp
+++ /dev/null
@@ -1,177 +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 "DtxWorkRecord.h"
-#include "qpid/framing/reply_exceptions.h"
-#include <boost/format.hpp>
-#include <boost/mem_fn.hpp>
-using boost::mem_fn;
-using qpid::sys::Mutex;
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-DtxWorkRecord::DtxWorkRecord(const std::string& _xid, TransactionalStore* const _store) :
- xid(_xid), store(_store), completed(false), rolledback(false), prepared(false), expired(false) {}
-
-DtxWorkRecord::~DtxWorkRecord()
-{
- if (timeout.get()) {
- timeout->cancelled = true;
- }
-}
-
-bool DtxWorkRecord::prepare()
-{
- Mutex::ScopedLock locker(lock);
- if (check()) {
- txn = store->begin(xid);
- if (prepare(txn.get())) {
- store->prepare(*txn);
- prepared = true;
- } else {
- abort();
- //TODO: this should probably be flagged as internal error
- }
- } else {
- //some part of the work has been marked rollback only
- abort();
- }
- return prepared;
-}
-
-bool DtxWorkRecord::prepare(TransactionContext* _txn)
-{
- bool succeeded(true);
- for (Work::iterator i = work.begin(); succeeded && i != work.end(); i++) {
- succeeded = (*i)->prepare(_txn);
- }
- return succeeded;
-}
-
-bool DtxWorkRecord::commit(bool onePhase)
-{
- Mutex::ScopedLock locker(lock);
- if (check()) {
- if (prepared) {
- //already prepared i.e. 2pc
- if (onePhase) {
- throw IllegalStateException(QPID_MSG("Branch with xid " << xid << " has been prepared, one-phase option not valid!"));
- }
-
- store->commit(*txn);
- txn.reset();
-
- std::for_each(work.begin(), work.end(), mem_fn(&TxBuffer::commit));
- return true;
- } else {
- //1pc commit optimisation, don't need a 2pc transaction context:
- if (!onePhase) {
- throw IllegalStateException(QPID_MSG("Branch with xid " << xid << " has not been prepared, one-phase option required!"));
- }
- std::auto_ptr<TransactionContext> localtxn = store->begin();
- if (prepare(localtxn.get())) {
- store->commit(*localtxn);
- std::for_each(work.begin(), work.end(), mem_fn(&TxBuffer::commit));
- return true;
- } else {
- store->abort(*localtxn);
- abort();
- //TODO: this should probably be flagged as internal error
- return false;
- }
- }
- } else {
- //some part of the work has been marked rollback only
- abort();
- return false;
- }
-}
-
-void DtxWorkRecord::rollback()
-{
- Mutex::ScopedLock locker(lock);
- check();
- abort();
-}
-
-void DtxWorkRecord::add(DtxBuffer::shared_ptr ops)
-{
- Mutex::ScopedLock locker(lock);
- if (expired) {
- throw DtxTimeoutException();
- }
- if (completed) {
- throw CommandInvalidException(QPID_MSG("Branch with xid " << xid << " has been completed!"));
- }
- work.push_back(ops);
-}
-
-bool DtxWorkRecord::check()
-{
- if (expired) {
- throw DtxTimeoutException();
- }
- if (!completed) {
- //iterate through all DtxBuffers and ensure they are all ended
- for (Work::iterator i = work.begin(); i != work.end(); i++) {
- if (!(*i)->isEnded()) {
- throw IllegalStateException(QPID_MSG("Branch with xid " << xid << " not completed!"));
- } else if ((*i)->isRollbackOnly()) {
- rolledback = true;
- }
- }
- completed = true;
- }
- return !rolledback;
-}
-
-void DtxWorkRecord::abort()
-{
- if (txn.get()) {
- store->abort(*txn);
- txn.reset();
- }
- std::for_each(work.begin(), work.end(), mem_fn(&TxBuffer::rollback));
-}
-
-void DtxWorkRecord::recover(std::auto_ptr<TPCTransactionContext> _txn, DtxBuffer::shared_ptr ops)
-{
- add(ops);
- txn = _txn;
- ops->markEnded();
- completed = true;
- prepared = true;
-}
-
-void DtxWorkRecord::timedout()
-{
- Mutex::ScopedLock locker(lock);
- expired = true;
- rolledback = true;
- if (!completed) {
- for (Work::iterator i = work.begin(); i != work.end(); i++) {
- if (!(*i)->isEnded()) {
- (*i)->timedout();
- }
- }
- }
- abort();
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/DtxWorkRecord.h b/M4-RCs/qpid/cpp/src/qpid/broker/DtxWorkRecord.h
deleted file mode 100644
index 6677784c32..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/DtxWorkRecord.h
+++ /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.
- *
- */
-#ifndef _DtxWorkRecord_
-#define _DtxWorkRecord_
-
-#include "DtxBuffer.h"
-#include "DtxTimeout.h"
-#include "TransactionalStore.h"
-
-#include "qpid/framing/amqp_types.h"
-#include "qpid/sys/Mutex.h"
-
-#include <algorithm>
-#include <functional>
-#include <vector>
-
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-
-/**
- * Represents the work done under a particular distributed transaction
- * across potentially multiple channels. Identified by a xid. Allows
- * that work to be prepared, committed and rolled-back.
- */
-class DtxWorkRecord
-{
- typedef std::vector<DtxBuffer::shared_ptr> Work;
-
- const std::string xid;
- TransactionalStore* const store;
- bool completed;
- bool rolledback;
- bool prepared;
- bool expired;
- boost::intrusive_ptr<DtxTimeout> timeout;
- Work work;
- std::auto_ptr<TPCTransactionContext> txn;
- qpid::sys::Mutex lock;
-
- bool check();
- void abort();
- bool prepare(TransactionContext* txn);
-public:
- DtxWorkRecord(const std::string& xid, TransactionalStore* const store);
- ~DtxWorkRecord();
- bool prepare();
- bool commit(bool onePhase);
- void rollback();
- void add(DtxBuffer::shared_ptr ops);
- void recover(std::auto_ptr<TPCTransactionContext> txn, DtxBuffer::shared_ptr ops);
- void timedout();
- void setTimeout(boost::intrusive_ptr<DtxTimeout> t) { timeout = t; }
- boost::intrusive_ptr<DtxTimeout> getTimeout() { return timeout; }
-};
-
-}
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Exchange.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/Exchange.cpp
deleted file mode 100644
index 34673bdab3..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Exchange.cpp
+++ /dev/null
@@ -1,270 +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 "Exchange.h"
-#include "ExchangeRegistry.h"
-#include "qpid/agent/ManagementAgent.h"
-#include "qpid/log/Statement.h"
-#include "qpid/framing/MessageProperties.h"
-#include "DeliverableMessage.h"
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-using qpid::framing::Buffer;
-using qpid::framing::FieldTable;
-using qpid::sys::Mutex;
-using qpid::management::ManagementAgent;
-using qpid::management::ManagementObject;
-using qpid::management::Manageable;
-using qpid::management::Args;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-namespace
-{
-const std::string qpidMsgSequence("qpid.msg_sequence");
-const std::string qpidSequenceCounter("qpid.sequence_counter");
-const std::string qpidIVE("qpid.ive");
-const std::string qpidFedOp("qpid.fed.op");
-const std::string qpidFedTags("qpid.fed.tags");
-const std::string qpidFedOrigin("qpid.fed.origin");
-
-const std::string fedOpBind("B");
-const std::string fedOpUnbind("U");
-const std::string fedOpReorigin("R");
-const std::string fedOpHello("H");
-}
-
-
-Exchange::PreRoute::PreRoute(Deliverable& msg, Exchange* _p):parent(_p) {
- if (parent){
- if (parent->sequence || parent->ive) parent->sequenceLock.lock();
-
- if (parent->sequence){
- parent->sequenceNo++;
- msg.getMessage().getProperties<MessageProperties>()->getApplicationHeaders().setInt64(qpidMsgSequence,parent->sequenceNo);
- }
- if (parent->ive) {
- parent->lastMsg = &( msg.getMessage());
- }
- }
-}
-
-Exchange::PreRoute::~PreRoute(){
- if (parent && (parent->sequence || parent->ive)){
- parent->sequenceLock.unlock();
- }
-}
-
-void Exchange::routeIVE(){
- if (ive && lastMsg.get()){
- DeliverableMessage dmsg(lastMsg);
- route(dmsg, lastMsg->getRoutingKey(), lastMsg->getApplicationHeaders());
- }
-}
-
-
-Exchange::Exchange (const string& _name, Manageable* parent) :
- name(_name), durable(false), persistenceId(0), sequence(false),
- sequenceNo(0), ive(false), mgmtExchange(0)
-{
- if (parent != 0)
- {
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent != 0)
- {
- mgmtExchange = new _qmf::Exchange (agent, this, parent, _name, durable);
- agent->addObject (mgmtExchange);
- }
- }
-}
-
-Exchange::Exchange(const string& _name, bool _durable, const qpid::framing::FieldTable& _args,
- Manageable* parent)
- : name(_name), durable(_durable), args(_args), alternateUsers(0), persistenceId(0),
- sequence(false), sequenceNo(0), ive(false), mgmtExchange(0)
-{
- if (parent != 0)
- {
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent != 0)
- {
- mgmtExchange = new _qmf::Exchange (agent, this, parent, _name, durable);
- mgmtExchange->set_arguments(args);
- if (!durable) {
- if (name == "")
- agent->addObject (mgmtExchange, 0x1000000000000004LL); // Special default exchange ID
- else if (name == "qpid.management")
- agent->addObject (mgmtExchange, 0x1000000000000005LL); // Special management exchange ID
- else
- agent->addObject (mgmtExchange);
- }
- }
- }
-
- sequence = _args.get(qpidMsgSequence);
- if (sequence) {
- QPID_LOG(debug, "Configured exchange "+ _name +" with Msg sequencing");
- args.setInt64(std::string(qpidSequenceCounter), sequenceNo);
- }
-
- ive = _args.get(qpidIVE);
- if (ive) QPID_LOG(debug, "Configured exchange "+ _name +" with Initial Value");
-}
-
-Exchange::~Exchange ()
-{
- if (mgmtExchange != 0)
- mgmtExchange->resourceDestroy ();
-}
-
-void Exchange::setPersistenceId(uint64_t id) const
-{
- if (mgmtExchange != 0 && persistenceId == 0)
- {
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- agent->addObject (mgmtExchange, 0x2000000000000000LL + id);
- }
- persistenceId = id;
-}
-
-Exchange::shared_ptr Exchange::decode(ExchangeRegistry& exchanges, Buffer& buffer)
-{
- string name;
- string type;
- FieldTable args;
-
- buffer.getShortString(name);
- bool durable(buffer.getOctet());
- buffer.getShortString(type);
- buffer.get(args);
-
- Exchange::shared_ptr exch = exchanges.declare(name, type, durable, args).first;
- exch->sequenceNo = args.getAsInt64(qpidSequenceCounter);
- return exch;
-}
-
-void Exchange::encode(Buffer& buffer) const
-{
- buffer.putShortString(name);
- buffer.putOctet(durable);
- buffer.putShortString(getType());
- if (args.isSet(qpidSequenceCounter))
- args.setInt64(std::string(qpidSequenceCounter),sequenceNo);
- buffer.put(args);
-}
-
-uint32_t Exchange::encodedSize() const
-{
- return name.size() + 1/*short string size*/
- + 1 /*durable*/
- + getType().size() + 1/*short string size*/
- + args.encodedSize();
-}
-
-ManagementObject* Exchange::GetManagementObject (void) const
-{
- return (ManagementObject*) mgmtExchange;
-}
-
-void Exchange::registerDynamicBridge(DynamicBridge* db)
-{
- if (!supportsDynamicBinding())
- throw Exception("Exchange type does not support dynamic binding");
-
- {
- Mutex::ScopedLock l(bridgeLock);
- for (std::vector<DynamicBridge*>::iterator iter = bridgeVector.begin();
- iter != bridgeVector.end(); iter++)
- (*iter)->sendReorigin();
-
- bridgeVector.push_back(db);
- }
-
- FieldTable args;
- args.setString(qpidFedOp, fedOpReorigin);
- bind(Queue::shared_ptr(), string(), &args);
-}
-
-void Exchange::removeDynamicBridge(DynamicBridge* db)
-{
- Mutex::ScopedLock l(bridgeLock);
- for (std::vector<DynamicBridge*>::iterator iter = bridgeVector.begin();
- iter != bridgeVector.end(); iter++)
- if (*iter == db) {
- bridgeVector.erase(iter);
- break;
- }
-}
-
-void Exchange::handleHelloRequest()
-{
-}
-
-void Exchange::propagateFedOp(const string& routingKey, const string& tags, const string& op, const string& origin)
-{
- Mutex::ScopedLock l(bridgeLock);
- string myOp(op.empty() ? fedOpBind : op);
-
- for (std::vector<DynamicBridge*>::iterator iter = bridgeVector.begin();
- iter != bridgeVector.end(); iter++)
- (*iter)->propagateBinding(routingKey, tags, op, origin);
-}
-
-Exchange::Binding::Binding(const string& _key, Queue::shared_ptr _queue, Exchange* parent,
- FieldTable _args, const string& origin)
- : queue(_queue), key(_key), args(_args), mgmtBinding(0)
-{
- if (parent != 0)
- {
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent != 0)
- {
- ManagementObject* mo = queue->GetManagementObject();
- if (mo != 0)
- {
- management::ObjectId queueId = mo->getObjectId();
- mgmtBinding = new _qmf::Binding
- (agent, this, (Manageable*) parent, queueId, key, args);
- if (!origin.empty())
- mgmtBinding->set_origin(origin);
- agent->addObject (mgmtBinding);
- }
- }
- }
-}
-
-Exchange::Binding::~Binding ()
-{
- if (mgmtBinding != 0)
- mgmtBinding->resourceDestroy ();
-}
-
-ManagementObject* Exchange::Binding::GetManagementObject () const
-{
- return (ManagementObject*) mgmtBinding;
-}
-
-Exchange::MatchQueue::MatchQueue(Queue::shared_ptr q) : queue(q) {}
-
-bool Exchange::MatchQueue::operator()(Exchange::Binding::shared_ptr b)
-{
- return b->queue == queue;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Exchange.h b/M4-RCs/qpid/cpp/src/qpid/broker/Exchange.h
deleted file mode 100644
index 5de3e98bc0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Exchange.h
+++ /dev/null
@@ -1,178 +0,0 @@
-#ifndef _broker_Exchange_h
-#define _broker_Exchange_h
-
-/*
- *
- * 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 <boost/shared_ptr.hpp>
-#include "Deliverable.h"
-#include "Queue.h"
-#include "MessageStore.h"
-#include "PersistableExchange.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/management/Manageable.h"
-#include "qmf/org/apache/qpid/broker/Exchange.h"
-#include "qmf/org/apache/qpid/broker/Binding.h"
-
-namespace qpid {
-namespace broker {
-
-class ExchangeRegistry;
-
-class Exchange : public PersistableExchange, public management::Manageable {
-private:
- const std::string name;
- const bool durable;
- mutable qpid::framing::FieldTable args;
- boost::shared_ptr<Exchange> alternate;
- uint32_t alternateUsers;
- mutable uint64_t persistenceId;
-
-protected:
- bool sequence;
- mutable qpid::sys::Mutex sequenceLock;
- int64_t sequenceNo;
- bool ive;
- boost::intrusive_ptr<Message> lastMsg;
-
- class PreRoute{
- public:
- PreRoute(Deliverable& msg, Exchange* _p);
- ~PreRoute();
- private:
- Exchange* parent;
- };
-
- void routeIVE();
-
- struct Binding : public management::Manageable {
- typedef boost::shared_ptr<Binding> shared_ptr;
- typedef std::vector<Binding::shared_ptr> vector;
-
- Queue::shared_ptr queue;
- const std::string key;
- const framing::FieldTable args;
- qmf::org::apache::qpid::broker::Binding* mgmtBinding;
-
- Binding(const std::string& key, Queue::shared_ptr queue, Exchange* parent = 0,
- framing::FieldTable args = framing::FieldTable(), const std::string& origin = std::string());
- ~Binding();
- management::ManagementObject* GetManagementObject() const;
- };
-
- struct MatchQueue {
- const Queue::shared_ptr queue;
- MatchQueue(Queue::shared_ptr q);
- bool operator()(Exchange::Binding::shared_ptr b);
- };
-
- class FedBinding {
- uint32_t localBindings;
- std::set<std::string> originSet;
- public:
- FedBinding() : localBindings(0) {}
- bool hasLocal() const { return localBindings != 0; }
- bool addOrigin(const std::string& origin) {
- if (origin.empty()) {
- localBindings++;
- return localBindings == 1;
- }
- originSet.insert(origin);
- return true;
- }
- bool delOrigin(const std::string& origin) {
- originSet.erase(origin);
- return true;
- }
- bool delOrigin() {
- if (localBindings > 0)
- localBindings--;
- return localBindings == 0;
- }
- uint32_t count() {
- return localBindings + originSet.size();
- }
- };
-
- qmf::org::apache::qpid::broker::Exchange* mgmtExchange;
-
-public:
- typedef boost::shared_ptr<Exchange> shared_ptr;
-
- explicit Exchange(const std::string& name, management::Manageable* parent = 0);
- Exchange(const std::string& _name, bool _durable, const qpid::framing::FieldTable& _args,
- management::Manageable* parent = 0);
- virtual ~Exchange();
-
- const std::string& getName() const { return name; }
- bool isDurable() { return durable; }
- qpid::framing::FieldTable& getArgs() { return args; }
-
- Exchange::shared_ptr getAlternate() { return alternate; }
- void setAlternate(Exchange::shared_ptr _alternate) { alternate = _alternate; }
- void incAlternateUsers() { alternateUsers++; }
- void decAlternateUsers() { alternateUsers--; }
- bool inUseAsAlternate() { return alternateUsers > 0; }
-
- virtual std::string getType() const = 0;
- virtual bool bind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args) = 0;
- virtual bool unbind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args) = 0;
- virtual bool isBound(Queue::shared_ptr queue, const std::string* const routingKey, const qpid::framing::FieldTable* const args) = 0;
- virtual void route(Deliverable& msg, const std::string& routingKey, const qpid::framing::FieldTable* args) = 0;
-
- //PersistableExchange:
- void setPersistenceId(uint64_t id) const;
- uint64_t getPersistenceId() const { return persistenceId; }
- uint32_t encodedSize() const;
- void encode(framing::Buffer& buffer) const;
-
- static Exchange::shared_ptr decode(ExchangeRegistry& exchanges, framing::Buffer& buffer);
-
- // Manageable entry points
- management::ManagementObject* GetManagementObject(void) const;
-
- // Federation hooks
- class DynamicBridge {
- public:
- virtual ~DynamicBridge() {}
- virtual void propagateBinding(const std::string& key, const std::string& tagList, const std::string& op, const std::string& origin) = 0;
- virtual void sendReorigin() = 0;
- virtual bool containsLocalTag(const std::string& tagList) const = 0;
- virtual const std::string& getLocalTag() const = 0;
- };
-
- void registerDynamicBridge(DynamicBridge* db);
- void removeDynamicBridge(DynamicBridge* db);
- virtual bool supportsDynamicBinding() { return false; }
-
-protected:
- qpid::sys::Mutex bridgeLock;
- std::vector<DynamicBridge*> bridgeVector;
-
- virtual void handleHelloRequest();
- void propagateFedOp(const std::string& routingKey, const std::string& tags,
- const std::string& op, const std::string& origin);
-};
-
-}}
-
-#endif /*!_broker_Exchange.cpp_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp
deleted file mode 100644
index 01f8bbfee6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/ExchangeRegistry.cpp
+++ /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.
- *
- */
-
-#include "ExchangeRegistry.h"
-#include "DirectExchange.h"
-#include "FanOutExchange.h"
-#include "HeadersExchange.h"
-#include "TopicExchange.h"
-#include "qpid/management/ManagementExchange.h"
-#include "qpid/framing/reply_exceptions.h"
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-using std::pair;
-using qpid::framing::FieldTable;
-
-pair<Exchange::shared_ptr, bool> ExchangeRegistry::declare(const string& name, const string& type)
- throw(UnknownExchangeTypeException){
-
- return declare(name, type, false, FieldTable());
-}
-
-pair<Exchange::shared_ptr, bool> ExchangeRegistry::declare(const string& name, const string& type,
- bool durable, const FieldTable& args)
- throw(UnknownExchangeTypeException){
- RWlock::ScopedWlock locker(lock);
- ExchangeMap::iterator i = exchanges.find(name);
- if (i == exchanges.end()) {
- Exchange::shared_ptr exchange;
-
- if(type == TopicExchange::typeName){
- exchange = Exchange::shared_ptr(new TopicExchange(name, durable, args, parent));
- }else if(type == DirectExchange::typeName){
- exchange = Exchange::shared_ptr(new DirectExchange(name, durable, args, parent));
- }else if(type == FanOutExchange::typeName){
- exchange = Exchange::shared_ptr(new FanOutExchange(name, durable, args, parent));
- }else if (type == HeadersExchange::typeName) {
- exchange = Exchange::shared_ptr(new HeadersExchange(name, durable, args, parent));
- }else if (type == ManagementExchange::typeName) {
- exchange = Exchange::shared_ptr(new ManagementExchange(name, durable, args, parent));
- }
- else{
- FunctionMap::iterator i = factory.find(type);
- if (i == factory.end()) {
- throw UnknownExchangeTypeException();
- } else {
- exchange = i->second(name, durable, args, parent);
- }
- }
- exchanges[name] = exchange;
- return std::pair<Exchange::shared_ptr, bool>(exchange, true);
- } else {
- return std::pair<Exchange::shared_ptr, bool>(i->second, false);
- }
-}
-
-void ExchangeRegistry::destroy(const string& name){
- RWlock::ScopedWlock locker(lock);
- ExchangeMap::iterator i = exchanges.find(name);
- if (i != exchanges.end()) {
- exchanges.erase(i);
- }
-}
-
-Exchange::shared_ptr ExchangeRegistry::get(const string& name){
- RWlock::ScopedRlock locker(lock);
- ExchangeMap::iterator i = exchanges.find(name);
- if (i == exchanges.end())
- throw framing::NotFoundException(QPID_MSG("Exchange not found: " << name));
- return i->second;
-}
-
-bool ExchangeRegistry::registerExchange(const Exchange::shared_ptr& ex) {
- return exchanges.insert(ExchangeMap::value_type(ex->getName(), ex)).second;
-}
-
-void ExchangeRegistry::registerType(const std::string& type, FactoryFunction f)
-{
- factory[type] = f;
-}
-
-
-namespace
-{
-const std::string empty;
-}
-
-Exchange::shared_ptr ExchangeRegistry::getDefault()
-{
- return get(empty);
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/ExchangeRegistry.h b/M4-RCs/qpid/cpp/src/qpid/broker/ExchangeRegistry.h
deleted file mode 100644
index 787b7896f0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/ExchangeRegistry.h
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef _broker_ExchangeRegistry_h
-#define _broker_ExchangeRegistry_h
-
-/*
- *
- * 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 "Exchange.h"
-#include "MessageStore.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/sys/Monitor.h"
-#include "qpid/management/Manageable.h"
-
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
-
-#include <algorithm>
-#include <map>
-
-namespace qpid {
-namespace broker {
-
-struct UnknownExchangeTypeException{};
-
-class ExchangeRegistry{
- public:
- typedef boost::function4<Exchange::shared_ptr, const std::string&,
- bool, const qpid::framing::FieldTable&, qpid::management::Manageable*> FactoryFunction;
-
- ExchangeRegistry () : parent(0) {}
- std::pair<Exchange::shared_ptr, bool> declare(const std::string& name, const std::string& type)
- throw(UnknownExchangeTypeException);
- std::pair<Exchange::shared_ptr, bool> declare(const std::string& name, const std::string& type,
- bool durable, const qpid::framing::FieldTable& args = framing::FieldTable())
- throw(UnknownExchangeTypeException);
- void destroy(const std::string& name);
- Exchange::shared_ptr get(const std::string& name);
- Exchange::shared_ptr getDefault();
-
- /**
- * Register the manageable parent for declared exchanges
- */
- void setParent (management::Manageable* _parent) { parent = _parent; }
-
- /** Register an exchange instance.
- *@return true if registered, false if exchange with same name is already registered.
- */
- bool registerExchange(const Exchange::shared_ptr&);
-
- void registerType(const std::string& type, FactoryFunction);
-
- /** Call f for each exchange in the registry. */
- template <class F> void eachExchange(F f) const {
- qpid::sys::RWlock::ScopedWlock l(lock);
- for (ExchangeMap::const_iterator i = exchanges.begin(); i != exchanges.end(); ++i)
- f(i->second);
- }
-
- private:
- typedef std::map<std::string, Exchange::shared_ptr> ExchangeMap;
- typedef std::map<std::string, FactoryFunction > FunctionMap;
-
- ExchangeMap exchanges;
- FunctionMap factory;
- mutable qpid::sys::RWlock lock;
- management::Manageable* parent;
-
-};
-
-}} // namespace qpid::broker
-
-
-#endif /*!_broker_ExchangeRegistry_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/FanOutExchange.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/FanOutExchange.cpp
deleted file mode 100644
index aa1f7ff30a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/FanOutExchange.cpp
+++ /dev/null
@@ -1,148 +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 "FanOutExchange.h"
-#include <algorithm>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-namespace
-{
-const std::string qpidFedOp("qpid.fed.op");
-const std::string qpidFedTags("qpid.fed.tags");
-const std::string qpidFedOrigin("qpid.fed.origin");
-
-const std::string fedOpBind("B");
-const std::string fedOpUnbind("U");
-const std::string fedOpReorigin("R");
-const std::string fedOpHello("H");
-}
-
-FanOutExchange::FanOutExchange(const std::string& _name, Manageable* _parent) :
- Exchange(_name, _parent)
-{
- if (mgmtExchange != 0)
- mgmtExchange->set_type (typeName);
-}
-
-FanOutExchange::FanOutExchange(const std::string& _name, bool _durable,
- const FieldTable& _args, Manageable* _parent) :
- Exchange(_name, _durable, _args, _parent)
-{
- if (mgmtExchange != 0)
- mgmtExchange->set_type (typeName);
-}
-
-bool FanOutExchange::bind(Queue::shared_ptr queue, const string& /*key*/, const FieldTable* args)
-{
- string fedOp(args ? args->getAsString(qpidFedOp) : fedOpBind);
- string fedTags(args ? args->getAsString(qpidFedTags) : "");
- string fedOrigin(args ? args->getAsString(qpidFedOrigin) : "");
- bool propagate = false;
-
- if (args == 0 || fedOp.empty() || fedOp == fedOpBind) {
- Binding::shared_ptr binding (new Binding ("", queue, this, FieldTable(), fedOrigin));
- if (bindings.add_unless(binding, MatchQueue(queue))) {
- propagate = fedBinding.addOrigin(fedOrigin);
- if (mgmtExchange != 0) {
- mgmtExchange->inc_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->inc_bindingCount();
- }
- } else {
- return false;
- }
- } else if (fedOp == fedOpUnbind) {
- propagate = fedBinding.delOrigin(fedOrigin);
- if (fedBinding.count() == 0)
- unbind(queue, "", 0);
- } else if (fedOp == fedOpReorigin) {
- if (fedBinding.hasLocal()) {
- propagateFedOp(string(), string(), fedOpBind, string());
- }
- }
-
- routeIVE();
- if (propagate)
- propagateFedOp(string(), fedTags, fedOp, fedOrigin);
- return true;
-}
-
-bool FanOutExchange::unbind(Queue::shared_ptr queue, const string& /*key*/, const FieldTable* /*args*/)
-{
- bool propagate = false;
-
- if (bindings.remove_if(MatchQueue(queue))) {
- propagate = fedBinding.delOrigin();
- if (mgmtExchange != 0) {
- mgmtExchange->dec_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->dec_bindingCount();
- }
- } else {
- return false;
- }
-
- if (propagate)
- propagateFedOp(string(), string(), fedOpUnbind, string());
- return true;
-}
-
-void FanOutExchange::route(Deliverable& msg, const string& /*routingKey*/, const FieldTable* /*args*/){
- PreRoute pr(msg, this);
- uint32_t count(0);
-
- BindingsArray::ConstPtr p = bindings.snapshot();
- if (p.get()){
- for(std::vector<Binding::shared_ptr>::const_iterator i = p->begin(); i != p->end(); ++i, count++){
- msg.deliverTo((*i)->queue);
- if ((*i)->mgmtBinding != 0)
- (*i)->mgmtBinding->inc_msgMatched ();
- }
- }
-
- if (mgmtExchange != 0)
- {
- mgmtExchange->inc_msgReceives ();
- mgmtExchange->inc_byteReceives (msg.contentSize ());
- if (count == 0)
- {
- mgmtExchange->inc_msgDrops ();
- mgmtExchange->inc_byteDrops (msg.contentSize ());
- }
- else
- {
- mgmtExchange->inc_msgRoutes (count);
- mgmtExchange->inc_byteRoutes (count * msg.contentSize ());
- }
- }
-}
-
-bool FanOutExchange::isBound(Queue::shared_ptr queue, const string* const, const FieldTable* const)
-{
- BindingsArray::ConstPtr ptr = bindings.snapshot();
- return ptr && std::find_if(ptr->begin(), ptr->end(), MatchQueue(queue)) != ptr->end();
-}
-
-
-FanOutExchange::~FanOutExchange() {}
-
-const std::string FanOutExchange::typeName("fanout");
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/FanOutExchange.h b/M4-RCs/qpid/cpp/src/qpid/broker/FanOutExchange.h
deleted file mode 100644
index 5884a19732..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/FanOutExchange.h
+++ /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.
- *
- */
-#ifndef _FanOutExchange_
-#define _FanOutExchange_
-
-#include <map>
-#include <vector>
-#include "Exchange.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/sys/CopyOnWriteArray.h"
-#include "Queue.h"
-
-namespace qpid {
-namespace broker {
-
-class FanOutExchange : public virtual Exchange {
- typedef qpid::sys::CopyOnWriteArray<Binding::shared_ptr> BindingsArray;
- BindingsArray bindings;
- FedBinding fedBinding;
- public:
- static const std::string typeName;
-
- FanOutExchange(const std::string& name, management::Manageable* parent = 0);
- FanOutExchange(const string& _name, bool _durable,
- const qpid::framing::FieldTable& _args,
- management::Manageable* parent = 0);
-
- virtual std::string getType() const { return typeName; }
-
- virtual bool bind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual bool unbind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual void route(Deliverable& msg, const std::string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual bool isBound(Queue::shared_ptr queue, const string* const routingKey, const qpid::framing::FieldTable* const args);
-
- virtual ~FanOutExchange();
- virtual bool supportsDynamicBinding() { return true; }
-};
-
-}
-}
-
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/HandlerImpl.h b/M4-RCs/qpid/cpp/src/qpid/broker/HandlerImpl.h
deleted file mode 100644
index 4c51e2a826..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/HandlerImpl.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef _broker_HandlerImpl_h
-#define _broker_HandlerImpl_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "SemanticState.h"
-#include "SessionContext.h"
-#include "ConnectionState.h"
-
-namespace qpid {
-namespace broker {
-
-class Broker;
-
-/**
- * Base template for protocol handler implementations.
- * Provides convenience methods for getting common session objects.
- */
-class HandlerImpl {
- protected:
- SemanticState& state;
- SessionContext& session;
-
- HandlerImpl(SemanticState& s) : state(s), session(s.getSession()) {}
-
- framing::AMQP_ClientProxy& getProxy() { return session.getProxy(); }
- ConnectionState& getConnection() { return session.getConnection(); }
- Broker& getBroker() { return session.getConnection().getBroker(); }
-};
-
-}} // namespace qpid::broker
-
-
-
-#endif /*!_broker_HandlerImpl_h*/
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/HeadersExchange.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/HeadersExchange.cpp
deleted file mode 100644
index 104b34da8b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/HeadersExchange.cpp
+++ /dev/null
@@ -1,226 +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 "HeadersExchange.h"
-#include "qpid/framing/FieldValue.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/log/Statement.h"
-#include <algorithm>
-
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-// TODO aconway 2006-09-20: More efficient matching algorithm.
-// The current search algorithm really sucks.
-// Fieldtables are heavy, maybe use shared_ptr to do handle-body.
-
-using namespace qpid::broker;
-
-namespace {
- const std::string all("all");
- const std::string any("any");
- const std::string x_match("x-match");
- const std::string empty;
-}
-
-HeadersExchange::HeadersExchange(const string& _name, Manageable* _parent) :
- Exchange(_name, _parent)
-{
- if (mgmtExchange != 0)
- mgmtExchange->set_type (typeName);
-}
-
-HeadersExchange::HeadersExchange(const std::string& _name, bool _durable,
- const FieldTable& _args, Manageable* _parent) :
- Exchange(_name, _durable, _args, _parent)
-{
- if (mgmtExchange != 0)
- mgmtExchange->set_type (typeName);
-}
-
-std::string HeadersExchange::getMatch(const FieldTable* args)
-{
- if (!args) {
- throw InternalErrorException(QPID_MSG("No arguments given."));
- }
- FieldTable::ValuePtr what = args->get(x_match);
- if (!what) {
- return empty;
- }
- if (!what->convertsTo<std::string>()) {
- throw InternalErrorException(QPID_MSG("Invalid x-match value binding to headers exchange."));
- }
- return what->get<std::string>();
-}
-
-bool HeadersExchange::bind(Queue::shared_ptr queue, const string& bindingKey, const FieldTable* args){
- std::string what = getMatch(args);
- if (what != all && what != any)
- throw InternalErrorException(QPID_MSG("Invalid x-match value binding to headers exchange."));
-
- Binding::shared_ptr binding (new Binding (bindingKey, queue, this, *args));
- if (bindings.add_unless(binding, MatchArgs(queue, args))) {
- if (mgmtExchange != 0) {
- mgmtExchange->inc_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->inc_bindingCount();
- }
- routeIVE();
- return true;
- } else {
- return false;
- }
-}
-
-bool HeadersExchange::unbind(Queue::shared_ptr queue, const string& bindingKey, const FieldTable*){
- if (bindings.remove_if(MatchKey(queue, bindingKey))) {
- if (mgmtExchange != 0) {
- mgmtExchange->dec_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->dec_bindingCount();
- }
- return true;
- } else {
- return false;
- }
-}
-
-
-void HeadersExchange::route(Deliverable& msg, const string& /*routingKey*/, const FieldTable* args){
- if (!args) return;//can't match if there were no headers passed in
- PreRoute pr(msg, this);
-
- uint32_t count(0);
-
- Bindings::ConstPtr p = bindings.snapshot();
- if (p.get()){
- for (std::vector<Binding::shared_ptr>::const_iterator i = p->begin(); i != p->end(); ++i, count++) {
- if (match((*i)->args, *args)) msg.deliverTo((*i)->queue);
- if ((*i)->mgmtBinding != 0)
- (*i)->mgmtBinding->inc_msgMatched ();
- }
- }
-
- if (mgmtExchange != 0)
- {
- mgmtExchange->inc_msgReceives ();
- mgmtExchange->inc_byteReceives (msg.contentSize ());
- if (count == 0)
- {
- mgmtExchange->inc_msgDrops ();
- mgmtExchange->inc_byteDrops (msg.contentSize ());
- }
- else
- {
- mgmtExchange->inc_msgRoutes (count);
- mgmtExchange->inc_byteRoutes (count * msg.contentSize ());
- }
- }
-}
-
-
-bool HeadersExchange::isBound(Queue::shared_ptr queue, const string* const, const FieldTable* const args)
-{
- Bindings::ConstPtr p = bindings.snapshot();
- if (p.get()){
- for (std::vector<Binding::shared_ptr>::const_iterator i = p->begin(); i != p->end(); ++i) {
- if ( (!args || equal((*i)->args, *args)) && (!queue || (*i)->queue == queue)) {
- return true;
- }
- }
- }
- return false;
-}
-
-HeadersExchange::~HeadersExchange() {}
-
-const std::string HeadersExchange::typeName("headers");
-
-namespace
-{
-
- bool match_values(const FieldValue& bind, const FieldValue& msg) {
- return bind.empty() || bind == msg;
- }
-
-}
-
-
-bool HeadersExchange::match(const FieldTable& bind, const FieldTable& msg) {
- typedef FieldTable::ValueMap Map;
- std::string what = getMatch(&bind);
- if (what == all) {
- for (Map::const_iterator i = bind.begin();
- i != bind.end();
- ++i)
- {
- if (i->first != x_match)
- {
- Map::const_iterator j = msg.find(i->first);
- if (j == msg.end()) return false;
- if (!match_values(*(i->second), *(j->second))) return false;
- }
- }
- return true;
- } else if (what == any) {
- for (Map::const_iterator i = bind.begin();
- i != bind.end();
- ++i)
- {
- if (i->first != x_match)
- {
- Map::const_iterator j = msg.find(i->first);
- if (j != msg.end()) {
- if (match_values(*(i->second), *(j->second))) return true;
- }
- }
- }
- return false;
- } else {
- return false;
- }
-}
-
-bool HeadersExchange::equal(const FieldTable& a, const FieldTable& b) {
- typedef FieldTable::ValueMap Map;
- for (Map::const_iterator i = a.begin();
- i != a.end();
- ++i)
- {
- Map::const_iterator j = b.find(i->first);
- if (j == b.end()) return false;
- if (!match_values(*(i->second), *(j->second))) return false;
- }
- return true;
-}
-
-HeadersExchange::MatchArgs::MatchArgs(Queue::shared_ptr q, const qpid::framing::FieldTable* a) : queue(q), args(a) {}
-bool HeadersExchange::MatchArgs::operator()(Exchange::Binding::shared_ptr b)
-{
- return b->queue == queue && b->args == *args;
-}
-
-HeadersExchange::MatchKey::MatchKey(Queue::shared_ptr q, const std::string& k) : queue(q), key(k) {}
-
-bool HeadersExchange::MatchKey::operator()(Exchange::Binding::shared_ptr b)
-{
- return b->queue == queue && b->key == key;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/HeadersExchange.h b/M4-RCs/qpid/cpp/src/qpid/broker/HeadersExchange.h
deleted file mode 100644
index e10fab2250..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/HeadersExchange.h
+++ /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.
- *
- */
-#ifndef _HeadersExchange_
-#define _HeadersExchange_
-
-#include <vector>
-#include "Exchange.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/sys/CopyOnWriteArray.h"
-#include "qpid/sys/Mutex.h"
-#include "Queue.h"
-
-namespace qpid {
-namespace broker {
-
-
-class HeadersExchange : public virtual Exchange {
- typedef std::pair<qpid::framing::FieldTable, Binding::shared_ptr> HeaderMap;
- typedef qpid::sys::CopyOnWriteArray<Binding::shared_ptr> Bindings;
-
- struct MatchArgs
- {
- const Queue::shared_ptr queue;
- const qpid::framing::FieldTable* args;
- MatchArgs(Queue::shared_ptr q, const qpid::framing::FieldTable* a);
- bool operator()(Exchange::Binding::shared_ptr b);
- };
- struct MatchKey
- {
- const Queue::shared_ptr queue;
- const std::string& key;
- MatchKey(Queue::shared_ptr q, const std::string& k);
- bool operator()(Exchange::Binding::shared_ptr b);
- };
-
- Bindings bindings;
- qpid::sys::Mutex lock;
-
- static std::string getMatch(const framing::FieldTable* args);
-
- public:
- static const std::string typeName;
-
- HeadersExchange(const string& name, management::Manageable* parent = 0);
- HeadersExchange(const string& _name, bool _durable,
- const qpid::framing::FieldTable& _args,
- management::Manageable* parent = 0);
-
- virtual std::string getType() const { return typeName; }
-
- virtual bool bind(Queue::shared_ptr queue, const string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual bool unbind(Queue::shared_ptr queue, const string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual void route(Deliverable& msg, const string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual bool isBound(Queue::shared_ptr queue, const string* const routingKey, const qpid::framing::FieldTable* const args);
-
- virtual ~HeadersExchange();
-
- static bool match(const qpid::framing::FieldTable& bindArgs, const qpid::framing::FieldTable& msgArgs);
- static bool equal(const qpid::framing::FieldTable& bindArgs, const qpid::framing::FieldTable& msgArgs);
-};
-
-
-
-}
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/IncompleteMessageList.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/IncompleteMessageList.cpp
deleted file mode 100644
index 2077e633ec..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/IncompleteMessageList.cpp
+++ /dev/null
@@ -1,81 +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 "IncompleteMessageList.h"
-
-namespace qpid {
-namespace broker {
-
-IncompleteMessageList::IncompleteMessageList() :
- callback(boost::bind(&IncompleteMessageList::enqueueComplete, this, _1))
-{}
-
-IncompleteMessageList::~IncompleteMessageList()
-{
- sys::Mutex::ScopedLock l(lock);
- std::for_each(incomplete.begin(), incomplete.end(), boost::bind(&Message::resetEnqueueCompleteCallback, _1));
-}
-
-void IncompleteMessageList::add(boost::intrusive_ptr<Message> msg)
-{
- sys::Mutex::ScopedLock l(lock);
- msg->setEnqueueCompleteCallback(callback);
- incomplete.push_back(msg);
-}
-
-void IncompleteMessageList::enqueueComplete(const boost::intrusive_ptr<Message>& ) {
- sys::Mutex::ScopedLock l(lock);
- lock.notify();
-}
-
-void IncompleteMessageList::process(const CompletionListener& listen, bool sync)
-{
- sys::Mutex::ScopedLock l(lock);
- while (!incomplete.empty()) {
- boost::intrusive_ptr<Message>& msg = incomplete.front();
- if (!msg->isEnqueueComplete()) {
- if (sync){
- {
- sys::Mutex::ScopedUnlock u(lock);
- msg->flush(); // Can re-enter IncompleteMessageList::enqueueComplete
- }
- while (!msg->isEnqueueComplete())
- lock.wait();
- } else {
- //leave the message as incomplete for now
- return;
- }
- }
- listen(msg);
- incomplete.pop_front();
- }
-}
-
-void IncompleteMessageList::each(const CompletionListener& listen) {
- Messages snapshot;
- {
- sys::Mutex::ScopedLock l(lock);
- snapshot = incomplete;
- }
- std::for_each(incomplete.begin(), incomplete.end(), listen); // FIXME aconway 2008-11-07: passed by ref or value?
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/IncompleteMessageList.h b/M4-RCs/qpid/cpp/src/qpid/broker/IncompleteMessageList.h
deleted file mode 100644
index f89c0023b0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/IncompleteMessageList.h
+++ /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.
- *
- */
-#ifndef _IncompleteMessageList_
-#define _IncompleteMessageList_
-
-#include "qpid/sys/Monitor.h"
-#include "qpid/broker/Message.h"
-#include <boost/intrusive_ptr.hpp>
-#include <boost/function.hpp>
-#include <list>
-
-namespace qpid {
-namespace broker {
-
-class IncompleteMessageList
-{
- typedef std::list< boost::intrusive_ptr<Message> > Messages;
-
- void enqueueComplete(const boost::intrusive_ptr<Message>&);
-
- sys::Monitor lock;
- Messages incomplete;
- Message::MessageCallback callback;
-
-public:
- typedef Message::MessageCallback CompletionListener;
-
- IncompleteMessageList();
- ~IncompleteMessageList();
-
- void add(boost::intrusive_ptr<Message> msg);
- void process(const CompletionListener& l, bool sync);
- void each(const CompletionListener& l);
-};
-
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Link.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/Link.cpp
deleted file mode 100644
index bda9c80f0b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Link.cpp
+++ /dev/null
@@ -1,398 +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 "Link.h"
-#include "LinkRegistry.h"
-#include "Broker.h"
-#include "Connection.h"
-#include "qmf/org/apache/qpid/broker/EventBrokerLinkUp.h"
-#include "qmf/org/apache/qpid/broker/EventBrokerLinkDown.h"
-#include "boost/bind.hpp"
-#include "qpid/log/Statement.h"
-#include "qpid/framing/enum.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "AclModule.h"
-
-using namespace qpid::broker;
-using qpid::framing::Buffer;
-using qpid::framing::FieldTable;
-using qpid::framing::NotAllowedException;
-using qpid::framing::connection::CLOSE_CODE_CONNECTION_FORCED;
-using qpid::management::ManagementAgent;
-using qpid::management::ManagementObject;
-using qpid::management::Manageable;
-using qpid::management::Args;
-using qpid::sys::Mutex;
-using std::stringstream;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-Link::Link(LinkRegistry* _links,
- MessageStore* _store,
- string& _host,
- uint16_t _port,
- string& _transport,
- bool _durable,
- string& _authMechanism,
- string& _username,
- string& _password,
- Broker* _broker,
- Manageable* parent)
- : links(_links), store(_store), host(_host), port(_port),
- transport(_transport),
- durable(_durable),
- authMechanism(_authMechanism), username(_username), password(_password),
- persistenceId(0), mgmtObject(0), broker(_broker), state(0),
- visitCount(0),
- currentInterval(1),
- closing(false),
- channelCounter(1),
- connection(0),
- agent(0)
-{
- if (parent != 0)
- {
- agent = ManagementAgent::Singleton::getInstance();
- if (agent != 0)
- {
- mgmtObject = new _qmf::Link(agent, this, parent, _host, _port, _transport, _durable);
- if (!durable)
- agent->addObject(mgmtObject);
- }
- }
- setStateLH(STATE_WAITING);
-}
-
-Link::~Link ()
-{
- if (state == STATE_OPERATIONAL && connection != 0)
- connection->close(CLOSE_CODE_CONNECTION_FORCED, "closed by management");
-
- if (mgmtObject != 0)
- mgmtObject->resourceDestroy ();
-}
-
-void Link::setStateLH (int newState)
-{
- if (newState == state)
- return;
-
- state = newState;
- if (mgmtObject == 0)
- return;
-
- switch (state)
- {
- case STATE_WAITING : mgmtObject->set_state("Waiting"); break;
- case STATE_CONNECTING : mgmtObject->set_state("Connecting"); break;
- case STATE_OPERATIONAL : mgmtObject->set_state("Operational"); break;
- case STATE_FAILED : mgmtObject->set_state("Failed"); break;
- case STATE_CLOSED : mgmtObject->set_state("Closed"); break;
- }
-}
-
-void Link::startConnectionLH ()
-{
- try {
- // Set the state before calling connect. It is possible that connect
- // will fail synchronously and call Link::closed before returning.
- setStateLH(STATE_CONNECTING);
- broker->connect (host, port, transport,
- boost::bind (&Link::closed, this, _1, _2));
- } catch(std::exception& e) {
- setStateLH(STATE_WAITING);
- if (mgmtObject != 0)
- mgmtObject->set_lastError (e.what());
- }
-}
-
-void Link::established ()
-{
- Mutex::ScopedLock mutex(lock);
- stringstream addr;
- addr << host << ":" << port;
-
- QPID_LOG (info, "Inter-broker link established to " << addr.str());
- agent->raiseEvent(_qmf::EventBrokerLinkUp(addr.str()));
- setStateLH(STATE_OPERATIONAL);
- currentInterval = 1;
- visitCount = 0;
- if (closing)
- destroy();
-}
-
-void Link::closed (int, std::string text)
-{
- Mutex::ScopedLock mutex(lock);
-
- connection = 0;
-
- if (state == STATE_OPERATIONAL) {
- stringstream addr;
- addr << host << ":" << port;
- QPID_LOG (warning, "Inter-broker link disconnected from " << addr.str());
- agent->raiseEvent(_qmf::EventBrokerLinkDown(addr.str()));
- }
-
- for (Bridges::iterator i = active.begin(); i != active.end(); i++) {
- (*i)->cancel();
- created.push_back(*i);
- }
- active.clear();
-
- if (state != STATE_FAILED)
- {
- setStateLH(STATE_WAITING);
- if (mgmtObject != 0)
- mgmtObject->set_lastError (text);
- }
-
- if (closing)
- destroy();
-}
-
-void Link::destroy ()
-{
- {
- Mutex::ScopedLock mutex(lock);
- Bridges toDelete;
-
- AclModule* acl = getBroker()->getAcl();
- std::string userID = getUsername() + "@" + getBroker()->getOptions().realm;
- if (acl && !acl->authorise(userID,acl::ACT_DELETE,acl::OBJ_LINK,"")){
- throw NotAllowedException("ACL denied delete link request");
- }
-
- QPID_LOG (info, "Inter-broker link to " << host << ":" << port << " removed by management");
- if (connection)
- connection->close(CLOSE_CODE_CONNECTION_FORCED, "closed by management");
-
- setStateLH(STATE_CLOSED);
-
- // Move the bridges to be deleted into a local vector so there is no
- // corruption of the iterator caused by bridge deletion.
- for (Bridges::iterator i = active.begin(); i != active.end(); i++)
- toDelete.push_back(*i);
- active.clear();
-
- for (Bridges::iterator i = created.begin(); i != created.end(); i++)
- toDelete.push_back(*i);
- created.clear();
-
- // Now delete all bridges on this link.
- for (Bridges::iterator i = toDelete.begin(); i != toDelete.end(); i++)
- (*i)->destroy();
- toDelete.clear();
- }
- links->destroy (host, port);
-}
-
-void Link::add(Bridge::shared_ptr bridge)
-{
- Mutex::ScopedLock mutex(lock);
- created.push_back (bridge);
-}
-
-void Link::cancel(Bridge::shared_ptr bridge)
-{
- Mutex::ScopedLock mutex(lock);
-
- for (Bridges::iterator i = created.begin(); i != created.end(); i++) {
- if ((*i).get() == bridge.get()) {
- created.erase(i);
- break;
- }
- }
- for (Bridges::iterator i = active.begin(); i != active.end(); i++) {
- if ((*i).get() == bridge.get()) {
- bridge->cancel();
- active.erase(i);
- break;
- }
- }
-}
-
-void Link::ioThreadProcessing()
-{
- Mutex::ScopedLock mutex(lock);
-
- if (state != STATE_OPERATIONAL)
- return;
-
- //process any pending creates
- if (!created.empty()) {
- for (Bridges::iterator i = created.begin(); i != created.end(); ++i) {
- active.push_back(*i);
- (*i)->create(*connection);
- }
- created.clear();
- }
-}
-
-void Link::setConnection(Connection* c)
-{
- Mutex::ScopedLock mutex(lock);
- connection = c;
-}
-
-void Link::maintenanceVisit ()
-{
- Mutex::ScopedLock mutex(lock);
-
- if (state == STATE_WAITING)
- {
- visitCount++;
- if (visitCount >= currentInterval)
- {
- visitCount = 0;
- currentInterval *= 2;
- if (currentInterval > MAX_INTERVAL)
- currentInterval = MAX_INTERVAL;
- startConnectionLH();
- }
- }
- else if (state == STATE_OPERATIONAL && !created.empty() && connection != 0)
- connection->requestIOProcessing (boost::bind(&Link::ioThreadProcessing, this));
-}
-
-uint Link::nextChannel()
-{
- Mutex::ScopedLock mutex(lock);
-
- return channelCounter++;
-}
-
-void Link::notifyConnectionForced(const string text)
-{
- Mutex::ScopedLock mutex(lock);
-
- setStateLH(STATE_FAILED);
- if (mgmtObject != 0)
- mgmtObject->set_lastError(text);
-}
-
-void Link::setPersistenceId(uint64_t id) const
-{
- if (mgmtObject != 0 && persistenceId == 0) {
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- agent->addObject(mgmtObject, id);
- }
- persistenceId = id;
-}
-
-const string& Link::getName() const
-{
- return host;
-}
-
-Link::shared_ptr Link::decode(LinkRegistry& links, Buffer& buffer)
-{
- string host;
- uint16_t port;
- string transport;
- string authMechanism;
- string username;
- string password;
-
- buffer.getShortString(host);
- port = buffer.getShort();
- buffer.getShortString(transport);
- bool durable(buffer.getOctet());
- buffer.getShortString(authMechanism);
- buffer.getShortString(username);
- buffer.getShortString(password);
-
- return links.declare(host, port, transport, durable, authMechanism, username, password).first;
-}
-
-void Link::encode(Buffer& buffer) const
-{
- buffer.putShortString(string("link"));
- buffer.putShortString(host);
- buffer.putShort(port);
- buffer.putShortString(transport);
- buffer.putOctet(durable ? 1 : 0);
- buffer.putShortString(authMechanism);
- buffer.putShortString(username);
- buffer.putShortString(password);
-}
-
-uint32_t Link::encodedSize() const
-{
- return host.size() + 1 // short-string (host)
- + 5 // short-string ("link")
- + 2 // port
- + transport.size() + 1 // short-string(transport)
- + 1 // durable
- + authMechanism.size() + 1
- + username.size() + 1
- + password.size() + 1;
-}
-
-ManagementObject* Link::GetManagementObject (void) const
-{
- return (ManagementObject*) mgmtObject;
-}
-
-Manageable::status_t Link::ManagementMethod (uint32_t op, Args& args, string& text)
-{
- switch (op)
- {
- case _qmf::Link::METHOD_CLOSE :
- closing = true;
- if (state != STATE_CONNECTING)
- destroy();
- return Manageable::STATUS_OK;
-
- case _qmf::Link::METHOD_BRIDGE :
- _qmf::ArgsLinkBridge& iargs = (_qmf::ArgsLinkBridge&) args;
-
- // Durable bridges are only valid on durable links
- if (iargs.i_durable && !durable) {
- text = "Can't create a durable route on a non-durable link";
- return Manageable::STATUS_USER;
- }
-
- if (iargs.i_dynamic) {
- Exchange::shared_ptr exchange = getBroker()->getExchanges().get(iargs.i_src);
- if (exchange.get() == 0) {
- text = "Exchange not found";
- return Manageable::STATUS_USER;
- }
- if (!exchange->supportsDynamicBinding()) {
- text = "Exchange type does not support dynamic routing";
- return Manageable::STATUS_USER;
- }
- }
-
- std::pair<Bridge::shared_ptr, bool> result =
- links->declare (host, port, iargs.i_durable, iargs.i_src,
- iargs.i_dest, iargs.i_key, iargs.i_srcIsQueue,
- iargs.i_srcIsLocal, iargs.i_tag, iargs.i_excludes,
- iargs.i_dynamic);
-
- if (result.second && iargs.i_durable)
- store->create(*result.first);
-
- return Manageable::STATUS_OK;
- }
-
- return Manageable::STATUS_UNKNOWN_METHOD;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Link.h b/M4-RCs/qpid/cpp/src/qpid/broker/Link.h
deleted file mode 100644
index a8dd528071..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Link.h
+++ /dev/null
@@ -1,136 +0,0 @@
-#ifndef _broker_Link_h
-#define _broker_Link_h
-
-/*
- *
- * 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 <boost/shared_ptr.hpp>
-#include "MessageStore.h"
-#include "PersistableConfig.h"
-#include "Bridge.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/management/Manageable.h"
-#include "qpid/agent/ManagementAgent.h"
-#include "qmf/org/apache/qpid/broker/Link.h"
-#include <boost/ptr_container/ptr_vector.hpp>
-
-namespace qpid {
- namespace broker {
-
- using std::string;
- class LinkRegistry;
- class Broker;
- class Connection;
-
- class Link : public PersistableConfig, public management::Manageable {
- private:
- sys::Mutex lock;
- LinkRegistry* links;
- MessageStore* store;
- string host;
- uint16_t port;
- string transport;
- bool durable;
- string authMechanism;
- string username;
- string password;
- mutable uint64_t persistenceId;
- qmf::org::apache::qpid::broker::Link* mgmtObject;
- Broker* broker;
- int state;
- uint32_t visitCount;
- uint32_t currentInterval;
- bool closing;
-
- typedef std::vector<Bridge::shared_ptr> Bridges;
- Bridges created; // Bridges pending creation
- Bridges active; // Bridges active
- uint channelCounter;
- Connection* connection;
- management::ManagementAgent* agent;
-
- static const int STATE_WAITING = 1;
- static const int STATE_CONNECTING = 2;
- static const int STATE_OPERATIONAL = 3;
- static const int STATE_FAILED = 4;
- static const int STATE_CLOSED = 5;
-
- static const uint32_t MAX_INTERVAL = 32;
-
- void setStateLH (int newState);
- void startConnectionLH(); // Start the IO Connection
- void destroy(); // Called when mgmt deletes this link
- void ioThreadProcessing(); // Called on connection's IO thread by request
-
- public:
- typedef boost::shared_ptr<Link> shared_ptr;
-
- Link(LinkRegistry* links,
- MessageStore* store,
- string& host,
- uint16_t port,
- string& transport,
- bool durable,
- string& authMechanism,
- string& username,
- string& password,
- Broker* broker,
- management::Manageable* parent = 0);
- virtual ~Link();
-
- std::string getHost() { return host; }
- uint16_t getPort() { return port; }
- bool isDurable() { return durable; }
- void maintenanceVisit ();
- uint nextChannel();
- void add(Bridge::shared_ptr);
- void cancel(Bridge::shared_ptr);
-
- void established(); // Called when connection is created
- void closed(int, std::string); // Called when connection goes away
- void setConnection(Connection*); // Set pointer to the AMQP Connection
-
- string getAuthMechanism() { return authMechanism; }
- string getUsername() { return username; }
- string getPassword() { return password; }
- Broker* getBroker() { return broker; }
-
- void notifyConnectionForced(const std::string text);
-
- // PersistableConfig:
- void setPersistenceId(uint64_t id) const;
- uint64_t getPersistenceId() const { return persistenceId; }
- uint32_t encodedSize() const;
- void encode(framing::Buffer& buffer) const;
- const string& getName() const;
-
- static Link::shared_ptr decode(LinkRegistry& links, framing::Buffer& buffer);
-
- // Manageable entry points
- management::ManagementObject* GetManagementObject(void) const;
- management::Manageable::status_t ManagementMethod(uint32_t, management::Args&, std::string&);
- };
- }
-}
-
-
-#endif /*!_broker_Link.cpp_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/LinkRegistry.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/LinkRegistry.cpp
deleted file mode 100644
index 960e9f21ba..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/LinkRegistry.cpp
+++ /dev/null
@@ -1,252 +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 "LinkRegistry.h"
-#include <iostream>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-using std::pair;
-using std::stringstream;
-using boost::intrusive_ptr;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-#define LINK_MAINT_INTERVAL 2
-
-LinkRegistry::LinkRegistry (Broker* _broker) : broker(_broker), parent(0), store(0)
-{
- timer.add (intrusive_ptr<TimerTask> (new Periodic(*this)));
-}
-
-LinkRegistry::Periodic::Periodic (LinkRegistry& _links) :
- TimerTask (Duration (LINK_MAINT_INTERVAL * TIME_SEC)), links(_links) {}
-
-void LinkRegistry::Periodic::fire ()
-{
- links.periodicMaintenance ();
- links.timer.add (intrusive_ptr<TimerTask> (new Periodic(links)));
-}
-
-void LinkRegistry::periodicMaintenance ()
-{
- Mutex::ScopedLock locker(lock);
-
- linksToDestroy.clear();
- bridgesToDestroy.clear();
- for (LinkMap::iterator i = links.begin(); i != links.end(); i++)
- i->second->maintenanceVisit();
-}
-
-pair<Link::shared_ptr, bool> LinkRegistry::declare(string& host,
- uint16_t port,
- string& transport,
- bool durable,
- string& authMechanism,
- string& username,
- string& password)
-
-{
- Mutex::ScopedLock locker(lock);
- stringstream keystream;
- keystream << host << ":" << port;
- string key = string(keystream.str());
-
- LinkMap::iterator i = links.find(key);
- if (i == links.end())
- {
- Link::shared_ptr link;
-
- link = Link::shared_ptr (new Link (this, store, host, port, transport, durable,
- authMechanism, username, password,
- broker, parent));
- links[key] = link;
- return std::pair<Link::shared_ptr, bool>(link, true);
- }
- return std::pair<Link::shared_ptr, bool>(i->second, false);
-}
-
-pair<Bridge::shared_ptr, bool> LinkRegistry::declare(std::string& host,
- uint16_t port,
- bool durable,
- std::string& src,
- std::string& dest,
- std::string& key,
- bool isQueue,
- bool isLocal,
- std::string& tag,
- std::string& excludes,
- bool dynamic)
-{
- Mutex::ScopedLock locker(lock);
- stringstream keystream;
- keystream << host << ":" << port;
- string linkKey = string(keystream.str());
-
- keystream << "!" << src << "!" << dest << "!" << key;
- string bridgeKey = string(keystream.str());
-
- LinkMap::iterator l = links.find(linkKey);
- if (l == links.end())
- return pair<Bridge::shared_ptr, bool>(Bridge::shared_ptr(), false);
-
- BridgeMap::iterator b = bridges.find(bridgeKey);
- if (b == bridges.end())
- {
- _qmf::ArgsLinkBridge args;
- Bridge::shared_ptr bridge;
-
- args.i_durable = durable;
- args.i_src = src;
- args.i_dest = dest;
- args.i_key = key;
- args.i_srcIsQueue = isQueue;
- args.i_srcIsLocal = isLocal;
- args.i_tag = tag;
- args.i_excludes = excludes;
- args.i_dynamic = dynamic;
-
- bridge = Bridge::shared_ptr
- (new Bridge (l->second.get(), l->second->nextChannel(),
- boost::bind(&LinkRegistry::destroy, this,
- host, port, src, dest, key), args));
- bridges[bridgeKey] = bridge;
- l->second->add(bridge);
- return std::pair<Bridge::shared_ptr, bool>(bridge, true);
- }
- return std::pair<Bridge::shared_ptr, bool>(b->second, false);
-}
-
-void LinkRegistry::destroy(const string& host, const uint16_t port)
-{
- Mutex::ScopedLock locker(lock);
- stringstream keystream;
- keystream << host << ":" << port;
- string key = string(keystream.str());
-
- LinkMap::iterator i = links.find(key);
- if (i != links.end())
- {
- if (i->second->isDurable() && store)
- store->destroy(*(i->second));
- linksToDestroy[key] = i->second;
- links.erase(i);
- }
-}
-
-void LinkRegistry::destroy(const std::string& host,
- const uint16_t port,
- const std::string& src,
- const std::string& dest,
- const std::string& key)
-{
- Mutex::ScopedLock locker(lock);
- stringstream keystream;
- keystream << host << ":" << port;
- string linkKey = string(keystream.str());
-
- LinkMap::iterator l = links.find(linkKey);
- if (l == links.end())
- return;
-
- keystream << "!" << src << "!" << dest << "!" << key;
- string bridgeKey = string(keystream.str());
- BridgeMap::iterator b = bridges.find(bridgeKey);
- if (b == bridges.end())
- return;
-
- l->second->cancel(b->second);
- if (b->second->isDurable())
- store->destroy(*(b->second));
- bridgesToDestroy[bridgeKey] = b->second;
- bridges.erase(b);
-}
-
-void LinkRegistry::setStore (MessageStore* _store)
-{
- store = _store;
-}
-
-MessageStore* LinkRegistry::getStore() const {
- return store;
-}
-
-void LinkRegistry::notifyConnection(const std::string& key, Connection* c)
-{
- Mutex::ScopedLock locker(lock);
- LinkMap::iterator l = links.find(key);
- if (l != links.end())
- {
- l->second->established();
- l->second->setConnection(c);
- }
-}
-
-void LinkRegistry::notifyClosed(const std::string& key)
-{
- Mutex::ScopedLock locker(lock);
- LinkMap::iterator l = links.find(key);
- if (l != links.end())
- l->second->closed(0, "Closed by peer");
-}
-
-void LinkRegistry::notifyConnectionForced(const std::string& key, const std::string& text)
-{
- Mutex::ScopedLock locker(lock);
- LinkMap::iterator l = links.find(key);
- if (l != links.end())
- l->second->notifyConnectionForced(text);
-}
-
-std::string LinkRegistry::getAuthMechanism(const std::string& key)
-{
- Mutex::ScopedLock locker(lock);
- LinkMap::iterator l = links.find(key);
- if (l != links.end())
- return l->second->getAuthMechanism();
- return string("ANONYMOUS");
-}
-
-std::string LinkRegistry::getAuthCredentials(const std::string& key)
-{
- Mutex::ScopedLock locker(lock);
- LinkMap::iterator l = links.find(key);
- if (l == links.end())
- return string();
-
- string result;
- result += '\0';
- result += l->second->getUsername();
- result += '\0';
- result += l->second->getPassword();
-
- return result;
-}
-
-std::string LinkRegistry::getAuthIdentity(const std::string& key)
-{
- Mutex::ScopedLock locker(lock);
- LinkMap::iterator l = links.find(key);
- if (l == links.end())
- return string();
-
- return l->second->getUsername();
-}
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/LinkRegistry.h b/M4-RCs/qpid/cpp/src/qpid/broker/LinkRegistry.h
deleted file mode 100644
index d563412cc1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/LinkRegistry.h
+++ /dev/null
@@ -1,123 +0,0 @@
-#ifndef _broker_LinkRegistry_h
-#define _broker_LinkRegistry_h
-
-/*
- *
- * 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 <map>
-#include "Link.h"
-#include "Bridge.h"
-#include "MessageStore.h"
-#include "Timer.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/management/Manageable.h"
-
-namespace qpid {
-namespace broker {
-
- class Broker;
- class Connection;
- class LinkRegistry {
-
- // Declare a timer task to manage the establishment of link connections and the
- // re-establishment of lost link connections.
- struct Periodic : public TimerTask
- {
- LinkRegistry& links;
-
- Periodic(LinkRegistry& links);
- virtual ~Periodic() {};
- void fire();
- };
-
- typedef std::map<std::string, Link::shared_ptr> LinkMap;
- typedef std::map<std::string, Bridge::shared_ptr> BridgeMap;
-
- LinkMap links;
- LinkMap linksToDestroy;
- BridgeMap bridges;
- BridgeMap bridgesToDestroy;
-
- qpid::sys::Mutex lock;
- Broker* broker;
- Timer timer;
- management::Manageable* parent;
- MessageStore* store;
-
- void periodicMaintenance ();
-
- public:
- LinkRegistry (Broker* _broker);
- std::pair<Link::shared_ptr, bool>
- declare(std::string& host,
- uint16_t port,
- std::string& transport,
- bool durable,
- std::string& authMechanism,
- std::string& username,
- std::string& password);
- std::pair<Bridge::shared_ptr, bool>
- declare(std::string& host,
- uint16_t port,
- bool durable,
- std::string& src,
- std::string& dest,
- std::string& key,
- bool isQueue,
- bool isLocal,
- std::string& id,
- std::string& excludes,
- bool dynamic);
-
- void destroy(const std::string& host, const uint16_t port);
- void destroy(const std::string& host,
- const uint16_t port,
- const std::string& src,
- const std::string& dest,
- const std::string& key);
-
- /**
- * Register the manageable parent for declared queues
- */
- void setParent (management::Manageable* _parent) { parent = _parent; }
-
- /**
- * Set the store to use. May only be called once.
- */
- void setStore (MessageStore*);
-
- /**
- * Return the message store used.
- */
- MessageStore* getStore() const;
-
- void notifyConnection (const std::string& key, Connection* c);
- void notifyClosed (const std::string& key);
- void notifyConnectionForced (const std::string& key, const std::string& text);
- std::string getAuthMechanism (const std::string& key);
- std::string getAuthCredentials (const std::string& key);
- std::string getAuthIdentity (const std::string& key);
- };
-}
-}
-
-
-#endif /*!_broker_LinkRegistry_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Message.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/Message.cpp
deleted file mode 100644
index 89f2653a21..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Message.cpp
+++ /dev/null
@@ -1,369 +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 "Message.h"
-#include "ExchangeRegistry.h"
-#include "qpid/StringUtils.h"
-#include "qpid/framing/frame_functors.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/framing/SendContent.h"
-#include "qpid/framing/SequenceNumber.h"
-#include "qpid/framing/TypeFilter.h"
-#include "qpid/log/Statement.h"
-
-#include <time.h>
-
-using boost::intrusive_ptr;
-using qpid::sys::AbsTime;
-using qpid::sys::Duration;
-using qpid::sys::TIME_MSEC;
-using qpid::sys::FAR_FUTURE;
-using std::string;
-using namespace qpid::framing;
-
-namespace qpid {
-namespace broker {
-
-TransferAdapter Message::TRANSFER;
-
-Message::Message(const framing::SequenceNumber& id) :
- frames(id), persistenceId(0), redelivered(false), loaded(false),
- staged(false), forcePersistentPolicy(false), publisher(0), adapter(0),
- expiration(FAR_FUTURE), enqueueCallback(0), dequeueCallback(0) {}
-
-Message::~Message()
-{
-}
-
-void Message::forcePersistent()
-{
- forcePersistentPolicy = true;
-}
-
-std::string Message::getRoutingKey() const
-{
- return getAdapter().getRoutingKey(frames);
-}
-
-std::string Message::getExchangeName() const
-{
- return getAdapter().getExchange(frames);
-}
-
-const boost::shared_ptr<Exchange> Message::getExchange(ExchangeRegistry& registry) const
-{
- if (!exchange) {
- exchange = registry.get(getExchangeName());
- }
- return exchange;
-}
-
-bool Message::isImmediate() const
-{
- return getAdapter().isImmediate(frames);
-}
-
-const FieldTable* Message::getApplicationHeaders() const
-{
- return getAdapter().getApplicationHeaders(frames);
-}
-
-bool Message::isPersistent()
-{
- return (getAdapter().isPersistent(frames) || forcePersistentPolicy);
-}
-
-bool Message::requiresAccept()
-{
- return getAdapter().requiresAccept(frames);
-}
-
-uint32_t Message::getRequiredCredit() const
-{
- //add up payload for all header and content frames in the frameset
- SumBodySize sum;
- frames.map_if(sum, TypeFilter2<HEADER_BODY, CONTENT_BODY>());
- return sum.getSize();
-}
-
-void Message::encode(framing::Buffer& buffer) const
-{
- //encode method and header frames
- EncodeFrame f1(buffer);
- frames.map_if(f1, TypeFilter2<METHOD_BODY, HEADER_BODY>());
-
- //then encode the payload of each content frame
- framing::EncodeBody f2(buffer);
- frames.map_if(f2, TypeFilter<CONTENT_BODY>());
-}
-
-void Message::encodeContent(framing::Buffer& buffer) const
-{
- //encode the payload of each content frame
- EncodeBody f2(buffer);
- frames.map_if(f2, TypeFilter<CONTENT_BODY>());
-}
-
-uint32_t Message::encodedSize() const
-{
- return encodedHeaderSize() + encodedContentSize();
-}
-
-uint32_t Message::encodedContentSize() const
-{
- return frames.getContentSize();
-}
-
-uint32_t Message::encodedHeaderSize() const
-{
- //add up the size for all method and header frames in the frameset
- SumFrameSize sum;
- frames.map_if(sum, TypeFilter2<METHOD_BODY, HEADER_BODY>());
- return sum.getSize();
-}
-
-void Message::decodeHeader(framing::Buffer& buffer)
-{
- AMQFrame method;
- method.decode(buffer);
- frames.append(method);
-
- AMQFrame header;
- header.decode(buffer);
- frames.append(header);
-}
-
-void Message::decodeContent(framing::Buffer& buffer)
-{
- if (buffer.available()) {
- //get the data as a string and set that as the content
- //body on a frame then add that frame to the frameset
- AMQFrame frame;
- frame.setBody(AMQContentBody());
- frame.castBody<AMQContentBody>()->decode(buffer, buffer.available());
- frames.append(frame);
- } else {
- //adjust header flags
- MarkLastSegment f;
- frames.map_if(f, TypeFilter<HEADER_BODY>());
- }
- //mark content loaded
- loaded = true;
-}
-
-void Message::releaseContent(MessageStore* _store)
-{
- if (!store) {
- store = _store;
- }
- if (store) {
- if (!getPersistenceId()) {
- intrusive_ptr<PersistableMessage> pmsg(this);
- store->stage(pmsg);
- staged = true;
- }
- //remove any content frames from the frameset
- frames.remove(TypeFilter<CONTENT_BODY>());
- setContentReleased();
- }
-}
-
-void Message::destroy()
-{
- if (staged) {
- if (store) {
- store->destroy(*this);
- } else {
- QPID_LOG(error, "Message content was staged but no store is set so it can't be destroyed");
- }
- }
-}
-
-void Message::sendContent(Queue& queue, framing::FrameHandler& out, uint16_t maxFrameSize) const
-{
- if (isContentReleased()) {
- //load content from store in chunks of maxContentSize
- uint16_t maxContentSize = maxFrameSize - AMQFrame::frameOverhead();
- intrusive_ptr<const PersistableMessage> pmsg(this);
-
- bool done = false;
- for (uint64_t offset = 0; !done; offset += maxContentSize)
- {
- AMQFrame frame(in_place<AMQContentBody>());
- string& data = frame.castBody<AMQContentBody>()->getData();
-
- store->loadContent(queue, pmsg, data, offset, maxContentSize);
- done = data.size() < maxContentSize;
- frame.setBof(false);
- frame.setEof(true);
- if (offset > 0) {
- frame.setBos(false);
- }
- if (!done) {
- frame.setEos(false);
- }
- QPID_LOG(debug, "loaded frame for delivery: " << frame);
- out.handle(frame);
- }
- } else {
- Count c;
- frames.map_if(c, TypeFilter<CONTENT_BODY>());
-
- SendContent f(out, maxFrameSize, c.getCount());
- frames.map_if(f, TypeFilter<CONTENT_BODY>());
- }
-}
-
-void Message::sendHeader(framing::FrameHandler& out, uint16_t /*maxFrameSize*/) const
-{
- sys::Mutex::ScopedLock l(lock);
- Relay f(out);
- frames.map_if(f, TypeFilter<HEADER_BODY>());
-}
-
-// TODO aconway 2007-11-09: Obsolete, remove. Was used to cover over
-// 0-8/0-9 message differences.
-MessageAdapter& Message::getAdapter() const
-{
- if (!adapter) {
- if(frames.isA<MessageTransferBody>()) {
- adapter = &TRANSFER;
- } else {
- const AMQMethodBody* method = frames.getMethod();
- if (!method) throw Exception("Can't adapt message with no method");
- else throw Exception(QPID_MSG("Can't adapt message based on " << *method));
- }
- }
- return *adapter;
-}
-
-uint64_t Message::contentSize() const
-{
- return frames.getContentSize();
-}
-
-bool Message::isContentLoaded() const
-{
- return loaded;
-}
-
-
-namespace
-{
-const std::string X_QPID_TRACE("x-qpid.trace");
-}
-
-bool Message::isExcluded(const std::vector<std::string>& excludes) const
-{
- const FieldTable* headers = getApplicationHeaders();
- if (headers) {
- std::string traceStr = headers->getAsString(X_QPID_TRACE);
- if (traceStr.size()) {
- std::vector<std::string> trace = split(traceStr, ", ");
-
- for (std::vector<std::string>::const_iterator i = excludes.begin(); i != excludes.end(); i++) {
- for (std::vector<std::string>::const_iterator j = trace.begin(); j != trace.end(); j++) {
- if (*i == *j) {
- return true;
- }
- }
- }
- }
- }
- return false;
-}
-
-void Message::addTraceId(const std::string& id)
-{
- sys::Mutex::ScopedLock l(lock);
- if (isA<MessageTransferBody>()) {
- FieldTable& headers = getProperties<MessageProperties>()->getApplicationHeaders();
- std::string trace = headers.getAsString(X_QPID_TRACE);
- if (trace.empty()) {
- headers.setString(X_QPID_TRACE, id);
- } else if (trace.find(id) == std::string::npos) {
- trace += ",";
- trace += id;
- headers.setString(X_QPID_TRACE, trace);
- }
- }
-}
-
-void Message::setTimestamp()
-{
- DeliveryProperties* props = getProperties<DeliveryProperties>();
- //Spec states that timestamp should be set, evaluate the
- //performance impact before re-enabling this:
- //time_t now = ::time(0);
- //props->setTimestamp(now);
- if (props->getTtl()) {
- //set expiration (nb: ttl is in millisecs, time_t is in secs)
- time_t now = ::time(0);
- props->setExpiration(now + (props->getTtl()/1000));
- expiration = AbsTime(AbsTime::now(), Duration(props->getTtl() * TIME_MSEC));
- }
-}
-
-bool Message::hasExpired() const
-{
- return expiration < FAR_FUTURE && expiration < AbsTime::now();
-}
-
-boost::intrusive_ptr<Message>& Message::getReplacementMessage(const Queue* qfor) const
-{
- Replacement::iterator i = replacement.find(qfor);
- if (i != replacement.end()){
- return i->second;
- }
- return empty;
-}
-
-void Message::setReplacementMessage(boost::intrusive_ptr<Message> msg, const Queue* qfor)
-{
- replacement[qfor] = msg;
-}
-
-void Message::allEnqueuesComplete() {
- MessageCallback* cb = 0;
- {
- sys::Mutex::ScopedLock l(lock);
- std::swap(cb, enqueueCallback);
- }
- if (cb && *cb) (*cb)(intrusive_ptr<Message>(this));
-}
-
-void Message::allDequeuesComplete() {
- MessageCallback* cb = 0;
- {
- sys::Mutex::ScopedLock l(lock);
- std::swap(cb, dequeueCallback);
- }
- if (cb && *cb) (*cb)(intrusive_ptr<Message>(this));
-}
-
-void Message::setEnqueueCompleteCallback(MessageCallback& cb) { enqueueCallback = &cb; }
-void Message::resetEnqueueCompleteCallback() { enqueueCallback = 0; }
-
-void Message::setDequeueCompleteCallback(MessageCallback& cb) { dequeueCallback = &cb; }
-void Message::resetDequeueCompleteCallback() { dequeueCallback = 0; }
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Message.h b/M4-RCs/qpid/cpp/src/qpid/broker/Message.h
deleted file mode 100644
index bed191fb8d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Message.h
+++ /dev/null
@@ -1,185 +0,0 @@
-#ifndef _broker_Message_h
-#define _broker_Message_h
-
-/*
- *
- * 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 "PersistableMessage.h"
-#include "MessageAdapter.h"
-#include "qpid/framing/amqp_types.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/Time.h"
-#include "qpid/shared_ptr.h"
-#include <boost/function.hpp>
-#include <string>
-#include <vector>
-
-namespace qpid {
-
-namespace framing {
-class FieldTable;
-class SequenceNumber;
-}
-
-namespace broker {
-class ConnectionToken;
-class Exchange;
-class ExchangeRegistry;
-class MessageStore;
-class Queue;
-
-class Message : public PersistableMessage {
-public:
- typedef boost::function<void (const boost::intrusive_ptr<Message>&)> MessageCallback;
-
- Message(const framing::SequenceNumber& id = framing::SequenceNumber());
- ~Message();
-
- uint64_t getPersistenceId() const { return persistenceId; }
- void setPersistenceId(uint64_t _persistenceId) const { persistenceId = _persistenceId; }
-
- bool getRedelivered() const { return redelivered; }
- void redeliver() { redelivered = true; }
-
- const ConnectionToken* getPublisher() const { return publisher; }
- void setPublisher(ConnectionToken* p) { publisher = p; }
-
- const framing::SequenceNumber& getCommandId() { return frames.getId(); }
-
- uint64_t contentSize() const;
-
- std::string getRoutingKey() const;
- const boost::shared_ptr<Exchange> getExchange(ExchangeRegistry&) const;
- std::string getExchangeName() const;
- bool isImmediate() const;
- const framing::FieldTable* getApplicationHeaders() const;
- bool isPersistent();
- bool requiresAccept();
- void setTimestamp();
- bool hasExpired() const;
-
- framing::FrameSet& getFrames() { return frames; }
- const framing::FrameSet& getFrames() const { return frames; }
-
- template <class T> T* getProperties() {
- qpid::framing::AMQHeaderBody* p = frames.getHeaders();
- return p->get<T>(true);
- }
-
- template <class T> const T* getProperties() const {
- qpid::framing::AMQHeaderBody* p = frames.getHeaders();
- return p->get<T>(true);
- }
-
- template <class T> const T* hasProperties() const {
- const qpid::framing::AMQHeaderBody* p = frames.getHeaders();
- return p->get<T>();
- }
-
- template <class T> const T* getMethod() const {
- return frames.as<T>();
- }
-
- template <class T> bool isA() const {
- return frames.isA<T>();
- }
-
- uint32_t getRequiredCredit() const;
-
- void encode(framing::Buffer& buffer) const;
- void encodeContent(framing::Buffer& buffer) const;
-
- /**
- * @returns the size of the buffer needed to encode this
- * message in its entirety
- */
- uint32_t encodedSize() const;
- /**
- * @returns the size of the buffer needed to encode the
- * 'header' of this message (not just the header frame,
- * but other meta data e.g.routing key and exchange)
- */
- uint32_t encodedHeaderSize() const;
- uint32_t encodedContentSize() const;
-
- void decodeHeader(framing::Buffer& buffer);
- void decodeContent(framing::Buffer& buffer);
-
- /**
- * Releases the in-memory content data held by this
- * message. Must pass in a store from which the data can
- * be reloaded.
- */
- void releaseContent(MessageStore* store);
- void destroy();
-
- void sendContent(Queue& queue, framing::FrameHandler& out, uint16_t maxFrameSize) const;
- void sendHeader(framing::FrameHandler& out, uint16_t maxFrameSize) const;
-
- bool isContentLoaded() const;
-
- bool isExcluded(const std::vector<std::string>& excludes) const;
- void addTraceId(const std::string& id);
-
- void forcePersistent();
-
- boost::intrusive_ptr<Message>& getReplacementMessage(const Queue* qfor) const;
- void setReplacementMessage(boost::intrusive_ptr<Message> msg, const Queue* qfor);
-
- /** Call cb when enqueue is complete, may call immediately. Holds cb by reference. */
- void setEnqueueCompleteCallback(MessageCallback& cb);
- void resetEnqueueCompleteCallback();
-
- /** Call cb when dequeue is complete, may call immediately. Holds cb by reference. */
- void setDequeueCompleteCallback(MessageCallback& cb);
- void resetDequeueCompleteCallback();
-
- private:
- typedef std::map<const Queue*,boost::intrusive_ptr<Message> > Replacement;
-
- MessageAdapter& getAdapter() const;
- void allEnqueuesComplete();
- void allDequeuesComplete();
-
- mutable sys::Mutex lock;
- framing::FrameSet frames;
- mutable boost::shared_ptr<Exchange> exchange;
- mutable uint64_t persistenceId;
- bool redelivered;
- bool loaded;
- bool staged;
- bool forcePersistentPolicy; // used to force message as durable, via a broker policy
- ConnectionToken* publisher;
- mutable MessageAdapter* adapter;
- qpid::sys::AbsTime expiration;
-
- static TransferAdapter TRANSFER;
-
- mutable Replacement replacement;
- mutable boost::intrusive_ptr<Message> empty;
- MessageCallback* enqueueCallback;
- MessageCallback* dequeueCallback;
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/MessageAdapter.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/MessageAdapter.cpp
deleted file mode 100644
index 12f01494de..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/MessageAdapter.cpp
+++ /dev/null
@@ -1,70 +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 "MessageAdapter.h"
-
-#include "qpid/framing/DeliveryProperties.h"
-#include "qpid/framing/MessageProperties.h"
-#include "qpid/framing/MessageTransferBody.h"
-
-namespace {
- const std::string empty;
-}
-
-namespace qpid {
-namespace broker{
-
- std::string TransferAdapter::getRoutingKey(const framing::FrameSet& f)
- {
- const framing::DeliveryProperties* p = f.getHeaders()->get<framing::DeliveryProperties>();
- return p ? p->getRoutingKey() : empty;
- }
-
- std::string TransferAdapter::getExchange(const framing::FrameSet& f)
- {
- return f.as<framing::MessageTransferBody>()->getDestination();
- }
-
- bool TransferAdapter::isImmediate(const framing::FrameSet&)
- {
- //TODO: delete this, immediate is no longer part of the spec
- return false;
- }
-
- const framing::FieldTable* TransferAdapter::getApplicationHeaders(const framing::FrameSet& f)
- {
- const framing::MessageProperties* p = f.getHeaders()->get<framing::MessageProperties>();
- return p ? &(p->getApplicationHeaders()) : 0;
- }
-
- bool TransferAdapter::isPersistent(const framing::FrameSet& f)
- {
- const framing::DeliveryProperties* p = f.getHeaders()->get<framing::DeliveryProperties>();
- return p && p->getDeliveryMode() == 2;
- }
-
- bool TransferAdapter::requiresAccept(const framing::FrameSet& f)
- {
- const framing::MessageTransferBody* b = f.as<framing::MessageTransferBody>();
- return b && b->getAcceptMode() == 0/*EXPLICIT == 0*/;
- }
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/MessageAdapter.h b/M4-RCs/qpid/cpp/src/qpid/broker/MessageAdapter.h
deleted file mode 100644
index 61a1bc4794..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/MessageAdapter.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _broker_MessageAdapter_h
-#define _broker_MessageAdapter_h
-
-/*
- *
- * 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 <string>
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/FrameSet.h"
-
-namespace qpid {
-namespace broker {
-
-// TODO aconway 2007-11-09: No longer needed, we only have one type of message.
-struct MessageAdapter
-{
- virtual ~MessageAdapter() {}
-
- virtual std::string getRoutingKey(const framing::FrameSet& f) = 0;
- virtual std::string getExchange(const framing::FrameSet& f) = 0;
- virtual bool isImmediate(const framing::FrameSet& f) = 0;
- virtual const framing::FieldTable* getApplicationHeaders(const framing::FrameSet& f) = 0;
- virtual bool isPersistent(const framing::FrameSet& f) = 0;
- virtual bool requiresAccept(const framing::FrameSet& f) = 0;
-};
-
-struct TransferAdapter : MessageAdapter
-{
- virtual std::string getRoutingKey(const framing::FrameSet& f);
- virtual std::string getExchange(const framing::FrameSet& f);
- virtual const framing::FieldTable* getApplicationHeaders(const framing::FrameSet& f);
- virtual bool isPersistent(const framing::FrameSet& f);
- bool isImmediate(const framing::FrameSet&);
- bool requiresAccept(const framing::FrameSet& f);
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/MessageBuilder.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/MessageBuilder.cpp
deleted file mode 100644
index 8f0e3344d5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/MessageBuilder.cpp
+++ /dev/null
@@ -1,128 +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 "MessageBuilder.h"
-
-#include "Message.h"
-#include "MessageStore.h"
-#include "NullMessageStore.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/reply_exceptions.h"
-
-using boost::intrusive_ptr;
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-namespace
-{
- std::string type_str(uint8_t type);
-}
-MessageBuilder::MessageBuilder(MessageStore* const _store, uint64_t _stagingThreshold) :
- state(DORMANT), store(_store), stagingThreshold(_stagingThreshold), staging(false) {}
-
-void MessageBuilder::handle(AMQFrame& frame)
-{
- uint8_t type = frame.getBody()->type();
- switch(state) {
- case METHOD:
- checkType(METHOD_BODY, type);
- state = HEADER;
- break;
- case HEADER:
- if (type == CONTENT_BODY) {
- //TODO: rethink how to handle non-existent headers(?)...
- //didn't get a header: add in a dummy
- AMQFrame header;
- header.setBody(AMQHeaderBody());
- header.setBof(false);
- header.setEof(false);
- message->getFrames().append(header);
- } else if (type != HEADER_BODY) {
- throw CommandInvalidException(
- QPID_MSG("Invalid frame sequence for message, expected header or content got "
- << type_str(type) << ")"));
- }
- state = CONTENT;
- break;
- case CONTENT:
- checkType(CONTENT_BODY, type);
- break;
- default:
- throw CommandInvalidException(QPID_MSG("Invalid frame sequence for message (state=" << state << ")"));
- }
- if (staging) {
- intrusive_ptr<const PersistableMessage> cpmsg = boost::static_pointer_cast<const PersistableMessage>(message);
- store->appendContent(cpmsg, frame.castBody<AMQContentBody>()->getData());
- } else {
- message->getFrames().append(frame);
- //have we reached the staging limit? if so stage message and release content
- if (state == CONTENT
- && stagingThreshold
- && message->getFrames().getContentSize() >= stagingThreshold
- && !NullMessageStore::isNullStore(store))
- {
- message->releaseContent(store);
- staging = true;
- }
- }
-}
-
-void MessageBuilder::end()
-{
- message = 0;
- state = DORMANT;
- staging = false;
-}
-
-void MessageBuilder::start(const SequenceNumber& id)
-{
- message = intrusive_ptr<Message>(new Message(id));
- state = METHOD;
- staging = false;
-}
-
-namespace {
-
-const std::string HEADER_BODY_S = "HEADER";
-const std::string METHOD_BODY_S = "METHOD";
-const std::string CONTENT_BODY_S = "CONTENT";
-const std::string HEARTBEAT_BODY_S = "HEARTBEAT";
-const std::string UNKNOWN = "unknown";
-
-std::string type_str(uint8_t type)
-{
- switch(type) {
- case METHOD_BODY: return METHOD_BODY_S;
- case HEADER_BODY: return HEADER_BODY_S;
- case CONTENT_BODY: return CONTENT_BODY_S;
- case HEARTBEAT_BODY: return HEARTBEAT_BODY_S;
- }
- return UNKNOWN;
-}
-
-}
-
-void MessageBuilder::checkType(uint8_t expected, uint8_t actual)
-{
- if (expected != actual) {
- throw CommandInvalidException(QPID_MSG("Invalid frame sequence for message (expected "
- << type_str(expected) << " got " << type_str(actual) << ")"));
- }
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/MessageBuilder.h b/M4-RCs/qpid/cpp/src/qpid/broker/MessageBuilder.h
deleted file mode 100644
index 395de024ab..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/MessageBuilder.h
+++ /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.
- *
- */
-#ifndef _MessageBuilder_
-#define _MessageBuilder_
-
-#include "qpid/framing/FrameHandler.h"
-#include "qpid/framing/SequenceNumber.h"
-#include "qpid/RefCounted.h"
-
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
- namespace broker {
- class Message;
- class MessageStore;
-
- class MessageBuilder : public framing::FrameHandler{
- public:
- MessageBuilder(MessageStore* const store, uint64_t stagingThreshold);
- void handle(framing::AMQFrame& frame);
- boost::intrusive_ptr<Message> getMessage() { return message; }
- void start(const framing::SequenceNumber& id);
- void end();
- private:
- enum State {DORMANT, METHOD, HEADER, CONTENT};
- State state;
- boost::intrusive_ptr<Message> message;
- MessageStore* const store;
- const uint64_t stagingThreshold;
- bool staging;
-
- void checkType(uint8_t expected, uint8_t actual);
- };
- }
-}
-
-
-#endif
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/MessageStore.h b/M4-RCs/qpid/cpp/src/qpid/broker/MessageStore.h
deleted file mode 100644
index 4c4c21dfba..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/MessageStore.h
+++ /dev/null
@@ -1,199 +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.
- *
- */
-#ifndef _MessageStore_
-#define _MessageStore_
-
-#include "PersistableExchange.h"
-#include "PersistableMessage.h"
-#include "PersistableQueue.h"
-#include "PersistableConfig.h"
-#include "RecoveryManager.h"
-#include "TransactionalStore.h"
-#include "qpid/framing/FieldTable.h"
-
-#include <qpid/Options.h>
-
-#include <boost/shared_ptr.hpp>
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-
-/**
- * An abstraction of the persistent storage for messages. (In
- * all methods, any pointers/references to queues or messages
- * are valid only for the duration of the call).
- */
-class MessageStore : public TransactionalStore, public Recoverable {
- public:
-
- /**
- * init the store, call before any other call. If not called, store
- * is free to pick any defaults
- *
- * @param options Options object provided by concrete store plug in.
- */
- virtual bool init(const Options* options) = 0;
-
- /**
- * Record the existence of a durable queue
- */
- virtual void create(PersistableQueue& queue,
- const framing::FieldTable& args) = 0;
- /**
- * Destroy a durable queue
- */
- virtual void destroy(PersistableQueue& queue) = 0;
-
- /**
- * Record the existence of a durable exchange
- */
- virtual void create(const PersistableExchange& exchange,
- const framing::FieldTable& args) = 0;
- /**
- * Destroy a durable exchange
- */
- virtual void destroy(const PersistableExchange& exchange) = 0;
-
- /**
- * Record a binding
- */
- virtual void bind(const PersistableExchange& exchange, const PersistableQueue& queue,
- const std::string& key, const framing::FieldTable& args) = 0;
-
- /**
- * Forget a binding
- */
- virtual void unbind(const PersistableExchange& exchange, const PersistableQueue& queue,
- const std::string& key, const framing::FieldTable& args) = 0;
-
- /**
- * Record generic durable configuration
- */
- virtual void create(const PersistableConfig& config) = 0;
-
- /**
- * Destroy generic durable configuration
- */
- virtual void destroy(const PersistableConfig& config) = 0;
-
- /**
- * Stores a messages before it has been enqueued
- * (enqueueing automatically stores the message so this is
- * only required if storage is required prior to that
- * point). If the message has not yet been stored it will
- * store the headers as well as any content passed in. A
- * persistence id will be set on the message which can be
- * used to load the content or to append to it.
- */
- virtual void stage(const boost::intrusive_ptr<PersistableMessage>& msg) = 0;
-
- /**
- * Destroys a previously staged message. This only needs
- * to be called if the message is never enqueued. (Once
- * enqueued, deletion will be automatic when the message
- * is dequeued from all queues it was enqueued onto).
- */
- virtual void destroy(PersistableMessage& msg) = 0;
-
- /**
- * Appends content to a previously staged message
- */
- virtual void appendContent(const boost::intrusive_ptr<const PersistableMessage>& msg,
- const std::string& data) = 0;
-
- /**
- * Loads (a section) of content data for the specified
- * message (previously stored through a call to stage or
- * enqueue) into data. The offset refers to the content
- * only (i.e. an offset of 0 implies that the start of the
- * content should be loaded, not the headers or related
- * meta-data).
- */
- virtual void loadContent(const qpid::broker::PersistableQueue& queue,
- const boost::intrusive_ptr<const PersistableMessage>& msg,
- std::string& data, uint64_t offset, uint32_t length) = 0;
-
- /**
- * Enqueues a message, storing the message if it has not
- * been previously stored and recording that the given
- * message is on the given queue.
- *
- * Note: that this is async so the return of the function does
- * not mean the opperation is complete.
- *
- * @param msg the message to enqueue
- * @param queue the name of the queue onto which it is to be enqueued
- * @param xid (a pointer to) an identifier of the
- * distributed transaction in which the operation takes
- * place or null for 'local' transactions
- */
- virtual void enqueue(TransactionContext* ctxt,
- const boost::intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue& queue) = 0;
-
- /**
- * Dequeues a message, recording that the given message is
- * no longer on the given queue and deleting the message
- * if it is no longer on any other queue.
- *
- * Note: that this is async so the return of the function does
- * not mean the opperation is complete.
- *
- * @param msg the message to dequeue
- * @param queue the name of the queue from which it is to be dequeued
- * @param xid (a pointer to) an identifier of the
- * distributed transaction in which the operation takes
- * place or null for 'local' transactions
- */
- virtual void dequeue(TransactionContext* ctxt,
- const boost::intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue& queue) = 0;
-
- /**
- * Flushes all async messages to disk for the specified queue
- *
- * Note: that this is async so the return of the function does
- * not mean the opperation is complete.
- *
- * @param queue the name of the queue from which it is to be dequeued
- */
- virtual void flush(const qpid::broker::PersistableQueue& queue)=0;
-
- /**
- * Returns the number of outstanding AIO's for a given queue
- *
- * If 0, than all the enqueue / dequeues have been stored
- * to disk
- *
- * @param queue the name of the queue to check for outstanding AIO
- */
- virtual uint32_t outstandingQueueAIO(const PersistableQueue& queue) = 0;
-
-
- virtual ~MessageStore(){}
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp
deleted file mode 100644
index 96186d508b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp
+++ /dev/null
@@ -1,174 +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 "MessageStoreModule.h"
-#include "NullMessageStore.h"
-#include <iostream>
-
-// This transfer protects against the unloading of the store lib prior to the handling of the exception
-#define TRANSFER_EXCEPTION(fn) try { fn; } catch (std::exception& e) { throw Exception(e.what()); }
-
-using boost::intrusive_ptr;
-using qpid::framing::FieldTable;
-
-namespace qpid {
-namespace broker {
-
-MessageStoreModule::MessageStoreModule(MessageStore* _store) : store(_store) {}
-
-MessageStoreModule::~MessageStoreModule()
-{
- delete store;
-}
-
-bool MessageStoreModule::init(const Options*) { return true; }
-
-void MessageStoreModule::create(PersistableQueue& queue, const FieldTable& args)
-{
- TRANSFER_EXCEPTION(store->create(queue, args));
-}
-
-void MessageStoreModule::destroy(PersistableQueue& queue)
-{
- TRANSFER_EXCEPTION(store->destroy(queue));
-}
-
-void MessageStoreModule::create(const PersistableExchange& exchange, const FieldTable& args)
-{
- TRANSFER_EXCEPTION(store->create(exchange, args));
-}
-
-void MessageStoreModule::destroy(const PersistableExchange& exchange)
-{
- TRANSFER_EXCEPTION(store->destroy(exchange));
-}
-
-void MessageStoreModule::bind(const PersistableExchange& e, const PersistableQueue& q,
- const std::string& k, const framing::FieldTable& a)
-{
- TRANSFER_EXCEPTION(store->bind(e, q, k, a));
-}
-
-void MessageStoreModule::unbind(const PersistableExchange& e, const PersistableQueue& q,
- const std::string& k, const framing::FieldTable& a)
-{
- TRANSFER_EXCEPTION(store->unbind(e, q, k, a));
-}
-
-void MessageStoreModule::create(const PersistableConfig& config)
-{
- TRANSFER_EXCEPTION(store->create(config));
-}
-
-void MessageStoreModule::destroy(const PersistableConfig& config)
-{
- TRANSFER_EXCEPTION(store->destroy(config));
-}
-
-void MessageStoreModule::recover(RecoveryManager& registry)
-{
- TRANSFER_EXCEPTION(store->recover(registry));
-}
-
-void MessageStoreModule::stage(const intrusive_ptr<PersistableMessage>& msg)
-{
- TRANSFER_EXCEPTION(store->stage(msg));
-}
-
-void MessageStoreModule::destroy(PersistableMessage& msg)
-{
- TRANSFER_EXCEPTION(store->destroy(msg));
-}
-
-void MessageStoreModule::appendContent(const intrusive_ptr<const PersistableMessage>& msg,
- const std::string& data)
-{
- TRANSFER_EXCEPTION(store->appendContent(msg, data));
-}
-
-void MessageStoreModule::loadContent(
- const qpid::broker::PersistableQueue& queue,
- const intrusive_ptr<const PersistableMessage>& msg,
- string& data, uint64_t offset, uint32_t length)
-{
- TRANSFER_EXCEPTION(store->loadContent(queue, msg, data, offset, length));
-}
-
-void MessageStoreModule::enqueue(TransactionContext* ctxt,
- const intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue& queue)
-{
- TRANSFER_EXCEPTION(store->enqueue(ctxt, msg, queue));
-}
-
-void MessageStoreModule::dequeue(TransactionContext* ctxt,
- const intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue& queue)
-{
- TRANSFER_EXCEPTION(store->dequeue(ctxt, msg, queue));
-}
-
-void MessageStoreModule::flush(const qpid::broker::PersistableQueue& queue)
-{
- TRANSFER_EXCEPTION(store->flush(queue));
-}
-
-uint32_t MessageStoreModule::outstandingQueueAIO(const PersistableQueue& queue)
-{
- TRANSFER_EXCEPTION(return store->outstandingQueueAIO(queue));
-}
-
-std::auto_ptr<TransactionContext> MessageStoreModule::begin()
-{
- TRANSFER_EXCEPTION(return store->begin());
-}
-
-std::auto_ptr<TPCTransactionContext> MessageStoreModule::begin(const std::string& xid)
-{
- TRANSFER_EXCEPTION(return store->begin(xid));
-}
-
-void MessageStoreModule::prepare(TPCTransactionContext& txn)
-{
- TRANSFER_EXCEPTION(store->prepare(txn));
-}
-
-void MessageStoreModule::commit(TransactionContext& ctxt)
-{
- TRANSFER_EXCEPTION(store->commit(ctxt));
-}
-
-void MessageStoreModule::abort(TransactionContext& ctxt)
-{
- TRANSFER_EXCEPTION(store->abort(ctxt));
-}
-
-void MessageStoreModule::collectPreparedXids(std::set<std::string>& xids)
-{
- TRANSFER_EXCEPTION(store->collectPreparedXids(xids));
-}
-
-bool MessageStoreModule::isNull() const
-{
- return NullMessageStore::isNullStore(store);
-}
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/MessageStoreModule.h b/M4-RCs/qpid/cpp/src/qpid/broker/MessageStoreModule.h
deleted file mode 100644
index 0b51610a46..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/MessageStoreModule.h
+++ /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.
- *
- */
-#ifndef _MessageStoreModule_
-#define _MessageStoreModule_
-
-#include "MessageStore.h"
-#include "Queue.h"
-#include "RecoveryManager.h"
-
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-
-/**
- * A null implementation of the MessageStore interface
- */
-class MessageStoreModule : public MessageStore
-{
- MessageStore* store;
- public:
- MessageStoreModule(MessageStore* store);
-
- bool init(const Options* options);
- std::auto_ptr<TransactionContext> begin();
- std::auto_ptr<TPCTransactionContext> begin(const std::string& xid);
- void prepare(TPCTransactionContext& txn);
- void commit(TransactionContext& txn);
- void abort(TransactionContext& txn);
- void collectPreparedXids(std::set<std::string>& xids);
-
- void create(PersistableQueue& queue, const framing::FieldTable& args);
- void destroy(PersistableQueue& queue);
- void create(const PersistableExchange& exchange, const framing::FieldTable& args);
- void destroy(const PersistableExchange& exchange);
- void bind(const PersistableExchange& exchange, const PersistableQueue& queue,
- const std::string& key, const framing::FieldTable& args);
- void unbind(const PersistableExchange& exchange, const PersistableQueue& queue,
- const std::string& key, const framing::FieldTable& args);
- void create(const PersistableConfig& config);
- void destroy(const PersistableConfig& config);
- void recover(RecoveryManager& queues);
- void stage(const boost::intrusive_ptr<PersistableMessage>& msg);
- void destroy(PersistableMessage& msg);
- void appendContent(const boost::intrusive_ptr<const PersistableMessage>& msg, const std::string& data);
- void loadContent(const qpid::broker::PersistableQueue& queue,
- const boost::intrusive_ptr<const PersistableMessage>& msg, std::string& data,
- uint64_t offset, uint32_t length);
-
- void enqueue(TransactionContext* ctxt,
- const boost::intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue& queue);
- void dequeue(TransactionContext* ctxt,
- const boost::intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue& queue);
- uint32_t outstandingQueueAIO(const PersistableQueue& queue);
- void flush(const qpid::broker::PersistableQueue& queue);
- bool isNull() const;
-
- ~MessageStoreModule();
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/NameGenerator.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/NameGenerator.cpp
deleted file mode 100644
index 8484f921e9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/NameGenerator.cpp
+++ /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.
- *
- */
-#include "NameGenerator.h"
-#include <sstream>
-
-using namespace qpid::broker;
-
-NameGenerator::NameGenerator(const std::string& _base) : base(_base), counter(1) {}
-
-std::string NameGenerator::generate(){
- std::stringstream ss;
- ss << base << counter++;
- return ss.str();
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/NameGenerator.h b/M4-RCs/qpid/cpp/src/qpid/broker/NameGenerator.h
deleted file mode 100644
index 6ea25c9797..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/NameGenerator.h
+++ /dev/null
@@ -1,39 +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.
- *
- */
-#ifndef _NameGenerator_
-#define _NameGenerator_
-
-#include <string>
-
-namespace qpid {
- namespace broker {
- class NameGenerator{
- const std::string base;
- unsigned int counter;
- public:
- NameGenerator(const std::string& base);
- std::string generate();
- };
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/NullMessageStore.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/NullMessageStore.cpp
deleted file mode 100644
index ad0143ce43..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/NullMessageStore.cpp
+++ /dev/null
@@ -1,166 +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 "NullMessageStore.h"
-#include "MessageStoreModule.h"
-#include "RecoveryManager.h"
-#include "qpid/log/Statement.h"
-#include "qpid/framing/reply_exceptions.h"
-
-#include <iostream>
-
-using boost::intrusive_ptr;
-
-namespace qpid{
-namespace broker{
-
-const std::string nullxid = "";
-
-class SimpleDummyCtxt : public TransactionContext {};
-
-class DummyCtxt : public TPCTransactionContext
-{
- const std::string xid;
-public:
- DummyCtxt(const std::string& _xid) : xid(_xid) {}
- static std::string getXid(TransactionContext& ctxt)
- {
- DummyCtxt* c(dynamic_cast<DummyCtxt*>(&ctxt));
- return c ? c->xid : nullxid;
- }
-};
-
-NullMessageStore::NullMessageStore() : nextPersistenceId(1) {
- QPID_LOG(info, "No message store configured, persistence is disabled.")
-}
-
-bool NullMessageStore::init(const Options* /*options*/) {return true;}
-
-void NullMessageStore::create(PersistableQueue& queue, const framing::FieldTable& /*args*/)
-{
- queue.setPersistenceId(nextPersistenceId++);
-}
-
-void NullMessageStore::destroy(PersistableQueue&)
-{
-}
-
-void NullMessageStore::create(const PersistableExchange& exchange, const framing::FieldTable& /*args*/)
-{
- exchange.setPersistenceId(nextPersistenceId++);
-}
-
-void NullMessageStore::destroy(const PersistableExchange& )
-{}
-
-void NullMessageStore::bind(const PersistableExchange&, const PersistableQueue&, const std::string&, const framing::FieldTable&){}
-
-void NullMessageStore::unbind(const PersistableExchange&, const PersistableQueue&, const std::string&, const framing::FieldTable&){}
-
-void NullMessageStore::create(const PersistableConfig& config)
-{
- config.setPersistenceId(nextPersistenceId++);
-}
-
-void NullMessageStore::destroy(const PersistableConfig&) {}
-
-void NullMessageStore::recover(RecoveryManager&) {}
-
-void NullMessageStore::stage(const intrusive_ptr<PersistableMessage>&) {}
-
-void NullMessageStore::destroy(PersistableMessage&) {}
-
-void NullMessageStore::appendContent(const intrusive_ptr<const PersistableMessage>&, const string&) {}
-
-void NullMessageStore::loadContent(const qpid::broker::PersistableQueue&,
- const intrusive_ptr<const PersistableMessage>&,
- string&, uint64_t, uint32_t)
-{
- throw qpid::framing::InternalErrorException("Can't load content; persistence not enabled");
-}
-
-void NullMessageStore::enqueue(TransactionContext*,
- const intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue&)
-{
- msg->enqueueComplete();
-}
-
-void NullMessageStore::dequeue(TransactionContext*,
- const intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue&)
-{
- msg->dequeueComplete();
-}
-
-void NullMessageStore::flush(const qpid::broker::PersistableQueue&) {}
-
-uint32_t NullMessageStore::outstandingQueueAIO(const PersistableQueue& ) {
- return 0;
-}
-
-std::auto_ptr<TransactionContext> NullMessageStore::begin()
-{
- return std::auto_ptr<TransactionContext>(new SimpleDummyCtxt());
-}
-
-std::auto_ptr<TPCTransactionContext> NullMessageStore::begin(const std::string& xid)
-{
- return std::auto_ptr<TPCTransactionContext>(new DummyCtxt(xid));
-}
-
-void NullMessageStore::prepare(TPCTransactionContext& ctxt)
-{
- prepared.insert(DummyCtxt::getXid(ctxt));
-}
-
-void NullMessageStore::commit(TransactionContext& ctxt)
-{
- prepared.erase(DummyCtxt::getXid(ctxt));
-}
-
-void NullMessageStore::abort(TransactionContext& ctxt)
-{
- prepared.erase(DummyCtxt::getXid(ctxt));
-}
-
-void NullMessageStore::collectPreparedXids(std::set<string>& out)
-{
- out.insert(prepared.begin(), prepared.end());
-}
-
-bool NullMessageStore::isNull() const
-{
- return true;
-}
-
-bool NullMessageStore::isNullStore(const MessageStore* store)
-{
- const MessageStoreModule* wrapper = dynamic_cast<const MessageStoreModule*>(store);
- if (wrapper) {
- return wrapper->isNull();
- } else {
- const NullMessageStore* test = dynamic_cast<const NullMessageStore*>(store);
- return test && test->isNull();
- }
-}
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/NullMessageStore.h b/M4-RCs/qpid/cpp/src/qpid/broker/NullMessageStore.h
deleted file mode 100644
index d99c751d26..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/NullMessageStore.h
+++ /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.
- *
- */
-#ifndef _NullMessageStore_
-#define _NullMessageStore_
-
-#include <set>
-#include "MessageStore.h"
-#include "Queue.h"
-
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-
-/**
- * A null implementation of the MessageStore interface
- */
-class NullMessageStore : public MessageStore
-{
- std::set<std::string> prepared;
- uint64_t nextPersistenceId;
- public:
- NullMessageStore();
-
- virtual bool init(const Options* options);
- virtual std::auto_ptr<TransactionContext> begin();
- virtual std::auto_ptr<TPCTransactionContext> begin(const std::string& xid);
- virtual void prepare(TPCTransactionContext& txn);
- virtual void commit(TransactionContext& txn);
- virtual void abort(TransactionContext& txn);
- virtual void collectPreparedXids(std::set<std::string>& xids);
-
- virtual void create(PersistableQueue& queue, const framing::FieldTable& args);
- virtual void destroy(PersistableQueue& queue);
- virtual void create(const PersistableExchange& exchange, const framing::FieldTable& args);
- virtual void destroy(const PersistableExchange& exchange);
-
- virtual void bind(const PersistableExchange& exchange, const PersistableQueue& queue,
- const std::string& key, const framing::FieldTable& args);
- virtual void unbind(const PersistableExchange& exchange, const PersistableQueue& queue,
- const std::string& key, const framing::FieldTable& args);
- virtual void create(const PersistableConfig& config);
- virtual void destroy(const PersistableConfig& config);
- virtual void recover(RecoveryManager& queues);
- virtual void stage(const boost::intrusive_ptr<PersistableMessage>& msg);
- virtual void destroy(PersistableMessage& msg);
- virtual void appendContent(const boost::intrusive_ptr<const PersistableMessage>& msg,
- const std::string& data);
- virtual void loadContent(const qpid::broker::PersistableQueue& queue,
- const boost::intrusive_ptr<const PersistableMessage>& msg, std::string& data,
- uint64_t offset, uint32_t length);
- virtual void enqueue(TransactionContext* ctxt,
- const boost::intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue& queue);
- virtual void dequeue(TransactionContext* ctxt,
- const boost::intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue& queue);
- virtual uint32_t outstandingQueueAIO(const PersistableQueue& queue);
- virtual void flush(const qpid::broker::PersistableQueue& queue);
- ~NullMessageStore(){}
-
- virtual bool isNull() const;
- static bool isNullStore(const MessageStore*);
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/OwnershipToken.h b/M4-RCs/qpid/cpp/src/qpid/broker/OwnershipToken.h
deleted file mode 100644
index effd2f5b3c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/OwnershipToken.h
+++ /dev/null
@@ -1,38 +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.
- *
- */
-#ifndef _OwnershipToken_
-#define _OwnershipToken_
-
-namespace qpid {
-namespace broker {
-
-class ConnectionToken;
-
-class OwnershipToken{
-public:
- virtual bool isLocal(const ConnectionToken* t) const = 0;
- virtual ~OwnershipToken(){}
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Persistable.h b/M4-RCs/qpid/cpp/src/qpid/broker/Persistable.h
deleted file mode 100644
index 36499c7a1a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Persistable.h
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef _broker_Persistable_h
-#define _broker_Persistable_h
-
-/*
- *
- * 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 "qpid/framing/amqp_types.h"
-#include "qpid/framing/Buffer.h"
-#include "qpid/RefCounted.h"
-
-namespace qpid {
-namespace broker {
-
-/**
- * Base class for all persistable objects
- */
-class Persistable : public RefCounted
-{
-public:
- /**
- * Allows the store to attach its own identifier to this object
- */
- virtual void setPersistenceId(uint64_t id) const = 0;
- /**
- * Returns any identifier the store may have attached to this
- * object
- */
- virtual uint64_t getPersistenceId() const = 0;
- /**
- * Encodes the persistable state of this object into the supplied
- * buffer
- */
- virtual void encode(framing::Buffer& buffer) const = 0;
- /**
- * @returns the size of the buffer needed to encode this object
- */
- virtual uint32_t encodedSize() const = 0;
-
- virtual ~Persistable() {};
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/PersistableConfig.h b/M4-RCs/qpid/cpp/src/qpid/broker/PersistableConfig.h
deleted file mode 100644
index 914e91ea80..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/PersistableConfig.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef _broker_PersistableConfig_h
-#define _broker_PersistableConfig_h
-
-/*
- *
- * 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 <string>
-#include "Persistable.h"
-
-namespace qpid {
-namespace broker {
-
-/**
- * The interface used by general-purpose persistable configuration for
- * the message store.
- */
-class PersistableConfig : public Persistable
-{
-public:
- virtual const std::string& getName() const = 0;
- virtual ~PersistableConfig() {};
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/PersistableExchange.h b/M4-RCs/qpid/cpp/src/qpid/broker/PersistableExchange.h
deleted file mode 100644
index 683b740ddc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/PersistableExchange.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef _broker_PersistableExchange_h
-#define _broker_PersistableExchange_h
-
-/*
- *
- * 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 <string>
-#include "Persistable.h"
-
-namespace qpid {
-namespace broker {
-
-/**
- * The interface exchanges must expose to the MessageStore in order to be
- * persistable.
- */
-class PersistableExchange : public Persistable
-{
-public:
- virtual const std::string& getName() const = 0;
- virtual ~PersistableExchange() {};
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/PersistableMessage.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/PersistableMessage.cpp
deleted file mode 100644
index 4d272c3780..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/PersistableMessage.cpp
+++ /dev/null
@@ -1,143 +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 "PersistableMessage.h"
-#include "MessageStore.h"
-#include <iostream>
-
-using namespace qpid::broker;
-
-namespace qpid {
-namespace broker {
-
-class MessageStore;
-
-PersistableMessage::~PersistableMessage() {}
-
-PersistableMessage::PersistableMessage() :
- asyncEnqueueCounter(0),
- asyncDequeueCounter(0),
- contentReleased(false),
- store(0)
-{}
-
-void PersistableMessage::flush()
-{
- syncList copy;
- {
- sys::ScopedLock<sys::Mutex> l(storeLock);
- if (store) {
- copy = synclist;
- } else {
- return;//early exit as nothing to do
- }
- }
- for (syncList::iterator i = copy.begin(); i != copy.end(); ++i) {
- PersistableQueue::shared_ptr q(i->lock());
- if (q) {
- store->flush(*q);
- }
- }
-}
-
-void PersistableMessage::setContentReleased() {contentReleased = true; }
-
-bool PersistableMessage::isContentReleased()const { return contentReleased; }
-
-bool PersistableMessage::isEnqueueComplete() {
- sys::ScopedLock<sys::Mutex> l(asyncEnqueueLock);
- return asyncEnqueueCounter == 0;
-}
-
-void PersistableMessage::enqueueComplete() {
- bool notify = false;
- {
- sys::ScopedLock<sys::Mutex> l(asyncEnqueueLock);
- if (asyncEnqueueCounter > 0) {
- if (--asyncEnqueueCounter == 0) {
- notify = true;
- }
- }
- }
- if (notify) {
- allEnqueuesComplete();
- sys::ScopedLock<sys::Mutex> l(storeLock);
- if (store) {
- for (syncList::iterator i = synclist.begin(); i != synclist.end(); ++i) {
- PersistableQueue::shared_ptr q(i->lock());
- if (q) q->notifyDurableIOComplete();
- }
- }
- }
-}
-
-void PersistableMessage::enqueueAsync(PersistableQueue::shared_ptr queue, MessageStore* _store) {
- if (_store){
- sys::ScopedLock<sys::Mutex> l(storeLock);
- store = _store;
- boost::weak_ptr<PersistableQueue> q(queue);
- synclist.push_back(q);
- }
- enqueueAsync();
-}
-
-void PersistableMessage::enqueueAsync() {
- sys::ScopedLock<sys::Mutex> l(asyncEnqueueLock);
- asyncEnqueueCounter++;
-}
-
-bool PersistableMessage::isDequeueComplete() {
- sys::ScopedLock<sys::Mutex> l(asyncDequeueLock);
- return asyncDequeueCounter == 0;
-}
-
-void PersistableMessage::dequeueComplete() {
- bool notify = false;
- {
- sys::ScopedLock<sys::Mutex> l(asyncDequeueLock);
- if (asyncDequeueCounter > 0) {
- if (--asyncDequeueCounter == 0) {
- notify = true;
- }
- }
- }
- if (notify) allDequeuesComplete();
-}
-
-void PersistableMessage::dequeueAsync(PersistableQueue::shared_ptr queue, MessageStore* _store) {
- if (_store){
- sys::ScopedLock<sys::Mutex> l(storeLock);
- store = _store;
- boost::weak_ptr<PersistableQueue> q(queue);
- synclist.push_back(q);
- }
- dequeueAsync();
-}
-
-void PersistableMessage::dequeueAsync() {
- sys::ScopedLock<sys::Mutex> l(asyncDequeueLock);
- asyncDequeueCounter++;
-}
-
-}}
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/PersistableMessage.h b/M4-RCs/qpid/cpp/src/qpid/broker/PersistableMessage.h
deleted file mode 100644
index 4f2e3abafa..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/PersistableMessage.h
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef _broker_PersistableMessage_h
-#define _broker_PersistableMessage_h
-
-/*
- *
- * 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 <string>
-#include <list>
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
-#include "Persistable.h"
-#include "qpid/framing/amqp_types.h"
-#include "qpid/sys/Mutex.h"
-#include "PersistableQueue.h"
-
-namespace qpid {
-namespace broker {
-
-class MessageStore;
-
-/**
- * Base class for persistable messages.
- */
-class PersistableMessage : public Persistable
-{
- typedef std::list< boost::weak_ptr<PersistableQueue> > syncList;
- sys::Mutex asyncEnqueueLock;
- sys::Mutex asyncDequeueLock;
- sys::Mutex storeLock;
-
- /**
- * Tracks the number of outstanding asynchronous enqueue
- * operations. When the message is enqueued asynchronously the
- * count is incremented; when that enqueue completes it is
- * decremented. Thus when it is 0, there are no outstanding
- * enqueues.
- */
- int asyncEnqueueCounter;
-
- /**
- * Tracks the number of outstanding asynchronous dequeue
- * operations. When the message is dequeued asynchronously the
- * count is incremented; when that dequeue completes it is
- * decremented. Thus when it is 0, there are no outstanding
- * dequeues.
- */
- int asyncDequeueCounter;
-
- bool contentReleased;
- syncList synclist;
-
- protected:
- /** Called when all enqueues are complete for this message. */
- virtual void allEnqueuesComplete() = 0;
- /** Called when all dequeues are complete for this message. */
- virtual void allDequeuesComplete() = 0;
-
- void setContentReleased();
-
- MessageStore* store;
-
- public:
- typedef boost::shared_ptr<PersistableMessage> shared_ptr;
-
- /**
- * @returns the size of the headers when encoded
- */
- virtual uint32_t encodedHeaderSize() const = 0;
-
- virtual ~PersistableMessage();
-
- PersistableMessage();
-
- void flush();
-
- bool isContentReleased() const;
-
- bool isEnqueueComplete();
-
- void enqueueComplete();
-
- void enqueueAsync(PersistableQueue::shared_ptr queue, MessageStore* _store);
-
- void enqueueAsync();
-
- bool isDequeueComplete();
-
- void dequeueComplete();
-
- void dequeueAsync(PersistableQueue::shared_ptr queue, MessageStore* _store);
-
- void dequeueAsync();
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/PersistableQueue.h b/M4-RCs/qpid/cpp/src/qpid/broker/PersistableQueue.h
deleted file mode 100644
index 9236814ae3..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/PersistableQueue.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef _broker_PersistableQueue_h
-#define _broker_PersistableQueue_h
-
-/*
- *
- * 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 <string>
-#include "Persistable.h"
-#include "qpid/management/Manageable.h"
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-
-
-/**
-* Empty class to be used by any module that wanted to set an external per queue store into
-* persistableQueue
-*/
-
-class ExternalQueueStore : public management::Manageable
-{
-public:
- virtual ~ExternalQueueStore() {};
-
-};
-
-
-/**
- * The interface queues must expose to the MessageStore in order to be
- * persistable.
- */
-class PersistableQueue : public Persistable
-{
-public:
- typedef boost::shared_ptr<PersistableQueue> shared_ptr;
-
- virtual const std::string& getName() const = 0;
- virtual ~PersistableQueue() {
- if (externalQueueStore)
- delete externalQueueStore;
- };
-
- virtual void setExternalQueueStore(ExternalQueueStore* inst) = 0;
-
- inline ExternalQueueStore* getExternalQueueStore() const {return externalQueueStore;};
-
- PersistableQueue():externalQueueStore(NULL){
- };
-
-
- /**
- * call back to signal async AIO writes have
- * completed (enqueue/dequeue etc)
- *
- * Note: DO NOT do work on this callback, if you block
- * this callback you will block the store.
- */
- virtual void notifyDurableIOComplete() = 0;
-protected:
-
- ExternalQueueStore* externalQueueStore;
-
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Queue.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/Queue.cpp
deleted file mode 100644
index 9089ba0c54..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Queue.cpp
+++ /dev/null
@@ -1,900 +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 "Broker.h"
-#include "Queue.h"
-#include "Exchange.h"
-#include "DeliverableMessage.h"
-#include "MessageStore.h"
-#include "NullMessageStore.h"
-#include "QueueRegistry.h"
-
-#include "qpid/StringUtils.h"
-#include "qpid/log/Statement.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/sys/Monitor.h"
-#include "qpid/sys/Time.h"
-#include "qmf/org/apache/qpid/broker/ArgsQueuePurge.h"
-
-#include <iostream>
-#include <algorithm>
-#include <functional>
-
-#include <boost/bind.hpp>
-#include <boost/intrusive_ptr.hpp>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-using namespace qpid::framing;
-using qpid::management::ManagementAgent;
-using qpid::management::ManagementObject;
-using qpid::management::Manageable;
-using qpid::management::Args;
-using std::for_each;
-using std::mem_fun;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-
-namespace
-{
-const std::string qpidMaxSize("qpid.max_size");
-const std::string qpidMaxCount("qpid.max_count");
-const std::string qpidNoLocal("no-local");
-const std::string qpidTraceIdentity("qpid.trace.id");
-const std::string qpidTraceExclude("qpid.trace.exclude");
-const std::string qpidLastValueQueue("qpid.last_value_queue");
-const std::string qpidLastValueQueueNoBrowse("qpid.last_value_queue_no_browse");
-const std::string qpidPersistLastNode("qpid.persist_last_node");
-const std::string qpidVQMatchProperty("qpid.LVQ_key");
-}
-
-
-Queue::Queue(const string& _name, bool _autodelete,
- MessageStore* const _store,
- const OwnershipToken* const _owner,
- Manageable* parent) :
-
- name(_name),
- autodelete(_autodelete),
- store(_store),
- owner(_owner),
- consumerCount(0),
- exclusive(0),
- noLocal(false),
- lastValueQueue(false),
- lastValueQueueNoBrowse(false),
- persistLastNode(false),
- inLastNodeFailure(false),
- persistenceId(0),
- policyExceeded(false),
- mgmtObject(0)
-{
- if (parent != 0)
- {
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
-
- if (agent != 0)
- {
- mgmtObject = new _qmf::Queue(agent, this, parent, _name, _store != 0, _autodelete, _owner != 0);
-
- // Add the object to the management agent only if this queue is not durable.
- // If it's durable, we will add it later when the queue is assigned a persistenceId.
- if (store == 0)
- agent->addObject (mgmtObject);
- }
- }
-}
-
-Queue::~Queue()
-{
- if (mgmtObject != 0)
- mgmtObject->resourceDestroy ();
-}
-
-void Queue::notifyDurableIOComplete()
-{
- QueueListeners::NotificationSet copy;
- {
- Mutex::ScopedLock locker(messageLock);
- listeners.populate(copy);
- }
- copy.notify();
-}
-
-bool isLocalTo(const OwnershipToken* token, boost::intrusive_ptr<Message>& msg)
-{
- return token && token->isLocal(msg->getPublisher());
-}
-
-bool Queue::isLocal(boost::intrusive_ptr<Message>& msg)
-{
- //message is considered local if it was published on the same
- //connection as that of the session which declared this queue
- //exclusive (owner) or which has an exclusive subscription
- //(exclusive)
- return noLocal && (isLocalTo(owner, msg) || isLocalTo(exclusive, msg));
-}
-
-bool Queue::isExcluded(boost::intrusive_ptr<Message>& msg)
-{
- return traceExclude.size() && msg->isExcluded(traceExclude);
-}
-
-void Queue::deliver(boost::intrusive_ptr<Message>& msg){
-
- if (msg->isImmediate() && getConsumerCount() == 0) {
- if (alternateExchange) {
- DeliverableMessage deliverable(msg);
- alternateExchange->route(deliverable, msg->getRoutingKey(), msg->getApplicationHeaders());
- }
- } else if (isLocal(msg)) {
- //drop message
- QPID_LOG(info, "Dropping 'local' message from " << getName());
- } else if (isExcluded(msg)) {
- //drop message
- QPID_LOG(info, "Dropping excluded message from " << getName());
- } else {
- // if no store then mark as enqueued
- if (!enqueue(0, msg)){
- push(msg);
- msg->enqueueComplete();
- }else {
- push(msg);
- }
- mgntEnqStats(msg);
- QPID_LOG(debug, "Message " << msg << " enqueued on " << name << "[" << this << "]");
- }
-}
-
-
-void Queue::recover(boost::intrusive_ptr<Message>& msg){
- push(msg);
- msg->enqueueComplete(); // mark the message as enqueued
- mgntEnqStats(msg);
-
- if (store && !msg->isContentLoaded()) {
- //content has not been loaded, need to ensure that lazy loading mode is set:
- //TODO: find a nicer way to do this
- msg->releaseContent(store);
- }
-}
-
-void Queue::process(boost::intrusive_ptr<Message>& msg){
- push(msg);
- mgntEnqStats(msg);
- if (mgmtObject != 0){
- mgmtObject->inc_msgTxnEnqueues ();
- mgmtObject->inc_byteTxnEnqueues (msg->contentSize ());
- }
-}
-
-void Queue::requeue(const QueuedMessage& msg){
- if (policy.get() && !policy->isEnqueued(msg)) return;
-
- QueueListeners::NotificationSet copy;
- {
- Mutex::ScopedLock locker(messageLock);
- msg.payload->enqueueComplete(); // mark the message as enqueued
- messages.push_front(msg);
- listeners.populate(copy);
- }
- copy.notify();
-}
-
-void Queue::clearLVQIndex(const QueuedMessage& msg){
- if (lastValueQueue){
- const framing::FieldTable* ft = msg.payload->getApplicationHeaders();
- string key = ft->getAsString(qpidVQMatchProperty);
- lvq.erase(key);
- }
-}
-
-bool Queue::acquire(const QueuedMessage& msg) {
- Mutex::ScopedLock locker(messageLock);
- QPID_LOG(debug, "attempting to acquire " << msg.position);
- for (Messages::iterator i = messages.begin(); i != messages.end(); i++) {
- if ((i->position == msg.position && !lastValueQueue) // note that in some cases payload not be set
- || (lastValueQueue && (i->position == msg.position) &&
- msg.payload.get() == checkLvqReplace(*i).payload.get()) ) {
-
- clearLVQIndex(msg);
- messages.erase(i);
- QPID_LOG(debug, "Match found, acquire succeeded: " << i->position << " == " << msg.position);
- return true;
- } else {
- QPID_LOG(debug, "No match: " << i->position << " != " << msg.position);
- }
- }
- QPID_LOG(debug, "Acquire failed for " << msg.position);
- return false;
-}
-
-bool Queue::getNextMessage(QueuedMessage& m, Consumer::shared_ptr c)
-{
- if (c->preAcquires()) {
- return consumeNextMessage(m, c);
- } else {
- return browseNextMessage(m, c);
- }
-}
-
-bool Queue::checkForMessages(Consumer::shared_ptr c)
-{
- Mutex::ScopedLock locker(messageLock);
- if (messages.empty()) {
- //no message available, register consumer for notification
- //when this changes
- listeners.addListener(c);
- return false;
- } else {
- QueuedMessage msg = getFront();
- if (store && !msg.payload->isEnqueueComplete()) {
- //though a message is on the queue, it has not yet been
- //enqueued and so is not available for consumption yet,
- //register consumer for notification when this changes
- listeners.addListener(c);
- return false;
- } else {
- //check that consumer has sufficient credit for the
- //message (if it does not, no need to register it for
- //notification as the consumer itself will handle the
- //credit allocation required to change this condition).
- return c->accept(msg.payload);
- }
- }
-}
-
-bool Queue::consumeNextMessage(QueuedMessage& m, Consumer::shared_ptr c)
-{
- while (true) {
- Mutex::ScopedLock locker(messageLock);
- if (messages.empty()) {
- QPID_LOG(debug, "No messages to dispatch on queue '" << name << "'");
- listeners.addListener(c);
- return false;
- } else {
- QueuedMessage msg = getFront();
- if (msg.payload->hasExpired()) {
- QPID_LOG(debug, "Message expired from queue '" << name << "'");
- popAndDequeue();
- continue;
- }
-
- if (c->filter(msg.payload)) {
- if (c->accept(msg.payload)) {
- m = msg;
- popMsg(msg);
- return true;
- } else {
- //message(s) are available but consumer hasn't got enough credit
- QPID_LOG(debug, "Consumer can't currently accept message from '" << name << "'");
- return false;
- }
- } else {
- //consumer will never want this message
- QPID_LOG(debug, "Consumer doesn't want message from '" << name << "'");
- return false;
- }
- }
- }
-}
-
-
-bool Queue::browseNextMessage(QueuedMessage& m, Consumer::shared_ptr c)
-{
- QueuedMessage msg(this);
- while (seek(msg, c)) {
- if (c->filter(msg.payload) && !msg.payload->hasExpired()) {
- if (c->accept(msg.payload)) {
- //consumer wants the message
- c->position = msg.position;
- m = msg;
- if (!lastValueQueueNoBrowse) clearLVQIndex(msg);
- if (lastValueQueue) {
- boost::intrusive_ptr<Message> replacement = msg.payload->getReplacementMessage(this);
- if (replacement.get()) m.payload = replacement;
- }
- return true;
- } else {
- //browser hasn't got enough credit for the message
- QPID_LOG(debug, "Browser can't currently accept message from '" << name << "'");
- return false;
- }
- } else {
- //consumer will never want this message, continue seeking
- c->position = msg.position;
- QPID_LOG(debug, "Browser skipping message from '" << name << "'");
- }
- }
- return false;
-}
-
-void Queue::removeListener(Consumer::shared_ptr c)
-{
- QueueListeners::NotificationSet set;
- {
- Mutex::ScopedLock locker(messageLock);
- listeners.removeListener(c);
- if (messages.size()) {
- listeners.populate(set);
- }
- }
- set.notify();
-}
-
-bool Queue::dispatch(Consumer::shared_ptr c)
-{
- QueuedMessage msg(this);
- if (getNextMessage(msg, c)) {
- c->deliver(msg);
- return true;
- } else {
- return false;
- }
-}
-
-bool Queue::seek(QueuedMessage& msg, Consumer::shared_ptr c) {
- Mutex::ScopedLock locker(messageLock);
- if (!messages.empty() && messages.back().position > c->position) {
- if (c->position < getFront().position) {
- msg = getFront();
- return true;
- } else {
- //TODO: can improve performance of this search, for now just searching linearly from end
- Messages::reverse_iterator pos;
- for (Messages::reverse_iterator i = messages.rbegin(); i != messages.rend() && i->position > c->position; i++) {
- pos = i;
- }
- msg = *pos;
- return true;
- }
- }
- listeners.addListener(c);
- return false;
-}
-
-namespace {
-struct PositionEquals {
- SequenceNumber pos;
- PositionEquals(SequenceNumber p) : pos(p) {}
- bool operator()(const QueuedMessage& msg) const { return msg.position == pos; }
-};
-}// namespace
-
-QueuedMessage Queue::find(SequenceNumber pos) const {
- Mutex::ScopedLock locker(messageLock);
- Messages::const_iterator i = std::find_if(messages.begin(), messages.end(), PositionEquals(pos));
- if (i != messages.end())
- return *i;
- return QueuedMessage();
-}
-
-void Queue::consume(Consumer::shared_ptr c, bool requestExclusive){
- Mutex::ScopedLock locker(consumerLock);
- if(exclusive) {
- throw ResourceLockedException(
- QPID_MSG("Queue " << getName() << " has an exclusive consumer. No more consumers allowed."));
- } else if(requestExclusive) {
- if(consumerCount) {
- throw ResourceLockedException(
- QPID_MSG("Queue " << getName() << " already has consumers. Exclusive access denied."));
- } else {
- exclusive = c->getSession();
- }
- }
- consumerCount++;
- if (mgmtObject != 0)
- mgmtObject->inc_consumerCount ();
-}
-
-void Queue::cancel(Consumer::shared_ptr c){
- removeListener(c);
- Mutex::ScopedLock locker(consumerLock);
- consumerCount--;
- if(exclusive) exclusive = 0;
- if (mgmtObject != 0)
- mgmtObject->dec_consumerCount ();
-}
-
-QueuedMessage Queue::get(){
- Mutex::ScopedLock locker(messageLock);
- QueuedMessage msg(this);
-
- if(!messages.empty()){
- msg = getFront();
- popMsg(msg);
- }
- return msg;
-}
-
-void Queue::purgeExpired()
-{
- //As expired messages are discarded during dequeue also, only
- //bother explicitly expiring if the rate of dequeues since last
- //attempt is less than one per second.
- if (dequeueTracker.sampleRatePerSecond() < 1) {
- Messages expired;
- {
- Mutex::ScopedLock locker(messageLock);
- for (Messages::iterator i = messages.begin(); i != messages.end();) {
- if (lastValueQueue) checkLvqReplace(*i);
- if (i->payload->hasExpired()) {
- expired.push_back(*i);
- i = messages.erase(i);
- } else {
- ++i;
- }
- }
- }
- for_each(expired.begin(), expired.end(), bind(&Queue::dequeue, this, (TransactionContext*) 0, _1));
- }
-}
-
-/**
- * purge - for purging all or some messages on a queue
- * depending on the purge_request
- *
- * purge_request == 0 then purge all messages
- * == N then purge N messages from queue
- * Sometimes purge_request == 1 to unblock the top of queue
- */
-uint32_t Queue::purge(const uint32_t purge_request){
- Mutex::ScopedLock locker(messageLock);
- uint32_t purge_count = purge_request; // only comes into play if >0
-
- uint32_t count = 0;
- // Either purge them all or just the some (purge_count) while the queue isn't empty.
- while((!purge_request || purge_count--) && !messages.empty()) {
- popAndDequeue();
- count++;
- }
- return count;
-}
-
-uint32_t Queue::move(const Queue::shared_ptr destq, uint32_t qty) {
- Mutex::ScopedLock locker(messageLock);
- uint32_t move_count = qty; // only comes into play if qty >0
- uint32_t count = 0; // count how many were moved for returning
-
- while((!qty || move_count--) && !messages.empty()) {
- QueuedMessage qmsg = getFront();
- boost::intrusive_ptr<Message> msg = qmsg.payload;
- destq->deliver(msg); // deliver message to the destination queue
- popMsg(qmsg);
- dequeue(0, qmsg);
- count++;
- }
- return count;
-}
-
-void Queue::popMsg(QueuedMessage& qmsg)
-{
- if (lastValueQueue){
- const framing::FieldTable* ft = qmsg.payload->getApplicationHeaders();
- string key = ft->getAsString(qpidVQMatchProperty);
- lvq.erase(key);
- }
- messages.pop_front();
- ++dequeueTracker;
-}
-
-void Queue::push(boost::intrusive_ptr<Message>& msg){
- QueueListeners::NotificationSet copy;
- {
- Mutex::ScopedLock locker(messageLock);
- QueuedMessage qm(this, msg, ++sequence);
- if (policy.get()) policy->tryEnqueue(qm);
-
- LVQ::iterator i;
- if (lastValueQueue){
- const framing::FieldTable* ft = msg->getApplicationHeaders();
- string key = ft->getAsString(qpidVQMatchProperty);
-
- i = lvq.find(key);
- if (i == lvq.end()){
- messages.push_back(qm);
- listeners.populate(copy);
- lvq[key] = msg;
- }else {
- i->second->setReplacementMessage(msg,this);
- qm.payload = i->second;
- dequeued(qm);
- }
- }else {
- messages.push_back(qm);
- listeners.populate(copy);
- }
- }
- copy.notify();
-}
-
-QueuedMessage Queue::getFront()
-{
- QueuedMessage msg = messages.front();
- if (lastValueQueue) {
- boost::intrusive_ptr<Message> replacement = msg.payload->getReplacementMessage(this);
- if (replacement.get()) msg.payload = replacement;
- }
- return msg;
-}
-
-QueuedMessage& Queue::checkLvqReplace(QueuedMessage& msg) const
-{
- boost::intrusive_ptr<Message> replacement = msg.payload->getReplacementMessage(this);
- if (replacement.get()) msg.payload = replacement;
- return msg;
-}
-
-/** function only provided for unit tests, or code not in critical message path */
-uint32_t Queue::getMessageCount() const
-{
- Mutex::ScopedLock locker(messageLock);
-
- uint32_t count = 0;
- for ( Messages::const_iterator i = messages.begin(); i != messages.end(); ++i ) {
- //NOTE: don't need to use checkLvqReplace() here as it
- //is only relevant for LVQ which does not support persistence
- //so the enqueueComplete check has no effect
- if ( i->payload->isEnqueueComplete() ) count ++;
- }
-
- return count;
-}
-
-uint32_t Queue::getConsumerCount() const
-{
- Mutex::ScopedLock locker(consumerLock);
- return consumerCount;
-}
-
-bool Queue::canAutoDelete() const
-{
- Mutex::ScopedLock locker(consumerLock);
- return autodelete && !consumerCount;
-}
-
-void Queue::clearLastNodeFailure()
-{
- inLastNodeFailure = false;
-}
-
-void Queue::setLastNodeFailure()
-{
- if (persistLastNode){
- Mutex::ScopedLock locker(messageLock);
- for ( Messages::iterator i = messages.begin(); i != messages.end(); ++i ) {
- if (lastValueQueue) checkLvqReplace(*i);
- i->payload->forcePersistent();
- if (i->payload->getPersistenceId() == 0){
- enqueue(0, i->payload);
- }
- }
- inLastNodeFailure = true;
- }
-}
-
-// return true if store exists,
-bool Queue::enqueue(TransactionContext* ctxt, boost::intrusive_ptr<Message> msg)
-{
- if (inLastNodeFailure && persistLastNode){
- msg->forcePersistent();
- }
-
- if (traceId.size()) {
- msg->addTraceId(traceId);
- }
-
- if (msg->isPersistent() && store && !lastValueQueue) {
- msg->enqueueAsync(shared_from_this(), store); //increment to async counter -- for message sent to more than one queue
- boost::intrusive_ptr<PersistableMessage> pmsg = boost::static_pointer_cast<PersistableMessage>(msg);
- store->enqueue(ctxt, pmsg, *this);
- return true;
- }
- return false;
-}
-
-// return true if store exists,
-bool Queue::dequeue(TransactionContext* ctxt, const QueuedMessage& msg)
-{
- if (policy.get() && !policy->isEnqueued(msg)) return false;
- {
- Mutex::ScopedLock locker(messageLock);
- if (!ctxt) {
- dequeued(msg);
- }
- }
- if (msg.payload->isPersistent() && store && !lastValueQueue) {
- msg.payload->dequeueAsync(shared_from_this(), store); //increment to async counter -- for message sent to more than one queue
- boost::intrusive_ptr<PersistableMessage> pmsg = boost::static_pointer_cast<PersistableMessage>(msg.payload);
- store->dequeue(ctxt, pmsg, *this);
- return true;
- }
- return false;
-}
-
-void Queue::dequeueCommitted(const QueuedMessage& msg)
-{
- Mutex::ScopedLock locker(messageLock);
- dequeued(msg);
- if (mgmtObject != 0) {
- mgmtObject->inc_msgTxnDequeues();
- mgmtObject->inc_byteTxnDequeues(msg.payload->contentSize());
- }
-}
-
-/**
- * Removes a message from the in-memory delivery queue as well
- * dequeing it from the logical (and persistent if applicable) queue
- */
-void Queue::popAndDequeue()
-{
- QueuedMessage msg = getFront();
- popMsg(msg);
- dequeue(0, msg);
-}
-
-/**
- * Updates policy and management when a message has been dequeued,
- * expects messageLock to be held
- */
-void Queue::dequeued(const QueuedMessage& msg)
-{
- if (policy.get()) policy->dequeued(msg);
- mgntDeqStats(msg.payload);
-}
-
-
-void Queue::create(const FieldTable& _settings)
-{
- settings = _settings;
- if (store) {
- store->create(*this, _settings);
- }
- configure(_settings);
-}
-
-void Queue::configure(const FieldTable& _settings)
-{
- setPolicy(QueuePolicy::createQueuePolicy(_settings));
- //set this regardless of owner to allow use of no-local with exclusive consumers also
- noLocal = _settings.get(qpidNoLocal);
- QPID_LOG(debug, "Configured queue with no-local=" << noLocal);
-
- lastValueQueue= _settings.get(qpidLastValueQueue);
- if (lastValueQueue) QPID_LOG(debug, "Configured queue as Last Value Queue");
-
- lastValueQueueNoBrowse = _settings.get(qpidLastValueQueueNoBrowse);
- if (lastValueQueueNoBrowse){
- QPID_LOG(debug, "Configured queue as Last Value Queue No Browse");
- lastValueQueue = lastValueQueueNoBrowse;
- }
-
- persistLastNode= _settings.get(qpidPersistLastNode);
- if (persistLastNode) QPID_LOG(debug, "Configured queue to Persist data if cluster fails to one node");
-
- traceId = _settings.getAsString(qpidTraceIdentity);
- std::string excludeList = _settings.getAsString(qpidTraceExclude);
- if (excludeList.size()) {
- split(traceExclude, excludeList, ", ");
- }
- QPID_LOG(debug, "Configured queue " << getName() << " with qpid.trace.id='" << traceId
- << "' and qpid.trace.exclude='"<< excludeList << "' i.e. " << traceExclude.size() << " elements");
-
- if (mgmtObject != 0)
- mgmtObject->set_arguments (_settings);
-}
-
-void Queue::destroy()
-{
- if (alternateExchange.get()) {
- Mutex::ScopedLock locker(messageLock);
- while(!messages.empty()){
- DeliverableMessage msg(getFront().payload);
- alternateExchange->route(msg, msg.getMessage().getRoutingKey(),
- msg.getMessage().getApplicationHeaders());
- popAndDequeue();
- }
- alternateExchange->decAlternateUsers();
- }
-
- if (store) {
- store->flush(*this);
- store->destroy(*this);
- store = 0;//ensure we make no more calls to the store for this queue
- }
-}
-
-void Queue::bound(const string& exchange, const string& key,
- const FieldTable& args)
-{
- bindings.add(exchange, key, args);
-}
-
-void Queue::unbind(ExchangeRegistry& exchanges, Queue::shared_ptr shared_ref)
-{
- bindings.unbind(exchanges, shared_ref);
-}
-
-void Queue::setPolicy(std::auto_ptr<QueuePolicy> _policy)
-{
- policy = _policy;
-}
-
-const QueuePolicy* Queue::getPolicy()
-{
- return policy.get();
-}
-
-uint64_t Queue::getPersistenceId() const
-{
- return persistenceId;
-}
-
-void Queue::setPersistenceId(uint64_t _persistenceId) const
-{
- if (mgmtObject != 0 && persistenceId == 0)
- {
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- agent->addObject (mgmtObject, 0x3000000000000000LL + _persistenceId);
-
- if (externalQueueStore) {
- ManagementObject* childObj = externalQueueStore->GetManagementObject();
- if (childObj != 0)
- childObj->setReference(mgmtObject->getObjectId());
- }
- }
- persistenceId = _persistenceId;
-}
-
-void Queue::encode(Buffer& buffer) const
-{
- buffer.putShortString(name);
- buffer.put(settings);
- if (policy.get()) {
- buffer.put(*policy);
- }
-}
-
-uint32_t Queue::encodedSize() const
-{
- return name.size() + 1/*short string size octet*/ + settings.encodedSize()
- + (policy.get() ? (*policy).encodedSize() : 0);
-}
-
-Queue::shared_ptr Queue::decode(QueueRegistry& queues, Buffer& buffer)
-{
- string name;
- buffer.getShortString(name);
- std::pair<Queue::shared_ptr, bool> result = queues.declare(name, true);
- buffer.get(result.first->settings);
- result.first->configure(result.first->settings);
- if (result.first->policy.get() && buffer.available() >= result.first->policy->encodedSize()) {
- buffer.get ( *(result.first->policy) );
- }
- return result.first;
-}
-
-
-void Queue::setAlternateExchange(boost::shared_ptr<Exchange> exchange)
-{
- alternateExchange = exchange;
-}
-
-boost::shared_ptr<Exchange> Queue::getAlternateExchange()
-{
- return alternateExchange;
-}
-
-void Queue::tryAutoDelete(Broker& broker, Queue::shared_ptr queue)
-{
- if (broker.getQueues().destroyIf(queue->getName(),
- boost::bind(boost::mem_fn(&Queue::canAutoDelete), queue))) {
- queue->unbind(broker.getExchanges(), queue);
- queue->destroy();
- }
-}
-
-bool Queue::isExclusiveOwner(const OwnershipToken* const o) const
-{
- Mutex::ScopedLock locker(ownershipLock);
- return o == owner;
-}
-
-void Queue::releaseExclusiveOwnership()
-{
- Mutex::ScopedLock locker(ownershipLock);
- owner = 0;
-}
-
-bool Queue::setExclusiveOwner(const OwnershipToken* const o)
-{
- Mutex::ScopedLock locker(ownershipLock);
- if (owner) {
- return false;
- } else {
- owner = o;
- return true;
- }
-}
-
-bool Queue::hasExclusiveOwner() const
-{
- Mutex::ScopedLock locker(ownershipLock);
- return owner != 0;
-}
-
-bool Queue::hasExclusiveConsumer() const
-{
- return exclusive;
-}
-
-void Queue::setExternalQueueStore(ExternalQueueStore* inst) {
- if (externalQueueStore!=inst && externalQueueStore)
- delete externalQueueStore;
- externalQueueStore = inst;
-
- if (inst) {
- ManagementObject* childObj = inst->GetManagementObject();
- if (childObj != 0 && mgmtObject != 0)
- childObj->setReference(mgmtObject->getObjectId());
- }
-}
-
-bool Queue::releaseMessageContent(const QueuedMessage& m)
-{
- if (store && !NullMessageStore::isNullStore(store)) {
- QPID_LOG(debug, "Message " << m.position << " on " << name << " released from memory");
- m.payload->releaseContent(store);
- return true;
- } else {
- QPID_LOG(warning, "Message " << m.position << " on " << name
- << " cannot be released from memory as the queue is not durable");
- return false;
- }
-}
-
-ManagementObject* Queue::GetManagementObject (void) const
-{
- return (ManagementObject*) mgmtObject;
-}
-
-Manageable::status_t Queue::ManagementMethod (uint32_t methodId, Args& args, string&)
-{
- Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
-
- QPID_LOG (debug, "Queue::ManagementMethod [id=" << methodId << "]");
-
- switch (methodId)
- {
- case _qmf::Queue::METHOD_PURGE :
- _qmf::ArgsQueuePurge& iargs = (_qmf::ArgsQueuePurge&) args;
- purge (iargs.i_request);
- status = Manageable::STATUS_OK;
- break;
- }
-
- return status;
-}
-
-void Queue::setPosition(SequenceNumber n) {
- Mutex::ScopedLock locker(messageLock);
- sequence = n;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Queue.h b/M4-RCs/qpid/cpp/src/qpid/broker/Queue.h
deleted file mode 100644
index e0bcc25fa3..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Queue.h
+++ /dev/null
@@ -1,287 +0,0 @@
-#ifndef _broker_Queue_h
-#define _broker_Queue_h
-
-/*
- *
- * 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 "OwnershipToken.h"
-#include "Consumer.h"
-#include "Message.h"
-#include "PersistableQueue.h"
-#include "QueuePolicy.h"
-#include "QueueBindings.h"
-#include "QueueListeners.h"
-#include "RateTracker.h"
-
-#include "qpid/framing/FieldTable.h"
-#include "qpid/sys/Monitor.h"
-#include "qpid/management/Manageable.h"
-#include "qmf/org/apache/qpid/broker/Queue.h"
-#include "qpid/framing/amqp_types.h"
-
-#include <boost/shared_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/intrusive_ptr.hpp>
-
-#include <list>
-#include <vector>
-#include <memory>
-#include <deque>
-#include <algorithm>
-
-namespace qpid {
- namespace broker {
- class Broker;
- class MessageStore;
- class QueueRegistry;
- class TransactionContext;
- class Exchange;
-
- using std::string;
-
- /**
- * The brokers representation of an amqp queue. Messages are
- * delivered to a queue from where they can be dispatched to
- * registered consumers or be stored until dequeued or until one
- * or more consumers registers.
- */
- class Queue : public boost::enable_shared_from_this<Queue>,
- public PersistableQueue, public management::Manageable {
-
- typedef std::deque<QueuedMessage> Messages;
- typedef std::map<string,boost::intrusive_ptr<Message> > LVQ;
-
- const string name;
- const bool autodelete;
- MessageStore* store;
- const OwnershipToken* owner;
- uint32_t consumerCount;
- OwnershipToken* exclusive;
- bool noLocal;
- bool lastValueQueue;
- bool lastValueQueueNoBrowse;
- bool persistLastNode;
- bool inLastNodeFailure;
- std::string traceId;
- std::vector<std::string> traceExclude;
- QueueListeners listeners;
- Messages messages;
- LVQ lvq;
- mutable qpid::sys::Mutex consumerLock;
- mutable qpid::sys::Mutex messageLock;
- mutable qpid::sys::Mutex ownershipLock;
- mutable uint64_t persistenceId;
- framing::FieldTable settings;
- std::auto_ptr<QueuePolicy> policy;
- bool policyExceeded;
- QueueBindings bindings;
- boost::shared_ptr<Exchange> alternateExchange;
- framing::SequenceNumber sequence;
- qmf::org::apache::qpid::broker::Queue* mgmtObject;
- RateTracker dequeueTracker;
-
- void push(boost::intrusive_ptr<Message>& msg);
- void setPolicy(std::auto_ptr<QueuePolicy> policy);
- bool seek(QueuedMessage& msg, Consumer::shared_ptr position);
- bool getNextMessage(QueuedMessage& msg, Consumer::shared_ptr c);
- bool consumeNextMessage(QueuedMessage& msg, Consumer::shared_ptr c);
- bool browseNextMessage(QueuedMessage& msg, Consumer::shared_ptr c);
-
- void removeListener(Consumer::shared_ptr);
-
- bool isExcluded(boost::intrusive_ptr<Message>& msg);
-
- void dequeued(const QueuedMessage& msg);
- void popAndDequeue();
- QueuedMessage getFront();
- QueuedMessage& checkLvqReplace(QueuedMessage& msg) const;
- void clearLVQIndex(const QueuedMessage& msg);
-
- inline void mgntEnqStats(const boost::intrusive_ptr<Message>& msg)
- {
- if (mgmtObject != 0) {
- mgmtObject->inc_msgTotalEnqueues ();
- mgmtObject->inc_byteTotalEnqueues (msg->contentSize ());
- if (msg->isPersistent ()) {
- mgmtObject->inc_msgPersistEnqueues ();
- mgmtObject->inc_bytePersistEnqueues (msg->contentSize ());
- }
- }
- }
- inline void mgntDeqStats(const boost::intrusive_ptr<Message>& msg)
- {
- if (mgmtObject != 0){
- mgmtObject->inc_msgTotalDequeues ();
- mgmtObject->inc_byteTotalDequeues (msg->contentSize());
- if (msg->isPersistent ()){
- mgmtObject->inc_msgPersistDequeues ();
- mgmtObject->inc_bytePersistDequeues (msg->contentSize());
- }
- }
- }
-
- public:
-
- virtual void notifyDurableIOComplete();
- typedef boost::shared_ptr<Queue> shared_ptr;
-
- typedef std::vector<shared_ptr> vector;
-
- Queue(const string& name, bool autodelete = false,
- MessageStore* const store = 0,
- const OwnershipToken* const owner = 0,
- management::Manageable* parent = 0);
- ~Queue();
-
- bool dispatch(Consumer::shared_ptr);
- /**
- * Check whether there would be a message available for
- * dispatch to this consumer. If not, the consumer will be
- * notified of events that may have changed this
- * situation.
- */
- bool checkForMessages(Consumer::shared_ptr);
-
- void create(const qpid::framing::FieldTable& settings);
- void configure(const qpid::framing::FieldTable& settings);
- void destroy();
- void bound(const string& exchange, const string& key, const qpid::framing::FieldTable& args);
- void unbind(ExchangeRegistry& exchanges, Queue::shared_ptr shared_ref);
-
- bool acquire(const QueuedMessage& msg);
-
- /**
- * Delivers a message to the queue. Will record it as
- * enqueued if persistent then process it.
- */
- void deliver(boost::intrusive_ptr<Message>& msg);
- /**
- * Dispatches the messages immediately to a consumer if
- * one is available or stores it for later if not.
- */
- void process(boost::intrusive_ptr<Message>& msg);
- /**
- * Returns a message to the in-memory queue (due to lack
- * of acknowledegement from a receiver). If a consumer is
- * available it will be dispatched immediately, else it
- * will be returned to the front of the queue.
- */
- void requeue(const QueuedMessage& msg);
- /**
- * Used during recovery to add stored messages back to the queue
- */
- void recover(boost::intrusive_ptr<Message>& msg);
-
- void consume(Consumer::shared_ptr c, bool exclusive = false);
- void cancel(Consumer::shared_ptr c);
-
- uint32_t purge(const uint32_t purge_request = 0); //defaults to all messages
- void purgeExpired();
-
- //move qty # of messages to destination Queue destq
- uint32_t move(const Queue::shared_ptr destq, uint32_t qty);
-
- uint32_t getMessageCount() const;
- uint32_t getConsumerCount() const;
- inline const string& getName() const { return name; }
- bool isExclusiveOwner(const OwnershipToken* const o) const;
- void releaseExclusiveOwnership();
- bool setExclusiveOwner(const OwnershipToken* const o);
- bool hasExclusiveConsumer() const;
- bool hasExclusiveOwner() const;
- inline bool isDurable() const { return store != 0; }
- inline const framing::FieldTable& getSettings() const { return settings; }
- inline bool isAutoDelete() const { return autodelete; }
- bool canAutoDelete() const;
- const QueueBindings& getBindings() const { return bindings; }
-
- /**
- * used to take messages from in memory and flush down to disk.
- */
- void setLastNodeFailure();
- void clearLastNodeFailure();
-
- bool enqueue(TransactionContext* ctxt, boost::intrusive_ptr<Message> msg);
- /**
- * dequeue from store (only done once messages is acknowledged)
- */
- bool dequeue(TransactionContext* ctxt, const QueuedMessage &msg);
- /**
- * Inform the queue that a previous transactional dequeue
- * committed.
- */
- void dequeueCommitted(const QueuedMessage& msg);
-
- /**
- * Gets the next available message
- */
- QueuedMessage get();
-
- /** Get the message at position pos */
- QueuedMessage find(framing::SequenceNumber pos) const;
-
- const QueuePolicy* getPolicy();
-
- void setAlternateExchange(boost::shared_ptr<Exchange> exchange);
- boost::shared_ptr<Exchange> getAlternateExchange();
- bool isLocal(boost::intrusive_ptr<Message>& msg);
-
- //PersistableQueue support:
- uint64_t getPersistenceId() const;
- void setPersistenceId(uint64_t persistenceId) const;
- void encode(framing::Buffer& buffer) const;
- uint32_t encodedSize() const;
-
- static Queue::shared_ptr decode(QueueRegistry& queues, framing::Buffer& buffer);
- static void tryAutoDelete(Broker& broker, Queue::shared_ptr);
-
- virtual void setExternalQueueStore(ExternalQueueStore* inst);
-
- // Manageable entry points
- management::ManagementObject* GetManagementObject (void) const;
- management::Manageable::status_t
- ManagementMethod (uint32_t methodId, management::Args& args, std::string& text);
-
- /** Apply f to each Message on the queue. */
- template <class F> void eachMessage(F f) const {
- sys::Mutex::ScopedLock l(messageLock);
- std::for_each(messages.begin(), messages.end(), f);
- }
-
- /** Apply f to each QueueBinding on the queue */
- template <class F> void eachBinding(F f) {
- bindings.eachBinding(f);
- }
-
- bool releaseMessageContent(const QueuedMessage&);
-
- void popMsg(QueuedMessage& qmsg);
-
- /** Set the position sequence number for the next message on the queue.
- * Must be >= the current sequence number.
- * Used by cluster to replicate queues.
- */
- void setPosition(framing::SequenceNumber pos);
- };
- }
-}
-
-
-#endif /*!_broker_Queue_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/QueueBindings.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/QueueBindings.cpp
deleted file mode 100644
index 6a1fa6aca3..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/QueueBindings.cpp
+++ /dev/null
@@ -1,46 +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 "QueueBindings.h"
-#include "ExchangeRegistry.h"
-#include "qpid/framing/reply_exceptions.h"
-
-using qpid::framing::FieldTable;
-using qpid::framing::NotFoundException;
-using std::string;
-using namespace qpid::broker;
-
-void QueueBindings::add(const string& exchange, const string& key, const FieldTable& args)
-{
- bindings.push_back(QueueBinding(exchange, key, args));
-}
-
-void QueueBindings::unbind(ExchangeRegistry& exchanges, Queue::shared_ptr queue)
-{
- for (Bindings::iterator i = bindings.begin(); i != bindings.end(); i++) {
- try {
- exchanges.get(i->exchange)->unbind(queue, i->key, &(i->args));
- } catch (const NotFoundException&) {}
- }
-}
-
-QueueBinding::QueueBinding(const string& _exchange, const string& _key, const FieldTable& _args)
- : exchange(_exchange), key(_key), args(_args)
-{}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/QueueBindings.h b/M4-RCs/qpid/cpp/src/qpid/broker/QueueBindings.h
deleted file mode 100644
index 1b90ba5540..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/QueueBindings.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.
- *
- */
-#ifndef _QueueBindings_
-#define _QueueBindings_
-
-#include "qpid/framing/FieldTable.h"
-#include <boost/ptr_container/ptr_list.hpp>
-#include <boost/shared_ptr.hpp>
-#include <algorithm>
-
-namespace qpid {
-namespace broker {
-
-class ExchangeRegistry;
-class Queue;
-
-struct QueueBinding{
- std::string exchange;
- std::string key;
- qpid::framing::FieldTable args;
- QueueBinding(const std::string& exchange, const std::string& key, const qpid::framing::FieldTable& args);
-};
-
-class QueueBindings
-{
- public:
-
- /** Apply f to each QueueBinding. */
- template <class F> void eachBinding(F f) const { std::for_each(bindings.begin(), bindings.end(), f); }
-
- void add(const std::string& exchange, const std::string& key, const qpid::framing::FieldTable& args);
- void unbind(ExchangeRegistry& exchanges, boost::shared_ptr<Queue> queue);
-
- private:
- typedef std::vector<QueueBinding> Bindings;
- Bindings bindings;
-};
-
-
-}} // namespace qpid::broker
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/QueueCleaner.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/QueueCleaner.cpp
deleted file mode 100644
index 0774dce2b7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/QueueCleaner.cpp
+++ /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.
- *
- */
-#include "QueueCleaner.h"
-
-#include "Broker.h"
-#include <boost/bind.hpp>
-
-namespace qpid {
-namespace broker {
-
-QueueCleaner::QueueCleaner(QueueRegistry& q, Timer& t) : queues(q), timer(t) {}
-
-void QueueCleaner::start(qpid::sys::Duration p)
-{
- task = boost::intrusive_ptr<TimerTask>(new Task(*this, p));
- timer.add(task);
-}
-
-QueueCleaner::Task::Task(QueueCleaner& p, qpid::sys::Duration d) : TimerTask(d), parent(p) {}
-
-void QueueCleaner::Task::fire()
-{
- parent.fired();
-}
-
-void QueueCleaner::fired()
-{
- queues.eachQueue(boost::bind(&Queue::purgeExpired, _1));
- task->reset();
- timer.add(task);
-}
-
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/QueueCleaner.h b/M4-RCs/qpid/cpp/src/qpid/broker/QueueCleaner.h
deleted file mode 100644
index 7903266f5f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/QueueCleaner.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef QPID_BROKER_QUEUECLEANER_H
-#define QPID_BROKER_QUEUECLEANER_H
-
-/*
- *
- * 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 "Timer.h"
-
-namespace qpid {
-namespace broker {
-
-class QueueRegistry;
-/**
- * TimerTask to purge expired messages from queues
- */
-class QueueCleaner
-{
- public:
- QueueCleaner(QueueRegistry& queues, Timer& timer);
- void start(qpid::sys::Duration period);
- private:
- class Task : public TimerTask
- {
- public:
- Task(QueueCleaner& parent, qpid::sys::Duration duration);
- void fire();
- private:
- QueueCleaner& parent;
- };
-
- boost::intrusive_ptr<TimerTask> task;
- QueueRegistry& queues;
- Timer& timer;
-
- void fired();
-};
-}} // namespace qpid::broker
-
-#endif /*!QPID_BROKER_QUEUECLEANER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/QueueListeners.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/QueueListeners.cpp
deleted file mode 100644
index 7baca7d0f4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/QueueListeners.cpp
+++ /dev/null
@@ -1,73 +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 "QueueListeners.h"
-#include <boost/bind.hpp>
-
-namespace qpid {
-namespace broker {
-
-void QueueListeners::addListener(Consumer::shared_ptr c)
-{
- if (c->preAcquires()) {
- add(consumers, c);
- } else {
- add(browsers, c);
- }
-}
-
-void QueueListeners::removeListener(Consumer::shared_ptr c)
-{
- if (c->preAcquires()) {
- remove(consumers, c);
- } else {
- remove(browsers, c);
- }
-}
-
-void QueueListeners::populate(NotificationSet& set)
-{
- if (consumers.size()) {
- set.consumer = consumers.front();
- consumers.pop_front();
- } else {
- browsers.swap(set.browsers);
- }
-}
-
-void QueueListeners::add(Listeners& listeners, Consumer::shared_ptr c)
-{
- Listeners::iterator i = std::find(listeners.begin(), listeners.end(), c);
- if (i == listeners.end()) listeners.push_back(c);
-}
-
-void QueueListeners::remove(Listeners& listeners, Consumer::shared_ptr c)
-{
- Listeners::iterator i = std::find(listeners.begin(), listeners.end(), c);
- if (i != listeners.end()) listeners.erase(i);
-}
-
-void QueueListeners::NotificationSet::notify()
-{
- if (consumer) consumer->notify();
- else for_each(browsers.begin(), browsers.end(), boost::mem_fn(&Consumer::notify));
-}
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/QueueListeners.h b/M4-RCs/qpid/cpp/src/qpid/broker/QueueListeners.h
deleted file mode 100644
index 53ed6a17e4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/QueueListeners.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef QPID_BROKER_QUEUELISTENERS_H
-#define QPID_BROKER_QUEUELISTENERS_H
-
-/*
- *
- * 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 "Consumer.h"
-#include <list>
-
-namespace qpid {
-namespace broker {
-
-/**
- * Track and notify components that wish to be notified of messages
- * that become available on a queue.
- *
- * None of the methods defined here are protected by locking. However
- * the populate method allows a 'snapshot' to be taken of the
- * listeners to be notified. NotificationSet::notify() may then be
- * called outside of any lock that protects the QueueListeners
- * instance from concurrent access.
- */
-class QueueListeners
-{
- public:
- typedef std::list<Consumer::shared_ptr> Listeners;
-
- class NotificationSet
- {
- public:
- void notify();
- private:
- Listeners browsers;
- Consumer::shared_ptr consumer;
- friend class QueueListeners;
- };
-
- void addListener(Consumer::shared_ptr);
- void removeListener(Consumer::shared_ptr);
- void populate(NotificationSet&);
- private:
- Listeners consumers;
- Listeners browsers;
-
- void add(Listeners&, Consumer::shared_ptr);
- void remove(Listeners&, Consumer::shared_ptr);
-
-};
-}} // namespace qpid::broker
-
-#endif /*!QPID_BROKER_QUEUELISTENERS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/QueuePolicy.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/QueuePolicy.cpp
deleted file mode 100644
index 41a6709d27..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/QueuePolicy.cpp
+++ /dev/null
@@ -1,297 +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 "QueuePolicy.h"
-#include "Queue.h"
-#include "qpid/Exception.h"
-#include "qpid/framing/FieldValue.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/log/Statement.h"
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-QueuePolicy::QueuePolicy(uint32_t _maxCount, uint64_t _maxSize, const std::string& _type) :
- maxCount(_maxCount), maxSize(_maxSize), type(_type), count(0), size(0), policyExceeded(false) {}
-
-void QueuePolicy::enqueued(uint64_t _size)
-{
- if (maxCount) ++count;
- if (maxSize) size += _size;
-}
-
-void QueuePolicy::dequeued(uint64_t _size)
-{
- //Note: underflow detection is not reliable in the face of
- //concurrent updates (at present locking in Queue.cpp prevents
- //these anyway); updates are atomic and are safe regardless.
- if (maxCount) {
- if (count.get() > 0) {
- --count;
- } else {
- throw Exception(QPID_MSG("Attempted count underflow on dequeue(" << _size << "): " << *this));
- }
- }
- if (maxSize) {
- if (_size > size.get()) {
- throw Exception(QPID_MSG("Attempted size underflow on dequeue(" << _size << "): " << *this));
- } else {
- size -= _size;
- }
- }
-}
-
-bool QueuePolicy::checkLimit(const QueuedMessage& m)
-{
- bool exceeded = (maxSize && (size.get() + m.payload->contentSize()) > maxSize) || (maxCount && (count.get() + 1) > maxCount);
- if (exceeded) {
- if (!policyExceeded) {
- policyExceeded = true;
- if (m.queue) {
- QPID_LOG(info, "Queue size exceeded policy for " << m.queue->getName());
- }
- }
- } else {
- if (policyExceeded) {
- policyExceeded = false;
- if (m.queue) {
- QPID_LOG(info, "Queue size within policy for " << m.queue->getName());
- }
- }
- }
- return !exceeded;
-}
-
-void QueuePolicy::tryEnqueue(const QueuedMessage& m)
-{
- if (checkLimit(m)) {
- enqueued(m);
- } else {
- std::string queue = m.queue ? m.queue->getName() : std::string("unknown queue");
- throw ResourceLimitExceededException(
- QPID_MSG("Policy exceeded on " << queue << " by message " << m.position
- << " of size " << m.payload->contentSize() << " , policy: " << *this));
- }
-}
-
-void QueuePolicy::enqueued(const QueuedMessage& m)
-{
- enqueued(m.payload->contentSize());
-}
-
-void QueuePolicy::dequeued(const QueuedMessage& m)
-{
- dequeued(m.payload->contentSize());
-}
-
-bool QueuePolicy::isEnqueued(const QueuedMessage&)
-{
- return true;
-}
-
-void QueuePolicy::update(FieldTable& settings)
-{
- if (maxCount) settings.setInt(maxCountKey, maxCount);
- if (maxSize) settings.setInt(maxSizeKey, maxSize);
- settings.setString(typeKey, type);
-}
-
-
-int QueuePolicy::getInt(const FieldTable& settings, const std::string& key, int defaultValue)
-{
- FieldTable::ValuePtr v = settings.get(key);
- if (v && v->convertsTo<int>()) return v->get<int>();
- else return defaultValue;
-}
-
-std::string QueuePolicy::getType(const FieldTable& settings)
-{
- FieldTable::ValuePtr v = settings.get(typeKey);
- if (v && v->convertsTo<std::string>()) {
- std::string t = v->get<std::string>();
- transform(t.begin(), t.end(), t.begin(), tolower);
- if (t == REJECT || t == FLOW_TO_DISK || t == RING || t == RING_STRICT) return t;
- }
- return FLOW_TO_DISK;
-}
-
-void QueuePolicy::setDefaultMaxSize(uint64_t s)
-{
- defaultMaxSize = s;
-}
-
-
-
-
-
-void QueuePolicy::encode(Buffer& buffer) const
-{
- buffer.putLong(maxCount);
- buffer.putLongLong(maxSize);
- buffer.putLong(count.get());
- buffer.putLongLong(size.get());
-}
-
-void QueuePolicy::decode ( Buffer& buffer )
-{
- maxCount = buffer.getLong();
- maxSize = buffer.getLongLong();
- count = buffer.getLong();
- size = buffer.getLongLong();
-}
-
-
-uint32_t QueuePolicy::encodedSize() const {
- return sizeof(uint32_t) + // maxCount
- sizeof(uint64_t) + // maxSize
- sizeof(uint32_t) + // count
- sizeof(uint64_t); // size
-}
-
-
-
-const std::string QueuePolicy::maxCountKey("qpid.max_count");
-const std::string QueuePolicy::maxSizeKey("qpid.max_size");
-const std::string QueuePolicy::typeKey("qpid.policy_type");
-const std::string QueuePolicy::REJECT("reject");
-const std::string QueuePolicy::FLOW_TO_DISK("flow_to_disk");
-const std::string QueuePolicy::RING("ring");
-const std::string QueuePolicy::RING_STRICT("ring_strict");
-uint64_t QueuePolicy::defaultMaxSize(0);
-
-FlowToDiskPolicy::FlowToDiskPolicy(uint32_t _maxCount, uint64_t _maxSize) :
- QueuePolicy(_maxCount, _maxSize, FLOW_TO_DISK) {}
-
-bool FlowToDiskPolicy::checkLimit(const QueuedMessage& m)
-{
- return QueuePolicy::checkLimit(m) || m.queue->releaseMessageContent(m);
-}
-
-RingQueuePolicy::RingQueuePolicy(uint32_t _maxCount, uint64_t _maxSize, const std::string& _type) :
- QueuePolicy(_maxCount, _maxSize, _type), strict(_type == RING_STRICT) {}
-
-void RingQueuePolicy::enqueued(const QueuedMessage& m)
-{
- QueuePolicy::enqueued(m);
- qpid::sys::Mutex::ScopedLock l(lock);
- queue.push_back(m);
-}
-
-void RingQueuePolicy::dequeued(const QueuedMessage& m)
-{
- qpid::sys::Mutex::ScopedLock l(lock);
- QueuePolicy::dequeued(m);
- //find and remove m from queue
- for (Messages::iterator i = queue.begin(); i != queue.end() && m.position <= i->position; i++) {
- if (i->position == m.position) {
- queue.erase(i);
- break;
- }
- }
-}
-
-bool RingQueuePolicy::isEnqueued(const QueuedMessage& m)
-{
- qpid::sys::Mutex::ScopedLock l(lock);
- //for non-strict ring policy, a message can be dequeued before acked; need to detect this
- for (Messages::iterator i = queue.begin(); i != queue.end() && m.position <= i->position; i++) {
- if (i->position == m.position) {
- return true;
- }
- }
- return false;
-}
-
-bool RingQueuePolicy::checkLimit(const QueuedMessage& m)
-{
- if (QueuePolicy::checkLimit(m)) return true;//if haven't hit limit, ok to accept
-
- QueuedMessage oldest;
- {
- qpid::sys::Mutex::ScopedLock l(lock);
- if (queue.empty()) {
- QPID_LOG(debug, "Message too large for ring queue "
- << (m.queue ? m.queue->getName() : std::string("unknown queue"))
- << " [" << *this << "] "
- << ": message size = " << m.payload->contentSize() << " bytes");
- return false;
- }
- oldest = queue.front();
- }
- if (oldest.queue->acquire(oldest) || !strict) {
- qpid::sys::Mutex::ScopedLock l(lock);
- if (oldest.position == queue.front().position) {
- queue.pop_front();
- QPID_LOG(debug, "Ring policy triggered in queue "
- << (m.queue ? m.queue->getName() : std::string("unknown queue"))
- << ": removed message " << oldest.position << " to make way for " << m.position);
- }
- return true;
- } else {
- QPID_LOG(debug, "Ring policy could not be triggered in queue "
- << (m.queue ? m.queue->getName() : std::string("unknown queue"))
- << ": oldest message (seq-no=" << oldest.position << ") has been delivered but not yet acknowledged or requeued");
- //in strict mode, if oldest message has been delivered (hence
- //cannot be acquired) but not yet acked, it should not be
- //removed and the attempted enqueue should fail
- return false;
- }
-}
-
-std::auto_ptr<QueuePolicy> QueuePolicy::createQueuePolicy(const qpid::framing::FieldTable& settings)
-{
- uint32_t maxCount = getInt(settings, maxCountKey, 0);
- uint32_t maxSize = getInt(settings, maxSizeKey, defaultMaxSize);
- if (maxCount || maxSize) {
- return createQueuePolicy(maxCount, maxSize, getType(settings));
- } else {
- return std::auto_ptr<QueuePolicy>();
- }
-}
-
-std::auto_ptr<QueuePolicy> QueuePolicy::createQueuePolicy(uint32_t maxCount, uint64_t maxSize, const std::string& type)
-{
- if (type == RING || type == RING_STRICT) {
- return std::auto_ptr<QueuePolicy>(new RingQueuePolicy(maxCount, maxSize, type));
- } else if (type == FLOW_TO_DISK) {
- return std::auto_ptr<QueuePolicy>(new FlowToDiskPolicy(maxCount, maxSize));
- } else {
- return std::auto_ptr<QueuePolicy>(new QueuePolicy(maxCount, maxSize, type));
- }
-
-}
-
-namespace qpid {
- namespace broker {
-
-std::ostream& operator<<(std::ostream& out, const QueuePolicy& p)
-{
- if (p.maxSize) out << "size: max=" << p.maxSize << ", current=" << p.size.get();
- else out << "size: unlimited";
- out << "; ";
- if (p.maxCount) out << "count: max=" << p.maxCount << ", current=" << p.count.get();
- else out << "count: unlimited";
- out << "; type=" << p.type;
- return out;
-}
-
- }
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/QueuePolicy.h b/M4-RCs/qpid/cpp/src/qpid/broker/QueuePolicy.h
deleted file mode 100644
index 0e8c15aa0e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/QueuePolicy.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.
- *
- */
-#ifndef _QueuePolicy_
-#define _QueuePolicy_
-
-#include <deque>
-#include <iostream>
-#include <memory>
-#include "QueuedMessage.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/sys/AtomicValue.h"
-#include "qpid/sys/Mutex.h"
-
-namespace qpid {
-namespace broker {
-
-class QueuePolicy
-{
- static uint64_t defaultMaxSize;
-
- uint32_t maxCount;
- uint64_t maxSize;
- const std::string type;
- qpid::sys::AtomicValue<uint32_t> count;
- qpid::sys::AtomicValue<uint64_t> size;
- bool policyExceeded;
-
- static int getInt(const qpid::framing::FieldTable& settings, const std::string& key, int defaultValue);
- static std::string getType(const qpid::framing::FieldTable& settings);
-
- public:
- static const std::string maxCountKey;
- static const std::string maxSizeKey;
- static const std::string typeKey;
- static const std::string REJECT;
- static const std::string FLOW_TO_DISK;
- static const std::string RING;
- static const std::string RING_STRICT;
-
- virtual ~QueuePolicy() {}
- void tryEnqueue(const QueuedMessage&);
- virtual void dequeued(const QueuedMessage&);
- virtual bool isEnqueued(const QueuedMessage&);
- virtual bool checkLimit(const QueuedMessage&);
- void update(qpid::framing::FieldTable& settings);
- uint32_t getMaxCount() const { return maxCount; }
- uint64_t getMaxSize() const { return maxSize; }
- void encode(framing::Buffer& buffer) const;
- void decode ( framing::Buffer& buffer );
- uint32_t encodedSize() const;
-
-
- static std::auto_ptr<QueuePolicy> createQueuePolicy(const qpid::framing::FieldTable& settings);
- static std::auto_ptr<QueuePolicy> createQueuePolicy(uint32_t maxCount, uint64_t maxSize, const std::string& type = REJECT);
- static void setDefaultMaxSize(uint64_t);
- friend std::ostream& operator<<(std::ostream&, const QueuePolicy&);
- protected:
- QueuePolicy(uint32_t maxCount, uint64_t maxSize, const std::string& type = REJECT);
-
- virtual void enqueued(const QueuedMessage&);
- void enqueued(uint64_t size);
- void dequeued(uint64_t size);
-};
-
-
-class FlowToDiskPolicy : public QueuePolicy
-{
- public:
- FlowToDiskPolicy(uint32_t maxCount, uint64_t maxSize);
- bool checkLimit(const QueuedMessage&);
-};
-
-class RingQueuePolicy : public QueuePolicy
-{
- public:
- RingQueuePolicy(uint32_t maxCount, uint64_t maxSize, const std::string& type = RING);
- void enqueued(const QueuedMessage&);
- void dequeued(const QueuedMessage&);
- bool isEnqueued(const QueuedMessage&);
- bool checkLimit(const QueuedMessage&);
- private:
- typedef std::deque<QueuedMessage> Messages;
- qpid::sys::Mutex lock;
- Messages queue;
- const bool strict;
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/QueueRegistry.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/QueueRegistry.cpp
deleted file mode 100644
index 2447ce5402..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/QueueRegistry.cpp
+++ /dev/null
@@ -1,107 +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 "QueueRegistry.h"
-#include "qpid/log/Statement.h"
-#include <sstream>
-#include <assert.h>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-
-QueueRegistry::QueueRegistry() :
- counter(1), store(0), parent(0), lastNode(false) {}
-
-QueueRegistry::~QueueRegistry(){}
-
-std::pair<Queue::shared_ptr, bool>
-QueueRegistry::declare(const string& declareName, bool durable,
- bool autoDelete, const OwnershipToken* owner)
-{
- RWlock::ScopedWlock locker(lock);
- string name = declareName.empty() ? generateName() : declareName;
- assert(!name.empty());
- QueueMap::iterator i = queues.find(name);
-
- if (i == queues.end()) {
- Queue::shared_ptr queue(new Queue(name, autoDelete, durable ? store : 0, owner, parent));
- queues[name] = queue;
- if (lastNode) queue->setLastNodeFailure();
-
- return std::pair<Queue::shared_ptr, bool>(queue, true);
- } else {
- return std::pair<Queue::shared_ptr, bool>(i->second, false);
- }
-}
-
-void QueueRegistry::destroyLH (const string& name){
- queues.erase(name);
-}
-
-void QueueRegistry::destroy (const string& name){
- RWlock::ScopedWlock locker(lock);
- destroyLH (name);
-}
-
-Queue::shared_ptr QueueRegistry::find(const string& name){
- RWlock::ScopedRlock locker(lock);
- QueueMap::iterator i = queues.find(name);
-
- if (i == queues.end()) {
- return Queue::shared_ptr();
- } else {
- return i->second;
- }
-}
-
-string QueueRegistry::generateName(){
- string name;
- do {
- std::stringstream ss;
- ss << "tmp_" << counter++;
- name = ss.str();
- // Thread safety: Private function, only called with lock held
- // so this is OK.
- } while(queues.find(name) != queues.end());
- return name;
-}
-
-void QueueRegistry::setStore (MessageStore* _store)
-{
- store = _store;
-}
-
-MessageStore* QueueRegistry::getStore() const {
- return store;
-}
-
-void QueueRegistry::updateQueueClusterState(bool _lastNode)
-{
- RWlock::ScopedRlock locker(lock);
- for (QueueMap::iterator i = queues.begin(); i != queues.end(); i++) {
- if (_lastNode){
- i->second->setLastNodeFailure();
- } else {
- i->second->clearLastNodeFailure();
- }
- }
- lastNode = _lastNode;
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/QueueRegistry.h b/M4-RCs/qpid/cpp/src/qpid/broker/QueueRegistry.h
deleted file mode 100644
index ca2cd132c4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/QueueRegistry.h
+++ /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.
- *
- */
-#ifndef _QueueRegistry_
-#define _QueueRegistry_
-
-#include "Queue.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/management/Manageable.h"
-#include <boost/bind.hpp>
-#include <algorithm>
-#include <map>
-
-namespace qpid {
-namespace broker {
-
-/**
- * A registry of queues indexed by queue name.
- *
- * Queues are reference counted using shared_ptr to ensure that they
- * are deleted when and only when they are no longer in use.
- *
- */
-class QueueRegistry{
- public:
- QueueRegistry();
- ~QueueRegistry();
-
- /**
- * Declare a queue.
- *
- * @return The queue and a boolean flag which is true if the queue
- * was created by this declare call false if it already existed.
- */
- std::pair<Queue::shared_ptr, bool> declare(const string& name, bool durable = false, bool autodelete = false,
- const OwnershipToken* owner = 0);
-
- /**
- * Destroy the named queue.
- *
- * Note: if the queue is in use it is not actually destroyed until
- * all shared_ptrs to it are destroyed. During that time it is
- * possible that a new queue with the same name may be
- * created. This should not create any problems as the new and
- * old queues exist independently. The registry has
- * forgotten the old queue so there can be no confusion for
- * subsequent calls to find or declare with the same name.
- *
- */
- void destroy (const string& name);
- template <class Test> bool destroyIf(const string& name, Test test)
- {
- qpid::sys::RWlock::ScopedWlock locker(lock);
- if (test()) {
- destroyLH (name);
- return true;
- } else {
- return false;
- }
- }
-
- /**
- * Find the named queue. Return 0 if not found.
- */
- Queue::shared_ptr find(const string& name);
-
- /**
- * Generate unique queue name.
- */
- string generateName();
-
- /**
- * Set the store to use. May only be called once.
- */
- void setStore (MessageStore*);
-
- /**
- * Return the message store used.
- */
- MessageStore* getStore() const;
-
- /**
- * Register the manageable parent for declared queues
- */
- void setParent (management::Manageable* _parent) { parent = _parent; }
-
- /** Call f for each queue in the registry. */
- template <class F> void eachQueue(F f) const {
- qpid::sys::RWlock::ScopedWlock l(lock);
- for (QueueMap::const_iterator i = queues.begin(); i != queues.end(); ++i)
- f(i->second);
- }
-
- /**
- * Change queue mode when cluster size drops to 1 node, expands again
- * in practice allows flow queue to disk when last name to be exectuted
- */
- void updateQueueClusterState(bool lastNode);
-
-private:
- typedef std::map<string, Queue::shared_ptr> QueueMap;
- QueueMap queues;
- mutable qpid::sys::RWlock lock;
- int counter;
- MessageStore* store;
- management::Manageable* parent;
- bool lastNode; //used to set mode on queue declare
-
- //destroy impl that assumes lock is already held:
- void destroyLH (const string& name);
-};
-
-
-}} // namespace qpid::broker
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/QueuedMessage.h b/M4-RCs/qpid/cpp/src/qpid/broker/QueuedMessage.h
deleted file mode 100644
index 82f5073d87..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/QueuedMessage.h
+++ /dev/null
@@ -1,46 +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.
- *
- */
-#ifndef _QueuedMessage_
-#define _QueuedMessage_
-
-#include "Message.h"
-
-namespace qpid {
-namespace broker {
-
-class Queue;
-
-struct QueuedMessage
-{
- boost::intrusive_ptr<Message> payload;
- framing::SequenceNumber position;
- Queue* queue;
-
- QueuedMessage() : queue(0) {}
- QueuedMessage(Queue* q, boost::intrusive_ptr<Message> msg, framing::SequenceNumber sn) :
- payload(msg), position(sn), queue(q) {}
- QueuedMessage(Queue* q) : queue(q) {}
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RateTracker.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/RateTracker.cpp
deleted file mode 100644
index fc88d99cfa..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RateTracker.cpp
+++ /dev/null
@@ -1,51 +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 "RateTracker.h"
-
-using qpid::sys::AbsTime;
-using qpid::sys::Duration;
-using qpid::sys::TIME_SEC;
-
-namespace qpid {
-namespace broker {
-
-RateTracker::RateTracker() : currentCount(0), lastCount(0), lastTime(AbsTime::now()) {}
-
-RateTracker& RateTracker::operator++()
-{
- ++currentCount;
- return *this;
-}
-
-double RateTracker::sampleRatePerSecond()
-{
- int32_t increment = currentCount - lastCount;
- AbsTime now = AbsTime::now();
- Duration interval(lastTime, now);
- lastCount = currentCount;
- lastTime = now;
- //if sampling at higher frequency than supported, will just return the number of increments
- if (interval < TIME_SEC) return increment;
- else if (increment == 0) return 0;
- else return increment / (interval / TIME_SEC);
-}
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RateTracker.h b/M4-RCs/qpid/cpp/src/qpid/broker/RateTracker.h
deleted file mode 100644
index 0c20b37312..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RateTracker.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef QPID_BROKER_RATETRACKER_H
-#define QPID_BROKER_RATETRACKER_H
-
-/*
- *
- * 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 "qpid/sys/Time.h"
-
-namespace qpid {
-namespace broker {
-
-/**
- * Simple rate tracker: represents some value that can be incremented,
- * then can periodcially sample the rate of increments.
- */
-class RateTracker
-{
- public:
- RateTracker();
- /**
- * Increments the count being tracked. Can be called concurrently
- * with other calls to this operator as well as with calls to
- * sampleRatePerSecond().
- */
- RateTracker& operator++();
- /**
- * Returns the rate of increments per second since last
- * called. Calls to this method should be serialised, but can be
- * called concurrently with the increment operator
- */
- double sampleRatePerSecond();
- private:
- volatile int32_t currentCount;
- int32_t lastCount;
- qpid::sys::AbsTime lastTime;
-};
-}} // namespace qpid::broker
-
-#endif /*!QPID_BROKER_RATETRACKER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableConfig.h b/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableConfig.h
deleted file mode 100644
index 838a8582dc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableConfig.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef _broker_RecoverableConfig_h
-#define _broker_RecoverableConfig_h
-
-/*
- *
- * 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 <boost/shared_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-
-/**
- * The interface through which configurations are recovered.
- */
-class RecoverableConfig
-{
-public:
- typedef boost::shared_ptr<RecoverableConfig> shared_ptr;
-
- virtual void setPersistenceId(uint64_t id) = 0;
- virtual ~RecoverableConfig() {};
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableExchange.h b/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableExchange.h
deleted file mode 100644
index 76d0d2ecdf..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableExchange.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef _broker_RecoverableExchange_h
-#define _broker_RecoverableExchange_h
-
-/*
- *
- * 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 <boost/shared_ptr.hpp>
-#include "qpid/framing/FieldTable.h"
-
-namespace qpid {
-namespace broker {
-
-/**
- * The interface through which bindings are recovered.
- */
-class RecoverableExchange
-{
-public:
- typedef boost::shared_ptr<RecoverableExchange> shared_ptr;
-
- virtual void setPersistenceId(uint64_t id) = 0;
- /**
- * Recover binding. Nb: queue must have been recovered earlier.
- */
- virtual void bind(std::string& queue, std::string& routingKey, qpid::framing::FieldTable& args) = 0;
- virtual ~RecoverableExchange() {};
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableMessage.h b/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableMessage.h
deleted file mode 100644
index f755fdf727..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableMessage.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _broker_RecoverableMessage_h
-#define _broker_RecoverableMessage_h
-
-/*
- *
- * 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 <boost/shared_ptr.hpp>
-#include "qpid/framing/amqp_types.h"
-#include "qpid/framing/Buffer.h"
-
-namespace qpid {
-namespace broker {
-
-/**
- * The interface through which messages are reloaded on recovery.
- */
-class RecoverableMessage
-{
-public:
- typedef boost::shared_ptr<RecoverableMessage> shared_ptr;
- virtual void setPersistenceId(uint64_t id) = 0;
- /**
- * Used by store to determine whether to load content on recovery
- * or let message load its own content as and when it requires it.
- *
- * @returns true if the content of the message should be loaded
- */
- virtual bool loadContent(uint64_t available) = 0;
- /**
- * Loads the content held in the supplied buffer (may do checking
- * of length as necessary)
- */
- virtual void decodeContent(framing::Buffer& buffer) = 0;
- virtual ~RecoverableMessage() {};
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableQueue.h b/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableQueue.h
deleted file mode 100644
index b32bae7f07..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableQueue.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef _broker_RecoverableQueue_h
-#define _broker_RecoverableQueue_h
-
-/*
- *
- * 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 "RecoverableMessage.h"
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-
-class ExternalQueueStore;
-
-/**
- * The interface through which messages are added back to queues on
- * recovery.
- */
-class RecoverableQueue
-{
-public:
- typedef boost::shared_ptr<RecoverableQueue> shared_ptr;
-
- virtual void setPersistenceId(uint64_t id) = 0;
- virtual uint64_t getPersistenceId() const = 0;
- /**
- * Used during recovery to add stored messages back to the queue
- */
- virtual void recover(RecoverableMessage::shared_ptr msg) = 0;
- virtual ~RecoverableQueue() {};
-
- virtual const std::string& getName() const = 0;
- virtual void setExternalQueueStore(ExternalQueueStore* inst) = 0;
- virtual ExternalQueueStore* getExternalQueueStore() const = 0;
-
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableTransaction.h b/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableTransaction.h
deleted file mode 100644
index 7fe34b6756..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoverableTransaction.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _broker_RecoverableTransaction_h
-#define _broker_RecoverableTransaction_h
-
-/*
- *
- * 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 <boost/shared_ptr.hpp>
-
-#include "RecoverableMessage.h"
-#include "RecoverableQueue.h"
-
-namespace qpid {
-namespace broker {
-
-/**
- * The interface through which prepared 2pc transactions are
- * recovered.
- */
-class RecoverableTransaction
-{
-public:
- typedef boost::shared_ptr<RecoverableTransaction> shared_ptr;
- virtual void enqueue(RecoverableQueue::shared_ptr queue, RecoverableMessage::shared_ptr message) = 0;
- virtual void dequeue(RecoverableQueue::shared_ptr queue, RecoverableMessage::shared_ptr message) = 0;
- virtual ~RecoverableTransaction() {};
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredDequeue.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredDequeue.cpp
deleted file mode 100644
index e2d70964fb..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredDequeue.cpp
+++ /dev/null
@@ -1,40 +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 "RecoveredDequeue.h"
-
-using boost::intrusive_ptr;
-using namespace qpid::broker;
-
-RecoveredDequeue::RecoveredDequeue(Queue::shared_ptr _queue, intrusive_ptr<Message> _msg) : queue(_queue), msg(_msg) {}
-
-bool RecoveredDequeue::prepare(TransactionContext*) throw(){
- //should never be called; transaction has already prepared if an enqueue is recovered
- return false;
-}
-
-void RecoveredDequeue::commit() throw(){
-}
-
-void RecoveredDequeue::rollback() throw(){
- msg->enqueueComplete();
- queue->process(msg);
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredDequeue.h b/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredDequeue.h
deleted file mode 100644
index ef6b8f1f74..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredDequeue.h
+++ /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.
- *
- */
-#ifndef _RecoveredDequeue_
-#define _RecoveredDequeue_
-
-#include "Deliverable.h"
-#include "Message.h"
-#include "MessageStore.h"
-#include "Queue.h"
-#include "TxOp.h"
-
-#include <boost/intrusive_ptr.hpp>
-
-#include <algorithm>
-#include <functional>
-#include <list>
-
-namespace qpid {
- namespace broker {
- class RecoveredDequeue : public TxOp{
- Queue::shared_ptr queue;
- boost::intrusive_ptr<Message> msg;
-
- public:
- RecoveredDequeue(Queue::shared_ptr queue, boost::intrusive_ptr<Message> msg);
- virtual bool prepare(TransactionContext* ctxt) throw();
- virtual void commit() throw();
- virtual void rollback() throw();
- virtual ~RecoveredDequeue(){}
- virtual void accept(TxOpConstVisitor& visitor) const { visitor(*this); }
-
- Queue::shared_ptr getQueue() const { return queue; }
- boost::intrusive_ptr<Message> getMessage() const { return msg; }
- };
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredEnqueue.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredEnqueue.cpp
deleted file mode 100644
index 1984a5d4a8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredEnqueue.cpp
+++ /dev/null
@@ -1,40 +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 "RecoveredEnqueue.h"
-
-using boost::intrusive_ptr;
-using namespace qpid::broker;
-
-RecoveredEnqueue::RecoveredEnqueue(Queue::shared_ptr _queue, intrusive_ptr<Message> _msg) : queue(_queue), msg(_msg) {}
-
-bool RecoveredEnqueue::prepare(TransactionContext*) throw(){
- //should never be called; transaction has already prepared if an enqueue is recovered
- return false;
-}
-
-void RecoveredEnqueue::commit() throw(){
- msg->enqueueComplete();
- queue->process(msg);
-}
-
-void RecoveredEnqueue::rollback() throw(){
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredEnqueue.h b/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredEnqueue.h
deleted file mode 100644
index 2d97768e65..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveredEnqueue.h
+++ /dev/null
@@ -1,58 +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.
- *
- */
-#ifndef _RecoveredEnqueue_
-#define _RecoveredEnqueue_
-
-#include "Deliverable.h"
-#include "Message.h"
-#include "MessageStore.h"
-#include "Queue.h"
-#include "TxOp.h"
-
-#include <boost/intrusive_ptr.hpp>
-
-#include <algorithm>
-#include <functional>
-#include <list>
-
-namespace qpid {
- namespace broker {
- class RecoveredEnqueue : public TxOp{
- Queue::shared_ptr queue;
- boost::intrusive_ptr<Message> msg;
-
- public:
- RecoveredEnqueue(Queue::shared_ptr queue, boost::intrusive_ptr<Message> msg);
- virtual bool prepare(TransactionContext* ctxt) throw();
- virtual void commit() throw();
- virtual void rollback() throw();
- virtual ~RecoveredEnqueue(){}
- virtual void accept(TxOpConstVisitor& visitor) const { visitor(*this); }
-
- Queue::shared_ptr getQueue() const { return queue; }
- boost::intrusive_ptr<Message> getMessage() const { return msg; }
-
- };
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManager.h b/M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManager.h
deleted file mode 100644
index 7dcbe3a2b0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManager.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.
- *
- */
-#ifndef _RecoveryManager_
-#define _RecoveryManager_
-
-#include "RecoverableExchange.h"
-#include "RecoverableQueue.h"
-#include "RecoverableMessage.h"
-#include "RecoverableTransaction.h"
-#include "RecoverableConfig.h"
-#include "TransactionalStore.h"
-#include "qpid/framing/Buffer.h"
-
-namespace qpid {
-namespace broker {
-
-class RecoveryManager{
- public:
- virtual ~RecoveryManager(){}
- virtual RecoverableExchange::shared_ptr recoverExchange(framing::Buffer& buffer) = 0;
- virtual RecoverableQueue::shared_ptr recoverQueue(framing::Buffer& buffer) = 0;
- virtual RecoverableMessage::shared_ptr recoverMessage(framing::Buffer& buffer) = 0;
- virtual RecoverableTransaction::shared_ptr recoverTransaction(const std::string& xid,
- std::auto_ptr<TPCTransactionContext> txn) = 0;
- virtual RecoverableConfig::shared_ptr recoverConfig(framing::Buffer& buffer) = 0;
-
- virtual void recoveryComplete() = 0;
-};
-
-class Recoverable {
- public:
- virtual ~Recoverable() {}
-
- /**
- * Request recovery of queue and message state.
- */
- virtual void recover(RecoveryManager& recoverer) = 0;
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp
deleted file mode 100644
index d3eacefc3c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp
+++ /dev/null
@@ -1,253 +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 "RecoveryManagerImpl.h"
-
-#include "Message.h"
-#include "Queue.h"
-#include "Link.h"
-#include "Bridge.h"
-#include "RecoveredEnqueue.h"
-#include "RecoveredDequeue.h"
-#include "qpid/framing/reply_exceptions.h"
-
-using namespace qpid;
-using namespace qpid::broker;
-using boost::dynamic_pointer_cast;
-using boost::intrusive_ptr;
-
-RecoveryManagerImpl::RecoveryManagerImpl(QueueRegistry& _queues, ExchangeRegistry& _exchanges, LinkRegistry& _links,
- DtxManager& _dtxMgr, uint64_t _stagingThreshold)
- : queues(_queues), exchanges(_exchanges), links(_links), dtxMgr(_dtxMgr), stagingThreshold(_stagingThreshold) {}
-
-RecoveryManagerImpl::~RecoveryManagerImpl() {}
-
-class RecoverableMessageImpl : public RecoverableMessage
-{
- intrusive_ptr<Message> msg;
- const uint64_t stagingThreshold;
-public:
- RecoverableMessageImpl(const intrusive_ptr<Message>& _msg, uint64_t _stagingThreshold)
- : msg(_msg), stagingThreshold(_stagingThreshold) {}
- ~RecoverableMessageImpl() {};
- void setPersistenceId(uint64_t id);
- bool loadContent(uint64_t available);
- void decodeContent(framing::Buffer& buffer);
- void recover(Queue::shared_ptr queue);
- void enqueue(DtxBuffer::shared_ptr buffer, Queue::shared_ptr queue);
- void dequeue(DtxBuffer::shared_ptr buffer, Queue::shared_ptr queue);
-};
-
-class RecoverableQueueImpl : public RecoverableQueue
-{
- Queue::shared_ptr queue;
-public:
- RecoverableQueueImpl(const boost::shared_ptr<Queue>& _queue) : queue(_queue) {}
- ~RecoverableQueueImpl() {};
- void setPersistenceId(uint64_t id);
- uint64_t getPersistenceId() const;
- const std::string& getName() const;
- void setExternalQueueStore(ExternalQueueStore* inst);
- ExternalQueueStore* getExternalQueueStore() const;
- void recover(RecoverableMessage::shared_ptr msg);
- void enqueue(DtxBuffer::shared_ptr buffer, RecoverableMessage::shared_ptr msg);
- void dequeue(DtxBuffer::shared_ptr buffer, RecoverableMessage::shared_ptr msg);
-};
-
-class RecoverableExchangeImpl : public RecoverableExchange
-{
- Exchange::shared_ptr exchange;
- QueueRegistry& queues;
-public:
- RecoverableExchangeImpl(Exchange::shared_ptr _exchange, QueueRegistry& _queues) : exchange(_exchange), queues(_queues) {}
- void setPersistenceId(uint64_t id);
- void bind(std::string& queue, std::string& routingKey, qpid::framing::FieldTable& args);
-};
-
-class RecoverableConfigImpl : public RecoverableConfig
-{
- Link::shared_ptr link;
- Bridge::shared_ptr bridge;
-public:
- RecoverableConfigImpl(Link::shared_ptr _link) : link(_link) {}
- RecoverableConfigImpl(Bridge::shared_ptr _bridge) : bridge(_bridge) {}
- void setPersistenceId(uint64_t id);
-};
-
-class RecoverableTransactionImpl : public RecoverableTransaction
-{
- DtxBuffer::shared_ptr buffer;
-public:
- RecoverableTransactionImpl(DtxBuffer::shared_ptr _buffer) : buffer(_buffer) {}
- void enqueue(RecoverableQueue::shared_ptr queue, RecoverableMessage::shared_ptr message);
- void dequeue(RecoverableQueue::shared_ptr queue, RecoverableMessage::shared_ptr message);
-};
-
-RecoverableExchange::shared_ptr RecoveryManagerImpl::recoverExchange(framing::Buffer& buffer)
-{
- return RecoverableExchange::shared_ptr(new RecoverableExchangeImpl(Exchange::decode(exchanges, buffer), queues));
-}
-
-RecoverableQueue::shared_ptr RecoveryManagerImpl::recoverQueue(framing::Buffer& buffer)
-{
- Queue::shared_ptr queue = Queue::decode(queues, buffer);
- try {
- Exchange::shared_ptr exchange = exchanges.getDefault();
- if (exchange) {
- exchange->bind(queue, queue->getName(), 0);
- }
- } catch (const framing::NotFoundException& /*e*/) {
- //assume no default exchange has been declared
- }
- return RecoverableQueue::shared_ptr(new RecoverableQueueImpl(queue));
-}
-
-RecoverableMessage::shared_ptr RecoveryManagerImpl::recoverMessage(framing::Buffer& buffer)
-{
- boost::intrusive_ptr<Message> message(new Message());
- message->decodeHeader(buffer);
- return RecoverableMessage::shared_ptr(new RecoverableMessageImpl(message, stagingThreshold));
-}
-
-RecoverableTransaction::shared_ptr RecoveryManagerImpl::recoverTransaction(const std::string& xid,
- std::auto_ptr<TPCTransactionContext> txn)
-{
- DtxBuffer::shared_ptr buffer(new DtxBuffer());
- dtxMgr.recover(xid, txn, buffer);
- return RecoverableTransaction::shared_ptr(new RecoverableTransactionImpl(buffer));
-}
-
-RecoverableConfig::shared_ptr RecoveryManagerImpl::recoverConfig(framing::Buffer& buffer)
-{
- string kind;
-
- buffer.getShortString (kind);
- if (kind == "link")
- return RecoverableConfig::shared_ptr(new RecoverableConfigImpl(Link::decode (links, buffer)));
- else if (kind == "bridge")
- return RecoverableConfig::shared_ptr(new RecoverableConfigImpl(Bridge::decode (links, buffer)));
-
- return RecoverableConfig::shared_ptr(); // TODO: raise an exception instead
-}
-
-void RecoveryManagerImpl::recoveryComplete()
-{
- //TODO (finalise binding setup etc)
-}
-
-bool RecoverableMessageImpl::loadContent(uint64_t available)
-{
- return !stagingThreshold || available < stagingThreshold;
-}
-
-void RecoverableMessageImpl::decodeContent(framing::Buffer& buffer)
-{
- msg->decodeContent(buffer);
-}
-
-void RecoverableMessageImpl::recover(Queue::shared_ptr queue)
-{
- queue->recover(msg);
-}
-
-void RecoverableMessageImpl::setPersistenceId(uint64_t id)
-{
- msg->setPersistenceId(id);
-}
-
-void RecoverableQueueImpl::recover(RecoverableMessage::shared_ptr msg)
-{
- dynamic_pointer_cast<RecoverableMessageImpl>(msg)->recover(queue);
-}
-
-void RecoverableQueueImpl::setPersistenceId(uint64_t id)
-{
- queue->setPersistenceId(id);
-}
-
-uint64_t RecoverableQueueImpl::getPersistenceId() const
-{
- return queue->getPersistenceId();
-}
-
-const std::string& RecoverableQueueImpl::getName() const
-{
- return queue->getName();
-}
-
-void RecoverableQueueImpl::setExternalQueueStore(ExternalQueueStore* inst)
-{
- queue->setExternalQueueStore(inst);
-}
-
-ExternalQueueStore* RecoverableQueueImpl::getExternalQueueStore() const
-{
- return queue->getExternalQueueStore();
-}
-
-void RecoverableExchangeImpl::setPersistenceId(uint64_t id)
-{
- exchange->setPersistenceId(id);
-}
-
-void RecoverableConfigImpl::setPersistenceId(uint64_t id)
-{
- if (link.get())
- link->setPersistenceId(id);
- else if (bridge.get())
- bridge->setPersistenceId(id);
-}
-
-void RecoverableExchangeImpl::bind(string& queueName, string& key, framing::FieldTable& args)
-{
- Queue::shared_ptr queue = queues.find(queueName);
- exchange->bind(queue, key, &args);
-}
-
-void RecoverableMessageImpl::dequeue(DtxBuffer::shared_ptr buffer, Queue::shared_ptr queue)
-{
- buffer->enlist(TxOp::shared_ptr(new RecoveredDequeue(queue, msg)));
-}
-
-void RecoverableMessageImpl::enqueue(DtxBuffer::shared_ptr buffer, Queue::shared_ptr queue)
-{
- msg->enqueueComplete(); // recoved nmessage to enqueued in store already
- buffer->enlist(TxOp::shared_ptr(new RecoveredEnqueue(queue, msg)));
-}
-
-void RecoverableQueueImpl::dequeue(DtxBuffer::shared_ptr buffer, RecoverableMessage::shared_ptr message)
-{
- dynamic_pointer_cast<RecoverableMessageImpl>(message)->dequeue(buffer, queue);
-}
-
-void RecoverableQueueImpl::enqueue(DtxBuffer::shared_ptr buffer, RecoverableMessage::shared_ptr message)
-{
- dynamic_pointer_cast<RecoverableMessageImpl>(message)->enqueue(buffer, queue);
-}
-
-void RecoverableTransactionImpl::dequeue(RecoverableQueue::shared_ptr queue, RecoverableMessage::shared_ptr message)
-{
- dynamic_pointer_cast<RecoverableQueueImpl>(queue)->dequeue(buffer, message);
-}
-
-void RecoverableTransactionImpl::enqueue(RecoverableQueue::shared_ptr queue, RecoverableMessage::shared_ptr message)
-{
- dynamic_pointer_cast<RecoverableQueueImpl>(queue)->enqueue(buffer, message);
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.h b/M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.h
deleted file mode 100644
index cd34d464f5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.h
+++ /dev/null
@@ -1,59 +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.
- *
- */
-#ifndef _RecoveryManagerImpl_
-#define _RecoveryManagerImpl_
-
-#include <list>
-#include "DtxManager.h"
-#include "ExchangeRegistry.h"
-#include "QueueRegistry.h"
-#include "LinkRegistry.h"
-#include "RecoveryManager.h"
-
-namespace qpid {
-namespace broker {
-
- class RecoveryManagerImpl : public RecoveryManager{
- QueueRegistry& queues;
- ExchangeRegistry& exchanges;
- LinkRegistry& links;
- DtxManager& dtxMgr;
- const uint64_t stagingThreshold;
- public:
- RecoveryManagerImpl(QueueRegistry& queues, ExchangeRegistry& exchanges, LinkRegistry& links,
- DtxManager& dtxMgr, uint64_t stagingThreshold);
- ~RecoveryManagerImpl();
-
- RecoverableExchange::shared_ptr recoverExchange(framing::Buffer& buffer);
- RecoverableQueue::shared_ptr recoverQueue(framing::Buffer& buffer);
- RecoverableMessage::shared_ptr recoverMessage(framing::Buffer& buffer);
- RecoverableTransaction::shared_ptr recoverTransaction(const std::string& xid,
- std::auto_ptr<TPCTransactionContext> txn);
- RecoverableConfig::shared_ptr recoverConfig(framing::Buffer& buffer);
- void recoveryComplete();
- };
-
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/SaslAuthenticator.cpp
deleted file mode 100644
index 370de8a1d1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SaslAuthenticator.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.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "Connection.h"
-#include "qpid/log/Statement.h"
-#include "qpid/framing/reply_exceptions.h"
-#include <boost/format.hpp>
-
-#if HAVE_SASL
-#include <sasl/sasl.h>
-#endif
-
-using namespace qpid::framing;
-using boost::format;
-using boost::str;
-
-namespace qpid {
-namespace broker {
-
-
-class NullAuthenticator : public SaslAuthenticator
-{
- Connection& connection;
- framing::AMQP_ClientProxy::Connection client;
- std::string realm;
-public:
- NullAuthenticator(Connection& connection);
- ~NullAuthenticator();
- void getMechanisms(framing::Array& mechanisms);
- void start(const std::string& mechanism, const std::string& response);
- void step(const std::string&) {}
-};
-
-#if HAVE_SASL
-
-class CyrusAuthenticator : public SaslAuthenticator
-{
- sasl_conn_t *sasl_conn;
- Connection& connection;
- framing::AMQP_ClientProxy::Connection client;
-
- void processAuthenticationStep(int code, const char *challenge, unsigned int challenge_len);
-
-public:
- CyrusAuthenticator(Connection& connection);
- ~CyrusAuthenticator();
- void init();
- void getMechanisms(framing::Array& mechanisms);
- void start(const std::string& mechanism, const std::string& response);
- void step(const std::string& response);
- void getUid(std::string& uid);
- void getError(std::string& error);
-};
-
-bool SaslAuthenticator::available(void)
-{
- return true;
-}
-
-// Initialize the SASL mechanism; throw if it fails.
-void SaslAuthenticator::init(const std::string& saslName)
-{
- int code = sasl_server_init(NULL, saslName.c_str());
- if (code != SASL_OK) {
- // TODO: Figure out who owns the char* returned by
- // sasl_errstring, though it probably does not matter much
- throw Exception(sasl_errstring(code, NULL, NULL));
- }
-}
-
-void SaslAuthenticator::fini(void)
-{
- sasl_done();
-}
-
-#else
-
-typedef NullAuthenticator CyrusAuthenticator;
-
-bool SaslAuthenticator::available(void)
-{
- return false;
-}
-
-void SaslAuthenticator::init(const std::string& /*saslName*/)
-{
- throw Exception("Requested authentication but SASL unavailable");
-}
-
-void SaslAuthenticator::fini(void)
-{
- return;
-}
-
-#endif
-
-std::auto_ptr<SaslAuthenticator> SaslAuthenticator::createAuthenticator(Connection& c)
-{
- static bool needWarning = true;
- if (c.getBroker().getOptions().auth) {
- return std::auto_ptr<SaslAuthenticator>(new CyrusAuthenticator(c));
- } else {
- QPID_LOG(warning, "SASL: No Authentication Performed");
- needWarning = false;
- return std::auto_ptr<SaslAuthenticator>(new NullAuthenticator(c));
- }
-}
-
-NullAuthenticator::NullAuthenticator(Connection& c) : connection(c), client(c.getOutput()),
- realm(c.getBroker().getOptions().realm) {}
-NullAuthenticator::~NullAuthenticator() {}
-
-void NullAuthenticator::getMechanisms(Array& mechanisms)
-{
- mechanisms.add(boost::shared_ptr<FieldValue>(new Str16Value("ANONYMOUS")));
-}
-
-void NullAuthenticator::start(const string& mechanism, const string& response)
-{
- if (mechanism == "PLAIN") { // Old behavior
- if (response.size() > 0 && response[0] == (char) 0) {
- string temp = response.substr(1);
- string::size_type i = temp.find((char)0);
- string uid = temp.substr(0, i);
- string pwd = temp.substr(i + 1);
- i = uid.find_last_of(realm);
- if (i == string::npos || i != (uid.size() - 1)) {
- uid = str(format("%1%@%2%") % uid % realm);
- }
- connection.setUserId(uid);
- }
- } else {
- connection.setUserId("anonymous");
- }
- client.tune(framing::CHANNEL_MAX, connection.getFrameMax(), 0, 0);
-}
-
-
-#if HAVE_SASL
-
-CyrusAuthenticator::CyrusAuthenticator(Connection& c) : sasl_conn(0), connection(c), client(c.getOutput())
-{
- init();
-}
-
-void CyrusAuthenticator::init()
-{
- /* Next to the service name, which specifies the
- * /etc/sasl2/<service name>.conf file to read, the realm is
- * currently the most important argument below. When
- * performing authentication the user that is authenticating
- * will be looked up in a specific realm. If none is given
- * then the realm defaults to the hostname, which can cause
- * confusion when the daemon is run on different hosts that
- * may be logically sharing a realm (aka a user domain). This
- * is especially important for SASL PLAIN authentication,
- * which cannot specify a realm for the user that is
- * authenticating.
- */
- const char *realm = connection.getBroker().getOptions().realm.c_str();
- int code = sasl_server_new(BROKER_SASL_NAME, /* Service name */
- NULL, /* Server FQDN, gethostname() */
- realm, /* Authentication realm */
- NULL, /* Local IP, needed for some mechanism */
- NULL, /* Remote IP, needed for some mechanism */
- NULL, /* Callbacks */
- 0, /* Connection flags */
- &sasl_conn);
-
- if (SASL_OK != code) {
- QPID_LOG(info, "SASL: Connection creation failed: [" << code << "] " << sasl_errdetail(sasl_conn));
-
- // TODO: Change this to an exception signaling
- // server error, when one is available
- throw ConnectionForcedException("Unable to perform authentication");
- }
-}
-
-CyrusAuthenticator::~CyrusAuthenticator()
-{
- if (sasl_conn) {
- sasl_dispose(&sasl_conn);
- sasl_conn = 0;
- }
-}
-
-void CyrusAuthenticator::getError(string& error)
-{
- error = string(sasl_errdetail(sasl_conn));
-}
-
-void CyrusAuthenticator::getUid(string& uid)
-{
- int code;
- const void* ptr;
-
- code = sasl_getprop(sasl_conn, SASL_USERNAME, &ptr);
- if (SASL_OK != code)
- return;
-
- uid = string(const_cast<char*>(static_cast<const char*>(ptr)));
-}
-
-void CyrusAuthenticator::getMechanisms(Array& mechanisms)
-{
- const char *separator = " ";
- const char *list;
- unsigned int list_len;
- int count;
-
- int code = sasl_listmech(sasl_conn, NULL,
- "", separator, "",
- &list, &list_len,
- &count);
-
- if (SASL_OK != code) {
- QPID_LOG(info, "SASL: Mechanism listing failed: " << sasl_errdetail(sasl_conn));
-
- // TODO: Change this to an exception signaling
- // server error, when one is available
- throw ConnectionForcedException("Mechanism listing failed");
- } else {
- string mechanism;
- unsigned int start;
- unsigned int end;
-
- QPID_LOG(info, "SASL: Mechanism list: " << list);
-
- end = 0;
- do {
- start = end;
-
- // Seek to end of next mechanism
- while (end < list_len && separator[0] != list[end])
- end++;
-
- // Record the mechanism
- mechanisms.add(boost::shared_ptr<FieldValue>(new Str16Value(string(list, start, end - start))));
- end++;
- } while (end < list_len);
- }
-}
-
-void CyrusAuthenticator::start(const string& mechanism, const string& response)
-{
- const char *challenge;
- unsigned int challenge_len;
-
- QPID_LOG(info, "SASL: Starting authentication with mechanism: " << mechanism);
- int code = sasl_server_start(sasl_conn,
- mechanism.c_str(),
- response.c_str(), response.length(),
- &challenge, &challenge_len);
-
- processAuthenticationStep(code, challenge, challenge_len);
-}
-
-void CyrusAuthenticator::step(const string& response)
-{
- const char *challenge;
- unsigned int challenge_len;
-
- int code = sasl_server_step(sasl_conn,
- response.c_str(), response.length(),
- &challenge, &challenge_len);
-
- processAuthenticationStep(code, challenge, challenge_len);
-}
-
-void CyrusAuthenticator::processAuthenticationStep(int code, const char *challenge, unsigned int challenge_len)
-{
- if (SASL_OK == code) {
- const void *uid;
-
- code = sasl_getprop(sasl_conn, SASL_USERNAME, &uid);
- if (SASL_OK != code) {
- QPID_LOG(info, "SASL: Authentication succeeded, username unavailable");
- // TODO: Change this to an exception signaling
- // authentication failure, when one is available
- throw ConnectionForcedException("Authenticated username unavailable");
- }
-
- QPID_LOG(info, "SASL: Authentication succeeded for: "
- << const_cast<char*>(static_cast<const char*>(uid)));
-
- connection.setUserId(const_cast<char*>(static_cast<const char*>(uid)));
-
- client.tune(framing::CHANNEL_MAX, connection.getFrameMax(), 0, 0);
- } else if (SASL_CONTINUE == code) {
- string challenge_str(challenge, challenge_len);
-
- QPID_LOG(debug, "SASL: sending challenge to client");
-
- client.secure(challenge_str);
- } else {
- QPID_LOG(info, "SASL: Authentication failed: " << sasl_errdetail(sasl_conn));
-
- // TODO: Change to more specific exceptions, when they are
- // available
- switch (code) {
- case SASL_NOMECH:
- throw ConnectionForcedException("Unsupported mechanism");
- break;
- case SASL_TRYAGAIN:
- throw ConnectionForcedException("Transient failure, try again");
- break;
- default:
- throw ConnectionForcedException("Authentication failed");
- break;
- }
- }
-}
-#endif
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SaslAuthenticator.h b/M4-RCs/qpid/cpp/src/qpid/broker/SaslAuthenticator.h
deleted file mode 100644
index 2598b6d177..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SaslAuthenticator.h
+++ /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.
- *
- */
-#ifndef _SaslAuthenticator_
-#define _SaslAuthenticator_
-
-#include "qpid/framing/amqp_types.h"
-#include "qpid/framing/AMQP_ClientProxy.h"
-#include "qpid/Exception.h"
-#include <memory>
-
-namespace qpid {
-namespace broker {
-
-class Connection;
-
-class SaslAuthenticator
-{
-public:
- virtual ~SaslAuthenticator() {}
- virtual void getMechanisms(framing::Array& mechanisms) = 0;
- virtual void start(const std::string& mechanism, const std::string& response) = 0;
- virtual void step(const std::string& response) = 0;
- virtual void getUid(std::string&) {}
- virtual void getError(std::string&) {}
-
- static bool available(void);
-
- // Initialize the SASL mechanism; throw if it fails.
- static void init(const std::string& saslName);
- static void fini(void);
-
- static std::auto_ptr<SaslAuthenticator> createAuthenticator(Connection& connection);
-};
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SemanticState.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/SemanticState.cpp
deleted file mode 100644
index d9896b388b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SemanticState.cpp
+++ /dev/null
@@ -1,669 +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 "SessionState.h"
-#include "Connection.h"
-#include "DeliverableMessage.h"
-#include "DtxAck.h"
-#include "DtxTimeout.h"
-#include "Message.h"
-#include "Queue.h"
-#include "SessionContext.h"
-#include "TxAccept.h"
-#include "TxPublish.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/log/Statement.h"
-#include "qpid/ptr_map.h"
-#include "AclModule.h"
-
-#include <boost/bind.hpp>
-#include <boost/format.hpp>
-
-#include <iostream>
-#include <sstream>
-#include <algorithm>
-#include <functional>
-
-#include <assert.h>
-
-
-namespace qpid {
-namespace broker {
-
-using std::mem_fun_ref;
-using boost::intrusive_ptr;
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-using qpid::ptr_map_ptr;
-
-SemanticState::SemanticState(DeliveryAdapter& da, SessionContext& ss)
- : session(ss),
- deliveryAdapter(da),
- tagGenerator("sgen"),
- dtxSelected(false),
- outputTasks(ss),
- authMsg(getSession().getBroker().getOptions().auth && !getSession().getConnection().isFederationLink()),
- userID(getSession().getConnection().getUserId().substr(0,getSession().getConnection().getUserId().find('@')))
-{
- acl = getSession().getBroker().getAcl();
-}
-
-SemanticState::~SemanticState() {
- //cancel all consumers
- for (ConsumerImplMap::iterator i = consumers.begin(); i != consumers.end(); i++) {
- cancel(i->second);
- }
-
- if (dtxBuffer.get()) {
- dtxBuffer->fail();
- }
- recover(true);
-}
-
-bool SemanticState::exists(const string& consumerTag){
- return consumers.find(consumerTag) != consumers.end();
-}
-
-void SemanticState::consume(const string& tag,
- Queue::shared_ptr queue, bool ackRequired, bool acquire,
- bool exclusive, const string& resumeId, uint64_t resumeTtl, const FieldTable& arguments)
-{
- ConsumerImpl::shared_ptr c(new ConsumerImpl(this, tag, queue, ackRequired, acquire, exclusive, resumeId, resumeTtl, arguments));
- queue->consume(c, exclusive);//may throw exception
- outputTasks.addOutputTask(c.get());
- consumers[tag] = c;
-}
-
-void SemanticState::cancel(const string& tag){
- ConsumerImplMap::iterator i = consumers.find(tag);
- if (i != consumers.end()) {
- cancel(i->second);
- consumers.erase(i);
- //should cancel all unacked messages for this consumer so that
- //they are not redelivered on recovery
- for_each(unacked.begin(), unacked.end(), boost::bind(&DeliveryRecord::cancel, _1, tag));
-
- }
-}
-
-
-void SemanticState::startTx()
-{
- txBuffer = TxBuffer::shared_ptr(new TxBuffer());
-}
-
-void SemanticState::commit(MessageStore* const store)
-{
- if (!txBuffer) throw
- CommandInvalidException(QPID_MSG("Session has not been selected for use with transactions"));
-
- TxOp::shared_ptr txAck(static_cast<TxOp*>(new TxAccept(accumulatedAck, unacked)));
- txBuffer->enlist(txAck);
- if (txBuffer->commitLocal(store)) {
- accumulatedAck.clear();
- } else {
- throw InternalErrorException(QPID_MSG("Commit failed"));
- }
-}
-
-void SemanticState::rollback()
-{
- if (!txBuffer)
- throw CommandInvalidException(QPID_MSG("Session has not been selected for use with transactions"));
-
- txBuffer->rollback();
- accumulatedAck.clear();
-}
-
-void SemanticState::selectDtx()
-{
- dtxSelected = true;
-}
-
-void SemanticState::startDtx(const std::string& xid, DtxManager& mgr, bool join)
-{
- if (!dtxSelected) {
- throw CommandInvalidException(QPID_MSG("Session has not been selected for use with dtx"));
- }
- dtxBuffer = DtxBuffer::shared_ptr(new DtxBuffer(xid));
- txBuffer = static_pointer_cast<TxBuffer>(dtxBuffer);
- if (join) {
- mgr.join(xid, dtxBuffer);
- } else {
- mgr.start(xid, dtxBuffer);
- }
-}
-
-void SemanticState::endDtx(const std::string& xid, bool fail)
-{
- if (!dtxBuffer) {
- throw IllegalStateException(QPID_MSG("xid " << xid << " not associated with this session"));
- }
- if (dtxBuffer->getXid() != xid) {
- throw CommandInvalidException(
- QPID_MSG("xid specified on start was " << dtxBuffer->getXid() << ", but " << xid << " specified on end"));
-
- }
-
- txBuffer.reset();//ops on this session no longer transactional
-
- checkDtxTimeout();
- if (fail) {
- dtxBuffer->fail();
- } else {
- dtxBuffer->markEnded();
- }
- dtxBuffer.reset();
-}
-
-void SemanticState::suspendDtx(const std::string& xid)
-{
- if (dtxBuffer->getXid() != xid) {
- throw CommandInvalidException(
- QPID_MSG("xid specified on start was " << dtxBuffer->getXid() << ", but " << xid << " specified on suspend"));
- }
- txBuffer.reset();//ops on this session no longer transactional
-
- checkDtxTimeout();
- dtxBuffer->setSuspended(true);
- suspendedXids[xid] = dtxBuffer;
- dtxBuffer.reset();
-}
-
-void SemanticState::resumeDtx(const std::string& xid)
-{
- if (!dtxSelected) {
- throw CommandInvalidException(QPID_MSG("Session has not been selected for use with dtx"));
- }
-
- dtxBuffer = suspendedXids[xid];
- if (!dtxBuffer) {
- throw CommandInvalidException(QPID_MSG("xid " << xid << " not attached"));
- } else {
- suspendedXids.erase(xid);
- }
-
- if (dtxBuffer->getXid() != xid) {
- throw CommandInvalidException(
- QPID_MSG("xid specified on start was " << dtxBuffer->getXid() << ", but " << xid << " specified on resume"));
-
- }
- if (!dtxBuffer->isSuspended()) {
- throw CommandInvalidException(QPID_MSG("xid " << xid << " not suspended"));
- }
-
- checkDtxTimeout();
- dtxBuffer->setSuspended(false);
- txBuffer = static_pointer_cast<TxBuffer>(dtxBuffer);
-}
-
-void SemanticState::checkDtxTimeout()
-{
- if (dtxBuffer->isExpired()) {
- dtxBuffer.reset();
- throw DtxTimeoutException();
- }
-}
-
-void SemanticState::record(const DeliveryRecord& delivery)
-{
- unacked.push_back(delivery);
-}
-
-SemanticState::ConsumerImpl::ConsumerImpl(SemanticState* _parent,
- const string& _name,
- Queue::shared_ptr _queue,
- bool ack,
- bool _acquire,
- bool _exclusive,
- const string& _resumeId,
- uint64_t _resumeTtl,
- const framing::FieldTable& _arguments
-
-
-) :
- Consumer(_acquire),
- parent(_parent),
- name(_name),
- queue(_queue),
- ackExpected(ack),
- acquire(_acquire),
- blocked(true),
- windowing(true),
- exclusive(_exclusive),
- resumeId(_resumeId),
- resumeTtl(_resumeTtl),
- arguments(_arguments),
- msgCredit(0),
- byteCredit(0),
- notifyEnabled(true) {}
-
-OwnershipToken* SemanticState::ConsumerImpl::getSession()
-{
- return &(parent->session);
-}
-
-bool SemanticState::ConsumerImpl::deliver(QueuedMessage& msg)
-{
- allocateCredit(msg.payload);
- DeliveryRecord record(msg, queue, name, acquire, !ackExpected, windowing);
- parent->deliver(record);
- if (!ackExpected) record.setEnded();//allows message to be released now its been delivered
- if (windowing || ackExpected || !acquire) {
- parent->record(record);
- }
- if (acquire && !ackExpected) {
- queue->dequeue(0, msg);
- }
- return true;
-}
-
-bool SemanticState::ConsumerImpl::filter(intrusive_ptr<Message>)
-{
- return true;
-}
-
-bool SemanticState::ConsumerImpl::accept(intrusive_ptr<Message> msg)
-{
- blocked = !(filter(msg) && checkCredit(msg));
- return !blocked;
-}
-
-void SemanticState::ConsumerImpl::allocateCredit(intrusive_ptr<Message>& msg)
-{
- uint32_t originalMsgCredit = msgCredit;
- uint32_t originalByteCredit = byteCredit;
- if (msgCredit != 0xFFFFFFFF) {
- msgCredit--;
- }
- if (byteCredit != 0xFFFFFFFF) {
- byteCredit -= msg->getRequiredCredit();
- }
- QPID_LOG(debug, "Credit allocated for '" << name << "' on " << parent
- << ", was " << " bytes: " << originalByteCredit << " msgs: " << originalMsgCredit
- << " now bytes: " << byteCredit << " msgs: " << msgCredit);
-
-}
-
-bool SemanticState::ConsumerImpl::checkCredit(intrusive_ptr<Message>& msg)
-{
- if (msgCredit == 0 || (byteCredit != 0xFFFFFFFF && byteCredit < msg->getRequiredCredit())) {
- QPID_LOG(debug, "Not enough credit for '" << name << "' on " << parent
- << ", bytes: " << byteCredit << " msgs: " << msgCredit);
- return false;
- } else {
- QPID_LOG(debug, "Credit available for '" << name << "' on " << parent
- << " bytes: " << byteCredit << " msgs: " << msgCredit);
- return true;
- }
-}
-
-SemanticState::ConsumerImpl::~ConsumerImpl() {}
-
-void SemanticState::cancel(ConsumerImpl::shared_ptr c)
-{
- c->disableNotify();
- outputTasks.removeOutputTask(c.get());
- Queue::shared_ptr queue = c->getQueue();
- if(queue) {
- queue->cancel(c);
- if (queue->canAutoDelete() && !queue->hasExclusiveOwner()) {
- Queue::tryAutoDelete(session.getBroker(), queue);
- }
- }
-}
-
-void SemanticState::handle(intrusive_ptr<Message> msg) {
- if (txBuffer.get()) {
- TxPublish* deliverable(new TxPublish(msg));
- TxOp::shared_ptr op(deliverable);
- route(msg, *deliverable);
- txBuffer->enlist(op);
- } else {
- DeliverableMessage deliverable(msg);
- route(msg, deliverable);
- }
-}
-
-namespace
-{
-const std::string nullstring;
-}
-
-void SemanticState::route(intrusive_ptr<Message> msg, Deliverable& strategy) {
- std::string exchangeName = msg->getExchangeName();
- //TODO: the following should be hidden behind message (using MessageAdapter or similar)
-
- // Do not replace the delivery-properties.exchange if it is is already set.
- // This is used internally (by the cluster) to force the exchange name on a message.
- // The client library ensures this is always empty for messages from normal clients.
- if (msg->isA<MessageTransferBody>()) {
- if (!msg->hasProperties<DeliveryProperties>() ||
- msg->getProperties<DeliveryProperties>()->getExchange().empty())
- msg->getProperties<DeliveryProperties>()->setExchange(exchangeName);
- msg->setTimestamp();
- }
- if (!cacheExchange || cacheExchange->getName() != exchangeName){
- cacheExchange = session.getBroker().getExchanges().get(exchangeName);
- }
-
- /* verify the userid if specified: */
- std::string id =
- msg->hasProperties<MessageProperties>() ? msg->getProperties<MessageProperties>()->getUserId() : nullstring;
-
- if (authMsg && !id.empty() && id != userID )
- {
- QPID_LOG(debug, "authorised user id : " << userID << " but user id in message declared as " << id);
- throw UnauthorizedAccessException(QPID_MSG("authorised user id : " << userID << " but user id in message declared as " << id));
- }
-
- if (acl && acl->doTransferAcl())
- {
- if (!acl->authorise(getSession().getConnection().getUserId(),acl::ACT_PUBLISH,acl::OBJ_EXCHANGE,exchangeName, msg->getRoutingKey() ))
- throw NotAllowedException(QPID_MSG(getSession().getConnection().getUserId() << " cannot publish to " <<
- exchangeName << " with routing-key " << msg->getRoutingKey()));
- }
-
- cacheExchange->route(strategy, msg->getRoutingKey(), msg->getApplicationHeaders());
-
- if (!strategy.delivered) {
- //TODO:if discard-unroutable, just drop it
- //TODO:else if accept-mode is explicit, reject it
- //else route it to alternate exchange
- if (cacheExchange->getAlternate()) {
- cacheExchange->getAlternate()->route(strategy, msg->getRoutingKey(), msg->getApplicationHeaders());
- }
- if (!strategy.delivered) {
- msg->destroy();
- }
- }
-
-}
-
-void SemanticState::requestDispatch()
-{
- for (ConsumerImplMap::iterator i = consumers.begin(); i != consumers.end(); i++) {
- requestDispatch(*(i->second));
- }
-}
-
-void SemanticState::requestDispatch(ConsumerImpl& c)
-{
- if(c.isBlocked())
- outputTasks.activateOutput();
-}
-
-void SemanticState::complete(DeliveryRecord& delivery)
-{
- ConsumerImplMap::iterator i = consumers.find(delivery.getTag());
- if (i != consumers.end()) {
- i->second->complete(delivery);
- }
-}
-
-void SemanticState::ConsumerImpl::complete(DeliveryRecord& delivery)
-{
- if (!delivery.isComplete()) {
- delivery.complete();
- if (windowing) {
- if (msgCredit != 0xFFFFFFFF) msgCredit++;
- if (byteCredit != 0xFFFFFFFF) byteCredit += delivery.getCredit();
- }
- }
-}
-
-void SemanticState::recover(bool requeue)
-{
- if(requeue){
- //take copy and clear unacked as requeue may result in redelivery to this session
- //which will in turn result in additions to unacked
- DeliveryRecords copy = unacked;
- unacked.clear();
- for_each(copy.rbegin(), copy.rend(), mem_fun_ref(&DeliveryRecord::requeue));
- }else{
- for_each(unacked.begin(), unacked.end(), boost::bind(&DeliveryRecord::redeliver, _1, this));
- //unconfirmed messages re redelivered and therefore have their
- //id adjusted, confirmed messages are not and so the ordering
- //w.r.t id is lost
- unacked.sort();
- }
-}
-
-void SemanticState::deliver(DeliveryRecord& msg)
-{
- return deliveryAdapter.deliver(msg);
-}
-
-SemanticState::ConsumerImpl& SemanticState::find(const std::string& destination)
-{
- ConsumerImplMap::iterator i = consumers.find(destination);
- if (i == consumers.end()) {
- throw NotFoundException(QPID_MSG("Unknown destination " << destination));
- } else {
- return *(i->second);
- }
-}
-
-void SemanticState::setWindowMode(const std::string& destination)
-{
- find(destination).setWindowMode();
-}
-
-void SemanticState::setCreditMode(const std::string& destination)
-{
- find(destination).setCreditMode();
-}
-
-void SemanticState::addByteCredit(const std::string& destination, uint32_t value)
-{
- ConsumerImpl& c = find(destination);
- c.addByteCredit(value);
- requestDispatch(c);
-}
-
-
-void SemanticState::addMessageCredit(const std::string& destination, uint32_t value)
-{
- ConsumerImpl& c = find(destination);
- c.addMessageCredit(value);
- requestDispatch(c);
-}
-
-void SemanticState::flush(const std::string& destination)
-{
- find(destination).flush();
-}
-
-
-void SemanticState::stop(const std::string& destination)
-{
- find(destination).stop();
-}
-
-void SemanticState::ConsumerImpl::setWindowMode()
-{
- windowing = true;
-}
-
-void SemanticState::ConsumerImpl::setCreditMode()
-{
- windowing = false;
-}
-
-void SemanticState::ConsumerImpl::addByteCredit(uint32_t value)
-{
- if (byteCredit != 0xFFFFFFFF) {
- byteCredit += value;
- }
-}
-
-void SemanticState::ConsumerImpl::addMessageCredit(uint32_t value)
-{
- if (msgCredit != 0xFFFFFFFF) {
- msgCredit += value;
- }
-}
-
-void SemanticState::ConsumerImpl::flush()
-{
- while(queue->dispatch(shared_from_this()))
- ;
- stop();
-}
-
-void SemanticState::ConsumerImpl::stop()
-{
- msgCredit = 0;
- byteCredit = 0;
-}
-
-Queue::shared_ptr SemanticState::getQueue(const string& name) const {
- Queue::shared_ptr queue;
- if (name.empty()) {
- throw NotAllowedException(QPID_MSG("No queue name specified."));
- } else {
- queue = session.getBroker().getQueues().find(name);
- if (!queue)
- throw NotFoundException(QPID_MSG("Queue not found: "<<name));
- }
- return queue;
-}
-
-AckRange SemanticState::findRange(DeliveryId first, DeliveryId last)
-{
- return DeliveryRecord::findRange(unacked, first, last);
-}
-
-void SemanticState::acquire(DeliveryId first, DeliveryId last, DeliveryIds& acquired)
-{
- AckRange range = findRange(first, last);
- for_each(range.start, range.end, AcquireFunctor(acquired));
-}
-
-void SemanticState::release(DeliveryId first, DeliveryId last, bool setRedelivered)
-{
- AckRange range = findRange(first, last);
- //release results in the message being added to the head so want
- //to release in reverse order to keep the original transfer order
- DeliveryRecords::reverse_iterator start(range.end);
- DeliveryRecords::reverse_iterator end(range.start);
- for_each(start, end, boost::bind(&DeliveryRecord::release, _1, setRedelivered));
-}
-
-void SemanticState::reject(DeliveryId first, DeliveryId last)
-{
- AckRange range = findRange(first, last);
- for_each(range.start, range.end, mem_fun_ref(&DeliveryRecord::reject));
- //need to remove the delivery records as well
- unacked.erase(range.start, range.end);
-}
-
-bool SemanticState::ConsumerImpl::hasOutput() {
- return queue->checkForMessages(shared_from_this());
-}
-
-bool SemanticState::ConsumerImpl::doOutput()
-{
- return queue->dispatch(shared_from_this());
-}
-
-void SemanticState::ConsumerImpl::enableNotify()
-{
- Mutex::ScopedLock l(lock);
- notifyEnabled = true;
-}
-
-void SemanticState::ConsumerImpl::disableNotify()
-{
- Mutex::ScopedLock l(lock);
- notifyEnabled = false;
-}
-
-bool SemanticState::ConsumerImpl::isNotifyEnabled() const {
- Mutex::ScopedLock l(lock);
- return notifyEnabled;
-}
-
-void SemanticState::ConsumerImpl::notify()
-{
- //TODO: alter this, don't want to hold locks across external
- //calls; for now its is required to protect the notify() from
- //having part of the object chain of the invocation being
- //concurrently deleted
- Mutex::ScopedLock l(lock);
- if (notifyEnabled) parent->outputTasks.activateOutput();
-}
-
-
-void SemanticState::accepted(DeliveryId first, DeliveryId last)
-{
- AckRange range = findRange(first, last);
- if (txBuffer.get()) {
- //in transactional mode, don't dequeue or remove, just
- //maintain set of acknowledged messages:
- accumulatedAck.add(first, last);
-
- if (dtxBuffer.get()) {
- //if enlisted in a dtx, copy the relevant slice from
- //unacked and record it against that transaction
- TxOp::shared_ptr txAck(new DtxAck(accumulatedAck, unacked));
- accumulatedAck.clear();
- dtxBuffer->enlist(txAck);
-
- //mark the relevant messages as 'ended' in unacked
- for_each(range.start, range.end, mem_fun_ref(&DeliveryRecord::setEnded));
-
- //if the messages are already completed, they can be
- //removed from the record
- unacked.remove_if(mem_fun_ref(&DeliveryRecord::isRedundant));
-
- }
- } else {
- for_each(range.start, range.end, boost::bind(&DeliveryRecord::accept, _1, (TransactionContext*) 0));
- unacked.remove_if(mem_fun_ref(&DeliveryRecord::isRedundant));
- }
-}
-
-void SemanticState::completed(DeliveryId first, DeliveryId last)
-{
- AckRange range = findRange(first, last);
- for_each(range.start, range.end, boost::bind(&SemanticState::complete, this, _1));
- unacked.remove_if(mem_fun_ref(&DeliveryRecord::isRedundant));
- requestDispatch();
-}
-
-void SemanticState::attached()
-{
- for (ConsumerImplMap::iterator i = consumers.begin(); i != consumers.end(); i++) {
- i->second->enableNotify();
- }
-}
-
-void SemanticState::detached()
-{
- for (ConsumerImplMap::iterator i = consumers.begin(); i != consumers.end(); i++) {
- i->second->disableNotify();
- }
-}
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SemanticState.h b/M4-RCs/qpid/cpp/src/qpid/broker/SemanticState.h
deleted file mode 100644
index 340017ddf0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SemanticState.h
+++ /dev/null
@@ -1,232 +0,0 @@
-#ifndef QPID_BROKER_SEMANTICSTATE_H
-#define QPID_BROKER_SEMANTICSTATE_H
-
-/*
- *
- * 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 "Consumer.h"
-#include "Deliverable.h"
-#include "DeliveryAdapter.h"
-#include "DeliveryRecord.h"
-#include "DtxBuffer.h"
-#include "DtxManager.h"
-#include "NameGenerator.h"
-#include "TxBuffer.h"
-
-#include "qpid/framing/FrameHandler.h"
-#include "qpid/framing/SequenceSet.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/sys/AggregateOutput.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/shared_ptr.h"
-#include "AclModule.h"
-
-#include <list>
-#include <map>
-#include <vector>
-
-#include <boost/intrusive_ptr.hpp>
-#include <boost/cast.hpp>
-
-namespace qpid {
-namespace broker {
-
-class SessionContext;
-
-/**
- * SemanticState holds the L3 and L4 state of an open session, whether
- * attached to a channel or suspended.
- */
-class SemanticState : public sys::OutputTask,
- private boost::noncopyable
-{
- public:
- class ConsumerImpl : public Consumer, public sys::OutputTask,
- public boost::enable_shared_from_this<ConsumerImpl>
- {
- mutable qpid::sys::Mutex lock;
- SemanticState* const parent;
- const string name;
- const Queue::shared_ptr queue;
- const bool ackExpected;
- const bool acquire;
- bool blocked;
- bool windowing;
- bool exclusive;
- string resumeId;
- uint64_t resumeTtl;
- framing::FieldTable arguments;
- uint32_t msgCredit;
- uint32_t byteCredit;
- bool notifyEnabled;
-
- bool checkCredit(boost::intrusive_ptr<Message>& msg);
- void allocateCredit(boost::intrusive_ptr<Message>& msg);
-
- public:
- typedef boost::shared_ptr<ConsumerImpl> shared_ptr;
-
- ConsumerImpl(SemanticState* parent,
- const string& name, Queue::shared_ptr queue,
- bool ack, bool acquire, bool exclusive,
- const std::string& resumeId, uint64_t resumeTtl, const framing::FieldTable& arguments);
- ~ConsumerImpl();
- OwnershipToken* getSession();
- bool deliver(QueuedMessage& msg);
- bool filter(boost::intrusive_ptr<Message> msg);
- bool accept(boost::intrusive_ptr<Message> msg);
-
- void disableNotify();
- void enableNotify();
- void notify();
- bool isNotifyEnabled() const;
-
- void setWindowMode();
- void setCreditMode();
- void addByteCredit(uint32_t value);
- void addMessageCredit(uint32_t value);
- void flush();
- void stop();
- void complete(DeliveryRecord&);
- Queue::shared_ptr getQueue() const { return queue; }
- bool isBlocked() const { return blocked; }
- bool setBlocked(bool set) { std::swap(set, blocked); return set; }
-
- bool hasOutput();
- bool doOutput();
-
- std::string getName() const { return name; }
-
- bool isAckExpected() const { return ackExpected; }
- bool isAcquire() const { return acquire; }
- bool isWindowing() const { return windowing; }
- bool isExclusive() const { return exclusive; }
- uint32_t getMsgCredit() const { return msgCredit; }
- uint32_t getByteCredit() const { return byteCredit; }
- std::string getResumeId() const { return resumeId; };
- uint64_t getResumeTtl() const { return resumeTtl; }
- const framing::FieldTable& getArguments() const { return arguments; }
- };
-
- private:
- typedef std::map<std::string, ConsumerImpl::shared_ptr> ConsumerImplMap;
- typedef std::map<std::string, DtxBuffer::shared_ptr> DtxBufferMap;
-
- SessionContext& session;
- DeliveryAdapter& deliveryAdapter;
- ConsumerImplMap consumers;
- NameGenerator tagGenerator;
- DeliveryRecords unacked;
- TxBuffer::shared_ptr txBuffer;
- DtxBuffer::shared_ptr dtxBuffer;
- bool dtxSelected;
- DtxBufferMap suspendedXids;
- framing::SequenceSet accumulatedAck;
- boost::shared_ptr<Exchange> cacheExchange;
- sys::AggregateOutput outputTasks;
- AclModule* acl;
- const bool authMsg;
- const string userID;
-
- void route(boost::intrusive_ptr<Message> msg, Deliverable& strategy);
- void checkDtxTimeout();
-
- void complete(DeliveryRecord&);
- AckRange findRange(DeliveryId first, DeliveryId last);
- void requestDispatch();
- void requestDispatch(ConsumerImpl&);
- void cancel(ConsumerImpl::shared_ptr);
-
- public:
- SemanticState(DeliveryAdapter&, SessionContext&);
- ~SemanticState();
-
- SessionContext& getSession() { return session; }
-
- ConsumerImpl& find(const std::string& destination);
-
- /**
- * Get named queue, never returns 0.
- * @return: named queue
- * @exception: ChannelException if no queue of that name is found.
- * @exception: ConnectionException if name="" and session has no default.
- */
- Queue::shared_ptr getQueue(const std::string& name) const;
-
- bool exists(const string& consumerTag);
-
- void consume(const string& destination,
- Queue::shared_ptr queue,
- bool ackRequired, bool acquire, bool exclusive,
- const string& resumeId=string(), uint64_t resumeTtl=0,
- const framing::FieldTable& = framing::FieldTable());
-
- void cancel(const string& tag);
-
- void setWindowMode(const std::string& destination);
- void setCreditMode(const std::string& destination);
- void addByteCredit(const std::string& destination, uint32_t value);
- void addMessageCredit(const std::string& destination, uint32_t value);
- void flush(const std::string& destination);
- void stop(const std::string& destination);
-
- void startTx();
- void commit(MessageStore* const store);
- void rollback();
- void selectDtx();
- void startDtx(const std::string& xid, DtxManager& mgr, bool join);
- void endDtx(const std::string& xid, bool fail);
- void suspendDtx(const std::string& xid);
- void resumeDtx(const std::string& xid);
- void recover(bool requeue);
- void deliver(DeliveryRecord& message);
- void acquire(DeliveryId first, DeliveryId last, DeliveryIds& acquired);
- void release(DeliveryId first, DeliveryId last, bool setRedelivered);
- void reject(DeliveryId first, DeliveryId last);
- void handle(boost::intrusive_ptr<Message> msg);
- bool hasOutput() { return outputTasks.hasOutput(); }
- bool doOutput() { return outputTasks.doOutput(); }
-
- //final 0-10 spec (completed and accepted are distinct):
- void completed(DeliveryId deliveryTag, DeliveryId endTag);
- void accepted(DeliveryId deliveryTag, DeliveryId endTag);
-
- void attached();
- void detached();
-
- // Used by cluster to re-create replica sessions
- static ConsumerImpl* castToConsumerImpl(OutputTask* p) { return boost::polymorphic_downcast<ConsumerImpl*>(p); }
-
- template <class F> void eachConsumer(F f) { outputTasks.eachOutput(boost::bind(f, boost::bind(castToConsumerImpl, _1))); }
- DeliveryRecords& getUnacked() { return unacked; }
- framing::SequenceSet getAccumulatedAck() const { return accumulatedAck; }
- TxBuffer::shared_ptr getTxBuffer() const { return txBuffer; }
- void setTxBuffer(const TxBuffer::shared_ptr& txb) { txBuffer = txb; }
- void setAccumulatedAck(const framing::SequenceSet& s) { accumulatedAck = s; }
- void record(const DeliveryRecord& delivery);
-};
-
-}} // namespace qpid::broker
-
-
-
-
-#endif /*!QPID_BROKER_SEMANTICSTATE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SessionAdapter.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
deleted file mode 100644
index 4450d56efb..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SessionAdapter.cpp
+++ /dev/null
@@ -1,749 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-#include "SessionAdapter.h"
-#include "Connection.h"
-#include "Queue.h"
-#include "qpid/Exception.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/framing/enum.h"
-#include "qpid/log/Statement.h"
-#include "qpid/framing/SequenceSet.h"
-#include "qpid/agent/ManagementAgent.h"
-#include "qmf/org/apache/qpid/broker/EventExchangeDeclare.h"
-#include "qmf/org/apache/qpid/broker/EventExchangeDelete.h"
-#include "qmf/org/apache/qpid/broker/EventQueueDeclare.h"
-#include "qmf/org/apache/qpid/broker/EventQueueDelete.h"
-#include "qmf/org/apache/qpid/broker/EventBind.h"
-#include "qmf/org/apache/qpid/broker/EventUnbind.h"
-#include "qmf/org/apache/qpid/broker/EventSubscribe.h"
-#include "qmf/org/apache/qpid/broker/EventUnsubscribe.h"
-#include <boost/format.hpp>
-#include <boost/cast.hpp>
-#include <boost/bind.hpp>
-
-namespace qpid {
-namespace broker {
-
-using namespace qpid;
-using namespace qpid::framing;
-using namespace qpid::framing::dtx;
-using namespace qpid::management;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-typedef std::vector<Queue::shared_ptr> QueueVector;
-
-SessionAdapter::SessionAdapter(SemanticState& s) :
- HandlerImpl(s),
- exchangeImpl(s),
- queueImpl(s),
- messageImpl(s),
- executionImpl(s),
- txImpl(s),
- dtxImpl(s)
-{}
-
-
-void SessionAdapter::ExchangeHandlerImpl::declare(const string& exchange, const string& type,
- const string& alternateExchange,
- bool passive, bool durable, bool /*autoDelete*/, const FieldTable& args){
-
- AclModule* acl = getBroker().getAcl();
- if (acl) {
- std::map<acl::Property, std::string> params;
- params.insert(make_pair(acl::PROP_TYPE, type));
- params.insert(make_pair(acl::PROP_ALTERNATE, alternateExchange));
- params.insert(make_pair(acl::PROP_PASSIVE, std::string(passive ? "true" : "false") ));
- params.insert(make_pair(acl::PROP_DURABLE, std::string(durable ? "true" : "false")));
- if (!acl->authorise(getConnection().getUserId(),acl::ACT_CREATE,acl::OBJ_EXCHANGE,exchange,&params) )
- throw NotAllowedException("ACL denied exhange declare request");
- }
-
- //TODO: implement autoDelete
- Exchange::shared_ptr alternate;
- if (!alternateExchange.empty()) {
- alternate = getBroker().getExchanges().get(alternateExchange);
- }
- if(passive){
- Exchange::shared_ptr actual(getBroker().getExchanges().get(exchange));
- checkType(actual, type);
- checkAlternate(actual, alternate);
- }else{
- try{
- std::pair<Exchange::shared_ptr, bool> response = getBroker().getExchanges().declare(exchange, type, durable, args);
- if (response.second) {
- if (durable) {
- getBroker().getStore().create(*response.first, args);
- }
- if (alternate) {
- response.first->setAlternate(alternate);
- alternate->incAlternateUsers();
- }
- } else {
- checkType(response.first, type);
- checkAlternate(response.first, alternate);
- }
-
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent)
- agent->raiseEvent(_qmf::EventExchangeDeclare(getConnection().getUrl(), getConnection().getUserId(), exchange, type,
- alternateExchange, durable, false, args,
- response.second ? "created" : "existing"));
-
- }catch(UnknownExchangeTypeException& /*e*/){
- throw CommandInvalidException(QPID_MSG("Exchange type not implemented: " << type));
- }
- }
-}
-
-void SessionAdapter::ExchangeHandlerImpl::checkType(Exchange::shared_ptr exchange, const std::string& type)
-{
- if (!type.empty() && exchange->getType() != type) {
- throw NotAllowedException(QPID_MSG("Exchange declared to be of type " << exchange->getType() << ", requested " << type));
- }
-}
-
-void SessionAdapter::ExchangeHandlerImpl::checkAlternate(Exchange::shared_ptr exchange, Exchange::shared_ptr alternate)
-{
- if (alternate && alternate != exchange->getAlternate())
- throw NotAllowedException(QPID_MSG("Exchange declared with alternate-exchange "
- << exchange->getAlternate()->getName() << ", requested "
- << alternate->getName()));
-}
-
-void SessionAdapter::ExchangeHandlerImpl::delete_(const string& name, bool /*ifUnused*/)
-{
- AclModule* acl = getBroker().getAcl();
- if (acl) {
- if (!acl->authorise(getConnection().getUserId(),acl::ACT_DELETE,acl::OBJ_EXCHANGE,name,NULL) )
- throw NotAllowedException("ACL denied exhange delete request");
- }
-
- //TODO: implement unused
- Exchange::shared_ptr exchange(getBroker().getExchanges().get(name));
- if (exchange->inUseAsAlternate()) throw NotAllowedException(QPID_MSG("Exchange in use as alternate-exchange."));
- if (exchange->isDurable()) getBroker().getStore().destroy(*exchange);
- if (exchange->getAlternate()) exchange->getAlternate()->decAlternateUsers();
- getBroker().getExchanges().destroy(name);
-
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent)
- agent->raiseEvent(_qmf::EventExchangeDelete(getConnection().getUrl(), getConnection().getUserId(), name));
-}
-
-ExchangeQueryResult SessionAdapter::ExchangeHandlerImpl::query(const string& name)
-{
- AclModule* acl = getBroker().getAcl();
- if (acl) {
- if (!acl->authorise(getConnection().getUserId(),acl::ACT_ACCESS,acl::OBJ_EXCHANGE,name,NULL) )
- throw NotAllowedException("ACL denied exhange query request");
- }
-
- try {
- Exchange::shared_ptr exchange(getBroker().getExchanges().get(name));
- return ExchangeQueryResult(exchange->getType(), exchange->isDurable(), false, exchange->getArgs());
- } catch (const NotFoundException& /*e*/) {
- return ExchangeQueryResult("", false, true, FieldTable());
- }
-}
-
-void SessionAdapter::ExchangeHandlerImpl::bind(const string& queueName,
- const string& exchangeName, const string& routingKey,
- const FieldTable& arguments)
-{
- AclModule* acl = getBroker().getAcl();
- if (acl) {
- if (!acl->authorise(getConnection().getUserId(),acl::ACT_BIND,acl::OBJ_EXCHANGE,exchangeName,routingKey) )
- throw NotAllowedException("ACL denied exhange bind request");
- }
-
- Queue::shared_ptr queue = getQueue(queueName);
- Exchange::shared_ptr exchange = getBroker().getExchanges().get(exchangeName);
- if(exchange){
- string exchangeRoutingKey = routingKey.empty() && queueName.empty() ? queue->getName() : routingKey;
- if (exchange->bind(queue, exchangeRoutingKey, &arguments)) {
- queue->bound(exchangeName, routingKey, arguments);
- if (exchange->isDurable() && queue->isDurable()) {
- getBroker().getStore().bind(*exchange, *queue, routingKey, arguments);
- }
-
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent)
- agent->raiseEvent(_qmf::EventBind(getConnection().getUrl(), getConnection().getUserId(), exchangeName, queueName, exchangeRoutingKey, arguments));
- }
- }else{
- throw NotFoundException("Bind failed. No such exchange: " + exchangeName);
- }
-}
-
-void SessionAdapter::ExchangeHandlerImpl::unbind(const string& queueName,
- const string& exchangeName,
- const string& routingKey)
-{
- AclModule* acl = getBroker().getAcl();
- if (acl) {
- std::map<acl::Property, std::string> params;
- params.insert(make_pair(acl::PROP_QUEUENAME, queueName));
- params.insert(make_pair(acl::PROP_ROUTINGKEY, routingKey));
- if (!acl->authorise(getConnection().getUserId(),acl::ACT_UNBIND,acl::OBJ_EXCHANGE,exchangeName,&params) )
- throw NotAllowedException("ACL denied exchange unbind request");
- }
-
- Queue::shared_ptr queue = getQueue(queueName);
- if (!queue.get()) throw NotFoundException("Unbind failed. No such exchange: " + exchangeName);
-
- Exchange::shared_ptr exchange = getBroker().getExchanges().get(exchangeName);
- if (!exchange.get()) throw NotFoundException("Unbind failed. No such exchange: " + exchangeName);
-
- //TODO: revise unbind to rely solely on binding key (not args)
- if (exchange->unbind(queue, routingKey, 0)) {
- if (exchange->isDurable() && queue->isDurable())
- getBroker().getStore().unbind(*exchange, *queue, routingKey, FieldTable());
-
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent)
- agent->raiseEvent(_qmf::EventUnbind(getConnection().getUrl(), getConnection().getUserId(), exchangeName, queueName, routingKey));
- }
-}
-
-ExchangeBoundResult SessionAdapter::ExchangeHandlerImpl::bound(const std::string& exchangeName,
- const std::string& queueName,
- const std::string& key,
- const framing::FieldTable& args)
-{
- AclModule* acl = getBroker().getAcl();
- if (acl) {
- std::map<acl::Property, std::string> params;
- params.insert(make_pair(acl::PROP_QUEUENAME, queueName));
- params.insert(make_pair(acl::PROP_ROUTINGKEY, key));
- if (!acl->authorise(getConnection().getUserId(),acl::ACT_CREATE,acl::OBJ_EXCHANGE,exchangeName,&params) )
- throw NotAllowedException("ACL denied exhange bound request");
- }
-
- Exchange::shared_ptr exchange;
- try {
- exchange = getBroker().getExchanges().get(exchangeName);
- } catch (const NotFoundException&) {}
-
- Queue::shared_ptr queue;
- if (!queueName.empty()) {
- queue = getBroker().getQueues().find(queueName);
- }
-
- if (!exchange) {
- return ExchangeBoundResult(true, false, false, false, false);
- } else if (!queueName.empty() && !queue) {
- return ExchangeBoundResult(false, true, false, false, false);
- } else if (exchange->isBound(queue, key.empty() ? 0 : &key, args.count() > 0 ? &args : &args)) {
- return ExchangeBoundResult(false, false, false, false, false);
- } else {
- //need to test each specified option individually
- bool queueMatched = queueName.empty() || exchange->isBound(queue, 0, 0);
- bool keyMatched = key.empty() || exchange->isBound(Queue::shared_ptr(), &key, 0);
- bool argsMatched = args.count() == 0 || exchange->isBound(Queue::shared_ptr(), 0, &args);
-
- return ExchangeBoundResult(false, false, !queueMatched, !keyMatched, !argsMatched);
- }
-}
-
-SessionAdapter::QueueHandlerImpl::QueueHandlerImpl(SemanticState& session) : HandlerHelper(session), broker(getBroker())
-{}
-
-
-SessionAdapter::QueueHandlerImpl::~QueueHandlerImpl()
-{
- try {
- destroyExclusiveQueues();
- } catch (std::exception& e) {
- QPID_LOG(error, e.what());
- }
-}
-
-void SessionAdapter::QueueHandlerImpl::destroyExclusiveQueues()
-{
- while (!exclusiveQueues.empty()) {
- Queue::shared_ptr q(exclusiveQueues.front());
- q->releaseExclusiveOwnership();
- if (q->canAutoDelete()) {
- Queue::tryAutoDelete(broker, q);
- }
- exclusiveQueues.erase(exclusiveQueues.begin());
- }
-}
-
-
-bool SessionAdapter::QueueHandlerImpl::isLocal(const ConnectionToken* t) const
-{
- return session.isLocal(t);
-}
-
-
-QueueQueryResult SessionAdapter::QueueHandlerImpl::query(const string& name)
-{
- AclModule* acl = getBroker().getAcl();
- if (acl) {
- if (!acl->authorise(getConnection().getUserId(),acl::ACT_ACCESS,acl::OBJ_QUEUE,name,NULL) )
- throw NotAllowedException("ACL denied queue query request");
- }
-
- Queue::shared_ptr queue = session.getBroker().getQueues().find(name);
- if (queue) {
-
- Exchange::shared_ptr alternateExchange = queue->getAlternateExchange();
-
- return QueueQueryResult(queue->getName(),
- alternateExchange ? alternateExchange->getName() : "",
- queue->isDurable(),
- queue->hasExclusiveOwner(),
- queue->isAutoDelete(),
- queue->getSettings(),
- queue->getMessageCount(),
- queue->getConsumerCount());
- } else {
- return QueueQueryResult();
- }
-}
-
-void SessionAdapter::QueueHandlerImpl::declare(const string& name, const string& alternateExchange,
- bool passive, bool durable, bool exclusive,
- bool autoDelete, const qpid::framing::FieldTable& arguments)
-{
- AclModule* acl = getBroker().getAcl();
- if (acl) {
- std::map<acl::Property, std::string> params;
- params.insert(make_pair(acl::PROP_ALTERNATE, alternateExchange));
- params.insert(make_pair(acl::PROP_PASSIVE, std::string(passive ? "true" : "false") ));
- params.insert(make_pair(acl::PROP_DURABLE, std::string(durable ? "true" : "false")));
- params.insert(make_pair(acl::PROP_EXCLUSIVE, std::string(exclusive ? "true" : "false")));
- params.insert(make_pair(acl::PROP_AUTODELETE, std::string(autoDelete ? "true" : "false")));
- if (!acl->authorise(getConnection().getUserId(),acl::ACT_CREATE,acl::OBJ_QUEUE,name,&params) )
- throw NotAllowedException("ACL denied queue create request");
- }
-
- Exchange::shared_ptr alternate;
- if (!alternateExchange.empty()) {
- alternate = getBroker().getExchanges().get(alternateExchange);
- }
- Queue::shared_ptr queue;
- if (passive && !name.empty()) {
- queue = getQueue(name);
- //TODO: check alternate-exchange is as expected
- } else {
- std::pair<Queue::shared_ptr, bool> queue_created =
- getBroker().getQueues().declare(name, durable,
- autoDelete,
- exclusive ? &session : 0);
- queue = queue_created.first;
- assert(queue);
- if (queue_created.second) { // This is a new queue
- if (alternate) {
- queue->setAlternateExchange(alternate);
- alternate->incAlternateUsers();
- }
-
- //apply settings & create persistent record if required
- queue_created.first->create(arguments);
-
- //add default binding:
- getBroker().getExchanges().getDefault()->bind(queue, name, 0);
- queue->bound(getBroker().getExchanges().getDefault()->getName(), name, arguments);
-
- //handle automatic cleanup:
- if (exclusive) {
- exclusiveQueues.push_back(queue);
- }
- } else {
- if (exclusive && queue->setExclusiveOwner(&session)) {
- exclusiveQueues.push_back(queue);
- }
- }
-
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent)
- agent->raiseEvent(_qmf::EventQueueDeclare(getConnection().getUrl(), getConnection().getUserId(),
- name, durable, exclusive, autoDelete, arguments,
- queue_created.second ? "created" : "existing"));
- }
-
- if (exclusive && !queue->isExclusiveOwner(&session))
- throw ResourceLockedException(QPID_MSG("Cannot grant exclusive access to queue "
- << queue->getName()));
-}
-
-
-void SessionAdapter::QueueHandlerImpl::purge(const string& queue){
- AclModule* acl = getBroker().getAcl();
- if (acl)
- {
- if (!acl->authorise(getConnection().getUserId(),acl::ACT_PURGE,acl::OBJ_QUEUE,queue,NULL) )
- throw NotAllowedException("ACL denied queue purge request");
- }
- getQueue(queue)->purge();
-}
-
-void SessionAdapter::QueueHandlerImpl::delete_(const string& queue, bool ifUnused, bool ifEmpty){
-
- AclModule* acl = getBroker().getAcl();
- if (acl)
- {
- if (!acl->authorise(getConnection().getUserId(),acl::ACT_DELETE,acl::OBJ_QUEUE,queue,NULL) )
- throw NotAllowedException("ACL denied queue delete request");
- }
-
- Queue::shared_ptr q = getQueue(queue);
- if (q->hasExclusiveOwner() && !q->isExclusiveOwner(&session))
- throw ResourceLockedException(QPID_MSG("Cannot delete queue "
- << queue << "; it is exclusive to another session"));
- if(ifEmpty && q->getMessageCount() > 0){
- throw PreconditionFailedException("Queue not empty.");
- }else if(ifUnused && q->getConsumerCount() > 0){
- throw PreconditionFailedException("Queue in use.");
- }else{
- //remove the queue from the list of exclusive queues if necessary
- if(q->isExclusiveOwner(&getConnection())){
- QueueVector::iterator i = std::find(getConnection().exclusiveQueues.begin(), getConnection().exclusiveQueues.end(), q);
- if(i < getConnection().exclusiveQueues.end()) getConnection().exclusiveQueues.erase(i);
- }
- q->destroy();
- getBroker().getQueues().destroy(queue);
- q->unbind(getBroker().getExchanges(), q);
-
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent)
- agent->raiseEvent(_qmf::EventQueueDelete(getConnection().getUrl(), getConnection().getUserId(), queue));
- }
-}
-
-
-SessionAdapter::MessageHandlerImpl::MessageHandlerImpl(SemanticState& s) :
- HandlerHelper(s),
- releaseRedeliveredOp(boost::bind(&SemanticState::release, &state, _1, _2, true)),
- releaseOp(boost::bind(&SemanticState::release, &state, _1, _2, false)),
- rejectOp(boost::bind(&SemanticState::reject, &state, _1, _2)),
- acceptOp(boost::bind(&SemanticState::accepted, &state, _1, _2))
- {}
-
-//
-// Message class method handlers
-//
-
-void SessionAdapter::MessageHandlerImpl::transfer(const string& /*destination*/,
- uint8_t /*acceptMode*/,
- uint8_t /*acquireMode*/)
-{
- //not yet used (content containing assemblies treated differently at present
- std::cout << "SessionAdapter::MessageHandlerImpl::transfer() called" << std::endl;
-}
-
-void SessionAdapter::MessageHandlerImpl::release(const SequenceSet& transfers, bool setRedelivered)
-{
- transfers.for_each(setRedelivered ? releaseRedeliveredOp : releaseOp);
-}
-
-void
-SessionAdapter::MessageHandlerImpl::subscribe(const string& queueName,
- const string& destination,
- uint8_t acceptMode,
- uint8_t acquireMode,
- bool exclusive,
- const string& resumeId,
- uint64_t resumeTtl,
- const FieldTable& arguments)
-{
-
- AclModule* acl = getBroker().getAcl();
- if (acl)
- {
- // add flags as needed
- if (!acl->authorise(getConnection().getUserId(),acl::ACT_CONSUME,acl::OBJ_QUEUE,queueName,NULL) )
- throw NotAllowedException("ACL denied Queue subscribe request");
- }
-
- Queue::shared_ptr queue = getQueue(queueName);
- if(!destination.empty() && state.exists(destination))
- throw NotAllowedException(QPID_MSG("Consumer tags must be unique"));
- if (queue->hasExclusiveOwner() && !queue->isExclusiveOwner(&session))
- throw ResourceLockedException(QPID_MSG("Cannot subscribe to exclusive queue "
- << queue->getName()));
-
- state.consume(destination, queue,
- acceptMode == 0, acquireMode == 0, exclusive,
- resumeId, resumeTtl, arguments);
-
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent)
- agent->raiseEvent(_qmf::EventSubscribe(getConnection().getUrl(), getConnection().getUserId(),
- queueName, destination, exclusive, arguments));
-}
-
-void
-SessionAdapter::MessageHandlerImpl::cancel(const string& destination )
-{
- state.cancel(destination);
-
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent)
- agent->raiseEvent(_qmf::EventUnsubscribe(getConnection().getUrl(), getConnection().getUserId(), destination));
-}
-
-void
-SessionAdapter::MessageHandlerImpl::reject(const SequenceSet& transfers, uint16_t /*code*/, const string& /*text*/ )
-{
- transfers.for_each(rejectOp);
-}
-
-void SessionAdapter::MessageHandlerImpl::flow(const std::string& destination, uint8_t unit, uint32_t value)
-{
- if (unit == 0) {
- //message
- state.addMessageCredit(destination, value);
- } else if (unit == 1) {
- //bytes
- state.addByteCredit(destination, value);
- } else {
- //unknown
- throw InvalidArgumentException(QPID_MSG("Invalid value for unit " << unit));
- }
-
-}
-
-void SessionAdapter::MessageHandlerImpl::setFlowMode(const std::string& destination, uint8_t mode)
-{
- if (mode == 0) {
- //credit
- state.setCreditMode(destination);
- } else if (mode == 1) {
- //window
- state.setWindowMode(destination);
- } else{
- throw InvalidArgumentException(QPID_MSG("Invalid value for mode " << mode));
- }
-}
-
-void SessionAdapter::MessageHandlerImpl::flush(const std::string& destination)
-{
- state.flush(destination);
-}
-
-void SessionAdapter::MessageHandlerImpl::stop(const std::string& destination)
-{
- state.stop(destination);
-}
-
-void SessionAdapter::MessageHandlerImpl::accept(const framing::SequenceSet& commands)
-{
-
- commands.for_each(acceptOp);
-}
-
-framing::MessageAcquireResult SessionAdapter::MessageHandlerImpl::acquire(const framing::SequenceSet& transfers)
-{
- // FIXME aconway 2008-05-12: create SequenceSet directly, no need for intermediate results vector.
- SequenceNumberSet results;
- RangedOperation f = boost::bind(&SemanticState::acquire, &state, _1, _2, boost::ref(results));
- transfers.for_each(f);
-
- results = results.condense();
- SequenceSet acquisitions;
- RangedOperation g = boost::bind(&SequenceSet::add, &acquisitions, _1, _2);
- results.processRanges(g);
-
- return MessageAcquireResult(acquisitions);
-}
-
-framing::MessageResumeResult SessionAdapter::MessageHandlerImpl::resume(const std::string& /*destination*/,
- const std::string& /*resumeId*/)
-{
- throw NotImplementedException("resuming transfers not yet supported");
-}
-
-
-
-void SessionAdapter::ExecutionHandlerImpl::sync() {} //essentially a no-op
-
-void SessionAdapter::ExecutionHandlerImpl::result(const SequenceNumber& /*commandId*/, const string& /*value*/)
-{
- //TODO: but currently never used client->server
-}
-
-void SessionAdapter::ExecutionHandlerImpl::exception(uint16_t /*errorCode*/,
- const SequenceNumber& /*commandId*/,
- uint8_t /*classCode*/,
- uint8_t /*commandCode*/,
- uint8_t /*fieldIndex*/,
- const std::string& /*description*/,
- const framing::FieldTable& /*errorInfo*/)
-{
- //TODO: again, not really used client->server but may be important
- //for inter-broker links
-}
-
-
-
-void SessionAdapter::TxHandlerImpl::select()
-{
- state.startTx();
-}
-
-void SessionAdapter::TxHandlerImpl::commit()
-{
- state.commit(&getBroker().getStore());
-}
-
-void SessionAdapter::TxHandlerImpl::rollback()
-{
- state.rollback();
-}
-
-std::string SessionAdapter::DtxHandlerImpl::convert(const framing::Xid& xid)
-{
- std::string encoded;
- encode(xid, encoded);
- return encoded;
-}
-
-void SessionAdapter::DtxHandlerImpl::select()
-{
- state.selectDtx();
-}
-
-XaResult SessionAdapter::DtxHandlerImpl::end(const Xid& xid,
- bool fail,
- bool suspend)
-{
- try {
- if (fail) {
- state.endDtx(convert(xid), true);
- if (suspend) {
- throw CommandInvalidException(QPID_MSG("End and suspend cannot both be set."));
- } else {
- return XaResult(XA_STATUS_XA_RBROLLBACK);
- }
- } else {
- if (suspend) {
- state.suspendDtx(convert(xid));
- } else {
- state.endDtx(convert(xid), false);
- }
- return XaResult(XA_STATUS_XA_OK);
- }
- } catch (const DtxTimeoutException& /*e*/) {
- return XaResult(XA_STATUS_XA_RBTIMEOUT);
- }
-}
-
-XaResult SessionAdapter::DtxHandlerImpl::start(const Xid& xid,
- bool join,
- bool resume)
-{
- if (join && resume) {
- throw CommandInvalidException(QPID_MSG("Join and resume cannot both be set."));
- }
- try {
- if (resume) {
- state.resumeDtx(convert(xid));
- } else {
- state.startDtx(convert(xid), getBroker().getDtxManager(), join);
- }
- return XaResult(XA_STATUS_XA_OK);
- } catch (const DtxTimeoutException& /*e*/) {
- return XaResult(XA_STATUS_XA_RBTIMEOUT);
- }
-}
-
-XaResult SessionAdapter::DtxHandlerImpl::prepare(const Xid& xid)
-{
- try {
- bool ok = getBroker().getDtxManager().prepare(convert(xid));
- return XaResult(ok ? XA_STATUS_XA_OK : XA_STATUS_XA_RBROLLBACK);
- } catch (const DtxTimeoutException& /*e*/) {
- return XaResult(XA_STATUS_XA_RBTIMEOUT);
- }
-}
-
-XaResult SessionAdapter::DtxHandlerImpl::commit(const Xid& xid,
- bool onePhase)
-{
- try {
- bool ok = getBroker().getDtxManager().commit(convert(xid), onePhase);
- return XaResult(ok ? XA_STATUS_XA_OK : XA_STATUS_XA_RBROLLBACK);
- } catch (const DtxTimeoutException& /*e*/) {
- return XaResult(XA_STATUS_XA_RBTIMEOUT);
- }
-}
-
-
-XaResult SessionAdapter::DtxHandlerImpl::rollback(const Xid& xid)
-{
- try {
- getBroker().getDtxManager().rollback(convert(xid));
- return XaResult(XA_STATUS_XA_OK);
- } catch (const DtxTimeoutException& /*e*/) {
- return XaResult(XA_STATUS_XA_RBTIMEOUT);
- }
-}
-
-DtxRecoverResult SessionAdapter::DtxHandlerImpl::recover()
-{
- std::set<std::string> xids;
- getBroker().getStore().collectPreparedXids(xids);
- /*
- * create array of long structs
- */
- Array indoubt(0xAB);
- for (std::set<std::string>::iterator i = xids.begin(); i != xids.end(); i++) {
- boost::shared_ptr<FieldValue> xid(new Struct32Value(*i));
- indoubt.add(xid);
- }
- return DtxRecoverResult(indoubt);
-}
-
-void SessionAdapter::DtxHandlerImpl::forget(const Xid& xid)
-{
- //Currently no heuristic completion is supported, so this should never be used.
- throw NotImplementedException(QPID_MSG("Forget not implemented. Branch with xid " << xid << " not heuristically completed!"));
-}
-
-DtxGetTimeoutResult SessionAdapter::DtxHandlerImpl::getTimeout(const Xid& xid)
-{
- uint32_t timeout = getBroker().getDtxManager().getTimeout(convert(xid));
- return DtxGetTimeoutResult(timeout);
-}
-
-
-void SessionAdapter::DtxHandlerImpl::setTimeout(const Xid& xid,
- uint32_t timeout)
-{
- getBroker().getDtxManager().setTimeout(convert(xid), timeout);
-}
-
-
-Queue::shared_ptr SessionAdapter::HandlerHelper::getQueue(const string& name) const {
- Queue::shared_ptr queue;
- if (name.empty()) {
- throw framing::IllegalArgumentException(QPID_MSG("No queue name specified."));
- } else {
- queue = session.getBroker().getQueues().find(name);
- if (!queue)
- throw framing::NotFoundException(QPID_MSG("Queue not found: "<<name));
- }
- return queue;
-}
-
-}} // namespace qpid::broker
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SessionAdapter.h b/M4-RCs/qpid/cpp/src/qpid/broker/SessionAdapter.h
deleted file mode 100644
index 60a5a0f285..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SessionAdapter.h
+++ /dev/null
@@ -1,260 +0,0 @@
-#ifndef _broker_SessionAdapter_h
-#define _broker_SessionAdapter_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "HandlerImpl.h"
-
-#include "ConnectionToken.h"
-#include "OwnershipToken.h"
-#include "qpid/Exception.h"
-#include "qpid/framing/AMQP_ServerOperations.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/framing/StructHelper.h"
-
-#include <vector>
-#include <boost/function.hpp>
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-
-class Channel;
-class Connection;
-class Broker;
-class Queue;
-
-/**
- * Per-channel protocol adapter.
- *
- * A container for a collection of AMQP-class adapters that translate
- * AMQP method bodies into calls on the core Broker objects. Each
- * adapter class also provides a client proxy to send methods to the
- * peer.
- *
- */
- class SessionAdapter : public HandlerImpl, public framing::AMQP_ServerOperations
-{
- public:
- SessionAdapter(SemanticState& session);
-
- framing::ProtocolVersion getVersion() const { return session.getConnection().getVersion();}
-
- MessageHandler* getMessageHandler(){ return &messageImpl; }
- ExchangeHandler* getExchangeHandler(){ return &exchangeImpl; }
- QueueHandler* getQueueHandler(){ return &queueImpl; }
- ExecutionHandler* getExecutionHandler(){ return &executionImpl; }
- TxHandler* getTxHandler(){ return &txImpl; }
- DtxHandler* getDtxHandler(){ return &dtxImpl; }
-
- ConnectionHandler* getConnectionHandler() { throw framing::NotImplementedException("Class not implemented"); }
- SessionHandler* getSessionHandler() { throw framing::NotImplementedException("Class not implemented"); }
- FileHandler* getFileHandler() { throw framing::NotImplementedException("Class not implemented"); }
- StreamHandler* getStreamHandler() { throw framing::NotImplementedException("Class not implemented"); }
-
- private:
- //common base for utility methods etc that are specific to this adapter
- struct HandlerHelper : public HandlerImpl
- {
- HandlerHelper(SemanticState& s) : HandlerImpl(s) {}
-
- Queue::shared_ptr getQueue(const string& name) const;
- };
-
-
- class ExchangeHandlerImpl :
- public ExchangeHandler,
- public HandlerHelper
- {
- public:
- ExchangeHandlerImpl(SemanticState& session) : HandlerHelper(session) {}
-
- void declare(const std::string& exchange, const std::string& type,
- const std::string& alternateExchange,
- bool passive, bool durable, bool autoDelete,
- const qpid::framing::FieldTable& arguments);
- void delete_(const std::string& exchange, bool ifUnused);
- framing::ExchangeQueryResult query(const std::string& name);
- void bind(const std::string& queue,
- const std::string& exchange, const std::string& routingKey,
- const qpid::framing::FieldTable& arguments);
- void unbind(const std::string& queue,
- const std::string& exchange,
- const std::string& routingKey);
- framing::ExchangeBoundResult bound(const std::string& exchange,
- const std::string& queue,
- const std::string& routingKey,
- const framing::FieldTable& arguments);
- private:
- void checkType(shared_ptr<Exchange> exchange, const std::string& type);
-
- void checkAlternate(shared_ptr<Exchange> exchange,
- shared_ptr<Exchange> alternate);
- };
-
- class QueueHandlerImpl : public QueueHandler,
- public HandlerHelper
- {
- Broker& broker;
- std::vector< boost::shared_ptr<Queue> > exclusiveQueues;
-
- public:
- QueueHandlerImpl(SemanticState& session);
- ~QueueHandlerImpl();
-
- void declare(const std::string& queue,
- const std::string& alternateExchange,
- bool passive, bool durable, bool exclusive,
- bool autoDelete,
- const qpid::framing::FieldTable& arguments);
- void delete_(const std::string& queue,
- bool ifUnused, bool ifEmpty);
- void purge(const std::string& queue);
- framing::QueueQueryResult query(const std::string& queue);
- bool isLocal(const ConnectionToken* t) const;
-
- void destroyExclusiveQueues();
- };
-
- class MessageHandlerImpl :
- public MessageHandler,
- public HandlerHelper
- {
- typedef boost::function<void(DeliveryId, DeliveryId)> RangedOperation;
- RangedOperation releaseRedeliveredOp;
- RangedOperation releaseOp;
- RangedOperation rejectOp;
- RangedOperation acceptOp;
-
- public:
- MessageHandlerImpl(SemanticState& session);
- void transfer(const string& destination,
- uint8_t acceptMode,
- uint8_t acquireMode);
-
- void accept(const framing::SequenceSet& commands);
-
- void reject(const framing::SequenceSet& commands,
- uint16_t code,
- const string& text);
-
- void release(const framing::SequenceSet& commands,
- bool setRedelivered);
-
- framing::MessageAcquireResult acquire(const framing::SequenceSet&);
-
- void subscribe(const string& queue,
- const string& destination,
- uint8_t acceptMode,
- uint8_t acquireMode,
- bool exclusive,
- const string& resumeId,
- uint64_t resumeTtl,
- const framing::FieldTable& arguments);
-
- void cancel(const string& destination);
-
- void setFlowMode(const string& destination,
- uint8_t flowMode);
-
- void flow(const string& destination,
- uint8_t unit,
- uint32_t value);
-
- void flush(const string& destination);
-
- void stop(const string& destination);
-
- framing::MessageResumeResult resume(const std::string& destination,
- const std::string& resumeId);
-
- };
-
- class ExecutionHandlerImpl : public ExecutionHandler, public HandlerHelper
- {
- public:
- ExecutionHandlerImpl(SemanticState& session) : HandlerHelper(session) {}
-
- void sync();
- void result(const framing::SequenceNumber& commandId, const string& value);
- void exception(uint16_t errorCode,
- const framing::SequenceNumber& commandId,
- uint8_t classCode,
- uint8_t commandCode,
- uint8_t fieldIndex,
- const std::string& description,
- const framing::FieldTable& errorInfo);
-
- };
-
- class TxHandlerImpl : public TxHandler, public HandlerHelper
- {
- public:
- TxHandlerImpl(SemanticState& session) : HandlerHelper(session) {}
-
- void select();
- void commit();
- void rollback();
- };
-
- class DtxHandlerImpl : public DtxHandler, public HandlerHelper, private framing::StructHelper
- {
- std::string convert(const framing::Xid& xid);
-
- public:
- DtxHandlerImpl(SemanticState& session) : HandlerHelper(session) {}
-
- void select();
-
- framing::XaResult start(const framing::Xid& xid,
- bool join,
- bool resume);
-
- framing::XaResult end(const framing::Xid& xid,
- bool fail,
- bool suspend);
-
- framing::XaResult commit(const framing::Xid& xid,
- bool onePhase);
-
- void forget(const framing::Xid& xid);
-
- framing::DtxGetTimeoutResult getTimeout(const framing::Xid& xid);
-
- framing::XaResult prepare(const framing::Xid& xid);
-
- framing::DtxRecoverResult recover();
-
- framing::XaResult rollback(const framing::Xid& xid);
-
- void setTimeout(const framing::Xid& xid, uint32_t timeout);
- };
-
- ExchangeHandlerImpl exchangeImpl;
- QueueHandlerImpl queueImpl;
- MessageHandlerImpl messageImpl;
- ExecutionHandlerImpl executionImpl;
- TxHandlerImpl txImpl;
- DtxHandlerImpl dtxImpl;
-};
-}} // namespace qpid::broker
-
-
-
-#endif /*!_broker_SessionAdapter_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SessionContext.h b/M4-RCs/qpid/cpp/src/qpid/broker/SessionContext.h
deleted file mode 100644
index 7a277964ab..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SessionContext.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef QPID_BROKER_SESSIONCONTEXT_H
-#define QPID_BROKER_SESSIONCONTEXT_H
-
-/*
- *
- * 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 "qpid/framing/FrameHandler.h"
-#include "qpid/framing/AMQP_ClientProxy.h"
-#include "qpid/framing/amqp_types.h"
-#include "qpid/sys/OutputControl.h"
-#include "ConnectionState.h"
-#include "OwnershipToken.h"
-
-
-#include <boost/noncopyable.hpp>
-
-namespace qpid {
-namespace broker {
-
-class SessionContext : public OwnershipToken, public sys::OutputControl
-{
- public:
- virtual ~SessionContext(){}
- virtual bool isLocal(const ConnectionToken* t) const = 0;
- virtual ConnectionState& getConnection() = 0;
- virtual framing::AMQP_ClientProxy& getProxy() = 0;
- virtual Broker& getBroker() = 0;
-};
-
-}} // namespace qpid::broker
-
-
-
-#endif /*!QPID_BROKER_SESSIONCONTEXT_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SessionHandler.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/SessionHandler.cpp
deleted file mode 100644
index 163102d008..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SessionHandler.cpp
+++ /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.
- *
- */
-
-#include "SessionHandler.h"
-#include "SessionState.h"
-#include "Connection.h"
-#include "qpid/log/Statement.h"
-
-#include <boost/bind.hpp>
-
-namespace qpid {
-namespace broker {
-using namespace framing;
-using namespace std;
-using namespace qpid::sys;
-
-SessionHandler::SessionHandler(Connection& c, ChannelId ch)
- : amqp_0_10::SessionHandler(&c.getOutput(), ch),
- connection(c),
- proxy(out)
-{}
-
-SessionHandler::~SessionHandler() {}
-
-namespace {
-ClassId classId(AMQMethodBody* m) { return m ? m->amqpMethodId() : 0; }
-MethodId methodId(AMQMethodBody* m) { return m ? m->amqpClassId() : 0; }
-} // namespace
-
-void SessionHandler::channelException(framing::session::DetachCode, const std::string&) {
- handleDetach();
-}
-
-void SessionHandler::connectionException(framing::connection::CloseCode code, const std::string& msg) {
- connection.close(code, msg);
-}
-
-ConnectionState& SessionHandler::getConnection() { return connection; }
-
-const ConnectionState& SessionHandler::getConnection() const { return connection; }
-
-void SessionHandler::handleDetach() {
- amqp_0_10::SessionHandler::handleDetach();
- assert(&connection.getChannel(channel.get()) == this);
- if (session.get())
- connection.getBroker().getSessionManager().detach(session);
- assert(!session.get());
- connection.closeChannel(channel.get());
-}
-
-void SessionHandler::setState(const std::string& name, bool force) {
- assert(!session.get());
- SessionId id(connection.getUserId(), name);
- session = connection.broker.getSessionManager().attach(*this, id, force);
-}
-
-void SessionHandler::detaching()
-{
- assert(session.get());
- session->disableOutput();
-}
-
-FrameHandler* SessionHandler::getInHandler() { return session.get() ? &session->in : 0; }
-qpid::SessionState* SessionHandler::getState() { return session.get(); }
-
-void SessionHandler::readyToSend() {
- if (session.get()) session->readyToSend();
-}
-
-// TODO aconway 2008-05-12: hacky - handle attached for bridge clients.
-// We need to integrate the client code so we can run a real client
-// in the bridge.
-//
-void SessionHandler::attached(const std::string& name) {
- if (session.get())
- checkName(name);
- else {
- SessionId id(connection.getUserId(), name);
- SessionState::Configuration config = connection.broker.getSessionManager().getSessionConfig();
- session.reset(new SessionState(connection.getBroker(), *this, id, config));
-}
-}
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SessionHandler.h b/M4-RCs/qpid/cpp/src/qpid/broker/SessionHandler.h
deleted file mode 100644
index 7449db1560..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SessionHandler.h
+++ /dev/null
@@ -1,81 +0,0 @@
-#ifndef QPID_BROKER_SESSIONHANDLER_H
-#define QPID_BROKER_SESSIONHANDLER_H
-
-/*
- *
- * 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 "qpid/amqp_0_10/SessionHandler.h"
-#include "qpid/framing/AMQP_ClientProxy.h"
-
-namespace qpid {
-class SessionState;
-
-namespace broker {
-
-class Connection;
-class ConnectionState;
-class SessionState;
-
-/**
- * A SessionHandler is associated with each active channel. It
- * receives incoming frames, handles session controls and manages the
- * association between the channel and a session.
- */
-class SessionHandler : public amqp_0_10::SessionHandler {
- public:
- SessionHandler(Connection&, framing::ChannelId);
- ~SessionHandler();
-
- /** Get broker::SessionState */
- SessionState* getSession() { return session.get(); }
- const SessionState* getSession() const { return session.get(); }
-
- ConnectionState& getConnection();
- const ConnectionState& getConnection() const;
-
- framing::AMQP_ClientProxy& getProxy() { return proxy; }
- const framing::AMQP_ClientProxy& getProxy() const { return proxy; }
-
- virtual void handleDetach();
-
- // Overrides
- void attached(const std::string& name);
-
- protected:
- virtual void setState(const std::string& sessionName, bool force);
- virtual qpid::SessionState* getState();
- virtual framing::FrameHandler* getInHandler();
- virtual void channelException(framing::session::DetachCode code, const std::string& msg);
- virtual void connectionException(framing::connection::CloseCode code, const std::string& msg);
- virtual void detaching();
- virtual void readyToSend();
-
- private:
- Connection& connection;
- framing::AMQP_ClientProxy proxy;
- std::auto_ptr<SessionState> session;
-};
-
-}} // namespace qpid::broker
-
-
-
-#endif /*!QPID_BROKER_SESSIONHANDLER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SessionManager.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/SessionManager.cpp
deleted file mode 100644
index a35488b746..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SessionManager.cpp
+++ /dev/null
@@ -1,104 +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 "SessionManager.h"
-#include "SessionState.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/log/Statement.h"
-#include "qpid/log/Helpers.h"
-#include "qpid/memory.h"
-
-#include <boost/bind.hpp>
-#include <boost/range.hpp>
-
-#include <algorithm>
-#include <functional>
-#include <ostream>
-
-namespace qpid {
-namespace broker {
-
-using boost::intrusive_ptr;
-using namespace sys;
-using namespace framing;
-
-SessionManager::SessionManager(const SessionState::Configuration& c, Broker& b)
- : config(c), broker(b) {}
-
-SessionManager::~SessionManager() {
- detached.clear(); // Must clear before destructor as session dtor will call forget()
-}
-
-std::auto_ptr<SessionState> SessionManager::attach(SessionHandler& h, const SessionId& id, bool/*force*/) {
- Mutex::ScopedLock l(lock);
- eraseExpired(); // Clean up expired table
- std::pair<Attached::iterator, bool> insert = attached.insert(id);
- if (!insert.second)
- throw SessionBusyException(QPID_MSG("Session already attached: " << id));
- Detached::iterator i = std::find(detached.begin(), detached.end(), id);
- std::auto_ptr<SessionState> state;
- if (i == detached.end())
- state.reset(new SessionState(broker, h, id, config));
- else {
- state.reset(detached.release(i).release());
- state->attach(h);
- }
- return state;
- // FIXME aconway 2008-04-29: implement force
-}
-
-void SessionManager::detach(std::auto_ptr<SessionState> session) {
- Mutex::ScopedLock l(lock);
- attached.erase(session->getId());
- session->detach();
- if (session->getTimeout() > 0) {
- session->expiry = AbsTime(now(),session->getTimeout()*TIME_SEC);
- if (session->mgmtObject != 0)
- session->mgmtObject->set_expireTime ((uint64_t) Duration (session->expiry));
- detached.push_back(session.release()); // In expiry order
- eraseExpired();
-}
-}
-
-void SessionManager::forget(const SessionId& id) {
- Mutex::ScopedLock l(lock);
- attached.erase(id);
-}
-
-void SessionManager::eraseExpired() {
- // Called with lock held.
- if (!detached.empty()) {
- // This used to use a more elegant invocation of std::lower_bound
- // but violated the strict weak ordering rule which Visual Studio
- // enforced. See QPID-1424 for more info should you be tempted to
- // replace the loop with something more elegant.
- AbsTime now = AbsTime::now();
- Detached::iterator keep = detached.begin();
- while ((keep != detached.end()) && ((*keep).expiry < now))
- keep++;
- if (detached.begin() != keep) {
- QPID_LOG(debug, "Expiring sessions: " << log::formatList(detached.begin(), keep));
- detached.erase(detached.begin(), keep);
- }
- }
-}
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SessionManager.h b/M4-RCs/qpid/cpp/src/qpid/broker/SessionManager.h
deleted file mode 100644
index db88e7ec10..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SessionManager.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef QPID_BROKER_SESSIONMANAGER_H
-#define QPID_BROKER_SESSIONMANAGER_H
-
-/*
- *
- * 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 <qpid/SessionState.h>
-#include <qpid/sys/Time.h>
-#include <qpid/sys/Mutex.h>
-#include <qpid/RefCounted.h>
-
-#include <set>
-#include <vector>
-#include <memory>
-
-#include <boost/noncopyable.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-class Broker;
-class SessionState;
-class SessionHandler;
-
-/**
- * Create and manage SessionState objects.
- */
-class SessionManager : private boost::noncopyable {
- public:
- SessionManager(const qpid::SessionState::Configuration&, Broker&);
-
- ~SessionManager();
-
- /** Open a new active session, caller takes ownership */
- std::auto_ptr<SessionState> attach(SessionHandler& h, const SessionId& id, bool/*force*/);
-
- /** Return a detached session to the manager, start the timeout counter. */
- void detach(std::auto_ptr<SessionState>);
-
- /** Forget about an attached session. Called by SessionState destructor. */
- void forget(const SessionId&);
-
- Broker& getBroker() const { return broker; }
-
- const qpid::SessionState::Configuration& getSessionConfig() const { return config; }
-
- private:
- typedef boost::ptr_vector<SessionState> Detached; // Sorted in expiry order.
- typedef std::set<SessionId> Attached;
-
- void eraseExpired();
-
- sys::Mutex lock;
- Detached detached;
- Attached attached;
- qpid::SessionState::Configuration config;
- Broker& broker;
-};
-
-
-
-}} // namespace qpid::broker
-
-
-
-
-
-#endif /*!QPID_BROKER_SESSIONMANAGER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SessionState.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/SessionState.cpp
deleted file mode 100644
index 4f088fdf4c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SessionState.cpp
+++ /dev/null
@@ -1,271 +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 "SessionState.h"
-#include "Broker.h"
-#include "ConnectionState.h"
-#include "DeliveryRecord.h"
-#include "SessionManager.h"
-#include "SessionHandler.h"
-#include "qpid/framing/AMQContentBody.h"
-#include "qpid/framing/AMQHeaderBody.h"
-#include "qpid/framing/AMQMethodBody.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/framing/ServerInvoker.h"
-#include "qpid/log/Statement.h"
-
-#include <boost/bind.hpp>
-#include <boost/lexical_cast.hpp>
-
-namespace qpid {
-namespace broker {
-
-using namespace framing;
-using sys::Mutex;
-using boost::intrusive_ptr;
-using qpid::management::ManagementAgent;
-using qpid::management::ManagementObject;
-using qpid::management::Manageable;
-using qpid::management::Args;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-SessionState::SessionState(
- Broker& b, SessionHandler& h, const SessionId& id, const SessionState::Configuration& config)
- : qpid::SessionState(id, config),
- broker(b), handler(&h),
- semanticState(*this, *this),
- adapter(semanticState),
- msgBuilder(&broker.getStore(), broker.getStagingThreshold()),
- enqueuedOp(boost::bind(&SessionState::enqueued, this, _1)),
- mgmtObject(0)
-{
- Manageable* parent = broker.GetVhostObject ();
- if (parent != 0) {
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent != 0) {
- mgmtObject = new _qmf::Session
- (agent, this, parent, getId().getName());
- mgmtObject->set_attached (0);
- mgmtObject->set_detachedLifespan (0);
- mgmtObject->clr_expireTime();
- agent->addObject (mgmtObject);
- }
- }
- attach(h);
-}
-
-SessionState::~SessionState() {
- if (mgmtObject != 0)
- mgmtObject->resourceDestroy ();
-}
-
-AMQP_ClientProxy& SessionState::getProxy() {
- assert(isAttached());
- return handler->getProxy();
-}
-
-ConnectionState& SessionState::getConnection() {
- assert(isAttached());
- return handler->getConnection();
-}
-
-bool SessionState::isLocal(const ConnectionToken* t) const
-{
- return isAttached() && &(handler->getConnection()) == t;
-}
-
-void SessionState::detach() {
- QPID_LOG(debug, getId() << ": detached on broker.");
- disableOutput();
- handler = 0;
- if (mgmtObject != 0)
- mgmtObject->set_attached (0);
-}
-
-void SessionState::disableOutput()
-{
- semanticState.detached();//prevents further activateOutput calls until reattached
- getConnection().outputTasks.removeOutputTask(&semanticState);
-}
-
-void SessionState::attach(SessionHandler& h) {
- QPID_LOG(debug, getId() << ": attached on broker.");
- handler = &h;
- if (mgmtObject != 0)
- {
- mgmtObject->set_attached (1);
- mgmtObject->set_connectionRef (h.getConnection().GetManagementObject()->getObjectId());
- mgmtObject->set_channelId (h.getChannel());
- }
-}
-
-void SessionState::activateOutput() {
- if (isAttached())
- getConnection().outputTasks.activateOutput();
-}
-
-void SessionState::giveReadCredit(int32_t credit) {
- if (isAttached())
- getConnection().outputTasks.giveReadCredit(credit);
-}
-
-ManagementObject* SessionState::GetManagementObject (void) const
-{
- return (ManagementObject*) mgmtObject;
-}
-
-Manageable::status_t SessionState::ManagementMethod (uint32_t methodId,
- Args& /*args*/,
- string& /*text*/)
-{
- Manageable::status_t status = Manageable::STATUS_UNKNOWN_METHOD;
-
- switch (methodId)
- {
- case _qmf::Session::METHOD_DETACH :
- if (handler != 0) {
- handler->sendDetach();
- }
- status = Manageable::STATUS_OK;
- break;
-
- case _qmf::Session::METHOD_CLOSE :
- /*
- if (handler != 0)
- {
- handler->getConnection().closeChannel(handler->getChannel());
- }
- status = Manageable::STATUS_OK;
- break;
- */
-
- case _qmf::Session::METHOD_SOLICITACK :
- case _qmf::Session::METHOD_RESETLIFESPAN :
- status = Manageable::STATUS_NOT_IMPLEMENTED;
- break;
- }
-
- return status;
-}
-
-void SessionState::handleCommand(framing::AMQMethodBody* method, const SequenceNumber& id) {
- Invoker::Result invocation = invoke(adapter, *method);
- receiverCompleted(id);
- if (!invocation.wasHandled()) {
- throw NotImplementedException(QPID_MSG("Not implemented: " << *method));
- } else if (invocation.hasResult()) {
- getProxy().getExecution().result(id, invocation.getResult());
- }
- if (method->isSync()) {
- incomplete.process(enqueuedOp, true);
- sendCompletion();
- }
-}
-
-void SessionState::handleContent(AMQFrame& frame, const SequenceNumber& id)
-{
- if (frame.getBof() && frame.getBos()) //start of frameset
- msgBuilder.start(id);
- intrusive_ptr<Message> msg(msgBuilder.getMessage());
- msgBuilder.handle(frame);
- if (frame.getEof() && frame.getEos()) {//end of frameset
- if (frame.getBof()) {
- //i.e this is a just a command frame, add a dummy header
- AMQFrame header;
- header.setBody(AMQHeaderBody());
- header.setBof(false);
- header.setEof(false);
- msg->getFrames().append(header);
- }
- msg->setPublisher(&getConnection());
- semanticState.handle(msg);
- msgBuilder.end();
-
- if (msg->isEnqueueComplete()) {
- enqueued(msg);
- } else {
- incomplete.add(msg);
- }
-
- //hold up execution until async enqueue is complete
- if (msg->getFrames().getMethod()->isSync()) {
- incomplete.process(enqueuedOp, true);
- sendCompletion();
- } else {
- incomplete.process(enqueuedOp, false);
- }
- }
-}
-
-void SessionState::enqueued(boost::intrusive_ptr<Message> msg)
-{
- receiverCompleted(msg->getCommandId());
- if (msg->requiresAccept())
- getProxy().getMessage().accept(SequenceSet(msg->getCommandId()));
-}
-
-void SessionState::handleIn(AMQFrame& frame) {
- SequenceNumber commandId = receiverGetCurrent();
- //TODO: make command handling more uniform, regardless of whether
- //commands carry content.
- AMQMethodBody* m = frame.getMethod();
- if (m == 0 || m->isContentBearing()) {
- handleContent(frame, commandId);
- } else if (frame.getBof() && frame.getEof()) {
- handleCommand(frame.getMethod(), commandId);
- } else {
- throw InternalErrorException("Cannot handle multi-frame command segments yet");
- }
-}
-
-void SessionState::handleOut(AMQFrame& frame) {
- assert(handler);
- handler->out(frame);
-}
-
-void SessionState::deliver(DeliveryRecord& msg)
-{
- uint32_t maxFrameSize = getConnection().getFrameMax();
- assert(senderGetCommandPoint().offset == 0);
- SequenceNumber commandId = senderGetCommandPoint().command;
- msg.deliver(getProxy().getHandler(), commandId, maxFrameSize);
- assert(senderGetCommandPoint() == SessionPoint(commandId+1, 0)); // Delivery has moved sendPoint.
-}
-
-void SessionState::sendCompletion() { handler->sendCompletion(); }
-
-void SessionState::senderCompleted(const SequenceSet& commands) {
- qpid::SessionState::senderCompleted(commands);
- for (SequenceSet::RangeIterator i = commands.rangesBegin(); i != commands.rangesEnd(); i++)
- semanticState.completed(i->first(), i->last());
-}
-
-void SessionState::readyToSend() {
- QPID_LOG(debug, getId() << ": ready to send, activating output.");
- assert(handler);
- semanticState.attached();
- sys::AggregateOutput& tasks = handler->getConnection().outputTasks;
- tasks.addOutputTask(&semanticState);
- tasks.activateOutput();
-}
-
-Broker& SessionState::getBroker() { return broker; }
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SessionState.h b/M4-RCs/qpid/cpp/src/qpid/broker/SessionState.h
deleted file mode 100644
index 035a444127..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SessionState.h
+++ /dev/null
@@ -1,144 +0,0 @@
-#ifndef QPID_BROKER_SESSION_H
-#define QPID_BROKER_SESSION_H
-
-/*
- *
- * 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 "qpid/SessionState.h"
-#include "qpid/framing/FrameHandler.h"
-#include "qpid/framing/SequenceSet.h"
-#include "qpid/sys/Time.h"
-#include "qpid/management/Manageable.h"
-#include "qmf/org/apache/qpid/broker/Session.h"
-#include "SessionAdapter.h"
-#include "DeliveryAdapter.h"
-#include "IncompleteMessageList.h"
-#include "MessageBuilder.h"
-#include "SessionContext.h"
-#include "SemanticState.h"
-
-#include <boost/noncopyable.hpp>
-#include <boost/scoped_ptr.hpp>
-
-#include <set>
-#include <vector>
-#include <ostream>
-
-namespace qpid {
-
-namespace framing {
-class AMQP_ClientProxy;
-}
-
-namespace broker {
-
-class Broker;
-class ConnectionState;
-class Message;
-class SessionHandler;
-class SessionManager;
-
-/**
- * Broker-side session state includes session's handler chains, which
- * may themselves have state.
- */
-class SessionState : public qpid::SessionState,
- public SessionContext,
- public DeliveryAdapter,
- public management::Manageable,
- public framing::FrameHandler::InOutHandler
-{
- public:
- SessionState(Broker&, SessionHandler&, const SessionId&, const SessionState::Configuration&);
- ~SessionState();
- bool isAttached() const { return handler; }
-
- void detach();
- void attach(SessionHandler& handler);
- void disableOutput();
-
- /** @pre isAttached() */
- framing::AMQP_ClientProxy& getProxy();
-
- /** @pre isAttached() */
- ConnectionState& getConnection();
- bool isLocal(const ConnectionToken* t) const;
-
- Broker& getBroker();
-
- /** OutputControl **/
- void activateOutput();
- void giveReadCredit(int32_t);
-
- void senderCompleted(const framing::SequenceSet& ranges);
-
- void sendCompletion();
-
- //delivery adapter methods:
- void deliver(DeliveryRecord&);
-
- // Manageable entry points
- management::ManagementObject* GetManagementObject (void) const;
- management::Manageable::status_t
- ManagementMethod (uint32_t methodId, management::Args& args, std::string&);
-
- void readyToSend();
-
- // Used by cluster to create replica sessions.
- SemanticState& getSemanticState() { return semanticState; }
- boost::intrusive_ptr<Message> getMessageInProgress() { return msgBuilder.getMessage(); }
-
- private:
-
- void handleCommand(framing::AMQMethodBody* method, const framing::SequenceNumber& id);
- void handleContent(framing::AMQFrame& frame, const framing::SequenceNumber& id);
- void enqueued(boost::intrusive_ptr<Message> msg);
-
- void handleIn(framing::AMQFrame& frame);
- void handleOut(framing::AMQFrame& frame);
-
- // End of the input & output chains.
- void handleInLast(framing::AMQFrame& frame);
- void handleOutLast(framing::AMQFrame& frame);
-
- Broker& broker;
- SessionHandler* handler;
- sys::AbsTime expiry; // Used by SessionManager.
- SemanticState semanticState;
- SessionAdapter adapter;
- MessageBuilder msgBuilder;
- IncompleteMessageList incomplete;
- IncompleteMessageList::CompletionListener enqueuedOp;
- qmf::org::apache::qpid::broker::Session* mgmtObject;
-
- friend class SessionManager;
-};
-
-
-inline std::ostream& operator<<(std::ostream& out, const SessionState& session) {
- return out << session.getId();
-}
-
-}} // namespace qpid::broker
-
-
-
-#endif /*!QPID_BROKER_SESSION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SignalHandler.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/SignalHandler.cpp
deleted file mode 100644
index 7207b0f8ce..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SignalHandler.cpp
+++ /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.
- *
- */
-#include "SignalHandler.h"
-#include "Broker.h"
-#include <signal.h>
-
-namespace qpid {
-namespace broker {
-
-boost::intrusive_ptr<Broker> SignalHandler::broker;
-
-void SignalHandler::setBroker(const boost::intrusive_ptr<Broker>& b) {
- broker = b;
-
- signal(SIGINT,shutdownHandler);
- signal(SIGTERM, shutdownHandler);
-
- signal(SIGHUP,SIG_IGN); // TODO aconway 2007-07-18: reload config.
-
- signal(SIGCHLD,SIG_IGN);
-}
-
-void SignalHandler::shutdownHandler(int) {
- if (broker.get()) {
- broker->shutdown();
- broker = 0; // Release the broker reference.
- }
-}
-
-}} // namespace qpid::broker
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/SignalHandler.h b/M4-RCs/qpid/cpp/src/qpid/broker/SignalHandler.h
deleted file mode 100644
index d2cdfae07c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/SignalHandler.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef QPID_BROKER_SIGNALHANDLER_H
-#define QPID_BROKER_SIGNALHANDLER_H
-
-/*
- *
- * 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 <boost/intrusive_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-
-class Broker;
-
-/**
- * Handle signals e.g. to shut-down a broker.
- */
-class SignalHandler
-{
- public:
- /** Set the broker to be shutdown on signals */
- static void setBroker(const boost::intrusive_ptr<Broker>& broker);
-
- private:
- static void shutdownHandler(int);
- static boost::intrusive_ptr<Broker> broker;
-};
-}} // namespace qpid::broker
-
-#endif /*!QPID_BROKER_SIGNALHANDLER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/System.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/System.cpp
deleted file mode 100644
index a11ad25bbe..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/System.cpp
+++ /dev/null
@@ -1,82 +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 "System.h"
-#include "qpid/agent/ManagementAgent.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/sys/SystemInfo.h"
-#include <iostream>
-#include <fstream>
-
-using qpid::management::ManagementAgent;
-using namespace qpid::broker;
-using namespace std;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-System::System (string _dataDir) : mgmtObject(0)
-{
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
-
- if (agent != 0)
- {
- framing::Uuid systemId;
-
- if (_dataDir.empty ())
- {
- systemId.generate ();
- }
- else
- {
- string filename (_dataDir + "/systemId");
- ifstream inFile (filename.c_str ());
-
- if (inFile.good ())
- {
- inFile >> systemId;
- inFile.close ();
- }
- else
- {
- systemId.generate ();
- ofstream outFile (filename.c_str ());
- if (outFile.good ())
- {
- outFile << systemId << endl;
- outFile.close ();
- }
- }
- }
-
- mgmtObject = new _qmf::System (agent, this, systemId);
- std::string sysname, nodename, release, version, machine;
- qpid::sys::SystemInfo::getSystemId (sysname,
- nodename,
- release,
- version,
- machine);
- mgmtObject->set_osName (sysname);
- mgmtObject->set_nodeName (nodename);
- mgmtObject->set_release (release);
- mgmtObject->set_version (version);
- mgmtObject->set_machine (machine);
-
- agent->addObject (mgmtObject, 0x1000000000000001LL);
- }
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/System.h b/M4-RCs/qpid/cpp/src/qpid/broker/System.h
deleted file mode 100644
index 42a816e095..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/System.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _BrokerSystem_
-#define _BrokerSystem_
-
-//
-// 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 "qpid/management/Manageable.h"
-#include "qmf/org/apache/qpid/broker/System.h"
-#include <boost/shared_ptr.hpp>
-#include <string>
-
-namespace qpid {
-namespace broker {
-
-class System : public management::Manageable
-{
- private:
-
- qmf::org::apache::qpid::broker::System* mgmtObject;
-
- public:
-
- typedef boost::shared_ptr<System> shared_ptr;
-
- System (std::string _dataDir);
-
- management::ManagementObject* GetManagementObject (void) const
- { return mgmtObject; }
-};
-
-}}
-
-#endif /*!_BrokerSystem_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Timer.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/Timer.cpp
deleted file mode 100644
index 0b0d3ba63d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Timer.cpp
+++ /dev/null
@@ -1,104 +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 "Timer.h"
-#include <iostream>
-
-using boost::intrusive_ptr;
-using qpid::sys::AbsTime;
-using qpid::sys::Duration;
-using qpid::sys::Monitor;
-using qpid::sys::Thread;
-using namespace qpid::broker;
-
-TimerTask::TimerTask(Duration timeout) :
- duration(timeout), time(AbsTime::now(), timeout), cancelled(false) {}
-
-TimerTask::TimerTask(AbsTime _time) :
- duration(0), time(_time), cancelled(false) {}
-
-TimerTask::~TimerTask(){}
-
-void TimerTask::reset() { time = AbsTime(AbsTime::now(), duration); }
-
-Timer::Timer() : active(false)
-{
- start();
-}
-
-Timer::~Timer()
-{
- stop();
-}
-
-void Timer::run()
-{
- Monitor::ScopedLock l(monitor);
- while(active){
- if (tasks.empty()) {
- monitor.wait();
- } else {
- intrusive_ptr<TimerTask> t = tasks.top();
- if (t->cancelled) {
- tasks.pop();
- } else if(t->time < AbsTime::now()) {
- tasks.pop();
- Monitor::ScopedUnlock u(monitor);
- t->fire();
- } else {
- monitor.wait(t->time);
- }
- }
- }
-}
-
-void Timer::add(intrusive_ptr<TimerTask> task)
-{
- Monitor::ScopedLock l(monitor);
- tasks.push(task);
- monitor.notify();
-}
-
-void Timer::start()
-{
- Monitor::ScopedLock l(monitor);
- if (!active) {
- active = true;
- runner = Thread(this);
- }
-}
-
-void Timer::stop()
-{
- {
- Monitor::ScopedLock l(monitor);
- if (!active) return;
- active = false;
- monitor.notifyAll();
- }
- runner.join();
-}
-
-bool Later::operator()(const intrusive_ptr<TimerTask>& a,
- const intrusive_ptr<TimerTask>& b) const
-{
- return a.get() && b.get() && a->time > b->time;
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Timer.h b/M4-RCs/qpid/cpp/src/qpid/broker/Timer.h
deleted file mode 100644
index f702f0f32d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Timer.h
+++ /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.
- *
- */
-#ifndef _Timer_
-#define _Timer_
-
-#include "qpid/sys/Monitor.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/sys/Runnable.h"
-#include "qpid/RefCounted.h"
-
-#include <memory>
-#include <queue>
-
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-
-struct TimerTask : public RefCounted {
- const qpid::sys::Duration duration;
- qpid::sys::AbsTime time;
- volatile bool cancelled;
-
- TimerTask(qpid::sys::Duration timeout);
- TimerTask(qpid::sys::AbsTime time);
- virtual ~TimerTask();
- void reset();
- virtual void fire() = 0;
-};
-
-struct Later {
- bool operator()(const boost::intrusive_ptr<TimerTask>& a,
- const boost::intrusive_ptr<TimerTask>& b) const;
-};
-
-class Timer : private qpid::sys::Runnable {
- protected:
- qpid::sys::Monitor monitor;
- std::priority_queue<boost::intrusive_ptr<TimerTask>,
- std::vector<boost::intrusive_ptr<TimerTask> >,
- Later> tasks;
- qpid::sys::Thread runner;
- bool active;
-
- virtual void run();
-
- public:
- Timer();
- virtual ~Timer();
-
- void add(boost::intrusive_ptr<TimerTask> task);
- void start();
- void stop();
-
-};
-
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/TopicExchange.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/TopicExchange.cpp
deleted file mode 100644
index d4f9721162..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/TopicExchange.cpp
+++ /dev/null
@@ -1,313 +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 "TopicExchange.h"
-#include <algorithm>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-// TODO aconway 2006-09-20: More efficient matching algorithm.
-// Areas for improvement:
-// - excessive string copying: should be 0 copy, match from original buffer.
-// - match/lookup: use descision tree or other more efficient structure.
-
-namespace
-{
-const std::string qpidFedOp("qpid.fed.op");
-const std::string qpidFedTags("qpid.fed.tags");
-const std::string qpidFedOrigin("qpid.fed.origin");
-
-const std::string fedOpBind("B");
-const std::string fedOpUnbind("U");
-const std::string fedOpReorigin("R");
-const std::string fedOpHello("H");
-}
-
-Tokens& Tokens::operator=(const std::string& s) {
- clear();
- if (s.empty()) return *this;
- std::string::const_iterator i = s.begin();
- while (true) {
- // Invariant: i is at the beginning of the next untokenized word.
- std::string::const_iterator j = std::find(i, s.end(), '.');
- push_back(std::string(i, j));
- if (j == s.end()) return *this;
- i = j + 1;
- }
- return *this;
-}
-
-TopicPattern& TopicPattern::operator=(const Tokens& tokens) {
- Tokens::operator=(tokens);
- normalize();
- return *this;
-}
-
-void Tokens::key(string& keytext) const
-{
- for (std::vector<string>::const_iterator iter = begin(); iter != end(); iter++) {
- if (iter != begin())
- keytext += ".";
- keytext += *iter;
- }
-}
-
-namespace {
-const std::string hashmark("#");
-const std::string star("*");
-}
-
-void TopicPattern::normalize() {
- std::string word;
- Tokens::iterator i = begin();
- while (i != end()) {
- if (*i == hashmark) {
- ++i;
- while (i != end()) {
- // Invariant: *(i-1)==#, [begin()..i-1] is normalized.
- if (*i == star) { // Move * before #.
- std::swap(*i, *(i-1));
- ++i;
- } else if (*i == hashmark) {
- erase(i); // Remove extra #
- } else {
- break;
- }
- }
- } else {
- i ++;
- }
- }
-}
-
-
-namespace {
-// TODO aconway 2006-09-20: Inefficient to convert every routingKey to a string.
-// Need StringRef class that operates on a string in place witout copy.
-// Should be applied everywhere strings are extracted from frames.
-//
-bool do_match(Tokens::const_iterator pattern_begin, Tokens::const_iterator pattern_end, Tokens::const_iterator target_begin, Tokens::const_iterator target_end)
-{
- // Invariant: [pattern_begin..p) matches [target_begin..t)
- Tokens::const_iterator p = pattern_begin;
- Tokens::const_iterator t = target_begin;
- while (p != pattern_end && t != target_end)
- {
- if (*p == star || *p == *t) {
- ++p, ++t;
- } else if (*p == hashmark) {
- ++p;
- if (do_match(p, pattern_end, t, target_end)) return true;
- while (t != target_end) {
- ++t;
- if (do_match(p, pattern_end, t, target_end)) return true;
- }
- return false;
- } else {
- return false;
- }
- }
- while (p != pattern_end && *p == hashmark) ++p; // Ignore trailing #
- return t == target_end && p == pattern_end;
-}
-}
-
-bool TopicPattern::match(const Tokens& target) const
-{
- return do_match(begin(), end(), target.begin(), target.end());
-}
-
-TopicExchange::TopicExchange(const string& _name, Manageable* _parent) : Exchange(_name, _parent)
-{
- if (mgmtExchange != 0)
- mgmtExchange->set_type (typeName);
-}
-
-TopicExchange::TopicExchange(const std::string& _name, bool _durable,
- const FieldTable& _args, Manageable* _parent) :
- Exchange(_name, _durable, _args, _parent)
-{
- if (mgmtExchange != 0)
- mgmtExchange->set_type (typeName);
-}
-
-bool TopicExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* args)
-{
- string fedOp(args ? args->getAsString(qpidFedOp) : fedOpBind);
- string fedTags(args ? args->getAsString(qpidFedTags) : "");
- string fedOrigin(args ? args->getAsString(qpidFedOrigin) : "");
- bool propagate = false;
- bool reallyUnbind;
- TopicPattern routingPattern(routingKey);
-
- if (args == 0 || fedOp.empty() || fedOp == fedOpBind) {
- RWlock::ScopedWlock l(lock);
- if (isBound(queue, routingPattern)) {
- return false;
- } else {
- Binding::shared_ptr binding (new Binding (routingKey, queue, this, FieldTable(), fedOrigin));
- BoundKey& bk = bindings[routingPattern];
- bk.bindingVector.push_back(binding);
- propagate = bk.fedBinding.addOrigin(fedOrigin);
- if (mgmtExchange != 0) {
- mgmtExchange->inc_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->inc_bindingCount();
- }
- }
- } else if (fedOp == fedOpUnbind) {
- {
- RWlock::ScopedWlock l(lock);
- BoundKey& bk = bindings[routingPattern];
- propagate = bk.fedBinding.delOrigin(fedOrigin);
- reallyUnbind = bk.fedBinding.count() == 0;
- }
- if (reallyUnbind)
- unbind(queue, routingKey, 0);
- } else if (fedOp == fedOpReorigin) {
- for (std::map<TopicPattern, BoundKey>::iterator iter = bindings.begin();
- iter != bindings.end(); iter++) {
- const BoundKey& bk = iter->second;
- if (bk.fedBinding.hasLocal()) {
- string propKey;
- iter->first.key(propKey);
- propagateFedOp(propKey, string(), fedOpBind, string());
- }
- }
- }
-
- routeIVE();
- if (propagate)
- propagateFedOp(routingKey, fedTags, fedOp, fedOrigin);
- return true;
-}
-
-bool TopicExchange::unbind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* /*args*/){
- RWlock::ScopedWlock l(lock);
- BindingMap::iterator bi = bindings.find(TopicPattern(routingKey));
- if (bi == bindings.end()) return false;
- BoundKey& bk = bi->second;
- Binding::vector& qv(bk.bindingVector);
- bool propagate = false;
-
- Binding::vector::iterator q;
- for (q = qv.begin(); q != qv.end(); q++)
- if ((*q)->queue == queue)
- break;
- if(q == qv.end()) return false;
- qv.erase(q);
- propagate = bk.fedBinding.delOrigin();
- if(qv.empty()) bindings.erase(bi);
- if (mgmtExchange != 0) {
- mgmtExchange->dec_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->dec_bindingCount();
- }
-
- if (propagate)
- propagateFedOp(routingKey, string(), fedOpUnbind, string());
- return true;
-}
-
-bool TopicExchange::isBound(Queue::shared_ptr queue, TopicPattern& pattern)
-{
- BindingMap::iterator bi = bindings.find(pattern);
- if (bi == bindings.end()) return false;
- Binding::vector& qv(bi->second.bindingVector);
- Binding::vector::iterator q;
- for (q = qv.begin(); q != qv.end(); q++)
- if ((*q)->queue == queue)
- break;
- return q != qv.end();
-}
-
-void TopicExchange::route(Deliverable& msg, const string& routingKey, const FieldTable* /*args*/){
- Binding::vector mb;
- PreRoute pr(msg, this);
- uint32_t count(0);
-
- {
- RWlock::ScopedRlock l(lock);
- Tokens tokens(routingKey);
-
- for (BindingMap::iterator i = bindings.begin(); i != bindings.end(); ++i) {
- if (i->first.match(tokens)) {
- Binding::vector& qv(i->second.bindingVector);
- for(Binding::vector::iterator j = qv.begin(); j != qv.end(); j++, count++){
- mb.push_back(*j);
- }
- }
- }
- }
-
- for (Binding::vector::iterator j = mb.begin(); j != mb.end(); ++j) {
- msg.deliverTo((*j)->queue);
- if ((*j)->mgmtBinding != 0)
- (*j)->mgmtBinding->inc_msgMatched ();
- }
-
- if (mgmtExchange != 0)
- {
- mgmtExchange->inc_msgReceives ();
- mgmtExchange->inc_byteReceives (msg.contentSize ());
- if (count == 0)
- {
- mgmtExchange->inc_msgDrops ();
- mgmtExchange->inc_byteDrops (msg.contentSize ());
- }
- else
- {
- mgmtExchange->inc_msgRoutes (count);
- mgmtExchange->inc_byteRoutes (count * msg.contentSize ());
- }
- }
-}
-
-bool TopicExchange::isBound(Queue::shared_ptr queue, const string* const routingKey, const FieldTable* const)
-{
- if (routingKey && queue) {
- TopicPattern key(*routingKey);
- return isBound(queue, key);
- } else if (!routingKey && !queue) {
- return bindings.size() > 0;
- } else if (routingKey) {
- for (BindingMap::iterator i = bindings.begin(); i != bindings.end(); ++i) {
- if (i->first.match(*routingKey)) {
- return true;
- }
- }
- } else {
- for (BindingMap::iterator i = bindings.begin(); i != bindings.end(); ++i) {
- Binding::vector& qv(i->second.bindingVector);
- Binding::vector::iterator q;
- for (q = qv.begin(); q != qv.end(); q++)
- if ((*q)->queue == queue)
- return true;
- }
- }
- return false;
-}
-
-TopicExchange::~TopicExchange() {}
-
-const std::string TopicExchange::typeName("topic");
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/TopicExchange.h b/M4-RCs/qpid/cpp/src/qpid/broker/TopicExchange.h
deleted file mode 100644
index f3a2e221f7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/TopicExchange.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.
- *
- */
-#ifndef _TopicExchange_
-#define _TopicExchange_
-
-#include <map>
-#include <vector>
-#include "Exchange.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/sys/Monitor.h"
-#include "Queue.h"
-
-namespace qpid {
-namespace broker {
-
-/** A vector of string tokens */
-class Tokens : public std::vector<std::string> {
- public:
- Tokens() {};
- // Default copy, assign, dtor are sufficient.
-
- /** Tokenize s, provides automatic conversion of string to Tokens */
- Tokens(const std::string& s) { operator=(s); }
- /** Tokenizing assignment operator s */
- Tokens & operator=(const std::string& s);
- void key(std::string& key) const;
-
- private:
- size_t hash;
-};
-
-
-/**
- * Tokens that have been normalized as a pattern and can be matched
- * with topic Tokens. Normalized meands all sequences of mixed * and
- * # are reduced to a series of * followed by at most one #.
- */
-class TopicPattern : public Tokens
-{
- public:
- TopicPattern() {}
- // Default copy, assign, dtor are sufficient.
- TopicPattern(const Tokens& tokens) { operator=(tokens); }
- TopicPattern(const std::string& str) { operator=(str); }
- TopicPattern& operator=(const Tokens&);
- TopicPattern& operator=(const std::string& str) { return operator=(Tokens(str)); }
-
- /** Match a topic */
- bool match(const std::string& topic) { return match(Tokens(topic)); }
- bool match(const Tokens& topic) const;
-
- private:
- void normalize();
-};
-
-class TopicExchange : public virtual Exchange {
- struct BoundKey {
- Binding::vector bindingVector;
- FedBinding fedBinding;
- };
- typedef std::map<TopicPattern, BoundKey> BindingMap;
- BindingMap bindings;
- qpid::sys::RWlock lock;
-
- bool isBound(Queue::shared_ptr queue, TopicPattern& pattern);
- public:
- static const std::string typeName;
-
- TopicExchange(const string& name, management::Manageable* parent = 0);
- TopicExchange(const string& _name, bool _durable,
- const qpid::framing::FieldTable& _args, management::Manageable* parent = 0);
-
- virtual std::string getType() const { return typeName; }
-
- virtual bool bind(Queue::shared_ptr queue, const string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual bool unbind(Queue::shared_ptr queue, const string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual void route(Deliverable& msg, const string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual bool isBound(Queue::shared_ptr queue, const string* const routingKey, const qpid::framing::FieldTable* const args);
-
- virtual ~TopicExchange();
- virtual bool supportsDynamicBinding() { return true; }
-};
-
-
-
-}
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/TransactionalStore.h b/M4-RCs/qpid/cpp/src/qpid/broker/TransactionalStore.h
deleted file mode 100644
index 2a2bac0c51..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/TransactionalStore.h
+++ /dev/null
@@ -1,60 +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.
- *
- */
-#ifndef _TransactionalStore_
-#define _TransactionalStore_
-
-#include <memory>
-#include <string>
-#include <set>
-
-namespace qpid {
-namespace broker {
-
-struct InvalidTransactionContextException : public std::exception {};
-
-class TransactionContext {
-public:
- virtual ~TransactionContext(){}
-};
-
-class TPCTransactionContext : public TransactionContext {
-public:
- virtual ~TPCTransactionContext(){}
-};
-
-class TransactionalStore {
-public:
- virtual std::auto_ptr<TransactionContext> begin() = 0;
- virtual std::auto_ptr<TPCTransactionContext> begin(const std::string& xid) = 0;
- virtual void prepare(TPCTransactionContext& txn) = 0;
- virtual void commit(TransactionContext& txn) = 0;
- virtual void abort(TransactionContext& txn) = 0;
-
- virtual void collectPreparedXids(std::set<std::string>& xids) = 0;
-
- virtual ~TransactionalStore(){}
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/TxAccept.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/TxAccept.cpp
deleted file mode 100644
index c7001e5526..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/TxAccept.cpp
+++ /dev/null
@@ -1,99 +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 "TxAccept.h"
-#include "qpid/log/Statement.h"
-
-using std::bind1st;
-using std::bind2nd;
-using std::mem_fun_ref;
-using namespace qpid::broker;
-using qpid::framing::SequenceSet;
-using qpid::framing::SequenceNumber;
-
-TxAccept::RangeOp::RangeOp(const AckRange& r) : range(r) {}
-
-void TxAccept::RangeOp::prepare(TransactionContext* ctxt)
-{
- for_each(range.start, range.end, bind(&DeliveryRecord::dequeue, _1, ctxt));
-}
-
-void TxAccept::RangeOp::commit()
-{
- for_each(range.start, range.end, bind(&DeliveryRecord::committed, _1));
- for_each(range.start, range.end, bind(&DeliveryRecord::setEnded, _1));
-}
-
-TxAccept::RangeOps::RangeOps(DeliveryRecords& u) : unacked(u) {}
-
-void TxAccept::RangeOps::operator()(SequenceNumber start, SequenceNumber end)
-{
- ranges.push_back(RangeOp(DeliveryRecord::findRange(unacked, start, end)));
-}
-
-void TxAccept::RangeOps::prepare(TransactionContext* ctxt)
-{
- for_each(ranges.begin(), ranges.end(), bind(&RangeOp::prepare, _1, ctxt));
-}
-
-void TxAccept::RangeOps::commit()
-{
- for_each(ranges.begin(), ranges.end(), bind(&RangeOp::commit, _1));
- //now remove if isRedundant():
- if (!ranges.empty()) {
- ack_iterator i = ranges.front().range.start;
- ack_iterator end = ranges.back().range.end;
- while (i != end) {
- if (i->isRedundant()) {
- i = unacked.erase(i);
- } else {
- i++;
- }
- }
- }
-}
-
-TxAccept::TxAccept(const SequenceSet& _acked, DeliveryRecords& _unacked) :
- acked(_acked), unacked(_unacked), ops(unacked)
-{
- //populate the ops
- acked.for_each(ops);
-}
-
-bool TxAccept::prepare(TransactionContext* ctxt) throw()
-{
- try{
- ops.prepare(ctxt);
- return true;
- }catch(const std::exception& e){
- QPID_LOG(error, "Failed to prepare: " << e.what());
- return false;
- }catch(...){
- QPID_LOG(error, "Failed to prepare");
- return false;
- }
-}
-
-void TxAccept::commit() throw()
-{
- ops.commit();
-}
-
-void TxAccept::rollback() throw() {}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/TxAccept.h b/M4-RCs/qpid/cpp/src/qpid/broker/TxAccept.h
deleted file mode 100644
index 0a5fdedb0a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/TxAccept.h
+++ /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.
- *
- */
-#ifndef _TxAccept_
-#define _TxAccept_
-
-#include <algorithm>
-#include <functional>
-#include <list>
-#include "qpid/framing/SequenceSet.h"
-#include "DeliveryRecord.h"
-#include "TxOp.h"
-
-namespace qpid {
- namespace broker {
- /**
- * Defines the transactional behaviour for accepts received by
- * a transactional channel.
- */
- class TxAccept : public TxOp {
- struct RangeOp
- {
- AckRange range;
-
- RangeOp(const AckRange& r);
- void prepare(TransactionContext* ctxt);
- void commit();
- };
-
- struct RangeOps
- {
- std::vector<RangeOp> ranges;
- DeliveryRecords& unacked;
-
- RangeOps(DeliveryRecords& u);
-
- void operator()(framing::SequenceNumber start, framing::SequenceNumber end);
- void prepare(TransactionContext* ctxt);
- void commit();
- };
-
- framing::SequenceSet acked;
- DeliveryRecords& unacked;
- RangeOps ops;
-
- public:
- /**
- * @param acked a representation of the accumulation of
- * acks received
- * @param unacked the record of delivered messages
- */
- TxAccept(const framing::SequenceSet& acked, DeliveryRecords& unacked);
- virtual bool prepare(TransactionContext* ctxt) throw();
- virtual void commit() throw();
- virtual void rollback() throw();
- virtual ~TxAccept(){}
- virtual void accept(TxOpConstVisitor& visitor) const { visitor(*this); }
-
- // Used by cluster replication.
- const framing::SequenceSet& getAcked() const { return acked; }
- };
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/TxBuffer.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/TxBuffer.cpp
deleted file mode 100644
index ae18e0f318..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/TxBuffer.cpp
+++ /dev/null
@@ -1,80 +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 "TxBuffer.h"
-#include "qpid/log/Statement.h"
-
-#include <boost/mem_fn.hpp>
-#include <boost/bind.hpp>
-using boost::mem_fn;
-using namespace qpid::broker;
-
-bool TxBuffer::prepare(TransactionContext* const ctxt)
-{
- for(op_iterator i = ops.begin(); i < ops.end(); i++){
- if(!(*i)->prepare(ctxt)){
- return false;
- }
- }
- return true;
-}
-
-void TxBuffer::commit()
-{
- std::for_each(ops.begin(), ops.end(), mem_fn(&TxOp::commit));
- ops.clear();
-}
-
-void TxBuffer::rollback()
-{
- std::for_each(ops.begin(), ops.end(), mem_fn(&TxOp::rollback));
- ops.clear();
-}
-
-void TxBuffer::enlist(TxOp::shared_ptr op)
-{
- ops.push_back(op);
-}
-
-bool TxBuffer::commitLocal(TransactionalStore* const store)
-{
- if (!store) return false;
- try {
- std::auto_ptr<TransactionContext> ctxt = store->begin();
- if (prepare(ctxt.get())) {
- store->commit(*ctxt);
- commit();
- return true;
- } else {
- store->abort(*ctxt);
- rollback();
- return false;
- }
- } catch (std::exception& e) {
- QPID_LOG(error, "Commit failed with exception: " << e.what());
- } catch (...) {
- QPID_LOG(error, "Commit failed with unknown exception");
- }
- return false;
-}
-
-void TxBuffer::accept(TxOpConstVisitor& v) const {
- std::for_each(ops.begin(), ops.end(), boost::bind(&TxOp::accept, _1, boost::ref(v)));
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/TxBuffer.h b/M4-RCs/qpid/cpp/src/qpid/broker/TxBuffer.h
deleted file mode 100644
index aabb5ea0b1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/TxBuffer.h
+++ /dev/null
@@ -1,118 +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.
- *
- */
-#ifndef _TxBuffer_
-#define _TxBuffer_
-
-#include <algorithm>
-#include <functional>
-#include <vector>
-#include "TransactionalStore.h"
-#include "TxOp.h"
-
-/**
- * Represents a single transaction. As such, an instance of this class
- * will hold a list of operations representing the workload of the
- * transaction. This work can be committed or rolled back. Committing
- * is a two-stage process: first all the operations should be
- * prepared, then if that succeeds they can be committed.
- *
- * In the 2pc case, a successful prepare may be followed by either a
- * commit or a rollback.
- *
- * Atomicity of prepare is ensured by using a lower level
- * transactional facility. This saves explicitly rolling back all the
- * successfully prepared ops when one of them fails. i.e. we do not
- * use 2pc internally, we instead ensure that prepare is atomic at a
- * lower level. This makes individual prepare operations easier to
- * code.
- *
- * Transactions on a messaging broker effect three types of 'action':
- * (1) updates to persistent storage (2) updates to transient storage
- * or cached data (3) network writes.
- *
- * Of these, (1) should always occur atomically during prepare to
- * ensure that if the broker crashes while a transaction is being
- * completed the persistent state (which is all that then remains) is
- * consistent. (3) can only be done on commit, after a successful
- * prepare. There is a little more flexibility with (2) but any
- * changes made during prepare should be subject to the control of the
- * TransactionalStore in use.
- */
-namespace qpid {
- namespace broker {
- class TxBuffer{
- typedef std::vector<TxOp::shared_ptr>::iterator op_iterator;
- std::vector<TxOp::shared_ptr> ops;
- protected:
-
- public:
- typedef boost::shared_ptr<TxBuffer> shared_ptr;
- /**
- * Adds an operation to the transaction.
- */
- void enlist(TxOp::shared_ptr op);
-
- /**
- * Requests that all ops are prepared. This should
- * primarily involve making sure that a persistent record
- * of the operations is stored where necessary.
- *
- * Once prepared, a transaction can be committed (or in
- * the 2pc case, rolled back).
- *
- * @returns true if all the operations prepared
- * successfully, false if not.
- */
- bool prepare(TransactionContext* const ctxt);
-
- /**
- * Signals that the ops all prepared successfully and can
- * now commit, i.e. the operation can now be fully carried
- * out.
- *
- * Should only be called after a call to prepare() returns
- * true.
- */
- void commit();
-
- /**
- * Signals that all ops can be rolled back.
- *
- * Should only be called either after a call to prepare()
- * returns true (2pc) or instead of a prepare call
- * ('server-local')
- */
- void rollback();
-
- /**
- * Helper method for managing the process of server local
- * commit
- */
- bool commitLocal(TransactionalStore* const store);
-
- // Used by cluster to replicate transaction status.
- void accept(TxOpConstVisitor& v) const;
- };
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/TxOp.h b/M4-RCs/qpid/cpp/src/qpid/broker/TxOp.h
deleted file mode 100644
index e0e17fc0dc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/TxOp.h
+++ /dev/null
@@ -1,46 +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.
- *
- */
-#ifndef _TxOp_
-#define _TxOp_
-
-#include "TxOpVisitor.h"
-#include "TransactionalStore.h"
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
- namespace broker {
-
- class TxOp{
- public:
- typedef boost::shared_ptr<TxOp> shared_ptr;
-
- virtual bool prepare(TransactionContext*) throw() = 0;
- virtual void commit() throw() = 0;
- virtual void rollback() throw() = 0;
- virtual ~TxOp(){}
-
- virtual void accept(TxOpConstVisitor&) const = 0;
- };
-
-}} // namespace qpid::broker
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/TxOpVisitor.h b/M4-RCs/qpid/cpp/src/qpid/broker/TxOpVisitor.h
deleted file mode 100644
index a5f2a018c9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/TxOpVisitor.h
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef QPID_BROKER_TXOPVISITOR_H
-#define QPID_BROKER_TXOPVISITOR_H
-
-/*
- *
- * 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 "qpid/shared_ptr.h"
-
-namespace qpid {
-namespace broker {
-
-class DtxAck;
-class RecoveredDequeue;
-class RecoveredEnqueue;
-class TxAccept;
-class TxPublish;
-
-/**
- * Visitor for TxOp familly of classes.
- */
-struct TxOpConstVisitor
-{
- virtual ~TxOpConstVisitor() {}
- virtual void operator()(const DtxAck&) = 0;
- virtual void operator()(const RecoveredDequeue&) = 0;
- virtual void operator()(const RecoveredEnqueue&) = 0;
- virtual void operator()(const TxAccept&) = 0;
- virtual void operator()(const TxPublish&) = 0;
-};
-
-}} // namespace qpid::broker
-
-#endif /*!QPID_BROKER_TXOPVISITOR_H*/
-#ifndef QPID_BROKER_TXOPVISITOR_H
-#define QPID_BROKER_TXOPVISITOR_H
-
-/*
- *
- * 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 "qpid/shared_ptr.h"
-
-namespace qpid {
-namespace broker {
-
-class DtxAck;
-class RecoveredDequeue;
-class RecoveredEnqueue;
-class TxAccept;
-class TxPublish;
-
-/**
- * Visitor for TxOp familly of classes.
- */
-struct TxOpConstVisitor
-{
- virtual ~TxOpConstVisitor() {}
- virtual void operator()(const DtxAck&) = 0;
- virtual void operator()(const RecoveredDequeue&) = 0;
- virtual void operator()(const RecoveredEnqueue&) = 0;
- virtual void operator()(const TxAccept&) = 0;
- virtual void operator()(const TxPublish&) = 0;
-};
-
-}} // namespace qpid::broker
-
-#endif /*!QPID_BROKER_TXOPVISITOR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/TxPublish.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/TxPublish.cpp
deleted file mode 100644
index 25ac691ada..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/TxPublish.cpp
+++ /dev/null
@@ -1,80 +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 "qpid/log/Statement.h"
-#include "TxPublish.h"
-
-using boost::intrusive_ptr;
-using namespace qpid::broker;
-
-TxPublish::TxPublish(intrusive_ptr<Message> _msg) : msg(_msg) {}
-
-bool TxPublish::prepare(TransactionContext* ctxt) throw(){
- try{
- for_each(queues.begin(), queues.end(), Prepare(ctxt, msg));
- return true;
- }catch(const std::exception& e){
- QPID_LOG(error, "Failed to prepare: " << e.what());
- }catch(...){
- QPID_LOG(error, "Failed to prepare (unknown error)");
- }
- return false;
-}
-
-void TxPublish::commit() throw(){
- for_each(queues.begin(), queues.end(), Commit(msg));
-}
-
-void TxPublish::rollback() throw(){
-}
-
-void TxPublish::deliverTo(const boost::shared_ptr<Queue>& queue){
- if (!queue->isLocal(msg)) {
- queues.push_back(queue);
- delivered = true;
- } else {
- QPID_LOG(debug, "Won't enqueue local message for " << queue->getName());
- }
-}
-
-TxPublish::Prepare::Prepare(TransactionContext* _ctxt, intrusive_ptr<Message>& _msg)
- : ctxt(_ctxt), msg(_msg){}
-
-void TxPublish::Prepare::operator()(const boost::shared_ptr<Queue>& queue){
- if (!queue->enqueue(ctxt, msg)){
- /**
- * if not store then mark message for ack and deleivery once
- * commit happens, as async IO will never set it when no store
- * exists
- */
- msg->enqueueComplete();
- }
-}
-
-TxPublish::Commit::Commit(intrusive_ptr<Message>& _msg) : msg(_msg){}
-
-void TxPublish::Commit::operator()(const boost::shared_ptr<Queue>& queue){
- queue->process(msg);
-}
-
-uint64_t TxPublish::contentSize ()
-{
- return msg->contentSize ();
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/TxPublish.h b/M4-RCs/qpid/cpp/src/qpid/broker/TxPublish.h
deleted file mode 100644
index 1f73cb8767..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/TxPublish.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.
- *
- */
-#ifndef _TxPublish_
-#define _TxPublish_
-
-#include "Queue.h"
-#include "Deliverable.h"
-#include "Message.h"
-#include "MessageStore.h"
-#include "TxOp.h"
-
-#include <algorithm>
-#include <functional>
-#include <list>
-
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
- namespace broker {
- /**
- * Defines the behaviour for publish operations on a
- * transactional channel. Messages are routed through
- * exchanges when received but are not at that stage delivered
- * to the matching queues, rather the queues are held in an
- * instance of this class. On prepare() the message is marked
- * enqueued to the relevant queues in the MessagesStore. On
- * commit() the messages will be passed to the queue for
- * dispatch or to be added to the in-memory queue.
- */
- class TxPublish : public TxOp, public Deliverable{
- class Prepare{
- TransactionContext* ctxt;
- boost::intrusive_ptr<Message>& msg;
- public:
- Prepare(TransactionContext* ctxt, boost::intrusive_ptr<Message>& msg);
- void operator()(const boost::shared_ptr<Queue>& queue);
- };
-
- class Commit{
- boost::intrusive_ptr<Message>& msg;
- public:
- Commit(boost::intrusive_ptr<Message>& msg);
- void operator()(const boost::shared_ptr<Queue>& queue);
- };
-
- boost::intrusive_ptr<Message> msg;
- std::list<Queue::shared_ptr> queues;
-
- public:
- TxPublish(boost::intrusive_ptr<Message> msg);
- virtual bool prepare(TransactionContext* ctxt) throw();
- virtual void commit() throw();
- virtual void rollback() throw();
-
- virtual Message& getMessage() { return *msg; };
-
- virtual void deliverTo(const boost::shared_ptr<Queue>& queue);
-
- virtual ~TxPublish(){}
- virtual void accept(TxOpConstVisitor& visitor) const { visitor(*this); }
-
- uint64_t contentSize();
-
- boost::intrusive_ptr<Message> getMessage() const { return msg; }
- const std::list<Queue::shared_ptr> getQueues() const { return queues; }
- };
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Vhost.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/Vhost.cpp
deleted file mode 100644
index c5bb6c5104..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Vhost.cpp
+++ /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.
-//
-
-#include "Vhost.h"
-#include "qpid/agent/ManagementAgent.h"
-
-using namespace qpid::broker;
-using qpid::management::ManagementAgent;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-namespace qpid { namespace management {
-class Manageable;
-}}
-
-Vhost::Vhost (qpid::management::Manageable* parentBroker) : mgmtObject(0)
-{
- if (parentBroker != 0)
- {
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
-
- if (agent != 0)
- {
- mgmtObject = new _qmf::Vhost(agent, this, parentBroker, "/");
- agent->addObject (mgmtObject, 0x1000000000000003LL);
- }
- }
-}
-
-void Vhost::setFederationTag(const std::string& tag)
-{
- mgmtObject->set_federationTag(tag);
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/Vhost.h b/M4-RCs/qpid/cpp/src/qpid/broker/Vhost.h
deleted file mode 100644
index ef59362e4d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/Vhost.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _Vhost_
-#define _Vhost_
-
-//
-// 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 "qpid/management/Manageable.h"
-#include "qmf/org/apache/qpid/broker/Vhost.h"
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
-namespace broker {
-
-class Vhost : public management::Manageable
-{
- private:
-
- qmf::org::apache::qpid::broker::Vhost* mgmtObject;
-
- public:
-
- typedef boost::shared_ptr<Vhost> shared_ptr;
-
- Vhost (management::Manageable* parentBroker);
-
- management::ManagementObject* GetManagementObject (void) const
- { return mgmtObject; }
- void setFederationTag(const std::string& tag);
-};
-
-}}
-
-#endif /*!_Vhost_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/posix/BrokerDefaults.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/posix/BrokerDefaults.cpp
deleted file mode 100644
index b3ef48fe58..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/posix/BrokerDefaults.cpp
+++ /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.
- *
- */
-
-#include "qpid/broker/Broker.h"
-
-namespace qpid {
-namespace broker {
-
-const std::string Broker::Options::DEFAULT_DATA_DIR_LOCATION("/tmp");
-const std::string Broker::Options::DEFAULT_DATA_DIR_NAME("/.qpidd");
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/windows/BrokerDefaults.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/windows/BrokerDefaults.cpp
deleted file mode 100644
index 138995980a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/windows/BrokerDefaults.cpp
+++ /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.
- *
- */
-
-#include "qpid/broker/Broker.h"
-
-namespace qpid {
-namespace broker {
-
-const std::string Broker::Options::DEFAULT_DATA_DIR_LOCATION("\\TEMP");
-const std::string Broker::Options::DEFAULT_DATA_DIR_NAME("\\QPIDD.DATA");
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/broker/windows/SaslAuthenticator.cpp b/M4-RCs/qpid/cpp/src/qpid/broker/windows/SaslAuthenticator.cpp
deleted file mode 100644
index a239987c0e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/broker/windows/SaslAuthenticator.cpp
+++ /dev/null
@@ -1,175 +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 source is only used on Windows; SSPI is the Windows mechanism for
-// accessing authentication mechanisms, analogous to Cyrus SASL.
-
-#include "qpid/broker/Connection.h"
-#include "qpid/log/Statement.h"
-#include "qpid/framing/reply_exceptions.h"
-
-#include <windows.h>
-
-using namespace qpid::framing;
-
-namespace qpid {
-namespace broker {
-
-class NullAuthenticator : public SaslAuthenticator
-{
- Connection& connection;
- framing::AMQP_ClientProxy::Connection client;
-public:
- NullAuthenticator(Connection& connection);
- ~NullAuthenticator();
- void getMechanisms(framing::Array& mechanisms);
- void start(const std::string& mechanism, const std::string& response);
- void step(const std::string&) {}
-};
-
-class SspiAuthenticator : public SaslAuthenticator
-{
- HANDLE userToken;
- Connection& connection;
- framing::AMQP_ClientProxy::Connection client;
-
-public:
- SspiAuthenticator(Connection& connection);
- ~SspiAuthenticator();
- void getMechanisms(framing::Array& mechanisms);
- void start(const std::string& mechanism, const std::string& response);
- void step(const std::string& response);
-};
-
-bool SaslAuthenticator::available(void)
-{
- return true;
-}
-
-// Initialize the SASL mechanism; throw if it fails.
-void SaslAuthenticator::init(const std::string& /*saslName*/)
-{
- return;
-}
-
-void SaslAuthenticator::fini(void)
-{
- return;
-}
-
-std::auto_ptr<SaslAuthenticator> SaslAuthenticator::createAuthenticator(Connection& c)
-{
- if (c.getBroker().getOptions().auth) {
- return std::auto_ptr<SaslAuthenticator>(new SspiAuthenticator(c));
- } else {
- return std::auto_ptr<SaslAuthenticator>(new NullAuthenticator(c));
- }
-}
-
-NullAuthenticator::NullAuthenticator(Connection& c) : connection(c), client(c.getOutput()) {}
-NullAuthenticator::~NullAuthenticator() {}
-
-void NullAuthenticator::getMechanisms(Array& mechanisms)
-{
- mechanisms.add(boost::shared_ptr<FieldValue>(new Str16Value("ANONYMOUS")));
-}
-
-void NullAuthenticator::start(const string& mechanism, const string& response)
-{
- QPID_LOG(warning, "SASL: No Authentication Performed");
- if (mechanism == "PLAIN") { // Old behavior
- if (response.size() > 0 && response[0] == (char) 0) {
- string temp = response.substr(1);
- string::size_type i = temp.find((char)0);
- string uid = temp.substr(0, i);
- string pwd = temp.substr(i + 1);
- connection.setUserId(uid);
- }
- } else {
- connection.setUserId("anonymous");
- }
- client.tune(framing::CHANNEL_MAX, connection.getFrameMax(), 0, 0);
-}
-
-
-SspiAuthenticator::SspiAuthenticator(Connection& c) : userToken(INVALID_HANDLE_VALUE), connection(c), client(c.getOutput())
-{
-}
-
-SspiAuthenticator::~SspiAuthenticator()
-{
- if (INVALID_HANDLE_VALUE != userToken) {
- CloseHandle(userToken);
- userToken = INVALID_HANDLE_VALUE;
- }
-}
-
-void SspiAuthenticator::getMechanisms(Array& mechanisms)
-{
- mechanisms.add(boost::shared_ptr<FieldValue>(new Str16Value(string("ANONYMOUS"))));
- mechanisms.add(boost::shared_ptr<FieldValue>(new Str16Value(string("PLAIN"))));
- QPID_LOG(info, "SASL: Mechanism list: ANONYMOUS PLAIN");
-}
-
-void SspiAuthenticator::start(const string& mechanism, const string& response)
-{
- QPID_LOG(info, "SASL: Starting authentication with mechanism: " << mechanism);
- if (mechanism == "ANONYMOUS") {
- connection.setUserId("anonymous");
- client.tune(framing::CHANNEL_MAX, connection.getFrameMax(), 0, 0);
- return;
- }
- if (mechanism != "PLAIN")
- throw ConnectionForcedException("Unsupported mechanism");
-
- // PLAIN's response is composed of 3 strings separated by 0 bytes:
- // authorization id, authentication id (user), clear-text password.
- if (response.size() == 0)
- throw ConnectionForcedException("Authentication failed");
-
- string::size_type i = response.find((char)0);
- string auth = response.substr(0, i);
- string::size_type j = response.find((char)0, i+1);
- string uid = response.substr(i+1, j-1);
- string pwd = response.substr(j+1);
- int error = 0;
- if (!LogonUser(uid.c_str(), ".", pwd.c_str(),
- LOGON32_LOGON_NETWORK,
- LOGON32_PROVIDER_DEFAULT,
- &userToken))
- error = GetLastError();
- pwd.replace(0, string::npos, 1, (char)0);
- if (error != 0) {
- QPID_LOG(info,
- "SASL: Auth failed [" << error << "]: " << qpid::sys::strError(error));
- throw ConnectionForcedException("Authentication failed");
- }
-
- connection.setUserId(uid);
- client.tune(framing::CHANNEL_MAX, connection.getFrameMax(), 0, 0);
-}
-
-void SspiAuthenticator::step(const string& response)
-{
- QPID_LOG(info, "SASL: Need another step!!!");
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/AckMode.h b/M4-RCs/qpid/cpp/src/qpid/client/AckMode.h
deleted file mode 100644
index b411c322d8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/AckMode.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef _client_AckMode_h
-#define _client_AckMode_h
-
-
-/*
- *
- * 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 qpid {
-namespace client {
-
-/**
- * DEPRECATED
- *
- * The available acknowledgement modes for Channel (now also deprecated).
- */
-enum AckMode {
- /** No acknowledgement will be sent, broker can
- discard messages as soon as they are delivered
- to a consumer using this mode. **/
- NO_ACK = 0,
- /** Each message will be automatically
- acknowledged as soon as it is delivered to the
- application. **/
- AUTO_ACK = 1,
- /** Acknowledgements will be sent automatically,
- but not for each message. **/
- LAZY_ACK = 2,
- /** The application is responsible for explicitly
- acknowledging messages. **/
- CLIENT_ACK = 3
-};
-
-}} // namespace qpid::client
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/AsyncSession.h b/M4-RCs/qpid/cpp/src/qpid/client/AsyncSession.h
deleted file mode 100644
index 150aabe191..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/AsyncSession.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef QPID_CLIENT_ASYNCSESSION_H
-#define QPID_CLIENT_ASYNCSESSION_H
-
-/*
- *
- * 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 "qpid/client/AsyncSession_0_10.h"
-
-namespace qpid {
-namespace client {
-
-/**
- * AsyncSession is an alias for Session_0_10
- *
- * \ingroup clientapi
- */
-typedef AsyncSession_0_10 AsyncSession;
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_ASYNCSESSION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Bounds.cpp b/M4-RCs/qpid/cpp/src/qpid/client/Bounds.cpp
deleted file mode 100644
index e2ddb5dfec..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Bounds.cpp
+++ /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.
- *
- */
-#include "Bounds.h"
-
-#include "qpid/log/Statement.h"
-#include "qpid/sys/Waitable.h"
-
-namespace qpid {
-namespace client {
-
-using sys::Waitable;
-
-Bounds::Bounds(size_t maxSize) : max(maxSize), current(0) {}
-
-bool Bounds::expand(size_t sizeRequired, bool block) {
- if (!max) return true;
- Waitable::ScopedLock l(lock);
- current += sizeRequired;
- if (block) {
- Waitable::ScopedWait w(lock);
- while (current > max)
- lock.wait();
- }
- return current <= max;
-}
-
-void Bounds::reduce(size_t size) {
- if (!max || size == 0) return;
- Waitable::ScopedLock l(lock);
- if (current == 0) return;
- current -= std::min(size, current);
- if (current < max && lock.hasWaiters()) {
- lock.notifyAll();
- }
-}
-
-size_t Bounds::getCurrentSize() {
- Waitable::ScopedLock l(lock);
- return current;
-}
-
-std::ostream& operator<<(std::ostream& out, const Bounds& bounds) {
- out << "current=" << bounds.current << ", max=" << bounds.max << " [" << &bounds << "]";
- return out;
-}
-
-void Bounds::setException(const sys::ExceptionHolder& e) {
- Waitable::ScopedLock l(lock);
- lock.setException(e);
- lock.waitWaiters(); // Wait for waiting threads to exit.
-}
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Bounds.h b/M4-RCs/qpid/cpp/src/qpid/client/Bounds.h
deleted file mode 100644
index 838fcb8368..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Bounds.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef QPID_CLIENT_BOUNDSCHECKING_H
-#define QPID_CLIENT_BOUNDSCHECKING_H
-/*
- *
- * 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 "qpid/sys/Waitable.h"
-
-namespace qpid{
-namespace client{
-
-class Bounds
-{
- public:
- Bounds(size_t maxSize);
- bool expand(size_t, bool block);
- void reduce(size_t);
- size_t getCurrentSize();
- void setException(const sys::ExceptionHolder&);
-
- private:
- friend std::ostream& operator<<(std::ostream&, const Bounds&);
- sys::Waitable lock;
- const size_t max;
- size_t current;
-};
-
-std::ostream& operator<<(std::ostream&, const Bounds&);
-
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/ChainableFrameHandler.h b/M4-RCs/qpid/cpp/src/qpid/client/ChainableFrameHandler.h
deleted file mode 100644
index 29e16d53dc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/ChainableFrameHandler.h
+++ /dev/null
@@ -1,47 +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.
- *
- */
-
-#ifndef _ChainableFrameHandler_
-#define _ChainableFrameHandler_
-
-#include <boost/function.hpp>
-#include "qpid/framing/AMQFrame.h"
-
-namespace qpid {
-namespace client {
-
-struct ChainableFrameHandler
-{
- typedef boost::function<void(framing::AMQFrame&)> FrameDelegate;
-
- FrameDelegate in;
- FrameDelegate out;
-
- ChainableFrameHandler() {}
- ChainableFrameHandler(FrameDelegate i, FrameDelegate o): in(i), out(o) {}
- virtual ~ChainableFrameHandler() {}
-};
-
-}}
-
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Completion.h b/M4-RCs/qpid/cpp/src/qpid/client/Completion.h
deleted file mode 100644
index c4979d7934..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Completion.h
+++ /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.
- *
- */
-
-#ifndef _Completion_
-#define _Completion_
-
-#include <boost/shared_ptr.hpp>
-#include "Future.h"
-#include "SessionImpl.h"
-
-namespace qpid {
-namespace client {
-
-/**
- * Asynchronous commands that do not return a result will return a
- * Completion. You can use the completion to wait for that specific
- * command to complete.
- *
- *@see TypedResult
- *
- *\ingroup clientapi
- */
-class Completion
-{
-protected:
- Future future;
- shared_ptr<SessionImpl> session;
-
-public:
- ///@internal
- Completion() {}
-
- ///@internal
- Completion(Future f, shared_ptr<SessionImpl> s) : future(f), session(s) {}
-
- /** Wait for the asynchronous command that returned this
- *Completion to complete.
- *
- *@exception If the command returns an error, get() throws an exception.
- */
- void wait()
- {
- future.wait(*session);
- }
-
- bool isComplete() {
- return future.isComplete(*session);
- }
-};
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Connection.cpp b/M4-RCs/qpid/cpp/src/qpid/client/Connection.cpp
deleted file mode 100644
index f450344aa7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Connection.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 "Connection.h"
-#include "ConnectionSettings.h"
-#include "Message.h"
-#include "SessionImpl.h"
-#include "SessionBase_0_10Access.h"
-#include "qpid/Url.h"
-#include "qpid/log/Logger.h"
-#include "qpid/log/Options.h"
-#include "qpid/log/Statement.h"
-#include "qpid/shared_ptr.h"
-#include "qpid/framing/AMQP_HighestVersion.h"
-
-#include <algorithm>
-#include <iostream>
-#include <sstream>
-#include <functional>
-#include <boost/format.hpp>
-#include <boost/bind.hpp>
-
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-
-namespace qpid {
-namespace client {
-
-Connection::Connection() : version(framing::highestProtocolVersion) {}
-
-Connection::~Connection(){ }
-
-void Connection::open(
- const Url& url,
- const std::string& uid, const std::string& pwd,
- const std::string& vhost,
- uint16_t maxFrameSize)
-{
- if (url.empty())
- throw Exception(QPID_MSG("Attempt to open URL with no addresses."));
- Url::const_iterator i = url.begin();
- do {
- const TcpAddress* tcp = i->get<TcpAddress>();
- i++;
- if (tcp) {
- try {
- ConnectionSettings settings;
- settings.host = tcp->host;
- settings.port = tcp->port;
- settings.username = uid;
- settings.password = pwd;
- settings.virtualhost = vhost;
- settings.maxFrameSize = maxFrameSize;
- open(settings);
- break;
- }
- catch (const Exception& /*e*/) {
- if (i == url.end()) throw;
- }
- }
- } while (i != url.end());
-}
-
-void Connection::open(
- const std::string& host, int port,
- const std::string& uid, const std::string& pwd,
- const std::string& vhost,
- uint16_t maxFrameSize)
-{
- ConnectionSettings settings;
- settings.host = host;
- settings.port = port;
- settings.username = uid;
- settings.password = pwd;
- settings.virtualhost = vhost;
- settings.maxFrameSize = maxFrameSize;
- open(settings);
-}
-
-bool Connection::isOpen() const {
- return impl && impl->isOpen();
-}
-
-void
-Connection::registerFailureCallback ( boost::function<void ()> fn ) {
- failureCallback = fn;
- if ( impl )
- impl->registerFailureCallback ( fn );
-}
-
-
-
-void Connection::open(const ConnectionSettings& settings)
-{
- if (isOpen())
- throw Exception(QPID_MSG("Connection::open() was already called"));
-
- impl = shared_ptr<ConnectionImpl>(new ConnectionImpl(version, settings));
- impl->open();
- if ( failureCallback )
- impl->registerFailureCallback ( failureCallback );
-}
-
-Session Connection::newSession(const std::string& name, uint32_t timeout) {
- if (!isOpen())
- throw Exception(QPID_MSG("Connection has not yet been opened"));
- Session s;
- SessionBase_0_10Access(s).set(impl->newSession(name, timeout));
- return s;
-}
-
-void Connection::resume(Session& session) {
- if (!isOpen())
- throw Exception(QPID_MSG("Connection is not open."));
- impl->addSession(session.impl);
- session.impl->resume(impl);
-}
-
-void Connection::close() {
- impl->close();
-}
-
-std::vector<Url> Connection::getKnownBrokers() {
- return impl ? impl->getKnownBrokers() : std::vector<Url>();
-}
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Connection.h b/M4-RCs/qpid/cpp/src/qpid/client/Connection.h
deleted file mode 100644
index d03542bb5b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Connection.h
+++ /dev/null
@@ -1,185 +0,0 @@
-#ifndef QPID_CLIENT_CONNECTION_H
-#define QPID_CLIENT_CONNECTION_H
-
-/*
- *
- * 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 <map>
-#include <string>
-#include "qpid/client/Session.h"
-
-namespace qpid {
-
-struct Url;
-
-namespace client {
-
-struct ConnectionSettings;
-class ConnectionImpl;
-
-/**
- * Represents a connection to an AMQP broker. All communication is
- * initiated by establishing a connection, then creating one or more
- * Session objects using the connection. @see newSession()
- *
- * \ingroup clientapi
- *
- */
-class Connection
-{
- framing::ProtocolVersion version;
-
- boost::function<void ()> failureCallback;
-
-
- protected:
- boost::shared_ptr<ConnectionImpl> impl;
-
-
- public:
- /**
- * Creates a connection object, but does not open the connection.
- * @see open()
- */
- Connection();
-
- ~Connection();
-
- /**
- * Opens a connection to a broker.
- *
- * @param host the host on which the broker is running.
- *
- * @param port the port on the which the broker is listening.
- *
- * @param uid the userid to connect with.
- *
- * @param pwd the password to connect with (currently SASL
- * PLAIN is the only authentication method supported so this
- * is sent in clear text).
- *
- * @param virtualhost the AMQP virtual host to use (virtual
- * hosts, where implemented(!), provide namespace partitioning
- * within a single broker).
- */
- void open(const std::string& host, int port = 5672,
- const std::string& uid = "guest",
- const std::string& pwd = "guest",
- const std::string& virtualhost = "/", uint16_t maxFrameSize=65535);
-
- /**
- * Opens a connection to a broker using a URL.
- * If the URL contains multiple addresses, try each in turn
- * till connection is successful.
- *
- * @url address of the broker to connect to.
- *
- * @param uid the userid to connect with.
- *
- * @param pwd the password to connect with (currently SASL
- * PLAIN is the only authentication method supported so this
- * is sent in clear text).
- *
- * @param virtualhost the AMQP virtual host to use (virtual
- * hosts, where implemented(!), provide namespace partitioning
- * within a single broker).
- */
- void open(const Url& url,
- const std::string& uid = "guest",
- const std::string& pwd = "guest",
- const std::string& virtualhost = "/", uint16_t maxFrameSize=65535);
-
- /**
- * Opens a connection to a broker.
- *
- * @param the settings to use (host, port etc). @see ConnectionSettings.
- */
- void open(const ConnectionSettings& settings);
-
- /**
- * Close the connection.
- *
- * Any further use of this connection (without reopening it) will
- * not succeed.
- */
- void close();
-
- /**
- * Create a new session on this connection. Sessions allow
- * multiple streams of work to be multiplexed over the same
- * connection. The returned Session provides functions to send
- * commands to the broker.
- *
- * Session functions are synchronous. In other words, a Session
- * function will send a command to the broker and does not return
- * until it receives the broker's response confirming the command
- * was executed.
- *
- * AsyncSession provides asynchronous versions of the same
- * functions. These functions send a command to the broker but do
- * not wait for a response.
- *
- * You can convert a Session s into an AsyncSession as follows:
- * @code
- * #include <qpid/client/AsyncSession.h>
- * AsyncSession as = async(s);
- * @endcode
- *
- * You can execute a single command asynchronously will a Session s
- * like ths:
- * @code
- * async(s).messageTransfer(...);
- * @endcode
- *
- * Using an AsyncSession is faster for sending large numbers of
- * commands, since each command is sent as soon as possible
- * without waiting for the previous command to be confirmed.
- *
- * However with AsyncSession you cannot assume that a command has
- * completed until you explicitly synchronize. The simplest way to
- * do this is to call Session::sync() or AsyncSession::sync().
- * Both of these functions wait for the broker to confirm all
- * commands issued so far on the session.
- *
- *@param name: A name to identify the session. @see qpid::SessionId
- * If the name is empty (the default) then a unique name will be
- * chosen using a Universally-unique identifier (UUID) algorithm.
- */
- Session newSession(const std::string& name=std::string(), uint32_t timeoutSeconds = 0);
-
- /**
- * Resume a suspended session. A session may be resumed
- * on a different connection to the one that created it.
- */
- void resume(Session& session);
-
- bool isOpen() const;
-
- std::vector<Url> getKnownBrokers();
- void registerFailureCallback ( boost::function<void ()> fn );
-
- friend class ConnectionAccess; ///<@internal
- friend class SessionBase_0_10; ///<@internal
-};
-
-}} // namespace qpid::client
-
-
-#endif /*!QPID_CLIENT_CONNECTION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionAccess.h b/M4-RCs/qpid/cpp/src/qpid/client/ConnectionAccess.h
deleted file mode 100644
index b662fd5d8b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionAccess.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef QPID_CLIENT_CONNECTIONACCESS_H
-#define QPID_CLIENT_CONNECTIONACCESS_H
-
-/*
- *
- * 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 "qpid/client/Connection.h"
-
-/**@file @internal Internal use only */
-
-namespace qpid {
-namespace client {
-
-
-
-struct ConnectionAccess {
- static void setVersion(Connection& c, const framing::ProtocolVersion& v) { c.version = v; }
- static boost::shared_ptr<ConnectionImpl> getImpl(Connection& c) { return c.impl; }
-};
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_CONNECTIONACCESS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionHandler.cpp b/M4-RCs/qpid/cpp/src/qpid/client/ConnectionHandler.cpp
deleted file mode 100644
index db5d006a17..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionHandler.cpp
+++ /dev/null
@@ -1,226 +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 "ConnectionHandler.h"
-
-#include "qpid/log/Statement.h"
-#include "qpid/framing/amqp_framing.h"
-#include "qpid/framing/all_method_bodies.h"
-#include "qpid/framing/ClientInvoker.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/log/Helpers.h"
-
-using namespace qpid::client;
-using namespace qpid::framing;
-using namespace qpid::framing::connection;
-
-namespace {
-const std::string OK("OK");
-const std::string PLAIN("PLAIN");
-const std::string en_US("en_US");
-
-const std::string INVALID_STATE_START("start received in invalid state");
-const std::string INVALID_STATE_TUNE("tune received in invalid state");
-const std::string INVALID_STATE_OPEN_OK("open-ok received in invalid state");
-const std::string INVALID_STATE_CLOSE_OK("close-ok received in invalid state");
-
-}
-
-CloseCode ConnectionHandler::convert(uint16_t replyCode)
-{
- switch (replyCode) {
- case 200: return CLOSE_CODE_NORMAL;
- case 320: return CLOSE_CODE_CONNECTION_FORCED;
- case 402: return CLOSE_CODE_INVALID_PATH;
- case 501: default:
- return CLOSE_CODE_FRAMING_ERROR;
- }
-}
-
-ConnectionHandler::ConnectionHandler(const ConnectionSettings& s, ProtocolVersion& v)
- : StateManager(NOT_STARTED), ConnectionSettings(s), outHandler(*this), proxy(outHandler),
- errorCode(CLOSE_CODE_NORMAL), version(v)
-{
- insist = true;
-
- ESTABLISHED.insert(FAILED);
- ESTABLISHED.insert(CLOSED);
- ESTABLISHED.insert(OPEN);
-
- FINISHED.insert(FAILED);
- FINISHED.insert(CLOSED);
-}
-
-void ConnectionHandler::incoming(AMQFrame& frame)
-{
- if (getState() == CLOSED) {
- throw Exception("Received frame on closed connection");
- }
-
-
- AMQBody* body = frame.getBody();
- try {
- if (frame.getChannel() != 0 || !invoke(static_cast<ConnectionOperations&>(*this), *body)) {
- switch(getState()) {
- case OPEN:
- in(frame);
- break;
- case CLOSING:
- QPID_LOG(warning, "Ignoring frame while closing connection: " << frame);
- break;
- default:
- throw Exception("Cannot receive frames on non-zero channel until connection is established.");
- }
- }
- }catch(std::exception& e){
- QPID_LOG(warning, "Closing connection due to " << e.what());
- setState(CLOSING);
- errorCode = CLOSE_CODE_FRAMING_ERROR;
- errorText = e.what();
- proxy.close(501, e.what());
- }
-}
-
-void ConnectionHandler::outgoing(AMQFrame& frame)
-{
- if (getState() == OPEN)
- out(frame);
- else
- throw TransportFailure(errorText.empty() ? "Connection is not open." : errorText);
-}
-
-void ConnectionHandler::waitForOpen()
-{
- waitFor(ESTABLISHED);
- if (getState() == FAILED || getState() == CLOSED) {
- throw ConnectionException(errorCode, errorText);
- }
-}
-
-void ConnectionHandler::close()
-{
- switch (getState()) {
- case NEGOTIATING:
- case OPENING:
- fail("Connection closed before it was established");
- break;
- case OPEN:
- setState(CLOSING);
- proxy.close(200, OK);
- waitFor(FINISHED);
- break;
- // Nothing to do for CLOSING, CLOSED, FAILED or NOT_STARTED
- }
-}
-
-void ConnectionHandler::checkState(STATES s, const std::string& msg)
-{
- if (getState() != s) {
- throw CommandInvalidException(msg);
- }
-}
-
-void ConnectionHandler::fail(const std::string& message)
-{
- errorCode = CLOSE_CODE_FRAMING_ERROR;
- errorText = message;
- QPID_LOG(warning, message);
- setState(FAILED);
-}
-
-void ConnectionHandler::start(const FieldTable& /*serverProps*/, const Array& /*mechanisms*/, const Array& /*locales*/)
-{
- checkState(NOT_STARTED, INVALID_STATE_START);
- setState(NEGOTIATING);
- //TODO: verify that desired mechanism and locale are supported
- string response = ((char)0) + username + ((char)0) + password;
- proxy.startOk(properties, mechanism, response, locale);
-}
-
-void ConnectionHandler::secure(const std::string& /*challenge*/)
-{
- throw NotImplementedException("Challenge-response cycle not yet implemented in client");
-}
-
-void ConnectionHandler::tune(uint16_t maxChannelsProposed, uint16_t maxFrameSizeProposed,
- uint16_t /*heartbeatMin*/, uint16_t /*heartbeatMax*/)
-{
- checkState(NEGOTIATING, INVALID_STATE_TUNE);
- maxChannels = std::min(maxChannels, maxChannelsProposed);
- maxFrameSize = std::min(maxFrameSize, maxFrameSizeProposed);
- //TODO: implement heartbeats and check desired value is in valid range
- proxy.tuneOk(maxChannels, maxFrameSize, heartbeat);
- setState(OPENING);
- proxy.open(virtualhost, capabilities, insist);
-}
-
-void ConnectionHandler::openOk ( const Array& knownBrokers )
-{
- checkState(OPENING, INVALID_STATE_OPEN_OK);
- knownBrokersUrls.clear();
- framing::Array::ValueVector::const_iterator i;
- for ( i = knownBrokers.begin(); i != knownBrokers.end(); ++i )
- knownBrokersUrls.push_back(Url((*i)->get<std::string>()));
- setState(OPEN);
- QPID_LOG(debug, "Known-brokers for connection: " << log::formatList(knownBrokersUrls));
-}
-
-
-void ConnectionHandler::redirect(const std::string& /*host*/, const Array& /*knownHosts*/)
-{
- throw NotImplementedException("Redirection received from broker; not yet implemented in client");
-}
-
-void ConnectionHandler::close(uint16_t replyCode, const std::string& replyText)
-{
- proxy.closeOk();
- errorCode = convert(replyCode);
- errorText = replyText;
- setState(CLOSED);
- QPID_LOG(warning, "Broker closed connection: " << replyCode << ", " << replyText);
- if (onError) {
- onError(replyCode, replyText);
- }
-}
-
-void ConnectionHandler::closeOk()
-{
- checkState(CLOSING, INVALID_STATE_CLOSE_OK);
- if (onError && errorCode != CLOSE_CODE_NORMAL) {
- onError(errorCode, errorText);
- } else if (onClose) {
- onClose();
- }
- setState(CLOSED);
-}
-
-bool ConnectionHandler::isOpen() const
-{
- return getState() == OPEN;
-}
-
-bool ConnectionHandler::isClosed() const
-{
- int s = getState();
- return s == CLOSED || s == FAILED;
-}
-
-bool ConnectionHandler::isClosing() const { return getState() == CLOSING; }
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionHandler.h b/M4-RCs/qpid/cpp/src/qpid/client/ConnectionHandler.h
deleted file mode 100644
index 12323684a5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionHandler.h
+++ /dev/null
@@ -1,116 +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.
- *
- */
-#ifndef _ConnectionHandler_
-#define _ConnectionHandler_
-
-#include "ChainableFrameHandler.h"
-#include "ConnectionSettings.h"
-#include "StateManager.h"
-#include "qpid/framing/AMQMethodBody.h"
-#include "qpid/framing/AMQP_HighestVersion.h"
-#include "qpid/framing/AMQP_ClientOperations.h"
-#include "qpid/framing/AMQP_ServerProxy.h"
-#include "qpid/framing/Array.h"
-#include "qpid/framing/enum.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/FrameHandler.h"
-#include "qpid/framing/InputHandler.h"
-#include "qpid/Url.h"
-
-namespace qpid {
-namespace client {
-
-class ConnectionHandler : private StateManager,
- public ConnectionSettings,
- public ChainableFrameHandler,
- public framing::InputHandler,
- private framing::AMQP_ClientOperations::ConnectionHandler
-{
- typedef framing::AMQP_ClientOperations::ConnectionHandler ConnectionOperations;
- enum STATES {NOT_STARTED, NEGOTIATING, OPENING, OPEN, CLOSING, CLOSED, FAILED};
- std::set<int> ESTABLISHED, FINISHED;
-
- class Adapter : public framing::FrameHandler
- {
- ConnectionHandler& handler;
- public:
- Adapter(ConnectionHandler& h) : handler(h) {}
- void handle(framing::AMQFrame& f) { handler.out(f); }
- };
-
- Adapter outHandler;
- framing::AMQP_ServerProxy::Connection proxy;
- framing::connection::CloseCode errorCode;
- std::string errorText;
- bool insist;
- framing::ProtocolVersion version;
- framing::Array capabilities;
- framing::FieldTable properties;
-
- void checkState(STATES s, const std::string& msg);
-
- //methods corresponding to connection controls:
- void start(const framing::FieldTable& serverProperties,
- const framing::Array& mechanisms,
- const framing::Array& locales);
- void secure(const std::string& challenge);
- void tune(uint16_t channelMax,
- uint16_t frameMax,
- uint16_t heartbeatMin,
- uint16_t heartbeatMax);
- void openOk(const framing::Array& knownHosts);
- void redirect(const std::string& host,
- const framing::Array& knownHosts);
- void close(uint16_t replyCode, const std::string& replyText);
- void closeOk();
-
-public:
- using InputHandler::handle;
- typedef boost::function<void()> CloseListener;
- typedef boost::function<void(uint16_t, const std::string&)> ErrorListener;
-
- ConnectionHandler(const ConnectionSettings&, framing::ProtocolVersion&);
-
- void received(framing::AMQFrame& f) { incoming(f); }
-
- void incoming(framing::AMQFrame& frame);
- void outgoing(framing::AMQFrame& frame);
-
- void waitForOpen();
- void close();
- void fail(const std::string& message);
-
- // Note that open and closed aren't related by open = !closed
- bool isOpen() const;
- bool isClosed() const;
- bool isClosing() const;
-
- CloseListener onClose;
- ErrorListener onError;
-
- std::vector<Url> knownBrokersUrls;
-
- static framing::connection::CloseCode convert(uint16_t replyCode);
-};
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionImpl.cpp b/M4-RCs/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
deleted file mode 100644
index 0d7ffa0288..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionImpl.cpp
+++ /dev/null
@@ -1,201 +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 "ConnectionImpl.h"
-#include "Connector.h"
-#include "ConnectionSettings.h"
-#include "SessionImpl.h"
-#include "FailoverListener.h"
-
-#include "qpid/log/Statement.h"
-#include "qpid/Url.h"
-#include "qpid/framing/enum.h"
-#include "qpid/framing/reply_exceptions.h"
-
-#include <boost/bind.hpp>
-#include <boost/format.hpp>
-
-
-namespace qpid {
-namespace client {
-
-using namespace qpid::framing;
-using namespace qpid::framing::connection;
-using namespace qpid::sys;
-using namespace qpid::framing::connection;//for connection error codes
-
-ConnectionImpl::ConnectionImpl(framing::ProtocolVersion v, const ConnectionSettings& settings)
- : Bounds(settings.maxFrameSize * settings.bounds),
- handler(settings, v),
- version(v),
- nextChannel(1)
-{
- QPID_LOG(debug, "ConnectionImpl created for " << version.toString());
- handler.in = boost::bind(&ConnectionImpl::incoming, this, _1);
- handler.out = boost::bind(&Connector::send, boost::ref(connector), _1);
- handler.onClose = boost::bind(&ConnectionImpl::closed, this,
- CLOSE_CODE_NORMAL, std::string());
- //only set error handler once open
- handler.onError = boost::bind(&ConnectionImpl::closed, this, _1, _2);
-}
-
-ConnectionImpl::~ConnectionImpl() {
- // Important to close the connector first, to ensure the
- // connector thread does not call on us while the destructor
- // is running.
- failover.reset();
- if (connector) connector->close();
-}
-
-void ConnectionImpl::addSession(const boost::shared_ptr<SessionImpl>& session, uint16_t channel)
-{
- Mutex::ScopedLock l(lock);
- session->setChannel(channel ? channel : nextChannel++);
- boost::weak_ptr<SessionImpl>& s = sessions[session->getChannel()];
- boost::shared_ptr<SessionImpl> ss = s.lock();
- if (ss) throw SessionBusyException(QPID_MSG("Channel " << ss->getChannel() << " attachd to " << ss->getId()));
- s = session;
-}
-
-void ConnectionImpl::handle(framing::AMQFrame& frame)
-{
- handler.outgoing(frame);
-}
-
-void ConnectionImpl::incoming(framing::AMQFrame& frame)
-{
- boost::shared_ptr<SessionImpl> s;
- {
- Mutex::ScopedLock l(lock);
- s = sessions[frame.getChannel()].lock();
- }
- if (!s)
- throw NotAttachedException(QPID_MSG("Invalid channel: " << frame.getChannel()));
- s->in(frame);
-}
-
-bool ConnectionImpl::isOpen() const
-{
- return handler.isOpen();
-}
-
-
-void ConnectionImpl::open()
-{
- const std::string& protocol = handler.protocol;
- const std::string& host = handler.host;
- int port = handler.port;
- QPID_LOG(info, "Connecting to " << protocol << ":" << host << ":" << port);
-
- connector.reset(Connector::create(protocol, version, handler, this));
- connector->setInputHandler(&handler);
- connector->setShutdownHandler(this);
- connector->connect(host, port);
- connector->init();
- handler.waitForOpen();
-
- failover.reset(new FailoverListener(shared_from_this(), handler.knownBrokersUrls));
-}
-
-void ConnectionImpl::idleIn()
-{
- close();
-}
-
-void ConnectionImpl::idleOut()
-{
- AMQFrame frame(in_place<AMQHeartbeatBody>());
- connector->send(frame);
-}
-
-void ConnectionImpl::close()
-{
- if (!handler.isOpen()) return;
- handler.close();
- closed(CLOSE_CODE_NORMAL, "Closed by client");
-}
-
-
-template <class F> void ConnectionImpl::closeInternal(const F& f) {
- {
- Mutex::ScopedUnlock u(lock);
- connector->close();
- }
- //notifying sessions of failure can result in those session being
- //deleted which in turn results in a call to erase(); this can
- //even happen on this thread, when 's' goes out of scope
- //below. Using a copy prevents the map being modified as we
- //iterate through.
- SessionMap copy;
- sessions.swap(copy);
- for (SessionMap::iterator i = copy.begin(); i != copy.end(); ++i) {
- boost::shared_ptr<SessionImpl> s = i->second.lock();
- if (s) f(s);
- }
-}
-
-void ConnectionImpl::closed(uint16_t code, const std::string& text) {
- Mutex::ScopedLock l(lock);
- setException(new ConnectionException(ConnectionHandler::convert(code), text));
- closeInternal(boost::bind(&SessionImpl::connectionClosed, _1, code, text));
-}
-
-static const std::string CONN_CLOSED("Connection closed");
-
-void ConnectionImpl::shutdown() {
- if ( failureCallback )
- failureCallback();
-
- if (handler.isClosed()) return;
-
- // FIXME aconway 2008-06-06: exception use, amqp0-10 does not seem to have
- // an appropriate close-code. connection-forced is not right.
- bool isClosing = handler.isClosing();
- handler.fail(CONN_CLOSED);//ensure connection is marked as failed before notifying sessions
- Mutex::ScopedLock l(lock);
- if (!isClosing)
- closeInternal(boost::bind(&SessionImpl::connectionBroke, _1, CONN_CLOSED));
- setException(new TransportFailure(CONN_CLOSED));
-}
-
-void ConnectionImpl::erase(uint16_t ch) {
- Mutex::ScopedLock l(lock);
- sessions.erase(ch);
-}
-
-const ConnectionSettings& ConnectionImpl::getNegotiatedSettings()
-{
- return handler;
-}
-
-std::vector<qpid::Url> ConnectionImpl::getKnownBrokers() {
- return failover ? failover->getKnownBrokers() : handler.knownBrokersUrls;
-}
-
-boost::shared_ptr<SessionImpl> ConnectionImpl::newSession(const std::string& name, uint32_t timeout, uint16_t channel) {
- boost::shared_ptr<SessionImpl> simpl(new SessionImpl(name, shared_from_this()));
- addSession(simpl, channel);
- simpl->open(timeout);
- return simpl;
-}
-
-void ConnectionImpl::stopFailoverListener() { failover->stop(); }
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionImpl.h b/M4-RCs/qpid/cpp/src/qpid/client/ConnectionImpl.h
deleted file mode 100644
index 55a4929028..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionImpl.h
+++ /dev/null
@@ -1,99 +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.
- *
- */
-
-#ifndef _ConnectionImpl_
-#define _ConnectionImpl_
-
-#include "Bounds.h"
-#include "ConnectionHandler.h"
-
-#include "qpid/framing/FrameHandler.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/ShutdownHandler.h"
-#include "qpid/sys/TimeoutHandler.h"
-
-#include <map>
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
-#include <boost/scoped_ptr.hpp>
-#include <boost/enable_shared_from_this.hpp>
-
-namespace qpid {
-namespace client {
-
-class Connector;
-struct ConnectionSettings;
-class SessionImpl;
-class FailoverListener;
-
-class ConnectionImpl : public Bounds,
- public framing::FrameHandler,
- public sys::TimeoutHandler,
- public sys::ShutdownHandler,
- public boost::enable_shared_from_this<ConnectionImpl>
-
-{
- typedef std::map<uint16_t, boost::weak_ptr<SessionImpl> > SessionMap;
-
- SessionMap sessions;
- ConnectionHandler handler;
- boost::scoped_ptr<Connector> connector;
- boost::scoped_ptr<FailoverListener> failover;
- framing::ProtocolVersion version;
- uint16_t nextChannel;
- sys::Mutex lock;
-
- template <class F> void closeInternal(const F&);
-
- void incoming(framing::AMQFrame& frame);
- void closed(uint16_t, const std::string&);
- void idleOut();
- void idleIn();
- void shutdown();
-
- boost::function<void ()> failureCallback;
-
- public:
- ConnectionImpl(framing::ProtocolVersion version, const ConnectionSettings& settings);
- ~ConnectionImpl();
-
- void open();
- bool isOpen() const;
-
- boost::shared_ptr<SessionImpl> newSession(const std::string& name, uint32_t timeout, uint16_t channel=0);
- void addSession(const boost::shared_ptr<SessionImpl>&, uint16_t channel=0);
-
- void close();
- void handle(framing::AMQFrame& frame);
- void erase(uint16_t channel);
- const ConnectionSettings& getNegotiatedSettings();
-
- std::vector<Url> getKnownBrokers();
- void registerFailureCallback ( boost::function<void ()> fn ) { failureCallback = fn; }
- void stopFailoverListener();
-
- framing::ProtocolVersion getVersion() { return version; }
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionSettings.cpp b/M4-RCs/qpid/cpp/src/qpid/client/ConnectionSettings.cpp
deleted file mode 100644
index f5fc62dad2..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionSettings.cpp
+++ /dev/null
@@ -1,54 +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 "ConnectionSettings.h"
-
-#include "qpid/log/Logger.h"
-#include "qpid/sys/Socket.h"
-
-namespace qpid {
-namespace client {
-
-ConnectionSettings::ConnectionSettings() :
- protocol("tcp"),
- host("localhost"),
- port(TcpAddress::DEFAULT_PORT),
- username("guest"),
- password("guest"),
- mechanism("PLAIN"),
- locale("en_US"),
- heartbeat(0),
- maxChannels(32767),
- maxFrameSize(65535),
- bounds(2),
- tcpNoDelay(false)
-{}
-
-ConnectionSettings::~ConnectionSettings() {}
-
-void ConnectionSettings::configureSocket(qpid::sys::Socket& socket) const
-{
- if (tcpNoDelay) {
- socket.setTcpNoDelay(tcpNoDelay);
- QPID_LOG(info, "Set TCP_NODELAY");
- }
-}
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionSettings.h b/M4-RCs/qpid/cpp/src/qpid/client/ConnectionSettings.h
deleted file mode 100644
index 1b994a6da3..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/ConnectionSettings.h
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef QPID_CLIENT_CONNECTIONSETTINGS_H
-#define QPID_CLIENT_CONNECTIONSETTINGS_H
-
-/*
- *
- * 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 "qpid/Options.h"
-#include "qpid/log/Options.h"
-#include "qpid/Url.h"
-
-#include <iostream>
-#include <exception>
-
-namespace qpid {
-
-namespace sys {
-class Socket;
-}
-
-namespace client {
-
-/**
- * Settings for a Connection.
- */
-struct ConnectionSettings {
-
- ConnectionSettings();
- virtual ~ConnectionSettings();
-
- /**
- * Allows socket to be configured; default only sets tcp-nodelay
- * based on the flag set. Can be overridden.
- */
- virtual void configureSocket(qpid::sys::Socket&) const;
-
- /**
- * The protocol used for the connection (defaults to 'tcp')
- */
- std::string protocol;
-
- /**
- * The host (or ip address) to connect to (defaults to 'localhost').
- */
- std::string host;
- /**
- * The port to connect to (defaults to 5672).
- */
- uint16_t port;
- /**
- * Allows an AMQP 'virtual host' to be specified for the
- * connection.
- */
- std::string virtualhost;
-
- /**
- * The username to use when authenticating the connection.
- */
- std::string username;
- /**
- * The password to use when authenticating the connection.
- */
- std::string password;
- /**
- * The SASL mechanism to use when authenticating the connection;
- * the options are currently PLAIN or ANONYMOUS.
- */
- std::string mechanism;
- /**
- * Allows a locale to be specified for the connection.
- */
- std::string locale;
- /**
- * Allows a heartbeat frequency to be specified (this feature is
- * not yet implemented).
- */
- uint16_t heartbeat;
- /**
- * The maximum number of channels that the client will request for
- * use on this connection.
- */
- uint16_t maxChannels;
- /**
- * The maximum frame size that the client will request for this
- * connection.
- */
- uint16_t maxFrameSize;
- /**
- * Limit the size of the connections send buffer . The buffer
- * is limited to bounds * maxFrameSize.
- */
- uint bounds;
- /**
- * If true, TCP_NODELAY will be set for the connection.
- */
- bool tcpNoDelay;
-};
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_CONNECTIONSETTINGS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Connector.cpp b/M4-RCs/qpid/cpp/src/qpid/client/Connector.cpp
deleted file mode 100644
index bef98863a1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Connector.cpp
+++ /dev/null
@@ -1,413 +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 "Connector.h"
-
-#include "Bounds.h"
-#include "ConnectionImpl.h"
-#include "ConnectionSettings.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/Time.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/sys/AsynchIO.h"
-#include "qpid/sys/Dispatcher.h"
-#include "qpid/sys/Poller.h"
-#include "qpid/Msg.h"
-
-#include <iostream>
-#include <map>
-#include <boost/bind.hpp>
-#include <boost/format.hpp>
-#include <boost/weak_ptr.hpp>
-
-namespace qpid {
-namespace client {
-
-using namespace qpid::sys;
-using namespace qpid::framing;
-using boost::format;
-using boost::str;
-
-// Stuff for the registry of protocol connectors (maybe should be moved to its own file)
-namespace {
- typedef std::map<std::string, Connector::Factory*> ProtocolRegistry;
-
- ProtocolRegistry& theProtocolRegistry() {
- static ProtocolRegistry protocolRegistry;
-
- return protocolRegistry;
- }
-}
-
-Connector* Connector::create(const std::string& proto, framing::ProtocolVersion v, const ConnectionSettings& s, ConnectionImpl* c)
-{
- ProtocolRegistry::const_iterator i = theProtocolRegistry().find(proto);
- if (i==theProtocolRegistry().end()) {
- throw Exception(QPID_MSG("Unknown protocol: " << proto));
- }
- return (i->second)(v, s, c);
-}
-
-void Connector::registerFactory(const std::string& proto, Factory* connectorFactory)
-{
- ProtocolRegistry::const_iterator i = theProtocolRegistry().find(proto);
- if (i!=theProtocolRegistry().end()) {
- QPID_LOG(error, "Tried to register protocol: " << proto << " more than once");
- }
- theProtocolRegistry()[proto] = connectorFactory;
-}
-
-class TCPConnector : public Connector, private sys::Runnable
-{
- struct Buff;
-
- /** Batch up frames for writing to aio. */
- class Writer : public framing::FrameHandler {
- typedef sys::AsynchIOBufferBase BufferBase;
- typedef std::vector<framing::AMQFrame> Frames;
-
- const uint16_t maxFrameSize;
- sys::Mutex lock;
- sys::AsynchIO* aio;
- BufferBase* buffer;
- Frames frames;
- size_t lastEof; // Position after last EOF in frames
- framing::Buffer encode;
- size_t framesEncoded;
- std::string identifier;
- Bounds* bounds;
-
- void writeOne();
- void newBuffer();
-
- public:
-
- Writer(uint16_t maxFrameSize, Bounds*);
- ~Writer();
- void init(std::string id, sys::AsynchIO*);
- void handle(framing::AMQFrame&);
- void write(sys::AsynchIO&);
- };
-
- const uint16_t maxFrameSize;
- framing::ProtocolVersion version;
- bool initiated;
-
- sys::Mutex closedLock;
- bool closed;
- bool joined;
-
- sys::ShutdownHandler* shutdownHandler;
- framing::InputHandler* input;
- framing::InitiationHandler* initialiser;
- framing::OutputHandler* output;
-
- Writer writer;
-
- sys::Thread receiver;
-
- sys::Socket socket;
-
- sys::AsynchIO* aio;
- boost::shared_ptr<sys::Poller> poller;
-
- ~TCPConnector();
-
- void run();
- void handleClosed();
- bool closeInternal();
-
- bool readbuff(qpid::sys::AsynchIO&, qpid::sys::AsynchIOBufferBase*);
- void writebuff(qpid::sys::AsynchIO&);
- void writeDataBlock(const framing::AMQDataBlock& data);
- void eof(qpid::sys::AsynchIO&);
-
- std::string identifier;
-
- boost::weak_ptr<ConnectionImpl> impl;
-
- void connect(const std::string& host, int port);
- void init();
- void close();
- void send(framing::AMQFrame& frame);
-
- void setInputHandler(framing::InputHandler* handler);
- void setShutdownHandler(sys::ShutdownHandler* handler);
- sys::ShutdownHandler* getShutdownHandler() const;
- framing::OutputHandler* getOutputHandler();
- const std::string& getIdentifier() const;
-
-public:
- TCPConnector(framing::ProtocolVersion pVersion,
- const ConnectionSettings&,
- ConnectionImpl*);
-};
-
-// Static constructor which registers connector here
-namespace {
- Connector* create(framing::ProtocolVersion v, const ConnectionSettings& s, ConnectionImpl* c) {
- return new TCPConnector(v, s, c);
- }
-
- struct StaticInit {
- StaticInit() {
- Connector::registerFactory("tcp", &create);
- };
- } init;
-}
-
-TCPConnector::TCPConnector(ProtocolVersion ver,
- const ConnectionSettings& settings,
- ConnectionImpl* cimpl)
- : maxFrameSize(settings.maxFrameSize),
- version(ver),
- initiated(false),
- closed(true),
- joined(true),
- shutdownHandler(0),
- writer(maxFrameSize, cimpl),
- aio(0),
- impl(cimpl->shared_from_this())
-{
- QPID_LOG(debug, "TCPConnector created for " << version.toString());
- settings.configureSocket(socket);
-}
-
-TCPConnector::~TCPConnector() {
- close();
-}
-
-void TCPConnector::connect(const std::string& host, int port){
- Mutex::ScopedLock l(closedLock);
- assert(closed);
- try {
- socket.connect(host, port);
- } catch (const std::exception& /*e*/) {
- socket.close();
- throw;
- }
-
- identifier = str(format("[%1% %2%]") % socket.getLocalPort() % socket.getPeerAddress());
- closed = false;
- poller = Poller::shared_ptr(new Poller);
- aio = AsynchIO::create(socket,
- boost::bind(&TCPConnector::readbuff, this, _1, _2),
- boost::bind(&TCPConnector::eof, this, _1),
- boost::bind(&TCPConnector::eof, this, _1),
- 0, // closed
- 0, // nobuffs
- boost::bind(&TCPConnector::writebuff, this, _1));
- writer.init(identifier, aio);
-}
-
-void TCPConnector::init(){
- Mutex::ScopedLock l(closedLock);
- assert(joined);
- ProtocolInitiation init(version);
- writeDataBlock(init);
- joined = false;
- receiver = Thread(this);
-}
-
-bool TCPConnector::closeInternal() {
- Mutex::ScopedLock l(closedLock);
- bool ret = !closed;
- if (!closed) {
- closed = true;
- poller->shutdown();
- }
- if (!joined && receiver.id() != Thread::current().id()) {
- joined = true;
- Mutex::ScopedUnlock u(closedLock);
- receiver.join();
- }
- return ret;
-}
-
-void TCPConnector::close() {
- closeInternal();
-}
-
-void TCPConnector::setInputHandler(InputHandler* handler){
- input = handler;
-}
-
-void TCPConnector::setShutdownHandler(ShutdownHandler* handler){
- shutdownHandler = handler;
-}
-
-OutputHandler* TCPConnector::getOutputHandler() {
- return this;
-}
-
-sys::ShutdownHandler* TCPConnector::getShutdownHandler() const {
- return shutdownHandler;
-}
-
-const std::string& TCPConnector::getIdentifier() const {
- return identifier;
-}
-
-void TCPConnector::send(AMQFrame& frame) {
- writer.handle(frame);
-}
-
-void TCPConnector::handleClosed() {
- if (closeInternal() && shutdownHandler)
- shutdownHandler->shutdown();
-}
-
-struct TCPConnector::Buff : public AsynchIO::BufferBase {
- Buff(size_t size) : AsynchIO::BufferBase(new char[size], size) {}
- ~Buff() { delete [] bytes;}
-};
-
-TCPConnector::Writer::Writer(uint16_t s, Bounds* b) : maxFrameSize(s), aio(0), buffer(0), lastEof(0), bounds(b)
-{
-}
-
-TCPConnector::Writer::~Writer() { delete buffer; }
-
-void TCPConnector::Writer::init(std::string id, sys::AsynchIO* a) {
- Mutex::ScopedLock l(lock);
- identifier = id;
- aio = a;
- newBuffer();
-}
-void TCPConnector::Writer::handle(framing::AMQFrame& frame) {
- Mutex::ScopedLock l(lock);
- frames.push_back(frame);
- //only try to write if this is the end of a frameset or if we
- //already have a buffers worth of data
- if (frame.getEof() || (bounds && bounds->getCurrentSize() >= maxFrameSize)) {
- lastEof = frames.size();
- aio->notifyPendingWrite();
- }
- QPID_LOG(trace, "SENT " << identifier << ": " << frame);
-}
-
-void TCPConnector::Writer::writeOne() {
- assert(buffer);
- framesEncoded = 0;
-
- buffer->dataStart = 0;
- buffer->dataCount = encode.getPosition();
- aio->queueWrite(buffer);
- newBuffer();
-}
-
-void TCPConnector::Writer::newBuffer() {
- buffer = aio->getQueuedBuffer();
- if (!buffer) buffer = new Buff(maxFrameSize);
- encode = framing::Buffer(buffer->bytes, buffer->byteCount);
- framesEncoded = 0;
-}
-
-// Called in IO thread.
-void TCPConnector::Writer::write(sys::AsynchIO&) {
- Mutex::ScopedLock l(lock);
- assert(buffer);
- size_t bytesWritten(0);
- for (size_t i = 0; i < lastEof; ++i) {
- AMQFrame& frame = frames[i];
- uint32_t size = frame.encodedSize();
- if (size > encode.available()) writeOne();
- assert(size <= encode.available());
- frame.encode(encode);
- ++framesEncoded;
- bytesWritten += size;
- }
- frames.erase(frames.begin(), frames.begin()+lastEof);
- lastEof = 0;
- if (bounds) bounds->reduce(bytesWritten);
- if (encode.getPosition() > 0) writeOne();
-}
-
-bool TCPConnector::readbuff(AsynchIO& aio, AsynchIO::BufferBase* buff) {
- framing::Buffer in(buff->bytes+buff->dataStart, buff->dataCount);
-
- if (!initiated) {
- framing::ProtocolInitiation protocolInit;
- if (protocolInit.decode(in)) {
- //TODO: check the version is correct
- QPID_LOG(debug, "RECV " << identifier << " INIT(" << protocolInit << ")");
- }
- initiated = true;
- }
- AMQFrame frame;
- while(frame.decode(in)){
- QPID_LOG(trace, "RECV " << identifier << ": " << frame);
- input->received(frame);
- }
- // TODO: unreading needs to go away, and when we can cope
- // with multiple sub-buffers in the general buffer scheme, it will
- if (in.available() != 0) {
- // Adjust buffer for used bytes and then "unread them"
- buff->dataStart += buff->dataCount-in.available();
- buff->dataCount = in.available();
- aio.unread(buff);
- } else {
- // Give whole buffer back to aio subsystem
- aio.queueReadBuffer(buff);
- }
- return true;
-}
-
-void TCPConnector::writebuff(AsynchIO& aio_) {
- writer.write(aio_);
-}
-
-void TCPConnector::writeDataBlock(const AMQDataBlock& data) {
- AsynchIO::BufferBase* buff = new Buff(maxFrameSize);
- framing::Buffer out(buff->bytes, buff->byteCount);
- data.encode(out);
- buff->dataCount = data.encodedSize();
- aio->queueWrite(buff);
-}
-
-void TCPConnector::eof(AsynchIO&) {
- handleClosed();
-}
-
-// TODO: astitcher 20070908 This version of the code can never time out, so the idle processing
-// will never be called
-void TCPConnector::run(){
- // Keep the connection impl in memory until run() completes.
- boost::shared_ptr<ConnectionImpl> protect = impl.lock();
- assert(protect);
- try {
- Dispatcher d(poller);
-
- for (int i = 0; i < 32; i++) {
- aio->queueReadBuffer(new Buff(maxFrameSize));
- }
-
- aio->start(poller);
- d.run();
- aio->queueForDeletion();
- socket.close();
- } catch (const std::exception& e) {
- QPID_LOG(error, QPID_MSG("FAIL " << identifier << ": " << e.what()));
- handleClosed();
- }
-}
-
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Connector.h b/M4-RCs/qpid/cpp/src/qpid/client/Connector.h
deleted file mode 100644
index 5c37d95300..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Connector.h
+++ /dev/null
@@ -1,73 +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.
- *
- */
-#ifndef _Connector_
-#define _Connector_
-
-
-#include "qpid/framing/InputHandler.h"
-#include "qpid/framing/OutputHandler.h"
-#include "qpid/framing/InitiationHandler.h"
-#include "qpid/framing/ProtocolInitiation.h"
-#include "qpid/framing/ProtocolVersion.h"
-#include "qpid/sys/ShutdownHandler.h"
-#include "qpid/sys/TimeoutHandler.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/sys/Runnable.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/Socket.h"
-#include "qpid/sys/Time.h"
-
-#include <queue>
-#include <boost/weak_ptr.hpp>
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
-namespace client {
-
-struct ConnectionSettings;
-class ConnectionImpl;
-
-///@internal
-class Connector : public framing::OutputHandler
-{
- public:
- // Protocol connector factory related stuff (it might be better to separate this code from the TCP Connector in the future)
- typedef Connector* Factory(framing::ProtocolVersion, const ConnectionSettings&, ConnectionImpl*);
- static Connector* create(const std::string& proto, framing::ProtocolVersion, const ConnectionSettings&, ConnectionImpl*);
- static void registerFactory(const std::string& proto, Factory* connectorFactory);
-
- virtual ~Connector() {};
- virtual void connect(const std::string& host, int port) = 0;
- virtual void init() {};
- virtual void close() = 0;
- virtual void send(framing::AMQFrame& frame) = 0;
-
- virtual void setInputHandler(framing::InputHandler* handler) = 0;
- virtual void setShutdownHandler(sys::ShutdownHandler* handler) = 0;
- virtual sys::ShutdownHandler* getShutdownHandler() const = 0;
- virtual framing::OutputHandler* getOutputHandler() = 0;
- virtual const std::string& getIdentifier() const = 0;
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Demux.cpp b/M4-RCs/qpid/cpp/src/qpid/client/Demux.cpp
deleted file mode 100644
index b774214ae4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Demux.cpp
+++ /dev/null
@@ -1,132 +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 "Demux.h"
-#include "qpid/Exception.h"
-#include "qpid/framing/MessageTransferBody.h"
-
-#include <iostream>
-
-namespace qpid {
-namespace client {
-
-ByTransferDest::ByTransferDest(const std::string& d) : dest(d) {}
-bool ByTransferDest::operator()(const framing::FrameSet& frameset) const
-{
- return frameset.isA<framing::MessageTransferBody>() &&
- frameset.as<framing::MessageTransferBody>()->getDestination() == dest;
-}
-
-ScopedDivert::ScopedDivert(const std::string& _dest, Demux& _demuxer) : dest(_dest), demuxer(_demuxer)
-{
- queue = demuxer.add(dest, ByTransferDest(dest));
-}
-
-ScopedDivert::~ScopedDivert()
-{
- demuxer.remove(dest);
-}
-
-Demux::Demux() : defaultQueue(new Queue()) {}
-
-Demux::~Demux() { close(sys::ExceptionHolder(new ClosedException())); }
-
-Demux::QueuePtr ScopedDivert::getQueue()
-{
- return queue;
-}
-
-void Demux::handle(framing::FrameSet::shared_ptr frameset)
-{
- sys::Mutex::ScopedLock l(lock);
- bool matched = false;
- for (iterator i = records.begin(); i != records.end() && !matched; i++) {
- if (i->condition && i->condition(*frameset)) {
- matched = true;
- i->queue->push(frameset);
- }
- }
- if (!matched) {
- defaultQueue->push(frameset);
- }
-}
-
-void Demux::close(const sys::ExceptionHolder& ex)
-{
- sys::Mutex::ScopedLock l(lock);
- for (iterator i = records.begin(); i != records.end(); i++) {
- i->queue->close(ex);
- }
- defaultQueue->close(ex);
-}
-
-void Demux::open()
-{
- sys::Mutex::ScopedLock l(lock);
- for (iterator i = records.begin(); i != records.end(); i++) {
- i->queue->open();
- }
- defaultQueue->open();
-}
-
-Demux::QueuePtr Demux::add(const std::string& name, Condition condition)
-{
- sys::Mutex::ScopedLock l(lock);
- iterator i = std::find_if(records.begin(), records.end(), Find(name));
- if (i == records.end()) {
- Record r(name, condition);
- records.push_back(r);
- return r.queue;
- } else {
- throw Exception("Queue already exists for " + name);
- }
-}
-
-void Demux::remove(const std::string& name)
-{
- sys::Mutex::ScopedLock l(lock);
- records.remove_if(Find(name));
-}
-
-Demux::QueuePtr Demux::get(const std::string& name)
-{
- sys::Mutex::ScopedLock l(lock);
- iterator i = std::find_if(records.begin(), records.end(), Find(name));
- if (i == records.end()) {
- throw Exception("No queue for " + name);
- }
- return i->queue;
-}
-
-Demux::QueuePtr Demux::getDefault()
-{
- return defaultQueue;
-}
-
-Demux::Find::Find(const std::string& n) : name(n) {}
-
-bool Demux::Find::operator()(const Record& record) const
-{
- return record.name == name;
-}
-
-}}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Demux.h b/M4-RCs/qpid/cpp/src/qpid/client/Demux.h
deleted file mode 100644
index 7304e799bb..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Demux.h
+++ /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.
- *
- */
-
-#include <list>
-#include <boost/function.hpp>
-#include <boost/shared_ptr.hpp>
-#include "qpid/framing/FrameSet.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/BlockingQueue.h"
-
-#ifndef _Demux_
-#define _Demux_
-
-namespace qpid {
-namespace client {
-
-///@internal
-class ByTransferDest
-{
- const std::string dest;
-public:
- ByTransferDest(const std::string& dest);
- bool operator()(const framing::FrameSet& frameset) const;
-};
-
-///@internal
-class Demux
-{
-public:
- typedef boost::function<bool(const framing::FrameSet&)> Condition;
- typedef sys::BlockingQueue<framing::FrameSet::shared_ptr> Queue;
- typedef boost::shared_ptr<Queue> QueuePtr;
-
- Demux();
- ~Demux();
-
- void handle(framing::FrameSet::shared_ptr);
- void close(const sys::ExceptionHolder& ex);
- void open();
-
- QueuePtr add(const std::string& name, Condition);
- void remove(const std::string& name);
- QueuePtr get(const std::string& name);
- QueuePtr getDefault();
-
-private:
- struct Record
- {
- const std::string name;
- Condition condition;
- QueuePtr queue;
-
- Record(const std::string& n, Condition c) : name(n), condition(c), queue(new Queue()) {}
- };
-
- sys::Mutex lock;
- std::list<Record> records;
- QueuePtr defaultQueue;
-
- typedef std::list<Record>::iterator iterator;
-
- struct Find
- {
- const std::string name;
- Find(const std::string& name);
- bool operator()(const Record& record) const;
- };
-};
-
-class ScopedDivert
-{
- const std::string dest;
- Demux& demuxer;
- Demux::QueuePtr queue;
-public:
- ScopedDivert(const std::string& dest, Demux& demuxer);
- ~ScopedDivert();
- Demux::QueuePtr getQueue();
-};
-
-}} // namespace qpid::client
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Dispatcher.cpp b/M4-RCs/qpid/cpp/src/qpid/client/Dispatcher.cpp
deleted file mode 100644
index 27cc4184f9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Dispatcher.cpp
+++ /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.
- *
- */
-#include "Dispatcher.h"
-#include "SubscriptionImpl.h"
-
-#include "qpid/framing/FrameSet.h"
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/BlockingQueue.h"
-#include "Message.h"
-
-#include <boost/state_saver.hpp>
-
-using qpid::framing::FrameSet;
-using qpid::framing::MessageTransferBody;
-using qpid::sys::Mutex;
-using qpid::sys::ScopedLock;
-using qpid::sys::Thread;
-
-namespace qpid {
-namespace client {
-
-Dispatcher::Dispatcher(const Session& s, const std::string& q)
- : session(s),
- running(false),
- autoStop(true),
- failoverHandler(0)
-{
- queue = q.empty() ?
- session.getExecution().getDemux().getDefault() :
- session.getExecution().getDemux().get(q);
-}
-
-void Dispatcher::start()
-{
- worker = Thread(this);
-}
-
-void Dispatcher::wait()
-{
- worker.join();
-}
-
-void Dispatcher::run()
-{
- Mutex::ScopedLock l(lock);
- if (running)
- throw Exception("Dispatcher is already running.");
- boost::state_saver<bool> reset(running); // Reset to false on exit.
- running = true;
- try {
- while (!queue->isClosed()) {
- Mutex::ScopedUnlock u(lock);
- FrameSet::shared_ptr content = queue->pop();
- if (content->isA<MessageTransferBody>()) {
- Message msg(*content);
- boost::intrusive_ptr<SubscriptionImpl> listener = find(msg.getDestination());
- if (!listener) {
- QPID_LOG(error, "No listener found for destination " << msg.getDestination());
- } else {
- assert(listener);
- listener->received(msg);
- }
- } else {
- if (handler.get()) {
- handler->handle(*content);
- } else {
- QPID_LOG(warning, "No handler found for " << *(content->getMethod()));
- }
- }
- }
- session.sync(); // Make sure all our acks are received before returning.
- }
- catch (const ClosedException&) {
- QPID_LOG(debug, QPID_MSG(session.getId() << ": closed by peer"));
- }
- catch (const TransportFailure&) {
- QPID_LOG(info, QPID_MSG(session.getId() << ": transport failure"));
- throw;
- }
- catch (const std::exception& e) {
- if ( failoverHandler ) {
- QPID_LOG(debug, QPID_MSG(session.getId() << " failover: " << e.what()));
- failoverHandler();
- } else {
- QPID_LOG(error, session.getId() << " error: " << e.what());
- throw;
- }
- }
-}
-
-void Dispatcher::stop()
-{
- ScopedLock<Mutex> l(lock);
- queue->close(); // Will interrupt thread blocked in pop()
-}
-
-void Dispatcher::setAutoStop(bool b)
-{
- ScopedLock<Mutex> l(lock);
- autoStop = b;
-}
-
-boost::intrusive_ptr<SubscriptionImpl> Dispatcher::find(const std::string& name)
-{
- ScopedLock<Mutex> l(lock);
- Listeners::iterator i = listeners.find(name);
- if (i == listeners.end()) {
- return defaultListener;
- }
- return i->second;
-}
-
-void Dispatcher::listen(const boost::intrusive_ptr<SubscriptionImpl>& subscription) {
- ScopedLock<Mutex> l(lock);
- listeners[subscription->getName()] = subscription;
-}
-
-void Dispatcher::cancel(const std::string& destination) {
- ScopedLock<Mutex> l(lock);
- listeners.erase(destination);
- if (autoStop && listeners.empty())
- queue->close();
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Dispatcher.h b/M4-RCs/qpid/cpp/src/qpid/client/Dispatcher.h
deleted file mode 100644
index e84f8f303d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Dispatcher.h
+++ /dev/null
@@ -1,82 +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.
- *
- */
-#ifndef _Dispatcher_
-#define _Dispatcher_
-
-#include <map>
-#include <memory>
-#include <string>
-#include <boost/shared_ptr.hpp>
-#include "qpid/client/Session.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/Runnable.h"
-#include "qpid/sys/Thread.h"
-#include "MessageListener.h"
-#include "SubscriptionImpl.h"
-
-namespace qpid {
-namespace client {
-
-class SubscriptionImpl;
-
-///@internal
-typedef framing::Handler<framing::FrameSet> FrameSetHandler;
-
-///@internal
-class Dispatcher : public sys::Runnable
-{
- typedef std::map<std::string, boost::intrusive_ptr<SubscriptionImpl> >Listeners;
- sys::Mutex lock;
- sys::Thread worker;
- Session session;
- Demux::QueuePtr queue;
- bool running;
- bool autoStop;
- Listeners listeners;
- boost::intrusive_ptr<SubscriptionImpl> defaultListener;
- std::auto_ptr<FrameSetHandler> handler;
-
- boost::intrusive_ptr<SubscriptionImpl> find(const std::string& name);
- bool isStopped();
-
- boost::function<void ()> failoverHandler;
-
-public:
- Dispatcher(const Session& session, const std::string& queue = "");
-
- void start();
- void wait();
- void run();
- void stop();
- void setAutoStop(bool b);
-
- void registerFailoverHandler ( boost::function<void ()> fh )
- {
- failoverHandler = fh;
- }
-
- void listen(const boost::intrusive_ptr<SubscriptionImpl>& subscription);
- void cancel(const std::string& destination);
-};
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Execution.h b/M4-RCs/qpid/cpp/src/qpid/client/Execution.h
deleted file mode 100644
index 10674afde0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Execution.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.
- *
- */
-#ifndef _Execution_
-#define _Execution_
-
-#include "qpid/framing/SequenceNumber.h"
-#include "Demux.h"
-
-namespace qpid {
-namespace client {
-
-/**@internal
- *
- * Provides access to more detailed aspects of the session
- * implementation.
- */
-class Execution
-{
-public:
- virtual ~Execution() {}
- /**
- * Provides access to the demultiplexing function within the
- * session implementation
- */
- virtual Demux& getDemux() = 0;
- /**
- * Wait until notification has been received of completion of the
- * outgoing command with the specified id.
- */
- void waitForCompletion(const framing::SequenceNumber& id);
-};
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/FailoverListener.cpp b/M4-RCs/qpid/cpp/src/qpid/client/FailoverListener.cpp
deleted file mode 100644
index 16370f8912..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/FailoverListener.cpp
+++ /dev/null
@@ -1,115 +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 "FailoverListener.h"
-#include "SessionBase_0_10Access.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/log/Statement.h"
-#include "qpid/log/Helpers.h"
-
-namespace qpid {
-namespace client {
-
-static const std::string AMQ_FAILOVER("amq.failover");
-
-static Session makeSession(boost::shared_ptr<SessionImpl> si) {
- // Hold only a weak pointer to the ConnectionImpl so a
- // FailoverListener in a ConnectionImpl won't createa a shared_ptr
- // cycle.
- //
- si->setWeakPtr(true);
- Session s;
- SessionBase_0_10Access(s).set(si);
- return s;
-}
-
-FailoverListener::FailoverListener(const boost::shared_ptr<ConnectionImpl>& c, const std::vector<Url>& initUrls)
- : knownBrokers(initUrls)
- {
- // Special versions used to mark cluster catch-up connections
- // which do not need a FailoverListener
- if (c->getVersion().getMajor() >= 0x80) {
- QPID_LOG(debug, "No failover listener for catch-up connection.");
- return;
- }
-
- Session session = makeSession(c->newSession(AMQ_FAILOVER+framing::Uuid(true).str(), 0));
- if (session.exchangeQuery(arg::name=AMQ_FAILOVER).getNotFound()) {
- session.close();
- return;
- }
- subscriptions.reset(new SubscriptionManager(session));
- std::string qname=session.getId().getName();
- session.queueDeclare(arg::queue=qname, arg::exclusive=true, arg::autoDelete=true);
- session.exchangeBind(arg::queue=qname, arg::exchange=AMQ_FAILOVER);
- subscriptions->subscribe(*this, qname, SubscriptionSettings(FlowControl::unlimited(), ACCEPT_MODE_NONE));
- thread = sys::Thread(*this);
-}
-
-void FailoverListener::run()
-{
- try {
- subscriptions->run();
- } catch (const TransportFailure&) {
- } catch (const std::exception& e) {
- QPID_LOG(error, QPID_MSG(e.what()));
- }
-}
-
-FailoverListener::~FailoverListener() {
- try { stop(); }
- catch (const std::exception& /*e*/) {}
-}
-
-void FailoverListener::stop() {
- if (subscriptions.get())
- subscriptions->stop();
-
- if (thread.id() == sys::Thread::current().id()) {
- // FIXME aconway 2008-10-16: this can happen if ConnectionImpl
- // dtor runs when my session drops its weak pointer lock.
- // For now, leak subscriptions to prevent a core if we delete
- // without joining.
- subscriptions.release();
- }
- else if (thread.id()) {
- thread.join();
- thread=sys::Thread();
- subscriptions.reset(); // Safe to delete after join.
- }
-}
-
-void FailoverListener::received(Message& msg) {
- sys::Mutex::ScopedLock l(lock);
- knownBrokers.clear();
- framing::Array urlArray;
- msg.getHeaders().getArray("amq.failover", urlArray);
- for (framing::Array::ValueVector::const_iterator i = urlArray.begin(); i != urlArray.end(); ++i )
- knownBrokers.push_back(Url((*i)->get<std::string>()));
- QPID_LOG(info, "Known-brokers update: " << log::formatList(knownBrokers));
-}
-
-std::vector<Url> FailoverListener::getKnownBrokers() const {
- sys::Mutex::ScopedLock l(lock);
- return knownBrokers;
-}
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/FailoverListener.h b/M4-RCs/qpid/cpp/src/qpid/client/FailoverListener.h
deleted file mode 100644
index fe73a26611..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/FailoverListener.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef QPID_CLIENT_FAILOVERLISTENER_H
-#define QPID_CLIENT_FAILOVERLISTENER_H
-
-/*
- *
- * 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 "qpid/client/MessageListener.h"
-#include "qpid/Url.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/Runnable.h"
-#include "qpid/sys/Thread.h"
-#include <vector>
-
-namespace qpid {
-namespace client {
-
-class SubscriptionManager;
-
-/**
- * @internal Listen for failover updates from the amq.failover exchange.
- */
-class FailoverListener : public MessageListener, private qpid::sys::Runnable
-{
- public:
- FailoverListener(const boost::shared_ptr<ConnectionImpl>&, const std::vector<Url>& initUrls);
- ~FailoverListener();
- void stop();
-
- std::vector<Url> getKnownBrokers() const;
- void received(Message& msg);
- void run();
-
- private:
- mutable sys::Mutex lock;
- std::auto_ptr<SubscriptionManager> subscriptions;
- sys::Thread thread;
- std::vector<Url> knownBrokers;
-};
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_FAILOVERLISTENER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/FailoverManager.cpp b/M4-RCs/qpid/cpp/src/qpid/client/FailoverManager.cpp
deleted file mode 100644
index ab9dbca70f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/FailoverManager.cpp
+++ /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.
- *
- */
-#include "FailoverManager.h"
-#include "qpid/Exception.h"
-#include "qpid/log/Statement.h"
-
-
-namespace qpid {
-namespace client {
-
-using qpid::sys::Monitor;
-
-FailoverManager::FailoverManager(const ConnectionSettings& s,
- ReconnectionStrategy* rs) : settings(s), strategy(rs), state(IDLE) {}
-
-void FailoverManager::execute(Command& c)
-{
- bool retry = false;
- bool completed = false;
- while (!completed) {
- try {
- AsyncSession session = connect().newSession();
- c.execute(session, retry);
- session.sync();//TODO: shouldn't be required
- session.close();
- completed = true;
- } catch(const TransportFailure&) {
- retry = true;
- }
- }
-}
-
-void FailoverManager::close()
-{
- Monitor::ScopedLock l(lock);
- connection.close();
-}
-
-Connection& FailoverManager::connect(std::vector<Url> brokers)
-{
- Monitor::ScopedLock l(lock);
- if (state == CANT_CONNECT) {
- state = IDLE;//retry
- }
- while (!connection.isOpen()) {
- if (state == CONNECTING) {
- lock.wait();
- } else if (state == CANT_CONNECT) {
- throw CannotConnectException("Cannot establish a connection");
- } else {
- state = CONNECTING;
- Connection c;
- attempt(c, settings, brokers.empty() ? connection.getKnownBrokers() : brokers);
- if (c.isOpen()) state = IDLE;
- else state = CANT_CONNECT;
- connection = c;
- lock.notifyAll();
- }
- }
- return connection;
-}
-
-Connection& FailoverManager::getConnection()
-{
- Monitor::ScopedLock l(lock);
- return connection;
-}
-
-void FailoverManager::attempt(Connection& c, ConnectionSettings s, std::vector<Url> urls)
-{
- Monitor::ScopedUnlock u(lock);
- if (strategy) strategy->editUrlList(urls);
- if (urls.empty()) {
- attempt(c, s);
- } else {
- for (std::vector<Url>::const_iterator i = urls.begin(); i != urls.end() && !c.isOpen(); ++i) {
- for (Url::const_iterator j = i->begin(); j != i->end() && !c.isOpen(); ++j) {
- const TcpAddress* tcp = j->get<TcpAddress>();
- if (tcp) {
- s.host = tcp->host;
- s.port = tcp->port;
- attempt(c, s);
- }
- }
- }
- }
-}
-
-void FailoverManager::attempt(Connection& c, ConnectionSettings s)
-{
- try {
- QPID_LOG(info, "Attempting to connect to " << s.host << " on " << s.port << "...");
- c.open(s);
- QPID_LOG(info, "Connected to " << s.host << " on " << s.port);
- } catch (const Exception& e) {
- QPID_LOG(info, "Could not connect to " << s.host << " on " << s.port << ": " << e.what());
- }
-}
-
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/FailoverManager.h b/M4-RCs/qpid/cpp/src/qpid/client/FailoverManager.h
deleted file mode 100644
index 8b6eeda8a1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/FailoverManager.h
+++ /dev/null
@@ -1,134 +0,0 @@
-#ifndef QPID_CLIENT_FAILOVERMANAGER_H
-#define QPID_CLIENT_FAILOVERMANAGER_H
-
-/*
- *
- * 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 "Connection.h"
-#include "ConnectionSettings.h"
-#include "qpid/Exception.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/sys/Monitor.h"
-#include <vector>
-
-namespace qpid {
-namespace client {
-
-struct CannotConnectException : qpid::Exception
-{
- CannotConnectException(const std::string& m) : qpid::Exception(m) {}
-};
-
-/**
- * Utility to manage failover.
- */
-class FailoverManager
-{
- public:
- /**
- * Interface to implement for doing work that can be resumed on
- * failover
- */
- struct Command
- {
- /**
- * This method will be called with isRetry=false when the
- * command is first executed. The session to use for the work
- * will be passed to the implementing class. If the connection
- * fails while the execute call is in progress, the
- * FailoverManager controlling the execution will re-establish
- * a connection, open a new session and call back to the
- * Command implementations execute method with the new session
- * and isRetry=true.
- */
- virtual void execute(AsyncSession& session, bool isRetry) = 0;
- virtual ~Command() {}
- };
-
- struct ReconnectionStrategy
- {
- /**
- * This method is called by the FailoverManager prior to
- * establishing a connection (or re-connection) and can be
- * used if the application wishes to edit or re-order the list
- * which will default to the list of known brokers for the
- * last connection.
- */
- virtual void editUrlList(std::vector<Url>& urls) = 0;
- virtual ~ReconnectionStrategy() {}
- };
-
- /**
- * Create a manager to control failover for a logical connection.
- *
- * @param settings the initial connection settings
- * @param strategy optional stratgey callback allowing application
- * to edit or reorder the list of urls to which reconnection is
- * attempted
- */
- FailoverManager(const ConnectionSettings& settings, ReconnectionStrategy* strategy = 0);
- /**
- * Return the current connection if open or attept to reconnect to
- * the specified list of urls. If no list is specified the list of
- * known brokers from the last connection will be used. If no list
- * is specified and this is the first connect attempt, the host
- * and port from the initial settings will be used.
- *
- * If the full list is tried and all attempts fail,
- * CannotConnectException is thrown.
- */
- Connection& connect(std::vector<Url> brokers = std::vector<Url>());
- /**
- * Return the current connection whether open or not
- */
- Connection& getConnection();
- /**
- * Close the current connection
- */
- void close();
- /**
- * Reliably execute the specified command. This involves creating
- * a session on which to carry out the work of the command,
- * handling failover occuring while exeuting that command and
- * re-starting the work.
- *
- * Multiple concurrent threads can call execute with different
- * commands; each thread will be allocated its own
- * session. FailoverManager will coordinate the different threads
- * on failover to ensure they continue to use the same logical
- * connection.
- */
- void execute(Command&);
- private:
- enum State {IDLE, CONNECTING, CANT_CONNECT};
-
- qpid::sys::Monitor lock;
- Connection connection;
- ConnectionSettings settings;
- ReconnectionStrategy* strategy;
- State state;
-
- void attempt(Connection&, ConnectionSettings settings, std::vector<Url> urls);
- void attempt(Connection&, ConnectionSettings settings);
-};
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_FAILOVERMANAGER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/FlowControl.h b/M4-RCs/qpid/cpp/src/qpid/client/FlowControl.h
deleted file mode 100644
index d2205aaa78..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/FlowControl.h
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef QPID_CLIENT_FLOWCONTROL_H
-#define QPID_CLIENT_FLOWCONTROL_H
-
-/*
- *
- * 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 <qpid/sys/IntegerTypes.h>
-
-namespace qpid {
-namespace client {
-
-/**
- * Flow control works by associating a finite amount of "credit"
- * with a subscription.
- *
- * Credit includes a message count and a byte count. Each message
- * received decreases the message count by one, and the byte count by
- * the size of the message. Either count can have the special value
- * UNLIMITED which is never decreased.
- *
- * A subscription's credit is exhausted when the message count is 0 or
- * the byte count is too small for the next available message. The
- * subscription will not receive any further messages until is credit
- * is renewed.
- *
- * In "window mode" credit is automatically renewed when a message is
- * completed (which by default happens when it is accepted). In
- * non-window mode credit is not automatically renewed, it must be
- * explicitly re-set (@see Subscription)
- */
-struct FlowControl {
- static const uint32_t UNLIMITED=0xFFFFFFFF;
- FlowControl(uint32_t messages_=0, uint32_t bytes_=0, bool window_=false)
- : messages(messages_), bytes(bytes_), window(window_) {}
-
- static FlowControl messageCredit(uint32_t messages_) { return FlowControl(messages_,UNLIMITED,false); }
- static FlowControl messageWindow(uint32_t messages_) { return FlowControl(messages_,UNLIMITED,true); }
- static FlowControl byteCredit(uint32_t bytes_) { return FlowControl(UNLIMITED,bytes_,false); }
- static FlowControl byteWindow(uint32_t bytes_) { return FlowControl(UNLIMITED,bytes_,true); }
- static FlowControl unlimited() { return FlowControl(UNLIMITED, UNLIMITED, false); }
- static FlowControl zero() { return FlowControl(0, 0, false); }
-
- /** Message credit: subscription can accept up to this many messages. */
- uint32_t messages;
- /** Byte credit: subscription can accept up to this many bytes of message content. */
- uint32_t bytes;
- /** Window mode. If true credit is automatically renewed as messages are acknowledged. */
- bool window;
-
- bool operator==(const FlowControl& x) {
- return messages == x.messages && bytes == x.bytes && window == x.window;
- };
-};
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_FLOWCONTROL_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Future.cpp b/M4-RCs/qpid/cpp/src/qpid/client/Future.cpp
deleted file mode 100644
index 6a0c78ae4b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Future.cpp
+++ /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.
- *
- */
-
-#include "Future.h"
-
-namespace qpid {
-namespace client {
-
-void Future::wait(SessionImpl& session)
-{
- if (!complete) {
- session.waitForCompletion(command);
- }
- complete = true;
-}
-
-bool Future::isComplete(SessionImpl& session)
-{
- return complete || session.isComplete(command);
-}
-
-void Future::setFutureResult(boost::shared_ptr<FutureResult> r)
-{
- result = r;
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Future.h b/M4-RCs/qpid/cpp/src/qpid/client/Future.h
deleted file mode 100644
index 67f39cdf3f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Future.h
+++ /dev/null
@@ -1,64 +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.
- *
- */
-
-#ifndef _Future_
-#define _Future_
-
-#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-#include "qpid/Exception.h"
-#include "qpid/framing/SequenceNumber.h"
-#include "qpid/framing/StructHelper.h"
-#include "FutureCompletion.h"
-#include "FutureResult.h"
-#include "SessionImpl.h"
-
-namespace qpid {
-namespace client {
-
-/**@internal */
-class Future : private framing::StructHelper
-{
- framing::SequenceNumber command;
- boost::shared_ptr<FutureResult> result;
- bool complete;
-
-public:
- Future() : complete(false) {}
- Future(const framing::SequenceNumber& id) : command(id), complete(false) {}
-
- template <class T> void decodeResult(T& value, SessionImpl& session)
- {
- if (result) {
- decode(value, result->getResult(session));
- } else {
- throw Exception("Result not expected");
- }
- }
-
- void wait(SessionImpl& session);
- bool isComplete(SessionImpl& session);
- void setFutureResult(boost::shared_ptr<FutureResult> r);
-};
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/FutureCompletion.cpp b/M4-RCs/qpid/cpp/src/qpid/client/FutureCompletion.cpp
deleted file mode 100644
index 130c65d6aa..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/FutureCompletion.cpp
+++ /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.
- *
- */
-
-#include "FutureCompletion.h"
-
-using namespace qpid::client;
-using namespace qpid::sys;
-
-FutureCompletion::FutureCompletion() : complete(false) {}
-
-bool FutureCompletion::isComplete() const
-{
- Monitor::ScopedLock l(lock);
- return complete;
-}
-
-void FutureCompletion::completed()
-{
- Monitor::ScopedLock l(lock);
- complete = true;
- lock.notifyAll();
-}
-
-void FutureCompletion::waitForCompletion() const
-{
- Monitor::ScopedLock l(lock);
- while (!complete) {
- lock.wait();
- }
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/FutureCompletion.h b/M4-RCs/qpid/cpp/src/qpid/client/FutureCompletion.h
deleted file mode 100644
index 4248ddeab8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/FutureCompletion.h
+++ /dev/null
@@ -1,49 +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.
- *
- */
-
-#ifndef _FutureCompletion_
-#define _FutureCompletion_
-
-#include "qpid/framing/amqp_framing.h"
-#include "qpid/sys/Monitor.h"
-
-namespace qpid {
-namespace client {
-
-///@internal
-class FutureCompletion
-{
-protected:
- mutable sys::Monitor lock;
- bool complete;
-
-public:
- FutureCompletion();
- virtual ~FutureCompletion(){}
- bool isComplete() const;
- void waitForCompletion() const;
- void completed();
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/FutureResult.cpp b/M4-RCs/qpid/cpp/src/qpid/client/FutureResult.cpp
deleted file mode 100644
index 007f278051..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/FutureResult.cpp
+++ /dev/null
@@ -1,43 +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 "FutureResult.h"
-
-#include "SessionImpl.h"
-
-using namespace qpid::client;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-const std::string& FutureResult::getResult(SessionImpl& session) const
-{
- waitForCompletion();
- session.assertOpen();
- return result;
-}
-
-void FutureResult::received(const std::string& r)
-{
- Monitor::ScopedLock l(lock);
- result = r;
- complete = true;
- lock.notifyAll();
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/FutureResult.h b/M4-RCs/qpid/cpp/src/qpid/client/FutureResult.h
deleted file mode 100644
index e97d80476d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/FutureResult.h
+++ /dev/null
@@ -1,47 +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.
- *
- */
-
-#ifndef _FutureResult_
-#define _FutureResult_
-
-#include <string>
-#include "qpid/framing/amqp_framing.h"
-#include "FutureCompletion.h"
-
-namespace qpid {
-namespace client {
-
-class SessionImpl;
-
-///@internal
-class FutureResult : public FutureCompletion
-{
- std::string result;
-public:
- const std::string& getResult(SessionImpl& session) const;
- void received(const std::string& result);
-};
-
-}}
-
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Handle.h b/M4-RCs/qpid/cpp/src/qpid/client/Handle.h
deleted file mode 100644
index 4fd82b7646..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Handle.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef QPID_CLIENT_HANDLE_H
-#define QPID_CLIENT_HANDLE_H
-
-/*
- *
- * 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 qpid {
-namespace client {
-
-template <class T> class HandlePrivate;
-
-/**
- * A handle is like a pointer: it points to some underlying object.
- * Handles can be null, like a 0 pointer. Use isValid(), isNull() or the
- * implicit conversion to bool to test for a null handle.
- */
-template <class T> class Handle {
- public:
- ~Handle();
- Handle(const Handle&);
- Handle& operator=(const Handle&);
-
- /**@return true if handle is valid, i.e. not null. */
- bool isValid() const { return impl; }
-
- /**@return true if handle is null. It is an error to call any function on a null handle. */
- bool isNull() const { return !impl; }
-
- operator bool() const { return impl; }
- bool operator !() const { return impl; }
-
- void swap(Handle<T>&);
-
- protected:
- Handle(T* =0);
- T* impl;
-
- friend class HandlePrivate<T>;
-};
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_HANDLE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/HandleAccess.h b/M4-RCs/qpid/cpp/src/qpid/client/HandleAccess.h
deleted file mode 100644
index f1747db638..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/HandleAccess.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef QPID_CLIENT_HANDLEACCESS_H
-#define QPID_CLIENT_HANDLEACCESS_H
-
-/*
- *
- * 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 <Handle.h>
-
-namespace qpid {
-namespace client {
-
-/**
- * Provide access to the private impl member of a Handle.
- */
-template <class T>
-class HandleAccess
-{
- public:
- static boost::shared_ptr<T> getImpl(Handle<T>& h) { return h.impl; }
-};
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_HANDLEACCESS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/HandlePrivate.h b/M4-RCs/qpid/cpp/src/qpid/client/HandlePrivate.h
deleted file mode 100644
index 488ce48075..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/HandlePrivate.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#ifndef QPID_CLIENT_HANDLEPRIVATE_H
-#define QPID_CLIENT_HANDLEPRIVATE_H
-
-/*
- *
- * 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 <algorithm>
-
-namespace qpid {
-namespace client {
-
-/** @file
- * Private implementation of handle, include in .cpp file of handle
- * subclasses _after_ including the declaration of class T.
- * T can be any class that can be used with boost::intrusive_ptr.
- */
-
-template <class T>
-Handle<T>::Handle(T* p) : impl(p) { if (impl) boost::intrusive_ptr_add_ref(impl); }
-
-template <class T>
-Handle<T>::~Handle() { if(impl) boost::intrusive_ptr_release(impl); }
-
-template <class T>
-Handle<T>::Handle(const Handle& h) : impl(h.impl) { if(impl) boost::intrusive_ptr_add_ref(impl); }
-
-template <class T>
-Handle<T>& Handle<T>::operator=(const Handle<T>& h) { Handle<T>(h).swap(*this); return *this; }
-
-template <class T>
-void Handle<T>::swap(Handle<T>& h) { std::swap(impl, h.impl); }
-
-
-/** Access to private impl of a Handle */
-template <class T>
-class HandlePrivate {
- public:
- static boost::intrusive_ptr<T> get(Handle<T>& h) { return boost::intrusive_ptr<T>(h.impl); }
-};
-
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_HANDLEPRIVATE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/LoadPlugins.cpp b/M4-RCs/qpid/cpp/src/qpid/client/LoadPlugins.cpp
deleted file mode 100644
index b395226859..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/LoadPlugins.cpp
+++ /dev/null
@@ -1,49 +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 "qpid/Modules.h"
-#include "qpid/sys/Shlib.h"
-#include <string>
-#include <vector>
-using std::vector;
-using std::string;
-
-namespace {
-
-struct LoadtimeInitialise {
- LoadtimeInitialise() {
- qpid::ModuleOptions moduleOptions(MODULE_DIR);
- string defaultPath (moduleOptions.loadDir);
- moduleOptions.parse (0, 0, CONF_FILE, true);
-
- for (vector<string>::iterator iter = moduleOptions.load.begin();
- iter != moduleOptions.load.end();
- iter++)
- qpid::tryShlib (iter->data(), false);
-
- if (!moduleOptions.noLoad) {
- bool isDefault = defaultPath == moduleOptions.loadDir;
- qpid::loadModuleDir (moduleOptions.loadDir, isDefault);
- }
- }
-} init;
-
-} // namespace
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/LocalQueue.cpp b/M4-RCs/qpid/cpp/src/qpid/client/LocalQueue.cpp
deleted file mode 100644
index e449c9f795..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/LocalQueue.cpp
+++ /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.
- *
- */
-#include "LocalQueue.h"
-#include "qpid/Exception.h"
-#include "qpid/framing/FrameSet.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "HandlePrivate.h"
-#include "SubscriptionImpl.h"
-
-namespace qpid {
-namespace client {
-
-using namespace framing;
-
-LocalQueue::LocalQueue() {}
-LocalQueue::~LocalQueue() {}
-
-Message LocalQueue::pop(sys::Duration timeout) { return get(timeout); }
-
-Message LocalQueue::get(sys::Duration timeout) {
- Message result;
- bool ok = get(result, timeout);
- if (!ok) throw Exception("Timed out waiting for a message");
- return result;
-}
-
-bool LocalQueue::get(Message& result, sys::Duration timeout) {
- if (!queue)
- throw ClosedException();
- FrameSet::shared_ptr content;
- bool ok = queue->pop(content, timeout);
- if (!ok) return false;
- if (content->isA<MessageTransferBody>()) {
- result = Message(*content);
- boost::intrusive_ptr<SubscriptionImpl> si = HandlePrivate<SubscriptionImpl>::get(subscription);
- assert(si);
- if (si) si->received(result);
- return true;
- }
- else
- throw CommandInvalidException(
- QPID_MSG("Unexpected method: " << content->getMethod()));
-}
-
-bool LocalQueue::empty() const
-{
- if (!queue)
- throw ClosedException();
- return queue->empty();
-}
-
-size_t LocalQueue::size() const
-{
- if (!queue)
- throw ClosedException();
- return queue->size();
-}
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/LocalQueue.h b/M4-RCs/qpid/cpp/src/qpid/client/LocalQueue.h
deleted file mode 100644
index 30ea00612d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/LocalQueue.h
+++ /dev/null
@@ -1,115 +0,0 @@
-#ifndef QPID_CLIENT_LOCALQUEUE_H
-#define QPID_CLIENT_LOCALQUEUE_H
-
-/*
- *
- * 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 "qpid/client/Message.h"
-#include "qpid/client/Subscription.h"
-#include "qpid/client/Demux.h"
-#include "qpid/sys/Time.h"
-
-namespace qpid {
-namespace client {
-
-/**
- * A local queue to collect messages retrieved from a remote broker
- * queue. Create a queue and subscribe it using the SubscriptionManager.
- * Messages from the remote queue on the broker will be stored in the
- * local queue until you retrieve them.
- *
- * \ingroup clientapi
- *
- * \details Using a Local Queue
- *
- * <pre>
- * LocalQueue local_queue;
- * subscriptions.subscribe(local_queue, string("message_queue"));
- * for (int i=0; i&lt;10; i++) {
- * Message message = local_queue.get();
- * std::cout &lt;&lt; message.getData() &lt;&lt; std::endl;
- * }
- * </pre>
- *
- * <h2>Getting Messages</h2>
- *
- * <ul><li>
- * <p>get()</p>
- * <pre>Message message = local_queue.get();</pre>
- * <pre>// Specifying timeouts (TIME_SEC, TIME_MSEC, TIME_USEC, TIME_NSEC)
- *#include <qpid/sys/Time.h>
- *Message message;
- *local_queue.get(message, 5*sys::TIME_SEC);</pre></li></ul>
- *
- * <h2>Checking size</h2>
- * <ul><li>
- * <p>empty()</p>
- * <pre>if (local_queue.empty()) { ... }</pre></li>
- * <li><p>size()</p>
- * <pre>std::cout &lt;&lt; local_queue.size();</pre></li>
- * </ul>
- */
-
-class LocalQueue {
- public:
- /** Create a local queue. Subscribe the local queue to a remote broker
- * queue with a SubscriptionManager.
- *
- * LocalQueue is an alternative to implementing a MessageListener.
- */
- LocalQueue();
-
- ~LocalQueue();
-
- /** Wait up to timeout for the next message from the local queue.
- *@param result Set to the message from the queue.
- *@param timeout wait up this timeout for a message to appear.
- *@return true if result was set, false if queue was empty after timeout.
- */
- bool get(Message& result, sys::Duration timeout=0);
-
- /** Get the next message off the local queue, or wait up to the timeout
- * for message from the broker queue.
- *@param timeout wait up this timeout for a message to appear.
- *@return message from the queue.
- *@throw ClosedException if subscription is closed or timeout exceeded.
- */
- Message get(sys::Duration timeout=sys::TIME_INFINITE);
-
- /** Synonym for get() */
- Message pop(sys::Duration timeout=sys::TIME_INFINITE);
-
- /** Return true if local queue is empty. */
- bool empty() const;
-
- /** Number of messages on the local queue */
- size_t size() const;
-
- private:
- Demux::QueuePtr queue;
- Subscription subscription;
-
- friend class SubscriptionManager;
-};
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_LOCALQUEUE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Message.cpp b/M4-RCs/qpid/cpp/src/qpid/client/Message.cpp
deleted file mode 100644
index 13caaecefd..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Message.cpp
+++ /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.
- *
- */
-
-#include "Message.h"
-
-namespace qpid {
-namespace client {
-
-Message::Message(const std::string& data, const std::string& routingKey) : TransferContent(data, routingKey) {}
-
-std::string Message::getDestination() const
-{
- return method.getDestination();
-}
-
-bool Message::isRedelivered() const
-{
- return hasDeliveryProperties() && getDeliveryProperties().getRedelivered();
-}
-
-void Message::setRedelivered(bool redelivered)
-{
- getDeliveryProperties().setRedelivered(redelivered);
-}
-
-framing::FieldTable& Message::getHeaders()
-{
- return getMessageProperties().getApplicationHeaders();
-}
-
-const framing::FieldTable& Message::getHeaders() const
-{
- return getMessageProperties().getApplicationHeaders();
-}
-
-const framing::MessageTransferBody& Message::getMethod() const
-{
- return method;
-}
-
-const framing::SequenceNumber& Message::getId() const
-{
- return id;
-}
-
-/**@internal for incoming messages */
-Message::Message(const framing::FrameSet& frameset) :
- method(*frameset.as<framing::MessageTransferBody>()), id(frameset.getId())
-{
- populate(frameset);
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Message.h b/M4-RCs/qpid/cpp/src/qpid/client/Message.h
deleted file mode 100644
index 3f932efd8b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Message.h
+++ /dev/null
@@ -1,151 +0,0 @@
-#ifndef _client_Message_h
-#define _client_Message_h
-
-/*
- *
- * 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 <string>
-#include "qpid/client/Session.h"
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/framing/TransferContent.h"
-
-namespace qpid {
-namespace client {
-
-/**
- * A message sent to or received from the broker.
- *
- * \ingroup clientapi
- * \details
- *
- * <h2>Getting and setting message contents</h2>
- *
- * <ul>
- * <li>
- * <p>getData()</p>
- * <pre>std::cout &lt;&lt; "Response: " &lt;&lt; message.getData() &lt;&lt; std::endl;</pre>
- * </li>
- * <li>
- * <p>setData()</p>
- * <pre>message.setData("That's all, folks!");</pre></li>
- * <li>
- * <p>appendData()</p>
- * <pre>message.appendData(" ... let's add a bit more ...");</pre></li>
- * </ul>
- *
- * <h2>Getting and Setting Delivery Properties</h2>
- *
- * <ul>
- * <li>
- * <p>getDeliveryProperties()</p>
- * <pre>message.getDeliveryProperties().setRoutingKey("control");</pre>
- * <pre>message.getDeliveryProperties().setDeliveryMode(PERSISTENT);</pre>
- * <pre>message.getDeliveryProperties().setPriority(9);</pre>
- * <pre>message.getDeliveryProperties().setTtl(100);</pre></li>
- *
- * <li>
- * <p>hasDeliveryProperties()</p>
- * <pre>if (! message.hasDeliveryProperties()) {
- * ...
- *}</pre></li>
- * </ul>
- *
- * <h2>Getting and Setting Message Properties</h2>
- *
- * <ul>
- * <li>
- * <p>getMessageProperties()</p>
- * <pre>
- *request.getMessageProperties().setReplyTo(ReplyTo("amq.direct", response_queue.str()));
- * </pre>
- * <pre>
- *routingKey = request.getMessageProperties().getReplyTo().getRoutingKey();
- *exchange = request.getMessageProperties().getReplyTo().getExchange();
- * </pre>
- * <pre>message.getMessageProperties().setContentType("text/plain");</pre>
- * <pre>message.getMessageProperties().setContentEncoding("text/plain");</pre>
- * </li>
- * <li>
- * <p>hasMessageProperties()</p>
- * <pre>request.getMessageProperties().hasReplyTo();</pre>
- * </li>
- * </ul>
- *
- * <h2>Getting and Setting Application Headers</h2>
- *
- * <ul>
- * <li>
- * <p>getHeaders()</p>
- * <pre>
- *message.getHeaders().getString("control");
- * </pre>
- * <pre>
- *message.getHeaders().setString("control","continue");
- * </pre></li>
- * </ul>
- *
- *
- */
-
-class Message : public framing::TransferContent
-{
-public:
- /** Create a Message.
- *@param data Data for the message body.
- *@param routingKey Passed to the exchange that routes the message.
- */
- Message(const std::string& data=std::string(),
- const std::string& routingKey=std::string());
-
- /** The destination of messages sent to the broker is the exchange
- * name. The destination of messages received from the broker is
- * the delivery tag identifyig the local subscription (often this
- * is the name of the subscribed queue.)
- */
- std::string getDestination() const;
-
- /** Check the redelivered flag. */
- bool isRedelivered() const;
- /** Set the redelivered flag. */
- void setRedelivered(bool redelivered);
-
- /** Get a modifyable reference to the message headers. */
- framing::FieldTable& getHeaders();
-
- /** Get a non-modifyable reference to the message headers. */
- const framing::FieldTable& getHeaders() const;
-
- ///@internal
- const framing::MessageTransferBody& getMethod() const;
- ///@internal
- const framing::SequenceNumber& getId() const;
-
- /**@internal for incoming messages */
- Message(const framing::FrameSet& frameset);
-
-private:
- //method and id are only set for received messages:
- framing::MessageTransferBody method;
- framing::SequenceNumber id;
-};
-
-}}
-
-#endif /*!_client_Message_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/MessageListener.cpp b/M4-RCs/qpid/cpp/src/qpid/client/MessageListener.cpp
deleted file mode 100644
index 68ebedeb0d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/MessageListener.cpp
+++ /dev/null
@@ -1,24 +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 "MessageListener.h"
-
-qpid::client::MessageListener::~MessageListener() {}
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/MessageListener.h b/M4-RCs/qpid/cpp/src/qpid/client/MessageListener.h
deleted file mode 100644
index 75aad6521b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/MessageListener.h
+++ /dev/null
@@ -1,100 +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 <string>
-
-#ifndef _MessageListener_
-#define _MessageListener_
-
-#include "Message.h"
-
-namespace qpid {
-namespace client {
-
- /**
- * Implement a subclass of MessageListener and subscribe it using
- * the SubscriptionManager to receive messages.
- *
- * Another way to receive messages is by using a LocalQueue.
- *
- * \ingroup clientapi
- * \details
- *
- * <h2>Using a MessageListener</h2>
- *
- * <ul>
- * <li>
- * <p>The received() function is called when a message arrives:</p>
- * <pre>virtual void received(Message&amp; message)=0;</pre>
- * </li>
- * <li>
- * <p>Derive your own listener, implement the received() function:</p>
- * <pre>
- * class Listener : public MessageListener {
- * private:
- * SubscriptionManager&amp; subscriptions;
- * public:
- * Listener(SubscriptionManager&amp; subscriptions);
- * virtual void received(Message&amp; message);
- * };
- *
- * Listener::Listener(SubscriptionManager&amp; subs) : subscriptions(subs)
- * {}
- *
- * void Listener::received(Message&amp; message) {
- * std::cout &lt;&lt; "Message: " &lt;&lt; message.getData() &lt;&lt; std::endl;
- * if (message.getData() == "That's all, folks!") {
- * std::cout &lt;&lt; "Shutting down listener for " &lt;&lt; message.getDestination()
- * &lt;&lt; std::endl;
- * subscriptions.cancel(message.getDestination());
- * }
- * }
- *</pre>
- * <pre>
- * SubscriptionManager subscriptions(session);
- *
- * // Create a listener and subscribe it to the queue named "message_queue"
- * Listener listener(subscriptions);
- * subscriptions.subscribe(listener, "message_queue");
- *
- * // Receive messages until the subscription is cancelled
- * // by Listener::received()
- * subscriptions.run();
- * </pre>
- * </li>
- * </ul>
- *
- */
-
- class MessageListener{
- public:
- virtual ~MessageListener();
-
- /** Called for each message arriving from the broker. Override
- * in your own subclass to process messages.
- */
- virtual void received(Message& msg) = 0;
- };
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/MessageReplayTracker.cpp b/M4-RCs/qpid/cpp/src/qpid/client/MessageReplayTracker.cpp
deleted file mode 100644
index 9ffbb76837..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/MessageReplayTracker.cpp
+++ /dev/null
@@ -1,80 +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 "MessageReplayTracker.h"
-#include <boost/bind.hpp>
-
-namespace qpid {
-namespace client {
-
-MessageReplayTracker::MessageReplayTracker(uint f) : flushInterval(f), count(0) {}
-
-void MessageReplayTracker::send(const Message& message, const std::string& destination)
-{
- buffer.push_back(ReplayRecord(message, destination));
- buffer.back().send(*this);
- if (flushInterval && ++count >= flushInterval) {
- checkCompletion();
- if (!buffer.empty()) session.flush();
- }
-}
-void MessageReplayTracker::init(AsyncSession s)
-{
- session = s;
-}
-
-void MessageReplayTracker::replay(AsyncSession s)
-{
- session = s;
- std::list<ReplayRecord> copy;
- buffer.swap(copy);
- std::for_each(copy.begin(), copy.end(), boost::bind(&ReplayRecord::send, _1, boost::ref(*this)));
- session.flush();
- count = 0;
-}
-
-void MessageReplayTracker::setFlushInterval(uint f)
-{
- flushInterval = f;
-}
-
-uint MessageReplayTracker::getFlushInterval()
-{
- return flushInterval;
-}
-
-void MessageReplayTracker::checkCompletion()
-{
- buffer.remove_if(boost::bind(&ReplayRecord::isComplete, _1));
-}
-
-MessageReplayTracker::ReplayRecord::ReplayRecord(const Message& m, const std::string& d) : message(m), destination(d) {}
-
-void MessageReplayTracker::ReplayRecord::send(MessageReplayTracker& tracker)
-{
- status = tracker.session.messageTransfer(arg::destination=destination, arg::content=message);
-}
-
-bool MessageReplayTracker::ReplayRecord::isComplete()
-{
- return status.isComplete();
-}
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/MessageReplayTracker.h b/M4-RCs/qpid/cpp/src/qpid/client/MessageReplayTracker.h
deleted file mode 100644
index 45b16fb704..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/MessageReplayTracker.h
+++ /dev/null
@@ -1,73 +0,0 @@
-#ifndef QPID_CLIENT_MESSAGEREPLAYTRACKER_H
-#define QPID_CLIENT_MESSAGEREPLAYTRACKER_H
-
-/*
- *
- * 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 "AsyncSession.h"
-#include "Message.h"
-
-#include <list>
-#include <string>
-
-namespace qpid {
-namespace client {
-
-/**
- * Utility to track messages sent asynchronously, allowing those that
- * are indoubt to be replayed over a new session.
- */
-class MessageReplayTracker
-{
- public:
- MessageReplayTracker(uint flushInterval);
- void send(const Message& message, const std::string& destination = "");
- void init(AsyncSession session);
- void replay(AsyncSession session);
- void setFlushInterval(uint interval);
- uint getFlushInterval();
- void checkCompletion();
-
- template <class F> void foreach(F& f) {
- for (std::list<ReplayRecord>::const_iterator i = buffer.begin(); i != buffer.end(); i++) {
- f(i->message);
- }
- }
-
- private:
- struct ReplayRecord
- {
- Completion status;
- Message message;
- std::string destination;
-
- ReplayRecord(const Message& message, const std::string& destination);
- void send(MessageReplayTracker&);
- bool isComplete();
- };
-
- AsyncSession session;
- uint flushInterval;
- uint count;
- std::list<ReplayRecord> buffer;
-};
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_MESSAGEREPLAYTRACKER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/QueueOptions.cpp b/M4-RCs/qpid/cpp/src/qpid/client/QueueOptions.cpp
deleted file mode 100644
index ac65b0bc22..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/QueueOptions.cpp
+++ /dev/null
@@ -1,116 +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 "QueueOptions.h"
-
-namespace qpid {
-namespace client {
-
-
-QueueOptions::QueueOptions()
-{}
-
-const std::string QueueOptions::strMaxCountKey("qpid.max_count");
-const std::string QueueOptions::strMaxSizeKey("qpid.max_size");
-const std::string QueueOptions::strTypeKey("qpid.policy_type");
-const std::string QueueOptions::strREJECT("reject");
-const std::string QueueOptions::strFLOW_TO_DISK("flow_to_disk");
-const std::string QueueOptions::strRING("ring");
-const std::string QueueOptions::strRING_STRICT("ring_strict");
-const std::string QueueOptions::strLastValueQueue("qpid.last_value_queue");
-const std::string QueueOptions::strPersistLastNode("qpid.persist_last_node");
-const std::string QueueOptions::strLVQMatchProperty("qpid.LVQ_key");
-const std::string QueueOptions::strLastValueQueueNoBrowse("qpid.last_value_queue_no_browse");
-
-
-QueueOptions::~QueueOptions()
-{}
-
-void QueueOptions::setSizePolicy(QueueSizePolicy sp, uint64_t maxSize, uint32_t maxCount)
-{
- if (maxCount) setInt(strMaxCountKey, maxCount);
- if (maxSize) setInt(strMaxSizeKey, maxSize);
- if (maxSize || maxCount){
- switch (sp)
- {
- case REJECT:
- setString(strTypeKey, strREJECT);
- break;
- case FLOW_TO_DISK:
- setString(strTypeKey, strFLOW_TO_DISK);
- break;
- case RING:
- setString(strTypeKey, strRING);
- break;
- case RING_STRICT:
- setString(strTypeKey, strRING_STRICT);
- break;
- case NONE:
- clearSizePolicy();
- break;
- }
- }
-}
-
-
-void QueueOptions::setPersistLastNode()
-{
- setInt(strPersistLastNode, 1);
-}
-
-void QueueOptions::setOrdering(QueueOrderingPolicy op)
-{
- if (op == LVQ){
- setInt(strLastValueQueue, 1);
- }else if (op == LVQ_NO_BROWSE){
- setInt(strLastValueQueueNoBrowse, 1);
- }else {
- clearOrdering();
- }
-}
-
-void QueueOptions::getLVQKey(std::string& key)
-{
- key.assign(strLVQMatchProperty);
-}
-
-void QueueOptions::clearSizePolicy()
-{
- erase(strMaxCountKey);
- erase(strMaxSizeKey);
- erase(strTypeKey);
-}
-
-void QueueOptions::clearPersistLastNode()
-{
- erase(strPersistLastNode);
-}
-
-void QueueOptions::clearOrdering()
-{
- erase(strLastValueQueue);
-}
-
-
-}
-}
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/QueueOptions.h b/M4-RCs/qpid/cpp/src/qpid/client/QueueOptions.h
deleted file mode 100644
index 114e1e49c2..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/QueueOptions.h
+++ /dev/null
@@ -1,104 +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 "qpid/framing/FieldTable.h"
-
-#ifndef _QueueOptions_
-#define _QueueOptions_
-
-namespace qpid {
-namespace client {
-
-enum QueueSizePolicy {NONE, REJECT, FLOW_TO_DISK, RING, RING_STRICT};
-enum QueueOrderingPolicy {FIFO, LVQ, LVQ_NO_BROWSE};
-
-/**
- * A help class to set options on the Queue. Create a configured args while
- * still allowing any custom configuration via the FieldTable base class
- */
-class QueueOptions: public framing::FieldTable
-{
- public:
- QueueOptions();
- virtual ~QueueOptions();
-
- /**
- * Sets the queue sizing plocy
- *
- * @param sp SizePolicy
- * REJECT - reject if queue greater than size/count
- * FLOW_TO_DISK - page messages to disk from this point is greater than size/count
- * RING - limit the queue to size/count and over-write old messages round a ring
- * RING_STRICT - limit the queue to size/count and reject is head == tail
- * NONE - Use default broker sizing policy
- * @param maxSize Set the max number of bytes for the sizing policies
- * @param setMaxCount Set the max number of messages for the sizing policies
- */
- void setSizePolicy(QueueSizePolicy sp, uint64_t maxSize, uint32_t maxCount );
-
- /**
- * Enables the persisting of a queue to the store module when a cluster fails down to it's last
- * node. Does so optimistically. Will start persisting when cluster count >1 again.
- */
- void setPersistLastNode();
-
- /**
- * Sets the odering policy on the Queue, default ordering is FIFO.
- */
- void setOrdering(QueueOrderingPolicy op);
-
- /**
- * Use broker defualt sizing ploicy
- */
- void clearSizePolicy();
-
- /**
- * Clear Persist Last Node Policy
- */
- void clearPersistLastNode();
-
- /**
- * get the key used match LVQ in args for message transfer
- */
- void getLVQKey(std::string& key);
-
- /**
- * Use default odering policy
- */
- void clearOrdering();
-
- static const std::string strMaxCountKey;
- static const std::string strMaxSizeKey;
- static const std::string strTypeKey;
- static const std::string strREJECT;
- static const std::string strFLOW_TO_DISK;
- static const std::string strRING;
- static const std::string strRING_STRICT;
- static const std::string strLastValueQueue;
- static const std::string strPersistLastNode;
- static const std::string strLVQMatchProperty;
- static const std::string strLastValueQueueNoBrowse;
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/RdmaConnector.cpp b/M4-RCs/qpid/cpp/src/qpid/client/RdmaConnector.cpp
deleted file mode 100644
index 98fe762f31..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/RdmaConnector.cpp
+++ /dev/null
@@ -1,428 +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 "Connector.h"
-
-#include "Bounds.h"
-#include "ConnectionImpl.h"
-#include "ConnectionSettings.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/Time.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/sys/rdma/RdmaIO.h"
-#include "qpid/sys/Dispatcher.h"
-#include "qpid/sys/Poller.h"
-#include "qpid/Msg.h"
-
-#include <iostream>
-#include <boost/bind.hpp>
-#include <boost/format.hpp>
-#include <boost/lexical_cast.hpp>
-
-// This stuff needs to abstracted out of here to a platform specific file
-#include <netdb.h>
-
-namespace qpid {
-namespace client {
-
-using namespace qpid::sys;
-using namespace qpid::framing;
-using boost::format;
-using boost::str;
-
-class RdmaConnector : public Connector, private sys::Runnable
-{
- struct Buff;
-
- /** Batch up frames for writing to aio. */
- class Writer : public framing::FrameHandler {
- typedef Rdma::Buffer BufferBase;
- typedef std::deque<framing::AMQFrame> Frames;
-
- const uint16_t maxFrameSize;
- sys::Mutex lock;
- Rdma::AsynchIO* aio;
- BufferBase* buffer;
- Frames frames;
- size_t lastEof; // Position after last EOF in frames
- framing::Buffer encode;
- size_t framesEncoded;
- std::string identifier;
- Bounds* bounds;
-
- void writeOne();
- void newBuffer();
-
- public:
-
- Writer(uint16_t maxFrameSize, Bounds*);
- ~Writer();
- void init(std::string id, Rdma::AsynchIO*);
- void handle(framing::AMQFrame&);
- void write(Rdma::AsynchIO&);
- };
-
- const uint16_t maxFrameSize;
- framing::ProtocolVersion version;
- bool initiated;
-
- sys::Mutex pollingLock;
- bool polling;
- bool joined;
-
- sys::ShutdownHandler* shutdownHandler;
- framing::InputHandler* input;
- framing::InitiationHandler* initialiser;
- framing::OutputHandler* output;
-
- Writer writer;
-
- sys::Thread receiver;
-
- Rdma::AsynchIO* aio;
- sys::Poller::shared_ptr poller;
-
- ~RdmaConnector();
-
- void run();
- void handleClosed();
- bool closeInternal();
-
- // Callbacks
- void connected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&);
- void connectionError(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, Rdma::ErrorType);
- void disconnected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&);
- void rejected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&);
-
- void readbuff(Rdma::AsynchIO&, Rdma::Buffer*);
- void writebuff(Rdma::AsynchIO&);
- void writeDataBlock(const framing::AMQDataBlock& data);
- void eof(Rdma::AsynchIO&);
-
- std::string identifier;
-
- ConnectionImpl* impl;
-
- void connect(const std::string& host, int port);
- void close();
- void send(framing::AMQFrame& frame);
-
- void setInputHandler(framing::InputHandler* handler);
- void setShutdownHandler(sys::ShutdownHandler* handler);
- sys::ShutdownHandler* getShutdownHandler() const;
- framing::OutputHandler* getOutputHandler();
- const std::string& getIdentifier() const;
-
-public:
- RdmaConnector(framing::ProtocolVersion pVersion,
- const ConnectionSettings&,
- ConnectionImpl*);
-};
-
-// Static constructor which registers connector here
-namespace {
- Connector* create(framing::ProtocolVersion v, const ConnectionSettings& s, ConnectionImpl* c) {
- return new RdmaConnector(v, s, c);
- }
-
- struct StaticInit {
- StaticInit() {
- Connector::registerFactory("rdma", &create);
- Connector::registerFactory("ib", &create);
- };
- } init;
-}
-
-
-RdmaConnector::RdmaConnector(ProtocolVersion ver,
- const ConnectionSettings& settings,
- ConnectionImpl* cimpl)
- : maxFrameSize(settings.maxFrameSize),
- version(ver),
- initiated(false),
- polling(false),
- joined(true),
- shutdownHandler(0),
- writer(maxFrameSize, cimpl),
- aio(0),
- impl(cimpl)
-{
- QPID_LOG(debug, "RdmaConnector created for " << version);
-}
-
-RdmaConnector::~RdmaConnector() {
- close();
-}
-
-void RdmaConnector::connect(const std::string& host, int port){
- Mutex::ScopedLock l(pollingLock);
- assert(!polling);
- assert(joined);
- poller = Poller::shared_ptr(new Poller);
-
- // This stuff needs to abstracted out of here to a platform specific file
- ::addrinfo *res;
- ::addrinfo hints;
- hints.ai_flags = 0;
- hints.ai_family = AF_INET;
- hints.ai_socktype = SOCK_STREAM;
- hints.ai_protocol = 0;
- int n = ::getaddrinfo(host.c_str(), boost::lexical_cast<std::string>(port).c_str(), &hints, &res);
- if (n<0) {
- throw Exception(QPID_MSG("Cannot resolve " << host << ": " << ::gai_strerror(n)));
- }
-
- Rdma::Connector* c = new Rdma::Connector(
- *res->ai_addr,
- Rdma::ConnectionParams(maxFrameSize, Rdma::DEFAULT_WR_ENTRIES),
- boost::bind(&RdmaConnector::connected, this, poller, _1, _2),
- boost::bind(&RdmaConnector::connectionError, this, poller, _1, _2),
- boost::bind(&RdmaConnector::disconnected, this, poller, _1),
- boost::bind(&RdmaConnector::rejected, this, poller, _1, _2));
- c->start(poller);
-
- polling = true;
- joined = false;
- receiver = Thread(this);
-}
-
-// The following only gets run when connected
-void RdmaConnector::connected(Poller::shared_ptr poller, Rdma::Connection::intrusive_ptr& ci, const Rdma::ConnectionParams& cp) {
- Rdma::QueuePair::intrusive_ptr q = ci->getQueuePair();
-
- aio = new Rdma::AsynchIO(ci->getQueuePair(),
- cp.maxRecvBufferSize, cp.initialXmitCredit , Rdma::DEFAULT_WR_ENTRIES,
- boost::bind(&RdmaConnector::readbuff, this, _1, _2),
- boost::bind(&RdmaConnector::writebuff, this, _1),
- 0, // write buffers full
- boost::bind(&RdmaConnector::eof, this, _1)); // data error - just close connection
- aio->start(poller);
-
- identifier = str(format("[%1% %2%]") % ci->getLocalName() % ci->getPeerName());
- writer.init(identifier, aio);
- ProtocolInitiation init(version);
- writeDataBlock(init);
-}
-
-void RdmaConnector::connectionError(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, Rdma::ErrorType) {
- QPID_LOG(trace, "Connection Error " << identifier);
- eof(*aio);
-}
-
-void RdmaConnector::disconnected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&) {
- eof(*aio);
-}
-
-void RdmaConnector::rejected(sys::Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams& cp) {
- QPID_LOG(trace, "Connection Rejected " << identifier << ": " << cp.maxRecvBufferSize);
- eof(*aio);
-}
-
-bool RdmaConnector::closeInternal() {
- bool ret;
- {
- Mutex::ScopedLock l(pollingLock);
- ret = polling;
- if (polling) {
- polling = false;
- poller->shutdown();
- }
- if (joined || receiver.id() == Thread::current().id()) {
- return ret;
- }
- joined = true;
- }
-
- receiver.join();
- return ret;
-}
-
-void RdmaConnector::close() {
- closeInternal();
-}
-
-void RdmaConnector::setInputHandler(InputHandler* handler){
- input = handler;
-}
-
-void RdmaConnector::setShutdownHandler(ShutdownHandler* handler){
- shutdownHandler = handler;
-}
-
-OutputHandler* RdmaConnector::getOutputHandler(){
- return this;
-}
-
-sys::ShutdownHandler* RdmaConnector::getShutdownHandler() const {
- return shutdownHandler;
-}
-
-const std::string& RdmaConnector::getIdentifier() const {
- return identifier;
-}
-
-void RdmaConnector::send(AMQFrame& frame) {
- writer.handle(frame);
-}
-
-void RdmaConnector::handleClosed() {
- if (closeInternal() && shutdownHandler)
- shutdownHandler->shutdown();
-}
-
-RdmaConnector::Writer::Writer(uint16_t s, Bounds* b) :
- maxFrameSize(s),
- aio(0),
- buffer(0),
- lastEof(0),
- bounds(b)
-{
-}
-
-RdmaConnector::Writer::~Writer() {
- if (aio)
- aio->returnBuffer(buffer);
-}
-
-void RdmaConnector::Writer::init(std::string id, Rdma::AsynchIO* a) {
- Mutex::ScopedLock l(lock);
- identifier = id;
- aio = a;
- assert(aio->bufferAvailable());
- newBuffer();
-}
-void RdmaConnector::Writer::handle(framing::AMQFrame& frame) {
- Mutex::ScopedLock l(lock);
- frames.push_back(frame);
- // Don't bother to send anything unless we're at the end of a frameset (assembly in 0-10 terminology)
- if (frame.getEof()) {
- lastEof = frames.size();
- QPID_LOG(debug, "Requesting write: lastEof=" << lastEof);
- aio->notifyPendingWrite();
- }
- QPID_LOG(trace, "SENT " << identifier << ": " << frame);
-}
-
-void RdmaConnector::Writer::writeOne() {
- assert(buffer);
- QPID_LOG(trace, "Write buffer " << encode.getPosition()
- << " bytes " << framesEncoded << " frames ");
- framesEncoded = 0;
-
- buffer->dataStart = 0;
- buffer->dataCount = encode.getPosition();
- aio->queueWrite(buffer);
- newBuffer();
-}
-
-void RdmaConnector::Writer::newBuffer() {
- buffer = aio->getBuffer();
- encode = framing::Buffer(buffer->bytes, buffer->byteCount);
- framesEncoded = 0;
-}
-
-// Called in IO thread. (write idle routine)
-// This is NOT only called in response to previously calling notifyPendingWrite
-void RdmaConnector::Writer::write(Rdma::AsynchIO&) {
- Mutex::ScopedLock l(lock);
- assert(buffer);
- // If nothing to do return immediately
- if (lastEof==0)
- return;
- size_t bytesWritten = 0;
- while (aio->writable() && aio->bufferAvailable() && !frames.empty()) {
- const AMQFrame* frame = &frames.front();
- uint32_t size = frame->encodedSize();
- while (size <= encode.available()) {
- frame->encode(encode);
- frames.pop_front();
- ++framesEncoded;
- bytesWritten += size;
- if (frames.empty())
- break;
- frame = &frames.front();
- size = frame->encodedSize();
- }
- lastEof -= framesEncoded;
- writeOne();
- }
- if (bounds) bounds->reduce(bytesWritten);
-}
-
-void RdmaConnector::readbuff(Rdma::AsynchIO&, Rdma::Buffer* buff) {
- framing::Buffer in(buff->bytes+buff->dataStart, buff->dataCount);
-
- if (!initiated) {
- framing::ProtocolInitiation protocolInit;
- if (protocolInit.decode(in)) {
- //TODO: check the version is correct
- QPID_LOG(debug, "RECV " << identifier << " INIT(" << protocolInit << ")");
- }
- initiated = true;
- }
- AMQFrame frame;
- while(frame.decode(in)){
- QPID_LOG(trace, "RECV " << identifier << ": " << frame);
- input->received(frame);
- }
-}
-
-void RdmaConnector::writebuff(Rdma::AsynchIO& aio_) {
- writer.write(aio_);
-}
-
-void RdmaConnector::writeDataBlock(const AMQDataBlock& data) {
- Rdma::Buffer* buff = aio->getBuffer();
- framing::Buffer out(buff->bytes, buff->byteCount);
- data.encode(out);
- buff->dataCount = data.encodedSize();
- aio->queueWrite(buff);
-}
-
-void RdmaConnector::eof(Rdma::AsynchIO&) {
- handleClosed();
-}
-
-// TODO: astitcher 20070908 This version of the code can never time out, so the idle processing
-// will never be called
-void RdmaConnector::run(){
- // Keep the connection impl in memory until run() completes.
- //GRS: currently the ConnectionImpls destructor is where the Io thread is joined
- //boost::shared_ptr<ConnectionImpl> protect = impl->shared_from_this();
- //assert(protect);
- try {
- Dispatcher d(poller);
-
- //aio->start(poller);
- d.run();
- //aio->queueForDeletion();
- } catch (const std::exception& e) {
- {
- // We're no longer polling
- Mutex::ScopedLock l(pollingLock);
- polling = false;
- }
- QPID_LOG(error, e.what());
- handleClosed();
- }
-}
-
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Results.cpp b/M4-RCs/qpid/cpp/src/qpid/client/Results.cpp
deleted file mode 100644
index 1b98d6c98a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Results.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 "Results.h"
-#include "FutureResult.h"
-#include "qpid/framing/SequenceSet.h"
-
-using namespace qpid::framing;
-using namespace boost;
-
-namespace qpid {
-namespace client {
-
-Results::Results() {}
-
-Results::~Results() {
- try { close(); } catch (const std::exception& /*e*/) { assert(0); }
-}
-
-void Results::close()
-{
- for (Listeners::iterator i = listeners.begin(); i != listeners.end(); i++) {
- i->second->completed();
- }
- listeners.clear();
-}
-
-void Results::completed(const SequenceSet& set)
-{
- //call complete on those listeners whose ids fall within the set
- Listeners::iterator i = listeners.begin();
- while (i != listeners.end()) {
- if (set.contains(i->first)) {
- i->second->completed();
- listeners.erase(i++);
- } else {
- i++;
- }
- }
-}
-
-void Results::received(const SequenceNumber& id, const std::string& result)
-{
- Listeners::iterator i = listeners.find(id);
- if (i != listeners.end()) {
- i->second->received(result);
- listeners.erase(i);
- }
-}
-
-Results::FutureResultPtr Results::listenForResult(const SequenceNumber& id)
-{
- FutureResultPtr l(new FutureResult());
- listeners[id] = l;
- return l;
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Results.h b/M4-RCs/qpid/cpp/src/qpid/client/Results.h
deleted file mode 100644
index 4c49f6b05b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Results.h
+++ /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.
- *
- */
-
-#include "qpid/framing/SequenceNumber.h"
-#include <map>
-#include <boost/shared_ptr.hpp>
-
-#ifndef _Results_
-#define _Results_
-
-namespace qpid {
-namespace client {
-
-class FutureResult;
-
-///@internal
-class Results
-{
-public:
- typedef boost::shared_ptr<FutureResult> FutureResultPtr;
-
- Results();
- ~Results();
- void completed(const framing::SequenceSet& set);
- void received(const framing::SequenceNumber& id, const std::string& result);
- FutureResultPtr listenForResult(const framing::SequenceNumber& point);
- void close();
-
-private:
- typedef std::map<framing::SequenceNumber, FutureResultPtr> Listeners;
- Listeners listeners;
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Session.h b/M4-RCs/qpid/cpp/src/qpid/client/Session.h
deleted file mode 100644
index bdabd26c82..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Session.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef QPID_CLIENT_SESSION_H
-#define QPID_CLIENT_SESSION_H
-
-/*
- *
- * 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 "qpid/client/Session_0_10.h"
-
-namespace qpid {
-namespace client {
-
-/**
- * Session is an alias for Session_0_10
- *
- * \ingroup clientapi
- */
-typedef Session_0_10 Session;
-
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_SESSION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10.cpp b/M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10.cpp
deleted file mode 100644
index c933a64f07..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10.cpp
+++ /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.
- *
- */
-#include "SessionBase_0_10.h"
-#include "Connection.h"
-#include "qpid/framing/all_method_bodies.h"
-
-namespace qpid {
-namespace client {
-
-using namespace framing;
-
-SessionBase_0_10::SessionBase_0_10() {}
-SessionBase_0_10::~SessionBase_0_10() {}
-
-void SessionBase_0_10::close() { impl->close(); }
-
-Execution& SessionBase_0_10::getExecution()
-{
- return *impl;
-}
-
-void SessionBase_0_10::flush()
-{
- impl->sendFlush();
-}
-
-void SessionBase_0_10::sync()
-{
- ExecutionSyncBody b;
- b.setSync(true);
- impl->send(b).wait(*impl);
-}
-
-void SessionBase_0_10::markCompleted(const framing::SequenceSet& ids, bool notifyPeer)
-{
- impl->markCompleted(ids, notifyPeer);
-}
-
-void SessionBase_0_10::markCompleted(const framing::SequenceNumber& id, bool cumulative, bool notifyPeer)
-{
- impl->markCompleted(id, cumulative, notifyPeer);
-}
-
-void SessionBase_0_10::sendCompletion()
-{
- impl->sendCompletion();
-}
-
-uint16_t SessionBase_0_10::getChannel() const { return impl->getChannel(); }
-
-void SessionBase_0_10::suspend() { impl->suspend(); }
-void SessionBase_0_10::resume(Connection c) { impl->resume(c.impl); }
-uint32_t SessionBase_0_10::timeout(uint32_t seconds) { return impl->setTimeout(seconds); }
-
-SessionId SessionBase_0_10::getId() const { return impl->getId(); }
-framing::FrameSet::shared_ptr SessionBase_0_10::get() { return impl->get(); }
-
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10.h b/M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10.h
deleted file mode 100644
index 091c977053..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10.h
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef QPID_CLIENT_SESSIONBASE_H
-#define QPID_CLIENT_SESSIONBASE_H
-
-/*
- *
- * 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 "qpid/SessionId.h"
-#include "qpid/framing/amqp_structs.h"
-#include "qpid/framing/ProtocolVersion.h"
-#include "qpid/framing/MethodContent.h"
-#include "qpid/framing/TransferContent.h"
-#include "qpid/client/Completion.h"
-#include "qpid/client/ConnectionImpl.h"
-#include "qpid/client/Execution.h"
-#include "qpid/client/SessionImpl.h"
-#include "qpid/client/TypedResult.h"
-#include "qpid/shared_ptr.h"
-#include <string>
-
-namespace qpid {
-namespace client {
-
-class Connection;
-
-using std::string;
-using framing::Content;
-using framing::FieldTable;
-using framing::MethodContent;
-using framing::SequenceNumber;
-using framing::SequenceSet;
-using framing::SequenceNumberSet;
-using qpid::SessionId;
-using framing::Xid;
-
-/** Unit of message credit: messages or bytes */
-enum CreditUnit { MESSAGE_CREDIT=0, BYTE_CREDIT=1, UNLIMITED_CREDIT=0xFFFFFFFF };
-
-/**
- * Base class for handles to an AMQP session.
- *
- * Subclasses provide the AMQP commands for a given
- * version of the protocol.
- */
-class SessionBase_0_10 {
- public:
-
- typedef framing::TransferContent DefaultContent;
-
- ///@internal
- SessionBase_0_10();
- ~SessionBase_0_10();
-
- /** Get the next message frame-set from the session. */
- framing::FrameSet::shared_ptr get();
-
- /** Get the session ID */
- SessionId getId() const;
-
- /** Close the session.
- * A session is automatically closed when all handles to it are destroyed.
- */
- void close();
-
- /**
- * Synchronize the session: sync() waits until all commands issued
- * on this session so far have been completed by the broker.
- *
- * Note sync() is always synchronous, even on an AsyncSession object
- * because that's almost always what you want. You can call
- * AsyncSession::executionSync() directly in the unusual event
- * that you want to do an asynchronous sync.
- */
- void sync();
-
- /** Set the timeout for this session. */
- uint32_t timeout(uint32_t seconds);
-
- /** Suspend the session - detach it from its connection */
- void suspend();
-
- /** Resume a suspended session with a new connection */
- void resume(Connection);
-
- /** Get the channel associated with this session */
- uint16_t getChannel() const;
-
- Execution& getExecution();
- void flush();
- void markCompleted(const framing::SequenceSet& ids, bool notifyPeer);
- void markCompleted(const framing::SequenceNumber& id, bool cumulative, bool notifyPeer);
- void sendCompletion();
-
- protected:
- boost::shared_ptr<SessionImpl> impl;
- friend class SessionBase_0_10Access;
-};
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_SESSIONBASE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10Access.h b/M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10Access.h
deleted file mode 100644
index e2189a53dd..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/SessionBase_0_10Access.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef QPID_CLIENT_SESSIONBASEACCESS_H
-#define QPID_CLIENT_SESSIONBASEACCESS_H
-
-/*
- *
- * 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 "qpid/client/SessionBase_0_10.h"
-
-/**@file @internal Internal use only */
-
-namespace qpid {
-namespace client {
-
-class SessionBase_0_10Access {
- public:
- SessionBase_0_10Access(SessionBase_0_10& sb_) : sb(sb_) {}
- void set(const boost::shared_ptr<SessionImpl>& si) { sb.impl = si; }
- boost::shared_ptr<SessionImpl> get() { return sb.impl; }
- private:
- SessionBase_0_10& sb;
-};
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_SESSIONBASEACCESS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/SessionImpl.cpp b/M4-RCs/qpid/cpp/src/qpid/client/SessionImpl.cpp
deleted file mode 100644
index ab8c1bddb8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/SessionImpl.cpp
+++ /dev/null
@@ -1,695 +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 "SessionImpl.h"
-
-#include "ConnectionImpl.h"
-#include "Future.h"
-
-#include "qpid/framing/all_method_bodies.h"
-#include "qpid/framing/ClientInvoker.h"
-#include "qpid/framing/enum.h"
-#include "qpid/framing/FrameSet.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/MethodContent.h"
-#include "qpid/framing/SequenceSet.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/framing/DeliveryProperties.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/IntegerTypes.h"
-
-#include <boost/bind.hpp>
-
-namespace { const std::string EMPTY; }
-
-namespace qpid {
-namespace client {
-
-using namespace qpid::framing;
-using namespace qpid::framing::session; //for detach codes
-
-typedef sys::Monitor::ScopedLock Lock;
-typedef sys::Monitor::ScopedUnlock UnLock;
-typedef sys::ScopedLock<sys::Semaphore> Acquire;
-
-
-SessionImpl::SessionImpl(const std::string& name, shared_ptr<ConnectionImpl> conn)
- : state(INACTIVE),
- detachedLifetime(0),
- maxFrameSize(conn->getNegotiatedSettings().maxFrameSize),
- id(conn->getNegotiatedSettings().username, name.empty() ? Uuid(true).str() : name),
- connectionShared(conn),
- connectionWeak(conn),
- weakPtr(false),
- ioHandler(*this),
- proxy(ioHandler),
- nextIn(0),
- nextOut(0)
-{
- channel.next = connectionShared.get();
-}
-
-SessionImpl::~SessionImpl() {
- {
- Lock l(state);
- if (state != DETACHED) {
- QPID_LOG(warning, "Session was not closed cleanly");
- setState(DETACHED);
- handleClosed();
- state.waitWaiters();
- }
- }
- boost::shared_ptr<ConnectionImpl> c = connectionWeak.lock();
- if (c) c->erase(channel);
-}
-
-
-FrameSet::shared_ptr SessionImpl::get() // user thread
-{
- // No lock here: pop does a blocking wait.
- return demux.getDefault()->pop();
-}
-
-const SessionId SessionImpl::getId() const //user thread
-{
- return id; //id is immutable
-}
-
-void SessionImpl::open(uint32_t timeout) // user thread
-{
- Lock l(state);
- if (state == INACTIVE) {
- setState(ATTACHING);
- proxy.attach(id.getName(), false);
- waitFor(ATTACHED);
- //TODO: timeout will not be set locally until get response to
- //confirm, should we wait for that?
- setTimeout(timeout);
- proxy.commandPoint(nextOut, 0);
- } else {
- throw Exception("Open already called for this session");
- }
-}
-
-void SessionImpl::close() //user thread
-{
- Lock l(state);
- if (detachedLifetime) setTimeout(0);
- detach();
- waitFor(DETACHED);
-}
-
-void SessionImpl::resume(shared_ptr<ConnectionImpl>) // user thread
-{
- // weakPtr sessions should not be resumed.
- if (weakPtr) return;
- throw NotImplementedException("Resume not yet implemented by client!");
-}
-
-void SessionImpl::suspend() //user thread
-{
- Lock l(state);
- detach();
-}
-
-void SessionImpl::detach() //call with lock held
-{
- if (state == ATTACHED) {
- setState(DETACHING);
- proxy.detach(id.getName());
- }
-}
-
-
-uint16_t SessionImpl::getChannel() const // user thread
-{
- return channel;
-}
-
-void SessionImpl::setChannel(uint16_t c) // user thread
-{
- //channel will only ever be set when session is detached (and
- //about to be resumed)
- channel = c;
-}
-
-Demux& SessionImpl::getDemux()
-{
- return demux;
-}
-
-void SessionImpl::waitForCompletion(const SequenceNumber& id)
-{
- Lock l(state);
- waitForCompletionImpl(id);
-}
-
-void SessionImpl::waitForCompletionImpl(const SequenceNumber& id) //call with lock held
-{
- while (incompleteOut.contains(id)) {
- checkOpen();
- state.wait();
- }
-}
-
-bool SessionImpl::isComplete(const SequenceNumber& id)
-{
- Lock l(state);
- return !incompleteOut.contains(id);
-}
-
-struct IsCompleteUpTo
-{
- const SequenceNumber& id;
- bool result;
-
- IsCompleteUpTo(const SequenceNumber& _id) : id(_id), result(true) {}
- void operator()(const SequenceNumber& start, const SequenceNumber&)
- {
- if (start <= id) result = false;
- }
-
-};
-
-bool SessionImpl::isCompleteUpTo(const SequenceNumber& id)
-{
- Lock l(state);
- //return false if incompleteOut contains anything less than id,
- //true otherwise
- IsCompleteUpTo f(id);
- incompleteIn.for_each(f);
- return f.result;
-}
-
-struct MarkCompleted
-{
- const SequenceNumber& id;
- SequenceSet& completedIn;
-
- MarkCompleted(const SequenceNumber& _id, SequenceSet& set) : id(_id), completedIn(set) {}
-
- void operator()(const SequenceNumber& start, const SequenceNumber& end)
- {
- if (id >= end) {
- completedIn.add(start, end);
- } else if (id >= start) {
- completedIn.add(start, id);
- }
- }
-
-};
-
-void SessionImpl::markCompleted(const SequenceSet& ids, bool notifyPeer)
-{
- Lock l(state);
- incompleteIn.remove(ids);
- completedIn.add(ids);
- if (notifyPeer) {
- sendCompletion();
- }
-}
-
-void SessionImpl::markCompleted(const SequenceNumber& id, bool cumulative, bool notifyPeer)
-{
- Lock l(state);
- if (cumulative) {
- //everything in incompleteIn less than or equal to id is now complete
- MarkCompleted f(id, completedIn);
- incompleteIn.for_each(f);
- //make sure id itself is in
- completedIn.add(id);
- //then remove anything thats completed from the incomplete set
- incompleteIn.remove(completedIn);
- } else if (incompleteIn.contains(id)) {
- incompleteIn.remove(id);
- completedIn.add(id);
- }
- if (notifyPeer) {
- sendCompletion();
- }
-}
-
-void SessionImpl::setException(const sys::ExceptionHolder& ex) {
- Lock l(state);
- setExceptionLH(ex);
-}
-
-void SessionImpl::setExceptionLH(const sys::ExceptionHolder& ex) { // Call with lock held.
- exceptionHolder = ex;
- setState(DETACHED);
-}
-
-/**
- * Called by ConnectionImpl to notify active sessions when connection
- * is explictly closed
- */
-void SessionImpl::connectionClosed(uint16_t code, const std::string& text) {
- setException(createConnectionException(code, text));
- handleClosed();
-}
-
-/**
- * Called by ConnectionImpl to notify active sessions when connection
- * is disconnected
- */
-void SessionImpl::connectionBroke(const std::string& _text) {
- setException(sys::ExceptionHolder(new TransportFailure(_text)));
- handleClosed();
-}
-
-Future SessionImpl::send(const AMQBody& command)
-{
- return sendCommand(command);
-}
-
-Future SessionImpl::send(const AMQBody& command, const MethodContent& content)
-{
- return sendCommand(command, &content);
-}
-
-namespace {
-// Functor for FrameSet::map to send header + content frames but, not method frames.
-struct SendContentFn {
- FrameHandler& handler;
- void operator()(const AMQFrame& f) {
- if (!f.getMethod())
- handler(const_cast<AMQFrame&>(f));
- }
- SendContentFn(FrameHandler& h) : handler(h) {}
-};
-}
-
-Future SessionImpl::send(const AMQBody& command, const FrameSet& content) {
- Acquire a(sendLock);
- SequenceNumber id = nextOut++;
- {
- Lock l(state);
- checkOpen();
- incompleteOut.add(id);
- }
- Future f(id);
- if (command.getMethod()->resultExpected()) {
- Lock l(state);
- //result listener must be set before the command is sent
- f.setFutureResult(results.listenForResult(id));
- }
- AMQFrame frame(command);
- frame.setEof(false);
- handleOut(frame);
-
- SendContentFn send(out);
- content.map(send);
- return f;
-}
-
-Future SessionImpl::sendCommand(const AMQBody& command, const MethodContent* content)
-{
- Acquire a(sendLock);
- SequenceNumber id = nextOut++;
- {
- Lock l(state);
- checkOpen();
- incompleteOut.add(id);
- }
- Future f(id);
- if (command.getMethod()->resultExpected()) {
- Lock l(state);
- //result listener must be set before the command is sent
- f.setFutureResult(results.listenForResult(id));
- }
- AMQFrame frame(command);
- if (content) {
- frame.setEof(false);
- }
- handleOut(frame);
- if (content) {
- sendContent(*content);
- }
- return f;
-}
-
-void SessionImpl::sendContent(const MethodContent& content)
-{
- AMQFrame header(content.getHeader());
-
- // Client is not allowed to set the delivery-properties.exchange.
- AMQHeaderBody* headerp = static_cast<AMQHeaderBody*>(header.getBody());
- if (headerp && headerp->get<DeliveryProperties>())
- headerp->get<DeliveryProperties>(true)->clearExchangeFlag();
-
- header.setFirstSegment(false);
- uint64_t data_length = content.getData().length();
- if(data_length > 0){
- header.setLastSegment(false);
- handleOut(header);
- /*Note: end of frame marker included in overhead but not in size*/
- const uint32_t frag_size = maxFrameSize - AMQFrame::frameOverhead();
-
- if(data_length < frag_size){
- AMQFrame frame(in_place<AMQContentBody>(content.getData()));
- frame.setFirstSegment(false);
- handleOut(frame);
- }else{
- uint32_t offset = 0;
- uint32_t remaining = data_length - offset;
- while (remaining > 0) {
- uint32_t length = remaining > frag_size ? frag_size : remaining;
- string frag(content.getData().substr(offset, length));
- AMQFrame frame(in_place<AMQContentBody>(frag));
- frame.setFirstSegment(false);
- frame.setLastSegment(true);
- if (offset > 0) {
- frame.setFirstFrame(false);
- }
- offset += length;
- remaining = data_length - offset;
- if (remaining) {
- frame.setLastFrame(false);
- }
- handleOut(frame);
- }
- }
- } else {
- handleOut(header);
- }
-}
-
-
-bool isMessageMethod(AMQMethodBody* method)
-{
- return method->isA<MessageTransferBody>();
-}
-
-bool isMessageMethod(AMQBody* body)
-{
- AMQMethodBody* method=body->getMethod();
- return method && isMessageMethod(method);
-}
-
-bool isContentFrame(AMQFrame& frame)
-{
- AMQBody* body = frame.getBody();
- uint8_t type = body->type();
- return type == HEADER_BODY || type == CONTENT_BODY || isMessageMethod(body);
-}
-
-void SessionImpl::handleIn(AMQFrame& frame) // network thread
-{
- try {
- if (!invoke(static_cast<SessionHandler&>(*this), *frame.getBody())) {
- if (invoke(static_cast<ExecutionHandler&>(*this), *frame.getBody())) {
- //make sure the command id sequence and completion
- //tracking takes account of execution commands
- Lock l(state);
- completedIn.add(nextIn++);
- } else {
- //if not handled by this class, its for the application:
- deliver(frame);
- }
- }
- }
- catch (const SessionException& e) {
- setException(createSessionException(e.code, e.getMessage()));
- }
- catch (const ChannelException& e) {
- setException(createChannelException(e.code, e.getMessage()));
- }
-}
-
-void SessionImpl::handleOut(AMQFrame& frame) // user thread
-{
- sendFrame(frame, true);
-}
-
-void SessionImpl::proxyOut(AMQFrame& frame) // network thread
-{
- //Note: this case is treated slightly differently that command
- //frames sent by application; session controls should not be
- //blocked by bounds checking on the outgoing frame queue.
- sendFrame(frame, false);
-}
-
-void SessionImpl::sendFrame(AMQFrame& frame, bool canBlock)
-{
- boost::shared_ptr<ConnectionImpl> c = connectionWeak.lock();
- if (c) {
- channel.handle(frame);
- c->expand(frame.encodedSize(), canBlock);
- }
-}
-
-void SessionImpl::deliver(AMQFrame& frame) // network thread
-{
- if (!arriving) {
- arriving = FrameSet::shared_ptr(new FrameSet(nextIn++));
- }
- arriving->append(frame);
- if (arriving->isComplete()) {
- //message.transfers will be marked completed only when 'acked'
- //as completion affects flow control; other commands will be
- //considered completed as soon as processed here
- if (arriving->isA<MessageTransferBody>()) {
- Lock l(state);
- incompleteIn.add(arriving->getId());
- } else {
- Lock l(state);
- completedIn.add(arriving->getId());
- }
- demux.handle(arriving);
- arriving.reset();
- }
-}
-
-//control handler methods (called by network thread when controls are
-//received from peer):
-
-void SessionImpl::attach(const std::string& /*name*/, bool /*force*/)
-{
- throw NotImplementedException("Client does not support attach");
-}
-
-void SessionImpl::attached(const std::string& _name)
-{
- Lock l(state);
- if (id.getName() != _name) throw InternalErrorException("Incorrect session name");
- setState(ATTACHED);
-}
-
-void SessionImpl::detach(const std::string& _name)
-{
- Lock l(state);
- if (id.getName() != _name) throw InternalErrorException("Incorrect session name");
- setState(DETACHED);
- QPID_LOG(info, "Session detached by peer: " << id);
-}
-
-void SessionImpl::detached(const std::string& _name, uint8_t _code) {
- Lock l(state);
- if (id.getName() != _name) throw InternalErrorException("Incorrect session name");
- setState(DETACHED);
- if (_code) {
- //TODO: make sure this works with execution.exception - don't
- //want to overwrite the code from that
- setExceptionLH(createChannelException(_code, "Session detached by peer"));
- QPID_LOG(error, exceptionHolder.what());
- }
- if (detachedLifetime == 0) {
- handleClosed();
-}
-}
-
-void SessionImpl::requestTimeout(uint32_t t)
-{
- Lock l(state);
- detachedLifetime = t;
- proxy.timeout(t);
-}
-
-void SessionImpl::timeout(uint32_t t)
-{
- Lock l(state);
- detachedLifetime = t;
-}
-
-void SessionImpl::commandPoint(const framing::SequenceNumber& id, uint64_t offset)
-{
- if (offset) throw NotImplementedException("Non-zero byte offset not yet supported for command-point");
-
- Lock l(state);
- nextIn = id;
-}
-
-void SessionImpl::expected(const framing::SequenceSet& commands, const framing::Array& fragments)
-{
- if (!commands.empty() || fragments.encodedSize()) {
- throw NotImplementedException("Session resumption not yet supported");
- }
-}
-
-void SessionImpl::confirmed(const framing::SequenceSet& /*commands*/, const framing::Array& /*fragments*/)
-{
- //don't really care too much about this yet
-}
-
-void SessionImpl::completed(const framing::SequenceSet& commands, bool timelyReply)
-{
- Lock l(state);
- incompleteOut.remove(commands);
- state.notifyAll();//notify any waiters of completion
- completedOut.add(commands);
- //notify any waiting results of completion
- results.completed(commands);
-
- if (timelyReply) {
- proxy.knownCompleted(completedOut);
- completedOut.clear();
- }
-}
-
-void SessionImpl::knownCompleted(const framing::SequenceSet& commands)
-{
- Lock l(state);
- completedIn.remove(commands);
-}
-
-void SessionImpl::flush(bool expected, bool confirmed, bool completed)
-{
- Lock l(state);
- if (expected) {
- proxy.expected(SequenceSet(nextIn), Array());
- }
- if (confirmed) {
- proxy.confirmed(completedIn, Array());
- }
- if (completed) {
- proxy.completed(completedIn, true);
- }
-}
-
-void SessionImpl::sendCompletion()
-{
- Lock l(state);
- sendCompletionImpl();
-}
-
-void SessionImpl::sendFlush()
-{
- Lock l(state);
- proxy.flush(false, false, true);
-}
-
-void SessionImpl::sendCompletionImpl()
-{
- proxy.completed(completedIn, completedIn.span() > 1000);
-}
-
-void SessionImpl::gap(const framing::SequenceSet& /*commands*/)
-{
- throw NotImplementedException("gap not yet supported");
-}
-
-void SessionImpl::sync() {}
-
-void SessionImpl::result(const framing::SequenceNumber& commandId, const std::string& value)
-{
- Lock l(state);
- results.received(commandId, value);
-}
-
-void SessionImpl::exception(uint16_t errorCode,
- const framing::SequenceNumber& commandId,
- uint8_t classCode,
- uint8_t commandCode,
- uint8_t /*fieldIndex*/,
- const std::string& description,
- const framing::FieldTable& /*errorInfo*/)
-{
- Lock l(state);
- setExceptionLH(createSessionException(errorCode, description));
- QPID_LOG(warning, "Exception received from broker: " << exceptionHolder.what()
- << " [caused by " << commandId << " " << classCode << ":" << commandCode << "]");
-
- if (detachedLifetime)
- setTimeout(0);
-}
-
-
-//private utility methods:
-
-inline void SessionImpl::setState(State s) //call with lock held
-{
- state = s;
-}
-
-inline void SessionImpl::waitFor(State s) //call with lock held
-{
- // We can be DETACHED at any time
- if (s == DETACHED) state.waitFor(DETACHED);
- else state.waitFor(States(s, DETACHED));
- check();
-}
-
-void SessionImpl::check() const //call with lock held.
-{
- exceptionHolder.raise();
-}
-
-void SessionImpl::checkOpen() const //call with lock held.
-{
- check();
- if (state != ATTACHED) {
- throw NotAttachedException(QPID_MSG("Session " << getId() << " isn't attached"));
- }
-}
-
-void SessionImpl::assertOpen() const
-{
- Lock l(state);
- checkOpen();
-}
-
-void SessionImpl::handleClosed()
-{
- demux.close(exceptionHolder.empty() ? new ClosedException() : exceptionHolder);
- results.close();
-}
-
-uint32_t SessionImpl::setTimeout(uint32_t seconds) {
- proxy.requestTimeout(seconds);
- // FIXME aconway 2008-10-07: wait for timeout response from broker
- // and use value retured by broker.
- detachedLifetime = seconds;
- return detachedLifetime;
-}
-
-uint32_t SessionImpl::getTimeout() const {
- return detachedLifetime;
-}
-
-void SessionImpl::setWeakPtr(bool weak) {
- weakPtr = weak;
- if (weakPtr)
- connectionShared.reset(); // Only keep weak pointer
- else
- connectionShared = connectionWeak.lock();
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/SessionImpl.h b/M4-RCs/qpid/cpp/src/qpid/client/SessionImpl.h
deleted file mode 100644
index ea7776634a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/SessionImpl.h
+++ /dev/null
@@ -1,219 +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.
- *
- */
-
-#ifndef _SessionImpl_
-#define _SessionImpl_
-
-#include "Demux.h"
-#include "Execution.h"
-#include "Results.h"
-
-#include "qpid/SessionId.h"
-#include "qpid/SessionState.h"
-#include "boost/shared_ptr.hpp"
-#include "boost/weak_ptr.hpp"
-#include "qpid/framing/FrameHandler.h"
-#include "qpid/framing/ChannelHandler.h"
-#include "qpid/framing/SequenceNumber.h"
-#include "qpid/framing/AMQP_ClientOperations.h"
-#include "qpid/framing/AMQP_ServerProxy.h"
-#include "qpid/sys/Semaphore.h"
-#include "qpid/sys/StateMonitor.h"
-#include "qpid/sys/ExceptionHolder.h"
-
-#include <boost/optional.hpp>
-
-namespace qpid {
-
-namespace framing {
-
-class FrameSet;
-class MethodContent;
-class SequenceSet;
-
-}
-
-namespace client {
-
-class Future;
-class ConnectionImpl;
-class SessionHandler;
-
-///@internal
-class SessionImpl : public framing::FrameHandler::InOutHandler,
- public Execution,
- private framing::AMQP_ClientOperations::SessionHandler,
- private framing::AMQP_ClientOperations::ExecutionHandler
-{
-public:
- SessionImpl(const std::string& name, shared_ptr<ConnectionImpl>);
- ~SessionImpl();
-
-
- //NOTE: Public functions called in user thread.
- framing::FrameSet::shared_ptr get();
-
- const SessionId getId() const;
-
- uint16_t getChannel() const;
- void setChannel(uint16_t channel);
-
- void open(uint32_t detachedLifetime);
- void close();
- void resume(shared_ptr<ConnectionImpl>);
- void suspend();
-
- void assertOpen() const;
-
- Future send(const framing::AMQBody& command);
- Future send(const framing::AMQBody& command, const framing::MethodContent& content);
- Future send(const framing::AMQBody& command, const framing::FrameSet& content);
-
- Demux& getDemux();
- void markCompleted(const framing::SequenceNumber& id, bool cumulative, bool notifyPeer);
- void markCompleted(const framing::SequenceSet& ids, bool notifyPeer);
- bool isComplete(const framing::SequenceNumber& id);
- bool isCompleteUpTo(const framing::SequenceNumber& id);
- void waitForCompletion(const framing::SequenceNumber& id);
- void sendCompletion();
- void sendFlush();
-
- void setException(const sys::ExceptionHolder&);
-
- //NOTE: these are called by the network thread when the connection is closed or dies
- void connectionClosed(uint16_t code, const std::string& text);
- void connectionBroke(const std::string& text);
-
- /** Set timeout in seconds, returns actual timeout allowed by broker */
- uint32_t setTimeout(uint32_t requestedSeconds);
-
- /** Get timeout in seconds. */
- uint32_t getTimeout() const;
-
- /** Make this session use a weak_ptr to the ConnectionImpl.
- * Used for sessions created by the ConnectionImpl itself.
- */
- void setWeakPtr(bool weak=true);
-
-private:
- enum State {
- INACTIVE,
- ATTACHING,
- ATTACHED,
- DETACHING,
- DETACHED
- };
- typedef framing::AMQP_ClientOperations::SessionHandler SessionHandler;
- typedef framing::AMQP_ClientOperations::ExecutionHandler ExecutionHandler;
- typedef sys::StateMonitor<State, DETACHED> StateMonitor;
- typedef StateMonitor::Set States;
-
- inline void setState(State s);
- inline void waitFor(State);
-
- void setExceptionLH(const sys::ExceptionHolder&); // LH = lock held when called.
- void detach();
-
- void check() const;
- void checkOpen() const;
- void handleClosed();
-
- void handleIn(framing::AMQFrame& frame);
- void handleOut(framing::AMQFrame& frame);
- /**
- * Sends session controls. This case is treated slightly
- * differently than command frames sent by the application via
- * handleOut(); session controlsare not subject to bounds checking
- * on the outgoing frame queue.
- */
- void proxyOut(framing::AMQFrame& frame);
- void sendFrame(framing::AMQFrame& frame, bool canBlock);
- void deliver(framing::AMQFrame& frame);
-
- Future sendCommand(const framing::AMQBody&, const framing::MethodContent* = 0);
- void sendContent(const framing::MethodContent&);
- void waitForCompletionImpl(const framing::SequenceNumber& id);
-
- void sendCompletionImpl();
-
- // Note: Following methods are called by network thread in
- // response to session controls from the broker
- void attach(const std::string& name, bool force);
- void attached(const std::string& name);
- void detach(const std::string& name);
- void detached(const std::string& name, uint8_t detachCode);
- void requestTimeout(uint32_t timeout);
- void timeout(uint32_t timeout);
- void commandPoint(const framing::SequenceNumber& commandId, uint64_t commandOffset);
- void expected(const framing::SequenceSet& commands, const framing::Array& fragments);
- void confirmed(const framing::SequenceSet& commands, const framing::Array& fragments);
- void completed(const framing::SequenceSet& commands, bool timelyReply);
- void knownCompleted(const framing::SequenceSet& commands);
- void flush(bool expected, bool confirmed, bool completed);
- void gap(const framing::SequenceSet& commands);
-
- // Note: Following methods are called by network thread in
- // response to execution commands from the broker
- void sync();
- void result(const framing::SequenceNumber& commandId, const std::string& value);
- void exception(uint16_t errorCode,
- const framing::SequenceNumber& commandId,
- uint8_t classCode,
- uint8_t commandCode,
- uint8_t fieldIndex,
- const std::string& description,
- const framing::FieldTable& errorInfo);
-
- sys::ExceptionHolder exceptionHolder;
- mutable StateMonitor state;
- mutable sys::Semaphore sendLock;
- uint32_t detachedLifetime;
- const uint64_t maxFrameSize;
- const SessionId id;
-
- shared_ptr<ConnectionImpl> connection();
- shared_ptr<ConnectionImpl> connectionShared;
- boost::weak_ptr<ConnectionImpl> connectionWeak;
- bool weakPtr;
-
- framing::FrameHandler::MemFunRef<SessionImpl, &SessionImpl::proxyOut> ioHandler;
- framing::ChannelHandler channel;
- framing::AMQP_ServerProxy::Session proxy;
-
- Results results;
- Demux demux;
- framing::FrameSet::shared_ptr arriving;
-
- framing::SequenceSet incompleteIn;//incoming commands that are as yet incomplete
- framing::SequenceSet completedIn;//incoming commands that are have completed
- framing::SequenceSet incompleteOut;//outgoing commands not yet known to be complete
- framing::SequenceSet completedOut;//outgoing commands that we know to be completed
- framing::SequenceNumber nextIn;
- framing::SequenceNumber nextOut;
-
- SessionState sessionState;
-
- friend class client::SessionHandler;
-};
-
-}} // namespace qpid::client
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/SslConnector.cpp b/M4-RCs/qpid/cpp/src/qpid/client/SslConnector.cpp
deleted file mode 100644
index 6dbdbd003e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/SslConnector.cpp
+++ /dev/null
@@ -1,399 +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 "Connector.h"
-
-#include "Bounds.h"
-#include "ConnectionImpl.h"
-#include "ConnectionSettings.h"
-#include "qpid/Options.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/Time.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/sys/ssl/util.h"
-#include "qpid/sys/ssl/SslIo.h"
-#include "qpid/sys/ssl/SslSocket.h"
-#include "qpid/sys/Dispatcher.h"
-#include "qpid/sys/Poller.h"
-#include "qpid/Msg.h"
-
-#include <iostream>
-#include <map>
-#include <boost/bind.hpp>
-#include <boost/format.hpp>
-
-namespace qpid {
-namespace client {
-
-using namespace qpid::sys;
-using namespace qpid::sys::ssl;
-using namespace qpid::framing;
-using boost::format;
-using boost::str;
-
-
-class SslConnector : public Connector, private sys::Runnable
-{
- struct Buff;
-
- /** Batch up frames for writing to aio. */
- class Writer : public framing::FrameHandler {
- typedef sys::ssl::SslIOBufferBase BufferBase;
- typedef std::vector<framing::AMQFrame> Frames;
-
- const uint16_t maxFrameSize;
- sys::Mutex lock;
- sys::ssl::SslIO* aio;
- BufferBase* buffer;
- Frames frames;
- size_t lastEof; // Position after last EOF in frames
- framing::Buffer encode;
- size_t framesEncoded;
- std::string identifier;
- Bounds* bounds;
-
- void writeOne();
- void newBuffer();
-
- public:
-
- Writer(uint16_t maxFrameSize, Bounds*);
- ~Writer();
- void init(std::string id, sys::ssl::SslIO*);
- void handle(framing::AMQFrame&);
- void write(sys::ssl::SslIO&);
- };
-
- const uint16_t maxFrameSize;
- framing::ProtocolVersion version;
- bool initiated;
-
- sys::Mutex closedLock;
- bool closed;
- bool joined;
-
- sys::ShutdownHandler* shutdownHandler;
- framing::InputHandler* input;
- framing::InitiationHandler* initialiser;
- framing::OutputHandler* output;
-
- Writer writer;
-
- sys::Thread receiver;
-
- sys::ssl::SslSocket socket;
-
- sys::ssl::SslIO* aio;
- boost::shared_ptr<sys::Poller> poller;
-
- ~SslConnector();
-
- void run();
- void handleClosed();
- bool closeInternal();
-
- void readbuff(qpid::sys::ssl::SslIO&, qpid::sys::ssl::SslIOBufferBase*);
- void writebuff(qpid::sys::ssl::SslIO&);
- void writeDataBlock(const framing::AMQDataBlock& data);
- void eof(qpid::sys::ssl::SslIO&);
-
- std::string identifier;
-
- ConnectionImpl* impl;
-
- void connect(const std::string& host, int port);
- void init();
- void close();
- void send(framing::AMQFrame& frame);
-
- void setInputHandler(framing::InputHandler* handler);
- void setShutdownHandler(sys::ShutdownHandler* handler);
- sys::ShutdownHandler* getShutdownHandler() const;
- framing::OutputHandler* getOutputHandler();
- const std::string& getIdentifier() const;
-
-public:
- SslConnector(framing::ProtocolVersion pVersion,
- const ConnectionSettings&,
- ConnectionImpl*);
-};
-
-// Static constructor which registers connector here
-namespace {
- Connector* create(framing::ProtocolVersion v, const ConnectionSettings& s, ConnectionImpl* c) {
- return new SslConnector(v, s, c);
- }
-
- struct StaticInit {
- StaticInit() {
- try {
- SslOptions options;
- options.parse (0, 0, CONF_FILE, true);
- if (options.certDbPath.empty()) {
- QPID_LOG(warning, "SSL connector not enabled, you must set QPID_SSL_CERT_DB to enable it.");
- } else {
- initNSS(options);
- Connector::registerFactory("ssl", &create);
- }
- } catch (const std::exception& e) {
- QPID_LOG(error, "Failed to initialise SSL connector: " << e.what());
- }
- };
-
- ~StaticInit() { shutdownNSS(); }
- } init;
-}
-
-SslConnector::SslConnector(ProtocolVersion ver,
- const ConnectionSettings& settings,
- ConnectionImpl* cimpl)
- : maxFrameSize(settings.maxFrameSize),
- version(ver),
- initiated(false),
- closed(true),
- joined(true),
- shutdownHandler(0),
- writer(maxFrameSize, cimpl),
- aio(0),
- impl(cimpl)
-{
- QPID_LOG(debug, "SslConnector created for " << version.toString());
- //TODO: how do we want to handle socket configuration with ssl?
- //settings.configureSocket(socket);
-}
-
-SslConnector::~SslConnector() {
- close();
-}
-
-void SslConnector::connect(const std::string& host, int port){
- Mutex::ScopedLock l(closedLock);
- assert(closed);
- try {
- socket.connect(host, port);
- } catch (const std::exception& e) {
- socket.close();
- throw;
- }
-
- identifier = str(format("[%1% %2%]") % socket.getLocalPort() % socket.getPeerAddress());
- closed = false;
- poller = Poller::shared_ptr(new Poller);
- aio = new SslIO(socket,
- boost::bind(&SslConnector::readbuff, this, _1, _2),
- boost::bind(&SslConnector::eof, this, _1),
- boost::bind(&SslConnector::eof, this, _1),
- 0, // closed
- 0, // nobuffs
- boost::bind(&SslConnector::writebuff, this, _1));
- writer.init(identifier, aio);
-}
-
-void SslConnector::init(){
- Mutex::ScopedLock l(closedLock);
- assert(joined);
- ProtocolInitiation init(version);
- writeDataBlock(init);
- joined = false;
- receiver = Thread(this);
-}
-
-bool SslConnector::closeInternal() {
- Mutex::ScopedLock l(closedLock);
- bool ret = !closed;
- if (!closed) {
- closed = true;
- poller->shutdown();
- }
- if (!joined && receiver.id() != Thread::current().id()) {
- joined = true;
- Mutex::ScopedUnlock u(closedLock);
- receiver.join();
- }
- return ret;
-}
-
-void SslConnector::close() {
- closeInternal();
-}
-
-void SslConnector::setInputHandler(InputHandler* handler){
- input = handler;
-}
-
-void SslConnector::setShutdownHandler(ShutdownHandler* handler){
- shutdownHandler = handler;
-}
-
-OutputHandler* SslConnector::getOutputHandler() {
- return this;
-}
-
-sys::ShutdownHandler* SslConnector::getShutdownHandler() const {
- return shutdownHandler;
-}
-
-const std::string& SslConnector::getIdentifier() const {
- return identifier;
-}
-
-void SslConnector::send(AMQFrame& frame) {
- writer.handle(frame);
-}
-
-void SslConnector::handleClosed() {
- if (closeInternal() && shutdownHandler)
- shutdownHandler->shutdown();
-}
-
-struct SslConnector::Buff : public SslIO::BufferBase {
- Buff(size_t size) : SslIO::BufferBase(new char[size], size) {}
- ~Buff() { delete [] bytes;}
-};
-
-SslConnector::Writer::Writer(uint16_t s, Bounds* b) : maxFrameSize(s), aio(0), buffer(0), lastEof(0), bounds(b)
-{
-}
-
-SslConnector::Writer::~Writer() { delete buffer; }
-
-void SslConnector::Writer::init(std::string id, sys::ssl::SslIO* a) {
- Mutex::ScopedLock l(lock);
- identifier = id;
- aio = a;
- newBuffer();
-}
-void SslConnector::Writer::handle(framing::AMQFrame& frame) {
- Mutex::ScopedLock l(lock);
- frames.push_back(frame);
- if (frame.getEof() || (bounds && bounds->getCurrentSize() >= maxFrameSize)) {
- lastEof = frames.size();
- aio->notifyPendingWrite();
- }
- QPID_LOG(trace, "SENT " << identifier << ": " << frame);
-}
-
-void SslConnector::Writer::writeOne() {
- assert(buffer);
- framesEncoded = 0;
-
- buffer->dataStart = 0;
- buffer->dataCount = encode.getPosition();
- aio->queueWrite(buffer);
- newBuffer();
-}
-
-void SslConnector::Writer::newBuffer() {
- buffer = aio->getQueuedBuffer();
- if (!buffer) buffer = new Buff(maxFrameSize);
- encode = framing::Buffer(buffer->bytes, buffer->byteCount);
- framesEncoded = 0;
-}
-
-// Called in IO thread.
-void SslConnector::Writer::write(sys::ssl::SslIO&) {
- Mutex::ScopedLock l(lock);
- assert(buffer);
- size_t bytesWritten(0);
- for (size_t i = 0; i < lastEof; ++i) {
- AMQFrame& frame = frames[i];
- uint32_t size = frame.encodedSize();
- if (size > encode.available()) writeOne();
- assert(size <= encode.available());
- frame.encode(encode);
- ++framesEncoded;
- bytesWritten += size;
- }
- frames.erase(frames.begin(), frames.begin()+lastEof);
- lastEof = 0;
- if (bounds) bounds->reduce(bytesWritten);
- if (encode.getPosition() > 0) writeOne();
-}
-
-void SslConnector::readbuff(SslIO& aio, SslIO::BufferBase* buff) {
- framing::Buffer in(buff->bytes+buff->dataStart, buff->dataCount);
-
- if (!initiated) {
- framing::ProtocolInitiation protocolInit;
- if (protocolInit.decode(in)) {
- //TODO: check the version is correct
- QPID_LOG(debug, "RECV " << identifier << " INIT(" << protocolInit << ")");
- }
- initiated = true;
- }
- AMQFrame frame;
- while(frame.decode(in)){
- QPID_LOG(trace, "RECV " << identifier << ": " << frame);
- input->received(frame);
- }
- // TODO: unreading needs to go away, and when we can cope
- // with multiple sub-buffers in the general buffer scheme, it will
- if (in.available() != 0) {
- // Adjust buffer for used bytes and then "unread them"
- buff->dataStart += buff->dataCount-in.available();
- buff->dataCount = in.available();
- aio.unread(buff);
- } else {
- // Give whole buffer back to aio subsystem
- aio.queueReadBuffer(buff);
- }
-}
-
-void SslConnector::writebuff(SslIO& aio_) {
- writer.write(aio_);
-}
-
-void SslConnector::writeDataBlock(const AMQDataBlock& data) {
- SslIO::BufferBase* buff = new Buff(maxFrameSize);
- framing::Buffer out(buff->bytes, buff->byteCount);
- data.encode(out);
- buff->dataCount = data.encodedSize();
- aio->queueWrite(buff);
-}
-
-void SslConnector::eof(SslIO&) {
- handleClosed();
-}
-
-// TODO: astitcher 20070908 This version of the code can never time out, so the idle processing
-// will never be called
-void SslConnector::run(){
- // Keep the connection impl in memory until run() completes.
- boost::shared_ptr<ConnectionImpl> protect = impl->shared_from_this();
- assert(protect);
- try {
- Dispatcher d(poller);
-
- for (int i = 0; i < 32; i++) {
- aio->queueReadBuffer(new Buff(maxFrameSize));
- }
-
- aio->start(poller);
- d.run();
- aio->queueForDeletion();
- socket.close();
- } catch (const std::exception& e) {
- QPID_LOG(error, e.what());
- handleClosed();
- }
-}
-
-
-}} // namespace qpid::client
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/StateManager.cpp b/M4-RCs/qpid/cpp/src/qpid/client/StateManager.cpp
deleted file mode 100644
index 0cb3c6b9d4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/StateManager.cpp
+++ /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.
- *
- */
-
-#include "StateManager.h"
-#include "qpid/framing/amqp_framing.h"
-
-using namespace qpid::client;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-StateManager::StateManager(int s) : state(s) {}
-
-void StateManager::waitForStateChange(int current)
-{
- Monitor::ScopedLock l(stateLock);
- while (state == current) {
- stateLock.wait();
- }
-}
-
-void StateManager::waitFor(int desired)
-{
- Monitor::ScopedLock l(stateLock);
- while (state != desired) {
- stateLock.wait();
- }
-}
-
-void StateManager::waitFor(std::set<int> desired)
-{
- Monitor::ScopedLock l(stateLock);
- while (desired.find(state) == desired.end()) {
- stateLock.wait();
- }
-}
-
-
-void StateManager::setState(int s)
-{
- Monitor::ScopedLock l(stateLock);
- state = s;
- stateLock.notifyAll();
-}
-
-int StateManager::getState() const
-{
- Monitor::ScopedLock l(stateLock);
- return state;
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/StateManager.h b/M4-RCs/qpid/cpp/src/qpid/client/StateManager.h
deleted file mode 100644
index b01664a0c1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/StateManager.h
+++ /dev/null
@@ -1,47 +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.
- *
- */
-#ifndef _StateManager_
-#define _StateManager_
-
-#include <set>
-#include "qpid/sys/Monitor.h"
-
-namespace qpid {
-namespace client {
-
-///@internal
-class StateManager
-{
- int state;
- mutable sys::Monitor stateLock;
-
-public:
- StateManager(int initial);
- void setState(int state);
- int getState() const ;
- void waitForStateChange(int current);
- void waitFor(std::set<int> states);
- void waitFor(int state);
-};
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Subscription.cpp b/M4-RCs/qpid/cpp/src/qpid/client/Subscription.cpp
deleted file mode 100644
index 1f1b5ac6c6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Subscription.cpp
+++ /dev/null
@@ -1,50 +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 "Subscription.h"
-#include "SubscriptionImpl.h"
-#include "HandlePrivate.h"
-#include "qpid/framing/enum.h"
-
-namespace qpid {
-namespace client {
-
-template class Handle<SubscriptionImpl>;
-
-
-std::string Subscription::getName() const { return impl->getName(); }
-std::string Subscription::getQueue() const { return impl->getQueue(); }
-const SubscriptionSettings& Subscription::getSettings() const { return impl->getSettings(); }
-void Subscription::setFlowControl(const FlowControl& f) { impl->setFlowControl(f); }
-void Subscription::setAutoAck(unsigned int n) { impl->setAutoAck(n); }
-SequenceSet Subscription::getUnacquired() const { return impl->getUnacquired(); }
-SequenceSet Subscription::getUnaccepted() const { return impl->getUnaccepted(); }
-void Subscription::acquire(const SequenceSet& messageIds) { impl->acquire(messageIds); }
-void Subscription::accept(const SequenceSet& messageIds) { impl->accept(messageIds); }
-void Subscription::release(const SequenceSet& messageIds) { impl->release(messageIds); }
-Session Subscription::getSession() const { return impl->getSession(); }
-SubscriptionManager&Subscription:: getSubscriptionManager() const { return impl->getSubscriptionManager(); }
-void Subscription::cancel() { impl->cancel(); }
-void Subscription::grantMessageCredit(uint32_t value) { impl->grantCredit(framing::message::CREDIT_UNIT_MESSAGE, value); }
-void Subscription::grantByteCredit(uint32_t value) { impl->grantCredit(framing::message::CREDIT_UNIT_BYTE, value); }
-}} // namespace qpid::client
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/Subscription.h b/M4-RCs/qpid/cpp/src/qpid/client/Subscription.h
deleted file mode 100644
index 6d9342bf09..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/Subscription.h
+++ /dev/null
@@ -1,113 +0,0 @@
-#ifndef QPID_CLIENT_SUBSCRIPTION_H
-#define QPID_CLIENT_SUBSCRIPTION_H
-
-/*
- *
- * 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 "qpid/client/Session.h"
-#include "qpid/client/SubscriptionSettings.h"
-#include "qpid/client/Handle.h"
-#include "qpid/client/Message.h"
-
-namespace qpid {
-namespace client {
-
-class SubscriptionImpl;
-class SubscriptionManager;
-
-/**
- * A handle to an active subscription. Provides methods to query the subscription status
- * and control acknowledgement (acquire and accept) of messages.
- */
-class Subscription : public Handle<SubscriptionImpl> {
- public:
- Subscription(SubscriptionImpl* si=0) : Handle<SubscriptionImpl>(si) {}
-
- /** The name of the subsctription, used as the "destination" for messages from the broker.
- * Usually the same as the queue name but can be set differently.
- */
- std::string getName() const;
-
- /** Name of the queue this subscription subscribes to */
- std::string getQueue() const;
-
- /** Get the flow control and acknowledgement settings for this subscription */
- const SubscriptionSettings& getSettings() const;
-
- /** Set the flow control parameters */
- void setFlowControl(const FlowControl&);
-
- /** Automatically acknowledge (acquire and accept) batches of n messages.
- * You can disable auto-acknowledgement by setting n=0, and use acquire() and accept()
- * to manually acquire and accept messages.
- */
- void setAutoAck(unsigned int n);
-
- /** Get the set of ID's for messages received by this subscription but not yet acquired.
- * This will always be empty if getSettings().acquireMode=ACQUIRE_MODE_PRE_ACQUIRED
- */
- SequenceSet getUnacquired() const;
-
- /** Get the set of ID's for messages received by this subscription but not yet accepted. */
- SequenceSet getUnaccepted() const;
-
- /** Acquire messageIds and remove them from the unacquired set.
- * oAdd them to the unaccepted set if getSettings().acceptMode == ACCEPT_MODE_EXPLICIT.
- */
- void acquire(const SequenceSet& messageIds);
-
- /** Accept messageIds and remove them from the unaccepted set.
- *@pre messageIds is a subset of getUnaccepted()
- */
- void accept(const SequenceSet& messageIds);
-
- /** Release messageIds and remove them from the unaccepted set.
- *@pre messageIds is a subset of getUnaccepted()
- */
- void release(const SequenceSet& messageIds);
-
- /* Acquire a single message */
- void acquire(const Message& m) { acquire(SequenceSet(m.getId())); }
-
- /* Accept a single message */
- void accept(const Message& m) { accept(SequenceSet(m.getId())); }
-
- /* Release a single message */
- void release(const Message& m) { release(SequenceSet(m.getId())); }
-
- /** Get the session associated with this subscription */
- Session getSession() const;
-
- /** Get the subscription manager associated with this subscription */
- SubscriptionManager& getSubscriptionManager() const;
-
- /** Cancel the subscription. */
- void cancel();
-
- /** Grant the specified amount of message credit */
- void grantMessageCredit(uint32_t);
-
- /** Grant the specified amount of byte credit */
- void grantByteCredit(uint32_t);
-};
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_SUBSCRIPTION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionImpl.cpp b/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionImpl.cpp
deleted file mode 100644
index 5ea87110c2..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionImpl.cpp
+++ /dev/null
@@ -1,149 +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 "SubscriptionImpl.h"
-#include "SubscriptionManager.h"
-#include "SubscriptionSettings.h"
-
-namespace qpid {
-namespace client {
-
-using sys::Mutex;
-using framing::MessageAcquireResult;
-
-SubscriptionImpl::SubscriptionImpl(SubscriptionManager& m, const std::string& q, const SubscriptionSettings& s, const std::string& n, MessageListener* l)
- : manager(m), name(n), queue(q), settings(s), listener(l)
-{}
-
-void SubscriptionImpl::subscribe()
-{
- async(manager.getSession()).messageSubscribe(
- arg::queue=queue,
- arg::destination=name,
- arg::acceptMode=settings.acceptMode,
- arg::acquireMode=settings.acquireMode,
- arg::exclusive=settings.exclusive);
- setFlowControl(settings.flowControl);
-}
-
-std::string SubscriptionImpl::getName() const { return name; }
-
-std::string SubscriptionImpl::getQueue() const { return queue; }
-
-const SubscriptionSettings& SubscriptionImpl::getSettings() const {
- Mutex::ScopedLock l(lock);
- return settings;
-}
-
-void SubscriptionImpl::setFlowControl(const FlowControl& f) {
- Mutex::ScopedLock l(lock);
- AsyncSession s=manager.getSession();
- if (&settings.flowControl != &f) settings.flowControl = f;
- s.messageSetFlowMode(name, f.window);
- s.messageFlow(name, CREDIT_UNIT_MESSAGE, f.messages);
- s.messageFlow(name, CREDIT_UNIT_BYTE, f.bytes);
- s.sync();
-}
-
-void SubscriptionImpl::grantCredit(framing::message::CreditUnit unit, uint32_t value) {
- async(manager.getSession()).messageFlow(name, unit, value);
-}
-
-void SubscriptionImpl::setAutoAck(size_t n) {
- Mutex::ScopedLock l(lock);
- settings.autoAck = n;
-}
-
-SequenceSet SubscriptionImpl::getUnacquired() const { Mutex::ScopedLock l(lock); return unacquired; }
-SequenceSet SubscriptionImpl::getUnaccepted() const { Mutex::ScopedLock l(lock); return unaccepted; }
-
-void SubscriptionImpl::acquire(const SequenceSet& messageIds) {
- Mutex::ScopedLock l(lock);
- MessageAcquireResult result = manager.getSession().messageAcquire(messageIds);
- unacquired.remove(result.getTransfers());
- if (settings.acceptMode == ACCEPT_MODE_EXPLICIT)
- unaccepted.add(result.getTransfers());
-}
-
-void SubscriptionImpl::accept(const SequenceSet& messageIds) {
- Mutex::ScopedLock l(lock);
- manager.getSession().messageAccept(messageIds);
- unaccepted.remove(messageIds);
- switch (settings.completionMode) {
- case COMPLETE_ON_ACCEPT:
- manager.getSession().markCompleted(messageIds, true);
- break;
- case COMPLETE_ON_DELIVERY:
- manager.getSession().sendCompletion();
- break;
- default://do nothing
- break;
- }
-}
-
-void SubscriptionImpl::release(const SequenceSet& messageIds) {
- Mutex::ScopedLock l(lock);
- manager.getSession().messageRelease(messageIds);
- if (settings.acceptMode == ACCEPT_MODE_EXPLICIT)
- unaccepted.remove(messageIds);
-}
-
-Session SubscriptionImpl::getSession() const { return manager.getSession(); }
-
-SubscriptionManager& SubscriptionImpl::getSubscriptionManager() const { return manager; }
-
-void SubscriptionImpl::cancel() { manager.cancel(name); }
-
-void SubscriptionImpl::received(Message& m) {
- Mutex::ScopedLock l(lock);
- if (m.getMethod().getAcquireMode() == ACQUIRE_MODE_NOT_ACQUIRED)
- unacquired.add(m.getId());
- else if (m.getMethod().getAcceptMode() == ACCEPT_MODE_EXPLICIT)
- unaccepted.add(m.getId());
-
- if (listener) {
- Mutex::ScopedUnlock u(lock);
- listener->received(m);
- }
-
- if (settings.completionMode == COMPLETE_ON_DELIVERY) {
- manager.getSession().markCompleted(m.getId(), false, false);
- }
- if (settings.autoAck) {
- if (unaccepted.size() >= settings.autoAck) {
- async(manager.getSession()).messageAccept(unaccepted);
- switch (settings.completionMode) {
- case COMPLETE_ON_ACCEPT:
- manager.getSession().markCompleted(unaccepted, true);
- break;
- case COMPLETE_ON_DELIVERY:
- manager.getSession().sendCompletion();
- break;
- default://do nothing
- break;
- }
- unaccepted.clear();
- }
- }
-}
-
-}} // namespace qpid::client
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionImpl.h b/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionImpl.h
deleted file mode 100644
index c4c486daeb..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionImpl.h
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef QPID_CLIENT_SUBSCRIPTIONIMPL_H
-#define QPID_CLIENT_SUBSCRIPTIONIMPL_H
-
-/*
- *
- * 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 "qpid/client/SubscriptionSettings.h"
-#include "qpid/client/Session.h"
-#include "qpid/client/MessageListener.h"
-#include "qpid/framing/enum.h"
-#include "qpid/framing/SequenceSet.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/RefCounted.h"
-
-namespace qpid {
-namespace client {
-
-class SubscriptionManager;
-
-class SubscriptionImpl : public RefCounted, public MessageListener {
- public:
- SubscriptionImpl(SubscriptionManager&, const std::string& queue,
- const SubscriptionSettings&, const std::string& name, MessageListener* =0);
-
- /** The name of the subsctription, used as the "destination" for messages from the broker.
- * Usually the same as the queue name but can be set differently.
- */
- std::string getName() const;
-
- /** Name of the queue this subscription subscribes to */
- std::string getQueue() const;
-
- /** Get the flow control and acknowledgement settings for this subscription */
- const SubscriptionSettings& getSettings() const;
-
- /** Set the flow control parameters */
- void setFlowControl(const FlowControl&);
-
- /** Automatically acknowledge (acquire and accept) batches of n messages.
- * You can disable auto-acknowledgement by setting n=0, and use acquire() and accept()
- * to manually acquire and accept messages.
- */
- void setAutoAck(size_t n);
-
- /** Get the set of ID's for messages received by this subscription but not yet acquired.
- * This will always be empty if acquireMode=ACQUIRE_MODE_PRE_ACQUIRED
- */
- SequenceSet getUnacquired() const;
-
- /** Get the set of ID's for messages acquired by this subscription but not yet accepted. */
- SequenceSet getUnaccepted() const;
-
- /** Acquire messageIds and remove them from the un-acquired set for the session. */
- void acquire(const SequenceSet& messageIds);
-
- /** Accept messageIds and remove them from the un-accepted set for the session. */
- void accept(const SequenceSet& messageIds);
-
- /** Release messageIds and remove them from the un-accepted set for the session. */
- void release(const SequenceSet& messageIds);
-
- /** Get the session associated with this subscription */
- Session getSession() const;
-
- /** Get the subscription manager associated with this subscription */
- SubscriptionManager& getSubscriptionManager() const;
-
- /** Send subscription request and issue appropriate flow control commands. */
- void subscribe();
-
- /** Cancel the subscription. */
- void cancel();
-
- /** Grant specified credit for this subscription **/
- void grantCredit(framing::message::CreditUnit unit, uint32_t value);
-
- void received(Message&);
-
- private:
-
- mutable sys::Mutex lock;
- SubscriptionManager& manager;
- std::string name, queue;
- SubscriptionSettings settings;
- framing::SequenceSet unacquired, unaccepted;
- MessageListener* listener;
-};
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_SUBSCRIPTIONIMPL_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionManager.cpp b/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionManager.cpp
deleted file mode 100644
index c91ae178ac..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionManager.cpp
+++ /dev/null
@@ -1,140 +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.
- *
- */
-#ifndef _Subscription_
-#define _Subscription_
-
-#include "SubscriptionManager.h"
-#include "SubscriptionImpl.h"
-#include <qpid/client/Dispatcher.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/MessageListener.h>
-#include <qpid/framing/Uuid.h>
-#include <set>
-#include <sstream>
-
-
-namespace qpid {
-namespace client {
-
-SubscriptionManager::SubscriptionManager(const Session& s)
- : dispatcher(s), session(s), autoStop(true)
-{}
-
-Subscription SubscriptionManager::subscribe(
- MessageListener& listener, const std::string& q, const SubscriptionSettings& ss, const std::string& n)
-{
- std::string name=n.empty() ? q:n;
- boost::intrusive_ptr<SubscriptionImpl> si = new SubscriptionImpl(*this, q, ss, name, &listener);
- dispatcher.listen(si);
- //issue subscription request after listener is registered with dispatcher
- si->subscribe();
- return subscriptions[name] = Subscription(si.get());
-}
-
-Subscription SubscriptionManager::subscribe(
- LocalQueue& lq, const std::string& q, const SubscriptionSettings& ss, const std::string& n)
-{
- std::string name=n.empty() ? q:n;
- lq.queue=session.getExecution().getDemux().add(name, ByTransferDest(name));
- boost::intrusive_ptr<SubscriptionImpl> si = new SubscriptionImpl(*this, q, ss, name, 0);
- si->subscribe();
- lq.subscription = Subscription(si.get());
- return subscriptions[name] = lq.subscription;
-}
-
-Subscription SubscriptionManager::subscribe(
- MessageListener& listener, const std::string& q, const std::string& n)
-{
- return subscribe(listener, q, defaultSettings, n);
-}
-
-Subscription SubscriptionManager::subscribe(
- LocalQueue& lq, const std::string& q, const std::string& n)
-{
- return subscribe(lq, q, defaultSettings, n);
-}
-
-void SubscriptionManager::cancel(const std::string& dest)
-{
- sync(session).messageCancel(dest);
- dispatcher.cancel(dest);
-}
-
-void SubscriptionManager::setAutoStop(bool set) { autoStop=set; }
-
-void SubscriptionManager::run()
-{
- dispatcher.setAutoStop(autoStop);
- dispatcher.run();
-}
-
-void SubscriptionManager::start()
-{
- dispatcher.setAutoStop(autoStop);
- dispatcher.start();
-}
-
-void SubscriptionManager::wait()
-{
- dispatcher.wait();
-}
-
-void SubscriptionManager::stop()
-{
- dispatcher.stop();
-}
-
-bool SubscriptionManager::get(Message& result, const std::string& queue, sys::Duration timeout) {
- LocalQueue lq;
- std::string unique = framing::Uuid(true).str();
- subscribe(lq, queue, SubscriptionSettings(FlowControl::messageCredit(1)), unique);
- AutoCancel ac(*this, unique);
- //first wait for message to be delivered if a timeout has been specified
- if (timeout && lq.get(result, timeout))
- return true;
- //make sure message is not on queue before final check
- sync(session).messageFlush(unique);
- return lq.get(result, 0);
-}
-
-Message SubscriptionManager::get(const std::string& queue, sys::Duration timeout) {
- Message result;
- if (!get(result, queue, timeout))
- throw Exception("Timed out waiting for a message");
- return result;
-}
-
-Session SubscriptionManager::getSession() const { return session; }
-
-Subscription SubscriptionManager::getSubscription(const std::string& name) const {
- std::map<std::string, Subscription>::const_iterator i = subscriptions.find(name);
- if (i == subscriptions.end())
- throw Exception(QPID_MSG("Subscription not found: " << name));
- return i->second;
-}
-
-void SubscriptionManager::registerFailoverHandler (boost::function<void ()> fh) {
- dispatcher.registerFailoverHandler(fh);
-}
-
-}} // namespace qpid::client
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionManager.h b/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionManager.h
deleted file mode 100644
index 1017480257..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionManager.h
+++ /dev/null
@@ -1,293 +0,0 @@
-#ifndef QPID_CLIENT_SUBSCRIPTIONMANAGER_H
-#define QPID_CLIENT_SUBSCRIPTIONMANAGER_H
-
-/*
- *
- * 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 "qpid/sys/Mutex.h"
-#include <qpid/client/Dispatcher.h>
-#include <qpid/client/Completion.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/AsyncSession.h>
-#include <qpid/client/MessageListener.h>
-#include <qpid/client/LocalQueue.h>
-#include <qpid/client/Subscription.h>
-#include <qpid/sys/Runnable.h>
-#include <set>
-#include <sstream>
-
-namespace qpid {
-namespace client {
-
-/**
- * A class to help create and manage subscriptions.
- *
- * Set up your subscriptions, then call run() to have messages
- * delivered.
- *
- * \ingroup clientapi
- *
- * \details
- *
- * <h2>Subscribing and canceling subscriptions</h2>
- *
- * <ul>
- * <li>
- * <p>subscribe()</p>
- * <pre> SubscriptionManager subscriptions(session);
- * Listener listener(subscriptions);
- * subscriptions.subscribe(listener, myQueue);</pre>
- * <pre> SubscriptionManager subscriptions(session);
- * LocalQueue local_queue;
- * subscriptions.subscribe(local_queue, string("message_queue"));</pre></li>
- * <li>
- * <p>cancel()</p>
- * <pre>subscriptions.cancel();</pre></li>
- * </ul>
- *
- * <h2>Waiting for messages (and returning)</h2>
- *
- * <ul>
- * <li>
- * <p>run()</p>
- * <pre> // Give up control to receive messages
- * subscriptions.run();</pre></li>
- * <li>
- * <p>stop()</p>
- * <pre>.// Use this code in a listener to return from run()
- * subscriptions.stop();</pre></li>
- * <li>
- * <p>setAutoStop()</p>
- * <pre>.// Return from subscriptions.run() when last subscription is cancelled
- *.subscriptions.setAutoStop(true);
- *.subscriptons.run();
- * </pre></li>
- * <li>
- * <p>Ending a subscription in a listener</p>
- * <pre>
- * void Listener::received(Message&amp; message) {
- *
- * if (message.getData() == "That's all, folks!") {
- * subscriptions.cancel(message.getDestination());
- * }
- * }
- * </pre>
- * </li>
- * </ul>
- *
- */
-class SubscriptionManager : public sys::Runnable
-{
- typedef sys::Mutex::ScopedLock Lock;
- typedef sys::Mutex::ScopedUnlock Unlock;
-
- qpid::client::Dispatcher dispatcher;
- qpid::client::AsyncSession session;
- bool autoStop;
- SubscriptionSettings defaultSettings;
-
- public:
- /** Create a new SubscriptionManager associated with a session */
- SubscriptionManager(const Session& session);
-
- /**
- * Subscribe a MessagesListener to receive messages from queue.
- *
- * Provide your own subclass of MessagesListener to process
- * incoming messages. It will be called for each message received.
- *
- *@param listener Listener object to receive messages.
- *@param queue Name of the queue to subscribe to.
- *@param settings settings for the subscription.
- *@param name unique destination name for the subscription, defaults to queue name.
- */
- Subscription subscribe(MessageListener& listener,
- const std::string& queue,
- const SubscriptionSettings& settings,
- const std::string& name=std::string());
-
- /**
- * Subscribe a LocalQueue to receive messages from queue.
- *
- * Incoming messages are stored in the queue for you to retrieve.
- *
- *@param queue Name of the queue to subscribe to.
- *@param flow initial FlowControl for the subscription.
- *@param name unique destination name for the subscription, defaults to queue name.
- * If not specified, the queue name is used.
- */
- Subscription subscribe(LocalQueue& localQueue,
- const std::string& queue,
- const SubscriptionSettings& settings,
- const std::string& name=std::string());
-
- /**
- * Subscribe a MessagesListener to receive messages from queue.
- *
- * Provide your own subclass of MessagesListener to process
- * incoming messages. It will be called for each message received.
- *
- *@param listener Listener object to receive messages.
- *@param queue Name of the queue to subscribe to.
- *@param name unique destination name for the subscription, defaults to queue name.
- * If not specified, the queue name is used.
- */
- Subscription subscribe(MessageListener& listener,
- const std::string& queue,
- const std::string& name=std::string());
-
- /**
- * Subscribe a LocalQueue to receive messages from queue.
- *
- * Incoming messages are stored in the queue for you to retrieve.
- *
- *@param queue Name of the queue to subscribe to.
- *@param name unique destination name for the subscription, defaults to queue name.
- * If not specified, the queue name is used.
- */
- Subscription subscribe(LocalQueue& localQueue,
- const std::string& queue,
- const std::string& name=std::string());
-
-
- /** Get a single message from a queue.
- *@param result is set to the message from the queue.
- *@param timeout wait up this timeout for a message to appear.
- *@return true if result was set, false if no message available after timeout.
- */
- bool get(Message& result, const std::string& queue, sys::Duration timeout=0);
-
- /** Get a single message from a queue.
- *@param timeout wait up this timeout for a message to appear.
- *@return message from the queue.
- *@throw Exception if the timeout is exceeded.
- */
- Message get(const std::string& queue, sys::Duration timeout=sys::TIME_INFINITE);
-
- /** Get a subscription by name.
- *@throw Exception if not found.
- */
- Subscription getSubscription(const std::string& name) const;
-
- /** Cancel a subscription. See also: Subscription.cancel() */
- void cancel(const std::string& name);
-
- /** Deliver messages in the current thread until stop() is called.
- * Only one thread may be running in a SubscriptionManager at a time.
- * @see run
- */
- void run();
-
- /** Start a new thread to deliver messages.
- * Only one thread may be running in a SubscriptionManager at a time.
- * @see start
- */
- void start();
-
- /**
- * Wait for the thread started by a call to start() to complete.
- */
- void wait();
-
- /** If set true, run() will stop when all subscriptions
- * are cancelled. If false, run will only stop when stop()
- * is called. True by default.
- */
- void setAutoStop(bool set=true);
-
- /** Stop delivery. Causes run() to return, or the thread started with start() to exit. */
- void stop();
-
- static const uint32_t UNLIMITED=0xFFFFFFFF;
-
- /** Set the flow control for a subscription. */
- void setFlowControl(const std::string& name, const FlowControl& flow) {
- getSubscription(name).setFlowControl(flow);
- }
-
- /** Set the flow control for a subscription.
- *@param name: name of the subscription.
- *@param messages: message credit.
- *@param bytes: byte credit.
- *@param window: if true use window-based flow control.
- */
- void setFlowControl(const std::string& name, uint32_t messages, uint32_t bytes, bool window=true) {
- setFlowControl(name, messages, bytes, window);
- }
-
- /** Set the default settings for subscribe() calls that don't
- * include a SubscriptionSettings parameter.
- */
- void setDefaultSettings(const SubscriptionSettings& s) { defaultSettings = s; }
-
- /** Get the default settings for subscribe() calls that don't
- * include a SubscriptionSettings parameter.
- */
- const SubscriptionSettings& getDefaultSettings() const { return defaultSettings; }
-
- /** Get the default settings for subscribe() calls that don't
- * include a SubscriptionSettings parameter.
- */
- SubscriptionSettings& getDefaultSettings() { return defaultSettings; }
-
- /**
- * Set the default flow control settings for subscribe() calls
- * that don't include a SubscriptionSettings parameter.
- *
- *@param messages: message credit.
- *@param bytes: byte credit.
- *@param window: if true use window-based flow control.
- */
- void setFlowControl(uint32_t messages, uint32_t bytes, bool window=true) {
- defaultSettings.flowControl = FlowControl(messages, bytes, window);
- }
-
- /**
- *Set the default accept-mode for subscribe() calls that don't
- *include a SubscriptionSettings parameter.
- */
- void setAcceptMode(AcceptMode mode) { defaultSettings.acceptMode = mode; }
-
- /**
- * Set the default acquire-mode subscribe()s that don't specify SubscriptionSettings.
- */
- void setAcquireMode(AcquireMode mode) { defaultSettings.acquireMode = mode; }
-
- void registerFailoverHandler ( boost::function<void ()> fh );
-
- Session getSession() const;
-
- private:
- std::map<std::string, Subscription> subscriptions;
-};
-
-/** AutoCancel cancels a subscription in its destructor */
-class AutoCancel {
- public:
- AutoCancel(SubscriptionManager& sm_, const std::string& tag_) : sm(sm_), tag(tag_) {}
- ~AutoCancel() { sm.cancel(tag); }
- private:
- SubscriptionManager& sm;
- std::string tag;
-};
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_SUBSCRIPTIONMANAGER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionSettings.h b/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionSettings.h
deleted file mode 100644
index ade539b376..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/SubscriptionSettings.h
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef QPID_CLIENT_SUBSCRIPTIONSETTINGS_H
-#define QPID_CLIENT_SUBSCRIPTIONSETTINGS_H
-
-/*
- *
- * 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 "qpid/client/FlowControl.h"
-#include "qpid/framing/enum.h"
-
-namespace qpid {
-namespace client {
-
-/** Bring AMQP enum definitions for message class into this namespace. */
-using namespace qpid::framing::message;
-
-enum CompletionMode {
- MANUAL_COMPLETION = 0,
- COMPLETE_ON_DELIVERY = 1,
- COMPLETE_ON_ACCEPT = 2
-};
-/**
- * Settings for a subscription.
- */
-struct SubscriptionSettings
-{
- SubscriptionSettings(
- FlowControl flow=FlowControl::unlimited(),
- AcceptMode accept=ACCEPT_MODE_EXPLICIT,
- AcquireMode acquire=ACQUIRE_MODE_PRE_ACQUIRED,
- unsigned int autoAck_=1,
- CompletionMode completion=COMPLETE_ON_DELIVERY
- ) : flowControl(flow), acceptMode(accept), acquireMode(acquire), autoAck(autoAck_), completionMode(completion), exclusive(false) {}
-
- FlowControl flowControl; ///@< Flow control settings. @see FlowControl
- AcceptMode acceptMode; ///@< ACCEPT_MODE_EXPLICIT or ACCEPT_MODE_NONE
- AcquireMode acquireMode; ///@< ACQUIRE_MODE_PRE_ACQUIRED or ACQUIRE_MODE_NOT_ACQUIRED
-
- /** Automatically acknowledge (accept) batches of autoAck
- * messages. 0 means no automatic acknowledgement. This has no
- * effect for messsages received for a subscription with
- * ACCEPT_MODE_NODE.*/
- unsigned int autoAck;
- /**
- * In windowing mode, completion of a message will cause the
- * credit used up by that message to be reallocated. The
- * subscriptions completion mode controls how completion is
- * managed.
- *
- * If set to COMPLETE_ON_DELIVERY (which is the default), messages
- * will be marked as completed once they have been received. The
- * server will be explicitly notified of all completed messages
- * for the session when the next accept is sent through the
- * subscription (either explictly or through autAck). However the
- * server may also periodically request information on the
- * completed messages.
- *
- * If set to COMPLETE_ON_ACCEPT, messages will be marked as
- * completed once they are accepted (via the Subscription class)
- * and the server will also be notified of all completed messages
- * for the session.
- *
- * If set to MANUAL_COMPLETION the application is responsible for
- * completing messages (@see Session::markCompleted()).
- */
- CompletionMode completionMode;
- /**
- * If set, requests that no other subscriber be allowed to access
- * the queue while this subscription is active.
- */
- bool exclusive;
-};
-
-}} // namespace qpid::client
-
-#endif /*!QPID_CLIENT_SUBSCRIPTIONSETTINGS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/client/TypedResult.h b/M4-RCs/qpid/cpp/src/qpid/client/TypedResult.h
deleted file mode 100644
index 5306997d74..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/client/TypedResult.h
+++ /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.
- *
- */
-
-#ifndef _TypedResult_
-#define _TypedResult_
-
-#include "Completion.h"
-
-namespace qpid {
-namespace client {
-
-/**
- * Returned by asynchronous commands that return a result.
- * You can use get() to wait for completion and get the result value.
- * \ingroup clientapi
- */
-template <class T> class TypedResult : public Completion
-{
- T result;
- bool decoded;
-
-public:
- ///@internal
- TypedResult(Future f, shared_ptr<SessionImpl> s) : Completion(f, s), decoded(false) {}
-
- /**
- * Wait for the asynchronous command that returned this TypedResult to complete
- * and return its result.
- *
- *@return The result returned by the command.
- *@exception If the command returns an error, get() throws an exception.
- *
- */
- T& get()
- {
- if (!decoded) {
- future.decodeResult(result, *session);
- decoded = true;
- }
-
- return result;
- }
-};
-
-}}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Cluster.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/Cluster.cpp
deleted file mode 100644
index dd9de68bf5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Cluster.cpp
+++ /dev/null
@@ -1,548 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Cluster.h"
-#include "Connection.h"
-#include "DumpClient.h"
-#include "FailoverExchange.h"
-
-#include "qpid/broker/Broker.h"
-#include "qpid/broker/SessionState.h"
-#include "qpid/broker/Connection.h"
-#include "qpid/broker/QueueRegistry.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/AMQP_AllOperations.h"
-#include "qpid/framing/AllInvoker.h"
-#include "qpid/framing/ClusterDumpRequestBody.h"
-#include "qpid/framing/ClusterReadyBody.h"
-#include "qpid/framing/ClusterConfigChangeBody.h"
-#include "qpid/framing/ClusterDumpOfferBody.h"
-#include "qpid/framing/ClusterShutdownBody.h"
-#include "qpid/framing/ClusterConnectionDeliverCloseBody.h"
-#include "qpid/framing/ClusterConnectionDeliverDoOutputBody.h"
-#include "qpid/log/Statement.h"
-#include "qpid/log/Helpers.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/memory.h"
-#include "qpid/shared_ptr.h"
-#include "qmf/org/apache/qpid/cluster/Package.h"
-
-#include <boost/bind.hpp>
-#include <boost/cast.hpp>
-#include <boost/current_function.hpp>
-#include <algorithm>
-#include <iterator>
-#include <map>
-#include <ostream>
-
-namespace qpid {
-namespace cluster {
-using namespace qpid::framing;
-using namespace qpid::sys;
-using namespace std;
-using namespace qpid::cluster;
-using qpid::management::ManagementAgent;
-using qpid::management::ManagementObject;
-using qpid::management::Manageable;
-using qpid::management::Args;
-namespace qmf = qmf::org::apache::qpid::cluster;
-
-/**@file
- Threading notes:
- - Public functions may be called in local connection IO threads.
- see .h.
-*/
-
-struct ClusterDispatcher : public framing::AMQP_AllOperations::ClusterHandler {
- qpid::cluster::Cluster& cluster;
- MemberId member;
- Cluster::Lock& l;
- ClusterDispatcher(Cluster& c, const MemberId& id, Cluster::Lock& l_) : cluster(c), member(id), l(l_) {}
-
- void dumpRequest(const std::string& url) { cluster.dumpRequest(member, url, l); }
- void ready(const std::string& url) { cluster.ready(member, url, l); }
- void configChange(const std::string& addresses) { cluster.configChange(member, addresses, l); }
- void dumpOffer(uint64_t dumpee, const Uuid& id) { cluster.dumpOffer(member, dumpee, id, l); }
- void shutdown() { cluster.shutdown(member, l); }
-
- bool invoke(AMQBody& body) { return framing::invoke(*this, body).wasHandled(); }
-};
-
-Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b, bool quorum_, size_t readMax_, size_t writeEstimate_) :
- broker(b),
- poller(b.getPoller()),
- cpg(*this),
- name(name_),
- myUrl(url_),
- myId(cpg.self()),
- readMax(readMax_),
- writeEstimate(writeEstimate_),
- cpgDispatchHandle(
- cpg,
- boost::bind(&Cluster::dispatch, this, _1), // read
- 0, // write
- boost::bind(&Cluster::disconnect, this, _1) // disconnect
- ),
- mcast(cpg, poller),
- mgmtObject(0),
- deliverQueue(boost::bind(&Cluster::delivered, this, _1), poller),
- state(INIT),
- lastSize(0),
- lastBroker(false)
-{
- ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
- if (agent != 0){
- qmf::Package packageInit(agent);
- mgmtObject = new qmf::Cluster (agent, this, &broker,name,myUrl.str());
- agent->addObject (mgmtObject);
- mgmtObject->set_status("JOINING");
- }
- broker.getKnownBrokers = boost::bind(&Cluster::getUrls, this);
- failoverExchange.reset(new FailoverExchange(this));
- cpgDispatchHandle.startWatch(poller);
- deliverQueue.start();
- QPID_LOG(notice, *this << " joining cluster " << name << " with url=" << myUrl);
- if (quorum_) quorum.init();
- cpg.join(name);
- broker.addFinalizer(boost::bind(&Cluster::brokerShutdown, this)); // Must be last for exception safety.
-}
-
-Cluster::~Cluster() {
- if (dumpThread.id()) dumpThread.join(); // Join the previous dumpthread.
-}
-
-void Cluster::insert(const boost::intrusive_ptr<Connection>& c) {
- connections.insert(c->getId(), c);
-}
-
-void Cluster::erase(ConnectionId id) {
- connections.erase(id);
-}
-
-std::vector<Url> Cluster::getUrls() const {
- Lock l(lock);
- return getUrls(l);
-}
-
-std::vector<Url> Cluster::getUrls(Lock&) const {
- return map.memberUrls();
-}
-
-void Cluster::leave() {
- Lock l(lock);
- leave(l);
-}
-
-void Cluster::leave(Lock&) {
- if (state != LEFT) {
- state = LEFT;
- QPID_LOG(notice, *this << " leaving cluster " << name);
- if (mgmtObject!=0) mgmtObject->set_status("SHUTDOWN");
- if (!deliverQueue.isStopped()) deliverQueue.stop();
- try { cpg.leave(); }
- catch (const std::exception& e) {
- QPID_LOG(critical, *this << " error leaving process group: " << e.what());
- }
- try { broker.shutdown(); }
- catch (const std::exception& e) {
- QPID_LOG(critical, *this << " error during shutdown: " << e.what());
- }
- }
-}
-
-boost::intrusive_ptr<Connection> Cluster::getConnection(const ConnectionId& connectionId) {
- boost::intrusive_ptr<Connection> cp = connections.find(connectionId);
- if (!cp && connectionId.getMember() != myId) { // New shadow connection
- std::ostringstream mgmtId;
- mgmtId << name << ":" << connectionId;
- cp = new Connection(*this, shadowOut, mgmtId.str(), connectionId);
- connections.insert(connectionId, cp);
- }
- return cp;
-}
-
-void Cluster::deliver(
- cpg_handle_t /*handle*/,
- cpg_name* /*group*/,
- uint32_t nodeid,
- uint32_t pid,
- void* msg,
- int msg_len)
-{
- Mutex::ScopedLock l(lock);
- MemberId from(nodeid, pid);
- framing::Buffer buf(static_cast<char*>(msg), msg_len);
- deliver(Event::decode(from, buf), l);
-}
-
-void Cluster::deliver(const Event& e, Lock&) {
- if (state == LEFT) return;
- QPID_LOG(trace, *this << " PUSH: " << e);
- deliverQueue.push(e); // Otherwise enqueue for processing.
-}
-
-// Entry point: called when deliverQueue has events to process.
-void Cluster::delivered(PollableEventQueue::Queue& events) {
- try {
- for_each(events.begin(), events.end(), boost::bind(&Cluster::deliveredEvent, this, _1));
- events.clear();
- } catch (const std::exception& e) {
- QPID_LOG(critical, *this << " error in cluster delivery: " << e.what());
- leave();
- }
-}
-
-void Cluster::deliveredEvent(const Event& e) {
- Buffer buf(e);
- AMQFrame frame;
- if (e.isCluster()) {
- while (frame.decode(buf)) {
- QPID_LOG(trace, *this << " DLVR: " << e << " " << frame);
- Mutex::ScopedLock l(lock); // FIXME aconway 2008-12-11: lock scope is too big.
- ClusterDispatcher dispatch(*this, e.getMemberId(), l);
- if (!framing::invoke(dispatch, *frame.getBody()).wasHandled())
- throw Exception(QPID_MSG("Invalid cluster control"));
- }
- }
- else { // e.isConnection()
- if (state == NEWBIE) {
- QPID_LOG(trace, *this << " DROP: " << e);
- }
- else {
- boost::intrusive_ptr<Connection> connection = getConnection(e.getConnectionId());
- if (!connection) return;
- if (e.getType() == CONTROL) {
- while (frame.decode(buf)) {
- QPID_LOG(trace, *this << " DLVR: " << e << " " << frame);
- connection->delivered(frame);
- }
- }
- else {
- QPID_LOG(trace, *this << " DLVR: " << e);
- connection->deliverBuffer(buf);
- }
- }
- }
-}
-
-struct AddrList {
- const cpg_address* addrs;
- int count;
- const char *prefix, *suffix;
- AddrList(const cpg_address* a, int n, const char* p="", const char* s="")
- : addrs(a), count(n), prefix(p), suffix(s) {}
-};
-
-ostream& operator<<(ostream& o, const AddrList& a) {
- if (!a.count) return o;
- o << a.prefix;
- for (const cpg_address* p = a.addrs; p < a.addrs+a.count; ++p) {
- const char* reasonString;
- switch (p->reason) {
- case CPG_REASON_JOIN: reasonString = " (joined) "; break;
- case CPG_REASON_LEAVE: reasonString = " (left) "; break;
- case CPG_REASON_NODEDOWN: reasonString = " (node-down) "; break;
- case CPG_REASON_NODEUP: reasonString = " (node-up) "; break;
- case CPG_REASON_PROCDOWN: reasonString = " (process-down) "; break;
- default: reasonString = " ";
- }
- qpid::cluster::MemberId member(*p);
- o << member << reasonString;
- }
- return o << a.suffix;
-}
-
-// Entry point: called by IO to dispatch CPG events.
-void Cluster::dispatch(sys::DispatchHandle& h) {
- try {
- cpg.dispatchAll();
- h.rewatch();
- } catch (const std::exception& e) {
- QPID_LOG(critical, *this << " error in cluster dispatch: " << e.what());
- leave();
- }
-}
-
-// Entry point: called if disconnected from CPG.
-void Cluster::disconnect(sys::DispatchHandle& ) {
- QPID_LOG(critical, *this << " error disconnected from cluster");
- try {
- broker.shutdown();
- } catch (const std::exception& e) {
- QPID_LOG(error, *this << " error in shutdown: " << e.what());
- }
-}
-
-void Cluster::configChange (
- cpg_handle_t /*handle*/,
- cpg_name */*group*/,
- cpg_address *current, int nCurrent,
- cpg_address *left, int nLeft,
- cpg_address */*joined*/, int /*nJoined*/)
-{
- Mutex::ScopedLock l(lock);
- QPID_LOG(debug, *this << " config change: " << AddrList(current, nCurrent)
- << AddrList(left, nLeft, "( ", ")"));
- std::string addresses;
- for (cpg_address* p = current; p < current+nCurrent; ++p)
- addresses.append(MemberId(*p).str());
- deliver(Event::control(ClusterConfigChangeBody(ProtocolVersion(), addresses), myId), l);
-}
-
-void Cluster::configChange(const MemberId&, const std::string& addresses, Lock& l) {
- bool memberChange = map.configChange(addresses);
- if (state == LEFT) return;
-
- if (!map.isAlive(myId)) { // Final config change.
- leave(l);
- return;
- }
-
- if (state == INIT) { // First configChange
- if (map.aliveCount() == 1) {
- setClusterId(true);
- // FIXME aconway 2008-12-11: Centralize transition to READY and associated actions eg mcast.release()
- state = READY;
- mcast.release();
- QPID_LOG(notice, *this << " first in cluster");
- if (mgmtObject!=0) mgmtObject->set_status("ACTIVE");
- map = ClusterMap(myId, myUrl, true);
- memberUpdate(l);
- }
- else { // Joining established group.
- state = NEWBIE;
- QPID_LOG(info, *this << " joining cluster: " << map);
- mcast.mcastControl(ClusterDumpRequestBody(ProtocolVersion(), myUrl.str()), myId);
- }
- }
- else if (state >= READY && memberChange)
- memberUpdate(l);
-}
-
-
-
-
-void Cluster::tryMakeOffer(const MemberId& id, Lock& ) {
- if (state == READY && map.isNewbie(id)) {
- state = OFFER;
- QPID_LOG(info, *this << " send dump-offer to " << id);
- mcast.mcastControl(ClusterDumpOfferBody(ProtocolVersion(), id, clusterId), myId);
- }
-}
-
-// Called from Broker::~Broker when broker is shut down. At this
-// point we know the poller has stopped so no poller callbacks will be
-// invoked. We must ensure that CPG has also shut down so no CPG
-// callbacks will be invoked.
-//
-void Cluster::brokerShutdown() {
- QPID_LOG(notice, *this << " shutting down ");
- if (state != LEFT) {
- try { cpg.shutdown(); }
- catch (const std::exception& e) {
- QPID_LOG(error, *this << " during shutdown: " << e.what());
- }
- }
- delete this;
-}
-
-void Cluster::dumpRequest(const MemberId& id, const std::string& url, Lock& l) {
- map.dumpRequest(id, url);
- tryMakeOffer(id, l);
-}
-
-void Cluster::ready(const MemberId& id, const std::string& url, Lock& l) {
- if (map.ready(id, Url(url)))
- memberUpdate(l);
- if (state == CATCHUP && id == myId) {
- state = READY;
- mcast.release();
- QPID_LOG(notice, *this << " caught up, active cluster member");
- if (mgmtObject!=0) mgmtObject->set_status("ACTIVE");
- mcast.release();
- }
-}
-
-void Cluster::dumpOffer(const MemberId& dumper, uint64_t dumpeeInt, const Uuid& uuid, Lock& l) {
- if (state == LEFT) return;
- MemberId dumpee(dumpeeInt);
- boost::optional<Url> url = map.dumpOffer(dumper, dumpee);
- if (dumper == myId) {
- assert(state == OFFER);
- if (url) { // My offer was first.
- dumpStart(dumpee, *url, l);
- }
- else { // Another offer was first.
- state = READY;
- mcast.release();
- QPID_LOG(info, *this << " cancelled dump offer to " << dumpee);
- tryMakeOffer(map.firstNewbie(), l); // Maybe make another offer.
- }
- }
- else if (dumpee == myId && url) {
- assert(state == NEWBIE);
- setClusterId(uuid);
- state = DUMPEE;
- QPID_LOG(info, *this << " receiving dump from " << dumper);
- deliverQueue.stop();
- checkDumpIn(l);
- }
-}
-
-// FIXME aconway 2008-10-15: no longer need a separate control now
-// that the dump control is in the deliver queue.
-void Cluster::dumpStart(const MemberId& dumpee, const Url& url, Lock&) {
- if (state == LEFT) return;
- assert(state == OFFER);
- state = DUMPER;
- QPID_LOG(info, *this << " stall for dump to " << dumpee << " at " << url);
- deliverQueue.stop();
- if (dumpThread.id()) dumpThread.join(); // Join the previous dumpthread.
- dumpThread = Thread(
- new DumpClient(myId, dumpee, url, broker, map, connections.values(),
- boost::bind(&Cluster::dumpOutDone, this),
- boost::bind(&Cluster::dumpOutError, this, _1)));
-}
-
-// Called in dump thread.
-void Cluster::dumpInDone(const ClusterMap& m) {
- Lock l(lock);
- dumpedMap = m;
- checkDumpIn(l);
-}
-
-void Cluster::checkDumpIn(Lock& ) {
- if (state == LEFT) return;
- if (state == DUMPEE && dumpedMap) {
- map = *dumpedMap;
- mcast.mcastControl(ClusterReadyBody(ProtocolVersion(), myUrl.str()), myId);
- state = CATCHUP;
- QPID_LOG(info, *this << " received dump, starting catch-up");
- deliverQueue.start();
- }
-}
-
-void Cluster::dumpOutDone() {
- Monitor::ScopedLock l(lock);
- dumpOutDone(l);
-}
-
-void Cluster::dumpOutDone(Lock& l) {
- assert(state == DUMPER);
- state = READY;
- mcast.release();
- QPID_LOG(info, *this << " sent dump");
- deliverQueue.start();
- tryMakeOffer(map.firstNewbie(), l); // Try another offer
-}
-
-void Cluster::dumpOutError(const std::exception& e) {
- Monitor::ScopedLock l(lock);
- QPID_LOG(error, *this << " error sending dump: " << e.what());
- dumpOutDone(l);
-}
-
-void Cluster ::shutdown(const MemberId& id, Lock& l) {
- QPID_LOG(notice, *this << " received shutdown from " << id);
- leave(l);
-}
-
-ManagementObject* Cluster::GetManagementObject() const { return mgmtObject; }
-
-Manageable::status_t Cluster::ManagementMethod (uint32_t methodId, Args&, string&) {
- Lock l(lock);
- QPID_LOG(debug, *this << " managementMethod [id=" << methodId << "]");
- switch (methodId) {
- case qmf::Cluster::METHOD_STOPCLUSTERNODE: stopClusterNode(l); break;
- case qmf::Cluster::METHOD_STOPFULLCLUSTER: stopFullCluster(l); break;
- default: return Manageable::STATUS_UNKNOWN_METHOD;
- }
- return Manageable::STATUS_OK;
-}
-
-void Cluster::stopClusterNode(Lock& l) {
- QPID_LOG(notice, *this << " stopped by admin");
- leave(l);
-}
-
-void Cluster::stopFullCluster(Lock& ) {
- QPID_LOG(notice, *this << " shutting down cluster " << name);
- mcast.mcastControl(ClusterShutdownBody(), myId);
-}
-
-void Cluster::memberUpdate(Lock& l) {
- QPID_LOG(info, *this << " member update: " << map);
- std::vector<Url> urls = getUrls(l);
- size_t size = urls.size();
- failoverExchange->setUrls(urls);
-
- if (size == 1 && lastSize > 1 && state >= READY) {
- QPID_LOG(info, *this << " last broker standing, update queue policies");
- lastBroker = true;
- broker.getQueues().updateQueueClusterState(true);
- }
- else if (size > 1 && lastBroker) {
- QPID_LOG(info, *this << " last broker standing joined by " << size-1 << " replicas, updating queue policies" << size);
- lastBroker = false;
- broker.getQueues().updateQueueClusterState(false);
- }
- lastSize = size;
-
- if (mgmtObject) {
- mgmtObject->set_clusterSize(size);
- string urlstr;
- for(std::vector<Url>::iterator iter = urls.begin(); iter != urls.end(); iter++ ) {
- if (iter != urls.begin()) urlstr += "\n";
- urlstr += iter->str();
- }
- mgmtObject->set_members(urlstr);
- }
-
- // Close connections belonging to members that have now been excluded
- connections.update(myId, map);
-}
-
-std::ostream& operator<<(std::ostream& o, const Cluster& cluster) {
- static const char* STATE[] = { "INIT", "NEWBIE", "DUMPEE", "CATCHUP", "READY", "OFFER", "DUMPER", "LEFT" };
- return o << cluster.myId << "(" << STATE[cluster.state] << ")";
-}
-
-MemberId Cluster::getId() const {
- return myId; // Immutable, no need to lock.
-}
-
-broker::Broker& Cluster::getBroker() const {
- return broker; // Immutable, no need to lock.
-}
-
-void Cluster::checkQuorum() {
- if (!quorum.isQuorate()) {
- QPID_LOG(critical, *this << " disconnected from cluster quorum, shutting down");
- leave();
- throw Exception(QPID_MSG(*this << " disconnected from cluster quorum."));
- }
-}
-
-void Cluster::setClusterId(const Uuid& uuid) {
- clusterId = uuid;
- if (mgmtObject)
- mgmtObject->set_clusterID(clusterId.str());
- QPID_LOG(debug, *this << " cluster-id = " << clusterId);
-}
-
-}} // namespace qpid::cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Cluster.h b/M4-RCs/qpid/cpp/src/qpid/cluster/Cluster.h
deleted file mode 100644
index b8fe61bf15..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Cluster.h
+++ /dev/null
@@ -1,230 +0,0 @@
-#ifndef QPID_CLUSTER_CLUSTER_H
-#define QPID_CLUSTER_CLUSTER_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Cpg.h"
-#include "Event.h"
-#include "NoOpConnectionOutputHandler.h"
-#include "ClusterMap.h"
-#include "ConnectionMap.h"
-#include "FailoverExchange.h"
-#include "Quorum.h"
-#include "Multicaster.h"
-
-#include "qpid/broker/Broker.h"
-#include "qpid/sys/PollableQueue.h"
-#include "qpid/sys/Monitor.h"
-#include "qpid/sys/LockPtr.h"
-#include "qpid/management/Manageable.h"
-#include "qpid/Url.h"
-#include "qmf/org/apache/qpid/cluster/Cluster.h"
-
-#include <boost/intrusive_ptr.hpp>
-#include <boost/bind.hpp>
-#include <boost/optional.hpp>
-
-#include <algorithm>
-#include <vector>
-#include <map>
-
-namespace qpid {
-
-namespace framing {
-class AMQBody;
-class Uuid;
-}
-
-namespace cluster {
-
-class Connection;
-
-/**
- * Connection to the cluster
- *
- * Threading notes: 3 thread categories: connection, deliver, dump.
- *
- */
-class Cluster : private Cpg::Handler, public management::Manageable {
- public:
- typedef boost::intrusive_ptr<Connection> ConnectionPtr;
- typedef std::vector<ConnectionPtr> Connections;
-
- /**
- * Join a cluster.
- */
- Cluster(const std::string& name, const Url& url, broker::Broker&, bool useQuorum,
- size_t readMax, size_t writeEstimate);
-
- virtual ~Cluster();
-
- // Connection map - called in connection threads.
- void insert(const ConnectionPtr&);
- void erase(ConnectionId);
-
- // URLs of current cluster members - called in connection threads.
- std::vector<Url> getUrls() const;
- boost::shared_ptr<FailoverExchange> getFailoverExchange() const { return failoverExchange; }
-
- // Leave the cluster - called in any thread.
- void leave();
-
- // Dump completed - called in dump thread
- void dumpInDone(const ClusterMap&);
-
- MemberId getId() const;
- broker::Broker& getBroker() const;
- Multicaster& getMulticast() { return mcast; }
-
- boost::function<bool ()> isQuorate;
- void checkQuorum(); // called in connection threads.
-
- size_t getReadMax() { return readMax; }
- size_t getWriteEstimate() { return writeEstimate; }
-
- private:
- typedef sys::LockPtr<Cluster,sys::Monitor> LockPtr;
- typedef sys::LockPtr<const Cluster,sys::Monitor> ConstLockPtr;
- typedef sys::Monitor::ScopedLock Lock;
-
- typedef sys::PollableQueue<Event> PollableEventQueue;
- typedef std::deque<Event> PlainEventQueue;
-
- // NB: The final Lock& parameter on functions below is used to mark functions
- // that should only be called by a function that already holds the lock.
- // The parameter makes it hard to forget since you have to have an instance of
- // a Lock to call the unlocked functions.
-
- void leave(Lock&);
- std::vector<Url> getUrls(Lock&) const;
-
- // Make an offer if we can - called in deliver thread.
- void tryMakeOffer(const MemberId&, Lock&);
-
- // Called in main thread in ~Broker.
- void brokerShutdown();
-
- // Cluster controls implement XML methods from cluster.xml.
- // Called in deliver thread.
- //
- void dumpRequest(const MemberId&, const std::string&, Lock&);
- void dumpOffer(const MemberId& dumper, uint64_t dumpee, const framing::Uuid&, Lock&);
- void ready(const MemberId&, const std::string&, Lock&);
- void configChange(const MemberId&, const std::string& addresses, Lock& l);
- void shutdown(const MemberId&, Lock&);
- void delivered(PollableEventQueue::Queue&); // deliverQueue callback
- void deliveredEvent(const Event&);
-
- // Helper, called in deliver thread.
- void dumpStart(const MemberId& dumpee, const Url& url, Lock&);
-
- // CPG callbacks, called in CPG IO thread.
- void dispatch(sys::DispatchHandle&); // Dispatch CPG events.
- void disconnect(sys::DispatchHandle&); // PG was disconnected
-
- void deliver( // CPG deliver callback.
- cpg_handle_t /*handle*/,
- struct cpg_name *group,
- uint32_t /*nodeid*/,
- uint32_t /*pid*/,
- void* /*msg*/,
- int /*msg_len*/);
-
- void deliver(const Event& e, Lock&);
-
- void configChange( // CPG config change callback.
- cpg_handle_t /*handle*/,
- struct cpg_name */*group*/,
- struct cpg_address */*members*/, int /*nMembers*/,
- struct cpg_address */*left*/, int /*nLeft*/,
- struct cpg_address */*joined*/, int /*nJoined*/
- );
-
- boost::intrusive_ptr<cluster::Connection> getConnection(const ConnectionId&);
-
- virtual qpid::management::ManagementObject* GetManagementObject() const;
- virtual management::Manageable::status_t ManagementMethod (uint32_t methodId, management::Args& args, std::string& text);
-
- void stopClusterNode(Lock&);
- void stopFullCluster(Lock&);
- void memberUpdate(Lock&);
-
- // Called in connection IO threads .
- void checkDumpIn(Lock&);
-
- // Called in DumpClient thread.
- void dumpOutDone();
- void dumpOutError(const std::exception&);
- void dumpOutDone(Lock&);
-
- void setClusterId(const framing::Uuid&);
-
- // Immutable members set on construction, never changed.
- broker::Broker& broker;
- boost::shared_ptr<sys::Poller> poller;
- Cpg cpg;
- const std::string name;
- const Url myUrl;
- const MemberId myId;
- const size_t readMax;
- const size_t writeEstimate;
- framing::Uuid clusterId;
- NoOpConnectionOutputHandler shadowOut;
- sys::DispatchHandle cpgDispatchHandle;
-
-
- // Thread safe members
- Multicaster mcast;
- qmf::org::apache::qpid::cluster::Cluster* mgmtObject; // mgnt owns lifecycle
- PollableEventQueue deliverQueue;
- ConnectionMap connections;
- boost::shared_ptr<FailoverExchange> failoverExchange;
- Quorum quorum;
-
- // Remaining members are protected by lock.
- mutable sys::Monitor lock;
-
- // Local cluster state, cluster map
- enum {
- INIT, ///< Initial state, no CPG messages received.
- NEWBIE, ///< Sent dump request, waiting for dump offer.
- DUMPEE, ///< Stalled receive queue at dump offer, waiting for dump to complete.
- CATCHUP, ///< Dump complete, unstalled but has not yet seen own "ready" event.
- READY, ///< Fully operational
- OFFER, ///< Sent an offer, waiting for accept/reject.
- DUMPER, ///< Offer accepted, sending a state dump.
- LEFT ///< Final state, left the cluster.
- } state;
- ClusterMap map;
- size_t lastSize;
- bool lastBroker;
-
- // Dump related
- sys::Thread dumpThread;
- boost::optional<ClusterMap> dumpedMap;
-
- friend std::ostream& operator<<(std::ostream&, const Cluster&);
- friend class ClusterDispatcher;
-};
-
-}} // namespace qpid::cluster
-
-
-
-#endif /*!QPID_CLUSTER_CLUSTER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterLeaveException.h b/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterLeaveException.h
deleted file mode 100644
index e5bdbc560a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterLeaveException.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef QPID_CLUSTER_CLUSTERLEAVEEXCEPTION_H
-#define QPID_CLUSTER_CLUSTERLEAVEEXCEPTION_H
-
-/*
- *
- * 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 "qpid/Exception.h"
-
-namespace qpid {
-namespace cluster {
-
-struct ClusterLeaveException : public Exception
-{
- ClusterLeaveException(const std::string& message=std::string()) : Exception(message) {}
-};
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_CLUSTERLEAVEEXCEPTION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterMap.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterMap.cpp
deleted file mode 100644
index 873f0be928..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterMap.cpp
+++ /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.
- *
- */
-#include "ClusterMap.h"
-#include "qpid/Url.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/log/Statement.h"
-#include <boost/bind.hpp>
-#include <algorithm>
-#include <functional>
-#include <iterator>
-#include <ostream>
-
-namespace qpid {
-using namespace framing;
-
-namespace cluster {
-
-namespace {
-
-void addFieldTableValue(FieldTable::ValueMap::value_type vt, ClusterMap::Map& map, ClusterMap::Set& set) {
- MemberId id(vt.first);
- set.insert(id);
- std::string url = vt.second->get<std::string>();
- if (!url.empty())
- map.insert(ClusterMap::Map::value_type(id, Url(url)));
-}
-
-void insertFieldTableFromMapValue(FieldTable& ft, const ClusterMap::Map::value_type& vt) {
- ft.setString(vt.first.str(), vt.second.str());
-}
-
-void assignFieldTable(FieldTable& ft, const ClusterMap::Map& map) {
- ft.clear();
- std::for_each(map.begin(), map.end(), boost::bind(&insertFieldTableFromMapValue, boost::ref(ft), _1));
-}
-
-}
-
-ClusterMap::ClusterMap() {}
-
-ClusterMap::ClusterMap(const MemberId& id, const Url& url , bool isMember) {
- alive.insert(id);
- if (isMember)
- members[id] = url;
- else
- newbies[id] = url;
-}
-
-ClusterMap::ClusterMap(const FieldTable& newbiesFt, const FieldTable& membersFt) {
- std::for_each(newbiesFt.begin(), newbiesFt.end(), boost::bind(&addFieldTableValue, _1, boost::ref(newbies), boost::ref(alive)));
- std::for_each(membersFt.begin(), membersFt.end(), boost::bind(&addFieldTableValue, _1, boost::ref(members), boost::ref(alive)));
-}
-
-ClusterConnectionMembershipBody ClusterMap::asMethodBody() const {
- framing::ClusterConnectionMembershipBody b;
- b.getNewbies().clear();
- std::for_each(newbies.begin(), newbies.end(), boost::bind(&insertFieldTableFromMapValue, boost::ref(b.getNewbies()), _1));
- for(Set::const_iterator i = alive.begin(); i != alive.end(); ++i) {
- if (!isMember(*i) && !isNewbie(*i))
- b.getNewbies().setString(i->str(), std::string());
- }
- b.getMembers().clear();
- std::for_each(members.begin(), members.end(), boost::bind(&insertFieldTableFromMapValue, boost::ref(b.getMembers()), _1));
- return b;
-}
-
-bool ClusterMap::configChange(
- cpg_address *current, int nCurrent,
- cpg_address *left, int nLeft,
- cpg_address */*joined*/, int /*nJoined*/)
-{
- cpg_address* a;
- bool memberChange=false;
- for (a = left; a != left+nLeft; ++a) {
- memberChange = memberChange || members.erase(*a);
- newbies.erase(*a);
- }
- alive.clear();
- std::copy(current, current+nCurrent, std::inserter(alive, alive.end()));
- return memberChange;
-}
-
-Url ClusterMap::getUrl(const Map& map, const MemberId& id) {
- Map::const_iterator i = map.find(id);
- return i == map.end() ? Url() : i->second;
-}
-
-MemberId ClusterMap::firstNewbie() const {
- return newbies.empty() ? MemberId() : newbies.begin()->first;
-}
-
-std::vector<Url> ClusterMap::memberUrls() const {
- std::vector<Url> urls(members.size());
- std::transform(members.begin(), members.end(), urls.begin(),
- boost::bind(&Map::value_type::second, _1));
- return urls;
-}
-
-std::ostream& operator<<(std::ostream& o, const ClusterMap::Map& m) {
- std::ostream_iterator<MemberId> oi(o);
- std::transform(m.begin(), m.end(), oi, boost::bind(&ClusterMap::Map::value_type::first, _1));
- return o;
-}
-
-std::ostream& operator<<(std::ostream& o, const ClusterMap& m) {
- for (ClusterMap::Set::const_iterator i = m.alive.begin(); i != m.alive.end(); ++i) {
- o << *i;
- if (m.isMember(*i)) o << "(member)";
- else if (m.isNewbie(*i)) o << "(newbie)";
- else o << "(unknown)";
- o << " ";
- }
- return o;
-}
-
-bool ClusterMap::dumpRequest(const MemberId& id, const std::string& url) {
- if (isAlive(id)) {
- newbies[id] = Url(url);
- return true;
- }
- return false;
-}
-
-bool ClusterMap::ready(const MemberId& id, const Url& url) {
- return isAlive(id) && members.insert(Map::value_type(id,url)).second;
-}
-
-bool ClusterMap::configChange(const std::string& addresses) {
- bool memberChange = false;
- Set update;
- for (std::string::const_iterator i = addresses.begin(); i < addresses.end(); i += 8)
- update.insert(MemberId(std::string(i, i+8)));
- Set removed;
- std::set_difference(alive.begin(), alive.end(),
- update.begin(), update.end(),
- std::inserter(removed, removed.begin()));
- alive = update;
- for (Set::const_iterator i = removed.begin(); i != removed.end(); ++i) {
- memberChange = memberChange || members.erase(*i);
- newbies.erase(*i);
- }
- return memberChange;
-}
-
-boost::optional<Url> ClusterMap::dumpOffer(const MemberId& from, const MemberId& to) {
- Map::iterator i = newbies.find(to);
- if (isAlive(from) && i != newbies.end()) {
- Url url= i->second;
- newbies.erase(i); // No longer a potential dumpee.
- return url;
- }
- return boost::optional<Url>();
-}
-
-}} // namespace qpid::cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterMap.h b/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterMap.h
deleted file mode 100644
index 5c1981269f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterMap.h
+++ /dev/null
@@ -1,99 +0,0 @@
-#ifndef QPID_CLUSTER_CLUSTERMAP_H
-#define QPID_CLUSTER_CLUSTERMAP_H
-
-/*
- *
- * 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 "types.h"
-#include "qpid/Url.h"
-#include "qpid/framing/ClusterConnectionMembershipBody.h"
-
-#include <boost/function.hpp>
-#include <boost/optional.hpp>
-
-#include <vector>
-#include <deque>
-#include <map>
-#include <set>
-#include <iosfwd>
-
-namespace qpid {
-namespace cluster {
-
-/**
- * Map of established cluster members and newbies waiting for a brain dump.
- */
-class ClusterMap {
- public:
- typedef std::map<MemberId, Url> Map;
- typedef std::set<MemberId> Set;
-
- ClusterMap();
- ClusterMap(const MemberId& id, const Url& url, bool isReady);
- ClusterMap(const framing::FieldTable& urls, const framing::FieldTable& states);
-
- /** Update from config change.
- *@return true if member set changed.
- */
- bool configChange(
- cpg_address *current, int nCurrent,
- cpg_address *left, int nLeft,
- cpg_address *joined, int nJoined);
-
- bool configChange(const std::string& addresses);
-
- bool isNewbie(const MemberId& id) const { return newbies.find(id) != newbies.end(); }
- bool isMember(const MemberId& id) const { return members.find(id) != members.end(); }
- bool isAlive(const MemberId& id) const { return alive.find(id) != alive.end(); }
-
- Url getNewbieUrl(const MemberId& id) { return getUrl(newbies, id); }
- Url getMemberUrl(const MemberId& id) { return getUrl(members, id); }
-
- /** First newbie in the cluster in ID order, target for offers */
- MemberId firstNewbie() const;
-
- /** Convert map contents to a cluster control body. */
- framing::ClusterConnectionMembershipBody asMethodBody() const;
-
- size_t aliveCount() const { return alive.size(); }
- size_t memberCount() const { return members.size(); }
- std::vector<Url> memberUrls() const;
-
- bool dumpRequest(const MemberId& id, const std::string& url);
- /** Return non-empty Url if accepted */
- boost::optional<Url> dumpOffer(const MemberId& from, const MemberId& to);
-
- /**@return true If this is a new member */
- bool ready(const MemberId& id, const Url&);
-
- private:
- Url getUrl(const Map& map, const MemberId& id);
-
- Map newbies, members;
- Set alive;
-
- friend std::ostream& operator<<(std::ostream&, const Map&);
- friend std::ostream& operator<<(std::ostream&, const ClusterMap&);
-};
-
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_CLUSTERMAP_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp
deleted file mode 100644
index 0f4944d392..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/ClusterPlugin.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Connection.h"
-#include "ConnectionCodec.h"
-
-#include "qpid/cluster/Cluster.h"
-#include "qpid/cluster/ConnectionCodec.h"
-
-#include "qpid/broker/Broker.h"
-#include "qpid/Plugin.h"
-#include "qpid/Options.h"
-#include "qpid/shared_ptr.h"
-#include "qpid/log/Statement.h"
-
-#include <boost/utility/in_place_factory.hpp>
-#include <boost/scoped_ptr.hpp>
-
-namespace qpid {
-namespace cluster {
-
-using namespace std;
-using broker::Broker;
-
-struct ClusterValues {
- string name;
- string url;
- bool quorum;
- size_t readMax, writeEstimate;
-
- // FIXME aconway 2008-12-09: revisit default.
- ClusterValues() : quorum(false), readMax(0), writeEstimate(64) {}
-
- Url getUrl(uint16_t port) const {
- if (url.empty()) return Url::getIpAddressesUrl(port);
- return Url(url);
- }
-};
-
-/** Note separating options from values to work around boost version differences.
- * Old boost takes a reference to options objects, but new boost makes a copy.
- * New boost allows a shared_ptr but that's not compatible with old boost.
- */
-struct ClusterOptions : public Options {
- ClusterValues& values;
-
- ClusterOptions(ClusterValues& v) : Options("Cluster Options"), values(v) {
- addOptions()
- ("cluster-name", optValue(values.name, "NAME"), "Name of cluster to join")
- ("cluster-url", optValue(values.url,"URL"),
- "URL of this broker, advertized to the cluster.\n"
- "Defaults to a URL listing all the local IP addresses\n")
-#if HAVE_LIBCMAN
- ("cluster-cman", optValue(values.quorum), "Integrate with Cluster Manager (CMAN) cluster.")
-#endif
- ("cluster-read-max", optValue(values.readMax,"N"),
- "Throttle read rate from client connections.")
- ("cluster-write-estimate", optValue(values.writeEstimate, "Kb"),
- "Estimate connection write rate per multicast cycle")
- ;
- }
-};
-
-struct ClusterPlugin : public Plugin {
-
- ClusterValues values;
- ClusterOptions options;
- Cluster* cluster;
- boost::scoped_ptr<ConnectionCodec::Factory> factory;
-
- ClusterPlugin() : options(values), cluster(0) {}
-
- Options* getOptions() { return &options; }
-
- void initialize(Plugin::Target& target) {
- if (values.name.empty()) return; // Only if --cluster-name option was specified.
- Broker* broker = dynamic_cast<Broker*>(&target);
- if (!broker) return;
- cluster = new Cluster(values.name, values.getUrl(broker->getPort(Broker::TCP_TRANSPORT)), *broker, values.quorum, values.readMax, values.writeEstimate*1024);
- broker->setConnectionFactory(
- boost::shared_ptr<sys::ConnectionCodec::Factory>(
- new ConnectionCodec::Factory(broker->getConnectionFactory(), *cluster)));
- broker->getExchanges().registerExchange(cluster->getFailoverExchange());
- }
-
- void earlyInitialize(Plugin::Target&) {}
-};
-
-static ClusterPlugin instance; // Static initialization.
-
-}} // namespace qpid::cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Connection.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/Connection.cpp
deleted file mode 100644
index f0d38bf299..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Connection.cpp
+++ /dev/null
@@ -1,370 +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 "Connection.h"
-#include "DumpClient.h"
-#include "Cluster.h"
-
-#include "qpid/broker/SessionState.h"
-#include "qpid/broker/SemanticState.h"
-#include "qpid/broker/TxBuffer.h"
-#include "qpid/broker/TxPublish.h"
-#include "qpid/broker/TxAccept.h"
-#include "qpid/broker/RecoveredEnqueue.h"
-#include "qpid/broker/RecoveredDequeue.h"
-#include "qpid/broker/Exchange.h"
-#include "qpid/broker/Queue.h"
-#include "qpid/framing/enum.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/AllInvoker.h"
-#include "qpid/framing/DeliveryProperties.h"
-#include "qpid/framing/ClusterConnectionDeliverCloseBody.h"
-#include "qpid/framing/ConnectionCloseBody.h"
-#include "qpid/framing/ConnectionCloseOkBody.h"
-#include "qpid/log/Statement.h"
-
-#include <boost/current_function.hpp>
-
-// TODO aconway 2008-11-03:
-//
-// Disproportionate amount of code here is dedicated to receiving a
-// brain-dump when joining a cluster and building initial
-// state. Should be separated out into its own classes.
-//
-
-
-namespace qpid {
-namespace cluster {
-
-using namespace framing;
-
-NoOpConnectionOutputHandler Connection::discardHandler;
-
-// Shadow connections
-Connection::Connection(Cluster& c, sys::ConnectionOutputHandler& out,
- const std::string& wrappedId, ConnectionId myId)
- : cluster(c), self(myId), catchUp(false), output(*this, out),
- connection(&output, cluster.getBroker(), wrappedId)
-{ init(); }
-
-// Local connections
-Connection::Connection(Cluster& c, sys::ConnectionOutputHandler& out,
- const std::string& wrappedId, MemberId myId, bool isCatchUp)
- : cluster(c), self(myId, this), catchUp(isCatchUp), output(*this, out),
- connection(&output, cluster.getBroker(), wrappedId)
-{ init(); }
-
-void Connection::init() {
- QPID_LOG(debug, cluster << " new connection: " << *this);
- if (isLocal() && !isCatchUp()) {
- output.giveReadCredit(cluster.getReadMax());
- }
-}
-
-Connection::~Connection() {
- QPID_LOG(debug, cluster << " deleted connection: " << *this);
-}
-
-bool Connection::doOutput() {
- return output.doOutput();
-}
-
-// Delivery of doOutput allows us to run the real connection doOutput()
-// which stocks up the write buffers with data.
-//
-void Connection::deliverDoOutput(uint32_t requested) {
- assert(!catchUp);
- output.deliverDoOutput(requested);
-}
-
-// Received from a directly connected client.
-void Connection::received(framing::AMQFrame& f) {
- QPID_LOG(trace, cluster << " RECV " << *this << ": " << f);
- if (isLocal()) {
- currentChannel = f.getChannel();
- if (!framing::invoke(*this, *f.getBody()).wasHandled())
- connection.received(f);
- }
- else { // Shadow or dumped ex catch-up connection.
- if (f.getMethod() && f.getMethod()->isA<ConnectionCloseBody>()) {
- if (isShadow()) {
- QPID_LOG(debug, cluster << " inserting connection " << *this);
- cluster.insert(boost::intrusive_ptr<Connection>(this));
- }
- AMQFrame ok(in_place<ConnectionCloseOkBody>());
- connection.getOutput().send(ok);
- output.setOutputHandler(discardHandler);
- catchUp = false;
- }
- else
- QPID_LOG(warning, cluster << " ignoring unexpected frame " << *this << ": " << f);
- }
-}
-
-bool Connection::checkUnsupported(const AMQBody& body) {
- std::string message;
- if (body.getMethod()) {
- switch (body.getMethod()->amqpClassId()) {
- case DTX_CLASS_ID: message = "DTX transactions are not currently supported by cluster."; break;
- }
- }
- else if (body.type() == HEADER_BODY) {
- const DeliveryProperties* dp = static_cast<const AMQHeaderBody&>(body).get<DeliveryProperties>();
- if (dp && dp->getTtl()) message = "Message TTL is not currently supported by cluster.";
- }
- if (!message.empty())
- connection.close(connection::CLOSE_CODE_FRAMING_ERROR, message);
- return !message.empty();
-}
-
-// Delivered from cluster.
-void Connection::delivered(framing::AMQFrame& f) {
- QPID_LOG(trace, cluster << " RECV: " << *this << ": " << f);
- assert(!catchUp);
- currentChannel = f.getChannel();
- if (!framing::invoke(*this, *f.getBody()).wasHandled() // Connection contol.
- && !checkUnsupported(*f.getBody())) // Unsupported operation.
- {
- connection.received(f); // Pass to broker connection.
- }
-}
-
-// A local connection is closed by the network layer.
-void Connection::closed() {
- try {
- if (catchUp) {
- QPID_LOG(critical, cluster << " catch-up connection closed prematurely " << *this);
- cluster.leave();
- }
- else if (isDumped()) {
- QPID_LOG(debug, cluster << " closed dump connection " << *this);
- connection.closed();
- }
- else if (isLocal()) {
- QPID_LOG(debug, cluster << " local close of replicated connection " << *this);
- // This was a local replicated connection. Multicast a deliver
- // closed and process any outstanding frames from the cluster
- // until self-delivery of deliver-close.
- output.setOutputHandler(discardHandler);
- cluster.getMulticast().mcastControl(ClusterConnectionDeliverCloseBody(), self);
- }
- }
- catch (const std::exception& e) {
- QPID_LOG(error, cluster << " error closing connection " << *this << ": " << e.what());
- }
-}
-
-// Self-delivery of close message, close the connection.
-void Connection::deliverClose () {
- assert(!catchUp);
- connection.closed();
- cluster.erase(self);
-}
-
-// Member of a shadow connection left the cluster.
-void Connection::left() {
- assert(isShadow());
- connection.closed();
-}
-
-// Decode data from local clients.
-size_t Connection::decode(const char* buffer, size_t size) {
- if (catchUp) { // Handle catch-up locally.
- Buffer buf(const_cast<char*>(buffer), size);
- while (localDecoder.decode(buf))
- received(localDecoder.frame);
- }
- else { // Multicast local connections.
- assert(isLocal());
- cluster.getMulticast().mcastBuffer(buffer, size, self);
- }
- return size;
-}
-
-void Connection::deliverBuffer(Buffer& buf) {
- assert(!catchUp);
- ++deliverSeq;
- while (mcastDecoder.decode(buf))
- delivered(mcastDecoder.frame);
- if (cluster.getReadMax())
- output.giveReadCredit(1);
-}
-
-broker::SessionState& Connection::sessionState() {
- return *connection.getChannel(currentChannel).getSession();
-}
-
-broker::SemanticState& Connection::semanticState() {
- return sessionState().getSemanticState();
-}
-
-void Connection::consumerState(const string& name, bool blocked, bool notifyEnabled) {
- broker::SemanticState::ConsumerImpl& c = semanticState().find(name);
- c.setBlocked(blocked);
- if (notifyEnabled) c.enableNotify(); else c.disableNotify();
-}
-
-void Connection::sessionState(
- const SequenceNumber& replayStart,
- const SequenceNumber& sendCommandPoint,
- const SequenceSet& sentIncomplete,
- const SequenceNumber& expected,
- const SequenceNumber& received,
- const SequenceSet& unknownCompleted,
- const SequenceSet& receivedIncomplete)
-{
- sessionState().setState(
- replayStart,
- sendCommandPoint,
- sentIncomplete,
- expected,
- received,
- unknownCompleted,
- receivedIncomplete);
- QPID_LOG(debug, cluster << " received session state dump for " << sessionState().getId());
-}
-
-void Connection::shadowReady(uint64_t memberId, uint64_t connectionId) {
- ConnectionId shadow = ConnectionId(memberId, connectionId);
- QPID_LOG(debug, cluster << " catch-up connection " << *this << " becomes shadow " << shadow);
- self = shadow;
-}
-
-void Connection::membership(const FieldTable& newbies, const FieldTable& members) {
- QPID_LOG(debug, cluster << " incoming dump complete on connection " << *this);
- cluster.dumpInDone(ClusterMap(newbies, members));
- self.second = 0; // Mark this as completed dump connection.
-}
-
-bool Connection::isLocal() const {
- return self.first == cluster.getId() && self.second == this;
-}
-
-bool Connection::isShadow() const {
- return self.first != cluster.getId();
-}
-
-bool Connection::isDumped() const {
- return self.first == cluster.getId() && self.second == 0;
-}
-
-
-shared_ptr<broker::Queue> Connection::findQueue(const std::string& qname) {
- shared_ptr<broker::Queue> queue = cluster.getBroker().getQueues().find(qname);
- if (!queue) throw Exception(QPID_MSG(cluster << " can't find queue " << qname));
- return queue;
-}
-
-broker::QueuedMessage Connection::getDumpMessage() {
- broker::QueuedMessage m = findQueue(DumpClient::DUMP)->get();
- if (!m.payload) throw Exception(QPID_MSG(cluster << " empty dump queue"));
- return m;
-}
-
-void Connection::deliveryRecord(const string& qname,
- const SequenceNumber& position,
- const string& tag,
- const SequenceNumber& id,
- bool acquired,
- bool accepted,
- bool cancelled,
- bool completed,
- bool ended,
- bool windowing,
- uint32_t credit)
-{
- broker::QueuedMessage m;
- broker::Queue::shared_ptr queue = findQueue(qname);
- if (!ended) { // Has a message
- if (acquired) // Message is on the dump queue
- m = getDumpMessage();
- else // Message at original position in original queue
- m = queue->find(position);
- if (!m.payload)
- throw Exception(QPID_MSG("deliveryRecord no dump message"));
- }
-
- broker::DeliveryRecord dr(m, queue, tag, acquired, accepted, windowing, credit);
- dr.setId(id);
- if (cancelled) dr.cancel(dr.getTag());
- if (completed) dr.complete();
- if (ended) dr.setEnded(); // Exsitance of message
- semanticState().record(dr); // Part of the session's unacked list.
-}
-
-void Connection::queuePosition(const string& qname, const SequenceNumber& position) {
- shared_ptr<broker::Queue> q = cluster.getBroker().getQueues().find(qname);
- if (!q) throw InvalidArgumentException(QPID_MSG("Invalid queue name " << qname));
- q->setPosition(position);
-}
-
-std::ostream& operator<<(std::ostream& o, const Connection& c) {
- const char* type="unknown";
- if (c.isLocal()) type = "local";
- else if (c.isShadow()) type = "shadow";
- else if (c.isDumped()) type = "dumped";
- return o << c.getId() << "(" << type << (c.isCatchUp() ? ",catchup" : "") << ")";
-}
-
-void Connection::txStart() {
- txBuffer = make_shared_ptr(new broker::TxBuffer());
-}
-void Connection::txAccept(const framing::SequenceSet& acked) {
- txBuffer->enlist(make_shared_ptr(new broker::TxAccept(acked, semanticState().getUnacked())));
-}
-
-void Connection::txDequeue(const std::string& queue) {
- txBuffer->enlist(make_shared_ptr(new broker::RecoveredDequeue(findQueue(queue), getDumpMessage().payload)));
-}
-
-void Connection::txEnqueue(const std::string& queue) {
- txBuffer->enlist(make_shared_ptr(new broker::RecoveredEnqueue(findQueue(queue), getDumpMessage().payload)));
-}
-
-void Connection::txPublish(const framing::Array& queues, bool delivered) {
- boost::shared_ptr<broker::TxPublish> txPub(new broker::TxPublish(getDumpMessage().payload));
- for (framing::Array::const_iterator i = queues.begin(); i != queues.end(); ++i)
- txPub->deliverTo(findQueue((*i)->get<std::string>()));
- txPub->delivered = delivered;
- txBuffer->enlist(txPub);
-}
-
-void Connection::txEnd() {
- semanticState().setTxBuffer(txBuffer);
-}
-
-void Connection::accumulatedAck(const qpid::framing::SequenceSet& s) {
- semanticState().setAccumulatedAck(s);
-}
-
-void Connection::exchange(const std::string& encoded) {
- Buffer buf(const_cast<char*>(encoded.data()), encoded.size());
- broker::Exchange::shared_ptr ex = broker::Exchange::decode(cluster.getBroker().getExchanges(), buf);
- QPID_LOG(debug, cluster << " decoded exchange " << ex->getName());
-}
-
-void Connection::queue(const std::string& encoded) {
- Buffer buf(const_cast<char*>(encoded.data()), encoded.size());
- broker::Queue::shared_ptr q = broker::Queue::decode(cluster.getBroker().getQueues(), buf);
- QPID_LOG(debug, cluster << " decoded queue " << q->getName());
-}
-
-}} // namespace qpid::cluster
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Connection.h b/M4-RCs/qpid/cpp/src/qpid/cluster/Connection.h
deleted file mode 100644
index 29e42ce534..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Connection.h
+++ /dev/null
@@ -1,177 +0,0 @@
-#ifndef QPID_CLUSTER_CONNECTION_H
-#define QPID_CLUSTER_CONNECTION_H
-
-/*
- *
- * 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 "types.h"
-#include "WriteEstimate.h"
-#include "OutputInterceptor.h"
-#include "NoOpConnectionOutputHandler.h"
-
-#include "qpid/broker/Connection.h"
-#include "qpid/amqp_0_10/Connection.h"
-#include "qpid/sys/ConnectionInputHandler.h"
-#include "qpid/sys/ConnectionOutputHandler.h"
-#include "qpid/framing/FrameDecoder.h"
-#include "qpid/framing/SequenceNumber.h"
-
-#include <iosfwd>
-
-namespace qpid {
-
-namespace framing { class AMQFrame; }
-
-namespace broker {
-class SemanticState;
-class QueuedMessage;
-class TxBuffer;
-class TxAccept;
-}
-
-namespace cluster {
-class Cluster;
-
-/** Intercept broker::Connection calls for shadow and local cluster connections. */
-class Connection :
- public RefCounted,
- public sys::ConnectionInputHandler,
- public framing::AMQP_AllOperations::ClusterConnectionHandler
-
-{
- public:
- /** Local connection, use this in ConnectionId */
- Connection(Cluster&, sys::ConnectionOutputHandler& out, const std::string& id, MemberId, bool catchUp);
- /** Shadow connection */
- Connection(Cluster&, sys::ConnectionOutputHandler& out, const std::string& id, ConnectionId);
- ~Connection();
-
- ConnectionId getId() const { return self; }
- broker::Connection& getBrokerConnection() { return connection; }
-
- /** True for connections from direct clients of local broker */
- bool isLocal() const;
-
- /** True for connections that are shadowing remote broker connections */
- bool isShadow() const;
-
- /** True if the connection is in "catch-up" mode: building initial broker state. */
- bool isCatchUp() const { return catchUp; }
-
- /** True if the connection is a completed shared dump connection */
- bool isDumped() const;
-
- Cluster& getCluster() { return cluster; }
-
- // ConnectionInputHandler methods
- void received(framing::AMQFrame&);
- void closed();
- bool doOutput();
- bool hasOutput() { return connection.hasOutput(); }
- void idleOut() { connection.idleOut(); }
- void idleIn() { connection.idleIn(); }
-
- /** Called if the connectors member has left the cluster */
- void left();
-
- // ConnectionCodec methods
- size_t decode(const char* buffer, size_t size);
-
- // Called for data delivered from the cluster.
- void deliverBuffer(framing::Buffer&);
- void delivered(framing::AMQFrame&);
-
- void consumerState(const std::string& name, bool blocked, bool notifyEnabled);
-
- // ==== Used in catch-up mode to build initial state.
- //
- // State dump methods.
- void sessionState(const framing::SequenceNumber& replayStart,
- const framing::SequenceNumber& sendCommandPoint,
- const framing::SequenceSet& sentIncomplete,
- const framing::SequenceNumber& expected,
- const framing::SequenceNumber& received,
- const framing::SequenceSet& unknownCompleted, const SequenceSet& receivedIncomplete);
-
- void shadowReady(uint64_t memberId, uint64_t connectionId);
-
- void membership(const framing::FieldTable&, const framing::FieldTable&);
-
- void deliveryRecord(const std::string& queue,
- const framing::SequenceNumber& position,
- const std::string& tag,
- const framing::SequenceNumber& id,
- bool acquired,
- bool accepted,
- bool cancelled,
- bool completed,
- bool ended,
- bool windowing,
- uint32_t credit);
-
- void queuePosition(const std::string&, const framing::SequenceNumber&);
-
- void txStart();
- void txAccept(const framing::SequenceSet&);
- void txDequeue(const std::string&);
- void txEnqueue(const std::string&);
- void txPublish(const qpid::framing::Array&, bool);
- void txEnd();
- void accumulatedAck(const qpid::framing::SequenceSet&);
-
- // Encoded queue/exchange replication.
- void queue(const std::string& encoded);
- void exchange(const std::string& encoded);
-
- private:
- void init();
- bool checkUnsupported(const framing::AMQBody& body);
- void deliverClose();
- void deliverDoOutput(uint32_t requested);
- void sendDoOutput();
-
- boost::shared_ptr<broker::Queue> findQueue(const std::string& qname);
- broker::SessionState& sessionState();
- broker::SemanticState& semanticState();
- broker::QueuedMessage getDumpMessage();
-
- static NoOpConnectionOutputHandler discardHandler;
-
- Cluster& cluster;
- ConnectionId self;
- bool catchUp;
- WriteEstimate writeEstimate;
- OutputInterceptor output;
- framing::FrameDecoder localDecoder;
- framing::FrameDecoder mcastDecoder;
- broker::Connection connection;
- framing::SequenceNumber deliverSeq;
- framing::ChannelId currentChannel;
- boost::shared_ptr<broker::TxBuffer> txBuffer;
-
- int FIXMEcredit; // FIXME aconway 2008-12-05: remove
-
- friend std::ostream& operator<<(std::ostream&, const Connection&);
-};
-
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_CONNECTION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp
deleted file mode 100644
index 44e40f0591..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionCodec.cpp
+++ /dev/null
@@ -1,82 +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 "ConnectionCodec.h"
-#include "Connection.h"
-#include "Cluster.h"
-#include "ProxyInputHandler.h"
-#include "qpid/broker/Connection.h"
-#include "qpid/framing/ConnectionCloseBody.h"
-#include "qpid/framing/ConnectionCloseOkBody.h"
-#include "qpid/log/Statement.h"
-#include "qpid/memory.h"
-#include <stdexcept>
-#include <boost/utility/in_place_factory.hpp>
-
-namespace qpid {
-namespace cluster {
-
-using namespace framing;
-
-sys::ConnectionCodec*
-ConnectionCodec::Factory::create(ProtocolVersion v, sys::OutputControl& out, const std::string& id) {
- if (v == ProtocolVersion(0, 10))
- return new ConnectionCodec(out, id, cluster, false);
- else if (v == ProtocolVersion(0x80 + 0, 0x80 + 10))
- return new ConnectionCodec(out, id, cluster, true); // Catch-up connection
- return 0;
-}
-
-// Used for outgoing Link connections, we don't care.
-sys::ConnectionCodec*
-ConnectionCodec::Factory::create(sys::OutputControl& out, const std::string& id) {
- return next->create(out, id);
-}
-
-ConnectionCodec::ConnectionCodec(sys::OutputControl& out, const std::string& id, Cluster& cluster, bool catchUp)
- : codec(out, id, false),
- interceptor(new Connection(cluster, codec, id, cluster.getId(), catchUp)),
- id(interceptor->getId()),
- localId(id)
-{
- std::auto_ptr<sys::ConnectionInputHandler> ih(new ProxyInputHandler(interceptor));
- codec.setInputHandler(ih);
- if (!catchUp) // Don't put catchUp connections in the cluster map.
- cluster.insert(interceptor);
-}
-
-ConnectionCodec::~ConnectionCodec() {}
-
-size_t ConnectionCodec::decode(const char* buffer, size_t size) {
- QPID_LOG(trace, "RECVB [" << localId << "]: " << size << " bytes");
- return interceptor->decode(buffer, size);
-}
-
-bool ConnectionCodec::isClosed() const { return codec.isClosed(); }
-
-size_t ConnectionCodec::encode(const char* buffer, size_t size) { return codec.encode(buffer, size); }
-
-bool ConnectionCodec::canEncode() { return codec.canEncode(); }
-
-void ConnectionCodec::closed() { codec.closed(); }
-
-ProtocolVersion ConnectionCodec::getVersion() const { return codec.getVersion(); }
-
-}} // namespace qpid::cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionCodec.h b/M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionCodec.h
deleted file mode 100644
index 86fac270fa..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionCodec.h
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef QPID_CLUSTER_CONNCTIONCODEC_H
-#define QPID_CLUSTER_CONNCTIONCODEC_H
-
-/*
- *
- * 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 "qpid/amqp_0_10/Connection.h"
-#include "qpid/cluster/Connection.h"
-#include <boost/shared_ptr.hpp>
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
-
-namespace broker {
-class Connection;
-}
-
-namespace cluster {
-class Cluster;
-
-/**
- * Encapsulates the standard amqp_0_10::ConnectionCodec and sets up
- * a cluster::Connection for the connection.
- *
- * The ConnectionCodec is deleted by the network layer when the
- * connection closes. The cluster::Connection needs to be kept
- * around until all cluster business on the connection is complete.
- *
- */
-class ConnectionCodec : public sys::ConnectionCodec {
- public:
- struct Factory : public sys::ConnectionCodec::Factory {
- boost::shared_ptr<sys::ConnectionCodec::Factory> next;
- Cluster& cluster;
- Factory(boost::shared_ptr<sys::ConnectionCodec::Factory> f, Cluster& c)
- : next(f), cluster(c) {}
- sys::ConnectionCodec* create(framing::ProtocolVersion, sys::OutputControl&, const std::string& id);
- sys::ConnectionCodec* create(sys::OutputControl&, const std::string& id);
- };
-
- ConnectionCodec(sys::OutputControl& out, const std::string& id, Cluster& c, bool catchUp);
- ~ConnectionCodec();
-
- // ConnectionCodec functions.
- size_t decode(const char* buffer, size_t size);
- size_t encode(const char* buffer, size_t size);
- bool canEncode();
- void closed();
- bool isClosed() const;
- framing::ProtocolVersion getVersion() const;
-
-
- private:
- amqp_0_10::Connection codec;
- boost::intrusive_ptr<cluster::Connection> interceptor;
- cluster::ConnectionId id;
- std::string localId;
-};
-
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_CONNCTIONCODEC_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionMap.h b/M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionMap.h
deleted file mode 100644
index f1862e2e75..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/ConnectionMap.h
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef QPID_CLUSTER_CONNECTIONMAP_H
-#define QPID_CLUSTER_CONNECTIONMAP_H
-
-/*
- *
- * 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 "types.h"
-#include "Connection.h"
-#include "ClusterMap.h"
-#include "qpid/sys/Mutex.h"
-#include <boost/intrusive_ptr.hpp>
-#include <map>
-
-namespace qpid {
-namespace cluster {
-
-/**
- * Thread safe map of connections.
- */
-class ConnectionMap
-{
- public:
- typedef boost::intrusive_ptr<cluster::Connection> ConnectionPtr;
- typedef std::vector<ConnectionPtr> Vector;
-
- void insert(ConnectionId id, ConnectionPtr p) {
- ScopedLock l(lock);
- map.insert(Map::value_type(id,p));
- }
-
- void erase(ConnectionId id) {
- ScopedLock l(lock);
- map.erase(id);
- }
-
- ConnectionPtr find(ConnectionId id) const {
- ScopedLock l(lock);
- Map::const_iterator i = map.find(id);
- return i == map.end() ? ConnectionPtr() : i->second;
- }
-
- Vector values() const {
- Vector result(map.size());
- std::transform(map.begin(), map.end(), result.begin(),
- boost::bind(&Map::value_type::second, _1));
- return result;
- }
-
- void update(MemberId myId, const ClusterMap& cluster) {
- for (Map::iterator i = map.begin(); i != map.end(); ) {
- MemberId member = i->first.getMember();
- if (member != myId && !cluster.isMember(member)) {
- i->second->left();
- map.erase(i++);
- } else {
- i++;
- }
- }
- }
-
- size_t size() const { return map.size(); }
- private:
- typedef std::map<ConnectionId, ConnectionPtr> Map;
- typedef sys::Mutex::ScopedLock ScopedLock;
-
- mutable sys::Mutex lock;
- Map map;
-};
-
-
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_CONNECTIONMAP_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Cpg.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/Cpg.cpp
deleted file mode 100644
index 48c3b483f9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Cpg.cpp
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Cpg.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/posix/PrivatePosix.h"
-#include "qpid/log/Statement.h"
-
-#include <vector>
-#include <limits>
-#include <iterator>
-
-#include <unistd.h>
-
-namespace qpid {
-namespace cluster {
-
-using namespace std;
-
-Cpg* Cpg::cpgFromHandle(cpg_handle_t handle) {
- void* cpg=0;
- check(cpg_context_get(handle, &cpg), "Cannot get CPG instance.");
- if (!cpg) throw Exception("Cannot get CPG instance.");
- return reinterpret_cast<Cpg*>(cpg);
-}
-
-// Global callback functions.
-void Cpg::globalDeliver (
- cpg_handle_t handle,
- struct cpg_name *group,
- uint32_t nodeid,
- uint32_t pid,
- void* msg,
- int msg_len)
-{
- cpgFromHandle(handle)->handler.deliver(handle, group, nodeid, pid, msg, msg_len);
-}
-
-void Cpg::globalConfigChange(
- cpg_handle_t handle,
- struct cpg_name *group,
- struct cpg_address *members, int nMembers,
- struct cpg_address *left, int nLeft,
- struct cpg_address *joined, int nJoined
-)
-{
- cpgFromHandle(handle)->handler.configChange(handle, group, members, nMembers, left, nLeft, joined, nJoined);
-}
-
-int Cpg::getFd() {
- int fd;
- check(cpg_fd_get(handle, &fd), "Cannot get CPG file descriptor");
- return fd;
-}
-
-Cpg::Cpg(Handler& h) : IOHandle(new sys::IOHandlePrivate), handler(h), isShutdown(false) {
- cpg_callbacks_t callbacks;
- ::memset(&callbacks, sizeof(callbacks), 0);
- callbacks.cpg_deliver_fn = &globalDeliver;
- callbacks.cpg_confchg_fn = &globalConfigChange;
- check(cpg_initialize(&handle, &callbacks), "Cannot initialize CPG");
- check(cpg_context_set(handle, this), "Cannot set CPG context");
- // Note: CPG is currently unix-specific. If CPG is ported to
- // windows then this needs to be refactored into
- // qpid::sys::<platform>
- IOHandle::impl->fd = getFd();
- QPID_LOG(debug, "Initialized CPG handle 0x" << std::hex << handle);
-}
-
-Cpg::~Cpg() {
- try {
- shutdown();
- } catch (const std::exception& e) {
- QPID_LOG(error, "Exception in Cpg destructor: " << e.what());
- }
-}
-
-void Cpg::join(const std::string& name) {
- group = name;
- check(cpg_join(handle, &group), cantJoinMsg(group));
-}
-
-void Cpg::leave() {
- check(cpg_leave(handle, &group), cantLeaveMsg(group));
-}
-
-bool Cpg::isFlowControlEnabled() {
- cpg_flow_control_state_t flowState;
- check(cpg_flow_control_state_get(handle, &flowState), "Cannot get CPG flow control status.");
- return flowState == CPG_FLOW_CONTROL_ENABLED;
-}
-
-bool Cpg::mcast(const iovec* iov, int iovLen) {
- if (isFlowControlEnabled()) {
- QPID_LOG(warning, "CPG flow control enabled")
- return false;
- }
- cpg_error_t result;
- do {
- result = cpg_mcast_joined(handle, CPG_TYPE_AGREED, const_cast<iovec*>(iov), iovLen);
- if (result != CPG_ERR_TRY_AGAIN) check(result, cantMcastMsg(group));
- } while(result == CPG_ERR_TRY_AGAIN);
- return true;
-}
-
-void Cpg::shutdown() {
- if (!isShutdown) {
- QPID_LOG(debug,"Shutting down CPG");
- isShutdown=true;
- check(cpg_finalize(handle), "Error in shutdown of CPG");
- }
-}
-
-void Cpg::dispatch(cpg_dispatch_t type) {
- check(cpg_dispatch(handle,type), "Error in CPG dispatch");
-}
-
-string Cpg::errorStr(cpg_error_t err, const std::string& msg) {
- switch (err) {
- case CPG_OK: return msg+": ok";
- case CPG_ERR_LIBRARY: return msg+": library error";
- case CPG_ERR_TIMEOUT: return msg+": timeout";
- case CPG_ERR_TRY_AGAIN: return msg+": timeout. The aisexec daemon may not be running";
- case CPG_ERR_INVALID_PARAM: return msg+": invalid param";
- case CPG_ERR_NO_MEMORY: return msg+": no memory";
- case CPG_ERR_BAD_HANDLE: return msg+": bad handle";
- case CPG_ERR_ACCESS: return msg+": access denied.";
- case CPG_ERR_NOT_EXIST: return msg+": not exist";
- case CPG_ERR_EXIST: return msg+": exist";
- case CPG_ERR_NOT_SUPPORTED: return msg+": not supported";
- case CPG_ERR_SECURITY: return msg+": security";
- case CPG_ERR_TOO_MANY_GROUPS: return msg+": too many groups";
- default:
- assert(0);
- return ": unknown";
- };
-}
-
-std::string Cpg::cantJoinMsg(const Name& group) {
- return "Cannot join CPG group "+group.str();
-}
-
-std::string Cpg::cantLeaveMsg(const Name& group) {
- return "Cannot leave CPG group "+group.str();
-}
-
-std::string Cpg::cantMcastMsg(const Name& group) {
- return "Cannot mcast to CPG group "+group.str();
-}
-
-MemberId Cpg::self() const {
- unsigned int nodeid;
- check(cpg_local_get(handle, &nodeid), "Cannot get local CPG identity");
- return MemberId(nodeid, getpid());
-}
-
-namespace { int byte(uint32_t value, int i) { return (value >> (i*8)) & 0xff; } }
-
-ostream& operator <<(ostream& out, const MemberId& id) {
- out << byte(id.first, 0) << "."
- << byte(id.first, 1) << "."
- << byte(id.first, 2) << "."
- << byte(id.first, 3);
- return out << ":" << id.second;
-}
-
-ostream& operator<<(ostream& o, const ConnectionId& c) {
- return o << c.first << "-" << c.second;
-}
-
-std::string MemberId::str() const {
- char s[8];
- reinterpret_cast<uint32_t&>(s[0]) = htonl(first);
- reinterpret_cast<uint32_t&>(s[4]) = htonl(second);
- return std::string(s,8);
-}
-
-MemberId::MemberId(const std::string& s) {
- first = ntohl(reinterpret_cast<const uint32_t&>(s[0]));
- second = ntohl(reinterpret_cast<const uint32_t&>(s[4]));
-}
-}} // namespace qpid::cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Cpg.h b/M4-RCs/qpid/cpp/src/qpid/cluster/Cpg.h
deleted file mode 100644
index 5de2b516d5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Cpg.h
+++ /dev/null
@@ -1,169 +0,0 @@
-#ifndef CPG_H
-#define CPG_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/Exception.h"
-#include "qpid/cluster/Dispatchable.h"
-#include "qpid/cluster/types.h"
-#include "qpid/sys/IOHandle.h"
-#include "qpid/sys/Mutex.h"
-
-#include <boost/scoped_ptr.hpp>
-
-#include <cassert>
-#include <string.h>
-
-namespace qpid {
-namespace cluster {
-
-/**
- * Lightweight C++ interface to cpg.h operations.
- *
- * Manages a single CPG handle, initialized in ctor, finialzed in destructor.
- * On error all functions throw Cpg::Exception.
- *
- */
-class Cpg : public sys::IOHandle {
- public:
- struct Exception : public ::qpid::Exception {
- Exception(const std::string& msg) : ::qpid::Exception(msg) {}
- };
-
- struct Name : public cpg_name {
- Name() { length = 0; }
- Name(const char* s) { copy(s, strlen(s)); }
- Name(const char* s, size_t n) { copy(s,n); }
- Name(const std::string& s) { copy(s.data(), s.size()); }
- void copy(const char* s, size_t n) {
- assert(n < CPG_MAX_NAME_LENGTH);
- memcpy(value, s, n);
- length=n;
- }
-
- std::string str() const { return std::string(value, length); }
- };
-
- static std::string str(const cpg_name& n) {
- return std::string(n.value, n.length);
- }
-
- struct Handler {
- virtual ~Handler() {};
- virtual void deliver(
- cpg_handle_t /*handle*/,
- struct cpg_name *group,
- uint32_t /*nodeid*/,
- uint32_t /*pid*/,
- void* /*msg*/,
- int /*msg_len*/) = 0;
-
- virtual void configChange(
- cpg_handle_t /*handle*/,
- struct cpg_name */*group*/,
- struct cpg_address */*members*/, int /*nMembers*/,
- struct cpg_address */*left*/, int /*nLeft*/,
- struct cpg_address */*joined*/, int /*nJoined*/
- ) = 0;
- };
-
- /** Open a CPG handle.
- *@param handler for CPG events.
- */
- Cpg(Handler&);
-
- /** Destructor calls shutdown if not already calledx. */
- ~Cpg();
-
- /** Disconnect from CPG */
- void shutdown();
-
- /** Dispatch CPG events.
- *@param type one of
- * - CPG_DISPATCH_ONE - dispatch exactly one event.
- * - CPG_DISPATCH_ALL - dispatch all available events, don't wait.
- * - CPG_DISPATCH_BLOCKING - blocking dispatch loop.
- */
- void dispatch(cpg_dispatch_t type);
-
- void dispatchOne() { dispatch(CPG_DISPATCH_ONE); }
- void dispatchAll() { dispatch(CPG_DISPATCH_ALL); }
- void dispatchBlocking() { dispatch(CPG_DISPATCH_BLOCKING); }
-
- void join(const std::string& group);
- void leave();
-
- /** Multicast to the group. NB: must not be called concurrently.
- *
- *@return true if the message was multi-cast, false if
- * it was not sent due to flow control.
- */
- bool mcast(const iovec* iov, int iovLen);
-
- cpg_handle_t getHandle() const { return handle; }
-
- MemberId self() const;
-
- int getFd();
-
- bool isFlowControlEnabled();
-
- private:
- static std::string errorStr(cpg_error_t err, const std::string& msg);
- static std::string cantJoinMsg(const Name&);
- static std::string cantLeaveMsg(const Name&);
- static std::string cantMcastMsg(const Name&);
-
- static void check(cpg_error_t result, const std::string& msg) {
- if (result != CPG_OK) throw Exception(errorStr(result, msg));
- }
-
- static Cpg* cpgFromHandle(cpg_handle_t);
-
- static void globalDeliver(
- cpg_handle_t handle,
- struct cpg_name *group,
- uint32_t nodeid,
- uint32_t pid,
- void* msg,
- int msg_len);
-
- static void globalConfigChange(
- cpg_handle_t handle,
- struct cpg_name *group,
- struct cpg_address *members, int nMembers,
- struct cpg_address *left, int nLeft,
- struct cpg_address *joined, int nJoined
- );
-
- cpg_handle_t handle;
- Handler& handler;
- bool isShutdown;
- Name group;
- sys::Mutex dispatchLock;
-};
-
-inline bool operator==(const cpg_name& a, const cpg_name& b) {
- return a.length==b.length && strncmp(a.value, b.value, a.length) == 0;
-}
-inline bool operator!=(const cpg_name& a, const cpg_name& b) { return !(a == b); }
-
-}} // namespace qpid::cluster
-
-#endif /*!CPG_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Dispatchable.h b/M4-RCs/qpid/cpp/src/qpid/cluster/Dispatchable.h
deleted file mode 100644
index e7f0df4218..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Dispatchable.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef QPID_CLUSTER_DISPATCHABLE_H
-#define QPID_CLUSTER_DISPATCHABLE_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-namespace qpid {
-namespace cluster {
-
-/**
- * Interface for classes that have some "events" that need dispatching
- * in a thread.
- */
-class Dispatchable
-{
- public:
- virtual ~Dispatchable() {}
-
- /** Dispatch one event in current thread. */
- virtual void dispatchOne() = 0;
- /** Dispatch all available events, don't block. */
- virtual void dispatchAll() = 0;
- /** Blocking loop to dispatch cluster events */
- virtual void dispatchBlocking() = 0;
-
- /** Wait for at least one event, then dispatch all available events.
- * Don't block. Useful for tests.
- */
- virtual void dispatchSome() { dispatchOne(); dispatchAll(); }
-
-};
-
-}} // namespace qpid::cluster
-
-
-
-#endif /*!QPID_CLUSTER_DISPATCHABLE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/DumpClient.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/DumpClient.cpp
deleted file mode 100644
index 3f3212470d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/DumpClient.cpp
+++ /dev/null
@@ -1,369 +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 "DumpClient.h"
-#include "Cluster.h"
-#include "ClusterMap.h"
-#include "Connection.h"
-#include "qpid/client/SessionBase_0_10Access.h"
-#include "qpid/client/ConnectionAccess.h"
-#include "qpid/broker/Broker.h"
-#include "qpid/broker/Queue.h"
-#include "qpid/broker/QueueRegistry.h"
-#include "qpid/broker/Message.h"
-#include "qpid/broker/Exchange.h"
-#include "qpid/broker/ExchangeRegistry.h"
-#include "qpid/broker/SessionHandler.h"
-#include "qpid/broker/SessionState.h"
-#include "qpid/broker/TxOpVisitor.h"
-#include "qpid/broker/DtxAck.h"
-#include "qpid/broker/TxAccept.h"
-#include "qpid/broker/TxPublish.h"
-#include "qpid/broker/RecoveredDequeue.h"
-#include "qpid/broker/RecoveredEnqueue.h"
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/framing/ClusterConnectionMembershipBody.h"
-#include "qpid/framing/ClusterConnectionShadowReadyBody.h"
-#include "qpid/framing/ClusterConnectionSessionStateBody.h"
-#include "qpid/framing/ClusterConnectionConsumerStateBody.h"
-#include "qpid/framing/enum.h"
-#include "qpid/framing/ProtocolVersion.h"
-#include "qpid/framing/TypeCode.h"
-#include "qpid/log/Statement.h"
-#include "qpid/Url.h"
-#include <boost/bind.hpp>
-#include <algorithm>
-
-namespace qpid {
-namespace cluster {
-
-using broker::Broker;
-using broker::Exchange;
-using broker::Queue;
-using broker::QueueBinding;
-using broker::Message;
-using namespace framing;
-namespace arg=client::arg;
-using client::SessionBase_0_10Access;
-
-struct ClusterConnectionProxy : public AMQP_AllProxy::ClusterConnection {
- ClusterConnectionProxy(client::Connection c) :
- AMQP_AllProxy::ClusterConnection(*client::ConnectionAccess::getImpl(c)) {}
- ClusterConnectionProxy(client::AsyncSession s) :
- AMQP_AllProxy::ClusterConnection(SessionBase_0_10Access(s).get()->out) {}
-};
-
-// Create a connection with special version that marks it as a catch-up connection.
-client::Connection catchUpConnection() {
- client::Connection c;
- client::ConnectionAccess::setVersion(c, ProtocolVersion(0x80 , 0x80 + 10));
- return c;
-}
-
-// Send a control body directly to the session.
-void send(client::AsyncSession& s, const AMQBody& body) {
- client::SessionBase_0_10Access sb(s);
- sb.get()->send(body);
-}
-
-// TODO aconway 2008-09-24: optimization: dump connections/sessions in parallel.
-
-DumpClient::DumpClient(const MemberId& dumper, const MemberId& dumpee, const Url& url,
- broker::Broker& broker, const ClusterMap& m, const Cluster::Connections& cons,
- const boost::function<void()>& ok,
- const boost::function<void(const std::exception&)>& fail)
- : dumperId(dumper), dumpeeId(dumpee), dumpeeUrl(url), dumperBroker(broker), map(m), connections(cons),
- connection(catchUpConnection()), shadowConnection(catchUpConnection()),
- done(ok), failed(fail)
-{
- connection.open(url);
- session = connection.newSession("dump_shared");
-}
-
-DumpClient::~DumpClient() {}
-
-// Illegal exchange/queue name for catch-up, avoid clashes with user queues/exchanges.
-static const char DUMP_CHARS[] = "\000qpid-dump";
-const std::string DumpClient::DUMP(DUMP_CHARS, sizeof(DUMP_CHARS));
-
-void DumpClient::dump() {
- QPID_LOG(debug, dumperId << " dumping state to " << dumpeeId << " at " << dumpeeUrl);
- Broker& b = dumperBroker;
- b.getExchanges().eachExchange(boost::bind(&DumpClient::dumpExchange, this, _1));
-
- // Dump exchange is used to route messages to the proper queue without modifying routing key.
- session.exchangeDeclare(arg::exchange=DUMP, arg::type="fanout", arg::autoDelete=true);
- b.getQueues().eachQueue(boost::bind(&DumpClient::dumpQueue, this, _1));
- // Dump queue is used to transfer acquired messages that are no longer on their original queue.
- session.queueDeclare(arg::queue=DUMP, arg::autoDelete=true);
- session.sync();
- session.close();
-
- std::for_each(connections.begin(), connections.end(), boost::bind(&DumpClient::dumpConnection, this, _1));
- AMQFrame frame(map.asMethodBody());
- client::ConnectionAccess::getImpl(connection)->handle(frame);
- connection.close();
- QPID_LOG(debug, dumperId << " dumped state to " << dumpeeId << " at " << dumpeeUrl);
-}
-
-void DumpClient::run() {
- try {
- dump();
- done();
- } catch (const std::exception& e) {
- failed(e);
- }
- delete this;
-}
-
-namespace {
-template <class T> std::string encode(const T& t) {
- std::string encoded;
- encoded.resize(t.encodedSize());
- framing::Buffer buf(const_cast<char*>(encoded.data()), encoded.size());
- t.encode(buf);
- return encoded;
-}
-} // namespace
-
-void DumpClient::dumpExchange(const boost::shared_ptr<Exchange>& ex) {
- QPID_LOG(debug, dumperId << " dumping exchange " << ex->getName());
- ClusterConnectionProxy proxy(session);
- proxy.exchange(encode(*ex));
-}
-
-/** Bind a queue to the dump exchange and dump messges to it
- * setting the message possition as needed.
- */
-class MessageDumper {
- std::string queue;
- bool haveLastPos;
- framing::SequenceNumber lastPos;
- client::AsyncSession session;
-
- public:
-
- MessageDumper(const string& q, const client::AsyncSession s) : queue(q), haveLastPos(false), session(s) {
- session.exchangeBind(queue, DumpClient::DUMP);
- }
-
- ~MessageDumper() {
- session.exchangeUnbind(queue, DumpClient::DUMP);
- }
-
- void dumpQueuedMessage(const broker::QueuedMessage& message) {
- if (!haveLastPos || message.position - lastPos != 1) {
- ClusterConnectionProxy(session).queuePosition(queue, message.position.getValue()-1);
- haveLastPos = true;
- }
- lastPos = message.position;
- SessionBase_0_10Access sb(session);
- framing::MessageTransferBody transfer(
- framing::ProtocolVersion(), DumpClient::DUMP, message::ACCEPT_MODE_NONE, message::ACQUIRE_MODE_PRE_ACQUIRED);
- sb.get()->send(transfer, message.payload->getFrames());
- }
-
- void dumpMessage(const boost::intrusive_ptr<broker::Message>& message) {
- dumpQueuedMessage(broker::QueuedMessage(0, message, haveLastPos? lastPos.getValue()+1 : 1));
- }
-};
-
-
-void DumpClient::dumpQueue(const boost::shared_ptr<Queue>& q) {
- QPID_LOG(debug, dumperId << " dumping queue " << q->getName());
- ClusterConnectionProxy proxy(session);
- proxy.queue(encode(*q));
- MessageDumper dumper(q->getName(), session);
- q->eachMessage(boost::bind(&MessageDumper::dumpQueuedMessage, &dumper, _1));
- q->eachBinding(boost::bind(&DumpClient::dumpBinding, this, q->getName(), _1));
-}
-
-
-void DumpClient::dumpBinding(const std::string& queue, const QueueBinding& binding) {
- session.exchangeBind(queue, binding.exchange, binding.key, binding.args);
-}
-
-void DumpClient::dumpConnection(const boost::intrusive_ptr<Connection>& dumpConnection) {
- QPID_LOG(debug, dumperId << " dumping connection " << *dumpConnection);
- shadowConnection = catchUpConnection();
-
- broker::Connection& bc = dumpConnection->getBrokerConnection();
- // FIXME aconway 2008-10-20: What authentication info to use on reconnect?
- shadowConnection.open(dumpeeUrl, bc.getUserId(), ""/*password*/, "/"/*vhost*/, bc.getFrameMax());
- bc.eachSessionHandler(boost::bind(&DumpClient::dumpSession, this, _1));
- ClusterConnectionProxy(shadowConnection).shadowReady(
- dumpConnection->getId().getMember(),
- reinterpret_cast<uint64_t>(dumpConnection->getId().getPointer()));
- shadowConnection.close();
- QPID_LOG(debug, dumperId << " dumped connection " << *dumpConnection);
-}
-
-void DumpClient::dumpSession(broker::SessionHandler& sh) {
- QPID_LOG(debug, dumperId << " dumping session " << &sh.getConnection() << "[" << sh.getChannel() << "] = "
- << sh.getSession()->getId());
- broker::SessionState* ss = sh.getSession();
- if (!ss) return; // no session.
-
- // Create a client session to dump session state.
- boost::shared_ptr<client::ConnectionImpl> cimpl = client::ConnectionAccess::getImpl(shadowConnection);
- boost::shared_ptr<client::SessionImpl> simpl = cimpl->newSession(ss->getId().getName(), ss->getTimeout(), sh.getChannel());
- client::SessionBase_0_10Access(shadowSession).set(simpl);
- AMQP_AllProxy::ClusterConnection proxy(simpl->out);
-
- // Re-create session state on remote connection.
-
- // Dump consumers. For reasons unknown, boost::bind does not work here with boost 1.33.
- QPID_LOG(debug, dumperId << " dumping consumers.");
- ss->getSemanticState().eachConsumer(std::bind1st(std::mem_fun(&DumpClient::dumpConsumer),this));
-
- QPID_LOG(debug, dumperId << " dumping unacknowledged messages.");
- broker::DeliveryRecords& drs = ss->getSemanticState().getUnacked();
- std::for_each(drs.begin(), drs.end(), boost::bind(&DumpClient::dumpUnacked, this, _1));
-
- dumpTxState(ss->getSemanticState()); // Tx transaction state.
-
- // Adjust for command counter for message in progress, will be sent after state update.
- boost::intrusive_ptr<Message> inProgress = ss->getMessageInProgress();
- SequenceNumber received = ss->receiverGetReceived().command;
- if (inProgress)
- --received;
-
- // Reset command-sequence state.
- proxy.sessionState(
- ss->senderGetReplayPoint().command,
- ss->senderGetCommandPoint().command,
- ss->senderGetIncomplete(),
- std::max(received, ss->receiverGetExpected().command),
- received,
- ss->receiverGetUnknownComplete(),
- ss->receiverGetIncomplete()
- );
-
- // Send frames for partial message in progress.
- if (inProgress) {
- inProgress->getFrames().map(simpl->out);
- }
-
- // FIXME aconway 2008-09-23: update session replay list.
-
- QPID_LOG(debug, dumperId << " dumped session " << sh.getSession()->getId());
-}
-
-void DumpClient::dumpConsumer(const broker::SemanticState::ConsumerImpl* ci) {
- QPID_LOG(debug, dumperId << " dumping consumer " << ci->getName() << " on " << shadowSession.getId());
- using namespace message;
- shadowSession.messageSubscribe(
- arg::queue = ci->getQueue()->getName(),
- arg::destination = ci->getName(),
- arg::acceptMode = ci->isAckExpected() ? ACCEPT_MODE_EXPLICIT : ACCEPT_MODE_NONE,
- arg::acquireMode = ci->isAcquire() ? ACQUIRE_MODE_PRE_ACQUIRED : ACQUIRE_MODE_NOT_ACQUIRED,
- arg::exclusive = ci->isExclusive(),
- arg::resumeId = ci->getResumeId(),
- arg::resumeTtl = ci->getResumeTtl(),
- arg::arguments = ci->getArguments()
- );
- shadowSession.messageSetFlowMode(ci->getName(), ci->isWindowing() ? FLOW_MODE_WINDOW : FLOW_MODE_CREDIT);
- shadowSession.messageFlow(ci->getName(), CREDIT_UNIT_MESSAGE, ci->getMsgCredit());
- shadowSession.messageFlow(ci->getName(), CREDIT_UNIT_BYTE, ci->getByteCredit());
- ClusterConnectionConsumerStateBody state(
- ProtocolVersion(),
- ci->getName(),
- ci->isBlocked(),
- ci->isNotifyEnabled()
- );
- client::SessionBase_0_10Access(shadowSession).get()->send(state);
- QPID_LOG(debug, dumperId << " dumped consumer " << ci->getName() << " on " << shadowSession.getId());
-}
-
-void DumpClient::dumpUnacked(const broker::DeliveryRecord& dr) {
- if (!dr.isEnded() && dr.isAcquired() && dr.getMessage().payload) {
- // If the message is acquired then it is no longer on the
- // dumpees queue, put it on the dump queue for dumpee to pick up.
- //
- MessageDumper(DUMP, shadowSession).dumpQueuedMessage(dr.getMessage());
- }
- ClusterConnectionProxy(shadowSession).deliveryRecord(
- dr.getQueue()->getName(),
- dr.getMessage().position,
- dr.getTag(),
- dr.getId(),
- dr.isAcquired(),
- dr.isAccepted(),
- dr.isCancelled(),
- dr.isComplete(),
- dr.isEnded(),
- dr.isWindowing(),
- dr.getCredit()
- );
-}
-
-class TxOpDumper : public broker::TxOpConstVisitor, public MessageDumper {
- public:
- TxOpDumper(DumpClient& dc, client::AsyncSession s)
- : MessageDumper(DumpClient::DUMP, s), parent(dc), session(s), proxy(s) {}
-
- void operator()(const broker::DtxAck& ) {
- throw InternalErrorException("DTX transactions not currently supported by cluster.");
- }
-
- void operator()(const broker::RecoveredDequeue& rdeq) {
- dumpMessage(rdeq.getMessage());
- proxy.txEnqueue(rdeq.getQueue()->getName());
- }
-
- void operator()(const broker::RecoveredEnqueue& renq) {
- dumpMessage(renq.getMessage());
- proxy.txEnqueue(renq.getQueue()->getName());
- }
-
- void operator()(const broker::TxAccept& txAccept) {
- proxy.txAccept(txAccept.getAcked());
- }
-
- void operator()(const broker::TxPublish& txPub) {
- dumpMessage(txPub.getMessage());
- typedef std::list<Queue::shared_ptr> QueueList;
- const QueueList& qlist = txPub.getQueues();
- Array qarray(TYPE_CODE_STR8);
- for (QueueList::const_iterator i = qlist.begin(); i != qlist.end(); ++i)
- qarray.push_back(Array::ValuePtr(new Str8Value((*i)->getName())));
- proxy.txPublish(qarray, txPub.delivered);
- }
-
- private:
- DumpClient& parent;
- client::AsyncSession session;
- ClusterConnectionProxy proxy;
-};
-
-void DumpClient::dumpTxState(broker::SemanticState& s) {
- QPID_LOG(debug, dumperId << " dumping TX transaction state.");
- ClusterConnectionProxy proxy(shadowSession);
- proxy.accumulatedAck(s.getAccumulatedAck());
- broker::TxBuffer::shared_ptr txBuffer = s.getTxBuffer();
- if (txBuffer) {
- proxy.txStart();
- TxOpDumper dumper(*this, shadowSession);
- txBuffer->accept(dumper);
- proxy.txEnd();
- }
-}
-
-}} // namespace qpid::cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/DumpClient.h b/M4-RCs/qpid/cpp/src/qpid/cluster/DumpClient.h
deleted file mode 100644
index 23676e7646..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/DumpClient.h
+++ /dev/null
@@ -1,101 +0,0 @@
-#ifndef QPID_CLUSTER_DUMPCLIENT_H
-#define QPID_CLUSTER_DUMPCLIENT_H
-
-/*
- *
- * 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 "ClusterMap.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/broker/SemanticState.h"
-#include "qpid/sys/Runnable.h"
-#include <boost/shared_ptr.hpp>
-
-
-namespace qpid {
-
-class Url;
-
-namespace broker {
-
-class Broker;
-class Queue;
-class Exchange;
-class QueueBindings;
-class QueueBinding;
-class QueuedMessage;
-class SessionHandler;
-class DeliveryRecord;
-class SessionState;
-class SemanticState;
-
-} // namespace broker
-
-namespace cluster {
-
-class Cluster;
-class Connection;
-class ClusterMap;
-
-/**
- * A client that dumps the contents of a local broker to a remote one using AMQP.
- */
-class DumpClient : public sys::Runnable {
- public:
- static const std::string DUMP; // Name for special dump queue and exchange.
-
- DumpClient(const MemberId& dumper, const MemberId& dumpee, const Url&,
- broker::Broker& donor, const ClusterMap& map, const std::vector<boost::intrusive_ptr<Connection> >& ,
- const boost::function<void()>& done,
- const boost::function<void(const std::exception&)>& fail);
-
- ~DumpClient();
- void dump();
- void run(); // Will delete this when finished.
-
- void dumpUnacked(const broker::DeliveryRecord&);
-
- private:
- void dumpQueue(const boost::shared_ptr<broker::Queue>&);
- void dumpExchange(const boost::shared_ptr<broker::Exchange>&);
- void dumpMessage(const broker::QueuedMessage&);
- void dumpMessageTo(const broker::QueuedMessage&, const std::string& queue, client::Session s);
- void dumpBinding(const std::string& queue, const broker::QueueBinding& binding);
- void dumpConnection(const boost::intrusive_ptr<Connection>& connection);
- void dumpSession(broker::SessionHandler& s);
- void dumpTxState(broker::SemanticState& s);
- void dumpConsumer(const broker::SemanticState::ConsumerImpl*);
-
- MemberId dumperId;
- MemberId dumpeeId;
- Url dumpeeUrl;
- broker::Broker& dumperBroker;
- ClusterMap map;
- std::vector<boost::intrusive_ptr<Connection> > connections;
- client::Connection connection, shadowConnection;
- client::AsyncSession session, shadowSession;
- boost::function<void()> done;
- boost::function<void(const std::exception& e)> failed;
-};
-
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_DUMPCLIENT_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Event.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/Event.cpp
deleted file mode 100644
index cfa8fe05f1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Event.cpp
+++ /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.
- *
- */
-#include "types.h"
-#include "Event.h"
-#include "Cpg.h"
-#include "qpid/framing/Buffer.h"
-#include "qpid/framing/AMQFrame.h"
-#include <ostream>
-#include <iterator>
-#include <algorithm>
-
-namespace qpid {
-namespace cluster {
-
-using framing::Buffer;
-
-const size_t Event::HEADER_SIZE =
- sizeof(uint8_t) + // type
- sizeof(uint64_t) + // connection pointer only, CPG provides member ID.
- sizeof(uint32_t); // payload size
-
-Event::Event(EventType t, const ConnectionId& c, size_t s)
- : type(t), connectionId(c), size(s), store(RefCountedBuffer::create(s+HEADER_SIZE)) {
- encodeHeader();
-}
-
-Event Event::decode(const MemberId& m, framing::Buffer& buf) {
- if (buf.available() <= HEADER_SIZE)
- throw ClusterLeaveException("Not enough for multicast header");
- EventType type((EventType)buf.getOctet());
- if(type != DATA && type != CONTROL)
- throw ClusterLeaveException("Invalid multicast event type");
- ConnectionId connection(m, reinterpret_cast<Connection*>(buf.getLongLong()));
- uint32_t size = buf.getLong();
- Event e(type, connection, size);
- if (buf.available() < size)
- throw ClusterLeaveException("Not enough data for multicast event");
- memcpy(e.getData(), buf.getPointer() + buf.getPosition(), size);
- return e;
-}
-
-Event Event::control(const framing::AMQBody& body, const ConnectionId& cid) {
- framing::AMQFrame f(body);
- Event e(CONTROL, cid, f.encodedSize());
- Buffer buf(e);
- f.encode(buf);
- return e;
-}
-
-void Event::encodeHeader () {
- Buffer b(getStore(), HEADER_SIZE);
- b.putOctet(type);
- b.putLongLong(reinterpret_cast<uint64_t>(connectionId.getPointer()));
- b.putLong(size);
- assert(b.getPosition() == HEADER_SIZE);
-}
-
-Event::operator Buffer() const {
- return Buffer(const_cast<char*>(getData()), getSize());
-}
-
-static const char* EVENT_TYPE_NAMES[] = { "data", "control" };
-
-std::ostream& operator << (std::ostream& o, const Event& e) {
- o << "[event " << e.getConnectionId()
- << " " << EVENT_TYPE_NAMES[e.getType()]
- << " " << e.getSize() << " bytes]";
- return o;
-}
-
-}} // namespace qpid::cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Event.h b/M4-RCs/qpid/cpp/src/qpid/cluster/Event.h
deleted file mode 100644
index 427410923b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Event.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#ifndef QPID_CLUSTER_EVENT_H
-#define QPID_CLUSTER_EVENT_H
-
-/*
- *
- * 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 "types.h"
-#include "Cpg.h"
-#include "Connection.h"
-#include "qpid/RefCountedBuffer.h"
-#include "qpid/framing/Buffer.h"
-#include <iosfwd>
-
-namespace qpid {
-namespace cluster {
-
-// TODO aconway 2008-09-03: more efficient solution for shared
-// byte-stream data.
-//
-
-/**
- * Events are sent to/received from the cluster.
- * Refcounted so they can be stored on queues.
- */
-class Event {
- public:
- /** Create an event with a buffer that can hold size bytes plus an event header. */
- Event(EventType t=DATA, const ConnectionId& c=ConnectionId(), size_t size=0);
-
- /** Create an event copied from delivered data. */
- static Event decode(const MemberId& m, framing::Buffer&);
-
- /** Create an event containing a control */
- static Event control(const framing::AMQBody&, const ConnectionId&);
-
- EventType getType() const { return type; }
- ConnectionId getConnectionId() const { return connectionId; }
- MemberId getMemberId() const { return connectionId.getMember(); }
- size_t getSize() const { return size; }
-
- // Data excluding header.
- char* getData() { return store + HEADER_SIZE; }
- const char* getData() const { return store + HEADER_SIZE; }
-
- // Store including header
- char* getStore() { return store; }
- const char* getStore() const { return store; }
- size_t getStoreSize() { return size + HEADER_SIZE; }
-
- bool isCluster() const { return connectionId.getPointer() == 0; }
- bool isConnection() const { return connectionId.getPointer() != 0; }
-
- operator framing::Buffer() const;
-
- private:
- static const size_t HEADER_SIZE;
-
- void encodeHeader();
-
- EventType type;
- ConnectionId connectionId;
- size_t size;
- RefCountedBuffer::pointer store;
-};
-
-std::ostream& operator << (std::ostream&, const Event&);
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_EVENT_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/FailoverExchange.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/FailoverExchange.cpp
deleted file mode 100644
index abc7f5df6f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/FailoverExchange.cpp
+++ /dev/null
@@ -1,99 +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 "FailoverExchange.h"
-#include "qpid/broker/Message.h"
-#include "qpid/broker/DeliverableMessage.h"
-#include "qpid/broker/Queue.h"
-#include "qpid/framing/MessageProperties.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/AMQHeaderBody.h"
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/log/Statement.h"
-#include "qpid/framing/Array.h"
-#include <boost/bind.hpp>
-#include <algorithm>
-
-namespace qpid {
-namespace cluster {
-using namespace std;
-
-using namespace broker;
-using namespace framing;
-
-const string FailoverExchange::TYPE_NAME("amq.failover");
-
-FailoverExchange::FailoverExchange(management::Manageable* parent) : Exchange(TYPE_NAME, parent) {
- if (mgmtExchange != 0)
- mgmtExchange->set_type(TYPE_NAME);
-}
-
-
-void FailoverExchange::setUrls(const vector<Url>& u) {
- Lock l(lock);
- urls=u;
- if (urls.empty()) return;
- std::for_each(queues.begin(), queues.end(),
- boost::bind(&FailoverExchange::sendUpdate, this, _1));
-}
-
-string FailoverExchange::getType() const { return TYPE_NAME; }
-
-bool FailoverExchange::bind(Queue::shared_ptr queue, const string&, const framing::FieldTable*) {
- Lock l(lock);
- sendUpdate(queue);
- return queues.insert(queue).second;
-}
-
-bool FailoverExchange::unbind(Queue::shared_ptr queue, const string&, const framing::FieldTable*) {
- Lock l(lock);
- return queues.erase(queue);
-}
-
-bool FailoverExchange::isBound(Queue::shared_ptr queue, const string* const, const framing::FieldTable*) {
- Lock l(lock);
- return queues.find(queue) != queues.end();
-}
-
-void FailoverExchange::route(Deliverable&, const string& , const framing::FieldTable* ) {
- QPID_LOG(warning, "Message received by exchange " << TYPE_NAME << " ignoring");
-}
-
-void FailoverExchange::sendUpdate(const Queue::shared_ptr& queue) {
- // Called with lock held.
- if (urls.empty()) return;
- framing::Array array(0x95); // FIXME aconway 2008-10-06: Array is unusable like this. Need type constants or better mapping.
- for (Urls::const_iterator i = urls.begin(); i != urls.end(); ++i)
- array.add(boost::shared_ptr<Str16Value>(new Str16Value(i->str())));
- const ProtocolVersion v;
- boost::intrusive_ptr<Message> msg(new Message);
- AMQFrame command(MessageTransferBody(v, TYPE_NAME, 1, 0));
- command.setLastSegment(false);
- msg->getFrames().append(command);
- AMQHeaderBody header;
- header.get<MessageProperties>(true)->setContentLength(0);
- header.get<MessageProperties>(true)->getApplicationHeaders().setArray(TYPE_NAME, array);
- AMQFrame headerFrame(header);
- headerFrame.setFirstSegment(false);
- msg->getFrames().append(headerFrame);
- DeliverableMessage(msg).deliverTo(queue);
-}
-
-}} // namespace cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/FailoverExchange.h b/M4-RCs/qpid/cpp/src/qpid/cluster/FailoverExchange.h
deleted file mode 100644
index 738cd2a602..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/FailoverExchange.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef QPID_CLUSTER_FAILOVEREXCHANGE_H
-#define QPID_CLUSTER_FAILOVEREXCHANGE_H
-
-/*
- *
- * 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 "qpid/broker/Exchange.h"
-#include "qpid/broker/DeliverableMessage.h"
-#include "qpid/Url.h"
-
-#include <vector>
-#include <set>
-
-namespace qpid {
-namespace cluster {
-
-/**
- * Failover exchange provides failover host list, as specified in AMQP 0-10.
- */
-class FailoverExchange : public broker::Exchange
-{
- public:
- static const std::string TYPE_NAME;
-
- FailoverExchange(management::Manageable* parent);
-
- void setUrls(const std::vector<Url>&);
-
- // Exchange overrides
- std::string getType() const;
- bool bind(broker::Queue::shared_ptr queue, const std::string& routingKey, const framing::FieldTable* args);
- bool unbind(broker::Queue::shared_ptr queue, const std::string& routingKey, const framing::FieldTable* args);
- bool isBound(broker::Queue::shared_ptr queue, const std::string* const routingKey, const framing::FieldTable* const args);
- void route(broker::Deliverable& msg, const std::string& routingKey, const framing::FieldTable* args);
-
- private:
- void sendUpdate(const broker::Queue::shared_ptr&);
-
- typedef sys::Mutex::ScopedLock Lock;
- typedef std::vector<Url> Urls;
- typedef std::set<broker::Queue::shared_ptr> Queues;
-
- sys::Mutex lock;
- Urls urls;
- Queues queues;
-
-};
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_FAILOVEREXCHANGE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Multicaster.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/Multicaster.cpp
deleted file mode 100644
index 37d2f81b39..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Multicaster.cpp
+++ /dev/null
@@ -1,84 +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 "Multicaster.h"
-#include "Cpg.h"
-#include "ClusterLeaveException.h"
-#include "qpid/log/Statement.h"
-
-
-namespace qpid {
-namespace cluster {
-
-Multicaster::Multicaster(Cpg& cpg_, const boost::shared_ptr<sys::Poller>& poller) :
- cpg(cpg_), queue(boost::bind(&Multicaster::sendMcast, this, _1), poller),
- holding(true)
-{
- queue.start();
-}
-
-void Multicaster::mcastControl(const framing::AMQBody& body, const ConnectionId& id) {
- mcast(Event::control(body, id));
-}
-
-void Multicaster::mcastBuffer(const char* data, size_t size, const ConnectionId& id) {
- Event e(DATA, id, size);
- memcpy(e.getData(), data, size);
- mcast(e);
-}
-
-void Multicaster::mcast(const Event& e) {
- {
- sys::Mutex::ScopedLock l(lock);
- if (e.getType() == DATA && e.isConnection() && holding) {
- holdingQueue.push_back(e);
- QPID_LOG(trace, " MCAST held: " << e );
- return;
- }
- }
- queue.push(e);
-}
-
-
-void Multicaster::sendMcast(PollableEventQueue::Queue& values) {
- try {
- PollableEventQueue::Queue::iterator i = values.begin();
- while( i != values.end()) {
- iovec iov = { const_cast<char*>(i->getStore()), i->getStoreSize() };
- if (!cpg.mcast(&iov, 1)) break; // returns false for flow control
- QPID_LOG(trace, " MCAST " << *i);
- ++i;
- }
- values.erase(values.begin(), i);
- }
- catch (const std::exception& e) {
- throw ClusterLeaveException(e.what());
- }
-}
-
-void Multicaster::release() {
- sys::Mutex::ScopedLock l(lock);
- holding = false;
- std::for_each(holdingQueue.begin(), holdingQueue.end(), boost::bind(&Multicaster::mcast, this, _1));
- holdingQueue.clear();
-}
-
-}} // namespace qpid::cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Multicaster.h b/M4-RCs/qpid/cpp/src/qpid/cluster/Multicaster.h
deleted file mode 100644
index 8b306ce10e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Multicaster.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef QPID_CLUSTER_MULTICASTER_H
-#define QPID_CLUSTER_MULTICASTER_H
-
-/*
- *
- * 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 "types.h"
-#include "Event.h"
-#include "qpid/sys/PollableQueue.h"
-#include "qpid/sys/Mutex.h"
-#include <boost/shared_ptr.hpp>
-#include <sys/uio.h> // For iovec
-
-namespace qpid {
-
-namespace sys {
-class Poller;
-}
-
-namespace cluster {
-
-class Cpg;
-
-/**
- * Multicast to the cluster. Shared, thread safe object.
- */
-class Multicaster
-{
- public:
- /** Starts in holding mode: connection data events are held, other events are mcast */
- Multicaster(Cpg& cpg_, const boost::shared_ptr<sys::Poller>& );
- void mcastControl(const framing::AMQBody& controlBody, const ConnectionId&);
- void mcastBuffer(const char*, size_t, const ConnectionId&);
- void mcast(const Event& e);
- /** End holding mode, held events are mcast */
- void release();
-
- private:
- typedef sys::PollableQueue<Event> PollableEventQueue;
- typedef std::deque<Event> PlainEventQueue;
-
- void sendMcast(PollableEventQueue::Queue& );
-
- sys::Mutex lock;
- Cpg& cpg;
- PollableEventQueue queue;
- bool holding;
- PlainEventQueue holdingQueue;
- std::vector<struct ::iovec> ioVector;
-};
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_MULTICASTER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/NoOpConnectionOutputHandler.h b/M4-RCs/qpid/cpp/src/qpid/cluster/NoOpConnectionOutputHandler.h
deleted file mode 100644
index 74a376a657..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/NoOpConnectionOutputHandler.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef QPID_CLUSTER_NOOPCONNECTIONOUTPUTHANDLER_H
-#define QPID_CLUSTER_NOOPCONNECTIONOUTPUTHANDLER_H
-
-/*
- *
- * 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 <qpid/sys/ConnectionOutputHandler.h>
-
-namespace qpid {
-
-namespace framing { class AMQFrame; }
-
-namespace cluster {
-
-/**
- * Output handler for frames sent to noop connections.
- * Simply discards frames.
- */
-class NoOpConnectionOutputHandler : public sys::ConnectionOutputHandler
-{
- public:
- virtual void send(framing::AMQFrame&) {}
- virtual void close() {}
- virtual void activateOutput() {}
- virtual void giveReadCredit(int32_t) {}
-};
-
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_NOOPCONNECTIONOUTPUTHANDLER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp
deleted file mode 100644
index 075023caea..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/OutputInterceptor.cpp
+++ /dev/null
@@ -1,121 +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 "OutputInterceptor.h"
-#include "Connection.h"
-#include "Cluster.h"
-#include "qpid/framing/ClusterConnectionDeliverDoOutputBody.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/log/Statement.h"
-#include <boost/current_function.hpp>
-
-
-namespace qpid {
-namespace cluster {
-
-using namespace framing;
-
-OutputInterceptor::OutputInterceptor(
- cluster::Connection& p, sys::ConnectionOutputHandler& h)
- : parent(p), next(&h), sent(), writeEstimate(p.getCluster().getWriteEstimate()),
- moreOutput(), doingOutput()
-{}
-
-void OutputInterceptor::send(framing::AMQFrame& f) {
- parent.getCluster().checkQuorum();
- next->send(f);
- if (!parent.isCatchUp())
- sent += f.encodedSize();
-}
-
-void OutputInterceptor::activateOutput() {
- if (parent.isCatchUp())
- next->activateOutput();
- else {
- QPID_LOG(trace, parent << " activateOutput - sending doOutput");
- moreOutput = true;
- sendDoOutput();
- }
-}
-
-void OutputInterceptor::giveReadCredit(int32_t credit) { next->giveReadCredit(credit); }
-
-// Called in write thread when the IO layer has no more data to write.
-// We do nothing in the write thread, we run doOutput only on delivery
-// of doOutput requests.
-bool OutputInterceptor::doOutput() {
- QPID_LOG(trace, parent << " write idle.");
- return false;
-}
-
-// Delivery of doOutput allows us to run the real connection doOutput()
-// which tranfers frames to the codec for writing.
-//
-void OutputInterceptor::deliverDoOutput(size_t requested) {
- size_t buf = next->getBuffered();
- if (parent.isLocal())
- writeEstimate.delivered(requested, sent, buf); // Update the estimate.
-
- // Run the real doOutput() till we have added the requested data or there's nothing to output.
- sent = 0;
- do {
- moreOutput = parent.getBrokerConnection().doOutput();
- } while (sent < requested && moreOutput);
- sent += buf; // Include buffered data in the sent total.
-
- QPID_LOG(trace, "Delivered doOutput: requested=" << requested << " output=" << sent << " more=" << moreOutput);
-
- if (parent.isLocal() && moreOutput) {
- QPID_LOG(trace, parent << " deliverDoOutput - sending doOutput, more output available.");
- sendDoOutput();
- }
- else
- doingOutput = false;
-}
-
-// Send a doOutput request if one is not already in flight.
-void OutputInterceptor::sendDoOutput() {
- if (!parent.isLocal()) return;
-
- doingOutput = true;
- size_t request = writeEstimate.sending(getBuffered());
-
- // Note we may send 0 size request if there's more than 2*estimate in the buffer.
- // Send it anyway to keep the doOutput chain going until we are sure there's no more output
- // (in deliverDoOutput)
- //
- parent.getCluster().getMulticast().mcastControl(
- ClusterConnectionDeliverDoOutputBody(ProtocolVersion(), request), parent.getId());
- QPID_LOG(trace, parent << "Send doOutput request for " << request);
-}
-
-void OutputInterceptor::setOutputHandler(sys::ConnectionOutputHandler& h) {
- next = &h;
-}
-
-void OutputInterceptor::close() {
- next->close();
-}
-
-size_t OutputInterceptor::getBuffered() const {
- return next->getBuffered();
-}
-
-}} // namespace qpid::cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/OutputInterceptor.h b/M4-RCs/qpid/cpp/src/qpid/cluster/OutputInterceptor.h
deleted file mode 100644
index 0ac15e747a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/OutputInterceptor.h
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef QPID_CLUSTER_OUTPUTINTERCEPTOR_H
-#define QPID_CLUSTER_OUTPUTINTERCEPTOR_H
-
-/*
- *
- * 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 "WriteEstimate.h"
-#include "qpid/sys/ConnectionOutputHandler.h"
-#include "qpid/broker/ConnectionFactory.h"
-#include <boost/function.hpp>
-
-namespace qpid {
-namespace framing { class AMQFrame; }
-namespace cluster {
-
-class Connection;
-
-/**
- * Interceptor for connection OutputHandler, manages outgoing message replication.
- */
-class OutputInterceptor : public sys::ConnectionOutputHandler {
- public:
- OutputInterceptor(cluster::Connection& p, sys::ConnectionOutputHandler& h);
-
- // sys::ConnectionOutputHandler functions
- void send(framing::AMQFrame& f);
- void activateOutput();
- void giveReadCredit(int32_t);
- void close();
- size_t getBuffered() const;
-
- // Delivery point for doOutput requests.
- void deliverDoOutput(size_t requested);
- // Intercept doOutput requests on Connection.
- bool doOutput();
-
- void setOutputHandler(sys::ConnectionOutputHandler& h);
-
- cluster::Connection& parent;
-
- private:
- typedef sys::Mutex::ScopedLock Locker;
-
- void sendDoOutput();
-
- mutable sys::Mutex lock;
- sys::ConnectionOutputHandler* next;
- size_t sent;
- size_t lastDoOutput;
- WriteEstimate writeEstimate;
- bool moreOutput;
- bool doingOutput;
-};
-
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_OUTPUTINTERCEPTOR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/ProxyInputHandler.h b/M4-RCs/qpid/cpp/src/qpid/cluster/ProxyInputHandler.h
deleted file mode 100644
index 228f8d092d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/ProxyInputHandler.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef QPID_CLUSTER_PROXYINPUTHANDLER_H
-#define QPID_CLUSTER_PROXYINPUTHANDLER_H
-
-/*
- *
- * 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 "qpid/sys/ConnectionInputHandler.h"
-#include <boost/intrusive_ptr.hpp>
-
-namespace qpid {
-
-namespace framing { class AMQFrame; }
-
-namespace cluster {
-
-/**
- * Proxies ConnectionInputHandler functions and ensures target.closed()
- * is called, on deletion if not before.
- */
-class ProxyInputHandler : public sys::ConnectionInputHandler
-{
- public:
- ProxyInputHandler(boost::intrusive_ptr<cluster::Connection> t) : target(t) {}
- ~ProxyInputHandler() { closed(); }
-
- void received(framing::AMQFrame& f) { target->received(f); }
- void closed() { if (target) target->closed(); target = 0; }
- void idleOut() { target->idleOut(); }
- void idleIn() { target->idleIn(); }
- bool doOutput() { return target->doOutput(); }
- bool hasOutput() { return target->hasOutput(); }
-
- private:
- boost::intrusive_ptr<cluster::Connection> target;
-};
-
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_PROXYINPUTHANDLER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum.h b/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum.h
deleted file mode 100644
index f07b58dfa6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef QPID_CLUSTER_QUORUM_H
-#define QPID_CLUSTER_QUORUM_H
-
-/*
- *
- * 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 "config.h"
-
-#if HAVE_LIBCMAN
-#include "Quorum_cman.h"
-#else
-#include "Quorum_null.h"
-#endif
-
-#endif /*!QPID_CLUSTER_QUORUM_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_cman.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_cman.cpp
deleted file mode 100644
index d5df758b40..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_cman.cpp
+++ /dev/null
@@ -1,49 +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 "Quorum_cman.h"
-#include "qpid/log/Statement.h"
-#include "qpid/Options.h"
-#include "qpid/sys/Time.h"
-
-namespace qpid {
-namespace cluster {
-
-Quorum::Quorum() : enable(false), cman(0) {}
-
-Quorum::~Quorum() { if (cman) cman_finish(cman); }
-
-void Quorum::init() {
- QPID_LOG(info, "Waiting for cluster quorum");
- enable = true;
- cman = cman_init(0);
- if (cman == 0) throw ErrnoException("Can't connect to cman service");
- // FIXME aconway 2008-11-13: configure max wait.
- for (int retry = 0; !cman_is_quorate(cman) && retry < 30; retry++) {
- QPID_LOG(info, "Waiting for cluster quorum: " << sys::strError(errno));
- sys::sleep(1);
- }
- if (!cman_is_quorate(cman))
- throw ErrnoException("Timed out waiting for cluster quorum.");
-}
-
-bool Quorum::isQuorate() { return enable ? cman_is_quorate(cman) : true; }
-
-}} // namespace qpid::cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_cman.h b/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_cman.h
deleted file mode 100644
index d0f8b2c954..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_cman.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef QPID_CLUSTER_QUORUM_CMAN_H
-#define QPID_CLUSTER_QUORUM_CMAN_H
-
-/*
- *
- * 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.
- *
- */
-
-extern "C" {
-#include <libcman.h>
-}
-
-namespace qpid {
-
-class Options;
-
-namespace cluster {
-
-class Quorum {
- public:
- Quorum();
- ~Quorum();
- void init();
- bool isQuorate();
-
- private:
- bool enable;
- cman_handle_t cman;
-};
-
-
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_QUORUM_CMAN_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_null.h b/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_null.h
deleted file mode 100644
index cbb6c20708..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/Quorum_null.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#ifndef QPID_CLUSTER_QUORUM_NULL_H
-#define QPID_CLUSTER_QUORUM_NULL_H
-
-/*
- *
- * 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 qpid {
-namespace cluster {
-
-/** Null implementation of quorum. */
-
-class Quorum {
- public:
- void init() {}
- bool isQuorate() { return true; }
-};
-
-#endif /*!QPID_CLUSTER_QUORUM_NULL_H*/
-
-}} // namespace qpid::cluster
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/WriteEstimate.cpp b/M4-RCs/qpid/cpp/src/qpid/cluster/WriteEstimate.cpp
deleted file mode 100644
index 4d840947f3..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/WriteEstimate.cpp
+++ /dev/null
@@ -1,64 +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 "WriteEstimate.h"
-#include "qpid/log/Statement.h"
-#include <boost/current_function.hpp>
-
-namespace qpid {
-namespace cluster {
-
-WriteEstimate::WriteEstimate(size_t initial)
- : growing(true), estimate(initial), lastEstimate(initial) {}
-
-size_t WriteEstimate::sending(size_t buffered) {
- // We want to send a doOutput request for enough data such
- // that if estimate bytes are written before it is self
- // delivered then what is left in the buffer plus the doOutput
- // request will be estimate bytes.
-
- size_t predictLeft = (buffered > estimate) ? buffered - estimate : 0;
- size_t request = (estimate > predictLeft) ? estimate - predictLeft : 0;
- return request;
-}
-
-size_t pad(size_t value) { return value + value/2; }
-
-void WriteEstimate::delivered(size_t last, size_t sent, size_t buffered) {
- lastEstimate = last;
- size_t wrote = sent > buffered ? sent - buffered : 0;
- if (wrote == 0) // No change
- return;
- if (buffered > 0) { // Buffer was over-stocked, we wrote to capacity.
- growing = false;
- estimate = pad(wrote); // Estimate at 1.5 write for padding.
- }
- else if (wrote > estimate) { // Wrote everything, buffer was under-stocked
- if (growing)
- estimate = std::max(estimate*2, pad(wrote)); // Grow quickly if we have not yet seen an over-stock.
- else
- estimate = pad(wrote);
- }
-}
-
-}} // namespace qpid::cluster
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/WriteEstimate.h b/M4-RCs/qpid/cpp/src/qpid/cluster/WriteEstimate.h
deleted file mode 100644
index 97b1435fcc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/WriteEstimate.h
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef QPID_CLUSTER_WRITEESTIMATE_H
-#define QPID_CLUSTER_WRITEESTIMATE_H
-
-/*
- *
- * 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 "qpid/sys/Mutex.h"
-
-namespace qpid {
-namespace cluster {
-
-/**
- * Estimate the amount of data that a connection can write between sending
- * a doOutput notice and re-receiving it.
- *
- * The goal is to avoid ever write-idling the connection by sending
- * the next doOutput request as soon as we've processed the previous
- * one, such that data generated by the previous request will keep the
- * writer busy till the next one is delivered.
- *
- */
-class WriteEstimate
-{
- public:
- WriteEstimate(size_t initial=4096);
-
- /** About to send a doOutput request.
- * Update estimation state and return size for next request.
- */
- size_t sending(size_t buffered);
-
- /**
- * doOutput request just delivered, not yet executed. Update the estimate.
- * and estimate how much data to request in the next onOutput
- * request. 0 means don't send an onOutput request.
- *
- * @param delivered value in doOutput control.
- */
- void delivered(size_t delivered, size_t sent, size_t buffered);
-
- /** Last estimate delivered, i.e. known to cluster */
- size_t getLastEstimate() const { return estimate; }
-
- private:
- bool growing;
- size_t estimate, lastEstimate;
-};
-
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_WRITEESTIMATE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/management-schema.xml b/M4-RCs/qpid/cpp/src/qpid/cluster/management-schema.xml
deleted file mode 100644
index da19387cc6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/management-schema.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<schema package="org.apache.qpid.cluster">
-
- <!--
- 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.
- -->
-
- <!-- Type information:
-
-Numeric types with "_wm" suffix are watermarked numbers. These are compound
-values containing a current value, and a low and high water mark for the reporting
-interval. The low and high water marks are set to the current value at the
-beginning of each interval and track the minimum and maximum values of the statistic
-over the interval respectively.
-
-Access rights for configuration elements:
-
-RO => Read Only
-RC => Read/Create, can be set at create time only, read-only thereafter
-RW => Read/Write
-
-If access rights are omitted for a property, they are assumed to be RO.
-
- -->
-
- <class name="Cluster">
- <property name="brokerRef" type="objId" references="Broker" access="RC" index="y" parentRef="y"/>
- <property name="clusterName" type="sstr" access="RC" desc="Name of cluster this server is a member of"/>
- <property name="clusterID" type="sstr" access="RO" desc="Globally uniquie ID (UUID) for this cluster instance"/>
- <property name="publishedURL" type="sstr" access="RC" desc="URL this node advertizes itself as"/>
- <property name="clusterSize" type="uint16" access="RO" desc="Number of brokers currently in the cluster"/>
- <property name="status" type="sstr" access="RO" desc="Cluster node status (STALLED,ACTIVE,JOINING)"/>
- <property name="members" type="lstr" access="RO" desc="List of member URLs delimited by ';'"/>
-
- <method name="stopClusterNode"/>
- <method name="stopFullCluster"/>
-
- </class>
-
-
-
-</schema>
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/cluster/types.h b/M4-RCs/qpid/cpp/src/qpid/cluster/types.h
deleted file mode 100644
index 857b19cc8a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/cluster/types.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef QPID_CLUSTER_TYPES_H
-#define QPID_CLUSTER_TYPES_H
-
-/*
- *
- * 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 "ClusterLeaveException.h"
-#include "config.h"
-#include "qpid/Url.h"
-
-#include <utility>
-#include <iosfwd>
-#include <string>
-
-#include <stdint.h>
-
-extern "C" {
-#ifdef HAVE_OPENAIS_CPG_H
-#include <openais/cpg.h>
-#elif HAVE_COROSYNC_CPG_H
-# include <corosync/cpg.h>
-#else
-# error "No cpg.h header file available"
-#endif
-}
-
-namespace qpid {
-namespace cluster {
-
-class Connection;
-
-/** Types of cluster event. */
-enum EventType { DATA, CONTROL };
-
-/** first=node-id, second=pid */
-struct MemberId : std::pair<uint32_t, uint32_t> {
- explicit MemberId(uint64_t n) : std::pair<uint32_t,uint32_t>( n >> 32, n & 0xffffffff) {}
- explicit MemberId(uint32_t node=0, uint32_t pid=0) : std::pair<uint32_t,uint32_t>(node, pid) {}
- MemberId(const cpg_address& caddr) : std::pair<uint32_t,uint32_t>(caddr.nodeid, caddr.pid) {}
- MemberId(const std::string&); // Decode from string.
- uint32_t getNode() const { return first; }
- uint32_t getPid() const { return second; }
- operator uint64_t() const { return (uint64_t(first)<<32ull) + second; }
-
- // AsMethodBody as string, network byte order.
- std::string str() const;
-};
-
-inline bool operator==(const cpg_address& caddr, const MemberId& id) { return id == MemberId(caddr); }
-
-std::ostream& operator<<(std::ostream&, const MemberId&);
-
-struct ConnectionId : public std::pair<MemberId, Connection*> {
- ConnectionId(const MemberId& m=MemberId(), Connection* c=0) : std::pair<MemberId, Connection*> (m,c) {}
- ConnectionId(uint64_t m, uint64_t c)
- : std::pair<MemberId, Connection*>(MemberId(m), reinterpret_cast<Connection*>(c)) {}
- MemberId getMember() const { return first; }
- Connection* getPointer() const { return second; }
-};
-
-std::ostream& operator<<(std::ostream&, const ConnectionId&);
-
-}} // namespace qpid::cluster
-
-#endif /*!QPID_CLUSTER_TYPES_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Agent.cpp b/M4-RCs/qpid/cpp/src/qpid/console/Agent.cpp
deleted file mode 100644
index 8b5a8adbb4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Agent.cpp
+++ /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.
- *
- */
-
-#include "Agent.h"
-
-std::ostream& qpid::console::operator<<(std::ostream& o, const Agent& agent)
-{
- o << "Agent at bank " << agent.getBrokerBank() << "." << agent.getAgentBank() <<
- " (" << agent.getLabel() << ")";
- return o;
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Agent.h b/M4-RCs/qpid/cpp/src/qpid/console/Agent.h
deleted file mode 100644
index 3307a1b44b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Agent.h
+++ /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.
- *
- */
-#ifndef _QPID_CONSOLE_AGENT_H_
-#define _QPID_CONSOLE_AGENT_H_
-
-#include "Broker.h"
-
-namespace qpid {
-namespace console {
-
- /**
- *
- * \ingroup qmfconsoleapi
- */
- class Agent {
- public:
- typedef std::vector<Agent*> Vector;
-
- Agent(Broker* _broker, uint32_t _bank, const std::string& _label) :
- broker(_broker), brokerBank(broker->getBrokerBank()),
- agentBank(_bank), label(_label) {}
- Broker* getBroker() const { return broker; }
- uint32_t getBrokerBank() const { return brokerBank; }
- uint32_t getAgentBank() const { return agentBank; }
- const std::string& getLabel() const { return label; }
-
- private:
- Broker* broker;
- const uint32_t brokerBank;
- const uint32_t agentBank;
- const std::string label;
- };
-
- std::ostream& operator<<(std::ostream& o, const Agent& agent);
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Broker.cpp b/M4-RCs/qpid/cpp/src/qpid/console/Broker.cpp
deleted file mode 100644
index c6b1be1d31..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Broker.cpp
+++ /dev/null
@@ -1,300 +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 "Broker.h"
-#include "Object.h"
-#include "Value.h"
-#include "SessionManager.h"
-#include "ConsoleListener.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/SystemInfo.h"
-
-using namespace qpid::client;
-using namespace qpid::console;
-using namespace qpid::framing;
-using namespace qpid::sys;
-using namespace std;
-
-Broker::Broker(SessionManager& sm, ConnectionSettings& settings) :
- sessionManager(sm), connected(false), connectionSettings(settings),
- reqsOutstanding(1), syncInFlight(false), topicBound(false), methodObject(0),
- connThreadBody(*this), connThread(connThreadBody)
-{
- string osName;
- string nodeName;
- string release;
- string version;
- string machine;
-
- sys::SystemInfo::getSystemId(osName, nodeName, release, version, machine);
- uint32_t pid = sys::SystemInfo::getParentProcessId();
-
- stringstream text;
-
- text << "qmfc-cpp-" << nodeName << "-" << pid;
- amqpSessionId = string(text.str());
-
- QPID_LOG(debug, "Broker::Broker: constructed, amqpSessionId=" << amqpSessionId);
-}
-
-Broker::~Broker()
-{
-}
-
-string Broker::getUrl() const
-{
- stringstream url;
- url << connectionSettings.host << ":" << connectionSettings.port;
- return url.str();
-}
-
-void Broker::encodeHeader(framing::Buffer& buf, uint8_t opcode, uint32_t seq) const
-{
- buf.putOctet('A');
- buf.putOctet('M');
- buf.putOctet('2');
- buf.putOctet(opcode);
- buf.putLong (seq);
-}
-
-bool Broker::checkHeader(framing::Buffer& buf, uint8_t *opcode, uint32_t *seq) const
-{
- if (buf.getSize() < 8)
- return false;
-
- uint8_t h1 = buf.getOctet();
- uint8_t h2 = buf.getOctet();
- uint8_t h3 = buf.getOctet();
-
- *opcode = buf.getOctet();
- *seq = buf.getLong();
-
- return h1 == 'A' && h2 == 'M' && h3 == '2';
-}
-
-void Broker::received(client::Message& msg)
-{
- string data = msg.getData();
- Buffer inBuffer(const_cast<char*>(data.c_str()), data.size());
- uint8_t opcode;
- uint32_t sequence;
-
- if (checkHeader(inBuffer, &opcode, &sequence)) {
- QPID_LOG(trace, "Broker::received: opcode=" << opcode << " seq=" << sequence);
-
- if (opcode == 'b') sessionManager.handleBrokerResp(this, inBuffer, sequence);
- else if (opcode == 'p') sessionManager.handlePackageInd(this, inBuffer, sequence);
- else if (opcode == 'z') sessionManager.handleCommandComplete(this, inBuffer, sequence);
- else if (opcode == 'q') sessionManager.handleClassInd(this, inBuffer, sequence);
- else if (opcode == 'm') sessionManager.handleMethodResp(this, inBuffer, sequence);
- else if (opcode == 'h') sessionManager.handleHeartbeatInd(this, inBuffer, sequence);
- else if (opcode == 'e') sessionManager.handleEventInd(this, inBuffer, sequence);
- else if (opcode == 's') sessionManager.handleSchemaResp(this, inBuffer, sequence);
- else if (opcode == 'c') sessionManager.handleContentInd(this, inBuffer, sequence, true, false);
- else if (opcode == 'i') sessionManager.handleContentInd(this, inBuffer, sequence, false, true);
- else if (opcode == 'g') sessionManager.handleContentInd(this, inBuffer, sequence, true, true);
- }
-}
-
-void Broker::resetAgents()
-{
- for (AgentMap::iterator iter = agents.begin(); iter != agents.end(); iter++) {
- if (sessionManager.listener != 0)
- sessionManager.listener->delAgent(*(iter->second));
- delete iter->second;
- }
-
- agents.clear();
- agents[0x0000000100000000LL] = new Agent(this, 0, "BrokerAgent");
-}
-
-void Broker::updateAgent(const Object& object)
-{
- uint32_t brokerBank = object.attrUint("brokerBank");
- uint32_t agentBank = object.attrUint("agentBank");
- uint64_t agentKey = ((uint64_t) brokerBank << 32) | (uint64_t) agentBank;
- AgentMap::iterator iter = agents.find(agentKey);
-
- if (object.isDeleted()) {
- if (iter != agents.end()) {
- if (sessionManager.listener != 0)
- sessionManager.listener->delAgent(*(iter->second));
- delete iter->second;
- agents.erase(iter);
- }
- } else {
- if (iter == agents.end()) {
- Agent* agent = new Agent(this, agentBank, object.attrString("label"));
- agents[agentKey] = agent;
- if (sessionManager.listener != 0)
- sessionManager.listener->newAgent(*agent);
- }
- }
-}
-
-void Broker::ConnectionThread::run()
-{
- static const int delayMin(1);
- static const int delayMax(128);
- static const int delayFactor(2);
- int delay(delayMin);
- string dest("qmfc");
-
- sessionId.generate();
- queueName << "qmfc-" << sessionId;
-
- while (true) {
- try {
- broker.topicBound = false;
- broker.reqsOutstanding = 1;
- connection.open(broker.connectionSettings);
- session = connection.newSession(queueName.str());
- subscriptions = new client::SubscriptionManager(session);
-
- session.queueDeclare(arg::queue=queueName.str(), arg::autoDelete=true,
- arg::exclusive=true);
- session.exchangeBind(arg::exchange="amq.direct", arg::queue=queueName.str(),
- arg::bindingKey=queueName.str());
-
- subscriptions->setAcceptMode(ACCEPT_MODE_NONE);
- subscriptions->setAcquireMode(ACQUIRE_MODE_PRE_ACQUIRED);
- subscriptions->subscribe(broker, queueName.str(), dest);
- subscriptions->setFlowControl(dest, FlowControl::unlimited());
- {
- Mutex::ScopedLock _lock(connLock);
- operational = true;
- broker.resetAgents();
- broker.connected = true;
- broker.sessionManager.handleBrokerConnect(&broker);
- broker.sessionManager.startProtocol(&broker);
- try {
- Mutex::ScopedUnlock _unlock(connLock);
- subscriptions->run();
- } catch (std::exception) {}
-
- operational = false;
- broker.connected = false;
- broker.sessionManager.handleBrokerDisconnect(&broker);
- }
- delay = delayMin;
- delete subscriptions;
- subscriptions = 0;
- session.close();
- } catch (std::exception &e) {
- QPID_LOG(debug, " outer exception: " << e.what());
- if (delay < delayMax)
- delay *= delayFactor;
- }
-
- ::sleep(delay);
- }
-}
-
-Broker::ConnectionThread::~ConnectionThread()
-{
- if (subscriptions != 0) {
- delete subscriptions;
- }
-}
-
-void Broker::ConnectionThread::sendBuffer(Buffer& buf, uint32_t length,
- const string& exchange, const string& routingKey)
-{
- {
- Mutex::ScopedLock _lock(connLock);
- if (!operational)
- return;
- }
-
- client::Message msg;
- string data;
-
- buf.getRawData(data, length);
- msg.getDeliveryProperties().setRoutingKey(routingKey);
- msg.getMessageProperties().setReplyTo(ReplyTo("amq.direct", queueName.str()));
- msg.setData(data);
- try {
- session.messageTransfer(arg::content=msg, arg::destination=exchange);
- } catch(std::exception&) {}
-}
-
-void Broker::ConnectionThread::bindExchange(const std::string& exchange, const std::string& key)
-{
- {
- Mutex::ScopedLock _lock(connLock);
- if (!operational)
- return;
- }
-
- QPID_LOG(debug, "Broker::ConnectionThread::bindExchange: exchange=" << exchange << " key=" << key);
- session.exchangeBind(arg::exchange=exchange, arg::queue=queueName.str(),
- arg::bindingKey=key);
-}
-
-void Broker::waitForStable()
-{
- Mutex::ScopedLock l(lock);
- if (reqsOutstanding == 0)
- return;
- syncInFlight = true;
- while (reqsOutstanding != 0) {
- bool result = cond.wait(lock, AbsTime(now(), TIME_SEC * sessionManager.settings.getTimeout));
- if (!result)
- throw(Exception("Timed out waiting for broker to synchronize"));
- }
-}
-
-void Broker::incOutstanding()
-{
- Mutex::ScopedLock l(lock);
- reqsOutstanding++;
-}
-
-void Broker::decOutstanding()
-{
- Mutex::ScopedLock l(lock);
- reqsOutstanding--;
- if (reqsOutstanding == 0) {
- if (!topicBound) {
- topicBound = true;
- for (vector<string>::const_iterator iter = sessionManager.bindingKeyList.begin();
- iter != sessionManager.bindingKeyList.end(); iter++)
- connThreadBody.bindExchange("qpid.management", *iter);
- }
- if (syncInFlight) {
- syncInFlight = false;
- cond.notify();
- }
- }
-}
-
-void Broker::appendAgents(Agent::Vector& agentlist) const
-{
- for (AgentMap::const_iterator iter = agents.begin(); iter != agents.end(); iter++) {
- agentlist.push_back(iter->second);
- }
-}
-
-ostream& qpid::console::operator<<(ostream& o, const Broker& k)
-{
- o << "Broker: " << k.connectionSettings.host << ":" << k.connectionSettings.port;
- return o;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Broker.h b/M4-RCs/qpid/cpp/src/qpid/console/Broker.h
deleted file mode 100644
index 9df2380dff..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Broker.h
+++ /dev/null
@@ -1,130 +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.
- *
- */
-#ifndef _QPID_CONSOLE_BROKER_H_
-#define _QPID_CONSOLE_BROKER_H_
-
-#include "qpid/client/Connection.h"
-#include "qpid/client/ConnectionSettings.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/client/Session.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/MessageListener.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/sys/Runnable.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/Condition.h"
-#include "qpid/Url.h"
-#include "qpid/framing/Buffer.h"
-#include "qpid/framing/Uuid.h"
-#include <string>
-#include <iostream>
-
-namespace qpid {
-namespace console {
- class SessionManager;
- class Agent;
- class Object;
-
- /**
- *
- * \ingroup qpidconsoleapi
- */
- class Broker : public client::MessageListener {
- public:
- Broker(SessionManager& sm, client::ConnectionSettings& settings);
- ~Broker();
-
- bool isConnected() const { return connected; }
- const std::string& getError() const { return error; }
- const std::string& getSessionId() const { return amqpSessionId; }
- const framing::Uuid& getBrokerId() const { return brokerId; }
- uint32_t getBrokerBank() const { return 1; }
- void addBinding(const std::string& key) {
- connThreadBody.bindExchange("qpid.management", key);
- }
- std::string getUrl() const;
-
- private:
- friend class SessionManager;
- friend class Object;
- typedef std::map<uint64_t,Agent*> AgentMap;
- static const int SYNC_TIME = 60;
-
- SessionManager& sessionManager;
- AgentMap agents;
- client::SubscriptionManager* subscription;
- bool connected;
- std::string error;
- std::string amqpSessionId;
- client::ConnectionSettings connectionSettings;
- sys::Mutex lock;
- sys::Condition cond;
- framing::Uuid brokerId;
- uint32_t reqsOutstanding;
- bool syncInFlight;
- bool topicBound;
- Object* methodObject;
-
- friend class ConnectionThread;
- class ConnectionThread : public sys::Runnable {
- bool operational;
- Broker& broker;
- framing::Uuid sessionId;
- client::Connection connection;
- client::Session session;
- client::SubscriptionManager* subscriptions;
- std::stringstream queueName;
- sys::Mutex connLock;
- void run();
- public:
- ConnectionThread(Broker& _broker) :
- operational(false), broker(_broker), subscriptions(0) {}
- ~ConnectionThread();
- void sendBuffer(qpid::framing::Buffer& buf,
- uint32_t length,
- const std::string& exchange = "qpid.management",
- const std::string& routingKey = "broker");
- void bindExchange(const std::string& exchange, const std::string& key);
- };
-
- ConnectionThread connThreadBody;
- sys::Thread connThread;
-
- void encodeHeader(framing::Buffer& buf, uint8_t opcode, uint32_t seq = 0) const;
- bool checkHeader(framing::Buffer& buf, uint8_t *opcode, uint32_t *seq) const;
- void received(client::Message& msg);
- void resetAgents();
- void updateAgent(const Object& object);
- void waitForStable();
- void incOutstanding();
- void decOutstanding();
- void setBrokerId(const framing::Uuid& id) { brokerId = id; }
- void appendAgents(std::vector<Agent*>& agents) const;
-
- friend std::ostream& operator<<(std::ostream& o, const Broker& k);
- };
-
- std::ostream& operator<<(std::ostream& o, const Broker& k);
-}
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/ClassKey.cpp b/M4-RCs/qpid/cpp/src/qpid/console/ClassKey.cpp
deleted file mode 100644
index 6aa2bcb117..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/ClassKey.cpp
+++ /dev/null
@@ -1,104 +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 "ClassKey.h"
-#include <string.h>
-
-using namespace std;
-using namespace qpid::console;
-
-ClassKey::ClassKey(const string& _package, const string& _name, const uint8_t* _hash) :
- package(_package), name(_name)
-{
- ::memcpy(hash, _hash, HASH_SIZE);
-}
-
-string ClassKey::getHashString() const
-{
- char cstr[36];
- ::sprintf(cstr, "%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x",
- hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7],
- hash[8], hash[9], hash[10], hash[11], hash[12], hash[13], hash[14], hash[15]);
- return string(cstr);
-}
-
-string ClassKey::str() const
-{
- string result(package + ":" + name + "(" + getHashString() + ")");
- return result;
-}
-
-bool ClassKey::operator==(const ClassKey& other) const
-{
- return ::memcmp(hash, other.hash, HASH_SIZE) == 0 &&
- name == other.name &&
- package == other.package;
-}
-
-bool ClassKey::operator!=(const ClassKey& other) const
-{
- return !(*this == other);
-}
-
-bool ClassKey::operator<(const ClassKey& other) const
-{
- int cmp = ::memcmp(hash, other.hash, HASH_SIZE);
- if (cmp != 0)
- return cmp < 0;
- cmp = name.compare(other.name);
- if (cmp != 0)
- return cmp < 0;
- return package < other.package;
-}
-
-bool ClassKey::operator>(const ClassKey& other) const
-{
- int cmp = ::memcmp(hash, other.hash, HASH_SIZE);
- if (cmp != 0)
- return cmp > 0;
- cmp = name.compare(other.name);
- if (cmp != 0)
- return cmp > 0;
- return package > other.package;
-}
-
-bool ClassKey::operator<=(const ClassKey& other) const
-{
- return !(*this > other);
-}
-
-bool ClassKey::operator>=(const ClassKey& other) const
-{
- return !(*this < other);
-}
-
-void ClassKey::encode(framing::Buffer& buffer) const
-{
- buffer.putShortString(package);
- buffer.putShortString(name);
- buffer.putBin128(const_cast<uint8_t*>(hash));
-}
-
-ostream& qpid::console::operator<<(ostream& o, const ClassKey& k)
-{
- o << k.str();
- return o;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/ClassKey.h b/M4-RCs/qpid/cpp/src/qpid/console/ClassKey.h
deleted file mode 100644
index f6617e22d5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/ClassKey.h
+++ /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.
- *
- */
-#ifndef _QPID_CONSOLE_CLASSKEY_H_
-#define _QPID_CONSOLE_CLASSKEY_H_
-
-#include <string>
-#include "Package.h"
-#include "qpid/framing/Buffer.h"
-
-namespace qpid {
-namespace console {
-
- /**
- *
- * \ingroup qmfconsoleapi
- */
- class ClassKey {
- public:
- static const int HASH_SIZE = 16;
-
- ClassKey(const std::string& package, const std::string& name, const uint8_t* hash);
-
- const std::string& getPackageName() const { return package; }
- const std::string& getClassName() const { return name; }
- const uint8_t* getHash() const { return hash; }
- std::string getHashString() const;
- std::string str() const;
- bool operator==(const ClassKey& other) const;
- bool operator!=(const ClassKey& other) const;
- bool operator<(const ClassKey& other) const;
- bool operator>(const ClassKey& other) const;
- bool operator<=(const ClassKey& other) const;
- bool operator>=(const ClassKey& other) const;
- void encode(framing::Buffer& buffer) const;
-
- private:
- std::string package;
- std::string name;
- uint8_t hash[HASH_SIZE];
- };
-
- std::ostream& operator<<(std::ostream& o, const ClassKey& k);
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/ConsoleListener.h b/M4-RCs/qpid/cpp/src/qpid/console/ConsoleListener.h
deleted file mode 100644
index d0db6034f6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/ConsoleListener.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.
- *
- */
-#ifndef _QPID_CONSOLE_CONSOLE_LISTENER_H_
-#define _QPID_CONSOLE_CONSOLE_LISTENER_H_
-
-#include <string>
-#include "Broker.h"
-#include "ClassKey.h"
-#include "Object.h"
-#include "Event.h"
-
-namespace qpid {
-namespace console {
-
- /**
- * Implement a subclass of ConsoleListener and subscribe it using
- * the SessionManager to receive indications.
- *
- * \ingroup qmfconsoleapi
- */
- class ConsoleListener{
- public:
- virtual ~ConsoleListener() {};
-
- /** Invoked when a connection is established to a broker
- */
- virtual void brokerConnected(const Broker&) {}
-
- /** Invoked when the connection to a broker is lost
- */
- virtual void brokerDisconnected(const Broker&) {}
-
- /** Invoked when a QMF package is discovered.
- */
- virtual void newPackage(const std::string&) {}
-
- /** Invoked when a new class is discovered. Session.getSchema can be
- * used to obtain details about the class.
- */
- virtual void newClass(const ClassKey&) {}
-
- /** Invoked when a QMF agent is discovered.
- */
- virtual void newAgent(const Agent&) {}
-
- /** Invoked when a QMF agent disconects.
- */
- virtual void delAgent(const Agent&) {}
-
- /** Invoked when an object is updated.
- */
- virtual void objectProps(Broker&, Object&) {}
-
- /** Invoked when an object is updated.
- */
- virtual void objectStats(Broker&, Object&) {}
-
- /** Invoked when an event is raised.
- */
- virtual void event(Event&) {}
-
- /**
- */
- //virtual void heartbeat(Agent&, uint64_t) {}
-
- /**
- */
- virtual void brokerInfo(Broker&) {}
-
- /**
- */
- //virtual void methodResponse(Broker&, uint32_t seq, MethodResponse&) {}
- };
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Event.cpp b/M4-RCs/qpid/cpp/src/qpid/console/Event.cpp
deleted file mode 100644
index 51f043159c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Event.cpp
+++ /dev/null
@@ -1,205 +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 "Broker.h"
-#include "ClassKey.h"
-#include "Schema.h"
-#include "Event.h"
-#include "Value.h"
-#include "qpid/sys/Time.h"
-#include "qpid/framing/Buffer.h"
-
-using namespace qpid::console;
-using namespace std;
-using qpid::framing::Uuid;
-using qpid::framing::FieldTable;
-
-Event::Event(Broker* _broker, SchemaClass* _schema, framing::Buffer& buffer) :
- broker(_broker), schema(_schema)
-{
- timestamp = buffer.getLongLong();
- severity = (Severity) buffer.getOctet();
- for (vector<SchemaArgument*>::const_iterator aIter = schema->arguments.begin();
- aIter != schema->arguments.end(); aIter++) {
- SchemaArgument* argument = *aIter;
- attributes[argument->name] = argument->decodeValue(buffer);
- }
-}
-
-const ClassKey& Event::getClassKey() const
-{
- return schema->getClassKey();
-}
-
-string Event::getSeverityString() const
-{
- switch (severity) {
- case EMERGENCY : return string("EMER");
- case ALERT : return string("ALERT");
- case CRITICAL : return string("CRIT");
- case ERROR : return string("ERROR");
- case WARNING : return string("WARN");
- case NOTICE : return string("NOTIC");
- case INFO : return string("INFO");
- case DEBUG : return string("DEBUG");
- }
- return string("<UNKNOWN>");
-}
-
-ObjectId Event::attrRef(const string& key) const
-{
- Object::AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return ObjectId();
- Value::Ptr val = iter->second;
- if (!val->isObjectId())
- return ObjectId();
- return val->asObjectId();
-}
-
-uint32_t Event::attrUint(const string& key) const
-{
- Object::AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0;
- Value::Ptr val = iter->second;
- if (!val->isUint())
- return 0;
- return val->asUint();
-}
-
-int32_t Event::attrInt(const string& key) const
-{
- Object::AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0;
- Value::Ptr val = iter->second;
- if (!val->isInt())
- return 0;
- return val->asInt();
-}
-
-uint64_t Event::attrUint64(const string& key) const
-{
- Object::AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0;
- Value::Ptr val = iter->second;
- if (!val->isUint64())
- return 0;
- return val->asUint64();
-}
-
-int64_t Event::attrInt64(const string& key) const
-{
- Object::AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0;
- Value::Ptr val = iter->second;
- if (!val->isInt64())
- return 0;
- return val->asInt64();
-}
-
-string Event::attrString(const string& key) const
-{
- Object::AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return string();
- Value::Ptr val = iter->second;
- if (!val->isString())
- return string();
- return val->asString();
-}
-
-bool Event::attrBool(const string& key) const
-{
- Object::AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return false;
- Value::Ptr val = iter->second;
- if (!val->isBool())
- return false;
- return val->asBool();
-}
-
-float Event::attrFloat(const string& key) const
-{
- Object::AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0.0;
- Value::Ptr val = iter->second;
- if (!val->isFloat())
- return 0.0;
- return val->asFloat();
-}
-
-double Event::attrDouble(const string& key) const
-{
- Object::AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0.0;
- Value::Ptr val = iter->second;
- if (!val->isDouble())
- return 0.0;
- return val->asDouble();
-}
-
-Uuid Event::attrUuid(const string& key) const
-{
- Object::AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return Uuid();
- Value::Ptr val = iter->second;
- if (!val->isUuid())
- return Uuid();
- return val->asUuid();
-}
-
-FieldTable Event::attrMap(const string& key) const
-{
- Object::AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return FieldTable();
- Value::Ptr val = iter->second;
- if (!val->isMap())
- return FieldTable();
- return val->asMap();
-}
-
-
-std::ostream& qpid::console::operator<<(std::ostream& o, const Event& event)
-{
- const ClassKey& key = event.getClassKey();
- sys::AbsTime aTime(sys::AbsTime(), sys::Duration(event.getTimestamp()));
- o << aTime << " " << event.getSeverityString() << " " <<
- key.getPackageName() << ":" << key.getClassName() <<
- " broker=" << event.getBroker()->getUrl();
-
- const Object::AttributeMap& attributes = event.getAttributes();
- for (Object::AttributeMap::const_iterator iter = attributes.begin();
- iter != attributes.end(); iter++) {
- o << " " << iter->first << "=" << iter->second->str();
- }
- return o;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Event.h b/M4-RCs/qpid/cpp/src/qpid/console/Event.h
deleted file mode 100644
index c212b72889..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Event.h
+++ /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.
- *
- */
-#ifndef _QPID_CONSOLE_EVENT_H_
-#define _QPID_CONSOLE_EVENT_H_
-
-#include "Object.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/framing/FieldTable.h"
-
-namespace qpid {
-namespace framing {
- class Buffer;
-}
-namespace console {
-
- class Broker;
- class SchemaClass;
- class ClassKey;
-
- /**
- *
- * \ingroup qmfconsoleapi
- */
- class Event {
- public:
- typedef enum {
- EMERGENCY = 0, ALERT = 1, CRITICAL = 2, ERROR = 3, WARNING = 4,
- NOTICE = 5, INFO = 6, DEBUG = 7
- } Severity;
-
- Event(Broker* broker, SchemaClass* schemaClass, framing::Buffer& buffer);
- Broker* getBroker() const { return broker; }
- const ClassKey& getClassKey() const;
- SchemaClass* getSchema() const { return schema; }
- const Object::AttributeMap& getAttributes() const { return attributes; }
- uint64_t getTimestamp() const { return timestamp; }
- uint8_t getSeverity() const { return severity; }
- std::string getSeverityString() const;
-
- ObjectId attrRef(const std::string& key) const;
- uint32_t attrUint(const std::string& key) const;
- int32_t attrInt(const std::string& key) const;
- uint64_t attrUint64(const std::string& key) const;
- int64_t attrInt64(const std::string& key) const;
- std::string attrString(const std::string& key) const;
- bool attrBool(const std::string& key) const;
- float attrFloat(const std::string& key) const;
- double attrDouble(const std::string& key) const;
- framing::Uuid attrUuid(const std::string& key) const;
- framing::FieldTable attrMap(const std::string& key) const;
-
- private:
- Broker* broker;
- SchemaClass* schema;
- uint64_t timestamp;
- Severity severity;
- Object::AttributeMap attributes;
- };
-
- std::ostream& operator<<(std::ostream& o, const Event& event);
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Object.cpp b/M4-RCs/qpid/cpp/src/qpid/console/Object.cpp
deleted file mode 100644
index da8ab962e0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Object.cpp
+++ /dev/null
@@ -1,383 +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 "SessionManager.h"
-#include "Broker.h"
-#include "Object.h"
-#include "Schema.h"
-#include "ClassKey.h"
-#include "Value.h"
-#include "qpid/framing/Buffer.h"
-#include "qpid/sys/Mutex.h"
-
-using namespace qpid::console;
-using namespace qpid::sys;
-using namespace std;
-using qpid::framing::Uuid;
-using qpid::framing::FieldTable;
-
-void Object::AttributeMap::addRef(const string& key, const ObjectId& val)
-{
- (*this)[key] = Value::Ptr(new RefValue(val));
-}
-
-void Object::AttributeMap::addUint(const string& key, uint32_t val)
-{
- (*this)[key] = Value::Ptr(new UintValue(val));
-}
-
-void Object::AttributeMap::addInt(const string& key, int32_t val)
-{
- (*this)[key] = Value::Ptr(new IntValue(val));
-}
-
-void Object::AttributeMap::addUint64(const string& key, uint64_t val)
-{
- (*this)[key] = Value::Ptr(new Uint64Value(val));
-}
-
-void Object::AttributeMap::addInt64(const string& key, int64_t val)
-{
- (*this)[key] = Value::Ptr(new Int64Value(val));
-}
-
-void Object::AttributeMap::addString(const string& key, const string& val)
-{
- (*this)[key] = Value::Ptr(new StringValue(val));
-}
-
-void Object::AttributeMap::addBool(const string& key, bool val)
-{
- (*this)[key] = Value::Ptr(new BoolValue(val));
-}
-
-void Object::AttributeMap::addFloat(const string& key, float val)
-{
- (*this)[key] = Value::Ptr(new FloatValue(val));
-}
-
-void Object::AttributeMap::addDouble(const string& key, double val)
-{
- (*this)[key] = Value::Ptr(new DoubleValue(val));
-}
-
-void Object::AttributeMap::addUuid(const string& key, const framing::Uuid& val)
-{
- (*this)[key] = Value::Ptr(new UuidValue(val));
-}
-
-void Object::AttributeMap::addMap(const string& key, const framing::FieldTable& val)
-{
- (*this)[key] = Value::Ptr(new MapValue(val));
-}
-
-Object::Object(Broker* b, SchemaClass* s, framing::Buffer& buffer, bool prop, bool stat) :
- broker(b), schema(s), pendingMethod(0)
-{
- currentTime = buffer.getLongLong();
- createTime = buffer.getLongLong();
- deleteTime = buffer.getLongLong();
- objectId.decode(buffer);
-
- if (prop) {
- set<string> excludes;
- parsePresenceMasks(buffer, excludes);
- for (vector<SchemaProperty*>::const_iterator pIter = schema->properties.begin();
- pIter != schema->properties.end(); pIter++) {
- SchemaProperty* property = *pIter;
- if (excludes.count(property->name) != 0) {
- attributes[property->name] = Value::Ptr(new NullValue());
- } else {
- attributes[property->name] = property->decodeValue(buffer);
- }
- }
- }
-
- if (stat) {
- for (vector<SchemaStatistic*>::const_iterator sIter = schema->statistics.begin();
- sIter != schema->statistics.end(); sIter++) {
- SchemaStatistic* statistic = *sIter;
- attributes[statistic->name] = statistic->decodeValue(buffer);
- }
- }
-}
-
-Object::~Object() {}
-
-const ClassKey& Object::getClassKey() const
-{
- return schema->getClassKey();
-}
-
-string Object::getIndex() const
-{
- string result;
-
- for (vector<SchemaProperty*>::const_iterator pIter = schema->properties.begin();
- pIter != schema->properties.end(); pIter++) {
- SchemaProperty* property = *pIter;
- if (property->isIndex) {
- AttributeMap::const_iterator vIter = attributes.find(property->name);
- if (vIter != attributes.end()) {
- if (!result.empty())
- result += ":";
- result += vIter->second->str();
- }
- }
- }
- return result;
-}
-
-void Object::mergeUpdate(const Object& /*updated*/)
-{
- // TODO
-}
-
-void Object::invokeMethod(const string name, const AttributeMap& args, MethodResponse& result)
-{
- for (vector<SchemaMethod*>::const_iterator iter = schema->methods.begin();
- iter != schema->methods.end(); iter++) {
- if ((*iter)->name == name) {
- SchemaMethod* method = *iter;
- char rawbuffer[65536];
- framing::Buffer buffer(rawbuffer, 65536);
- uint32_t sequence = broker->sessionManager.sequenceManager.reserve("method");
- pendingMethod = method;
- broker->methodObject = this;
- broker->encodeHeader(buffer, 'M', sequence);
- objectId.encode(buffer);
- schema->key.encode(buffer);
- buffer.putShortString(name);
-
- for (vector<SchemaArgument*>::const_iterator aIter = method->arguments.begin();
- aIter != method->arguments.end(); aIter++) {
- SchemaArgument* arg = *aIter;
- if (arg->dirInput) {
- AttributeMap::const_iterator attr = args.find(arg->name);
- if (attr != args.end()) {
- ValueFactory::encodeValue(arg->typeCode, attr->second, buffer);
- } else {
- // TODO Use the default value instead of throwing
- throw Exception("Missing arguments in method call");
- }
- }
- }
-
- uint32_t length = buffer.getPosition();
- buffer.reset();
- stringstream routingKey;
- routingKey << "agent." << objectId.getBrokerBank() << "." << objectId.getAgentBank();
- broker->connThreadBody.sendBuffer(buffer, length, "qpid.management", routingKey.str());
-
- {
- Mutex::ScopedLock l(broker->lock);
- bool ok = true;
- while (pendingMethod != 0 && ok) {
- ok = broker->cond.wait(broker->lock, AbsTime(now(), broker->sessionManager.settings.methodTimeout * TIME_SEC));
- }
-
- if (!ok) {
- result.code = 0x1001;
- result.text.assign("Method call timed out");
- result.arguments.clear();
- } else {
- result = methodResponse;
- }
- }
- }
- }
-}
-
-void Object::handleMethodResp(framing::Buffer& buffer, uint32_t sequence)
-{
- broker->sessionManager.sequenceManager.release(sequence);
- methodResponse.code = buffer.getLong();
- buffer.getMediumString(methodResponse.text);
- methodResponse.arguments.clear();
-
- for (vector<SchemaArgument*>::const_iterator aIter = pendingMethod->arguments.begin();
- aIter != pendingMethod->arguments.end(); aIter++) {
- SchemaArgument* arg = *aIter;
- if (arg->dirOutput) {
- methodResponse.arguments[arg->name] = arg->decodeValue(buffer);
- }
- }
-
- {
- Mutex::ScopedLock l(broker->lock);
- pendingMethod = 0;
- broker->cond.notify();
- }
-}
-
-ObjectId Object::attrRef(const string& key) const
-{
- AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return ObjectId();
- Value::Ptr val = iter->second;
- if (!val->isObjectId())
- return ObjectId();
- return val->asObjectId();
-}
-
-uint32_t Object::attrUint(const string& key) const
-{
- AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0;
- Value::Ptr val = iter->second;
- if (!val->isUint())
- return 0;
- return val->asUint();
-}
-
-int32_t Object::attrInt(const string& key) const
-{
- AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0;
- Value::Ptr val = iter->second;
- if (!val->isInt())
- return 0;
- return val->asInt();
-}
-
-uint64_t Object::attrUint64(const string& key) const
-{
- AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0;
- Value::Ptr val = iter->second;
- if (!val->isUint64())
- return 0;
- return val->asUint64();
-}
-
-int64_t Object::attrInt64(const string& key) const
-{
- AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0;
- Value::Ptr val = iter->second;
- if (!val->isInt64())
- return 0;
- return val->asInt64();
-}
-
-string Object::attrString(const string& key) const
-{
- AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return string();
- Value::Ptr val = iter->second;
- if (!val->isString())
- return string();
- return val->asString();
-}
-
-bool Object::attrBool(const string& key) const
-{
- AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return false;
- Value::Ptr val = iter->second;
- if (!val->isBool())
- return false;
- return val->asBool();
-}
-
-float Object::attrFloat(const string& key) const
-{
- AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0.0;
- Value::Ptr val = iter->second;
- if (!val->isFloat())
- return 0.0;
- return val->asFloat();
-}
-
-double Object::attrDouble(const string& key) const
-{
- AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return 0.0;
- Value::Ptr val = iter->second;
- if (!val->isDouble())
- return 0.0;
- return val->asDouble();
-}
-
-Uuid Object::attrUuid(const string& key) const
-{
- AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return Uuid();
- Value::Ptr val = iter->second;
- if (!val->isUuid())
- return Uuid();
- return val->asUuid();
-}
-
-FieldTable Object::attrMap(const string& key) const
-{
- AttributeMap::const_iterator iter = attributes.find(key);
- if (iter == attributes.end())
- return FieldTable();
- Value::Ptr val = iter->second;
- if (!val->isMap())
- return FieldTable();
- return val->asMap();
-}
-
-void Object::parsePresenceMasks(framing::Buffer& buffer, set<string>& excludeList)
-{
- excludeList.clear();
- uint8_t bit = 0;
- uint8_t mask = 0;
-
- for (vector<SchemaProperty*>::const_iterator pIter = schema->properties.begin();
- pIter != schema->properties.end(); pIter++) {
- SchemaProperty* property = *pIter;
- if (property->isOptional) {
- if (bit == 0) {
- mask = buffer.getOctet();
- bit = 1;
- }
- if ((mask & bit) == 0)
- excludeList.insert(property->name);
- if (bit == 0x80)
- bit = 0;
- else
- bit = bit << 1;
- }
- }
-}
-
-ostream& qpid::console::operator<<(ostream& o, const Object& object)
-{
- const ClassKey& key = object.getClassKey();
- o << key.getPackageName() << ":" << key.getClassName() << "[" << object.getObjectId() << "] " <<
- object.getIndex();
- return o;
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Object.h b/M4-RCs/qpid/cpp/src/qpid/console/Object.h
deleted file mode 100644
index 54a3e0f6e8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Object.h
+++ /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.
- *
- */
-#ifndef _QPID_CONSOLE_OBJECT_H_
-#define _QPID_CONSOLE_OBJECT_H_
-
-#include "ObjectId.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/framing/FieldTable.h"
-#include <boost/shared_ptr.hpp>
-#include <map>
-#include <set>
-#include <vector>
-
-namespace qpid {
-namespace framing {
- class Buffer;
-}
-namespace console {
-
- class Broker;
- class SchemaClass;
- class SchemaMethod;
- class ObjectId;
- class ClassKey;
- class Value;
-
- /**
- * \ingroup qmfconsoleapi
- */
- struct MethodResponse {
- uint32_t code;
- std::string text;
- std::map<std::string, boost::shared_ptr<Value> > arguments;
- };
-
- class Object {
- public:
- typedef std::vector<Object> Vector;
- struct AttributeMap : public std::map<std::string, boost::shared_ptr<Value> > {
- void addRef(const std::string& key, const ObjectId& val);
- void addUint(const std::string& key, uint32_t val);
- void addInt(const std::string& key, int32_t val);
- void addUint64(const std::string& key, uint64_t val);
- void addInt64(const std::string& key, int64_t val);
- void addString(const std::string& key, const std::string& val);
- void addBool(const std::string& key, bool val);
- void addFloat(const std::string& key, float val);
- void addDouble(const std::string& key, double val);
- void addUuid(const std::string& key, const framing::Uuid& val);
- void addMap(const std::string& key, const framing::FieldTable& val);
- };
-
- Object(Broker* broker, SchemaClass* schemaClass, framing::Buffer& buffer, bool prop, bool stat);
- ~Object();
-
- Broker* getBroker() const { return broker; }
- const ObjectId& getObjectId() const { return objectId; }
- const ClassKey& getClassKey() const;
- SchemaClass* getSchema() const { return schema; }
- uint64_t getCurrentTime() const { return currentTime; }
- uint64_t getCreateTime() const { return createTime; }
- uint64_t getDeleteTime() const { return deleteTime; }
- bool isDeleted() const { return deleteTime != 0; }
- std::string getIndex() const;
- void mergeUpdate(const Object& updated);
- const AttributeMap& getAttributes() const { return attributes; }
- void invokeMethod(const std::string name, const AttributeMap& args, MethodResponse& result);
- void handleMethodResp(framing::Buffer& buffer, uint32_t sequence);
-
- ObjectId attrRef(const std::string& key) const;
- uint32_t attrUint(const std::string& key) const;
- int32_t attrInt(const std::string& key) const;
- uint64_t attrUint64(const std::string& key) const;
- int64_t attrInt64(const std::string& key) const;
- std::string attrString(const std::string& key) const;
- bool attrBool(const std::string& key) const;
- float attrFloat(const std::string& key) const;
- double attrDouble(const std::string& key) const;
- framing::Uuid attrUuid(const std::string& key) const;
- framing::FieldTable attrMap(const std::string& key) const;
-
- private:
- Broker* broker;
- SchemaClass* schema;
- ObjectId objectId;
- uint64_t currentTime;
- uint64_t createTime;
- uint64_t deleteTime;
- AttributeMap attributes;
- SchemaMethod* pendingMethod;
- MethodResponse methodResponse;
-
- void parsePresenceMasks(framing::Buffer& buffer, std::set<std::string>& excludeList);
- };
-
- std::ostream& operator<<(std::ostream& o, const Object& object);
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/ObjectId.cpp b/M4-RCs/qpid/cpp/src/qpid/console/ObjectId.cpp
deleted file mode 100644
index 535e59e88d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/ObjectId.cpp
+++ /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.
- *
- */
-
-#include "ObjectId.h"
-#include "qpid/framing/Buffer.h"
-
-using namespace qpid::console;
-using namespace std;
-
-ObjectId::ObjectId(framing::Buffer& buffer)
-{
- decode(buffer);
-}
-
-void ObjectId::decode(framing::Buffer& buffer)
-{
- first = buffer.getLongLong();
- second = buffer.getLongLong();
-}
-
-void ObjectId::encode(framing::Buffer& buffer)
-{
- buffer.putLongLong(first);
- buffer.putLongLong(second);
-}
-
-ostream& qpid::console::operator<<(ostream& o, const ObjectId& id)
-{
- o << (int) id.getFlags() << "-" << id.getSequence() << "-" << id.getBrokerBank() << "-" <<
- id.getAgentBank() << "-" << id.getObject();
- return o;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/ObjectId.h b/M4-RCs/qpid/cpp/src/qpid/console/ObjectId.h
deleted file mode 100644
index c9c2fc852a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/ObjectId.h
+++ /dev/null
@@ -1,60 +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.
- *
- */
-#ifndef _QPID_CONSOLE_OBJECTID_H
-#define _QPID_CONSOLE_OBJECTID_H
-
-#include <iostream>
-
-namespace qpid {
-namespace framing {
- class Buffer;
-}
-namespace console {
-
- /**
- *
- * \ingroup qmfconsoleapi
- */
- class ObjectId {
- public:
- ObjectId() : first(0), second(0) {}
- ObjectId(framing::Buffer& buffer);
-
- uint8_t getFlags() const { return (first & 0xF000000000000000LL) >> 60; }
- uint16_t getSequence() const { return (first & 0x0FFF000000000000LL) >> 48; }
- uint32_t getBrokerBank() const { return (first & 0x0000FFFFF0000000LL) >> 28; }
- uint32_t getAgentBank() const { return first & 0x000000000FFFFFFFLL; }
- uint64_t getObject() const { return second; }
- bool isDurable() const { return getSequence() == 0; }
- void decode(framing::Buffer& buffer);
- void encode(framing::Buffer& buffer);
- void setValue(uint64_t f, uint64_t s) { first = f; second = s; }
-
- private:
- uint64_t first;
- uint64_t second;
- };
-
- std::ostream& operator<<(std::ostream& o, const ObjectId& id);
-}
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Package.cpp b/M4-RCs/qpid/cpp/src/qpid/console/Package.cpp
deleted file mode 100644
index 81a04445f2..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Package.cpp
+++ /dev/null
@@ -1,41 +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 "Package.h"
-
-using namespace qpid::console;
-
-SchemaClass* Package::getClass(const std::string& className, uint8_t* hash)
-{
- NameHash key(className, hash);
- ClassMap::iterator iter = classes.find(key);
- if (iter != classes.end())
- return iter->second;
- return 0;
-}
-
-void Package::addClass(const std::string& className, uint8_t* hash, SchemaClass* schemaClass)
-{
- NameHash key(className, hash);
- ClassMap::iterator iter = classes.find(key);
- if (iter == classes.end())
- classes[key] = schemaClass;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Package.h b/M4-RCs/qpid/cpp/src/qpid/console/Package.h
deleted file mode 100644
index a8679dff19..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Package.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.
- *
- */
-#ifndef _QPID_CONSOLE_PACKAGE_H_
-#define _QPID_CONSOLE_PACKAGE_H_
-
-#include <string>
-#include <map>
-
-namespace qpid {
-namespace console {
- class SchemaClass;
-
- /**
- *
- * \ingroup qmfconsoleapi
- */
- class Package {
- public:
- Package(const std::string& n) : name(n) {}
- const std::string& getName() const { return name; }
-
- private:
- friend class SessionManager;
- struct NameHash {
- std::string name;
- uint8_t hash[16];
- NameHash(const std::string& n, const uint8_t* h) : name(n) {
- for (int i = 0; i < 16; i++)
- hash[i] = h[i];
- }
- };
-
- struct NameHashComp {
- bool operator() (const NameHash& lhs, const NameHash& rhs) const
- {
- if (lhs.name != rhs.name)
- return lhs.name < rhs.name;
- else
- for (int i = 0; i < 16; i++)
- if (lhs.hash[i] != rhs.hash[i])
- return lhs.hash[i] < rhs.hash[i];
- return false;
- }
- };
-
- typedef std::map<NameHash, SchemaClass*, NameHashComp> ClassMap;
-
- const std::string name;
- ClassMap classes;
-
- SchemaClass* getClass(const std::string& className, uint8_t* hash);
- void addClass(const std::string& className, uint8_t* hash,
- SchemaClass* schemaClass);
- };
-}
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Schema.cpp b/M4-RCs/qpid/cpp/src/qpid/console/Schema.cpp
deleted file mode 100644
index 31d947cdd5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Schema.cpp
+++ /dev/null
@@ -1,155 +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 "Schema.h"
-#include "Value.h"
-#include "qpid/framing/FieldTable.h"
-
-using namespace qpid::console;
-using std::string;
-using std::vector;
-
-SchemaArgument::SchemaArgument(framing::Buffer& buffer, bool forMethod)
-{
- framing::FieldTable map;
- map.decode(buffer);
-
- name = map.getAsString("name");
- typeCode = map.getAsInt("type");
- unit = map.getAsString("unit");
- min = map.getAsInt("min");
- max = map.getAsInt("max");
- maxLen = map.getAsInt("maxlen");
- desc = map.getAsString("desc");
-
- dirInput = false;
- dirOutput = false;
- if (forMethod) {
- string dir(map.getAsString("dir"));
- if (dir.find('I') != dir.npos || dir.find('i') != dir.npos)
- dirInput = true;
- if (dir.find('O') != dir.npos || dir.find('o') != dir.npos)
- dirOutput = true;
- }
-}
-
-Value::Ptr SchemaArgument::decodeValue(framing::Buffer& buffer)
-{
- return ValueFactory::newValue(typeCode, buffer);
-}
-
-SchemaProperty::SchemaProperty(framing::Buffer& buffer)
-{
- framing::FieldTable map;
- map.decode(buffer);
-
- name = map.getAsString("name");
- typeCode = map.getAsInt("type");
- accessCode = map.getAsInt("access");
- isIndex = map.getAsInt("index") != 0;
- isOptional = map.getAsInt("optional") != 0;
- unit = map.getAsString("unit");
- min = map.getAsInt("min");
- max = map.getAsInt("max");
- maxLen = map.getAsInt("maxlen");
- desc = map.getAsString("desc");
-}
-
-Value::Ptr SchemaProperty::decodeValue(framing::Buffer& buffer)
-{
- return ValueFactory::newValue(typeCode, buffer);
-}
-
-SchemaStatistic::SchemaStatistic(framing::Buffer& buffer)
-{
- framing::FieldTable map;
- map.decode(buffer);
-
- name = map.getAsString("name");
- typeCode = map.getAsInt("type");
- unit = map.getAsString("unit");
- desc = map.getAsString("desc");
-}
-
-Value::Ptr SchemaStatistic::decodeValue(framing::Buffer& buffer)
-{
- return ValueFactory::newValue(typeCode, buffer);
-}
-
-SchemaMethod::SchemaMethod(framing::Buffer& buffer)
-{
- framing::FieldTable map;
- map.decode(buffer);
-
- name = map.getAsString("name");
- desc = map.getAsString("desc");
- int argCount = map.getAsInt("argCount");
-
- for (int i = 0; i < argCount; i++)
- arguments.push_back(new SchemaArgument(buffer, true));
-}
-
-SchemaMethod::~SchemaMethod()
-{
- for (vector<SchemaArgument*>::iterator iter = arguments.begin();
- iter != arguments.end(); iter++)
- delete *iter;
-}
-
-SchemaClass::SchemaClass(const uint8_t _kind, const ClassKey& _key, framing::Buffer& buffer) :
- kind(_kind), key(_key)
-{
- if (kind == KIND_TABLE) {
- uint16_t propCount = buffer.getShort();
- uint16_t statCount = buffer.getShort();
- uint16_t methodCount = buffer.getShort();
-
- for (uint16_t idx = 0; idx < propCount; idx++)
- properties.push_back(new SchemaProperty(buffer));
- for (uint16_t idx = 0; idx < statCount; idx++)
- statistics.push_back(new SchemaStatistic(buffer));
- for (uint16_t idx = 0; idx < methodCount; idx++)
- methods.push_back(new SchemaMethod(buffer));
-
- } else if (kind == KIND_EVENT) {
- uint16_t argCount = buffer.getShort();
-
- for (uint16_t idx = 0; idx < argCount; idx++)
- arguments.push_back(new SchemaArgument(buffer));
- }
-}
-
-SchemaClass::~SchemaClass()
-{
- for (vector<SchemaProperty*>::iterator iter = properties.begin();
- iter != properties.end(); iter++)
- delete *iter;
- for (vector<SchemaStatistic*>::iterator iter = statistics.begin();
- iter != statistics.end(); iter++)
- delete *iter;
- for (vector<SchemaMethod*>::iterator iter = methods.begin();
- iter != methods.end(); iter++)
- delete *iter;
- for (vector<SchemaArgument*>::iterator iter = arguments.begin();
- iter != arguments.end(); iter++)
- delete *iter;
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Schema.h b/M4-RCs/qpid/cpp/src/qpid/console/Schema.h
deleted file mode 100644
index aacedfe23f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Schema.h
+++ /dev/null
@@ -1,105 +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.
- *
- */
-#ifndef _QPID_CONSOLE_SCHEMA_H_
-#define _QPID_CONSOLE_SCHEMA_H_
-
-#include "ClassKey.h"
-#include <boost/shared_ptr.hpp>
-#include <vector>
-
-namespace qpid {
-namespace framing {
- class Buffer;
-}
-namespace console {
- class Value;
-
- struct SchemaArgument {
- SchemaArgument(framing::Buffer& buffer, bool forMethod = false);
- boost::shared_ptr<Value> decodeValue(framing::Buffer& buffer);
-
- std::string name;
- uint8_t typeCode;
- bool dirInput;
- bool dirOutput;
- std::string unit;
- int min;
- int max;
- int maxLen;
- std::string desc;
- std::string defaultVal;
- };
-
- struct SchemaProperty {
- SchemaProperty(framing::Buffer& buffer);
- boost::shared_ptr<Value> decodeValue(framing::Buffer& buffer);
-
- std::string name;
- uint8_t typeCode;
- uint8_t accessCode;
- bool isIndex;
- bool isOptional;
- std::string unit;
- int min;
- int max;
- int maxLen;
- std::string desc;
- };
-
- struct SchemaStatistic {
- SchemaStatistic(framing::Buffer& buffer);
- boost::shared_ptr<Value> decodeValue(framing::Buffer& buffer);
-
- std::string name;
- uint8_t typeCode;
- std::string unit;
- std::string desc;
- };
-
- struct SchemaMethod {
- SchemaMethod(framing::Buffer& buffer);
- ~SchemaMethod();
-
- std::string name;
- std::string desc;
- std::vector<SchemaArgument*> arguments;
- };
-
- struct SchemaClass {
- static const uint8_t KIND_TABLE = 1;
- static const uint8_t KIND_EVENT = 2;
-
- SchemaClass(const uint8_t kind, const ClassKey& key, framing::Buffer& buffer);
- ~SchemaClass();
- const ClassKey& getClassKey() const { return key; }
-
- const uint8_t kind;
- const ClassKey key;
- std::vector<SchemaProperty*> properties;
- std::vector<SchemaStatistic*> statistics;
- std::vector<SchemaMethod*> methods;
- std::vector<SchemaArgument*> arguments;
- };
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/SequenceManager.cpp b/M4-RCs/qpid/cpp/src/qpid/console/SequenceManager.cpp
deleted file mode 100644
index ff777430c0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/SequenceManager.cpp
+++ /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.
- *
- */
-
-#include "SequenceManager.h"
-
-using namespace qpid::console;
-using namespace qpid::sys;
-using std::string;
-using std::cout;
-using std::endl;
-
-uint32_t SequenceManager::reserve(const std::string& context)
-{
- Mutex::ScopedLock l(lock);
- uint32_t result = sequence++;
- pending[result] = context;
- return result;
-}
-
-std::string SequenceManager::release(uint32_t seq)
-{
- Mutex::ScopedLock l(lock);
- std::map<uint32_t, string>::iterator iter = pending.find(seq);
- if (iter == pending.end())
- return string();
- string result(iter->second);
- pending.erase(iter);
- return result;
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/SequenceManager.h b/M4-RCs/qpid/cpp/src/qpid/console/SequenceManager.h
deleted file mode 100644
index c7a8c20fe6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/SequenceManager.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.
- *
- */
-#ifndef _QPID_CONSOLE_SEQUENCEMANAGER_H_
-#define _QPID_CONSOLE_SEQUENCEMANAGER_H_
-
-#include "qpid/sys/Mutex.h"
-#include <map>
-#include <string>
-#include <set>
-
-namespace qpid {
-namespace console {
-
- /**
- *
- * \ingroup qpidconsoleapi
- */
- class SequenceManager {
- public:
- typedef std::set<uint32_t> set;
-
- SequenceManager() : sequence(0) {}
- uint32_t reserve(const std::string& context = "");
- std::string release(uint32_t seq);
-
- private:
- sys::Mutex lock;
- uint32_t sequence;
- std::map<uint32_t, std::string> pending;
- };
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/SessionManager.cpp b/M4-RCs/qpid/cpp/src/qpid/console/SessionManager.cpp
deleted file mode 100644
index 6aa347e051..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/SessionManager.cpp
+++ /dev/null
@@ -1,462 +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 "SessionManager.h"
-#include "Schema.h"
-#include "Agent.h"
-#include "qpid/console/ConsoleListener.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/Time.h"
-#include "qpid/framing/Buffer.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/framing/FieldTable.h"
-
-using namespace qpid::console;
-using namespace qpid::sys;
-using namespace std;
-using qpid::framing::Buffer;
-using qpid::framing::FieldTable;
-
-SessionManager::SessionManager(ConsoleListener* _listener, Settings _settings) :
- listener(_listener), settings(_settings)
-{
- bindingKeys();
-}
-
-Broker* SessionManager::addBroker(client::ConnectionSettings& settings)
-{
- Broker* broker(new Broker(*this, settings));
- {
- Mutex::ScopedLock l(brokerListLock);
- brokers.push_back(broker);
- }
- return broker;
-}
-
-void SessionManager::delBroker(Broker* broker)
-{
- Mutex::ScopedLock l(brokerListLock);
- for (vector<Broker*>::iterator iter = brokers.begin();
- iter != brokers.end(); iter++)
- if (*iter == broker) {
- brokers.erase(iter);
- return;
- }
-}
-
-void SessionManager::getPackages(NameVector& packageNames)
-{
- allBrokersStable();
- packageNames.clear();
- {
- Mutex::ScopedLock l(lock);
- for (map<string, Package*>::iterator iter = packages.begin();
- iter != packages.end(); iter++)
- packageNames.push_back(iter->first);
- }
-}
-
-void SessionManager::getClasses(KeyVector& classKeys, const std::string& packageName)
-{
- allBrokersStable();
- classKeys.clear();
- map<string, Package*>::iterator iter = packages.find(packageName);
- if (iter == packages.end())
- return;
-
- Package& package = *(iter->second);
- for (Package::ClassMap::const_iterator piter = package.classes.begin();
- piter != package.classes.end(); piter++) {
- ClassKey key(piter->second->getClassKey());
- classKeys.push_back(key);
- }
-}
-
-SchemaClass& SessionManager::getSchema(const ClassKey& classKey)
-{
- allBrokersStable();
- map<string, Package*>::iterator iter = packages.find(classKey.getPackageName());
- if (iter == packages.end())
- throw Exception("Unknown package");
-
- Package& package = *(iter->second);
- Package::NameHash key(classKey.getClassName(), classKey.getHash());
- Package::ClassMap::iterator cIter = package.classes.find(key);
- if (cIter == package.classes.end())
- throw Exception("Unknown class");
-
- return *(cIter->second);
-}
-
-void SessionManager::bindPackage(const std::string& packageName)
-{
- stringstream key;
- key << "console.obj.*.*." << packageName << ".#";
- bindingKeyList.push_back(key.str());
- for (vector<Broker*>::iterator iter = brokers.begin(); iter != brokers.end(); iter++)
- (*iter)->addBinding(key.str());
-}
-
-void SessionManager::bindClass(const ClassKey& classKey)
-{
- bindClass(classKey.getPackageName(), classKey.getClassName());
-}
-
-void SessionManager::bindClass(const std::string& packageName, const std::string& className)
-{
- stringstream key;
- key << "console.obj.*.*." << packageName << "." << className << ".#";
- bindingKeyList.push_back(key.str());
- for (vector<Broker*>::iterator iter = brokers.begin();
- iter != brokers.end(); iter++)
- (*iter)->addBinding(key.str());
-}
-
-void SessionManager::getAgents(Agent::Vector& agents, Broker* broker)
-{
- agents.clear();
- if (broker != 0) {
- broker->appendAgents(agents);
- } else {
- for (vector<Broker*>::iterator iter = brokers.begin(); iter != brokers.end(); iter++) {
- (*iter)->appendAgents(agents);
- }
- }
-}
-
-void SessionManager::getObjects(Object::Vector& objects, const std::string& className,
- Broker* _broker, Agent* _agent)
-{
- Agent::Vector agentList;
-
- if (_agent != 0) {
- agentList.push_back(_agent);
- _agent->getBroker()->waitForStable();
- } else {
- if (_broker != 0) {
- _broker->appendAgents(agentList);
- _broker->waitForStable();
- } else {
- allBrokersStable();
- Mutex::ScopedLock _lock(brokerListLock);
- for (vector<Broker*>::iterator iter = brokers.begin(); iter != brokers.end(); iter++) {
- (*iter)->appendAgents(agentList);
- }
- }
- }
-
- FieldTable ft;
- uint32_t sequence;
- ft.setString("_class", className);
-
- getResult.clear();
- syncSequenceList.clear();
- error = string();
-
- for (Agent::Vector::iterator iter = agentList.begin(); iter != agentList.end(); iter++) {
- Agent* agent = *iter;
- char rawbuffer[512];
- Buffer buffer(rawbuffer, 512);
- stringstream routingKey;
- routingKey << "agent." << agent->getBrokerBank() << "." << agent->getAgentBank();
- {
- Mutex::ScopedLock _lock(lock);
- sequence = sequenceManager.reserve("multiget");
- syncSequenceList.insert(sequence);
- }
- agent->getBroker()->encodeHeader(buffer, 'G', sequence);
- ft.encode(buffer);
- uint32_t length = buffer.getPosition();
- buffer.reset();
- agent->getBroker()->connThreadBody.sendBuffer(buffer, length, "qpid.management", routingKey.str());
- }
-
- {
- Mutex::ScopedLock _lock(lock);
- while (!syncSequenceList.empty() && error.empty()) {
- cv.wait(lock, AbsTime(now(), settings.getTimeout * TIME_SEC));
- }
- }
-
- objects = getResult;
-}
-
-void SessionManager::bindingKeys()
-{
- bindingKeyList.push_back("schema.#");
- if (settings.rcvObjects && settings.rcvEvents && settings.rcvHeartbeats && !settings.userBindings) {
- bindingKeyList.push_back("console.#");
- } else {
- if (settings.rcvObjects && !settings.userBindings)
- bindingKeyList.push_back("console.obj.#");
- else
- bindingKeyList.push_back("console.obj.*.*.org.apache.qpid.broker.agent");
- if (settings.rcvEvents)
- bindingKeyList.push_back("console.event.#");
- if (settings.rcvHeartbeats)
- bindingKeyList.push_back("console.heartbeat");
- }
-}
-
-void SessionManager::allBrokersStable()
-{
- Mutex::ScopedLock l(brokerListLock);
- for (vector<Broker*>::iterator iter = brokers.begin();
- iter != brokers.end(); iter++)
- (*iter)->waitForStable();
-}
-
-void SessionManager::startProtocol(Broker* broker)
-{
- char rawbuffer[512];
- Buffer buffer(rawbuffer, 512);
-
- broker->encodeHeader(buffer, 'B');
- uint32_t length = 512 - buffer.available();
- buffer.reset();
- broker->connThreadBody.sendBuffer(buffer, length);
-}
-
-
-void SessionManager::handleBrokerResp(Broker* broker, Buffer& inBuffer, uint32_t)
-{
- framing::Uuid brokerId;
-
- brokerId.decode(inBuffer);
- broker->setBrokerId(brokerId);
-
- char rawbuffer[512];
- Buffer buffer(rawbuffer, 512);
-
- uint32_t sequence = sequenceManager.reserve("startup");
- broker->encodeHeader(buffer, 'P', sequence);
- uint32_t length = 512 - buffer.available();
- buffer.reset();
- broker->connThreadBody.sendBuffer(buffer, length);
-
- if (listener != 0) {
- listener->brokerInfo(*broker);
- }
-}
-
-void SessionManager::handlePackageInd(Broker* broker, Buffer& inBuffer, uint32_t)
-{
- string packageName;
- inBuffer.getShortString(packageName);
-
- {
- Mutex::ScopedLock l(lock);
- map<string, Package*>::iterator iter = packages.find(packageName);
- if (iter == packages.end()) {
- packages[packageName] = new Package(packageName);
- if (listener != 0)
- listener->newPackage(packageName);
- }
- }
-
- broker->incOutstanding();
- char rawbuffer[512];
- Buffer buffer(rawbuffer, 512);
-
- uint32_t sequence = sequenceManager.reserve("startup");
- broker->encodeHeader(buffer, 'Q', sequence);
- buffer.putShortString(packageName);
- uint32_t length = 512 - buffer.available();
- buffer.reset();
- broker->connThreadBody.sendBuffer(buffer, length);
-}
-
-void SessionManager::handleCommandComplete(Broker* broker, Buffer& inBuffer, uint32_t sequence)
-{
- Mutex::ScopedLock l(lock);
- uint32_t resultCode = inBuffer.getLong();
- string resultText;
- inBuffer.getShortString(resultText);
- string context = sequenceManager.release(sequence);
- if (resultCode != 0)
- QPID_LOG(debug, "Received error in completion: " << resultCode << " " << resultText);
- if (context == "startup") {
- broker->decOutstanding();
- } else if (context == "multiget") {
- if (syncSequenceList.count(sequence) == 1) {
- syncSequenceList.erase(sequence);
- if (syncSequenceList.empty()) {
- cv.notify();
- }
- }
- }
- // TODO: Other context cases
-}
-
-void SessionManager::handleClassInd(Broker* broker, Buffer& inBuffer, uint32_t)
-{
- uint8_t kind;
- string packageName;
- string className;
- uint8_t hash[16];
-
- kind = inBuffer.getOctet();
- inBuffer.getShortString(packageName);
- inBuffer.getShortString(className);
- inBuffer.getBin128(hash);
-
- {
- Mutex::ScopedLock l(lock);
- map<string, Package*>::iterator pIter = packages.find(packageName);
- if (pIter == packages.end() || pIter->second->getClass(className, hash))
- return;
- }
-
- broker->incOutstanding();
- char rawbuffer[512];
- Buffer buffer(rawbuffer, 512);
-
- uint32_t sequence = sequenceManager.reserve("startup");
- broker->encodeHeader(buffer, 'S', sequence);
- buffer.putShortString(packageName);
- buffer.putShortString(className);
- buffer.putBin128(hash);
- uint32_t length = 512 - buffer.available();
- buffer.reset();
- broker->connThreadBody.sendBuffer(buffer, length);
-}
-
-void SessionManager::handleMethodResp(Broker* broker, Buffer& buffer, uint32_t sequence)
-{
- if (broker->methodObject) {
- broker->methodObject->handleMethodResp(buffer, sequence);
- }
-}
-
-void SessionManager::handleHeartbeatInd(Broker* /*broker*/, Buffer& /*inBuffer*/, uint32_t /*sequence*/)
-{
-}
-
-void SessionManager::handleEventInd(Broker* broker, Buffer& buffer, uint32_t /*sequence*/)
-{
- string packageName;
- string className;
- uint8_t hash[16];
- SchemaClass* schemaClass;
-
- buffer.getShortString(packageName);
- buffer.getShortString(className);
- buffer.getBin128(hash);
-
- {
- Mutex::ScopedLock l(lock);
- map<string, Package*>::iterator pIter = packages.find(packageName);
- if (pIter == packages.end())
- return;
- schemaClass = pIter->second->getClass(className, hash);
- if (schemaClass == 0)
- return;
- }
-
- Event event(broker, schemaClass, buffer);
-
- if (listener)
- listener->event(event);
-}
-
-void SessionManager::handleSchemaResp(Broker* broker, Buffer& inBuffer, uint32_t sequence)
-{
- uint8_t kind;
- string packageName;
- string className;
- uint8_t hash[16];
-
- kind = inBuffer.getOctet();
- inBuffer.getShortString(packageName);
- inBuffer.getShortString(className);
- inBuffer.getBin128(hash);
-
- {
- Mutex::ScopedLock l(lock);
- map<string, Package*>::iterator pIter = packages.find(packageName);
- if (pIter != packages.end() && !pIter->second->getClass(className, hash)) {
- ClassKey key(packageName, className, hash);
- SchemaClass* schemaClass(new SchemaClass(kind, key, inBuffer));
- pIter->second->addClass(className, hash, schemaClass);
- if (listener != 0) {
- listener->newClass(schemaClass->getClassKey());
- }
- }
- }
-
- sequenceManager.release(sequence);
- broker->decOutstanding();
-}
-
-void SessionManager::handleContentInd(Broker* broker, Buffer& buffer, uint32_t sequence, bool prop, bool stat)
-{
- string packageName;
- string className;
- uint8_t hash[16];
- SchemaClass* schemaClass;
-
- buffer.getShortString(packageName);
- buffer.getShortString(className);
- buffer.getBin128(hash);
-
- {
- Mutex::ScopedLock l(lock);
- map<string, Package*>::iterator pIter = packages.find(packageName);
- if (pIter == packages.end())
- return;
- schemaClass = pIter->second->getClass(className, hash);
- if (schemaClass == 0)
- return;
- }
-
- Object object(broker, schemaClass, buffer, prop, stat);
-
- if (prop && className == "agent" && packageName == "org.apache.qpid.broker")
- broker->updateAgent(object);
-
- {
- Mutex::ScopedLock l(lock);
- if (syncSequenceList.count(sequence) == 1) {
- if (!object.isDeleted())
- getResult.push_back(object);
- }
- return;
- }
-
- if (listener) {
- if (prop)
- listener->objectProps(*broker, object);
- if (stat)
- listener->objectStats(*broker, object);
- }
-}
-
-void SessionManager::handleBrokerConnect(Broker* broker)
-{
- if (listener != 0)
- listener->brokerConnected(*broker);
-}
-
-void SessionManager::handleBrokerDisconnect(Broker* broker)
-{
- if (listener != 0)
- listener->brokerDisconnected(*broker);
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/SessionManager.h b/M4-RCs/qpid/cpp/src/qpid/console/SessionManager.h
deleted file mode 100644
index 27df00494c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/SessionManager.h
+++ /dev/null
@@ -1,199 +0,0 @@
-#ifndef _QPID_CONSOLE_SESSION_MANAGER_H
-#define _QPID_CONSOLE_SESSION_MANAGER_H
-
-/*
- *
- * 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 "Broker.h"
-#include "Package.h"
-#include "SequenceManager.h"
-#include "ClassKey.h"
-#include "Schema.h"
-#include "Agent.h"
-#include "Object.h"
-#include "ObjectId.h"
-#include "Value.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/Condition.h"
-#include "qpid/client/ConnectionSettings.h"
-#include <string>
-#include <vector>
-
-namespace qpid {
-namespace console {
-
-class ConsoleListener;
-
-/**
- *
- * \ingroup qmfconsoleapi
- */
-class SessionManager
-{
- public:
- typedef std::vector<std::string> NameVector;
- typedef std::vector<ClassKey> KeyVector;
- ~SessionManager() {}
-
- struct Settings {
- bool rcvObjects;
- bool rcvEvents;
- bool rcvHeartbeats;
- bool userBindings;
- uint32_t methodTimeout;
- uint32_t getTimeout;
-
- Settings() : rcvObjects(true), rcvEvents(true), rcvHeartbeats(true), userBindings(false),
- methodTimeout(20), getTimeout(20)
- {}
- };
-
- /** Create a new SessionManager
- *
- * Provide your own subclass of ConsoleListener to receive updates and indications
- * asynchronously or leave it as its default and use only synchronous methods.
- *
- *@param listener Listener object to receive asynchronous indications.
- *@param rcvObjects Listener wishes to receive managed object data.
- *@param rcvEvents Listener wishes to receive events.
- *@param rcvHeartbeats Listener wishes to receive agent heartbeats.
- *@param userBindings If rcvObjects is true, userBindings allows the console client
- * to control which object classes are received. See the bindPackage and bindClass
- * methods. If userBindings is false, the listener will receive updates for all
- * object classes.
- */
- SessionManager(ConsoleListener* listener = 0,
- Settings settings = Settings());
-
- /** Connect a broker to the console session
- *
- *@param settings Connection settings for client access
- *@return broker object if operation is successful
- * an exception shall be thrown.
- */
- Broker* addBroker(client::ConnectionSettings& settings);
-
- /** Disconnect a broker from the console session
- *
- *@param broker The broker object returned from an earlier call to addBroker.
- */
- void delBroker(Broker* broker);
-
- /** Get a list of known management packages
- *
- *@param packages Vector of package names returned by the session manager.
- */
- void getPackages(NameVector& packages);
-
- /** Get a list of class keys associated with a package
- *
- *@param classKeys List of class keys returned by the session manager.
- *@param packageName Name of package being queried.
- */
- void getClasses(KeyVector& classKeys, const std::string& packageName);
-
- /** Get the schema of a class given its class key
- *
- *@param classKey Class key of the desired schema.
- */
- SchemaClass& getSchema(const ClassKey& classKey);
-
- /** Request that updates be received for all classes within a package
- *
- * Note that this method is only meaningful if a ConsoleListener was provided at session
- * creation and if the 'userBindings' flag was set to true.
- *
- *@param packageName Name of the package to which to bind.
- */
- void bindPackage(const std::string& packageName);
-
- /** Request update to be received for a particular class
- *
- * Note that this method is only meaningful if a ConsoleListener was provided at session
- * creation and if the 'userBindings' flag was set to true.
- *
- *@param classKey Class key of class to which to bind.
- */
- void bindClass(const ClassKey& classKey);
- void bindClass(const std::string& packageName, const std::string& className);
-
- /** Get a list of qmf agents known to the session manager.
- *
- *@param agents Vector of Agent objects returned by the session manager.
- *@param broker Return agents registered with this broker only. If NULL, return agents
- * from all connected brokers.
- */
- void getAgents(Agent::Vector& agents, Broker* broker = 0);
-
- /** Get objects from agents. There are four variants of this method with different ways of
- * specifying from which class objects are being queried.
- *
- *@param objects List of objects received.
- *@param classKey ClassKey object identifying class to be queried.
- *@param className Class name identifying class to be queried.
- *@param objectId Object Id of the single object to be queried.
- *@param broker Restrict the query to this broker, or all brokers if NULL.
- *@param agent Restrict the query to this agent, or all agents if NULL.
- */
- void getObjects(Object::Vector& objects, const std::string& className,
- Broker* broker = 0, Agent* agent = 0);
- //void getObjects(Object::Vector& objects, const ClassKey& classKey,
- // Broker* broker = 0, Agent* agent = 0);
- //void getObjects(Object::Vector& objects, const ObjectId& objectId,
- // Broker* broker = 0, Agent* agent = 0);
-
-private:
- friend class Broker;
- friend class Broker::ConnectionThread;
- friend class Object;
- sys::Mutex lock;
- sys::Mutex brokerListLock;
- ConsoleListener* listener;
- std::vector<Broker*> brokers;
- std::map<std::string, Package*> packages;
- SequenceManager sequenceManager;
- sys::Condition cv;
- SequenceManager::set syncSequenceList;
- Object::Vector getResult;
- std::string error;
- Settings settings;
- NameVector bindingKeyList;
-
- void bindingKeys();
- void allBrokersStable();
- void startProtocol(Broker* broker);
- void handleBrokerResp(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
- void handlePackageInd(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
- void handleCommandComplete(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
- void handleClassInd(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
- void handleMethodResp(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
- void handleHeartbeatInd(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
- void handleEventInd(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
- void handleSchemaResp(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence);
- void handleContentInd(Broker* broker, framing::Buffer& inBuffer, uint32_t sequence, bool prop, bool stat);
- void handleBrokerConnect(Broker* broker);
- void handleBrokerDisconnect(Broker* broker);
-
-};
-
-}} // namespace qpid::console
-
-#endif /*!_QPID_CONSOLE_SESSION_MANAGER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Value.cpp b/M4-RCs/qpid/cpp/src/qpid/console/Value.cpp
deleted file mode 100644
index 532709ab05..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Value.cpp
+++ /dev/null
@@ -1,168 +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 "Value.h"
-#include "qpid/framing/Buffer.h"
-
-using namespace qpid::console;
-using namespace std;
-
-string NullValue::str() const
-{
- return "<Null>";
-}
-
-RefValue::RefValue(framing::Buffer& buffer)
-{
- uint64_t first = buffer.getLongLong();
- uint64_t second = buffer.getLongLong();
- value.setValue(first, second);
-}
-
-string RefValue::str() const
-{
- stringstream s;
- s << value;
- return s.str();
-}
-
-string UintValue::str() const
-{
- stringstream s;
- s << value;
- return s.str();
-}
-
-string IntValue::str() const
-{
- stringstream s;
- s << value;
- return s.str();
-}
-
-string Uint64Value::str() const
-{
- stringstream s;
- s << value;
- return s.str();
-}
-
-string Int64Value::str() const
-{
- stringstream s;
- s << value;
- return s.str();
-}
-
-StringValue::StringValue(framing::Buffer& buffer, int tc)
-{
- if (tc == 6)
- buffer.getShortString(value);
- else
- buffer.getMediumString(value);
-}
-
-string BoolValue::str() const
-{
- return value ? "T" : "F";
-}
-
-string FloatValue::str() const
-{
- stringstream s;
- s << value;
- return s.str();
-}
-
-string DoubleValue::str() const
-{
- stringstream s;
- s << value;
- return s.str();
-}
-
-UuidValue::UuidValue(framing::Buffer& buffer)
-{
- value.decode(buffer);
-}
-
-string MapValue::str() const
-{
- stringstream s;
- s << value;
- return s.str();
-}
-
-MapValue::MapValue(framing::Buffer& buffer)
-{
- value.decode(buffer);
-}
-
-
-Value::Ptr ValueFactory::newValue(int typeCode, framing::Buffer& buffer)
-{
- switch (typeCode) {
- case 1: return Value::Ptr(new UintValue(buffer.getOctet())); // U8
- case 2: return Value::Ptr(new UintValue(buffer.getShort())); // U16
- case 3: return Value::Ptr(new UintValue(buffer.getLong())); // U32
- case 4: return Value::Ptr(new Uint64Value(buffer.getLongLong())); // U64
- case 6: return Value::Ptr(new StringValue(buffer, 6)); // SSTR
- case 7: return Value::Ptr(new StringValue(buffer, 7)); // LSTR
- case 8: return Value::Ptr(new Int64Value(buffer.getLongLong())); // ABSTIME
- case 9: return Value::Ptr(new Uint64Value(buffer.getLongLong())); // DELTATIME
- case 10: return Value::Ptr(new RefValue(buffer)); // REF
- case 11: return Value::Ptr(new BoolValue(buffer.getOctet())); // BOOL
- case 12: return Value::Ptr(new FloatValue(buffer.getFloat())); // FLOAT
- case 13: return Value::Ptr(new DoubleValue(buffer.getDouble())); // DOUBLE
- case 14: return Value::Ptr(new UuidValue(buffer)); // UUID
- case 15: return Value::Ptr(new MapValue(buffer)); // MAP
- case 16: return Value::Ptr(new IntValue(buffer.getOctet())); // S8
- case 17: return Value::Ptr(new IntValue(buffer.getShort())); // S16
- case 18: return Value::Ptr(new IntValue(buffer.getLong())); // S32
- case 19: return Value::Ptr(new Int64Value(buffer.getLongLong())); // S64
- }
-
- return Value::Ptr();
-}
-
-void ValueFactory::encodeValue(int typeCode, Value::Ptr value, framing::Buffer& buffer)
-{
- switch (typeCode) {
- case 1: buffer.putOctet(value->asUint()); return; // U8
- case 2: buffer.putShort(value->asUint()); return; // U16
- case 3: buffer.putLong(value->asUint()); return; // U32
- case 4: buffer.putLongLong(value->asUint64()); return; // U64
- case 6: buffer.putShortString(value->asString()); return; // SSTR
- case 7: buffer.putMediumString(value->asString()); return; // LSTR
- case 8: buffer.putLongLong(value->asInt64()); return; // ABSTIME
- case 9: buffer.putLongLong(value->asUint64()); return; // DELTATIME
- case 10: value->asObjectId().encode(buffer); return; // REF
- case 11: buffer.putOctet(value->asBool() ? 1 : 0); return; // BOOL
- case 12: buffer.putFloat(value->asFloat()); return; // FLOAT
- case 13: buffer.putDouble(value->asDouble()); return; // DOUBLE
- case 14: value->asUuid().encode(buffer); return; // UUID
- case 15: value->asMap().encode(buffer); return; // MAP
- case 16: buffer.putOctet(value->asInt()); return; // S8
- case 17: buffer.putShort(value->asInt()); return; // S16
- case 18: buffer.putLong(value->asInt()); return; // S32
- case 19: buffer.putLongLong(value->asInt64()); return; // S64
- }
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/console/Value.h b/M4-RCs/qpid/cpp/src/qpid/console/Value.h
deleted file mode 100644
index 5a0915c69b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/console/Value.h
+++ /dev/null
@@ -1,207 +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.
- *
- */
-#ifndef _QPID_CONSOLE_VALUE_H_
-#define _QPID_CONSOLE_VALUE_H_
-
-#include "qpid/Exception.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/framing/FieldTable.h"
-#include "ObjectId.h"
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
-namespace framing {
- class Buffer;
-}
-namespace console {
-
- /**
- * \ingroup qmfconsoleapi
- */
- class Value {
-
- public:
- typedef boost::shared_ptr<Value> Ptr;
- virtual ~Value() {}
- virtual std::string str() const = 0;
-
- virtual bool isNull() const { return false; }
- virtual bool isObjectId() const { return false; }
- virtual bool isUint() const { return false; }
- virtual bool isInt() const { return false; }
- virtual bool isUint64() const { return false; }
- virtual bool isInt64() const { return false; }
- virtual bool isString() const { return false; }
- virtual bool isBool() const { return false; }
- virtual bool isFloat() const { return false; }
- virtual bool isDouble() const { return false; }
- virtual bool isUuid() const { return false; }
- virtual bool isMap() const { return false; }
-
- virtual ObjectId asObjectId() const { incompatible(); return ObjectId(); }
- virtual uint32_t asUint() const { incompatible(); return 0; }
- virtual int32_t asInt() const { incompatible(); return 0; }
- virtual uint64_t asUint64() const { incompatible(); return 0; }
- virtual int64_t asInt64() const { incompatible(); return 0; }
- virtual std::string asString() const { incompatible(); return std::string(); }
- virtual bool asBool() const { incompatible(); return false; }
- virtual float asFloat() const { incompatible(); return 0.0; }
- virtual double asDouble() const { incompatible(); return 0.0; }
- virtual framing::Uuid asUuid() const { incompatible(); return framing::Uuid(); }
- virtual framing::FieldTable asMap() const { incompatible(); return framing::FieldTable(); }
-
- private:
- void incompatible() const {
- throw Exception("Incompatible Type");
- }
- };
-
- class NullValue : public Value {
- public:
- NullValue() {}
- std::string str() const;
- bool isNull() const { return true; }
- };
-
- class RefValue : public Value {
- public:
- RefValue(ObjectId v) : value(v) {}
- RefValue(framing::Buffer& buffer);
- std::string str() const;
- bool isObjectId() const { return true; }
- ObjectId asObjectId() const { return value; }
- private:
- ObjectId value;
- };
-
- class UintValue : public Value {
- public:
- UintValue(uint32_t v) : value(v) {}
- std::string str() const;
- bool isUint() const { return true; }
- uint32_t asUint() const { return value; }
- private:
- uint32_t value;
- };
-
- class IntValue : public Value {
- public:
- IntValue(int32_t v) : value(v) {}
- std::string str() const;
- bool isInt() const { return true; }
- int32_t asInt() const { return value; }
- private:
- int32_t value;
- };
-
- class Uint64Value : public Value {
- public:
- Uint64Value(uint64_t v) : value(v) {}
- std::string str() const;
- bool isUint64() const { return true; }
- uint64_t asUint64() const { return value; }
- private:
- uint64_t value;
- };
-
- class Int64Value : public Value {
- public:
- Int64Value(int64_t v) : value(v) {}
- std::string str() const;
- bool isInt64() const { return true; }
- int64_t asInt64() const { return value; }
- private:
- int64_t value;
- };
-
- class StringValue : public Value {
- public:
- StringValue(const std::string& v) : value(v) {}
- StringValue(framing::Buffer& buffer, int tc);
- std::string str() const { return value; }
- bool isString() const { return true; }
- std::string asString() const { return value; }
- private:
- std::string value;
- };
-
- class BoolValue : public Value {
- public:
- BoolValue(bool v) : value(v) {}
- BoolValue(uint8_t v) : value(v != 0) {}
- std::string str() const;
- bool isBool() const { return true; }
- bool asBool() const { return value; }
- private:
- bool value;
- };
-
- class FloatValue : public Value {
- public:
- FloatValue(float v) : value(v) {}
- std::string str() const;
- bool isFloat() const { return true; }
- float asFloat() const { return value; }
- private:
- float value;
- };
-
- class DoubleValue : public Value {
- public:
- DoubleValue(double v) : value(v) {}
- std::string str() const;
- bool isDouble() const { return true; }
- double asDouble() const { return value; }
- private:
- double value;
- };
-
- class UuidValue : public Value {
- public:
- UuidValue(const framing::Uuid& v) : value(v) {}
- UuidValue(framing::Buffer& buffer);
- std::string str() const { return value.str(); }
- bool isUuid() const { return true; }
- framing::Uuid asUuid() const { return value; }
- private:
- framing::Uuid value;
- };
-
- class MapValue : public Value {
- public:
- MapValue(const framing::FieldTable& v) : value(v) {}
- MapValue(framing::Buffer& buffer);
- std::string str() const;
- bool isMap() const { return true; }
- framing::FieldTable asMap() const { return value; }
- private:
- framing::FieldTable value;
- };
-
- class ValueFactory {
- public:
- static Value::Ptr newValue(int typeCode, framing::Buffer& buffer);
- static void encodeValue(int typeCode, Value::Ptr value, framing::Buffer& buffer);
- };
-}
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQBody.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/AMQBody.cpp
deleted file mode 100644
index b3eeae0615..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQBody.cpp
+++ /dev/null
@@ -1,64 +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 "qpid/framing/AMQBody.h"
-#include "qpid/framing/AMQMethodBody.h"
-#include "qpid/framing/AMQHeaderBody.h"
-#include "qpid/framing/AMQContentBody.h"
-#include "qpid/framing/AMQHeartbeatBody.h"
-#include <iostream>
-
-namespace qpid {
-namespace framing {
-
-std::ostream& operator<<(std::ostream& out, const AMQBody& body)
-{
- body.print(out);
- return out;
-}
-
-AMQBody::~AMQBody() {}
-
-namespace {
-struct MatchBodies : public AMQBodyConstVisitor {
- const AMQBody& body;
- bool match;
-
- MatchBodies(const AMQBody& b) : body(b), match(false) {}
- virtual ~MatchBodies() {}
-
- virtual void visit(const AMQHeaderBody&) { match=dynamic_cast<const AMQHeaderBody*>(&body); }
- virtual void visit(const AMQContentBody&) { match=dynamic_cast<const AMQContentBody*>(&body); }
- virtual void visit(const AMQHeartbeatBody&) { match=dynamic_cast<const AMQHeartbeatBody*>(&body); }
- virtual void visit(const AMQMethodBody& x) {
- const AMQMethodBody* y=dynamic_cast<const AMQMethodBody*>(&body);
- match = (y && y->amqpMethodId() == x.amqpMethodId() && y->amqpClassId() == x.amqpClassId());
- }
-};
-
-}
-bool AMQBody::match(const AMQBody& a, const AMQBody& b) {
- MatchBodies matcher(a);
- b.accept(matcher);
- return matcher.match;
-}
-
-}} // namespace
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQBody.h b/M4-RCs/qpid/cpp/src/qpid/framing/AMQBody.h
deleted file mode 100644
index 93f4319575..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQBody.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef QPID_FRAMING_AMQBODY_H
-#define QPID_FRAMING_AMQBODY_H
-
-/*
- *
- * 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 "qpid/framing/amqp_types.h"
-
-#include <ostream>
-
-namespace qpid {
-namespace framing {
-
-class Buffer;
-
-class AMQMethodBody;
-class AMQHeaderBody;
-class AMQContentBody;
-class AMQHeartbeatBody;
-
-struct AMQBodyConstVisitor {
- virtual ~AMQBodyConstVisitor() {}
- virtual void visit(const AMQHeaderBody&) = 0;
- virtual void visit(const AMQContentBody&) = 0;
- virtual void visit(const AMQHeartbeatBody&) = 0;
- virtual void visit(const AMQMethodBody&) = 0;
-};
-
-class AMQBody
-{
- public:
- virtual ~AMQBody();
-
- virtual uint8_t type() const = 0;
-
- virtual void encode(Buffer& buffer) const = 0;
- virtual void decode(Buffer& buffer, uint32_t=0) = 0;
- virtual uint32_t encodedSize() const = 0;
-
- virtual void print(std::ostream& out) const = 0;
- virtual void accept(AMQBodyConstVisitor&) const = 0;
-
- virtual AMQMethodBody* getMethod() { return 0; }
- virtual const AMQMethodBody* getMethod() const { return 0; }
-
- /** Match if same type and same class/method ID for methods */
- static bool match(const AMQBody& , const AMQBody& );
-};
-
-std::ostream& operator<<(std::ostream& out, const AMQBody& body) ;
-
-enum BodyTypes {
- METHOD_BODY = 1,
- HEADER_BODY = 2,
- CONTENT_BODY = 3,
- HEARTBEAT_BODY = 8
-};
-
-}} // namespace qpid::framing
-
-#endif /*!QPID_FRAMING_AMQBODY_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQCommandControlBody.h b/M4-RCs/qpid/cpp/src/qpid/framing/AMQCommandControlBody.h
deleted file mode 100644
index d12b70a168..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQCommandControlBody.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef QPID_FRAMING_AMQCOMMANDCONTROLBODY_H
-#define QPID_FRAMING_AMQCOMMANDCONTROLBODY_H
-
-/*
- *
- * 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 "qpid/amqp_0_10/helpers.h"
-#include "qpid/framing/AMQBody.h"
-
-namespace qpid {
-namespace framing {
-
-/**
- * AMQBody wrapper for Command and Control.
- * Temporary measure to fit with old code.
- */
-template <class T> class AMQCommandControlBody : public AMQBody, public T
-{
- public:
- virtual uint8_t type() const { return 100+T::SEGMENT_TYPE; }
-
- virtual void encode(Buffer& buffer) const {
- Codec::encode(buffer.getIterator(), static_cast<const T&>(*this));
- }
- virtual void decode(Buffer& buffer, uint32_t=0) {
- Codec::decode(buffer.getIterator(), static_cast<T&>(*this));
- }
- virtual uint32_t encodedSize() const {
- Codec::size(buffer.getIterator(), static_cast<const T&>(*this));
- }
-
- virtual void print(std::ostream& out) const {
- out << static_cast<const T&>(*this) << endl;
- }
- virtual void AMQBody::accept(AMQBodyConstVisitor&) const { assert(0); }
-};
-
-class CommandBody : public AMQCommandControlBody<amqp_0_10::Command> {
- using Command::accept; // Hide AMQBody::accept
- virtual Command* getCommand() { return this; }
- virtual const Command* getCommand() const { return this; }
-};
-
-class ControlBody : public AMQCommandControlBody<amqp_0_10::Control> {
- using Control::accept; // Hide AMQBody::accept
- virtual Control* getControl() { return this; }
- virtual const Control* getControl() const { return this; }
-};
-
-}} // namespace qpid::framing
-
-#endif /*!QPID_FRAMING_AMQCOMMANDCONTROLBODY_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQContentBody.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/AMQContentBody.cpp
deleted file mode 100644
index 85fb95739b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQContentBody.cpp
+++ /dev/null
@@ -1,44 +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 "AMQContentBody.h"
-#include <iostream>
-
-qpid::framing::AMQContentBody::AMQContentBody(){
-}
-
-qpid::framing::AMQContentBody::AMQContentBody(const string& _data) : data(_data){
-}
-
-uint32_t qpid::framing::AMQContentBody::encodedSize() const{
- return data.size();
-}
-void qpid::framing::AMQContentBody::encode(Buffer& buffer) const{
- buffer.putRawData(data);
-}
-void qpid::framing::AMQContentBody::decode(Buffer& buffer, uint32_t _size){
- buffer.getRawData(data, _size);
-}
-
-void qpid::framing::AMQContentBody::print(std::ostream& out) const
-{
- out << "content (" << encodedSize() << " bytes)";
- out << " " << data.substr(0,16) << "...";
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQContentBody.h b/M4-RCs/qpid/cpp/src/qpid/framing/AMQContentBody.h
deleted file mode 100644
index 288f1549a9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQContentBody.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.
- *
- */
-#include "amqp_types.h"
-#include "AMQBody.h"
-#include "Buffer.h"
-
-#ifndef _AMQContentBody_
-#define _AMQContentBody_
-
-namespace qpid {
-namespace framing {
-
-class AMQContentBody : public AMQBody
-{
- string data;
-
-public:
- AMQContentBody();
- AMQContentBody(const string& data);
- inline virtual ~AMQContentBody(){}
- inline uint8_t type() const { return CONTENT_BODY; };
- inline const string& getData() const { return data; }
- inline string& getData() { return data; }
- uint32_t encodedSize() const;
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer, uint32_t size);
- void print(std::ostream& out) const;
- void accept(AMQBodyConstVisitor& v) const { v.visit(*this); }
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQDataBlock.h b/M4-RCs/qpid/cpp/src/qpid/framing/AMQDataBlock.h
deleted file mode 100644
index 0b1f459627..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQDataBlock.h
+++ /dev/null
@@ -1,42 +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 "Buffer.h"
-
-#ifndef _AMQDataBlock_
-#define _AMQDataBlock_
-
-namespace qpid {
-namespace framing {
-
-class AMQDataBlock
-{
-public:
- virtual ~AMQDataBlock() {}
- virtual void encode(Buffer& buffer) const = 0;
- virtual bool decode(Buffer& buffer) = 0;
- virtual uint32_t encodedSize() const = 0;
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQFrame.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/AMQFrame.cpp
deleted file mode 100644
index 98a1354811..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQFrame.cpp
+++ /dev/null
@@ -1,124 +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 "AMQFrame.h"
-
-#include "qpid/framing/variant.h"
-#include "qpid/framing/AMQMethodBody.h"
-#include "qpid/framing/reply_exceptions.h"
-
-#include <boost/format.hpp>
-
-#include <iostream>
-
-namespace qpid {
-namespace framing {
-
-AMQFrame::~AMQFrame() {}
-
-void AMQFrame::setBody(const AMQBody& b) { body = new BodyHolder(b); }
-
-void AMQFrame::setMethod(ClassId c, MethodId m) { body = new BodyHolder(c,m); }
-
-uint32_t AMQFrame::encodedSize() const {
- return frameOverhead() + body->encodedSize();
-}
-
-uint32_t AMQFrame::frameOverhead() {
- return 12 /*frame header*/;
-}
-
-uint16_t AMQFrame::DECODE_SIZE_MIN=4;
-
-uint16_t AMQFrame::decodeSize(char* data) {
- Buffer buf(data+2, DECODE_SIZE_MIN);
- return buf.getShort();
-}
-
-void AMQFrame::encode(Buffer& buffer) const
-{
- //set track first (controls on track 0, everything else on 1):
- uint8_t track = getBody()->type() ? 1 : 0;
-
- uint8_t flags = (bof ? 0x08 : 0) | (eof ? 0x04 : 0) | (bos ? 0x02 : 0) | (eos ? 0x01 : 0);
- buffer.putOctet(flags);
- buffer.putOctet(getBody()->type());
- buffer.putShort(encodedSize());
- buffer.putOctet(0);
- buffer.putOctet(0x0f & track);
- buffer.putShort(channel);
- buffer.putLong(0);
- body->encode(buffer);
-}
-
-bool AMQFrame::decode(Buffer& buffer)
-{
- if(buffer.available() < frameOverhead())
- return false;
- buffer.record();
-
- uint8_t flags = buffer.getOctet();
- uint8_t framing_version = (flags & 0xc0) >> 6;
- if (framing_version != 0)
- throw FramingErrorException(QPID_MSG("Framing version unsupported"));
- bof = flags & 0x08;
- eof = flags & 0x04;
- bos = flags & 0x02;
- eos = flags & 0x01;
- uint8_t type = buffer.getOctet();
- uint16_t frame_size = buffer.getShort();
- if (frame_size < frameOverhead())
- throw FramingErrorException(QPID_MSG("Frame size too small " << frame_size));
- uint8_t reserved1 = buffer.getOctet();
- uint8_t field1 = buffer.getOctet();
- subchannel = field1 & 0x0f;
- channel = buffer.getShort();
- (void) buffer.getLong(); // reserved2
-
- // Verify that the protocol header meets current spec
- // TODO: should we check reserved2 against zero as well? - the
- // spec isn't clear
- if ((flags & 0x30) != 0 || reserved1 != 0 || (field1 & 0xf0) != 0)
- throw FramingErrorException(QPID_MSG("Reserved bits not zero"));
-
- // TODO: should no longer care about body size and only pass up
- // B,E,b,e flags
- uint16_t body_size = frame_size - frameOverhead();
- if (buffer.available() < body_size){
- buffer.restore();
- return false;
- }
- body = new BodyHolder();
- body->decode(type,buffer, body_size);
- return true;
-}
-
-std::ostream& operator<<(std::ostream& out, const AMQFrame& f)
-{
- return
- out << "Frame["
- << (f.getBof() ? "B" : "") << (f.getEof() ? "E" : "")
- << (f.getBos() ? "b" : "") << (f.getEos() ? "e" : "") << "; "
- << "channel=" << f.getChannel() << "; " << *f.getBody()
- << "]";
-}
-
-
-}} // namespace qpid::framing
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQFrame.h b/M4-RCs/qpid/cpp/src/qpid/framing/AMQFrame.h
deleted file mode 100644
index ddfe438806..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQFrame.h
+++ /dev/null
@@ -1,128 +0,0 @@
-#ifndef _AMQFrame_
-#define _AMQFrame_
-
-/*
- *
- * 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 "AMQDataBlock.h"
-#include "AMQHeaderBody.h"
-#include "AMQContentBody.h"
-#include "AMQHeartbeatBody.h"
-#include "ProtocolVersion.h"
-#include "BodyHolder.h"
-
-#include <boost/intrusive_ptr.hpp>
-#include <boost/cast.hpp>
-
-namespace qpid {
-namespace framing {
-
-class BodyHolder;
-
-class AMQFrame : public AMQDataBlock
-{
- public:
- AMQFrame(boost::intrusive_ptr<BodyHolder> b=0) : body(b) { init(); }
- AMQFrame(const AMQBody& b) { setBody(b); init(); }
- ~AMQFrame();
-
- template <class InPlace>
- AMQFrame(const InPlace& ip, typename EnableInPlace<InPlace>::type* =0) {
- init(); setBody(ip);
- }
-
- ChannelId getChannel() const { return channel; }
- void setChannel(ChannelId c) { channel = c; }
-
- boost::intrusive_ptr<BodyHolder> getHolder() { return body; }
-
- AMQBody* getBody() { return body ? body->get() : 0; }
- const AMQBody* getBody() const { return body ? body->get() : 0; }
-
- AMQMethodBody* getMethod() { return getBody()->getMethod(); }
- const AMQMethodBody* getMethod() const { return getBody()->getMethod(); }
-
- void setBody(const AMQBody& b);
-
- template <class InPlace>
- typename EnableInPlace<InPlace>::type setBody(const InPlace& ip) {
- body = new BodyHolder(ip);
- }
-
- void setMethod(ClassId c, MethodId m);
-
- template <class T> T* castBody() {
- return boost::polymorphic_downcast<T*>(getBody());
- }
-
- template <class T> const T* castBody() const {
- return boost::polymorphic_downcast<const T*>(getBody());
- }
-
- void encode(Buffer& buffer) const;
- bool decode(Buffer& buffer);
- uint32_t encodedSize() const;
-
- // 0-10 terminology: first/last frame (in segment) first/last segment (in assembly)
-
- bool isFirstSegment() const { return bof; }
- bool isLastSegment() const { return eof; }
- bool isFirstFrame() const { return bos; }
- bool isLastFrame() const { return eos; }
-
- void setFirstSegment(bool set=true) { bof = set; }
- void setLastSegment(bool set=true) { eof = set; }
- void setFirstFrame(bool set=true) { bos = set; }
- void setLastFrame(bool set=true) { eos = set; }
-
- // 0-9 terminology: beginning/end of frameset, beginning/end of segment.
-
- bool getBof() const { return bof; }
- void setBof(bool isBof) { bof = isBof; }
- bool getEof() const { return eof; }
- void setEof(bool isEof) { eof = isEof; }
-
- bool getBos() const { return bos; }
- void setBos(bool isBos) { bos = isBos; }
- bool getEos() const { return eos; }
- void setEos(bool isEos) { eos = isEos; }
-
- static uint16_t DECODE_SIZE_MIN;
- static uint32_t frameOverhead();
- /** Must point to at least DECODE_SIZE_MIN bytes of data */
- static uint16_t decodeSize(char* data);
- private:
- void init() { bof = eof = bos = eos = true; subchannel=0; channel=0; }
-
- boost::intrusive_ptr<BodyHolder> body;
- uint16_t channel : 16;
- uint8_t subchannel : 8;
- bool bof : 1;
- bool eof : 1;
- bool bos : 1;
- bool eos : 1;
-};
-
-std::ostream& operator<<(std::ostream&, const AMQFrame&);
-
-}} // namespace qpid::framing
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeaderBody.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeaderBody.cpp
deleted file mode 100644
index 276418b208..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeaderBody.cpp
+++ /dev/null
@@ -1,63 +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 "AMQHeaderBody.h"
-#include "qpid/Exception.h"
-#include "qpid/log/Statement.h"
-
-uint32_t qpid::framing::AMQHeaderBody::encodedSize() const {
- return properties.encodedSize();
-}
-
-void qpid::framing::AMQHeaderBody::encode(Buffer& buffer) const {
- properties.encode(buffer);
-}
-
-void qpid::framing::AMQHeaderBody::decode(Buffer& buffer, uint32_t size) {
- uint32_t limit = buffer.available() - size;
- while (buffer.available() > limit + 2) {
- uint32_t len = buffer.getLong();
- uint16_t type = buffer.getShort();
- if (!properties.decode(buffer, len, type)) {
- // TODO: should just skip & keep for later dispatch.
- throw Exception(QPID_MSG("Unexpected property type: " << type));
- }
- }
-}
-
-uint64_t qpid::framing::AMQHeaderBody::getContentLength() const
-{
- const MessageProperties* mProps = get<MessageProperties>();
- if (mProps)
- return mProps->getContentLength();
- return 0;
-}
-
-void qpid::framing::AMQHeaderBody::print(std::ostream& out) const
-{
- out << "header (" << encodedSize() << " bytes)";
- out << "; properties={";
- properties.print(out);
- out << "}";
-}
-
-void qpid::framing::AMQHeaderBody::accept(AMQBodyConstVisitor& v) const {
- v.visit(*this);
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeaderBody.h b/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeaderBody.h
deleted file mode 100644
index 7ddb7d89cf..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeaderBody.h
+++ /dev/null
@@ -1,108 +0,0 @@
-#ifndef QPID_FRAMING_AMQHEADERBODY_H
-#define QPID_FRAMING_AMQHEADERBODY_H
-
-/*
- *
- * 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 "amqp_types.h"
-#include "AMQBody.h"
-#include "Buffer.h"
-#include "qpid/framing/DeliveryProperties.h"
-#include "qpid/framing/MessageProperties.h"
-#include <iostream>
-
-#include <boost/optional.hpp>
-
-
-namespace qpid {
-namespace framing {
-
-enum DeliveryMode { TRANSIENT = 1, PERSISTENT = 2};
-
-class AMQHeaderBody : public AMQBody
-{
- template <class T> struct OptProps { boost::optional<T> props; };
- template <class Base, class T>
- struct PropSet : public Base, public OptProps<T> {
- uint32_t encodedSize() const {
- const boost::optional<T>& p=this->OptProps<T>::props;
- return (p ? p->encodedSize() : 0) + Base::encodedSize();
- }
- void encode(Buffer& buffer) const {
- const boost::optional<T>& p=this->OptProps<T>::props;
- if (p) p->encode(buffer);
- Base::encode(buffer);
- }
- bool decode(Buffer& buffer, uint32_t size, uint16_t type) {
- boost::optional<T>& p=this->OptProps<T>::props;
- if (type == T::TYPE) {
- p=T();
- p->decodeStructBody(buffer, size);
- return true;
- }
- else
- return Base::decode(buffer, size, type);
- }
- void print(std::ostream& out) const {
- const boost::optional<T>& p=this->OptProps<T>::props;
- if (p) out << *p;
- Base::print(out);
- }
- };
-
- struct Empty {
- uint32_t encodedSize() const { return 0; }
- void encode(Buffer&) const {};
- bool decode(Buffer&, uint32_t, uint16_t) const { return false; };
- void print(std::ostream&) const {}
- };
-
- // Could use boost::mpl::fold to construct a larger set.
- typedef PropSet<PropSet<Empty, DeliveryProperties>, MessageProperties> Properties;
-
- Properties properties;
-
-public:
-
- inline uint8_t type() const { return HEADER_BODY; }
-
- uint32_t encodedSize() const;
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer, uint32_t size);
- uint64_t getContentLength() const;
- void print(std::ostream& out) const;
- void accept(AMQBodyConstVisitor&) const;
-
- template <class T> T* get(bool create) {
- boost::optional<T>& p=properties.OptProps<T>::props;
- if (create && !p) p=T();
- return p.get_ptr();
- }
-
- template <class T> const T* get() const {
- return properties.OptProps<T>::props.get_ptr();
- }
-};
-
-}}
-
-
-
-#endif /*!QPID_FRAMING_AMQHEADERBODY_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.cpp
deleted file mode 100644
index 140ce2e794..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.cpp
+++ /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.
- *
- */
-
-#include "AMQHeartbeatBody.h"
-#include <iostream>
-
-qpid::framing::AMQHeartbeatBody::~AMQHeartbeatBody() {}
-
-void qpid::framing::AMQHeartbeatBody::print(std::ostream& out) const {
- out << "heartbeat";
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.h b/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.h
deleted file mode 100644
index 7b42b46e5c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQHeartbeatBody.h
+++ /dev/null
@@ -1,46 +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 "amqp_types.h"
-#include "AMQBody.h"
-#include "Buffer.h"
-
-#ifndef _AMQHeartbeatBody_
-#define _AMQHeartbeatBody_
-
-namespace qpid {
-namespace framing {
-
-class AMQHeartbeatBody : public AMQBody
-{
-public:
- virtual ~AMQHeartbeatBody();
- inline uint32_t encodedSize() const { return 0; }
- inline uint8_t type() const { return HEARTBEAT_BODY; }
- inline void encode(Buffer& ) const {}
- inline void decode(Buffer& , uint32_t /*size*/) {}
- virtual void print(std::ostream& out) const;
- void accept(AMQBodyConstVisitor& v) const { v.visit(*this); }
-};
-
-}
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp
deleted file mode 100644
index 924d906d43..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQMethodBody.cpp
+++ /dev/null
@@ -1,28 +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 "AMQMethodBody.h"
-
-namespace qpid {
-namespace framing {
-
-AMQMethodBody::~AMQMethodBody() {}
-
-}} // namespace qpid::framing
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQMethodBody.h b/M4-RCs/qpid/cpp/src/qpid/framing/AMQMethodBody.h
deleted file mode 100644
index cc7489ddd9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQMethodBody.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#ifndef _AMQMethodBody_
-#define _AMQMethodBody_
-
-/*
- *
- * 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 "amqp_types.h"
-#include "AMQBody.h"
-#include "qpid/framing/ProtocolVersion.h"
-#include "qpid/shared_ptr.h"
-
-#include <ostream>
-
-#include <assert.h>
-
-namespace qpid {
-namespace framing {
-
-class Buffer;
-class AMQP_ServerOperations;
-class MethodBodyConstVisitor;
-
-class AMQMethodBody : public AMQBody {
- public:
- AMQMethodBody() {}
- virtual ~AMQMethodBody();
-
- virtual void accept(MethodBodyConstVisitor&) const = 0;
-
- virtual MethodId amqpMethodId() const = 0;
- virtual ClassId amqpClassId() const = 0;
- virtual bool isContentBearing() const = 0;
- virtual bool resultExpected() const = 0;
- virtual bool responseExpected() const = 0;
-
- template <class T> bool isA() const {
- return amqpClassId()==T::CLASS_ID && amqpMethodId()==T::METHOD_ID;
- }
-
- virtual uint32_t encodedSize() const = 0;
- virtual uint8_t type() const { return METHOD_BODY; }
-
- virtual bool isSync() const { return false; /*only ModelMethods can have the sync flag set*/ }
- virtual void setSync(bool) const { /*only ModelMethods can have the sync flag set*/ }
-
- AMQMethodBody* getMethod() { return this; }
- const AMQMethodBody* getMethod() const { return this; }
- void accept(AMQBodyConstVisitor& v) const { v.visit(*this); }
-};
-
-
-}} // namespace qpid::framing
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AMQP_HighestVersion.h b/M4-RCs/qpid/cpp/src/qpid/framing/AMQP_HighestVersion.h
deleted file mode 100644
index 42139c7937..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AMQP_HighestVersion.h
+++ /dev/null
@@ -1,40 +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 file used to be auto-generated by Qpid Gentools v.0.1
- * its here temporarily until we get a full solution to multi-version support
- */
-#ifndef qpid_framing_highestProtocolVersion__
-#define qpid_framing_highestProtocolVersion__
-
-#include "qpid/framing/ProtocolVersion.h"
-
-
-namespace qpid {
-namespace framing {
-
-static ProtocolVersion highestProtocolVersion(0, 10);
-
-} /* namespace framing */
-} /* namespace qpid */
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AccumulatedAck.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/AccumulatedAck.cpp
deleted file mode 100644
index 2d3ecf3f6a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AccumulatedAck.cpp
+++ /dev/null
@@ -1,164 +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 "AccumulatedAck.h"
-
-#include <assert.h>
-#include <iostream>
-#include <boost/bind.hpp>
-
-using std::list;
-using std::max;
-using std::min;
-using namespace qpid::framing;
-
-AccumulatedAck::AccumulatedAck(SequenceNumber r) : mark(r) {}
-
-void AccumulatedAck::update(SequenceNumber first, SequenceNumber last){
- assert(first <= last);
- if (last < mark) return;
-
-
- Range r(first, last);
- bool handled = false;
- bool markMerged = false;
- list<Range>::iterator merged = ranges.end();
- if (r.mergeable(mark)) {
- mark = r.end;
- markMerged = true;
- handled = true;
- } else {
- for (list<Range>::iterator i = ranges.begin(); i != ranges.end() && !handled; i++) {
- if (i->merge(r)) {
- merged = i;
- handled = true;
- } else if (r.start < i->start) {
- ranges.insert(i, r);
- handled = true;
- }
- }
- }
- if (!handled) {
- ranges.push_back(r);
- } else {
- while (!ranges.empty() && ranges.front().end <= mark) {
- ranges.pop_front();
- }
- if (markMerged) {
- //new range is incorporated, but may be possible to consolidate
- merged = ranges.begin();
- while (merged != ranges.end() && merged->mergeable(mark)) {
- mark = merged->end;
- merged = ranges.erase(merged);
- }
- }
- if (merged != ranges.end()) {
- //consolidate ranges
- list<Range>::iterator i = merged;
- list<Range>::iterator j = i++;
- while (i != ranges.end() && j->merge(*i)) {
- j = i++;
- }
- }
- }
-}
-
-void AccumulatedAck::consolidate(){}
-
-void AccumulatedAck::clear(){
- mark = SequenceNumber(0);//not sure that this is valid when wraparound is a possibility
- ranges.clear();
-}
-
-bool AccumulatedAck::covers(SequenceNumber tag) const{
- if (tag <= mark) return true;
- for (list<Range>::const_iterator i = ranges.begin(); i != ranges.end(); i++) {
- if (i->contains(tag)) return true;
- }
- return false;
-}
-
-void AccumulatedAck::collectRanges(SequenceNumberSet& set) const
-{
- for (list<Range>::const_iterator i = ranges.begin(); i != ranges.end(); i++) {
- set.push_back(i->start);
- set.push_back(i->end);
- }
-}
-
-void AccumulatedAck::update(const SequenceNumber cumulative, const SequenceNumberSet& range)
-{
- update(mark, cumulative);
- range.processRanges(*this);
-}
-
-
-bool Range::contains(SequenceNumber i) const
-{
- return i >= start && i <= end;
-}
-
-bool Range::intersect(const Range& r) const
-{
- return r.contains(start) || r.contains(end) || contains(r.start) || contains(r.end);
-}
-
-bool Range::merge(const Range& r)
-{
- if (intersect(r) || mergeable(r.end) || r.mergeable(end)) {
- start = min(start, r.start);
- end = max(end, r.end);
- return true;
- } else {
- return false;
- }
-}
-
-bool Range::mergeable(const SequenceNumber& s) const
-{
- if (contains(s) || start - s == 1) {
- return true;
- } else {
- return false;
- }
-}
-
-Range::Range(SequenceNumber s, SequenceNumber e) : start(s), end(e) {}
-
-
-namespace qpid{
-namespace framing{
- std::ostream& operator<<(std::ostream& out, const Range& r)
- {
- out << "[" << r.start.getValue() << "-" << r.end.getValue() << "]";
- return out;
- }
-
- std::ostream& operator<<(std::ostream& out, const AccumulatedAck& a)
- {
- out << "{mark: " << a.mark.getValue() << ", ranges: (";
- for (list<Range>::const_iterator i = a.ranges.begin(); i != a.ranges.end(); i++) {
- if (i != a.ranges.begin()) out << ", ";
- out << *i;
- }
- out << ")]";
- return out;
- }
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/AccumulatedAck.h b/M4-RCs/qpid/cpp/src/qpid/framing/AccumulatedAck.h
deleted file mode 100644
index ea78b797e0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/AccumulatedAck.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.
- *
- */
-#ifndef _AccumulatedAck_
-#define _AccumulatedAck_
-
-#include <algorithm>
-#include <functional>
-#include <list>
-#include <ostream>
-#include "SequenceNumber.h"
-#include "SequenceNumberSet.h"
-
-namespace qpid {
- namespace framing {
-
- struct Range
- {
- SequenceNumber start;
- SequenceNumber end;
-
- Range(SequenceNumber s, SequenceNumber e);
- bool contains(SequenceNumber i) const;
- bool intersect(const Range& r) const;
- bool merge(const Range& r);
- bool mergeable(const SequenceNumber& r) const;
- };
- /**
- * Keeps an accumulated record of acknowledged messages (by delivery
- * tag).
- */
- class AccumulatedAck {
- public:
- /**
- * Everything up to this value has been acknowledged.
- */
- SequenceNumber mark;
- /**
- * List of individually acknowledged messages greater than the
- * 'mark'.
- */
- std::list<Range> ranges;
-
- explicit AccumulatedAck(SequenceNumber r = SequenceNumber());
- void update(SequenceNumber firstTag, SequenceNumber lastTag);
- void consolidate();
- void clear();
- bool covers(SequenceNumber tag) const;
- void collectRanges(SequenceNumberSet& set) const;
- void update(const SequenceNumber cumulative, const SequenceNumberSet& range);
- void operator()(SequenceNumber first, SequenceNumber last) { update(first, last); }
- };
- std::ostream& operator<<(std::ostream&, const Range&);
- std::ostream& operator<<(std::ostream&, const AccumulatedAck&);
- }
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Array.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/Array.cpp
deleted file mode 100644
index 9f072f7b05..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Array.cpp
+++ /dev/null
@@ -1,129 +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 "Array.h"
-#include "Buffer.h"
-#include "FieldValue.h"
-#include "qpid/Exception.h"
-#include "qpid/framing/reply_exceptions.h"
-#include <assert.h>
-
-namespace qpid {
-namespace framing {
-
-Array::Array() : type(TYPE_CODE_VOID) {}
-
-Array::Array(TypeCode t) : type(t) {}
-
-Array::Array(uint8_t t) : type(typeCode(t)) {}
-
-Array::Array(const std::vector<std::string>& in)
-{
- type = TYPE_CODE_STR16;
- for (std::vector<std::string>::const_iterator i = in.begin(); i != in.end(); ++i) {
- ValuePtr value(new Str16Value(*i));
- values.push_back(value);
- }
-}
-
-uint32_t Array::encodedSize() const {
- //note: size is only included when used as a 'top level' type
- uint32_t len(4/*size*/ + 1/*type*/ + 4/*count*/);
- for(ValueVector::const_iterator i = values.begin(); i != values.end(); ++i) {
- len += (*i)->getData().encodedSize();
- }
- return len;
-}
-
-int Array::count() const {
- return values.size();
-}
-
-std::ostream& operator<<(std::ostream& out, const Array& a) {
- out << typeName(a.getType()) << "{";
- for(Array::ValueVector::const_iterator i = a.values.begin(); i != a.values.end(); ++i) {
- if (i != a.values.begin()) out << ", ";
- (*i)->print(out);
- }
- return out << "}";
-}
-
-void Array::encode(Buffer& buffer) const{
- buffer.putLong(encodedSize() - 4);//size added only when array is a top-level type
- buffer.putOctet(type);
- buffer.putLong(count());
- for (ValueVector::const_iterator i = values.begin(); i!=values.end(); ++i) {
- (*i)->getData().encode(buffer);
- }
-}
-
-void Array::decode(Buffer& buffer){
- uint32_t size = buffer.getLong();//size added only when array is a top-level type
- uint32_t available = buffer.available();
- if (available < size) {
- throw IllegalArgumentException(QPID_MSG("Not enough data for array, expected "
- << size << " bytes but only " << available << " available"));
- }
- if (size) {
- type = TypeCode(buffer.getOctet());
- uint32_t count = buffer.getLong();
-
- FieldValue dummy;
- dummy.setType(type);
- available = buffer.available();
- if (available < count * dummy.getData().encodedSize()) {
- throw IllegalArgumentException(QPID_MSG("Not enough data for array, expected "
- << count << " items of " << dummy.getData().encodedSize()
- << " bytes each but only " << available << " bytes available"));
- }
-
- for (uint32_t i = 0; i < count; i++) {
- ValuePtr value(new FieldValue);
- value->setType(type);
- value->getData().decode(buffer);
- values.push_back(ValuePtr(value));
- }
- }
-}
-
-
-bool Array::operator==(const Array& x) const {
- if (type != x.type) return false;
- if (values.size() != x.values.size()) return false;
-
- for (ValueVector::const_iterator i = values.begin(), j = x.values.begin(); i != values.end(); ++i, ++j) {
- if (*(i->get()) != *(j->get())) return false;
- }
-
- return true;
-}
-
-void Array::insert(iterator i, ValuePtr value) {
- if (type != value->getType()) {
- // FIXME aconway 2008-10-31: put meaningful strings in this message.
- throw Exception(QPID_MSG("Wrong type of value in Array, expected " << type
- << " but found " << TypeCode(value->getType())));
- }
- values.insert(i, value);
-}
-
-
-}
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Array.h b/M4-RCs/qpid/cpp/src/qpid/framing/Array.h
deleted file mode 100644
index 183fcb6d5c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Array.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.
- *
- */
-#include "amqp_types.h"
-#include "FieldValue.h"
-#include "qpid/framing/TypeCode.h"
-#include <boost/shared_ptr.hpp>
-#include <iostream>
-#include <vector>
-
-#ifndef _Array_
-#define _Array_
-
-namespace qpid {
-namespace framing {
-
-class Buffer;
-
-class Array
-{
- public:
- typedef boost::shared_ptr<FieldValue> ValuePtr;
- typedef std::vector<ValuePtr> ValueVector;
- typedef ValueVector::const_iterator const_iterator;
- typedef ValueVector::iterator iterator;
-
- uint32_t encodedSize() const;
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer);
-
- int count() const;
- bool operator==(const Array& other) const;
-
- Array();
- Array(TypeCode type);
- Array(uint8_t type);
- //creates a longstr array
- Array(const std::vector<std::string>& in);
-
- TypeCode getType() const { return type; }
-
- // std collection interface.
- const_iterator begin() const { return values.begin(); }
- const_iterator end() const { return values.end(); }
- iterator begin() { return values.begin(); }
- iterator end(){ return values.end(); }
-
- ValuePtr front() const { return values.front(); }
- ValuePtr back() const { return values.back(); }
- size_t size() const { return values.size(); }
-
- void insert(iterator i, ValuePtr value);
- void erase(iterator i) { values.erase(i); }
- void push_back(ValuePtr value) { values.insert(end(), value); }
- void pop_back() { values.pop_back(); }
-
- // Non-std interface
- void add(ValuePtr value) { push_back(value); }
-
- template <class T>
- void collect(std::vector<T>& out) const
- {
- for (ValueVector::const_iterator i = values.begin(); i != values.end(); ++i) {
- out.push_back((*i)->get<T>());
- }
- }
-
- private:
- TypeCode type;
- ValueVector values;
-
- friend std::ostream& operator<<(std::ostream& out, const Array& body);
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Blob.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/Blob.cpp
deleted file mode 100644
index 388d4b64ef..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Blob.cpp
+++ /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.
- *
- */
-
-#include "Blob.h"
-
-
-namespace qpid {
-namespace framing {
-
-void BlobHelper<void>::destroy(void*) {}
-
-void BlobHelper<void>::copy(void*, const void*) {}
-
-}} // namespace qpid::framing
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Blob.h b/M4-RCs/qpid/cpp/src/qpid/framing/Blob.h
deleted file mode 100644
index 5c84384ad7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Blob.h
+++ /dev/null
@@ -1,197 +0,0 @@
-#ifndef QPID_FRAMING_BLOB_H
-#define QPID_FRAMING_BLOB_H
-
-/*
- * 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 <boost/static_assert.hpp>
-#include <boost/aligned_storage.hpp>
-#include <boost/checked_delete.hpp>
-#include <boost/utility/typed_in_place_factory.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/version.hpp>
-
-#include <new>
-
-#include <assert.h>
-
-
-namespace qpid {
-namespace framing {
-
-using boost::in_place;
-using boost::typed_in_place_factory_base;
-
-/** 0-arg typed_in_place_factory, missing in pre-1.35 boost. */
-#if (BOOST_VERSION < 103500)
-template <class T>
-struct typed_in_place_factory0 : public typed_in_place_factory_base {
- typedef T value_type ;
- void apply ( void* address ) const { new (address) T(); }
-};
-
-/** 0-arg in_place<T>() function, missing from boost. */
-template<class T>
-typed_in_place_factory0<T> in_place() { return typed_in_place_factory0<T>(); }
-#endif
-
-template <class T, class R=void>
-struct EnableInPlace
- : public boost::enable_if<boost::is_base_and_derived<
- typed_in_place_factory_base, T>,
- R>
-{};
-
-template <class T, class R=void>
-struct DisableInPlace
- : public boost::disable_if<boost::is_base_and_derived<
- typed_in_place_factory_base, T>,
- R>
-{};
-
-template <class T> struct BlobHelper {
- static void destroy(void* ptr) { static_cast<T*>(ptr)->~T(); }
- static void copy(void* dest, const void* src) {
- new (dest) T(*static_cast<const T*>(src));
- }
-};
-
-template <> struct BlobHelper<void> {
- static void destroy(void*);
- static void copy(void* to, const void* from);
-};
-
-/**
- * A Blob is a chunk of memory which can contain a single object at
- * a time-arbitrary type, provided sizeof(T)<=blob.size(). Using Blobs
- * ensures proper construction and destruction of its contents,
- * and proper copying between Blobs, but nothing else.
- *
- * In particular you must ensure that the Blob is big enough for its
- * contents and must know the type of object in the Blob to cast get().
- *
- * If BaseType is specified then only an object that can be
- * static_cast to BaseType may be stored in the Blob.
- */
-template <size_t Size, class BaseType=void>
-class Blob
-{
- boost::aligned_storage<Size> store;
- BaseType* basePtr;
-
- void (*destroy)(void*);
- void (*copy)(void*, const void*);
-
- template <class T>void setType() {
- BOOST_STATIC_ASSERT(sizeof(T) <= Size);
- destroy=&BlobHelper<T>::destroy;
- copy=&BlobHelper<T>::copy;
- // Base pointer may be offeset from store.address()
- basePtr = reinterpret_cast<T*>(store.address());
- }
-
- void initialize() {
- destroy=&BlobHelper<void>::destroy;
- copy=&BlobHelper<void>::copy;
- basePtr=0;
- }
-
- template<class Factory>
- typename EnableInPlace<Factory>::type apply(const Factory& factory)
- {
- typedef typename Factory::value_type T;
- assert(empty());
- factory.apply(store.address());
- setType<T>();
- }
-
- void assign(const Blob& b) {
- assert(empty());
- if (b.empty()) return;
- b.copy(this->store.address(), b.store.address());
- copy = b.copy;
- destroy = b.destroy;
- basePtr = reinterpret_cast<BaseType*>(
- ((char*)this)+ ((const char*)(b.basePtr) - (const char*)(&b)));
- }
-
- public:
- /** Construct an empty Blob. */
- Blob() { initialize(); }
-
- /** Copy a Blob. */
- Blob(const Blob& b) { initialize(); assign(b); }
-
- /** Construct from in_place constructor. */
- template<class InPlace>
- Blob(const InPlace & expr, typename EnableInPlace<InPlace>::type* =0) {
- initialize(); apply(expr);
- }
-
- /** Construct by copying an object constructor. */
- template<class T>
- Blob(const T & t, typename DisableInPlace<T>::type* =0) {
- initialize(); apply(in_place<T>(t));
- }
-
- ~Blob() { clear(); }
-
- /** Assign from another Blob. */
- Blob& operator=(const Blob& b) {
- clear();
- assign(b);
- return *this;
- }
-
- /** Assign from an in_place constructor expression. */
- template<class InPlace>
- typename EnableInPlace<InPlace,Blob&>::type operator=(const InPlace& expr) {
- clear(); apply(expr); return *this;
- }
-
- /** Assign from an object of type T. */
- template <class T>
- typename DisableInPlace<T, Blob&>::type operator=(const T& x) {
- clear(); apply(in_place<T>(x)); return *this;
- }
-
- /** Get pointer to Blob contents, returns 0 if empty. */
- BaseType* get() { return basePtr; }
-
- /** Get pointer to Blob contents, returns 0 if empty. */
- const BaseType* get() const { return basePtr; }
-
- /** Destroy the object in the Blob making it empty. */
- void clear() {
- void (*oldDestroy)(void*) = destroy;
- initialize();
- oldDestroy(store.address());
- }
-
- bool empty() const { return destroy==BlobHelper<void>::destroy; }
-
- static size_t size() { return Size; }
-};
-
-}} // namespace qpid::framing
-
-
-#endif /*!QPID_FRAMING_BLOB_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/BodyHandler.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/BodyHandler.cpp
deleted file mode 100644
index ffbcf33a95..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/BodyHandler.cpp
+++ /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.
- *
- */
-#include "BodyHandler.h"
-#include "AMQMethodBody.h"
-#include "AMQHeaderBody.h"
-#include "AMQContentBody.h"
-#include "AMQHeartbeatBody.h"
-#include <boost/cast.hpp>
-#include "qpid/framing/reply_exceptions.h"
-
-using namespace qpid::framing;
-using namespace boost;
-
-BodyHandler::~BodyHandler() {}
-
-// TODO aconway 2007-08-13: Replace with visitor.
-void BodyHandler::handleBody(AMQBody* body) {
- switch(body->type())
- {
- case METHOD_BODY:
- handleMethod(polymorphic_downcast<AMQMethodBody*>(body));
- break;
- case HEADER_BODY:
- handleHeader(polymorphic_downcast<AMQHeaderBody*>(body));
- break;
- case CONTENT_BODY:
- handleContent(polymorphic_downcast<AMQContentBody*>(body));
- break;
- case HEARTBEAT_BODY:
- handleHeartbeat(polymorphic_downcast<AMQHeartbeatBody*>(body));
- break;
- default:
- throw FramingErrorException(
- QPID_MSG("Invalid frame type " << body->type()));
- }
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/BodyHandler.h b/M4-RCs/qpid/cpp/src/qpid/framing/BodyHandler.h
deleted file mode 100644
index 9ded737195..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/BodyHandler.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef _BodyHandler_
-#define _BodyHandler_
-
-/*
- *
- * 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 <boost/shared_ptr.hpp>
-
-namespace qpid {
-namespace framing {
-class AMQBody;
-class AMQMethodBody;
-class AMQHeaderBody;
-class AMQContentBody;
-class AMQHeartbeatBody;
-
-// TODO aconway 2007-08-10: rework using Visitor pattern?
-
-/**
- * Interface to handle incoming frame bodies.
- * Derived classes provide logic for each frame type.
- */
-class BodyHandler {
- public:
- virtual ~BodyHandler();
- virtual void handleBody(AMQBody* body);
-
- protected:
- virtual void handleMethod(AMQMethodBody*) = 0;
- virtual void handleHeader(AMQHeaderBody*) = 0;
- virtual void handleContent(AMQContentBody*) = 0;
- virtual void handleHeartbeat(AMQHeartbeatBody*) = 0;
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/BodyHolder.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/BodyHolder.cpp
deleted file mode 100644
index b30a52a38e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/BodyHolder.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 "BodyHolder.h"
-#include "AMQMethodBody.h"
-#include "AMQHeaderBody.h"
-#include "AMQContentBody.h"
-#include "AMQHeartbeatBody.h"
-#include "Buffer.h"
-#include "qpid/framing/reply_exceptions.h"
-
-namespace qpid {
-namespace framing {
-
-
-// BodyHolder::operator=(const AMQBody&) is defined
-// in generated file BodyHolder_gen.cpp
-
-
-void BodyHolder::encode(Buffer& b) const {
- const AMQMethodBody* method=getMethod();
- if (method) {
- b.putOctet(method->amqpClassId());
- b.putOctet(method->amqpMethodId());
- method->encode(b);
- }
- else
- get()->encode(b);
-}
-
-void BodyHolder::decode(uint8_t type, Buffer& buffer, uint32_t size) {
- switch(type)
- {
- case 0://CONTROL
- case METHOD_BODY: {
- ClassId c = buffer.getOctet();
- MethodId m = buffer.getOctet();
- setMethod(c, m);
- break;
- }
- case HEADER_BODY: *this=in_place<AMQHeaderBody>(); break;
- case CONTENT_BODY: *this=in_place<AMQContentBody>(); break;
- case HEARTBEAT_BODY: *this=in_place<AMQHeartbeatBody>(); break;
- default:
- throw IllegalArgumentException(QPID_MSG("Invalid frame type " << type));
- }
- get()->decode(buffer, size);
-}
-
-uint32_t BodyHolder::encodedSize() const {
- const AMQMethodBody* method=getMethod();
- if (method)
- return sizeof(ClassId)+sizeof(MethodId)+method->encodedSize();
- else
- return get()->encodedSize();
-}
-
-}} // namespace qpid::framing
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/BodyHolder.h b/M4-RCs/qpid/cpp/src/qpid/framing/BodyHolder.h
deleted file mode 100644
index 0a35bb5e99..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/BodyHolder.h
+++ /dev/null
@@ -1,88 +0,0 @@
-#ifndef QPID_FRAMING_BODYHOLDER_H
-#define QPID_FRAMING_BODYHOLDER_H
-
-/*
- *
- * 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 "qpid/framing/AMQBody.h"
-#include "qpid/framing/Blob.h"
-#include "qpid/framing/MaxMethodBodySize.h" // Generated file.
-#include "qpid/framing/amqp_types.h"
-#include "qpid/RefCounted.h"
-
-
-namespace qpid {
-namespace framing {
-
-class AMQMethodBody;
-class AMQBody;
-class Buffer;
-
-/**
- * Holder for arbitrary frame body.
- */
-class BodyHolder : public RefCounted
-{
- public:
- // default copy, assign dtor ok.
- BodyHolder() {}
- BodyHolder(const AMQBody& b) { setBody(b); }
- BodyHolder(ClassId c, MethodId m) { setMethod(c,m); }
-
- /** Construct from an in_place constructor expression. */
- template <class InPlace>
- BodyHolder(const InPlace& ip, typename EnableInPlace<InPlace>::type* =0)
- : blob(ip) {}
-
- void setBody(const AMQBody& b);
-
- /** Assign from an in_place constructor expression. */
- template <class InPlace>
- typename EnableInPlace<InPlace,BodyHolder&>::type
- operator=(const InPlace& ip) { blob=ip; return *this; }
-
- /** Assign by copying. */
- template <class T>
- typename DisableInPlace<T,BodyHolder&>::type operator=(const T& x)
- { blob=in_place<T>(x); return *this; }
-
- /** Set to method with ClassId c, MethodId m. */
- void setMethod(ClassId c, MethodId m);
-
- void encode(Buffer&) const;
- void decode(uint8_t frameType, Buffer&, uint32_t=0);
- uint32_t encodedSize() const;
-
- /** Return body pointer or 0 if empty. */
- AMQBody* get() { return blob.get(); }
- const AMQBody* get() const { return blob.get(); }
-
- /** Return method pointer or 0 if not a method. */
- AMQMethodBody* getMethod() { return get()->getMethod(); }
- const AMQMethodBody* getMethod() const { return get()->getMethod(); }
-
- private:
- Blob<MAX_METHOD_BODY_SIZE, AMQBody> blob;
-};
-
-}} // namespace qpid::framing
-
-#endif /*!QPID_FRAMING_BODYHOLDER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Buffer.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/Buffer.cpp
deleted file mode 100644
index a90c3a2e64..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Buffer.cpp
+++ /dev/null
@@ -1,319 +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 "Buffer.h"
-#include "FieldTable.h"
-#include <string.h>
-#include <boost/format.hpp>
-namespace qpid {
-
-namespace framing {
-
-Buffer::Buffer(char* _data, uint32_t _size)
- : size(_size), data(_data), position(0) {
-}
-
-void Buffer::record(){
- r_position = position;
-}
-
-void Buffer::restore(bool reRecord){
- uint32_t savedPosition = position;
-
- position = r_position;
-
- if (reRecord)
- r_position = savedPosition;
-}
-
-void Buffer::reset(){
- position = 0;
-}
-
-///////////////////////////////////////////////////
-
-void Buffer::putOctet(uint8_t i){
- data[position++] = i;
- assert(position <= size);
-}
-
-void Buffer::putShort(uint16_t i){
- uint16_t b = i;
- data[position++] = (uint8_t) (0xFF & (b >> 8));
- data[position++] = (uint8_t) (0xFF & b);
- assert(position <= size);
-}
-
-void Buffer::putLong(uint32_t i){
- uint32_t b = i;
- data[position++] = (uint8_t) (0xFF & (b >> 24));
- data[position++] = (uint8_t) (0xFF & (b >> 16));
- data[position++] = (uint8_t) (0xFF & (b >> 8));
- data[position++] = (uint8_t) (0xFF & b);
- assert(position <= size);
-}
-
-void Buffer::putLongLong(uint64_t i){
- uint32_t hi = i >> 32;
- uint32_t lo = i;
- putLong(hi);
- putLong(lo);
-}
-
-void Buffer::putInt8(int8_t i){
- data[position++] = (uint8_t) i;
- assert(position <= size);
-}
-
-void Buffer::putInt16(int16_t i){
- putShort((uint16_t) i);
-}
-
-void Buffer::putInt32(int32_t i){
- putLong((uint32_t) i);
-}
-
-void Buffer::putInt64(int64_t i){
- putLongLong((uint64_t) i);
-}
-
-void Buffer::putFloat(float f){
- union {
- uint32_t i;
- float f;
- } val;
-
- val.f = f;
- putLong (val.i);
-}
-
-void Buffer::putDouble(double f){
- union {
- uint64_t i;
- double f;
- } val;
-
- val.f = f;
- putLongLong (val.i);
-}
-
-void Buffer::putBin128(uint8_t* b){
- memcpy (data + position, b, 16);
- position += 16;
-}
-
-uint8_t Buffer::getOctet(){
- uint8_t octet = static_cast<uint8_t>(data[position++]);
- assert(position <= size);
- return octet;
-}
-
-uint16_t Buffer::getShort(){
- uint16_t hi = (unsigned char) data[position++];
- hi = hi << 8;
- hi |= (unsigned char) data[position++];
- assert(position <= size);
- return hi;
-}
-
-uint32_t Buffer::getLong(){
- uint32_t a = (unsigned char) data[position++];
- uint32_t b = (unsigned char) data[position++];
- uint32_t c = (unsigned char) data[position++];
- uint32_t d = (unsigned char) data[position++];
- assert(position <= size);
- a = a << 24;
- a |= b << 16;
- a |= c << 8;
- a |= d;
- return a;
-}
-
-uint64_t Buffer::getLongLong(){
- uint64_t hi = getLong();
- uint64_t lo = getLong();
- hi = hi << 32;
- return hi | lo;
-}
-
-int8_t Buffer::getInt8(){
- int8_t i = static_cast<int8_t>(data[position++]);
- assert(position <= size);
- return i;
-}
-
-int16_t Buffer::getInt16(){
- return (int16_t) getShort();
-}
-
-int32_t Buffer::getInt32(){
- return (int32_t) getLong();
-}
-
-int64_t Buffer::getInt64(){
- return (int64_t) getLongLong();
-}
-
-float Buffer::getFloat(){
- union {
- uint32_t i;
- float f;
- } val;
- val.i = getLong();
- return val.f;
-}
-
-double Buffer::getDouble(){
- union {
- uint64_t i;
- double f;
- } val;
- val.i = getLongLong();
- return val.f;
-}
-
-template <>
-uint64_t Buffer::getUInt<1>() {
- return getOctet();
-}
-
-template <>
-uint64_t Buffer::getUInt<2>() {
- return getShort();
-}
-
-template <>
-uint64_t Buffer::getUInt<4>() {
- return getLong();
-}
-
-template <>
-uint64_t Buffer::getUInt<8>() {
- return getLongLong();
-}
-
-template <>
-void Buffer::putUInt<1>(uint64_t i) {
- putOctet(i);
-}
-
-template <>
-void Buffer::putUInt<2>(uint64_t i) {
- putShort(i);
-}
-
-template <>
-void Buffer::putUInt<4>(uint64_t i) {
- putLong(i);
-}
-
-template <>
-void Buffer::putUInt<8>(uint64_t i) {
- putLongLong(i);
-}
-
-void Buffer::putShortString(const string& s){
- size_t slen = s.length();
- uint8_t len = slen < 0x100 ? (uint8_t) slen : 0xFF;
- putOctet(len);
- s.copy(data + position, len);
- position += len;
-}
-
-void Buffer::putMediumString(const string& s){
- size_t slen = s.length();
- uint16_t len = slen < 0x10000 ? (uint16_t) slen : 0xFFFF;
- putShort(len);
- s.copy(data + position, len);
- position += len;
-}
-
-void Buffer::putLongString(const string& s){
- uint32_t len = s.length();
- putLong(len);
- s.copy(data + position, len);
- position += len;
-}
-
-void Buffer::getShortString(string& s){
- uint8_t len = getOctet();
- checkAvailable(len);
- s.assign(data + position, len);
- position += len;
-}
-
-void Buffer::getMediumString(string& s){
- uint16_t len = getShort();
- checkAvailable(len);
- s.assign(data + position, len);
- position += len;
-}
-
-void Buffer::getLongString(string& s){
- uint32_t len = getLong();
- checkAvailable(len);
- s.assign(data + position, len);
- position += len;
-}
-
-void Buffer::getBin128(uint8_t* b){
- memcpy (b, data + position, 16);
- position += 16;
-}
-
-void Buffer::putRawData(const string& s){
- uint32_t len = s.length();
- s.copy(data + position, len);
- position += len;
-}
-
-void Buffer::getRawData(string& s, uint32_t len){
- checkAvailable(len);
- s.assign(data + position, len);
- position += len;
-}
-
-void Buffer::putRawData(const uint8_t* s, size_t len){
- memcpy(data + position, s, len);
- position += len;
-}
-
-void Buffer::getRawData(uint8_t* s, size_t len){
- checkAvailable(len);
- memcpy(s, data + position, len);
- position += len;
-}
-
-void Buffer::dump(std::ostream& out) const {
- for (uint32_t i = position; i < size; i++)
- {
- if (i != position)
- out << " ";
- out << boost::format("%02x") % ((unsigned) (uint8_t) data[i]);
- }
-}
-
-std::ostream& operator<<(std::ostream& out, const Buffer& b){
- out << "Buffer[";
- b.dump(out);
- return out << "]";
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Buffer.h b/M4-RCs/qpid/cpp/src/qpid/framing/Buffer.h
deleted file mode 100644
index 828e6e963a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Buffer.h
+++ /dev/null
@@ -1,135 +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 "amqp_types.h"
-#include "qpid/Exception.h"
-#include <boost/iterator/iterator_facade.hpp>
-
-#ifndef _Buffer_
-#define _Buffer_
-
-namespace qpid {
-namespace framing {
-
-struct OutOfBounds : qpid::Exception {
- OutOfBounds() : qpid::Exception(std::string("Out of Bounds")) {}
-};
-
-class Content;
-class FieldTable;
-
-class Buffer
-{
- uint32_t size;
- char* data;
- uint32_t position;
- uint32_t r_position;
-
- void checkAvailable(uint32_t count) { if (position + count > size) throw OutOfBounds(); }
-
- public:
-
- /** Buffer input/output iterator.
- * Supports using an amqp_0_10::Codec with a framing::Buffer.
- */
- class Iterator : public boost::iterator_facade<
- Iterator, char, boost::random_access_traversal_tag>
- {
- public:
- Iterator(Buffer& b) : buffer(&b) {}
-
- private:
- friend class boost::iterator_core_access;
- char& dereference() const { return buffer->data[buffer->position]; }
- void increment() { ++buffer->position; }
- bool equal(const Iterator& x) const { return buffer == x.buffer; }
-
- Buffer* buffer;
- };
-
- friend class Iterator;
-
- Buffer(char* data=0, uint32_t size=0);
-
- void record();
- void restore(bool reRecord = false);
- void reset();
-
- uint32_t available() { return size - position; }
- uint32_t getSize() { return size; }
- uint32_t getPosition() { return position; }
- Iterator getIterator() { return Iterator(*this); }
- char* getPointer() { return data; }
-
- void putOctet(uint8_t i);
- void putShort(uint16_t i);
- void putLong(uint32_t i);
- void putLongLong(uint64_t i);
- void putInt8(int8_t i);
- void putInt16(int16_t i);
- void putInt32(int32_t i);
- void putInt64(int64_t i);
- void putFloat(float f);
- void putDouble(double f);
- void putBin128(uint8_t* b);
-
- uint8_t getOctet();
- uint16_t getShort();
- uint32_t getLong();
- uint64_t getLongLong();
- int8_t getInt8();
- int16_t getInt16();
- int32_t getInt32();
- int64_t getInt64();
- float getFloat();
- double getDouble();
-
- template <int n>
- uint64_t getUInt();
-
- template <int n>
- void putUInt(uint64_t);
-
- void putShortString(const string& s);
- void putMediumString(const string& s);
- void putLongString(const string& s);
- void getShortString(string& s);
- void getMediumString(string& s);
- void getLongString(string& s);
- void getBin128(uint8_t* b);
-
- void putRawData(const string& s);
- void getRawData(string& s, uint32_t size);
-
- void putRawData(const uint8_t* data, size_t size);
- void getRawData(uint8_t* data, size_t size);
-
- template <class T> void put(const T& data) { data.encode(*this); }
- template <class T> void get(T& data) { data.decode(*this); }
-
- void dump(std::ostream&) const;
-};
-
-std::ostream& operator<<(std::ostream&, const Buffer&);
-
-}} // namespace qpid::framing
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/ChannelHandler.h b/M4-RCs/qpid/cpp/src/qpid/framing/ChannelHandler.h
deleted file mode 100644
index 69aaeac492..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/ChannelHandler.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef QPID_FRAMING_CHANNELHANDLER_H
-#define QPID_FRAMING_CHANNELHANDLER_H
-
-/*
- *
- * 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 "FrameHandler.h"
-#include "AMQFrame.h"
-
-namespace qpid {
-namespace framing {
-
-/**
- * Sets the channel number on outgoing frames.
- */
-class ChannelHandler : public FrameHandler
-{
- public:
- ChannelHandler(uint16_t channelId=0, FrameHandler* next=0)
- : FrameHandler(next), channel(channelId) {}
- void handle(AMQFrame& frame) {
- frame.setChannel(channel);
- next->handle(frame);
- }
- uint16_t get() const { return channel; }
- ChannelHandler& set(uint16_t ch) { channel=ch; return *this; }
- operator uint16_t() const { return get(); }
- ChannelHandler& operator=(uint16_t ch) { return set(ch); }
-
- private:
- uint16_t channel;
-};
-
-}} // namespace qpid::framing
-
-#endif /*!QPID_FRAMING_CHANNELHANDLER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Endian.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/Endian.cpp
deleted file mode 100644
index 1948579b88..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Endian.cpp
+++ /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.
- *
- */
-#include "Endian.h"
-
-namespace qpid {
-namespace framing {
-
-Endian::Endian() : littleEndian(!testBigEndian()) {}
-
-bool Endian::testBigEndian()
-{
- uint16_t a = 1;
- uint16_t b;
- uint8_t* p = (uint8_t*) &b;
- p[0] = 0xFF & (a >> 8);
- p[1] = 0xFF & (a);
- return a == b;
-}
-
-uint8_t* Endian::convertIfRequired(uint8_t* const octets, int width)
-{
- if (instance.littleEndian) {
- for (int i = 0; i < (width/2); i++) {
- uint8_t temp = octets[i];
- octets[i] = octets[width - (1 + i)];
- octets[width - (1 + i)] = temp;
- }
- }
- return octets;
-}
-
-const Endian Endian::instance;
-
-}} // namespace qpid::framing
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Endian.h b/M4-RCs/qpid/cpp/src/qpid/framing/Endian.h
deleted file mode 100644
index 077d5a3e9b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Endian.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef QPID_FRAMING_ENDIAN_H
-#define QPID_FRAMING_ENDIAN_H
-
-/*
- *
- * 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 "qpid/sys/IntegerTypes.h"
-
-namespace qpid {
-namespace framing {
-
-/**
- * Conversion utility for little-endian platforms that need to convert
- * to and from network ordered octet sequences
- */
-class Endian
-{
- public:
- static uint8_t* convertIfRequired(uint8_t* const octets, int width);
- private:
- const bool littleEndian;
- Endian();
- static const Endian instance;
- static bool testBigEndian();
-};
-}} // namespace qpid::framing
-
-#endif /*!QPID_FRAMING_ENDIAN_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/FieldTable.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/FieldTable.cpp
deleted file mode 100644
index 7260261970..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/FieldTable.cpp
+++ /dev/null
@@ -1,240 +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 "FieldTable.h"
-#include "Array.h"
-#include "Buffer.h"
-#include "Endian.h"
-#include "FieldValue.h"
-#include "qpid/Exception.h"
-#include "qpid/framing/reply_exceptions.h"
-#include <assert.h>
-
-namespace qpid {
-namespace framing {
-
-FieldTable::FieldTable(const FieldTable& ft)
-{
- *this = ft;
-}
-
-FieldTable& FieldTable::operator=(const FieldTable& ft)
-{
- clear();
- values = ft.values;
- return *this;
-}
-
-FieldTable::~FieldTable() {}
-
-uint32_t FieldTable::encodedSize() const {
- uint32_t len(4/*size field*/ + 4/*count field*/);
- for(ValueMap::const_iterator i = values.begin(); i != values.end(); ++i) {
- // shortstr_len_byte + key size + value size
- len += 1 + (i->first).size() + (i->second)->encodedSize();
- }
- return len;
-}
-
-int FieldTable::count() const {
- return values.size();
-}
-
-namespace
-{
-std::ostream& operator<<(std::ostream& out, const FieldTable::ValueMap::value_type& i) {
- return out << i.first << ":" << *i.second;
-}
-}
-
-std::ostream& operator<<(std::ostream& out, const FieldTable& t) {
- out << "{";
- FieldTable::ValueMap::const_iterator i = t.begin();
- if (i != t.end()) out << *i++;
- while (i != t.end())
- {
- out << "," << *i++;
- }
- return out << "}";
-}
-
-void FieldTable::set(const std::string& name, const ValuePtr& value){
- values[name] = value;
-}
-
-void FieldTable::setString(const std::string& name, const std::string& value){
- values[name] = ValuePtr(new Str16Value(value));
-}
-
-void FieldTable::setInt(const std::string& name, const int value){
- values[name] = ValuePtr(new IntegerValue(value));
-}
-
-void FieldTable::setInt64(const std::string& name, const int64_t value){
- values[name] = ValuePtr(new Integer64Value(value));
-}
-
-void FieldTable::setTimestamp(const std::string& name, const uint64_t value){
- values[name] = ValuePtr(new TimeValue(value));
-}
-
-void FieldTable::setUInt64(const std::string& name, const uint64_t value){
- values[name] = ValuePtr(new Unsigned64Value(value));
-}
-
-void FieldTable::setTable(const std::string& name, const FieldTable& value)
-{
- values[name] = ValuePtr(new FieldTableValue(value));
-}
-void FieldTable::setArray(const std::string& name, const Array& value)
-{
- values[name] = ValuePtr(new ArrayValue(value));
-}
-
-void FieldTable::setFloat(const std::string& name, const float value){
- values[name] = ValuePtr(new FloatValue(value));
-}
-
-void FieldTable::setDouble(const std::string& name, double value){
- values[name] = ValuePtr(new DoubleValue(value));
-}
-
-FieldTable::ValuePtr FieldTable::get(const std::string& name) const
-{
- ValuePtr value;
- ValueMap::const_iterator i = values.find(name);
- if ( i!=values.end() )
- value = i->second;
- return value;
-}
-
-namespace {
- template <class T> T default_value() { return T(); }
- template <> int default_value<int>() { return 0; }
- template <> uint64_t default_value<uint64_t>() { return 0; }
-}
-
-template <class T>
-T getValue(const FieldTable::ValuePtr value)
-{
- if (!value || !value->convertsTo<T>())
- return default_value<T>();
-
- return value->get<T>();
-}
-
-std::string FieldTable::getAsString(const std::string& name) const {
- return getValue<std::string>(get(name));
-}
-
-int FieldTable::getAsInt(const std::string& name) const {
- return getValue<int>(get(name));
-}
-
-uint64_t FieldTable::getAsUInt64(const std::string& name) const {
- return static_cast<uint64_t>( getValue<int64_t>(get(name)));
-}
-
-int64_t FieldTable::getAsInt64(const std::string& name) const {
- return getValue<int64_t>(get(name));
-}
-
-bool FieldTable::getTable(const std::string& name, FieldTable& value) const {
- return getEncodedValue<FieldTable>(get(name), value);
-}
-
-bool FieldTable::getArray(const std::string& name, Array& value) const {
- return getEncodedValue<Array>(get(name), value);
-}
-
-template <class T, int width, uint8_t typecode>
-bool getRawFixedWidthValue(FieldTable::ValuePtr vptr, T& value)
-{
- if (vptr && vptr->getType() == typecode) {
- FixedWidthValue<width>* fwv = dynamic_cast< FixedWidthValue<width>* >(&vptr->getData());
- if (fwv) {
- uint8_t* const octets = Endian::convertIfRequired(fwv->rawOctets(), width);
- uint8_t* const target = reinterpret_cast<uint8_t*>(&value);
- for (uint i = 0; i < width; ++i) target[i] = octets[i];
- return true;
- }
- }
- return false;
-}
-
-bool FieldTable::getFloat(const std::string& name, float& value) const {
- return getRawFixedWidthValue<float, 4, 0x23>(get(name), value);
-}
-
-bool FieldTable::getDouble(const std::string& name, double& value) const {
- return getRawFixedWidthValue<double, 8, 0x33>(get(name), value);
-}
-
-//uint64_t FieldTable::getTimestamp(const std::string& name) const {
-// return getValue<uint64_t>(name);
-//}
-
-void FieldTable::encode(Buffer& buffer) const{
- buffer.putLong(encodedSize() - 4);
- buffer.putLong(values.size());
- for (ValueMap::const_iterator i = values.begin(); i!=values.end(); ++i) {
- buffer.putShortString(i->first);
- i->second->encode(buffer);
- }
-}
-
-void FieldTable::decode(Buffer& buffer){
- uint32_t len = buffer.getLong();
- if (len) {
- uint32_t available = buffer.available();
- if (available < len)
- throw IllegalArgumentException(QPID_MSG("Not enough data for field table."));
- uint32_t count = buffer.getLong();
- uint32_t leftover = available - len;
- while(buffer.available() > leftover && count--){
- std::string name;
- ValuePtr value(new FieldValue);
-
- buffer.getShortString(name);
- value->decode(buffer);
- values[name] = ValuePtr(value);
- }
- }
-}
-
-
-bool FieldTable::operator==(const FieldTable& x) const {
- if (values.size() != x.values.size()) return false;
- for (ValueMap::const_iterator i = values.begin(); i != values.end(); ++i) {
- ValueMap::const_iterator j = x.values.find(i->first);
- if (j == x.values.end()) return false;
- if (*(i->second) != *(j->second)) return false;
- }
- return true;
-}
-
-void FieldTable::erase(const std::string& name)
-{
- if (values.find(name) != values.end())
- values.erase(name);
-}
-
-}
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/FieldTable.h b/M4-RCs/qpid/cpp/src/qpid/framing/FieldTable.h
deleted file mode 100644
index 9e1214a28c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/FieldTable.h
+++ /dev/null
@@ -1,120 +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 <iostream>
-#include <vector>
-#include <boost/shared_ptr.hpp>
-#include <map>
-#include "amqp_types.h"
-
-#ifndef _FieldTable_
-#define _FieldTable_
-
-namespace qpid {
- /**
- * The framing namespace contains classes that are used to create,
- * send and receive the basic packets from which AMQP is built.
- */
-namespace framing {
-
-class Array;
-class FieldValue;
-class Buffer;
-
-/**
- * A set of name-value pairs. (See the AMQP spec for more details on
- * AMQP field tables).
- *
- * \ingroup clientapi
- */
-class FieldTable
-{
- public:
- typedef boost::shared_ptr<FieldValue> ValuePtr;
- typedef std::map<std::string, ValuePtr> ValueMap;
- typedef ValueMap::iterator iterator;
-
- FieldTable() {};
- FieldTable(const FieldTable& ft);
- ~FieldTable();
- FieldTable& operator=(const FieldTable& ft);
- uint32_t encodedSize() const;
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer);
-
- int count() const;
- void set(const std::string& name, const ValuePtr& value);
- ValuePtr get(const std::string& name) const;
- bool isSet(const std::string& name) const { return get(name).get() != 0; }
-
- void setString(const std::string& name, const std::string& value);
- void setInt(const std::string& name, const int value);
- void setInt64(const std::string& name, const int64_t value);
- void setTimestamp(const std::string& name, const uint64_t value);
- void setUInt64(const std::string& name, const uint64_t value);
- void setTable(const std::string& name, const FieldTable& value);
- void setArray(const std::string& name, const Array& value);
- void setFloat(const std::string& name, const float value);
- void setDouble(const std::string& name, const double value);
- //void setDecimal(string& name, xxx& value);
-
- int getAsInt(const std::string& name) const;
- uint64_t getAsUInt64(const std::string& name) const;
- int64_t getAsInt64(const std::string& name) const;
- std::string getAsString(const std::string& name) const;
-
- bool getTable(const std::string& name, FieldTable& value) const;
- bool getArray(const std::string& name, Array& value) const;
- bool getFloat(const std::string& name, float& value) const;
- bool getDouble(const std::string& name, double& value) const;
- //bool getTimestamp(const std::string& name, uint64_t& value) const;
- //bool getDecimal(string& name, xxx& value);
- void erase(const std::string& name);
-
-
- bool operator==(const FieldTable& other) const;
-
- // Map-like interface.
- // TODO: may need to duplicate into versions that return mutable iterator
- ValueMap::const_iterator begin() const { return values.begin(); }
- ValueMap::const_iterator end() const { return values.end(); }
- ValueMap::const_iterator find(const std::string& s) const { return values.find(s); }
-
- std::pair <ValueMap::iterator, bool> insert(const ValueMap::value_type&);
- void clear() { values.clear(); }
-
- // ### Hack Alert
-
- ValueMap::iterator getValues() { return values.begin(); }
-
- private:
- ValueMap values;
-
- friend std::ostream& operator<<(std::ostream& out, const FieldTable& body);
-};
-
-//class FieldNotFoundException{};
-//class UnknownFieldName : public FieldNotFoundException{};
-//class IncorrectFieldType : public FieldNotFoundException{};
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/FieldValue.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/FieldValue.cpp
deleted file mode 100644
index ecf469236d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/FieldValue.cpp
+++ /dev/null
@@ -1,180 +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 "FieldValue.h"
-#include "Array.h"
-#include "Buffer.h"
-#include "Endian.h"
-#include "qpid/framing/reply_exceptions.h"
-
-namespace qpid {
-namespace framing {
-
-uint8_t FieldValue::getType()
-{
- return typeOctet;
-}
-
-void FieldValue::setType(uint8_t type)
-{
- typeOctet = type;
- if (typeOctet == 0xA8) {
- data.reset(new EncodedValue<FieldTable>());
- } else if (typeOctet == 0xAA) {
- data.reset(new EncodedValue<Array>());
- } else {
- uint8_t lenType = typeOctet >> 4;
- switch(lenType){
- case 0:
- data.reset(new FixedWidthValue<1>());
- break;
- case 1:
- data.reset(new FixedWidthValue<2>());
- break;
- case 2:
- data.reset(new FixedWidthValue<4>());
- break;
- case 3:
- data.reset(new FixedWidthValue<8>());
- break;
- case 4:
- data.reset(new FixedWidthValue<16>());
- break;
- case 5:
- data.reset(new FixedWidthValue<32>());
- break;
- case 6:
- data.reset(new FixedWidthValue<64>());
- break;
- case 7:
- data.reset(new FixedWidthValue<128>());
- break;
- case 8:
- data.reset(new VariableWidthValue<1>());
- break;
- case 9:
- data.reset(new VariableWidthValue<2>());
- break;
- case 0xA:
- data.reset(new VariableWidthValue<4>());
- break;
- case 0xC:
- data.reset(new FixedWidthValue<5>());
- break;
- case 0xD:
- data.reset(new FixedWidthValue<9>());
- break;
- case 0xF:
- data.reset(new FixedWidthValue<0>());
- break;
- default:
- throw IllegalArgumentException(QPID_MSG("Unknown field table value type: " << (int)typeOctet));
- }
- }
-}
-
-void FieldValue::decode(Buffer& buffer)
-{
- setType(buffer.getOctet());
- data->decode(buffer);
-}
-
-void FieldValue::encode(Buffer& buffer)
-{
- buffer.putOctet(typeOctet);
- data->encode(buffer);
-}
-
-bool FieldValue::operator==(const FieldValue& v) const
-{
- return
- typeOctet == v.typeOctet &&
- *data == *v.data;
-}
-
-Str8Value::Str8Value(const std::string& v) :
- FieldValue(
- TYPE_CODE_STR8,
- new VariableWidthValue<1>(
- reinterpret_cast<const uint8_t*>(v.data()),
- reinterpret_cast<const uint8_t*>(v.data()+v.size())))
-{
-}
-
-Str16Value::Str16Value(const std::string& v) :
- FieldValue(
- 0x95,
- new VariableWidthValue<2>(
- reinterpret_cast<const uint8_t*>(v.data()),
- reinterpret_cast<const uint8_t*>(v.data()+v.size())))
-{}
-
-Struct32Value::Struct32Value(const std::string& v) :
- FieldValue(
- 0xAB,
- new VariableWidthValue<4>(
- reinterpret_cast<const uint8_t*>(v.data()),
- reinterpret_cast<const uint8_t*>(v.data()+v.size())))
-{}
-
-IntegerValue::IntegerValue(int v) :
- FieldValue(0x21, new FixedWidthValue<4>(v))
-{}
-
-FloatValue::FloatValue(float v) :
- FieldValue(0x23, new FixedWidthValue<4>(Endian::convertIfRequired(reinterpret_cast<uint8_t*>(&v), 4)))
-{}
-
-DoubleValue::DoubleValue(double v) :
- FieldValue(0x33, new FixedWidthValue<8>(Endian::convertIfRequired(reinterpret_cast<uint8_t*>(&v), 8)))
-{}
-
-Integer64Value::Integer64Value(int64_t v) :
- FieldValue(0x31, new FixedWidthValue<8>(v))
-{}
-
-Unsigned64Value::Unsigned64Value(uint64_t v) :
- FieldValue(0x32, new FixedWidthValue<8>(v))
-{}
-
-
-TimeValue::TimeValue(uint64_t v) :
- FieldValue(0x38, new FixedWidthValue<8>(v))
-{
-}
-
-FieldTableValue::FieldTableValue(const FieldTable& f) : FieldValue(0xa8, new EncodedValue<FieldTable>(f))
-{
-}
-
-ArrayValue::ArrayValue(const Array& a) : FieldValue(0xaa, new EncodedValue<Array>(a))
-{
-}
-
-void FieldValue::print(std::ostream& out) const {
- data->print(out);
- out << TypeCode(typeOctet) << '(';
- if (data->convertsToString()) out << data->getString();
- else if (data->convertsToInt()) out << data->getInt();
- else data->print(out);
- out << ')';
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/FieldValue.h b/M4-RCs/qpid/cpp/src/qpid/framing/FieldValue.h
deleted file mode 100644
index 29760619e5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/FieldValue.h
+++ /dev/null
@@ -1,320 +0,0 @@
-#ifndef _framing_FieldValue_h
-#define _framing_FieldValue_h
-/*
- *
- * 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 "qpid/Exception.h"
-#include "amqp_types.h"
-#include "Buffer.h"
-#include "FieldTable.h"
-
-#include "assert.h"
-
-#include <iostream>
-#include <memory>
-#include <vector>
-
-namespace qpid {
-namespace framing {
-
-//class Array;
-/**
- * Exception that is the base exception for all field table errors.
- *
- * \ingroup clientapi
- */
-class FieldValueException : public qpid::Exception {};
-
-/**
- * Exception thrown when we can't perform requested conversion
- *
- * \ingroup clientapi
- */
-struct InvalidConversionException : public FieldValueException {
- InvalidConversionException() {}
-};
-
-/**
- * Value that can appear in an AMQP field table
- *
- * \ingroup clientapi
- */
-class FieldValue {
- public:
- /*
- * Abstract type for content of different types
- */
- class Data {
- public:
- virtual ~Data() {};
- virtual uint32_t encodedSize() const = 0;
- virtual void encode(Buffer& buffer) = 0;
- virtual void decode(Buffer& buffer) = 0;
- virtual bool operator==(const Data&) const = 0;
-
- virtual bool convertsToInt() const { return false; }
- virtual bool convertsToString() const { return false; }
- virtual int64_t getInt() const { throw InvalidConversionException();}
- virtual std::string getString() const { throw InvalidConversionException(); }
-
- virtual void print(std::ostream& out) const = 0;
- };
-
- FieldValue(): data(0) {};
- // Default assignment operator is fine
- void setType(uint8_t type);
- uint8_t getType();
- Data& getData() { return *data; }
- uint32_t encodedSize() const { return 1 + data->encodedSize(); };
- bool empty() const { return data.get() == 0; }
- void encode(Buffer& buffer);
- void decode(Buffer& buffer);
- bool operator==(const FieldValue&) const;
- bool operator!=(const FieldValue& v) const { return !(*this == v); }
-
- void print(std::ostream& out) const;
-
- template <typename T> bool convertsTo() const { return false; }
- template <typename T> T get() const { throw InvalidConversionException(); }
-
- protected:
- FieldValue(uint8_t t, Data* d): typeOctet(t), data(d) {}
-
- private:
- uint8_t typeOctet;
- std::auto_ptr<Data> data;
-};
-
-template <>
-inline bool FieldValue::convertsTo<int>() const { return data->convertsToInt(); }
-
-template <>
-inline bool FieldValue::convertsTo<int64_t>() const { return data->convertsToInt(); }
-
-template <>
-inline bool FieldValue::convertsTo<std::string>() const { return data->convertsToString(); }
-
-template <>
-inline int FieldValue::get<int>() const { return data->getInt(); }
-
-template <>
-inline int64_t FieldValue::get<int64_t>() const { return data->getInt(); }
-
-template <>
-inline std::string FieldValue::get<std::string>() const { return data->getString(); }
-
-inline std::ostream& operator<<(std::ostream& out, const FieldValue& v) {
- v.print(out);
- return out;
-}
-
-template <int width>
-class FixedWidthValue : public FieldValue::Data {
- uint8_t octets[width];
-
- public:
- FixedWidthValue() {}
- FixedWidthValue(const uint8_t (&data)[width]) : octets(data) {}
- FixedWidthValue(const uint8_t* const data)
- {
- for (int i = 0; i < width; i++) octets[i] = data[i];
- }
- FixedWidthValue(uint64_t v)
- {
- for (int i = width; i > 1; --i) {
- octets[i-1] = (uint8_t) (0xFF & v); v >>= 8;
- }
- octets[0] = (uint8_t) (0xFF & v);
- }
- uint32_t encodedSize() const { return width; }
- void encode(Buffer& buffer) { buffer.putRawData(octets, width); }
- void decode(Buffer& buffer) { buffer.getRawData(octets, width); }
- bool operator==(const Data& d) const {
- const FixedWidthValue<width>* rhs = dynamic_cast< const FixedWidthValue<width>* >(&d);
- if (rhs == 0) return false;
- else return std::equal(&octets[0], &octets[width], &rhs->octets[0]);
- }
-
- bool convertsToInt() const { return true; }
- int64_t getInt() const
- {
- int64_t v = 0;
- for (int i = 0; i < width-1; ++i) {
- v |= octets[i]; v <<= 8;
- }
- v |= octets[width-1];
- return v;
- }
- uint8_t* rawOctets() { return octets; }
-
- void print(std::ostream& o) const { o << "F" << width << ":"; };
-};
-
-template <>
-class FixedWidthValue<0> : public FieldValue::Data {
- public:
- // Implicit default constructor is fine
- uint32_t encodedSize() const { return 0; }
- void encode(Buffer&) {};
- void decode(Buffer&) {};
- bool operator==(const Data& d) const {
- const FixedWidthValue<0>* rhs = dynamic_cast< const FixedWidthValue<0>* >(&d);
- return rhs != 0;
- }
- void print(std::ostream& o) const { o << "F0"; };
-};
-
-template <int lenwidth>
-class VariableWidthValue : public FieldValue::Data {
- std::vector<uint8_t> octets;
-
- public:
- VariableWidthValue() {}
- VariableWidthValue(const std::vector<uint8_t>& data) : octets(data) {}
- VariableWidthValue(const uint8_t* start, const uint8_t* end) : octets(start, end) {}
- uint32_t encodedSize() const { return lenwidth + octets.size(); }
- void encode(Buffer& buffer) {
- buffer.putUInt<lenwidth>(octets.size());
- if (octets.size() > 0)
- buffer.putRawData(&octets[0], octets.size());
- };
- void decode(Buffer& buffer) {
- uint32_t len = buffer.getUInt<lenwidth>();
- octets.resize(len);
- if (len > 0)
- buffer.getRawData(&octets[0], len);
- }
- bool operator==(const Data& d) const {
- const VariableWidthValue<lenwidth>* rhs = dynamic_cast< const VariableWidthValue<lenwidth>* >(&d);
- if (rhs == 0) return false;
- else return octets==rhs->octets;
- }
-
- bool convertsToString() const { return true; }
- std::string getString() const { return std::string(octets.begin(), octets.end()); }
-
- void print(std::ostream& o) const { o << "V" << lenwidth << ":" << octets.size() << ":"; };
-};
-
-template <class T>
-class EncodedValue : public FieldValue::Data {
- T value;
- public:
-
- EncodedValue() {}
- EncodedValue(const T& v) : value(v) {}
-
- T& getValue() { return value; }
- const T& getValue() const { return value; }
-
- uint32_t encodedSize() const { return value.encodedSize(); }
-
- void encode(Buffer& buffer) {
- value.encode(buffer);
- };
- void decode(Buffer& buffer) {
- value.decode(buffer);
- }
- bool operator==(const Data& d) const {
- const EncodedValue<T>* rhs = dynamic_cast< const EncodedValue<T>* >(&d);
- if (rhs == 0) return false;
- else return value==rhs->value;
- }
-
- void print(std::ostream& o) const { o << "[" << value << "]"; };
-};
-
-class Str8Value : public FieldValue {
- public:
- Str8Value(const std::string& v);
-};
-
-class Str16Value : public FieldValue {
- public:
- Str16Value(const std::string& v);
-};
-
-class Struct32Value : public FieldValue {
- public:
- Struct32Value(const std::string& v);
-};
-
-class FloatValue : public FieldValue
-{
- public:
- FloatValue(float f);
-};
-class DoubleValue : public FieldValue
-{
- public:
- DoubleValue(double f);
-};
-
-/*
- * Basic integer value encodes as signed 32 bit
- */
-class IntegerValue : public FieldValue {
- public:
- IntegerValue(int v);
-};
-
-class TimeValue : public FieldValue {
- public:
- TimeValue(uint64_t v);
-};
-
-class Integer64Value : public FieldValue {
- public:
- Integer64Value(int64_t v);
-};
-
-class Unsigned64Value : public FieldValue {
- public:
- Unsigned64Value(uint64_t v);
-};
-
-class FieldTableValue : public FieldValue {
- public:
- FieldTableValue(const FieldTable&);
-};
-
-class ArrayValue : public FieldValue {
- public:
- ArrayValue(const Array&);
-};
-
-template <class T>
-bool getEncodedValue(FieldTable::ValuePtr vptr, T& value)
-{
- if (vptr) {
- const EncodedValue<T>* ev = dynamic_cast< EncodedValue<T>* >(&(vptr->getData()));
- if (ev != 0) {
- value = ev->getValue();
- return true;
- }
- }
- return false;
-}
-
-
-}} // qpid::framing
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/FrameDecoder.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/FrameDecoder.cpp
deleted file mode 100644
index 07e2f7513d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/FrameDecoder.cpp
+++ /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.
- *
- */
-#include "FrameDecoder.h"
-#include "Buffer.h"
-#include "qpid/log/Statement.h"
-#include <algorithm>
-
-namespace qpid {
-namespace framing {
-
-namespace {
-/** Move up to n bytes from start of buf to end of bytes. */
-void move(std::vector<char>& bytes, Buffer& buffer, size_t n) {
- size_t oldSize = bytes.size();
- n = std::min(n, size_t(buffer.available()));
- bytes.resize(oldSize+n);
- char* p = &bytes[oldSize];
- buffer.getRawData(reinterpret_cast<uint8_t*>(p), n);
-}
-}
-
-bool FrameDecoder::decode(Buffer& buffer) {
- if (buffer.available() == 0) return false;
- if (fragment.empty()) {
- if (frame.decode(buffer)) // Decode from buffer
- return true;
- else // Store fragment
- move(fragment, buffer, buffer.available());
- }
- else { // Already have a fragment
- // Get enough data to decode the frame size.
- if (fragment.size() < AMQFrame::DECODE_SIZE_MIN) {
- move(fragment, buffer, AMQFrame::DECODE_SIZE_MIN - fragment.size());
- }
- if (fragment.size() >= AMQFrame::DECODE_SIZE_MIN) {
- uint16_t size = AMQFrame::decodeSize(&fragment[0]);
- assert(size > fragment.size());
- move(fragment, buffer, size-fragment.size());
- Buffer b(&fragment[0], fragment.size());
- if (frame.decode(b)) {
- assert(b.available() == 0);
- fragment.clear();
- return true;
- }
- }
- }
- return false;
-}
-
-}} // namespace qpid::framing
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/FrameDecoder.h b/M4-RCs/qpid/cpp/src/qpid/framing/FrameDecoder.h
deleted file mode 100644
index 7f974dadc3..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/FrameDecoder.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef QPID_FRAMING_FRAMEDECODER_H
-#define QPID_FRAMING_FRAMEDECODER_H
-
-/*
- *
- * 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 "AMQFrame.h"
-
-namespace qpid {
-namespace framing {
-
-/**
- * Decode a frame from buffer. If buffer does not contain a complete
- * frame, caches the fragment for the next call to decode.
- */
-class FrameDecoder
-{
- public:
- bool decode(Buffer& buffer);
- AMQFrame frame;
- private:
- std::vector<char> fragment;
-};
-}} // namespace qpid::framing
-
-#endif /*!QPID_FRAMING_FRAMEDECODER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/FrameDefaultVisitor.h b/M4-RCs/qpid/cpp/src/qpid/framing/FrameDefaultVisitor.h
deleted file mode 100644
index bd676960bf..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/FrameDefaultVisitor.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#ifndef QPID_FRAMING_FRAMEVISITOR_H
-#define QPID_FRAMING_FRAMEVISITOR_H
-
-/*
- * 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 "qpid/framing/MethodBodyDefaultVisitor.h"
-#include "qpid/framing/AMQBody.h"
-#include "qpid/framing/AMQMethodBody.h"
-#include "qpid/framing/AMQHeaderBody.h"
-#include "qpid/framing/AMQContentBody.h"
-#include "qpid/framing/AMQHeartbeatBody.h"
-
-namespace qpid {
-namespace framing {
-/**
- * Visitor for all concrete frame body types, which combines
- * AMQBodyConstVisitor and MethodBodyDefaultVisitor.
- *
- * Derived classes can override visit methods to specify actions.
- * Derived classes must override defaultVisit(), which is called
- * for any non-overridden visit functions.
- *
- */
-struct FrameDefaultVisitor : public AMQBodyConstVisitor,
- protected MethodBodyDefaultVisitor
-{
- virtual void defaultVisit(const AMQBody&) = 0;
- void defaultVisit(const AMQMethodBody& method) { defaultVisit(static_cast<const AMQBody&>(method)); }
-
- void visit(const AMQHeaderBody& b) { defaultVisit(b); }
- void visit(const AMQContentBody& b) { defaultVisit(b); }
- void visit(const AMQHeartbeatBody& b) { defaultVisit(b); }
- void visit(const AMQMethodBody& b) { b.accept(static_cast<MethodBodyDefaultVisitor&>(*this)); }
-
- using AMQBodyConstVisitor::visit;
- using MethodBodyDefaultVisitor::visit;
-};
-
-}} // namespace qpid::framing
-
-
-#endif /*!QPID_FRAMING_FRAMEVISITOR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/FrameHandler.h b/M4-RCs/qpid/cpp/src/qpid/framing/FrameHandler.h
deleted file mode 100644
index 457968c35e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/FrameHandler.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef QPID_FRAMING_FRAMEHANDLER_H
-#define QPID_FRAMING_FRAMEHANDLER_H
-/*
- *
- * 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 "Handler.h"
-
-namespace qpid {
-namespace framing {
-
-class AMQFrame;
-typedef Handler<AMQFrame&> FrameHandler;
-
-
-}}
-#endif /*!QPID_FRAMING_FRAMEHANDLER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/FrameSet.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/FrameSet.cpp
deleted file mode 100644
index 9846f1d42b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/FrameSet.cpp
+++ /dev/null
@@ -1,90 +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 "FrameSet.h"
-#include "qpid/framing/all_method_bodies.h"
-#include "qpid/framing/frame_functors.h"
-#include "qpid/framing/MessageProperties.h"
-#include "qpid/framing/TypeFilter.h"
-
-using namespace qpid::framing;
-using namespace boost;
-
-FrameSet::FrameSet(const SequenceNumber& _id) : id(_id),contentSize(0),recalculateSize(true) { }
-
-void FrameSet::append(const AMQFrame& part)
-{
- parts.push_back(part);
- recalculateSize = true;
-}
-
-bool FrameSet::isComplete() const
-{
- return !parts.empty() && parts.back().getEof() && parts.back().getEos();
-}
-
-bool FrameSet::isContentBearing() const
-{
- const AMQMethodBody* method = getMethod();
- return method && method->isContentBearing();
-}
-
-const AMQMethodBody* FrameSet::getMethod() const
-{
- return parts.empty() ? 0 : parts[0].getMethod();
-}
-
-const AMQHeaderBody* FrameSet::getHeaders() const
-{
- return parts.size() < 2 ? 0 : parts[1].castBody<AMQHeaderBody>();
-}
-
-AMQHeaderBody* FrameSet::getHeaders()
-{
- return parts.size() < 2 ? 0 : parts[1].castBody<AMQHeaderBody>();
-}
-
-uint64_t FrameSet::getContentSize() const
-{
- if (recalculateSize)
- {
- SumBodySize sum;
- map_if(sum, TypeFilter<CONTENT_BODY>());
- contentSize = sum.getSize();
- recalculateSize = false;
- }
- return contentSize;
-}
-
-void FrameSet::getContent(std::string& out) const {
- out.clear();
- out.reserve(getContentSize());
- for(Frames::const_iterator i = parts.begin(); i != parts.end(); i++) {
- if (i->getBody()->type() == CONTENT_BODY)
- out += i->castBody<AMQContentBody>()->getData();
- }
-}
-
-std::string FrameSet::getContent() const {
- std::string out;
- getContent(out);
- return out;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/FrameSet.h b/M4-RCs/qpid/cpp/src/qpid/framing/FrameSet.h
deleted file mode 100644
index 82987910a7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/FrameSet.h
+++ /dev/null
@@ -1,107 +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 <string>
-#include "qpid/InlineVector.h"
-#include "qpid/framing/amqp_framing.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/SequenceNumber.h"
-
-#ifndef _FrameSet_
-#define _FrameSet_
-
-namespace qpid {
-namespace framing {
-
-/**
- * Collects the frames representing a message.
- */
-class FrameSet
-{
- typedef InlineVector<AMQFrame, 4> Frames;
- const SequenceNumber id;
- Frames parts;
- mutable uint64_t contentSize;
- mutable bool recalculateSize;
-
-public:
- typedef boost::shared_ptr<FrameSet> shared_ptr;
-
- FrameSet(const SequenceNumber& id);
- void append(const AMQFrame& part);
- bool isComplete() const;
-
- uint64_t getContentSize() const;
- void getContent(std::string&) const;
- std::string getContent() const;
-
- bool isContentBearing() const;
-
- const AMQMethodBody* getMethod() const;
- const AMQHeaderBody* getHeaders() const;
- AMQHeaderBody* getHeaders();
-
- template <class T> bool isA() const {
- const AMQMethodBody* method = getMethod();
- return method && method->isA<T>();
- }
-
- template <class T> const T* as() const {
- const AMQMethodBody* method = getMethod();
- return (method && method->isA<T>()) ? dynamic_cast<const T*>(method) : 0;
- }
-
- template <class T> const T* getHeaderProperties() const {
- const AMQHeaderBody* header = getHeaders();
- return header ? header->get<T>() : 0;
- }
-
- const SequenceNumber& getId() const { return id; }
-
- template <class P> void remove(P predicate) {
- parts.erase(std::remove_if(parts.begin(), parts.end(), predicate), parts.end());
- }
-
- template <class F> void map(F& functor) {
- std::for_each(parts.begin(), parts.end(), functor);
- }
-
- template <class F> void map(F& functor) const {
- std::for_each(parts.begin(), parts.end(), functor);
- }
-
- template <class F, class P> void map_if(F& functor, P predicate) {
- for(Frames::iterator i = parts.begin(); i != parts.end(); i++) {
- if (predicate(*i)) functor(*i);
- }
- }
-
- template <class F, class P> void map_if(F& functor, P predicate) const {
- for(Frames::const_iterator i = parts.begin(); i != parts.end(); i++) {
- if (predicate(*i)) functor(*i);
- }
- }
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Handler.h b/M4-RCs/qpid/cpp/src/qpid/framing/Handler.h
deleted file mode 100644
index e07a803e17..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Handler.h
+++ /dev/null
@@ -1,101 +0,0 @@
-#ifndef QPID_FRAMING_HANDLER_H
-#define QPID_FRAMING_HANDLER_H
-
-/*
- *
- * 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 "qpid/shared_ptr.h"
-#include <boost/type_traits/remove_reference.hpp>
-#include <assert.h>
-
-namespace qpid {
-namespace framing {
-
-template <class T>
-struct Handler {
- typedef T HandledType;
- typedef void handleFptr(T);
- typedef void result_type; // Compatible with std/boost functors.
-
- Handler(Handler<T>* next_=0) : next(next_) {}
- virtual ~Handler() {}
- virtual void handle(T) = 0;
-
- /** Allow functor syntax for calling handle */
- void operator()(T t) { handle(t); }
-
-
- /** Pointer to next handler in a linked list. */
- Handler<T>* next;
-
- /** Adapt any void(T) functor as a Handler.
- * Functor<F>(f) will copy f.
- * Functor<F&>(f) will only take a reference to x.
- */
- template <class F> class Functor : public Handler<T> {
- public:
- Functor(F f, Handler<T>* next=0) : Handler<T>(next), functor(f) {}
- void handle(T t) { functor(t); }
- private:
- F functor;
- };
-
- /** Adapt a member function of X as a Handler.
- * Only holds a reference to its target, not a copy.
- */
- template <class X, void (X::*F)(T)>
- class MemFunRef : public Handler<T> {
- public:
- MemFunRef(X& x, Handler<T>* next=0) : Handler(next), target(&x) {}
- void handle(T t) { (target->*F)(t); }
-
- /** Allow calling with -> syntax */
- MemFunRef* operator->() { return this; }
-
- private:
- X* target;
- };
-
- /** Interface for a handler that implements a
- * pair of in/out handle operations.
- * @see InOutHandler
- */
- class InOutHandlerInterface {
- public:
- virtual ~InOutHandlerInterface() {}
- virtual void handleIn(T) = 0;
- virtual void handleOut(T) = 0;
- };
-
- /** Support for implementing an in-out handler pair as a single class.
- * Overrides handleIn, handleOut functions in a single class.
- */
- struct InOutHandler : protected InOutHandlerInterface {
- InOutHandler(Handler<T>* nextIn=0, Handler<T>* nextOut=0) : in(*this, nextIn), out(*this, nextOut) {}
- MemFunRef<InOutHandlerInterface, &InOutHandlerInterface::handleIn> in;
- MemFunRef<InOutHandlerInterface, &InOutHandlerInterface::handleOut> out;
- };
-};
-
-
-
-}}
-#endif /*!QPID_FRAMING_HANDLER_H*/
-//
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/HeaderProperties.h b/M4-RCs/qpid/cpp/src/qpid/framing/HeaderProperties.h
deleted file mode 100644
index 39c448fc3c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/HeaderProperties.h
+++ /dev/null
@@ -1,44 +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 "amqp_types.h"
-#include "Buffer.h"
-
-#ifndef _HeaderProperties_
-#define _HeaderProperties_
-
-namespace qpid {
-namespace framing {
-
- class HeaderProperties
- {
-
- public:
- inline virtual ~HeaderProperties(){}
- virtual uint8_t classId() const = 0;
- virtual uint32_t encodedSize() const = 0;
- virtual void encode(Buffer& buffer) const = 0;
- virtual void decode(Buffer& buffer, uint32_t size) = 0;
- };
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/InitiationHandler.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/InitiationHandler.cpp
deleted file mode 100644
index eceeaf4abc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/InitiationHandler.cpp
+++ /dev/null
@@ -1,24 +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 "InitiationHandler.h"
-
-qpid::framing::InitiationHandler::~InitiationHandler() {}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/InitiationHandler.h b/M4-RCs/qpid/cpp/src/qpid/framing/InitiationHandler.h
deleted file mode 100644
index 16a6b502e8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/InitiationHandler.h
+++ /dev/null
@@ -1,41 +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 <string>
-
-#ifndef _InitiationHandler_
-#define _InitiationHandler_
-
-#include "ProtocolInitiation.h"
-
-namespace qpid {
-namespace framing {
-
- class InitiationHandler{
- public:
- virtual ~InitiationHandler();
- virtual void initiated(const ProtocolInitiation&) = 0;
- };
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/InputHandler.h b/M4-RCs/qpid/cpp/src/qpid/framing/InputHandler.h
deleted file mode 100644
index 3a6d786a24..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/InputHandler.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef _InputHandler_
-#define _InputHandler_
-/*
- *
- * 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 "FrameHandler.h"
-#include <boost/noncopyable.hpp>
-
-namespace qpid {
-namespace framing {
-
-// TODO aconway 2007-08-29: Eliminate, replace with FrameHandler.
-class InputHandler : public FrameHandler {
- public:
- virtual ~InputHandler() {}
- virtual void received(AMQFrame&) = 0;
- void handle(AMQFrame& f) { received(f); }
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Invoker.h b/M4-RCs/qpid/cpp/src/qpid/framing/Invoker.h
deleted file mode 100644
index 4f1cf7c331..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Invoker.h
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef QPID_FRAMING_INVOKER_H
-#define QPID_FRAMING_INVOKER_H
-
-/*
- *
- * 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 "qpid/framing/AMQMethodBody.h"
-#include "qpid/framing/MethodBodyDefaultVisitor.h"
-#include "qpid/framing/StructHelper.h"
-
-#include <boost/optional.hpp>
-
-namespace qpid {
-namespace framing {
-
-class AMQMethodBody;
-
-/**
- * Base class for invoker visitors.
- */
-class Invoker: public MethodBodyDefaultVisitor, protected StructHelper
-{
- public:
- struct Result {
- public:
- Result() : handled(false) {}
- const std::string& getResult() const { return result; }
- bool hasResult() const { return !result.empty(); }
- bool wasHandled() const { return handled; }
- operator bool() const { return handled; }
-
- std::string result;
- bool handled;
- };
-
- void defaultVisit(const AMQMethodBody&) {}
- Result getResult() const { return result; }
-
- protected:
- Result result;
-};
-
-/**
- * Invoke an invocable object.
- * Invocable classes must provide a nested type Invoker.
- */
-template <class Invocable>
-Invoker::Result invoke(Invocable& target, const AMQMethodBody& body) {
- typename Invocable::Invoker invoker(target);
- body.accept(invoker);
- return invoker.getResult();
-}
-
-/**
- * Invoke an invocable object.
- * Invocable classes must provide a nested type Invoker.
- */
-template <class Invocable>
-Invoker::Result invoke(Invocable& target, const AMQBody& body) {
- typename Invocable::Invoker invoker(target);
- const AMQMethodBody* method = body.getMethod();
- if (method)
- method->accept(invoker);
- return invoker.getResult();
-}
-
-}} // namespace qpid::framing
-
-#endif /*!QPID_FRAMING_INVOKER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/MethodContent.h b/M4-RCs/qpid/cpp/src/qpid/framing/MethodContent.h
deleted file mode 100644
index 737c0d6b7b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/MethodContent.h
+++ /dev/null
@@ -1,40 +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.
- *
- */
-#ifndef _MethodContent_
-#define _MethodContent_
-
-#include <string>
-#include "AMQHeaderBody.h"
-
-namespace qpid {
-namespace framing {
-
-class MethodContent
-{
-public:
- virtual ~MethodContent() {}
- //TODO: rethink this interface
- virtual AMQHeaderBody getHeader() const = 0;
- virtual const std::string& getData() const = 0;
-};
-
-}}
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/ModelMethod.h b/M4-RCs/qpid/cpp/src/qpid/framing/ModelMethod.h
deleted file mode 100644
index afbdf7b6e2..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/ModelMethod.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _ModelMethod_
-#define _ModelMethod_
-
-/*
- *
- * 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 "AMQMethodBody.h"
-#include "qpid/framing/Header.h"
-
-namespace qpid {
-namespace framing {
-
-
-class ModelMethod : public AMQMethodBody
-{
- mutable Header header;
-public:
- virtual ~ModelMethod() {}
- virtual void encodeHeader(Buffer& buffer) const { header.encode(buffer); }
- virtual void decodeHeader(Buffer& buffer, uint32_t size=0) { header.decode(buffer, size); }
- virtual uint32_t headerSize() const { return header.encodedSize(); }
- virtual bool isSync() const { return header.getSync(); }
- virtual void setSync(bool on) const { header.setSync(on); }
- Header& getHeader() { return header; }
- const Header& getHeader() const { return header; }
-};
-
-
-}} // namespace qpid::framing
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/OutputHandler.h b/M4-RCs/qpid/cpp/src/qpid/framing/OutputHandler.h
deleted file mode 100644
index 6f4b27fb72..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/OutputHandler.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#ifndef _OutputHandler_
-#define _OutputHandler_
-
-/*
- *
- * 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 <boost/noncopyable.hpp>
-#include "FrameHandler.h"
-
-namespace qpid {
-namespace framing {
-
-// TODO aconway 2007-08-29: Replace with FrameHandler.
-class OutputHandler : public FrameHandler {
- public:
- virtual ~OutputHandler() {}
- virtual void send(AMQFrame&) = 0;
- void handle(AMQFrame& f) { send(f); }
-};
-
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolInitiation.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolInitiation.cpp
deleted file mode 100644
index 50617de017..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolInitiation.cpp
+++ /dev/null
@@ -1,66 +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 "ProtocolInitiation.h"
-
-namespace qpid {
-namespace framing {
-
-ProtocolInitiation::ProtocolInitiation(){}
-
-ProtocolInitiation::ProtocolInitiation(uint8_t _major, uint8_t _minor) : version(_major, _minor) {}
-
-ProtocolInitiation::ProtocolInitiation(ProtocolVersion p) : version(p) {}
-
-ProtocolInitiation::~ProtocolInitiation(){}
-
-void ProtocolInitiation::encode(Buffer& buffer) const {
- buffer.putOctet('A');
- buffer.putOctet('M');
- buffer.putOctet('Q');
- buffer.putOctet('P');
- buffer.putOctet(1);//class
- buffer.putOctet(1);//instance
- buffer.putOctet(version.getMajor());
- buffer.putOctet(version.getMinor());
-}
-
-bool ProtocolInitiation::decode(Buffer& buffer){
- if(buffer.available() >= 8){
- buffer.getOctet();//A
- buffer.getOctet();//M
- buffer.getOctet();//Q
- buffer.getOctet();//P
- buffer.getOctet();//class
- buffer.getOctet();//instance
- version.setMajor(buffer.getOctet());
- version.setMinor(buffer.getOctet());
- return true;
- }else{
- return false;
- }
-}
-
-
-std::ostream& operator<<(std::ostream& o, const framing::ProtocolInitiation& pi) {
- return o << int(pi.getMajor()) << "-" << int(pi.getMinor());
-}
-
-}} // namespace qpid::framing
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolInitiation.h b/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolInitiation.h
deleted file mode 100644
index 6584fee55c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolInitiation.h
+++ /dev/null
@@ -1,58 +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 "amqp_types.h"
-#include "Buffer.h"
-#include "AMQDataBlock.h"
-#include "ProtocolVersion.h"
-
-#ifndef _ProtocolInitiation_
-#define _ProtocolInitiation_
-
-namespace qpid {
-namespace framing {
-
-class ProtocolInitiation : public AMQDataBlock
-{
-private:
- ProtocolVersion version;
-
-public:
- ProtocolInitiation();
- ProtocolInitiation(uint8_t major, uint8_t minor);
- ProtocolInitiation(ProtocolVersion p);
- virtual ~ProtocolInitiation();
- virtual void encode(Buffer& buffer) const;
- virtual bool decode(Buffer& buffer);
- inline virtual uint32_t encodedSize() const { return 8; }
- inline uint8_t getMajor() const { return version.getMajor(); }
- inline uint8_t getMinor() const { return version.getMinor(); }
- inline ProtocolVersion getVersion() const { return version; }
- bool operator==(ProtocolVersion v) const { return v == getVersion(); }
-};
-
-std::ostream& operator<<(std::ostream& o, const framing::ProtocolInitiation& pi);
-
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolVersion.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolVersion.cpp
deleted file mode 100644
index 7a96bfa925..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolVersion.cpp
+++ /dev/null
@@ -1,44 +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 "ProtocolVersion.h"
-#include <sstream>
-
-using namespace qpid::framing;
-
-const std::string ProtocolVersion::toString() const
-{
- std::stringstream ss;
- ss << major_ << "-" << minor_;
- return ss.str();
-}
-
-ProtocolVersion& ProtocolVersion::operator=(ProtocolVersion p)
-{
- major_ = p.major_;
- minor_ = p.minor_;
- return *this;
-}
-
-bool ProtocolVersion::operator==(ProtocolVersion p) const
-{
- return major_ == p.major_ && minor_ == p.minor_;
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolVersion.h b/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolVersion.h
deleted file mode 100644
index 9a7ebec491..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/ProtocolVersion.h
+++ /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.
- *
- */
-#ifndef _ProtocolVersion_
-#define _ProtocolVersion_
-
-#include "amqp_types.h"
-
-namespace qpid
-{
-namespace framing
-{
-
-class ProtocolVersion
-{
-private:
- uint8_t major_;
- uint8_t minor_;
-
-public:
- explicit ProtocolVersion(uint8_t _major=0, uint8_t _minor=0)
- : major_(_major), minor_(_minor) {}
-
- uint8_t getMajor() const { return major_; }
- void setMajor(uint8_t major) { major_ = major; }
- uint8_t getMinor() const { return minor_; }
- void setMinor(uint8_t minor) { minor_ = minor; }
- const std::string toString() const;
-
- ProtocolVersion& operator=(ProtocolVersion p);
-
- bool operator==(ProtocolVersion p) const;
- bool operator!=(ProtocolVersion p) const { return ! (*this == p); }
-};
-
-} // namespace framing
-} // namespace qpid
-
-
-#endif // ifndef _ProtocolVersion_
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Proxy.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/Proxy.cpp
deleted file mode 100644
index 6b37fb368d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Proxy.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Proxy.h"
-#include "AMQFrame.h"
-
-namespace qpid {
-namespace framing {
-
-Proxy::Proxy(FrameHandler& h) : out(&h) {}
-
-Proxy::~Proxy() {}
-
-void Proxy::send(const AMQBody& b) {
- AMQFrame f(b);
- out->handle(f);
-}
-
-ProtocolVersion Proxy::getVersion() const {
- return ProtocolVersion();
-}
-
-FrameHandler& Proxy::getHandler() { return *out; }
-
-void Proxy::setHandler(FrameHandler& f) { out=&f; }
-
-}} // namespace qpid::framing
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Proxy.h b/M4-RCs/qpid/cpp/src/qpid/framing/Proxy.h
deleted file mode 100644
index 3dc082097a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Proxy.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef _framing_Proxy_h
-#define _framing_Proxy_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "FrameHandler.h"
-#include "ProtocolVersion.h"
-
-namespace qpid {
-namespace framing {
-
-class AMQBody;
-
-/**
- * Base class for proxies.
- */
-class Proxy
-{
- public:
- Proxy(FrameHandler& h);
- virtual ~Proxy();
-
- void send(const AMQBody&);
-
- ProtocolVersion getVersion() const;
-
- FrameHandler& getHandler();
- void setHandler(FrameHandler&);
-
- private:
- FrameHandler* out;
-};
-
-}} // namespace qpid::framing
-
-
-
-#endif /*!_framing_Proxy_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/SendContent.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/SendContent.cpp
deleted file mode 100644
index f390106dee..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/SendContent.cpp
+++ /dev/null
@@ -1,69 +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 "SendContent.h"
-
-qpid::framing::SendContent::SendContent(FrameHandler& h, uint16_t mfs, uint efc) : handler(h),
- maxFrameSize(mfs),
- expectedFrameCount(efc), frameCount(0) {}
-
-void qpid::framing::SendContent::operator()(const AMQFrame& f)
-{
- bool first = frameCount == 0;
- bool last = ++frameCount == expectedFrameCount;
-
- /*end of frame marker is included in frameOverhead() but not in
- real frame size, hence substract -1 from frameOverhead()*/
- uint16_t maxContentSize = maxFrameSize - (AMQFrame::frameOverhead() - 1);
- const AMQContentBody* body(f.castBody<AMQContentBody>());
- if (body->encodedSize() > maxContentSize) {
- uint32_t offset = 0;
- for (int chunk = body->encodedSize() / maxContentSize; chunk > 0; chunk--) {
- sendFragment(*body, offset, maxContentSize, first && offset == 0, last && offset + maxContentSize == body->encodedSize());
- offset += maxContentSize;
- }
- uint32_t remainder = body->encodedSize() % maxContentSize;
- if (remainder) {
- sendFragment(*body, offset, remainder, first && offset == 0, last);
- }
- } else {
- AMQFrame copy(f);
- setFlags(copy, first, last);
- handler.handle(copy);
- }
-}
-
-void qpid::framing::SendContent::sendFragment(const AMQContentBody& body, uint32_t offset, uint16_t size, bool first, bool last) const
-{
- AMQFrame fragment(in_place<AMQContentBody>(
- body.getData().substr(offset, size)));
- setFlags(fragment, first, last);
- handler.handle(fragment);
-}
-
-void qpid::framing::SendContent::setFlags(AMQFrame& f, bool first, bool last) const
-{
- f.setBof(false);
- f.setBos(first);
- f.setEof(true);//content is always the last segment
- f.setEos(last);
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/SendContent.h b/M4-RCs/qpid/cpp/src/qpid/framing/SendContent.h
deleted file mode 100644
index dcd5202b3e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/SendContent.h
+++ /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.
- *
- */
-#include <string>
-#include "qpid/framing/amqp_framing.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/FrameHandler.h"
-
-#ifndef _SendContent_
-#define _SendContent_
-
-namespace qpid {
-namespace framing {
-
-/**
- * Functor that sends frame to handler, refragmenting if
- * necessary. Currently only works on content frames but this could be
- * changed once we support multi-frame segments in general.
- */
-class SendContent
-{
- mutable FrameHandler& handler;
- const uint16_t maxFrameSize;
- uint expectedFrameCount;
- uint frameCount;
-
- void sendFragment(const AMQContentBody& body, uint32_t offset, uint16_t size, bool first, bool last) const;
- void setFlags(AMQFrame& f, bool first, bool last) const;
-public:
- SendContent(FrameHandler& _handler, uint16_t _maxFrameSize, uint frameCount);
- void operator()(const AMQFrame& f);
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumber.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumber.cpp
deleted file mode 100644
index cac4e6681e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumber.cpp
+++ /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.
- *
- */
-
-#include "SequenceNumber.h"
-#include "Buffer.h"
-#include <ostream>
-
-using qpid::framing::SequenceNumber;
-using qpid::framing::Buffer;
-
-SequenceNumber::SequenceNumber() : value(0) {}
-
-SequenceNumber::SequenceNumber(uint32_t v) : value((int32_t) v) {}
-
-bool SequenceNumber::operator==(const SequenceNumber& other) const
-{
- return value == other.value;
-}
-
-bool SequenceNumber::operator!=(const SequenceNumber& other) const
-{
- return !(value == other.value);
-}
-
-
-SequenceNumber& SequenceNumber::operator++()
-{
- value = value + 1;
- return *this;
-}
-
-const SequenceNumber SequenceNumber::operator++(int)
-{
- SequenceNumber old(value);
- value = value + 1;
- return old;
-}
-
-SequenceNumber& SequenceNumber::operator--()
-{
- value = value - 1;
- return *this;
-}
-
-bool SequenceNumber::operator<(const SequenceNumber& other) const
-{
- return (value - other.value) < 0;
-}
-
-bool SequenceNumber::operator>(const SequenceNumber& other) const
-{
- return other < *this;
-}
-
-bool SequenceNumber::operator<=(const SequenceNumber& other) const
-{
- return *this == other || *this < other;
-}
-
-bool SequenceNumber::operator>=(const SequenceNumber& other) const
-{
- return *this == other || *this > other;
-}
-
-void SequenceNumber::encode(Buffer& buffer) const
-{
- buffer.putLong(value);
-}
-
-void SequenceNumber::decode(Buffer& buffer)
-{
- value = buffer.getLong();
-}
-
-uint32_t SequenceNumber::encodedSize() const {
- return 4;
-}
-
-namespace qpid {
-namespace framing {
-
-int32_t operator-(const SequenceNumber& a, const SequenceNumber& b)
-{
- int32_t result = a.value - b.value;
- return result;
-}
-
-std::ostream& operator<<(std::ostream& o, const SequenceNumber& n) {
- return o << n.getValue();
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumber.h b/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumber.h
deleted file mode 100644
index 930e146863..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumber.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.
- *
- */
-#ifndef _framing_SequenceNumber_h
-#define _framing_SequenceNumber_h
-
-#include "amqp_types.h"
-#include <iosfwd>
-
-namespace qpid {
-namespace framing {
-
-class Buffer;
-
-/**
- * 4-byte sequence number that 'wraps around'.
- */
-class SequenceNumber
-{
- int32_t value;
-
- public:
- SequenceNumber();
- SequenceNumber(uint32_t v);
-
- SequenceNumber& operator++();//prefix ++
- const SequenceNumber operator++(int);//postfix ++
- SequenceNumber& operator--();//prefix ++
- bool operator==(const SequenceNumber& other) const;
- bool operator!=(const SequenceNumber& other) const;
- bool operator<(const SequenceNumber& other) const;
- bool operator>(const SequenceNumber& other) const;
- bool operator<=(const SequenceNumber& other) const;
- bool operator>=(const SequenceNumber& other) const;
- uint32_t getValue() const { return (uint32_t) value; }
- operator uint32_t() const { return (uint32_t) value; }
-
- friend int32_t operator-(const SequenceNumber& a, const SequenceNumber& b);
-
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer);
- uint32_t encodedSize() const;
-
- template <class S> void serialize(S& s) { s(value); }
-};
-
-struct Window
-{
- SequenceNumber hwm;
- SequenceNumber lwm;
-};
-
-std::ostream& operator<<(std::ostream& o, const SequenceNumber& n);
-
-}} // namespace qpid::framing
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumberSet.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumberSet.cpp
deleted file mode 100644
index afab9033e5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumberSet.cpp
+++ /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.
- *
- */
-
-#include "SequenceNumberSet.h"
-
-using namespace qpid::framing;
-
-void SequenceNumberSet::encode(Buffer& buffer) const
-{
- buffer.putShort(size() * 4);
- for (const_iterator i = begin(); i != end(); i++) {
- buffer.putLong(i->getValue());
- }
-}
-
-void SequenceNumberSet::decode(Buffer& buffer)
-{
- uint16_t count = (buffer.getShort() / 4);
- for (uint16_t i = 0; i < count; i++) {
- push_back(SequenceNumber(buffer.getLong()));
- }
-}
-
-uint32_t SequenceNumberSet::encodedSize() const
-{
- return 2 /*count*/ + (size() * 4);
-}
-
-SequenceNumberSet SequenceNumberSet::condense() const
-{
- SequenceNumberSet result;
- const_iterator last = end();
- const_iterator start = end();
- for (const_iterator i = begin(); i != end(); i++) {
- if (start == end()) {
- start = i;
- } else if (*i - *last > 1) {
- result.push_back(*start);
- result.push_back(*last);
- start = i;
- }
- last = i;
- }
- if (start != end()) {
- result.push_back(*start);
- result.push_back(*last);
- }
- return result;
-}
-
-void SequenceNumberSet::addRange(const SequenceNumber& start, const SequenceNumber& end)
-{
- push_back(start);
- push_back(end);
-}
-
-namespace qpid{
-namespace framing{
-
-std::ostream& operator<<(std::ostream& out, const SequenceNumberSet& set) {
- out << "{";
- for (SequenceNumberSet::const_iterator i = set.begin(); i != set.end(); i++) {
- if (i != set.begin()) out << ", ";
- out << (i->getValue());
- }
- out << "}";
- return out;
-}
-
-}
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumberSet.h b/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumberSet.h
deleted file mode 100644
index 666307f9d9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceNumberSet.h
+++ /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.
- *
- */
-#ifndef _framing_SequenceNumberSet_h
-#define _framing_SequenceNumberSet_h
-
-#include <ostream>
-#include "amqp_types.h"
-#include "Buffer.h"
-#include "SequenceNumber.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/InlineVector.h"
-
-namespace qpid {
-namespace framing {
-
-class SequenceNumberSet : public InlineVector<SequenceNumber, 2>
-{
- typedef InlineVector<SequenceNumber, 2> Base;
-public:
- typedef Base::const_iterator const_iterator;
- typedef Base::iterator iterator;
-
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer);
- uint32_t encodedSize() const;
- SequenceNumberSet condense() const;
- void addRange(const SequenceNumber& start, const SequenceNumber& end);
-
- template <class T>
- void processRanges(T& t) const
- {
- if (size() % 2) { //must be even number
- throw InvalidArgumentException("SequenceNumberSet contains odd number of elements");
- }
-
- for (SequenceNumberSet::const_iterator i = begin(); i != end(); i++) {
- SequenceNumber first = *(i);
- SequenceNumber last = *(++i);
- t(first, last);
- }
- }
-
- friend std::ostream& operator<<(std::ostream&, const SequenceNumberSet&);
-};
-
-
-}} // namespace qpid::framing
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceSet.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/SequenceSet.cpp
deleted file mode 100644
index 2046fac3e1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceSet.cpp
+++ /dev/null
@@ -1,100 +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 "SequenceSet.h"
-#include "Buffer.h"
-#include "qpid/framing/reply_exceptions.h"
-
-using namespace qpid::framing;
-using std::max;
-using std::min;
-
-namespace qpid {
-namespace framing {
-
-namespace {
-//each range contains 2 numbers, 4 bytes each
-uint16_t RANGE_SIZE = 2 * 4;
-}
-
-void SequenceSet::encode(Buffer& buffer) const
-{
- buffer.putShort(rangesSize() * RANGE_SIZE);
- for (RangeIterator i = rangesBegin(); i != rangesEnd(); i++) {
- buffer.putLong(i->first().getValue());
- buffer.putLong(i->last().getValue());
- }
-}
-
-void SequenceSet::decode(Buffer& buffer)
-{
- uint16_t size = buffer.getShort();
- uint16_t count = size / RANGE_SIZE;//number of ranges
- if (size % RANGE_SIZE)
- throw IllegalArgumentException(QPID_MSG("Invalid size for sequence set: " << size));
-
- for (uint16_t i = 0; i < count; i++) {
- add(SequenceNumber(buffer.getLong()), SequenceNumber(buffer.getLong()));
- }
-}
-
-uint32_t SequenceSet::encodedSize() const {
- return 2 /*size field*/ + (rangesSize() * RANGE_SIZE);
-}
-
-bool SequenceSet::contains(const SequenceNumber& s) const {
- return RangeSet<SequenceNumber>::contains(s);
-}
-
-void SequenceSet::add(const SequenceNumber& s) { *this += s; }
-
-void SequenceSet::add(const SequenceNumber& start, const SequenceNumber& finish) {
- *this += Range<SequenceNumber>::makeClosed(std::min(start,finish), std::max(start, finish));
-}
-
-void SequenceSet::add(const SequenceSet& set) { *this += set; }
-
-void SequenceSet::remove(const SequenceSet& set) { *this -= set; }
-
-void SequenceSet::remove(const SequenceNumber& start, const SequenceNumber& finish) {
- *this -= Range<SequenceNumber>::makeClosed(std::min(start,finish), std::max(start, finish));
-}
-
-void SequenceSet::remove(const SequenceNumber& s) { *this -= s; }
-
-
-struct RangePrinter {
- std::ostream& out;
- RangePrinter(std::ostream& o) : out(o) {}
- void operator()(SequenceNumber i, SequenceNumber j) const {
- out << "[" << i.getValue() << "," << j.getValue() << "] ";
- }
-};
-
-std::ostream& operator<<(std::ostream& o, const SequenceSet& s) {
- RangePrinter print(o);
- o << "{ ";
- s.for_each(print);
- return o << "}";
-}
-
-}} // namespace qpid::framing
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceSet.h b/M4-RCs/qpid/cpp/src/qpid/framing/SequenceSet.h
deleted file mode 100644
index 57b9c2c8e1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/SequenceSet.h
+++ /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.
- *
- */
-#ifndef _framing_SequenceSet_h
-#define _framing_SequenceSet_h
-
-#include "SequenceNumber.h"
-#include "qpid/RangeSet.h"
-
-namespace qpid {
-namespace framing {
-class Buffer;
-
-class SequenceSet : public RangeSet<SequenceNumber> {
- public:
- SequenceSet() {}
- SequenceSet(const RangeSet<SequenceNumber>& r)
- : RangeSet<SequenceNumber>(r) {}
- SequenceSet(const SequenceNumber& s) { add(s); }
- SequenceSet(const SequenceNumber& start, const SequenceNumber finish) { add(start,finish); }
-
-
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer);
- uint32_t encodedSize() const;
-
- bool contains(const SequenceNumber& s) const;
- void add(const SequenceNumber& s);
- void add(const SequenceNumber& start, const SequenceNumber& finish); // Closed range
- void add(const SequenceSet& set);
- void remove(const SequenceNumber& s);
- void remove(const SequenceNumber& start, const SequenceNumber& finish); // Closed range
- void remove(const SequenceSet& set);
-
- template <class T> void for_each(T& t) const {
- for (RangeIterator i = rangesBegin(); i != rangesEnd(); i++)
- t(i->first(), i->last());
- }
-
- template <class T> void for_each(const T& t) const {
- for (RangeIterator i = rangesBegin(); i != rangesEnd(); i++)
- t(i->first(), i->last());
- }
-
- friend std::ostream& operator<<(std::ostream&, const SequenceSet&);
-};
-
-}} // namespace qpid::framing
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/StructHelper.h b/M4-RCs/qpid/cpp/src/qpid/framing/StructHelper.h
deleted file mode 100644
index e3dce4f5ec..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/StructHelper.h
+++ /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.
- *
- */
-#ifndef _StructHelper_
-#define _StructHelper_
-
-#include "qpid/Exception.h"
-#include "Buffer.h"
-
-#include <stdlib.h> // For alloca
-
-namespace qpid {
-namespace framing {
-
-class StructHelper
-{
-public:
-
- template <class T> void encode(const T t, std::string& data) {
- uint32_t size = t.bodySize() + 2/*type*/;
- data.resize(size);
- Buffer wbuffer(const_cast<char*>(data.data()), size);
- wbuffer.putShort(T::TYPE);
- t.encodeStructBody(wbuffer);
- }
-
- template <class T> void decode(T& t, const std::string& data) {
- Buffer rbuffer(const_cast<char*>(data.data()), data.length());
- uint16_t type = rbuffer.getShort();
- if (type == T::TYPE) {
- t.decodeStructBody(rbuffer);
- } else {
- throw Exception("Type code does not match");
- }
- }
-};
-
-}}
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/TemplateVisitor.h b/M4-RCs/qpid/cpp/src/qpid/framing/TemplateVisitor.h
deleted file mode 100644
index d6d59603f7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/TemplateVisitor.h
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef QPID_FRAMING_TEMPLATEVISITOR_H
-#define QPID_FRAMING_TEMPLATEVISITOR_H
-
-/*
- * 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 <boost/mpl/fold.hpp>
-#include <boost/utility/value_init.hpp>
-
-namespace qpid {
-namespace framing {
-
-/**
- * Metafunction to generate a visitor class derived from Base, with a
- * visit for each type in TypeList calling functor F. TypeList may be
- * any boost::mpl type collection e.g. mpl::list.
- *
- * Generated class is: TemplateVisitor<Base, F, TypeList>::type
- *
- * @see make_visitor
- */
-template <class VisitTemplate, class TypeList, class F>
-class TemplateVisitor
-{
- struct Base : public VisitorBase {
- F action;
- Base(F f) : action(f) {}
- using VisitorBase::visit;
- };
-
- template <class B, class T> struct Visit : public B {
- Visit(F action) : B(action) {}
- using B::visit;
- void visit(const T& body) { action(body); }
- };
-
- typedef typename boost::mpl::fold<
- TypeList, Base, Visit<boost::mpl::placeholders::_1,
- boost::mpl::placeholders::_2>
- >::type type;
-};
-
-/**
- * Construct a TemplateVisitor to perform the given action,
- * for example:
- * @code
- */
-template <class VisitorBase, class TypeList, class F>
-TemplateVisitor<VisitorBase,TypeList,F>::type make_visitor(F action) {
- return TemplateVisitor<VisitorBase,TypeList,F>::type(action);
-};
-
-/**
- * For method body classes in TypeList, invoke the corresponding function
- * on Target and return true. For other body types return false.
- */
-template <class TypeList, class Target>
-bool invoke(const AMQBody& body, Target& target) {
- typename InvokeVisitor<TypeList, Target>::type v(target);
- body.accept(v);
- return v.target;
-}
-
-}} // namespace qpid::framing
-
-
-#endif /*!QPID_FRAMING_INVOKEVISITOR_H*/
-
-}} // namespace qpid::framing
-
-
-
-#endif /*!QPID_FRAMING_TEMPLATEVISITOR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/TransferContent.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/TransferContent.cpp
deleted file mode 100644
index 3fc54296fa..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/TransferContent.cpp
+++ /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.
- *
- */
-
-#include "TransferContent.h"
-
-namespace qpid {
-namespace framing {
-
-TransferContent::TransferContent(const std::string& data, const std::string& key) {
- setData(data);
- if (!key.empty()) getDeliveryProperties().setRoutingKey(key);
-}
-
-
-AMQHeaderBody TransferContent::getHeader() const
-{
- return header;
-}
-
-const std::string& TransferContent::getData() const {
- return data;
-}
-
-std::string& TransferContent::getData() {
- return data;
-}
-
-void TransferContent::setData(const std::string& _data)
-{
- data = _data;
- header.get<MessageProperties>(true)->setContentLength(data.size());
-}
-
-void TransferContent::appendData(const std::string& _data)
-{
- data += _data;
- header.get<MessageProperties>(true)->setContentLength(data.size());
-}
-
-MessageProperties& TransferContent::getMessageProperties()
-{
- return *header.get<MessageProperties>(true);
-}
-
-DeliveryProperties& TransferContent::getDeliveryProperties()
-{
- return *header.get<DeliveryProperties>(true);
-}
-
-void TransferContent::populate(const FrameSet& frameset)
-{
- const AMQHeaderBody* h = frameset.getHeaders();
- if (h) {
- header = *h;
- }
- frameset.getContent(data);
-}
-
-const MessageProperties& TransferContent::getMessageProperties() const
-{
- const MessageProperties* props = header.get<MessageProperties>();
- if (!props) throw Exception("No message properties.");
- return *props;
-}
-
-const DeliveryProperties& TransferContent::getDeliveryProperties() const
-{
- const DeliveryProperties* props = header.get<DeliveryProperties>();
- if (!props) throw Exception("No message properties.");
- return *props;
-}
-
-bool TransferContent::hasMessageProperties() const
-{
- return header.get<MessageProperties>();
-}
-
-bool TransferContent::hasDeliveryProperties() const
-{
- return header.get<DeliveryProperties>();
-}
-
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/TransferContent.h b/M4-RCs/qpid/cpp/src/qpid/framing/TransferContent.h
deleted file mode 100644
index e3f6666fa4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/TransferContent.h
+++ /dev/null
@@ -1,63 +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.
- *
- */
-#ifndef _TransferContent_
-#define _TransferContent_
-
-#include "FrameSet.h"
-#include "MethodContent.h"
-#include "qpid/Exception.h"
-#include "qpid/framing/MessageProperties.h"
-#include "qpid/framing/DeliveryProperties.h"
-
-namespace qpid {
-namespace framing {
-
-/** Message content */
-class TransferContent : public MethodContent
-{
- AMQHeaderBody header;
- std::string data;
-public:
- TransferContent(const std::string& data = std::string(), const std::string& key=std::string());
-
- ///@internal
- AMQHeaderBody getHeader() const;
-
- void setData(const std::string&);
- const std::string& getData() const;
- std::string& getData();
-
- void appendData(const std::string&);
-
- bool hasMessageProperties() const;
- MessageProperties& getMessageProperties();
- const MessageProperties& getMessageProperties() const;
-
- bool hasDeliveryProperties() const;
- DeliveryProperties& getDeliveryProperties();
- const DeliveryProperties& getDeliveryProperties() const;
-
- ///@internal
- void populate(const FrameSet& frameset);
-};
-
-}}
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/TypeFilter.h b/M4-RCs/qpid/cpp/src/qpid/framing/TypeFilter.h
deleted file mode 100644
index d1c42de583..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/TypeFilter.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef QPID_FRAMING_TYPEFILTER_H
-#define QPID_FRAMING_TYPEFILTER_H
-
-/*
- *
- * 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 <string>
-#include "qpid/framing/amqp_framing.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/FrameHandler.h"
-
-namespace qpid {
-namespace framing {
-
-/**
- * Predicate that selects frames by type
- */
-template <uint8_t Type>
-struct TypeFilter {
- bool operator()(const AMQFrame& f) const {
- return f.getBody()->type() == Type;
- }
-};
-
-template <uint8_t T1, uint8_t T2>
-struct TypeFilter2 {
- bool operator()(const AMQFrame& f) const {
- return f.getBody()->type() == T1 || f.getBody()->type() == T2;
- }
-};
-
-}} // namespace qpid::framing
-
-#endif /*!QPID_FRAMING_TYPEFILTER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Uuid.cpp b/M4-RCs/qpid/cpp/src/qpid/framing/Uuid.cpp
deleted file mode 100644
index fbbaac1cf5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Uuid.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Uuid.h"
-#include "qpid/Exception.h"
-#include "qpid/framing/Buffer.h"
-#include "qpid/framing/reply_exceptions.h"
-
-namespace qpid {
-namespace framing {
-
-using namespace std;
-
-static const size_t UNPARSED_SIZE=36;
-
-void Uuid::encode(Buffer& buf) const {
- buf.putRawData(data(), size());
-}
-
-void Uuid::decode(Buffer& buf) {
- if (buf.available() < size())
- throw IllegalArgumentException(QPID_MSG("Not enough data for UUID."));
- buf.getRawData(c_array(), size());
-}
-
-ostream& operator<<(ostream& out, Uuid uuid) {
- char unparsed[UNPARSED_SIZE + 1];
- uuid_unparse(uuid.data(), unparsed);
- return out << unparsed;
-}
-
-istream& operator>>(istream& in, Uuid& uuid) {
- char unparsed[UNPARSED_SIZE + 1] = {0};
- in.get(unparsed, sizeof(unparsed));
- if (uuid_parse(unparsed, uuid.c_array()) != 0)
- in.setstate(ios::failbit);
- return in;
-}
-
-std::string Uuid::str() const {
- std::ostringstream os;
- os << *this;
- return os.str();
-}
-
-}} // namespace qpid::framing
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Uuid.h b/M4-RCs/qpid/cpp/src/qpid/framing/Uuid.h
deleted file mode 100644
index 2fcbb5a261..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Uuid.h
+++ /dev/null
@@ -1,88 +0,0 @@
-#ifndef QPID_FRAMING_UUID_H
-#define QPID_FRAMING_UUID_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/sys/uuid.h"
-
-#include <boost/array.hpp>
-
-#include <ostream>
-#include <istream>
-
-namespace qpid {
-namespace framing {
-
-class Buffer;
-
-/**
- * A UUID is represented as a boost::array of 16 bytes.
- *
- * Full value semantics, operators ==, < etc. are provided by
- * boost::array so Uuid can be the key type in a map etc.
- */
-struct Uuid : public boost::array<uint8_t, 16> {
- /** If unique is true, generate a unique ID else a null ID. */
- Uuid(bool unique=false) { if (unique) generate(); else clear(); }
-
- /** Copy from 16 bytes of data. */
- Uuid(uint8_t* data) { assign(data); }
-
- /** Copy from 16 bytes of data. */
- void assign(uint8_t* data) {
- uuid_copy(c_array(), data);
- }
-
- /** Set to a new unique identifier. */
- void generate() { uuid_generate(c_array()); }
-
- /** Set to all zeros. */
- void clear() { uuid_clear(c_array()); }
-
- /** Test for null (all zeros). */
- bool isNull() {
- return uuid_is_null(data());
- }
-
- // Default op= and copy ctor are fine.
- // boost::array gives us ==, < etc.
-
- void encode(framing::Buffer& buf) const;
- void decode(framing::Buffer& buf);
- uint32_t encodedSize() const { return size(); }
-
- /** String value in format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb. */
- std::string str() const;
-
- template <class S> void serialize(S& s) {
- s.raw(begin(), size());
- }
-};
-
-/** Print in format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb. */
-std::ostream& operator<<(std::ostream&, Uuid);
-
-/** Read from format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb. */
-std::istream& operator>>(std::istream&, Uuid&);
-
-}} // namespace qpid::framing
-
-
-
-#endif /*!QPID_FRAMING_UUID_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/Visitor.h b/M4-RCs/qpid/cpp/src/qpid/framing/Visitor.h
deleted file mode 100644
index 759ee65914..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/Visitor.h
+++ /dev/null
@@ -1,92 +0,0 @@
-#ifndef QPID_FRAMING_VISITOR_H
-#define QPID_FRAMING_VISITOR_H
-
-/*
- * 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 <boost/mpl/vector.hpp>
-#include <boost/type_traits/remove_reference.hpp>
-#include <boost/preprocessor/seq/for_each.hpp>
-
-namespace qpid {
-namespace framing {
-
-/** @file Generic visitor pattern. */
-
-/** visit() interface for type T (optional return type R, default is void.)
- * To create a visitor for a set of types T1, T2 ... do this:
- * struct MyVisitor : public Visit<T1>, public Visit<T2> ... {};
- *@param T Type to visit. This must be forward declared, and need not be defined.
- */
-template <class T, class R=void> struct Visit {
- typedef R ReturnType;
- typedef T VisitType;
-
- virtual ~Visit() {}
- virtual R visit(T&) = 0;
-};
-
-
-#define QPID_VISITOR_DECL(_1,_2,T) class T;
-
-#define QPID_VISITOR_BASE(_1,_2,T) , public ::qpid::framing::Visit<T>
-
-/** Convenience macro to generate a visitor interface.
- * QPID_VISITOR(MyVisitor,(A)(B)(C)); is equivalent to:
- * @code
- * class A; class B; class C;
- * class MyVisitor : public Visit<A> , public Visit<B> , public Visit<C> {};
- * @endcode
- * @param visitor name of the generated visitor class.
- * @param bases a sequence of visitable types in the form (T1)(T2)...
- * Any parenthesized notations are due to quirks of the preprocesser.
- */
-#define QPID_VISITOR(visitor,types) \
- BOOST_PP_SEQ_FOR_EACH(QPID_VISITOR_DECL, _, types) \
- class visitor : public ::qpid::framing::Visit<BOOST_PP_SEQ_HEAD(types)> \
- BOOST_PP_SEQ_FOR_EACH(QPID_VISITOR_BASE, _, BOOST_PP_SEQ_TAIL(types)) \
- {}
-
-/** The root class for the hierarchy of objects visitable by Visitor V.
- * Defines virtual accept().
- */
-template <class V, class R=void>
-struct VisitableRoot {
- typedef V VisitorType;
- typedef R ReturnType;
- virtual ~VisitableRoot() {}
- virtual R accept(V& v) = 0;
-};
-
-/** The base class for concrete visitable classes.
- * Implements accept().
- * @param T type of visitable class (CRTP).
- * @param Base base class to inherit from.
- */
-template <class T, class Base>
-struct Visitable : public Base {
- void accept(typename Base::VisitorType& v) {
- static_cast<Visit<T>& >(v).visit(static_cast<T&>(*this));
- }
-};
-
-}} // namespace qpid::framing
-
-#endif /*!QPID_FRAMING_VISITOR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/amqp_framing.h b/M4-RCs/qpid/cpp/src/qpid/framing/amqp_framing.h
deleted file mode 100644
index 4e4747c3f4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/amqp_framing.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.
- *
- */
-#include "amqp_types.h"
-#include "AMQFrame.h"
-#include "AMQBody.h"
-#include "BodyHandler.h"
-#include "AMQMethodBody.h"
-#include "AMQHeaderBody.h"
-#include "AMQContentBody.h"
-#include "AMQHeartbeatBody.h"
-#include "InputHandler.h"
-#include "OutputHandler.h"
-#include "ProtocolInitiation.h"
-#include "ProtocolVersion.h"
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/amqp_types.h b/M4-RCs/qpid/cpp/src/qpid/framing/amqp_types.h
deleted file mode 100644
index 97b889a7ca..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/amqp_types.h
+++ /dev/null
@@ -1,63 +0,0 @@
-#ifndef AMQP_TYPES_H
-#define AMQP_TYPES_H
-/*
- *
- * 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.
- *
- */
-
-/** \file
- * Definitions and forward declarations of all types used
- * in AMQP messages.
- */
-
-#include "qpid/sys/IntegerTypes.h"
-#include <string>
-
-namespace qpid {
-namespace framing {
-
-using std::string;
-typedef uint8_t FrameType;
-typedef uint16_t ChannelId;
-typedef uint32_t BatchOffset;
-typedef uint8_t ClassId;
-typedef uint8_t MethodId;
-typedef uint16_t ReplyCode;
-
-// Types represented by classes.
-class Content;
-class FieldTable;
-class SequenceNumberSet;
-struct Uuid;
-
-// Useful constants
-
-/** Maximum channel ID used by broker. Reserve high bit for internal use.*/
-const ChannelId CHANNEL_MAX=(ChannelId(~1))>>1;
-const ChannelId CHANNEL_HIGH_BIT= ChannelId(~CHANNEL_MAX);
-
-// Forward declare class types
-class FramingContent;
-class FieldTable;
-class SequenceNumberSet;
-class SequenceSet;
-struct Uuid;
-
-}} // namespace qpid::framing
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/amqp_types_full.h b/M4-RCs/qpid/cpp/src/qpid/framing/amqp_types_full.h
deleted file mode 100644
index d0aaf28cb4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/amqp_types_full.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef _framing_amqp_types_decl_h
-#define _framing_amqp_types_decl_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-/** \file
- * Definitions and full declarations of all types used
- * in AMQP messages.
- *
- * It's better to include amqp_types.h in another header instead of this file
- * unless the header actually needs the full declarations. Including
- * full declarations when forward declarations would increase compile
- * times.
- */
-
-#include "amqp_types.h"
-#include "Array.h"
-#include "FieldTable.h"
-#include "SequenceSet.h"
-#include "Uuid.h"
-
-#endif /*!_framing_amqp_types_decl_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/frame_functors.h b/M4-RCs/qpid/cpp/src/qpid/framing/frame_functors.h
deleted file mode 100644
index d2064d6a57..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/frame_functors.h
+++ /dev/null
@@ -1,116 +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 <string>
-#include <ostream>
-#include <iostream>
-#include "qpid/framing/amqp_framing.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/Buffer.h"
-
-#ifndef _frame_functors_
-#define _frame_functors_
-
-namespace qpid {
-namespace framing {
-
-class SumFrameSize
-{
- uint64_t size;
-public:
- SumFrameSize() : size(0) {}
- void operator()(const AMQFrame& f) { size += f.encodedSize(); }
- uint64_t getSize() { return size; }
-};
-
-class SumBodySize
-{
- uint64_t size;
-public:
- SumBodySize() : size(0) {}
- void operator()(const AMQFrame& f) { size += f.getBody()->encodedSize(); }
- uint64_t getSize() { return size; }
-};
-
-class Count
-{
- uint count;
-public:
- Count() : count(0) {}
- void operator()(const AMQFrame&) { count++; }
- uint getCount() { return count; }
-};
-
-class EncodeFrame
-{
- Buffer& buffer;
-public:
- EncodeFrame(Buffer& b) : buffer(b) {}
- void operator()(const AMQFrame& f) { f.encode(buffer); }
-};
-
-class EncodeBody
-{
- Buffer& buffer;
-public:
- EncodeBody(Buffer& b) : buffer(b) {}
- void operator()(const AMQFrame& f) { f.getBody()->encode(buffer); }
-};
-
-/**
- * Sends to the specified handler a copy of the frame it is applied to.
- */
-class Relay
-{
- FrameHandler& handler;
-
-public:
- Relay(FrameHandler& h) : handler(h) {}
-
- void operator()(const AMQFrame& f)
- {
- AMQFrame copy(f);
- handler.handle(copy);
- }
-};
-
-class Print
-{
- std::ostream& out;
-public:
- Print(std::ostream& o) : out(o) {}
-
- void operator()(const AMQFrame& f)
- {
- out << f << std::endl;
- }
-};
-
-class MarkLastSegment
-{
-public:
- void operator()(AMQFrame& f) const { f.setEof(true); }
-};
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/framing/variant.h b/M4-RCs/qpid/cpp/src/qpid/framing/variant.h
deleted file mode 100644
index 8e13063385..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/framing/variant.h
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef QPID_FRAMING_VARIANT_H
-#define QPID_FRAMING_VARIANT_H
-
-/*
- * 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.
- *
- */
-
-/**@file Tools for using boost::variant. */
-
-
-#include <boost/variant.hpp>
-
-namespace qpid {
-namespace framing {
-class Buffer;
-
-/** boost::static_visitor that throws an exception if variant contains a blank.
- * Subclasses need to have a using() declaration, which can be generated
- * with QPID_USING_NOBLANK(R)
- */
-template <class R=void>
-struct NoBlankVisitor : public boost::static_visitor<R> {
- R foundBlank() const {
- assert(0);
- throw Exception(QPID_MSG("Invalid variant value."));
- }
- R operator()(const boost::blank&) const { return foundBlank(); }
- R operator()(boost::blank&) const { return foundBlank(); }
-};
-
-
-}} // qpid::framing
-
-
-/** Generate a using statement, needed in visitors inheriting NoBlankVisitor
- * @param R return type.
- */
-#define QPID_USING_NOBLANK(R) using ::qpid::framing::NoBlankVisitor<R>::operator()
-
-namespace qpid {
-namespace framing {
-
-/** Convert the variant value to type R. */
-template <class R> struct ConvertVisitor : public NoBlankVisitor<R> {
- QPID_USING_NOBLANK(R);
- template <class T> R operator()(T& t) const { return t; }
-};
-
-/** Convert the address of variant value to type R. */
-template <class R> struct AddressVisitor : public NoBlankVisitor<R> {
- QPID_USING_NOBLANK(R);
- template <class T> R operator()(T& t) const { return &t; }
-};
-
-/** Apply a visitor to the nested variant.*/
-template<class V>
-struct ApplyVisitor : public NoBlankVisitor<typename V::result_type> {
- QPID_USING_NOBLANK(typename V::result_type);
- const V& visitor;
- ApplyVisitor(const V& v) : visitor(v) {}
- template <class T> typename V::result_type operator()(T& t) const {
- return boost::apply_visitor(visitor, t);
- }
-};
-
-/** Convenience function to construct and apply an ApplyVisitor */
-template <class Visitor, class Visitable>
-typename Visitor::result_type applyApplyVisitor(const Visitor& visitor, Visitable& visitable) {
- return boost::apply_visitor(ApplyVisitor<Visitor>(visitor), visitable);
-}
-
-}} // namespace qpid::framing
-
-
-#endif /*!QPID_FRAMING_VARIANT_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/Helpers.h b/M4-RCs/qpid/cpp/src/qpid/log/Helpers.h
deleted file mode 100644
index 82ef8244be..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/Helpers.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef QPID_LOG_HELPERS_H
-#define QPID_LOG_HELPERS_H
-
-/*
- * 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 <boost/range.hpp>
-
-#include <ostream>
-
-namespace qpid {
-namespace log {
-
-/** @file Helper classes for logging complex types */
-
-/// @internal
-template <class Range>
-struct ListFormatter {
- typedef typename boost::range_const_iterator<Range>::type Iterator;
- boost::iterator_range<Iterator> range;
- const char* separator;
-
- ListFormatter(const Range& r, const char* s=", ") : range(r), separator(s) {}
-};
-
-/// @internal
-template <class Range>
-std::ostream& operator<<(std::ostream& out, const ListFormatter<Range>& sl) {
- typename ListFormatter<Range>::Iterator i = sl.range.begin();
- if (i != sl.range.end()) out << *(i++);
- while (i != sl.range.end()) out << sl.separator << *(i++);
- return out;
-}
-
-/** Return a formatting object with operator <<
- * to stream range as a separated list.
- *@param range: a range - all standard containers are ranges,
- * as is a pair of iterators.
- *@param separator: printed between elements, default ", "
- */
-template <class Range>
-ListFormatter<Range> formatList(const Range& range, const char* separator=", ") {
- return ListFormatter<Range>(range, separator);
-}
-
-/** Return a formatting object with operator <<
- * to stream the range defined by iterators [begin, end)
- * as a separated list.
- *@param begin, end: Beginning and end of range.
- *@param separator: printed between elements, default ", "
- */
-template <class U, class V>
-ListFormatter<std::pair<U,V> > formatList(U begin, V end, const char* separator=", ") {
- return formatList(std::make_pair(begin,end), separator);
-}
-
-
-}} // namespace qpid::log
-
-
-
-#endif /*!QPID_LOG_HELPERS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/Logger.cpp b/M4-RCs/qpid/cpp/src/qpid/log/Logger.cpp
deleted file mode 100644
index 07e4245399..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/Logger.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Logger.h"
-#include "Options.h"
-#include "SinkOptions.h"
-#include "qpid/memory.h"
-#include "qpid/sys/Thread.h"
-#include <boost/pool/detail/singleton.hpp>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
-#include <algorithm>
-#include <sstream>
-#include <iomanip>
-#include <stdexcept>
-#include <time.h>
-
-
-namespace qpid {
-namespace log {
-
-using namespace std;
-
-typedef sys::Mutex::ScopedLock ScopedLock;
-
-inline void Logger::enable_unlocked(Statement* s) {
- s->enabled=selector.isEnabled(s->level, s->function);
-}
-
-Logger& Logger::instance() {
- return boost::details::pool::singleton_default<Logger>::instance();
-}
-
-Logger::Logger() : flags(0) {
- // Initialize myself from env variables so all programs
- // (e.g. tests) can use logging even if they don't parse
- // command line args.
- Options opts("");
- opts.parse(0, 0);
- configure(opts);
-}
-
-Logger::~Logger() {}
-
-void Logger::select(const Selector& s) {
- ScopedLock l(lock);
- selector=s;
- std::for_each(statements.begin(), statements.end(),
- boost::bind(&Logger::enable_unlocked, this, _1));
-}
-
-Logger::Output::Output() {}
-Logger::Output::~Output() {}
-
-void Logger::log(const Statement& s, const std::string& msg) {
- // Format the message outside the lock.
- std::ostringstream os;
- if (!prefix.empty())
- os << prefix << ": ";
- if (flags&TIME)
- {
- const char * month_abbrevs[] = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" };
- time_t rawtime;
- struct tm * timeinfo;
-
- time ( & rawtime );
- timeinfo = localtime ( &rawtime );
- char time_string[100];
- sprintf ( time_string,
- "%d-%s-%02d %02d:%02d:%02d",
- 1900 + timeinfo->tm_year,
- month_abbrevs[timeinfo->tm_mon],
- timeinfo->tm_mday,
- timeinfo->tm_hour,
- timeinfo->tm_min,
- timeinfo->tm_sec
- );
- os << time_string << " ";
- }
- if (flags&LEVEL)
- os << LevelTraits::name(s.level) << " ";
- if (flags&THREAD)
- os << "[0x" << hex << qpid::sys::Thread::logId() << "] ";
- if (flags&FILE)
- os << s.file << ":";
- if (flags&LINE)
- os << dec << s.line << ":";
- if (flags&FUNCTION)
- os << s.function << ":";
- if (flags & (FILE|LINE|FUNCTION))
- os << " ";
- os << msg << endl;
- std::string formatted=os.str();
- {
- ScopedLock l(lock);
- std::for_each(outputs.begin(), outputs.end(),
- boost::bind(&Output::log, _1, s, formatted));
- }
-}
-
-void Logger::output(std::auto_ptr<Output> out) {
- ScopedLock l(lock);
- outputs.push_back(out.release());
-}
-
-void Logger::clear() {
- select(Selector()); // locked
- format(0); // locked
- ScopedLock l(lock);
- outputs.clear();
-}
-
-void Logger::format(int formatFlags) {
- ScopedLock l(lock);
- flags=formatFlags;
-}
-
-static int bitIf(bool test, int bit) {
- return test ? bit : 0;
-}
-
-int Logger::format(const Options& opts) {
- int flags=
- bitIf(opts.level, LEVEL) |
- bitIf(opts.time, TIME) |
- bitIf(opts.source, (FILE|LINE)) |
- bitIf(opts.function, FUNCTION) |
- bitIf(opts.thread, THREAD);
- format(flags);
- return flags;
-}
-
-void Logger::add(Statement& s) {
- ScopedLock l(lock);
- enable_unlocked(&s);
- statements.insert(&s);
-}
-
-void Logger::configure(const Options& opts) {
- options = opts;
- clear();
- Options o(opts);
- if (o.trace)
- o.selectors.push_back("trace+");
- format(o);
- select(Selector(o));
- setPrefix(opts.prefix);
- options.sinkOptions->setup(this);
-}
-
-void Logger::setPrefix(const std::string& p) { prefix = p; }
-
-}} // namespace qpid::log
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/Logger.h b/M4-RCs/qpid/cpp/src/qpid/log/Logger.h
deleted file mode 100644
index 539c1c851b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/Logger.h
+++ /dev/null
@@ -1,113 +0,0 @@
-#ifndef QPID_LOG_LOGGER_H
-#define QPID_LOG_LOGGER_H
-
-/*
- * 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 "Selector.h"
-#include "Options.h"
-#include "qpid/sys/Mutex.h"
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/noncopyable.hpp>
-#include <set>
-
-namespace qpid {
-namespace log {
-
-/**
- * Central logging agent.
- *
- * Thread safe, singleton.
- *
- * The Logger provides all needed functionality for selecting and
- * formatting logging output. The actual outputting of log records
- * is handled by Logger::Output-derived classes instantiated by the
- * platform's sink-related options.
- */
-class Logger : private boost::noncopyable {
- public:
- /** Flags indicating what to include in the log output */
- enum FormatFlag { FILE=1, LINE=2, FUNCTION=4, LEVEL=8, TIME=16, THREAD=32};
-
- /**
- * Logging output sink.
- *
- * The Output sink provides an interface to direct logging output to.
- * Logging sinks are primarily platform-specific as provided for on
- * each platform.
- *
- * Implementations of Output must be thread safe.
- */
- class Output {
- public:
- Output();
- virtual ~Output();
- /** Receives the statemnt of origin and formatted message to log. */
- virtual void log(const Statement&, const std::string&) =0;
- };
-
- static Logger& instance();
-
- Logger();
- ~Logger();
-
- /** Select the messages to be logged. */
- void select(const Selector& s);
-
- /** Set the formatting flags, bitwise OR of FormatFlag values. */
- void format(int formatFlags);
-
- /** Set format flags from options object.
- *@returns computed flags.
- */
- int format(const Options&);
-
- /** Configure logger from Options */
- void configure(const Options& o);
-
- /** Add a statement. */
- void add(Statement& s);
-
- /** Log a message. */
- void log(const Statement&, const std::string&);
-
- /** Add an output destination for messages */
- void output(std::auto_ptr<Output> out);
-
- /** Set a prefix for all messages */
- void setPrefix(const std::string& prefix);
-
- /** Reset the logger. */
- void clear();
-
- /** Get the options used to configure the logger. */
- const Options& getOptions() const { return options; }
-
-
- private:
- typedef boost::ptr_vector<Output> Outputs;
- typedef std::set<Statement*> Statements;
-
- sys::Mutex lock;
- inline void enable_unlocked(Statement* s);
-
- Statements statements;
- Outputs outputs;
- Selector selector;
- int flags;
- std::string prefix;
- Options options;
-};
-
-}} // namespace qpid::log
-
-
-#endif /*!QPID_LOG_LOGGER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/Options.cpp b/M4-RCs/qpid/cpp/src/qpid/log/Options.cpp
deleted file mode 100644
index a33da6fd8f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/Options.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Options.h"
-#include "SinkOptions.h"
-#include "Statement.h"
-#include "qpid/Options.h"
-#include <map>
-#include <string>
-#include <algorithm>
-
-namespace qpid {
-namespace log {
-
-using namespace std;
-
-Options::Options(const std::string& argv0_, const std::string& name_) :
- qpid::Options(name_),
- argv0(argv0_),
- name(name_),
- time(true),
- level(true),
- thread(false),
- source(false),
- function(false),
- trace(false),
- sinkOptions (SinkOptions::create(argv0_))
-{
- selectors.push_back("notice+");
-
- ostringstream levels;
- levels << LevelTraits::name(Level(0));
- for (int i = 1; i < LevelTraits::COUNT; ++i)
- levels << " " << LevelTraits::name(Level(i));
-
- addOptions()
- ("trace,t", optValue(trace), "Enables all logging" )
- ("log-enable", optValue(selectors, "RULE"),
- ("Enables logging for selected levels and components. "
- "RULE is in the form 'LEVEL[+][:PATTERN]' "
- "Levels are one of: \n\t "+levels.str()+"\n"
- "For example:\n"
- "\t'--log-enable warning+' "
- "logs all warning, error and critical messages.\n"
- "\t'--log-enable debug:framing' "
- "logs debug messages from the framing namespace. "
- "This option can be used multiple times").c_str())
- ("log-time", optValue(time, "yes|no"), "Include time in log messages")
- ("log-level", optValue(level,"yes|no"), "Include severity level in log messages")
- ("log-source", optValue(source,"yes|no"), "Include source file:line in log messages")
- ("log-thread", optValue(thread,"yes|no"), "Include thread ID in log messages")
- ("log-function", optValue(function,"yes|no"), "Include function signature in log messages")
- ("log-prefix", optValue(prefix,"STRING"), "Prefix to append to all log messages")
- ;
- add(*sinkOptions);
-}
-
-Options::Options(const Options &o) :
- qpid::Options(o.name),
- argv0(o.argv0),
- name(o.name),
- selectors(o.selectors),
- time(o.time),
- level(o.level),
- thread(o.thread),
- source(o.source),
- function(o.function),
- trace(o.trace),
- prefix(o.prefix),
- sinkOptions (SinkOptions::create(o.argv0))
-{
- *sinkOptions = *o.sinkOptions;
-}
-
-Options& Options::operator=(const Options& x) {
- if (this != &x) {
- argv0 = x.argv0;
- name = x.name;
- selectors = x.selectors;
- time = x.time;
- level= x.level;
- thread = x.thread;
- source = x.source;
- function = x.function;
- trace = x.trace;
- prefix = x.prefix;
- *sinkOptions = *x.sinkOptions;
- }
- return *this;
-}
-
-}} // namespace qpid::log
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/Options.h b/M4-RCs/qpid/cpp/src/qpid/log/Options.h
deleted file mode 100644
index 8a3c352d14..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/Options.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef QPID_LOG_OPTIONS_H
-#define QPID_LOG_OPTIONS_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-#include "qpid/Options.h"
-#include "SinkOptions.h"
-#include <iosfwd>
-#include <memory>
-
-namespace qpid {
-namespace log {
-
-/** Logging options for config parser. */
-struct Options : public qpid::Options {
- /** Pass argv[0] for use in syslog output */
- Options(const std::string& argv0_=std::string(),
- const std::string& name_="Logging options");
- Options(const Options &);
-
- Options& operator=(const Options&);
-
- std::string argv0;
- std::string name;
- std::vector<std::string> selectors;
- bool time, level, thread, source, function;
- bool trace;
- std::string prefix;
- std::auto_ptr<SinkOptions> sinkOptions;
-};
-
-}} // namespace qpid::log
-
-#endif /*!QPID_LOG_OPTIONS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/OstreamOutput.cpp b/M4-RCs/qpid/cpp/src/qpid/log/OstreamOutput.cpp
deleted file mode 100644
index c96a311a4e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/OstreamOutput.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "OstreamOutput.h"
-#include <stdexcept>
-
-using namespace std;
-
-namespace qpid {
-namespace log {
-
-OstreamOutput::OstreamOutput(std::ostream& o) : out(&o) {}
-
-OstreamOutput::OstreamOutput(const std::string& file)
- : out(new ofstream(file.c_str(), ios_base::out | ios_base::app)),
- mine(out)
-{
- if (!out->good())
- throw std::runtime_error("Can't open log file: "+file);
-}
-
-void OstreamOutput::log(const Statement&, const std::string& m) {
- *out << m << flush;
-}
-
-}} // namespace qpid::log
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/OstreamOutput.h b/M4-RCs/qpid/cpp/src/qpid/log/OstreamOutput.h
deleted file mode 100644
index 8bbfc8c38b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/OstreamOutput.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef QPID_LOG_OSTREAMOUTPUT_H
-#define QPID_LOG_OSTREAMOUTPUT_H
-
-/*
- * 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 "Logger.h"
-#include <boost/scoped_ptr.hpp>
-#include <fstream>
-#include <ostream>
-
-namespace qpid {
-namespace log {
-
-/**
- * OstreamOutput is a reusable logging sink that directs logging to a C++
- * ostream.
- */
-class OstreamOutput : public qpid::log::Logger::Output {
-public:
- OstreamOutput(std::ostream& o);
- OstreamOutput(const std::string& file);
-
- virtual void log(const Statement&, const std::string& m);
-
-private:
- std::ostream* out;
- boost::scoped_ptr<std::ostream> mine;
-};
-
-}} // namespace qpid::log
-
-#endif /*!QPID_LOG_OSTREAMOUTPUT_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/Selector.cpp b/M4-RCs/qpid/cpp/src/qpid/log/Selector.cpp
deleted file mode 100644
index 4d1c5b6e0c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/Selector.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Selector.h"
-#include "Options.h"
-#include <boost/bind.hpp>
-#include <algorithm>
-
-namespace qpid {
-namespace log {
-
-using namespace std;
-
-void Selector::enable(const string& enableStr) {
- string level, pattern;
- size_t c=enableStr.find(':');
- if (c==string::npos) {
- level=enableStr;
- }
- else {
- level=enableStr.substr(0,c);
- pattern=enableStr.substr(c+1);
- }
- if (!level.empty() && level[level.size()-1]=='+') {
- for (int i = LevelTraits::level(level.substr(0,level.size()-1));
- i < LevelTraits::COUNT;
- ++i)
- enable(Level(i), pattern);
- }
- else {
- enable(LevelTraits::level(level), pattern);
- }
-}
-
-Selector::Selector(const Options& opt){
- for_each(opt.selectors.begin(), opt.selectors.end(),
- boost::bind(&Selector::enable, this, _1));
-}
-
-bool Selector::isEnabled(Level level, const char* function) {
- const char* functionEnd = function+::strlen(function);
- for (std::vector<std::string>::iterator i=substrings[level].begin();
- i != substrings[level].end();
- ++i)
- {
- if (std::search(function, functionEnd, i->begin(), i->end()) != functionEnd)
- return true;
- }
- return false;
-}
-
-}} // namespace qpid::log
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/Selector.h b/M4-RCs/qpid/cpp/src/qpid/log/Selector.h
deleted file mode 100644
index 705abfeb5d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/Selector.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef SELECTOR_H
-#define SELECTOR_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Statement.h"
-#include <vector>
-
-namespace qpid {
-namespace log {
-struct Options;
-
-/**
- * A selector identifies the set of log messages to enable.
- *
- * Thread object unsafe, pass-by-value type.
- */
-class Selector {
- public:
- /** Empty selector selects nothing */
- Selector() {}
-
- /** Set selector from Options */
- Selector(const Options&);
-
- /** Equavlient to: Selector s; s.enable(l, s) */
- Selector(Level l, const std::string& s=std::string()) {
- enable(l,s);
- }
-
- Selector(const std::string& enableStr) { enable(enableStr); }
- /**
- * Enable messages with level in levels where the file
- * name contains substring. Empty string matches all.
- */
- void enable(Level level, const std::string& substring=std::string()) {
- substrings[level].push_back(substring);
- }
-
- /** Enable based on a 'level[+]:file' string */
- void enable(const std::string& enableStr);
-
- /** True if level is enabled for file. */
- bool isEnabled(Level level, const char* function);
-
- private:
- std::vector<std::string> substrings[LevelTraits::COUNT];
-};
-
-
-}} // namespace qpid::log
-
-
-#endif /*!SELECTOR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/SinkOptions.h b/M4-RCs/qpid/cpp/src/qpid/log/SinkOptions.h
deleted file mode 100644
index 7ec2cfbc17..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/SinkOptions.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef QPID_LOG_SINKOPTIONS_H
-#define QPID_LOG_SINKOPTIONS_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/Options.h"
-#include <string>
-
-namespace qpid {
-namespace log {
-
-class Logger;
-
-/**
- * Logging sink options.
- *
- * Most logging sink options will be platform-specific, even if some are
- * duplicated. The range of platforms to which this code may be ported
- * can't be assumed to all have C++ iostreams or files. Thus, this class
- * is primarily for implementing in a platform-specific way.
- */
-struct SinkOptions : public qpid::Options {
-
- // Create a platform's SinkOptions. Pass argv0 as the program name,
- // useful for syslog-type logging.
- static SinkOptions *create(const std::string& argv0=std::string());
-
- SinkOptions(const std::string& name="Logging sink options")
- : qpid::Options(name)
- {}
- virtual ~SinkOptions() {}
-
- virtual SinkOptions& operator=(const SinkOptions&) = 0;
-
- // This allows the caller to indicate that there's no normal outputs
- // available. For example, when running as a daemon. In these cases, the
- // platform's "syslog"-type output should replace the default stderr
- // unless some other sink has been selected.
- virtual void detached(void) = 0;
-
- // The Logger acting on these options calls setup() to request any
- // Sinks be set up and fed back to the logger.
- virtual void setup(Logger *logger) = 0;
-};
-
-}} // namespace qpid::log
-
-#endif /*!QPID_LOG_OPTIONS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/Statement.cpp b/M4-RCs/qpid/cpp/src/qpid/log/Statement.cpp
deleted file mode 100644
index 090a993e78..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/Statement.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Statement.h"
-#include "Logger.h"
-#include <boost/bind.hpp>
-#include <stdexcept>
-#include <algorithm>
-#include <ctype.h>
-
-namespace qpid {
-namespace log {
-
-namespace {
-using namespace std;
-
-struct NonPrint { bool operator()(unsigned char c) { return !isprint(c) && !isspace(c); } };
-
-const char hex[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
-
-std::string quote(const std::string& str) {
- NonPrint nonPrint;
- size_t n = std::count_if(str.begin(), str.end(), nonPrint);
- if (n==0) return str;
- std::string ret;
- ret.reserve(str.size()+2*n); // Avoid extra allocations.
- for (string::const_iterator i = str.begin(); i != str.end(); ++i) {
- if (nonPrint(*i)) {
- ret.push_back('\\');
- ret.push_back('x');
- ret.push_back(hex[((*i) >> 4)&0xf]);
- ret.push_back(hex[(*i) & 0xf]);
- }
- else ret.push_back(*i);
- }
- return ret;
-}
-
-}
-
-void Statement::log(const std::string& message) {
- Logger::instance().log(*this, quote(message));
-}
-
-Statement::Initializer::Initializer(Statement& s) : statement(s) {
- Logger::instance().add(s);
-}
-
-namespace {
-const char* names[LevelTraits::COUNT] = {
- "trace", "debug", "info", "notice", "warning", "error", "critical"
-};
-
-} // namespace
-
-Level LevelTraits::level(const char* name) {
- for (int i =0; i < LevelTraits::COUNT; ++i) {
- if (strcmp(names[i], name)==0)
- return Level(i);
- }
- throw std::runtime_error(std::string("Invalid log level name: ")+name);
-}
-
-const char* LevelTraits::name(Level l) {
- return names[l];
-}
-
-}} // namespace qpid::log
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/Statement.h b/M4-RCs/qpid/cpp/src/qpid/log/Statement.h
deleted file mode 100644
index 3c67b04b20..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/Statement.h
+++ /dev/null
@@ -1,121 +0,0 @@
-#ifndef STATEMENT_H
-#define STATEMENT_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/Msg.h"
-
-#include <boost/current_function.hpp>
-
-namespace qpid {
-namespace log {
-
-/** Debugging severity levels
- * - trace: High-volume debugging messages.
- * - debug: Debugging messages.
- * - info: Informational messages.
- * - notice: Normal but significant condition.
- * - warning: Warn of a possible problem.
- * - error: A definite error has occured.
- * - critical: System in danger of severe failure.
- */
-enum Level { trace, debug, info, notice, warning, error, critical };
-struct LevelTraits {
- static const int COUNT=critical+1;
-
- /** Get level from string name.
- *@exception if name invalid.
- */
- static Level level(const char* name);
-
- /** Get level from string name.
- *@exception if name invalid.
- */
- static Level level(const std::string& name) {
- return level(name.c_str());
- }
-
- /** String name of level */
- static const char* name(Level);
-};
-
-/** POD struct representing a logging statement in source code. */
-struct Statement {
- bool enabled;
- const char* file;
- int line;
- const char* function;
- Level level;
-
- void log(const std::string& message);
-
- struct Initializer {
- Initializer(Statement& s);
- Statement& statement;
- };
-};
-
-///@internal static initializer for a Statement.
-#define QPID_LOG_STATEMENT_INIT(level) \
- { 0, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, (::qpid::log::level) }
-
-/**
- * Like QPID_LOG but computes an additional boolean test expression
- * to determine if the message should be logged. Evaluation of both
- * the test and message expressions occurs only if the requested log level
- * is enabled.
- *@param LEVEL severity Level for message, should be one of:
- * debug, info, notice, warning, error, critical. NB no qpid::log:: prefix.
- *@param TEST message is logged only if expression TEST evaluates to true.
- *@param MESSAGE any object with an @eostream operator<<, or a sequence
- * like of ostreamable objects separated by @e<<.
- */
-#define QPID_LOG_IF(LEVEL, TEST, MESSAGE) \
- do { \
- using ::qpid::log::Statement; \
- static Statement stmt_= QPID_LOG_STATEMENT_INIT(LEVEL); \
- static Statement::Initializer init_(stmt_); \
- if (stmt_.enabled && (TEST)) \
- stmt_.log(::qpid::Msg() << MESSAGE); \
- } while(0)
-
-/**
- * Macro for log statements. Example of use:
- * @code
- * QPID_LOG(debug, "There are " << foocount << " foos in the bar.");
- * QPID_LOG(error, boost::format("Dohickey %s exploded") % dohicky.name());
- * @endcode
- *
- * You can subscribe to log messages by level, by component, by filename
- * or a combination @see Configuration.
-
- *@param LEVEL severity Level for message, should be one of:
- * debug, info, notice, warning, error, critical. NB no qpid::log:: prefix.
- *@param MESSAGE any object with an @eostream operator<<, or a sequence
- * like of ostreamable objects separated by @e<<.
- */
-#define QPID_LOG(LEVEL, MESSAGE) QPID_LOG_IF(LEVEL, true, MESSAGE);
-
-}} // namespace qpid::log
-
-
-
-
-#endif /*!STATEMENT_H*/
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/posix/SinkOptions.cpp b/M4-RCs/qpid/cpp/src/qpid/log/posix/SinkOptions.cpp
deleted file mode 100644
index 9d51358e2e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/posix/SinkOptions.cpp
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "SinkOptions.h"
-#include "qpid/log/SinkOptions.h"
-#include "qpid/log/Logger.h"
-#include "qpid/log/OstreamOutput.h"
-#include "qpid/memory.h"
-#include "qpid/Exception.h"
-#include <iostream>
-#include <map>
-#include <string>
-#include <syslog.h>
-
-using std::string;
-using qpid::Exception;
-
-namespace {
-
-// SyslogFacilities maps from syslog values to the text equivalents.
-class SyslogFacilities {
-public:
- typedef std::map<string, int> ByName;
- typedef std::map<int, string> ByValue;
-
- SyslogFacilities() {
- struct NameValue { const char* name; int value; };
- NameValue nameValue[] = {
- { "AUTH", LOG_AUTH },
- { "AUTHPRIV", LOG_AUTHPRIV },
- { "CRON", LOG_CRON },
- { "DAEMON", LOG_DAEMON },
- { "FTP", LOG_FTP },
- { "KERN", LOG_KERN },
- { "LOCAL0", LOG_LOCAL0 },
- { "LOCAL1", LOG_LOCAL1 },
- { "LOCAL2", LOG_LOCAL2 },
- { "LOCAL3", LOG_LOCAL3 },
- { "LOCAL4", LOG_LOCAL4 },
- { "LOCAL5", LOG_LOCAL5 },
- { "LOCAL6", LOG_LOCAL6 },
- { "LOCAL7", LOG_LOCAL7 },
- { "LPR", LOG_LPR },
- { "MAIL", LOG_MAIL },
- { "NEWS", LOG_NEWS },
- { "SYSLOG", LOG_SYSLOG },
- { "USER", LOG_USER },
- { "UUCP", LOG_UUCP }
- };
- for (size_t i = 0; i < sizeof(nameValue)/sizeof(nameValue[0]); ++i) {
- byName.insert(ByName::value_type(nameValue[i].name, nameValue[i].value));
- // Recognise with and without LOG_ prefix e.g.: AUTH and LOG_AUTH
- byName.insert(ByName::value_type(string("LOG_")+nameValue[i].name, nameValue[i].value));
- byValue.insert(ByValue::value_type(nameValue[i].value, string("LOG_")+nameValue[i].name));
- }
- }
-
- int value(const string& name) const {
- string key(name);
- transform(key.begin(), key.end(), key.begin(), ::toupper);
- ByName::const_iterator i = byName.find(key);
- if (i == byName.end())
- throw Exception("Not a valid syslog facility: " + name);
- return i->second;
- }
-
- string name(int value) const {
- ByValue::const_iterator i = byValue.find(value);
- if (i == byValue.end())
- throw Exception("Not a valid syslog value: " + value);
- return i->second;
- }
-
- private:
- ByName byName;
- ByValue byValue;
-};
-
-// 'priorities' maps qpid log levels to syslog priorities. They are in
-// order of qpid log levels and must map to:
-// "trace", "debug", "info", "notice", "warning", "error", "critical"
-static int priorities[qpid::log::LevelTraits::COUNT] = {
- LOG_DEBUG, LOG_DEBUG, LOG_INFO, LOG_NOTICE,
- LOG_WARNING, LOG_ERR, LOG_CRIT
-};
-
-std::string basename(const std::string path) {
- size_t i = path.find_last_of('/');
- return path.substr((i == std::string::npos) ? 0 : i+1);
-}
-
-} // namespace
-
-namespace qpid {
-namespace log {
-namespace posix {
-
-std::ostream& operator<<(std::ostream& o, const SyslogFacility& f) {
- return o << SyslogFacilities().name(f.value);
-}
-
-std::istream& operator>>(std::istream& i, SyslogFacility& f) {
- std::string name;
- i >> name;
- f.value = SyslogFacilities().value(name);
- return i;
-}
-
-class SyslogOutput : public qpid::log::Logger::Output {
-public:
- SyslogOutput(const std::string& logName, const SyslogFacility& logFacility)
- : name(logName), facility(logFacility.value)
- {
- ::openlog(name.c_str(), LOG_PID, facility);
- }
-
- virtual ~SyslogOutput() {
- ::closelog();
- }
-
- virtual void log(const Statement& s, const std::string& m)
- {
- syslog(priorities[s.level], "%s", m.c_str());
- }
-
-private:
- std::string name;
- int facility;
-};
-
-SinkOptions::SinkOptions(const std::string& argv0)
- : qpid::log::SinkOptions(),
- logToStderr(true),
- logToStdout(false),
- logToSyslog(false),
- syslogName(basename(argv0)),
- syslogFacility(LOG_DAEMON) {
-
- addOptions()
- ("log-to-stderr", optValue(logToStderr, "yes|no"), "Send logging output to stderr")
- ("log-to-stdout", optValue(logToStdout, "yes|no"), "Send logging output to stdout")
- ("log-to-file", optValue(logFile, "FILE"), "Send log output to FILE.")
- ("log-to-syslog", optValue(logToSyslog, "yes|no"), "Send logging output to syslog;\n\tcustomize using --syslog-name and --syslog-facility")
- ("syslog-name", optValue(syslogName, "NAME"), "Name to use in syslog messages")
- ("syslog-facility", optValue(syslogFacility,"LOG_XXX"), "Facility to use in syslog messages")
- ;
-
-}
-
-qpid::log::SinkOptions& SinkOptions::operator=(const qpid::log::SinkOptions& rhs) {
- const SinkOptions *prhs = dynamic_cast<const SinkOptions*>(&rhs);
- if (this != prhs) {
- logToStderr = prhs->logToStderr;
- logToStdout = prhs->logToStdout;
- logToSyslog = prhs->logToSyslog;
- logFile = prhs->logFile;
- syslogName = prhs->syslogName;
- syslogFacility.value = prhs->syslogFacility.value;
- }
- return *this;
-}
-
-void SinkOptions::detached(void) {
- if (logToStderr && !logToStdout && !logToSyslog) {
- logToStderr = false;
- logToSyslog = true;
- }
-}
-
-// The Logger acting on these options calls setup() to request any
-// Sinks be set up and fed back to the logger.
-void SinkOptions::setup(qpid::log::Logger *logger) {
- if (logToStderr)
- logger->output(make_auto_ptr<qpid::log::Logger::Output>
- (new qpid::log::OstreamOutput(std::clog)));
- if (logToStdout)
- logger->output(make_auto_ptr<qpid::log::Logger::Output>
- (new qpid::log::OstreamOutput(std::cout)));
-
- if (logFile.length() > 0)
- logger->output(make_auto_ptr<qpid::log::Logger::Output>
- (new qpid::log::OstreamOutput(logFile)));
-
- if (logToSyslog)
- logger->output(make_auto_ptr<qpid::log::Logger::Output>
- (new SyslogOutput(syslogName, syslogFacility)));
-
-}
-
-} // namespace qpid::log::posix
-
-SinkOptions* SinkOptions::create(const std::string& argv0) {
- return new qpid::log::posix::SinkOptions (argv0);
-}
-
-}} // namespace qpid::log
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/posix/SinkOptions.h b/M4-RCs/qpid/cpp/src/qpid/log/posix/SinkOptions.h
deleted file mode 100644
index d929c29025..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/posix/SinkOptions.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef QPID_LOG_POSIX_SINKOPTIONS_H
-#define QPID_LOG_POSIX_SINKOPTIONS_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/log/SinkOptions.h"
-#include <string>
-
-namespace qpid {
-namespace log {
-namespace posix {
-
-/**
- * Provides a type that can be passed to << and >> operators to convert
- * syslog facility values to/from strings.
- */
-struct SyslogFacility {
- int value;
- SyslogFacility(int i=0) : value(i) {}
-};
-
-struct SinkOptions : public qpid::log::SinkOptions {
- SinkOptions(const std::string& argv0);
- virtual ~SinkOptions() {}
-
- virtual qpid::log::SinkOptions& operator=(const qpid::log::SinkOptions& rhs);
-
- // This allows the caller to indicate that there's no normal outputs
- // available. For example, when running as a daemon. In these cases, the
- // platform's "syslog"-type output should replace the default stderr
- // unless some other sink has been selected.
- virtual void detached(void);
-
- // The Logger acting on these options calls setup() to request any
- // Sinks be set up and fed back to the logger.
- virtual void setup(qpid::log::Logger *logger);
-
- bool logToStderr;
- bool logToStdout;
- bool logToSyslog;
- std::string logFile;
- std::string syslogName;
- SyslogFacility syslogFacility;
-};
-
-}}} // namespace qpid::log::posix
-
-#endif /*!QPID_LOG_POSIX_SINKOPTIONS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/windows/SinkOptions.cpp b/M4-RCs/qpid/cpp/src/qpid/log/windows/SinkOptions.cpp
deleted file mode 100644
index cfcb965464..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/windows/SinkOptions.cpp
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "SinkOptions.h"
-#include "qpid/log/SinkOptions.h"
-#include "qpid/log/Logger.h"
-#include "qpid/log/OstreamOutput.h"
-#include "qpid/memory.h"
-#include "qpid/Exception.h"
-#include <iostream>
-#include <map>
-#include <string>
-
-#include <windows.h>
-
-using qpid::Exception;
-
-namespace qpid {
-namespace log {
-namespace windows {
-
-namespace {
-
-// 'eventTypes' maps qpid log levels to Windows event types. They are in
-// order of qpid log levels and must map to:
-// "trace", "debug", "info", "notice", "warning", "error", "critical"
-static int eventTypes[qpid::log::LevelTraits::COUNT] = {
- EVENTLOG_INFORMATION_TYPE, /* trace */
- EVENTLOG_INFORMATION_TYPE, /* debug */
- EVENTLOG_INFORMATION_TYPE, /* info */
- EVENTLOG_INFORMATION_TYPE, /* notice */
- EVENTLOG_WARNING_TYPE, /* warning */
- EVENTLOG_ERROR_TYPE, /* error */
- EVENTLOG_ERROR_TYPE /* critical */
-};
-
-} // namespace
-
-class EventLogOutput : public qpid::log::Logger::Output {
-public:
- EventLogOutput(const std::string& sourceName) : logHandle(0)
- {
- logHandle = OpenEventLog(0, "Application");
- }
-
- virtual ~EventLogOutput() {
- if (logHandle)
- CloseEventLog(logHandle);
- }
-
- virtual void log(const Statement& s, const std::string& m)
- {
- if (logHandle) {
- const char *msg = m.c_str();
- ReportEvent(logHandle,
- eventTypes[s.level],
- 0, /* category unused */
- 0, /* event id */
- 0, /* user security id */
- 1, /* number of strings */
- 0, /* no event-specific data */
- &msg,
- 0);
- }
- }
-
-private:
- HANDLE logHandle;
-};
-
-SinkOptions::SinkOptions(const std::string& argv0)
- : qpid::log::SinkOptions(),
- logToStderr(true),
- logToStdout(false),
- logToEventLog(false),
- eventSource("Application")
-{
- addOptions()
- ("log-to-stderr", optValue(logToStderr, "yes|no"), "Send logging output to stderr")
- ("log-to-stdout", optValue(logToStdout, "yes|no"), "Send logging output to stdout")
- ("log-to-file", optValue(logFile, "FILE"), "Send log output to FILE.")
- ("log-to-eventlog", optValue(logToEventLog, "yes|no"), "Send logging output to event log;\n\tcustomize using --syslog-name and --syslog-facility")
- ("eventlog-source-name", optValue(eventSource, "Application"), "Event source to log to")
- ;
-
-}
-
-qpid::log::SinkOptions& SinkOptions::operator=(const qpid::log::SinkOptions& rhs) {
- const SinkOptions *prhs = dynamic_cast<const SinkOptions*>(&rhs);
- if (this != prhs) {
- logToStderr = prhs->logToStderr;
- logToStdout = prhs->logToStdout;
- logToEventLog = prhs->logToEventLog;
- eventSource = prhs->eventSource;
- logFile = prhs->logFile;
- }
- return *this;
-}
-
-void SinkOptions::detached(void) {
- if (logToStderr && !logToStdout && !logToEventLog) {
- logToStderr = false;
- logToEventLog = true;
- }
-}
-
-// The Logger acting on these options calls setup() to request any
-// Sinks be set up and fed back to the logger.
-void SinkOptions::setup(qpid::log::Logger *logger) {
- if (logToStderr)
- logger->output(make_auto_ptr<qpid::log::Logger::Output>
- (new qpid::log::OstreamOutput(std::clog)));
- if (logToStdout)
- logger->output(make_auto_ptr<qpid::log::Logger::Output>
- (new qpid::log::OstreamOutput(std::cout)));
-
- if (logFile.length() > 0)
- logger->output(make_auto_ptr<qpid::log::Logger::Output>
- (new qpid::log::OstreamOutput(logFile)));
-
- if (logToEventLog)
- logger->output(make_auto_ptr<qpid::log::Logger::Output>
- (new EventLogOutput(eventSource)));
-
-}
-
-} // namespace windows
-
-SinkOptions* SinkOptions::create(const std::string& argv0) {
- return new qpid::log::windows::SinkOptions (argv0);
-}
-
-}} // namespace qpid::log
diff --git a/M4-RCs/qpid/cpp/src/qpid/log/windows/SinkOptions.h b/M4-RCs/qpid/cpp/src/qpid/log/windows/SinkOptions.h
deleted file mode 100644
index d14e9352be..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/log/windows/SinkOptions.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef QPID_LOG_WINDOWS_SINKOPTIONS_H
-#define QPID_LOG_WINDOWS_SINKOPTIONS_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/log/SinkOptions.h"
-#include <string>
-
-namespace qpid {
-namespace log {
-namespace windows {
-
-struct SinkOptions : public qpid::log::SinkOptions {
- SinkOptions(const std::string& argv0);
- virtual ~SinkOptions() {}
-
- virtual qpid::log::SinkOptions& operator=(const qpid::log::SinkOptions& rhs);
-
- // This allows the caller to indicate that there's no normal outputs
- // available. For example, when running as a service. In these cases, the
- // platform's "syslog"-type output should replace the default stderr
- // unless some other sink has been selected.
- virtual void detached(void);
-
- // The Logger acting on these options calls setup() to request any
- // Sinks be set up and fed back to the logger.
- virtual void setup(qpid::log::Logger *logger);
-
- bool logToStderr;
- bool logToStdout;
- bool logToEventLog;
- std::string eventSource;
- std::string logFile;
-};
-
-}}} // namespace qpid::log::windows
-
-#endif /*!QPID_LOG_WINDOWS_SINKOPTIONS_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/management/Args.h b/M4-RCs/qpid/cpp/src/qpid/management/Args.h
deleted file mode 100644
index da1fb033b9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/management/Args.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#ifndef _Args_
-#define _Args_
-
-//
-// 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 qpid {
-namespace management {
-
-class Args
-{
- public:
-
- virtual ~Args (void) = 0;
-
-};
-
-inline Args::~Args (void) {}
-
-class ArgsNone : public Args
-{
-};
-
-}}
-
-
-#endif /*!_Args_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/management/Manageable.cpp b/M4-RCs/qpid/cpp/src/qpid/management/Manageable.cpp
deleted file mode 100644
index 08bb541fc7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/management/Manageable.cpp
+++ /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.
-//
-
-#include "Manageable.h"
-
-using namespace qpid::management;
-using std::string;
-
-string Manageable::StatusText (status_t status, string text)
-{
- if ((status & STATUS_USER) == STATUS_USER)
- return text;
-
- switch (status)
- {
- case STATUS_OK : return "OK";
- case STATUS_UNKNOWN_OBJECT : return "UnknownObject";
- case STATUS_UNKNOWN_METHOD : return "UnknownMethod";
- case STATUS_NOT_IMPLEMENTED : return "NotImplemented";
- case STATUS_INVALID_PARAMETER : return "InvalidParameter";
- case STATUS_FEATURE_NOT_IMPLEMENTED : return "FeatureNotImplemented";
- case STATUS_FORBIDDEN : return "Forbidden";
- }
-
- return "??";
-}
-
-Manageable::status_t Manageable::ManagementMethod (uint32_t, Args&, std::string&)
-{
- return STATUS_UNKNOWN_METHOD;
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/management/Manageable.h b/M4-RCs/qpid/cpp/src/qpid/management/Manageable.h
deleted file mode 100644
index b4d80d8fad..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/management/Manageable.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#ifndef _Manageable_
-#define _Manageable_
-
-//
-// 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 "ManagementObject.h"
-#include "Args.h"
-#include <string>
-
-namespace qpid {
-namespace management {
-
-class Manageable
-{
- public:
-
- virtual ~Manageable(void) = 0;
-
- // status_t is a type used to pass completion status from the method handler.
- //
- typedef uint32_t status_t;
- static std::string StatusText(status_t status, std::string text = std::string());
-
- static const status_t STATUS_OK = 0;
- static const status_t STATUS_UNKNOWN_OBJECT = 1;
- static const status_t STATUS_UNKNOWN_METHOD = 2;
- static const status_t STATUS_NOT_IMPLEMENTED = 3;
- static const status_t STATUS_INVALID_PARAMETER = 4;
- static const status_t STATUS_FEATURE_NOT_IMPLEMENTED = 5;
- static const status_t STATUS_FORBIDDEN = 6;
- static const status_t STATUS_EXCEPTION = 7;
- static const status_t STATUS_USER = 0x00010000;
-
- // Every "Manageable" object must hold a reference to exactly one
- // management object. This object is always of a class derived from
- // the pure-virtual "ManagementObject".
- //
- // This accessor function returns a pointer to the management object.
- //
- virtual ManagementObject* GetManagementObject(void) const = 0;
-
- // Every "Manageable" object must implement ManagementMethod. This
- // function is called when a remote management client invokes a method
- // on this object. The input and output arguments are specific to the
- // method being called and must be down-cast to the appropriate sub class
- // before use.
- virtual status_t ManagementMethod(uint32_t methodId, Args& args, std::string& text);
-};
-
-inline Manageable::~Manageable(void) {}
-
-}}
-
-#endif /*!_Manageable_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/management/ManagementBroker.cpp b/M4-RCs/qpid/cpp/src/qpid/management/ManagementBroker.cpp
deleted file mode 100644
index cc7a2dc4f3..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/management/ManagementBroker.cpp
+++ /dev/null
@@ -1,1138 +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 "ManagementBroker.h"
-#include "qpid/broker/DeliverableMessage.h"
-#include "qpid/log/Statement.h"
-#include <qpid/broker/Message.h>
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/sys/Time.h"
-#include "qpid/broker/ConnectionState.h"
-#include "qpid/broker/AclModule.h"
-#include <list>
-#include <iostream>
-#include <fstream>
-
-using boost::intrusive_ptr;
-using qpid::framing::Uuid;
-using namespace qpid::framing;
-using namespace qpid::management;
-using namespace qpid::broker;
-using namespace qpid::sys;
-using namespace std;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-Mutex ManagementAgent::Singleton::lock;
-bool ManagementAgent::Singleton::disabled = false;
-ManagementAgent* ManagementAgent::Singleton::agent = 0;
-int ManagementAgent::Singleton::refCount = 0;
-
-ManagementAgent::Singleton::Singleton(bool disableManagement)
-{
- Mutex::ScopedLock _lock(lock);
- if (disableManagement && !disabled) {
- disabled = true;
- assert(refCount == 0); // can't disable after agent has been allocated
- }
- if (refCount == 0 && !disabled)
- agent = new ManagementBroker();
- refCount++;
-}
-
-ManagementAgent::Singleton::~Singleton()
-{
- Mutex::ScopedLock _lock(lock);
- refCount--;
- if (refCount == 0 && !disabled) {
- delete agent;
- agent = 0;
- }
-}
-
-ManagementAgent* ManagementAgent::Singleton::getInstance()
-{
- return agent;
-}
-
-ManagementBroker::RemoteAgent::~RemoteAgent ()
-{
- if (mgmtObject != 0)
- mgmtObject->resourceDestroy();
-}
-
-ManagementBroker::ManagementBroker () :
- threadPoolSize(1), interval(10), broker(0)
-{
- nextObjectId = 1;
- brokerBank = 1;
- bootSequence = 1;
- nextRemoteBank = 10;
- nextRequestSequence = 1;
- clientWasAdded = false;
-}
-
-ManagementBroker::~ManagementBroker ()
-{
- timer.stop();
- {
- Mutex::ScopedLock lock (userLock);
-
- // Reset the shared pointers to exchanges. If this is not done now, the exchanges
- // will stick around until dExchange and mExchange are implicitely destroyed (long
- // after this destructor completes). Those exchanges hold references to management
- // objects that will be invalid.
- dExchange.reset();
- mExchange.reset();
-
- moveNewObjectsLH();
- for (ManagementObjectMap::iterator iter = managementObjects.begin ();
- iter != managementObjects.end ();
- iter++) {
- ManagementObject* object = iter->second;
- delete object;
- }
- managementObjects.clear();
- }
-}
-
-void ManagementBroker::configure(const string& _dataDir, uint16_t _interval,
- qpid::broker::Broker* _broker, int _threads)
-{
- dataDir = _dataDir;
- interval = _interval;
- broker = _broker;
- threadPoolSize = _threads;
- timer.add (intrusive_ptr<TimerTask> (new Periodic(*this, interval)));
-
- // Get from file or generate and save to file.
- if (dataDir.empty())
- {
- uuid.generate();
- QPID_LOG (info, "ManagementBroker has no data directory, generated new broker ID: "
- << uuid);
- }
- else
- {
- string filename(dataDir + "/.mbrokerdata");
- ifstream inFile(filename.c_str ());
-
- if (inFile.good())
- {
- inFile >> uuid;
- inFile >> bootSequence;
- inFile >> nextRemoteBank;
- inFile.close();
- QPID_LOG (debug, "ManagementBroker restored broker ID: " << uuid);
-
- // if sequence goes beyond a 12-bit field, skip zero and wrap to 1.
- bootSequence++;
- if (bootSequence & 0xF000)
- bootSequence = 1;
- writeData();
- }
- else
- {
- uuid.generate();
- QPID_LOG (info, "ManagementBroker generated broker ID: " << uuid);
- writeData();
- }
-
- QPID_LOG (debug, "ManagementBroker boot sequence: " << bootSequence);
- }
-}
-
-void ManagementBroker::writeData ()
-{
- string filename (dataDir + "/.mbrokerdata");
- ofstream outFile (filename.c_str ());
-
- if (outFile.good())
- {
- outFile << uuid << " " << bootSequence << " " << nextRemoteBank << endl;
- outFile.close();
- }
-}
-
-void ManagementBroker::setExchange (qpid::broker::Exchange::shared_ptr _mexchange,
- qpid::broker::Exchange::shared_ptr _dexchange)
-{
- mExchange = _mexchange;
- dExchange = _dexchange;
-}
-
-void ManagementBroker::registerClass (const string& packageName,
- const string& className,
- uint8_t* md5Sum,
- ManagementObject::writeSchemaCall_t schemaCall)
-{
- Mutex::ScopedLock lock(userLock);
- PackageMap::iterator pIter = findOrAddPackageLH(packageName);
- addClassLH(ManagementItem::CLASS_KIND_TABLE, pIter, className, md5Sum, schemaCall);
-}
-
-void ManagementBroker::registerEvent (const string& packageName,
- const string& eventName,
- uint8_t* md5Sum,
- ManagementObject::writeSchemaCall_t schemaCall)
-{
- Mutex::ScopedLock lock(userLock);
- PackageMap::iterator pIter = findOrAddPackageLH(packageName);
- addClassLH(ManagementItem::CLASS_KIND_EVENT, pIter, eventName, md5Sum, schemaCall);
-}
-
-ObjectId ManagementBroker::addObject (ManagementObject* object,
- uint64_t persistId)
-{
- Mutex::ScopedLock lock (addLock);
- uint16_t sequence;
- uint64_t objectNum;
-
- if (persistId == 0) {
- sequence = bootSequence;
- objectNum = nextObjectId++;
- } else {
- sequence = 0;
- objectNum = persistId;
- }
-
- ObjectId objId(0 /*flags*/ , sequence, brokerBank, 0, objectNum);
-
- object->setObjectId(objId);
- newManagementObjects[objId] = object;
- return objId;
-}
-
-void ManagementBroker::raiseEvent(const ManagementEvent& event, severity_t severity)
-{
- Mutex::ScopedLock lock (userLock);
- Buffer outBuffer(eventBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
- uint8_t sev = (severity == SEV_DEFAULT) ? event.getSeverity() : (uint8_t) severity;
-
- encodeHeader(outBuffer, 'e');
- outBuffer.putShortString(event.getPackageName());
- outBuffer.putShortString(event.getEventName());
- outBuffer.putBin128(event.getMd5Sum());
- outBuffer.putLongLong(uint64_t(Duration(now())));
- outBuffer.putOctet(sev);
- event.encode(outBuffer);
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- sendBuffer(outBuffer, outLen, mExchange,
- "console.event.1.0." + event.getPackageName() + "." + event.getEventName());
-}
-
-ManagementBroker::Periodic::Periodic (ManagementBroker& _broker, uint32_t _seconds)
- : TimerTask (qpid::sys::Duration ((_seconds ? _seconds : 1) * qpid::sys::TIME_SEC)), broker(_broker) {}
-
-ManagementBroker::Periodic::~Periodic () {}
-
-void ManagementBroker::Periodic::fire ()
-{
- broker.timer.add (intrusive_ptr<TimerTask> (new Periodic (broker, broker.interval)));
- broker.periodicProcessing ();
-}
-
-void ManagementBroker::clientAdded (const std::string& routingKey)
-{
- if (routingKey.find("console") != 0)
- return;
-
- clientWasAdded = true;
- for (RemoteAgentMap::iterator aIter = remoteAgents.begin();
- aIter != remoteAgents.end();
- aIter++) {
- char localBuffer[16];
- Buffer outBuffer(localBuffer, 16);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 'x');
- outLen = outBuffer.getPosition();
- outBuffer.reset();
- sendBuffer(outBuffer, outLen, dExchange, aIter->second->routingKey);
- }
-}
-
-void ManagementBroker::encodeHeader (Buffer& buf, uint8_t opcode, uint32_t seq)
-{
- buf.putOctet ('A');
- buf.putOctet ('M');
- buf.putOctet ('2');
- buf.putOctet (opcode);
- buf.putLong (seq);
-}
-
-bool ManagementBroker::checkHeader (Buffer& buf, uint8_t *opcode, uint32_t *seq)
-{
- uint8_t h1 = buf.getOctet();
- uint8_t h2 = buf.getOctet();
- uint8_t h3 = buf.getOctet();
-
- *opcode = buf.getOctet();
- *seq = buf.getLong();
-
- return h1 == 'A' && h2 == 'M' && h3 == '2';
-}
-
-void ManagementBroker::sendBuffer(Buffer& buf,
- uint32_t length,
- qpid::broker::Exchange::shared_ptr exchange,
- string routingKey)
-{
- if (exchange.get() == 0)
- return;
-
- intrusive_ptr<Message> msg(new Message());
- AMQFrame method(in_place<MessageTransferBody>(
- ProtocolVersion(), exchange->getName (), 0, 0));
- AMQFrame header(in_place<AMQHeaderBody>());
- AMQFrame content(in_place<AMQContentBody>());
-
- content.castBody<AMQContentBody>()->decode(buf, length);
-
- method.setEof(false);
- header.setBof(false);
- header.setEof(false);
- content.setBof(false);
-
- msg->getFrames().append(method);
- msg->getFrames().append(header);
-
- MessageProperties* props =
- msg->getFrames().getHeaders()->get<MessageProperties>(true);
- props->setContentLength(length);
- msg->getFrames().append(content);
-
- DeliverableMessage deliverable (msg);
- try {
- exchange->route(deliverable, routingKey, 0);
- } catch(exception&) {}
-}
-
-void ManagementBroker::moveNewObjectsLH()
-{
- Mutex::ScopedLock lock (addLock);
- for (ManagementObjectMap::iterator iter = newManagementObjects.begin ();
- iter != newManagementObjects.end ();
- iter++)
- managementObjects[iter->first] = iter->second;
- newManagementObjects.clear();
-}
-
-void ManagementBroker::periodicProcessing (void)
-{
-#define BUFSIZE 65536
- Mutex::ScopedLock lock (userLock);
- char msgChars[BUFSIZE];
- uint32_t contentSize;
- string routingKey;
- list<pair<ObjectId, ManagementObject*> > deleteList;
-
- moveNewObjectsLH();
-
- if (clientWasAdded) {
- clientWasAdded = false;
- for (ManagementObjectMap::iterator iter = managementObjects.begin ();
- iter != managementObjects.end ();
- iter++) {
- ManagementObject* object = iter->second;
- object->setForcePublish(true);
- }
- }
-
- for (ManagementObjectMap::iterator iter = managementObjects.begin ();
- iter != managementObjects.end ();
- iter++) {
- ManagementObject* object = iter->second;
-
- if (object->getConfigChanged() || object->getInstChanged())
- object->setUpdateTime();
-
- if (object->getConfigChanged() || object->getForcePublish() || object->isDeleted()) {
- Buffer msgBuffer (msgChars, BUFSIZE);
- encodeHeader (msgBuffer, 'c');
- object->writeProperties(msgBuffer);
-
- contentSize = BUFSIZE - msgBuffer.available ();
- msgBuffer.reset ();
- routingKey = "console.obj.1.0." + object->getPackageName() + "." + object->getClassName();
- sendBuffer (msgBuffer, contentSize, mExchange, routingKey);
- }
-
- if (object->hasInst() && (object->getInstChanged() || object->getForcePublish())) {
- Buffer msgBuffer (msgChars, BUFSIZE);
- encodeHeader (msgBuffer, 'i');
- object->writeStatistics(msgBuffer);
-
- contentSize = BUFSIZE - msgBuffer.available ();
- msgBuffer.reset ();
- routingKey = "console.obj.1.0." + object->getPackageName() + "." + object->getClassName();
- sendBuffer (msgBuffer, contentSize, mExchange, routingKey);
- }
-
- if (object->isDeleted())
- deleteList.push_back(pair<ObjectId, ManagementObject*>(iter->first, object));
- object->setForcePublish(false);
- }
-
- // Delete flagged objects
- for (list<pair<ObjectId, ManagementObject*> >::reverse_iterator iter = deleteList.rbegin();
- iter != deleteList.rend();
- iter++) {
- delete iter->second;
- managementObjects.erase(iter->first);
- }
-
- if (!deleteList.empty()) {
- deleteList.clear();
- deleteOrphanedAgentsLH();
- }
-
- {
- Buffer msgBuffer(msgChars, BUFSIZE);
- encodeHeader(msgBuffer, 'h');
- msgBuffer.putLongLong(uint64_t(Duration(now())));
-
- contentSize = BUFSIZE - msgBuffer.available ();
- msgBuffer.reset ();
- routingKey = "console.heartbeat.1.0";
- sendBuffer (msgBuffer, contentSize, mExchange, routingKey);
- }
-}
-
-void ManagementBroker::sendCommandComplete (string replyToKey, uint32_t sequence,
- uint32_t code, string text)
-{
- Buffer outBuffer (outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader (outBuffer, 'z', sequence);
- outBuffer.putLong (code);
- outBuffer.putShortString (text);
- outLen = MA_BUFFER_SIZE - outBuffer.available ();
- outBuffer.reset ();
- sendBuffer (outBuffer, outLen, dExchange, replyToKey);
-}
-
-bool ManagementBroker::dispatchCommand (Deliverable& deliverable,
- const string& routingKey,
- const FieldTable* /*args*/)
-{
- Mutex::ScopedLock lock (userLock);
- Message& msg = ((DeliverableMessage&) deliverable).getMessage ();
-
- // Parse the routing key. This management broker should act as though it
- // is bound to the exchange to match the following keys:
- //
- // agent.1.0.#
- // broker
- // schema.#
-
- if (routingKey == "broker") {
- dispatchAgentCommandLH(msg);
- return false;
- }
-
- else if (routingKey.compare(0, 9, "agent.1.0") == 0) {
- dispatchAgentCommandLH(msg);
- return false;
- }
-
- else if (routingKey.compare(0, 8, "agent.1.") == 0) {
- return authorizeAgentMessageLH(msg);
- }
-
- else if (routingKey.compare(0, 7, "schema.") == 0) {
- dispatchAgentCommandLH(msg);
- return true;
- }
-
- return true;
-}
-
-void ManagementBroker::handleMethodRequestLH (Buffer& inBuffer, string replyToKey,
- uint32_t sequence, const ConnectionToken* connToken)
-{
- string methodName;
- string packageName;
- string className;
- uint8_t hash[16];
- Buffer outBuffer (outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
- AclModule* acl = broker->getAcl();
-
- ObjectId objId(inBuffer);
- inBuffer.getShortString(packageName);
- inBuffer.getShortString(className);
- inBuffer.getBin128(hash);
- inBuffer.getShortString(methodName);
- encodeHeader(outBuffer, 'm', sequence);
-
- if (acl != 0) {
- string userId = ((const qpid::broker::ConnectionState*) connToken)->getUserId();
- map<acl::Property, string> params;
- params[acl::PROP_SCHEMAPACKAGE] = packageName;
- params[acl::PROP_SCHEMACLASS] = className;
-
- if (!acl->authorise(userId, acl::ACT_ACCESS, acl::OBJ_METHOD, methodName, &params)) {
- outBuffer.putLong(Manageable::STATUS_FORBIDDEN);
- outBuffer.putMediumString(Manageable::StatusText(Manageable::STATUS_FORBIDDEN));
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- sendBuffer(outBuffer, outLen, dExchange, replyToKey);
- return;
- }
- }
-
- ManagementObjectMap::iterator iter = managementObjects.find(objId);
- if (iter == managementObjects.end() || iter->second->isDeleted()) {
- outBuffer.putLong (Manageable::STATUS_UNKNOWN_OBJECT);
- outBuffer.putMediumString(Manageable::StatusText (Manageable::STATUS_UNKNOWN_OBJECT));
- } else {
- if ((iter->second->getPackageName() != packageName) ||
- (iter->second->getClassName() != className)) {
- outBuffer.putLong (Manageable::STATUS_INVALID_PARAMETER);
- outBuffer.putMediumString(Manageable::StatusText (Manageable::STATUS_INVALID_PARAMETER));
- }
- else
- try {
- outBuffer.record();
- iter->second->doMethod(methodName, inBuffer, outBuffer);
- } catch(exception& e) {
- outBuffer.restore();
- outBuffer.putLong(Manageable::STATUS_EXCEPTION);
- outBuffer.putMediumString(e.what());
- }
- }
-
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- sendBuffer(outBuffer, outLen, dExchange, replyToKey);
-}
-
-void ManagementBroker::handleBrokerRequestLH (Buffer&, string replyToKey, uint32_t sequence)
-{
- Buffer outBuffer (outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader (outBuffer, 'b', sequence);
- uuid.encode (outBuffer);
-
- outLen = MA_BUFFER_SIZE - outBuffer.available ();
- outBuffer.reset ();
- sendBuffer (outBuffer, outLen, dExchange, replyToKey);
-}
-
-void ManagementBroker::handlePackageQueryLH (Buffer&, string replyToKey, uint32_t sequence)
-{
- for (PackageMap::iterator pIter = packages.begin ();
- pIter != packages.end ();
- pIter++)
- {
- Buffer outBuffer (outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader (outBuffer, 'p', sequence);
- encodePackageIndication (outBuffer, pIter);
- outLen = MA_BUFFER_SIZE - outBuffer.available ();
- outBuffer.reset ();
- sendBuffer (outBuffer, outLen, dExchange, replyToKey);
- }
-
- sendCommandComplete (replyToKey, sequence);
-}
-
-void ManagementBroker::handlePackageIndLH (Buffer& inBuffer, string /*replyToKey*/, uint32_t /*sequence*/)
-{
- string packageName;
-
- inBuffer.getShortString(packageName);
- findOrAddPackageLH(packageName);
-}
-
-void ManagementBroker::handleClassQueryLH(Buffer& inBuffer, string replyToKey, uint32_t sequence)
-{
- string packageName;
-
- inBuffer.getShortString(packageName);
- PackageMap::iterator pIter = packages.find(packageName);
- if (pIter != packages.end())
- {
- ClassMap cMap = pIter->second;
- for (ClassMap::iterator cIter = cMap.begin();
- cIter != cMap.end();
- cIter++)
- {
- if (cIter->second.hasSchema())
- {
- Buffer outBuffer(outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 'q', sequence);
- encodeClassIndication(outBuffer, pIter, cIter);
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- sendBuffer(outBuffer, outLen, dExchange, replyToKey);
- }
- }
- }
- sendCommandComplete(replyToKey, sequence);
-}
-
-void ManagementBroker::handleClassIndLH (Buffer& inBuffer, string replyToKey, uint32_t)
-{
- string packageName;
- SchemaClassKey key;
-
- uint8_t kind = inBuffer.getOctet();
- inBuffer.getShortString(packageName);
- inBuffer.getShortString(key.name);
- inBuffer.getBin128(key.hash);
-
- PackageMap::iterator pIter = findOrAddPackageLH(packageName);
- ClassMap::iterator cIter = pIter->second.find(key);
- if (cIter == pIter->second.end() || !cIter->second.hasSchema()) {
- Buffer outBuffer (outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
- uint32_t sequence = nextRequestSequence++;
-
- encodeHeader (outBuffer, 'S', sequence);
- outBuffer.putShortString(packageName);
- outBuffer.putShortString(key.name);
- outBuffer.putBin128(key.hash);
- outLen = MA_BUFFER_SIZE - outBuffer.available ();
- outBuffer.reset ();
- sendBuffer (outBuffer, outLen, dExchange, replyToKey);
-
- if (cIter != pIter->second.end())
- pIter->second.erase(key);
-
- pIter->second.insert(pair<SchemaClassKey, SchemaClass>(key, SchemaClass(kind, sequence)));
- }
-}
-
-void ManagementBroker::SchemaClass::appendSchema(Buffer& buf)
-{
- // If the management package is attached locally (embedded in the broker or
- // linked in via plug-in), call the schema handler directly. If the package
- // is from a remote management agent, send the stored schema information.
-
- if (writeSchemaCall != 0)
- writeSchemaCall(buf);
- else
- buf.putRawData(buffer, bufferLen);
-}
-
-void ManagementBroker::handleSchemaRequestLH(Buffer& inBuffer, string replyToKey, uint32_t sequence)
-{
- string packageName;
- SchemaClassKey key;
-
- inBuffer.getShortString (packageName);
- inBuffer.getShortString (key.name);
- inBuffer.getBin128 (key.hash);
-
- PackageMap::iterator pIter = packages.find(packageName);
- if (pIter != packages.end()) {
- ClassMap& cMap = pIter->second;
- ClassMap::iterator cIter = cMap.find(key);
- if (cIter != cMap.end()) {
- Buffer outBuffer(outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
- SchemaClass& classInfo = cIter->second;
-
- if (classInfo.hasSchema()) {
- encodeHeader(outBuffer, 's', sequence);
- classInfo.appendSchema(outBuffer);
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- sendBuffer(outBuffer, outLen, dExchange, replyToKey);
- }
- else
- sendCommandComplete(replyToKey, sequence, 1, "Schema not available");
- }
- else
- sendCommandComplete(replyToKey, sequence, 1, "Class key not found");
- }
- else
- sendCommandComplete(replyToKey, sequence, 1, "Package not found");
-}
-
-void ManagementBroker::handleSchemaResponseLH(Buffer& inBuffer, string /*replyToKey*/, uint32_t sequence)
-{
- string packageName;
- SchemaClassKey key;
-
- inBuffer.record();
- inBuffer.getOctet();
- inBuffer.getShortString(packageName);
- inBuffer.getShortString(key.name);
- inBuffer.getBin128(key.hash);
- inBuffer.restore();
-
- PackageMap::iterator pIter = packages.find(packageName);
- if (pIter != packages.end()) {
- ClassMap& cMap = pIter->second;
- ClassMap::iterator cIter = cMap.find(key);
- if (cIter != cMap.end() && cIter->second.pendingSequence == sequence) {
- size_t length = validateSchema(inBuffer, cIter->second.kind);
- if (length == 0) {
- QPID_LOG(warning, "Management Broker received invalid schema response: " << packageName << "." << key.name);
- cMap.erase(key);
- } else {
- cIter->second.buffer = (uint8_t*) malloc(length);
- cIter->second.bufferLen = length;
- inBuffer.getRawData(cIter->second.buffer, cIter->second.bufferLen);
-
- // Publish a class-indication message
- Buffer outBuffer(outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 'q');
- encodeClassIndication(outBuffer, pIter, cIter);
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- sendBuffer(outBuffer, outLen, mExchange, "schema.class");
- }
- }
- }
-}
-
-bool ManagementBroker::bankInUse (uint32_t bank)
-{
- for (RemoteAgentMap::iterator aIter = remoteAgents.begin();
- aIter != remoteAgents.end();
- aIter++)
- if (aIter->second->agentBank == bank)
- return true;
- return false;
-}
-
-uint32_t ManagementBroker::allocateNewBank ()
-{
- while (bankInUse (nextRemoteBank))
- nextRemoteBank++;
-
- uint32_t allocated = nextRemoteBank++;
- writeData ();
- return allocated;
-}
-
-uint32_t ManagementBroker::assignBankLH (uint32_t requestedBank)
-{
- if (requestedBank == 0 || bankInUse (requestedBank))
- return allocateNewBank ();
- return requestedBank;
-}
-
-void ManagementBroker::deleteOrphanedAgentsLH()
-{
- vector<ObjectId> deleteList;
-
- for (RemoteAgentMap::iterator aIter = remoteAgents.begin(); aIter != remoteAgents.end(); aIter++) {
- ObjectId connectionRef = aIter->first;
- bool found = false;
-
- for (ManagementObjectMap::iterator iter = managementObjects.begin();
- iter != managementObjects.end();
- iter++) {
- if (iter->first == connectionRef && !iter->second->isDeleted()) {
- found = true;
- break;
- }
- }
-
- if (!found) {
- deleteList.push_back(connectionRef);
- delete aIter->second;
- }
- }
-
- for (vector<ObjectId>::iterator dIter = deleteList.begin(); dIter != deleteList.end(); dIter++)
- remoteAgents.erase(*dIter);
-
- deleteList.clear();
-}
-
-void ManagementBroker::handleAttachRequestLH (Buffer& inBuffer, string replyToKey, uint32_t sequence, const ConnectionToken* connToken)
-{
- string label;
- uint32_t requestedBrokerBank, requestedAgentBank;
- uint32_t assignedBank;
- ObjectId connectionRef = ((const ConnectionState*) connToken)->GetManagementObject()->getObjectId();
- Uuid systemId;
-
- moveNewObjectsLH();
- deleteOrphanedAgentsLH();
- RemoteAgentMap::iterator aIter = remoteAgents.find(connectionRef);
- if (aIter != remoteAgents.end()) {
- // There already exists an agent on this session. Reject the request.
- sendCommandComplete(replyToKey, sequence, 1, "Connection already has remote agent");
- return;
- }
-
- inBuffer.getShortString(label);
- systemId.decode(inBuffer);
- requestedBrokerBank = inBuffer.getLong();
- requestedAgentBank = inBuffer.getLong();
- assignedBank = assignBankLH(requestedAgentBank);
-
- RemoteAgent* agent = new RemoteAgent;
- agent->brokerBank = brokerBank;
- agent->agentBank = assignedBank;
- agent->routingKey = replyToKey;
- agent->connectionRef = connectionRef;
- agent->mgmtObject = new _qmf::Agent (this, agent);
- agent->mgmtObject->set_connectionRef(agent->connectionRef);
- agent->mgmtObject->set_label (label);
- agent->mgmtObject->set_registeredTo (broker->GetManagementObject()->getObjectId());
- agent->mgmtObject->set_systemId (systemId);
- agent->mgmtObject->set_brokerBank (brokerBank);
- agent->mgmtObject->set_agentBank (assignedBank);
- addObject (agent->mgmtObject);
-
- remoteAgents[connectionRef] = agent;
-
- // Send an Attach Response
- Buffer outBuffer (outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader (outBuffer, 'a', sequence);
- outBuffer.putLong (brokerBank);
- outBuffer.putLong (assignedBank);
- outLen = MA_BUFFER_SIZE - outBuffer.available ();
- outBuffer.reset ();
- sendBuffer (outBuffer, outLen, dExchange, replyToKey);
-}
-
-void ManagementBroker::handleGetQueryLH (Buffer& inBuffer, string replyToKey, uint32_t sequence)
-{
- FieldTable ft;
- FieldTable::ValuePtr value;
-
- moveNewObjectsLH();
-
- ft.decode(inBuffer);
- value = ft.get("_class");
- if (value.get() == 0 || !value->convertsTo<string>()) {
- value = ft.get("_objectid");
- if (value.get() == 0 || !value->convertsTo<string>())
- return;
-
- ObjectId selector(value->get<string>());
- ManagementObjectMap::iterator iter = managementObjects.find(selector);
- if (iter != managementObjects.end()) {
- ManagementObject* object = iter->second;
- Buffer outBuffer (outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 'g', sequence);
- object->writeProperties(outBuffer);
- object->writeStatistics(outBuffer, true);
- outLen = MA_BUFFER_SIZE - outBuffer.available ();
- outBuffer.reset ();
- sendBuffer(outBuffer, outLen, dExchange, replyToKey);
- }
- sendCommandComplete(replyToKey, sequence);
- return;
- }
-
- string className (value->get<string>());
-
- for (ManagementObjectMap::iterator iter = managementObjects.begin();
- iter != managementObjects.end();
- iter++) {
- ManagementObject* object = iter->second;
- if (object->getClassName () == className) {
- Buffer outBuffer (outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 'g', sequence);
- object->writeProperties(outBuffer);
- object->writeStatistics(outBuffer, true);
- outLen = MA_BUFFER_SIZE - outBuffer.available ();
- outBuffer.reset ();
- sendBuffer(outBuffer, outLen, dExchange, replyToKey);
- }
- }
-
- sendCommandComplete(replyToKey, sequence);
-}
-
-bool ManagementBroker::authorizeAgentMessageLH(Message& msg)
-{
- Buffer inBuffer (inputBuffer, MA_BUFFER_SIZE);
- uint8_t opcode;
- uint32_t sequence;
- string replyToKey;
-
- if (msg.encodedSize() > MA_BUFFER_SIZE)
- return false;
-
- msg.encodeContent(inBuffer);
- inBuffer.reset();
-
- if (!checkHeader(inBuffer, &opcode, &sequence))
- return false;
-
- if (opcode == 'M') {
- // TODO: check method call against ACL list.
- AclModule* acl = broker->getAcl();
- if (acl == 0)
- return true;
-
- string userId = ((const qpid::broker::ConnectionState*) msg.getPublisher())->getUserId();
- string packageName;
- string className;
- uint8_t hash[16];
- string methodName;
-
- map<acl::Property, string> params;
- ObjectId objId(inBuffer);
- inBuffer.getShortString(packageName);
- inBuffer.getShortString(className);
- inBuffer.getBin128(hash);
- inBuffer.getShortString(methodName);
-
- params[acl::PROP_SCHEMAPACKAGE] = packageName;
- params[acl::PROP_SCHEMACLASS] = className;
-
- if (acl->authorise(userId, acl::ACT_ACCESS, acl::OBJ_METHOD, methodName, &params))
- return true;
-
- const framing::MessageProperties* p =
- msg.getFrames().getHeaders()->get<framing::MessageProperties>();
- if (p && p->hasReplyTo()) {
- const framing::ReplyTo& rt = p->getReplyTo();
- replyToKey = rt.getRoutingKey();
-
- Buffer outBuffer(outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader(outBuffer, 'm', sequence);
- outBuffer.putLong(Manageable::STATUS_FORBIDDEN);
- outBuffer.putMediumString(Manageable::StatusText(Manageable::STATUS_FORBIDDEN));
- outLen = MA_BUFFER_SIZE - outBuffer.available();
- outBuffer.reset();
- sendBuffer(outBuffer, outLen, dExchange, replyToKey);
- }
-
- return false;
- }
-
- return true;
-}
-
-void ManagementBroker::dispatchAgentCommandLH(Message& msg)
-{
- Buffer inBuffer(inputBuffer, MA_BUFFER_SIZE);
- uint8_t opcode;
- uint32_t sequence;
- string replyToKey;
-
- const framing::MessageProperties* p =
- msg.getFrames().getHeaders()->get<framing::MessageProperties>();
- if (p && p->hasReplyTo()) {
- const framing::ReplyTo& rt = p->getReplyTo();
- replyToKey = rt.getRoutingKey();
- }
- else
- return;
-
- if (msg.encodedSize() > MA_BUFFER_SIZE) {
- QPID_LOG(debug, "ManagementBroker::dispatchAgentCommandLH: Message too large: " <<
- msg.encodedSize());
- return;
- }
-
- msg.encodeContent(inBuffer);
- uint32_t bufferLen = inBuffer.getPosition();
- inBuffer.reset();
-
- while (inBuffer.getPosition() < bufferLen) {
- if (!checkHeader(inBuffer, &opcode, &sequence))
- return;
-
- if (opcode == 'B') handleBrokerRequestLH (inBuffer, replyToKey, sequence);
- else if (opcode == 'P') handlePackageQueryLH (inBuffer, replyToKey, sequence);
- else if (opcode == 'p') handlePackageIndLH (inBuffer, replyToKey, sequence);
- else if (opcode == 'Q') handleClassQueryLH (inBuffer, replyToKey, sequence);
- else if (opcode == 'q') handleClassIndLH (inBuffer, replyToKey, sequence);
- else if (opcode == 'S') handleSchemaRequestLH (inBuffer, replyToKey, sequence);
- else if (opcode == 's') handleSchemaResponseLH (inBuffer, replyToKey, sequence);
- else if (opcode == 'A') handleAttachRequestLH (inBuffer, replyToKey, sequence, msg.getPublisher());
- else if (opcode == 'G') handleGetQueryLH (inBuffer, replyToKey, sequence);
- else if (opcode == 'M') handleMethodRequestLH (inBuffer, replyToKey, sequence, msg.getPublisher());
- }
-}
-
-ManagementBroker::PackageMap::iterator ManagementBroker::findOrAddPackageLH(string name)
-{
- PackageMap::iterator pIter = packages.find (name);
- if (pIter != packages.end ())
- return pIter;
-
- // No such package found, create a new map entry.
- pair<PackageMap::iterator, bool> result =
- packages.insert(pair<string, ClassMap>(name, ClassMap()));
- QPID_LOG (debug, "ManagementBroker added package " << name);
-
- // Publish a package-indication message
- Buffer outBuffer (outputBuffer, MA_BUFFER_SIZE);
- uint32_t outLen;
-
- encodeHeader (outBuffer, 'p');
- encodePackageIndication (outBuffer, result.first);
- outLen = MA_BUFFER_SIZE - outBuffer.available ();
- outBuffer.reset ();
- sendBuffer (outBuffer, outLen, mExchange, "schema.package");
-
- return result.first;
-}
-
-void ManagementBroker::addClassLH(uint8_t kind,
- PackageMap::iterator pIter,
- const string& className,
- uint8_t* md5Sum,
- ManagementObject::writeSchemaCall_t schemaCall)
-{
- SchemaClassKey key;
- ClassMap& cMap = pIter->second;
-
- key.name = className;
- memcpy(&key.hash, md5Sum, 16);
-
- ClassMap::iterator cIter = cMap.find(key);
- if (cIter != cMap.end())
- return;
-
- // No such class found, create a new class with local information.
- QPID_LOG (debug, "ManagementBroker added class " << pIter->first << ":" <<
- key.name);
-
- cMap.insert(pair<SchemaClassKey, SchemaClass>(key, SchemaClass(kind, schemaCall)));
- cIter = cMap.find(key);
-}
-
-void ManagementBroker::encodePackageIndication(Buffer& buf,
- PackageMap::iterator pIter)
-{
- buf.putShortString((*pIter).first);
-}
-
-void ManagementBroker::encodeClassIndication(Buffer& buf,
- PackageMap::iterator pIter,
- ClassMap::iterator cIter)
-{
- SchemaClassKey key = (*cIter).first;
-
- buf.putOctet((*cIter).second.kind);
- buf.putShortString((*pIter).first);
- buf.putShortString(key.name);
- buf.putBin128(key.hash);
-}
-
-size_t ManagementBroker::validateSchema(Buffer& inBuffer, uint8_t kind)
-{
- if (kind == ManagementItem::CLASS_KIND_TABLE)
- return validateTableSchema(inBuffer);
- else if (kind == ManagementItem::CLASS_KIND_EVENT)
- return validateEventSchema(inBuffer);
- return 0;
-}
-
-size_t ManagementBroker::validateTableSchema(Buffer& inBuffer)
-{
- uint32_t start = inBuffer.getPosition();
- uint32_t end;
- string text;
- uint8_t hash[16];
-
- try {
- inBuffer.record();
- uint8_t kind = inBuffer.getOctet();
- if (kind != ManagementItem::CLASS_KIND_TABLE)
- return 0;
-
- inBuffer.getShortString(text);
- inBuffer.getShortString(text);
- inBuffer.getBin128(hash);
-
- uint16_t propCount = inBuffer.getShort();
- uint16_t statCount = inBuffer.getShort();
- uint16_t methCount = inBuffer.getShort();
-
- for (uint16_t idx = 0; idx < propCount + statCount; idx++) {
- FieldTable ft;
- ft.decode(inBuffer);
- }
-
- for (uint16_t idx = 0; idx < methCount; idx++) {
- FieldTable ft;
- ft.decode(inBuffer);
- if (!ft.isSet("argCount"))
- return 0;
- int argCount = ft.getAsInt("argCount");
- for (int mIdx = 0; mIdx < argCount; mIdx++) {
- FieldTable aft;
- aft.decode(inBuffer);
- }
- }
- } catch (exception& /*e*/) {
- return 0;
- }
-
- end = inBuffer.getPosition();
- inBuffer.restore(); // restore original position
- return end - start;
-}
-
-size_t ManagementBroker::validateEventSchema(Buffer& inBuffer)
-{
- uint32_t start = inBuffer.getPosition();
- uint32_t end;
- string text;
- uint8_t hash[16];
-
- try {
- inBuffer.record();
- uint8_t kind = inBuffer.getOctet();
- if (kind != ManagementItem::CLASS_KIND_EVENT)
- return 0;
-
- inBuffer.getShortString(text);
- inBuffer.getShortString(text);
- inBuffer.getBin128(hash);
-
- uint16_t argCount = inBuffer.getShort();
-
- for (uint16_t idx = 0; idx < argCount; idx++) {
- FieldTable ft;
- ft.decode(inBuffer);
- }
- } catch (exception& /*e*/) {
- return 0;
- }
-
- end = inBuffer.getPosition();
- inBuffer.restore(); // restore original position
- return end - start;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/management/ManagementBroker.h b/M4-RCs/qpid/cpp/src/qpid/management/ManagementBroker.h
deleted file mode 100644
index 59dfb98596..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/management/ManagementBroker.h
+++ /dev/null
@@ -1,235 +0,0 @@
-#ifndef _ManagementBroker_
-#define _ManagementBroker_
-
-/*
- *
- * 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 "qpid/Options.h"
-#include "qpid/broker/Exchange.h"
-#include "qpid/broker/Timer.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/broker/ConnectionToken.h"
-#include "qpid/agent/ManagementAgent.h"
-#include "ManagementObject.h"
-#include "Manageable.h"
-#include "qmf/org/apache/qpid/broker/Agent.h"
-#include <qpid/framing/AMQFrame.h>
-
-namespace qpid {
-namespace management {
-
-class ManagementBroker : public ManagementAgent
-{
-private:
-
- int threadPoolSize;
-
-public:
-
- ManagementBroker ();
- virtual ~ManagementBroker ();
-
- void configure (const std::string& dataDir, uint16_t interval,
- qpid::broker::Broker* broker, int threadPoolSize);
- void setInterval (uint16_t _interval) { interval = _interval; }
- void setExchange (qpid::broker::Exchange::shared_ptr mgmtExchange,
- qpid::broker::Exchange::shared_ptr directExchange);
- int getMaxThreads () { return threadPoolSize; }
- void registerClass (const std::string& packageName,
- const std::string& className,
- uint8_t* md5Sum,
- ManagementObject::writeSchemaCall_t schemaCall);
- void registerEvent (const std::string& packageName,
- const std::string& eventName,
- uint8_t* md5Sum,
- ManagementObject::writeSchemaCall_t schemaCall);
- ObjectId addObject (ManagementObject* object,
- uint64_t persistId = 0);
- void raiseEvent(const ManagementEvent& event, severity_t severity = SEV_DEFAULT);
- void clientAdded (const std::string& routingKey);
- bool dispatchCommand (qpid::broker::Deliverable& msg,
- const std::string& routingKey,
- const framing::FieldTable* args);
- const framing::Uuid& getUuid() const { return uuid; }
-
- // Stubs for remote management agent calls
- void init(const std::string&, uint16_t, uint16_t, bool,
- const std::string&, const std::string&, const std::string&,
- const std::string&, const std::string&) { assert(0); }
- void init(const client::ConnectionSettings&, uint16_t, bool, const std::string&) { assert(0); }
- uint32_t pollCallbacks (uint32_t) { assert(0); return 0; }
- int getSignalFd () { assert(0); return -1; }
-
-private:
- friend class ManagementAgent;
-
- struct Periodic : public qpid::broker::TimerTask
- {
- ManagementBroker& broker;
-
- Periodic (ManagementBroker& broker, uint32_t seconds);
- virtual ~Periodic ();
- void fire ();
- };
-
- // Storage for tracking remote management agents, attached via the client
- // management agent API.
- //
- struct RemoteAgent : public Manageable
- {
- uint32_t brokerBank;
- uint32_t agentBank;
- std::string routingKey;
- ObjectId connectionRef;
- qmf::org::apache::qpid::broker::Agent* mgmtObject;
- ManagementObject* GetManagementObject (void) const { return mgmtObject; }
- virtual ~RemoteAgent ();
- };
-
- // TODO: Eventually replace string with entire reply-to structure. reply-to
- // currently assumes that the exchange is "amq.direct" even though it could
- // in theory be specified differently.
- typedef std::map<ObjectId, RemoteAgent*> RemoteAgentMap;
- typedef std::vector<std::string> ReplyToVector;
-
- // Storage for known schema classes:
- //
- // SchemaClassKey -- Key elements for map lookups
- // SchemaClassKeyComp -- Comparison class for SchemaClassKey
- // SchemaClass -- Non-key elements for classes
- //
- struct SchemaClassKey
- {
- std::string name;
- uint8_t hash[16];
- };
-
- struct SchemaClassKeyComp
- {
- bool operator() (const SchemaClassKey& lhs, const SchemaClassKey& rhs) const
- {
- if (lhs.name != rhs.name)
- return lhs.name < rhs.name;
- else
- for (int i = 0; i < 16; i++)
- if (lhs.hash[i] != rhs.hash[i])
- return lhs.hash[i] < rhs.hash[i];
- return false;
- }
- };
-
- struct SchemaClass
- {
- uint8_t kind;
- ManagementObject::writeSchemaCall_t writeSchemaCall;
- uint32_t pendingSequence;
- size_t bufferLen;
- uint8_t* buffer;
-
- SchemaClass(uint8_t _kind, uint32_t seq) :
- kind(_kind), writeSchemaCall(0), pendingSequence(seq), bufferLen(0), buffer(0) {}
- SchemaClass(uint8_t _kind, ManagementObject::writeSchemaCall_t call) :
- kind(_kind), writeSchemaCall(call), pendingSequence(0), bufferLen(0), buffer(0) {}
- bool hasSchema () { return (writeSchemaCall != 0) || (buffer != 0); }
- void appendSchema (framing::Buffer& buf);
- };
-
- typedef std::map<SchemaClassKey, SchemaClass, SchemaClassKeyComp> ClassMap;
- typedef std::map<std::string, ClassMap> PackageMap;
-
- RemoteAgentMap remoteAgents;
- PackageMap packages;
- ManagementObjectMap managementObjects;
- ManagementObjectMap newManagementObjects;
-
- static ManagementAgent* agent;
- static bool enabled;
-
- framing::Uuid uuid;
- sys::Mutex addLock;
- sys::Mutex userLock;
- qpid::broker::Timer timer;
- qpid::broker::Exchange::shared_ptr mExchange;
- qpid::broker::Exchange::shared_ptr dExchange;
- std::string dataDir;
- uint16_t interval;
- qpid::broker::Broker* broker;
- uint16_t bootSequence;
- uint32_t nextObjectId;
- uint32_t brokerBank;
- uint32_t nextRemoteBank;
- uint32_t nextRequestSequence;
- bool clientWasAdded;
-
-# define MA_BUFFER_SIZE 65536
- char inputBuffer[MA_BUFFER_SIZE];
- char outputBuffer[MA_BUFFER_SIZE];
- char eventBuffer[MA_BUFFER_SIZE];
-
- void writeData ();
- void periodicProcessing (void);
- void encodeHeader (framing::Buffer& buf, uint8_t opcode, uint32_t seq = 0);
- bool checkHeader (framing::Buffer& buf, uint8_t *opcode, uint32_t *seq);
- void sendBuffer (framing::Buffer& buf,
- uint32_t length,
- qpid::broker::Exchange::shared_ptr exchange,
- std::string routingKey);
- void moveNewObjectsLH();
-
- bool authorizeAgentMessageLH(qpid::broker::Message& msg);
- void dispatchAgentCommandLH(qpid::broker::Message& msg);
-
- PackageMap::iterator findOrAddPackageLH(std::string name);
- void addClassLH(uint8_t kind,
- PackageMap::iterator pIter,
- const std::string& className,
- uint8_t* md5Sum,
- ManagementObject::writeSchemaCall_t schemaCall);
- void encodePackageIndication (framing::Buffer& buf,
- PackageMap::iterator pIter);
- void encodeClassIndication (framing::Buffer& buf,
- PackageMap::iterator pIter,
- ClassMap::iterator cIter);
- bool bankInUse (uint32_t bank);
- uint32_t allocateNewBank ();
- uint32_t assignBankLH (uint32_t requestedPrefix);
- void deleteOrphanedAgentsLH();
- void sendCommandComplete (std::string replyToKey, uint32_t sequence,
- uint32_t code = 0, std::string text = std::string("OK"));
- void handleBrokerRequestLH (framing::Buffer& inBuffer, std::string replyToKey, uint32_t sequence);
- void handlePackageQueryLH (framing::Buffer& inBuffer, std::string replyToKey, uint32_t sequence);
- void handlePackageIndLH (framing::Buffer& inBuffer, std::string replyToKey, uint32_t sequence);
- void handleClassQueryLH (framing::Buffer& inBuffer, std::string replyToKey, uint32_t sequence);
- void handleClassIndLH (framing::Buffer& inBuffer, std::string replyToKey, uint32_t sequence);
- void handleSchemaRequestLH (framing::Buffer& inBuffer, std::string replyToKey, uint32_t sequence);
- void handleSchemaResponseLH (framing::Buffer& inBuffer, std::string replyToKey, uint32_t sequence);
- void handleAttachRequestLH (framing::Buffer& inBuffer, std::string replyToKey, uint32_t sequence, const qpid::broker::ConnectionToken* connToken);
- void handleGetQueryLH (framing::Buffer& inBuffer, std::string replyToKey, uint32_t sequence);
- void handleMethodRequestLH (framing::Buffer& inBuffer, std::string replyToKey, uint32_t sequence, const qpid::broker::ConnectionToken* connToken);
-
- size_t validateSchema(framing::Buffer&, uint8_t kind);
- size_t validateTableSchema(framing::Buffer&);
- size_t validateEventSchema(framing::Buffer&);
-};
-
-}}
-
-#endif /*!_ManagementBroker_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/management/ManagementEvent.h b/M4-RCs/qpid/cpp/src/qpid/management/ManagementEvent.h
deleted file mode 100644
index 8566f31c47..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/management/ManagementEvent.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _ManagementEvent_
-#define _ManagementEvent_
-
-/*
- *
- * 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 "ManagementObject.h"
-#include <qpid/framing/Buffer.h>
-#include <string>
-
-namespace qpid {
-namespace management {
-
-class ManagementAgent;
-
-class ManagementEvent : public ManagementItem {
-public:
- typedef void (*writeSchemaCall_t)(qpid::framing::Buffer&);
- virtual ~ManagementEvent() {}
-
- virtual writeSchemaCall_t getWriteSchemaCall(void) = 0;
- virtual std::string& getEventName() const = 0;
- virtual std::string& getPackageName() const = 0;
- virtual uint8_t* getMd5Sum() const = 0;
- virtual uint8_t getSeverity() const = 0;
- virtual void encode(qpid::framing::Buffer&) const = 0;
-};
-
-}}
-
-#endif /*!_ManagementEvent_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/management/ManagementExchange.cpp b/M4-RCs/qpid/cpp/src/qpid/management/ManagementExchange.cpp
deleted file mode 100644
index 4dcafbfcdd..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/management/ManagementExchange.cpp
+++ /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.
- *
- */
-
-#include "ManagementExchange.h"
-#include "qpid/log/Statement.h"
-
-using namespace qpid::management;
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-ManagementExchange::ManagementExchange (const string& _name, Manageable* _parent) :
- Exchange (_name, _parent), TopicExchange(_name, _parent) {}
-ManagementExchange::ManagementExchange (const std::string& _name,
- bool _durable,
- const FieldTable& _args,
- Manageable* _parent) :
- Exchange (_name, _durable, _args, _parent),
- TopicExchange(_name, _durable, _args, _parent) {}
-
-void ManagementExchange::route (Deliverable& msg,
- const string& routingKey,
- const FieldTable* args)
-{
- bool routeIt = true;
-
- // Intercept management agent commands
- if ((routingKey.length() > 6 &&
- routingKey.substr(0, 6).compare("agent.") == 0) ||
- (routingKey == "broker"))
- routeIt = managementAgent->dispatchCommand(msg, routingKey, args);
-
- if (routeIt)
- TopicExchange::route(msg, routingKey, args);
-}
-
-bool ManagementExchange::bind (Queue::shared_ptr queue,
- const string& routingKey,
- const qpid::framing::FieldTable* args)
-{
- managementAgent->clientAdded(routingKey);
- return TopicExchange::bind(queue, routingKey, args);
-}
-
-void ManagementExchange::setManagmentAgent (ManagementBroker* agent)
-{
- managementAgent = agent;
-}
-
-
-ManagementExchange::~ManagementExchange() {}
-
-const std::string ManagementExchange::typeName("management");
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/management/ManagementExchange.h b/M4-RCs/qpid/cpp/src/qpid/management/ManagementExchange.h
deleted file mode 100644
index d54db1a74e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/management/ManagementExchange.h
+++ /dev/null
@@ -1,62 +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.
- *
- */
-#ifndef _ManagementExchange_
-#define _ManagementExchange_
-
-#include "qpid/broker/TopicExchange.h"
-#include "ManagementBroker.h"
-
-namespace qpid {
-namespace broker {
-
-class ManagementExchange : public virtual TopicExchange
-{
- private:
- management::ManagementBroker* managementAgent;
-
- public:
- static const std::string typeName;
-
- ManagementExchange (const string& name, Manageable* _parent = 0);
- ManagementExchange (const string& _name, bool _durable,
- const qpid::framing::FieldTable& _args,
- Manageable* _parent = 0);
-
- virtual std::string getType() const { return typeName; }
-
- virtual void route (Deliverable& msg,
- const string& routingKey,
- const qpid::framing::FieldTable* args);
-
- virtual bool bind (Queue::shared_ptr queue,
- const string& routingKey,
- const qpid::framing::FieldTable* args);
-
- void setManagmentAgent (management::ManagementBroker* agent);
-
- virtual ~ManagementExchange();
-};
-
-
-}
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/management/ManagementObject.cpp b/M4-RCs/qpid/cpp/src/qpid/management/ManagementObject.cpp
deleted file mode 100644
index f4c45de126..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/management/ManagementObject.cpp
+++ /dev/null
@@ -1,183 +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 "Manageable.h"
-#include "ManagementObject.h"
-#include "qpid/agent/ManagementAgent.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/sys/Thread.h"
-
-#include <stdlib.h>
-
-using namespace qpid;
-using namespace qpid::management;
-
-void AgentAttachment::setBanks(uint32_t broker, uint32_t bank)
-{
- first =
- ((uint64_t) (broker & 0x000fffff)) << 28 |
- ((uint64_t) (bank & 0x0fffffff));
-}
-
-ObjectId::ObjectId(uint8_t flags, uint16_t seq, uint32_t broker, uint32_t bank, uint64_t object)
- : agent(0)
-{
- first =
- ((uint64_t) (flags & 0x0f)) << 60 |
- ((uint64_t) (seq & 0x0fff)) << 48 |
- ((uint64_t) (broker & 0x000fffff)) << 28 |
- ((uint64_t) (bank & 0x0fffffff));
- second = object;
-}
-
-ObjectId::ObjectId(AgentAttachment* _agent, uint8_t flags, uint16_t seq, uint64_t object)
- : agent(_agent)
-{
- first =
- ((uint64_t) (flags & 0x0f)) << 60 |
- ((uint64_t) (seq & 0x0fff)) << 48;
- second = object;
-}
-
-ObjectId::ObjectId(std::istream& in) : agent(0)
-{
- std::string text;
- in >> text;
- fromString(text);
-}
-
-ObjectId::ObjectId(const std::string& text) : agent(0)
-{
- fromString(text);
-}
-
-void ObjectId::fromString(const std::string& text)
-{
-#define FIELDS 5
-#if defined (_WIN32) && !defined (atoll)
-# define atoll(X) _atoi64(X)
-#endif
-
- std::string copy(text.c_str());
- char* cText;
- char* field[FIELDS];
- bool atFieldStart = true;
- int idx = 0;
-
- cText = const_cast<char*>(copy.c_str());
- for (char* cursor = cText; *cursor; cursor++) {
- if (atFieldStart) {
- if (idx >= FIELDS)
- throw Exception("Invalid ObjectId format");
- field[idx++] = cursor;
- atFieldStart = false;
- } else {
- if (*cursor == '-') {
- *cursor = '\0';
- atFieldStart = true;
- }
- }
- }
-
- if (idx != FIELDS)
- throw Exception("Invalid ObjectId format");
-
- first = (atoll(field[0]) << 60) +
- (atoll(field[1]) << 48) +
- (atoll(field[2]) << 28) +
- atoll(field[3]);
- second = atoll(field[4]);
-}
-
-
-bool ObjectId::operator==(const ObjectId &other) const
-{
- uint64_t otherFirst = agent == 0 ? other.first : other.first & 0xffff000000000000LL;
-
- return first == otherFirst && second == other.second;
-}
-
-bool ObjectId::operator<(const ObjectId &other) const
-{
- uint64_t otherFirst = agent == 0 ? other.first : other.first & 0xffff000000000000LL;
-
- return (first < otherFirst) || ((first == otherFirst) && (second < other.second));
-}
-
-void ObjectId::encode(framing::Buffer& buffer)
-{
- if (agent == 0)
- buffer.putLongLong(first);
- else
- buffer.putLongLong(first | agent->first);
- buffer.putLongLong(second);
-}
-
-void ObjectId::decode(framing::Buffer& buffer)
-{
- first = buffer.getLongLong();
- second = buffer.getLongLong();
-}
-
-namespace qpid {
-namespace management {
-
-std::ostream& operator<<(std::ostream& out, const ObjectId& i)
-{
- uint64_t virtFirst = i.first;
- if (i.agent)
- virtFirst |= i.agent->getFirst();
-
- out << ((virtFirst & 0xF000000000000000LL) >> 60) <<
- "-" << ((virtFirst & 0x0FFF000000000000LL) >> 48) <<
- "-" << ((virtFirst & 0x0000FFFFF0000000LL) >> 28) <<
- "-" << (virtFirst & 0x000000000FFFFFFFLL) <<
- "-" << i.second;
- return out;
-}
-
-}}
-
-int ManagementObject::nextThreadIndex = 0;
-
-void ManagementObject::writeTimestamps (framing::Buffer& buf)
-{
- buf.putShortString (getPackageName ());
- buf.putShortString (getClassName ());
- buf.putBin128 (getMd5Sum ());
- buf.putLongLong (updateTime);
- buf.putLongLong (createTime);
- buf.putLongLong (destroyTime);
- objectId.encode(buf);
-}
-
-void ManagementObject::setReference(ObjectId) {}
-
-int ManagementObject::getThreadIndex() {
- static QPID_TSS int thisIndex = -1;
- if (thisIndex == -1) {
- sys::Mutex::ScopedLock mutex(accessLock);
- thisIndex = nextThreadIndex;
- if (nextThreadIndex < agent->getMaxThreads() - 1)
- nextThreadIndex++;
- }
- return thisIndex;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/management/ManagementObject.h b/M4-RCs/qpid/cpp/src/qpid/management/ManagementObject.h
deleted file mode 100644
index fbdad347b8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/management/ManagementObject.h
+++ /dev/null
@@ -1,188 +0,0 @@
-#ifndef _ManagementObject_
-#define _ManagementObject_
-
-/*
- *
- * 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 "qpid/sys/Time.h"
-#include "qpid/sys/Mutex.h"
-#include <qpid/framing/Buffer.h>
-#include <map>
-
-namespace qpid {
-namespace management {
-
-class Manageable;
-class ManagementAgent;
-class ObjectId;
-
-
-class AgentAttachment {
- friend class ObjectId;
-private:
- uint64_t first;
-public:
- AgentAttachment() : first(0) {}
- void setBanks(uint32_t broker, uint32_t bank);
- uint64_t getFirst() const { return first; }
-};
-
-
-class ObjectId {
-protected:
- const AgentAttachment* agent;
- uint64_t first;
- uint64_t second;
- void fromString(const std::string&);
-public:
- ObjectId() : agent(0), first(0), second(0) {}
- ObjectId(framing::Buffer& buf) : agent(0) { decode(buf); }
- ObjectId(uint8_t flags, uint16_t seq, uint32_t broker, uint32_t bank, uint64_t object);
- ObjectId(AgentAttachment* _agent, uint8_t flags, uint16_t seq, uint64_t object);
- ObjectId(std::istream&);
- ObjectId(const std::string&);
- bool operator==(const ObjectId &other) const;
- bool operator<(const ObjectId &other) const;
- void encode(framing::Buffer& buffer);
- void decode(framing::Buffer& buffer);
- friend std::ostream& operator<<(std::ostream&, const ObjectId&);
-};
-
-class ManagementItem {
-public:
- static const uint8_t TYPE_U8 = 1;
- static const uint8_t TYPE_U16 = 2;
- static const uint8_t TYPE_U32 = 3;
- static const uint8_t TYPE_U64 = 4;
- static const uint8_t TYPE_SSTR = 6;
- static const uint8_t TYPE_LSTR = 7;
- static const uint8_t TYPE_ABSTIME = 8;
- static const uint8_t TYPE_DELTATIME = 9;
- static const uint8_t TYPE_REF = 10;
- static const uint8_t TYPE_BOOL = 11;
- static const uint8_t TYPE_FLOAT = 12;
- static const uint8_t TYPE_DOUBLE = 13;
- static const uint8_t TYPE_UUID = 14;
- static const uint8_t TYPE_FTABLE = 15;
- static const uint8_t TYPE_S8 = 16;
- static const uint8_t TYPE_S16 = 17;
- static const uint8_t TYPE_S32 = 18;
- static const uint8_t TYPE_S64 = 19;
-
- static const uint8_t ACCESS_RC = 1;
- static const uint8_t ACCESS_RW = 2;
- static const uint8_t ACCESS_RO = 3;
-
- static const uint8_t DIR_I = 1;
- static const uint8_t DIR_O = 2;
- static const uint8_t DIR_IO = 3;
-
- static const uint8_t FLAG_CONFIG = 0x01;
- static const uint8_t FLAG_INDEX = 0x02;
- static const uint8_t FLAG_END = 0x80;
-
- const static uint8_t CLASS_KIND_TABLE = 1;
- const static uint8_t CLASS_KIND_EVENT = 2;
-
-
-
-public:
- virtual ~ManagementItem() {}
-};
-
-class ManagementObject : public ManagementItem
-{
- protected:
-
- uint64_t createTime;
- uint64_t destroyTime;
- uint64_t updateTime;
- ObjectId objectId;
- bool configChanged;
- bool instChanged;
- bool deleted;
- Manageable* coreObject;
- sys::Mutex accessLock;
- ManagementAgent* agent;
- int maxThreads;
- uint32_t flags;
-
- static int nextThreadIndex;
- bool forcePublish;
-
- int getThreadIndex();
- void writeTimestamps(qpid::framing::Buffer& buf);
-
- public:
- typedef void (*writeSchemaCall_t) (qpid::framing::Buffer&);
-
- ManagementObject(ManagementAgent* _agent, Manageable* _core) :
- createTime(uint64_t(qpid::sys::Duration(qpid::sys::now()))),
- destroyTime(0), updateTime(createTime), configChanged(true),
- instChanged(true), deleted(false),
- coreObject(_core), agent(_agent), forcePublish(false) {}
- virtual ~ManagementObject() {}
-
- virtual writeSchemaCall_t getWriteSchemaCall() = 0;
- virtual void writeProperties(qpid::framing::Buffer& buf) = 0;
- virtual void writeStatistics(qpid::framing::Buffer& buf,
- bool skipHeaders = false) = 0;
- virtual void doMethod(std::string& methodName,
- qpid::framing::Buffer& inBuf,
- qpid::framing::Buffer& outBuf) = 0;
- virtual void setReference(ObjectId objectId);
-
- virtual std::string& getClassName() const = 0;
- virtual std::string& getPackageName() const = 0;
- virtual uint8_t* getMd5Sum() const = 0;
-
- void setObjectId(ObjectId oid) { objectId = oid; }
- ObjectId getObjectId() { return objectId; }
- inline bool getConfigChanged() { return configChanged; }
- virtual bool getInstChanged() { return instChanged; }
- virtual bool hasInst() { return true; }
- inline void setForcePublish(bool f) { forcePublish = f; }
- inline bool getForcePublish() { return forcePublish; }
- inline void setUpdateTime() { updateTime = (uint64_t(sys::Duration(sys::now()))); }
-
- inline void resourceDestroy() {
- destroyTime = uint64_t (qpid::sys::Duration(qpid::sys::now()));
- deleted = true;
- }
- inline bool isDeleted() { return deleted; }
- inline void setFlags(uint32_t f) { flags = f; }
- inline uint32_t getFlags() { return flags; }
- bool isSameClass(ManagementObject& other) {
- for (int idx = 0; idx < 16; idx++)
- if (other.getMd5Sum()[idx] != getMd5Sum()[idx])
- return false;
- return other.getClassName() == getClassName() &&
- other.getPackageName() == getPackageName();
- }
-};
-
-typedef std::map<ObjectId, ManagementObject*> ManagementObjectMap;
-
-}}
-
-
-
-#endif /*!_ManagementObject_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/memory.h b/M4-RCs/qpid/cpp/src/qpid/memory.h
deleted file mode 100644
index 99d7a71e7b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/memory.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef QPID_AUTO_PTR_H
-#define QPID_AUTO_PTR_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <memory>
-namespace qpid {
-/** Convenient template for creating auto_ptr in-place in an argument list. */
-template <class T>
-std::auto_ptr<T> make_auto_ptr(T* ptr) { return std::auto_ptr<T>(ptr); }
-
-} // namespace qpid
-
-
-
-#endif /*!QPID_AUTO_PTR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/pointer_to_other.h b/M4-RCs/qpid/cpp/src/qpid/pointer_to_other.h
deleted file mode 100644
index a99dc89658..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/pointer_to_other.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef QPID_POINTERTOOTHER_H
-#define QPID_POINTERTOOTHER_H
-
-/*
- * 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 qpid {
-
-// Defines the same pointer type (raw or smart) to another pointee type
-
-template<class T, class U>
-struct pointer_to_other;
-
-template<class T, class U,
- template<class> class Sp>
-struct pointer_to_other< Sp<T>, U >
- {
- typedef Sp<U> type;
- };
-
-template<class T, class T2, class U,
- template<class, class> class Sp>
-struct pointer_to_other< Sp<T, T2>, U >
- {
- typedef Sp<U, T2> type;
- };
-
-template<class T, class T2, class T3, class U,
- template<class, class, class> class Sp>
-struct pointer_to_other< Sp<T, T2, T3>, U >
- {
- typedef Sp<U, T2, T3> type;
- };
-
-template<class T, class U>
-struct pointer_to_other< T*, U >
-{
- typedef U* type;
-};
-
-} // namespace qpid
-
-
-
-#endif /*!QPID_POINTERTOOTHER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/ptr_map.h b/M4-RCs/qpid/cpp/src/qpid/ptr_map.h
deleted file mode 100644
index 6ffcd48e89..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/ptr_map.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#ifndef QPID_PTR_MAP
-#define QPID_PTR_MAP
-
-/*
- *
- * 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 <boost/ptr_container/ptr_map.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/remove_const.hpp>
-
-namespace qpid {
-
-/** @file
- * Workaround for API change between boost 1.33 and 1.34.
- *
- * To be portable across these versions, code using boost::ptr_map
- * iterators should use ptr_map_ptr(i) to get the pointer from
- * boost::ptr_map::iterator i.
- *
- * @see http://www.boost.org/libs/ptr_container/doc/ptr_container.html#upgrading-from-boost-v-1-33
- */
-
-
-typedef boost::is_same<boost::ptr_map<int, int>::iterator::value_type, int> IsOldPtrMap;
-
-template <class Iter>
-typename boost::enable_if<IsOldPtrMap, typename Iter::value_type*>::type
-ptr_map_ptr(const Iter& i) { return &*i; }
-
-template <class Iter>
-typename boost::disable_if<IsOldPtrMap,
- typename boost::remove_const<typename Iter::value_type::second_type>::type
- >::type
-ptr_map_ptr(const Iter& i) { return i->second; }
-
-} // namespace qpid
-
-#endif /*!QPID_PTR_MAP*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/shared_ptr.h b/M4-RCs/qpid/cpp/src/qpid/shared_ptr.h
deleted file mode 100644
index 0c933ea6a6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/shared_ptr.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef _common_shared_ptr_h
-#define _common_shared_ptr_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <boost/shared_ptr.hpp>
-#include <boost/cast.hpp>
-
-namespace qpid {
-
-// Import shared_ptr definitions into qpid namespace and define some
-// useful shared_ptr templates for convenience.
-
-using boost::shared_ptr;
-using boost::dynamic_pointer_cast;
-using boost::static_pointer_cast;
-using boost::const_pointer_cast;
-using boost::shared_polymorphic_downcast;
-
-template <class T> shared_ptr<T> make_shared_ptr(T* ptr) {
- return shared_ptr<T>(ptr);
-}
-
-template <class T, class D>
-shared_ptr<T> make_shared_ptr(T* ptr, D deleter) {
- return shared_ptr<T>(ptr, deleter);
-}
-
-inline void nullDeleter(void const *) {}
-
-} // namespace qpid
-
-
-
-#endif /*!_common_shared_ptr_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ActivityTimer.h b/M4-RCs/qpid/cpp/src/qpid/sys/ActivityTimer.h
deleted file mode 100644
index d49e16bc4f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ActivityTimer.h
+++ /dev/null
@@ -1,106 +0,0 @@
-#ifndef QPID_SYS_ACTIVITYTIMER_H
-#define QPID_SYS_ACTIVITYTIMER_H
-
-/*
- *
- * 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 "qpid/sys/Time.h"
-#include "qpid/sys/Thread.h"
-#include <boost/current_function.hpp>
-#include <stdio.h>
-
-namespace qpid {
-namespace sys {
-
-/**
- * Measures and reports time spent in a particular segment of code.
- * This is real time so it includes time blocked/sleeping as well as time on CPU.
- *
- * Intended to be used via the QPID_ACTIVITY_TIMER macro for profiling
- * during development & debugging
- */
-class ActivityTimer
-{
- public:
-
- struct Stat { // Must be a POD
- uint64_t total, count;
- void sample(uint64_t value) { total += value; ++count; }
- uint64_t mean() { return count ? total/count : 0; }
- void reset() { total = count = 0; }
- };
-
- struct Data { // Must be a POD
- uint64_t start, entered;
- Stat active;
-
- void reset() {
- start = entered = 0;
- active.reset();
- }
-
- void enter(uint64_t now) {
- entered=now;
- if (!start) start = Duration(now);
- }
-
- void exit(uint64_t now) {
- active.sample(now - entered);
- }
- };
-
- ActivityTimer(Data& d, const char* fn, const char* file, int line, uint64_t reportInterval) : data(d) {
- uint64_t now = Duration(qpid::sys::now());
- if (data.start) {
- interval = now-data.start;
- if (interval > reportInterval)
- report(fn, file, line);
- }
- data.enter(now);
- }
-
- ~ActivityTimer() {
- data.exit(Duration(now()));
- }
-
- private:
- Data& data;
- uint64_t interval;
-
- void report(const char* fn, const char* file, int line) {
- long rate = (data.active.count*TIME_SEC)/interval;
- double percent = (data.active.total*100.0)/interval;
- printf("%s:%d: TIMER %ld/sec %f%% [%lu] %s\n",
- file, line, rate, percent, Thread::current().id(), fn);
- data.reset();
- }
-};
-
-}} // namespace qpid::sys
-
-/** Measures time between the point of declaration and the end of the innermost enclosing scope.
- * Can only have one in a given scope.
- */
-#define ACTIVITY_TIMER(REPORT_INTERVAL_SECS) \
- static __thread ::qpid::sys::ActivityTimer::Data qpid__ActivityTimerData__ = { 0, 0, { 0,0 }}; \
- ::qpid::sys::ActivityTimer qpid__ActivityTimerInstance__(qpid__ActivityTimerData__, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__, 2*::qpid::sys::TIME_SEC)
-
-#endif /*!QPID_SYS_ACTIVITYTIMER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/AggregateOutput.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/AggregateOutput.cpp
deleted file mode 100644
index fa6901d3e4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/AggregateOutput.cpp
+++ /dev/null
@@ -1,73 +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 "qpid/sys/AggregateOutput.h"
-#include "qpid/log/Statement.h"
-#include <algorithm>
-
-namespace qpid {
-namespace sys {
-
-void AggregateOutput::activateOutput() { control.activateOutput(); }
-
-void AggregateOutput::giveReadCredit(int32_t credit) { control.giveReadCredit(credit); }
-
-bool AggregateOutput::hasOutput() {
- for (TaskList::const_iterator i = tasks.begin(); i != tasks.end(); ++i)
- if ((*i)->hasOutput()) return true;
- return false;
-}
-
-bool AggregateOutput::doOutput()
-{
- bool result = false;
- if (!tasks.empty()) {
- if (next >= tasks.size()) next = next % tasks.size();
-
- size_t start = next;
- //loop until a task generated some output
- while (!result) {
- result = tasks[next++]->doOutput();
- if (tasks.empty()) break;
- if (next >= tasks.size()) next = next % tasks.size();
- if (start == next) break;
- }
- }
- return result;
-}
-
-void AggregateOutput::addOutputTask(OutputTask* t)
-{
- tasks.push_back(t);
-}
-
-void AggregateOutput::removeOutputTask(OutputTask* t)
-{
- TaskList::iterator i = std::find(tasks.begin(), tasks.end(), t);
- if (i != tasks.end()) tasks.erase(i);
-}
-
-void AggregateOutput::removeAll()
-{
- tasks.clear();
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/AggregateOutput.h b/M4-RCs/qpid/cpp/src/qpid/sys/AggregateOutput.h
deleted file mode 100644
index 1cda4456b4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/AggregateOutput.h
+++ /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.
- *
- */
-#ifndef _AggregateOutput_
-#define _AggregateOutput_
-
-#include "Mutex.h"
-#include "OutputControl.h"
-#include "OutputTask.h"
-
-#include <algorithm>
-#include <vector>
-
-namespace qpid {
-namespace sys {
-
- class AggregateOutput : public OutputTask, public OutputControl
- {
- typedef std::vector<OutputTask*> TaskList;
-
- TaskList tasks;
- size_t next;
- OutputControl& control;
-
- public:
- AggregateOutput(OutputControl& c) : next(0), control(c) {};
- //this may be called on any thread
- void activateOutput();
- void giveReadCredit(int32_t);
-
- //all the following will be called on the same thread
- bool doOutput();
- bool hasOutput();
- void addOutputTask(OutputTask* t);
- void removeOutputTask(OutputTask* t);
- void removeAll();
-
- /** Apply f to each OutputTask* in the tasks list */
- template <class F> void eachOutput(F f) {
- std::for_each(tasks.begin(), tasks.end(), f);
- }
- };
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/AsynchIO.h b/M4-RCs/qpid/cpp/src/qpid/sys/AsynchIO.h
deleted file mode 100644
index 68e441349a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/AsynchIO.h
+++ /dev/null
@@ -1,152 +0,0 @@
-#ifndef _sys_AsynchIO
-#define _sys_AsynchIO
-/*
- *
- * 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: TAKE THIS OUT... SHould be in posix version.
-#include "DispatchHandle.h"
-
-#include <boost/function.hpp>
-#include <deque>
-
-namespace qpid {
-namespace sys {
-
-class Socket;
-
-/*
- * Asynchronous acceptor: accepts connections then does a callback with the
- * accepted fd
- */
-class AsynchAcceptorPrivate;
-class AsynchAcceptor {
-public:
- typedef boost::function1<void, const Socket&> Callback;
-
-private:
- AsynchAcceptorPrivate* impl;
-
-public:
- AsynchAcceptor(const Socket& s, Callback callback);
- ~AsynchAcceptor();
- void start(Poller::shared_ptr poller);
-};
-
-/*
- * Asynchronous connector: starts the process of initiating a connection and
- * invokes a callback when completed or failed.
- */
-class AsynchConnector {
-public:
- typedef boost::function1<void, const Socket&> ConnectedCallback;
- typedef boost::function2<void, int, std::string> FailedCallback;
-
- // Call create() to allocate a new AsynchConnector object with the
- // specified poller, addressing, and callbacks.
- // This method is implemented in platform-specific code to
- // create a correctly typed object. The platform code also manages
- // deletes. To correctly manage heaps when needed, the allocate and
- // delete should both be done from the same class/library.
- static AsynchConnector* create(const Socket& s,
- Poller::shared_ptr poller,
- std::string hostname,
- uint16_t port,
- ConnectedCallback connCb,
- FailedCallback failCb = 0);
-
-protected:
- AsynchConnector() {}
- virtual ~AsynchConnector() {}
-};
-
-struct AsynchIOBufferBase {
- char* const bytes;
- const int32_t byteCount;
- int32_t dataStart;
- int32_t dataCount;
-
- AsynchIOBufferBase(char* const b, const int32_t s) :
- bytes(b),
- byteCount(s),
- dataStart(0),
- dataCount(0)
- {}
-
- virtual ~AsynchIOBufferBase()
- {}
-};
-
-/*
- * Asychronous reader/writer:
- * Reader accepts buffers to read into; reads into the provided buffers
- * and then does a callback with the buffer and amount read. Optionally it
- * can callback when there is something to read but no buffer to read it into.
- *
- * Writer accepts a buffer and queues it for writing; can also be given
- * a callback for when writing is "idle" (ie fd is writable, but nothing
- * to write).
- */
-class AsynchIO {
-public:
- typedef AsynchIOBufferBase BufferBase;
-
- typedef boost::function2<bool, AsynchIO&, BufferBase*> ReadCallback;
- typedef boost::function1<void, AsynchIO&> EofCallback;
- typedef boost::function1<void, AsynchIO&> DisconnectCallback;
- typedef boost::function2<void, AsynchIO&, const Socket&> ClosedCallback;
- typedef boost::function1<void, AsynchIO&> BuffersEmptyCallback;
- typedef boost::function1<void, AsynchIO&> IdleCallback;
-
- // Call create() to allocate a new AsynchIO object with the specified
- // callbacks. This method is implemented in platform-specific code to
- // create a correctly typed object. The platform code also manages
- // deletes. To correctly manage heaps when needed, the allocate and
- // delete should both be done from the same class/library.
- static AsynchIO* create(const Socket& s,
- ReadCallback rCb,
- EofCallback eofCb,
- DisconnectCallback disCb,
- ClosedCallback cCb = 0,
- BuffersEmptyCallback eCb = 0,
- IdleCallback iCb = 0);
-public:
- virtual void queueForDeletion() = 0;
-
- virtual void start(Poller::shared_ptr poller) = 0;
- virtual void queueReadBuffer(BufferBase* buff) = 0;
- virtual void unread(BufferBase* buff) = 0;
- virtual void queueWrite(BufferBase* buff) = 0;
- virtual void notifyPendingWrite() = 0;
- virtual void queueWriteClose() = 0;
- virtual bool writeQueueEmpty() = 0;
- virtual void startReading() = 0;
- virtual BufferBase* getQueuedBuffer() = 0;
-
-protected:
- // Derived class manages lifetime; must be constructed using the
- // static create() method. Deletes not allowed from outside.
- AsynchIO() {}
- virtual ~AsynchIO() {}
-};
-
-}}
-
-#endif // _sys_AsynchIO
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp
deleted file mode 100644
index 83b6329889..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/AsynchIOHandler.cpp
+++ /dev/null
@@ -1,199 +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 "AsynchIOHandler.h"
-#include "qpid/sys/AsynchIO.h"
-#include "qpid/sys/Socket.h"
-#include "qpid/framing/AMQP_HighestVersion.h"
-#include "qpid/framing/ProtocolInitiation.h"
-#include "qpid/log/Statement.h"
-
-namespace qpid {
-namespace sys {
-
-// Buffer definition
-struct Buff : public AsynchIO::BufferBase {
- Buff() :
- AsynchIO::BufferBase(new char[65536], 65536)
- {}
- ~Buff()
- { delete [] bytes;}
-};
-
-AsynchIOHandler::AsynchIOHandler(std::string id, ConnectionCodec::Factory* f) :
- identifier(id),
- aio(0),
- factory(f),
- codec(0),
- readError(false),
- isClient(false),
- readCredit(InfiniteCredit)
-{}
-
-AsynchIOHandler::~AsynchIOHandler() {
- if (codec)
- codec->closed();
- delete codec;
-}
-
-void AsynchIOHandler::init(AsynchIO* a, int numBuffs) {
- aio = a;
-
- // Give connection some buffers to use
- for (int i = 0; i < numBuffs; i++) {
- aio->queueReadBuffer(new Buff);
- }
-}
-
-void AsynchIOHandler::write(const framing::ProtocolInitiation& data)
-{
- QPID_LOG(debug, "SENT [" << identifier << "] INIT(" << data << ")");
- AsynchIO::BufferBase* buff = aio->getQueuedBuffer();
- if (!buff)
- buff = new Buff;
- framing::Buffer out(buff->bytes, buff->byteCount);
- data.encode(out);
- buff->dataCount = data.encodedSize();
- aio->queueWrite(buff);
-}
-
-void AsynchIOHandler::activateOutput() {
- aio->notifyPendingWrite();
-}
-
-// Input side
-void AsynchIOHandler::giveReadCredit(int32_t credit) {
- // Check whether we started in the don't about credit state
- if (readCredit.boolCompareAndSwap(InfiniteCredit, credit))
- return;
- else if (readCredit.fetchAndAdd(credit) != 0)
- return;
- // Lock and retest credit to make sure we don't race with decreasing credit
- ScopedLock<Mutex> l(creditLock);
- assert(readCredit.get() >= 0);
- if (readCredit.get() != 0)
- aio->startReading();
-}
-
-bool AsynchIOHandler::readbuff(AsynchIO& , AsynchIO::BufferBase* buff) {
- if (readError) {
- return false;
- }
- size_t decoded = 0;
- if (codec) { // Already initiated
- try {
- decoded = codec->decode(buff->bytes+buff->dataStart, buff->dataCount);
- }catch(const std::exception& e){
- QPID_LOG(error, e.what());
- readError = true;
- aio->queueWriteClose();
- }
- }else{
- framing::Buffer in(buff->bytes+buff->dataStart, buff->dataCount);
- framing::ProtocolInitiation protocolInit;
- if (protocolInit.decode(in)) {
- decoded = in.getPosition();
- QPID_LOG(debug, "RECV [" << identifier << "] INIT(" << protocolInit << ")");
- try {
- codec = factory->create(protocolInit.getVersion(), *this, identifier);
- if (!codec) {
- //TODO: may still want to revise this...
- //send valid version header & close connection.
- write(framing::ProtocolInitiation(framing::highestProtocolVersion));
- readError = true;
- aio->queueWriteClose();
- }
- } catch (const std::exception& e) {
- QPID_LOG(error, e.what());
- readError = true;
- aio->queueWriteClose();
- }
- }
- }
- // TODO: unreading needs to go away, and when we can cope
- // with multiple sub-buffers in the general buffer scheme, it will
- if (decoded != size_t(buff->dataCount)) {
- // Adjust buffer for used bytes and then "unread them"
- buff->dataStart += decoded;
- buff->dataCount -= decoded;
- aio->unread(buff);
- } else {
- // Give whole buffer back to aio subsystem
- aio->queueReadBuffer(buff);
- }
- // Check here for read credit
- if (readCredit.get() != InfiniteCredit) {
- if (--readCredit == 0) {
- // Lock and retest credit to make sure we don't race with increasing credit
- ScopedLock<Mutex> l(creditLock);
- assert(readCredit.get() >= 0);
- if (readCredit.get() == 0)
- return false;
- }
- }
- return true;
-}
-
-void AsynchIOHandler::eof(AsynchIO&) {
- QPID_LOG(debug, "DISCONNECTED [" << identifier << "]");
- if (codec) codec->closed();
- aio->queueWriteClose();
-}
-
-void AsynchIOHandler::closedSocket(AsynchIO&, const Socket& s) {
- // If we closed with data still to send log a warning
- if (!aio->writeQueueEmpty()) {
- QPID_LOG(warning, "CLOSING [" << identifier << "] unsent data (probably due to client disconnect)");
- }
- delete &s;
- aio->queueForDeletion();
- delete this;
-}
-
-void AsynchIOHandler::disconnect(AsynchIO& a) {
- // treat the same as eof
- eof(a);
-}
-
-// Notifications
-void AsynchIOHandler::nobuffs(AsynchIO&) {
-}
-
-void AsynchIOHandler::idle(AsynchIO&){
- if (isClient && codec == 0) {
- codec = factory->create(*this, identifier);
- write(framing::ProtocolInitiation(codec->getVersion()));
- return;
- }
- if (codec == 0) return;
- if (codec->canEncode()) {
- // Try and get a queued buffer if not then construct new one
- AsynchIO::BufferBase* buff = aio->getQueuedBuffer();
- if (!buff) buff = new Buff;
- size_t encoded=codec->encode(buff->bytes, buff->byteCount);
- buff->dataCount = encoded;
- aio->queueWrite(buff);
- }
- if (codec->isClosed())
- aio->queueWriteClose();
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/AsynchIOHandler.h b/M4-RCs/qpid/cpp/src/qpid/sys/AsynchIOHandler.h
deleted file mode 100644
index fa020fbce4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/AsynchIOHandler.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef _sys_AsynchIOHandler_h
-#define _sys_AsynchIOHandler_h
-/*
- *
- * 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 "OutputControl.h"
-#include "ConnectionCodec.h"
-#include "AtomicValue.h"
-#include "Mutex.h"
-
-namespace qpid {
-
-namespace framing {
- class ProtocolInitiation;
-}
-
-namespace sys {
-
-class AsynchIO;
-struct AsynchIOBufferBase;
-class Socket;
-
-class AsynchIOHandler : public OutputControl {
- std::string identifier;
- AsynchIO* aio;
- ConnectionCodec::Factory* factory;
- ConnectionCodec* codec;
- bool readError;
- bool isClient;
- AtomicValue<int32_t> readCredit;
- static const int32_t InfiniteCredit = -1;
- Mutex creditLock;
-
- void write(const framing::ProtocolInitiation&);
-
- public:
- AsynchIOHandler(std::string id, ConnectionCodec::Factory* f);
- ~AsynchIOHandler();
- void init(AsynchIO* a, int numBuffs);
-
- void setClient() { isClient = true; }
-
- // Output side
- void close();
- void activateOutput();
- void giveReadCredit(int32_t credit);
-
- // Input side
- bool readbuff(AsynchIO& aio, AsynchIOBufferBase* buff);
- void eof(AsynchIO& aio);
- void disconnect(AsynchIO& aio);
-
- // Notifications
- void nobuffs(AsynchIO& aio);
- void idle(AsynchIO& aio);
- void closedSocket(AsynchIO& aio, const Socket& s);
-};
-
-}} // namespace qpid::sys
-
-#endif // _sys_AsynchIOHandler_h
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/AtomicCount.h b/M4-RCs/qpid/cpp/src/qpid/sys/AtomicCount.h
deleted file mode 100644
index d598b49427..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/AtomicCount.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef _posix_AtomicCount_h
-#define _posix_AtomicCount_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <boost/detail/atomic_count.hpp>
-#include "ScopedIncrement.h"
-
-namespace qpid {
-namespace sys {
-
-/**
- * Atomic counter.
- */
-class AtomicCount {
- public:
- typedef ::qpid::sys::ScopedDecrement<AtomicCount> ScopedDecrement;
- typedef ::qpid::sys::ScopedIncrement<AtomicCount> ScopedIncrement;
-
- AtomicCount(long value = 0) : count(value) {}
-
- void operator++() { ++count ; }
-
- long operator--() { return --count; }
-
- operator long() const { return count; }
-
- private:
- boost::detail::atomic_count count;
-};
-
-
-}}
-
-
-#endif // _posix_AtomicCount_h
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue.h b/M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue.h
deleted file mode 100644
index 6e90eafead..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef QPID_SYS_ATOMICVALUE_H
-#define QPID_SYS_ATOMICVALUE_H
-
-/*
- *
- * 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.
- *
- */
-
-#if defined( __GNUC__ ) && __GNUC__ >= 4 && ( defined( __i686__ ) || defined( __x86_64__ ) )
-// Use the Gnu C built-in atomic operations if compiling with gcc on a suitable platform.
-#include "qpid/sys/AtomicValue_gcc.h"
-
-#else
-// Fall-back to mutex locked operations if we don't have atomic ops.
-#include "qpid/sys/AtomicValue_mutex.h"
-#endif
-
-#endif /*!QPID_SYS_ATOMICVALUE_GCC_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue_gcc.h b/M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue_gcc.h
deleted file mode 100644
index d022b07c1d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue_gcc.h
+++ /dev/null
@@ -1,68 +0,0 @@
-#ifndef QPID_SYS_ATOMICVALUE_GCC_H
-#define QPID_SYS_ATOMICVALUE_GCC_H
-
-/*
- *
- * 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.
- *
- */
-
-#if !defined(QPID_SYS_ATOMICVALUE_H)
-#error "This file should only be included via AtomicValue.h."
-#endif
-
-namespace qpid {
-namespace sys {
-
-/**
- * Atomic value of type T. T must be an integral type of size 1,2,4 or 8 bytes.
- * All operations are atomic and preform a full memory barrier unless otherwise noted.
- */
-template <class T>
-class AtomicValue
-{
- public:
- AtomicValue(T init=0) : value(init) {}
-
- // Update and return new value.
- inline T operator+=(T n) { return __sync_add_and_fetch(&value, n); }
- inline T operator-=(T n) { return __sync_sub_and_fetch(&value, n); }
- inline T operator++() { return *this += 1; }
- inline T operator--() { return *this -= 1; }
-
- // Update and return old value.
- inline T fetchAndAdd(T n) { return __sync_fetch_and_add(&value, n); }
- inline T fetchAndSub(T n) { return __sync_fetch_and_sub(&value, n); }
- inline T operator++(int) { return fetchAndAdd(1); }
- inline T operator--(int) { return fetchAndSub(1); }
-
- /** If current value == testval then set to newval. Returns the old value. */
- T valueCompareAndSwap(T testval, T newval) { return __sync_val_compare_and_swap(&value, testval, newval); }
-
- /** If current value == testval then set to newval. Returns true if the swap was performed. */
- bool boolCompareAndSwap(T testval, T newval) { return __sync_bool_compare_and_swap(&value, testval, newval); }
-
- T get() const { return const_cast<AtomicValue<T>*>(this)->fetchAndAdd(static_cast<T>(0)); }
-
- private:
- T value;
-};
-
-}} // namespace qpid::sys
-
-#endif /*!QPID_SYS_ATOMICVALUE_GCC_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue_mutex.h b/M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue_mutex.h
deleted file mode 100644
index e4d433e7f5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/AtomicValue_mutex.h
+++ /dev/null
@@ -1,83 +0,0 @@
-#ifndef QPID_SYS_ATOMICVALUE_MUTEX_H
-#define QPID_SYS_ATOMICVALUE_MUTEX_H
-
-/*
- *
- * 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.
- *
- */
-
-#if !defined(QPID_SYS_ATOMICVALUE_H)
-#error "This file should only be included via AtomicValue.h."
-#endif
-
-#include "qpid/sys/Mutex.h"
-
-namespace qpid {
-namespace sys {
-
-/**
- * Atomic value of type T. T must be an integral type of size 1,2,4 or 8 bytes.
- * All operations are atomic and preform a full memory barrier unless otherwise noted.
- */
-template <class T>
-class AtomicValue
-{
- public:
- AtomicValue(T init=0) : value(init) {}
-
- // Update and return new value.
- inline T operator+=(T n) { Lock l(lock); return value += n; }
- inline T operator-=(T n) { Lock l(lock); return value -= n; }
- inline T operator++() { return *this += 1; }
- inline T operator--() { return *this -= 1; }
-
- // Update and return old value.
- inline T fetchAndAdd(T n) { Lock l(lock); T old=value; value += n; return old; }
- inline T fetchAndSub(T n) { Lock l(lock); T old=value; value -= n; return old; }
- inline T operator++(int) { return fetchAndAdd(1); }
- inline T operator--(int) { return fetchAndSub(1); }
-
- AtomicValue& operator=(T newval) { Lock l(lock); value = newval; return *this; }
-
- /** If current value == testval then set to newval. Returns the old value. */
- T valueCompareAndSwap(T testval, T newval) {
- Lock l(lock);
- T old=value;
- if (value == testval) value = newval;
- return old;
- }
-
- /** If current value == testval then set to newval. Returns true if the swap was performed. */
- bool boolCompareAndSwap(T testval, T newval) {
- Lock l(lock);
- if (value == testval) { value = newval; return true; }
- return false;
- }
-
- T get() const { Lock l(lock); return value; }
-
- private:
- typedef Mutex::ScopedLock Lock;
- T value;
- mutable Mutex lock;
-};
-
-}} // namespace qpid::sys
-
-#endif /*!QPID_SYS_ATOMICVALUE_MUTEX_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/BlockingQueue.h b/M4-RCs/qpid/cpp/src/qpid/sys/BlockingQueue.h
deleted file mode 100644
index a05a10d811..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/BlockingQueue.h
+++ /dev/null
@@ -1,125 +0,0 @@
-#ifndef QPID_SYS_BLOCKINGQUEUE_H
-#define QPID_SYS_BLOCKINGQUEUE_H
-
-/*
- *
- * 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 "Waitable.h"
-
-#include <queue>
-
-namespace qpid {
-namespace sys {
-
-/**
- * A simple blocking queue template
- */
-template <class T>
-class BlockingQueue
-{
- mutable sys::Waitable waitable;
- std::queue<T> queue;
-
-public:
- BlockingQueue() {}
- ~BlockingQueue() { close(); }
-
- /** Pop from the queue, block up to timeout if empty.
- *@param result Set to value popped from queue.
- *@param timeout Defaults to infinite.
- *@return true if result was set, false if queue empty after timeout.
- */
- bool pop(T& result, Duration timeout=TIME_INFINITE) {
- Mutex::ScopedLock l(waitable);
- {
- Waitable::ScopedWait w(waitable);
- if (timeout == TIME_INFINITE) {
- while (queue.empty()) waitable.wait();
- } else {
- AbsTime deadline(now(),timeout);
- while (queue.empty() && deadline > now()) waitable.wait(deadline);
- }
- }
- if (queue.empty()) return false;
- result = queue.front();
- queue.pop();
- if (!queue.empty())
- waitable.notify(); // Notify another waiter.
- return true;
- }
-
- T pop(Duration timeout=TIME_INFINITE) {
- T result;
- bool ok = pop(result, timeout);
- if (!ok)
- throw Exception("Timed out waiting on a blocking queue");
- return result;
- }
-
- /** Push a value onto the queue.
- * Note it is not an error to push onto a closed queue.
- */
- void push(const T& t) {
- Mutex::ScopedLock l(waitable);
- queue.push(t);
- waitable.notify(); // Notify a waiter.
- }
-
- /**
- * Close the queue.
- *@ex exception to throw to waiting threads. ClosedException by default.
- */
- void close(const ExceptionHolder& ex=ExceptionHolder(new ClosedException()))
- {
- Mutex::ScopedLock l(waitable);
- if (!waitable.hasException()) {
- waitable.setException(ex);
- waitable.notifyAll();
- waitable.waitWaiters(); // Ensure no threads are still waiting.
- }
- }
-
- /** Open a closed queue. */
- void open() {
- Mutex::ScopedLock l(waitable);
- waitable.resetException();
- }
-
- bool isClosed() const {
- Mutex::ScopedLock l(waitable);
- return waitable.hasException();
- }
-
- bool empty() const {
- Mutex::ScopedLock l(waitable);
- return queue.empty();
- }
- size_t size() const {
- Mutex::ScopedLock l(waitable);
- return queue.size();
- }
-};
-
-}}
-
-
-
-#endif /*!QPID_SYS_BLOCKINGQUEUE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Condition.h b/M4-RCs/qpid/cpp/src/qpid/sys/Condition.h
deleted file mode 100644
index fe0e3a1c71..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Condition.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef _sys_Condition_h
-#define _sys_Condition_h
-
-/*
- *
- * 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.
- *
- */
-
-#ifdef USE_APR_PLATFORM
-#include "apr/Condition.h"
-#elif defined (_WIN32)
-#include "windows/Condition.h"
-#else
-#include "posix/Condition.h"
-#endif
-
-#endif /*!_sys_Condition_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionCodec.h b/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionCodec.h
deleted file mode 100644
index b1b047d2cc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionCodec.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef QPID_SYS_CONNECTION_CODEC_H
-#define QPID_SYS_CONNECTION_CODEC_H
-
-/*
- *
- * 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 "qpid/framing/ProtocolVersion.h"
-
-namespace qpid {
-
-namespace sys {
-
-class InputHandlerFactory;
-class OutputControl;
-
-/**
- * Interface of coder/decoder for a connection of a specific protocol
- * version.
- */
-class ConnectionCodec {
- public:
- virtual ~ConnectionCodec() {}
-
- /** Decode from buffer, return number of bytes decoded.
- * @return may be less than size if there was incomplete
- * data at the end of the buffer.
- */
- virtual size_t decode(const char* buffer, size_t size) = 0;
-
-
- /** Encode into buffer, return number of bytes encoded */
- virtual size_t encode(const char* buffer, size_t size) = 0;
-
- /** Return true if we have data to encode */
- virtual bool canEncode() = 0;
-
- /** Network connection was closed from other end. */
- virtual void closed() = 0;
-
- virtual bool isClosed() const = 0;
-
- virtual framing::ProtocolVersion getVersion() const = 0;
-
- struct Factory {
- virtual ~Factory() {}
-
- /** Return 0 if version unknown */
- virtual ConnectionCodec* create(
- framing::ProtocolVersion, OutputControl&, const std::string& id
- ) = 0;
-
- /** Return "preferred" codec for outbound connections. */
- virtual ConnectionCodec* create(
- OutputControl&, const std::string& id
- ) = 0;
- };
-};
-
-}} // namespace qpid::sys
-
-#endif /*!QPID_SYS_CONNECTION_CODEC_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionInputHandler.h b/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionInputHandler.h
deleted file mode 100644
index 9a5b9f75a5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionInputHandler.h
+++ /dev/null
@@ -1,44 +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.
- *
- */
-#ifndef _ConnectionInputHandler_
-#define _ConnectionInputHandler_
-
-#include "qpid/framing/InputHandler.h"
-#include "OutputTask.h"
-#include "TimeoutHandler.h"
-
-namespace qpid {
-namespace sys {
-
- class ConnectionInputHandler :
- public qpid::framing::InputHandler,
- public TimeoutHandler, public OutputTask
- {
- public:
-
- virtual void closed() = 0;
- };
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionInputHandlerFactory.h b/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionInputHandlerFactory.h
deleted file mode 100644
index 9bb7e13686..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionInputHandlerFactory.h
+++ /dev/null
@@ -1,54 +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.
- *
- */
-#ifndef _ConnectionInputHandlerFactory_
-#define _ConnectionInputHandlerFactory_
-
-#include <boost/noncopyable.hpp>
-#include <string>
-
-namespace qpid {
-namespace sys {
-
-class ConnectionOutputHandler;
-class ConnectionInputHandler;
-
-/**
- * Callback interface used by the Acceptor to
- * create a ConnectionInputHandler for each new connection.
- */
-class ConnectionInputHandlerFactory : private boost::noncopyable
-{
- public:
- /**
- *@param out handler for connection output.
- *@param id identify the connection for management purposes.
- */
- virtual ConnectionInputHandler* create(ConnectionOutputHandler* out,
- const std::string& id,
- bool isClient) = 0;
-
- virtual ~ConnectionInputHandlerFactory(){}
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionOutputHandler.h b/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionOutputHandler.h
deleted file mode 100644
index de0bef3630..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionOutputHandler.h
+++ /dev/null
@@ -1,43 +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.
- *
- */
-#ifndef _ConnectionOutputHandler_
-#define _ConnectionOutputHandler_
-
-#include "qpid/framing/OutputHandler.h"
-#include "OutputControl.h"
-
-namespace qpid {
-namespace sys {
-
-/**
- * Provides the output handler associated with a connection.
- */
-class ConnectionOutputHandler : public virtual qpid::framing::OutputHandler, public OutputControl
-{
- public:
- virtual void close() = 0;
- virtual size_t getBuffered() const { return 0; }
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionOutputHandlerPtr.h b/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionOutputHandlerPtr.h
deleted file mode 100644
index df6de89982..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ConnectionOutputHandlerPtr.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef QPID_SYS_CONNECTIONOUTPUTHANDLERPTR_H
-#define QPID_SYS_CONNECTIONOUTPUTHANDLERPTR_H
-
-/*
- *
- * 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 "ConnectionOutputHandler.h"
-
-namespace qpid {
-namespace sys {
-
-/**
- * A ConnectionOutputHandler that delegates to another
- * ConnectionOutputHandler. Allows the "real" ConnectionOutputHandler
- * to be changed modified without updating all the pointers/references
- * using the ConnectionOutputHandlerPtr
- */
-class ConnectionOutputHandlerPtr : public ConnectionOutputHandler
-{
- public:
- ConnectionOutputHandlerPtr(ConnectionOutputHandler* p) : next(p) { assert(next); }
- void set(ConnectionOutputHandler* p) { next = p; assert(next); }
- ConnectionOutputHandler* get() { return next; }
- const ConnectionOutputHandler* get() const { return next; }
-
- void close() { next->close(); }
- size_t getBuffered() const { return next->getBuffered(); }
- void activateOutput() { next->activateOutput(); }
- void giveReadCredit(int32_t credit) { next->giveReadCredit(credit); }
- void send(framing::AMQFrame& f) { next->send(f); }
-
- private:
- ConnectionOutputHandler* next;
-};
-}} // namespace qpid::sys
-
-#endif /*!QPID_SYS_CONNECTIONOUTPUTHANDLERPTR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/CopyOnWriteArray.h b/M4-RCs/qpid/cpp/src/qpid/sys/CopyOnWriteArray.h
deleted file mode 100644
index c5bdcc0942..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/CopyOnWriteArray.h
+++ /dev/null
@@ -1,126 +0,0 @@
-#ifndef QPID_SYS_COPYONWRITEARRAY_H
-#define QPID_SYS_COPYONWRITEARRAY_H
-
-/*
- *
- * 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 "Mutex.h"
-#include <algorithm>
-#include <vector>
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
-namespace sys {
-
-/**
- * An array that copies on adding/removing element allowing lock-free
- * iteration.
- */
-template <class T>
-class CopyOnWriteArray
-{
-public:
- typedef boost::shared_ptr<const std::vector<T> > ConstPtr;
-
- CopyOnWriteArray() {}
- CopyOnWriteArray(const CopyOnWriteArray& c) : array(c.array) {}
-
- void add(T& t)
- {
- Mutex::ScopedLock l(lock);
- ArrayPtr copy(array ? new std::vector<T>(*array) : new std::vector<T>());
- copy->push_back(t);
- array = copy;
- }
-
- bool remove(T& t)
- {
- Mutex::ScopedLock l(lock);
- if (array && std::find(array->begin(), array->end(), t) != array->end()) {
- ArrayPtr copy(new std::vector<T>(*array));
- copy->erase(std::find(copy->begin(), copy->end(), t));
- array = copy;
- return true;
- } else {
- return false;
- }
- }
-
- template <class F>
- bool add_unless(T& t, F f)
- {
- Mutex::ScopedLock l(lock);
- if (array && find_if(array->begin(), array->end(), f) != array->end()) {
- return false;
- } else {
- ArrayPtr copy(array ? new std::vector<T>(*array) : new std::vector<T>());
- copy->push_back(t);
- array = copy;
- return true;
- }
- }
-
- template <class F>
- bool remove_if(F f)
- {
- Mutex::ScopedLock l(lock);
- if (array && std::find_if(array->begin(), array->end(), f) != array->end()) {
- ArrayPtr copy(new std::vector<T>(*array));
- copy->erase(std::remove_if(copy->begin(), copy->end(), f), copy->end());
- array = copy;
- return true;
- }
- return false;
- }
-
- template <class F>
- F for_each(F f)
- {
- ArrayPtr a;
- {
- Mutex::ScopedLock l(lock);
- a = array;
- }
- if (!a) return f;
- return std::for_each(a->begin(), a->end(), f);
- }
-
- ConstPtr snapshot()
- {
- ConstPtr a;
- {
- Mutex::ScopedLock l(lock);
- a = array;
- }
- return a;
- }
-
-private:
- typedef boost::shared_ptr< std::vector<T> > ArrayPtr;
- Mutex lock;
- ArrayPtr array;
-};
-
-}}
-
-
-
-#endif /*!QPID_SYS_COPYONWRITEARRAY_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/DeletionManager.h b/M4-RCs/qpid/cpp/src/qpid/sys/DeletionManager.h
deleted file mode 100644
index 43154eb98e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/DeletionManager.h
+++ /dev/null
@@ -1,138 +0,0 @@
-#ifndef _sys_DeletionManager_h
-#define _sys_DeletionManager_h
-
-/*
- *
- * 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 <vector>
-#include <algorithm>
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
-namespace sys {
-
-struct deleter
-{
- template <typename T>
- void operator()(T* ptr){ delete ptr;}
-};
-
-/**
- * DeletionManager keeps track of handles that need to be deleted but may still be
- * in use by one of the threads concurrently.
- *
- * The mode of operation is like this:
- * - When we want to delete but we might still be using the handle we
- * * Transfer ownership of the handle to this class
- * * Mark the handle as (potentially) in use by every thread
- * - Then subsequently at points where the thread code knows it isn't
- * using any handles it declares that it is using no handles
- * - When the last thread declares no use of a handle it automatically
- * gets deleted by the shared_ptr implementation
- *
- * The class only has static members and data and so can only be used once for
- * any particular handle type
- */
-template <typename H>
-class DeletionManager
-{
-public:
- // Mark every thread as using the handle - it will be deleted
- // below after every thread marks the handle as unused
- static void markForDeletion(H* handle) {
- allThreadsStatuses.addHandle(shared_ptr(handle));
- }
-
- // Mark this thread is not using any handle -
- // handles get deleted here when no one else
- // is using them either
- static void markAllUnusedInThisThread() {
- static __thread ThreadStatus* threadStatus = 0;
-
- // Thread local vars can't be dynamically constructed so we need
- // to check whether we've made it yet and construct it if not
- // (no locking necessary for the check as it's thread local!)
- if (!threadStatus) {
- threadStatus = new ThreadStatus;
- allThreadsStatuses.addThreadStatus(threadStatus);
- }
-
- ScopedLock<Mutex> l(threadStatus->lock);
-
- // The actual deletions will happen here when all the shared_ptr
- // ref counts hit 0 (that is when every thread marks the handle unused)
- threadStatus->handles.clear();
- }
-
-private:
- typedef boost::shared_ptr<H> shared_ptr;
-
- // In theory we know that we never need more handles than the number of
- // threads runnning so we could use a fixed size array. However at this point
- // in the code we don't have easy access to this information.
- struct ThreadStatus
- {
- Mutex lock;
- std::vector<shared_ptr> handles;
- };
-
- class AllThreadsStatuses
- {
- Mutex lock;
- std::vector<ThreadStatus*> statuses;
-
- struct handleAdder
- {
- shared_ptr handle;
-
- handleAdder(shared_ptr h): handle(h) {}
-
- void operator()(ThreadStatus* ptr) {
- ScopedLock<Mutex> l(ptr->lock);
- ptr->handles.push_back(handle);
- }
- };
-
- public:
- // Need this to be able to do static initialisation
- explicit AllThreadsStatuses(int) {}
-
- ~AllThreadsStatuses() {
- ScopedLock<Mutex> l(lock);
- std::for_each(statuses.begin(), statuses.end(), deleter());
- }
-
- void addThreadStatus(ThreadStatus* t) {
- ScopedLock<Mutex> l(lock);
- statuses.push_back(t);
- }
-
- void addHandle(shared_ptr h) {
- ScopedLock<Mutex> l(lock);
- std::for_each(statuses.begin(), statuses.end(), handleAdder(h));
- }
- };
-
- static AllThreadsStatuses allThreadsStatuses;
-};
-
-}}
-#endif // _sys_DeletionManager_h
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/DispatchHandle.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/DispatchHandle.cpp
deleted file mode 100644
index 4722fc0b8b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/DispatchHandle.cpp
+++ /dev/null
@@ -1,409 +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 "DispatchHandle.h"
-
-#include <boost/cast.hpp>
-
-#include <assert.h>
-
-namespace qpid {
-namespace sys {
-
-DispatchHandle::~DispatchHandle() {
- stopWatch();
-}
-
-void DispatchHandle::startWatch(Poller::shared_ptr poller0) {
- bool r = readableCallback;
- bool w = writableCallback;
-
- ScopedLock<Mutex> lock(stateLock);
- assert(state == IDLE);
-
- // If no callbacks set then do nothing (that is what we were asked to do!)
- // TODO: Maybe this should be an assert instead
- if (!r && !w) {
- state = INACTIVE;
- return;
- }
-
- Poller::Direction d = r ?
- (w ? Poller::INOUT : Poller::INPUT) :
- Poller::OUTPUT;
-
- poller = poller0;
- poller->addFd(*this, d);
-
- state = r ?
- (w ? ACTIVE_RW : ACTIVE_R) :
- ACTIVE_W;
-}
-
-void DispatchHandle::rewatch() {
- bool r = readableCallback;
- bool w = writableCallback;
-
- ScopedLock<Mutex> lock(stateLock);
- switch(state) {
- case IDLE:
- case DELAYED_IDLE:
- break;
- case DELAYED_R:
- case DELAYED_W:
- case DELAYED_INACTIVE:
- state = r ?
- (w ? DELAYED_RW : DELAYED_R) :
- DELAYED_W;
- break;
- case DELAYED_DELETE:
- break;
- case INACTIVE:
- case ACTIVE_R:
- case ACTIVE_W: {
- assert(poller);
- Poller::Direction d = r ?
- (w ? Poller::INOUT : Poller::INPUT) :
- Poller::OUTPUT;
- poller->modFd(*this, d);
- state = r ?
- (w ? ACTIVE_RW : ACTIVE_R) :
- ACTIVE_W;
- break;
- }
- case DELAYED_RW:
- case ACTIVE_RW:
- // Don't need to do anything already waiting for readable/writable
- break;
- }
-}
-
-void DispatchHandle::rewatchRead() {
- if (!readableCallback) {
- return;
- }
-
- ScopedLock<Mutex> lock(stateLock);
- switch(state) {
- case IDLE:
- case DELAYED_IDLE:
- break;
- case DELAYED_R:
- case DELAYED_RW:
- case DELAYED_DELETE:
- break;
- case DELAYED_W:
- state = DELAYED_RW;
- break;
- case DELAYED_INACTIVE:
- state = DELAYED_R;
- break;
- case ACTIVE_R:
- case ACTIVE_RW:
- // Nothing to do: already waiting for readable
- break;
- case INACTIVE:
- assert(poller);
- poller->modFd(*this, Poller::INPUT);
- state = ACTIVE_R;
- break;
- case ACTIVE_W:
- assert(poller);
- poller->modFd(*this, Poller::INOUT);
- state = ACTIVE_RW;
- break;
- }
-}
-
-void DispatchHandle::rewatchWrite() {
- if (!writableCallback) {
- return;
- }
-
- ScopedLock<Mutex> lock(stateLock);
- switch(state) {
- case IDLE:
- case DELAYED_IDLE:
- break;
- case DELAYED_W:
- case DELAYED_RW:
- case DELAYED_DELETE:
- break;
- case DELAYED_R:
- state = DELAYED_RW;
- break;
- case DELAYED_INACTIVE:
- state = DELAYED_W;
- break;
- case INACTIVE:
- assert(poller);
- poller->modFd(*this, Poller::OUTPUT);
- state = ACTIVE_W;
- break;
- case ACTIVE_R:
- assert(poller);
- poller->modFd(*this, Poller::INOUT);
- state = ACTIVE_RW;
- break;
- case ACTIVE_W:
- case ACTIVE_RW:
- // Nothing to do: already waiting for writable
- break;
- }
-}
-
-void DispatchHandle::unwatchRead() {
- if (!readableCallback) {
- return;
- }
-
- ScopedLock<Mutex> lock(stateLock);
- switch(state) {
- case IDLE:
- case DELAYED_IDLE:
- break;
- case DELAYED_R:
- state = DELAYED_INACTIVE;
- break;
- case DELAYED_RW:
- state = DELAYED_W;
- break;
- case DELAYED_W:
- case DELAYED_INACTIVE:
- case DELAYED_DELETE:
- break;
- case ACTIVE_R:
- assert(poller);
- poller->modFd(*this, Poller::NONE);
- state = INACTIVE;
- break;
- case ACTIVE_RW:
- assert(poller);
- poller->modFd(*this, Poller::OUTPUT);
- state = ACTIVE_W;
- break;
- case ACTIVE_W:
- case INACTIVE:
- break;
- }
-}
-
-void DispatchHandle::unwatchWrite() {
- if (!writableCallback) {
- return;
- }
-
- ScopedLock<Mutex> lock(stateLock);
- switch(state) {
- case IDLE:
- case DELAYED_IDLE:
- break;
- case DELAYED_W:
- state = DELAYED_INACTIVE;
- break;
- case DELAYED_RW:
- state = DELAYED_R;
- break;
- case DELAYED_R:
- case DELAYED_INACTIVE:
- case DELAYED_DELETE:
- break;
- case ACTIVE_W:
- assert(poller);
- poller->modFd(*this, Poller::NONE);
- state = INACTIVE;
- break;
- case ACTIVE_RW:
- assert(poller);
- poller->modFd(*this, Poller::INPUT);
- state = ACTIVE_R;
- break;
- case ACTIVE_R:
- case INACTIVE:
- break;
- }
-}
-
-void DispatchHandle::unwatch() {
- ScopedLock<Mutex> lock(stateLock);
- switch (state) {
- case IDLE:
- case DELAYED_IDLE:
- break;
- case DELAYED_R:
- case DELAYED_W:
- case DELAYED_RW:
- case DELAYED_INACTIVE:
- state = DELAYED_INACTIVE;
- break;
- case DELAYED_DELETE:
- break;
- default:
- assert(poller);
- poller->modFd(*this, Poller::NONE);
- state = INACTIVE;
- break;
- }
-}
-
-void DispatchHandle::stopWatch() {
- ScopedLock<Mutex> lock(stateLock);
- switch (state) {
- case IDLE:
- case DELAYED_IDLE:
- case DELAYED_DELETE:
- return;
- case DELAYED_R:
- case DELAYED_W:
- case DELAYED_RW:
- case DELAYED_INACTIVE:
- state = DELAYED_IDLE;
- break;
- default:
- state = IDLE;
- break;
- }
- assert(poller);
- poller->delFd(*this);
- poller.reset();
-}
-
-// The slightly strange switch structure
-// is to ensure that the lock is released before
-// we do the delete
-void DispatchHandle::doDelete() {
- // Ensure that we're no longer watching anything
- stopWatch();
-
- // If we're in the middle of a callback defer the delete
- {
- ScopedLock<Mutex> lock(stateLock);
- switch (state) {
- case DELAYED_IDLE:
- case DELAYED_DELETE:
- state = DELAYED_DELETE;
- return;
- case IDLE:
- break;
- default:
- // Can only get out of stopWatch() in DELAYED_IDLE/DELAYED_DELETE/IDLE states
- assert(false);
- }
- }
- // If we're not then do it right away
- delete this;
-}
-
-void DispatchHandle::processEvent(Poller::EventType type) {
- // Note that we are now doing the callbacks
- {
- ScopedLock<Mutex> lock(stateLock);
-
- // Set up to wait for same events next time unless reset
- switch(state) {
- case ACTIVE_R:
- state = DELAYED_R;
- break;
- case ACTIVE_W:
- state = DELAYED_W;
- break;
- case ACTIVE_RW:
- state = DELAYED_RW;
- break;
- // Can only get here in a DELAYED_* state in the rare case
- // that we're already here for reading and we get activated for
- // writing and we can write (it might be possible the other way
- // round too). In this case we're already processing the handle
- // in a different thread in this function so return right away
- case DELAYED_R:
- case DELAYED_W:
- case DELAYED_RW:
- case DELAYED_INACTIVE:
- case DELAYED_IDLE:
- case DELAYED_DELETE:
- return;
- default:
- assert(false);
- }
- }
-
- // Do callbacks - whilst we are doing the callbacks we are prevented from processing
- // the same handle until we re-enable it. To avoid rentering the callbacks for a single
- // handle re-enabling in the callbacks is actually deferred until they are complete.
- switch (type) {
- case Poller::READABLE:
- readableCallback(*this);
- break;
- case Poller::WRITABLE:
- writableCallback(*this);
- break;
- case Poller::READ_WRITABLE:
- readableCallback(*this);
- writableCallback(*this);
- break;
- case Poller::DISCONNECTED:
- {
- ScopedLock<Mutex> lock(stateLock);
- state = DELAYED_INACTIVE;
- }
- if (disconnectedCallback) {
- disconnectedCallback(*this);
- }
- break;
- default:
- assert(false);
- }
-
- // If any of the callbacks re-enabled reading/writing then actually
- // do it now
- {
- ScopedLock<Mutex> lock(stateLock);
- switch (state) {
- case DELAYED_R:
- poller->modFd(*this, Poller::INPUT);
- state = ACTIVE_R;
- return;
- case DELAYED_W:
- poller->modFd(*this, Poller::OUTPUT);
- state = ACTIVE_W;
- return;
- case DELAYED_RW:
- poller->modFd(*this, Poller::INOUT);
- state = ACTIVE_RW;
- return;
- case DELAYED_INACTIVE:
- state = INACTIVE;
- return;
- case DELAYED_IDLE:
- state = IDLE;
- return;
- default:
- // This should be impossible
- assert(false);
- return;
- case DELAYED_DELETE:
- break;
- }
- }
- delete this;
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/DispatchHandle.h b/M4-RCs/qpid/cpp/src/qpid/sys/DispatchHandle.h
deleted file mode 100644
index 219f2c53d6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/DispatchHandle.h
+++ /dev/null
@@ -1,146 +0,0 @@
-#ifndef _sys_DispatchHandle_h
-#define _sys_DispatchHandle_h
-
-/*
- *
- * 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 "Poller.h"
-#include "Mutex.h"
-
-#include <boost/function.hpp>
-
-
-namespace qpid {
-namespace sys {
-
-class DispatchHandleRef;
-/**
- * In order to have your own handle (file descriptor on Unix) watched by the poller
- * you need to:
- *
- * - Subclass IOHandle, in the constructor supply an appropriate
- * IOHandlerPrivate object for the platform.
- *
- * - Construct a DispatchHandle passing it your IOHandle and
- * callback functions for read, write and disconnect events.
- *
- * - Ensure the DispatchHandle is not deleted until the poller is no longer using it.
- * TODO: astitcher document DispatchHandleRef to simplify this.
- *
- * When an event occurs on the handle, the poller calls the relevant callback and
- * stops watching that handle. Your callback can call rewatch() or related functions
- * to re-enable polling.
- */
-class DispatchHandle : public PollerHandle {
- friend class DispatchHandleRef;
-public:
- typedef boost::function1<void, DispatchHandle&> Callback;
-
-private:
- Callback readableCallback;
- Callback writableCallback;
- Callback disconnectedCallback;
- Poller::shared_ptr poller;
- Mutex stateLock;
- enum {
- IDLE, INACTIVE, ACTIVE_R, ACTIVE_W, ACTIVE_RW,
- DELAYED_IDLE, DELAYED_INACTIVE, DELAYED_R, DELAYED_W, DELAYED_RW,
- DELAYED_DELETE
- } state;
-
-public:
- /**
- * Provide a handle to poll and a set of callbacks. Note
- * callbacks can be 0, meaning you are not interested in that
- * event.
- *
- *@param h: the handle to watch. The IOHandle encapsulates a
- * platfrom-specific handle to an IO object (e.g. a file descriptor
- * on Unix.)
- *@param rCb Callback called when the handle is readable.
- *@param wCb Callback called when the handle is writable.
- *@param dCb Callback called when the handle is disconnected.
- */
- DispatchHandle(const IOHandle& h, Callback rCb, Callback wCb, Callback dCb) :
- PollerHandle(h),
- readableCallback(rCb),
- writableCallback(wCb),
- disconnectedCallback(dCb),
- state(IDLE)
- {}
-
- ~DispatchHandle();
-
- /** Add this DispatchHandle to the poller to be watched. */
- void startWatch(Poller::shared_ptr poller);
-
- /** Resume watchingn for all non-0 callbacks. */
- void rewatch();
- /** Resume watchingn for read only. */
- void rewatchRead();
-
- /** Resume watchingn for write only. */
- void rewatchWrite();
-
- /** Stop watching temporarily. The DispatchHandle remains
- associated with the poller and can be re-activated using
- rewatch. */
- void unwatch();
- /** Stop watching for read */
- void unwatchRead();
- /** Stop watching for write */
- void unwatchWrite();
-
- /** Stop watching permanently. Disassociates from the poller. */
- void stopWatch();
-
-protected:
- /** Override to get extra processing done when the DispatchHandle is deleted. */
- void doDelete();
-
-private:
- void processEvent(Poller::EventType dir);
-};
-
-class DispatchHandleRef {
- DispatchHandle* ref;
-
-public:
- typedef boost::function1<void, DispatchHandle&> Callback;
- DispatchHandleRef(const IOHandle& h, Callback rCb, Callback wCb, Callback dCb) :
- ref(new DispatchHandle(h, rCb, wCb, dCb))
- {}
-
- ~DispatchHandleRef() { ref->doDelete(); }
-
- void startWatch(Poller::shared_ptr poller) { ref->startWatch(poller); }
- void rewatch() { ref->rewatch(); }
- void rewatchRead() { ref->rewatchRead(); }
- void rewatchWrite() { ref->rewatchWrite(); }
- void unwatch() { ref->unwatch(); }
- void unwatchRead() { ref->unwatchRead(); }
- void unwatchWrite() { ref->unwatchWrite(); }
- void stopWatch() { ref->stopWatch(); }
-};
-
-}}
-
-#endif // _sys_DispatchHandle_h
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Dispatcher.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/Dispatcher.cpp
deleted file mode 100644
index 8d1d1b79f5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Dispatcher.cpp
+++ /dev/null
@@ -1,59 +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 "Dispatcher.h"
-
-#include <assert.h>
-
-namespace qpid {
-namespace sys {
-
-Dispatcher::Dispatcher(Poller::shared_ptr poller0) :
- poller(poller0) {
-}
-
-Dispatcher::~Dispatcher() {
-}
-
-void Dispatcher::run() {
- do {
- Poller::Event event = poller->wait();
-
- // If can read/write then dispatch appropriate callbacks
- if (event.handle) {
- event.process();
- } else {
- // Handle shutdown
- switch (event.type) {
- case Poller::SHUTDOWN:
- goto dispatcher_shutdown;
- default:
- // This should be impossible
- assert(false);
- }
- }
- } while (true);
-
-dispatcher_shutdown:
- ;
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Dispatcher.h b/M4-RCs/qpid/cpp/src/qpid/sys/Dispatcher.h
deleted file mode 100644
index f7c9e8d731..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Dispatcher.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef _sys_Dispatcher_h
-#define _sys_Dispatcher_h
-
-/*
- *
- * 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 "Poller.h"
-#include "Runnable.h"
-
-namespace qpid {
-namespace sys {
-
-class Dispatcher : public Runnable {
- const Poller::shared_ptr poller;
-
-public:
- Dispatcher(Poller::shared_ptr poller);
- ~Dispatcher();
-
- void run();
-};
-
-}}
-
-#endif // _sys_Dispatcher_h
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ExceptionHolder.h b/M4-RCs/qpid/cpp/src/qpid/sys/ExceptionHolder.h
deleted file mode 100644
index fecaa73eea..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ExceptionHolder.h
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef QPID_EXCEPTIONHOLDER_H
-#define QPID_EXCEPTIONHOLDER_H
-
-/*
- *
- * 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 "qpid/memory.h"
-#include <boost/shared_ptr.hpp>
-
-
-namespace qpid {
-namespace sys {
-
-struct Raisable {
- virtual ~Raisable() {};
- virtual void raise() const=0;
- virtual std::string what() const=0;
-};
-
-/**
- * Holder for exceptions. Allows the thread that notices an error condition to
- * create an exception and store it to be thrown by another thread.
- */
-class ExceptionHolder : public Raisable {
- public:
- ExceptionHolder() {}
- // Use default copy & assign.
-
- /** Take ownership of ex */
- template <class Ex> ExceptionHolder(Ex* ex) { wrap(ex); }
- template <class Ex> ExceptionHolder(const boost::shared_ptr<Ex>& ex) { wrap(ex.release()); }
-
- template <class Ex> ExceptionHolder& operator=(Ex* ex) { wrap(ex); return *this; }
- template <class Ex> ExceptionHolder& operator=(boost::shared_ptr<Ex> ex) { wrap(ex.release()); return *this; }
-
- void raise() const { if (wrapper.get()) wrapper->raise() ; }
- std::string what() const { return wrapper.get() ? wrapper->what() : std::string(); }
- bool empty() const { return !wrapper.get(); }
- operator bool() const { return !empty(); }
- void reset() { wrapper.reset(); }
-
- private:
- template <class Ex> struct Wrapper : public Raisable {
- Wrapper(Ex* ptr) : exception(ptr) {}
- void raise() const { throw *exception; }
- std::string what() const { return exception->what(); }
- boost::shared_ptr<Ex> exception;
- };
- template <class Ex> void wrap(Ex* ex) { wrapper.reset(new Wrapper<Ex>(ex)); }
- boost::shared_ptr<Raisable> wrapper;
-};
-
-
-}} // namespace qpid::sys
-
-
-#endif /*!QPID_EXCEPTIONHOLDER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/FileSysDir.h b/M4-RCs/qpid/cpp/src/qpid/sys/FileSysDir.h
deleted file mode 100755
index ffe7823f0a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/FileSysDir.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef QPID_SYS_FILESYSDIR_H
-#define QPID_SYS_FILESYSDIR_H
-
-/*
- * 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 <string>
-
-namespace qpid {
-namespace sys {
-
-/**
- * @class FileSysDir
- *
- * Represents a filesystem directory accessible from the local host.
- * This class simply checks existence of, and creates, a directory. It could
- * be added to later to list contents, etc.
- */
-class FileSysDir
-{
- const std::string dirPath;
-
- public:
-
- FileSysDir (std::string path) : dirPath(path) {}
- ~FileSysDir () {}
-
- /**
- * Check to see if the directory exists and is a directory. Throws an
- * exception if there is an error checking existence or if the path
- * exists but is not a directory.
- *
- * @retval true if the path exists and is a directory.
- * @retval false if the path does not exist.
- */
- bool exists (void) const;
-
- void mkdir(void);
-
- std::string getPath () { return dirPath; }
-};
-
-}} // namespace qpid::sys
-
-#endif /*!QPID_SYS_FILESYSDIR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Fork.h b/M4-RCs/qpid/cpp/src/qpid/sys/Fork.h
deleted file mode 100644
index 4ec061f7bc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Fork.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef QPID_SYS_FORK_H
-#define QPID_SYS_FORK_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "posix/Fork.h"
-
-#endif /*!QPID_SYS_FORK_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/IOHandle.h b/M4-RCs/qpid/cpp/src/qpid/sys/IOHandle.h
deleted file mode 100644
index 0bf2abbafa..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/IOHandle.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef _sys_IOHandle_h
-#define _sys_IOHandle_h
-
-/*
- *
- * 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 qpid {
-namespace sys {
-
-/**
- * This is a class intended to abstract the Unix concept of file descriptor
- * or the Windows concept of HANDLE
- */
-// Windows-related classes
-class AsynchAcceptorPrivate;
-class AsynchAcceptResult;
-namespace windows {
- class AsynchIO;
-}
-
-// General classes
-class PollerHandle;
-class IOHandlePrivate;
-class IOHandle {
-
- friend class AsynchAcceptorPrivate;
- friend class AsynchAcceptResult;
- friend class windows::AsynchIO;
-
- friend class PollerHandle;
-
-protected:
- IOHandlePrivate* const impl;
-
- IOHandle(IOHandlePrivate*);
- virtual ~IOHandle();
-};
-
-}}
-
-#endif // _sys_IOHandle_h
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/IntegerTypes.h b/M4-RCs/qpid/cpp/src/qpid/sys/IntegerTypes.h
deleted file mode 100755
index 89635f033e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/IntegerTypes.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef QPID_SYS_INTEGERTYPES_H
-#define QPID_SYS_INTEGERTYPES_H
-
-/*
- * 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.
- *
- */
-
-#if (defined(_WINDOWS) || defined (WIN32)) && defined(_MSC_VER)
-#include "qpid/sys/windows/IntegerTypes.h"
-#endif
-#if !defined _WINDOWS && !defined WIN32
-#include "qpid/sys/posix/IntegerTypes.h"
-#endif
-
-#endif /*!QPID_SYS_INTEGERTYPES_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/LockFile.h b/M4-RCs/qpid/cpp/src/qpid/sys/LockFile.h
deleted file mode 100644
index 2ff8c2f6d4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/LockFile.h
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef _sys_LockFile_h
-#define _sys_LockFile_h
-
-/*
- *
- * Copyright (c) 2008 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
-#include <string>
-
-#include "IntegerTypes.h"
-
-namespace qpid {
-namespace sys {
-
-class LockFilePrivate;
-
-/**
- * @class LockFile
- *
- * LockFile represents a locked file suitable for a coarse-grain system
- * lock. For example, the broker uses this to ensure that only one broker
- * runs. A common usage idiom is to store the current "owner" process ID
- * in the lock file - if the lock file exists, but the stored process ID
- * doesn't, the old owner has probably died without cleaning up the lock
- * file.
- */
-class LockFile : private boost::noncopyable
-{
- boost::shared_ptr<LockFilePrivate> impl;
-
- std::string path;
- bool created;
-
-public:
- LockFile(const std::string& path_, bool create);
- ~LockFile();
-
- /**
- * Read the process ID from the lock file. This method assumes that
- * if there is a process ID in the file, it was written there by
- * writePid(); thus, it's at the start of the file.
- *
- * Throws an exception if there is an error reading the file.
- *
- * @returns The stored process ID. No validity check is done on it.
- */
- pid_t readPid(void) const;
-
- /**
- * Write the current process's ID to the lock file. It's written at
- * the start of the file and will overwrite any other content that
- * may be in the file.
- *
- * Throws an exception if the write fails.
- */
- void writePid(void);
-};
-
-}} /* namespace qpid::sys */
-
-#endif /*!_sys_LockFile_h*/
-
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/LockPtr.h b/M4-RCs/qpid/cpp/src/qpid/sys/LockPtr.h
deleted file mode 100644
index 738a864317..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/LockPtr.h
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef QPID_SYS_LOCKPTR_H
-#define QPID_SYS_LOCKPTR_H
-
-/*
- *
- * 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 "qpid/sys/Mutex.h"
-#include <boost/noncopyable.hpp>
-
-namespace qpid {
-namespace sys {
-
-class Mutex;
-
-/**
- * LockPtr is a smart pointer to T. It is constructed from a volatile
- * T* and a Lock (by default a Mutex). It const_casts away the
- * volatile qualifier and locks the Lock for the duration of its
- *
- * Used in conjuntion with the "volatile" keyword to get the compiler
- * to help enforce correct concurrent use of mutli-threaded objects.
- * See ochttp://www.ddj.com/cpp/184403766 for a detailed discussion.
- *
- * To summarize the convention:
- * - Declare thread-safe member functions as volatile.
- * - Declare instances of the class that may be called concurrently as volatile.
- * - Use LockPtr to cast away the volatile qualifier while taking a lock.
- *
- * This means that code calling on a concurrently-used object
- * (declared volatile) can only call thread-safe (volatile) member
- * functions. Code that needs to use thread-unsafe members must use a
- * LockPtr, thereby acquiring the lock and making it safe to do so.
- *
- * A good type-safe pattern is the internally-locked object:
- * - It has it's own private lock member.
- * - All public functions are thread safe and declared volatile.
- * - Any thread-unsafe, non-volatile functions are private.
- * - Only member function implementations use LockPtr to access private functions.
- *
- * This encapsulates all the locking logic inside the class.
- *
- * One nice feature of this convention is the common case where you
- * need a public, locked version of some function foo() and also a
- * private unlocked version to avoid recursive locks. They can be declared as
- * volatile and non-volatile overloads of the same function:
- *
- * // public
- * void Thing::foo() volatile { LockPtr<Thing>(this, myLock)->foo(); }
- * // private
- * void Thing::foo() { ... do stuff ...}
- */
-
-template <class T, class Lock> class LockPtr : public boost::noncopyable {
- public:
- LockPtr(volatile T* p, Lock& l) : ptr(const_cast<T*>(p)), lock(l) { lock.lock(); }
- LockPtr(volatile T* p, volatile Lock& l) : ptr(const_cast<T*>(p)), lock(const_cast<Lock&>(l)) { lock.lock(); }
- ~LockPtr() { lock.unlock(); }
-
- T& operator*() { return *ptr; }
- T* operator->() { return ptr; }
-
- private:
- T* ptr;
- Lock& lock;
-};
-
-
-}} // namespace qpid::sys
-
-
-#endif /*!QPID_SYS_LOCKPTR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Monitor.h b/M4-RCs/qpid/cpp/src/qpid/sys/Monitor.h
deleted file mode 100644
index 2dd405efaf..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Monitor.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _sys_Monitor_h
-#define _sys_Monitor_h
-
-/*
- *
- * 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 "Condition.h"
-
-namespace qpid {
-namespace sys {
-
-/**
- * A monitor is a condition variable and a mutex
- */
-class Monitor : public Mutex, public Condition {
- public:
- inline void wait();
- inline bool wait(const AbsTime& absoluteTime);
-};
-
-
-void Monitor::wait() {
- Condition::wait(*this);
-}
-
-bool Monitor::wait(const AbsTime& absoluteTime) {
- return Condition::wait(*this, absoluteTime);
-}
-
-}}
-#endif /*!_sys_Monitor_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Mutex.h b/M4-RCs/qpid/cpp/src/qpid/sys/Mutex.h
deleted file mode 100644
index 00bf392604..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Mutex.h
+++ /dev/null
@@ -1,91 +0,0 @@
-#ifndef _sys_Mutex_h
-#define _sys_Mutex_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-namespace qpid {
-namespace sys {
-
-/**
- * Scoped lock template: calls lock() in ctor, unlock() in dtor.
- * L can be any class with lock() and unlock() functions.
- */
-template <class L>
-class ScopedLock
-{
- public:
- ScopedLock(L& l) : mutex(l) { l.lock(); }
- ~ScopedLock() { mutex.unlock(); }
- private:
- L& mutex;
-};
-
-template <class L>
-class ScopedUnlock
-{
- public:
- ScopedUnlock(L& l) : mutex(l) { l.unlock(); }
- ~ScopedUnlock() { mutex.lock(); }
- private:
- L& mutex;
-};
-
-template <class L>
-class ScopedRlock
-{
- public:
- ScopedRlock(L& l) : mutex(l) { l.rlock(); }
- ~ScopedRlock() { mutex.unlock(); }
- private:
- L& mutex;
-};
-
-template <class L>
-class ScopedWlock
-{
- public:
- ScopedWlock(L& l) : mutex(l) { l.wlock(); }
- ~ScopedWlock() { mutex.unlock(); }
- private:
- L& mutex;
-};
-
-template <class L>
-class ConditionalScopedLock
-{
- public:
- ConditionalScopedLock(L& l) : mutex(l) { acquired = l.trylock(); }
- ~ConditionalScopedLock() { if (acquired) mutex.unlock(); }
- bool lockAcquired() { return acquired; }
- private:
- L& mutex;
- bool acquired;
-};
-
-}}
-
-#ifdef USE_APR_PLATFORM
-#include "apr/Mutex.h"
-#elif defined (_WIN32)
-#include "windows/Mutex.h"
-#else
-#include "posix/Mutex.h"
-#endif
-
-#endif /*!_sys_Mutex_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/OutputControl.h b/M4-RCs/qpid/cpp/src/qpid/sys/OutputControl.h
deleted file mode 100644
index e9e6c57a9b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/OutputControl.h
+++ /dev/null
@@ -1,42 +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 "IntegerTypes.h"
-
-#ifndef _OutputControl_
-#define _OutputControl_
-
-namespace qpid {
-namespace sys {
-
- class OutputControl
- {
- public:
- virtual ~OutputControl() {}
- virtual void activateOutput() = 0;
- virtual void giveReadCredit(int32_t credit) = 0;
- };
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/OutputTask.h b/M4-RCs/qpid/cpp/src/qpid/sys/OutputTask.h
deleted file mode 100644
index 005ae7dbc4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/OutputTask.h
+++ /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.
- *
- */
-#ifndef _OutputTask_
-#define _OutputTask_
-
-namespace qpid {
-namespace sys {
-
- class OutputTask
- {
- public:
- virtual ~OutputTask() {}
- /** Generate some output.
- *@return true if output was generated, false if there is no work to do.
- */
- virtual bool doOutput() = 0;
-
- /** Check if there may be work to do, but don't do it.
- * @return True if there may be work to do, false if there is none.
- * Can to return a false positive, to allow implementations to do a
- * faster check than doOutput(). Must never return a false negative.
- */
- virtual bool hasOutput() = 0;
- };
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/PollableCondition.h b/M4-RCs/qpid/cpp/src/qpid/sys/PollableCondition.h
deleted file mode 100644
index 56d38f90da..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/PollableCondition.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef QPID_SYS_POLLABLECONDITION_H
-#define QPID_SYS_POLLABLECONDITION_H
-
-/*
- *
- * 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.
- *
- */
-
-// Currently only has a posix implementation, add #ifdefs for other platforms as needed.
-#include "posix/PollableCondition.h"
-
-#endif /*!QPID_SYS_POLLABLECONDITION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/PollableQueue.h b/M4-RCs/qpid/cpp/src/qpid/sys/PollableQueue.h
deleted file mode 100644
index 7f11cc35a9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/PollableQueue.h
+++ /dev/null
@@ -1,152 +0,0 @@
-#ifndef QPID_SYS_POLLABLEQUEUE_H
-#define QPID_SYS_POLLABLEQUEUE_H
-
-/*
- *
- * 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 "qpid/sys/PollableCondition.h"
-#include "qpid/sys/Dispatcher.h"
-#include "qpid/sys/DispatchHandle.h"
-#include "qpid/sys/Monitor.h"
-#include <boost/function.hpp>
-#include <boost/bind.hpp>
-#include <algorithm>
-#include <deque>
-
-namespace qpid {
-namespace sys {
-
-class Poller;
-
-/**
- * A queue that can be polled by sys::Poller. Any thread can push to
- * the queue, on wakeup the poller thread processes all items on the
- * queue by passing them to a callback in a batch.
- */
-template <class T>
-class PollableQueue {
- public:
- typedef std::deque<T> Queue;
-
- /**
- * Callback to process a batch of items from the queue.
- * @param values to process, any items remaining after call are put back on the queue.
- */
- typedef boost::function<void (Queue& values)> Callback;
-
- /** When the queue is selected by the poller, values are passed to callback cb. */
- PollableQueue(const Callback& cb, const boost::shared_ptr<sys::Poller>& poller);
-
- ~PollableQueue();
-
- /** Push a value onto the queue. Thread safe */
- void push(const T& t);
-
- /** Start polling. */
- void start();
-
- /** Stop polling and wait for the current callback, if any, to complete. */
- void stop();
-
- /** Are we currently stopped?*/
- bool isStopped() const { ScopedLock l(lock); return stopped; }
-
- size_t size() { ScopedLock l(lock); return queue.size(); }
- bool empty() { ScopedLock l(lock); return queue.empty(); }
-
- private:
- typedef sys::Monitor::ScopedLock ScopedLock;
- typedef sys::Monitor::ScopedUnlock ScopedUnlock;
-
- void dispatch(sys::DispatchHandle&);
-
- mutable sys::Monitor lock;
- Callback callback;
- boost::shared_ptr<sys::Poller> poller;
- PollableCondition condition;
- DispatchHandle handle;
- Queue queue, batch;
- Thread dispatcher;
- bool stopped;
-};
-
-template <class T> PollableQueue<T>::PollableQueue(
- const Callback& cb, const boost::shared_ptr<sys::Poller>& p)
- : callback(cb), poller(p),
- handle(condition, boost::bind(&PollableQueue<T>::dispatch, this, _1), 0, 0), stopped(true)
-{
- handle.startWatch(poller);
- handle.unwatch();
-}
-
-template <class T> void PollableQueue<T>::start() {
- ScopedLock l(lock);
- if (!stopped) return;
- stopped = false;
- if (!queue.empty()) condition.set();
- handle.rewatch();
-}
-
-template <class T> PollableQueue<T>::~PollableQueue() {
- handle.stopWatch();
-}
-
-template <class T> void PollableQueue<T>::push(const T& t) {
- ScopedLock l(lock);
- if (queue.empty()) condition.set();
- queue.push_back(t);
-}
-
-template <class T> void PollableQueue<T>::dispatch(sys::DispatchHandle& h) {
- ScopedLock l(lock);
- assert(dispatcher.id() == 0);
- dispatcher = Thread::current();
- while (!stopped && !queue.empty()) {
- assert(batch.empty());
- batch.swap(queue);
- {
- ScopedUnlock u(lock); // Allow concurrent push to queue.
- callback(batch);
- }
- if (!batch.empty()) {
- queue.insert(queue.begin(), batch.begin(), batch.end()); // put back unprocessed items.
- batch.clear();
- }
- }
- dispatcher = Thread();
- if (queue.empty()) condition.clear();
- if (stopped) lock.notifyAll();
- else h.rewatch();
-}
-
-template <class T> void PollableQueue<T>::stop() {
- ScopedLock l(lock);
- if (stopped) return;
- handle.unwatch();
- stopped = true;
- // Avoid deadlock if stop is called from the dispatch thread
- while (dispatcher.id() && dispatcher.id() != Thread::current().id())
- lock.wait();
-}
-
-}} // namespace qpid::sys
-
-#endif /*!QPID_SYS_POLLABLEQUEUE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Poller.h b/M4-RCs/qpid/cpp/src/qpid/sys/Poller.h
deleted file mode 100644
index 6b7f4d818e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Poller.h
+++ /dev/null
@@ -1,109 +0,0 @@
-#ifndef _sys_Poller_h
-#define _sys_Poller_h
-
-/*
- *
- * 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 "Time.h"
-
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
-namespace sys {
-
-/**
- * Poller: abstract class to encapsulate a file descriptor poll to be used
- * by a reactor.
- *
- * @see DispatchHandler for more details of normal use.
- */
-class PollerHandle;
-class PollerPrivate;
-class Poller {
- PollerPrivate* const impl;
-
-public:
- typedef boost::shared_ptr<Poller> shared_ptr;
-
- enum Direction {
- NONE = 0,
- INPUT,
- OUTPUT,
- INOUT
- };
-
- enum EventType {
- INVALID = 0,
- READABLE,
- WRITABLE,
- READ_WRITABLE,
- DISCONNECTED,
- SHUTDOWN,
- TIMEOUT
- };
-
- struct Event {
- PollerHandle* handle;
- EventType type;
-
- Event(PollerHandle* handle0, EventType type0) :
- handle(handle0),
- type(type0) {
- }
-
- void process();
- };
-
- Poller();
- ~Poller();
- /** Note: this function is async-signal safe */
- void shutdown();
-
- void addFd(PollerHandle& handle, Direction dir);
- void delFd(PollerHandle& handle);
- void modFd(PollerHandle& handle, Direction dir);
- void rearmFd(PollerHandle& handle);
- Event wait(Duration timeout = TIME_INFINITE);
-};
-
-/**
- * Handle class to use for polling
- */
-class IOHandle;
-class PollerHandlePrivate;
-class PollerHandle {
- friend class Poller;
- friend struct Poller::Event;
-
- PollerHandlePrivate* const impl;
- virtual void processEvent(Poller::EventType) {};
-
-public:
- PollerHandle(const IOHandle& h);
- virtual ~PollerHandle();
-};
-
-inline void Poller::Event::process() {
- handle->processEvent(type);
-}
-
-}}
-#endif // _sys_Poller_h
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ProtocolFactory.h b/M4-RCs/qpid/cpp/src/qpid/sys/ProtocolFactory.h
deleted file mode 100644
index 56ab404d82..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ProtocolFactory.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _sys_ProtocolFactory_h
-#define _sys_ProtocolFactory_h
-
-/*
- *
- * 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 "qpid/sys/IntegerTypes.h"
-#include "qpid/SharedObject.h"
-#include "ConnectionCodec.h"
-#include <boost/function.hpp>
-
-namespace qpid {
-namespace sys {
-
-class Poller;
-
-class ProtocolFactory : public qpid::SharedObject<ProtocolFactory>
-{
- public:
- typedef boost::function2<void, int, std::string> ConnectFailedCallback;
-
- virtual ~ProtocolFactory() = 0;
- virtual uint16_t getPort() const = 0;
- virtual std::string getHost() const = 0;
- virtual void accept(boost::shared_ptr<Poller>, ConnectionCodec::Factory*) = 0;
- virtual void connect(
- boost::shared_ptr<Poller>,
- const std::string& host, int16_t port,
- ConnectionCodec::Factory* codec,
- ConnectFailedCallback failed) = 0;
- virtual bool supports(const std::string& /*capability*/) { return false; }
-};
-
-inline ProtocolFactory::~ProtocolFactory() {}
-
-}}
-
-
-
-#endif //!_sys_ProtocolFactory_h
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp
deleted file mode 100644
index 8afe8ba5ef..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/RdmaIOPlugin.cpp
+++ /dev/null
@@ -1,356 +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 "ProtocolFactory.h"
-
-#include "qpid/Plugin.h"
-#include "qpid/broker/Broker.h"
-#include "qpid/framing/AMQP_HighestVersion.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/rdma/RdmaIO.h"
-#include "qpid/sys/OutputControl.h"
-
-#include <boost/bind.hpp>
-#include <memory>
-
-#include <netdb.h>
-
-using std::auto_ptr;
-using std::string;
-using std::stringstream;
-
-namespace qpid {
-namespace sys {
-
-class RdmaIOHandler : public OutputControl {
- Rdma::Connection::intrusive_ptr connection;
- std::string identifier;
- Rdma::AsynchIO* aio;
- ConnectionCodec::Factory* factory;
- ConnectionCodec* codec;
- bool readError;
-
- void write(const framing::ProtocolInitiation&);
-
- public:
- RdmaIOHandler(Rdma::Connection::intrusive_ptr& c, ConnectionCodec::Factory* f);
- ~RdmaIOHandler();
- void init(Rdma::AsynchIO* a);
- void start(Poller::shared_ptr poller) {aio->start(poller);}
-
- // Output side
- void close();
- void activateOutput();
- void giveReadCredit(int32_t credit);
- void initProtocolOut();
-
- // Input side
- void readbuff(Rdma::AsynchIO& aio, Rdma::Buffer* buff);
- void initProtocolIn(Rdma::Buffer* buff);
-
- // Notifications
- void full(Rdma::AsynchIO& aio);
- void idle(Rdma::AsynchIO& aio);
- void error(Rdma::AsynchIO& aio);
-};
-
-RdmaIOHandler::RdmaIOHandler(Rdma::Connection::intrusive_ptr& c, qpid::sys::ConnectionCodec::Factory* f) :
- connection(c),
- identifier(c->getPeerName()),
- factory(f),
- codec(0),
- readError(false)
-{
-}
-
-void RdmaIOHandler::init(Rdma::AsynchIO* a) {
- aio = a;
-}
-
-RdmaIOHandler::~RdmaIOHandler() {
- if (codec)
- codec->closed();
- delete codec;
-
- aio->deferDelete();
-}
-
-void RdmaIOHandler::write(const framing::ProtocolInitiation& data)
-{
- QPID_LOG(debug, "Rdma: SENT [" << identifier << "] INIT(" << data << ")");
- Rdma::Buffer* buff = aio->getBuffer();
- framing::Buffer out(buff->bytes, buff->byteCount);
- data.encode(out);
- buff->dataCount = data.encodedSize();
- aio->queueWrite(buff);
-}
-
-void RdmaIOHandler::close() {
- aio->queueWriteClose();
-}
-
-void RdmaIOHandler::activateOutput() {
- aio->notifyPendingWrite();
-}
-
-void RdmaIOHandler::idle(Rdma::AsynchIO&) {
- // TODO: Shouldn't need this test as idle() should only ever be called when
- // the connection is writable anyway
- if ( !(aio->writable() && aio->bufferAvailable()) ) {
- return;
- }
- if (codec == 0) return;
- if (codec->canEncode()) {
- Rdma::Buffer* buff = aio->getBuffer();
- size_t encoded=codec->encode(buff->bytes, buff->byteCount);
- buff->dataCount = encoded;
- aio->queueWrite(buff);
- }
- if (codec->isClosed())
- aio->queueWriteClose();
-}
-
-void RdmaIOHandler::initProtocolOut() {
- // We mustn't have already started the conversation
- // but we must be able to send
- assert( codec == 0 );
- assert( aio->writable() && aio->bufferAvailable() );
- codec = factory->create(*this, identifier);
- write(framing::ProtocolInitiation(codec->getVersion()));
-}
-
-void RdmaIOHandler::error(Rdma::AsynchIO&) {
- close();
-}
-
-void RdmaIOHandler::full(Rdma::AsynchIO&) {
- QPID_LOG(debug, "Rdma: buffer full [" << identifier << "]");
-}
-
-// TODO: Dummy implementation of read throttling
-void RdmaIOHandler::giveReadCredit(int32_t) {
-}
-
-// The logic here is subtly different from TCP as RDMA is message oriented
-// so we define that an RDMA message is a frame - in this case there is no putting back
-// of any message remainder - there shouldn't be any. And what we read here can't be
-// smaller than a frame
-void RdmaIOHandler::readbuff(Rdma::AsynchIO&, Rdma::Buffer* buff) {
- if (readError) {
- return;
- }
- size_t decoded = 0;
- try {
- if (codec) {
- decoded = codec->decode(buff->bytes+buff->dataStart, buff->dataCount);
- }else{
- // Need to start protocol processing
- initProtocolIn(buff);
- }
- }catch(const std::exception& e){
- QPID_LOG(error, e.what());
- readError = true;
- aio->queueWriteClose();
- }
-}
-
-void RdmaIOHandler::initProtocolIn(Rdma::Buffer* buff) {
- framing::Buffer in(buff->bytes+buff->dataStart, buff->dataCount);
- framing::ProtocolInitiation protocolInit;
- size_t decoded = 0;
- if (protocolInit.decode(in)) {
- decoded = in.getPosition();
- QPID_LOG(debug, "Rdma: RECV [" << identifier << "] INIT(" << protocolInit << ")");
-
- codec = factory->create(protocolInit.getVersion(), *this, identifier);
-
- // If we failed to create the codec then we don't understand the offered protocol version
- if (!codec) {
- // send valid version header & close connection.
- write(framing::ProtocolInitiation(framing::highestProtocolVersion));
- readError = true;
- aio->queueWriteClose();
- }
- }
-}
-
-class RdmaIOProtocolFactory : public ProtocolFactory {
- auto_ptr<Rdma::Listener> listener;
- const uint16_t listeningPort;
-
- public:
- RdmaIOProtocolFactory(int16_t port, int backlog);
- void accept(Poller::shared_ptr, ConnectionCodec::Factory*);
- void connect(Poller::shared_ptr, const string& host, int16_t port, ConnectionCodec::Factory*, ConnectFailedCallback);
-
- uint16_t getPort() const;
- string getHost() const;
-
- private:
- bool request(Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&, ConnectionCodec::Factory*);
- void established(Poller::shared_ptr, Rdma::Connection::intrusive_ptr&);
- void connected(Poller::shared_ptr, Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&, ConnectionCodec::Factory*);
- void connectionError(Rdma::Connection::intrusive_ptr&, Rdma::ErrorType);
- void disconnected(Rdma::Connection::intrusive_ptr&);
- void rejected(Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&, ConnectFailedCallback);
-};
-
-// Static instance to initialise plugin
-static class RdmaIOPlugin : public Plugin {
- void earlyInitialize(Target&) {
- }
-
- void initialize(Target& target) {
- // Check whether we actually have any rdma devices
- if ( Rdma::deviceCount() == 0 ) {
- QPID_LOG(info, "Rdma: Disabled: no rdma devices found");
- return;
- }
-
- broker::Broker* broker = dynamic_cast<broker::Broker*>(&target);
- // Only provide to a Broker
- if (broker) {
- const broker::Broker::Options& opts = broker->getOptions();
- ProtocolFactory::shared_ptr protocol(new RdmaIOProtocolFactory(opts.port, opts.connectionBacklog));
- QPID_LOG(notice, "Rdma: Listening on RDMA port " << protocol->getPort());
- broker->registerProtocolFactory("rdma", protocol);
- }
- }
-} rdmaPlugin;
-
-RdmaIOProtocolFactory::RdmaIOProtocolFactory(int16_t port, int /*backlog*/) :
- listeningPort(port)
-{}
-
-void RdmaIOProtocolFactory::established(Poller::shared_ptr poller, Rdma::Connection::intrusive_ptr& ci) {
- RdmaIOHandler* async = ci->getContext<RdmaIOHandler>();
- async->start(poller);
-}
-
-bool RdmaIOProtocolFactory::request(Rdma::Connection::intrusive_ptr& ci, const Rdma::ConnectionParams& cp,
- ConnectionCodec::Factory* f) {
- try {
- RdmaIOHandler* async = new RdmaIOHandler(ci, f);
- Rdma::AsynchIO* aio =
- new Rdma::AsynchIO(ci->getQueuePair(),
- cp.maxRecvBufferSize, cp.initialXmitCredit, Rdma::DEFAULT_WR_ENTRIES,
- boost::bind(&RdmaIOHandler::readbuff, async, _1, _2),
- boost::bind(&RdmaIOHandler::idle, async, _1),
- 0, // boost::bind(&RdmaIOHandler::full, async, _1),
- boost::bind(&RdmaIOHandler::error, async, _1));
- async->init(aio);
-
- // Record aio so we can get it back from a connection
- ci->addContext(async);
- return true;
- } catch (const Rdma::Exception& e) {
- QPID_LOG(error, "Rdma: Cannot accept new connection (Rdma exception): " << e.what());
- } catch (const std::exception& e) {
- QPID_LOG(error, "Rdma: Cannot accept new connection (unknown exception): " << e.what());
- }
-
- // If we get here we caught an exception so reject connection
- return false;
-}
-
-void RdmaIOProtocolFactory::connectionError(Rdma::Connection::intrusive_ptr&, Rdma::ErrorType) {
-}
-
-void RdmaIOProtocolFactory::disconnected(Rdma::Connection::intrusive_ptr& ci) {
- // If we've got a connection already tear it down, otherwise ignore
- RdmaIOHandler* async = ci->getContext<RdmaIOHandler>();
- if (async) {
- async->close();
- }
- delete async;
-}
-
-uint16_t RdmaIOProtocolFactory::getPort() const {
- return listeningPort; // Immutable no need for lock.
-}
-
-string RdmaIOProtocolFactory::getHost() const {
- //return listener.getSockname();
- return "";
-}
-
-void RdmaIOProtocolFactory::accept(Poller::shared_ptr poller, ConnectionCodec::Factory* fact) {
- ::sockaddr_in sin;
-
- sin.sin_family = AF_INET;
- sin.sin_port = htons(listeningPort);
- sin.sin_addr.s_addr = INADDR_ANY;
-
- listener.reset(
- new Rdma::Listener((const sockaddr&)(sin),
- Rdma::ConnectionParams(65536, Rdma::DEFAULT_WR_ENTRIES),
- boost::bind(&RdmaIOProtocolFactory::established, this, poller, _1),
- boost::bind(&RdmaIOProtocolFactory::connectionError, this, _1, _2),
- boost::bind(&RdmaIOProtocolFactory::disconnected, this, _1),
- boost::bind(&RdmaIOProtocolFactory::request, this, _1, _2, fact)));
-
- listener->start(poller);
-}
-
-// Only used for outgoing connections (in federation)
-void RdmaIOProtocolFactory::rejected(Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&, ConnectFailedCallback failed) {
- failed(-1, "Connection rejected");
-}
-
-// Do the same as connection request and established but mark a client too
-void RdmaIOProtocolFactory::connected(Poller::shared_ptr poller, Rdma::Connection::intrusive_ptr& ci, const Rdma::ConnectionParams& cp,
- ConnectionCodec::Factory* f) {
- (void) request(ci, cp, f);
- established(poller, ci);
- RdmaIOHandler* async = ci->getContext<RdmaIOHandler>();
- async->initProtocolOut();
-}
-
-void RdmaIOProtocolFactory::connect(
- Poller::shared_ptr poller,
- const std::string& host, int16_t p,
- ConnectionCodec::Factory* f,
- ConnectFailedCallback failed)
-{
- ::addrinfo *res;
- ::addrinfo hints = {};
- hints.ai_family = AF_INET;
- hints.ai_socktype = SOCK_STREAM;
- stringstream ss; ss << p;
- string port = ss.str();
- int n = ::getaddrinfo(host.c_str(), port.c_str(), &hints, &res);
- if (n<0) {
- throw Exception(QPID_MSG("Rdma: Cannot resolve " << host << ": " << ::gai_strerror(n)));
- }
-
- Rdma::Connector* c =
- new Rdma::Connector(
- *res->ai_addr,
- Rdma::ConnectionParams(8000, Rdma::DEFAULT_WR_ENTRIES),
- boost::bind(&RdmaIOProtocolFactory::connected, this, poller, _1, _2, f),
- boost::bind(&RdmaIOProtocolFactory::connectionError, this, _1, _2),
- boost::bind(&RdmaIOProtocolFactory::disconnected, this, _1),
- boost::bind(&RdmaIOProtocolFactory::rejected, this, _1, _2, failed));
-
- c->start(poller);
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Runnable.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/Runnable.cpp
deleted file mode 100644
index 30122c682f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Runnable.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Runnable.h"
-#include <boost/bind.hpp>
-
-namespace qpid {
-namespace sys {
-
-Runnable::~Runnable() {}
-
-Runnable::Functor Runnable::functor()
-{
- return boost::bind(&Runnable::run, this);
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Runnable.h b/M4-RCs/qpid/cpp/src/qpid/sys/Runnable.h
deleted file mode 100644
index fb3927c612..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Runnable.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef _Runnable_
-#define _Runnable_
-/*
- *
- * 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 <boost/function.hpp>
-
-namespace qpid {
-namespace sys {
-
-/**
- * Interface for objects that can be run, e.g. in a thread.
- */
-class Runnable
-{
- public:
- /** Type to represent a runnable as a Functor */
- typedef boost::function0<void> Functor;
-
- virtual ~Runnable();
-
- /** Derived classes override run(). */
- virtual void run() = 0;
-
- /** Create a functor object that will call this->run(). */
- Functor functor();
-};
-
-}}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ScopedIncrement.h b/M4-RCs/qpid/cpp/src/qpid/sys/ScopedIncrement.h
deleted file mode 100644
index 8645ab2484..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ScopedIncrement.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef _posix_ScopedIncrement_h
-#define _posix_ScopedIncrement_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <boost/noncopyable.hpp>
-#include <boost/function.hpp>
-
-namespace qpid {
-namespace sys {
-
-/**
- * Increment counter in constructor and decrement in destructor.
- * Optionally call a function if the decremented counter value is 0.
- * Note the function must not throw, it is called in the destructor.
- */
-template <class T, class F=boost::function<void()> >
-class ScopedIncrement : boost::noncopyable
-{
- public:
- ScopedIncrement(T& c, F f=0)
- : count(c), callback(f) { ++count; }
- ~ScopedIncrement() { if (--count == 0 && callback) callback(); }
-
- private:
- T& count;
- F callback;
-};
-
-
-/** Decrement counter in constructor and increment in destructor. */
-template <class T>
-class ScopedDecrement : boost::noncopyable
-{
- public:
- ScopedDecrement(T& c) : count(c) { value = --count; }
- ~ScopedDecrement() { ++count; }
-
- /** Return the value after the decrement. */
- operator long() { return value; }
-
- private:
- T& count;
- long value;
-};
-
-
-}}
-
-
-#endif // _posix_ScopedIncrement_h
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Semaphore.h b/M4-RCs/qpid/cpp/src/qpid/sys/Semaphore.h
deleted file mode 100644
index 3efb7ce2df..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Semaphore.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef _sys_Semaphore_h
-#define _sys_Semaphore_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "Monitor.h"
-
-namespace qpid {
-namespace sys {
-
-class Semaphore
-{
-public:
- Semaphore(uint c = 1) : count(c) {}
-
- void lock() { acquire(); }
- void unlock() { release(); }
- bool trylock() { return tryAcquire(); }
-
- bool tryAcquire()
- {
- Monitor::ScopedLock l(monitor);
- if (count) {
- count--;
- return true;
- } else {
- return false;
- }
- }
-
- void acquire()
- {
- Monitor::ScopedLock l(monitor);
- while (count == 0) monitor.wait();
- count--;
- }
-
- void release()
- {
- Monitor::ScopedLock l(monitor);
- if (!count++) monitor.notifyAll();
- }
-
-private:
- Monitor monitor;
- uint count;
-};
-
-}}
-
-#endif /*!_sys_Semaphore_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Shlib.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/Shlib.cpp
deleted file mode 100644
index 8fd3f42cc6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Shlib.cpp
+++ /dev/null
@@ -1,38 +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 "Shlib.h"
-
-#include "qpid/log/Statement.h"
-
-namespace qpid {
-namespace sys {
-
-AutoShlib::~AutoShlib() throw() {
- try {
- unload();
- } catch(const std::exception& e) {
- QPID_LOG(error, "Unloading shared library: " << e.what());
- }
-}
-
-// Note: Other functions are defined in apr/Shlib.cpp or posix/Shlib.cpp.
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Shlib.h b/M4-RCs/qpid/cpp/src/qpid/sys/Shlib.h
deleted file mode 100644
index a6d94b42d4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Shlib.h
+++ /dev/null
@@ -1,75 +0,0 @@
-#ifndef QPID_SYS_SHLIB_H
-#define QPID_SYS_SHLIB_H
-
-/*
- *
- * 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 <boost/noncopyable.hpp>
-#include <iostream>
-
-namespace qpid {
-namespace sys {
-
-/** Encapsulates a shared library handle.
- *@see AutoShlib
- */
-class Shlib {
- public:
- /** Load a shared library */
- Shlib(const char* libname) { load(libname); }
-
- /** Load a shared library */
- Shlib(const std::string& libname) { load(libname.c_str()); }
-
- /** Unload shared library. */
- void unload();
-
- /** Look up symbol. */
- void* getSymbol(const char* symbol);
-
- /** Look up symbol in shared library, cast it to the desired
- * pointer type, void* by default.
- */
- template <class T>
- T getSymbol(const char* symbol) {
- // Double cast avoids warning about casting object to function pointer
- return reinterpret_cast<T>(reinterpret_cast<intptr_t>(
- this->getSymbol(symbol)));
- }
-
- private:
- void* handle;
- void load(const char* libname);
-};
-
-/** A shared library handle that unloads the shlib in it's dtor */
-class AutoShlib : public Shlib {
- public:
- /** Load shared library */
- AutoShlib(const std::string& libname) : Shlib(libname) {}
- /** Calls unload() */
- ~AutoShlib() throw();
-};
-
-
-}} // namespace qpid::sys
-
-#endif /*!QPID_SYS_SHLIB_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ShutdownHandler.h b/M4-RCs/qpid/cpp/src/qpid/sys/ShutdownHandler.h
deleted file mode 100644
index 88baecb5b6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ShutdownHandler.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.
- *
- */
-#ifndef _ShutdownHandler_
-#define _ShutdownHandler_
-
-namespace qpid {
-namespace sys {
-
- class ShutdownHandler
- {
- public:
- virtual void shutdown() = 0;
- virtual ~ShutdownHandler(){}
- };
-
-}
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Socket.h b/M4-RCs/qpid/cpp/src/qpid/sys/Socket.h
deleted file mode 100644
index ae48b8104d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Socket.h
+++ /dev/null
@@ -1,110 +0,0 @@
-#ifndef _sys_Socket_h
-#define _sys_Socket_h
-
-/*
- *
- * 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 "IOHandle.h"
-#include "qpid/sys/IntegerTypes.h"
-
-#include <string>
-
-struct sockaddr;
-
-namespace qpid {
-namespace sys {
-
-class Duration;
-
-class Socket : public IOHandle
-{
-public:
- /** Create a socket wrapper for descriptor. */
- Socket();
-
- /** Create an initialized TCP socket */
- void createTcp() const;
-
- /** Set timeout for read and write */
- void setTimeout(const Duration& interval) const;
-
- /** Set socket non blocking */
- void setNonblocking() const;
-
- void connect(const std::string& host, uint16_t port) const;
-
- void close() const;
-
- /** Bind to a port and start listening.
- *@param port 0 means choose an available port.
- *@param backlog maximum number of pending connections.
- *@return The bound port.
- */
- int listen(uint16_t port = 0, int backlog = 10) const;
-
- /** Returns the "socket name" ie the address bound to
- * the near end of the socket
- */
- std::string getSockname() const;
-
- /** Returns the "peer name" ie the address bound to
- * the remote end of the socket
- */
- std::string getPeername() const;
-
- /**
- * Returns an address (host and port) for the remote end of the
- * socket
- */
- std::string getPeerAddress() const;
- /**
- * Returns an address (host and port) for the local end of the
- * socket
- */
- std::string getLocalAddress() const;
-
- uint16_t getLocalPort() const;
- uint16_t getRemotePort() const;
-
- /**
- * Returns the error code stored in the socket. This may be used
- * to determine the result of a non-blocking connect.
- */
- int getError() const;
-
- /** Accept a connection from a socket that is already listening
- * and has an incoming connection
- */
- Socket* accept(struct sockaddr *addr, socklen_t *addrlen) const;
-
- // TODO The following are raw operations, maybe they need better wrapping?
- int read(void *buf, size_t count) const;
- int write(const void *buf, size_t count) const;
-
- void setTcpNoDelay(bool nodelay) const;
-
-private:
- Socket(IOHandlePrivate*);
- mutable std::string connectname;
-};
-
-}}
-#endif /*!_sys_Socket_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/SslPlugin.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/SslPlugin.cpp
deleted file mode 100644
index 14052c2ee4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/SslPlugin.cpp
+++ /dev/null
@@ -1,184 +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 "ProtocolFactory.h"
-
-#include "qpid/Plugin.h"
-#include "qpid/sys/ssl/check.h"
-#include "qpid/sys/ssl/util.h"
-#include "qpid/sys/ssl/SslHandler.h"
-#include "qpid/sys/ssl/SslIo.h"
-#include "qpid/sys/ssl/SslSocket.h"
-#include "qpid/broker/Broker.h"
-#include "qpid/log/Statement.h"
-
-#include <boost/bind.hpp>
-#include <memory>
-
-
-namespace qpid {
-namespace sys {
-
-struct SslServerOptions : ssl::SslOptions
-{
- uint16_t port;
- bool clientAuth;
-
- SslServerOptions() : port(5671),
- clientAuth(false)
- {
- addOptions()
- ("ssl-port", optValue(port, "PORT"), "Port on which to listen for SSL connections")
- ("ssl-require-client-authentication", optValue(clientAuth),
- "Forces clients to authenticate in order to establish an SSL connection");
- }
-};
-
-class SslProtocolFactory : public ProtocolFactory {
- const bool tcpNoDelay;
- qpid::sys::ssl::SslSocket listener;
- const uint16_t listeningPort;
- std::auto_ptr<qpid::sys::ssl::SslAcceptor> acceptor;
-
- public:
- SslProtocolFactory(const SslServerOptions&, int backlog, bool nodelay);
- void accept(Poller::shared_ptr, ConnectionCodec::Factory*);
- void connect(Poller::shared_ptr, const std::string& host, int16_t port,
- ConnectionCodec::Factory*,
- boost::function2<void, int, std::string> failed);
-
- uint16_t getPort() const;
- std::string getHost() const;
- bool supports(const std::string& capability);
-
- private:
- void established(Poller::shared_ptr, const qpid::sys::ssl::SslSocket&, ConnectionCodec::Factory*,
- bool isClient);
-};
-
-// Static instance to initialise plugin
-static struct SslPlugin : public Plugin {
- SslServerOptions options;
-
- Options* getOptions() { return &options; }
-
- ~SslPlugin() { ssl::shutdownNSS(); }
-
- void earlyInitialize(Target&) {
- }
-
- void initialize(Target& target) {
- broker::Broker* broker = dynamic_cast<broker::Broker*>(&target);
- // Only provide to a Broker
- if (broker) {
- if (options.certDbPath.empty()) {
- QPID_LOG(warning, "SSL plugin not enabled, you must set --qpid-ssl-cert-db to enable it.");
- } else {
- try {
- ssl::initNSS(options, true);
-
- const broker::Broker::Options& opts = broker->getOptions();
- ProtocolFactory::shared_ptr protocol(new SslProtocolFactory(options,
- opts.connectionBacklog, opts.tcpNoDelay));
- QPID_LOG(notice, "Listening for SSL connections on TCP port " << protocol->getPort());
- broker->registerProtocolFactory("ssl", protocol);
- } catch (const std::exception& e) {
- QPID_LOG(error, "Failed to initialise SSL plugin: " << e.what());
- }
- }
- }
- }
-} sslPlugin;
-
-SslProtocolFactory::SslProtocolFactory(const SslServerOptions& options, int backlog, bool nodelay) :
- tcpNoDelay(nodelay), listeningPort(listener.listen(options.port, backlog, options.certName, options.clientAuth))
-{}
-
-void SslProtocolFactory::established(Poller::shared_ptr poller, const qpid::sys::ssl::SslSocket& s,
- ConnectionCodec::Factory* f, bool isClient) {
- qpid::sys::ssl::SslHandler* async = new qpid::sys::ssl::SslHandler(s.getPeerAddress(), f);
-
- if (tcpNoDelay) {
- s.setTcpNoDelay(tcpNoDelay);
- QPID_LOG(info, "Set TCP_NODELAY on connection to " << s.getPeerAddress());
- }
-
- if (isClient)
- async->setClient();
- qpid::sys::ssl::SslIO* aio = new qpid::sys::ssl::SslIO(s,
- boost::bind(&qpid::sys::ssl::SslHandler::readbuff, async, _1, _2),
- boost::bind(&qpid::sys::ssl::SslHandler::eof, async, _1),
- boost::bind(&qpid::sys::ssl::SslHandler::disconnect, async, _1),
- boost::bind(&qpid::sys::ssl::SslHandler::closedSocket, async, _1, _2),
- boost::bind(&qpid::sys::ssl::SslHandler::nobuffs, async, _1),
- boost::bind(&qpid::sys::ssl::SslHandler::idle, async, _1));
-
- async->init(aio, 4);
- aio->start(poller);
-}
-
-uint16_t SslProtocolFactory::getPort() const {
- return listeningPort; // Immutable no need for lock.
-}
-
-std::string SslProtocolFactory::getHost() const {
- return listener.getSockname();
-}
-
-void SslProtocolFactory::accept(Poller::shared_ptr poller,
- ConnectionCodec::Factory* fact) {
- acceptor.reset(
- new qpid::sys::ssl::SslAcceptor(listener,
- boost::bind(&SslProtocolFactory::established, this, poller, _1, fact, false)));
- acceptor->start(poller);
-}
-
-void SslProtocolFactory::connect(
- Poller::shared_ptr poller,
- const std::string& host, int16_t port,
- ConnectionCodec::Factory* fact,
- ConnectFailedCallback failed)
-{
- // Note that the following logic does not cause a memory leak.
- // The allocated Socket is freed either by the SslConnector
- // upon connection failure or by the SslIoHandle upon connection
- // shutdown. The allocated SslConnector frees itself when it
- // is no longer needed.
-
- qpid::sys::ssl::SslSocket* socket = new qpid::sys::ssl::SslSocket();
- new qpid::sys::ssl::SslConnector (*socket, poller, host, port,
- boost::bind(&SslProtocolFactory::established, this, poller, _1, fact, true),
- failed);
-}
-
-namespace
-{
-const std::string SSL = "ssl";
-}
-
-bool SslProtocolFactory::supports(const std::string& capability)
-{
- std::string s = capability;
- transform(s.begin(), s.end(), s.begin(), tolower);
- return s == SSL;
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/StateMonitor.h b/M4-RCs/qpid/cpp/src/qpid/sys/StateMonitor.h
deleted file mode 100644
index 5a92756f3a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/StateMonitor.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef QPID_SYS_STATEMONITOR_H
-#define QPID_SYS_STATEMONITOR_H
-
-/*
- *
- * 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 "qpid/sys/Waitable.h"
-
-#include <bitset>
-
-namespace qpid {
-namespace sys {
-
-/**
- * A monitor with an enum state value.
- *
- *@param Enum: enum type to use for states.
- *@param EnumMax: Highest enum value.
- */
-template <class Enum, size_t MaxEnum>
-class StateMonitor : public Waitable
-{
- public:
- struct Set : public std::bitset<MaxEnum + 1> {
- Set() {}
- Set(Enum s) { set(s); }
- Set(Enum s, Enum t) { set(s).set(t); }
- Set(Enum s, Enum t, Enum u) { set(s).set(t).set(u); }
- Set(Enum s, Enum t, Enum u, Enum v) { set(s).set(t).set(u).set(v); }
- };
-
-
- StateMonitor(Enum initial) { state=initial; }
-
- /** @pre Caller holds a ScopedLock. */
- void set(Enum s) { state=s; notifyAll(); }
- /** @pre Caller holds a ScopedLock. */
- StateMonitor& operator=(Enum s) { set(s); return *this; }
-
- /** @pre Caller holds a ScopedLock. */
- Enum get() const { return state; }
- /** @pre Caller holds a ScopedLock. */
- operator Enum() const { return state; }
-
- /** @pre Caller holds a ScopedLock */
- void waitFor(Enum s) { ScopedWait(*this); while (s != state) wait(); }
- /** @pre Caller holds a ScopedLock */
- void waitFor(Set s) { ScopedWait(*this); while (!s.test(state)) wait(); }
- /** @pre Caller holds a ScopedLock */
- void waitNot(Enum s) { ScopedWait(*this); while (s == state) wait(); }
- /** @pre Caller holds a ScopedLock */
- void waitNot(Set s) { ScopedWait(*this); while (s.test(state)) wait(); }
-
- private:
- Enum state;
-};
-
-}}
-
-
-#endif /*!QPID_SYS_STATEMONITOR_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/StrError.h b/M4-RCs/qpid/cpp/src/qpid/sys/StrError.h
deleted file mode 100644
index 3843f2abe1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/StrError.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef _sys_StrError_h
-#define _sys_StrError_h
-
-/*
- *
- * 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 <string>
-
-namespace qpid {
-namespace sys {
-
-/** Get the error message for a system number err, e.g. errno. */
-std::string strError(int err);
-
-}} // namespace qpid
-
-#endif // _sys_StrError_h
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/SystemInfo.h b/M4-RCs/qpid/cpp/src/qpid/sys/SystemInfo.h
deleted file mode 100644
index d43fe34b04..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/SystemInfo.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef QPID_SYS_SYSTEMINFO_H
-#define QPID_SYS_SYSTEMINFO_H
-
-/*
- * 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 "qpid/sys/IntegerTypes.h"
-#include "qpid/Address.h"
-
-namespace qpid {
-namespace sys {
-
-/**
- * Retrieve information about the system we are running on.
- * Results may be dependent on OS/hardware.
- */
-namespace SystemInfo {
- /**
- * Estimate available concurrency, e.g. number of CPU cores.
- * -1 means estimate not available on this platform.
- */
- long concurrency();
-
- /**
- * Get the local host name and set it in the specified TcpAddress.
- * Returns false if it can't be obtained and sets errno to any error value.
- */
- bool getLocalHostname (TcpAddress &address);
-
- void getLocalIpAddresses (uint16_t port, std::vector<Address> &addrList);
-
- /**
- * Retrieve system identifiers and versions. This is information that can
- * generally be retrieved via POSIX uname().
- *
- * @param osName Receives the OS name; e.g., GNU/Linux or Windows
- * @param nodeName Receives the nodename. This may or may not match the
- * set hostname from getLocalHostname().
- * @param release Receives the OS release identifier.
- * @param version Receives the OS release version (kernel, build, sp, etc.)
- * @param machine Receives the hardware type.
- */
- void getSystemId (std::string &osName,
- std::string &nodeName,
- std::string &release,
- std::string &version,
- std::string &machine);
-
- /**
- * Get the process ID of the current process.
- */
- uint32_t getProcessId();
-
- /**
- * Get the process ID of the parent of the current process.
- */
- uint32_t getParentProcessId();
-
-
-}}} // namespace qpid::sys::SystemInfo
-
-#endif /*!QPID_SYS_SYSTEMINFO_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp
deleted file mode 100644
index be091f86d8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/TCPIOPlugin.cpp
+++ /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.
- *
- */
-
-#include "ProtocolFactory.h"
-#include "AsynchIOHandler.h"
-#include "AsynchIO.h"
-
-#include "qpid/Plugin.h"
-#include "qpid/sys/Socket.h"
-#include "qpid/broker/Broker.h"
-#include "qpid/log/Statement.h"
-
-#include <boost/bind.hpp>
-#include <memory>
-
-namespace qpid {
-namespace sys {
-
-class AsynchIOProtocolFactory : public ProtocolFactory {
- const bool tcpNoDelay;
- Socket listener;
- const uint16_t listeningPort;
- std::auto_ptr<AsynchAcceptor> acceptor;
-
- public:
- AsynchIOProtocolFactory(int16_t port, int backlog, bool nodelay);
- void accept(Poller::shared_ptr, ConnectionCodec::Factory*);
- void connect(Poller::shared_ptr, const std::string& host, int16_t port,
- ConnectionCodec::Factory*,
- boost::function2<void, int, std::string> failed);
-
- uint16_t getPort() const;
- std::string getHost() const;
-
- private:
- void established(Poller::shared_ptr, const Socket&, ConnectionCodec::Factory*,
- bool isClient);
-};
-
-// Static instance to initialise plugin
-static class TCPIOPlugin : public Plugin {
- void earlyInitialize(Target&) {
- }
-
- void initialize(Target& target) {
- broker::Broker* broker = dynamic_cast<broker::Broker*>(&target);
- // Only provide to a Broker
- if (broker) {
- const broker::Broker::Options& opts = broker->getOptions();
- if (opts.requireEncrypted) {
- QPID_LOG(info, "Not accepting unencrypted connections on TCP");
- } else {
- ProtocolFactory::shared_ptr protocol(new AsynchIOProtocolFactory(opts.port, opts.connectionBacklog,
- opts.tcpNoDelay));
- QPID_LOG(notice, "Listening on TCP port " << protocol->getPort());
- broker->registerProtocolFactory("tcp", protocol);
- }
- }
- }
-} tcpPlugin;
-
-AsynchIOProtocolFactory::AsynchIOProtocolFactory(int16_t port, int backlog, bool nodelay) :
- tcpNoDelay(nodelay), listeningPort(listener.listen(port, backlog))
-{}
-
-void AsynchIOProtocolFactory::established(Poller::shared_ptr poller, const Socket& s,
- ConnectionCodec::Factory* f, bool isClient) {
- AsynchIOHandler* async = new AsynchIOHandler(s.getPeerAddress(), f);
-
- if (tcpNoDelay) {
- s.setTcpNoDelay(tcpNoDelay);
- QPID_LOG(info, "Set TCP_NODELAY on connection to " << s.getPeerAddress());
- }
-
- if (isClient)
- async->setClient();
- AsynchIO* aio = AsynchIO::create
- (s,
- boost::bind(&AsynchIOHandler::readbuff, async, _1, _2),
- boost::bind(&AsynchIOHandler::eof, async, _1),
- boost::bind(&AsynchIOHandler::disconnect, async, _1),
- boost::bind(&AsynchIOHandler::closedSocket, async, _1, _2),
- boost::bind(&AsynchIOHandler::nobuffs, async, _1),
- boost::bind(&AsynchIOHandler::idle, async, _1));
-
- async->init(aio, 4);
- aio->start(poller);
-}
-
-uint16_t AsynchIOProtocolFactory::getPort() const {
- return listeningPort; // Immutable no need for lock.
-}
-
-std::string AsynchIOProtocolFactory::getHost() const {
- return listener.getSockname();
-}
-
-void AsynchIOProtocolFactory::accept(Poller::shared_ptr poller,
- ConnectionCodec::Factory* fact) {
- acceptor.reset(
- new AsynchAcceptor(listener,
- boost::bind(&AsynchIOProtocolFactory::established, this, poller, _1, fact, false)));
- acceptor->start(poller);
-}
-
-void AsynchIOProtocolFactory::connect(
- Poller::shared_ptr poller,
- const std::string& host, int16_t port,
- ConnectionCodec::Factory* fact,
- ConnectFailedCallback failed)
-{
- // Note that the following logic does not cause a memory leak.
- // The allocated Socket is freed either by the AsynchConnector
- // upon connection failure or by the AsynchIO upon connection
- // shutdown. The allocated AsynchConnector frees itself when it
- // is no longer needed.
-
- Socket* socket = new Socket();
- AsynchConnector::create (*socket,
- poller,
- host,
- port,
- boost::bind(&AsynchIOProtocolFactory::established,
- this, poller, _1, fact, true),
- failed);
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Thread.h b/M4-RCs/qpid/cpp/src/qpid/sys/Thread.h
deleted file mode 100644
index 2fd59621d8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Thread.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#ifndef _sys_Thread_h
-#define _sys_Thread_h
-
-/*
- *
- * 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 <boost/shared_ptr.hpp>
-
-#ifdef _WIN32
-# define QPID_TSS __declspec(thread)
-#elif defined (gcc)
-# define QPID_TSS __thread
-#else
-# define QPID_TSS
-#endif
-
-namespace qpid {
-namespace sys {
-
-class Runnable;
-class ThreadPrivate;
-
-class Thread
-{
- boost::shared_ptr<ThreadPrivate> impl;
-
- public:
- Thread();
- explicit Thread(qpid::sys::Runnable*);
- explicit Thread(qpid::sys::Runnable&);
-
- void join();
-
- unsigned long id();
-
- static Thread current();
-
- /** ID of current thread for logging.
- * Workaround for broken Thread::current() in APR
- */
- static unsigned long logId() { return current().id(); }
-};
-
-}}
-#endif /*!_sys_Thread_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Time.h b/M4-RCs/qpid/cpp/src/qpid/sys/Time.h
deleted file mode 100644
index d39be95434..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Time.h
+++ /dev/null
@@ -1,168 +0,0 @@
-#ifndef _sys_Time_h
-#define _sys_Time_h
-
-/*
- *
- * 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 "qpid/sys/IntegerTypes.h"
-/*
- * The platform defines its notion of time as a TimePrivate type. The
- * platform's implementation knows how to handle this type.
- */
-#if defined (_WIN32)
-# include "windows/Time.h"
-#else
-# include "posix/Time.h"
-#endif
-
-#include <limits>
-#include <iosfwd>
-
-namespace qpid {
-namespace sys {
-
-class Duration;
-
-/**
- * @class AbsTime
- *
- * Class to represent an instant in time.
- *
- * The time resolution is in nanosecs, and this is held with 64 bits
- * giving a total time span from about 25 million years ago to 25 million
- * years hence. As an aside the internal time can sensibly be negative
- * meaning before the epoch (probably 1/1/1970 although this class doesn't
- * care).
- *
- * The AbsTime class is a value class and so you don't need to add any
- * accessors to its internal state. If you think you want to replace its value,
- * you need to construct a new AbsTime and assign it, viz:
- *
- * AbsTime when = AbsTime::now();
- * ...
- * when = AbsTime(when, 2*TIME_SEC); // Advance timer 2 secs
- *
- * If for some reason you need access to the internal nanosec value you need
- * to convert the AbsTime to a Duration and use its conversion to int64_t, viz:
- *
- * AbsTime now = AbsTime::now();
- *
- * int64_t ns = Duration(now);
- *
- * However note that the nanosecond value that is returned here is not
- * defined to be anything in particular and could vary from platform to
- * platform.
- *
- * There are some sensible operations that are currently missing from
- * AbsTime, but nearly all that's needed can be done with a mixture of
- * AbsTimes and Durations.
- *
- * For example, convenience operators to add a Duration and AbsTime returning
- * an AbsTime would fit here (although you can already perform the operation
- * with one of the AbsTime constructors). However trying to add 2 AbsTimes
- * doesn't make sense.
- */
-class AbsTime {
- friend class Duration;
-
- TimePrivate timepoint;
-
-public:
- inline AbsTime() {}
- AbsTime(const AbsTime& time0, const Duration& duration);
- // Default assignment operation fine
- // Default copy constructor fine
-
- static AbsTime now();
- static AbsTime FarFuture();
- const TimePrivate& getPrivate(void) const { return timepoint; }
- bool operator==(const AbsTime& t) const { return t.timepoint == timepoint; }
- template <class S> void serialize(S& s) { s(timepoint); }
-
- friend bool operator<(const AbsTime& a, const AbsTime& b);
- friend bool operator>(const AbsTime& a, const AbsTime& b);
- friend std::ostream& operator << (std::ostream&, const AbsTime&);
-};
-
-std::ostream& operator << (std::ostream&, const AbsTime&);
-
-/**
- * @class Duration
- * Class to represent the duration between instants of time.
- *
- * As AbsTime, this class also uses nanosecs for its time
- * resolution where possible. For the most part a duration can be dealt
- * with like a 64 bit integer, and indeed there is an implicit conversion which
- * makes this quite convenient.
- */
-class Duration {
- static int64_t max() { return std::numeric_limits<int64_t>::max(); }
- int64_t nanosecs;
-
- friend class AbsTime;
-
-public:
- inline Duration(int64_t time0);
- explicit Duration(const AbsTime& time0);
- explicit Duration(const AbsTime& start, const AbsTime& finish);
- inline operator int64_t() const;
-};
-
-std::ostream& operator << (std::ostream&, const Duration&);
-
-inline AbsTime now() { return AbsTime::now(); }
-
-inline bool operator<(const AbsTime& a, const AbsTime& b)
-{ return a.timepoint < b.timepoint; }
-inline bool operator>(const AbsTime& a, const AbsTime& b)
-{ return a.timepoint > b.timepoint; }
-
-Duration::Duration(int64_t time0) :
- nanosecs(time0)
-{}
-
-Duration::operator int64_t() const
-{ return nanosecs; }
-
-/** Nanoseconds per second. */
-const Duration TIME_SEC = 1000*1000*1000;
-/** Nanoseconds per millisecond */
-const Duration TIME_MSEC = 1000*1000;
-/** Nanoseconds per microseconds. */
-const Duration TIME_USEC = 1000;
-/** Nanoseconds per nanosecond. */
-const Duration TIME_NSEC = 1;
-
-/** Value to represent an infinite timeout */
-const Duration TIME_INFINITE = std::numeric_limits<int64_t>::max();
-
-/** Time greater than any other time */
-const AbsTime FAR_FUTURE = AbsTime::FarFuture();
-
-/** Portable sleep for a number of seconds */
-void sleep(int secs);
-
-/** Portable sleep for a number of microseconds */
-void usleep(uint64_t usecs);
-
-}}
-
-#endif /*!_sys_Time_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/TimeoutHandler.h b/M4-RCs/qpid/cpp/src/qpid/sys/TimeoutHandler.h
deleted file mode 100644
index 0c10709bbf..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/TimeoutHandler.h
+++ /dev/null
@@ -1,39 +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.
- *
- */
-#ifndef _TimeoutHandler_
-#define _TimeoutHandler_
-
-namespace qpid {
-namespace sys {
-
- class TimeoutHandler
- {
- public:
- virtual void idleOut() = 0;
- virtual void idleIn() = 0;
- virtual ~TimeoutHandler(){}
- };
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/Waitable.h b/M4-RCs/qpid/cpp/src/qpid/sys/Waitable.h
deleted file mode 100644
index 7701b6f97d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/Waitable.h
+++ /dev/null
@@ -1,114 +0,0 @@
-#ifndef QPID_SYS_WAITABLE_H
-#define QPID_SYS_WAITABLE_H
-
-/*
- * 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 "qpid/sys/Monitor.h"
-#include "qpid/sys/ExceptionHolder.h"
-#include <assert.h>
-
-namespace qpid {
-namespace sys {
-
-/**
- * A monitor that keeps track of waiting threads. Threads declare a
- * ScopedWait around wait() inside a ScopedLock to be considered
- * waiters.
- *
- * Allows waiting threads to be interrupted by an exception.
- */
-class Waitable : public Monitor {
- public:
- Waitable() : waiters(0) {}
-
- ~Waitable() { assert(waiters == 0); }
-
- /** Use this inside a scoped lock around the
- * call to wait() to be counted as a waiter.
- */
- struct ScopedWait {
- Waitable& w;
- ScopedWait(Waitable& w_) : w(w_) { ++w.waiters; }
- ~ScopedWait() { if (--w.waiters==0) w.notifyAll(); }
- };
-
- /** Block till there are no more waiters in ScopedWaits.
- * waitWaiters() does not raise an exception even if waiters
- * were interrupted by one.
- *@pre Must be called inside a ScopedLock but NOT a ScopedWait.
- */
- void waitWaiters() {
- while (waiters != 0)
- Monitor::wait();
- }
-
- /** Returns the number of outstanding ScopedWaits.
- * Must be called with the lock held.
- */
- size_t hasWaiters() const {
- return waiters;
- }
-
- /** Set an execption to interrupt waiters in ScopedWait.
- * Must be called with the lock held.
- */
- void setException(const ExceptionHolder& e) {
- exception = e;
- notifyAll();
-
- }
-
- /** True if the waitable has an exception */
- bool hasException() const { return exception; }
-
- /** Clear the exception if any */
- void resetException() { exception.reset(); }
-
- /** Throws an exception if one is set before or during the wait. */
- void wait() {
- ExCheck e(exception);
- Monitor::wait();
- }
-
- /** Throws an exception if one is set before or during the wait. */
- bool wait(const AbsTime& absoluteTime) {
- ExCheck e(exception);
- return Monitor::wait(absoluteTime);
- }
-
- private:
- struct ExCheck {
- const ExceptionHolder& exception;
- ExCheck(const ExceptionHolder& e) : exception(e) { e.raise(); }
- ~ExCheck() { exception.raise(); }
- };
-
- size_t waiters;
- ExceptionHolder exception;
-
- friend struct ScopedWait;
-};
-
-}} // namespace qpid::sys
-
-
-
-#endif /*!QPID_SYS_WAITABLE_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRBase.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRBase.cpp
deleted file mode 100644
index 724c489303..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRBase.cpp
+++ /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.
- *
- */
-#include <iostream>
-#include "qpid/log/Statement.h"
-#include "APRBase.h"
-
-using namespace qpid::sys;
-
-APRBase* APRBase::instance = 0;
-
-APRBase* APRBase::getInstance(){
- if(instance == 0){
- instance = new APRBase();
- }
- return instance;
-}
-
-
-APRBase::APRBase() : count(0){
- apr_initialize();
- CHECK_APR_SUCCESS(apr_pool_create(&pool, 0));
- CHECK_APR_SUCCESS(apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_NESTED, pool));
-}
-
-APRBase::~APRBase(){
- CHECK_APR_SUCCESS(apr_thread_mutex_destroy(mutex));
- apr_pool_destroy(pool);
- apr_terminate();
-}
-
-bool APRBase::_increment(){
- bool deleted(false);
- CHECK_APR_SUCCESS(apr_thread_mutex_lock(mutex));
- if(this == instance){
- count++;
- }else{
- deleted = true;
- }
- CHECK_APR_SUCCESS(apr_thread_mutex_unlock(mutex));
- return !deleted;
-}
-
-void APRBase::_decrement(){
- APRBase* copy = 0;
- CHECK_APR_SUCCESS(apr_thread_mutex_lock(mutex));
- if(--count == 0){
- copy = instance;
- instance = 0;
- }
- CHECK_APR_SUCCESS(apr_thread_mutex_unlock(mutex));
- if(copy != 0){
- delete copy;
- }
-}
-
-void APRBase::increment(){
- int count = 0;
- while(count++ < 2 && !getInstance()->_increment())
- QPID_LOG(warning, "APR initialization triggered concurrently with termination.");
-}
-
-void APRBase::decrement(){
- getInstance()->_decrement();
-}
-
-std::string qpid::sys::get_desc(apr_status_t status){
- const int size = 50;
- char tmp[size];
- return std::string(apr_strerror(status, tmp, size));
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRBase.h b/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRBase.h
deleted file mode 100644
index 7b5644a129..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRBase.h
+++ /dev/null
@@ -1,74 +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.
- *
- */
-#ifndef _APRBase_
-#define _APRBase_
-
-#include <string>
-#include <apr_thread_mutex.h>
-#include <apr_errno.h>
-
-namespace qpid {
-namespace sys {
-
- /**
- * Use of APR libraries necessitates explicit init and terminate
- * calls. Any class using APR libs should obtain the reference to
- * this singleton and increment on construction, decrement on
- * destruction. This class can then correctly initialise apr
- * before the first use and terminate after the last use.
- */
- class APRBase{
- static APRBase* instance;
- apr_pool_t* pool;
- apr_thread_mutex_t* mutex;
- int count;
-
- APRBase();
- ~APRBase();
- static APRBase* getInstance();
- bool _increment();
- void _decrement();
- public:
- static void increment();
- static void decrement();
- };
-
- //this is also a convenient place for a helper function for error checking:
- void check(apr_status_t status, const char* file, const int line);
- std::string get_desc(apr_status_t status);
-
-#define CHECK_APR_SUCCESS(A) qpid::sys::check(A, __FILE__, __LINE__);
-
-}
-}
-
-// Inlined as it is called *a lot*
-void inline qpid::sys::check(apr_status_t status, const char* file, const int line){
- if (status != APR_SUCCESS){
- char tmp[256];
- throw Exception(QPID_MSG(apr_strerror(status, tmp, size)))
- }
-}
-
-
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRPool.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRPool.cpp
deleted file mode 100644
index e8b71f6e8a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRPool.cpp
+++ /dev/null
@@ -1,41 +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 "APRPool.h"
-#include "APRBase.h"
-#include <boost/pool/detail/singleton.hpp>
-
-using namespace qpid::sys;
-
-APRPool::APRPool(){
- APRBase::increment();
- CHECK_APR_SUCCESS(apr_pool_create(&pool, NULL));
-}
-
-APRPool::~APRPool(){
- apr_pool_destroy(pool);
- APRBase::decrement();
-}
-
-apr_pool_t* APRPool::get() {
- return boost::details::pool::singleton_default<APRPool>::instance().pool;
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRPool.h b/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRPool.h
deleted file mode 100644
index da7661fcfa..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/apr/APRPool.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef _APRPool_
-#define _APRPool_
-
-/*
- *
- * 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 <boost/noncopyable.hpp>
-#include <apr_pools.h>
-
-namespace qpid {
-namespace sys {
-/**
- * Singleton APR memory pool.
- */
-class APRPool : private boost::noncopyable {
- public:
- APRPool();
- ~APRPool();
-
- /** Get singleton instance */
- static apr_pool_t* get();
-
- private:
- apr_pool_t* pool;
-};
-
-}}
-
-
-
-
-
-#endif /*!_APRPool_*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Condition.h b/M4-RCs/qpid/cpp/src/qpid/sys/apr/Condition.h
deleted file mode 100644
index 5e544219ab..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Condition.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef _sys_apr_Condition_h
-#define _sys_apr_Condition_h
-
-/*
- *
- * 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 "APRPool.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/Time.h"
-
-#include <sys/errno.h>
-#include <boost/noncopyable.hpp>
-#include <apr_thread_cond.h>
-
-namespace qpid {
-namespace sys {
-
-/**
- * A condition variable for thread synchronization.
- */
-class Condition
-{
- public:
- inline Condition();
- inline ~Condition();
- inline void wait(Mutex&);
- inline bool wait(Mutex&, const AbsTime& absoluteTime);
- inline void notify();
- inline void notifyAll();
-
- private:
- apr_thread_cond_t* condition;
-};
-
-
-Condition::Condition() {
- CHECK_APR_SUCCESS(apr_thread_cond_create(&condition, APRPool::get()));
-}
-
-Condition::~Condition() {
- CHECK_APR_SUCCESS(apr_thread_cond_destroy(condition));
-}
-
-void Condition::wait(Mutex& mutex) {
- CHECK_APR_SUCCESS(apr_thread_cond_wait(condition, mutex.mutex));
-}
-
-bool Condition::wait(Mutex& mutex, const AbsTime& absoluteTime){
- // APR uses microseconds.
- apr_status_t status =
- apr_thread_cond_timedwait(
- condition, mutex.mutex, Duration(now(), absoluteTime)/TIME_USEC);
- if(status != APR_TIMEUP) CHECK_APR_SUCCESS(status);
- return status == 0;
-}
-
-void Condition::notify(){
- CHECK_APR_SUCCESS(apr_thread_cond_signal(condition));
-}
-
-void Condition::notifyAll(){
- CHECK_APR_SUCCESS(apr_thread_cond_broadcast(condition));
-}
-
-}}
-#endif /*!_sys_apr_Condition_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Mutex.h b/M4-RCs/qpid/cpp/src/qpid/sys/apr/Mutex.h
deleted file mode 100644
index 51089c98ff..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Mutex.h
+++ /dev/null
@@ -1,124 +0,0 @@
-#ifndef _sys_apr_Mutex_h
-#define _sys_apr_Mutex_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "APRBase.h"
-#include "APRPool.h"
-
-#include <boost/noncopyable.hpp>
-#include <apr_thread_mutex.h>
-
-namespace qpid {
-namespace sys {
-
-class Condition;
-
-/**
- * Mutex lock.
- */
-class Mutex : private boost::noncopyable {
- public:
- typedef ScopedLock<Mutex> ScopedLock;
- typedef ScopedUnlock<Mutex> ScopedUnlock;
-
- inline Mutex();
- inline ~Mutex();
- inline void lock();
- inline void unlock();
- inline bool trylock();
-
- protected:
- apr_thread_mutex_t* mutex;
- friend class Condition;
-};
-
-Mutex::Mutex() {
- CHECK_APR_SUCCESS(apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_NESTED, APRPool::get()));
-}
-
-Mutex::~Mutex(){
- CHECK_APR_SUCCESS(apr_thread_mutex_destroy(mutex));
-}
-
-void Mutex::lock() {
- CHECK_APR_SUCCESS(apr_thread_mutex_lock(mutex));
-}
-void Mutex::unlock() {
- CHECK_APR_SUCCESS(apr_thread_mutex_unlock(mutex));
-}
-
-bool Mutex::trylock() {
- return apr_thread_mutex_trylock(mutex) == 0;
-}
-
-
-/**
- * RW lock.
- */
-class RWlock : private boost::noncopyable {
- friend class Condition;
-
-public:
- typedef ScopedRlock<RWlock> ScopedRlock;
- typedef ScopedWlock<RWlock> ScopedWlock;
-
- inline RWlock();
- inline ~RWlock();
- inline void wlock(); // will write-lock
- inline void rlock(); // will read-lock
- inline void unlock();
- inline bool trywlock(); // will write-try
- inline bool tryrlock(); // will read-try
-
- protected:
- apr_thread_mutex_t* mutex;
-};
-
-RWlock::RWlock() {
- CHECK_APR_SUCCESS(apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_NESTED, APRPool::get()));
-}
-
-RWlock::~RWlock(){
- CHECK_APR_SUCCESS(apr_thread_mutex_destroy(mutex));
-}
-
-void RWlock::wlock() {
- CHECK_APR_SUCCESS(apr_thread_mutex_lock(mutex));
-}
-
-void RWlock::rlock() {
- CHECK_APR_SUCCESS(apr_thread_mutex_lock(mutex));
-}
-
-void RWlock::unlock() {
- CHECK_APR_SUCCESS(apr_thread_mutex_unlock(mutex));
-}
-
-bool RWlock::trywlock() {
- return apr_thread_mutex_trylock(mutex) == 0;
-}
-
-bool RWlock::tryrlock() {
- return apr_thread_mutex_trylock(mutex) == 0;
-}
-
-
-}}
-#endif /*!_sys_apr_Mutex_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Shlib.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/apr/Shlib.cpp
deleted file mode 100644
index b0ba706713..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Shlib.cpp
+++ /dev/null
@@ -1,49 +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 "qpid/sys/Shlib.h"
-#include "APRBase.h"
-#include "APRPool.h"
-#include <apr_dso.h>
-
-namespace qpid {
-namespace sys {
-
-void Shlib::load(const char* libname) {
- apr_dso_handle_t* aprHandle;
- CHECK_APR_SUCCESS(
- apr_dso_load(&aprHandle, libname, APRPool::get()));
- handle=aprHandle;
-}
-
-void Shlib::unload() {
- CHECK_APR_SUCCESS(
- apr_dso_unload(static_cast<apr_dso_handle_t*>(handle)));
-}
-
-void* Shlib::getSymbol(const char* name) {
- apr_dso_handle_sym_t symbol;
- CHECK_APR_SUCCESS(apr_dso_sym(&symbol,
- static_cast<apr_dso_handle_t*>(handle),
- name));
- return (void*) symbol;
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Socket.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/apr/Socket.cpp
deleted file mode 100644
index 577268844a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Socket.cpp
+++ /dev/null
@@ -1,114 +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 "qpid/sys/Socket.h"
-
-#include "APRBase.h"
-#include "APRPool.h"
-
-#include <apr_network_io.h>
-
-namespace qpid {
-namespace sys {
-
-class SocketPrivate {
-public:
- SocketPrivate(apr_socket_t* s = 0) :
- socket(s)
- {}
-
- apr_socket_t* socket;
-};
-
-Socket::Socket() :
- impl(new SocketPrivate)
-{
- createTcp();
-}
-
-Socket::Socket(SocketPrivate* sp) :
- impl(sp)
-{}
-
-Socket::~Socket() {
- delete impl;
-}
-
-void Socket::createTcp() const {
- apr_socket_t*& socket = impl->socket;
- apr_socket_t* s;
- CHECK_APR_SUCCESS(
- apr_socket_create(
- &s, APR_INET, SOCK_STREAM, APR_PROTO_TCP,
- APRPool::get()));
- socket = s;
-}
-
-void Socket::setTimeout(const Duration& interval) const {
- apr_socket_t*& socket = impl->socket;
- apr_socket_timeout_set(socket, interval/TIME_USEC);
-}
-
-void Socket::connect(const std::string& host, int port) const {
- apr_socket_t*& socket = impl->socket;
- apr_sockaddr_t* address;
- CHECK_APR_SUCCESS(
- apr_sockaddr_info_get(
- &address, host.c_str(), APR_UNSPEC, port, APR_IPV4_ADDR_OK,
- APRPool::get()));
- CHECK_APR_SUCCESS(apr_socket_connect(socket, address));
-}
-
-void Socket::close() const {
- apr_socket_t*& socket = impl->socket;
- if (socket == 0) return;
- CHECK_APR_SUCCESS(apr_socket_close(socket));
- socket = 0;
-}
-
-ssize_t Socket::send(const void* data, size_t size) const
-{
- apr_socket_t*& socket = impl->socket;
- apr_size_t sent = size;
- apr_status_t status =
- apr_socket_send(socket, reinterpret_cast<const char*>(data), &sent);
- if (APR_STATUS_IS_TIMEUP(status)) return SOCKET_TIMEOUT;
- if (APR_STATUS_IS_EOF(status)) return SOCKET_EOF;
- CHECK_APR_SUCCESS(status);
- return sent;
-}
-
-ssize_t Socket::recv(void* data, size_t size) const
-{
- apr_socket_t*& socket = impl->socket;
- apr_size_t received = size;
- apr_status_t status =
- apr_socket_recv(socket, reinterpret_cast<char*>(data), &received);
- if (APR_STATUS_IS_TIMEUP(status))
- return SOCKET_TIMEOUT;
- if (APR_STATUS_IS_EOF(status))
- return SOCKET_EOF;
- CHECK_APR_SUCCESS(status);
- return received;
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Thread.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/apr/Thread.cpp
deleted file mode 100644
index 3369ef7eb1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Thread.cpp
+++ /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.
- *
- */
-
-#include "Thread.h"
-#include "qpid/sys/Runnable.h"
-
-using namespace qpid::sys;
-using qpid::sys::Runnable;
-
-void* APR_THREAD_FUNC Thread::runRunnable(apr_thread_t* thread, void *data) {
- reinterpret_cast<Runnable*>(data)->run();
- CHECK_APR_SUCCESS(apr_thread_exit(thread, APR_SUCCESS));
- return NULL;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Thread.h b/M4-RCs/qpid/cpp/src/qpid/sys/apr/Thread.h
deleted file mode 100644
index 8cbbc0456e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Thread.h
+++ /dev/null
@@ -1,106 +0,0 @@
-#ifndef _sys_apr_Thread_h
-#define _sys_apr_Thread_h
-
-/*
- *
- * 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 "APRPool.h"
-#include "APRBase.h"
-
-#include <apr_thread_proc.h>
-#include <apr_portable.h>
-
-namespace qpid {
-namespace sys {
-
-class Runnable;
-
-class Thread
-{
- public:
- inline static Thread current();
-
- /** ID of current thread for logging.
- * Workaround for broken Thread::current() in APR
- */
- inline static long logId();
-
- inline static void yield();
-
- inline Thread();
- inline explicit Thread(qpid::sys::Runnable*);
- inline explicit Thread(qpid::sys::Runnable&);
-
- inline void join();
-
- inline long id();
-
- private:
- static void* APR_THREAD_FUNC runRunnable(apr_thread_t* thread, void *data);
- inline Thread(apr_thread_t* t);
- apr_thread_t* thread;
-};
-
-Thread::Thread() : thread(0) {}
-
-Thread::Thread(Runnable* runnable) {
- CHECK_APR_SUCCESS(
- apr_thread_create(&thread, 0, runRunnable, runnable, APRPool::get()));
-}
-
-Thread::Thread(Runnable& runnable) {
- CHECK_APR_SUCCESS(
- apr_thread_create(&thread, 0, runRunnable, &runnable, APRPool::get()));
-}
-
-void Thread::join(){
- apr_status_t status;
- if (thread != 0)
- CHECK_APR_SUCCESS(apr_thread_join(&status, thread));
-}
-
-long Thread::id() {
- return long(thread);
-}
-
-/** ID of current thread for logging.
- * Workaround for broken Thread::current() in APR
- */
-long Thread::logId() {
- return static_cast<long>(apr_os_thread_current());
-}
-
-Thread::Thread(apr_thread_t* t) : thread(t) {}
-
-Thread Thread::current(){
- apr_thread_t* thr;
- apr_os_thread_t osthr = apr_os_thread_current();
- CHECK_APR_SUCCESS(apr_os_thread_put(&thr, &osthr, APRPool::get()));
- return Thread(thr);
-}
-
-void Thread::yield()
-{
- apr_thread_yield();
-}
-
-}}
-#endif /*!_sys_apr_Thread_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Time.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/apr/Time.cpp
deleted file mode 100644
index 34e740b144..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/apr/Time.cpp
+++ /dev/null
@@ -1,36 +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 "qpid/sys/Time.h"
-
-#include <apr_time.h>
-
-namespace qpid {
-namespace sys {
-
-AbsTime AbsTime::now() {
- AbsTime time_now;
- time_now.time_ns = apr_time_now() * TIME_USEC;
- return time_now;
-}
-
-}}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
deleted file mode 100644
index a1e624ea75..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/epoll/EpollPoller.cpp
+++ /dev/null
@@ -1,371 +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 "qpid/sys/Poller.h"
-#include "qpid/sys/IOHandle.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/DeletionManager.h"
-#include "qpid/sys/posix/check.h"
-#include "qpid/sys/posix/PrivatePosix.h"
-
-#include <sys/epoll.h>
-#include <errno.h>
-
-#include <assert.h>
-#include <vector>
-#include <exception>
-
-namespace qpid {
-namespace sys {
-
-// Deletion manager to handle deferring deletion of PollerHandles to when they definitely aren't being used
-DeletionManager<PollerHandlePrivate> PollerHandleDeletionManager;
-
-// Instantiate (and define) class static for DeletionManager
-template <>
-DeletionManager<PollerHandlePrivate>::AllThreadsStatuses DeletionManager<PollerHandlePrivate>::allThreadsStatuses(0);
-
-class PollerHandlePrivate {
- friend class Poller;
- friend class PollerHandle;
-
- enum FDStat {
- ABSENT,
- MONITORED,
- INACTIVE,
- HUNGUP,
- MONITORED_HUNGUP,
- DELETED
- };
-
- int fd;
- ::__uint32_t events;
- PollerHandle* pollerHandle;
- FDStat stat;
- Mutex lock;
-
- PollerHandlePrivate(int f, PollerHandle* p) :
- fd(f),
- events(0),
- pollerHandle(p),
- stat(ABSENT) {
- }
-
- bool isActive() const {
- return stat == MONITORED || stat == MONITORED_HUNGUP;
- }
-
- void setActive() {
- stat = (stat == HUNGUP) ? MONITORED_HUNGUP : MONITORED;
- }
-
- bool isInactive() const {
- return stat == INACTIVE || stat == HUNGUP;
- }
-
- void setInactive() {
- stat = INACTIVE;
- }
-
- bool isIdle() const {
- return stat == ABSENT;
- }
-
- void setIdle() {
- stat = ABSENT;
- }
-
- bool isHungup() const {
- return stat == MONITORED_HUNGUP || stat == HUNGUP;
- }
-
- void setHungup() {
- assert(stat == MONITORED);
- stat = HUNGUP;
- }
-
- bool isDeleted() const {
- return stat == DELETED;
- }
-
- void setDeleted() {
- stat = DELETED;
- }
-};
-
-PollerHandle::PollerHandle(const IOHandle& h) :
- impl(new PollerHandlePrivate(toFd(h.impl), this))
-{}
-
-PollerHandle::~PollerHandle() {
- {
- ScopedLock<Mutex> l(impl->lock);
- if (impl->isDeleted()) {
- return;
- }
- if (impl->isActive()) {
- impl->setDeleted();
- }
- }
- PollerHandleDeletionManager.markForDeletion(impl);
-}
-
-/**
- * Concrete implementation of Poller to use the Linux specific epoll
- * interface
- */
-class PollerPrivate {
- friend class Poller;
-
- static const int DefaultFds = 256;
-
- struct ReadablePipe {
- int fds[2];
-
- /**
- * This encapsulates an always readable pipe which we can add
- * to the epoll set to force epoll_wait to return
- */
- ReadablePipe() {
- QPID_POSIX_CHECK(::pipe(fds));
- // Just write the pipe's fds to the pipe
- QPID_POSIX_CHECK(::write(fds[1], fds, 2));
- }
-
- ~ReadablePipe() {
- ::close(fds[0]);
- ::close(fds[1]);
- }
-
- int getFD() {
- return fds[0];
- }
- };
-
- static ReadablePipe alwaysReadable;
-
- const int epollFd;
- bool isShutdown;
-
- static ::__uint32_t directionToEpollEvent(Poller::Direction dir) {
- switch (dir) {
- case Poller::INPUT: return ::EPOLLIN;
- case Poller::OUTPUT: return ::EPOLLOUT;
- case Poller::INOUT: return ::EPOLLIN | ::EPOLLOUT;
- default: return 0;
- }
- }
-
- static Poller::EventType epollToDirection(::__uint32_t events) {
- // POLLOUT & POLLHUP are mutually exclusive really, but at least socketpairs
- // can give you both!
- events = (events & ::EPOLLHUP) ? events & ~::EPOLLOUT : events;
- ::__uint32_t e = events & (::EPOLLIN | ::EPOLLOUT);
- switch (e) {
- case ::EPOLLIN: return Poller::READABLE;
- case ::EPOLLOUT: return Poller::WRITABLE;
- case ::EPOLLIN | ::EPOLLOUT: return Poller::READ_WRITABLE;
- default:
- return (events & (::EPOLLHUP | ::EPOLLERR)) ?
- Poller::DISCONNECTED : Poller::INVALID;
- }
- }
-
- PollerPrivate() :
- epollFd(::epoll_create(DefaultFds)),
- isShutdown(false) {
- QPID_POSIX_CHECK(epollFd);
- }
-
- ~PollerPrivate() {
- // It's probably okay to ignore any errors here as there can't be data loss
- ::close(epollFd);
- }
-};
-
-PollerPrivate::ReadablePipe PollerPrivate::alwaysReadable;
-
-void Poller::addFd(PollerHandle& handle, Direction dir) {
- PollerHandlePrivate& eh = *handle.impl;
- ScopedLock<Mutex> l(eh.lock);
- ::epoll_event epe;
- int op;
-
- if (eh.isIdle()) {
- op = EPOLL_CTL_ADD;
- epe.events = PollerPrivate::directionToEpollEvent(dir) | ::EPOLLONESHOT;
- } else {
- assert(eh.isActive());
- op = EPOLL_CTL_MOD;
- epe.events = eh.events | PollerPrivate::directionToEpollEvent(dir);
- }
- epe.data.u64 = 0; // Keep valgrind happy
- epe.data.ptr = &eh;
-
- QPID_POSIX_CHECK(::epoll_ctl(impl->epollFd, op, eh.fd, &epe));
-
- // Record monitoring state of this fd
- eh.events = epe.events;
- eh.setActive();
-}
-
-void Poller::delFd(PollerHandle& handle) {
- PollerHandlePrivate& eh = *handle.impl;
- ScopedLock<Mutex> l(eh.lock);
- assert(!eh.isIdle());
- int rc = ::epoll_ctl(impl->epollFd, EPOLL_CTL_DEL, eh.fd, 0);
- // Ignore EBADF since deleting a nonexistent fd has the overall required result!
- // And allows the case where a sloppy program closes the fd and then does the delFd()
- if (rc == -1 && errno != EBADF) {
- QPID_POSIX_CHECK(rc);
- }
- eh.setIdle();
-}
-
-// modFd is equivalent to delFd followed by addFd
-void Poller::modFd(PollerHandle& handle, Direction dir) {
- PollerHandlePrivate& eh = *handle.impl;
- ScopedLock<Mutex> l(eh.lock);
- assert(!eh.isIdle());
-
- ::epoll_event epe;
- epe.events = PollerPrivate::directionToEpollEvent(dir) | ::EPOLLONESHOT;
- epe.data.u64 = 0; // Keep valgrind happy
- epe.data.ptr = &eh;
-
- QPID_POSIX_CHECK(::epoll_ctl(impl->epollFd, EPOLL_CTL_MOD, eh.fd, &epe));
-
- // Record monitoring state of this fd
- eh.events = epe.events;
- eh.setActive();
-}
-
-void Poller::rearmFd(PollerHandle& handle) {
- PollerHandlePrivate& eh = *handle.impl;
- ScopedLock<Mutex> l(eh.lock);
- assert(eh.isInactive());
-
- ::epoll_event epe;
- epe.events = eh.events;
- epe.data.u64 = 0; // Keep valgrind happy
- epe.data.ptr = &eh;
-
- QPID_POSIX_CHECK(::epoll_ctl(impl->epollFd, EPOLL_CTL_MOD, eh.fd, &epe));
-
- eh.setActive();
-}
-
-void Poller::shutdown() {
- // NB: this function must be async-signal safe, it must not
- // call any function that is not async-signal safe.
-
- // Allow sloppy code to shut us down more than once
- if (impl->isShutdown)
- return;
-
- // Don't use any locking here - isshutdown will be visible to all
- // after the epoll_ctl() anyway (it's a memory barrier)
- impl->isShutdown = true;
-
- // Add always readable fd to epoll (not EPOLLONESHOT)
- int fd = impl->alwaysReadable.getFD();
- ::epoll_event epe;
- epe.events = ::EPOLLIN;
- epe.data.u64 = 0; // Keep valgrind happy - don't strictly need next line now
- epe.data.ptr = 0;
- QPID_POSIX_CHECK(::epoll_ctl(impl->epollFd, EPOLL_CTL_ADD, fd, &epe));
-}
-
-Poller::Event Poller::wait(Duration timeout) {
- epoll_event epe;
- int timeoutMs = (timeout == TIME_INFINITE) ? -1 : timeout / TIME_MSEC;
-
- // Repeat until we weren't interupted
- do {
- PollerHandleDeletionManager.markAllUnusedInThisThread();
- int rc = ::epoll_wait(impl->epollFd, &epe, 1, timeoutMs);
-
- if (impl->isShutdown) {
- PollerHandleDeletionManager.markAllUnusedInThisThread();
- return Event(0, SHUTDOWN);
- }
-
- if (rc ==-1 && errno != EINTR) {
- QPID_POSIX_CHECK(rc);
- } else if (rc > 0) {
- assert(rc == 1);
- PollerHandlePrivate& eh = *static_cast<PollerHandlePrivate*>(epe.data.ptr);
-
- ScopedLock<Mutex> l(eh.lock);
-
- // the handle could have gone inactive since we left the epoll_wait
- if (eh.isActive()) {
- PollerHandle* handle = eh.pollerHandle;
-
- // If the connection has been hungup we could still be readable
- // (just not writable), allow us to readable until we get here again
- if (epe.events & ::EPOLLHUP) {
- if (eh.isHungup()) {
- return Event(handle, DISCONNECTED);
- }
- eh.setHungup();
- } else {
- eh.setInactive();
- }
- return Event(handle, PollerPrivate::epollToDirection(epe.events));
- } else if (eh.isDeleted()) {
- // The handle has been deleted whilst still active and so must be removed
- // from the poller
- int rc = ::epoll_ctl(impl->epollFd, EPOLL_CTL_DEL, eh.fd, 0);
- // Ignore EBADF since it's quite likely that we could race with closing the fd
- if (rc == -1 && errno != EBADF) {
- QPID_POSIX_CHECK(rc);
- }
- }
- }
- // We only get here if one of the following:
- // * epoll_wait was interrupted by a signal
- // * epoll_wait timed out
- // * the state of the handle changed after being returned by epoll_wait
- //
- // The only things we can do here are return a timeout or wait more.
- // Obviously if we timed out we return timeout; if the wait was meant to
- // be indefinite then we should never return with a time out so we go again.
- // If the wait wasn't indefinite, but we were interrupted then we have to return
- // with a timeout as we don't know how long we've waited so far and so we can't
- // continue the wait.
- if (rc == 0 || timeoutMs != -1) {
- PollerHandleDeletionManager.markAllUnusedInThisThread();
- return Event(0, TIMEOUT);
- }
- } while (true);
-}
-
-// Concrete constructors
-Poller::Poller() :
- impl(new PollerPrivate())
-{}
-
-Poller::~Poller() {
- delete impl;
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
deleted file mode 100644
index 9a5798311b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/AsynchIO.cpp
+++ /dev/null
@@ -1,595 +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 "qpid/sys/AsynchIO.h"
-#include "qpid/sys/Socket.h"
-#include "qpid/sys/Time.h"
-#include "qpid/log/Statement.h"
-
-#include "check.h"
-
-// TODO The basic algorithm here is not really POSIX specific and with a
-// bit more abstraction could (should) be promoted to be platform portable
-#include <unistd.h>
-#include <sys/socket.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-
-#include <boost/bind.hpp>
-
-using namespace qpid::sys;
-
-namespace {
-
-struct StaticInit {
- StaticInit() {
- /**
- * Make *process* not generate SIGPIPE when writing to closed
- * pipe/socket (necessary as default action is to terminate process)
- */
- ::signal(SIGPIPE, SIG_IGN);
- };
-} init;
-
-/*
- * We keep per thread state to avoid locking overhead. The assumption is that
- * on average all the connections are serviced by all the threads so the state
- * recorded in each thread is about the same. If this turns out not to be the
- * case we could rebalance the info occasionally.
- */
-__thread int threadReadTotal = 0;
-__thread int threadMaxRead = 0;
-__thread int threadReadCount = 0;
-__thread int threadWriteTotal = 0;
-__thread int threadWriteCount = 0;
-__thread int64_t threadMaxReadTimeNs = 2 * 1000000; // start at 2ms
-}
-
-/*
- * Asynch Acceptor
- */
-namespace qpid {
-namespace sys {
-
-class AsynchAcceptorPrivate {
-public:
- AsynchAcceptorPrivate(const Socket& s, AsynchAcceptor::Callback callback);
- void start(Poller::shared_ptr poller);
-
-private:
- void readable(DispatchHandle& handle);
-
-private:
- AsynchAcceptor::Callback acceptedCallback;
- DispatchHandle handle;
- const Socket& socket;
-
-};
-
-}} // namespace qpid::sys
-
-AsynchAcceptor::AsynchAcceptor(const Socket& s, Callback callback) :
- impl(new AsynchAcceptorPrivate(s, callback))
-{}
-
-AsynchAcceptor::~AsynchAcceptor()
-{ delete impl;}
-
-void AsynchAcceptor::start(Poller::shared_ptr poller) {
- impl->start(poller);
-}
-
-AsynchAcceptorPrivate::AsynchAcceptorPrivate(const Socket& s,
- AsynchAcceptor::Callback callback) :
- acceptedCallback(callback),
- handle(s, boost::bind(&AsynchAcceptorPrivate::readable, this, _1), 0, 0),
- socket(s) {
-
- s.setNonblocking();
-}
-
-void AsynchAcceptorPrivate::start(Poller::shared_ptr poller) {
- handle.startWatch(poller);
-}
-
-/*
- * We keep on accepting as long as there is something to accept
- */
-void AsynchAcceptorPrivate::readable(DispatchHandle& h) {
- Socket* s;
- do {
- errno = 0;
- // TODO: Currently we ignore the peers address, perhaps we should
- // log it or use it for connection acceptance.
- try {
- s = socket.accept(0, 0);
- if (s) {
- acceptedCallback(*s);
- } else {
- break;
- }
- } catch (const std::exception& e) {
- QPID_LOG(error, "Could not accept socket: " << e.what());
- }
- } while (true);
-
- h.rewatch();
-}
-
-/*
- * Asynch Connector
- */
-namespace qpid {
-namespace sys {
-namespace posix {
-
-/*
- * POSIX version of AsynchIO TCP socket connector.
- *
- * The class is implemented in terms of DispatchHandle to allow it to be
- * deleted by deleting the contained DispatchHandle.
- */
-class AsynchConnector : public qpid::sys::AsynchConnector,
- private DispatchHandle {
-
-private:
- void connComplete(DispatchHandle& handle);
- void failure(int, std::string);
-
-private:
- ConnectedCallback connCallback;
- FailedCallback failCallback;
- const Socket& socket;
-
-public:
- AsynchConnector(const Socket& socket,
- Poller::shared_ptr poller,
- std::string hostname,
- uint16_t port,
- ConnectedCallback connCb,
- FailedCallback failCb = 0);
-};
-
-AsynchConnector::AsynchConnector(const Socket& s,
- Poller::shared_ptr poller,
- std::string hostname,
- uint16_t port,
- ConnectedCallback connCb,
- FailedCallback failCb) :
- DispatchHandle(s,
- 0,
- boost::bind(&AsynchConnector::connComplete, this, _1),
- boost::bind(&AsynchConnector::connComplete, this, _1)),
- connCallback(connCb),
- failCallback(failCb),
- socket(s)
-{
- socket.setNonblocking();
- try {
- socket.connect(hostname, port);
- startWatch(poller);
- } catch(std::exception& e) {
- failure(-1, std::string(e.what()));
- }
-}
-
-void AsynchConnector::connComplete(DispatchHandle& h)
-{
- int errCode = socket.getError();
-
- h.stopWatch();
- if (errCode == 0) {
- connCallback(socket);
- DispatchHandle::doDelete();
- } else {
- // TODO: This need to be fixed as strerror isn't thread safe
- failure(errCode, std::string(::strerror(errCode)));
- }
-}
-
-void AsynchConnector::failure(int errCode, std::string message)
-{
- if (failCallback)
- failCallback(errCode, message);
-
- socket.close();
- delete &socket;
-
- DispatchHandle::doDelete();
-}
-
-} // namespace posix
-
-
-AsynchConnector* qpid::sys::AsynchConnector::create(const Socket& s,
- Poller::shared_ptr poller,
- std::string hostname,
- uint16_t port,
- ConnectedCallback connCb,
- FailedCallback failCb)
-{
- return new qpid::sys::posix::AsynchConnector(s,
- poller,
- hostname,
- port,
- connCb,
- failCb);
-}
-
-/*
- * POSIX version of AsynchIO reader/writer
- *
- * The class is implemented in terms of DispatchHandle to allow it to be
- * deleted by deleting the contained DispatchHandle.
- */
-namespace posix {
-
-class AsynchIO : public qpid::sys::AsynchIO, private DispatchHandle {
-
-public:
- AsynchIO(const Socket& s,
- ReadCallback rCb,
- EofCallback eofCb,
- DisconnectCallback disCb,
- ClosedCallback cCb = 0,
- BuffersEmptyCallback eCb = 0,
- IdleCallback iCb = 0);
-
- // Methods inherited from qpid::sys::AsynchIO
-
- virtual void queueForDeletion();
-
- virtual void start(Poller::shared_ptr poller);
- virtual void queueReadBuffer(BufferBase* buff);
- virtual void unread(BufferBase* buff);
- virtual void queueWrite(BufferBase* buff);
- virtual void notifyPendingWrite();
- virtual void queueWriteClose();
- virtual bool writeQueueEmpty();
- virtual void startReading();
- virtual BufferBase* getQueuedBuffer();
-
-private:
- ~AsynchIO();
-
- // Methods that are callback targets from Dispatcher.
- void readable(DispatchHandle& handle);
- void writeable(DispatchHandle& handle);
- void disconnected(DispatchHandle& handle);
- void close(DispatchHandle& handle);
-
-private:
- ReadCallback readCallback;
- EofCallback eofCallback;
- DisconnectCallback disCallback;
- ClosedCallback closedCallback;
- BuffersEmptyCallback emptyCallback;
- IdleCallback idleCallback;
- const Socket& socket;
- std::deque<BufferBase*> bufferQueue;
- std::deque<BufferBase*> writeQueue;
- bool queuedClose;
- /**
- * This flag is used to detect and handle concurrency between
- * calls to notifyPendingWrite() (which can be made from any thread) and
- * the execution of the writeable() method (which is always on the
- * thread processing this handle.
- */
- volatile bool writePending;
-};
-
-AsynchIO::AsynchIO(const Socket& s,
- ReadCallback rCb, EofCallback eofCb, DisconnectCallback disCb,
- ClosedCallback cCb, BuffersEmptyCallback eCb, IdleCallback iCb) :
-
- DispatchHandle(s,
- boost::bind(&AsynchIO::readable, this, _1),
- boost::bind(&AsynchIO::writeable, this, _1),
- boost::bind(&AsynchIO::disconnected, this, _1)),
- readCallback(rCb),
- eofCallback(eofCb),
- disCallback(disCb),
- closedCallback(cCb),
- emptyCallback(eCb),
- idleCallback(iCb),
- socket(s),
- queuedClose(false),
- writePending(false) {
-
- s.setNonblocking();
-}
-
-struct deleter
-{
- template <typename T>
- void operator()(T *ptr){ delete ptr;}
-};
-
-AsynchIO::~AsynchIO() {
- std::for_each( bufferQueue.begin(), bufferQueue.end(), deleter());
- std::for_each( writeQueue.begin(), writeQueue.end(), deleter());
-}
-
-void AsynchIO::queueForDeletion() {
- DispatchHandle::doDelete();
-}
-
-void AsynchIO::start(Poller::shared_ptr poller) {
- DispatchHandle::startWatch(poller);
-}
-
-void AsynchIO::queueReadBuffer(BufferBase* buff) {
- assert(buff);
- buff->dataStart = 0;
- buff->dataCount = 0;
- bufferQueue.push_back(buff);
- DispatchHandle::rewatchRead();
-}
-
-void AsynchIO::unread(BufferBase* buff) {
- assert(buff);
- if (buff->dataStart != 0) {
- memmove(buff->bytes, buff->bytes+buff->dataStart, buff->dataCount);
- buff->dataStart = 0;
- }
- bufferQueue.push_front(buff);
- DispatchHandle::rewatchRead();
-}
-
-void AsynchIO::queueWrite(BufferBase* buff) {
- assert(buff);
- // If we've already closed the socket then throw the write away
- if (queuedClose) {
- bufferQueue.push_front(buff);
- return;
- } else {
- writeQueue.push_front(buff);
- }
- writePending = false;
- DispatchHandle::rewatchWrite();
-}
-
-void AsynchIO::notifyPendingWrite() {
- writePending = true;
- DispatchHandle::rewatchWrite();
-}
-
-void AsynchIO::queueWriteClose() {
- queuedClose = true;
- DispatchHandle::rewatchWrite();
-}
-
-bool AsynchIO::writeQueueEmpty() {
- return writeQueue.empty();
-}
-
-void AsynchIO::startReading() {
- DispatchHandle::rewatchRead();
-}
-
-/** Return a queued buffer if there are enough
- * to spare
- */
-AsynchIO::BufferBase* AsynchIO::getQueuedBuffer() {
- // Always keep at least one buffer (it might have data that was "unread" in it)
- if (bufferQueue.size()<=1)
- return 0;
- BufferBase* buff = bufferQueue.back();
- assert(buff);
- buff->dataStart = 0;
- buff->dataCount = 0;
- bufferQueue.pop_back();
- return buff;
-}
-
-/*
- * We keep on reading as long as we have something to read and a buffer to put
- * it in
- */
-void AsynchIO::readable(DispatchHandle& h) {
- int readTotal = 0;
- AbsTime readStartTime = AbsTime::now();
- do {
- // (Try to) get a buffer
- if (!bufferQueue.empty()) {
- // Read into buffer
- BufferBase* buff = bufferQueue.front();
- assert(buff);
- bufferQueue.pop_front();
- errno = 0;
- int readCount = buff->byteCount-buff->dataCount;
- int rc = socket.read(buff->bytes + buff->dataCount, readCount);
- if (rc > 0) {
- buff->dataCount += rc;
- threadReadTotal += rc;
- readTotal += rc;
-
- if (!readCallback(*this, buff)) {
- // We were told to flow control reading at this point
- h.unwatchRead();
- break;
- }
-
- if (rc != readCount) {
- // If we didn't fill the read buffer then time to stop reading
- break;
- }
-
- // Stop reading if we've overrun our timeslot
- if (Duration(readStartTime, AbsTime::now()) > threadMaxReadTimeNs) {
- break;
- }
-
- } else {
- // Put buffer back (at front so it doesn't interfere with unread buffers)
- bufferQueue.push_front(buff);
- assert(buff);
-
- // Eof or other side has gone away
- if (rc == 0 || errno == ECONNRESET) {
- eofCallback(*this);
- h.unwatchRead();
- break;
- } else if (errno == EAGAIN) {
- // We have just put a buffer back so we know
- // we can carry on watching for reads
- break;
- } else {
- // Report error then just treat as a socket disconnect
- QPID_LOG(error, "Error reading socket: " << qpid::sys::strError(rc) << "(" << rc << ")" );
- eofCallback(*this);
- h.unwatchRead();
- break;
- }
- }
- } else {
- // Something to read but no buffer
- if (emptyCallback) {
- emptyCallback(*this);
- }
- // If we still have no buffers we can't do anything more
- if (bufferQueue.empty()) {
- h.unwatchRead();
- break;
- }
-
- }
- } while (true);
-
- ++threadReadCount;
- threadMaxRead = std::max(threadMaxRead, readTotal);
- return;
-}
-
-/*
- * We carry on writing whilst we have data to write and we can write
- */
-void AsynchIO::writeable(DispatchHandle& h) {
- int writeTotal = 0;
- do {
- // See if we've got something to write
- if (!writeQueue.empty()) {
- // Write buffer
- BufferBase* buff = writeQueue.back();
- writeQueue.pop_back();
- errno = 0;
- assert(buff->dataStart+buff->dataCount <= buff->byteCount);
- int rc = socket.write(buff->bytes+buff->dataStart, buff->dataCount);
- if (rc >= 0) {
- threadWriteTotal += rc;
- writeTotal += rc;
-
- // If we didn't write full buffer put rest back
- if (rc != buff->dataCount) {
- buff->dataStart += rc;
- buff->dataCount -= rc;
- writeQueue.push_back(buff);
- break;
- }
-
- // Recycle the buffer
- queueReadBuffer(buff);
-
- // If we've already written more than the max for reading then stop
- // (this is to stop writes dominating reads)
- if (writeTotal > threadMaxRead)
- break;
- } else {
- // Put buffer back
- writeQueue.push_back(buff);
- if (errno == ECONNRESET || errno == EPIPE) {
- // Just stop watching for write here - we'll get a
- // disconnect callback soon enough
- h.unwatchWrite();
- break;
- } else if (errno == EAGAIN) {
- // We have just put a buffer back so we know
- // we can carry on watching for writes
- break;
- } else {
- QPID_POSIX_CHECK(rc);
- }
- }
- } else {
- // If we're waiting to close the socket then can do it now as there is nothing to write
- if (queuedClose) {
- close(h);
- break;
- }
- // Fd is writable, but nothing to write
- if (idleCallback) {
- writePending = false;
- idleCallback(*this);
- }
- // If we still have no buffers to write we can't do anything more
- if (writeQueue.empty() && !writePending && !queuedClose) {
- h.unwatchWrite();
- // The following handles the case where writePending is
- // set to true after the test above; in this case its
- // possible that the unwatchWrite overwrites the
- // desired rewatchWrite so we correct that here
- if (writePending)
- h.rewatchWrite();
- break;
- }
- }
- } while (true);
-
- ++threadWriteCount;
- return;
-}
-
-void AsynchIO::disconnected(DispatchHandle& h) {
- // If we've already queued close do it instead of disconnected callback
- if (queuedClose) {
- close(h);
- } else if (disCallback) {
- disCallback(*this);
- h.unwatch();
- }
-}
-
-/*
- * Close the socket and callback to say we've done it
- */
-void AsynchIO::close(DispatchHandle& h) {
- h.stopWatch();
- socket.close();
- if (closedCallback) {
- closedCallback(*this, socket);
- }
-}
-
-} // namespace posix
-
-AsynchIO* qpid::sys::AsynchIO::create(const Socket& s,
- AsynchIO::ReadCallback rCb,
- AsynchIO::EofCallback eofCb,
- AsynchIO::DisconnectCallback disCb,
- AsynchIO::ClosedCallback cCb,
- AsynchIO::BuffersEmptyCallback eCb,
- AsynchIO::IdleCallback iCb)
-{
- return new qpid::sys::posix::AsynchIO(s, rCb, eofCb, disCb, cCb, eCb, iCb);
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Condition.h b/M4-RCs/qpid/cpp/src/qpid/sys/posix/Condition.h
deleted file mode 100644
index 86d6500ee9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Condition.h
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef _sys_posix_Condition_h
-#define _sys_posix_Condition_h
-
-/*
- *
- * 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 "PrivatePosix.h"
-
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/Time.h"
-
-#include <time.h>
-#include <sys/errno.h>
-#include <boost/noncopyable.hpp>
-
-namespace qpid {
-namespace sys {
-
-/**
- * A condition variable for thread synchronization.
- */
-class Condition
-{
- public:
- inline Condition();
- inline ~Condition();
- inline void wait(Mutex&);
- inline bool wait(Mutex&, const AbsTime& absoluteTime);
- inline void notify();
- inline void notifyAll();
-
- private:
- pthread_cond_t condition;
-};
-
-Condition::Condition() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_cond_init(&condition, 0));
-}
-
-Condition::~Condition() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_cond_destroy(&condition));
-}
-
-void Condition::wait(Mutex& mutex) {
- QPID_POSIX_ASSERT_THROW_IF(pthread_cond_wait(&condition, &mutex.mutex));
-}
-
-bool Condition::wait(Mutex& mutex, const AbsTime& absoluteTime){
- struct timespec ts;
- toTimespec(ts, Duration(absoluteTime));
- int status = pthread_cond_timedwait(&condition, &mutex.mutex, &ts);
- if (status != 0) {
- if (status == ETIMEDOUT) return false;
- throw QPID_POSIX_ERROR(status);
- }
- return true;
-}
-
-void Condition::notify(){
- QPID_POSIX_ASSERT_THROW_IF(pthread_cond_signal(&condition));
-}
-
-void Condition::notifyAll(){
- QPID_POSIX_ASSERT_THROW_IF(pthread_cond_broadcast(&condition));
-}
-
-}}
-#endif /*!_sys_posix_Condition_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/FileSysDir.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/FileSysDir.cpp
deleted file mode 100755
index 22dc487e74..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/FileSysDir.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/sys/FileSysDir.h"
-#include "qpid/sys/StrError.h"
-#include "qpid/Exception.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <cerrno>
-#include <unistd.h>
-
-namespace qpid {
-namespace sys {
-
-bool FileSysDir::exists (void) const
-{
- const char *cpath = dirPath.c_str ();
- struct stat s;
- if (::stat(cpath, &s)) {
- if (errno == ENOENT) {
- return false;
- }
- throw qpid::Exception (strError(errno) +
- ": Can't check directory: " + dirPath);
- }
- if (S_ISDIR(s.st_mode))
- return true;
- throw qpid::Exception(dirPath + " is not a directory");
-}
-
-void FileSysDir::mkdir(void)
-{
- if (::mkdir(dirPath.c_str(), 0755))
- throw Exception ("Can't create directory: " + dirPath);
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Fork.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/Fork.cpp
deleted file mode 100644
index ec3af620ef..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Fork.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-#include "qpid/sys/Fork.h"
-#include "qpid/log/Statement.h"
-#include "qpid/Exception.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-namespace qpid {
-namespace sys {
-
-using namespace std;
-
-namespace {
-
-void writeStr(int fd, const std::string& str) {
- const char* WRITE_ERR = "Error writing to parent process";
- int size = str.size();
- if (int(sizeof(size)) > ::write(fd, &size, sizeof(size))) throw ErrnoException(WRITE_ERR);
- if (size > ::write(fd, str.data(), size)) throw ErrnoException(WRITE_ERR);
-}
-
-string readStr(int fd) {
- string value;
- const char* READ_ERR = "Error reading from forked process";
- int size;
- if (int(sizeof(size)) > ::read(fd, &size, sizeof(size))) throw ErrnoException(READ_ERR);
- if (size > 0) { // Read string message
- value.resize(size);
- if (size > ::read(fd, const_cast<char*>(value.data()), size)) throw ErrnoException(READ_ERR);
- }
- return value;
-}
-
-} // namespace
-
-Fork::Fork() {}
-Fork::~Fork() {}
-
-void Fork::fork() {
- pid_t pid = ::fork();
- if (pid < 0) throw ErrnoException("Failed to fork the process");
- if (pid == 0) child();
- else parent(pid);
-}
-
-ForkWithMessage::ForkWithMessage() {
- pipeFds[0] = pipeFds[1] = -1;
-}
-
-struct AutoCloseFd {
- int fd;
- AutoCloseFd(int d) : fd(d) {}
- ~AutoCloseFd() { ::close(fd); }
-};
-
-void ForkWithMessage::fork() {
- if(::pipe(pipeFds) < 0) throw ErrnoException("Can't create pipe");
- pid_t pid = ::fork();
- if(pid < 0) throw ErrnoException("Fork fork failed");
- if (pid == 0) { // Child
- AutoCloseFd ac(pipeFds[1]); // Write side.
- ::close(pipeFds[0]); // Read side
- try {
- child();
- }
- catch (const std::exception& e) {
- QPID_LOG(error, "Error in forked child: " << e.what());
- std::string msg = e.what();
- if (msg.empty()) msg = " "; // Make sure we send a non-empty error string.
- writeStr(pipeFds[1], msg);
- }
- }
- else { // Parent
- close(pipeFds[1]); // Write side.
- AutoCloseFd ac(pipeFds[0]); // Read side
- parent(pid);
- }
-}
-
-string ForkWithMessage::wait(int timeout) { // parent waits for child.
- errno = 0;
- struct timeval tv;
- tv.tv_sec = timeout;
- tv.tv_usec = 0;
-
- fd_set fds;
- FD_ZERO(&fds);
- FD_SET(pipeFds[0], &fds);
- int n=select(FD_SETSIZE, &fds, 0, 0, &tv);
- if(n<0) throw ErrnoException("Error waiting for fork");
- if (n==0) throw Exception("Timed out waiting for fork");
-
- string error = readStr(pipeFds[0]);
- if (error.empty()) return readStr(pipeFds[0]);
- else throw Exception("Error in forked process: " + error);
-}
-
-// Write empty error string followed by value string to pipe.
-void ForkWithMessage::ready(const string& value) { // child
- // Write empty string for error followed by value.
- writeStr(pipeFds[1], string()); // No error
- writeStr(pipeFds[1], value);
-}
-
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Fork.h b/M4-RCs/qpid/cpp/src/qpid/sys/posix/Fork.h
deleted file mode 100644
index 698c61ed30..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Fork.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef QPID_SYS_POSIX_FORK_H
-#define QPID_SYS_POSIX_FORK_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <string>
-#include <sys/types.h>
-
-namespace qpid {
-namespace sys {
-
-/**
- * Fork the process. Call parent() in parent and child() in child.
- */
-class Fork {
- public:
- Fork();
- virtual ~Fork();
-
- /**
- * Fork the process.
- * Calls parent() in the parent process, child() in the child.
- */
- virtual void fork();
-
- protected:
-
- /** Called in parent process.
- *@child pid of child process
- */
- virtual void parent(pid_t child) = 0;
-
- /** Called in child process */
- virtual void child() = 0;
-};
-
-/**
- * Like Fork but also allows the child to send a string message
- * or throw an exception to the parent.
- */
-class ForkWithMessage : public Fork {
- public:
- ForkWithMessage();
- void fork();
-
- protected:
- /** Call from parent(): wait for child to send a value or throw exception.
- * @timeout in seconds to wait for response.
- * @return value passed by child to ready().
- */
- std::string wait(int timeout);
-
- /** Call from child(): Send a value to the parent.
- *@param value returned by parent call to wait().
- */
- void ready(const std::string& value);
-
- private:
- int pipeFds[2];
-};
-
-}} // namespace qpid::sys
-
-
-
-#endif /*!QPID_SYS_POSIX_FORK_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/IOHandle.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/IOHandle.cpp
deleted file mode 100644
index 80b487eadc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/IOHandle.cpp
+++ /dev/null
@@ -1,42 +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 "qpid/sys/IOHandle.h"
-
-#include "PrivatePosix.h"
-
-namespace qpid {
-namespace sys {
-
-int toFd(const IOHandlePrivate* h)
-{
- return h->fd;
-}
-
-IOHandle::IOHandle(IOHandlePrivate* h) :
- impl(h)
-{}
-
-IOHandle::~IOHandle() {
- delete impl;
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/IntegerTypes.h b/M4-RCs/qpid/cpp/src/qpid/sys/posix/IntegerTypes.h
deleted file mode 100755
index ce97f7bde8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/IntegerTypes.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef QPID_SYS_POSIX_INTEGERTYPES_H
-#define QPID_SYS_POSIX_INTEGERTYPES_H
-
-/*
- * 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 <stdint.h>
-
-#endif /*!QPID_SYS_INTEGERTYPES_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/LockFile.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/LockFile.cpp
deleted file mode 100755
index af9ecd7d66..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/LockFile.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *
- * Copyright (c) 2008 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/sys/LockFile.h"
-
-#include <string>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "check.h"
-
-namespace qpid {
-namespace sys {
-
-class LockFilePrivate {
- friend class LockFile;
-
- int fd;
-
-public:
- LockFilePrivate(int f) : fd(f) {}
-};
-
-LockFile::LockFile(const std::string& path_, bool create)
- : path(path_), created(create) {
-
- errno = 0;
- int flags=create ? O_WRONLY|O_CREAT|O_NOFOLLOW : O_RDWR;
- int fd = ::open(path.c_str(), flags, 0644);
- if (fd < 0) throw ErrnoException("Cannot open " + path, errno);
- if (::lockf(fd, F_TLOCK, 0) < 0) {
- ::close(fd);
- throw ErrnoException("Cannot lock " + path, errno);
- }
- impl.reset(new LockFilePrivate(fd));
-}
-
-LockFile::~LockFile() {
- if (impl) {
- int f = impl->fd;
- if (f >= 0) {
- (void) ::lockf(f, F_ULOCK, 0); // Suppress warnings about ignoring return value.
- ::close(f);
- impl->fd = -1;
- }
- }
-}
-
-pid_t LockFile::readPid(void) const {
- if (!impl)
- throw Exception("Lock file not open");
-
- pid_t pid;
- int desired_read = sizeof(pid_t);
- if (desired_read > ::read(impl->fd, &pid, desired_read) ) {
- throw Exception("Cannot read lock file " + path);
- }
- return pid;
-}
-
-void LockFile::writePid(void) {
- if (!impl)
- throw Exception("Lock file not open");
-
- pid_t pid = getpid();
- int desired_write = sizeof(pid_t);
- if (desired_write > ::write(impl->fd, &pid, desired_write)) {
- throw Exception("Cannot write lock file " + path);
- }
-}
-
-}} /* namespace qpid::sys */
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Mutex.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/Mutex.cpp
deleted file mode 100644
index 0e1f0d30c2..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Mutex.cpp
+++ /dev/null
@@ -1,46 +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 "qpid/sys/Mutex.h"
-
-namespace qpid {
-namespace sys {
-
-/**
- * Initialise a recursive mutex attr for use in creating mutexes later
- * (we use pthread_once to make sure it is initialised exactly once)
- */
-
-namespace {
-pthread_once_t onceControl = PTHREAD_ONCE_INIT;
-pthread_mutexattr_t mutexattr;
-
-void initMutexattr() {
- pthread_mutexattr_init(&mutexattr);
- pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE);
-}
-}
-
-const pthread_mutexattr_t* Mutex::getAttribute() {
- pthread_once(&onceControl, initMutexattr);
- return &mutexattr;
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Mutex.h b/M4-RCs/qpid/cpp/src/qpid/sys/posix/Mutex.h
deleted file mode 100644
index cd5a8affd4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Mutex.h
+++ /dev/null
@@ -1,158 +0,0 @@
-#ifndef _sys_posix_Mutex_h
-#define _sys_posix_Mutex_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "check.h"
-
-#include <pthread.h>
-#include <boost/noncopyable.hpp>
-
-namespace qpid {
-namespace sys {
-
-class Condition;
-
-/**
- * Mutex lock.
- */
-class Mutex : private boost::noncopyable {
- friend class Condition;
- static const pthread_mutexattr_t* getAttribute();
-
-public:
- typedef ::qpid::sys::ScopedLock<Mutex> ScopedLock;
- typedef ::qpid::sys::ScopedUnlock<Mutex> ScopedUnlock;
-
- inline Mutex();
- inline ~Mutex();
- inline void lock();
- inline void unlock();
- inline bool trylock();
-
-
-protected:
- pthread_mutex_t mutex;
-};
-
-/**
- * RW lock.
- */
-class RWlock : private boost::noncopyable {
- friend class Condition;
-
-public:
- typedef ::qpid::sys::ScopedRlock<RWlock> ScopedRlock;
- typedef ::qpid::sys::ScopedWlock<RWlock> ScopedWlock;
-
- inline RWlock();
- inline ~RWlock();
- inline void wlock(); // will write-lock
- inline void rlock(); // will read-lock
- inline void unlock();
- inline void trywlock(); // will write-try
- inline void tryrlock(); // will read-try
-
-protected:
- pthread_rwlock_t rwlock;
-};
-
-
-/**
- * PODMutex is a POD, can be static-initialized with
- * PODMutex m = QPID_PODMUTEX_INITIALIZER
- */
-struct PODMutex
-{
- typedef ::qpid::sys::ScopedLock<PODMutex> ScopedLock;
-
- inline void lock();
- inline void unlock();
- inline bool trylock();
-
- // Must be public to be a POD:
- pthread_mutex_t mutex;
-};
-
-#define QPID_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER }
-
-void PODMutex::lock() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_mutex_lock(&mutex));
-}
-
-void PODMutex::unlock() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_mutex_unlock(&mutex));
-}
-
-bool PODMutex::trylock() {
- return pthread_mutex_trylock(&mutex) == 0;
-}
-
-Mutex::Mutex() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_mutex_init(&mutex, getAttribute()));
-}
-
-Mutex::~Mutex(){
- QPID_POSIX_ASSERT_THROW_IF(pthread_mutex_destroy(&mutex));
-}
-
-void Mutex::lock() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_mutex_lock(&mutex));
-}
-
-void Mutex::unlock() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_mutex_unlock(&mutex));
-}
-
-bool Mutex::trylock() {
- return pthread_mutex_trylock(&mutex) == 0;
-}
-
-
-RWlock::RWlock() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_rwlock_init(&rwlock, NULL));
-}
-
-RWlock::~RWlock(){
- QPID_POSIX_ASSERT_THROW_IF(pthread_rwlock_destroy(&rwlock));
-}
-
-void RWlock::wlock() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_rwlock_wrlock(&rwlock));
-}
-
-void RWlock::rlock() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_rwlock_rdlock(&rwlock));
-}
-
-void RWlock::unlock() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_rwlock_unlock(&rwlock));
-}
-
-void RWlock::trywlock() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_rwlock_trywrlock(&rwlock));
-}
-
-void RWlock::tryrlock() {
- QPID_POSIX_ASSERT_THROW_IF(pthread_rwlock_tryrdlock(&rwlock));
-}
-
-
-}}
-#endif /*!_sys_posix_Mutex_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/PollableCondition.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/PollableCondition.cpp
deleted file mode 100644
index 0c55fd3c0d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/PollableCondition.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-#ifndef QPID_SYS_LINUX_POLLABLECONDITION_CPP
-#define QPID_SYS_LINUX_POLLABLECONDITION_CPP
-
-/*
- *
- * 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 "PollableCondition.h"
-#include "qpid/sys/posix/PrivatePosix.h"
-#include "qpid/Exception.h"
-
-#include <unistd.h>
-#include <fcntl.h>
-
-namespace qpid {
-namespace sys {
-
-PollableCondition::PollableCondition() : IOHandle(new sys::IOHandlePrivate) {
- int fds[2];
- if (::pipe(fds) == -1)
- throw ErrnoException(QPID_MSG("Can't create PollableCondition"));
- impl->fd = fds[0];
- writeFd = fds[1];
- if (::fcntl(impl->fd, F_SETFL, O_NONBLOCK) == -1)
- throw ErrnoException(QPID_MSG("Can't create PollableCondition"));
- if (::fcntl(writeFd, F_SETFL, O_NONBLOCK) == -1)
- throw ErrnoException(QPID_MSG("Can't create PollableCondition"));
-}
-
-bool PollableCondition::clear() {
- char buf[256];
- ssize_t n;
- bool wasSet = false;
- while ((n = ::read(impl->fd, buf, sizeof(buf))) > 0)
- wasSet = true;
- if (n == -1 && errno != EAGAIN) throw ErrnoException(QPID_MSG("Error clearing PollableCondition"));
- return wasSet;
-}
-
-void PollableCondition::set() {
- static const char dummy=0;
- ssize_t n = ::write(writeFd, &dummy, 1);
- if (n == -1 && errno != EAGAIN) throw ErrnoException("Error setting PollableCondition");
-}
-
-
-#if 0
-// FIXME aconway 2008-08-12: More efficient Linux implementation using
-// eventfd system call. Move to separate file & do configure.ac test
-// to enable this when ::eventfd() is available.
-
-#include <sys/eventfd.h>
-
-namespace qpid {
-namespace sys {
-
-PollableCondition::PollableCondition() : IOHandle(new sys::IOHandlePrivate) {
- impl->fd = ::eventfd(0, 0);
- if (impl->fd < 0) throw ErrnoException("conditionfd() failed");
-}
-
-bool PollableCondition::clear() {
- char buf[8];
- ssize_t n = ::read(impl->fd, buf, 8);
- if (n != 8) throw ErrnoException("read failed on conditionfd");
- return *reinterpret_cast<uint64_t*>(buf);
-}
-
-void PollableCondition::set() {
- static const uint64_t value=1;
- ssize_t n = ::write(impl->fd, reinterpret_cast<const void*>(&value), 8);
- if (n != 8) throw ErrnoException("write failed on conditionfd");
-}
-
-#endif
-
-}} // namespace qpid::sys
-
-#endif /*!QPID_SYS_LINUX_POLLABLECONDITION_CPP*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/PollableCondition.h b/M4-RCs/qpid/cpp/src/qpid/sys/posix/PollableCondition.h
deleted file mode 100644
index 4ec277b0ec..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/PollableCondition.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef QPID_SYS_POSIX_POLLABLECONDITION_H
-#define QPID_SYS_POSIX_POLLABLECONDITION_H
-
-/*
- *
- * 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 "qpid/sys/IOHandle.h"
-
-namespace qpid {
-namespace sys {
-
-/**
- * A pollable condition to integrate in-process conditions with IO
- * conditions in a polling loop.
- *
- * Setting the condition makes it readable for a poller.
- *
- * Writable/disconnected conditions are undefined and should not be
- * polled for.
- */
-class PollableCondition : public sys::IOHandle {
- public:
- PollableCondition();
-
- /** Set the condition, triggers readable in a poller. */
- void set();
-
- /** Get the current state of the condition, then clear it.
- *@return The state of the condition before it was cleared.
- */
- bool clear();
-
- private:
- int writeFd;
-};
-}} // namespace qpid::sys
-
-#endif /*!QPID_SYS_POSIX_POLLABLECONDITION_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/PrivatePosix.h b/M4-RCs/qpid/cpp/src/qpid/sys/posix/PrivatePosix.h
deleted file mode 100644
index 33c0cd81bc..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/PrivatePosix.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef _sys_posix_PrivatePosix_h
-#define _sys_posix_PrivatePosix_h
-
-/*
- *
- * 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 "qpid/sys/Time.h"
-
-struct timespec;
-struct timeval;
-
-namespace qpid {
-namespace sys {
-
-// Private Time related implementation details
-struct timespec& toTimespec(struct timespec& ts, const Duration& t);
-struct timeval& toTimeval(struct timeval& tv, const Duration& t);
-Duration toTime(const struct timespec& ts);
-
-// Private fd related implementation details
-class IOHandlePrivate {
-public:
- IOHandlePrivate(int f = -1) :
- fd(f)
- {}
-
- int fd;
-};
-
-int toFd(const IOHandlePrivate* h);
-
-}}
-
-#endif /*!_sys_posix_PrivatePosix_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Shlib.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/Shlib.cpp
deleted file mode 100644
index 62dbfb3dd9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Shlib.cpp
+++ /dev/null
@@ -1,59 +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 "qpid/sys/Shlib.h"
-#include "qpid/Exception.h"
-#include <dlfcn.h>
-
-
-namespace qpid {
-namespace sys {
-
-void Shlib::load(const char* name) {
- dlerror();
- handle = ::dlopen(name, RTLD_NOW);
- const char* error = ::dlerror();
- if (error) {
- throw Exception(QPID_MSG(error << ": " << name));
- }
-}
-
-void Shlib::unload() {
- if (handle) {
- ::dlerror();
- ::dlclose(handle);
- const char* error = ::dlerror();
- if (error) {
- throw Exception(QPID_MSG(error));
- }
- handle = 0;
- }
-}
-
-void* Shlib::getSymbol(const char* name) {
- ::dlerror();
- void* sym = ::dlsym(handle, name);
- const char* error = ::dlerror();
- if (error)
- throw Exception(QPID_MSG(error << ": " << name));
- return sym;
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Socket.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/Socket.cpp
deleted file mode 100644
index 415d5293ef..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Socket.cpp
+++ /dev/null
@@ -1,264 +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 "qpid/sys/Socket.h"
-
-#include "check.h"
-#include "PrivatePosix.h"
-
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
-#include <cstdlib>
-#include <string.h>
-#include <iostream>
-
-#include <boost/format.hpp>
-
-namespace qpid {
-namespace sys {
-
-namespace {
-std::string getName(int fd, bool local, bool includeService = false)
-{
- ::sockaddr_storage name; // big enough for any socket address
- ::socklen_t namelen = sizeof(name);
-
- int result = -1;
- if (local) {
- result = ::getsockname(fd, (::sockaddr*)&name, &namelen);
- } else {
- result = ::getpeername(fd, (::sockaddr*)&name, &namelen);
- }
-
- QPID_POSIX_CHECK(result);
-
- char servName[NI_MAXSERV];
- char dispName[NI_MAXHOST];
- if (includeService) {
- if (int rc=::getnameinfo((::sockaddr*)&name, namelen, dispName, sizeof(dispName),
- servName, sizeof(servName),
- NI_NUMERICHOST | NI_NUMERICSERV) != 0)
- throw QPID_POSIX_ERROR(rc);
- return std::string(dispName) + ":" + std::string(servName);
-
- } else {
- if (int rc=::getnameinfo((::sockaddr*)&name, namelen, dispName, sizeof(dispName), 0, 0, NI_NUMERICHOST) != 0)
- throw QPID_POSIX_ERROR(rc);
- return dispName;
- }
-}
-
-std::string getService(int fd, bool local)
-{
- ::sockaddr_storage name; // big enough for any socket address
- ::socklen_t namelen = sizeof(name);
-
- int result = -1;
- if (local) {
- result = ::getsockname(fd, (::sockaddr*)&name, &namelen);
- } else {
- result = ::getpeername(fd, (::sockaddr*)&name, &namelen);
- }
-
- QPID_POSIX_CHECK(result);
-
- char servName[NI_MAXSERV];
- if (int rc=::getnameinfo((::sockaddr*)&name, namelen, 0, 0,
- servName, sizeof(servName),
- NI_NUMERICHOST | NI_NUMERICSERV) != 0)
- throw QPID_POSIX_ERROR(rc);
- return servName;
-}
-}
-
-Socket::Socket() :
- IOHandle(new IOHandlePrivate)
-{
- createTcp();
-}
-
-Socket::Socket(IOHandlePrivate* h) :
- IOHandle(h)
-{}
-
-void Socket::createTcp() const
-{
- int& socket = impl->fd;
- if (socket != -1) Socket::close();
- int s = ::socket (PF_INET, SOCK_STREAM, 0);
- if (s < 0) throw QPID_POSIX_ERROR(errno);
- socket = s;
-}
-
-void Socket::setTimeout(const Duration& interval) const
-{
- const int& socket = impl->fd;
- struct timeval tv;
- toTimeval(tv, interval);
- setsockopt(socket, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
- setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
-}
-
-void Socket::setNonblocking() const {
- QPID_POSIX_CHECK(::fcntl(impl->fd, F_SETFL, O_NONBLOCK));
-}
-
-namespace {
-const char* h_errstr(int e) {
- switch (e) {
- case HOST_NOT_FOUND: return "Host not found";
- case NO_ADDRESS: return "Name does not have an IP address";
- case TRY_AGAIN: return "A temporary error occurred on an authoritative name server.";
- case NO_RECOVERY: return "Non-recoverable name server error";
- default: return "Unknown error";
- }
-}
-}
-
-void Socket::connect(const std::string& host, uint16_t port) const
-{
- std::stringstream namestream;
- namestream << host << ":" << port;
- connectname = namestream.str();
-
- const int& socket = impl->fd;
- struct sockaddr_in name;
- name.sin_family = AF_INET;
- name.sin_port = htons(port);
- // TODO: Be good to make this work for IPv6 as well as IPv4
- // Use more modern lookup functions
- struct hostent* hp = gethostbyname ( host.c_str() );
- if (hp == 0)
- throw Exception(QPID_MSG("Cannot resolve " << host << ": " << h_errstr(h_errno)));
- ::memcpy(&name.sin_addr.s_addr, hp->h_addr_list[0], hp->h_length);
- if ((::connect(socket, (struct sockaddr*)(&name), sizeof(name)) < 0) &&
- (errno != EINPROGRESS))
- throw qpid::Exception(QPID_MSG(strError(errno) << ": " << host << ":" << port));
-}
-
-void
-Socket::close() const
-{
- int& socket = impl->fd;
- if (socket == -1) return;
- if (::close(socket) < 0) throw QPID_POSIX_ERROR(errno);
- socket = -1;
-}
-
-int Socket::listen(uint16_t port, int backlog) const
-{
- const int& socket = impl->fd;
- int yes=1;
- QPID_POSIX_CHECK(setsockopt(socket,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(yes)));
- struct sockaddr_in name;
- name.sin_family = AF_INET;
- name.sin_port = htons(port);
- name.sin_addr.s_addr = 0;
- if (::bind(socket, (struct sockaddr*)&name, sizeof(name)) < 0)
- throw Exception(QPID_MSG("Can't bind to port " << port << ": " << strError(errno)));
- if (::listen(socket, backlog) < 0)
- throw Exception(QPID_MSG("Can't listen on port " << port << ": " << strError(errno)));
-
- socklen_t namelen = sizeof(name);
- if (::getsockname(socket, (struct sockaddr*)&name, &namelen) < 0)
- throw QPID_POSIX_ERROR(errno);
-
- return ntohs(name.sin_port);
-}
-
-Socket* Socket::accept(struct sockaddr *addr, socklen_t *addrlen) const
-{
- int afd = ::accept(impl->fd, addr, addrlen);
- if ( afd >= 0)
- return new Socket(new IOHandlePrivate(afd));
- else if (errno == EAGAIN)
- return 0;
- else throw QPID_POSIX_ERROR(errno);
-}
-
-int Socket::read(void *buf, size_t count) const
-{
- return ::read(impl->fd, buf, count);
-}
-
-int Socket::write(const void *buf, size_t count) const
-{
- return ::write(impl->fd, buf, count);
-}
-
-std::string Socket::getSockname() const
-{
- return getName(impl->fd, true);
-}
-
-std::string Socket::getPeername() const
-{
- return getName(impl->fd, false);
-}
-
-std::string Socket::getPeerAddress() const
-{
- if (!connectname.empty())
- return std::string (connectname);
- return getName(impl->fd, false, true);
-}
-
-std::string Socket::getLocalAddress() const
-{
- return getName(impl->fd, true, true);
-}
-
-uint16_t Socket::getLocalPort() const
-{
- return std::atoi(getService(impl->fd, true).c_str());
-}
-
-uint16_t Socket::getRemotePort() const
-{
- return atoi(getService(impl->fd, true).c_str());
-}
-
-int Socket::getError() const
-{
- int result;
- socklen_t rSize = sizeof (result);
-
- if (::getsockopt(impl->fd, SOL_SOCKET, SO_ERROR, &result, &rSize) < 0)
- throw QPID_POSIX_ERROR(errno);
-
- return result;
-}
-
-void Socket::setTcpNoDelay(bool nodelay) const
-{
- if (nodelay) {
- int flag = 1;
- int result = setsockopt(impl->fd, IPPROTO_TCP, TCP_NODELAY, (char *)&flag, sizeof(flag));
- QPID_POSIX_CHECK(result);
- }
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/StrError.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/StrError.cpp
deleted file mode 100644
index 633e20213c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/StrError.cpp
+++ /dev/null
@@ -1,41 +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 "qpid/sys/StrError.h"
-
-#include <string.h>
-
-namespace qpid {
-namespace sys {
-
-std::string strError(int err) {
- char buf[512] = "Unknown error";
-#ifdef _GNU_SOURCE
- // GNU strerror_r returns the message
- return ::strerror_r(err, buf, sizeof(buf));
-#else
- // POSIX strerror_r doesn't return the buffer
- ::strerror_r(err, buf, sizeof(buf));
- return std::string(buf);
-#endif
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp
deleted file mode 100755
index 938d4861c4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/SystemInfo.cpp
+++ /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.
- *
- */
-
-#include "qpid/sys/SystemInfo.h"
-
-#include <sys/ioctl.h>
-#include <sys/utsname.h>
-#include <net/if.h>
-#include <unistd.h>
-#include <arpa/inet.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#ifndef HOST_NAME_MAX
-# define HOST_NAME_MAX 256
-#endif
-
-using namespace std;
-
-namespace qpid {
-namespace sys {
-
-long SystemInfo::concurrency() {
-#ifdef _SC_NPROCESSORS_ONLN // Linux specific.
- return sysconf(_SC_NPROCESSORS_ONLN);
-#else
- return -1;
-#endif
-}
-
-bool SystemInfo::getLocalHostname (TcpAddress &address) {
- char name[HOST_NAME_MAX];
- if (::gethostname(name, sizeof(name)) != 0)
- return false;
- address.host = name;
- return true;
-}
-
-static const string LOCALHOST("127.0.0.1");
-
-void SystemInfo::getLocalIpAddresses (uint16_t port,
- std::vector<Address> &addrList) {
- int s = socket (PF_INET, SOCK_STREAM, 0);
- for (int i=1;;i++) {
- struct ifreq ifr;
- ifr.ifr_ifindex = i;
- if (::ioctl (s, SIOCGIFNAME, &ifr) < 0)
- break;
- /* now ifr.ifr_name is set */
- if (::ioctl (s, SIOCGIFADDR, &ifr) < 0)
- continue;
- struct sockaddr_in *sin = (struct sockaddr_in *) &ifr.ifr_addr;
- string addr(inet_ntoa(sin->sin_addr));
- if (addr != LOCALHOST)
- addrList.push_back(TcpAddress(addr, port));
- }
- if (addrList.empty()) {
- addrList.push_back(TcpAddress(LOCALHOST, port));
- }
- close (s);
-}
-
-void SystemInfo::getSystemId (std::string &osName,
- std::string &nodeName,
- std::string &release,
- std::string &version,
- std::string &machine)
-{
- struct utsname _uname;
- if (uname (&_uname) == 0)
- {
- osName = _uname.sysname;
- nodeName = _uname.nodename;
- release = _uname.release;
- version = _uname.version;
- machine = _uname.machine;
- }
-}
-
-uint32_t SystemInfo::getProcessId()
-{
- return (uint32_t) ::getpid();
-}
-
-uint32_t SystemInfo::getParentProcessId()
-{
- return (uint32_t) ::getppid();
-}
-
-
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Thread.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/Thread.cpp
deleted file mode 100644
index bb5641bc53..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Thread.cpp
+++ /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.
- *
- */
-
-#include "qpid/sys/Thread.h"
-
-#include "qpid/sys/Runnable.h"
-#include "check.h"
-
-#include <pthread.h>
-
-namespace qpid {
-namespace sys {
-
-namespace {
-void* runRunnable(void* p)
-{
- static_cast<Runnable*>(p)->run();
- return 0;
-}
-}
-
-struct ThreadPrivate {
- pthread_t thread;
-
- ThreadPrivate(Runnable* runnable) {
- QPID_POSIX_ASSERT_THROW_IF(::pthread_create(&thread, NULL, runRunnable, runnable));
- }
-
- ThreadPrivate() : thread(::pthread_self()) {}
-};
-
-Thread::Thread() {}
-
-Thread::Thread(Runnable* runnable) : impl(new ThreadPrivate(runnable)) {}
-
-Thread::Thread(Runnable& runnable) : impl(new ThreadPrivate(&runnable)) {}
-
-void Thread::join(){
- if (impl) {
- QPID_POSIX_ASSERT_THROW_IF(::pthread_join(impl->thread, 0));
- }
-}
-
-unsigned long Thread::id() {
- if (impl)
- return impl->thread;
- else
- return 0;
-}
-
-Thread Thread::current() {
- Thread t;
- t.impl.reset(new ThreadPrivate());
- return t;
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Time.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/posix/Time.cpp
deleted file mode 100644
index d8d0a58d2e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Time.cpp
+++ /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.
- *
- */
-
-#include "PrivatePosix.h"
-
-#include "qpid/sys/Time.h"
-#include <ostream>
-#include <time.h>
-#include <stdio.h>
-#include <sys/time.h>
-#include <unistd.h>
-
-namespace {
-int64_t max_abstime() { return std::numeric_limits<int64_t>::max(); }
-}
-
-namespace qpid {
-namespace sys {
-
-AbsTime::AbsTime(const AbsTime& t, const Duration& d) :
- timepoint(d == Duration::max() ? max_abstime() : t.timepoint+d.nanosecs)
-{}
-
-AbsTime AbsTime::FarFuture() {
- AbsTime ff; ff.timepoint = max_abstime(); return ff;
-}
-
-AbsTime AbsTime::now() {
- struct timespec ts;
- ::clock_gettime(CLOCK_REALTIME, &ts);
- AbsTime time_now;
- time_now.timepoint = toTime(ts).nanosecs;
- return time_now;
-}
-
-Duration::Duration(const AbsTime& time0) :
- nanosecs(time0.timepoint)
-{}
-
-Duration::Duration(const AbsTime& start, const AbsTime& finish) :
- nanosecs(finish.timepoint - start.timepoint)
-{}
-
-struct timespec& toTimespec(struct timespec& ts, const Duration& t) {
- ts.tv_sec = t / TIME_SEC;
- ts.tv_nsec = t % TIME_SEC;
- return ts;
-}
-
-struct timeval& toTimeval(struct timeval& tv, const Duration& t) {
- tv.tv_sec = t/TIME_SEC;
- tv.tv_usec = (t%TIME_SEC)/TIME_USEC;
- return tv;
-}
-
-Duration toTime(const struct timespec& ts) {
- return ts.tv_sec*TIME_SEC + ts.tv_nsec;
-}
-
-std::ostream& operator<<(std::ostream& o, const Duration& d) {
- return o << int64_t(d) << "ns";
-}
-
-std::ostream& operator<<(std::ostream& o, const AbsTime& t) {
- static const char * month_abbrevs[] = {
- "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"
- };
- struct tm * timeinfo;
- time_t rawtime(t.timepoint/TIME_SEC);
- timeinfo = localtime (&rawtime);
- char time_string[100];
- sprintf ( time_string,
- "%d-%s-%02d %02d:%02d:%02d",
- 1900 + timeinfo->tm_year,
- month_abbrevs[timeinfo->tm_mon],
- timeinfo->tm_mday,
- timeinfo->tm_hour,
- timeinfo->tm_min,
- timeinfo->tm_sec
- );
- return o << time_string;
-}
-
-void sleep(int secs) {
- ::sleep(secs);
-}
-
-void usleep(uint64_t usecs) {
- ::usleep(usecs);
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Time.h b/M4-RCs/qpid/cpp/src/qpid/sys/posix/Time.h
deleted file mode 100755
index 62d734c816..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/Time.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef QPID_SYS_POSIX_TIME_H
-#define QPID_SYS_POSIX_TIME_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/sys/IntegerTypes.h"
-
-namespace qpid {
-namespace sys {
-
-/**
- * Class to represent an instant in time.
- */
-typedef int64_t TimePrivate;
-
-}} // namespace qpid::sys
-
-#endif /*!QPID_SYS_POSIX_TIME_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/posix/check.h b/M4-RCs/qpid/cpp/src/qpid/sys/posix/check.h
deleted file mode 100644
index f3031b7593..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/posix/check.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _posix_check_h
-#define _posix_check_h
-
-/*
- *
- * 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 "qpid/Exception.h"
-
-#include <cerrno>
-#include <assert.h>
-#include <stdio.h>
-
-#define QPID_POSIX_ERROR(ERRNO) qpid::Exception(QPID_MSG(qpid::sys::strError(ERRNO)))
-
-/** THROW QPID_POSIX_ERROR(errno) if RESULT is less than zero */
-#define QPID_POSIX_CHECK(RESULT) \
- if ((RESULT) < 0) throw QPID_POSIX_ERROR((errno))
-
-/** Throw a posix error if ERRNO is non-zero */
-#define QPID_POSIX_THROW_IF(ERRNO) \
- do { int e=(ERRNO); if (e) throw QPID_POSIX_ERROR(e); } while(0)
-
-/** Same as _THROW_IF in a release build, but abort a debug build */
-#ifdef NDEBUG
-#define QPID_POSIX_ASSERT_THROW_IF(ERRNO) QPID_POSIX_THROW_IF(ERRNO)
-#else
-#define QPID_POSIX_ASSERT_THROW_IF(ERRNO) \
- do { int e=(ERRNO); if (e) { errno=e; ::perror(0); assert(0); } } while(0)
-#endif
-
-#endif /*!_posix_check_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaClient.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaClient.cpp
deleted file mode 100644
index 0d3dd83131..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaClient.cpp
+++ /dev/null
@@ -1,207 +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 "RdmaIO.h"
-#include "qpid/sys/Time.h"
-
-#include <netdb.h>
-#include <arpa/inet.h>
-
-#include <vector>
-#include <string>
-#include <iostream>
-#include <algorithm>
-#include <cmath>
-#include <boost/bind.hpp>
-
-using std::vector;
-using std::string;
-using std::cout;
-using std::cerr;
-using std::copy;
-using std::rand;
-
-using qpid::sys::Poller;
-using qpid::sys::Dispatcher;
-using qpid::sys::AbsTime;
-using qpid::sys::Duration;
-using qpid::sys::TIME_SEC;
-using qpid::sys::TIME_INFINITE;
-
-// count of messages
-int64_t smsgs = 0;
-int64_t sbytes = 0;
-int64_t rmsgs = 0;
-int64_t rbytes = 0;
-
-int target = 1000000;
-int msgsize = 200;
-AbsTime startTime;
-Duration sendingDuration(TIME_INFINITE);
-Duration fullTestDuration(TIME_INFINITE);
-
-vector<char> testString;
-
-void write(Rdma::AsynchIO& aio) {
- while (aio.writable()) {
- if (smsgs >= target)
- return;
- Rdma::Buffer* b = aio.getBuffer();
- std::copy(testString.begin(), testString.end(), b->bytes);
- b->dataCount = msgsize;
- aio.queueWrite(b);
- ++smsgs;
- sbytes += msgsize;
- }
-}
-
-void dataError(Rdma::AsynchIO&) {
- cout << "Data error:\n";
-}
-
-void data(Poller::shared_ptr p, Rdma::AsynchIO& aio, Rdma::Buffer* b) {
- ++rmsgs;
- rbytes += b->dataCount;
-
- // When all messages have been recvd stop
- if (rmsgs < target) {
- write(aio);
- } else {
- fullTestDuration = std::min(fullTestDuration, Duration(startTime, AbsTime::now()));
- if (aio.incompletedWrites() == 0)
- p->shutdown();
- }
-}
-
-void full(Rdma::AsynchIO& a, Rdma::Buffer* b) {
- // Warn as we shouldn't get here anymore
- cerr << "!";
-
- // Don't need to keep buffer just adjust the counts
- --smsgs;
- sbytes -= b->dataCount;
-
- // Give buffer back
- a.returnBuffer(b);
-}
-
-void idle(Poller::shared_ptr p, Rdma::AsynchIO& aio) {
- if (smsgs < target) {
- write(aio);
- } else {
- sendingDuration = std::min(sendingDuration, Duration(startTime, AbsTime::now()));
- if (rmsgs >= target && aio.incompletedWrites() == 0)
- p->shutdown();
- }
-}
-
-void connected(Poller::shared_ptr poller, Rdma::Connection::intrusive_ptr& ci, const Rdma::ConnectionParams& cp) {
- cout << "Connected\n";
- Rdma::QueuePair::intrusive_ptr q = ci->getQueuePair();
-
- Rdma::AsynchIO* aio = new Rdma::AsynchIO(ci->getQueuePair(),
- cp.maxRecvBufferSize, cp.initialXmitCredit , Rdma::DEFAULT_WR_ENTRIES,
- boost::bind(&data, poller, _1, _2),
- boost::bind(&idle, poller, _1),
- &full,
- dataError);
-
- startTime = AbsTime::now();
- write(*aio);
-
- aio->start(poller);
-}
-
-void disconnected(boost::shared_ptr<Poller> p, Rdma::Connection::intrusive_ptr&) {
- cout << "Disconnected\n";
- p->shutdown();
-}
-
-void connectionError(boost::shared_ptr<Poller> p, Rdma::Connection::intrusive_ptr&, const Rdma::ErrorType) {
- cout << "Connection error\n";
- p->shutdown();
-}
-
-void rejected(boost::shared_ptr<Poller> p, Rdma::Connection::intrusive_ptr&, const Rdma::ConnectionParams&) {
- cout << "Connection rejected\n";
- p->shutdown();
-}
-
-int main(int argc, char* argv[]) {
- vector<string> args(&argv[0], &argv[argc]);
-
- ::addrinfo *res;
- ::addrinfo hints = {};
- hints.ai_family = AF_INET;
- hints.ai_socktype = SOCK_STREAM;
- string port = (args.size() < 3) ? "20079" : args[2];
- int n = ::getaddrinfo(args[1].c_str(), port.c_str(), &hints, &res);
- if (n<0) {
- cerr << "Can't find information for: " << args[1] << "\n";
- return 1;
- } else {
- cout << "Connecting to: " << args[1] << ":" << port <<"\n";
- }
-
- if (args.size() > 3)
- msgsize = atoi(args[3].c_str());
- cout << "Message size: " << msgsize << "\n";
-
- // Make a random message of that size
- testString.resize(msgsize);
- for (int i = 0; i < msgsize; ++i) {
- testString[i] = 32 + (rand() & 0x3f);
- }
-
- try {
- boost::shared_ptr<Poller> p(new Poller());
- Dispatcher d(p);
-
- Rdma::Connector c(
- *res->ai_addr,
- Rdma::ConnectionParams(msgsize, Rdma::DEFAULT_WR_ENTRIES),
- boost::bind(&connected, p, _1, _2),
- boost::bind(&connectionError, p, _1, _2),
- boost::bind(&disconnected, p, _1),
- boost::bind(&rejected, p, _1, _2));
-
- c.start(p);
- d.run();
- } catch (Rdma::Exception& e) {
- int err = e.getError();
- cerr << "Error: " << e.what() << "(" << err << ")\n";
- }
-
- cout
- << "Sent: " << smsgs
- << "msgs (" << sbytes
- << "bytes) in: " << double(sendingDuration)/TIME_SEC
- << "s: " << double(smsgs)*TIME_SEC/sendingDuration
- << "msgs/s(" << double(sbytes)*TIME_SEC/sendingDuration
- << "bytes/s)\n";
- cout
- << "Recd: " << rmsgs
- << "msgs (" << rbytes
- << "bytes) in: " << double(fullTestDuration)/TIME_SEC
- << "s: " << double(rmsgs)*TIME_SEC/fullTestDuration
- << "msgs/s(" << double(rbytes)*TIME_SEC/fullTestDuration
- << "bytes/s)\n";
-
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
deleted file mode 100644
index 77e766dd79..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
+++ /dev/null
@@ -1,617 +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 "RdmaIO.h"
-
-#include "qpid/log/Statement.h"
-
-
-#include <iostream>
-#include <boost/bind.hpp>
-
-using qpid::sys::DispatchHandle;
-using qpid::sys::Poller;
-
-namespace Rdma {
- AsynchIO::AsynchIO(
- QueuePair::intrusive_ptr q,
- int size,
- int xCredit,
- int rCount,
- ReadCallback rc,
- IdleCallback ic,
- FullCallback fc,
- ErrorCallback ec
- ) :
- qp(q),
- dataHandle(*qp, boost::bind(&AsynchIO::dataEvent, this, _1), 0, 0),
- bufferSize(size),
- recvCredit(0),
- xmitCredit(xCredit),
- recvBufferCount(rCount),
- xmitBufferCount(xCredit),
- outstandingWrites(0),
- closed(false),
- deleting(false),
- state(IDLE),
- readCallback(rc),
- idleCallback(ic),
- fullCallback(fc),
- errorCallback(ec)
- {
- qp->nonblocking();
- qp->notifyRecv();
- qp->notifySend();
-
- // Prepost some recv buffers before we go any further
- for (int i = 0; i<recvBufferCount; ++i) {
- // Allocate recv buffer
- Buffer* b = qp->createBuffer(bufferSize);
- buffers.push_front(b);
- b->dataCount = b->byteCount;
- qp->postRecv(b);
- }
-
- for (int i = 0; i<xmitBufferCount; ++i) {
- // Allocate xmit buffer
- Buffer* b = qp->createBuffer(bufferSize);
- buffers.push_front(b);
- bufferQueue.push_front(b);
- b->dataCount = 0;
- b->dataStart = 0;
- }
- }
-
- AsynchIO::~AsynchIO() {
- // Warn if we are deleting whilst there are still unreclaimed write buffers
- if ( outstandingWrites>0 )
- QPID_LOG(error, "RDMA: qp=" << qp << ": Deleting queue before all write buffers finished");
-
- // Turn off callbacks (before doing the deletes)
- dataHandle.stopWatch();
-
- // The buffers ptr_deque automatically deletes all the buffers we've allocated
- // TODO: It might turn out to be more efficient in high connection loads to reuse the
- // buffers rather than having to reregister them all the time (this would be straightforward if all
- // connections haver the same buffer size and harder otherwise)
- }
-
- void AsynchIO::start(Poller::shared_ptr poller) {
- dataHandle.startWatch(poller);
- }
-
- // Mark for deletion/Delete this object when we have no outstanding writes
- void AsynchIO::deferDelete() {
- State oldState;
- State newState;
- bool doReturn;
- //qpid::sys::ScopedLock<qpid::sys::Mutex> l(stateLock);
- // It is safe to assign to deleting here as we either delete ourselves
- // before leaving this function or deleting is set on exit
- do {
- newState = oldState = state.get();
- doReturn = false;
- if (outstandingWrites > 0 || oldState != IDLE) {
- deleting = true;
- doReturn = true;
- } else{
- newState = DELETED; // Stop any read callback before the dataHandle.stopWatch() in the destructor
- }
- } while (!state.boolCompareAndSwap(oldState, newState));
- if (doReturn) {
- return;
- }
- delete this;
- }
-
- void AsynchIO::queueWrite(Buffer* buff) {
- // Make sure we don't overrun our available buffers
- // either at our end or the known available at the peers end
- if (writable()) {
- // TODO: We might want to batch up sending credit
- if (recvCredit > 0) {
- int creditSent = recvCredit & ~FlagsMask;
- qp->postSend(creditSent, buff);
- recvCredit -= creditSent;
- } else {
- qp->postSend(buff);
- }
- ++outstandingWrites;
- --xmitCredit;
- } else {
- if (fullCallback) {
- fullCallback(*this, buff);
- } else {
- QPID_LOG(error, "RDMA: qp=" << qp << ": Write queue full, but no callback, throwing buffer away");
- returnBuffer(buff);
- }
- }
- }
-
- // Mark now closed (so we don't accept any more writes or make any idle callbacks)
- void AsynchIO::queueWriteClose() {
- // Don't think we actually need to lock here as transition is 1 way only to closed
- closed = true;
- }
-
- void AsynchIO::notifyPendingWrite() {
- // As notifyPendingWrite can be called on an arbitrary thread it must check whether we are processing or not.
- // If we are then we just return as we know that we will eventually do the idle callback anyway.
- //
- // qpid::sys::ScopedLock<qpid::sys::Mutex> l(stateLock);
- // We can get here in any state (as the caller could be in any thread)
- State oldState;
- State newState;
- bool doReturn;
- do {
- newState = oldState = state.get();
- doReturn = false;
- switch (oldState) {
- case NOTIFY_WRITE:
- case PENDING_NOTIFY:
- // We only need to note a pending notify if we're already doing a notify as data processing
- // is always followed by write notification processing
- newState = PENDING_NOTIFY;
- doReturn = true;
- break;
- case PENDING_DATA:
- doReturn = true;
- break;
- case DATA:
- // Only need to return here as data processing will do the idleCallback itself anyway
- doReturn = true;
- break;
- case IDLE:
- newState = NOTIFY_WRITE;
- break;
- case DELETED:
- assert(oldState!=DELETED);
- doReturn = true;
- };
- } while (!state.boolCompareAndSwap(oldState, newState));
- if (doReturn) {
- return;
- }
-
- doWriteCallback();
-
- // Keep track of what we need to do so that we can release the lock
- enum {COMPLETION, NOTIFY, RETURN, EXIT} action;
- // If there was pending data whilst we were doing this, process it now
- //
- // Using NOTIFY_WRITE for both NOTIFY & COMPLETION is a bit strange, but we're making sure we get the
- // correct result if we reenter notifyPendingWrite(), in which case we want to
- // end up in PENDING_NOTIFY (entering dataEvent doesn't matter as it only checks
- // not IDLE)
- do {
- //qpid::sys::ScopedLock<qpid::sys::Mutex> l(stateLock);
- do {
- newState = oldState = state.get();
- action = RETURN; // Anything but COMPLETION
- switch (oldState) {
- case NOTIFY_WRITE:
- newState = IDLE;
- action = (action == COMPLETION) ? EXIT : RETURN;
- break;
- case PENDING_DATA:
- newState = NOTIFY_WRITE;
- action = COMPLETION;
- break;
- case PENDING_NOTIFY:
- newState = NOTIFY_WRITE;
- action = NOTIFY;
- break;
- default:
- assert(oldState!=IDLE && oldState!=DATA && oldState!=DELETED);
- action = RETURN;
- }
- } while (!state.boolCompareAndSwap(oldState, newState));
-
- // Note we only get here if we were in the PENDING_DATA or PENDING_NOTIFY state
- // so that we do need to process completions or notifications now
- switch (action) {
- case COMPLETION:
- processCompletions();
- // Fall through
- case NOTIFY:
- doWriteCallback();
- break;
- case RETURN:
- return;
- case EXIT:
- // If we just processed completions we might need to delete ourselves
- if (deleting && outstandingWrites == 0) {
- delete this;
- }
- return;
- }
- } while (true);
- }
-
- void AsynchIO::dataEvent(qpid::sys::DispatchHandle&) {
- // Keep track of writable notifications
- // qpid::sys::ScopedLock<qpid::sys::Mutex> l(stateLock);
- State oldState;
- State newState;
- bool doReturn;
- do {
- newState = oldState = state.get();
- doReturn = false;
- // We're already processing a notification
- switch (oldState) {
- case IDLE:
- newState = DATA;
- break;
- default:
- // Can't get here in DATA state as that would violate the serialisation rules
- assert( oldState!=DATA );
- newState = PENDING_DATA;
- doReturn = true;
- }
- } while (!state.boolCompareAndSwap(oldState, newState));
- if (doReturn) {
- return;
- }
-
- processCompletions();
-
- //qpid::sys::ScopedLock<qpid::sys::Mutex> l(stateLock);
- do {
- newState = oldState = state.get();
- assert( oldState==DATA );
- newState = NOTIFY_WRITE;
- } while (!state.boolCompareAndSwap(oldState, newState));
-
- do {
- doWriteCallback();
-
- // qpid::sys::ScopedLock<qpid::sys::Mutex> l(stateLock);
- bool doBreak;
- do {
- newState = oldState = state.get();
- doBreak = false;
- if ( oldState==NOTIFY_WRITE ) {
- newState = IDLE;
- doBreak = true;
- } else {
- // Can't get DATA/PENDING_DATA here as dataEvent cannot be reentered
- assert( oldState==PENDING_NOTIFY );
- newState = NOTIFY_WRITE;
- }
- } while (!state.boolCompareAndSwap(oldState, newState));
- if (doBreak) {
- break;
- }
- } while (true);
-
- // We might need to delete ourselves
- if (deleting && outstandingWrites == 0) {
- delete this;
- }
- }
-
- void AsynchIO::processCompletions() {
- QueuePair::intrusive_ptr q = qp->getNextChannelEvent();
-
- // Re-enable notification for queue:
- // This needs to happen before we could do anything that could generate more work completion
- // events (ie the callbacks etc. in the following).
- // This can't make us reenter this code as the handle attached to the completion queue will still be
- // disabled by the poller until we leave this code
- qp->notifyRecv();
- qp->notifySend();
-
- int recvEvents = 0;
- int sendEvents = 0;
-
- // If no event do nothing
- if (!q)
- return;
-
- assert(q == qp);
-
- // Repeat until no more events
- do {
- QueuePairEvent e(qp->getNextEvent());
- if (!e)
- break;
-
- ::ibv_wc_status status = e.getEventStatus();
- if (status != IBV_WC_SUCCESS) {
- errorCallback(*this);
- // TODO: Probably need to flush queues at this point
- return;
- }
-
- // Test if recv (or recv with imm)
- //::ibv_wc_opcode eventType = e.getEventType();
- Buffer* b = e.getBuffer();
- QueueDirection dir = e.getDirection();
- if (dir == RECV) {
- ++recvEvents;
-
- // Get our xmitCredit if it was sent
- bool dataPresent = true;
- if (e.immPresent() ) {
- xmitCredit += (e.getImm() & ~FlagsMask);
- dataPresent = ((e.getImm() & IgnoreData) == 0);
- }
-
- // if there was no data sent then the message was only to update our credit
- if ( dataPresent ) {
- readCallback(*this, b);
- }
-
- // At this point the buffer has been consumed so put it back on the recv queue
- b->dataStart = 0;
- b->dataCount = 0;
- qp->postRecv(b);
-
- // Received another message
- ++recvCredit;
-
- // Send recvCredit if it is large enough (it will have got this large because we've not sent anything recently)
- if (recvCredit > recvBufferCount/2) {
- // TODO: This should use RDMA write with imm as there might not ever be a buffer to receive this message
- // but this is a little unlikely, as to get in this state we have to have received messages without sending any
- // for a while so its likely we've received an credit update from the far side.
- if (writable()) {
- Buffer* ob = getBuffer();
- // Have to send something as adapters hate it when you try to transfer 0 bytes
- *reinterpret_cast< uint32_t* >(ob->bytes) = htonl(recvCredit);
- ob->dataCount = sizeof(uint32_t);
-
- int creditSent = recvCredit & ~FlagsMask;
- qp->postSend(creditSent | IgnoreData, ob);
- recvCredit -= creditSent;
- ++outstandingWrites;
- --xmitCredit;
- } else {
- QPID_LOG(warning, "RDMA: qp=" << qp << ": Unable to send unsolicited credit");
- }
- }
- } else {
- ++sendEvents;
- {
- qpid::sys::ScopedLock<qpid::sys::Mutex> l(bufferQueueLock);
- bufferQueue.push_front(b);
- }
- --outstandingWrites;
- }
- } while (true);
-
- // Not sure if this is expected or not
- if (recvEvents == 0 && sendEvents == 0) {
- QPID_LOG(debug, "RDMA: qp=" << qp << ": Got channel event with no recv/send completions");
- }
- }
-
- void AsynchIO::doWriteCallback() {
- // TODO: maybe don't call idle unless we're low on write buffers
- // Keep on calling the idle routine as long as we are writable and we got something to write last call
- while (writable()) {
- int xc = xmitCredit;
- idleCallback(*this);
- // Check whether we actually wrote anything
- if (xmitCredit == xc) {
- QPID_LOG(debug, "RDMA: qp=" << qp << ": Called for data, but got none: xmitCredit=" << xmitCredit);
- return;
- }
- }
- }
-
- Buffer* AsynchIO::getBuffer() {
- qpid::sys::ScopedLock<qpid::sys::Mutex> l(bufferQueueLock);
- assert(!bufferQueue.empty());
- Buffer* b = bufferQueue.front();
- bufferQueue.pop_front();
- b->dataCount = 0;
- b->dataStart = 0;
- return b;
- }
-
- void AsynchIO::returnBuffer(Buffer* b) {
- qpid::sys::ScopedLock<qpid::sys::Mutex> l(bufferQueueLock);
- bufferQueue.push_front(b);
- b->dataCount = 0;
- b->dataStart = 0;
- }
-
- ConnectionManager::ConnectionManager(
- ErrorCallback errc,
- DisconnectedCallback dc
- ) :
- ci(Connection::make()),
- handle(*ci, boost::bind(&ConnectionManager::event, this, _1), 0, 0),
- errorCallback(errc),
- disconnectedCallback(dc)
- {
- ci->nonblocking();
- }
-
- void ConnectionManager::start(Poller::shared_ptr poller) {
- startConnection(ci);
- handle.startWatch(poller);
- }
-
- void ConnectionManager::event(DispatchHandle&) {
- connectionEvent(ci);
- }
-
- Listener::Listener(
- const sockaddr& src,
- const ConnectionParams& cp,
- EstablishedCallback ec,
- ErrorCallback errc,
- DisconnectedCallback dc,
- ConnectionRequestCallback crc
- ) :
- ConnectionManager(errc, dc),
- src_addr(src),
- checkConnectionParams(cp),
- connectionRequestCallback(crc),
- establishedCallback(ec)
- {
- }
-
- void Listener::startConnection(Connection::intrusive_ptr ci) {
- ci->bind(src_addr);
- ci->listen();
- }
-
- void Listener::connectionEvent(Connection::intrusive_ptr ci) {
- ConnectionEvent e(ci->getNextEvent());
-
- // If (for whatever reason) there was no event do nothing
- if (!e)
- return;
-
- // Important documentation ommision the new rdma_cm_id
- // you get from CONNECT_REQUEST has the same context info
- // as its parent listening rdma_cm_id
- ::rdma_cm_event_type eventType = e.getEventType();
- ::rdma_conn_param conn_param = e.getConnectionParam();
- Rdma::Connection::intrusive_ptr id = e.getConnection();
-
- switch (eventType) {
- case RDMA_CM_EVENT_CONNECT_REQUEST: {
- // Make sure peer has sent params we can use
- if (!conn_param.private_data || conn_param.private_data_len < sizeof(ConnectionParams)) {
- id->reject();
- break;
- }
- ConnectionParams cp = *static_cast<const ConnectionParams*>(conn_param.private_data);
-
- // Reject if requested msg size is bigger than we allow
- if (cp.maxRecvBufferSize > checkConnectionParams.maxRecvBufferSize) {
- id->reject(&checkConnectionParams);
- break;
- }
-
- bool accept = true;
- if (connectionRequestCallback)
- accept = connectionRequestCallback(id, cp);
-
- if (accept) {
- // Accept connection
- cp.initialXmitCredit = checkConnectionParams.initialXmitCredit;
- id->accept(conn_param, &cp);
- } else {
- // Reject connection
- id->reject();
- }
- break;
- }
- case RDMA_CM_EVENT_ESTABLISHED:
- establishedCallback(id);
- break;
- case RDMA_CM_EVENT_DISCONNECTED:
- disconnectedCallback(id);
- break;
- case RDMA_CM_EVENT_CONNECT_ERROR:
- errorCallback(id, CONNECT_ERROR);
- break;
- default:
- // Unexpected response
- errorCallback(id, UNKNOWN);
- //std::cerr << "Warning: unexpected response to listen - " << eventType << "\n";
- }
- }
-
- Connector::Connector(
- const sockaddr& dst,
- const ConnectionParams& cp,
- ConnectedCallback cc,
- ErrorCallback errc,
- DisconnectedCallback dc,
- RejectedCallback rc
- ) :
- ConnectionManager(errc, dc),
- dst_addr(dst),
- connectionParams(cp),
- rejectedCallback(rc),
- connectedCallback(cc)
- {
- }
-
- void Connector::startConnection(Connection::intrusive_ptr ci) {
- ci->resolve_addr(dst_addr);
- }
-
- void Connector::connectionEvent(Connection::intrusive_ptr ci) {
- ConnectionEvent e(ci->getNextEvent());
-
- // If (for whatever reason) there was no event do nothing
- if (!e)
- return;
-
- ::rdma_cm_event_type eventType = e.getEventType();
- ::rdma_conn_param conn_param = e.getConnectionParam();
- Rdma::Connection::intrusive_ptr id = e.getConnection();
- switch (eventType) {
- case RDMA_CM_EVENT_ADDR_RESOLVED:
- // RESOLVE_ADDR
- ci->resolve_route();
- break;
- case RDMA_CM_EVENT_ADDR_ERROR:
- // RESOLVE_ADDR
- errorCallback(ci, ADDR_ERROR);
- break;
- case RDMA_CM_EVENT_ROUTE_RESOLVED:
- // RESOLVE_ROUTE:
- ci->connect(&connectionParams);
- break;
- case RDMA_CM_EVENT_ROUTE_ERROR:
- // RESOLVE_ROUTE:
- errorCallback(ci, ROUTE_ERROR);
- break;
- case RDMA_CM_EVENT_CONNECT_ERROR:
- // CONNECTING
- errorCallback(ci, CONNECT_ERROR);
- break;
- case RDMA_CM_EVENT_UNREACHABLE:
- // CONNECTING
- errorCallback(ci, UNREACHABLE);
- break;
- case RDMA_CM_EVENT_REJECTED: {
- // CONNECTING
- // Extract private data from event
- assert(conn_param.private_data && conn_param.private_data_len >= sizeof(ConnectionParams));
- ConnectionParams cp = *static_cast<const ConnectionParams*>(conn_param.private_data);
- rejectedCallback(ci, cp);
- break;
- }
- case RDMA_CM_EVENT_ESTABLISHED: {
- // CONNECTING
- // Extract private data from event
- assert(conn_param.private_data && conn_param.private_data_len >= sizeof(ConnectionParams));
- ConnectionParams cp = *static_cast<const ConnectionParams*>(conn_param.private_data);
- connectedCallback(ci, cp);
- break;
- }
- case RDMA_CM_EVENT_DISCONNECTED:
- // ESTABLISHED
- disconnectedCallback(ci);
- break;
- default:
- QPID_LOG(warning, "RDMA: Unexpected event in connect: " << eventType);
- }
- }
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h b/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h
deleted file mode 100644
index 577c22d053..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaIO.h
+++ /dev/null
@@ -1,222 +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.
- *
- */
-#ifndef Rdma_Acceptor_h
-#define Rdma_Acceptor_h
-
-#include "rdma_wrap.h"
-
-#include "qpid/sys/AtomicValue.h"
-#include "qpid/sys/Dispatcher.h"
-#include "qpid/sys/DispatchHandle.h"
-#include "qpid/sys/Mutex.h"
-
-#include <netinet/in.h>
-
-#include <boost/function.hpp>
-#include <boost/ptr_container/ptr_deque.hpp>
-#include <deque>
-
-namespace Rdma {
-
- class Connection;
-
- class AsynchIO
- {
- typedef boost::function1<void, AsynchIO&> ErrorCallback;
- typedef boost::function2<void, AsynchIO&, Buffer*> ReadCallback;
- typedef boost::function1<void, AsynchIO&> IdleCallback;
- typedef boost::function2<void, AsynchIO&, Buffer*> FullCallback;
-
- QueuePair::intrusive_ptr qp;
- qpid::sys::DispatchHandleRef dataHandle;
- int bufferSize;
- int recvCredit;
- int xmitCredit;
- int recvBufferCount;
- int xmitBufferCount;
- int outstandingWrites;
- bool closed; // TODO: Perhaps (probably) this state can be merged with the following...
- bool deleting; // TODO: Perhaps (probably) this state can be merged with the following...
- enum State { IDLE, DATA, PENDING_DATA, NOTIFY_WRITE, PENDING_NOTIFY, DELETED };
- qpid::sys::AtomicValue<State> state;
- //qpid::sys::Mutex stateLock;
- std::deque<Buffer*> bufferQueue;
- qpid::sys::Mutex bufferQueueLock;
- boost::ptr_deque<Buffer> buffers;
-
- ReadCallback readCallback;
- IdleCallback idleCallback;
- FullCallback fullCallback;
- ErrorCallback errorCallback;
-
- public:
- // TODO: Instead of specifying a buffer size specify the amount of memory the AsynchIO class can use
- // for buffers both read and write (allocate half to each up front) and fail if we cannot allocate that much
- // locked memory
- AsynchIO(
- QueuePair::intrusive_ptr q,
- int size,
- int xCredit,
- int rCount,
- ReadCallback rc,
- IdleCallback ic,
- FullCallback fc,
- ErrorCallback ec
- );
-
- void start(qpid::sys::Poller::shared_ptr poller);
- bool writable() const;
- bool bufferAvailable() const;
- void queueWrite(Buffer* buff);
- void notifyPendingWrite();
- void queueWriteClose();
- void deferDelete();
- int incompletedWrites() const;
- Buffer* getBuffer();
- void returnBuffer(Buffer*);
-
- private:
- // Don't let anyone else delete us to make sure there can't be outstanding callbacks
- ~AsynchIO();
-
- // Constants for the peer-peer command messages
- // These are sent in the high bits if the imm data of an rdma message
- // The low bits are used to send the credit
- const static int FlagsMask = 0x10000000; // Mask for all flag bits - be sure to update this if you add more command bits
- const static int IgnoreData = 0x10000000; // Message contains no application data
-
- void dataEvent(qpid::sys::DispatchHandle& handle);
- void processCompletions();
- void doWriteCallback();
- };
-
- inline bool AsynchIO::writable() const {
- return (!closed && outstandingWrites < xmitBufferCount && xmitCredit > 0);
- }
-
- inline int AsynchIO::incompletedWrites() const {
- return outstandingWrites;
- }
-
- inline bool AsynchIO::bufferAvailable() const {
- return !bufferQueue.empty();
- }
- // These are the parameters necessary to start the conversation
- // * Each peer HAS to allocate buffers of the size of the maximum receive from its peer
- // * Each peer HAS to know the initial "credit" it has for transmitting to its peer
- struct ConnectionParams {
- int maxRecvBufferSize;
- int initialXmitCredit ;
-
- ConnectionParams(int s, int c) :
- maxRecvBufferSize(s),
- initialXmitCredit(c)
- {}
- };
-
- enum ErrorType {
- ADDR_ERROR,
- ROUTE_ERROR,
- CONNECT_ERROR,
- UNREACHABLE,
- UNKNOWN
- };
-
- typedef boost::function2<void, Rdma::Connection::intrusive_ptr&, ErrorType> ErrorCallback;
- typedef boost::function1<void, Rdma::Connection::intrusive_ptr&> DisconnectedCallback;
-
- class ConnectionManager {
- Connection::intrusive_ptr ci;
- qpid::sys::DispatchHandle handle;
-
- protected:
- ErrorCallback errorCallback;
- DisconnectedCallback disconnectedCallback;
-
- public:
- ConnectionManager(
- ErrorCallback errc,
- DisconnectedCallback dc
- );
-
- virtual ~ConnectionManager() {}
-
- void start(qpid::sys::Poller::shared_ptr poller);
-
- private:
- void event(qpid::sys::DispatchHandle& handle);
-
- virtual void startConnection(Connection::intrusive_ptr ci) = 0;
- virtual void connectionEvent(Connection::intrusive_ptr ci) = 0;
- };
-
- typedef boost::function2<bool, Rdma::Connection::intrusive_ptr&, const ConnectionParams&> ConnectionRequestCallback;
- typedef boost::function1<void, Rdma::Connection::intrusive_ptr&> EstablishedCallback;
-
- class Listener : public ConnectionManager
- {
- sockaddr src_addr;
- ConnectionParams checkConnectionParams;
- ConnectionRequestCallback connectionRequestCallback;
- EstablishedCallback establishedCallback;
-
- public:
- Listener(
- const sockaddr& src,
- const ConnectionParams& cp,
- EstablishedCallback ec,
- ErrorCallback errc,
- DisconnectedCallback dc,
- ConnectionRequestCallback crc = 0
- );
-
- private:
- void startConnection(Connection::intrusive_ptr ci);
- void connectionEvent(Connection::intrusive_ptr ci);
- };
-
- typedef boost::function2<void, Rdma::Connection::intrusive_ptr&, const ConnectionParams&> RejectedCallback;
- typedef boost::function2<void, Rdma::Connection::intrusive_ptr&, const ConnectionParams&> ConnectedCallback;
-
- class Connector : public ConnectionManager
- {
- sockaddr dst_addr;
- ConnectionParams connectionParams;
- RejectedCallback rejectedCallback;
- ConnectedCallback connectedCallback;
-
- public:
- Connector(
- const sockaddr& dst,
- const ConnectionParams& cp,
- ConnectedCallback cc,
- ErrorCallback errc,
- DisconnectedCallback dc,
- RejectedCallback rc = 0
- );
-
- private:
- void startConnection(Connection::intrusive_ptr ci);
- void connectionEvent(Connection::intrusive_ptr ci);
- };
-}
-
-#endif // Rdma_Acceptor_h
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaServer.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaServer.cpp
deleted file mode 100644
index 594578a265..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/RdmaServer.cpp
+++ /dev/null
@@ -1,167 +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 "RdmaIO.h"
-
-#include <arpa/inet.h>
-
-#include <vector>
-#include <queue>
-#include <string>
-#include <iostream>
-
-#include <boost/bind.hpp>
-
-using std::vector;
-using std::queue;
-using std::string;
-using std::cout;
-using std::cerr;
-
-using qpid::sys::Poller;
-using qpid::sys::Dispatcher;
-
-// All the accepted connections
-struct ConRec {
- Rdma::Connection::intrusive_ptr connection;
- Rdma::AsynchIO* data;
- queue<Rdma::Buffer*> queuedWrites;
-
- ConRec(Rdma::Connection::intrusive_ptr c) :
- connection(c)
- {}
-};
-
-void dataError(Rdma::AsynchIO&) {
- cout << "Data error:\n";
-}
-
-void idle(ConRec* cr, Rdma::AsynchIO& a) {
- // Need to make sure full is not called as it would reorder messages
- while (!cr->queuedWrites.empty() && a.writable()) {
- Rdma::Buffer* buf = cr->queuedWrites.front();
- cr->queuedWrites.pop();
- a.queueWrite(buf);
- }
-}
-
-void data(ConRec* cr, Rdma::AsynchIO& a, Rdma::Buffer* b) {
- // Echo data back
- Rdma::Buffer* buf = a.getBuffer();
- std::copy(b->bytes+b->dataStart, b->bytes+b->dataStart+b->dataCount, buf->bytes);
- buf->dataCount = b->dataCount;
- if (cr->queuedWrites.empty()) {
- // If can't write then full will be called and push buffer on back of queue
- a.queueWrite(buf);
- } else {
- cr->queuedWrites.push(buf);
- // Try to empty queue
- idle(cr, a);
- }
-}
-
-void full(ConRec* cr, Rdma::AsynchIO&, Rdma::Buffer* buf) {
- cr->queuedWrites.push(buf);
-}
-
-void disconnected(Rdma::Connection::intrusive_ptr& ci) {
- ConRec* cr = ci->getContext<ConRec>();
- cr->connection->disconnect();
- cr->data->queueWriteClose();
- delete cr;
- cout << "Disconnected: " << cr << "\n";
-}
-
-void connectionError(Rdma::Connection::intrusive_ptr& ci, Rdma::ErrorType) {
- ConRec* cr = ci->getContext<ConRec>();
- cr->connection->disconnect();
- if (cr) {
- cr->data->queueWriteClose();
- delete cr;
- }
- cout << "Connection error: " << cr << "\n";
-}
-
-bool connectionRequest(Rdma::Connection::intrusive_ptr& ci, const Rdma::ConnectionParams& cp) {
- cout << "Incoming connection: ";
-
- // For fun reject alternate connection attempts
- static bool x = false;
- x = true;
-
- // Must create aio here so as to prepost buffers *before* we accept connection
- if (x) {
- ConRec* cr = new ConRec(ci);
- Rdma::AsynchIO* aio =
- new Rdma::AsynchIO(ci->getQueuePair(),
- cp.maxRecvBufferSize, cp.initialXmitCredit, Rdma::DEFAULT_WR_ENTRIES,
- boost::bind(data, cr, _1, _2),
- boost::bind(idle, cr, _1),
- boost::bind(full, cr, _1, _2),
- dataError);
- ci->addContext(cr);
- cr->data = aio;
- cout << "Accept=>" << cr << "\n";
- } else {
- cout << "Reject\n";
- }
-
- return x;
-}
-
-void connected(Poller::shared_ptr poller, Rdma::Connection::intrusive_ptr& ci) {
- static int cnt = 0;
- ConRec* cr = ci->getContext<ConRec>();
- cout << "Connected: " << cr << "(" << ++cnt << ")\n";
-
- cr->data->start(poller);
-}
-
-int main(int argc, char* argv[]) {
- vector<string> args(&argv[0], &argv[argc]);
-
- ::sockaddr_in sin;
-
- int port = (args.size() < 2) ? 20079 : atoi(args[1].c_str());
- cout << "Listening on port: " << port << "\n";
-
- sin.sin_family = AF_INET;
- sin.sin_port = htons(port);
- sin.sin_addr.s_addr = INADDR_ANY;
-
- try {
- boost::shared_ptr<Poller> p(new Poller());
- Dispatcher d(p);
-
- Rdma::Listener a((const sockaddr&)(sin),
- Rdma::ConnectionParams(16384, Rdma::DEFAULT_WR_ENTRIES),
- boost::bind(connected, p, _1),
- connectionError,
- disconnected,
- connectionRequest);
-
-
- a.start(p);
- d.run();
- } catch (Rdma::Exception& e) {
- int err = e.getError();
- cerr << "Error: " << e.what() << "(" << err << ")\n";
- }
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_exception.h b/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_exception.h
deleted file mode 100644
index 7867aef2e4..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_exception.h
+++ /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.
- *
- */
-#ifndef RDMA_EXCEPTION_H
-#define RDMA_EXCEPTION_H
-
-#include <exception>
-
-#include <errno.h>
-#include <string.h>
-
-namespace Rdma {
- static __thread char s[50];
- class Exception : public std::exception {
- int err;
-
- public:
- Exception(int e) : err(e) {}
- int getError() { return err; }
- const char* what() const throw() {
- return ::strerror_r(err, s, 50);
- }
- };
-
- inline void THROW_ERRNO() {
- throw Rdma::Exception(errno);
- }
-
- inline void CHECK(int rc) {
- if (rc != 0)
- throw Rdma::Exception((rc == -1) ? errno : rc >0 ? rc : -rc);
- }
-
- inline void CHECK_IBV(int rc) {
- if (rc != 0)
- throw Rdma::Exception(rc);
- }
-
- template <typename T>
- inline
- T* CHECK_NULL(T* rc) {
- if (rc == 0)
- THROW_ERRNO();
- return rc;
- }
-}
-
-#endif // RDMA_EXCEPTION_H
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_factories.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_factories.cpp
deleted file mode 100644
index c6e8df814b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_factories.cpp
+++ /dev/null
@@ -1,64 +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 "rdma_factories.h"
-
-namespace Rdma {
- void acker(::rdma_cm_event* e) throw () {
- if (e)
- // Intentionally ignore return value - we can't do anything about it here
- (void) ::rdma_ack_cm_event(e);
- }
-
- void destroyEChannel(::rdma_event_channel* c) throw () {
- if (c)
- // Intentionally ignore return value - we can't do anything about it here
- (void) ::rdma_destroy_event_channel(c);
- }
-
- void destroyId(::rdma_cm_id* i) throw () {
- if (i)
- // Intentionally ignore return value - we can't do anything about it here
- (void) ::rdma_destroy_id(i);
- }
-
- void deallocPd(::ibv_pd* p) throw () {
- if (p)
- // Intentionally ignore return value - we can't do anything about it here
- (void) ::ibv_dealloc_pd(p);
- }
-
- void destroyCChannel(::ibv_comp_channel* c) throw () {
- if (c)
- // Intentionally ignore return value - we can't do anything about it here
- (void) ::ibv_destroy_comp_channel(c);
- }
-
- void destroyCq(::ibv_cq* cq) throw () {
- if (cq)
- (void) ::ibv_destroy_cq(cq);
- }
-
- void destroyQp(::ibv_qp* qp) throw () {
- if (qp)
- (void) ::ibv_destroy_qp(qp);
- }
-
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_factories.h b/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_factories.h
deleted file mode 100644
index 8d024f37aa..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_factories.h
+++ /dev/null
@@ -1,69 +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.
- *
- */
-#ifndef RDMA_FACTORIES_H
-#define RDMA_FACTORIES_H
-
-#include "rdma_exception.h"
-
-#include <rdma/rdma_cma.h>
-
-#include <boost/shared_ptr.hpp>
-
-namespace Rdma {
- // These allow us to use simple shared_ptrs to do ref counting
- void acker(::rdma_cm_event* e) throw ();
- void destroyEChannel(::rdma_event_channel* c) throw ();
- void destroyId(::rdma_cm_id* i) throw ();
- void deallocPd(::ibv_pd* p) throw ();
- void destroyCChannel(::ibv_comp_channel* c) throw ();
- void destroyCq(::ibv_cq* cq) throw ();
- void destroyQp(::ibv_qp* qp) throw ();
-
- inline boost::shared_ptr< ::rdma_event_channel > mkEChannel() {
- ::rdma_event_channel* c = CHECK_NULL(::rdma_create_event_channel());
- return boost::shared_ptr< ::rdma_event_channel >(c, destroyEChannel);
- }
-
- inline boost::shared_ptr< ::rdma_cm_id >
- mkId(::rdma_event_channel* ec, void* context, ::rdma_port_space ps) {
- ::rdma_cm_id* i;
- CHECK(::rdma_create_id(ec, &i, context, ps));
- return boost::shared_ptr< ::rdma_cm_id >(i, destroyId);
- }
-
- inline boost::shared_ptr< ::ibv_pd > allocPd(::ibv_context* c) {
- ::ibv_pd* pd = CHECK_NULL(ibv_alloc_pd(c));
- return boost::shared_ptr< ::ibv_pd >(pd, deallocPd);
- }
-
- inline boost::shared_ptr< ::ibv_comp_channel > mkCChannel(::ibv_context* c) {
- ::ibv_comp_channel* cc = CHECK_NULL(::ibv_create_comp_channel(c));
- return boost::shared_ptr< ::ibv_comp_channel >(cc, destroyCChannel);
- }
-
- inline boost::shared_ptr< ::ibv_cq >
- mkCq(::ibv_context* c, int cqe, void* context, ::ibv_comp_channel* cc) {
- ::ibv_cq* cq = CHECK_NULL(ibv_create_cq(c, cqe, context, cc, 0));
- return boost::shared_ptr< ::ibv_cq >(cq, destroyCq);
- }
-}
-
-#endif // RDMA_FACTORIES_H
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.cpp
deleted file mode 100644
index e105eb68c6..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.cpp
+++ /dev/null
@@ -1,183 +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 "rdma_wrap.h"
-
-namespace Rdma {
- const ::rdma_conn_param DEFAULT_CONNECT_PARAM = {
- 0, // .private_data
- 0, // .private_data_len
- 4, // .responder_resources
- 4, // .initiator_depth
- 0, // .flow_control
- 5, // .retry_count
- 7 // .rnr_retry_count
- };
-
- // This is moderately inefficient so don't use in a critical path
- int deviceCount() {
- int count;
- ::ibv_free_device_list(::ibv_get_device_list(&count));
- return count;
- }
-
- ::rdma_conn_param ConnectionEvent::getConnectionParam() const {
- // It's badly documented, but it seems from the librdma source code that all the following
- // event types have a valid param.conn
- switch (event->event) {
- case RDMA_CM_EVENT_CONNECT_REQUEST:
- case RDMA_CM_EVENT_ESTABLISHED:
- case RDMA_CM_EVENT_REJECTED:
- case RDMA_CM_EVENT_DISCONNECTED:
- case RDMA_CM_EVENT_CONNECT_ERROR:
- return event->param.conn;
- default:
- ::rdma_conn_param p = {};
- return p;
- }
- }
-
- QueuePair::QueuePair(boost::shared_ptr< ::rdma_cm_id > i) :
- qpid::sys::IOHandle(new qpid::sys::IOHandlePrivate),
- pd(allocPd(i->verbs)),
- cchannel(mkCChannel(i->verbs)),
- scq(mkCq(i->verbs, DEFAULT_CQ_ENTRIES, 0, cchannel.get())),
- rcq(mkCq(i->verbs, DEFAULT_CQ_ENTRIES, 0, cchannel.get())),
- outstandingSendEvents(0),
- outstandingRecvEvents(0)
- {
- impl->fd = cchannel->fd;
-
- // Set cq context to this QueuePair object so we can find
- // ourselves again
- scq->cq_context = this;
- rcq->cq_context = this;
-
- ::ibv_qp_init_attr qp_attr = {};
-
- // TODO: make a default struct for this
- qp_attr.cap.max_send_wr = DEFAULT_WR_ENTRIES;
- qp_attr.cap.max_send_sge = 4;
- qp_attr.cap.max_recv_wr = DEFAULT_WR_ENTRIES;
- qp_attr.cap.max_recv_sge = 4;
-
- qp_attr.send_cq = scq.get();
- qp_attr.recv_cq = rcq.get();
- qp_attr.qp_type = IBV_QPT_RC;
-
- CHECK(::rdma_create_qp(i.get(), pd.get(), &qp_attr));
- qp = boost::shared_ptr< ::ibv_qp >(i->qp, destroyQp);
-
- // Set the qp context to this so we can find ourselves again
- qp->qp_context = this;
- }
-
- QueuePair::~QueuePair() {
- if (outstandingSendEvents > 0)
- ::ibv_ack_cq_events(scq.get(), outstandingSendEvents);
- if (outstandingRecvEvents > 0)
- ::ibv_ack_cq_events(rcq.get(), outstandingRecvEvents);
-
- // Reset back pointer in case someone else has the qp
- qp->qp_context = 0;
- }
-
- void QueuePair::postRecv(Buffer* buf) {
- ::ibv_recv_wr rwr = {};
- ::ibv_sge sge;
-
- sge.addr = (uintptr_t) buf->bytes+buf->dataStart;
- sge.length = buf->dataCount;
- sge.lkey = buf->mr->lkey;
-
- rwr.wr_id = reinterpret_cast<uint64_t>(buf);
- rwr.sg_list = &sge;
- rwr.num_sge = 1;
-
- ::ibv_recv_wr* badrwr = 0;
- CHECK_IBV(::ibv_post_recv(qp.get(), &rwr, &badrwr));
- if (badrwr)
- throw std::logic_error("ibv_post_recv(): Bad rwr");
- }
-
- void QueuePair::postSend(Buffer* buf) {
- ::ibv_send_wr swr = {};
- ::ibv_sge sge;
-
- sge.addr = (uintptr_t) buf->bytes+buf->dataStart;
- sge.length = buf->dataCount;
- sge.lkey = buf->mr->lkey;
-
- swr.wr_id = reinterpret_cast<uint64_t>(buf);
- swr.opcode = IBV_WR_SEND;
- swr.send_flags = IBV_SEND_SIGNALED;
- swr.sg_list = &sge;
- swr.num_sge = 1;
-
- ::ibv_send_wr* badswr = 0;
- CHECK_IBV(::ibv_post_send(qp.get(), &swr, &badswr));
- if (badswr)
- throw std::logic_error("ibv_post_send(): Bad swr");
- }
-
- void QueuePair::postSend(uint32_t imm, Buffer* buf) {
- ::ibv_send_wr swr = {};
- ::ibv_sge sge;
-
- sge.addr = (uintptr_t) buf->bytes+buf->dataStart;
- sge.length = buf->dataCount;
- sge.lkey = buf->mr->lkey;
- swr.send_flags = IBV_SEND_SIGNALED;
-
- swr.wr_id = reinterpret_cast<uint64_t>(buf);
- swr.imm_data = htonl(imm);
- swr.opcode = IBV_WR_SEND_WITH_IMM;
- swr.sg_list = &sge;
- swr.num_sge = 1;
-
- ::ibv_send_wr* badswr = 0;
- CHECK_IBV(::ibv_post_send(qp.get(), &swr, &badswr));
- if (badswr)
- throw std::logic_error("ibv_post_send(): Bad swr");
- }
-}
-
-std::ostream& operator<<(std::ostream& o, ::rdma_cm_event_type t) {
-# define CHECK_TYPE(t) case t: o << #t; break;
- switch(t) {
- CHECK_TYPE(RDMA_CM_EVENT_ADDR_RESOLVED)
- CHECK_TYPE(RDMA_CM_EVENT_ADDR_ERROR)
- CHECK_TYPE(RDMA_CM_EVENT_ROUTE_RESOLVED)
- CHECK_TYPE(RDMA_CM_EVENT_ROUTE_ERROR)
- CHECK_TYPE(RDMA_CM_EVENT_CONNECT_REQUEST)
- CHECK_TYPE(RDMA_CM_EVENT_CONNECT_RESPONSE)
- CHECK_TYPE(RDMA_CM_EVENT_CONNECT_ERROR)
- CHECK_TYPE(RDMA_CM_EVENT_UNREACHABLE)
- CHECK_TYPE(RDMA_CM_EVENT_REJECTED)
- CHECK_TYPE(RDMA_CM_EVENT_ESTABLISHED)
- CHECK_TYPE(RDMA_CM_EVENT_DISCONNECTED)
- CHECK_TYPE(RDMA_CM_EVENT_DEVICE_REMOVAL)
- CHECK_TYPE(RDMA_CM_EVENT_MULTICAST_JOIN)
- CHECK_TYPE(RDMA_CM_EVENT_MULTICAST_ERROR)
- }
-# undef CHECK_TYPE
- return o;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.h b/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.h
deleted file mode 100644
index 7812a02532..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/rdma/rdma_wrap.h
+++ /dev/null
@@ -1,498 +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.
- *
- */
-#ifndef RDMA_WRAP_H
-#define RDMA_WRAP_H
-
-#include "rdma_factories.h"
-
-#include <rdma/rdma_cma.h>
-
-#include "qpid/RefCounted.h"
-#include "qpid/sys/IOHandle.h"
-#include "qpid/sys/posix/PrivatePosix.h"
-
-#include <fcntl.h>
-
-#include <netdb.h>
-
-#include <vector>
-#include <algorithm>
-#include <iostream>
-#include <stdexcept>
-#include <boost/shared_ptr.hpp>
-#include <boost/intrusive_ptr.hpp>
-
-namespace Rdma {
- const int DEFAULT_TIMEOUT = 2000; // 2 secs
- const int DEFAULT_BACKLOG = 100;
- const int DEFAULT_CQ_ENTRIES = 256;
- const int DEFAULT_WR_ENTRIES = 64;
- extern const ::rdma_conn_param DEFAULT_CONNECT_PARAM;
-
- int deviceCount();
-
- struct Buffer {
- friend class QueuePair;
-
- char* const bytes;
- const int32_t byteCount;
- int32_t dataStart;
- int32_t dataCount;
-
- Buffer(::ibv_pd* pd, char* const b, const int32_t s) :
- bytes(b),
- byteCount(s),
- dataStart(0),
- dataCount(0),
- mr(CHECK_NULL(::ibv_reg_mr(
- pd, bytes, byteCount,
- ::IBV_ACCESS_LOCAL_WRITE)))
- {}
-
- ~Buffer() {
- (void) ::ibv_dereg_mr(mr);
- delete [] bytes;
- }
-
- private:
- ::ibv_mr* mr;
- };
-
- class Connection;
-
- enum QueueDirection {
- NONE,
- SEND,
- RECV
- };
-
- class QueuePairEvent {
- boost::shared_ptr< ::ibv_cq > cq;
- ::ibv_wc wc;
- QueueDirection dir;
-
- friend class QueuePair;
-
- QueuePairEvent() :
- dir(NONE)
- {}
-
- QueuePairEvent(
- const ::ibv_wc& w,
- boost::shared_ptr< ::ibv_cq > c,
- QueueDirection d) :
- cq(c),
- wc(w),
- dir(d)
- {
- assert(dir != NONE);
- }
-
- public:
- operator bool() const {
- return dir != NONE;
- }
-
- bool immPresent() const {
- return wc.wc_flags & IBV_WC_WITH_IMM;
- }
-
- uint32_t getImm() const {
- return ntohl(wc.imm_data);
- }
-
- QueueDirection getDirection() const {
- return dir;
- }
-
- ::ibv_wc_opcode getEventType() const {
- return wc.opcode;
- }
-
- ::ibv_wc_status getEventStatus() const {
- return wc.status;
- }
-
- Buffer* getBuffer() const {
- Buffer* b = reinterpret_cast<Buffer*>(wc.wr_id);
- b->dataCount = wc.byte_len;
- return b;
- }
- };
-
- // Wrapper for a queue pair - this has the functionality for
- // putting buffers on the receive queue and for sending buffers
- // to the other end of the connection.
- class QueuePair : public qpid::sys::IOHandle, public qpid::RefCounted {
- boost::shared_ptr< ::ibv_pd > pd;
- boost::shared_ptr< ::ibv_comp_channel > cchannel;
- boost::shared_ptr< ::ibv_cq > scq;
- boost::shared_ptr< ::ibv_cq > rcq;
- boost::shared_ptr< ::ibv_qp > qp;
- int outstandingSendEvents;
- int outstandingRecvEvents;
-
- friend class Connection;
-
- QueuePair(boost::shared_ptr< ::rdma_cm_id > id);
- ~QueuePair();
-
- public:
- typedef boost::intrusive_ptr<QueuePair> intrusive_ptr;
-
- // Create a buffer to use for writing
- Buffer* createBuffer(int s) {
- return new Buffer(pd.get(), new char[s], s);
- }
-
- // Make channel non-blocking by making
- // associated fd nonblocking
- void nonblocking() {
- ::fcntl(cchannel->fd, F_SETFL, O_NONBLOCK);
- }
-
- // If we get EAGAIN because the channel has been set non blocking
- // and we'd have to wait then return an empty event
- QueuePair::intrusive_ptr getNextChannelEvent() {
- // First find out which cq has the event
- ::ibv_cq* cq;
- void* ctx;
- int rc = ::ibv_get_cq_event(cchannel.get(), &cq, &ctx);
- if (rc == -1 && errno == EAGAIN)
- return 0;
- CHECK(rc);
-
- // Batch acknowledge the event
- if (cq == scq.get()) {
- if (++outstandingSendEvents > DEFAULT_CQ_ENTRIES / 2) {
- ::ibv_ack_cq_events(cq, outstandingSendEvents);
- outstandingSendEvents = 0;
- }
- } else if (cq == rcq.get()) {
- if (++outstandingRecvEvents > DEFAULT_CQ_ENTRIES / 2) {
- ::ibv_ack_cq_events(cq, outstandingRecvEvents);
- outstandingRecvEvents = 0;
- }
- }
-
- return static_cast<QueuePair*>(ctx);
- }
-
- QueuePairEvent getNextEvent() {
- ::ibv_wc w;
- if (::ibv_poll_cq(scq.get(), 1, &w) == 1)
- return QueuePairEvent(w, scq, SEND);
- else if (::ibv_poll_cq(rcq.get(), 1, &w) == 1)
- return QueuePairEvent(w, rcq, RECV);
- else
- return QueuePairEvent();
- }
-
- void postRecv(Buffer* buf);
- void postSend(Buffer* buf);
- void postSend(uint32_t imm, Buffer* buf);
- void notifyRecv();
- void notifySend();
- };
-
- class ConnectionEvent {
- friend class Connection;
-
- // The order of the members is important as we have to acknowledge
- // the event before destroying the ids on destruction
- boost::intrusive_ptr<Connection> id;
- boost::intrusive_ptr<Connection> listen_id;
- boost::shared_ptr< ::rdma_cm_event > event;
-
- ConnectionEvent() {}
- ConnectionEvent(::rdma_cm_event* e);
-
- // Default copy, assignment and destructor ok
- public:
- operator bool() const {
- return event;
- }
-
- ::rdma_cm_event_type getEventType() const {
- return event->event;
- }
-
- ::rdma_conn_param getConnectionParam() const;
-
- boost::intrusive_ptr<Connection> getConnection () const {
- return id;
- }
-
- boost::intrusive_ptr<Connection> getListenId() const {
- return listen_id;
- }
- };
-
- // For the moment this is a fairly simple wrapper for rdma_cm_id.
- //
- // NB: It allocates a protection domain (pd) per connection which means that
- // registered buffers can't be shared between different connections
- // (this can only happen between connections on the same controller in any case,
- // so needs careful management if used)
- class Connection : public qpid::sys::IOHandle, public qpid::RefCounted {
- boost::shared_ptr< ::rdma_event_channel > channel;
- boost::shared_ptr< ::rdma_cm_id > id;
- QueuePair::intrusive_ptr qp;
-
- void* context;
-
- friend class ConnectionEvent;
- friend class QueuePair;
-
- // Wrap the passed in rdma_cm_id with a Connection
- // this basically happens only on connection request
- Connection(::rdma_cm_id* i) :
- qpid::sys::IOHandle(new qpid::sys::IOHandlePrivate),
- id(i, destroyId),
- context(0)
- {
- impl->fd = id->channel->fd;
-
- // Just overwrite the previous context as it will
- // have come from the listening connection
- if (i)
- i->context = this;
- }
-
- Connection() :
- qpid::sys::IOHandle(new qpid::sys::IOHandlePrivate),
- channel(mkEChannel()),
- id(mkId(channel.get(), this, RDMA_PS_TCP)),
- context(0)
- {
- impl->fd = channel->fd;
- }
-
- ~Connection() {
- // Reset the id context in case someone else has it
- id->context = 0;
- }
-
- // Default destructor fine
-
- void ensureQueuePair() {
- assert(id.get());
-
- // Only allocate a queue pair if there isn't one already
- if (qp)
- return;
-
- qp = new QueuePair(id);
- }
-
- public:
- typedef boost::intrusive_ptr<Connection> intrusive_ptr;
-
- static intrusive_ptr make() {
- return new Connection();
- }
-
- static intrusive_ptr find(::rdma_cm_id* i) {
- if (!i)
- return 0;
- Connection* id = static_cast< Connection* >(i->context);
- if (!id)
- throw std::logic_error("Couldn't find existing Connection");
- return id;
- }
-
- template <typename T>
- void addContext(T* c) {
- // Don't allow replacing context
- if (!context)
- context = c;
- }
-
- template <typename T>
- T* getContext() {
- return static_cast<T*>(context);
- }
-
- // Make channel non-blocking by making
- // associated fd nonblocking
- void nonblocking() {
- assert(id.get());
- ::fcntl(id->channel->fd, F_SETFL, O_NONBLOCK);
- }
-
- // If we get EAGAIN because the channel has been set non blocking
- // and we'd have to wait then return an empty event
- ConnectionEvent getNextEvent() {
- assert(id.get());
- ::rdma_cm_event* e;
- int rc = ::rdma_get_cm_event(id->channel, &e);
- if (rc == -1 && errno == EAGAIN)
- return ConnectionEvent();
- CHECK(rc);
- return ConnectionEvent(e);
- }
-
- void bind(sockaddr& src_addr) const {
- assert(id.get());
- CHECK(::rdma_bind_addr(id.get(), &src_addr));
- }
-
- void listen(int backlog = DEFAULT_BACKLOG) const {
- assert(id.get());
- CHECK(::rdma_listen(id.get(), backlog));
- }
-
- void resolve_addr(
- sockaddr& dst_addr,
- sockaddr* src_addr = 0,
- int timeout_ms = DEFAULT_TIMEOUT) const
- {
- assert(id.get());
- CHECK(::rdma_resolve_addr(id.get(), src_addr, &dst_addr, timeout_ms));
- }
-
- void resolve_route(int timeout_ms = DEFAULT_TIMEOUT) const {
- assert(id.get());
- CHECK(::rdma_resolve_route(id.get(), timeout_ms));
- }
-
- void disconnect() const {
- assert(id.get());
- CHECK(::rdma_disconnect(id.get()));
- }
-
- // TODO: Currently you can only connect with the default connection parameters
- void connect() {
- assert(id.get());
-
- // Need to have a queue pair before we can connect
- ensureQueuePair();
-
- ::rdma_conn_param p = DEFAULT_CONNECT_PARAM;
- CHECK(::rdma_connect(id.get(), &p));
- }
-
- template <typename T>
- void connect(const T* data) {
- assert(id.get());
- // Need to have a queue pair before we can connect
- ensureQueuePair();
-
- ::rdma_conn_param p = DEFAULT_CONNECT_PARAM;
- p.private_data = data;
- p.private_data_len = sizeof(T);
- CHECK(::rdma_connect(id.get(), &p));
- }
-
- // TODO: Not sure how to default accept params - they come from the connection request
- // event
- template <typename T>
- void accept(const ::rdma_conn_param& param, const T* data) {
- assert(id.get());
- // Need to have a queue pair before we can accept
- ensureQueuePair();
-
- ::rdma_conn_param p = param;
- p.private_data = data;
- p.private_data_len = sizeof(T);
- CHECK(::rdma_accept(id.get(), &p));
- }
-
- void accept(const ::rdma_conn_param& param) {
- assert(id.get());
- // Need to have a queue pair before we can accept
- ensureQueuePair();
-
- ::rdma_conn_param p = param;
- p.private_data = 0;
- p.private_data_len = 0;
- CHECK(::rdma_accept(id.get(), &p));
- }
-
- template <typename T>
- void reject(const T* data) const {
- assert(id.get());
- CHECK(::rdma_reject(id.get(), data, sizeof(T)));
- }
-
- void reject() const {
- assert(id.get());
- CHECK(::rdma_reject(id.get(), 0, 0));
- }
-
- QueuePair::intrusive_ptr getQueuePair() {
- assert(id.get());
-
- ensureQueuePair();
-
- return qp;
- }
-
- std::string getLocalName() const {
- ::sockaddr* addr = ::rdma_get_local_addr(id.get());
- char hostName[NI_MAXHOST];
- char portName[NI_MAXSERV];
- CHECK_IBV(::getnameinfo(
- addr, sizeof(::sockaddr_storage),
- hostName, sizeof(hostName),
- portName, sizeof(portName),
- NI_NUMERICHOST | NI_NUMERICSERV));
- std::string r(hostName);
- r += ":";
- r += portName;
- return r;
- }
-
- std::string getPeerName() const {
- ::sockaddr* addr = ::rdma_get_peer_addr(id.get());
- char hostName[NI_MAXHOST];
- char portName[NI_MAXSERV];
- CHECK_IBV(::getnameinfo(
- addr, sizeof(::sockaddr_storage),
- hostName, sizeof(hostName),
- portName, sizeof(portName),
- NI_NUMERICHOST | NI_NUMERICSERV));
- std::string r(hostName);
- r += ":";
- r += portName;
- return r;
- }
- };
-
- inline void QueuePair::notifyRecv() {
- CHECK_IBV(ibv_req_notify_cq(rcq.get(), 0));
- }
-
- inline void QueuePair::notifySend() {
- CHECK_IBV(ibv_req_notify_cq(scq.get(), 0));
- }
-
- inline ConnectionEvent::ConnectionEvent(::rdma_cm_event* e) :
- id((e->event != RDMA_CM_EVENT_CONNECT_REQUEST) ?
- Connection::find(e->id) : new Connection(e->id)),
- listen_id(Connection::find(e->listen_id)),
- event(e, acker)
- {}
-}
-
-std::ostream& operator<<(std::ostream& o, ::rdma_cm_event_type t);
-
-#endif // RDMA_WRAP_H
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/solaris/ECFPoller.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/solaris/ECFPoller.cpp
deleted file mode 100644
index 783f84576b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/solaris/ECFPoller.cpp
+++ /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.
- *
- */
-
-#include "qpid/log/Logger.h"
-#include "qpid/sys/Poller.h"
-#include "qpid/sys/IOHandle.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/DeletionManager.h"
-#include "qpid/sys/posix/check.h"
-#include "qpid/sys/posix/PrivatePosix.h"
-
-#include <port.h>
-#include <poll.h>
-#include <errno.h>
-
-#include <assert.h>
-#include <vector>
-#include <exception>
-
-
-//TODO: Remove this
-#include "qpid/sys/Dispatcher.h"
-
-namespace qpid {
-namespace sys {
-
-// Deletion manager to handle deferring deletion of PollerHandles to when they definitely aren't being used
-DeletionManager<PollerHandle> PollerHandleDeletionManager;
-
-// Instantiate (and define) class static for DeletionManager
-template <>
-DeletionManager<PollerHandle>::AllThreadsStatuses DeletionManager<PollerHandle>::allThreadsStatuses(0);
-
-class PollerHandlePrivate {
- friend class Poller;
- friend class PollerHandle;
-
- enum FDStat {
- ABSENT,
- MONITORED,
- INACTIVE,
- HUNGUP,
- MONITORED_HUNGUP
- };
-
- int fd;
- uint32_t events;
- FDStat stat;
- Mutex lock;
-
- PollerHandlePrivate(int f) :
- fd(f),
- events(0),
- stat(ABSENT) {
- }
-
- bool isActive() const {
- return stat == MONITORED || stat == MONITORED_HUNGUP;
- }
-
- void setActive() {
- stat = (stat == HUNGUP) ? MONITORED_HUNGUP : MONITORED;
- }
-
- bool isInactive() const {
- return stat == INACTIVE || stat == HUNGUP;
- }
-
- void setInactive() {
- stat = INACTIVE;
- }
-
- bool isIdle() const {
- return stat == ABSENT;
- }
-
- void setIdle() {
- stat = ABSENT;
- }
-
- bool isHungup() const {
- return stat == MONITORED_HUNGUP || stat == HUNGUP;
- }
-
- void setHungup() {
- assert(stat == MONITORED);
- stat = HUNGUP;
- }
-};
-
-PollerHandle::PollerHandle(const IOHandle& h) :
- impl(new PollerHandlePrivate(toFd(h.impl)))
-{}
-
-PollerHandle::~PollerHandle() {
- delete impl;
-}
-
-void PollerHandle::deferDelete() {
- PollerHandleDeletionManager.markForDeletion(this);
-}
-
-/**
- * Concrete implementation of Poller to use the Solaris Event Completion
- * Framework interface
- */
-class PollerPrivate {
- friend class Poller;
-
- const int portId;
-
- static uint32_t directionToPollEvent(Poller::Direction dir) {
- switch (dir) {
- case Poller::INPUT: return POLLIN;
- case Poller::OUTPUT: return POLLOUT;
- case Poller::INOUT: return POLLIN | POLLOUT;
- default: return 0;
- }
- }
-
- static Poller::EventType pollToDirection(uint32_t events) {
- uint32_t e = events & (POLLIN | POLLOUT);
- switch (e) {
- case POLLIN: return Poller::READABLE;
- case POLLOUT: return Poller::WRITABLE;
- case POLLIN | POLLOUT: return Poller::READ_WRITABLE;
- default:
- return (events & (POLLHUP | POLLERR)) ?
- Poller::DISCONNECTED : Poller::INVALID;
- }
- }
-
- PollerPrivate() :
- portId(::port_create()) {
- }
-
- ~PollerPrivate() {
- }
-};
-
-void Poller::addFd(PollerHandle& handle, Direction dir) {
- PollerHandlePrivate& eh = *handle.impl;
- ScopedLock<Mutex> l(eh.lock);
-
- uint32_t events = 0;
-
- if (eh.isIdle()) {
- events = PollerPrivate::directionToPollEvent(dir);
- } else {
- assert(eh.isActive());
- events = eh.events | PollerPrivate::directionToPollEvent(dir);
- }
-
- //port_associate can be used to add an association or modify an
- //existing one
- QPID_POSIX_CHECK(::port_associate(impl->portId, PORT_SOURCE_FD, (uintptr_t) eh.fd, events, &handle));
- eh.events = events;
- eh.setActive();
- QPID_LOG(trace, "Poller::addFd(handle=" << &handle
- << "[" << typeid(&handle).name()
- << "], fd=" << eh.fd << ")");
- //assert(dynamic_cast<DispatchHandle*>(&handle));
-}
-
-void Poller::delFd(PollerHandle& handle) {
- PollerHandlePrivate& eh = *handle.impl;
- ScopedLock<Mutex> l(eh.lock);
- assert(!eh.isIdle());
- int rc = ::port_dissociate(impl->portId, PORT_SOURCE_FD, (uintptr_t) eh.fd);
- //Allow closing an invalid fd, allowing users to close fd before
- //doing delFd()
- if (rc == -1 && errno != EBADFD) {
- QPID_POSIX_CHECK(rc);
- }
- eh.setIdle();
- QPID_LOG(trace, "Poller::delFd(handle=" << &handle
- << ", fd=" << eh.fd << ")");
-}
-
-// modFd is equivalent to delFd followed by addFd
-void Poller::modFd(PollerHandle& handle, Direction dir) {
- PollerHandlePrivate& eh = *handle.impl;
- ScopedLock<Mutex> l(eh.lock);
- assert(!eh.isIdle());
-
- eh.events = PollerPrivate::directionToPollEvent(dir);
-
- //If fd is already associated, events and user arguments are updated
- //So, no need to check if fd is already associated
- QPID_POSIX_CHECK(::port_associate(impl->portId, PORT_SOURCE_FD, (uintptr_t) eh.fd, eh.events, &handle));
- eh.setActive();
- QPID_LOG(trace, "Poller::modFd(handle=" << &handle
- << ", fd=" << eh.fd << ")");
-}
-
-void Poller::rearmFd(PollerHandle& handle) {
- PollerHandlePrivate& eh = *handle.impl;
- ScopedLock<Mutex> l(eh.lock);
- assert(eh.isInactive());
-
- QPID_POSIX_CHECK(::port_associate(impl->portId, PORT_SOURCE_FD, (uintptr_t) eh.fd, eh.events, &handle));
- eh.setActive();
- QPID_LOG(trace, "Poller::rearmdFd(handle=" << &handle
- << ", fd=" << eh.fd << ")");
-}
-
-void Poller::shutdown() {
- //Send an Alarm to the port
- //We need to send a nonzero event mask, using POLLHUP, but
- //The wait method will only look for a PORT_ALERT_SET
- QPID_POSIX_CHECK(::port_alert(impl->portId, PORT_ALERT_SET, POLLHUP, NULL));
- QPID_LOG(trace, "Poller::shutdown");
-}
-
-Poller::Event Poller::wait(Duration timeout) {
- timespec_t tout;
- timespec_t* ptout = NULL;
- port_event_t pe;
-
- if (timeout != TIME_INFINITE) {
- tout.tv_sec = 0;
- tout.tv_nsec = timeout;
- ptout = &tout;
- }
-
- do {
- PollerHandleDeletionManager.markAllUnusedInThisThread();
- QPID_LOG(trace, "About to enter port_get. Thread "
- << pthread_self()
- << ", timeout=" << timeout);
-
- int rc = ::port_get(impl->portId, &pe, ptout);
-
- if (rc < 0) {
- switch (errno) {
- case EINTR:
- continue;
- case ETIME:
- return Event(0, TIMEOUT);
- default:
- QPID_POSIX_CHECK(rc);
- }
- } else {
- //We use alert mode to notify the shutdown of the Poller
- if (pe.portev_source == PORT_SOURCE_ALERT) {
- return Event(0, SHUTDOWN);
- }
- if (pe.portev_source == PORT_SOURCE_FD) {
- PollerHandle *handle = static_cast<PollerHandle*>(pe.portev_user);
- PollerHandlePrivate& eh = *handle->impl;
- ScopedLock<Mutex> l(eh.lock);
- QPID_LOG(trace, "About to send handle: " << handle);
-
- if (eh.isActive()) {
- if (pe.portev_events & POLLHUP) {
- if (eh.isHungup()) {
- return Event(handle, DISCONNECTED);
- }
- eh.setHungup();
- } else {
- eh.setInactive();
- }
- QPID_LOG(trace, "Sending event (thread: "
- << pthread_self() << ") for handle " << handle
- << ", direction= "
- << PollerPrivate::pollToDirection(pe.portev_events));
- return Event(handle, PollerPrivate::pollToDirection(pe.portev_events));
- }
- }
- }
- } while (true);
-}
-
-// Concrete constructors
-Poller::Poller() :
- impl(new PollerPrivate())
-{}
-
-Poller::~Poller() {
- delete impl;
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslHandler.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslHandler.cpp
deleted file mode 100644
index 3c7e2190e7..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslHandler.cpp
+++ /dev/null
@@ -1,181 +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 "SslHandler.h"
-
-#include "SslIo.h"
-#include "SslSocket.h"
-#include "qpid/framing/AMQP_HighestVersion.h"
-#include "qpid/framing/ProtocolInitiation.h"
-#include "qpid/log/Statement.h"
-
-namespace qpid {
-namespace sys {
-namespace ssl {
-
-
-// Buffer definition
-struct Buff : public SslIO::BufferBase {
- Buff() :
- SslIO::BufferBase(new char[65536], 65536)
- {}
- ~Buff()
- { delete [] bytes;}
-};
-
-SslHandler::SslHandler(std::string id, ConnectionCodec::Factory* f) :
- identifier(id),
- aio(0),
- factory(f),
- codec(0),
- readError(false),
- isClient(false)
-{}
-
-SslHandler::~SslHandler() {
- if (codec)
- codec->closed();
- delete codec;
-}
-
-void SslHandler::init(SslIO* a, int numBuffs) {
- aio = a;
-
- // Give connection some buffers to use
- for (int i = 0; i < numBuffs; i++) {
- aio->queueReadBuffer(new Buff);
- }
-}
-
-void SslHandler::write(const framing::ProtocolInitiation& data)
-{
- QPID_LOG(debug, "SENT [" << identifier << "] INIT(" << data << ")");
- SslIO::BufferBase* buff = aio->getQueuedBuffer();
- if (!buff)
- buff = new Buff;
- framing::Buffer out(buff->bytes, buff->byteCount);
- data.encode(out);
- buff->dataCount = data.encodedSize();
- aio->queueWrite(buff);
-}
-
-void SslHandler::activateOutput() {
- aio->notifyPendingWrite();
-}
-
-void SslHandler::giveReadCredit(int32_t) {
- // FIXME aconway 2008-12-05: not yet implemented.
-}
-
-// Input side
-void SslHandler::readbuff(SslIO& , SslIO::BufferBase* buff) {
- if (readError) {
- return;
- }
- size_t decoded = 0;
- if (codec) { // Already initiated
- try {
- decoded = codec->decode(buff->bytes+buff->dataStart, buff->dataCount);
- }catch(const std::exception& e){
- QPID_LOG(error, e.what());
- readError = true;
- aio->queueWriteClose();
- }
- }else{
- framing::Buffer in(buff->bytes+buff->dataStart, buff->dataCount);
- framing::ProtocolInitiation protocolInit;
- if (protocolInit.decode(in)) {
- decoded = in.getPosition();
- QPID_LOG(debug, "RECV [" << identifier << "] INIT(" << protocolInit << ")");
- try {
- codec = factory->create(protocolInit.getVersion(), *this, identifier);
- if (!codec) {
- //TODO: may still want to revise this...
- //send valid version header & close connection.
- write(framing::ProtocolInitiation(framing::highestProtocolVersion));
- readError = true;
- aio->queueWriteClose();
- }
- } catch (const std::exception& e) {
- QPID_LOG(error, e.what());
- readError = true;
- aio->queueWriteClose();
- }
- }
- }
- // TODO: unreading needs to go away, and when we can cope
- // with multiple sub-buffers in the general buffer scheme, it will
- if (decoded != size_t(buff->dataCount)) {
- // Adjust buffer for used bytes and then "unread them"
- buff->dataStart += decoded;
- buff->dataCount -= decoded;
- aio->unread(buff);
- } else {
- // Give whole buffer back to aio subsystem
- aio->queueReadBuffer(buff);
- }
-}
-
-void SslHandler::eof(SslIO&) {
- QPID_LOG(debug, "DISCONNECTED [" << identifier << "]");
- if (codec) codec->closed();
- aio->queueWriteClose();
-}
-
-void SslHandler::closedSocket(SslIO&, const SslSocket& s) {
- // If we closed with data still to send log a warning
- if (!aio->writeQueueEmpty()) {
- QPID_LOG(warning, "CLOSING [" << identifier << "] unsent data (probably due to client disconnect)");
- }
- delete &s;
- aio->queueForDeletion();
- delete this;
-}
-
-void SslHandler::disconnect(SslIO& a) {
- // treat the same as eof
- eof(a);
-}
-
-// Notifications
-void SslHandler::nobuffs(SslIO&) {
-}
-
-void SslHandler::idle(SslIO&){
- if (isClient && codec == 0) {
- codec = factory->create(*this, identifier);
- write(framing::ProtocolInitiation(codec->getVersion()));
- return;
- }
- if (codec == 0) return;
- if (codec->canEncode()) {
- // Try and get a queued buffer if not then construct new one
- SslIO::BufferBase* buff = aio->getQueuedBuffer();
- if (!buff) buff = new Buff;
- size_t encoded=codec->encode(buff->bytes, buff->byteCount);
- buff->dataCount = encoded;
- aio->queueWrite(buff);
- }
- if (codec->isClosed())
- aio->queueWriteClose();
-}
-
-
-}}} // namespace qpid::sys::ssl
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslHandler.h b/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslHandler.h
deleted file mode 100644
index ae654d7ad2..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslHandler.h
+++ /dev/null
@@ -1,76 +0,0 @@
-#ifndef QPID_SYS_SSL_SSLHANDLER_H
-#define QPID_SYS_SSL_SSLHANDLER_H
-
-/*
- *
- * 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 "qpid/sys/ConnectionCodec.h"
-#include "qpid/sys/OutputControl.h"
-
-namespace qpid {
-
-namespace framing {
- class ProtocolInitiation;
-}
-
-namespace sys {
-namespace ssl {
-
-class SslIO;
-class SslIOBufferBase;
-class SslSocket;
-
-class SslHandler : public OutputControl {
- std::string identifier;
- SslIO* aio;
- ConnectionCodec::Factory* factory;
- ConnectionCodec* codec;
- bool readError;
- bool isClient;
-
- void write(const framing::ProtocolInitiation&);
-
- public:
- SslHandler(std::string id, ConnectionCodec::Factory* f);
- ~SslHandler();
- void init(SslIO* a, int numBuffs);
-
- void setClient() { isClient = true; }
-
- // Output side
- void close();
- void activateOutput();
- void giveReadCredit(int32_t);
-
- // Input side
- void readbuff(SslIO& aio, SslIOBufferBase* buff);
- void eof(SslIO& aio);
- void disconnect(SslIO& aio);
-
- // Notifications
- void nobuffs(SslIO& aio);
- void idle(SslIO& aio);
- void closedSocket(SslIO& aio, const SslSocket& s);
-};
-
-}}} // namespace qpid::sys::ssl
-
-#endif /*!QPID_SYS_SSL_SSLHANDLER_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslIo.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslIo.cpp
deleted file mode 100644
index 9be75af47d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslIo.cpp
+++ /dev/null
@@ -1,433 +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 "SslIo.h"
-#include "SslSocket.h"
-
-#include "qpid/sys/Time.h"
-#include "qpid/sys/posix/check.h"
-#include "qpid/log/Statement.h"
-
-// TODO The basic algorithm here is not really POSIX specific and with a bit more abstraction
-// could (should) be promoted to be platform portable
-#include <unistd.h>
-#include <sys/socket.h>
-#include <signal.h>
-#include <errno.h>
-#include <string.h>
-
-#include <boost/bind.hpp>
-
-using namespace qpid::sys;
-using namespace qpid::sys::ssl;
-
-namespace {
-
-/*
- * Make *process* not generate SIGPIPE when writing to closed
- * pipe/socket (necessary as default action is to terminate process)
- */
-void ignoreSigpipe() {
- ::signal(SIGPIPE, SIG_IGN);
-}
-
-/*
- * We keep per thread state to avoid locking overhead. The assumption is that
- * on average all the connections are serviced by all the threads so the state
- * recorded in each thread is about the same. If this turns out not to be the
- * case we could rebalance the info occasionally.
- */
-__thread int threadReadTotal = 0;
-__thread int threadMaxRead = 0;
-__thread int threadReadCount = 0;
-__thread int threadWriteTotal = 0;
-__thread int threadWriteCount = 0;
-__thread int64_t threadMaxReadTimeNs = 2 * 1000000; // start at 2ms
-}
-
-/*
- * Asynch Acceptor
- */
-
-SslAcceptor::SslAcceptor(const SslSocket& s, Callback callback) :
- acceptedCallback(callback),
- handle(s, boost::bind(&SslAcceptor::readable, this, _1), 0, 0),
- socket(s) {
-
- s.setNonblocking();
- ignoreSigpipe();
-}
-
-void SslAcceptor::start(Poller::shared_ptr poller) {
- handle.startWatch(poller);
-}
-
-/*
- * We keep on accepting as long as there is something to accept
- */
-void SslAcceptor::readable(DispatchHandle& h) {
- SslSocket* s;
- do {
- errno = 0;
- // TODO: Currently we ignore the peers address, perhaps we should
- // log it or use it for connection acceptance.
- try {
- s = socket.accept(0, 0);
- if (s) {
- acceptedCallback(*s);
- } else {
- break;
- }
- } catch (const std::exception& e) {
- QPID_LOG(error, "Could not accept socket: " << e.what());
- }
- } while (true);
-
- h.rewatch();
-}
-
-/*
- * Asynch Connector
- */
-
-SslConnector::SslConnector(const SslSocket& s,
- Poller::shared_ptr poller,
- std::string hostname,
- uint16_t port,
- ConnectedCallback connCb,
- FailedCallback failCb) :
- DispatchHandle(s,
- 0,
- boost::bind(&SslConnector::connComplete, this, _1),
- boost::bind(&SslConnector::connComplete, this, _1)),
- connCallback(connCb),
- failCallback(failCb),
- socket(s)
-{
- //TODO: would be better for connect to be performed on a
- //non-blocking socket, but that doesn't work at present so connect
- //blocks until complete
- try {
- socket.connect(hostname, port);
- socket.setNonblocking();
- startWatch(poller);
- } catch(std::exception& e) {
- failure(-1, std::string(e.what()));
- }
-}
-
-void SslConnector::connComplete(DispatchHandle& h)
-{
- int errCode = socket.getError();
-
- h.stopWatch();
- if (errCode == 0) {
- connCallback(socket);
- DispatchHandle::doDelete();
- } else {
- // TODO: This need to be fixed as strerror isn't thread safe
- failure(errCode, std::string(::strerror(errCode)));
- }
-}
-
-void SslConnector::failure(int errCode, std::string message)
-{
- if (failCallback)
- failCallback(errCode, message);
-
- socket.close();
- delete &socket;
-
- DispatchHandle::doDelete();
-}
-
-/*
- * Asynch reader/writer
- */
-SslIO::SslIO(const SslSocket& s,
- ReadCallback rCb, EofCallback eofCb, DisconnectCallback disCb,
- ClosedCallback cCb, BuffersEmptyCallback eCb, IdleCallback iCb) :
-
- DispatchHandle(s,
- boost::bind(&SslIO::readable, this, _1),
- boost::bind(&SslIO::writeable, this, _1),
- boost::bind(&SslIO::disconnected, this, _1)),
- readCallback(rCb),
- eofCallback(eofCb),
- disCallback(disCb),
- closedCallback(cCb),
- emptyCallback(eCb),
- idleCallback(iCb),
- socket(s),
- queuedClose(false),
- writePending(false) {
-
- s.setNonblocking();
-}
-
-struct deleter
-{
- template <typename T>
- void operator()(T *ptr){ delete ptr;}
-};
-
-SslIO::~SslIO() {
- std::for_each( bufferQueue.begin(), bufferQueue.end(), deleter());
- std::for_each( writeQueue.begin(), writeQueue.end(), deleter());
-}
-
-void SslIO::queueForDeletion() {
- DispatchHandle::doDelete();
-}
-
-void SslIO::start(Poller::shared_ptr poller) {
- DispatchHandle::startWatch(poller);
-}
-
-void SslIO::queueReadBuffer(BufferBase* buff) {
- assert(buff);
- buff->dataStart = 0;
- buff->dataCount = 0;
- bufferQueue.push_back(buff);
- DispatchHandle::rewatchRead();
-}
-
-void SslIO::unread(BufferBase* buff) {
- assert(buff);
- if (buff->dataStart != 0) {
- memmove(buff->bytes, buff->bytes+buff->dataStart, buff->dataCount);
- buff->dataStart = 0;
- }
- bufferQueue.push_front(buff);
- DispatchHandle::rewatchRead();
-}
-
-void SslIO::queueWrite(BufferBase* buff) {
- assert(buff);
- // If we've already closed the socket then throw the write away
- if (queuedClose) {
- bufferQueue.push_front(buff);
- return;
- } else {
- writeQueue.push_front(buff);
- }
- writePending = false;
- DispatchHandle::rewatchWrite();
-}
-
-void SslIO::notifyPendingWrite() {
- writePending = true;
- DispatchHandle::rewatchWrite();
-}
-
-void SslIO::queueWriteClose() {
- queuedClose = true;
- DispatchHandle::rewatchWrite();
-}
-
-/** Return a queued buffer if there are enough
- * to spare
- */
-SslIO::BufferBase* SslIO::getQueuedBuffer() {
- // Always keep at least one buffer (it might have data that was "unread" in it)
- if (bufferQueue.size()<=1)
- return 0;
- BufferBase* buff = bufferQueue.back();
- assert(buff);
- buff->dataStart = 0;
- buff->dataCount = 0;
- bufferQueue.pop_back();
- return buff;
-}
-
-/*
- * We keep on reading as long as we have something to read and a buffer to put
- * it in
- */
-void SslIO::readable(DispatchHandle& h) {
- int readTotal = 0;
- AbsTime readStartTime = AbsTime::now();
- do {
- // (Try to) get a buffer
- if (!bufferQueue.empty()) {
- // Read into buffer
- BufferBase* buff = bufferQueue.front();
- assert(buff);
- bufferQueue.pop_front();
- errno = 0;
- int readCount = buff->byteCount-buff->dataCount;
- int rc = socket.read(buff->bytes + buff->dataCount, readCount);
- if (rc > 0) {
- buff->dataCount += rc;
- threadReadTotal += rc;
- readTotal += rc;
-
- readCallback(*this, buff);
- if (rc != readCount) {
- // If we didn't fill the read buffer then time to stop reading
- break;
- }
-
- // Stop reading if we've overrun our timeslot
- if (Duration(readStartTime, AbsTime::now()) > threadMaxReadTimeNs) {
- break;
- }
-
- } else {
- // Put buffer back (at front so it doesn't interfere with unread buffers)
- bufferQueue.push_front(buff);
- assert(buff);
-
- // Eof or other side has gone away
- if (rc == 0 || errno == ECONNRESET) {
- eofCallback(*this);
- h.unwatchRead();
- break;
- } else if (errno == EAGAIN) {
- // We have just put a buffer back so we know
- // we can carry on watching for reads
- break;
- } else {
- // Report error then just treat as a socket disconnect
- QPID_LOG(error, "Error reading socket: " << qpid::sys::strError(rc) << "(" << rc << ")" );
- eofCallback(*this);
- h.unwatchRead();
- break;
- }
- }
- } else {
- // Something to read but no buffer
- if (emptyCallback) {
- emptyCallback(*this);
- }
- // If we still have no buffers we can't do anything more
- if (bufferQueue.empty()) {
- h.unwatchRead();
- break;
- }
-
- }
- } while (true);
-
- ++threadReadCount;
- threadMaxRead = std::max(threadMaxRead, readTotal);
- return;
-}
-
-/*
- * We carry on writing whilst we have data to write and we can write
- */
-void SslIO::writeable(DispatchHandle& h) {
- int writeTotal = 0;
- do {
- // See if we've got something to write
- if (!writeQueue.empty()) {
- // Write buffer
- BufferBase* buff = writeQueue.back();
- writeQueue.pop_back();
- errno = 0;
- assert(buff->dataStart+buff->dataCount <= buff->byteCount);
- int rc = socket.write(buff->bytes+buff->dataStart, buff->dataCount);
- if (rc >= 0) {
- threadWriteTotal += rc;
- writeTotal += rc;
-
- // If we didn't write full buffer put rest back
- if (rc != buff->dataCount) {
- buff->dataStart += rc;
- buff->dataCount -= rc;
- writeQueue.push_back(buff);
- break;
- }
-
- // Recycle the buffer
- queueReadBuffer(buff);
-
- // If we've already written more than the max for reading then stop
- // (this is to stop writes dominating reads)
- if (writeTotal > threadMaxRead)
- break;
- } else {
- // Put buffer back
- writeQueue.push_back(buff);
- if (errno == ECONNRESET || errno == EPIPE) {
- // Just stop watching for write here - we'll get a
- // disconnect callback soon enough
- h.unwatchWrite();
- break;
- } else if (errno == EAGAIN) {
- // We have just put a buffer back so we know
- // we can carry on watching for writes
- break;
- } else {
- QPID_POSIX_CHECK(rc);
- }
- }
- } else {
- // If we're waiting to close the socket then can do it now as there is nothing to write
- if (queuedClose) {
- close(h);
- break;
- }
- // Fd is writable, but nothing to write
- if (idleCallback) {
- writePending = false;
- idleCallback(*this);
- }
- // If we still have no buffers to write we can't do anything more
- if (writeQueue.empty() && !writePending && !queuedClose) {
- h.unwatchWrite();
- // The following handles the case where writePending is
- // set to true after the test above; in this case its
- // possible that the unwatchWrite overwrites the
- // desired rewatchWrite so we correct that here
- if (writePending)
- h.rewatchWrite();
- break;
- }
- }
- } while (true);
-
- ++threadWriteCount;
- return;
-}
-
-void SslIO::disconnected(DispatchHandle& h) {
- // If we've already queued close do it instead of disconnected callback
- if (queuedClose) {
- close(h);
- } else if (disCallback) {
- disCallback(*this);
- h.unwatch();
- }
-}
-
-/*
- * Close the socket and callback to say we've done it
- */
-void SslIO::close(DispatchHandle& h) {
- h.stopWatch();
- socket.close();
- if (closedCallback) {
- closedCallback(*this, socket);
- }
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslIo.h b/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslIo.h
deleted file mode 100644
index ba6483282b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslIo.h
+++ /dev/null
@@ -1,167 +0,0 @@
-#ifndef _sys_ssl_SslIO
-#define _sys_ssl_SslIO
-/*
- *
- * 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 "qpid/sys/DispatchHandle.h"
-
-#include <boost/function.hpp>
-#include <deque>
-
-namespace qpid {
-namespace sys {
-namespace ssl {
-
-class SslSocket;
-
-/*
- * Asynchronous ssl acceptor: accepts connections then does a callback
- * with the accepted fd
- */
-class SslAcceptor {
-public:
- typedef boost::function1<void, const SslSocket&> Callback;
-
-private:
- Callback acceptedCallback;
- qpid::sys::DispatchHandle handle;
- const SslSocket& socket;
-
-public:
- SslAcceptor(const SslSocket& s, Callback callback);
- void start(qpid::sys::Poller::shared_ptr poller);
-
-private:
- void readable(qpid::sys::DispatchHandle& handle);
-};
-
-/*
- * Asynchronous ssl connector: starts the process of initiating a
- * connection and invokes a callback when completed or failed.
- */
-class SslConnector : private qpid::sys::DispatchHandle {
-public:
- typedef boost::function1<void, const SslSocket&> ConnectedCallback;
- typedef boost::function2<void, int, std::string> FailedCallback;
-
-private:
- ConnectedCallback connCallback;
- FailedCallback failCallback;
- const SslSocket& socket;
-
-public:
- SslConnector(const SslSocket& socket,
- Poller::shared_ptr poller,
- std::string hostname,
- uint16_t port,
- ConnectedCallback connCb,
- FailedCallback failCb = 0);
-
-private:
- void connComplete(DispatchHandle& handle);
- void failure(int, std::string);
-};
-
-struct SslIOBufferBase {
- char* const bytes;
- const int32_t byteCount;
- int32_t dataStart;
- int32_t dataCount;
-
- SslIOBufferBase(char* const b, const int32_t s) :
- bytes(b),
- byteCount(s),
- dataStart(0),
- dataCount(0)
- {}
-
- virtual ~SslIOBufferBase()
- {}
-};
-
-/*
- * Asychronous reader/writer:
- * Reader accepts buffers to read into; reads into the provided buffers
- * and then does a callback with the buffer and amount read. Optionally it can callback
- * when there is something to read but no buffer to read it into.
- *
- * Writer accepts a buffer and queues it for writing; can also be given
- * a callback for when writing is "idle" (ie fd is writable, but nothing to write)
- *
- * The class is implemented in terms of DispatchHandle to allow it to be deleted by deleting
- * the contained DispatchHandle
- */
-class SslIO : private qpid::sys::DispatchHandle {
-public:
- typedef SslIOBufferBase BufferBase;
-
- typedef boost::function2<void, SslIO&, BufferBase*> ReadCallback;
- typedef boost::function1<void, SslIO&> EofCallback;
- typedef boost::function1<void, SslIO&> DisconnectCallback;
- typedef boost::function2<void, SslIO&, const SslSocket&> ClosedCallback;
- typedef boost::function1<void, SslIO&> BuffersEmptyCallback;
- typedef boost::function1<void, SslIO&> IdleCallback;
-
-private:
- ReadCallback readCallback;
- EofCallback eofCallback;
- DisconnectCallback disCallback;
- ClosedCallback closedCallback;
- BuffersEmptyCallback emptyCallback;
- IdleCallback idleCallback;
- const SslSocket& socket;
- std::deque<BufferBase*> bufferQueue;
- std::deque<BufferBase*> writeQueue;
- bool queuedClose;
- /**
- * This flag is used to detect and handle concurrency between
- * calls to notifyPendingWrite() (which can be made from any thread) and
- * the execution of the writeable() method (which is always on the
- * thread processing this handle.
- */
- volatile bool writePending;
-
-public:
- SslIO(const SslSocket& s,
- ReadCallback rCb, EofCallback eofCb, DisconnectCallback disCb,
- ClosedCallback cCb = 0, BuffersEmptyCallback eCb = 0, IdleCallback iCb = 0);
- void queueForDeletion();
-
- void start(qpid::sys::Poller::shared_ptr poller);
- void queueReadBuffer(BufferBase* buff);
- void unread(BufferBase* buff);
- void queueWrite(BufferBase* buff);
- void notifyPendingWrite();
- void queueWriteClose();
- bool writeQueueEmpty() { return writeQueue.empty(); }
- BufferBase* getQueuedBuffer();
-
-private:
- ~SslIO();
- void readable(qpid::sys::DispatchHandle& handle);
- void writeable(qpid::sys::DispatchHandle& handle);
- void disconnected(qpid::sys::DispatchHandle& handle);
- void close(qpid::sys::DispatchHandle& handle);
-};
-
-}}}
-
-#endif // _sys_ssl_SslIO
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslSocket.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslSocket.cpp
deleted file mode 100644
index 597fbe57db..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslSocket.cpp
+++ /dev/null
@@ -1,279 +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 "SslSocket.h"
-#include "check.h"
-#include "util.h"
-#include "qpid/Exception.h"
-#include "qpid/sys/posix/check.h"
-#include "qpid/sys/posix/PrivatePosix.h"
-
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/errno.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h>
-#include <netdb.h>
-#include <cstdlib>
-#include <string.h>
-#include <iostream>
-
-#include <nspr4/private/pprio.h>
-#include <nss3/nss.h>
-#include <nss3/pk11pub.h>
-#include <nss3/ssl.h>
-#include <nss3/key.h>
-
-#include <boost/format.hpp>
-
-namespace qpid {
-namespace sys {
-namespace ssl {
-
-namespace {
-std::string getName(int fd, bool local, bool includeService = false)
-{
- ::sockaddr_storage name; // big enough for any socket address
- ::socklen_t namelen = sizeof(name);
-
- int result = -1;
- if (local) {
- result = ::getsockname(fd, (::sockaddr*)&name, &namelen);
- } else {
- result = ::getpeername(fd, (::sockaddr*)&name, &namelen);
- }
-
- QPID_POSIX_CHECK(result);
-
- char servName[NI_MAXSERV];
- char dispName[NI_MAXHOST];
- if (includeService) {
- if (int rc=::getnameinfo((::sockaddr*)&name, namelen, dispName, sizeof(dispName),
- servName, sizeof(servName),
- NI_NUMERICHOST | NI_NUMERICSERV) != 0)
- throw QPID_POSIX_ERROR(rc);
- return std::string(dispName) + ":" + std::string(servName);
-
- } else {
- if (int rc=::getnameinfo((::sockaddr*)&name, namelen, dispName, sizeof(dispName), 0, 0, NI_NUMERICHOST) != 0)
- throw QPID_POSIX_ERROR(rc);
- return dispName;
- }
-}
-
-std::string getService(int fd, bool local)
-{
- ::sockaddr_storage name; // big enough for any socket address
- ::socklen_t namelen = sizeof(name);
-
- int result = -1;
- if (local) {
- result = ::getsockname(fd, (::sockaddr*)&name, &namelen);
- } else {
- result = ::getpeername(fd, (::sockaddr*)&name, &namelen);
- }
-
- QPID_POSIX_CHECK(result);
-
- char servName[NI_MAXSERV];
- if (int rc=::getnameinfo((::sockaddr*)&name, namelen, 0, 0,
- servName, sizeof(servName),
- NI_NUMERICHOST | NI_NUMERICSERV) != 0)
- throw QPID_POSIX_ERROR(rc);
- return servName;
-}
-
-}
-
-SslSocket::SslSocket() : IOHandle(new IOHandlePrivate()), socket(0), prototype(0)
-{
- impl->fd = ::socket (PF_INET, SOCK_STREAM, 0);
- if (impl->fd < 0) throw QPID_POSIX_ERROR(errno);
- socket = SSL_ImportFD(0, PR_ImportTCPSocket(impl->fd));
-}
-
-/**
- * This form of the constructor is used with the server-side sockets
- * returned from accept. Because we use posix accept rather than
- * PR_Accept, we have to reset the handshake.
- */
-SslSocket::SslSocket(IOHandlePrivate* ioph, PRFileDesc* model) : IOHandle(ioph), socket(0), prototype(0)
-{
- socket = SSL_ImportFD(model, PR_ImportTCPSocket(impl->fd));
- NSS_CHECK(SSL_ResetHandshake(socket, true));
- NSS_CHECK(SSL_ForceHandshake(socket));
-}
-
-void SslSocket::setNonblocking() const
-{
- PRSocketOptionData option;
- option.option = PR_SockOpt_Nonblocking;
- option.value.non_blocking = true;
- PR_SetSocketOption(socket, &option);
-}
-
-void SslSocket::connect(const std::string& host, uint16_t port) const
-{
- std::stringstream namestream;
- namestream << host << ":" << port;
- connectname = namestream.str();
-
- void* arg = SslOptions::global.certName.empty() ? 0 : const_cast<char*>(SslOptions::global.certName.c_str());
- NSS_CHECK(SSL_GetClientAuthDataHook(socket, NSS_GetClientAuthData, arg));
- NSS_CHECK(SSL_SetURL(socket, host.data()));
-
- char hostBuffer[PR_NETDB_BUF_SIZE];
- PRHostEnt hostEntry;
- PR_CHECK(PR_GetHostByName(host.data(), hostBuffer, PR_NETDB_BUF_SIZE, &hostEntry));
- PRNetAddr address;
- int value = PR_EnumerateHostEnt(0, &hostEntry, port, &address);
- if (value < 0) {
- throw Exception(QPID_MSG("Error getting address for host: " << ErrorString()));
- } else if (value == 0) {
- throw Exception(QPID_MSG("Could not resolve address for host."));
- }
- PR_CHECK(PR_Connect(socket, &address, PR_INTERVAL_NO_TIMEOUT));
- NSS_CHECK(SSL_ForceHandshake(socket));
-}
-
-void SslSocket::close() const
-{
- if (impl->fd > 0) {
- PR_Close(socket);
- impl->fd = -1;
- }
-}
-
-int SslSocket::listen(uint16_t port, int backlog, const std::string& certName, bool clientAuth) const
-{
- //configure prototype socket:
- prototype = SSL_ImportFD(0, PR_NewTCPSocket());
- if (clientAuth) {
- NSS_CHECK(SSL_OptionSet(prototype, SSL_REQUEST_CERTIFICATE, PR_TRUE));
- NSS_CHECK(SSL_OptionSet(prototype, SSL_REQUIRE_CERTIFICATE, PR_TRUE));
- }
-
- //get certificate and key (is this the correct way?)
- CERTCertificate *cert = PK11_FindCertFromNickname(const_cast<char*>(certName.c_str()), 0);
- if (!cert) throw Exception(QPID_MSG("Failed to load certificate '" << certName << "'"));
- SECKEYPrivateKey *key = PK11_FindKeyByAnyCert(cert, 0);
- if (!key) throw Exception(QPID_MSG("Failed to retrieve private key from certificate"));
- NSS_CHECK(SSL_ConfigSecureServer(prototype, cert, key, NSS_FindCertKEAType(cert)));
- SECKEY_DestroyPrivateKey(key);
- CERT_DestroyCertificate(cert);
-
- //bind and listen
- const int& socket = impl->fd;
- int yes=1;
- QPID_POSIX_CHECK(setsockopt(socket,SOL_SOCKET,SO_REUSEADDR,&yes,sizeof(yes)));
- struct sockaddr_in name;
- name.sin_family = AF_INET;
- name.sin_port = htons(port);
- name.sin_addr.s_addr = 0;
- if (::bind(socket, (struct sockaddr*)&name, sizeof(name)) < 0)
- throw Exception(QPID_MSG("Can't bind to port " << port << ": " << strError(errno)));
- if (::listen(socket, backlog) < 0)
- throw Exception(QPID_MSG("Can't listen on port " << port << ": " << strError(errno)));
-
- socklen_t namelen = sizeof(name);
- if (::getsockname(socket, (struct sockaddr*)&name, &namelen) < 0)
- throw QPID_POSIX_ERROR(errno);
-
- return ntohs(name.sin_port);
-}
-
-SslSocket* SslSocket::accept(struct sockaddr *addr, socklen_t *addrlen) const
-{
- int afd = ::accept(impl->fd, addr, addrlen);
- if ( afd >= 0) {
- return new SslSocket(new IOHandlePrivate(afd), prototype);
- } else if (errno == EAGAIN) {
- return 0;
- } else {
- throw QPID_POSIX_ERROR(errno);
- }
-}
-
-int SslSocket::read(void *buf, size_t count) const
-{
- return PR_Read(socket, buf, count);
-}
-
-int SslSocket::write(const void *buf, size_t count) const
-{
- return PR_Write(socket, buf, count);
-}
-
-std::string SslSocket::getSockname() const
-{
- return getName(impl->fd, true);
-}
-
-std::string SslSocket::getPeername() const
-{
- return getName(impl->fd, false);
-}
-
-std::string SslSocket::getPeerAddress() const
-{
- if (!connectname.empty())
- return connectname;
- return getName(impl->fd, false, true);
-}
-
-std::string SslSocket::getLocalAddress() const
-{
- return getName(impl->fd, true, true);
-}
-
-uint16_t SslSocket::getLocalPort() const
-{
- return std::atoi(getService(impl->fd, true).c_str());
-}
-
-uint16_t SslSocket::getRemotePort() const
-{
- return atoi(getService(impl->fd, true).c_str());
-}
-
-int SslSocket::getError() const
-{
- int result;
- socklen_t rSize = sizeof (result);
-
- if (::getsockopt(impl->fd, SOL_SOCKET, SO_ERROR, &result, &rSize) < 0)
- throw QPID_POSIX_ERROR(errno);
-
- return result;
-}
-
-void SslSocket::setTcpNoDelay(bool nodelay) const
-{
- if (nodelay) {
- PRSocketOptionData option;
- option.option = PR_SockOpt_NoDelay;
- option.value.no_delay = true;
- PR_SetSocketOption(socket, &option);
- }
-}
-
-}}} // namespace qpid::sys::ssl
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslSocket.h b/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslSocket.h
deleted file mode 100644
index a82e9133e8..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/SslSocket.h
+++ /dev/null
@@ -1,117 +0,0 @@
-#ifndef _sys_ssl_Socket_h
-#define _sys_ssl_Socket_h
-
-/*
- *
- * 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 "qpid/sys/IOHandle.h"
-#include <nspr4/nspr.h>
-
-#include <string>
-
-struct sockaddr;
-
-namespace qpid {
-namespace sys {
-
-class Duration;
-
-namespace ssl {
-
-class SslSocket : public qpid::sys::IOHandle
-{
-public:
- /** Create a socket wrapper for descriptor. */
- SslSocket();
-
- /** Set socket non blocking */
- void setNonblocking() const;
-
- /** Set tcp-nodelay */
- void setTcpNoDelay(bool nodelay) const;
-
- void connect(const std::string& host, uint16_t port) const;
-
- void close() const;
-
- /** Bind to a port and start listening.
- *@param port 0 means choose an available port.
- *@param backlog maximum number of pending connections.
- *@param certName name of certificate to use to identify the server
- *@return The bound port.
- */
- int listen(uint16_t port = 0, int backlog = 10, const std::string& certName = "localhost.localdomain", bool clientAuth = false) const;
-
- /**
- * Accept a connection from a socket that is already listening
- * and has an incoming connection
- */
- SslSocket* accept(struct sockaddr *addr, socklen_t *addrlen) const;
-
- // TODO The following are raw operations, maybe they need better wrapping?
- int read(void *buf, size_t count) const;
- int write(const void *buf, size_t count) const;
-
- /** Returns the "socket name" ie the address bound to
- * the near end of the socket
- */
- std::string getSockname() const;
-
- /** Returns the "peer name" ie the address bound to
- * the remote end of the socket
- */
- std::string getPeername() const;
-
- /**
- * Returns an address (host and port) for the remote end of the
- * socket
- */
- std::string getPeerAddress() const;
- /**
- * Returns an address (host and port) for the local end of the
- * socket
- */
- std::string getLocalAddress() const;
-
- uint16_t getLocalPort() const;
- uint16_t getRemotePort() const;
-
- /**
- * Returns the error code stored in the socket. This may be used
- * to determine the result of a non-blocking connect.
- */
- int getError() const;
-
-private:
- mutable std::string connectname;
- mutable PRFileDesc* socket;
- /**
- * 'model' socket, with configuration to use when importing
- * accepted sockets for use as ssl sockets. Set on listen(), used
- * in accept to pass through to newly created socket instances.
- */
- mutable PRFileDesc* prototype;
-
- SslSocket(IOHandlePrivate* ioph, PRFileDesc* model);
-};
-
-}}}
-#endif /*!_sys_ssl_Socket_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/check.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/ssl/check.cpp
deleted file mode 100644
index b580e9bcf5..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/check.cpp
+++ /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.
- *
- */
-#include "check.h"
-#include <nss3/secerr.h>
-#include <nss3/sslerr.h>
-#include <boost/format.hpp>
-
-using boost::format;
-using boost::str;
-
-namespace qpid {
-namespace sys {
-namespace ssl {
-
-const std::string SSL_ERROR_BAD_CERT_DOMAIN_STR =
- "Unable to communicate securely with peer: requested domain name does not match the server's certificate.";
-const std::string SSL_ERROR_BAD_CERT_ALERT_STR = "SSL peer cannot verify your certificate.";
-const std::string SEC_ERROR_BAD_DATABASE_STR = "Security library: bad database.";
-const std::string SSL_ERROR_NO_CERTIFICATE_STR = "Unable to find the certificate or key necessary for authentication.";
-const std::string SSL_ERROR_UNKNOWN = "Unknown NSS error code.";
-
-ErrorString::ErrorString() : code(PR_GetError()), buffer(new char[PR_GetErrorTextLength()]), used(PR_GetErrorText(buffer)) {}
-
-ErrorString::~ErrorString()
-{
- delete[] buffer;
-}
-
-std::string ErrorString::getString() const
-{
- std::string msg = std::string(buffer, used);
- if (!used) {
- //seems most of the NSPR/NSS errors don't have text set for
- //them, add a few specific ones in here. (TODO: more complete
- //list?):
- switch (code) {
- case SSL_ERROR_BAD_CERT_DOMAIN: msg = SSL_ERROR_BAD_CERT_DOMAIN_STR; break;
- case SSL_ERROR_BAD_CERT_ALERT: msg = SSL_ERROR_BAD_CERT_ALERT_STR; break;
- case SEC_ERROR_BAD_DATABASE: msg = SEC_ERROR_BAD_DATABASE_STR; break;
- case SSL_ERROR_NO_CERTIFICATE: msg = SSL_ERROR_NO_CERTIFICATE_STR; break;
- default: msg = SSL_ERROR_UNKNOWN; break;
- }
- }
- return str(format("%1% [%2%]") % msg % code);
-}
-
-std::ostream& operator<<(std::ostream& out, const ErrorString& err)
-{
- out << err.getString();
- return out;
-}
-
-
-}}} // namespace qpid::sys::ssl
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/check.h b/M4-RCs/qpid/cpp/src/qpid/sys/ssl/check.h
deleted file mode 100644
index 6217a39429..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/check.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef QPID_SYS_SSL_CHECK_H
-#define QPID_SYS_SSL_CHECK_H
-
-/*
- *
- * 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 <iostream>
-#include <string>
-#include <nspr4/nspr.h>
-#include <nss3/nss.h>
-
-namespace qpid {
-namespace sys {
-namespace ssl {
-
-class ErrorString
-{
- public:
- ErrorString();
- ~ErrorString();
- std::string getString() const;
- private:
- const int code;
- char* const buffer;
- const size_t used;
-};
-
-std::ostream& operator<<(std::ostream& out, const ErrorString& err);
-
-}}} // namespace qpid::sys::ssl
-
-
-#define NSS_CHECK(value) if (value != SECSuccess) { throw Exception(QPID_MSG("Failed: " << qpid::sys::ssl::ErrorString())); }
-#define PR_CHECK(value) if (value != PR_SUCCESS) { throw Exception(QPID_MSG("Failed: " << qpid::sys::ssl::ErrorString())); }
-
-#endif /*!QPID_SYS_SSL_CHECK_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/util.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/ssl/util.cpp
deleted file mode 100644
index 97b00f19de..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/util.cpp
+++ /dev/null
@@ -1,118 +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 "util.h"
-#include "check.h"
-#include "qpid/Exception.h"
-#include "qpid/sys/SystemInfo.h"
-
-#include <unistd.h>
-#include <nspr4/nspr.h>
-#include <nss3/nss.h>
-#include <nss3/pk11pub.h>
-#include <nss3/ssl.h>
-
-#include <iostream>
-#include <fstream>
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-
-namespace qpid {
-namespace sys {
-namespace ssl {
-
-std::string defaultCertName()
-{
- TcpAddress address;
- if (SystemInfo::getLocalHostname(address)) {
- return address.host;
- } else {
- return "localhost";
- }
-}
-
-SslOptions::SslOptions() : qpid::Options("SSL Settings"),
- certName(defaultCertName()),
- exportPolicy(false)
-{
- addOptions()
- ("ssl-use-export-policy", optValue(exportPolicy), "Use NSS export policy")
- ("ssl-cert-password-file", optValue(certPasswordFile, "PATH"), "File containing password to use for accessing certificate database")
- ("ssl-cert-db", optValue(certDbPath, "PATH"), "Path to directory containing certificate database")
- ("ssl-cert-name", optValue(certName, "NAME"), "Name of the certificate to use");
-}
-
-SslOptions& SslOptions::operator=(const SslOptions& o)
-{
- certDbPath = o.certDbPath;
- certName = o.certName;
- certPasswordFile = o.certPasswordFile;
- exportPolicy = o.exportPolicy;
- return *this;
-}
-
-char* promptForPassword(PK11SlotInfo*, PRBool retry, void*)
-{
- if (retry) return 0;
- //TODO: something else?
- return PL_strdup(getpass("Please enter the password for accessing the certificate database:"));
-}
-
-SslOptions SslOptions::global;
-
-char* readPasswordFromFile(PK11SlotInfo*, PRBool retry, void*)
-{
- const std::string& passwordFile = SslOptions::global.certPasswordFile;
- if (retry || passwordFile.empty() || !boost::filesystem::exists(passwordFile)) {
- return 0;
- } else {
- std::ifstream file(passwordFile.c_str());
- std::string password;
- file >> password;
- return PL_strdup(password.c_str());
- }
-}
-
-void initNSS(const SslOptions& options, bool server)
-{
- SslOptions::global = options;
- if (options.certPasswordFile.empty()) {
- PK11_SetPasswordFunc(promptForPassword);
- } else {
- PK11_SetPasswordFunc(readPasswordFromFile);
- }
- NSS_CHECK(NSS_Init(options.certDbPath.c_str()));
- if (options.exportPolicy) {
- NSS_CHECK(NSS_SetExportPolicy());
- } else {
- NSS_CHECK(NSS_SetDomesticPolicy());
- }
- if (server) {
- //use defaults for all args, TODO: may want to make this configurable
- SSL_ConfigServerSessionIDCache(0, 0, 0, 0);
- }
-}
-
-void shutdownNSS()
-{
- NSS_Shutdown();
-}
-
-}}} // namespace qpid::sys::ssl
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/util.h b/M4-RCs/qpid/cpp/src/qpid/sys/ssl/util.h
deleted file mode 100644
index f34adab7be..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/ssl/util.h
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef QPID_SYS_SSL_UTIL_H
-#define QPID_SYS_SSL_UTIL_H
-
-/*
- *
- * 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 "qpid/Options.h"
-#include <string>
-
-namespace qpid {
-namespace sys {
-namespace ssl {
-
-struct SslOptions : qpid::Options
-{
- static SslOptions global;
-
- std::string certDbPath;
- std::string certName;
- std::string certPasswordFile;
- bool exportPolicy;
-
- SslOptions();
- SslOptions& operator=(const SslOptions&);
-};
-
-void initNSS(const SslOptions& options, bool server = false);
-void shutdownNSS();
-
-}}} // namespace qpid::sys::ssl
-
-#endif /*!QPID_SYS_SSL_UTIL_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/uuid.h b/M4-RCs/qpid/cpp/src/qpid/sys/uuid.h
deleted file mode 100644
index 804ab34463..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/uuid.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _sys_uuid_h
-#define _sys_uuid_h
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#ifdef _WIN32
-# include "qpid/sys/windows/uuid.h"
-#else
-# include <uuid/uuid.h>
-#endif /* _WIN32 */
-
-#endif /* _sys_uuid_h */
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp
deleted file mode 100644
index ca56efd8dd..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/AsynchIO.cpp
+++ /dev/null
@@ -1,741 +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 "AsynchIoResult.h"
-#include "IoHandlePrivate.h"
-#include "qpid/sys/AsynchIO.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/sys/Socket.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/sys/Time.h"
-#include "qpid/log/Statement.h"
-
-#include "check.h"
-
-#include <boost/thread/once.hpp>
-
-#include <queue>
-#include <winsock2.h>
-#include <mswsock.h>
-#include <windows.h>
-
-#include <boost/bind.hpp>
-
-namespace {
-
- typedef qpid::sys::ScopedLock<qpid::sys::Mutex> QLock;
-
-/*
- * We keep per thread state to avoid locking overhead. The assumption is that
- * on average all the connections are serviced by all the threads so the state
- * recorded in each thread is about the same. If this turns out not to be the
- * case we could rebalance the info occasionally.
- */
-QPID_TSS int threadReadTotal = 0;
-QPID_TSS int threadMaxRead = 0;
-QPID_TSS int threadReadCount = 0;
-QPID_TSS int threadWriteTotal = 0;
-QPID_TSS int threadWriteCount = 0;
-QPID_TSS int64_t threadMaxReadTimeNs = 2 * 1000000; // start at 2ms
-
-/*
- * The function pointers for AcceptEx and ConnectEx need to be looked up
- * at run time. Make sure this is done only once.
- */
-boost::once_flag lookUpAcceptExOnce = BOOST_ONCE_INIT;
-LPFN_ACCEPTEX fnAcceptEx = 0;
-typedef void (*lookUpFunc)(const qpid::sys::Socket &);
-
-void lookUpAcceptEx() {
- SOCKET h = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- GUID guidAcceptEx = WSAID_ACCEPTEX;
- DWORD dwBytes = 0;
- WSAIoctl(h,
- SIO_GET_EXTENSION_FUNCTION_POINTER,
- &guidAcceptEx,
- sizeof(guidAcceptEx),
- &fnAcceptEx,
- sizeof(fnAcceptEx),
- &dwBytes,
- NULL,
- NULL);
- closesocket(h);
- if (fnAcceptEx == 0)
- throw qpid::Exception(QPID_MSG("Failed to look up AcceptEx"));
-}
-
-}
-
-namespace qpid {
-namespace sys {
-
-/*
- * Asynch Acceptor
- *
- * This implementation uses knowledge that the DispatchHandle handle member
- * is derived from PollerHandle, which has a reference to the Socket.
- * No dispatching features of DispatchHandle are used - we just use the
- * conduit to the Socket.
- *
- * AsynchAcceptor uses an AsynchAcceptResult object to track completion
- * and status of each accept operation outstanding.
- */
-
-class AsynchAcceptorPrivate {
-
- friend class AsynchAcceptResult;
-
-public:
- AsynchAcceptorPrivate(const Socket& s, AsynchAcceptor::Callback callback);
- ~AsynchAcceptorPrivate();
- void start(Poller::shared_ptr poller);
-
-private:
- void restart(void);
-
- AsynchAcceptor::Callback acceptedCallback;
- const Socket& socket;
-};
-
-AsynchAcceptor::AsynchAcceptor(const Socket& s, Callback callback) :
- impl(new AsynchAcceptorPrivate(s, callback))
-{}
-
-AsynchAcceptor::~AsynchAcceptor()
-{ delete impl; }
-
-void AsynchAcceptor::start(Poller::shared_ptr poller) {
- impl->start(poller);
-}
-
-AsynchAcceptorPrivate::AsynchAcceptorPrivate(const Socket& s,
- AsynchAcceptor::Callback callback)
- : acceptedCallback(callback),
- socket(s) {
-
- s.setNonblocking();
-#if (BOOST_VERSION >= 103500) /* boost 1.35 or later reversed the args */
- boost::call_once(lookUpAcceptExOnce, lookUpAcceptEx);
-#else
- boost::call_once(lookUpAcceptEx, lookUpAcceptExOnce);
-#endif
-}
-
-AsynchAcceptorPrivate::~AsynchAcceptorPrivate(void) {
- socket.close();
-}
-
-void AsynchAcceptorPrivate::start(Poller::shared_ptr poller) {
- poller->addFd(PollerHandle(socket), Poller::INPUT);
- restart ();
-}
-
-void AsynchAcceptorPrivate::restart(void) {
- DWORD bytesReceived = 0; // Not used, needed for AcceptEx API
- AsynchAcceptResult *result = new AsynchAcceptResult(acceptedCallback,
- this,
- toFd(socket.impl));
- BOOL status;
- status = ::fnAcceptEx(toFd(socket.impl),
- toFd(result->newSocket->impl),
- result->addressBuffer,
- 0,
- AsynchAcceptResult::SOCKADDRMAXLEN,
- AsynchAcceptResult::SOCKADDRMAXLEN,
- &bytesReceived,
- result->overlapped());
- QPID_WINDOWS_CHECK_ASYNC_START(status);
-}
-
-
-AsynchAcceptResult::AsynchAcceptResult(AsynchAcceptor::Callback cb,
- AsynchAcceptorPrivate *acceptor,
- SOCKET listener)
- : callback(cb), acceptor(acceptor), listener(listener) {
- newSocket.reset (new Socket());
-}
-
-void AsynchAcceptResult::success(size_t /*bytesTransferred*/) {
- ::setsockopt (toFd(newSocket->impl),
- SOL_SOCKET,
- SO_UPDATE_ACCEPT_CONTEXT,
- (char*)&listener,
- sizeof (listener));
- callback(*(newSocket.release()));
- acceptor->restart ();
- delete this;
-}
-
-void AsynchAcceptResult::failure(int status) {
- //if (status != WSA_OPERATION_ABORTED)
- // Can there be anything else? ;
- delete this;
-}
-
-namespace windows {
-
-/*
- * AsynchConnector does synchronous connects for now... to do asynch the
- * IocpPoller will need some extension to register an event handle as a
- * CONNECT-type "direction", the connect completion/result will need an
- * event handle to associate with the connecting handle. But there's no
- * time for that right now...
- */
-class AsynchConnector : public qpid::sys::AsynchConnector {
-private:
- ConnectedCallback connCallback;
- FailedCallback failCallback;
- const Socket& socket;
-
-public:
- AsynchConnector(const Socket& socket,
- Poller::shared_ptr poller,
- std::string hostname,
- uint16_t port,
- ConnectedCallback connCb,
- FailedCallback failCb = 0);
-};
-
-AsynchConnector::AsynchConnector(const Socket& sock,
- Poller::shared_ptr poller,
- std::string hostname,
- uint16_t port,
- ConnectedCallback connCb,
- FailedCallback failCb)
- : connCallback(connCb), failCallback(failCb), socket(sock) {
- socket.setNonblocking();
- try {
- socket.connect(hostname, port);
- connCallback(socket);
- } catch(std::exception& e) {
- if (failCallback)
- failCallback(-1, std::string(e.what()));
- socket.close();
- delete &socket;
- }
-}
-
-} // namespace windows
-
-AsynchConnector* qpid::sys::AsynchConnector::create(const Socket& s,
- Poller::shared_ptr poller,
- std::string hostname,
- uint16_t port,
- ConnectedCallback connCb,
- FailedCallback failCb)
-{
- return new qpid::sys::windows::AsynchConnector(s,
- poller,
- hostname,
- port,
- connCb,
- failCb);
-}
-
-
-/*
- * Asynch reader/writer
- */
-
-namespace windows {
-
-class AsynchIO : public qpid::sys::AsynchIO {
-public:
- AsynchIO(const Socket& s,
- ReadCallback rCb,
- EofCallback eofCb,
- DisconnectCallback disCb,
- ClosedCallback cCb = 0,
- BuffersEmptyCallback eCb = 0,
- IdleCallback iCb = 0);
- ~AsynchIO();
-
- // Methods inherited from qpid::sys::AsynchIO
-
- /**
- * Notify the object is should delete itself as soon as possible.
- */
- virtual void queueForDeletion();
-
- /// Take any actions needed to prepare for working with the poller.
- virtual void start(Poller::shared_ptr poller);
- virtual void queueReadBuffer(BufferBase* buff);
- virtual void unread(BufferBase* buff);
- virtual void queueWrite(BufferBase* buff);
- virtual void notifyPendingWrite();
- virtual void queueWriteClose();
- virtual bool writeQueueEmpty();
- virtual void startReading();
-
- /**
- * getQueuedBuffer returns a buffer from the buffer queue, if one is
- * available.
- *
- * @retval Pointer to BufferBase buffer; 0 if none is available.
- */
- virtual BufferBase* getQueuedBuffer();
-
-private:
- ReadCallback readCallback;
- EofCallback eofCallback;
- DisconnectCallback disCallback;
- ClosedCallback closedCallback;
- BuffersEmptyCallback emptyCallback;
- IdleCallback idleCallback;
- const Socket& socket;
- Poller::shared_ptr poller;
-
- std::deque<BufferBase*> bufferQueue;
- std::deque<BufferBase*> writeQueue;
- /* The MSVC-supplied deque is not thread-safe; keep locks to serialize
- * access to the buffer queue and write queue.
- */
- Mutex bufferQueueLock;
-
- // Number of outstanding I/O operations.
- volatile LONG opsInProgress;
- // Is there a write in progress?
- volatile bool writeInProgress;
- // Deletion requested, but there are callbacks in progress.
- volatile bool queuedDelete;
- // Socket close requested, but there are operations in progress.
- volatile bool queuedClose;
-
-private:
- // Dispatch events that have completed.
- void notifyEof(void);
- void notifyDisconnect(void);
- void notifyClosed(void);
- void notifyBuffersEmpty(void);
- void notifyIdle(void);
-
- /**
- * Initiate a write of the specified buffer. There's no callback for
- * write completion to the AsynchIO object.
- */
- void startWrite(AsynchIO::BufferBase* buff);
-
- void close(void);
-
- /**
- * readComplete is called when a read request is complete.
- *
- * @param result Results of the operation.
- */
- void readComplete(AsynchReadResult *result);
-
- /**
- * writeComplete is called when a write request is complete.
- *
- * @param result Results of the operation.
- */
- void writeComplete(AsynchWriteResult *result);
-
- /**
- * Queue of completions to run. This queue enforces the requirement
- * from upper layers that only one thread at a time is allowed to act
- * on any given connection. Once a thread is busy processing a completion
- * on this object, other threads that dispatch completions queue the
- * completions here for the in-progress thread to handle when done.
- * Thus, any threads can dispatch a completion from the IocpPoller, but
- * this class ensures that actual processing at the connection level is
- * only on one thread at a time.
- */
- std::queue<AsynchIoResult *> completionQueue;
- volatile bool working;
- Mutex completionLock;
-
- /**
- * Called when there's a completion to process.
- */
- void completion(AsynchIoResult *result);
-};
-
-AsynchIO::AsynchIO(const Socket& s,
- ReadCallback rCb,
- EofCallback eofCb,
- DisconnectCallback disCb,
- ClosedCallback cCb,
- BuffersEmptyCallback eCb,
- IdleCallback iCb) :
-
- readCallback(rCb),
- eofCallback(eofCb),
- disCallback(disCb),
- closedCallback(cCb),
- emptyCallback(eCb),
- idleCallback(iCb),
- socket(s),
- opsInProgress(0),
- writeInProgress(false),
- queuedDelete(false),
- queuedClose(false),
- working(false) {
-}
-
-struct deleter
-{
- template <typename T>
- void operator()(T *ptr){ delete ptr;}
-};
-
-AsynchIO::~AsynchIO() {
- std::for_each( bufferQueue.begin(), bufferQueue.end(), deleter());
- std::for_each( writeQueue.begin(), writeQueue.end(), deleter());
-}
-
-void AsynchIO::queueForDeletion() {
- queuedDelete = true;
- if (opsInProgress > 0) {
- QPID_LOG(info, "Delete AsynchIO queued; ops in progress");
- // AsynchIOHandler calls this then deletes itself; don't do any more
- // callbacks.
- readCallback = 0;
- eofCallback = 0;
- disCallback = 0;
- closedCallback = 0;
- emptyCallback = 0;
- idleCallback = 0;
- }
- else {
- delete this;
- }
-}
-
-void AsynchIO::start(Poller::shared_ptr poller0) {
- poller = poller0;
- poller->addFd(PollerHandle(socket), Poller::INPUT);
- if (writeQueue.size() > 0) // Already have data queued for write
- notifyPendingWrite();
- startReading();
-}
-
-void AsynchIO::queueReadBuffer(AsynchIO::BufferBase* buff) {
- assert(buff);
- buff->dataStart = 0;
- buff->dataCount = 0;
- QLock l(bufferQueueLock);
- bufferQueue.push_back(buff);
-}
-
-void AsynchIO::unread(AsynchIO::BufferBase* buff) {
- assert(buff);
- if (buff->dataStart != 0) {
- memmove(buff->bytes, buff->bytes+buff->dataStart, buff->dataCount);
- buff->dataStart = 0;
- }
- QLock l(bufferQueueLock);
- bufferQueue.push_front(buff);
-}
-
-void AsynchIO::queueWrite(AsynchIO::BufferBase* buff) {
- assert(buff);
- QLock l(bufferQueueLock);
- writeQueue.push_back(buff);
- if (!writeInProgress)
- notifyPendingWrite();
-}
-
-void AsynchIO::notifyPendingWrite() {
- // This method is generally called from a processing thread; transfer
- // work on this to an I/O thread. Much of the upper layer code assumes
- // that all I/O-related things happen in an I/O thread.
- if (poller == 0) // Not really going yet...
- return;
-
- InterlockedIncrement(&opsInProgress);
- IOHandlePrivate *hp =
- new IOHandlePrivate (INVALID_SOCKET,
- boost::bind(&AsynchIO::completion, this, _1));
- IOHandle h(hp);
- PollerHandle ph(h);
- poller->addFd(ph, Poller::OUTPUT);
-}
-
-void AsynchIO::queueWriteClose() {
- queuedClose = true;
- if (!writeInProgress)
- notifyPendingWrite();
-}
-
-bool AsynchIO::writeQueueEmpty() {
- QLock l(bufferQueueLock);
- return writeQueue.size() == 0;
-}
-
-/*
- * Initiate a read operation. AsynchIO::readComplete() will be
- * called when the read is complete and data is available.
- */
-void AsynchIO::startReading() {
- if (queuedDelete)
- return;
-
- // (Try to) get a buffer; look on the front since there may be an
- // "unread" one there with data remaining from last time.
- AsynchIO::BufferBase *buff = 0;
- {
- QLock l(bufferQueueLock);
-
- if (!bufferQueue.empty()) {
- buff = bufferQueue.front();
- assert(buff);
- bufferQueue.pop_front();
- }
- }
- if (buff != 0) {
- int readCount = buff->byteCount - buff->dataCount;
- AsynchReadResult *result =
- new AsynchReadResult(boost::bind(&AsynchIO::completion, this, _1),
- buff,
- readCount);
- DWORD bytesReceived = 0, flags = 0;
- InterlockedIncrement(&opsInProgress);
- int status = WSARecv(toFd(socket.impl),
- const_cast<LPWSABUF>(result->getWSABUF()), 1,
- &bytesReceived,
- &flags,
- result->overlapped(),
- 0);
- if (status != 0) {
- int error = WSAGetLastError();
- if (error != WSA_IO_PENDING) {
- result->failure(error);
- result = 0; // result is invalid here
- return;
- }
- }
- // On status 0 or WSA_IO_PENDING, completion will handle the rest.
- }
- else {
- notifyBuffersEmpty();
- }
- return;
-}
-
-/**
- * Return a queued buffer if there are enough to spare.
- */
-AsynchIO::BufferBase* AsynchIO::getQueuedBuffer() {
- QLock l(bufferQueueLock);
- // Always keep at least one buffer (it might have data that was
- // "unread" in it).
- if (bufferQueue.size() <= 1)
- return 0;
- BufferBase* buff = bufferQueue.back();
- assert(buff);
- bufferQueue.pop_back();
- return buff;
-}
-
-void AsynchIO::notifyEof(void) {
- if (eofCallback)
- eofCallback(*this);
-}
-
-void AsynchIO::notifyDisconnect(void) {
- if (disCallback)
- disCallback(*this);
-}
-
-void AsynchIO::notifyClosed(void) {
- if (closedCallback)
- closedCallback(*this, socket);
-}
-
-void AsynchIO::notifyBuffersEmpty(void) {
- if (emptyCallback)
- emptyCallback(*this);
-}
-
-void AsynchIO::notifyIdle(void) {
- if (idleCallback)
- idleCallback(*this);
-}
-
-/*
- * Asynch reader/writer using overlapped I/O
- */
-
-void AsynchIO::startWrite(AsynchIO::BufferBase* buff) {
- writeInProgress = true;
- InterlockedIncrement(&opsInProgress);
- int writeCount = buff->byteCount-buff->dataCount;
- AsynchWriteResult *result =
- new AsynchWriteResult(boost::bind(&AsynchIO::completion, this, _1),
- buff,
- buff->dataCount);
- DWORD bytesSent = 0;
- int status = WSASend(toFd(socket.impl),
- const_cast<LPWSABUF>(result->getWSABUF()), 1,
- &bytesSent,
- 0,
- result->overlapped(),
- 0);
- if (status != 0) {
- int error = WSAGetLastError();
- if (error != WSA_IO_PENDING) {
- result->failure(error); // Also decrements in-progress count
- result = 0; // result is invalid here
- return;
- }
- }
- // On status 0 or WSA_IO_PENDING, completion will handle the rest.
- return;
-}
-
-/*
- * Close the socket and callback to say we've done it
- */
-void AsynchIO::close(void) {
- socket.close();
- notifyClosed();
-}
-
-void AsynchIO::readComplete(AsynchReadResult *result) {
- ++threadReadCount;
- int status = result->getStatus();
- size_t bytes = result->getTransferred();
- if (status == 0 && bytes > 0) {
- bool restartRead = true; // May not if receiver doesn't want more
- threadReadTotal += bytes;
- if (readCallback)
- restartRead = readCallback(*this, result->getBuff());
- if (restartRead)
- startReading();
- }
- else {
- // No data read, so put the buffer back. It may be partially filled,
- // so "unread" it back to the front of the queue.
- unread(result->getBuff());
- if (status == 0)
- notifyEof();
- else
- notifyDisconnect();
- }
-}
-
-/*
- * NOTE - this completion is called for completed writes and also when
- * a write is desired. The difference is in the buff - if a write is desired
- * the buff is 0.
- */
-void AsynchIO::writeComplete(AsynchWriteResult *result) {
- int status = result->getStatus();
- size_t bytes = result->getTransferred();
- AsynchIO::BufferBase *buff = result->getBuff();
- if (buff != 0) {
- ++threadWriteCount;
- writeInProgress = false;
- if (status == 0 && bytes > 0) {
- threadWriteTotal += bytes;
- if (bytes < result->getRequested()) // Still more to go; resubmit
- startWrite(buff);
- else
- queueReadBuffer(buff); // All done; back to the pool
- }
- else {
- // An error... if it's a connection close, ignore it - it will be
- // noticed and handled on a read completion any moment now.
- // What to do with real error??? Save the Buffer?
- }
- }
-
- // If there are no writes outstanding, the priority is to write any
- // remaining buffers first (either queued or via idle), then close the
- // socket if that's queued.
- // opsInProgress handled in completion()
- if (!writeInProgress) {
- bool writing = false;
- {
- QLock l(bufferQueueLock);
- if (writeQueue.size() > 0) {
- buff = writeQueue.front();
- assert(buff);
- writeQueue.pop_front();
- startWrite(buff);
- writing = true;
- }
- }
- if (!writing) {
- if (queuedClose)
- close();
- else
- notifyIdle();
- }
- }
- return;
-}
-
-void AsynchIO::completion(AsynchIoResult *result) {
- {
- ScopedLock<Mutex> l(completionLock);
- if (working) {
- completionQueue.push(result);
- return;
- }
-
- // First thread in with something to do; note we're working then keep
- // handling completions.
- working = true;
- while (result != 0) {
- // New scope to unlock temporarily.
- {
- ScopedUnlock<Mutex> ul(completionLock);
- AsynchReadResult *r = dynamic_cast<AsynchReadResult*>(result);
- if (r != 0)
- readComplete(r);
- else {
- AsynchWriteResult *w =
- dynamic_cast<AsynchWriteResult*>(result);
- writeComplete(w);
- }
- delete result;
- result = 0;
- InterlockedDecrement(&opsInProgress);
- }
- // Lock is held again.
- if (completionQueue.empty())
- continue;
- result = completionQueue.front();
- completionQueue.pop();
- }
- working = false;
- }
- // Lock released; ok to delete if all is done.
- if (opsInProgress == 0 && queuedDelete)
- delete this;
-}
-
-} // namespace windows
-
-AsynchIO* qpid::sys::AsynchIO::create(const Socket& s,
- AsynchIO::ReadCallback rCb,
- AsynchIO::EofCallback eofCb,
- AsynchIO::DisconnectCallback disCb,
- AsynchIO::ClosedCallback cCb,
- AsynchIO::BuffersEmptyCallback eCb,
- AsynchIO::IdleCallback iCb)
-{
- return new qpid::sys::windows::AsynchIO(s, rCb, eofCb, disCb, cCb, eCb, iCb);
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/AsynchIoResult.h b/M4-RCs/qpid/cpp/src/qpid/sys/windows/AsynchIoResult.h
deleted file mode 100755
index 7db4e9c331..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/AsynchIoResult.h
+++ /dev/null
@@ -1,185 +0,0 @@
-#ifndef _windows_asynchIoResult_h
-#define _windows_asynchIoResult_h
-
-/*
- *
- * 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 "qpid/sys/AsynchIO.h"
-#include "qpid/sys/Socket.h"
-#include <memory.h>
-#include <winsock2.h>
-#include <ws2tcpip.h>
-
-namespace qpid {
-namespace sys {
-
-/*
- * AsynchIoResult defines the class that receives the result of an
- * asynchronous I/O operation, either send/recv or accept/connect.
- *
- * Operation factories should set one of these up before beginning the
- * operation. Poller knows how to dispatch completion to this class.
- * This class must be subclassed for needed operations; this class provides
- * an interface only and cannot be instantiated.
- *
- * This class is tied to Windows; it inherits from OVERLAPPED so that the
- * IocpPoller can cast OVERLAPPED pointers back to AsynchIoResult and call
- * the completion handler.
- */
-class AsynchResult : private OVERLAPPED {
-public:
- LPOVERLAPPED overlapped(void) { return this; }
- static AsynchResult* from_overlapped(LPOVERLAPPED ol) {
- return static_cast<AsynchResult*>(ol);
- }
- virtual void success (size_t bytesTransferred) {
- bytes = bytesTransferred;
- status = 0;
- complete();
- }
- virtual void failure (int error) {
- bytes = 0;
- status = error;
- complete();
- }
- size_t getTransferred(void) const { return bytes; }
- int getStatus(void) const { return status; }
-
-protected:
- AsynchResult() : bytes(0), status(0)
- { memset(overlapped(), 0, sizeof(OVERLAPPED)); }
- ~AsynchResult() {}
- virtual void complete(void) = 0;
-
- size_t bytes;
- int status;
-};
-
-class AsynchAcceptorPrivate;
-class AsynchAcceptResult : public AsynchResult {
-
- friend class AsynchAcceptorPrivate;
-
-public:
- AsynchAcceptResult(AsynchAcceptor::Callback cb,
- AsynchAcceptorPrivate *acceptor,
- SOCKET listener);
- virtual void success (size_t bytesTransferred);
- virtual void failure (int error);
-
-private:
- virtual void complete(void) {} // No-op for this class.
-
- std::auto_ptr<qpid::sys::Socket> newSocket;
- AsynchAcceptor::Callback callback;
- AsynchAcceptorPrivate *acceptor;
- SOCKET listener;
-
- // AcceptEx needs a place to write the local and remote addresses
- // when accepting the connection. Place those here; get enough for
- // IPv6 addresses, even if the socket is IPv4.
- enum { SOCKADDRMAXLEN = sizeof sockaddr_in6 + 16,
- SOCKADDRBUFLEN = 2 * SOCKADDRMAXLEN };
- char addressBuffer[SOCKADDRBUFLEN];
-};
-
-class AsynchIoResult : public AsynchResult {
-public:
- typedef boost::function1<void, AsynchIoResult *> Completer;
-
- virtual ~AsynchIoResult() {}
- AsynchIO::BufferBase *getBuff(void) const { return iobuff; }
- size_t getRequested(void) const { return requested; }
- const WSABUF *getWSABUF(void) const { return &wsabuf; }
-
-protected:
- void setBuff (AsynchIO::BufferBase *buffer) { iobuff = buffer; }
-
-protected:
- AsynchIoResult(Completer cb,
- AsynchIO::BufferBase *buff, size_t length)
- : completionCallback(cb), iobuff(buff), requested(length) {}
-
- virtual void complete(void) = 0;
- WSABUF wsabuf;
- Completer completionCallback;
-
-private:
- AsynchIO::BufferBase *iobuff;
- size_t requested; // Number of bytes in original I/O request
-};
-
-class AsynchReadResult : public AsynchIoResult {
-
- // complete() updates buffer then does completion callback.
- virtual void complete(void) {
- getBuff()->dataCount += bytes;
- completionCallback(this);
- }
-
-public:
- AsynchReadResult(AsynchIoResult::Completer cb,
- AsynchIO::BufferBase *buff,
- size_t length)
- : AsynchIoResult(cb, buff, length) {
- wsabuf.buf = buff->bytes + buff->dataCount;
- wsabuf.len = length;
- }
-};
-
-class AsynchWriteResult : public AsynchIoResult {
-
- // complete() updates buffer then does completion callback.
- virtual void complete(void) {
- AsynchIO::BufferBase *b = getBuff();
- b->dataStart += bytes;
- b->dataCount -= bytes;
- completionCallback(this);
- }
-
-public:
- AsynchWriteResult(AsynchIoResult::Completer cb,
- AsynchIO::BufferBase *buff,
- size_t length)
- : AsynchIoResult(cb, buff, length) {
- wsabuf.buf = buff ? buff->bytes : 0;
- wsabuf.len = length;
- }
-};
-
-class AsynchWriteWanted : public AsynchWriteResult {
-
- // complete() just does completion callback; no buffers used.
- virtual void complete(void) {
- completionCallback(this);
- }
-
-public:
- AsynchWriteWanted(AsynchIoResult::Completer cb)
- : AsynchWriteResult(cb, 0, 0) {
- wsabuf.buf = 0;
- wsabuf.len = 0;
- }
-};
-
-}}
-
-#endif /*!_windows_asynchIoResult_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Condition.h b/M4-RCs/qpid/cpp/src/qpid/sys/windows/Condition.h
deleted file mode 100755
index 979fae9b0a..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Condition.h
+++ /dev/null
@@ -1,80 +0,0 @@
-#ifndef _sys_windows_Condition_h
-#define _sys_windows_Condition_h
-
-/*
- *
- * 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 "qpid/sys/Mutex.h"
-#include "qpid/sys/Time.h"
-
-#include <time.h>
-#include <boost/noncopyable.hpp>
-#include <boost/thread/condition.hpp>
-#include <boost/thread/thread_time.hpp>
-#include <windows.h>
-
-namespace qpid {
-namespace sys {
-
-// Private Time related implementation details
-void toPtime(boost::posix_time::ptime& pt, const AbsTime& t);
-
-/**
- * A condition variable for thread synchronization.
- */
-class Condition : private boost::noncopyable
-{
- public:
- inline Condition();
- inline ~Condition();
- inline void wait(Mutex&);
- inline bool wait(Mutex&, const AbsTime& absoluteTime);
- inline void notify();
- inline void notifyAll();
-
- private:
- boost::condition_variable_any condition;
-};
-
-Condition::Condition() {
-}
-
-Condition::~Condition() {
-}
-
-void Condition::wait(Mutex& mutex) {
- condition.wait(mutex.mutex);
-}
-
-bool Condition::wait(Mutex& mutex, const AbsTime& absoluteTime){
- return condition.timed_wait(mutex.mutex, absoluteTime.getPrivate());
-}
-
-void Condition::notify(){
- condition.notify_one();
-}
-
-void Condition::notifyAll(){
- condition.notify_all();
-}
-
-}}
-#endif /*!_sys_windows_Condition_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/FileSysDir.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/FileSysDir.cpp
deleted file mode 100644
index 88f1637d48..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/FileSysDir.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/sys/FileSysDir.h"
-#include "qpid/sys/StrError.h"
-#include "qpid/Exception.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <direct.h>
-#include <errno.h>
-
-namespace qpid {
-namespace sys {
-
-bool FileSysDir::exists (void) const
-{
- const char *cpath = dirPath.c_str ();
- struct _stat s;
- if (::_stat(cpath, &s)) {
- if (errno == ENOENT) {
- return false;
- }
- throw qpid::Exception (strError(errno) +
- ": Can't check directory: " + dirPath);
- }
- if (s.st_mode & _S_IFDIR)
- return true;
- throw qpid::Exception(dirPath + " is not a directory");
-}
-
-void FileSysDir::mkdir(void)
-{
- if (::_mkdir(dirPath.c_str()) == -1)
- throw Exception ("Can't create directory: " + dirPath);
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/IOHandle.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/IOHandle.cpp
deleted file mode 100755
index ba544c8c90..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/IOHandle.cpp
+++ /dev/null
@@ -1,42 +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 "qpid/sys/IOHandle.h"
-#include "IoHandlePrivate.h"
-#include <windows.h>
-
-namespace qpid {
-namespace sys {
-
-SOCKET toFd(const IOHandlePrivate* h)
-{
- return h->fd;
-}
-
-IOHandle::IOHandle(IOHandlePrivate* h) :
- impl(h)
-{}
-
-IOHandle::~IOHandle() {
- delete impl;
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/IntegerTypes.h b/M4-RCs/qpid/cpp/src/qpid/sys/windows/IntegerTypes.h
deleted file mode 100755
index 80168fab88..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/IntegerTypes.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef QPID_SYS_WINDOWS_INTEGERTYPES_H
-#define QPID_SYS_WINDOWS_INTEGERTYPES_H
-
-/*
- * 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.
- *
- */
-
-typedef unsigned char uint8_t;
-typedef char int8_t;
-typedef unsigned short uint16_t;
-typedef short int16_t;
-typedef unsigned int uint32_t;
-typedef int int32_t;
-typedef unsigned __int64 uint64_t;
-typedef __int64 int64_t;
-
-// Visual Studio doesn't define other common types, so set them up here too.
-typedef int pid_t;
-typedef int socklen_t;
-typedef unsigned int size_t;
-typedef int ssize_t;
-typedef unsigned int uint;
-
-#endif /*!QPID_SYS_WINDOWS_INTEGERTYPES_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/IoHandlePrivate.h b/M4-RCs/qpid/cpp/src/qpid/sys/windows/IoHandlePrivate.h
deleted file mode 100755
index 18e75047ed..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/IoHandlePrivate.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef _sys_windows_IoHandlePrivate_h
-#define _sys_windows_IoHandlePrivate_h
-
-/*
- *
- * 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 "AsynchIoResult.h"
-
-#include <winsock2.h>
-
-namespace qpid {
-namespace sys {
-
-// Private fd related implementation details
-// There should be either a valid socket handle or a completer callback.
-// Handle is used to associate with poller's iocp; completer is used to
-// inject a completion that will very quickly trigger a callback to the
-// completer from an I/O thread.
-class IOHandlePrivate {
-public:
- IOHandlePrivate(SOCKET f = INVALID_SOCKET,
- AsynchIoResult::Completer cb = 0) :
- fd(f), event(cb)
- {}
-
- SOCKET fd;
- AsynchIoResult::Completer event;
-};
-
-SOCKET toFd(const IOHandlePrivate* h);
-
-}}
-
-#endif /* _sys_windows_IoHandlePrivate_h */
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/IocpDispatcher.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/IocpDispatcher.cpp
deleted file mode 100755
index 1a0f6ce927..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/IocpDispatcher.cpp
+++ /dev/null
@@ -1,54 +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 "qpid/sys/Dispatcher.h"
-
-#include <assert.h>
-
-namespace qpid {
-namespace sys {
-
-Dispatcher::Dispatcher(Poller::shared_ptr poller0) :
- poller(poller0) {
-}
-
-Dispatcher::~Dispatcher() {
-}
-
-void Dispatcher::run() {
- do {
- Poller::Event event = poller->wait();
-
- // Handle shutdown
- switch (event.type) {
- case Poller::SHUTDOWN:
- return;
- break;
- case Poller::INVALID: // On any type of success or fail completion
- break;
- default:
- // This should be impossible
- assert(false);
- }
- } while (true);
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp
deleted file mode 100755
index 44298ac8ea..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/IocpPoller.cpp
+++ /dev/null
@@ -1,176 +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 "qpid/sys/Poller.h"
-#include "qpid/sys/Mutex.h"
-
-#include "AsynchIoResult.h"
-#include "IoHandlePrivate.h"
-#include "check.h"
-
-#include <winsock2.h>
-#include <windows.h>
-
-#include <assert.h>
-#include <vector>
-#include <exception>
-
-namespace qpid {
-namespace sys {
-
-class PollerHandlePrivate {
- friend class Poller;
- friend class PollerHandle;
-
- SOCKET fd;
- AsynchIoResult::Completer cb;
-
- PollerHandlePrivate(SOCKET f, AsynchIoResult::Completer cb0 = 0) :
- fd(f), cb(cb0)
- {
- }
-
-};
-
-PollerHandle::PollerHandle(const IOHandle& h) :
- impl(new PollerHandlePrivate(toFd(h.impl), h.impl->event))
-{}
-
-PollerHandle::~PollerHandle() {
- delete impl;
-}
-
-/**
- * Concrete implementation of Poller to use the Windows I/O Completion
- * port (IOCP) facility.
- */
-class PollerPrivate {
- friend class Poller;
-
- const HANDLE iocp;
-
- // The number of threads running the event loop.
- volatile LONG threadsRunning;
-
- // Shutdown request is handled by setting isShutdown and injecting a
- // well-formed completion event into the iocp.
- bool isShutdown;
-
- PollerPrivate() :
- iocp(::CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0)),
- threadsRunning(0),
- isShutdown(false) {
- QPID_WINDOWS_CHECK_NULL(iocp);
- }
-
- ~PollerPrivate() {
- // It's probably okay to ignore any errors here as there can't be
- // data loss
- ::CloseHandle(iocp);
- }
-};
-
-void Poller::addFd(PollerHandle& handle, Direction dir) {
- HANDLE h = (HANDLE)(handle.impl->fd);
- if (h != INVALID_HANDLE_VALUE) {
- HANDLE iocpHandle = ::CreateIoCompletionPort (h, impl->iocp, 0, 0);
- QPID_WINDOWS_CHECK_NULL(iocpHandle);
- }
- else {
- AsynchWriteWanted *result = new AsynchWriteWanted(handle.impl->cb);
- PostQueuedCompletionStatus(impl->iocp, 0, 0, result->overlapped());
- }
-}
-
-void Poller::shutdown() {
- // Allow sloppy code to shut us down more than once.
- if (impl->isShutdown)
- return;
- ULONG_PTR key = 1; // Tell wait() it's a shutdown, not I/O
- PostQueuedCompletionStatus(impl->iocp, 0, key, 0);
-}
-
-// All no-ops...
-void Poller::delFd(PollerHandle& handle) {}
-void Poller::modFd(PollerHandle& handle, Direction dir) {}
-void Poller::rearmFd(PollerHandle& handle) {}
-
-Poller::Event Poller::wait(Duration timeout) {
- DWORD timeoutMs = 0;
- DWORD numTransferred = 0;
- ULONG_PTR completionKey = 0;
- OVERLAPPED *overlapped = 0;
- AsynchResult *result = 0;
-
- // Wait for either an I/O operation to finish (thus signaling the
- // IOCP handle) or a shutdown request to be made (thus signaling the
- // shutdown event).
- if (timeout == TIME_INFINITE)
- timeoutMs = INFINITE;
- else
- timeoutMs = static_cast<DWORD>(timeout / TIME_MSEC);
-
- InterlockedIncrement(&impl->threadsRunning);
- bool goodOp = ::GetQueuedCompletionStatus (impl->iocp,
- &numTransferred,
- &completionKey,
- &overlapped,
- timeoutMs);
- LONG remainingThreads = InterlockedDecrement(&impl->threadsRunning);
- if (goodOp) {
- // Dequeued a successful completion. If it's a posted packet from
- // shutdown() the overlapped ptr is 0 and key is 1. Else downcast
- // the OVERLAPPED pointer to an AsynchIoResult and call the
- // completion handler.
- if (overlapped == 0 && completionKey == 1) {
- // If there are other threads still running this wait, re-post
- // the completion.
- if (remainingThreads > 0)
- PostQueuedCompletionStatus(impl->iocp, 0, completionKey, 0);
- return Event(0, SHUTDOWN);
- }
-
- result = AsynchResult::from_overlapped(overlapped);
- result->success (static_cast<size_t>(numTransferred));
- }
- else {
- if (overlapped != 0) {
- // Dequeued a completion for a failed operation. Downcast back
- // to the result object and inform it that the operation failed.
- DWORD status = ::GetLastError();
- result = AsynchResult::from_overlapped(overlapped);
- result->failure (static_cast<int>(status));
- }
- }
- return Event(0, INVALID); // TODO - this may need to be changed.
-
-}
-
-// Concrete constructors
-Poller::Poller() :
- impl(new PollerPrivate())
-{}
-
-Poller::~Poller() {
- delete impl;
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/LockFile.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/LockFile.cpp
deleted file mode 100755
index 9804020167..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/LockFile.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * Copyright (c) 2008 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/sys/LockFile.h"
-#include "check.h"
-
-#include <windows.h>
-
-namespace qpid {
-namespace sys {
-
-class LockFilePrivate {
- friend class LockFile;
-
- HANDLE fd;
-
-public:
- LockFilePrivate(HANDLE f) : fd(f) {}
-};
-
-LockFile::LockFile(const std::string& path_, bool create)
- : path(path_), created(create) {
-
- HANDLE h = CreateFile(path.c_str(),
- GENERIC_READ|GENERIC_WRITE,
- 0, /* Disable opens by any other attempter */
- 0, /* Default security */
- OPEN_ALWAYS, /* Create if needed */
- FILE_FLAG_DELETE_ON_CLOSE, /* Delete file when closed */
- NULL);
- QPID_WINDOWS_CHECK_NOT(h, INVALID_HANDLE_VALUE);
- impl.reset(new LockFilePrivate(h));
-}
-
-LockFile::~LockFile() {
- if (impl) {
- if (impl->fd != INVALID_HANDLE_VALUE) {
- CloseHandle(impl->fd);
- }
- }
-}
-
-pid_t LockFile::readPid(void) const {
- if (!impl)
- throw Exception("Lock file not open");
-
- pid_t pid;
- DWORD desired_read = sizeof(pid_t);
- DWORD actual_read = 0;
- if (!ReadFile(impl->fd, &pid, desired_read, &actual_read, 0)) {
- throw Exception("Cannot read lock file " + path);
- }
- return pid;
-}
-
-void LockFile::writePid(void) {
- if (!impl)
- throw Exception("Lock file not open");
-
- pid_t pid = GetCurrentProcessId();
- DWORD desired_write = sizeof(pid_t);
- DWORD written = 0;
- if (!WriteFile(impl->fd, &pid, desired_write, &written, 0)) {
- throw Exception("Cannot write lock file " + path);
- }
-}
-
-}} /* namespace qpid::sys */
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Mutex.h b/M4-RCs/qpid/cpp/src/qpid/sys/windows/Mutex.h
deleted file mode 100755
index 08de0712b9..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Mutex.h
+++ /dev/null
@@ -1,188 +0,0 @@
-#ifndef _sys_windows_Mutex_h
-#define _sys_windows_Mutex_h
-
-/*
- *
- * Copyright (c) 2008 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "check.h"
-
-#include <boost/version.hpp>
-#if (BOOST_VERSION < 103500)
-#error The Windows port requires Boost version 1.35.0 or later
-#endif
-
-#include <boost/noncopyable.hpp>
-#include <boost/thread/recursive_mutex.hpp>
-#include <boost/thread/shared_mutex.hpp>
-#include <boost/thread/thread_time.hpp>
-#include <boost/thread/tss.hpp>
-
-namespace qpid {
-namespace sys {
-
-class Condition;
-
-/**
- * Mutex lock.
- */
-class Mutex : private boost::noncopyable {
- friend class Condition;
-
-public:
- typedef ::qpid::sys::ScopedLock<Mutex> ScopedLock;
- typedef ::qpid::sys::ScopedUnlock<Mutex> ScopedUnlock;
-
- inline Mutex();
- inline ~Mutex();
- inline void lock();
- inline void unlock();
- inline bool trylock();
-
-
-protected:
- boost::recursive_mutex mutex;
-};
-
-/**
- * RW lock.
- */
-class RWlock : private boost::noncopyable {
- friend class Condition;
-
-public:
- typedef ::qpid::sys::ScopedRlock<RWlock> ScopedRlock;
- typedef ::qpid::sys::ScopedWlock<RWlock> ScopedWlock;
-
- inline RWlock();
- inline ~RWlock();
- inline void wlock(); // will write-lock
- inline void rlock(); // will read-lock
- inline void unlock();
- inline void trywlock(); // will write-try
- inline void tryrlock(); // will read-try
-
-protected:
- boost::shared_mutex rwMutex;
- boost::thread_specific_ptr<bool> haveWrite;
-
- inline bool &write (void);
-};
-
-
-/**
- * PODMutex is a POD, can be static-initialized with
- * PODMutex m = QPID_PODMUTEX_INITIALIZER
- */
-struct PODMutex
-{
- typedef ::qpid::sys::ScopedLock<PODMutex> ScopedLock;
-
- inline void lock();
- inline void unlock();
- inline bool trylock();
-
- // Must be public to be a POD:
- boost::recursive_mutex mutex;
-};
-
-#define QPID_MUTEX_INITIALIZER 0
-
-void PODMutex::lock() {
- mutex.lock();
-}
-
-void PODMutex::unlock() {
- mutex.unlock();
-}
-
-bool PODMutex::trylock() {
- return mutex.try_lock();
-}
-
-Mutex::Mutex() {
-}
-
-Mutex::~Mutex(){
-}
-
-void Mutex::lock() {
- mutex.lock();
-}
-
-void Mutex::unlock() {
- mutex.unlock();
-}
-
-bool Mutex::trylock() {
- return mutex.try_lock();
-}
-
-
-RWlock::RWlock() {
-}
-
-RWlock::~RWlock(){
-}
-
-void RWlock::wlock() {
- bool &writer = write();
- rwMutex.lock();
- writer = true; // Remember this thread has write lock held.
-}
-
-void RWlock::rlock() {
- bool &writer = write();
- rwMutex.lock_shared();
- writer = false; // Remember this thread has shared lock held.
-}
-
-void RWlock::unlock() {
- bool &writer = write();
- if (writer)
- rwMutex.unlock();
- else
- rwMutex.unlock_shared();
-}
-
-void RWlock::trywlock() {
- bool &writer = write();
- // shared_mutex::try_lock() seems to not be available... emulate it with
- // a timed lock().
- boost::system_time now = boost::get_system_time();
- if (rwMutex.timed_lock(now))
- writer = true;
-}
-
-void RWlock::tryrlock() {
- bool &writer = write();
- if (rwMutex.try_lock_shared())
- writer = false;
-}
-
-bool & RWlock::write (void) {
- // Accessing thread-specific and stack-local info, so no locks needed.
- bool *writePtr = haveWrite.get();
- if (writePtr == 0) {
- writePtr = new bool(false);
- haveWrite.reset(writePtr);
- }
- return *writePtr;
-}
-
-}}
-#endif /*!_sys_windows_Mutex_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Shlib.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/Shlib.cpp
deleted file mode 100644
index 38027de93f..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Shlib.cpp
+++ /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.
- *
- */
-
-#include "qpid/sys/Shlib.h"
-#include "qpid/Exception.h"
-#include "qpid/sys/windows/check.h"
-#include <windows.h>
-
-namespace qpid {
-namespace sys {
-
-void Shlib::load(const char* name) {
- HMODULE h = LoadLibrary(name);
- if (h == NULL) {
- throw QPID_WINDOWS_ERROR(GetLastError());
- }
- handle = static_cast<void*>(h);
-}
-
-void Shlib::unload() {
- if (handle) {
- if (FreeLibrary(static_cast<HMODULE>(handle)) == 0) {
- throw QPID_WINDOWS_ERROR(GetLastError());
- }
- handle = 0;
- }
-}
-
-void* Shlib::getSymbol(const char* name) {
- void* sym = GetProcAddress(static_cast<HMODULE>(handle), name);
- if (sym == NULL)
- throw QPID_WINDOWS_ERROR(GetLastError());
- return sym;
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Socket.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/Socket.cpp
deleted file mode 100755
index a9959bf43e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Socket.cpp
+++ /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.
- *
- */
-
-#include "qpid/sys/Socket.h"
-#include "IoHandlePrivate.h"
-#include "check.h"
-#include "qpid/sys/Time.h"
-
-#include <cstdlib>
-#include <string.h>
-#include <iostream>
-#include <memory.h>
-
-#include <winsock2.h>
-#include <ws2tcpip.h>
-
-#include <boost/format.hpp>
-
-// Need to initialize WinSock. Ideally, this would be a singleton or embedded
-// in some one-time initialization function. I tried boost singleton and could
-// not get it to compile (and others located in google had the same problem).
-// So, this simple static with an interlocked increment will do for known
-// use cases at this time. Since this will only shut down winsock at process
-// termination, there may be some problems with client programs that also
-// expect to load and unload winsock, but we'll see...
-// If someone does get an easy-to-use singleton sometime, converting to it
-// may be preferable.
-
-namespace {
-
-static LONG volatile initialized = 0;
-
-class WinSockSetup {
- // : public boost::details::pool::singleton_default<WinSockSetup> {
-
-public:
- WinSockSetup() {
- LONG timesEntered = InterlockedIncrement(&initialized);
- if (timesEntered > 1)
- return;
- err = 0;
- WORD wVersionRequested;
- WSADATA wsaData;
-
- /* Request WinSock 2.2 */
- wVersionRequested = MAKEWORD(2, 2);
- err = WSAStartup(wVersionRequested, &wsaData);
- }
-
- ~WinSockSetup() {
- WSACleanup();
- }
-
-public:
- int error(void) const { return err; }
-
-protected:
- DWORD err;
-};
-
-static WinSockSetup setup;
-
-} /* namespace */
-
-namespace qpid {
-namespace sys {
-
-namespace {
-
-std::string getName(SOCKET fd, bool local, bool includeService = false)
-{
- sockaddr_in name; // big enough for any socket address
- socklen_t namelen = sizeof(name);
- if (local) {
- QPID_WINSOCK_CHECK(::getsockname(fd, (sockaddr*)&name, &namelen));
- } else {
- QPID_WINSOCK_CHECK(::getpeername(fd, (sockaddr*)&name, &namelen));
- }
-
- char servName[NI_MAXSERV];
- char dispName[NI_MAXHOST];
- if (includeService) {
- if (int rc = ::getnameinfo((sockaddr*)&name, namelen,
- dispName, sizeof(dispName),
- servName, sizeof(servName),
- NI_NUMERICHOST | NI_NUMERICSERV) != 0)
- throw qpid::Exception(QPID_MSG(gai_strerror(rc)));
- return std::string(dispName) + ":" + std::string(servName);
- } else {
- if (int rc = ::getnameinfo((sockaddr*)&name, namelen,
- dispName, sizeof(dispName),
- 0, 0,
- NI_NUMERICHOST) != 0)
- throw qpid::Exception(QPID_MSG(gai_strerror(rc)));
- return dispName;
- }
-}
-
-std::string getService(SOCKET fd, bool local)
-{
- sockaddr_in name; // big enough for any socket address
- socklen_t namelen = sizeof(name);
-
- if (local) {
- QPID_WINSOCK_CHECK(::getsockname(fd, (sockaddr*)&name, &namelen));
- } else {
- QPID_WINSOCK_CHECK(::getpeername(fd, (sockaddr*)&name, &namelen));
- }
-
- char servName[NI_MAXSERV];
- if (int rc = ::getnameinfo((sockaddr*)&name, namelen,
- 0, 0,
- servName, sizeof(servName),
- NI_NUMERICHOST | NI_NUMERICSERV) != 0)
- throw qpid::Exception(QPID_MSG(gai_strerror(rc)));
- return servName;
-}
-} // namespace
-
-Socket::Socket() :
- IOHandle(new IOHandlePrivate)
-{
- createTcp();
-}
-
-Socket::Socket(IOHandlePrivate* h) :
- IOHandle(h)
-{}
-
-void Socket::createTcp() const
-{
- SOCKET& socket = impl->fd;
- if (socket != INVALID_SOCKET) Socket::close();
- SOCKET s = ::socket (PF_INET, SOCK_STREAM, 0);
- if (s == INVALID_SOCKET) throw QPID_WINDOWS_ERROR(WSAGetLastError());
- socket = s;
-}
-
-void Socket::setTimeout(const Duration& interval) const
-{
- const SOCKET& socket = impl->fd;
- int64_t nanosecs = interval;
- nanosecs /= (1000 * 1000); // nsecs -> usec -> msec
- int msec = 0;
- if (nanosecs > std::numeric_limits<int>::max())
- msec = std::numeric_limits<int>::max();
- else
- msec = static_cast<int>(nanosecs);
- setsockopt(socket, SOL_SOCKET, SO_SNDTIMEO, (char *)&msec, sizeof(msec));
- setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&msec, sizeof(msec));
-}
-
-void Socket::setNonblocking() const {
- u_long nonblock = 1;
- QPID_WINSOCK_CHECK(ioctlsocket(impl->fd, FIONBIO, &nonblock));
-}
-
-void Socket::connect(const std::string& host, uint16_t port) const
-{
- std::stringstream portstream;
- portstream << port << std::ends;
- std::string portstr = portstream.str();
- std::stringstream namestream;
- namestream << host << ":" << port;
- connectname = namestream.str();
-
- const SOCKET& socket = impl->fd;
- // TODO: Be good to make this work for IPv6 as well as IPv4. Would require
- // other changes, such as waiting to create the socket until after we
- // have the address family. Maybe unbundle the translation of names here;
- // use TcpAddress to resolve things and make this class take a TcpAddress
- // and grab its address family to create the socket.
- struct addrinfo hints;
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = AF_INET; // We always creating AF_INET-only sockets.
- hints.ai_socktype = SOCK_STREAM; // We always do TCP
- addrinfo *addrs;
- int status = getaddrinfo(host.c_str(), portstr.c_str(), &hints, &addrs);
- if (status != 0)
- throw Exception(QPID_MSG("Cannot resolve " << host << ": " <<
- gai_strerror(status)));
- addrinfo *addr = addrs;
- int error = 0;
- WSASetLastError(0);
- while (addr != 0) {
- if ((::connect(socket, addr->ai_addr, addr->ai_addrlen) == 0) ||
- (WSAGetLastError() == WSAEWOULDBLOCK))
- break;
- // Error... save this error code and see if there are other address
- // to try before throwing the exception.
- error = WSAGetLastError();
- addr = addr->ai_next;
- }
- freeaddrinfo(addrs);
- if (error)
- throw qpid::Exception(QPID_MSG(strError(error) << ": " << connectname));
-}
-
-void
-Socket::close() const
-{
- SOCKET& socket = impl->fd;
- if (socket == INVALID_SOCKET) return;
- QPID_WINSOCK_CHECK(closesocket(socket));
- socket = INVALID_SOCKET;
-}
-
-
-int Socket::write(const void *buf, size_t count) const
-{
- const SOCKET& socket = impl->fd;
- int sent = ::send(socket, (const char *)buf, count, 0);
- if (sent == SOCKET_ERROR)
- return -1;
- return sent;
-}
-
-int Socket::read(void *buf, size_t count) const
-{
- const SOCKET& socket = impl->fd;
- int received = ::recv(socket, (char *)buf, count, 0);
- if (received == SOCKET_ERROR)
- return -1;
- return received;
-}
-
-int Socket::listen(uint16_t port, int backlog) const
-{
- const SOCKET& socket = impl->fd;
- BOOL yes=1;
- QPID_WINSOCK_CHECK(setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, (char *)&yes, sizeof(yes)));
- struct sockaddr_in name;
- memset(&name, 0, sizeof(name));
- name.sin_family = AF_INET;
- name.sin_port = htons(port);
- name.sin_addr.s_addr = 0;
- if (::bind(socket, (struct sockaddr*)&name, sizeof(name)) == SOCKET_ERROR)
- throw Exception(QPID_MSG("Can't bind to port " << port << ": " << strError(WSAGetLastError())));
- if (::listen(socket, backlog) == SOCKET_ERROR)
- throw Exception(QPID_MSG("Can't listen on port " << port << ": " << strError(WSAGetLastError())));
-
- socklen_t namelen = sizeof(name);
- QPID_WINSOCK_CHECK(::getsockname(socket, (struct sockaddr*)&name, &namelen));
- return ntohs(name.sin_port);
-}
-
-Socket* Socket::accept(struct sockaddr *addr, socklen_t *addrlen) const
-{
- SOCKET afd = ::accept(impl->fd, addr, addrlen);
- if (afd != INVALID_SOCKET)
- return new Socket(new IOHandlePrivate(afd));
- else if (WSAGetLastError() == EAGAIN)
- return 0;
- else throw QPID_WINDOWS_ERROR(WSAGetLastError());
-}
-
-std::string Socket::getSockname() const
-{
- return getName(impl->fd, true);
-}
-
-std::string Socket::getPeername() const
-{
- return getName(impl->fd, false);
-}
-
-std::string Socket::getPeerAddress() const
-{
- if (!connectname.empty())
- return std::string (connectname);
- return getName(impl->fd, false, true);
-}
-
-std::string Socket::getLocalAddress() const
-{
- return getName(impl->fd, true, true);
-}
-
-uint16_t Socket::getLocalPort() const
-{
- return atoi(getService(impl->fd, true).c_str());
-}
-
-uint16_t Socket::getRemotePort() const
-{
- return atoi(getService(impl->fd, true).c_str());
-}
-
-int Socket::getError() const
-{
- int result;
- socklen_t rSize = sizeof (result);
-
- QPID_WINSOCK_CHECK(::getsockopt(impl->fd, SOL_SOCKET, SO_ERROR, (char *)&result, &rSize));
- return result;
-}
-
-void Socket::setTcpNoDelay(bool nodelay) const
-{
- if (nodelay) {
- int flag = 1;
- int result = setsockopt(impl->fd,
- IPPROTO_TCP,
- TCP_NODELAY,
- (char *)&flag,
- sizeof(flag));
- QPID_WINSOCK_CHECK(result);
- }
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/StrError.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/StrError.cpp
deleted file mode 100755
index 9c1bfcd79c..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/StrError.cpp
+++ /dev/null
@@ -1,47 +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 "qpid/sys/StrError.h"
-#include <string>
-#include <string.h>
-#include <windows.h>
-
-namespace qpid {
-namespace sys {
-
-std::string strError(int err) {
- const size_t bufsize = 512;
- char buf[bufsize];
- if (0 == FormatMessage (FORMAT_MESSAGE_MAX_WIDTH_MASK
- | FORMAT_MESSAGE_FROM_SYSTEM,
- 0,
- err,
- 0, // Default language
- buf,
- bufsize,
- 0))
- {
- strerror_s (buf, bufsize, err);
- }
- return std::string(buf);
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/SystemInfo.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/SystemInfo.cpp
deleted file mode 100755
index b887cac58b..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/SystemInfo.cpp
+++ /dev/null
@@ -1,160 +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.
- *
- */
-
-/* GetNativeSystemInfo call requires _WIN32_WINNT 0x0501 or higher */
-#ifndef _WIN32_WINNT
-# define _WIN32_WINNT 0x0501
-#endif
-
-#include "qpid/sys/IntegerTypes.h"
-#include "qpid/sys/SystemInfo.h"
-
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <windows.h>
-
-#ifndef HOST_NAME_MAX
-# define HOST_NAME_MAX 256
-#endif
-
-namespace qpid {
-namespace sys {
-
-long SystemInfo::concurrency() {
- SYSTEM_INFO sys_info;
- ::GetSystemInfo (&sys_info);
- long activeProcessors = 0;
- DWORD_PTR mask = sys_info.dwActiveProcessorMask;
- while (mask != 0) {
- if (mask & 1)
- ++activeProcessors;
- mask >>= 1;
- }
- return activeProcessors;
-}
-
-bool SystemInfo::getLocalHostname (TcpAddress &address) {
- char name[HOST_NAME_MAX];
- if (::gethostname(name, sizeof(name)) != 0) {
- errno = WSAGetLastError();
- return false;
- }
- address.host = name;
- return true;
-}
-
-void SystemInfo::getLocalIpAddresses (uint16_t port,
- std::vector<Address> &addrList) {
- enum { MAX_URL_INTERFACES = 100 };
- static const std::string LOCALHOST("127.0.0.1");
-
- SOCKET s = socket (PF_INET, SOCK_STREAM, 0);
- if (s != INVALID_SOCKET) {
- INTERFACE_INFO interfaces[MAX_URL_INTERFACES];
- DWORD filledBytes = 0;
- WSAIoctl (s,
- SIO_GET_INTERFACE_LIST,
- 0,
- 0,
- interfaces,
- sizeof (interfaces),
- &filledBytes,
- 0,
- 0);
- unsigned int interfaceCount = filledBytes / sizeof (INTERFACE_INFO);
- for (unsigned int i = 0; i < interfaceCount; ++i) {
- if (interfaces[i].iiFlags & IFF_UP) {
- std::string addr(inet_ntoa(interfaces[i].iiAddress.AddressIn.sin_addr));
- if (addr != LOCALHOST)
- addrList.push_back(TcpAddress(addr, port));
- }
- }
- closesocket (s);
- }
-}
-
-void SystemInfo::getSystemId (std::string &osName,
- std::string &nodeName,
- std::string &release,
- std::string &version,
- std::string &machine)
-{
- osName = "Microsoft Windows";
-
- char node[MAX_COMPUTERNAME_LENGTH + 1];
- DWORD nodelen = MAX_COMPUTERNAME_LENGTH + 1;
- GetComputerName (node, &nodelen);
- nodeName = node;
-
- OSVERSIONINFOEX vinfo;
- vinfo.dwOSVersionInfoSize = sizeof(vinfo);
- GetVersionEx ((OSVERSIONINFO *)&vinfo);
-
- SYSTEM_INFO sinfo;
- GetNativeSystemInfo(&sinfo);
-
- switch(vinfo.dwMajorVersion) {
- case 5:
- switch(vinfo.dwMinorVersion) {
- case 0:
- release ="2000";
- break;
- case 1:
- release = "XP";
- break;
- case 2:
- if (sinfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ||
- sinfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64)
- release = "XP-64";
- else
- release = "Server 2003";
- break;
- default:
- release = "Windows";
- }
- break;
- case 6:
- if (vinfo.wProductType == VER_NT_SERVER)
- release = "Server 2008";
- else
- release = "Vista";
- break;
- default:
- release = "Microsoft Windows";
- }
- version = vinfo.szCSDVersion;
-
- switch(sinfo.wProcessorArchitecture) {
- case PROCESSOR_ARCHITECTURE_AMD64:
- machine = "x86-64";
- break;
- case PROCESSOR_ARCHITECTURE_IA64:
- machine = "IA64";
- break;
- case PROCESSOR_ARCHITECTURE_INTEL:
- machine = "x86";
- break;
- default:
- machine = "unknown";
- break;
- }
-}
-
-}} // namespace qpid::sys
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Thread.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/Thread.cpp
deleted file mode 100755
index 6d5d78393e..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Thread.cpp
+++ /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.
- *
- */
-
-#include "qpid/sys/Thread.h"
-#include "qpid/sys/Runnable.h"
-#include "check.h"
-
-#include <process.h>
-#include <windows.h>
-
-namespace {
-unsigned __stdcall runRunnable(void* p)
-{
- static_cast<qpid::sys::Runnable*>(p)->run();
- _endthreadex(0);
- return 0;
-}
-}
-
-namespace qpid {
-namespace sys {
-
-class ThreadPrivate {
- friend class Thread;
-
- HANDLE threadHandle;
- unsigned threadId;
-
- ThreadPrivate(Runnable* runnable) {
- uintptr_t h = _beginthreadex(0,
- 0,
- runRunnable,
- runnable,
- 0,
- &threadId);
- QPID_WINDOWS_CHECK_CRT_NZ(h);
- threadHandle = reinterpret_cast<HANDLE>(h);
- }
-
- ThreadPrivate()
- : threadHandle(GetCurrentThread()), threadId(GetCurrentThreadId()) {}
-};
-
-Thread::Thread() {}
-
-Thread::Thread(Runnable* runnable) : impl(new ThreadPrivate(runnable)) {}
-
-Thread::Thread(Runnable& runnable) : impl(new ThreadPrivate(&runnable)) {}
-
-void Thread::join() {
- if (impl) {
- DWORD status = WaitForSingleObject (impl->threadHandle, INFINITE);
- QPID_WINDOWS_CHECK_NOT(status, WAIT_FAILED);
- CloseHandle (impl->threadHandle);
- impl->threadHandle = 0;
- }
-}
-
-unsigned long Thread::id() {
- return impl ? impl->threadId : 0;
-}
-
-/* static */
-Thread Thread::current() {
- Thread t;
- t.impl.reset(new ThreadPrivate());
- return t;
-}
-
-}} /* qpid::sys */
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Time.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/Time.cpp
deleted file mode 100644
index 2390826831..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Time.cpp
+++ /dev/null
@@ -1,90 +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 "qpid/sys/Time.h"
-#include <ostream>
-#include <boost/date_time/posix_time/posix_time.hpp>
-#include <boost/thread/thread_time.hpp>
-#include <windows.h>
-
-using namespace boost::posix_time;
-
-namespace qpid {
-namespace sys {
-
-AbsTime::AbsTime(const AbsTime& t, const Duration& d) {
- if (d == Duration::max()) {
- timepoint = ptime(max_date_time);
- }
- else {
- time_duration td = microseconds(d.nanosecs / 1000);
- timepoint = t.timepoint + td;
- }
-}
-
-AbsTime AbsTime::FarFuture() {
- AbsTime ff;
- ptime maxd(max_date_time);
- ff.timepoint = maxd;
- return ff;
-}
-
-AbsTime AbsTime::now() {
- AbsTime time_now;
- time_now.timepoint = boost::get_system_time();
- return time_now;
-}
-
-Duration::Duration(const AbsTime& time0) : nanosecs(0) {
- time_period p(ptime(min_date_time), time0.timepoint);
- nanosecs = p.length().total_nanoseconds();
-}
-
-Duration::Duration(const AbsTime& start, const AbsTime& finish) {
- time_duration d = finish.timepoint - start.timepoint;
- nanosecs = d.total_nanoseconds();
-}
-
-std::ostream& operator<<(std::ostream& o, const Duration& d) {
- return o << int64_t(d) << "ns";
-}
-
-std::ostream& operator<<(std::ostream& o, const AbsTime& t) {
- std::string time_string = to_simple_string(t.timepoint);
- return o << time_string;
-}
-
-void toPtime(ptime& pt, const AbsTime& t) {
- pt = t.getPrivate();
-}
-
-void sleep(int secs) {
- ::Sleep(secs * 1000);
-}
-
-void usleep(uint64_t usecs) {
- DWORD msecs = usecs / 1000;
- if (msecs == 0)
- msecs = 1;
- ::Sleep(msecs);
-}
-
-}}
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Time.h b/M4-RCs/qpid/cpp/src/qpid/sys/windows/Time.h
deleted file mode 100644
index 49b3c4bab3..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/Time.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef QPID_SYS_WINDOWS_TIME_H
-#define QPID_SYS_WINDOWS_TIME_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <boost/date_time/posix_time/posix_time.hpp>
-
-namespace qpid {
-namespace sys {
-
-/**
- * Class to represent an instant in time. Boost has this stuff already done
- * so just reuse it. We can also grab this for quick use with the Condition
- * wait operations.
- */
-typedef boost::posix_time::ptime TimePrivate;
-
-}} // namespace qpid::sys
-
-#endif /*!QPID_SYS_WINDOWS_TIME_H*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/check.h b/M4-RCs/qpid/cpp/src/qpid/sys/windows/check.h
deleted file mode 100755
index aba38814b2..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/check.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#ifndef _windows_check_h
-#define _windows_check_h
-
-/*
- *
- * 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 "qpid/Exception.h"
-#include "qpid/sys/StrError.h"
-
-#define QPID_WINDOWS_ERROR(ERRVAL) qpid::Exception(QPID_MSG(qpid::sys::strError(ERRVAL)))
-#define QPID_WINDOWS_CRT_ERROR(ERRNO) qpid::Exception(QPID_MSG(qpid::sys::strError(ERRNO)))
-
-/** THROW QPID_WINDOWS_ERROR(::GetLastError()) if RESULT is NULL */
-#define QPID_WINDOWS_CHECK_NULL(RESULT) \
- if ((RESULT) == NULL) throw QPID_WINDOWS_ERROR((::GetLastError()))
-
-#define QPID_WINDOWS_CHECK_NOT(RESULT,VAL) \
- if ((RESULT) == (VAL)) throw QPID_WINDOWS_ERROR((::GetLastError()))
-
-#define QPID_WINDOWS_CHECK_ASYNC_START(STATUS) \
- if (!(STATUS) && ::WSAGetLastError() != ERROR_IO_PENDING) \
- throw QPID_WINDOWS_ERROR((::WSAGetLastError()))
-
-#define QPID_WINDOWS_CHECK_CRT_NZ(VAL) \
- if ((VAL) == 0) throw QPID_WINDOWS_CRT_ERROR(errno)
-
-#define QPID_WINSOCK_CHECK(OP) \
- if ((OP) == SOCKET_ERROR) throw QPID_WINDOWS_ERROR((::WSAGetLastError()))
-
-#endif /*!_windows_check_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/uuid.cpp b/M4-RCs/qpid/cpp/src/qpid/sys/windows/uuid.cpp
deleted file mode 100644
index 92f60e04b1..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/uuid.cpp
+++ /dev/null
@@ -1,54 +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 "uuid.h"
-
-#include <string.h>
-
-void uuid_clear (uuid_t uu) {
- UuidCreateNil (reinterpret_cast<UUID*>(uu));
-}
-
-void uuid_copy (uuid_t dst, const uuid_t src) {
- memcpy (dst, src, qpid::sys::UuidSize);
-}
-
-void uuid_generate (uuid_t out) {
- UuidCreate (reinterpret_cast<UUID*>(out));
-}
-
-int uuid_is_null (const uuid_t uu) {
- RPC_STATUS unused;
- return UuidIsNil ((UUID*)uu, &unused);
-}
-
-int uuid_parse (const char *in, uuid_t uu) {
- return UuidFromString ((unsigned char*)in, (UUID*)uu) == RPC_S_OK ? 0 : -1;
-}
-
-void uuid_unparse (const uuid_t uu, char *out) {
- unsigned char *formatted;
- if (UuidToString((UUID*)uu, &formatted) == RPC_S_OK) {
- strncpy_s (out, 36+1, (char*)formatted, _TRUNCATE);
- RpcStringFree(&formatted);
- }
-}
-
diff --git a/M4-RCs/qpid/cpp/src/qpid/sys/windows/uuid.h b/M4-RCs/qpid/cpp/src/qpid/sys/windows/uuid.h
deleted file mode 100644
index a44ef2e9a3..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/sys/windows/uuid.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef _sys_windows_uuid_h
-#define _sys_windows_uuid_h
-
-/*
- *
- * 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 <Rpc.h>
-
-#ifdef uuid_t /* Done in rpcdce.h */
-# undef uuid_t
-#endif
-#include <qpid/sys/IntegerTypes.h>
-namespace qpid { namespace sys { const size_t UuidSize = 16; }}
-typedef uint8_t uuid_t[qpid::sys::UuidSize];
-
-void uuid_clear (uuid_t uu);
-void uuid_copy (uuid_t dst, const uuid_t src);
-void uuid_generate (uuid_t out);
-int uuid_is_null (const uuid_t uu); // Returns 1 if null, else 0
-int uuid_parse (const char *in, uuid_t uu); // Returns 0 on success, else -1
-void uuid_unparse (const uuid_t uu, char *out);
-
-#endif /*!_sys_windows_uuid_h*/
diff --git a/M4-RCs/qpid/cpp/src/qpid/xml/XmlBinding.h b/M4-RCs/qpid/cpp/src/qpid/xml/XmlBinding.h
deleted file mode 100644
index cc6b4dca5d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/xml/XmlBinding.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.
- *
- */
-#include <qpid/framing/FieldTable>
-#include <string>
-
-#ifndef _XmlBinding_
-#define _XmlBinding_
-
-namespace qpid {
-namespace client {
-
-class XmlBinding : public framing::FieldTable {
- public:
- setQuery(string query) { setString("xquery", query); }
-};
-
-}
-}
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/xml/XmlExchange.cpp b/M4-RCs/qpid/cpp/src/qpid/xml/XmlExchange.cpp
deleted file mode 100644
index 5197b239d0..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/xml/XmlExchange.cpp
+++ /dev/null
@@ -1,263 +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 "config.h"
-
-#include "XmlExchange.h"
-
-#include "qpid/broker/DeliverableMessage.h"
-
-#include "qpid/log/Statement.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/FieldValue.h"
-#include "qpid/framing/reply_exceptions.h"
-
-#include "qpid/Plugin.h"
-
-#include <xercesc/framework/MemBufInputSource.hpp>
-#include <xqilla/context/ItemFactory.hpp>
-#include <xqilla/xqilla-simple.hpp>
-
-#include <iostream>
-#include <sstream>
-
-using namespace qpid::framing;
-using namespace qpid::sys;
-using qpid::management::Manageable;
-namespace _qmf = qmf::org::apache::qpid::broker;
-
-namespace qpid {
-namespace broker {
-
-
-XmlExchange::XmlExchange(const string& _name, Manageable* _parent) : Exchange(_name, _parent)
-{
- if (mgmtExchange != 0)
- mgmtExchange->set_type (typeName);
-}
-
-XmlExchange::XmlExchange(const std::string& _name, bool _durable,
- const FieldTable& _args, Manageable* _parent) :
- Exchange(_name, _durable, _args, _parent)
-{
- if (mgmtExchange != 0)
- mgmtExchange->set_type (typeName);
-}
-
-/*
- * Use the name of the query as the binding key.
- *
- * The first time a given name is used in a binding, the query body
- * must be provided.After that, no query body should be present.
- *
- * To modify an installed query, the user must first unbind the
- * existing query, then replace it by binding again with the same
- * name.
- *
- */
-
- // #### TODO: The Binding should take the query text
- // #### only. Consider encapsulating the entire block, including
- // #### the if condition.
-
-
-bool XmlExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* bindingArguments)
-{
- string queryText = bindingArguments->getAsString("xquery");
-
- try {
- RWlock::ScopedWlock l(lock);
-
- XmlBinding::vector& bindings(bindingsMap[routingKey]);
- XmlBinding::vector::ConstPtr p = bindings.snapshot();
- if (!p || std::find_if(p->begin(), p->end(), MatchQueue(queue)) == p->end()) {
- Query query(xqilla.parse(X(queryText.c_str())));
- XmlBinding::shared_ptr binding(new XmlBinding (routingKey, queue, this, query));
- bindings.add(binding);
- QPID_LOG(trace, "Bound successfully with query: " << queryText );
-
- if (mgmtExchange != 0) {
- mgmtExchange->inc_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->inc_bindingCount();
- }
- } else {
- return false;
- }
- }
- catch (XQException& e) {
- throw InternalErrorException(QPID_MSG("Could not parse xquery:"+ queryText));
- }
- catch (...) {
- throw InternalErrorException(QPID_MSG("Unexpected error - Could not parse xquery:"+ queryText));
- }
- routeIVE();
- return true;
-}
-
-bool XmlExchange::unbind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* /*args*/)
-{
- RWlock::ScopedWlock l(lock);
- if (bindingsMap[routingKey].remove_if(MatchQueue(queue))) {
- if (mgmtExchange != 0) {
- mgmtExchange->dec_bindingCount();
- ((_qmf::Queue*) queue->GetManagementObject())->dec_bindingCount();
- }
- return true;
- } else {
- return false;
- }
-}
-
-bool XmlExchange::matches(Query& query, Deliverable& msg, const qpid::framing::FieldTable* args)
-{
- // ### TODO: Need istream for frameset
- // Hack alert - the following code does not work for really large messages
-
- string msgContent;
-
- try {
- msg.getMessage().getFrames().getContent(msgContent);
-
- QPID_LOG(trace, "matches: query is [" << UTF8(query->getQueryText()) << "]");
- QPID_LOG(trace, "matches: message content is [" << msgContent << "]");
-
- boost::scoped_ptr<DynamicContext> context(query->createDynamicContext());
- if (!context.get()) {
- throw InternalErrorException(QPID_MSG("Query context looks munged ..."));
- }
-
- XERCES_CPP_NAMESPACE::MemBufInputSource xml((const XMLByte*) msgContent.c_str(),
- msgContent.length(), "input" );
- Sequence seq(context->parseDocument(xml));
-
- if (args) {
- FieldTable::ValueMap::const_iterator v = args->begin();
- for(; v != args->end(); ++v) {
- // ### TODO: Do types properly
- if (v->second->convertsTo<std::string>()) {
- QPID_LOG(trace, "XmlExchange, external variable: " << v->first << " = " << v->second->getData().getString().c_str());
- Item::Ptr value = context->getItemFactory()->createString(X(v->second->getData().getString().c_str()), context.get());
- context->setExternalVariable(X(v->first.c_str()), value);
- }
- }
- }
-
- if(!seq.isEmpty() && seq.first()->isNode()) {
- context->setContextItem(seq.first());
- context->setContextPosition(1);
- context->setContextSize(1);
- }
- Result result = query->execute(context.get());
- return result->getEffectiveBooleanValue(context.get(), 0);
- }
- catch (XQException& e) {
- QPID_LOG(warning, "Could not parse XML content (or message headers):" << msgContent);
- return 0;
- }
- catch (...) {
- QPID_LOG(warning, "Unexpected error routing message: " << msgContent);
- return 0;
- }
- return 0;
-}
-
-void XmlExchange::route(Deliverable& msg, const string& routingKey, const FieldTable* args)
-{
- PreRoute pr(msg, this);
- try {
- XmlBinding::vector::ConstPtr p;
- {
- RWlock::ScopedRlock l(lock);
- p = bindingsMap[routingKey].snapshot();
- if (!p) return;
- }
- int count(0);
-
- for (std::vector<XmlBinding::shared_ptr>::const_iterator i = p->begin(); i != p->end(); i++) {
- if ((*i)->xquery && matches((*i)->xquery, msg, args)) { // Overly defensive? There should always be a query ...
- msg.deliverTo((*i)->queue);
- count++;
- QPID_LOG(trace, "Delivered to queue" );
-
- if ((*i)->mgmtBinding != 0)
- (*i)->mgmtBinding->inc_msgMatched ();
- }
- }
- if (!count) {
- QPID_LOG(warning, "XMLExchange " << getName() << ": could not route message with query " << routingKey);
- if (mgmtExchange != 0) {
- mgmtExchange->inc_msgDrops ();
- mgmtExchange->inc_byteDrops (msg.contentSize ());
- }
- } else {
- if (mgmtExchange != 0) {
- mgmtExchange->inc_msgRoutes (count);
- mgmtExchange->inc_byteRoutes (count * msg.contentSize ());
- }
- }
-
- if (mgmtExchange != 0) {
- mgmtExchange->inc_msgReceives ();
- mgmtExchange->inc_byteReceives (msg.contentSize ());
- }
- } catch (...) {
- QPID_LOG(warning, "XMLExchange " << getName() << ": exception routing message with query " << routingKey);
- }
-
-
-}
-
-
-bool XmlExchange::isBound(Queue::shared_ptr queue, const string* const routingKey, const FieldTable* const)
-{
- RWlock::ScopedRlock l(lock);
- if (routingKey) {
- XmlBindingsMap::iterator i = bindingsMap.find(*routingKey);
-
- if (i == bindingsMap.end())
- return false;
- if (!queue)
- return true;
- XmlBinding::vector::ConstPtr p = i->second.snapshot();
- return p && std::find_if(p->begin(), p->end(), MatchQueue(queue)) != p->end();
- } else if (!queue) {
- //if no queue or routing key is specified, just report whether any bindings exist
- return bindingsMap.size() > 0;
- } else {
- for (XmlBindingsMap::iterator i = bindingsMap.begin(); i != bindingsMap.end(); i++) {
- XmlBinding::vector::ConstPtr p = i->second.snapshot();
- if (p && std::find_if(p->begin(), p->end(), MatchQueue(queue)) != p->end()) return true;
- }
- return false;
- }
-
-}
-
-
-XmlExchange::~XmlExchange()
-{
- bindingsMap.clear();
-}
-
-const std::string XmlExchange::typeName("xml");
-
-}
-}
diff --git a/M4-RCs/qpid/cpp/src/qpid/xml/XmlExchange.h b/M4-RCs/qpid/cpp/src/qpid/xml/XmlExchange.h
deleted file mode 100644
index 066a26489d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/xml/XmlExchange.h
+++ /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.
- *
- */
-#ifndef _XmlExchange_
-#define _XmlExchange_
-
-#include "qpid/broker/Exchange.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/sys/CopyOnWriteArray.h"
-#include "qpid/sys/Monitor.h"
-#include "qpid/broker/Queue.h"
-
-#include <xqilla/xqilla-simple.hpp>
-
-#include <boost/scoped_ptr.hpp>
-
-#include <map>
-#include <vector>
-
-namespace qpid {
-namespace broker {
-
-class XmlExchange : public virtual Exchange {
-
- typedef boost::shared_ptr<XQQuery> Query;
-
- struct XmlBinding : public Exchange::Binding {
- typedef boost::shared_ptr<XmlBinding> shared_ptr;
- typedef qpid::sys::CopyOnWriteArray<XmlBinding::shared_ptr> vector;
-
- boost::shared_ptr<XQQuery> xquery;
-
- XmlBinding(const std::string& key, const Queue::shared_ptr queue, Exchange* parent, Query query):
- Binding(key, queue, parent), xquery(query) {}
- };
-
-
- typedef std::map<string, XmlBinding::vector > XmlBindingsMap;
-
- XmlBindingsMap bindingsMap;
- XQilla xqilla;
- qpid::sys::RWlock lock;
-
- bool matches(Query& query, Deliverable& msg, const qpid::framing::FieldTable* args);
-
- public:
- static const std::string typeName;
-
- XmlExchange(const std::string& name, management::Manageable* parent = 0);
- XmlExchange(const string& _name, bool _durable,
- const qpid::framing::FieldTable& _args, management::Manageable* parent = 0);
-
- virtual std::string getType() const { return typeName; }
-
- virtual bool bind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual bool unbind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual void route(Deliverable& msg, const std::string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual bool isBound(Queue::shared_ptr queue, const string* const routingKey, const qpid::framing::FieldTable* const args);
-
- virtual ~XmlExchange();
-};
-
-
-}
-}
-
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/qpid/xml/XmlExchangePlugin.cpp b/M4-RCs/qpid/cpp/src/qpid/xml/XmlExchangePlugin.cpp
deleted file mode 100644
index 97e221589d..0000000000
--- a/M4-RCs/qpid/cpp/src/qpid/xml/XmlExchangePlugin.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include <sstream>
-#include "qpid/acl/Acl.h"
-#include "qpid/broker/Broker.h"
-#include "qpid/Plugin.h"
-#include "qpid/shared_ptr.h"
-#include "qpid/log/Statement.h"
-
-#include <boost/utility/in_place_factory.hpp>
-
-#include "XmlExchange.h"
-
-namespace qpid {
-namespace broker { // ACL uses the acl namespace here - should I?
-
-using namespace std;
-
-Exchange::shared_ptr create(const std::string& name, bool durable,
- const framing::FieldTable& args,
- management::Manageable* parent)
-{
- Exchange::shared_ptr e(new XmlExchange(name, durable, args, parent));
- return e;
-}
-
-
-class XmlExchangePlugin : public Plugin
-{
-public:
- void earlyInitialize(Plugin::Target& target);
- void initialize(Plugin::Target& target);
-};
-
-
-void XmlExchangePlugin::initialize(Plugin::Target& target)
-{
- Broker* broker = dynamic_cast<broker::Broker*>(&target);
- if (broker) {
- broker->getExchanges().registerType(XmlExchange::typeName, &create);
- QPID_LOG(info, "Registered xml exchange");
- }
-}
-
-void XmlExchangePlugin::earlyInitialize(Target&) {}
-
-
-static XmlExchangePlugin matchingPlugin;
-
-
-}} // namespace qpid::acl
diff --git a/M4-RCs/qpid/cpp/src/qpidd.cpp b/M4-RCs/qpid/cpp/src/qpidd.cpp
deleted file mode 100644
index 330f12ae83..0000000000
--- a/M4-RCs/qpid/cpp/src/qpidd.cpp
+++ /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.
- *
- */
-
-#include "qpidd.h"
-#include "qpid/Plugin.h"
-#include "qpid/Version.h"
-#include "qpid/log/Logger.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/Shlib.h"
-
-#include <iostream>
-#include <memory>
-using namespace std;
-
-auto_ptr<QpiddOptions> options;
-
-int main(int argc, char* argv[])
-{
- try
- {
- {
- BootstrapOptions bootOptions(argv[0]);
- string defaultPath (bootOptions.module.loadDir);
- // Parse only the common, load, and log options to see which
- // modules need to be loaded. Once the modules are loaded,
- // the command line will be re-parsed with all of the
- // module-supplied options.
- bootOptions.parse (argc, argv, bootOptions.common.config, true);
- qpid::log::Logger::instance().configure(bootOptions.log);
-
- for (vector<string>::iterator iter = bootOptions.module.load.begin();
- iter != bootOptions.module.load.end();
- iter++)
- qpid::tryShlib (iter->data(), false);
-
- if (!bootOptions.module.noLoad) {
- bool isDefault = defaultPath == bootOptions.module.loadDir;
- qpid::loadModuleDir (bootOptions.module.loadDir, isDefault);
- }
- }
-
- // Parse options
- options.reset(new QpiddOptions(argv[0]));
- options->parse(argc, argv, options->common.config);
-
- // Options that just print information.
- if (options->common.help || options->common.version) {
- if (options->common.version)
- cout << "qpidd (" << qpid::product << ") version "
- << qpid::version << endl;
- else if (options->common.help)
- options->usage();
- return 0;
- }
-
- // Everything else is driven by the platform-specific broker
- // logic.
- QpiddBroker broker;
- return broker.execute(options.get());
- }
- catch(const exception& e) {
- QPID_LOG(critical, "Broker start-up failed: " << e.what());
- }
- return 1;
-}
diff --git a/M4-RCs/qpid/cpp/src/qpidd.h b/M4-RCs/qpid/cpp/src/qpidd.h
deleted file mode 100644
index c702270e80..0000000000
--- a/M4-RCs/qpid/cpp/src/qpidd.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef QPID_H
-#define QPID_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/Modules.h"
-#include "qpid/Options.h"
-#include "qpid/broker/Broker.h"
-#include "qpid/log/Options.h"
-
-#include <memory>
-
-// BootstrapOptions is a minimal subset of options used for a pre-parse
-// of the command line to discover which plugin modules need to be loaded.
-// The pre-parse is necessary because plugin modules may supply their own
-// set of options. CommonOptions is needed to properly support loading
-// from a configuration file.
-struct BootstrapOptions : public qpid::Options {
- qpid::CommonOptions common;
- qpid::ModuleOptions module;
- qpid::log::Options log;
-
- BootstrapOptions(const char *argv0);
-};
-
-// Each platform derives an options struct from QpiddOptionsPrivate, adding
-// platform-specific option types. QpiddOptions needs to allocation one of
-// these derived structs from its constructor.
-struct QpiddOptions;
-struct QpiddOptionsPrivate {
- QpiddOptions *options;
- QpiddOptionsPrivate(QpiddOptions *parent) : options(parent) {}
- virtual ~QpiddOptionsPrivate() {}
-protected:
- QpiddOptionsPrivate() {}
-};
-
-struct QpiddOptions : public qpid::Options {
- qpid::CommonOptions common;
- qpid::ModuleOptions module;
- qpid::broker::Broker::Options broker;
- qpid::log::Options log;
- std::auto_ptr<QpiddOptionsPrivate> platform;
-
- QpiddOptions(const char *argv0);
- void usage() const;
-};
-
-class QpiddBroker {
-public:
- int execute (QpiddOptions *options);
-};
-
-#endif /*!QPID_H*/
diff --git a/M4-RCs/qpid/cpp/src/ssl.mk b/M4-RCs/qpid/cpp/src/ssl.mk
deleted file mode 100644
index 5b0ef3d8ae..0000000000
--- a/M4-RCs/qpid/cpp/src/ssl.mk
+++ /dev/null
@@ -1,64 +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.
-#
-#
-# Makefile fragment, conditionally included in Makefile.am
-#
-libsslcommon_la_SOURCES = \
- qpid/sys/ssl/check.h \
- qpid/sys/ssl/check.cpp \
- qpid/sys/ssl/util.h \
- qpid/sys/ssl/util.cpp \
- qpid/sys/ssl/SslSocket.h \
- qpid/sys/ssl/SslSocket.cpp \
- qpid/sys/ssl/SslIo.h \
- qpid/sys/ssl/SslIo.cpp
-
-libsslcommon_la_LIBADD= -lnss3 -lssl3 -lnspr4 libqpidcommon.la
-
-libsslcommon_la_CXXFLAGS=$(AM_CXXFLAGS) $(SSL_CFLAGS)
-
-lib_LTLIBRARIES += libsslcommon.la
-
-ssl_la_SOURCES = \
- qpid/sys/SslPlugin.cpp \
- qpid/sys/ssl/SslHandler.h \
- qpid/sys/ssl/SslHandler.cpp
-
-ssl_la_LIBADD= libqpidbroker.la libsslcommon.la
-
-ssl_la_CXXFLAGS=$(AM_CXXFLAGS) $(SSL_CFLAGS)
-
-ssl_la_LDFLAGS = $(PLUGINLDFLAGS)
-
-dmodule_LTLIBRARIES += ssl.la
-
-
-sslconnector_la_SOURCES = \
- qpid/client/SslConnector.cpp
-
-sslconnector_la_LIBADD = \
- libqpidclient.la \
- libsslcommon.la
-
-sslconnector_la_CXXFLAGS = $(AM_CXXFLAGS) -DCONF_FILE=\"$(confdir)/qpidc.conf\"
-
-sslconnector_la_LDFLAGS = $(PLUGINLDFLAGS)
-
-cmodule_LTLIBRARIES += \
- sslconnector.la
diff --git a/M4-RCs/qpid/cpp/src/tests/.valgrind.supp b/M4-RCs/qpid/cpp/src/tests/.valgrind.supp
deleted file mode 100644
index 7ac34fde5d..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/.valgrind.supp
+++ /dev/null
@@ -1,203 +0,0 @@
-{
- Benign error in libcpg.
- Memcheck:Param
- socketcall.sendmsg(msg.msg_iov[i])
- obj:*/libpthread-2.5.so
- obj:*/libcpg.so.2.0.0
-}
-
-{
- Uninitialised value problem in _dl_relocate (F7, F8)
- Memcheck:Cond
- fun:_dl_relocate_object
- fun:*dl_*
-}
-
-{
- False "possibly leaked" in boost program_options - global std::string var.
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSs4_Rep9_S_createEjjRKSaIcE
- obj:/usr/lib/libstdc++.so.6.0.8
- fun:_ZNSsC1EPKcRKSaIcE
- obj:/usr/lib/libboost_program_options.so.1.33.1
-}
-
-{
- boost 103200 -- we think Boost is responsible for these leaks.
- Memcheck:Leak
- fun:_Znwm
- fun:_ZN5boost15program_options??options_description*
-}
-
-{
- boost 103200 -- we think Boost is responsible for these leaks.
- Memcheck:Leak
- fun:_Znwm
- fun:_ZN5boost9unit_test9test_case*
-}
-
-{
- boost 103200 -- we think Boost is responsible for these leaks.
- Memcheck:Leak
- fun:calloc
- fun:_dlerror_run
- fun:dlopen@@GLIBC_2.2.5
- fun:_ZN4qpid3sys5Shlib4loadEPKc
- fun:_Z9testShlibv
- fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor8functionEv
- obj:/usr/lib64/libboost_unit_test_framework.so.1.32.0
- fun:_ZN5boost17execution_monitor7executeEbi
- fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor21execute_and_translateEPNS0_9test_caseEMS3_FvvEi
- fun:_ZN5boost9unit_test9test_case3runEv
- fun:_ZN5boost9unit_test10test_suite6do_runEv
- fun:_ZN5boost9unit_test9test_case3runEv
- fun:main
-}
-
-{
- boost 103200 -- we think Boost is responsible for these leaks.
- Memcheck:Leak
- fun:calloc
- fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.2.5
- fun:_ZN4qpid6broker5Timer5startEv
- fun:_ZN4qpid6broker5TimerC1Ev
- fun:_ZN4qpid6broker10DtxManagerC1Ev
- fun:_ZN4qpid6broker6BrokerC1ERKNS1_7OptionsE
- fun:_ZN4qpid6broker6Broker6createERKNS1_7OptionsE
- fun:_ZN15SessionFixtureTI15ProxyConnectionEC2Ev
- fun:_Z14testQueueQueryv
- fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor8functionEv
- obj:/usr/lib64/libboost_unit_test_framework.so.1.32.0
- fun:_ZN5boost17execution_monitor7executeEbi
- fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor21execute_and_translateEPNS0_9test_caseEMS3_FvvEi
- fun:_ZN5boost9unit_test9test_case3runEv
- fun:_ZN5boost9unit_test10test_suite6do_runEv
- fun:_ZN5boost9unit_test9test_case3runEv
- fun:main
-}
-
-{
- INVESTIGATE
- Memcheck:Leak
- fun:calloc
- fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.2.5
- fun:_ZN4qpid6client9Connector4initEv
- fun:_ZN4qpid6client14ConnectionImpl4openERKSsiS3_S3_S3_
-}
-
-{
- INVESTIGATE
- Memcheck:Param
- write(buf)
- obj:/lib64/tls/libc-2.3.4.so
- fun:_ZNK4qpid3sys6Socket5writeEPKvm
- fun:_ZN4qpid3sys8AsynchIO9writeableERNS0_14DispatchHandleE
-}
-
-{
- "Conditional jump or move depends on uninitialised value(s)" from Xerces parser
- Memcheck:Cond
- fun:_ZN11xercesc_2_717XMLUTF8Transcoder13transcodeFromEPKhjPtjRjPh
- fun:_ZN11xercesc_2_79XMLReader14xcodeMoreCharsEPtPhj
- fun:_ZN11xercesc_2_79XMLReader17refreshCharBufferEv
-}
-
-{
- boost 103200 -- mgoulish -- fix this, sometime
- Memcheck:Leak
- fun:*
- fun:*
- obj:*
- fun:*
- fun:_ZN4qpid34options_description_less_easy_initclEPKcPKN5boost15program_options14value_semanticES2_
-}
-
-{
- boost 103200 -- mgoulish -- fix this, sometime
- Memcheck:Leak
- fun:*
- fun:*
- fun:*
- fun:_ZN4qpid34options_description_less_easy_initclEPKcPKN5boost15program_options14value_semanticES2_
-}
-
-{
- INVESTIGATE
- Memcheck:Param
- socketcall.sendto(msg)
- fun:send
- fun:get_mapping
- fun:__nscd_get_map_ref
- fun:nscd_gethst_r
- fun:__nscd_gethostbyname_r
- fun:gethostbyname_r@@GLIBC_2.2.5
- fun:gethostbyname
- fun:_ZNK4qpid3sys6Socket7connectERKSsi
-}
-
-{
- INVESTIGATE
- Memcheck:Leak
- fun:calloc
- fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.2.5
- fun:_ZN4qpid6broker5Timer5startEv
- fun:_ZN4qpid6broker5TimerC1Ev
- fun:_ZN4qpid6broker10DtxManagerC1Ev
- fun:_ZN4qpid6broker6BrokerC1ERKNS1_7OptionsE
- fun:_ZN4qpid6broker6Broker6createERKNS1_7OptionsE
- fun:_ZN20ClientSessionFixtureC1Ev
- fun:_Z14testQueueQueryv
- fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor8functionEv
- obj:/usr/lib64/libboost_unit_test_framework.so.1.32.0
- fun:_ZN5boost17execution_monitor7executeEbi
- fun:_ZN5boost9unit_test9ut_detail17unit_test_monitor21execute_and_translateEPNS0_9test_caseEMS3_FvvEi
- fun:_ZN5boost9unit_test9test_case3runEv
- fun:_ZN5boost9unit_test10test_suite6do_runEv
- fun:_ZN5boost9unit_test9test_case3runEv
- fun:main
-}
-
-{
- INVESTIGATE
- Memcheck:Leak
- fun:calloc
- fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.2.5
- fun:_ZN4qpid6client9Connector4initEv
-}
-
-{
- MICK -- FIX
- Memcheck:Leak
- fun:_Znam
- fun:_ZN4qpid7Options5parseEiPPcRKSsb
-}
-
-{
- MICK -- FIX
- Memcheck:Leak
- fun:malloc
- fun:strdup
- fun:_ZN4qpid7Options5parseEiPPcRKSsb
-}
-
-{
- CPG error - seems benign.
- Memcheck:Param
- socketcall.sendmsg(msg.msg_iov[i])
- obj:*
- obj:*/libcpg.so.2.0.0
-}
-
-{
- Known leak in boost.thread 1.33.1. Wildcards for 64/32 bit diffs.
- Memcheck:Leak
- fun:*
- obj:/usr/*/libboost_thread.so.1.33.1
- fun:_ZN5boost6detail3tss3setEPv
-}
-
diff --git a/M4-RCs/qpid/cpp/src/tests/AccumulatedAckTest.cpp b/M4-RCs/qpid/cpp/src/tests/AccumulatedAckTest.cpp
deleted file mode 100644
index 028ce71907..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/AccumulatedAckTest.cpp
+++ /dev/null
@@ -1,232 +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 "qpid/framing/AccumulatedAck.h"
-#include "unit_test.h"
-#include <iostream>
-#include <list>
-
-using std::list;
-using namespace qpid::framing;
-
-
-bool covers(const AccumulatedAck& ack, int i)
-{
- return ack.covers(SequenceNumber(i));
-}
-
-void update(AccumulatedAck& ack, int start, int end)
-{
- ack.update(SequenceNumber(start), SequenceNumber(end));
-}
-
-QPID_AUTO_TEST_SUITE(AccumulatedAckTestSuite)
-
-QPID_AUTO_TEST_CASE(testGeneral)
-{
- AccumulatedAck ack(0);
- ack.clear();
- update(ack, 3,3);
- update(ack, 7,7);
- update(ack, 9,9);
- update(ack, 1,2);
- update(ack, 4,5);
- update(ack, 6,6);
-
- for(int i = 1; i <= 7; i++) BOOST_CHECK(covers(ack, i));
- BOOST_CHECK(covers(ack, 9));
-
- BOOST_CHECK(!covers(ack, 8));
- BOOST_CHECK(!covers(ack, 10));
-
- ack.consolidate();
-
- for(int i = 1; i <= 7; i++) BOOST_CHECK(covers(ack, i));
- BOOST_CHECK(covers(ack, 9));
-
- BOOST_CHECK(!covers(ack, 8));
- BOOST_CHECK(!covers(ack, 10));
-}
-
-QPID_AUTO_TEST_CASE(testCovers)
-{
- AccumulatedAck ack(5);
- update(ack, 7, 7);
- update(ack, 9, 9);
-
- BOOST_CHECK(covers(ack, 1));
- BOOST_CHECK(covers(ack, 2));
- BOOST_CHECK(covers(ack, 3));
- BOOST_CHECK(covers(ack, 4));
- BOOST_CHECK(covers(ack, 5));
- BOOST_CHECK(covers(ack, 7));
- BOOST_CHECK(covers(ack, 9));
-
- BOOST_CHECK(!covers(ack, 6));
- BOOST_CHECK(!covers(ack, 8));
- BOOST_CHECK(!covers(ack, 10));
-}
-
-QPID_AUTO_TEST_CASE(testUpdateFromCompletionData)
-{
- AccumulatedAck ack(0);
- SequenceNumber mark(2);
- SequenceNumberSet ranges;
- ranges.addRange(SequenceNumber(5), SequenceNumber(8));
- ranges.addRange(SequenceNumber(10), SequenceNumber(15));
- ranges.addRange(SequenceNumber(9), SequenceNumber(9));
- ranges.addRange(SequenceNumber(3), SequenceNumber(4));
-
- ack.update(mark, ranges);
-
- for(int i = 0; i <= 15; i++) {
- BOOST_CHECK(covers(ack, i));
- }
- BOOST_CHECK(!covers(ack, 16));
- BOOST_CHECK_EQUAL((uint32_t) 15, ack.mark.getValue());
-}
-
-QPID_AUTO_TEST_CASE(testCase1)
-{
- AccumulatedAck ack(3);
- update(ack, 1,2);
- for(int i = 1; i <= 3; i++) BOOST_CHECK(covers(ack, i));
- BOOST_CHECK(!covers(ack, 4));
-}
-
-QPID_AUTO_TEST_CASE(testCase2)
-{
- AccumulatedAck ack(3);
- update(ack, 3,6);
- for(int i = 1; i <= 6; i++) BOOST_CHECK(covers(ack, i));
- BOOST_CHECK(!covers(ack, 7));
-}
-
-QPID_AUTO_TEST_CASE(testCase3)
-{
- AccumulatedAck ack(3);
- update(ack, 4,6);
- for(int i = 1; i <= 6; i++) {
- BOOST_CHECK(covers(ack, i));
- }
- BOOST_CHECK(!covers(ack, 7));
-}
-
-QPID_AUTO_TEST_CASE(testCase4)
-{
- AccumulatedAck ack(3);
- update(ack, 5,6);
- for(int i = 1; i <= 6; i++) {
- if (i == 4) BOOST_CHECK(!covers(ack, i));
- else BOOST_CHECK(covers(ack, i));
- }
- BOOST_CHECK(!covers(ack, 7));
-}
-
-QPID_AUTO_TEST_CASE(testConsolidation1)
-{
- AccumulatedAck ack(3);
- update(ack, 7,7);
- BOOST_CHECK_EQUAL((uint32_t) 3, ack.mark.getValue());
- BOOST_CHECK_EQUAL((size_t) 1, ack.ranges.size());
-
- update(ack, 8,9);
- BOOST_CHECK_EQUAL((uint32_t) 3, ack.mark.getValue());
- BOOST_CHECK_EQUAL((size_t) 1, ack.ranges.size());
-
- update(ack, 1,2);
- BOOST_CHECK_EQUAL((uint32_t) 3, ack.mark.getValue());
- BOOST_CHECK_EQUAL((size_t) 1, ack.ranges.size());
-
- update(ack, 4,5);
- BOOST_CHECK_EQUAL((uint32_t) 5, ack.mark.getValue());
- BOOST_CHECK_EQUAL((size_t) 1, ack.ranges.size());
-
- update(ack, 6,6);
- BOOST_CHECK_EQUAL((uint32_t) 9, ack.mark.getValue());
- BOOST_CHECK_EQUAL((size_t) 0, ack.ranges.size());
-
- for(int i = 1; i <= 9; i++) BOOST_CHECK(covers(ack, i));
- BOOST_CHECK(!covers(ack, 10));
-}
-
-QPID_AUTO_TEST_CASE(testConsolidation2)
-{
- AccumulatedAck ack(0);
- update(ack, 10,12);
- BOOST_CHECK_EQUAL((uint32_t) 0, ack.mark.getValue());
- BOOST_CHECK_EQUAL((size_t) 1, ack.ranges.size());
-
- update(ack, 7,9);
- BOOST_CHECK_EQUAL((uint32_t) 0, ack.mark.getValue());
- BOOST_CHECK_EQUAL((size_t) 1, ack.ranges.size());
- BOOST_CHECK_EQUAL((uint32_t) 7, ack.ranges.front().start.getValue());
- BOOST_CHECK_EQUAL((uint32_t) 12, ack.ranges.front().end.getValue());
-
- update(ack, 5,7);
- BOOST_CHECK_EQUAL((uint32_t) 0, ack.mark.getValue());
- BOOST_CHECK_EQUAL((size_t) 1, ack.ranges.size());
- BOOST_CHECK_EQUAL((uint32_t) 5, ack.ranges.front().start.getValue());
- BOOST_CHECK_EQUAL((uint32_t) 12, ack.ranges.front().end.getValue());
-
- update(ack, 3,4);
- BOOST_CHECK_EQUAL((uint32_t) 0, ack.mark.getValue());
- BOOST_CHECK_EQUAL((size_t) 1, ack.ranges.size());
- BOOST_CHECK_EQUAL((uint32_t) 3, ack.ranges.front().start.getValue());
- BOOST_CHECK_EQUAL((uint32_t) 12, ack.ranges.front().end.getValue());
-
- update(ack, 1,2);
- BOOST_CHECK_EQUAL((uint32_t) 12, ack.mark.getValue());
- BOOST_CHECK_EQUAL((size_t) 0, ack.ranges.size());
-
- for(int i = 1; i <= 12; i++) BOOST_CHECK(covers(ack, i));
- BOOST_CHECK(!covers(ack, 13));
-}
-
-QPID_AUTO_TEST_CASE(testConsolidation3)
-{
- AccumulatedAck ack(0);
- update(ack, 10,12);
- update(ack, 6,7);
- update(ack, 3,4);
- update(ack, 1,15);
- BOOST_CHECK_EQUAL((uint32_t) 15, ack.mark.getValue());
- BOOST_CHECK_EQUAL((size_t) 0, ack.ranges.size());
-}
-
-QPID_AUTO_TEST_CASE(testConsolidation4)
-{
- AccumulatedAck ack(0);
- ack.update(SequenceNumber(0), SequenceNumber(2));
- ack.update(SequenceNumber(5), SequenceNumber(8));
- ack.update(SequenceNumber(10), SequenceNumber(15));
- ack.update(SequenceNumber(9), SequenceNumber(9));
- ack.update(SequenceNumber(3), SequenceNumber(4));
-
- for(int i = 0; i <= 15; i++) {
- BOOST_CHECK(covers(ack, i));
- }
- BOOST_CHECK(!covers(ack, 16));
- BOOST_CHECK_EQUAL((uint32_t) 15, ack.mark.getValue());
-}
-
-QPID_AUTO_TEST_SUITE_END()
-
diff --git a/M4-RCs/qpid/cpp/src/tests/Array.cpp b/M4-RCs/qpid/cpp/src/tests/Array.cpp
deleted file mode 100644
index c779cbe901..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/Array.cpp
+++ /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.
- *
- */
-#include <iostream>
-#include <sstream>
-#include "qpid/framing/Array.h"
-#include "qpid/framing/FieldValue.h"
-
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(ArrayTestSuite)
-
-using namespace qpid::framing;
-
-void populate(std::vector<std::string>& data, int count = 10)
-{
- for (int i = 0; i < count; i++) {
- std::stringstream out;
- out << "item-" << i;
- data.push_back(out.str());
- }
-}
-
-QPID_AUTO_TEST_CASE(testEncodeDecode)
-{
- std::vector<std::string> data;
- populate(data);
-
- Array a(data);
-
- char buff[200];
- Buffer wbuffer(buff, 200);
- a.encode(wbuffer);
-
- Array b;
- Buffer rbuffer(buff, 200);
- b.decode(rbuffer);
- BOOST_CHECK_EQUAL(a, b);
-
- std::vector<std::string> data2;
- b.collect(data2);
- //BOOST_CHECK_EQUAL(data, data2);
- BOOST_CHECK(data == data2);
-}
-
-QPID_AUTO_TEST_CASE(testArrayAssignment)
-{
- std::vector<std::string> data;
- populate(data);
- Array b;
- {
- Array a(data);
- b = a;
- BOOST_CHECK_EQUAL(a, b);
- }
- std::vector<std::string> data2;
- b.collect(data2);
- //BOOST_CHECK_EQUAL(data, data2);
- BOOST_CHECK(data == data2);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/AsyncCompletion.cpp b/M4-RCs/qpid/cpp/src/tests/AsyncCompletion.cpp
deleted file mode 100644
index e33b2dc35d..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/AsyncCompletion.cpp
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-
-#include "unit_test.h"
-#include "test_tools.h"
-#include "BrokerFixture.h"
-#include "qpid/broker/NullMessageStore.h"
-#include "qpid/sys/BlockingQueue.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/sys/Time.h"
-
-using namespace std;
-using namespace qpid;
-using namespace client;
-using namespace framing;
-
-namespace qpid { namespace broker {
-class TransactionContext;
-class PersistableQueue;
-}}
-
-using broker::PersistableMessage;
-using broker::NullMessageStore;
-using broker::TransactionContext;
-using broker::PersistableQueue;
-using sys::TIME_SEC;
-using boost::intrusive_ptr;
-
-/** @file Unit tests for async completion.
- * Using a dummy store, verify that the broker indicates async completion of
- * message enqueues at the correct time.
- */
-
-class AsyncCompletionMessageStore : public NullMessageStore {
- public:
- sys::BlockingQueue<boost::intrusive_ptr<PersistableMessage> > enqueued;
-
- AsyncCompletionMessageStore() : NullMessageStore() {}
- ~AsyncCompletionMessageStore(){}
-
- void enqueue(TransactionContext*,
- const boost::intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue& )
- {
- enqueued.push(msg);
- }
-};
-
-QPID_AUTO_TEST_SUITE(AsyncCompletionTestSuite)
-
-QPID_AUTO_TEST_CASE(testWaitTillComplete) {
- AsyncCompletionMessageStore* store = new AsyncCompletionMessageStore;
- SessionFixture fix;
- fix.broker->setStore(store); // Broker will delete store.
- AsyncSession s = fix.session;
-
- static const int count = 3;
-
- s.queueDeclare("q", arg::durable=true);
- Completion transfers[count];
- for (int i = 0; i < count; ++i) {
- Message msg(boost::lexical_cast<string>(i), "q");
- msg.getDeliveryProperties().setDeliveryMode(PERSISTENT);
- transfers[i] = s.messageTransfer(arg::content=msg);
- }
-
- // Get hold of the broker-side messages.
- typedef vector<intrusive_ptr<PersistableMessage> > BrokerMessages;
- BrokerMessages enqueued;
- for (int j = 0; j < count; ++j)
- enqueued.push_back(store->enqueued.pop(TIME_SEC));
-
- // Send a sync, make sure it does not complete till all messages are complete.
- // In reverse order for fun.
- Completion sync = s.executionSync(arg::sync=true);
- for (int k = count-1; k >= 0; --k) {
- BOOST_CHECK(!transfers[k].isComplete()); // Should not be complete yet.
- BOOST_CHECK(!sync.isComplete()); // Should not be complete yet.
- enqueued[k]->enqueueComplete();
- }
- sync.wait(); // Should complete now, all messages are completed.
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/AtomicValue.cpp b/M4-RCs/qpid/cpp/src/tests/AtomicValue.cpp
deleted file mode 100644
index 05083ad177..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/AtomicValue.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-
-#include "unit_test.h"
-#include "test_tools.h"
-#include "qpid/sys/AtomicValue.h"
-
-QPID_AUTO_TEST_SUITE(AtomicValueTestSuite)
-
-QPID_AUTO_TEST_CASE(test) {
- qpid::sys::AtomicValue<int> x(0);
- BOOST_CHECK_EQUAL(++x, 1);
- BOOST_CHECK_EQUAL(--x,0);
- BOOST_CHECK_EQUAL(x+=5,5);
- BOOST_CHECK_EQUAL(x-=10,-5);
- BOOST_CHECK_EQUAL(x.fetchAndAdd(7), -5);
- BOOST_CHECK_EQUAL(x.get(),2);
- BOOST_CHECK_EQUAL(x.fetchAndSub(3), 2);
- BOOST_CHECK_EQUAL(x.get(),-1);
-
- BOOST_CHECK_EQUAL(x.valueCompareAndSwap(-1,10), -1);
- BOOST_CHECK_EQUAL(x.get(), 10);
- BOOST_CHECK_EQUAL(x.valueCompareAndSwap(5, 6), 10);
- BOOST_CHECK_EQUAL(x.get(), 10);
-
- BOOST_CHECK(!x.boolCompareAndSwap(5, 6));
- BOOST_CHECK_EQUAL(x.get(), 10);
- BOOST_CHECK(x.boolCompareAndSwap(10, 6));
- BOOST_CHECK_EQUAL(x.get(), 6);
-}
-
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/BasicP2PTest.cpp b/M4-RCs/qpid/cpp/src/tests/BasicP2PTest.cpp
deleted file mode 100644
index f4a4cce7f2..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/BasicP2PTest.cpp
+++ /dev/null
@@ -1,66 +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 "BasicP2PTest.h"
-
-using namespace qpid;
-using namespace qpid::client;
-
-class BasicP2PTest::Receiver : public Worker, public MessageListener
-{
- const std::string queue;
- std::string tag;
-public:
- Receiver(ConnectionOptions& options, const std::string& _queue, const int _messages)
- : Worker(options, _messages), queue(_queue){}
- void init()
- {
- Queue q(queue, true);
- channel.declareQueue(q);
- framing::FieldTable args;
- channel.bind(Exchange::STANDARD_DIRECT_EXCHANGE, q, queue, args);
- channel.consume(q, tag, this);
- channel.start();
- }
-
- void start()
- {
- }
-
- void received(Message&)
- {
- count++;
- }
-};
-
-void BasicP2PTest::assign(const std::string& role, framing::FieldTable& params, ConnectionOptions& options)
-{
- std::string queue = params.getString("P2P_QUEUE_AND_KEY_NAME");
- int messages = params.getInt("P2P_NUM_MESSAGES");
- if (role == "SENDER") {
- worker = std::auto_ptr<Worker>(new Sender(options, Exchange::STANDARD_DIRECT_EXCHANGE, queue, messages));
- } else if(role == "RECEIVER"){
- worker = std::auto_ptr<Worker>(new Receiver(options, queue, messages));
- } else {
- throw Exception("unrecognised role");
- }
- worker->init();
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/BasicP2PTest.h b/M4-RCs/qpid/cpp/src/tests/BasicP2PTest.h
deleted file mode 100644
index b2611f0301..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/BasicP2PTest.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef _BasicP2PTest_
-#define _BasicP2PTest_
-/*
- *
- * 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 <memory>
-#include <sstream>
-
-#include "qpid/Exception.h"
-#include "qpid/client/Channel.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/MessageListener.h"
-#include "SimpleTestCaseBase.h"
-
-
-namespace qpid {
-
-class BasicP2PTest : public SimpleTestCaseBase
-{
- class Receiver;
-public:
- void assign(const std::string& role, framing::FieldTable& params, ConnectionOptions& options);
-};
-
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/tests/BasicPubSubTest.cpp b/M4-RCs/qpid/cpp/src/tests/BasicPubSubTest.cpp
deleted file mode 100644
index 1e9ff364f1..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/BasicPubSubTest.cpp
+++ /dev/null
@@ -1,121 +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 "BasicPubSubTest.h"
-
-using namespace qpid;
-
-class BasicPubSubTest::Receiver : public Worker, public MessageListener
-{
- const Exchange& exchange;
- const std::string queue;
- const std::string key;
- std::string tag;
-public:
- Receiver(ConnectionOptions& options, const Exchange& _exchange, const std::string& _queue, const std::string& _key, const int _messages)
- : Worker(options, _messages), exchange(_exchange), queue(_queue), key(_key){}
-
- void init()
- {
- Queue q(queue, true);
- channel.declareQueue(q);
- framing::FieldTable args;
- channel.bind(exchange, q, key, args);
- channel.consume(q, tag, this);
- channel.start();
- }
-
- void start(){
- }
-
- void received(Message&)
- {
- count++;
- }
-};
-
-class BasicPubSubTest::MultiReceiver : public Worker, public MessageListener
-{
- typedef boost::ptr_vector<Receiver> ReceiverList;
- ReceiverList receivers;
-
-public:
- MultiReceiver(ConnectionOptions& options, const Exchange& exchange, const std::string& key, const int _messages, int receiverCount)
- : Worker(options, _messages)
- {
- for (int i = 0; i != receiverCount; i++) {
- std::string queue = (boost::format("%1%_%2%") % options.clientid % i).str();
- receivers.push_back(new Receiver(options, exchange, queue, key, _messages));
- }
- }
-
- void init()
- {
- for (ReceiverList::size_type i = 0; i != receivers.size(); i++) {
- receivers[i].init();
- }
- }
-
- void start()
- {
- for (ReceiverList::size_type i = 0; i != receivers.size(); i++) {
- receivers[i].start();
- }
- }
-
- void received(Message& msg)
- {
- for (ReceiverList::size_type i = 0; i != receivers.size(); i++) {
- receivers[i].received(msg);
- }
- }
-
- virtual int getCount()
- {
- count = 0;
- for (ReceiverList::size_type i = 0; i != receivers.size(); i++) {
- count += receivers[i].getCount();
- }
- return count;
- }
- virtual void stop()
- {
- for (ReceiverList::size_type i = 0; i != receivers.size(); i++) {
- receivers[i].stop();
- }
- }
-};
-
-void BasicPubSubTest::assign(const std::string& role, framing::FieldTable& params, ConnectionOptions& options)
-{
- std::string key = params.getString("PUBSUB_KEY");
- int messages = params.getInt("PUBSUB_NUM_MESSAGES");
- int receivers = params.getInt("PUBSUB_NUM_RECEIVERS");
- if (role == "SENDER") {
- worker = std::auto_ptr<Worker>(new Sender(options, Exchange::STANDARD_TOPIC_EXCHANGE, key, messages));
- } else if(role == "RECEIVER"){
- worker = std::auto_ptr<Worker>(new MultiReceiver(options, Exchange::STANDARD_TOPIC_EXCHANGE, key, messages, receivers));
- } else {
- throw Exception("unrecognised role");
- }
- worker->init();
-}
-
diff --git a/M4-RCs/qpid/cpp/src/tests/BasicPubSubTest.h b/M4-RCs/qpid/cpp/src/tests/BasicPubSubTest.h
deleted file mode 100644
index 242d2847d7..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/BasicPubSubTest.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef _BasicPubSubTest_
-#define _BasicPubSubTest_
-/*
- *
- * 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 <memory>
-#include <sstream>
-
-#include "qpid/Exception.h"
-#include "qpid/client/Channel.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/MessageListener.h"
-#include "SimpleTestCaseBase.h"
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/format.hpp>
-
-
-namespace qpid {
-
-using namespace qpid::client;
-
-class BasicPubSubTest : public SimpleTestCaseBase
-{
- class Receiver;
- class MultiReceiver;
-public:
- void assign(const std::string& role, framing::FieldTable& params, ConnectionOptions& options);
-};
-
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/tests/Blob.cpp b/M4-RCs/qpid/cpp/src/tests/Blob.cpp
deleted file mode 100644
index c40e43b96e..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/Blob.cpp
+++ /dev/null
@@ -1,128 +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 "qpid/framing/Blob.h"
-
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(BlobTestSuite)
-
-using namespace std;
-using namespace qpid::framing;
-
-struct Base {
- int id;
- int magic;
-
- Base(int n) : id(n), magic(42) {}
- Base(const Base& c) : id(c.id), magic(42) {}
- ~Base() { BOOST_CHECK_EQUAL(42, magic); } // Detect random data.
-};
-
-template <class T> struct Count : public Base {
- static int instances;
- bool destroyed;
-
- Count(int n) : Base(n), destroyed(false) { ++instances; }
- Count(const Count& c) : Base(c), destroyed(false) { ++instances; }
- ~Count() {
- BOOST_CHECK(!destroyed); // Detect double-destructor
- destroyed=true;
- BOOST_CHECK(--instances >= 0);
- }
-};
-
-template <class T> int Count<T>::instances = 0;
-
-struct Foo : public Count<Foo> { Foo(int n) : Count<Foo>(n) {}; };
-struct Bar : public Count<Bar> { Bar(int n) : Count<Bar>(n) {}; };
-
-typedef Blob<sizeof(Foo), Base> TestBlob ;
-
-QPID_AUTO_TEST_CASE(testBlobCtor) {
- {
- TestBlob empty;
- BOOST_CHECK(empty.empty());
- BOOST_CHECK(empty.get() == 0);
-
- TestBlob empty2(empty);
- BOOST_CHECK(empty2.empty());
-
- TestBlob foo(in_place<Foo>(1));
- BOOST_CHECK(!foo.empty());
- BOOST_CHECK_EQUAL(1, foo.get()->id);
- BOOST_CHECK_EQUAL(1, Foo::instances);
-
- TestBlob foo2(foo);
- BOOST_CHECK(!foo2.empty());
- BOOST_CHECK_EQUAL(1, foo2.get()->id);
- BOOST_CHECK_EQUAL(2, Foo::instances);
- }
-
- BOOST_CHECK_EQUAL(0, Foo::instances);
- BOOST_CHECK_EQUAL(0, Bar::instances);
-}
-
-
-QPID_AUTO_TEST_CASE(testAssign) {
- {
- TestBlob b;
- b = Foo(2);
- BOOST_CHECK_EQUAL(2, b.get()->id);
- BOOST_CHECK_EQUAL(1, Foo::instances);
-
- TestBlob b2(b);
- BOOST_CHECK_EQUAL(2, b.get()->id);
- BOOST_CHECK_EQUAL(2, Foo::instances);
-
- b2 = Bar(3);
- BOOST_CHECK_EQUAL(3, b2.get()->id);
- BOOST_CHECK_EQUAL(1, Foo::instances);
- BOOST_CHECK_EQUAL(1, Bar::instances);
-
- b2 = in_place<Foo>(4);
- BOOST_CHECK_EQUAL(4, b2.get()->id);
- BOOST_CHECK_EQUAL(2, Foo::instances);
- BOOST_CHECK_EQUAL(0, Bar::instances);
-
- b2.clear();
- BOOST_CHECK(b2.empty());
- BOOST_CHECK_EQUAL(1, Foo::instances);
- }
- BOOST_CHECK_EQUAL(0, Foo::instances);
- BOOST_CHECK_EQUAL(0, Bar::instances);
-}
-
-
-QPID_AUTO_TEST_CASE(testClear) {
- TestBlob b(in_place<Foo>(5));
- TestBlob c(b);
- BOOST_CHECK(!c.empty());
- BOOST_CHECK(!b.empty());
- BOOST_CHECK_EQUAL(2, Foo::instances);
-
- c.clear();
- BOOST_CHECK(c.empty());
- BOOST_CHECK_EQUAL(1, Foo::instances);
-
- b.clear();
- BOOST_CHECK(b.empty());
- BOOST_CHECK_EQUAL(0, Foo::instances);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/BrokerFixture.h b/M4-RCs/qpid/cpp/src/tests/BrokerFixture.h
deleted file mode 100644
index 2a4faa2fd4..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/BrokerFixture.h
+++ /dev/null
@@ -1,130 +0,0 @@
-#ifndef TESTS_BROKERFIXTURE_H
-#define TESTS_BROKERFIXTURE_H
-
-/*
- *
- * 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 "SocketProxy.h"
-
-#include "qpid/broker/Broker.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/ConnectionImpl.h"
-#include "qpid/client/Session.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/log/Logger.h"
-#include "qpid/log/Options.h"
-#include "qpid/sys/Thread.h"
-#include <boost/noncopyable.hpp>
-
-/**
- * A fixture with an in-process broker.
- */
-struct BrokerFixture : private boost::noncopyable {
- typedef qpid::broker::Broker Broker;
- typedef boost::intrusive_ptr<Broker> BrokerPtr;
-
- BrokerPtr broker;
- qpid::sys::Thread brokerThread;
-
- BrokerFixture(Broker::Options opts=Broker::Options()) {
- // Keep the tests quiet unless logging env. vars have been set by user.
- if (!::getenv("QPID_LOG_ENABLE") && !::getenv("QPID_TRACE")) {
- qpid::log::Options logOpts;
- logOpts.selectors.clear();
- logOpts.selectors.push_back("error+");
- qpid::log::Logger::instance().configure(logOpts);
- }
- opts.port=0;
- // Management doesn't play well with multiple in-process brokers.
- opts.enableMgmt=false;
- opts.workerThreads=1;
- opts.dataDir="";
- opts.auth=false;
- broker = Broker::create(opts);
- // TODO aconway 2007-12-05: At one point BrokerFixture
- // tests could hang in Connection ctor if the following
- // line is removed. This may not be an issue anymore.
- broker->getPort(qpid::broker::Broker::TCP_TRANSPORT);
- brokerThread = qpid::sys::Thread(*broker);
- };
-
- ~BrokerFixture() {
- broker->shutdown();
- brokerThread.join();
- }
-
- /** Open a connection to the broker. */
- void open(qpid::client::Connection& c) {
- c.open("localhost", broker->getPort(qpid::broker::Broker::TCP_TRANSPORT));
- }
-
- uint16_t getPort() { return broker->getPort(qpid::broker::Broker::TCP_TRANSPORT); }
-};
-
-/** Connection that opens in its constructor */
-struct LocalConnection : public qpid::client::Connection {
- LocalConnection(uint16_t port) { open("localhost", port); }
-};
-
-/** A local client connection via a socket proxy. */
-struct ProxyConnection : public qpid::client::Connection {
- SocketProxy proxy;
- ProxyConnection(int brokerPort) : proxy(brokerPort) {
- open("localhost", proxy.getPort());
- }
- ~ProxyConnection() { close(); }
-};
-
-/** Convenience class to create and open a connection and session
- * and some related useful objects.
- */
-template <class ConnectionType=LocalConnection, class SessionType=qpid::client::Session>
-struct ClientT {
- ConnectionType connection;
- SessionType session;
- qpid::client::SubscriptionManager subs;
- qpid::client::LocalQueue lq;
- ClientT(uint16_t port, const std::string& name=std::string())
- : connection(port), session(connection.newSession(name)), subs(session) {}
-
- ~ClientT() { connection.close(); }
-};
-
-typedef ClientT<> Client;
-
-/**
- * A BrokerFixture and ready-connected BrokerFixture::Client all in one.
- */
-template <class ConnectionType, class SessionType=qpid::client::Session>
-struct SessionFixtureT : BrokerFixture, ClientT<ConnectionType,SessionType> {
-
- SessionFixtureT(Broker::Options opts=Broker::Options()) :
- BrokerFixture(opts),
- ClientT<ConnectionType,SessionType>(broker->getPort(qpid::broker::Broker::TCP_TRANSPORT))
- {}
-
-};
-
-typedef SessionFixtureT<LocalConnection> SessionFixture;
-typedef SessionFixtureT<ProxyConnection> ProxySessionFixture;
-
-
-#endif /*!TESTS_BROKERFIXTURE_H*/
diff --git a/M4-RCs/qpid/cpp/src/tests/ClientSessionTest.cpp b/M4-RCs/qpid/cpp/src/tests/ClientSessionTest.cpp
deleted file mode 100644
index 5d047dcd0e..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/ClientSessionTest.cpp
+++ /dev/null
@@ -1,452 +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 "unit_test.h"
-#include "test_tools.h"
-#include "BrokerFixture.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/sys/Monitor.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/sys/Runnable.h"
-#include "qpid/client/Session.h"
-#include "qpid/framing/TransferContent.h"
-#include "qpid/framing/reply_exceptions.h"
-
-#include <boost/optional.hpp>
-#include <boost/lexical_cast.hpp>
-#include <boost/bind.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
-
-#include <vector>
-
-QPID_AUTO_TEST_SUITE(ClientSessionTest)
-
-using namespace qpid::client;
-using namespace qpid::framing;
-using namespace qpid;
-using qpid::sys::Monitor;
-using qpid::sys::Thread;
-using qpid::sys::TIME_SEC;
-using qpid::broker::Broker;
-using std::string;
-using std::cout;
-using std::endl;
-
-
-struct DummyListener : public sys::Runnable, public MessageListener {
- std::vector<Message> messages;
- string name;
- uint expected;
- SubscriptionManager submgr;
-
- DummyListener(Session& session, const string& n, uint ex) :
- name(n), expected(ex), submgr(session) {}
-
- void run()
- {
- submgr.subscribe(*this, name);
- submgr.run();
- }
-
- void received(Message& msg)
- {
- messages.push_back(msg);
- if (--expected == 0) {
- submgr.stop();
- }
- }
-};
-
-struct SimpleListener : public MessageListener
-{
- Monitor lock;
- std::vector<Message> messages;
-
- void received(Message& msg)
- {
- Monitor::ScopedLock l(lock);
- messages.push_back(msg);
- lock.notifyAll();
- }
-
- void waitFor(const uint n)
- {
- Monitor::ScopedLock l(lock);
- while (messages.size() < n) {
- lock.wait();
- }
- }
-};
-
-struct ClientSessionFixture : public ProxySessionFixture
-{
- ClientSessionFixture(Broker::Options opts = Broker::Options()) : ProxySessionFixture(opts) {
- session.queueDeclare(arg::queue="my-queue");
- }
-};
-
-QPID_AUTO_TEST_CASE(testQueueQuery) {
- ClientSessionFixture fix;
- fix.session = fix.connection.newSession();
- fix.session.queueDeclare(arg::queue="q", arg::alternateExchange="amq.fanout",
- arg::exclusive=true, arg::autoDelete=true);
- QueueQueryResult result = fix.session.queueQuery("q");
- BOOST_CHECK_EQUAL(false, result.getDurable());
- BOOST_CHECK_EQUAL(true, result.getExclusive());
- BOOST_CHECK_EQUAL("amq.fanout", result.getAlternateExchange());
-}
-
-QPID_AUTO_TEST_CASE(testDispatcher)
-{
- ClientSessionFixture fix;
- fix.session =fix.connection.newSession();
- size_t count = 100;
- for (size_t i = 0; i < count; ++i)
- fix.session.messageTransfer(arg::content=TransferContent(boost::lexical_cast<string>(i), "my-queue"));
- DummyListener listener(fix.session, "my-queue", count);
- listener.run();
- BOOST_CHECK_EQUAL(count, listener.messages.size());
- for (size_t i = 0; i < count; ++i)
- BOOST_CHECK_EQUAL(boost::lexical_cast<string>(i), listener.messages[i].getData());
-}
-
-QPID_AUTO_TEST_CASE(testDispatcherThread)
-{
- ClientSessionFixture fix;
- fix.session =fix.connection.newSession();
- size_t count = 10;
- DummyListener listener(fix.session, "my-queue", count);
- sys::Thread t(listener);
- for (size_t i = 0; i < count; ++i) {
- fix.session.messageTransfer(arg::content=TransferContent(boost::lexical_cast<string>(i), "my-queue"));
- }
- t.join();
- BOOST_CHECK_EQUAL(count, listener.messages.size());
- for (size_t i = 0; i < count; ++i)
- BOOST_CHECK_EQUAL(boost::lexical_cast<string>(i), listener.messages[i].getData());
-}
-
-QPID_AUTO_TEST_CASE_EXPECTED_FAILURES(testSuspend0Timeout, 1)
-{
- ClientSessionFixture fix;
- fix.session.suspend(); // session has 0 timeout.
- try {
- fix.connection.resume(fix.session);
- BOOST_FAIL("Expected InvalidArgumentException.");
- } catch(const InternalErrorException&) {}
-}
-
-QPID_AUTO_TEST_CASE(testUseSuspendedError)
-{
- ClientSessionFixture fix;
- fix.session.timeout(60);
- fix.session.suspend();
- try {
- fix.session.exchangeQuery(arg::exchange="amq.fanout");
- BOOST_FAIL("Expected session suspended exception");
- } catch(const NotAttachedException&) {}
-}
-
-QPID_AUTO_TEST_CASE_EXPECTED_FAILURES(testSuspendResume, 1)
-{
- ClientSessionFixture fix;
- fix.session.timeout(60);
- fix.session.suspend();
- // Make sure we are still subscribed after resume.
- fix.connection.resume(fix.session);
- fix.session.messageTransfer(arg::content=TransferContent("my-message", "my-queue"));
- FrameSet::shared_ptr msg = fix.session.get();
- BOOST_CHECK_EQUAL(string("my-message"), msg->getContent());
-}
-
-
-QPID_AUTO_TEST_CASE(testSendToSelf) {
- ClientSessionFixture fix;
- SimpleListener mylistener;
- fix.session.queueDeclare(arg::queue="myq", arg::exclusive=true, arg::autoDelete=true);
- fix.subs.subscribe(mylistener, "myq");
- sys::Thread runner(fix.subs);//start dispatcher thread
- string data("msg");
- Message msg(data, "myq");
- const uint count=10;
- for (uint i = 0; i < count; ++i) {
- fix.session.messageTransfer(arg::content=msg);
- }
- mylistener.waitFor(count);
- fix.subs.cancel("myq");
- fix.subs.stop();
- runner.join();
- fix.session.close();
- BOOST_CHECK_EQUAL(mylistener.messages.size(), count);
- for (uint j = 0; j < count; ++j) {
- BOOST_CHECK_EQUAL(mylistener.messages[j].getData(), data);
- }
-}
-
-QPID_AUTO_TEST_CASE(testLocalQueue) {
- ClientSessionFixture fix;
- fix.session.queueDeclare(arg::queue="lq", arg::exclusive=true, arg::autoDelete=true);
- LocalQueue lq;
- fix.subs.subscribe(lq, "lq", FlowControl(2, FlowControl::UNLIMITED, false));
- fix.session.messageTransfer(arg::content=Message("foo0", "lq"));
- fix.session.messageTransfer(arg::content=Message("foo1", "lq"));
- fix.session.messageTransfer(arg::content=Message("foo2", "lq"));
- BOOST_CHECK_EQUAL("foo0", lq.pop().getData());
- BOOST_CHECK_EQUAL("foo1", lq.pop().getData());
- BOOST_CHECK(lq.empty()); // Credit exhausted.
- fix.subs.getSubscription("lq").setFlowControl(FlowControl::unlimited());
- BOOST_CHECK_EQUAL("foo2", lq.pop().getData());
-}
-
-struct DelayedTransfer : sys::Runnable
-{
- ClientSessionFixture& fixture;
-
- DelayedTransfer(ClientSessionFixture& f) : fixture(f) {}
-
- void run()
- {
- sleep(1);
- fixture.session.messageTransfer(arg::content=Message("foo2", "getq"));
- }
-};
-
-QPID_AUTO_TEST_CASE(testGet) {
- ClientSessionFixture fix;
- fix.session.queueDeclare(arg::queue="getq", arg::exclusive=true, arg::autoDelete=true);
- fix.session.messageTransfer(arg::content=Message("foo0", "getq"));
- fix.session.messageTransfer(arg::content=Message("foo1", "getq"));
- Message got;
- BOOST_CHECK(fix.subs.get(got, "getq", TIME_SEC));
- BOOST_CHECK_EQUAL("foo0", got.getData());
- BOOST_CHECK(fix.subs.get(got, "getq", TIME_SEC));
- BOOST_CHECK_EQUAL("foo1", got.getData());
- BOOST_CHECK(!fix.subs.get(got, "getq"));
- DelayedTransfer sender(fix);
- Thread t(sender);
- //test timed get where message shows up after a short delay
- BOOST_CHECK(fix.subs.get(got, "getq", 5*TIME_SEC));
- BOOST_CHECK_EQUAL("foo2", got.getData());
- t.join();
-}
-
-QPID_AUTO_TEST_CASE(testOpenFailure) {
- BrokerFixture b;
- Connection c;
- string host("unknowable-host");
- try {
- c.open(host);
- } catch (const Exception&) {
- BOOST_CHECK(!c.isOpen());
- }
- b.open(c);
- BOOST_CHECK(c.isOpen());
- c.close();
- BOOST_CHECK(!c.isOpen());
-}
-
-QPID_AUTO_TEST_CASE(testPeriodicExpiration) {
- Broker::Options opts;
- opts.queueCleanInterval = 1;
- ClientSessionFixture fix(opts);
- fix.session.queueDeclare(arg::queue="my-queue", arg::exclusive=true, arg::autoDelete=true);
-
- for (uint i = 0; i < 10; i++) {
- Message m((boost::format("Message_%1%") % (i+1)).str(), "my-queue");
- if (i % 2) m.getDeliveryProperties().setTtl(500);
- fix.session.messageTransfer(arg::content=m);
- }
-
- BOOST_CHECK_EQUAL(fix.session.queueQuery(string("my-queue")).getMessageCount(), 10u);
- sleep(2);
- BOOST_CHECK_EQUAL(fix.session.queueQuery(string("my-queue")).getMessageCount(), 5u);
-}
-
-QPID_AUTO_TEST_CASE(testExpirationOnPop) {
- ClientSessionFixture fix;
- fix.session.queueDeclare(arg::queue="my-queue", arg::exclusive=true, arg::autoDelete=true);
-
- for (uint i = 0; i < 10; i++) {
- Message m((boost::format("Message_%1%") % (i+1)).str(), "my-queue");
- if (i % 2) m.getDeliveryProperties().setTtl(200);
- fix.session.messageTransfer(arg::content=m);
- }
-
- ::usleep(300* 1000);
-
- for (uint i = 0; i < 10; i++) {
- if (i % 2) continue;
- Message m;
- BOOST_CHECK(fix.subs.get(m, "my-queue", TIME_SEC));
- BOOST_CHECK_EQUAL((boost::format("Message_%1%") % (i+1)).str(), m.getData());
- }
-}
-
-QPID_AUTO_TEST_CASE(testRelease) {
- ClientSessionFixture fix;
-
- const uint count=10;
- for (uint i = 0; i < count; i++) {
- Message m((boost::format("Message_%1%") % (i+1)).str(), "my-queue");
- fix.session.messageTransfer(arg::content=m);
- }
-
- fix.subs.setAutoStop(false);
- fix.subs.start();
- SubscriptionSettings settings;
- settings.autoAck = 0;
-
- SimpleListener l1;
- Subscription s1 = fix.subs.subscribe(l1, "my-queue", settings);
- l1.waitFor(count);
- s1.cancel();
-
- for (uint i = 0; i < count; i++) {
- BOOST_CHECK_EQUAL((boost::format("Message_%1%") % (i+1)).str(), l1.messages[i].getData());
- }
- s1.release(s1.getUnaccepted());
-
- //check that released messages are redelivered
- settings.autoAck = 1;
- SimpleListener l2;
- Subscription s2 = fix.subs.subscribe(l2, "my-queue", settings);
- l2.waitFor(count);
- for (uint i = 0; i < count; i++) {
- BOOST_CHECK_EQUAL((boost::format("Message_%1%") % (i+1)).str(), l2.messages[i].getData());
- }
-
- fix.subs.stop();
- fix.subs.wait();
- fix.session.close();
-}
-
-QPID_AUTO_TEST_CASE(testCompleteOnAccept) {
- ClientSessionFixture fix;
- const uint count = 8;
- const uint chunk = 4;
- for (uint i = 0; i < count; i++) {
- Message m((boost::format("Message_%1%") % (i+1)).str(), "my-queue");
- fix.session.messageTransfer(arg::content=m);
- }
-
- SubscriptionSettings settings;
- settings.autoAck = 0;
- settings.completionMode = COMPLETE_ON_ACCEPT;
- settings.flowControl = FlowControl::messageWindow(chunk);
-
- LocalQueue q;
- Subscription s = fix.subs.subscribe(q, "my-queue", settings);
- fix.session.messageFlush(arg::destination=s.getName());
- SequenceSet accepted;
- for (uint i = 0; i < chunk; i++) {
- Message m;
- BOOST_CHECK(q.get(m));
- BOOST_CHECK_EQUAL((boost::format("Message_%1%") % (i+1)).str(), m.getData());
- accepted.add(m.getId());
- }
- Message m;
- BOOST_CHECK(!q.get(m));
-
- s.accept(accepted);
- fix.session.messageFlush(arg::destination=s.getName());
- accepted.clear();
-
- for (uint i = chunk; i < count; i++) {
- Message m;
- BOOST_CHECK(q.get(m));
- BOOST_CHECK_EQUAL((boost::format("Message_%1%") % (i+1)).str(), m.getData());
- accepted.add(m.getId());
- }
- fix.session.messageAccept(accepted);
-}
-
-namespace
-{
-struct Publisher : qpid::sys::Runnable
-{
- AsyncSession session;
- Message message;
- uint count;
- Thread thread;
-
- Publisher(Connection& con, Message m, uint c) : session(con.newSession()), message(m), count(c) {}
-
- void start()
- {
- thread = Thread(*this);
- }
-
- void join()
- {
- thread.join();
- }
-
- void run()
- {
- for (uint i = 0; i < count; i++) {
- session.messageTransfer(arg::content=message);
- }
- session.sync();
- session.close();
- }
-};
-}
-
-QPID_AUTO_TEST_CASE(testConcurrentSenders)
-{
- //Ensure concurrent publishing sessions on a connection don't
- //cause assertions, deadlocks or other undesirables:
- BrokerFixture fix;
- Connection connection;
- ConnectionSettings settings;
- settings.maxFrameSize = 1024;
- settings.port = fix.broker->getPort(qpid::broker::Broker::TCP_TRANSPORT);
- connection.open(settings);
- AsyncSession session = connection.newSession();
- Message message(string(512, 'X'));
-
- boost::ptr_vector<Publisher> publishers;
- for (size_t i = 0; i < 5; i++) {
- publishers.push_back(new Publisher(connection, message, 100));
- }
- for_each(publishers.begin(), publishers.end(), boost::bind(&Publisher::start, _1));
- for_each(publishers.begin(), publishers.end(), boost::bind(&Publisher::join, _1));
- connection.close();
-}
-
-
-QPID_AUTO_TEST_CASE(testExclusiveSubscribe)
-{
- ClientSessionFixture fix;
- fix.session.queueDeclare(arg::queue="myq", arg::exclusive=true, arg::autoDelete=true);
- SubscriptionSettings settings;
- settings.exclusive = true;
- LocalQueue q;
- fix.subs.subscribe(q, "myq", settings, "first");
- //attempt to create new subscriber should fail
- ScopedSuppressLogging sl;
- BOOST_CHECK_THROW(fix.subs.subscribe(q, "myq", "second"), ResourceLockedException);
- ;
-
-}
-
-QPID_AUTO_TEST_SUITE_END()
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/ConnectionOptions.h b/M4-RCs/qpid/cpp/src/tests/ConnectionOptions.h
deleted file mode 100644
index 0130842668..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/ConnectionOptions.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef QPID_CLIENT_CONNECTIONOPTIONS_H
-#define QPID_CLIENT_CONNECTIONOPTIONS_H
-
-/*
- *
- * 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 "qpid/client/ConnectionSettings.h"
-#include "qpid/Options.h"
-
-/**
- * Options parser for ConnectionOptions.
- */
-struct ConnectionOptions : public qpid::Options,
- public qpid::client::ConnectionSettings
-{
- ConnectionOptions() : qpid::Options("Connection Settings")
- {
- using namespace qpid;
- addOptions()
- ("broker,b", optValue(host, "HOST"), "Broker host to connect to")
- ("port,p", optValue(port, "PORT"), "Broker port to connect to")
- ("protocol,P", optValue(protocol, "tcp|rdma"), "Protocol to use for broker connection")
- ("virtualhost,v", optValue(virtualhost, "VHOST"), "virtual host")
- ("username", optValue(username, "USER"), "user name for broker log in.")
- ("password", optValue(password, "PASSWORD"), "password for broker log in.")
- ("mechanism", optValue(mechanism, "MECH"), "SASL mechanism to use when authenticating.")
- ("locale", optValue(locale, "LOCALE"), "locale to use.")
- ("max-channels", optValue(maxChannels, "N"), "the maximum number of channels the client requires.")
- ("max-frame-size", optValue(maxFrameSize, "N"), "the maximum frame size to request.")
- ("bounds-multiplier", optValue(bounds, "N"),
- "bound size of write queue (as a multiple of the max frame size).")
- ("tcp-nodelay", optValue(tcpNoDelay), "Turn on tcp-nodelay");
- }
-};
-
-#endif /*!QPID_CLIENT_CONNECTIONOPTIONS_H*/
diff --git a/M4-RCs/qpid/cpp/src/tests/ConsoleTest.cpp b/M4-RCs/qpid/cpp/src/tests/ConsoleTest.cpp
deleted file mode 100644
index 1d55b13f3c..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/ConsoleTest.cpp
+++ /dev/null
@@ -1,43 +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 "qpid/console/Package.h"
-#include "qpid/console/ClassKey.h"
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(ConsoleTestSuite)
-
-using namespace qpid::framing;
-using namespace qpid::console;
-
-QPID_AUTO_TEST_CASE(testClassKey) {
- uint8_t hash[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
- ClassKey k("com.redhat.test", "class", hash);
-
- BOOST_CHECK_EQUAL(k.getPackageName(), "com.redhat.test");
- BOOST_CHECK_EQUAL(k.getClassName(), "class");
- BOOST_CHECK_EQUAL(k.getHashString(), "00010203-04050607-08090a0b-0c0d0e0f");
- BOOST_CHECK_EQUAL(k.str(), "com.redhat.test:class(00010203-04050607-08090a0b-0c0d0e0f)");
-}
-
-QPID_AUTO_TEST_SUITE_END()
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/DeliveryRecordTest.cpp b/M4-RCs/qpid/cpp/src/tests/DeliveryRecordTest.cpp
deleted file mode 100644
index 47c7157749..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/DeliveryRecordTest.cpp
+++ /dev/null
@@ -1,62 +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 "qpid/broker/DeliveryRecord.h"
-#include "unit_test.h"
-#include <iostream>
-#include <memory>
-#include <boost/format.hpp>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-using namespace qpid::framing;
-using boost::dynamic_pointer_cast;
-using std::list;
-
-QPID_AUTO_TEST_SUITE(DeliveryRecordTestSuite)
-
-QPID_AUTO_TEST_CASE(testSort)
-{
- list<SequenceNumber> ids;
- ids.push_back(SequenceNumber(6));
- ids.push_back(SequenceNumber(2));
- ids.push_back(SequenceNumber(4));
- ids.push_back(SequenceNumber(5));
- ids.push_back(SequenceNumber(1));
- ids.push_back(SequenceNumber(3));
-
- list<DeliveryRecord> records;
- for (list<SequenceNumber>::iterator i = ids.begin(); i != ids.end(); i++) {
- DeliveryRecord r(QueuedMessage(0), Queue::shared_ptr(), "tag", false, false, false);
- r.setId(*i);
- records.push_back(r);
- }
- records.sort();
-
- SequenceNumber expected(0);
- for (list<DeliveryRecord>::iterator i = records.begin(); i != records.end(); i++) {
- BOOST_CHECK(i->matches(++expected));
- }
-}
-
-
-QPID_AUTO_TEST_SUITE_END()
-
diff --git a/M4-RCs/qpid/cpp/src/tests/DispatcherTest.cpp b/M4-RCs/qpid/cpp/src/tests/DispatcherTest.cpp
deleted file mode 100644
index 7631956acc..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/DispatcherTest.cpp
+++ /dev/null
@@ -1,128 +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 "qpid/sys/Poller.h"
-#include "qpid/sys/Dispatcher.h"
-#include "qpid/sys/Thread.h"
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <iostream>
-#include <boost/bind.hpp>
-
-using namespace std;
-using namespace qpid::sys;
-
-int writeALot(int fd, const string& s) {
- int bytesWritten = 0;
- do {
- errno = 0;
- int lastWrite = ::write(fd, s.c_str(), s.size());
- if ( lastWrite >= 0) {
- bytesWritten += lastWrite;
- }
- } while (errno != EAGAIN);
- return bytesWritten;
-}
-
-int readALot(int fd) {
- int bytesRead = 0;
- char buf[10240];
-
- do {
- errno = 0;
- int lastRead = ::read(fd, buf, sizeof(buf));
- if ( lastRead >= 0) {
- bytesRead += lastRead;
- }
- } while (errno != EAGAIN);
- return bytesRead;
-}
-
-int64_t writtenBytes = 0;
-int64_t readBytes = 0;
-
-void writer(DispatchHandle& h, int fd, const string& s) {
- writtenBytes += writeALot(fd, s);
- h.rewatch();
-}
-
-void reader(DispatchHandle& h, int fd) {
- readBytes += readALot(fd);
- h.rewatch();
-}
-
-int main(int argc, char** argv)
-{
- // Create poller
- Poller::shared_ptr poller(new Poller);
-
- // Create dispatcher thread
- Dispatcher d(poller);
- Dispatcher d1(poller);
- //Dispatcher d2(poller);
- //Dispatcher d3(poller);
- Thread dt(d);
- Thread dt1(d1);
- //Thread dt2(d2);
- //Thread dt3(d3);
-
- // Setup sender and receiver
- int sv[2];
- int rc = ::socketpair(AF_LOCAL, SOCK_STREAM, 0, sv);
- assert(rc >= 0);
-
- // Set non-blocking
- rc = ::fcntl(sv[0], F_SETFL, O_NONBLOCK);
- assert(rc >= 0);
-
- rc = ::fcntl(sv[1], F_SETFL, O_NONBLOCK);
- assert(rc >= 0);
-
- // Make up a large string
- string testString = "This is only a test ... 1,2,3,4,5,6,7,8,9,10;";
- for (int i = 0; i < 8; i++)
- testString += testString;
-
- DispatchHandle rh(sv[0], boost::bind(reader, _1, sv[0]), 0);
- DispatchHandle wh(sv[1], 0, boost::bind(writer, _1, sv[1], testString));
-
- rh.watch(poller);
- wh.watch(poller);
-
- // wait 2 minutes then shutdown
- sleep(60);
-
- poller->shutdown();
- dt.join();
- dt1.join();
- //dt2.join();
- //dt3.join();
-
- cout << "Wrote: " << writtenBytes << "\n";
- cout << "Read: " << readBytes << "\n";
-
- return 0;
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/DtxWorkRecordTest.cpp b/M4-RCs/qpid/cpp/src/tests/DtxWorkRecordTest.cpp
deleted file mode 100644
index c7c1b460ff..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/DtxWorkRecordTest.cpp
+++ /dev/null
@@ -1,189 +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 "qpid/broker/DtxWorkRecord.h"
-#include "unit_test.h"
-#include <iostream>
-#include <vector>
-#include "TxMocks.h"
-
-using namespace qpid::broker;
-using boost::static_pointer_cast;
-
-QPID_AUTO_TEST_SUITE(DtxWorkRecordTestSuite)
-
-QPID_AUTO_TEST_CASE(testOnePhaseCommit){
- MockTransactionalStore store;
- store.expectBegin().expectCommit();
-
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectPrepare().expectCommit();
- MockTxOp::shared_ptr opB(new MockTxOp());
- opB->expectPrepare().expectCommit();
-
- DtxBuffer::shared_ptr bufferA(new DtxBuffer());
- bufferA->enlist(static_pointer_cast<TxOp>(opA));
- bufferA->markEnded();
- DtxBuffer::shared_ptr bufferB(new DtxBuffer());
- bufferB->enlist(static_pointer_cast<TxOp>(opB));
- bufferB->markEnded();
-
- DtxWorkRecord work("my-xid", &store);
- work.add(bufferA);
- work.add(bufferB);
-
- work.commit(true);
-
- store.check();
- BOOST_CHECK(store.isCommitted());
- opA->check();
- opB->check();
-}
-
-QPID_AUTO_TEST_CASE(testFailOnOnePhaseCommit){
- MockTransactionalStore store;
- store.expectBegin().expectAbort();
-
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectPrepare().expectRollback();
- MockTxOp::shared_ptr opB(new MockTxOp(true));
- opB->expectPrepare().expectRollback();
- MockTxOp::shared_ptr opC(new MockTxOp());
- opC->expectRollback();
-
- DtxBuffer::shared_ptr bufferA(new DtxBuffer());
- bufferA->enlist(static_pointer_cast<TxOp>(opA));
- bufferA->markEnded();
- DtxBuffer::shared_ptr bufferB(new DtxBuffer());
- bufferB->enlist(static_pointer_cast<TxOp>(opB));
- bufferB->markEnded();
- DtxBuffer::shared_ptr bufferC(new DtxBuffer());
- bufferC->enlist(static_pointer_cast<TxOp>(opC));
- bufferC->markEnded();
-
- DtxWorkRecord work("my-xid", &store);
- work.add(bufferA);
- work.add(bufferB);
- work.add(bufferC);
-
- work.commit(true);
-
- BOOST_CHECK(store.isAborted());
- store.check();
-
- opA->check();
- opB->check();
- opC->check();
-}
-
-QPID_AUTO_TEST_CASE(testTwoPhaseCommit){
- MockTransactionalStore store;
- store.expectBegin2PC().expectPrepare().expectCommit();
-
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectPrepare().expectCommit();
- MockTxOp::shared_ptr opB(new MockTxOp());
- opB->expectPrepare().expectCommit();
-
- DtxBuffer::shared_ptr bufferA(new DtxBuffer());
- bufferA->enlist(static_pointer_cast<TxOp>(opA));
- bufferA->markEnded();
- DtxBuffer::shared_ptr bufferB(new DtxBuffer());
- bufferB->enlist(static_pointer_cast<TxOp>(opB));
- bufferB->markEnded();
-
- DtxWorkRecord work("my-xid", &store);
- work.add(bufferA);
- work.add(bufferB);
-
- BOOST_CHECK(work.prepare());
- BOOST_CHECK(store.isPrepared());
- work.commit(false);
- store.check();
- BOOST_CHECK(store.isCommitted());
- opA->check();
- opB->check();
-}
-
-QPID_AUTO_TEST_CASE(testFailOnTwoPhaseCommit){
- MockTransactionalStore store;
- store.expectBegin2PC().expectAbort();
-
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectPrepare().expectRollback();
- MockTxOp::shared_ptr opB(new MockTxOp(true));
- opB->expectPrepare().expectRollback();
- MockTxOp::shared_ptr opC(new MockTxOp());
- opC->expectRollback();
-
- DtxBuffer::shared_ptr bufferA(new DtxBuffer());
- bufferA->enlist(static_pointer_cast<TxOp>(opA));
- bufferA->markEnded();
- DtxBuffer::shared_ptr bufferB(new DtxBuffer());
- bufferB->enlist(static_pointer_cast<TxOp>(opB));
- bufferB->markEnded();
- DtxBuffer::shared_ptr bufferC(new DtxBuffer());
- bufferC->enlist(static_pointer_cast<TxOp>(opC));
- bufferC->markEnded();
-
- DtxWorkRecord work("my-xid", &store);
- work.add(bufferA);
- work.add(bufferB);
- work.add(bufferC);
-
- BOOST_CHECK(!work.prepare());
- BOOST_CHECK(store.isAborted());
- store.check();
- opA->check();
- opB->check();
- opC->check();
-}
-
-QPID_AUTO_TEST_CASE(testRollback){
- MockTransactionalStore store;
- store.expectBegin2PC().expectPrepare().expectAbort();
-
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectPrepare().expectRollback();
- MockTxOp::shared_ptr opB(new MockTxOp());
- opB->expectPrepare().expectRollback();
-
- DtxBuffer::shared_ptr bufferA(new DtxBuffer());
- bufferA->enlist(static_pointer_cast<TxOp>(opA));
- bufferA->markEnded();
- DtxBuffer::shared_ptr bufferB(new DtxBuffer());
- bufferB->enlist(static_pointer_cast<TxOp>(opB));
- bufferB->markEnded();
-
- DtxWorkRecord work("my-xid", &store);
- work.add(bufferA);
- work.add(bufferB);
-
- BOOST_CHECK(work.prepare());
- BOOST_CHECK(store.isPrepared());
- work.rollback();
- store.check();
- BOOST_CHECK(store.isAborted());
- opA->check();
- opB->check();
-}
-
-QPID_AUTO_TEST_SUITE_END()
-
diff --git a/M4-RCs/qpid/cpp/src/tests/ExchangeTest.cpp b/M4-RCs/qpid/cpp/src/tests/ExchangeTest.cpp
deleted file mode 100644
index 0946d3115d..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/ExchangeTest.cpp
+++ /dev/null
@@ -1,284 +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 "qpid/Exception.h"
-#include "qpid/broker/Exchange.h"
-#include "qpid/broker/Queue.h"
-#include "qpid/broker/DeliverableMessage.h"
-#include "qpid/broker/DirectExchange.h"
-#include "qpid/broker/ExchangeRegistry.h"
-#include "qpid/broker/FanOutExchange.h"
-#include "qpid/broker/HeadersExchange.h"
-#include "qpid/broker/TopicExchange.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "unit_test.h"
-#include <iostream>
-#include "MessageUtils.h"
-
-using boost::intrusive_ptr;
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-using namespace qpid;
-
-QPID_AUTO_TEST_SUITE(ExchangeTestSuite)
-
-QPID_AUTO_TEST_CASE(testMe)
-{
- Queue::shared_ptr queue(new Queue("queue", true));
- Queue::shared_ptr queue2(new Queue("queue2", true));
-
- TopicExchange topic("topic");
- topic.bind(queue, "abc", 0);
- topic.bind(queue2, "abc", 0);
-
- DirectExchange direct("direct");
- direct.bind(queue, "abc", 0);
- direct.bind(queue2, "abc", 0);
-
- queue.reset();
- queue2.reset();
-
- intrusive_ptr<Message> msgPtr(MessageUtils::createMessage("exchange", "key", "id"));
- DeliverableMessage msg(msgPtr);
- topic.route(msg, "abc", 0);
- direct.route(msg, "abc", 0);
-
-}
-
-QPID_AUTO_TEST_CASE(testIsBound)
-{
- Queue::shared_ptr a(new Queue("a", true));
- Queue::shared_ptr b(new Queue("b", true));
- Queue::shared_ptr c(new Queue("c", true));
- Queue::shared_ptr d(new Queue("d", true));
-
- string k1("abc");
- string k2("def");
- string k3("xyz");
-
- FanOutExchange fanout("fanout");
- BOOST_CHECK(fanout.bind(a, "", 0));
- BOOST_CHECK(fanout.bind(b, "", 0));
- BOOST_CHECK(fanout.bind(c, "", 0));
-
- BOOST_CHECK(fanout.isBound(a, 0, 0));
- BOOST_CHECK(fanout.isBound(b, 0, 0));
- BOOST_CHECK(fanout.isBound(c, 0, 0));
- BOOST_CHECK(!fanout.isBound(d, 0, 0));
-
- DirectExchange direct("direct");
- BOOST_CHECK(direct.bind(a, k1, 0));
- BOOST_CHECK(direct.bind(a, k3, 0));
- BOOST_CHECK(direct.bind(b, k2, 0));
- BOOST_CHECK(direct.bind(c, k1, 0));
-
- BOOST_CHECK(direct.isBound(a, 0, 0));
- BOOST_CHECK(direct.isBound(a, &k1, 0));
- BOOST_CHECK(direct.isBound(a, &k3, 0));
- BOOST_CHECK(!direct.isBound(a, &k2, 0));
- BOOST_CHECK(direct.isBound(b, 0, 0));
- BOOST_CHECK(direct.isBound(b, &k2, 0));
- BOOST_CHECK(direct.isBound(c, &k1, 0));
- BOOST_CHECK(!direct.isBound(d, 0, 0));
- BOOST_CHECK(!direct.isBound(d, &k1, 0));
- BOOST_CHECK(!direct.isBound(d, &k2, 0));
- BOOST_CHECK(!direct.isBound(d, &k3, 0));
-
- TopicExchange topic("topic");
- BOOST_CHECK(topic.bind(a, k1, 0));
- BOOST_CHECK(topic.bind(a, k3, 0));
- BOOST_CHECK(topic.bind(b, k2, 0));
- BOOST_CHECK(topic.bind(c, k1, 0));
-
- BOOST_CHECK(topic.isBound(a, 0, 0));
- BOOST_CHECK(topic.isBound(a, &k1, 0));
- BOOST_CHECK(topic.isBound(a, &k3, 0));
- BOOST_CHECK(!topic.isBound(a, &k2, 0));
- BOOST_CHECK(topic.isBound(b, 0, 0));
- BOOST_CHECK(topic.isBound(b, &k2, 0));
- BOOST_CHECK(topic.isBound(c, &k1, 0));
- BOOST_CHECK(!topic.isBound(d, 0, 0));
- BOOST_CHECK(!topic.isBound(d, &k1, 0));
- BOOST_CHECK(!topic.isBound(d, &k2, 0));
- BOOST_CHECK(!topic.isBound(d, &k3, 0));
-
- HeadersExchange headers("headers");
- FieldTable args1;
- args1.setString("x-match", "all");
- args1.setString("a", "A");
- args1.setInt("b", 1);
- FieldTable args2;
- args2.setString("x-match", "any");
- args2.setString("a", "A");
- args2.setInt("b", 1);
- FieldTable args3;
- args3.setString("x-match", "any");
- args3.setString("c", "C");
- args3.setInt("b", 6);
-
- headers.bind(a, "", &args1);
- headers.bind(a, "", &args3);
- headers.bind(b, "", &args2);
- headers.bind(c, "", &args1);
-
- BOOST_CHECK(headers.isBound(a, 0, 0));
- BOOST_CHECK(headers.isBound(a, 0, &args1));
- BOOST_CHECK(headers.isBound(a, 0, &args3));
- BOOST_CHECK(!headers.isBound(a, 0, &args2));
- BOOST_CHECK(headers.isBound(b, 0, 0));
- BOOST_CHECK(headers.isBound(b, 0, &args2));
- BOOST_CHECK(headers.isBound(c, 0, &args1));
- BOOST_CHECK(!headers.isBound(d, 0, 0));
- BOOST_CHECK(!headers.isBound(d, 0, &args1));
- BOOST_CHECK(!headers.isBound(d, 0, &args2));
- BOOST_CHECK(!headers.isBound(d, 0, &args3));
-}
-
-QPID_AUTO_TEST_CASE(testDeleteGetAndRedeclare)
-{
- ExchangeRegistry exchanges;
- exchanges.declare("my-exchange", "direct", false, FieldTable());
- exchanges.destroy("my-exchange");
- try {
- exchanges.get("my-exchange");
- } catch (const NotFoundException&) {}
- std::pair<Exchange::shared_ptr, bool> response = exchanges.declare("my-exchange", "direct", false, FieldTable());
- BOOST_CHECK_EQUAL(string("direct"), response.first->getType());
-}
-
-intrusive_ptr<Message> cmessage(std::string exchange, std::string routingKey) {
- intrusive_ptr<Message> msg(new Message());
- AMQFrame method(in_place<MessageTransferBody>(ProtocolVersion(), exchange, 0, 0));
- AMQFrame header(in_place<AMQHeaderBody>());
- msg->getFrames().append(method);
- msg->getFrames().append(header);
- msg->getFrames().getHeaders()->get<DeliveryProperties>(true)->setRoutingKey(routingKey);
- return msg;
-}
-
-QPID_AUTO_TEST_CASE(testSequenceOptions)
-{
- FieldTable args;
- args.setInt("qpid.msg_sequence",1);
- char* buff = new char[10000];
- framing::Buffer buffer(buff,10000);
- {
- DirectExchange direct("direct1", false, args);
-
- intrusive_ptr<Message> msg1 = cmessage("e", "A");
- intrusive_ptr<Message> msg2 = cmessage("e", "B");
- intrusive_ptr<Message> msg3 = cmessage("e", "C");
-
- DeliverableMessage dmsg1(msg1);
- DeliverableMessage dmsg2(msg2);
- DeliverableMessage dmsg3(msg3);
-
- direct.route(dmsg1, "abc", 0);
- direct.route(dmsg2, "abc", 0);
- direct.route(dmsg3, "abc", 0);
-
- BOOST_CHECK_EQUAL(1, msg1->getApplicationHeaders()->getAsInt64("qpid.msg_sequence"));
- BOOST_CHECK_EQUAL(2, msg2->getApplicationHeaders()->getAsInt64("qpid.msg_sequence"));
- BOOST_CHECK_EQUAL(3, msg3->getApplicationHeaders()->getAsInt64("qpid.msg_sequence"));
-
- FanOutExchange fanout("fanout1", false, args);
- HeadersExchange header("headers1", false, args);
- TopicExchange topic ("topic1", false, args);
-
- // check other exchanges, that they preroute
- intrusive_ptr<Message> msg4 = cmessage("e", "A");
- intrusive_ptr<Message> msg5 = cmessage("e", "B");
- intrusive_ptr<Message> msg6 = cmessage("e", "C");
-
- DeliverableMessage dmsg4(msg4);
- DeliverableMessage dmsg5(msg5);
- DeliverableMessage dmsg6(msg6);
-
- fanout.route(dmsg4, "abc", 0);
- BOOST_CHECK_EQUAL(1, msg4->getApplicationHeaders()->getAsInt64("qpid.msg_sequence"));
-
- FieldTable headers;
- header.route(dmsg5, "abc", &headers);
- BOOST_CHECK_EQUAL(1, msg5->getApplicationHeaders()->getAsInt64("qpid.msg_sequence"));
-
- topic.route(dmsg6, "abc", 0);
- BOOST_CHECK_EQUAL(1, msg6->getApplicationHeaders()->getAsInt64("qpid.msg_sequence"));
- direct.encode(buffer);
- }
- {
-
- ExchangeRegistry exchanges;
- buffer.reset();
- DirectExchange::shared_ptr exch_dec = Exchange::decode(exchanges, buffer);
-
- intrusive_ptr<Message> msg1 = cmessage("e", "A");
- DeliverableMessage dmsg1(msg1);
- exch_dec->route(dmsg1, "abc", 0);
-
- BOOST_CHECK_EQUAL(4, msg1->getApplicationHeaders()->getAsInt64("qpid.msg_sequence"));
-
- }
- delete [] buff;
-}
-
-QPID_AUTO_TEST_CASE(testIVEOption)
-{
- FieldTable args;
- args.setInt("qpid.ive",1);
- DirectExchange direct("direct1", false, args);
- FanOutExchange fanout("fanout1", false, args);
- HeadersExchange header("headers1", false, args);
- TopicExchange topic ("topic1", false, args);
-
- intrusive_ptr<Message> msg1 = cmessage("direct1", "abc");
- msg1->getProperties<MessageProperties>()->getApplicationHeaders().setString("a", "abc");
- DeliverableMessage dmsg1(msg1);
-
- FieldTable args2;
- args2.setString("x-match", "any");
- args2.setString("a", "abc");
-
- direct.route(dmsg1, "abc", 0);
- fanout.route(dmsg1, "abc", 0);
- header.route(dmsg1, "abc", &args2);
- topic.route(dmsg1, "abc", 0);
- Queue::shared_ptr queue(new Queue("queue", true));
- Queue::shared_ptr queue1(new Queue("queue1", true));
- Queue::shared_ptr queue2(new Queue("queue2", true));
- Queue::shared_ptr queue3(new Queue("queue3", true));
-
- BOOST_CHECK(HeadersExchange::match(args2, msg1->getProperties<MessageProperties>()->getApplicationHeaders()));
-
- BOOST_CHECK(direct.bind(queue, "abc", 0));
- BOOST_CHECK(fanout.bind(queue1, "abc", 0));
- BOOST_CHECK(header.bind(queue2, "", &args2));
- BOOST_CHECK(topic.bind(queue3, "abc", 0));
-
- BOOST_CHECK_EQUAL(1u,queue->getMessageCount());
- BOOST_CHECK_EQUAL(1u,queue1->getMessageCount());
- BOOST_CHECK_EQUAL(1u,queue2->getMessageCount());
- BOOST_CHECK_EQUAL(1u,queue3->getMessageCount());
-
-}
-
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/FieldTable.cpp b/M4-RCs/qpid/cpp/src/tests/FieldTable.cpp
deleted file mode 100644
index 6b364723cf..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/FieldTable.cpp
+++ /dev/null
@@ -1,178 +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 <iostream>
-#include "qpid/framing/Array.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/FieldValue.h"
-#include <alloca.h>
-
-#include "unit_test.h"
-
-using namespace qpid::framing;
-
-QPID_AUTO_TEST_SUITE(FieldTableTestSuite)
-
-QPID_AUTO_TEST_CASE(testMe)
-{
- FieldTable ft;
- ft.setString("A", "BCDE");
- BOOST_CHECK(string("BCDE") == ft.getAsString("A"));
-
- char buff[100];
- Buffer wbuffer(buff, 100);
- wbuffer.put(ft);
-
- Buffer rbuffer(buff, 100);
- FieldTable ft2;
- rbuffer.get(ft2);
- BOOST_CHECK(string("BCDE") == ft2.getAsString("A"));
-
-}
-
-QPID_AUTO_TEST_CASE(testAssignment)
-{
- FieldTable a;
- FieldTable b;
-
- a.setString("A", "BBBB");
- a.setInt("B", 1234);
- b = a;
- a.setString("A", "CCCC");
-
- BOOST_CHECK(string("CCCC") == a.getAsString("A"));
- BOOST_CHECK(string("BBBB") == b.getAsString("A"));
- BOOST_CHECK_EQUAL(1234, a.getAsInt("B"));
- BOOST_CHECK_EQUAL(1234, b.getAsInt("B"));
- BOOST_CHECK(IntegerValue(1234) == *a.get("B"));
- BOOST_CHECK(IntegerValue(1234) == *b.get("B"));
-
- FieldTable d;
- {
- FieldTable c;
- c = a;
-
- char* buff = static_cast<char*>(::alloca(c.encodedSize()));
- Buffer wbuffer(buff, c.encodedSize());
- wbuffer.put(c);
-
- Buffer rbuffer(buff, c.encodedSize());
- rbuffer.get(d);
- BOOST_CHECK_EQUAL(c, d);
- BOOST_CHECK(string("CCCC") == c.getAsString("A"));
- BOOST_CHECK(IntegerValue(1234) == *c.get("B"));
- }
- BOOST_CHECK(string("CCCC") == d.getAsString("A"));
- BOOST_CHECK(IntegerValue(1234) == *d.get("B"));
-}
-
-
-QPID_AUTO_TEST_CASE(testNestedValues)
-{
- char buff[100];
- {
- FieldTable a;
- FieldTable b;
- std::vector<std::string> items;
- items.push_back("one");
- items.push_back("two");
- Array c(items);
-
- a.setString("id", "A");
- b.setString("id", "B");
- a.setTable("B", b);
- a.setArray("C", c);
-
-
- Buffer wbuffer(buff, 100);
- wbuffer.put(a);
- }
- {
- Buffer rbuffer(buff, 100);
- FieldTable a;
- FieldTable b;
- Array c;
- rbuffer.get(a);
- BOOST_CHECK(string("A") == a.getAsString("id"));
- a.getTable("B", b);
- BOOST_CHECK(string("B") == b.getAsString("id"));
- a.getArray("C", c);
- std::vector<std::string> items;
- c.collect(items);
- BOOST_CHECK((uint) 2 == items.size());
- BOOST_CHECK(string("one") == items[0]);
- BOOST_CHECK(string("two") == items[1]);
- }
-}
-
-QPID_AUTO_TEST_CASE(testFloatAndDouble)
-{
- char buff[100];
- float f = 5.672;
- double d = 56.720001;
- {
- FieldTable a;
- a.setString("string", "abc");
- a.setInt("int", 5672);
- a.setFloat("float", f);
- a.setDouble("double", d);
-
- Buffer wbuffer(buff, 100);
- wbuffer.put(a);
- }
- {
- Buffer rbuffer(buff, 100);
- FieldTable a;
- rbuffer.get(a);
- BOOST_CHECK(string("abc") == a.getAsString("string"));
- BOOST_CHECK(5672 == a.getAsInt("int"));
- float f2;
- BOOST_CHECK(!a.getFloat("string", f2));
- BOOST_CHECK(!a.getFloat("int", f2));
- BOOST_CHECK(a.getFloat("float", f2));
- BOOST_CHECK(f2 == f);
-
- double d2;
- BOOST_CHECK(!a.getDouble("string", d2));
- BOOST_CHECK(!a.getDouble("int", d2));
- BOOST_CHECK(a.getDouble("double", d2));
- BOOST_CHECK(d2 == d);
- }
-}
-
-QPID_AUTO_TEST_CASE(test64GetAndSetConverts)
-{
- FieldTable args;
- args.setInt64("a",100);
- args.setInt64("b",-(int64_t) ((int64_t) 1<<34));
-
- args.setUInt64("c",1u);
- args.setUInt64("d",(uint64_t) ((uint64_t) 1<<34));
- BOOST_CHECK_EQUAL(1u, args.getAsUInt64("c"));
- BOOST_CHECK_EQUAL(100u, args.getAsUInt64("a"));
- BOOST_CHECK_EQUAL(1, args.getAsInt64("c"));
- BOOST_CHECK_EQUAL(100, args.getAsInt64("a"));
- BOOST_CHECK_EQUAL(-(int64_t) ((int64_t) 1<<34), args.getAsInt64("b"));
- BOOST_CHECK_EQUAL((uint64_t) ((uint64_t) 1<<34), args.getAsUInt64("d"));
- BOOST_CHECK_EQUAL((int64_t) ((int64_t) 1<<34), args.getAsInt64("d"));
-
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/FieldValue.cpp b/M4-RCs/qpid/cpp/src/tests/FieldValue.cpp
deleted file mode 100644
index 448f068107..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/FieldValue.cpp
+++ /dev/null
@@ -1,90 +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 "qpid/framing/FieldValue.h"
-
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(FieldValueTestSuite)
-
-using namespace qpid::framing;
-
-Str16Value s("abc");
-IntegerValue i(42);
-//DecimalValue d(1234,2);
-//FieldTableValue ft;
-//EmptyValue e;
-
-QPID_AUTO_TEST_CASE(testStr16ValueEquals)
-{
-
- BOOST_CHECK(Str16Value("abc") == s);
- BOOST_CHECK(Str16Value("foo") != s);
- BOOST_CHECK(s != i);
- BOOST_CHECK(s.convertsTo<std::string>() == true);
- BOOST_CHECK(s.convertsTo<int>() == false);
- BOOST_CHECK(s.get<std::string>() == "abc");
- BOOST_CHECK_THROW(s.get<int>(), InvalidConversionException);
-// BOOST_CHECK(s != ft);
-
-}
-
-QPID_AUTO_TEST_CASE(testIntegerValueEquals)
-{
- BOOST_CHECK(IntegerValue(42) == i);
- BOOST_CHECK(IntegerValue(5) != i);
- BOOST_CHECK(i != s);
- BOOST_CHECK(i.convertsTo<std::string>() == false);
- BOOST_CHECK(i.convertsTo<int>() == true);
- BOOST_CHECK_THROW(i.get<std::string>(), InvalidConversionException);
- BOOST_CHECK(i.get<int>() == 42);
-// BOOST_CHECK(i != ft);
-}
-
-#if 0
-QPID_AUTO_TEST_CASE(testDecimalValueEquals)
-{
- BOOST_CHECK(DecimalValue(1234, 2) == d);
- BOOST_CHECK(DecimalValue(12345, 2) != d);
- BOOST_CHECK(DecimalValue(1234, 3) != d);
- BOOST_CHECK(d != s);
-}
-
-QPID_AUTO_TEST_CASE(testFieldTableValueEquals)
-{
- ft.getValue().setString("foo", "FOO");
- ft.getValue().setInt("magic", 7);
-
- BOOST_CHECK_EQUAL(std::string("FOO"),
- ft.getValue().getString("foo"));
- BOOST_CHECK_EQUAL(7, ft.getValue().getInt("magic"));
-
- FieldTableValue f2;
- BOOST_CHECK(ft != f2);
- f2.getValue().setString("foo", "FOO");
- BOOST_CHECK(ft != f2);
- f2.getValue().setInt("magic", 7);
- BOOST_CHECK_EQUAL(ft,f2);
- BOOST_CHECK(ft == f2);
- f2.getValue().setString("foo", "BAR");
- BOOST_CHECK(ft != f2);
- BOOST_CHECK(ft != i);
-}
-#endif
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/ForkedBroker.h b/M4-RCs/qpid/cpp/src/tests/ForkedBroker.h
deleted file mode 100644
index bf9e9265c4..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/ForkedBroker.h
+++ /dev/null
@@ -1,122 +0,0 @@
-#ifndef TESTS_FORKEDBROKER_H
-
-
-/*
- *
- * 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 "qpid/Exception.h"
-#include "qpid/log/Statement.h"
-#include "qpid/broker/Broker.h"
-#include <boost/lexical_cast.hpp>
-#include <string>
-#include <stdio.h>
-#include <sys/wait.h>
-
-/**
- * Class to fork a broker child process.
- *
- * For most tests a BrokerFixture may be more convenient as it starts
- * a broker in the same process which allows you to easily debug into
- * the broker.
- *
- * This useful for tests that need to start multiple brokers where
- * those brokers can't coexist in the same process (e.g. for cluster
- * tests where CPG doesn't allow multiple group members in a single
- * process.)
- *
- */
-class ForkedBroker {
- public:
- ForkedBroker(std::vector<const char*> argv) { init(argv); }
-
- ForkedBroker(int argc, const char* const argv[]) {
- std::vector<const char*> args(argv, argv+argc);
- init(args);
- }
-
- ~ForkedBroker() {
- try { kill(); } catch(const std::exception& e) {
- QPID_LOG(error, QPID_MSG("Killing forked broker: " << e.what()));
- }
- }
-
- void kill(int sig=SIGINT) {
- if (pid == 0) return;
- int savePid = pid;
- pid = 0; // Reset pid here in case of an exception.
- using qpid::ErrnoException;
- if (::kill(savePid, sig) < 0)
- throw ErrnoException("kill failed");
- int status;
- if (::waitpid(savePid, &status, 0) < 0)
- throw ErrnoException("wait for forked process failed");
- if (WEXITSTATUS(status) != 0)
- throw qpid::Exception(QPID_MSG("Forked broker exited with: " << WEXITSTATUS(status)));
- }
-
- uint16_t getPort() { return port; }
- pid_t getPID() { return pid; }
-
- private:
-
- template <class F> struct OnExit {
- F fn;
- OnExit(F f) : fn(f) {}
- ~OnExit() { fn(); }
- };
-
- void init(const std::vector<const char*>& args) {
- using qpid::ErrnoException;
- port = 0;
- int pipeFds[2];
- if(::pipe(pipeFds) < 0) throw ErrnoException("Can't create pipe");
- pid = ::fork();
- if (pid < 0) throw ErrnoException("Fork failed");
- if (pid) { // parent
- ::close(pipeFds[1]);
- FILE* f = ::fdopen(pipeFds[0], "r");
- if (!f) throw ErrnoException("fopen failed");
- if (::fscanf(f, "%d", &port) != 1) {
- if (ferror(f)) throw ErrnoException("Error reading port number from child.");
- else throw qpid::Exception("EOF reading port number from child.");
- }
- ::close(pipeFds[0]);
- }
- else { // child
- ::close(pipeFds[0]);
- int fd = ::dup2(pipeFds[1], 1); // pipe stdout to the parent.
- if (fd < 0) throw ErrnoException("dup2 failed");
- const char* prog = "../qpidd";
- std::vector<const char*> args2(args);
- args2.push_back("--port=0");
- args2.push_back("--mgmt-enable=no"); // TODO aconway 2008-07-16: why does mgmt cause problems?
- args2.push_back("--log-enable=error+"); // Keep quiet except for errors.
- args2.push_back(0);
- execv(prog, const_cast<char* const*>(&args2[0]));
- throw ErrnoException("execv failed");
- }
- }
-
- pid_t pid;
- int port;
-};
-
-#endif /*!TESTS_FORKEDBROKER_H*/
diff --git a/M4-RCs/qpid/cpp/src/tests/Frame.cpp b/M4-RCs/qpid/cpp/src/tests/Frame.cpp
deleted file mode 100644
index 11905911fa..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/Frame.cpp
+++ /dev/null
@@ -1,80 +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 "qpid/framing/Frame.h"
-
-#include <boost/lexical_cast.hpp>
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(FrameTestSuite)
-
-using namespace std;
-using namespace qpid::framing;
-using namespace boost;
-
-QPID_AUTO_TEST_CASE(testContentBody) {
- Frame f(42, AMQContentBody("foobar"));
- AMQBody* body=f.getBody();
- BOOST_CHECK(dynamic_cast<AMQContentBody*>(body));
- Buffer b(f.encodedSize();
- f.encode(b);
- b.flip();
- Frame g;
- g.decode(b);
- AMQContentBody* content=dynamic_cast<AMQContentBody*>(g.getBody());
- BOOST_REQUIRE(content);
- BOOST_CHECK_EQUAL(content->getData(), "foobar");
-}
-
-QPID_AUTO_TEST_CASE(testMethodBody) {
- FieldTable args;
- args.setString("foo", "bar");
- Frame f(
- 42, QueueDeclareBody(ProtocolVersion(), 1, "q", "altex",
- true, false, true, false, true, args));
- BOOST_CHECK_EQUAL(f.getChannel(), 42);
- Buffer b(f.encodedSize();
- f.encode(b);
- b.flip();
- Frame g;
- g.decode(b);
- BOOST_CHECK_EQUAL(f.getChannel(), g.getChannel());
- QueueDeclareBody* declare=dynamic_cast<QueueDeclareBody*>(g.getBody());
- BOOST_REQUIRE(declare);
- BOOST_CHECK_EQUAL(declare->getAlternateExchange(), "altex");
- BOOST_CHECK_EQUAL(lexical_cast<string>(*f.getBody()), lexical_cast<string>(*g.getBody()));
-}
-
-QPID_AUTO_TEST_CASE(testLoop) {
- // Run in a loop so heap profiler can spot any allocations.
- Buffer b(1024);
- for (int i = 0; i < 100; ++i) {
- Frame ctor(2, AccessRequestOkBody(ProtocolVersion(), 42));
- Frame assign(3);
- assign.body = AccessRequestOkBody(ProtocolVersion(), 42);
- assign.encode(b);
- b.flip();
- Frame g;
- g.decode(b);
- BOOST_REQUIRE(dynamic_cast<AccessRequestOkBody*>(g.getBody())->getTicket() == 42);
- }
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/FramingTest.cpp b/M4-RCs/qpid/cpp/src/tests/FramingTest.cpp
deleted file mode 100644
index f82507c0a7..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/FramingTest.cpp
+++ /dev/null
@@ -1,151 +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 "qpid/client/Connection.h"
-#include "qpid/client/Connector.h"
-#include "qpid/framing/AMQP_HighestVersion.h"
-#include "qpid/framing/ProtocolVersion.h"
-#include "qpid/framing/all_method_bodies.h"
-#include "qpid/framing/amqp_framing.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "unit_test.h"
-
-#include <boost/bind.hpp>
-#include <boost/lexical_cast.hpp>
-#include <iostream>
-
-#include <memory>
-#include <sstream>
-#include <typeinfo>
-
-using namespace qpid;
-using namespace qpid::framing;
-using namespace std;
-
-template <class T>
-std::string tostring(const T& x)
-{
- std::ostringstream out;
- out << x;
- return out.str();
-}
-
-QPID_AUTO_TEST_SUITE(FramingTestSuite)
-
-QPID_AUTO_TEST_CASE(testMessageTransferBody)
-{
- char buffer[1024];
- ProtocolVersion version(highestProtocolVersion);
- Buffer wbuff(buffer, sizeof(buffer));
- MessageTransferBody in(version, "my-exchange", 1, 1);
- in.encode(wbuff);
-
- Buffer rbuff(buffer, sizeof(buffer));
- MessageTransferBody out(version);
- out.decode(rbuff);
- BOOST_CHECK_EQUAL(tostring(in), tostring(out));
-}
-
-QPID_AUTO_TEST_CASE(testConnectionSecureBody)
-{
- char buffer[1024];
- ProtocolVersion version(highestProtocolVersion);
- Buffer wbuff(buffer, sizeof(buffer));
- std::string s = "security credential";
- ConnectionSecureBody in(version, s);
- in.encode(wbuff);
-
- Buffer rbuff(buffer, sizeof(buffer));
- ConnectionSecureBody out(version);
- out.decode(rbuff);
- BOOST_CHECK_EQUAL(tostring(in), tostring(out));
-}
-
-QPID_AUTO_TEST_CASE(testConnectionRedirectBody)
-{
- char buffer[1024];
- ProtocolVersion version(highestProtocolVersion);
- Buffer wbuff(buffer, sizeof(buffer));
- std::string a = "hostA";
- std::string b = "hostB";
- Array hosts(0x95);
- hosts.add(boost::shared_ptr<FieldValue>(new Str16Value(a)));
- hosts.add(boost::shared_ptr<FieldValue>(new Str16Value(b)));
-
- ConnectionRedirectBody in(version, a, hosts);
- in.encode(wbuff);
-
- Buffer rbuff(buffer, sizeof(buffer));
- ConnectionRedirectBody out(version);
- out.decode(rbuff);
- BOOST_CHECK_EQUAL(tostring(in), tostring(out));
-}
-
-QPID_AUTO_TEST_CASE(testQueueDeclareBody)
-{
- char buffer[1024];
- ProtocolVersion version(highestProtocolVersion);
- Buffer wbuff(buffer, sizeof(buffer));
- QueueDeclareBody in(version, "name", "dlq", true, false, true, false, FieldTable());
- in.encode(wbuff);
-
- Buffer rbuff(buffer, sizeof(buffer));
- QueueDeclareBody out(version);
- out.decode(rbuff);
- BOOST_CHECK_EQUAL(tostring(in), tostring(out));
-}
-
-QPID_AUTO_TEST_CASE(testConnectionRedirectBodyFrame)
-{
- char buffer[1024];
- ProtocolVersion version(highestProtocolVersion);
- Buffer wbuff(buffer, sizeof(buffer));
- std::string a = "hostA";
- std::string b = "hostB";
- Array hosts(0x95);
- hosts.add(boost::shared_ptr<FieldValue>(new Str16Value(a)));
- hosts.add(boost::shared_ptr<FieldValue>(new Str16Value(b)));
-
- AMQFrame in(in_place<ConnectionRedirectBody>(version, a, hosts));
- in.setChannel(999);
- in.encode(wbuff);
-
- Buffer rbuff(buffer, sizeof(buffer));
- AMQFrame out;
- out.decode(rbuff);
- BOOST_CHECK_EQUAL(tostring(in), tostring(out));
-}
-
-QPID_AUTO_TEST_CASE(testMessageCancelBodyFrame)
-{
- char buffer[1024];
- ProtocolVersion version(highestProtocolVersion);
- Buffer wbuff(buffer, sizeof(buffer));
- AMQFrame in(in_place<MessageCancelBody>(version, "tag"));
- in.setChannel(999);
- in.encode(wbuff);
-
- Buffer rbuff(buffer, sizeof(buffer));
- AMQFrame out;
- out.decode(rbuff);
- BOOST_CHECK_EQUAL(tostring(in), tostring(out));
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/HeaderTest.cpp b/M4-RCs/qpid/cpp/src/tests/HeaderTest.cpp
deleted file mode 100644
index 33bf705e65..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/HeaderTest.cpp
+++ /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.
- *
- */
-#include <iostream>
-#include "qpid/framing/amqp_framing.h"
-#include "qpid/framing/FieldValue.h"
-#include "unit_test.h"
-
-using namespace qpid::framing;
-using namespace std;
-
-QPID_AUTO_TEST_SUITE(HeaderTestSuite)
-
-QPID_AUTO_TEST_CASE(testGenericProperties)
-{
- AMQHeaderBody body;
- body.get<MessageProperties>(true)->getApplicationHeaders().setString(
- "A", "BCDE");
- char buff[100];
- Buffer wbuffer(buff, 100);
- body.encode(wbuffer);
-
- Buffer rbuffer(buff, 100);
- AMQHeaderBody body2;
- body2.decode(rbuffer, body.encodedSize());
- MessageProperties* props =
- body2.get<MessageProperties>(true);
- BOOST_CHECK_EQUAL(
- string("BCDE"),
- props->getApplicationHeaders().get("A")->get<string>());
-}
-
-QPID_AUTO_TEST_CASE(testMessageProperties)
-{
- AMQFrame out(in_place<AMQHeaderBody>());
- MessageProperties* props1 =
- out.castBody<AMQHeaderBody>()->get<MessageProperties>(true);
-
- props1->setContentLength(42);
- props1->setMessageId(Uuid(true));
- props1->setCorrelationId("correlationId");
- props1->setReplyTo(ReplyTo("ex","key"));
- props1->setContentType("contentType");
- props1->setContentEncoding("contentEncoding");
- props1->setUserId("userId");
- props1->setAppId("appId");
-
- char buff[10000];
- Buffer wbuffer(buff, 10000);
- out.encode(wbuffer);
-
- Buffer rbuffer(buff, 10000);
- AMQFrame in;
- in.decode(rbuffer);
- MessageProperties* props2 =
- in.castBody<AMQHeaderBody>()->get<MessageProperties>(true);
-
- BOOST_CHECK_EQUAL(props1->getContentLength(), props2->getContentLength());
- BOOST_CHECK_EQUAL(props1->getMessageId(), props2->getMessageId());
- BOOST_CHECK_EQUAL(props1->getCorrelationId(), props2->getCorrelationId());
- BOOST_CHECK_EQUAL(props1->getContentType(), props2->getContentType());
- BOOST_CHECK_EQUAL(props1->getContentEncoding(), props2->getContentEncoding());
- BOOST_CHECK_EQUAL(props1->getUserId(), props2->getUserId());
- BOOST_CHECK_EQUAL(props1->getAppId(), props2->getAppId());
-
-}
-
-QPID_AUTO_TEST_CASE(testDeliveryProperies)
-{
- AMQFrame out(in_place<AMQHeaderBody>());
- DeliveryProperties* props1 =
- out.castBody<AMQHeaderBody>()->get<DeliveryProperties>(true);
-
- props1->setDiscardUnroutable(true);
- props1->setExchange("foo");
-
- char buff[10000];
- Buffer wbuffer(buff, 10000);
- out.encode(wbuffer);
-
- Buffer rbuffer(buff, 10000);
- AMQFrame in;
- in.decode(rbuffer);
- DeliveryProperties* props2 =
- in.castBody<AMQHeaderBody>()->get<DeliveryProperties>(true);
-
- BOOST_CHECK(props2->getDiscardUnroutable());
- BOOST_CHECK_EQUAL(string("foo"), props2->getExchange());
- BOOST_CHECK(!props2->hasTimestamp());
-}
-
-QPID_AUTO_TEST_SUITE_END()
-
diff --git a/M4-RCs/qpid/cpp/src/tests/HeadersExchangeTest.cpp b/M4-RCs/qpid/cpp/src/tests/HeadersExchangeTest.cpp
deleted file mode 100644
index 46933f955a..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/HeadersExchangeTest.cpp
+++ /dev/null
@@ -1,115 +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 "qpid/Exception.h"
-#include "qpid/broker/HeadersExchange.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/framing/FieldValue.h"
-#include "unit_test.h"
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-QPID_AUTO_TEST_SUITE(HeadersExchangeTestSuite)
-
-QPID_AUTO_TEST_CASE(testMatchAll)
-{
- FieldTable b, m, n;
- b.setString("x-match", "all");
- b.setString("foo", "FOO");
- b.setInt("n", 42);
- m.setString("foo", "FOO");
- m.setInt("n", 42);
- BOOST_CHECK(HeadersExchange::match(b, m));
-
- // Ignore extras.
- m.setString("extra", "x");
- BOOST_CHECK(HeadersExchange::match(b, m));
-
- // Fail mismatch, wrong value.
- m.setString("foo", "NotFoo");
- BOOST_CHECK(!HeadersExchange::match(b, m));
-
- // Fail mismatch, missing value
- n.setInt("n", 42);
- n.setString("extra", "x");
- BOOST_CHECK(!HeadersExchange::match(b, n));
-}
-
-QPID_AUTO_TEST_CASE(testMatchAny)
-{
- FieldTable b, m, n;
- b.setString("x-match", "any");
- b.setString("foo", "FOO");
- b.setInt("n", 42);
- m.setString("foo", "FOO");
- BOOST_CHECK(!HeadersExchange::match(b, n));
- BOOST_CHECK(HeadersExchange::match(b, m));
- m.setInt("n", 42);
- BOOST_CHECK(HeadersExchange::match(b, m));
-}
-
-QPID_AUTO_TEST_CASE(testMatchEmptyValue)
-{
- FieldTable b, m;
- b.setString("x-match", "all");
- b.set("foo", FieldTable::ValuePtr());
- b.set("n", FieldTable::ValuePtr());
- BOOST_CHECK(!HeadersExchange::match(b, m));
- m.setString("foo", "blah");
- m.setInt("n", 123);
-}
-
-QPID_AUTO_TEST_CASE(testMatchEmptyArgs)
-{
- FieldTable b, m;
- m.setString("foo", "FOO");
-
- b.setString("x-match", "all");
- BOOST_CHECK(HeadersExchange::match(b, m));
- b.setString("x-match", "any");
- BOOST_CHECK(!HeadersExchange::match(b, m));
-}
-
-
-QPID_AUTO_TEST_CASE(testMatchNoXMatch)
-{
- FieldTable b, m;
- b.setString("foo", "FOO");
- m.setString("foo", "FOO");
- BOOST_CHECK(!HeadersExchange::match(b, m));
-}
-
-QPID_AUTO_TEST_CASE(testBindNoXMatch)
-{
- HeadersExchange exchange("test");
- Queue::shared_ptr queue;
- std::string key;
- FieldTable args;
- try {
- //just checking this doesn't cause assertion etc
- exchange.bind(queue, key, &args);
- } catch(qpid::Exception&) {
- //expected
- }
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/IncompleteMessageList.cpp b/M4-RCs/qpid/cpp/src/tests/IncompleteMessageList.cpp
deleted file mode 100644
index 925cdbf43e..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/IncompleteMessageList.cpp
+++ /dev/null
@@ -1,128 +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 <iostream>
-#include <sstream>
-#include "qpid/broker/Message.h"
-#include "qpid/broker/NullMessageStore.h"
-#include "qpid/broker/Queue.h"
-#include "qpid/broker/IncompleteMessageList.h"
-
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(IncompleteMessageListTestSuite)
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-struct Checker
-{
- std::list<SequenceNumber> ids;
-
- Checker() { }
-
- Checker(uint start, uint end) {
- for (uint i = start; i <= end; i++) {
- ids.push_back(i);
- }
- }
-
- Checker& expect(const SequenceNumber& id) {
- ids.push_back(id);
- return *this;
- }
-
- void operator()(boost::intrusive_ptr<Message> msg) {
- BOOST_CHECK(!ids.empty());
- BOOST_CHECK_EQUAL(msg->getCommandId(), ids.front());
- ids.pop_front();
- }
-};
-
-QPID_AUTO_TEST_CASE(testProcessSimple)
-{
- IncompleteMessageList list;
- SequenceNumber counter(1);
- //fill up list with messages
- for (int i = 0; i < 5; i++) {
- boost::intrusive_ptr<Message> msg(new Message(counter++));
- list.add(msg);
- }
- //process and ensure they are all passed to completion listener
- list.process(Checker(1, 5), false);
- //process again and ensure none are resent to listener
- list.process(Checker(), false);
-}
-
-QPID_AUTO_TEST_CASE(testProcessWithIncomplete)
-{
- IncompleteMessageList list;
- SequenceNumber counter(1);
- boost::intrusive_ptr<Message> middle;
- //fill up list with messages
- for (int i = 0; i < 5; i++) {
- boost::intrusive_ptr<Message> msg(new Message(counter++));
- list.add(msg);
- if (i == 2) {
- //mark a message in the middle as incomplete
- msg->enqueueAsync();
- middle = msg;
- }
- }
- //process and ensure only message upto incomplete message are passed to listener
- list.process(Checker(1, 2), false);
- //mark message complete and re-process to get remaining messages sent to listener
- middle->enqueueComplete();
- list.process(Checker(3, 5), false);
-}
-
-
-struct MockStore : public NullMessageStore
-{
- Queue::shared_ptr queue;
- boost::intrusive_ptr<Message> msg;
-
- void flush(const qpid::broker::PersistableQueue& q) {
- BOOST_CHECK_EQUAL(queue.get(), &q);
- msg->enqueueComplete();
- }
-};
-
-QPID_AUTO_TEST_CASE(testSyncProcessWithIncomplete)
-{
- IncompleteMessageList list;
- SequenceNumber counter(1);
- MockStore store;
- store.queue = Queue::shared_ptr(new Queue("mock-queue"));
- //fill up list with messages
- for (int i = 0; i < 5; i++) {
- boost::intrusive_ptr<Message> msg(new Message(counter++));
- list.add(msg);
- if (i == 2) {
- //mark a message in the middle as incomplete
- msg->enqueueAsync(store.queue, &store);
- store.msg = msg;
- }
- }
- //process with sync bit specified and ensure that all messages are passed to listener
- list.process(Checker(1, 5), true);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/InlineAllocator.cpp b/M4-RCs/qpid/cpp/src/tests/InlineAllocator.cpp
deleted file mode 100644
index fe6eaefaf4..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/InlineAllocator.cpp
+++ /dev/null
@@ -1,63 +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 "qpid/InlineAllocator.h"
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(InlineAllocatorTestSuite)
-
-using namespace qpid;
-using namespace std;
-
-QPID_AUTO_TEST_CASE(testAllocate) {
- InlineAllocator<std::allocator<char>, 2> alloc;
-
- char* p = alloc.allocate(1);
- BOOST_CHECK(p == (char*)&alloc);
- alloc.deallocate(p,1);
-
- p = alloc.allocate(2);
- BOOST_CHECK(p == (char*)&alloc);
- alloc.deallocate(p,2);
-
- p = alloc.allocate(3);
- BOOST_CHECK(p != (char*)&alloc);
- alloc.deallocate(p,3);
-}
-
-QPID_AUTO_TEST_CASE(testAllocateFull) {
- InlineAllocator<std::allocator<char>, 1> alloc;
-
- char* p = alloc.allocate(1);
- BOOST_CHECK(p == (char*)&alloc);
-
- char* q = alloc.allocate(1);
- BOOST_CHECK(q != (char*)&alloc);
-
- alloc.deallocate(p,1);
- p = alloc.allocate(1);
- BOOST_CHECK(p == (char*)&alloc);
-
- alloc.deallocate(p,1);
- alloc.deallocate(q,1);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/InlineVector.cpp b/M4-RCs/qpid/cpp/src/tests/InlineVector.cpp
deleted file mode 100644
index bcd36e47b4..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/InlineVector.cpp
+++ /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.
- *
- */
-
-#include "qpid/InlineVector.h"
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(InlineVectorTestSuite)
-
-using namespace qpid;
-using namespace std;
-
-typedef InlineVector<int, 3> Vec;
-
-bool isInline(const Vec& v) {
- return (const char*)&v <= (const char*)(&v[0]) &&
- (const char*)(&v[0]) < (const char*)&v+sizeof(v);
-}
-
-QPID_AUTO_TEST_CASE(testCtor) {
- {
- Vec v;
- BOOST_CHECK(isInline(v));
- BOOST_CHECK(v.empty());
- }
- {
- Vec v(3, 42);
- BOOST_CHECK(isInline(v));
- BOOST_CHECK_EQUAL(3u, v.size());
- BOOST_CHECK_EQUAL(v[0], 42);
- BOOST_CHECK_EQUAL(v[2], 42);
-
- Vec u(v);
- BOOST_CHECK(isInline(u));
- BOOST_CHECK_EQUAL(3u, u.size());
- BOOST_CHECK_EQUAL(u[0], 42);
- BOOST_CHECK_EQUAL(u[2], 42);
- }
-
- {
- Vec v(4, 42);
-
- BOOST_CHECK_EQUAL(v.size(), 4u);
- BOOST_CHECK(!isInline(v));
- Vec u(v);
- BOOST_CHECK_EQUAL(u.size(), 4u);
- BOOST_CHECK(!isInline(u));
- }
-}
-
-QPID_AUTO_TEST_CASE(testInsert) {
- {
- Vec v;
- v.push_back(1);
- BOOST_CHECK_EQUAL(v.size(), 1u);
- BOOST_CHECK_EQUAL(v.back(), 1);
- BOOST_CHECK(isInline(v));
-
- v.insert(v.begin(), 2);
- BOOST_CHECK_EQUAL(v.size(), 2u);
- BOOST_CHECK_EQUAL(v.back(), 1);
- BOOST_CHECK(isInline(v));
-
- v.push_back(3);
- BOOST_CHECK(isInline(v));
-
- v.push_back(4);
-
- BOOST_CHECK(!isInline(v));
- }
- {
- Vec v(3,42);
- v.insert(v.begin(), 9);
- BOOST_CHECK_EQUAL(v.size(), 4u);
- BOOST_CHECK(!isInline(v));
- }
- {
- Vec v(3,42);
- v.insert(v.begin()+1, 9);
- BOOST_CHECK(!isInline(v));
- BOOST_CHECK_EQUAL(v.size(), 4u);
- }
-}
-
-QPID_AUTO_TEST_CASE(testAssign) {
- Vec v(3,42);
- Vec u;
- u = v;
- BOOST_CHECK(isInline(u));
- u.push_back(4);
- BOOST_CHECK(!isInline(u));
- v = u;
- BOOST_CHECK(!isInline(v));
-}
-
-QPID_AUTO_TEST_CASE(testResize) {
- Vec v;
- v.resize(5);
- BOOST_CHECK(!isInline(v));
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/Makefile.am b/M4-RCs/qpid/cpp/src/tests/Makefile.am
deleted file mode 100644
index 3a608b2bae..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/Makefile.am
+++ /dev/null
@@ -1,245 +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.
-#
-
-AM_CXXFLAGS = $(WARNING_CFLAGS) -DBOOST_TEST_DYN_LINK
-INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../gen -I$(top_builddir)/src/gen
-
-abs_builddir=@abs_builddir@
-extra_libs =
-lib_client = $(abs_builddir)/../libqpidclient.la
-lib_common = $(abs_builddir)/../libqpidcommon.la
-lib_broker = $(abs_builddir)/../libqpidbroker.la
-lib_console = $(abs_builddir)/../libqmfconsole.la
-# lib_amqp_0_10 = $(abs_builddir)/../libqpidamqp_0_10.la
-
-#
-# Initialize variables that are incremented with +=
-#
-check_PROGRAMS=
-check_LTLIBRARIES=
-TESTS=
-EXTRA_DIST=
-CLEANFILES=
-
-#
-# Unit test program
-#
-# Unit tests are built as a single program to reduce valgrind overhead
-# when running the tests. If you want to build a subset of the tests do
-# rm -f unit_test; make unit_test unit_test_OBJECTS="unit_test.o SelectedTest.o"
-#
-
-TESTS+=unit_test
-check_PROGRAMS+=unit_test
-unit_test_LDADD=-lboost_unit_test_framework -lboost_regex \
- $(lib_client) $(lib_broker) $(lib_console)
-
-unit_test_SOURCES= unit_test.cpp unit_test.h \
- BrokerFixture.h SocketProxy.h \
- exception_test.cpp \
- RefCounted.cpp \
- SessionState.cpp Blob.cpp logging.cpp \
- AsyncCompletion.cpp \
- Url.cpp Uuid.cpp \
- Shlib.cpp FieldValue.cpp FieldTable.cpp Array.cpp \
- QueueOptionsTest.cpp \
- InlineAllocator.cpp \
- InlineVector.cpp \
- ClientSessionTest.cpp \
- SequenceSet.cpp \
- StringUtils.cpp \
- IncompleteMessageList.cpp \
- RangeSet.cpp \
- AtomicValue.cpp \
- QueueTest.cpp \
- AccumulatedAckTest.cpp \
- DtxWorkRecordTest.cpp \
- DeliveryRecordTest.cpp \
- ExchangeTest.cpp \
- HeadersExchangeTest.cpp \
- MessageTest.cpp \
- QueueRegistryTest.cpp \
- QueuePolicyTest.cpp \
- FramingTest.cpp \
- HeaderTest.cpp \
- SequenceNumberTest.cpp \
- TimerTest.cpp \
- TopicExchangeTest.cpp \
- TxBufferTest.cpp \
- TxPublishTest.cpp \
- MessageBuilderTest.cpp \
- ConnectionOptions.h \
- ForkedBroker.h \
- ManagementTest.cpp \
- MessageReplayTracker.cpp \
- ConsoleTest.cpp
-
-if HAVE_XML
-unit_test_SOURCES+= XmlClientSessionTest.cpp
-endif
-
-
-# Disabled till we move to amqp_0_10 codec.
-# amqp_0_10/serialize.cpp allSegmentTypes.h \
-# amqp_0_10/ProxyTemplate.cpp \
-# amqp_0_10/apply.cpp \
-# amqp_0_10/Map.cpp \
-# amqp_0_10/handlers.cpp
-
-
-check_LTLIBRARIES += libshlibtest.la
-libshlibtest_la_LDFLAGS = -module -rpath $(abs_builddir)
-libshlibtest_la_SOURCES = shlibtest.cpp
-
-include cluster.mk
-if SSL
-include ssl.mk
-endif
-
-#
-# Other test programs
-#
-check_PROGRAMS+=perftest
-perftest_SOURCES=perftest.cpp test_tools.h TestOptions.h ConnectionOptions.h
-perftest_LDADD=$(lib_client)
-
-check_PROGRAMS+=txtest
-txtest_SOURCES=txtest.cpp TestOptions.h ConnectionOptions.h
-txtest_LDADD=$(lib_client)
-
-check_PROGRAMS+=latencytest
-latencytest_SOURCES=latencytest.cpp TestOptions.h ConnectionOptions.h
-latencytest_LDADD=$(lib_client)
-
-check_PROGRAMS+=echotest
-echotest_SOURCES=echotest.cpp TestOptions.h ConnectionOptions.h
-echotest_LDADD=$(lib_client)
-
-check_PROGRAMS+=client_test
-client_test_SOURCES=client_test.cpp TestOptions.h ConnectionOptions.h
-client_test_LDADD=$(lib_client)
-
-check_PROGRAMS+=topic_listener
-topic_listener_SOURCES=topic_listener.cpp TestOptions.h ConnectionOptions.h
-topic_listener_LDADD=$(lib_client)
-
-check_PROGRAMS+=topic_publisher
-topic_publisher_SOURCES=topic_publisher.cpp TestOptions.h ConnectionOptions.h
-topic_publisher_LDADD=$(lib_client)
-
-check_PROGRAMS+=publish
-publish_SOURCES=publish.cpp TestOptions.h ConnectionOptions.h
-publish_LDADD=$(lib_client)
-
-check_PROGRAMS+=consume
-consume_SOURCES=consume.cpp TestOptions.h ConnectionOptions.h
-consume_LDADD=$(lib_client)
-
-check_PROGRAMS+=header_test
-header_test_SOURCES=header_test.cpp TestOptions.h ConnectionOptions.h
-header_test_LDADD=$(lib_client)
-
-check_PROGRAMS+=failover_soak
-failover_soak_SOURCES=failover_soak.cpp ForkedBroker.h
-failover_soak_LDADD=$(lib_client)
-
-check_PROGRAMS+=declare_queues
-declare_queues_SOURCES=declare_queues.cpp
-declare_queues_LDADD=$(lib_client)
-
-check_PROGRAMS+=replaying_sender
-replaying_sender_SOURCES=replaying_sender.cpp
-replaying_sender_LDADD=$(lib_client)
-
-check_PROGRAMS+=resuming_receiver
-resuming_receiver_SOURCES=resuming_receiver.cpp
-resuming_receiver_LDADD=$(lib_client)
-
-check_PROGRAMS+=txshift
-txshift_SOURCES=txshift.cpp TestOptions.h ConnectionOptions.h
-txshift_LDADD=$(lib_client)
-
-check_PROGRAMS+=txjob
-txjob_SOURCES=txjob.cpp TestOptions.h ConnectionOptions.h
-txjob_LDADD=$(lib_client)
-
-check_PROGRAMS+=receiver
-receiver_SOURCES=receiver.cpp TestOptions.h ConnectionOptions.h
-receiver_LDADD=$(lib_client)
-
-check_PROGRAMS+=sender
-sender_SOURCES=sender.cpp TestOptions.h ConnectionOptions.h
-sender_LDADD=$(lib_client)
-
-
-TESTS_ENVIRONMENT = VALGRIND=$(VALGRIND) srcdir=$(srcdir) QPID_DATA_DIR= BOOST_TEST_SHOW_PROGRESS=yes $(srcdir)/run_test
-
-system_tests = client_test quick_perftest quick_topictest run_header_test quick_txtest
-TESTS += start_broker $(system_tests) python_tests stop_broker run_federation_tests run_acl_tests
-
-EXTRA_DIST += \
- run_test vg_check \
- run-unit-tests start_broker python_tests stop_broker \
- quick_topictest \
- quick_perftest \
- quick_txtest \
- topictest \
- run_header_test \
- header_test.py \
- ssl_test \
- config.null \
- ais_check \
- run_federation_tests \
- run_acl_tests \
- .valgrind.supp \
- MessageUtils.h \
- TestMessageStore.h \
- TxMocks.h \
- start_cluster stop_cluster restart_cluster
-
-check_LTLIBRARIES += libdlclose_noop.la
-libdlclose_noop_la_LDFLAGS = -module -rpath $(abs_builddir)
-libdlclose_noop_la_SOURCES = dlclose_noop.c
-
-CLEANFILES+=valgrind.out *.log *.vglog* dummy_test $(unit_wrappers)
-
-# FIXME aconway 2008-05-23: Disabled interop_runner because it uses
-# the obsolete Channel class. Convert to Session and re-enable.
-#
-# check_PROGRAMS += interop_runner
-
-# interop_runner_SOURCES = \
-# interop_runner.cpp \
-# SimpleTestCaseBase.cpp \
-# BasicP2PTest.cpp \
-# BasicPubSubTest.cpp \
-# SimpleTestCaseBase.h \
-# BasicP2PTest.h \
-# BasicPubSubTest.h \
-# TestCase.h \
-# TestOptions.h ConnectionOptions.h
-# interop_runner_LDADD = $(lib_client) $(lib_common) $(extra_libs)
-
-
-# Longer running stability tests, not run by default check: target.
-# Not run under valgrind, too slow
-LONG_TESTS=fanout_perftest shared_perftest multiq_perftest topic_perftest run_failover_soak
-EXTRA_DIST+=$(LONG_TESTS) run_perftest
-check-long:
- $(MAKE) check TESTS="start_broker $(LONG_TESTS) stop_broker" VALGRIND=
diff --git a/M4-RCs/qpid/cpp/src/tests/ManagementTest.cpp b/M4-RCs/qpid/cpp/src/tests/ManagementTest.cpp
deleted file mode 100644
index a3d29ec22c..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/ManagementTest.cpp
+++ /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.
- *
- */
-
-#include "qpid/management/ManagementObject.h"
-#include "qpid/framing/Buffer.h"
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(ManagementTestSuite)
-
-using namespace qpid::framing;
-using namespace qpid::management;
-
-QPID_AUTO_TEST_CASE(testObjectIdSerializeStream) {
- std::string text("0-10-4-2500-80000000000");
- std::stringstream input(text);
-
- ObjectId oid(input);
-
- std::stringstream output;
- output << oid;
-
- BOOST_CHECK_EQUAL(text, output.str());
-}
-
-QPID_AUTO_TEST_CASE(testObjectIdSerializeString) {
- std::string text("0-10-4-2500-80000000000");
-
- ObjectId oid(text);
-
- std::stringstream output;
- output << oid;
-
- BOOST_CHECK_EQUAL(text, output.str());
-}
-
-QPID_AUTO_TEST_CASE(testObjectIdEncode) {
- char buffer[100];
- Buffer msgBuf(buffer, 100);
- msgBuf.putLongLong(0x1002000030000004LL);
- msgBuf.putLongLong(0x0000000000000005LL);
- msgBuf.reset();
-
- ObjectId oid(msgBuf);
-
- std::stringstream out1;
- out1 << oid;
-
- BOOST_CHECK_EQUAL(out1.str(), "1-2-3-4-5");
-}
-
-QPID_AUTO_TEST_CASE(testObjectIdAttach) {
- AgentAttachment agent;
- ObjectId oid(&agent, 10, 20, 50);
-
- std::stringstream out1;
- out1 << oid;
- BOOST_CHECK_EQUAL(out1.str(), "10-20-0-0-50");
-
- agent.setBanks(30, 40);
- std::stringstream out2;
- out2 << oid;
- BOOST_CHECK_EQUAL(out2.str(), "10-20-30-40-50");
-}
-
-QPID_AUTO_TEST_SUITE_END()
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/MessageBuilderTest.cpp b/M4-RCs/qpid/cpp/src/tests/MessageBuilderTest.cpp
deleted file mode 100644
index 313a91c053..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/MessageBuilderTest.cpp
+++ /dev/null
@@ -1,224 +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 "qpid/broker/Message.h"
-#include "qpid/broker/MessageBuilder.h"
-#include "qpid/broker/NullMessageStore.h"
-#include "qpid/framing/frame_functors.h"
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/framing/TypeFilter.h"
-#include "unit_test.h"
-#include <list>
-
-using namespace boost;
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-class MockMessageStore : public NullMessageStore
-{
- enum Op {STAGE=1, APPEND=2};
-
- uint64_t id;
- intrusive_ptr<PersistableMessage> expectedMsg;
- string expectedData;
- std::list<Op> ops;
-
- void checkExpectation(Op actual)
- {
- BOOST_CHECK_EQUAL(ops.front(), actual);
- ops.pop_front();
- }
-
- public:
- MockMessageStore() : id(0), expectedMsg(0) {}
-
- void expectStage(PersistableMessage& msg)
- {
- expectedMsg = &msg;
- ops.push_back(STAGE);
- }
-
- void expectAppendContent(PersistableMessage& msg, const string& data)
- {
- expectedMsg = &msg;
- expectedData = data;
- ops.push_back(APPEND);
- }
-
- void stage(const intrusive_ptr<PersistableMessage>& msg)
- {
- checkExpectation(STAGE);
- BOOST_CHECK_EQUAL(expectedMsg, msg);
- msg->setPersistenceId(++id);
- }
-
- void appendContent(const intrusive_ptr<const PersistableMessage>& msg,
- const string& data)
- {
- checkExpectation(APPEND);
- BOOST_CHECK_EQUAL(static_pointer_cast<const PersistableMessage>(expectedMsg), msg);
- BOOST_CHECK_EQUAL(expectedData, data);
- }
-
- bool expectationsMet()
- {
- return ops.empty();
- }
-
- //don't treat this store as a null impl
- bool isNull() const
- {
- return false;
- }
-
-};
-
-QPID_AUTO_TEST_SUITE(MessageBuilderTestSuite)
-
-QPID_AUTO_TEST_CASE(testHeaderOnly)
-{
- MessageBuilder builder(0, 0);
- builder.start(SequenceNumber());
-
- std::string exchange("builder-exchange");
- std::string key("builder-exchange");
-
- AMQFrame method(in_place<MessageTransferBody>(
- ProtocolVersion(), exchange, 0, 0));
- AMQFrame header(in_place<AMQHeaderBody>());
-
- header.castBody<AMQHeaderBody>()->get<MessageProperties>(true)->setContentLength(0);
- header.castBody<AMQHeaderBody>()->get<DeliveryProperties>(true)->setRoutingKey(key);
-
- builder.handle(method);
- builder.handle(header);
-
- BOOST_CHECK(builder.getMessage());
- BOOST_CHECK_EQUAL(exchange, builder.getMessage()->getExchangeName());
- BOOST_CHECK_EQUAL(key, builder.getMessage()->getRoutingKey());
- BOOST_CHECK(builder.getMessage()->getFrames().isComplete());
-}
-
-QPID_AUTO_TEST_CASE(test1ContentFrame)
-{
- MessageBuilder builder(0, 0);
- builder.start(SequenceNumber());
-
- std::string data("abcdefg");
- std::string exchange("builder-exchange");
- std::string key("builder-exchange");
-
- AMQFrame method(in_place<MessageTransferBody>(ProtocolVersion(), exchange, 0, 0));
- AMQFrame header(in_place<AMQHeaderBody>());
- AMQFrame content(in_place<AMQContentBody>(data));
- method.setEof(false);
- header.setBof(false);
- header.setEof(false);
- content.setBof(false);
-
- header.castBody<AMQHeaderBody>()->get<MessageProperties>(true)->setContentLength(data.size());
- header.castBody<AMQHeaderBody>()->get<DeliveryProperties>(true)->setRoutingKey(key);
-
- builder.handle(method);
- BOOST_CHECK(builder.getMessage());
- BOOST_CHECK(!builder.getMessage()->getFrames().isComplete());
-
- builder.handle(header);
- BOOST_CHECK(builder.getMessage());
- BOOST_CHECK(!builder.getMessage()->getFrames().isComplete());
-
- builder.handle(content);
- BOOST_CHECK(builder.getMessage());
- BOOST_CHECK(builder.getMessage()->getFrames().isComplete());
-}
-
-QPID_AUTO_TEST_CASE(test2ContentFrames)
-{
- MessageBuilder builder(0, 0);
- builder.start(SequenceNumber());
-
- std::string data1("abcdefg");
- std::string data2("hijklmn");
- std::string exchange("builder-exchange");
- std::string key("builder-exchange");
-
- AMQFrame method(in_place<MessageTransferBody>(
- ProtocolVersion(), exchange, 0, 0));
- AMQFrame header(in_place<AMQHeaderBody>());
- AMQFrame content1(in_place<AMQContentBody>(data1));
- AMQFrame content2(in_place<AMQContentBody>(data2));
- method.setEof(false);
- header.setBof(false);
- header.setEof(false);
- content1.setBof(false);
- content1.setEof(false);
- content2.setBof(false);
-
- header.castBody<AMQHeaderBody>()->get<MessageProperties>(true)->setContentLength(data1.size() + data2.size());
- header.castBody<AMQHeaderBody>()->get<DeliveryProperties>(true)->setRoutingKey(key);
-
- builder.handle(method);
- builder.handle(header);
- builder.handle(content1);
- BOOST_CHECK(builder.getMessage());
- BOOST_CHECK(!builder.getMessage()->getFrames().isComplete());
-
- builder.handle(content2);
- BOOST_CHECK(builder.getMessage());
- BOOST_CHECK(builder.getMessage()->getFrames().isComplete());
-}
-
-QPID_AUTO_TEST_CASE(testStaging)
-{
- MockMessageStore store;
- MessageBuilder builder(&store, 5);
- builder.start(SequenceNumber());
-
- std::string data1("abcdefg");
- std::string data2("hijklmn");
- std::string exchange("builder-exchange");
- std::string key("builder-exchange");
-
- AMQFrame method(in_place<MessageTransferBody>(
- ProtocolVersion(), exchange, 0, 0));
- AMQFrame header(in_place<AMQHeaderBody>());
- AMQFrame content1(in_place<AMQContentBody>(data1));
- AMQFrame content2(in_place<AMQContentBody>(data2));
-
- header.castBody<AMQHeaderBody>()->get<MessageProperties>(true)->setContentLength(data1.size() + data2.size());
- header.castBody<AMQHeaderBody>()->get<DeliveryProperties>(true)->setRoutingKey(key);
-
- builder.handle(method);
- builder.handle(header);
-
- store.expectStage(*builder.getMessage());
- builder.handle(content1);
- BOOST_CHECK(store.expectationsMet());
- BOOST_CHECK_EQUAL((uint64_t) 1, builder.getMessage()->getPersistenceId());
-
- store.expectAppendContent(*builder.getMessage(), data2);
- builder.handle(content2);
- BOOST_CHECK(store.expectationsMet());
- //were the content frames dropped?
- BOOST_CHECK(!builder.getMessage()->isContentLoaded());
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/MessageReplayTracker.cpp b/M4-RCs/qpid/cpp/src/tests/MessageReplayTracker.cpp
deleted file mode 100644
index a5121cdeb7..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/MessageReplayTracker.cpp
+++ /dev/null
@@ -1,99 +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 "unit_test.h"
-#include "BrokerFixture.h"
-#include "qpid/client/MessageReplayTracker.h"
-#include "qpid/sys/Time.h"
-
-QPID_AUTO_TEST_SUITE(MessageReplayTrackerTests)
-
-using namespace qpid::client;
-using namespace qpid::sys;
-using std::string;
-
-class ReplayBufferChecker
-{
- public:
-
- ReplayBufferChecker(uint from, uint to) : end(to), i(from) {}
-
- void operator()(const Message& m)
- {
- if (i > end) BOOST_FAIL("Extra message found: " + m.getData());
- BOOST_CHECK_EQUAL((boost::format("Message_%1%") % (i++)).str(), m.getData());
- }
- private:
- const uint end;
- uint i;
-
-};
-
-QPID_AUTO_TEST_CASE(testReplay)
-{
- ProxySessionFixture fix;
- fix.session.queueDeclare(arg::queue="my-queue", arg::exclusive=true, arg::autoDelete=true);
-
- MessageReplayTracker tracker(10);
- tracker.init(fix.session);
- for (uint i = 0; i < 5; i++) {
- Message message((boost::format("Message_%1%") % (i+1)).str(), "my-queue");
- tracker.send(message);
- }
- ReplayBufferChecker checker(1, 10);
- tracker.foreach(checker);
-
- tracker.replay(fix.session);
- for (uint j = 0; j < 2; j++) {//each message should have been sent twice
- for (uint i = 0; i < 5; i++) {
- Message m;
- BOOST_CHECK(fix.subs.get(m, "my-queue", TIME_SEC));
- BOOST_CHECK_EQUAL((boost::format("Message_%1%") % (i+1)).str(), m.getData());
- }
- }
- Message m;
- BOOST_CHECK(!fix.subs.get(m, "my-queue"));
-}
-
-QPID_AUTO_TEST_CASE(testCheckCompletion)
-{
- ProxySessionFixture fix;
- fix.session.queueDeclare(arg::queue="my-queue", arg::exclusive=true, arg::autoDelete=true);
-
- MessageReplayTracker tracker(10);
- tracker.init(fix.session);
- for (uint i = 0; i < 5; i++) {
- Message message((boost::format("Message_%1%") % (i+1)).str(), "my-queue");
- tracker.send(message);
- }
- fix.session.sync();//ensures all messages are complete
- tracker.checkCompletion();
- tracker.replay(fix.session);
- Message received;
- for (uint i = 0; i < 5; i++) {
- BOOST_CHECK(fix.subs.get(received, "my-queue"));
- BOOST_CHECK_EQUAL((boost::format("Message_%1%") % (i+1)).str(), received.getData());
- }
- BOOST_CHECK(!fix.subs.get(received, "my-queue"));
-}
-
-QPID_AUTO_TEST_SUITE_END()
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/MessageTest.cpp b/M4-RCs/qpid/cpp/src/tests/MessageTest.cpp
deleted file mode 100644
index f9292ee53e..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/MessageTest.cpp
+++ /dev/null
@@ -1,90 +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 "qpid/broker/Message.h"
-#include "qpid/framing/AMQP_HighestVersion.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/framing/FieldValue.h"
-#include "qpid/framing/Uuid.h"
-
-#include "unit_test.h"
-
-#include <iostream>
-#include <alloca.h>
-
-using namespace boost;
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-QPID_AUTO_TEST_SUITE(MessageTestSuite)
-
-QPID_AUTO_TEST_CASE(testEncodeDecode)
-{
- string exchange = "MyExchange";
- string routingKey = "MyRoutingKey";
- Uuid messageId(true);
- string data1("abcdefg");
- string data2("hijklmn");
-
- intrusive_ptr<Message> msg(new Message());
-
- AMQFrame method(in_place<MessageTransferBody>(
- ProtocolVersion(), exchange, 0, 0));
- AMQFrame header(in_place<AMQHeaderBody>());
- AMQFrame content1(in_place<AMQContentBody>(data1));
- AMQFrame content2(in_place<AMQContentBody>(data2));
-
- msg->getFrames().append(method);
- msg->getFrames().append(header);
- msg->getFrames().append(content1);
- msg->getFrames().append(content2);
-
- MessageProperties* mProps = msg->getFrames().getHeaders()->get<MessageProperties>(true);
- mProps->setContentLength(data1.size() + data2.size());
- mProps->setMessageId(messageId);
- FieldTable applicationHeaders;
- applicationHeaders.setString("abc", "xyz");
- mProps->setApplicationHeaders(applicationHeaders);
- DeliveryProperties* dProps = msg->getFrames().getHeaders()->get<DeliveryProperties>(true);
- dProps->setRoutingKey(routingKey);
- dProps->setDeliveryMode(PERSISTENT);
- BOOST_CHECK(msg->isPersistent());
-
- char* buff = static_cast<char*>(::alloca(msg->encodedSize()));
- Buffer wbuffer(buff, msg->encodedSize());
- msg->encode(wbuffer);
-
- Buffer rbuffer(buff, msg->encodedSize());
- msg = new Message();
- msg->decodeHeader(rbuffer);
- msg->decodeContent(rbuffer);
- BOOST_CHECK_EQUAL(exchange, msg->getExchangeName());
- BOOST_CHECK_EQUAL(routingKey, msg->getRoutingKey());
- BOOST_CHECK_EQUAL((uint64_t) data1.size() + data2.size(), msg->contentSize());
- BOOST_CHECK_EQUAL((uint64_t) data1.size() + data2.size(), msg->getProperties<MessageProperties>()->getContentLength());
- BOOST_CHECK_EQUAL(messageId, msg->getProperties<MessageProperties>()->getMessageId());
- BOOST_CHECK_EQUAL(string("xyz"), msg->getProperties<MessageProperties>()->getApplicationHeaders().getAsString("abc"));
- BOOST_CHECK_EQUAL((uint8_t) PERSISTENT, msg->getProperties<DeliveryProperties>()->getDeliveryMode());
- BOOST_CHECK(msg->isPersistent());
-}
-
-QPID_AUTO_TEST_SUITE_END()
-
diff --git a/M4-RCs/qpid/cpp/src/tests/MessageUtils.h b/M4-RCs/qpid/cpp/src/tests/MessageUtils.h
deleted file mode 100644
index 81508e534e..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/MessageUtils.h
+++ /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.
- *
- */
-
-#include "qpid/broker/Message.h"
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/framing/Uuid.h"
-
-using namespace qpid;
-using namespace broker;
-using namespace framing;
-
-struct MessageUtils
-{
- static boost::intrusive_ptr<Message> createMessage(const string& exchange="", const string& routingKey="",
- const Uuid& messageId=Uuid(true), uint64_t contentSize = 0)
- {
- boost::intrusive_ptr<Message> msg(new Message());
-
- AMQFrame method(in_place<MessageTransferBody>(ProtocolVersion(), exchange, 0, 0));
- AMQFrame header(in_place<AMQHeaderBody>());
-
- msg->getFrames().append(method);
- msg->getFrames().append(header);
- MessageProperties* props = msg->getFrames().getHeaders()->get<MessageProperties>(true);
- props->setContentLength(contentSize);
- props->setMessageId(messageId);
- msg->getFrames().getHeaders()->get<DeliveryProperties>(true)->setRoutingKey(routingKey);
- return msg;
- }
-
- static void addContent(boost::intrusive_ptr<Message> msg, const string& data)
- {
- AMQFrame content(in_place<AMQContentBody>(data));
- msg->getFrames().append(content);
- }
-};
diff --git a/M4-RCs/qpid/cpp/src/tests/PollerTest.cpp b/M4-RCs/qpid/cpp/src/tests/PollerTest.cpp
deleted file mode 100644
index fcb1d0dadf..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/PollerTest.cpp
+++ /dev/null
@@ -1,164 +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.
- *
- */
-
-/**
- * Use socketpair to test the poller
- */
-
-#include "qpid/sys/Poller.h"
-
-#include <string>
-#include <iostream>
-#include <memory>
-#include <exception>
-
-#include <assert.h>
-
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-
-using namespace std;
-using namespace qpid::sys;
-
-int writeALot(int fd, const string& s) {
- int bytesWritten = 0;
- do {
- errno = 0;
- int lastWrite = ::write(fd, s.c_str(), s.size());
- if ( lastWrite >= 0) {
- bytesWritten += lastWrite;
- }
- } while (errno != EAGAIN);
- return bytesWritten;
-}
-
-int readALot(int fd) {
- int bytesRead = 0;
- char buf[1024];
-
- do {
- errno = 0;
- int lastRead = ::read(fd, buf, sizeof(buf));
- if ( lastRead >= 0) {
- bytesRead += lastRead;
- }
- } while (errno != EAGAIN);
- return bytesRead;
-}
-
-int main(int argc, char** argv)
-{
- try
- {
- int sv[2];
- int rc = ::socketpair(AF_LOCAL, SOCK_STREAM, 0, sv);
- assert(rc >= 0);
-
- // Set non-blocking
- rc = ::fcntl(sv[0], F_SETFL, O_NONBLOCK);
- assert(rc >= 0);
-
- rc = ::fcntl(sv[1], F_SETFL, O_NONBLOCK);
- assert(rc >= 0);
-
- // Make up a large string
- string testString = "This is only a test ... 1,2,3,4,5,6,7,8,9,10;";
- for (int i = 0; i < 6; i++)
- testString += testString;
-
- // Read as much as we can from socket 0
- int bytesRead = readALot(sv[0]);
- assert(bytesRead == 0);
- cout << "Read(0): " << bytesRead << " bytes\n";
-
- // Write as much as we can to socket 0
- int bytesWritten = writeALot(sv[0], testString);
- cout << "Wrote(0): " << bytesWritten << " bytes\n";
-
- // Read as much as we can from socket 1
- bytesRead = readALot(sv[1]);
- assert(bytesRead == bytesWritten);
- cout << "Read(1): " << bytesRead << " bytes\n";
-
- auto_ptr<Poller> poller(new Poller);
-
- PollerHandle h0(sv[0]);
- PollerHandle h1(sv[1]);
-
- poller->addFd(h0, Poller::INOUT);
-
- // Wait for 500ms - h0 should be writable
- Poller::Event event = poller->wait();
- assert(event.handle == &h0);
- assert(event.dir == Poller::OUT);
-
- // Write as much as we can to socket 0
- bytesWritten = writeALot(sv[0], testString);
- cout << "Wrote(0): " << bytesWritten << " bytes\n";
-
- // Wait for 500ms - h0 no longer writable
- poller->rearmFd(h0);
- event = poller->wait(500000000);
- assert(event.handle == 0);
-
- // Test we can read it all now
- poller->addFd(h1, Poller::INOUT);
- event = poller->wait();
- assert(event.handle == &h1);
- assert(event.dir == Poller::INOUT);
-
- bytesRead = readALot(sv[1]);
- assert(bytesRead == bytesWritten);
- cout << "Read(1): " << bytesRead << " bytes\n";
-
- // At this point h1 should have been disabled from the poller
- // (as it was just returned) and h0 can write again
- event = poller->wait();
- assert(event.handle == &h0);
- assert(event.dir == Poller::OUT);
-
- // Now both the handles should be disabled
- event = poller->wait(500000000);
- assert(event.handle == 0);
-
- // Test shutdown
- poller->shutdown();
- event = poller->wait();
- assert(event.handle == 0);
- assert(event.dir == Poller::SHUTDOWN);
-
- event = poller->wait();
- assert(event.handle == 0);
- assert(event.dir == Poller::SHUTDOWN);
-
- poller->delFd(h1);
- poller->delFd(h0);
-
- return 0;
- } catch (exception& e) {
- cout << "Caught exception " << e.what() << "\n";
- }
-}
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/QueueOptionsTest.cpp b/M4-RCs/qpid/cpp/src/tests/QueueOptionsTest.cpp
deleted file mode 100644
index bac369bfec..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/QueueOptionsTest.cpp
+++ /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.
- *
- */
-#include <iostream>
-#include "qpid/framing/Array.h"
-#include "qpid/client/QueueOptions.h"
-#include <alloca.h>
-
-#include "unit_test.h"
-
-using namespace qpid::client;
-
-
-QPID_AUTO_TEST_SUITE(QueueOptionsTestSuite)
-
-QPID_AUTO_TEST_CASE(testSizePolicy)
-{
- QueueOptions ft;
-
- ft.setSizePolicy(REJECT,1,2);
-
- BOOST_CHECK(QueueOptions::strREJECT == ft.getAsString(QueueOptions::strTypeKey));
- BOOST_CHECK(1 == ft.getAsInt(QueueOptions::strMaxSizeKey));
- BOOST_CHECK(2 == ft.getAsInt(QueueOptions::strMaxCountKey));
-
- ft.setSizePolicy(FLOW_TO_DISK,0,2);
- BOOST_CHECK(QueueOptions::strFLOW_TO_DISK == ft.getAsString(QueueOptions::strTypeKey));
- BOOST_CHECK(1 == ft.getAsInt(QueueOptions::strMaxSizeKey));
- BOOST_CHECK(2 == ft.getAsInt(QueueOptions::strMaxCountKey));
-
- ft.setSizePolicy(RING,1,0);
- BOOST_CHECK(QueueOptions::strRING == ft.getAsString(QueueOptions::strTypeKey));
-
- ft.setSizePolicy(RING_STRICT,1,0);
- BOOST_CHECK(QueueOptions::strRING_STRICT == ft.getAsString(QueueOptions::strTypeKey));
-
- ft.clearSizePolicy();
- BOOST_CHECK(!ft.isSet(QueueOptions::strTypeKey));
- BOOST_CHECK(!ft.isSet(QueueOptions::strMaxSizeKey));
- BOOST_CHECK(!ft.isSet(QueueOptions::strMaxCountKey));
-}
-
-QPID_AUTO_TEST_CASE(testFlags)
-{
- QueueOptions ft;
-
- ft.setPersistLastNode();
- ft.setOrdering(LVQ);
-
- BOOST_CHECK(1 == ft.getAsInt(QueueOptions::strPersistLastNode));
- BOOST_CHECK(1 == ft.getAsInt(QueueOptions::strLastValueQueue));
-
- ft.clearPersistLastNode();
- ft.setOrdering(FIFO);
-
- BOOST_CHECK(!ft.isSet(QueueOptions::strPersistLastNode));
- BOOST_CHECK(!ft.isSet(QueueOptions::strLastValueQueue));
-
-}
-
-QPID_AUTO_TEST_CASE(testSetOrdering)
-{
- //ensure setOrdering(FIFO) works even if not preceded by a call to
- //setOrdering(LVQ)
- QueueOptions ft;
- ft.setOrdering(FIFO);
- BOOST_CHECK(!ft.isSet(QueueOptions::strLastValueQueue));
-
-}
-
-QPID_AUTO_TEST_CASE(testClearPersistLastNode)
-{
- //ensure clear works even if not preceded by the setting on the
- //option
- QueueOptions ft;
- ft.clearPersistLastNode();
- BOOST_CHECK(!ft.isSet(QueueOptions::strPersistLastNode));
-}
-
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/QueuePolicyTest.cpp b/M4-RCs/qpid/cpp/src/tests/QueuePolicyTest.cpp
deleted file mode 100644
index 6c650169c7..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/QueuePolicyTest.cpp
+++ /dev/null
@@ -1,274 +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 "unit_test.h"
-#include "test_tools.h"
-
-#include "qpid/broker/QueuePolicy.h"
-#include "qpid/client/QueueOptions.h"
-#include "qpid/sys/Time.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "MessageUtils.h"
-#include "BrokerFixture.h"
-
-using namespace qpid::broker;
-using namespace qpid::client;
-using namespace qpid::framing;
-
-QPID_AUTO_TEST_SUITE(QueuePolicyTestSuite)
-
-QueuedMessage createMessage(uint32_t size)
-{
- QueuedMessage msg;
- msg.payload = MessageUtils::createMessage();
- MessageUtils::addContent(msg.payload, std::string (size, 'x'));
- return msg;
-}
-
-
-QPID_AUTO_TEST_CASE(testCount)
-{
- std::auto_ptr<QueuePolicy> policy(QueuePolicy::createQueuePolicy(5, 0));
- BOOST_CHECK_EQUAL((uint64_t) 0, policy->getMaxSize());
- BOOST_CHECK_EQUAL((uint32_t) 5, policy->getMaxCount());
-
- QueuedMessage msg = createMessage(10);
- for (size_t i = 0; i < 5; i++) {
- policy->tryEnqueue(msg);
- }
- try {
- policy->tryEnqueue(msg);
- BOOST_FAIL("Policy did not fail on enqueuing sixth message");
- } catch (const ResourceLimitExceededException&) {}
-
- policy->dequeued(msg);
- policy->tryEnqueue(msg);
-
- try {
- policy->tryEnqueue(msg);
- BOOST_FAIL("Policy did not fail on enqueuing sixth message (after dequeue)");
- } catch (const ResourceLimitExceededException&) {}
-}
-
-QPID_AUTO_TEST_CASE(testSize)
-{
- std::auto_ptr<QueuePolicy> policy(QueuePolicy::createQueuePolicy(0, 50));
- QueuedMessage msg = createMessage(10);
-
- for (size_t i = 0; i < 5; i++) {
- policy->tryEnqueue(msg);
- }
- try {
- policy->tryEnqueue(msg);
- BOOST_FAIL("Policy did not fail on aggregate size exceeding 50. " << *policy);
- } catch (const ResourceLimitExceededException&) {}
-
- policy->dequeued(msg);
- policy->tryEnqueue(msg);
-
- try {
- policy->tryEnqueue(msg);
- BOOST_FAIL("Policy did not fail on aggregate size exceeding 50 (after dequeue). " << *policy);
- } catch (const ResourceLimitExceededException&) {}
-}
-
-QPID_AUTO_TEST_CASE(testBoth)
-{
- std::auto_ptr<QueuePolicy> policy(QueuePolicy::createQueuePolicy(5, 50));
- try {
- QueuedMessage msg = createMessage(51);
- policy->tryEnqueue(msg);
- BOOST_FAIL("Policy did not fail on single message exceeding 50. " << *policy);
- } catch (const ResourceLimitExceededException&) {}
-
- std::vector<QueuedMessage> messages;
- messages.push_back(createMessage(15));
- messages.push_back(createMessage(10));
- messages.push_back(createMessage(11));
- messages.push_back(createMessage(2));
- messages.push_back(createMessage(7));
- for (size_t i = 0; i < messages.size(); i++) {
- policy->tryEnqueue(messages[i]);
- }
- //size = 45 at this point, count = 5
- try {
- QueuedMessage msg = createMessage(5);
- policy->tryEnqueue(msg);
- BOOST_FAIL("Policy did not fail on count exceeding 6. " << *policy);
- } catch (const ResourceLimitExceededException&) {}
- try {
- QueuedMessage msg = createMessage(10);
- policy->tryEnqueue(msg);
- BOOST_FAIL("Policy did not fail on aggregate size exceeding 50. " << *policy);
- } catch (const ResourceLimitExceededException&) {}
-
-
- policy->dequeued(messages[0]);
- try {
- QueuedMessage msg = createMessage(20);
- policy->tryEnqueue(msg);
- } catch (const ResourceLimitExceededException&) {
- BOOST_FAIL("Policy failed incorrectly after dequeue. " << *policy);
- }
-}
-
-QPID_AUTO_TEST_CASE(testSettings)
-{
- //test reading and writing the policy from/to field table
- std::auto_ptr<QueuePolicy> a(QueuePolicy::createQueuePolicy(101, 303));
- FieldTable settings;
- a->update(settings);
- std::auto_ptr<QueuePolicy> b(QueuePolicy::createQueuePolicy(settings));
- BOOST_CHECK_EQUAL(a->getMaxCount(), b->getMaxCount());
- BOOST_CHECK_EQUAL(a->getMaxSize(), b->getMaxSize());
-}
-
-QPID_AUTO_TEST_CASE(testRingPolicy)
-{
- FieldTable args;
- std::auto_ptr<QueuePolicy> policy = QueuePolicy::createQueuePolicy(5, 0, QueuePolicy::RING);
- policy->update(args);
-
- ProxySessionFixture f;
- std::string q("my-ring-queue");
- f.session.queueDeclare(arg::queue=q, arg::exclusive=true, arg::autoDelete=true, arg::arguments=args);
- for (int i = 0; i < 10; i++) {
- f.session.messageTransfer(arg::content=client::Message((boost::format("%1%_%2%") % "Message" % (i+1)).str(), q));
- }
- client::Message msg;
- for (int i = 5; i < 10; i++) {
- BOOST_CHECK(f.subs.get(msg, q, qpid::sys::TIME_SEC));
- BOOST_CHECK_EQUAL((boost::format("%1%_%2%") % "Message" % (i+1)).str(), msg.getData());
- }
- BOOST_CHECK(!f.subs.get(msg, q));
-}
-
-QPID_AUTO_TEST_CASE(testStrictRingPolicy)
-{
- FieldTable args;
- std::auto_ptr<QueuePolicy> policy = QueuePolicy::createQueuePolicy(5, 0, QueuePolicy::RING_STRICT);
- policy->update(args);
-
- ProxySessionFixture f;
- std::string q("my-ring-queue");
- f.session.queueDeclare(arg::queue=q, arg::exclusive=true, arg::autoDelete=true, arg::arguments=args);
- LocalQueue incoming;
- SubscriptionSettings settings(FlowControl::unlimited());
- settings.autoAck = 0; // no auto ack.
- Subscription sub = f.subs.subscribe(incoming, q, settings);
- for (int i = 0; i < 5; i++) {
- f.session.messageTransfer(arg::content=client::Message((boost::format("%1%_%2%") % "Message" % (i+1)).str(), q));
- }
- for (int i = 0; i < 5; i++) {
- BOOST_CHECK_EQUAL(incoming.pop().getData(), (boost::format("%1%_%2%") % "Message" % (i+1)).str());
- }
- try {
- ScopedSuppressLogging sl; // Suppress messages for expected errors.
- f.session.messageTransfer(arg::content=client::Message("Message_6", q));
- BOOST_FAIL("expecting ResourceLimitExceededException.");
- } catch (const ResourceLimitExceededException&) {}
-}
-
-QPID_AUTO_TEST_CASE(testPolicyWithDtx)
-{
- FieldTable args;
- std::auto_ptr<QueuePolicy> policy = QueuePolicy::createQueuePolicy(5, 0, QueuePolicy::REJECT);
- policy->update(args);
-
- ProxySessionFixture f;
- std::string q("my-policy-queue");
- f.session.queueDeclare(arg::queue=q, arg::exclusive=true, arg::autoDelete=true, arg::arguments=args);
- LocalQueue incoming;
- SubscriptionSettings settings(FlowControl::unlimited());
- settings.autoAck = 0; // no auto ack.
- Subscription sub = f.subs.subscribe(incoming, q, settings);
- f.session.dtxSelect();
- Xid tx1(1, "test-dtx-mgr", "tx1");
- f.session.dtxStart(arg::xid=tx1);
- for (int i = 0; i < 5; i++) {
- f.session.messageTransfer(arg::content=client::Message((boost::format("%1%_%2%") % "Message" % (i+1)).str(), q));
- }
- f.session.dtxEnd(arg::xid=tx1);
- f.session.dtxCommit(arg::xid=tx1, arg::onePhase=true);
-
- Xid tx2(1, "test-dtx-mgr", "tx2");
- f.session.dtxStart(arg::xid=tx2);
- for (int i = 0; i < 5; i++) {
- BOOST_CHECK_EQUAL(incoming.pop().getData(), (boost::format("%1%_%2%") % "Message" % (i+1)).str());
- }
- SequenceSet accepting=sub.getUnaccepted();
- f.session.messageAccept(accepting);
- f.session.dtxEnd(arg::xid=tx2);
- f.session.dtxPrepare(arg::xid=tx2);
- f.session.dtxRollback(arg::xid=tx2);
- f.session.messageRelease(accepting);
-
- Xid tx3(1, "test-dtx-mgr", "tx3");
- f.session.dtxStart(arg::xid=tx3);
- for (int i = 0; i < 5; i++) {
- incoming.pop();
- }
- accepting=sub.getUnaccepted();
- f.session.messageAccept(accepting);
- f.session.dtxEnd(arg::xid=tx3);
- f.session.dtxPrepare(arg::xid=tx3);
-
- Session other = f.connection.newSession();
- try {
- ScopedSuppressLogging sl; // Suppress messages for expected errors.
- other.messageTransfer(arg::content=client::Message("Message_6", q));
- BOOST_FAIL("expecting ResourceLimitExceededException.");
- } catch (const ResourceLimitExceededException&) {}
-
- f.session.dtxCommit(arg::xid=tx3);
- //now retry and this time should succeed
- other = f.connection.newSession();
- other.messageTransfer(arg::content=client::Message("Message_6", q));
-}
-
-QPID_AUTO_TEST_CASE(testFlowToDiskWithNoStore)
-{
- //Ensure that with no store loaded, we don't flow to disk but
- //fallback to rejecting messages
- QueueOptions args;
- args.setSizePolicy(FLOW_TO_DISK, 0, 5);
-
- ProxySessionFixture f;
- std::string q("my-queue");
- f.session.queueDeclare(arg::queue=q, arg::exclusive=true, arg::autoDelete=true, arg::arguments=args);
- LocalQueue incoming;
- SubscriptionSettings settings(FlowControl::unlimited());
- settings.autoAck = 0; // no auto ack.
- Subscription sub = f.subs.subscribe(incoming, q, settings);
- for (int i = 0; i < 5; i++) {
- f.session.messageTransfer(arg::content=client::Message((boost::format("%1%_%2%") % "Message" % (i+1)).str(), q));
- }
- for (int i = 0; i < 5; i++) {
- BOOST_CHECK_EQUAL(incoming.pop().getData(), (boost::format("%1%_%2%") % "Message" % (i+1)).str());
- }
- try {
- ScopedSuppressLogging sl; // Suppress messages for expected errors.
- f.session.messageTransfer(arg::content=client::Message("Message_6", q));
- BOOST_FAIL("expecting ResourceLimitExceededException.");
- } catch (const ResourceLimitExceededException&) {}
-}
-
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/QueueRegistryTest.cpp b/M4-RCs/qpid/cpp/src/tests/QueueRegistryTest.cpp
deleted file mode 100644
index 7ad4e0b89d..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/QueueRegistryTest.cpp
+++ /dev/null
@@ -1,94 +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 "qpid/broker/QueueRegistry.h"
-#include "unit_test.h"
-#include <string>
-
-using namespace qpid::broker;
-
-QPID_AUTO_TEST_SUITE(QueueRegistryTest)
-
-QPID_AUTO_TEST_CASE(testDeclare)
-{
- std::string foo("foo");
- std::string bar("bar");
- QueueRegistry reg;
- std::pair<Queue::shared_ptr, bool> qc;
-
- qc = reg.declare(foo, false, 0, 0);
- Queue::shared_ptr q = qc.first;
- BOOST_CHECK(q);
- BOOST_CHECK(qc.second); // New queue
- BOOST_CHECK_EQUAL(foo, q->getName());
-
- qc = reg.declare(foo, false, 0, 0);
- BOOST_CHECK_EQUAL(q, qc.first);
- BOOST_CHECK(!qc.second);
-
- qc = reg.declare(bar, false, 0, 0);
- q = qc.first;
- BOOST_CHECK(q);
- BOOST_CHECK_EQUAL(true, qc.second);
- BOOST_CHECK_EQUAL(bar, q->getName());
-}
-
-QPID_AUTO_TEST_CASE(testDeclareTmp)
-{
- QueueRegistry reg;
- std::pair<Queue::shared_ptr, bool> qc;
-
- qc = reg.declare(std::string(), false, 0, 0);
- BOOST_CHECK(qc.second);
- BOOST_CHECK_EQUAL(std::string("tmp_1"), qc.first->getName());
-}
-
-QPID_AUTO_TEST_CASE(testFind)
-{
- std::string foo("foo");
- std::string bar("bar");
- QueueRegistry reg;
- std::pair<Queue::shared_ptr, bool> qc;
-
- BOOST_CHECK(reg.find(foo) == 0);
-
- reg.declare(foo, false, 0, 0);
- reg.declare(bar, false, 0, 0);
- Queue::shared_ptr q = reg.find(bar);
- BOOST_CHECK(q);
- BOOST_CHECK_EQUAL(bar, q->getName());
-}
-
-QPID_AUTO_TEST_CASE(testDestroy)
-{
- std::string foo("foo");
- QueueRegistry reg;
- std::pair<Queue::shared_ptr, bool> qc;
-
- qc = reg.declare(foo, false, 0, 0);
- reg.destroy(foo);
- // Queue is gone from the registry.
- BOOST_CHECK(reg.find(foo) == 0);
- // Queue is not actually destroyed till we drop our reference.
- BOOST_CHECK_EQUAL(foo, qc.first->getName());
- // We shoud be the only reference.
- BOOST_CHECK_EQUAL(1L, qc.first.use_count());
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/QueueTest.cpp b/M4-RCs/qpid/cpp/src/tests/QueueTest.cpp
deleted file mode 100644
index f1771e26cd..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/QueueTest.cpp
+++ /dev/null
@@ -1,501 +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 "unit_test.h"
-#include "qpid/Exception.h"
-#include "qpid/broker/Broker.h"
-#include "qpid/broker/Queue.h"
-#include "qpid/broker/Deliverable.h"
-#include "qpid/broker/ExchangeRegistry.h"
-#include "qpid/broker/QueueRegistry.h"
-#include "qpid/broker/NullMessageStore.h"
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/client/QueueOptions.h"
-#include <iostream>
-#include "boost/format.hpp"
-
-using boost::intrusive_ptr;
-using namespace qpid;
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-class TestConsumer : public virtual Consumer{
-public:
- typedef boost::shared_ptr<TestConsumer> shared_ptr;
-
- intrusive_ptr<Message> last;
- bool received;
- TestConsumer(bool acquire = true):Consumer(acquire), received(false) {};
-
- virtual bool deliver(QueuedMessage& msg){
- last = msg.payload;
- received = true;
- return true;
- };
- void notify() {}
- OwnershipToken* getSession() { return 0; }
-};
-
-class FailOnDeliver : public Deliverable
-{
- Message msg;
-public:
- void deliverTo(const boost::shared_ptr<Queue>& queue)
- {
- throw Exception(QPID_MSG("Invalid delivery to " << queue->getName()));
- }
- Message& getMessage() { return msg; }
-};
-
-intrusive_ptr<Message> create_message(std::string exchange, std::string routingKey) {
- intrusive_ptr<Message> msg(new Message());
- AMQFrame method(in_place<MessageTransferBody>(ProtocolVersion(), exchange, 0, 0));
- AMQFrame header(in_place<AMQHeaderBody>());
- msg->getFrames().append(method);
- msg->getFrames().append(header);
- msg->getFrames().getHeaders()->get<DeliveryProperties>(true)->setRoutingKey(routingKey);
- return msg;
-}
-
-QPID_AUTO_TEST_SUITE(QueueTestSuite)
-
-QPID_AUTO_TEST_CASE(testAsyncMessage) {
- Queue::shared_ptr queue(new Queue("my_test_queue", true));
- intrusive_ptr<Message> received;
-
- TestConsumer::shared_ptr c1(new TestConsumer());
- queue->consume(c1);
-
-
- //Test basic delivery:
- intrusive_ptr<Message> msg1 = create_message("e", "A");
- msg1->enqueueAsync();//this is done on enqueue which is not called from process
- queue->process(msg1);
- sleep(2);
-
- BOOST_CHECK(!c1->received);
- msg1->enqueueComplete();
-
- received = queue->get().payload;
- BOOST_CHECK_EQUAL(msg1.get(), received.get());
-}
-
-
-QPID_AUTO_TEST_CASE(testAsyncMessageCount){
- Queue::shared_ptr queue(new Queue("my_test_queue", true));
- intrusive_ptr<Message> msg1 = create_message("e", "A");
- msg1->enqueueAsync();//this is done on enqueue which is not called from process
-
- queue->process(msg1);
- sleep(2);
- uint32_t compval=0;
- BOOST_CHECK_EQUAL(compval, queue->getMessageCount());
- msg1->enqueueComplete();
- compval=1;
- BOOST_CHECK_EQUAL(compval, queue->getMessageCount());
-}
-
-QPID_AUTO_TEST_CASE(testConsumers){
- Queue::shared_ptr queue(new Queue("my_queue", true));
-
- //Test adding consumers:
- TestConsumer::shared_ptr c1(new TestConsumer());
- TestConsumer::shared_ptr c2(new TestConsumer());
- queue->consume(c1);
- queue->consume(c2);
-
- BOOST_CHECK_EQUAL(uint32_t(2), queue->getConsumerCount());
-
- //Test basic delivery:
- intrusive_ptr<Message> msg1 = create_message("e", "A");
- intrusive_ptr<Message> msg2 = create_message("e", "B");
- intrusive_ptr<Message> msg3 = create_message("e", "C");
-
- queue->deliver(msg1);
- BOOST_CHECK(queue->dispatch(c1));
- BOOST_CHECK_EQUAL(msg1.get(), c1->last.get());
-
- queue->deliver(msg2);
- BOOST_CHECK(queue->dispatch(c2));
- BOOST_CHECK_EQUAL(msg2.get(), c2->last.get());
-
- c1->received = false;
- queue->deliver(msg3);
- BOOST_CHECK(queue->dispatch(c1));
- BOOST_CHECK_EQUAL(msg3.get(), c1->last.get());
-
- //Test cancellation:
- queue->cancel(c1);
- BOOST_CHECK_EQUAL(uint32_t(1), queue->getConsumerCount());
- queue->cancel(c2);
- BOOST_CHECK_EQUAL(uint32_t(0), queue->getConsumerCount());
-}
-
-QPID_AUTO_TEST_CASE(testRegistry){
- //Test use of queues in registry:
- QueueRegistry registry;
- registry.declare("queue1", true, true);
- registry.declare("queue2", true, true);
- registry.declare("queue3", true, true);
-
- BOOST_CHECK(registry.find("queue1"));
- BOOST_CHECK(registry.find("queue2"));
- BOOST_CHECK(registry.find("queue3"));
-
- registry.destroy("queue1");
- registry.destroy("queue2");
- registry.destroy("queue3");
-
- BOOST_CHECK(!registry.find("queue1"));
- BOOST_CHECK(!registry.find("queue2"));
- BOOST_CHECK(!registry.find("queue3"));
-}
-
-QPID_AUTO_TEST_CASE(testDequeue){
- Queue::shared_ptr queue(new Queue("my_queue", true));
- intrusive_ptr<Message> msg1 = create_message("e", "A");
- intrusive_ptr<Message> msg2 = create_message("e", "B");
- intrusive_ptr<Message> msg3 = create_message("e", "C");
- intrusive_ptr<Message> received;
-
- queue->deliver(msg1);
- queue->deliver(msg2);
- queue->deliver(msg3);
-
- BOOST_CHECK_EQUAL(uint32_t(3), queue->getMessageCount());
-
- received = queue->get().payload;
- BOOST_CHECK_EQUAL(msg1.get(), received.get());
- BOOST_CHECK_EQUAL(uint32_t(2), queue->getMessageCount());
-
- received = queue->get().payload;
- BOOST_CHECK_EQUAL(msg2.get(), received.get());
- BOOST_CHECK_EQUAL(uint32_t(1), queue->getMessageCount());
-
- TestConsumer::shared_ptr consumer(new TestConsumer());
- queue->consume(consumer);
- queue->dispatch(consumer);
- if (!consumer->received)
- sleep(2);
-
- BOOST_CHECK_EQUAL(msg3.get(), consumer->last.get());
- BOOST_CHECK_EQUAL(uint32_t(0), queue->getMessageCount());
-
- received = queue->get().payload;
- BOOST_CHECK(!received);
- BOOST_CHECK_EQUAL(uint32_t(0), queue->getMessageCount());
-
-}
-
-QPID_AUTO_TEST_CASE(testBound)
-{
- //test the recording of bindings, and use of those to allow a queue to be unbound
- string key("my-key");
- FieldTable args;
-
- Queue::shared_ptr queue(new Queue("my-queue", true));
- ExchangeRegistry exchanges;
- //establish bindings from exchange->queue and notify the queue as it is bound:
- Exchange::shared_ptr exchange1 = exchanges.declare("my-exchange-1", "direct").first;
- exchange1->bind(queue, key, &args);
- queue->bound(exchange1->getName(), key, args);
-
- Exchange::shared_ptr exchange2 = exchanges.declare("my-exchange-2", "fanout").first;
- exchange2->bind(queue, key, &args);
- queue->bound(exchange2->getName(), key, args);
-
- Exchange::shared_ptr exchange3 = exchanges.declare("my-exchange-3", "topic").first;
- exchange3->bind(queue, key, &args);
- queue->bound(exchange3->getName(), key, args);
-
- //delete one of the exchanges:
- exchanges.destroy(exchange2->getName());
- exchange2.reset();
-
- //unbind the queue from all exchanges it knows it has been bound to:
- queue->unbind(exchanges, queue);
-
- //ensure the remaining exchanges don't still have the queue bound to them:
- FailOnDeliver deliverable;
- exchange1->route(deliverable, key, &args);
- exchange3->route(deliverable, key, &args);
-}
-
-QPID_AUTO_TEST_CASE(testPersistLastNodeStanding){
-
- client::QueueOptions args;
- args.setPersistLastNode();
-
- Queue::shared_ptr queue(new Queue("my-queue", true));
- queue->configure(args);
-
- intrusive_ptr<Message> msg1 = create_message("e", "A");
- intrusive_ptr<Message> msg2 = create_message("e", "B");
- intrusive_ptr<Message> msg3 = create_message("e", "C");
-
- //enqueue 2 messages
- queue->deliver(msg1);
- queue->deliver(msg2);
-
- //change mode
- queue->setLastNodeFailure();
-
- //enqueue 1 message
- queue->deliver(msg3);
-
- //check all have persistent ids.
- BOOST_CHECK(msg1->isPersistent());
- BOOST_CHECK(msg2->isPersistent());
- BOOST_CHECK(msg3->isPersistent());
-
-}
-
-class TestMessageStoreOC : public NullMessageStore
-{
- public:
-
- virtual void dequeue(TransactionContext*,
- const boost::intrusive_ptr<PersistableMessage>& /*msg*/,
- const PersistableQueue& /*queue*/)
- {
- }
-
- virtual void enqueue(TransactionContext*,
- const boost::intrusive_ptr<PersistableMessage>& /*msg*/,
- const PersistableQueue& /* queue */)
- {
- }
-
- TestMessageStoreOC() : NullMessageStore() {}
- ~TestMessageStoreOC(){}
-};
-
-
-QPID_AUTO_TEST_CASE(testLVQOrdering){
-
- client::QueueOptions args;
- // set queue mode
- args.setOrdering(client::LVQ);
-
- Queue::shared_ptr queue(new Queue("my-queue", true ));
- queue->configure(args);
-
- intrusive_ptr<Message> msg1 = create_message("e", "A");
- intrusive_ptr<Message> msg2 = create_message("e", "B");
- intrusive_ptr<Message> msg3 = create_message("e", "C");
- intrusive_ptr<Message> msg4 = create_message("e", "D");
- intrusive_ptr<Message> received;
-
- //set deliever match for LVQ a,b,c,a
-
- string key;
- args.getLVQKey(key);
- BOOST_CHECK_EQUAL(key, "qpid.LVQ_key");
-
-
- msg1->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"a");
- msg2->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"b");
- msg3->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"c");
- msg4->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"a");
-
- //enqueue 4 message
- queue->deliver(msg1);
- queue->deliver(msg2);
- queue->deliver(msg3);
- queue->deliver(msg4);
-
- BOOST_CHECK_EQUAL(queue->getMessageCount(), 3u);
-
- received = queue->get().payload;
- BOOST_CHECK_EQUAL(msg4.get(), received.get());
-
- received = queue->get().payload;
- BOOST_CHECK_EQUAL(msg2.get(), received.get());
-
- received = queue->get().payload;
- BOOST_CHECK_EQUAL(msg3.get(), received.get());
-
- intrusive_ptr<Message> msg5 = create_message("e", "A");
- intrusive_ptr<Message> msg6 = create_message("e", "B");
- intrusive_ptr<Message> msg7 = create_message("e", "C");
- msg5->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"a");
- msg6->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"b");
- msg7->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"c");
- queue->deliver(msg5);
- queue->deliver(msg6);
- queue->deliver(msg7);
-
- BOOST_CHECK_EQUAL(queue->getMessageCount(), 3u);
-
- received = queue->get().payload;
- BOOST_CHECK_EQUAL(msg5.get(), received.get());
-
- received = queue->get().payload;
- BOOST_CHECK_EQUAL(msg6.get(), received.get());
-
- received = queue->get().payload;
- BOOST_CHECK_EQUAL(msg7.get(), received.get());
-
-}
-
-QPID_AUTO_TEST_CASE(testLVQAcquire){
-
- client::QueueOptions args;
- // set queue mode
- args.setOrdering(client::LVQ);
-
- Queue::shared_ptr queue(new Queue("my-queue", true ));
- queue->configure(args);
-
- intrusive_ptr<Message> msg1 = create_message("e", "A");
- intrusive_ptr<Message> msg2 = create_message("e", "B");
- intrusive_ptr<Message> msg3 = create_message("e", "C");
- intrusive_ptr<Message> msg4 = create_message("e", "D");
- intrusive_ptr<Message> msg5 = create_message("e", "F");
- intrusive_ptr<Message> msg6 = create_message("e", "G");
-
- //set deliever match for LVQ a,b,c,a
-
- string key;
- args.getLVQKey(key);
- BOOST_CHECK_EQUAL(key, "qpid.LVQ_key");
-
-
- msg1->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"a");
- msg2->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"b");
- msg3->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"c");
- msg4->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"a");
- msg5->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"b");
- msg6->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"c");
-
- //enqueue 4 message
- queue->deliver(msg1);
- queue->deliver(msg2);
- queue->deliver(msg3);
- queue->deliver(msg4);
-
- BOOST_CHECK_EQUAL(queue->getMessageCount(), 3u);
-
- framing::SequenceNumber sequence(1);
- QueuedMessage qmsg(queue.get(), msg1, sequence);
- QueuedMessage qmsg2(queue.get(), msg2, ++sequence);
-
- BOOST_CHECK(!queue->acquire(qmsg));
- BOOST_CHECK(queue->acquire(qmsg2));
-
- BOOST_CHECK_EQUAL(queue->getMessageCount(), 2u);
-
- queue->deliver(msg5);
- BOOST_CHECK_EQUAL(queue->getMessageCount(), 3u);
-
- // set mode to no browse and check
- args.setOrdering(client::LVQ_NO_BROWSE);
- queue->configure(args);
- TestConsumer::shared_ptr c1(new TestConsumer(false));
-
- queue->dispatch(c1);
- queue->dispatch(c1);
- queue->dispatch(c1);
-
- queue->deliver(msg6);
- BOOST_CHECK_EQUAL(queue->getMessageCount(), 3u);
-
- intrusive_ptr<Message> received;
- received = queue->get().payload;
- BOOST_CHECK_EQUAL(msg4.get(), received.get());
-
-}
-
-QPID_AUTO_TEST_CASE(testLVQMultiQueue){
-
- client::QueueOptions args;
- // set queue mode
- args.setOrdering(client::LVQ);
-
- Queue::shared_ptr queue1(new Queue("my-queue", true ));
- Queue::shared_ptr queue2(new Queue("my-queue", true ));
- intrusive_ptr<Message> received;
- queue1->configure(args);
- queue2->configure(args);
-
- intrusive_ptr<Message> msg1 = create_message("e", "A");
- intrusive_ptr<Message> msg2 = create_message("e", "A");
-
- string key;
- args.getLVQKey(key);
- BOOST_CHECK_EQUAL(key, "qpid.LVQ_key");
-
- msg1->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"a");
- msg2->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"a");
-
- queue1->deliver(msg1);
- queue2->deliver(msg1);
- queue1->deliver(msg2);
-
- received = queue1->get().payload;
- BOOST_CHECK_EQUAL(msg2.get(), received.get());
-
- received = queue2->get().payload;
- BOOST_CHECK_EQUAL(msg1.get(), received.get());
-
-}
-
-void addMessagesToQueue(uint count, Queue& queue, uint oddTtl = 200, uint evenTtl = 0)
-{
- for (uint i = 0; i < count; i++) {
- intrusive_ptr<Message> m = create_message("exchange", "key");
- if (i % 2) {
- if (oddTtl) m->getProperties<DeliveryProperties>()->setTtl(oddTtl);
- } else {
- if (evenTtl) m->getProperties<DeliveryProperties>()->setTtl(evenTtl);
- }
- m->setTimestamp();
- queue.deliver(m);
- }
-}
-
-QPID_AUTO_TEST_CASE(testPurgeExpired) {
- Queue queue("my-queue");
- addMessagesToQueue(10, queue);
- BOOST_CHECK_EQUAL(queue.getMessageCount(), 10u);
- ::usleep(300*1000);
- queue.purgeExpired();
- BOOST_CHECK_EQUAL(queue.getMessageCount(), 5u);
-}
-
-QPID_AUTO_TEST_CASE(testQueueCleaner) {
- Timer timer;
- QueueRegistry queues;
- Queue::shared_ptr queue = queues.declare("my-queue").first;
- addMessagesToQueue(10, *queue, 200, 400);
- BOOST_CHECK_EQUAL(queue->getMessageCount(), 10u);
-
- QueueCleaner cleaner(queues, timer);
- cleaner.start(100 * qpid::sys::TIME_MSEC);
- ::usleep(300*1000);
- BOOST_CHECK_EQUAL(queue->getMessageCount(), 5u);
- ::usleep(300*1000);
- BOOST_CHECK_EQUAL(queue->getMessageCount(), 0u);
-}
-
-QPID_AUTO_TEST_SUITE_END()
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/README b/M4-RCs/qpid/cpp/src/tests/README
deleted file mode 100644
index 0f4edee493..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/README
+++ /dev/null
@@ -1,54 +0,0 @@
-= Running Qpid C++ tests =
-
-General philosophy is that "make check" run all tests by default, but
-developers can run tests selectively as explained below.
-
-== Valgrind ==
-
-By default we run tests under valgrind to detect memory errors if valgrind
-is present. ./configure --disable-valgrind will disable it.
-
-Default valgrind options are specified in .valgrindrc-default, which a
-checked-in file. The actual options used are in .valgrindrc which is a
-local file. Normally it is a copy of valgrindrc-default but you can
-modify at will.
-
-Supressed errors are listed in .valgrind.supp. If you want to change
-suppressions for local testing, just modify .valgrindrc to point to a
-different file. Do NOT add suppressions to .valgrindrc.supp unless
-they are known problems outside of Qpid that can't reasonably be
-worked around in Qpid.
-
-
-== Unit Tests ==
-Unit tests use the boost test framework, and are compiled to rogram
- unit_test
-There are several options to control how test results are displayed,
-see
- http://www.boost.org/doc/libs/1_35_0/libs/test/doc/components/utf/parameters/index.html
-
-NOTE: some unit tests are written as CppUnit plug-ins, we are moving away
-from CppUnit so new tests should use the boost framework.
-
-CppUnit tests are run by the script run-unit-tests.
-
-== System Tests ==
-
-System tests are self contained AMQP client executables or scripts.
-They are listed in the TESTS make variable, which can be over-ridden.
-
-The ./start_broker "test" launches the broker, ./stop_broker" stops it.
-Tests in between assume the broker is running.
-
-./python_tests: runs ../python/run_tests. This is the main set of
-system testss for the broker.
-
-Other C++ client test executables and scripts under client/test are
-system tests for the client.
-
-By setting TESTS in a make command you can run a different subset of tests
-against an already-running broker.
-
-
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/RangeSet.cpp b/M4-RCs/qpid/cpp/src/tests/RangeSet.cpp
deleted file mode 100644
index 9c602de78d..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/RangeSet.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-
-#include "unit_test.h"
-#include "test_tools.h"
-#include "qpid/RangeSet.h"
-
-using namespace std;
-using namespace qpid;
-
-QPID_AUTO_TEST_SUITE(RangeSetTestSuite)
-
-typedef qpid::Range<int> TestRange;
-typedef qpid::RangeSet<int> TestRangeSet;
-
-QPID_AUTO_TEST_CASE(testEmptyRange) {
- TestRange r;
- BOOST_CHECK(r.empty());
- BOOST_CHECK(!r.contains(0));
- // BOOST_CHECK(r.contiguous(0));
-}
-
-QPID_AUTO_TEST_CASE(testRangeSetAddPoint) {
- TestRangeSet r;
- BOOST_CHECK(r.empty());
- r += 3;
- BOOST_CHECK_MESSAGE(r.contains(3), r);
- BOOST_CHECK_MESSAGE(r.contains(TestRange(3,4)), r);
- BOOST_CHECK(!r.empty());
- r += 5;
- BOOST_CHECK_MESSAGE(r.contains(5), r);
- BOOST_CHECK_MESSAGE(r.contains(TestRange(5,6)), r);
- BOOST_CHECK_MESSAGE(!r.contains(TestRange(3,6)), r);
- r += 4;
- BOOST_CHECK_MESSAGE(r.contains(TestRange(3,6)), r);
-}
-
-QPID_AUTO_TEST_CASE(testRangeSetAddRange) {
- TestRangeSet r;
- r += TestRange(0,3);
- BOOST_CHECK(r.contains(TestRange(0,3)));
- r += TestRange(4,6);
- BOOST_CHECK_MESSAGE(r.contains(TestRange(4,6)), r);
- r += 3;
- BOOST_CHECK_MESSAGE(r.contains(TestRange(0,6)), r);
- BOOST_CHECK(r.front() == 0);
- BOOST_CHECK(r.back() == 6);
-}
-
-QPID_AUTO_TEST_CASE(testRangeSetAddSet) {
- TestRangeSet r;
- TestRangeSet s = TestRangeSet(0,3)+TestRange(5,10);
- r += s;
- BOOST_CHECK_EQUAL(r,s);
- r += TestRangeSet(3,5) + TestRange(7,12) + 15;
- BOOST_CHECK_EQUAL(r, TestRangeSet(0,12) + 15);
-
- r.clear();
- BOOST_CHECK(r.empty());
- r += TestRange::makeClosed(6,10);
- BOOST_CHECK_EQUAL(r, TestRangeSet(6,11));
- r += TestRangeSet(2,6)+8;
- BOOST_CHECK_EQUAL(r, TestRangeSet(2,11));
-}
-
-QPID_AUTO_TEST_CASE(testRangeSetIterate) {
- TestRangeSet r;
- (((r += 1) += 10) += TestRange(4,7)) += 2;
- BOOST_MESSAGE(r);
- std::vector<int> actual;
- std::copy(r.begin(), r.end(), std::back_inserter(actual));
- std::vector<int> expect = boost::assign::list_of(1)(2)(4)(5)(6)(10);
- BOOST_CHECK_EQUAL(expect, actual);
-}
-
-QPID_AUTO_TEST_CASE(testRangeSetRemove) {
- // points
- BOOST_CHECK_EQUAL(TestRangeSet(0,5)-3, TestRangeSet(0,3)+TestRange(4,5));
- BOOST_CHECK_EQUAL(TestRangeSet(1,5)-5, TestRangeSet(1,5));
- BOOST_CHECK_EQUAL(TestRangeSet(1,5)-0, TestRangeSet(1,5));
-
- TestRangeSet r(TestRangeSet(0,5)+TestRange(10,15)+TestRange(20,25));
-
- // TestRanges
- BOOST_CHECK_EQUAL(r-TestRange(0,5), TestRangeSet(10,15)+TestRange(20,25));
- BOOST_CHECK_EQUAL(r-TestRange(10,15), TestRangeSet(0,5)+TestRange(20,25));
- BOOST_CHECK_EQUAL(r-TestRange(20,25), TestRangeSet(0,5)+TestRange(10,15));
-
- BOOST_CHECK_EQUAL(r-TestRange(-5, 30), TestRangeSet());
-
- BOOST_CHECK_EQUAL(r-TestRange(-5, 7), TestRangeSet(10,15)+TestRange(20,25));
- BOOST_CHECK_EQUAL(r-TestRange(8,19), TestRangeSet(0,5)+TestRange(20,25));
- BOOST_CHECK_EQUAL(r-TestRange(17,30), TestRangeSet(0,5)+TestRange(10,15));
- BOOST_CHECK_EQUAL(r-TestRange(17,30), TestRangeSet(0,5)+TestRange(10,15));
-
- BOOST_CHECK_EQUAL(r-TestRange(-5, 5), TestRangeSet(10,15)+TestRange(20,25));
- BOOST_CHECK_EQUAL(r-TestRange(10,19), TestRangeSet(0,5)+TestRange(20,25));
- BOOST_CHECK_EQUAL(r-TestRange(18,25), TestRangeSet(0,5)+TestRange(10,15));
- BOOST_CHECK_EQUAL(r-TestRange(23,25), TestRangeSet(0,5)+TestRange(10,15)+TestRange(20,23));
-
- BOOST_CHECK_EQUAL(r-TestRange(-3, 3), TestRangeSet(3,5)+TestRange(10,15)+TestRange(20,25));
- BOOST_CHECK_EQUAL(r-TestRange(3, 7), TestRangeSet(0,2)+TestRange(10,15)+TestRange(20,25));
- BOOST_CHECK_EQUAL(r-TestRange(3, 12), TestRangeSet(0,3)+TestRange(12,15)+TestRange(20,25));
- BOOST_CHECK_EQUAL(r-TestRange(3, 22), TestRangeSet(12,15)+TestRange(22,25));
- BOOST_CHECK_EQUAL(r-TestRange(12, 22), TestRangeSet(0,5)+TestRange(10,11)+TestRange(22,25));
-
- // Sets
- BOOST_CHECK_EQUAL(r-(TestRangeSet(-1,6)+TestRange(11,14)+TestRange(23,25)),
- TestRangeSet(10,11)+TestRange(14,15)+TestRange(20,23));
-}
-
-QPID_AUTO_TEST_CASE(testRangeContaining) {
- TestRangeSet r;
- (((r += 1) += TestRange(3,5)) += 7);
- BOOST_CHECK_EQUAL(r.rangeContaining(0), TestRange(0,0));
- BOOST_CHECK_EQUAL(r.rangeContaining(1), TestRange(1,2));
- BOOST_CHECK_EQUAL(r.rangeContaining(2), TestRange(2,2));
- BOOST_CHECK_EQUAL(r.rangeContaining(3), TestRange(3,5));
- BOOST_CHECK_EQUAL(r.rangeContaining(4), TestRange(3,5));
- BOOST_CHECK_EQUAL(r.rangeContaining(5), TestRange(5,5));
- BOOST_CHECK_EQUAL(r.rangeContaining(6), TestRange(6,6));
- BOOST_CHECK_EQUAL(r.rangeContaining(7), TestRange(7,8));
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/RefCounted.cpp b/M4-RCs/qpid/cpp/src/tests/RefCounted.cpp
deleted file mode 100644
index 8c679a3d2e..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/RefCounted.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/RefCounted.h"
-#include <boost/intrusive_ptr.hpp>
-
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(RefCountedTestSuiteTestSuite)
-
-using boost::intrusive_ptr;
-using namespace std;
-using namespace qpid;
-
-struct CountMe : public RefCounted {
- static int instances;
- CountMe() { ++instances; }
- ~CountMe() { --instances; }
-};
-
-int CountMe::instances=0;
-
-QPID_AUTO_TEST_CASE(testRefCounted) {
- BOOST_CHECK_EQUAL(0, CountMe::instances);
- intrusive_ptr<CountMe> p(new CountMe());
- BOOST_CHECK_EQUAL(1, CountMe::instances);
- intrusive_ptr<CountMe> q(p);
- BOOST_CHECK_EQUAL(1, CountMe::instances);
- q=0;
- BOOST_CHECK_EQUAL(1, CountMe::instances);
- p=0;
- BOOST_CHECK_EQUAL(0, CountMe::instances);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/SequenceNumberTest.cpp b/M4-RCs/qpid/cpp/src/tests/SequenceNumberTest.cpp
deleted file mode 100644
index e4c6d066ef..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/SequenceNumberTest.cpp
+++ /dev/null
@@ -1,205 +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 "unit_test.h"
-#include <iostream>
-#include "qpid/framing/SequenceNumber.h"
-#include "qpid/framing/SequenceNumberSet.h"
-
-using namespace qpid::framing;
-
-
-void checkDifference(SequenceNumber& a, SequenceNumber& b, int gap)
-{
- BOOST_CHECK_EQUAL(gap, a - b);
- BOOST_CHECK_EQUAL(-gap, b - a);
-
- //increment until b wraps around
- for (int i = 0; i < (gap + 2); i++, ++a, ++b) {
- BOOST_CHECK_EQUAL(gap, a - b);
- }
- //keep incrementing until a also wraps around
- for (int i = 0; i < (gap + 2); i++, ++a, ++b) {
- BOOST_CHECK_EQUAL(gap, a - b);
- }
- //let b catch up and overtake
- for (int i = 0; i < (gap*2); i++, ++b) {
- BOOST_CHECK_EQUAL(gap - i, a - b);
- BOOST_CHECK_EQUAL(i - gap, b - a);
- }
-}
-
-void checkComparison(SequenceNumber& a, SequenceNumber& b, int gap)
-{
- //increment until b wraps around
- for (int i = 0; i < (gap + 2); i++) {
- BOOST_CHECK(++a < ++b);//test prefix
- }
- //keep incrementing until a also wraps around
- for (int i = 0; i < (gap + 2); i++) {
- BOOST_CHECK(a++ < b++);//test postfix
- }
- //let a 'catch up'
- for (int i = 0; i < gap; i++) {
- a++;
- }
- BOOST_CHECK(a == b);
- BOOST_CHECK(++a > b);
-}
-
-
-QPID_AUTO_TEST_SUITE(SequenceNumberTestSuite)
-
-QPID_AUTO_TEST_CASE(testIncrementPostfix)
-{
- SequenceNumber a;
- SequenceNumber b;
- BOOST_CHECK(!(a > b));
- BOOST_CHECK(!(b < a));
- BOOST_CHECK(a == b);
-
- SequenceNumber c = a++;
- BOOST_CHECK(a > b);
- BOOST_CHECK(b < a);
- BOOST_CHECK(a != b);
- BOOST_CHECK(c < a);
- BOOST_CHECK(a != c);
-
- b++;
- BOOST_CHECK(!(a > b));
- BOOST_CHECK(!(b < a));
- BOOST_CHECK(a == b);
- BOOST_CHECK(c < b);
- BOOST_CHECK(b != c);
-}
-
-QPID_AUTO_TEST_CASE(testIncrementPrefix)
-{
- SequenceNumber a;
- SequenceNumber b;
- BOOST_CHECK(!(a > b));
- BOOST_CHECK(!(b < a));
- BOOST_CHECK(a == b);
-
- SequenceNumber c = ++a;
- BOOST_CHECK(a > b);
- BOOST_CHECK(b < a);
- BOOST_CHECK(a != b);
- BOOST_CHECK(a == c);
-
- ++b;
- BOOST_CHECK(!(a > b));
- BOOST_CHECK(!(b < a));
- BOOST_CHECK(a == b);
-}
-
-QPID_AUTO_TEST_CASE(testWrapAround)
-{
- const uint32_t max = 0xFFFFFFFF;
- SequenceNumber a(max - 10);
- SequenceNumber b(max - 5);
- checkComparison(a, b, 5);
-
- const uint32_t max_signed = 0x7FFFFFFF;
- SequenceNumber c(max_signed - 10);
- SequenceNumber d(max_signed - 5);
- checkComparison(c, d, 5);
-}
-
-QPID_AUTO_TEST_CASE(testCondense)
-{
- SequenceNumberSet set;
- for (uint i = 0; i < 6; i++) {
- set.push_back(SequenceNumber(i));
- }
- set.push_back(SequenceNumber(7));
- for (uint i = 9; i < 13; i++) {
- set.push_back(SequenceNumber(i));
- }
- set.push_back(SequenceNumber(13));
- SequenceNumberSet actual = set.condense();
-
- SequenceNumberSet expected;
- expected.addRange(SequenceNumber(0), SequenceNumber(5));
- expected.addRange(SequenceNumber(7), SequenceNumber(7));
- expected.addRange(SequenceNumber(9), SequenceNumber(13));
- BOOST_CHECK_EQUAL(expected, actual);
-}
-
-QPID_AUTO_TEST_CASE(testCondenseSingleRange)
-{
- SequenceNumberSet set;
- for (uint i = 0; i < 6; i++) {
- set.push_back(SequenceNumber(i));
- }
- SequenceNumberSet actual = set.condense();
-
- SequenceNumberSet expected;
- expected.addRange(SequenceNumber(0), SequenceNumber(5));
- BOOST_CHECK_EQUAL(expected, actual);
-}
-
-QPID_AUTO_TEST_CASE(testCondenseSingleItem)
-{
- SequenceNumberSet set;
- set.push_back(SequenceNumber(1));
- SequenceNumberSet actual = set.condense();
-
- SequenceNumberSet expected;
- expected.addRange(SequenceNumber(1), SequenceNumber(1));
- BOOST_CHECK_EQUAL(expected, actual);
-}
-
-QPID_AUTO_TEST_CASE(testDifference)
-{
- SequenceNumber a;
- SequenceNumber b;
-
- for (int i = 0; i < 10; i++, ++a) {
- BOOST_CHECK_EQUAL(i, a - b);
- BOOST_CHECK_EQUAL(-i, b - a);
- }
-
- b = a;
-
- for (int i = 0; i < 10; i++, ++b) {
- BOOST_CHECK_EQUAL(-i, a - b);
- BOOST_CHECK_EQUAL(i, b - a);
- }
-}
-
-QPID_AUTO_TEST_CASE(testDifferenceWithWrapAround1)
-{
- const uint32_t max = 0xFFFFFFFF;
- SequenceNumber a(max - 5);
- SequenceNumber b(max - 10);
- checkDifference(a, b, 5);
-}
-
-QPID_AUTO_TEST_CASE(testDifferenceWithWrapAround2)
-{
- const uint32_t max_signed = 0x7FFFFFFF;
- SequenceNumber c(max_signed - 5);
- SequenceNumber d(max_signed - 10);
- checkDifference(c, d, 5);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/SequenceSet.cpp b/M4-RCs/qpid/cpp/src/tests/SequenceSet.cpp
deleted file mode 100644
index ba2f1391a1..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/SequenceSet.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/framing/SequenceSet.h"
-#include "unit_test.h"
-#include <list>
-
-QPID_AUTO_TEST_SUITE(SequenceSetTestSuite)
-
-using namespace qpid::framing;
-
-struct RangeExpectations
-{
- typedef std::pair<SequenceNumber, SequenceNumber> Range;
- typedef std::list<Range> Ranges;
-
- Ranges ranges;
-
- RangeExpectations& expect(const SequenceNumber& start, const SequenceNumber& end) {
- ranges.push_back(Range(start, end));
- return *this;
- }
-
- void operator()(const SequenceNumber& start, const SequenceNumber& end) {
- BOOST_CHECK(!ranges.empty());
- if (!ranges.empty()) {
- BOOST_CHECK_EQUAL(start, ranges.front().first);
- BOOST_CHECK_EQUAL(end, ranges.front().second);
- ranges.pop_front();
- }
- }
-
- void check(SequenceSet& set) {
- set.for_each(*this);
- BOOST_CHECK(ranges.empty());
- }
-};
-
-QPID_AUTO_TEST_CASE(testAdd) {
- SequenceSet s;
- s.add(2);
- s.add(8,8);
- s.add(3,5);
-
- for (uint32_t i = 0; i <= 1; i++)
- BOOST_CHECK(!s.contains(i));
-
- for (uint32_t i = 2; i <= 5; i++)
- BOOST_CHECK(s.contains(i));
-
- for (uint32_t i = 6; i <= 7; i++)
- BOOST_CHECK(!s.contains(i));
-
- BOOST_CHECK(s.contains(8));
-
- for (uint32_t i = 9; i <= 10; i++)
- BOOST_CHECK(!s.contains(i));
-
- RangeExpectations().expect(2, 5).expect(8, 8).check(s);
-
- SequenceSet t;
- t.add(6, 10);
- t.add(s);
-
- for (uint32_t i = 0; i <= 1; i++)
- BOOST_CHECK(!t.contains(i));
-
- for (uint32_t i = 2; i <= 10; i++)
- BOOST_CHECK_MESSAGE(t.contains(i), t << " contains " << i);
-
- RangeExpectations().expect(2, 10).check(t);
-}
-
-QPID_AUTO_TEST_CASE(testAdd2) {
- SequenceSet s;
- s.add(7,6);
- s.add(4,4);
- s.add(3,10);
- s.add(2);
- RangeExpectations().expect(2, 10).check(s);
-}
-
-QPID_AUTO_TEST_CASE(testRemove) {
- SequenceSet s;
- SequenceSet t;
- s.add(0, 10);
- t.add(0, 10);
-
- s.remove(7);
- s.remove(3, 5);
- s.remove(9, 10);
-
- t.remove(s);
-
- for (uint32_t i = 0; i <= 2; i++) {
- BOOST_CHECK(s.contains(i));
- BOOST_CHECK(!t.contains(i));
- }
-
- for (uint32_t i = 3; i <= 5; i++) {
- BOOST_CHECK(!s.contains(i));
- BOOST_CHECK(t.contains(i));
- }
-
- BOOST_CHECK(s.contains(6));
- BOOST_CHECK(!t.contains(6));
-
- BOOST_CHECK(!s.contains(7));
- BOOST_CHECK(t.contains(7));
-
- BOOST_CHECK(s.contains(8));
- BOOST_CHECK(!t.contains(8));
-
- for (uint32_t i = 9; i <= 10; i++) {
- BOOST_CHECK(!s.contains(i));
- BOOST_CHECK(t.contains(i));
- }
-
- RangeExpectations().expect(0, 2).expect(6, 6).expect(8, 8).check(s);
- RangeExpectations().expect(3, 5).expect(7, 7).expect(9, 10).check(t);
-}
-
-QPID_AUTO_TEST_SUITE_END()
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/SessionState.cpp b/M4-RCs/qpid/cpp/src/tests/SessionState.cpp
deleted file mode 100644
index 2db25f9fe8..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/SessionState.cpp
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "unit_test.h"
-
-#include "qpid/SessionState.h"
-#include "qpid/Exception.h"
-#include "qpid/framing/MessageTransferBody.h"
-#include "qpid/framing/SessionFlushBody.h"
-
-#include <boost/bind.hpp>
-#include <algorithm>
-#include <functional>
-#include <numeric>
-
-QPID_AUTO_TEST_SUITE(SessionStateTestSuite)
-
-using namespace std;
-using namespace boost;
-using namespace qpid::framing;
-
-// ================================================================
-// Utility functions.
-
-// Apply f to [begin, end) and accumulate the result
-template <class Iter, class T, class F>
-T applyAccumulate(Iter begin, Iter end, T seed, const F& f) {
- return std::accumulate(begin, end, seed, bind(std::plus<T>(), _1, bind(f, _2)));
-}
-
-// Create a frame with a one-char string.
-AMQFrame& frame(char s) {
- static AMQFrame frame;
- frame.setBody(AMQContentBody(string(&s, 1)));
- return frame;
-}
-
-// Simple string representation of a frame.
-string str(const AMQFrame& f) {
- if (f.getMethod()) return "C"; // Command or Control
- const AMQContentBody* c = dynamic_cast<const AMQContentBody*>(f.getBody());
- if (c) return c->getData(); // Return data for content frames.
- return "H"; // Must be a header.
-}
-// Make a string from a range of frames.
-string str(const boost::iterator_range<vector<AMQFrame>::const_iterator>& frames) {
- string (*strFrame)(const AMQFrame&) = str;
- return applyAccumulate(frames.begin(), frames.end(), string(), ptr_fun(strFrame));
-}
-// Make a transfer command frame.
-AMQFrame transferFrame(bool hasContent) {
- AMQFrame t(in_place<MessageTransferBody>());
- t.setFirstFrame(true);
- t.setLastFrame(true);
- t.setFirstSegment(true);
- t.setLastSegment(!hasContent);
- return t;
-}
-// Make a content frame
-AMQFrame contentFrame(string content, bool isLast=true) {
- AMQFrame f(in_place<AMQContentBody>(content));
- f.setFirstFrame(true);
- f.setLastFrame(true);
- f.setFirstSegment(false);
- f.setLastSegment(isLast);
- return f;
-}
-AMQFrame contentFrameChar(char content, bool isLast=true) {
- return contentFrame(string(1, content), isLast);
-}
-
-// Send frame & return size of frame.
-size_t send(qpid::SessionState& s, const AMQFrame& f) { s.senderRecord(f); return f.encodedSize(); }
-// Send transfer command with no content.
-size_t transfer0(qpid::SessionState& s) { return send(s, transferFrame(false)); }
-// Send transfer frame with single content frame.
-size_t transfer1(qpid::SessionState& s, string content) {
- return send(s,transferFrame(true)) + send(s,contentFrame(content));
-}
-size_t transfer1Char(qpid::SessionState& s, char content) {
- return transfer1(s, string(1,content));
-}
-
-// Send transfer frame with multiple single-byte content frames.
-size_t transferN(qpid::SessionState& s, string content) {
- size_t size=send(s, transferFrame(!content.empty()));
- if (!content.empty()) {
- char last = content[content.size()-1];
- content.resize(content.size()-1);
- size += applyAccumulate(content.begin(), content.end(), 0,
- bind(&send, ref(s),
- bind(contentFrameChar, _1, false)));
- size += send(s, contentFrameChar(last, true));
- }
- return size;
-}
-
-// Send multiple transfers with single-byte content.
-size_t transfers(qpid::SessionState& s, string content) {
- return applyAccumulate(content.begin(), content.end(), 0,
- bind(transfer1Char, ref(s), _1));
-}
-
-size_t contentFrameSize(size_t n=1) { return AMQFrame(in_place<AMQContentBody>()).encodedSize() + n; }
-size_t transferFrameSize() { return AMQFrame(in_place<MessageTransferBody>()).encodedSize(); }
-
-// ==== qpid::SessionState test classes
-
-using qpid::SessionId;
-using qpid::SessionPoint;
-
-
-QPID_AUTO_TEST_CASE(testSendGetReplyList) {
- qpid::SessionState s;
- s.setTimeout(1);
- s.senderGetCommandPoint();
- transfer1(s, "abc");
- transfers(s, "def");
- transferN(s, "xyz");
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint(0,0))),"CabcCdCeCfCxyz");
- // Ignore controls.
- s.senderRecord(AMQFrame(in_place<SessionFlushBody>()));
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint(2,0))),"CeCfCxyz");
-}
-
-QPID_AUTO_TEST_CASE(testNeedFlush) {
- qpid::SessionState::Configuration c;
- // sync after 2 1-byte transfers or equivalent bytes.
- c.replayFlushLimit = 2*(transferFrameSize()+contentFrameSize());
- qpid::SessionState s(SessionId(), c);
- s.setTimeout(1);
- s.senderGetCommandPoint();
- transfers(s, "a");
- BOOST_CHECK(!s.senderNeedFlush());
- transfers(s, "b");
- BOOST_CHECK(s.senderNeedFlush());
- s.senderRecordFlush();
- BOOST_CHECK(!s.senderNeedFlush());
- transfers(s, "c");
- BOOST_CHECK(!s.senderNeedFlush());
- transfers(s, "d");
- BOOST_CHECK(s.senderNeedFlush());
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint())), "CaCbCcCd");
-}
-
-QPID_AUTO_TEST_CASE(testPeerConfirmed) {
- qpid::SessionState::Configuration c;
- // sync after 2 1-byte transfers or equivalent bytes.
- c.replayFlushLimit = 2*(transferFrameSize()+contentFrameSize());
- qpid::SessionState s(SessionId(), c);
- s.setTimeout(1);
- s.senderGetCommandPoint();
- transfers(s, "ab");
- BOOST_CHECK(s.senderNeedFlush());
- transfers(s, "cd");
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint(0,0))), "CaCbCcCd");
- s.senderConfirmed(SessionPoint(3));
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint(3,0))), "Cd");
- BOOST_CHECK(!s.senderNeedFlush());
-
- // Multi-frame transfer.
- transfer1(s, "efg");
- transfers(s, "xy");
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint(3,0))), "CdCefgCxCy");
- BOOST_CHECK(s.senderNeedFlush());
-
- s.senderConfirmed(SessionPoint(4));
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint(4,0))), "CefgCxCy");
- BOOST_CHECK(s.senderNeedFlush());
-
- s.senderConfirmed(SessionPoint(5));
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint(5,0))), "CxCy");
- BOOST_CHECK(s.senderNeedFlush());
-
- s.senderConfirmed(SessionPoint(6));
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint(6,0))), "Cy");
- BOOST_CHECK(!s.senderNeedFlush());
-}
-
-QPID_AUTO_TEST_CASE(testPeerCompleted) {
- qpid::SessionState s;
- s.setTimeout(1);
- s.senderGetCommandPoint();
- // Completion implies confirmation
- transfers(s, "abc");
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint(0,0))), "CaCbCc");
- SequenceSet set(SequenceSet() + 0 + 1);
- s.senderCompleted(set);
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint(2,0))), "Cc");
-
- transfers(s, "def");
- // We dont do out-of-order confirmation, so this will only confirm up to 3:
- set = SequenceSet(SequenceSet() + 2 + 3 + 5);
- s.senderCompleted(set);
- BOOST_CHECK_EQUAL(str(s.senderExpected(SessionPoint(4,0))), "CeCf");
-}
-
-QPID_AUTO_TEST_CASE(testReceive) {
- // Advance expected/received correctly
- qpid::SessionState s;
- s.receiverSetCommandPoint(SessionPoint());
- BOOST_CHECK_EQUAL(s.receiverGetExpected(), SessionPoint(0));
- BOOST_CHECK_EQUAL(s.receiverGetReceived(), SessionPoint(0));
-
- BOOST_CHECK(s.receiverRecord(transferFrame(false)));
- BOOST_CHECK_EQUAL(s.receiverGetExpected(), SessionPoint(1));
- BOOST_CHECK_EQUAL(s.receiverGetReceived(), SessionPoint(1));
-
- BOOST_CHECK(s.receiverRecord(transferFrame(true)));
- SessionPoint point = SessionPoint(1, transferFrameSize());
- BOOST_CHECK_EQUAL(s.receiverGetExpected(), point);
- BOOST_CHECK_EQUAL(s.receiverGetReceived(), point);
- BOOST_CHECK(s.receiverRecord(contentFrame("", false)));
- point.offset += contentFrameSize(0);
- BOOST_CHECK_EQUAL(s.receiverGetExpected(), point);
- BOOST_CHECK_EQUAL(s.receiverGetReceived(), point);
- BOOST_CHECK(s.receiverRecord(contentFrame("", true)));
- BOOST_CHECK_EQUAL(s.receiverGetExpected(), SessionPoint(2));
- BOOST_CHECK_EQUAL(s.receiverGetReceived(), SessionPoint(2));
-
- // Idempotence barrier, rewind expected & receive some duplicates.
- s.receiverSetCommandPoint(SessionPoint(1));
- BOOST_CHECK(!s.receiverRecord(transferFrame(false)));
- BOOST_CHECK_EQUAL(s.receiverGetExpected(), SessionPoint(2));
- BOOST_CHECK_EQUAL(s.receiverGetReceived(), SessionPoint(2));
- BOOST_CHECK(s.receiverRecord(transferFrame(false)));
- BOOST_CHECK_EQUAL(s.receiverGetExpected(), SessionPoint(3));
- BOOST_CHECK_EQUAL(s.receiverGetReceived(), SessionPoint(3));
-}
-
-QPID_AUTO_TEST_CASE(testCompleted) {
- // completed & unknownCompleted
- qpid::SessionState s;
- s.receiverSetCommandPoint(SessionPoint());
- s.receiverRecord(transferFrame(false));
- s.receiverRecord(transferFrame(false));
- s.receiverRecord(transferFrame(false));
- s.receiverCompleted(1);
- BOOST_CHECK_EQUAL(s.receiverGetUnknownComplete(), SequenceSet(SequenceSet()+1));
- s.receiverCompleted(0);
- BOOST_CHECK_EQUAL(s.receiverGetUnknownComplete(),
- SequenceSet(SequenceSet() + qpid::Range<SequenceNumber>(0,2)));
- s.receiverKnownCompleted(SequenceSet(SequenceSet()+1));
- BOOST_CHECK_EQUAL(s.receiverGetUnknownComplete(), SequenceSet(SequenceSet()+2));
- // TODO aconway 2008-04-30: missing tests for known-completed.
-}
-
-QPID_AUTO_TEST_CASE(testNeedKnownCompleted) {
- size_t flushInterval= 2*(transferFrameSize()+contentFrameSize())+1;
- qpid::SessionState::Configuration c(flushInterval);
- qpid::SessionState s(qpid::SessionId(), c);
- s.senderGetCommandPoint();
- transfers(s, "a");
- SequenceSet set(SequenceSet() + 0);
- s.senderCompleted(set);
- BOOST_CHECK(!s.senderNeedKnownCompleted());
-
- transfers(s, "b");
- set += 1;
- s.senderCompleted(set);
- BOOST_CHECK(!s.senderNeedKnownCompleted());
-
- transfers(s, "c");
- set += 2;
- s.senderCompleted(set);
- BOOST_CHECK(s.senderNeedKnownCompleted());
- s.senderRecordKnownCompleted();
- BOOST_CHECK(!s.senderNeedKnownCompleted());
-
- transfers(s, "de");
- set += 3;
- set += 4;
- s.senderCompleted(set);
- BOOST_CHECK(!s.senderNeedKnownCompleted());
-
- transfers(s, "f");
- set += 2;
- s.senderCompleted(set);
- BOOST_CHECK(s.senderNeedKnownCompleted());
- s.senderRecordKnownCompleted();
- BOOST_CHECK(!s.senderNeedKnownCompleted());
-}
-
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/Shlib.cpp b/M4-RCs/qpid/cpp/src/tests/Shlib.cpp
deleted file mode 100644
index 426a052c9f..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/Shlib.cpp
+++ /dev/null
@@ -1,60 +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 "test_tools.h"
-#include "qpid/sys/Shlib.h"
-#include "qpid/Exception.h"
-
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(ShlibTestSuite)
-
-using namespace qpid::sys;
-typedef void (*CallMe)(int*);
-
-QPID_AUTO_TEST_CASE(testShlib) {
- Shlib sh(".libs/libshlibtest.so");
- // Double cast to avoid ISO warning.
- CallMe callMe=sh.getSymbol<CallMe>("callMe");
- BOOST_REQUIRE(callMe != 0);
- int unloaded=0;
- callMe(&unloaded);
- sh.unload();
- BOOST_CHECK_EQUAL(42, unloaded);
- try {
- sh.getSymbol("callMe");
- BOOST_FAIL("Expected exception");
- }
- catch (const qpid::Exception&) {}
-}
-
-QPID_AUTO_TEST_CASE(testAutoShlib) {
- int unloaded = 0;
- {
- AutoShlib sh(".libs/libshlibtest.so");
- CallMe callMe=sh.getSymbol<CallMe>("callMe");
- BOOST_REQUIRE(callMe != 0);
- callMe(&unloaded);
- }
- BOOST_CHECK_EQUAL(42, unloaded);
-}
-
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/SimpleTestCaseBase.cpp b/M4-RCs/qpid/cpp/src/tests/SimpleTestCaseBase.cpp
deleted file mode 100644
index 2739734731..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/SimpleTestCaseBase.cpp
+++ /dev/null
@@ -1,87 +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 "SimpleTestCaseBase.h"
-
-using namespace qpid;
-
-void SimpleTestCaseBase::start()
-{
- if (worker.get()) {
- worker->start();
- }
-}
-
-void SimpleTestCaseBase::stop()
-{
- if (worker.get()) {
- worker->stop();
- }
-}
-
-void SimpleTestCaseBase::report(client::Message& report)
-{
- if (worker.get()) {
- report.getHeaders().setInt("MESSAGE_COUNT", worker->getCount());
- //add number of messages sent or received
- std::stringstream reportstr;
- reportstr << worker->getCount();
- report.setData(reportstr.str());
- }
-}
-
-SimpleTestCaseBase::Sender::Sender(ConnectionOptions& options,
- const Exchange& _exchange,
- const std::string& _key,
- const int _messages)
- : Worker(options, _messages), exchange(_exchange), key(_key) {}
-
-void SimpleTestCaseBase::Sender::init()
-{
- channel.start();
-}
-
-void SimpleTestCaseBase::Sender::start(){
- Message msg;
- while (count < messages) {
- channel.publish(msg, exchange, key);
- count++;
- }
- stop();
-}
-
-SimpleTestCaseBase::Worker::Worker(ConnectionOptions& options, const int _messages) :
- messages(_messages), count(0)
-{
- connection.open(options.host, options.port);
- connection.openChannel(channel);
-}
-
-void SimpleTestCaseBase::Worker::stop()
-{
- channel.close();
- connection.close();
-}
-
-int SimpleTestCaseBase::Worker::getCount()
-{
- return count;
-}
-
diff --git a/M4-RCs/qpid/cpp/src/tests/SimpleTestCaseBase.h b/M4-RCs/qpid/cpp/src/tests/SimpleTestCaseBase.h
deleted file mode 100644
index 0c1052d0c2..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/SimpleTestCaseBase.h
+++ /dev/null
@@ -1,89 +0,0 @@
-#ifndef _SimpleTestCaseBase_
-#define _SimpleTestCaseBase_
-/*
- *
- * 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 <memory>
-#include <sstream>
-
-#include "qpid/Exception.h"
-#include "qpid/client/Channel.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/Connection.h"
-#include "ConnectionOptions.h"
-#include "qpid/client/MessageListener.h"
-#include "TestCase.h"
-
-
-namespace qpid {
-
-using namespace qpid::client;
-
-class SimpleTestCaseBase : public TestCase
-{
-protected:
- class Worker
- {
- protected:
- client::Connection connection;
- client::Channel channel;
- const int messages;
- int count;
-
- public:
-
- Worker(ConnectionOptions& options, const int messages);
- virtual ~Worker(){}
-
- virtual void stop();
- virtual int getCount();
- virtual void init() = 0;
- virtual void start() = 0;
- };
-
- class Sender : public Worker
- {
- const Exchange& exchange;
- const std::string key;
- public:
- Sender(ConnectionOptions& options,
- const Exchange& exchange,
- const std::string& key,
- const int messages);
- void init();
- void start();
- };
-
- std::auto_ptr<Worker> worker;
-
-public:
- virtual void assign(const std::string& role, framing::FieldTable& params, ConnectionOptions& options) = 0;
-
- virtual ~SimpleTestCaseBase() {}
-
- void start();
- void stop();
- void report(client::Message& report);
-};
-
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/tests/SocketProxy.h b/M4-RCs/qpid/cpp/src/tests/SocketProxy.h
deleted file mode 100644
index 9722359d82..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/SocketProxy.h
+++ /dev/null
@@ -1,143 +0,0 @@
-#ifndef SOCKETPROXY_H
-#define SOCKETPROXY_H
-
-/*
- * 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 "qpid/sys/Socket.h"
-#include "qpid/sys/Poller.h"
-#include "qpid/sys/Runnable.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/sys/Mutex.h"
-#include "qpid/client/Connection.h"
-#include "qpid/log/Statement.h"
-
-#include <algorithm>
-
-/**
- * A simple socket proxy that forwards to another socket.
- * Used between client & local broker to simulate network failures.
- */
-class SocketProxy : private qpid::sys::Runnable
-{
- public:
- /** Connect to connectPort on host, start a forwarding thread.
- * Listen for connection on getPort().
- */
- SocketProxy(int connectPort, const std::string host="localhost")
- : closed(false), port(listener.listen()), dropClient(), dropServer()
- {
- client.connect(host, connectPort);
- thread = qpid::sys::Thread(static_cast<qpid::sys::Runnable*>(this));
- }
-
- ~SocketProxy() { close(); }
-
- /** Simulate a network disconnect. */
- void close() {
- {
- qpid::sys::Mutex::ScopedLock l(lock);
- if (closed) return;
- closed=true;
- }
- poller.shutdown();
- if (thread.id() != qpid::sys::Thread::current().id())
- thread.join();
- client.close();
- }
-
- /** Simulate lost packets, drop data from client */
- void dropClientData(bool drop=true) { dropClient=drop; }
-
- /** Simulate lost packets, drop data from server */
- void dropServerData(bool drop=true) { dropServer=drop; }
-
- bool isClosed() const {
- qpid::sys::Mutex::ScopedLock l(lock);
- return closed;
- }
-
- uint16_t getPort() const { return port; }
-
- private:
- static void throwErrno(const std::string& msg) {
- throw qpid::Exception(msg+":"+qpid::sys::strError(errno));
- }
- static void throwIf(bool condition, const std::string& msg) {
- if (condition) throw qpid::Exception(msg);
- }
-
- void run() {
- std::auto_ptr<qpid::sys::Socket> server;
- try {
- qpid::sys::PollerHandle listenerHandle(listener);
- poller.addFd(listenerHandle, qpid::sys::Poller::INPUT);
- qpid::sys::Poller::Event event = poller.wait();
- throwIf(event.type == qpid::sys::Poller::SHUTDOWN, "SocketProxy: Closed by close()");
- throwIf(!(event.type == qpid::sys::Poller::READABLE && event.handle == &listenerHandle), "SocketProxy: Accept failed");
-
- poller.delFd(listenerHandle);
- server.reset(listener.accept(0, 0));
-
- // Pump data between client & server sockets
- qpid::sys::PollerHandle clientHandle(client);
- qpid::sys::PollerHandle serverHandle(*server);
- poller.addFd(clientHandle, qpid::sys::Poller::INPUT);
- poller.addFd(serverHandle, qpid::sys::Poller::INPUT);
- char buffer[1024];
- for (;;) {
- qpid::sys::Poller::Event event = poller.wait();
- throwIf(event.type == qpid::sys::Poller::SHUTDOWN, "SocketProxy: Closed by close()");
- throwIf(event.type == qpid::sys::Poller::DISCONNECTED, "SocketProxy: client/server disconnected");
- if (event.handle == &serverHandle) {
- ssize_t n = server->read(buffer, sizeof(buffer));
- if (!dropServer) client.write(buffer, n);
- poller.rearmFd(serverHandle);
- } else if (event.handle == &clientHandle) {
- ssize_t n = client.read(buffer, sizeof(buffer));
- if (!dropClient) server->write(buffer, n);
- poller.rearmFd(clientHandle);
- } else {
- throwIf(true, "SocketProxy: No handle ready");
- }
- }
- }
- catch (const std::exception& e) {
- QPID_LOG(debug, "SocketProxy::run exception: " << e.what());
- }
- try {
- if (server.get()) server->close();
- close();
- }
- catch (const std::exception& e) {
- QPID_LOG(debug, "SocketProxy::run exception in client/server close()" << e.what());
- }
- }
-
- mutable qpid::sys::Mutex lock;
- bool closed;
- qpid::sys::Poller poller;
- qpid::sys::Socket client, listener;
- uint16_t port;
- qpid::sys::Thread thread;
- bool dropClient, dropServer;
-};
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/tests/StringUtils.cpp b/M4-RCs/qpid/cpp/src/tests/StringUtils.cpp
deleted file mode 100644
index 6a19119288..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/StringUtils.cpp
+++ /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.
- *
- */
-#include <iostream>
-#include "qpid/StringUtils.h"
-
-#include "unit_test.h"
-
-QPID_AUTO_TEST_SUITE(StringUtilsTestSuite)
-
-using namespace qpid;
-using std::string;
-
-QPID_AUTO_TEST_CASE(testSplit_general)
-{
- std::vector<std::string> results = split("a bbbb, car,d123,,,e", ", ");
- BOOST_CHECK_EQUAL(5u, results.size());
- BOOST_CHECK_EQUAL(string("a"), results[0]);
- BOOST_CHECK_EQUAL(string("bbbb"), results[1]);
- BOOST_CHECK_EQUAL(string("car"), results[2]);
- BOOST_CHECK_EQUAL(string("d123"), results[3]);
- BOOST_CHECK_EQUAL(string("e"), results[4]);
-}
-
-QPID_AUTO_TEST_CASE(testSplit_noDelims)
-{
- std::vector<std::string> results = split("abc", ", ");
- BOOST_CHECK_EQUAL(1u, results.size());
- BOOST_CHECK_EQUAL(string("abc"), results[0]);
-}
-
-QPID_AUTO_TEST_CASE(testSplit_delimAtEnd)
-{
- std::vector<std::string> results = split("abc def,,", ", ");
- BOOST_CHECK_EQUAL(2u, results.size());
- BOOST_CHECK_EQUAL(string("abc"), results[0]);
- BOOST_CHECK_EQUAL(string("def"), results[1]);
-}
-
-QPID_AUTO_TEST_CASE(testSplit_delimAtStart)
-{
- std::vector<std::string> results = split(",,abc def", ", ");
- BOOST_CHECK_EQUAL(2u, results.size());
- BOOST_CHECK_EQUAL(string("abc"), results[0]);
- BOOST_CHECK_EQUAL(string("def"), results[1]);
-}
-
-QPID_AUTO_TEST_CASE(testSplit_onlyDelims)
-{
- std::vector<std::string> results = split(",, , ", ", ");
- BOOST_CHECK_EQUAL(0u, results.size());
-}
-
-QPID_AUTO_TEST_CASE(testSplit_empty)
-{
- std::vector<std::string> results = split("", ", ");
- BOOST_CHECK_EQUAL(0u, results.size());
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/TestCase.h b/M4-RCs/qpid/cpp/src/tests/TestCase.h
deleted file mode 100644
index ba3330c951..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/TestCase.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef _TestCase_
-#define _TestCase_
-/*
- *
- * 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 "ConnectionOptions.h"
-#include "qpid/client/Message.h"
-
-
-namespace qpid {
-
-/**
- * Interface to be implemented by test cases for use with the test
- * runner.
- */
-class TestCase
-{
-public:
- /**
- * Directs the test case to act in a particular role. Some roles
- * may be 'activated' at this stage others may require an explicit
- * start request.
- */
- virtual void assign(const std::string& role, framing::FieldTable& params, client::ConnectionOptions& options) = 0;
- /**
- * Each test will be started on its own thread, which should block
- * until the test completes (this may or may not require an
- * explicit stop() request).
- */
- virtual void start() = 0;
- /**
- * Requests that the test be stopped if still running.
- */
- virtual void stop() = 0;
- /**
- * Allows the test to fill in details on the final report
- * message. Will be called only after start has returned.
- */
- virtual void report(client::Message& report) = 0;
-
- virtual ~TestCase() {}
-};
-
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/tests/TestMessageStore.h b/M4-RCs/qpid/cpp/src/tests/TestMessageStore.h
deleted file mode 100644
index be1ed57349..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/TestMessageStore.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _tests_TestMessageStore_h
-#define _tests_TestMessageStore_h
-
-/*
- *
- * 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 "qpid/broker/NullMessageStore.h"
-#include <vector>
-
-using namespace qpid;
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-typedef std::pair<string, boost::intrusive_ptr<PersistableMessage> > msg_queue_pair;
-
-class TestMessageStore : public NullMessageStore
-{
- public:
- std::vector<boost::intrusive_ptr<PersistableMessage> > dequeued;
- std::vector<msg_queue_pair> enqueued;
-
- void dequeue(TransactionContext*,
- const boost::intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue& /*queue*/)
- {
- dequeued.push_back(msg);
- }
-
- void enqueue(TransactionContext*,
- const boost::intrusive_ptr<PersistableMessage>& msg,
- const PersistableQueue& queue)
- {
- msg->enqueueComplete();
- enqueued.push_back(msg_queue_pair(queue.getName(), msg));
- }
-
- TestMessageStore() : NullMessageStore() {}
- ~TestMessageStore(){}
-};
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/tests/TestOptions.h b/M4-RCs/qpid/cpp/src/tests/TestOptions.h
deleted file mode 100644
index a400fe5ecb..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/TestOptions.h
+++ /dev/null
@@ -1,79 +0,0 @@
-#ifndef _TestOptions_
-#define _TestOptions_
-/*
- *
- * 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 "qpid/Options.h"
-#include "qpid/log/Options.h"
-#include "qpid/Url.h"
-#include "qpid/log/Logger.h"
-#include "qpid/client/Connection.h"
-#include "ConnectionOptions.h"
-
-#include <iostream>
-#include <exception>
-
-namespace qpid {
-
-struct TestOptions : public qpid::Options
-{
- TestOptions(const std::string& helpText_=std::string(),
- const std::string& argv0=std::string())
- : Options("Test Options"), help(false), log(argv0), helpText(helpText_)
- {
- addOptions()
- ("help", optValue(help), "print this usage statement");
- add(con);
- add(log);
- }
-
- /** As well as parsing, throw help message if requested. */
- void parse(int argc, char** argv) {
- try {
- qpid::Options::parse(argc, argv);
- } catch (const std::exception& e) {
- std::ostringstream msg;
- msg << *this << std::endl << std::endl << e.what() << std::endl;
- throw qpid::Options::Exception(msg.str());
- }
- qpid::log::Logger::instance().configure(log);
- if (help) {
- std::ostringstream msg;
- msg << *this << std::endl << std::endl << helpText << std::endl;
- throw qpid::Options::Exception(msg.str());
- }
- }
-
- /** Open a connection using option values */
- void open(qpid::client::Connection& connection) {
- connection.open(con);
- }
-
-
- bool help;
- ConnectionOptions con;
- qpid::log::Options log;
- std::string helpText;
-};
-
-}
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/tests/TimerTest.cpp b/M4-RCs/qpid/cpp/src/tests/TimerTest.cpp
deleted file mode 100644
index 50712ff79c..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/TimerTest.cpp
+++ /dev/null
@@ -1,120 +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 "qpid/broker/Timer.h"
-#include "qpid/sys/Monitor.h"
-#include "unit_test.h"
-#include <math.h>
-#include <iostream>
-#include <memory>
-#include <boost/format.hpp>
-#include <boost/lexical_cast.hpp>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-using boost::intrusive_ptr;
-using boost::dynamic_pointer_cast;
-
-class Counter
-{
- Mutex lock;
- uint counter;
- public:
- Counter() : counter(0) {}
- uint next()
- {
- Mutex::ScopedLock l(lock);
- return ++counter;
- }
-};
-
-class TestTask : public TimerTask
-{
- const AbsTime start;
- const Duration expected;
- AbsTime end;
- bool fired;
- uint position;
- Monitor monitor;
- Counter& counter;
-
- public:
- TestTask(Duration timeout, Counter& _counter)
- : TimerTask(timeout), start(now()), expected(timeout), end(start), fired(false), counter(_counter) {}
-
- void fire()
- {
- Monitor::ScopedLock l(monitor);
- fired = true;
- position = counter.next();
- end = now();
- monitor.notify();
- }
-
- void check(uint expected_position, uint64_t tolerance = 500 * TIME_MSEC)
- {
- Monitor::ScopedLock l(monitor);
- BOOST_CHECK(fired);
- BOOST_CHECK_EQUAL(expected_position, position);
- Duration actual(start, end);
- uint64_t difference = abs(expected - actual);
- std::string msg(boost::lexical_cast<std::string>(boost::format("tolerance = %1%, difference = %2%") % tolerance % difference));
- BOOST_CHECK_MESSAGE(difference < tolerance, msg);
- }
-
- void wait(Duration d)
- {
- Monitor::ScopedLock l(monitor);
- monitor.wait(AbsTime(now(), d));
- }
-};
-
-class DummyRunner : public Runnable
-{
- public:
- void run() {}
-};
-
-QPID_AUTO_TEST_SUITE(TimerTestSuite)
-
-QPID_AUTO_TEST_CASE(testGeneral)
-{
- Counter counter;
- Timer timer;
- intrusive_ptr<TestTask> task1(new TestTask(Duration(3 * TIME_SEC), counter));
- intrusive_ptr<TestTask> task2(new TestTask(Duration(1 * TIME_SEC), counter));
- intrusive_ptr<TestTask> task3(new TestTask(Duration(4 * TIME_SEC), counter));
- intrusive_ptr<TestTask> task4(new TestTask(Duration(2 * TIME_SEC), counter));
-
- timer.add(task1);
- timer.add(task2);
- timer.add(task3);
- timer.add(task4);
-
- dynamic_pointer_cast<TestTask>(task3)->wait(Duration(6 * TIME_SEC));
-
- dynamic_pointer_cast<TestTask>(task1)->check(3);
- dynamic_pointer_cast<TestTask>(task2)->check(1);
- dynamic_pointer_cast<TestTask>(task3)->check(4);
- dynamic_pointer_cast<TestTask>(task4)->check(2);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/TopicExchangeTest.cpp b/M4-RCs/qpid/cpp/src/tests/TopicExchangeTest.cpp
deleted file mode 100644
index af4263de34..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/TopicExchangeTest.cpp
+++ /dev/null
@@ -1,167 +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 "qpid/broker/TopicExchange.h"
-#include "unit_test.h"
-#include "test_tools.h"
-
-using namespace qpid::broker;
-
-Tokens makeTokens(const char** begin, const char** end)
-{
- Tokens t;
- t.insert(t.end(), begin, end);
- return t;
-}
-
-// Calculate size of an array.
-#define LEN(a) (sizeof(a)/sizeof(a[0]))
-
-// Convert array to token vector
-#define TOKENS(a) makeTokens(a, a + LEN(a))
-
-#define ASSERT_NORMALIZED(expect, pattern) \
- BOOST_CHECK_EQUAL(Tokens(expect), static_cast<Tokens>(TopicPattern(pattern)))
-
-
-QPID_AUTO_TEST_SUITE(TopicExchangeTestSuite)
-
-QPID_AUTO_TEST_CASE(testTokens)
-{
- Tokens tokens("hello.world");
- const char* expect[] = {"hello", "world"};
- BOOST_CHECK_EQUAL(TOKENS(expect), tokens);
-
- tokens = "a.b.c";
- const char* expect2[] = { "a", "b", "c" };
- BOOST_CHECK_EQUAL(TOKENS(expect2), tokens);
-
- tokens = "";
- BOOST_CHECK(tokens.empty());
-
- tokens = "x";
- const char* expect3[] = { "x" };
- BOOST_CHECK_EQUAL(TOKENS(expect3), tokens);
-
- tokens = (".x");
- const char* expect4[] = { "", "x" };
- BOOST_CHECK_EQUAL(TOKENS(expect4), tokens);
-
- tokens = ("x.");
- const char* expect5[] = { "x", "" };
- BOOST_CHECK_EQUAL(TOKENS(expect5), tokens);
-
- tokens = (".");
- const char* expect6[] = { "", "" };
- BOOST_CHECK_EQUAL(TOKENS(expect6), tokens);
-
- tokens = ("..");
- const char* expect7[] = { "", "", "" };
- BOOST_CHECK_EQUAL(TOKENS(expect7), tokens);
-}
-
-QPID_AUTO_TEST_CASE(testNormalize)
-{
- BOOST_CHECK(TopicPattern("").empty());
- ASSERT_NORMALIZED("a.b.c", "a.b.c");
- ASSERT_NORMALIZED("a.*.c", "a.*.c");
- ASSERT_NORMALIZED("#", "#");
- ASSERT_NORMALIZED("#", "#.#.#.#");
- ASSERT_NORMALIZED("*.*.*.#", "#.*.#.*.#.#.*");
- ASSERT_NORMALIZED("a.*.*.*.#", "a.*.#.*.#.*.#");
- ASSERT_NORMALIZED("a.*.*.*.#", "a.*.#.*.#.*");
-}
-
-QPID_AUTO_TEST_CASE(testPlain)
-{
- TopicPattern p("ab.cd.e");
- BOOST_CHECK(p.match("ab.cd.e"));
- BOOST_CHECK(!p.match("abx.cd.e"));
- BOOST_CHECK(!p.match("ab.cd"));
- BOOST_CHECK(!p.match("ab.cd..e."));
- BOOST_CHECK(!p.match("ab.cd.e."));
- BOOST_CHECK(!p.match(".ab.cd.e"));
-
- p = "";
- BOOST_CHECK(p.match(""));
-
- p = ".";
- BOOST_CHECK(p.match("."));
-}
-
-
-QPID_AUTO_TEST_CASE(testStar)
-{
- TopicPattern p("a.*.b");
- BOOST_CHECK(p.match("a.xx.b"));
- BOOST_CHECK(!p.match("a.b"));
-
- p = "*.x";
- BOOST_CHECK(p.match("y.x"));
- BOOST_CHECK(p.match(".x"));
- BOOST_CHECK(!p.match("x"));
-
- p = "x.x.*";
- BOOST_CHECK(p.match("x.x.y"));
- BOOST_CHECK(p.match("x.x."));
- BOOST_CHECK(!p.match("x.x"));
- BOOST_CHECK(!p.match("q.x.y"));
-}
-
-QPID_AUTO_TEST_CASE(testHash)
-{
- TopicPattern p("a.#.b");
- BOOST_CHECK(p.match("a.b"));
- BOOST_CHECK(p.match("a.x.b"));
- BOOST_CHECK(p.match("a..x.y.zz.b"));
- BOOST_CHECK(!p.match("a.b."));
- BOOST_CHECK(!p.match("q.x.b"));
-
- p = "a.#";
- BOOST_CHECK(p.match("a"));
- BOOST_CHECK(p.match("a.b"));
- BOOST_CHECK(p.match("a.b.c"));
-
- p = "#.a";
- BOOST_CHECK(p.match("a"));
- BOOST_CHECK(p.match("x.y.a"));
-}
-
-QPID_AUTO_TEST_CASE(testMixed)
-{
- TopicPattern p("*.x.#.y");
- BOOST_CHECK(p.match("a.x.y"));
- BOOST_CHECK(p.match("a.x.p.qq.y"));
- BOOST_CHECK(!p.match("a.a.x.y"));
- BOOST_CHECK(!p.match("aa.x.b.c"));
-
- p = "a.#.b.*";
- BOOST_CHECK(p.match("a.b.x"));
- BOOST_CHECK(p.match("a.x.x.x.b.x"));
-}
-
-QPID_AUTO_TEST_CASE(testCombo)
-{
- TopicPattern p("*.#.#.*.*.#");
- BOOST_CHECK(p.match("x.y.z"));
- BOOST_CHECK(p.match("x.y.z.a.b.c"));
- BOOST_CHECK(!p.match("x.y"));
- BOOST_CHECK(!p.match("x"));
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/TxBufferTest.cpp b/M4-RCs/qpid/cpp/src/tests/TxBufferTest.cpp
deleted file mode 100644
index 3d6a12cacc..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/TxBufferTest.cpp
+++ /dev/null
@@ -1,176 +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 "qpid/broker/TxBuffer.h"
-#include "unit_test.h"
-#include <iostream>
-#include <vector>
-#include "TxMocks.h"
-
-using namespace qpid::broker;
-using boost::static_pointer_cast;
-
-QPID_AUTO_TEST_SUITE(TxBufferTestSuite)
-
-QPID_AUTO_TEST_CASE(testCommitLocal)
-{
- MockTransactionalStore store;
- store.expectBegin().expectCommit();
-
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectPrepare().expectCommit();
- MockTxOp::shared_ptr opB(new MockTxOp());
- opB->expectPrepare().expectPrepare().expectCommit().expectCommit();//opB enlisted twice to test relative order
- MockTxOp::shared_ptr opC(new MockTxOp());
- opC->expectPrepare().expectCommit();
-
- TxBuffer buffer;
- buffer.enlist(static_pointer_cast<TxOp>(opA));
- buffer.enlist(static_pointer_cast<TxOp>(opB));
- buffer.enlist(static_pointer_cast<TxOp>(opB));//opB enlisted twice
- buffer.enlist(static_pointer_cast<TxOp>(opC));
-
- BOOST_CHECK(buffer.commitLocal(&store));
- store.check();
- BOOST_CHECK(store.isCommitted());
- opA->check();
- opB->check();
- opC->check();
-}
-
-QPID_AUTO_TEST_CASE(testFailOnCommitLocal)
-{
- MockTransactionalStore store;
- store.expectBegin().expectAbort();
-
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectPrepare().expectRollback();
- MockTxOp::shared_ptr opB(new MockTxOp(true));
- opB->expectPrepare().expectRollback();
- MockTxOp::shared_ptr opC(new MockTxOp());//will never get prepare as b will fail
- opC->expectRollback();
-
- TxBuffer buffer;
- buffer.enlist(static_pointer_cast<TxOp>(opA));
- buffer.enlist(static_pointer_cast<TxOp>(opB));
- buffer.enlist(static_pointer_cast<TxOp>(opC));
-
- BOOST_CHECK(!buffer.commitLocal(&store));
- BOOST_CHECK(store.isAborted());
- store.check();
- opA->check();
- opB->check();
- opC->check();
-}
-
-QPID_AUTO_TEST_CASE(testPrepare)
-{
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectPrepare();
- MockTxOp::shared_ptr opB(new MockTxOp());
- opB->expectPrepare();
- MockTxOp::shared_ptr opC(new MockTxOp());
- opC->expectPrepare();
-
- TxBuffer buffer;
- buffer.enlist(static_pointer_cast<TxOp>(opA));
- buffer.enlist(static_pointer_cast<TxOp>(opB));
- buffer.enlist(static_pointer_cast<TxOp>(opC));
-
- BOOST_CHECK(buffer.prepare(0));
- opA->check();
- opB->check();
- opC->check();
-}
-
-QPID_AUTO_TEST_CASE(testFailOnPrepare)
-{
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectPrepare();
- MockTxOp::shared_ptr opB(new MockTxOp(true));
- opB->expectPrepare();
- MockTxOp::shared_ptr opC(new MockTxOp());//will never get prepare as b will fail
-
- TxBuffer buffer;
- buffer.enlist(static_pointer_cast<TxOp>(opA));
- buffer.enlist(static_pointer_cast<TxOp>(opB));
- buffer.enlist(static_pointer_cast<TxOp>(opC));
-
- BOOST_CHECK(!buffer.prepare(0));
- opA->check();
- opB->check();
- opC->check();
-}
-
-QPID_AUTO_TEST_CASE(testRollback)
-{
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectRollback();
- MockTxOp::shared_ptr opB(new MockTxOp(true));
- opB->expectRollback();
- MockTxOp::shared_ptr opC(new MockTxOp());
- opC->expectRollback();
-
- TxBuffer buffer;
- buffer.enlist(static_pointer_cast<TxOp>(opA));
- buffer.enlist(static_pointer_cast<TxOp>(opB));
- buffer.enlist(static_pointer_cast<TxOp>(opC));
-
- buffer.rollback();
- opA->check();
- opB->check();
- opC->check();
-}
-
-QPID_AUTO_TEST_CASE(testBufferIsClearedAfterRollback)
-{
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectRollback();
- MockTxOp::shared_ptr opB(new MockTxOp());
- opB->expectRollback();
-
- TxBuffer buffer;
- buffer.enlist(static_pointer_cast<TxOp>(opA));
- buffer.enlist(static_pointer_cast<TxOp>(opB));
-
- buffer.rollback();
- buffer.commit();//second call should not reach ops
- opA->check();
- opB->check();
-}
-
-QPID_AUTO_TEST_CASE(testBufferIsClearedAfterCommit)
-{
- MockTxOp::shared_ptr opA(new MockTxOp());
- opA->expectCommit();
- MockTxOp::shared_ptr opB(new MockTxOp());
- opB->expectCommit();
-
- TxBuffer buffer;
- buffer.enlist(static_pointer_cast<TxOp>(opA));
- buffer.enlist(static_pointer_cast<TxOp>(opB));
-
- buffer.commit();
- buffer.rollback();//second call should not reach ops
- opA->check();
- opB->check();
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/TxMocks.h b/M4-RCs/qpid/cpp/src/tests/TxMocks.h
deleted file mode 100644
index fe103c5fe5..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/TxMocks.h
+++ /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.
- *
- */
-#ifndef _tests_TxMocks_h
-#define _tests_TxMocks_h
-
-
-#include "qpid/Exception.h"
-#include "qpid/broker/TransactionalStore.h"
-#include "qpid/broker/TxOp.h"
-#include <iostream>
-#include <vector>
-
-using namespace qpid::broker;
-using boost::static_pointer_cast;
-using std::string;
-
-template <class T> void assertEqualVector(std::vector<T>& expected, std::vector<T>& actual){
- unsigned int i = 0;
- while(i < expected.size() && i < actual.size()){
- BOOST_CHECK_EQUAL(expected[i], actual[i]);
- i++;
- }
- if (i < expected.size()) {
- throw qpid::Exception(QPID_MSG("Missing " << expected[i]));
- } else if (i < actual.size()) {
- throw qpid::Exception(QPID_MSG("Extra " << actual[i]));
- }
- BOOST_CHECK_EQUAL(expected.size(), actual.size());
-}
-
-class TxOpConstants{
-protected:
- const string PREPARE;
- const string COMMIT;
- const string ROLLBACK;
-
- TxOpConstants() : PREPARE("PREPARE"), COMMIT("COMMIT"), ROLLBACK("ROLLBACK") {}
-};
-
-class MockTxOp : public TxOp, public TxOpConstants{
- std::vector<string> expected;
- std::vector<string> actual;
- bool failOnPrepare;
- string debugName;
-public:
- typedef boost::shared_ptr<MockTxOp> shared_ptr;
-
- MockTxOp() : failOnPrepare(false) {}
- MockTxOp(bool _failOnPrepare) : failOnPrepare(_failOnPrepare) {}
-
- void setDebugName(string name){
- debugName = name;
- }
-
- void printExpected(){
- std::cout << std::endl << "MockTxOp[" << debugName << "] expects: ";
- for (std::vector<string>::iterator i = expected.begin(); i < expected.end(); i++) {
- if(i != expected.begin()) std::cout << ", ";
- std::cout << *i;
- }
- std::cout << std::endl;
- }
-
- void printActual(){
- std::cout << std::endl << "MockTxOp[" << debugName << "] actual: ";
- for (std::vector<string>::iterator i = actual.begin(); i < actual.end(); i++) {
- if(i != actual.begin()) std::cout << ", ";
- std::cout << *i;
- }
- std::cout << std::endl;
- }
-
- bool prepare(TransactionContext*) throw(){
- actual.push_back(PREPARE);
- return !failOnPrepare;
- }
- void commit() throw(){
- actual.push_back(COMMIT);
- }
- void rollback() throw(){
- if(!debugName.empty()) std::cout << std::endl << "MockTxOp[" << debugName << "]::rollback()" << std::endl;
- actual.push_back(ROLLBACK);
- }
- MockTxOp& expectPrepare(){
- expected.push_back(PREPARE);
- return *this;
- }
- MockTxOp& expectCommit(){
- expected.push_back(COMMIT);
- return *this;
- }
- MockTxOp& expectRollback(){
- expected.push_back(ROLLBACK);
- return *this;
- }
- void check(){
- assertEqualVector(expected, actual);
- }
-
- void accept(TxOpConstVisitor&) const {}
-
- ~MockTxOp(){}
-};
-
-class MockTransactionalStore : public TransactionalStore{
- const string BEGIN;
- const string BEGIN2PC;
- const string PREPARE;
- const string COMMIT;
- const string ABORT;
- std::vector<string> expected;
- std::vector<string> actual;
-
- enum states {OPEN = 1, PREPARED = 2, COMMITTED = 3, ABORTED = 4};
- int state;
-
- class TestTransactionContext : public TPCTransactionContext{
- MockTransactionalStore* store;
- public:
- TestTransactionContext(MockTransactionalStore* _store) : store(_store) {}
- void prepare(){
- if(!store->isOpen()) throw "txn already completed";
- store->state = PREPARED;
- }
-
- void commit(){
- if(!store->isOpen() && !store->isPrepared()) throw "txn already completed";
- store->state = COMMITTED;
- }
-
- void abort(){
- if(!store->isOpen() && !store->isPrepared()) throw "txn already completed";
- store->state = ABORTED;
- }
- ~TestTransactionContext(){}
- };
-
-public:
- MockTransactionalStore() :
- BEGIN("BEGIN"), BEGIN2PC("BEGIN2PC"), PREPARE("PREPARE"), COMMIT("COMMIT"), ABORT("ABORT"), state(OPEN){}
-
- void collectPreparedXids(std::set<std::string>&)
- {
- throw "Operation not supported";
- }
-
- std::auto_ptr<TPCTransactionContext> begin(const std::string&){
- actual.push_back(BEGIN2PC);
- std::auto_ptr<TPCTransactionContext> txn(new TestTransactionContext(this));
- return txn;
- }
- std::auto_ptr<TransactionContext> begin(){
- actual.push_back(BEGIN);
- std::auto_ptr<TransactionContext> txn(new TestTransactionContext(this));
- return txn;
- }
- void prepare(TPCTransactionContext& ctxt){
- actual.push_back(PREPARE);
- dynamic_cast<TestTransactionContext&>(ctxt).prepare();
- }
- void commit(TransactionContext& ctxt){
- actual.push_back(COMMIT);
- dynamic_cast<TestTransactionContext&>(ctxt).commit();
- }
- void abort(TransactionContext& ctxt){
- actual.push_back(ABORT);
- dynamic_cast<TestTransactionContext&>(ctxt).abort();
- }
- MockTransactionalStore& expectBegin(){
- expected.push_back(BEGIN);
- return *this;
- }
- MockTransactionalStore& expectBegin2PC(){
- expected.push_back(BEGIN2PC);
- return *this;
- }
- MockTransactionalStore& expectPrepare(){
- expected.push_back(PREPARE);
- return *this;
- }
- MockTransactionalStore& expectCommit(){
- expected.push_back(COMMIT);
- return *this;
- }
- MockTransactionalStore& expectAbort(){
- expected.push_back(ABORT);
- return *this;
- }
- void check(){
- assertEqualVector(expected, actual);
- }
-
- bool isPrepared(){
- return state == PREPARED;
- }
-
- bool isCommitted(){
- return state == COMMITTED;
- }
-
- bool isAborted(){
- return state == ABORTED;
- }
-
- bool isOpen() const{
- return state == OPEN;
- }
- ~MockTransactionalStore(){}
-};
-
-#endif
diff --git a/M4-RCs/qpid/cpp/src/tests/TxPublishTest.cpp b/M4-RCs/qpid/cpp/src/tests/TxPublishTest.cpp
deleted file mode 100644
index 9e9715c987..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/TxPublishTest.cpp
+++ /dev/null
@@ -1,94 +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 "qpid/broker/NullMessageStore.h"
-#include "qpid/broker/RecoveryManager.h"
-#include "qpid/broker/TxPublish.h"
-#include "unit_test.h"
-#include <iostream>
-#include <list>
-#include <vector>
-#include "MessageUtils.h"
-#include "TestMessageStore.h"
-
-using std::list;
-using std::pair;
-using std::vector;
-using boost::intrusive_ptr;
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-struct TxPublishTest
-{
-
- TestMessageStore store;
- Queue::shared_ptr queue1;
- Queue::shared_ptr queue2;
- intrusive_ptr<Message> msg;
- TxPublish op;
-
- TxPublishTest() :
- queue1(new Queue("queue1", false, &store, 0)),
- queue2(new Queue("queue2", false, &store, 0)),
- msg(MessageUtils::createMessage("exchange", "routing_key", "id")),
- op(msg)
- {
- msg->getProperties<DeliveryProperties>()->setDeliveryMode(PERSISTENT);
- op.deliverTo(queue1);
- op.deliverTo(queue2);
- }
-};
-
-
-QPID_AUTO_TEST_SUITE(TxPublishTestSuite)
-
-QPID_AUTO_TEST_CASE(testPrepare)
-{
- TxPublishTest t;
-
- intrusive_ptr<PersistableMessage> pmsg = static_pointer_cast<PersistableMessage>(t.msg);
- //ensure messages are enqueued in store
- t.op.prepare(0);
- BOOST_CHECK_EQUAL((size_t) 2, t.store.enqueued.size());
- BOOST_CHECK_EQUAL(string("queue1"), t.store.enqueued[0].first);
- BOOST_CHECK_EQUAL(pmsg, t.store.enqueued[0].second);
- BOOST_CHECK_EQUAL(string("queue2"), t.store.enqueued[1].first);
- BOOST_CHECK_EQUAL(pmsg, t.store.enqueued[1].second);
- BOOST_CHECK_EQUAL( true, ( static_pointer_cast<PersistableMessage>(t.msg))->isEnqueueComplete());
-}
-
-QPID_AUTO_TEST_CASE(testCommit)
-{
- TxPublishTest t;
-
- //ensure messages are delivered to queue
- t.op.prepare(0);
- t.op.commit();
- BOOST_CHECK_EQUAL((uint32_t) 1, t.queue1->getMessageCount());
- intrusive_ptr<Message> msg_dequeue = t.queue1->get().payload;
-
- BOOST_CHECK_EQUAL( true, (static_pointer_cast<PersistableMessage>(msg_dequeue))->isEnqueueComplete());
- BOOST_CHECK_EQUAL(t.msg, msg_dequeue);
-
- BOOST_CHECK_EQUAL((uint32_t) 1, t.queue2->getMessageCount());
- BOOST_CHECK_EQUAL(t.msg, t.queue2->get().payload);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/Url.cpp b/M4-RCs/qpid/cpp/src/tests/Url.cpp
deleted file mode 100644
index f3b42a7208..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/Url.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-
-#include "unit_test.h"
-#include "test_tools.h"
-#include "qpid/Url.h"
-#include <boost/assign.hpp>
-
-using namespace std;
-using namespace qpid;
-using namespace boost::assign;
-
-QPID_AUTO_TEST_SUITE(UrlTestSuite)
-
-#define URL_CHECK_STR(STR) BOOST_CHECK_EQUAL(Url(STR).str(), STR)
-#define URL_CHECK_INVALID(STR) BOOST_CHECK_THROW(Url(STR), Url::Invalid)
-
-QPID_AUTO_TEST_CASE(TestParseTcp) {
- URL_CHECK_STR("amqp:tcp:host:42");
- URL_CHECK_STR("amqp:tcp:host-._~%ff%23:42"); // unreserved chars and pct encoded hex.
-
- // Check defaults
- BOOST_CHECK_EQUAL(Url("amqp:host:42").str(), "amqp:tcp:host:42");
- BOOST_CHECK_EQUAL(Url("amqp:tcp:host").str(), "amqp:tcp:host:5672");
- BOOST_CHECK_EQUAL(Url("amqp:tcp:").str(), "amqp:tcp:127.0.0.1:5672");
- BOOST_CHECK_EQUAL(Url("amqp:").str(), "amqp:tcp:127.0.0.1:5672");
- BOOST_CHECK_EQUAL(Url("amqp::42").str(), "amqp:tcp:127.0.0.1:42");
-
- URL_CHECK_INVALID("amqp::badHost!#$#");
- URL_CHECK_INVALID("amqp::host:badPort");
-}
-
-QPID_AUTO_TEST_CASE(TestParseExample) {
- URL_CHECK_STR("amqp:example:x");
- URL_CHECK_INVALID("amqp:example:badExample");
-}
-
-QPID_AUTO_TEST_CASE(TestParseMultiAddress) {
- URL_CHECK_STR("amqp:tcp:host:0,example:y,tcp:foo:0,example:1");
- URL_CHECK_STR("amqp:example:z,tcp:foo:0");
- URL_CHECK_INVALID("amqp:tcp:h:0,");
- URL_CHECK_INVALID(",amqp:tcp:h");
-}
-
-
-QPID_AUTO_TEST_CASE(TestInvalidAddress) {
- URL_CHECK_INVALID("xxxx");
- URL_CHECK_INVALID("");
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/Uuid.cpp b/M4-RCs/qpid/cpp/src/tests/Uuid.cpp
deleted file mode 100644
index ee86d75a26..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/Uuid.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "qpid/framing/Uuid.h"
-#include "qpid/framing/Buffer.h"
-
-#include "unit_test.h"
-
-#include <set>
-#include <alloca.h>
-
-QPID_AUTO_TEST_SUITE(UuidTestSuite)
-
-using namespace std;
-using namespace qpid::framing;
-
-struct UniqueSet : public std::set<Uuid> {
- void operator()(const Uuid& uuid) {
- BOOST_REQUIRE(find(uuid) == end());
- insert(uuid);
- }
-};
-
-QPID_AUTO_TEST_CASE(testUuidCtor) {
- // Uniqueness
- boost::array<Uuid,1000> uuids;
- for_each(uuids.begin(), uuids.end(), mem_fun_ref(&Uuid::generate));
- UniqueSet unique;
- for_each(uuids.begin(), uuids.end(), unique);
-}
-
-boost::array<uint8_t, 16> sample = {{'\x1b', '\x4e', '\x28', '\xba', '\x2f', '\xa1', '\x11', '\xd2', '\x88', '\x3f', '\xb9', '\xa7', '\x61', '\xbd', '\xe3', '\xfb'}};
-const string sampleStr("1b4e28ba-2fa1-11d2-883f-b9a761bde3fb");
-
-QPID_AUTO_TEST_CASE(testUuidIstream) {
- Uuid uuid;
- istringstream in(sampleStr);
- in >> uuid;
- BOOST_CHECK(!in.fail());
- BOOST_CHECK(uuid == sample);
-}
-
-QPID_AUTO_TEST_CASE(testUuidOstream) {
- Uuid uuid(sample.c_array());
- ostringstream out;
- out << uuid;
- BOOST_CHECK(out.good());
- BOOST_CHECK_EQUAL(out.str(), sampleStr);
-}
-
-QPID_AUTO_TEST_CASE(testUuidEncodeDecode) {
- char* buff = static_cast<char*>(::alloca(Uuid::size()));
- Buffer wbuf(buff, Uuid::size());
- Uuid uuid(sample.c_array());
- uuid.encode(wbuf);
-
- Buffer rbuf(buff, Uuid::size());
- Uuid decoded;
- decoded.decode(rbuf);
- BOOST_CHECK_EQUAL(string(sample.begin(), sample.end()),
- string(decoded.begin(), decoded.end()));
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/XmlClientSessionTest.cpp b/M4-RCs/qpid/cpp/src/tests/XmlClientSessionTest.cpp
deleted file mode 100644
index 98558f0a76..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/XmlClientSessionTest.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- *
- * Licensed to the Apachef 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 "unit_test.h"
-#include "test_tools.h"
-#include "BrokerFixture.h"
-#include "qpid/sys/Shlib.h"
-#include "qpid/sys/Monitor.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/sys/Runnable.h"
-#include "qpid/framing/TransferContent.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/client/LocalQueue.h"
-#include "qpid/client/Session.h"
-#include "qpid/client/SubscriptionManager.h"
-
-#include <boost/optional.hpp>
-#include <boost/lexical_cast.hpp>
-
-#include <vector>
-
-QPID_AUTO_TEST_SUITE(XmlClientSessionTest)
-
-using namespace qpid::client;
-
-using namespace qpid::client::arg;
-using namespace qpid::framing;
-using namespace qpid;
-using qpid::sys::Shlib;
-using qpid::sys::Monitor;
-using std::string;
-using std::cout;
-using std::endl;
-
-Shlib shlib("../.libs/xml.so");
-
-class SubscribedLocalQueue : public LocalQueue {
- private:
- SubscriptionManager& subscriptions;
- public:
- SubscribedLocalQueue(SubscriptionManager& subs) : subscriptions(subs) {}
- Message get () { return pop(); }
- virtual ~SubscribedLocalQueue() {}
-};
-
-
-struct SimpleListener : public MessageListener
-{
- Monitor lock;
- std::vector<Message> messages;
-
- void received(Message& msg)
- {
- Monitor::ScopedLock l(lock);
- messages.push_back(msg);
- lock.notifyAll();
- }
-
- void waitFor(const uint n)
- {
- Monitor::ScopedLock l(lock);
- while (messages.size() < n) {
- lock.wait();
- }
- }
-};
-
-struct ClientSessionFixture : public ProxySessionFixture
-{
- void declareSubscribe(const string& q="odd_blue",
- const string& dest="xml")
- {
- session.queueDeclare(queue=q);
- session.messageSubscribe(queue=q, destination=dest, acquireMode=1);
- session.messageFlow(destination=dest, unit=0, value=0xFFFFFFFF);//messages
- session.messageFlow(destination=dest, unit=1, value=0xFFFFFFFF);//bytes
- }
-};
-
-// ########### START HERE ####################################
-
-
-
-QPID_AUTO_TEST_CASE(testXmlBinding) {
- ClientSessionFixture f;
-
- SubscriptionManager subscriptions(f.session);
- SubscribedLocalQueue localQueue(subscriptions);
-
- f.session.exchangeDeclare(qpid::client::arg::exchange="xml", qpid::client::arg::type="xml");
- f.session.queueDeclare(qpid::client::arg::queue="odd_blue");
- subscriptions.subscribe(localQueue, "odd_blue");
-
- FieldTable binding;
- binding.setString("xquery", "declare variable $color external;"
- "(./message/id mod 2 = 1) and ($color = 'blue')");
- f.session.exchangeBind(qpid::client::arg::exchange="xml", qpid::client::arg::queue="odd_blue", qpid::client::arg::bindingKey="query_name", qpid::client::arg::arguments=binding);
-
- Message message;
- message.getDeliveryProperties().setRoutingKey("query_name");
-
- message.getHeaders().setString("color", "blue");
- string m = "<message><id>1</id></message>";
- message.setData(m);
-
- f.session.messageTransfer(qpid::client::arg::content=message, qpid::client::arg::destination="xml");
-
- Message m2 = localQueue.get();
- BOOST_CHECK_EQUAL(m, m2.getData());
-}
-
-/**
- * Ensure that multiple queues can be bound using the same routing key
- */
-QPID_AUTO_TEST_CASE(testXMLBindMultipleQueues) {
- ClientSessionFixture f;
-
-
- f.session.exchangeDeclare(arg::exchange="xml", arg::type="xml");
- f.session.queueDeclare(arg::queue="blue", arg::exclusive=true, arg::autoDelete=true);
- f.session.queueDeclare(arg::queue="red", arg::exclusive=true, arg::autoDelete=true);
-
- FieldTable blue;
- blue.setString("xquery", "./colour = 'blue'");
- f.session.exchangeBind(arg::exchange="xml", arg::queue="blue", arg::bindingKey="by-colour", arg::arguments=blue);
- FieldTable red;
- red.setString("xquery", "./colour = 'red'");
- f.session.exchangeBind(arg::exchange="xml", arg::queue="red", arg::bindingKey="by-colour", arg::arguments=red);
-
- Message sent1("<colour>blue</colour>", "by-colour");
- f.session.messageTransfer(arg::content=sent1, arg::destination="xml");
-
- Message sent2("<colour>red</colour>", "by-colour");
- f.session.messageTransfer(arg::content=sent2, arg::destination="xml");
-
- Message received;
- BOOST_CHECK(f.subs.get(received, "blue"));
- BOOST_CHECK_EQUAL(sent1.getData(), received.getData());
- BOOST_CHECK(f.subs.get(received, "red"));
- BOOST_CHECK_EQUAL(sent2.getData(), received.getData());
-}
-
-//### Test: Bad XML does not kill the server - and does not even
-// raise an exception, the content is not required to be XML.
-
-QPID_AUTO_TEST_CASE(testXMLSendBadXML) {
- ClientSessionFixture f;
-
- f.session.exchangeDeclare(arg::exchange="xml", arg::type="xml");
- f.session.queueDeclare(arg::queue="blue", arg::exclusive=true, arg::autoDelete=true)\
- ;
- f.session.queueDeclare(arg::queue="red", arg::exclusive=true, arg::autoDelete=true);
-
- FieldTable blue;
- blue.setString("xquery", "./colour = 'blue'");
- f.session.exchangeBind(arg::exchange="xml", arg::queue="blue", arg::bindingKey="by-c\
-olour", arg::arguments=blue);
- FieldTable red;
- red.setString("xquery", "./colour = 'red'");
- f.session.exchangeBind(arg::exchange="xml", arg::queue="red", arg::bindingKey="by-co\
-lour", arg::arguments=red);
-
- Message sent1("<>colour>blue</colour>", "by-colour");
- f.session.messageTransfer(arg::content=sent1, arg::destination="xml");
-
- BOOST_CHECK_EQUAL(1, 1);
-}
-
-
-//### Test: Bad XQuery does not kill the server, but does raise an exception
-
-QPID_AUTO_TEST_CASE(testXMLBadXQuery) {
- ClientSessionFixture f;
-
- f.session.exchangeDeclare(arg::exchange="xml", arg::type="xml");
- f.session.queueDeclare(arg::queue="blue", arg::exclusive=true, arg::autoDelete=true)\
- ;
-
- try {
- ScopedSuppressLogging sl; // Supress logging of error messages for expected error.
- FieldTable blue;
- blue.setString("xquery", "./colour $=! 'blue'");
- f.session.exchangeBind(arg::exchange="xml", arg::queue="blue", arg::bindingKey="by-c\
-olour", arg::arguments=blue);
- }
- catch (const InternalErrorException& e) {
- return;
- }
- BOOST_ERROR("A bad XQuery must raise an exception when used in an XML Binding.");
-
-}
-
-
-//### Test: Each session can provide its own definition for a query name
-
-
-
-//### Test: Bindings persist, surviving broker restart
-
-QPID_AUTO_TEST_SUITE_END()
-
diff --git a/M4-RCs/qpid/cpp/src/tests/acl.py b/M4-RCs/qpid/cpp/src/tests/acl.py
deleted file mode 100755
index 671b2fe247..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/acl.py
+++ /dev/null
@@ -1,459 +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
-import qpid
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import uuid4
-from qpid.testlib import TestBase010, testrunner
-from qmf.console import Session
-from qpid.datatypes import Message
-
-def scan_args(name, default=None, args=sys.argv[1:]):
- if (name in args):
- pos = args.index(name)
- return args[pos + 1]
- elif default:
- return default
- else:
- print "Please specify extra argument: %s" % name
- sys.exit(2)
-
-def extract_args(name, args):
- if (name in args):
- pos = args.index(name)
- del args[pos:pos+2]
- else:
- return None
-
-def get_broker_port():
- return scan_args("--port", "5672")
-
-def get_session(user, passwd):
- socket = connect('127.0.0.1', int(get_broker_port()))
- connection = Connection (sock=socket, username=user, password=passwd)
- connection.start()
- return connection.session(str(uuid4()))
-
-class ACLFile:
- def __init__(self):
- self.f = open('data_dir/policy.acl','w');
-
- def write(self,line):
- self.f.write(line)
-
- def close(self):
- self.f.close()
-
-class ACLTests(TestBase010):
-
- def reload_acl(self):
- acl = self.qmf.getObjects(_class="acl")[0]
- return acl.reloadACLFile()
-
- def setUp(self):
- aclf = ACLFile()
- aclf.write('acl allow all all\n')
- aclf.close()
- TestBase010.setUp(self)
- self.startQmf()
- self.reload_acl()
-
- #=====================================
- # ACL general tests
- #=====================================
-
- def test_deny_all(self):
- """
- Test the deny all mode
- """
- aclf = ACLFile()
- aclf.write('acl allow guest@QPID all all\n')
- aclf.write('acl allow bob@QPID create queue\n')
- aclf.write('acl deny all all')
- aclf.close()
-
- self.reload_acl()
-
- session = get_session('bob','bob')
- try:
- session.queue_declare(queue="deny_queue")
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow queue create request");
- self.fail("Error during queue create request");
-
- try:
- session.exchange_bind(exchange="amq.direct", queue="deny_queue", binding_key="routing_key")
- self.fail("ACL should deny queue bind request");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
-
- def test_allow_all(self):
- """
- Test the allow all mode
- """
- aclf = ACLFile()
- aclf.write('acl deny bob@QPID bind exchange\n')
- aclf.write('acl allow all all')
- aclf.close()
-
- self.reload_acl()
-
- session = get_session('bob','bob')
- try:
- session.queue_declare(queue="allow_queue")
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow queue create request");
- self.fail("Error during queue create request");
-
- try:
- session.exchange_bind(exchange="amq.direct", queue="allow_queue", binding_key="routing_key")
- self.fail("ACL should deny queue bind request");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
-
-
- #=====================================
- # ACL file format tests
- #=====================================
-
- def test_empty_groups(self):
- """
- Test empty groups
- """
- aclf = ACLFile()
- aclf.write('acl group\n')
- aclf.write('acl group admins bob@QPID joe@QPID\n')
- aclf.write('acl allow all all')
- aclf.close()
-
- result = self.reload_acl()
- if (result.text.find("Insufficient tokens for acl definition",0,len(result.text)) == -1):
- self.fail("ACL Reader should reject the acl file due to empty group name")
-
- def test_illegal_acl_formats(self):
- """
- Test illegal acl formats
- """
- aclf = ACLFile()
- aclf.write('acl group admins bob@QPID joe@QPID\n')
- aclf.write('acl allow all all')
- aclf.close()
-
- result = self.reload_acl()
- if (result.text.find("Unknown ACL permission",0,len(result.text)) == -1):
- self.fail(result)
-
- def test_illegal_extension_lines(self):
- """
- Test illegal extension lines
- """
-
- aclf = ACLFile()
- aclf.write('group admins bob@QPID \ ')
- aclf.write(' \ \n')
- aclf.write('joe@QPID \n')
- aclf.write('acl allow all all')
- aclf.close()
-
- result = self.reload_acl()
- if (result.text.find("contains illegal characters",0,len(result.text)) == -1):
- self.fail(result)
-
-
-
- #=====================================
- # ACL queue tests
- #=====================================
-
- def test_queue_acl(self):
- """
- Test various modes for queue acl
- """
- aclf = ACLFile()
- aclf.write('acl deny bob@QPID create queue name=q1 durable=true passive=true\n')
- aclf.write('acl deny bob@QPID create queue name=q2 exclusive=true\n')
- aclf.write('acl deny bob@QPID access queue name=q3\n')
- aclf.write('acl deny bob@QPID purge queue name=q3\n')
- aclf.write('acl deny bob@QPID delete queue name=q4\n')
- aclf.write('acl allow all all')
- aclf.close()
-
- self.reload_acl()
-
- session = get_session('bob','bob')
-
- try:
- session.queue_declare(queue="q1", durable='true', passive='true')
- self.fail("ACL should deny queue create request with name=q1 durable=true passive=true");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.queue_declare(queue="q2", exclusive='true')
- self.fail("ACL should deny queue create request with name=q2 exclusive=true");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.queue_declare(queue="q3", exclusive='true')
- session.queue_declare(queue="q4", durable='true')
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow queue create request for q3 and q4 with any parameter");
-
- try:
- session.queue_query(queue="q3")
- self.fail("ACL should deny queue query request for q3");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.queue_purge(queue="q3")
- self.fail("ACL should deny queue purge request for q3");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.queue_purge(queue="q4")
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow queue purge request for q4");
-
- try:
- session.queue_delete(queue="q4")
- self.fail("ACL should deny queue delete request for q4");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.queue_delete(queue="q3")
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow queue delete request for q3");
-
- #=====================================
- # ACL exchange tests
- #=====================================
-
- def test_exchange_acl(self):
- """
- Test various modes for exchange acl
- """
- aclf = ACLFile()
- aclf.write('acl deny bob@QPID create exchange name=testEx durable=true passive=true\n')
- aclf.write('acl deny bob@QPID create exchange name=ex1 type=direct\n')
- aclf.write('acl deny bob@QPID access exchange name=myEx\n')
- aclf.write('acl deny bob@QPID bind exchange name=myEx queuename=q1 routingkey=rk1\n')
- aclf.write('acl deny bob@QPID unbind exchange name=myEx queuename=q1 routingkey=rk1\n')
- aclf.write('acl deny bob@QPID delete exchange name=myEx\n')
- aclf.write('acl allow all all')
- aclf.close()
-
- self.reload_acl()
-
- session = get_session('bob','bob')
-
- try:
- session.exchange_declare(exchange='testEx', durable='true', passive='true')
- self.fail("ACL should deny exchange create request with name=testEx durable=true passive=true");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.exchange_declare(exchange='ex1', type='direct')
- self.fail("ACL should deny exchange create request with name=ex1 type=direct");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.exchange_declare(exchange='myXml', type='direct')
- session.queue_declare(queue='q1')
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow exchange create request for myXml with any parameter");
-
- try:
- session.exchange_query(name='myEx')
- self.fail("ACL should deny queue query request for q3");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.exchange_bind(exchange='myEx', queue='q1', binding_key='rk1')
- self.fail("ACL should deny exchange bind request with exchange='myEx' queuename='q1' bindingkey='rk1'");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.exchange_bind(exchange='myXml', queue='q1', binding_key='x')
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow exchange bind request for exchange='myXml', queue='q1', binding_key='x'");
- try:
- session.exchange_unbind(exchange='myEx', queue='q1', binding_key='rk1')
- self.fail("ACL should deny exchange unbind request with exchange='myEx' queuename='q1' bindingkey='rk1'");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.exchange_unbind(exchange='myXml', queue='q1', binding_key='x')
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow exchange unbind request for exchange='myXml', queue='q1', binding_key='x'");
-
- try:
- session.exchange_delete(exchange='myEx')
- self.fail("ACL should deny exchange delete request for myEx");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.exchange_delete(exchange='myXml')
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow exchange delete request for myXml");
-
-
- #=====================================
- # ACL consume tests
- #=====================================
-
- def test_consume_acl(self):
- """
- Test various consume acl
- """
- aclf = ACLFile()
- aclf.write('acl deny bob@QPID consume queue name=q1 durable=true\n')
- aclf.write('acl deny bob@QPID consume queue name=q2 exclusive=true\n')
- aclf.write('acl allow all all')
- aclf.close()
-
- self.reload_acl()
-
- session = get_session('bob','bob')
-
-
- try:
- session.queue_declare(queue='q1', durable='true')
- session.queue_declare(queue='q2', exclusive='true')
- session.queue_declare(queue='q3', durable='true')
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow create queue request");
-
- try:
- session.message_subscribe(queue='q1', destination='myq1')
- self.fail("ACL should deny message subscriber request for queue='q1'");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.message_subscribe(queue='q2', destination='myq1')
- self.fail("ACL should deny message subscriber request for queue='q2'");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.message_subscribe(queue='q3', destination='myq1')
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow create message subscribe");
-
-
- #=====================================
- # ACL publish tests
- #=====================================
-
- def test_publish_acl(self):
- """
- Test various publish acl
- """
- aclf = ACLFile()
- aclf.write('acl deny bob@QPID publish exchange name=amq.direct routingkey=rk1\n')
- aclf.write('acl deny bob@QPID publish exchange name=amq.topic\n')
- aclf.write('acl deny bob@QPID publish exchange name=myEx routingkey=rk2\n')
- aclf.write('acl allow all all')
- aclf.close()
-
- self.reload_acl()
-
- session = get_session('bob','bob')
-
- try:
- session.exchange_declare(exchange='myEx', type='topic')
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow exchange create request for myEx with any parameter");
-
- props = session.delivery_properties(routing_key="rk1")
-
- try:
- session.message_transfer(destination="amq.direct", message=Message(props,"Test"))
- self.fail("ACL should deny message transfer to name=amq.direct routingkey=rk1");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.message_transfer(destination="amq.topic", message=Message(props,"Test"))
- self.fail("ACL should deny message transfer to name=amq.topic");
- except qpid.session.SessionException, e:
- self.assertEqual(530,e.args[0].error_code)
- session = get_session('bob','bob')
-
- try:
- session.message_transfer(destination="myEx", message=Message(props,"Test"))
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow message transfer to exchange myEx with routing key rk1");
-
-
- props = session.delivery_properties(routing_key="rk2")
- try:
- session.message_transfer(destination="amq.direct", message=Message(props,"Test"))
- except qpid.session.SessionException, e:
- if (530 == e.args[0].error_code):
- self.fail("ACL should allow message transfer to exchange amq.direct");
-
-
-if __name__ == '__main__':
- args = sys.argv[1:]
- #need to remove the extra options from args as test runner doesn't recognize them
- extract_args("--port", args)
- args.append("acl")
-
- if not testrunner.run(args): sys.exit(1)
diff --git a/M4-RCs/qpid/cpp/src/tests/ais_check b/M4-RCs/qpid/cpp/src/tests/ais_check
deleted file mode 100755
index 5687110165..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/ais_check
+++ /dev/null
@@ -1,56 +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.
-#
-
-srcdir=`dirname $0`
-
-# Check AIS requirements and run tests if found.
-id -nG | grep '\<ais\>' >/dev/null || \
- NOGROUP="You are not a member of the ais group."
-ps -u root | grep 'aisexec\|corosync' >/dev/null || \
- NOAISEXEC="The aisexec or corosync daemon is not running as root"
-
-if test -n "$NOGROUP" -o -n "$NOAISEXEC"; then
- cat <<EOF
-
- =========== WARNING: NOT RUNNING AIS TESTS ==============
-
- Tests that depend on the openais library (used for clustering)
- will not be run because:
-
- $NOGROUP
- $NOAISEXEC
-
- ==========================================================
-
-EOF
- exit 0; # A warning, not a failure.
-fi
-
-# Execute command with the ais group set.
-with_ais_group() {
- id -nG | grep '\<ais\>' >/dev/null || { echo "You are not a member of the ais group."; exit 1; }
- echo $* | newgrp ais
-}
-
-# Run the tests
-srcdir=`dirname $0`
-with_ais_group $srcdir/run_test ./cluster_test || ERROR=1
-exit $ERROR
-
diff --git a/M4-RCs/qpid/cpp/src/tests/ais_test.cpp b/M4-RCs/qpid/cpp/src/tests/ais_test.cpp
deleted file mode 100644
index 00c61242e4..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/ais_test.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-// Defines test_main function to link with actual unit test code.
-#define BOOST_AUTO_TEST_MAIN // Boost 1.33
-#define BOOST_TEST_MAIN
-#include "unit_test.h"
-
diff --git a/M4-RCs/qpid/cpp/src/tests/allSegmentTypes.h b/M4-RCs/qpid/cpp/src/tests/allSegmentTypes.h
deleted file mode 100644
index e942250c89..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/allSegmentTypes.h
+++ /dev/null
@@ -1,128 +0,0 @@
-#ifndef TESTS_ALLSEGMENTTYPES_H
-#define TESTS_ALLSEGMENTTYPES_H
-/*
- *
- * 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 file was automatically generated from the AMQP specification.
-/// Do not edit.
-///
-
-
-#include "qpid/amqp_0_10/specification.h"
-#include "qpid/amqp_0_10/Header.h"
-#include "qpid/amqp_0_10/Body.h"
-
-using namespace qpid::amqp_0_10;
-
-template <class Op> size_t allSegmentTypes(Op& op) {
- op(Header());
- op(Body());
- op(ControlHolder(connection::Start()));
- op(ControlHolder(connection::StartOk()));
- op(ControlHolder(connection::Secure()));
- op(ControlHolder(connection::SecureOk()));
- op(ControlHolder(connection::Tune()));
- op(ControlHolder(connection::TuneOk()));
- op(ControlHolder(connection::Open()));
- op(ControlHolder(connection::OpenOk()));
- // op(ControlHolder(connection::Redirect())); // known-hosts array
- op(ControlHolder(connection::Heartbeat()));
- // op(ControlHolder(connection::Close())); // class/method dropped
- op(ControlHolder(connection::CloseOk()));
- op(ControlHolder(session::Attach()));
- op(ControlHolder(session::Attached()));
- op(ControlHolder(session::Detach()));
- op(ControlHolder(session::Detached()));
- op(ControlHolder(session::RequestTimeout()));
- op(ControlHolder(session::Timeout()));
- op(ControlHolder(session::CommandPoint()));
- // op(ControlHolder(session::Expected())); // fragments array encoding problem
- // op(ControlHolder(session::Confirmed())); // fragments array encoding problem
- op(ControlHolder(session::Completed()));
- op(ControlHolder(session::KnownCompleted()));
- op(ControlHolder(session::Flush()));
- op(ControlHolder(session::Gap()));
- // FIXME aconway 2008-04-15: command encoding, fix headers, fix sized structs.
- op(CommandHolder(execution::Sync()));
- op(CommandHolder(execution::Result()));
-
- // FIXME aconway 2008-04-16: investigate remaining failures.
- // op(CommandHolder(execution::Exception()));
- op(CommandHolder(message::Transfer()));
- op(CommandHolder(message::Accept()));
- // op(CommandHolder(message::Reject()));
- op(CommandHolder(message::Release()));
- op(CommandHolder(message::Acquire()));
- // op(CommandHolder(message::Resume()));
- op(CommandHolder(message::Subscribe()));
- op(CommandHolder(message::Cancel()));
- op(CommandHolder(message::SetFlowMode()));
- op(CommandHolder(message::Flow()));
- op(CommandHolder(message::Flush()));
- op(CommandHolder(message::Stop()));
- op(CommandHolder(tx::Select()));
- op(CommandHolder(tx::Commit()));
- op(CommandHolder(tx::Rollback()));
- op(CommandHolder(dtx::Select()));
- // op(CommandHolder(dtx::Start()));
- // op(CommandHolder(dtx::End()));
- // op(CommandHolder(dtx::Commit()));
- // op(CommandHolder(dtx::Forget()));
- // op(CommandHolder(dtx::GetTimeout()));
- // op(CommandHolder(dtx::Prepare()));
- // op(CommandHolder(dtx::Recover()));
- // op(CommandHolder(dtx::Rollback()));
- // op(CommandHolder(dtx::SetTimeout()));
- op(CommandHolder(exchange::Declare()));
- op(CommandHolder(exchange::Delete()));
- op(CommandHolder(exchange::Query()));
- op(CommandHolder(exchange::Bind()));
- op(CommandHolder(exchange::Unbind()));
- op(CommandHolder(exchange::Bound()));
- op(CommandHolder(queue::Declare()));
- op(CommandHolder(queue::Delete()));
- op(CommandHolder(queue::Purge()));
- op(CommandHolder(queue::Query()));
- // op(CommandHolder(file::Qos()));
- // op(CommandHolder(file::QosOk()));
-// op(CommandHolder(file::Consume()));
-// op(CommandHolder(file::ConsumeOk()));
-// op(CommandHolder(file::Cancel()));
-// op(CommandHolder(file::Open()));
-// op(CommandHolder(file::OpenOk()));
-// op(CommandHolder(file::Stage()));
-// op(CommandHolder(file::Publish()));
-// op(CommandHolder(file::Return()));
-// op(CommandHolder(file::Deliver()));
-// op(CommandHolder(file::Ack()));
-// op(CommandHolder(file::Reject()));
-// op(CommandHolder(stream::Qos()));
-// op(CommandHolder(stream::QosOk()));
-// op(CommandHolder(stream::Consume()));
-// op(CommandHolder(stream::ConsumeOk()));
-// op(CommandHolder(stream::Cancel()));
-// op(CommandHolder(stream::Publish()));
-// op(CommandHolder(stream::Return()));
-// op(CommandHolder(stream::Deliver()));
- return 0;
-}
-#endif /*!TESTS_ALLSEGMENTTYPES_H*/
diff --git a/M4-RCs/qpid/cpp/src/tests/amqp_0_10/Map.cpp b/M4-RCs/qpid/cpp/src/tests/amqp_0_10/Map.cpp
deleted file mode 100644
index efde967050..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/amqp_0_10/Map.cpp
+++ /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.
- *
- */
-#include "unit_test.h"
-#include "qpid/amqp_0_10/Map.h"
-#include "qpid/amqp_0_10/Array.h"
-#include "qpid/amqp_0_10/Struct32.h"
-#include "qpid/amqp_0_10/UnknownType.h"
-#include "qpid/amqp_0_10/Codec.h"
-#include <iostream>
-
-using namespace qpid::amqp_0_10;
-using namespace std;
-
-QPID_AUTO_TEST_SUITE(MapTestSuite)
-
- QPID_AUTO_TEST_CASE(testGetSet) {
- MapValue v;
- v = Str8("foo");
- BOOST_CHECK(v.get<Str8>());
- BOOST_CHECK(!v.get<uint8_t>());
- BOOST_CHECK_EQUAL(*v.get<Str8>(), "foo");
-
- v = uint8_t(42);
- BOOST_CHECK(!v.get<Str8>());
- BOOST_CHECK(v.get<uint8_t>());
- BOOST_CHECK_EQUAL(*v.get<uint8_t>(), 42);
-
- v = uint16_t(12);
- BOOST_CHECK(v.get<uint16_t>());
- BOOST_CHECK_EQUAL(*v.get<uint16_t>(), 12);
-}
-
-template <class R> struct TestVisitor : public MapValue::Visitor<R> {
- template <class T> R operator()(const T&) const { throw MapValue::BadTypeException(); }
- R operator()(const R& r) const { return r; }
-};
-
-QPID_AUTO_TEST_CASE(testVisit) {
- MapValue v;
- v = Str8("foo");
- BOOST_CHECK_EQUAL(v.apply_visitor(TestVisitor<Str8>()), "foo");
- v = Uint16(42);
- BOOST_CHECK_EQUAL(v.apply_visitor(TestVisitor<Uint16>()), 42);
- try {
- v.apply_visitor(TestVisitor<bool>());
- BOOST_FAIL("Expecting exception");
- }
- catch(const MapValue::BadTypeException&) {}
-}
-
-
-QPID_AUTO_TEST_CASE(testEncodeMapValue) {
- MapValue mv;
- std::string data;
- mv = Str8("hello");
- Codec::encode(back_inserter(data))(mv);
- BOOST_CHECK_EQUAL(data.size(), Codec::size(mv));
- MapValue mv2;
- Codec::decode(data.begin())(mv2);
- BOOST_CHECK_EQUAL(mv2.getCode(), 0x85);
- BOOST_REQUIRE(mv2.get<Str8>());
- BOOST_CHECK_EQUAL(*mv2.get<Str8>(), "hello");
-}
-
-QPID_AUTO_TEST_CASE(testEncode) {
- Map map;
- std::string data;
- map["A"] = true;
- map["b"] = Str8("hello");
- Codec::encode(back_inserter(data))(map);
- BOOST_CHECK_EQUAL(Codec::size(map), data.size());
- Map map2;
- Codec::decode(data.begin())(map2);
- BOOST_CHECK_EQUAL(map.size(), 2u);
- BOOST_CHECK(map["A"].get<bool>());
- BOOST_CHECK_EQUAL(*map["b"].get<Str8>(), "hello");
-}
-
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/amqp_0_10/ProxyTemplate.cpp b/M4-RCs/qpid/cpp/src/tests/amqp_0_10/ProxyTemplate.cpp
deleted file mode 100644
index 9d4fcb8935..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/amqp_0_10/ProxyTemplate.cpp
+++ /dev/null
@@ -1,49 +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 "unit_test.h"
-#include "qpid/amqp_0_10/ProxyTemplate.h"
-#include <boost/any.hpp>
-
-QPID_AUTO_TEST_SUITE(ProxyTemplateTestSuite)
-
-using namespace qpid::amqp_0_10;
-
-struct ToAny {
- template <class T>
- boost::any operator()(const T& t) { return boost::any(t); }
-};
-
-struct AnyProxy : public ProxyTemplate<ToAny, boost::any> {};
-
-QPID_AUTO_TEST_CASE(testAnyProxy) {
- AnyProxy p;
- boost::any a=p.connectionTune(1,2,3,4);
- BOOST_CHECK_EQUAL(a.type().name(), typeid(connection::Tune).name());
- connection::Tune* tune=boost::any_cast<connection::Tune>(&a);
- BOOST_REQUIRE(tune);
- BOOST_CHECK_EQUAL(tune->channelMax, 1u);
- BOOST_CHECK_EQUAL(tune->maxFrameSize, 2u);
- BOOST_CHECK_EQUAL(tune->heartbeatMin, 3u);
- BOOST_CHECK_EQUAL(tune->heartbeatMax, 4u);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/amqp_0_10/apply.cpp b/M4-RCs/qpid/cpp/src/tests/amqp_0_10/apply.cpp
deleted file mode 100644
index 5a67c28c79..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/amqp_0_10/apply.cpp
+++ /dev/null
@@ -1,99 +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 "unit_test.h"
-#include "qpid/amqp_0_10/specification.h"
-#include "qpid/amqp_0_10/ApplyControl.h"
-
-QPID_AUTO_TEST_SUITE(VisitorTestSuite)
-
-using namespace qpid::amqp_0_10;
-
-struct GetCode : public ApplyFunctor<uint8_t> {
- template <class T> uint8_t operator()(const T&) const { return T::CODE; }
-};
-
-struct SetChannelMax : ApplyFunctor<void> {
- template <class T> void operator()(T&) const { BOOST_FAIL(""); }
- void operator()(connection::Tune& t) const { t.channelMax=42; }
-};
-
-struct TestFunctor {
- typedef bool result_type;
- bool operator()(const connection::Tune& tune) {
- BOOST_CHECK_EQUAL(tune.channelMax, 1u);
- BOOST_CHECK_EQUAL(tune.maxFrameSize, 2u);
- BOOST_CHECK_EQUAL(tune.heartbeatMin, 3u);
- BOOST_CHECK_EQUAL(tune.heartbeatMax, 4u);
- return true;
- }
- template <class T>
- bool operator()(const T&) { return false; }
-};
-
-QPID_AUTO_TEST_CASE(testApply) {
- connection::Tune tune(1,2,3,4);
- Control* p = &tune;
-
- // boost oddity - without the cast we get undefined symbol errors.
- BOOST_CHECK_EQUAL(apply(GetCode(), *p), (uint8_t)connection::Tune::CODE);
-
- TestFunctor tf;
- BOOST_CHECK(apply(tf, *p));
-
- connection::Start start;
- p = &start;
- BOOST_CHECK(!apply(tf, *p));
-
- apply(SetChannelMax(), tune);
- BOOST_CHECK_EQUAL(tune.channelMax, 42);
-}
-
-struct VoidTestFunctor {
- typedef void result_type;
-
- int code;
- VoidTestFunctor() : code() {}
-
- void operator()(const connection::Tune& tune) {
- BOOST_CHECK_EQUAL(tune.channelMax, 1u);
- BOOST_CHECK_EQUAL(tune.maxFrameSize, 2u);
- BOOST_CHECK_EQUAL(tune.heartbeatMin, 3u);
- BOOST_CHECK_EQUAL(tune.heartbeatMax, 4u);
- code=connection::Tune::CODE;
- }
- template <class T>
- void operator()(const T&) { code=0xFF; }
-};
-
-QPID_AUTO_TEST_CASE(testApplyVoid) {
- connection::Tune tune(1,2,3,4);
- Control* p = &tune;
- VoidTestFunctor tf;
- apply(tf, *p);
- BOOST_CHECK_EQUAL(uint8_t(connection::Tune::CODE), tf.code);
-
- connection::Start start;
- p = &start;
- apply(tf, *p);
- BOOST_CHECK_EQUAL(0xFF, tf.code);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/amqp_0_10/handlers.cpp b/M4-RCs/qpid/cpp/src/tests/amqp_0_10/handlers.cpp
deleted file mode 100644
index 428643c802..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/amqp_0_10/handlers.cpp
+++ /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.
- *
- */
-
-#include "unit_test.h"
-#include "qpid/Exception.h"
-#include "qpid/amqp_0_10/Unit.h"
-#include "qpid/amqp_0_10/ControlHolder.h"
-#include "qpid/amqp_0_10/CommandHolder.h"
-#include "qpid/amqp_0_10/handlers.h"
-#include "qpid/amqp_0_10/specification.h"
-
-QPID_AUTO_TEST_SUITE(handler_tests)
-
-using namespace qpid::amqp_0_10;
-using namespace std;
-
-string called; // Set by called handler function
-
-// Note on handlers:
-//
-// Control and Command handlers are separate, both behave the same way,
-// so substitute "control or command" for command in the following.
-//
-// Command handlers derive from CommandHandler and implement functions
-// for all the commands they handle. Handling an unimplemented command
-// will raise NotImplementedException.
-//
-// Using virtual inheritance from CommandHandler allows multiple
-// handlers to be aggregated into one with multiple inheritance,
-// See test code for example.
-//
-// E.g. the existing broker model would have two control handlers:
-// - ConnectionHandler: ControlHandler for connection controls.
-// - SessionHandler: ControlHandler for session controls.
-// It would have class-command handlers for each AMQP class:
-// - QueueHandler, MessageHandler etc.. handle each class.
-// And an aggregate handler in place of BrokerAdapter
-// - BrokerCommandHandler: public QueueHandler, MessageHandler ...
-//
-// In other applications (e.g. cluster) any combination of commands
-// can be handled by a given handler. It _might_ simplify the code
-// to collaps ConnectionHandler and SessionHandler into a single
-// ControlHandler (or it might not.)
-
-struct TestExecutionHandler : public virtual CommandHandler {
- void executionSync() { called = "executionSync"; }
- // ... etc. for all execution commands
-};
-
-struct TestMessageHandler : public virtual CommandHandler {
- void messageCancel(const Str8&) { called="messageCancel"; }
- // ... etc.
-};
-
-// Aggregate handler for all recognised commands.
-struct TestCommandHandler :
- public TestExecutionHandler,
- public TestMessageHandler
- // ... etc. handlers for all command classes.
-{}; // Nothing to do.
-
-
-// Sample unit handler, written as a static_visitor.
-// Note it could equally be written with if/else statements
-// in handle.
-//
-struct TestUnitHandler : public boost::static_visitor<void> {
- TestCommandHandler handler;
- void handle(const Unit& u) { u.applyVisitor(*this); }
-
- void operator()(const Body&) { called="Body"; }
- void operator()(const Header&) { called="Header"; }
- void operator()(const ControlHolder&) { throw qpid::Exception("I don't do controls."); }
- void operator()(const CommandHolder& c) { c.invoke(handler); }
-};
-
-QPID_AUTO_TEST_CASE(testHandlers) {
- TestUnitHandler handler;
- Unit u;
-
- u = Body();
- handler.handle(u);
- BOOST_CHECK_EQUAL("Body", called);
-
- u = Header();
- handler.handle(u);
- BOOST_CHECK_EQUAL("Header", called);
-
- // in_place<Foo>(...) is equivalent to Foo(...) but
- // constructs Foo directly in the holder, avoiding
- // a copy.
-
- u = CommandHolder(in_place<execution::Sync>());
- handler.handle(u);
- BOOST_CHECK_EQUAL("executionSync", called);
-
- u = ControlHolder(in_place<connection::Start>(Map(), Str16Array(), Str16Array()));
- try {
- handler.handle(u);
- } catch (const qpid::Exception&) {}
-
- u = CommandHolder(in_place<message::Cancel>(Str8()));
- handler.handle(u);
- BOOST_CHECK_EQUAL("messageCancel", called);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/amqp_0_10/serialize.cpp b/M4-RCs/qpid/cpp/src/tests/amqp_0_10/serialize.cpp
deleted file mode 100644
index 0cfeb8d28d..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/amqp_0_10/serialize.cpp
+++ /dev/null
@@ -1,429 +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 "unit_test.h"
-#include "allSegmentTypes.h"
-
-#include "qpid/framing/AMQFrame.h"
-#include "qpid/framing/Buffer.h"
-
-#include "qpid/amqp_0_10/Packer.h"
-#include "qpid/amqp_0_10/built_in_types.h"
-#include "qpid/amqp_0_10/Codec.h"
-#include "qpid/amqp_0_10/specification.h"
-#include "qpid/amqp_0_10/ControlHolder.h"
-#include "qpid/amqp_0_10/Struct32.h"
-#include "qpid/amqp_0_10/FrameHeader.h"
-#include "qpid/amqp_0_10/Map.h"
-#include "qpid/amqp_0_10/Unit.h"
-#include "tests/allSegmentTypes.h"
-
-#include <boost/test/test_case_template.hpp>
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <boost/optional.hpp>
-#include <boost/mpl/vector.hpp>
-#include <boost/mpl/back_inserter.hpp>
-#include <boost/mpl/copy.hpp>
-#include <boost/mpl/empty_sequence.hpp>
-#include <boost/current_function.hpp>
-#include <iterator>
-#include <string>
-#include <sstream>
-#include <iostream>
-#include <netinet/in.h>
-
-// Missing operators needed for tests.
-namespace boost {
-template <class T, size_t N>
-std::ostream& operator<<(std::ostream& out, const array<T,N>& a) {
- std::ostream_iterator<T> o(out, " ");
- std::copy(a.begin(), a.end(), o);
- return out;
-}
-} // boost
-
-QPID_AUTO_TEST_SUITE(SerializeTestSuite)
-
-using namespace std;
-namespace mpl=boost::mpl;
-using namespace qpid::amqp_0_10;
-using qpid::framing::in_place;
-
-template <class A, class B> struct concat2 { typedef typename mpl::copy<B, typename mpl::back_inserter<A> >::type type; };
-template <class A, class B, class C> struct concat3 { typedef typename concat2<A, typename concat2<B, C>::type>::type type; };
-template <class A, class B, class C, class D> struct concat4 { typedef typename concat2<A, typename concat3<B, C, D>::type>::type type; };
-
-typedef mpl::vector<Boolean, Char, Int32, Int64, Int8, Uint16, CharUtf32, Uint32, Uint64, Bin8, Uint8>::type IntegralTypes;
-typedef mpl::vector<Bin1024, Bin128, Bin16, Bin256, Bin32, Bin40, Bin512, Bin64, Bin72>::type BinTypes;
-typedef mpl::vector<Double, Float>::type FloatTypes;
-typedef mpl::vector<SequenceNo, Uuid, Datetime, Dec32, Dec64> FixedSizeClassTypes;
-typedef mpl::vector<Map, Vbin8, Str8Latin, Str8, Str8Utf16, Vbin16, Str16Latin, Str16, Str16Utf16, Vbin32> VariableSizeTypes;
-
-typedef concat4<IntegralTypes, BinTypes, FloatTypes, FixedSizeClassTypes>::type FixedSizeTypes;
-typedef concat2<FixedSizeTypes, VariableSizeTypes>::type AllTypes;
-
-// TODO aconway 2008-02-20: should test 64 bit integrals for order also.
-QPID_AUTO_TEST_CASE(testNetworkByteOrder) {
- string data;
-
- uint32_t l = 0x11223344;
- Codec::encode(std::back_inserter(data))(l);
- uint32_t enc=reinterpret_cast<const uint32_t&>(*data.data());
- uint32_t l2 = ntohl(enc);
- BOOST_CHECK_EQUAL(l, l2);
-
- data.clear();
- uint16_t s = 0x1122;
- Codec::encode(std::back_inserter(data))(s);
- uint32_t s2 = ntohs(*reinterpret_cast<const uint32_t*>(data.data()));
- BOOST_CHECK_EQUAL(s, s2);
-}
-
-QPID_AUTO_TEST_CASE(testSetLimit) {
- typedef Codec::Encoder<back_insert_iterator<string> > Encoder;
- string data;
- Encoder encode(back_inserter(data), 3);
- encode('1')('2')('3');
- try {
- encode('4');
- BOOST_FAIL("Expected exception");
- } catch (...) {} // FIXME aconway 2008-04-03: catch proper exception
- BOOST_CHECK_EQUAL(data, "123");
-}
-
-QPID_AUTO_TEST_CASE(testScopedLimit) {
- typedef Codec::Encoder<back_insert_iterator<string> > Encoder;
- string data;
- Encoder encode(back_inserter(data), 10);
- encode(Str8("123")); // 4 bytes
- {
- Encoder::ScopedLimit l(encode, 3);
- encode('a')('b')('c');
- try {
- encode('d');
- BOOST_FAIL("Expected exception");
- } catch(...) {} // FIXME aconway 2008-04-03: catch proper exception
- }
- BOOST_CHECK_EQUAL(data, "\003123abc");
- encode('x')('y')('z');
- try {
- encode('!');
- BOOST_FAIL("Expected exception");
- } catch(...) {} // FIXME aconway 2008-04-03: catch proper exception
- BOOST_CHECK_EQUAL(data.size(), 10u);
-}
-
-// Assign test values to the various types.
-void testValue(bool& b) { b = true; }
-void testValue(Bit&) { }
-template <class T> typename boost::enable_if<boost::is_arithmetic<T> >::type testValue(T& n) { n=42; }
-void testValue(CharUtf32& c) { c = 43; }
-void testValue(long long& l) { l = 0x012345; }
-void testValue(Datetime& dt) { dt = qpid::sys::now(); }
-void testValue(Uuid& uuid) { uuid=Uuid(true); }
-template <class E, class M> void testValue(Decimal<E,M>& d) { d.exponent=2; d.mantissa=0x1122; }
-void testValue(SequenceNo& s) { s = 42; }
-template <size_t N> void testValue(Bin<N>& a) { a.assign(42); }
-template <class T, class S, int Unique> void testValue(SerializableString<T, S, Unique>& s) {
- char msg[]="foobar";
- s.assign(msg, msg+sizeof(msg));
-}
-void testValue(Str16& s) { s = "the quick brown fox jumped over the lazy dog"; }
-void testValue(Str8& s) { s = "foobar"; }
-void testValue(Map& m) { m["s"] = Str8("foobar"); m["b"] = true; m["c"] = uint16_t(42); }
-
-//typedef mpl::vector<Str8, Str16>::type TestTypes;
-/*BOOST_AUTO_TEST_CASE_TEMPLATE(testEncodeDecode, T, AllTypes)
-{
- string data;
- T t;
- testValue(t);
- Codec::encode(std::back_inserter(data))(t);
-
- BOOST_CHECK_EQUAL(Codec::size(t), data.size());
-
- T t2;
- Codec::decode(data.begin())(t2);
- BOOST_CHECK_EQUAL(t,t2);
-}
-*/
-
-struct TestMe {
- bool encoded, decoded;
- char value;
- TestMe(char v) : encoded(), decoded(), value(v) {}
- template <class S> void encode(S& s) const {
- const_cast<TestMe*>(this)->encoded=true; s(value);
- }
- template <class S> void decode(S& s) { decoded=true; s(value); }
- template <class S> void serialize(S& s) { s.split(*this); }
-};
-
-QPID_AUTO_TEST_CASE(testSplit) {
- string data;
- TestMe t1('x');
- Codec::encode(std::back_inserter(data))(t1);
- BOOST_CHECK(t1.encoded);
- BOOST_CHECK(!t1.decoded);
- BOOST_CHECK_EQUAL(data, "x");
-
- TestMe t2('y');
- Codec::decode(data.begin())(t2);
- BOOST_CHECK(!t2.encoded);
- BOOST_CHECK(t2.decoded);
- BOOST_CHECK_EQUAL(t2.value, 'x');
-}
-
-QPID_AUTO_TEST_CASE(testControlEncodeDecode) {
- string data;
- Control::Holder h(in_place<connection::Tune>(1,2,3,4));
- Codec::encode(std::back_inserter(data))(h);
-
- BOOST_CHECK_EQUAL(data.size(), Codec::size(h));
-
- Codec::Decoder<string::iterator> decode(data.begin());
- Control::Holder h2;
- decode(h2);
-
- BOOST_REQUIRE(h2.get());
- BOOST_CHECK_EQUAL(h2.get()->getClassCode(), connection::CODE);
- BOOST_CHECK_EQUAL(h2.get()->getCode(), uint8_t(connection::Tune::CODE));
- connection::Tune& tune=static_cast<connection::Tune&>(*h2.get());
- BOOST_CHECK_EQUAL(tune.channelMax, 1u);
- BOOST_CHECK_EQUAL(tune.maxFrameSize, 2u);
- BOOST_CHECK_EQUAL(tune.heartbeatMin, 3u);
- BOOST_CHECK_EQUAL(tune.heartbeatMax, 4u);
-}
-
-QPID_AUTO_TEST_CASE(testStruct32) {
- message::DeliveryProperties dp;
- dp.priority=message::MEDIUM;
- dp.routingKey="foo";
- Struct32 s(dp);
- string data;
- Codec::encode(back_inserter(data))(s);
-
- uint32_t structSize; // Starts with size
- Codec::decode(data.begin())(structSize);
- BOOST_CHECK_EQUAL(structSize, Codec::size(dp) + 2); // +2 for code
- BOOST_CHECK_EQUAL(structSize, data.size()-4); // encoded body
-
- BOOST_CHECK_EQUAL(data.size(), Codec::size(s));
- Struct32 s2;
- Codec::decode(data.begin())(s2);
- message::DeliveryProperties* dp2 = s2.getIf<message::DeliveryProperties>();
- BOOST_REQUIRE(dp2);
- BOOST_CHECK_EQUAL(dp2->priority, message::MEDIUM);
- BOOST_CHECK_EQUAL(dp2->routingKey, "foo");
-}
-
-QPID_AUTO_TEST_CASE(testStruct32Unknown) {
- // Verify we can recode an unknown struct unchanged.
- Struct32 s;
- string data;
- Codec::encode(back_inserter(data))(uint32_t(10));
- data.append(10, 'X');
- Codec::decode(data.begin())(s);
- string data2;
- Codec::encode(back_inserter(data2))(s);
- BOOST_CHECK_EQUAL(data.size(), data2.size());
- BOOST_CHECK_EQUAL(data, data2);
-}
-
-struct DummyPacked {
- static const uint8_t PACK=1;
- boost::optional<char> i, j;
- char k;
- Bit l,m;
- DummyPacked(char a=0, char b=0, char c=0) : i(a), j(b), k(c), l(), m() {}
- template <class S> void serialize(S& s) { s(i)(j)(k)(l)(m); }
-};
-
-Packer<DummyPacked> serializable(DummyPacked& d) { return Packer<DummyPacked>(d); }
-
-QPID_AUTO_TEST_CASE(testPackBits) {
- DummyPacked d('a','b','c');
- BOOST_CHECK_EQUAL(packBits(d), 7u);
- d.j = boost::none;
- BOOST_CHECK_EQUAL(packBits(d), 5u);
- d.m = true;
- BOOST_CHECK_EQUAL(packBits(d), 0x15u);
-}
-
-
-QPID_AUTO_TEST_CASE(testPacked) {
- string data;
-
- Codec::encode(back_inserter(data))('a')(boost::optional<char>('b'))(boost::optional<char>())('c');
- BOOST_CHECK_EQUAL(data, "abc");
- data.clear();
-
- DummyPacked dummy('a','b','c');
-
- Codec::encode(back_inserter(data))(dummy);
- BOOST_CHECK_EQUAL(data.size(), 4u);
- BOOST_CHECK_EQUAL(data, string("\007abc"));
- data.clear();
-
- dummy.i = boost::none;
- Codec::encode(back_inserter(data))(dummy);
- BOOST_CHECK_EQUAL(data, string("\6bc"));
- data.clear();
-
- const char* missing = "\5xy";
- Codec::decode(missing)(dummy);
- BOOST_CHECK(dummy.i);
- BOOST_CHECK_EQUAL(*dummy.i, 'x');
- BOOST_CHECK(!dummy.j);
- BOOST_CHECK_EQUAL(dummy.k, 'y');
-}
-
-QPID_AUTO_TEST_CASE(testUnitControl) {
- string data;
- Control::Holder h(in_place<connection::Tune>(1,2,3,4));
- Codec::encode(std::back_inserter(data))(h);
-
- Unit unit(FrameHeader(FIRST_FRAME|LAST_FRAME, CONTROL));
- Codec::decode(data.begin())(unit);
-
- BOOST_REQUIRE(unit.get<ControlHolder>());
-
- string data2;
- Codec::encode(back_inserter(data2))(unit);
-
- BOOST_CHECK_EQUAL(data, data2);
-}
-
-QPID_AUTO_TEST_CASE(testArray) {
- ArrayDomain<char> a;
- a.resize(3, 'x');
- string data;
- Codec::encode(back_inserter(data))(a);
-
- ArrayDomain<char> b;
- Codec::decode(data.begin())(b);
- BOOST_CHECK_EQUAL(b.size(), 3u);
- string data3;
- Codec::encode(back_inserter(data3))(a);
- BOOST_CHECK_EQUAL(data, data3);
-
- Array x;
- Codec::decode(data.begin())(x);
- BOOST_CHECK_EQUAL(x.size(), 3u);
- BOOST_CHECK_EQUAL(x[0].size(), 1u);
- BOOST_CHECK_EQUAL(*x[0].begin(), 'x');
- BOOST_CHECK_EQUAL(*x[2].begin(), 'x');
-
- string data2;
- Codec::encode(back_inserter(data2))(x);
- BOOST_CHECK_EQUAL(data,data2);
-}
-
-QPID_AUTO_TEST_CASE(testStruct) {
- string data;
-
- message::DeliveryProperties dp;
- BOOST_CHECK(!dp.discardUnroutable);
- dp.immediate = true;
- dp.redelivered = false;
- dp.priority = message::MEDIUM;
- dp.exchange = "foo";
-
- Codec::encode(back_inserter(data))(dp);
- // Skip 4 bytes size, little-endian decode for pack bits.
- uint16_t encodedBits=uint8_t(data[5]);
- encodedBits <<= 8;
- encodedBits += uint8_t(data[4]);
- BOOST_CHECK_EQUAL(encodedBits, packBits(dp));
-
- data.clear();
- Struct32 h(dp);
- Codec::encode(back_inserter(data))(h);
-
- Struct32 h2;
- Codec::decode(data.begin())(h2);
- BOOST_CHECK_EQUAL(h2.getClassCode(), Uint8(message::DeliveryProperties::CLASS_CODE));
- BOOST_CHECK_EQUAL(h2.getCode(), Uint8(message::DeliveryProperties::CODE));
- message::DeliveryProperties* dp2 =
- dynamic_cast<message::DeliveryProperties*>(h2.get());
- BOOST_CHECK(dp2);
- BOOST_CHECK(!dp2->discardUnroutable);
- BOOST_CHECK(dp2->immediate);
- BOOST_CHECK(!dp2->redelivered);
- BOOST_CHECK_EQUAL(dp2->priority, message::MEDIUM);
- BOOST_CHECK_EQUAL(dp2->exchange, "foo");
-}
-
-struct RecodeUnit {
- template <class T>
- void operator() (const T& t) {
- BOOST_MESSAGE(BOOST_CURRENT_FUNCTION << " called with: " << t);
- using qpid::framing::Buffer;
- using qpid::framing::AMQFrame;
-
- session::Header sh;
- BOOST_CHECK_EQUAL(Codec::size(sh), 2u);
-
- // Encode unit.
- Unit u(t);
- string data;
- Codec::encode(back_inserter(data))(u.getHeader())(u);
- data.push_back(char(0xCE)); // Preview end-of-frame
-
- // Decode AMQFrame
- Buffer buf(&data[0], data.size());
- AMQFrame f;
- f.decode(buf);
- BOOST_MESSAGE("AMQFrame decoded: " << f);
- // Encode AMQFrame
- string data2(f.size(), ' ');
- Buffer buf2(&data2[0], data.size());
- f.encode(buf2);
-
- // Verify encoded by unit == encoded by AMQFrame
- BOOST_CHECK_MESSAGE(data == data2, BOOST_CURRENT_FUNCTION);
-
- // Decode unit
- // FIXME aconway 2008-04-15: must set limit to decode a header.
- Codec::Decoder<string::iterator> decode(data2.begin(), data2.size()-1);
-
- FrameHeader h;
- decode(h);
- BOOST_CHECK_EQUAL(u.getHeader(), h);
- Unit u2(h);
- decode(u2);
-
- // Re-encode unit
- string data3;
- Codec::encode(back_inserter(data3))(u2.getHeader())(u2);
- data3.push_back(char(0xCE)); // Preview end-of-frame
-
- BOOST_CHECK_MESSAGE(data3 == data2, BOOST_CURRENT_FUNCTION);
- }
-};
-
-QPID_AUTO_TEST_CASE(testSerializeAllSegmentTypes) {
- RecodeUnit recode;
- allSegmentTypes(recode);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/benchmark b/M4-RCs/qpid/cpp/src/tests/benchmark
deleted file mode 100755
index c075837847..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/benchmark
+++ /dev/null
@@ -1,95 +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.
-#
-# A basic "benchmark" to generate performacne samples of throughput
-# and latency against a single cluster member while they are replicating.
-#
-# Must be run in the qpid src/tests build directory.
-#
-
-usage() {
-cat <<EOF
-Usage: $0 [options] -- client hosts --- broker hosts
-Read the script for options.
-EOF
-}
-# Defaults
-TESTDIR=${TESTDIR:-$PWD} # Absolute path to test exes on all hosts.
-SCRIPTDIR=${SCRIPTDIR:-`dirname $0`} # Path to local test scripts directory.
-SAMPLES=10 # Runs of each test.
-COUNT=${COUNT:-10000} # Count for pub/sub tests.
-SIZE=${SIZE:-600} # Size of messages
-ECHO=${ECHO:-1000} # Count for echo test.
-NSUBS=${NSUBS:-4}
-NPUBS=${NPUBS:-4}
-
-collect() { eval $COLLECT=\""\$$COLLECT $*"\"; }
-COLLECT=ARGS
-while test $# -gt 0; do
- case $1 in
- --testdir) TESTDIR=$2 ; shift 2 ;;
- --samples) SAMPLES=$2 ; shift 2 ;;
- --count) COUNT=$2 ; shift 2 ;;
- --echos) ECHO=$2 ; shift 2 ;;
- --size) SIZE=$2 ; shift 2 ;;
- --nsubs) NSUBS=$2 ; shift 2 ;;
- --npubs) NPUBS=$2 ; shift 2 ;;
- --) COLLECT=CLIENTARG; shift ;;
- ---) COLLECT=BROKERARG; shift;;
- *) collect $1; shift ;;
- esac
-done
-
-CLIENTS=${CLIENTARG:-$CLIENTS}
-BROKERS=${BROKERARG:-$BROKERS}
-test -z "$CLIENTS" && { echo "Must specify at least one client host."; exit 1; }
-test -z "$BROKERS" && { echo "Must specify at least one broker host."; exit 1; }
-
-export TESTDIR # For perfdist
-CLIENTS=($CLIENTS) # Convert to array
-BROKERS=($BROKERS)
-trap "rm -f $FILES" EXIT
-
-dosamples() {
- FILE=`mktemp`
- FILES="$FILES $FILE"
- TABS=`echo "$HEADING" | sed s'/[^ ]//g'`
- {
- echo "\"$*\"$TABS"
- echo "$HEADING"
- for (( i=0; i<$SAMPLES; ++i)) ; do echo "`$*`" ; done
- echo
- } | tee $FILE
-}
-
-HEADING="pub sub total Mb"
-dosamples $SCRIPTDIR/perfdist --size $SIZE --count $COUNT --nsubs $NSUBS --npubs $NPUBS -s -- ${CLIENTS[*]} --- ${BROKERS[*]}
-HEADING="pub"
-dosamples ssh -A ${CLIENTS[0]} $TESTDIR/publish --routing-key perftest0 --size $SIZE --count $COUNT -s -b ${BROKERS[0]}
-HEADING="sub"
-dosamples ssh -A ${CLIENTS[0]} $TESTDIR/consume --queue perftest0 -s --count $COUNT -b ${BROKERS[0]}
-HEADING="min max avg"
-dosamples ssh -A ${CLIENTS[0]} $TESTDIR/echotest --count $ECHO -s -b ${BROKERS[0]}
-
-echo
-echo "Tab separated spreadsheet (also saved as benchmark.tab):"
-echo
-
-echo "benchmark -- ${CLIENTS[*]} --- ${BROKERS[*]} " | tee benchmark.tab
-paste $FILES | tee -a benchmark.tab
diff --git a/M4-RCs/qpid/cpp/src/tests/client_test.cpp b/M4-RCs/qpid/cpp/src/tests/client_test.cpp
deleted file mode 100644
index 204c2c4b71..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/client_test.cpp
+++ /dev/null
@@ -1,149 +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 file provides a simple test (and example) of basic
- * functionality including declaring an exchange and a queue, binding
- * these together, publishing a message and receiving that message
- * asynchronously.
- */
-
-#include <iostream>
-
-#include "TestOptions.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/Session.h"
-#include "qpid/framing/FrameSet.h"
-#include "qpid/framing/all_method_bodies.h"
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::framing;
-using std::string;
-
-struct Args : public TestOptions {
- uint msgSize;
- bool verbose;
-
- Args() : TestOptions("Simple test of Qpid c++ client; sends and receives a single message."), msgSize(26)
- {
- addOptions()
- ("size", optValue(msgSize, "N"), "message size")
- ("verbose", optValue(verbose), "print out some status messages");
- }
-};
-
-const std::string chars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
-
-std::string generateData(uint size)
-{
- if (size < chars.length()) {
- return chars.substr(0, size);
- }
- std::string data;
- for (uint i = 0; i < (size / chars.length()); i++) {
- data += chars;
- }
- data += chars.substr(0, size % chars.length());
- return data;
-}
-
-void print(const std::string& text, const Message& msg)
-{
- std::cout << text;
- if (msg.getData().size() > 16) {
- std::cout << msg.getData().substr(0, 16) << "...";
- } else {
- std::cout << msg.getData();
- }
- std::cout << std::endl;
-}
-
-int main(int argc, char** argv)
-{
- try {
- Args opts;
- opts.parse(argc, argv);
-
- //Connect to the broker:
- Connection connection;
- opts.open(connection);
- if (opts.verbose) std::cout << "Opened connection." << std::endl;
-
- //Create and open a session on the connection through which
- //most functionality is exposed:
- Session session = connection.newSession();
- if (opts.verbose) std::cout << "Opened session." << std::endl;
-
-
- //'declare' the exchange and the queue, which will create them
- //as they don't exist
- session.exchangeDeclare(arg::exchange="MyExchange", arg::type="direct");
- if (opts.verbose) std::cout << "Declared exchange." << std::endl;
- session.queueDeclare(arg::queue="MyQueue", arg::autoDelete=true, arg::exclusive=true);
- if (opts.verbose) std::cout << "Declared queue." << std::endl;
-
- //now bind the queue to the exchange
- session.exchangeBind(arg::exchange="MyExchange", arg::queue="MyQueue", arg::bindingKey="MyKey");
- if (opts.verbose) std::cout << "Bound queue to exchange." << std::endl;
-
- //create and send a message to the exchange using the routing
- //key we bound our queue with:
- Message msgOut(generateData(opts.msgSize));
- msgOut.getDeliveryProperties().setRoutingKey("MyKey");
- session.messageTransfer(arg::destination="MyExchange", arg::content=msgOut, arg::acceptMode=1);
- if (opts.verbose) print("Published message: ", msgOut);
-
- //subscribe to the queue, add sufficient credit and then get
- //incoming 'frameset', check that its a message transfer and
- //then convert it to a message (see Dispatcher and
- //SubscriptionManager utilties for common reusable patterns at
- //a higher level)
- session.messageSubscribe(arg::queue="MyQueue", arg::destination="MyId");
- session.messageFlow(arg::destination="MyId", arg::unit=0, arg::value=1); //credit for one message
- session.messageFlow(arg::destination="MyId", arg::unit=1, arg::value=0xFFFFFFFF); //credit for infinite bytes
- if (opts.verbose) std::cout << "Subscribed to queue." << std::endl;
- FrameSet::shared_ptr incoming = session.get();
- if (incoming->isA<MessageTransferBody>()) {
- Message msgIn(*incoming);
- if (msgIn.getData() == msgOut.getData()) {
- if (opts.verbose) std::cout << "Received the exepected message." << std::endl;
- session.messageAccept(SequenceSet(msgIn.getId()));
- session.markCompleted(msgIn.getId(), true, true);
- } else {
- print("Received an unexepected message: ", msgIn);
- }
- } else {
- throw Exception("Unexpected command received");
- }
-
- //close the session & connection
- session.close();
- if (opts.verbose) std::cout << "Closed session." << std::endl;
- connection.close();
- if (opts.verbose) std::cout << "Closed connection." << std::endl;
- return 0;
- } catch(const std::exception& e) {
- std::cout << e.what() << std::endl;
- }
- return 1;
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/cluster.mk b/M4-RCs/qpid/cpp/src/tests/cluster.mk
deleted file mode 100644
index 1f027ccb4c..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/cluster.mk
+++ /dev/null
@@ -1,41 +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.
-#
-
-if HAVE_LIBCPG
-
-#
-# Cluster tests makefile fragment, to be included in Makefile.am
-#
-
-# NOTE: Programs using the openais library must be run with gid=ais
-# You should do "newgrp ais" before running the tests to run these.
-#
-
-
-# ais_check checks pre-requisites for cluster tests and runs them if ok.
-TESTS+=ais_check
-EXTRA_DIST+=ais_check start_cluster stop_cluster
-
-check_PROGRAMS+=cluster_test
-cluster_test_SOURCES=unit_test.cpp cluster_test.cpp
-cluster_test_LDADD=$(lib_client) ../cluster.la -lboost_unit_test_framework
-
-unit_test_LDADD+=../cluster.la
-
-endif
diff --git a/M4-RCs/qpid/cpp/src/tests/cluster_test.cpp b/M4-RCs/qpid/cpp/src/tests/cluster_test.cpp
deleted file mode 100644
index f4a38ae861..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/cluster_test.cpp
+++ /dev/null
@@ -1,648 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "test_tools.h"
-#include "unit_test.h"
-#include "ForkedBroker.h"
-#include "BrokerFixture.h"
-
-#include "qpid/client/Connection.h"
-#include "qpid/client/ConnectionAccess.h"
-#include "qpid/client/Session.h"
-#include "qpid/client/FailoverListener.h"
-#include "qpid/cluster/Cluster.h"
-#include "qpid/cluster/Cpg.h"
-#include "qpid/cluster/DumpClient.h"
-#include "qpid/framing/AMQBody.h"
-#include "qpid/framing/Uuid.h"
-#include "qpid/framing/reply_exceptions.h"
-#include "qpid/framing/enum.h"
-#include "qpid/log/Logger.h"
-
-#include <boost/bind.hpp>
-#include <boost/shared_ptr.hpp>
-
-#include <string>
-#include <iostream>
-#include <iterator>
-#include <vector>
-#include <set>
-#include <algorithm>
-#include <iterator>
-
-namespace std { // ostream operators in std:: namespace
-template <class T>
-ostream& operator<<(ostream& o, const std::set<T>& s) { return seqPrint(o, s); }
-}
-
-
-QPID_AUTO_TEST_SUITE(cluster)
-
-using namespace std;
-using namespace qpid;
-using namespace qpid::cluster;
-using namespace qpid::framing;
-using namespace qpid::client;
-using qpid::sys::TIME_SEC;
-using qpid::broker::Broker;
-using boost::shared_ptr;
-using qpid::cluster::Cluster;
-
-/** Parse broker & cluster options */
-Broker::Options parseOpts(size_t argc, const char* argv[]) {
- Broker::Options opts;
- Plugin::addOptions(opts); // Pick up cluster options.
- opts.parse(argc, argv, "", true); // Allow-unknown for --load-module
- return opts;
-}
-
-/** Cluster fixture is a vector of ports for the replicas.
- *
- * At most one replica (by default replica 0) is in the current
- * process, all others are forked as children.
- */
-class ClusterFixture : public vector<uint16_t> {
- string name;
- std::auto_ptr<BrokerFixture> localBroker;
- int localIndex;
- std::vector<shared_ptr<ForkedBroker> > forkedBrokers;
-
- public:
- /** @param localIndex can be -1 meaning don't automatically start a local broker.
- * A local broker can be started with addLocal().
- */
- ClusterFixture(size_t n, int localIndex=0);
- void add(size_t n) { for (size_t i=0; i < n; ++i) add(); }
- void add(); // Add a broker.
- void addLocal(); // Add a local broker.
- void setup();
-
- bool hasLocal() const { return localIndex >= 0 && size_t(localIndex) < size(); }
-
- /** Kill a forked broker with sig, or shutdown localBroker if n==0. */
- void kill(size_t n, int sig=SIGINT) {
- if (n == size_t(localIndex))
- localBroker->broker->shutdown();
- else
- forkedBrokers[n]->kill(sig);
- }
-
- /** Kill a broker and suppress errors from connection. */
- void killWithSilencer(size_t n, client::Connection& c, int sig=SIGINT) {
- ScopedSuppressLogging sl;
- kill(n,sig);
- try { c.close(); } catch(...) {}
- }
-};
-
-ClusterFixture::ClusterFixture(size_t n, int localIndex_) : name(Uuid(true).str()), localIndex(localIndex_) {
- add(n);
-}
-
-void ClusterFixture::add() {
- if (size() != size_t(localIndex)) { // fork a broker process.
- std::ostringstream os; os << "fork" << size();
- std::string prefix = os.str();
- const char* argv[] = {
- "qpidd " __FILE__ ,
- "--no-module-dir",
- "--load-module=../.libs/cluster.so",
- "--cluster-name", name.c_str(),
- "--auth=no", "--no-data-dir",
- "--log-prefix", prefix.c_str(),
- };
- size_t argc = sizeof(argv)/sizeof(argv[0]);
- forkedBrokers.push_back(shared_ptr<ForkedBroker>(new ForkedBroker(argc, argv)));
- push_back(forkedBrokers.back()->getPort());
- }
- else { // Run in this process
- addLocal();
- }
-}
-
-void ClusterFixture::addLocal() {
- assert(int(size()) == localIndex || localIndex == -1);
- localIndex = size();
- const char* argv[] = {
- "qpidd " __FILE__ ,
- "--load-module=../.libs/cluster.so",
- "--cluster-name", name.c_str(),
- "--auth=no", "--no-data-dir"
- };
- size_t argc = sizeof(argv)/sizeof(argv[0]);
- ostringstream os; os << "local" << localIndex;
- qpid::log::Logger::instance().setPrefix(os.str());
- localBroker.reset(new BrokerFixture(parseOpts(argc, argv)));
- push_back(localBroker->getPort());
- forkedBrokers.push_back(shared_ptr<ForkedBroker>());
-}
-
-ostream& operator<<(ostream& o, const cpg_name* n) {
- return o << qpid::cluster::Cpg::str(*n);
-}
-
-ostream& operator<<(ostream& o, const cpg_address& a) {
- return o << "(" << a.nodeid <<","<<a.pid<<","<<a.reason<<")";
-}
-
-template <class T>
-ostream& operator<<(ostream& o, const pair<T*, int>& array) {
- o << "{ ";
- ostream_iterator<cpg_address> i(o, " ");
- copy(array.first, array.first+array.second, i);
- o << "}";
- return o;
-}
-
-template <class C> set<uint16_t> makeSet(const C& c) {
- set<uint16_t> s;
- std::copy(c.begin(), c.end(), std::inserter(s, s.begin()));
- return s;
-}
-
-template <class T> std::set<uint16_t> knownBrokerPorts(T& source, int n=-1) {
- vector<Url> urls = source.getKnownBrokers();
- if (n >= 0 && unsigned(n) != urls.size()) {
- BOOST_MESSAGE("knownBrokerPorts waiting for " << n << ": " << urls);
- // Retry up to 10 secs in .1 second intervals.
- for (size_t retry=100; urls.size() != unsigned(n) && retry != 0; --retry) {
- ::usleep(1000*100); // 0.1 secs
- urls = source.getKnownBrokers();
- }
- }
- BOOST_MESSAGE("knownBrokerPorts expecting " << n << ": " << urls);
- set<uint16_t> s;
- for (vector<Url>::const_iterator i = urls.begin(); i != urls.end(); ++i)
- s.insert((*i)[0].get<TcpAddress>()->port);
- return s;
-}
-
-class Sender {
- public:
- Sender(boost::shared_ptr<ConnectionImpl> ci, uint16_t ch) : connection(ci), channel(ch) {}
- void send(const AMQBody& body, bool firstSeg, bool lastSeg, bool firstFrame, bool lastFrame) {
- AMQFrame f(body);
- f.setChannel(channel);
- f.setFirstSegment(firstSeg);
- f.setLastSegment(lastSeg);
- f.setFirstFrame(firstFrame);
- f.setLastFrame(lastFrame);
- connection->handle(f);
- }
-
- private:
- boost::shared_ptr<ConnectionImpl> connection;
- uint16_t channel;
-};
-
-int64_t getMsgSequence(const Message& m) {
- return m.getMessageProperties().getApplicationHeaders().getAsInt64("qpid.msg_sequence");
-}
-
-QPID_AUTO_TEST_CASE(testSequenceOptions) {
- // Make sure the exchange qpid.msg_sequence property is properly replicated.
- ClusterFixture cluster(1);
- Client c0(cluster[0], "c0");
- FieldTable args;
- args.setInt("qpid.msg_sequence", 1); // FIXME aconway 2008-11-11: works with "qpid.sequence_counter"??
- c0.session.queueDeclare(arg::queue="q");
- c0.session.exchangeDeclare(arg::exchange="ex", arg::type="direct", arg::arguments=args);
- c0.session.exchangeBind(arg::exchange="ex", arg::queue="q", arg::bindingKey="k");
- c0.session.messageTransfer(arg::content=Message("1", "k"), arg::destination="ex");
- c0.session.messageTransfer(arg::content=Message("2", "k"), arg::destination="ex");
- BOOST_CHECK_EQUAL(1, getMsgSequence(c0.subs.get("q", TIME_SEC)));
- BOOST_CHECK_EQUAL(2, getMsgSequence(c0.subs.get("q", TIME_SEC)));
-
- cluster.add();
- Client c1(cluster[1]);
- c1.session.messageTransfer(arg::content=Message("3", "k"), arg::destination="ex");
- BOOST_CHECK_EQUAL(3, getMsgSequence(c1.subs.get("q", TIME_SEC)));
-}
-
-QPID_AUTO_TEST_CASE(testUnsupported) {
- ScopedSuppressLogging sl;
- ClusterFixture cluster(1);
- Client c1(cluster[0], "c1");
- BOOST_CHECK_THROW(c1.session.dtxSelect(), FramingErrorException);
- Client c2(cluster[0], "c2");
- Message m;
- m.getDeliveryProperties().setTtl(1);
- BOOST_CHECK_THROW(c2.session.messageTransfer(arg::content=m), Exception);
-}
-
-QPID_AUTO_TEST_CASE(testTxTransaction) {
- ClusterFixture cluster(1);
- Client c0(cluster[0], "c0");
- c0.session.queueDeclare(arg::queue="q");
- c0.session.messageTransfer(arg::content=Message("A", "q"));
- c0.session.messageTransfer(arg::content=Message("B", "q"));
-
- // Start a transaction that will commit.
- Session commitSession = c0.connection.newSession("commit");
- SubscriptionManager commitSubs(commitSession);
- commitSession.txSelect();
- commitSession.messageTransfer(arg::content=Message("a", "q"));
- commitSession.messageTransfer(arg::content=Message("b", "q"));
- BOOST_CHECK_EQUAL(commitSubs.get("q", TIME_SEC).getData(), "A");
-
- // Start a transaction that will roll back.
- Session rollbackSession = c0.connection.newSession("rollback");
- SubscriptionManager rollbackSubs(rollbackSession);
- rollbackSession.txSelect();
- rollbackSession.messageTransfer(arg::content=Message("1", "q"));
- Message rollbackMessage = rollbackSubs.get("q", TIME_SEC);
- BOOST_CHECK_EQUAL(rollbackMessage.getData(), "B");
-
- BOOST_CHECK_EQUAL(c0.session.queueQuery("q").getMessageCount(), 0u);
- // Add new member mid transaction.
- cluster.add();
- Client c1(cluster[1], "c1");
-
- // More transactional work
- BOOST_CHECK_EQUAL(c1.session.queueQuery("q").getMessageCount(), 0u);
- rollbackSession.messageTransfer(arg::content=Message("2", "q"));
- commitSession.messageTransfer(arg::content=Message("c", "q"));
- rollbackSession.messageTransfer(arg::content=Message("3", "q"));
-
- BOOST_CHECK_EQUAL(c1.session.queueQuery("q").getMessageCount(), 0u);
-
- // Commit/roll back.
- commitSession.txCommit();
- rollbackSession.txRollback();
- rollbackSession.messageRelease(rollbackMessage.getId());
-
-
- // Verify queue status: just the comitted messages and dequeues should remain.
- BOOST_CHECK_EQUAL(c1.session.queueQuery("q").getMessageCount(), 4u);
- BOOST_CHECK_EQUAL(c1.subs.get("q", TIME_SEC).getData(), "B");
- BOOST_CHECK_EQUAL(c1.subs.get("q", TIME_SEC).getData(), "a");
- BOOST_CHECK_EQUAL(c1.subs.get("q", TIME_SEC).getData(), "b");
- BOOST_CHECK_EQUAL(c1.subs.get("q", TIME_SEC).getData(), "c");
-}
-
-QPID_AUTO_TEST_CASE(testUnacked) {
- // Verify replication of unacknowledged messages.
- ClusterFixture cluster(1);
- Client c0(cluster[0], "c0");
-
- Message m;
-
- // Create unacked message: acquired but not accepted.
- SubscriptionSettings manualAccept(FlowControl::unlimited(), ACCEPT_MODE_EXPLICIT, ACQUIRE_MODE_PRE_ACQUIRED, 0);
- c0.session.queueDeclare("q1");
- c0.session.messageTransfer(arg::content=Message("11","q1"));
- LocalQueue q1;
- c0.subs.subscribe(q1, "q1", manualAccept);
- BOOST_CHECK_EQUAL(q1.get(TIME_SEC).getData(), "11"); // Acquired but not accepted
- BOOST_CHECK_EQUAL(c0.session.queueQuery("q1").getMessageCount(), 0u); // Gone from queue
-
- // Create unacked message: not acquired, accepted or completeed.
- SubscriptionSettings manualAcquire(FlowControl::unlimited(), ACCEPT_MODE_EXPLICIT, ACQUIRE_MODE_NOT_ACQUIRED, 0);
- c0.session.queueDeclare("q2");
- c0.session.messageTransfer(arg::content=Message("21","q2"));
- c0.session.messageTransfer(arg::content=Message("22","q2"));
- LocalQueue q2;
- c0.subs.subscribe(q2, "q2", manualAcquire);
- m = q2.get(TIME_SEC); // Not acquired or accepted, still on queue
- BOOST_CHECK_EQUAL(m.getData(), "21");
- BOOST_CHECK_EQUAL(c0.session.queueQuery("q2").getMessageCount(), 2u); // Not removed
- c0.subs.getSubscription("q2").acquire(m); // Acquire manually
- BOOST_CHECK_EQUAL(c0.session.queueQuery("q2").getMessageCount(), 1u); // Removed
- BOOST_CHECK_EQUAL(q2.get(TIME_SEC).getData(), "22"); // Not acquired or accepted, still on queue
- BOOST_CHECK_EQUAL(c0.session.queueQuery("q2").getMessageCount(), 1u); // 1 not acquired.
-
- // Create empty credit record: acquire and accept but don't complete.
- SubscriptionSettings manualComplete(FlowControl::messageWindow(1), ACCEPT_MODE_EXPLICIT, ACQUIRE_MODE_PRE_ACQUIRED, 1, MANUAL_COMPLETION);
- c0.session.queueDeclare("q3");
- c0.session.messageTransfer(arg::content=Message("31", "q3"));
- c0.session.messageTransfer(arg::content=Message("32", "q3"));
- LocalQueue q3;
- c0.subs.subscribe(q3, "q3", manualComplete);
- Message m31=q3.get(TIME_SEC);
- BOOST_CHECK_EQUAL(m31.getData(), "31"); // Automatically acquired & accepted but not completed.
- BOOST_CHECK_EQUAL(c0.session.queueQuery("q3").getMessageCount(), 1u);
-
- // Add new member while there are unacked messages.
- cluster.add();
- Client c1(cluster[1], "c1");
-
- // Check queue counts
- BOOST_CHECK_EQUAL(c1.session.queueQuery("q1").getMessageCount(), 0u);
- BOOST_CHECK_EQUAL(c1.session.queueQuery("q2").getMessageCount(), 1u);
- BOOST_CHECK_EQUAL(c1.session.queueQuery("q3").getMessageCount(), 1u);
-
- // Complete the empty credit message, should unblock the message behind it.
- BOOST_CHECK_THROW(q3.get(0), Exception);
- c0.session.markCompleted(SequenceSet(m31.getId()), true);
- BOOST_CHECK_EQUAL(q3.get(TIME_SEC).getData(), "32");
- BOOST_CHECK_EQUAL(c0.session.queueQuery("q3").getMessageCount(), 0u);
- BOOST_CHECK_EQUAL(c1.session.queueQuery("q3").getMessageCount(), 0u);
-
- // Close the original session - unacked messages should be requeued.
- c0.session.close();
- BOOST_CHECK_EQUAL(c1.session.queueQuery("q1").getMessageCount(), 1u);
- BOOST_CHECK_EQUAL(c1.session.queueQuery("q2").getMessageCount(), 2u);
-
- BOOST_CHECK_EQUAL(c1.subs.get("q1", TIME_SEC).getData(), "11");
- BOOST_CHECK_EQUAL(c1.subs.get("q2", TIME_SEC).getData(), "21");
- BOOST_CHECK_EQUAL(c1.subs.get("q2", TIME_SEC).getData(), "22");
-}
-
-QPID_AUTO_TEST_CASE_EXPECTED_FAILURES(testDumpTxState, 1) {
- // Verify that we dump transaction state correctly to new members.
- ClusterFixture cluster(1);
- Client c0(cluster[0], "c0");
-
- // Do work in a transaction.
- c0.session.txSelect();
- c0.session.queueDeclare("q");
- c0.session.messageTransfer(arg::content=Message("1","q"));
- c0.session.messageTransfer(arg::content=Message("2","q"));
- Message m;
- BOOST_CHECK(c0.subs.get(m, "q", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "1");
-
- // New member, TX not comitted, c1 should see nothing.
- cluster.add();
- Client c1(cluster[1], "c1");
- BOOST_CHECK_EQUAL(c1.session.queueQuery(arg::queue="q").getMessageCount(), 0u);
-
- // After commit c1 shoudl see results of tx.
- c0.session.txCommit();
- BOOST_CHECK_EQUAL(c1.session.queueQuery(arg::queue="q").getMessageCount(), 1u);
- BOOST_CHECK(c1.subs.get(m, "q", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "2");
-
- // Another transaction with both members active.
- c0.session.messageTransfer(arg::content=Message("3","q"));
- BOOST_CHECK_EQUAL(c1.session.queueQuery(arg::queue="q").getMessageCount(), 0u);
- c0.session.txCommit();
- BOOST_CHECK_EQUAL(c1.session.queueQuery(arg::queue="q").getMessageCount(), 1u);
- BOOST_CHECK(c1.subs.get(m, "q", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "3");
-}
-
-QPID_AUTO_TEST_CASE(testDumpMessageBuilder) {
- // Verify that we dump a partially recieved message to a new member.
- ClusterFixture cluster(1);
- Client c0(cluster[0], "c0");
- c0.session.queueDeclare("q");
- Sender sender(ConnectionAccess::getImpl(c0.connection), c0.session.getChannel());
-
- // Send first 2 frames of message.
- MessageTransferBody transfer(
- ProtocolVersion(), std::string(), // default exchange.
- framing::message::ACCEPT_MODE_NONE,
- framing::message::ACQUIRE_MODE_PRE_ACQUIRED);
- sender.send(transfer, true, false, true, true);
- AMQHeaderBody header;
- header.get<DeliveryProperties>(true)->setRoutingKey("q");
- sender.send(header, false, false, true, true);
-
- // No reliable way to ensure the partial message has arrived
- // before we start the new broker, so we sleep.
- ::usleep(2500);
- cluster.add();
-
- // Send final 2 frames of message.
- sender.send(AMQContentBody("ab"), false, true, true, false);
- sender.send(AMQContentBody("cd"), false, true, false, true);
-
- // Verify message is enqued correctly on second member.
- Message m;
- Client c1(cluster[1], "c1");
- BOOST_CHECK(c1.subs.get(m, "q", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "abcd");
- BOOST_CHECK_EQUAL(2u, knownBrokerPorts(c1.connection).size());
-}
-
-QPID_AUTO_TEST_CASE(testConnectionKnownHosts) {
- ClusterFixture cluster(1);
- Client c0(cluster[0], "c0");
- set<uint16_t> kb0 = knownBrokerPorts(c0.connection);
- BOOST_CHECK_EQUAL(kb0.size(), 1u);
- BOOST_CHECK_EQUAL(kb0, makeSet(cluster));
-
- cluster.add();
- Client c1(cluster[1], "c1");
- set<uint16_t> kb1 = knownBrokerPorts(c1.connection);
- kb0 = knownBrokerPorts(c0.connection, 2);
- BOOST_CHECK_EQUAL(kb1.size(), 2u);
- BOOST_CHECK_EQUAL(kb1, makeSet(cluster));
- BOOST_CHECK_EQUAL(kb1,kb0);
-
- cluster.add();
- Client c2(cluster[2], "c2");
- set<uint16_t> kb2 = knownBrokerPorts(c2.connection);
- kb1 = knownBrokerPorts(c1.connection, 3);
- kb0 = knownBrokerPorts(c0.connection, 3);
- BOOST_CHECK_EQUAL(kb2.size(), 3u);
- BOOST_CHECK_EQUAL(kb2, makeSet(cluster));
- BOOST_CHECK_EQUAL(kb2,kb0);
- BOOST_CHECK_EQUAL(kb2,kb1);
-
- cluster.killWithSilencer(1,c1.connection,9);
- kb0 = knownBrokerPorts(c0.connection, 2);
- kb2 = knownBrokerPorts(c2.connection, 2);
- BOOST_CHECK_EQUAL(kb0.size(), 2u);
- BOOST_CHECK_EQUAL(kb0, kb2);
-}
-
-QPID_AUTO_TEST_CASE(DumpConsumers) {
- ClusterFixture cluster(1, 1);
-
- Client c0(cluster[0], "c0");
- c0.session.queueDeclare("p");
- c0.session.queueDeclare("q");
- c0.subs.subscribe(c0.lq, "q", FlowControl::zero());
- LocalQueue lp;
- c0.subs.subscribe(lp, "p", FlowControl::messageCredit(1));
- c0.session.sync();
-
- // Start new members
- cluster.add(); // Local
- Client c1(cluster[1], "c1");
- cluster.add();
- Client c2(cluster[2], "c2");
-
- // Transfer messages
- c0.session.messageTransfer(arg::content=Message("aaa", "q"));
-
- c0.session.messageTransfer(arg::content=Message("bbb", "p"));
- c0.session.messageTransfer(arg::content=Message("ccc", "p"));
-
- // Activate the subscription, ensure message removed on all queues.
- c0.subs.setFlowControl("q", FlowControl::unlimited());
- Message m;
- BOOST_CHECK(c0.lq.get(m, TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "aaa");
- BOOST_CHECK_EQUAL(c0.session.queueQuery("q").getMessageCount(), 0u);
- BOOST_CHECK_EQUAL(c1.session.queueQuery("q").getMessageCount(), 0u);
- BOOST_CHECK_EQUAL(c2.session.queueQuery("q").getMessageCount(), 0u);
-
- // Check second subscription's flow control: gets first message, not second.
- BOOST_CHECK(lp.get(m, TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "bbb");
- BOOST_CHECK_EQUAL(c0.session.queueQuery("p").getMessageCount(), 1u);
- BOOST_CHECK_EQUAL(c1.session.queueQuery("p").getMessageCount(), 1u);
- BOOST_CHECK_EQUAL(c2.session.queueQuery("p").getMessageCount(), 1u);
-
- BOOST_CHECK(c0.subs.get(m, "p", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "ccc");
-
- // Kill the subscribing member, ensure further messages are not removed.
- cluster.killWithSilencer(0,c0.connection,9);
- BOOST_REQUIRE_EQUAL(knownBrokerPorts(c1.connection, 2).size(), 2u);
- for (int i = 0; i < 10; ++i) {
- c1.session.messageTransfer(arg::content=Message("xxx", "q"));
- BOOST_REQUIRE(c1.subs.get(m, "q", TIME_SEC));
- BOOST_REQUIRE_EQUAL(m.getData(), "xxx");
- }
-}
-
-QPID_AUTO_TEST_CASE(testCatchupSharedState) {
- ClusterFixture cluster(1);
- Client c0(cluster[0], "c0");
-
- // Create some shared state.
- c0.session.queueDeclare("q");
- c0.session.messageTransfer(arg::content=Message("foo","q"));
- c0.session.messageTransfer(arg::content=Message("bar","q"));
- while (c0.session.queueQuery("q").getMessageCount() != 2)
- ::usleep(1000); // Wait for message to show up on broker 0.
-
- // Add a new broker, it should catch up.
- cluster.add();
-
- // Do some work post-add
- c0.session.queueDeclare("p");
- c0.session.messageTransfer(arg::content=Message("pfoo","p"));
-
- // Do some work post-join
- BOOST_REQUIRE_EQUAL(knownBrokerPorts(c0.connection, 2).size(), 2u);
- c0.session.messageTransfer(arg::content=Message("pbar","p"));
-
- // Verify new brokers have state.
- Message m;
-
- Client c1(cluster[1], "c1");
-
- BOOST_CHECK(c1.subs.get(m, "q", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "foo");
- BOOST_CHECK(c1.subs.get(m, "q", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "bar");
- BOOST_CHECK_EQUAL(c1.session.queueQuery("q").getMessageCount(), 0u);
-
- // Add another broker, don't wait for join - should be stalled till ready.
- cluster.add();
- Client c2(cluster[2], "c2");
- BOOST_CHECK(c2.subs.get(m, "p", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "pfoo");
- BOOST_CHECK(c2.subs.get(m, "p", TIME_SEC));
- BOOST_CHECK_EQUAL(m.getData(), "pbar");
- BOOST_CHECK_EQUAL(c2.session.queueQuery("p").getMessageCount(), 0u);
-}
-
-QPID_AUTO_TEST_CASE(testWiringReplication) {
- ClusterFixture cluster(3);
- Client c0(cluster[0]);
- BOOST_CHECK(c0.session.queueQuery("q").getQueue().empty());
- BOOST_CHECK(c0.session.exchangeQuery("ex").getType().empty());
- c0.session.queueDeclare("q");
- c0.session.exchangeDeclare("ex", arg::type="direct");
- c0.session.close();
- c0.connection.close();
- // Verify all brokers get wiring update.
- for (size_t i = 0; i < cluster.size(); ++i) {
- BOOST_MESSAGE("i == "<< i);
- Client c(cluster[i]);
- BOOST_CHECK_EQUAL("q", c.session.queueQuery("q").getQueue());
- BOOST_CHECK_EQUAL("direct", c.session.exchangeQuery("ex").getType());
- }
-}
-
-QPID_AUTO_TEST_CASE(testMessageEnqueue) {
- // Enqueue on one broker, dequeue on another.
- ClusterFixture cluster(2);
- Client c0(cluster[0]);
- c0.session.queueDeclare("q");
- c0.session.messageTransfer(arg::content=Message("foo", "q"));
- c0.session.messageTransfer(arg::content=Message("bar", "q"));
- c0.session.close();
- Client c1(cluster[1]);
- Message msg;
- BOOST_CHECK(c1.subs.get(msg, "q", qpid::sys::TIME_SEC));
- BOOST_CHECK_EQUAL(string("foo"), msg.getData());
- BOOST_CHECK(c1.subs.get(msg, "q", qpid::sys::TIME_SEC));
- BOOST_CHECK_EQUAL(string("bar"), msg.getData());
-}
-
-QPID_AUTO_TEST_CASE(testMessageDequeue) {
- // Enqueue on one broker, dequeue on two others.
- ClusterFixture cluster(3);
- Client c0(cluster[0], "c0");
- c0.session.queueDeclare("q");
- c0.session.messageTransfer(arg::content=Message("foo", "q"));
- c0.session.messageTransfer(arg::content=Message("bar", "q"));
-
- Message msg;
-
- // Dequeue on 2 others, ensure correct order.
- Client c1(cluster[1], "c1");
- BOOST_CHECK(c1.subs.get(msg, "q"));
- BOOST_CHECK_EQUAL("foo", msg.getData());
-
- Client c2(cluster[2], "c2");
- BOOST_CHECK(c1.subs.get(msg, "q"));
- BOOST_CHECK_EQUAL("bar", msg.getData());
-
- // Queue should be empty on all cluster members.
- BOOST_CHECK_EQUAL(0u, c0.session.queueQuery("q").getMessageCount());
- BOOST_CHECK_EQUAL(0u, c1.session.queueQuery("q").getMessageCount());
- BOOST_CHECK_EQUAL(0u, c2.session.queueQuery("q").getMessageCount());
-}
-
-QPID_AUTO_TEST_CASE(testDequeueWaitingSubscription) {
- ClusterFixture cluster(3);
- Client c0(cluster[0]);
- BOOST_REQUIRE_EQUAL(knownBrokerPorts(c0.connection, 3).size(), 3u); // Wait for brokers.
-
- // First start a subscription.
- c0.session.queueDeclare("q");
- c0.subs.subscribe(c0.lq, "q", FlowControl::messageCredit(2));
-
- // Now send messages
- Client c1(cluster[1]);
- c1.session.messageTransfer(arg::content=Message("foo", "q"));
- c1.session.messageTransfer(arg::content=Message("bar", "q"));
-
- // Check they arrived
- Message m;
- BOOST_CHECK(c0.lq.get(m, sys::TIME_SEC));
- BOOST_CHECK_EQUAL("foo", m.getData());
- BOOST_CHECK(c0.lq.get(m, sys::TIME_SEC));
- BOOST_CHECK_EQUAL("bar", m.getData());
-
- // Queue should be empty on all cluster members.
- Client c2(cluster[2]);
- BOOST_CHECK_EQUAL(0u, c0.session.queueQuery("q").getMessageCount());
- BOOST_CHECK_EQUAL(0u, c1.session.queueQuery("q").getMessageCount());
- BOOST_CHECK_EQUAL(0u, c2.session.queueQuery("q").getMessageCount());
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/config.null b/M4-RCs/qpid/cpp/src/tests/config.null
deleted file mode 100644
index 565c7da435..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/config.null
+++ /dev/null
@@ -1 +0,0 @@
-# empty config
diff --git a/M4-RCs/qpid/cpp/src/tests/consume.cpp b/M4-RCs/qpid/cpp/src/tests/consume.cpp
deleted file mode 100644
index 4d74b8ae57..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/consume.cpp
+++ /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.
- *
- */
-
-#include <algorithm>
-#include <iostream>
-#include <memory>
-#include <sstream>
-#include <vector>
-
-#include "TestOptions.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/Session.h"
-#include "qpid/client/SubscriptionManager.h"
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::sys;
-using namespace std;
-
-typedef vector<string> StringSet;
-
-struct Args : public qpid::TestOptions {
- uint count;
- uint ack;
- string queue;
- bool declare;
- bool summary;
-
- Args() : count(1000), ack(0), queue("publish-consume"),
- declare(false), summary(false)
- {
- addOptions()
- ("count", optValue(count, "N"), "number of messages to publish")
- ("ack-frequency", optValue(ack, "N"), "ack every N messages (0 means use no-ack mode)")
- ("queue", optValue(queue, "<queue name>"), "queue to consume from")
- ("declare", optValue(declare), "declare the queue")
- ("s,summary", optValue(summary), "Print undecorated rate.");
- }
-};
-
-Args opts;
-
-struct Client
-{
- Connection connection;
- Session session;
-
- Client()
- {
- opts.open(connection);
- session = connection.newSession();
- }
-
- void consume()
- {
- if (opts.declare)
- session.queueDeclare(opts.queue);
- SubscriptionManager subs(session);
- LocalQueue lq;
- SubscriptionSettings settings;
- settings.acceptMode = opts.ack > 0 ? ACCEPT_MODE_EXPLICIT : ACCEPT_MODE_NONE;
- settings.flowControl = FlowControl(opts.count, SubscriptionManager::UNLIMITED,false);
- Subscription sub = subs.subscribe(lq, opts.queue, settings);
- Message msg;
- AbsTime begin=now();
- for (size_t i = 0; i < opts.count; ++i) {
- msg=lq.pop();
- QPID_LOG(info, "Received: " << msg.getMessageProperties().getCorrelationId());
- }
- if (opts.ack != 0)
- sub.accept(sub.getUnaccepted()); // Cumulative ack for final batch.
- AbsTime end=now();
- double secs(double(Duration(begin,end))/TIME_SEC);
- if (opts.summary) cout << opts.count/secs << endl;
- else cout << "Time: " << secs << "s Rate: " << opts.count/secs << endl;
- }
-
- ~Client()
- {
- try{
- session.close();
- connection.close();
- } catch(const exception& e) {
- cout << e.what() << endl;
- }
- }
-};
-
-int main(int argc, char** argv)
-{
- try {
- opts.parse(argc, argv);
- Client client;
- client.consume();
- return 0;
- } catch(const exception& e) {
- cout << e.what() << endl;
- }
- return 1;
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/declare_queues.cpp b/M4-RCs/qpid/cpp/src/tests/declare_queues.cpp
deleted file mode 100644
index 7f61bde12a..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/declare_queues.cpp
+++ /dev/null
@@ -1,69 +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 <qpid/client/FailoverManager.h>
-#include <qpid/client/Session.h>
-#include <qpid/Exception.h>
-
-#include <cstdlib>
-#include <iostream>
-
-using namespace qpid::client;
-
-using namespace std;
-
-int main(int argc, char ** argv)
-{
- ConnectionSettings settings;
- if ( argc != 3 )
- {
- cerr << "Usage: declare_queues host port\n";
- return 1;
- }
-
- settings.host = argv[1];
- settings.port = atoi(argv[2]);
-
- FailoverManager connection(settings);
- try {
- bool complete = false;
- while (!complete) {
- Session session = connection.connect().newSession();
- try {
- session.queueDeclare(arg::queue="message_queue");
- complete = true;
- } catch (const qpid::TransportFailure&) {}
- }
- connection.close();
- return 0;
- } catch (const exception& error) {
- cerr << "declare_queues failed:" << error.what() << endl;
- cerr << " host: " << settings.host
- << " port: " << settings.port << endl;
- return 1;
- }
-
-}
-
-
-
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/dlclose_noop.c b/M4-RCs/qpid/cpp/src/tests/dlclose_noop.c
deleted file mode 100644
index ba2fa75891..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/dlclose_noop.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-/*
- * Loaded via LD_PRELOAD this will turn dlclose into a no-op.
- *
- * Allows valgrind to generate useful reports from programs that
- * dynamically unload libraries before exit, such as CppUnit's
- * DllPlugInTester.
- *
- */
-
-#include <stdio.h>
-void* dlclose(void* handle) {}
-
diff --git a/M4-RCs/qpid/cpp/src/tests/echotest.cpp b/M4-RCs/qpid/cpp/src/tests/echotest.cpp
deleted file mode 100644
index 7cbf3e7df4..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/echotest.cpp
+++ /dev/null
@@ -1,150 +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 <qpid/client/Connection.h>
-#include <qpid/client/SubscriptionManager.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/MessageListener.h>
-#include <qpid/sys/Time.h>
-
-#include <iostream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-using namespace qpid::sys;
-using namespace std;
-
-struct Args : public qpid::Options,
- public qpid::client::ConnectionSettings
-{
- bool help;
- uint count;
- uint size;
- bool summary;
-
- Args() : qpid::Options("Simple latency test optins"), help(false), count(20), size(0), summary()
- {
- using namespace qpid;
- addOptions()
- ("help", optValue(help), "Print this usage statement")
- ("count", optValue(count, "N"), "Number of messages to send")
- ("size", optValue(count, "N"), "Size of messages")
- ("broker,b", optValue(host, "HOST"), "Broker host to connect to")
- ("port,p", optValue(port, "PORT"), "Broker port to connect to")
- ("username", optValue(username, "USER"), "user name for broker log in.")
- ("password", optValue(password, "PASSWORD"), "password for broker log in.")
- ("mechanism", optValue(mechanism, "MECH"), "SASL mechanism to use when authenticating.")
- ("tcp-nodelay", optValue(tcpNoDelay), "Turn on tcp-nodelay")
- ("s,summary", optValue(summary), "Print only average latency.");
- }
-};
-
-uint64_t current_time()
-{
- Duration t(now());
- return t;
-}
-
-class Listener : public MessageListener
-{
- private:
- Session session;
- SubscriptionManager subscriptions;
- uint counter;
- const uint limit;
- std::string queue;
- Message request;
- double total, min, max;
- bool summary;
-
- public:
- Listener(Session& session, uint limit, bool summary);
- void start(uint size);
- void received(Message& message);
-};
-
-Listener::Listener(Session& s, uint l, bool summary_) :
- session(s), subscriptions(s), counter(0), limit(l),
- queue(session.getId().getName()), total(),
- min(std::numeric_limits<double>::max()), max(), summary(summary_)
-{}
-
-void Listener::start(uint size)
-{
- session.queueDeclare(arg::queue=queue, arg::exclusive=true, arg::autoDelete=true);
- request.getDeliveryProperties().setRoutingKey(queue);
- subscriptions.subscribe(*this, queue, SubscriptionSettings(FlowControl::unlimited(), ACCEPT_MODE_NONE));
-
- request.getDeliveryProperties().setTimestamp(current_time());
- if (size) request.setData(std::string(size, 'X'));
- async(session).messageTransfer(arg::content=request);
- subscriptions.run();
-}
-
-void Listener::received(Message& response)
-{
- //extract timestamp and compute latency:
- uint64_t sentAt = response.getDeliveryProperties().getTimestamp();
- uint64_t receivedAt = current_time();
-
- double latency = ((double) (receivedAt - sentAt)) / TIME_MSEC;
- if (!summary) cout << "Latency: " << latency << "ms" << endl;
- min = std::min(latency, min);
- max = std::max(latency, max);
- total += latency;
-
- if (++counter < limit) {
- request.getDeliveryProperties().setTimestamp(current_time());
- async(session).messageTransfer(arg::content=request);
- } else {
- subscriptions.cancel(queue);
- if (summary) cout << min << "\t" << max << "\t" << total/limit << endl;
- else cout << "min: " << min << " max: " << max << " average: " << total/limit << endl;
- }
-}
-
-int main(int argc, char** argv)
-{
- Args opts;
- opts.parse(argc, argv);
-
- if (opts.help) {
- std::cout << opts << std::endl;
- return 0;
- }
-
- Connection connection;
- try {
- connection.open(opts);
- Session session = connection.newSession();
- Listener listener(session, opts.count, opts.summary);
- listener.start(opts.size);
-
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << error.what() << std::endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/exception_test.cpp b/M4-RCs/qpid/cpp/src/tests/exception_test.cpp
deleted file mode 100644
index e420bf2f0b..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/exception_test.cpp
+++ /dev/null
@@ -1,121 +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 "unit_test.h"
-#include "test_tools.h"
-#include "BrokerFixture.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/sys/Runnable.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/framing/reply_exceptions.h"
-
-QPID_AUTO_TEST_SUITE(exception_test)
-
-// FIXME aconway 2008-06-12: need to update our exception handling to
-// 0-10 handling and extend this test to provoke all the exceptional
-// conditions we know of and verify the correct exception is thrown.
-
-using namespace std;
-using namespace qpid;
-using namespace sys;
-using namespace client;
-using namespace framing;
-
-using qpid::broker::Broker;
-using boost::bind;
-using boost::function;
-
-template <class Ex>
-struct Catcher : public Runnable {
- function<void ()> f;
- bool caught;
- Thread thread;
-
- Catcher(function<void ()> f_) : f(f_), caught(false), thread(this) {}
- ~Catcher() { join(); }
-
- void run() {
- try {
- ScopedSuppressLogging sl; // Suppress messages for expected errors.
- f();
- }
- catch(const Ex& e) {
- caught=true;
- BOOST_MESSAGE(string("Caught expected exception: ")+e.what()+"["+typeid(e).name()+"]");
- }
- catch(const std::exception& e) {
- BOOST_ERROR(string("Bad exception: ")+e.what()+"["+typeid(e).name()+"] expected: "+typeid(Ex).name());
- }
- catch(...) {
- BOOST_ERROR(string("Bad exception: unknown"));
- }
- }
-
- bool join() {
- if (thread.id()) {
- thread.join();
- thread=Thread();
- }
- return caught;
- }
-};
-
-QPID_AUTO_TEST_CASE(TestSessionBusy) {
- SessionFixture f;
- try {
- ScopedSuppressLogging sl; // Suppress messages for expected errors.
- f.connection.newSession(f.session.getId().getName());
- BOOST_FAIL("Expected SessionBusyException for " << f.session.getId().getName());
- } catch (const SessionBusyException&) {} // FIXME aconway 2008-09-22: client is not throwing correct exception.
-}
-
-QPID_AUTO_TEST_CASE(DisconnectedPop) {
- ProxySessionFixture fix;
- ProxyConnection c(fix.broker->getPort(Broker::TCP_TRANSPORT));
- fix.session.queueDeclare(arg::queue="q");
- fix.subs.subscribe(fix.lq, "q");
- Catcher<TransportFailure> pop(bind(&LocalQueue::pop, &fix.lq, sys::TIME_SEC));
- fix.connection.proxy.close();
- BOOST_CHECK(pop.join());
-}
-
-QPID_AUTO_TEST_CASE(DisconnectedListen) {
- ProxySessionFixture fix;
- struct NullListener : public MessageListener {
- void received(Message&) { BOOST_FAIL("Unexpected message"); }
- } l;
- ProxyConnection c(fix.broker->getPort(Broker::TCP_TRANSPORT));
- fix.session.queueDeclare(arg::queue="q");
- fix.subs.subscribe(l, "q");
-
- Catcher<TransportFailure> runner(bind(&SubscriptionManager::run, boost::ref(fix.subs)));
- fix.connection.proxy.close();
- runner.join();
- BOOST_CHECK_THROW(fix.session.close(), TransportFailure);
-}
-
-QPID_AUTO_TEST_CASE(NoSuchQueueTest) {
- ProxySessionFixture fix;
- ScopedSuppressLogging sl; // Suppress messages for expected errors.
- BOOST_CHECK_THROW(fix.subs.subscribe(fix.lq, "no such queue"), NotFoundException);
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/failover_soak.cpp b/M4-RCs/qpid/cpp/src/tests/failover_soak.cpp
deleted file mode 100644
index 6149e845e4..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/failover_soak.cpp
+++ /dev/null
@@ -1,654 +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 <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <string.h>
-
-#include <string>
-#include <iostream>
-#include <sstream>
-#include <vector>
-
-#include <ForkedBroker.h>
-
-
-
-
-using namespace std;
-
-
-typedef vector<ForkedBroker *> brokerVector;
-
-typedef enum
-{
- NO_STATUS,
- RUNNING,
- COMPLETED
-}
-childStatus;
-
-
-
-struct child
-{
- child ( string & name, pid_t pid )
- : name(name), pid(pid), retval(-999), status(RUNNING)
- {
- gettimeofday ( & startTime, 0 );
- }
-
-
- void
- done ( int _retval )
- {
- retval = _retval;
- status = COMPLETED;
- gettimeofday ( & stopTime, 0 );
- }
-
-
- string name;
- pid_t pid;
- int retval;
- childStatus status;
- struct timeval startTime,
- stopTime;
-};
-
-
-
-
-struct children : public vector<child *>
-{
- void
- add ( string & name, pid_t pid )
- {
- push_back(new child ( name, pid ));
- }
-
-
- child *
- get ( pid_t pid )
- {
- vector<child *>::iterator i;
- for ( i = begin(); i != end(); ++ i )
- if ( pid == (*i)->pid )
- return *i;
-
- return 0;
- }
-
-
- void
- exited ( pid_t pid, int retval )
- {
- child * kid = get ( pid );
- if(! kid)
- {
- if ( verbosity > 0 )
- {
- cerr << "children::exited warning: Can't find child with pid "
- << pid
- << endl;
- }
- return;
- }
-
- kid->done ( retval );
- }
-
-
- int
- unfinished ( )
- {
- int count = 0;
-
- vector<child *>::iterator i;
- for ( i = begin(); i != end(); ++ i )
- if ( COMPLETED != (*i)->status )
- ++ count;
-
- return count;
- }
-
-
- int
- checkChildren ( )
- {
- vector<child *>::iterator i;
- for ( i = begin(); i != end(); ++ i )
- if ( (COMPLETED == (*i)->status) && (0 != (*i)->retval) )
- return (*i)->retval;
-
- return 0;
- }
-
-
- void
- killEverybody ( )
- {
- vector<child *>::iterator i;
- for ( i = begin(); i != end(); ++ i )
- kill ( (*i)->pid, 9 );
- }
-
-
-
- void
- print ( )
- {
- cout << "--- status of all children --------------\n";
- vector<child *>::iterator i;
- for ( i = begin(); i != end(); ++ i )
- cout << "child: " << (*i)->name
- << " status: " << (*i)->status
- << endl;
- cout << "\n\n\n\n";
- }
-
-
- /*
- Only call this if you already know there is at least
- one child still running. Supply a time in seconds.
- If it has been at least that long since a shild stopped
- running, we judge the system to have hung.
- */
- bool
- hanging ( int hangTime )
- {
- struct timeval now,
- duration;
- gettimeofday ( &now, 0 );
-
- vector<child *>::iterator i;
- for ( i = begin(); i != end(); ++ i )
- {
- timersub ( & now, &((*i)->startTime), & duration );
- if ( duration.tv_sec >= hangTime )
- return true;
- }
-
- return false;
- }
-
-
- int verbosity;
-};
-
-
-
-children allMyChildren;
-
-
-
-
-void
-childExit ( int signalNumber )
-{
- signalNumber ++; // Now maybe the compiler willleave me alone?
- int childReturnCode;
- pid_t pid = waitpid ( 0, & childReturnCode, WNOHANG);
-
- if ( pid > 0 )
- allMyChildren.exited ( pid, childReturnCode );
-}
-
-
-
-int
-mrand ( int maxDesiredVal ) {
- double zeroToOne = (double) rand() / (double) RAND_MAX;
- return (int) (zeroToOne * (double) maxDesiredVal);
-}
-
-
-
-int
-mrand ( int minDesiredVal, int maxDesiredVal ) {
- int interval = maxDesiredVal - minDesiredVal;
- return minDesiredVal + mrand ( interval );
-}
-
-
-
-void
-makeClusterName ( string & s, int & num ) {
- num = mrand(1000);
- stringstream ss;
- ss << "soakTestCluster_" << num;
- s = ss.str();
-}
-
-
-
-
-
-void
-printBrokers ( brokerVector & brokers )
-{
- cout << "Broker List ------------ size: " << brokers.size() << "\n";
- for ( brokerVector::iterator i = brokers.begin(); i != brokers.end(); ++ i) {
- cout << "pid: "
- << (*i)->getPID()
- << " port: "
- << (*i)->getPort()
- << endl;
- }
- cout << "end Broker List ------------\n";
-}
-
-
-
-
-
-void
-startNewBroker ( brokerVector & brokers,
- char const * srcRoot,
- char const * moduleDir,
- string const clusterName )
-{
- static int brokerId = 0;
- stringstream path, prefix, module;
- module << moduleDir << "/cluster.so";
- path << srcRoot << "/qpidd";
- prefix << "soak-" << brokerId++;
-
- const char * const argv[] =
- {
- "qpidd",
- "-p0",
- "--load-module=cluster.so",
- "--cluster-name",
- clusterName.c_str(),
- "--auth=no",
- "--no-data-dir",
- "--no-module-dir",
- "--mgmt-enable=no",
- "--log-prefix", prefix.str().c_str(),
- 0
- };
-
- size_t argc = sizeof(argv)/sizeof(argv[0]);
- brokers.push_back ( new ForkedBroker ( argc, argv ) );
-}
-
-
-
-
-
-void
-killFrontBroker ( brokerVector & brokers, int verbosity )
-{
- if ( verbosity > 0 )
- cout << "killFrontBroker pid: " << brokers[0]->getPID() << " on port " << brokers[0]->getPort() << endl;
- try { brokers[0]->kill(9); }
- catch ( const exception& error ) {
- if ( verbosity > 0 )
- cout << "error killing broker: " << error.what() << endl;
- }
- delete brokers[0];
- brokers.erase ( brokers.begin() );
-}
-
-
-
-
-
-void
-killAllBrokers ( brokerVector & brokers )
-{
- for ( uint i = 0; i < brokers.size(); ++ i )
- try { brokers[i]->kill(9); }
- catch ( ... ) { }
-}
-
-
-
-
-
-pid_t
-runDeclareQueuesClient ( brokerVector brokers,
- char const * host,
- char const * path,
- int verbosity
- )
-{
- string name("declareQueues");
- int port = brokers[0]->getPort ( );
-
- if ( verbosity > 0 )
- cout << "startDeclareQueuesClient: host: "
- << host
- << " port: "
- << port
- << endl;
- stringstream portSs;
- portSs << port;
-
- vector<const char*> argv;
- argv.push_back ( "declareQueues" );
- argv.push_back ( host );
- argv.push_back ( portSs.str().c_str() );
- argv.push_back ( 0 );
- pid_t pid = fork();
-
- if ( ! pid ) {
- execv ( path, const_cast<char * const *>(&argv[0]) );
- perror ( "error executing dq: " );
- return 0;
- }
-
- allMyChildren.add ( name, pid );
- return pid;
-}
-
-
-
-
-
-pid_t
-startReceivingClient ( brokerVector brokers,
- char const * host,
- char const * receiverPath,
- char const * reportFrequency,
- int verbosity
- )
-{
- string name("receiver");
- int port = brokers[0]->getPort ( );
-
- if ( verbosity > 0 )
- cout << "startReceivingClient: port " << port << endl;
- char portStr[100];
- char verbosityStr[100];
- sprintf(portStr, "%d", port);
- sprintf(verbosityStr, "%d", verbosity);
-
-
- vector<const char*> argv;
- argv.push_back ( "resumingReceiver" );
- argv.push_back ( host );
- argv.push_back ( portStr );
- argv.push_back ( reportFrequency );
- argv.push_back ( verbosityStr );
- argv.push_back ( 0 );
-
- pid_t pid = fork();
-
- if ( ! pid ) {
- execv ( receiverPath, const_cast<char * const *>(&argv[0]) );
- perror ( "error executing receiver: " );
- return 0;
- }
-
- allMyChildren.add ( name, pid );
- return pid;
-}
-
-
-
-
-
-pid_t
-startSendingClient ( brokerVector brokers,
- char const * host,
- char const * senderPath,
- char const * nMessages,
- char const * reportFrequency,
- int verbosity
- )
-{
- string name("sender");
- int port = brokers[0]->getPort ( );
-
- if ( verbosity )
- cout << "startSenderClient: port " << port << endl;
- char portStr[100];
- char verbosityStr[100];
-
- sprintf ( portStr, "%d", port);
- sprintf ( verbosityStr, "%d", verbosity);
-
- vector<const char*> argv;
- argv.push_back ( "replayingSender" );
- argv.push_back ( host );
- argv.push_back ( portStr );
- argv.push_back ( nMessages );
- argv.push_back ( reportFrequency );
- argv.push_back ( verbosityStr );
- argv.push_back ( 0 );
-
- pid_t pid = fork();
-
- if ( ! pid ) {
- execv ( senderPath, const_cast<char * const *>(&argv[0]) );
- perror ( "error executing sender: " );
- return 0;
- }
-
- allMyChildren.add ( name, pid );
- return pid;
-}
-
-
-
-#define HUNKY_DORY 0
-#define BAD_ARGS 1
-#define CANT_FORK_DQ 2
-#define CANT_FORK_RECEIVER 3
-#define DQ_FAILED 4
-#define ERROR_ON_CHILD 5
-#define HANGING 6
-
-
-int
-main ( int argc, char const ** argv )
-{
- if ( argc < 9 ) {
- cerr << "Usage: failoverSoak srcRoot moduleDir host senderPath receiverPath nMessages verbosity\n";
- cerr << " ( argc was " << argc << " )\n";
- return BAD_ARGS;
- }
-
- signal ( SIGCHLD, childExit );
-
- char const * srcRoot = argv[1];
- char const * moduleDir = argv[2];
- char const * host = argv[3];
- char const * declareQueuesPath = argv[4];
- char const * senderPath = argv[5];
- char const * receiverPath = argv[6];
- char const * nMessages = argv[7];
- char const * reportFrequency = argv[8];
- int verbosity = atoi(argv[9]);
-
- int maxBrokers = 50;
-
- allMyChildren.verbosity = verbosity;
-
- int clusterNum;
- string clusterName;
-
- srand ( getpid() );
-
- makeClusterName ( clusterName, clusterNum );
-
- brokerVector brokers;
-
- if ( verbosity > 0 )
- cout << "Starting initial cluster...\n";
-
- int nBrokers = 3;
- for ( int i = 0; i < nBrokers; ++ i ) {
- startNewBroker ( brokers,
- srcRoot,
- moduleDir,
- clusterName );
- }
-
-
- if ( verbosity > 0 )
- printBrokers ( brokers );
-
- // Run the declareQueues child.
- int childStatus;
- pid_t dqClientPid =
- runDeclareQueuesClient ( brokers, host, declareQueuesPath, verbosity );
- if ( -1 == dqClientPid ) {
- cerr << "failoverSoak error: Couldn't fork declareQueues.\n";
- return CANT_FORK_DQ;
- }
-
- // Don't continue until declareQueues is finished.
- pid_t retval = waitpid ( dqClientPid, & childStatus, 0);
- if ( retval != dqClientPid) {
- cerr << "failoverSoak error: waitpid on declareQueues returned value " << retval << endl;
- return DQ_FAILED;
- }
- allMyChildren.exited ( dqClientPid, childStatus );
-
-
-
- // Start the receiving client.
- pid_t receivingClientPid =
- startReceivingClient ( brokers,
- host,
- receiverPath,
- reportFrequency,
- verbosity );
- if ( -1 == receivingClientPid ) {
- cerr << "failoverSoak error: Couldn't fork receiver.\n";
- return CANT_FORK_RECEIVER;
- }
-
-
- // Start the sending client.
- pid_t sendingClientPid =
- startSendingClient ( brokers,
- host,
- senderPath,
- nMessages,
- reportFrequency,
- verbosity );
- if ( -1 == sendingClientPid ) {
- cerr << "failoverSoak error: Couldn't fork sender.\n";
- return CANT_FORK_RECEIVER;
- }
-
-
- int minSleep = 3,
- maxSleep = 6;
-
-
- for ( int totalBrokers = 3;
- totalBrokers < maxBrokers;
- ++ totalBrokers
- )
- {
- if ( verbosity > 0 )
- cout << totalBrokers << " brokers have been added to the cluster.\n\n\n";
-
- // Sleep for a while. -------------------------
- int sleepyTime = mrand ( minSleep, maxSleep );
- if ( verbosity > 0 )
- cout << "Sleeping for " << sleepyTime << " seconds.\n";
- sleep ( sleepyTime );
-
- // Kill the oldest broker. --------------------------
- killFrontBroker ( brokers, verbosity );
-
- // Sleep for a while. -------------------------
- sleepyTime = mrand ( minSleep, maxSleep );
- if ( verbosity > 0 )
- cerr << "Sleeping for " << sleepyTime << " seconds.\n";
- sleep ( sleepyTime );
-
- // Start a new broker. --------------------------
- if ( verbosity > 0 )
- cout << "Starting new broker.\n\n";
-
- startNewBroker ( brokers,
- srcRoot,
- moduleDir,
- clusterName );
-
- if ( verbosity > 0 )
- printBrokers ( brokers );
-
- // If all children have exited, quit.
- int unfinished = allMyChildren.unfinished();
- if ( ! unfinished ) {
- killAllBrokers ( brokers );
-
- if ( verbosity > 0 )
- cout << "failoverSoak: all children have exited.\n";
- int retval = allMyChildren.checkChildren();
- if ( verbosity > 0 )
- std::cerr << "failoverSoak: checkChildren: " << retval << endl;
- return retval ? ERROR_ON_CHILD : HUNKY_DORY;
- }
-
- // Even if some are still running, if there's an error, quit.
- if ( allMyChildren.checkChildren() )
- {
- if ( verbosity > 0 )
- cout << "failoverSoak: error on child.\n";
- allMyChildren.killEverybody();
- killAllBrokers ( brokers );
- return ERROR_ON_CHILD;
- }
-
- // If one is hanging, quit.
- if ( allMyChildren.hanging ( 120 ) )
- {
- if ( verbosity > 0 )
- cout << "failoverSoak: child hanging.\n";
- allMyChildren.killEverybody();
- killAllBrokers ( brokers );
- return HANGING;
- }
-
- if ( verbosity > 0 ) {
- std::cerr << "------- next kill-broker loop --------\n";
- allMyChildren.print();
- }
- }
-
- retval = allMyChildren.checkChildren();
- if ( verbosity > 0 )
- std::cerr << "failoverSoak: checkChildren: " << retval << endl;
-
- if ( verbosity > 0 )
- cout << "failoverSoak: maxBrokers reached.\n";
-
- allMyChildren.killEverybody();
- killAllBrokers ( brokers );
-
- return retval ? ERROR_ON_CHILD : HUNKY_DORY;
-}
-
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/fanout_perftest b/M4-RCs/qpid/cpp/src/tests/fanout_perftest
deleted file mode 100755
index d8a7661f49..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/fanout_perftest
+++ /dev/null
@@ -1,22 +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.
-#
-
-exec `dirname $0`/run_perftest 10000 --mode fanout --npubs 16 --nsubs 16 --size 64
diff --git a/M4-RCs/qpid/cpp/src/tests/federated_topic_test b/M4-RCs/qpid/cpp/src/tests/federated_topic_test
deleted file mode 100755
index 21d8411eaf..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/federated_topic_test
+++ /dev/null
@@ -1,130 +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.
-#
-
-# Run the topic test on a federated setup
-
-# Clean up old log files
-rm -f subscriber_*.log
-
-# Defaults values
-SUBSCRIBERS=2
-MESSAGES=1000
-BATCHES=1
-VERBOSE=1
-
-while getopts "s:m:b:" opt ; do
- case $opt in
- s) SUBSCRIBERS=$OPTARG ;;
- m) MESSAGES=$OPTARG ;;
- b) BATCHES=$OPTARG ;;
- ?)
- echo "Usage: %0 [-s <subscribers>] [-m <messages.] [-b <batches>]"
- exit 1
- ;;
- esac
-done
-
-MY_DIR=$(dirname $(which $0))
-PYTHON_DIR=${MY_DIR}/../../../python
-
-trap stop_brokers EXIT
-
-start_broker() {
- ${MY_DIR}/../qpidd --daemon --port 0 --no-module-dir --no-data-dir --auth no > qpidd.port
-}
-
-start_brokers() {
- start_broker
- PORT_A=`cat qpidd.port`
- start_broker
- PORT_B=`cat qpidd.port`
- start_broker
- PORT_C=`cat qpidd.port`
-}
-
-stop_brokers() {
- for p in $PORT_A $PORT_B $PORT_C; do
- ${MY_DIR}/../qpidd -q --port $p
- done
-}
-
-subscribe() {
- #which broker should we connect to?
- if (( $1 % 2 )); then
- MY_PORT=$PORT_C;
- else
- MY_PORT=$PORT_A;
- fi
-
- echo Subscriber $1 connecting on $MY_PORT
- LOG="subscriber_$1.log"
- ${MY_DIR}/topic_listener -p $MY_PORT > $LOG 2>&1 && rm -f $LOG
-}
-
-publish() {
- ${MY_DIR}/topic_publisher --messages $MESSAGES --batches $BATCHES --subscribers $SUBSCRIBERS -p $PORT_A
-}
-
-setup_routes() {
- BROKER_A="localhost:$PORT_A"
- BROKER_B="localhost:$PORT_B"
- BROKER_C="localhost:$PORT_C"
- export PYTHONPATH=$PYTHON_DIR
- if (($VERBOSE)); then
- echo "Establishing routes for topic..."
- fi
- $PYTHON_DIR/commands/qpid-route route add $BROKER_B $BROKER_A amq.topic topic_control B B
- $PYTHON_DIR/commands/qpid-route route add $BROKER_C $BROKER_B amq.topic topic_control C C
- if (($VERBOSE)); then
- echo "linked A->B->C"
- fi
- $PYTHON_DIR/commands/qpid-route route add $BROKER_B $BROKER_C amq.topic topic_control B B
- $PYTHON_DIR/commands/qpid-route route add $BROKER_A $BROKER_B amq.topic topic_control A A
- if (($VERBOSE)); then
- echo "linked C->B->A"
- echo "Establishing routes for response queue..."
- fi
-
- $PYTHON_DIR/commands/qpid-route route add $BROKER_B $BROKER_C amq.direct response B B
- $PYTHON_DIR/commands/qpid-route route add $BROKER_A $BROKER_B amq.direct response A A
- if (($VERBOSE)); then
- echo "linked C->B->A"
- for b in $BROKER_A $BROKER_B $BROKER_C; do
- echo "Routes for $b"
- $PYTHON_DIR/commands/qpid-route route list $b
- done
- fi
-}
-
-if test -d ${PYTHON_DIR} ; then
- start_brokers
- if (($VERBOSE)); then
- echo "Running federated topic test against brokers on ports $PORT_A $PORT_B $PORT_C"
- fi
-
- for ((i=$SUBSCRIBERS ; i--; )); do
- subscribe $i &
- done
-
- setup_routes
-
- publish || exit 1
-fi
diff --git a/M4-RCs/qpid/cpp/src/tests/federation.py b/M4-RCs/qpid/cpp/src/tests/federation.py
deleted file mode 100755
index ad82964007..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/federation.py
+++ /dev/null
@@ -1,505 +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
-from qpid.testlib import TestBase010, testrunner
-from qpid.datatypes import Message
-from qpid.queue import Empty
-from time import sleep
-
-def add_module(args=sys.argv[1:]):
- for a in args:
- if a.startswith("federation"):
- return False
- return True
-
-def scan_args(name, default=None, args=sys.argv[1:]):
- if (name in args):
- pos = args.index(name)
- return args[pos + 1]
- elif default:
- return default
- else:
- print "Please specify extra argument: %s" % name
- sys.exit(2)
-
-def extract_args(name, args):
- if (name in args):
- pos = args.index(name)
- del args[pos:pos+2]
- else:
- return None
-
-def remote_host():
- return scan_args("--remote-host", "localhost")
-
-def remote_port():
- return int(scan_args("--remote-port"))
-
-class FederationTests(TestBase010):
-
- def test_bridge_create_and_close(self):
- self.startQmf();
- qmf = self.qmf
-
- broker = qmf.getObjects(_class="broker")[0]
- result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest", "tcp")
- self.assertEqual(result.status, 0)
-
- link = qmf.getObjects(_class="link")[0]
- result = link.bridge(False, "amq.direct", "amq.direct", "my-key", "", "", False, False, False)
- self.assertEqual(result.status, 0)
-
- bridge = qmf.getObjects(_class="bridge")[0]
- result = bridge.close()
- self.assertEqual(result.status, 0)
-
- result = link.close()
- self.assertEqual(result.status, 0)
-
- sleep(3)
- self.assertEqual(len(qmf.getObjects(_class="bridge")), 0)
- self.assertEqual(len(qmf.getObjects(_class="link")), 0)
-
- def test_pull_from_exchange(self):
- session = self.session
-
- self.startQmf()
- qmf = self.qmf
- broker = qmf.getObjects(_class="broker")[0]
- result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest", "tcp")
- self.assertEqual(result.status, 0)
-
- link = qmf.getObjects(_class="link")[0]
- result = link.bridge(False, "amq.direct", "amq.fanout", "my-key", "", "", False, False, False)
- self.assertEqual(result.status, 0)
-
- bridge = qmf.getObjects(_class="bridge")[0]
-
- #setup queue to receive messages from local broker
- session.queue_declare(queue="fed1", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="fed1", exchange="amq.fanout")
- self.subscribe(queue="fed1", destination="f1")
- queue = session.incoming("f1")
- sleep(6)
-
- #send messages to remote broker and confirm it is routed to local broker
- r_conn = self.connect(host=remote_host(), port=remote_port())
- r_session = r_conn.session("test_pull_from_exchange")
-
- for i in range(1, 11):
- dp = r_session.delivery_properties(routing_key="my-key")
- r_session.message_transfer(destination="amq.direct", message=Message(dp, "Message %d" % i))
-
- for i in range(1, 11):
- msg = queue.get(timeout=5)
- self.assertEqual("Message %d" % i, msg.body)
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message in queue: " + extra.body)
- except Empty: None
-
- result = bridge.close()
- self.assertEqual(result.status, 0)
- result = link.close()
- self.assertEqual(result.status, 0)
-
- sleep(3)
- self.assertEqual(len(qmf.getObjects(_class="bridge")), 0)
- self.assertEqual(len(qmf.getObjects(_class="link")), 0)
-
- def test_push_to_exchange(self):
- session = self.session
-
- self.startQmf()
- qmf = self.qmf
- broker = qmf.getObjects(_class="broker")[0]
- result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest", "tcp")
- self.assertEqual(result.status, 0)
-
- link = qmf.getObjects(_class="link")[0]
- result = link.bridge(False, "amq.direct", "amq.fanout", "my-key", "", "", False, True, False)
- self.assertEqual(result.status, 0)
-
- bridge = qmf.getObjects(_class="bridge")[0]
-
- #setup queue to receive messages from remote broker
- r_conn = self.connect(host=remote_host(), port=remote_port())
- r_session = r_conn.session("test_push_to_exchange")
- r_session.queue_declare(queue="fed1", exclusive=True, auto_delete=True)
- r_session.exchange_bind(queue="fed1", exchange="amq.fanout")
- self.subscribe(session=r_session, queue="fed1", destination="f1")
- queue = r_session.incoming("f1")
- sleep(6)
-
- #send messages to local broker and confirm it is routed to remote broker
- for i in range(1, 11):
- dp = session.delivery_properties(routing_key="my-key")
- session.message_transfer(destination="amq.direct", message=Message(dp, "Message %d" % i))
-
- for i in range(1, 11):
- msg = queue.get(timeout=5)
- self.assertEqual("Message %d" % i, msg.body)
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message in queue: " + extra.body)
- except Empty: None
-
- result = bridge.close()
- self.assertEqual(result.status, 0)
- result = link.close()
- self.assertEqual(result.status, 0)
-
- sleep(3)
- self.assertEqual(len(qmf.getObjects(_class="bridge")), 0)
- self.assertEqual(len(qmf.getObjects(_class="link")), 0)
-
- def test_pull_from_queue(self):
- session = self.session
-
- #setup queue on remote broker and add some messages
- r_conn = self.connect(host=remote_host(), port=remote_port())
- r_session = r_conn.session("test_pull_from_queue")
- r_session.queue_declare(queue="my-bridge-queue", auto_delete=True)
- for i in range(1, 6):
- dp = r_session.delivery_properties(routing_key="my-bridge-queue")
- r_session.message_transfer(message=Message(dp, "Message %d" % i))
-
- #setup queue to receive messages from local broker
- session.queue_declare(queue="fed1", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="fed1", exchange="amq.fanout")
- self.subscribe(queue="fed1", destination="f1")
- queue = session.incoming("f1")
-
- self.startQmf()
- qmf = self.qmf
- broker = qmf.getObjects(_class="broker")[0]
- result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest", "tcp")
- self.assertEqual(result.status, 0)
-
- link = qmf.getObjects(_class="link")[0]
- result = link.bridge(False, "my-bridge-queue", "amq.fanout", "my-key", "", "", True, False, False)
- self.assertEqual(result.status, 0)
-
- bridge = qmf.getObjects(_class="bridge")[0]
- sleep(3)
-
- #add some more messages (i.e. after bridge was created)
- for i in range(6, 11):
- dp = r_session.delivery_properties(routing_key="my-bridge-queue")
- r_session.message_transfer(message=Message(dp, "Message %d" % i))
-
- for i in range(1, 11):
- try:
- msg = queue.get(timeout=5)
- self.assertEqual("Message %d" % i, msg.body)
- except Empty:
- self.fail("Failed to find expected message containing 'Message %d'" % i)
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message in queue: " + extra.body)
- except Empty: None
-
- result = bridge.close()
- self.assertEqual(result.status, 0)
- result = link.close()
- self.assertEqual(result.status, 0)
-
- sleep(3)
- self.assertEqual(len(qmf.getObjects(_class="bridge")), 0)
- self.assertEqual(len(qmf.getObjects(_class="link")), 0)
-
- def test_tracing_automatic(self):
- remoteUrl = "%s:%d" % (remote_host(), remote_port())
- self.startQmf()
- l_broker = self.qmf_broker
- r_broker = self.qmf.addBroker(remoteUrl)
-
- l_brokerObj = self.qmf.getObjects(_class="broker", _broker=l_broker)[0]
- r_brokerObj = self.qmf.getObjects(_class="broker", _broker=r_broker)[0]
-
- l_res = l_brokerObj.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest", "tcp")
- r_res = r_brokerObj.connect(testrunner.host, testrunner.port, False, "PLAIN", "guest", "guest", "tcp")
-
- self.assertEqual(l_res.status, 0)
- self.assertEqual(r_res.status, 0)
-
- l_link = self.qmf.getObjects(_class="link", _broker=l_broker)[0]
- r_link = self.qmf.getObjects(_class="link", _broker=r_broker)[0]
-
- l_res = l_link.bridge(False, "amq.direct", "amq.direct", "key", "", "", False, False, False)
- r_res = r_link.bridge(False, "amq.direct", "amq.direct", "key", "", "", False, False, False)
-
- self.assertEqual(l_res.status, 0)
- self.assertEqual(r_res.status, 0)
-
- count = 0
- while l_link.state != "Operational" or r_link.state != "Operational":
- count += 1
- if count > 10:
- self.fail("Fed links didn't become operational after 10 seconds")
- sleep(1)
- l_link = self.qmf.getObjects(_class="link", _broker=l_broker)[0]
- r_link = self.qmf.getObjects(_class="link", _broker=r_broker)[0]
- sleep(3)
-
- #setup queue to receive messages from local broker
- session = self.session
- session.queue_declare(queue="fed1", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="fed1", exchange="amq.direct", binding_key="key")
- self.subscribe(queue="fed1", destination="f1")
- queue = session.incoming("f1")
-
- #setup queue on remote broker and add some messages
- r_conn = self.connect(host=remote_host(), port=remote_port())
- r_session = r_conn.session("test_trace")
- for i in range(1, 11):
- dp = r_session.delivery_properties(routing_key="key")
- r_session.message_transfer(destination="amq.direct", message=Message(dp, "Message %d" % i))
-
- for i in range(1, 11):
- try:
- msg = queue.get(timeout=5)
- self.assertEqual("Message %d" % i, msg.body)
- except Empty:
- self.fail("Failed to find expected message containing 'Message %d'" % i)
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message in queue: " + extra.body)
- except Empty: None
-
- def test_tracing(self):
- session = self.session
-
- self.startQmf()
- qmf = self.qmf
- broker = qmf.getObjects(_class="broker")[0]
- result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest", "tcp")
- self.assertEqual(result.status, 0)
-
- link = qmf.getObjects(_class="link")[0]
- result = link.bridge(False, "amq.direct", "amq.fanout", "my-key", "my-bridge-id",
- "exclude-me,also-exclude-me", False, False, False)
- self.assertEqual(result.status, 0)
- bridge = qmf.getObjects(_class="bridge")[0]
-
- #setup queue to receive messages from local broker
- session.queue_declare(queue="fed1", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="fed1", exchange="amq.fanout")
- self.subscribe(queue="fed1", destination="f1")
- queue = session.incoming("f1")
- sleep(6)
-
- #send messages to remote broker and confirm it is routed to local broker
- r_conn = self.connect(host=remote_host(), port=remote_port())
- r_session = r_conn.session("test_tracing")
-
- trace = [None, "exclude-me", "a,exclude-me,b", "also-exclude-me,c", "dont-exclude-me"]
- body = ["yes", "first-bad", "second-bad", "third-bad", "yes"]
- for b, t in zip(body, trace):
- headers = {}
- if (t): headers["x-qpid.trace"]=t
- dp = r_session.delivery_properties(routing_key="my-key")
- mp = r_session.message_properties(application_headers=headers)
- r_session.message_transfer(destination="amq.direct", message=Message(dp, mp, b))
-
- for e in ["my-bridge-id", "dont-exclude-me,my-bridge-id"]:
- msg = queue.get(timeout=5)
- self.assertEqual("yes", msg.body)
- self.assertEqual(e, self.getAppHeader(msg, "x-qpid.trace"))
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message in queue: " + extra.body)
- except Empty: None
-
- result = bridge.close()
- self.assertEqual(result.status, 0)
- result = link.close()
- self.assertEqual(result.status, 0)
-
- sleep(3)
- self.assertEqual(len(qmf.getObjects(_class="bridge")), 0)
- self.assertEqual(len(qmf.getObjects(_class="link")), 0)
-
- def test_dynamic_fanout(self):
- session = self.session
- r_conn = self.connect(host=remote_host(), port=remote_port())
- r_session = r_conn.session("test_dynamic_fanout")
-
- session.exchange_declare(exchange="fed.fanout", type="fanout")
- r_session.exchange_declare(exchange="fed.fanout", type="fanout")
-
- self.startQmf()
- qmf = self.qmf
- broker = qmf.getObjects(_class="broker")[0]
- result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest", "tcp")
- self.assertEqual(result.status, 0)
-
- link = qmf.getObjects(_class="link")[0]
- result = link.bridge(False, "fed.fanout", "fed.fanout", "", "", "", False, False, True)
- self.assertEqual(result.status, 0)
- bridge = qmf.getObjects(_class="bridge")[0]
- sleep(5)
-
- session.queue_declare(queue="fed1", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="fed1", exchange="fed.fanout")
- self.subscribe(queue="fed1", destination="f1")
- queue = session.incoming("f1")
-
- for i in range(1, 11):
- dp = r_session.delivery_properties()
- r_session.message_transfer(destination="fed.fanout", message=Message(dp, "Message %d" % i))
-
- for i in range(1, 11):
- msg = queue.get(timeout=5)
- self.assertEqual("Message %d" % i, msg.body)
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message in queue: " + extra.body)
- except Empty: None
-
- result = bridge.close()
- self.assertEqual(result.status, 0)
- result = link.close()
- self.assertEqual(result.status, 0)
-
- sleep(3)
- self.assertEqual(len(qmf.getObjects(_class="bridge")), 0)
- self.assertEqual(len(qmf.getObjects(_class="link")), 0)
-
-
- def test_dynamic_direct(self):
- session = self.session
- r_conn = self.connect(host=remote_host(), port=remote_port())
- r_session = r_conn.session("test_dynamic_direct")
-
- session.exchange_declare(exchange="fed.direct", type="direct")
- r_session.exchange_declare(exchange="fed.direct", type="direct")
-
- self.startQmf()
- qmf = self.qmf
- broker = qmf.getObjects(_class="broker")[0]
- result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest", "tcp")
- self.assertEqual(result.status, 0)
-
- link = qmf.getObjects(_class="link")[0]
- result = link.bridge(False, "fed.direct", "fed.direct", "", "", "", False, False, True)
- self.assertEqual(result.status, 0)
- bridge = qmf.getObjects(_class="bridge")[0]
- sleep(5)
-
- session.queue_declare(queue="fed1", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="fed1", exchange="fed.direct", binding_key="fd-key")
- self.subscribe(queue="fed1", destination="f1")
- queue = session.incoming("f1")
-
- for i in range(1, 11):
- dp = r_session.delivery_properties(routing_key="fd-key")
- r_session.message_transfer(destination="fed.direct", message=Message(dp, "Message %d" % i))
-
- for i in range(1, 11):
- msg = queue.get(timeout=5)
- self.assertEqual("Message %d" % i, msg.body)
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message in queue: " + extra.body)
- except Empty: None
-
- result = bridge.close()
- self.assertEqual(result.status, 0)
- result = link.close()
- self.assertEqual(result.status, 0)
-
- sleep(3)
- self.assertEqual(len(qmf.getObjects(_class="bridge")), 0)
- self.assertEqual(len(qmf.getObjects(_class="link")), 0)
-
-
- def test_dynamic_topic(self):
- session = self.session
- r_conn = self.connect(host=remote_host(), port=remote_port())
- r_session = r_conn.session("test_dynamic_topic")
-
- session.exchange_declare(exchange="fed.topic", type="topic")
- r_session.exchange_declare(exchange="fed.topic", type="topic")
-
- self.startQmf()
- qmf = self.qmf
- broker = qmf.getObjects(_class="broker")[0]
- result = broker.connect(remote_host(), remote_port(), False, "PLAIN", "guest", "guest", "tcp")
- self.assertEqual(result.status, 0)
-
- link = qmf.getObjects(_class="link")[0]
- result = link.bridge(False, "fed.topic", "fed.topic", "", "", "", False, False, True)
- self.assertEqual(result.status, 0)
- bridge = qmf.getObjects(_class="bridge")[0]
- sleep(5)
-
- session.queue_declare(queue="fed1", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="fed1", exchange="fed.topic", binding_key="ft-key.#")
- self.subscribe(queue="fed1", destination="f1")
- queue = session.incoming("f1")
-
- for i in range(1, 11):
- dp = r_session.delivery_properties(routing_key="ft-key.one.two")
- r_session.message_transfer(destination="fed.topic", message=Message(dp, "Message %d" % i))
-
- for i in range(1, 11):
- msg = queue.get(timeout=5)
- self.assertEqual("Message %d" % i, msg.body)
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message in queue: " + extra.body)
- except Empty: None
-
- result = bridge.close()
- self.assertEqual(result.status, 0)
- result = link.close()
- self.assertEqual(result.status, 0)
-
- sleep(3)
- self.assertEqual(len(qmf.getObjects(_class="bridge")), 0)
- self.assertEqual(len(qmf.getObjects(_class="link")), 0)
-
-
- def getProperty(self, msg, name):
- for h in msg.headers:
- if hasattr(h, name): return getattr(h, name)
- return None
-
- def getAppHeader(self, msg, name):
- headers = self.getProperty(msg, "application_headers")
- if headers:
- return headers[name]
- return None
-
-
-if __name__ == '__main__':
- args = sys.argv[1:]
- #need to remove the extra options from args as test runner doesn't recognise them
- extract_args("--remote-port", args)
- extract_args("--remote-host", args)
-
- if add_module():
- #add module(s) to run to testrunners args
- args.append("federation")
-
- if not testrunner.run(args): sys.exit(1)
diff --git a/M4-RCs/qpid/cpp/src/tests/header_test.cpp b/M4-RCs/qpid/cpp/src/tests/header_test.cpp
deleted file mode 100644
index ba9ffacc9b..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/header_test.cpp
+++ /dev/null
@@ -1,59 +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 <iostream>
-
-#include "TestOptions.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/Session.h"
-#include "qpid/client/SubscriptionManager.h"
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace std;
-
-int main(int argc, char** argv)
-{
- TestOptions opts;
- try {
- opts.parse(argc, argv);
- Connection connection;
- connection.open(opts.con);
- Session session = connection.newSession();
- std::string q("header_interop_test_queue");
- session.queueDeclare(arg::queue=q);
- double pi = 3.14159265;
- float e = 2.71828;
- Message msg("", q);
- msg.getMessageProperties().getApplicationHeaders().setDouble("pi", pi);
- msg.getMessageProperties().getApplicationHeaders().setFloat("e", e);
- session.messageTransfer(arg::content=msg);
-
- session.close();
- connection.close();
-
- return 0;
- } catch(const exception& e) {
- cout << e.what() << endl;
- }
- return 1;
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/header_test.py b/M4-RCs/qpid/cpp/src/tests/header_test.py
deleted file mode 100755
index d5a2c16c01..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/header_test.py
+++ /dev/null
@@ -1,86 +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 qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-from math import fabs
-
-def getApplicationHeaders(msg):
- for h in msg.headers:
- if hasattr(h, 'application_headers'): return getattr(h, 'application_headers')
- return None
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket)
-connection.start()
-session = connection.session(str(uuid4()))
-
-q = "header_interop_test_queue"
-session.queue_declare(queue=q)
-
-session.message_subscribe(queue=q, destination="received")
-queue = session.incoming("received")
-queue.start()
-
-msg = queue.get(timeout=10)
-pi = 3.14159265
-e = 2.71828
-
-headers = getApplicationHeaders(msg)
-pi_ = headers["pi"]
-e_ = headers["e"]
-session.close(timeout=10)
-
-failed = False
-
-if pi != pi_:
- print "got incorrect value for pi: ", pi_, " expected:", pi
- failed = True
-
-if fabs(e - e_) > 0.0001:
- print "got incorrect value for e: ", e_, " expected:", e
- failed = True
-
-if failed:
- sys.exit(1)
-else:
- print "Correct header values received."
- sys.exit(0)
-
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/interop_runner.cpp b/M4-RCs/qpid/cpp/src/tests/interop_runner.cpp
deleted file mode 100644
index 8c6e0a6991..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/interop_runner.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 "qpid/Options.h"
-#include "qpid/ptr_map.h"
-#include "qpid/Exception.h"
-#include "qpid/client/Channel.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/ConnectionOptions.h"
-#include "qpid/client/Exchange.h"
-#include "qpid/client/MessageListener.h"
-#include "qpid/client/Queue.h"
-#include "qpid/sys/Thread.h"
-#include "qpid/sys/Time.h"
-#include <iostream>
-#include <memory>
-#include "BasicP2PTest.h"
-#include "BasicPubSubTest.h"
-#include "TestCase.h"
-#include <boost/ptr_container/ptr_map.hpp>
-
-/**
- * Framework for interop tests.
- *
- * [see http://cwiki.apache.org/confluence/display/qpid/Interop+Testing+Specification for details].
- */
-
-using namespace qpid::client;
-using namespace qpid::sys;
-using qpid::TestCase;
-using qpid::framing::FieldTable;
-using qpid::framing::ReplyTo;
-using namespace std;
-
-class DummyRun : public TestCase
-{
-public:
- DummyRun() {}
- void assign(const string&, FieldTable&, ConnectionOptions&) {}
- void start() {}
- void stop() {}
- void report(qpid::client::Message&) {}
-};
-
-string parse_next_word(const string& input, const string& delims, string::size_type& position);
-
-/**
- */
-class Listener : public MessageListener, private Runnable{
- typedef boost::ptr_map<string, TestCase> TestMap;
-
- Channel& channel;
- ConnectionOptions& options;
- TestMap tests;
- const string name;
- const string topic;
- TestCase* test;
- auto_ptr<Thread> runner;
- ReplyTo reportTo;
- string reportCorrelator;
-
- void shutdown();
- bool invite(const string& name);
- void run();
-
- void sendResponse(Message& response, ReplyTo replyTo);
- void sendResponse(Message& response, Message& request);
- void sendSimpleResponse(const string& type, Message& request);
- void sendReport();
-public:
- Listener(Channel& channel, ConnectionOptions& options);
- void received(Message& msg);
- void bindAndConsume();
- void registerTest(string name, TestCase* test);
-};
-
-struct TestSettings : ConnectionOptions
-{
- bool help;
-
- TestSettings() : help(false)
- {
- addOptions()
- ("help", qpid::optValue(help), "print this usage statement");
- }
-};
-
-int main(int argc, char** argv) {
- try {
- TestSettings options;
- options.parse(argc, argv);
- if (options.help) {
- cout << options;
- } else {
- Connection connection;
- connection.open(options.host, options.port, "guest", "guest", options.virtualhost);
-
- Channel channel;
- connection.openChannel(channel);
-
- Listener listener(channel, options);
- listener.registerTest("TC1_DummyRun", new DummyRun());
- listener.registerTest("TC2_BasicP2P", new qpid::BasicP2PTest());
- listener.registerTest("TC3_BasicPubSub", new qpid::BasicPubSubTest());
-
- listener.bindAndConsume();
-
- channel.run();
- connection.close();
- }
- } catch(const exception& error) {
- cout << error.what() << endl << "Type " << argv[0] << " --help for help" << endl;
- }
-}
-
-Listener::Listener(Channel& _channel, ConnectionOptions& _options) : channel(_channel), options(_options), name(options.clientid), topic("iop.control." + name)
-{}
-
-void Listener::registerTest(string name, TestCase* test)
-{
- tests.insert(name, test);
-}
-
-void Listener::bindAndConsume()
-{
- Queue control(name, true);
- channel.declareQueue(control);
- qpid::framing::FieldTable bindArgs;
- //replace these separate binds with a wildcard once that is supported on java broker
- channel.bind(Exchange::STANDARD_TOPIC_EXCHANGE, control, "iop.control", bindArgs);
- channel.bind(Exchange::STANDARD_TOPIC_EXCHANGE, control, topic, bindArgs);
-
- string tag;
- channel.consume(control, tag, this);
-}
-
-void Listener::sendSimpleResponse(const string& type, Message& request)
-{
- Message response;
- response.getHeaders().setString("CONTROL_TYPE", type);
- response.getHeaders().setString("CLIENT_NAME", name);
- response.getHeaders().setString("CLIENT_PRIVATE_CONTROL_KEY", topic);
- response.getMessageProperties().setCorrelationId(request.getMessageProperties().getCorrelationId());
- sendResponse(response, request);
-}
-
-void Listener::sendResponse(Message& response, Message& request)
-{
- sendResponse(response, request.getMessageProperties().getReplyTo());
-}
-
-void Listener::sendResponse(Message& response, ReplyTo replyTo)
-{
- string exchange = replyTo.getExchange();
- string routingKey = replyTo.getRoutingKey();
- channel.publish(response, exchange, routingKey);
-}
-
-void Listener::received(Message& message)
-{
- string type(message.getHeaders().getString("CONTROL_TYPE"));
-
- if (type == "INVITE") {
- string name(message.getHeaders().getString("TEST_NAME"));
- if (name.empty() || invite(name)) {
- sendSimpleResponse("ENLIST", message);
- } else {
- cout << "Can't take part in '" << name << "'" << endl;
- }
- } else if (type == "ASSIGN_ROLE") {
- test->assign(message.getHeaders().getString("ROLE"), message.getHeaders(), options);
- sendSimpleResponse("ACCEPT_ROLE", message);
- } else if (type == "START") {
- reportTo = message.getMessageProperties().getReplyTo();
- reportCorrelator = message.getMessageProperties().getCorrelationId();
- runner = auto_ptr<Thread>(new Thread(this));
- } else if (type == "STATUS_REQUEST") {
- reportTo = message.getMessageProperties().getReplyTo();
- reportCorrelator = message.getMessageProperties().getCorrelationId();
- test->stop();
- sendReport();
- } else if (type == "TERMINATE") {
- if (test) test->stop();
- shutdown();
- } else {
- cerr <<"ERROR!: Received unknown control message: " << type << endl;
- shutdown();
- }
-}
-
-void Listener::shutdown()
-{
- channel.close();
-}
-
-bool Listener::invite(const string& name)
-{
- TestMap::iterator i = tests.find(name);
- test = (i != tests.end()) ? qpid::ptr_map_ptr(i) : 0;
- return test;
-}
-
-void Listener::run()
-{
- //NB: this method will be called in its own thread
- //start test and when start returns...
- test->start();
- sendReport();
-}
-
-void Listener::sendReport()
-{
- Message report;
- report.getHeaders().setString("CONTROL_TYPE", "REPORT");
- test->report(report);
- report.getMessageProperties().setCorrelationId(reportCorrelator);
- sendResponse(report, reportTo);
-}
-
-string parse_next_word(const string& input, const string& delims, string::size_type& position)
-{
- string::size_type start = input.find_first_not_of(delims, position);
- if (start == string::npos) {
- return "";
- } else {
- string::size_type end = input.find_first_of(delims, start);
- if (end == string::npos) {
- end = input.length();
- }
- position = end;
- return input.substr(start, end - start);
- }
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/latencytest.cpp b/M4-RCs/qpid/cpp/src/tests/latencytest.cpp
deleted file mode 100644
index 6895964133..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/latencytest.cpp
+++ /dev/null
@@ -1,432 +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 <algorithm>
-#include <limits>
-#include <iostream>
-#include <memory>
-#include <sstream>
-#include <vector>
-
-#include "TestOptions.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/sys/Time.h"
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::sys;
-using std::string;
-
-typedef std::vector<std::string> StringSet;
-
-struct Args : public qpid::TestOptions {
- uint size;
- uint count;
- uint rate;
- bool sync;
- uint reportFrequency;
- uint timeLimit;
- uint queues;
- uint prefetch;
- uint ack;
- bool cumulative;
- bool csv;
- bool durable;
- string base;
-
- Args() : size(256), count(1000), rate(0), reportFrequency(1000),
- timeLimit(0), queues(1),
- prefetch(100), ack(0),
- durable(false), base("latency-test")
- {
- addOptions()
-
- ("size", optValue(size, "N"), "message size")
- ("queues", optValue(queues, "N"), "number of queues")
- ("count", optValue(count, "N"), "number of messages to send")
- ("rate", optValue(rate, "N"), "target message rate (causes count to be ignored)")
- ("sync", optValue(sync), "send messages synchronously")
- ("report-frequency", optValue(reportFrequency, "N"),
- "number of milliseconds to wait between reports (ignored unless rate specified)")
- ("time-limit", optValue(timeLimit, "N"),
- "test duration, in seconds")
- ("prefetch", optValue(prefetch, "N"), "prefetch count (0 implies no flow control, and no acking)")
- ("ack", optValue(ack, "N"), "Ack frequency in messages (defaults to half the prefetch value)")
- ("durable", optValue(durable, "yes|no"), "use durable messages")
- ("csv", optValue(csv), "print stats in csv format (rate,min,max,avg)")
- ("cumulative", optValue(cumulative), "cumulative stats in csv format")
- ("queue-base-name", optValue(base, "<name>"), "base name for queues");
- }
-};
-
-const std::string chars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
-
-Args opts;
-double c_min, c_avg, c_max;
-
-uint64_t current_time()
-{
- Duration t(now());
- return t;
-}
-
-struct Stats
-{
- Mutex lock;
- uint count;
- double minLatency;
- double maxLatency;
- double totalLatency;
-
- Stats();
- void update(double l);
- void print();
- void reset();
-};
-
-class Client : public Runnable
-{
-protected:
- Connection connection;
- AsyncSession session;
- Thread thread;
- string queue;
-
-public:
- Client(const string& q);
- virtual ~Client() {}
-
- void start();
- void join();
- void run();
- virtual void test() = 0;
-};
-
-class Receiver : public Client, public MessageListener
-{
- SubscriptionManager mgr;
- uint count;
- Stats& stats;
-
-public:
- Receiver(const string& queue, Stats& stats);
- void test();
- void received(Message& msg);
- Stats getStats();
- uint getCount() { return count; }
- void stop() { mgr.stop(); mgr.cancel(queue); }
-};
-
-
-class Sender : public Client
-{
- string generateData(uint size);
- void sendByRate();
- void sendByCount();
- Receiver& receiver;
- const string data;
-public:
- Sender(const string& queue, Receiver& receiver);
- void test();
-};
-
-
-class Test
-{
- const string queue;
- Stats stats;
- Receiver receiver;
- Sender sender;
- AbsTime begin;
-
-public:
- Test(const string& q) : queue(q), receiver(queue, stats), sender(queue, receiver), begin(now()) {}
- void start();
- void join();
- void report();
-};
-
-
-Client::Client(const string& q) : queue(q)
-{
- opts.open(connection);
- session = connection.newSession();
-}
-
-void Client::start()
-{
- thread = Thread(this);
-}
-
-void Client::join()
-{
- thread.join();
-}
-
-void Client::run()
-{
- try{
- test();
- session.close();
- connection.close();
- } catch(const std::exception& e) {
- std::cout << "Error in receiver: " << e.what() << std::endl;
- }
-}
-
-Receiver::Receiver(const string& q, Stats& s) : Client(q), mgr(session), count(0), stats(s)
-{
- session.queueDeclare(arg::queue=queue, arg::durable=opts.durable, arg::autoDelete=true);
- uint msgCount = session.queueQuery(arg::queue=queue).get().getMessageCount();
- if (msgCount) {
- std::cout << "Warning: found " << msgCount << " msgs on " << queue << ". Purging..." << std::endl;
- session.queuePurge(arg::queue=queue);
- }
- SubscriptionSettings settings;
- if (opts.prefetch) {
- settings.autoAck = (opts.ack ? opts.ack : (opts.prefetch / 2));
- settings.flowControl = FlowControl::messageWindow(opts.prefetch);
- } else {
- settings.acceptMode = ACCEPT_MODE_NONE;
- settings.flowControl = FlowControl::unlimited();
- }
- mgr.subscribe(*this, queue, settings);
-}
-
-void Receiver::test()
-{
- mgr.run();
- mgr.cancel(queue);
-}
-
-void Receiver::received(Message& msg)
-{
- ++count;
- uint64_t sentAt = msg.getDeliveryProperties().getTimestamp();
- //uint64_t sentAt = msg.getHeaders().getTimestamp("sent-at");// TODO: add support for uint64_t as a field table type
- uint64_t receivedAt = current_time();
-
- //std::cerr << "Latency: " << (receivedAt - sentAt) << std::endl;
- stats.update(((double) (receivedAt - sentAt)) / TIME_MSEC);
-
- if (!opts.rate && count >= opts.count) {
- mgr.stop();
- }
-}
-
-void Stats::update(double latency)
-{
- Mutex::ScopedLock l(lock);
- count++;
- minLatency = std::min(minLatency, latency);
- maxLatency = std::max(maxLatency, latency);
- totalLatency += latency;
-}
-
-Stats::Stats() : count(0), minLatency(std::numeric_limits<double>::max()), maxLatency(0), totalLatency(0) {}
-
-void Stats::print()
-{
- static bool already_have_stats = false;
- uint value;
-
- if (opts.rate)
- value = opts.rate;
- else
- value = opts.count;
- Mutex::ScopedLock l(lock);
- double aux_avg = (totalLatency / count);
- if (!opts.cumulative) {
- if (!opts.csv) {
- std::cout << "Latency(ms): min=" << minLatency << ", max=" <<
- maxLatency << ", avg=" << aux_avg;
- } else {
- std::cout << value << "," << minLatency << "," << maxLatency <<
- "," << aux_avg;
- }
- } else {
- if (already_have_stats) {
- c_avg = (c_min + aux_avg) / 2;
- if (c_min > minLatency) c_min = minLatency;
- if (c_max < maxLatency) c_max = maxLatency;
- } else {
- c_avg = aux_avg;
- c_min = minLatency;
- c_max = maxLatency;
- already_have_stats = true;
- }
- std::cout << value << "," << c_min << "," << c_max <<
- "," << c_avg;
- }
-
-}
-
-void Stats::reset()
-{
- Mutex::ScopedLock l(lock);
- count = 0;
- totalLatency = maxLatency = 0;
- minLatency = std::numeric_limits<double>::max();
-}
-
-Sender::Sender(const string& q, Receiver& receiver) : Client(q), receiver(receiver), data(generateData(opts.size)) {}
-
-void Sender::test()
-{
- if (opts.rate) sendByRate();
- else sendByCount();
-}
-
-void Sender::sendByCount()
-{
- Message msg(data, queue);
- if (opts.durable) {
- msg.getDeliveryProperties().setDeliveryMode(framing::PERSISTENT);
- }
-
- for (uint i = 0; i < opts.count; i++) {
- uint64_t sentAt(current_time());
- msg.getDeliveryProperties().setTimestamp(sentAt);
- async(session).messageTransfer(arg::content=msg, arg::acceptMode=1);
- if (opts.sync) session.sync();
- }
- session.sync();
-}
-
-void Sender::sendByRate()
-{
- Message msg(data, queue);
- if (opts.durable) {
- msg.getDeliveryProperties().setDeliveryMode(framing::PERSISTENT);
- }
-
- //calculate interval (in micro secs) between messages to achieve desired rate
- uint64_t interval = (1000*1000)/opts.rate;
- uint64_t timeLimit(opts.timeLimit * TIME_SEC);
- uint64_t start(current_time());
-
- while (true) {
- uint64_t start_msg(current_time());
- msg.getDeliveryProperties().setTimestamp(start_msg);
- async(session).messageTransfer(arg::content=msg, arg::acceptMode=1);
- if (opts.sync) session.sync();
-
- uint64_t now = current_time();
-
- if (timeLimit != 0 && (now - start) > timeLimit) {
- session.sync();
- receiver.stop();
- break;
- }
-
- uint64_t timeTaken = (now - start_msg) / TIME_USEC;
- if (timeTaken < interval) {
- qpid::sys::usleep(interval - timeTaken);
- } else if (timeTaken > interval &&
- !opts.csv && !opts.cumulative) { // Don't be so verbose in this case, we're piping the results to another program
- std::cout << "Could not achieve desired rate! (Took " << timeTaken
- << " microsecs to send message, aiming for " << interval << " microsecs)" << std::endl;
- }
- }
-}
-
-string Sender::generateData(uint size)
-{
- if (size < chars.length()) {
- return chars.substr(0, size);
- }
- std::string data;
- for (uint i = 0; i < (size / chars.length()); i++) {
- data += chars;
- }
- data += chars.substr(0, size % chars.length());
- return data;
-}
-
-
-void Test::start()
-{
- receiver.start();
- begin = AbsTime(now());
- sender.start();
-}
-
-void Test::join()
-{
- sender.join();
- receiver.join();
- AbsTime end = now();
- Duration time(begin, end);
- double msecs(time / TIME_MSEC);
- if (!opts.csv) {
- std::cout << "Sent " << receiver.getCount() << " msgs through " << queue
- << " in " << msecs << "ms (" << (receiver.getCount() * 1000 / msecs) << " msgs/s) ";
- }
- stats.print();
- std::cout << std::endl;
-}
-
-void Test::report()
-{
- stats.print();
- std::cout << std::endl;
- stats.reset();
-}
-
-int main(int argc, char** argv)
-{
- try {
- opts.parse(argc, argv);
- if (opts.cumulative)
- opts.csv = true;
- boost::ptr_vector<Test> tests(opts.queues);
- for (uint i = 0; i < opts.queues; i++) {
- std::ostringstream out;
- out << opts.base << "-" << (i+1);
- tests.push_back(new Test(out.str()));
- }
- for (boost::ptr_vector<Test>::iterator i = tests.begin(); i != tests.end(); i++) {
- i->start();
- }
- if (opts.rate && !opts.timeLimit) {
- while (true) {
- qpid::sys::usleep(opts.reportFrequency * 1000);
- //print latency report:
- for (boost::ptr_vector<Test>::iterator i = tests.begin(); i != tests.end(); i++) {
- i->report();
- }
- }
- } else {
- for (boost::ptr_vector<Test>::iterator i = tests.begin(); i != tests.end(); i++) {
- i->join();
- }
- }
-
- return 0;
- } catch(const std::exception& e) {
- std::cout << e.what() << std::endl;
- }
- return 1;
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/logging.cpp b/M4-RCs/qpid/cpp/src/tests/logging.cpp
deleted file mode 100644
index 051722e7c8..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/logging.cpp
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-#include "test_tools.h"
-#include "qpid/log/Logger.h"
-#include "qpid/log/Options.h"
-#include "qpid/log/OstreamOutput.h"
-#include "qpid/memory.h"
-#include "qpid/Options.h"
-#if defined (_WIN32)
-#else
-# include "qpid/log/posix/SinkOptions.h"
-#endif
-
-#include <boost/test/floating_point_comparison.hpp>
-#include <boost/format.hpp>
-#include "unit_test.h"
-
-#include <exception>
-#include <fstream>
-#include <time.h>
-
-
-QPID_AUTO_TEST_SUITE(loggingTestSuite)
-
-using namespace std;
-using namespace boost;
-using namespace qpid::log;
-
-QPID_AUTO_TEST_CASE(testStatementInit) {
- Statement s=QPID_LOG_STATEMENT_INIT(debug); int line=__LINE__;
- BOOST_CHECK(!s.enabled);
- BOOST_CHECK_EQUAL(string(__FILE__), s.file);
- BOOST_CHECK_EQUAL(line, s.line);
- BOOST_CHECK_EQUAL(debug, s.level);
-}
-
-
-QPID_AUTO_TEST_CASE(testSelector_enable) {
- Selector s;
- // Simple enable
- s.enable(debug,"foo");
- BOOST_CHECK(s.isEnabled(debug,"foo"));
- BOOST_CHECK(!s.isEnabled(error,"foo"));
- BOOST_CHECK(!s.isEnabled(error,"bar"));
-
- // Substring match
- BOOST_CHECK(s.isEnabled(debug, "bazfoobar"));
- BOOST_CHECK(!s.isEnabled(debug, "bazbar"));
-
- // Different levels for different substrings.
- s.enable(info, "bar");
- BOOST_CHECK(s.isEnabled(debug, "foobar"));
- BOOST_CHECK(s.isEnabled(info, "foobar"));
- BOOST_CHECK(!s.isEnabled(debug, "bar"));
- BOOST_CHECK(!s.isEnabled(info, "foo"));
-
- // Enable-strings
- s.enable("notice:blob");
- BOOST_CHECK(s.isEnabled(notice, "blob"));
- s.enable("error+:oops");
- BOOST_CHECK(s.isEnabled(error, "oops"));
- BOOST_CHECK(s.isEnabled(critical, "oops"));
-}
-
-QPID_AUTO_TEST_CASE(testStatementEnabled) {
- // Verify that the singleton enables and disables static
- // log statements.
- Logger& l = Logger::instance();
- ScopedSuppressLogging ls(l);
- l.select(Selector(debug));
- static Statement s=QPID_LOG_STATEMENT_INIT(debug);
- BOOST_CHECK(!s.enabled);
- static Statement::Initializer init(s);
- BOOST_CHECK(s.enabled);
-
- static Statement s2=QPID_LOG_STATEMENT_INIT(warning);
- static Statement::Initializer init2(s2);
- BOOST_CHECK(!s2.enabled);
-
- l.select(Selector(warning));
- BOOST_CHECK(!s.enabled);
- BOOST_CHECK(s2.enabled);
-}
-
-struct TestOutput : public Logger::Output {
- vector<string> msg;
- vector<Statement> stmt;
-
- TestOutput(Logger& l) {
- l.output(std::auto_ptr<Logger::Output>(this));
- }
-
- void log(const Statement& s, const string& m) {
- msg.push_back(m);
- stmt.push_back(s);
- }
- string last() { return msg.back(); }
-};
-
-using boost::assign::list_of;
-
-QPID_AUTO_TEST_CASE(testLoggerOutput) {
- Logger l;
- l.clear();
- l.select(Selector(debug));
- Statement s=QPID_LOG_STATEMENT_INIT(debug);
-
- TestOutput* out=new TestOutput(l);
-
- // Verify message is output.
- l.log(s, "foo");
- vector<string> expect=list_of("foo\n");
- BOOST_CHECK_EQUAL(expect, out->msg);
-
- // Verify multiple outputs
- TestOutput* out2=new TestOutput(l);
- l.log(Statement(), "baz");
- expect.push_back("baz\n");
- BOOST_CHECK_EQUAL(expect, out->msg);
- expect.erase(expect.begin());
- BOOST_CHECK_EQUAL(expect, out2->msg);
-}
-
-QPID_AUTO_TEST_CASE(testMacro) {
- Logger& l=Logger::instance();
- ScopedSuppressLogging ls(l);
- l.select(Selector(info));
- TestOutput* out=new TestOutput(l);
- QPID_LOG(info, "foo");
- vector<string> expect=list_of("foo\n");
- BOOST_CHECK_EQUAL(expect, out->msg);
- BOOST_CHECK_EQUAL(__FILE__, out->stmt.front().file);
-
- // Not enabled:
- QPID_LOG(debug, "bar");
- BOOST_CHECK_EQUAL(expect, out->msg);
-
- QPID_LOG(info, 42 << " bingo");
- expect.push_back("42 bingo\n");
- BOOST_CHECK_EQUAL(expect, out->msg);
-}
-
-QPID_AUTO_TEST_CASE(testLoggerFormat) {
- Logger& l = Logger::instance();
- ScopedSuppressLogging ls(l);
- l.select(Selector(critical));
- TestOutput* out=new TestOutput(l);
-
- l.format(Logger::FILE);
- QPID_LOG(critical, "foo");
- BOOST_CHECK_EQUAL(out->last(), string(__FILE__)+": foo\n");
-
- l.format(Logger::FILE|Logger::LINE);
- QPID_LOG(critical, "foo");
- BOOST_CHECK_REGEX(string(__FILE__)+":\\d+: foo\n", out->last());
-
- l.format(Logger::FUNCTION);
- QPID_LOG(critical, "foo");
- BOOST_CHECK_REGEX("void .*testLoggerFormat.*\\(\\): foo\n", out->last());
-
- l.format(Logger::LEVEL);
- QPID_LOG(critical, "foo");
- BOOST_CHECK_EQUAL("critical foo\n", out->last());
-}
-
-QPID_AUTO_TEST_CASE(testOstreamOutput) {
- Logger& l=Logger::instance();
- ScopedSuppressLogging ls(l);
- l.select(Selector(error));
- ostringstream os;
- l.output(qpid::make_auto_ptr<Logger::Output>(new OstreamOutput(os)));
- QPID_LOG(error, "foo");
- QPID_LOG(error, "bar");
- QPID_LOG(error, "baz");
- BOOST_CHECK_EQUAL("foo\nbar\nbaz\n", os.str());
-}
-
-#if 0 // This test requires manual intervention. Normally disabled.
-QPID_AUTO_TEST_CASE(testSyslogOutput) {
- Logger& l=Logger::instance();
- Logger::StateSaver ls(l);
- l.clear();
- l.select(Selector(info));
- l.syslog("qpid_test");
- QPID_LOG(info, "Testing QPID");
- BOOST_ERROR("Manually verify that /var/log/messages contains a recent line 'Testing QPID'");
-}
-#endif // 0
-
-int count() {
- static int n = 0;
- return n++;
-}
-
-int loggedCount() {
- static int n = 0;
- QPID_LOG(debug, "counting: " << n);
- return n++;
-}
-
-
-using namespace qpid::sys;
-
-// Measure CPU time.
-clock_t timeLoop(int times, int (*fp)()) {
- clock_t start=clock();
- while (times-- > 0)
- (*fp)();
- return clock() - start;
-}
-
-// Overhead test disabled because it consumes a ton of CPU and takes
-// forever under valgrind. Not friendly for regular test runs.
-//
-#if 0
-QPID_AUTO_TEST_CASE(testOverhead) {
- // Ensure that the ratio of CPU time for an incrementing loop
- // with and without disabled log statements is in acceptable limits.
- //
- int times=100000000;
- clock_t noLog=timeLoop(times, count);
- clock_t withLog=timeLoop(times, loggedCount);
- double ratio=double(withLog)/double(noLog);
-
- // NB: in initial tests the ratio was consistently below 1.5,
- // 2.5 is reasonable and should avoid spurios failures
- // due to machine load.
- //
- BOOST_CHECK_SMALL(ratio, 2.5);
-}
-#endif // 0
-
-Statement statement(
- Level level, const char* file="", int line=0, const char* fn=0)
-{
- Statement s={0, file, line, fn, level};
- return s;
-}
-
-
-#define ARGC(argv) (sizeof(argv)/sizeof(char*))
-
-QPID_AUTO_TEST_CASE(testOptionsParse) {
- const char* argv[]={
- 0,
- "--log-enable", "error+:foo",
- "--log-enable", "debug:bar",
- "--log-enable", "info",
- "--log-to-stderr", "no",
- "--log-to-file", "logout",
- "--log-level", "yes",
- "--log-source", "1",
- "--log-thread", "true",
- "--log-function", "YES"
- };
- qpid::log::Options opts("");
- qpid::log::posix::SinkOptions sinks("test");
- opts.parse(ARGC(argv), const_cast<char**>(argv));
- sinks = *opts.sinkOptions;
- vector<string> expect=list_of("error+:foo")("debug:bar")("info");
- BOOST_CHECK_EQUAL(expect, opts.selectors);
- BOOST_CHECK(!sinks.logToStderr);
- BOOST_CHECK(!sinks.logToStdout);
- BOOST_CHECK(sinks.logFile == "logout");
- BOOST_CHECK(opts.level);
- BOOST_CHECK(opts.source);
- BOOST_CHECK(opts.function);
- BOOST_CHECK(opts.thread);
-}
-
-QPID_AUTO_TEST_CASE(testOptionsDefault) {
- Options opts("");
- qpid::log::posix::SinkOptions sinks("test");
- sinks = *opts.sinkOptions;
- BOOST_CHECK(sinks.logToStderr);
- BOOST_CHECK(!sinks.logToStdout);
- BOOST_CHECK(sinks.logFile.length() == 0);
- vector<string> expect=list_of("notice+");
- BOOST_CHECK_EQUAL(expect, opts.selectors);
- BOOST_CHECK(opts.time && opts.level);
- BOOST_CHECK(!(opts.source || opts.function || opts.thread));
-}
-
-QPID_AUTO_TEST_CASE(testSelectorFromOptions) {
- const char* argv[]={
- 0,
- "--log-enable", "error+:foo",
- "--log-enable", "debug:bar",
- "--log-enable", "info"
- };
- qpid::log::Options opts("");
- opts.parse(ARGC(argv), const_cast<char**>(argv));
- vector<string> expect=list_of("error+:foo")("debug:bar")("info");
- BOOST_CHECK_EQUAL(expect, opts.selectors);
- Selector s(opts);
- BOOST_CHECK(!s.isEnabled(warning, "x"));
- BOOST_CHECK(!s.isEnabled(debug, "x"));
- BOOST_CHECK(s.isEnabled(debug, "bar"));
- BOOST_CHECK(s.isEnabled(error, "foo"));
- BOOST_CHECK(s.isEnabled(critical, "foo"));
-}
-
-QPID_AUTO_TEST_CASE(testLoggerStateure) {
- Logger& l=Logger::instance();
- ScopedSuppressLogging ls(l);
- Options opts("test");
- const char* argv[]={
- 0,
- "--log-time", "no",
- "--log-source", "yes",
- "--log-to-stderr", "no",
- "--log-to-file", "logging.tmp",
- "--log-enable", "critical"
- };
- opts.parse(ARGC(argv), const_cast<char**>(argv));
- l.configure(opts);
- QPID_LOG(critical, "foo"); int srcline=__LINE__;
- ifstream log("logging.tmp");
- string line;
- getline(log, line);
- string expect=(format("critical %s:%d: foo")%__FILE__%srcline).str();
- BOOST_CHECK_EQUAL(expect, line);
- log.close();
- unlink("logging.tmp");
-}
-
-QPID_AUTO_TEST_CASE(testQuoteNonPrintable) {
- Logger& l=Logger::instance();
- ScopedSuppressLogging ls(l);
- Options opts("test");
- opts.time=false;
- qpid::log::posix::SinkOptions *sinks =
- dynamic_cast<qpid::log::posix::SinkOptions *>(opts.sinkOptions.get());
- sinks->logToStderr = false;
- sinks->logFile = "logging.tmp";
- l.configure(opts);
-
- char s[] = "null\0tab\tspace newline\nret\r\x80\x99\xff";
- string str(s, sizeof(s));
- QPID_LOG(critical, str);
- ifstream log("logging.tmp");
- string line;
- getline(log, line, '\0');
- string expect="critical null\\x00tab\tspace newline\nret\r\\x80\\x99\\xFF\\x00\n";
- BOOST_CHECK_EQUAL(expect, line);
- log.close();
- unlink("logging.tmp");
-}
-
-QPID_AUTO_TEST_SUITE_END()
diff --git a/M4-RCs/qpid/cpp/src/tests/multiq_perftest b/M4-RCs/qpid/cpp/src/tests/multiq_perftest
deleted file mode 100755
index 10f9edd2a6..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/multiq_perftest
+++ /dev/null
@@ -1,22 +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.
-#
-
-exec `dirname $0`/run_perftest 10000 --mode shared --qt 16
diff --git a/M4-RCs/qpid/cpp/src/tests/perfdist b/M4-RCs/qpid/cpp/src/tests/perfdist
deleted file mode 100755
index 59548b23f7..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/perfdist
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-
-#
-# 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.
-#
-
-
-#
-# Distributed perftest.
-# Runs perftest clients on multiple hosts using ssh.
-#
-
-set -e
-usage() {
-cat <<EOF
-usage: $0 <perftest-args> -- <client-hosts ...> [ --- <broker hosts...> ]
-Client & broker hosts can also be set in env vars CLIENTS and BROKERS.
-
-Run perftest clients on the client hosts against brokers on the broker
-hosts Clients are assigned to client hosts round robin: publishers
-first, then subscribers. If there are multiple brokers (for cluster
-tests) clients connect to them round robin.
-
-Broker hosts can be listed with -b in perftest-args or after ---
-at the end of the arguments.
-
-Error: $*
-EOF
-exit 1
-}
-
-TESTDIR=${TESTDIR:-$PWD} # Absolute path to test exes on all hosts.
-
-collect() { eval $COLLECT=\""\$$COLLECT $*"\"; }
-NPUBS=1
-NSUBS=1
-COLLECT=ARGS
-while test $# -gt 0; do
- case $1 in
- --publish|--subscribe|--setup|--control) usage "Don't pass perftest action flags: $1" ;;
- --npubs) collect $1 $2; NPUBS=$2; shift 2 ;;
- --nsubs) collect $1 $2; NSUBS=$2; shift 2 ;;
- -s|--summary) collect $1; QUIET=yes; shift 1 ;;
- -b|--broker) BROKERS="$BROKERS $2"; shift 2;;
- --) COLLECT=CLIENTARG; shift ;;
- ---) COLLECT=BROKERARG; shift;;
- *) collect $1; shift ;;
- esac
-done
-
-CLIENTS=${CLIENTARG:-$CLIENTS}
-if [ -z "$CLIENTS" ]; then usage "No client hosts listed after --"; fi
-BROKERS=${BROKERARG:-$BROKERS}
-if [ -z "$BROKERS" ]; then usage "No brokers specified"; fi
-
-PERFTEST="$TESTDIR/perftest $ARGS"
-
-CLIENTS=($CLIENTS)
-BROKERS=($BROKERS)
-start() {
- CLIENT=${CLIENTS[i % ${#CLIENTS[*]}]}
- BROKER=${BROKERS[i % ${#BROKERS[*]}]}
- ARGS="$* --broker $BROKER"
- cmd="ssh -n $CLIENT $PERFTEST $ARGS"
- test -z "$QUIET" && echo "Client $i: $cmd"
- $cmd &
-}
-
-$PERFTEST --setup -b ${BROKERS[0]}
-for (( i=0 ; i < $NPUBS ; ++i)); do start --publish; done
-for (( ; i < $NPUBS+$NSUBS ; ++i)); do start --subscribe; done
-$PERFTEST --control -b ${BROKERS[0]}
diff --git a/M4-RCs/qpid/cpp/src/tests/perftest.cpp b/M4-RCs/qpid/cpp/src/tests/perftest.cpp
deleted file mode 100644
index be9ffd846e..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/perftest.cpp
+++ /dev/null
@@ -1,701 +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 "TestOptions.h"
-
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/Completion.h"
-#include "qpid/client/Message.h"
-#include "qpid/framing/FieldTable.h"
-#include "qpid/sys/Time.h"
-
-#include <boost/lexical_cast.hpp>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
-
-#include <iostream>
-#include <sstream>
-#include <numeric>
-#include <algorithm>
-#include <unistd.h>
-#include <math.h>
-
-
-using namespace std;
-using namespace qpid;
-using namespace client;
-using namespace sys;
-using boost::lexical_cast;
-using boost::bind;
-
-enum Mode { SHARED, FANOUT, TOPIC };
-const char* modeNames[] = { "shared", "fanout", "topic" };
-
-// istream/ostream ops so Options can read/display Mode.
-istream& operator>>(istream& in, Mode& mode) {
- string s;
- in >> s;
- int i = find(modeNames, modeNames+3, s) - modeNames;
- if (i >= 3) throw Exception("Invalid mode: "+s);
- mode = Mode(i);
- return in;
-}
-
-ostream& operator<<(ostream& out, Mode mode) {
- return out << modeNames[mode];
-}
-
-
-struct Opts : public TestOptions {
-
- // Actions
- bool setup, control, publish, subscribe;
-
- // Queue policy
- uint32_t queueMaxCount;
- uint64_t queueMaxSize;
- bool queueDurable;
-
- // Publisher
- size_t pubs;
- size_t count ;
- size_t size;
- bool confirm;
- bool durable;
- bool uniqueData;
- bool syncPub;
-
- // Subscriber
- size_t subs;
- size_t ack;
-
- // General
- size_t qt;
- size_t iterations;
- Mode mode;
- bool summary;
- uint32_t intervalSub;
- uint32_t intervalPub;
- size_t tx;
- size_t txPub;
- size_t txSub;
- bool commitAsync;
-
- static const std::string helpText;
-
- Opts() :
- TestOptions(helpText),
- setup(false), control(false), publish(false), subscribe(false),
- pubs(1), count(500000), size(1024), confirm(true), durable(false), uniqueData(false), syncPub(false),
- subs(1), ack(0),
- qt(1), iterations(1), mode(SHARED), summary(false),
- intervalSub(0), intervalPub(0), tx(0), txPub(0), txSub(0), commitAsync(false)
- {
- addOptions()
- ("setup", optValue(setup), "Create shared queues.")
- ("control", optValue(control), "Run test, print report.")
- ("publish", optValue(publish), "Publish messages.")
- ("subscribe", optValue(subscribe), "Subscribe for messages.")
-
- ("mode", optValue(mode, "shared|fanout|topic"), "Test mode."
- "\nshared: --qt queues, --npubs publishers and --nsubs subscribers per queue.\n"
- "\nfanout: --npubs publishers, --nsubs subscribers, fanout exchange."
- "\ntopic: --qt topics, --npubs publishers and --nsubs subscribers per topic.\n")
-
- ("npubs", optValue(pubs, "N"), "Create N publishers.")
- ("count", optValue(count, "N"), "Each publisher sends N messages.")
- ("size", optValue(size, "BYTES"), "Size of messages in bytes.")
- ("pub-confirm", optValue(confirm, "yes|no"), "Publisher use confirm-mode.")
- ("durable", optValue(durable, "yes|no"), "Publish messages as durable.")
- ("unique-data", optValue(uniqueData, "yes|no"), "Make data for each message unique.")
- ("sync-publish", optValue(syncPub, "yes|no"), "Wait for confirmation of each message before sending the next one.")
-
- ("nsubs", optValue(subs, "N"), "Create N subscribers.")
- ("sub-ack", optValue(ack, "N"), "N>0: Subscriber acks batches of N.\n"
- "N==0: Subscriber uses unconfirmed mode")
-
- ("qt", optValue(qt, "N"), "Create N queues or topics.")
- ("iterations", optValue(iterations, "N"), "Desired number of iterations of the test.")
- ("summary,s", optValue(summary), "Summary output: pubs/sec subs/sec transfers/sec Mbytes/sec")
-
- ("queue-max-count", optValue(queueMaxCount, "N"), "queue policy: count to trigger 'flow to disk'")
- ("queue-max-size", optValue(queueMaxSize, "N"), "queue policy: accumulated size to trigger 'flow to disk'")
- ("queue-durable", optValue(queueDurable, "N"), "Make queue durable (implied if durable set)")
-
- ("interval_sub", optValue(intervalSub, "ms"), ">=0 delay between msg consume")
- ("interval_pub", optValue(intervalPub, "ms"), ">=0 delay between msg publish")
-
- ("tx", optValue(tx, "N"), "if non-zero, the transaction batch size for publishing and consuming")
- ("pub-tx", optValue(txPub, "N"), "if non-zero, the transaction batch size for publishing")
- ("async-commit", optValue(commitAsync, "yes|no"), "Don't wait for completion of commit")
- ("sub-tx", optValue(txSub, "N"), "if non-zero, the transaction batch size for consuming");
- }
-
- // Computed values
- size_t totalPubs;
- size_t totalSubs;
- size_t transfers;
- size_t subQuota;
-
- void parse(int argc, char** argv) {
- TestOptions::parse(argc, argv);
- switch (mode) {
- case SHARED:
- if (count % subs) {
- count += subs - (count % subs);
- cout << "WARNING: Adjusted --count to " << count
- << " the nearest multiple of --nsubs" << endl;
- }
- totalPubs = pubs*qt;
- totalSubs = subs*qt;
- subQuota = (pubs*count)/subs;
- break;
- case FANOUT:
- if (qt != 1) cerr << "WARNING: Fanout mode, ignoring --qt="
- << qt << endl;
- qt=1;
- totalPubs = pubs;
- totalSubs = subs;
- subQuota = totalPubs*count;
- break;
- case TOPIC:
- totalPubs = pubs*qt;
- totalSubs = subs*qt;
- subQuota = pubs*count;
- break;
- }
- transfers=(totalPubs*count) + (totalSubs*subQuota);
- if (tx) {
- if (txPub) {
- cerr << "WARNING: Using overriden tx value for publishers: " << txPub << std::endl;
- } else {
- txPub = tx;
- }
- if (txSub) {
- cerr << "WARNING: Using overriden tx value for subscribers: " << txSub << std::endl;
- } else {
- txSub = tx;
- }
- }
- }
-};
-
-const std::string Opts::helpText=
-"There are two ways to use perftest: single process or multi-process.\n\n"
-"If none of the --setup, --publish, --subscribe or --control options\n"
-"are given perftest will run a single-process test.\n"
-"For a multi-process test first run:\n"
-" perftest --setup <other options>\n"
-"and wait for it to complete. The remaining process should run concurrently::\n"
-"Run --npubs times: perftest --publish <other options>\n"
-"Run --nsubs times: perftest --subscribe <other options>\n"
-"Run once: perftest --control <other options>\n"
-"Note the <other options> must be identical for all processes.\n";
-
-Opts opts;
-
-struct Client : public Runnable {
- Connection connection;
- AsyncSession session;
- Thread thread;
-
- Client() {
- opts.open(connection);
- session = connection.newSession();
- }
-
- ~Client() {
- try {
- session.close();
- connection.close();
- } catch (const std::exception& e) {
- std::cerr << "Error in shutdown: " << e.what() << std::endl;
- }
- }
-};
-
-struct Setup : public Client {
-
- void queueInit(string name, bool durable=false, const framing::FieldTable& settings=framing::FieldTable()) {
- session.queueDeclare(arg::queue=name, arg::durable=durable, arg::arguments=settings);
- session.queuePurge(arg::queue=name);
- session.sync();
- }
-
- void run() {
- queueInit("pub_start");
- queueInit("pub_done");
- queueInit("sub_ready");
- queueInit("sub_done");
- if (opts.mode==SHARED) {
- framing::FieldTable settings;//queue policy settings
- settings.setInt("qpid.max_count", opts.queueMaxCount);
- settings.setInt("qpid.max_size", opts.queueMaxSize);
- for (size_t i = 0; i < opts.qt; ++i) {
- ostringstream qname;
- qname << "perftest" << i;
- queueInit(qname.str(), opts.durable || opts.queueDurable, settings);
- }
- }
- }
-};
-
-void expect(string actual, string expect) {
- if (expect != actual)
- throw Exception("Expecting "+expect+" but received "+actual);
-
-}
-
-double secs(Duration d) { return double(d)/TIME_SEC; }
-double secs(AbsTime start, AbsTime finish) {
- return secs(Duration(start,finish));
-}
-
-
-// Collect rates & print stats.
-class Stats {
- vector<double> values;
- double sum;
-
- public:
- Stats() : sum(0) {}
-
- // Functor to collect rates.
- void operator()(const string& data) {
- try {
- double d=lexical_cast<double>(data);
- values.push_back(d);
- sum += d;
- } catch (const std::exception&) {
- throw Exception("Bad report: "+data);
- }
- }
-
- double mean() const {
- return sum/values.size();
- }
-
- double stdev() const {
- if (values.size() <= 1) return 0;
- double avg = mean();
- double ssq = 0;
- for (vector<double>::const_iterator i = values.begin();
- i != values.end(); ++i) {
- double x=*i;
- x -= avg;
- ssq += x*x;
- }
- return sqrt(ssq/(values.size()-1));
- }
-
- ostream& print(ostream& out) {
- ostream_iterator<double> o(out, "\n");
- copy(values.begin(), values.end(), o);
- out << "Average: " << mean();
- if (values.size() > 1)
- out << " (std.dev. " << stdev() << ")";
- return out << endl;
- }
-};
-
-
-// Manage control queues, collect and print reports.
-struct Controller : public Client {
-
- SubscriptionManager subs;
-
- Controller() : subs(session) {}
-
- /** Process messages from queue by applying a functor. */
- void process(size_t n, string queue,
- boost::function<void (const string&)> msgFn)
- {
- if (!opts.summary)
- cout << "Processing " << n << " messages from "
- << queue << " " << flush;
- LocalQueue lq;
- subs.setFlowControl(n, SubscriptionManager::UNLIMITED, false);
- subs.subscribe(lq, queue);
- for (size_t i = 0; i < n; ++i) {
- if (!opts.summary) cout << "." << flush;
- msgFn(lq.pop().getData());
- }
- if (!opts.summary) cout << " done." << endl;
- }
-
- void process(size_t n, LocalQueue lq, string queue,
- boost::function<void (const string&)> msgFn)
- {
- session.messageFlow(queue, 0, n);
- if (!opts.summary)
- cout << "Processing " << n << " messages from "
- << queue << " " << flush;
- for (size_t i = 0; i < n; ++i) {
- if (!opts.summary) cout << "." << flush;
- msgFn(lq.pop().getData());
- }
- if (!opts.summary) cout << " done." << endl;
- }
-
- void send(size_t n, string queue, string data) {
- if (!opts.summary)
- cout << "Sending " << data << " " << n << " times to " << queue
- << endl;
- Message msg(data, queue);
- for (size_t i = 0; i < n; ++i)
- session.messageTransfer(arg::content=msg, arg::acceptMode=1);
- }
-
- void run() { // Controller
- try {
- // Wait for subscribers to be ready.
- process(opts.totalSubs, "sub_ready", bind(expect, _1, "ready"));
-
- LocalQueue pubDone;
- LocalQueue subDone;
- subs.setFlowControl(0, SubscriptionManager::UNLIMITED, false);
- subs.subscribe(pubDone, "pub_done");
- subs.subscribe(subDone, "sub_done");
-
- double txrateTotal(0);
- double mbytesTotal(0);
- double pubRateTotal(0);
- double subRateTotal(0);
-
- for (size_t j = 0; j < opts.iterations; ++j) {
- AbsTime start=now();
- send(opts.totalPubs, "pub_start", "start"); // Start publishers
-
- Stats pubRates;
- Stats subRates;
-
- process(opts.totalPubs, pubDone, "pub_done", boost::ref(pubRates));
- process(opts.totalSubs, subDone, "sub_done", boost::ref(subRates));
-
- AbsTime end=now();
-
- double time=secs(start, end);
- double txrate=opts.transfers/time;
- double mbytes=(txrate*opts.size)/(1024*1024);
-
- if (!opts.summary) {
- cout << endl << "Total " << opts.transfers << " transfers of "
- << opts.size << " bytes in "
- << time << " seconds." << endl;
- cout << endl << "Publish transfers/sec: " << endl;
- pubRates.print(cout);
- cout << endl << "Subscribe transfers/sec: " << endl;
- subRates.print(cout);
- cout << endl
- << "Total transfers/sec: " << txrate << endl
- << "Total Mbytes/sec: " << mbytes << endl;
- }
- else {
- cout << pubRates.mean() << "\t"
- << subRates.mean() << "\t"
- << txrate << "\t"
- << mbytes << endl;
- }
-
- txrateTotal += txrate;
- mbytesTotal += mbytes;
- pubRateTotal += pubRates.mean();
- subRateTotal += subRates.mean();
- }
- if (opts.iterations > 1) {
- cout << "Averages: "<< endl
- << (pubRateTotal / opts.iterations) << "\t"
- << (subRateTotal / opts.iterations) << "\t"
- << (txrateTotal / opts.iterations) << "\t"
- << (mbytesTotal / opts.iterations) << endl;
- }
- }
- catch (const std::exception& e) {
- cout << "Controller exception: " << e.what() << endl;
- }
- }
-};
-
-
-struct PublishThread : public Client {
- string destination;
- string routingKey;
-
- PublishThread() {};
-
- PublishThread(string key, string dest=string()) {
- destination=dest;
- routingKey=key;
- }
-
- void run() { // Publisher
- try {
- string data;
- size_t offset(0);
- if (opts.uniqueData) {
- offset = 5;
- data += "data:";//marker (requested for latency testing tool scripts)
- data += string(sizeof(size_t), 'X');//space for seq no
- data += session.getId().str();
- if (opts.size > data.size()) {
- data += string(opts.size - data.size(), 'X');
- } else if(opts.size < data.size()) {
- cout << "WARNING: Increased --size to " << data.size()
- << " to honour --unique-data" << endl;
- }
- } else {
- size_t msgSize=max(opts.size, sizeof(size_t));
- data = string(msgSize, 'X');
- }
-
- Message msg(data, routingKey);
- if (opts.durable)
- msg.getDeliveryProperties().setDeliveryMode(framing::PERSISTENT);
-
-
- if (opts.txPub){
- session.txSelect();
- }
- SubscriptionManager subs(session);
- LocalQueue lq;
- subs.setFlowControl(1, SubscriptionManager::UNLIMITED, true);
- subs.subscribe(lq, "pub_start");
-
- for (size_t j = 0; j < opts.iterations; ++j) {
- expect(lq.pop().getData(), "start");
- AbsTime start=now();
- for (size_t i=0; i<opts.count; i++) {
- // Stamp the iteration into the message data, avoid
- // any heap allocation.
- const_cast<std::string&>(msg.getData()).replace(offset, sizeof(size_t),
- reinterpret_cast<const char*>(&i), sizeof(size_t));
- if (opts.syncPub) {
- sync(session).messageTransfer(
- arg::destination=destination,
- arg::content=msg,
- arg::acceptMode=1);
- } else {
- session.messageTransfer(
- arg::destination=destination,
- arg::content=msg,
- arg::acceptMode=1);
- }
- if (opts.txPub && ((i+1) % opts.txPub == 0)){
- if (opts.commitAsync){
- session.txCommit();
- } else {
- sync(session).txCommit();
- }
- }
- if (opts.intervalPub) ::usleep(opts.intervalPub*1000);
- }
- if (opts.confirm) session.sync();
- AbsTime end=now();
- double time=secs(start,end);
-
- // Send result to controller.
- Message report(lexical_cast<string>(opts.count/time), "pub_done");
- session.messageTransfer(arg::content=report, arg::acceptMode=1);
- if (opts.txPub){
- sync(session).txCommit();
- }
- }
- session.close();
- }
- catch (const std::exception& e) {
- cout << "PublishThread exception: " << e.what() << endl;
- }
- }
-};
-
-struct SubscribeThread : public Client {
-
- string queue;
-
- SubscribeThread() {}
-
- SubscribeThread(string q) { queue = q; }
-
- SubscribeThread(string key, string ex) {
- queue=session.getId().str(); // Unique name.
- session.queueDeclare(arg::queue=queue,
- arg::exclusive=true,
- arg::autoDelete=true,
- arg::durable=opts.durable);
- session.exchangeBind(arg::queue=queue,
- arg::exchange=ex,
- arg::bindingKey=key);
- }
-
- void verify(bool cond, const char* test, uint32_t expect, uint32_t actual) {
- if (!cond) {
- Message error(
- QPID_MSG("Sequence error: expected n" << test << expect << " but got " << actual),
- "sub_done");
- session.messageTransfer(arg::content=error, arg::acceptMode=1);
- throw Exception(error.getData());
- }
- }
-
- void run() { // Subscribe
- try {
- if (opts.txSub) sync(session).txSelect();
- SubscriptionManager subs(session);
- SubscriptionSettings settings;
- settings.autoAck = opts.txSub ? opts.txSub : opts.ack;
- settings.acceptMode = (opts.txSub || opts.ack ? ACCEPT_MODE_EXPLICIT : ACCEPT_MODE_NONE);
- settings.flowControl = FlowControl::messageCredit(opts.subQuota);
- LocalQueue lq;
- Subscription subscription = subs.subscribe(lq, queue, settings);
- // Notify controller we are ready.
- session.messageTransfer(arg::content=Message("ready", "sub_ready"), arg::acceptMode=1);
- if (opts.txSub) {
- if (opts.commitAsync) session.txCommit();
- else sync(session).txCommit();
- }
-
- for (size_t j = 0; j < opts.iterations; ++j) {
- if (j > 0) {
- //need to allocate some more credit
- session.messageFlow(queue, 0, opts.subQuota);
- }
- Message msg;
- AbsTime start=now();
- size_t expect=0;
- for (size_t i = 0; i < opts.subQuota; ++i) {
- msg=lq.pop();
- if (opts.txSub && ((i+1) % opts.txSub == 0)) {
- if (opts.commitAsync) session.txCommit();
- else sync(session).txCommit();
- }
- if (opts.intervalSub) ::usleep(opts.intervalSub*1000);
- // TODO aconway 2007-11-23: check message order for.
- // multiple publishers. Need an array of counters,
- // one per publisher and a publisher ID in the
- // message. Careful not to introduce a lot of overhead
- // here, e.g. no std::map, std::string etc.
- //
- // For now verify order only for a single publisher.
- size_t offset = opts.uniqueData ? 5 /*marker is 'data:'*/ : 0;
- size_t n = *reinterpret_cast<const size_t*>(msg.getData().data() + offset);
- if (opts.pubs == 1) {
- if (opts.subs == 1 || opts.mode == FANOUT) verify(n==expect, "==", expect, n);
- else verify(n>=expect, ">=", expect, n);
- expect = n+1;
- }
- }
- if (opts.txSub || opts.ack)
- subscription.accept(subscription.getUnaccepted());
- if (opts.txSub) {
- if (opts.commitAsync) session.txCommit();
- else sync(session).txCommit();
- }
- AbsTime end=now();
-
- // Report to publisher.
- Message result(lexical_cast<string>(opts.subQuota/secs(start,end)),
- "sub_done");
- session.messageTransfer(arg::content=result, arg::acceptMode=1);
- if (opts.txSub) sync(session).txCommit();
- }
- session.close();
- }
- catch (const std::exception& e) {
- cout << "SubscribeThread exception: " << e.what() << endl;
- }
- }
-};
-
-int main(int argc, char** argv) {
-
- try {
- opts.parse(argc, argv);
-
- string exchange;
- switch (opts.mode) {
- case FANOUT: exchange="amq.fanout"; break;
- case TOPIC: exchange="amq.topic"; break;
- case SHARED: break;
- }
-
- bool singleProcess=
- (!opts.setup && !opts.control && !opts.publish && !opts.subscribe);
- if (singleProcess)
- opts.setup = opts.control = opts.publish = opts.subscribe = true;
-
- if (opts.setup) Setup().run(); // Set up queues
-
- boost::ptr_vector<Client> subs(opts.subs);
- boost::ptr_vector<Client> pubs(opts.pubs);
-
- // Start pubs/subs for each queue/topic.
- for (size_t i = 0; i < opts.qt; ++i) {
- ostringstream key;
- key << "perftest" << i; // Queue or topic name.
- if (opts.publish) {
- size_t n = singleProcess ? opts.pubs : 1;
- for (size_t j = 0; j < n; ++j) {
- pubs.push_back(new PublishThread(key.str(), exchange));
- pubs.back().thread=Thread(pubs.back());
- }
- }
- if (opts.subscribe) {
- size_t n = singleProcess ? opts.subs : 1;
- for (size_t j = 0; j < n; ++j) {
- if (opts.mode==SHARED)
- subs.push_back(new SubscribeThread(key.str()));
- else
- subs.push_back(new SubscribeThread(key.str(),exchange));
- subs.back().thread=Thread(subs.back());
- }
- }
- }
-
- if (opts.control) Controller().run();
-
-
- // Wait for started threads.
- if (opts.publish) {
- for (boost::ptr_vector<Client>::iterator i=pubs.begin();
- i != pubs.end();
- ++i)
- i->thread.join();
- }
-
-
- if (opts.subscribe) {
- for (boost::ptr_vector<Client>::iterator i=subs.begin();
- i != subs.end();
- ++i)
- i->thread.join();
- }
- return 0;
- }
- catch (const std::exception& e) {
- cout << endl << e.what() << endl;
- }
- return 1;
-}
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/policy.acl b/M4-RCs/qpid/cpp/src/tests/policy.acl
deleted file mode 100644
index ef46026555..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/policy.acl
+++ /dev/null
@@ -1 +0,0 @@
-acl allow all all
diff --git a/M4-RCs/qpid/cpp/src/tests/publish.cpp b/M4-RCs/qpid/cpp/src/tests/publish.cpp
deleted file mode 100644
index 34c2b8fefc..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/publish.cpp
+++ /dev/null
@@ -1,128 +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 <algorithm>
-#include <iostream>
-#include <memory>
-#include <sstream>
-#include <vector>
-
-#include "TestOptions.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/SubscriptionManager.h"
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::sys;
-using namespace std;
-
-typedef vector<string> StringSet;
-
-struct Args : public qpid::TestOptions {
- uint size;
- uint count;
- bool durable;
- string destination;
- string routingKey;
- bool summary;
- bool id;
-
- Args() : size(256), count(1000), durable(true), routingKey("publish-consume"), summary(false), id(false) {
- addOptions()
- ("size", optValue(size, "N"), "message size")
- ("count", optValue(count, "N"), "number of messages to publish")
- ("durable", optValue(durable, "yes|no"), "use durable messages")
- ("destination", optValue(destination, "<exchange name>"), "destination to publish to")
- ("routing-key", optValue(routingKey, "<key>"), "routing key to publish with")
- ("summary,s", optValue(summary), "Output only the rate.")
- ("id", optValue(id), "Add unique correlation ID");
- }
-};
-
-Args opts;
-
-struct Client
-{
- Connection connection;
- AsyncSession session;
-
- Client()
- {
- opts.open(connection);
- session = connection.newSession();
- }
-
- // Cheap hex calculation, avoid expensive ostrstream and string
- // creation to generate correlation ids in message loop.
- char hex(char i) { return i<10 ? '0'+i : 'A'+i-10; }
- void hex(char i, string& s) {
- s[0]=hex(i>>24); s[1]=hex(i>>16); s[2]=hex(i>>8); s[3]=i;
- }
-
- void publish()
- {
- AbsTime begin=now();
- Message msg(string(opts.size, 'X'), opts.routingKey);
- string correlationId = "0000";
- if (opts.durable)
- msg.getDeliveryProperties().setDeliveryMode(framing::PERSISTENT);
-
- for (uint i = 0; i < opts.count; i++) {
- if (opts.id) {
- hex(i+1, correlationId);
- msg.getMessageProperties().setCorrelationId(correlationId);
- }
- session.messageTransfer(arg::destination=opts.destination,
- arg::content=msg,
- arg::acceptMode=1);
- }
- session.sync();
- AbsTime end=now();
- double secs(double(Duration(begin,end))/TIME_SEC);
- if (opts.summary) cout << opts.count/secs << endl;
- else cout << "Time: " << secs << "s Rate: " << opts.count/secs << endl;
- }
-
- ~Client()
- {
- try{
- session.close();
- connection.close();
- } catch(const exception& e) {
- cout << e.what() << endl;
- }
- }
-};
-
-int main(int argc, char** argv)
-{
- try {
- opts.parse(argc, argv);
- Client client;
- client.publish();
- return 0;
- } catch(const exception& e) {
- cout << e.what() << endl;
- }
- return 1;
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/python_tests b/M4-RCs/qpid/cpp/src/tests/python_tests
deleted file mode 100755
index 30bb8259a4..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/python_tests
+++ /dev/null
@@ -1,39 +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.
-#
-
-# Run the python tests.
-QPID_PORT=${QPID_PORT:-5672}
-PYTHON_TESTS=${PYTHON_TESTS:-$*}
-MY_DIR=`dirname \`which $0\``
-QPID_PYTHON_DIR=${QPID_PYTHON_DIR:-${MY_DIR}/../../../python}
-
-run() {
- SPEC=$1
- FAILING=$2
- ./run-tests --skip-self-test -v -s $SPEC -I $FAILING -b localhost:$QPID_PORT $PYTHON_TESTS || { echo "FAIL python tests for $SPEC"; exit 1; }
-}
-
-if test -d ${QPID_PYTHON_DIR} ; then
- cd ${QPID_PYTHON_DIR}
- run 0-10-errata cpp_failing_0-10.txt
-else
- echo "WARNING: No python tests. $QPID_PYTHON_DIR not found."
-fi
diff --git a/M4-RCs/qpid/cpp/src/tests/quick_perftest b/M4-RCs/qpid/cpp/src/tests/quick_perftest
deleted file mode 100755
index 4f7cf3cb54..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/quick_perftest
+++ /dev/null
@@ -1,22 +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.
-#
-
-exec `dirname $0`/run_test ./perftest --summary --count 100
diff --git a/M4-RCs/qpid/cpp/src/tests/quick_topictest b/M4-RCs/qpid/cpp/src/tests/quick_topictest
deleted file mode 100755
index 5e7d85849f..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/quick_topictest
+++ /dev/null
@@ -1,30 +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.
-#
-
-
-# Quick and quiet topic test for make check.
-test -z "$srcdir" && srcdir=.
-$srcdir/topictest -s2 -m2 -b1 > topictest.log 2>&1 || {
- echo $0 FAILED:
- cat topictest.log
- exit 1
-}
-rm topictest.log
diff --git a/M4-RCs/qpid/cpp/src/tests/quick_txtest b/M4-RCs/qpid/cpp/src/tests/quick_txtest
deleted file mode 100755
index 938e3805d8..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/quick_txtest
+++ /dev/null
@@ -1,22 +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.
-#
-
-exec `dirname $0`/run_test ./txtest --queues 4 --tx-count 10 --quiet
diff --git a/M4-RCs/qpid/cpp/src/tests/receiver.cpp b/M4-RCs/qpid/cpp/src/tests/receiver.cpp
deleted file mode 100644
index 1b0b6b2548..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/receiver.cpp
+++ /dev/null
@@ -1,129 +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 <qpid/client/FailoverManager.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/SubscriptionManager.h>
-#include <qpid/client/SubscriptionManager.h>
-#include "TestOptions.h"
-
-#include <iostream>
-#include <fstream>
-
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using namespace std;
-
-struct Args : public qpid::TestOptions
-{
- string queue;
- uint messages;
- bool ignoreDuplicates;
- uint creditWindow;
- uint ackFrequency;
-
- Args() : queue("test-queue"), messages(0), ignoreDuplicates(false), creditWindow(0), ackFrequency(1)
- {
- addOptions()
- ("queue", qpid::optValue(queue, "QUEUE NAME"), "Queue from which to request messages")
- ("messages", qpid::optValue(messages, "N"), "Number of messages to receive; 0 means receive indefinitely")
- ("ignore-duplicates", qpid::optValue(ignoreDuplicates), "Detect and ignore duplicates (by checking 'sn' header)")
- ("credit-window", qpid::optValue(creditWindow, "N"), "Credit window (0 implies infinite window)")
- ("ack-frequency", qpid::optValue(ackFrequency, "N"), "Ack frequency (0 implies none of the messages will get accepted)");
- }
-};
-
-const string EOS("eos");
-
-class Receiver : public MessageListener, public FailoverManager::Command
-{
- public:
- Receiver(const string& queue, uint messages, bool ignoreDuplicates, uint creditWindow, uint ackFrequency);
- void received(Message& message);
- void execute(AsyncSession& session, bool isRetry);
- private:
- const string queue;
- const uint count;
- const bool skipDups;
- SubscriptionSettings settings;
- Subscription subscription;
- uint processed;
- uint lastSn;
-
- bool isDuplicate(Message& message);
-};
-
-Receiver::Receiver(const string& q, uint messages, bool ignoreDuplicates, uint creditWindow, uint ackFrequency) :
- queue(q), count(messages), skipDups(ignoreDuplicates), processed(0), lastSn(0)
-{
- if (creditWindow) settings.flowControl = FlowControl::messageWindow(creditWindow);
- settings.autoAck = ackFrequency;
-}
-
-void Receiver::received(Message & message)
-{
- if (!(skipDups && isDuplicate(message))) {
- bool eos = message.getData() == EOS;
- if (!eos) std::cout << message.getData() << std::endl;
- if (eos || ++processed == count) subscription.cancel();
- }
-}
-
-bool Receiver::isDuplicate(Message& message)
-{
- uint sn = message.getHeaders().getAsInt("sn");
- if (lastSn < sn) {
- lastSn = sn;
- return false;
- } else {
- return true;
- }
-}
-
-void Receiver::execute(AsyncSession& session, bool /*isRetry*/)
-{
- SubscriptionManager subs(session);
- subscription = subs.subscribe(*this, queue, settings);
- subs.run();
-}
-
-int main(int argc, char ** argv)
-{
- Args opts;
- try {
- opts.parse(argc, argv);
- FailoverManager connection(opts.con);
- Receiver receiver(opts.queue, opts.messages, opts.ignoreDuplicates, opts.creditWindow, opts.ackFrequency);
- connection.execute(receiver);
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cerr << "Failure: " << error.what() << std::endl;
- }
- return 1;
-}
-
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/replaying_sender.cpp b/M4-RCs/qpid/cpp/src/tests/replaying_sender.cpp
deleted file mode 100644
index 7e148e277f..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/replaying_sender.cpp
+++ /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.
- *
- */
-
-#include <qpid/client/FailoverManager.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/AsyncSession.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/MessageReplayTracker.h>
-#include <qpid/Exception.h>
-
-#include <iostream>
-#include <sstream>
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using namespace std;
-
-class Sender : public FailoverManager::Command
-{
- public:
- Sender(const std::string& queue, uint count, uint reportFreq);
- void execute(AsyncSession& session, bool isRetry);
- uint getSent();
-
- int verbosity;
-
- private:
- MessageReplayTracker sender;
- const uint count;
- uint sent;
- const uint reportFrequency;
- Message message;
-
-};
-
-Sender::Sender(const std::string& queue, uint count_, uint reportFreq ) : sender(10), count(count_), sent(0), reportFrequency(reportFreq)
-{
- message.getDeliveryProperties().setRoutingKey(queue);
-}
-
-void Sender::execute(AsyncSession& session, bool isRetry)
-{
- if (isRetry) sender.replay(session);
- else sender.init(session);
- while (sent < count) {
- stringstream message_data;
- message_data << ++sent;
- message.setData(message_data.str());
- message.getHeaders().setInt("sn", sent);
- sender.send(message);
- if (count > reportFrequency && !(sent % reportFrequency)) {
- if ( verbosity > 0 )
- std::cout << "sent " << sent << " of " << count << std::endl;
- }
- }
- message.setData("That's all, folks!");
- sender.send(message);
-
- if ( verbosity > 0 )
- std::cout << "SENDER COMPLETED\n";
-}
-
-uint Sender::getSent()
-{
- return sent;
-}
-
-int main(int argc, char ** argv)
-{
- ConnectionSettings settings;
-
- if ( argc != 6 )
- {
- std::cerr << "Usage: replaying_sender host port n_messages report_frequency verbosity\n";
- return 1;
- }
-
- settings.host = argv[1];
- settings.port = atoi(argv[2]);
- int n_messages = atoi(argv[3]);
- int reportFrequency = atoi(argv[4]);
- int verbosity = atoi(argv[5]);
-
- FailoverManager connection(settings);
- Sender sender("message_queue", n_messages, reportFrequency );
- sender.verbosity = verbosity;
- try {
- connection.execute ( sender );
- if ( verbosity > 0 )
- {
- std::cout << "Sender finished. Sent "
- << sender.getSent()
- << " messages."
- << endl;
- }
- connection.close();
- return 0;
- }
- catch(const std::exception& error)
- {
- cerr << "Sender (host: "
- << settings.host
- << " port: "
- << settings.port
- << " ) "
- << " Failed: "
- << error.what()
- << std::endl;
- }
- return 1;
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/restart_cluster b/M4-RCs/qpid/cpp/src/tests/restart_cluster
deleted file mode 100755
index 6a6abc8042..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/restart_cluster
+++ /dev/null
@@ -1,38 +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.
-#
-
-# Re-start a cluster on the local host.
-
-srcdir=`dirname $0`
-$srcdir/stop_cluster
-exec $srcdir/start_cluster "$@"
-#!/bin/sh
-# Re-start a cluster on the local host.
-
-srcdir=`dirname $0`
-$srcdir/stop_cluster
-exec $srcdir/start_cluster "$@"
-#!/bin/sh
-# Re-start a cluster on the local host.
-
-srcdir=`dirname $0`
-$srcdir/stop_cluster
-exec $srcdir/start_cluster "$@"
diff --git a/M4-RCs/qpid/cpp/src/tests/resuming_receiver.cpp b/M4-RCs/qpid/cpp/src/tests/resuming_receiver.cpp
deleted file mode 100644
index f49a115e1e..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/resuming_receiver.cpp
+++ /dev/null
@@ -1,163 +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 <qpid/client/FailoverManager.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/SubscriptionManager.h>
-
-#include <iostream>
-#include <fstream>
-
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using namespace std;
-
-
-class Listener : public MessageListener,
- public FailoverManager::Command,
- public FailoverManager::ReconnectionStrategy
-{
- public:
- Listener ( int report_frequency = 1000, int verbosity = 0 );
- void received(Message& message);
- void execute(AsyncSession& session, bool isRetry);
- void check();
- void editUrlList(std::vector<Url>& urls);
- private:
- Subscription subscription;
- uint count;
- uint received_twice;
- uint lastSn;
- bool gaps;
- uint reportFrequency;
- int verbosity;
-};
-
-
-Listener::Listener(int freq, int verbosity)
- : count(0),
- received_twice(0),
- lastSn(0),
- gaps(false),
- reportFrequency(freq),
- verbosity(verbosity)
-{}
-
-
-void Listener::received(Message & message)
-{
- if (message.getData() == "That's all, folks!")
- {
- if(verbosity > 0 )
- {
- std::cout << "Shutting down listener for "
- << message.getDestination() << std::endl;
-
- std::cout << "Listener received "
- << count
- << " messages ("
- << received_twice
- << " received_twice)"
- << endl;
- }
- subscription.cancel();
- if ( verbosity > 0 )
- std::cout << "LISTENER COMPLETED\n";
- } else {
- uint sn = message.getHeaders().getAsInt("sn");
- if (lastSn < sn) {
- if (sn - lastSn > 1) {
- std::cerr << "Error: gap in sequence between " << lastSn << " and " << sn << std::endl;
- gaps = true;
- }
- lastSn = sn;
- ++count;
- if ( ! ( count % reportFrequency ) ) {
- if ( verbosity > 0 )
- std::cout << "Listener has received "
- << count
- << " messages.\n";
- }
- } else {
- ++received_twice;
- }
- }
-}
-
-void Listener::check()
-{
- if (gaps) throw Exception("Detected gaps in sequence; messages appear to have been lost.");
-}
-
-void Listener::execute(AsyncSession& session, bool isRetry)
-{
- if (isRetry) {
- // std::cout << "Resuming from " << count << std::endl;
- }
- SubscriptionManager subs(session);
- subscription = subs.subscribe(*this, "message_queue");
- subs.run();
-}
-
-void Listener::editUrlList(std::vector<Url>& urls)
-{
- /**
- * A more realistic algorithm would be to search through the list
- * for prefered hosts and ensure they come first in the list.
- */
- if (urls.size() > 1) std::rotate(urls.begin(), urls.begin() + 1, urls.end());
-}
-
-int main(int argc, char ** argv)
-{
- ConnectionSettings settings;
-
- if ( argc != 5 )
- {
- std::cerr << "Usage: resuming_receiver host port report_frequency verbosity\n";
- return 1;
- }
-
- settings.host = argv[1];
- settings.port = atoi(argv[2]);
- int reportFrequency = atoi(argv[3]);
- int verbosity = atoi(argv[4]);
-
- Listener listener(reportFrequency, verbosity);
- FailoverManager connection(settings, &listener);
-
- try {
- connection.execute(listener);
- connection.close();
- listener.check();
- return 0;
- } catch(const std::exception& error) {
- std::cerr << "Receiver failed: " << error.what() << std::endl;
- }
- return 1;
-}
-
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/run-unit-tests b/M4-RCs/qpid/cpp/src/tests/run-unit-tests
deleted file mode 100755
index 862a76c4f5..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/run-unit-tests
+++ /dev/null
@@ -1,48 +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.
-#
-
-#
-# Library names (without path or .so) and CppUnit test paths can be
-# specified on the command line or in env var UNIT_TESTS. For example:
-#
-# Selected test classes:
-# ./run-unit-tests ValueTest ClientChannelTest
-#
-# Individual test method
-# ./run-unit-tests ValueTest :ValueTest::testStringValueEquals
-#
-# Build and run selected tests:
-# make check TESTS=run-unit-tests UNIT_TESTS=ClientChannelTest
-#
-
-for u in $* $UNIT_TESTS ; do
- case $u in
- :*) TEST_ARGS="$TEST_ARGS $u" ;; # A test path.
- *) TEST_ARGS="$TEST_ARGS .libs/$u.so" ;; # A test library.
- esac
-done
-test -z "$TEST_ARGS" && TEST_ARGS=".libs/*Test.so"
-
-test -z "$srcdir" && srcdir=.
-
-# libdlclose_noop prevents unloading symbols needed for valgrind output.
-export LD_PRELOAD=.libs/libdlclose_noop.so
-source $srcdir/run_test DllPlugInTester -c -b $TEST_ARGS
diff --git a/M4-RCs/qpid/cpp/src/tests/run_acl_tests b/M4-RCs/qpid/cpp/src/tests/run_acl_tests
deleted file mode 100755
index 8d583c1895..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/run_acl_tests
+++ /dev/null
@@ -1,64 +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.
-#
-
-# Run the acl tests. $srcdir is set by the Makefile.
-PYTHON_DIR=$srcdir/../../../python
-DATA_DIR=`pwd`/data_dir
-
-trap stop_brokers INT TERM QUIT
-
-start_brokers() {
- ../qpidd --daemon --port 0 --no-module-dir --data-dir $DATA_DIR --load-module ../.libs/acl.so --acl-file policy.acl --auth no > qpidd.port
- LOCAL_PORT=`cat qpidd.port`
-}
-
-stop_brokers() {
- ../qpidd -q --port $LOCAL_PORT
-}
-
-test_loading_acl_from_absolute_path(){
- POLICY_FILE=$PWD/$srcdir/policy.acl
- ../qpidd --daemon --port 0 --no-module-dir --no-data-dir --auth no --load-module ../.libs/acl.so --acl-file $POLICY_FILE -t --log-to-file temp.log 2>/dev/null
- PORT=`grep "Listening on TCP port" temp.log | awk '{print $8}'`
- ACL_FILE=`grep "notice Read ACL file" temp.log | awk '{print $7}'`
- ../qpidd -q --port $PORT
- if test "$ACL_FILE" != "\"$POLICY_FILE\""; then
- echo "unable to load policy file from an absolute path";
- return 1;
- fi
- rm temp.log
-}
-
-if test -d ${PYTHON_DIR} ; then
- rm -rf $DATA_DIR
- mkdir -p $DATA_DIR
- cp $srcdir/policy.acl $DATA_DIR
- start_brokers
- echo "Running acl tests using brokers on ports $LOCAL_PORT"
- PYTHONPATH=$PYTHON_DIR
- export PYTHONPATH
- $srcdir/acl.py -v -s $srcdir/../../../specs/amqp.0-10-qpid-errata.xml -b localhost:$LOCAL_PORT --port $LOCAL_PORT || EXITCODE=1
- stop_brokers || EXITCODE=1
- test_loading_acl_from_absolute_path || EXITCODE=1
- rm -rf $DATA_DIR
- exit $EXITCODE
-fi
-
diff --git a/M4-RCs/qpid/cpp/src/tests/run_failover_soak b/M4-RCs/qpid/cpp/src/tests/run_failover_soak
deleted file mode 100755
index 9dddf59cf1..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/run_failover_soak
+++ /dev/null
@@ -1,56 +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.
-#
-
-# Check AIS requirements and run tests if found.
-id -ng | grep '\<ais\>' >/dev/null || \
- NOGROUP="The ais group is not your primary group."
-ps -u root | grep aisexec >/dev/null || \
- NOAISEXEC="The aisexec daemon is not running as root"
-
-if test -n "$NOGROUP" -o -n "$NOAISEXEC"; then
- cat <<EOF
-
- =========== WARNING: NOT RUNNING AIS TESTS ==============
-
- Tests that depend on the openais library (used for clustering)
- will not be run because:
-
- $NOGROUP
- $NOAISEXEC
-
- ==========================================================
-
-EOF
- exit 0; # A warning, not a failure.
-fi
-
-
-host=127.0.0.1
-
-src_root=..
-module_dir=$src_root/.libs
-n_messages=300000
-report_frequency=10000
-verbosity=1
-
-
-exec `dirname $0`/failover_soak $src_root $module_dir $host ./declare_queues ./replaying_sender ./resuming_receiver $n_messages $report_frequency $verbosity
-
diff --git a/M4-RCs/qpid/cpp/src/tests/run_federation_tests b/M4-RCs/qpid/cpp/src/tests/run_federation_tests
deleted file mode 100755
index 28bcc012cc..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/run_federation_tests
+++ /dev/null
@@ -1,52 +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.
-#
-
-# Run the federation tests.
-MY_DIR=`dirname \`which $0\``
-PYTHON_DIR=${MY_DIR}/../../../python
-
-trap stop_brokers INT TERM QUIT
-
-start_brokers() {
- ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no > qpidd.port
- LOCAL_PORT=`cat qpidd.port`
- ../qpidd --daemon --port 0 --no-data-dir --no-module-dir --auth no > qpidd.port
- REMOTE_PORT=`cat qpidd.port`
-}
-
-stop_brokers() {
- ../qpidd -q --port $LOCAL_PORT
- ../qpidd -q --port $REMOTE_PORT
-}
-
-if test -d ${PYTHON_DIR} ; then
- start_brokers
- echo "Running federation tests using brokers on ports $LOCAL_PORT $REMOTE_PORT"
- PYTHONPATH=${PYTHON_DIR}
- export PYTHONPATH
- ${MY_DIR}/federation.py -v -s ${MY_DIR}/../../../specs/amqp.0-10-qpid-errata.xml -b localhost:$LOCAL_PORT --remote-port $REMOTE_PORT $@
- RETCODE=$?
- stop_brokers
- if test x$RETCODE != x0; then
- echo "FAIL federation tests"; exit 1;
- fi
-fi
-
diff --git a/M4-RCs/qpid/cpp/src/tests/run_header_test b/M4-RCs/qpid/cpp/src/tests/run_header_test
deleted file mode 100755
index 39d4a24f84..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/run_header_test
+++ /dev/null
@@ -1,37 +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.
-#
-
-# Simple test of encode/decode of a double in application headers
-# TODO: this should be expanded to cover a wider set of types and go
-# in both directions
-
-srcdir=`dirname $0`
-PYTHON_DIR=$srcdir/../../../python
-test -f qpidd.port && QPID_PORT=`cat qpidd.port`
-
-if test -d ${PYTHON_DIR} ; then
- ./header_test -p $QPID_PORT
- export PYTHONPATH=$PYTHON_DIR:$PYTHONPATH
- $srcdir/header_test.py "localhost" $QPID_PORT
-else
- echo "Skipping header test as python libs not found"
-fi
-
diff --git a/M4-RCs/qpid/cpp/src/tests/run_perftest b/M4-RCs/qpid/cpp/src/tests/run_perftest
deleted file mode 100755
index 1a9b934641..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/run_perftest
+++ /dev/null
@@ -1,28 +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.
-#
-
-# Args: count [perftest options...]
-# Run a perftest with count multiplied.
-#
-MULTIPLIER=3
-COUNT=`expr $1 \* $MULTIPLIER`
-shift
-exec `dirname $0`/run_test ./perftest --summary --count $COUNT "$@"
diff --git a/M4-RCs/qpid/cpp/src/tests/run_test b/M4-RCs/qpid/cpp/src/tests/run_test
deleted file mode 100755
index 062e9e137e..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/run_test
+++ /dev/null
@@ -1,78 +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.
-#
-
-#
-# Set up environment and run a test executable or script.
-#
-# Output nothing if test passes, show the output if it fails and
-# leave output in <test>.log for examination.
-#
-# If qpidd.port exists run test with QPID_PORT=`cat qpidd.port`
-#
-# If $VALGRIND if is set run under valgrind. If there are valgrind
-# erros show valgrind output, also leave it in <test>.valgrind for
-# examination.
-#
-
-srcdir=`dirname $0`
-. $srcdir/vg_check
-
-# Export variables from makefile.
-export VALGRIND srcdir
-
-# Set QPID_PORT if qpidd.port exists.
-test -f qpidd.port && QPID_PORT=`cat qpidd.port`
-export QPID_PORT
-
-# Avoid silly libtool error messages if these are not defined
-test -z "$LC_ALL" && LC_ALL=
-test -z "$LC_CTYPE" && LC_CTYPE=
-test -z "$LC_COLLATE" && LC_COLLATE=
-test -z "$LC_MESSAGES" && LC_MESSAGES=
-export LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-
-VG_LOG="`basename $1`.vglog"
-rm -f $VG_LOG*
-
-VALGRIND_OPTS="
---gen-suppressions=all
---leak-check=full
---demangle=yes
---suppressions=$srcdir/.valgrind.supp
---num-callers=25
---log-file=$VG_LOG --
-"
-# FIXME aconway 2008-07-16: removed --trace-children=yes, problems with cluster tests forking
-# qpidd libtool script. Investigate & restore --trace-children if possible.
-
-ERROR=0
-if grep -l "^# Generated by .*libtool" "$1" >/dev/null 2>&1; then
- # This is a libtool "executable". Valgrind it if VALGRIND specified.
- test -n "$VALGRIND" && VALGRIND="$VALGRIND $VALGRIND_OPTS"
- # Hide output unless there's an error.
- libtool --mode=execute $VALGRIND "$@" 2>&1 || ERROR=1
- test -n "$VALGRIND" && { vg_check $VG_LOG* || ERROR=1 ; }
-else
- # This is a non-libtool shell script, just execute it.
- exec "$@"
-fi
-
-exit $ERROR
-
diff --git a/M4-RCs/qpid/cpp/src/tests/sender.cpp b/M4-RCs/qpid/cpp/src/tests/sender.cpp
deleted file mode 100644
index a02b713d86..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/sender.cpp
+++ /dev/null
@@ -1,100 +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 <qpid/client/FailoverManager.h>
-#include <qpid/client/Session.h>
-#include <qpid/client/AsyncSession.h>
-#include <qpid/client/Message.h>
-#include <qpid/client/MessageReplayTracker.h>
-#include <qpid/Exception.h>
-#include "TestOptions.h"
-
-#include <iostream>
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::framing;
-
-using namespace std;
-
-struct Args : public qpid::TestOptions
-{
- string destination;
- string key;
- uint sendEos;
-
- Args() : key("test-queue"), sendEos(0)
- {
- addOptions()
- ("exchange", qpid::optValue(destination, "EXCHANGE"), "Exchange to send messages to")
- ("routing-key", qpid::optValue(key, "KEY"), "Routing key to add to messages")
- ("send-eos", qpid::optValue(sendEos, "N"), "Send N EOS messages to mark end of input");
- }
-};
-
-const string EOS("eos");
-
-class Sender : public FailoverManager::Command
-{
- public:
- Sender(const std::string& destination, const std::string& key, uint sendEos);
- void execute(AsyncSession& session, bool isRetry);
- private:
- MessageReplayTracker sender;
- Message message;
- const uint sendEos;
- uint sent;
-};
-
-Sender::Sender(const std::string& destination, const std::string& key, uint eos) :
- sender(10), message(destination, key), sendEos(eos), sent(0) {}
-
-void Sender::execute(AsyncSession& session, bool isRetry)
-{
- if (isRetry) sender.replay(session);
- else sender.init(session);
- string data;
- while (std::cin >> data) {
- message.setData(data);
- message.getHeaders().setInt("sn", ++sent);
- sender.send(message);
- }
- for (uint i = sendEos; i > 0; --i) {
- message.setData(EOS);
- sender.send(message);
- }
-}
-
-int main(int argc, char ** argv)
-{
- Args opts;
- try {
- opts.parse(argc, argv);
- FailoverManager connection(opts.con);
- Sender sender(opts.destination, opts.key, opts.sendEos);
- connection.execute(sender);
- connection.close();
- return 0;
- } catch(const std::exception& error) {
- std::cout << "Failed: " << error.what() << std::endl;
- }
- return 1;
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/shared_perftest b/M4-RCs/qpid/cpp/src/tests/shared_perftest
deleted file mode 100755
index cc192d25bd..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/shared_perftest
+++ /dev/null
@@ -1,22 +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.
-#
-
-exec `dirname $0`/run_perftest 100000 --mode shared --npubs 16 --nsubs 16
diff --git a/M4-RCs/qpid/cpp/src/tests/shlibtest.cpp b/M4-RCs/qpid/cpp/src/tests/shlibtest.cpp
deleted file mode 100644
index 80320ea7be..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/shlibtest.cpp
+++ /dev/null
@@ -1,28 +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.
- *
- */
-
-int* loaderData = 0;
-extern "C" void callMe(int *i) { loaderData=i; }
-
-struct OnUnload { ~OnUnload() { *loaderData=42; } };
-OnUnload unloader; // For destructor.
-
-
-
diff --git a/M4-RCs/qpid/cpp/src/tests/ssl.mk b/M4-RCs/qpid/cpp/src/tests/ssl.mk
deleted file mode 100644
index cb887c8fda..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/ssl.mk
+++ /dev/null
@@ -1,23 +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.
-#
-
-TESTS+=ssl_test
-EXTRA_DIST+=ssl_test
-clean-local:
- rm -rf test_cert_db cert.password \ No newline at end of file
diff --git a/M4-RCs/qpid/cpp/src/tests/ssl_test b/M4-RCs/qpid/cpp/src/tests/ssl_test
deleted file mode 100755
index 047db93d20..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/ssl_test
+++ /dev/null
@@ -1,71 +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.
-#
-
-# Run a simple test over SSL
-
-CONFIG=$(dirname $0)/config.null
-CERT_DIR=`pwd`/test_cert_db
-CERT_PW_FILE=`pwd`/cert.password
-HOSTNAME=`hostname`
-COUNT=10000
-
-trap stop_broker EXIT
-
-error() { echo $*; exit 1; }
-
-create_certs() {
- #create certificate and key databases with single, simple, self-signed certificate in it
- mkdir ${CERT_DIR}
- certutil -N -d ${CERT_DIR} -f ${CERT_PW_FILE}
- certutil -S -d ${CERT_DIR} -n ${HOSTNAME} -s "CN=${HOSTNAME}" -t "CT,," -x -f ${CERT_PW_FILE} -z /usr/bin/certutil
-}
-
-start_broker() {
- ../qpidd --daemon --transport ssl --port 0 --ssl-port 0 --no-data-dir --no-module-dir --auth no --config $CONFIG --load-module ../.libs/ssl.so --ssl-cert-db $CERT_DIR --ssl-cert-password-file $CERT_PW_FILE > qpidd.port
- PORT=`cat qpidd.port`
-}
-
-stop_broker() {
- if [[ $PORT ]] ; then
- ../qpidd -q --port $PORT
- fi
-}
-CERTUTIL=$(type -p certutil)
-if [[ !(-x $CERTUTIL) ]] ; then
- echo "No certutil, skipping ssl test";
- exit 0;
-fi
-
-if [[ !(-e ${CERT_PW_FILE}) ]] ; then
- echo password > ${CERT_PW_FILE}
-fi
-if [[ !(-e ${CERT_DIR}) ]] ; then
- create_certs || error "Could not create test certificate"
-fi
-
-start_broker || error "Could not start broker"
-echo "Running SSL test on port $PORT"
-export QPID_NO_MODULE_DIR=1
-export QPID_LOAD_MODULE=../.libs/sslconnector.so
-export QPID_SSL_CERT_DB=${CERT_DIR}
-export QPID_SSL_CERT_PASSWORD_FILE=${CERT_PW_FILE}
-./perftest --count ${COUNT} --port ${PORT} -P ssl -b $HOSTNAME --summary
-
diff --git a/M4-RCs/qpid/cpp/src/tests/start_broker b/M4-RCs/qpid/cpp/src/tests/start_broker
deleted file mode 100755
index 093c44051a..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/start_broker
+++ /dev/null
@@ -1,24 +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.
-#
-
-# Start a test broker.
-srcdir=`dirname $0`
-exec $srcdir/run_test ../qpidd --auth=no --no-module-dir --daemon --port=0 --log-to-file qpidd.log "$@" > qpidd.port
diff --git a/M4-RCs/qpid/cpp/src/tests/start_cluster b/M4-RCs/qpid/cpp/src/tests/start_cluster
deleted file mode 100755
index ee306edf14..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/start_cluster
+++ /dev/null
@@ -1,46 +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.
-#
-
-# Start a cluster of brokers on local host, put the list of ports for cluster members in cluster.ports
-#
-
-# Execute command with the ais group set.
-with_ais_group() {
- id -nG | grep '\<ais\>' >/dev/null || { echo "You are not a member of the ais group." 1>&2; exit 1; }
- echo $* | newgrp ais
-}
-
-test -f cluster.ports && { echo "cluster.ports file already exists" ; exit 1; }
-rm -f cluster*.log
-SIZE=$1; shift
-CLUSTER=`pwd` # Cluster name=pwd, avoid clashes.
-OPTS="-d --load-module ../.libs/cluster.so --cluster-name=$CLUSTER --no-data-dir --auth=no $*"
-
-if test "$SIZE" = "one"; then # Special case of singleton cluster, use default port.
- ../qpidd -q
- with_ais_group ../qpidd $OPTS --log-to-file=cluster.log || exit 1
-else
- for (( i=0; i<SIZE; ++i )); do
- PORT=`with_ais_group ../qpidd -p0 --log-to-file=cluster$i.log $OPTS` || exit 1
- echo $PORT >> cluster.ports
- done
-fi
-
diff --git a/M4-RCs/qpid/cpp/src/tests/start_cluster_hosts b/M4-RCs/qpid/cpp/src/tests/start_cluster_hosts
deleted file mode 100755
index 7680da01ad..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/start_cluster_hosts
+++ /dev/null
@@ -1,70 +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.
-#
-
-#
-# Start a cluster of brokers on local host, put the list of host port addresses
-# in cluster.ports
-#
-# Arguments: [-k] [-p port] HOST [HOST...]
-# -p port to start broker on, can be 0. Actual ports recorded in cluster.addr.
-# -k kill any qpidd processes owned by this user before starting.
-#
-# Start a broker on each named host. Name a host twice to start multiple brokers.
-#
-# You must be able to ssh to each host and be in group ais.
-# $QPIDD must be executable on each host.
-# Logs go to syslog on each host, with a unique prefix per broker.
-#
-
-QPIDD=${QPIDD:-$PWD/../qpidd}
-LIBQPIDCLUSTER=${LIBQPIDCLUSTER:-$PWD/../.libs/cluster.so}
-NAME=$USER # User name is default cluster name.
-RESTART=NO
-
-while getopts "kp:n:q:r" ARG ; do
- case $ARG in
- k) KILL=yes ;;
- p) PORT="$OPTARG" ;;
- n) NAME=$OPTARG ;;
- q) QPIDD=$OPTARG ;;
- l) LIBQPIDCLUSTER=$OPTARG ;;
- r) RESTART=yes ;;
- *) echo "Error parsing options: $ARG"; exit 1 ;;
- esac
-done
-shift `expr $OPTIND - 1`
-test -n "$PORT" && PORTOPT="-p $PORT"
-test "$KILL" = yes && KILL="$QPIDD -q $PORTOPT ;"
-CLUSTER=${*:-$CLUSTER} # Use args or env
-test -z "$CLUSTER" && { echo Must specify at least one host; exit 1; }
-
-
-OPTS="-d $PORTOPT --load-module $LIBQPIDCLUSTER --cluster-name=$NAME --no-data-dir --auth=no --log-to-syslog --log-enable=info+"
-
-num=0
-for h in $CLUSTER; do
- num=`expr $num + 1` # Give a unique log prefix to each node.
- cmd="$KILL $QPIDD $OPTS --log-prefix $num.$h"
- out=`echo "$cmd" | ssh $h newgrp ais` || { echo == $h error: $out ; exit 1; }
- if [ "$PORT" = 0 ] ; then p=$out; else p=$PORT; fi
- echo "$h $p"
-done
-
diff --git a/M4-RCs/qpid/cpp/src/tests/stop_broker b/M4-RCs/qpid/cpp/src/tests/stop_broker
deleted file mode 100755
index 2f45309a2b..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/stop_broker
+++ /dev/null
@@ -1,41 +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.
-#
-
-# Stop the broker, check for errors.
-#
-QPID_PORT=`cat qpidd.port`
-export QPID_PORT
-rm -f qpidd.port
-
-../qpidd --quit || ERROR=1
-
-# Check qpidd.log.
-egrep 'warning\|error\|critical' qpidd.log && {
- echo "WARNING: Suspicious broker log entries in qpidd.log, above."
-}
-
-# Check valgrind log.
-if test -n "$VALGRIND"; then
- . `dirname $0`/vg_check $VG_LOG*
- vg_check qpidd.vglog* || ERROR=1
-fi
-
-exit $ERROR
diff --git a/M4-RCs/qpid/cpp/src/tests/stop_cluster b/M4-RCs/qpid/cpp/src/tests/stop_cluster
deleted file mode 100755
index b3f0e7395e..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/stop_cluster
+++ /dev/null
@@ -1,33 +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.
-#
-
-# Stop brokers on ports listed in cluster.ports
-
-PORTS=`cat cluster.ports`
-for PORT in $PORTS ; do
- ../qpidd -qp $PORT || ERROR="$ERROR $PORT"
-done
-rm -f cluster.ports
-
-if [ -n "$ERROR" ]; then
- echo "Errors stopping brokers on ports: $ERROR"
- exit 1
-fi
diff --git a/M4-RCs/qpid/cpp/src/tests/test_tools.h b/M4-RCs/qpid/cpp/src/tests/test_tools.h
deleted file mode 100644
index 37a6594f8a..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/test_tools.h
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef TEST_TOOLS_H
-#define TEST_TOOLS_H
-
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-#include "qpid/log/Logger.h"
-
-#include <limits.h> // Include before boost/test headers.
-#include <boost/test/test_tools.hpp>
-#include <boost/assign/list_of.hpp>
-#include <boost/regex.hpp>
-#include <boost/assign/list_of.hpp>
-#include <vector>
-#include <ostream>
-
-// Print a sequence
-template <class T> std::ostream& seqPrint(std::ostream& o, const T& seq) {
- std::copy(seq.begin(), seq.end(), std::ostream_iterator<typename T::value_type>(o, " "));
- return o;
-}
-
-// Compare sequences
-template <class T, class U>
-bool seqEqual(const T& a, const U& b) {
- typename T::const_iterator i = a.begin();
- typename U::const_iterator j = b.begin();
- while (i != a.end() && j != b.end() && *i == *j) { ++i; ++j; }
- return (i == a.end()) && (j == b.end());
-}
-
-// ostream and == operators so we can compare vectors and boost::assign::list_of
-// with BOOST_CHECK_EQUALS
-namespace std { // In namespace std so boost can find them.
-
-template <class T>
-ostream& operator<<(ostream& o, const vector<T>& v) { return seqPrint(o, v); }
-
-template <class T>
-ostream& operator<<(ostream& o, const boost::assign_detail::generic_list<T>& l) { return seqPrint(o, l); }
-
-template <class T>
-bool operator == (const vector<T>& a, const boost::assign_detail::generic_list<T>& b) { return seqEqual(a, b); }
-
-template <class T>
-bool operator == (const boost::assign_detail::generic_list<T>& b, const vector<T>& a) { return seqEqual(a, b); }
-}
-
-/** NB: order of parameters is regex first, in line with
- * CHECK(expected, actual) convention.
- */
-inline bool regexPredicate(const std::string& re, const std::string& text) {
- return boost::regex_match(text, boost::regex(re));
-}
-
-/** Check for regular expression match. You must #include <boost/regex.hpp> */
-#if (BOOST_VERSION < 103300)
- #define BOOST_CHECK_REGEX(re, text)
-#else
- #define BOOST_CHECK_REGEX(re, text) \
- BOOST_CHECK_PREDICATE(regexPredicate, (re)(text))
-#endif
-
-/** Check if types of two objects (as given by typeinfo::name()) match. */
-#define BOOST_CHECK_TYPEID_EQUAL(a,b) BOOST_CHECK_EQUAL(typeid(a).name(),typeid(b).name())
-
-/**
- * Supress all logging in a scope, restore to previous configuration in destructor.
- */
-struct ScopedSuppressLogging {
- typedef qpid::log::Logger Logger;
- ScopedSuppressLogging(Logger& l=Logger::instance()) : logger(l), opts(l.getOptions()) { l.clear(); }
- ~ScopedSuppressLogging() { logger.configure(opts); }
- Logger& logger;
- qpid::log::Options opts;
-};
-
-
-#endif /*!TEST_TOOLS_H*/
-
diff --git a/M4-RCs/qpid/cpp/src/tests/topic_listener.cpp b/M4-RCs/qpid/cpp/src/tests/topic_listener.cpp
deleted file mode 100644
index 7bdc2c32de..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/topic_listener.cpp
+++ /dev/null
@@ -1,202 +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 file provides one half of a test and example of a pub-sub
- * style of interaction. See topic_publisher.cpp for the other half,
- * in which the logic for publishing is defined.
- *
- * This file contains the listener logic. A listener will subscribe to
- * a logical 'topic'. It will count the number of messages it receives
- * and the time elapsed between the first one and the last one. It
- * recognises two types of 'special' message that tell it to (a) send
- * a report containing this information, (b) shutdown (i.e. stop
- * listening).
- */
-
-#include "TestOptions.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/MessageListener.h"
-#include "qpid/client/Session.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/sys/Time.h"
-#include "qpid/framing/FieldValue.h"
-#include <iostream>
-#include <sstream>
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::sys;
-using namespace qpid::framing;
-using namespace std;
-
-/**
- * A message listener implementation in which the runtime logic is
- * defined.
- */
-class Listener : public MessageListener{
- Session session;
- SubscriptionManager& mgr;
- const string responseQueue;
- const bool transactional;
- bool init;
- int count;
- AbsTime start;
-
- void shutdown();
- void report();
-public:
- Listener(const Session& session, SubscriptionManager& mgr, const string& reponseQueue, bool tx);
- virtual void received(Message& msg);
- Subscription subscription;
-};
-
-/**
- * A utility class for managing the options passed in.
- */
-struct Args : public qpid::TestOptions {
- int ack;
- bool transactional;
- bool durable;
- int prefetch;
- string statusqueue;
-
- Args() : ack(0), transactional(false), durable(false), prefetch(0) {
- addOptions()
- ("ack", optValue(ack, "MODE"), "Ack frequency in messages (defaults to half the prefetch value)")
- ("transactional", optValue(transactional), "Use transactions")
- ("durable", optValue(durable), "subscribers should use durable queues")
- ("prefetch", optValue(prefetch, "N"), "prefetch count (0 implies no flow control, and no acking)")
- ("status-queue", optValue(statusqueue, "QUEUE-NAME"), "Message queue to put status messages on");
- }
-};
-
-
-/**
- * The main routine creates a Listener instance and sets it up to
- * consume from a private queue bound to the exchange with the
- * appropriate topic name.
- */
-int main(int argc, char** argv){
- try{
- Args args;
- args.parse(argc, argv);
- if(args.help)
- cout << args << endl;
- else {
- Connection connection;
- args.open(connection);
- AsyncSession session = connection.newSession();
-
- //declare exchange, queue and bind them:
- session.queueDeclare(arg::queue="response");
- std::string control = "control_" + session.getId().str();
- if (args.durable) {
- session.queueDeclare(arg::queue=control, arg::durable=true);
- } else {
- session.queueDeclare(arg::queue=control, arg::exclusive=true, arg::autoDelete=true);
- }
- session.exchangeBind(arg::exchange="amq.topic", arg::queue=control, arg::bindingKey="topic_control");
-
- //set up listener
- SubscriptionManager mgr(session);
- Listener listener(session, mgr, "response", args.transactional);
- SubscriptionSettings settings;
- if (args.prefetch) {
- settings.autoAck = (args.ack ? args.ack : (args.prefetch / 2));
- settings.flowControl = FlowControl::messageCredit(args.prefetch);
- } else {
- settings.acceptMode = ACCEPT_MODE_NONE;
- settings.flowControl = FlowControl::unlimited();
- }
- listener.subscription = mgr.subscribe(listener, control, settings);
- session.sync();
-
- if( args.statusqueue.length() > 0 ) {
- stringstream msg_str;
- msg_str << "topic_listener: " << (int)getpid();
- session.messageTransfer(arg::content=Message(msg_str.str(), args.statusqueue));
- cout << "Ready status put on queue '" << args.statusqueue << "'" << endl;
- }
-
- if (args.transactional) {
- session.txSelect();
- }
-
- cout << "topic_listener: listening..." << endl;
- mgr.run();
- if (args.durable) {
- session.queueDelete(arg::queue=control);
- }
- session.close();
- cout << "closing connection" << endl;
- connection.close();
- }
- return 0;
- } catch (const std::exception& error) {
- cout << "topic_listener: " << error.what() << endl;
- }
- return 1;
-}
-
-Listener::Listener(const Session& s, SubscriptionManager& m, const string& _responseq, bool tx) :
- session(s), mgr(m), responseQueue(_responseq), transactional(tx), init(false), count(0){}
-
-void Listener::received(Message& message){
- if(!init){
- start = now();
- count = 0;
- init = true;
- cout << "Batch started." << endl;
- }
- string type = message.getHeaders().getAsString("TYPE");
-
- if(string("TERMINATION_REQUEST") == type){
- shutdown();
- }else if(string("REPORT_REQUEST") == type){
- subscription.accept(subscription.getUnaccepted()); // Accept everything upto this point
- cout <<"Batch ended, sending report." << endl;
- //send a report:
- report();
- init = false;
- }else if (++count % 1000 == 0){
- cout <<"Received " << count << " messages." << endl;
- }
-}
-
-void Listener::shutdown(){
- mgr.stop();
-}
-
-void Listener::report(){
- AbsTime finish = now();
- Duration time(start, finish);
- stringstream reportstr;
- reportstr << "Received " << count << " messages in "
- << time/TIME_MSEC << " ms.";
- Message msg(reportstr.str(), responseQueue);
- msg.getHeaders().setString("TYPE", "REPORT");
- session.messageTransfer(arg::destination="amq.direct", arg::content=msg, arg::acceptMode=1);
- if(transactional){
- sync(session).txCommit();
- }
-}
-
diff --git a/M4-RCs/qpid/cpp/src/tests/topic_perftest b/M4-RCs/qpid/cpp/src/tests/topic_perftest
deleted file mode 100755
index cd440b2458..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/topic_perftest
+++ /dev/null
@@ -1,22 +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.
-#
-
-exec `dirname $0`/run_perftest 10000 --mode topic --qt 16
diff --git a/M4-RCs/qpid/cpp/src/tests/topic_publisher.cpp b/M4-RCs/qpid/cpp/src/tests/topic_publisher.cpp
deleted file mode 100644
index f37ad2dc0e..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/topic_publisher.cpp
+++ /dev/null
@@ -1,224 +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 file provides one half of a test and example of a pub-sub
- * style of interaction. See topic_listener.cpp for the other half, in
- * which the logic for subscribers is defined.
- *
- * This file contains the publisher logic. The publisher will send a
- * number of messages to the exchange with the appropriate routing key
- * for the logical 'topic'. Once it has done this it will then send a
- * request that each subscriber report back with the number of message
- * it has received and the time that elapsed between receiving the
- * first one and receiving the report request. Once the expected
- * number of reports are received, it sends out a request that each
- * subscriber shutdown.
- */
-
-#include "TestOptions.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/MessageListener.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/sys/Monitor.h"
-#include <unistd.h>
-#include "qpid/sys/Time.h"
-#include <cstdlib>
-#include <iostream>
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::sys;
-using namespace std;
-
-/**
- * The publishing logic is defined in this class. It implements
- * message listener and can therfore be used to receive messages sent
- * back by the subscribers.
- */
-class Publisher {
- AsyncSession session;
- SubscriptionManager mgr;
- LocalQueue queue;
- const string controlTopic;
- const bool transactional;
- const bool durable;
-
- string generateData(int size);
-
-public:
- Publisher(const AsyncSession& session, const string& controlTopic, bool tx, bool durable);
- int64_t publish(int msgs, int listeners, int size);
- void terminate();
-};
-
-/**
- * A utility class for managing the options passed in to the test
- */
-struct Args : public TestOptions {
- int messages;
- int subscribers;
- bool transactional;
- bool durable;
- int batches;
- int delay;
- int size;
- string statusqueue;
-
- Args() : messages(1000), subscribers(1),
- transactional(false), durable(false),
- batches(1), delay(0), size(256)
- {
- addOptions()
- ("messages", optValue(messages, "N"), "how many messages to send")
- ("subscribers", optValue(subscribers, "N"), "how many subscribers to expect reports from")
- ("transactional", optValue(transactional), "client should use transactions")
- ("durable", optValue(durable), "messages should be durable")
- ("batches", optValue(batches, "N"), "how many batches to run")
- ("delay", optValue(delay, "SECONDS"), "Causes a delay between each batch")
- ("size", optValue(size, "BYTES"), "size of the published messages")
- ("status-queue", optValue(statusqueue, "QUEUE-NAME"), "Message queue to read status messages from");
- }
-};
-
-int main(int argc, char** argv) {
- try{
- Args args;
- args.parse(argc, argv);
- if(args.help)
- cout << args << endl;
- else {
- Connection connection;
- args.open(connection);
- AsyncSession session = connection.newSession();
-
- // If status-queue is defined, wait for all expected listeners to join in before we start
- if( args.statusqueue.length() > 0 ) {
- cout << "Waiting for " << args.subscribers << " listeners..." << endl;
- SubscriptionManager statusSubs(session);
- LocalQueue statusQ;
- statusSubs.subscribe(statusQ, args.statusqueue);
- for (int i = 0; i < args.subscribers; i++) {
- Message m = statusQ.get();
- if( m.getData().find("topic_listener: ", 0) == 0 ) {
- cout << "Listener " << (i+1) << " of " << args.subscribers
- << " is ready (pid " << m.getData().substr(16, m.getData().length() - 16)
- << ")" << endl;
- } else {
- throw Exception(QPID_MSG("Unexpected message received on status queue: " << m.getData()));
- }
- }
- }
-
- if (args.transactional) {
- session.txSelect();
- }
- session.queueDeclare(arg::queue="response");
- session.exchangeBind(arg::exchange="amq.direct", arg::queue="response", arg::bindingKey="response");
-
- Publisher publisher(session, "topic_control", args.transactional, args.durable);
-
- int batchSize(args.batches);
- int64_t max(0);
- int64_t min(0);
- int64_t sum(0);
- for(int i = 0; i < batchSize; i++){
- if(i > 0 && args.delay) sleep(args.delay);
- int64_t msecs =
- publisher.publish(args.messages,
- args.subscribers,
- args.size) / TIME_MSEC;
- if(!max || msecs > max) max = msecs;
- if(!min || msecs < min) min = msecs;
- sum += msecs;
- cout << "Completed " << (i+1) << " of " << batchSize
- << " in " << msecs << "ms" << endl;
- }
- publisher.terminate();
- int64_t avg = sum / batchSize;
- if(batchSize > 1){
- cout << batchSize << " batches completed. avg=" << avg <<
- ", max=" << max << ", min=" << min << endl;
- }
- session.close();
- connection.close();
- }
- return 0;
- }catch(exception& error) {
- cout << error.what() << endl;
- }
- return 1;
-}
-
-Publisher::Publisher(const AsyncSession& _session, const string& _controlTopic, bool tx, bool d) :
- session(_session), mgr(session), controlTopic(_controlTopic), transactional(tx), durable(d)
-{
- mgr.subscribe(queue, "response");
-}
-
-int64_t Publisher::publish(int msgs, int listeners, int size){
- Message msg(generateData(size), controlTopic);
- if (durable) {
- msg.getDeliveryProperties().setDeliveryMode(framing::PERSISTENT);
- }
- AbsTime start = now();
-
- for(int i = 0; i < msgs; i++){
- session.messageTransfer(arg::content=msg, arg::destination="amq.topic", arg::acceptMode=1);
- }
- //send report request
- Message reportRequest("", controlTopic);
- reportRequest.getHeaders().setString("TYPE", "REPORT_REQUEST");
- session.messageTransfer(arg::content=reportRequest, arg::destination="amq.topic", arg::acceptMode=1);
- if(transactional){
- sync(session).txCommit();
- }
- //wait for a response from each listener (TODO, could log these)
- for (int i = 0; i < listeners; i++) {
- Message report = queue.pop();
- }
-
- if(transactional){
- sync(session).txCommit();
- }
-
- AbsTime finish = now();
- return Duration(start, finish);
-}
-
-string Publisher::generateData(int size){
- string data;
- for(int i = 0; i < size; i++){
- data += ('A' + (i / 26));
- }
- return data;
-}
-
-void Publisher::terminate(){
- //send termination request
- Message terminationRequest("", controlTopic);
- terminationRequest.getHeaders().setString("TYPE", "TERMINATION_REQUEST");
- session.messageTransfer(arg::content=terminationRequest, arg::destination="amq.topic", arg::acceptMode=1);
- if(transactional){
- session.txCommit();
- }
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/topictest b/M4-RCs/qpid/cpp/src/tests/topictest
deleted file mode 100755
index 8fd680ee35..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/topictest
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-
-#
-# 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.
-#
-
-# Run the C++ topic test
-
-# Clean up old log files
-rm -f subscriber_*.log
-
-# Defaults values
-SUBSCRIBERS=10
-MESSAGES=2000
-BATCHES=10
-
-while getopts "s:m:b:h:t" opt ; do
- case $opt in
- s) SUBSCRIBERS=$OPTARG ;;
- m) MESSAGES=$OPTARG ;;
- b) BATCHES=$OPTARG ;;
- h) HOST=-h$OPTARG ;;
- t) TRANSACTIONAL="--transactional --durable" ;;
- ?)
- echo "Usage: %0 [-s <subscribers>] [-m <messages.] [-b <batches>]"
- exit 1
- ;;
- esac
-done
-
-subscribe() {
- echo Start subscriber $1
- LOG="subscriber_$1.log"
- ./topic_listener $TRANSACTIONAL > $LOG 2>&1 && rm -f $LOG
-}
-
-publish() {
- ./topic_publisher --messages $MESSAGES --batches $BATCHES --subscribers $SUBSCRIBERS $HOST $TRANSACTIONAL
-}
-
-for ((i=$SUBSCRIBERS ; i--; )); do
- subscribe $i &
-done
-# FIXME aconway 2007-03-27: Hack around startup race. Fix topic test.
-sleep 2
-publish 2>&1 || exit 1
diff --git a/M4-RCs/qpid/cpp/src/tests/txjob.cpp b/M4-RCs/qpid/cpp/src/tests/txjob.cpp
deleted file mode 100644
index 94db96a666..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/txjob.cpp
+++ /dev/null
@@ -1,95 +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 <iostream>
-#include <boost/bind.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
-
-#include "TestOptions.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/FailoverManager.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/sys/Thread.h"
-
-using namespace qpid::client;
-using namespace qpid::sys;
-
-struct Args : public qpid::TestOptions
-{
- string workQueue;
- string source;
- string dest;
- uint messages;
- uint jobs;
- bool quit;
- bool declareQueues;
-
- Args() : workQueue("txshift-control"), source("txshift-1"), dest("txshift-2"), messages(0), jobs(0),
- quit(false), declareQueues(false)
- {
- addOptions()
- ("messages", qpid::optValue(messages, "N"), "Number of messages to shift")
- ("jobs", qpid::optValue(jobs, "N"), "Number of shift jobs to request")
- ("source", qpid::optValue(source, "QUEUE NAME"), "source queue from which messages will be shifted")
- ("dest", qpid::optValue(dest, "QUEUE NAME"), "dest queue to which messages will be shifted")
- ("work-queue", qpid::optValue(workQueue, "QUEUE NAME"), "work queue from which to take instructions")
- ("add-quit", qpid::optValue(quit), "add a 'quit' instruction to the queue (after any other jobs)")
- ("declare-queues", qpid::optValue(declareQueues), "issue a declare for all queues");
- }
-};
-
-//TODO: might be nice to make this capable of failover as well at some
-//point; for now its just for the setup phase.
-int main(int argc, char** argv)
-{
- Args opts;
- try {
- opts.parse(argc, argv);
- Connection connection;
- connection.open(opts.con);
- Session session = connection.newSession();
- if (opts.declareQueues) {
- session.queueDeclare(arg::queue=opts.workQueue);
- session.queueDeclare(arg::queue=opts.source);
- session.queueDeclare(arg::queue=opts.dest);
- }
- for (uint i = 0; i < opts.jobs; ++i) {
- Message job("transfer", opts.workQueue);
- job.getHeaders().setString("src", opts.source);
- job.getHeaders().setString("dest", opts.dest);
- job.getHeaders().setInt("count", opts.messages);
- async(session).messageTransfer(arg::content=job);
- }
-
- if (opts.quit) {
- async(session).messageTransfer(arg::content=Message("quit", opts.workQueue));
- }
-
- session.sync();
- session.close();
-
- return 0;
- } catch(const std::exception& e) {
- std::cout << e.what() << std::endl;
- return 1;
- }
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/txshift.cpp b/M4-RCs/qpid/cpp/src/tests/txshift.cpp
deleted file mode 100644
index 5db08d7a53..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/txshift.cpp
+++ /dev/null
@@ -1,185 +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 <iostream>
-#include <boost/bind.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
-
-#include "TestOptions.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/FailoverManager.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/log/Statement.h"
-#include "qpid/sys/Thread.h"
-
-using namespace qpid::client;
-using namespace qpid::sys;
-
-struct Args : public qpid::TestOptions
-{
- string workQueue;
- size_t workers;
-
- Args() : workQueue("txshift-control"), workers(1)
- {
- addOptions()
- ("workers", qpid::optValue(workers, "N"), "Number of separate worker sessions to start")
- ("work-queue", qpid::optValue(workQueue, "NAME"), "work queue from which to take instructions");
- }
-};
-
-struct Transfer : MessageListener
-{
- std::string control;
- std::string source;
- std::string destination;
- uint expected;
- uint transfered;
- SubscriptionSettings controlSettings;
- Subscription controlSubscription;
- SubscriptionSettings sourceSettings;
- Subscription sourceSubscription;
-
- Transfer(const std::string control_) : control(control_), expected(0), transfered(0) {}
-
- void subscribeToSource(SubscriptionManager& manager)
- {
- sourceSettings.autoAck = 0;//will accept once at the end of the batch
- sourceSettings.flowControl = FlowControl::messageCredit(expected);
- sourceSubscription = manager.subscribe(*this, source, sourceSettings);
- QPID_LOG(info, "Subscribed to source: " << source << " expecting: " << expected);
- }
-
- void subscribeToControl(SubscriptionManager& manager)
- {
- controlSettings.flowControl = FlowControl::messageCredit(1);
- controlSubscription = manager.subscribe(*this, control, controlSettings);
- QPID_LOG(info, "Subscribed to job queue");
- }
-
- void received(Message& message)
- {
- QPID_LOG(debug, "received: " << message.getData() << " for " << message.getDestination());
- if (message.getDestination() == source) {
- receivedFromSource(message);
- } else if (message.getDestination() == control) {
- receivedFromControl(message);
- } else {
- QPID_LOG(error, "Unexpected message: " << message.getData() << " to " << message.getDestination());
- }
- }
-
- void receivedFromSource(Message& message)
- {
- QPID_LOG(debug, "transfering " << (transfered+1) << " of " << expected);
- message.getDeliveryProperties().setRoutingKey(destination);
- async(sourceSubscription.getSession()).messageTransfer(arg::content=message);
- if (++transfered == expected) {
- QPID_LOG(info, "completed job: " << transfered << " messages shifted from " <<
- source << " to " << destination);
- sourceSubscription.accept(sourceSubscription.getUnaccepted());
- sourceSubscription.getSession().txCommit();
- sourceSubscription.cancel();
- //grant credit to allow broker to send us another control message
- controlSubscription.grantMessageCredit(1);
- }
- }
-
- void receivedFromControl(Message& message)
- {
- if (message.getData() == "transfer") {
- source = message.getHeaders().getAsString("src");
- destination = message.getHeaders().getAsString("dest");
- expected = message.getHeaders().getAsInt("count");
- transfered = 0;
- QPID_LOG(info, "received transfer request: " << expected << " messages to be shifted from " <<
- source << " to " << destination);
- subscribeToSource(controlSubscription.getSubscriptionManager());
- } else if (message.getData() == "quit") {
- QPID_LOG(info, "received quit request");
- controlSubscription.cancel();
- } else {
- std::cerr << "Rejecting invalid message: " << message.getData() << std::endl;
- controlSubscription.getSession().messageReject(SequenceSet(message.getId()));
- }
- }
-
-};
-
-struct Worker : FailoverManager::Command, Runnable
-{
- FailoverManager& connection;
- Transfer transfer;
- Thread runner;
-
- Worker(FailoverManager& c, const std::string& controlQueue) : connection(c), transfer(controlQueue) {}
-
- void run()
- {
- connection.execute(*this);
- }
-
- void start()
- {
- runner = Thread(this);
- }
-
- void join()
- {
- runner.join();
- }
-
- void execute(AsyncSession& session, bool isRetry)
- {
- if (isRetry) QPID_LOG(info, "Retrying...");
- session.txSelect();
- SubscriptionManager subs(session);
- transfer.subscribeToControl(subs);
- subs.run();
- }
-};
-
-int main(int argc, char** argv)
-{
- Args opts;
- try {
- opts.parse(argc, argv);
- FailoverManager connection(opts.con);
- connection.connect();
- if (opts.workers == 1) {
- Worker worker(connection, opts.workQueue);
- worker.run();
- } else {
- boost::ptr_vector<Worker> workers;
- for (size_t i = 0; i < opts.workers; i++) {
- workers.push_back(new Worker(connection, opts.workQueue));
- }
- for_each(workers.begin(), workers.end(), boost::bind(&Worker::start, _1));
- for_each(workers.begin(), workers.end(), boost::bind(&Worker::join, _1));
- }
-
- return 0;
- } catch(const std::exception& e) {
- std::cout << e.what() << std::endl;
- return 1;
- }
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/txtest.cpp b/M4-RCs/qpid/cpp/src/tests/txtest.cpp
deleted file mode 100644
index 0c8ce90648..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/txtest.cpp
+++ /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.
- *
- */
-
-#include <algorithm>
-#include <iomanip>
-#include <iostream>
-#include <memory>
-#include <sstream>
-#include <vector>
-
-#include "TestOptions.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/framing/Array.h"
-#include "qpid/framing/Buffer.h"
-#include "qpid/sys/uuid.h"
-
-using namespace qpid;
-using namespace qpid::client;
-using namespace qpid::sys;
-using std::string;
-
-typedef std::vector<std::string> StringSet;
-
-struct Args : public qpid::TestOptions {
- bool init, transfer, check;//actions
- uint size;
- bool durable;
- uint queues;
- string base;
- uint msgsPerTx;
- uint txCount;
- uint totalMsgCount;
- bool dtx;
- bool quiet;
-
- Args() : init(true), transfer(true), check(true),
- size(256), durable(true), queues(2),
- base("tx-test"), msgsPerTx(1), txCount(1), totalMsgCount(10),
- dtx(false), quiet(false)
- {
- addOptions()
-
- ("init", optValue(init, "yes|no"), "Declare queues and populate one with the initial set of messages.")
- ("transfer", optValue(transfer, "yes|no"), "'Move' messages from one queue to another using transactions to ensure no message loss.")
- ("check", optValue(check, "yes|no"), "Check that the initial messages are all still available.")
- ("size", optValue(size, "N"), "message size")
- ("durable", optValue(durable, "yes|no"), "use durable messages")
- ("queues", optValue(queues, "N"), "number of queues")
- ("queue-base-name", optValue(base, "<name>"), "base name for queues")
- ("messages-per-tx", optValue(msgsPerTx, "N"), "number of messages transferred per transaction")
- ("tx-count", optValue(txCount, "N"), "number of transactions per 'agent'")
- ("total-messages", optValue(totalMsgCount, "N"), "total number of messages in 'circulation'")
- ("dtx", optValue(dtx, "yes|no"), "use distributed transactions")
- ("quiet", optValue(quiet), "reduce output from test");
- }
-};
-
-const std::string chars("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
-
-std::string generateData(uint size)
-{
- if (size < chars.length()) {
- return chars.substr(0, size);
- }
- std::string data;
- for (uint i = 0; i < (size / chars.length()); i++) {
- data += chars;
- }
- data += chars.substr(0, size % chars.length());
- return data;
-}
-
-void generateSet(const std::string& base, uint count, StringSet& collection)
-{
- for (uint i = 0; i < count; i++) {
- std::ostringstream out;
- out << base << "-" << (i+1);
- collection.push_back(out.str());
- }
-}
-
-Args opts;
-
-struct Client
-{
- Connection connection;
- AsyncSession session;
-
- Client()
- {
- opts.open(connection);
- session = connection.newSession();
- }
-
- ~Client()
- {
- try{
- session.close();
- connection.close();
- } catch(const std::exception& e) {
- std::cout << e.what() << std::endl;
- }
- }
-};
-
-struct Transfer : public Client, public Runnable
-{
- std::string src;
- std::string dest;
- Thread thread;
- uuid_t uuid;
- char uuidStr[37]; // Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + trailing \0
- framing::Xid xid;
-
- Transfer(const std::string& to, const std::string& from) : src(to), dest(from), xid(0x4c414e47, "", from) {}
-
- void run()
- {
- try {
-
- if (opts.dtx) session.dtxSelect();
- else session.txSelect();
- SubscriptionManager subs(session);
-
- LocalQueue lq;
- SubscriptionSettings settings(FlowControl::messageWindow(opts.msgsPerTx));
- settings.autoAck = 0; // Disabled
- Subscription sub = subs.subscribe(lq, src, settings);
-
- for (uint t = 0; t < opts.txCount; t++) {
- Message in;
- Message out("", dest);
- if (opts.dtx) {
- setNewXid(xid);
- session.dtxStart(arg::xid=xid);
- }
- for (uint m = 0; m < opts.msgsPerTx; m++) {
- in = lq.pop();
- out.setData(in.getData());
- out.getMessageProperties().setCorrelationId(in.getMessageProperties().getCorrelationId());
- out.getDeliveryProperties().setDeliveryMode(in.getDeliveryProperties().getDeliveryMode());
- session.messageTransfer(arg::content=out, arg::acceptMode=1);
- }
- sub.accept(sub.getUnaccepted());
- if (opts.dtx) {
- session.dtxEnd(arg::xid=xid);
- session.dtxPrepare(arg::xid=xid);
- session.dtxCommit(arg::xid=xid);
- } else {
- session.txCommit();
- }
- }
- } catch(const std::exception& e) {
- std::cout << "Transfer interrupted: " << e.what() << std::endl;
- }
- }
-
- void setNewXid(framing::Xid& xid) {
- ::uuid_generate(uuid);
- ::uuid_unparse(uuid, uuidStr);
- xid.setGlobalId(uuidStr);
- }
-};
-
-struct Controller : public Client
-{
- StringSet ids;
- StringSet queues;
-
- Controller()
- {
- generateSet(opts.base, opts.queues, queues);
- generateSet("msg", opts.totalMsgCount, ids);
- }
-
- void init()
- {
- //declare queues
- for (StringSet::iterator i = queues.begin(); i != queues.end(); i++) {
- session.queueDeclare(arg::queue=*i, arg::durable=opts.durable);
- session.sync();
- }
-
- Message msg(generateData(opts.size), *queues.begin());
- if (opts.durable) {
- msg.getDeliveryProperties().setDeliveryMode(framing::PERSISTENT);
- }
-
- //publish messages
- for (StringSet::iterator i = ids.begin(); i != ids.end(); i++) {
- msg.getMessageProperties().setCorrelationId(*i);
- session.messageTransfer(arg::content=msg, arg::acceptMode=1);
- }
- }
-
- void transfer()
- {
- boost::ptr_vector<Transfer> agents(opts.queues);
- //launch transfer agents
- for (StringSet::iterator i = queues.begin(); i != queues.end(); i++) {
- StringSet::iterator next = i + 1;
- if (next == queues.end()) next = queues.begin();
-
- if (!opts.quiet) std::cout << "Transfering from " << *i << " to " << *next << std::endl;
- agents.push_back(new Transfer(*i, *next));
- agents.back().thread = Thread(agents.back());
- }
-
- for (boost::ptr_vector<Transfer>::iterator i = agents.begin(); i != agents.end(); i++) {
- i->thread.join();
- }
- }
-
- int check()
- {
- SubscriptionManager subs(session);
-
- // Recover DTX transactions (if any)
- if (opts.dtx) {
- std::vector<std::string> inDoubtXids;
- framing::DtxRecoverResult dtxRes = session.dtxRecover().get();
- const framing::Array& xidArr = dtxRes.getInDoubt();
- xidArr.collect(inDoubtXids);
-
- if (inDoubtXids.size()) {
- if (!opts.quiet) std::cout << "Recovering DTX in-doubt transaction(s):" << std::endl;
- framing::StructHelper decoder;
- framing::Xid xid;
- // abort even, commit odd transactions
- for (unsigned i = 0; i < inDoubtXids.size(); i++) {
- decoder.decode(xid, inDoubtXids[i]);
- if (!opts.quiet) std::cout << (i%2 ? " * aborting " : " * committing ");
- xid.print(std::cout);
- std::cout << std::endl;
- if (i%2) {
- session.dtxRollback(arg::xid=xid);
- } else {
- session.dtxCommit(arg::xid=xid);
- }
- }
- }
- }
-
- StringSet drained;
- //drain each queue and verify the correct set of messages are available
- for (StringSet::iterator i = queues.begin(); i != queues.end(); i++) {
- //subscribe, allocate credit and flushn
- LocalQueue lq;
- SubscriptionSettings settings(FlowControl::unlimited(), ACCEPT_MODE_NONE);
- subs.subscribe(lq, *i, settings);
- session.messageFlush(arg::destination=*i);
- session.sync();
-
- uint count(0);
- while (!lq.empty()) {
- Message m = lq.pop();
- //add correlation ids of received messages to drained
- drained.push_back(m.getMessageProperties().getCorrelationId());
- ++count;
- }
- if (!opts.quiet) std::cout << "Drained " << count << " messages from " << *i << std::endl;
- }
-
- sort(ids.begin(), ids.end());
- sort(drained.begin(), drained.end());
-
- //check that drained == ids
- StringSet missing;
- set_difference(ids.begin(), ids.end(), drained.begin(), drained.end(), back_inserter(missing));
-
- StringSet extra;
- set_difference(drained.begin(), drained.end(), ids.begin(), ids.end(), back_inserter(extra));
-
- if (missing.empty() && extra.empty()) {
- std::cout << "All expected messages were retrieved." << std::endl;
- return 0;
- } else {
- if (!missing.empty()) {
- std::cout << "The following ids were missing:" << std::endl;
- for (StringSet::iterator i = missing.begin(); i != missing.end(); i++) {
- std::cout << " '" << *i << "'" << std::endl;
- }
- }
- if (!extra.empty()) {
- std::cout << "The following extra ids were encountered:" << std::endl;
- for (StringSet::iterator i = extra.begin(); i != extra.end(); i++) {
- std::cout << " '" << *i << "'" << std::endl;
- }
- }
- return 1;
- }
- }
-};
-
-int main(int argc, char** argv)
-{
- try {
- opts.parse(argc, argv);
- Controller controller;
- if (opts.init) controller.init();
- if (opts.transfer) controller.transfer();
- if (opts.check) return controller.check();
- return 0;
- } catch(const std::exception& e) {
- std::cout << e.what() << std::endl;
- }
- return 2;
-}
diff --git a/M4-RCs/qpid/cpp/src/tests/unit_test.cpp b/M4-RCs/qpid/cpp/src/tests/unit_test.cpp
deleted file mode 100644
index 00c61242e4..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/unit_test.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-// Defines test_main function to link with actual unit test code.
-#define BOOST_AUTO_TEST_MAIN // Boost 1.33
-#define BOOST_TEST_MAIN
-#include "unit_test.h"
-
diff --git a/M4-RCs/qpid/cpp/src/tests/unit_test.h b/M4-RCs/qpid/cpp/src/tests/unit_test.h
deleted file mode 100644
index df3ebfb1fe..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/unit_test.h
+++ /dev/null
@@ -1,86 +0,0 @@
-#ifndef QPIPD_TEST_UNIT_TEST_H_
-#define QPIPD_TEST_UNIT_TEST_H_
-
-/*
- *
- * 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.
- *
- */
-
-// Workaround so we can build against boost 1.33 and boost 1.34.
-// Remove when we no longer need to support 1.33.
-//
-#include <boost/version.hpp>
-#include <limits.h> // Must be inclued beofre boost/test headers.
-
-// #include the correct header file.
-//
-#if (BOOST_VERSION < 103400)
-# include <boost/test/auto_unit_test.hpp>
-#else
-# include <boost/test/unit_test.hpp>
-#endif // BOOST_VERSION
-
-// Workarounds for BOOST_AUTO_TEST_CASE|SUITE|SUITE_END
-//
-#if (BOOST_VERSION < 103300)
-
-# define QPID_AUTO_TEST_SUITE(name)
-# define QPID_AUTO_TEST_CASE(name) BOOST_AUTO_UNIT_TEST(name)
-# define QPID_AUTO_TEST_SUITE_END()
-
-#elif (BOOST_VERSION < 103400)
-// Note the trailing ';'
-# define QPID_AUTO_TEST_SUITE(name) BOOST_AUTO_TEST_SUITE(name);
-# define QPID_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END();
-
-#endif // Workarounds for BOOST_AUTO_TEST_CASE|SUITE|SUITE_END
-
-// Workaround for BOOST_AUTO_TEST_SUITE_EXPECTED_FAILURES
-//
-#if (BOOST_VERSION < 103600)
-
-// Keep the test function for compilation but do not not register it.
-// TODO aconway 2008-04-23: better workaround for expected failures.
-# define QPID_AUTO_TEST_CASE_EXPECTED_FAILURES(test_name,n) \
- namespace { struct test_name { void test_method(); }; } \
- void test_name::test_method()
-
-#endif // Workaround for BOOST_AUTO_TEST_SUITE_EXPECTED_FAILURES
-
-//
-// Default definitions for latest version of boost.
-//
-
-#ifndef QPID_AUTO_TEST_SUITE
-# define QPID_AUTO_TEST_SUITE(name) BOOST_AUTO_TEST_SUITE(name)
-#endif
-
-#ifndef QPID_AUTO_TEST_CASE
-# define QPID_AUTO_TEST_CASE(name) BOOST_AUTO_TEST_CASE(name)
-#endif
-
-#ifndef QPID_AUTO_TEST_CASE_EXPECTED_FAILURES
-# define QPID_AUTO_TEST_CASE_EXPECTED_FAILURES(name,n) BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(name,n)
-#endif
-
-#ifndef QPID_AUTO_TEST_SUITE_END
-# define QPID_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
-#endif
-
-#endif // !QPIPD_TEST_UNIT_TEST_H_
diff --git a/M4-RCs/qpid/cpp/src/tests/vg_check b/M4-RCs/qpid/cpp/src/tests/vg_check
deleted file mode 100644
index c5a1e6d2d0..0000000000
--- a/M4-RCs/qpid/cpp/src/tests/vg_check
+++ /dev/null
@@ -1,24 +0,0 @@
-# Check for valgrind errors. Sourced by test scripts.
-
-vg_failed() {
- echo "Valgrind error log in $VG_LOG." 1>&2
- cat $VG_LOG 1>&2
- echo $1 1>&2
- exit 1
-}
-
-vg_check()
-{
- test -z "$1" || VG_LOG=$1
- test -f $VG_LOG || vg_failed Valgrind log file $VG_LOG missing.
- # Ensure there is an ERROR SUMMARY line.
- grep -E '^==[0-9]+== ERROR SUMMARY:' $VG_LOG > /dev/null || \
- vg_failed "No valgrind ERROR SUMMARY line in $VG_LOG."
- # Ensure that the number of errors is 0.
- grep -E '^==[0-9]+== ERROR SUMMARY: [^0]' $VG_LOG > /dev/null && \
- vg_failed "Valgrind reported errors in $VG_LOG; see above."
- # Check for leaks.
- grep -E '^==[0-9]+== +.* lost: [^0]' $VG_LOG && \
- vg_failed "Found memory leaks (see log file, $VG_LOG); see above."
- true
-}
diff --git a/M4-RCs/qpid/cpp/src/windows/QpiddBroker.cpp b/M4-RCs/qpid/cpp/src/windows/QpiddBroker.cpp
deleted file mode 100644
index 6714ac2e01..0000000000
--- a/M4-RCs/qpid/cpp/src/windows/QpiddBroker.cpp
+++ /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.
- *
- */
-
-#include "qpidd.h"
-#include "qpid/Exception.h"
-#include "qpid/Options.h"
-#include "qpid/Plugin.h"
-#include "qpid/sys/IntegerTypes.h"
-#include "qpid/sys/windows/check.h"
-#include "qpid/broker/Broker.h"
-
-#include <iostream>
-
-// These need to be made something sensible, like reading a value from
-// the registry. But for now, get things going with a local definition.
-namespace {
-const char *CONF_FILE = "qpid_broker.conf";
-const char *MODULE_DIR = ".";
-}
-
-using namespace qpid::broker;
-
-BootstrapOptions::BootstrapOptions(const char* argv0)
- : qpid::Options("Options"),
- common("", CONF_FILE),
- module(MODULE_DIR),
- log(argv0)
-{
- add(common);
- add(module);
- add(log);
-}
-
-struct QpiddWindowsOptions : public QpiddOptionsPrivate {
- QpiddWindowsOptions(QpiddOptions *parent) : QpiddOptionsPrivate(parent) {
- }
-};
-
-QpiddOptions::QpiddOptions(const char* argv0)
- : qpid::Options("Options"),
- common("", CONF_FILE),
- module(MODULE_DIR),
- log(argv0)
-{
- add(common);
- add(module);
- add(broker);
- add(log);
-
- platform.reset(new QpiddWindowsOptions(this));
- qpid::Plugin::addOptions(*this);
-}
-
-void QpiddOptions::usage() const {
- std::cout << "Usage: qpidd [OPTIONS]" << std::endl << std::endl
- << *this << std::endl;
-}
-
-int QpiddBroker::execute (QpiddOptions *options) {
- // Options that affect a running daemon.
- QpiddWindowsOptions *myOptions =
- reinterpret_cast<QpiddWindowsOptions *>(options->platform.get());
- if (myOptions == 0)
- throw qpid::Exception("Internal error obtaining platform options");
-
- boost::intrusive_ptr<Broker> brokerPtr(new Broker(options->broker));
- if (options->broker.port == 0)
- std::cout << (uint16_t)(brokerPtr->getPort("")) << std::endl;
- brokerPtr->run();
- return 0;
-}
diff --git a/M4-RCs/qpid/cpp/src/xml.mk b/M4-RCs/qpid/cpp/src/xml.mk
deleted file mode 100644
index 957a18efde..0000000000
--- a/M4-RCs/qpid/cpp/src/xml.mk
+++ /dev/null
@@ -1,28 +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.
-#
-dmodule_LTLIBRARIES += xml.la
-
-xml_la_SOURCES = \
- qpid/xml/XmlExchange.cpp \
- qpid/xml/XmlExchange.h \
- qpid/xml/XmlExchangePlugin.cpp
-
-xml_la_LIBADD = -lxerces-c -lxqilla libqpidbroker.la
-
-xml_la_LDFLAGS = $(PLUGINLDFLAGS)
diff --git a/M4-RCs/qpid/cpp/versions b/M4-RCs/qpid/cpp/versions
deleted file mode 100755
index 2c82e3fd80..0000000000
--- a/M4-RCs/qpid/cpp/versions
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-# Utility to print out currently installed versions of qpid developer
-# dependencies. Assumes that some dependencies are installed with RPM.
-#
-
-for p in pkg-config doxygen help2man autoconf automake libtool ; do
- echo `which $p` `$p --version | head -n1`
-done
-
-for r in apr boost boost-devel cppunit cppunit-devel graphviz; do
- rpm -q $r
-done
diff --git a/M4-RCs/qpid/cpp/xml/cluster.xml b/M4-RCs/qpid/cpp/xml/cluster.xml
deleted file mode 100644
index 19d9f7ea56..0000000000
--- a/M4-RCs/qpid/cpp/xml/cluster.xml
+++ /dev/null
@@ -1,143 +0,0 @@
-<?xml version="1.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 major="0" minor="10" port="5672">
-
- <!-- Controls sent between cluster nodes. -->
-
- <class name = "cluster" code = "0x80" label="Qpid clustering extensions.">
- <doc>Qpid extension class to allow clustered brokers to communicate.</doc>
-
- <control name="dump-request" code="0x1" label="URL for a member.">
- <field name="url" type="str16"/>
- </control>
-
- <control name = "dump-offer" code="0x2" label="Member offering to be dumper for dumpee.">
- <field name="dumpee" type="uint64"/>
- <field name="cluster-id" type="uuid"/>
- </control>
-
-Min <control name="ready" code="0x10" label="New member is ready.">
- <field name="url" type="str16"/>
- </control>
-
- <control name="config-change" code="0x11" label="Raw cluster membership.">
- <field name="current" type="vbin16"/> <!-- packed member-id array -->
- </control>
-
- <control name="shutdown" code="0x20" label="Shut down entire cluster"/>
- </class>
-
- <!-- TODO aconway 2008-09-10: support for un-attached connections. -->
-
- <!-- Controls associated with a specific connection. -->
-
- <class name="cluster-connection" code="0x81" label="Qpid clustering extensions.">
-
- <control name="deliver-close" code="0x2">
- </control>
-
- <control name="deliver-do-output" code="0x3">
- <field name="bytes" type="uint32"/>
- </control>
-
- <!-- Brain-dump controls. Sent to a new broker in joining mode.
- A connection is dumped as followed:
- - open as a normal connection.
- - attach sessions, create consumers, set flow with normal AMQP cokmmands.
- - send /reset additional session state with controls below.
- - send shadow-ready to mark end of shadow dump.
- - send dump-complete when entire dump is complete.
- -->
-
- <!-- Consumer state that cannot be set by standard AMQP controls. -->
- <control name="consumer-state" code="0x10">
- <field name="name" type="str8"/>
- <field name="blocked" type="bit"/>
- <field name="notifyEnabled" type="bit"/>
- </control>
-
- <!-- Delivery-record for outgoing messages sent but not yet accepted. -->
- <control name="delivery-record" code ="0x11">
- <field name="queue" type="str8"/>
- <field name="position" type="sequence-no"/>
- <field name="tag" type="str8"/>
- <field name="id" type="sequence-no"/>
- <field name="acquired" type="bit"/> <!--If not set, message follows. -->
- <field name="accepted" type="bit"/>
- <field name="cancelled" type="bit"/>
- <field name="completed" type="bit"/>
- <field name="ended" type="bit"/>
- <field name="windowing" type="bit"/>
- <field name="credit" type="uint32"/>
- </control>
-
- <!-- Tx transaction state. -->
- <control name="tx-start" code="0x12"/>
- <control name="tx-accept" code="0x13"> <field name="commands" type="sequence-set"/> </control>
- <control name="tx-dequeue" code="0x14"> <field name="queue" type="str8"/> </control>
- <control name="tx-enqueue" code="0x15"> <field name="queue" type="str8"/> </control>
- <control name="tx-publish" code="0x16">
- <field name="queues" type="array"/> <!--Array of str8 -->
- <field name="delivered" type="bit"/>
- </control>
- <control name="tx-end" code="0x17"/>
- <control name="accumulated-ack" code="0x18"> <field name="commands" type="sequence-set"/> </control>
-
- <!-- Complete a session state dump. -->
- <control name="session-state" code="0x1F" label="Set session state during a brain dump.">
- <!-- Target session deduced from channel number. -->
- <field name="replay-start" type="sequence-no"/> <!-- Replay frames will start from this point.-->
- <field name="command-point" type="sequence-no"/> <!-- Id of next command sent -->
- <field name="sent-incomplete" type="sequence-set"/> <!-- Commands sent and incomplete. -->
-
- <field name="expected" type="sequence-no"/> <!-- Next command expected. -->
- <field name="received" type="sequence-no"/> <!-- Received up to here (>= expected) -->
- <field name="unknown-completed" type="sequence-set"/> <!-- Completed but not known to peer. -->
- <field name="received-incomplete" type="sequence-set"/> <!-- Received and incomplete -->
- </control>
-
- <!-- Complete a shadow connection dump. -->
- <control name="shadow-ready" code="0x20" label="End of shadow connection dump.">
- <field name="member-id" type="uint64"/>
- <field name="connection-id" type="uint64"/>
- </control>
-
- <!-- Complete a cluster state dump. -->
- <control name="membership" code="0x21" label="Cluster membership details.">
- <field name="newbies" type="map"/> <!-- member-id -> URL -->
- <field name="members" type="map"/> <!-- member-id -> state -->
- </control>
-
- <!-- Set the position of a replicated queue. -->
- <control name="queue-position" code="0x30">
- <field name="queue" type="str8"/>
- <field name="position" type="sequence-no"/>
- </control>
-
- <!-- Replicate encoded exchanges/queues. -->
- <control name="exchange" code="0x31"><field name="encoded" type="str32"/></control>
- <control name="queue" code="0x32"><field name="encoded" type="str32"/></control>
-
-
- </class>
-</amqp>
diff --git a/M4-RCs/qpid/cpp/xml/extra.xml b/M4-RCs/qpid/cpp/xml/extra.xml
deleted file mode 100644
index 5cb37ae65f..0000000000
--- a/M4-RCs/qpid/cpp/xml/extra.xml
+++ /dev/null
@@ -1,926 +0,0 @@
-<?xml version="1.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 major="99" minor="0" port="5672">
-
- <domain name="mediumstr" type="mediumstr" label="string with 16bit size field" />
-
- <domain name="sequence-set" type="sequence-set" label="ranged set representation">
- <doc>
- Set of pairs of RFC-1982 numbers representing a discontinuous range. Each pair represents a
- closed interval within the list.
-
- For example, the set (1,3), (6,6), (8,9) represents the sequence 1,2,3,6,8,9.
- </doc>
- </domain>
-
- <domain name="xid010">
- <struct size="long" pack="short" type="1540">
- <field name="format" domain="long" />
- <field name="global-id" domain="shortstr" />
- <field name="branch-id" domain="shortstr" />
- </struct>
- </domain>
-
- <domain name="delivery-properties-010">
- <struct size="long" pack="short" type="1025">
- <field name="discard-unroutable" domain="bit" label="controls discard of unroutable messages"/>
- <field name="immediate" domain="bit" label="Consider message unroutable if it cannot be
- processed immediately"/>
- <field name="redelivered" domain="bit" label="redelivery flag"/>
- <field name="priority" domain="octet" label="message priority, 0 to 9"
- required="true"/>
- <field name="delivery-mode" domain="octet" label="message persistence requirement"
- required="true"/>
- <field name="ttl" domain="longlong" label="time to live in ms"/>
- <field name="timestamp" domain="longlong" label="message timestamp"/>
- <field name="expiration" domain="longlong" label="message expiration time"/>
- <field name="exchange" domain="shortstr" label="originating exchange"/>
- <field name="routing-key" domain="shortstr" label="message routing key"/>
- <field name="resume-id" domain="mediumstr" label="global id for message transfer"/>
- <field name="resume-ttl" domain="longlong" label="ttl in ms for interrupted message data"/>
- </struct>
- </domain>
-
- <domain name="message-properties-010">
- <struct size="long" pack="short" type="1027">
- <field name="content-length" domain="longlong" label="length of the body segment in bytes"/>
- <field name="message-id" domain="uuid" label="application message identifier"/>
- <field name="correlation-id" domain="mediumstr" label="application correlation identifier"/>
- <field name="reply-to" domain="reply-to" label="destination to reply to"/>
- <field name="content-type" domain="shortstr" label="MIME content type"/>
- <field name="content-encoding" domain="shortstr" label="MIME content encoding"/>
- <field name="user-id" domain="mediumstr" label="creating user id"/>
- <field name="app-id" domain="mediumstr" label="creating application id"/>
- <field name="application-headers" domain="table" label="application specific headers table"/>
- </struct>
- </domain>
-
-<class name = "connection010" index = "1">
-
-<method name = "start" index="1">
- <doc>new start method</doc>
- <chassis name="client" implement="MUST" />
-
- <response name="start-ok" />
-
- <field name="server-properties" domain="table" label="server properties">
- <doc>blah, blah</doc>
- </field>
-
- <field name="mechanisms" domain="array" label="available security mechanisms">
- <doc>blah, blah</doc>
- </field>
-
- <field name="locales" domain="array" label="available message locales">
- </field>
-
-</method>
-
-<method name = "start-ok" index="2">
- <doc>new start-ok method</doc>
- <chassis name="server" implement="MUST" />
-
- <field name="client-properties" domain="table" label="server properties">
- <doc>blah, blah</doc>
- </field>
-
- <field name="mechanism" domain="shortstr" label="chosen security mechanism">
- <doc>blah, blah</doc>
- </field>
-
- <field name="response" domain="longstr" label="security response data">
- <doc>blah blah</doc>
- </field>
-
- <field name="locale" domain="shortstr" label="chosen locale">
- <doc>blah, blah</doc>
- </field>
-
-</method>
-
- <method name="secure" synchronous="1" index="3" label="security mechanism challenge">
- <doc>
- The SASL protocol works by exchanging challenges and responses until both peers have
- received sufficient information to authenticate each other. This method challenges the
- client to provide more information.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <response name="secure-ok" />
-
- <field name="challenge" domain="longstr" label="security challenge data">
- <doc>
- Challenge information, a block of opaque binary data passed to the security mechanism.
- </doc>
- </field>
- </method>
-
- <!-- - Method: connection.secure-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="secure-ok" synchronous="1" index="4" label="security mechanism response">
- <doc>
- This method attempts to authenticate, passing a block of SASL data for the security
- mechanism at the server side.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="response" domain="longstr" label="security response data">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this data are
- defined by the SASL security mechanism.
- </doc>
- <assert check="notnull" />
- </field>
- </method>
-
- <method name="tune" synchronous="1" index="5" label="propose connection tuning parameters">
- <doc>
- This method proposes a set of connection configuration values to the client. The client can
- accept and/or adjust these.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <response name="tune-ok" />
-
- <field name="channel-max" domain="short" label="proposed maximum channels">
- <doc>
- The maximum total number of channels that the server allows per connection. Zero means
- that the server does not impose a fixed limit, but the number of allowed channels may be
- limited by available server resources.
- </doc>
- </field>
-
- <field name="frame-max" domain="short" label="proposed maximum frame size">
- <doc>
- The largest frame size that the server proposes for the connection. The client can
- negotiate a lower value. Zero means that the server does not impose any specific limit but
- may reject very large frames if it cannot allocate resources for them.
- </doc>
-
- <rule name="minimum">
- <doc>
- Until the frame-max has been negotiated, both peers MUST accept frames of up to
- frame-min-size octets large, and the minimum negotiated value for frame-max is also
- frame-min-size.
- </doc>
- <doc type="scenario">
- Client connects to server and sends a large properties field, creating a frame of
- frame-min-size octets. The server must accept this frame.
- </doc>
- </rule>
- </field>
-
- <field name="heartbeat-min" domain="short" label="desired heartbeat delay"/>
- <field name="heartbeat-max" domain="short" label="desired heartbeat delay"/>
- </method>
-
- <!-- - Method: connection.tune-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="tune-ok" synchronous="1" index="6"
- label="negotiate connection tuning parameters">
- <doc>
- This method sends the client's connection tuning parameters to the server. Certain fields
- are negotiated, others provide capability information.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="channel-max" domain="short" label="negotiated maximum channels">
- <doc>
- The maximum total number of channels that the client will use per connection.
- </doc>
-
- <rule name="upper-limit">
- <doc>
- If the client specifies a channel max that is higher than the value provided by the
- server, the server MUST close the connection without attempting a negotiated close. The
- server may report the error in some fashion to assist implementors.
- </doc>
- </rule>
-
- <assert check="notnull" />
- <assert check="le" value="channel-max" />
- </field>
-
- <field name="frame-max" domain="short" label="negotiated maximum frame size">
- <doc>
- The largest frame size that the client and server will use for the connection. Zero means
- that the client does not impose any specific limit but may reject very large frames if it
- cannot allocate resources for them. Note that the frame-max limit applies principally to
- content frames, where large contents can be broken into frames of arbitrary size.
- </doc>
-
- <rule name="minimum">
- <doc>
- Until the frame-max has been negotiated, both peers MUST accept frames of up to
- frame-min-size octets large, and the minimum negotiated value for frame-max is also
- frame-min-size.
- </doc>
- </rule>
-
- <rule name="upper-limit">
- <doc>
- If the client specifies a frame max that is higher than the value provided by the
- server, the server MUST close the connection without attempting a negotiated close. The
- server may report the error in some fashion to assist implementors.
- </doc>
- </rule>
- </field>
-
- <field name="heartbeat" domain="short" label="desired heartbeat delay">
- <doc>
- The delay, in seconds, of the connection heartbeat that the client wants. Zero means the
- client does not want a heartbeat.
- </doc>
- </field>
- </method>
-
- <method name="open" synchronous="1" index="7" label="open connection to virtual host">
- <doc>
- This method opens a connection to a virtual host, which is a collection of resources, and
- acts to separate multiple application domains within a server. The server may apply
- arbitrary limits per virtual host, such as the number of each type of entity that may be
- used, per connection and/or in total.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <response name="open-ok" />
- <response name="redirect" />
-
- <field name="virtual-host" domain="path" label="virtual host name">
- <!-- TODO 0.82 - the entire vhost model needs review. This concept was prompted by the HTTP
- vhost concept but does not fit very well into AMQP. Currently we use the vhost as a
- "cluster identifier" which is inaccurate usage. /PH 2006/07/19
- -->
- <doc>
- The name of the virtual host to work with.
- </doc>
-
- <rule name="separation">
- <doc>
- If the server supports multiple virtual hosts, it MUST enforce a full separation of
- exchanges, queues, and all associated entities per virtual host. An application,
- connected to a specific virtual host, MUST NOT be able to access resources of another
- virtual host.
- </doc>
- </rule>
-
- <rule name="security">
- <doc>
- The server SHOULD verify that the client has permission to access the specified virtual
- host.
- </doc>
- </rule>
- <assert check="regexp" value="^[a-zA-Z0-9/-_]+$" />
- </field>
-
- <field name="capabilities" domain="array" label="required capabilities">
- <doc>
- The client can specify zero or more capability names, delimited by spaces. The server can
- use this string to how to process the client's connection request.
- </doc>
- </field>
-
- <field name="insist" domain="bit" label="insist on connecting to server">
- <doc>
- In a configuration with multiple collaborating servers, the server may respond to a
- Connection.Open method with a Connection.Redirect. The insist option tells the server that
- the client is insisting on a connection to the specified server.
- </doc>
- <rule name="behaviour">
- <doc>
- When the client uses the insist option, the server MUST NOT respond with a
- Connection.Redirect method. If it cannot accept the client's connection request it
- should respond by closing the connection with a suitable reply code.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name="open-ok" synchronous="1" index="8" label="signal that connection is ready">
- <doc>
- This method signals to the client that the connection is ready for use.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <field name="known-hosts" domain="array" />
- </method>
-
- <method name="redirect" synchronous="1" index="9" label="redirects client to other server">
- <doc>
- This method redirects the client to another server, based on the requested virtual host
- and/or capabilities.
- </doc>
-
- <rule name="usage">
- <doc>
- When getting the Connection.Redirect method, the client SHOULD reconnect to the host
- specified, and if that host is not present, to any of the hosts specified in the
- known-hosts list.
- </doc>
- </rule>
-
- <chassis name="client" implement="MUST" />
-
- <field name="host" domain="shortstr" label="server to connect to">
- <doc>
- Specifies the server to connect to. This is an IP address or a DNS name, optionally
- followed by a colon and a port number. If no port number is specified, the client should
- use the default port number for the protocol.
- </doc>
- <assert check="notnull" />
- </field>
-
- <field name="known-hosts" domain="array" />
- </method>
-
-<method name = "heartbeat" index="10">
- <doc>new start-ok method</doc>
- <chassis name="server" implement="MUST" />
-</method>
-
- <!-- - Method: connection.close - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="close" synchronous="1" index="11" label="request a connection close">
- <doc>
- This method indicates that the sender wants to close the connection. This may be due to
- internal conditions (e.g. a forced shut-down) or due to an error handling a specific method,
- i.e. an exception. When a close is due to an exception, the sender provides the class and
- method id of the method which caused the exception.
- </doc>
- <!-- TODO: The connection close mechanism needs to be reviewed from the ODF documentation and
- better expressed as rules here. /PH 2006/07/20
- -->
-
- <rule name="stability">
- <doc>
- After sending this method any received method except the Close-OK method MUST be
- discarded.
- </doc>
- </rule>
-
- <chassis name="client" implement="MUST" />
- <chassis name="server" implement="MUST" />
-
- <response name="close-ok" />
-
- <field name="reply-code" domain="reply-code" />
- <field name="reply-text" domain="reply-text" />
- </method>
-
- <!-- - Method: connection.close-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="close-ok" synchronous="1" index="12" label="confirm a connection close">
- <doc>
- This method confirms a Connection.Close method and tells the recipient that it is safe to
- release resources for the connection and close the socket.
- </doc>
-
- <rule name="reporting">
- <doc>
- A peer that detects a socket closure without having received a Close-Ok handshake method
- SHOULD log the error.
- </doc>
- </rule>
-
- <chassis name="client" implement="MUST" />
- <chassis name="server" implement="MUST" />
- </method>
-
-
-</class>
-
-
-
-<class name = "session010" index = "2">
-
-<method name = "attach" index="1">
-
- <doc>blah, blah</doc>
- <chassis name="client" implement="MUST" />
- <chassis name="server" implement="MUST" />
-
- <response name="start-ok" />
-
- <field name="name" domain="mediumstr" label="blah">
- <doc>blah, blah</doc>
- </field>
-
- <field name="force" domain="bit" label="blah">
- <doc>blah, blah</doc>
- </field>
-
-</method>
-
-<method name = "attached" index="2">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="name" domain="mediumstr" label="blah">
- <doc>blah, blah</doc>
- </field>
-
-</method>
-
-<method name = "detach" index="3">
-
- <doc>blah, blah</doc>
- <chassis name="client" implement="MUST" />
- <chassis name="server" implement="MUST" />
-
- <response name="start-ok" />
-
- <field name="name" domain="mediumstr" label="blah">
- <doc>blah, blah</doc>
- </field>
-
-</method>
-
-<method name = "detached" index="4">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="name" domain="mediumstr" label="blah">
- <doc>blah, blah</doc>
- </field>
-
-
- <field name="detach-code" domain="octet" label="blah">
- <doc>blah, blah</doc>
- </field>
-
-</method>
-
-<method name = "request-timeout" index="5">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="timeout" domain="long" label="blah">
- <doc>blah, blah</doc>
- </field>
-</method>
-
-<method name = "timeout" index="6">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="timeout" domain="long" label="blah">
- <doc>blah, blah</doc>
- </field>
-</method>
-
-
-<method name = "command-point" index="7">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="command-id" domain="rfc1982-long" label="blah">
- <doc>blah, blah</doc>
- </field>
-
-
- <field name="command-offset" domain="longlong" label="blah">
- <doc>blah, blah</doc>
- </field>
-</method>
-
-<method name = "expected" index="8">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="commands" domain="sequence-set" label="blah">
- <doc>blah, blah</doc>
- </field>
-
- <field name="fragments" domain="array" label="blah">
- <doc>blah, blah</doc>
- </field>
-</method>
-
-<method name = "confirmed" index="9">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="commands" domain="sequence-set" label="blah">
- <doc>blah, blah</doc>
- </field>
-
- <field name="fragments" domain="array" label="blah">
- <doc>blah, blah</doc>
- </field>
-</method>
-
-<method name = "completed" index="10">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="commands" domain="sequence-set" label="blah">
- <doc>blah, blah</doc>
- </field>
-
- <field name="timely-reply" domain="bit" label="blah">
- <doc>blah, blah</doc>
- </field>
-</method>
-
-<method name = "known-completed" index="11">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="commands" domain="sequence-set" label="blah">
- <doc>blah, blah</doc>
- </field>
-</method>
-
-<method name = "flush" index="12">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="expected" domain="bit" label="blah">
- <doc>blah, blah</doc>
- </field>
- <field name="confirmed" domain="bit" label="blah">
- <doc>blah, blah</doc>
- </field>
- <field name="completed" domain="bit" label="blah">
- <doc>blah, blah</doc>
- </field>
-</method>
-
-<method name = "gap" index="13">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="commands" domain="sequence-set" label="blah">
- <doc>blah, blah</doc>
- </field>
-</method>
-
-</class>
-
-<class name="execution010" index="3">
- <method name = "sync" index="1">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
- </method>
- <method name = "result" index="2">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
- <field name="command-id" domain="command-id"/>
- <field name="value" domain="long-struct"/>
- </method>
- <method name = "exception" index="3">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
- <field name="error-code" domain="short"/>
- <field name="command-id" domain="long"/>
- <field name="class-code" domain="octet"/>
- <field name="command-code" domain="octet"/>
- <field name="field-index" domain="octet"/>
- <field name="description" domain="mediumstr"/>
- <field name="error-info" domain="table"/>
- </method>
-</class>
-
-<class name="message010" index="4">
- <doc>blah, blah</doc>
- <method name = "transfer" content="1" index="1">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
- <field name="destination" domain="shortstr"/>
- <field name="accept-mode" domain="octet"/>
- <field name="acquire-mode" domain="octet"/>
- </method>
- <method name = "accept" index="2">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
- <field name="commands" domain="sequence-set"/>
- </method>
- <method name = "reject" index="3">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
- <field name="commands" domain="sequence-set"/>
- <field name="code" domain="short"/>
- <field name="text" domain="shortstr"/>
- </method>
- <method name = "release" index="4">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="commands" domain="sequence-set"/>
- <field name="set-redelivered" domain="bit"/>
- </method>
- <method name = "acquire" index="5">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="transfers" domain="sequence-set"/>
- <result>
- <struct size="long" type="4">
- <field name="transfers" domain="sequence-set"/>
- </struct>
- </result>
- </method>
-
- <method name = "subscribe" index="7">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="queue" domain="shortstr"/>
- <field name="destination" domain="shortstr"/>
- <field name="accept-mode" domain="octet"/>
- <field name="acquire-mode" domain="octet"/>
- <field name="exclusive" domain="bit"/>
- <field name="resume-id" domain="mediumstr"/>
- <field name="resume-ttl" domain="longlong"/>
- <field name="arguments" domain="table"/>
- </method>
- <method name = "cancel" index="8">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="destination" domain="shortstr"/>
- </method>
- <method name = "set-flow-mode" index="9">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="destination" domain="shortstr"/>
- <field name="flow-mode" domain="octet"/>
- </method>
- <method name = "flow" index="10">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="destination" domain="shortstr"/>
- <field name="unit" domain="octet"/>
- <field name="value" domain="long"/>
- </method>
- <method name = "flush" index="11">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="destination" domain="shortstr"/>
- </method>
- <method name = "stop" index="12">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="destination" domain="shortstr"/>
- </method>
-</class>
-
-<class name="tx010" index="5">
- <doc>blah, blah</doc>
- <method name = "select" index="1">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- </method>
- <method name = "commit" index="2">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- </method>
- <method name = "rollback" index="3">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- </method>
-</class>
-
-<class name="dtx010" index="6">
- <doc>blah, blah</doc>
- <method name = "select" index="1">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- </method>
- <method name = "start" index="2">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="xid" domain="xid010"/>
- <field name="join" domain="bit"/>
- <field name="resume" domain="bit"/>
- <result>
- <struct size="long" pack="short" type="1">
- <field name="status" domain="short" />
- </struct>
- </result>
- </method>
- <method name = "end" index="3">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="xid" domain="xid010"/>
- <field name="fail" domain="bit"/>
- <field name="suspend" domain="bit"/>
- <result>
- <struct size="long" pack="short" type="1">
- <field name="status" domain="short" />
- </struct>
- </result>
- </method>
- <method name = "commit" index="4">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="xid" domain="xid010"/>
- <field name="one-phase" domain="bit"/>
- <result>
- <struct size="long" pack="short" type="1">
- <field name="status" domain="short" />
- </struct>
- </result>
- </method>
- <method name = "forget" index="5">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="xid" domain="xid010"/>
- </method>
- <method name = "get-timeout" index="6">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="xid" domain="xid010"/>
- <result>
- <struct size="long" pack="short" type="2">
- <field name="timeout" domain="long" />
- </struct>
- </result>
- </method>
- <method name = "prepare" index="7">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="xid" domain="xid010"/>
- <result>
- <struct size="long" pack="short" type="1">
- <field name="status" domain="short" />
- </struct>
- </result>
- </method>
- <method name = "recover" index="8">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <result>
- <struct size="long" pack="short" type="3">
- <field name="in-doubt" domain="array" />
- </struct>
- </result>
- </method>
- <method name = "rollback" index="9">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="xid" domain="xid010"/>
- <result>
- <struct size="long" pack="short" type="1">
- <field name="status" domain="short" />
- </struct>
- </result>
- </method>
- <method name = "set-timeout" index="10">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="xid" domain="xid010"/>
- <field name="timeout" domain="long"/>
- </method>
-</class>
-
-<class name="exchange010" index="7">
- <doc>blah, blah</doc>
- <method name = "declare" index="1">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="exchange" domain="shortstr"/>
- <field name="type" domain="shortstr"/>
- <field name="alternate-exchange" domain="shortstr"/>
- <field name="passive" domain="bit"/>
- <field name="durable" domain="bit"/>
- <field name="auto-delete" domain="bit"/>
- <field name="arguments" domain="table"/>
- </method>
- <method name = "delete" index="2">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="exchange" domain="shortstr"/>
- <field name="if-unused" domain="bit"/>
- </method>
- <method name = "query" index="3">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="name" domain="shortstr"/>
- <result>
- <struct size="long" type="1">
- <field name="type" domain="shortstr"/>
- <field name="durable" domain="bit"/>
- <field name="not-found" domain="bit"/>
- <field name="arguments" domain="table"/>
- </struct>
- </result>
- </method>
- <method name = "bind" index="4">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="queue" domain="shortstr"/>
- <field name="exchange" domain="shortstr"/>
- <field name="binding-key" domain="shortstr"/>
- <field name="arguments" domain="table"/>
- </method>
- <method name = "unbind" index="5">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="queue" domain="shortstr"/>
- <field name="exchange" domain="shortstr"/>
- <field name="binding-key" domain="shortstr"/>
- </method>
- <method name = "bound" index="6">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="exchange" domain="shortstr"/>
- <field name="queue" domain="shortstr"/>
- <field name="binding-key" domain="shortstr"/>
- <field name="arguments" domain="table"/>
- <result>
- <struct size="long" type="2">
- <field name="exchange-not-found" domain="bit"/>
- <field name="queue-not-found" domain="bit"/>
- <field name="queue-not-matched" domain="bit"/>
- <field name="key-not-matched" domain="bit"/>
- <field name="arguments-not-matched" domain="bit"/>
- </struct>
- </result>
- </method>
-</class>
-
-<class name="queue010" index="8">
- <doc>blah, blah</doc>
- <method name = "declare" index="1">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="queue" domain="shortstr"/>
- <field name="alternate-exchange" domain="shortstr"/>
- <field name="passive" domain="bit"/>
- <field name="durable" domain="bit"/>
- <field name="exclusive" domain="bit"/>
- <field name="auto-delete" domain="bit"/>
- <field name="arguments" domain="table"/>
- </method>
- <method name = "delete" index="2">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="queue" domain="shortstr"/>
- <field name="if-unused" domain="bit"/>
- <field name="if-empty" domain="bit"/>
- </method>
- <method name = "purge" index="3">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="queue" domain="shortstr"/>
- </method>
- <method name = "query" index="4">
- <doc>blah, blah</doc>
- <chassis name="server" implement="MUST" />
- <field name="queue" domain="shortstr"/>
- <result>
- <struct size="long" type="1">
- <field name="name" domain="shortstr"/>
- <field name="alternate-exchange" domain="shortstr"/>
- <field name="durable" domain="bit"/>
- <field name="exclusive" domain="bit"/>
- <field name="auto-delete" domain="bit"/>
- <field name="arguments" domain="table"/>
- <field name="message-count" domain="long"/>
- <field name="subscriber-count" domain="long"/>
- </struct>
- </result>
- </method>
-</class>
-
-</amqp>
diff --git a/M4-RCs/qpid/dotnet/LICENSE.txt b/M4-RCs/qpid/dotnet/LICENSE.txt
deleted file mode 100644
index 981d2f83c3..0000000000
--- a/M4-RCs/qpid/dotnet/LICENSE.txt
+++ /dev/null
@@ -1,757 +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.
-
-
-=========================================================================
-== Saxon XSLT License ==
-=========================================================================
-
-Mozilla Public License Version 1.0
-
-1. Definitions.
-
- 1.1. "Contributor" means each entity that creates or contributes
- to the creation of Modifications.
-
- 1.2. "Contributor Version" means the combination of the
- Original Code, prior Modifications used by a Contributor, and the
- Modifications made by that particular Contributor.
-
- 1.3. "Covered Code" means the Original Code or Modifications
- or the combination of the Original Code and Modifications, in each case
- including portions thereof.
-
- 1.4. "Electronic Distribution Mechanism" means a mechanism
- generally accepted in the software development community for the
- electronic transfer of data.
-
- 1.5. "Executable" means Covered Code in any form other than
- Source Code.
-
- 1.6. "Initial Developer" means the individual or entity
- identified as the Initial Developer in the Source Code notice required by
- Exhibit A.
-
- 1.7. "Larger Work" means a work which combines Covered Code
- or portions thereof with code not governed by the terms of this License.
-
- 1.8. "License" means this document.
-
- 1.9. "Modifications" means any addition to or deletion from
- the substance or structure of either the Original Code or any previous
- Modifications. When Covered Code is released as a series of files, a
- Modification is:
-
- A. Any addition to or deletion from the contents of a file
- containing Original Code or previous Modifications.
-
- B. Any new file that contains any part of the Original
- Code or previous Modifications.
-
- 1.10. "Original Code" means Source Code of computer software
- code which is described in the Source Code notice required by Exhibit
- A as Original Code, and which, at the time of its release under this
- License is not already Covered Code governed by this License.
-
- 1.11. "Source Code" means the preferred form of the Covered
- Code for making modifications to it, including all modules it contains,
- plus any associated interface definition files, scripts used to control
- compilation and installation of an Executable, or a list of source code
- differential comparisons against either the Original Code or another well
- known, available Covered Code of the Contributor's choice. The Source
- Code can be in a compressed or archival form, provided the appropriate
- decompression or de-archiving software is widely available for no charge.
-
- 1.12. "You" means an individual or a legal entity exercising
- rights under, and complying with all of the terms of, this License or a
- future version of this License issued under Section 6.1. For legal
- entities, "You" includes any entity which controls, is controlled by,
- or is under common control with You. For purposes of this definition,
- "control" means (a) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or otherwise,
- or (b) ownership of fifty percent (50%) or more of the outstanding shares
- or beneficial ownership of such entity.
-
-2. Source Code License.
-
- 2.1. The Initial Developer Grant.
-
-
- The Initial Developer hereby grants You a world-wide, royalty-free,
- non-exclusive license, subject to third party intellectual property
- claims:
-
- (a) to use, reproduce, modify, display, perform, sublicense
- and distribute the Original Code (or portions thereof) with or
- without Modifications, or as part of a Larger Work; and
-
- (b) under patents now or hereafter owned or controlled by
- Initial Developer, to make, have made, use and sell ("Utilize") the
- Original Code (or portions thereof), but solely to the extent that
- any such patent is reasonably necessary to enable You to Utilize the
- Original Code (or portions thereof) and not to any greater extent
- that may be necessary to Utilize further Modifications or
- combinations.
-
- 2.2. Contributor Grant.
-
-
- Each Contributor hereby grants You a world-wide, royalty-free,
- non-exclusive license, subject to third party intellectual property
- claims:
-
- (a) to use, reproduce, modify, display, perform, sublicense and
- distribute the Modifications created by such Contributor (or portions
- thereof) either on an unmodified basis, with other Modifications, as
- Covered Code or as part of a Larger Work; and
-
- (b) under patents now or hereafter owned or controlled by
- Contributor, to Utilize the Contributor Version (or portions thereof),
- but solely to the extent that any such patent is reasonably necessary to
- enable You to Utilize the Contributor Version (or portions thereof), and
- not to any greater extent that may be necessary to Utilize further
- Modifications or combinations.
-
-3. Distribution Obligations.
-
- 3.1. Application of License.
-
-
- The Modifications which You create or to which You contribute are
- governed by the terms of this License, including without limitation
- Section 2.2. The Source Code version of Covered Code may be
- distributed only under the terms of this License or a future version of
- this License released under Section 6.1, and You must include a
- copy of this License with every copy of the Source Code You
- distribute. You may not offer or impose any terms on any Source Code
- version that alters or restricts the applicable version of this License
- or the recipients' rights hereunder. However, You may include an
- additional document offering the additional rights described in Section
- 3.5.
-
- 3.2. Availability of Source Code.
-
-
- Any Modification which You create or to which You contribute must be
- made available in Source Code form under the terms of this License either
- on the same media as an Executable version or via an accepted Electronic
- Distribution Mechanism to anyone to whom you made an Executable version
- available; and if made available via Electronic Distribution Mechanism,
- must remain available for at least twelve (12) months after the date it
- initially became available, or at least six (6) months after a subsequent
- version of that particular Modification has been made available to such
- recipients. You are responsible for ensuring that the Source Code version
- remains available even if the Electronic Distribution Mechanism is
- maintained by a third party.
-
- 3.3. Description of Modifications.
-
-
- You must cause all Covered Code to which you contribute to contain a
- file documenting the changes You made to create that Covered Code and the
- date of any change. You must include a prominent statement that the
- Modification is derived, directly or indirectly, from Original Code
- provided by the Initial Developer and including the name of the Initial
- Developer in (a) the Source Code, and (b) in any notice in an Executable
- version or related documentation in which You describe the origin or
- ownership of the Covered Code.
-
- 3.4. Intellectual Property Matters
-
- (a) Third Party Claims.
-
-
- If You have knowledge that a party claims an intellectual
- property right in particular functionality or code (or its
- utilization under this License), you must include a text file with
- the source code distribution titled "LEGAL" which describes the
- claim and the party making the claim in sufficient detail that a
- recipient will know whom to contact. If you obtain such knowledge
- after You make Your Modification available as described in Section
- 3.2, You shall promptly modify the LEGAL file in all copies
- You make available thereafter and shall take other steps (such as
- notifying appropriate mailing lists or newsgroups) reasonably
- calculated to inform those who received the Covered Code that new
- knowledge has been obtained.
-
- (b) Contributor APIs.
-
-
- If Your Modification is an application programming interface and
- You own or control patents which are reasonably necessary to
- implement that API, you must also include this information in the
- LEGAL file.
-
- 3.5. Required Notices.
-
-
- You must duplicate the notice in Exhibit A in each file of the
- Source Code, and this License in any documentation for the Source Code,
- where You describe recipients' rights relating to Covered Code. If You
- created one or more Modification(s), You may add your name as a
- Contributor to the notice described in Exhibit A. If it is not
- possible to put such notice in a particular Source Code file due to its
- structure, then you must include such notice in a location (such as a
- relevant directory file) where a user would be likely to look for such a
- notice. You may choose to offer, and to charge a fee for, warranty,
- support, indemnity or liability obligations to one or more recipients of
- Covered Code. However, You may do so only on Your own behalf, and not on
- behalf of the Initial Developer or any Contributor. You must make it
- absolutely clear than any such warranty, support, indemnity or liability
- obligation is offered by You alone, and You hereby agree to indemnify the
- Initial Developer and every Contributor for any liability incurred by the
- Initial Developer or such Contributor as a result of warranty, support,
- indemnity or liability terms You offer.
-
- 3.6. Distribution of Executable Versions.
-
-
- You may distribute Covered Code in Executable form only if the
- requirements of Section 3.1-3.5 have been met for that Covered
- Code, and if You include a notice stating that the Source Code version of
- the Covered Code is available under the terms of this License, including
- a description of how and where You have fulfilled the obligations of
- Section 3.2. The notice must be conspicuously included in any
- notice in an Executable version, related documentation or collateral in
- which You describe recipients' rights relating to the Covered Code. You
- may distribute the Executable version of Covered Code under a license of
- Your choice, which may contain terms different from this License,
- provided that You are in compliance with the terms of this License and
- that the license for the Executable version does not attempt to limit or
- alter the recipient's rights in the Source Code version from the rights
- set forth in this License. If You distribute the Executable version under
- a different license You must make it absolutely clear that any terms
- which differ from this License are offered by You alone, not by the
- Initial Developer or any Contributor. You hereby agree to indemnify the
- Initial Developer and every Contributor for any liability incurred by the
- Initial Developer or such Contributor as a result of any such terms You
- offer.
-
- 3.7. Larger Works.
-
-
- You may create a Larger Work by combining Covered Code with other
- code not governed by the terms of this License and distribute the Larger
- Work as a single product. In such a case, You must make sure the
- requirements of this License are fulfilled for the Covered Code.
-
-4. Inability to Comply Due to Statute or Regulation.
-
- If it is impossible for You to comply with any of the terms of this
- License with respect to some or all of the Covered Code due to statute or
- regulation then You must: (a) comply with the terms of this License to
- the maximum extent possible; and (b) describe the limitations and the
- code they affect. Such description must be included in the LEGAL file
- described in Section 3.4 and must be included with all
- distributions of the Source Code. Except to the extent prohibited by
- statute or regulation, such description must be sufficiently detailed for
- a recipient of ordinary skill
- to be able to understand it.
-
-5. Application of this License.
-
- This License applies to code to which the Initial Developer has attached
- the notice in Exhibit A, and to related Covered Code.
-
-6. Versions of the License.
-
- 6.1. New Versions.
-
-
- Netscape Communications Corporation ("Netscape") may publish
- revised and/or new versions of the License from time to time. Each
- version will be given a distinguishing version number.
-
- 6.2. Effect of New Versions.
-
-
- Once Covered Code has been published under a particular version of
- the License, You may always continue to use it under the terms of that
- version. You may also choose to use such Covered Code under the terms of
- any subsequent version of the License published by Netscape. No one other
- than Netscape has the right to modify the terms applicable to Covered
- Code created under this License.
-
- 6.3. Derivative Works.
-
-
- If you create or use a modified version of this License (which you
- may only do in order to apply it to code which is not already Covered
- Code governed by this License), you must (a) rename Your license so that
- the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "NPL"
- or any confusingly similar phrase do not appear anywhere in your license
- and (b) otherwise make it clear that your version of the license contains
- terms which differ from the Mozilla Public License and Netscape Public
- License. (Filling in the name of the Initial Developer, Original Code or
- Contributor in the notice described in Exhibit A shall not of
- themselves be deemed to be modifications of this License.)
-
-7. DISCLAIMER OF WARRANTY.
-
- COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS,
- MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
- RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH
- YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE
- INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY
- NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
- CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE
- IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-8. TERMINATION.
-
- This License and the rights granted hereunder will terminate
- automatically if You fail to comply with terms herein and fail to cure
- such breach within 30 days of becoming aware of the breach. All
- sublicenses to the Covered Code which are properly granted shall survive
- any termination of this License. Provisions which, by their nature, must
- remain in effect beyond the termination of this License shall survive.
-
-9. LIMITATION OF LIABILITY.
-
- UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
- NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY
- OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF
- ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
- INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER
- INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK
- STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
- COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED
- OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL
- NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH
- PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
- LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION
- OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION
- MAY NOT APPLY TO YOU.
-
-10. U.S. GOVERNMENT END USERS.
-
- The Covered Code is a "commercial item," as that term is defined in 48
- C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software"
- and "commercial computer software documentation," as such terms are
- used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212
- and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all
- U.S. Government End Users acquire Covered Code with only those rights set
- forth herein.
-
-11. MISCELLANEOUS.
-
- This License represents the complete agreement concerning subject matter
- hereof. If any provision of this License is held to be unenforceable,
- such provision shall be reformed only to the extent necessary to make it
- enforceable. This License shall be governed by California law provisions
- (except to the extent applicable law, if any, provides otherwise),
- excluding its conflict-of-law provisions. With respect to disputes in
- which at least one party is a citizen of, or an entity chartered or
- registered to do business in, the United States of America: (a) unless
- otherwise agreed in writing, all disputes relating to this License
- (excepting any dispute relating to intellectual property rights) shall be
- subject to final and binding arbitration, with the losing party paying
- all costs of arbitration; (b) any arbitration relating to this Agreement
- shall be held in Santa Clara County, California, under the auspices of
- JAMS/EndDispute; and (c) any litigation relating to this Agreement shall
- be subject to the jurisdiction of the Federal Courts of the Northern
- District of California, with venue lying in Santa Clara County,
- California, with the losing party responsible for costs, including
- without limitation, court costs and reasonable attorneys fees and
- expenses. The application of the United Nations Convention on Contracts
- for the International Sale of Goods is expressly excluded. Any law or
- regulation which provides that the language of a contract shall be
- construed against the drafter shall not apply to this License.
-
-12. RESPONSIBILITY FOR CLAIMS.
-
- Except in cases where another Contributor has failed to comply with
- Section 3.4, You are responsible for damages arising, directly or
- indirectly, out of Your utilization of rights under this License, based
- on the number of copies of Covered Code you made available, the revenues
- you received from utilizing such rights, and other relevant factors. You
- agree to work with affected parties to distribute responsibility on an
- equitable basis.
-
-EXHIBIT A.
-
- "The contents of this file are subject to the Mozilla Public License
- Version 1.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.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- License for the specific language governing rights and limitations under
- the License.
-
- The Original Code is ______________________________________.
-
- The Initial Developer of the Original Code is
- ________________________. Portions created by ______________________ are
- Copyright (C) ______ _______________________. All Rights Reserved.
-
- Contributor(s): ______________________________________."
-
-
-=========================================================================
-== Nunit License ==
-=========================================================================
-Copyright (c) 2002 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
-Copyright (c) 2000-2002 Philip A. Craig
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
-
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
-
- 3. This notice may not be removed or altered from any source
- distribution.
-
-=========================================================================
-== Mentalis Security LibraryLicense ==
-=========================================================================
-
-Source Code License
-
-Copyright © 2002-2007, The Mentalis.org Team
-All rights reserved.
-http://www.mentalis.org/
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-- Neither the name of the Mentalis.org Team, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=========================================================================
-== AMQP License ==
-=========================================================================
-
- Copyright Notice
- ================
- (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc.,
- iMatix Corporation, IONA\ufffd Technologies, Red Hat, Inc.,
- TWIST Process Innovations, and 29West Inc. 2006. All rights reserved.
-
- License
- =======
- JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
- Corporation, IONA\ufffd Technologies, Red Hat, Inc., TWIST Process Innovations, and
- 29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide,
- perpetual, royalty-free, nontransferable, nonexclusive license to
- (i) copy, display, and implement the Advanced Messaging Queue Protocol
- ("AMQP") Specification and (ii) the Licensed Claims that are held by
- the Authors, all for the purpose of implementing the Advanced Messaging
- Queue Protocol Specification. Your license and any rights under this
- Agreement will terminate immediately without notice from
- any Author if you bring any claim, suit, demand, or action related to
- the Advanced Messaging Queue Protocol Specification against any Author.
- Upon termination, you shall destroy all copies of the Advanced Messaging
- Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or
- patent application, throughout the world, excluding design patents and
- design registrations, owned or controlled, or that can be sublicensed
- without fee and in compliance with the requirements of this
- Agreement, by an Author or its affiliates now or at any
- future time and which would necessarily be infringed by implementation
- of the Advanced Messaging Queue Protocol Specification. A claim is
- necessarily infringed hereunder only when it is not possible to avoid
- infringing it because there is no plausible non-infringing alternative
- for implementing the required portions of the Advanced Messaging Queue
- Protocol Specification. Notwithstanding the foregoing, Licensed Claims
- shall not include any claims other than as set forth above even if
- contained in the same patent as Licensed Claims; or that read solely
- on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging
- Queue Protocol Specification, or that, if licensed, would require a
- payment of royalties by the licensor to unaffiliated third parties.
- Moreover, Licensed Claims shall not include (i) any enabling technologies
- that may be necessary to make or use any Licensed Product but are not
- themselves expressly set forth in the Advanced Messaging Queue Protocol
- Specification (e.g., semiconductor manufacturing technology, compiler
- technology, object oriented technology, networking technology, operating
- system technology, and the like); or (ii) the implementation of other
- published standards developed elsewhere and merely referred to in the
- body of the Advanced Messaging Queue Protocol Specification, or
- (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced
- Messaging Queue Protocol Specification. For purposes of this definition,
- the Advanced Messaging Queue Protocol Specification shall be deemed to
- include both architectural and interconnection requirements essential
- for interoperability and may also include supporting source code artifacts
- where such architectural, interconnection requirements and source code
- artifacts are expressly identified as being required or documentation to
- achieve compliance with the Advanced Messaging Queue Protocol Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions
- of products (hardware, software or combinations thereof) that implement
- and are compliant with all relevant portions of the Advanced Messaging
- Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any
- use you may make of the Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS,"
- AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
- IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE
- CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE
- SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY
- PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
- USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE
- PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner,
- including advertising or publicity pertaining to the Advanced Messaging
- Queue Protocol Specification or its contents without specific, written
- prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you
- shall destroy all copies of the Advanced Messaging Queue Protocol
- Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the
- Octagon Symbol are trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA
- Technologies PLC and/or its subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered
- trademarks of Red Hat, Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of
- Sun Microsystems, Inc. in the United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service
- marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
diff --git a/M4-RCs/qpid/dotnet/NOTICE.txt b/M4-RCs/qpid/dotnet/NOTICE.txt
deleted file mode 100644
index 0b22ed3ab2..0000000000
--- a/M4-RCs/qpid/dotnet/NOTICE.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-=========================================================================
-== NOTICE file corresponding to the section 4 d of ==
-== the Apache License, Version 2.0, ==
-== in this case for the Apache Ant distribution. ==
-=========================================================================
-
-Apache Qpid.NET
-Copyright 2006 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software developed by:
-
- - The SAXON XSLT Processor from Michael Kay distributed under the Mozilla
- Public License v1.0, which is available for download at
- http://saxon.sourceforge.net/
-
- - The nunit library, Copyright © 2002 James W. Newkirk, Michael C. Two,
- Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig. Available
- under terms based on the zlib/libpng licence. Available from
- http://www.nunit.org/
-
- - The Mentalis Security Library, Copyright © 2002-2006, , The Mentalis.org Team
- under tterms based on the BSD license (http://www.mentalis.org/site/license.qpx).
- Available from http://www.mentalis.org/soft/projects/seclib/
-
-This product includes software, Apache Log4Net
-(http://logging.apache.org/log4net)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index 3802708cf4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-
- 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.Buffer.Tests")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.Buffer.Tests")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("9d967d0b-9454-4f00-8f53-fa86fd62b696")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj b/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj
deleted file mode 100644
index 72d3ccc82f..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj
+++ /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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{74640962-99D0-4D06-B57A-9CD66517CF52}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Buffer.Tests</RootNamespace>
- <AssemblyName>Apache.Qpid.Buffer.Tests</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <UseVSHostingProcess>true</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\bin\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Qpid.Client.Tests\lib\nunit\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Buffer\Qpid.Buffer.csproj">
- <Project>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</Project>
- <Name>Qpid.Buffer</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/SimpleByteBufferTests.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/SimpleByteBufferTests.cs
deleted file mode 100644
index 9af8801627..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/SimpleByteBufferTests.cs
+++ /dev/null
@@ -1,333 +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 NUnit.Framework;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Buffer.Tests
-{
- /// <summary>
- /// Tests for the SimpleByteBuffer class
- /// </summary>
- [TestFixture]
- public class SimpleByteBufferTests
- {
- [Test]
- public void CanCreateNewBuffer()
- {
- const int size = 10;
- ByteBuffer buffer = ByteBuffer.Allocate(size);
- Assert.AreEqual(size, buffer.Capacity);
- Assert.AreEqual(0, buffer.Position);
- Assert.AreEqual(size, buffer.Remaining);
- Assert.AreEqual(true, buffer.HasRemaining);
- }
-
- [Test]
- public void CanWrapArray()
- {
- byte[] array = new byte[10];
- for ( int i=0; i < array.Length; i++ )
- {
- array[i] = (byte) i;
- }
- ByteBuffer buffer = ByteBuffer.Wrap(array);
- // the buffer should be the same size,
- // and positioned at the end
- Assert.AreEqual(array.Length, buffer.Capacity);
- Assert.AreEqual(array.Length, buffer.Position);
- Assert.AreEqual(array.Length, buffer.Limit);
- }
-
- #region Base Read/Write tests
- //
- // Base Read/Write tests
- //
- [Test]
- public void CanReadWriteBytes()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03);
- buffer.Rewind();
- Assert.AreEqual(0x01, buffer.GetByte());
- Assert.AreEqual(0x02, buffer.GetByte());
- Assert.AreEqual(0x03, buffer.GetByte());
- }
-
- [Test]
- [ExpectedException(typeof(BufferUnderflowException))]
- public void ThrowOnReadByteWithNoSpace()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(1);
- buffer.Put((byte)0x01);
- buffer.GetByte();
- }
-
- [Test]
- [ExpectedException(typeof(BufferOverflowException))]
- public void ThrowOnWriteByteWithNoSpace()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(1);
- buffer.Put((byte)0x01).Put((byte)0x02);
- }
-
- #endregion Base Read/Write tests
-
- #region Other Buffer Operations
- //
- // Other Buffer Operations
- //
-
- [Test]
- public void CanFlipBuffer()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03);
- buffer.Flip();
- Assert.AreEqual(10, buffer.Capacity);
- Assert.AreEqual(3, buffer.Limit);
- Assert.AreEqual(0, buffer.Position);
- Assert.AreEqual(3, buffer.Remaining);
- }
-
- [Test]
- public void CanCompactBuffer()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03);
- buffer.Flip();
- buffer.Position = 1;
- buffer.Compact();
- Assert.AreEqual(10, buffer.Capacity);
- Assert.AreEqual(10, buffer.Limit);
- Assert.AreEqual(2, buffer.Position);
- Assert.AreEqual(8, buffer.Remaining);
- buffer.Rewind();
- Assert.AreEqual((byte)0x02, buffer.GetByte());
- Assert.AreEqual((byte)0x03, buffer.GetByte());
- }
-
- [Test]
- public void CanClearBuffer()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03);
- buffer.Flip();
- buffer.Position = 2;
- buffer.Clear();
- Assert.AreEqual(10, buffer.Capacity);
- Assert.AreEqual(10, buffer.Limit);
- Assert.AreEqual(0, buffer.Position);
- Assert.AreEqual(10, buffer.Remaining);
- }
-
- [Test]
- public void CanExpandBuffer()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03);
- buffer.Flip();
- buffer.Position = 2;
- int pos = buffer.Position;
- buffer.Expand(20);
-
- Assert.AreEqual(pos, buffer.Position);
- Assert.IsTrue(buffer.Remaining >= 20);
- buffer.Rewind();
- Assert.AreEqual(0x01, buffer.GetByte());
- }
-
- [Test]
- public void CanAutoExpand()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(2);
- buffer.IsAutoExpand = true;
- // should cause autoexpand
- buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03);
- Assert.IsTrue(buffer.Capacity > 2);
- }
-
- [Test]
- public void CanGetArray()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- buffer.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03);
- buffer.Flip();
-
- byte[] array = buffer.Array;
- for ( int i=0; i < buffer.Limit; i++ )
- {
- Assert.AreEqual(buffer.GetByte(), array[i]);
- }
- }
-
- [Test]
- public void CanSkip()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- buffer.Skip(4);
- Assert.AreEqual(4, buffer.Position);
- }
-
- #endregion // Base Read/Write tests
-
- #region Typed Accessors
- //
- // Typed Accessors
- //
- [Test]
- public void CanReadWriteSByte()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- sbyte value = -12;
- buffer.Put(value);
- buffer.Flip();
- Assert.AreEqual(value, buffer.GetSByte());
- }
- [Test]
- public void CanReadWriteUInt16()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- ushort value = 41233;
- buffer.Put(value);
- buffer.Flip();
- Assert.AreEqual(value, buffer.GetUInt16());
- }
- [Test]
- public void CanReadWriteInt16()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- short value = -21233;
- buffer.Put(value);
- buffer.Flip();
- Assert.AreEqual(value, buffer.GetInt16());
- }
- [Test]
- public void CanReadWriteUInt32()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- uint value = 41233211;
- buffer.Put(value);
- buffer.Flip();
- Assert.AreEqual(value, buffer.GetUInt32());
- }
- [Test]
- public void CanReadWriteInt32()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- int value = -22221233;
- buffer.Put(value);
- buffer.Flip();
- Assert.AreEqual(value, buffer.GetInt32());
- }
- [Test]
- public void CanReadWriteUInt64()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- ulong value = 41233218871;
- buffer.Put(value);
- buffer.Flip();
- Assert.AreEqual(value, buffer.GetUInt64());
- }
- [Test]
- public void CanReadWriteInt64()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- long value = -9887335411;
- buffer.Put(value);
- buffer.Flip();
- Assert.AreEqual(value, buffer.GetInt64());
- }
- [Test]
- public void CanReadWriteFloat()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- float value = -1.2331f;
- buffer.Put(value);
- buffer.Flip();
- Assert.AreEqual(value, buffer.GetFloat());
- }
-
- [Test]
- public void CanReadWriteDouble()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- double value = -1.2331E12;
- buffer.Put(value);
- buffer.Flip();
- Assert.AreEqual(value, buffer.GetDouble());
- }
-
- [Test]
- public void CanReadWriteChar()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- char value = 'H';
- buffer.Put(value);
- buffer.Flip();
- Assert.AreEqual(value, buffer.GetChar());
- }
-
- [Test]
- public void CanReadWriteByteArray()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- buffer.Put(new byte[] { 0x01, 0x02, 0x03});
- buffer.Flip();
- byte[] data = new byte[3];
- buffer.GetBytes(data);
- Assert.AreEqual(0x01, data[0]);
- Assert.AreEqual(0x02, data[1]);
- Assert.AreEqual(0x03, data[2]);
- }
-
- [Test]
- public void CanReadWriteByteArrayWithOffset()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(10);
- buffer.Put(new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05 }, 1, 4);
- buffer.Flip();
- byte[] data = new byte[3];
- buffer.GetBytes(data, 2, 1);
- Assert.AreEqual(0x00, data[0]);
- Assert.AreEqual(0x00, data[1]);
- Assert.AreEqual(0x02, data[2]);
- }
-
- [Test]
- public void CanWriteByteBuffer()
- {
- ByteBuffer buffer1 = ByteBuffer.Allocate(10);
- buffer1.Put((byte)0x01).Put((byte)0x02).Put((byte)0x03);
- buffer1.Flip();
-
- ByteBuffer buffer2 = ByteBuffer.Allocate(10);
- buffer2.Put(buffer1);
- buffer2.Flip();
- Assert.AreEqual(buffer1.Limit, buffer2.Limit);
- Assert.AreEqual(0x01, buffer2.GetByte());
- }
- #endregion // Typed Accessors
-
- } // class SimpleByteBufferTests
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/SlicedByteBufferTests.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/SlicedByteBufferTests.cs
deleted file mode 100644
index 071aa23830..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/SlicedByteBufferTests.cs
+++ /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.
- *
- */
-
-using System;
-using NUnit.Framework;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Buffer.Tests
-{
- /// <summary>
- /// Tests for the SlicedByteBuffer class
- /// </summary>
- [TestFixture]
- public class SlicedByteBufferTests
- {
- private ByteBuffer _baseBuffer;
-
- [SetUp]
- public void Setup()
- {
- const int size = 50;
- _baseBuffer = ByteBuffer.Allocate(size);
- for ( byte b = 0; b < 10; b++ )
- {
- _baseBuffer.Put(b);
- }
- _baseBuffer.Flip();
- }
-
- [Test]
- public void CanSliceBuffer()
- {
- _baseBuffer.Position = 5;
-
- ByteBuffer slice = _baseBuffer.Slice();
- Assert.AreEqual(5, slice.Capacity);
- Assert.AreEqual(0, slice.Position);
- Assert.AreEqual(5, slice.Remaining);
- Assert.AreEqual(5, slice.Limit);
- }
-
- [Test]
- public void CanReadWriteSlice()
- {
- _baseBuffer.Position = 5;
-
- ByteBuffer slice = _baseBuffer.Slice();
- slice.Put((byte) 0xFF).Put((byte) 0xF0).Put((byte) 0xA0);
- slice.Flip();
-
- Assert.AreEqual(3, slice.Limit);
- Assert.AreEqual(0xFF, slice.GetByte());
- Assert.AreEqual(0xF0, slice.GetByte());
- Assert.AreEqual(0xA0, slice.GetByte());
- }
-
- [Test]
- public void WriteModifiesBaseBufferOnCorrectPosition()
- {
- _baseBuffer.Position = 5;
-
- ByteBuffer slice = _baseBuffer.Slice();
- slice.Put((byte) 0xFF);
- slice.Flip();
- // reading the _baseBuffer at position 5 should yield 0xFF
- _baseBuffer.Position = 5;
- Assert.AreEqual(0xFF, _baseBuffer.GetByte());
-
- }
-
- [Test]
- public void CanReadWriteByteArray()
- {
- _baseBuffer.Position = 5;
-
- ByteBuffer slice = _baseBuffer.Slice();
- byte[] data = {0xFF, 0xF0, 0xF2, 0xEE, 0x23};
- slice.Put(data, 2, 2);
- slice.Flip();
-
- Assert.AreEqual(2, slice.Limit);
- Assert.AreEqual(0xF2, slice.GetByte());
- Assert.AreEqual(0xEE, slice.GetByte());
- }
-
- [Test]
- [ExpectedException(typeof(BufferOverflowException))]
- public void ThrowWhenWritePastLimit()
- {
- _baseBuffer.Position = 5;
-
- ByteBuffer slice = _baseBuffer.Slice();
- slice.Put(0x01).Put(0x02);
- }
-
-
- [Test]
- [ExpectedException(typeof(NotSupportedException))]
- public void ThrowOnCompact()
- {
- // we don't support compacting
- ByteBuffer slice = _baseBuffer.Slice();
- slice.Compact();
- }
-
- [Test]
- [ExpectedException(typeof(NotSupportedException))]
- public void ThrowOnResize()
- {
- // we don't support resizing
- ByteBuffer slice = _baseBuffer.Slice();
- slice.Expand(50);
- }
- } // class SlicedByteBufferTests
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/default.build b/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/default.build
deleted file mode 100644
index 77e95fb9d9..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer.Tests/default.build
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Apache.Qpid.Buffer" default="test">
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- warnaserror="true" debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.Tests.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/nunit.framework.dll" />
- <include name="${build.dir}/${project::get-name()}.dll" />
- </references>
-
- </csc>
- </target>
- <target name="test" depends="build">
- <nunit2>
- <formatter type="${nant.formatter}" usefile="false" />
- <test assemblyname="${build.dir}/${project::get-name()}.Tests.dll" />
- </nunit2>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs
deleted file mode 100644
index 5a2fff74a7..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer/BufferOverflowException.cs
+++ /dev/null
@@ -1,41 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Buffer
-{
- [Serializable]
- public class BufferOverflowException : Exception
- {
- public BufferOverflowException(string message) : base(message)
- {
- }
-
- protected BufferOverflowException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs
deleted file mode 100644
index 13939b77a8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer/BufferUnderflowException.cs
+++ /dev/null
@@ -1,42 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Buffer
-{
- [Serializable]
- public class BufferUnderflowException : Exception
- {
- public BufferUnderflowException(string message)
- : base(message)
- {
- }
-
- protected BufferUnderflowException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer/ByteBuffer.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer/ByteBuffer.cs
deleted file mode 100644
index 67f0edd440..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer/ByteBuffer.cs
+++ /dev/null
@@ -1,982 +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;
-
-namespace Apache.Qpid.Buffer
-{
- /// <summary>
- /// Abstract class implementing a byte buffer
- /// </summary>
- public abstract class ByteBuffer
- {
- private int _position;
- private int _limit;
- private bool _isAutoExpand;
- private static IByteBufferAllocator _allocator =
- new SimpleByteBufferAllocator();
-
- #region Properties
- //
- // Properties
- //
-
- /// <summary>
- /// The maximum number of bytes the buffer can hold
- /// </summary>
- public abstract int Capacity
- {
- get;
- }
-
- /// <summary>
- /// Return the backing array of this buffer
- /// </summary>
- public abstract byte[] Array
- {
- get;
- }
-
- /// <summary>
- /// The current position inside this buffer
- /// </summary>
- public int Position
- {
- get { return _position; }
- set { Seek(value); }
- }
-
- /// <summary>
- /// Index of the first element that should not be read or written.
- /// A buffer's limit is never negative and is never greater than the its capacity.
- /// </summary>
- public int Limit
- {
- get { return _limit; }
- set { SetLimit(value); }
- }
-
- /// <summary>
- /// Number of bytes remaining in the buffer from the current position
- /// </summary>
- public int Remaining
- {
- get { return Limit - Position; }
- }
-
- /// <summary>
- /// True if there are bytes remaining in the buffer
- /// </summary>
- public bool HasRemaining
- {
- get { return Remaining > 0; }
- }
-
- /// <summary>
- /// If true, the buffer will be resized as necessary
- /// to allow space for writing. By default is false.
- /// </summary>
- public bool IsAutoExpand
- {
- get { return _isAutoExpand; }
- set { _isAutoExpand = value; }
- }
-
- #endregion // Properties
-
- #region Buffer Manipulation
- //
- // Buffer Manipulation
- //
-
- /// <summary>
- /// Move the buffer to Position 0
- /// </summary>
- /// <returns>This instance</returns>
- public ByteBuffer Rewind()
- {
- Seek(0);
- return this;
- }
-
- /// <summary>
- /// Prepare the buffer to read back what's been written
- /// </summary>
- /// <returns>This instance</returns>
- public ByteBuffer Flip()
- {
- Limit = Position;
- Position = 0;
- return this;
- }
-
- /// <summary>
- /// Compact this buffer.
- /// </summary>
- /// <returns>This instance</returns>
- /// <remarks>
- /// The bytes between the buffer's current position and its limit, if any,
- /// are copied to the beginning of the buffer.
- /// </remarks>
- public ByteBuffer Compact()
- {
- DoCompact();
- return this;
- }
-
- /// <summary>
- /// Clears this buffer. The position is set to zero, the limit is set to the capacity
- /// </summary>
- /// <returns>This instance</returns>
- public ByteBuffer Clear()
- {
- Limit = Capacity;
- Position = 0;
- return this;
- }
-
- /// <summary>
- /// Expands this buffer's capacity so that
- /// Remaining == expectedRemaining
- /// </summary>
- /// <param name="expectedRemaining">Number of bytes that should be accessable after resizing</param>
- /// <returns>This instance</returns>
- public ByteBuffer Expand(int expectedRemaining)
- {
- return Expand(Position, expectedRemaining);
- }
-
- /// <summary>
- /// Expands this buffer's capacity so that
- /// Remaining == expectedRemaining
- /// </summary>
- /// <param name="position">Position from which to start the resize</param>
- /// <param name="expectedRemaining">Number of bytes that should be accessable after resizing</param>
- /// <returns>This instance</returns>
- public ByteBuffer Expand(int position, int expectedRemaining)
- {
- if ( expectedRemaining <= 0 )
- throw new ArgumentException("expectedRemaining must be greater than 0");
-
- int end = position + expectedRemaining;
- if ( end > Capacity )
- {
- DoResize(end);
- }
- if ( end > Limit )
- Limit = end;
- return this;
- }
-
- /// <summary>
- /// Creates a new byte buffer whose content is a shared
- /// subsequence of this buffer's content.
- /// </summary>
- /// <remarks>
- /// The content of the new buffer will start at this buffer's current position.
- /// Changes to this buffer's content will be visible in the new buffer,
- /// and vice versa; the two buffers' position and limit values will be independent.
- /// <para>
- /// The new buffer's position will be zero, its capacity and its limit will
- /// be the number of bytes remaining in this buffer.
- /// </para>
- /// </remarks>
- /// <returns>A view on top of this instance</returns>
- public ByteBuffer Slice()
- {
- return new SlicedByteBuffer(this);
- }
-
- /// <summary>
- /// Skip the specified number of bytes
- /// </summary>
- /// <param name="numBytes">Number of bytes to move forward by</param>
- /// <returns>This instance</returns>
- public ByteBuffer Skip(int numBytes)
- {
- Position += numBytes;
- return this;
- }
-
- /// <summary>
- /// Acquire this buffer to keep it alive.
- /// </summary>
- public virtual void Acquire()
- {
- // override in subclass if supported
- }
-
- /// <summary>
- /// Release this buffer instance
- /// </summary>
- public virtual void Release()
- {
- // override in subclass if supported
- }
-
- /// <summary>
- /// Return a string with a Hex Dump of this buffer's contents
- /// </summary>
- /// <returns>The hex dump</returns>
- public string GetHexDump()
- {
- return ByteBufferHexDumper.GetHexDump(this);
- }
-
- public override string ToString()
- {
- return GetHexDump();
- }
- #endregion // Buffer Manipulation
-
- #region Static Operations
- //
- // Static Operations
- //
- /// <summary>
- /// Replaces the default allocator with your own implementation
- /// </summary>
- /// <param name="allocator">New allocator</param>
- public static void SetAllocator(IByteBufferAllocator allocator)
- {
- if ( allocator == null )
- throw new ArgumentNullException("allocator");
- _allocator = allocator;
- }
-
- /// <summary>
- /// Allocate a new buffer with the specified capacity
- /// using the default allocator
- /// </summary>
- /// <param name="capacity">Desired capacity</param>
- /// <returns>The new buffer</returns>
- public static ByteBuffer Allocate(int capacity)
- {
- return _allocator.Allocate(capacity);
- }
-
- /// <summary>
- /// Wraps the specified arrat into a new buffer
- /// </summary>
- /// <param name="buffer"></param>
- /// <returns></returns>
- public static ByteBuffer Wrap(byte[] buffer)
- {
- return _allocator.Wrap(buffer);
- }
- #endregion // Static Operations
-
- #region Data Accessors
- //
- // Data Accessors
- //
-
- // Byte Stuff
-
- /// <summary>
- /// Read the next byte in the buffer
- /// </summary>
- /// <returns>The next byte available</returns>
- public byte GetByte()
- {
- byte value = GetByte(Position);
- Position += 1;
- return value;
- }
- /// <summary>
- /// Read the byte at the specified position
- /// </summary>
- /// <param name="position">Position to read from</param>
- /// <returns>The value at the position</returns>
- public byte GetByte(int position)
- {
- CheckSpaceForReading(position, 1);
- return ReadByte(position);
- }
- /// <summary>
- /// Write a byte at the current position
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(byte value)
- {
- Put(Position, value);
- Position++;
- return this;
- }
- /// <summary>
- /// Write a byte at the specified position
- /// </summary>
- /// <param name="position">Position to write to</param>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int position, byte value)
- {
- CheckSpaceForWriting(position, 1);
- Write(position, value);
- return this;
- }
-
- // SByte Stuff
-
- /// <summary>
- /// Read the next signed byte in the buffer
- /// </summary>
- /// <returns>The next signed byte available</returns>
- public sbyte GetSByte()
- {
- sbyte value = GetSByte(Position);
- Position += 1;
- return value;
- }
- /// <summary>
- /// Read the signed byte at the specified position
- /// </summary>
- /// <param name="position">Position to read from</param>
- /// <returns>The value at the position</returns>
- public sbyte GetSByte(int position)
- {
- CheckSpaceForReading(position, 1);
- return (sbyte)ReadByte(position);
- }
-
- /// <summary>
- /// Write a signed byte at the current position
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(sbyte value)
- {
- Put(Position, value);
- Position += 1;
- return this;
- }
-
- /// <summary>
- /// Write a signed byte at the specified position
- /// </summary>
- /// <param name="position">Position to write to</param>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int position, sbyte value)
- {
- CheckSpaceForWriting(position, 1);
- Write(position, (byte)value);
- return this;
- }
-
- // UInt16 Stuff
-
- /// <summary>
- /// Read the next uint16 in the buffer
- /// </summary>
- /// <returns>The next uint16 available</returns>
- public ushort GetUInt16()
- {
- ushort value = GetUInt16(Position);
- Position += 2;
- return value;
- }
- /// <summary>
- /// Read the uint16 at the specified position
- /// </summary>
- /// <param name="position">Position to read from</param>
- /// <returns>The value at the position</returns>
- public ushort GetUInt16(int position)
- {
- CheckSpaceForReading(position, 2);
- byte upper = ReadByte(position);
- byte lower = ReadByte(position+1);
- return (ushort)(((ushort)upper << 8) + lower);
- }
-
- /// <summary>
- /// Write a uint16 at the current position
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(ushort value)
- {
- Put(Position, value);
- Position += 2;
- return this;
- }
-
- /// <summary>
- /// Write a uint16 at the specified position
- /// </summary>
- /// <param name="position">Position to write to</param>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int position, ushort value)
- {
- CheckSpaceForWriting(position, 2);
- Write(position, (byte)(value >> 8));
- Write(position+1, (byte)(value));
- return this;
- }
-
- // Int16 Stuff
-
- /// <summary>
- /// Read the next int16 in the buffer
- /// </summary>
- /// <returns>The next int16 available</returns>
- public short GetInt16()
- {
- return (short) GetUInt16();
- }
- /// <summary>
- /// Read the int16 at the specified position
- /// </summary>
- /// <param name="position">Position to read from</param>
- /// <returns>The value at the position</returns>
- public short GetInt16(int position)
- {
- return (short)GetUInt16(position);
- }
-
- /// <summary>
- /// Write a int16 at the current position
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(short value)
- {
- return Put((ushort) value);
- }
-
- /// <summary>
- /// Write a int16 at the specified position
- /// </summary>
- /// <param name="position">Position to write to</param>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int position, short value)
- {
- return Put(position, (ushort)value);
- }
-
-
- // UInt32 Stuff
-
- /// <summary>
- /// Read the next uint32 in the buffer
- /// </summary>
- /// <returns>The next uint32 available</returns>
- public uint GetUInt32()
- {
- uint value = GetUInt32(Position);
- Position += 4;
- return value;
- }
- /// <summary>
- /// Read the uint32 at the specified position
- /// </summary>
- /// <param name="position">Position to read from</param>
- /// <returns>The value at the position</returns>
- public uint GetUInt32(int position)
- {
- CheckSpaceForReading(position, 4);
- byte b1 = ReadByte(position);
- byte b2 = ReadByte(position + 1);
- byte b3 = ReadByte(position + 2);
- byte b4 = ReadByte(position + 3);
- return (uint)((b1 << 24) + (b2 << 16) + (b3 << 8) + b4);
- }
-
- /// <summary>
- /// Write a uint32 at the current position
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(uint value)
- {
- Put(Position, value);
- Position += 4;
- return this;
- }
-
- /// <summary>
- /// Write a uint32 at the specified position
- /// </summary>
- /// <param name="position">Position to write to</param>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int position, uint value)
- {
- CheckSpaceForWriting(position, 4);
- Write(position, (byte)(value >> 24));
- Write(position + 1, (byte)(value >> 16));
- Write(position + 2, (byte)(value >> 8));
- Write(position + 3, (byte)(value));
- return this;
- }
-
- // Int32 Stuff
-
- /// <summary>
- /// Read the next int32 in the buffer
- /// </summary>
- /// <returns>The next int32 available</returns>
- public int GetInt32()
- {
- return (int)GetUInt32();
- }
- /// <summary>
- /// Read the int32 at the specified position
- /// </summary>
- /// <param name="position">Position to read from</param>
- /// <returns>The value at the position</returns>
- public int GetInt32(int position)
- {
- return (int)GetUInt32(position);
- }
-
- /// <summary>
- /// Write a int32 at the current position
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int value)
- {
- return Put((uint)value);
- }
-
- /// <summary>
- /// Write a int32 at the specified position
- /// </summary>
- /// <param name="position">Position to write to</param>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int position, int value)
- {
- return Put(position, (uint)value);
- }
-
- // UInt64 Stuff
-
- /// <summary>
- /// Read the next uint64 in the buffer
- /// </summary>
- /// <returns>The next uint64 available</returns>
- public ulong GetUInt64()
- {
- ulong value = GetUInt64(Position);
- Position += 8;
- return value;
- }
- /// <summary>
- /// Read the uint64 at the specified position
- /// </summary>
- /// <param name="position">Position to read from</param>
- /// <returns>The value at the position</returns>
- public ulong GetUInt64(int position)
- {
- CheckSpaceForReading(position, 8);
- byte b1 = ReadByte(position);
- byte b2 = ReadByte(position + 1);
- byte b3 = ReadByte(position + 2);
- byte b4 = ReadByte(position + 3);
- byte b5 = ReadByte(position + 4);
- byte b6 = ReadByte(position + 5);
- byte b7 = ReadByte(position + 6);
- byte b8 = ReadByte(position + 7);
- // all the casts necessary because otherwise each subexpression
- // only gets promoted to uint and cause incorrect results
- return (((ulong)b1 << 56) + ((ulong)b2 << 48) + ((ulong)b3 << 40) +
- ((ulong)b4 << 32) + ((ulong)b5 << 24) +
- ((ulong)b6 << 16) + ((ulong)b7 << 8) + b8);
- }
-
- /// <summary>
- /// Write a uint64 at the current position
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(ulong value)
- {
- Put(Position, value);
- Position += 8;
- return this;
- }
-
- /// <summary>
- /// Write a uint64 at the specified position
- /// </summary>
- /// <param name="position">Position to write to</param>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int position, ulong value)
- {
- CheckSpaceForWriting(position, 8);
- Write(position, (byte)(value >> 56));
- Write(position + 1, (byte)(value >> 48));
- Write(position + 2, (byte)(value >> 40));
- Write(position + 3, (byte)(value >> 32));
- Write(position + 4, (byte)(value >> 24));
- Write(position + 5, (byte)(value >> 16));
- Write(position + 6, (byte)(value >> 8));
- Write(position + 7, (byte)(value));
- return this;
- }
-
- // Int64 Stuff
-
- /// <summary>
- /// Read the next int64 in the buffer
- /// </summary>
- /// <returns>The next int64 available</returns>
- public long GetInt64()
- {
- return (long)GetUInt64();
- }
- /// <summary>
- /// Read the int64 at the specified position
- /// </summary>
- /// <param name="position">Position to read from</param>
- /// <returns>The value at the position</returns>
- public long GetInt64(int position)
- {
- return (long)GetUInt64(position);
- }
-
- /// <summary>
- /// Write a int64 at the current position
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(long value)
- {
- return Put((ulong)value);
- }
-
- /// <summary>
- /// Write a int64 at the specified position
- /// </summary>
- /// <param name="position">Position to write to</param>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int position, long value)
- {
- return Put(position, (ulong)value);
- }
-
-
- // Float Stuff
-
- /// <summary>
- /// Read the next float in the buffer
- /// </summary>
- /// <returns>The next float available</returns>
- public float GetFloat()
- {
- unsafe
- {
- uint val = GetUInt32();
- return *((float*)&val);
- }
- }
- /// <summary>
- /// Read the float at the specified position
- /// </summary>
- /// <param name="position">Position to read from</param>
- /// <returns>The value at the position</returns>
- public float GetFloat(int position)
- {
- unsafe
- {
- uint val = GetUInt32(position);
- return *((float*)&val);
- }
- }
-
- /// <summary>
- /// Write a float at the current position
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(float value)
- {
- unsafe
- {
- uint val = *((uint*)&value);
- return Put(val);
- }
- }
-
- /// <summary>
- /// Write a float at the specified position
- /// </summary>
- /// <param name="position">Position to write to</param>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int position, float value)
- {
- unsafe
- {
- uint val = *((uint*)&value);
- return Put(position, val);
- }
- }
-
- // Double Stuff
-
- /// <summary>
- /// Read the next double in the buffer
- /// </summary>
- /// <returns>The next double available</returns>
- public double GetDouble()
- {
- unsafe
- {
- ulong val = GetUInt64();
- return *((double*)&val);
- }
- }
- /// <summary>
- /// Read the double at the specified position
- /// </summary>
- /// <param name="position">Position to read from</param>
- /// <returns>The value at the position</returns>
- public double GetDouble(int position)
- {
- unsafe
- {
- ulong val = GetUInt64(position);
- return *((double*)&val);
- }
- }
-
- /// <summary>
- /// Write a double at the current position
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(double value)
- {
- unsafe
- {
- ulong val = *((ulong*)&value);
- return Put(val);
- }
- }
-
- /// <summary>
- /// Write a double at the specified position
- /// </summary>
- /// <param name="position">Position to write to</param>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int position, double value)
- {
- unsafe
- {
- ulong val = *((ulong*)&value);
- return Put(position, val);
- }
- }
-
- // Char Stuff
-
- /// <summary>
- /// Read the next char in the buffer
- /// </summary>
- /// <returns>The next char available</returns>
- public char GetChar()
- {
- return (char)GetUInt16();
- }
- /// <summary>
- /// Read the char at the specified position
- /// </summary>
- /// <param name="position">Position to read from</param>
- /// <returns>The value at the position</returns>
- public char GetChar(int position)
- {
- return (char)GetUInt16(position);
- }
-
- /// <summary>
- /// Write a char at the current position
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(char value)
- {
- return Put((ushort) value);
- }
-
- /// <summary>
- /// Write a char at the specified position
- /// </summary>
- /// <param name="position">Position to write to</param>
- /// <param name="value">Value to write</param>
- /// <returns>This instance</returns>
- public ByteBuffer Put(int position, char value)
- {
- return Put(position, (ushort)value);
- }
-
- // Byte[] stuff
-
- public void GetBytes(byte[] buffer)
- {
- GetBytes(buffer, 0, buffer.Length);
- }
-
- public void GetBytes(byte[] buffer, int offset, int length)
- {
- GetBytes(Position, buffer, offset, length);
- Position += length;
- }
- public void GetBytes(int position, byte[] buffer, int offset, int length)
- {
- CheckSpaceForReading(position, length);
- if ( offset + length > buffer.Length )
- throw new ArgumentException("Invalid offset + length");
- ReadBytes(position, buffer, offset, length);
- }
-
- public ByteBuffer Put(byte[] buffer)
- {
- return Put(buffer, 0, buffer.Length);
- }
-
- public ByteBuffer Put(byte[] buffer, int offset, int length)
- {
- Put(Position, buffer, offset, length);
- Position += length;
- return this;
- }
-
- public ByteBuffer Put(int position, byte[] buffer, int offset, int length)
- {
- CheckSpaceForWriting(position, length);
- if ( offset + length > buffer.Length )
- throw new ArgumentException("Invalid offset + length");
-
- Write(position, buffer, offset, length);
- return this;
- }
-
- public ByteBuffer Put(ByteBuffer data)
- {
- Put(Position, data);
- Position += data.Remaining;
- return this;
- }
-
- public ByteBuffer Put(int position, ByteBuffer data)
- {
- CheckSpaceForWriting(position, data.Remaining);
- Write(position, data.Array, data.Position, data.Remaining);
- return this;
- }
-
- #endregion // Data Accessors
-
- #region Core Overrides
- //
- // Core Overrides
- //
-
- protected abstract void DoWrite(int position, byte value);
- protected abstract void DoWrite(int position, byte[] src, int offset, int length);
- protected abstract byte DoReadByte(int position);
- protected abstract void DoReadBytes(int position, byte[] dest, int offset, int length);
- protected abstract void DoCompact();
- protected abstract void DoResize(int newSize);
-
- #endregion // Core Overrides
-
- #region Private Methods
- //
- // Private Methods
- //
-
- private void Seek(int offset)
- {
- if ( offset > Capacity )
- throw new ArgumentException("Cannot position beyond end of buffer");
- _position = offset;
- AdjustLimit();
- }
-
- private void SetLimit(int newLimit)
- {
- if ( newLimit < 0 )
- throw new ArgumentOutOfRangeException("The new limit must be a positive value");
- if ( newLimit > Capacity )
- throw new ArgumentOutOfRangeException("The new limit must not be greater than the capacity");
- _limit = newLimit;
- if ( _position > newLimit )
- _position = newLimit;
- }
-
- private void AdjustLimit()
- {
- if ( _limit < _position )
- _limit = _position;
- }
-
- private void CheckSpaceForReading(int position, int length)
- {
- if ( position + length > Limit )
- {
- throw new BufferUnderflowException("Attempt to read " + length + " byte(s) to buffer where position is " + position +
- " and limit is " + Limit);
- }
- }
-
- private void CheckSpaceForWriting(int position, int length)
- {
- if ( IsAutoExpand )
- {
- Expand(position, length);
- }
- if ( position + length > Limit )
- {
- throw new BufferOverflowException("Attempt to write " + length + " byte(s) to buffer where position is " + position +
- " and limit is " + Limit);
- }
- }
-
- private void Write(int position, byte value)
- {
- DoWrite(position, value);
- }
- private void Write(int position, byte[] src, int offset, int length)
- {
- DoWrite(position, src, offset, length);
- }
- private byte ReadByte(int position)
- {
- return DoReadByte(position);
- }
- private void ReadBytes(int position, byte[] dest, int offset, int length)
- {
- DoReadBytes(position, dest, offset, length);
- }
-
- #endregion // Private Methods
-
- } // class ByteBuffer
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer/ByteBufferHexDumper.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer/ByteBufferHexDumper.cs
deleted file mode 100644
index 4c2856c333..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer/ByteBufferHexDumper.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.
- *
- */
-using System.Text;
-
-namespace Apache.Qpid.Buffer
-{
- public class ByteBufferHexDumper
- {
- private static byte[] highDigits;
-
- private static byte[] lowDigits;
-
- static ByteBufferHexDumper()
- {
- byte[] digits = { (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', (byte)'6',
- (byte)'7', (byte)'8', (byte)'9', (byte)'A', (byte)'B', (byte)'C', (byte)'D',
- (byte)'E', (byte)'F' };
- int i;
- byte[] high = new byte[256];
- byte[] low = new byte[256];
-
- for (i = 0; i < 256; i++)
- {
- high[i] = digits[i >> 4];
- low[i] = digits[i & 0x0F];
- }
-
- highDigits = high;
- lowDigits = low;
- }
-
- public static string GetHexDump(ByteBuffer input)
- {
- int size = input.Remaining;
- if (size == 0)
- {
- return "empty";
- }
-
- StringBuilder output = new StringBuilder(size * 3 - 1);
-
- byte[] data = input.Array;
- int byteValue = data[0] & 0xFF;
- output.Append((char) highDigits[byteValue]);
- output.Append((char) lowDigits[byteValue]);
-
- for (int i = 1 ; i < size; i++)
- {
- output.Append(' ');
- byteValue = data[i] & 0xFF;
- output.Append((char) highDigits[byteValue]);
- output.Append((char) lowDigits[byteValue]);
- }
-
- return output.ToString();
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer/IByteBufferAllocator.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer/IByteBufferAllocator.cs
deleted file mode 100644
index 0f457df065..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer/IByteBufferAllocator.cs
+++ /dev/null
@@ -1,50 +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;
-
-namespace Apache.Qpid.Buffer
-{
- /// <summary>
- /// Allocates <see cref="ByteBuffer"/>'s and manages them. Please
- /// implement this interface if you need more advanced memory management scheme
- /// </summary>
- public interface IByteBufferAllocator : IDisposable
- {
- /// <summary>
- /// Returns the buffer which is capable of the specified size.
- /// </summary>
- /// <param name="capacity">The capacity of the buffer</param>
- /// <returns>A new buffer</returns>
- ByteBuffer Allocate(int capacity);
-
- /// <summary>
- /// Wrap the specified byte array in a new buffer
- /// </summary>
- /// <param name="src">Source array</param>
- /// <returns>A new buffer</returns>
- ByteBuffer Wrap(byte[] src);
-
- } // interface IByteBufferAllocator
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs
deleted file mode 100644
index f8fa3f97b9..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-using System.Reflection;
-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.ByteBuffer")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.ByteBuffer")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("2b3333e5-03b5-4f00-9215-66009f8a5c47")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer/Qpid.Buffer.csproj b/M4-RCs/qpid/dotnet/Qpid.Buffer/Qpid.Buffer.csproj
deleted file mode 100644
index d13f399196..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer/Qpid.Buffer.csproj
+++ /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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Buffer</RootNamespace>
- <AssemblyName>Apache.Qpid.Buffer</AssemblyName>
- <SignAssembly>true</SignAssembly>
- <AssemblyOriginatorKeyFile>
- </AssemblyOriginatorKeyFile>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\bin\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/Qpid.Buffer/SimpleByteBuffer.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer/SimpleByteBuffer.cs
deleted file mode 100644
index d3b7245cb1..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer/SimpleByteBuffer.cs
+++ /dev/null
@@ -1,120 +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;
-
-namespace Apache.Qpid.Buffer
-{
- internal sealed class SimpleByteBuffer : ByteBuffer
- {
- private byte[] _buffer;
-
- public override int Capacity
- {
- get { return _buffer.Length; }
- }
-
- public override byte[] Array
- {
- get { return _buffer; }
- }
-
- /// <summary>
- /// Initialize a new instance with the desired size
- /// </summary>
- /// <param name="desiredSize">Initial Length of the array</param>
- internal SimpleByteBuffer(int desiredSize)
- {
- _buffer = new byte[desiredSize];
- Position = 0;
- Limit = Capacity;
- }
-
- /// <summary>
- /// Initialize a new instance with the data from
- /// an underlying array
- /// </summary>
- /// <param name="buffer">Initial data</param>
- /// <remarks>The original array is copied during construction and is not modified</remarks>
- internal SimpleByteBuffer(byte[] buffer)
- {
- _buffer = (byte[])buffer.Clone();
- // position at end
- Position = Limit = Capacity;
- }
-
- protected override void DoWrite(int position, byte value)
- {
- // available space is already handled by base class
- _buffer[position] = value;
- }
-
- protected override void DoWrite(int position, byte[] src, int offset, int length)
- {
- // available space is already handled by base class
- for ( int i = 0; i < length; i++ )
- {
- _buffer[position+i] = src[offset+i];
- }
- }
-
- protected override byte DoReadByte(int position)
- {
- return _buffer[position];
- }
-
- protected override void DoReadBytes(int position, byte[] dest, int offset, int length)
- {
- System.Array.Copy(_buffer, position, dest, offset, length);
- }
-
- protected override void DoCompact()
- {
- if ( Remaining > 0 )
- {
- if ( Position > 0 )
- {
- System.Array.Copy(_buffer, Position, _buffer, 0, Remaining);
- }
- Position = Remaining;
- } else
- {
- Position = 0;
- }
- Limit = Capacity;
- }
-
- protected override void DoResize(int newSize)
- {
- if ( newSize < Capacity )
- throw new NotSupportedException("Cannot resize a buffer to make it smaller");
-
- int newCapacity = 1;
- while ( newCapacity < newSize )
- {
- newCapacity <<= 1;
- }
-
- byte[] newBuffer = new byte[newCapacity];
- System.Array.Copy(_buffer, newBuffer, _buffer.Length);
- _buffer = newBuffer;
- }
- } // class SimpleByteBuffer
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer/SimpleByteBufferAllocator.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer/SimpleByteBufferAllocator.cs
deleted file mode 100644
index e772e59ae3..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer/SimpleByteBufferAllocator.cs
+++ /dev/null
@@ -1,58 +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.Buffer
-{
- /// <summary>
- /// Allocates <see cref="ByteBuffer"/>'s and manages them.
- /// This is a simple implementation that just returns buffers
- /// as they are. Buffers are not reused or refcounted
- /// </summary>
- public class SimpleByteBufferAllocator : IByteBufferAllocator
- {
- #region IByteBufferAllocator Members
-
- public ByteBuffer Allocate(int capacity)
- {
- return new SimpleByteBuffer(capacity);
- }
-
- public ByteBuffer Wrap(byte[] src)
- {
- return new SimpleByteBuffer(src);
- }
-
- #endregion
-
- #region IDisposable Members
-
- public void Dispose()
- {
- // no need to do anaything
- }
-
- #endregion
-
- } // class SimpleByteBufferAllocator
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer/SlicedByteBuffer.cs b/M4-RCs/qpid/dotnet/Qpid.Buffer/SlicedByteBuffer.cs
deleted file mode 100644
index c27b7949b6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer/SlicedByteBuffer.cs
+++ /dev/null
@@ -1,86 +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;
-
-namespace Apache.Qpid.Buffer
-{
- internal sealed class SlicedByteBuffer : ByteBuffer
- {
- private ByteBuffer _buffer;
- private int _capacity;
- private int _startPos;
-
- public override int Capacity
- {
- get { return _capacity; }
- }
-
- public override byte[] Array
- {
- get { return _buffer.Array; }
- }
-
- /// <summary>
- /// Initialize a new instance
- /// </summary>
- /// <param name="buffer">Underlying byte buffer</param>
- internal SlicedByteBuffer(ByteBuffer buffer)
- {
- _buffer = buffer;
- _startPos = buffer.Position;
- Position = 0;
- _capacity = buffer.Remaining;
- Limit = Capacity;
- // cannot autoexpand
- IsAutoExpand = false;
- }
-
- protected override void DoWrite(int position, byte value)
- {
- _buffer.Put(_startPos + position, value);
- }
-
- protected override void DoWrite(int position, byte[] src, int offset, int length)
- {
- _buffer.Put(_startPos + position, src, offset, length);
- }
-
- protected override byte DoReadByte(int position)
- {
- return _buffer.GetByte(_startPos + position);
- }
-
- protected override void DoReadBytes(int position, byte[] dest, int offset, int length)
- {
- _buffer.GetBytes(_startPos + position, dest, offset, length);
- }
-
- protected override void DoCompact()
- {
- throw new NotSupportedException();
- }
-
- protected override void DoResize(int newSize)
- {
- throw new NotSupportedException();
- }
- } // class SlicedByteBuffer
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Buffer/default.build b/M4-RCs/qpid/dotnet/Qpid.Buffer/default.build
deleted file mode 100644
index efb5a8fc89..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Buffer/default.build
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Apache.Qpid.Buffer" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- debug="${build.debug}"
- unsafe="true"
- output="${build.dir}/${project::get-name()}.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/App.config b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/App.config
deleted file mode 100644
index e71a468a3a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/App.config
+++ /dev/null
@@ -1,34 +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.
-
--->
-
-<configuration>
- <configSections>
- <sectionGroup name="qpid.client">
- <section name="authentication" type="Apache.Qpid.Client.Configuration.AuthenticationConfigurationSectionHandler, Apache.Qpid.Client"/>
- </sectionGroup>
- </configSections>
- <qpid.client>
- <authentication>
- <add key="TEST" value="Apache.Qpid.Client.Tests.Security.TestCallbackHandler, Apache.Qpid.Client.Tests"/>
- </authentication>
- </qpid.client>
-</configuration>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/BrokerDetails/BrokerDetailsTest.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/BrokerDetails/BrokerDetailsTest.cs
deleted file mode 100644
index 8e8d8ced3b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/BrokerDetails/BrokerDetailsTest.cs
+++ /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.
- *
- */
-using System;
-using System.Net;
-using NUnit.Framework;
-using Apache.Qpid.Client.Qms;
-
-namespace Apache.Qpid.Client.Tests.BrokerDetails
-{
- [TestFixture]
- public class BrokerDetailsTest
- {
-
- [Test]
- public void ValidateBrokerInfoEqualsMethod()
- {
- AmqBrokerInfo broker = new AmqBrokerInfo("amqp", "localhost", 5672, true);
- AmqBrokerInfo broker1 = new AmqBrokerInfo("Amqp", "localhost", 5672, true);
-
- Assert.IsTrue(broker.Equals(broker1),"The two AmqBrokerInfo objects are not equals");
- Console.WriteLine(string.Format("The object broker: {0} and broker1: {1} are equals", broker, broker1));
- }
-
- [Test]
- public void ValidateBrokerInfoWithDifferentSSL()
- {
- AmqBrokerInfo broker = new AmqBrokerInfo("amqp", "localhost", 5672, true);
- AmqBrokerInfo broker1 = new AmqBrokerInfo("amqp", "localhost", 5672, false);
-
- Assert.IsFalse(broker.Equals(broker1), "The two AmqBrokerInfo objects are equals");
- Console.WriteLine(string.Format("The object broker: {0} and broker1: {1} are not equals", broker, broker1));
- }
-
- [Test]
- public void ValidateBrokerInfoFromToString()
- {
- String url = "tcp://localhost:5672?timeout='200',immediatedelivery='true'";
-
- AmqBrokerInfo broker = new AmqBrokerInfo(url);
- AmqBrokerInfo broker1 = new AmqBrokerInfo(broker.ToString());
-
- Assert.AreEqual(broker.GetOption("timeout"), broker1.GetOption("timeout"));
- Assert.AreEqual(broker.GetOption("immediatedelivery"), broker1.GetOption("immediatedelivery"));
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Channel/ChannelMessageCreationTests.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Channel/ChannelMessageCreationTests.cs
deleted file mode 100644
index c27aa9a503..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Channel/ChannelMessageCreationTests.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.
- *
- */
-
-using System;
-
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Client;
-using Apache.Qpid.Client.Message;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.Tests.Channel
-{
- /// <summary>
- /// Test that channels can create messages correctly
- /// </summary>
- [TestFixture]
- public class ChannelMessageCreationTests
- {
- [Test]
- public void CanCreateTextMessage()
- {
- IChannel channel = AmqChannel.CreateDisconnectedChannel();
- ITextMessage msg = channel.CreateTextMessage();
- Assert.IsNotNull(msg);
- }
- [Test]
- public void CanCreateTextMessageWithContent()
- {
- IChannel channel = AmqChannel.CreateDisconnectedChannel();
- const string CONTENT = "1234567890";
- ITextMessage msg = channel.CreateTextMessage(CONTENT);
- Assert.IsNotNull(msg);
- Assert.AreEqual(CONTENT, msg.Text);
- }
- [Test]
- public void CanCreateBytesMessage()
- {
- IChannel channel = AmqChannel.CreateDisconnectedChannel();
- IBytesMessage msg = channel.CreateBytesMessage();
- Assert.IsNotNull(msg);
- }
- [Test]
- public void CanCreateMessage()
- {
- IChannel channel = AmqChannel.CreateDisconnectedChannel();
- IMessage msg = channel.CreateMessage();
- Assert.IsNotNull(msg);
- }
- [Test]
- public void CanCreateMessageFromMimeType()
- {
- IChannel channel = AmqChannel.CreateDisconnectedChannel();
- IMessage msg = channel.CreateMessage("text/xml");
- Assert.IsNotNull(msg);
- Assert.IsInstanceOfType(typeof(ITextMessage), msg);
- }
- }
-} // namespace Apache.Qpid.Client.Tests.Channel
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Messages/MessageFactoryRegistryTests.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Messages/MessageFactoryRegistryTests.cs
deleted file mode 100644
index 1211196541..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Messages/MessageFactoryRegistryTests.cs
+++ /dev/null
@@ -1,114 +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;
-
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Message;
-
-namespace Apache.Qpid.Client.Tests.Messages
-{
- /// <summary>
- /// Ensure a factory creates messages correctly
- /// </summary>
- [TestFixture]
- public class MessageFactoryRegistryTests
- {
- const string TEXT_PLAIN = "text/plain";
- const string TEXT_XML = "text/xml";
- const string OCTET_STREAM = "application/octet-stream";
-
- /// <summary>
- /// Check default registry can create text/plain messages
- /// </summary>
- [Test]
- public void CanCreateTextPlain()
- {
- MessageFactoryRegistry registry =
- MessageFactoryRegistry.NewDefaultRegistry();
-
- IMessage message = registry.CreateMessage(TEXT_PLAIN);
- Assert.IsNotNull(message);
- Assert.AreEqual(TEXT_PLAIN, message.ContentType);
- Assert.IsInstanceOfType(typeof(QpidTextMessage), message);
- }
- /// <summary>
- /// Check default registry can create text/xml messages
- /// </summary>
- [Test]
- public void CanCreateTextXml()
- {
- MessageFactoryRegistry registry =
- MessageFactoryRegistry.NewDefaultRegistry();
-
- IMessage message = registry.CreateMessage(TEXT_XML);
- Assert.IsNotNull(message);
- Assert.AreEqual(TEXT_XML, message.ContentType);
- Assert.IsInstanceOfType(typeof(QpidTextMessage), message);
- }
- /// <summary>
- /// Check default registry can create application/octet-stream messages
- /// </summary>
- [Test]
- public void CanCreateBinary()
- {
- MessageFactoryRegistry registry =
- MessageFactoryRegistry.NewDefaultRegistry();
-
- IMessage message = registry.CreateMessage(OCTET_STREAM);
- Assert.IsNotNull(message);
- Assert.AreEqual(OCTET_STREAM, message.ContentType);
- Assert.IsInstanceOfType(typeof(QpidBytesMessage), message);
- }
- /// <summary>
- /// Check default registry can create messages for unknown types
- /// </summary>
- [Test]
- public void CanCreateUnknownType()
- {
- MessageFactoryRegistry registry =
- MessageFactoryRegistry.NewDefaultRegistry();
-
- const string OTHER = "application/unknown";
- IMessage message = registry.CreateMessage(OTHER);
- Assert.IsNotNull(message);
- Assert.AreEqual(OTHER, message.ContentType);
- Assert.IsInstanceOfType(typeof(QpidBytesMessage), message);
- }
- /// <summary>
- /// Check that text messages default to UTF-8 encoding
- /// </summary>
- [Test]
- public void TextMessagesDefaultToUTF8Encoding()
- {
- MessageFactoryRegistry registry =
- MessageFactoryRegistry.NewDefaultRegistry();
-
- IMessage message = registry.CreateMessage(TEXT_PLAIN);
- Assert.AreEqual("utf-8", message.ContentEncoding.ToLower());
- }
-
- }
-} // namespace Apache.Qpid.Client.Tests.Messages
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index 6359567f04..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-using System.Reflection;
-using System.Runtime.InteropServices;
-using log4net.Config;
-[assembly: XmlConfigurator(ConfigFile="log4net.config")]
-
-// 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.Client.Tests")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.Client.Tests")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("7ebdea21-1352-4673-b66e-fdc0beff461f")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("2.1.0.0")]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj
deleted file mode 100644
index 73eabfa1f8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj
+++ /dev/null
@@ -1,158 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{BA1B0032-4CE6-40DD-A2DC-119F0FFA0A1D}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Client.Tests</RootNamespace>
- <AssemblyName>Apache.Qpid.Client.Tests</AssemblyName>
- <StartupObject>
- </StartupObject>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <PublishUrl>http://localhost/Apache.Qpid.Client.Tests/</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Web</InstallFrom>
- <UpdateEnabled>true</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>true</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <UseVSHostingProcess>true</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\bin\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Qpid.Common\lib\log4net\log4net.dll</HintPath>
- </Reference>
- <Reference Include="nunit.framework, Version=2.2.6.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>lib\nunit\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Buffer\Qpid.Buffer.csproj">
- <Project>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</Project>
- <Name>Qpid.Buffer</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Messaging\Qpid.Messaging.csproj">
- <Project>{6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}</Project>
- <Name>Qpid.Messaging</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Client\Qpid.Client.csproj">
- <Project>{68987C05-3768-452C-A6FC-6BA1D372852F}</Project>
- <Name>Qpid.Client</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Common\Qpid.Common.csproj">
- <Project>{77064C42-24D2-4CEB-9EA2-0EF481A43205}</Project>
- <Name>Qpid.Common</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Sasl\Qpid.Sasl.csproj">
- <Project>{1465B0EE-6452-42A6-AB73-B2F9EABEEE75}</Project>
- <Name>Qpid.Sasl</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="log4net.config">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- </ItemGroup>
- <ItemGroup>
- <None Include="App.config" />
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
- <Install>true</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>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <Folder Include="interop\TestCases\" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs
deleted file mode 100644
index 1345511cbf..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs
+++ /dev/null
@@ -1,66 +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;
-using NUnit.Framework;
-using Apache.Qpid.Client.Security;
-
-
-namespace Apache.Qpid.Client.Tests.Security
-{
- [TestFixture]
- public class CallbackRegistryHandlerTests
- {
- [Test]
- public void ParsesConfiguration()
- {
- CallbackHandlerRegistry registry = CallbackHandlerRegistry.Instance;
- Assert.AreEqual(4, registry.Mechanisms.Length);
- Assert.Contains("TEST", registry.Mechanisms);
-
- Type handlerType = registry.GetCallbackHandler("TEST");
- Assert.IsNotNull(handlerType);
- Assert.AreEqual(typeof(TestCallbackHandler), handlerType);
- }
-
- [Test]
- public void MechanimsInOrder()
- {
- CallbackHandlerRegistry registry = CallbackHandlerRegistry.Instance;
- Assert.AreEqual(4, registry.Mechanisms.Length);
- Assert.AreEqual("TEST", registry.Mechanisms[0]);
- Assert.AreEqual("EXTERNAL", registry.Mechanisms[1]);
- Assert.AreEqual("CRAM-MD5", registry.Mechanisms[2]);
- Assert.AreEqual("PLAIN", registry.Mechanisms[3]);
- }
- } // class CallbackRegistryHandlerTests
-
- public class TestCallbackHandler : IAMQCallbackHandler
- {
- public void Initialize(Qpid.Client.Protocol.AMQProtocolSession session)
- {
- }
- public void Handle(Qpid.Sasl.ISaslCallback[] callbacks)
- {
- }
-
- } // class TestCallbackHandler
-
-} // namespace Apache.Qpid.Client.Tests.Connection
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/default.build b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/default.build
deleted file mode 100644
index 5116e651e1..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/default.build
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Apache.Qpid.Client" default="test">
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- warnaserror="false" debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.Tests.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/nunit.framework.dll" />
- <include name="${build.dir}/${project::get-name()}.dll" />
- <include name="${build.dir}/Apache.Qpid.Common.dll" />
- <include name="${build.dir}/Apache.Qpid.Messaging.dll" />
- <include name="${build.dir}/Apache.Qpid.Sasl.dll" />
- </references>
- </csc>
- <copy tofile="${build.dir}/${project::get-name()}.Tests.dll.config" file="App.config" />
- <copy todir="${build.dir}" file="log4net.config"/>
- </target>
-
- <target name="test" depends="build">
- <nunit2 verbose="true">
- <formatter type="${nant.formatter}" usefile="false" />
- <test>
- <assemblies>
- <include name="${build.dir}/${project::get-name()}.tests.dll"/>
- </assemblies>
- <categories>
- <!-- The fail-over tests are interactive so should not be run as part of the build. -->
- <exclude name="Integration"/>
- <exclude name="SSL" if="${framework::get-target-framework() == 'mono-2.0'}"/>
- </categories>
- </test>
- </nunit2>
- </target>
-
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/interop/TopicListener.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/interop/TopicListener.cs
deleted file mode 100644
index 13141d52b8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/interop/TopicListener.cs
+++ /dev/null
@@ -1,211 +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;
-using log4net;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-
-namespace Apache.Qpid.Client.Tests.interop
-{
- public class TopicListener
- {
- private static ILog log = LogManager.GetLogger(typeof(TopicListener));
-
- /// <summary> The default AMQ connection URL to use for tests. </summary>
- const string DEFAULT_URI = "amqp://guest:guest@default/test?brokerlist='tcp://localhost:5672'";
-
- /// <summary> Holds the routing key for the topic to receive test messages on. </summary>
- public static string CONTROL_ROUTING_KEY = "topic_control";
-
- /// <summary> Holds the routing key for the queue to send reports to. </summary>
- public static string RESPONSE_ROUTING_KEY = "response";
-
- /// <summary> Holds the connection to listen on. </summary>
- private IConnection connection;
-
- /// <summary> Holds the channel for all test messages.</summary>
- private IChannel channel;
-
- /// <summary> Holds the producer to send report messages on. </summary>
- private IMessagePublisher publisher;
-
- /// <summary> Holds a flag to indicate that a timer has begun on the first message. Reset when report is sent. </summary> */
- private bool init;
-
- /// <summary> Holds the count of messages received by this listener. </summary> */
- private int count;
-
- /// <summary> Creates a topic listener using the specified broker URL. </summary>
- ///
- /// <param name="connectionUri">The broker URL to listen on.</param>
- TopicListener(string connectionUri)
- {
- log.Debug("TopicListener(string connectionUri = " + connectionUri + "): called");
-
- // Create a connection to the broker.
- IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(connectionUri);
- connection = new AMQConnection(connectionInfo);
-
- // Establish a session on the broker.
- channel = connection.CreateChannel(false, AcknowledgeMode.AutoAcknowledge, 1);
-
- // Set up a queue to listen for test messages on.
- string topicQueueName = channel.GenerateUniqueName();
- channel.DeclareQueue(topicQueueName, false, true, true);
-
- // Set this listener up to listen for incoming messages on the test topic queue.
- channel.Bind(topicQueueName, ExchangeNameDefaults.TOPIC, CONTROL_ROUTING_KEY);
- IMessageConsumer consumer = channel.CreateConsumerBuilder(topicQueueName)
- .Create();
- consumer.OnMessage += new MessageReceivedDelegate(OnMessage);
-
- // Set up this listener with a producer to send the reports on.
- publisher = channel.CreatePublisherBuilder()
- .WithExchangeName(ExchangeNameDefaults.DIRECT)
- .WithRoutingKey(RESPONSE_ROUTING_KEY)
- .Create();
-
- connection.Start();
- Console.WriteLine("Waiting for messages...");
- }
-
- public static void Main(String[] argv)
- {
- // Create an instance of this listener with the command line parameters.
- new TopicListener(DEFAULT_URI);
- }
-
- /// <summary>
- /// Handles all message received by this listener. Test messages are counted, report messages result in a report being sent and
- /// shutdown messages result in this listener being terminated.
- /// </summary>
- ///
- /// <param name="message">The received message.</param>
- public void OnMessage(IMessage message)
- {
- log.Debug("public void onMessage(Message message = " + message + "): called");
-
- // Take the start time of the first message if this is the first message.
- if (!init)
- {
- count = 0;
- init = true;
- }
-
- // Check if the message is a control message telling this listener to shut down.
- if (IsShutdown(message))
- {
- log.Debug("Got a shutdown message.");
- Shutdown();
- }
- // Check if the message is a report request message asking this listener to respond with the message count.
- else if (IsReport(message))
- {
- log.Debug("Got a report request message.");
-
- // Send the message count report.
- SendReport();
-
- // Reset the initialization flag so that the next message is considered to be the first.
- init = false;
- }
- // Otherwise it is an ordinary test message, so increment the message count.
- else
- {
- count++;
- }
- }
-
- /// <summary> Checks a message to see if it is a shutdown control message. </summary>
- ///
- /// <param name="m">The message to check.</param>
- ///
- /// <returns><tt>true</tt> if it is a shutdown control message, <tt>false</tt> otherwise.</returns>
- private bool IsShutdown(IMessage m)
- {
- bool result = CheckTextField(m, "TYPE", "TERMINATION_REQUEST");
-
- //log.Debug("isShutdown = " + result);
-
- return result;
- }
-
- /// <summary> Checks a message to see if it is a report request control message. </summary>
- ///
- /// <param name="m">The message to check.</param>
- ///
- /// <returns><tt>true</tt> if it is a report request control message, <tt>false</tt> otherwise.</returns>
- private bool IsReport(IMessage m)
- {
- bool result = CheckTextField(m, "TYPE", "REPORT_REQUEST");
-
- //log.Debug("isReport = " + result);
-
- return result;
- }
-
- /// <summary> Checks whether or not a text field on a message has the specified value. </summary>
- ///
- /// <param name="e">The message to check.</param>
- /// <param name="e">The name of the field to check.</param>
- /// <param name="e">The expected value of the field to compare with.</param>
- ///
- /// <returns> <tt>true</tt>If the specified field has the specified value, <tt>fals</tt> otherwise. </returns>
- private static bool CheckTextField(IMessage m, string fieldName, string value)
- {
- /*log.Debug("private static boolean checkTextField(Message m = " + m + ", String fieldName = " + fieldName
- + ", String value = " + value + "): called");*/
-
- string comp = m.Headers.GetString(fieldName);
-
- return (comp != null) && comp == value;
- }
-
- /// <summary> Stops the message consumer and closes the connection. </summary>
- private void Shutdown()
- {
- connection.Stop();
- channel.Dispose();
- connection.Dispose();
- }
-
- /// <summary> Sends the report message to the response location. </summary>
- private void SendReport()
- {
- string report = "Received " + count + ".";
-
- IMessage reportMessage = channel.CreateTextMessage(report);
-
- reportMessage.Headers.SetBoolean("BOOLEAN", false);
- //reportMessage.Headers.SetByte("BYTE", 5);
- reportMessage.Headers.SetDouble("DOUBLE", 3.141);
- reportMessage.Headers.SetFloat("FLOAT", 1.0f);
- reportMessage.Headers.SetInt("INT", 1);
- reportMessage.Headers.SetLong("LONG", 1);
- reportMessage.Headers.SetString("STRING", "hello");
- reportMessage.Headers.SetShort("SHORT", 2);
-
- publisher.Send(reportMessage);
-
- Console.WriteLine("Sent report: " + report);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs
deleted file mode 100644
index a96c1f327b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs
+++ /dev/null
@@ -1,208 +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;
-using System.Threading;
-using log4net;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-
-namespace Apache.Qpid.Client.Tests.interop
-{
- public class TopicPublisher
- {
- private static ILog log = LogManager.GetLogger(typeof(TopicPublisher));
-
- /// <summary> The default AMQ connection URL to use for tests. </summary>
- const string DEFAULT_URI = "amqp://guest:guest@default/test?brokerlist='tcp://localhost:5672'";
-
- /// <summary> Holds the default test timeout for broker communications before tests give up. </summary>
- const int TIMEOUT = 10000;
-
- /// <summary> Holds the routing key for the topic to receive test messages on. </summary>
- const string CONTROL_ROUTING_KEY = "topic_control";
-
- /// <summary> Holds the routing key for the queue to send reports to. </summary>
- const string RESPONSE_ROUTING_KEY = "response";
-
- /// <summary> Holds the number of messages to send in each test run. </summary>
- private int numMessages;
-
- /// <summary> Holds the number of subscribers listening to the messsages. </summary>
- private int numSubscribers;
-
- /// <summary> A monitor used to wait for all reports to arrive back from consumers on. </summary>
- private AutoResetEvent allReportsReceivedEvt = new AutoResetEvent(false);
-
- /// <summary> Holds the connection to listen on. </summary>
- private IConnection connection;
-
- /// <summary> Holds the channel for all test messages.</summary>
- private IChannel channel;
-
- /// <summary> Holds the producer to send test messages on. </summary>
- private IMessagePublisher publisher;
-
- /// <summary>
- /// Creates a topic publisher that will send the specifed number of messages and expect the specifed number of report back from test
- /// subscribers.
- /// </summary>
- ///
- /// <param name="connectionUri">The broker URL.</param>
- /// <param name="numMessages">The number of messages to send in each test.</param>
- /// <param name="numSubscribers">The number of subscribes that are expected to reply with a report.</param>
- TopicPublisher(string connectionUri, int numMessages, int numSubscribers)
- {
- log.Debug("TopicPublisher(string connectionUri = " + connectionUri + ", int numMessages = "+ numMessages +
- ", int numSubscribers = " + numSubscribers + "): called");
-
- // Create a connection to the broker.
- IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(connectionUri);
- connection = new AMQConnection(connectionInfo);
-
- // Establish a session on the broker.
- channel = connection.CreateChannel(false, AcknowledgeMode.AutoAcknowledge, 1);
-
- // Set up a queue to listen for reports on.
- string responseQueueName = channel.GenerateUniqueName();
- channel.DeclareQueue(responseQueueName, false, true, true);
-
- // Set this listener up to listen for reports on the response queue.
- channel.Bind(responseQueueName, ExchangeNameDefaults.DIRECT, RESPONSE_ROUTING_KEY);
- //channel.Bind(responseQueueName, "<<default>>", RESPONSE_ROUTING_KEY);
- IMessageConsumer consumer = channel.CreateConsumerBuilder(responseQueueName)
- .Create();
- consumer.OnMessage += new MessageReceivedDelegate(OnMessage);
-
- // Set up this listener with a producer to send the test messages and report requests on.
- publisher = channel.CreatePublisherBuilder()
- .WithExchangeName(ExchangeNameDefaults.TOPIC)
- .WithRoutingKey(CONTROL_ROUTING_KEY)
- .Create();
-
- // Keep the test parameters.
- this.numMessages = numMessages;
- this.numSubscribers = numSubscribers;
-
- connection.Start();
- Console.WriteLine("Sending messages and waiting for reports...");
- }
-
- /// <summary>
- /// Start a test subscriber. The broker URL must be specified as the first command line argument.
- /// </summary>
- ///
- /// <param name="argv">The command line arguments, broker URL first.</param>
- public static void Main(String[] argv)
- {
- // Create an instance of this publisher with the command line parameters.
- TopicPublisher publisher = new TopicPublisher(DEFAULT_URI, 1, 1);
-
- // Publish the test messages.
- publisher.DoTest();
- }
-
- /// <summary>
- /// Sends the test messages and waits for all subscribers to reply with a report.
- /// </summary>
- public void DoTest()
- {
- log.Debug("public void DoTest(): called");
-
- // Create a test message to send.
- IMessage testMessage = channel.CreateTextMessage("test");
-
- // Send the desired number of test messages.
- for (int i = 0; i < numMessages; i++)
- {
- publisher.Send(testMessage);
- }
-
- log.Debug("Sent " + numMessages + " test messages.");
-
- // Send the report request.
- IMessage reportRequestMessage = channel.CreateTextMessage("Report request message.");
- reportRequestMessage.Headers["TYPE"] = "REPORT_REQUEST";
-
- reportRequestMessage.Headers.SetBoolean("BOOLEAN", false);
- //reportRequestMessage.Headers.SetByte("BYTE", 5);
- reportRequestMessage.Headers.SetDouble("DOUBLE", 3.141);
- reportRequestMessage.Headers.SetFloat("FLOAT", 1.0f);
- reportRequestMessage.Headers.SetInt("INT", 1);
- reportRequestMessage.Headers.SetLong("LONG", 1);
- reportRequestMessage.Headers.SetString("STRING", "hello");
- reportRequestMessage.Headers.SetShort("SHORT", 2);
-
- publisher.Send(reportRequestMessage);
-
- log.Debug("Sent the report request message, waiting for all replies...");
-
- // Wait until all the reports come in.
- allReportsReceivedEvt.WaitOne(TIMEOUT, true);
-
- // Check if all reports were really received or if the timeout occurred.
- if (numSubscribers == 0)
- {
- log.Debug("Got all reports.");
- }
- else
- {
- log.Debug("Waiting for reports timed out, still waiting for " + numSubscribers + ".");
- }
-
- // Send the termination request.
- IMessage terminationRequestMessage = channel.CreateTextMessage("Termination request message.");
- terminationRequestMessage.Headers["TYPE"] = "TERMINATION_REQUEST";
- publisher.Send(terminationRequestMessage);
-
- log.Debug("Sent the termination request message.");
-
- // Close all message producers and consumers and the connection to the broker.
- Shutdown();
- }
-
- /// <summary>
- /// Handles all report messages from subscribers. This decrements the count of subscribers that are still to reply, until this becomes
- /// zero, at which time waiting threads are notified of this event.
- /// </summary>
- ///
- /// <param name="message">The received report message.</param>
- public void OnMessage(IMessage message)
- {
- log.Debug("public void OnMessage(IMessage message = " + message + "): called");
-
- // Decrement the count of expected messages and release the wait monitor when this becomes zero.
- if (--numSubscribers == 0)
- {
- log.Debug("Got reports from all subscribers.");
- allReportsReceivedEvt.Set();
- }
- }
-
- /// <summary> Stops the message consumers and closes the connection. </summary>
- private void Shutdown()
- {
- connection.Stop();
- publisher.Dispose();
- channel.Dispose();
- connection.Dispose();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit-licence.txt b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit-licence.txt
deleted file mode 100644
index b2316295d3..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit-licence.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov,
- Charlie Poole
-Copyright © 2000-2004 Philip A. Craig
-
-This software is provided 'as-is', without any express or implied warranty. In
-no event will the authors be held liable for any damages arising from the use
-of this software.
-
-Permission is granted to anyone to use this software for any purpose, including
-commercial applications, and to alter it and redistribute it freely, subject to
-the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim
- that you wrote the original software. If you use this software in a product, an
- acknowledgment (see the following) in the product documentation is required.
-
- Portions Copyright © 2002 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
- or Copyright © 2000-2002 Philip A. Craig
-
-2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any source distribution.
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dll b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dll
deleted file mode 100644
index 53666e74c9..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dll
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/log4net.config b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/log4net.config
deleted file mode 100644
index 0ad25c4185..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/log4net.config
+++ /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.
-
--->
-<log4net>
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="console" type="log4net.Appender.ConsoleAppender" >
- <layout type="log4net.Layout.PatternLayout">
- <conversionPattern value="%m%n"/>
- </layout>
- <threshold value="info"/>
- </appender>
-
- <!-- ====================================== -->
- <!-- Append messages to the socket appender -->
- <!-- ====================================== -->
-
- <appender name="UdpAppender" type="log4net.Appender.UdpAppender">
- <remoteAddress value="127.0.0.1"/>
- <remotePort value="4445"/>
- <layout type="log4net.Layout.XmlLayoutSchemaLog4j">
- <locationInfo value="true"/>
- </layout>
- <threshold value="debug"/>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <logger name="Qpid">
- <level value="debug"/>
- </logger>
-
- <logger name="CONSOLE">
- <level value="info"/>
- <appender-ref ref="console"/>
- </logger>
-
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <appender-ref ref="UdpAppender"/>
- </root>
-
-</log4net>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/url/ConnectionUrlTest.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Tests/url/ConnectionUrlTest.cs
deleted file mode 100644
index 3c9f8dd4e2..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Tests/url/ConnectionUrlTest.cs
+++ /dev/null
@@ -1,446 +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;
-using System.Net;
-using NUnit.Framework;
-using Apache.Qpid.Client.Qms;
-
-namespace Apache.Qpid.Client.Tests.url
-{
- [TestFixture]
- public class connectionUrlTests
- {
- [Test]
- public void FailoverURL()
- {
- //String url = "amqp://ritchiem:bob@/temp?brokerlist='tcp://localhost:5672;tcp://fancyserver:3000/',failover='roundrobin'";
- String url = "amqp://ritchiem:bob@default/temp?brokerlist='tcp://localhost:5672;tcp://fancyserver:3000/',failover='roundrobin'";
-
- IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url);
-
- Assert.AreEqual("roundrobin", connectionurl.FailoverMethod);
- Assert.IsTrue(connectionurl.Username.Equals("ritchiem"));
- Assert.IsTrue(connectionurl.Password.Equals("bob"));
- Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp"));
-
- Assert.IsTrue(connectionurl.BrokerCount == 2);
-
- IBrokerInfo service = connectionurl.GetBrokerInfo(0);
-
- Assert.IsTrue(service.Transport.Equals("tcp"));
- Assert.IsTrue(service.Host.Equals("localhost"));
- Assert.IsTrue(service.Port == 5672);
-
- service = connectionurl.GetBrokerInfo(1);
-
- Assert.IsTrue(service.Transport.Equals("tcp"));
- Assert.IsTrue(service.Host.Equals("fancyserver"));
- Assert.IsTrue(service.Port == 3000);
-
- }
-
- [Test]
- public void SingleTransportUsernamePasswordURL()
- {
- String url = "amqp://ritchiem:bob@default/temp?brokerlist='tcp://localhost:5672'";
-
- IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url);
-
- Assert.IsTrue(connectionurl.FailoverMethod == null);
- Assert.IsTrue(connectionurl.Username.Equals("ritchiem"));
- Assert.IsTrue(connectionurl.Password.Equals("bob"));
- Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp"));
-
- Assert.IsTrue(connectionurl.BrokerCount == 1);
-
- IBrokerInfo service = connectionurl.GetBrokerInfo(0);
-
- Assert.IsTrue(service.Transport.Equals("tcp"));
- Assert.IsTrue(service.Host.Equals("localhost"));
- Assert.IsTrue(service.Port == 5672);
- }
-
- [Test]
- public void SingleTransportUsernameBlankPasswordURL()
- {
- String url = "amqp://ritchiem:@default/temp?brokerlist='tcp://localhost:5672'";
-
- IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url);
-
- Assert.IsTrue(connectionurl.FailoverMethod == null);
- Assert.IsTrue(connectionurl.Username.Equals("ritchiem"));
- Assert.IsTrue(connectionurl.Password.Equals(""));
- Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp"));
-
- Assert.IsTrue(connectionurl.BrokerCount == 1);
-
- IBrokerInfo service = connectionurl.GetBrokerInfo(0);
-
- Assert.IsTrue(service.Transport.Equals("tcp"));
- Assert.IsTrue(service.Host.Equals("localhost"));
- Assert.IsTrue(service.Port == 5672);
- }
-
- [Test]
- public void FailedURLNullPassword()
- {
- String url = "amqp://ritchiem@default/temp?brokerlist='tcp://localhost:5672'";
-
- try
- {
- QpidConnectionInfo.FromUrl(url);
- Assert.Fail("URL has null password");
- }
- catch (UrlSyntaxException e)
- {
- Assert.AreEqual("Null password in user information not allowed.", e.Message);
- Assert.IsTrue(e.GetIndex() == 7);
- }
- }
-
- [Test]
- public void SingleTransportURL()
- {
- String url = "amqp://guest:guest@default/test?brokerlist='tcp://localhost:5672'";
-
- IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url);
-
-
- Assert.IsTrue(connectionurl.FailoverMethod == null);
- Assert.IsTrue(connectionurl.Username.Equals("guest"));
- Assert.IsTrue(connectionurl.Password.Equals("guest"));
- Assert.IsTrue(connectionurl.VirtualHost.Equals("/test"));
-
-
- Assert.IsTrue(connectionurl.BrokerCount == 1);
-
-
- IBrokerInfo service = connectionurl.GetBrokerInfo(0);
-
- Assert.IsTrue(service.Transport.Equals("tcp"));
- Assert.IsTrue(service.Host.Equals("localhost"));
- Assert.IsTrue(service.Port == 5672);
- }
-
- [Test]
- public void SingleTransportWithClientURLURL()
- {
- String url = "amqp://guest:guest@clientname/temp?brokerlist='tcp://localhost:5672'";
-
- IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url);
-
-
- Assert.IsTrue(connectionurl.FailoverMethod == null);
- Assert.IsTrue(connectionurl.Username.Equals("guest"));
- Assert.IsTrue(connectionurl.Password.Equals("guest"));
- Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp"));
- Assert.IsTrue(connectionurl.ClientName.Equals("clientname"));
-
-
- Assert.IsTrue(connectionurl.BrokerCount == 1);
-
-
- IBrokerInfo service = connectionurl.GetBrokerInfo(0);
-
- Assert.IsTrue(service.Transport.Equals("tcp"));
- Assert.IsTrue(service.Host.Equals("localhost"));
- Assert.IsTrue(service.Port == 5672);
- }
-
- [Test]
- public void SingleTransport1OptionURL()
- {
- String url = "amqp://guest:guest@default/temp?brokerlist='tcp://localhost:5672',routingkey='jim'";
-
- IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url);
-
- Assert.IsTrue(connectionurl.FailoverMethod == null);
- Assert.IsTrue(connectionurl.Username.Equals("guest"));
- Assert.IsTrue(connectionurl.Password.Equals("guest"));
- Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp"));
-
-
- Assert.IsTrue(connectionurl.BrokerCount == 1);
-
- IBrokerInfo service = connectionurl.GetBrokerInfo(0);
-
- Assert.IsTrue(service.Transport.Equals("tcp"));
-
- Assert.IsTrue(service.Host.Equals("localhost"));
- Assert.IsTrue(service.Port == 5672);
- Assert.IsTrue(connectionurl.GetOption("routingkey").Equals("jim"));
- }
-
- [Test]
- public void SingleTransportDefaultedBroker()
- {
- String url = "amqp://guest:guest@default/temp?brokerlist='localhost:'";
-
- IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url);
-
- Assert.IsTrue(connectionurl.FailoverMethod == null);
- Assert.IsTrue(connectionurl.Username.Equals("guest"));
- Assert.IsTrue(connectionurl.Password.Equals("guest"));
- Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp"));
-
-
- Assert.IsTrue(connectionurl.BrokerCount == 1);
-
- IBrokerInfo service = connectionurl.GetBrokerInfo(0);
-
- Assert.IsTrue(service.Transport.Equals("tcp"));
-
- Assert.IsTrue(service.Host.Equals("localhost"));
- Assert.IsTrue(service.Port == 5672);
- }
-
- [Test]
- public void SingleTransportMultiOptionURL()
- {
- String url = "amqp://guest:guest@default/temp?brokerlist='tcp://localhost:5672',routingkey='jim',timeout='200',immediatedelivery='true'";
-
- IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url);
-
- Assert.IsTrue(connectionurl.FailoverMethod == null);
- Assert.IsTrue(connectionurl.Username.Equals("guest"));
- Assert.IsTrue(connectionurl.Password.Equals("guest"));
- Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp"));
-
- Assert.IsTrue(connectionurl.BrokerCount == 1);
-
- IBrokerInfo service = connectionurl.GetBrokerInfo(0);
-
- Assert.IsTrue(service.Transport.Equals("tcp"));
-
- Assert.IsTrue(service.Host.Equals("localhost"));
- Assert.IsTrue(service.Port == 5672);
-
- Assert.IsTrue(connectionurl.GetOption("routingkey").Equals("jim"));
- Assert.IsTrue(connectionurl.GetOption("timeout").Equals("200"));
- Assert.IsTrue(connectionurl.GetOption("immediatedelivery").Equals("true"));
- }
-
- [Test]
- public void SinglevmURL()
- {
- String url = "amqp://guest:guest@default/messages?brokerlist='vm://default:2'";
-
- IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url);
-
- Assert.IsTrue(connectionurl.FailoverMethod == null);
- Assert.IsTrue(connectionurl.Username.Equals("guest"));
- Assert.IsTrue(connectionurl.Password.Equals("guest"));
- Assert.IsTrue(connectionurl.VirtualHost.Equals("/messages"));
-
- Assert.IsTrue(connectionurl.BrokerCount == 1);
-
- IBrokerInfo service = connectionurl.GetBrokerInfo(0);
-
- Assert.IsTrue(service.Transport.Equals("vm"));
- Assert.AreEqual("localhost", service.Host);
- Assert.AreEqual(2, service.Port);
- }
-
- [Test]
- public void FailoverVMURL()
- {
- String url = "amqp://ritchiem:bob@default/temp?brokerlist='vm://default:2;vm://default:3',failover='roundrobin'";
-
- IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url);
-
- Assert.IsTrue(connectionurl.FailoverMethod.Equals("roundrobin"));
- Assert.IsTrue(connectionurl.Username.Equals("ritchiem"));
- Assert.IsTrue(connectionurl.Password.Equals("bob"));
- Assert.IsTrue(connectionurl.VirtualHost.Equals("/temp"));
-
- Assert.AreEqual(2, connectionurl.BrokerCount);
-
- IBrokerInfo service = connectionurl.GetBrokerInfo(0);
-
- Assert.IsTrue(service.Transport.Equals("vm"));
- Assert.AreEqual("localhost", service.Host);
- Assert.IsTrue(service.Port == 2);
-
- service = connectionurl.GetBrokerInfo(1);
- Assert.IsTrue(service.Transport.Equals("vm"));
- Assert.AreEqual("localhost", service.Host);
- Assert.IsTrue(service.Port == 3);
- }
-
- [Test]
- public void NoVirtualHostURL()
- {
- String url = "amqp://user@default?brokerlist='tcp://localhost:5672'";
-
- try
- {
- QpidConnectionInfo.FromUrl(url);
- Assert.Fail("URL has no virtual host should not parse");
- }
- catch (UrlSyntaxException)
- {
- // This should occur.
- }
- }
-
- [Test]
- public void NoClientID()
- {
- String url = "amqp://user:@default/test?brokerlist='tcp://localhost:5672'";
-
- IConnectionInfo connectionurl = QpidConnectionInfo.FromUrl(url);
-
- Assert.IsTrue(connectionurl.Username.Equals("user"));
- Assert.IsTrue(connectionurl.Password.Equals(""));
- Assert.IsTrue(connectionurl.VirtualHost.Equals("/test"));
- Assert.IsTrue(connectionurl.ClientName.StartsWith(Dns.GetHostName()));
-
- Assert.IsTrue(connectionurl.BrokerCount == 1);
- }
-
- [Test]
- public void WrongOptionSeparatorInOptions()
- {
- String url = "amqp://guest:guest@default/test?brokerlist='tcp://localhost:5672;tcp://localhost:5673'+failover='roundrobin'";
- try
- {
- QpidConnectionInfo.FromUrl(url);
- Assert.Fail("URL Should not parse");
- }
- catch (UrlSyntaxException urise)
- {
- Assert.IsTrue(urise.Message.Equals("Unterminated option. Possible illegal option separator:'+'"));
- }
-
- }
-
- [Test]
- public void NoUserDetailsProvidedWithClientID()
-
- {
- String url = "amqp://clientID/test?brokerlist='tcp://localhost:5672;tcp://localhost:5673'";
- try
- {
- QpidConnectionInfo.FromUrl(url);
- Assert.Fail("URL Should not parse");
- }
- catch (UrlSyntaxException urise)
- {
- Assert.IsTrue(urise.Message.StartsWith("User information not found on url"));
- }
-
- }
-
- [Test]
- public void NoUserDetailsProvidedNOClientID()
-
- {
- String url = "amqp:///test@default?brokerlist='tcp://localhost:5672;tcp://localhost:5673'";
- try
- {
- QpidConnectionInfo.FromUrl(url);
- Assert.Fail("URL Should not parse");
- }
- catch (UrlSyntaxException urise)
- {
-
- Assert.IsTrue(urise.Message.StartsWith("User information not found on url"));
- }
-
- }
-
- [Test]
- public void CheckVirtualHostFormat()
- {
- String url = "amqp://guest:guest@default/t.-_+!=:?brokerlist='tcp://localhost:5672'";
-
- IConnectionInfo connection = QpidConnectionInfo.FromUrl(url);
- Assert.IsTrue(connection.VirtualHost.Equals("/t.-_+!=:"));
- }
-
- [Test]
- public void CheckDefaultPort()
- {
- String url = "amqp://guest:guest@default/test=:?brokerlist='tcp://localhost'";
-
- IConnectionInfo connection = QpidConnectionInfo.FromUrl(url);
-
- IBrokerInfo broker = connection.GetBrokerInfo(0);
- Assert.IsTrue(broker.Port == BrokerInfoConstants.DEFAULT_PORT);
-
- }
-
- [Test]
- public void CheckMissingFinalQuote()
- {
- String url = "amqp://guest:guest@id/test" + "?brokerlist='tcp://localhost:5672";
-
- try
- {
- QpidConnectionInfo.FromUrl(url);
- }
- catch (UrlSyntaxException e)
- {
-// Assert.AreEqual("Unterminated option at index 32: brokerlist='tcp://localhost:5672",
-// e.Message);
- Assert.AreEqual("Unterminated option", e.Message);
- }
- }
-
- [Test]
- public void ValidateQpidConnectionInfoFromToString()
- {
- String url = "amqp://ritchiem:bob@default/temp?brokerlist='tcp://localhost:5672;tcp://fancyserver:3000/',failover='roundrobin'";
-
- IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(url);
- IConnectionInfo connectionInfo1 = QpidConnectionInfo.FromUrl(connectionInfo.ToString());
-
- Console.WriteLine(connectionInfo.ToString());
- Console.WriteLine(connectionInfo1.ToString());
-
- Assert.AreEqual(connectionInfo.Username, connectionInfo1.Username);
- Assert.AreEqual(connectionInfo.Password, connectionInfo1.Password);
- Assert.AreEqual(connectionInfo.VirtualHost, connectionInfo1.VirtualHost);
-
- Assert.IsTrue((connectionInfo1.GetAllBrokerInfos().Count == 2));
- Assert.IsTrue(connectionInfo.GetBrokerInfo(0).Equals(connectionInfo1.GetBrokerInfo(0)));
- Assert.IsTrue(connectionInfo.GetBrokerInfo(1).Equals(connectionInfo1.GetBrokerInfo(1)));
-
- }
-
- [Test]
- public void EnsureVirtualHostStartsWithSlash()
- {
- IConnectionInfo connection = new QpidConnectionInfo();
- connection.VirtualHost = "test";
- Assert.AreEqual("/test", connection.VirtualHost);
-
- connection.VirtualHost = "/mytest";
- Assert.AreEqual("/mytest", connection.VirtualHost);
-
- connection.VirtualHost = "";
- Assert.AreEqual("/", connection.VirtualHost);
-
- connection.VirtualHost = null;
- Assert.AreEqual("/", connection.VirtualHost);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.cs
deleted file mode 100644
index b62b11a3db..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.cs
+++ /dev/null
@@ -1,135 +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;
-using System.Net;
-using System.Net.Sockets;
-using log4net;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Client.Protocol;
-
-namespace Apache.Qpid.Client.Transport.Socket.Blocking
-{
- class BlockingSocketProcessor : IConnectionCloser
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(BlockingSocketProcessor));
-
- string _host;
- int _port;
- System.Net.Sockets.Socket _socket;
- private NetworkStream _networkStream;
- IByteChannel _byteChannel;
- IProtocolListener _protocolListener;
-
- public BlockingSocketProcessor(string host, int port, IProtocolListener protocolListener)
- {
- _host = host;
- _port = port;
- _protocolListener = protocolListener;
- _byteChannel = new ByteChannel(this);
- }
-
- /// <summary>
- /// Synchronous blocking connect.
- /// </summary>
- public void Connect()
- {
- _socket = new System.Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-
- /// For future note TCP Set NoDelay options may help, though with the blocking io not sure
- /// The Don't linger may help with detecting disconnect but that hasn't been the case in testing.
- /// _socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.NoDelay, 0);
- /// _socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.DontLinger, 0);
-
- IPHostEntry ipHostInfo = Dns.Resolve(_host); // Note: don't fix this warning. We do this for .NET 1.1 compatibility.
- IPAddress ipAddress = ipHostInfo.AddressList[0];
-
- IPEndPoint ipe = new IPEndPoint(ipAddress, _port);
-
- _socket.Connect(ipe);
- _networkStream = new NetworkStream(_socket, true);
- }
-
- public string getLocalEndPoint()
- {
- return _socket.LocalEndPoint.ToString();
- }
-
- public void Write(ByteBuffer byteBuffer)
- {
- try
- {
- _networkStream.Write(byteBuffer.array(), byteBuffer.position(), byteBuffer.limit()); // FIXME
- }
- catch (Exception e)
- {
- _log.Error("Write caused exception", e);
- _protocolListener.OnException(e);
- // We should provide the error synchronously as we are doing blocking io.
- throw e;
- }
- }
-
- public ByteBuffer Read()
- {
- const int bufferSize = 4 * 1024; // TODO: Prevent constant allocation of buffers.
- byte[] bytes = new byte[bufferSize];
-
- int numOctets = _networkStream.Read(bytes, 0, bytes.Length);
-
- /// Read only returns 0 if the socket has been gracefully shutdown.
- /// http://msdn2.microsoft.com/en-us/library/system.net.sockets.networkstream.read(VS.71).aspx
- /// We can use this to block Send so the next Read will force an exception forcing failover.
- /// Otherwise we need to wait ~20 seconds for the NetworkStream/Socket code to realise that
- /// the socket has been closed.
- if (numOctets == 0)
- {
- _socket.Shutdown(SocketShutdown.Send);
- _socket.Close();
- }
-
- ByteBuffer byteBuffer = ByteBuffer.wrap(bytes);
- byteBuffer.limit(numOctets);
-
- byteBuffer.flip();
-
- return byteBuffer;
- }
-
- public void Disconnect()
- {
- _networkStream.Flush();
- _networkStream.Close();
- _socket.Close();
- }
-
- public void Close()
- {
- Disconnect();
- }
-
- public IByteChannel ByteChannel
- {
- get { return _byteChannel; }
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketTransport.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketTransport.cs
deleted file mode 100644
index 17f911fb6d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketTransport.cs
+++ /dev/null
@@ -1,121 +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;
-using System.Collections;
-using System.Threading;
-using log4net;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Framing;
-
-namespace Qpid.Client.Transport.Socket.Blocking
-{
- public class BlockingSocketTransport : ITransport
- {
-// static readonly ILog _log = LogManager.GetLogger(typeof(BlockingSocketTransport));
-
- // Configuration variables.
- string _host;
- int _port;
- IProtocolListener _protocolListener;
-
- // Runtime variables.
- private BlockingSocketProcessor _socketProcessor;
- private AmqpChannel _amqpChannel;
-
- private ReaderRunner _readerRunner;
- private Thread _readerThread;
-
- public BlockingSocketTransport(string host, int port, AMQConnection connection)
- {
- _host = host;
- _port = port;
- _protocolListener = connection.ProtocolListener;
- }
-
- public void Open()
- {
- _socketProcessor = new BlockingSocketProcessor(_host, _port, _protocolListener);
- _socketProcessor.Connect();
- _amqpChannel = new AmqpChannel(_socketProcessor.ByteChannel);
- _readerRunner = new ReaderRunner(this);
- _readerThread = new Thread(new ThreadStart(_readerRunner.Run));
- _readerThread.Start();
- }
-
- public string getLocalEndPoint()
- {
- return _socketProcessor.getLocalEndPoint();
- }
-
- public void Close()
- {
- StopReaderThread();
- _socketProcessor.Disconnect();
- }
-
- public IProtocolChannel ProtocolChannel { get { return _amqpChannel; } }
- public IProtocolWriter ProtocolWriter { get { return _amqpChannel; } }
-
- public void StopReaderThread()
- {
- _readerRunner.Stop();
- }
-
- class ReaderRunner
- {
- BlockingSocketTransport _transport;
- bool _running = true;
-
- public ReaderRunner(BlockingSocketTransport transport)
- {
- _transport = transport;
- }
-
- public void Run()
- {
- try
- {
- while (_running)
- {
- Queue frames = _transport.ProtocolChannel.Read();
-
- foreach (IDataBlock dataBlock in frames)
- {
- _transport._protocolListener.OnMessage(dataBlock);
- }
- }
- }
- catch (Exception e)
- {
- _transport._protocolListener.OnException(e);
- }
- }
-
- public void Stop()
- {
- // TODO: Check if this is thread safe. running is not volitile....
- _running = false;
- }
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/ByteChannel.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/ByteChannel.cs
deleted file mode 100644
index 5f67e99838..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/ByteChannel.cs
+++ /dev/null
@@ -1,63 +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;
-using log4net;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Client.Transport.Socket.Blocking
-{
- class ByteChannel : IByteChannel
- {
- // Warning: don't use this log for regular logging.
- private static readonly ILog _ioTraceLog = LogManager.GetLogger("TRACE.Qpid.Client.ByteChannel");
-
- BlockingSocketProcessor processor;
-
- public ByteChannel(BlockingSocketProcessor processor)
- {
- this.processor = processor;
- }
-
- public ByteBuffer Read()
- {
- ByteBuffer result = processor.Read();
-
- // TODO: Move into decorator.
- if (_ioTraceLog.IsDebugEnabled)
- {
- _ioTraceLog.Debug(String.Format("READ {0}", result));
- }
-
- return result;
- }
-
- public void Write(ByteBuffer buffer)
- {
- // TODO: Move into decorator.
- if (_ioTraceLog.IsDebugEnabled)
- {
- _ioTraceLog.Debug(String.Format("WRITE {0}", buffer));
- }
-
- processor.Write(buffer);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Properties/AssemblyInfo.cs
deleted file mode 100644
index e50bacdfc7..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-using System.Reflection;
-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.Transport.Blocking")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.Transport.Blocking")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("ca23e89c-f5b9-4f7a-929a-4fae00ef055b")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj b/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj
deleted file mode 100644
index 6a0b1cd8e6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj
+++ /dev/null
@@ -1,92 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{52AC4940-2077-4104-A753-29A9C8C16957}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Client.Transport.Socket.Blocking</RootNamespace>
- <AssemblyName>Apache.Qpid.Client.Transport.Socket.Blocking</AssemblyName>
- </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="log4net, Version=1.2.0.30714, Culture=neutral, PublicKeyToken=500ffcafb14f92df">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Qpid.Common\lib\log4net\log4net.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="BlockingSocketProcessor.cs" />
- <Compile Include="BlockingSocketTransport.cs" />
- <Compile Include="ByteChannel.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Buffer\Qpid.Buffer.csproj">
- <Project>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</Project>
- <Name>Qpid.Buffer</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Client\Qpid.Client.csproj">
- <Project>{68987C05-3768-452C-A6FC-6BA1D372852F}</Project>
- <Name>Qpid.Client</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Common\Qpid.Common.csproj">
- <Project>{77064C42-24D2-4CEB-9EA2-0EF481A43205}</Project>
- <Name>Qpid.Common</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Messaging\Qpid.Messaging.csproj">
- <Project>{6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}</Project>
- <Name>Qpid.Messaging</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.mdp b/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.mdp
deleted file mode 100644
index 8f95000a4a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.mdp
+++ /dev/null
@@ -1,30 +0,0 @@
-<Project name="Qpid.Client.Transport.Socket.Blocking" fileversion="2.0" language="C#" clr-version="Net_1_1" ctype="DotNetProject">
- <Configurations active="Debug">
- <Configuration name="Debug" ctype="DotNetProjectConfiguration">
- <Output directory="./bin/Debug" assembly="Qpid.Client.Transport.Socket.Blocking" />
- <Build debugmode="True" target="Library" />
- <Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_1_1" />
- <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
- </Configuration>
- <Configuration name="Release" ctype="DotNetProjectConfiguration">
- <Output directory="./bin/Release" assembly="Qpid.Client.Transport.Socket.Blocking" />
- <Build debugmode="False" target="Library" />
- <Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_1_1" />
- <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
- </Configuration>
- </Configurations>
- <DeployTargets />
- <Contents>
- <File name="./Properties/AssemblyInfo.cs" subtype="Code" buildaction="Compile" />
- <File name="./BlockingSocketProcessor.cs" subtype="Code" buildaction="Compile" />
- <File name="./BlockingSocketTransport.cs" subtype="Code" buildaction="Compile" />
- <File name="./ByteChannel.cs" subtype="Code" buildaction="Compile" />
- </Contents>
- <References>
- <ProjectReference type="Gac" localcopy="True" refto="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
- <ProjectReference type="Assembly" localcopy="True" refto="../Qpid.Common/lib/log4net/log4net.dll" />
- <ProjectReference type="Project" localcopy="True" refto="Qpid.Buffer" />
- <ProjectReference type="Project" localcopy="True" refto="Qpid.Client" />
- <ProjectReference type="Project" localcopy="True" refto="Qpid.Common" />
- </References>
-</Project> \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQAuthenticationException.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQAuthenticationException.cs
deleted file mode 100644
index 6382eaaf39..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQAuthenticationException.cs
+++ /dev/null
@@ -1,39 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Client
-{
- [Serializable]
- public class AMQAuthenticationException : AMQException
- {
- public AMQAuthenticationException(int error, String message)
- : base(error, message)
- {
- }
-
- protected AMQAuthenticationException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQConnection.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQConnection.cs
deleted file mode 100644
index 41d4e089b6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQConnection.cs
+++ /dev/null
@@ -1,873 +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;
-using System.Collections;
-using System.IO;
-using System.Reflection;
-using System.Threading;
-using log4net;
-using Apache.Qpid.Client.Failover;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Client.Transport;
-using Apache.Qpid.Client.Transport.Socket.Blocking;
-using Apache.Qpid.Collections;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client
-{
- public class AMQConnection : Closeable, IConnection
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(AMQConnection));
-
- IConnectionInfo _connectionInfo;
- private int _nextChannelId = 0;
-
- // _Connected should be refactored with a suitable wait object.
- private bool _connected;
-
- Thread _heartBeatThread;
- HeartBeatThread _heartBeatRunner;
-
- // The last error code that occured on the connection. Used to return the correct exception to the client
- private AMQException _lastAMQException = null;
-
- /**
- * This is the "root" mutex that must be held when doing anything that could be impacted by failover.
- * This must be held by any child objects of this connection such as the session, producers and consumers.
- */
- private readonly Object _failoverMutex = new Object();
- public object FailoverMutex
- {
- get { return _failoverMutex; }
- }
-
- /**
- * Policy dictating how to failover
- */
- private FailoverPolicy _failoverPolicy;
-
- internal bool IsFailoverAllowed
- {
- get { if(!_connected) return false; else return _failoverPolicy.FailoverAllowed(); }
- }
-
- /// <summary>
- /// A channel is roughly analogous to a session. The server can negotiate the maximum number of channels
- /// per session and we must prevent the client from opening too many. Zero means unlimited.
- /// </summary>
- private ushort _maximumChannelCount;
-
- /// <summary>
- /// The maximum size of frame supported by the server
- /// </summary>
- private uint _maximumFrameSize;
-
- private AMQStateManager _stateManager;
-
- private AMQProtocolSession _protocolSession;
- public AMQProtocolSession ProtocolSession { get { return _protocolSession; } }
-
- /// <summary>
- /// Maps from session id (Integer) to AmqChannel instance
- /// </summary>
- private readonly IDictionary _sessions = new LinkedHashtable();
-
- private ExceptionListenerDelegate _exceptionListener;
-
- private IConnectionListener _connectionListener;
-
- private ITransport _transport;
- public ITransport Transport { get { return _transport; } }
-
- /// <summary>
- /// Whether this connection is started, i.e. whether messages are flowing to consumers. It has no meaning for
- /// message publication.
- /// </summary>
- private bool _started;
-
- private AMQProtocolListener _protocolListener;
- public AMQProtocolListener ProtocolListener { get { return _protocolListener; } }
-
- public IProtocolWriter ProtocolWriter
- {
- get { return _transport.ProtocolWriter; }
- }
-
- ProtocolWriter _protocolWriter;
-
- public ProtocolWriter ConvenientProtocolWriter
- {
- get { return _protocolWriter; }
- }
-
- public AMQConnection(IConnectionInfo connectionInfo)
- {
- if (connectionInfo == null)
- {
- throw new ArgumentException("ConnectionInfo must be specified");
- }
- _log.Debug("ConnectionInfo: " + connectionInfo);
- _connectionInfo = connectionInfo;
- _log.Debug("password = " + _connectionInfo.Password);
- _failoverPolicy = new FailoverPolicy(connectionInfo);
-
- // We are not currently connected.
- _connected = false;
-
- Exception lastException = null;
- do
- {
- try
- {
- IBrokerInfo brokerInfo = _failoverPolicy.GetNextBrokerInfo();
- _log.Debug("Connecting to " + brokerInfo);
- MakeBrokerConnection(brokerInfo);
- break;
- }
- catch (Exception e)
- {
- lastException = e;
- _log.Error("Unable to connect to broker " + _failoverPolicy.GetCurrentBrokerInfo(), e);
- // XXX: Should perhaps break out of the do/while here if not a SocketException...
- }
- } while (!_connected && _failoverPolicy.FailoverAllowed());
-
- _log.Debug("Are we connected:" + _connected);
-
- if (!_connected)
- {
- if ( lastException is AMQException )
- {
- throw lastException;
- }
- else
- {
- throw new AMQConnectionException("Unable to connect", lastException);
- }
- }
-
- }
-
- /*private ITransport LoadTransportFromAssembly(string host, int port, String assemblyName, String transportType)
- {
- //Assembly assembly = Assembly.LoadFrom(assemblyName);
- Assembly assembly = Assembly.Load(assemblyName);
-
- foreach (Type type in assembly.GetTypes())
- {
- _log.Debug(String.Format("type = {0}", type));
- }
-
- Type transport = assembly.GetType(transportType);
-
- if (transport == null)
- {
- throw new ArgumentException(
- String.Format("Type is not found in assembly. Type={0} Assembly={1}", transportType, assemblyName));
-
- }
-
- _log.Debug("transport = " + transport);
- _log.Debug("ctors = " + transport.GetConstructors());
-
- ConstructorInfo info = transport.GetConstructors()[0];
- ITransport result = (ITransport)info.Invoke(new object[] { host, port, this });
-
- _log.Debug("transport = " + result);
-
- return result;
- }*/
-
- public void Disconnect()
- {
- _transport.Close();
- }
-
- #region IConnection Members
-
- public string ClientID
- {
- get
- {
- CheckNotClosed();
- return _connectionInfo.ClientName;
- }
- set
- {
- CheckNotClosed();
- _connectionInfo.ClientName = value;
- }
- }
-
- public override void Close()
- {
- lock (FailoverMutex)
- {
- // atomically set to closed and check the _previous value was NOT CLOSED
- if (Interlocked.Exchange(ref _closed, CLOSED) == NOT_CLOSED)
- {
- try
- {
- CloseAllSessions(null);
- CloseConnection();
- }
- catch (AMQException e)
- {
- throw new QpidException("Error closing connection: " + e);
- }
- }
- }
- }
-
- private void CloseConnection()
- {
- _stateManager.ChangeState(AMQState.CONNECTION_CLOSING);
-
- AMQFrame frame = ConnectionCloseBody.CreateAMQFrame(
- 0, 200, "Qpid.NET client is closing the connection.", 0, 0);
-
- ProtocolWriter.Write(frame);
-
- _log.Debug("Blocking for connection close ok frame");
-
- Disconnect();
- }
-
- class CreateChannelFailoverSupport : FailoverSupport
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(CreateChannelFailoverSupport));
-
- private bool _transacted;
- private AcknowledgeMode _acknowledgeMode;
- int _prefetchHigh;
- int _prefetchLow;
- AMQConnection _connection;
-
- public CreateChannelFailoverSupport(AMQConnection connection, bool transacted, AcknowledgeMode acknowledgeMode, int prefetchHigh, int prefetchLow)
- {
- _connection = connection;
- _transacted = transacted;
- _acknowledgeMode = acknowledgeMode;
- _prefetchHigh = prefetchHigh;
- _prefetchLow = prefetchLow;
- }
-
- protected override object operation()
- {
- ushort channelId = _connection.NextChannelId();
-
- if (_log.IsDebugEnabled)
- {
- _log.Debug("Write channel open frame for channel id " + channelId);
- }
-
- // We must create the channel and register it before actually sending the frame to the server to
- // open it, so that there is no window where we could receive data on the channel and not be set
- // up to handle it appropriately.
- AmqChannel channel = new AmqChannel(_connection,
- channelId, _transacted, _acknowledgeMode, _prefetchHigh, _prefetchLow);
- _connection.ProtocolSession.AddSessionByChannel(channelId, channel);
- _connection.RegisterSession(channelId, channel);
-
- bool success = false;
- try
- {
- _connection.CreateChannelOverWire(channelId, _prefetchHigh, _prefetchLow, _transacted);
- success = true;
- }
- catch (AMQException e)
- {
- throw new QpidException("Error creating channel: " + e, e);
- }
- finally
- {
- if (!success) {
- _connection.ProtocolSession.RemoveSessionByChannel(channelId);
- _connection.DeregisterSession(channelId);
- }
- }
-
- if (_connection._started)
- {
- channel.Start();
- }
- return channel;
- }
- }
-
- internal ushort NextChannelId()
- {
- return (ushort) Interlocked.Increment(ref _nextChannelId);
- }
-
- public IChannel CreateChannel(bool transacted, AcknowledgeMode acknowledgeMode)
- {
- return CreateChannel(transacted, acknowledgeMode, AmqChannel.DEFAULT_PREFETCH_HIGH_MARK);
- }
-
- public IChannel CreateChannel(bool transacted, AcknowledgeMode acknowledgeMode, int prefetch)
- {
- return CreateChannel(transacted, acknowledgeMode, prefetch, prefetch);
- }
-
- public IChannel CreateChannel(bool transacted, AcknowledgeMode acknowledgeMode, int prefetchHigh, int prefetchLow)
- {
- CheckNotClosed();
- if (ChannelLimitReached())
- {
- throw new ChannelLimitReachedException(_maximumChannelCount);
- }
- else
- {
- CreateChannelFailoverSupport operation =
- new CreateChannelFailoverSupport(this, transacted, acknowledgeMode, prefetchHigh, prefetchLow);
- return (IChannel)operation.execute(this);
- }
- }
-
- public void CloseSession(AmqChannel channel)
- {
- // FIXME: Don't we need FailoverSupport here (as we have SyncWrite).
- _protocolSession.CloseSession(channel);
-
- AMQFrame frame = ChannelCloseBody.CreateAMQFrame(
- channel.ChannelId, 200, "JMS client closing channel", 0, 0);
-
- _log.Debug("Blocking for channel close frame for channel " + channel.ChannelId);
- _protocolWriter.SyncWrite(frame, typeof(ChannelCloseOkBody));
- _log.Debug("Received channel close frame");
- // When control resumes at this point, a reply will have been received that
- // indicates the broker has closed the channel successfully
- }
-
- public ExceptionListenerDelegate ExceptionListener
- {
- get
- {
- CheckNotClosed();
- return _exceptionListener;
- }
- set
- {
- CheckNotClosed();
- _exceptionListener = value;
- }
- }
-
- /// <summary>
- /// Start the connection, i.e. start flowing messages. Note that this method must be called only from a single thread
- /// and is not thread safe (which is legal according to the JMS specification).
- /// @throws JMSException
- /// </summary>
- public void Start()
- {
- CheckNotClosed();
-
- if (!_started)
- {
- foreach (DictionaryEntry lde in _sessions)
- {
- AmqChannel s = (AmqChannel)lde.Value;
- s.Start();
- }
- _started = true;
- }
- }
-
- public void Stop()
- {
- CheckNotClosed();
-
- if (_started)
- {
- foreach (DictionaryEntry lde in _sessions)
- {
- AmqChannel s = (AmqChannel) lde.Value;
- s.Stop();
- }
- _started = false;
- }
- }
-
- public IConnectionListener ConnectionListener
- {
- get { return _connectionListener; }
- set { _connectionListener = value; }
- }
-
- #endregion
-
- #region IDisposable Members
-
- public void Dispose()
- {
- Close();
- }
-
- #endregion
-
- private bool ChannelLimitReached()
- {
- return _maximumChannelCount != 0 && _sessions.Count == _maximumChannelCount;
- }
-
- /// <summary>
- /// Close all the sessions, either due to normal connection closure or due to an error occurring.
- /// @param cause if not null, the error that is causing this shutdown
- /// </summary>
- private void CloseAllSessions(Exception cause)
- {
- _log.Debug("Closing all session in connection " + this);
- ICollection sessions = new ArrayList(_sessions.Values);
- foreach (AmqChannel channel in sessions)
- {
- _log.Debug("Closing channel " + channel);
- if (cause != null)
- {
- channel.ClosedWithException(cause);
- }
- else
- {
- try
- {
- channel.Close();
- }
- catch (QpidException e)
- {
- _log.Error("Error closing channel: " + e);
- }
- }
- }
- _log.Debug("Done closing all sessions in connection " + this);
- }
-
- public int MaximumChannelCount
- {
- get
- {
- CheckNotClosed();
- return _maximumChannelCount;
- }
- }
-
- internal void SetMaximumChannelCount(ushort maximumChannelCount)
- {
- CheckNotClosed();
- _maximumChannelCount = maximumChannelCount;
- }
-
- public uint MaximumFrameSize
- {
- get
- {
- return _maximumFrameSize;
- }
-
- set
- {
- _maximumFrameSize = value;
- }
- }
-
- public IDictionary Sessions
- {
- get
- {
- return _sessions;
- }
- }
-
- public string Host
- {
- get
- {
- return _failoverPolicy.GetCurrentBrokerInfo().Host;
- }
- }
-
- public int Port
- {
- get
- {
- return _failoverPolicy.GetCurrentBrokerInfo().Port;
- }
- }
-
- public string Username
- {
- get
- {
- return _connectionInfo.Username;
- }
- }
-
- public string Password
- {
- get
- {
- return _connectionInfo.Password;
- }
- }
-
- public string VirtualHost
- {
- get
- {
- return _connectionInfo.VirtualHost;
- }
- }
-
- /// <summary>
- /// Invoked by the AMQProtocolSession when a protocol session exception has occurred.
- /// This method sends the exception to a JMS exception listener, if configured, and
- /// propagates the exception to sessions, which in turn will propagate to consumers.
- /// This allows synchronous consumers to have exceptions thrown to them.
- /// </summary>
- /// <param name="cause">the exception</param>
- public void ExceptionReceived(Exception cause)
- {
- if (_exceptionListener != null)
- {
- // Listener expects one of these...
- QpidException xe;
-
- if (cause is QpidException)
- {
- xe = (QpidException) cause;
- }
- else
- {
- xe = new QpidException("Exception thrown against " + ToString() + ": " + cause, cause);
- }
- // in the case of an IOException, MINA has closed the protocol session so we set _closed to true
- // so that any generic client code that tries to close the connection will not mess up this error
- // handling sequence
- if (cause is IOException)
- {
- Interlocked.Exchange(ref _closed, CLOSED);
- }
-#if __MonoCS__
- _exceptionListener(xe);
-#else
- _exceptionListener.Invoke(xe);
-#endif
- }
- else
- {
- _log.Error("Connection exception: " + cause);
- }
-
- // An undelivered is not fatal to the connections usability.
- if (!(cause is AMQUndeliveredException))
- {
- Interlocked.Exchange(ref _closed, CLOSED);
- CloseAllSessions(cause);
- }
- else
- {
- ;
- }
- }
-
- internal void RegisterSession(int channelId, AmqChannel channel)
- {
- _sessions[channelId] = channel;
- }
-
- internal void DeregisterSession(int channelId)
- {
- _sessions.Remove(channelId);
- }
-
- /**
- * Fire the preFailover event to the registered connection listener (if any)
- *
- * @param redirect true if this is the result of a redirect request rather than a connection error
- * @return true if no listener or listener does not veto change
- */
- public bool FirePreFailover(bool redirect)
- {
- bool proceed = true;
- if (_connectionListener != null)
- {
- proceed = _connectionListener.PreFailover(redirect);
- }
- return proceed;
- }
-
- /**
- * Fire the preResubscribe event to the registered connection listener (if any). If the listener
- * vetoes resubscription then all the sessions are closed.
- *
- * @return true if no listener or listener does not veto resubscription.
- * @throws JMSException
- */
- public bool FirePreResubscribe()
- {
- if (_connectionListener != null)
- {
- bool resubscribe = _connectionListener.PreResubscribe();
- if (!resubscribe)
- {
- MarkAllSessionsClosed();
- }
- return resubscribe;
- }
- else
- {
- return true;
- }
- }
-
- /**
- * Marks all sessions and their children as closed without sending any protocol messages. Useful when
- * you need to mark objects "visible" in userland as closed after failover or other significant event that
- * impacts the connection.
- * <p/>
- * The caller must hold the failover mutex before calling this method.
- */
- private void MarkAllSessionsClosed()
- {
- //LinkedList sessionCopy = new LinkedList(_sessions.values());
- ArrayList sessionCopy = new ArrayList(_sessions.Values);
- foreach (AmqChannel session in sessionCopy)
- {
- session.MarkClosed();
- }
- _sessions.Clear();
- }
-
- /**
- * Fires a failover complete event to the registered connection listener (if any).
- */
- public void FireFailoverComplete()
- {
- if (_connectionListener != null)
- {
- _connectionListener.FailoverComplete();
- }
- }
-
- public bool AttemptReconnection(String host, int port, SslOptions sslConfig)
- {
- IBrokerInfo bd = new AmqBrokerInfo("amqp", host, port, sslConfig);
-
- _failoverPolicy.setBroker(bd);
-
- try
- {
- MakeBrokerConnection(bd);
- return true;
- }
- catch (Exception e)
- {
- _log.Debug("Unable to connect to broker at " + bd, e);
- AttemptReconnection();
- }
- return false;
- }
-
- private void MakeBrokerConnection(IBrokerInfo brokerDetail)
- {
- try
- {
- _stateManager = new AMQStateManager();
- _protocolListener = new AMQProtocolListener(this, _stateManager);
- _protocolListener.AddFrameListener(_stateManager);
-
- /*
- // Currently there is only one transport option - BlockingSocket.
- String assemblyName = "Apache.Qpid.Client.Transport.Socket.Blocking.dll";
- String transportType = "Apache.Qpid.Client.Transport.Socket.Blocking.BlockingSocketTransport";
-
- // Load the transport assembly dynamically.
- _transport = LoadTransportFromAssembly(brokerDetail.getHost(), brokerDetail.getPort(), assemblyName, transportType);
- */
-
- _transport = new BlockingSocketTransport();
-
- // Connect.
- _transport.Connect(brokerDetail, this);
- _protocolWriter = new ProtocolWriter(_transport.ProtocolWriter, _protocolListener);
- _protocolSession = new AMQProtocolSession(_transport.ProtocolWriter, _transport, this);
- _protocolListener.ProtocolSession = _protocolSession;
-
- // Now start the connection "handshake".
- _transport.ProtocolWriter.Write(new ProtocolInitiation());
-
- // Blocks until the connection has been opened.
- _stateManager.AttainState(AMQState.CONNECTION_OPEN);
-
- _failoverPolicy.attainedConnection();
-
- // XXX: Again this should be changed to a suitable notify.
- _connected = true;
- }
- catch (AMQException e)
- {
- _lastAMQException = e;
- throw; // rethrow
- }
- }
-
- public bool AttemptReconnection()
- {
- while (_failoverPolicy.FailoverAllowed())
- {
- try
- {
- MakeBrokerConnection(_failoverPolicy.GetNextBrokerInfo());
- return true;
- }
- catch (Exception e)
- {
- if (!(e is AMQException))
- {
- _log.Debug("Unable to connect to broker at " + _failoverPolicy.GetCurrentBrokerInfo(), e);
- }
- else
- {
- _log.Debug(e.Message + ":Unable to connect to broker at " + _failoverPolicy.GetCurrentBrokerInfo());
- }
- }
- }
-
- // Connection unsuccessful.
- return false;
- }
-
- /**
- * For all channels, and for all consumers in those sessions, resubscribe. This is called during failover handling.
- * The caller must hold the failover mutex before calling this method.
- */
- public void ResubscribeChannels()
- {
- ArrayList channels = new ArrayList(_sessions.Values);
- _log.Debug(String.Format("Resubscribing sessions = {0} sessions.size={1}", channels, channels.Count));
- foreach (AmqChannel channel in channels)
- {
- _protocolSession.AddSessionByChannel(channel.ChannelId, channel);
- ReopenChannel(
- channel.ChannelId,
- channel.DefaultPrefetchHigh,
- channel.DefaultPrefetchLow,
- channel.Transacted
- );
- channel.ReplayOnFailOver();
- }
- }
-
- private void ReopenChannel(ushort channelId, int prefetchHigh, int prefetchLow, bool transacted)
- {
- _log.Debug(string.Format("Reopening channel id={0} prefetchHigh={1} prefetchLow={2} transacted={3}",
- channelId, prefetchHigh, prefetchLow, transacted));
- try
- {
- CreateChannelOverWire(channelId, prefetchHigh, prefetchLow, transacted);
- }
- catch (AMQException e)
- {
- _protocolSession.RemoveSessionByChannel(channelId);
- DeregisterSession(channelId);
- throw new AMQException("Error reopening channel " + channelId + " after failover: " + e);
- }
- }
-
- void CreateChannelOverWire(ushort channelId, int prefetchHigh, int prefetchLow, bool transacted)
- {
- _protocolWriter.SyncWrite(ChannelOpenBody.CreateAMQFrame(channelId, null), typeof (ChannelOpenOkBody));
-
- // Don't use the BasicQos frame if connecting to OpenAMQ (at it is not support). We
- // know this when we connection using AMQP 0.7
- if (ProtocolInitiation.CURRENT_PROTOCOL_VERSION_MAJOR != 7)
- {
- // Basic.Qos frame appears to not be supported by OpenAMQ 1.0d.
- _protocolWriter.SyncWrite(BasicQosBody.CreateAMQFrame(channelId, 0, (ushort)prefetchHigh, false), typeof (BasicQosOkBody));
- }
-
- if (transacted)
- {
- if (_log.IsDebugEnabled)
- {
- _log.Debug("Issuing TxSelect for " + channelId);
- }
- _protocolWriter.SyncWrite(TxSelectBody.CreateAMQFrame(channelId), typeof(TxSelectOkBody));
- }
- }
-
- public String toURL()
- {
- return _connectionInfo.AsUrl();
- }
-
- class HeartBeatThread
- {
- int _heartbeatMillis;
- IProtocolWriter _protocolWriter;
- bool _run = true;
-
- public HeartBeatThread(IProtocolWriter protocolWriter, int heartbeatMillis)
- {
- _protocolWriter = protocolWriter;
- _heartbeatMillis = heartbeatMillis;
- }
-
- public void Run()
- {
- while (_run)
- {
- Thread.Sleep(_heartbeatMillis);
- if (!_run) break;
- _log.Debug("Sending heartbeat");
- // TODO: Can we optimise this so that heartbeats are only written when we haven't sent anything recently to the broker?
- _protocolWriter.Write(HeartbeatBody.FRAME);
- }
- _log.Debug("Heatbeat thread stopped");
- }
-
- public void Stop()
- {
- _run = false;
- }
- }
-
- public void StartHeartBeatThread(int heartbeatSeconds)
- {
- _log.Debug("Starting new heartbeat thread");
- _heartBeatRunner = new HeartBeatThread(ProtocolWriter, heartbeatSeconds * 1000);
- _heartBeatThread = new Thread(new ThreadStart(_heartBeatRunner.Run));
- _heartBeatThread.Name = "HeartBeat";
- _heartBeatThread.Start();
- }
-
- public void StopHeartBeatThread()
- {
- if (_heartBeatRunner != null)
- {
- _log.Debug("Stopping old heartbeat thread");
- _heartBeatRunner.Stop();
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs
deleted file mode 100644
index c8a48814bb..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQConnectionException.cs
+++ /dev/null
@@ -1,38 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Client
-{
- [Serializable]
- public class AMQConnectionException : AMQException
- {
- public AMQConnectionException(String message, Exception e) : base(message, e)
- {
- }
-
- protected AMQConnectionException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQDestination.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQDestination.cs
deleted file mode 100644
index 07ce3c2354..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQDestination.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.
- *
- */
-using System;
-
-namespace Apache.Qpid.Client
-{
- public abstract class AMQDestination
- {
- protected readonly string _exchangeName;
- protected readonly string _exchangeClass;
- protected readonly string _destinationName;
- protected readonly bool _isExclusive;
- protected readonly bool _isAutoDelete;
- protected bool _isDurable;
-
- public bool IsDurable
- {
-
- get { return _isDurable; }
- }
-
- protected string _queueName;
-
- protected AMQDestination(String exchangeName, String exchangeClass, String destinationName, bool isExclusive,
- bool isAutoDelete, String queueName)
- {
- // XXX: This is ugly - OnlyRequired because of ReplyToDestination.
-// if (destinationName == null)
-// {
-// throw new ArgumentNullException("destinationName");
-// }
-
- // XXX: This is ugly - OnlyRequired because of SendingDestinationAdapter.
-// if (exchangeName == null)
-// {
-// throw new ArgumentNullException("exchangeName");
-// }
-
- // XXX: This is ugly - OnlyRequired because of SendingDestinationAdapter.
-// if (exchangeClass == null)
-// {
-// throw new ArgumentNullException("exchangeClass");
-// }
-
- _exchangeName = exchangeName;
- _exchangeClass = exchangeClass;
- _destinationName = destinationName;
- _isExclusive = isExclusive;
- _isAutoDelete = isAutoDelete;
- _queueName = queueName;
- }
-
- public string Name
- {
- get
- {
- return _destinationName;
- }
- }
-
- public abstract string RoutingKey
- {
- get;
- }
-
- public abstract string EncodedName
- {
- get;
- }
-
- public bool AutoDelete
- {
- get
- {
- return _isAutoDelete;
- }
- }
-
- public string QueueName
- {
- get
- {
- return _queueName;
- }
- set
- {
- _queueName = value;
- }
- }
-
- public string ExchangeName
- {
- get
- {
- return _exchangeName;
- }
- }
-
- public string ExchangeClass
- {
- get
- {
- return _exchangeClass;
- }
- }
-
- public bool IsExclusive
- {
- get
- {
- return _isExclusive;
- }
- }
-
- public bool IsAutoDelete
- {
- get
- {
- return _isAutoDelete;
- }
- }
-
- public override string ToString()
- {
- return "Destination: " + _destinationName + ", " +
- "Queue Name: " + _queueName + ", Exchange: " + _exchangeName +
- ", Exchange class: " + _exchangeClass + ", Exclusive: " + _isExclusive +
- ", AutoDelete: " + _isAutoDelete; // +", Routing Key: " + RoutingKey;
- }
-
- public override bool Equals(object o)
- {
- if (this == o)
- {
- return true;
- }
- if (o == null || GetType() != o.GetType())
- {
- return false;
- }
-
- AMQDestination that = (AMQDestination) o;
-
- if (!StringsNotEqualNullSafe(_destinationName, that._destinationName))
- {
- return false;
- }
- if (!StringsNotEqualNullSafe(_exchangeClass, that._exchangeClass))
- {
- return false;
- }
- if (!StringsNotEqualNullSafe(_exchangeName, that._exchangeName))
- {
- return false;
- }
- if (!StringsNotEqualNullSafe(_queueName, that._queueName))
- {
- return false;
- }
- if (_isExclusive != that._isExclusive)
- {
- return false;
- }
- if (_isAutoDelete != that._isAutoDelete)
- {
- return false;
- }
- return true;
- }
-
- private bool StringsNotEqualNullSafe(string one, string two)
- {
- if ((one == null && two != null) ||
- (one != null && !one.Equals(two)))
- {
- return false;
- }
- else
- {
- return true;
- }
- }
-
- public override int GetHashCode()
- {
- int result;
- if (_exchangeName == null)
- {
- result = "".GetHashCode();
- }
- else
- {
- result = _exchangeName.GetHashCode();
- }
- if (_exchangeClass != null)
- {
- result = 29 * result + _exchangeClass.GetHashCode();
- }
- if (_destinationName != null)
- {
- result = 29 * result + _destinationName.GetHashCode();
- }
- if (_queueName != null)
- {
- result = 29 * result + _queueName.GetHashCode();
- }
- result = result * (_isExclusive ? 13 : 7);
- result = result * (_isAutoDelete ? 13 : 7);
-
- Console.WriteLine("FIXME HashCode for " + this + " = " + result);
- return result;
- }
-
- public abstract bool IsNameRequired { get; }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQNoConsumersException.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQNoConsumersException.cs
deleted file mode 100644
index 0d93176734..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQNoConsumersException.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.
- *
- */
-using System;
-using System.Runtime.Serialization;
-using Apache.Qpid.Common;
-using Apache.Qpid.Protocol;
-
-namespace Apache.Qpid.Client
-{
- [Serializable]
- public class AMQNoConsumersException : AMQUndeliveredException
- {
- public AMQNoConsumersException(string message)
- : this(message, null)
- {
- }
-
- public AMQNoConsumersException(string message, object bounced)
- : base(AMQConstant.NO_CONSUMERS.Code, message, bounced)
- {
- }
- protected AMQNoConsumersException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQNoRouteException.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQNoRouteException.cs
deleted file mode 100644
index bde3cdd989..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AMQNoRouteException.cs
+++ /dev/null
@@ -1,46 +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;
-using System.Runtime.Serialization;
-using Apache.Qpid.Common;
-using Apache.Qpid.Protocol;
-
-namespace Apache.Qpid.Client
-{
- [Serializable]
- public class AMQNoRouteException : AMQUndeliveredException
- {
- public AMQNoRouteException(string message)
- : this(message, null)
- {
- }
-
- public AMQNoRouteException(string message, object bounced)
- : base(AMQConstant.NO_ROUTE.Code, message, bounced)
- {
- }
-
- protected AMQNoRouteException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs
deleted file mode 100644
index 591c5b941f..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs
+++ /dev/null
@@ -1,322 +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;
-using System.Collections;
-using System.Text;
-using Apache.Qpid.Client.Qms;
-
-namespace Apache.Qpid.Client
-{
- public class AmqBrokerInfo : IBrokerInfo
- {
- public readonly string URL_FORMAT_EXAMPLE =
- "<transport>://<hostname>[:<port Default=\""+BrokerInfoConstants.DEFAULT_PORT+"\">][?<option>='<value>'[,<option>='<value>']]";
-
- public const long DEFAULT_CONNECT_TIMEOUT = 30000L;
-
- private string _host = "localhost";
- private int _port = 5672;
- private string _transport = "amqp";
- private Hashtable _options = new Hashtable();
- private SslOptions _sslOptions;
-
- public AmqBrokerInfo()
- {
- }
-
- public AmqBrokerInfo(string url)
- {
- // URL should be of format tcp://host:port?option='value',option='value'
- try
- {
- Uri connection = new Uri(url);
-
- String transport = connection.Scheme;
-
- // Handles some defaults to minimise changes to existing broker URLS e.g. localhost
- if (transport != null)
- {
- transport = transport.ToLower();
- //todo this list of valid transports should be enumerated somewhere
- if ((!(transport.Equals("vm") || transport.Equals("tcp"))))
- {
- if (transport.Equals("localhost"))
- {
- connection = new Uri(BrokerInfoConstants.DEFAULT_TRANSPORT + "://" + url);
- transport = connection.Scheme;
- }
- else
- {
- if (url[transport.Length] == ':' && url[transport.Length + 1] != '/')
- {
- //Then most likely we have a host:port value
- connection = new Uri(BrokerInfoConstants.DEFAULT_TRANSPORT + "://" + url);
- transport = connection.Scheme;
- }
- else
- {
- URLHelper.parseError(0, transport.Length, "Unknown transport", url);
- }
- }
- }
- }
- else
- {
- //Default the transport
- connection = new Uri(BrokerInfoConstants.DEFAULT_TRANSPORT + "://" + url);
- transport = connection.Scheme;
- }
-
- if (transport == null)
- {
- URLHelper.parseError(-1, "Unknown transport:'" + transport + "'" +
- " In broker URL:'" + url + "' Format: " + URL_FORMAT_EXAMPLE, "");
- }
-
- Transport = transport;
-
- String host = connection.Host;
- if (!host.Equals("default")) Host = host;
-
- int port = connection.Port;
-
- if (port == -1)
- {
- // Fix for when there is port data but it is not automatically parseable by getPort().
- String auth = connection.Authority;
-
- if (auth != null && auth.IndexOf(':') != -1)
- {
- int start = auth.IndexOf(":") + 1;
- int end = start;
- bool looking = true;
- bool found = false;
- //Walk the authority looking for a port value.
- while (looking)
- {
- try
- {
- end++;
- int.Parse(auth.Substring(start, end-start+1));
-
- if (end >= auth.Length)
- {
- looking = false;
- found = true;
- }
- }
- catch (FormatException)
- {
- looking = false;
- }
-
- }
- if (found)
- {
- Port = int.Parse(auth.Substring(start, end-start+1));
- }
- else
- {
- URLHelper.parseError(connection.ToString().IndexOf(connection.Authority) + end - 1,
- "Illegal character in port number", connection.ToString());
- }
- }
- else
- {
- Port = BrokerInfoConstants.DEFAULT_PORT;
- }
- }
- else
- {
- Port = port;
- }
-
- String queryString = connection.Query;
- if (queryString.Length > 0 && queryString[0] == '?')
- {
- queryString = queryString.Substring(1);
- }
-
- URLHelper.parseOptions(_options, queryString);
-
- //Fragment is #string (not used)
- }
- catch (UriFormatException uris)
- {
- throw uris;
-// if (uris is UrlSyntaxException)
-// {
-// throw uris;
-// }
-//
-// URLHelper.parseError(uris.getIndex(), uris.getReason(), uris.getInput());
- }
- }
-
- public AmqBrokerInfo(string transport, string host, int port, bool useSSL) : this()
- {
- _transport = transport;
- _host = host;
- _port = port;
-
- if (useSSL)
- {
- SetOption(BrokerInfoConstants.OPTIONS_SSL, "true");
- }
- }
-
- public AmqBrokerInfo(string transport, string host, int port, SslOptions sslConfig)
- : this()
- {
- _transport = transport;
- _host = host;
- _port = port;
-
- if ( sslConfig != null )
- {
- SetOption(BrokerInfoConstants.OPTIONS_SSL, "true");
- _sslOptions = sslConfig;
- }
- }
-
-
- public string Host
- {
- get { return _host; }
- set { _host = value; }
- }
-
- public int Port
- {
- get { return _port; }
- set { _port = value; }
- }
-
- public string Transport
- {
- get { return _transport; }
- set { _transport = value; }
- }
-
- public SslOptions SslOptions
- {
- get { return _sslOptions; }
- }
-
- public string GetOption(string key)
- {
- return (string)_options[key];
- }
-
- public void SetOption(string key, string value)
- {
- _options[key] = value;
- }
-
- public long Timeout
- {
- get
- {
- if ( _options.ContainsKey(BrokerInfoConstants.OPTIONS_CONNECT_TIMEOUT) )
- {
- try
- {
- return long.Parse(GetOption(BrokerInfoConstants.OPTIONS_CONNECT_TIMEOUT));
- } catch ( FormatException )
- {
- //Do nothing as we will use the default below.
- }
- }
- return BrokerInfoConstants.DEFAULT_CONNECT_TIMEOUT;
- }
- set
- {
- SetOption(BrokerInfoConstants.OPTIONS_CONNECT_TIMEOUT, value.ToString());
- }
- }
-
- public override string ToString()
- {
- StringBuilder sb = new StringBuilder();
-
- sb.Append(_transport);
- sb.Append("://");
-
- if (!(StringEqualsIgnoreCase(_transport, "vm")))
- {
- sb.Append(_host);
- }
-
- sb.Append(':');
- sb.Append(_port);
-
- sb.Append(URLHelper.printOptions(_options));
-
- return sb.ToString();
- }
-
- public override bool Equals(object obj)
- {
- if (!(obj is IBrokerInfo))
- {
- return false;
- }
-
- IBrokerInfo bd = (IBrokerInfo) obj;
- return StringEqualsIgnoreCase(_host, bd.Host) &&
- _port == bd.Port &&
- StringEqualsIgnoreCase(_transport, bd.Transport) &&
- UseSSL == bd.UseSSL;
- }
-
- public override int GetHashCode()
- {
- return _host.ToLower().GetHashCode() ^ _port.GetHashCode();
- }
-
- // TODO: move to util class.
- private bool StringEqualsIgnoreCase(string one, string two)
- {
- return one.ToLower().Equals(two.ToLower());
- }
-
- public bool UseSSL
- {
- get
- {
- // To be friendly to users we should be case insensitive.
- // or simply force users to conform to OPTIONS_SSL
- // todo make case insensitive by trying ssl Ssl sSl ssL SSl SsL sSL SSL
-
- if ( _options.ContainsKey(BrokerInfoConstants.OPTIONS_SSL) )
- {
- return StringEqualsIgnoreCase(GetOption(BrokerInfoConstants.OPTIONS_SSL), "true");
- }
-
- return false;
- }
- set
- {
- SetOption(BrokerInfoConstants.OPTIONS_SSL, value.ToString());
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AmqChannel.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/AmqChannel.cs
deleted file mode 100644
index 86dc9a4681..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/AmqChannel.cs
+++ /dev/null
@@ -1,1198 +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;
-using System.Collections;
-using System.Text.RegularExpressions;
-using System.Threading;
-using log4net;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Client.Message;
-using Apache.Qpid.Client.Util;
-using Apache.Qpid.Collections;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Protocol;
-
-namespace Apache.Qpid.Client
-{
- /// <summary>
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Declare queues.
- /// <tr><td> Declare exchanges.
- /// <tr><td> Bind queues to exchanges.
- /// <tr><td> Create messages.
- /// <tr><td> Set up message consumers on the channel.
- /// <tr><td> Set up message producers on the channel.
- /// <tr><td> Commit the current transaction.
- /// <tr><td> Roll-back the current transaction.
- /// <tr><td> Close the channel.
- /// </table>
- /// </summary>
- public class AmqChannel : Closeable, IChannel
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(AmqChannel));
-
- internal const int BASIC_CONTENT_TYPE = 60;
-
- public const int DEFAULT_PREFETCH_HIGH_MARK = 5000;
-
- public const int DEFAULT_PREFETCH_LOW_MARK = 2500;
-
- private static int _nextSessionNumber = 0;
-
- private AMQConnection _connection;
-
- private int _sessionNumber;
-
- private bool _suspended;
-
- private object _suspensionLock = new object();
-
- // Used in the consume method. We generate the consume tag on the client so that we can use the nowait feature.
- private int _nextConsumerNumber = 1;
-
- private bool _transacted;
-
- private AcknowledgeMode _acknowledgeMode;
-
- private ushort _channelId;
-
- private int _defaultPrefetchHighMark = DEFAULT_PREFETCH_HIGH_MARK;
-
- private int _defaultPrefetchLowMark = DEFAULT_PREFETCH_LOW_MARK;
-
- private FlowControlQueue _queue;
-
- private Dispatcher _dispatcher;
-
- private MessageFactoryRegistry _messageFactoryRegistry;
-
- /// <summary> Holds all of the producers created by this channel. </summary>
- private Hashtable _producers = Hashtable.Synchronized(new Hashtable());
-
- /// <summary> Holds all of the consumers created by this channel. </summary>
- private Hashtable _consumers = Hashtable.Synchronized(new Hashtable());
-
- private ArrayList _replayFrames = new ArrayList();
-
- /// <summary>
- /// The counter of the _next producer id. This id is generated by the session and used only to allow the
- /// producer to identify itself to the session when deregistering itself.
- ///
- /// Access to this id does not require to be synchronized since according to the JMS specification only one
- /// thread of control is allowed to create producers for any given session instance.
- /// </summary>
- private long _nextProducerId;
-
- /// <summary>
- /// Initializes a new instance of the <see cref="AmqChannel"/> class.
- /// </summary>
- /// <param name="con">The connection.</param>
- /// <param name="channelId">The channel id.</param>
- /// <param name="transacted">if set to <c>true</c> [transacted].</param>
- /// <param name="acknowledgeMode">The acknowledge mode.</param>
- /// <param name="defaultPrefetchHigh">Default prefetch high value</param>
- /// <param name="defaultPrefetchLow">Default prefetch low value</param>
- internal AmqChannel(AMQConnection con, ushort channelId, bool transacted, AcknowledgeMode acknowledgeMode,
- int defaultPrefetchHigh, int defaultPrefetchLow)
- : this()
- {
- _sessionNumber = Interlocked.Increment(ref _nextSessionNumber);
- _connection = con;
- _transacted = transacted;
-
- if ( transacted )
- {
- _acknowledgeMode = AcknowledgeMode.SessionTransacted;
- }
- else
- {
- _acknowledgeMode = acknowledgeMode;
- }
-
- _channelId = channelId;
- _defaultPrefetchHighMark = defaultPrefetchHigh;
- _defaultPrefetchLowMark = defaultPrefetchLow;
-
- if ( _acknowledgeMode == AcknowledgeMode.NoAcknowledge )
- {
- _queue = new FlowControlQueue(_defaultPrefetchLowMark, _defaultPrefetchHighMark,
- new ThresholdMethod(OnPrefetchLowMark),
- new ThresholdMethod(OnPrefetchHighMark));
- }
- else
- {
- // low and upper are the same
- _queue = new FlowControlQueue(_defaultPrefetchHighMark, _defaultPrefetchHighMark,
- null, null);
- }
- }
-
- private AmqChannel()
- {
- _messageFactoryRegistry = MessageFactoryRegistry.NewDefaultRegistry();
- }
-
- /// <summary>
- /// Acknowledge mode for messages received.
- /// </summary>
- public AcknowledgeMode AcknowledgeMode
- {
- get
- {
- CheckNotClosed();
- return _acknowledgeMode;
- }
- }
-
- /// <summary>
- /// True if the channel should use transactions.
- /// </summary>
- public bool Transacted
- {
- get
- {
- CheckNotClosed();
- return _transacted;
- }
- }
-
- /// <summary>
- /// Prefetch value to be used as the default for
- /// consumers created on this channel.
- /// </summary>
- public int DefaultPrefetch
- {
- get { return DefaultPrefetchHigh; }
- }
-
- /// <summary>
- /// Prefetch low value to be used as the default for
- /// consumers created on this channel.
- /// </summary>
- public int DefaultPrefetchLow
- {
- get { return _defaultPrefetchLowMark; }
- }
-
- /// <summary>
- /// Prefetch high value to be used as the default for
- /// consumers created on this channel.
- /// </summary>
- public int DefaultPrefetchHigh
- {
- get { return _defaultPrefetchHighMark; }
- }
-
- /// <summary> Indicates whether or not this channel is currently suspended. </summary>
- public bool IsSuspended
- {
- get { return _suspended; }
- }
-
- /// <summary> Provides the channels number within the the connection. </summary>
- public ushort ChannelId
- {
- get { return _channelId; }
- }
-
- /// <summary> Provides the connection that this channel runs over. </summary>
- public AMQConnection Connection
- {
- get { return _connection; }
- }
-
- /// <summary>
- /// Declare a new exchange.
- /// </summary>
- /// <param name="exchangeName">Name of the exchange</param>
- /// <param name="exchangeClass">Class of the exchange, from <see cref="ExchangeClassConstants"/></param>
- public void DeclareExchange(String exchangeName, String exchangeClass)
- {
- _logger.Debug(string.Format("DeclareExchange vame={0} exchangeClass={1}", exchangeName, exchangeClass));
-
- DeclareExchange(_channelId, 0, exchangeName, exchangeClass, false, false, false, false, true, null);
- }
-
- /// <summary>
- /// Declare a new exchange using the default exchange class.
- /// </summary>
- /// <param name="exchangeName">Name of the exchange</param>
- public void DeleteExchange(string exchangeName)
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Declare a new queue with the specified set of arguments.
- /// </summary>
- /// <param name="queueName">Name of the queue</param>
- /// <param name="isDurable">True if the queue should be durable</param>
- /// <param name="isExclusive">True if the queue should be exclusive to this channel</param>
- /// <param name="isAutoDelete">True if the queue should be deleted when the channel closes</param>
- public void DeclareQueue(string queueName, bool isDurable, bool isExclusive, bool isAutoDelete)
- {
- DoQueueDeclare(queueName, isDurable, isExclusive, isAutoDelete);
- }
-
- /// <summary>
- /// Delete a queue with the specifies arguments.
- /// </summary>
- /// <param name="queueName">Name of the queue to delete</param>
- /// <param name="ifUnused">If true, the queue will not deleted if it has no consumers</param>
- /// <param name="ifEmpty">If true, the queue will not deleted if it has no messages</param>
- /// <param name="noWait">If true, the server will not respond to the method</param>
- public void DeleteQueue(string queueName, bool ifUnused, bool ifEmpty, bool noWait)
- {
- DoDeleteQueue(queueName, ifUnused, ifEmpty, noWait);
- }
-
- /// <summary>
- /// Generate a new Unique name to use for a queue.
- /// </summary>
- /// <returns>A unique name to this channel</returns>
- public string GenerateUniqueName()
- {
- string result = _connection.ProtocolSession.GenerateQueueName();
- return Regex.Replace(result, "[^a-z0-9_]", "_");
- }
-
- /// <summary>
- /// Removes all messages from a queue.
- /// </summary>
- /// <param name="queueName">Name of the queue to delete</param>
- /// <param name="noWait">If true, the server will not respond to the method</param>
- public void PurgeQueue(string queueName, bool noWait)
- {
- DoPurgeQueue(queueName, noWait);
- }
-
- /// <summary>
- /// Bind a queue to the specified exchange.
- /// </summary>
- /// <param name="queueName">Name of queue to bind</param>
- /// <param name="exchangeName">Name of exchange to bind to</param>
- /// <param name="routingKey">Routing key</param>
- public void Bind(string queueName, string exchangeName, string routingKey)
- {
- DoBind(queueName, exchangeName, routingKey, new FieldTable());
- }
-
- /// <summary>
- /// Bind a queue to the specified exchange.
- /// </summary>
- /// <param name="queueName">Name of queue to bind</param>
- /// <param name="exchangeName">Name of exchange to bind to</param>
- /// <param name="routingKey">Routing key</param>
- /// <param name="args">Table of arguments for the binding. Used to bind with a Headers Exchange</param>
- public void Bind(string queueName, string exchangeName, string routingKey, IFieldTable args)
- {
- DoBind(queueName, exchangeName, routingKey, (FieldTable)args);
- }
-
- /// <summary>
- /// Create a new empty message with no body.
- /// </summary>
- /// <returns>The new message</returns>
- public IMessage CreateMessage()
- {
- return (IBytesMessage)_messageFactoryRegistry.CreateMessage("application/octet-stream");
- }
-
- /// <summary>
- /// Create a new message of the specified MIME type.
- /// </summary>
- /// <param name="mimeType">The mime type to create</param>
- /// <returns>The new message</returns>
- public IMessage CreateMessage(string mimeType)
- {
- return _messageFactoryRegistry.CreateMessage(mimeType);
- }
-
- /// <summary>
- /// Creates a new message for bytes (application/octet-stream).
- /// </summary>
- /// <returns>The new message</returns>
- public IBytesMessage CreateBytesMessage()
- {
- return (IBytesMessage)_messageFactoryRegistry.CreateMessage("application/octet-stream");
- }
-
- /// <summary>
- /// Creates a new text message (text/plain) with empty content.
- /// </summary>
- /// <returns>The new message</returns>
- public ITextMessage CreateTextMessage()
- {
- return CreateTextMessage(String.Empty);
- }
-
- /// <summary>
- /// Creates a new text message (text/plain) with a body.
- /// </summary>
- /// <param name="text">Initial body of the message</param>
- /// <returns>The new message</returns>
- public ITextMessage CreateTextMessage(string text)
- {
- ITextMessage msg = (ITextMessage)_messageFactoryRegistry.CreateMessage("text/plain");
- msg.Text = text;
- return msg;
- }
-
- /// <summary>
- /// Creates a new Consumer using the builder pattern.
- /// </summary>
- /// <param name="queueName">Name of queue to receive messages from</param>
- /// <returns>The builder object</returns>
- public MessageConsumerBuilder CreateConsumerBuilder(string queueName)
- {
- return new MessageConsumerBuilder(this, queueName);
- }
-
- /// <summary>
- /// Creates a new consumer.
- /// </summary>
- /// <param name="queueName">Name of queue to receive messages from</param>
- /// <param name="prefetchLow">Low prefetch value</param>
- /// <param name="prefetchHigh">High prefetch value</param>
- /// <param name="noLocal">If true, messages sent on this channel will not be received by this consumer</param>
- /// <param name="exclusive">If true, the consumer opens the queue in exclusive mode</param>
- /// <returns>The new consumer</returns>
- public IMessageConsumer CreateConsumer(string queueName,
- int prefetchLow,
- int prefetchHigh,
- bool noLocal,
- bool exclusive)
- {
- _logger.Debug(String.Format("CreateConsumer queueName={0} prefetchLow={1} prefetchHigh={2} noLocal={3} exclusive={4} ",
- queueName, prefetchLow, prefetchHigh, noLocal, exclusive));
-
- return CreateConsumerImpl(queueName, prefetchLow, prefetchHigh, noLocal, exclusive);
- }
-
- /// <summary>
- /// Unsubscribe from a queue.
- /// </summary>
- /// <param name="subscriptionName">Subscription name</param>
- public void Unsubscribe(String name)
- {
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Create a new message publisher using the builder pattern.
- /// </summary>
- /// <returns>The builder object</returns>
- public MessagePublisherBuilder CreatePublisherBuilder()
- {
- return new MessagePublisherBuilder(this);
- }
-
- /// <summary>
- /// Create a new message publisher.
- /// </summary>
- /// <param name="exchangeName">Name of exchange to publish to</param>
- /// <param name="routingKey">Routing key</param>
- /// <param name="deliveryMode">Default delivery mode</param>
- /// <param name="timeToLive">Default TTL time of messages</param>
- /// <param name="immediate">If true, sent immediately</param>
- /// <param name="mandatory">If true, the broker will return an error
- /// (as a connection exception) if the message cannot be delivered</param>
- /// <param name="priority">Default message priority</param>
- /// <returns>The new message publisher</returns>
- public IMessagePublisher CreatePublisher(string exchangeName, string routingKey, DeliveryMode deliveryMode,
- long timeToLive, bool immediate, bool mandatory, int priority)
- {
- _logger.Debug(string.Format("Using new CreatePublisher exchangeName={0}, exchangeClass={1} routingKey={2}",
- exchangeName, "none", routingKey));
-
- return CreateProducerImpl(exchangeName, routingKey, deliveryMode,
- timeToLive, immediate, mandatory, priority);
- }
-
- /// <summary>
- /// Recover after transaction failure.
- /// </summary>
- /// <remarks>The 0-8 protocol does not support this, not implemented exception will always be thrown.</remarks>
- public void Recover()
- {
- CheckNotClosed();
- CheckNotTransacted();
-
- throw new NotImplementedException();
- }
-
- /// <summary>
- /// Commit the transaction.
- /// </summary>
- public void Commit()
- {
- // FIXME: Fail over safety. Needs FailoverSupport?
- CheckNotClosed();
- CheckTransacted(); // throws IllegalOperationException if not a transacted session
-
- try
- {
- // Acknowledge up to message last delivered (if any) for each consumer.
- // Need to send ack for messages delivered to consumers so far.
- foreach (BasicMessageConsumer consumer in _consumers.Values)
- {
- // Sends acknowledgement to server.
- consumer.AcknowledgeDelivered();
- }
-
- // Commits outstanding messages sent and outstanding acknowledgements.
- _connection.ConvenientProtocolWriter.SyncWrite(TxCommitBody.CreateAMQFrame(_channelId), typeof(TxCommitOkBody));
- }
- catch (AMQException e)
- {
- throw new QpidException("Failed to commit", e);
- }
- }
-
- /// <summary>
- /// Rollback the transaction.
- /// </summary>
- public void Rollback()
- {
- lock (_suspensionLock)
- {
- CheckTransacted(); // throws IllegalOperationException if not a transacted session
-
- try
- {
- bool suspended = IsSuspended;
- if (!suspended)
- {
- Suspend(true);
- }
-
- // Reject up to message last delivered (if any) for each consumer.
- // Need to send reject for messages delivered to consumers so far.
- foreach (BasicMessageConsumer consumer in _consumers.Values)
- {
- // Sends acknowledgement to server.
- consumer.RejectUnacked();
- }
-
- _connection.ConvenientProtocolWriter.SyncWrite(TxRollbackBody.CreateAMQFrame(_channelId), typeof(TxRollbackOkBody));
-
- if ( !suspended )
- {
- Suspend(false);
- }
- }
- catch (AMQException e)
- {
- throw new QpidException("Failed to rollback", e);
- }
- }
- }
-
- /// <summary>
- /// Create a disconnected channel that will fault
- /// for most things, but is useful for testing
- /// </summary>
- /// <returns>A new disconnected channel</returns>
- public static IChannel CreateDisconnectedChannel()
- {
- return new AmqChannel();
- }
-
- public override void Close()
- {
- lock (_connection.FailoverMutex)
- {
- // We must close down all producers and consumers in an orderly fashion. This is the only method
- // that can be called from a different thread of control from the one controlling the session
-
- lock (_closingLock)
- {
- SetClosed();
-
- // we pass null since this is not an error case
- CloseProducersAndConsumers(null);
-
- try
- {
- _connection.CloseSession(this);
- }
- catch (AMQException e)
- {
- throw new QpidException("Error closing session: " + e);
- }
- finally
- {
- _connection.DeregisterSession(_channelId);
- }
- }
- }
- }
-
- /**
- * Called when the server initiates the closure of the session
- * unilaterally.
- * @param e the exception that caused this session to be closed. Null causes the
- */
- public void ClosedWithException(Exception e)
- {
- lock (_connection.FailoverMutex)
- {
- // An AMQException has an error code and message already and will be passed in when closure occurs as a
- // result of a channel close request
- SetClosed();
- AMQException amqe;
-
- if (e is AMQException)
- {
- amqe = (AMQException) e;
- }
- else
- {
- amqe = new AMQException("Closing session forcibly", e);
- }
-
- _connection.DeregisterSession(_channelId);
- CloseProducersAndConsumers(amqe);
- }
- }
-
- public void MessageReceived(UnprocessedMessage message)
- {
- if (_logger.IsDebugEnabled)
- {
- _logger.Debug("Message received in session with channel id " + _channelId);
- }
-
- if ( message.DeliverBody == null )
- {
- ReturnBouncedMessage(message);
- }
- else
- {
- _queue.Enqueue(message);
- }
- }
-
- public void Dispose()
- {
- Close();
- }
-
- private void SetClosed()
- {
- Interlocked.Exchange(ref _closed, CLOSED);
- }
-
- /// <summary>
- /// Close all producers or consumers. This is called either in the error case or when closing the session normally.
- /// <param name="amqe">the exception, may be null to indicate no error has occurred</param>
- ///
- private void CloseProducersAndConsumers(AMQException amqe)
- {
- try
- {
- CloseProducers();
- }
- catch (QpidException e)
- {
- _logger.Error("Error closing session: " + e, e);
- }
- try
- {
- CloseConsumers(amqe);
- }
- catch (QpidException e)
- {
- _logger.Error("Error closing session: " + e, e);
- }
- }
-
- /// <summary>
- /// Called to close message producers cleanly. This may or may <b>not</b> be as a result of an error. There is
- /// currently no way of propagating errors to message producers (this is a JMS limitation).
- /// </summary>
- private void CloseProducers()
- {
- _logger.Debug("Closing producers on session " + this);
-
- // we need to clone the list of producers since the close() method updates the _producers collection
- // which would result in a concurrent modification exception
- ArrayList clonedProducers = new ArrayList(_producers.Values);
-
- foreach (BasicMessageProducer prod in clonedProducers)
- {
- _logger.Debug("Closing producer " + prod);
- prod.Close();
- }
-
- // at this point the _producers map is empty
- }
-
- /// <summary>
- /// Called to close message consumers cleanly. This may or may <b>not</b> be as a result of an error.
- /// <param name="error">not null if this is a result of an error occurring at the connection level</param>
- private void CloseConsumers(Exception error)
- {
- if (_dispatcher != null)
- {
- _dispatcher.StopDispatcher();
- }
-
- // we need to clone the list of consumers since the close() method updates the _consumers collection
- // which would result in a concurrent modification exception
- ArrayList clonedConsumers = new ArrayList(_consumers.Values);
-
- foreach (BasicMessageConsumer con in clonedConsumers)
- {
- if (error != null)
- {
- con.NotifyError(error);
- }
- else
- {
- con.Close();
- }
- }
-
- // at this point the _consumers map will be empty
- }
-
- private IMessagePublisher CreateProducerImpl(string exchangeName, string routingKey,
- DeliveryMode deliveryMode,
- long timeToLive, bool immediate, bool mandatory, int priority)
- {
- lock (_closingLock)
- {
- CheckNotClosed();
-
- try
- {
- return new BasicMessageProducer(exchangeName, routingKey, _transacted, _channelId,
- this, GetNextProducerId(),
- deliveryMode, timeToLive, immediate, mandatory, priority);
- }
- catch (AMQException e)
- {
- _logger.Error("Error creating message producer: " + e, e);
- throw new QpidException("Error creating message producer", e);
- }
- }
- }
-
- /// <summary> Creates a message consumer on this channel.</summary>
- ///
- /// <param name="queueName">The name of the queue to attach the consumer to.</param>
- /// <param name="prefetchLow">The pre-fetch buffer low-water mark.</param>
- /// <param name="prefetchHigh">The pre-fetch buffer high-water mark.</param>
- /// <param name="noLocal">The no-local flag, <tt>true</tt> means that the consumer does not receive messages sent on this channel.</param>
- /// <param name="exclusive">The exclusive flag, <tt>true</tt> gives this consumer exclusive receive access to the queue.</param>
- ///
- /// <return>The message consumer.</return>
- private IMessageConsumer CreateConsumerImpl(string queueName,
- int prefetchLow,
- int prefetchHigh,
- bool noLocal,
- bool exclusive)
- {
- lock (_closingLock)
- {
- CheckNotClosed();
-
- BasicMessageConsumer consumer = new BasicMessageConsumer(_channelId, queueName, noLocal,
- _messageFactoryRegistry, this,
- prefetchHigh, prefetchLow, exclusive);
- try
- {
- RegisterConsumer(consumer);
- }
- catch (AMQException e)
- {
- throw new QpidException("Error registering consumer: " + e, e);
- }
-
- return consumer;
- }
- }
-
- private void CheckTransacted()
- {
- if (!Transacted)
- {
- throw new InvalidOperationException("Channel is not transacted");
- }
- }
-
- private void CheckNotTransacted()
- {
- if (Transacted)
- {
- throw new InvalidOperationException("Channel is transacted");
- }
- }
-
- internal void Start()
- {
- _dispatcher = new Dispatcher(this);
- Thread dispatcherThread = new Thread(new ThreadStart(_dispatcher.RunDispatcher));
- dispatcherThread.IsBackground = true;
- dispatcherThread.Start();
- }
-
- internal void Stop()
- {
- Suspend(true);
- if (_dispatcher != null)
- {
- _dispatcher.StopDispatcher();
- }
- }
-
- internal void RegisterConsumer(string consumerTag, IMessageConsumer consumer)
- {
- _consumers[consumerTag] = consumer;
- }
-
- /// <summary>
- /// Called by the MessageConsumer when closing, to deregister the consumer from the
- /// map from consumerTag to consumer instance.
- /// </summary>
- /// <param name="consumerTag">the consumer tag, that was broker-generated</param>
- internal void DeregisterConsumer(string consumerTag)
- {
- _consumers.Remove(consumerTag);
- }
-
- internal void RegisterProducer(long producerId, IMessagePublisher publisher)
- {
- _producers[producerId] = publisher;
- }
-
- internal void DeregisterProducer(long producerId)
- {
- _producers.Remove(producerId);
- }
-
- private long GetNextProducerId()
- {
- return ++_nextProducerId;
- }
-
- /**
- * Called to mark the session as being closed. Useful when the session needs to be made invalid, e.g. after
- * failover when the client has veoted resubscription.
- *
- * The caller of this method must already hold the failover mutex.
- */
- internal void MarkClosed()
- {
- SetClosed();
- _connection.DeregisterSession(_channelId);
- MarkClosedProducersAndConsumers();
- }
-
- private void MarkClosedProducersAndConsumers()
- {
- try
- {
- // no need for a markClosed* method in this case since there is no protocol traffic closing a producer
- CloseProducers();
- }
- catch (QpidException e)
- {
- _logger.Error("Error closing session: " + e, e);
- }
- try
- {
- MarkClosedConsumers();
- }
- catch (QpidException e)
- {
- _logger.Error("Error closing session: " + e, e);
- }
- }
-
- private void MarkClosedConsumers()
- {
- if (_dispatcher != null)
- {
- _dispatcher.StopDispatcher();
- }
- // we need to clone the list of consumers since the close() method updates the _consumers collection
- // which would result in a concurrent modification exception
- ArrayList clonedConsumers = new ArrayList(_consumers.Values);
-
- foreach (BasicMessageConsumer consumer in clonedConsumers)
- {
- consumer.MarkClosed();
- }
- // at this point the _consumers map will be empty
- }
-
- private void DoPurgeQueue(string queueName, bool noWait)
- {
- try
- {
- _logger.DebugFormat("PurgeQueue {0}", queueName);
-
- AMQFrame purgeQueue = QueuePurgeBody.CreateAMQFrame(_channelId, 0, queueName, noWait);
-
- if (noWait)
- _connection.ProtocolWriter.Write(purgeQueue);
- else
- _connection.ConvenientProtocolWriter.SyncWrite(purgeQueue, typeof(QueuePurgeOkBody));
- }
- catch (AMQException)
- {
- throw;
- }
- }
-
- /**
- * Replays frame on fail over.
- *
- * @throws AMQException
- */
- internal void ReplayOnFailOver()
- {
- _logger.Debug(string.Format("Replaying frames for channel {0}", _channelId));
- foreach (AMQFrame frame in _replayFrames)
- {
- _logger.Debug(string.Format("Replaying frame=[{0}]", frame));
- _connection.ProtocolWriter.Write(frame);
- }
- }
-
- /// <summary>
- /// Callers must hold the failover mutex before calling this method.
- /// </summary>
- /// <param name="consumer"></param>
- private void RegisterConsumer(BasicMessageConsumer consumer)
- {
- // Need to generate a consumer tag on the client so we can exploit the nowait flag.
- String tag = string.Format("{0}-{1}", _sessionNumber, _nextConsumerNumber++);
- consumer.ConsumerTag = tag;
- _consumers.Add(tag, consumer);
-
- String consumerTag = ConsumeFromQueue(consumer.QueueName, consumer.NoLocal,
- consumer.Exclusive, consumer.AcknowledgeMode, tag);
-
- }
-
- internal void DoBind(string queueName, string exchangeName, string routingKey, FieldTable args)
- {
-
- _logger.Debug(string.Format("QueueBind queueName={0} exchangeName={1} routingKey={2}, arg={3}",
- queueName, exchangeName, routingKey, args));
-
- AMQFrame queueBind = QueueBindBody.CreateAMQFrame(_channelId, 0,
- queueName, exchangeName,
- routingKey, false, args);
-
-
- lock (_connection.FailoverMutex)
- {
- _connection.ConvenientProtocolWriter.SyncWrite(queueBind, typeof(QueueBindOkBody));
- }
- // AS FIXME: wasnae me
- _replayFrames.Add(QueueBindBody.CreateAMQFrame(_channelId, 0,
- queueName, exchangeName,
- routingKey, true, args));
- }
-
- private String ConsumeFromQueue(String queueName, bool noLocal, bool exclusive, AcknowledgeMode acknowledgeMode, String tag)
- {
-
- AMQFrame basicConsume = BasicConsumeBody.CreateAMQFrame(_channelId, 0,
- queueName, tag, noLocal,
- acknowledgeMode == AcknowledgeMode.NoAcknowledge,
- exclusive, true, new FieldTable());
-
- _replayFrames.Add(basicConsume);
-
- _connection.ProtocolWriter.Write(basicConsume);
- return tag;
- }
-
- private void DoDeleteQueue(string queueName, bool ifUnused, bool ifEmpty, bool noWait)
- {
- try
- {
- _logger.Debug(string.Format("DeleteQueue name={0}", queueName));
-
- AMQFrame queueDelete = QueueDeleteBody.CreateAMQFrame(_channelId, 0, queueName, ifUnused, ifEmpty, noWait);
-
- if (noWait)
- {
- _connection.ProtocolWriter.Write(queueDelete);
- }
- else
- {
- _connection.ConvenientProtocolWriter.SyncWrite(queueDelete, typeof(QueueDeleteOkBody));
- }
- // AS FIXME: wasnae me
- _replayFrames.Add(QueueDeleteBody.CreateAMQFrame(_channelId, 0, queueName, ifUnused, ifEmpty, true));
- }
- catch (AMQException)
- {
- throw;
- }
- }
-
- private void DoQueueDeclare(string queueName, bool isDurable, bool isExclusive, bool isAutoDelete)
- {
- _logger.Debug(string.Format("DeclareQueue name={0} durable={1} exclusive={2}, auto-delete={3}",
- queueName, isDurable, isExclusive, isAutoDelete));
-
- AMQFrame queueDeclare = QueueDeclareBody.CreateAMQFrame(_channelId, 0, queueName, false, isDurable, isExclusive,
- isAutoDelete, false, null);
-
-
- lock (_connection.FailoverMutex)
- {
- _connection.ConvenientProtocolWriter.SyncWrite(queueDeclare, typeof(QueueDeclareOkBody));
- }
- // AS FIXME: wasnae me
- _replayFrames.Add(QueueDeclareBody.CreateAMQFrame(_channelId, 0, queueName, false, isDurable, isExclusive,
- isAutoDelete, true, null));
- }
-
- // AMQP-level method.
- private void DeclareExchange(ushort channelId, ushort ticket, string exchangeName,
- string exchangeClass, bool passive, bool durable,
- bool autoDelete, bool xinternal, bool noWait, FieldTable args)
- {
- _logger.Debug(String.Format("DeclareExchange channelId={0} exchangeName={1} exchangeClass={2}",
- _channelId, exchangeName, exchangeClass));
-
- AMQFrame declareExchange = ExchangeDeclareBody.CreateAMQFrame(channelId, ticket, exchangeName, exchangeClass, passive,
- durable, autoDelete, xinternal, noWait, args);
-
- if (noWait)
- {
- lock (_connection.FailoverMutex)
- {
- _connection.ProtocolWriter.Write(declareExchange);
- }
- // AS FIXME: wasnae me
- _replayFrames.Add(declareExchange);
- }
- else
- {
- throw new NotImplementedException("Don't use nowait=false with DeclareExchange");
- //_connection.ConvenientProtocolWriter.SyncWrite(declareExchange, typeof (ExchangeDeclareOkBody));
- }
- }
-
- /**
- * Acknowledge a message or several messages. This method can be called via AbstractJMSMessage or from
- * a BasicConsumer. The former where the mode is CLIENT_ACK and the latter where the mode is
- * AUTO_ACK or similar.
- *
- * @param deliveryTag the tag of the last message to be acknowledged
- * @param multiple if true will acknowledge all messages up to and including the one specified by the
- * delivery tag
- */
- internal void AcknowledgeMessage(ulong deliveryTag, bool multiple)
- {
- AMQFrame ackFrame = BasicAckBody.CreateAMQFrame(_channelId, deliveryTag, multiple);
- if (_logger.IsDebugEnabled)
- {
- _logger.Debug("Sending ack for delivery tag " + deliveryTag + " on channel " + _channelId);
- }
- // FIXME: lock FailoverMutex here?
- _connection.ProtocolWriter.Write(ackFrame);
- }
-
- public void RejectMessage(ulong deliveryTag, bool requeue)
- {
- if ((_acknowledgeMode == AcknowledgeMode.ClientAcknowledge) || (_acknowledgeMode == AcknowledgeMode.SessionTransacted))
- {
- AMQFrame rejectFrame = BasicRejectBody.CreateAMQFrame(_channelId, deliveryTag, requeue);
- _connection.ProtocolWriter.Write(rejectFrame);
- }
- }
-
- /// <summary>
- /// Handle a message that bounced from the server, creating
- /// the corresponding exception and notifying the connection about it
- /// </summary>
- /// <param name="message">Unprocessed message</param>
- private void ReturnBouncedMessage(UnprocessedMessage message)
- {
- try
- {
- AbstractQmsMessage bouncedMessage =
- _messageFactoryRegistry.CreateMessage(0, false, message.ContentHeader, message.Bodies);
-
- int errorCode = message.BounceBody.ReplyCode;
- string reason = message.BounceBody.ReplyText;
- _logger.Debug("Message returned with error code " + errorCode + " (" + reason + ")");
- AMQException exception;
-
- if (errorCode == AMQConstant.NO_CONSUMERS.Code)
- {
- exception = new AMQNoConsumersException(reason, bouncedMessage);
- }
- else if (errorCode == AMQConstant.NO_ROUTE.Code)
- {
- exception = new AMQNoRouteException(reason, bouncedMessage);
- }
- else
- {
- exception = new AMQUndeliveredException(errorCode, reason, bouncedMessage);
- }
-
- _connection.ExceptionReceived(exception);
- }
- catch (Exception ex)
- {
- _logger.Error("Caught exception trying to raise undelivered message exception (dump follows) - ignoring...", ex);
- }
- }
-
- private void OnPrefetchLowMark(int count)
- {
- if (_acknowledgeMode == AcknowledgeMode.NoAcknowledge)
- {
- _logger.Warn("Below threshold(" + _defaultPrefetchLowMark + ") so unsuspending channel. Current value is " + count);
- Suspend(false);
- }
- }
-
- private void OnPrefetchHighMark(int count)
- {
- if (_acknowledgeMode == AcknowledgeMode.NoAcknowledge)
- {
- _logger.Warn("Above threshold(" + _defaultPrefetchHighMark + ") so suspending channel. Current value is " + count);
- Suspend(true);
- }
- }
-
- private void Suspend(bool suspend)
- {
- lock (_suspensionLock)
- {
- if (_logger.IsDebugEnabled)
- {
- _logger.Debug("Setting channel flow : " + (suspend ? "suspended" : "unsuspended"));
- }
-
- _suspended = suspend;
- AMQFrame frame = ChannelFlowBody.CreateAMQFrame(_channelId, !suspend);
-
- Connection.ConvenientProtocolWriter.SyncWrite(frame, typeof(ChannelFlowOkBody));
- }
- }
-
- /// <summary>A Dispatcher turns the consumption of incoming messages from an arrival queue, into event notifications on consumers.
- /// The arrival queue is typically a blocking queue, on which a dispatcher waits for messages to consume. Upon receipt of a message
- /// the dispatcher finds the consumer that is listening to the queue to which the message has been send and notifies it of the new
- /// message.
- ///
- /// <p/>The Dispatcher also contains logic to recognize bounced messages. Bounced messages returned from the broker can be
- /// told apart from regular deliveries because they do not have a delivery queue set on them. When the dispatcher receives a
- /// bounced message it creates an exception and notifies the connection, to which its containing channel belongs, of the condition.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Notify consumers of message arrivals on their queues. <td> <see cref="BasicMessageConsumer"/>
- /// <tr><td> Notify the containing connection of bounced message arrivals. <td> <see cref="AMQConnection"/>
- /// </table>
- /// </summary>
- ///
- /// <remarks>Stop mechanism seems wrong, as queue consume is evaluated after stop flag, so could consume and notify one more message.
- /// Placing stop check after consume may also be wrong as it may cause a message to be thrown away. Seems more correct to use interupt on
- /// the block thread to cause it to prematurely return from its wait, whereupon it can be made to re-check the stop flag.</remarks>
- ///
- /// <remarks>Exception swallowed, if there is an exception whilst notifying the connection on bounced messages. Unhandled excetpion should
- /// fall through and terminate the loop, as it is a bug if it occurrs.</remarks>
- private class Dispatcher
- {
- /// <summary> Flag used to indicate when this dispatcher is to be stopped (0=go, 1=stop). </summary>
- private int _stopped = 0;
-
- /// <summary> The channel for which this is a dispatcher. </summary>
- private AmqChannel _containingChannel;
-
- /// <summary> Creates a dispatcher on the specified channel. </summary>
- ///
- /// <param name="containingChannel"> The channel on which this is a dispatcher. </param>
- public Dispatcher(AmqChannel containingChannel)
- {
- _containingChannel = containingChannel;
- }
-
- /// <summary>The message dispatch loop. Consumes messages from the channels queue, notifying consumers of regular deliveries, and
- /// the connection of bounced messages.</summary>
- public void RunDispatcher()
- {
- UnprocessedMessage message;
-
- while (_stopped == 0 && (message = (UnprocessedMessage)_containingChannel._queue.Dequeue()) != null)
- {
- if (message.DeliverBody != null)
- {
- BasicMessageConsumer consumer = (BasicMessageConsumer) _containingChannel._consumers[message.DeliverBody.ConsumerTag];
-
- if (consumer == null)
- {
- _logger.Warn("Received a message from queue " + message.DeliverBody.ConsumerTag + " without a f - ignoring...");
- }
- else
- {
- consumer.NotifyMessage(message, _containingChannel.ChannelId);
- }
- }
- else
- {
- try
- {
- // Bounced message is processed here, away from the transport thread
- AbstractQmsMessage bouncedMessage = _containingChannel._messageFactoryRegistry.
- CreateMessage(0, false, message.ContentHeader, message.Bodies);
-
- int errorCode = message.BounceBody.ReplyCode;
- string reason = message.BounceBody.ReplyText;
-
- _logger.Debug("Message returned with error code " + errorCode + " (" + reason + ")");
-
- _containingChannel._connection.ExceptionReceived(new AMQUndeliveredException(errorCode, "Error: " + reason, bouncedMessage));
- }
- catch (Exception e)
- {
- _logger.Error("Caught exception trying to raise undelivered message exception (dump follows) - ignoring...", e);
- }
- }
- }
-
- _logger.Debug("Dispatcher thread terminating for channel: " + _containingChannel._channelId + ".");
- }
-
- /// <summary> Sets a stop flag on this dispatcher, which causes its dispatch loop to exit at the next available opportunity. </summary>
- public void StopDispatcher()
- {
- Interlocked.Exchange(ref _stopped, 1);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs
deleted file mode 100644
index 6fee316cb4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs
+++ /dev/null
@@ -1,477 +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;
-using System.Threading;
-using System.Collections;
-using System.Collections.Generic;
-using log4net;
-using Apache.Qpid.Client.Message;
-using Apache.Qpid.Collections;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client
-{
- public class BasicMessageConsumer : Closeable, IMessageConsumer
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(BasicMessageConsumer));
-
- private bool _noLocal;
-
- /** Holds the exclusive status flag for the consumers access to its queue. */
- private bool _exclusive;
-
- public bool Exclusive
- {
- get { return _exclusive; }
- }
-
- public bool NoLocal
- {
- get { return _noLocal; }
- set { _noLocal = value; }
- }
-
- private AcknowledgeMode _acknowledgeMode;
-
- public AcknowledgeMode AcknowledgeMode
- {
- get { return _acknowledgeMode; }
- }
-
- private MessageReceivedDelegate _messageListener;
-
- private bool IsMessageListenerSet
- {
- get { return _messageListener != null; }
- }
-
- /// <summary>
- /// The consumer tag allows us to close the consumer by sending a jmsCancel method to the
- /// broker
- /// </summary>
- private string _consumerTag;
-
- /// <summary>
- /// We need to know the channel id when constructing frames
- /// </summary>
- private ushort _channelId;
-
- private readonly string _queueName;
-
- /// <summary>
- /// Protects the setting of a messageListener
- /// </summary>
- private readonly object _syncLock = new object();
-
- /// <summary>
- /// We store the high water prefetch field in order to be able to reuse it when resubscribing in the event of failover
- /// </summary>
- private int _prefetchHigh;
-
- /// <summary>
- /// We store the low water prefetch field in order to be able to reuse it when resubscribing in the event of failover
- /// </summary>
- private int _prefetchLow;
-
- /// <summary>
- /// When true indicates that either a message listener is set or that
- /// a blocking receive call is in progress
- /// </summary>
- private bool _receiving;
-
- /// <summary>
- /// Used in the blocking receive methods to receive a message from
- /// the Channel thread.
- /// </summary>
- private readonly ConsumerProducerQueue _messageQueue = new ConsumerProducerQueue();
-
- private MessageFactoryRegistry _messageFactory;
-
- private AmqChannel _channel;
-
- // <summary>
- // Tag of last message delievered, whoch should be acknowledged on commit in transaction mode.
- // </summary>
- //private long _lastDeliveryTag;
-
- /// <summary>
- /// Explicit list of all received but un-acked messages in a transaction. Used to ensure acking is completed when transaction is committed.
- /// </summary>
- private LinkedList<long> _receivedDeliveryTags;
-
- /// <summary>
- /// Number of messages unacknowledged in DUPS_OK_ACKNOWLEDGE mode
- /// </summary>
- private int _outstanding;
-
- /// <summary>
- /// Switch to enable sending of acknowledgements when using DUPS_OK_ACKNOWLEDGE mode.
- /// Enabled when _outstannding number of msgs >= _prefetchHigh and disabled at < _prefetchLow
- /// </summary>
- private bool _dups_ok_acknowledge_send;
-
- internal BasicMessageConsumer(ushort channelId, string queueName, bool noLocal,
- MessageFactoryRegistry messageFactory, AmqChannel channel,
- int prefetchHigh, int prefetchLow, bool exclusive)
- {
- _channelId = channelId;
- _queueName = queueName;
- _noLocal = noLocal;
- _messageFactory = messageFactory;
- _channel = channel;
- _acknowledgeMode = _channel.AcknowledgeMode;
- _prefetchHigh = prefetchHigh;
- _prefetchLow = prefetchLow;
- _exclusive = exclusive;
-
- if (_acknowledgeMode == AcknowledgeMode.SessionTransacted)
- {
- _receivedDeliveryTags = new LinkedList<long>();
- }
- }
-
- #region IMessageConsumer Members
-
- public MessageReceivedDelegate OnMessage
- {
- get
- {
- return _messageListener;
- }
- set
- {
- CheckNotClosed();
-
- lock (_syncLock)
- {
- // If someone is already receiving
- if (_messageListener != null && _receiving)
- {
- throw new InvalidOperationException("Another thread is already receiving...");
- }
-
- _messageListener = value;
-
- _receiving = (_messageListener != null);
-
- if (_receiving)
- {
- _logger.Debug("Message listener set for queue with name " + _queueName);
- }
- }
- }
- }
-
- public IMessage Receive(long delay)
- {
- CheckNotClosed();
-
- lock (_syncLock)
- {
- // If someone is already receiving
- if (_receiving)
- {
- throw new InvalidOperationException("Another thread is already receiving (possibly asynchronously)...");
- }
-
- _receiving = true;
- }
-
- try
- {
- object o = _messageQueue.Dequeue(delay);
-
- return ReturnMessageOrThrowAndPostDeliver(o);
- }
- finally
- {
- lock (_syncLock)
- {
- _receiving = false;
- }
- }
- }
-
- private IMessage ReturnMessageOrThrowAndPostDeliver(object o)
- {
- IMessage m = ReturnMessageOrThrow(o);
- if (m != null)
- {
- PostDeliver(m);
- }
- return m;
- }
-
- public IMessage Receive()
- {
- return Receive(Timeout.Infinite);
- }
-
- public IMessage ReceiveNoWait()
- {
- return Receive(0);
- }
-
- #endregion
-
- /// <summary>
- /// We can get back either a Message or an exception from the queue. This method examines the argument and deals
- /// with it by throwing it (if an exception) or returning it (in any other case).
- /// </summary>
- /// <param name="o">the object off the queue</param>
- /// <returns> a message only if o is a Message</returns>
- /// <exception>JMSException if the argument is a throwable. If it is a QpidMessagingException it is rethrown as is, but if not
- /// a QpidMessagingException is created with the linked exception set appropriately</exception>
- private IMessage ReturnMessageOrThrow(object o)
- {
- // errors are passed via the queue too since there is no way of interrupting the poll() via the API.
- if (o is Exception)
- {
- Exception e = (Exception) o;
- throw new QpidException("Message consumer forcibly closed due to error: " + e, e);
- }
- else
- {
- return (IMessage) o;
- }
- }
-
- #region IDisposable Members
-
- public void Dispose()
- {
- Close();
- }
-
- #endregion
-
- public override void Close()
- {
- if (_closed == CLOSED)
- {
- return;
- }
- // FIXME: Don't we need FailoverSupport here (as we have SyncWrite). i.e. rather than just locking FailOverMutex
- lock (_channel.Connection.FailoverMutex)
- {
- lock (_closingLock)
- {
- Interlocked.Exchange(ref _closed, CLOSED);
-
- AMQFrame cancelFrame = BasicCancelBody.CreateAMQFrame(_channelId, _consumerTag, false);
-
- try
- {
- _channel.Connection.ConvenientProtocolWriter.SyncWrite(
- cancelFrame, typeof(BasicCancelOkBody));
- }
- catch (AMQException e)
- {
- _logger.Error("Error closing consumer: " + e, e);
- throw new QpidException("Error closing consumer: " + e);
- }
- finally
- {
- DeregisterConsumer();
- }
- }
- }
- }
-
- /**
- * Called from the AMQSession when a message has arrived for this consumer. This methods handles both the case
- * of a message listener or a synchronous receive() caller.
- *
- * @param messageFrame the raw unprocessed mesage
- * @param channelId channel on which this message was sent
- */
- internal void NotifyMessage(UnprocessedMessage messageFrame, int channelId)
- {
- if (_logger.IsDebugEnabled)
- {
- _logger.Debug("notifyMessage called with message number " + messageFrame.DeliverBody.DeliveryTag);
- }
- try
- {
- AbstractQmsMessage jmsMessage = _messageFactory.CreateMessage((long)messageFrame.DeliverBody.DeliveryTag,
- messageFrame.DeliverBody.Redelivered,
- messageFrame.ContentHeader,
- messageFrame.Bodies);
-
- _logger.Debug("Message is of type: " + jmsMessage.GetType().Name);
-
- PreDeliver(jmsMessage);
-
- if (IsMessageListenerSet)
- {
- // We do not need a lock around the test above, and the dispatch below as it is invalid
- // for an application to alter an installed listener while the session is started.
-#if __MonoCS__
- _messageListener(jmsMessage);
-#else
- _messageListener.Invoke(jmsMessage);
-#endif
- PostDeliver(jmsMessage);
- }
- else
- {
- _messageQueue.Enqueue(jmsMessage);
- }
- }
- catch (Exception e)
- {
- _logger.Error("Caught exception (dump follows) - ignoring...", e); // FIXME
- }
- }
-
-
- internal void NotifyError(Exception cause)
- {
- lock (_syncLock)
- {
- SetClosed();
-
- // we have no way of propagating the exception to a message listener - a JMS limitation - so we
- // deal with the case where we have a synchronous receive() waiting for a message to arrive
- if (_messageListener == null)
- {
- // offer only succeeds if there is a thread waiting for an item from the queue
- _messageQueue.Enqueue(cause);
- _logger.Debug("Passed exception to synchronous queue for propagation to receive()");
- }
- DeregisterConsumer();
- }
- }
-
- private void SetClosed()
- {
- Interlocked.Exchange(ref _closed, CLOSED);
- }
-
- /// <summary>
- /// Perform cleanup to deregister this consumer. This occurs when closing the consumer in both the clean
- /// case and in the case of an error occurring.
- /// </summary>
- internal void DeregisterConsumer()
- {
- _channel.DeregisterConsumer(_consumerTag);
- }
-
- public string ConsumerTag
- {
- get
- {
- return _consumerTag;
- }
- set
- {
- _consumerTag = value;
- }
- }
-
- /**
- * Called when you need to invalidate a consumer. Used for example when failover has occurred and the
- * client has vetoed automatic resubscription.
- * The caller must hold the failover mutex.
- */
- internal void MarkClosed()
- {
- SetClosed();
- DeregisterConsumer();
- }
-
- public string QueueName
- {
- get { return _queueName; }
- }
-
- /// <summary>
- /// Acknowledge up to last message delivered (if any). Used when commiting.
- /// </summary>
- internal void AcknowledgeDelivered()
- {
- foreach (long tag in _receivedDeliveryTags)
- {
- _channel.AcknowledgeMessage((ulong)tag, false);
- }
-
- _receivedDeliveryTags.Clear();
- }
-
- internal void RejectUnacked()
- {
- foreach (long tag in _receivedDeliveryTags)
- {
- _channel.RejectMessage((ulong)tag, true);
- }
-
- _receivedDeliveryTags.Clear();
- }
-
- private void PreDeliver(AbstractQmsMessage msg)
- {
- switch (AcknowledgeMode)
- {
- case AcknowledgeMode.PreAcknowledge:
- _channel.AcknowledgeMessage((ulong)msg.DeliveryTag, false);
- break;
-
- case AcknowledgeMode.ClientAcknowledge:
- // We set the session so that when the user calls acknowledge() it can call the method on session
- // to send out the appropriate frame.
- //msg.setAMQSession(_session);
- msg.Channel = _channel;
- break;
- }
- }
-
- private void PostDeliver(IMessage m)
- {
- AbstractQmsMessage msg = (AbstractQmsMessage) m;
- switch (AcknowledgeMode)
- {
- case AcknowledgeMode.DupsOkAcknowledge:
- if (++_outstanding >= _prefetchHigh)
- {
- _dups_ok_acknowledge_send = true;
- }
- if (_outstanding <= _prefetchLow)
- {
- _dups_ok_acknowledge_send = false;
- }
- if (_dups_ok_acknowledge_send)
- {
- _channel.AcknowledgeMessage((ulong)msg.DeliveryTag, true);
- }
- break;
-
- case AcknowledgeMode.AutoAcknowledge:
- _channel.AcknowledgeMessage((ulong)msg.DeliveryTag, true);
- break;
-
- case AcknowledgeMode.SessionTransacted:
- _receivedDeliveryTags.AddLast(msg.DeliveryTag);
- break;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/BasicMessageProducer.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/BasicMessageProducer.cs
deleted file mode 100644
index f33afc452e..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/BasicMessageProducer.cs
+++ /dev/null
@@ -1,405 +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;
-using System.Threading;
-using log4net;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Client.Message;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client
-{
- public class BasicMessageProducer : Closeable, IMessagePublisher
- {
- protected readonly ILog _logger = LogManager.GetLogger(typeof(BasicMessageProducer));
-
- /// <summary>
- /// If true, messages will not get a timestamp.
- /// </summary>
- private bool _disableTimestamps;
-
- /// <summary>
- /// Priority of messages created by this producer.
- /// </summary>
- private int _messagePriority;
-
- /// <summary>
- /// Time to live of messages. Specified in milliseconds but AMQ has 1 second resolution.
- /// </summary>
- private long _timeToLive;
-
- /// <summary>
- /// Delivery mode used for this producer.
- /// </summary>
- private DeliveryMode _deliveryMode;
-
- private bool _immediate;
- private bool _mandatory;
-
- string _exchangeName;
- string _routingKey;
-
- /// <summary>
- /// Default encoding used for messages produced by this producer.
- /// </summary>
- private string _encoding;
-
- /// <summary>
- /// Default encoding used for message produced by this producer.
- /// </summary>
- private string _mimeType;
-
- /// <summary>
- /// True if this producer was created from a transacted session
- /// </summary>
- private bool _transacted;
-
- private ushort _channelId;
-
- /// <summary>
- /// This is an id generated by the session and is used to tie individual producers to the session. This means we
- /// can deregister a producer with the session when the producer is closed. We need to be able to tie producers
- /// to the session so that when an error is propagated to the session it can close the producer (meaning that
- /// a client that happens to hold onto a producer reference will get an error if he tries to use it subsequently).
- /// </summary>
- private long _producerId;
-
- /// <summary>
- /// The session used to create this producer
- /// </summary>
- private AmqChannel _channel;
-
- public BasicMessageProducer(string exchangeName, string routingKey,
- bool transacted,
- ushort channelId,
- AmqChannel channel,
- long producerId,
- DeliveryMode deliveryMode,
- long timeToLive,
- bool immediate,
- bool mandatory,
- int priority)
- {
- _exchangeName = exchangeName;
- _routingKey = routingKey;
- _transacted = transacted;
- _channelId = channelId;
- _channel = channel;
- _producerId = producerId;
- _deliveryMode = deliveryMode;
- _timeToLive = timeToLive;
- _immediate = immediate;
- _mandatory = mandatory;
- _messagePriority = priority;
-
- _channel.RegisterProducer(producerId, this);
- }
-
-
- #region IMessagePublisher Members
-
- public DeliveryMode DeliveryMode
- {
- get
- {
- CheckNotClosed();
- return _deliveryMode;
- }
- set
- {
- CheckNotClosed();
- _deliveryMode = value;
- }
- }
-
- public string ExchangeName
- {
- get { return _exchangeName; }
- }
-
- public string RoutingKey
- {
- get { return _routingKey; }
- }
-
- public bool DisableMessageID
- {
- get
- {
- throw new Exception("The method or operation is not implemented.");
- }
- set
- {
- throw new Exception("The method or operation is not implemented.");
- }
- }
-
- public bool DisableMessageTimestamp
- {
- get
- {
- CheckNotClosed();
- return _disableTimestamps;
- }
- set
- {
- CheckNotClosed();
- _disableTimestamps = value;
- }
- }
-
- public int Priority
- {
- get
- {
- CheckNotClosed();
- return _messagePriority;
- }
- set
- {
- CheckNotClosed();
- if ( value < 0 || value > 9 )
- {
- throw new ArgumentOutOfRangeException("Priority of " + value + " is illegal. Value must be in range 0 to 9");
- }
- _messagePriority = value;
- }
- }
-
- public override void Close()
- {
- _logger.Debug("Closing producer " + this);
- Interlocked.Exchange(ref _closed, CLOSED);
- _channel.DeregisterProducer(_producerId);
- }
-
- public void Send(IMessage msg, DeliveryMode deliveryMode, int priority, long timeToLive)
- {
- CheckNotClosed();
- SendImpl(
- _exchangeName,
- _routingKey,
- (AbstractQmsMessage)msg,
- deliveryMode,
- priority,
- (uint)timeToLive,
- _mandatory,
- _immediate
- );
- }
-
- public void Send(IMessage msg)
- {
- CheckNotClosed();
- SendImpl(
- _exchangeName,
- _routingKey,
- (AbstractQmsMessage)msg,
- _deliveryMode,
- _messagePriority,
- (uint)_timeToLive,
- _mandatory,
- _immediate
- );
- }
-
- // This is a short-term hack (knowing that this code will be re-vamped sometime soon)
- // to facilitate publishing messages to potentially non-existent recipients.
- public void Send(IMessage msg, bool mandatory)
- {
- CheckNotClosed();
- SendImpl(
- _exchangeName,
- _routingKey,
- (AbstractQmsMessage)msg,
- _deliveryMode,
- _messagePriority,
- (uint)_timeToLive,
- mandatory,
- _immediate
- );
- }
-
- public long TimeToLive
- {
- get
- {
- CheckNotClosed();
- return _timeToLive;
- }
- set
- {
- CheckNotClosed();
- if ( value < 0 )
- {
- throw new ArgumentOutOfRangeException("Time to live must be non-negative - supplied value was " + value);
- }
- _timeToLive = value;
- }
- }
-
- #endregion
-
- public string MimeType
- {
- get
- {
- CheckNotClosed();
- return _mimeType;
- }
- set
- {
- CheckNotClosed();
- _mimeType = value;
- }
- }
-
- public string Encoding
- {
- get
- {
- CheckNotClosed();
- return _encoding;
- }
- set
- {
- CheckNotClosed();
- _encoding = value;
- }
- }
-
- public void Dispose()
- {
- Close();
- }
-
- #region Message Publishing
-
- private void SendImpl(string exchangeName, string routingKey, AbstractQmsMessage message, DeliveryMode deliveryMode, int priority, uint timeToLive, bool mandatory, bool immediate)
- {
- // todo: handle session access ticket
- AMQFrame publishFrame = BasicPublishBody.CreateAMQFrame(
- _channel.ChannelId, 0, exchangeName,
- routingKey, mandatory, immediate
- );
-
- // fix message properties
- if ( !_disableTimestamps )
- {
- message.Timestamp = DateTime.UtcNow.Ticks;
- if (timeToLive != 0)
- {
- message.Expiration = message.Timestamp + timeToLive;
- }
- } else
- {
- message.Expiration = 0;
- }
- message.DeliveryMode = deliveryMode;
- message.Priority = (byte)priority;
-
- ByteBuffer payload = message.Data;
- int payloadLength = payload.Limit;
-
- ContentBody[] contentBodies = CreateContentBodies(payload);
- AMQFrame[] frames = new AMQFrame[2 + contentBodies.Length];
- for ( int i = 0; i < contentBodies.Length; i++ )
- {
- frames[2 + i] = ContentBody.CreateAMQFrame(_channelId, contentBodies[i]);
- }
- if ( contentBodies.Length > 0 && _logger.IsDebugEnabled )
- {
- _logger.Debug(string.Format("Sending content body frames to {{exchangeName={0} routingKey={1}}}", exchangeName, routingKey));
- }
-
- // weight argument of zero indicates no child content headers, just bodies
- AMQFrame contentHeaderFrame = ContentHeaderBody.CreateAMQFrame(
- _channelId, AmqChannel.BASIC_CONTENT_TYPE, 0,
- message.ContentHeaderProperties, (uint)payloadLength
- );
- if ( _logger.IsDebugEnabled )
- {
- _logger.Debug(string.Format("Sending content header frame to {{exchangeName={0} routingKey={1}}}", exchangeName, routingKey));
- }
-
- frames[0] = publishFrame;
- frames[1] = contentHeaderFrame;
- CompositeAMQDataBlock compositeFrame = new CompositeAMQDataBlock(frames);
-
- lock ( _channel.Connection.FailoverMutex )
- {
- _channel.Connection.ProtocolWriter.Write(compositeFrame);
- }
- }
-
-
- /// <summary>
- /// Create content bodies. This will split a large message into numerous bodies depending on the negotiated
- /// maximum frame size.
- /// </summary>
- /// <param name="payload"></param>
- /// <returns>return the array of content bodies</returns>
- private ContentBody[] CreateContentBodies(ByteBuffer payload)
- {
- if ( payload == null )
- {
- return null;
- } else if ( payload.Remaining == 0 )
- {
- return new ContentBody[0];
- }
- // we substract one from the total frame maximum size to account for the end of frame marker in a body frame
- // (0xCE byte).
- int framePayloadMax = (int)(_channel.Connection.MaximumFrameSize - 1);
- int frameCount = CalculateContentBodyFrames(payload);
- ContentBody[] bodies = new ContentBody[frameCount];
- for ( int i = 0; i < frameCount; i++ )
- {
- int length = (payload.Remaining >= framePayloadMax)
- ? framePayloadMax : payload.Remaining;
- bodies[i] = new ContentBody(payload, (uint)length);
- }
- return bodies;
- }
-
- private int CalculateContentBodyFrames(ByteBuffer payload)
- {
- // we substract one from the total frame maximum size to account
- // for the end of frame marker in a body frame
- // (0xCE byte).
- int frameCount;
- if ( (payload == null) || (payload.Remaining == 0) )
- {
- frameCount = 0;
- } else
- {
- int dataLength = payload.Remaining;
- int framePayloadMax = (int)_channel.Connection.MaximumFrameSize - 1;
- int lastFrame = ((dataLength % framePayloadMax) > 0) ? 1 : 0;
- frameCount = (int)(dataLength / framePayloadMax) + lastFrame;
- }
-
- return frameCount;
- }
- #endregion // Message Publishing
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Closeable.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Closeable.cs
deleted file mode 100644
index b9664ccea3..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Closeable.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.
- *
- */
-using System;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client
-{
- /// <summary>Closeable provides monitoring of the state of a closeable resource; whether it is open or closed. It also provides a lock on which
- /// attempts to close the resource from multiple threads can be coordinated.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Close (and clean-up) a resource.
- /// <tr><td> Monitor the state of a closeable resource.
- /// <tr><td> Synchronous attempts to close resource from concurrent threads.
- /// </table>
- /// </summary>
- ///
- /// <remarks>Poor encapsulation of the close lock. Better to completely hide the implementation, such that there is a method, e.g., DoSingleClose,
- /// that sub-classes implement. Guaranteed to only be called by one thread at once, and iff the object is not already closed. That is, multiple
- /// simultaneous closes will result in a single call to the real close method. Put the wait and condition checking loop in this base class.
- /// </remarks>
- public abstract class Closeable : ICloseable
- {
- /// <summary> Constant representing the closed state. </summary>
- protected const int CLOSED = 1;
-
- /// <summary> Constant representing the open state. </summary>
- protected const int NOT_CLOSED = 2;
-
- /// <summary> Used to ensure orderly closing of the object. </summary>
- protected readonly object _closingLock = new object();
-
- /// <summary> Indicates the state of this resource; open or closed. </summary>
- protected int _closed = NOT_CLOSED;
-
- /// <summary>
- /// Checks the not closed.
- /// </summary>
- ///
- /// <remarks>Don't like check methods that throw exceptions. a) it can come as a surprise without checked exceptions, b) it limits the
- /// callers choice, if the caller would prefer a boolean, c) it is not side-effect free programming, where such could be used. Get rid
- /// of this and replace with boolean.</remarks>
- protected void CheckNotClosed()
- {
- if (_closed == CLOSED)
- {
- throw new InvalidOperationException("Object " + ToString() + " has been closed");
- }
- }
-
- /// <summary>Indicates whether this resource is closed.</summary>
- /// <value><c>true</c> if closed; otherwise, <c>false</c>.</value>
- public bool Closed
- {
- get
- {
- return _closed == CLOSED;
- }
- }
-
- /// <summary> Close this resource. </summary>
- public abstract void Close();
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Configuration/AuthenticationConfigurationSectionHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Configuration/AuthenticationConfigurationSectionHandler.cs
deleted file mode 100644
index ae9225a53a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Configuration/AuthenticationConfigurationSectionHandler.cs
+++ /dev/null
@@ -1,84 +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;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Configuration;
-using System.Text;
-
-using Apache.Qpid.Client.Security;
-using Apache.Qpid.Sasl.Mechanisms;
-
-namespace Apache.Qpid.Client.Configuration
-{
- public class AuthenticationConfigurationSectionHandler
- : IConfigurationSectionHandler
- {
-
- public object Create(object parent, object configContext, System.Xml.XmlNode section)
- {
- NameValueSectionHandler handler = new NameValueSectionHandler();
- OrderedHashTable schemes = new OrderedHashTable();
-
- NameValueCollection options = (NameValueCollection)
- handler.Create(parent, configContext, section);
-
- if ( options != null )
- {
- foreach ( string key in options.Keys )
- {
- Type type = Type.GetType(options[key]);
- if ( type == null )
- throw new ConfigurationException(string.Format("Type '{0}' not found", key));
- if ( !typeof(IAMQCallbackHandler).IsAssignableFrom(type) )
- throw new ConfigurationException(string.Format("Type '{0}' does not implement IAMQCallbackHandler", key));
-
- schemes.Add(key, type);
- }
- }
-
- return schemes;
- }
-
- } // class AuthenticationConfigurationSectionHandler
-
- public class OrderedHashTable : Hashtable
- {
- private ArrayList _keys = new ArrayList();
-
- public IList OrderedKeys
- {
- get { return _keys; }
- }
-
- public override void Add(object key, object value)
- {
- base.Add(key, value);
- _keys.Add(key);
- }
- public override void Remove(object key)
- {
- base.Remove(key);
- _keys.Remove(key);
- }
- }
-} // namespace Apache.Qpid.Client.Configuration
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/ConnectionTuneParameters.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/ConnectionTuneParameters.cs
deleted file mode 100644
index b21486bfa8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/ConnectionTuneParameters.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.Client
-{
- public class ConnectionTuneParameters
- {
- private uint _frameMax;
-
- private ushort _channelMax;
-
- private uint _hearbeat;
-
- private uint _txnLimit;
-
- public uint FrameMax
- {
- get
- {
- return _frameMax;
- }
- set
- {
- _frameMax = value;
- }
- }
-
- public ushort ChannelMax
- {
- get
- {
- return _channelMax;
- }
- set
- {
- _channelMax = value;
- }
- }
-
- public uint Heartbeat
- {
- get
- {
- return _hearbeat;
- }
- set
- {
- _hearbeat = value;
- }
- }
-
- public uint TxnLimit
- {
- get
- {
- return _txnLimit;
- }
- set
- {
- _txnLimit = value;
- }
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs
deleted file mode 100644
index 7013746414..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverException.cs
+++ /dev/null
@@ -1,42 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Client.Failover
-{
- /// <summary>
- /// This exception is thrown when failover is taking place and we need to let other
- /// parts of the client know about this.
- /// </summary>
- [Serializable]
- class FailoverException : Exception
- {
- public FailoverException(String message) : base(message)
- {
- }
-
- protected FailoverException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverHandler.cs
deleted file mode 100644
index 83c69b7d25..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverHandler.cs
+++ /dev/null
@@ -1,175 +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;
-using System.Threading;
-using log4net;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-
-namespace Apache.Qpid.Client.Failover
-{
- public class FailoverHandler
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(FailoverHandler));
-
- private AMQConnection _connection;
-
- /**
- * Used where forcing the failover host
- */
- private String _host;
-
- /**
- * Used where forcing the failover port
- */
- private int _port;
-
- public FailoverHandler(AMQConnection connection)
- {
- _connection = connection;
- }
-
- public void Run()
- {
- if (Thread.CurrentThread.IsBackground)
- {
- throw new InvalidOperationException("FailoverHandler must Run on a non-background thread.");
- }
-
- AMQProtocolListener pl = _connection.ProtocolListener;
- pl.FailoverLatch = new ManualResetEvent(false);
-
- // We wake up listeners. If they can handle failover, they will extend the
- // FailoverSupport class and will in turn block on the latch until failover
- // has completed before retrying the operation
- _connection.ProtocolListener.PropagateExceptionToWaiters(new FailoverException("Failing over about to start"));
-
- // Since failover impacts several structures we protect them all with a single mutex. These structures
- // are also in child objects of the connection. This allows us to manipulate them without affecting
- // client code which runs in a separate thread.
- lock (_connection.FailoverMutex)
- {
- _log.Info("Starting failover process");
-
- // We switch in a new state manager temporarily so that the interaction to get to the "connection open"
- // state works, without us having to terminate any existing "state waiters". We could theoretically
- // have a state waiter waiting until the connection is closed for some reason. Or in future we may have
- // a slightly more complex state model therefore I felt it was worthwhile doing this.
- AMQStateManager existingStateManager = _connection.ProtocolListener.StateManager;
- _connection.ProtocolListener.StateManager = new AMQStateManager();
- if (!_connection.FirePreFailover(_host != null))
- {
- _connection.ProtocolListener.StateManager = existingStateManager;
- if (_host != null)
- {
- _connection.ExceptionReceived(new AMQDisconnectedException("Redirect was vetoed by client"));
- }
- else
- {
- _connection.ExceptionReceived(new AMQDisconnectedException("Failover was vetoed by client"));
- }
- pl.FailoverLatch.Set();
- pl.FailoverLatch = null;
- return;
- }
- bool failoverSucceeded;
- // when host is non null we have a specified failover host otherwise we all the client to cycle through
- // all specified hosts
-
- // if _host has value then we are performing a redirect.
- if (_host != null)
- {
- // todo: fix SSL support!
- failoverSucceeded = _connection.AttemptReconnection(_host, _port, null);
- }
- else
- {
- failoverSucceeded = _connection.AttemptReconnection();
- }
-
- // XXX: at this point it appears that we are going to set StateManager to existingStateManager in
- // XXX: both paths of control.
- if (!failoverSucceeded)
- {
- _connection.ProtocolListener.StateManager = existingStateManager;
- _connection.ExceptionReceived(
- new AMQDisconnectedException("Server closed connection and no failover " +
- "was successful"));
- }
- else
- {
- _connection.ProtocolListener.StateManager = existingStateManager;
- try
- {
- if (_connection.FirePreResubscribe())
- {
- _log.Info("Resubscribing on new connection");
- _connection.ResubscribeChannels();
- }
- else
- {
- _log.Info("Client vetoed automatic resubscription");
- }
- _connection.FireFailoverComplete();
- _connection.ProtocolListener.FailoverState = FailoverState.NOT_STARTED;
- _log.Info("Connection failover completed successfully");
- }
- catch (Exception e)
- {
- _log.Info("Failover process failed - exception being propagated by protocol handler");
- _connection.ProtocolListener.FailoverState = FailoverState.FAILED;
- try
- {
- _connection.ProtocolListener.OnException(e);
- }
- catch (Exception ex)
- {
- _log.Error("Error notifying protocol session of error: " + ex, ex);
- }
- }
- }
- }
- pl.FailoverLatch.Set();
- }
-
- public String getHost()
- {
- return _host;
- }
-
- public void setHost(String host)
- {
- _host = host;
- }
-
- public int getPort()
- {
- return _port;
- }
-
- public void setPort(int port)
- {
- _port = port;
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverState.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverState.cs
deleted file mode 100644
index 3058cdcd69..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverState.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.Client.Failover
-{
- /// <summary>
- /// Enumeration of failover states. Used to handle failover from within AMQProtocolHandler where MINA events need to be
- /// dealt with and can happen during failover.
- /// </summary>
- enum FailoverState
- {
- NOT_STARTED, IN_PROGRESS, FAILED
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverSupport.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverSupport.cs
deleted file mode 100644
index afa5301f39..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Failover/FailoverSupport.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 log4net;
-
-namespace Apache.Qpid.Client.Failover
-{
- public abstract class FailoverSupport
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(FailoverSupport));
-
- public object execute(AMQConnection con)
- {
- // We wait until we are not in the middle of failover before acquiring the mutex and then proceeding.
- // Any method that can potentially block for any reason should use this class so that deadlock will not
- // occur. The FailoverException is propagated by the AMQProtocolHandler to any listeners (e.g. frame listeners)
- // that might be causing a block. When that happens, the exception is caught here and the mutex is released
- // before waiting for the failover to complete (either successfully or unsuccessfully).
- while (true)
- {
- con.ProtocolListener.BlockUntilNotFailingOver();
- lock (con.FailoverMutex)
- {
- try
- {
- return operation();
- }
- catch (FailoverException e)
- {
- _log.Info("Failover exception caught during operation", e);
- }
- }
- }
- }
-
- protected abstract object operation();
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/BasicDeliverMethodHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/BasicDeliverMethodHandler.cs
deleted file mode 100644
index def1e78e8c..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/BasicDeliverMethodHandler.cs
+++ /dev/null
@@ -1,42 +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 log4net;
-using Apache.Qpid.Client.Message;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Handler
-{
- public class BasicDeliverMethodHandler : IStateAwareMethodListener
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(BasicDeliverMethodHandler));
-
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- UnprocessedMessage msg = new UnprocessedMessage();
- msg.DeliverBody = (BasicDeliverBody) evt.Method;
- msg.ChannelId = evt.ChannelId;
- _logger.Debug("New JmsDeliver method received");
- evt.ProtocolSession.UnprocessedMessageReceived(msg);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/BasicReturnMethodHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/BasicReturnMethodHandler.cs
deleted file mode 100644
index f413dfc9c6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/BasicReturnMethodHandler.cs
+++ /dev/null
@@ -1,44 +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 log4net;
-using Apache.Qpid.Client.Message;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Handler
-{
- public class BasicReturnMethodHandler : IStateAwareMethodListener
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(BasicReturnMethodHandler));
-
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- _logger.Debug("New Basic.Return method received");
- UnprocessedMessage msg = new UnprocessedMessage();
- msg.DeliverBody = null;
- msg.BounceBody = (BasicReturnBody) evt.Method;
- msg.ChannelId = evt.ChannelId;
-
- evt.ProtocolSession.UnprocessedMessageReceived(msg);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs
deleted file mode 100644
index 9ed09a0d01..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.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.
- *
- */
-using log4net;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Protocol;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Handler
-{
- public class ChannelCloseMethodHandler : IStateAwareMethodListener
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(ChannelCloseMethodHandler));
-
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- _logger.Debug("ChannelClose method received");
- ChannelCloseBody method = (ChannelCloseBody) evt.Method;
-
- int errorCode = method.ReplyCode;
- string reason = method.ReplyText;
- if (_logger.IsDebugEnabled)
- {
- _logger.Debug("Channel close reply code: " + errorCode + ", reason: " + reason);
- }
-
- AMQFrame frame = ChannelCloseOkBody.CreateAMQFrame(evt.ChannelId);
- evt.ProtocolSession.WriteFrame(frame);
-
- if ( errorCode != AMQConstant.REPLY_SUCCESS.Code )
- {
- _logger.Debug("Channel close received with errorCode " + errorCode + ", throwing exception");
- if ( errorCode == AMQConstant.NO_CONSUMERS.Code )
- throw new AMQNoConsumersException(reason);
- if ( errorCode == AMQConstant.NO_ROUTE.Code )
- throw new AMQNoRouteException(reason);
- if ( errorCode == AMQConstant.INVALID_ARGUMENT.Code )
- throw new AMQInvalidArgumentException(reason);
- if ( errorCode == AMQConstant.INVALID_ROUTING_KEY.Code )
- throw new AMQInvalidRoutingKeyException(reason);
- // any other
- throw new AMQChannelClosedException(errorCode, "Error: " + reason);
- }
- evt.ProtocolSession.ChannelClosed(evt.ChannelId, errorCode, reason);
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseMethodHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseMethodHandler.cs
deleted file mode 100644
index 66cff3bc65..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseMethodHandler.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.
- *
- */
-using System;
-using System.Threading;
-using log4net;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Protocol;
-
-namespace Apache.Qpid.Client.Handler
-{
- public class ConnectionCloseMethodHandler : IStateAwareMethodListener
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(ConnectionCloseMethodHandler));
-
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- _logger.Debug("ConnectionClose frame received");
- ConnectionCloseBody method = (ConnectionCloseBody) evt.Method;
-
- int errorCode = method.ReplyCode;
- String reason = method.ReplyText;
-
- // send CloseOK
- evt.ProtocolSession.WriteFrame(ConnectionCloseOkBody.CreateAMQFrame(evt.ChannelId));
-
- if ( errorCode != AMQConstant.REPLY_SUCCESS.Code )
- {
- if ( errorCode == AMQConstant.NOT_ALLOWED.Code )
- {
- _logger.Info("Authentication Error: " + Thread.CurrentThread.Name);
- evt.ProtocolSession.CloseProtocolSession();
-
- //todo this is a bit of a fudge (could be conssidered such as each new connection needs a new state manager or at least a fresh state.
- stateManager.ChangeState(AMQState.CONNECTION_NOT_STARTED);
-
- throw new AMQAuthenticationException(errorCode, reason);
- } else
- {
- _logger.Info("Connection close received with error code " + errorCode);
- throw new AMQConnectionClosedException(errorCode, "Error: " + reason);
- }
- }
- // this actually closes the connection in the case where it is not an error.
- evt.ProtocolSession.CloseProtocolSession();
- stateManager.ChangeState(AMQState.CONNECTION_CLOSED);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseOkHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseOkHandler.cs
deleted file mode 100644
index 038da15731..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionCloseOkHandler.cs
+++ /dev/null
@@ -1,41 +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 log4net;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Handler
-{
- public class ConnectionCloseOkHandler : IStateAwareMethodListener
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(ConnectionCloseOkHandler));
-
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- _logger.Debug("ConnectionCloseOk frame received");
-// ConnectionCloseOkBody method = (ConnectionCloseOkBody)evt.Method;
- stateManager.ChangeState(AMQState.CONNECTION_CLOSED);
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionOpenOkMethodHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionOpenOkMethodHandler.cs
deleted file mode 100644
index a12e4ead60..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionOpenOkMethodHandler.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.
- *
- */
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-
-namespace Apache.Qpid.Client.Handler
-{
- public class ConnectionOpenOkMethodHandler : IStateAwareMethodListener
- {
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- stateManager.ChangeState(AMQState.CONNECTION_OPEN);
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionRedirectMethodHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionRedirectMethodHandler.cs
deleted file mode 100644
index 08cc580b17..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionRedirectMethodHandler.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.
- *
- */
-using log4net;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-
-namespace Apache.Qpid.Client.Handler
-{
- public class ConnectionRedirectMethodHandler : IStateAwareMethodListener
- {
-// private static readonly ILog _logger = LogManager.GetLogger(typeof(ConnectionRedirectMethodHandler));
-
- private const int DEFAULT_REDIRECT_PORT = 5672;
-
- private static ConnectionRedirectMethodHandler _handler = new ConnectionRedirectMethodHandler();
-
- public static ConnectionRedirectMethodHandler GetInstance()
- {
- return _handler;
- }
-
- private ConnectionRedirectMethodHandler()
- {
- }
-
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- /*_logger.Info("ConnectionRedirect frame received");
- ConnectionRedirectBody method = (ConnectionRedirectBody) evt.Method;
-
- // the host is in the form hostname:port with the port being optional
- int portIndex = method.Host.IndexOf(':');
- String host;
- int port;
- if (portIndex == -1)
- {
- host = method.Host;
- port = DEFAULT_REDIRECT_PORT;
- }
- else
- {
- host = method.Host.Substring(0, portIndex);
- port = Int32.Parse(method.Host.Substring(portIndex + 1));
- }
- evt.ProtocolSession.Failover(host, port);*/
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionSecureMethodHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionSecureMethodHandler.cs
deleted file mode 100644
index 9333d4d0a6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionSecureMethodHandler.cs
+++ /dev/null
@@ -1,60 +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 Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Sasl;
-
-namespace Apache.Qpid.Client.Handler
-{
- public class ConnectionSecureMethodHandler : IStateAwareMethodListener
- {
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- ISaslClient saslClient = evt.ProtocolSession.SaslClient;
- if ( saslClient == null )
- {
- throw new AMQException("No SASL client set up - cannot proceed with authentication");
- }
-
-
- ConnectionSecureBody body = (ConnectionSecureBody)evt.Method;
-
- try
- {
- // Evaluate server challenge
- byte[] response = saslClient.EvaluateChallenge(body.Challenge);
- // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
- // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
- // Be aware of possible changes to parameter order as versions change.
- AMQFrame responseFrame = ConnectionSecureOkBody.CreateAMQFrame(
- evt.ChannelId, response);
- evt.ProtocolSession.WriteFrame(responseFrame);
- } catch ( SaslException e )
- {
- throw new AMQException("Error processing SASL challenge: " + e, e);
- }
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.cs
deleted file mode 100644
index c54662286b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.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.
- *
- */
-using System;
-using System.Collections;
-using System.Text;
-using log4net;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.Security;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Sasl;
-
-
-namespace Apache.Qpid.Client.Handler
-{
- public class ConnectionStartMethodHandler : IStateAwareMethodListener
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(ConnectionStartMethodHandler));
-
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- ConnectionStartBody body = (ConnectionStartBody) evt.Method;
- AMQProtocolSession ps = evt.ProtocolSession;
-
- try
- {
- if ( body.Mechanisms == null )
- {
- throw new AMQException("mechanism not specified in ConnectionStart method frame");
- }
- string mechanisms = Encoding.UTF8.GetString(body.Mechanisms);
- string selectedMechanism = ChooseMechanism(mechanisms);
- if ( selectedMechanism == null )
- {
- throw new AMQException("No supported security mechanism found, passed: " + mechanisms);
- }
-
- byte[] saslResponse = DoAuthentication(selectedMechanism, ps);
-
- if (body.Locales == null)
- {
- throw new AMQException("Locales is not defined in Connection Start method");
- }
- string allLocales = Encoding.ASCII.GetString(body.Locales);
- string[] locales = allLocales.Split(' ');
- string selectedLocale;
- if (locales != null && locales.Length > 0)
- {
- selectedLocale = locales[0];
- }
- else
- {
- throw new AMQException("No locales sent from server, passed: " + locales);
- }
-
- stateManager.ChangeState(AMQState.CONNECTION_NOT_TUNED);
- FieldTable clientProperties = new FieldTable();
- clientProperties["product"] = "Apache.Qpid.NET";
- clientProperties["version"] = "1.0";
- clientProperties["platform"] = GetFullSystemInfo();
- clientProperties["instance"] = ps.ClientID;
- AMQFrame frame = ConnectionStartOkBody.CreateAMQFrame(
- evt.ChannelId, clientProperties, selectedMechanism,
- saslResponse, selectedLocale);
- ps.WriteFrame(frame);
- }
- catch (Exception e)
- {
- throw new AMQException(_log, "Unable to decode data: " + e, e);
- }
- }
-
- private string GetFullSystemInfo()
- {
- StringBuilder sysInfo = new StringBuilder();
- // check if we're running on mono or .net
- Type monoRuntime = Type.GetType("Mono.Runtime");
- if ( monoRuntime != null )
- sysInfo.Append("Mono");
- else
- sysInfo.Append(".NET");
- sysInfo.Append(" ").Append(Environment.Version);
- sysInfo.Append(", ").Append(Environment.OSVersion);
- return sysInfo.ToString();
- }
-
- private string ChooseMechanism(string mechanisms)
- {
- return CallbackHandlerRegistry.Instance.ChooseMechanism(mechanisms);
- }
-
- private byte[] DoAuthentication(string selectedMechanism, AMQProtocolSession ps)
- {
- ISaslClient saslClient = Sasl.Sasl.CreateClient(
- new string[] { selectedMechanism }, null, "AMQP", "localhost",
- new Hashtable(), CreateCallbackHandler(selectedMechanism, ps)
- );
- if ( saslClient == null )
- {
- throw new AMQException("Client SASL configuration error: no SaslClient could be created for mechanism " +
- selectedMechanism);
- }
- ps.SaslClient = saslClient;
- try
- {
- return saslClient.HasInitialResponse ?
- saslClient.EvaluateChallenge(new byte[0]) : null;
- } catch ( Exception ex )
- {
- ps.SaslClient = null;
- throw new AMQException("Unable to create SASL client", ex);
- }
- }
-
- private IAMQCallbackHandler CreateCallbackHandler(string mechanism, AMQProtocolSession session)
- {
- Type type = CallbackHandlerRegistry.Instance.GetCallbackHandler(mechanism);
- IAMQCallbackHandler handler =
- (IAMQCallbackHandler)Activator.CreateInstance(type);
- if ( handler == null )
- throw new AMQException("Unable to create callback handler: " + mechanism);
- handler.Initialize(session);
- return handler;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionTuneMethodHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionTuneMethodHandler.cs
deleted file mode 100644
index 15a1d908b7..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/ConnectionTuneMethodHandler.cs
+++ /dev/null
@@ -1,63 +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;
-using log4net;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Handler
-{
- public class ConnectionTuneMethodHandler : IStateAwareMethodListener
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(ConnectionTuneMethodHandler));
-
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- _logger.Debug("ConnectionTune frame received");
- ConnectionTuneBody frame = (ConnectionTuneBody) evt.Method;
- AMQProtocolSession session = evt.ProtocolSession;
-
- ConnectionTuneParameters parameters = session.ConnectionTuneParameters;
- if (parameters == null)
- {
- parameters = new ConnectionTuneParameters();
- }
-
- _logger.Debug(String.Format("ConnectionTune.heartbeat = {0}.", frame.Heartbeat));
-
- parameters.FrameMax = frame.FrameMax;
- parameters.Heartbeat = frame.Heartbeat;
- session.ConnectionTuneParameters = parameters;
-
- stateManager.ChangeState(AMQState.CONNECTION_NOT_OPENED);
- session.WriteFrame(ConnectionTuneOkBody.CreateAMQFrame(
- evt.ChannelId, frame.ChannelMax, frame.FrameMax, frame.Heartbeat));
- session.WriteFrame(ConnectionOpenBody.CreateAMQFrame(
- evt.ChannelId, session.AMQConnection.VirtualHost, null, true));
-
- if (frame.Heartbeat > 0)
- {
- evt.ProtocolSession.AMQConnection.StartHeartBeatThread(frame.Heartbeat);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/QueueDeleteOkMethodHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/QueueDeleteOkMethodHandler.cs
deleted file mode 100644
index 7290d758f8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/QueueDeleteOkMethodHandler.cs
+++ /dev/null
@@ -1,44 +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 log4net;
-using Apache.Qpid.Client.Message;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Handler
-{
- public class QueueDeleteOkMethodHandler : IStateAwareMethodListener
- {
-
- private static readonly ILog _logger = LogManager.GetLogger(typeof(QueueDeleteOkMethodHandler));
-
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- QueueDeleteOkBody body = (QueueDeleteOkBody)evt.Method;
- if (body != null)
- {
- _logger.InfoFormat("Received Queue.Delete-Ok message, message count {0}", body.MessageCount);
- }
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/QueuePurgeOkMethodHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/QueuePurgeOkMethodHandler.cs
deleted file mode 100644
index 8bde707b00..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Handler/QueuePurgeOkMethodHandler.cs
+++ /dev/null
@@ -1,44 +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 log4net;
-using Apache.Qpid.Client.Message;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Handler
-{
- public class QueuePurgeOkMethodHandler : IStateAwareMethodListener
- {
-
- private static readonly ILog _logger = LogManager.GetLogger(typeof(QueuePurgeOkMethodHandler));
-
- public void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt)
- {
- QueuePurgeOkBody body = (QueuePurgeOkBody)evt.Method;
- if (body != null)
- {
- _logger.InfoFormat("Received Queue.Purge-Ok message, message count {0}", body.MessageCount);
- }
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AMQMessage.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AMQMessage.cs
deleted file mode 100644
index e58de2ab96..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AMQMessage.cs
+++ /dev/null
@@ -1,58 +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 Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Message
-{
- public class AMQMessage
- {
- protected IContentHeaderProperties _contentHeaderProperties;
-
- /// <summary>
- /// If the acknowledge mode is CLIENT_ACKNOWLEDGE the session is required
- /// </summary>
- protected AmqChannel _channel;
-
- private long _deliveryTag;
-
- public AMQMessage(IContentHeaderProperties properties, long deliveryTag)
- {
- _contentHeaderProperties = properties;
- _deliveryTag = deliveryTag;
- }
-
- public AMQMessage(IContentHeaderProperties properties)
- : this(properties, -1)
- {
- }
-
- public long DeliveryTag
- {
- get { return _deliveryTag; }
- }
-
- public AmqChannel Channel
- {
- get { return _channel; }
- set { _channel = value; }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AMQMessageFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AMQMessageFactory.cs
deleted file mode 100644
index f352d62c11..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AMQMessageFactory.cs
+++ /dev/null
@@ -1,73 +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.Collections;
-using Apache.Qpid.Framing;
-using log4net;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Client.Message
-{
- public abstract class AbstractQmsMessageFactory : IMessageFactory
- {
- public abstract AbstractQmsMessage CreateMessage(string mimeType);
-
- private static readonly ILog _logger = LogManager.GetLogger(typeof (AbstractQmsMessageFactory));
-
- protected abstract AbstractQmsMessage CreateMessage(long messageNbr, ByteBuffer data, ContentHeaderBody contentHeader);
-
- protected AbstractQmsMessage CreateMessageWithBody(long messageNbr,
- ContentHeaderBody contentHeader,
- IList bodies)
- {
- ByteBuffer data;
-
- // we optimise the non-fragmented case to avoid copying
- if (bodies != null && bodies.Count == 1)
- {
- _logger.Debug("Non-fragmented message body (bodySize=" + contentHeader.BodySize +")");
- data = ((ContentBody)bodies[0]).Payload;
- }
- else
- {
- _logger.Debug("Fragmented message body (" + bodies.Count + " frames, bodySize=" + contentHeader.BodySize + ")");
- data = ByteBuffer.Allocate((int)contentHeader.BodySize); // XXX: Is cast a problem?
- foreach (ContentBody body in bodies) {
- data.Put(body.Payload);
- //body.Payload.Release();
- }
-
- data.Flip();
- }
- _logger.Debug("Creating message from buffer with position=" + data.Position + " and remaining=" + data.Remaining);
-
- return CreateMessage(messageNbr, data, contentHeader);
- }
-
- public AbstractQmsMessage CreateMessage(long messageNbr, bool redelivered,
- ContentHeaderBody contentHeader,
- IList bodies)
- {
- AbstractQmsMessage msg = CreateMessageWithBody(messageNbr, contentHeader, bodies);
- msg.Redelivered = redelivered;
- return msg;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs
deleted file mode 100644
index 34b47137e5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs
+++ /dev/null
@@ -1,694 +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;
-using System.Collections;
-using System.Text;
-using log4net;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Client.Message
-{
- public abstract class AbstractQmsMessage : AMQMessage, IMessage
- {
- private static ILog log = LogManager.GetLogger(typeof(AbstractQmsMessage));
-
- protected bool _redelivered;
-
- protected ByteBuffer _data;
- protected bool _readableMessage = false;
- private QpidHeaders _headers;
-
- protected AbstractQmsMessage(ByteBuffer data)
- : base(new BasicContentHeaderProperties())
- {
- Init(data);
- }
-
- protected AbstractQmsMessage(long deliveryTag, BasicContentHeaderProperties contentHeader, ByteBuffer data)
- : this(contentHeader, deliveryTag)
- {
- Init(data);
- }
-
- protected AbstractQmsMessage(BasicContentHeaderProperties contentHeader, long deliveryTag) : base(contentHeader, deliveryTag)
- {
- Init(null);
- }
-
- private void Init(ByteBuffer data)
- {
- _data = data;
- if ( _data != null )
- {
- _data.Acquire();
- }
- _readableMessage = (data != null);
- if ( ContentHeaderProperties.Headers == null )
- ContentHeaderProperties.Headers = new FieldTable();
- _headers = new QpidHeaders(ContentHeaderProperties.Headers);
- }
-
- //
- // Properties
- //
-
- /// <summary>
- /// The application message identifier
- /// </summary>
- public string MessageId
- {
- get
- {
- if (ContentHeaderProperties.MessageId == null)
- {
- ContentHeaderProperties.MessageId = "ID:" + DeliveryTag;
- }
- return ContentHeaderProperties.MessageId;
- }
- set { ContentHeaderProperties.MessageId = value; }
- }
-
- /// <summary>
- /// The message timestamp
- /// </summary>
- public long Timestamp
- {
- get
- {
- // TODO: look at ulong/long choice
- return (long) ContentHeaderProperties.Timestamp;
- }
- set
- {
- ContentHeaderProperties.Timestamp = (ulong) value;
- }
- }
-
- /// <summary>
- /// The <see cref="CorrelationId"/> as a byte array.
- /// </summary>
- public byte[] CorrelationIdAsBytes
- {
- get { return Encoding.Default.GetBytes(ContentHeaderProperties.CorrelationId); }
- set { ContentHeaderProperties.CorrelationId = Encoding.Default.GetString(value); }
- }
-
- /// <summary>
- /// The application correlation identifier
- /// </summary>
- public string CorrelationId
- {
- get { return ContentHeaderProperties.CorrelationId; }
- set { ContentHeaderProperties.CorrelationId = value; }
- }
-
- struct Dest
- {
- public string ExchangeName;
- public string RoutingKey;
-
- public Dest(string exchangeName, string routingKey)
- {
- ExchangeName = exchangeName;
- RoutingKey = routingKey;
- }
- }
-
- /// <summary>
- /// Exchange name of the reply-to address
- /// </summary>
- public string ReplyToExchangeName
- {
- get
- {
- return ReadReplyToHeader().ExchangeName;
- }
- set
- {
- BindingURL dest = ReadReplyToHeader();
- dest.ExchangeName = value;
- WriteReplyToHeader(dest);
- }
- }
-
- /// <summary>
- /// Routing key of the reply-to address
- /// </summary>
- public string ReplyToRoutingKey
- {
- get
- {
- return ReadReplyToHeader().RoutingKey;
- }
- set
- {
- BindingURL dest = ReadReplyToHeader();
- dest.RoutingKey = value;
- WriteReplyToHeader(dest);
- }
- }
-
- /// <summary>
- /// Non-persistent (1) or persistent (2)
- /// </summary>
- public DeliveryMode DeliveryMode
- {
- get
- {
- byte b = ContentHeaderProperties.DeliveryMode;
- switch (b)
- {
- case 1:
- return DeliveryMode.NonPersistent;
- case 2:
- return DeliveryMode.Persistent;
- default:
- throw new QpidException("Illegal value for delivery mode in content header properties");
- }
- }
- set
- {
- ContentHeaderProperties.DeliveryMode = (byte)(value==DeliveryMode.NonPersistent?1:2);
- }
- }
-
- /// <summary>
- /// True, if this is a redelivered message
- /// </summary>
- public bool Redelivered
- {
- get { return _redelivered; }
- set { _redelivered = value; }
- }
-
- /// <summary>
- /// The message type name
- /// </summary>
- public string Type
- {
- get { return ContentHeaderProperties.Type; }
- set { ContentHeaderProperties.Type = value; }
- }
-
- /// <summary>
- /// Message expiration specification
- /// </summary>
- public long Expiration
- {
- get { return ContentHeaderProperties.Expiration; }
- set { ContentHeaderProperties.Expiration = value; }
- }
-
- /// <summary>
- /// The message priority, 0 to 9
- /// </summary>
- public byte Priority
- {
- get { return ContentHeaderProperties.Priority; }
- set { ContentHeaderProperties.Priority = (byte) value; }
- }
-
- /// <summary>
- /// The MIME Content Type
- /// </summary>
- public string ContentType
- {
- get { return ContentHeaderProperties.ContentType; }
- set { ContentHeaderProperties.ContentType = value; }
- }
-
- /// <summary>
- /// The MIME Content Encoding
- /// </summary>
- public string ContentEncoding
- {
- get { return ContentHeaderProperties.Encoding; }
- set { ContentHeaderProperties.Encoding = value; }
- }
-
- /// <summary>
- /// Headers of this message
- /// </summary>
- public IHeaders Headers
- {
- get { return _headers; }
- }
-
- /// <summary>
- /// The creating user id
- /// </summary>
- public string UserId
- {
- get { return ContentHeaderProperties.UserId; }
- set { ContentHeaderProperties.UserId = value; }
- }
-
- /// <summary>
- /// The creating application id
- /// </summary>
- public string AppId
- {
- get { return ContentHeaderProperties.AppId; }
- set { ContentHeaderProperties.AppId = value; }
- }
-
- /// <summary>
- /// Intra-cluster routing identifier
- /// </summary>
- public string ClusterId
- {
- get { return ContentHeaderProperties.ClusterId; }
- set { ContentHeaderProperties.ClusterId = value; }
- }
-
- /// <summary>
- /// Return the raw byte array that is used to populate the frame when sending
- /// the message.
- /// </summary>
- /// <value>a byte array of message data</value>
- public ByteBuffer Data
- {
- get
- {
- if (_data != null)
- {
- if (!_readableMessage)
- {
- _data.Flip();
- }
- else
- {
- // Make sure we rewind the data just in case any method has moved the
- // position beyond the start.
- _data.Rewind();
- }
- }
- return _data;
- }
-
- set
- {
- _data = value;
- }
- }
-
- public void Acknowledge()
- {
- // the JMS 1.1 spec says in section 3.6 that calls to acknowledge are ignored when client acknowledge
- // is not specified. In our case, we only set the session field where client acknowledge mode is specified.
- if (_channel != null)
- {
- // we set multiple to true here since acknowledgement implies acknowledge of all count messages
- // received on the session
- _channel.AcknowledgeMessage((ulong)DeliveryTag, true);
- }
-
- }
-
- public abstract void ClearBodyImpl();
-
- public void ClearBody()
- {
- ClearBodyImpl();
- _readableMessage = false;
- }
-
- /// <summary>
- /// Get a String representation of the body of the message. Used in the
- /// toString() method which outputs this before message properties.
- /// </summary>
- /// <exception cref="QpidException"></exception>
- public abstract string ToBodyString();
-
- public override string ToString()
- {
- try
- {
- StringBuilder buf = new StringBuilder("Body:\n");
- buf.Append(ToBodyString());
- buf.Append("\nQmsTimestamp: ").Append(Timestamp);
- buf.Append("\nQmsExpiration: ").Append(Expiration);
- buf.Append("\nQmsPriority: ").Append(Priority);
- buf.Append("\nQmsDeliveryMode: ").Append(DeliveryMode);
- buf.Append("\nReplyToExchangeName: ").Append(ReplyToExchangeName);
- buf.Append("\nReplyToRoutingKey: ").Append(ReplyToRoutingKey);
- buf.Append("\nAMQ message number: ").Append(DeliveryTag);
- buf.Append("\nProperties:");
- if (ContentHeaderProperties.Headers == null)
- {
- buf.Append("<NONE>");
- }
- else
- {
- buf.Append(Headers.ToString());
- }
- return buf.ToString();
- }
- catch (Exception e)
- {
- return e.ToString();
- }
- }
-
- public FieldTable PopulateHeadersFromMessageProperties()
- {
- if (ContentHeaderProperties.Headers == null)
- {
- return null;
- }
- else
- {
- //
- // We need to convert every property into a String representation
- // Note that type information is preserved in the property name
- //
- FieldTable table = new FieldTable();
- foreach (DictionaryEntry entry in ContentHeaderProperties.Headers)
- {
- string propertyName = (string) entry.Key;
- if (propertyName == null)
- {
- continue;
- }
- else
- {
- table[propertyName] = entry.Value.ToString();
- }
- }
- return table;
- }
- }
-
- public BasicContentHeaderProperties ContentHeaderProperties
- {
- get
- {
- return (BasicContentHeaderProperties) _contentHeaderProperties;
- }
- }
-
- protected virtual void Reset()
- {
- _readableMessage = true;
- }
-
- public bool IsReadable
- {
- get { return _readableMessage; }
- }
-
- public bool isWritable
- {
- get { return !_readableMessage; }
- }
-
- protected void CheckReadable()
- {
- if ( !_readableMessage )
- {
- throw new MessageNotReadableException("You need to call reset() to make the message readable");
- }
- }
-
- /// <summary>
- /// Decodes the replyto field if one is set.
- ///
- /// Splits a replyto field containing an exchange name followed by a ':', followed by a routing key into the exchange name and
- /// routing key seperately. The exchange name may be empty in which case the empty string is returned. If the exchange name is
- /// empty the replyto field is expected to being with ':'.
- ///
- /// Anyhting other than a two part replyto field sperated with a ':' will result in an exception.
- /// </summary>
- ///
- /// <returns>A destination initialized to the replyto location if a replyto field was set, or an empty destination otherwise.</returns>
- private BindingURL ReadReplyToHeader()
- {
- string replyToEncoding = ContentHeaderProperties.ReplyTo;
- //log.Debug("replyToEncoding = " + replyToEncoding);
-
- BindingURL bindingUrl = new BindingURL(replyToEncoding);
- //log.Debug("bindingUrl = " + bindingUrl.ToString());
-
- return bindingUrl;
-
- //log.Info("replyToEncoding = " + replyToEncoding);
-
-// if ( replyToEncoding == null )
-// {
-// return new Dest();
-// } else
-// {
-// // Split the replyto field on a ':'
-// string[] split = replyToEncoding.Split(':');
-
-// // Ensure that the replyto field argument only consisted of two parts.
-// if ( split.Length != 2 )
-// {
-// throw new QpidException("Illegal value in ReplyTo property: " + replyToEncoding);
-// }
-
-// // Extract the exchange name and routing key from the split replyto field.
-// string exchangeName = split[0];
-
-// string[] split2 = split[1].Split('/');
-// string routingKey = split2[3];
-
-// return new Dest(exchangeName, routingKey);
-// }
- }
-
- private void WriteReplyToHeader(BindingURL dest)
- {
- string encodedDestination = string.Format("{0}:{1}", dest.ExchangeName, dest.RoutingKey);
- ContentHeaderProperties.ReplyTo = encodedDestination;
- }
- }
-
- public class BindingURL
- {
- public readonly static string OPTION_EXCLUSIVE = "exclusive";
- public readonly static string OPTION_AUTODELETE = "autodelete";
- public readonly static string OPTION_DURABLE = "durable";
- public readonly static string OPTION_CLIENTID = "clientid";
- public readonly static string OPTION_SUBSCRIPTION = "subscription";
- public readonly static string OPTION_ROUTING_KEY = "routingkey";
-
- /// <summary> Holds the undecoded URL </summary>
- string url;
-
- /// <summary> Holds the decoded options. </summary>
- IDictionary options = new Hashtable();
-
- /// <summary> Holds the decoded exchange class. </summary>
- string exchangeClass;
-
- /// <summary> Holds the decoded exchange name. </summary>
- string exchangeName;
-
- /// <summary> Holds the destination name. </summary>
- string destination;
-
- /// <summary> Holds the decoded queue name. </summary>
- string queueName;
-
- /// <summary>
- /// The binding URL has the format:
- /// <exch_class>://<exch_name>/[<destination>]/[<queue>]?<option>='<value>'[,<option>='<value>']*
- /// </summary>
- public BindingURL(string url)
- {
- this.url = url;
- Parse();
- }
-
- public string Url { get { return url; } }
-
- public string ExchangeClass
- {
- get { return exchangeClass; }
- set { exchangeClass = value; }
- }
-
- public string ExchangeName
- {
- get { return exchangeName; }
- set { exchangeName = value; }
- }
-
- public string QueueName
- {
- get { return queueName; }
- set { queueName = value; }
- }
-
- public string DestinationName
- {
- get { return destination; }
- set { destination = value; }
- }
-
- public string RoutingKey {
- get { return (string)options[OPTION_ROUTING_KEY]; }
- set { options[OPTION_ROUTING_KEY] = value; }
- }
-
- public bool ContainsOption(string key) { return options.Contains(key); }
-
- public string ToString()
- {
- return "BindingURL: [ ExchangeClass = " + ExchangeClass + ", ExchangeName = " + ExchangeName + ", QueueName = " + QueueName +
- ", DestinationName = " + DestinationName + ", RoutingKey = " + RoutingKey + " ] ";
- }
-
- private void Parse()
- {
- Uri binding = new Uri(url);
-
- // Extract the URI scheme, this contains the exchange class. It is defaulted to the direct exchange if not specified.
- string exchangeClass = binding.Scheme;
-
- if (exchangeClass == null)
- {
- url = ExchangeNameDefaults.DIRECT_EXCHANGE_CLASS + "://" + ExchangeNameDefaults.DIRECT + "//" + url;
- Parse();
-
- return;
- }
- else
- {
- this.exchangeClass = exchangeClass;
- }
-
- // Extract the host name, this contains the exchange name. It is defaulted to the default direct exchange if not specified.
- string exchangeName = binding.Host;
-
- if (exchangeName == null)
- {
- if (exchangeClass.Equals(ExchangeNameDefaults.DIRECT_EXCHANGE_CLASS))
- {
- this.exchangeName = "";
- }
- }
- else
- {
- this.exchangeName = exchangeName;
- }
-
- // Extract the destination and queue name.
- if ((binding.AbsolutePath == null) || binding.AbsolutePath.Equals(""))
- {
- throw new UriFormatException("Destination or Queue required");
- }
- else
- {
- int slashOffset = binding.AbsolutePath.IndexOf("/", 1);
- if (slashOffset == -1)
- {
- throw new UriFormatException("Destination required");
- }
- else
- {
- String path = binding.AbsolutePath;
-
- this.destination = path.Substring(1, slashOffset - 1);
- this.queueName = path.Substring(slashOffset + 1);
- }
- }
-
- ParseOptions(options, binding.Query);
-
- // If the routing key is not set as an option, set it to the destination name.
- if (!ContainsOption(OPTION_ROUTING_KEY))
- {
- options[OPTION_ROUTING_KEY] = destination;
- }
- }
-
- /// <summary>
- /// options looks like this
- /// brokerlist='tcp://host:port?option='value',option='value';vm://:3/virtualpath?option='value'',failover='method?option='value',option='value'
- /// </summary>
- public static void ParseOptions(IDictionary optionMap, string options)
- {
- // Check that there really are some options to parse.
- if ((options == null) || (options.IndexOf('=') == -1))
- {
- return;
- }
-
- int optionIndex = options.IndexOf('=');
- string option = options.Substring(0, optionIndex);
- int length = options.Length;
- int nestedQuotes = 0;
-
- // Holds the index of the final "'".
- int valueIndex = optionIndex;
-
- // Loop over all the options.Dest
- while ((nestedQuotes > 0) || (valueIndex < length))
- {
- valueIndex++;
-
- if (valueIndex >= length)
- {
- break;
- }
-
- if (options[valueIndex] == '\'')
- {
- if ((valueIndex + 1) < options.Length)
- {
- if ((options[valueIndex + 1] == '&') ||
- (options[valueIndex + 1] == ',') ||
- (options[valueIndex + 1] == ';') ||
- (options[valueIndex + 1] == '\''))
- {
- nestedQuotes--;
-
- if (nestedQuotes == 0)
- {
- // We've found the value of an option
- break;
- }
- }
- else
- {
- nestedQuotes++;
- }
- }
- else
- {
- // We are at the end of the string
- // Check to see if we are corectly closing quotes
- if (options[valueIndex] == '\'')
- {
- nestedQuotes--;
- }
-
- break;
- }
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/IMessageFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/IMessageFactory.cs
deleted file mode 100644
index bed379290f..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/IMessageFactory.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.Collections;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Message
-{
- public interface IMessageFactory
- {
- /// <summary>
- /// Create a message
- /// </summary>
- /// <param name="deliverTag">Delivery Tag</param>
- /// <param name="messageNbr">Message Sequence Number</param>
- /// <param name="redelivered">True if this is a redelivered message</param>
- /// <param name="contentHeader">Content headers</param>
- /// <param name="bodies">Message bodies</param>
- /// <returns>The new message</returns>
- /// <exception cref="QpidMessagingException">if the message cannot be created</exception>
- AbstractQmsMessage CreateMessage(long deliverTag, bool redelivered,
- ContentHeaderBody contentHeader,
- IList bodies);
-
- /// <summary>
- /// Creates the message.
- /// </summary>
- /// <param name="mimeType">Mime type to associate the new message with</param>
- /// <returns>The new message</returns>
- /// <exception cref="QpidMessagingException">if the message cannot be created</exception>
- AbstractQmsMessage CreateMessage(string mimeType);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/MessageFactoryRegistry.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/MessageFactoryRegistry.cs
deleted file mode 100644
index fdb5e14aa6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/MessageFactoryRegistry.cs
+++ /dev/null
@@ -1,129 +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;
-using System.Collections;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.Message
-{
- public class MessageFactoryRegistry
- {
- private readonly Hashtable _mimeToFactoryMap = new Hashtable();
- private IMessageFactory _defaultFactory;
-
- /// <summary>
- /// Default factory to use for unknown message types
- /// </summary>
- public IMessageFactory DefaultFactory
- {
- get { return _defaultFactory; }
- set { _defaultFactory = value; }
- }
-
- /// <summary>
- /// Register a new message factory for a MIME type
- /// </summary>
- /// <param name="mimeType">Mime type to register</param>
- /// <param name="mf"></param>
- public void RegisterFactory(string mimeType, IMessageFactory mf)
- {
- if ( mf == null )
- throw new ArgumentNullException("mf");
- if ( mimeType == null || mimeType.Length == 0 )
- throw new ArgumentNullException("mimeType");
-
- _mimeToFactoryMap[mimeType] = mf;
- }
-
- /// <summary>
- /// Remove a message factory
- /// </summary>
- /// <param name="mimeType">MIME type to unregister</param>
- public void DeregisterFactory(string mimeType)
- {
- _mimeToFactoryMap.Remove(mimeType);
- }
-
- /// <summary>
- /// Create a message. This looks up the MIME type from the content header and instantiates the appropriate
- /// concrete message type.
- /// </summary>
- /// <param name="messageNbr">the AMQ message id</param>
- /// <param name="redelivered">true if redelivered</param>
- /// <param name="contentHeader">the content header that was received</param>
- /// <param name="bodies">a list of ContentBody instances</param>
- /// <returns>the message.</returns>
- /// <exception cref="AMQException"/>
- /// <exception cref="QpidException"/>
- public AbstractQmsMessage CreateMessage(long messageNbr, bool redelivered,
- ContentHeaderBody contentHeader,
- IList bodies)
- {
- BasicContentHeaderProperties properties = (BasicContentHeaderProperties)contentHeader.Properties;
-
- if ( properties.ContentType == null )
- {
- properties.ContentType = "";
- }
-
- IMessageFactory mf = GetFactory(properties.ContentType);
- return mf.CreateMessage(messageNbr, redelivered, contentHeader, bodies);
- }
-
- /// <summary>
- /// Create a new message of the specified type
- /// </summary>
- /// <param name="mimeType">The Mime type</param>
- /// <returns>The new message</returns>
- public AbstractQmsMessage CreateMessage(string mimeType)
- {
- if ( mimeType == null || mimeType.Length == 0 )
- throw new ArgumentNullException("mimeType");
-
- IMessageFactory mf = GetFactory(mimeType);
- return mf.CreateMessage(mimeType);
- }
-
- /// <summary>
- /// Construct a new registry with the default message factories registered
- /// </summary>
- /// <returns>a message factory registry</returns>
- public static MessageFactoryRegistry NewDefaultRegistry()
- {
- MessageFactoryRegistry mf = new MessageFactoryRegistry();
- mf.RegisterFactory("text/plain", new QpidTextMessageFactory());
- mf.RegisterFactory("text/xml", new QpidTextMessageFactory());
- mf.RegisterFactory("application/octet-stream", new QpidBytesMessageFactory());
-
- mf.DefaultFactory = new QpidBytesMessageFactory();
- return mf;
- }
-
- private IMessageFactory GetFactory(string mimeType)
- {
- IMessageFactory mf = (IMessageFactory)_mimeToFactoryMap[mimeType];
- return mf != null ? mf : _defaultFactory;
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs
deleted file mode 100644
index fb3efb1b0f..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.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.
- *
- */
-using System;
-using System.IO;
-using System.Runtime.Serialization;
-using System.Text;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Client.Message
-{
- [Serializable]
- class MessageEOFException : QpidException
- {
- public MessageEOFException(string message) : base(message)
- {
- }
-
- protected MessageEOFException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-
- public class QpidBytesMessage : AbstractQmsMessage, IBytesMessage
- {
- private const int DEFAULT_BUFFER_INITIAL_SIZE = 1024;
-
- public QpidBytesMessage() : this(null)
- {
- }
-
- /// <summary>
- /// Construct a bytes message with existing data.
- /// </summary>
- /// <param name="data">if data is not null, the message is immediately in read only mode. if data is null, it is in
- /// write-only mode</param>
- QpidBytesMessage(ByteBuffer data) : base(data)
- {
- // superclass constructor has instantiated a content header at this point
- if (data == null)
- {
- _data = ByteBuffer.Allocate(DEFAULT_BUFFER_INITIAL_SIZE);
- _data.IsAutoExpand = true;
- }
- }
-
- internal QpidBytesMessage(long messageNbr, ContentHeaderBody contentHeader, ByteBuffer data)
- // TODO: this casting is ugly. Need to review whole ContentHeaderBody idea
- : base(messageNbr, (BasicContentHeaderProperties)contentHeader.Properties, data)
- {
- }
-
- public override void ClearBodyImpl()
- {
- _data.Clear();
- }
-
- public override string ToBodyString()
- {
- CheckReadable();
- try
- {
- return GetText();
- }
- catch (IOException e)
- {
- throw new QpidException(e.ToString());
- }
- }
-
- private String GetText()
- {
- // this will use the default platform encoding
- if (_data == null)
- {
- return null;
- }
- int pos = _data.Position;
- _data.Rewind();
- // one byte left is for the end of frame marker
- if (_data.Remaining == 0)
- {
- // this is really redundant since pos must be zero
- _data.Position = pos;
- return null;
- }
- else
- {
- byte[] data = new byte[_data.Remaining];
- _data.GetBytes(data);
- return Encoding.UTF8.GetString(data);
- }
- }
-
- public long BodyLength
- {
- get
- {
- CheckReadable();
- return _data.Limit;
- }
- }
-
- private void CheckWritable()
- {
- if (_readableMessage)
- {
- throw new MessageNotWriteableException("You need to call clearBody() to make the message writable");
- }
- }
-
- public bool ReadBoolean()
- {
- CheckReadable();
- CheckAvailable(1);
- return _data.GetByte() != 0;
- }
-
- public byte ReadByte()
- {
- CheckReadable();
- CheckAvailable(1);
- return _data.GetByte();
- }
-
- public short ReadSignedByte()
- {
- CheckReadable();
- CheckAvailable(1);
- return _data.GetSByte();
- }
-
- public short ReadShort()
- {
- CheckReadable();
- CheckAvailable(2);
- return _data.GetInt16();
- }
-
- public char ReadChar()
- {
- CheckReadable();
- CheckAvailable(2);
- return _data.GetChar();
- }
-
- public int ReadInt()
- {
- CheckReadable();
- CheckAvailable(4);
- return _data.GetInt32();
- }
-
- public long ReadLong()
- {
- CheckReadable();
- CheckAvailable(8);
- return _data.GetInt64();
- }
-
- public float ReadFloat()
- {
- CheckReadable();
- CheckAvailable(4);
- return _data.GetFloat();
- }
-
- public double ReadDouble()
- {
- CheckReadable();
- CheckAvailable(8);
- return _data.GetDouble();
- }
-
- public string ReadUTF()
- {
- CheckReadable();
- // we check only for one byte since theoretically the string could be only a
- // single byte when using UTF-8 encoding
- CheckAvailable(1);
- try
- {
- byte[] data = new byte[_data.Remaining];
- _data.GetBytes(data);
- return Encoding.UTF8.GetString(data);
- }
- catch (IOException e)
- {
- throw new QpidException(e.ToString(), e);
- }
- }
-
- public int ReadBytes(byte[] bytes)
- {
- if (bytes == null)
- {
- throw new ArgumentNullException("bytes");
- }
- CheckReadable();
- int count = (_data.Remaining >= bytes.Length ? bytes.Length : _data.Remaining);
- if (count == 0)
- {
- return -1;
- }
- else
- {
- _data.GetBytes(bytes, 0, count);
- return count;
- }
- }
-
- public int ReadBytes(byte[] bytes, int maxLength)
- {
- if (bytes == null)
- {
- throw new ArgumentNullException("bytes");
- }
- if (maxLength > bytes.Length)
- {
- throw new ArgumentOutOfRangeException("maxLength must be >= 0");
- }
- CheckReadable();
- int count = (_data.Remaining >= maxLength ? maxLength : _data.Remaining);
- if (count == 0)
- {
- return -1;
- }
- else
- {
- _data.GetBytes(bytes, 0, count);
- return count;
- }
- }
-
- public void WriteBoolean(bool b)
- {
- CheckWritable();
- _data.Put(b ? (byte)1 : (byte)0);
- }
-
- public void WriteByte(byte b)
- {
- CheckWritable();
- _data.Put(b);
- }
-
- public void WriteShort(short i)
- {
- CheckWritable();
- _data.Put(i);
- }
-
- public void WriteChar(char c)
- {
- CheckWritable();
- _data.Put(c);
- }
-
- public void WriteSignedByte(short value)
- {
- CheckWritable();
- _data.Put(value);
- }
-
- public void WriteDouble(double value)
- {
- CheckWritable();
- _data.Put(value);
- }
-
- public void WriteFloat(float value)
- {
- CheckWritable();
- _data.Put(value);
- }
-
- public void WriteInt(int value)
- {
- CheckWritable();
- _data.Put(value);
- }
-
- public void WriteLong(long value)
- {
- CheckWritable();
- _data.Put(value);
- }
-
- public void WriteUTF(string value)
- {
- CheckWritable();
- byte[] encodedData = Encoding.UTF8.GetBytes(value);
- _data.Put(encodedData);
- }
-
- public void WriteBytes(byte[] bytes)
- {
- CheckWritable();
- _data.Put(bytes);
- }
-
- public void WriteBytes(byte[] bytes, int offset, int length)
- {
- CheckWritable();
- _data.Put(bytes, offset, length);
- }
-
- protected override void Reset()
- {
- base.Reset();
- _data.Flip();
- }
-
- void IBytesMessage.Reset()
- {
- Reset();
- }
-
- /**
- * Check that there is at least a certain number of bytes available to read
- *
- * @param len the number of bytes
- * @throws MessageEOFException if there are less than len bytes available to read
- */
- private void CheckAvailable(int len)
- {
- if (_data.Remaining < len)
- {
- throw new MessageEOFException("Unable to read " + len + " bytes");
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessageFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessageFactory.cs
deleted file mode 100644
index 3cc96cbddc..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidBytesMessageFactory.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.
- *
- */
-using System;
-using System.Collections;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Client.Message
-{
- public class QpidBytesMessageFactory : AbstractQmsMessageFactory
- {
- //protected override AbstractQmsMessage CreateMessageWithBody(long messageNbr,
- // ContentHeaderBody contentHeader,
- // IList bodies)
- //{
- // byte[] data;
-
- // // we optimise the non-fragmented case to avoid copying
- // if (bodies != null && bodies.Count == 1)
- // {
- // data = ((ContentBody)bodies[0]).Payload;
- // }
- // else
- // {
- // data = new byte[(long)contentHeader.BodySize];
- // int currentPosition = 0;
- // foreach (ContentBody cb in bodies)
- // {
- // Array.Copy(cb.Payload, 0, data, currentPosition, cb.Payload.Length);
- // currentPosition += cb.Payload.Length;
- // }
- // }
-
- // return new QpidBytesMessage(messageNbr, data, contentHeader);
- //}
-
- //public override AbstractQmsMessage CreateMessage()
- //{
- // return new QpidBytesMessage();
- //}
-
- protected override AbstractQmsMessage CreateMessage(long deliveryTag, ByteBuffer data, ContentHeaderBody contentHeader)
- {
- return new QpidBytesMessage(deliveryTag, contentHeader, data);
- }
-
- public override AbstractQmsMessage CreateMessage(string mimeType)
- {
- QpidBytesMessage msg = new QpidBytesMessage();
- msg.ContentType = mimeType;
- return msg;
- }
-
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs
deleted file mode 100644
index 9ad1c26867..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs
+++ /dev/null
@@ -1,233 +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;
-using System.Collections;
-using System.Text;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.Message
-{
- internal class QpidHeaders : IHeaders
- {
- private FieldTable _headers;
-
- public QpidHeaders(FieldTable headers)
- {
- if ( headers == null )
- throw new ArgumentNullException("headers");
- _headers = headers;
- }
-
- public bool Contains(string name)
- {
- CheckPropertyName(name);
- return _headers.Contains(name);
- }
-
- public void Clear()
- {
- _headers.Clear();
- }
-
- public object this[string name]
- {
- get { return GetObject(name); }
- set { SetObject(name, value); }
- }
-
- public bool GetBoolean(string name)
- {
- CheckPropertyName(name);
- if ( Contains(name) )
- return _headers.GetBoolean(name);
- return false;
- }
-
- public void SetBoolean(string name, bool b)
- {
- CheckPropertyName(name);
- _headers.SetBoolean(name, b);
- }
-
- public byte GetByte(string propertyName)
- {
- CheckPropertyName(propertyName);
- if ( Contains(propertyName) )
- return _headers.GetByte(propertyName);
- return 0;
- }
-
- public void SetByte(string propertyName, byte b)
- {
- CheckPropertyName(propertyName);
- _headers.SetByte(propertyName, b);
- }
-
- // we have sbyte overloads to interoperate with java
- // because the Java client/server uses signed bytes
- // by default, while C#'s is unsigned
- public sbyte GetSByte(string propertyName)
- {
- CheckPropertyName(propertyName);
- if ( Contains(propertyName) )
- return _headers.GetSByte(propertyName);
- return 0;
- }
-
- public void SetSByte(string propertyName, sbyte b)
- {
- CheckPropertyName(propertyName);
- _headers.SetSByte(propertyName, b);
- }
-
- public short GetShort(string propertyName)
- {
- CheckPropertyName(propertyName);
- if ( Contains(propertyName) )
- return _headers.GetInt16(propertyName);
- return 0;
- }
-
- public void SetShort(string propertyName, short i)
- {
- CheckPropertyName(propertyName);
- _headers.SetInt16(propertyName, i);
- }
-
- public int GetInt(string propertyName)
- {
- CheckPropertyName(propertyName);
- if ( Contains(propertyName) )
- return _headers.GetInt32(propertyName);
- return 0;
- }
-
- public void SetInt(string propertyName, int i)
- {
- CheckPropertyName(propertyName);
- _headers.SetInt32(propertyName, i);
- }
-
- public long GetLong(string propertyName)
- {
- CheckPropertyName(propertyName);
- if ( Contains(propertyName) )
- return _headers.GetInt64(propertyName);
- return 0;
- }
-
- public void SetLong(string propertyName, long l)
- {
- CheckPropertyName(propertyName);
- _headers.SetInt64(propertyName, l);
- }
-
- public float GetFloat(String propertyName)
- {
- CheckPropertyName(propertyName);
- if ( Contains(propertyName) )
- return _headers.GetFloat(propertyName);
- return 0f;
- }
-
- public void SetFloat(string propertyName, float f)
- {
- CheckPropertyName(propertyName);
- _headers.SetFloat(propertyName, f);
- }
-
- public double GetDouble(string propertyName)
- {
- CheckPropertyName(propertyName);
- if ( Contains(propertyName) )
- return _headers.GetDouble(propertyName);
- return 0;
- }
-
- public void SetDouble(string propertyName, double v)
- {
- CheckPropertyName(propertyName);
- _headers.SetDouble(propertyName, v);
- }
-
- public string GetString(string propertyName)
- {
- CheckPropertyName(propertyName);
- return _headers.GetString(propertyName);
- }
-
- public void SetString(string propertyName, string value)
- {
- CheckPropertyName(propertyName);
- _headers.SetString(propertyName, value);
- }
-
- public object GetObject(string propertyName)
- {
- CheckPropertyName(propertyName);
- return _headers[propertyName];
- }
-
- public void SetObject(string propertyName, object value)
- {
- CheckPropertyName(propertyName);
- _headers[propertyName] = value;
- }
-
- private static void CheckPropertyName(string propertyName)
- {
- if ( propertyName == null )
- {
- throw new ArgumentException("Property name must not be null");
- } else if ( "".Equals(propertyName) )
- {
- throw new ArgumentException("Property name must not be the empty string");
- }
- }
-
- public override string ToString()
- {
- StringBuilder buf = new StringBuilder("{");
- int i = 0;
- foreach ( DictionaryEntry entry in _headers )
- {
- ++i;
- if ( i > 1 )
- {
- buf.Append(", ");
- }
- string propertyName = (string)entry.Key;
- if ( propertyName == null )
- {
- buf.Append("\nInternal error: Property with NULL key defined");
- } else
- {
- buf.Append(propertyName);
- buf.Append(" = ").Append(entry.Value);
- }
- }
- buf.Append("}");
- return buf.ToString();
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessage.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessage.cs
deleted file mode 100644
index 24aef92aa5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessage.cs
+++ /dev/null
@@ -1,115 +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;
-using System.Text;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Client.Message
-{
- public class QpidTextMessage : AbstractQmsMessage, ITextMessage
- {
- private string _decodedValue = null;
- private static Encoding DEFAULT_ENCODING = Encoding.UTF8;
-
- internal QpidTextMessage() : this(null, null)
- {
- ContentEncoding = DEFAULT_ENCODING.BodyName;
- }
-
- internal QpidTextMessage(ByteBuffer data, String encoding) : base(data)
- {
- ContentEncoding = encoding;
- }
-
- internal QpidTextMessage(long deliveryTag, BasicContentHeaderProperties contentHeader, ByteBuffer data)
- :base(deliveryTag, contentHeader, data)
- {
- }
-
- public override void ClearBodyImpl()
- {
- if (_data != null)
- {
- _data.Release();
- }
- _data = null;
- _decodedValue = null;
- }
-
- public override string ToBodyString()
- {
- return Text;
- }
-
- public string Text
- {
- get
- {
- if (_data == null && _decodedValue == null)
- {
- return null;
- }
- else if (_decodedValue != null)
- {
- return _decodedValue;
- }
- else
- {
- _data.Rewind();
-
- // Read remaining bytes.
- byte[] bytes = new byte[_data.Remaining];
- _data.GetBytes(bytes);
-
- // Convert to string based on encoding.
- if (ContentHeaderProperties.Encoding != null)
- {
- // throw ArgumentException if the encoding is not supported
- _decodedValue = Encoding.GetEncoding(ContentHeaderProperties.Encoding).GetString(bytes);
- }
- else
- {
- _decodedValue = DEFAULT_ENCODING.GetString(bytes);
- }
- return _decodedValue;
- }
- }
-
- set
- {
- byte[] bytes;
- if (ContentHeaderProperties.Encoding == null)
- {
- bytes = Encoding.Default.GetBytes(value);
- }
- else
- {
- // throw ArgumentException if the encoding is not supported
- bytes = Encoding.GetEncoding(ContentHeaderProperties.Encoding).GetBytes(value);
- }
- _data = ByteBuffer.Wrap(bytes);
- _decodedValue = value;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs
deleted file mode 100644
index 79871e85ca..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs
+++ /dev/null
@@ -1,40 +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 Apache.Qpid.Buffer;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Message
-{
- public class QpidTextMessageFactory : AbstractQmsMessageFactory
- {
- public override AbstractQmsMessage CreateMessage(string mimeType)
- {
- QpidTextMessage msg = new QpidTextMessage();
- msg.ContentType = mimeType;
- return msg;
- }
-
- protected override AbstractQmsMessage CreateMessage(long deliveryTag, ByteBuffer data, ContentHeaderBody contentHeader)
- {
- return new QpidTextMessage(deliveryTag, (BasicContentHeaderProperties) contentHeader.Properties, data);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs
deleted file mode 100644
index 4317ef3474..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.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.
- *
- */
-using System;
-using System.Runtime.Serialization;
-using log4net;
-
-namespace Apache.Qpid.Client.Message
-{
- /// <summary>
- /// Raised when a message body is received unexpectedly by the client. This typically occurs when the
- /// length of bodies received does not match with the declared length in the content header.
- /// </summary>
- [Serializable]
- public class UnexpectedBodyReceivedException : AMQException
- {
- public UnexpectedBodyReceivedException(ILog logger, string msg, Exception t)
- : base(logger, msg, t)
- {
- }
-
- public UnexpectedBodyReceivedException(ILog logger, string msg)
- : base(logger, msg)
- {
- }
-
- public UnexpectedBodyReceivedException(ILog logger, int errorCode, string msg)
- : base(logger, errorCode, msg)
- {
- }
-
- protected UnexpectedBodyReceivedException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/UnprocessedMessage.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/UnprocessedMessage.cs
deleted file mode 100644
index d329712334..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Message/UnprocessedMessage.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.
- *
- */
-using System.Collections;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Message
-{
- public class UnprocessedMessage
- {
- private ulong _bytesReceived = 0;
-
- public BasicDeliverBody DeliverBody;
- public BasicReturnBody BounceBody;
- public ushort ChannelId;
- public ContentHeaderBody ContentHeader;
-
- /// <summary>
- /// List of ContentBody instances. Due to fragmentation you don't know how big this will be in general
- /// </summary>
- /// TODO: write and use linked list class
- public IList Bodies = new ArrayList();
-
- public void ReceiveBody(ContentBody body)
- {
- Bodies.Add(body);
- if (body.Payload != null)
- {
- _bytesReceived += (uint)body.Payload.Remaining;
- }
- }
-
- public bool IsAllBodyDataReceived()
- {
- return _bytesReceived == ContentHeader.BodySize;
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQMethodEvent.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQMethodEvent.cs
deleted file mode 100644
index a7ce808862..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQMethodEvent.cs
+++ /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.
- *
- */
-using System;
-using System.Text;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Protocol
-{
- public class AMQMethodEvent
- {
- private AMQMethodBody _method;
-
- private ushort _channelId;
-
- private AMQProtocolSession _protocolSession;
-
- public AMQMethodEvent(ushort channelId, AMQMethodBody method, AMQProtocolSession protocolSession)
- {
- _channelId = channelId;
- _method = method;
- _protocolSession = protocolSession;
- }
-
- public AMQMethodBody Method
- {
- get
- {
- return _method;
- }
- }
-
- public ushort ChannelId
- {
- get
- {
- return _channelId;
- }
- }
-
- public AMQProtocolSession ProtocolSession
- {
- get
- {
- return _protocolSession;
- }
- }
-
- public override String ToString()
- {
- StringBuilder buf = new StringBuilder("Method event: ");
- buf.Append("\nChannel id: ").Append(_channelId);
- buf.Append("\nMethod: ").Append(_method);
- return buf.ToString();
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs
deleted file mode 100644
index c51538b70e..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs
+++ /dev/null
@@ -1,318 +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;
-using System.Collections;
-using System.Threading;
-using log4net;
-using Apache.Qpid.Client.Failover;
-using Apache.Qpid.Client.Protocol.Listener;
-using Apache.Qpid.Client.State;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Protocol
-{
- /// <summary>
- /// AMQProtocolListener
- ///
- /// <p/>Fail-over state transition rules...
- ///
- /// <p/>The failover handler is created when the session is created since it needs a reference to the IoSession in order
- /// to be able to send errors during failover back to the client application. The session won't be available in the case
- /// when failing over due to a Connection.Redirect message from the broker.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Track fail over state of a connection.
- /// <tr><td> Manage method listeners. <td> IAMQMethodListener
- /// <tr><td> Receive notification of all IO errors on a connection. <td> IoHandler
- /// <tr><td> Inform method listeners of all method events on a connection. <td> IAMQMethodListener
- /// <tr><td> Inform method listeners of all error events on a connection. <td> IAMQMethodListener
- /// </table>
- ///
- /// <b>Todo:</b> The broker will close the connection with no warning if authentication fails. This may result in the fail-over process being
- /// triggered, when it should not be.
- ///
- /// </summary>
- public class AMQProtocolListener : IProtocolListener
- {
- /// <summary>Used for debugging.</summary>
- private static readonly ILog _log = LogManager.GetLogger(typeof(AMQProtocolListener));
-
- /// <summary>
- /// Holds the failover handler for the connection. When a failure is detected, and the current failover state allows it,
- /// the failover process is handed off to this handler.
- /// </summary>
- private FailoverHandler _failoverHandler;
-
- /// <summary>Tracks the current fail-over state.</summary>
- internal FailoverState _failoverState = FailoverState.NOT_STARTED;
-
- internal FailoverState FailoverState
- {
- get { return _failoverState; }
- set { _failoverState = value; }
- }
-
- internal ManualResetEvent FailoverLatch;
-
- AMQConnection _connection;
- AMQStateManager _stateManager;
-
- public AMQStateManager StateManager
- {
- get { return _stateManager; }
- set { _stateManager = value; }
- }
-
- private readonly ArrayList _frameListeners = ArrayList.Synchronized(new ArrayList());
-
- AMQProtocolSession _protocolSession = null;
-
- private readonly Object _lock = new Object();
-
- public AMQProtocolSession ProtocolSession { set { _protocolSession = value; } }
-
- public AMQProtocolListener(AMQConnection connection, AMQStateManager stateManager)
- {
- _connection = connection;
- _stateManager = stateManager;
- _failoverHandler = new FailoverHandler(connection);
- }
-
- public void OnMessage(IDataBlock message)
- {
- // Handle incorrect protocol version.
- if (message is ProtocolInitiation)
- {
- string error = String.Format("Protocol mismatch - {0}", message.ToString());
- AMQException e = new AMQProtocolHeaderException(error);
- _log.Error("Closing connection because of protocol mismatch", e);
- //_protocolSession.CloseProtocolSession();
- _stateManager.Error(e);
- return;
- }
-
- AMQFrame frame = (AMQFrame)message;
-
- if (frame.BodyFrame is AMQMethodBody)
- {
- if (_log.IsDebugEnabled)
- {
- _log.Debug("Method frame received: " + frame);
- }
- AMQMethodEvent evt = new AMQMethodEvent(frame.Channel, (AMQMethodBody)frame.BodyFrame, _protocolSession);
- try
- {
- bool wasAnyoneInterested = false;
- lock (_frameListeners.SyncRoot)
- {
- foreach (IAMQMethodListener listener in _frameListeners)
- {
- wasAnyoneInterested = listener.MethodReceived(evt) || wasAnyoneInterested;
- }
- }
- if (!wasAnyoneInterested)
- {
- throw new AMQException("AMQMethodEvent " + evt + " was not processed by any listener.");
- }
- }
- catch (Exception e)
- {
- foreach (IAMQMethodListener listener in _frameListeners)
- {
- listener.Error(e);
- }
- }
- }
- else if (frame.BodyFrame is ContentHeaderBody)
- {
- _protocolSession.MessageContentHeaderReceived(frame.Channel,
- (ContentHeaderBody)frame.BodyFrame);
- }
- else if (frame.BodyFrame is ContentBody)
- {
- _protocolSession.MessageContentBodyReceived(frame.Channel,
- (ContentBody)frame.BodyFrame);
- }
- else if (frame.BodyFrame is HeartbeatBody)
- {
- _log.Debug("HeartBeat received");
- }
- }
-
- /// <summary>
- /// Receives notification of any IO exceptions on the connection.
- ///
- /// <p/>Upon receipt of a connection closed exception or any IOException, the fail-over process is attempted. If the fail-over fails, then
- /// all method listeners and the application connection object are notified of the connection failure exception.
- ///
- /// <p/>All other exception types are propagated to all method listeners.
- /// </summary>
- public void OnException(Exception cause)
- {
- _log.Warn("public void OnException(Exception cause = " + cause + "): called");
-
- // Ensure that the method listener set cannot be changed whilst this exception is propagated to all listeners. This also
- // ensures that this exception is fully propagated to all listeners, before another one can be processed.
- lock (_lock)
- {
- if (cause is AMQConnectionClosedException || cause is System.IO.IOException)
- {
- // Try a fail-over because the connection has failed.
- FailoverState failoverState = AttemptFailover();
-
- // Check if the fail-over has failed, in which case notify all method listeners of the exception.
- // The application connection object is also notified of the failure of the connection with the exception.
- if (failoverState == FailoverState.FAILED)
- {
- _log.Debug("Fail-over has failed. Notifying all method listeners of the exception.");
-
- AMQException amqe = new AMQException("Protocol handler error: " + cause, cause);
- PropagateExceptionToWaiters(amqe);
- _connection.ExceptionReceived(cause);
- }
- }
- // Notify all method listeners of the exception.
- else
- {
- PropagateExceptionToWaiters(cause);
- _connection.ExceptionReceived(cause);
- }
- }
- }
-
- /// <summary>
- /// Tries to fail-over the connection, if the connection policy will permit it, and the fail-over process has not yet been
- /// started. If the connection does not allow fail-over then an exception will be raised. If a fail-over is already in progress
- /// this method allows it to continue to run and will do nothing.
- ///
- /// <p/>This method should only be called when the connection has been remotely closed.
- /// </summary>
- ///
- /// <returns>The fail-over state at the end of this attempt.</returns>
- private FailoverState AttemptFailover()
- {
- _log.Debug("private void AttemptFailover(): called");
- _log.Debug("_failoverState = " + _failoverState);
-
- // Ensure that the connection stops sending heart beats, if it still is.
- _connection.StopHeartBeatThread();
-
- // Check that the connection policy allows fail-over to be attempted.
- if (!_connection.IsFailoverAllowed)
- {
- _log.Debug("Connection does not allowed to failover");
- _connection.ExceptionReceived(
- new AMQDisconnectedException("Broker closed connection and reconnection is not permitted."));
- }
-
- // Check if connection was closed deliberately by the application, in which case no fail-over is attempted.
- if (_connection.Closed)
- {
- return _failoverState;
- }
-
- // If the connection allows fail-over and fail-over has not yet been started, then it is started and the fail-over state is
- // advanced to 'in progress'
- if (_failoverState == FailoverState.NOT_STARTED && _connection.IsFailoverAllowed)
- {
- _log.Info("Starting the fail-over process.");
-
- _failoverState = FailoverState.IN_PROGRESS;
- StartFailoverThread();
- }
-
- return _failoverState;
- }
-
- /// <summary>
- /// There are two cases where we have other threads potentially blocking for events to be handled by this
- /// class. These are for the state manager (waiting for a state change) or a frame listener (waiting for a
- /// particular type of frame to arrive). When an error occurs we need to notify these waiters so that they can
- /// react appropriately.
- ///
- /// <param name="e">the exception to propagate</param>
- /// </summary>
- public void PropagateExceptionToWaiters(Exception e)
- {
- // FIXME: not sure if required as StateManager is in _frameListeners. Probably something to do with fail-over.
- _stateManager.Error(e);
- lock ( _lock )
- {
- foreach ( IAMQMethodListener listener in _frameListeners )
- {
- listener.Error(e);
- }
- }
- }
-
- public void AddFrameListener(IAMQMethodListener listener)
- {
- lock ( _lock )
- {
- _frameListeners.Add(listener);
- }
- }
-
- public void RemoveFrameListener(IAMQMethodListener listener)
- {
- if (_log.IsDebugEnabled)
- {
- _log.Debug("Removing frame listener: " + listener.ToString());
- }
- lock ( _lock )
- {
- _frameListeners.Remove(listener);
- }
- }
-
- public void BlockUntilNotFailingOver()
- {
- if (FailoverLatch != null)
- {
- FailoverLatch.WaitOne();
- }
- }
-
- /// <summary>
- /// "Failover" for redirection.
- /// </summary>
- /// <param name="host"></param>
- /// <param name="port"></param>
- public void Failover(string host, int port)
- {
- _failoverHandler.setHost(host);
- _failoverHandler.setPort(port);
- // see javadoc for FailoverHandler to see rationale for separate thread
- StartFailoverThread();
- }
-
- private void StartFailoverThread()
- {
- Thread failoverThread = new Thread(new ThreadStart(_failoverHandler.Run));
- failoverThread.Name = "Failover";
- // Do not inherit daemon-ness from current thread as this can be a daemon
- // thread such as a AnonymousIoService thread.
- failoverThread.IsBackground = false;
- failoverThread.Start();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs
deleted file mode 100644
index 1fb3d407eb..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs
+++ /dev/null
@@ -1,267 +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;
-using System.Collections;
-using log4net;
-using Apache.Qpid.Client.Message;
-using Apache.Qpid.Client.Transport;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Sasl;
-
-namespace Apache.Qpid.Client.Protocol
-{
- public class AMQProtocolSession
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(AMQProtocolSession));
-
- private readonly IProtocolWriter _protocolWriter;
- private readonly IConnectionCloser _connectionCloser;
-
- /// <summary>
- /// Maps from the channel id to the AmqChannel that it represents.
- /// </summary>
- //private ConcurrentMap _channelId2SessionMap = new ConcurrentHashMap();
- private Hashtable _channelId2SessionMap = Hashtable.Synchronized(new Hashtable());
-
- //private ConcurrentMap _closingChannels = new ConcurrentHashMap();
- private Hashtable _closingChannels = Hashtable.Synchronized(new Hashtable());
-
- /// <summary>
- /// Maps from a channel id to an unprocessed message. This is used to tie together the
- /// JmsDeliverBody (which arrives first) with the subsequent content header and content bodies.
- /// </summary>
- //private ConcurrentMap _channelId2UnprocessedMsgMap = new ConcurrentHashMap();
- private Hashtable _channelId2UnprocessedMsgMap = Hashtable.Synchronized(new Hashtable());
-
- private AMQConnection _connection;
-
- public string ClientID { get { return _connection.ClientID; } }
-
- public AMQProtocolSession(IProtocolWriter protocolWriter, IConnectionCloser connectionCloser, AMQConnection connection)
- {
- _protocolWriter = protocolWriter;
- _connectionCloser = connectionCloser;
- _connection = connection;
- }
-
- public void Init()
- {
- // start the process of setting up the connection. This is the first place that
- // data is written to the server.
- _protocolWriter.Write(new ProtocolInitiation());
- }
-
- public string Username
- {
- get
- {
- return AMQConnection.Username;
- }
- }
-
- public string Password
- {
- get
- {
- return AMQConnection.Password;
- }
- }
-
- ConnectionTuneParameters _connectionTuneParameters; // TODO: should be able to have this in the Java too.
-
- public ConnectionTuneParameters ConnectionTuneParameters
- {
- get
- {
- return _connectionTuneParameters;
- }
- set
- {
- _connectionTuneParameters = value;
- AMQConnection con = AMQConnection;
- con.SetMaximumChannelCount(value.ChannelMax);
- con.MaximumFrameSize = value.FrameMax;
- }
- }
-
- private ISaslClient _saslClient;
- public ISaslClient SaslClient
- {
- get { return _saslClient; }
- set { _saslClient = value; }
- }
-
- /// <summary>
- /// Callback invoked from the BasicDeliverMethodHandler when a message has been received.
- /// This is invoked on the MINA dispatcher thread.
- /// </summary>
- /// <param name="message">the unprocessed message</param>
- /// <exception cname="AMQException">if this was not expected</exception>
- public void UnprocessedMessageReceived(UnprocessedMessage message)
- {
- _channelId2UnprocessedMsgMap[message.ChannelId] = message;
- }
-
- public void MessageContentHeaderReceived(ushort channelId, ContentHeaderBody contentHeader)
- {
- UnprocessedMessage msg = (UnprocessedMessage) _channelId2UnprocessedMsgMap[channelId];
- if (msg == null)
- {
- throw new AMQException("Error: received content header without having received a JMSDeliver frame first");
- }
- if (msg.ContentHeader != null)
- {
- throw new AMQException("Error: received duplicate content header or did not receive correct number of content body frames");
- }
- msg.ContentHeader = contentHeader;
- if (contentHeader.BodySize == 0)
- {
- DeliverMessageToAMQSession(channelId, msg);
- }
- }
-
- public void MessageContentBodyReceived(ushort channelId, ContentBody contentBody)
- {
- UnprocessedMessage msg = (UnprocessedMessage) _channelId2UnprocessedMsgMap[channelId];
- if (msg == null)
- {
- throw new AMQException("Error: received content body without having received a BasicDeliver frame first");
- }
- if (msg.ContentHeader == null)
- {
- _channelId2UnprocessedMsgMap.Remove(channelId);
- throw new AMQException("Error: received content body without having received a ContentHeader frame first");
- }
- try
- {
- msg.ReceiveBody(contentBody);
- }
- catch (UnexpectedBodyReceivedException e)
- {
- _channelId2UnprocessedMsgMap.Remove(channelId);
- throw e;
- }
- if (msg.IsAllBodyDataReceived())
- {
- DeliverMessageToAMQSession(channelId, msg);
- }
- }
-
- /// <summary>
- /// Deliver a message to the appropriate session, removing the unprocessed message
- /// from our map
- /// <param name="channelId">the channel id the message should be delivered to</param>
- /// <param name="msg"> the message</param>
- private void DeliverMessageToAMQSession(ushort channelId, UnprocessedMessage msg)
- {
- AmqChannel channel = (AmqChannel) _channelId2SessionMap[channelId];
- channel.MessageReceived(msg);
- _channelId2UnprocessedMsgMap.Remove(channelId);
- }
-
- /// <summary>
- /// Convenience method that writes a frame to the protocol session. Equivalent
- /// to calling getProtocolSession().write().
- /// </summary>
- /// <param name="frame">the frame to write</param>
- public void WriteFrame(IDataBlock frame)
- {
- _protocolWriter.Write(frame);
- }
-
- public void AddSessionByChannel(ushort channelId, AmqChannel channel)
- {
- if (channel == null)
- {
- throw new ArgumentNullException("Attempt to register a null channel");
- }
- _logger.Debug("Add channel with channel id " + channelId);
- _channelId2SessionMap[channelId] = channel;
- }
-
- public void RemoveSessionByChannel(ushort channelId)
- {
- _logger.Debug("Removing session with channelId " + channelId);
- _channelId2SessionMap.Remove(channelId);
- }
-
- /// <summary>
- /// Starts the process of closing a channel
- /// </summary>
- /// <param name="channel" the AmqChannel being closed</param>
- public void CloseSession(AmqChannel channel)
- {
- _logger.Debug("closeSession called on protocol channel for channel " + channel.ChannelId);
- ushort channelId = channel.ChannelId;
-
- // we need to know when a channel is closing so that we can respond
- // with a channel.close frame when we receive any other type of frame
- // on that channel
- _closingChannels[channelId] = channel;
-
- }
-
- /// <summary>
- /// Called from the ChannelClose handler when a channel close frame is received.
- /// This method decides whether this is a response or an initiation. The latter
- /// case causes the AmqChannel to be closed and an exception to be thrown if
- /// appropriate.
- /// </summary>
- /// <param name="channelId">the id of the channel (session)</param>
- /// <returns>true if the client must respond to the server, i.e. if the server
- /// initiated the channel close, false if the channel close is just the server
- /// responding to the client's earlier request to close the channel.</returns>
- public bool ChannelClosed(ushort channelId, int code, string text)
- {
- // if this is not a response to an earlier request to close the channel
- if (!_closingChannels.ContainsKey(channelId))
- {
- _closingChannels.Remove(channelId);
- AmqChannel channel = (AmqChannel) _channelId2SessionMap[channelId];
- channel.ClosedWithException(new AMQException(_logger, code, text));
- return true;
- }
- else
- {
- return false;
- }
- }
-
- public AMQConnection AMQConnection
- {
- get
- {
- return _connection;
- }
- }
-
- public void CloseProtocolSession()
- {
- _logger.Debug("Closing protocol session");
- _connectionCloser.Close();
- }
-
- internal string GenerateQueueName()
- {
- return "ntmp_" + System.Guid.NewGuid();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/DefaultTimeouts.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/DefaultTimeouts.cs
deleted file mode 100644
index 6841b46f54..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/DefaultTimeouts.cs
+++ /dev/null
@@ -1,47 +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;
-using System.Text;
-
-namespace Apache.Qpid.Client.Protocol
-{
- /// <summary>
- /// Default timeout values for the protocol
- /// </summary>
- sealed class DefaultTimeouts
- {
- /// <summary>
- /// Maximum number of milliseconds to wait for a state change
- /// in the protocol's state machine
- /// </summary>
- public const int MaxWaitForState = 30* 1000;
- /// <summary>
- /// Maximum number of milliseconds to wait for a reply
- /// frame when doing synchronous writer to the broker
- /// </summary>
- public const int MaxWaitForSyncWriter = 30 * 1000;
-
- private DefaultTimeouts()
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/IConnectionCloser.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/IConnectionCloser.cs
deleted file mode 100644
index e3298200c4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/IConnectionCloser.cs
+++ /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.
- *
- */
-namespace Apache.Qpid.Client.Protocol
-{
- public interface IConnectionCloser
- {
- void Close();
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/IProtocolListener.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/IProtocolListener.cs
deleted file mode 100644
index 3b53f015f8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/IProtocolListener.cs
+++ /dev/null
@@ -1,36 +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;
-using Apache.Qpid.Client.Protocol.Listener;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Protocol
-{
- public interface IProtocolListener
- {
- void OnMessage(IDataBlock message);
- void OnException(Exception e);
-
- // XXX: .NET way of doing listeners?
- void AddFrameListener(IAMQMethodListener listener);
- void RemoveFrameListener(IAMQMethodListener listener);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/BlockingMethodFrameListener.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/BlockingMethodFrameListener.cs
deleted file mode 100644
index 9cc9f8cee5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/BlockingMethodFrameListener.cs
+++ /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.
- *
- */
-using System;
-using System.Threading;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Protocol.Listener
-{
- public abstract class BlockingMethodFrameListener : IAMQMethodListener
- {
- private ManualResetEvent _resetEvent;
-
- public abstract bool ProcessMethod(ushort channelId, AMQMethodBody frame);
-
- /// <summary>
- /// This is set if there is an exception thrown from processCommandFrame and the
- /// exception is rethrown to the caller of blockForFrame()
- /// </summary>
- private volatile Exception _error;
-
- protected ushort _channelId;
-
- protected AMQMethodEvent _doneEvt = null;
-
- public BlockingMethodFrameListener(ushort channelId)
- {
- _channelId = channelId;
- _resetEvent = new ManualResetEvent(false);
- }
-
- /// <summary>
- /// This method is called by the MINA dispatching thread. Note that it could
- /// be called before BlockForFrame() has been called.
- /// </summary>
- /// <param name="evt">the frame event</param>
- /// <returns>true if the listener has dealt with this frame</returns>
- /// <exception cref="AMQException"></exception>
- public bool MethodReceived(AMQMethodEvent evt)
- {
- AMQMethodBody method = evt.Method;
-
- try
- {
- bool ready = (evt.ChannelId == _channelId) && ProcessMethod(evt.ChannelId, method);
- if (ready)
- {
- _doneEvt = evt;
- _resetEvent.Set();
- }
-
- return ready;
- }
- catch (AMQException e)
- {
- Error(e);
- // we rethrow the error here, and the code in the frame dispatcher will go round
- // each listener informing them that an exception has been thrown
- throw e;
- }
- }
-
- /// <summary>
- /// This method is called by the thread that wants to wait for a frame.
- /// </summary>
- /// <param name="timeout">Set the number of milliseconds to wait</param>
- public AMQMethodEvent BlockForFrame(int timeout)
- {
- _resetEvent.WaitOne(timeout, true);
- //at this point the event will have been signalled. The error field might or might not be set
- // depending on whether an error occurred
- if (_error != null)
- {
- throw _error;
- }
-
- return _doneEvt;
- }
-
- /// <summary>
- /// This is a callback, called by the MINA dispatcher thread only. It is also called from within this
- /// class to avoid code repetition but again is only called by the MINA dispatcher thread.
- /// </summary>
- /// <param name="e">the exception that caused the error</param>
- public void Error(Exception e)
- {
- // set the error so that the thread that is blocking (in BlockForFrame())
- // can pick up the exception and rethrow to the caller
- _error = e;
- _resetEvent.Set();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/IAMQMethodListener.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/IAMQMethodListener.cs
deleted file mode 100644
index b5450d00f7..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/IAMQMethodListener.cs
+++ /dev/null
@@ -1,46 +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;
-
-namespace Apache.Qpid.Client.Protocol.Listener
-{
- public interface IAMQMethodListener
- {
- /// <summary>
- /// Invoked when a method frame has been received
- /// <param name="evt">the event</param>
- /// <returns>true if the handler has processed the method frame, false otherwise. Note
- /// that this does not prohibit the method event being delivered to subsequent listeners
- /// but can be used to determine if nobody has dealt with an incoming method frame.</param>
- /// <exception cname="AMQException">if an error has occurred. This exception will be delivered
- /// to all registered listeners using the error() method (see below) allowing them to
- /// perform cleanup if necessary.</exception>
- bool MethodReceived(AMQMethodEvent evt);
-
- /// <summary>
- /// Callback when an error has occurred. Allows listeners to clean up.
- /// </summary>
- /// <param name="e">the exception</param>
- void Error(Exception e);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/SpecificMethodFrameListener.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/SpecificMethodFrameListener.cs
deleted file mode 100644
index 8cdc1dbba9..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/Listener/SpecificMethodFrameListener.cs
+++ /dev/null
@@ -1,42 +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;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Protocol.Listener
-{
- public class SpecificMethodFrameListener : BlockingMethodFrameListener
- {
- private readonly Type _expectedClass;
-
- public SpecificMethodFrameListener(ushort channelId, Type expectedClass) : base(channelId)
- {
- _expectedClass = expectedClass;
- }
-
- public override bool ProcessMethod(ushort channelId, AMQMethodBody frame)
- {
- return _expectedClass.IsInstanceOfType(frame);
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/ProtocolWriter.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/ProtocolWriter.cs
deleted file mode 100644
index 11918f1ea2..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Protocol/ProtocolWriter.cs
+++ /dev/null
@@ -1,107 +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;
-using Apache.Qpid.Client.Protocol.Listener;
-using Apache.Qpid.Client.Transport;
-using Apache.Qpid.Framing;
-
-using log4net;
-
-namespace Apache.Qpid.Client.Protocol
-{
- /// <summary>
- /// A convenient interface to writing protocol frames.
- /// </summary>
- public class ProtocolWriter
- {
-
- private ILog _logger = LogManager.GetLogger(typeof(ProtocolWriter));
-
- IProtocolWriter _protocolWriter;
- IProtocolListener _protocolListener;
-
- public ProtocolWriter(IProtocolWriter protocolWriter, IProtocolListener protocolListener)
- {
- _protocolWriter = protocolWriter;
- _protocolListener = protocolListener;
- }
-
- public void WriteFrame(IDataBlock frame)
- {
- _protocolWriter.Write(frame);
- }
-
- /// <summary>
- /// Convenience method that writes a frame to the protocol session and waits for
- /// a particular response. Equivalent to calling getProtocolSession().write() then
- /// waiting for the response.
- /// </summary>
- /// <param name="frame">the frame</param>
- /// <param name="listener">the blocking listener. Note the calling thread will block.</param>
- /// <param name="timeout">set the number of milliseconds to wait</param>
- private AMQMethodEvent SyncWrite(AMQFrame frame, BlockingMethodFrameListener listener, int timeout)
- {
- try
- {
- _protocolListener.AddFrameListener(listener);
- _protocolWriter.Write(frame);
-
- return listener.BlockForFrame(timeout);
- }
- finally
- {
- _protocolListener.RemoveFrameListener(listener);
- }
- // When control resumes before this line, a reply will have been received
- // that matches the criteria defined in the blocking listener
- }
-
- /// <summary>
- /// Convenience method that writes a frame to the protocol session and waits for
- /// a particular response. Equivalent to calling getProtocolSession().write() then
- /// waiting for the response.
- /// </summary>
- /// <param name="frame">the frame</param>
- /// <param name="responseType">the type of method response</param>
- public AMQMethodEvent SyncWrite(AMQFrame frame, Type responseType)
- {
- // TODO: If each frame knew it's response type, then the responseType argument would
- // TODO: not be neccesary.
- return SyncWrite(frame, responseType, DefaultTimeouts.MaxWaitForSyncWriter);
- }
-
- /// <summary>
- /// Convenience method that writes a frame to the protocol session and waits for
- /// a particular response. Equivalent to calling getProtocolSession().write() then
- /// waiting for the response.
- /// </summary>
- /// <param name="frame">the frame</param>
- /// <param name="responseType">the type of method response</param>
- /// <param name="timeout">set the number of milliseconds to wait</param>
- /// <returns>set the number of milliseconds to wait</returns>
- public AMQMethodEvent SyncWrite(AMQFrame frame, Type responseType, int timeout)
- {
- return SyncWrite(frame, new SpecificMethodFrameListener(frame.Channel, responseType), timeout);
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/QpidConnectionInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/QpidConnectionInfo.cs
deleted file mode 100644
index ede8966f37..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/QpidConnectionInfo.cs
+++ /dev/null
@@ -1,504 +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;
-using System.Collections;
-using System.Net;
-using System.Text;
-using System.Text.RegularExpressions;
-using log4net;
-using Apache.Qpid.Client.Qms;
-
-namespace Apache.Qpid.Client
-{
-
- public class URLHelper
- {
- public static char DEFAULT_OPTION_SEPERATOR = '&';
- public static char ALTERNATIVE_OPTION_SEPARATOR = ',';
- public static char BROKER_SEPARATOR = ';';
-
- /// <summary>
- ///
- /// </summary>
- /// <param name="optionMap"></param>
- /// <param name="options"></param>
- public static void parseOptions(IDictionary optionMap, string options)
- {
- //options looks like this
- //brokerlist='tcp://host:port?option='value',option='value';vm://:3/virtualpath?option='value'',failover='method?option='value',option='value''
-
- if (options == null || options.IndexOf('=') == -1)
- {
- return;
- }
-
- int optionIndex = options.IndexOf('=');
-
- String option = options.Substring(0, optionIndex);
-
- int length = options.Length;
-
- int nestedQuotes = 0;
-
- // to store index of final "'"
- int valueIndex = optionIndex;
-
- //Walk remainder of url.
- while (nestedQuotes > 0 || valueIndex < length)
- {
- valueIndex++;
-
- if (valueIndex >= length)
- {
- break;
- }
-
- if (options[valueIndex] == '\'')
- {
- if (valueIndex + 1 < options.Length)
- {
- if (options[valueIndex + 1] == DEFAULT_OPTION_SEPERATOR ||
- options[valueIndex + 1] == ALTERNATIVE_OPTION_SEPARATOR ||
- options[valueIndex + 1] == BROKER_SEPARATOR ||
- options[valueIndex + 1] == '\'')
- {
- nestedQuotes--;
- // System.out.println(
- // options + "\n" + "-" + nestedQuotes + ":" + getPositionString(valueIndex - 2, 1));
- if (nestedQuotes == 0)
- {
- //We've found the value of an option
- break;
- }
- }
- else
- {
- nestedQuotes++;
- // System.out.println(
- // options + "\n" + "+" + nestedQuotes + ":" + getPositionString(valueIndex - 2, 1));
- }
- }
- else
- {
- // We are at the end of the string
- // Check to see if we are corectly closing quotes
- if (options[valueIndex] == '\'')
- {
- nestedQuotes--;
- }
-
- break;
- }
- }
- }
-
- if (nestedQuotes != 0 || valueIndex < (optionIndex + 2))
- {
- int sepIndex = 0;
-
- //Try and identify illegal separator character
- if (nestedQuotes > 1)
- {
- for (int i = 0; i < nestedQuotes; i++)
- {
- sepIndex = options.IndexOf('\'', sepIndex);
- sepIndex++;
- }
- }
-
- if (sepIndex >= options.Length || sepIndex == 0)
- {
- parseError(valueIndex, "Unterminated option", options);
- }
- else
- {
- parseError(sepIndex, "Unterminated option. Possible illegal option separator:'" +
- options[sepIndex] + "'", options);
- }
- }
-
- // optionIndex +2 to skip "='"
- int sublen = valueIndex - (optionIndex + 2);
- String value = options.Substring(optionIndex + 2, sublen);
-
- optionMap.Add(option, value);
-
- if (valueIndex < (options.Length - 1))
- {
- //Recurse to get remaining options
- parseOptions(optionMap, options.Substring(valueIndex + 2));
- }
- }
-
-
- public static void parseError(int index, String error, String url)
- {
- parseError(index, 1, error, url);
- }
-
- public static void parseError(int index, int length, String error, String url)
- {
- throw new UrlSyntaxException(url, error, index, length);
- }
-
- public static String printOptions(Hashtable options)
- {
- if (options.Count == 0)
- {
- return "";
- }
- else
- {
- StringBuilder sb = new StringBuilder();
- sb.Append('?');
- foreach (String key in options.Keys)
- {
- sb.AppendFormat("{0}='{1}'{2}", key, options[key], DEFAULT_OPTION_SEPERATOR);
- }
-
- sb.Remove(sb.Length - 1, 1);
- return sb.ToString();
- }
- }
-
- }
-
- public class QpidConnectionUrl
- {
- internal static IConnectionInfo FromUrl(string fullURL)
- {
- //_url = fullURL;
- IConnectionInfo connectionInfo = new QpidConnectionInfo();
-
-
- // _options = new HashMap<String, String>();
- // _brokers = new LinkedList();
- // _failoverOptions = new HashMap<String, String>();
-
- // Connection URL format
- //amqp://[user:pass@][clientid]/virtualhost?brokerlist='tcp://host:port?option=\'value\',option=\'value\';vm://:3/virtualpath?option=\'value\'',failover='method?option=\'value\',option='value''"
- // Options are of course optional except for requiring a single broker in the broker list.
- try
- {
- Uri connection = new Uri(fullURL);
-
- if (connection.Scheme == null || !(connection.Scheme.Equals(ConnectionUrlConstants.AMQ_PROTOCOL)))
- {
- throw new UrlSyntaxException(fullURL, "Not an AMQP URL");
- }
-
- if (connection.Host != null && connection.Host.Length > 0 && !connection.Host.Equals("default"))
- {
- connectionInfo.ClientName = connection.Host;
- }
-
- String userInfo = connection.UserInfo;
- if (userInfo == null || userInfo.Length == 0)
- {
- URLHelper.parseError(ConnectionUrlConstants.AMQ_PROTOCOL.Length + 3,
- "User information not found on url", fullURL);
- }
- else
- {
- parseUserInfo(userInfo, fullURL, connectionInfo);
- }
- String virtualHost = connection.AbsolutePath; // XXX: is AbsolutePath corrrect?
-
- if (virtualHost != null && virtualHost.Length > 0)
- {
- connectionInfo.VirtualHost = virtualHost;
- }
- else
- {
- int authLength = connection.Authority.Length;
- int start = ConnectionUrlConstants.AMQ_PROTOCOL.Length + 3;
- int testIndex = start + authLength;
- if (testIndex < fullURL.Length && fullURL[testIndex] == '?')
- {
- URLHelper.parseError(start, testIndex - start, "Virtual host found", fullURL);
- }
- else
- {
- URLHelper.parseError(-1, "Virtual host not specified", fullURL);
- }
-
- }
-
- QpidConnectionInfo qci = (QpidConnectionInfo)connectionInfo;
- string query = connection.Query;
- if (query[0] == '?') query = query.Substring(1);
- URLHelper.parseOptions(qci.GetOptions(), query);
-
- processOptions(connectionInfo);
-
- //Fragment is #string (not used)
- //System.out.println(connection.getFragment());
- return connectionInfo;
- }
- catch (UriFormatException uris)
- {
- throw uris;
- // if (uris is UrlSyntaxException)
- // {
- // throw uris;
- // }
- //
- // int slash = fullURL.IndexOf("\\");
- //
- // if (slash == -1)
- // {
- // URLHelper.parseError(uris.GetIndex(), uris.getReason(), uris.getInput());
- // }
- // else
- // {
- // if (slash != 0 && fullURL.charAt(slash - 1) == ':')
- // {
- // URLHelper.parseError(slash - 2, fullURL.indexOf('?') - slash + 2, "Virtual host looks like a windows path, forward slash not allowed in URL", fullURL);
- // }
- // else
- // {
- // URLHelper.parseError(slash, "Forward slash not allowed in URL", fullURL);
- // }
- // }
- }
- }
-
- private static void parseUserInfo(String userinfo, string fullUrl, IConnectionInfo connectionInfo)
- {
- //user info = user:pass
-
- int colonIndex = userinfo.IndexOf(':');
-
- if (colonIndex == -1)
- {
- URLHelper.parseError(ConnectionUrlConstants.AMQ_PROTOCOL.Length + 3,
- userinfo.Length, "Null password in user information not allowed.", fullUrl);
- }
- else
- {
- connectionInfo.Username = userinfo.Substring(0, colonIndex);
- connectionInfo.Password = userinfo.Substring(colonIndex + 1);
- }
- }
-
- private static void processOptions(IConnectionInfo connectionInfo)
- {
- string brokerlist = connectionInfo.GetOption(ConnectionUrlConstants.OPTIONS_BROKERLIST);
- if (brokerlist != null)
- {
- //brokerlist tcp://host:port?option='value',option='value';vm://:3/virtualpath?option='value'
- Regex splitter = new Regex("" + URLHelper.BROKER_SEPARATOR);
-
- foreach (string broker in splitter.Split(brokerlist))
- {
- connectionInfo.AddBrokerInfo(new AmqBrokerInfo(broker));
- }
-
- connectionInfo.SetOption(ConnectionUrlConstants.OPTIONS_BROKERLIST, null);
- // _options.remove(OPTIONS_BROKERLIST);
- }
-
- string failover = connectionInfo.GetOption(ConnectionUrlConstants.OPTIONS_FAILOVER);
- if (failover != null)
- {
- // failover='method?option='value',option='value''
-
- int methodIndex = failover.IndexOf('?');
-
- if (methodIndex > -1)
- {
- connectionInfo.FailoverMethod = failover.Substring(0, methodIndex);
- QpidConnectionInfo qpidConnectionInfo = (QpidConnectionInfo)connectionInfo;
- URLHelper.parseOptions(qpidConnectionInfo.GetFailoverOptions(),
- failover.Substring(methodIndex + 1));
- }
- else
- {
- connectionInfo.FailoverMethod = failover;
- }
-
- connectionInfo.SetOption(ConnectionUrlConstants.OPTIONS_FAILOVER, null);
- // _options.remove(OPTIONS_FAILOVER);
- }
- }
-
- internal static IConnectionInfo FromUri(Uri uri)
- {
- return null; // FIXME
-
- }
- }
-
- public class QpidConnectionInfo : IConnectionInfo
- {
- const string DEFAULT_VHOST = "/";
- string _username = "guest";
- string _password = "guest";
- string _virtualHost = DEFAULT_VHOST;
-
- string _failoverMethod = null;
- IDictionary _failoverOptions = new Hashtable();
- IDictionary _options = new Hashtable();
- IList _brokerInfos = new ArrayList(); // List<BrokerInfo>
- string _clientName = String.Format("{0}{1:G}", Dns.GetHostName(), DateTime.Now.Ticks);
-
- public IDictionary GetFailoverOptions()
- {
- return _failoverOptions;
- }
-
- public IDictionary GetOptions()
- {
- return _options;
- }
-
- public static IConnectionInfo FromUrl(String url)
- {
- return QpidConnectionUrl.FromUrl(url);
- }
-
- public string AsUrl()
- {
- StringBuilder sb = new StringBuilder();
- sb.AppendFormat("{0}://", ConnectionUrlConstants.AMQ_PROTOCOL);
-
- if (_username != null)
- {
- sb.Append(_username);
- if (_password != null)
- {
- sb.AppendFormat(":{0}", _password);
- }
- sb.Append("@");
- }
-
- sb.Append(_clientName);
- sb.Append(_virtualHost);
- sb.Append(OptionsToString());
-
- return sb.ToString();
- }
-
- private String OptionsToString()
- {
- StringBuilder sb = new StringBuilder();
- sb.AppendFormat("?{0}='", ConnectionUrlConstants.OPTIONS_BROKERLIST);
-
- foreach (IBrokerInfo broker in _brokerInfos)
- {
- sb.AppendFormat("{0};", broker);
- }
-
- sb.Remove(sb.Length - 1, 1);
- sb.Append("'");
-
- if (_failoverMethod != null)
- {
- sb.AppendFormat("{0}{1}='{2}{3}'", URLHelper.DEFAULT_OPTION_SEPERATOR,
- ConnectionUrlConstants.OPTIONS_FAILOVER,
- _failoverMethod,
- URLHelper.printOptions((Hashtable)_failoverOptions));
- }
-
- return sb.ToString();
- }
-
-
- public string FailoverMethod
- {
- get { return _failoverMethod; }
- set { _failoverMethod = value; }
- }
-
- public string GetFailoverOption(string key)
- {
- return (string)_failoverOptions[key];
- }
-
- public int BrokerCount
- {
- get { return _brokerInfos.Count; }
- }
-
- public IBrokerInfo GetBrokerInfo(int index)
- {
- return (IBrokerInfo)_brokerInfos[index];
- }
-
- public void AddBrokerInfo(IBrokerInfo brokerInfo)
- {
- if (!_brokerInfos.Contains(brokerInfo))
- {
- _brokerInfos.Add(brokerInfo);
- }
- }
-
- public IList GetAllBrokerInfos()
- {
- return _brokerInfos;
- }
-
- public string ClientName
- {
- get { return _clientName; }
- set { _clientName = value; }
- }
-
- public string Username
- {
- get { return _username; }
- set { _username = value; }
- }
-
- public string Password
- {
- get { return _password; }
- set { _password = value; }
- }
-
- public string VirtualHost
- {
- get { return _virtualHost; }
- set {
- _virtualHost = value;
- if ( _virtualHost == null || _virtualHost.Length == 0 )
- _virtualHost = DEFAULT_VHOST;
- if ( _virtualHost[0] != '/' )
- _virtualHost = '/' + _virtualHost;
- }
- }
-
- public string GetOption(string key)
- {
- return (string)_options[key];
- }
-
- public void SetOption(string key, string value)
- {
- _options[key] = value;
- }
-
- public override string ToString()
- {
- return AsUrl();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/CallbackHandlerRegistry.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/CallbackHandlerRegistry.cs
deleted file mode 100644
index 85be927ff4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/CallbackHandlerRegistry.cs
+++ /dev/null
@@ -1,127 +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;
-using System.Collections;
-using System.Configuration;
-using System.Text;
-using Apache.Qpid.Sasl;
-using Apache.Qpid.Sasl.Mechanisms;
-
-using Apache.Qpid.Client.Configuration;
-
-namespace Apache.Qpid.Client.Security
-{
-
- /// <summary>
- /// Helper class to map SASL mechanisms to our
- /// internal ISaslCallbackHandler implementations.
- /// </summary>
- /// <remarks>
- /// The set of configured callback handlers and their order
- /// controls the selection of the SASL mechanism used for authentication.
- /// <para>
- /// You can either replace the default handler for CRAM-MD5 and PLAIN
- /// authentication (the two default options) using the application
- /// configuration file. Configuration is done by especifying the SASL
- /// mechanism name (e.g PLAIN) and the type implementing the callback handler
- /// used to provide any data required by the mechanism like username and password.
- /// </para>
- /// <para>
- /// Callback handler types should implement the IAMQCallbackHandler interface.
- /// </para>
- /// <para>
- /// New callbacks or authentication mechanisms can be configured like this:
- /// </para>
- /// <example><![CDATA[
- /// <configuration>
- /// <configSections>
- /// <sectionGroup name="qpid.client">
- /// <section name="authentication" type="Apache.Qpid.Client.Configuration.AuthenticationConfigurationSectionHandler, Apache.Qpid.Client"/>
- /// </sectionGroup>
- /// </configSections>
- /// <qpid.client>
- /// <authentication>
- /// <add key="TEST" value="Apache.Qpid.Client.Tests.Security.TestCallbackHandler, Apache.Qpid.Client.Tests"/>
- /// </authentication>
- /// </qpid.client>
- /// </configuration>
- /// ]]></example>
- /// </remarks>
- public sealed class CallbackHandlerRegistry
- {
- private static CallbackHandlerRegistry _instance =
- new CallbackHandlerRegistry();
- private OrderedHashTable _mechanism2HandlerMap;
- private string[] _mechanisms;
-
- public static CallbackHandlerRegistry Instance
- {
- get { return _instance; }
- }
-
- public string[] Mechanisms
- {
- get { return _mechanisms; }
- }
-
- private CallbackHandlerRegistry()
- {
- _mechanism2HandlerMap = (OrderedHashTable)
- ConfigurationSettings.GetConfig("qpid.client/authentication");
-
- // configure default options if not available
- if ( _mechanism2HandlerMap == null )
- _mechanism2HandlerMap = new OrderedHashTable();
-
- if ( !_mechanism2HandlerMap.Contains(ExternalSaslClient.Mechanism) )
- _mechanism2HandlerMap.Add(ExternalSaslClient.Mechanism, typeof(UsernamePasswordCallbackHandler));
- if ( !_mechanism2HandlerMap.Contains(CramMD5SaslClient.Mechanism) )
- _mechanism2HandlerMap.Add(CramMD5SaslClient.Mechanism, typeof(UsernamePasswordCallbackHandler));
- if ( !_mechanism2HandlerMap.Contains(PlainSaslClient.Mechanism) )
- _mechanism2HandlerMap.Add(PlainSaslClient.Mechanism, typeof(UsernamePasswordCallbackHandler));
-
- _mechanisms = new string[_mechanism2HandlerMap.Count];
- _mechanism2HandlerMap.OrderedKeys.CopyTo(_mechanisms, 0);
- }
-
- public bool IsSupportedMechanism(string mechanism)
- {
- return _mechanism2HandlerMap.Contains(mechanism);
- }
-
- public string ChooseMechanism(string mechanisms)
- {
- IList mechs = mechanisms.Split(' ');
- foreach ( string supportedMech in _mechanisms )
- {
- if ( mechs.Contains(supportedMech) )
- return supportedMech;
- }
- return null;
- }
-
- public Type GetCallbackHandler(string mechanism)
- {
- return (Type)_mechanism2HandlerMap[mechanism];
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/IAMQCallbackHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/IAMQCallbackHandler.cs
deleted file mode 100644
index 2560c1d96b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/IAMQCallbackHandler.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.
- *
- */
-using System;
-using System.Text;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Sasl;
-
-namespace Apache.Qpid.Client.Security
-{
- public interface IAMQCallbackHandler : ISaslCallbackHandler
- {
- void Initialize(AMQProtocolSession session);
- }
-
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/UsernamePasswordCallbackHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/UsernamePasswordCallbackHandler.cs
deleted file mode 100644
index 489d4d1665..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Security/UsernamePasswordCallbackHandler.cs
+++ /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.
- *
- */
-
-using System;
-using System.Collections;
-using System.Text;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Sasl;
-
-namespace Apache.Qpid.Client.Security
-{
- internal class UsernamePasswordCallbackHandler : IAMQCallbackHandler
- {
- private AMQProtocolSession _session;
-
- public void Initialize(AMQProtocolSession session)
- {
- if ( session == null )
- throw new ArgumentNullException("session");
-
- _session = session;
- }
-
- public void Handle(ISaslCallback[] callbacks)
- {
- foreach ( ISaslCallback cb in callbacks )
- {
- if ( cb is NameCallback )
- {
- ((NameCallback)cb).Text = _session.Username;
- } else if ( cb is PasswordCallback )
- {
- ((PasswordCallback)cb).Text = _session.Password;
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/SslOptions.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/SslOptions.cs
deleted file mode 100644
index d637101000..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/SslOptions.cs
+++ /dev/null
@@ -1,81 +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;
-using System.Security.Cryptography.X509Certificates;
-
-namespace Apache.Qpid.Client
-{
- /// <summary>
- /// Configures SSL-related options to connect to an AMQP broker.
- /// </summary>
- /// <remarks>
- /// If the server certificate is not trusted by the client,
- /// connection will fail. However, you can set the
- /// <see cref="IgnoreValidationErrors"/> property to true
- /// to ignore any certificate verification errors for debugging purposes.
- /// </remarks>
- public class SslOptions
- {
- private X509Certificate _clientCertificate;
- private bool _ignoreValidationErrors;
-
- /// <summary>
- /// Certificate to present to the broker to authenticate
- /// this client connection
- /// </summary>
- public X509Certificate ClientCertificate
- {
- get { return _clientCertificate; }
- }
-
- /// <summary>
- /// If true, the validity of the broker certificate
- /// will not be verified on connection
- /// </summary>
- public bool IgnoreValidationErrors
- {
- get { return _ignoreValidationErrors; }
- }
-
- /// <summary>
- /// Initialize a new instance with default values
- /// (No client certificate, don't ignore validation errors)
- /// </summary>
- public SslOptions()
- {
- }
-
- /// <summary>
- /// Initialize a new instance
- /// </summary>
- /// <param name="clientCertificate">
- /// Certificate to use to authenticate the client to the broker
- /// </param>
- /// <param name="ignoreValidationErrors">
- /// If true, ignore any validation errors when validating the server certificate
- /// </param>
- public SslOptions(X509Certificate clientCertificate, bool ignoreValidationErrors)
- {
- _clientCertificate = clientCertificate;
- _ignoreValidationErrors = ignoreValidationErrors;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQState.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQState.cs
deleted file mode 100644
index 67f8427fb2..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQState.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.Client.State
-{
- public enum AMQState
- {
- CONNECTION_NOT_STARTED,
- CONNECTION_NOT_TUNED,
- CONNECTION_NOT_OPENED,
- CONNECTION_OPEN,
- CONNECTION_CLOSING,
- CONNECTION_CLOSED,
- ALL // all is a special state used in the state manager. It is not valid to be "in" the state "all".
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQStateChangedEvent.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQStateChangedEvent.cs
deleted file mode 100644
index a464bbb6f5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQStateChangedEvent.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.
- *
- */
-namespace Apache.Qpid.Client.State
-{
- public class AMQStateChangedEvent
- {
- private readonly AMQState _oldState;
-
- private readonly AMQState _newState;
-
- public AMQStateChangedEvent(AMQState oldState, AMQState newState)
- {
- _oldState = oldState;
- _newState = newState;
- }
-
- public AMQState OldState
- {
- get
- {
- return _oldState;
- }
- }
-
- public AMQState NewState
- {
- get
- {
- return _newState;
- }
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQStateManager.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQStateManager.cs
deleted file mode 100644
index 881e01e697..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/AMQStateManager.cs
+++ /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.
- *
- */
-using System;
-using System.Collections;
-using log4net;
-using Apache.Qpid.Client.Handler;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Client.Protocol.Listener;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.State
-{
- public class AMQStateManager : IAMQMethodListener
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(AMQStateManager));
-
- const bool InfoLoggingHack = true;
-
- /// <summary>
- /// The current state
- /// </summary>
- private AMQState _currentState;
-
- /// <summary>
- /// Maps from an AMQState instance to a Map from Class to StateTransitionHandler.
- /// The class must be a subclass of AMQFrame.
- /// </summary>
- private readonly IDictionary _state2HandlersMap;
- private ArrayList _stateListeners;
- private object _syncLock;
-
- public AMQStateManager()
- {
- _syncLock = new object();
- _state2HandlersMap = new Hashtable();
- _stateListeners = ArrayList.Synchronized(new ArrayList(5));
- _currentState = AMQState.CONNECTION_NOT_STARTED;
- RegisterListeners();
- }
-
- private void RegisterListeners()
- {
- IStateAwareMethodListener connectionStart = new ConnectionStartMethodHandler();
- IStateAwareMethodListener connectionClose = new ConnectionCloseMethodHandler();
- IStateAwareMethodListener connectionCloseOk = new ConnectionCloseOkHandler();
- IStateAwareMethodListener connectionTune = new ConnectionTuneMethodHandler();
- IStateAwareMethodListener connectionSecure = new ConnectionSecureMethodHandler();
- IStateAwareMethodListener connectionOpenOk = new ConnectionOpenOkMethodHandler();
- IStateAwareMethodListener channelClose = new ChannelCloseMethodHandler();
- IStateAwareMethodListener basicDeliver = new BasicDeliverMethodHandler();
- IStateAwareMethodListener basicReturn = new BasicReturnMethodHandler();
- IStateAwareMethodListener queueDeleteOk = new QueueDeleteOkMethodHandler();
- IStateAwareMethodListener queuePurgeOk = new QueuePurgeOkMethodHandler();
-
- // We need to register a map for the null (i.e. all state) handlers otherwise you get
- // a stack overflow in the handler searching code when you present it with a frame for which
- // no handlers are registered.
- _state2HandlersMap[AMQState.ALL] = new Hashtable();
-
- {
- Hashtable notStarted = new Hashtable();
- notStarted[typeof(ConnectionStartBody)] = connectionStart;
- notStarted[typeof(ConnectionCloseBody)] = connectionClose;
- _state2HandlersMap[AMQState.CONNECTION_NOT_STARTED] = notStarted;
- }
- {
- Hashtable notTuned = new Hashtable();
- notTuned[typeof(ConnectionTuneBody)] = connectionTune;
- notTuned[typeof(ConnectionSecureBody)] = connectionSecure;
- notTuned[typeof(ConnectionCloseBody)] = connectionClose;
- _state2HandlersMap[AMQState.CONNECTION_NOT_TUNED] = notTuned;
- }
- {
- Hashtable notOpened = new Hashtable();
- notOpened[typeof(ConnectionOpenOkBody)] = connectionOpenOk;
- notOpened[typeof(ConnectionCloseBody)] = connectionClose;
- _state2HandlersMap[AMQState.CONNECTION_NOT_OPENED] = notOpened;
- }
- {
- Hashtable open = new Hashtable();
- open[typeof(ChannelCloseBody)] = channelClose;
- open[typeof(ConnectionCloseBody)] = connectionClose;
- open[typeof(BasicDeliverBody)] = basicDeliver;
- open[typeof(BasicReturnBody)] = basicReturn;
- open[typeof(QueueDeleteOkBody)] = queueDeleteOk;
- open[typeof(QueuePurgeOkBody)] = queuePurgeOk;
- _state2HandlersMap[AMQState.CONNECTION_OPEN] = open;
- }
- {
- Hashtable closing = new Hashtable();
- closing[typeof(ConnectionCloseOkBody)] = connectionCloseOk;
- _state2HandlersMap[AMQState.CONNECTION_CLOSING] = closing;
- }
- }
-
- public AMQState CurrentState
- {
- get
- {
- return _currentState;
- }
- }
-
- /// <summary>
- /// Changes the state.
- /// </summary>
- /// <param name="newState">The new state.</param>
- /// <exception cref="AMQException">if there is an error changing state</exception>
- public void ChangeState(AMQState newState)
- {
- if (InfoLoggingHack)
- {
- _logger.Debug("State changing to " + newState + " from old state " + _currentState);
- }
- _logger.Debug("State changing to " + newState + " from old state " + _currentState);
- AMQState oldState = _currentState;
- _currentState = newState;
-
- lock ( _syncLock )
- {
- foreach ( IStateListener l in _stateListeners )
- {
- l.StateChanged(oldState, newState);
- }
- }
- }
-
- public void Error(Exception e)
- {
- _logger.Debug("State manager receive error notification: " + e);
- lock ( _syncLock )
- {
- foreach ( IStateListener l in _stateListeners )
- {
- l.Error(e);
- }
- }
- }
-
- public bool MethodReceived(AMQMethodEvent evt)
- {
- _logger.Debug(String.Format("Finding method handler. currentState={0} type={1}", _currentState, evt.Method.GetType()));
- IStateAwareMethodListener handler = FindStateTransitionHandler(_currentState, evt.Method);
- if (handler != null)
- {
- handler.MethodReceived(this, evt);
- return true;
- }
- return false;
- }
-
- /// <summary>
- /// Finds the state transition handler.
- /// </summary>
- /// <param name="currentState">State of the current.</param>
- /// <param name="frame">The frame.</param>
- /// <returns></returns>
- /// <exception cref="IllegalStateTransitionException">if the state transition if not allowed</exception>
- private IStateAwareMethodListener FindStateTransitionHandler(AMQState currentState,
- AMQMethodBody frame)
- {
- Type clazz = frame.GetType();
- if (_logger.IsDebugEnabled)
- {
- _logger.Debug("Looking for state transition handler for frame " + clazz);
- }
- IDictionary classToHandlerMap = (IDictionary) _state2HandlersMap[currentState];
-
- if (classToHandlerMap == null)
- {
- // if no specialised per state handler is registered look for a
- // handler registered for "all" states
- return FindStateTransitionHandler(AMQState.ALL, frame);
- }
- IStateAwareMethodListener handler = (IStateAwareMethodListener) classToHandlerMap[clazz];
- if (handler == null)
- {
- if (currentState == AMQState.ALL)
- {
- _logger.Debug("No state transition handler defined for receiving frame " + frame);
- return null;
- }
- else
- {
- // if no specialised per state handler is registered look for a
- // handler registered for "all" states
- return FindStateTransitionHandler(AMQState.ALL, frame);
- }
- }
- else
- {
- return handler;
- }
- }
-
- public void AddStateListener(IStateListener listener)
- {
- _logger.Debug("Adding state listener");
- lock ( _syncLock )
- {
- _stateListeners.Add(listener);
- }
- }
-
- public void RemoveStateListener(IStateListener listener)
- {
- lock ( _syncLock )
- {
- _stateListeners.Remove(listener);
- }
- }
-
- public void AttainState(AMQState s)
- {
- if (_currentState != s)
- {
- StateWaiter sw = null;
- try
- {
- _logger.Debug("Adding state wait to reach state " + s);
- sw = new StateWaiter(s);
- AddStateListener(sw);
- sw.WaituntilStateHasChanged();
- // at this point the state will have changed.
- }
- finally
- {
- RemoveStateListener(sw);
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IAMQStateListener.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IAMQStateListener.cs
deleted file mode 100644
index 31e4b5046d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IAMQStateListener.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.Client.State
-{
- public interface IAMQStateListener
- {
- void StateChanged(AMQStateChangedEvent evt);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IStateAwareMethodListener.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IStateAwareMethodListener.cs
deleted file mode 100644
index 0874f39665..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IStateAwareMethodListener.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.
- *
- */
-using Apache.Qpid.Client.Protocol;
-
-namespace Apache.Qpid.Client.State
-{
- public interface IStateAwareMethodListener
- {
- void MethodReceived(AMQStateManager stateManager, AMQMethodEvent evt);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IStateListener.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IStateListener.cs
deleted file mode 100644
index edd7382f93..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IStateListener.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.
- *
- */
-using System;
-
-namespace Apache.Qpid.Client.State
-{
- public interface IStateListener
- {
- void StateChanged(AMQState oldState, AMQState newState);
-
- void Error(Exception e);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs
deleted file mode 100644
index 81de622617..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs
+++ /dev/null
@@ -1,74 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Client.State
-{
- [Serializable]
- public class IllegalStateTransitionException : AMQException
- {
- private AMQState _originalState;
-
- private Type _frame;
-
- public IllegalStateTransitionException(AMQState originalState, Type frame)
- : base("No valid state transition defined for receiving frame " + frame +
- " from state " + originalState)
- {
- _originalState = originalState;
- _frame = frame;
- }
-
- protected IllegalStateTransitionException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- _originalState = (AMQState)info.GetValue("OriginalState", typeof(AMQState));
- _frame = (Type)info.GetValue("FrameType", typeof(Type));
- }
-
- public AMQState OriginalState
- {
- get
- {
- return _originalState;
- }
- }
-
- public Type FrameType
- {
- get
- {
- return _frame;
- }
- }
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData(info, context);
- info.AddValue("OriginalState", OriginalState);
- info.AddValue("FrameType", FrameType);
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/StateWaiter.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/StateWaiter.cs
deleted file mode 100644
index e739d0cb44..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/State/StateWaiter.cs
+++ /dev/null
@@ -1,121 +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;
-using System.Threading;
-using Apache.Qpid.Client.Protocol;
-using log4net;
-
-namespace Apache.Qpid.Client.State
-{
- public class StateWaiter : IStateListener
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(StateWaiter));
-
- private readonly AMQState _state;
- private AMQState _newState;
-
- private volatile bool _newStateAchieved;
-
- private volatile Exception _exception;
-
- private ManualResetEvent _resetEvent = new ManualResetEvent(false);
-
- public StateWaiter(AMQState state)
- {
- _state = state;
- }
-
- public void StateChanged(AMQState oldState, AMQState newState)
- {
- _newState = newState;
- if (_logger.IsDebugEnabled)
- {
- _logger.Debug("stateChanged called");
- }
- if (_state == newState)
- {
- _newStateAchieved = true;
-
- if (_logger.IsDebugEnabled)
- {
- _logger.Debug("New state reached so notifying monitor");
- }
- _resetEvent.Set();
- }
- }
-
- public void Error(Exception e)
- {
- if (_logger.IsDebugEnabled)
- {
- _logger.Debug("exceptionThrown called");
- }
-
- _exception = e;
- _resetEvent.Set();
- }
-
- public void WaituntilStateHasChanged()
- {
- //
- // The guard is required in case we are woken up by a spurious
- // notify().
- //
-
- TimeSpan waitTime = TimeSpan.FromMilliseconds(DefaultTimeouts.MaxWaitForState);
- DateTime waitUntilTime = DateTime.Now + waitTime;
-
- while ( !_newStateAchieved
- && _exception == null
- && waitTime.TotalMilliseconds > 0 )
- {
- _logger.Debug("State not achieved so waiting...");
- try
- {
- _resetEvent.WaitOne(waitTime, true);
- }
- finally
- {
- if (!_newStateAchieved)
- {
- waitTime = waitUntilTime - DateTime.Now;
- }
- }
- }
-
- if (_exception != null)
- {
- _logger.Debug("Throwable reached state waiter: " + _exception);
- if (_exception is AMQException)
- throw _exception;
- else
- throw new AMQException("Error: " + _exception, _exception);
- }
-
- if (!_newStateAchieved)
- {
- string error = string.Format("State not achieved within permitted time. Current state: {0}, desired state: {1}", _state, _newState);
- _logger.Warn(error);
- throw new AMQException(error);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/AMQProtocolProvider.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/AMQProtocolProvider.cs
deleted file mode 100644
index dd0bb404cb..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/AMQProtocolProvider.cs
+++ /dev/null
@@ -1,47 +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 Apache.Qpid.Codec;
-using Apache.Qpid.Codec.Demux;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Transport
-{
- public class AMQProtocolProvider
- {
- private DemuxingProtocolCodecFactory _factory;
-
- public AMQProtocolProvider()
- {
- _factory = new DemuxingProtocolCodecFactory();
- _factory.Register(new AMQDataBlockEncoder());
- _factory.Register(new AMQDataBlockDecoder());
- _factory.Register(new ProtocolInitiation.Decoder());
- }
-
- public IProtocolCodecFactory CodecFactory
- {
- get
- {
- return _factory;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/AmqpChannel.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/AmqpChannel.cs
deleted file mode 100644
index 1e217e755b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/AmqpChannel.cs
+++ /dev/null
@@ -1,111 +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;
-using System.Collections;
-using log4net;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Codec;
-using Apache.Qpid.Codec.Support;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Transport
-{
- public class AmqpChannel : IProtocolChannel
- {
- // Warning: don't use this log for regular logging.
- static readonly ILog _protocolTraceLog = LogManager.GetLogger("TRACE.Qpid.Client.ProtocolChannel");
-
- IByteChannel _byteChannel;
- IProtocolEncoder _encoder;
- IProtocolDecoder _decoder;
- IProtocolDecoderOutput _decoderOutput;
- private object _syncLock;
-
- public AmqpChannel(IByteChannel byteChannel, IProtocolDecoderOutput decoderOutput)
- {
- _byteChannel = byteChannel;
- _decoderOutput = decoderOutput;
- _syncLock = new object();
-
- AMQProtocolProvider protocolProvider = new AMQProtocolProvider();
- IProtocolCodecFactory factory = protocolProvider.CodecFactory;
- _encoder = factory.Encoder;
- _decoder = factory.Decoder;
- }
-
- public void Read()
- {
- ByteBuffer buffer = _byteChannel.Read();
- Decode(buffer);
- }
-
- public IAsyncResult BeginRead(AsyncCallback callback, object state)
- {
- return _byteChannel.BeginRead(callback, state);
- }
-
- public void EndRead(IAsyncResult result)
- {
- ByteBuffer buffer = _byteChannel.EndRead(result);
- Decode(buffer);
- }
-
- public void Write(IDataBlock o)
- {
- // TODO: Refactor to decorator.
- if (_protocolTraceLog.IsDebugEnabled)
- {
- _protocolTraceLog.Debug(String.Format("WRITE {0}", o));
- }
- // we should be doing an async write, but apparently
- // the mentalis library doesn't queue async read/writes
- // correctly and throws random IOException's. Stay sync for a while
- //_byteChannel.BeginWrite(Encode(o), OnAsyncWriteDone, null);
- _byteChannel.Write(Encode(o));
- }
-
- // not used for now
- //private void OnAsyncWriteDone(IAsyncResult result)
- //{
- // _byteChannel.EndWrite(result);
- //}
-
- private void Decode(ByteBuffer buffer)
- {
- // make sure we don't try to decode more than
- // one buffer at the same time
- lock ( _syncLock )
- {
- _decoder.Decode(buffer, _decoderOutput);
- }
- }
-
- private ByteBuffer Encode(object o)
- {
- SingleProtocolEncoderOutput output = new SingleProtocolEncoderOutput();
- _encoder.Encode(o, output);
- return output.buffer;
- }
-
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IByteChannel.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IByteChannel.cs
deleted file mode 100644
index 35806f2a6e..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IByteChannel.cs
+++ /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.
- *
- */
-using System;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Client.Transport
-{
- /// <summary>
- /// Represents input/output channels that read
- /// and write <see cref="ByteBuffer"/> instances
- /// </summary>
- public interface IByteChannel
- {
- /// <summary>
- /// Read a <see cref="ByteBuffer"/> from the underlying
- /// network stream and any configured filters
- /// </summary>
- /// <returns>A ByteBuffer, if available</returns>
- ByteBuffer Read();
- /// <summary>
- /// Begin an asynchronous read operation
- /// </summary>
- /// <param name="callback">Callback method to call when read operation completes</param>
- /// <param name="state">State object</param>
- /// <returns>An <see cref="System.IAsyncResult"/> object</returns>
- IAsyncResult BeginRead(AsyncCallback callback, object state);
- /// <summary>
- /// End an asynchronous read operation
- /// </summary>
- /// <param name="result">The <see cref="System.IAsyncResult"/> object returned from <see cref="BeginRead"/></param>
- /// <returns>The <see cref="ByteBuffer"/> read</returns>
- ByteBuffer EndRead(IAsyncResult result);
- /// <summary>
- /// Write a <see cref="ByteBuffer"/> to the underlying network
- /// stream, going through any configured filters
- /// </summary>
- /// <param name="buffer"></param>
- void Write(ByteBuffer buffer);
- /// <summary>
- /// Begin an asynchronous write operation
- /// </summary>
- /// <param name="buffer">Buffer to write</param>
- /// <param name="callback">A callback to call when the operation completes</param>
- /// <param name="state">State object</param>
- /// <returns>An <see cref="System.IAsyncResult"/> object</returns>
- IAsyncResult BeginWrite(ByteBuffer buffer, AsyncCallback callback, object state);
- /// <summary>
- /// End an asynchronous write operation
- /// </summary>
- /// <param name="result">The <see cref="System.IAsyncResult"/> object returned by <see cref="BeginWrite"/></param>
- void EndWrite(IAsyncResult result);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolChannel.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolChannel.cs
deleted file mode 100644
index 0b59ee8799..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolChannel.cs
+++ /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.
- *
- */
-using System;
-using System.Collections;
-
-namespace Apache.Qpid.Client.Transport
-{
- public interface IProtocolChannel : IProtocolWriter
- {
- void Read();
- IAsyncResult BeginRead(AsyncCallback callback, object state);
- void EndRead(IAsyncResult result);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolWriter.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolWriter.cs
deleted file mode 100644
index 592dff3a19..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IProtocolWriter.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.
- *
- */
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Transport
-{
- public interface IProtocolWriter
- {
- void Write(IDataBlock o);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IStreamFilter.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IStreamFilter.cs
deleted file mode 100644
index 7195b3ab04..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IStreamFilter.cs
+++ /dev/null
@@ -1,38 +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.IO;
-
-namespace Apache.Qpid.Client.Transport
-{
- /// <summary>
- /// Defines a way to introduce an arbitrary filtering
- /// stream into the stream chain managed by <see cref="IoHandler"/>
- /// </summary>
- public interface IStreamFilter
- {
- /// <summary>
- /// Creates a new filtering stream on top of another
- /// </summary>
- /// <param name="lowerStream">Next stream on the stack</param>
- /// <returns>A new filtering stream</returns>
- Stream CreateFilterStream(Stream lowerStream);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/ITransport.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/ITransport.cs
deleted file mode 100644
index 693a9a9534..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/ITransport.cs
+++ /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.
- *
- */
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client.Protocol;
-
-namespace Apache.Qpid.Client.Transport
-{
- public interface ITransport : IConnectionCloser
- {
- void Connect(IBrokerInfo broker, AMQConnection connection);
- string LocalEndpoint { get; }
- IProtocolWriter ProtocolWriter { get; }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IoHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IoHandler.cs
deleted file mode 100644
index 9ac513069e..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/IoHandler.cs
+++ /dev/null
@@ -1,322 +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;
-using System.IO;
-using System.Threading;
-using log4net;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Client.Protocol;
-
-namespace Apache.Qpid.Client.Transport
-{
- /// <summary>
- /// Responsible for reading and writing
- /// ByteBuffers from/to network streams, and handling
- /// the stream filters
- /// </summary>
- public class IoHandler : IByteChannel, IDisposable
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(IoHandler));
- private const int DEFAULT_BUFFER_SIZE = 32 * 1024;
-
- private Stream _topStream;
- private IProtocolListener _protocolListener;
- private int _readBufferSize;
-
- public int ReadBufferSize
- {
- get { return _readBufferSize; }
- set { _readBufferSize = value; }
- }
-
- /// <summary>
- /// Initialize a new instance
- /// </summary>
- /// <param name="stream">Underlying network stream</param>
- /// <param name="protocolListener">Protocol listener to report exceptions to</param>
- public IoHandler(Stream stream, IProtocolListener protocolListener)
- {
- if ( stream == null )
- throw new ArgumentNullException("stream");
- if ( protocolListener == null )
- throw new ArgumentNullException("protocolListener");
-
- // initially, the stream at the top of the filter
- // chain is the underlying network stream
- _topStream = stream;
- _protocolListener = protocolListener;
- _readBufferSize = DEFAULT_BUFFER_SIZE;
- }
-
- /// <summary>
- /// Adds a new filter on the top of the chain
- /// </summary>
- /// <param name="filter">Stream filter to put on top of the chain</param>
- /// <remarks>
- /// This should *only* be called during initialization. We don't
- /// support changing the filter change after the first read/write
- /// has been done and it's not thread-safe to boot!
- /// </remarks>
- public void AddFilter(IStreamFilter filter)
- {
- _topStream = filter.CreateFilterStream(_topStream);
- }
-
- #region IByteChannel Implementation
- //
- // IByteChannel Implementation
- //
-
- /// <summary>
- /// Read a <see cref="ByteBuffer"/> from the underlying
- /// network stream and any configured filters
- /// </summary>
- /// <returns>A ByteBuffer, if available</returns>
- public ByteBuffer Read()
- {
- byte[] bytes = AllocateBuffer();
-
- int numOctets = _topStream.Read(bytes, 0, bytes.Length);
-
- return WrapByteArray(bytes, numOctets);
- }
-
- /// <summary>
- /// Begin an asynchronous read operation
- /// </summary>
- /// <param name="callback">Callback method to call when read operation completes</param>
- /// <param name="state">State object</param>
- /// <returns>An <see cref="System.IAsyncResult"/> object</returns>
- public IAsyncResult BeginRead(AsyncCallback callback, object state)
- {
- byte[] bytes = AllocateBuffer();
- ReadData rd = new ReadData(callback, state, bytes);
-
- // only put a callback if the caller wants one.
- AsyncCallback myCallback = null;
- if ( callback != null )
- myCallback = new AsyncCallback(OnAsyncReadDone);
-
- IAsyncResult result = _topStream.BeginRead(
- bytes, 0, bytes.Length, myCallback,rd
- );
- return new WrappedAsyncResult(result, bytes);
- }
-
- /// <summary>
- /// End an asynchronous read operation
- /// </summary>
- /// <param name="result">The <see cref="System.IAsyncResult"/> object returned from <see cref="BeginRead"/></param>
- /// <returns>The <see cref="ByteBuffer"/> read</returns>
- public ByteBuffer EndRead(IAsyncResult result)
- {
- WrappedAsyncResult theResult = (WrappedAsyncResult)result;
- int bytesRead = _topStream.EndRead(theResult.InnerResult);
- return WrapByteArray(theResult.Buffer, bytesRead);
- }
-
- /// <summary>
- /// Write a <see cref="ByteBuffer"/> to the underlying network
- /// stream, going through any configured filters
- /// </summary>
- /// <param name="buffer"></param>
- public void Write(ByteBuffer buffer)
- {
- try
- {
- _topStream.Write(buffer.Array, buffer.Position, buffer.Limit); // FIXME
- }
- catch (Exception e)
- {
- _log.Warn("Write caused exception", e);
- _protocolListener.OnException(e);
- }
- }
-
- /// <summary>
- /// Begin an asynchronous write operation
- /// </summary>
- /// <param name="buffer">Buffer to write</param>
- /// <param name="callback">A callback to call when the operation completes</param>
- /// <param name="state">State object</param>
- /// <returns>An <see cref="System.IAsyncResult"/> object</returns>
- public IAsyncResult BeginWrite(ByteBuffer buffer, AsyncCallback callback, object state)
- {
- try
- {
- return _topStream.BeginWrite(
- buffer.Array, buffer.Position, buffer.Limit,
- callback, state
- );
- } catch ( Exception e )
- {
- _log.Error("BeginWrite caused exception", e);
- // not clear if an exception here should be propagated? we still
- // need to propagate it upwards anyway!
- _protocolListener.OnException(e);
- throw;
- }
- }
-
- /// <summary>
- /// End an asynchronous write operation
- /// </summary>
- /// <param name="result">The <see cref="System.IAsyncResult"/> object returned by <see cref="BeginWrite"/></param>
- public void EndWrite(IAsyncResult result)
- {
- try
- {
- _topStream.EndWrite(result);
- } catch ( Exception e )
- {
- _log.Error("EndWrite caused exception", e);
- // not clear if an exception here should be propagated?
- _protocolListener.OnException(e);
- //throw;
- }
- }
- #endregion // IByteChannel Implementation
-
- #region IDisposable Implementation
- //
- // IDisposable Implementation
- //
-
- public void Dispose()
- {
- if ( _topStream != null )
- {
- _topStream.Close();
- }
- }
-
- #endregion // IDisposable Implementation
-
- #region Private and Helper Classes/Methods
- //
- // Private and Helper Classes/Methods
- //
-
- private byte[] AllocateBuffer()
- {
- return new byte[ReadBufferSize];
- }
-
- private static ByteBuffer WrapByteArray(byte[] bytes, int size)
- {
- ByteBuffer byteBuffer = ByteBuffer.Wrap(bytes);
- byteBuffer.Limit = size;
- byteBuffer.Flip();
-
- return byteBuffer;
- }
-
-
- private static void OnAsyncReadDone(IAsyncResult result)
- {
- ReadData rd = (ReadData) result.AsyncState;
- IAsyncResult wrapped = new WrappedAsyncResult(result, rd.Buffer);
- rd.Callback(wrapped);
- }
-
- class ReadData
- {
- private object _state;
- private AsyncCallback _callback;
- private byte[] _buffer;
-
- public object State
- {
- get { return _state; }
- }
-
- public AsyncCallback Callback
- {
- get { return _callback; }
- }
-
- public byte[] Buffer
- {
- get { return _buffer; }
- }
-
- public ReadData(AsyncCallback callback, object state, byte[] buffer)
- {
- _callback = callback;
- _state = state;
- _buffer = buffer;
- }
- }
-
- class WrappedAsyncResult : IAsyncResult
- {
- private IAsyncResult _innerResult;
- private byte[] _buffer;
-
- #region IAsyncResult Properties
- //
- // IAsyncResult Properties
- //
- public bool IsCompleted
- {
- get { return _innerResult.IsCompleted; }
- }
-
- public WaitHandle AsyncWaitHandle
- {
- get { return _innerResult.AsyncWaitHandle; }
- }
-
- public object AsyncState
- {
- get { return _innerResult.AsyncState; }
- }
-
- public bool CompletedSynchronously
- {
- get { return _innerResult.CompletedSynchronously; }
- }
- #endregion // IAsyncResult Properties
-
- public IAsyncResult InnerResult
- {
- get { return _innerResult; }
- }
- public byte[] Buffer
- {
- get { return _buffer; }
- }
-
- public WrappedAsyncResult(IAsyncResult result, byte[] buffer)
- {
- if ( result == null )
- throw new ArgumentNullException("result");
- if ( buffer == null )
- throw new ArgumentNullException("buffer");
-
- _innerResult = result;
- _buffer = buffer;
- }
- }
-
- #endregion // Private and Helper Classes/Methods
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/ProtocolDecoderOutput.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/ProtocolDecoderOutput.cs
deleted file mode 100644
index 3841c158e4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/ProtocolDecoderOutput.cs
+++ /dev/null
@@ -1,60 +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;
-using System.Threading;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Codec;
-using Apache.Qpid.Framing;
-using log4net;
-
-namespace Apache.Qpid.Client.Transport
-{
- /// <summary>
- /// <see cref="IProtocolDecoderOutput"/> implementation that forwards
- /// each <see cref="IDataBlock"/> as it is decoded to the
- /// protocol listener
- /// </summary>
- internal class ProtocolDecoderOutput : IProtocolDecoderOutput
- {
- private IProtocolListener _protocolListener;
- static readonly ILog _protocolTraceLog = LogManager.GetLogger("TRACE.Qpid.Client.ProtocolChannel");
-
- public ProtocolDecoderOutput(IProtocolListener protocolListener)
- {
- if ( protocolListener == null )
- throw new ArgumentNullException("protocolListener");
-
- _protocolListener = protocolListener;
- }
-
- public void Write(object message)
- {
- IDataBlock block = message as IDataBlock;
- if ( block != null )
- {
- _protocolTraceLog.Debug(String.Format("READ {0}", block));
- _protocolListener.OnMessage(block);
- }
- }
- }
-} // namespace Apache.Qpid.Client.Transport
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/SingleProtocolEncoderOutput.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/SingleProtocolEncoderOutput.cs
deleted file mode 100644
index a1aa889ba0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/SingleProtocolEncoderOutput.cs
+++ /dev/null
@@ -1,40 +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;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Codec;
-
-namespace Apache.Qpid.Client.Transport
-{
- public class SingleProtocolEncoderOutput : IProtocolEncoderOutput
- {
- public ByteBuffer buffer;
-
- public void Write(ByteBuffer buf)
- {
- if (buffer != null)
- {
- throw new InvalidOperationException("{0} does not allow the writing of more than one buffer");
- }
- buffer = buf;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/BlockingSocketTransport.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/BlockingSocketTransport.cs
deleted file mode 100644
index 8a16f9a675..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/BlockingSocketTransport.cs
+++ /dev/null
@@ -1,150 +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;
-using System.Collections;
-using System.IO;
-using System.Threading;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client.Protocol;
-using Apache.Qpid.Codec;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Client.Transport.Socket.Blocking
-{
- /// <summary>
- /// TCP Socket transport supporting both
- /// SSL and non-SSL connections.
- /// </summary>
- public class BlockingSocketTransport : ITransport
- {
- // Configuration variables.
- IProtocolListener _protocolListener;
-
- // Runtime variables.
- private ISocketConnector _connector;
- private IoHandler _ioHandler;
- private AmqpChannel _amqpChannel;
- private ManualResetEvent _stopEvent;
-
- public IProtocolWriter ProtocolWriter
- {
- get { return _amqpChannel; }
- }
- public string LocalEndpoint
- {
- get { return _connector.LocalEndpoint; }
- }
-
-
- /// <summary>
- /// Connect to the specified broker
- /// </summary>
- /// <param name="broker">The broker to connect to</param>
- /// <param name="connection">The AMQ connection</param>
- public void Connect(IBrokerInfo broker, AMQConnection connection)
- {
- _stopEvent = new ManualResetEvent(false);
- _protocolListener = connection.ProtocolListener;
-
- _ioHandler = MakeBrokerConnection(broker, connection);
- // todo: get default read size from config!
-
- IProtocolDecoderOutput decoderOutput =
- new ProtocolDecoderOutput(_protocolListener);
- _amqpChannel =
- new AmqpChannel(new ByteChannel(_ioHandler), decoderOutput);
-
- // post an initial async read
- _amqpChannel.BeginRead(new AsyncCallback(OnAsyncReadDone), this);
- }
-
- /// <summary>
- /// Close the broker connection
- /// </summary>
- public void Close()
- {
- StopReading();
- CloseBrokerConnection();
- }
-
- private void StopReading()
- {
- _stopEvent.Set();
- }
-
- private void CloseBrokerConnection()
- {
- if ( _ioHandler != null )
- {
- _ioHandler.Dispose();
- _ioHandler = null;
- }
- if ( _connector != null )
- {
- _connector.Dispose();
- _connector = null;
- }
- }
-
- private IoHandler MakeBrokerConnection(IBrokerInfo broker, AMQConnection connection)
- {
- if ( broker.UseSSL )
- {
- _connector = new SslSocketConnector();
- } else
- {
- _connector = new SocketConnector();
- }
-
- Stream stream = _connector.Connect(broker);
- return new IoHandler(stream, connection.ProtocolListener);
- }
-
- private void OnAsyncReadDone(IAsyncResult result)
- {
- try
- {
- _amqpChannel.EndRead(result);
-
- bool stopping = _stopEvent.WaitOne(0, false);
- if ( !stopping )
- _amqpChannel.BeginRead(new AsyncCallback(OnAsyncReadDone), null);
- } catch ( Exception e )
- {
- // ignore any errors during closing
- bool stopping = _stopEvent.WaitOne(0, false);
- if ( !stopping )
- _protocolListener.OnException(e);
- }
- }
-
- #region IProtocolDecoderOutput Members
-
- public void Write(object message)
- {
- _protocolListener.OnMessage((IDataBlock)message);
- }
-
- #endregion
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ByteChannel.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ByteChannel.cs
deleted file mode 100644
index 73575c7086..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ByteChannel.cs
+++ /dev/null
@@ -1,92 +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;
-using log4net;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Client.Transport.Socket.Blocking
-{
- class ByteChannel : IByteChannel
- {
- // Warning: don't use this log for regular logging.
- private static readonly ILog _ioTraceLog = LogManager.GetLogger("TRACE.Qpid.Client.ByteChannel");
-
- private IByteChannel _lowerChannel;
-
- public ByteChannel(IByteChannel lowerChannel)
- {
- _lowerChannel = lowerChannel;
- }
-
- public ByteBuffer Read()
- {
- ByteBuffer result = _lowerChannel.Read();
-
- // TODO: Move into decorator.
- if (_ioTraceLog.IsDebugEnabled)
- {
- _ioTraceLog.Debug(String.Format("READ {0}", result));
- }
-
- return result;
- }
-
- public IAsyncResult BeginRead(AsyncCallback callback, object state)
- {
- return _lowerChannel.BeginRead(callback, state);
- }
-
- public ByteBuffer EndRead(IAsyncResult result)
- {
- ByteBuffer buffer = _lowerChannel.EndRead(result);
- if ( _ioTraceLog.IsDebugEnabled )
- {
- _ioTraceLog.Debug(String.Format("READ {0}", buffer));
- }
- return buffer;
- }
-
- public void Write(ByteBuffer buffer)
- {
- // TODO: Move into decorator.
- if (_ioTraceLog.IsDebugEnabled)
- {
- _ioTraceLog.Debug(String.Format("WRITE {0}", buffer));
- }
-
- _lowerChannel.Write(buffer);
- }
-
- public IAsyncResult BeginWrite(ByteBuffer buffer, AsyncCallback callback, object state)
- {
- if ( _ioTraceLog.IsDebugEnabled )
- {
- _ioTraceLog.Debug(String.Format("WRITE {0}", buffer));
- }
- return _lowerChannel.BeginWrite(buffer, callback, state);
- }
-
- public void EndWrite(IAsyncResult result)
- {
- _lowerChannel.EndWrite(result);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ISocketConnector.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ISocketConnector.cs
deleted file mode 100644
index 3d5d2898cf..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ISocketConnector.cs
+++ /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.
- *
- */
-using System;
-using System.IO;
-using Apache.Qpid.Client.Qms;
-
-namespace Apache.Qpid.Client.Transport.Socket.Blocking
-{
- interface ISocketConnector : IDisposable
- {
- string LocalEndpoint { get; }
- Stream Connect(IBrokerInfo broker);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SocketConnector.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SocketConnector.cs
deleted file mode 100644
index 83f7287e9b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SocketConnector.cs
+++ /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.
- *
- */
-using System.IO;
-using System.Net;
-using System.Net.Sockets;
-using Apache.Qpid.Client.Qms;
-
-namespace Apache.Qpid.Client.Transport.Socket.Blocking
-{
- /// <summary>
- /// Implements a TCP connection over regular sockets.
- /// </summary>
- class SocketConnector : ISocketConnector
- {
- private MyTcpClient _tcpClient;
-
- public string LocalEndpoint
- {
- get { return _tcpClient.LocalEndpoint.ToString(); }
- }
-
- public Stream Connect(IBrokerInfo broker)
- {
- _tcpClient = new MyTcpClient(broker.Host, broker.Port);
- return _tcpClient.GetStream();
- }
-
- public void Dispose()
- {
- if ( _tcpClient != null )
- {
- _tcpClient.Close();
- _tcpClient = null;
- }
- }
-
- class MyTcpClient : TcpClient
- {
- public MyTcpClient(string host, int port)
- : base(host, port)
- {
- }
-
- public EndPoint LocalEndpoint
- {
- get { return Client.LocalEndPoint; }
- }
- }
-
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SslSocketConnector.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SslSocketConnector.cs
deleted file mode 100644
index 708edde48c..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SslSocketConnector.cs
+++ /dev/null
@@ -1,107 +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.IO;
-using System.Net;
-using log4net;
-using Apache.Qpid.Client.Qms;
-using Org.Mentalis.Security.Ssl;
-using MCertificate = Org.Mentalis.Security.Certificates.Certificate;
-using MCertificateChain = Org.Mentalis.Security.Certificates.CertificateChain;
-
-namespace Apache.Qpid.Client.Transport.Socket.Blocking
-{
- /// <summary>
- /// Implements a TLS v1.0 connection using the Mentalis.org library
- /// </summary>
- /// <remarks>
- /// It would've been easier to implement this at the StreamFilter
- /// level, but unfortunately the Mentalis library doesn't support
- /// a passthrough SSL stream class and is tied directly
- /// to socket-like classes.
- /// </remarks>
- class SslSocketConnector : ISocketConnector
- {
- private static ILog _logger = LogManager.GetLogger(typeof(SslSocketConnector));
- private MyTcpClient _tcpClient;
-
- public string LocalEndpoint
- {
- get { return _tcpClient.LocalEndpoint.ToString(); }
- }
-
- public Stream Connect(IBrokerInfo broker)
- {
- MCertificate cert = GetClientCert(broker);
- SecurityOptions options = new SecurityOptions(
- SecureProtocol.Tls1, cert, ConnectionEnd.Client
- );
- if ( broker.SslOptions != null
- && broker.SslOptions.IgnoreValidationErrors )
- {
- _logger.Warn("Ignoring any certificate validation errors during SSL handshake...");
- options.VerificationType = CredentialVerification.None;
- }
-
- _tcpClient = new MyTcpClient(broker.Host, broker.Port, options);
- return _tcpClient.GetStream();
- }
-
- public void Dispose()
- {
- if ( _tcpClient != null )
- {
- _tcpClient.Close();
- _tcpClient = null;
- }
- }
-
- private static MCertificate GetClientCert(IBrokerInfo broker)
- {
- // if a client certificate is configured,
- // use that to enable mutual authentication
- MCertificate cert = null;
- if ( broker.SslOptions != null
- && broker.SslOptions.ClientCertificate != null )
- {
- cert = MCertificate.CreateFromX509Certificate(
- broker.SslOptions.ClientCertificate
- );
- _logger.DebugFormat("Using Client Certificate for SSL '{0}'", cert.ToString(true));
- }
- return cert;
- }
-
- class MyTcpClient : SecureTcpClient
- {
- public MyTcpClient(string host, int port, SecurityOptions options)
- : base(host, port, options)
- {
- }
-
- public EndPoint LocalEndpoint
- {
- get { return Client.LocalEndPoint; }
- }
-
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Util/FlowControlQueue.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Client/Util/FlowControlQueue.cs
deleted file mode 100644
index 87bb2a2859..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Client/Util/FlowControlQueue.cs
+++ /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.
- *
- */
-using System;
-using System.Collections;
-using System.Text;
-using System.Threading;
-using Apache.Qpid.Collections;
-using Apache.Qpid.Common;
-
-namespace Apache.Qpid.Client.Util
-{
- internal delegate void ThresholdMethod(int currentCount);
-
- /// <summary>
- /// Basic bounded queue used to implement prefetching.
- /// Notice we do the callbacks here asynchronously to
- /// avoid adding more complexity to the channel impl.
- /// </summary>
- internal class FlowControlQueue
- {
- private BlockingQueue _queue = new LinkedBlockingQueue();
- private int _itemCount;
- private int _lowerBound;
- private int _upperBound;
- private ThresholdMethod _underThreshold;
- private ThresholdMethod _overThreshold;
-
- public FlowControlQueue(
- int lowerBound,
- int upperBound,
- ThresholdMethod underThreshold,
- ThresholdMethod overThreshold
- )
- {
- _lowerBound = lowerBound;
- _upperBound = upperBound;
- _underThreshold = underThreshold;
- _overThreshold = overThreshold;
- }
-
- public void Enqueue(object item)
- {
- _queue.EnqueueBlocking(item);
- int count = Interlocked.Increment(ref _itemCount);
- if ( _overThreshold != null )
- {
- if ( count == _upperBound )
- {
- _overThreshold.BeginInvoke(
- count, new AsyncCallback(OnAsyncCallEnd),
- _overThreshold
- );
- }
- }
- }
-
- public object Dequeue()
- {
- object item = _queue.DequeueBlocking();
- int count = Interlocked.Decrement(ref _itemCount);
- if ( _underThreshold != null )
- {
- if ( count == _lowerBound )
- {
- _underThreshold.BeginInvoke(
- count, new AsyncCallback(OnAsyncCallEnd),
- _underThreshold
- );
- }
- }
- return item;
- }
-
- private void OnAsyncCallEnd(IAsyncResult res)
- {
- ThresholdMethod method = (ThresholdMethod)res.AsyncState;
- method.EndInvoke(res);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Client/Properties/AssemblyInfo.cs
deleted file mode 100644
index 4343c30bf5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/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.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.Client")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.Client")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("380cb124-07a8-40c2-b67d-69a0d94cb620")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0.0")]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/Qpid.Client.csproj b/M4-RCs/qpid/dotnet/Qpid.Client/Qpid.Client.csproj
deleted file mode 100644
index 303f885149..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/Qpid.Client.csproj
+++ /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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{68987C05-3768-452C-A6FC-6BA1D372852F}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Client</RootNamespace>
- <AssemblyName>Apache.Qpid.Client</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\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\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="log4net, Version=1.2.0.30714, Culture=neutral, PublicKeyToken=500ffcafb14f92df">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Qpid.Common\lib\log4net\log4net.dll</HintPath>
- </Reference>
- <Reference Include="Org.Mentalis.Security, Version=1.0.13.716, Culture=neutral, PublicKeyToken=085a8f6006888436">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Qpid.Common\lib\seclib-1.0.0\Org.Mentalis.Security.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Buffer\Qpid.Buffer.csproj">
- <Project>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</Project>
- <Name>Qpid.Buffer</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Codec\Qpid.Codec.csproj">
- <Project>{22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}</Project>
- <Name>Qpid.Codec</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Messaging\Qpid.Messaging.csproj">
- <Project>{6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}</Project>
- <Name>Qpid.Messaging</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Common\Qpid.Common.csproj">
- <Project>{77064C42-24D2-4CEB-9EA2-0EF481A43205}</Project>
- <Name>Qpid.Common</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Sasl\Qpid.Sasl.csproj">
- <Project>{1465B0EE-6452-42A6-AB73-B2F9EABEEE75}</Project>
- <Name>Qpid.Sasl</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/Qpid.Client/default.build b/M4-RCs/qpid/dotnet/Qpid.Client/default.build
deleted file mode 100644
index 9a0ec2ea6d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/default.build
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Apache.Qpid.Client" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/Apache.Qpid.Buffer.dll" />
- <include name="${build.dir}/Apache.Qpid.Sasl.dll" />
- <include name="${build.dir}/Apache.Qpid.Codec.dll" />
- <include name="${build.dir}/Apache.Qpid.Common.dll" />
- <include name="${build.dir}/Apache.Qpid.Messaging.dll" />
- <include name="${build.dir}/Org.Mentalis.Security.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/qms/BrokerInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Client/qms/BrokerInfo.cs
deleted file mode 100644
index 93c00af6e0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/qms/BrokerInfo.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;
-
-namespace Apache.Qpid.Client.Qms
-{
- /// <summary>
- /// Know URL option names.
- /// <seealso cref="IConnectionInfo"/>
- /// </summary>
- public class BrokerInfoConstants
- {
- public const String OPTIONS_RETRY = "retries";
- public const String OPTIONS_SSL = ConnectionUrlConstants.OPTIONS_SSL;
- public const String OPTIONS_CONNECT_TIMEOUT = "connecttimeout";
- public const int DEFAULT_PORT = 5672;
- public const String DEFAULT_TRANSPORT = "tcp";
-
- public readonly string URL_FORMAT_EXAMPLE =
- "<transport>://<hostname>[:<port Default=\"" + DEFAULT_PORT + "\">][?<option>='<value>'[,<option>='<value>']]";
-
- public const long DEFAULT_CONNECT_TIMEOUT = 30000L;
- }
-
- public interface IBrokerInfo
- {
- string Host { get; set; }
- int Port { get; set; }
- string Transport { get; set; }
- bool UseSSL { get; set; }
- long Timeout { get; set; }
- SslOptions SslOptions { get; }
-
- String GetOption(string key);
- void SetOption(string key, string value);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/qms/ConnectionInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Client/qms/ConnectionInfo.cs
deleted file mode 100644
index 4d3f7698b5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/qms/ConnectionInfo.cs
+++ /dev/null
@@ -1,63 +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.Collections;
-
-namespace Apache.Qpid.Client.Qms
-{
- class ConnectionUrlConstants
- {
- public const string AMQ_PROTOCOL = "amqp";
- public const string OPTIONS_BROKERLIST = "brokerlist";
- public const string OPTIONS_FAILOVER = "failover";
- public const string OPTIONS_FAILOVER_CYCLE = "cyclecount";
- public const string OPTIONS_SSL = "ssl";
- }
-
- /// <summary>
- /// Connection URL format
- /// amqp://[user:pass@][clientid]/virtualhost?brokerlist='tcp://host:port?option=\'value\'&amp;option=\'value\';vm://:3/virtualpath?option=\'value\''&amp;failover='method?option=\'value\'&amp;option='value''"
- /// Options are of course optional except for requiring a single broker in the broker list.
- /// The option seperator is defined to be either '&amp;' or ','
- /// </summary>
- public interface IConnectionInfo
- {
- string AsUrl();
-
- string FailoverMethod { get; set; }
- string ClientName { get; set; }
- string Username { get; set; }
- string Password { get; set; }
- string VirtualHost { get; set; }
- string GetFailoverOption(string key);
-
- int BrokerCount { get; }
-
- IBrokerInfo GetBrokerInfo(int index);
-
- void AddBrokerInfo(IBrokerInfo broker);
-
- IList GetAllBrokerInfos();
-
- string GetOption(string key);
-
- void SetOption(string key, string value);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/qms/FailoverPolicy.cs b/M4-RCs/qpid/dotnet/Qpid.Client/qms/FailoverPolicy.cs
deleted file mode 100644
index 179a695bf9..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/qms/FailoverPolicy.cs
+++ /dev/null
@@ -1,315 +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;
-using System.Text;
-using log4net;
-using Apache.Qpid.Client.Qms.Failover;
-
-namespace Apache.Qpid.Client.Qms
-{
- public class FailoverPolicy
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(FailoverPolicy));
-
- private const long MINUTE = 60000L;
-
- private const long DEFAULT_METHOD_TIMEOUT = 1 * MINUTE;
- private const long DEFAULT_FAILOVER_TIMEOUT = 4 * MINUTE;
-
- private IFailoverMethod[] _methods = new IFailoverMethod[1];
-
- private int _currentMethod;
-
- private int _methodsRetries;
-
- private int _currentRetry;
-
- private bool _timing;
-
- private long _lastMethodTime;
- private long _lastFailTime;
-
- public FailoverPolicy(IConnectionInfo connectionInfo)
- {
- IFailoverMethod method;
-
- //todo This should be integrated in to the connection url when it supports
- // multiple strategies.
-
- _methodsRetries = 0;
-
- if (connectionInfo.FailoverMethod == null)
- {
- if (connectionInfo.BrokerCount > 1)
- {
- method = new FailoverRoundRobin(connectionInfo);
- }
- else
- {
- method = new FailoverSingleServer(connectionInfo);
- }
- }
- else
- {
- string failoverMethod = connectionInfo.FailoverMethod;
-
- /*
- if (failoverMethod.equals(FailoverMethod.RANDOM))
- {
- //todo write a random connection Failover
- }
- */
- if (failoverMethod.Equals(FailoverMethodConstants.ROUND_ROBIN))
- {
- method = new FailoverRoundRobin(connectionInfo);
- }
- else
- {
- throw new NotImplementedException("Dynamic loading of FailoverMethods not yet implemented.");
-// try
-// {
-// Type[] constructorSpec = {ConnectionInfo.class};
-// Object [] params = {connectionInfo};
-//
-// method = (FailoverMethod) ClassLoader.getSystemClassLoader().
-// loadClass(failoverMethod).
-// getConstructor(constructorSpec).newInstance(params);
-// }
-// catch (Exception cnfe)
-// {
-// throw new IllegalArgumentException("Unknown failover method:" + failoverMethod);
-// }
- }
- }
-
- if (method == null)
- {
- throw new ArgumentException("Unknown failover method specified.");
- }
-
- reset();
-
- _methods[_currentMethod] = method;
- }
-
- public FailoverPolicy(IFailoverMethod method) : this(method, 0)
- {
- }
-
- public FailoverPolicy(IFailoverMethod method, int retries)
- {
- _methodsRetries = retries;
-
- reset();
-
- _methods[_currentMethod] = method;
- }
-
- private void reset()
- {
- _currentMethod = 0;
- _currentRetry = 0;
- _timing = false;
-
- }
-
- public bool FailoverAllowed()
- {
- bool failoverAllowed;
-
- if (_timing)
- {
- long now = CurrentTimeMilliseconds();
-
- if ((now - _lastMethodTime) >= DEFAULT_METHOD_TIMEOUT)
- {
- _logger.Info("Failover method timeout");
- _lastMethodTime = now;
-
- if (!nextMethod())
- {
- return false;
- }
-
-
- }
- else if ((now - _lastFailTime) >= DEFAULT_FAILOVER_TIMEOUT)
- {
- _logger.Info("Failover timeout");
- return false;
- }
- else
- {
- _lastMethodTime = now;
- }
- }
- else
- {
- _timing = true;
- _lastMethodTime = CurrentTimeMilliseconds();
- _lastFailTime = _lastMethodTime;
- }
-
-
- if (_methods[_currentMethod].FailoverAllowed())
- {
- failoverAllowed = true;
- }
- else
- {
- if (_currentMethod < (_methods.Length - 1))
- {
- nextMethod();
- _logger.Info("Changing method to " + _methods[_currentMethod].MethodName);
- return FailoverAllowed();
- }
- else
- {
- return cycleMethods();
- }
- }
-
- return failoverAllowed;
- }
-
- private static long CurrentTimeMilliseconds()
- {
- return DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
- }
-
- private bool nextMethod()
- {
- if (_currentMethod < (_methods.Length - 1))
- {
- _currentMethod++;
- _methods[_currentMethod].Reset();
- return true;
- }
- else
- {
- return cycleMethods();
- }
- }
-
- private bool cycleMethods()
- {
- if (_currentRetry < _methodsRetries)
- {
- _currentRetry++;
-
- _currentMethod = 0;
-
- _logger.Info("Retrying methods starting with " + _methods[_currentMethod].MethodName);
- _methods[_currentMethod].Reset();
- return FailoverAllowed();
- }
- else
- {
- _logger.Debug("All failover methods exhausted");
- return false;
- }
- }
-
- /**
- * Notification that connection was successful.
- */
- public void attainedConnection()
- {
- _currentRetry = 0;
-
- _methods[_currentMethod].AttainedConnection();
-
- _timing = false;
- }
-
- public IBrokerInfo GetCurrentBrokerInfo()
- {
- return _methods[_currentMethod].GetCurrentBrokerInfo();
- }
-
- public IBrokerInfo GetNextBrokerInfo()
- {
- return _methods[_currentMethod].GetNextBrokerDetails();
- }
-
- public void setBroker(IBrokerInfo broker)
- {
- _methods[_currentMethod].SetBroker(broker);
- }
-
- public void addMethod(IFailoverMethod method)
- {
- int len = _methods.Length + 1;
- IFailoverMethod[] newMethods = new IFailoverMethod[len];
- _methods.CopyTo(newMethods, 0);
-// System.arraycopy(_methods, 0, newMethods, 0, _methods.length);
- int index = len - 1;
- newMethods[index] = method;
- _methods = newMethods;
- }
-
- public void setMethodRetries(int retries)
- {
- _methodsRetries = retries;
- }
-
- public IFailoverMethod getCurrentMethod()
- {
- if (_currentMethod >= 0 && _currentMethod < (_methods.Length - 1))
- {
- return _methods[_currentMethod];
- }
- else
- {
- return null;
- }
- }
-
- public String toString()
- {
- StringBuilder sb = new StringBuilder();
-
- sb.Append("Failover Policy:\n");
-
- if (FailoverAllowed())
- {
- sb.Append("Failover allowed\n");
- }
- else
- {
- sb.Append("Failover not allowed\n");
- }
-
- sb.Append("Failover policy methods\n");
- for (int i = 0; i < _methods.Length; i++)
- {
-
- if (i == _currentMethod)
- {
- sb.Append(">");
- }
- sb.Append(_methods[i].ToString());
- }
-
- return sb.ToString();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/qms/UrlSyntaxException.cs b/M4-RCs/qpid/dotnet/Qpid.Client/qms/UrlSyntaxException.cs
deleted file mode 100644
index ab3de325d4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/qms/UrlSyntaxException.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.
- *
- */
-using System;
-using System.Runtime.Serialization;
-using System.Text;
-
-namespace Apache.Qpid.Client.Qms
-{
- [Serializable]
- public class UrlSyntaxException : UriFormatException
- {
- private string _url;
- private int _index;
- private int _length;
-
- public int GetIndex()
- {
- return _index;
- }
-
- public UrlSyntaxException(String input, String reason)
- : this(input, reason, -1)
- {
- }
-
- private UrlSyntaxException(string input, string reason, int index)
- :
- this(input, reason, index, input.Length)
- {
- }
-
- public UrlSyntaxException(String url, String error, int index, int length)
- : base(error)
- {
- _url = url;
- _index = index;
- _length = length;
- }
-
- protected UrlSyntaxException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- _url = info.GetString("Url");
- _index = info.GetInt32("Index");
- _length = info.GetInt32("Length");
- }
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData(info, context);
- info.AddValue("Url", _url);
- info.AddValue("Index", _index);
- info.AddValue("Length", _length);
- }
-
- private static String getPositionString(int index, int length)
- {
- StringBuilder sb = new StringBuilder(index + 1);
-
- for (int i = 0; i < index; i++)
- {
- sb.Append(" ");
- }
-
- if (length > -1)
- {
- for (int i = 0; i < length; i++)
- {
- sb.Append('^');
- }
- }
-
- return sb.ToString();
- }
-
-
- public String toString()
- {
- StringBuilder sb = new StringBuilder();
-
-// sb.Append(getReason());
-
- if (_index > -1)
- {
- if (_length != -1)
- {
- sb.Append(" between indicies ");
- sb.Append(_index);
- sb.Append(" and ");
- sb.Append(_length);
- }
- else
- {
- sb.Append(" at index ");
- sb.Append(_index);
- }
- }
-
- sb.Append(" ");
- if (_index != -1)
- {
- sb.Append("\n");
- }
-
- sb.Append(_url);
-
- if (_index != -1)
- {
- sb.Append("\n");
- sb.Append(getPositionString(_index, _length));
- }
-
- return sb.ToString();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverMethod.cs b/M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverMethod.cs
deleted file mode 100644
index f32b275e84..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverMethod.cs
+++ /dev/null
@@ -1,78 +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;
-
-namespace Apache.Qpid.Client.Qms.Failover
-{
- public class FailoverMethodConstants
- {
- public const String ROUND_ROBIN = "roundrobin";
- public const String RANDOM = "random";
- }
-
- public interface IFailoverMethod
- {
- /// <summary>
- /// The name of this method for display purposes.
- /// </summary>
- String MethodName { get; }
-
- /// <summary>
- /// Reset the Failover to initial conditions
- /// </summary>
- void Reset();
-
- /// <summary>
- /// Check if failover is possible for this method
- /// </summary>
- /// <returns>true if failover is allowed</returns>
- bool FailoverAllowed();
-
- /// <summary>
- /// Notification to the Failover method that a connection has been attained.
- /// </summary>
- void AttainedConnection();
-
- /// <summary>
- /// If there is no current BrokerInfo the null will be returned.
- /// </summary>
- /// <returns>The current BrokerDetail value to use</returns>
- IBrokerInfo GetCurrentBrokerInfo();
-
- /// <summary>
- /// Move to the next BrokerInfo if one is available.
- /// </summary>
- /// <returns>the next BrokerDetail or null if there is none.</returns>
- IBrokerInfo GetNextBrokerDetails();
-
- /// <summary>
- /// Set the currently active broker to be the new value.
- /// </summary>
- /// <param name="broker">The new BrokerDetail value</param>
- void SetBroker(IBrokerInfo broker);
-
- /// <summary>
- /// Set the retries for this method
- /// </summary>
- /// <param name="maxRetries">the maximum number of time to retry this Method</param>
- void SetRetries(int maxRetries);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverRoundRobin.cs b/M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverRoundRobin.cs
deleted file mode 100644
index 8103940fb4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverRoundRobin.cs
+++ /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.
- *
- */
-using System;
-using System.Text;
-using log4net;
-
-namespace Apache.Qpid.Client.Qms.Failover
-{
- public class FailoverRoundRobin : IFailoverMethod
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(FailoverRoundRobin));
-
- /** The default number of times to cycle through all servers */
- public const int DEFAULT_CYCLE_RETRIES = 0;
- /** The default number of times to retry each server */
- public const int DEFAULT_SERVER_RETRIES = 0;
-
- /**
- * The index into the hostDetails array of the broker to which we are connected
- */
- private int _currentBrokerIndex = -1;
-
- /**
- * The number of times to retry connecting for each server
- */
- private int _serverRetries;
-
- /**
- * The current number of retry attempts made
- */
- private int _currentServerRetry;
-
- /**
- * The number of times to cycle through the servers
- */
- private int _cycleRetries;
-
- /**
- * The current number of cycles performed.
- */
- private int _currentCycleRetries;
-
- /**
- * Array of BrokerDetail used to make connections.
- */
- private IConnectionInfo _connectionDetails;
-
- public FailoverRoundRobin(IConnectionInfo connectionDetails)
- {
- if (!(connectionDetails.BrokerCount > 0))
- {
- throw new ArgumentException("At least one broker details must be specified.");
- }
-
- _connectionDetails = connectionDetails;
-
- //There is no current broker at startup so set it to -1.
- _currentBrokerIndex = -1;
-
- String cycleRetries = _connectionDetails.GetFailoverOption(ConnectionUrlConstants.OPTIONS_FAILOVER_CYCLE);
-
- if (cycleRetries != null)
- {
- try
- {
- _cycleRetries = int.Parse(cycleRetries);
- }
- catch (FormatException)
- {
- _cycleRetries = DEFAULT_CYCLE_RETRIES;
- }
- }
-
- _currentCycleRetries = 0;
-
- _serverRetries = 0;
- _currentServerRetry = -1;
- }
-
- public void Reset()
- {
- _currentBrokerIndex = 0;
- _currentCycleRetries = 0;
- _currentServerRetry = -1;
- }
-
- public bool FailoverAllowed()
- {
- return ((_currentCycleRetries < _cycleRetries)
- || (_currentServerRetry < _serverRetries)
- || (_currentBrokerIndex < (_connectionDetails.BrokerCount - 1)));
- }
-
- public void AttainedConnection()
- {
- _currentCycleRetries = 0;
- _currentServerRetry = -1;
- }
-
- public IBrokerInfo GetCurrentBrokerInfo()
- {
- if (_currentBrokerIndex == -1)
- {
- return null;
- }
-
- return _connectionDetails.GetBrokerInfo(_currentBrokerIndex);
- }
-
- public IBrokerInfo GetNextBrokerDetails()
- {
- if (_currentBrokerIndex == (_connectionDetails.BrokerCount - 1))
- {
- if (_currentServerRetry < _serverRetries)
- {
- if (_currentBrokerIndex == -1)
- {
- _currentBrokerIndex = 0;
-
- SetBroker(_connectionDetails.GetBrokerInfo(_currentBrokerIndex ));
-
- _logger.Info("First Run using " + _connectionDetails.GetBrokerInfo(_currentBrokerIndex));
- }
- else
- {
- _logger.Info("Retrying " + _connectionDetails.GetBrokerInfo(_currentBrokerIndex));
- }
-
- _currentServerRetry++;
- }
- else
- {
- _currentCycleRetries++;
- //failed to connect to first broker
- _currentBrokerIndex = 0;
-
- SetBroker(_connectionDetails.GetBrokerInfo(_currentBrokerIndex ));
-
- // This is zero rather than -1 as we are already retrieving the details.
- _currentServerRetry = 0;
- }
- //else - should force client to stop as max retries has been reached.
- }
- else
- {
- if (_currentServerRetry < _serverRetries)
- {
- if (_currentBrokerIndex == -1)
- {
- _currentBrokerIndex = 0;
-
- SetBroker(_connectionDetails.GetBrokerInfo(_currentBrokerIndex ));
-
- _logger.Info("First Run using " + _connectionDetails.GetBrokerInfo(_currentBrokerIndex));
- }
- else
- {
- _logger.Info("Retrying " + _connectionDetails.GetBrokerInfo(_currentBrokerIndex));
- }
- _currentServerRetry++;
- }
- else
- {
- _currentBrokerIndex++;
-
- SetBroker(_connectionDetails.GetBrokerInfo(_currentBrokerIndex ));
- // This is zero rather than -1 as we are already retrieving the details.
- _currentServerRetry = 0;
- }
- }
-
- return _connectionDetails.GetBrokerInfo(_currentBrokerIndex);
- }
-
- public void SetBroker(IBrokerInfo broker)
- {
- _connectionDetails.AddBrokerInfo(broker);
-
- int index = _connectionDetails.GetAllBrokerInfos().IndexOf(broker);
-
- String serverRetries = broker.GetOption(BrokerInfoConstants.OPTIONS_RETRY);
-
- if (serverRetries != null)
- {
- try
- {
- _serverRetries = int.Parse(serverRetries);
- }
- catch (FormatException)
- {
- _serverRetries = DEFAULT_SERVER_RETRIES;
- }
- }
-
- _currentServerRetry = -1;
- _currentBrokerIndex = index;
- }
-
- public void SetRetries(int maxRetries)
- {
- _cycleRetries = maxRetries;
- }
-
- public String MethodName
- {
- get { return "Cycle Servers"; }
- }
-
- public override string ToString()
- {
- StringBuilder sb = new StringBuilder();
-
- sb.Append(GetType().Name).Append("\n");
-
- sb.Append("Broker count: ").Append(_connectionDetails.BrokerCount);
- sb.Append("\ncurrent broker index: ").Append(_currentBrokerIndex);
-
- sb.Append("\nCycle Retries: ").Append(_cycleRetries);
- sb.Append("\nCurrent Cycle:").Append(_currentCycleRetries);
- sb.Append("\nServer Retries:").Append(_serverRetries);
- sb.Append("\nCurrent Retry:").Append(_currentServerRetry);
- sb.Append("\n");
-
- for(int i=0; i < _connectionDetails.BrokerCount ; i++)
- {
- if (i == _currentBrokerIndex)
- {
- sb.Append(">");
- }
- sb.Append(_connectionDetails.GetBrokerInfo(i));
- sb.Append("\n");
- }
-
- return sb.ToString();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverSingleServer.cs b/M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverSingleServer.cs
deleted file mode 100644
index 5e502b897e..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Client/qms/failover/FailoverSingleServer.cs
+++ /dev/null
@@ -1,147 +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;
-
-namespace Apache.Qpid.Client.Qms.Failover
-{
- public class FailoverSingleServer : IFailoverMethod
- {
- /** The default number of times to rety a conection to this server */
- public const int DEFAULT_SERVER_RETRIES = 1;
-
- /**
- * The details of the Single Server
- */
- private IBrokerInfo _brokerDetail;
-
- /**
- * The number of times to retry connecting to the sever
- */
- private int _retries;
-
- /**
- * The current number of attempts made to the server
- */
- private int _currentRetries;
-
-
- public FailoverSingleServer(IConnectionInfo connectionDetails)
- {
- if (connectionDetails.BrokerCount > 0)
- {
- SetBroker(connectionDetails.GetBrokerInfo(0));
- }
- else
- {
- throw new ArgumentException("BrokerInfo details required for connection.");
- }
- }
-
- public FailoverSingleServer(IBrokerInfo brokerDetail)
- {
- SetBroker(brokerDetail);
- }
-
- public void Reset()
- {
- _currentRetries = -1;
- }
-
- public bool FailoverAllowed()
- {
- return _currentRetries < _retries;
- }
-
- public void AttainedConnection()
- {
- Reset();
- }
-
- public IBrokerInfo GetCurrentBrokerInfo()
- {
- return _brokerDetail;
- }
-
- public IBrokerInfo GetNextBrokerDetails()
- {
- if (_currentRetries == _retries)
- {
- return null;
- }
- else
- {
- if (_currentRetries < _retries)
- {
- _currentRetries ++;
- }
-
- return _brokerDetail;
- }
- }
-
- public void SetBroker(IBrokerInfo broker)
- {
- if (broker == null)
- {
- throw new ArgumentException("BrokerInfo details cannot be null");
- }
- _brokerDetail = broker;
-
- String retries = broker.GetOption(BrokerInfoConstants.OPTIONS_RETRY);
- if (retries != null)
- {
- try
- {
- _retries = int.Parse(retries);
- }
- catch (FormatException)
- {
- _retries = DEFAULT_SERVER_RETRIES;
- }
- }
- else
- {
- _retries = DEFAULT_SERVER_RETRIES;
- }
-
- Reset();
- }
-
- public void SetRetries(int retries)
- {
- _retries = retries;
- }
-
- public String MethodName
- {
- get { return "Single Server"; }
- }
-
- public String toString()
- {
- return "SingleServer:\n"+
- "Max Retries:"+_retries+
- "\nCurrent Retry:"+_currentRetries+
- "\n"+_brokerDetail+"\n";
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs
deleted file mode 100644
index 6cfd75c851..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs
+++ /dev/null
@@ -1,152 +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;
-using log4net;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Codec
-{
- public abstract class CumulativeProtocolDecoder : IProtocolDecoder
- {
- static ILog _logger = LogManager.GetLogger(typeof(CumulativeProtocolDecoder));
-
- ByteBuffer _remaining;
-
- /// <summary>
- /// Creates a new instance with the 4096 bytes initial capacity of
- /// cumulative buffer.
- /// </summary>
- protected CumulativeProtocolDecoder()
- {
- _remaining = AllocateBuffer();
- }
-
- /// <summary>
- /// Cumulates content of <tt>in</tt> into internal buffer and forwards
- /// decoding request to {@link #doDecode(IoSession, ByteBuffer, ProtocolDecoderOutput)}.
- /// <tt>doDecode()</tt> is invoked repeatedly until it returns <tt>false</tt>
- /// and the cumulative buffer is compacted after decoding ends.
- /// </summary>
- /// <exception cref="Exception">
- /// if your <tt>doDecode()</tt> returned <tt>true</tt> not consuming the cumulative buffer.
- /// </exception>
- public void Decode(ByteBuffer input, IProtocolDecoderOutput output)
- {
- if ( _remaining.Position != 0 ) // If there were remaining undecoded bytes
- {
- DecodeRemainingAndInput(input, output);
- } else
- {
- DecodeInput(input, output);
- }
- }
-
- private void DecodeInput(ByteBuffer input, IProtocolDecoderOutput output)
- {
- _logger.Debug(string.Format("DecodeInput: input {0}", input.Remaining));
- // Just decode the input buffer and remember any remaining undecoded bytes.
- try
- {
- DecodeAll(input, output);
- } finally
- {
- if ( input.HasRemaining )
- {
- _remaining.Put(input);
- }
- }
- }
-
- private void DecodeRemainingAndInput(ByteBuffer input, IProtocolDecoderOutput output)
- {
- _logger.Debug(string.Format("DecodeRemainingAndInput: input {0}, remaining {1}", input.Remaining, _remaining.Position));
- // replace the _remainder buffer, so that we can leave the
- // original one alone. Necessary because some consumer splice
- // the buffer and only consume it until later, causing
- // a race condition if we compact it too soon.
- ByteBuffer newRemainding = AllocateBuffer();
- ByteBuffer temp = _remaining;
- _remaining = newRemainding;
- temp.Put(input);
- temp.Flip();
- try
- {
- DecodeAll(temp, output);
- } finally
- {
- if ( temp.Remaining > 0 )
- _remaining.Put(temp);
- }
- }
-
- private void DecodeAll(ByteBuffer buf, IProtocolDecoderOutput output)
- {
- for ( ; ; )
- {
- int oldPos = buf.Position;
- bool decoded = DoDecode(buf, output);
- if ( decoded )
- {
- if ( buf.Position == oldPos )
- {
- throw new Exception(
- "doDecode() can't return true when buffer is not consumed.");
- }
-
- if ( !buf.HasRemaining )
- {
- break;
- }
- } else
- {
- break;
- }
- }
- }
-
- /// <summary>
- /// Implement this method to consume the specified cumulative buffer and
- /// decode its content into message(s).
- /// </summary>
- /// <param name="input">the cumulative buffer</param>
- /// <param name="output">decoder output</param>
- /// <returns>
- /// <tt>true</tt> if and only if there's more to decode in the buffer
- /// and you want to have <tt>doDecode</tt> method invoked again.
- /// Return <tt>false</tt> if remaining data is not enough to decode,
- /// then this method will be invoked again when more data is cumulated.
- /// </returns>
- /// <exception cref="Exception">If cannot decode</exception>
- protected abstract bool DoDecode(ByteBuffer input, IProtocolDecoderOutput output);
-
- public void Dispose()
- {
- _remaining = null;
- }
-
- private ByteBuffer AllocateBuffer()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(4096);
- buffer.IsAutoExpand = true;
- return buffer;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs
deleted file mode 100644
index 78276202d6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs
+++ /dev/null
@@ -1,387 +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;
-using System.Collections;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Codec.Demux
-{
- public class DemuxingProtocolCodecFactory : IProtocolCodecFactory
- {
- private ArrayList _decoderFactories = new ArrayList();
- private ArrayList _encoderFactories = new ArrayList();
-
- public void Register(Type encoderOrDecoderClass)
- {
- if (encoderOrDecoderClass == null)
- {
- throw new ArgumentNullException("encoderOrDecoderClass");
- }
-
- bool registered = false;
- if (typeof(IMessageEncoder).IsAssignableFrom(encoderOrDecoderClass))
- {
- Register(new DefaultConstructorMessageEncoderFactory(encoderOrDecoderClass));
- registered = true;
- }
-
- if (typeof(IMessageDecoder).IsAssignableFrom(encoderOrDecoderClass))
- {
- Register(new DefaultConstructorMessageDecoderFactory(encoderOrDecoderClass));
- registered = true;
- }
-
- if (!registered)
- {
- throw new ArgumentException("Unregisterable type: " + encoderOrDecoderClass);
- }
- }
-
- public void Register(IMessageEncoder encoder)
- {
- Register(new SingletonMessageEncoderFactory(encoder));
- }
-
- public void Register(IMessageEncoderFactory factory)
- {
- if (factory == null)
- {
- throw new ArgumentNullException("factory");
- }
-
- _encoderFactories.Add(factory);
- }
-
- public void Register(IMessageDecoder decoder)
- {
- Register(new SingletonMessageDecoderFactory(decoder));
- }
-
- public void Register(IMessageDecoderFactory factory)
- {
- if (factory == null)
- {
- throw new ArgumentNullException("factory");
- }
- _decoderFactories.Add(factory);
- }
-
- public IProtocolEncoder Encoder
- {
- get
- {
- return new ProtocolEncoderImpl(this);
- }
- }
-
- public IProtocolDecoder Decoder
- {
- get
- {
- return new ProtocolDecoderImpl(this);
- }
- }
-
- protected void DisposeCodecResources()
- {
- // Do nothing by default
- }
-
- private class ProtocolEncoderImpl : IProtocolEncoder
- {
- private readonly Hashtable _encoders = new Hashtable();
-
- private DemuxingProtocolCodecFactory _enclosing;
-
- public ProtocolEncoderImpl(DemuxingProtocolCodecFactory enclosing)
- {
- _enclosing = enclosing;
- ArrayList encoderFactories = enclosing._encoderFactories;
- for (int i = encoderFactories.Count - 1; i >= 0; i--)
- {
- IMessageEncoder encoder = ((IMessageEncoderFactory)encoderFactories[i]).NewEncoder();
- foreach (Type type in encoder.MessageTypes.Keys)
- {
- _encoders[type] = encoder;
- }
- }
- }
-
- public void Encode(object message, IProtocolEncoderOutput output)
- {
- Type type = message.GetType();
- IMessageEncoder encoder = FindEncoder(type);
- if (encoder == null)
- {
- throw new ProtocolEncoderException("Unexpected message type: " + type);
- }
-
- encoder.Encode(message, output);
- }
-
- private IMessageEncoder FindEncoder(Type type)
- {
- IMessageEncoder encoder = (IMessageEncoder)_encoders[type];
- if (encoder == null)
- {
- encoder = FindEncoder(type, new Hashtable());
- }
-
- return encoder;
- }
-
- private IMessageEncoder FindEncoder(Type type, Hashtable triedClasses)
- {
- IMessageEncoder encoder;
-
- if (triedClasses.Contains(type))
- {
- return null;
- }
- triedClasses[type] = 1;
-
- encoder = (IMessageEncoder)_encoders[type];
- if (encoder == null)
- {
- encoder = FindEncoder(type, triedClasses);
- if (encoder != null)
- {
- return encoder;
- }
-
- Type[] interfaces = type.GetInterfaces();
- for (int i = 0; i < interfaces.Length; i++)
- {
- encoder = FindEncoder(interfaces[i], triedClasses);
- if (encoder != null)
- {
- return encoder;
- }
- }
-
- return null;
- }
- else
- return encoder;
- }
-
- public void Dispose()
- {
- _enclosing.DisposeCodecResources();
- }
- }
-
- private class ProtocolDecoderImpl : CumulativeProtocolDecoder
- {
- private readonly IMessageDecoder[] _decoders;
- private IMessageDecoder _currentDecoder;
- private DemuxingProtocolCodecFactory _enclosing;
-
- public ProtocolDecoderImpl(DemuxingProtocolCodecFactory enclosing)
- {
- _enclosing = enclosing;
- ArrayList decoderFactories = _enclosing._decoderFactories;
- _decoders = new IMessageDecoder[decoderFactories.Count];
- for (int i = decoderFactories.Count - 1; i >= 0; i--)
- {
- _decoders[i] = ((IMessageDecoderFactory) decoderFactories[i]).NewDecoder();
- }
- }
-
- protected override bool DoDecode(ByteBuffer input, IProtocolDecoderOutput output)
- {
- MessageDecoderResult result;
- if (_currentDecoder == null)
- {
- IMessageDecoder[] decoders = _decoders;
- int undecodables = 0;
-
- for (int i = decoders.Length - 1; i >= 0; i --)
- {
- IMessageDecoder decoder = decoders[i];
- int limit = input.Limit;
- int pos = input.Position;
-
- try
- {
- result = decoder.Decodable(input);
- }
- finally
- {
- input.Position = pos;
- input.Limit = limit;
- }
-
- if (result == MessageDecoderResult.OK)
- {
- _currentDecoder = decoder;
- break;
- }
- else if(result == MessageDecoderResult.NOT_OK)
- {
- undecodables ++;
- }
- else if (result != MessageDecoderResult.NEED_DATA)
- {
- throw new Exception("Unexpected decode result (see your decodable()): " + result);
- }
- }
-
- if (undecodables == _decoders.Length)
- {
- // Throw an exception if all decoders cannot decode data.
- input.Position = input.Limit; // Skip data
- throw new ProtocolDecoderException(
- "No appropriate message decoder: " + input.GetHexDump());
- }
-
- if (_currentDecoder == null)
- {
- // Decoder is not determined yet (i.e. we need more data)
- return false;
- }
- }
-
- result = _currentDecoder.Decode(input, output);
- if (result == MessageDecoderResult.OK)
- {
- _currentDecoder = null;
- return true;
- }
- else if (result == MessageDecoderResult.NEED_DATA)
- {
- return false;
- }
- else if (result == MessageDecoderResult.NOT_OK)
- {
- throw new ProtocolDecoderException("Message decoder returned NOT_OK.");
- }
- else
- {
- throw new Exception("Unexpected decode result (see your decode()): " + result);
- }
- }
- }
-
- private class SingletonMessageEncoderFactory : IMessageEncoderFactory
- {
- private readonly IMessageEncoder _encoder;
-
- public SingletonMessageEncoderFactory(IMessageEncoder encoder)
- {
- if (encoder == null)
- {
- throw new ArgumentNullException("encoder");
- }
- _encoder = encoder;
- }
-
- public IMessageEncoder NewEncoder()
- {
- return _encoder;
- }
- }
-
- private class SingletonMessageDecoderFactory : IMessageDecoderFactory
- {
- private readonly IMessageDecoder _decoder;
-
- public SingletonMessageDecoderFactory(IMessageDecoder decoder)
- {
- if (decoder == null)
- {
- throw new ArgumentNullException("decoder");
- }
- _decoder = decoder;
- }
-
- public IMessageDecoder NewDecoder()
- {
- return _decoder;
- }
- }
-
- private class DefaultConstructorMessageEncoderFactory : IMessageEncoderFactory
- {
- private readonly Type _encoderClass;
-
- public DefaultConstructorMessageEncoderFactory(Type encoderClass)
- {
- if (encoderClass == null)
- {
- throw new ArgumentNullException("encoderClass");
- }
-
- if(!typeof(IMessageEncoder).IsAssignableFrom(encoderClass))
- {
- throw new ArgumentException("encoderClass is not assignable to MessageEncoder");
- }
- _encoderClass = encoderClass;
- }
-
- public IMessageEncoder NewEncoder()
- {
- try
- {
- return (IMessageEncoder) Activator.CreateInstance(_encoderClass);
- }
- catch (Exception e)
- {
- throw new Exception( "Failed to create a new instance of " + _encoderClass, e);
- }
- }
- }
-
- private class DefaultConstructorMessageDecoderFactory : IMessageDecoderFactory
- {
- private readonly Type _decoderClass;
-
- public DefaultConstructorMessageDecoderFactory(Type decoderClass)
- {
- if (decoderClass == null)
- {
- throw new ArgumentNullException("decoderClass");
- }
-
- if(!typeof(IMessageDecoder).IsAssignableFrom(decoderClass))
- {
- throw new ArgumentException("decoderClass is not assignable to MessageDecoder");
- }
- _decoderClass = decoderClass;
- }
-
- public IMessageDecoder NewDecoder()
- {
- try
- {
- return (IMessageDecoder) Activator.CreateInstance(_decoderClass);
- }
- catch (Exception e)
- {
- throw new Exception("Failed to create a new instance of " + _decoderClass, e);
- }
- }
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs
deleted file mode 100644
index 5892673440..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs
+++ /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.
- *
- */
-using System;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Codec.Demux
-{
- public interface IMessageDecoder
- {
- /// <summary>
- /// Checks the specified buffer is decodable by this decoder.
- /// </summary>
- /// <param name="buffer">The buffer to read data from.</param>
- /// <returns>
- /// OK if this decoder can decode the specified buffer.
- /// NOT_OK if this decoder cannot decode the specified buffer.
- /// if more data is required to determine if the
- /// specified buffer is decodable ({@link #OK}) or not decodable
- /// {@link #NOT_OK}.</returns>
- MessageDecoderResult Decodable(ByteBuffer buffer);
-
- /// <summary>
- /// Decodes binary or protocol-specific content into higher-level message objects.
- /// MINA invokes {@link #decode(IoSession, ByteBuffer, ProtocolDecoderOutput)}
- /// method with read data, and then the decoder implementation puts decoded
- /// messages into {@link ProtocolDecoderOutput}.
- /// </summary>
- /// <returns>
- /// {@link #OK} if you finished decoding messages successfully.
- /// {@link #NEED_DATA} if you need more data to finish decoding current message.
- /// {@link #NOT_OK} if you cannot decode current message due to protocol specification violation.
- /// </returns>
- /// <exception cref="Exception">if the read data violated protocol specification </exception>
- MessageDecoderResult Decode(ByteBuffer buffer, IProtocolDecoderOutput output);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs
deleted file mode 100644
index 9e333d670f..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs
+++ /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.
- *
- */
-namespace Apache.Qpid.Codec.Demux
-{
- public interface IMessageDecoderFactory
- {
- /// <summary>
- /// Creates a new message decoder.
- /// </summary>
- IMessageDecoder NewDecoder();
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs
deleted file mode 100644
index 75ae23592b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs
+++ /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.
- *
- */
-using System;
-using System.Collections;
-
-namespace Apache.Qpid.Codec.Demux
-{
- public interface IMessageEncoder
- {
- /// <summary>
- /// Returns the set of message classes this encoder can encode.
- /// </summary>
- Hashtable MessageTypes
- {
- get;
- }
-
- /// <summary>
- /// Encodes higher-level message objects into binary or protocol-specific data.
- /// MINA invokes {@link #encode(IoSession, Object, ProtocolEncoderOutput)}
- /// method with message which is popped from the session write queue, and then
- /// the encoder implementation puts encoded {@link ByteBuffer}s into
- /// {@link ProtocolEncoderOutput}.
- /// </summary>
- /// <exception cref="Exception">if the message violated protocol specification</exception>
- void Encode(Object message, IProtocolEncoderOutput output);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs
deleted file mode 100644
index 3001d1a963..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs
+++ /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.
- *
- */
-namespace Apache.Qpid.Codec.Demux
-{
- public interface IMessageEncoderFactory
- {
- /// <summary>
- /// Creates a new message encoder.
- /// </summary>
- IMessageEncoder NewEncoder();
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs
deleted file mode 100644
index ab01864bc0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/Demux/MessageDecoderResult.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.Codec.Demux
-{
- public enum MessageDecoderResult
- {
- OK, NOT_OK, NEED_DATA
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolCodecFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolCodecFactory.cs
deleted file mode 100644
index a26b91b16c..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolCodecFactory.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.Codec
-{
- public interface IProtocolCodecFactory
- {
- IProtocolEncoder Encoder
- {
- get;
- }
-
- IProtocolDecoder Decoder
- {
- get;
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolDecoder.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolDecoder.cs
deleted file mode 100644
index 3cccb0f7da..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolDecoder.cs
+++ /dev/null
@@ -1,41 +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;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Codec
-{
- public interface IProtocolDecoder : IDisposable
- {
- /// <summary>
- /// Decodes binary or protocol-specific content into higher-level message objects.
- /// MINA invokes {@link #decode(IoSession, ByteBuffer, ProtocolDecoderOutput)}
- /// method with read data, and then the decoder implementation puts decoded
- /// messages into {@link ProtocolDecoderOutput}.
- /// </summary>
- /// <param name="input"></param>
- /// <param name="output"></param>
- /// <exception cref="Exception">if the read data violated protocol specification</exception>
- void Decode(ByteBuffer input, IProtocolDecoderOutput output);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolDecoderOutput.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolDecoderOutput.cs
deleted file mode 100644
index 77a1aea9db..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolDecoderOutput.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.Codec
-{
- public interface IProtocolDecoderOutput
- {
- /// <summary>
- /// Callback for {@link ProtocolDecoder} to generate decoded messages.
- /// {@link ProtocolDecoder} must call {@link #write(Object)} for each
- /// decoded messages.
- /// </summary>
- /// <param name="message">the decoded message</param>
- void Write(object message);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolEncoder.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolEncoder.cs
deleted file mode 100644
index a16f2ad9d6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolEncoder.cs
+++ /dev/null
@@ -1,41 +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;
-
-namespace Apache.Qpid.Codec
-{
- public interface IProtocolEncoder : IDisposable
- {
- /// <summary>
- /// Encodes higher-level message objects into binary or protocol-specific data.
- /// MINA invokes {@link #encode(IoSession, Object, ProtocolEncoderOutput)}
- /// method with message which is popped from the session write queue, and then
- /// the encoder implementation puts encoded {@link ByteBuffer}s into
- /// {@link ProtocolEncoderOutput}.
- /// </summary>
- /// <param name="message"></param>
- /// <param name="output"></param>
- /// <exception cref="Exception">if the message violated protocol specification</exception>
- void Encode(Object message, IProtocolEncoderOutput output);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolEncoderOutput.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolEncoderOutput.cs
deleted file mode 100644
index 70f9be38dc..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/IProtocolEncoderOutput.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.
- *
- */
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Codec
-{
- public interface IProtocolEncoderOutput
- {
- /// <summary>
- /// Callback for {@link ProtocolEncoder} to generate encoded
- /// {@link ByteBuffer}s. {@link ProtocolEncoder} must call
- /// {@link #write(ByteBuffer)} for each decoded messages.
- /// </summary>
- /// <param name="buf">the buffer which contains encoded data</param>
- void Write(ByteBuffer buf);
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs
deleted file mode 100644
index 4729dc6ab8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-using System.Reflection;
-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.Codec")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.Codec")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("8bfe84f8-cd88-48f7-b0d2-0010411a14e5")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolCodecException.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolCodecException.cs
deleted file mode 100644
index 49678d2c11..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolCodecException.cs
+++ /dev/null
@@ -1,49 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Codec
-{
- [Serializable]
- public class ProtocolCodecException : Exception
- {
- public ProtocolCodecException() : base()
- {
- }
-
- public ProtocolCodecException(string message) : base(message)
- {
- }
-
- public ProtocolCodecException(Exception cause) : base("Codec Exception", cause)
- {
- }
-
- protected ProtocolCodecException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolDecoderException.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolDecoderException.cs
deleted file mode 100644
index 8e7e6da145..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolDecoderException.cs
+++ /dev/null
@@ -1,70 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Codec
-{
- [Serializable]
- public class ProtocolDecoderException : ProtocolCodecException
- {
- private string _hexdump;
-
- public ProtocolDecoderException() : base()
- {
- }
-
- public ProtocolDecoderException(string message) : base(message)
- {
- }
-
- public ProtocolDecoderException(Exception cause) : base(cause)
- {
- }
-
- protected ProtocolDecoderException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- _hexdump = info.GetString("HexDump");
- }
-
- public string HexDump
- {
- get
- {
- return _hexdump;
- }
- set
- {
- _hexdump = value;
- }
- }
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData(info, context);
- info.AddValue("HexDump", _hexdump);
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolEncoderException.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolEncoderException.cs
deleted file mode 100644
index ac565a308b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/ProtocolEncoderException.cs
+++ /dev/null
@@ -1,49 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Codec
-{
- [Serializable]
- public class ProtocolEncoderException : ProtocolCodecException
- {
- public ProtocolEncoderException() : base()
- {
- }
-
- public ProtocolEncoderException(string message) : base(message)
- {
- }
-
- public ProtocolEncoderException(Exception cause) : base(cause)
- {
- }
-
- protected ProtocolEncoderException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/Qpid.Codec.csproj b/M4-RCs/qpid/dotnet/Qpid.Codec/Qpid.Codec.csproj
deleted file mode 100644
index a0217cffa3..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/Qpid.Codec.csproj
+++ /dev/null
@@ -1,82 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Codec</RootNamespace>
- <AssemblyName>Apache.Qpid.Codec</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\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\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="log4net, Version=1.2.0.30714, Culture=neutral, PublicKeyToken=500ffcafb14f92df">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Qpid.Common\lib\log4net\log4net.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Buffer\Qpid.Buffer.csproj">
- <Project>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</Project>
- <Name>Qpid.Buffer</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs
deleted file mode 100644
index 0a4ff10ff0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs
+++ /dev/null
@@ -1,44 +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.Collections;
-
-namespace Apache.Qpid.Codec.Support
-{
- public class SimpleProtocolDecoderOutput : IProtocolDecoderOutput
- {
- private readonly Queue _messageQueue = new Queue();
-
- public Queue MessageQueue
- {
- get
- {
- return _messageQueue;
- }
- }
-
- public void Write(object message)
- {
- _messageQueue.Enqueue(message);
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs b/M4-RCs/qpid/dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs
deleted file mode 100644
index 2e4224ef98..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs
+++ /dev/null
@@ -1,43 +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.Collections;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Codec.Support
-{
- public abstract class SimpleProtocolEncoderOutput : IProtocolEncoderOutput
- {
- private readonly Queue _bufferQueue = new Queue();
-
- public Queue BufferQueue
- {
- get
- {
- return _bufferQueue;
- }
- }
-
- public void Write(ByteBuffer buf)
- {
- _bufferQueue.Enqueue(buf);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Codec/default.build b/M4-RCs/qpid/dotnet/Qpid.Codec/default.build
deleted file mode 100644
index dd59df7d6a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Codec/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Apache.Qpid.Codec" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/Apache.Qpid.Buffer.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index b67ca8ea8b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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.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.Common.Tests")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.Common.Tests")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("2c0d906c-375d-4b04-8ad0-a22fcb4e7337")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid.Common.Tests.csproj b/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid.Common.Tests.csproj
deleted file mode 100644
index c99217cc51..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid.Common.Tests.csproj
+++ /dev/null
@@ -1,87 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{F83624B0-762B-4D82-900D-FF4C1B36E36E}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Tests</RootNamespace>
- <AssemblyName>Apache.Qpid.Common.Tests</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <UseVSHostingProcess>true</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\bin\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="nunit.framework, Version=2.2.6.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Qpid.Client.Tests\lib\nunit\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Buffer\Qpid.Buffer.csproj">
- <Project>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</Project>
- <Name>Qpid.Buffer</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Common\Qpid.Common.csproj">
- <Project>{77064C42-24D2-4CEB-9EA2-0EF481A43205}</Project>
- <Name>Qpid.Common</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Collections/TestConsumerProducerQueue.cs b/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Collections/TestConsumerProducerQueue.cs
deleted file mode 100644
index 03ed999999..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Collections/TestConsumerProducerQueue.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.
- *
- */
-using System;
-using System.Collections;
-using System.Text;
-using System.Threading;
-using NUnit.Framework;
-using Apache.Qpid.Collections;
-
-namespace Apache.Qpid.Collections.Tests
-{
- [TestFixture]
- public class TestConsumerProducerQueue
- {
- private ConsumerProducerQueue _queue;
-
- [SetUp]
- public void SetUp()
- {
- _queue = new ConsumerProducerQueue();
- }
-
- [Test]
- public void CanDequeueWithInifiniteWait()
- {
- Thread producer = new Thread(new ThreadStart(ProduceFive));
- producer.Start();
- for ( int i = 0; i < 5; i++ )
- {
- object item = _queue.Dequeue();
- Assert.IsNotNull(item);
- }
- }
-
- [Test]
- public void ReturnsNullOnDequeueTimeout()
- {
- // queue is empty
- Assert.IsNull(_queue.Dequeue(500));
- }
-
- [Test]
- public void DequeueTillEmpty()
- {
- _queue.Enqueue(1);
- _queue.Enqueue(2);
- _queue.Enqueue(3);
- Assert.AreEqual(1, _queue.Dequeue());
- Assert.AreEqual(2, _queue.Dequeue());
- Assert.AreEqual(3, _queue.Dequeue());
- // no messages in queue, will timeout
- Assert.IsNull(_queue.Dequeue(500));
- }
-
-
- private void ProduceFive()
- {
- Thread.Sleep(1000);
- _queue.Enqueue("test item 1");
- _queue.Enqueue("test item 2");
- _queue.Enqueue("test item 3");
- Thread.Sleep(0);
- _queue.Enqueue("test item 4");
- _queue.Enqueue("test item 5");
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Collections/TestLinkedHashtable.cs b/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Collections/TestLinkedHashtable.cs
deleted file mode 100644
index dbbc98a2e6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Collections/TestLinkedHashtable.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.
- *
- */
-using System;
-using System.Collections;
-using System.Text;
-using NUnit.Framework;
-
-namespace Apache.Qpid.Collections
-{
- [TestFixture]
- public class TestLinkedHashtable
- {
- [Test]
- public void Test1()
- {
- LinkedHashtable table = new LinkedHashtable();
- table["Super"] = "Ayr";
- table["Ayr"] = "United";
- table["Fred"] = "Wilma";
- table["Dumbarton"] = "Gubbed";
- dumpDictionary(table);
-
- Console.WriteLine("\nRemoving XXX (non-existant)");
- table.Remove("XXX");
- dumpDictionary(table);
-
- Console.WriteLine("\nRemoving Fred");
- table.Remove("Fred");
- dumpDictionary(table);
-
- Console.WriteLine("\nMoving Dumbarton to head");
- table.MoveToHead("Dumbarton");
- dumpDictionary(table);
- }
-
- private static void dumpDictionary(LinkedHashtable table)
- {
- foreach (DictionaryEntry o in table)
- {
- Console.WriteLine(string.Format("Item: key={0} value={1}", o.Key, o.Value));
- }
-
- Console.WriteLine("keys are " + InspectCollection(table.Keys));
- Console.WriteLine("values are " + InspectCollection(table.Values));
- }
-
- static string InspectCollection(ICollection collection)
- {
- StringBuilder sb = null;
- foreach (object o in collection)
- {
- if (sb == null)
- {
- sb = new StringBuilder(o.ToString());
- }
- else
- {
- sb.Append(", ");
- sb.Append(o.ToString());
- }
- }
- return sb.ToString();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Framing/TestAMQType.cs b/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Framing/TestAMQType.cs
deleted file mode 100644
index ab4cb4409c..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Framing/TestAMQType.cs
+++ /dev/null
@@ -1,270 +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;
-using NUnit.Framework;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Framing.Tests
-{
- [TestFixture]
- public class TestAMQType
- {
-
- #region LONG_STRING tests
- [Test]
- public void LONG_STRING_ReadWrite()
- {
- AMQType type = AMQType.LONG_STRING;
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- const string VALUE = "simple string 1";
-
- type.WriteToBuffer(VALUE, buffer);
- buffer.Flip();
- buffer.Rewind();
- AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- Assert.AreEqual(VALUE, value.Value);
- }
- #endregion // LONG_STRING tests
-
- #region UINT32 tests
- [Test]
- public void UINT32_CanGetEncodingSize()
- {
- AMQType type = AMQType.UINT32;
- Assert.AreEqual(4, type.GetEncodingSize(1234443));
- }
-
- [Test]
- public void UINT32_ToNativeValue()
- {
- AMQType type = AMQType.UINT32;
- Assert.AreEqual(1, type.ToNativeValue(1));
- Assert.AreEqual(1, type.ToNativeValue((short)1));
- Assert.AreEqual(1, type.ToNativeValue((byte)1));
- Assert.AreEqual(1, type.ToNativeValue("1"));
-
- try
- {
- Assert.AreEqual(1, type.ToNativeValue("adasdads"));
- Assert.Fail("Invalid format allowed");
- } catch ( FormatException )
- {
- }
- }
-
- [Test]
- public void UINT32_ReadWrite()
- {
- AMQType type = AMQType.UINT32;
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- const uint VALUE = 0xFFEEDDCC;
-
- type.WriteToBuffer(VALUE, buffer);
- buffer.Flip();
- buffer.Rewind();
- AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- Assert.AreEqual(VALUE, value.Value);
- }
- #endregion // UINT32 Tests
-
- #region VOID Tests
- [Test]
- public void VOID_CanGetEncodingSize()
- {
- AMQType type = AMQType.VOID;
- Assert.AreEqual(0, type.GetEncodingSize(null));
- }
-
- [Test]
- public void VOID_ToNativeValue()
- {
- AMQType type = AMQType.VOID;
- Assert.IsNull(type.ToNativeValue(null));
-
- try
- {
- type.ToNativeValue("asdasd");
- Assert.Fail("converted invalid value");
- } catch (FormatException)
- {
- }
- }
-
- [Test]
- public void VOID_ReadWrite()
- {
- AMQType type = AMQType.VOID;
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
-
- type.WriteToBuffer(null, buffer);
- buffer.Flip();
- buffer.Rewind();
- AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- Assert.AreEqual(null, value.Value);
- }
-
- #endregion // VOID Tests
-
- #region BOOLEAN Tests
- [Test]
- public void BOOLEAN_CanGetEncodingSize()
- {
- AMQType type = AMQType.BOOLEAN;
- Assert.AreEqual(1, type.GetEncodingSize(true));
- }
-
- [Test]
- public void BOOLEAN_ToNativeValue()
- {
- AMQType type = AMQType.BOOLEAN;
- Assert.AreEqual(true, type.ToNativeValue(true));
- Assert.AreEqual(false, type.ToNativeValue("false"));
-
- try
- {
- type.ToNativeValue("asdasd");
- Assert.Fail("converted invalid value");
- } catch ( FormatException )
- {
- }
- }
-
- [Test]
- public void BOOLEAN_ReadWrite()
- {
- AMQType type = AMQType.BOOLEAN;
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
-
- type.WriteToBuffer(true, buffer);
- buffer.Flip();
- buffer.Rewind();
- AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- Assert.AreEqual(true, value.Value);
- }
- #endregion // BOOLEAN Tests
-
- #region INT16 tests
- [Test]
- public void INT16_ReadWrite()
- {
- AMQType type = AMQType.INT16;
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- const short VALUE = -32765;
-
- type.WriteToBuffer(VALUE, buffer);
- buffer.Flip();
- buffer.Rewind();
- AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- Assert.AreEqual(VALUE, value.Value);
- }
- //public void UINT16_ReadWrite()
- //{
- // AMQType type = AMQType.UINT16;
- // ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- // const ushort VALUE = 64321;
-
- // type.WriteToBuffer(VALUE, buffer);
- // buffer.Flip();
- // buffer.Rewind();
- // AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- // Assert.AreEqual(VALUE, value.Value);
- //}
- #endregion // INT16 Tests
-
- #region INT32 tests
- [Test]
- public void INT32_ReadWrite()
- {
- AMQType type = AMQType.INT32;
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- const int VALUE = -39273563;
-
- type.WriteToBuffer(VALUE, buffer);
- buffer.Flip();
- buffer.Rewind();
- AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- Assert.AreEqual(VALUE, value.Value);
- }
- #endregion // INT32 Tests
-
- #region INT64 tests
- [Test]
- public void INT64_ReadWrite()
- {
- AMQType type = AMQType.INT64;
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- const long VALUE = -(2^43+1233123);
-
- type.WriteToBuffer(VALUE, buffer);
- buffer.Flip();
- buffer.Rewind();
- AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- Assert.AreEqual(VALUE, value.Value);
- }
- [Test]
- public void UINT64_ReadWrite()
- {
- AMQType type = AMQType.UINT64;
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- const ulong VALUE = (2 ^ 61 + 1233123);
-
- type.WriteToBuffer(VALUE, buffer);
- buffer.Flip();
- buffer.Rewind();
- AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- Assert.AreEqual(VALUE, value.Value);
- }
- #endregion // INT64 Tests
-
- #region FLOAT tests
- [Test]
- public void FLOAT_ReadWrite()
- {
- AMQType type = AMQType.FLOAT;
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- const float VALUE = 1.2345000E-035f;
-
- type.WriteToBuffer(VALUE, buffer);
- buffer.Flip();
- buffer.Rewind();
- AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- Assert.AreEqual(VALUE, value.Value);
- }
- #endregion // FLOAT Tests
-
- #region DOUBLE tests
- [Test]
- public void DOUBLE_ReadWrite()
- {
- AMQType type = AMQType.DOUBLE;
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- const double VALUE = 1.2345000E-045;
-
- type.WriteToBuffer(VALUE, buffer);
- buffer.Flip();
- buffer.Rewind();
- AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- Assert.AreEqual(VALUE, value.Value);
- }
- #endregion // FLOAT Tests
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Framing/TestEncodingUtils.cs b/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Framing/TestEncodingUtils.cs
deleted file mode 100644
index 720d7697d3..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/Qpid/Framing/TestEncodingUtils.cs
+++ /dev/null
@@ -1,60 +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;
-using NUnit.Framework;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Framing;
-
-namespace Apache.Qpid.Framing.Tests
-{
- [TestFixture]
- public class TestEncodingUtils
- {
- [Test]
- public void CanReadLongAsShortString()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- EncodingUtils.WriteShortStringBytes(buffer, "98878122");
- buffer.Flip();
- long value = EncodingUtils.ReadLongAsShortString(buffer);
- Assert.AreEqual(98878122, value);
- }
- [Test]
- public void CanReadLongAsShortStringNegative()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- EncodingUtils.WriteShortStringBytes(buffer, "-98878122");
- buffer.Flip();
- long value = EncodingUtils.ReadLongAsShortString(buffer);
- Assert.AreEqual(-98878122, value);
- }
- [Test]
- public void CanReadLongAsShortStringEmpty()
- {
- ByteBuffer buffer = ByteBuffer.Allocate(0x1000);
- EncodingUtils.WriteShortStringBytes(buffer, "");
- buffer.Flip();
- long value = EncodingUtils.ReadLongAsShortString(buffer);
- Assert.AreEqual(0, value);
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/default.build b/M4-RCs/qpid/dotnet/Qpid.Common.Tests/default.build
deleted file mode 100644
index a97c0282c2..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common.Tests/default.build
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Apache.Qpid.Common" default="test">
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- warnaserror="true" debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.Tests.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/nunit.framework.dll" />
- <include name="${build.dir}/${project::get-name()}.dll" />
- <include name="${build.dir}/Apache.Qpid.Codec.dll" />
- <include name="${build.dir}/Apache.Qpid.Messaging.dll" />
- <include name="${build.dir}/Apache.Qpid.Buffer.dll" />
- </references>
-
- </csc>
- </target>
- <target name="test" depends="build">
- <nunit2>
- <formatter type="${nant.formatter}" usefile="false" />
- <test assemblyname="${build.dir}/${project::get-name()}.Tests.dll" />
- </nunit2>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/AMQChannelClosedException.cs b/M4-RCs/qpid/dotnet/Qpid.Common/AMQChannelClosedException.cs
deleted file mode 100644
index 98c6966cd1..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/AMQChannelClosedException.cs
+++ /dev/null
@@ -1,40 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid
-{
- [Serializable]
- public class AMQChannelClosedException : AMQException
- {
- public AMQChannelClosedException(int errorCode, string message)
- : base(errorCode, message)
- {
- }
-
- protected AMQChannelClosedException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/AMQConnectionClosedException.cs b/M4-RCs/qpid/dotnet/Qpid.Common/AMQConnectionClosedException.cs
deleted file mode 100644
index 136131144b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/AMQConnectionClosedException.cs
+++ /dev/null
@@ -1,51 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid
-{
- /// <summary>
- /// AMQConnectionClosedException indicates that a connection has been closed.
- ///
- /// <p/>This exception is really used as an event, in order that the method handler that raises it creates an event
- /// which is propagated to the io handler, in order to notify it of the connection closure.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Represents a the closure of a connection.
- /// </table>
- /// </summary>
- [Serializable]
- public class AMQConnectionClosedException : AMQException
- {
- public AMQConnectionClosedException(int errorCode, string message)
- : base(errorCode, message)
- {
- }
-
- protected AMQConnectionClosedException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/AMQDisconnectedException.cs b/M4-RCs/qpid/dotnet/Qpid.Common/AMQDisconnectedException.cs
deleted file mode 100644
index b5c4d544cd..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/AMQDisconnectedException.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.
- *
- */
-
-using System;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid
-{
- [Serializable]
- public class AMQDisconnectedException : AMQException
- {
- public AMQDisconnectedException(int errorCode, string message)
- : base(errorCode, message)
- {
- }
-
- public AMQDisconnectedException(string message)
- : base(message)
- {
- }
-
- protected AMQDisconnectedException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/AMQException.cs b/M4-RCs/qpid/dotnet/Qpid.Common/AMQException.cs
deleted file mode 100644
index f9f7158a26..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/AMQException.cs
+++ /dev/null
@@ -1,149 +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;
-using System.Runtime.Serialization;
-using log4net;
-
-namespace Apache.Qpid
-{
- /// <summary>
- /// The generic AMQ exception.
- /// </summary>
- [Serializable]
- public class AMQException : Exception
- {
- private int _errorCode;
-
- public AMQException(string message)
- : base(message)
- {
- }
-
- public AMQException(string message, Exception innerException)
- : base(message, innerException)
- {
- }
-
- public AMQException(int errorCode, string message)
- : base(message)
- {
- _errorCode = errorCode;
- }
-
- public AMQException(int errorCode, string message, Exception innerException)
- : base(message, innerException)
- {
- _errorCode = errorCode;
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="T:AMQException"/> class, with a logger that will
- /// be used to output log information upon construction. This saves having to log separately.
- /// </summary>
- /// <param name="logger">The logger.</param>
- /// <param name="message">The message.</param>
- public AMQException(ILog logger, string message)
- : base(message)
- {
- logger.Error(message);
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="T:AMQException"/> class, with a logger that will
- /// be used to output log information upon construction. This saves having to log separately.
- /// </summary>
- /// <param name="logger">The logger.</param>
- /// <param name="message">The message.</param>
- /// <param name="innerException">The root cause</param>
- public AMQException(ILog logger, string message, Exception innerException)
- : base(message, innerException)
- {
- logger.Error(message, innerException);
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="T:AMQException"/> class, with a logger that will
- /// be used to output log information upon construction. This saves having to log separately.
- /// </summary>
- /// <param name="logger">The logger.</param>
- /// <param name="message">The message.</param>
- /// <param name="errorCode">The AMQ error code. See RFC 006 for details of error codes</param>
- public AMQException(ILog logger, int errorCode, string message)
- : this(errorCode, message)
- {
- logger.Error(message);
- }
-
- /// <summary>
- /// Initializes a new instance of the <see cref="T:AMQException"/> class, with a logger that will
- /// be used to output log information upon construction. This saves having to log separately.
- /// </summary>
- /// <param name="logger">The logger.</param>
- /// <param name="message">The message.</param>
- /// <param name="errorCode">The AMQ error code. See RFC 006 for details of error codes</param>
- /// <param name="innerException">The root cause</param>
- public AMQException(ILog logger, int errorCode, string message, Exception innerException)
- : this(errorCode, message, innerException)
- {
- logger.Error(message, innerException);
- }
-
- /// <summary>
- /// Serialization Constructor
- /// </summary>
- /// <param name="info">SerializationInfo object</param>
- /// <param name="ctxt">StreamingContext object</param>
- protected AMQException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- _errorCode = info.GetInt32("ErrorCode");
- }
-
- /// <summary>
- /// ISerializable implementation of GetObjectData()
- /// </summary>
- /// <param name="info">SerializationInfo object</param>
- /// <param name="ctxt">StreamingContext object</param>
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData(info, context);
- info.AddValue("ErrorCode", _errorCode);
- }
-
-
- /// <summary>
- /// Gets or sets the error code. See RFC 006 for details of error codes.
- /// </summary>
- /// <value>The error code.</value>
- public int ErrorCode
- {
- get
- {
- return _errorCode;
- }
- set
- {
- _errorCode = value;
- }
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/AMQInvalidArgumentException.cs b/M4-RCs/qpid/dotnet/Qpid.Common/AMQInvalidArgumentException.cs
deleted file mode 100644
index 0fb4ddae99..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/AMQInvalidArgumentException.cs
+++ /dev/null
@@ -1,46 +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;
-using System.Runtime.Serialization;
-
-using Apache.Qpid.Protocol;
-
-namespace Apache.Qpid
-{
- /// <summary>
- /// Thrown when an invalid argument was supplied to the broker
- /// </summary>
- [Serializable]
- public class AMQInvalidArgumentException : AMQException
- {
- public AMQInvalidArgumentException(string message)
- : base(AMQConstant.INVALID_ARGUMENT.Code, message, null)
- {
- }
-
- protected AMQInvalidArgumentException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/AMQInvalidRoutingKeyException.cs b/M4-RCs/qpid/dotnet/Qpid.Common/AMQInvalidRoutingKeyException.cs
deleted file mode 100644
index 3f8dead94d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/AMQInvalidRoutingKeyException.cs
+++ /dev/null
@@ -1,46 +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;
-using System.Runtime.Serialization;
-
-using Apache.Qpid.Protocol;
-
-namespace Apache.Qpid
-{
- /// <summary>
- /// Thrown when an invalid routing key was sent to the broker
- /// </summary>
- [Serializable]
- public class AMQInvalidRoutingKeyException : AMQException
- {
- public AMQInvalidRoutingKeyException(string message)
- : base(AMQConstant.INVALID_ROUTING_KEY.Code, message, null)
- {
- }
-
- protected AMQInvalidRoutingKeyException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/AMQUndeliveredException.cs b/M4-RCs/qpid/dotnet/Qpid.Common/AMQUndeliveredException.cs
deleted file mode 100644
index 70ad86c8a3..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/AMQUndeliveredException.cs
+++ /dev/null
@@ -1,59 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid
-{
- /// <summary>
- /// Thrown when a message has been bounced by the broker, indicating it could not be delivered.
- /// </summary>
- [Serializable]
- public class AMQUndeliveredException : AMQException
- {
- // TODO: Warning, no guarantee that the value stored here is serializable!
- private object _bounced;
-
- public AMQUndeliveredException(int errorCode, string message, object bounced)
- : base(errorCode, message)
- {
- _bounced = bounced;
- }
-
- protected AMQUndeliveredException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- _bounced = info.GetValue("bounced", typeof(object));
- }
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData(info, context);
- info.AddValue("bounced", _bounced);
- }
-
- public object GetUndeliveredMessage()
- {
- return _bounced;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/AssemblySettings.cs b/M4-RCs/qpid/dotnet/Qpid.Common/AssemblySettings.cs
deleted file mode 100644
index 888de692e8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/AssemblySettings.cs
+++ /dev/null
@@ -1,160 +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;
-using System.Collections;
-using System.Configuration;
-using System.IO;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Xml;
-using log4net;
-
-namespace Apache.Qpid.Common
-{
- /// <summary>
- ///
- /// Mike Woodring
- /// Bear Canyon Consulting LLC
- /// http://www.bearcanyon.com
- ///
- /// AssemblySettings usage:
- ///
- /// If you know the keys you're after, the following is probably
- /// the most convenient:
- ///
- /// AssemblySettings settings = new AssemblySettings();
- /// string someSetting1 = settings["someKey1"];
- /// string someSetting2 = settings["someKey2"];
- ///
- /// If you want to enumerate over the settings (or just as an
- /// alternative approach), you can do this too:
- ///
- /// IDictionary settings = AssemblySettings.GetConfig();
- ///
- /// foreach( DictionaryEntry entry in settings )
- /// {
- /// // Use entry.Key or entry.Value as desired...
- /// }
- ///
- /// In either of the above two scenarios, the calling assembly
- /// (the one that called the constructor or GetConfig) is used
- /// to determine what file to parse and what the name of the
- /// settings collection element is. For example, if the calling
- /// assembly is c:\foo\bar\TestLib.dll, then the configuration file
- /// that's parsed is c:\foo\bar\TestLib.dll.config, and the
- /// configuration section that's parsed must be named <assemblySettings>.
- ///
- /// To retrieve the configuration information for an arbitrary assembly,
- /// use the overloaded constructor or GetConfig method that takes an
- /// Assembly reference as input.
- ///
- /// If your assembly is being automatically downloaded from a web
- /// site by an "href-exe" (an application that's run directly from a link
- /// on a web page), then the enclosed web.config shows the mechanism
- /// for allowing the AssemblySettings library to download the
- /// configuration files you're using for your assemblies (while not
- /// allowing web.config itself to be downloaded).
- ///
- /// If the assembly you are trying to use this with is installed in, and loaded
- /// from, the GAC then you'll need to place the config file in the GAC directory where
- /// the assembly is installed. On the first release of the CLR, this directory is
- /// <windir>\assembly\gac\libName\verNum__pubKeyToken]]>. For example,
- /// the assembly "SomeLib, Version=1.2.3.4, Culture=neutral, PublicKeyToken=abcd1234"
- /// would be installed to the c:\winnt\assembly\gac\SomeLib\1.2.3.4__abcd1234 diretory
- /// (assuming the OS is installed in c:\winnt). For future versions of the CLR, this
- /// directory scheme may change, so you'll need to check the <code>CodeBase</code> property
- /// of a GAC-loaded assembly in the debugger to determine the correct directory location.
- ///
- /// </summary>
- public class AssemblySettings
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(AssemblySettings));
-
- private IDictionary settings;
-
- [MethodImpl(MethodImplOptions.NoInlining)]
- public AssemblySettings()
- : this(Assembly.GetCallingAssembly())
- {
- }
-
- public AssemblySettings(Assembly asm)
- {
- settings = GetConfig(asm);
- }
-
- public string this[string key]
- {
- get
- {
- string settingValue = null;
-
- if (settings != null)
- {
- settingValue = settings[key] as string;
- }
-
- return (settingValue == null ? "" : settingValue);
- }
- }
-
- public static IDictionary GetConfig()
- {
- return GetConfig(Assembly.GetCallingAssembly());
- }
-
- public static IDictionary GetConfig(Assembly asm)
- {
- // Open and parse configuration file for specified
- // assembly, returning collection to caller for future
- // use outside of this class.
- string cfgFile = asm.CodeBase + ".config";
- try
- {
- const string nodeName = "assemblySettings";
-
- XmlDocument doc = new XmlDocument();
- doc.Load(new XmlTextReader(cfgFile));
-
- XmlNodeList nodes = doc.GetElementsByTagName(nodeName);
-
- foreach (XmlNode node in nodes)
- {
- if (node.LocalName == nodeName)
- {
- DictionarySectionHandler handler = new DictionarySectionHandler();
- return (IDictionary)handler.Create(null, null, node);
- }
- }
- }
- catch (FileNotFoundException)
- {
- _log.Warn("Assembly configuration file not found: " + cfgFile);
- }
- catch (Exception e)
- {
- _log.Warn("Failed to load .config file: " + cfgFile, e);
- }
-
- return null;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Collections/BlockingQueue.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Collections/BlockingQueue.cs
deleted file mode 100644
index dcfacf8474..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Collections/BlockingQueue.cs
+++ /dev/null
@@ -1,95 +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;
-using System.Collections;
-
-namespace Apache.Qpid.Collections
-{
- public abstract class BlockingQueue : Queue
- {
- /**
- * Inserts the specified element into this queue if it is possible to do
- * so immediately without violating capacity restrictions, returning
- * <tt>true</tt> upon success and <tt>false</tt> if no space is currently
- * available. When using a capacity-restricted queue, this method is
- * generally preferable to {@link #add}, which can fail to insert an
- * element only by throwing an exception.
- *
- * @param e the element to add
- * @return <tt>true</tt> if the element was added to this queue, else
- * <tt>false</tt>
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this queue
- */
- public abstract bool EnqueueNoThrow(Object e);
-
- /**
- * Inserts the specified element into this queue, waiting if necessary
- * for space to become available.
- *
- * @param e the element to add
- * @throws InterruptedException if interrupted while waiting
- * @throws ClassCastException if the class of the specified element
- * prevents it from being added to this queue
- * @throws NullPointerException if the specified element is null
- * @throws IllegalArgumentException if some property of the specified
- * element prevents it from being added to this queue
- */
- public abstract void EnqueueBlocking(object e);
-
- /**
- * Retrieves and removes the head of this queue, waiting up to the
- * specified wait time if necessary for an element to become available.
- *
- * @param timeout how long to wait before giving up, in units of
- * <tt>unit</tt>
- * @param unit a <tt>TimeUnit</tt> determining how to interpret the
- * <tt>timeout</tt> parameter
- * @return the head of this queue, or <tt>null</tt> if the
- * specified waiting time elapses before an element is available
- * @throws InterruptedException if interrupted while waiting
- */
- public abstract object DequeueBlocking();
-
- /**
- * Returns the number of additional elements that this queue can ideally
- * (in the absence of memory or resource constraints) accept without
- * blocking, or <tt>Integer.MAX_VALUE</tt> if there is no intrinsic
- * limit.
- *
- * <p>Note that you <em>cannot</em> always tell if an attempt to insert
- * an element will succeed by inspecting <tt>remainingCapacity</tt>
- * because it may be the case that another thread is about to
- * insert or remove an element.
- *
- * @return the remaining capacity
- */
- public abstract int RemainingCapacity
- {
- get;
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Collections/ConsumerProducerQueue.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Collections/ConsumerProducerQueue.cs
deleted file mode 100644
index ea4526faaf..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Collections/ConsumerProducerQueue.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.
- *
- */
-using System;
-using System.Collections;
-using System.Threading;
-
-
-namespace Apache.Qpid.Collections
-{
- /// <summary>
- /// Simple FIFO queue to support multi-threaded consumer
- /// and producers. It supports timeouts in dequeue operations.
- /// </summary>
- public sealed class ConsumerProducerQueue
- {
- private Queue _queue = new Queue();
- private WaitSemaphore _semaphore = new WaitSemaphore();
-
- /// <summary>
- /// Put an item into the tail of the queue
- /// </summary>
- /// <param name="item"></param>
- public void Enqueue(object item)
- {
- lock ( _queue.SyncRoot )
- {
- _queue.Enqueue(item);
- _semaphore.Increment();
- }
- }
-
- /// <summary>
- /// Wait indefinitely for an item to be available
- /// on the queue.
- /// </summary>
- /// <returns>The object at the head of the queue</returns>
- public object Dequeue()
- {
- return Dequeue(Timeout.Infinite);
- }
-
- /// <summary>
- /// Wait up to the number of milliseconds specified
- /// for an item to be available on the queue
- /// </summary>
- /// <param name="timeout">Number of milliseconds to wait</param>
- /// <returns>The object at the head of the queue, or null
- /// if the timeout expires</returns>
- public object Dequeue(long timeout)
- {
- if ( _semaphore.Decrement(timeout) )
- {
- lock ( _queue.SyncRoot )
- {
- return _queue.Dequeue();
- }
- }
- return null;
- }
-
- #region Simple Semaphore
- //
- // Simple Semaphore
- //
-
- class WaitSemaphore
- {
- private int _count;
- private AutoResetEvent _event = new AutoResetEvent(false);
-
- public void Increment()
- {
- Interlocked.Increment(ref _count);
- _event.Set();
- }
-
- public bool Decrement(long timeout)
- {
- if ( timeout > int.MaxValue )
- throw new ArgumentOutOfRangeException("timeout", timeout, "Must be <= Int32.MaxValue");
-
- int millis = (int) (timeout & 0x7FFFFFFF);
- if ( Interlocked.Decrement(ref _count) > 0 )
- {
- // there are messages in queue, so no need to wait
- return true;
- } else
- {
- return _event.WaitOne(millis, false);
- }
- }
- }
- #endregion // Simple Semaphore
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Collections/LinkedBlockingQueue.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Collections/LinkedBlockingQueue.cs
deleted file mode 100644
index be92576951..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Collections/LinkedBlockingQueue.cs
+++ /dev/null
@@ -1,384 +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;
-using System.Threading;
-
-namespace Apache.Qpid.Collections
-{
- public class LinkedBlockingQueue : BlockingQueue
- {
-
- /*
- * A variant of the "two lock queue" algorithm. The putLock gates
- * entry to put (and offer), and has an associated condition for
- * waiting puts. Similarly for the takeLock. The "count" field
- * that they both rely on is maintained as an atomic to avoid
- * needing to get both locks in most cases. Also, to minimize need
- * for puts to get takeLock and vice-versa, cascading notifies are
- * used. When a put notices that it has enabled at least one take,
- * it signals taker. That taker in turn signals others if more
- * items have been entered since the signal. And symmetrically for
- * takes signalling puts. Operations such as remove(Object) and
- * iterators acquire both locks.
- */
-
- /**
- * Linked list node class
- */
- internal class Node
- {
- /** The item, volatile to ensure barrier separating write and read */
- internal volatile Object item;
- internal Node next;
- internal Node(Object x) { item = x; }
- }
-
- /** The capacity bound, or Integer.MAX_VALUE if none */
- private readonly int capacity;
-
- /** Current number of elements */
- private volatile int count = 0;
-
- /** Head of linked list */
- private Node head;
-
- /** Tail of linked list */
- private Node last;
-
- /** Lock held by take, poll, etc */
- private readonly object takeLock = new Object(); //new SerializableLock();
-
- /** Lock held by put, offer, etc */
- private readonly object putLock = new Object();//new SerializableLock();
-
- /**
- * Signals a waiting take. Called only from put/offer (which do not
- * otherwise ordinarily lock takeLock.)
- */
- private void SignalNotEmpty()
- {
- lock (takeLock)
- {
- Monitor.Pulse(takeLock);
- }
- }
-
- /**
- * Signals a waiting put. Called only from take/poll.
- */
- private void SignalNotFull()
- {
- lock (putLock)
- {
- Monitor.Pulse(putLock);
- }
- }
-
- /**
- * Creates a node and links it at end of queue.
- * @param x the item
- */
- private void Insert(Object x)
- {
- last = last.next = new Node(x);
- }
-
- /**
- * Removes a node from head of queue,
- * @return the node
- */
- private Object Extract()
- {
- Node first = head.next;
- head = first;
- Object x = first.item;
- first.item = null;
- return x;
- }
-
-
- /**
- * Creates a <tt>LinkedBlockingQueue</tt> with a capacity of
- * {@link Integer#MAX_VALUE}.
- */
- public LinkedBlockingQueue() : this(Int32.MaxValue)
- {
- }
-
- /**
- * Creates a <tt>LinkedBlockingQueue</tt> with the given (fixed) capacity.
- *
- * @param capacity the capacity of this queue
- * @throws IllegalArgumentException if <tt>capacity</tt> is not greater
- * than zero
- */
- public LinkedBlockingQueue(int capacity)
- {
- if (capacity <= 0) throw new ArgumentException("Capacity must be positive, was passed " + capacity);
- this.capacity = capacity;
- last = head = new Node(null);
- }
-
- // this doc comment is overridden to remove the reference to collections
- // greater in size than Integer.MAX_VALUE
- /**
- * Returns the number of elements in this queue.
- *
- * @return the number of elements in this queue
- */
- public int Size
- {
- get
- {
- return count;
- }
- }
-
- // this doc comment is a modified copy of the inherited doc comment,
- // without the reference to unlimited queues.
- /**
- * Returns the number of additional elements that this queue can ideally
- * (in the absence of memory or resource constraints) accept without
- * blocking. This is always equal to the initial capacity of this queue
- * less the current <tt>size</tt> of this queue.
- *
- * <p>Note that you <em>cannot</em> always tell if an attempt to insert
- * an element will succeed by inspecting <tt>remainingCapacity</tt>
- * because it may be the case that another thread is about to
- * insert or remove an element.
- */
- public override int RemainingCapacity
- {
- get
- {
- return capacity - count;
- }
- }
-
- /**
- * Inserts the specified element at the tail of this queue, waiting if
- * necessary for space to become available.
- *
- * @throws InterruptedException {@inheritDoc}
- * @throws NullPointerException {@inheritDoc}
- */
- public override void EnqueueBlocking(Object e)
- {
- if (e == null) throw new ArgumentNullException("Object must not be null");
- // Note: convention in all put/take/etc is to preset
- // local var holding count negative to indicate failure unless set.
- int c = -1;
- lock (putLock)
- {
- /*
- * Note that count is used in wait guard even though it is
- * not protected by lock. This works because count can
- * only decrease at this point (all other puts are shut
- * out by lock), and we (or some other waiting put) are
- * signalled if it ever changes from
- * capacity. Similarly for all other uses of count in
- * other wait guards.
- */
- while (count == capacity)
- {
- Monitor.Wait(putLock);
- }
-
- Insert(e);
- lock(this)
- {
- c = count++;
- }
- if (c + 1 < capacity)
- {
- Monitor.Pulse(putLock);
- }
- }
-
- if (c == 0)
- {
- SignalNotEmpty();
- }
- }
-
- /**
- * Inserts the specified element at the tail of this queue if it is
- * possible to do so immediately without exceeding the queue's capacity,
- * returning <tt>true</tt> upon success and <tt>false</tt> if this queue
- * is full.
- * When using a capacity-restricted queue, this method is generally
- * preferable to method {@link BlockingQueue#add add}, which can fail to
- * insert an element only by throwing an exception.
- *
- * @throws NullPointerException if the specified element is null
- */
- public override bool EnqueueNoThrow(Object e)
- {
- if (e == null) throw new ArgumentNullException("e must not be null");
- if (count == capacity)
- {
- return false;
- }
- int c = -1;
- lock (putLock)
- {
- if (count < capacity)
- {
- Insert(e);
- lock (this)
- {
- c = count++;
- }
- if (c + 1 < capacity)
- {
- Monitor.Pulse(putLock);
- }
- }
- }
- if (c == 0)
- {
- SignalNotEmpty();
- }
- return c >= 0;
- }
-
- /**
- * Retrieves and removes the head of this queue, waiting if necessary
- * until an element becomes available.
- *
- * @return the head of this queue
- * @throws InterruptedException if interrupted while waiting
- */
- public override Object DequeueBlocking()
- {
- Object x;
- int c = -1;
- lock (takeLock)
- {
-
- while (count == 0)
- {
- Monitor.Wait(takeLock);
- }
-
-
- x = Extract();
- lock (this) { c = count--; }
- if (c > 1)
- {
- Monitor.Pulse(takeLock);
- }
- }
- if (c == capacity)
- {
- SignalNotFull();
- }
- return x;
- }
-
- public Object Poll()
- {
- if (count == 0)
- {
- return null;
- }
- Object x = null;
- int c = -1;
- lock (takeLock)
- {
- if (count > 0)
- {
- x = Extract();
- lock (this) { c = count--; }
- if (c > 1)
- {
- Monitor.Pulse(takeLock);
- }
- }
- }
- if (c == capacity)
- {
- SignalNotFull();
- }
- return x;
- }
-
-
- public override Object Peek()
- {
- if (count == 0)
- {
- return null;
- }
- lock (takeLock)
- {
- Node first = head.next;
- if (first == null)
- {
- return null;
- }
- else
- {
- return first.item;
- }
- }
- }
-
- public override String ToString()
- {
- lock (putLock)
- {
- lock (takeLock)
- {
- return base.ToString();
- }
- }
- }
-
- /**
- * Atomically removes all of the elements from this queue.
- * The queue will be empty after this call returns.
- */
- public override void Clear()
- {
- lock (putLock)
- {
- lock (takeLock)
- {
- head.next = null;
- last = head;
- int c;
- lock (this)
- {
- c = count;
- count = 0;
- }
- if (c == capacity)
- {
- Monitor.PulseAll(putLock);
- }
- }
- }
- }
- }
-}
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Collections/LinkedHashtable.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Collections/LinkedHashtable.cs
deleted file mode 100644
index 10ab5c674d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Collections/LinkedHashtable.cs
+++ /dev/null
@@ -1,327 +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;
-using System.Collections;
-
-namespace Apache.Qpid.Collections
-{
- public class LinkedHashtable : IDictionary
- {
- /// <summary>
- /// Maps from key to LinkedDictionaryEntry
- /// </summary>
- private Hashtable _indexedValues = new Hashtable();
-
- private LinkedDictionaryEntry _head;
-
- private LinkedDictionaryEntry _tail;
-
- private class LinkedDictionaryEntry
- {
- public LinkedDictionaryEntry _previous;
- public LinkedDictionaryEntry _next;
- internal DictionaryEntry _entry;
-
- public LinkedDictionaryEntry(object key, object value)
- {
- _entry = new DictionaryEntry(key, value);
- }
- }
-
- public object this[object key]
- {
- get
- {
- LinkedDictionaryEntry entry = (LinkedDictionaryEntry)_indexedValues[key];
- if (entry == null)
- {
- return null; // key not found
- }
- else
- {
- return entry._entry.Value;
- }
- }
-
- set
- {
- LinkedDictionaryEntry entry = (LinkedDictionaryEntry)_indexedValues[key];
- if (entry == null)
- {
- Add(key, value);
- }
- else
- {
- entry._entry.Value = value;
- }
- }
- }
-
- /// <summary>
- /// Collect keys in linked order.
- /// </summary>
- public ICollection Keys
- {
- get
- {
- IList result = new ArrayList();
- foreach (DictionaryEntry entry in this)
- {
- result.Add(entry.Key);
- }
- return result;
- }
- }
-
- /// <summary>
- /// Collect values in linked order.
- /// </summary>
- public ICollection Values
- {
- get
- {
- IList result = new ArrayList();
- foreach (DictionaryEntry entry in this)
- {
- result.Add(entry.Value);
- }
- return result;
- }
- }
-
- public bool IsReadOnly
- {
- get { return _indexedValues.IsReadOnly; }
- }
-
- public bool IsFixedSize
- {
- get { return _indexedValues.IsFixedSize; }
- }
-
- public bool Contains(object key)
- {
- return _indexedValues.Contains(key);
- }
-
- public void Add(object key, object value)
- {
- if (key == null) throw new ArgumentNullException("key");
-
- if (Contains(key))
- {
- throw new ArgumentException("LinkedHashtable already contains key. key=" + key);
- }
-
- LinkedDictionaryEntry de = new LinkedDictionaryEntry(key, value);
- if (_head == null)
- {
- _head = de;
- _tail = de;
- }
- else
- {
- _tail._next = de;
- de._previous = _tail;
- _tail = de;
- }
- _indexedValues[key] = de;
- }
-
- public void Clear()
- {
- _indexedValues.Clear();
- }
-
- IDictionaryEnumerator IDictionary.GetEnumerator()
- {
- return new LHTEnumerator(this);
- }
-
- public void Remove(object key)
- {
- if (key == null) throw new ArgumentNullException("key");
-
- LinkedDictionaryEntry de = (LinkedDictionaryEntry)_indexedValues[key];
- if (de == null) return; // key not found.
- LinkedDictionaryEntry prev = de._previous;
- if (prev == null)
- {
- _head = de._next;
- }
- else
- {
- prev._next = de._next;
- }
-
- LinkedDictionaryEntry next = de._next;
- if (next == null)
- {
- _tail = de;
- }
- else
- {
- next._previous = de._previous;
- }
- }
-
- private LinkedDictionaryEntry Head
- {
- get
- {
- return _head;
- }
- }
-
-// private LinkedDictionaryEntry Tail
-// {
-// get
-// {
-// return _tail;
-// }
-// }
-
- private class LHTEnumerator : IDictionaryEnumerator
- {
- private LinkedHashtable _container;
-
- private LinkedDictionaryEntry _current;
-
- /// <summary>
- /// Set once we have navigated off the end of the collection
- /// </summary>
- private bool _needsReset = false;
-
- public LHTEnumerator(LinkedHashtable container)
- {
- _container = container;
- }
-
- public object Current
- {
- get
- {
- if (_current == null)
- {
- throw new Exception("Iterator before first element");
- }
- else
- {
- return _current._entry;
- }
- }
- }
-
- public object Key
- {
- get { return _current._entry.Key; }
- }
-
- public object Value
- {
- get { return _current._entry.Value; }
- }
-
- public DictionaryEntry Entry
- {
- get
- {
- return _current._entry;
- }
- }
-
- public bool MoveNext()
- {
- if (_needsReset)
- {
- return false;
- }
- else if (_current == null)
- {
- _current = _container.Head;
- }
- else
- {
- _current = _current._next;
- }
- _needsReset = (_current == null);
- return !_needsReset;
- }
-
- public void Reset()
- {
- _current = null;
- _needsReset = false;
- }
- }
-
- public void MoveToHead(object key)
- {
- LinkedDictionaryEntry de = (LinkedDictionaryEntry)_indexedValues[key];
- if (de == null)
- {
- throw new ArgumentException("Key " + key + " not found");
- }
- // if the head is the element then there is nothing to do
- if (_head == de)
- {
- return;
- }
- de._previous._next = de._next;
- if (de._next != null)
- {
- de._next._previous = de._previous;
- }
- else
- {
- _tail = de._previous;
- }
- de._next = _head;
- _head = de;
- de._previous = null;
- }
-
- public void CopyTo(Array array, int index)
- {
- _indexedValues.CopyTo(array, index);
- }
-
- public int Count
- {
- get { return _indexedValues.Count; }
- }
-
- public object SyncRoot
- {
- get { return _indexedValues.SyncRoot; }
- }
-
- public bool IsSynchronized
- {
- get { return _indexedValues.IsSynchronized; }
- }
-
- public IEnumerator GetEnumerator()
- {
- return new LHTEnumerator(this);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Collections/SynchronousQueue.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Collections/SynchronousQueue.cs
deleted file mode 100644
index 3c12df6067..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Collections/SynchronousQueue.cs
+++ /dev/null
@@ -1,375 +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;
-using System.Threading;
-
-namespace Apache.Qpid.Collections
-{
- public class SynchronousQueue : BlockingQueue
- {
- /// <summary>
- /// Lock protecting both wait queues
- /// </summary>
-// private readonly object _qlock = new object();
-
- /// <summary>
- /// Queue holding waiting puts
- /// </summary>
-// private readonly WaitQueue _waitingProducers;
-
- /// <summary>
- /// Queue holding waiting takes
- /// </summary>
-// private readonly WaitQueue _waitingConsumers;
-
- /**
- * Queue to hold waiting puts/takes; specialized to Fifo/Lifo below.
- * These queues have all transient fields, but are serializable
- * in order to recover fairness settings when deserialized.
- */
- internal abstract class WaitQueue
- {
- /** Creates, adds, and returns node for x. */
- internal abstract Node Enq(Object x);
- /** Removes and returns node, or null if empty. */
- internal abstract Node Deq();
- /** Removes a cancelled node to avoid garbage retention. */
- internal abstract void Unlink(Node node);
- /** Returns true if a cancelled node might be on queue. */
- internal abstract bool ShouldUnlink(Node node);
- }
-
- /**
- * FIFO queue to hold waiting puts/takes.
- */
- sealed class FifoWaitQueue : WaitQueue
- {
- private Node head;
- private Node last;
-
- internal override Node Enq(Object x)
- {
- Node p = new Node(x);
- if (last == null)
- {
- last = head = p;
- }
- else
- {
- last = last.next = p;
- }
- return p;
- }
-
- internal override Node Deq()
- {
- Node p = head;
- if (p != null)
- {
- if ((head = p.next) == null)
- {
- last = null;
- }
- p.next = null;
- }
- return p;
- }
-
- internal override bool ShouldUnlink(Node node)
- {
- return (node == last || node.next != null);
- }
-
- internal override void Unlink(Node node)
- {
- Node p = head;
- Node trail = null;
- while (p != null)
- {
- if (p == node)
- {
- Node next = p.next;
- if (trail == null)
- {
- head = next;
- }
- else
- {
- trail.next = next;
- }
- if (last == node)
- {
- last = trail;
- }
- break;
- }
- trail = p;
- p = p.next;
- }
- }
- }
-
- /**
- * LIFO queue to hold waiting puts/takes.
- */
- sealed class LifoWaitQueue : WaitQueue
- {
- private Node head;
-
- internal override Node Enq(Object x)
- {
- return head = new Node(x, head);
- }
-
- internal override Node Deq()
- {
- Node p = head;
- if (p != null)
- {
- head = p.next;
- p.next = null;
- }
- return p;
- }
-
- internal override bool ShouldUnlink(Node node)
- {
- // Return false if already dequeued or is bottom node (in which
- // case we might retain at most one garbage node)
- return (node == head || node.next != null);
- }
-
- internal override void Unlink(Node node)
- {
- Node p = head;
- Node trail = null;
- while (p != null)
- {
- if (p == node)
- {
- Node next = p.next;
- if (trail == null)
- head = next;
- else
- trail.next = next;
- break;
- }
- trail = p;
- p = p.next;
- }
- }
- }
-
- /**
- * Nodes each maintain an item and handle waits and signals for
- * getting and setting it. The class extends
- * AbstractQueuedSynchronizer to manage blocking, using AQS state
- * 0 for waiting, 1 for ack, -1 for cancelled.
- */
- sealed internal class Node
- {
-
- /** Synchronization state value representing that node acked */
- private const int ACK = 1;
- /** Synchronization state value representing that node cancelled */
- private const int CANCEL = -1;
-
- internal int state = 0;
-
- /** The item being transferred */
- internal Object item;
- /** Next node in wait queue */
- internal Node next;
-
- /** Creates a node with initial item */
- internal Node(Object x)
- {
- item = x;
- }
-
- /** Creates a node with initial item and next */
- internal Node(Object x, Node n)
- {
- item = x;
- next = n;
- }
-
- /**
- * Takes item and nulls out field (for sake of GC)
- *
- * PRE: lock owned
- */
- private Object Extract()
- {
- Object x = item;
- item = null;
- return x;
- }
-
- /**
- * Tries to cancel on interrupt; if so rethrowing,
- * else setting interrupt state
- *
- * PRE: lock owned
- */
- /*private void checkCancellationOnInterrupt(InterruptedException ie)
- throws InterruptedException
- {
- if (state == 0) {
- state = CANCEL;
- notify();
- throw ie;
- }
- Thread.currentThread().interrupt();
- }*/
-
- /**
- * Fills in the slot created by the consumer and signal consumer to
- * continue.
- */
- internal bool SetItem(Object x)
- {
- lock (this)
- {
- if (state != 0) return false;
- item = x;
- state = ACK;
- Monitor.Pulse(this);
- return true;
- }
- }
-
- /**
- * Removes item from slot created by producer and signal producer
- * to continue.
- */
- internal Object GetItem()
- {
- if (state != 0) return null;
- state = ACK;
- Monitor.Pulse(this);
- return Extract();
- }
-
- /**
- * Waits for a consumer to take item placed by producer.
- */
- internal void WaitForTake() //throws InterruptedException {
- {
- while (state == 0)
- {
- Monitor.Wait(this);
- }
- }
-
- /**
- * Waits for a producer to put item placed by consumer.
- */
- internal object WaitForPut()
- {
- lock (this)
- {
- while (state == 0) Monitor.Wait(this);
- }
- return Extract();
- }
-
- private bool Attempt(long nanos)
- {
- if (state != 0) return true;
- if (nanos <= 0) {
- state = CANCEL;
- Monitor.Pulse(this);
- return false;
- }
-
- while (true)
- {
- Monitor.Wait(nanos);
- //TimeUnit.NANOSECONDS.timedWait(this, nanos);
- if (state != 0)
- {
- return true;
- }
- //nanos = deadline - Utils.nanoTime();
- //if (nanos <= 0)
- else
- {
- state = CANCEL;
- Monitor.Pulse(this);
- return false;
- }
- }
- }
-
- /**
- * Waits for a consumer to take item placed by producer or time out.
- */
- internal bool WaitForTake(long nanos)
- {
- return Attempt(nanos);
- }
-
- /**
- * Waits for a producer to put item placed by consumer, or time out.
- */
- internal object WaitForPut(long nanos)
- {
- if (!Attempt(nanos))
- {
- return null;
- }
- else
- {
- return Extract();
- }
- }
- }
-
- public SynchronousQueue(bool strict)
- {
- // TODO !!!!
- }
-
- public override bool EnqueueNoThrow(object e)
- {
- throw new NotImplementedException();
- }
-
- public override void EnqueueBlocking(object e)
- {
- throw new NotImplementedException();
- }
-
- public override object DequeueBlocking()
- {
- throw new NotImplementedException();
- }
-
- public override int RemainingCapacity
- {
- get
- {
- throw new NotImplementedException();
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQDataBlockDecoder.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQDataBlockDecoder.cs
deleted file mode 100644
index 7867650e50..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQDataBlockDecoder.cs
+++ /dev/null
@@ -1,155 +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;
-using System.Collections;
-using log4net;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Codec;
-using Apache.Qpid.Codec.Demux;
-
-namespace Apache.Qpid.Framing
-{
- public class AMQDataBlockDecoder : IMessageDecoder
- {
- private static ILog _logger = LogManager.GetLogger(typeof(AMQDataBlockDecoder));
-
- private Hashtable _supportedBodies = new Hashtable();
-
- private bool _disabled = false;
-
- public AMQDataBlockDecoder()
- {
- _supportedBodies[AMQMethodBody.TYPE] = AMQMethodBodyFactory.GetInstance();
- _supportedBodies[ContentHeaderBody.TYPE] = ContentHeaderBodyFactory.GetInstance();
- _supportedBodies[ContentBody.TYPE] = ContentBodyFactory.GetInstance();
- _supportedBodies[HeartbeatBody.TYPE] = new HeartbeatBodyFactory();
- }
-
- public MessageDecoderResult Decodable(ByteBuffer input)
- {
- if (_disabled)
- {
- return MessageDecoderResult.NOT_OK;
- }
- // final +1 represents the command end which we know we must require even
- // if there is an empty body
- if (input.Remaining < 1)
- {
- return MessageDecoderResult.NEED_DATA;
- }
- byte type = input.GetByte();
-
- // we have to check this isn't a protocol initiation frame here - we can't tell later on and we end up
- // waiting for more data. This could be improved if MINA supported some kind of state awareness when decoding
- if ((char)type == 'A')
- {
- _logger.Error("Received what appears to be a protocol initiation frame");
- return MessageDecoderResult.NOT_OK;
- }
- // zero, channel, body size and end byte
- if (input.Remaining < (1 + 2 + 4 + 1))
- {
- return MessageDecoderResult.NEED_DATA;
- }
-
- int channel = input.GetUInt16();
- long bodySize = input.GetUInt32();
-
- // bodySize can be zero
- if (type <= 0 || channel < 0 || bodySize < 0)
- {
- _logger.Error(String.Format("Error decoding frame: Type={0}, Channel={1}, BodySize={2}", type, channel, bodySize));
- return MessageDecoderResult.NOT_OK;
- }
-
- if (input.Remaining < (bodySize + 1))
- {
- return MessageDecoderResult.NEED_DATA;
- }
-
- if (IsSupportedFrameType(type))
- {
- if (_logger.IsDebugEnabled)
- {
- // we have read 7 bytes so far, so output 7 + bodysize + 1 (for end byte) to get complete data block size
- // this logging statement is useful when looking at exactly what size of data is coming in/out
- // the broker
- _logger.Debug("Able to decode data block of size " + (bodySize + 8));
- }
- return MessageDecoderResult.OK;
- }
- else
- {
- return MessageDecoderResult.NOT_OK;
- }
- }
-
- private bool IsSupportedFrameType(byte frameType)
- {
- bool result = _supportedBodies.ContainsKey(frameType);
-
- if (!result)
- {
- _logger.Warn("AMQDataBlockDecoder does not handle frame type " + frameType);
- }
-
- return result;
- }
-
- protected Object CreateAndPopulateFrame(ByteBuffer input)
- {
- byte type = input.GetByte();
- ushort channel = input.GetUInt16();
- uint bodySize = input.GetUInt32();
-
- IBodyFactory bodyFactory = (IBodyFactory)_supportedBodies[type];
- if (bodyFactory == null)
- {
- throw new AMQFrameDecodingException("Unsupported body type: " + type);
- }
- AMQFrame frame = new AMQFrame();
-
- frame.PopulateFromBuffer(input, channel, bodySize, bodyFactory);
-
- byte marker = input.GetByte();
- if (marker != 0xCE) {
- throw new FormatException("marker is not 0xCE");
- }
- return frame;
- }
-
- public MessageDecoderResult Decode(ByteBuffer input, IProtocolDecoderOutput output)
- {
-
- output.Write(CreateAndPopulateFrame(input));
-
- return MessageDecoderResult.OK;
- }
-
- public bool Disabled
- {
- set
- {
- _disabled = value;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQDataBlockEncoder.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQDataBlockEncoder.cs
deleted file mode 100644
index e2645c630e..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQDataBlockEncoder.cs
+++ /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.
- *
- */
-using System.Collections;
-using log4net;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Codec;
-using Apache.Qpid.Codec.Demux;
-
-namespace Apache.Qpid.Framing
-{
- public class AMQDataBlockEncoder : IMessageEncoder
- {
- private static ILog _logger = LogManager.GetLogger(typeof(AMQDataBlockEncoder));
-
- private Hashtable _messageTypes;
-
- public AMQDataBlockEncoder()
- {
- _messageTypes = new Hashtable();
- _messageTypes[typeof (IEncodableAMQDataBlock)] = 1;
- }
-
-
- public Hashtable MessageTypes
- {
- get
- {
- return _messageTypes;
- }
- }
-
- public void Encode(object message, IProtocolEncoderOutput output)
- {
- IDataBlock frame = (IDataBlock) message;
- int frameSize = (int)frame.Size; // TODO: sort out signed/unsigned
- ByteBuffer buffer = ByteBuffer.Allocate(frameSize);
- frame.WritePayload(buffer);
-
- if (_logger.IsDebugEnabled)
- {
- _logger.Debug("Encoded frame byte-buffer is '" + ByteBufferHexDumper.GetHexDump(buffer) + "'");
- }
- buffer.Flip();
- output.Write(buffer);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQFrame.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQFrame.cs
deleted file mode 100644
index 912be72d30..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQFrame.cs
+++ /dev/null
@@ -1,107 +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 Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class AMQFrame : IDataBlock
- {
- private ushort _channel;
-
- private IBody _bodyFrame;
-
- public AMQFrame()
- {
- }
-
- public AMQFrame(ushort channel, IBody bodyFrame)
- {
- _channel = channel;
- _bodyFrame = bodyFrame;
- }
-
- public ushort Channel
- {
- get
- {
- return _channel;
- }
- set
- {
- _channel = value;
- }
- }
-
- public IBody BodyFrame
- {
- get
- {
- return _bodyFrame;
- }
- set
- {
- _bodyFrame = value;
- }
- }
-
- #region IDataBlock Members
-
- public uint Size
- {
- get
- {
- return (uint) (1 + 2 + 4 + _bodyFrame.Size + 1);
- }
- }
-
- public void WritePayload(ByteBuffer buffer)
- {
- buffer.Put(_bodyFrame.BodyType);
- // TODO: how does channel get populated
- buffer.Put(_channel);
- buffer.Put(_bodyFrame.Size);
- _bodyFrame.WritePayload(buffer);
- buffer.Put((byte) 0xCE);
- }
-
- #endregion
-
- /// <summary>
- /// Populates the frame instance data from the supplied buffer.
- /// </summary>
- /// <param name="buffer">The buffer.</param>
- /// <param name="channel">The channel.</param>
- /// <param name="bodySize">Size of the body in bytes</param>
- /// <param name="bodyFactory">The body factory.</param>
- /// <exception cref="AMQFrameDecodingException">Thrown if the buffer cannot be decoded</exception>
- public void PopulateFromBuffer(ByteBuffer buffer, ushort channel, uint bodySize, IBodyFactory bodyFactory)
- {
- _channel = channel;
- _bodyFrame = bodyFactory.CreateBody(buffer);
- _bodyFrame.PopulateFromBuffer(buffer, bodySize);
- }
-
- public override string ToString()
- {
- return "Frame channelId: " + _channel + ", bodyFrame: " + _bodyFrame.ToString();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQFrameDecodingException.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQFrameDecodingException.cs
deleted file mode 100644
index cda8c84ecf..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQFrameDecodingException.cs
+++ /dev/null
@@ -1,59 +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;
-using System.Runtime.Serialization;
-using log4net;
-
-namespace Apache.Qpid.Framing
-{
- /// <summary>
- /// Thrown when a frame cannot be decoded. This generally indicates a mismatch between the broker and the
- /// client.
- /// </summary>
- [Serializable]
- public class AMQFrameDecodingException : AMQException
- {
- public AMQFrameDecodingException(string message)
- : base(message)
- {
- }
-
- public AMQFrameDecodingException(string message, Exception innerException)
- : base(message, innerException)
- {
- }
-
- public AMQFrameDecodingException(ILog logger, string message)
- : base(logger, message)
- {
- }
-
- public AMQFrameDecodingException(ILog logger, string message, Exception innerException)
- : base(logger, message, innerException)
- {
- }
-
- protected AMQFrameDecodingException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQMethodBody.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQMethodBody.cs
deleted file mode 100644
index a3c4337147..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQMethodBody.cs
+++ /dev/null
@@ -1,93 +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;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public abstract class AMQMethodBody : IBody
- {
- public const byte TYPE = 1;
-
- protected abstract uint BodySize
- {
- get;
- }
-
- protected abstract ushort Clazz
- {
- get;
- }
-
- protected abstract ushort Method
- {
- get;
- }
-
- protected abstract void WriteMethodPayload(ByteBuffer buffer);
-
- public byte BodyType
- {
- get
- {
- return TYPE;
- }
- }
-
- public uint Size
- {
- get
- {
- return (uint) (2 + 2 + BodySize);
- }
- }
-
- public void WritePayload(ByteBuffer buffer)
- {
- buffer.Put(Clazz);
- buffer.Put(Method);
- WriteMethodPayload(buffer);
- }
-
- /// <summary>
- /// Populates the method body by decoding the specified buffer
- /// </summary>
- /// <param name="buffer">The buffer to decode.</param>
- /// <exception cref="AMQFrameDecodingException">If the buffer cannot be decoded</exception>
- protected abstract void PopulateMethodBodyFromBuffer(ByteBuffer buffer);
-
- /// <summary>
- /// Populates this instance from a buffer of data.
- /// </summary>
- /// <param name="buffer">The buffer.</param>
- /// <param name="size">The size.</param>
- /// <exception cref="AMQFrameDecodingException">If the buffer contains data that cannot be decoded</exception>
- public void PopulateFromBuffer(ByteBuffer buffer, uint size)
- {
- PopulateMethodBodyFromBuffer(buffer);
- }
-
- public override string ToString()
- {
- return String.Format("{0}{{ Class: {1} Method: {2} }}", GetType().Name, Clazz, Method);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQMethodBodyFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQMethodBodyFactory.cs
deleted file mode 100644
index c1fd3f887a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQMethodBodyFactory.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.
- *
- */
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class AMQMethodBodyFactory : IBodyFactory
- {
- private static readonly AMQMethodBodyFactory _instance = new AMQMethodBodyFactory();
-
- public static AMQMethodBodyFactory GetInstance()
- {
- return _instance;
- }
-
- /// <summary>
- /// Creates the body.
- /// </summary>
- /// <param name="inbuf">The ByteBuffer containing data from the network</param>
- /// <returns></returns>
- /// <exception>AMQFrameDecodingException</exception>
- public IBody CreateBody(ByteBuffer inbuf)
- {
- return MethodBodyDecoderRegistry.Get(inbuf.GetUInt16(), inbuf.GetUInt16());
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQProtocolHeaderException.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQProtocolHeaderException.cs
deleted file mode 100644
index 379e5d00ba..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQProtocolHeaderException.cs
+++ /dev/null
@@ -1,39 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Framing
-{
- [Serializable]
- public class AMQProtocolHeaderException : AMQException
- {
- public AMQProtocolHeaderException(string message) : base(message)
- {
- }
-
- protected AMQProtocolHeaderException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQType.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQType.cs
deleted file mode 100644
index 618ab31d32..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQType.cs
+++ /dev/null
@@ -1,700 +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;
-using System.Text;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- /// <summary>
- /// Base class for the Field Table Type system.
- /// Ported over from the Java AMQType enumeration
- /// </summary>
- public abstract class AMQType
- {
- private byte _identifier;
-
- /// <summary>
- /// Type code identifier for this type
- /// </summary>
- public byte Identifier
- {
- get { return _identifier; }
- }
-
- protected AMQType(char identifier)
- {
- _identifier = (byte)identifier;
- }
-
- /// <summary>
- /// Create a new <see cref="AMQTypedValue"/> instance
- /// </summary>
- /// <param name="value">Value to initialize with</param>
- /// <returns>A new typed value instance</returns>
- public AMQTypedValue AsTypedValue(object value)
- {
- return new AMQTypedValue(this, ToNativeValue(value));
- }
-
- /// <summary>
- /// Write the specified value to the buffer using the encoding
- /// specified for this type
- /// </summary>
- /// <param name="value">Value to write</param>
- /// <param name="buffer">Buffer to write to</param>
- public void WriteToBuffer(object value, ByteBuffer buffer)
- {
- buffer.Put(Identifier);
- WriteValueImpl(value, buffer);
- }
-
- public override string ToString()
- {
- return ((Char) Identifier).ToString();
- }
-
- /// <summary>
- /// Get the encoding size for the specified value in this type format
- /// </summary>
- /// <param name="value">Value to find encoded size for</param>
- /// <returns>The encoded size</returns>
- public abstract uint GetEncodingSize(object value);
- /// <summary>
- /// Convert the specified value to this type
- /// </summary>
- /// <param name="value">Value to convert</param>
- /// <returns>The converted value</returns>
- public abstract object ToNativeValue(object value);
-
- /// <summary>
- /// Read a value from the specified buffer using the encoding for
- /// this type
- /// </summary>
- /// <param name="buffer">Buffer to read from</param>
- /// <returns>The value read</returns>
- public abstract object ReadValueFromBuffer(ByteBuffer buffer);
-
- protected abstract void WriteValueImpl(Object value, ByteBuffer buffer);
-
-
- #region Known Types
- //
- // Known Types
- //
-
- // long string is not defined in the proposed specification,
- // and the 'S' discriminator is left for unsigned short (16-bit) values
- public static readonly AMQType LONG_STRING = new AMQLongStringType();
- public static readonly AMQType UINT32 = new AMQUInt32Type();
- public static readonly AMQType DECIMAL = new AMQDecimalType();
- public static readonly AMQType TIMESTAMP = new AMQTimeStampType();
- public static readonly AMQType FIELD_TABLE = new AMQFieldTableType();
- public static readonly AMQType VOID = new AMQVoidType();
- public static readonly AMQType BINARY = new AMQBinaryType();
- public static readonly AMQType ASCII_STRING = new AMQAsciiStringType();
- public static readonly AMQType WIDE_STRING = new AMQWideStringType();
- public static readonly AMQType BOOLEAN = new AMQBooleanType();
- public static readonly AMQType ASCII_CHARACTER = new AMQAsciiCharType();
- public static readonly AMQType BYTE = new AMQByteType();
- public static readonly AMQType SBYTE = new AMQSByteType();
- public static readonly AMQType INT16 = new AMQInt16Type();
- public static readonly AMQType UINT16 = new AMQUInt16Type();
- public static readonly AMQType INT32 = new AMQInt32Type();
- public static readonly AMQType INT64 = new AMQInt64Type();
- public static readonly AMQType UINT64 = new AMQUInt64Type();
- public static readonly AMQType FLOAT = new AMQFloatType();
- public static readonly AMQType DOUBLE = new AMQDoubleType();
-
- #endregion // Known Types
-
- #region Type Implementation
- //
- // Type Implementation
- //
-
- sealed class AMQLongStringType : AMQType
- {
- public AMQLongStringType() : base('S')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedLongStringLength((string) value);
- }
-
- public override object ToNativeValue(object value)
- {
- if ( value == null )
- throw new ArgumentNullException("value");
- return value.ToString();
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadLongString(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteLongStringBytes(buffer, (string) value);
- }
-
- }
-
- sealed class AMQUInt32Type : AMQType
- {
- public AMQUInt32Type() : base('i')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.UnsignedIntegerLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToUInt32(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadUnsignedInteger(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteUnsignedInteger(buffer, (uint) value);
- }
-
- }
-
- sealed class AMQDecimalType : AMQType
- {
- public AMQDecimalType() : base('D')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- throw new NotImplementedException();
- }
-
- public override object ToNativeValue(object value)
- {
- throw new NotImplementedException();
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- throw new NotImplementedException();
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- throw new NotImplementedException();
- }
- }
-
- sealed class AMQTimeStampType : AMQType
- {
- public AMQTimeStampType() : base('T')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- throw new NotImplementedException();
- }
-
- public override object ToNativeValue(object value)
- {
- throw new NotImplementedException();
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- throw new NotImplementedException();
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- throw new NotImplementedException();
- }
- }
-
- sealed class AMQFieldTableType : AMQType
- {
- public AMQFieldTableType() : base('F')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- throw new NotImplementedException();
- }
-
- public override object ToNativeValue(object value)
- {
- throw new NotImplementedException();
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- throw new NotImplementedException();
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- throw new NotImplementedException();
- }
- }
-
- sealed class AMQVoidType : AMQType
- {
- public AMQVoidType() : base('V')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return 0;
- }
-
- public override object ToNativeValue(object value)
- {
- if ( value != null )
- throw new FormatException(string.Format("Cannot convert {0} to VOID type", value));
- return null;
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return null;
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- }
- }
-
- // Extended Types
-
- sealed class AMQBinaryType : AMQType
- {
- public AMQBinaryType() : base('x')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedLongstrLength((byte[]) value);
- }
-
- public override object ToNativeValue(object value)
- {
- if ( value is byte[] || value == null )
- {
- return value;
- }
- throw new ArgumentException("Value cannot be converted to byte[]");
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadLongstr(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteLongstr(buffer, (byte[])value);
- }
- }
-
- sealed class AMQAsciiStringType : AMQType
- {
- public AMQAsciiStringType() : base('c')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedAsciiStringLength((string)value);
- }
-
- public override object ToNativeValue(object value)
- {
- if ( value == null )
- throw new ArgumentNullException("value");
- return value.ToString();
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadAsciiString(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteAsciiString(buffer, (string)value);
- }
- }
-
- sealed class AMQWideStringType : AMQType
- {
- // todo: Change encoding to UTF16 (java code still uses default
- // ascii encoding for wide strings
- private static readonly Encoding ENCODING = Encoding.ASCII;
-
- public AMQWideStringType()
- : base('C')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedLongStringLength((string)value, ENCODING);
- }
-
- public override object ToNativeValue(object value)
- {
- if ( value == null )
- throw new ArgumentNullException("value");
- return value.ToString();
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadLongString(buffer, ENCODING);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteLongStringBytes(buffer, (string)value, ENCODING);
- }
- }
-
- sealed class AMQBooleanType : AMQType
- {
- public AMQBooleanType() : base('t')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedBooleanLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToBoolean(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadBoolean(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteBoolean(buffer, (bool)value);
- }
- }
-
- sealed class AMQAsciiCharType : AMQType
- {
- public AMQAsciiCharType() : base('k')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedCharLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToChar(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadChar(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteChar(buffer, (char)value);
- }
- }
-
- sealed class AMQByteType : AMQType
- {
- public AMQByteType() : base('B')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedByteLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToByte(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadByte(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteByte(buffer, (byte)value);
- }
- }
-
- sealed class AMQSByteType : AMQType
- {
- public AMQSByteType()
- : base('b')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedSByteLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToSByte(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadSByte(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteSByte(buffer, (sbyte)value);
- }
- }
-
- sealed class AMQInt16Type : AMQType
- {
- public AMQInt16Type() : base('s')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedShortLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToInt16(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadShort(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteShort(buffer, (short)value);
- }
- }
-
- sealed class AMQUInt16Type : AMQType
- {
- public AMQUInt16Type()
- : base('S')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedUnsignedShortLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToUInt16(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadUnsignedShort(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteUnsignedShort(buffer, (ushort)value);
- }
- }
-
- sealed class AMQInt32Type : AMQType
- {
- public AMQInt32Type() : base('I')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedIntegerLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToInt32(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadInteger(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteInteger(buffer, (int)value);
- }
- }
-
- sealed class AMQInt64Type : AMQType
- {
- public AMQInt64Type() : base('l')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedLongLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToInt64(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadLong(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteLong(buffer, (long)value);
- }
- }
-
- sealed class AMQUInt64Type : AMQType
- {
- public AMQUInt64Type()
- : base('L')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedUnsignedLongLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToUInt64(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadUnsignedLong(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteUnsignedLong(buffer, (ulong)value);
- }
- }
-
- sealed class AMQFloatType : AMQType
- {
- public AMQFloatType() : base('f')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedFloatLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToSingle(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadFloat(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteFloat(buffer, (float)value);
- }
- }
-
- sealed class AMQDoubleType : AMQType
- {
- public AMQDoubleType() : base('d')
- {
- }
-
- public override uint GetEncodingSize(object value)
- {
- return EncodingUtils.EncodedDoubleLength();
- }
-
- public override object ToNativeValue(object value)
- {
- return Convert.ToDouble(value);
- }
-
- public override object ReadValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.ReadDouble(buffer);
- }
-
- protected override void WriteValueImpl(object value, ByteBuffer buffer)
- {
- EncodingUtils.WriteDouble(buffer, (double)value);
- }
- }
-
- #endregion // Type Implementation
-
- } // class AMQType
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQTypeMap.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQTypeMap.cs
deleted file mode 100644
index ed38c203a9..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQTypeMap.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.
- *
- */
-using System;
-using System.Collections;
-
-namespace Apache.Qpid.Framing
-{
- public sealed class AMQTypeMap
- {
- private static Hashtable _reverseTypeMap;
-
- private AMQTypeMap()
- {
- }
-
- static AMQTypeMap()
- {
- _reverseTypeMap = Hashtable.Synchronized(new Hashtable());
-
- Add(AMQType.LONG_STRING);
- Add(AMQType.BOOLEAN);
- Add(AMQType.BYTE);
- Add(AMQType.SBYTE);
- Add(AMQType.INT16);
- // not supported for now as type code conflicts
- // with LONG_STRING
- //Add(AMQType.UINT16);
- Add(AMQType.INT32);
- Add(AMQType.UINT32);
- Add(AMQType.INT64);
- Add(AMQType.UINT64);
- Add(AMQType.FLOAT);
- Add(AMQType.DOUBLE);
- Add(AMQType.DECIMAL);
- Add(AMQType.BINARY);
- Add(AMQType.ASCII_STRING);
- Add(AMQType.WIDE_STRING);
- Add(AMQType.ASCII_CHARACTER);
- Add(AMQType.TIMESTAMP);
- Add(AMQType.FIELD_TABLE);
- Add(AMQType.VOID);
- }
-
- public static AMQType GetType(byte identifier)
- {
- AMQType type = (AMQType)_reverseTypeMap[identifier];
- if ( type == null )
- throw new ArgumentOutOfRangeException(string.Format("No such type code: {0:x}", identifier));
- return type;
- }
-
- private static void Add(AMQType type)
- {
- _reverseTypeMap.Add(type.Identifier, type);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQTypedValue.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQTypedValue.cs
deleted file mode 100644
index 8d21a60831..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/AMQTypedValue.cs
+++ /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.
- *
- */
-using System;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class AMQTypedValue
- {
- private readonly AMQType _type;
- private readonly object _value;
-
- public AMQType Type
- {
- get { return _type; }
- }
-
- public object Value
- {
- get { return _value; }
- }
-
- public uint EncodingLength
- {
- get { return _type.GetEncodingSize(_value); }
- }
-
- public AMQTypedValue(AMQType type, object value)
- {
- if ( type == null )
- throw new ArgumentNullException("type");
- _type = type;
- _value = type.ToNativeValue(value);
- }
-
- public AMQTypedValue(AMQType type, ByteBuffer buffer)
- {
- _type = type;
- _value = type.ReadValueFromBuffer(buffer);
- }
-
- public void WriteToBuffer(ByteBuffer buffer)
- {
- _type.WriteToBuffer(_value, buffer);
- }
-
- public static AMQTypedValue ReadFromBuffer(ByteBuffer buffer)
- {
- AMQType type = AMQTypeMap.GetType(buffer.GetByte());
- return new AMQTypedValue(type, buffer);
- }
-
- public override string ToString()
- {
- return string.Format("{0}: {1}", Type, Value);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/BasicContentHeaderProperties.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/BasicContentHeaderProperties.cs
deleted file mode 100644
index 47db7b0887..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/BasicContentHeaderProperties.cs
+++ /dev/null
@@ -1,290 +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;
-using log4net;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Framing
-{
- public class BasicContentHeaderProperties : IContentHeaderProperties
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(BasicContentHeaderProperties));
-
- private string _contentType;
- private string _encoding;
- private FieldTable _headers;
- private byte _deliveryMode;
- private byte _priority;
- private string _correlationId;
- private long _expiration;
- private string _replyTo;
- private string _messageId;
- private ulong _timestamp;
- private string _type;
- private string _userId;
- private string _appId;
- private string _clusterId;
-
-
- #region Properties
- //
- // Properties
- //
-
- /// <summary>
- /// The MIME Content Type
- /// </summary>
- public string ContentType
- {
- get { return _contentType; }
- set { _contentType = value; }
- }
-
- /// <summary>
- /// The MIME Content Encoding
- /// </summary>
- public string Encoding
- {
- get { return _encoding; }
- set { _encoding = value; }
- }
-
- /// <summary>
- /// Message headers
- /// </summary>
- public FieldTable Headers
- {
- get { return _headers; }
- set { _headers = value; }
- }
-
- /// <summary>
- /// Non-persistent (1) or persistent (2)
- /// </summary>
- public byte DeliveryMode
- {
- get { return _deliveryMode; }
- set { _deliveryMode = value; }
- }
-
- /// <summary>
- /// The message priority, 0 to 9
- /// </summary>
- public byte Priority
- {
- get { return _priority; }
- set { _priority = value; }
- }
-
- /// <summary>
- /// The application correlation identifier
- /// </summary>
- public string CorrelationId
- {
- get { return _correlationId; }
- set { _correlationId = value; }
- }
-
- /// <summary>
- /// Message expiration specification
- /// </summary>
- // TODO: Should be string according to spec
- public long Expiration
- {
- get { return _expiration; }
- set { _expiration = value; }
- }
-
- /// <summary>
- /// The destination to reply to
- /// </summary>
- public string ReplyTo
- {
- get { return _replyTo; }
- set { _replyTo = value; }
- }
-
- /// <summary>
- /// The application message identifier
- /// </summary>
- public string MessageId
- {
- get { return _messageId; }
- set { _messageId = value; }
- }
-
- /// <summary>
- /// The message timestamp
- /// </summary>
- public ulong Timestamp
- {
- get { return _timestamp; }
- set { _timestamp = value; }
- }
-
- /// <summary>
- /// The message type name
- /// </summary>
- public string Type
- {
- get { return _type; }
- set { _type = value; }
- }
-
- /// <summary>
- /// The creating user id
- /// </summary>
- public string UserId
- {
- get { return _userId; }
- set { _userId = value; }
- }
-
- /// <summary>
- /// The creating application id
- /// </summary>
- public string AppId
- {
- get { return _appId; }
- set { _appId = value; }
- }
-
- /// <summary>
- /// Intra-cluster routing identifier
- /// </summary>
- public string ClusterId
- {
- get { return _clusterId; }
- set { _clusterId = value; }
- }
-
- #endregion // Properties
-
-
- public BasicContentHeaderProperties()
- {
- }
-
- public uint PropertyListSize
- {
- get
- {
- return (uint)(EncodingUtils.EncodedShortStringLength(ContentType) +
- EncodingUtils.EncodedShortStringLength(Encoding) +
- EncodingUtils.EncodedFieldTableLength(Headers) +
- 1 + 1 +
- EncodingUtils.EncodedShortStringLength(CorrelationId) +
- EncodingUtils.EncodedShortStringLength(ReplyTo) +
- EncodingUtils.EncodedShortStringLength(String.Format("{0:D}", Expiration)) +
- EncodingUtils.EncodedShortStringLength(MessageId) +
- 8 +
- EncodingUtils.EncodedShortStringLength(Type) +
- EncodingUtils.EncodedShortStringLength(UserId) +
- EncodingUtils.EncodedShortStringLength(AppId) +
- EncodingUtils.EncodedShortStringLength(ClusterId));
-
- }
- }
-
- public ushort PropertyFlags
- {
- get
- {
- int value = 0;
-
- // for now we just blast in all properties
- for ( int i = 0; i < 14; i++ )
- {
- value += (1 << (15 - i));
- }
- return (ushort)value;
- }
- }
-
- public void WritePropertyListPayload(ByteBuffer buffer)
- {
- EncodingUtils.WriteShortStringBytes(buffer, ContentType);
- EncodingUtils.WriteShortStringBytes(buffer, Encoding);
- EncodingUtils.WriteFieldTableBytes(buffer, Headers);
- buffer.Put(DeliveryMode);
- buffer.Put(Priority);
- EncodingUtils.WriteShortStringBytes(buffer, CorrelationId);
- EncodingUtils.WriteShortStringBytes(buffer, ReplyTo);
- EncodingUtils.WriteShortStringBytes(buffer, String.Format("{0:D}", Expiration));
- EncodingUtils.WriteShortStringBytes(buffer, MessageId);
- buffer.Put(Timestamp);
- EncodingUtils.WriteShortStringBytes(buffer, Type);
- EncodingUtils.WriteShortStringBytes(buffer, UserId);
- EncodingUtils.WriteShortStringBytes(buffer, AppId);
- EncodingUtils.WriteShortStringBytes(buffer, ClusterId);
- }
-
- public void PopulatePropertiesFromBuffer(ByteBuffer buffer, ushort propertyFlags)
- {
- _log.Debug("Property flags: " + propertyFlags);
- if ( (propertyFlags & (1 << 15)) > 0 )
- ContentType = EncodingUtils.ReadShortString(buffer);
- if ( (propertyFlags & (1 << 14)) > 0 )
- Encoding = EncodingUtils.ReadShortString(buffer);
- if ( (propertyFlags & (1 << 13)) > 0 )
- Headers = EncodingUtils.ReadFieldTable(buffer);
- if ( (propertyFlags & (1 << 12)) > 0 )
- DeliveryMode = buffer.GetByte();
- if ( (propertyFlags & (1 << 11)) > 0 )
- Priority = buffer.GetByte();
- if ( (propertyFlags & (1 << 10)) > 0 )
- CorrelationId = EncodingUtils.ReadShortString(buffer);
- if ( (propertyFlags & (1 << 9)) > 0 )
- ReplyTo = EncodingUtils.ReadShortString(buffer);
- if ( (propertyFlags & (1 << 8)) > 0 )
- Expiration = EncodingUtils.ReadLongAsShortString(buffer);
- if ( (propertyFlags & (1 << 7)) > 0 )
- MessageId = EncodingUtils.ReadShortString(buffer);
- if ( (propertyFlags & (1 << 6)) > 0 )
- Timestamp = buffer.GetUInt64();
- if ( (propertyFlags & (1 << 5)) > 0 )
- Type = EncodingUtils.ReadShortString(buffer);
- if ( (propertyFlags & (1 << 4)) > 0 )
- UserId = EncodingUtils.ReadShortString(buffer);
- if ( (propertyFlags & (1 << 3)) > 0 )
- AppId = EncodingUtils.ReadShortString(buffer);
- if ( (propertyFlags & (1 << 2)) > 0 )
- ClusterId = EncodingUtils.ReadShortString(buffer);
- }
-
- public void SetDeliveryMode(DeliveryMode deliveryMode)
- {
- if ( deliveryMode == Messaging.DeliveryMode.NonPersistent )
- {
- DeliveryMode = 1;
- } else
- {
- DeliveryMode = 2;
- }
- }
-
- public override string ToString()
- {
- return "Properties: " + ContentType + " " + Encoding + " " + Timestamp + " " + Type;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/CompositeAMQDataBlock.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/CompositeAMQDataBlock.cs
deleted file mode 100644
index d2b7f606b2..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/CompositeAMQDataBlock.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.
- *
- */
-using System.Text;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class CompositeAMQDataBlock : IDataBlock, IEncodableAMQDataBlock
- {
- private IDataBlock[] _blocks;
-
- public CompositeAMQDataBlock(IDataBlock[] blocks)
- {
- _blocks = blocks;
- }
-
- public IDataBlock[] Blocks
- {
- get
- {
- return _blocks;
- }
- }
-
- public uint Size
- {
- get
- {
- uint frameSize = 0;
- foreach (IDataBlock block in _blocks)
- {
- frameSize += block.Size;
- }
- return frameSize;
- }
- }
-
- public void WritePayload(ByteBuffer buffer)
- {
- foreach (IDataBlock block in _blocks)
- {
- block.WritePayload(buffer);
- }
- }
-
- public override string ToString()
- {
- if (_blocks == null)
- {
- return "No blocks contained in composite frame";
- }
- else
- {
- StringBuilder buf = new StringBuilder(GetType().Name);
- buf.Append("{");
- //buf.Append("encodedBlock=").Append(_encodedBlock);
- for (int i = 0; i < _blocks.Length; i++)
- {
- buf.Append(" ").Append(i).Append("=[").Append(_blocks[i].ToString()).Append("]");
- }
- buf.Append("}");
- return buf.ToString();
- }
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentBody.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentBody.cs
deleted file mode 100644
index 7a2142985d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentBody.cs
+++ /dev/null
@@ -1,100 +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 Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class ContentBody : IBody
- {
- public const byte TYPE = 3;
-
- private ByteBuffer _payload;
-
- public ByteBuffer Payload
- {
- get { return _payload; }
- }
-
- public ContentBody()
- {
- }
- public ContentBody(ByteBuffer payload)
- {
- PopulateFromBuffer(payload, (uint)payload.Remaining);
- }
- public ContentBody(ByteBuffer payload, uint length)
- {
- PopulateFromBuffer(payload, length);
- }
-
- #region IBody Members
-
- public byte BodyType
- {
- get
- {
- return TYPE;
- }
- }
-
- public uint Size
- {
- get
- {
- return (ushort)(Payload == null ? 0 : Payload.Remaining);
- }
- }
-
- public void WritePayload(ByteBuffer buffer)
- {
- if (Payload != null)
- {
- buffer.Put(Payload);
- Payload.Rewind();
- }
- }
-
- public void PopulateFromBuffer(ByteBuffer buffer, uint size)
- {
- if (size > 0)
- {
- _payload = buffer.Slice();
- _payload.Limit = (int)size;
- buffer.Skip((int)size);
- }
- }
-
- #endregion
-
- public static AMQFrame CreateAMQFrame(ushort channelId, ContentBody body)
- {
- AMQFrame frame = new AMQFrame();
- frame.Channel = channelId;
- frame.BodyFrame = body;
- return frame;
- }
-
- public override string ToString()
- {
- return string.Format("ContentBody [ Size: {0} ]", Size);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentBodyFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentBodyFactory.cs
deleted file mode 100644
index 400b2aec08..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentBodyFactory.cs
+++ /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.
- *
- */
-using log4net;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class ContentBodyFactory : IBodyFactory
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(ContentBodyFactory));
-
- private static readonly ContentBodyFactory _instance = new ContentBodyFactory();
-
- public static ContentBodyFactory GetInstance()
- {
- return _instance;
- }
-
- private ContentBodyFactory()
- {
- _log.Debug("Creating content body factory");
- }
-
- /// <summary>
- /// Creates the body.
- /// </summary>
- /// <param name="inbuf">The ByteBuffer containing data from the network</param>
- /// <returns></returns>
- /// <exception>AMQFrameDecodingException</exception>
- public IBody CreateBody(ByteBuffer inbuf)
- {
- return new ContentBody();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderBody.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderBody.cs
deleted file mode 100644
index 82889c23c8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderBody.cs
+++ /dev/null
@@ -1,118 +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;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class ContentHeaderBody : IBody
- {
- public static readonly byte TYPE = 2;
-
- public ushort ClassId;
-
- public ushort Weight;
-
- public ulong BodySize;
-
- /** must never be null */
- public IContentHeaderProperties Properties;
-
- public ContentHeaderBody()
- {
- }
-
- public ContentHeaderBody(IContentHeaderProperties props, ushort classId)
- {
- Properties = props;
- ClassId = classId;
- }
-
- public ContentHeaderBody(ushort classId, ushort weight, IContentHeaderProperties props, uint bodySize)
- : this(props, classId)
- {
- Weight = weight;
- BodySize = bodySize;
- }
-
- #region IBody Members
-
- public byte BodyType
- {
- get
- {
- return TYPE;
- }
- }
-
- public uint Size
- {
- get
- {
- return (2 + 2 + 8 + 2 + Properties.PropertyListSize);
- }
- }
-
- public void WritePayload(ByteBuffer buffer)
- {
- buffer.Put(ClassId);
- buffer.Put(Weight);
- buffer.Put(BodySize);
- buffer.Put(Properties.PropertyFlags);
- Properties.WritePropertyListPayload(buffer);
- }
-
- public void PopulateFromBuffer(ByteBuffer buffer, uint size)
- {
- ClassId = buffer.GetUInt16();
- Weight = buffer.GetUInt16();
- BodySize = buffer.GetUInt64();
- ushort propertyFlags = buffer.GetUInt16();
- ContentHeaderPropertiesFactory factory = ContentHeaderPropertiesFactory.GetInstance();
- Properties = factory.CreateContentHeaderProperties(ClassId, propertyFlags, buffer);
- }
-
- #endregion
-
- public static AMQFrame CreateAMQFrame(ushort channelId, ushort classId, ushort weight, BasicContentHeaderProperties properties,
- uint bodySize)
- {
- AMQFrame frame = new AMQFrame();
- frame.Channel = channelId;
- frame.BodyFrame = new ContentHeaderBody(classId, weight, properties, bodySize);
- return frame;
- }
-
- public static AMQFrame CreateAMQFrame(ushort channelId, ContentHeaderBody body)
- {
- AMQFrame frame = new AMQFrame();
- frame.Channel = channelId;
- frame.BodyFrame = body;
- return frame;
- }
-
- public override string ToString()
- {
- return String.Format("ContentHeaderBody: ClassId {0}, Weight {1}, BodySize {2}, Properties {3}", ClassId, Weight,
- BodySize, Properties);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderBodyFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderBodyFactory.cs
deleted file mode 100644
index c95a10871d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderBodyFactory.cs
+++ /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.
- *
- */
-using log4net;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class ContentHeaderBodyFactory : IBodyFactory
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(ContentHeaderBodyFactory));
-
- private static readonly ContentHeaderBodyFactory _instance = new ContentHeaderBodyFactory();
-
- public static ContentHeaderBodyFactory GetInstance()
- {
- return _instance;
- }
-
- private ContentHeaderBodyFactory()
- {
- _log.Debug("Creating content header body factory");
- }
-
- #region IBodyFactory Members
-
- public IBody CreateBody(ByteBuffer inbuf)
- {
- // all content headers are the same - it is only the properties that differ.
- // the content header body further delegates construction of properties
- return new ContentHeaderBody();
- }
-
- #endregion
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderPropertiesFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderPropertiesFactory.cs
deleted file mode 100644
index bac5d10fd4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ContentHeaderPropertiesFactory.cs
+++ /dev/null
@@ -1,63 +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 Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class ContentHeaderPropertiesFactory
- {
-
- private static readonly ContentHeaderPropertiesFactory _instance = new ContentHeaderPropertiesFactory();
-
- public static ContentHeaderPropertiesFactory GetInstance()
- {
- return _instance;
- }
-
- private ContentHeaderPropertiesFactory()
- {
- }
-
- /// <summary>
- /// Creates the content header properties from a buffer.
- /// </summary>
- /// <param name="classId">The class id.</param>
- /// <param name="propertyFlags">The property flags.</param>
- /// <param name="buffer">The buffer.</param>
- /// <returns>a populated properties structure</returns>
- /// <exception cref="AMQFrameDecodingException">if the buffer cannot be decoded</exception>
- public IContentHeaderProperties CreateContentHeaderProperties(ushort classId, ushort propertyFlags,
- ByteBuffer buffer)
- {
- IContentHeaderProperties properties;
- switch (classId)
- {
- case 60:
- properties = new BasicContentHeaderProperties();
- break;
- default:
- throw new AMQFrameDecodingException("Unsupport content header class id: " + classId);
- }
- properties.PopulatePropertiesFromBuffer(buffer, propertyFlags);
- return properties;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/EncodingUtils.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/EncodingUtils.cs
deleted file mode 100644
index 4d424656f9..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/EncodingUtils.cs
+++ /dev/null
@@ -1,460 +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;
-using System.Globalization;
-using System.Text;
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class EncodingUtils
- {
- private static readonly Encoding DEFAULT_ENCODER = Encoding.ASCII;
-
- // SHORT STRING
- public static ushort EncodedShortStringLength(string s)
- {
- if ( s == null )
- {
- return 1;
- } else
- {
- return (ushort)(1 + s.Length);
- }
- }
- public static void WriteShortStringBytes(ByteBuffer buffer, string s)
- {
- if ( s != null )
- {
- //try
- //{
- //final byte[] encodedString = s.getBytes(STRING_ENCODING);
- byte[] encodedString;
- lock ( DEFAULT_ENCODER )
- {
- encodedString = DEFAULT_ENCODER.GetBytes(s);
- }
- // TODO: check length fits in an unsigned byte
- buffer.Put((byte)encodedString.Length);
- buffer.Put(encodedString);
-
- } else
- {
- // really writing out unsigned byte
- buffer.Put((byte)0);
- }
- }
-
- // ASCII STRINGS
- public static uint EncodedAsciiStringLength(string s)
- {
- // TODO: move this to 2-byte length once the proposed encodings
- // have been approved. Also, validate length!
- if ( s == null )
- return 4;
- else
- return (uint) (4 + s.Length);
- }
- public static string ReadAsciiString(ByteBuffer buffer)
- {
- return ReadLongString(buffer, DEFAULT_ENCODER);
- }
- public static void WriteAsciiString(ByteBuffer buffer, string s)
- {
- WriteLongStringBytes(buffer, s, DEFAULT_ENCODER);
- }
-
- // LONG STRING
- public static uint EncodedLongStringLength(string s)
- {
- return EncodedLongStringLength(s, DEFAULT_ENCODER);
- }
-
- public static uint EncodedLongStringLength(string s, Encoding encoding)
- {
- if ( s == null )
- {
- return 4;
- } else
- {
- return (uint)(4 + encoding.GetByteCount(s));
- }
- }
- public static string ReadLongString(ByteBuffer buffer)
- {
- return ReadLongString(buffer, DEFAULT_ENCODER);
- }
- public static string ReadLongString(ByteBuffer buffer, Encoding encoding)
- {
- uint length = buffer.GetUInt32();
- if ( length == 0 )
- {
- return null;
- } else
- {
- byte[] data = new byte[length];
- buffer.GetBytes(data);
- lock ( encoding )
- {
- return encoding.GetString(data);
- }
- }
- }
- public static void WriteLongStringBytes(ByteBuffer buffer, string s)
- {
- WriteLongStringBytes(buffer, s, DEFAULT_ENCODER);
- }
-
- public static void WriteLongStringBytes(ByteBuffer buffer, string s, Encoding encoding)
- {
- if ( !(s == null || s.Length <= 0xFFFE) )
- {
- throw new ArgumentException("String too long");
- }
- if ( s != null )
- {
- lock ( encoding )
- {
- byte[] encodedString = encoding.GetBytes(s);
- buffer.Put((uint)encodedString.Length);
- buffer.Put(encodedString);
- }
- } else
- {
- buffer.Put((uint)0);
- }
- }
-
- // BINARY
- public static uint EncodedLongstrLength(byte[] bytes)
- {
- if ( bytes == null )
- {
- return 4;
- } else
- {
- return (uint)(4 + bytes.Length);
- }
- }
- public static byte[] ReadLongstr(ByteBuffer buffer)
- {
- uint length = buffer.GetUInt32();
- if ( length == 0 )
- {
- return null;
- } else
- {
- byte[] result = new byte[length];
- buffer.GetBytes(result);
- return result;
- }
- }
- public static void WriteLongstr(ByteBuffer buffer, byte[] data)
- {
- if ( data != null )
- {
- buffer.Put((uint)data.Length);
- buffer.Put(data);
- } else
- {
- buffer.Put((uint)0);
- }
- }
-
- // BOOLEANS
- public static bool[] ReadBooleans(ByteBuffer buffer)
- {
- byte packedValue = buffer.GetByte();
- bool[] result = new bool[8];
-
- for ( int i = 0; i < 8; i++ )
- {
- result[i] = ((packedValue & (1 << i)) != 0);
- }
- return result;
- }
- public static void WriteBooleans(ByteBuffer buffer, bool[] values)
- {
- byte packedValue = 0;
- for ( int i = 0; i < values.Length; i++ )
- {
- if ( values[i] )
- {
- packedValue = (byte)(packedValue | (1 << i));
- }
- }
-
- buffer.Put(packedValue);
- }
-
- // FIELD TABLES
- public static uint EncodedFieldTableLength(FieldTable table)
- {
- if ( table == null )
- {
- // size is encoded as 4 octets
- return 4;
- } else
- {
- // size of the table plus 4 octets for the size
- return table.EncodedSize + 4;
- }
- }
- /// <summary>
- /// Reads the field table using the data in the specified buffer
- /// </summary>
- /// <param name="buffer">The buffer to read from.</param>
- /// <returns>a populated field table</returns>
- /// <exception cref="AMQFrameDecodingException">if the buffer does not contain a decodable field table</exception>
- public static FieldTable ReadFieldTable(ByteBuffer buffer)
- {
- uint length = buffer.GetUInt32();
- if ( length == 0 )
- {
- return null;
- } else
- {
- return new FieldTable(buffer, length);
- }
- }
- public static void WriteFieldTableBytes(ByteBuffer buffer, FieldTable table)
- {
- if ( table != null )
- {
- table.WriteToBuffer(buffer);
- } else
- {
- buffer.Put((uint)0);
- }
- }
-
-
- /// <summary>
- /// Read a short string from the buffer
- /// </summary>
- /// <param name="buffer">The buffer to read from.</param>
- /// <returns>a string</returns>
- /// <exception cref="AMQFrameDecodingException">if the buffer does not contain a decodable short string</exception>
- public static string ReadShortString(ByteBuffer buffer)
- {
- byte length = buffer.GetByte();
- if ( length == 0 )
- {
- return null;
- } else
- {
- byte[] data = new byte[length];
- buffer.GetBytes(data);
-
- lock ( DEFAULT_ENCODER )
- {
- return DEFAULT_ENCODER.GetString(data);
- }
- }
- }
-
-
-
- // BOOLEAN
- public static uint EncodedBooleanLength()
- {
- return 1;
- }
- public static bool ReadBoolean(ByteBuffer buffer)
- {
- byte packedValue = buffer.GetByte();
- return (packedValue == 1);
- }
- public static void WriteBoolean(ByteBuffer buffer, bool value)
- {
- buffer.Put((byte)(value ? 1 : 0));
- }
-
-
- // CHAR
- public static uint EncodedCharLength()
- {
- return EncodedByteLength();
- }
- public static char ReadChar(ByteBuffer buffer)
- {
- return (char)buffer.GetByte();
- }
- public static void WriteChar(ByteBuffer buffer, char value)
- {
- buffer.Put((byte)value);
- }
-
- // BYTE
- public static uint EncodedByteLength()
- {
- return 1;
- }
- public static byte ReadByte(ByteBuffer buffer)
- {
- return buffer.GetByte();
- }
- public static void WriteByte(ByteBuffer buffer, byte value)
- {
- buffer.Put(value);
- }
-
- // SBYTE
- public static uint EncodedSByteLength()
- {
- return 1;
- }
- public static sbyte ReadSByte(ByteBuffer buffer)
- {
- return buffer.GetSByte();
- }
- public static void WriteSByte(ByteBuffer buffer, sbyte value)
- {
- buffer.Put(value);
- }
-
- // INT16
- public static uint EncodedShortLength()
- {
- return 2;
- }
-
- public static short ReadShort(ByteBuffer buffer)
- {
- return buffer.GetInt16();
- }
- public static void WriteShort(ByteBuffer buffer, short value)
- {
- buffer.Put(value);
- }
-
- // UINT16
- public static uint EncodedUnsignedShortLength()
- {
- return 2;
- }
-
- public static ushort ReadUnsignedShort(ByteBuffer buffer)
- {
- return buffer.GetUInt16();
- }
- public static void WriteUnsignedShort(ByteBuffer buffer, ushort value)
- {
- buffer.Put(value);
- }
-
-
- // INT32
- public static uint EncodedIntegerLength()
- {
- return 4;
- }
- public static int ReadInteger(ByteBuffer buffer)
- {
- return buffer.GetInt32();
- }
- public static void WriteInteger(ByteBuffer buffer, int value)
- {
- buffer.Put(value);
- }
-
- // UINT32
- public static uint UnsignedIntegerLength()
- {
- return 4;
- }
- public static void WriteUnsignedInteger(ByteBuffer buffer, uint value)
- {
- buffer.Put(value);
- }
- public static uint ReadUnsignedInteger(ByteBuffer buffer)
- {
- return buffer.GetUInt32();
- }
-
- // INT64
- public static uint EncodedUnsignedLongLength()
- {
- return 8;
- }
- public static ulong ReadUnsignedLong(ByteBuffer buffer)
- {
- return buffer.GetUInt64();
- }
- public static void WriteUnsignedLong(ByteBuffer buffer, ulong value)
- {
- buffer.Put(value);
- }
-
- // UINT64
- public static uint EncodedLongLength()
- {
- return 8;
- }
- public static long ReadLong(ByteBuffer buffer)
- {
- return buffer.GetInt64();
- }
- public static void WriteLong(ByteBuffer buffer, long value)
- {
- buffer.Put(value);
- }
-
- // FLOAT
- public static uint EncodedFloatLength()
- {
- return 4;
- }
- public static void WriteFloat(ByteBuffer buffer, float value)
- {
- buffer.Put(value);
- }
- public static float ReadFloat(ByteBuffer buffer)
- {
- return buffer.GetFloat();
- }
-
- // DOUBLE
- public static uint EncodedDoubleLength()
- {
- return 8;
- }
- public static void WriteDouble(ByteBuffer buffer, double value)
- {
- buffer.Put(value);
- }
- public static double ReadDouble(ByteBuffer buffer)
- {
- return buffer.GetDouble();
- }
-
- // OTHER
- public static long ReadLongAsShortString(ByteBuffer buffer)
- {
- string value = ReadShortString(buffer);
- if ( value == null || value.Length == 0 )
- return 0L;
- return Convert.ToInt64(value, CultureInfo.InvariantCulture);
- }
-
- }
-
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/FieldTable.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/FieldTable.cs
deleted file mode 100644
index 6567bf58ab..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/FieldTable.cs
+++ /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.
- *
- */
-using System;
-using System.Collections;
-using System.Text;
-using log4net;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Collections;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Framing
-{
- public class FieldTable : IFieldTable, IEnumerable
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(FieldTable));
-
- IDictionary _properties;
- private ByteBuffer _encodedForm;
- private object _syncLock;
- private uint _encodedSize;
-
- public FieldTable()
- {
- _syncLock = new object();
- }
-
- /// <summary>
- /// Construct a new field table.
- /// </summary>
- /// <param name="buffer">the buffer from which to read data. The length byte must be read already</param>
- /// <param name="length">the length of the field table. Must be > 0.</param>
- public FieldTable(ByteBuffer buffer, uint length) : this()
- {
- _encodedForm = buffer.Slice();
- _encodedForm.Limit = (int)length;
- _encodedSize = length;
- buffer.Skip((int)length);
- }
-
- /// <summary>
- /// The set of all property names
- /// </summary>
- public ICollection Keys
- {
- get
- {
- InitMapIfNecessary();
- return _properties.Keys;
- }
- }
-
- /// <summary>
- /// Calculated size of this field table once encoded
- /// </summary>
- public uint EncodedSize
- {
- get { return _encodedSize; }
- }
-
- /// <summary>
- /// Number of properties in the field table
- /// </summary>
- public int Count
- {
- get
- {
- InitMapIfNecessary();
- return _properties.Count;
- }
- }
-
- /// <summary>
- /// Gets or sets the specified property.
- /// </summary>
- /// <param name="key">Property name</param>
- /// <returns>The specified property value</returns>
- public object this[string key]
- {
- get { return GetObject(key); }
- set { SetObject(key, value); }
- }
-
- #region Typed Setters and Getters
- //
- // Typed Setters and Getters
- //
- public bool GetBoolean(string key)
- {
- return (bool)this[key];
- }
- public void SetBoolean(string key, bool value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.BOOLEAN.AsTypedValue(value));
- }
- public byte GetByte(string key)
- {
- return (byte)this[key];
- }
- public void SetByte(string key, byte value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.BYTE.AsTypedValue(value));
- }
- public sbyte GetSByte(string key)
- {
- return (sbyte)this[key];
- }
- public void SetSByte(string key, sbyte value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.SBYTE.AsTypedValue(value));
- }
- public short GetInt16(string key)
- {
- return (short)this[key];
- }
- public void SetInt16(string key, short value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.INT16.AsTypedValue(value));
- }
- public int GetInt32(string key)
- {
- return (int)this[key];
- }
- public void SetInt32(string key, int value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.INT32.AsTypedValue(value));
- }
- public long GetInt64(string key)
- {
- return (long)this[key];
- }
- public void SetInt64(string key, long value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.INT64.AsTypedValue(value));
- }
- public char GetChar(string key)
- {
- return (char)this[key];
- }
- public void SetChar(string key, char value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.ASCII_CHARACTER.AsTypedValue(value));
- }
- public float GetFloat(string key)
- {
- return (float)this[key];
- }
- public void SetFloat(string key, float value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.FLOAT.AsTypedValue(value));
- }
- public double GetDouble(string key)
- {
- return (double)this[key];
- }
- public void SetDouble(string key, double value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.DOUBLE.AsTypedValue(value));
- }
- public decimal GetDecimal(string key)
- {
- return (decimal)this[key];
- }
- public void SetDecimal(string key, decimal value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.DECIMAL.AsTypedValue(value));
- }
- public string GetString(string key)
- {
- return (string)this[key];
- }
- public void SetString(string key, string value)
- {
- CheckPropertyName(key);
- if ( value == null )
- SetProperty(key, AMQType.VOID.AsTypedValue(null));
- else
- SetProperty(key, AMQType.LONG_STRING.AsTypedValue(value));
- }
- public byte[] GetBytes(string key)
- {
- return (byte[])this[key];
- }
- public void SetBytes(string key, byte[] value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.BINARY.AsTypedValue(value));
- }
- public ushort GetUInt16(string key)
- {
- return (ushort)this[key];
- }
- public void SetUInt16(string key, ushort value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.UINT16.AsTypedValue(value));
- }
- public uint GetUInt32(string key)
- {
- return (uint)this[key];
- }
- public void SetUInt32(string key, uint value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.UINT32.AsTypedValue(value));
- }
- public ulong GetUInt64(string key)
- {
- return (ulong)this[key];
- }
- public void SetUInt64(string key, ulong value)
- {
- CheckPropertyName(key);
- SetProperty(key, AMQType.UINT64.AsTypedValue(value));
- }
-
- #endregion // Typed Setters and Getters
-
- #region Public Methods
- //
- // Public Methods
- //
-
- /// <summary>
- /// Removes the property with the specified name
- /// </summary>
- /// <param name="key">The name of the property to remove</param>
- /// <returns>The previous value of the property or null</returns>
- public AMQTypedValue RemoveKey(string key)
- {
- InitMapIfNecessary();
- _encodedForm = null;
- AMQTypedValue value = (AMQTypedValue)_properties[key];
- if ( value != null )
- {
- _properties.Remove(key);
- _encodedSize -= EncodingUtils.EncodedShortStringLength(key);
- _encodedSize--;
- _encodedSize -= value.EncodingLength;
-
- }
- return value;
- }
-
-
- /// <summary>
- /// Remove the property with the specified name
- /// </summary>
- /// <param name="key">The name of the property to remove</param>
- public void Remove(string key)
- {
- RemoveKey(key);
- }
-
- /// <summary>
- /// Remove all properties from the table
- /// </summary>
- public void Clear()
- {
- InitMapIfNecessary();
- _encodedForm = null;
- _properties.Clear();
- _encodedSize = 0;
- }
-
- /// <summary>
- /// Adds all the items from one field table in this one. Will overwrite any items in the current table
- /// with the same key.
- /// </summary>
- /// <param name="ft">the source field table</param>
- public void AddAll(IFieldTable ft)
- {
- foreach ( DictionaryEntry dictionaryEntry in ft )
- {
- this[(string)dictionaryEntry.Key] = dictionaryEntry.Value;
- }
- }
-
- /// <summary>
- /// Get a enumerator over the internal property set.
- /// Notice the enumerator will DictionaryEntry objects with
- /// a string as the Key and an <see cref="AMQTypedValue"/> instance as the value
- /// </summary>
- /// <returns>The enumerator object</returns>
- public IEnumerator GetEnumerator()
- {
- InitMapIfNecessary();
- return _properties.GetEnumerator();
- }
-
- /// <summary>
- /// Indicates if a property with the given name exists
- /// </summary>
- /// <param name="s">Property name to check</param>
- /// <returns>True if the property exists</returns>
- public bool Contains(string s)
- {
- InitMapIfNecessary();
- return _properties.Contains(s);
- }
-
- /// <summary>
- /// Returns a dictionary mapping Property Names to the corresponding
- /// <see cref="AMQTypedValue"/> value
- /// </summary>
- /// <returns>The internal dictionary</returns>
- public IDictionary AsDictionary()
- {
- InitMapIfNecessary();
- return _properties;
- }
-
- /// <summary>
- /// Returns a string representation of this field table
- /// </summary>
- /// <returns>A string</returns>
- public override string ToString()
- {
- StringBuilder sb = new StringBuilder("FieldTable {");
-
- bool first = true;
- InitMapIfNecessary();
- foreach ( DictionaryEntry entry in _properties )
- {
- if ( !first )
- {
- sb.Append(", ");
- }
- first = false;
- sb.Append(entry.Key).Append(" => ").Append(entry.Value);
- }
-
- sb.Append("}");
- return sb.ToString();
- }
-
- /// <summary>
- /// Serializes this instance to the specified <see cref="ByteBuffer"/>.
- /// </summary>
- /// <param name="buffer">The buffer to write to</param>
- public void WriteToBuffer(ByteBuffer buffer)
- {
- if ( _log.IsDebugEnabled )
- {
- _log.Debug("FieldTable::writeToBuffer: Writing encoded length of " + EncodedSize + "...");
- }
-
- EncodingUtils.WriteUnsignedInteger(buffer, EncodedSize);
- WritePayload(buffer);
- }
-
- /// <summary>
- /// Returns a byte array with the serialized representation
- /// of this field table
- /// </summary>
- /// <returns>An array of bytes</returns>
- public byte[] GetDataAsBytes()
- {
- ByteBuffer buffer = ByteBuffer.Allocate((int)_encodedSize);
- WritePayload(buffer);
- byte[] result = new byte[_encodedSize];
- buffer.Flip();
- buffer.GetBytes(result);
- //buffer.Release();
- return result;
- }
-
- #endregion // Public Methods
-
- #region Private Methods
- //
- // Private Methods
- //
-
- private static void CheckPropertyName(string propertyName)
- {
- if ( propertyName == null || propertyName.Length == 0 )
- throw new ArgumentNullException("propertyName");
- CheckIdentifierFormat(propertyName);
- }
-
- private static void CheckIdentifierFormat(string propertyName)
- {
- // AMQP Spec: 4.2.5.5 Field Tables
- // Guidelines for implementers:
- // * Field names MUST start with a letter, '$' or '#' and may continue with
- // letters, '$' or '#', digits, or underlines, to a maximum length of 128
- // characters.
- // * The server SHOULD validate field names and upon receiving an invalid
- // field name, it SHOULD signal a connection exception with reply code
- // 503 (syntax error). Conformance test: amq_wlp_table_01.
- // * A peer MUST handle duplicate fields by using only the first instance.
-
-
- // AMQP length limit
- if ( propertyName.Length > 128 )
- {
- throw new ArgumentException("AMQP limits property names to 128 characters");
- }
-
- // AMQ start character
- if ( !(Char.IsLetter(propertyName[0])
- || propertyName[0] == '$'
- || propertyName[0] == '#'
- || propertyName[0] == '_' ) )// Not official AMQP added for JMS.
- {
- throw new ArgumentException("Identifier '" + propertyName + "' does not start with a valid AMQP start character");
- }
- }
-
- private object GetObject(string key)
- {
- AMQTypedValue value = GetProperty(key);
- return value != null ? value.Value : null;
- }
-
- private void SetObject(string key, object value)
- {
- if ( value is bool )
- {
- SetBoolean(key, (bool)value);
- } else if ( value is byte )
- {
- SetByte(key, (byte)value);
- } else if ( value is sbyte )
- {
- SetSByte(key, (sbyte)value);
- } else if ( value is short )
- {
- SetInt16(key, (short)value);
- } else if ( value is ushort )
- {
- SetUInt16(key, (ushort)value);
- } else if ( value is int )
- {
- SetInt32(key, (int) value);
- } else if ( value is uint )
- {
- SetUInt32(key, (uint)value);
- } else if ( value is long )
- {
- SetInt64(key, (long) value);
- } else if ( value is ulong )
- {
- SetUInt64(key, (ulong)value);
- } else if ( value is char )
- {
- SetChar(key, (char) value);
- } else if ( value is float )
- {
- SetFloat(key, (float) value);
- } else if ( value is double )
- {
- SetDouble(key, (double) value);
- } else if ( value is decimal )
- {
- SetDecimal(key, (decimal) value);
- } else if ( value is string )
- {
- SetString(key, (string) value);
- } else if ( value is byte[] )
- {
- SetBytes(key, (byte[])value);
- } else
- {
- throw new ArgumentException("Data type not supported yet");
- }
- }
-
- private AMQTypedValue GetProperty(string name)
- {
- InitMapIfNecessary();
- return (AMQTypedValue) _properties[name];
- }
-
- private void PopulateFromBuffer()
- {
- try
- {
- ByteBuffer buffer = _encodedForm;
- _encodedForm = null;
- if ( buffer != null )
- SetFromBuffer(buffer, _encodedSize);
- } catch ( AMQFrameDecodingException e )
- {
- _log.Error("Error decoding FieldTable in deferred decoding mode ", e);
- throw;
- }
- }
-
- private void SetFromBuffer(ByteBuffer buffer, uint length)
- {
- bool trace = _log.IsDebugEnabled;
- if ( length > 0 )
- {
- int expectedRemaining = buffer.Remaining - (int)length;
- _properties = new LinkedHashtable();
-
- do
- {
- string key = EncodingUtils.ReadShortString(buffer);
- AMQTypedValue value = AMQTypedValue.ReadFromBuffer(buffer);
- if ( trace )
- {
- _log.Debug(string.Format("FieldTable::PropFieldTable(buffer,{0}): Read type '{1}', key '{2}', value '{3}'", length, value.Type, key, value.Value));
- }
- _properties.Add(key, value);
-
- } while ( buffer.Remaining > expectedRemaining );
- _encodedSize = length;
- }
- if ( trace )
- {
- _log.Debug("FieldTable::FieldTable(buffer," + length + "): Done.");
- }
- }
-
- private void InitMapIfNecessary()
- {
- lock ( _syncLock )
- {
- if ( _properties == null )
- {
- if ( _encodedForm == null )
- {
- _properties = new LinkedHashtable();
- } else
- {
- PopulateFromBuffer();
- }
- }
- }
- }
-
- private AMQTypedValue SetProperty(string key, AMQTypedValue value)
- {
- InitMapIfNecessary();
- _encodedForm = null;
- if ( value == null )
- {
- RemoveKey(key);
- }
- AMQTypedValue oldVal = (AMQTypedValue)_properties[key];
- _properties.Add(key, value);
- if ( oldVal != null )
- {
- _encodedSize -= oldVal.EncodingLength;
- } else
- {
- _encodedSize += EncodingUtils.EncodedShortStringLength(key) + (uint)1;
- }
- if ( value != null )
- {
- _encodedSize += value.EncodingLength;
- }
-
- return oldVal;
- }
-
- public void WritePayload(ByteBuffer buffer)
- {
- if ( _encodedForm != null )
- {
- lock ( _syncLock )
- {
- buffer.Put(_encodedForm);
- _encodedForm.Flip();
- }
- } else if ( _properties != null )
- {
- foreach ( DictionaryEntry de in _properties )
- {
- string key = (string)de.Key;
- AMQTypedValue value = (AMQTypedValue)de.Value;
- try
- {
- if ( _log.IsDebugEnabled )
- {
- _log.Debug("Writing Property:" + key +
- " Type:" + value.Type +
- " Value:" + value.Value);
- _log.Debug("Buffer Position:" + buffer.Position +
- " Remaining:" + buffer.Remaining);
- }
- //Write the actual parameter name
- EncodingUtils.WriteShortStringBytes(buffer, key);
- value.WriteToBuffer(buffer);
- } catch ( Exception ex )
- {
- if ( _log.IsDebugEnabled )
- {
- _log.Debug("Exception thrown:" + ex);
- _log.Debug("Writing Property:" + key +
- " Type:" + value.Type +
- " Value:" + value.Value);
- _log.Debug("Buffer Position:" + buffer.Position +
- " Remaining:" + buffer.Remaining);
- }
- throw;
- }
- }
- }
- }
- #endregion // Private Methods
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/HeartbeatBody.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/HeartbeatBody.cs
deleted file mode 100644
index a8906f5ba8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/HeartbeatBody.cs
+++ /dev/null
@@ -1,64 +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 Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class HeartbeatBody : IBody
-{
- public const byte TYPE = 8;
- public static AMQFrame FRAME = new HeartbeatBody().ToFrame();
-
- public byte BodyType
- {
- get
- {
- return TYPE;
- }
- }
-
- public uint Size
- {
- get
- {
- return 0;//heartbeats we generate have no payload
- }
- }
-
- public void WritePayload(ByteBuffer buffer)
- {
- }
-
- public void PopulateFromBuffer(ByteBuffer buffer, uint size)
- {
- if (size > 0)
- {
- //allow other implementations to have a payload, but ignore it:
- buffer.Skip((int) size);
- }
- }
-
- public AMQFrame ToFrame()
- {
- return new AMQFrame(0, this);
- }
-}
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/HeartbeatBodyFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/HeartbeatBodyFactory.cs
deleted file mode 100644
index 90e5c7768e..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/HeartbeatBodyFactory.cs
+++ /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.
- *
- */
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- public class HeartbeatBodyFactory : IBodyFactory
- {
- public IBody CreateBody(ByteBuffer input)
- {
- return new HeartbeatBody();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IBody.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IBody.cs
deleted file mode 100644
index 97b4459e5c..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IBody.cs
+++ /dev/null
@@ -1,63 +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 Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- /// <summary>
- /// An IBody is contained within a top level frame. As such, it is not en/decodable on its own but
- /// is decoded as a step within a the overall en/decoding process.
- /// </summary>
- public interface IBody
- {
- /// <summary>
- /// Gets the type. See RFC 006 for the meaning of "type" in this context.
- /// </summary>
- /// <value>The type.</value>
- byte BodyType
- {
- get;
- }
-
- /// <summary>
- /// Get the size of the body
- /// </summary>
- /// <value>The size in bytes.</value>
- uint Size
- {
- get;
- }
-
- /// <summary>
- /// Writes this instance to a buffer.
- /// </summary>
- /// <param name="buffer">The buffer.</param>
- void WritePayload(ByteBuffer buffer);
-
- /// <summary>
- /// Populates this instance from a buffer of data.
- /// </summary>
- /// <param name="buffer">The buffer.</param>
- /// <param name="size">The size.</param>
- /// <exception cref="AMQFrameDecodingException">If the buffer contains data that cannot be decoded</exception>
- void PopulateFromBuffer(ByteBuffer buffer, uint size);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IBodyFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IBodyFactory.cs
deleted file mode 100644
index dd7960ddbe..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IBodyFactory.cs
+++ /dev/null
@@ -1,38 +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 Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- /// <summary>
- /// Any class that is capable of turning a stream of bytes into an AMQ structure must implement this interface.
- /// </summary>
- public interface IBodyFactory
- {
- /// <summary>
- /// Creates the body.
- /// </summary>
- /// <param name="inbuf">The ByteBuffer containing data from the network</param>
- /// <returns></returns>
- /// <exception>AMQFrameDecodingException</exception>
- IBody CreateBody(ByteBuffer inbuf);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IContentHeaderProperties.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IContentHeaderProperties.cs
deleted file mode 100644
index 676d0910d4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IContentHeaderProperties.cs
+++ /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.
- *
- */
-using Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- /// <summary>
- /// There will be an implementation of this interface for each content type. All content types have associated
- /// header properties and this provides a way to encode and decode them.
- /// </summary>
- public interface IContentHeaderProperties
- {
- /// <summary>
- /// Writes the property list to the buffer, in a suitably encoded form.
- /// </summary>
- /// <param name="buffer">The buffer to write to</param>
- void WritePropertyListPayload(ByteBuffer buffer);
-
- /// <summary>
- /// Populates the properties from buffer.
- /// </summary>
- /// <param name="buffer">The buffer to read from.</param>
- /// <param name="propertyFlags">The property flags.</param>
- /// <exception cref="AMQFrameDecodingException">Thrown when the buffer does not contain valid data</exception>
- void PopulatePropertiesFromBuffer(ByteBuffer buffer, ushort propertyFlags);
-
- /// <summary>
- /// Gets the size of the encoded property list in bytes.
- /// </summary>
- /// <value>The size of the property list in bytes</value>
- uint PropertyListSize
- {
- get;
- }
-
- /// <summary>
- /// Gets the property flags. Property flags indicate which properties are set in the list. The
- /// position and meaning of each flag is defined in the protocol specification for the particular
- /// content type with which these properties are associated.
- /// </summary>
- /// <value>the flags as an unsigned integer</value>
- ushort PropertyFlags
- {
- get;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IDataBlock.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IDataBlock.cs
deleted file mode 100644
index c61ed90d10..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IDataBlock.cs
+++ /dev/null
@@ -1,47 +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 Apache.Qpid.Buffer;
-
-namespace Apache.Qpid.Framing
-{
- /// <summary>
- /// A data block represents something that has a size in bytes and the ability to write itself to a byte
- /// buffer (similar to a byte array). It represents "top level" frames in the protocol specification.
- /// </summary>
- public interface IDataBlock : IEncodableAMQDataBlock
- {
- /// <summary>
- /// Get the size of buffer needed to store the byte representation of this
- /// frame.
- /// </summary>
- /// <returns>size in bytes</returns>
- uint Size
- {
- get;
- }
-
- /// <summary>
- /// Writes the datablock to the specified buffer.
- /// </summary>
- /// <param name="buffer">The buffer to write to. Must be the correct size.</param>
- void WritePayload(ByteBuffer buffer);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IEncodableAMQDataBlock.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IEncodableAMQDataBlock.cs
deleted file mode 100644
index da8bf9fef9..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/IEncodableAMQDataBlock.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.Framing
-{
-
- /// <summary>
- /// Marker interface to indicate to MINA that a data block should be encoded with the
- /// single encoder/decoder that we have defined.
- /// </summary>
- public interface IEncodableAMQDataBlock
- {
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ProtocolInitiation.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ProtocolInitiation.cs
deleted file mode 100644
index 5407bc08d5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Framing/ProtocolInitiation.cs
+++ /dev/null
@@ -1,158 +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;
-using System.Collections;
-using System.Configuration;
-using System.Reflection;
-using System.Xml;
-using log4net;
-using Apache.Qpid.Buffer;
-using Apache.Qpid.Codec;
-using Apache.Qpid.Codec.Demux;
-using Apache.Qpid.Common;
-
-namespace Apache.Qpid.Framing
-{
- public class ProtocolInitiation : IDataBlock, IEncodableAMQDataBlock
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(ProtocolInitiation));
-
- public char[] Header = new char[]{'A','M','Q','P'};
-
- private const byte CURRENT_PROTOCOL_CLASS = 1;
- private const int CURRENT_PROTOCOL_INSTANCE = 1;
- // FIXME: Needs to be tweakable from GRM.dll.config file. i.e. Major version 7 or 8 +
- // FIXME: a configuration item for avoiding Basic.Qos (for OpenAMQ compatibility)
- public static int CURRENT_PROTOCOL_VERSION_MAJOR = 8; // FIXME: put back to 7 for OpenAMQ!
- private const int CURRENT_PROTOCOL_VERSION_MINOR = 0;
-
- public byte ProtocolClass = CURRENT_PROTOCOL_CLASS;
- public byte ProtocolInstance = CURRENT_PROTOCOL_INSTANCE;
- public byte ProtocolMajor = (byte)CURRENT_PROTOCOL_VERSION_MAJOR;
- public byte ProtocolMinor = CURRENT_PROTOCOL_VERSION_MINOR;
-
- static ProtocolInitiation()
- {
- AssemblySettings settings = new AssemblySettings();
-
- /*
- string openAMQ = settings["OpenAMQ1d4Compatibility"];
- if (openAMQ.Equals("true"))
- {
- _log.Warn("Starting in OpenAMQ-1.0d4 compatibility mode. ProtocolMajorVersion is 7 and Basic.Qos will not be sent.");
- CURRENT_PROTOCOL_VERSION_MAJOR = 7;
- }
- */
- }
-
- public uint Size
- {
- get
- {
- return 4 + 1 + 1 + 1 + 1;
- }
- }
-
- public void WritePayload(ByteBuffer buffer)
- {
- foreach (char c in Header)
- {
- buffer.Put((byte) c);
- }
- buffer.Put(ProtocolClass);
- buffer.Put(ProtocolInstance);
- buffer.Put(ProtocolMajor);
- buffer.Put(ProtocolMinor);
- }
-
- /// <summary>
- /// Populates from buffer.
- /// </summary>
- /// <param name="buffer">The buffer.</param>
- public void PopulateFromBuffer(ByteBuffer buffer)
- {
- throw new AMQException("Method not implemented");
- }
-
- public class Decoder : IMessageDecoder
- {
- private bool _disabled = false;
-
- public MessageDecoderResult Decodable(ByteBuffer inbuf)
- {
- if (_disabled)
- {
- return MessageDecoderResult.NOT_OK;
- }
- if (inbuf.Remaining < 8)
- {
- return MessageDecoderResult.NEED_DATA;
- }
- else
- {
- char[] expected = new char[]{'A', 'M', 'Q', 'P'};
- for (int i = 0; i < 4; i++)
- {
- if (((char) inbuf.GetByte()) != expected[i])
- {
- return MessageDecoderResult.NOT_OK;
- }
- }
- return MessageDecoderResult.OK;
- }
- }
-
- /// <summary>
- /// Decodes the specified session.
- /// </summary>
- /// <param name="inbuf">The inbuf.</param>
- /// <param name="output">The protocol output.</param>
- /// <returns></returns>
- public MessageDecoderResult Decode(ByteBuffer inbuf, IProtocolDecoderOutput output)
- {
- byte[] header = new byte[4];
- inbuf.GetBytes(header);
- ProtocolInitiation pi = new ProtocolInitiation();
- pi.Header = new char[]{'A','M','Q','P'};
- pi.ProtocolClass = inbuf.GetByte();
- pi.ProtocolInstance = inbuf.GetByte();
- pi.ProtocolMajor = inbuf.GetByte();
- pi.ProtocolMinor = inbuf.GetByte();
- output.Write(pi);
- return MessageDecoderResult.OK;
- }
-
- public bool Disabled
- {
- set
- {
- _disabled = value;
- }
- }
- }
-
- public override string ToString()
- {
- return String.Format("{0}{{Class={1} Instance={2} Major={3} Minor={4}}}",
- GetType().Name, ProtocolClass, ProtocolInstance, ProtocolMajor, ProtocolMinor);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Properties/AssemblyInfo.cs
deleted file mode 100644
index 3d3f444f3e..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/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.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.Common")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.Common")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("8dea7c69-1383-4bf7-99e9-e172eba639a2")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0.0")]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Protocol/AMQConstant.cs b/M4-RCs/qpid/dotnet/Qpid.Common/Protocol/AMQConstant.cs
deleted file mode 100644
index fcf94c29f4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Protocol/AMQConstant.cs
+++ /dev/null
@@ -1,100 +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;
-using System.Collections;
-
-namespace Apache.Qpid.Protocol
-{
- public sealed class AMQConstant
- {
- private int _code;
- private string _name;
- private static Hashtable _codeMap = new Hashtable();
-
- public int Code
- {
- get { return _code; }
- }
-
- public string Name
- {
- get { return _name; }
- }
-
- private AMQConstant(int code, string name, bool map)
- {
- _code = code;
- _name = name;
-
- if ( map )
- {
- _codeMap.Add(code, this);
- }
- }
-
- public override string ToString()
- {
- return string.Format("{0}: {1}", Code, Name);
- }
-
- public static AMQConstant GetConstant(int code)
- {
- AMQConstant c = (AMQConstant)_codeMap[code];
- if ( c == null )
- {
- c = new AMQConstant(code, "unknown code", false);
- }
- return c;
- }
-
- #region Constants
- //
- // Constants
- //
- public static readonly AMQConstant FRAME_MIN_SIZE = new AMQConstant(4096, "frame min size", true);
- public static readonly AMQConstant FRAME_END = new AMQConstant(206, "frame end", true);
- public static readonly AMQConstant REPLY_SUCCESS = new AMQConstant(200, "reply success", true);
- public static readonly AMQConstant NOT_DELIVERED = new AMQConstant(310, "not delivered", true);
- public static readonly AMQConstant MESSAGE_TOO_LARGE = new AMQConstant(311, "message too large", true);
- public static readonly AMQConstant NO_ROUTE = new AMQConstant(312, "no route", true);
- public static readonly AMQConstant NO_CONSUMERS = new AMQConstant(313, "no consumers", true);
- public static readonly AMQConstant CONTEXT_IN_USE = new AMQConstant(320, "context in use", true);
- public static readonly AMQConstant INVALID_PATH = new AMQConstant(402, "invalid path", true);
- public static readonly AMQConstant ACCESS_REFUSED = new AMQConstant(403, "access refused", true);
- public static readonly AMQConstant NOT_FOUND = new AMQConstant(404, "not found", true);
- public static readonly AMQConstant ALREADY_EXISTS = new AMQConstant(405, "already exists", true);
- public static readonly AMQConstant IN_USE = new AMQConstant(406, "in use", true);
- public static readonly AMQConstant INVALID_ROUTING_KEY = new AMQConstant(407, "routing key invalid", true);
- public static readonly AMQConstant REQUEST_TIMEOUT = new AMQConstant(408, "request timeout", true);
- public static readonly AMQConstant INVALID_ARGUMENT = new AMQConstant(409, "argument invalid", true);
- public static readonly AMQConstant FRAME_ERROR = new AMQConstant(501, "frame error", true);
- public static readonly AMQConstant SYNTAX_ERROR = new AMQConstant(502, "syntax error", true);
- public static readonly AMQConstant COMMAND_INVALID = new AMQConstant(503, "command invalid", true);
- public static readonly AMQConstant CHANNEL_ERROR = new AMQConstant(504, "channel error", true);
- public static readonly AMQConstant RESOURCE_ERROR = new AMQConstant(506, "resource error", true);
- public static readonly AMQConstant NOT_ALLOWED = new AMQConstant(530, "not allowed", true);
- public static readonly AMQConstant NOT_IMPLEMENTED = new AMQConstant(540, "not implemented", true);
- public static readonly AMQConstant INTERNAL_ERROR = new AMQConstant(541, "internal error", true);
-
- #endregion // Constants
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/Qpid.Common.csproj b/M4-RCs/qpid/dotnet/Qpid.Common/Qpid.Common.csproj
deleted file mode 100644
index 09f0a96ba9..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/Qpid.Common.csproj
+++ /dev/null
@@ -1,104 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{77064C42-24D2-4CEB-9EA2-0EF481A43205}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid</RootNamespace>
- <AssemblyName>Apache.Qpid.Common</AssemblyName>
- <SignAssembly>false</SignAssembly>
- <AssemblyOriginatorKeyFile>
- </AssemblyOriginatorKeyFile>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\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\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>lib\log4net\log4net.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Buffer\Qpid.Buffer.csproj">
- <Project>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</Project>
- <Name>Qpid.Buffer</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Codec\Qpid.Codec.csproj">
- <Project>{22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}</Project>
- <Name>Qpid.Codec</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Messaging\Qpid.Messaging.csproj">
- <Project>{6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}</Project>
- <Name>Qpid.Messaging</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <Content Include="stylesheets\csharp.xsl" />
- <Content Include="stylesheets\framing.xsl" />
- <Content Include="stylesheets\java.xsl" />
- <Content Include="stylesheets\prepare1.xsl" />
- <Content Include="stylesheets\prepare2.xsl" />
- <Content Include="stylesheets\prepare3.xsl" />
- <Content Include="stylesheets\readme.txt" />
- <Content Include="stylesheets\registry.xsl" />
- <Content Include="stylesheets\utils.xsl" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/Qpid.Common/amqp.xml b/M4-RCs/qpid/dotnet/Qpid.Common/amqp.xml
deleted file mode 100644
index ddd4b5be4b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/amqp.xml
+++ /dev/null
@@ -1,3929 +0,0 @@
-<?xml version="1.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.
-
--->
-
-
-<!--
-Copyright Notice
-================
-© Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc.,
-iMatix Corporation, IONA� Technologies, Red Hat, Inc.,
-TWIST Process Innovations, and 29West Inc. 2006. All rights reserved.
-
-License
-=======
-JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
-Corporation, IONA� Technologies, Red Hat, Inc., TWIST Process Innovations, and
-29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide,
-perpetual, royalty-free, nontransferable, nonexclusive license to
-(i) copy, display, and implement the Advanced Messaging Queue Protocol
-("AMQP") Specification and (ii) the Licensed Claims that are held by
-the Authors, all for the purpose of implementing the Advanced Messaging
-Queue Protocol Specification. Your license and any rights under this
-Agreement will terminate immediately without notice from
-any Author if you bring any claim, suit, demand, or action related to
-the Advanced Messaging Queue Protocol Specification against any Author.
-Upon termination, you shall destroy all copies of the Advanced Messaging
-Queue Protocol Specification in your possession or control.
-
-As used hereunder, "Licensed Claims" means those claims of a patent or
-patent application, throughout the world, excluding design patents and
-design registrations, owned or controlled, or that can be sublicensed
-without fee and in compliance with the requirements of this
-Agreement, by an Author or its affiliates now or at any
-future time and which would necessarily be infringed by implementation
-of the Advanced Messaging Queue Protocol Specification. A claim is
-necessarily infringed hereunder only when it is not possible to avoid
-infringing it because there is no plausible non-infringing alternative
-for implementing the required portions of the Advanced Messaging Queue
-Protocol Specification. Notwithstanding the foregoing, Licensed Claims
-shall not include any claims other than as set forth above even if
-contained in the same patent as Licensed Claims; or that read solely
-on any implementations of any portion of the Advanced Messaging Queue
-Protocol Specification that are not required by the Advanced Messaging
-Queue Protocol Specification, or that, if licensed, would require a
-payment of royalties by the licensor to unaffiliated third parties.
-Moreover, Licensed Claims shall not include (i) any enabling technologies
-that may be necessary to make or use any Licensed Product but are not
-themselves expressly set forth in the Advanced Messaging Queue Protocol
-Specification (e.g., semiconductor manufacturing technology, compiler
-technology, object oriented technology, networking technology, operating
-system technology, and the like); or (ii) the implementation of other
-published standards developed elsewhere and merely referred to in the
-body of the Advanced Messaging Queue Protocol Specification, or
-(iii) any Licensed Product and any combinations thereof the purpose or
-function of which is not required for compliance with the Advanced
-Messaging Queue Protocol Specification. For purposes of this definition,
-the Advanced Messaging Queue Protocol Specification shall be deemed to
-include both architectural and interconnection requirements essential
-for interoperability and may also include supporting source code artifacts
-where such architectural, interconnection requirements and source code
-artifacts are expressly identified as being required or documentation to
-achieve compliance with the Advanced Messaging Queue Protocol Specification.
-
-As used hereunder, "Licensed Products" means only those specific portions
-of products (hardware, software or combinations thereof) that implement
-and are compliant with all relevant portions of the Advanced Messaging
-Queue Protocol Specification.
-
-The following disclaimers, which you hereby also acknowledge as to any
-use you may make of the Advanced Messaging Queue Protocol Specification:
-
-THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS,"
-AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
-IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE
-CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE
-SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED
-MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY
-PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
-INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
-USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE
-PROTOCOL SPECIFICATION.
-
-The name and trademarks of the Authors may NOT be used in any manner,
-including advertising or publicity pertaining to the Advanced Messaging
-Queue Protocol Specification or its contents without specific, written
-prior permission. Title to copyright in the Advanced Messaging Queue
-Protocol Specification will at all times remain with the Authors.
-
-No other rights are granted by implication, estoppel or otherwise.
-
-Upon termination of your license or rights under this Agreement, you
-shall destroy all copies of the Advanced Messaging Queue Protocol
-Specification in your possession or control.
-
-Trademarks
-==========
-"JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the
-Octagon Symbol are trademarks of JPMorgan Chase & Co.
-
-IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
-IONA, IONA Technologies, and the IONA logos are trademarks of IONA
-Technologies PLC and/or its subsidiaries.
-
-LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered
-trademarks of Red Hat, Inc. in the US and other countries.
-
-Java, all Java-based trademarks and OpenOffice.org are trademarks of
-Sun Microsystems, Inc. in the United States, other countries, or both.
-
-Other company, product, or service names may be trademarks or service
-marks of others.
-
-Links to full AMQP specification:
-=================================
-http://www.envoytech.org/spec/amq/
-http://www.iona.com/opensource/amqp/
-http://www.redhat.com/solutions/specifications/amqp/
-http://www.twiststandards.org/tiki-index.php?page=AMQ
-http://www.imatix.com/amqp
-
--->
-
-<amqp major="8" minor="0" port="5672" comment="AMQ protocol 0.80">
- AMQ Protocol 0.80
-<!--
-======================================================
-== CONSTANTS
-======================================================
--->
- <constant name="frame method" value="1"/>
- <constant name="frame header" value="2"/>
- <constant name="frame body" value="3"/>
- <constant name="frame oob method" value="4"/>
- <constant name="frame oob header" value="5"/>
- <constant name="frame oob body" value="6"/>
- <constant name="frame trace" value="7"/>
- <constant name="frame heartbeat" value="8"/>
- <constant name="frame min size" value="4096"/>
- <constant name="frame end" value="206"/>
- <constant name="reply success" value="200">
- Indicates that the method completed successfully. This reply code is
- reserved for future use - the current protocol design does not use
- positive confirmation and reply codes are sent only in case of an
- error.
-</constant>
- <constant name="not delivered" value="310" class="soft error">
- The client asked for a specific message that is no longer available.
- The message was delivered to another client, or was purged from the
- queue for some other reason.
-</constant>
- <constant name="content too large" value="311" class="soft error">
- The client attempted to transfer content larger than the server
- could accept at the present time. The client may retry at a later
- time.
-</constant>
- <constant name="connection forced" value="320" class="hard error">
- An operator intervened to close the connection for some reason.
- The client may retry at some later date.
-</constant>
- <constant name="invalid path" value="402" class="hard error">
- The client tried to work with an unknown virtual host or cluster.
-</constant>
- <constant name="access refused" value="403" class="soft error">
- The client attempted to work with a server entity to which it has
- no due to security settings.
-</constant>
- <constant name="not found" value="404" class="soft error">
- The client attempted to work with a server entity that does not exist.
-</constant>
- <constant name="resource locked" value="405" class="soft error">
- The client attempted to work with a server entity to which it has
- no access because another client is working with it.
-</constant>
- <constant name="frame error" value="501" class="hard error">
- The client sent a malformed frame that the server could not decode.
- This strongly implies a programming error in the client.
-</constant>
- <constant name="syntax error" value="502" class="hard error">
- The client sent a frame that contained illegal values for one or more
- fields. This strongly implies a programming error in the client.
-</constant>
- <constant name="command invalid" value="503" class="hard error">
- The client sent an invalid sequence of frames, attempting to perform
- an operation that was considered invalid by the server. This usually
- implies a programming error in the client.
-</constant>
- <constant name="channel error" value="504" class="hard error">
- The client attempted to work with a channel that had not been
- correctly opened. This most likely indicates a fault in the client
- layer.
-</constant>
- <constant name="resource error" value="506" class="hard error">
- The server could not complete the method because it lacked sufficient
- resources. This may be due to the client creating too many of some
- type of entity.
-</constant>
- <constant name="not allowed" value="530" class="hard error">
- The client tried to work with some entity in a manner that is
- prohibited by the server, due to security settings or by some other
- criteria.
-</constant>
- <constant name="not implemented" value="540" class="hard error">
- The client tried to use functionality that is not implemented in the
- server.
-</constant>
- <constant name="internal error" value="541" class="hard error">
- The server could not complete the method because of an internal error.
- The server may require intervention by an operator in order to resume
- normal operations.
-</constant>
- <!--
-======================================================
-== DOMAIN TYPES
-======================================================
--->
- <domain name="access ticket" type="short">
- access ticket granted by server
- <doc>
- An access ticket granted by the server for a certain set of access
- rights within a specific realm. Access tickets are valid within the
- channel where they were created, and expire when the channel closes.
- </doc>
- <assert check="ne" value="0"/>
- </domain>
- <domain name="class id" type="short"/>
- <domain name="consumer tag" type="shortstr">
- consumer tag
- <doc>
- Identifier for the consumer, valid within the current connection.
- </doc>
- <rule implement="MUST">
- The consumer tag is valid only within the channel from which the
- consumer was created. I.e. a client MUST NOT create a consumer in
- one channel and then use it in another.
- </rule>
- </domain>
- <domain name="delivery tag" type="longlong">
- server-assigned delivery tag
- <doc>
- The server-assigned and channel-specific delivery tag
- </doc>
- <rule implement="MUST">
- The delivery tag is valid only within the channel from which the
- message was received. I.e. a client MUST NOT receive a message on
- one channel and then acknowledge it on another.
- </rule>
- <rule implement="MUST">
- The server MUST NOT use a zero value for delivery tags. Zero is
- reserved for client use, meaning "all messages so far received".
- </rule>
- </domain>
- <domain name="exchange name" type="shortstr">
- exchange name
- <doc>
- The exchange name is a client-selected string that identifies
- the exchange for publish methods. Exchange names may consist
- of any mixture of digits, letters, and underscores. Exchange
- names are scoped by the virtual host.
- </doc>
- <assert check="length" value="127"/>
- </domain>
- <domain name="known hosts" type="shortstr">
-list of known hosts
-<doc>
-Specifies the list of equivalent or alternative hosts that the server
-knows about, which will normally include the current server itself.
-Clients can cache this information and use it when reconnecting to a
-server after a failure.
-</doc>
- <rule implement="MAY">
-The server MAY leave this field empty if it knows of no other
-hosts than itself.
-</rule>
- </domain>
- <domain name="method id" type="short"/>
- <domain name="no ack" type="bit">
- no acknowledgement needed
- <doc>
- If this field is set the server does not expect acknowledgments
- for messages. That is, when a message is delivered to the client
- the server automatically and silently acknowledges it on behalf
- of the client. This functionality increases performance but at
- the cost of reliability. Messages can get lost if a client dies
- before it can deliver them to the application.
- </doc>
- </domain>
- <domain name="no local" type="bit">
- do not deliver own messages
- <doc>
- If the no-local field is set the server will not send messages to
- the client that published them.
- </doc>
- </domain>
- <domain name="path" type="shortstr">
- <doc>
- Must start with a slash "/" and continue with path names
- separated by slashes. A path name consists of any combination
- of at least one of [A-Za-z0-9] plus zero or more of [.-_+!=:].
-</doc>
- <assert check="notnull"/>
- <assert check="syntax" rule="path"/>
- <assert check="length" value="127"/>
- </domain>
- <domain name="peer properties" type="table">
- <doc>
-This string provides a set of peer properties, used for
-identification, debugging, and general information.
-</doc>
- <rule implement="SHOULD">
-The properties SHOULD contain these fields:
-"product", giving the name of the peer product, "version", giving
-the name of the peer version, "platform", giving the name of the
-operating system, "copyright", if appropriate, and "information",
-giving other general information.
-</rule>
- </domain>
- <domain name="queue name" type="shortstr">
- queue name
- <doc>
- The queue name identifies the queue within the vhost. Queue
- names may consist of any mixture of digits, letters, and
- underscores.
- </doc>
- <assert check="length" value="127"/>
- </domain>
- <domain name="redelivered" type="bit">
- message is being redelivered
- <doc>
- This indicates that the message has been previously delivered to
- this or another client.
- </doc>
- <rule implement="SHOULD">
- The server SHOULD try to signal redelivered messages when it can.
- When redelivering a message that was not successfully acknowledged,
- the server SHOULD deliver it to the original client if possible.
- </rule>
- <rule implement="MUST">
- The client MUST NOT rely on the redelivered field but MUST take it
- as a hint that the message may already have been processed. A
- fully robust client must be able to track duplicate received messages
- on non-transacted, and locally-transacted channels.
- </rule>
- </domain>
- <domain name="reply code" type="short">
-reply code from server
-<doc>
- The reply code. The AMQ reply codes are defined in AMQ RFC 011.
-</doc>
- <assert check="notnull"/>
- </domain>
- <domain name="reply text" type="shortstr">
-localised reply text
-<doc>
- The localised reply text. This text can be logged as an aid to
- resolving issues.
-</doc>
- <assert check="notnull"/>
- </domain>
- <class name="connection" handler="connection" index="10">
- <!--
-======================================================
-== CONNECTION
-======================================================
--->
- work with socket connections
-<doc>
- The connection class provides methods for a client to establish a
- network connection to a server, and for both peers to operate the
- connection thereafter.
-</doc>
- <doc name="grammar">
- connection = open-connection *use-connection close-connection
- open-connection = C:protocol-header
- S:START C:START-OK
- *challenge
- S:TUNE C:TUNE-OK
- C:OPEN S:OPEN-OK | S:REDIRECT
- challenge = S:SECURE C:SECURE-OK
- use-connection = *channel
- close-connection = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="start" synchronous="1" index="10">
- start connection negotiation
- <doc>
- This method starts the connection negotiation process by telling
- the client the protocol version that the server proposes, along
- with a list of security mechanisms which the client can use for
- authentication.
- </doc>
- <rule implement="MUST">
- If the client cannot handle the protocol version suggested by the
- server it MUST close the socket connection.
- </rule>
- <rule implement="MUST">
- The server MUST provide a protocol version that is lower than or
- equal to that requested by the client in the protocol header. If
- the server cannot support the specified protocol it MUST NOT send
- this method, but MUST close the socket connection.
- </rule>
- <chassis name="client" implement="MUST"/>
- <response name="start-ok"/>
- <field name="version major" type="octet">
- protocol major version
- <doc>
- The protocol major version that the server agrees to use, which
- cannot be higher than the client's major version.
- </doc>
- </field>
- <field name="version minor" type="octet">
- protocol major version
- <doc>
- The protocol minor version that the server agrees to use, which
- cannot be higher than the client's minor version.
- </doc>
- </field>
- <field name="server properties" domain="peer properties">
- server properties
- </field>
- <field name="mechanisms" type="longstr">
- available security mechanisms
- <doc>
- A list of the security mechanisms that the server supports, delimited
- by spaces. Currently ASL supports these mechanisms: PLAIN.
- </doc>
- <see name="security mechanisms"/>
- <assert check="notnull"/>
- </field>
- <field name="locales" type="longstr">
- available message locales
- <doc>
- A list of the message locales that the server supports, delimited
- by spaces. The locale defines the language in which the server
- will send reply texts.
- </doc>
- <rule implement="MUST">
- All servers MUST support at least the en_US locale.
- </rule>
- <assert check="notnull"/>
- </field>
- </method>
- <method name="start-ok" synchronous="1" index="11">
- select security mechanism and locale
- <doc>
- This method selects a SASL security mechanism. ASL uses SASL
- (RFC2222) to negotiate authentication and encryption.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="client properties" domain="peer properties">
- client properties
- </field>
- <field name="mechanism" type="shortstr">
- selected security mechanism
- <doc>
- A single security mechanisms selected by the client, which must be
- one of those specified by the server.
- </doc>
- <rule implement="SHOULD">
- The client SHOULD authenticate using the highest-level security
- profile it can handle from the list provided by the server.
- </rule>
- <rule implement="MUST">
- The mechanism field MUST contain one of the security mechanisms
- proposed by the server in the Start method. If it doesn't, the
- server MUST close the socket.
- </rule>
- <assert check="notnull"/>
- </field>
- <field name="response" type="longstr">
- security response data
- <doc>
- A block of opaque data passed to the security mechanism. The contents
- of this data are defined by the SASL security mechanism. For the
- PLAIN security mechanism this is defined as a field table holding
- two fields, LOGIN and PASSWORD.
- </doc>
- <assert check="notnull"/>
- </field>
- <field name="locale" type="shortstr">
- selected message locale
- <doc>
- A single message local selected by the client, which must be one
- of those specified by the server.
- </doc>
- <assert check="notnull"/>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="secure" synchronous="1" index="20">
- security mechanism challenge
- <doc>
- The SASL protocol works by exchanging challenges and responses until
- both peers have received sufficient information to authenticate each
- other. This method challenges the client to provide more information.
- </doc>
- <chassis name="client" implement="MUST"/>
- <response name="secure-ok"/>
- <field name="challenge" type="longstr">
- security challenge data
- <doc>
- Challenge information, a block of opaque binary data passed to
- the security mechanism.
- </doc>
- <see name="security mechanisms"/>
- </field>
- </method>
- <method name="secure-ok" synchronous="1" index="21">
- security mechanism response
- <doc>
- This method attempts to authenticate, passing a block of SASL data
- for the security mechanism at the server side.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="response" type="longstr">
- security response data
- <doc>
- A block of opaque data passed to the security mechanism. The contents
- of this data are defined by the SASL security mechanism.
- </doc>
- <assert check="notnull"/>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="tune" synchronous="1" index="30">
- propose connection tuning parameters
- <doc>
- This method proposes a set of connection configuration values
- to the client. The client can accept and/or adjust these.
- </doc>
- <chassis name="client" implement="MUST"/>
- <response name="tune-ok"/>
- <field name="channel max" type="short">
- proposed maximum channels
- <doc>
- The maximum total number of channels that the server allows
- per connection. Zero means that the server does not impose a
- fixed limit, but the number of allowed channels may be limited
- by available server resources.
- </doc>
- </field>
- <field name="frame max" type="long">
- proposed maximum frame size
- <doc>
- The largest frame size that the server proposes for the
- connection. The client can negotiate a lower value. Zero means
- that the server does not impose any specific limit but may reject
- very large frames if it cannot allocate resources for them.
- </doc>
- <rule implement="MUST">
- Until the frame-max has been negotiated, both peers MUST accept
- frames of up to 4096 octets large. The minimum non-zero value for
- the frame-max field is 4096.
- </rule>
- </field>
- <field name="heartbeat" type="short">
- desired heartbeat delay
- <doc>
- The delay, in seconds, of the connection heartbeat that the server
- wants. Zero means the server does not want a heartbeat.
- </doc>
- </field>
- </method>
- <method name="tune-ok" synchronous="1" index="31">
- negotiate connection tuning parameters
- <doc>
- This method sends the client's connection tuning parameters to the
- server. Certain fields are negotiated, others provide capability
- information.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="channel max" type="short">
- negotiated maximum channels
- <doc>
- The maximum total number of channels that the client will use
- per connection. May not be higher than the value specified by
- the server.
- </doc>
- <rule implement="MAY">
- The server MAY ignore the channel-max value or MAY use it for
- tuning its resource allocation.
- </rule>
- <assert check="notnull"/>
- <assert check="le" method="tune" field="channel max"/>
- </field>
- <field name="frame max" type="long">
- negotiated maximum frame size
- <doc>
- The largest frame size that the client and server will use for
- the connection. Zero means that the client does not impose any
- specific limit but may reject very large frames if it cannot
- allocate resources for them. Note that the frame-max limit
- applies principally to content frames, where large contents
- can be broken into frames of arbitrary size.
- </doc>
- <rule implement="MUST">
- Until the frame-max has been negotiated, both peers must accept
- frames of up to 4096 octets large. The minimum non-zero value for
- the frame-max field is 4096.
- </rule>
- </field>
- <field name="heartbeat" type="short">
- desired heartbeat delay
- <doc>
- The delay, in seconds, of the connection heartbeat that the client
- wants. Zero means the client does not want a heartbeat.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="open" synchronous="1" index="40">
- open connection to virtual host
- <doc>
- This method opens a connection to a virtual host, which is a
- collection of resources, and acts to separate multiple application
- domains within a server.
- </doc>
- <rule implement="MUST">
- The client MUST open the context before doing any work on the
- connection.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="open-ok"/>
- <response name="redirect"/>
- <field name="virtual host" domain="path">
- virtual host name
- <assert check="regexp" value="^[a-zA-Z0-9/-_]+$"/>
- <doc>
- The name of the virtual host to work with.
- </doc>
- <rule implement="MUST">
- If the server supports multiple virtual hosts, it MUST enforce a
- full separation of exchanges, queues, and all associated entities
- per virtual host. An application, connected to a specific virtual
- host, MUST NOT be able to access resources of another virtual host.
- </rule>
- <rule implement="SHOULD">
- The server SHOULD verify that the client has permission to access
- the specified virtual host.
- </rule>
- <rule implement="MAY">
- The server MAY configure arbitrary limits per virtual host, such
- as the number of each type of entity that may be used, per
- connection and/or in total.
- </rule>
- </field>
- <field name="capabilities" type="shortstr">
- required capabilities
- <doc>
- The client may specify a number of capability names, delimited by
- spaces. The server can use this string to how to process the
- client's connection request.
- </doc>
- </field>
- <field name="insist" type="bit">
- insist on connecting to server
- <doc>
- In a configuration with multiple load-sharing servers, the server
- may respond to a Connection.Open method with a Connection.Redirect.
- The insist option tells the server that the client is insisting on
- a connection to the specified server.
- </doc>
- <rule implement="SHOULD">
- When the client uses the insist option, the server SHOULD accept
- the client connection unless it is technically unable to do so.
- </rule>
- </field>
- </method>
- <method name="open-ok" synchronous="1" index="41">
- signal that the connection is ready
- <doc>
- This method signals to the client that the connection is ready for
- use.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="known hosts" domain="known hosts"/>
- </method>
- <method name="redirect" synchronous="1" index="50">
- asks the client to use a different server
- <doc>
- This method redirects the client to another server, based on the
- requested virtual host and/or capabilities.
- </doc>
- <rule implement="SHOULD">
- When getting the Connection.Redirect method, the client SHOULD
- reconnect to the host specified, and if that host is not present,
- to any of the hosts specified in the known-hosts list.
- </rule>
- <chassis name="client" implement="MAY"/>
- <field name="host" type="shortstr">
- server to connect to
- <doc>
- Specifies the server to connect to. This is an IP address or a
- DNS name, optionally followed by a colon and a port number. If
- no port number is specified, the client should use the default
- port number for the protocol.
- </doc>
- <assert check="notnull"/>
- </field>
- <field name="known hosts" domain="known hosts"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="close" synchronous="1" index="60">
- request a connection close
- <doc>
- This method indicates that the sender wants to close the connection.
- This may be due to internal conditions (e.g. a forced shut-down) or
- due to an error handling a specific method, i.e. an exception. When
- a close is due to an exception, the sender provides the class and
- method id of the method which caused the exception.
- </doc>
- <rule implement="MUST">
- After sending this method any received method except the Close-OK
- method MUST be discarded.
- </rule>
- <rule implement="MAY">
- The peer sending this method MAY use a counter or timeout to
- detect failure of the other peer to respond correctly with
- the Close-OK method.
- </rule>
- <rule implement="MUST">
- When a server receives the Close method from a client it MUST
- delete all server-side resources associated with the client's
- context. A client CANNOT reconnect to a context after sending
- or receiving a Close method.
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="close-ok"/>
- <field name="reply code" domain="reply code"/>
- <field name="reply text" domain="reply text"/>
- <field name="class id" domain="class id">
- failing method class
- <doc>
- When the close is provoked by a method exception, this is the
- class of the method.
- </doc>
- </field>
- <field name="method id" domain="class id">
- failing method ID
- <doc>
- When the close is provoked by a method exception, this is the
- ID of the method.
- </doc>
- </field>
- </method>
- <method name="close-ok" synchronous="1" index="61">
- confirm a connection close
- <doc>
- This method confirms a Connection.Close method and tells the
- recipient that it is safe to release resources for the connection
- and close the socket.
- </doc>
- <rule implement="SHOULD">
- A peer that detects a socket closure without having received a
- Close-Ok handshake method SHOULD log the error.
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- </method>
- </class>
- <class name="channel" handler="channel" index="20">
- <!--
-======================================================
-== CHANNEL
-======================================================
--->
- work with channels
-<doc>
- The channel class provides methods for a client to establish a virtual
- connection - a channel - to a server and for both peers to operate the
- virtual connection thereafter.
-</doc>
- <doc name="grammar">
- channel = open-channel *use-channel close-channel
- open-channel = C:OPEN S:OPEN-OK
- use-channel = C:FLOW S:FLOW-OK
- / S:FLOW C:FLOW-OK
- / S:ALERT
- / functional-class
- close-channel = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="open" synchronous="1" index="10">
- open a channel for use
- <doc>
- This method opens a virtual connection (a channel).
- </doc>
- <rule implement="MUST">
- This method MUST NOT be called when the channel is already open.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="open-ok"/>
- <field name="out of band" type="shortstr">
- out-of-band settings
- <doc>
- Configures out-of-band transfers on this channel. The syntax and
- meaning of this field will be formally defined at a later date.
- </doc>
- <assert check="null"/>
- </field>
- </method>
- <method name="open-ok" synchronous="1" index="11">
- signal that the channel is ready
- <doc>
- This method signals to the client that the channel is ready for use.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="flow" synchronous="1" index="20">
- enable/disable flow from peer
- <doc>
- This method asks the peer to pause or restart the flow of content
- data. This is a simple flow-control mechanism that a peer can use
- to avoid oveflowing its queues or otherwise finding itself receiving
- more messages than it can process. Note that this method is not
- intended for window control. The peer that receives a request to
- stop sending content should finish sending the current content, if
- any, and then wait until it receives a Flow restart method.
- </doc>
- <rule implement="MAY">
- When a new channel is opened, it is active. Some applications
- assume that channels are inactive until started. To emulate this
- behaviour a client MAY open the channel, then pause it.
- </rule>
- <rule implement="SHOULD">
- When sending content data in multiple frames, a peer SHOULD monitor
- the channel for incoming methods and respond to a Channel.Flow as
- rapidly as possible.
- </rule>
- <rule implement="MAY">
- A peer MAY use the Channel.Flow method to throttle incoming content
- data for internal reasons, for example, when exchangeing data over a
- slower connection.
- </rule>
- <rule implement="MAY">
- The peer that requests a Channel.Flow method MAY disconnect and/or
- ban a peer that does not respect the request.
- </rule>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <response name="flow-ok"/>
- <field name="active" type="bit">
- start/stop content frames
- <doc>
- If 1, the peer starts sending content frames. If 0, the peer
- stops sending content frames.
- </doc>
- </field>
- </method>
- <method name="flow-ok" index="21">
- confirm a flow method
- <doc>
- Confirms to the peer that a flow command was received and processed.
- </doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <field name="active" type="bit">
- current flow setting
- <doc>
- Confirms the setting of the processed flow method: 1 means the
- peer will start sending or continue to send content frames; 0
- means it will not.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="alert" index="30">
- send a non-fatal warning message
- <doc>
- This method allows the server to send a non-fatal warning to the
- client. This is used for methods that are normally asynchronous
- and thus do not have confirmations, and for which the server may
- detect errors that need to be reported. Fatal errors are handled
- as channel or connection exceptions; non-fatal errors are sent
- through this method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="reply code" domain="reply code"/>
- <field name="reply text" domain="reply text"/>
- <field name="details" type="table">
- detailed information for warning
- <doc>
- A set of fields that provide more information about the
- problem. The meaning of these fields are defined on a
- per-reply-code basis (TO BE DEFINED).
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="close" synchronous="1" index="40">
- request a channel close
- <doc>
- This method indicates that the sender wants to close the channel.
- This may be due to internal conditions (e.g. a forced shut-down) or
- due to an error handling a specific method, i.e. an exception. When
- a close is due to an exception, the sender provides the class and
- method id of the method which caused the exception.
- </doc>
- <rule implement="MUST">
- After sending this method any received method except
- Channel.Close-OK MUST be discarded.
- </rule>
- <rule implement="MAY">
- The peer sending this method MAY use a counter or timeout to detect
- failure of the other peer to respond correctly with Channel.Close-OK..
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="close-ok"/>
- <field name="reply code" domain="reply code"/>
- <field name="reply text" domain="reply text"/>
- <field name="class id" domain="class id">
- failing method class
- <doc>
- When the close is provoked by a method exception, this is the
- class of the method.
- </doc>
- </field>
- <field name="method id" domain="method id">
- failing method ID
- <doc>
- When the close is provoked by a method exception, this is the
- ID of the method.
- </doc>
- </field>
- </method>
- <method name="close-ok" synchronous="1" index="41">
- confirm a channel close
- <doc>
- This method confirms a Channel.Close method and tells the recipient
- that it is safe to release resources for the channel and close the
- socket.
- </doc>
- <rule implement="SHOULD">
- A peer that detects a socket closure without having received a
- Channel.Close-Ok handshake method SHOULD log the error.
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- </method>
- </class>
- <class name="access" handler="connection" index="30">
- <!--
-======================================================
-== ACCESS CONTROL
-======================================================
--->
- work with access tickets
-<doc>
- The protocol control access to server resources using access tickets.
- A client must explicitly request access tickets before doing work.
- An access ticket grants a client the right to use a specific set of
- resources - called a "realm" - in specific ways.
-</doc>
- <doc name="grammar">
- access = C:REQUEST S:REQUEST-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="request" synchronous="1" index="10">
- request an access ticket
- <doc>
- This method requests an access ticket for an access realm.
- The server responds by granting the access ticket. If the
- client does not have access rights to the requested realm
- this causes a connection exception. Access tickets are a
- per-channel resource.
- </doc>
- <rule implement="MUST">
- The realm name MUST start with either "/data" (for application
- resources) or "/admin" (for server administration resources).
- If the realm starts with any other path, the server MUST raise
- a connection exception with reply code 403 (access refused).
- </rule>
- <rule implement="MUST">
- The server MUST implement the /data realm and MAY implement the
- /admin realm. The mapping of resources to realms is not
- defined in the protocol - this is a server-side configuration
- issue.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="request-ok"/>
- <field name="realm" domain="path">
- name of requested realm
- <rule implement="MUST">
- If the specified realm is not known to the server, the server
- must raise a channel exception with reply code 402 (invalid
- path).
- </rule>
- </field>
- <field name="exclusive" type="bit">
- request exclusive access
- <doc>
- Request exclusive access to the realm. If the server cannot grant
- this - because there are other active tickets for the realm - it
- raises a channel exception.
- </doc>
- </field>
- <field name="passive" type="bit">
- request passive access
- <doc>
- Request message passive access to the specified access realm.
- Passive access lets a client get information about resources in
- the realm but not to make any changes to them.
- </doc>
- </field>
- <field name="active" type="bit">
- request active access
- <doc>
- Request message active access to the specified access realm.
- Acvtive access lets a client get create and delete resources in
- the realm.
- </doc>
- </field>
- <field name="write" type="bit">
- request write access
- <doc>
- Request write access to the specified access realm. Write access
- lets a client publish messages to all exchanges in the realm.
- </doc>
- </field>
- <field name="read" type="bit">
- request read access
- <doc>
- Request read access to the specified access realm. Read access
- lets a client consume messages from queues in the realm.
- </doc>
- </field>
- </method>
- <method name="request-ok" synchronous="1" index="11">
- grant access to server resources
- <doc>
- This method provides the client with an access ticket. The access
- ticket is valid within the current channel and for the lifespan of
- the channel.
- </doc>
- <rule implement="MUST">
- The client MUST NOT use access tickets except within the same
- channel as originally granted.
- </rule>
- <rule implement="MUST">
- The server MUST isolate access tickets per channel and treat an
- attempt by a client to mix these as a connection exception.
- </rule>
- <chassis name="client" implement="MUST"/>
- <field name="ticket" domain="access ticket"/>
- </method>
- </class>
- <class name="exchange" handler="channel" index="40">
- <!--
-======================================================
-== EXCHANGES (or "routers", if you prefer)
-== (Or matchers, plugins, extensions, agents,... Routing is just one of
-== the many fun things an exchange can do.)
-======================================================
--->
- work with exchanges
-<doc>
- Exchanges match and distribute messages across queues. Exchanges can be
- configured in the server or created at runtime.
-</doc>
- <doc name="grammar">
- exchange = C:DECLARE S:DECLARE-OK
- / C:DELETE S:DELETE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <rule implement="MUST">
- <test>amq_exchange_19</test>
- The server MUST implement the direct and fanout exchange types, and
- predeclare the corresponding exchanges named amq.direct and amq.fanout
- in each virtual host. The server MUST also predeclare a direct
- exchange to act as the default exchange for content Publish methods
- and for default queue bindings.
-</rule>
- <rule implement="SHOULD">
- <test>amq_exchange_20</test>
- The server SHOULD implement the topic exchange type, and predeclare
- the corresponding exchange named amq.topic in each virtual host.
-</rule>
- <rule implement="MAY">
- <test>amq_exchange_21</test>
- The server MAY implement the system exchange type, and predeclare the
- corresponding exchanges named amq.system in each virtual host. If the
- client attempts to bind a queue to the system exchange, the server
- MUST raise a connection exception with reply code 507 (not allowed).
-</rule>
- <rule implement="MUST">
- <test>amq_exchange_22</test>
- The default exchange MUST be defined as internal, and be inaccessible
- to the client except by specifying an empty exchange name in a content
- Publish method. That is, the server MUST NOT let clients make explicit
- bindings to this exchange.
-</rule>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="declare" synchronous="1" index="10">
- declare exchange, create if needed
- <doc>
- This method creates an exchange if it does not already exist, and if the
- exchange exists, verifies that it is of the correct and expected class.
- </doc>
- <rule implement="SHOULD">
- <test>amq_exchange_23</test>
- The server SHOULD support a minimum of 16 exchanges per virtual host
- and ideally, impose no limit except as defined by available resources.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="declare-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- When a client defines a new exchange, this belongs to the access realm
- of the ticket used. All further work done with that exchange must be
- done with an access ticket for the same realm.
- </doc>
- <rule implement="MUST">
- The client MUST provide a valid access ticket giving "active" access
- to the realm in which the exchange exists or will be created, or
- "passive" access if the if-exists flag is set.
- </rule>
- </field>
- <field name="exchange" domain="exchange name">
- <rule implement="MUST">
- <test>amq_exchange_15</test>
- Exchange names starting with "amq." are reserved for predeclared
- and standardised exchanges. If the client attempts to create an
- exchange starting with "amq.", the server MUST raise a channel
- exception with reply code 403 (access refused).
- </rule>
- <assert check="regexp" value="^[a-zA-Z0-9-_.:]+$"/>
- </field>
- <field name="type" type="shortstr">
- exchange type
- <doc>
- Each exchange belongs to one of a set of exchange types implemented
- by the server. The exchange types define the functionality of the
- exchange - i.e. how messages are routed through it. It is not valid
- or meaningful to attempt to change the type of an existing exchange.
- </doc>
- <rule implement="MUST">
- <test>amq_exchange_16</test>
- If the exchange already exists with a different type, the server
- MUST raise a connection exception with a reply code 507 (not allowed).
- </rule>
- <rule implement="MUST">
- <test>amq_exchange_18</test>
- If the server does not support the requested exchange type it MUST
- raise a connection exception with a reply code 503 (command invalid).
- </rule>
- <assert check="regexp" value="^[a-zA-Z0-9-_.:]+$"/>
- </field>
- <field name="passive" type="bit">
- do not create exchange
- <doc>
- If set, the server will not create the exchange. The client can use
- this to check whether an exchange exists without modifying the server
- state.
- </doc>
- <rule implement="MUST">
- <test>amq_exchange_05</test>
- If set, and the exchange does not already exist, the server MUST
- raise a channel exception with reply code 404 (not found).
- </rule>
- </field>
- <field name="durable" type="bit">
- request a durable exchange
- <doc>
- If set when creating a new exchange, the exchange will be marked as
- durable. Durable exchanges remain active when a server restarts.
- Non-durable exchanges (transient exchanges) are purged if/when a
- server restarts.
- </doc>
- <rule implement="MUST">
- <test>amq_exchange_24</test>
- The server MUST support both durable and transient exchanges.
- </rule>
- <rule implement="MUST">
- The server MUST ignore the durable field if the exchange already
- exists.
- </rule>
- </field>
- <field name="auto delete" type="bit">
- auto-delete when unused
- <doc>
- If set, the exchange is deleted when all queues have finished
- using it.
- </doc>
- <rule implement="SHOULD">
- <test>amq_exchange_02</test>
- The server SHOULD allow for a reasonable delay between the point
- when it determines that an exchange is not being used (or no longer
- used), and the point when it deletes the exchange. At the least it
- must allow a client to create an exchange and then bind a queue to
- it, with a small but non-zero delay between these two actions.
- </rule>
- <rule implement="MUST">
- <test>amq_exchange_25</test>
- The server MUST ignore the auto-delete field if the exchange already
- exists.
- </rule>
- </field>
- <field name="internal" type="bit">
- create internal exchange
- <doc>
- If set, the exchange may not be used directly by publishers, but
- only when bound to other exchanges. Internal exchanges are used to
- construct wiring that is not visible to applications.
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- <field name="arguments" type="table">
- arguments for declaration
- <doc>
- A set of arguments for the declaration. The syntax and semantics
- of these arguments depends on the server implementation. This
- field is ignored if passive is 1.
- </doc>
- </field>
- </method>
- <method name="declare-ok" synchronous="1" index="11">
- confirms an exchange declaration
- <doc>
- This method confirms a Declare method and confirms the name of the
- exchange, essential for automatically-named exchanges.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="delete" synchronous="1" index="20">
- delete an exchange
- <doc>
- This method deletes an exchange. When an exchange is deleted all queue
- bindings on the exchange are cancelled.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="delete-ok"/>
- <field name="ticket" domain="access ticket">
- <rule implement="MUST">
- The client MUST provide a valid access ticket giving "active"
- access rights to the exchange's access realm.
- </rule>
- </field>
- <field name="exchange" domain="exchange name">
- <rule implement="MUST">
- <test>amq_exchange_11</test>
- The exchange MUST exist. Attempting to delete a non-existing exchange
- causes a channel exception.
- </rule>
- <assert check="notnull"/>
- </field>
- <field name="if unused" type="bit">
- delete only if unused
- <doc>
- If set, the server will only delete the exchange if it has no queue
- bindings. If the exchange has queue bindings the server does not
- delete it but raises a channel exception instead.
- </doc>
- <rule implement="SHOULD">
- <test>amq_exchange_12</test>
- If set, the server SHOULD delete the exchange but only if it has
- no queue bindings.
- </rule>
- <rule implement="SHOULD">
- <test>amq_exchange_13</test>
- If set, the server SHOULD raise a channel exception if the exchange is in
- use.
- </rule>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- </method>
- <method name="delete-ok" synchronous="1" index="21">
- confirm deletion of an exchange
- <doc>
- This method confirms the deletion of an exchange.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- </class>
- <class name="queue" handler="channel" index="50">
- <!--
-======================================================
-== QUEUES
-======================================================
--->
- work with queues
-
-<doc>
- Queues store and forward messages. Queues can be configured in the server
- or created at runtime. Queues must be attached to at least one exchange
- in order to receive messages from publishers.
-</doc>
- <doc name="grammar">
- queue = C:DECLARE S:DECLARE-OK
- / C:BIND S:BIND-OK
- / C:PURGE S:PURGE-OK
- / C:DELETE S:DELETE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <rule implement="MUST">
- <test>amq_queue_33</test>
- A server MUST allow any content class to be sent to any queue, in any
- mix, and queue and delivery these content classes independently. Note
- that all methods that fetch content off queues are specific to a given
- content class.
-</rule>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="declare" synchronous="1" index="10">
- declare queue, create if needed
- <doc>
- This method creates or checks a queue. When creating a new queue
- the client can specify various properties that control the durability
- of the queue and its contents, and the level of sharing for the queue.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_34</test>
- The server MUST create a default binding for a newly-created queue
- to the default exchange, which is an exchange of type 'direct'.
- </rule>
- <rule implement="SHOULD">
- <test>amq_queue_35</test>
- The server SHOULD support a minimum of 256 queues per virtual host
- and ideally, impose no limit except as defined by available resources.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="declare-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- When a client defines a new queue, this belongs to the access realm
- of the ticket used. All further work done with that queue must be
- done with an access ticket for the same realm.
- </doc>
- <doc>
- The client provides a valid access ticket giving "active" access
- to the realm in which the queue exists or will be created, or
- "passive" access if the if-exists flag is set.
- </doc>
- </field>
- <field name="queue" domain="queue name">
- <rule implement="MAY">
- <test>amq_queue_10</test>
- The queue name MAY be empty, in which case the server MUST create
- a new queue with a unique generated name and return this to the
- client in the Declare-Ok method.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_32</test>
- Queue names starting with "amq." are reserved for predeclared and
- standardised server queues. If the queue name starts with "amq."
- and the passive option is zero, the server MUST raise a connection
- exception with reply code 403 (access refused).
- </rule>
- <assert check="regexp" value="^[a-zA-Z0-9-_.:]*$"/>
- </field>
- <field name="passive" type="bit">
- do not create queue
- <doc>
- If set, the server will not create the queue. The client can use
- this to check whether a queue exists without modifying the server
- state.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_05</test>
- If set, and the queue does not already exist, the server MUST
- respond with a reply code 404 (not found) and raise a channel
- exception.
- </rule>
- </field>
- <field name="durable" type="bit">
- request a durable queue
- <doc>
- If set when creating a new queue, the queue will be marked as
- durable. Durable queues remain active when a server restarts.
- Non-durable queues (transient queues) are purged if/when a
- server restarts. Note that durable queues do not necessarily
- hold persistent messages, although it does not make sense to
- send persistent messages to a transient queue.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_03</test>
- The server MUST recreate the durable queue after a restart.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_36</test>
- The server MUST support both durable and transient queues.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_37</test>
- The server MUST ignore the durable field if the queue already
- exists.
- </rule>
- </field>
- <field name="exclusive" type="bit">
- request an exclusive queue
- <doc>
- Exclusive queues may only be consumed from by the current connection.
- Setting the 'exclusive' flag always implies 'auto-delete'.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_38</test>
- The server MUST support both exclusive (private) and non-exclusive
- (shared) queues.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_04</test>
- The server MUST raise a channel exception if 'exclusive' is specified
- and the queue already exists and is owned by a different connection.
- </rule>
- </field>
- <field name="auto delete" type="bit">
- auto-delete queue when unused
- <doc>
- If set, the queue is deleted when all consumers have finished
- using it. Last consumer can be cancelled either explicitly or because
- its channel is closed. If there was no consumer ever on the queue, it
- won't be deleted.
- </doc>
- <rule implement="SHOULD">
- <test>amq_queue_02</test>
- The server SHOULD allow for a reasonable delay between the point
- when it determines that a queue is not being used (or no longer
- used), and the point when it deletes the queue. At the least it
- must allow a client to create a queue and then create a consumer
- to read from it, with a small but non-zero delay between these
- two actions. The server should equally allow for clients that may
- be disconnected prematurely, and wish to re-consume from the same
- queue without losing messages. We would recommend a configurable
- timeout, with a suitable default value being one minute.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_31</test>
- The server MUST ignore the auto-delete field if the queue already
- exists.
- </rule>
- </field>
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- <field name="arguments" type="table">
- arguments for declaration
- <doc>
- A set of arguments for the declaration. The syntax and semantics
- of these arguments depends on the server implementation. This
- field is ignored if passive is 1.
- </doc>
- </field>
- </method>
- <method name="declare-ok" synchronous="1" index="11">
- confirms a queue definition
- <doc>
- This method confirms a Declare method and confirms the name of the
- queue, essential for automatically-named queues.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="queue" domain="queue name">
- <doc>
- Reports the name of the queue. If the server generated a queue
- name, this field contains that name.
- </doc>
- <assert check="notnull"/>
- </field>
- <field name="message count" type="long">
- number of messages in queue
- <doc>
- Reports the number of messages in the queue, which will be zero
- for newly-created queues.
- </doc>
- </field>
- <field name="consumer count" type="long">
- number of consumers
- <doc>
- Reports the number of active consumers for the queue. Note that
- consumers can suspend activity (Channel.Flow) in which case they
- do not appear in this count.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="bind" synchronous="1" index="20">
- bind queue to an exchange
- <doc>
- This method binds a queue to an exchange. Until a queue is
- bound it will not receive any messages. In a classic messaging
- model, store-and-forward queues are bound to a dest exchange
- and subscription queues are bound to a dest_wild exchange.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_25</test>
- A server MUST allow ignore duplicate bindings - that is, two or
- more bind methods for a specific queue, with identical arguments
- - without treating these as an error.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_39</test>
- If a bind fails, the server MUST raise a connection exception.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_12</test>
- The server MUST NOT allow a durable queue to bind to a transient
- exchange. If the client attempts this the server MUST raise a
- channel exception.
- </rule>
- <rule implement="SHOULD">
- <test>amq_queue_13</test>
- Bindings for durable queues are automatically durable and the
- server SHOULD restore such bindings after a server restart.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_17</test>
- If the client attempts to an exchange that was declared as internal,
- the server MUST raise a connection exception with reply code 530
- (not allowed).
- </rule>
- <rule implement="SHOULD">
- <test>amq_queue_40</test>
- The server SHOULD support at least 4 bindings per queue, and
- ideally, impose no limit except as defined by available resources.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="bind-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- The client provides a valid access ticket giving "active"
- access rights to the queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to bind. If the queue name is
- empty, refers to the current queue for the channel, which is
- the last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue
- name in this method is empty, the server MUST raise a connection
- exception with reply code 530 (not allowed).
- </doc>
- <doc name = "rule" test = "amq_queue_26">
- If the queue does not exist the server MUST raise a channel exception
- with reply code 404 (not found).
- </doc>
- </field>
-
- <field name="exchange" domain="exchange name">
- The name of the exchange to bind to.
- <rule implement="MUST">
- <test>amq_queue_14</test>
- If the exchange does not exist the server MUST raise a channel
- exception with reply code 404 (not found).
- </rule>
- </field>
- <field name="routing key" type="shortstr">
- message routing key
- <doc>
- Specifies the routing key for the binding. The routing key is
- used for routing messages depending on the exchange configuration.
- Not all exchanges use a routing key - refer to the specific
- exchange documentation. If the routing key is empty and the queue
- name is empty, the routing key will be the current queue for the
- channel, which is the last declared queue.
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- <field name="arguments" type="table">
- arguments for binding
- <doc>
- A set of arguments for the binding. The syntax and semantics of
- these arguments depends on the exchange class.
- </doc>
- </field>
- </method>
- <method name="bind-ok" synchronous="1" index="21">
- confirm bind successful
- <doc>
- This method confirms that the bind was successful.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="purge" synchronous="1" index="30">
- purge a queue
- <doc>
- This method removes all messages from a queue. It does not cancel
- consumers. Purged messages are deleted without any formal "undo"
- mechanism.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_15</test>
- A call to purge MUST result in an empty queue.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_41</test>
- On transacted channels the server MUST not purge messages that have
- already been sent to a client but not yet acknowledged.
- </rule>
- <rule implement="MAY">
- <test>amq_queue_42</test>
- The server MAY implement a purge queue or log that allows system
- administrators to recover accidentally-purged messages. The server
- SHOULD NOT keep purged messages in the same storage spaces as the
- live messages since the volumes of purged messages may get very
- large.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="purge-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- The access ticket must be for the access realm that holds the
- queue.
- </doc>
- <rule implement="MUST">
- The client MUST provide a valid access ticket giving "read" access
- rights to the queue's access realm. Note that purging a queue is
- equivalent to reading all messages and discarding them.
- </rule>
- </field>
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to purge. If the queue name is
- empty, refers to the current queue for the channel, which is
- the last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue
- name in this method is empty, the server MUST raise a connection
- exception with reply code 530 (not allowed).
- </doc>
- <doc name = "rule" test = "amq_queue_16">
- The queue must exist. Attempting to purge a non-existing queue
- causes a channel exception.
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
- </method>
- <method name="purge-ok" synchronous="1" index="31">
- confirms a queue purge
- <doc>
- This method confirms the purge of a queue.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="message count" type="long">
- number of messages purged
- <doc>
- Reports the number of messages purged.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="delete" synchronous="1" index="40">
- delete a queue
- <doc>
- This method deletes a queue. When a queue is deleted any pending
- messages are sent to a dead-letter queue if this is defined in the
- server configuration, and all consumers on the queue are cancelled.
- </doc>
- <rule implement="SHOULD">
- <test>amq_queue_43</test>
- The server SHOULD use a dead-letter queue to hold messages that
- were pending on a deleted queue, and MAY provide facilities for
- a system administrator to move these messages back to an active
- queue.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="delete-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- The client provides a valid access ticket giving "active"
- access rights to the queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to delete. If the queue name is
- empty, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue
- name in this method is empty, the server MUST raise a connection
- exception with reply code 530 (not allowed).
- </doc>
- <doc name = "rule" test = "amq_queue_21">
- The queue must exist. Attempting to delete a non-existing queue
- causes a channel exception.
- </doc>
- </field>
-
- <field name="if unused" type="bit">
- delete only if unused
- <doc>
- If set, the server will only delete the queue if it has no
- consumers. If the queue has consumers the server does does not
- delete it but raises a channel exception instead.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_29</test>
- <test>amq_queue_30</test>
- The server MUST respect the if-unused flag when deleting a queue.
- </rule>
- </field>
- <field name="if empty" type="bit">
- delete only if empty
- <test>amq_queue_27</test>
- <doc>
- If set, the server will only delete the queue if it has no
- messages. If the queue is not empty the server raises a channel
- exception.
- </doc>
- </field>
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name="delete-ok" synchronous="1" index="41">
- confirm deletion of a queue
- <doc>
- This method confirms the deletion of a queue.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="message count" type="long">
- number of messages purged
- <doc>
- Reports the number of messages purged.
- </doc>
- </field>
- </method>
- </class>
- <class name="basic" handler="channel" index="60">
- <!--
-======================================================
-== BASIC MIDDLEWARE
-======================================================
--->
- work with basic content
-<doc>
- The Basic class provides methods that support an industry-standard
- messaging model.
-</doc>
-
-<doc name = "grammar">
- basic = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN content
- / S:DELIVER content
- / C:GET ( S:GET-OK content / S:GET-EMPTY )
- / C:ACK
- / C:REJECT
-</doc>
-
-<chassis name = "server" implement = "MUST" />
-<chassis name = "client" implement = "MAY" />
-
-<doc name = "rule" test = "amq_basic_08">
- The server SHOULD respect the persistent property of basic messages
- and SHOULD make a best-effort to hold persistent basic messages on a
- reliable storage mechanism.
-</doc>
-<doc name = "rule" test = "amq_basic_09">
- The server MUST NOT discard a persistent basic message in case of a
- queue overflow. The server MAY use the Channel.Flow method to slow
- or stop a basic message publisher when necessary.
-</doc>
-<doc name = "rule" test = "amq_basic_10">
- The server MAY overflow non-persistent basic messages to persistent
- storage and MAY discard or dead-letter non-persistent basic messages
- on a priority basis if the queue size exceeds some configured limit.
-</doc>
-<doc name = "rule" test = "amq_basic_11">
- The server MUST implement at least 2 priority levels for basic
- messages, where priorities 0-4 and 5-9 are treated as two distinct
- levels. The server MAY implement up to 10 priority levels.
-</doc>
-<doc name = "rule" test = "amq_basic_12">
- The server MUST deliver messages of the same priority in order
- irrespective of their individual persistence.
-</doc>
-<doc name = "rule" test = "amq_basic_13">
- The server MUST support both automatic and explicit acknowledgements
- on Basic content.
-</doc>
-
-<!-- These are the properties for a Basic content -->
-
-<field name = "content type" type = "shortstr">
- MIME content type
-</field>
-<field name = "content encoding" type = "shortstr">
- MIME content encoding
-</field>
-<field name = "headers" type = "table">
- Message header field table
-</field>
-<field name = "delivery mode" type = "octet">
- Non-persistent (1) or persistent (2)
-</field>
-<field name = "priority" type = "octet">
- The message priority, 0 to 9
-</field>
-<field name = "correlation id" type = "shortstr">
- The application correlation identifier
-</field>
-<field name = "reply to" type = "shortstr">
- The destination to reply to
-</field>
-<field name = "expiration" type = "shortstr">
- Message expiration specification
-</field>
-<field name = "message id" type = "shortstr">
- The application message identifier
-</field>
-<field name = "timestamp" type = "timestamp">
- The message timestamp
-</field>
-<field name = "type" type = "shortstr">
- The message type name
-</field>
-<field name = "user id" type = "shortstr">
- The creating user id
-</field>
-<field name = "app id" type = "shortstr">
- The creating application id
-</field>
-<field name = "cluster id" type = "shortstr">
- Intra-cluster routing identifier
-</field>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "qos" synchronous = "1" index = "10">
- specify quality of service
- <doc>
- This method requests a specific quality of service. The QoS can
- be specified for the current channel or for all channels on the
- connection. The particular properties and semantics of a qos method
- always depend on the content class semantics. Though the qos method
- could in principle apply to both peers, it is currently meaningful
- only for the server.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch size" type = "long">
- prefetch window in octets
- <doc>
- The client can request that messages be sent in advance so that
- when the client finishes processing a message, the following
- message is already held locally, rather than needing to be sent
- down the channel. Prefetching gives a performance improvement.
- This field specifies the prefetch window size in octets. The
- server will send a message in advance if it is equal to or
- smaller in size than the available prefetch size (and also falls
- into other prefetch limits). May be set to zero, meaning "no
- specific limit", although other prefetch limits may still apply.
- The prefetch-size is ignored if the no-ack option is set.
- </doc>
- <doc name = "rule" test = "amq_basic_17">
- The server MUST ignore this setting when the client is not
- processing any messages - i.e. the prefetch size does not limit
- the transfer of single messages to a client, only the sending in
- advance of more messages while the client still has one or more
- unacknowledged messages.
- </doc>
- </field>
-
- <field name = "prefetch count" type = "short">
- prefetch window in messages
- <doc>
- Specifies a prefetch window in terms of whole messages. This
- field may be used in combination with the prefetch-size field;
- a message will only be sent in advance if both prefetch windows
- (and those at the channel and connection level) allow it.
- The prefetch-count is ignored if the no-ack option is set.
- </doc>
- <doc name = "rule" test = "amq_basic_18">
- The server MAY send less data in advance than allowed by the
- client's specified prefetch windows but it MUST NOT send more.
- </doc>
- </field>
-
- <field name = "global" type = "bit">
- apply to entire connection
- <doc>
- By default the QoS settings apply to the current channel only. If
- this field is set, they are applied to the entire connection.
- </doc>
- </field>
-</method>
-
-<method name = "qos-ok" synchronous = "1" index = "11">
- confirm the requested qos
- <doc>
- This method tells the client that the requested QoS levels could
- be handled by the server. The requested QoS applies to all active
- consumers until a new QoS is defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "consume" synchronous = "1" index = "20">
- start a queue consumer
- <doc>
- This method asks the server to start a "consumer", which is a
- transient request for messages from a specific queue. Consumers
- last as long as the channel they were created on, or until the
- client cancels them.
- </doc>
- <doc name = "rule" test = "amq_basic_01">
- The server SHOULD support at least 16 consumers per queue, unless
- the queue was declared as private, and ideally, impose no limit
- except as defined by available resources.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read" access
- rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is
- local to a connection, so two clients can use the same consumer
- tags. If this field is empty the server will generate a unique
- tag.
- </doc>
- <doc name = "rule" test = "todo">
- The tag MUST NOT refer to an existing consumer. If the client
- attempts to create two consumers with the same non-empty tag
- the server MUST raise a connection exception with reply code
- 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no local" domain = "no local" />
-
- <field name = "no ack" domain = "no ack" />
-
- <field name = "exclusive" type = "bit">
- request exclusive access
- <doc>
- Request exclusive consumer access, meaning only this consumer can
- access the queue.
- </doc>
- <doc name = "rule" test = "amq_basic_02">
- If the server cannot grant exclusive access to the queue when asked,
- - because there are other consumers active - it MUST raise a channel
- exception with return code 403 (access refused).
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "consume-ok" synchronous = "1" index = "21">
- confirm a new consumer
- <doc>
- The server provides the client with a consumer tag, which is used
- by the client for methods called on the consumer at a later stage.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Holds the consumer tag specified by the client or provided by
- the server.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "cancel" synchronous = "1" index = "30">
- end a queue consumer
- <doc test = "amq_basic_04">
- This method cancels a consumer. This does not affect already
- delivered messages, but it does mean the server will not send any
- more messages for that consumer. The client may receive an
- abitrary number of messages in between sending the cancel method
- and receiving the cancel-ok reply.
- </doc>
- <doc name = "rule" test = "todo">
- If the queue no longer exists when the client sends a cancel command,
- or the consumer has been cancelled for other reasons, this command
- has no effect.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "cancel-ok" synchronous = "1" index = "31">
- confirm a cancelled consumer
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "publish" content = "1" index = "40">
- publish a message
- <doc>
- This method publishes a message to a specific exchange. The message
- will be routed to queues as defined by the exchange configuration
- and distributed to any active consumers when the transaction, if any,
- is committed.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "write"
- access rights to the access realm for the exchange.
- </doc>
- </field>
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange
- name can be empty, meaning the default exchange. If the exchange
- name is specified, and that exchange does not exist, the server
- will raise a channel exception.
- </doc>
- <doc name = "rule" test = "amq_basic_06">
- The server MUST accept a blank exchange name to mean the default
- exchange.
- </doc>
- <doc name = "rule" test = "amq_basic_14">
- If the exchange was declared as an internal exchange, the server
- MUST raise a channel exception with a reply code 403 (access
- refused).
- </doc>
- <doc name = "rule" test = "amq_basic_15">
- The exchange MAY refuse basic content in which case it MUST raise
- a channel exception with reply code 540 (not implemented).
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key for the message. The routing key is
- used for routing messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" type = "bit">
- indicate mandatory routing
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue. If this flag is set, the server will return an
- unroutable message with a Return method. If this flag is zero, the
- server silently drops the message.
- </doc>
- <doc name = "rule" test = "amq_basic_07">
- The server SHOULD implement the mandatory flag.
- </doc>
- </field>
-
- <field name = "immediate" type = "bit">
- request immediate delivery
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue consumer immediately. If this flag is set, the
- server will return an undeliverable message with a Return method.
- If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
- <doc name = "rule" test = "amq_basic_16">
- The server SHOULD implement the immediate flag.
- </doc>
- </field>
-</method>
-
-<method name = "return" content = "1" index = "50">
- return a failed message
- <doc>
- This method returns an undeliverable message that was published
- with the "immediate" flag set, or an unroutable message published
- with the "mandatory" flag set. The reply code and text provide
- information about the reason that the message was undeliverable.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply code" domain = "reply code" />
- <field name = "reply text" domain = "reply text" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "deliver" content = "1" index = "60">
- notify the client of a consumer message
- <doc>
- This method delivers a message to the client, via a consumer. In
- the asynchronous message delivery model, the client starts a
- consumer using the Consume method, then the server responds with
- Deliver methods as and when messages arrive for that consumer.
- </doc>
- <doc name = "rule" test = "amq_basic_19">
- The server SHOULD track the number of times a message has been
- delivered to clients and when a message is redelivered a certain
- number of times - e.g. 5 times - without being acknowledged, the
- server SHOULD consider the message to be unprocessable (possibly
- causing client applications to abort), and move the message to a
- dead letter queue.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "get" synchronous = "1" index = "70">
- direct access to a queue
- <doc>
- This method provides a direct access to the messages in a queue
- using a synchronous dialogue that is designed for specific types of
- application where synchronous functionality is more important than
- performance.
- </doc>
- <response name = "get-ok" />
- <response name = "get-empty" />
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read"
- access rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no ack" domain = "no ack" />
-</method>
-
-<method name = "get-ok" synchronous = "1" content = "1" index = "71">
- provide client with a message
- <doc>
- This method delivers a message to the client following a get
- method. A message delivered by 'get-ok' must be acknowledged
- unless the no-ack option was set in the get method.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was originally
- published to. If empty, the message was published to the default
- exchange.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-
- <field name = "message count" type = "long" >
- number of messages pending
- <doc>
- This field reports the number of messages pending on the queue,
- excluding the message being delivered. Note that this figure is
- indicative, not reliable, and can change arbitrarily as messages
- are added to the queue and removed by other clients.
- </doc>
- </field>
-</method>
-
-
-<method name = "get-empty" synchronous = "1" index = "72">
- indicate no messages available
- <doc>
- This method tells the client that the queue has no messages
- available for the client.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "cluster id" type = "shortstr">
- Cluster id
- <doc>
- For use by cluster applications, should not be used by
- client applications.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "ack" index = "80">
- acknowledge one or more messages
- <doc>
- This method acknowledges one or more messages delivered via the
- Deliver or Get-Ok methods. The client can ask to confirm a
- single message or a set of messages up to and including a specific
- message.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "multiple" type = "bit">
- acknowledge multiple messages
- <doc>
- If set to 1, the delivery tag is treated as "up to and including",
- so that the client can acknowledge multiple messages with a single
- method. If set to zero, the delivery tag refers to a single
- message. If the multiple field is 1, and the delivery tag is zero,
- tells the server to acknowledge all outstanding mesages.
- </doc>
- <doc name = "rule" test = "amq_basic_20">
- The server MUST validate that a non-zero delivery-tag refers to an
- delivered message, and raise a channel exception if this is not the
- case.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "reject" index = "90">
- reject an incoming message
- <doc>
- This method allows a client to reject a message. It can be used to
- interrupt and cancel large incoming messages, or return untreatable
- messages to their original queue.
- </doc>
- <doc name = "rule" test = "amq_basic_21">
- The server SHOULD be capable of accepting and process the Reject
- method while sending message content with a Deliver or Get-Ok
- method. I.e. the server should read and process incoming methods
- while sending output frames. To cancel a partially-send content,
- the server sends a content body frame of size 1 (i.e. with no data
- except the frame-end octet).
- </doc>
- <doc name = "rule" test = "amq_basic_22">
- The server SHOULD interpret this method as meaning that the client
- is unable to process the message at this time.
- </doc>
- <doc name = "rule">
- A client MUST NOT use this method as a means of selecting messages
- to process. A rejected message MAY be discarded or dead-lettered,
- not necessarily passed to another client.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "requeue" type = "bit">
- requeue the message
- <doc>
- If this field is zero, the message will be discarded. If this bit
- is 1, the server will attempt to requeue the message.
- </doc>
- <doc name = "rule" test = "amq_basic_23">
- The server MUST NOT deliver the message to the same client within
- the context of the current channel. The recommended strategy is
- to attempt to deliver the message to an alternative consumer, and
- if that is not possible, to move the message to a dead-letter
- queue. The server MAY use more sophisticated tracking to hold
- the message on the queue and redeliver it to the same client at
- a later stage.
- </doc>
- </field>
-</method>
-
-<method name = "recover" index = "100">
- redeliver unacknowledged messages. This method is only allowed on non-transacted channels.
- <doc>
- This method asks the broker to redeliver all unacknowledged messages on a
- specifieid channel. Zero or more messages may be redelivered.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "requeue" type = "bit">
- requeue the message
- <doc>
- If this field is zero, the message will be redelivered to the original recipient. If this bit
- is 1, the server will attempt to requeue the message, potentially then delivering it to an
- alternative subscriber.
- </doc>
- </field>
-
- <doc name="rule">
- The server MUST set the redelivered flag on all messages that are resent.
- </doc>
- <doc name="rule">
- The server MUST raise a channel exception if this is called on a transacted channel.
- </doc>
-</method>
-
-
-</class>
-
-
- <class name="file" handler="channel" index="70">
- <!--
-======================================================
-== FILE TRANSFER
-======================================================
--->
- work with file content
-<doc>
- The file class provides methods that support reliable file transfer.
- File messages have a specific set of properties that are required for
- interoperability with file transfer applications. File messages and
- acknowledgements are subject to channel transactions. Note that the
- file class does not provide message browsing methods; these are not
- compatible with the staging model. Applications that need browsable
- file transfer should use Basic content and the Basic class.
-</doc>
-
-<doc name = "grammar">
- file = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:OPEN S:OPEN-OK C:STAGE content
- / S:OPEN C:OPEN-OK S:STAGE content
- / C:PUBLISH
- / S:DELIVER
- / S:RETURN
- / C:ACK
- / C:REJECT
-</doc>
-
-<chassis name = "server" implement = "MAY" />
-<chassis name = "client" implement = "MAY" />
-
-<doc name = "rule">
- The server MUST make a best-effort to hold file messages on a
- reliable storage mechanism.
-</doc>
-<doc name = "rule">
- The server MUST NOT discard a file message in case of a queue
- overflow. The server MUST use the Channel.Flow method to slow or stop
- a file message publisher when necessary.
-</doc>
-<doc name = "rule">
- The server MUST implement at least 2 priority levels for file
- messages, where priorities 0-4 and 5-9 are treated as two distinct
- levels. The server MAY implement up to 10 priority levels.
-</doc>
-<doc name = "rule">
- The server MUST support both automatic and explicit acknowledgements
- on file content.
-</doc>
-
-<!-- These are the properties for a File content -->
-
-<field name = "content type" type = "shortstr">
- MIME content type
-</field>
-<field name = "content encoding" type = "shortstr">
- MIME content encoding
-</field>
-<field name = "headers" type = "table">
- Message header field table
-</field>
-<field name = "priority" type = "octet">
- The message priority, 0 to 9
-</field>
-<field name = "reply to" type = "shortstr">
- The destination to reply to
-</field>
-<field name = "message id" type = "shortstr">
- The application message identifier
-</field>
-<field name = "filename" type = "shortstr">
- The message filename
-</field>
-<field name = "timestamp" type = "timestamp">
- The message timestamp
-</field>
-<field name = "cluster id" type = "shortstr">
- Intra-cluster routing identifier
-</field>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "qos" synchronous = "1" index = "10">
- specify quality of service
- <doc>
- This method requests a specific quality of service. The QoS can
- be specified for the current channel or for all channels on the
- connection. The particular properties and semantics of a qos method
- always depend on the content class semantics. Though the qos method
- could in principle apply to both peers, it is currently meaningful
- only for the server.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch size" type = "long">
- prefetch window in octets
- <doc>
- The client can request that messages be sent in advance so that
- when the client finishes processing a message, the following
- message is already held locally, rather than needing to be sent
- down the channel. Prefetching gives a performance improvement.
- This field specifies the prefetch window size in octets. May be
- set to zero, meaning "no specific limit". Note that other
- prefetch limits may still apply. The prefetch-size is ignored
- if the no-ack option is set.
- </doc>
- </field>
-
- <field name = "prefetch count" type = "short">
- prefetch window in messages
- <doc>
- Specifies a prefetch window in terms of whole messages. This
- is compatible with some file API implementations. This field
- may be used in combination with the prefetch-size field; a
- message will only be sent in advance if both prefetch windows
- (and those at the channel and connection level) allow it.
- The prefetch-count is ignored if the no-ack option is set.
- </doc>
- <doc name = "rule">
- The server MAY send less data in advance than allowed by the
- client's specified prefetch windows but it MUST NOT send more.
- </doc>
- </field>
-
- <field name = "global" type = "bit">
- apply to entire connection
- <doc>
- By default the QoS settings apply to the current channel only. If
- this field is set, they are applied to the entire connection.
- </doc>
- </field>
-</method>
-
-<method name = "qos-ok" synchronous = "1" index = "11">
- confirm the requested qos
- <doc>
- This method tells the client that the requested QoS levels could
- be handled by the server. The requested QoS applies to all active
- consumers until a new QoS is defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "consume" synchronous = "1" index = "20">
- start a queue consumer
- <doc>
- This method asks the server to start a "consumer", which is a
- transient request for messages from a specific queue. Consumers
- last as long as the channel they were created on, or until the
- client cancels them.
- </doc>
- <doc name = "rule">
- The server SHOULD support at least 16 consumers per queue, unless
- the queue was declared as private, and ideally, impose no limit
- except as defined by available resources.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read" access
- rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is
- local to a connection, so two clients can use the same consumer
- tags. If this field is empty the server will generate a unique
- tag.
- </doc>
- <doc name = "rule" test = "todo">
- The tag MUST NOT refer to an existing consumer. If the client
- attempts to create two consumers with the same non-empty tag
- the server MUST raise a connection exception with reply code
- 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no local" domain = "no local" />
-
- <field name = "no ack" domain = "no ack" />
-
- <field name = "exclusive" type = "bit">
- request exclusive access
- <doc>
- Request exclusive consumer access, meaning only this consumer can
- access the queue.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- If the server cannot grant exclusive access to the queue when asked,
- - because there are other consumers active - it MUST raise a channel
- exception with return code 405 (resource locked).
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "consume-ok" synchronous = "1" index = "21">
- confirm a new consumer
- <doc>
- This method provides the client with a consumer tag which it MUST
- use in methods that work with the consumer.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Holds the consumer tag specified by the client or provided by
- the server.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "cancel" synchronous = "1" index = "30">
- end a queue consumer
- <doc>
- This method cancels a consumer. This does not affect already
- delivered messages, but it does mean the server will not send any
- more messages for that consumer.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "cancel-ok" synchronous = "1" index = "31">
- confirm a cancelled consumer
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "open" synchronous = "1" index = "40">
- request to start staging
- <doc>
- This method requests permission to start staging a message. Staging
- means sending the message into a temporary area at the recipient end
- and then delivering the message by referring to this temporary area.
- Staging is how the protocol handles partial file transfers - if a
- message is partially staged and the connection breaks, the next time
- the sender starts to stage it, it can restart from where it left off.
- </doc>
- <response name = "open-ok" />
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "identifier" type = "shortstr">
- staging identifier
- <doc>
- This is the staging identifier. This is an arbitrary string chosen
- by the sender. For staging to work correctly the sender must use
- the same staging identifier when staging the same message a second
- time after recovery from a failure. A good choice for the staging
- identifier would be the SHA1 hash of the message properties data
- (including the original filename, revised time, etc.).
- </doc>
- </field>
-
- <field name = "content size" type = "longlong">
- message content size
- <doc>
- The size of the content in octets. The recipient may use this
- information to allocate or check available space in advance, to
- avoid "disk full" errors during staging of very large messages.
- </doc>
- <doc name = "rule">
- The sender MUST accurately fill the content-size field.
- Zero-length content is permitted.
- </doc>
- </field>
-</method>
-
-<method name = "open-ok" synchronous = "1" index = "41">
- confirm staging ready
- <doc>
- This method confirms that the recipient is ready to accept staged
- data. If the message was already partially-staged at a previous
- time the recipient will report the number of octets already staged.
- </doc>
- <response name = "stage" />
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "staged size" type = "longlong">
- already staged amount
- <doc>
- The amount of previously-staged content in octets. For a new
- message this will be zero.
- </doc>
- <doc name = "rule">
- The sender MUST start sending data from this octet offset in the
- message, counting from zero.
- </doc>
- <doc name = "rule">
- The recipient MAY decide how long to hold partially-staged content
- and MAY implement staging by always discarding partially-staged
- content. However if it uses the file content type it MUST support
- the staging methods.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "stage" content = "1" index = "50">
- stage message content
- <doc>
- This method stages the message, sending the message content to the
- recipient from the octet offset specified in the Open-Ok method.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "publish" index = "60">
- publish a message
- <doc>
- This method publishes a staged file message to a specific exchange.
- The file message will be routed to queues as defined by the exchange
- configuration and distributed to any active consumers when the
- transaction, if any, is committed.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "write"
- access rights to the access realm for the exchange.
- </doc>
- </field>
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange
- name can be empty, meaning the default exchange. If the exchange
- name is specified, and that exchange does not exist, the server
- will raise a channel exception.
- </doc>
- <doc name = "rule">
- The server MUST accept a blank exchange name to mean the default
- exchange.
- </doc>
- <doc name = "rule">
- If the exchange was declared as an internal exchange, the server
- MUST respond with a reply code 403 (access refused) and raise a
- channel exception.
- </doc>
- <doc name = "rule">
- The exchange MAY refuse file content in which case it MUST respond
- with a reply code 540 (not implemented) and raise a channel
- exception.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key for the message. The routing key is
- used for routing messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" type = "bit">
- indicate mandatory routing
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue. If this flag is set, the server will return an
- unroutable message with a Return method. If this flag is zero, the
- server silently drops the message.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- The server SHOULD implement the mandatory flag.
- </doc>
- </field>
-
- <field name = "immediate" type = "bit">
- request immediate delivery
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue consumer immediately. If this flag is set, the
- server will return an undeliverable message with a Return method.
- If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- The server SHOULD implement the immediate flag.
- </doc>
- </field>
-
- <field name = "identifier" type = "shortstr">
- staging identifier
- <doc>
- This is the staging identifier of the message to publish. The
- message must have been staged. Note that a client can send the
- Publish method asynchronously without waiting for staging to
- finish.
- </doc>
- </field>
-</method>
-
-<method name = "return" content = "1" index = "70">
- return a failed message
- <doc>
- This method returns an undeliverable message that was published
- with the "immediate" flag set, or an unroutable message published
- with the "mandatory" flag set. The reply code and text provide
- information about the reason that the message was undeliverable.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply code" domain = "reply code" />
- <field name = "reply text" domain = "reply text" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "deliver" index = "80">
- notify the client of a consumer message
- <doc>
- This method delivers a staged file message to the client, via a
- consumer. In the asynchronous message delivery model, the client
- starts a consumer using the Consume method, then the server
- responds with Deliver methods as and when messages arrive for
- that consumer.
- </doc>
- <doc name = "rule">
- The server SHOULD track the number of times a message has been
- delivered to clients and when a message is redelivered a certain
- number of times - e.g. 5 times - without being acknowledged, the
- server SHOULD consider the message to be unprocessable (possibly
- causing client applications to abort), and move the message to a
- dead letter queue.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was originally
- published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-
- <field name = "identifier" type = "shortstr">
- staging identifier
- <doc>
- This is the staging identifier of the message to deliver. The
- message must have been staged. Note that a server can send the
- Deliver method asynchronously without waiting for staging to
- finish.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "ack" index = "90">
- acknowledge one or more messages
- <doc>
- This method acknowledges one or more messages delivered via the
- Deliver method. The client can ask to confirm a single message or
- a set of messages up to and including a specific message.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "multiple" type = "bit">
- acknowledge multiple messages
- <doc>
- If set to 1, the delivery tag is treated as "up to and including",
- so that the client can acknowledge multiple messages with a single
- method. If set to zero, the delivery tag refers to a single
- message. If the multiple field is 1, and the delivery tag is zero,
- tells the server to acknowledge all outstanding mesages.
- </doc>
- <doc name = "rule">
- The server MUST validate that a non-zero delivery-tag refers to an
- delivered message, and raise a channel exception if this is not the
- case.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "reject" index = "100">
- reject an incoming message
- <doc>
- This method allows a client to reject a message. It can be used to
- return untreatable messages to their original queue. Note that file
- content is staged before delivery, so the client will not use this
- method to interrupt delivery of a large message.
- </doc>
- <doc name = "rule">
- The server SHOULD interpret this method as meaning that the client
- is unable to process the message at this time.
- </doc>
- <doc name = "rule">
- A client MUST NOT use this method as a means of selecting messages
- to process. A rejected message MAY be discarded or dead-lettered,
- not necessarily passed to another client.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "requeue" type = "bit">
- requeue the message
- <doc>
- If this field is zero, the message will be discarded. If this bit
- is 1, the server will attempt to requeue the message.
- </doc>
- <doc name = "rule">
- The server MUST NOT deliver the message to the same client within
- the context of the current channel. The recommended strategy is
- to attempt to deliver the message to an alternative consumer, and
- if that is not possible, to move the message to a dead-letter
- queue. The server MAY use more sophisticated tracking to hold
- the message on the queue and redeliver it to the same client at
- a later stage.
- </doc>
- </field>
-</method>
-
-</class>
-
- <class name="stream" handler="channel" index="80">
- <!--
-======================================================
-== STREAMING
-======================================================
--->
- work with streaming content
-
-<doc>
- The stream class provides methods that support multimedia streaming.
- The stream class uses the following semantics: one message is one
- packet of data; delivery is unacknowleged and unreliable; the consumer
- can specify quality of service parameters that the server can try to
- adhere to; lower-priority messages may be discarded in favour of high
- priority messages.
-</doc>
-
-<doc name = "grammar">
- stream = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN
- / S:DELIVER content
-</doc>
-
-<chassis name = "server" implement = "MAY" />
-<chassis name = "client" implement = "MAY" />
-
-<doc name = "rule">
- The server SHOULD discard stream messages on a priority basis if
- the queue size exceeds some configured limit.
-</doc>
-<doc name = "rule">
- The server MUST implement at least 2 priority levels for stream
- messages, where priorities 0-4 and 5-9 are treated as two distinct
- levels. The server MAY implement up to 10 priority levels.
-</doc>
-<doc name = "rule">
- The server MUST implement automatic acknowledgements on stream
- content. That is, as soon as a message is delivered to a client
- via a Deliver method, the server must remove it from the queue.
-</doc>
-
-
-<!-- These are the properties for a Stream content -->
-
-<field name = "content type" type = "shortstr">
- MIME content type
-</field>
-<field name = "content encoding" type = "shortstr">
- MIME content encoding
-</field>
-<field name = "headers" type = "table">
- Message header field table
-</field>
-<field name = "priority" type = "octet">
- The message priority, 0 to 9
-</field>
-<field name = "timestamp" type = "timestamp">
- The message timestamp
-</field>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "qos" synchronous = "1" index = "10">
- specify quality of service
- <doc>
- This method requests a specific quality of service. The QoS can
- be specified for the current channel or for all channels on the
- connection. The particular properties and semantics of a qos method
- always depend on the content class semantics. Though the qos method
- could in principle apply to both peers, it is currently meaningful
- only for the server.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch size" type = "long">
- prefetch window in octets
- <doc>
- The client can request that messages be sent in advance so that
- when the client finishes processing a message, the following
- message is already held locally, rather than needing to be sent
- down the channel. Prefetching gives a performance improvement.
- This field specifies the prefetch window size in octets. May be
- set to zero, meaning "no specific limit". Note that other
- prefetch limits may still apply.
- </doc>
- </field>
-
- <field name = "prefetch count" type = "short">
- prefetch window in messages
- <doc>
- Specifies a prefetch window in terms of whole messages. This
- field may be used in combination with the prefetch-size field;
- a message will only be sent in advance if both prefetch windows
- (and those at the channel and connection level) allow it.
- </doc>
- </field>
-
- <field name = "consume rate" type = "long">
- transfer rate in octets/second
- <doc>
- Specifies a desired transfer rate in octets per second. This is
- usually determined by the application that uses the streaming
- data. A value of zero means "no limit", i.e. as rapidly as
- possible.
- </doc>
- <doc name = "rule">
- The server MAY ignore the prefetch values and consume rates,
- depending on the type of stream and the ability of the server
- to queue and/or reply it. The server MAY drop low-priority
- messages in favour of high-priority messages.
- </doc>
- </field>
-
- <field name = "global" type = "bit">
- apply to entire connection
- <doc>
- By default the QoS settings apply to the current channel only. If
- this field is set, they are applied to the entire connection.
- </doc>
- </field>
-</method>
-
-<method name = "qos-ok" synchronous = "1" index = "11">
- confirm the requested qos
- <doc>
- This method tells the client that the requested QoS levels could
- be handled by the server. The requested QoS applies to all active
- consumers until a new QoS is defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "consume" synchronous = "1" index = "20">
- start a queue consumer
- <doc>
- This method asks the server to start a "consumer", which is a
- transient request for messages from a specific queue. Consumers
- last as long as the channel they were created on, or until the
- client cancels them.
- </doc>
- <doc name = "rule">
- The server SHOULD support at least 16 consumers per queue, unless
- the queue was declared as private, and ideally, impose no limit
- except as defined by available resources.
- </doc>
- <doc name = "rule">
- Streaming applications SHOULD use different channels to select
- different streaming resolutions. AMQP makes no provision for
- filtering and/or transforming streams except on the basis of
- priority-based selective delivery of individual messages.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read" access
- rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is
- local to a connection, so two clients can use the same consumer
- tags. If this field is empty the server will generate a unique
- tag.
- </doc>
- <doc name = "rule" test = "todo">
- The tag MUST NOT refer to an existing consumer. If the client
- attempts to create two consumers with the same non-empty tag
- the server MUST raise a connection exception with reply code
- 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no local" domain = "no local" />
-
- <field name = "exclusive" type = "bit">
- request exclusive access
- <doc>
- Request exclusive consumer access, meaning only this consumer can
- access the queue.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- If the server cannot grant exclusive access to the queue when asked,
- - because there are other consumers active - it MUST raise a channel
- exception with return code 405 (resource locked).
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-
-<method name = "consume-ok" synchronous = "1" index = "21">
- confirm a new consumer
- <doc>
- This method provides the client with a consumer tag which it may
- use in methods that work with the consumer.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Holds the consumer tag specified by the client or provided by
- the server.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "cancel" synchronous = "1" index = "30">
- end a queue consumer
- <doc>
- This method cancels a consumer. Since message delivery is
- asynchronous the client may continue to receive messages for
- a short while after canceling a consumer. It may process or
- discard these as appropriate.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "cancel-ok" synchronous = "1" index = "31">
- confirm a cancelled consumer
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "publish" content = "1" index = "40">
- publish a message
- <doc>
- This method publishes a message to a specific exchange. The message
- will be routed to queues as defined by the exchange configuration
- and distributed to any active consumers as appropriate.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "write"
- access rights to the access realm for the exchange.
- </doc>
- </field>
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange
- name can be empty, meaning the default exchange. If the exchange
- name is specified, and that exchange does not exist, the server
- will raise a channel exception.
- </doc>
- <doc name = "rule">
- The server MUST accept a blank exchange name to mean the default
- exchange.
- </doc>
- <doc name = "rule">
- If the exchange was declared as an internal exchange, the server
- MUST respond with a reply code 403 (access refused) and raise a
- channel exception.
- </doc>
- <doc name = "rule">
- The exchange MAY refuse stream content in which case it MUST
- respond with a reply code 540 (not implemented) and raise a
- channel exception.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key for the message. The routing key is
- used for routing messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" type = "bit">
- indicate mandatory routing
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue. If this flag is set, the server will return an
- unroutable message with a Return method. If this flag is zero, the
- server silently drops the message.
- </doc>
- <doc name = "rule" test = "amq_stream_00">
- The server SHOULD implement the mandatory flag.
- </doc>
- </field>
-
- <field name = "immediate" type = "bit">
- request immediate delivery
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue consumer immediately. If this flag is set, the
- server will return an undeliverable message with a Return method.
- If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
- <doc name = "rule" test = "amq_stream_00">
- The server SHOULD implement the immediate flag.
- </doc>
- </field>
-</method>
-
-<method name = "return" content = "1" index = "50">
- return a failed message
- <doc>
- This method returns an undeliverable message that was published
- with the "immediate" flag set, or an unroutable message published
- with the "mandatory" flag set. The reply code and text provide
- information about the reason that the message was undeliverable.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply code" domain = "reply code" />
- <field name = "reply text" domain = "reply text" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "deliver" content = "1" index = "60">
- notify the client of a consumer message
- <doc>
- This method delivers a message to the client, via a consumer. In
- the asynchronous message delivery model, the client starts a
- consumer using the Consume method, then the server responds with
- Deliver methods as and when messages arrive for that consumer.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was originally
- published to.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue that the message came from. Note
- that a single channel can start many consumers on different
- queues.
- </doc>
- <assert check = "notnull" />
- </field>
-</method>
- </class>
-
- <class name="tx" handler="channel" index="90">
- <!--
-======================================================
-== TRANSACTIONS
-======================================================
--->
- work with standard transactions
-
-<doc>
- Standard transactions provide so-called "1.5 phase commit". We can
- ensure that work is never lost, but there is a chance of confirmations
- being lost, so that messages may be resent. Applications that use
- standard transactions must be able to detect and ignore duplicate
- messages.
-</doc>
- <rule implement="SHOULD">
- An client using standard transactions SHOULD be able to track all
- messages received within a reasonable period, and thus detect and
- reject duplicates of the same message. It SHOULD NOT pass these to
- the application layer.
-</rule>
- <doc name="grammar">
- tx = C:SELECT S:SELECT-OK
- / C:COMMIT S:COMMIT-OK
- / C:ROLLBACK S:ROLLBACK-OK
-</doc>
- <chassis name="server" implement="SHOULD"/>
- <chassis name="client" implement="MAY"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="select" synchronous="1" index="10">
-select standard transaction mode
- <doc>
- This method sets the channel to use standard transactions. The
- client must use this method at least once on a channel before
- using the Commit or Rollback methods.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="select-ok"/>
- </method>
- <method name="select-ok" synchronous="1" index="11">
-confirm transaction mode
- <doc>
- This method confirms to the client that the channel was successfully
- set to use standard transactions.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="commit" synchronous="1" index="20">
-commit the current transaction
- <doc>
- This method commits all messages published and acknowledged in
- the current transaction. A new transaction starts immediately
- after a commit.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="commit-ok"/>
- </method>
- <method name="commit-ok" synchronous="1" index="21">
-confirm a successful commit
- <doc>
- This method confirms to the client that the commit succeeded.
- Note that if a commit fails, the server raises a channel exception.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="rollback" synchronous="1" index="30">
-abandon the current transaction
- <doc>
- This method abandons all messages published and acknowledged in
- the current transaction. A new transaction starts immediately
- after a rollback.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="rollback-ok"/>
- </method>
- <method name="rollback-ok" synchronous="1" index="31">
-confirm a successful rollback
- <doc>
- This method confirms to the client that the rollback succeeded.
- Note that if an rollback fails, the server raises a channel exception.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- </class>
- <class name="dtx" handler="channel" index="100">
- <!--
-======================================================
-== DISTRIBUTED TRANSACTIONS
-======================================================
--->
- work with distributed transactions
-
-<doc>
- Distributed transactions provide so-called "2-phase commit". The
- AMQP distributed transaction model supports the X-Open XA
- architecture and other distributed transaction implementations.
- The Dtx class assumes that the server has a private communications
- channel (not AMQP) to a distributed transaction coordinator.
-</doc>
- <doc name="grammar">
- dtx = C:SELECT S:SELECT-OK
- C:START S:START-OK
-</doc>
- <chassis name="server" implement="MAY"/>
- <chassis name="client" implement="MAY"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="select" synchronous="1" index="10">
-select standard transaction mode
- <doc>
- This method sets the channel to use distributed transactions. The
- client must use this method at least once on a channel before
- using the Start method.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="select-ok"/>
- </method>
- <method name="select-ok" synchronous="1" index="11">
-confirm transaction mode
- <doc>
- This method confirms to the client that the channel was successfully
- set to use distributed transactions.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="start" synchronous="1" index="20">
- start a new distributed transaction
- <doc>
- This method starts a new distributed transaction. This must be
- the first method on a new channel that uses the distributed
- transaction mode, before any methods that publish or consume
- messages.
- </doc>
- <chassis name="server" implement="MAY"/>
- <response name="start-ok"/>
- <field name="dtx identifier" type="shortstr">
- transaction identifier
- <doc>
- The distributed transaction key. This identifies the transaction
- so that the AMQP server can coordinate with the distributed
- transaction coordinator.
- </doc>
- <assert check="notnull"/>
- </field>
- </method>
- <method name="start-ok" synchronous="1" index="21">
- confirm the start of a new distributed transaction
- <doc>
- This method confirms to the client that the transaction started.
- Note that if a start fails, the server raises a channel exception.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- </class>
- <class name="tunnel" handler="tunnel" index="110">
- <!--
-======================================================
-== TUNNEL
-======================================================
--->
- methods for protocol tunneling.
-
-<doc>
- The tunnel methods are used to send blocks of binary data - which
- can be serialised AMQP methods or other protocol frames - between
- AMQP peers.
-</doc>
- <doc name="grammar">
- tunnel = C:REQUEST
- / S:REQUEST
-</doc>
- <chassis name="server" implement="MAY"/>
- <chassis name="client" implement="MAY"/>
- <field name="headers" type="table">
- Message header field table
-</field>
- <field name="proxy name" type="shortstr">
- The identity of the tunnelling proxy
-</field>
- <field name="data name" type="shortstr">
- The name or type of the message being tunnelled
-</field>
- <field name="durable" type="octet">
- The message durability indicator
-</field>
- <field name="broadcast" type="octet">
- The message broadcast mode
-</field>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="request" content="1" index="10">
- sends a tunnelled method
- <doc>
- This method tunnels a block of binary data, which can be an
- encoded AMQP method or other data. The binary data is sent
- as the content for the Tunnel.Request method.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="meta data" type="table">
- meta data for the tunnelled block
- <doc>
- This field table holds arbitrary meta-data that the sender needs
- to pass to the recipient.
- </doc>
- </field>
- </method>
- </class>
- <class name="test" handler="channel" index="120">
- <!--
-======================================================
-== TEST - CHECK FUNCTIONAL CAPABILITIES OF AN IMPLEMENTATION
-======================================================
--->
- test functional primitives of the implementation
-
-<doc>
- The test class provides methods for a peer to test the basic
- operational correctness of another peer. The test methods are
- intended to ensure that all peers respect at least the basic
- elements of the protocol, such as frame and content organisation
- and field types. We assume that a specially-designed peer, a
- "monitor client" would perform such tests.
-</doc>
- <doc name="grammar">
- test = C:INTEGER S:INTEGER-OK
- / S:INTEGER C:INTEGER-OK
- / C:STRING S:STRING-OK
- / S:STRING C:STRING-OK
- / C:TABLE S:TABLE-OK
- / S:TABLE C:TABLE-OK
- / C:CONTENT S:CONTENT-OK
- / S:CONTENT C:CONTENT-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="SHOULD"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="integer" synchronous="1" index="10">
- test integer handling
- <doc>
- This method tests the peer's capability to correctly marshal integer
- data.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="integer-ok"/>
- <field name="integer 1" type="octet">
- octet test value
- <doc>
- An octet integer test value.
- </doc>
- </field>
- <field name="integer 2" type="short">
- short test value
- <doc>
- A short integer test value.
- </doc>
- </field>
- <field name="integer 3" type="long">
- long test value
- <doc>
- A long integer test value.
- </doc>
- </field>
- <field name="integer 4" type="longlong">
- long-long test value
- <doc>
- A long long integer test value.
- </doc>
- </field>
- <field name="operation" type="octet">
- operation to test
- <doc>
- The client must execute this operation on the provided integer
- test fields and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return sum of test values</value>
- <value name="min">return lowest of test values</value>
- <value name="max">return highest of test values</value>
- </assert>
- </field>
- </method>
- <method name="integer-ok" synchronous="1" index="11">
- report integer test result
- <doc>
- This method reports the result of an Integer method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="result" type="longlong">
- result value
- <doc>
- The result of the tested operation.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="string" synchronous="1" index="20">
- test string handling
- <doc>
- This method tests the peer's capability to correctly marshal string
- data.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="string-ok"/>
- <field name="string 1" type="shortstr">
- short string test value
- <doc>
- An short string test value.
- </doc>
- </field>
- <field name="string 2" type="longstr">
- long string test value
- <doc>
- A long string test value.
- </doc>
- </field>
- <field name="operation" type="octet">
- operation to test
- <doc>
- The client must execute this operation on the provided string
- test fields and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return concatentation of test strings</value>
- <value name="min">return shortest of test strings</value>
- <value name="max">return longest of test strings</value>
- </assert>
- </field>
- </method>
- <method name="string-ok" synchronous="1" index="21">
- report string test result
- <doc>
- This method reports the result of a String method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="result" type="longstr">
- result value
- <doc>
- The result of the tested operation.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="table" synchronous="1" index="30">
- test field table handling
- <doc>
- This method tests the peer's capability to correctly marshal field
- table data.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="table-ok"/>
- <field name="table" type="table">
- field table of test values
- <doc>
- A field table of test values.
- </doc>
- </field>
- <field name="integer op" type="octet">
- operation to test on integers
- <doc>
- The client must execute this operation on the provided field
- table integer values and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return sum of numeric field values</value>
- <value name="min">return min of numeric field values</value>
- <value name="max">return max of numeric field values</value>
- </assert>
- </field>
- <field name="string op" type="octet">
- operation to test on strings
- <doc>
- The client must execute this operation on the provided field
- table string values and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return concatenation of string field values</value>
- <value name="min">return shortest of string field values</value>
- <value name="max">return longest of string field values</value>
- </assert>
- </field>
- </method>
- <method name="table-ok" synchronous="1" index="31">
- report table test result
- <doc>
- This method reports the result of a Table method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="integer result" type="longlong">
- integer result value
- <doc>
- The result of the tested integer operation.
- </doc>
- </field>
- <field name="string result" type="longstr">
- string result value
- <doc>
- The result of the tested string operation.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="content" synchronous="1" content="1" index="40">
- test content handling
- <doc>
- This method tests the peer's capability to correctly marshal content.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="content-ok"/>
- </method>
- <method name="content-ok" synchronous="1" content="1" index="41">
- report content test result
- <doc>
- This method reports the result of a Content method. It contains the
- content checksum and echoes the original content as provided.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="content checksum" type="long">
- content hash
- <doc>
- The 32-bit checksum of the content, calculated by adding the
- content into a 32-bit accumulator.
- </doc>
- </field>
- </method>
- </class>
-</amqp>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/build.xml b/M4-RCs/qpid/dotnet/Qpid.Common/build.xml
deleted file mode 100644
index 96dd877722..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/build.xml
+++ /dev/null
@@ -1,95 +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 sole purpose of this build script is to generate the framing layer for the .net client from the AMQ spec.
- -->
-<project name="AMQ Dot Net Framing Layer" default="generate">
-
- <property name="amq.home" value="../.."/>
-
- <property name="stylesheet" value="stylesheets/framing.xsl"/>
- <property name="registry_stylesheet" value="stylesheets/registry.xsl"/>
- <property name="registry_template" value="resources/registry.template"/>
- <property name="saxon.jar" value="lib/saxon/saxon8.jar"/>
- <property name="generated.src" value="generated"/>
- <property name="static.src" value="src"/>
- <property name="resources" value="resources"/>
- <property name="base.lib" value="lib"/>
-
- <path id="amq.home.path">
- <pathelement location="${amq.home}"/>
- </path>
-
- <pathconvert targetos="unix" property="amq.home.fixed" refid="amq.home.path"/>
-
-<!-- Some spec changes break the build, reverting to private copy in Qpid.Common temporarily till this is fixed. -->
- <property name="amq.asl" value="${amq.home.fixed}/specs/amqp.0-8.xml"/>
-
- <target name="clean" description="Deletes the generated sources.">
- <delete>
- <fileset dir="${generated.src}" includes="**/*"/>
- </delete>
- </target>
-
- <!--
- Checks if the generation step needs to be performed. It will be skipped if the sources are up to date with the spec and provided that the
- force flag has not been set.
- -->
- <target name="check-generate"
- description="Checks if the generated sources are up-to-date. Use -Dforce=true or the 'forcegen' target to force generation.">
-
- <condition property="generateNotRequired">
- <and>
- <uptodate targetfile="${generated.src}/results.out" srcfile="${amq.asl}"/>
- <not><isset property="force"/></not>
- </and>
- </condition>
- </target>
-
- <!-- Applies a transformation to the AMQP spec to generate the framing layer. -->
- <target name="generate" depends="check-generate" unless="generateNotRequired" description="generates code">
-
- <mkdir dir="${generated.src}"/>
-
- <java jar="${saxon.jar}" fork="true">
- <arg value="-o"/>
- <arg value="${generated.src}/results.out"/>
- <arg value="${amq.asl}"/>
- <arg value="${stylesheet}"/>
- <arg value="asl_base=${asl.base}"/>
- <arg value="registry_name=MainRegistry"/>
- </java>
-
- <java jar="${saxon.jar}" fork="true">
- <arg value="-o"/>
- <arg value="${generated.src}/registry.out"/>
- <arg value="${registry_template}"/>
- <arg value="${registry_stylesheet}"/>
- </java>
- </target>
-
- <!-- Does a clean and forces re-generation of the sources. -->
- <target name="forcegen" depends="clean, generate" description="Forces clean re-generation of the code.">
- </target>
-
-</project>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/default.build b/M4-RCs/qpid/dotnet/Qpid.Common/default.build
deleted file mode 100644
index df07397d0b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/default.build
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Apache.Qpid.Common" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/Apache.Qpid.Buffer.dll" />
- <include name="${build.dir}/Apache.Qpid.Messaging.dll" />
- <include name="${build.dir}/Apache.Qpid.Codec.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net-licence.txt b/M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net-licence.txt
deleted file mode 100644
index 261eeb9e9f..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net-licence.txt
+++ /dev/null
@@ -1,201 +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/M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net.dll b/M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net.dll
deleted file mode 100644
index 995816f27b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net.dll
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net.xml b/M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net.xml
deleted file mode 100644
index 5beb669ab0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/lib/log4net/log4net.xml
+++ /dev/null
@@ -1,28676 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<doc>
- <assembly>
- <name>log4net</name>
- </assembly>
- <members>
- <member name="T:log4net.Appender.AdoNetAppender">
- <summary>
- Appender that logs to a database.
- </summary>
- <remarks>
- <para>
- <see cref="T:log4net.Appender.AdoNetAppender"/> appends logging events to a table within a
- database. The appender can be configured to specify the connection
- string by setting the <see cref="P:log4net.Appender.AdoNetAppender.ConnectionString"/> property.
- The connection type (provider) can be specified by setting the <see cref="P:log4net.Appender.AdoNetAppender.ConnectionType"/>
- property. For more information on database connection strings for
- your specific database see <a href="http://www.connectionstrings.com/">http://www.connectionstrings.com/</a>.
- </para>
- <para>
- Records are written into the database either using a prepared
- statement or a stored procedure. The <see cref="P:log4net.Appender.AdoNetAppender.CommandType"/> property
- is set to <see cref="F:System.Data.CommandType.Text"/> (<c>System.Data.CommandType.Text</c>) to specify a prepared statement
- or to <see cref="F:System.Data.CommandType.StoredProcedure"/> (<c>System.Data.CommandType.StoredProcedure</c>) to specify a stored
- procedure.
- </para>
- <para>
- The prepared statement text or the name of the stored procedure
- must be set in the <see cref="P:log4net.Appender.AdoNetAppender.CommandText"/> property.
- </para>
- <para>
- The prepared statement or stored procedure can take a number
- of parameters. Parameters are added using the <see cref="M:log4net.Appender.AdoNetAppender.AddParameter(log4net.Appender.AdoNetAppenderParameter)"/>
- method. This adds a single <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> to the
- ordered list of parameters. The <see cref="T:log4net.Appender.AdoNetAppenderParameter"/>
- type may be subclassed if required to provide database specific
- functionality. The <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> specifies
- the parameter name, database type, size, and how the value should
- be generated using a <see cref="T:log4net.Layout.ILayout"/>.
- </para>
- </remarks>
- <example>
- An example of a SQL Server table that could be logged to:
- <code lang="SQL">
- CREATE TABLE [dbo].[Log] (
- [ID] [int] IDENTITY (1, 1) NOT NULL ,
- [Date] [datetime] NOT NULL ,
- [Thread] [varchar] (255) NOT NULL ,
- [Level] [varchar] (20) NOT NULL ,
- [Logger] [varchar] (255) NOT NULL ,
- [Message] [varchar] (4000) NOT NULL
- ) ON [PRIMARY]
- </code>
- </example>
- <example>
- An example configuration to log to the above table:
- <code lang="XML" escaped="true">
- <appender name="AdoNetAppender_SqlServer" type="log4net.Appender.AdoNetAppender">
- <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
- <connectionString value="data source=SQLSVR;initial catalog=test_log4net;integrated security=false;persist security info=True;User ID=sa;Password=sa"/>
- <commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message]) VALUES (@log_date, @thread, @log_level, @logger, @message)"/>
- <parameter>
- <parameterName value="@log_date"/>
- <dbType value="DateTime"/>
- <layout type="log4net.Layout.PatternLayout" value="%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}"/>
- </parameter>
- <parameter>
- <parameterName value="@thread"/>
- <dbType value="String"/>
- <size value="255"/>
- <layout type="log4net.Layout.PatternLayout" value="%thread"/>
- </parameter>
- <parameter>
- <parameterName value="@log_level"/>
- <dbType value="String"/>
- <size value="50"/>
- <layout type="log4net.Layout.PatternLayout" value="%level"/>
- </parameter>
- <parameter>
- <parameterName value="@logger"/>
- <dbType value="String"/>
- <size value="255"/>
- <layout type="log4net.Layout.PatternLayout" value="%logger"/>
- </parameter>
- <parameter>
- <parameterName value="@message"/>
- <dbType value="String"/>
- <size value="4000"/>
- <layout type="log4net.Layout.PatternLayout" value="%message"/>
- </parameter>
- </appender>
- </code>
- </example>
- <author>Julian Biddle</author>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Lance Nehring</author>
- </member>
- <member name="T:log4net.Appender.BufferingAppenderSkeleton">
- <summary>
- Abstract base class implementation of <see cref="T:log4net.Appender.IAppender"/> that
- buffers events in a fixed size buffer.
- </summary>
- <remarks>
- <para>
- This base class should be used by appenders that need to buffer a
- number of events before logging them. For example the <see cref="T:log4net.Appender.AdoNetAppender"/>
- buffers events and then submits the entire contents of the buffer to
- the underlying database in one go.
- </para>
- <para>
- Subclasses should override the <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>
- method to deliver the buffered events.
- </para>
- <para>The BufferingAppenderSkeleton maintains a fixed size cyclic
- buffer of events. The size of the buffer is set using
- the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> property.
- </para>
- <para>A <see cref="T:log4net.Core.ITriggeringEventEvaluator"/> is used to inspect
- each event as it arrives in the appender. If the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/>
- triggers, then the current buffer is sent immediately
- (see <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>). Otherwise the event
- is stored in the buffer. For example, an evaluator can be used to
- deliver the events immediately when an ERROR event arrives.
- </para>
- <para>
- The buffering appender can be configured in a <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> mode.
- By default the appender is NOT lossy. When the buffer is full all
- the buffered events are sent with <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>.
- If the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> property is set to <c>true</c> then the
- buffer will not be sent when it is full, and new events arriving
- in the appender will overwrite the oldest event in the buffer.
- In lossy mode the buffer will only be sent when the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/>
- triggers. This can be useful behavior when you need to know about
- ERROR events but not about events with a lower level, configure an
- evaluator that will trigger when an ERROR event arrives, the whole
- buffer will be sent which gives a history of events leading up to
- the ERROR event.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Appender.AppenderSkeleton">
- <summary>
- Abstract base class implementation of <see cref="T:log4net.Appender.IAppender"/>.
- </summary>
- <remarks>
- <para>
- This class provides the code for common functionality, such
- as support for threshold filtering and support for general filters.
- </para>
- <para>
- Appenders can also implement the <see cref="T:log4net.Core.IOptionHandler"/> interface. Therefore
- they would require that the <see cref="M:log4net.Core.IOptionHandler.ActivateOptions"/> method
- be called after the appenders properties have been configured.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Appender.IAppender">
- <summary>
- Implement this interface for your own strategies for printing log statements.
- </summary>
- <remarks>
- <para>
- Implementors should consider extending the <see cref="T:log4net.Appender.AppenderSkeleton"/>
- class which provides a default implementation of this interface.
- </para>
- <para>
- Appenders can also implement the <see cref="T:log4net.Core.IOptionHandler"/> interface. Therefore
- they would require that the <see cref="M:log4net.Core.IOptionHandler.ActivateOptions"/> method
- be called after the appenders properties have been configured.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.IAppender.Close">
- <summary>
- Closes the appender and releases resources.
- </summary>
- <remarks>
- <para>
- Releases any resources allocated within the appender such as file handles,
- network connections, etc.
- </para>
- <para>
- It is a programming error to append to a closed appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.IAppender.DoAppend(log4net.Core.LoggingEvent)">
- <summary>
- Log the logging event in Appender specific way.
- </summary>
- <param name="loggingEvent">The event to log</param>
- <remarks>
- <para>
- This method is called to log a message into this appender.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.IAppender.Name">
- <summary>
- Gets or sets the name of this appender.
- </summary>
- <value>The name of the appender.</value>
- <remarks>
- <para>The name uniquely identifies the appender.</para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.IBulkAppender">
- <summary>
- Interface for appenders that support bulk logging.
- </summary>
- <remarks>
- <para>
- This interface extends the <see cref="T:log4net.Appender.IAppender"/> interface to
- support bulk logging of <see cref="T:log4net.Core.LoggingEvent"/> objects. Appenders
- should only implement this interface if they can bulk log efficiently.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.IBulkAppender.DoAppend(log4net.Core.LoggingEvent[])">
- <summary>
- Log the array of logging events in Appender specific way.
- </summary>
- <param name="loggingEvents">The events to log</param>
- <remarks>
- <para>
- This method is called to log an array of events into this appender.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.IOptionHandler">
- <summary>
- Interface used to delay activate a configured object.
- </summary>
- <remarks>
- <para>
- This allows an object to defer activation of its options until all
- options have been set. This is required for components which have
- related options that remain ambiguous until all are set.
- </para>
- <para>
- If a component implements this interface then the <see cref="M:log4net.Core.IOptionHandler.ActivateOptions"/> method
- must be called by the container after its all the configured properties have been set
- and before the component can be used.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Core.IOptionHandler.ActivateOptions">
- <summary>
- Activate the options that were previously set with calls to properties.
- </summary>
- <remarks>
- <para>
- This allows an object to defer activation of its options until all
- options have been set. This is required for components which have
- related options that remain ambiguous until all are set.
- </para>
- <para>
- If a component implements this interface then this method must be called
- after its properties have been set before the component can be used.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.c_renderBufferSize">
- <summary>
- Initial buffer size
- </summary>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.c_renderBufferMaxCapacity">
- <summary>
- Maximum buffer size before it is recycled
- </summary>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>Empty default constructor</para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.Finalize">
- <summary>
- Finalizes this appender by calling the implementation's
- <see cref="M:log4net.Appender.AppenderSkeleton.Close"/> method.
- </summary>
- <remarks>
- <para>
- If this appender has not been closed then the <c>Finalize</c> method
- will call <see cref="M:log4net.Appender.AppenderSkeleton.Close"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.AppenderSkeleton.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.AppenderSkeleton.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.AppenderSkeleton.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.Close">
- <summary>
- Closes the appender and release resources.
- </summary>
- <remarks>
- <para>
- Release any resources allocated within the appender such as file handles,
- network connections, etc.
- </para>
- <para>
- It is a programming error to append to a closed appender.
- </para>
- <para>
- This method cannot be overridden by subclasses. This method
- delegates the closing of the appender to the <see cref="M:log4net.Appender.AppenderSkeleton.OnClose"/>
- method which must be overridden in the subclass.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)">
- <summary>
- Performs threshold checks and invokes filters before
- delegating actual logging to the subclasses specific
- <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- This method cannot be overridden by derived classes. A
- derived class should override the <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> method
- which is called by this method.
- </para>
- <para>
- The implementation of this method is as follows:
- </para>
- <para>
- <list type="bullet">
- <item>
- <description>
- Checks that the severity of the <paramref name="loggingEvent"/>
- is greater than or equal to the <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/> of this
- appender.</description>
- </item>
- <item>
- <description>
- Checks that the <see cref="T:log4net.Filter.IFilter"/> chain accepts the
- <paramref name="loggingEvent"/>.
- </description>
- </item>
- <item>
- <description>
- Calls <see cref="M:log4net.Appender.AppenderSkeleton.PreAppendCheck"/> and checks that
- it returns <c>true</c>.</description>
- </item>
- </list>
- </para>
- <para>
- If all of the above steps succeed then the <paramref name="loggingEvent"/>
- will be passed to the abstract <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent[])">
- <summary>
- Performs threshold checks and invokes filters before
- delegating actual logging to the subclasses specific
- <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent[])"/> method.
- </summary>
- <param name="loggingEvents">The array of events to log.</param>
- <remarks>
- <para>
- This method cannot be overridden by derived classes. A
- derived class should override the <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent[])"/> method
- which is called by this method.
- </para>
- <para>
- The implementation of this method is as follows:
- </para>
- <para>
- <list type="bullet">
- <item>
- <description>
- Checks that the severity of the <paramref name="loggingEvent"/>
- is greater than or equal to the <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/> of this
- appender.</description>
- </item>
- <item>
- <description>
- Checks that the <see cref="T:log4net.Filter.IFilter"/> chain accepts the
- <paramref name="loggingEvent"/>.
- </description>
- </item>
- <item>
- <description>
- Calls <see cref="M:log4net.Appender.AppenderSkeleton.PreAppendCheck"/> and checks that
- it returns <c>true</c>.</description>
- </item>
- </list>
- </para>
- <para>
- If all of the above steps succeed then the <paramref name="loggingEvents"/>
- will be passed to the <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent[])"/> method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.FilterEvent(log4net.Core.LoggingEvent)">
- <summary>
- Test if the logging event should we output by this appender
- </summary>
- <param name="loggingEvent">the event to test</param>
- <returns><c>true</c> if the event should be output, <c>false</c> if the event should be ignored</returns>
- <remarks>
- <para>
- This method checks the logging event against the threshold level set
- on this appender and also against the filters specified on this
- appender.
- </para>
- <para>
- The implementation of this method is as follows:
- </para>
- <para>
- <list type="bullet">
- <item>
- <description>
- Checks that the severity of the <paramref name="loggingEvent"/>
- is greater than or equal to the <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/> of this
- appender.</description>
- </item>
- <item>
- <description>
- Checks that the <see cref="T:log4net.Filter.IFilter"/> chain accepts the
- <paramref name="loggingEvent"/>.
- </description>
- </item>
- </list>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.AddFilter(log4net.Filter.IFilter)">
- <summary>
- Adds a filter to the end of the filter chain.
- </summary>
- <param name="filter">the filter to add to this appender</param>
- <remarks>
- <para>
- The Filters are organized in a linked list.
- </para>
- <para>
- Setting this property causes the new filter to be pushed onto the
- back of the filter chain.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.ClearFilters">
- <summary>
- Clears the filter list for this appender.
- </summary>
- <remarks>
- <para>
- Clears the filter list for this appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.IsAsSevereAsThreshold(log4net.Core.Level)">
- <summary>
- Checks if the message level is below this appender's threshold.
- </summary>
- <param name="level"><see cref="T:log4net.Core.Level"/> to test against.</param>
- <remarks>
- <para>
- If there is no threshold set, then the return value is always <c>true</c>.
- </para>
- </remarks>
- <returns>
- <c>true</c> if the <paramref name="level"/> meets the <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/>
- requirements of this appender.
- </returns>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.OnClose">
- <summary>
- Is called when the appender is closed. Derived classes should override
- this method if resources need to be released.
- </summary>
- <remarks>
- <para>
- Releases any resources allocated within the appender such as file handles,
- network connections, etc.
- </para>
- <para>
- It is a programming error to append to a closed appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)">
- <summary>
- Subclasses of <see cref="T:log4net.Appender.AppenderSkeleton"/> should implement this method
- to perform actual logging.
- </summary>
- <param name="loggingEvent">The event to append.</param>
- <remarks>
- <para>
- A subclass must implement this method to perform
- logging of the <paramref name="loggingEvent"/>.
- </para>
- <para>This method will be called by <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/>
- if all the conditions listed for that method are met.
- </para>
- <para>
- To restrict the logging of events in the appender
- override the <see cref="M:log4net.Appender.AppenderSkeleton.PreAppendCheck"/> method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent[])">
- <summary>
- Append a bulk array of logging events.
- </summary>
- <param name="loggingEvents">the array of logging events</param>
- <remarks>
- <para>
- This base class implementation calls the <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/>
- method for each element in the bulk array.
- </para>
- <para>
- A sub class that can better process a bulk array of events should
- override this method in addition to <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.PreAppendCheck">
- <summary>
- Called before <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> as a precondition.
- </summary>
- <remarks>
- <para>
- This method is called by <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/>
- before the call to the abstract <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> method.
- </para>
- <para>
- This method can be overridden in a subclass to extend the checks
- made before the event is passed to the <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> method.
- </para>
- <para>
- A subclass should ensure that they delegate this call to
- this base class if it is overridden.
- </para>
- </remarks>
- <returns><c>true</c> if the call to <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> should proceed.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.RenderLoggingEvent(log4net.Core.LoggingEvent)">
- <summary>
- Renders the <see cref="T:log4net.Core.LoggingEvent"/> to a string.
- </summary>
- <param name="loggingEvent">The event to render.</param>
- <returns>The event rendered as a string.</returns>
- <remarks>
- <para>
- Helper method to render a <see cref="T:log4net.Core.LoggingEvent"/> to
- a string. This appender must have a <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/>
- set to render the <paramref name="loggingEvent"/> to
- a string.
- </para>
- <para>If there is exception data in the logging event and
- the layout does not process the exception, this method
- will append the exception text to the rendered string.
- </para>
- <para>
- Where possible use the alternative version of this method
- <see cref="M:log4net.Appender.AppenderSkeleton.RenderLoggingEvent(System.IO.TextWriter,log4net.Core.LoggingEvent)"/>.
- That method streams the rendering onto an existing Writer
- which can give better performance if the caller already has
- a <see cref="T:System.IO.TextWriter"/> open and ready for writing.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.RenderLoggingEvent(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Renders the <see cref="T:log4net.Core.LoggingEvent"/> to a string.
- </summary>
- <param name="loggingEvent">The event to render.</param>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <remarks>
- <para>
- Helper method to render a <see cref="T:log4net.Core.LoggingEvent"/> to
- a string. This appender must have a <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/>
- set to render the <paramref name="loggingEvent"/> to
- a string.
- </para>
- <para>If there is exception data in the logging event and
- the layout does not process the exception, this method
- will append the exception text to the rendered string.
- </para>
- <para>
- Use this method in preference to <see cref="M:log4net.Appender.AppenderSkeleton.RenderLoggingEvent(log4net.Core.LoggingEvent)"/>
- where possible. If, however, the caller needs to render the event
- to a string then <see cref="M:log4net.Appender.AppenderSkeleton.RenderLoggingEvent(log4net.Core.LoggingEvent)"/> does
- provide an efficient mechanism for doing so.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_layout">
- <summary>
- The layout of this appender.
- </summary>
- <remarks>
- See <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/> for more information.
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_name">
- <summary>
- The name of this appender.
- </summary>
- <remarks>
- See <see cref="P:log4net.Appender.AppenderSkeleton.Name"/> for more information.
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_threshold">
- <summary>
- The level threshold of this appender.
- </summary>
- <remarks>
- <para>
- There is no level threshold filtering by default.
- </para>
- <para>
- See <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_errorHandler">
- <summary>
- It is assumed and enforced that errorHandler is never null.
- </summary>
- <remarks>
- <para>
- It is assumed and enforced that errorHandler is never null.
- </para>
- <para>
- See <see cref="P:log4net.Appender.AppenderSkeleton.ErrorHandler"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_headFilter">
- <summary>
- The first filter in the filter chain.
- </summary>
- <remarks>
- <para>
- Set to <c>null</c> initially.
- </para>
- <para>
- See <see cref="T:log4net.Filter.IFilter"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_tailFilter">
- <summary>
- The last filter in the filter chain.
- </summary>
- <remarks>
- See <see cref="T:log4net.Filter.IFilter"/> for more information.
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_closed">
- <summary>
- Flag indicating if this appender is closed.
- </summary>
- <remarks>
- See <see cref="M:log4net.Appender.AppenderSkeleton.Close"/> for more information.
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_recursiveGuard">
- <summary>
- The guard prevents an appender from repeatedly calling its own DoAppend method
- </summary>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_renderWriter">
- <summary>
- StringWriter used to render events
- </summary>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.Threshold">
- <summary>
- Gets or sets the threshold <see cref="T:log4net.Core.Level"/> of this appender.
- </summary>
- <value>
- The threshold <see cref="T:log4net.Core.Level"/> of the appender.
- </value>
- <remarks>
- <para>
- All log events with lower level than the threshold level are ignored
- by the appender.
- </para>
- <para>
- In configuration files this option is specified by setting the
- value of the <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/> option to a level
- string, such as "DEBUG", "INFO" and so on.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.ErrorHandler">
- <summary>
- Gets or sets the <see cref="T:log4net.Core.IErrorHandler"/> for this appender.
- </summary>
- <value>The <see cref="T:log4net.Core.IErrorHandler"/> of the appender</value>
- <remarks>
- <para>
- The <see cref="T:log4net.Appender.AppenderSkeleton"/> provides a default
- implementation for the <see cref="P:log4net.Appender.AppenderSkeleton.ErrorHandler"/> property.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.FilterHead">
- <summary>
- The filter chain.
- </summary>
- <value>The head of the filter chain filter chain.</value>
- <remarks>
- <para>
- Returns the head Filter. The Filters are organized in a linked list
- and so all Filters on this Appender are available through the result.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.Layout">
- <summary>
- Gets or sets the <see cref="T:log4net.Layout.ILayout"/> for this appender.
- </summary>
- <value>The layout of the appender.</value>
- <remarks>
- <para>
- See <see cref="P:log4net.Appender.AppenderSkeleton.RequiresLayout"/> for more information.
- </para>
- </remarks>
- <seealso cref="P:log4net.Appender.AppenderSkeleton.RequiresLayout"/>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.Name">
- <summary>
- Gets or sets the name of this appender.
- </summary>
- <value>The name of the appender.</value>
- <remarks>
- <para>
- The name uniquely identifies the appender.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.RequiresLayout">
- <summary>
- Tests if this appender requires a <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/> to be set.
- </summary>
- <remarks>
- <para>
- In the rather exceptional case, where the appender
- implementation admits a layout but can also work without it,
- then the appender should return <c>true</c>.
- </para>
- <para>
- This default implementation always returns <c>true</c>.
- </para>
- </remarks>
- <returns>
- <c>true</c> if the appender requires a layout object, otherwise <c>false</c>.
- </returns>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.DEFAULT_BUFFER_SIZE">
- <summary>
- The default buffer size.
- </summary>
- <remarks>
- The default size of the cyclic buffer used to store events.
- This is set to 512 by default.
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.BufferingAppenderSkeleton"/> class.
- </summary>
- <remarks>
- <para>
- Protected default constructor to allow subclassing.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.#ctor(System.Boolean)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.BufferingAppenderSkeleton"/> class.
- </summary>
- <param name="eventMustBeFixed">the events passed through this appender must be
- fixed by the time that they arrive in the derived class' <c>SendBuffer</c> method.</param>
- <remarks>
- <para>
- Protected constructor to allow subclassing.
- </para>
- <para>
- The <paramref name="eventMustBeFixed"/> should be set if the subclass
- expects the events delivered to be fixed even if the
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> is set to zero, i.e. when no buffering occurs.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.Flush">
- <summary>
- Flush the currently buffered events
- </summary>
- <remarks>
- <para>
- Flushes any events that have been buffered.
- </para>
- <para>
- If the appender is buffering in <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> mode then the contents
- of the buffer will NOT be flushed to the appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.Flush(System.Boolean)">
- <summary>
- Flush the currently buffered events
- </summary>
- <param name="flushLossyBuffer">set to <c>true</c> to flush the buffer of lossy events</param>
- <remarks>
- <para>
- Flushes events that have been buffered. If <paramref name="flushLossyBuffer"/> is
- <c>false</c> then events will only be flushed if this buffer is non-lossy mode.
- </para>
- <para>
- If the appender is buffering in <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> mode then the contents
- of the buffer will only be flushed if <paramref name="flushLossyBuffer"/> is <c>true</c>.
- In this case the contents of the buffer will be tested against the
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.LossyEvaluator"/> and if triggering will be output. All other buffered
- events will be discarded.
- </para>
- <para>
- If <paramref name="flushLossyBuffer"/> is <c>true</c> then the buffer will always
- be emptied by calling this method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.BufferingAppenderSkeleton.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.BufferingAppenderSkeleton.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.BufferingAppenderSkeleton.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.OnClose">
- <summary>
- Close this appender instance.
- </summary>
- <remarks>
- <para>
- Close this appender instance. If this appender is marked
- as not <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> then the remaining events in
- the buffer must be sent when the appender is closed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">the event to log</param>
- <remarks>
- <para>
- Stores the <paramref name="loggingEvent"/> in the cyclic buffer.
- </para>
- <para>
- The buffer will be sent (i.e. passed to the <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>
- method) if one of the following conditions is met:
- </para>
- <list type="bullet">
- <item>
- <description>The cyclic buffer is full and this appender is
- marked as not lossy (see <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/>)</description>
- </item>
- <item>
- <description>An <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> is set and
- it is triggered for the <paramref name="loggingEvent"/>
- specified.</description>
- </item>
- </list>
- <para>
- Before the event is stored in the buffer it is fixed
- (see <see cref="M:log4net.Core.LoggingEvent.FixVolatileData(log4net.Core.FixFlags)"/>) to ensure that
- any data referenced by the event will be valid when the buffer
- is processed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.SendFromBuffer(log4net.Core.LoggingEvent,log4net.Util.CyclicBuffer)">
- <summary>
- Sends the contents of the buffer.
- </summary>
- <param name="firstLoggingEvent">The first logging event.</param>
- <param name="buffer">The buffer containing the events that need to be send.</param>
- <remarks>
- <para>
- The subclass must override <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Sends the events.
- </summary>
- <param name="events">The events that need to be send.</param>
- <remarks>
- <para>
- The subclass must override this method to process the buffered events.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_bufferSize">
- <summary>
- The size of the cyclic buffer used to hold the logging events.
- </summary>
- <remarks>
- Set to <see cref="F:log4net.Appender.BufferingAppenderSkeleton.DEFAULT_BUFFER_SIZE"/> by default.
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_cb">
- <summary>
- The cyclic buffer used to store the logging events.
- </summary>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_evaluator">
- <summary>
- The triggering event evaluator that causes the buffer to be sent immediately.
- </summary>
- <remarks>
- The object that is used to determine if an event causes the entire
- buffer to be sent immediately. This field can be <c>null</c>, which
- indicates that event triggering is not to be done. The evaluator
- can be set using the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> property. If this appender
- has the <see cref="F:log4net.Appender.BufferingAppenderSkeleton.m_lossy"/> (<see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> property) set to
- <c>true</c> then an <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> must be set.
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_lossy">
- <summary>
- Indicates if the appender should overwrite events in the cyclic buffer
- when it becomes full, or if the buffer should be flushed when the
- buffer is full.
- </summary>
- <remarks>
- If this field is set to <c>true</c> then an <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> must
- be set.
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_lossyEvaluator">
- <summary>
- The triggering event evaluator filters discarded events.
- </summary>
- <remarks>
- The object that is used to determine if an event that is discarded should
- really be discarded or if it should be sent to the appenders.
- This field can be <c>null</c>, which indicates that all discarded events will
- be discarded.
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_fixFlags">
- <summary>
- Value indicating which fields in the event should be fixed
- </summary>
- <remarks>
- By default all fields are fixed
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_eventMustBeFixed">
- <summary>
- The events delivered to the subclass must be fixed.
- </summary>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.Lossy">
- <summary>
- Gets or sets a value that indicates whether the appender is lossy.
- </summary>
- <value>
- <c>true</c> if the appender is lossy, otherwise <c>false</c>. The default is <c>false</c>.
- </value>
- <remarks>
- <para>
- This appender uses a buffer to store logging events before
- delivering them. A triggering event causes the whole buffer
- to be send to the remote sink. If the buffer overruns before
- a triggering event then logging events could be lost. Set
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> to <c>false</c> to prevent logging events
- from being lost.
- </para>
- <para>If <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> is set to <c>true</c> then an
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> must be specified.</para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize">
- <summary>
- Gets or sets the size of the cyclic buffer used to hold the
- logging events.
- </summary>
- <value>
- The size of the cyclic buffer used to hold the logging events.
- </value>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> option takes a positive integer
- representing the maximum number of logging events to collect in
- a cyclic buffer. When the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> is reached,
- oldest events are deleted as new events are added to the
- buffer. By default the size of the cyclic buffer is 512 events.
- </para>
- <para>
- If the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> is set to a value less than
- or equal to 1 then no buffering will occur. The logging event
- will be delivered synchronously (depending on the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/>
- and <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> properties). Otherwise the event will
- be buffered.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator">
- <summary>
- Gets or sets the <see cref="T:log4net.Core.ITriggeringEventEvaluator"/> that causes the
- buffer to be sent immediately.
- </summary>
- <value>
- The <see cref="T:log4net.Core.ITriggeringEventEvaluator"/> that causes the buffer to be
- sent immediately.
- </value>
- <remarks>
- <para>
- The evaluator will be called for each event that is appended to this
- appender. If the evaluator triggers then the current buffer will
- immediately be sent (see <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>).
- </para>
- <para>If <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> is set to <c>true</c> then an
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> must be specified.</para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.LossyEvaluator">
- <summary>
- Gets or sets the value of the <see cref="T:log4net.Core.ITriggeringEventEvaluator"/> to use.
- </summary>
- <value>
- The value of the <see cref="T:log4net.Core.ITriggeringEventEvaluator"/> to use.
- </value>
- <remarks>
- <para>
- The evaluator will be called for each event that is discarded from this
- appender. If the evaluator triggers then the current buffer will immediately
- be sent (see <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.OnlyFixPartialEventData">
- <summary>
- Gets or sets a value indicating if only part of the logging event data
- should be fixed.
- </summary>
- <value>
- <c>true</c> if the appender should only fix part of the logging event
- data, otherwise <c>false</c>. The default is <c>false</c>.
- </value>
- <remarks>
- <para>
- Setting this property to <c>true</c> will cause only part of the
- event data to be fixed and serialized. This will improve performance.
- </para>
- <para>
- See <see cref="M:log4net.Core.LoggingEvent.FixVolatileData(log4net.Core.FixFlags)"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.Fix">
- <summary>
- Gets or sets a the fields that will be fixed in the event
- </summary>
- <value>
- The event fields that will be fixed before the event is buffered
- </value>
- <remarks>
- <para>
- The logging event needs to have certain thread specific values
- captured before it can be buffered. See <see cref="P:log4net.Core.LoggingEvent.Fix"/>
- for details.
- </para>
- </remarks>
- <seealso cref="P:log4net.Core.LoggingEvent.Fix"/>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.AdoNetAppender"/> class.
- </summary>
- <remarks>
- Public default constructor to initialize a new instance of this class.
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.AdoNetAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.AdoNetAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.AdoNetAppender.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.OnClose">
- <summary>
- Override the parent method to close the database
- </summary>
- <remarks>
- <para>
- Closes the database command and database connection.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Inserts the events into the database.
- </summary>
- <param name="events">The events to insert into the database.</param>
- <remarks>
- <para>
- Insert all the events specified in the <paramref name="events"/>
- array into the database.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.AddParameter(log4net.Appender.AdoNetAppenderParameter)">
- <summary>
- Adds a parameter to the command.
- </summary>
- <param name="parameter">The parameter to add to the command.</param>
- <remarks>
- <para>
- Adds a parameter to the ordered list of command parameters.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.SendBuffer(System.Data.IDbTransaction,log4net.Core.LoggingEvent[])">
- <summary>
- Writes the events to the database using the transaction specified.
- </summary>
- <param name="dbTran">The transaction that the events will be executed under.</param>
- <param name="events">The array of events to insert into the database.</param>
- <remarks>
- <para>
- The transaction argument can be <c>null</c> if the appender has been
- configured not to use transactions. See <see cref="P:log4net.Appender.AdoNetAppender.UseTransactions"/>
- property for more information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.GetLogStatement(log4net.Core.LoggingEvent)">
- <summary>
- Formats the log message into database statement text.
- </summary>
- <param name="logEvent">The event being logged.</param>
- <remarks>
- This method can be overridden by subclasses to provide
- more control over the format of the database statement.
- </remarks>
- <returns>
- Text that can be passed to a <see cref="T:System.Data.IDbCommand"/>.
- </returns>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.InitializeDatabaseConnection">
- <summary>
- Connects to the database.
- </summary>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.ResolveConnectionType">
- <summary>
- Retrieves the class type of the ADO.NET provider.
- </summary>
- <remarks>
- <para>
- Gets the Type of the ADO.NET provider to use to connect to the
- database. This method resolves the type specified in the
- <see cref="P:log4net.Appender.AdoNetAppender.ConnectionType"/> property.
- </para>
- <para>
- Subclasses can override this method to return a different type
- if necessary.
- </para>
- </remarks>
- <returns>The <see cref="T:System.Type"/> of the ADO.NET provider</returns>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.InitializeDatabaseCommand">
- <summary>
- Prepares the database command and initialize the parameters.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_usePreparedCommand">
- <summary>
- Flag to indicate if we are using a command object
- </summary>
- <remarks>
- <para>
- Set to <c>true</c> when the appender is to use a prepared
- statement or stored procedure to insert into the database.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_parameters">
- <summary>
- The list of <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> objects.
- </summary>
- <remarks>
- <para>
- The list of <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> objects.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_securityContext">
- <summary>
- The security context to use for privileged calls
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_dbConnection">
- <summary>
- The <see cref="T:System.Data.IDbConnection"/> that will be used
- to insert logging events into a database.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_dbCommand">
- <summary>
- The database command.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_connectionString">
- <summary>
- Database connection string.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_connectionType">
- <summary>
- String type name of the <see cref="T:System.Data.IDbConnection"/> type name.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_commandText">
- <summary>
- The text of the command.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_commandType">
- <summary>
- The command type.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_useTransactions">
- <summary>
- Indicates whether to use transactions when writing to the database.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_reconnectOnError">
- <summary>
- Indicates whether to use transactions when writing to the database.
- </summary>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.ConnectionString">
- <summary>
- Gets or sets the database connection string that is used to connect to
- the database.
- </summary>
- <value>
- The database connection string used to connect to the database.
- </value>
- <remarks>
- <para>
- The connections string is specific to the connection type.
- See <see cref="P:log4net.Appender.AdoNetAppender.ConnectionType"/> for more information.
- </para>
- </remarks>
- <example>Connection string for MS Access via ODBC:
- <code>"DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb"</code>
- </example>
- <example>Another connection string for MS Access via ODBC:
- <code>"Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;"</code>
- </example>
- <example>Connection string for MS Access via OLE DB:
- <code>"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;"</code>
- </example>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.ConnectionType">
- <summary>
- Gets or sets the type name of the <see cref="T:System.Data.IDbConnection"/> connection
- that should be created.
- </summary>
- <value>
- The type name of the <see cref="T:System.Data.IDbConnection"/> connection.
- </value>
- <remarks>
- <para>
- The type name of the ADO.NET provider to use.
- </para>
- <para>
- The default is to use the OLE DB provider.
- </para>
- </remarks>
- <example>Use the OLE DB Provider. This is the default value.
- <code>System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</code>
- </example>
- <example>Use the MS SQL Server Provider.
- <code>System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</code>
- </example>
- <example>Use the ODBC Provider.
- <code>Microsoft.Data.Odbc.OdbcConnection,Microsoft.Data.Odbc,version=1.0.3300.0,publicKeyToken=b77a5c561934e089,culture=neutral</code>
- This is an optional package that you can download from
- <a href="http://msdn.microsoft.com/downloads">http://msdn.microsoft.com/downloads</a>
- search for <b>ODBC .NET Data Provider</b>.
- </example>
- <example>Use the Oracle Provider.
- <code>System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</code>
- This is an optional package that you can download from
- <a href="http://msdn.microsoft.com/downloads">http://msdn.microsoft.com/downloads</a>
- search for <b>.NET Managed Provider for Oracle</b>.
- </example>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.CommandText">
- <summary>
- Gets or sets the command text that is used to insert logging events
- into the database.
- </summary>
- <value>
- The command text used to insert logging events into the database.
- </value>
- <remarks>
- <para>
- Either the text of the prepared statement or the
- name of the stored procedure to execute to write into
- the database.
- </para>
- <para>
- The <see cref="P:log4net.Appender.AdoNetAppender.CommandType"/> property determines if
- this text is a prepared statement or a stored procedure.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.CommandType">
- <summary>
- Gets or sets the command type to execute.
- </summary>
- <value>
- The command type to execute.
- </value>
- <remarks>
- <para>
- This value may be either <see cref="F:System.Data.CommandType.Text"/> (<c>System.Data.CommandType.Text</c>) to specify
- that the <see cref="P:log4net.Appender.AdoNetAppender.CommandText"/> is a prepared statement to execute,
- or <see cref="F:System.Data.CommandType.StoredProcedure"/> (<c>System.Data.CommandType.StoredProcedure</c>) to specify that the
- <see cref="P:log4net.Appender.AdoNetAppender.CommandText"/> property is the name of a stored procedure
- to execute.
- </para>
- <para>
- The default value is <see cref="F:System.Data.CommandType.Text"/> (<c>System.Data.CommandType.Text</c>).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.UseTransactions">
- <summary>
- Should transactions be used to insert logging events in the database.
- </summary>
- <value>
- <c>true</c> if transactions should be used to insert logging events in
- the database, otherwise <c>false</c>. The default value is <c>true</c>.
- </value>
- <remarks>
- <para>
- Gets or sets a value that indicates whether transactions should be used
- to insert logging events in the database.
- </para>
- <para>
- When set a single transaction will be used to insert the buffered events
- into the database. Otherwise each event will be inserted without using
- an explicit transaction.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.SecurityContext">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.AdoNetAppender.SecurityContext"/> used to call the NetSend method.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.AdoNetAppender.SecurityContext"/> used to call the NetSend method.
- </value>
- <remarks>
- <para>
- Unless a <see cref="P:log4net.Appender.AdoNetAppender.SecurityContext"/> specified here for this appender
- the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is queried for the
- security context to use. The default behavior is to use the security context
- of the current thread.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.ReconnectOnError">
- <summary>
- Should this appender try to reconnect to the database on error.
- </summary>
- <value>
- <c>true</c> if the appender should try to reconnect to the database after an
- error has occurred, otherwise <c>false</c>. The default value is <c>false</c>,
- i.e. not to try to reconnect.
- </value>
- <remarks>
- <para>
- The default behaviour is for the appender not to try to reconnect to the
- database if an error occurs. Subsequent logging events are discarded.
- </para>
- <para>
- To force the appender to attempt to reconnect to the database set this
- property to <c>true</c>.
- </para>
- <note>
- When the appender attempts to connect to the database there may be a
- delay of up to the connection timeout specified in the connection string.
- This delay will block the calling application's thread.
- Until the connection can be reestablished this potential delay may occur multiple times.
- </note>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.Connection">
- <summary>
- Gets or sets the underlying <see cref="T:System.Data.IDbConnection"/>.
- </summary>
- <value>
- The underlying <see cref="T:System.Data.IDbConnection"/>.
- </value>
- <remarks>
- <see cref="T:log4net.Appender.AdoNetAppender"/> creates a <see cref="T:System.Data.IDbConnection"/> to insert
- logging events into a database. Classes deriving from <see cref="T:log4net.Appender.AdoNetAppender"/>
- can use this property to get or set this <see cref="T:System.Data.IDbConnection"/>. Use the
- underlying <see cref="T:System.Data.IDbConnection"/> returned from <see cref="P:log4net.Appender.AdoNetAppender.Connection"/> if
- you require access beyond that which <see cref="T:log4net.Appender.AdoNetAppender"/> provides.
- </remarks>
- </member>
- <member name="T:log4net.Appender.AdoNetAppenderParameter">
- <summary>
- Parameter type used by the <see cref="T:log4net.Appender.AdoNetAppender"/>.
- </summary>
- <remarks>
- <para>
- This class provides the basic database parameter properties
- as defined by the <see cref="T:System.Data.IDbDataParameter"/> interface.
- </para>
- <para>This type can be subclassed to provide database specific
- functionality. The two methods that are called externally are
- <see cref="M:log4net.Appender.AdoNetAppenderParameter.Prepare(System.Data.IDbCommand)"/> and <see cref="M:log4net.Appender.AdoNetAppenderParameter.FormatValue(System.Data.IDbCommand,log4net.Core.LoggingEvent)"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppenderParameter.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> class.
- </summary>
- <remarks>
- Default constructor for the AdoNetAppenderParameter class.
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppenderParameter.Prepare(System.Data.IDbCommand)">
- <summary>
- Prepare the specified database command object.
- </summary>
- <param name="command">The command to prepare.</param>
- <remarks>
- <para>
- Prepares the database command object by adding
- this parameter to its collection of parameters.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppenderParameter.FormatValue(System.Data.IDbCommand,log4net.Core.LoggingEvent)">
- <summary>
- Renders the logging event and set the parameter value in the command.
- </summary>
- <param name="command">The command containing the parameter.</param>
- <param name="loggingEvent">The event to be rendered.</param>
- <remarks>
- <para>
- Renders the logging event using this parameters layout
- object. Sets the value of the parameter on the command object.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_parameterName">
- <summary>
- The name of this parameter.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_dbType">
- <summary>
- The database type for this parameter.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_inferType">
- <summary>
- Flag to infer type rather than use the DbType
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_precision">
- <summary>
- The precision for this parameter.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_scale">
- <summary>
- The scale for this parameter.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_size">
- <summary>
- The size for this parameter.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_layout">
- <summary>
- The <see cref="T:log4net.Layout.IRawLayout"/> to use to render the
- logging event into an object for this parameter.
- </summary>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.ParameterName">
- <summary>
- Gets or sets the name of this parameter.
- </summary>
- <value>
- The name of this parameter.
- </value>
- <remarks>
- <para>
- The name of this parameter. The parameter name
- must match up to a named parameter to the SQL stored procedure
- or prepared statement.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.DbType">
- <summary>
- Gets or sets the database type for this parameter.
- </summary>
- <value>
- The database type for this parameter.
- </value>
- <remarks>
- <para>
- The database type for this parameter. This property should
- be set to the database type from the <see cref="P:log4net.Appender.AdoNetAppenderParameter.DbType"/>
- enumeration. See <see cref="P:System.Data.IDataParameter.DbType"/>.
- </para>
- <para>
- This property is optional. If not specified the ADO.NET provider
- will attempt to infer the type from the value.
- </para>
- </remarks>
- <seealso cref="P:System.Data.IDataParameter.DbType"/>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.Precision">
- <summary>
- Gets or sets the precision for this parameter.
- </summary>
- <value>
- The precision for this parameter.
- </value>
- <remarks>
- <para>
- The maximum number of digits used to represent the Value.
- </para>
- <para>
- This property is optional. If not specified the ADO.NET provider
- will attempt to infer the precision from the value.
- </para>
- </remarks>
- <seealso cref="P:System.Data.IDbDataParameter.Precision"/>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.Scale">
- <summary>
- Gets or sets the scale for this parameter.
- </summary>
- <value>
- The scale for this parameter.
- </value>
- <remarks>
- <para>
- The number of decimal places to which Value is resolved.
- </para>
- <para>
- This property is optional. If not specified the ADO.NET provider
- will attempt to infer the scale from the value.
- </para>
- </remarks>
- <seealso cref="P:System.Data.IDbDataParameter.Scale"/>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.Size">
- <summary>
- Gets or sets the size for this parameter.
- </summary>
- <value>
- The size for this parameter.
- </value>
- <remarks>
- <para>
- The maximum size, in bytes, of the data within the column.
- </para>
- <para>
- This property is optional. If not specified the ADO.NET provider
- will attempt to infer the size from the value.
- </para>
- </remarks>
- <seealso cref="P:System.Data.IDbDataParameter.Size"/>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.Layout">
- <summary>
- Gets or sets the <see cref="T:log4net.Layout.IRawLayout"/> to use to
- render the logging event into an object for this
- parameter.
- </summary>
- <value>
- The <see cref="T:log4net.Layout.IRawLayout"/> used to render the
- logging event into an object for this parameter.
- </value>
- <remarks>
- <para>
- The <see cref="T:log4net.Layout.IRawLayout"/> that renders the value for this
- parameter.
- </para>
- <para>
- The <see cref="T:log4net.Layout.RawLayoutConverter"/> can be used to adapt
- any <see cref="T:log4net.Layout.ILayout"/> into a <see cref="T:log4net.Layout.IRawLayout"/>
- for use in the property.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.AnsiColorTerminalAppender">
- <summary>
- Appends logging events to the terminal using ANSI color escape sequences.
- </summary>
- <remarks>
- <para>
- AnsiColorTerminalAppender appends log events to the standard output stream
- or the error output stream using a layout specified by the
- user. It also allows the color of a specific level of message to be set.
- </para>
- <note>
- This appender expects the terminal to understand the VT100 control set
- in order to interpret the color codes. If the terminal or console does not
- understand the control codes the behavior is not defined.
- </note>
- <para>
- By default, all output is written to the console's standard output stream.
- The <see cref="P:log4net.Appender.AnsiColorTerminalAppender.Target"/> property can be set to direct the output to the
- error stream.
- </para>
- <para>
- NOTE: This appender writes each message to the <c>System.Console.Out</c> or
- <c>System.Console.Error</c> that is set at the time the event is appended.
- Therefore it is possible to programmatically redirect the output of this appender
- (for example NUnit does this to capture program output). While this is the desired
- behavior of this appender it may have security implications in your application.
- </para>
- <para>
- When configuring the ANSI colored terminal appender, a mapping should be
- specified to map a logging level to a color. For example:
- </para>
- <code lang="XML" escaped="true">
- <mapping>
- <level value="ERROR"/>
- <foreColor value="White"/>
- <backColor value="Red"/>
- <attributes value="Bright,Underscore"/>
- </mapping>
- <mapping>
- <level value="DEBUG"/>
- <backColor value="Green"/>
- </mapping>
- </code>
- <para>
- The Level is the standard log4net logging level and ForeColor and BackColor can be any
- of the following values:
- <list type="bullet">
- <item><term>Blue</term><description></description></item>
- <item><term>Green</term><description></description></item>
- <item><term>Red</term><description></description></item>
- <item><term>White</term><description></description></item>
- <item><term>Yellow</term><description></description></item>
- <item><term>Purple</term><description></description></item>
- <item><term>Cyan</term><description></description></item>
- </list>
- These color values cannot be combined together to make new colors.
- </para>
- <para>
- The attributes can be any combination of the following:
- <list type="bullet">
- <item><term>Bright</term><description>foreground is brighter</description></item>
- <item><term>Dim</term><description>foreground is dimmer</description></item>
- <item><term>Underscore</term><description>message is underlined</description></item>
- <item><term>Blink</term><description>foreground is blinking (does not work on all terminals)</description></item>
- <item><term>Reverse</term><description>foreground and background are reversed</description></item>
- <item><term>Hidden</term><description>output is hidden</description></item>
- <item><term>Strikethrough</term><description>message has a line through it</description></item>
- </list>
- While any of these attributes may be combined together not all combinations
- work well together, for example setting both <i>Bright</i> and <i>Dim</i> attributes makes
- no sense.
- </para>
- </remarks>
- <author>Patrick Wagstrom</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.ConsoleOut">
- <summary>
- The <see cref="P:log4net.Appender.AnsiColorTerminalAppender.Target"/> to use when writing to the Console
- standard output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.AnsiColorTerminalAppender.Target"/> to use when writing to the Console
- standard output stream.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.ConsoleError">
- <summary>
- The <see cref="P:log4net.Appender.AnsiColorTerminalAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.AnsiColorTerminalAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.PostEventCodes">
- <summary>
- Ansi code to reset terminal
- </summary>
- </member>
- <member name="M:log4net.Appender.AnsiColorTerminalAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.AnsiColorTerminalAppender"/> class.
- </summary>
- <remarks>
- The instance of the <see cref="T:log4net.Appender.AnsiColorTerminalAppender"/> class is set up to write
- to the standard output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.AnsiColorTerminalAppender.AddMapping(log4net.Appender.AnsiColorTerminalAppender.LevelColors)">
- <summary>
- Add a mapping of level to color
- </summary>
- <param name="mapping">The mapping to add</param>
- <remarks>
- <para>
- Add a <see cref="T:log4net.Appender.AnsiColorTerminalAppender.LevelColors"/> mapping to this appender.
- Each mapping defines the foreground and background colours
- for a level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AnsiColorTerminalAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the event to the console.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AnsiColorTerminalAppender.ActivateOptions">
- <summary>
- Initialize the options for this appender
- </summary>
- <remarks>
- <para>
- Initialize the level to color mappings set on this appender.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.m_writeToErrorStream">
- <summary>
- Flag to write output to the error stream rather than the standard output stream
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.m_levelMapping">
- <summary>
- Mapping from level object to color value
- </summary>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.Target">
- <summary>
- Target is the value of the console output stream.
- </summary>
- <value>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </value>
- <remarks>
- <para>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes">
- <summary>
- The enum of possible display attributes
- </summary>
- <remarks>
- <para>
- The following flags can be combined together to
- form the ANSI color attributes.
- </para>
- </remarks>
- <seealso cref="T:log4net.Appender.AnsiColorTerminalAppender"/>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Bright">
- <summary>
- text is bright
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Dim">
- <summary>
- text is dim
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Underscore">
- <summary>
- text is underlined
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Blink">
- <summary>
- text is blinking
- </summary>
- <remarks>
- Not all terminals support this attribute
- </remarks>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Reverse">
- <summary>
- text and background colors are reversed
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Hidden">
- <summary>
- text is hidden
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Strikethrough">
- <summary>
- text is displayed with a strikethrough
- </summary>
- </member>
- <member name="T:log4net.Appender.AnsiColorTerminalAppender.AnsiColor">
- <summary>
- The enum of possible foreground or background color values for
- use with the color mapping method
- </summary>
- <remarks>
- <para>
- The output can be in one for the following ANSI colors.
- </para>
- </remarks>
- <seealso cref="T:log4net.Appender.AnsiColorTerminalAppender"/>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Black">
- <summary>
- color is black
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Red">
- <summary>
- color is red
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Green">
- <summary>
- color is green
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Yellow">
- <summary>
- color is yellow
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Blue">
- <summary>
- color is blue
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Magenta">
- <summary>
- color is magenta
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Cyan">
- <summary>
- color is cyan
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.White">
- <summary>
- color is white
- </summary>
- </member>
- <member name="T:log4net.Appender.AnsiColorTerminalAppender.LevelColors">
- <summary>
- A class to act as a mapping between the level that a logging call is made at and
- the color it should be displayed as.
- </summary>
- <remarks>
- <para>
- Defines the mapping between a level and the color it should be displayed in.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.LevelMappingEntry">
- <summary>
- An entry in the <see cref="T:log4net.Util.LevelMapping"/>
- </summary>
- <remarks>
- <para>
- This is an abstract base class for types that are stored in the
- <see cref="T:log4net.Util.LevelMapping"/> object.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.LevelMappingEntry.#ctor">
- <summary>
- Default protected constructor
- </summary>
- <remarks>
- <para>
- Default protected constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LevelMappingEntry.ActivateOptions">
- <summary>
- Initialize any options defined on this entry
- </summary>
- <remarks>
- <para>
- Should be overridden by any classes that need to initialise based on their options
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.LevelMappingEntry.Level">
- <summary>
- The level that is the key for this mapping
- </summary>
- <value>
- The <see cref="P:log4net.Util.LevelMappingEntry.Level"/> that is the key for this mapping
- </value>
- <remarks>
- <para>
- Get or set the <see cref="P:log4net.Util.LevelMappingEntry.Level"/> that is the key for this
- mapping subclass.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AnsiColorTerminalAppender.LevelColors.ActivateOptions">
- <summary>
- Initialize the options for the object
- </summary>
- <remarks>
- <para>
- Combine the <see cref="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.ForeColor"/> and <see cref="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.BackColor"/> together
- and append the attributes.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.ForeColor">
- <summary>
- The mapped foreground color for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped foreground color for the specified level
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.BackColor">
- <summary>
- The mapped background color for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped background color for the specified level
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.Attributes">
- <summary>
- The color attributes for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The color attributes for the specified level
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.CombinedColor">
- <summary>
- The combined <see cref="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.ForeColor"/>, <see cref="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.BackColor"/> and
- <see cref="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.Attributes"/> suitable for setting the ansi terminal color.
- </summary>
- </member>
- <member name="T:log4net.Appender.AppenderCollection">
- <summary>
- A strongly-typed collection of <see cref="T:log4net.Appender.IAppender"/> objects.
- </summary>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.ReadOnly(log4net.Appender.AppenderCollection)">
- <summary>
- Creates a read-only wrapper for a <c>AppenderCollection</c> instance.
- </summary>
- <param name="list">list to create a readonly wrapper arround</param>
- <returns>
- An <c>AppenderCollection</c> wrapper that is read-only.
- </returns>
- </member>
- <member name="F:log4net.Appender.AppenderCollection.EmptyCollection">
- <summary>
- An empty readonly static AppenderCollection
- </summary>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor">
- <summary>
- Initializes a new instance of the <c>AppenderCollection</c> class
- that is empty and has the default initial capacity.
- </summary>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor(System.Int32)">
- <summary>
- Initializes a new instance of the <c>AppenderCollection</c> class
- that has the specified initial capacity.
- </summary>
- <param name="capacity">
- The number of elements that the new <c>AppenderCollection</c> is initially capable of storing.
- </param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor(log4net.Appender.AppenderCollection)">
- <summary>
- Initializes a new instance of the <c>AppenderCollection</c> class
- that contains elements copied from the specified <c>AppenderCollection</c>.
- </summary>
- <param name="c">The <c>AppenderCollection</c> whose elements are copied to the new collection.</param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor(log4net.Appender.IAppender[])">
- <summary>
- Initializes a new instance of the <c>AppenderCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Appender.IAppender"/> array.
- </summary>
- <param name="a">The <see cref="T:log4net.Appender.IAppender"/> array whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor(System.Collections.ICollection)">
- <summary>
- Initializes a new instance of the <c>AppenderCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Appender.IAppender"/> collection.
- </summary>
- <param name="col">The <see cref="T:log4net.Appender.IAppender"/> collection whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor(log4net.Appender.AppenderCollection.Tag)">
- <summary>
- Allow subclasses to avoid our default constructors
- </summary>
- <param name="tag"></param>
- <exclude/>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.CopyTo(log4net.Appender.IAppender[])">
- <summary>
- Copies the entire <c>AppenderCollection</c> to a one-dimensional
- <see cref="T:log4net.Appender.IAppender"/> array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Appender.IAppender"/> array to copy to.</param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.CopyTo(log4net.Appender.IAppender[],System.Int32)">
- <summary>
- Copies the entire <c>AppenderCollection</c> to a one-dimensional
- <see cref="T:log4net.Appender.IAppender"/> array, starting at the specified index of the target array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Appender.IAppender"/> array to copy to.</param>
- <param name="start">The zero-based index in <paramref name="array"/> at which copying begins.</param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Add(log4net.Appender.IAppender)">
- <summary>
- Adds a <see cref="T:log4net.Appender.IAppender"/> to the end of the <c>AppenderCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Appender.IAppender"/> to be added to the end of the <c>AppenderCollection</c>.</param>
- <returns>The index at which the value has been added.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Clear">
- <summary>
- Removes all elements from the <c>AppenderCollection</c>.
- </summary>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Clone">
- <summary>
- Creates a shallow copy of the <see cref="T:log4net.Appender.AppenderCollection"/>.
- </summary>
- <returns>A new <see cref="T:log4net.Appender.AppenderCollection"/> with a shallow copy of the collection data.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Contains(log4net.Appender.IAppender)">
- <summary>
- Determines whether a given <see cref="T:log4net.Appender.IAppender"/> is in the <c>AppenderCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Appender.IAppender"/> to check for.</param>
- <returns><c>true</c> if <paramref name="item"/> is found in the <c>AppenderCollection</c>; otherwise, <c>false</c>.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.IndexOf(log4net.Appender.IAppender)">
- <summary>
- Returns the zero-based index of the first occurrence of a <see cref="T:log4net.Appender.IAppender"/>
- in the <c>AppenderCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Appender.IAppender"/> to locate in the <c>AppenderCollection</c>.</param>
- <returns>
- The zero-based index of the first occurrence of <paramref name="item"/>
- in the entire <c>AppenderCollection</c>, if found; otherwise, -1.
- </returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Insert(System.Int32,log4net.Appender.IAppender)">
- <summary>
- Inserts an element into the <c>AppenderCollection</c> at the specified index.
- </summary>
- <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
- <param name="item">The <see cref="T:log4net.Appender.IAppender"/> to insert.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Appender.AppenderCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Remove(log4net.Appender.IAppender)">
- <summary>
- Removes the first occurrence of a specific <see cref="T:log4net.Appender.IAppender"/> from the <c>AppenderCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Appender.IAppender"/> to remove from the <c>AppenderCollection</c>.</param>
- <exception cref="T:System.ArgumentException">
- The specified <see cref="T:log4net.Appender.IAppender"/> was not found in the <c>AppenderCollection</c>.
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.RemoveAt(System.Int32)">
- <summary>
- Removes the element at the specified index of the <c>AppenderCollection</c>.
- </summary>
- <param name="index">The zero-based index of the element to remove.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Appender.AppenderCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through the <c>AppenderCollection</c>.
- </summary>
- <returns>An <see cref="T:log4net.Appender.AppenderCollection.Enumerator"/> for the entire <c>AppenderCollection</c>.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.AddRange(log4net.Appender.AppenderCollection)">
- <summary>
- Adds the elements of another <c>AppenderCollection</c> to the current <c>AppenderCollection</c>.
- </summary>
- <param name="x">The <c>AppenderCollection</c> whose elements should be added to the end of the current <c>AppenderCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Appender.AppenderCollection.Count"/> of the <c>AppenderCollection</c>.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.AddRange(log4net.Appender.IAppender[])">
- <summary>
- Adds the elements of a <see cref="T:log4net.Appender.IAppender"/> array to the current <c>AppenderCollection</c>.
- </summary>
- <param name="x">The <see cref="T:log4net.Appender.IAppender"/> array whose elements should be added to the end of the <c>AppenderCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Appender.AppenderCollection.Count"/> of the <c>AppenderCollection</c>.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.AddRange(System.Collections.ICollection)">
- <summary>
- Adds the elements of a <see cref="T:log4net.Appender.IAppender"/> collection to the current <c>AppenderCollection</c>.
- </summary>
- <param name="col">The <see cref="T:log4net.Appender.IAppender"/> collection whose elements should be added to the end of the <c>AppenderCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Appender.AppenderCollection.Count"/> of the <c>AppenderCollection</c>.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.TrimToSize">
- <summary>
- Sets the capacity to the actual number of elements.
- </summary>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.ToArray">
- <summary>
- Return the collection elements as an array
- </summary>
- <returns>the array</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.ValidateIndex(System.Int32)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Appender.AppenderCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.ValidateIndex(System.Int32,System.Boolean)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Appender.AppenderCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.Count">
- <summary>
- Gets the number of elements actually contained in the <c>AppenderCollection</c>.
- </summary>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.IsSynchronized">
- <summary>
- Gets a value indicating whether access to the collection is synchronized (thread-safe).
- </summary>
- <returns>true if access to the ICollection is synchronized (thread-safe); otherwise, false.</returns>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.SyncRoot">
- <summary>
- Gets an object that can be used to synchronize access to the collection.
- </summary>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.Item(System.Int32)">
- <summary>
- Gets or sets the <see cref="T:log4net.Appender.IAppender"/> at the specified index.
- </summary>
- <param name="index">The zero-based index of the element to get or set.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Appender.AppenderCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.IsFixedSize">
- <summary>
- Gets a value indicating whether the collection has a fixed size.
- </summary>
- <value>true if the collection has a fixed size; otherwise, false. The default is false</value>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.IsReadOnly">
- <summary>
- Gets a value indicating whether the IList is read-only.
- </summary>
- <value>true if the collection is read-only; otherwise, false. The default is false</value>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.Capacity">
- <summary>
- Gets or sets the number of elements the <c>AppenderCollection</c> can contain.
- </summary>
- </member>
- <member name="T:log4net.Appender.AppenderCollection.IAppenderCollectionEnumerator">
- <summary>
- Supports type-safe iteration over a <see cref="T:log4net.Appender.AppenderCollection"/>.
- </summary>
- <exclude/>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.IAppenderCollectionEnumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.IAppenderCollectionEnumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.IAppenderCollectionEnumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- </member>
- <member name="T:log4net.Appender.AppenderCollection.Tag">
- <summary>
- Type visible only to our subclasses
- Used to access protected constructor
- </summary>
- <exclude/>
- </member>
- <member name="F:log4net.Appender.AppenderCollection.Tag.Default">
- <summary>
- A value
- </summary>
- </member>
- <member name="T:log4net.Appender.AppenderCollection.Enumerator">
- <summary>
- Supports simple iteration over a <see cref="T:log4net.Appender.AppenderCollection"/>.
- </summary>
- <exclude/>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Enumerator.#ctor(log4net.Appender.AppenderCollection)">
- <summary>
- Initializes a new instance of the <c>Enumerator</c> class.
- </summary>
- <param name="tc"></param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Enumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Enumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.Enumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- </member>
- <member name="T:log4net.Appender.AppenderCollection.ReadOnlyAppenderCollection">
- <exclude/>
- </member>
- <member name="T:log4net.Appender.AspNetTraceAppender">
- <summary>
- <para>
- Appends log events to the ASP.NET <see cref="T:System.Web.TraceContext"/> system.
- </para>
- </summary>
- <remarks>
- <para>
- Diagnostic information and tracing messages that you specify are appended to the output
- of the page that is sent to the requesting browser. Optionally, you can view this information
- from a separate trace viewer (Trace.axd) that displays trace information for every page in a
- given application.
- </para>
- <para>
- Trace statements are processed and displayed only when tracing is enabled. You can control
- whether tracing is displayed to a page, to the trace viewer, or both.
- </para>
- <para>
- The logging event is passed to the <see cref="M:System.Web.TraceContext.Write(System.String)"/> or
- <see cref="M:System.Web.TraceContext.Warn(System.String)"/> method depending on the level of the logging event.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.AspNetTraceAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.AspNetTraceAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AspNetTraceAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Write the logging event to the ASP.NET trace
- </summary>
- <param name="loggingEvent">the event to log</param>
- <remarks>
- <para>
- Write the logging event to the ASP.NET trace
- <c>HttpContext.Current.Trace</c>
- (<see cref="T:System.Web.TraceContext"/>).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AspNetTraceAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.BufferingForwardingAppender">
- <summary>
- Buffers events and then forwards them to attached appenders.
- </summary>
- <remarks>
- <para>
- The events are buffered in this appender until conditions are
- met to allow the appender to deliver the events to the attached
- appenders. See <see cref="T:log4net.Appender.BufferingAppenderSkeleton"/> for the
- conditions that cause the buffer to be sent.
- </para>
- <para>The forwarding appender can be used to specify different
- thresholds and filters for the same appender at different locations
- within the hierarchy.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Core.IAppenderAttachable">
- <summary>
- Interface for attaching appenders to objects.
- </summary>
- <remarks>
- <para>
- Interface for attaching, removing and retrieving appenders.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.IAppenderAttachable.AddAppender(log4net.Appender.IAppender)">
- <summary>
- Attaches an appender.
- </summary>
- <param name="appender">The appender to add.</param>
- <remarks>
- <para>
- Add the specified appender. The implementation may
- choose to allow or deny duplicate appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IAppenderAttachable.GetAppender(System.String)">
- <summary>
- Gets an attached appender with the specified name.
- </summary>
- <param name="name">The name of the appender to get.</param>
- <returns>
- The appender with the name specified, or <c>null</c> if no appender with the
- specified name is found.
- </returns>
- <remarks>
- <para>
- Returns an attached appender with the <paramref name="name"/> specified.
- If no appender with the specified name is found <c>null</c> will be
- returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IAppenderAttachable.RemoveAllAppenders">
- <summary>
- Removes all attached appenders.
- </summary>
- <remarks>
- <para>
- Removes and closes all attached appenders
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IAppenderAttachable.RemoveAppender(log4net.Appender.IAppender)">
- <summary>
- Removes the specified appender from the list of attached appenders.
- </summary>
- <param name="appender">The appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IAppenderAttachable.RemoveAppender(System.String)">
- <summary>
- Removes the appender with the specified name from the list of appenders.
- </summary>
- <param name="name">The name of the appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.IAppenderAttachable.Appenders">
- <summary>
- Gets all attached appenders.
- </summary>
- <value>
- A collection of attached appenders.
- </value>
- <remarks>
- <para>
- Gets a collection of attached appenders.
- If there are no attached appenders the
- implementation should return an empty
- collection rather than <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.BufferingForwardingAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.OnClose">
- <summary>
- Closes the appender and releases resources.
- </summary>
- <remarks>
- <para>
- Releases any resources allocated within the appender such as file handles,
- network connections, etc.
- </para>
- <para>
- It is a programming error to append to a closed appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Send the events.
- </summary>
- <param name="events">The events that need to be send.</param>
- <remarks>
- <para>
- Forwards the events to the attached appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.AddAppender(log4net.Appender.IAppender)">
- <summary>
- Adds an <see cref="T:log4net.Appender.IAppender"/> to the list of appenders of this
- instance.
- </summary>
- <param name="newAppender">The <see cref="T:log4net.Appender.IAppender"/> to add to this appender.</param>
- <remarks>
- <para>
- If the specified <see cref="T:log4net.Appender.IAppender"/> is already in the list of
- appenders, then it won't be added again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.GetAppender(System.String)">
- <summary>
- Looks for the appender with the specified name.
- </summary>
- <param name="name">The name of the appender to lookup.</param>
- <returns>
- The appender with the specified name, or <c>null</c>.
- </returns>
- <remarks>
- <para>
- Get the named appender attached to this buffering appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.RemoveAllAppenders">
- <summary>
- Removes all previously added appenders from this appender.
- </summary>
- <remarks>
- <para>
- This is useful when re-reading configuration information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.RemoveAppender(log4net.Appender.IAppender)">
- <summary>
- Removes the specified appender from the list of appenders.
- </summary>
- <param name="appender">The appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.RemoveAppender(System.String)">
- <summary>
- Removes the appender with the specified name from the list of appenders.
- </summary>
- <param name="name">The name of the appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingForwardingAppender.m_appenderAttachedImpl">
- <summary>
- Implementation of the <see cref="T:log4net.Core.IAppenderAttachable"/> interface
- </summary>
- </member>
- <member name="P:log4net.Appender.BufferingForwardingAppender.Appenders">
- <summary>
- Gets the appenders contained in this appender as an
- <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <remarks>
- If no appenders can be found, then an <see cref="T:log4net.Util.EmptyCollection"/>
- is returned.
- </remarks>
- <returns>
- A collection of the appenders in this appender.
- </returns>
- </member>
- <member name="T:log4net.Appender.ColoredConsoleAppender">
- <summary>
- Appends logging events to the console.
- </summary>
- <remarks>
- <para>
- ColoredConsoleAppender appends log events to the standard output stream
- or the error output stream using a layout specified by the
- user. It also allows the color of a specific type of message to be set.
- </para>
- <para>
- By default, all output is written to the console's standard output stream.
- The <see cref="P:log4net.Appender.ColoredConsoleAppender.Target"/> property can be set to direct the output to the
- error stream.
- </para>
- <para>
- NOTE: This appender writes directly to the application's attached console
- not to the <c>System.Console.Out</c> or <c>System.Console.Error</c> <c>TextWriter</c>.
- The <c>System.Console.Out</c> and <c>System.Console.Error</c> streams can be
- programmatically redirected (for example NUnit does this to capture program output).
- This appender will ignore these redirections because it needs to use Win32
- API calls to colorize the output. To respect these redirections the <see cref="T:log4net.Appender.ConsoleAppender"/>
- must be used.
- </para>
- <para>
- When configuring the colored console appender, mapping should be
- specified to map a logging level to a color. For example:
- </para>
- <code lang="XML" escaped="true">
- <mapping>
- <level value="ERROR"/>
- <foreColor value="White"/>
- <backColor value="Red, HighIntensity"/>
- </mapping>
- <mapping>
- <level value="DEBUG"/>
- <backColor value="Green"/>
- </mapping>
- </code>
- <para>
- The Level is the standard log4net logging level and ForeColor and BackColor can be any
- combination of the following values:
- <list type="bullet">
- <item><term>Blue</term><description></description></item>
- <item><term>Green</term><description></description></item>
- <item><term>Red</term><description></description></item>
- <item><term>White</term><description></description></item>
- <item><term>Yellow</term><description></description></item>
- <item><term>Purple</term><description></description></item>
- <item><term>Cyan</term><description></description></item>
- <item><term>HighIntensity</term><description></description></item>
- </list>
- </para>
- </remarks>
- <author>Rick Hobbs</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.ConsoleOut">
- <summary>
- The <see cref="P:log4net.Appender.ColoredConsoleAppender.Target"/> to use when writing to the Console
- standard output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.ColoredConsoleAppender.Target"/> to use when writing to the Console
- standard output stream.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.ConsoleError">
- <summary>
- The <see cref="P:log4net.Appender.ColoredConsoleAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.ColoredConsoleAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ColoredConsoleAppender"/> class.
- </summary>
- <remarks>
- The instance of the <see cref="T:log4net.Appender.ColoredConsoleAppender"/> class is set up to write
- to the standard output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.#ctor(log4net.Layout.ILayout)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ColoredConsoleAppender"/> class
- with the specified layout.
- </summary>
- <param name="layout">the layout to use for this appender</param>
- <remarks>
- The instance of the <see cref="T:log4net.Appender.ColoredConsoleAppender"/> class is set up to write
- to the standard output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.#ctor(log4net.Layout.ILayout,System.Boolean)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ColoredConsoleAppender"/> class
- with the specified layout.
- </summary>
- <param name="layout">the layout to use for this appender</param>
- <param name="writeToErrorStream">flag set to <c>true</c> to write to the console error stream</param>
- <remarks>
- When <paramref name="writeToErrorStream"/> is set to <c>true</c>, output is written to
- the standard error output stream. Otherwise, output is written to the standard
- output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.AddMapping(log4net.Appender.ColoredConsoleAppender.LevelColors)">
- <summary>
- Add a mapping of level to color - done by the config file
- </summary>
- <param name="mapping">The mapping to add</param>
- <remarks>
- <para>
- Add a <see cref="T:log4net.Appender.ColoredConsoleAppender.LevelColors"/> mapping to this appender.
- Each mapping defines the foreground and background colors
- for a level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the event to the console.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.ActivateOptions">
- <summary>
- Initialize the options for this appender
- </summary>
- <remarks>
- <para>
- Initialize the level to color mappings set on this appender.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.m_writeToErrorStream">
- <summary>
- Flag to write output to the error stream rather than the standard output stream
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.m_levelMapping">
- <summary>
- Mapping from level object to color value
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.m_consoleOutputWriter">
- <summary>
- The console output stream writer to write to
- </summary>
- <remarks>
- <para>
- This writer is not thread safe.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ColoredConsoleAppender.Target">
- <summary>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </summary>
- <value>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </value>
- <remarks>
- <para>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ColoredConsoleAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.ColoredConsoleAppender.Colors">
- <summary>
- The enum of possible color values for use with the color mapping method
- </summary>
- <remarks>
- <para>
- The following flags can be combined together to
- form the colors.
- </para>
- </remarks>
- <seealso cref="T:log4net.Appender.ColoredConsoleAppender"/>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Blue">
- <summary>
- color is blue
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Green">
- <summary>
- color is green
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Red">
- <summary>
- color is red
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.White">
- <summary>
- color is white
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Yellow">
- <summary>
- color is yellow
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Purple">
- <summary>
- color is purple
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Cyan">
- <summary>
- color is cyan
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.HighIntensity">
- <summary>
- color is intensified
- </summary>
- </member>
- <member name="T:log4net.Appender.ColoredConsoleAppender.LevelColors">
- <summary>
- A class to act as a mapping between the level that a logging call is made at and
- the color it should be displayed as.
- </summary>
- <remarks>
- <para>
- Defines the mapping between a level and the color it should be displayed in.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.LevelColors.ActivateOptions">
- <summary>
- Initialize the options for the object
- </summary>
- <remarks>
- <para>
- Combine the <see cref="P:log4net.Appender.ColoredConsoleAppender.LevelColors.ForeColor"/> and <see cref="P:log4net.Appender.ColoredConsoleAppender.LevelColors.BackColor"/> together.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ColoredConsoleAppender.LevelColors.ForeColor">
- <summary>
- The mapped foreground color for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped foreground color for the specified level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ColoredConsoleAppender.LevelColors.BackColor">
- <summary>
- The mapped background color for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped background color for the specified level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ColoredConsoleAppender.LevelColors.CombinedColor">
- <summary>
- The combined <see cref="P:log4net.Appender.ColoredConsoleAppender.LevelColors.ForeColor"/> and <see cref="P:log4net.Appender.ColoredConsoleAppender.LevelColors.BackColor"/> suitable for
- setting the console color.
- </summary>
- </member>
- <member name="T:log4net.Appender.ConsoleAppender">
- <summary>
- Appends logging events to the console.
- </summary>
- <remarks>
- <para>
- ConsoleAppender appends log events to the standard output stream
- or the error output stream using a layout specified by the
- user.
- </para>
- <para>
- By default, all output is written to the console's standard output stream.
- The <see cref="P:log4net.Appender.ConsoleAppender.Target"/> property can be set to direct the output to the
- error stream.
- </para>
- <para>
- NOTE: This appender writes each message to the <c>System.Console.Out</c> or
- <c>System.Console.Error</c> that is set at the time the event is appended.
- Therefore it is possible to programmatically redirect the output of this appender
- (for example NUnit does this to capture program output). While this is the desired
- behavior of this appender it may have security implications in your application.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Appender.ConsoleAppender.ConsoleOut">
- <summary>
- The <see cref="P:log4net.Appender.ConsoleAppender.Target"/> to use when writing to the Console
- standard output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.ConsoleAppender.Target"/> to use when writing to the Console
- standard output stream.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.ConsoleAppender.ConsoleError">
- <summary>
- The <see cref="P:log4net.Appender.ConsoleAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.ConsoleAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ConsoleAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ConsoleAppender"/> class.
- </summary>
- <remarks>
- The instance of the <see cref="T:log4net.Appender.ConsoleAppender"/> class is set up to write
- to the standard output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ConsoleAppender.#ctor(log4net.Layout.ILayout)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ConsoleAppender"/> class
- with the specified layout.
- </summary>
- <param name="layout">the layout to use for this appender</param>
- <remarks>
- The instance of the <see cref="T:log4net.Appender.ConsoleAppender"/> class is set up to write
- to the standard output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ConsoleAppender.#ctor(log4net.Layout.ILayout,System.Boolean)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ConsoleAppender"/> class
- with the specified layout.
- </summary>
- <param name="layout">the layout to use for this appender</param>
- <param name="writeToErrorStream">flag set to <c>true</c> to write to the console error stream</param>
- <remarks>
- When <paramref name="writeToErrorStream"/> is set to <c>true</c>, output is written to
- the standard error output stream. Otherwise, output is written to the standard
- output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ConsoleAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the event to the console.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ConsoleAppender.Target">
- <summary>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </summary>
- <value>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </value>
- <remarks>
- <para>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ConsoleAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.DebugAppender">
- <summary>
- Appends log events to the <see cref="T:System.Diagnostics.Debug"/> system.
- </summary>
- <remarks>
- <para>
- The application configuration file can be used to control what listeners
- are actually used. See the MSDN documentation for the
- <see cref="T:System.Diagnostics.Debug"/> class for details on configuring the
- debug system.
- </para>
- <para>
- Events are written using the <see cref="M:System.Diagnostics.Debug.Write(System.String,System.String)"/>
- method. The event's logger name is passed as the value for the category name to the Write method.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.DebugAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.DebugAppender"/>.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.DebugAppender.#ctor(log4net.Layout.ILayout)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.DebugAppender"/>
- with a specified layout.
- </summary>
- <param name="layout">The layout to use with this appender.</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.DebugAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Writes the logging event to the <see cref="T:System.Diagnostics.Debug"/> system.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the logging event to the <see cref="T:System.Diagnostics.Debug"/> system.
- If <see cref="P:log4net.Appender.DebugAppender.ImmediateFlush"/> is <c>true</c> then the <see cref="M:System.Diagnostics.Debug.Flush"/>
- is called.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.DebugAppender.m_immediateFlush">
- <summary>
- Immediate flush means that the underlying writer or output stream
- will be flushed at the end of each append operation.
- </summary>
- <remarks>
- <para>
- Immediate flush is slower but ensures that each append request is
- actually written. If <see cref="P:log4net.Appender.DebugAppender.ImmediateFlush"/> is set to
- <c>false</c>, then there is a good chance that the last few
- logs events are not actually written to persistent media if and
- when the application crashes.
- </para>
- <para>
- The default value is <c>true</c>.</para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.DebugAppender.ImmediateFlush">
- <summary>
- Gets or sets a value that indicates whether the appender will
- flush at the end of each write.
- </summary>
- <remarks>
- <para>The default behavior is to flush at the end of each
- write. If the option is set to<c>false</c>, then the underlying
- stream can defer writing to physical medium to a later time.
- </para>
- <para>
- Avoiding the flush operation at the end of each append results
- in a performance gain of 10 to 20 percent. However, there is safety
- trade-off involved in skipping flushing. Indeed, when flushing is
- skipped, then it is likely that the last few log events will not
- be recorded on disk when the application exits. This is a high
- price to pay even for a 20% performance gain.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.DebugAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.EventLogAppender">
- <summary>
- Writes events to the system event log.
- </summary>
- <remarks>
- <para>
- The <c>EventID</c> of the event log entry can be
- set using the <c>EventLogEventID</c> property (<see cref="P:log4net.Core.LoggingEvent.Properties"/>)
- on the <see cref="T:log4net.Core.LoggingEvent"/>.
- </para>
- <para>
- There is a limit of 32K characters for an event log message
- </para>
- <para>
- When configuring the EventLogAppender a mapping can be
- specified to map a logging level to an event log entry type. For example:
- </para>
- <code lang="XML">
- &lt;mapping&gt;
- &lt;level value="ERROR" /&gt;
- &lt;eventLogEntryType value="Error" /&gt;
- &lt;/mapping&gt;
- &lt;mapping&gt;
- &lt;level value="DEBUG" /&gt;
- &lt;eventLogEntryType value="Information" /&gt;
- &lt;/mapping&gt;
- </code>
- <para>
- The Level is the standard log4net logging level and eventLogEntryType can be any value
- from the <see cref="T:System.Diagnostics.EventLogEntryType"/> enum, i.e.:
- <list type="bullet">
- <item><term>Error</term><description>an error event</description></item>
- <item><term>Warning</term><description>a warning event</description></item>
- <item><term>Information</term><description>an informational event</description></item>
- </list>
- </para>
- </remarks>
- <author>Aspi Havewala</author>
- <author>Douglas de la Torre</author>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Thomas Voss</author>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.EventLogAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.#ctor(log4net.Layout.ILayout)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.EventLogAppender"/> class
- with the specified <see cref="T:log4net.Layout.ILayout"/>.
- </summary>
- <param name="layout">The <see cref="T:log4net.Layout.ILayout"/> to use with this appender.</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.AddMapping(log4net.Appender.EventLogAppender.Level2EventLogEntryType)">
- <summary>
- Add a mapping of level to <see cref="T:System.Diagnostics.EventLogEntryType"/> - done by the config file
- </summary>
- <param name="mapping">The mapping to add</param>
- <remarks>
- <para>
- Add a <see cref="T:log4net.Appender.EventLogAppender.Level2EventLogEntryType"/> mapping to this appender.
- Each mapping defines the event log entry type for a level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.EventLogAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.EventLogAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.EventLogAppender.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.CreateEventSource(System.String,System.String,System.String)">
- <summary>
- Create an event log source
- </summary>
- <remarks>
- Uses different API calls under NET_2_0
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/>
- method.
- </summary>
- <param name="loggingEvent">the event to log</param>
- <remarks>
- <para>Writes the event to the system event log using the
- <see cref="P:log4net.Appender.EventLogAppender.ApplicationName"/>.</para>
-
- <para>If the event has an <c>EventID</c> property (see <see cref="P:log4net.Core.LoggingEvent.Properties"/>)
- set then this integer will be used as the event log event id.</para>
-
- <para>
- There is a limit of 32K characters for an event log message
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.GetEntryType(log4net.Core.Level)">
- <summary>
- Get the equivalent <see cref="T:System.Diagnostics.EventLogEntryType"/> for a <see cref="T:log4net.Core.Level"/> <paramref name="p"/>
- </summary>
- <param name="level">the Level to convert to an EventLogEntryType</param>
- <returns>The equivalent <see cref="T:System.Diagnostics.EventLogEntryType"/> for a <see cref="T:log4net.Core.Level"/> <paramref name="p"/></returns>
- <remarks>
- Because there are fewer applicable <see cref="T:System.Diagnostics.EventLogEntryType"/>
- values to use in logging levels than there are in the
- <see cref="T:log4net.Core.Level"/> this is a one way mapping. There is
- a loss of information during the conversion.
- </remarks>
- </member>
- <member name="F:log4net.Appender.EventLogAppender.m_logName">
- <summary>
- The log name is the section in the event logs where the messages
- are stored.
- </summary>
- </member>
- <member name="F:log4net.Appender.EventLogAppender.m_applicationName">
- <summary>
- Name of the application to use when logging. This appears in the
- application column of the event log named by <see cref="F:log4net.Appender.EventLogAppender.m_logName"/>.
- </summary>
- </member>
- <member name="F:log4net.Appender.EventLogAppender.m_machineName">
- <summary>
- The name of the machine which holds the event log. This is
- currently only allowed to be '.' i.e. the current machine.
- </summary>
- </member>
- <member name="F:log4net.Appender.EventLogAppender.m_levelMapping">
- <summary>
- Mapping from level object to EventLogEntryType
- </summary>
- </member>
- <member name="F:log4net.Appender.EventLogAppender.m_securityContext">
- <summary>
- The security context to use for privileged calls
- </summary>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.LogName">
- <summary>
- The name of the log where messages will be stored.
- </summary>
- <value>
- The string name of the log where messages will be stored.
- </value>
- <remarks>
- <para>This is the name of the log as it appears in the Event Viewer
- tree. The default value is to log into the <c>Application</c>
- log, this is where most applications write their events. However
- if you need a separate log for your application (or applications)
- then you should set the <see cref="P:log4net.Appender.EventLogAppender.LogName"/> appropriately.</para>
- <para>This should not be used to distinguish your event log messages
- from those of other applications, the <see cref="P:log4net.Appender.EventLogAppender.ApplicationName"/>
- property should be used to distinguish events. This property should be
- used to group together events into a single log.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.ApplicationName">
- <summary>
- Property used to set the Application name. This appears in the
- event logs when logging.
- </summary>
- <value>
- The string used to distinguish events from different sources.
- </value>
- <remarks>
- Sets the event log source property.
- </remarks>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.MachineName">
- <summary>
- This property is used to return the name of the computer to use
- when accessing the event logs. Currently, this is the current
- computer, denoted by a dot "."
- </summary>
- <value>
- The string name of the machine holding the event log that
- will be logged into.
- </value>
- <remarks>
- This property cannot be changed. It is currently set to '.'
- i.e. the local machine. This may be changed in future.
- </remarks>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.SecurityContext">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.EventLogAppender.SecurityContext"/> used to write to the EventLog.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.EventLogAppender.SecurityContext"/> used to write to the EventLog.
- </value>
- <remarks>
- <para>
- The system security context used to write to the EventLog.
- </para>
- <para>
- Unless a <see cref="P:log4net.Appender.EventLogAppender.SecurityContext"/> specified here for this appender
- the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is queried for the
- security context to use. The default behavior is to use the security context
- of the current thread.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.EventLogAppender.Level2EventLogEntryType">
- <summary>
- A class to act as a mapping between the level that a logging call is made at and
- the color it should be displayed as.
- </summary>
- <remarks>
- <para>
- Defines the mapping between a level and its event log entry type.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.Level2EventLogEntryType.EventLogEntryType">
- <summary>
- The <see cref="P:log4net.Appender.EventLogAppender.Level2EventLogEntryType.EventLogEntryType"/> for this entry
- </summary>
- <remarks>
- <para>
- Required property.
- The <see cref="P:log4net.Appender.EventLogAppender.Level2EventLogEntryType.EventLogEntryType"/> for this entry
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.FileAppender">
- <summary>
- Appends logging events to a file.
- </summary>
- <remarks>
- <para>
- Logging events are sent to the file specified by
- the <see cref="P:log4net.Appender.FileAppender.File"/> property.
- </para>
- <para>
- The file can be opened in either append or overwrite mode
- by specifying the <see cref="P:log4net.Appender.FileAppender.AppendToFile"/> property.
- If the file path is relative it is taken as relative from
- the application base directory. The file encoding can be
- specified by setting the <see cref="P:log4net.Appender.FileAppender.Encoding"/> property.
- </para>
- <para>
- The layout's <see cref="P:log4net.Layout.ILayout.Header"/> and <see cref="P:log4net.Layout.ILayout.Footer"/>
- values will be written each time the file is opened and closed
- respectively. If the <see cref="P:log4net.Appender.FileAppender.AppendToFile"/> property is <see langword="true"/>
- then the file may contain multiple copies of the header and footer.
- </para>
- <para>
- This appender will first try to open the file for writing when <see cref="M:log4net.Appender.FileAppender.ActivateOptions"/>
- is called. This will typically be during configuration.
- If the file cannot be opened for writing the appender will attempt
- to open the file again each time a message is logged to the appender.
- If the file cannot be opened for writing when a message is logged then
- the message will be discarded by this appender.
- </para>
- <para>
- The <see cref="T:log4net.Appender.FileAppender"/> supports pluggable file locking models via
- the <see cref="P:log4net.Appender.FileAppender.LockingModel"/> property.
- The default behavior, implemented by <see cref="T:log4net.Appender.FileAppender.ExclusiveLock"/>
- is to obtain an exclusive write lock on the file until this appender is closed.
- The alternative model, <see cref="T:log4net.Appender.FileAppender.MinimalLock"/>, only holds a
- write lock while the appender is writing a logging event.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Rodrigo B. de Oliveira</author>
- <author>Douglas de la Torre</author>
- <author>Niall Daley</author>
- </member>
- <member name="T:log4net.Appender.TextWriterAppender">
- <summary>
- Sends logging events to a <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <remarks>
- <para>
- An Appender that writes to a <see cref="T:System.IO.TextWriter"/>.
- </para>
- <para>
- This appender may be used stand alone if initialized with an appropriate
- writer, however it is typically used as a base class for an appender that
- can open a <see cref="T:System.IO.TextWriter"/> to write to.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Douglas de la Torre</author>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.TextWriterAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.#ctor(log4net.Layout.ILayout,System.IO.Stream)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.TextWriterAppender"/> class and
- sets the output destination to a new <see cref="T:System.IO.StreamWriter"/> initialized
- with the specified <see cref="T:System.IO.Stream"/>.
- </summary>
- <param name="layout">The layout to use with this appender.</param>
- <param name="os">The <see cref="T:System.IO.Stream"/> to output to.</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.#ctor(log4net.Layout.ILayout,System.IO.TextWriter)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.TextWriterAppender"/> class and sets
- the output destination to the specified <see cref="T:System.IO.StreamWriter"/>.
- </summary>
- <param name="layout">The layout to use with this appender</param>
- <param name="writer">The <see cref="T:System.IO.TextWriter"/> to output to</param>
- <remarks>
- The <see cref="T:System.IO.TextWriter"/> must have been previously opened.
- </remarks>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.PreAppendCheck">
- <summary>
- This method determines if there is a sense in attempting to append.
- </summary>
- <remarks>
- <para>
- This method checked if an output target has been set and if a
- layout has been set.
- </para>
- </remarks>
- <returns><c>false</c> if any of the preconditions fail.</returns>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/>
- method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes a log statement to the output stream if the output stream exists
- and is writable.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.Append(log4net.Core.LoggingEvent[])">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent[])"/>
- method.
- </summary>
- <param name="loggingEvents">The array of events to log.</param>
- <remarks>
- <para>
- This method writes all the bulk logged events to the output writer
- before flushing the stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.OnClose">
- <summary>
- Close this appender instance. The underlying stream or writer is also closed.
- </summary>
- <remarks>
- Closed appenders cannot be reused.
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.WriteFooterAndCloseWriter">
- <summary>
- Writes the footer and closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <remarks>
- <para>
- Writes the footer and closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.CloseWriter">
- <summary>
- Closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <remarks>
- <para>
- Closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.Reset">
- <summary>
- Clears internal references to the underlying <see cref="T:System.IO.TextWriter"/>
- and other variables.
- </summary>
- <remarks>
- <para>
- Subclasses can override this method for an alternate closing behavior.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.WriteFooter">
- <summary>
- Writes a footer as produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Footer"/> property.
- </summary>
- <remarks>
- <para>
- Writes a footer as produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Footer"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.WriteHeader">
- <summary>
- Writes a header produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Header"/> property.
- </summary>
- <remarks>
- <para>
- Writes a header produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Header"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.PrepareWriter">
- <summary>
- Called to allow a subclass to lazily initialize the writer
- </summary>
- <remarks>
- <para>
- This method is called when an event is logged and the <see cref="P:log4net.Appender.TextWriterAppender.Writer"/> or
- <see cref="P:log4net.Appender.TextWriterAppender.QuietWriter"/> have not been set. This allows a subclass to
- attempt to initialize the writer multiple times.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.TextWriterAppender.m_qtw">
- <summary>
- This is the <see cref="T:log4net.Util.QuietTextWriter"/> where logging events
- will be written to.
- </summary>
- </member>
- <member name="F:log4net.Appender.TextWriterAppender.m_immediateFlush">
- <summary>
- Immediate flush means that the underlying <see cref="T:System.IO.TextWriter"/>
- or output stream will be flushed at the end of each append operation.
- </summary>
- <remarks>
- <para>
- Immediate flush is slower but ensures that each append request is
- actually written. If <see cref="P:log4net.Appender.TextWriterAppender.ImmediateFlush"/> is set to
- <c>false</c>, then there is a good chance that the last few
- logging events are not actually persisted if and when the application
- crashes.
- </para>
- <para>
- The default value is <c>true</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TextWriterAppender.ImmediateFlush">
- <summary>
- Gets or set whether the appender will flush at the end
- of each append operation.
- </summary>
- <value>
- <para>
- The default behavior is to flush at the end of each
- append operation.
- </para>
- <para>
- If this option is set to <c>false</c>, then the underlying
- stream can defer persisting the logging event to a later
- time.
- </para>
- </value>
- <remarks>
- Avoiding the flush operation at the end of each append results in
- a performance gain of 10 to 20 percent. However, there is safety
- trade-off involved in skipping flushing. Indeed, when flushing is
- skipped, then it is likely that the last few log events will not
- be recorded on disk when the application exits. This is a high
- price to pay even for a 20% performance gain.
- </remarks>
- </member>
- <member name="P:log4net.Appender.TextWriterAppender.Writer">
- <summary>
- Sets the <see cref="T:System.IO.TextWriter"/> where the log output will go.
- </summary>
- <remarks>
- <para>
- The specified <see cref="T:System.IO.TextWriter"/> must be open and writable.
- </para>
- <para>
- The <see cref="T:System.IO.TextWriter"/> will be closed when the appender
- instance is closed.
- </para>
- <para>
- <b>Note:</b> Logging to an unopened <see cref="T:System.IO.TextWriter"/> will fail.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TextWriterAppender.ErrorHandler">
- <summary>
- Gets or set the <see cref="T:log4net.Core.IErrorHandler"/> and the underlying
- <see cref="T:log4net.Util.QuietTextWriter"/>, if any, for this appender.
- </summary>
- <value>
- The <see cref="T:log4net.Core.IErrorHandler"/> for this appender.
- </value>
- </member>
- <member name="P:log4net.Appender.TextWriterAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TextWriterAppender.QuietWriter">
- <summary>
- Gets or sets the <see cref="T:log4net.Util.QuietTextWriter"/> where logging events
- will be written to.
- </summary>
- <value>
- The <see cref="T:log4net.Util.QuietTextWriter"/> where logging events are written.
- </value>
- <remarks>
- <para>
- This is the <see cref="T:log4net.Util.QuietTextWriter"/> where logging events
- will be written to.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.#ctor(log4net.Layout.ILayout,System.String,System.Boolean)">
- <summary>
- Construct a new appender using the layout, file and append mode.
- </summary>
- <param name="layout">the layout to use with this appender</param>
- <param name="filename">the full path to the file to write to</param>
- <param name="append">flag to indicate if the file should be appended to</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.#ctor(log4net.Layout.ILayout,System.String)">
- <summary>
- Construct a new appender using the layout and file specified.
- The file will be appended to.
- </summary>
- <param name="layout">the layout to use with this appender</param>
- <param name="filename">the full path to the file to write to</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ActivateOptions">
- <summary>
- Activate the options on the file appender.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.FileAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.FileAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.FileAppender.ActivateOptions"/> must be called again.
- </para>
- <para>
- This will cause the file to be opened.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.Reset">
- <summary>
- Closes any previously opened file and calls the parent's <see cref="M:log4net.Appender.TextWriterAppender.Reset"/>.
- </summary>
- <remarks>
- <para>
- Resets the filename and the file stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.PrepareWriter">
- <summary>
- Called to initialize the file writer
- </summary>
- <remarks>
- <para>
- Will be called for each logged message until the file is
- successfully opened.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/>
- method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes a log statement to the output stream if the output stream exists
- and is writable.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.Append(log4net.Core.LoggingEvent[])">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent[])"/>
- method.
- </summary>
- <param name="loggingEvents">The array of events to log.</param>
- <remarks>
- <para>
- Acquires the output file locks once before writing all the events to
- the stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.WriteFooter">
- <summary>
- Writes a footer as produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Footer"/> property.
- </summary>
- <remarks>
- <para>
- Writes a footer as produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Footer"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.WriteHeader">
- <summary>
- Writes a header produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Header"/> property.
- </summary>
- <remarks>
- <para>
- Writes a header produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Header"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.CloseWriter">
- <summary>
- Closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <remarks>
- <para>
- Closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.CloseFile">
- <summary>
- Closes the previously opened file.
- </summary>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Layout.ILayout.Footer"/> to the file and then
- closes the file.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.SafeOpenFile(System.String,System.Boolean)">
- <summary>
- Sets and <i>opens</i> the file where the log output will go. The specified file must be writable.
- </summary>
- <param name="fileName">The path to the log file. Must be a fully qualified path.</param>
- <param name="append">If true will append to fileName. Otherwise will truncate fileName</param>
- <remarks>
- <para>
- Calls <see cref="M:log4net.Appender.FileAppender.OpenFile(System.String,System.Boolean)"/> but guarantees not to throw an exception.
- Errors are passed to the <see cref="P:log4net.Appender.TextWriterAppender.ErrorHandler"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.OpenFile(System.String,System.Boolean)">
- <summary>
- Sets and <i>opens</i> the file where the log output will go. The specified file must be writable.
- </summary>
- <param name="fileName">The path to the log file. Must be a fully qualified path.</param>
- <param name="append">If true will append to fileName. Otherwise will truncate fileName</param>
- <remarks>
- <para>
- If there was already an opened file, then the previous file
- is closed first.
- </para>
- <para>
- This method will ensure that the directory structure
- for the <paramref name="fileName"/> specified exists.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.SetQWForFiles(System.IO.Stream)">
- <summary>
- Sets the quiet writer used for file output
- </summary>
- <param name="fileStream">the file stream that has been opened for writing</param>
- <remarks>
- <para>
- This implementation of <see cref="M:log4net.Appender.FileAppender.SetQWForFiles(System.IO.Stream)"/> creates a <see cref="T:System.IO.StreamWriter"/>
- over the <paramref name="fileStream"/> and passes it to the
- <see cref="M:log4net.Appender.FileAppender.SetQWForFiles(System.IO.TextWriter)"/> method.
- </para>
- <para>
- This method can be overridden by sub classes that want to wrap the
- <see cref="T:System.IO.Stream"/> in some way, for example to encrypt the output
- data using a <c>System.Security.Cryptography.CryptoStream</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.SetQWForFiles(System.IO.TextWriter)">
- <summary>
- Sets the quiet writer being used.
- </summary>
- <param name="writer">the writer over the file stream that has been opened for writing</param>
- <remarks>
- <para>
- This method can be overridden by sub classes that want to
- wrap the <see cref="T:System.IO.TextWriter"/> in some way.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ConvertToFullPath(System.String)">
- <summary>
- Convert a path into a fully qualified path.
- </summary>
- <param name="path">The path to convert.</param>
- <returns>The fully qualified path.</returns>
- <remarks>
- <para>
- Converts the path specified to a fully
- qualified path. If the path is relative it is
- taken as relative from the application base
- directory.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_appendToFile">
- <summary>
- Flag to indicate if we should append to the file
- or overwrite the file. The default is to append.
- </summary>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_fileName">
- <summary>
- The name of the log file.
- </summary>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_encoding">
- <summary>
- The encoding to use for the file stream.
- </summary>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_securityContext">
- <summary>
- The security context to use for privileged calls
- </summary>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_stream">
- <summary>
- The stream to log to. Has added locking semantics
- </summary>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_lockingModel">
- <summary>
- The locking model to use
- </summary>
- </member>
- <member name="P:log4net.Appender.FileAppender.File">
- <summary>
- Gets or sets the path to the file that logging will be written to.
- </summary>
- <value>
- The path to the file that logging will be written to.
- </value>
- <remarks>
- <para>
- If the path is relative it is taken as relative from
- the application base directory.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.FileAppender.AppendToFile">
- <summary>
- Gets or sets a flag that indicates whether the file should be
- appended to or overwritten.
- </summary>
- <value>
- Indicates whether the file should be appended to or overwritten.
- </value>
- <remarks>
- <para>
- If the value is set to false then the file will be overwritten, if
- it is set to true then the file will be appended to.
- </para>
- The default value is true.
- </remarks>
- </member>
- <member name="P:log4net.Appender.FileAppender.Encoding">
- <summary>
- Gets or sets <see cref="P:log4net.Appender.FileAppender.Encoding"/> used to write to the file.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.FileAppender.Encoding"/> used to write to the file.
- </value>
- <remarks>
- <para>
- The default encoding set is <see cref="P:System.Text.Encoding.Default"/>
- which is the encoding for the system's current ANSI code page.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.FileAppender.SecurityContext">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.FileAppender.SecurityContext"/> used to write to the file.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.FileAppender.SecurityContext"/> used to write to the file.
- </value>
- <remarks>
- <para>
- Unless a <see cref="P:log4net.Appender.FileAppender.SecurityContext"/> specified here for this appender
- the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is queried for the
- security context to use. The default behavior is to use the security context
- of the current thread.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.FileAppender.LockingModel">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.FileAppender.LockingModel"/> used to handle locking of the file.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.FileAppender.LockingModel"/> used to lock the file.
- </value>
- <remarks>
- <para>
- Gets or sets the <see cref="P:log4net.Appender.FileAppender.LockingModel"/> used to handle locking of the file.
- </para>
- <para>
- There are two built in locking models, <see cref="T:log4net.Appender.FileAppender.ExclusiveLock"/> and <see cref="T:log4net.Appender.FileAppender.MinimalLock"/>.
- The former locks the file from the start of logging to the end and the
- later lock only for the minimal amount of time when logging each message.
- </para>
- <para>
- The default locking model is the <see cref="T:log4net.Appender.FileAppender.ExclusiveLock"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.FileAppender.LockingStream">
- <summary>
- Write only <see cref="T:System.IO.Stream"/> that uses the <see cref="T:log4net.Appender.FileAppender.LockingModelBase"/>
- to manage access to an underlying resource.
- </summary>
- </member>
- <member name="M:log4net.Appender.FileAppender.LockingStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)">
- <summary>
- True asynchronous writes are not supported, the implementation forces a synchronous write.
- </summary>
- </member>
- <member name="T:log4net.Core.LogException">
- <summary>
- Exception base type for log4net.
- </summary>
- <remarks>
- <para>
- This type extends <see cref="T:System.ApplicationException"/>. It
- does not add any new functionality but does differentiate the
- type of exception being thrown.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.LogException.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LogException"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogException.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="message">A message to include with the exception.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LogException"/> class with
- the specified message.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogException.#ctor(System.String,System.Exception)">
- <summary>
- Constructor
- </summary>
- <param name="message">A message to include with the exception.</param>
- <param name="innerException">A nested exception to include.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LogException"/> class
- with the specified message and inner exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Serialization constructor
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
- <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LogException"/> class
- with serialized data.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.FileAppender.LockingModelBase">
- <summary>
- Locking model base class
- </summary>
- <remarks>
- <para>
- Base class for the locking models available to the <see cref="T:log4net.Appender.FileAppender"/> derived loggers.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.LockingModelBase.OpenFile(System.String,System.Boolean,System.Text.Encoding)">
- <summary>
- Open the output file
- </summary>
- <param name="filename">The filename to use</param>
- <param name="append">Whether to append to the file, or overwrite</param>
- <param name="encoding">The encoding to use</param>
- <remarks>
- <para>
- Open the file specified and prepare for logging.
- No writes will be made until <see cref="M:log4net.Appender.FileAppender.LockingModelBase.AcquireLock"/> is called.
- Must be called before any calls to <see cref="M:log4net.Appender.FileAppender.LockingModelBase.AcquireLock"/>,
- <see cref="M:log4net.Appender.FileAppender.LockingModelBase.ReleaseLock"/> and <see cref="M:log4net.Appender.FileAppender.LockingModelBase.CloseFile"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.LockingModelBase.CloseFile">
- <summary>
- Close the file
- </summary>
- <remarks>
- <para>
- Close the file. No further writes will be made.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.LockingModelBase.AcquireLock">
- <summary>
- Acquire the lock on the file
- </summary>
- <returns>A stream that is ready to be written to.</returns>
- <remarks>
- <para>
- Acquire the lock on the file in preparation for writing to it.
- Return a stream pointing to the file. <see cref="M:log4net.Appender.FileAppender.LockingModelBase.ReleaseLock"/>
- must be called to release the lock on the output file.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.LockingModelBase.ReleaseLock">
- <summary>
- Release the lock on the file
- </summary>
- <remarks>
- <para>
- Release the lock on the file. No further writes will be made to the
- stream until <see cref="M:log4net.Appender.FileAppender.LockingModelBase.AcquireLock"/> is called again.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.FileAppender.LockingModelBase.CurrentAppender">
- <summary>
- Gets or sets the <see cref="T:log4net.Appender.FileAppender"/> for this LockingModel
- </summary>
- <value>
- The <see cref="T:log4net.Appender.FileAppender"/> for this LockingModel
- </value>
- <remarks>
- <para>
- The file appender this locking model is attached to and working on
- behalf of.
- </para>
- <para>
- The file appender is used to locate the security context and the error handler to use.
- </para>
- <para>
- The value of this property will be set before <see cref="M:log4net.Appender.FileAppender.LockingModelBase.OpenFile(System.String,System.Boolean,System.Text.Encoding)"/> is
- called.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.FileAppender.ExclusiveLock">
- <summary>
- Hold an exclusive lock on the output file
- </summary>
- <remarks>
- <para>
- Open the file once for writing and hold it open until <see cref="M:log4net.Appender.FileAppender.ExclusiveLock.CloseFile"/> is called.
- Maintains an exclusive lock on the file during this time.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ExclusiveLock.OpenFile(System.String,System.Boolean,System.Text.Encoding)">
- <summary>
- Open the file specified and prepare for logging.
- </summary>
- <param name="filename">The filename to use</param>
- <param name="append">Whether to append to the file, or overwrite</param>
- <param name="encoding">The encoding to use</param>
- <remarks>
- <para>
- Open the file specified and prepare for logging.
- No writes will be made until <see cref="M:log4net.Appender.FileAppender.ExclusiveLock.AcquireLock"/> is called.
- Must be called before any calls to <see cref="M:log4net.Appender.FileAppender.ExclusiveLock.AcquireLock"/>,
- <see cref="M:log4net.Appender.FileAppender.ExclusiveLock.ReleaseLock"/> and <see cref="M:log4net.Appender.FileAppender.ExclusiveLock.CloseFile"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ExclusiveLock.CloseFile">
- <summary>
- Close the file
- </summary>
- <remarks>
- <para>
- Close the file. No further writes will be made.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ExclusiveLock.AcquireLock">
- <summary>
- Acquire the lock on the file
- </summary>
- <returns>A stream that is ready to be written to.</returns>
- <remarks>
- <para>
- Does nothing. The lock is already taken
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ExclusiveLock.ReleaseLock">
- <summary>
- Release the lock on the file
- </summary>
- <remarks>
- <para>
- Does nothing. The lock will be released when the file is closed.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.FileAppender.MinimalLock">
- <summary>
- Acquires the file lock for each write
- </summary>
- <remarks>
- <para>
- Opens the file once for each <see cref="M:log4net.Appender.FileAppender.MinimalLock.AcquireLock"/>/<see cref="M:log4net.Appender.FileAppender.MinimalLock.ReleaseLock"/> cycle,
- thus holding the lock for the minimal amount of time. This method of locking
- is considerably slower than <see cref="T:log4net.Appender.FileAppender.ExclusiveLock"/> but allows
- other processes to move/delete the log file whilst logging continues.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.MinimalLock.OpenFile(System.String,System.Boolean,System.Text.Encoding)">
- <summary>
- Prepares to open the file when the first message is logged.
- </summary>
- <param name="filename">The filename to use</param>
- <param name="append">Whether to append to the file, or overwrite</param>
- <param name="encoding">The encoding to use</param>
- <remarks>
- <para>
- Open the file specified and prepare for logging.
- No writes will be made until <see cref="M:log4net.Appender.FileAppender.MinimalLock.AcquireLock"/> is called.
- Must be called before any calls to <see cref="M:log4net.Appender.FileAppender.MinimalLock.AcquireLock"/>,
- <see cref="M:log4net.Appender.FileAppender.MinimalLock.ReleaseLock"/> and <see cref="M:log4net.Appender.FileAppender.MinimalLock.CloseFile"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.MinimalLock.CloseFile">
- <summary>
- Close the file
- </summary>
- <remarks>
- <para>
- Close the file. No further writes will be made.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.MinimalLock.AcquireLock">
- <summary>
- Acquire the lock on the file
- </summary>
- <returns>A stream that is ready to be written to.</returns>
- <remarks>
- <para>
- Acquire the lock on the file in preparation for writing to it.
- Return a stream pointing to the file. <see cref="M:log4net.Appender.FileAppender.MinimalLock.ReleaseLock"/>
- must be called to release the lock on the output file.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.MinimalLock.ReleaseLock">
- <summary>
- Release the lock on the file
- </summary>
- <remarks>
- <para>
- Release the lock on the file. No further writes will be made to the
- stream until <see cref="M:log4net.Appender.FileAppender.MinimalLock.AcquireLock"/> is called again.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.ForwardingAppender">
- <summary>
- This appender forwards logging events to attached appenders.
- </summary>
- <remarks>
- <para>
- The forwarding appender can be used to specify different thresholds
- and filters for the same appender at different locations within the hierarchy.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ForwardingAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.OnClose">
- <summary>
- Closes the appender and releases resources.
- </summary>
- <remarks>
- <para>
- Releases any resources allocated within the appender such as file handles,
- network connections, etc.
- </para>
- <para>
- It is a programming error to append to a closed appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Forward the logging event to the attached appenders
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Delivers the logging event to all the attached appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.Append(log4net.Core.LoggingEvent[])">
- <summary>
- Forward the logging events to the attached appenders
- </summary>
- <param name="loggingEvents">The array of events to log.</param>
- <remarks>
- <para>
- Delivers the logging events to all the attached appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.AddAppender(log4net.Appender.IAppender)">
- <summary>
- Adds an <see cref="T:log4net.Appender.IAppender"/> to the list of appenders of this
- instance.
- </summary>
- <param name="newAppender">The <see cref="T:log4net.Appender.IAppender"/> to add to this appender.</param>
- <remarks>
- <para>
- If the specified <see cref="T:log4net.Appender.IAppender"/> is already in the list of
- appenders, then it won't be added again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.GetAppender(System.String)">
- <summary>
- Looks for the appender with the specified name.
- </summary>
- <param name="name">The name of the appender to lookup.</param>
- <returns>
- The appender with the specified name, or <c>null</c>.
- </returns>
- <remarks>
- <para>
- Get the named appender attached to this appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.RemoveAllAppenders">
- <summary>
- Removes all previously added appenders from this appender.
- </summary>
- <remarks>
- <para>
- This is useful when re-reading configuration information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.RemoveAppender(log4net.Appender.IAppender)">
- <summary>
- Removes the specified appender from the list of appenders.
- </summary>
- <param name="appender">The appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.RemoveAppender(System.String)">
- <summary>
- Removes the appender with the specified name from the list of appenders.
- </summary>
- <param name="name">The name of the appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </remarks>
- </member>
- <member name="F:log4net.Appender.ForwardingAppender.m_appenderAttachedImpl">
- <summary>
- Implementation of the <see cref="T:log4net.Core.IAppenderAttachable"/> interface
- </summary>
- </member>
- <member name="P:log4net.Appender.ForwardingAppender.Appenders">
- <summary>
- Gets the appenders contained in this appender as an
- <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <remarks>
- If no appenders can be found, then an <see cref="T:log4net.Util.EmptyCollection"/>
- is returned.
- </remarks>
- <returns>
- A collection of the appenders in this appender.
- </returns>
- </member>
- <member name="T:log4net.Appender.LocalSyslogAppender">
- <summary>
- Logs events to a local syslog service.
- </summary>
- <remarks>
- <note>
- This appender uses the POSIX libc library functions <c>openlog</c>, <c>syslog</c>, and <c>closelog</c>.
- If these functions are not available on the local system then this appender will not work!
- </note>
- <para>
- The functions <c>openlog</c>, <c>syslog</c>, and <c>closelog</c> are specified in SUSv2 and
- POSIX 1003.1-2001 standards. These are used to log messages to the local syslog service.
- </para>
- <para>
- This appender talks to a local syslog service. If you need to log to a remote syslog
- daemon and you cannot configure your local syslog service to do this you may be
- able to use the <see cref="T:log4net.Appender.RemoteSyslogAppender"/> to log via UDP.
- </para>
- <para>
- Syslog messages must have a facility and and a severity. The severity
- is derived from the Level of the logging event.
- The facility must be chosen from the set of defined syslog
- <see cref="T:log4net.Appender.LocalSyslogAppender.SyslogFacility"/> values. The facilities list is predefined
- and cannot be extended.
- </para>
- <para>
- An identifier is specified with each log message. This can be specified
- by setting the <see cref="P:log4net.Appender.LocalSyslogAppender.Identity"/> property. The identity (also know
- as the tag) must not contain white space. The default value for the
- identity is the application name (from <see cref="P:log4net.Util.SystemInfo.ApplicationFriendlyName"/>).
- </para>
- </remarks>
- <author>Rob Lyon</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.LocalSyslogAppender"/> class.
- </summary>
- <remarks>
- This instance of the <see cref="T:log4net.Appender.LocalSyslogAppender"/> class is set up to write
- to a local syslog service.
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.AddMapping(log4net.Appender.LocalSyslogAppender.LevelSeverity)">
- <summary>
- Add a mapping of level to severity
- </summary>
- <param name="mapping">The mapping to add</param>
- <remarks>
- <para>
- Adds a <see cref="T:log4net.Appender.LocalSyslogAppender.LevelSeverity"/> to this appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.LocalSyslogAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.LocalSyslogAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.LocalSyslogAppender.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the event to a remote syslog daemon.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.OnClose">
- <summary>
- Close the syslog when the appender is closed
- </summary>
- <remarks>
- <para>
- Close the syslog when the appender is closed
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.GetSeverity(log4net.Core.Level)">
- <summary>
- Translates a log4net level to a syslog severity.
- </summary>
- <param name="level">A log4net level.</param>
- <returns>A syslog severity.</returns>
- <remarks>
- <para>
- Translates a log4net level to a syslog severity.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.GeneratePriority(log4net.Appender.LocalSyslogAppender.SyslogFacility,log4net.Appender.LocalSyslogAppender.SyslogSeverity)">
- <summary>
- Generate a syslog priority.
- </summary>
- <param name="facility">The syslog facility.</param>
- <param name="severity">The syslog severity.</param>
- <returns>A syslog priority.</returns>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.m_facility">
- <summary>
- The facility. The default facility is <see cref="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.User"/>.
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.m_identity">
- <summary>
- The message identity
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.m_handleToIdentity">
- <summary>
- Marshaled handle to the identity string. We have to hold on to the
- string as the <c>openlog</c> and <c>syslog</c> APIs just hold the
- pointer to the ident and dereference it for each log message.
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.m_levelMapping">
- <summary>
- Mapping from level object to syslog severity
- </summary>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.openlog(System.IntPtr,System.Int32,log4net.Appender.LocalSyslogAppender.SyslogFacility)">
- <summary>
- Open connection to system logger.
- </summary>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.syslog(System.Int32,System.String,System.String)">
- <summary>
- Generate a log message.
- </summary>
- <remarks>
- <para>
- The libc syslog method takes a format string and a variable argument list similar
- to the classic printf function. As this type of vararg list is not supported
- by C# we need to specify the arguments explicitly. Here we have specified the
- format string with a single message argument. The caller must set the format
- string to <c>"%s"</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.closelog">
- <summary>
- Close descriptor used to write to system logger.
- </summary>
- </member>
- <member name="P:log4net.Appender.LocalSyslogAppender.Identity">
- <summary>
- Message identity
- </summary>
- <remarks>
- <para>
- An identifier is specified with each log message. This can be specified
- by setting the <see cref="P:log4net.Appender.LocalSyslogAppender.Identity"/> property. The identity (also know
- as the tag) must not contain white space. The default value for the
- identity is the application name (from <see cref="P:log4net.Util.SystemInfo.ApplicationFriendlyName"/>).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.LocalSyslogAppender.Facility">
- <summary>
- Syslog facility
- </summary>
- <remarks>
- Set to one of the <see cref="T:log4net.Appender.LocalSyslogAppender.SyslogFacility"/> values. The list of
- facilities is predefined and cannot be extended. The default value
- is <see cref="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.User"/>.
- </remarks>
- </member>
- <member name="P:log4net.Appender.LocalSyslogAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.LocalSyslogAppender.SyslogSeverity">
- <summary>
- syslog severities
- </summary>
- <remarks>
- <para>
- The log4net Level maps to a syslog severity using the
- <see cref="M:log4net.Appender.LocalSyslogAppender.AddMapping(log4net.Appender.LocalSyslogAppender.LevelSeverity)"/> method and the <see cref="T:log4net.Appender.LocalSyslogAppender.LevelSeverity"/>
- class. The severity is set on <see cref="P:log4net.Appender.LocalSyslogAppender.LevelSeverity.Severity"/>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Emergency">
- <summary>
- system is unusable
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Alert">
- <summary>
- action must be taken immediately
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Critical">
- <summary>
- critical conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Error">
- <summary>
- error conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Warning">
- <summary>
- warning conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Notice">
- <summary>
- normal but significant condition
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Informational">
- <summary>
- informational
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Debug">
- <summary>
- debug-level messages
- </summary>
- </member>
- <member name="T:log4net.Appender.LocalSyslogAppender.SyslogFacility">
- <summary>
- syslog facilities
- </summary>
- <remarks>
- <para>
- The syslog facility defines which subsystem the logging comes from.
- This is set on the <see cref="P:log4net.Appender.LocalSyslogAppender.Facility"/> property.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Kernel">
- <summary>
- kernel messages
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.User">
- <summary>
- random user-level messages
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Mail">
- <summary>
- mail system
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Daemons">
- <summary>
- system daemons
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Authorization">
- <summary>
- security/authorization messages
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Syslog">
- <summary>
- messages generated internally by syslogd
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Printer">
- <summary>
- line printer subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.News">
- <summary>
- network news subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Uucp">
- <summary>
- UUCP subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Clock">
- <summary>
- clock (cron/at) daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Authorization2">
- <summary>
- security/authorization messages (private)
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Ftp">
- <summary>
- ftp daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Ntp">
- <summary>
- NTP subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Audit">
- <summary>
- log audit
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Alert">
- <summary>
- log alert
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Clock2">
- <summary>
- clock daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local0">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local1">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local2">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local3">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local4">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local5">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local6">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local7">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="T:log4net.Appender.LocalSyslogAppender.LevelSeverity">
- <summary>
- A class to act as a mapping between the level that a logging call is made at and
- the syslog severity that is should be logged at.
- </summary>
- <remarks>
- <para>
- A class to act as a mapping between the level that a logging call is made at and
- the syslog severity that is should be logged at.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.LocalSyslogAppender.LevelSeverity.Severity">
- <summary>
- The mapped syslog severity for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped syslog severity for the specified level
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.MemoryAppender">
- <summary>
- Stores logging events in an array.
- </summary>
- <remarks>
- <para>
- The memory appender stores all the logging events
- that are appended in an in-memory array.
- </para>
- <para>
- Use the <see cref="M:log4net.Appender.MemoryAppender.GetEvents"/> method to get
- the current list of events that have been appended.
- </para>
- <para>
- Use the <see cref="M:log4net.Appender.MemoryAppender.Clear"/> method to clear the
- current list of events.
- </para>
- </remarks>
- <author>Julian Biddle</author>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.MemoryAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.MemoryAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.MemoryAppender.GetEvents">
- <summary>
- Gets the events that have been logged.
- </summary>
- <returns>The events that have been logged</returns>
- <remarks>
- <para>
- Gets the events that have been logged.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.MemoryAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">the event to log</param>
- <remarks>
- <para>Stores the <paramref name="loggingEvent"/> in the events list.</para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.MemoryAppender.Clear">
- <summary>
- Clear the list of events
- </summary>
- <remarks>
- Clear the list of events
- </remarks>
- </member>
- <member name="F:log4net.Appender.MemoryAppender.m_eventsList">
- <summary>
- The list of events that have been appended.
- </summary>
- </member>
- <member name="F:log4net.Appender.MemoryAppender.m_fixFlags">
- <summary>
- Value indicating which fields in the event should be fixed
- </summary>
- <remarks>
- By default all fields are fixed
- </remarks>
- </member>
- <member name="P:log4net.Appender.MemoryAppender.OnlyFixPartialEventData">
- <summary>
- Gets or sets a value indicating whether only part of the logging event
- data should be fixed.
- </summary>
- <value>
- <c>true</c> if the appender should only fix part of the logging event
- data, otherwise <c>false</c>. The default is <c>false</c>.
- </value>
- <remarks>
- <para>
- Setting this property to <c>true</c> will cause only part of the event
- data to be fixed and stored in the appender, hereby improving performance.
- </para>
- <para>
- See <see cref="M:log4net.Core.LoggingEvent.FixVolatileData(System.Boolean)"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.MemoryAppender.Fix">
- <summary>
- Gets or sets the fields that will be fixed in the event
- </summary>
- <remarks>
- <para>
- The logging event needs to have certain thread specific values
- captured before it can be buffered. See <see cref="P:log4net.Core.LoggingEvent.Fix"/>
- for details.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.NetSendAppender">
- <summary>
- Logs entries by sending network messages using the
- <see cref="M:log4net.Appender.NetSendAppender.NetMessageBufferSend(System.String,System.String,System.String,System.String,System.Int32)"/> native function.
- </summary>
- <remarks>
- <para>
- You can send messages only to names that are active
- on the network. If you send the message to a user name,
- that user must be logged on and running the Messenger
- service to receive the message.
- </para>
- <para>
- The receiver will get a top most window displaying the
- messages one at a time, therefore this appender should
- not be used to deliver a high volume of messages.
- </para>
- <para>
- The following table lists some possible uses for this appender :
- </para>
- <para>
- <list type="table">
- <listheader>
- <term>Action</term>
- <description>Property Value(s)</description>
- </listheader>
- <item>
- <term>Send a message to a user account on the local machine</term>
- <description>
- <para>
- <paramref name="Server"/> = &lt;name of the local machine&gt;
- </para>
- <para>
- <paramref name="Recipient"/> = &lt;user name&gt;
- </para>
- </description>
- </item>
- <item>
- <term>Send a message to a user account on a remote machine</term>
- <description>
- <para>
- <paramref name="Server"/> = &lt;name of the remote machine&gt;
- </para>
- <para>
- <paramref name="Recipient"/> = &lt;user name&gt;
- </para>
- </description>
- </item>
- <item>
- <term>Send a message to a domain user account</term>
- <description>
- <para>
- <paramref name="Server"/> = &lt;name of a domain controller | uninitialized&gt;
- </para>
- <para>
- <paramref name="Recipient"/> = &lt;user name&gt;
- </para>
- </description>
- </item>
- <item>
- <term>Send a message to all the names in a workgroup or domain</term>
- <description>
- <para>
- <paramref name="Recipient"/> = &lt;workgroup name | domain name&gt;*
- </para>
- </description>
- </item>
- <item>
- <term>Send a message from the local machine to a remote machine</term>
- <description>
- <para>
- <paramref name="Server"/> = &lt;name of the local machine | uninitialized&gt;
- </para>
- <para>
- <paramref name="Recipient"/> = &lt;name of the remote machine&gt;
- </para>
- </description>
- </item>
- </list>
- </para>
- <para>
- <b>Note :</b> security restrictions apply for sending
- network messages, see <see cref="M:log4net.Appender.NetSendAppender.NetMessageBufferSend(System.String,System.String,System.String,System.String,System.Int32)"/>
- for more information.
- </para>
- </remarks>
- <example>
- <para>
- An example configuration section to log information
- using this appender from the local machine, named
- LOCAL_PC, to machine OPERATOR_PC :
- </para>
- <code lang="XML" escaped="true">
- <appender name="NetSendAppender_Operator" type="log4net.Appender.NetSendAppender">
- <server value="LOCAL_PC"/>
- <recipient value="OPERATOR_PC"/>
- <layout type="log4net.Layout.PatternLayout" value="%-5p %c [%x] - %m%n"/>
- </appender>
- </code>
- </example>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Appender.NetSendAppender.m_server">
- <summary>
- The DNS or NetBIOS name of the server on which the function is to execute.
- </summary>
- </member>
- <member name="F:log4net.Appender.NetSendAppender.m_sender">
- <summary>
- The sender of the network message.
- </summary>
- </member>
- <member name="F:log4net.Appender.NetSendAppender.m_recipient">
- <summary>
- The message alias to which the message should be sent.
- </summary>
- </member>
- <member name="F:log4net.Appender.NetSendAppender.m_securityContext">
- <summary>
- The security context to use for privileged calls
- </summary>
- </member>
- <member name="M:log4net.Appender.NetSendAppender.#ctor">
- <summary>
- Initializes the appender.
- </summary>
- <remarks>
- The default constructor initializes all fields to their default values.
- </remarks>
- </member>
- <member name="M:log4net.Appender.NetSendAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.NetSendAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.NetSendAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.NetSendAppender.ActivateOptions"/> must be called again.
- </para>
- <para>
- The appender will be ignored if no <see cref="P:log4net.Appender.NetSendAppender.Recipient"/> was specified.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">The required property <see cref="P:log4net.Appender.NetSendAppender.Recipient"/> was not specified.</exception>
- </member>
- <member name="M:log4net.Appender.NetSendAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Sends the event using a network message.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.NetSendAppender.NetMessageBufferSend(System.String,System.String,System.String,System.String,System.Int32)">
- <summary>
- Sends a buffer of information to a registered message alias.
- </summary>
- <param name="serverName">The DNS or NetBIOS name of the server on which the function is to execute.</param>
- <param name="msgName">The message alias to which the message buffer should be sent</param>
- <param name="fromName">The originator of the message.</param>
- <param name="buffer">The message text.</param>
- <param name="bufferSize">The length, in bytes, of the message text.</param>
- <remarks>
- <para>
- The following restrictions apply for sending network messages:
- </para>
- <para>
- <list type="table">
- <listheader>
- <term>Platform</term>
- <description>Requirements</description>
- </listheader>
- <item>
- <term>Windows NT</term>
- <description>
- <para>
- No special group membership is required to send a network message.
- </para>
- <para>
- Admin, Accounts, Print, or Server Operator group membership is required to
- successfully send a network message on a remote server.
- </para>
- </description>
- </item>
- <item>
- <term>Windows 2000 or later</term>
- <description>
- <para>
- If you send a message on a domain controller that is running Active Directory,
- access is allowed or denied based on the access control list (ACL) for the securable
- object. The default ACL permits only Domain Admins and Account Operators to send a network message.
- </para>
- <para>
- On a member server or workstation, only Administrators and Server Operators can send a network message.
- </para>
- </description>
- </item>
- </list>
- </para>
- <para>
- For more information see <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/netmgmt/security_requirements_for_the_network_management_functions.asp">Security Requirements for the Network Management Functions</a>.
- </para>
- </remarks>
- <returns>
- <para>
- If the function succeeds, the return value is zero.
- </para>
- </returns>
- </member>
- <member name="P:log4net.Appender.NetSendAppender.Sender">
- <summary>
- Gets or sets the sender of the message.
- </summary>
- <value>
- The sender of the message.
- </value>
- <remarks>
- If this property is not specified, the message is sent from the local computer.
- </remarks>
- </member>
- <member name="P:log4net.Appender.NetSendAppender.Recipient">
- <summary>
- Gets or sets the message alias to which the message should be sent.
- </summary>
- <value>
- The recipient of the message.
- </value>
- <remarks>
- This property should always be specified in order to send a message.
- </remarks>
- </member>
- <member name="P:log4net.Appender.NetSendAppender.Server">
- <summary>
- Gets or sets the DNS or NetBIOS name of the remote server on which the function is to execute.
- </summary>
- <value>
- DNS or NetBIOS name of the remote server on which the function is to execute.
- </value>
- <remarks>
- <para>
- For Windows NT 4.0 and earlier, the string should begin with \\.
- </para>
- <para>
- If this property is not specified, the local computer is used.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.NetSendAppender.SecurityContext">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.NetSendAppender.SecurityContext"/> used to call the NetSend method.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.NetSendAppender.SecurityContext"/> used to call the NetSend method.
- </value>
- <remarks>
- <para>
- Unless a <see cref="P:log4net.Appender.NetSendAppender.SecurityContext"/> specified here for this appender
- the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is queried for the
- security context to use. The default behavior is to use the security context
- of the current thread.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.NetSendAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.OutputDebugStringAppender">
- <summary>
- Appends log events to the OutputDebugString system.
- </summary>
- <remarks>
- <para>
- OutputDebugStringAppender appends log events to the
- OutputDebugString system.
- </para>
- <para>
- The string is passed to the native <c>OutputDebugString</c>
- function.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.OutputDebugStringAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.OutputDebugStringAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.OutputDebugStringAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Write the logging event to the output debug string API
- </summary>
- <param name="loggingEvent">the event to log</param>
- <remarks>
- <para>
- Write the logging event to the output debug string API
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.OutputDebugStringAppender.OutputDebugString(System.String)">
- <summary>
- Stub for OutputDebugString native method
- </summary>
- <param name="message">the string to output</param>
- <remarks>
- <para>
- Stub for OutputDebugString native method
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.OutputDebugStringAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RemoteSyslogAppender">
- <summary>
- Logs events to a remote syslog daemon.
- </summary>
- <remarks>
- <para>
- The BSD syslog protocol is used to remotely log to
- a syslog daemon. The syslogd listens for for messages
- on UDP port 514.
- </para>
- <para>
- The syslog UDP protocol is not authenticated. Most syslog daemons
- do not accept remote log messages because of the security implications.
- You may be able to use the LocalSyslogAppender to talk to a local
- syslog service.
- </para>
- <para>
- There is an RFC 3164 that claims to document the BSD Syslog Protocol.
- This RFC can be seen here: http://www.faqs.org/rfcs/rfc3164.html.
- This appender generates what the RFC calls an "Original Device Message",
- i.e. does not include the TIMESTAMP or HOSTNAME fields. By observation
- this format of message will be accepted by all current syslog daemon
- implementations. The daemon will attach the current time and the source
- hostname or IP address to any messages received.
- </para>
- <para>
- Syslog messages must have a facility and and a severity. The severity
- is derived from the Level of the logging event.
- The facility must be chosen from the set of defined syslog
- <see cref="T:log4net.Appender.RemoteSyslogAppender.SyslogFacility"/> values. The facilities list is predefined
- and cannot be extended.
- </para>
- <para>
- An identifier is specified with each log message. This can be specified
- by setting the <see cref="P:log4net.Appender.RemoteSyslogAppender.Identity"/> property. The identity (also know
- as the tag) must not contain white space. The default value for the
- identity is the application name (from <see cref="P:log4net.Core.LoggingEvent.Domain"/>).
- </para>
- </remarks>
- <author>Rob Lyon</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Appender.UdpAppender">
- <summary>
- Sends logging events as connectionless UDP datagrams to a remote host or a
- multicast group using an <see cref="T:System.Net.Sockets.UdpClient"/>.
- </summary>
- <remarks>
- <para>
- UDP guarantees neither that messages arrive, nor that they arrive in the correct order.
- </para>
- <para>
- To view the logging results, a custom application can be developed that listens for logging
- events.
- </para>
- <para>
- When decoding events send via this appender remember to use the same encoding
- to decode the events as was used to send the events. See the <see cref="P:log4net.Appender.UdpAppender.Encoding"/>
- property to specify the encoding to use.
- </para>
- </remarks>
- <example>
- This example shows how to log receive logging events that are sent
- on IP address 244.0.0.1 and port 8080 to the console. The event is
- encoded in the packet as a unicode string and it is decoded as such.
- <code lang="C#">
- IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
- UdpClient udpClient;
- byte[] buffer;
- string loggingEvent;
-
- try
- {
- udpClient = new UdpClient(8080);
-
- while(true)
- {
- buffer = udpClient.Receive(ref remoteEndPoint);
- loggingEvent = System.Text.Encoding.Unicode.GetString(buffer);
- Console.WriteLine(loggingEvent);
- }
- }
- catch(Exception e)
- {
- Console.WriteLine(e.ToString());
- }
- </code>
- <code lang="Visual Basic">
- Dim remoteEndPoint as IPEndPoint
- Dim udpClient as UdpClient
- Dim buffer as Byte()
- Dim loggingEvent as String
-
- Try
- remoteEndPoint = new IPEndPoint(IPAddress.Any, 0)
- udpClient = new UdpClient(8080)
-
- While True
- buffer = udpClient.Receive(ByRef remoteEndPoint)
- loggingEvent = System.Text.Encoding.Unicode.GetString(buffer)
- Console.WriteLine(loggingEvent)
- Wend
- Catch e As Exception
- Console.WriteLine(e.ToString())
- End Try
- </code>
- <para>
- An example configuration section to log information using this appender to the
- IP 224.0.0.1 on port 8080:
- </para>
- <code lang="XML" escaped="true">
- <appender name="UdpAppender" type="log4net.Appender.UdpAppender">
- <remoteAddress value="224.0.0.1"/>
- <remotePort value="8080"/>
- <layout type="log4net.Layout.PatternLayout" value="%-5level %logger [%ndc] - %message%newline"/>
- </appender>
- </code>
- </example>
- <author>Gert Driesen</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.UdpAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.UdpAppender"/> class.
- </summary>
- <remarks>
- The default constructor initializes all fields to their default values.
- </remarks>
- </member>
- <member name="M:log4net.Appender.UdpAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.UdpAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.UdpAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.UdpAppender.ActivateOptions"/> must be called again.
- </para>
- <para>
- The appender will be ignored if no <see cref="P:log4net.Appender.UdpAppender.RemoteAddress"/> was specified or
- an invalid remote or local TCP port number was specified.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">The required property <see cref="P:log4net.Appender.UdpAppender.RemoteAddress"/> was not specified.</exception>
- <exception cref="T:System.ArgumentOutOfRangeException">The TCP port number assigned to <see cref="P:log4net.Appender.UdpAppender.LocalPort"/> or <see cref="P:log4net.Appender.UdpAppender.RemotePort"/> is less than <see cref="F:System.Net.IPEndPoint.MinPort"/> or greater than <see cref="F:System.Net.IPEndPoint.MaxPort"/>.</exception>
- </member>
- <member name="M:log4net.Appender.UdpAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Sends the event using an UDP datagram.
- </para>
- <para>
- Exceptions are passed to the <see cref="P:log4net.Appender.AppenderSkeleton.ErrorHandler"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.UdpAppender.OnClose">
- <summary>
- Closes the UDP connection and releases all resources associated with
- this <see cref="T:log4net.Appender.UdpAppender"/> instance.
- </summary>
- <remarks>
- <para>
- Disables the underlying <see cref="T:System.Net.Sockets.UdpClient"/> and releases all managed
- and unmanaged resources associated with the <see cref="T:log4net.Appender.UdpAppender"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.UdpAppender.InitializeClientConnection">
- <summary>
- Initializes the underlying <see cref="T:System.Net.Sockets.UdpClient"/> connection.
- </summary>
- <remarks>
- <para>
- The underlying <see cref="T:System.Net.Sockets.UdpClient"/> is initialized and binds to the
- port number from which you intend to communicate.
- </para>
- <para>
- Exceptions are passed to the <see cref="P:log4net.Appender.AppenderSkeleton.ErrorHandler"/>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_remoteAddress">
- <summary>
- The IP address of the remote host or multicast group to which
- the logging event will be sent.
- </summary>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_remotePort">
- <summary>
- The TCP port number of the remote host or multicast group to
- which the logging event will be sent.
- </summary>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_remoteEndPoint">
- <summary>
- The cached remote endpoint to which the logging events will be sent.
- </summary>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_localPort">
- <summary>
- The TCP port number from which the <see cref="T:System.Net.Sockets.UdpClient"/> will communicate.
- </summary>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_client">
- <summary>
- The <see cref="T:System.Net.Sockets.UdpClient"/> instance that will be used for sending the
- logging events.
- </summary>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_encoding">
- <summary>
- The encoding to use for the packet.
- </summary>
- </member>
- <member name="P:log4net.Appender.UdpAppender.RemoteAddress">
- <summary>
- Gets or sets the IP address of the remote host or multicast group to which
- the underlying <see cref="T:System.Net.Sockets.UdpClient"/> should sent the logging event.
- </summary>
- <value>
- The IP address of the remote host or multicast group to which the logging event
- will be sent.
- </value>
- <remarks>
- <para>
- Multicast addresses are identified by IP class <b>D</b> addresses (in the range 224.0.0.0 to
- 239.255.255.255). Multicast packets can pass across different networks through routers, so
- it is possible to use multicasts in an Internet scenario as long as your network provider
- supports multicasting.
- </para>
- <para>
- Hosts that want to receive particular multicast messages must register their interest by joining
- the multicast group. Multicast messages are not sent to networks where no host has joined
- the multicast group. Class <b>D</b> IP addresses are used for multicast groups, to differentiate
- them from normal host addresses, allowing nodes to easily detect if a message is of interest.
- </para>
- <para>
- Static multicast addresses that are needed globally are assigned by IANA. A few examples are listed in the table below:
- </para>
- <para>
- <list type="table">
- <listheader>
- <term>IP Address</term>
- <description>Description</description>
- </listheader>
- <item>
- <term>224.0.0.1</term>
- <description>
- <para>
- Sends a message to all system on the subnet.
- </para>
- </description>
- </item>
- <item>
- <term>224.0.0.2</term>
- <description>
- <para>
- Sends a message to all routers on the subnet.
- </para>
- </description>
- </item>
- <item>
- <term>224.0.0.12</term>
- <description>
- <para>
- The DHCP server answers messages on the IP address 224.0.0.12, but only on a subnet.
- </para>
- </description>
- </item>
- </list>
- </para>
- <para>
- A complete list of actually reserved multicast addresses and their owners in the ranges
- defined by RFC 3171 can be found at the <A href="http://www.iana.org/assignments/multicast-addresses">IANA web site</A>.
- </para>
- <para>
- The address range 239.0.0.0 to 239.255.255.255 is reserved for administrative scope-relative
- addresses. These addresses can be reused with other local groups. Routers are typically
- configured with filters to prevent multicast traffic in this range from flowing outside
- of the local network.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.UdpAppender.RemotePort">
- <summary>
- Gets or sets the TCP port number of the remote host or multicast group to which
- the underlying <see cref="T:System.Net.Sockets.UdpClient"/> should sent the logging event.
- </summary>
- <value>
- An integer value in the range <see cref="F:System.Net.IPEndPoint.MinPort"/> to <see cref="F:System.Net.IPEndPoint.MaxPort"/>
- indicating the TCP port number of the remote host or multicast group to which the logging event
- will be sent.
- </value>
- <remarks>
- The underlying <see cref="T:System.Net.Sockets.UdpClient"/> will send messages to this TCP port number
- on the remote host or multicast group.
- </remarks>
- <exception cref="T:System.ArgumentOutOfRangeException">The value specified is less than <see cref="F:System.Net.IPEndPoint.MinPort"/> or greater than <see cref="F:System.Net.IPEndPoint.MaxPort"/>.</exception>
- </member>
- <member name="P:log4net.Appender.UdpAppender.LocalPort">
- <summary>
- Gets or sets the TCP port number from which the underlying <see cref="T:System.Net.Sockets.UdpClient"/> will communicate.
- </summary>
- <value>
- An integer value in the range <see cref="F:System.Net.IPEndPoint.MinPort"/> to <see cref="F:System.Net.IPEndPoint.MaxPort"/>
- indicating the TCP port number from which the underlying <see cref="T:System.Net.Sockets.UdpClient"/> will communicate.
- </value>
- <remarks>
- <para>
- The underlying <see cref="T:System.Net.Sockets.UdpClient"/> will bind to this port for sending messages.
- </para>
- <para>
- Setting the value to 0 (the default) will cause the udp client not to bind to
- a local port.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentOutOfRangeException">The value specified is less than <see cref="F:System.Net.IPEndPoint.MinPort"/> or greater than <see cref="F:System.Net.IPEndPoint.MaxPort"/>.</exception>
- </member>
- <member name="P:log4net.Appender.UdpAppender.Encoding">
- <summary>
- Gets or sets <see cref="P:log4net.Appender.UdpAppender.Encoding"/> used to write the packets.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.UdpAppender.Encoding"/> used to write the packets.
- </value>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.UdpAppender.Encoding"/> used to write the packets.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.UdpAppender.Client">
- <summary>
- Gets or sets the underlying <see cref="T:System.Net.Sockets.UdpClient"/>.
- </summary>
- <value>
- The underlying <see cref="T:System.Net.Sockets.UdpClient"/>.
- </value>
- <remarks>
- <see cref="T:log4net.Appender.UdpAppender"/> creates a <see cref="T:System.Net.Sockets.UdpClient"/> to send logging events
- over a network. Classes deriving from <see cref="T:log4net.Appender.UdpAppender"/> can use this
- property to get or set this <see cref="T:System.Net.Sockets.UdpClient"/>. Use the underlying <see cref="T:System.Net.Sockets.UdpClient"/>
- returned from <see cref="P:log4net.Appender.UdpAppender.Client"/> if you require access beyond that which
- <see cref="T:log4net.Appender.UdpAppender"/> provides.
- </remarks>
- </member>
- <member name="P:log4net.Appender.UdpAppender.RemoteEndPoint">
- <summary>
- Gets or sets the cached remote endpoint to which the logging events should be sent.
- </summary>
- <value>
- The cached remote endpoint to which the logging events will be sent.
- </value>
- <remarks>
- The <see cref="M:log4net.Appender.UdpAppender.ActivateOptions"/> method will initialize the remote endpoint
- with the values of the <see cref="P:log4net.Appender.UdpAppender.RemoteAddress"/> and <see cref="P:log4net.Appender.UdpAppender.RemotePort"/>
- properties.
- </remarks>
- </member>
- <member name="P:log4net.Appender.UdpAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.DefaultSyslogPort">
- <summary>
- Syslog port 514
- </summary>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.RemoteSyslogAppender"/> class.
- </summary>
- <remarks>
- This instance of the <see cref="T:log4net.Appender.RemoteSyslogAppender"/> class is set up to write
- to a remote syslog daemon.
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.AddMapping(log4net.Appender.RemoteSyslogAppender.LevelSeverity)">
- <summary>
- Add a mapping of level to severity
- </summary>
- <param name="mapping">The mapping to add</param>
- <remarks>
- <para>
- Add a <see cref="T:log4net.Appender.RemoteSyslogAppender.LevelSeverity"/> mapping to this appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the event to a remote syslog daemon.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.ActivateOptions">
- <summary>
- Initialize the options for this appender
- </summary>
- <remarks>
- <para>
- Initialize the level to syslog severity mappings set on this appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.GetSeverity(log4net.Core.Level)">
- <summary>
- Translates a log4net level to a syslog severity.
- </summary>
- <param name="level">A log4net level.</param>
- <returns>A syslog severity.</returns>
- <remarks>
- <para>
- Translates a log4net level to a syslog severity.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.GeneratePriority(log4net.Appender.RemoteSyslogAppender.SyslogFacility,log4net.Appender.RemoteSyslogAppender.SyslogSeverity)">
- <summary>
- Generate a syslog priority.
- </summary>
- <param name="facility">The syslog facility.</param>
- <param name="severity">The syslog severity.</param>
- <returns>A syslog priority.</returns>
- <remarks>
- <para>
- Generate a syslog priority.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.m_facility">
- <summary>
- The facility. The default facility is <see cref="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.User"/>.
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.m_identity">
- <summary>
- The message identity
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.m_levelMapping">
- <summary>
- Mapping from level object to syslog severity
- </summary>
- </member>
- <member name="P:log4net.Appender.RemoteSyslogAppender.Identity">
- <summary>
- Message identity
- </summary>
- <remarks>
- <para>
- An identifier is specified with each log message. This can be specified
- by setting the <see cref="P:log4net.Appender.RemoteSyslogAppender.Identity"/> property. The identity (also know
- as the tag) must not contain white space. The default value for the
- identity is the application name (from <see cref="P:log4net.Core.LoggingEvent.Domain"/>).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RemoteSyslogAppender.Facility">
- <summary>
- Syslog facility
- </summary>
- <remarks>
- Set to one of the <see cref="T:log4net.Appender.RemoteSyslogAppender.SyslogFacility"/> values. The list of
- facilities is predefined and cannot be extended. The default value
- is <see cref="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.User"/>.
- </remarks>
- </member>
- <member name="T:log4net.Appender.RemoteSyslogAppender.SyslogSeverity">
- <summary>
- syslog severities
- </summary>
- <remarks>
- <para>
- The syslog severities.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Emergency">
- <summary>
- system is unusable
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Alert">
- <summary>
- action must be taken immediately
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Critical">
- <summary>
- critical conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Error">
- <summary>
- error conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Warning">
- <summary>
- warning conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Notice">
- <summary>
- normal but significant condition
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Informational">
- <summary>
- informational
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Debug">
- <summary>
- debug-level messages
- </summary>
- </member>
- <member name="T:log4net.Appender.RemoteSyslogAppender.SyslogFacility">
- <summary>
- syslog facilities
- </summary>
- <remarks>
- <para>
- The syslog facilities
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Kernel">
- <summary>
- kernel messages
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.User">
- <summary>
- random user-level messages
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Mail">
- <summary>
- mail system
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Daemons">
- <summary>
- system daemons
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Authorization">
- <summary>
- security/authorization messages
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Syslog">
- <summary>
- messages generated internally by syslogd
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Printer">
- <summary>
- line printer subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.News">
- <summary>
- network news subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Uucp">
- <summary>
- UUCP subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Clock">
- <summary>
- clock (cron/at) daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Authorization2">
- <summary>
- security/authorization messages (private)
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Ftp">
- <summary>
- ftp daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Ntp">
- <summary>
- NTP subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Audit">
- <summary>
- log audit
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Alert">
- <summary>
- log alert
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Clock2">
- <summary>
- clock daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local0">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local1">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local2">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local3">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local4">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local5">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local6">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local7">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="T:log4net.Appender.RemoteSyslogAppender.LevelSeverity">
- <summary>
- A class to act as a mapping between the level that a logging call is made at and
- the syslog severity that is should be logged at.
- </summary>
- <remarks>
- <para>
- A class to act as a mapping between the level that a logging call is made at and
- the syslog severity that is should be logged at.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RemoteSyslogAppender.LevelSeverity.Severity">
- <summary>
- The mapped syslog severity for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped syslog severity for the specified level
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RemotingAppender">
- <summary>
- Delivers logging events to a remote logging sink.
- </summary>
- <remarks>
- <para>
- This Appender is designed to deliver events to a remote sink.
- That is any object that implements the <see cref="T:log4net.Appender.RemotingAppender.IRemoteLoggingSink"/>
- interface. It delivers the events using .NET remoting. The
- object to deliver events to is specified by setting the
- appenders <see cref="P:log4net.Appender.RemotingAppender.Sink"/> property.</para>
- <para>
- The RemotingAppender buffers events before sending them. This allows it to
- make more efficient use of the remoting infrastructure.</para>
- <para>
- Once the buffer is full the events are still not sent immediately.
- They are scheduled to be sent using a pool thread. The effect is that
- the send occurs asynchronously. This is very important for a
- number of non obvious reasons. The remoting infrastructure will
- flow thread local variables (stored in the <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/>),
- if they are marked as <see cref="T:System.Runtime.Remoting.Messaging.ILogicalThreadAffinative"/>, across the
- remoting boundary. If the server is not contactable then
- the remoting infrastructure will clear the <see cref="T:System.Runtime.Remoting.Messaging.ILogicalThreadAffinative"/>
- objects from the <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/>. To prevent a logging failure from
- having side effects on the calling application the remoting call must be made
- from a separate thread to the one used by the application. A <see cref="T:System.Threading.ThreadPool"/>
- thread is used for this. If no <see cref="T:System.Threading.ThreadPool"/> thread is available then
- the events will block in the thread pool manager until a thread is available.</para>
- <para>
- Because the events are sent asynchronously using pool threads it is possible to close
- this appender before all the queued events have been sent.
- When closing the appender attempts to wait until all the queued events have been sent, but
- this will timeout after 30 seconds regardless.</para>
- <para>
- If this appender is being closed because the <see cref="E:System.AppDomain.ProcessExit"/>
- event has fired it may not be possible to send all the queued events. During process
- exit the runtime limits the time that a <see cref="E:System.AppDomain.ProcessExit"/>
- event handler is allowed to run for. If the runtime terminates the threads before
- the queued events have been sent then they will be lost. To ensure that all events
- are sent the appender must be closed before the application exits. See
- <see cref="M:log4net.Core.LoggerManager.Shutdown"/> for details on how to shutdown
- log4net programmatically.</para>
- </remarks>
- <seealso cref="T:log4net.Appender.RemotingAppender.IRemoteLoggingSink"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Daniel Cazzulino</author>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.RemotingAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.RemotingAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.RemotingAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.RemotingAppender.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Send the contents of the buffer to the remote sink.
- </summary>
- <remarks>
- The events are not sent immediately. They are scheduled to be sent
- using a pool thread. The effect is that the send occurs asynchronously.
- This is very important for a number of non obvious reasons. The remoting
- infrastructure will flow thread local variables (stored in the <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/>),
- if they are marked as <see cref="T:System.Runtime.Remoting.Messaging.ILogicalThreadAffinative"/>, across the
- remoting boundary. If the server is not contactable then
- the remoting infrastructure will clear the <see cref="T:System.Runtime.Remoting.Messaging.ILogicalThreadAffinative"/>
- objects from the <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/>. To prevent a logging failure from
- having side effects on the calling application the remoting call must be made
- from a separate thread to the one used by the application. A <see cref="T:System.Threading.ThreadPool"/>
- thread is used for this. If no <see cref="T:System.Threading.ThreadPool"/> thread is available then
- the events will block in the thread pool manager until a thread is available.
- </remarks>
- <param name="events">The events to send.</param>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.OnClose">
- <summary>
- Override base class close.
- </summary>
- <remarks>
- <para>
- This method waits while there are queued work items. The events are
- sent asynchronously using <see cref="T:System.Threading.ThreadPool"/> work items. These items
- will be sent once a thread pool thread is available to send them, therefore
- it is possible to close the appender before all the queued events have been
- sent.</para>
- <para>
- This method attempts to wait until all the queued events have been sent, but this
- method will timeout after 30 seconds regardless.</para>
- <para>
- If the appender is being closed because the <see cref="E:System.AppDomain.ProcessExit"/>
- event has fired it may not be possible to send all the queued events. During process
- exit the runtime limits the time that a <see cref="E:System.AppDomain.ProcessExit"/>
- event handler is allowed to run for.</para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.BeginAsyncSend">
- <summary>
- A work item is being queued into the thread pool
- </summary>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.EndAsyncSend">
- <summary>
- A work item from the thread pool has completed
- </summary>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.SendBufferCallback(System.Object)">
- <summary>
- Send the contents of the buffer to the remote sink.
- </summary>
- <remarks>
- This method is designed to be used with the <see cref="T:System.Threading.ThreadPool"/>.
- This method expects to be passed an array of <see cref="T:log4net.Core.LoggingEvent"/>
- objects in the state param.
- </remarks>
- <param name="state">the logging events to send</param>
- </member>
- <member name="F:log4net.Appender.RemotingAppender.m_sinkUrl">
- <summary>
- The URL of the remote sink.
- </summary>
- </member>
- <member name="F:log4net.Appender.RemotingAppender.m_sinkObj">
- <summary>
- The local proxy (.NET remoting) for the remote logging sink.
- </summary>
- </member>
- <member name="F:log4net.Appender.RemotingAppender.m_queuedCallbackCount">
- <summary>
- The number of queued callbacks currently waiting or executing
- </summary>
- </member>
- <member name="F:log4net.Appender.RemotingAppender.m_workQueueEmptyEvent">
- <summary>
- Event used to signal when there are no queued work items
- </summary>
- <remarks>
- This event is set when there are no queued work items. In this
- state it is safe to close the appender.
- </remarks>
- </member>
- <member name="P:log4net.Appender.RemotingAppender.Sink">
- <summary>
- Gets or sets the URL of the well-known object that will accept
- the logging events.
- </summary>
- <value>
- The well-known URL of the remote sink.
- </value>
- <remarks>
- <para>
- The URL of the remoting sink that will accept logging events.
- The sink must implement the <see cref="T:log4net.Appender.RemotingAppender.IRemoteLoggingSink"/>
- interface.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RemotingAppender.IRemoteLoggingSink">
- <summary>
- Interface used to deliver <see cref="T:log4net.Core.LoggingEvent"/> objects to a remote sink.
- </summary>
- <remarks>
- This interface must be implemented by a remoting sink
- if the <see cref="T:log4net.Appender.RemotingAppender"/> is to be used
- to deliver logging events to the sink.
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.IRemoteLoggingSink.LogEvents(log4net.Core.LoggingEvent[])">
- <summary>
- Delivers logging events to the remote sink
- </summary>
- <param name="events">Array of events to log.</param>
- <remarks>
- <para>
- Delivers logging events to the remote sink
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RollingFileAppender">
- <summary>
- Appender that rolls log files based on size or date or both.
- </summary>
- <remarks>
- <para>
- RollingFileAppender can roll log files based on size or date or both
- depending on the setting of the <see cref="P:log4net.Appender.RollingFileAppender.RollingStyle"/> property.
- When set to <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Size"/> the log file will be rolled
- once its size exceeds the <see cref="P:log4net.Appender.RollingFileAppender.MaximumFileSize"/>.
- When set to <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Date"/> the log file will be rolled
- once the date boundary specified in the <see cref="P:log4net.Appender.RollingFileAppender.DatePattern"/> property
- is crossed.
- When set to <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Composite"/> the log file will be
- rolled once the date boundary specified in the <see cref="P:log4net.Appender.RollingFileAppender.DatePattern"/> property
- is crossed, but within a date boundary the file will also be rolled
- once its size exceeds the <see cref="P:log4net.Appender.RollingFileAppender.MaximumFileSize"/>.
- When set to <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Once"/> the log file will be rolled when
- the appender is configured. This effectively means that the log file can be
- rolled once per program execution.
- </para>
- <para>
- A of few additional optional features have been added:
- <list type="bullet">
- <item>Attach date pattern for current log file <see cref="P:log4net.Appender.RollingFileAppender.StaticLogFileName"/></item>
- <item>Backup number increments for newer files <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/></item>
- <item>Infinite number of backups by file size <see cref="P:log4net.Appender.RollingFileAppender.MaxSizeRollBackups"/></item>
- </list>
- </para>
-
- <note>
- <para>
- For large or infinite numbers of backup files a <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/>
- greater than zero is highly recommended, otherwise all the backup files need
- to be renamed each time a new backup is created.
- </para>
- <para>
- When Date/Time based rolling is used setting <see cref="P:log4net.Appender.RollingFileAppender.StaticLogFileName"/>
- to <see langword="true"/> will reduce the number of file renamings to few or none.
- </para>
- </note>
-
- <note type="caution">
- <para>
- Changing <see cref="P:log4net.Appender.RollingFileAppender.StaticLogFileName"/> or <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/> without clearing
- the log file directory of backup files will cause unexpected and unwanted side effects.
- </para>
- </note>
-
- <para>
- If Date/Time based rolling is enabled this appender will attempt to roll existing files
- in the directory without a Date/Time tag based on the last write date of the base log file.
- The appender only rolls the log file when a message is logged. If Date/Time based rolling
- is enabled then the appender will not roll the log file at the Date/Time boundary but
- at the point when the next message is logged after the boundary has been crossed.
- </para>
-
- <para>
- The <see cref="T:log4net.Appender.RollingFileAppender"/> extends the <see cref="T:log4net.Appender.FileAppender"/> and
- has the same behavior when opening the log file.
- The appender will first try to open the file for writing when <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/>
- is called. This will typically be during configuration.
- If the file cannot be opened for writing the appender will attempt
- to open the file again each time a message is logged to the appender.
- If the file cannot be opened for writing when a message is logged then
- the message will be discarded by this appender.
- </para>
- <para>
- When rolling a backup file necessitates deleting an older backup file the
- file to be deleted is moved to a temporary name before being deleted.
- </para>
-
- <note type="caution">
- <para>
- A maximum number of backup files when rolling on date/time boundaries is not supported.
- </para>
- </note>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Aspi Havewala</author>
- <author>Douglas de la Torre</author>
- <author>Edward Smit</author>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.RollingFileAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.SetQWForFiles(System.IO.TextWriter)">
- <summary>
- Sets the quiet writer being used.
- </summary>
- <remarks>
- This method can be overridden by sub classes.
- </remarks>
- <param name="writer">the writer to set</param>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Write out a logging event.
- </summary>
- <param name="loggingEvent">the event to write to file.</param>
- <remarks>
- <para>
- Handles append time behavior for RollingFileAppender. This checks
- if a roll over either by date (checked first) or time (checked second)
- is need and then appends to the file last.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.Append(log4net.Core.LoggingEvent[])">
- <summary>
- Write out an array of logging events.
- </summary>
- <param name="loggingEvents">the events to write to file.</param>
- <remarks>
- <para>
- Handles append time behavior for RollingFileAppender. This checks
- if a roll over either by date (checked first) or time (checked second)
- is need and then appends to the file last.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.AdjustFileBeforeAppend">
- <summary>
- Performs any required rolling before outputting the next event
- </summary>
- <remarks>
- <para>
- Handles append time behavior for RollingFileAppender. This checks
- if a roll over either by date (checked first) or time (checked second)
- is need and then appends to the file last.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.OpenFile(System.String,System.Boolean)">
- <summary>
- Creates and opens the file for logging. If <see cref="P:log4net.Appender.RollingFileAppender.StaticLogFileName"/>
- is false then the fully qualified name is determined and used.
- </summary>
- <param name="fileName">the name of the file to open</param>
- <param name="append">true to append to existing file</param>
- <remarks>
- <para>This method will ensure that the directory structure
- for the <paramref name="fileName"/> specified exists.</para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.GetNextOutputFileName(System.String)">
- <summary>
- Get the current output file name
- </summary>
- <param name="fileName">the base file name</param>
- <returns>the output file name</returns>
- <remarks>
- The output file name is based on the base fileName specified.
- If <see cref="P:log4net.Appender.RollingFileAppender.StaticLogFileName"/> is set then the output
- file name is the same as the base file passed in. Otherwise
- the output file depends on the date pattern, on the count
- direction or both.
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.DetermineCurSizeRollBackups">
- <summary>
- Determines curSizeRollBackups (only within the current roll point)
- </summary>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.GetWildcardPatternForFile(System.String)">
- <summary>
- Generates a wildcard pattern that can be used to find all files
- that are similar to the base file name.
- </summary>
- <param name="baseFileName"></param>
- <returns></returns>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.GetExistingFiles(System.String)">
- <summary>
- Builds a list of filenames for all files matching the base filename plus a file
- pattern.
- </summary>
- <param name="baseFilePath"></param>
- <returns></returns>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.RollOverIfDateBoundaryCrossing">
- <summary>
- Initiates a roll over if needed for crossing a date boundary since the last run.
- </summary>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.ExistingInit">
- <summary>
- Initializes based on existing conditions at time of <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/>.
- </summary>
- <remarks>
- <para>
- Initializes based on existing conditions at time of <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/>.
- The following is done
- <list type="bullet">
- <item>determine curSizeRollBackups (only within the current roll point)</item>
- <item>initiates a roll over if needed for crossing a date boundary since the last run.</item>
- </list>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.InitializeFromOneFile(System.String,System.String)">
- <summary>
- Does the work of bumping the 'current' file counter higher
- to the highest count when an incremental file name is seen.
- The highest count is either the first file (when count direction
- is greater than 0) or the last file (when count direction less than 0).
- In either case, we want to know the highest count that is present.
- </summary>
- <param name="baseFile"></param>
- <param name="curFileName"></param>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.InitializeRollBackups(System.String,System.Collections.ArrayList)">
- <summary>
- Takes a list of files and a base file name, and looks for
- 'incremented' versions of the base file. Bumps the max
- count up to the highest count seen.
- </summary>
- <param name="baseFile"></param>
- <param name="arrayFiles"></param>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.ComputeCheckPeriod(System.String)">
- <summary>
- Calculates the RollPoint for the datePattern supplied.
- </summary>
- <param name="datePattern">the date pattern to calculate the check period for</param>
- <returns>The RollPoint that is most accurate for the date pattern supplied</returns>
- <remarks>
- Essentially the date pattern is examined to determine what the
- most suitable roll point is. The roll point chosen is the roll point
- with the smallest period that can be detected using the date pattern
- supplied. i.e. if the date pattern only outputs the year, month, day
- and hour then the smallest roll point that can be detected would be
- and hourly roll point as minutes could not be detected.
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/> must be called again.
- </para>
- <para>
- Sets initial conditions including date/time roll over information, first check,
- scheduledFilename, and calls <see cref="M:log4net.Appender.RollingFileAppender.ExistingInit"/> to initialize
- the current number of backups.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.RollOverTime(System.Boolean)">
- <summary>
- Rollover the file(s) to date/time tagged file(s).
- </summary>
- <param name="fileIsOpen">set to true if the file to be rolled is currently open</param>
- <remarks>
- <para>
- Rollover the file(s) to date/time tagged file(s).
- Resets curSizeRollBackups.
- If fileIsOpen is set then the new file is opened (through SafeOpenFile).
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.RollFile(System.String,System.String)">
- <summary>
- Renames file <paramref name="fromFile"/> to file <paramref name="toFile"/>.
- </summary>
- <param name="fromFile">Name of existing file to roll.</param>
- <param name="toFile">New name for file.</param>
- <remarks>
- <para>
- Renames file <paramref name="fromFile"/> to file <paramref name="toFile"/>. It
- also checks for existence of target file and deletes if it does.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.FileExists(System.String)">
- <summary>
- Test if a file exists at a specified path
- </summary>
- <param name="path">the path to the file</param>
- <returns>true if the file exists</returns>
- <remarks>
- <para>
- Test if a file exists at a specified path
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.DeleteFile(System.String)">
- <summary>
- Deletes the specified file if it exists.
- </summary>
- <param name="fileName">The file to delete.</param>
- <remarks>
- <para>
- Delete a file if is exists.
- The file is first moved to a new filename then deleted.
- This allows the file to be removed even when it cannot
- be deleted, but it still can be moved.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.RollOverSize">
- <summary>
- Implements file roll base on file size.
- </summary>
- <remarks>
- <para>
- If the maximum number of size based backups is reached
- (<c>curSizeRollBackups == maxSizeRollBackups</c>) then the oldest
- file is deleted -- its index determined by the sign of countDirection.
- If <c>countDirection</c> &lt; 0, then files
- {<c>File.1</c>, ..., <c>File.curSizeRollBackups -1</c>}
- are renamed to {<c>File.2</c>, ...,
- <c>File.curSizeRollBackups</c>}. Moreover, <c>File</c> is
- renamed <c>File.1</c> and closed.
- </para>
- <para>
- A new file is created to receive further log output.
- </para>
- <para>
- If <c>maxSizeRollBackups</c> is equal to zero, then the
- <c>File</c> is truncated with no backup files created.
- </para>
- <para>
- If <c>maxSizeRollBackups</c> &lt; 0, then <c>File</c> is
- renamed if needed and no files are deleted.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.RollOverRenameFiles(System.String)">
- <summary>
- Implements file roll.
- </summary>
- <param name="baseFileName">the base name to rename</param>
- <remarks>
- <para>
- If the maximum number of size based backups is reached
- (<c>curSizeRollBackups == maxSizeRollBackups</c>) then the oldest
- file is deleted -- its index determined by the sign of countDirection.
- If <c>countDirection</c> &lt; 0, then files
- {<c>File.1</c>, ..., <c>File.curSizeRollBackups -1</c>}
- are renamed to {<c>File.2</c>, ...,
- <c>File.curSizeRollBackups</c>}.
- </para>
- <para>
- If <c>maxSizeRollBackups</c> is equal to zero, then the
- <c>File</c> is truncated with no backup files created.
- </para>
- <para>
- If <c>maxSizeRollBackups</c> &lt; 0, then <c>File</c> is
- renamed if needed and no files are deleted.
- </para>
- <para>
- This is called by <see cref="M:log4net.Appender.RollingFileAppender.RollOverSize"/> to rename the files.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.NextCheckDate(System.DateTime,log4net.Appender.RollingFileAppender.RollPoint)">
- <summary>
- Get the start time of the next window for the current rollpoint
- </summary>
- <param name="currentDateTime">the current date</param>
- <param name="rollPoint">the type of roll point we are working with</param>
- <returns>the start time for the next roll point an interval after the currentDateTime date</returns>
- <remarks>
- <para>
- Returns the date of the next roll point after the currentDateTime date passed to the method.
- </para>
- <para>
- The basic strategy is to subtract the time parts that are less significant
- than the rollpoint from the current time. This should roll the time back to
- the start of the time window for the current rollpoint. Then we add 1 window
- worth of time and get the start time of the next window for the rollpoint.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_dateTime">
- <summary>
- This object supplies the current date/time. Allows test code to plug in
- a method to control this class when testing date/time based rolling.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_datePattern">
- <summary>
- The date pattern. By default, the pattern is set to <c>".yyyy-MM-dd"</c>
- meaning daily rollover.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_scheduledFilename">
- <summary>
- The actual formatted filename that is currently being written to
- or will be the file transferred to on roll over
- (based on staticLogFileName).
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_nextCheck">
- <summary>
- The timestamp when we shall next recompute the filename.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_now">
- <summary>
- Holds date of last roll over
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_rollPoint">
- <summary>
- The type of rolling done
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_maxFileSize">
- <summary>
- The default maximum file size is 10MB
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_maxSizeRollBackups">
- <summary>
- There is zero backup files by default
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_curSizeRollBackups">
- <summary>
- How many sized based backups have been made so far
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_countDirection">
- <summary>
- The rolling file count direction.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_rollingStyle">
- <summary>
- The rolling mode used in this appender.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_rollDate">
- <summary>
- Cache flag set if we are rolling by date.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_rollSize">
- <summary>
- Cache flag set if we are rolling by size.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_staticLogFileName">
- <summary>
- Value indicating whether to always log to the same file.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_baseFileName">
- <summary>
- FileName provided in configuration. Used for rolling properly
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.s_date1970">
- <summary>
- The 1st of January 1970 in UTC
- </summary>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.DatePattern">
- <summary>
- Gets or sets the date pattern to be used for generating file names
- when rolling over on date.
- </summary>
- <value>
- The date pattern to be used for generating file names when rolling
- over on date.
- </value>
- <remarks>
- <para>
- Takes a string in the same format as expected by
- <see cref="T:log4net.DateFormatter.SimpleDateFormatter"/>.
- </para>
- <para>
- This property determines the rollover schedule when rolling over
- on date.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.MaxSizeRollBackups">
- <summary>
- Gets or sets the maximum number of backup files that are kept before
- the oldest is erased.
- </summary>
- <value>
- The maximum number of backup files that are kept before the oldest is
- erased.
- </value>
- <remarks>
- <para>
- If set to zero, then there will be no backup files and the log file
- will be truncated when it reaches <see cref="P:log4net.Appender.RollingFileAppender.MaxFileSize"/>.
- </para>
- <para>
- If a negative number is supplied then no deletions will be made. Note
- that this could result in very slow performance as a large number of
- files are rolled over unless <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/> is used.
- </para>
- <para>
- The maximum applies to <b>each</b> time based group of files and
- <b>not</b> the total.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.MaxFileSize">
- <summary>
- Gets or sets the maximum size that the output file is allowed to reach
- before being rolled over to backup files.
- </summary>
- <value>
- The maximum size in bytes that the output file is allowed to reach before being
- rolled over to backup files.
- </value>
- <remarks>
- <para>
- This property is equivalent to <see cref="P:log4net.Appender.RollingFileAppender.MaximumFileSize"/> except
- that it is required for differentiating the setter taking a
- <see cref="T:System.Int64"/> argument from the setter taking a <see cref="T:System.String"/>
- argument.
- </para>
- <para>
- The default maximum file size is 10MB (10*1024*1024).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.MaximumFileSize">
- <summary>
- Gets or sets the maximum size that the output file is allowed to reach
- before being rolled over to backup files.
- </summary>
- <value>
- The maximum size that the output file is allowed to reach before being
- rolled over to backup files.
- </value>
- <remarks>
- <para>
- This property allows you to specify the maximum size with the
- suffixes "KB", "MB" or "GB" so that the size is interpreted being
- expressed respectively in kilobytes, megabytes or gigabytes.
- </para>
- <para>
- For example, the value "10KB" will be interpreted as 10240 bytes.
- </para>
- <para>
- The default maximum file size is 10MB.
- </para>
- <para>
- If you have the option to set the maximum file size programmatically
- consider using the <see cref="P:log4net.Appender.RollingFileAppender.MaxFileSize"/> property instead as this
- allows you to set the size in bytes as a <see cref="T:System.Int64"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.CountDirection">
- <summary>
- Gets or sets the rolling file count direction.
- </summary>
- <value>
- The rolling file count direction.
- </value>
- <remarks>
- <para>
- Indicates if the current file is the lowest numbered file or the
- highest numbered file.
- </para>
- <para>
- By default newer files have lower numbers (<see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/> &lt; 0),
- i.e. log.1 is most recent, log.5 is the 5th backup, etc...
- </para>
- <para>
- <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/> &gt;= 0 does the opposite i.e.
- log.1 is the first backup made, log.5 is the 5th backup made, etc.
- For infinite backups use <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/> &gt;= 0 to reduce
- rollover costs.
- </para>
- <para>The default file count direction is -1.</para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.RollingStyle">
- <summary>
- Gets or sets the rolling style.
- </summary>
- <value>The rolling style.</value>
- <remarks>
- <para>
- The default rolling style is <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Composite"/>.
- </para>
- <para>
- When set to <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Once"/> this appender's
- <see cref="P:log4net.Appender.FileAppender.AppendToFile"/> property is set to <c>false</c>, otherwise
- the appender would append to a single file rather than rolling
- the file each time it is opened.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.StaticLogFileName">
- <summary>
- Gets or sets a value indicating whether to always log to
- the same file.
- </summary>
- <value>
- <c>true</c> if always should be logged to the same file, otherwise <c>false</c>.
- </value>
- <remarks>
- <para>
- By default file.log is always the current file. Optionally
- file.log.yyyy-mm-dd for current formatted datePattern can by the currently
- logging file (or file.log.curSizeRollBackup or even
- file.log.yyyy-mm-dd.curSizeRollBackup).
- </para>
- <para>
- This will make time based rollovers with a large number of backups
- much faster as the appender it won't have to rename all the backups!
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RollingFileAppender.RollingMode">
- <summary>
- Style of rolling to use
- </summary>
- <remarks>
- <para>
- Style of rolling to use
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollingMode.Once">
- <summary>
- Roll files once per program execution
- </summary>
- <remarks>
- <para>
- Roll files once per program execution.
- Well really once each time this appender is
- configured.
- </para>
- <para>
- Setting this option also sets <c>AppendToFile</c> to
- <c>false</c> on the <c>RollingFileAppender</c>, otherwise
- this appender would just be a normal file appender.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollingMode.Size">
- <summary>
- Roll files based only on the size of the file
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollingMode.Date">
- <summary>
- Roll files based only on the date
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollingMode.Composite">
- <summary>
- Roll files based on both the size and date of the file
- </summary>
- </member>
- <member name="T:log4net.Appender.RollingFileAppender.RollPoint">
- <summary>
- The code assumes that the following 'time' constants are in a increasing sequence.
- </summary>
- <remarks>
- <para>
- The code assumes that the following 'time' constants are in a increasing sequence.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.InvalidRollPoint">
- <summary>
- Roll the log not based on the date
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.TopOfMinute">
- <summary>
- Roll the log for each minute
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.TopOfHour">
- <summary>
- Roll the log for each hour
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.HalfDay">
- <summary>
- Roll the log twice a day (midday and midnight)
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.TopOfDay">
- <summary>
- Roll the log each day (midnight)
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.TopOfWeek">
- <summary>
- Roll the log each week
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.TopOfMonth">
- <summary>
- Roll the log each month
- </summary>
- </member>
- <member name="T:log4net.Appender.RollingFileAppender.IDateTime">
- <summary>
- This interface is used to supply Date/Time information to the <see cref="T:log4net.Appender.RollingFileAppender"/>.
- </summary>
- <remarks>
- This interface is used to supply Date/Time information to the <see cref="T:log4net.Appender.RollingFileAppender"/>.
- Used primarily to allow test classes to plug themselves in so they can
- supply test date/times.
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.IDateTime.Now">
- <summary>
- Gets the <i>current</i> time.
- </summary>
- <value>The <i>current</i> time.</value>
- <remarks>
- <para>
- Gets the <i>current</i> time.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RollingFileAppender.DefaultDateTime">
- <summary>
- Default implementation of <see cref="T:log4net.Appender.RollingFileAppender.IDateTime"/> that returns the current time.
- </summary>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.DefaultDateTime.Now">
- <summary>
- Gets the <b>current</b> time.
- </summary>
- <value>The <b>current</b> time.</value>
- <remarks>
- <para>
- Gets the <b>current</b> time.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.SmtpAppender">
- <summary>
- Send an e-mail when a specific logging event occurs, typically on errors
- or fatal errors.
- </summary>
- <remarks>
- <para>
- The number of logging events delivered in this e-mail depend on
- the value of <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> option. The
- <see cref="T:log4net.Appender.SmtpAppender"/> keeps only the last
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> logging events in its
- cyclic buffer. This keeps memory requirements at a reasonable level while
- still delivering useful application context.
- </para>
- <note type="caution">
- Authentication and setting the server Port are only available on the MS .NET 1.1 runtime.
- For these features to be enabled you need to ensure that you are using a version of
- the log4net assembly that is built against the MS .NET 1.1 framework and that you are
- running the your application on the MS .NET 1.1 runtime. On all other platforms only sending
- unauthenticated messages to a server listening on port 25 (the default) is supported.
- </note>
- <para>
- Authentication is supported by setting the <see cref="P:log4net.Appender.SmtpAppender.Authentication"/> property to
- either <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/> or <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Ntlm"/>.
- If using <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/> authentication then the <see cref="P:log4net.Appender.SmtpAppender.Username"/>
- and <see cref="P:log4net.Appender.SmtpAppender.Password"/> properties must also be set.
- </para>
- <para>
- To set the SMTP server port use the <see cref="P:log4net.Appender.SmtpAppender.Port"/> property. The default port is 25.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.SmtpAppender.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.SmtpAppender.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Sends the contents of the cyclic buffer as an e-mail message.
- </summary>
- <param name="events">The logging events to send.</param>
- </member>
- <member name="M:log4net.Appender.SmtpAppender.SendEmail(System.String)">
- <summary>
- Send the email message
- </summary>
- <param name="messageBody">the body text to include in the mail</param>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.To">
- <summary>
- Gets or sets a semicolon-delimited list of recipient e-mail addresses.
- </summary>
- <value>
- A semicolon-delimited list of e-mail addresses.
- </value>
- <remarks>
- <para>
- A semicolon-delimited list of recipient e-mail addresses.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.From">
- <summary>
- Gets or sets the e-mail address of the sender.
- </summary>
- <value>
- The e-mail address of the sender.
- </value>
- <remarks>
- <para>
- The e-mail address of the sender.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Subject">
- <summary>
- Gets or sets the subject line of the e-mail message.
- </summary>
- <value>
- The subject line of the e-mail message.
- </value>
- <remarks>
- <para>
- The subject line of the e-mail message.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.SmtpHost">
- <summary>
- Gets or sets the name of the SMTP relay mail server to use to send
- the e-mail messages.
- </summary>
- <value>
- The name of the e-mail relay server. If SmtpServer is not set, the
- name of the local SMTP server is used.
- </value>
- <remarks>
- <para>
- The name of the e-mail relay server. If SmtpServer is not set, the
- name of the local SMTP server is used.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.LocationInfo">
- <summary>
- Obsolete
- </summary>
- <remarks>
- Use the BufferingAppenderSkeleton Fix methods instead
- </remarks>
- <remarks>
- <para>
- Obsolete property.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Authentication">
- <summary>
- The mode to use to authentication with the SMTP server
- </summary>
- <remarks>
- <note type="caution">Authentication is only available on the MS .NET 1.1 runtime.</note>
- <para>
- Valid Authentication mode values are: <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.None"/>,
- <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/>, and <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Ntlm"/>.
- The default value is <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.None"/>. When using
- <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/> you must specify the <see cref="P:log4net.Appender.SmtpAppender.Username"/>
- and <see cref="P:log4net.Appender.SmtpAppender.Password"/> to use to authenticate.
- When using <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Ntlm"/> the Windows credentials for the current
- thread, if impersonating, or the process will be used to authenticate.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Username">
- <summary>
- The username to use to authenticate with the SMTP server
- </summary>
- <remarks>
- <note type="caution">Authentication is only available on the MS .NET 1.1 runtime.</note>
- <para>
- A <see cref="P:log4net.Appender.SmtpAppender.Username"/> and <see cref="P:log4net.Appender.SmtpAppender.Password"/> must be specified when
- <see cref="P:log4net.Appender.SmtpAppender.Authentication"/> is set to <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/>,
- otherwise the username will be ignored.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Password">
- <summary>
- The password to use to authenticate with the SMTP server
- </summary>
- <remarks>
- <note type="caution">Authentication is only available on the MS .NET 1.1 runtime.</note>
- <para>
- A <see cref="P:log4net.Appender.SmtpAppender.Username"/> and <see cref="P:log4net.Appender.SmtpAppender.Password"/> must be specified when
- <see cref="P:log4net.Appender.SmtpAppender.Authentication"/> is set to <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/>,
- otherwise the password will be ignored.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Port">
- <summary>
- The port on which the SMTP server is listening
- </summary>
- <remarks>
- <note type="caution">Server Port is only available on the MS .NET 1.1 runtime.</note>
- <para>
- The port on which the SMTP server is listening. The default
- port is <c>25</c>. The Port can only be changed when running on
- the MS .NET 1.1 runtime.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Priority">
- <summary>
- Gets or sets the priority of the e-mail message
- </summary>
- <value>
- One of the <see cref="T:System.Web.Mail.MailPriority"/> values.
- </value>
- <remarks>
- <para>
- Sets the priority of the e-mails generated by this
- appender. The default priority is <see cref="F:System.Web.Mail.MailPriority.Normal"/>.
- </para>
- <para>
- If you are using this appender to report errors then
- you may want to set the priority to <see cref="F:System.Web.Mail.MailPriority.High"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.SmtpAppender.SmtpAuthentication">
- <summary>
- Values for the <see cref="P:log4net.Appender.SmtpAppender.Authentication"/> property.
- </summary>
- <remarks>
- <para>
- SMTP authentication modes.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.SmtpAppender.SmtpAuthentication.None">
- <summary>
- No authentication
- </summary>
- </member>
- <member name="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic">
- <summary>
- Basic authentication.
- </summary>
- <remarks>
- Requires a username and password to be supplied
- </remarks>
- </member>
- <member name="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Ntlm">
- <summary>
- Integrated authentication
- </summary>
- <remarks>
- Uses the Windows credentials from the current thread or process to authenticate.
- </remarks>
- </member>
- <member name="T:log4net.Appender.SmtpPickupDirAppender">
- <summary>
- Send an email when a specific logging event occurs, typically on errors
- or fatal errors. Rather than sending via smtp it writes a file into the
- directory specified by <see cref="P:log4net.Appender.SmtpPickupDirAppender.PickupDir"/>. This allows services such
- as the IIS SMTP agent to manage sending the messages.
- </summary>
- <remarks>
- <para>
- The configuration for this appender is identical to that of the <c>SMTPAppender</c>,
- except that instead of specifying the <c>SMTPAppender.SMTPHost</c> you specify
- <see cref="P:log4net.Appender.SmtpPickupDirAppender.PickupDir"/>.
- </para>
- <para>
- The number of logging events delivered in this e-mail depend on
- the value of <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> option. The
- <see cref="T:log4net.Appender.SmtpPickupDirAppender"/> keeps only the last
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> logging events in its
- cyclic buffer. This keeps memory requirements at a reasonable level while
- still delivering useful application context.
- </para>
- </remarks>
- <author>Niall Daley</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.SmtpPickupDirAppender.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.SmtpPickupDirAppender.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Sends the contents of the cyclic buffer as an e-mail message.
- </summary>
- <param name="events">The logging events to send.</param>
- <remarks>
- <para>
- Sends the contents of the cyclic buffer as an e-mail message.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.SmtpPickupDirAppender.ActivateOptions">
- <summary>
- Activate the options on this appender.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.SmtpPickupDirAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.SmtpPickupDirAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.SmtpPickupDirAppender.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.SmtpPickupDirAppender.ConvertToFullPath(System.String)">
- <summary>
- Convert a path into a fully qualified path.
- </summary>
- <param name="path">The path to convert.</param>
- <returns>The fully qualified path.</returns>
- <remarks>
- <para>
- Converts the path specified to a fully
- qualified path. If the path is relative it is
- taken as relative from the application base
- directory.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.SmtpPickupDirAppender.m_securityContext">
- <summary>
- The security context to use for privileged calls
- </summary>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.To">
- <summary>
- Gets or sets a semicolon-delimited list of recipient e-mail addresses.
- </summary>
- <value>
- A semicolon-delimited list of e-mail addresses.
- </value>
- <remarks>
- <para>
- A semicolon-delimited list of e-mail addresses.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.From">
- <summary>
- Gets or sets the e-mail address of the sender.
- </summary>
- <value>
- The e-mail address of the sender.
- </value>
- <remarks>
- <para>
- The e-mail address of the sender.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.Subject">
- <summary>
- Gets or sets the subject line of the e-mail message.
- </summary>
- <value>
- The subject line of the e-mail message.
- </value>
- <remarks>
- <para>
- The subject line of the e-mail message.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.PickupDir">
- <summary>
- Gets or sets the path to write the messages to.
- </summary>
- <remarks>
- <para>
- Gets or sets the path to write the messages to. This should be the same
- as that used by the agent sending the messages.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.SecurityContext">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.SmtpPickupDirAppender.SecurityContext"/> used to write to the pickup directory.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.SmtpPickupDirAppender.SecurityContext"/> used to write to the pickup directory.
- </value>
- <remarks>
- <para>
- Unless a <see cref="P:log4net.Appender.SmtpPickupDirAppender.SecurityContext"/> specified here for this appender
- the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is queried for the
- security context to use. The default behavior is to use the security context
- of the current thread.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.TelnetAppender">
- <summary>
- Appender that allows clients to connect via Telnet to receive log messages
- </summary>
- <remarks>
- <para>
- The TelnetAppender accepts socket connections and streams logging messages
- back to the client.
- The output is provided in a telnet-friendly way so that a log can be monitored
- over a TCP/IP socket.
- This allows simple remote monitoring of application logging.
- </para>
- <para>
- The default <see cref="P:log4net.Appender.TelnetAppender.Port"/> is 23 (the telnet port).
- </para>
- </remarks>
- <author>Keith Long</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.OnClose">
- <summary>
- Overrides the parent method to close the socket handler
- </summary>
- <remarks>
- <para>
- Closes all the outstanding connections.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.TelnetAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.TelnetAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.TelnetAppender.ActivateOptions"/> must be called again.
- </para>
- <para>
- Create the socket handler and wait for connections
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Writes the logging event to each connected client.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the logging event to each connected client.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TelnetAppender.Port">
- <summary>
- Gets or sets the TCP port number on which this <see cref="T:log4net.Appender.TelnetAppender"/> will listen for connections.
- </summary>
- <value>
- An integer value in the range <see cref="F:System.Net.IPEndPoint.MinPort"/> to <see cref="F:System.Net.IPEndPoint.MaxPort"/>
- indicating the TCP port number on which this <see cref="T:log4net.Appender.TelnetAppender"/> will listen for connections.
- </value>
- <remarks>
- <para>
- The default value is 23 (the telnet port).
- </para>
- </remarks>
- <exception cref="T:System.ArgumentOutOfRangeException">The value specified is less than <see cref="F:System.Net.IPEndPoint.MinPort"/>
- or greater than <see cref="F:System.Net.IPEndPoint.MaxPort"/>.</exception>
- </member>
- <member name="P:log4net.Appender.TelnetAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.TelnetAppender.SocketHandler">
- <summary>
- Helper class to manage connected clients
- </summary>
- <remarks>
- <para>
- The SocketHandler class is used to accept connections from
- clients. It is threaded so that clients can connect/disconnect
- asynchronously.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.#ctor(System.Int32)">
- <summary>
- Opens a new server port on <paramref ref="port"/>
- </summary>
- <param name="port">the local port to listen on for connections</param>
- <remarks>
- <para>
- Creates a socket handler on the specified local server port.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.Send(System.String)">
- <summary>
- Sends a string message to each of the connected clients
- </summary>
- <param name="message">the text to send</param>
- <remarks>
- <para>
- Sends a string message to each of the connected clients
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.AddClient(log4net.Appender.TelnetAppender.SocketHandler.SocketClient)">
- <summary>
- Add a client to the internal clients list
- </summary>
- <param name="client">client to add</param>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.RemoveClient(log4net.Appender.TelnetAppender.SocketHandler.SocketClient)">
- <summary>
- Remove a client from the internal clients list
- </summary>
- <param name="client">client to remove</param>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.OnConnect(System.IAsyncResult)">
- <summary>
- Callback used to accept a connection on the server socket
- </summary>
- <param name="asyncResult">The result of the asynchronous operation</param>
- <remarks>
- <para>
- On connection adds to the list of connections
- if there are two many open connections you will be disconnected
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.Dispose">
- <summary>
- Close all network connections
- </summary>
- <remarks>
- <para>
- Make sure we close all network connections
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TelnetAppender.SocketHandler.HasConnections">
- <summary>
- Test if this handler has active connections
- </summary>
- <value>
- <c>true</c> if this handler has active connections
- </value>
- <remarks>
- <para>
- This property will be <c>true</c> while this handler has
- active connections, that is at least one connection that
- the handler will attempt to send a message to.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.TelnetAppender.SocketHandler.SocketClient">
- <summary>
- Class that represents a client connected to this handler
- </summary>
- <remarks>
- <para>
- Class that represents a client connected to this handler
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.SocketClient.#ctor(System.Net.Sockets.Socket)">
- <summary>
- Create this <see cref="T:log4net.Appender.TelnetAppender.SocketHandler.SocketClient"/> for the specified <see cref="T:System.Net.Sockets.Socket"/>
- </summary>
- <param name="socket">the client's socket</param>
- <remarks>
- <para>
- Opens a stream writer on the socket.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.SocketClient.Send(System.String)">
- <summary>
- Write a string to the client
- </summary>
- <param name="message">string to send</param>
- <remarks>
- <para>
- Write a string to the client
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.SocketClient.Dispose">
- <summary>
- Cleanup the clients connection
- </summary>
- <remarks>
- <para>
- Close the socket connection.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.TraceAppender">
- <summary>
- Appends log events to the <see cref="T:System.Diagnostics.Trace"/> system.
- </summary>
- <remarks>
- <para>
- The application configuration file can be used to control what listeners
- are actually used. See the MSDN documentation for the
- <see cref="T:System.Diagnostics.Trace"/> class for details on configuring the
- trace system.
- </para>
- <para>
- Events are written using the <c>System.Diagnostics.Trace.Write(string,string)</c>
- method. The event's logger name is passed as the value for the category name to the Write method.
- </para>
- <para>
- <b>Compact Framework</b><br/>
- The Compact Framework does not support the <see cref="T:System.Diagnostics.Trace"/>
- class for any operation except <c>Assert</c>. When using the Compact Framework this
- appender will write to the <see cref="T:System.Diagnostics.Debug"/> system rather than
- the Trace system. This appender will therefore behave like the <see cref="T:log4net.Appender.DebugAppender"/>.
- </para>
- </remarks>
- <author>Douglas de la Torre</author>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.TraceAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.TraceAppender"/>.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TraceAppender.#ctor(log4net.Layout.ILayout)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.TraceAppender"/>
- with a specified layout.
- </summary>
- <param name="layout">The layout to use with this appender.</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TraceAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Writes the logging event to the <see cref="T:System.Diagnostics.Trace"/> system.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the logging event to the <see cref="T:System.Diagnostics.Trace"/> system.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.TraceAppender.m_immediateFlush">
- <summary>
- Immediate flush means that the underlying writer or output stream
- will be flushed at the end of each append operation.
- </summary>
- <remarks>
- <para>
- Immediate flush is slower but ensures that each append request is
- actually written. If <see cref="P:log4net.Appender.TraceAppender.ImmediateFlush"/> is set to
- <c>false</c>, then there is a good chance that the last few
- logs events are not actually written to persistent media if and
- when the application crashes.
- </para>
- <para>
- The default value is <c>true</c>.</para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TraceAppender.ImmediateFlush">
- <summary>
- Gets or sets a value that indicates whether the appender will
- flush at the end of each write.
- </summary>
- <remarks>
- <para>The default behavior is to flush at the end of each
- write. If the option is set to<c>false</c>, then the underlying
- stream can defer writing to physical medium to a later time.
- </para>
- <para>
- Avoiding the flush operation at the end of each append results
- in a performance gain of 10 to 20 percent. However, there is safety
- trade-off involved in skipping flushing. Indeed, when flushing is
- skipped, then it is likely that the last few log events will not
- be recorded on disk when the application exits. This is a high
- price to pay even for a 20% performance gain.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TraceAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.AliasDomainAttribute">
- <summary>
- Assembly level attribute that specifies a domain to alias to this assembly's repository.
- </summary>
- <remarks>
- <para>
- <b>AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute.</b>
- </para>
- <para>
- An assembly's logger repository is defined by its <see cref="T:log4net.Config.DomainAttribute"/>,
- however this can be overridden by an assembly loaded before the target assembly.
- </para>
- <para>
- An assembly can alias another assembly's domain to its repository by
- specifying this attribute with the name of the target domain.
- </para>
- <para>
- This attribute can only be specified on the assembly and may be used
- as many times as necessary to alias all the required domains.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Config.AliasRepositoryAttribute">
- <summary>
- Assembly level attribute that specifies a repository to alias to this assembly's repository.
- </summary>
- <remarks>
- <para>
- An assembly's logger repository is defined by its <see cref="T:log4net.Config.RepositoryAttribute"/>,
- however this can be overridden by an assembly loaded before the target assembly.
- </para>
- <para>
- An assembly can alias another assembly's repository to its repository by
- specifying this attribute with the name of the target repository.
- </para>
- <para>
- This attribute can only be specified on the assembly and may be used
- as many times as necessary to alias all the required repositories.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.AliasRepositoryAttribute.#ctor(System.String)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.AliasRepositoryAttribute"/> class with
- the specified repository to alias to this assembly's repository.
- </summary>
- <param name="name">The repository to alias to this assemby's repository.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Config.AliasRepositoryAttribute"/> class with
- the specified repository to alias to this assembly's repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.AliasRepositoryAttribute.Name">
- <summary>
- Gets or sets the repository to alias to this assemby's repository.
- </summary>
- <value>
- The repository to alias to this assemby's repository.
- </value>
- <remarks>
- <para>
- The name of the repository to alias to this assemby's repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.AliasDomainAttribute.#ctor(System.String)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.AliasDomainAttribute"/> class with
- the specified domain to alias to this assembly's repository.
- </summary>
- <param name="name">The domain to alias to this assemby's repository.</param>
- <remarks>
- <para>
- Obsolete. Use <see cref="T:log4net.Config.AliasRepositoryAttribute"/> instead of <see cref="T:log4net.Config.AliasDomainAttribute"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.BasicConfigurator">
- <summary>
- Use this class to quickly configure a <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.
- </summary>
- <remarks>
- <para>
- Allows very simple programmatic configuration of log4net.
- </para>
- <para>
- Only one appender can be configured using this configurator.
- The appender is set at the root of the hierarchy and all logging
- events will be delivered to that appender.
- </para>
- <para>
- Appenders can also implement the <see cref="T:log4net.Core.IOptionHandler"/> interface. Therefore
- they would require that the <see cref="M:log4net.Core.IOptionHandler.ActivateOptions"/> method
- be called after the appenders properties have been configured.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.BasicConfigurator.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.BasicConfigurator"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.BasicConfigurator.Configure">
- <summary>
- Initializes the log4net system with a default configuration.
- </summary>
- <remarks>
- <para>
- Initializes the log4net logging system using a <see cref="T:log4net.Appender.ConsoleAppender"/>
- that will write to <c>Console.Out</c>. The log messages are
- formatted using the <see cref="T:log4net.Layout.PatternLayout"/> layout object
- with the <see cref="F:log4net.Layout.PatternLayout.DetailConversionPattern"/>
- layout style.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.BasicConfigurator.Configure(log4net.Appender.IAppender)">
- <summary>
- Initializes the log4net system using the specified appender.
- </summary>
- <param name="appender">The appender to use to log all logging events.</param>
- <remarks>
- <para>
- Initializes the log4net system using the specified appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.BasicConfigurator.Configure(log4net.Repository.ILoggerRepository)">
- <summary>
- Initializes the <see cref="T:log4net.Repository.ILoggerRepository"/> with a default configuration.
- </summary>
- <param name="repository">The repository to configure.</param>
- <remarks>
- <para>
- Initializes the specified repository using a <see cref="T:log4net.Appender.ConsoleAppender"/>
- that will write to <c>Console.Out</c>. The log messages are
- formatted using the <see cref="T:log4net.Layout.PatternLayout"/> layout object
- with the <see cref="F:log4net.Layout.PatternLayout.DetailConversionPattern"/>
- layout style.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.BasicConfigurator.Configure(log4net.Repository.ILoggerRepository,log4net.Appender.IAppender)">
- <summary>
- Initializes the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified appender.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="appender">The appender to use to log all logging events.</param>
- <remarks>
- <para>
- Initializes the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified appender.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.ConfiguratorAttribute">
- <summary>
- Base class for all log4net configuration attributes.
- </summary>
- <remarks>
- This is an abstract class that must be extended by
- specific configurators. This attribute allows the
- configurator to be parameterized by an assembly level
- attribute.
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.ConfiguratorAttribute.#ctor(System.Int32)">
- <summary>
- Constructor used by subclasses.
- </summary>
- <param name="priority">the ordering priority for this configurator</param>
- <remarks>
- <para>
- The <paramref name="priority"/> is used to order the configurator
- attributes before they are invoked. Higher priority configurators are executed
- before lower priority ones.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.ConfiguratorAttribute.Configure(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly.
- </summary>
- <param name="sourceAssembly">The assembly that this attribute was defined on.</param>
- <param name="targetRepository">The repository to configure.</param>
- <remarks>
- <para>
- Abstract method implemented by a subclass. When this method is called
- the subclass should configure the <paramref name="targetRepository"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.ConfiguratorAttribute.CompareTo(System.Object)">
- <summary>
- Compare this instance to another ConfiguratorAttribute
- </summary>
- <param name="obj">the object to compare to</param>
- <returns>see <see cref="M:System.IComparable.CompareTo(System.Object)"/></returns>
- <remarks>
- <para>
- Compares the priorities of the two <see cref="T:log4net.Config.ConfiguratorAttribute"/> instances.
- Sorts by priority in descending order. Objects with the same priority are
- randomly ordered.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.DomainAttribute">
- <summary>
- Assembly level attribute that specifies the logging domain for the assembly.
- </summary>
- <remarks>
- <para>
- <b>DomainAttribute is obsolete. Use RepositoryAttribute instead of DomainAttribute.</b>
- </para>
- <para>
- Assemblies are mapped to logging domains. Each domain has its own
- logging repository. This attribute specified on the assembly controls
- the configuration of the domain. The <see cref="P:log4net.Config.RepositoryAttribute.Name"/> property specifies the name
- of the domain that this assembly is a part of. The <see cref="P:log4net.Config.RepositoryAttribute.RepositoryType"/>
- specifies the type of the repository objects to create for the domain. If
- this attribute is not specified and a <see cref="P:log4net.Config.RepositoryAttribute.Name"/> is not specified
- then the assembly will be part of the default shared logging domain.
- </para>
- <para>
- This attribute can only be specified on the assembly and may only be used
- once per assembly.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Config.RepositoryAttribute">
- <summary>
- Assembly level attribute that specifies the logging repository for the assembly.
- </summary>
- <remarks>
- <para>
- Assemblies are mapped to logging repository. This attribute specified
- on the assembly controls
- the configuration of the repository. The <see cref="P:log4net.Config.RepositoryAttribute.Name"/> property specifies the name
- of the repository that this assembly is a part of. The <see cref="P:log4net.Config.RepositoryAttribute.RepositoryType"/>
- specifies the type of the <see cref="T:log4net.Repository.ILoggerRepository"/> object
- to create for the assembly. If this attribute is not specified or a <see cref="P:log4net.Config.RepositoryAttribute.Name"/>
- is not specified then the assembly will be part of the default shared logging repository.
- </para>
- <para>
- This attribute can only be specified on the assembly and may only be used
- once per assembly.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.RepositoryAttribute.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.RepositoryAttribute"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.RepositoryAttribute.#ctor(System.String)">
- <summary>
- Initialize a new instance of the <see cref="T:log4net.Config.RepositoryAttribute"/> class
- with the name of the repository.
- </summary>
- <param name="name">The name of the repository.</param>
- <remarks>
- <para>
- Initialize the attribute with the name for the assembly's repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.RepositoryAttribute.Name">
- <summary>
- Gets or sets the name of the logging repository.
- </summary>
- <value>
- The string name to use as the name of the repository associated with this
- assembly.
- </value>
- <remarks>
- <para>
- This value does not have to be unique. Several assemblies can share the
- same repository. They will share the logging configuration of the repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.RepositoryAttribute.RepositoryType">
- <summary>
- Gets or sets the type of repository to create for this assembly.
- </summary>
- <value>
- The type of repository to create for this assembly.
- </value>
- <remarks>
- <para>
- The type of the repository to create for the assembly.
- The type must implement the <see cref="T:log4net.Repository.ILoggerRepository"/>
- interface.
- </para>
- <para>
- This will be the type of repository created when
- the repository is created. If multiple assemblies reference the
- same repository then the repository is only created once using the
- <see cref="P:log4net.Config.RepositoryAttribute.RepositoryType"/> of the first assembly to call into the
- repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.DomainAttribute.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.DomainAttribute"/> class.
- </summary>
- <remarks>
- <para>
- Obsolete. Use RepositoryAttribute instead of DomainAttribute.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.DomainAttribute.#ctor(System.String)">
- <summary>
- Initialize a new instance of the <see cref="T:log4net.Config.DomainAttribute"/> class
- with the name of the domain.
- </summary>
- <param name="name">The name of the domain.</param>
- <remarks>
- <para>
- Obsolete. Use RepositoryAttribute instead of DomainAttribute.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.DOMConfigurator">
- <summary>
- Use this class to initialize the log4net environment using an Xml tree.
- </summary>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- Configures a <see cref="T:log4net.Repository.ILoggerRepository"/> using an Xml tree.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.#ctor">
- <summary>
- Private constructor
- </summary>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure">
- <summary>
- Automatically configures the log4net system based on the
- application's configuration settings.
- </summary>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- Each application has a configuration file. This has the
- same name as the application with '.config' appended.
- This file is XML and calling this function prompts the
- configurator to look in that file for a section called
- <c>log4net</c> that contains the configuration data.
- </remarks>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(log4net.Repository.ILoggerRepository)">
- <summary>
- Automatically configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using settings
- stored in the application's configuration file.
- </summary>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- Each application has a configuration file. This has the
- same name as the application with '.config' appended.
- This file is XML and calling this function prompts the
- configurator to look in that file for a section called
- <c>log4net</c> that contains the configuration data.
- </remarks>
- <param name="repository">The repository to configure.</param>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(System.Xml.XmlElement)">
- <summary>
- Configures log4net using a <c>log4net</c> element
- </summary>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- Loads the log4net configuration from the XML element
- supplied as <paramref name="element"/>.
- </remarks>
- <param name="element">The element to parse.</param>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(log4net.Repository.ILoggerRepository,System.Xml.XmlElement)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified XML
- element.
- </summary>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- Loads the log4net configuration from the XML element
- supplied as <paramref name="element"/>.
- </remarks>
- <param name="repository">The repository to configure.</param>
- <param name="element">The element to parse.</param>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(System.IO.FileInfo)">
- <summary>
- Configures log4net using the specified configuration file.
- </summary>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the log4net configuration data.
- </para>
- <para>
- The log4net configuration file can possible be specified in the application's
- configuration file (either <c>MyAppName.exe.config</c> for a
- normal application on <c>Web.config</c> for an ASP.NET application).
- </para>
- <example>
- The following example configures log4net using a configuration file, of which the
- location is stored in the application's configuration file :
- </example>
- <code lang="C#">
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
- </code>
- <para>
- In the <c>.config</c> file, the path to the log4net can be specified like this :
- </para>
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net-config-file" value="log.config"/>
- </appSettings>
- </configuration>
- </code>
- </remarks>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(System.IO.Stream)">
- <summary>
- Configures log4net using the specified configuration file.
- </summary>
- <param name="configStream">A stream to load the XML configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the log4net configuration data.
- </para>
- <para>
- Note that this method will NOT close the stream parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified configuration
- file.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The log4net configuration file can possible be specified in the application's
- configuration file (either <c>MyAppName.exe.config</c> for a
- normal application on <c>Web.config</c> for an ASP.NET application).
- </para>
- <example>
- The following example configures log4net using a configuration file, of which the
- location is stored in the application's configuration file :
- </example>
- <code lang="C#">
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
- </code>
- <para>
- In the <c>.config</c> file, the path to the log4net can be specified like this :
- </para>
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net-config-file" value="log.config"/>
- </appSettings>
- </configuration>
- </code>
- </remarks>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(log4net.Repository.ILoggerRepository,System.IO.Stream)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified configuration
- file.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configStream">The stream to load the XML configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- Note that this method will NOT close the stream parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.ConfigureAndWatch(System.IO.FileInfo)">
- <summary>
- Configures log4net using the file specified, monitors the file for changes
- and reloads the configuration if a change is detected.
- </summary>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The configuration file will be monitored using a <see cref="T:System.IO.FileSystemWatcher"/>
- and depends on the behavior of that class.
- </para>
- <para>
- For more information on how to configure log4net using
- a separate configuration file, see <see cref="M:log4net.Config.DOMConfigurator.Configure(System.IO.FileInfo)"/>.
- </para>
- </remarks>
- <seealso cref="M:log4net.Config.DOMConfigurator.Configure(System.IO.FileInfo)"/>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.ConfigureAndWatch(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the file specified,
- monitors the file for changes and reloads the configuration if a change
- is detected.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The configuration file will be monitored using a <see cref="T:System.IO.FileSystemWatcher"/>
- and depends on the behavior of that class.
- </para>
- <para>
- For more information on how to configure log4net using
- a separate configuration file, see <see cref="M:log4net.Config.DOMConfigurator.Configure(System.IO.FileInfo)"/>.
- </para>
- </remarks>
- <seealso cref="M:log4net.Config.DOMConfigurator.Configure(System.IO.FileInfo)"/>
- </member>
- <member name="T:log4net.Config.DOMConfiguratorAttribute">
- <summary>
- Assembly level attribute to configure the <see cref="T:log4net.Config.XmlConfigurator"/>.
- </summary>
- <remarks>
- <para>
- <b>AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute.</b>
- </para>
- <para>
- This attribute may only be used at the assembly scope and can only
- be used once per assembly.
- </para>
- <para>
- Use this attribute to configure the <see cref="T:log4net.Config.XmlConfigurator"/>
- without calling one of the <see cref="M:log4net.Config.XmlConfigurator.Configure"/>
- methods.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Config.XmlConfiguratorAttribute">
- <summary>
- Assembly level attribute to configure the <see cref="T:log4net.Config.XmlConfigurator"/>.
- </summary>
- <remarks>
- <para>
- This attribute may only be used at the assembly scope and can only
- be used once per assembly.
- </para>
- <para>
- Use this attribute to configure the <see cref="T:log4net.Config.XmlConfigurator"/>
- without calling one of the <see cref="M:log4net.Config.XmlConfigurator.Configure"/>
- methods.
- </para>
- <para>
- If neither of the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> or <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/>
- properties are set the configuration is loaded from the application's .config file.
- If set the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> property takes priority over the
- <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/> property. The <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> property
- specifies a path to a file to load the config from. The path is relative to the
- application's base directory; <see cref="P:System.AppDomain.BaseDirectory"/>.
- The <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/> property is used as a postfix to the assembly file name.
- The config file must be located in the application's base directory; <see cref="P:System.AppDomain.BaseDirectory"/>.
- For example in a console application setting the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/> to
- <c>config</c> has the same effect as not specifying the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> or
- <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/> properties.
- </para>
- <para>
- The <see cref="P:log4net.Config.XmlConfiguratorAttribute.Watch"/> property can be set to cause the <see cref="T:log4net.Config.XmlConfigurator"/>
- to watch the configuration file for changes.
- </para>
- <note>
- <para>
- Log4net will only look for assembly level configuration attributes once.
- When using the log4net assembly level attributes to control the configuration
- of log4net you must ensure that the first call to any of the
- <see cref="T:log4net.Core.LoggerManager"/> methods is made from the assembly with the configuration
- attributes.
- </para>
- <para>
- If you cannot guarantee the order in which log4net calls will be made from
- different assemblies you must use programmatic configuration instead, i.e.
- call the <see cref="M:log4net.Config.XmlConfigurator.Configure"/> method directly.
- </para>
- </note>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.XmlConfiguratorAttribute.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfiguratorAttribute.Configure(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly.
- </summary>
- <param name="sourceAssembly">The assembly that this attribute was defined on.</param>
- <param name="targetRepository">The repository to configure.</param>
- <remarks>
- <para>
- Configure the repository using the <see cref="T:log4net.Config.XmlConfigurator"/>.
- The <paramref name="targetRepository"/> specified must extend the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>
- class otherwise the <see cref="T:log4net.Config.XmlConfigurator"/> will not be able to
- configure it.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="repository"/> does not extend <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.</exception>
- </member>
- <member name="M:log4net.Config.XmlConfiguratorAttribute.ConfigureFromFile(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Attempt to load configuration from the local file system
- </summary>
- <param name="sourceAssembly">The assembly that this attribute was defined on.</param>
- <param name="targetRepository">The repository to configure.</param>
- </member>
- <member name="M:log4net.Config.XmlConfiguratorAttribute.ConfigureFromFile(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Configure the specified repository using a <see cref="T:System.IO.FileInfo"/>
- </summary>
- <param name="targetRepository">The repository to configure.</param>
- <param name="configFile">the FileInfo pointing to the config file</param>
- </member>
- <member name="M:log4net.Config.XmlConfiguratorAttribute.ConfigureFromUri(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Attempt to load configuration from a URI
- </summary>
- <param name="sourceAssembly">The assembly that this attribute was defined on.</param>
- <param name="targetRepository">The repository to configure.</param>
- </member>
- <member name="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile">
- <summary>
- Gets or sets the filename of the configuration file.
- </summary>
- <value>
- The filename of the configuration file.
- </value>
- <remarks>
- <para>
- If specified, this is the name of the configuration file to use with
- the <see cref="T:log4net.Config.XmlConfigurator"/>. This file path is relative to the
- <b>application base</b> directory (<see cref="P:System.AppDomain.BaseDirectory"/>).
- </para>
- <para>
- The <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> takes priority over the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension">
- <summary>
- Gets or sets the extension of the configuration file.
- </summary>
- <value>
- The extension of the configuration file.
- </value>
- <remarks>
- <para>
- If specified this is the extension for the configuration file.
- The path to the config file is built by using the <b>application
- base</b> directory (<see cref="P:System.AppDomain.BaseDirectory"/>),
- the <b>assembly file name</b> and the config file extension.
- </para>
- <para>
- If the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/> is set to <c>MyExt</c> then
- possible config file names would be: <c>MyConsoleApp.exe.MyExt</c> or
- <c>MyClassLibrary.dll.MyExt</c>.
- </para>
- <para>
- The <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> takes priority over the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.XmlConfiguratorAttribute.Watch">
- <summary>
- Gets or sets a value indicating whether to watch the configuration file.
- </summary>
- <value>
- <c>true</c> if the configuration should be watched, <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- If this flag is specified and set to <c>true</c> then the framework
- will watch the configuration file and will reload the config each time
- the file is modified.
- </para>
- <para>
- The config file can only be watched if it is loaded from local disk.
- In a No-Touch (Smart Client) deployment where the application is downloaded
- from a web server the config file may not reside on the local disk
- and therefore it may not be able to watch it.
- </para>
- <note>
- Watching configuration is not supported on the SSCLI.
- </note>
- </remarks>
- </member>
- <member name="T:log4net.Config.Log4NetConfigurationSectionHandler">
- <summary>
- Class to register for the log4net section of the configuration file
- </summary>
- <remarks>
- The log4net section of the configuration file needs to have a section
- handler registered. This is the section handler used. It simply returns
- the XML element that is the root of the section.
- </remarks>
- <example>
- Example of registering the log4net section handler :
- <code lang="XML" escaped="true">
- <configuration>
- <configSections>
- <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
- </configSections>
- <log4net>
- log4net configuration XML goes here
- </log4net>
- </configuration>
- </code>
- </example>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.Log4NetConfigurationSectionHandler.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.Log4NetConfigurationSectionHandler.Create(System.Object,System.Object,System.Xml.XmlNode)">
- <summary>
- Parses the configuration section.
- </summary>
- <param name="parent">The configuration settings in a corresponding parent configuration section.</param>
- <param name="configContext">The configuration context when called from the ASP.NET configuration system. Otherwise, this parameter is reserved and is a null reference.</param>
- <param name="section">The <see cref="T:System.Xml.XmlNode"/> for the log4net section.</param>
- <returns>The <see cref="T:System.Xml.XmlNode"/> for the log4net section.</returns>
- <remarks>
- <para>
- Returns the <see cref="T:System.Xml.XmlNode"/> containing the configuration data,
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.PluginAttribute">
- <summary>
- Assembly level attribute that specifies a plugin to attach to
- the repository.
- </summary>
- <remarks>
- <para>
- Specifies the type of a plugin to create and attach to the
- assembly's repository. The plugin type must implement the
- <see cref="T:log4net.Plugin.IPlugin"/> interface.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Plugin.IPluginFactory">
- <summary>
- Interface used to create plugins.
- </summary>
- <remarks>
- <para>
- Interface used to create a plugin.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Plugin.IPluginFactory.CreatePlugin">
- <summary>
- Creates the plugin object.
- </summary>
- <returns>the new plugin instance</returns>
- <remarks>
- <para>
- Create and return a new plugin instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.PluginAttribute.#ctor(System.String)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.PluginAttribute"/> class
- with the specified type.
- </summary>
- <param name="typeName">The type name of plugin to create.</param>
- <remarks>
- <para>
- Create the attribute with the plugin type specified.
- </para>
- <para>
- Where possible use the constructor that takes a <see cref="T:System.Type"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.PluginAttribute.#ctor(System.Type)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.PluginAttribute"/> class
- with the specified type.
- </summary>
- <param name="type">The type of plugin to create.</param>
- <remarks>
- <para>
- Create the attribute with the plugin type specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.PluginAttribute.CreatePlugin">
- <summary>
- Creates the plugin object defined by this attribute.
- </summary>
- <remarks>
- <para>
- Creates the instance of the <see cref="T:log4net.Plugin.IPlugin"/> object as
- specified by this attribute.
- </para>
- </remarks>
- <returns>The plugin object.</returns>
- </member>
- <member name="M:log4net.Config.PluginAttribute.ToString">
- <summary>
- Returns a representation of the properties of this object.
- </summary>
- <remarks>
- <para>
- Overrides base class <see cref="M:System.Object.ToString"/> method to
- return a representation of the properties of this object.
- </para>
- </remarks>
- <returns>A representation of the properties of this object</returns>
- </member>
- <member name="P:log4net.Config.PluginAttribute.Type">
- <summary>
- Gets or sets the type for the plugin.
- </summary>
- <value>
- The type for the plugin.
- </value>
- <remarks>
- <para>
- The type for the plugin.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.PluginAttribute.TypeName">
- <summary>
- Gets or sets the type name for the plugin.
- </summary>
- <value>
- The type name for the plugin.
- </value>
- <remarks>
- <para>
- The type name for the plugin.
- </para>
- <para>
- Where possible use the <see cref="P:log4net.Config.PluginAttribute.Type"/> property instead.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.SecurityContextProviderAttribute">
- <summary>
- Assembly level attribute to configure the <see cref="T:log4net.Core.SecurityContextProvider"/>.
- </summary>
- <remarks>
- <para>
- This attribute may only be used at the assembly scope and can only
- be used once per assembly.
- </para>
- <para>
- Use this attribute to configure the <see cref="T:log4net.Config.XmlConfigurator"/>
- without calling one of the <see cref="M:log4net.Config.XmlConfigurator.Configure"/>
- methods.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Config.SecurityContextProviderAttribute.#ctor(System.Type)">
- <summary>
- Construct provider attribute with type specified
- </summary>
- <param name="providerType">the type of the provider to use</param>
- <remarks>
- <para>
- The provider specified must subclass the <see cref="T:log4net.Core.SecurityContextProvider"/>
- class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.SecurityContextProviderAttribute.Configure(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Configures the SecurityContextProvider
- </summary>
- <param name="sourceAssembly">The assembly that this attribute was defined on.</param>
- <param name="targetRepository">The repository to configure.</param>
- <remarks>
- <para>
- Creates a provider instance from the <see cref="P:log4net.Config.SecurityContextProviderAttribute.ProviderType"/> specified.
- Sets this as the default security context provider <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.SecurityContextProviderAttribute.ProviderType">
- <summary>
- Gets or sets the type of the provider to use.
- </summary>
- <value>
- the type of the provider to use.
- </value>
- <remarks>
- <para>
- The provider specified must subclass the <see cref="T:log4net.Core.SecurityContextProvider"/>
- class.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.XmlConfigurator">
- <summary>
- Use this class to initialize the log4net environment using an Xml tree.
- </summary>
- <remarks>
- <para>
- Configures a <see cref="T:log4net.Repository.ILoggerRepository"/> using an Xml tree.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.#ctor">
- <summary>
- Private constructor
- </summary>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure">
- <summary>
- Automatically configures the log4net system based on the
- application's configuration settings.
- </summary>
- <remarks>
- <para>
- Each application has a configuration file. This has the
- same name as the application with '.config' appended.
- This file is XML and calling this function prompts the
- configurator to look in that file for a section called
- <c>log4net</c> that contains the configuration data.
- </para>
- <para>
- To use this method to configure log4net you must specify
- the <see cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/> section
- handler for the <c>log4net</c> configuration section. See the
- <see cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/> for an example.
- </para>
- </remarks>
- <seealso cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(log4net.Repository.ILoggerRepository)">
- <summary>
- Automatically configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using settings
- stored in the application's configuration file.
- </summary>
- <remarks>
- <para>
- Each application has a configuration file. This has the
- same name as the application with '.config' appended.
- This file is XML and calling this function prompts the
- configurator to look in that file for a section called
- <c>log4net</c> that contains the configuration data.
- </para>
- <para>
- To use this method to configure log4net you must specify
- the <see cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/> section
- handler for the <c>log4net</c> configuration section. See the
- <see cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/> for an example.
- </para>
- </remarks>
- <param name="repository">The repository to configure.</param>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(System.Xml.XmlElement)">
- <summary>
- Configures log4net using a <c>log4net</c> element
- </summary>
- <remarks>
- <para>
- Loads the log4net configuration from the XML element
- supplied as <paramref name="element"/>.
- </para>
- </remarks>
- <param name="element">The element to parse.</param>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(log4net.Repository.ILoggerRepository,System.Xml.XmlElement)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified XML
- element.
- </summary>
- <remarks>
- Loads the log4net configuration from the XML element
- supplied as <paramref name="element"/>.
- </remarks>
- <param name="repository">The repository to configure.</param>
- <param name="element">The element to parse.</param>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(System.IO.FileInfo)">
- <summary>
- Configures log4net using the specified configuration file.
- </summary>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the log4net configuration data.
- </para>
- <para>
- The log4net configuration file can possible be specified in the application's
- configuration file (either <c>MyAppName.exe.config</c> for a
- normal application on <c>Web.config</c> for an ASP.NET application).
- </para>
- <para>
- The first element matching <c>&lt;configuration&gt;</c> will be read as the
- configuration. If this file is also a .NET .config file then you must specify
- a configuration section for the <c>log4net</c> element otherwise .NET will
- complain. Set the type for the section handler to <see cref="T:System.Configuration.IgnoreSectionHandler"/>, for example:
- <code lang="XML" escaped="true">
- <configSections>
- <section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>
- </configSections>
- </code>
- </para>
- <example>
- The following example configures log4net using a configuration file, of which the
- location is stored in the application's configuration file :
- </example>
- <code lang="C#">
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
- </code>
- <para>
- In the <c>.config</c> file, the path to the log4net can be specified like this :
- </para>
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net-config-file" value="log.config"/>
- </appSettings>
- </configuration>
- </code>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(System.Uri)">
- <summary>
- Configures log4net using the specified configuration URI.
- </summary>
- <param name="configUri">A URI to load the XML configuration from.</param>
- <remarks>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the log4net configuration data.
- </para>
- <para>
- The <see cref="T:System.Net.WebRequest"/> must support the URI scheme specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(System.IO.Stream)">
- <summary>
- Configures log4net using the specified configuration data stream.
- </summary>
- <param name="configStream">A stream to load the XML configuration from.</param>
- <remarks>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the log4net configuration data.
- </para>
- <para>
- Note that this method will NOT close the stream parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified configuration
- file.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The log4net configuration file can possible be specified in the application's
- configuration file (either <c>MyAppName.exe.config</c> for a
- normal application on <c>Web.config</c> for an ASP.NET application).
- </para>
- <para>
- The first element matching <c>&lt;configuration&gt;</c> will be read as the
- configuration. If this file is also a .NET .config file then you must specify
- a configuration section for the <c>log4net</c> element otherwise .NET will
- complain. Set the type for the section handler to <see cref="T:System.Configuration.IgnoreSectionHandler"/>, for example:
- <code lang="XML" escaped="true">
- <configSections>
- <section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>
- </configSections>
- </code>
- </para>
- <example>
- The following example configures log4net using a configuration file, of which the
- location is stored in the application's configuration file :
- </example>
- <code lang="C#">
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
- </code>
- <para>
- In the <c>.config</c> file, the path to the log4net can be specified like this :
- </para>
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net-config-file" value="log.config"/>
- </appSettings>
- </configuration>
- </code>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(log4net.Repository.ILoggerRepository,System.Uri)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified configuration
- URI.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configUri">A URI to load the XML configuration from.</param>
- <remarks>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The <see cref="T:System.Net.WebRequest"/> must support the URI scheme specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(log4net.Repository.ILoggerRepository,System.IO.Stream)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified configuration
- file.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configStream">The stream to load the XML configuration from.</param>
- <remarks>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- Note that this method will NOT close the stream parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatch(System.IO.FileInfo)">
- <summary>
- Configures log4net using the file specified, monitors the file for changes
- and reloads the configuration if a change is detected.
- </summary>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The configuration file will be monitored using a <see cref="T:System.IO.FileSystemWatcher"/>
- and depends on the behavior of that class.
- </para>
- <para>
- For more information on how to configure log4net using
- a separate configuration file, see <see cref="M:log4net.Config.XmlConfigurator.Configure(System.IO.FileInfo)"/>.
- </para>
- </remarks>
- <seealso cref="M:log4net.Config.XmlConfigurator.Configure(System.IO.FileInfo)"/>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatch(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the file specified,
- monitors the file for changes and reloads the configuration if a change
- is detected.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The configuration file will be monitored using a <see cref="T:System.IO.FileSystemWatcher"/>
- and depends on the behavior of that class.
- </para>
- <para>
- For more information on how to configure log4net using
- a separate configuration file, see <see cref="M:log4net.Config.XmlConfigurator.Configure(System.IO.FileInfo)"/>.
- </para>
- </remarks>
- <seealso cref="M:log4net.Config.XmlConfigurator.Configure(System.IO.FileInfo)"/>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureFromXml(log4net.Repository.ILoggerRepository,System.Xml.XmlElement)">
- <summary>
- Configures the specified repository using a <c>log4net</c> element.
- </summary>
- <param name="repository">The hierarchy to configure.</param>
- <param name="element">The element to parse.</param>
- <remarks>
- <para>
- Loads the log4net configuration from the XML element
- supplied as <paramref name="element"/>.
- </para>
- <para>
- This method is ultimately called by one of the Configure methods
- to load the configuration from an <see cref="T:System.Xml.XmlElement"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler">
- <summary>
- Class used to watch config files.
- </summary>
- <remarks>
- <para>
- Uses the <see cref="T:System.IO.FileSystemWatcher"/> to monitor
- changes to a specified file. Because multiple change notifications
- may be raised when the file is modified, a timer is used to
- compress the notifications into a single event. The timer
- waits for <see cref="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.TimeoutMillis"/> time before delivering
- the event notification. If any further <see cref="T:System.IO.FileSystemWatcher"/>
- change notifications arrive while the timer is waiting it
- is reset and waits again for <see cref="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.TimeoutMillis"/> to
- elapse.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.TimeoutMillis">
- <summary>
- The default amount of time to wait after receiving notification
- before reloading the config file.
- </summary>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.StartWatching(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Watch a specified config file used to configure a repository
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The configuration file to watch.</param>
- <remarks>
- <para>
- Watch a specified config file used to configure a repository
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.m_configFile">
- <summary>
- Holds the FileInfo used to configure the XmlConfigurator
- </summary>
- </member>
- <member name="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.m_repository">
- <summary>
- Holds the repository being configured.
- </summary>
- </member>
- <member name="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.m_timer">
- <summary>
- The timer used to compress the notification events.
- </summary>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.#ctor(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler"/> class.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The configuration file to watch.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.ConfigureAndWatchHandler_OnChanged(System.Object,System.IO.FileSystemEventArgs)">
- <summary>
- Event handler used by <see cref="T:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler"/>.
- </summary>
- <param name="source">The <see cref="T:System.IO.FileSystemWatcher"/> firing the event.</param>
- <param name="e">The argument indicates the file that caused the event to be fired.</param>
- <remarks>
- <para>
- This handler reloads the configuration from the file when the event is fired.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.ConfigureAndWatchHandler_OnRenamed(System.Object,System.IO.RenamedEventArgs)">
- <summary>
- Event handler used by <see cref="T:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler"/>.
- </summary>
- <param name="source">The <see cref="T:System.IO.FileSystemWatcher"/> firing the event.</param>
- <param name="e">The argument indicates the file that caused the event to be fired.</param>
- <remarks>
- <para>
- This handler reloads the configuration from the file when the event is fired.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.OnWatchedFileChange(System.Object)">
- <summary>
- Called by the timer when the configuration has been updated.
- </summary>
- <param name="state">null</param>
- </member>
- <member name="T:log4net.Core.CompactRepositorySelector">
- <summary>
- The implementation of the <see cref="T:log4net.Core.IRepositorySelector"/> interface suitable
- for use with the compact framework
- </summary>
- <remarks>
- <para>
- This <see cref="T:log4net.Core.IRepositorySelector"/> implementation is a simple
- mapping between repository name and <see cref="T:log4net.Repository.ILoggerRepository"/>
- object.
- </para>
- <para>
- The .NET Compact Framework 1.0 does not support retrieving assembly
- level attributes therefore unlike the <c>DefaultRepositorySelector</c>
- this selector does not examine the calling assembly for attributes.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Core.IRepositorySelector">
- <summary>
- Interface used by the <see cref="T:log4net.LogManager"/> to select the <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.LogManager"/> uses a <see cref="T:log4net.Core.IRepositorySelector"/>
- to specify the policy for selecting the correct <see cref="T:log4net.Repository.ILoggerRepository"/>
- to return to the caller.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.GetRepository(System.Reflection.Assembly)">
- <summary>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly.
- </summary>
- <param name="assembly">The assembly to use to lookup to the <see cref="T:log4net.Repository.ILoggerRepository"/></param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> for the assembly.</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly.
- </para>
- <para>
- How the association between <see cref="T:System.Reflection.Assembly"/> and <see cref="T:log4net.Repository.ILoggerRepository"/>
- is made is not defined. The implementation may choose any method for
- this association. The results of this method must be repeatable, i.e.
- when called again with the same arguments the result must be the
- save value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.GetRepository(System.String)">
- <summary>
- Gets the named <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </summary>
- <param name="repositoryName">The name to use to lookup to the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <returns>The named <see cref="T:log4net.Repository.ILoggerRepository"/></returns>
- <remarks>
- Lookup a named <see cref="T:log4net.Repository.ILoggerRepository"/>. This is the repository created by
- calling <see cref="M:log4net.Core.IRepositorySelector.CreateRepository(System.String,System.Type)"/>.
- </remarks>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.CreateRepository(System.Reflection.Assembly,System.Type)">
- <summary>
- Creates a new repository for the assembly specified.
- </summary>
- <param name="assembly">The assembly to use to create the domain to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryType">The type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <returns>The repository created.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the domain
- specified such that a call to <see cref="M:log4net.Core.IRepositorySelector.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- <para>
- How the association between <see cref="T:System.Reflection.Assembly"/> and <see cref="T:log4net.Repository.ILoggerRepository"/>
- is made is not defined. The implementation may choose any method for
- this association.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.CreateRepository(System.String,System.Type)">
- <summary>
- Creates a new repository with the name specified.
- </summary>
- <param name="repositoryName">The name to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryType">The type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <returns>The repository created.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the name
- specified such that a call to <see cref="M:log4net.Core.IRepositorySelector.GetRepository(System.String)"/> with the
- same name will return the same repository instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.ExistsRepository(System.String)">
- <summary>
- Test if a named repository exists
- </summary>
- <param name="repositoryName">the named repository to check</param>
- <returns><c>true</c> if the repository exists</returns>
- <remarks>
- <para>
- Test if a named repository exists. Use <see cref="M:log4net.Core.IRepositorySelector.CreateRepository(System.Reflection.Assembly,System.Type)"/>
- to create a new repository and <see cref="M:log4net.Core.IRepositorySelector.GetRepository(System.Reflection.Assembly)"/> to retrieve
- a repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.GetAllRepositories">
- <summary>
- Gets an array of all currently defined repositories.
- </summary>
- <returns>
- An array of the <see cref="T:log4net.Repository.ILoggerRepository"/> instances created by
- this <see cref="T:log4net.Core.IRepositorySelector"/>.</returns>
- <remarks>
- <para>
- Gets an array of all of the repositories created by this selector.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Core.IRepositorySelector.LoggerRepositoryCreatedEvent">
- <summary>
- Event to notify that a logger repository has been created.
- </summary>
- <value>
- Event to notify that a logger repository has been created.
- </value>
- <remarks>
- <para>
- Event raised when a new repository is created.
- The event source will be this selector. The event args will
- be a <see cref="T:log4net.Core.LoggerRepositoryCreationEventArgs"/> which
- holds the newly created <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.#ctor(System.Type)">
- <summary>
- Create a new repository selector
- </summary>
- <param name="defaultRepositoryType">the type of the repositories to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/></param>
- <remarks>
- <para>
- Create an new compact repository selector.
- The default type for repositories must be specified,
- an appropriate value would be <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">throw if <paramref name="defaultRepositoryType"/> is null</exception>
- <exception cref="T:System.ArgumentOutOfRangeException">throw if <paramref name="defaultRepositoryType"/> does not implement <see cref="T:log4net.Repository.ILoggerRepository"/></exception>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.GetRepository(System.Reflection.Assembly)">
- <summary>
- Get the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly
- </summary>
- <param name="assembly">not used</param>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/></returns>
- <remarks>
- <para>
- The <paramref name="assembly"/> argument is not used. This selector does not create a
- separate repository for each assembly.
- </para>
- <para>
- As a named repository is not specified the default repository is
- returned. The default repository is named <c>log4net-default-repository</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.GetRepository(System.String)">
- <summary>
- Get the named <see cref="T:log4net.Repository.ILoggerRepository"/>
- </summary>
- <param name="repositoryName">the name of the repository to lookup</param>
- <returns>The named <see cref="T:log4net.Repository.ILoggerRepository"/></returns>
- <remarks>
- <para>
- Get the named <see cref="T:log4net.Repository.ILoggerRepository"/>. The default
- repository is <c>log4net-default-repository</c>. Other repositories
- must be created using the <see cref="M:log4net.Core.CompactRepositorySelector.CreateRepository(System.String,System.Type)"/>.
- If the named repository does not exist an exception is thrown.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">throw if <paramref name="repositoryName"/> is null</exception>
- <exception cref="T:log4net.Core.LogException">throw if the <paramref name="repositoryName"/> does not exist</exception>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.CreateRepository(System.Reflection.Assembly,System.Type)">
- <summary>
- Create a new repository for the assembly specified
- </summary>
- <param name="assembly">not used</param>
- <param name="repositoryType">the type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/></param>
- <returns>the repository created</returns>
- <remarks>
- <para>
- The <paramref name="assembly"/> argument is not used. This selector does not create a
- separate repository for each assembly.
- </para>
- <para>
- If the <paramref name="repositoryType"/> is <c>null</c> then the
- default repository type specified to the constructor is used.
- </para>
- <para>
- As a named repository is not specified the default repository is
- returned. The default repository is named <c>log4net-default-repository</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.CreateRepository(System.String,System.Type)">
- <summary>
- Create a new repository for the repository specified
- </summary>
- <param name="repositoryName">the repository to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/></param>
- <param name="repositoryType">the type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.
- If this param is null then the default repository type is used.</param>
- <returns>the repository created</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.CompactRepositorySelector.GetRepository(System.String)"/> with the
- same repository specified will return the same repository instance.
- </para>
- <para>
- If the named repository already exists an exception will be thrown.
- </para>
- <para>
- If <paramref name="repositoryType"/> is <c>null</c> then the default
- repository type specified to the constructor is used.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">throw if <paramref name="repositoryName"/> is null</exception>
- <exception cref="T:log4net.Core.LogException">throw if the <paramref name="repositoryName"/> already exists</exception>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.ExistsRepository(System.String)">
- <summary>
- Test if a named repository exists
- </summary>
- <param name="repositoryName">the named repository to check</param>
- <returns><c>true</c> if the repository exists</returns>
- <remarks>
- <para>
- Test if a named repository exists. Use <see cref="M:log4net.Core.CompactRepositorySelector.CreateRepository(System.String,System.Type)"/>
- to create a new repository and <see cref="M:log4net.Core.CompactRepositorySelector.GetRepository(System.String)"/> to retrieve
- a repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.GetAllRepositories">
- <summary>
- Gets a list of <see cref="T:log4net.Repository.ILoggerRepository"/> objects
- </summary>
- <returns>an array of all known <see cref="T:log4net.Repository.ILoggerRepository"/> objects</returns>
- <remarks>
- <para>
- Gets an array of all of the repositories created by this selector.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.OnLoggerRepositoryCreatedEvent(log4net.Repository.ILoggerRepository)">
- <summary>
- Notify the registered listeners that the repository has been created
- </summary>
- <param name="repository">The repository that has been created</param>
- <remarks>
- <para>
- Raises the <event cref="E:log4net.Core.CompactRepositorySelector.LoggerRepositoryCreatedEvent">LoggerRepositoryCreatedEvent</event>
- event.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Core.CompactRepositorySelector.LoggerRepositoryCreatedEvent">
- <summary>
- Event to notify that a logger repository has been created.
- </summary>
- <value>
- Event to notify that a logger repository has been created.
- </value>
- <remarks>
- <para>
- Event raised when a new repository is created.
- The event source will be this selector. The event args will
- be a <see cref="T:log4net.Core.LoggerRepositoryCreationEventArgs"/> which
- holds the newly created <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.DefaultRepositorySelector">
- <summary>
- The default implementation of the <see cref="T:log4net.Core.IRepositorySelector"/> interface.
- </summary>
- <remarks>
- <para>
- Uses attributes defined on the calling assembly to determine how to
- configure the hierarchy for the repository.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.#ctor(System.Type)">
- <summary>
- Creates a new repository selector.
- </summary>
- <param name="defaultRepositoryType">The type of the repositories to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/></param>
- <remarks>
- <para>
- Create an new repository selector.
- The default type for repositories must be specified,
- an appropriate value would be <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException"><paramref name="defaultRepositoryType"/> is <see langword="null"/>.</exception>
- <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="defaultRepositoryType"/> does not implement <see cref="T:log4net.Repository.ILoggerRepository"/>.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.Reflection.Assembly)">
- <summary>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly.
- </summary>
- <param name="repositoryAssembly">The assembly use to lookup the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <remarks>
- <para>
- The type of the <see cref="T:log4net.Repository.ILoggerRepository"/> created and the repository
- to create can be overridden by specifying the <see cref="T:log4net.Config.RepositoryAttribute"/>
- attribute on the <paramref name="repositoryAssembly"/>.
- </para>
- <para>
- The default values are to use the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>
- implementation of the <see cref="T:log4net.Repository.ILoggerRepository"/> interface and to use the
- <see cref="P:System.Reflection.AssemblyName.Name"/> as the name of the repository.
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be automatically configured using
- any <see cref="T:log4net.Config.ConfiguratorAttribute"/> attributes defined on
- the <paramref name="repositoryAssembly"/>.
- </para>
- </remarks>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> for the assembly</returns>
- <exception cref="T:System.ArgumentNullException"><paramref name="repositoryAssembly"/> is <see langword="null"/>.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.String)">
- <summary>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified repository.
- </summary>
- <param name="repositoryName">The repository to use to lookup the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified repository.</returns>
- <remarks>
- <para>
- Returns the named repository. If <paramref name="repositoryName"/> is <c>null</c>
- a <see cref="T:System.ArgumentNullException"/> is thrown. If the repository
- does not exist a <see cref="T:log4net.Core.LogException"/> is thrown.
- </para>
- <para>
- Use <see cref="M:log4net.Core.DefaultRepositorySelector.CreateRepository(System.String,System.Type)"/> to create a repository.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException"><paramref name="repositoryName"/> is <see langword="null"/>.</exception>
- <exception cref="T:log4net.Core.LogException"><paramref name="repositoryName"/> does not exist.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.CreateRepository(System.Reflection.Assembly,System.Type)">
- <summary>
- Create a new repository for the assembly specified
- </summary>
- <param name="repositoryAssembly">the assembly to use to create the repository to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryType">The type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <returns>The repository created.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- <para>
- The type of the <see cref="T:log4net.Repository.ILoggerRepository"/> created and
- the repository to create can be overridden by specifying the
- <see cref="T:log4net.Config.RepositoryAttribute"/> attribute on the
- <paramref name="repositoryAssembly"/>. The default values are to use the
- <paramref name="repositoryType"/> implementation of the
- <see cref="T:log4net.Repository.ILoggerRepository"/> interface and to use the
- <see cref="P:System.Reflection.AssemblyName.Name"/> as the name of the repository.
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be automatically
- configured using any <see cref="T:log4net.Config.ConfiguratorAttribute"/>
- attributes defined on the <paramref name="repositoryAssembly"/>.
- </para>
- <para>
- If a repository for the <paramref name="repositoryAssembly"/> already exists
- that repository will be returned. An error will not be raised and that
- repository may be of a different type to that specified in <paramref name="repositoryType"/>.
- Also the <see cref="T:log4net.Config.RepositoryAttribute"/> attribute on the
- assembly may be used to override the repository type specified in
- <paramref name="repositoryType"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException"><paramref name="repositoryAssembly"/> is <see langword="null"/>.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.CreateRepository(System.Reflection.Assembly,System.Type,System.String,System.Boolean)">
- <summary>
- Creates a new repository for the assembly specified.
- </summary>
- <param name="repositoryAssembly">the assembly to use to create the repository to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryType">The type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryName">The name to assign to the created repository</param>
- <param name="readAssemblyAttributes">Set to <c>true</c> to read and apply the assembly attributes</param>
- <returns>The repository created.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- <para>
- The type of the <see cref="T:log4net.Repository.ILoggerRepository"/> created and
- the repository to create can be overridden by specifying the
- <see cref="T:log4net.Config.RepositoryAttribute"/> attribute on the
- <paramref name="repositoryAssembly"/>. The default values are to use the
- <paramref name="repositoryType"/> implementation of the
- <see cref="T:log4net.Repository.ILoggerRepository"/> interface and to use the
- <see cref="P:System.Reflection.AssemblyName.Name"/> as the name of the repository.
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be automatically
- configured using any <see cref="T:log4net.Config.ConfiguratorAttribute"/>
- attributes defined on the <paramref name="repositoryAssembly"/>.
- </para>
- <para>
- If a repository for the <paramref name="repositoryAssembly"/> already exists
- that repository will be returned. An error will not be raised and that
- repository may be of a different type to that specified in <paramref name="repositoryType"/>.
- Also the <see cref="T:log4net.Config.RepositoryAttribute"/> attribute on the
- assembly may be used to override the repository type specified in
- <paramref name="repositoryType"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException"><paramref name="repositoryAssembly"/> is <see langword="null"/>.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.CreateRepository(System.String,System.Type)">
- <summary>
- Creates a new repository for the specified repository.
- </summary>
- <param name="repositoryName">The repository to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryType">The type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.
- If this param is <see langword="null"/> then the default repository type is used.</param>
- <returns>The new repository.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.String)"/> with the
- same repository specified will return the same repository instance.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException"><paramref name="repositoryName"/> is <see langword="null"/>.</exception>
- <exception cref="T:log4net.Core.LogException"><paramref name="repositoryName"/> already exists.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.ExistsRepository(System.String)">
- <summary>
- Test if a named repository exists
- </summary>
- <param name="repositoryName">the named repository to check</param>
- <returns><c>true</c> if the repository exists</returns>
- <remarks>
- <para>
- Test if a named repository exists. Use <see cref="M:log4net.Core.DefaultRepositorySelector.CreateRepository(System.String,System.Type)"/>
- to create a new repository and <see cref="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.String)"/> to retrieve
- a repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.GetAllRepositories">
- <summary>
- Gets a list of <see cref="T:log4net.Repository.ILoggerRepository"/> objects
- </summary>
- <returns>an array of all known <see cref="T:log4net.Repository.ILoggerRepository"/> objects</returns>
- <remarks>
- <para>
- Gets an array of all of the repositories created by this selector.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.AliasRepository(System.String,log4net.Repository.ILoggerRepository)">
- <summary>
- Aliases a repository to an existing repository.
- </summary>
- <param name="repositoryAlias">The repository to alias.</param>
- <param name="repositoryTarget">The repository that the repository is aliased to.</param>
- <remarks>
- <para>
- The repository specified will be aliased to the repository when created.
- The repository must not already exist.
- </para>
- <para>
- When the repository is created it must utilize the same repository type as
- the repository it is aliased to, otherwise the aliasing will fail.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">
- <para><paramref name="repositoryAlias"/> is <see langword="null"/>.</para>
- <para>-or-</para>
- <para><paramref name="repositoryTarget"/> is <see langword="null"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.OnLoggerRepositoryCreatedEvent(log4net.Repository.ILoggerRepository)">
- <summary>
- Notifies the registered listeners that the repository has been created.
- </summary>
- <param name="repository">The repository that has been created.</param>
- <remarks>
- <para>
- Raises the <see cref="E:log4net.Core.DefaultRepositorySelector.LoggerRepositoryCreatedEvent"/> event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.GetInfoForAssembly(System.Reflection.Assembly,System.String@,System.Type@)">
- <summary>
- Gets the repository name and repository type for the specified assembly.
- </summary>
- <param name="assembly">The assembly that has a <see cref="T:log4net.Config.RepositoryAttribute"/>.</param>
- <param name="repositoryName">in/out param to hold the repository name to use for the assembly, caller should set this to the default value before calling.</param>
- <param name="repositoryType">in/out param to hold the type of the repository to create for the assembly, caller should set this to the default value before calling.</param>
- <exception cref="T:System.ArgumentNullException"><paramref name="assembly"/> is <see langword="null"/>.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.ConfigureRepository(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Configures the repository using information from the assembly.
- </summary>
- <param name="assembly">The assembly containing <see cref="T:log4net.Config.ConfiguratorAttribute"/>
- attributes which define the configuration for the repository.</param>
- <param name="repository">The repository to configure.</param>
- <exception cref="T:System.ArgumentNullException">
- <para><paramref name="assembly"/> is <see langword="null"/>.</para>
- <para>-or-</para>
- <para><paramref name="repository"/> is <see langword="null"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.LoadPlugins(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Loads the attribute defined plugins on the assembly.
- </summary>
- <param name="assembly">The assembly that contains the attributes.</param>
- <param name="repository">The repository to add the plugins to.</param>
- <exception cref="T:System.ArgumentNullException">
- <para><paramref name="assembly"/> is <see langword="null"/>.</para>
- <para>-or-</para>
- <para><paramref name="repository"/> is <see langword="null"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.LoadAliases(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Loads the attribute defined aliases on the assembly.
- </summary>
- <param name="assembly">The assembly that contains the attributes.</param>
- <param name="repository">The repository to alias to.</param>
- <exception cref="T:System.ArgumentNullException">
- <para><paramref name="assembly"/> is <see langword="null"/>.</para>
- <para>-or-</para>
- <para><paramref name="repository"/> is <see langword="null"/>.</para>
- </exception>
- </member>
- <member name="E:log4net.Core.DefaultRepositorySelector.LoggerRepositoryCreatedEvent">
- <summary>
- Event to notify that a logger repository has been created.
- </summary>
- <value>
- Event to notify that a logger repository has been created.
- </value>
- <remarks>
- <para>
- Event raised when a new repository is created.
- The event source will be this selector. The event args will
- be a <see cref="T:log4net.Core.LoggerRepositoryCreationEventArgs"/> which
- holds the newly created <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.ErrorCode">
- <summary>
- Defined error codes that can be passed to the <see cref="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)"/> method.
- </summary>
- <remarks>
- <para>
- Values passed to the <see cref="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)"/> method.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.ErrorCode.GenericFailure">
- <summary>
- A general error
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.WriteFailure">
- <summary>
- Error while writing output
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.FlushFailure">
- <summary>
- Failed to flush file
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.CloseFailure">
- <summary>
- Failed to close file
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.FileOpenFailure">
- <summary>
- Unable to open output file
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.MissingLayout">
- <summary>
- No layout specified
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.AddressParseFailure">
- <summary>
- Failed to parse address
- </summary>
- </member>
- <member name="T:log4net.Core.IErrorHandler">
- <summary>
- Appenders may delegate their error handling to an <see cref="T:log4net.Core.IErrorHandler"/>.
- </summary>
- <remarks>
- <para>
- Error handling is a particularly tedious to get right because by
- definition errors are hard to predict and to reproduce.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)">
- <summary>
- Handles the error and information about the error condition is passed as
- a parameter.
- </summary>
- <param name="message">The message associated with the error.</param>
- <param name="e">The <see cref="T:System.Exception"/> that was thrown when the error occurred.</param>
- <param name="errorCode">The error code associated with the error.</param>
- <remarks>
- <para>
- Handles the error and information about the error condition is passed as
- a parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception)">
- <summary>
- Prints the error message passed as a parameter.
- </summary>
- <param name="message">The message associated with the error.</param>
- <param name="e">The <see cref="T:System.Exception"/> that was thrown when the error occurred.</param>
- <remarks>
- <para>
- See <see cref="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IErrorHandler.Error(System.String)">
- <summary>
- Prints the error message passed as a parameter.
- </summary>
- <param name="message">The message associated with the error.</param>
- <remarks>
- <para>
- See <see cref="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.IFixingRequired">
- <summary>
- Interface for objects that require fixing.
- </summary>
- <remarks>
- <para>
- Interface that indicates that the object requires fixing before it
- can be taken outside the context of the appender's
- <see cref="M:log4net.Appender.IAppender.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </para>
- <para>
- When objects that implement this interface are stored
- in the context properties maps <see cref="T:log4net.GlobalContext"/>
- <see cref="P:log4net.GlobalContext.Properties"/> and <see cref="T:log4net.ThreadContext"/>
- <see cref="P:log4net.ThreadContext.Properties"/> are fixed
- (see <see cref="P:log4net.Core.LoggingEvent.Fix"/>) the <see cref="M:log4net.Core.IFixingRequired.GetFixedObject"/>
- method will be called.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Core.IFixingRequired.GetFixedObject">
- <summary>
- Get a portable version of this object
- </summary>
- <returns>the portable instance of this object</returns>
- <remarks>
- <para>
- Get a portable instance object that represents the current
- state of this object. The portable object can be stored
- and logged from any thread with identical results.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.ILogger">
- <summary>
- Interface that all loggers implement
- </summary>
- <remarks>
- <para>
- This interface supports logging events and testing if a level
- is enabled for logging.
- </para>
- <para>
- These methods will not throw exceptions. Note to implementor, ensure
- that the implementation of these methods cannot allow an exception
- to be thrown to the caller.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.ILogger.Log(System.Type,log4net.Core.Level,System.Object,System.Exception)">
- <summary>
- This generic form is intended to be used by wrappers.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="level">The level of the message to be logged.</param>
- <param name="message">The message object to log.</param>
- <param name="exception">the exception to log, including its stack trace. Pass <c>null</c> to not log an exception.</param>
- <remarks>
- <para>
- Generates a logging event for the specified <paramref name="level"/> using
- the <paramref name="message"/> and <paramref name="exception"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.ILogger.Log(log4net.Core.LoggingEvent)">
- <summary>
- This is the most generic printing method that is intended to be used
- by wrappers.
- </summary>
- <param name="logEvent">The event being logged.</param>
- <remarks>
- <para>
- Logs the specified logging event through this logger.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.ILogger.IsEnabledFor(log4net.Core.Level)">
- <summary>
- Checks if this logger is enabled for a given <see cref="T:log4net.Core.Level"/> passed as parameter.
- </summary>
- <param name="level">The level to check.</param>
- <returns>
- <c>true</c> if this logger is enabled for <c>level</c>, otherwise <c>false</c>.
- </returns>
- <remarks>
- <para>
- Test if this logger is going to log events of the specified <paramref name="level"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.ILogger.Name">
- <summary>
- Gets the name of the logger.
- </summary>
- <value>
- The name of the logger.
- </value>
- <remarks>
- <para>
- The name of this logger
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.ILogger.Repository">
- <summary>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> where this
- <c>Logger</c> instance is attached to.
- </summary>
- <value>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that this logger belongs to.
- </value>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> where this
- <c>Logger</c> instance is attached to.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.ILoggerWrapper">
- <summary>
- Base interface for all wrappers
- </summary>
- <remarks>
- <para>
- Base interface for all wrappers.
- </para>
- <para>
- All wrappers must implement this interface.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="P:log4net.Core.ILoggerWrapper.Logger">
- <summary>
- Get the implementation behind this wrapper object.
- </summary>
- <value>
- The <see cref="T:log4net.Core.ILogger"/> object that in implementing this object.
- </value>
- <remarks>
- <para>
- The <see cref="T:log4net.Core.ILogger"/> object that in implementing this
- object. The <c>Logger</c> object may not
- be the same object as this object because of logger decorators.
- This gets the actual underlying objects that is used to process
- the log events.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggerRepositoryCreationEventHandler">
- <summary>
- Delegate used to handle logger repository creation event notifications
- </summary>
- <param name="sender">The <see cref="T:log4net.Core.IRepositorySelector"/> which created the repository.</param>
- <param name="e">The <see cref="T:log4net.Core.LoggerRepositoryCreationEventArgs"/> event args
- that holds the <see cref="T:log4net.Repository.ILoggerRepository"/> instance that has been created.</param>
- <remarks>
- <para>
- Delegate used to handle logger repository creation event notifications.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggerRepositoryCreationEventArgs">
- <summary>
- Provides data for the <see cref="E:log4net.Core.IRepositorySelector.LoggerRepositoryCreatedEvent"/> event.
- </summary>
- <remarks>
- <para>
- A <see cref="E:log4net.Core.IRepositorySelector.LoggerRepositoryCreatedEvent"/>
- event is raised every time a <see cref="T:log4net.Repository.ILoggerRepository"/> is created.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggerRepositoryCreationEventArgs.m_repository">
- <summary>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created
- </summary>
- </member>
- <member name="M:log4net.Core.LoggerRepositoryCreationEventArgs.#ctor(log4net.Repository.ILoggerRepository)">
- <summary>
- Construct instance using <see cref="T:log4net.Repository.ILoggerRepository"/> specified
- </summary>
- <param name="repository">the <see cref="T:log4net.Repository.ILoggerRepository"/> that has been created</param>
- <remarks>
- <para>
- Construct instance using <see cref="T:log4net.Repository.ILoggerRepository"/> specified
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggerRepositoryCreationEventArgs.LoggerRepository">
- <summary>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that has been created
- </summary>
- <value>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that has been created
- </value>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that has been created
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.ITriggeringEventEvaluator">
- <summary>
- Test if an <see cref="T:log4net.Core.LoggingEvent"/> triggers an action
- </summary>
- <remarks>
- <para>
- Implementations of this interface allow certain appenders to decide
- when to perform an appender specific action.
- </para>
- <para>
- The action or behavior triggered is defined by the implementation.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Core.ITriggeringEventEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)">
- <summary>
- Test if this event triggers the action
- </summary>
- <param name="loggingEvent">The event to check</param>
- <returns><c>true</c> if this event triggers the action, otherwise <c>false</c></returns>
- <remarks>
- <para>
- Return <c>true</c> if this event triggers the action
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.Level">
- <summary>
- Defines the default set of levels recognized by the system.
- </summary>
- <remarks>
- <para>
- Each <see cref="T:log4net.Core.LoggingEvent"/> has an associated <see cref="T:log4net.Core.Level"/>.
- </para>
- <para>
- Levels have a numeric <see cref="P:log4net.Core.Level.Value"/> that defines the relative
- ordering between levels. Two Levels with the same <see cref="P:log4net.Core.Level.Value"/>
- are deemed to be equivalent.
- </para>
- <para>
- The levels that are recognized by log4net are set for each <see cref="T:log4net.Repository.ILoggerRepository"/>
- and each repository can have different levels defined. The levels are stored
- in the <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/> on the repository. Levels are
- looked up by name from the <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>.
- </para>
- <para>
- When logging at level INFO the actual level used is not <see cref="F:log4net.Core.Level.Info"/> but
- the value of <c>LoggerRepository.LevelMap["INFO"]</c>. The default value for this is
- <see cref="F:log4net.Core.Level.Info"/>, but this can be changed by reconfiguring the level map.
- </para>
- <para>
- Each level has a <see cref="P:log4net.Core.Level.DisplayName"/> in addition to its <see cref="P:log4net.Core.Level.Name"/>. The
- <see cref="P:log4net.Core.Level.DisplayName"/> is the string that is written into the output log. By default
- the display name is the same as the level name, but this can be used to alias levels
- or to localize the log output.
- </para>
- <para>
- Some of the predefined levels recognized by the system are:
- </para>
- <list type="bullet">
- <item>
- <description><see cref="F:log4net.Core.Level.Off"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.Fatal"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.Error"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.Warn"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.Info"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.Debug"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.All"/>.</description>
- </item>
- </list>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.Level.#ctor(System.Int32,System.String,System.String)">
- <summary>
- Constructor
- </summary>
- <param name="level">Integer value for this level, higher values represent more severe levels.</param>
- <param name="levelName">The string name of this level.</param>
- <param name="displayName">The display name for this level. This may be localized or otherwise different from the name</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.Level"/> class with
- the specified level name and value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.#ctor(System.Int32,System.String)">
- <summary>
- Constructor
- </summary>
- <param name="level">Integer value for this level, higher values represent more severe levels.</param>
- <param name="levelName">The string name of this level.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.Level"/> class with
- the specified level name and value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.ToString">
- <summary>
- Returns the <see cref="T:System.String"/> representation of the current
- <see cref="T:log4net.Core.Level"/>.
- </summary>
- <returns>
- A <see cref="T:System.String"/> representation of the current <see cref="T:log4net.Core.Level"/>.
- </returns>
- <remarks>
- <para>
- Returns the level <see cref="P:log4net.Core.Level.Name"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.Equals(System.Object)">
- <summary>
- Compares levels.
- </summary>
- <param name="o">The object to compare against.</param>
- <returns><c>true</c> if the objects are equal.</returns>
- <remarks>
- <para>
- Compares the levels of <see cref="T:log4net.Core.Level"/> instances, and
- defers to base class if the target object is not a <see cref="T:log4net.Core.Level"/>
- instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.GetHashCode">
- <summary>
- Returns a hash code
- </summary>
- <returns>A hash code for the current <see cref="T:log4net.Core.Level"/>.</returns>
- <remarks>
- <para>
- Returns a hash code suitable for use in hashing algorithms and data
- structures like a hash table.
- </para>
- <para>
- Returns the hash code of the level <see cref="P:log4net.Core.Level.Value"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.CompareTo(System.Object)">
- <summary>
- Compares this instance to a specified object and returns an
- indication of their relative values.
- </summary>
- <param name="r">A <see cref="T:log4net.Core.Level"/> instance or <see langword="null"/> to compare with this instance.</param>
- <returns>
- A 32-bit signed integer that indicates the relative order of the
- values compared. The return value has these meanings:
- <list type="table">
- <listheader>
- <term>Value</term>
- <description>Meaning</description>
- </listheader>
- <item>
- <term>Less than zero</term>
- <description>This instance is less than <paramref name="r"/>.</description>
- </item>
- <item>
- <term>Zero</term>
- <description>This instance is equal to <paramref name="r"/>.</description>
- </item>
- <item>
- <term>Greater than zero</term>
- <description>
- <para>This instance is greater than <paramref name="r"/>.</para>
- <para>-or-</para>
- <para><paramref name="r"/> is <see langword="null"/>.</para>
- </description>
- </item>
- </list>
- </returns>
- <remarks>
- <para>
- <paramref name="r"/> must be an instance of <see cref="T:log4net.Core.Level"/>
- or <see langword="null"/>; otherwise, an exception is thrown.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentException"><paramref name="r"/> is not a <see cref="T:log4net.Core.Level"/>.</exception>
- </member>
- <member name="M:log4net.Core.Level.op_GreaterThan(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether a specified <see cref="T:log4net.Core.Level"/>
- is greater than another specified <see cref="T:log4net.Core.Level"/>.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/></param>
- <param name="r">A <see cref="T:log4net.Core.Level"/></param>
- <returns>
- <c>true</c> if <paramref name="l"/> is greater than
- <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.op_LessThan(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether a specified <see cref="T:log4net.Core.Level"/>
- is less than another specified <see cref="T:log4net.Core.Level"/>.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/></param>
- <param name="r">A <see cref="T:log4net.Core.Level"/></param>
- <returns>
- <c>true</c> if <paramref name="l"/> is less than
- <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.op_GreaterThanOrEqual(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether a specified <see cref="T:log4net.Core.Level"/>
- is greater than or equal to another specified <see cref="T:log4net.Core.Level"/>.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/></param>
- <param name="r">A <see cref="T:log4net.Core.Level"/></param>
- <returns>
- <c>true</c> if <paramref name="l"/> is greater than or equal to
- <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.op_LessThanOrEqual(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether a specified <see cref="T:log4net.Core.Level"/>
- is less than or equal to another specified <see cref="T:log4net.Core.Level"/>.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/></param>
- <param name="r">A <see cref="T:log4net.Core.Level"/></param>
- <returns>
- <c>true</c> if <paramref name="l"/> is less than or equal to
- <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.op_Equality(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether two specified <see cref="T:log4net.Core.Level"/>
- objects have the same value.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/> or <see langword="null"/>.</param>
- <param name="r">A <see cref="T:log4net.Core.Level"/> or <see langword="null"/>.</param>
- <returns>
- <c>true</c> if the value of <paramref name="l"/> is the same as the
- value of <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.op_Inequality(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether two specified <see cref="T:log4net.Core.Level"/>
- objects have different values.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/> or <see langword="null"/>.</param>
- <param name="r">A <see cref="T:log4net.Core.Level"/> or <see langword="null"/>.</param>
- <returns>
- <c>true</c> if the value of <paramref name="l"/> is different from
- the value of <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.Compare(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Compares two specified <see cref="T:log4net.Core.Level"/> instances.
- </summary>
- <param name="l">The first <see cref="T:log4net.Core.Level"/> to compare.</param>
- <param name="r">The second <see cref="T:log4net.Core.Level"/> to compare.</param>
- <returns>
- A 32-bit signed integer that indicates the relative order of the
- two values compared. The return value has these meanings:
- <list type="table">
- <listheader>
- <term>Value</term>
- <description>Meaning</description>
- </listheader>
- <item>
- <term>Less than zero</term>
- <description><paramref name="l"/> is less than <paramref name="r"/>.</description>
- </item>
- <item>
- <term>Zero</term>
- <description><paramref name="l"/> is equal to <paramref name="r"/>.</description>
- </item>
- <item>
- <term>Greater than zero</term>
- <description><paramref name="l"/> is greater than <paramref name="r"/>.</description>
- </item>
- </list>
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.Level.Off">
- <summary>
- The <see cref="F:log4net.Core.Level.Off"/> level designates a higher level than all the rest.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Emergency">
- <summary>
- The <see cref="F:log4net.Core.Level.Emergency"/> level designates very severe error events.
- System unusable, emergencies.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Fatal">
- <summary>
- The <see cref="F:log4net.Core.Level.Fatal"/> level designates very severe error events
- that will presumably lead the application to abort.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Alert">
- <summary>
- The <see cref="F:log4net.Core.Level.Alert"/> level designates very severe error events.
- Take immediate action, alerts.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Critical">
- <summary>
- The <see cref="F:log4net.Core.Level.Critical"/> level designates very severe error events.
- Critical condition, critical.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Severe">
- <summary>
- The <see cref="F:log4net.Core.Level.Severe"/> level designates very severe error events.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Error">
- <summary>
- The <see cref="F:log4net.Core.Level.Error"/> level designates error events that might
- still allow the application to continue running.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Warn">
- <summary>
- The <see cref="F:log4net.Core.Level.Warn"/> level designates potentially harmful
- situations.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Notice">
- <summary>
- The <see cref="F:log4net.Core.Level.Notice"/> level designates informational messages
- that highlight the progress of the application at the highest level.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Info">
- <summary>
- The <see cref="F:log4net.Core.Level.Info"/> level designates informational messages that
- highlight the progress of the application at coarse-grained level.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Debug">
- <summary>
- The <see cref="F:log4net.Core.Level.Debug"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Fine">
- <summary>
- The <see cref="F:log4net.Core.Level.Fine"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Trace">
- <summary>
- The <see cref="F:log4net.Core.Level.Trace"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Finer">
- <summary>
- The <see cref="F:log4net.Core.Level.Finer"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Verbose">
- <summary>
- The <see cref="F:log4net.Core.Level.Verbose"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Finest">
- <summary>
- The <see cref="F:log4net.Core.Level.Finest"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.All">
- <summary>
- The <see cref="F:log4net.Core.Level.All"/> level designates the lowest level possible.
- </summary>
- </member>
- <member name="P:log4net.Core.Level.Name">
- <summary>
- Gets the name of this level.
- </summary>
- <value>
- The name of this level.
- </value>
- <remarks>
- <para>
- Gets the name of this level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.Level.Value">
- <summary>
- Gets the value of this level.
- </summary>
- <value>
- The value of this level.
- </value>
- <remarks>
- <para>
- Gets the value of this level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.Level.DisplayName">
- <summary>
- Gets the display name of this level.
- </summary>
- <value>
- The display name of this level.
- </value>
- <remarks>
- <para>
- Gets the display name of this level.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LevelCollection">
- <summary>
- A strongly-typed collection of <see cref="T:log4net.Core.Level"/> objects.
- </summary>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Core.LevelCollection.ReadOnly(log4net.Core.LevelCollection)">
- <summary>
- Creates a read-only wrapper for a <c>LevelCollection</c> instance.
- </summary>
- <param name="list">list to create a readonly wrapper arround</param>
- <returns>
- A <c>LevelCollection</c> wrapper that is read-only.
- </returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor">
- <summary>
- Initializes a new instance of the <c>LevelCollection</c> class
- that is empty and has the default initial capacity.
- </summary>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor(System.Int32)">
- <summary>
- Initializes a new instance of the <c>LevelCollection</c> class
- that has the specified initial capacity.
- </summary>
- <param name="capacity">
- The number of elements that the new <c>LevelCollection</c> is initially capable of storing.
- </param>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor(log4net.Core.LevelCollection)">
- <summary>
- Initializes a new instance of the <c>LevelCollection</c> class
- that contains elements copied from the specified <c>LevelCollection</c>.
- </summary>
- <param name="c">The <c>LevelCollection</c> whose elements are copied to the new collection.</param>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor(log4net.Core.Level[])">
- <summary>
- Initializes a new instance of the <c>LevelCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Core.Level"/> array.
- </summary>
- <param name="a">The <see cref="T:log4net.Core.Level"/> array whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor(System.Collections.ICollection)">
- <summary>
- Initializes a new instance of the <c>LevelCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Core.Level"/> collection.
- </summary>
- <param name="col">The <see cref="T:log4net.Core.Level"/> collection whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor(log4net.Core.LevelCollection.Tag)">
- <summary>
- Allow subclasses to avoid our default constructors
- </summary>
- <param name="tag"></param>
- </member>
- <member name="M:log4net.Core.LevelCollection.CopyTo(log4net.Core.Level[])">
- <summary>
- Copies the entire <c>LevelCollection</c> to a one-dimensional
- <see cref="T:log4net.Core.Level"/> array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Core.Level"/> array to copy to.</param>
- </member>
- <member name="M:log4net.Core.LevelCollection.CopyTo(log4net.Core.Level[],System.Int32)">
- <summary>
- Copies the entire <c>LevelCollection</c> to a one-dimensional
- <see cref="T:log4net.Core.Level"/> array, starting at the specified index of the target array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Core.Level"/> array to copy to.</param>
- <param name="start">The zero-based index in <paramref name="array"/> at which copying begins.</param>
- </member>
- <member name="M:log4net.Core.LevelCollection.Add(log4net.Core.Level)">
- <summary>
- Adds a <see cref="T:log4net.Core.Level"/> to the end of the <c>LevelCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Core.Level"/> to be added to the end of the <c>LevelCollection</c>.</param>
- <returns>The index at which the value has been added.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.Clear">
- <summary>
- Removes all elements from the <c>LevelCollection</c>.
- </summary>
- </member>
- <member name="M:log4net.Core.LevelCollection.Clone">
- <summary>
- Creates a shallow copy of the <see cref="T:log4net.Core.LevelCollection"/>.
- </summary>
- <returns>A new <see cref="T:log4net.Core.LevelCollection"/> with a shallow copy of the collection data.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.Contains(log4net.Core.Level)">
- <summary>
- Determines whether a given <see cref="T:log4net.Core.Level"/> is in the <c>LevelCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Core.Level"/> to check for.</param>
- <returns><c>true</c> if <paramref name="item"/> is found in the <c>LevelCollection</c>; otherwise, <c>false</c>.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.IndexOf(log4net.Core.Level)">
- <summary>
- Returns the zero-based index of the first occurrence of a <see cref="T:log4net.Core.Level"/>
- in the <c>LevelCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Core.Level"/> to locate in the <c>LevelCollection</c>.</param>
- <returns>
- The zero-based index of the first occurrence of <paramref name="item"/>
- in the entire <c>LevelCollection</c>, if found; otherwise, -1.
- </returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.Insert(System.Int32,log4net.Core.Level)">
- <summary>
- Inserts an element into the <c>LevelCollection</c> at the specified index.
- </summary>
- <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
- <param name="item">The <see cref="T:log4net.Core.Level"/> to insert.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Core.LevelCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.Remove(log4net.Core.Level)">
- <summary>
- Removes the first occurrence of a specific <see cref="T:log4net.Core.Level"/> from the <c>LevelCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Core.Level"/> to remove from the <c>LevelCollection</c>.</param>
- <exception cref="T:System.ArgumentException">
- The specified <see cref="T:log4net.Core.Level"/> was not found in the <c>LevelCollection</c>.
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.RemoveAt(System.Int32)">
- <summary>
- Removes the element at the specified index of the <c>LevelCollection</c>.
- </summary>
- <param name="index">The zero-based index of the element to remove.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Core.LevelCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through the <c>LevelCollection</c>.
- </summary>
- <returns>An <see cref="T:log4net.Core.LevelCollection.Enumerator"/> for the entire <c>LevelCollection</c>.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.AddRange(log4net.Core.LevelCollection)">
- <summary>
- Adds the elements of another <c>LevelCollection</c> to the current <c>LevelCollection</c>.
- </summary>
- <param name="x">The <c>LevelCollection</c> whose elements should be added to the end of the current <c>LevelCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Core.LevelCollection.Count"/> of the <c>LevelCollection</c>.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.AddRange(log4net.Core.Level[])">
- <summary>
- Adds the elements of a <see cref="T:log4net.Core.Level"/> array to the current <c>LevelCollection</c>.
- </summary>
- <param name="x">The <see cref="T:log4net.Core.Level"/> array whose elements should be added to the end of the <c>LevelCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Core.LevelCollection.Count"/> of the <c>LevelCollection</c>.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.AddRange(System.Collections.ICollection)">
- <summary>
- Adds the elements of a <see cref="T:log4net.Core.Level"/> collection to the current <c>LevelCollection</c>.
- </summary>
- <param name="col">The <see cref="T:log4net.Core.Level"/> collection whose elements should be added to the end of the <c>LevelCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Core.LevelCollection.Count"/> of the <c>LevelCollection</c>.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.TrimToSize">
- <summary>
- Sets the capacity to the actual number of elements.
- </summary>
- </member>
- <member name="M:log4net.Core.LevelCollection.ValidateIndex(System.Int32)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Core.LevelCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.ValidateIndex(System.Int32,System.Boolean)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Core.LevelCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Core.LevelCollection.Count">
- <summary>
- Gets the number of elements actually contained in the <c>LevelCollection</c>.
- </summary>
- </member>
- <member name="P:log4net.Core.LevelCollection.IsSynchronized">
- <summary>
- Gets a value indicating whether access to the collection is synchronized (thread-safe).
- </summary>
- <value>true if access to the ICollection is synchronized (thread-safe); otherwise, false.</value>
- </member>
- <member name="P:log4net.Core.LevelCollection.SyncRoot">
- <summary>
- Gets an object that can be used to synchronize access to the collection.
- </summary>
- </member>
- <member name="P:log4net.Core.LevelCollection.Item(System.Int32)">
- <summary>
- Gets or sets the <see cref="T:log4net.Core.Level"/> at the specified index.
- </summary>
- <param name="index">The zero-based index of the element to get or set.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Core.LevelCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Core.LevelCollection.IsFixedSize">
- <summary>
- Gets a value indicating whether the collection has a fixed size.
- </summary>
- <value>true if the collection has a fixed size; otherwise, false. The default is false</value>
- </member>
- <member name="P:log4net.Core.LevelCollection.IsReadOnly">
- <summary>
- Gets a value indicating whether the IList is read-only.
- </summary>
- <value>true if the collection is read-only; otherwise, false. The default is false</value>
- </member>
- <member name="P:log4net.Core.LevelCollection.Capacity">
- <summary>
- Gets or sets the number of elements the <c>LevelCollection</c> can contain.
- </summary>
- </member>
- <member name="T:log4net.Core.LevelCollection.ILevelCollectionEnumerator">
- <summary>
- Supports type-safe iteration over a <see cref="T:log4net.Core.LevelCollection"/>.
- </summary>
- </member>
- <member name="M:log4net.Core.LevelCollection.ILevelCollectionEnumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.ILevelCollectionEnumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Core.LevelCollection.ILevelCollectionEnumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- </member>
- <member name="T:log4net.Core.LevelCollection.Tag">
- <summary>
- Type visible only to our subclasses
- Used to access protected constructor
- </summary>
- </member>
- <member name="F:log4net.Core.LevelCollection.Tag.Default">
- <summary>
- A value
- </summary>
- </member>
- <member name="T:log4net.Core.LevelCollection.Enumerator">
- <summary>
- Supports simple iteration over a <see cref="T:log4net.Core.LevelCollection"/>.
- </summary>
- </member>
- <member name="M:log4net.Core.LevelCollection.Enumerator.#ctor(log4net.Core.LevelCollection)">
- <summary>
- Initializes a new instance of the <c>Enumerator</c> class.
- </summary>
- <param name="tc"></param>
- </member>
- <member name="M:log4net.Core.LevelCollection.Enumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.Enumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Core.LevelCollection.Enumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- </member>
- <member name="T:log4net.Core.LevelEvaluator">
- <summary>
- An evaluator that triggers at a threshold level
- </summary>
- <remarks>
- <para>
- This evaluator will trigger if the level of the event
- passed to <see cref="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)"/>
- is equal to or greater than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>
- level.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.LevelEvaluator.m_threshold">
- <summary>
- The threshold for triggering
- </summary>
- </member>
- <member name="M:log4net.Core.LevelEvaluator.#ctor">
- <summary>
- Create a new evaluator using the <see cref="F:log4net.Core.Level.Off"/> threshold.
- </summary>
- <remarks>
- <para>
- Create a new evaluator using the <see cref="F:log4net.Core.Level.Off"/> threshold.
- </para>
- <para>
- This evaluator will trigger if the level of the event
- passed to <see cref="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)"/>
- is equal to or greater than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>
- level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelEvaluator.#ctor(log4net.Core.Level)">
- <summary>
- Create a new evaluator using the specified <see cref="T:log4net.Core.Level"/> threshold.
- </summary>
- <param name="threshold">the threshold to trigger at</param>
- <remarks>
- <para>
- Create a new evaluator using the specified <see cref="T:log4net.Core.Level"/> threshold.
- </para>
- <para>
- This evaluator will trigger if the level of the event
- passed to <see cref="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)"/>
- is equal to or greater than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>
- level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)">
- <summary>
- Is this <paramref name="loggingEvent"/> the triggering event?
- </summary>
- <param name="loggingEvent">The event to check</param>
- <returns>This method returns <c>true</c>, if the event level
- is equal or higher than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>.
- Otherwise it returns <c>false</c></returns>
- <remarks>
- <para>
- This evaluator will trigger if the level of the event
- passed to <see cref="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)"/>
- is equal to or greater than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>
- level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LevelEvaluator.Threshold">
- <summary>
- the threshold to trigger at
- </summary>
- <value>
- The <see cref="T:log4net.Core.Level"/> that will cause this evaluator to trigger
- </value>
- <remarks>
- <para>
- This evaluator will trigger if the level of the event
- passed to <see cref="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)"/>
- is equal to or greater than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>
- level.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LevelMap">
- <summary>
- Mapping between string name and Level object
- </summary>
- <remarks>
- <para>
- Mapping between string name and <see cref="T:log4net.Core.Level"/> object.
- This mapping is held separately for each <see cref="T:log4net.Repository.ILoggerRepository"/>.
- The level name is case insensitive.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.LevelMap.m_mapName2Level">
- <summary>
- Mapping from level name to Level object. The
- level name is case insensitive
- </summary>
- </member>
- <member name="M:log4net.Core.LevelMap.#ctor">
- <summary>
- Construct the level map
- </summary>
- <remarks>
- <para>
- Construct the level map.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelMap.Clear">
- <summary>
- Clear the internal maps of all levels
- </summary>
- <remarks>
- <para>
- Clear the internal maps of all levels
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelMap.Add(System.String,System.Int32)">
- <summary>
- Create a new Level and add it to the map
- </summary>
- <param name="name">the string to display for the Level</param>
- <param name="value">the level value to give to the Level</param>
- <remarks>
- <para>
- Create a new Level and add it to the map
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LevelMap.Add(System.String,System.Int32,System.String)"/>
- </member>
- <member name="M:log4net.Core.LevelMap.Add(System.String,System.Int32,System.String)">
- <summary>
- Create a new Level and add it to the map
- </summary>
- <param name="name">the string to display for the Level</param>
- <param name="value">the level value to give to the Level</param>
- <param name="displayName">the display name to give to the Level</param>
- <remarks>
- <para>
- Create a new Level and add it to the map
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelMap.Add(log4net.Core.Level)">
- <summary>
- Add a Level to the map
- </summary>
- <param name="level">the Level to add</param>
- <remarks>
- <para>
- Add a Level to the map
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelMap.LookupWithDefault(log4net.Core.Level)">
- <summary>
- Lookup a named level from the map
- </summary>
- <param name="defaultLevel">the name of the level to lookup is taken from this level.
- If the level is not set on the map then this level is added</param>
- <returns>the level in the map with the name specified</returns>
- <remarks>
- <para>
- Lookup a named level from the map. The name of the level to lookup is taken
- from the <see cref="P:log4net.Core.Level.Name"/> property of the <paramref name="defaultLevel"/>
- argument.
- </para>
- <para>
- If no level with the specified name is found then the
- <paramref name="defaultLevel"/> argument is added to the level map
- and returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LevelMap.Item(System.String)">
- <summary>
- Lookup a <see cref="T:log4net.Core.Level"/> by name
- </summary>
- <param name="name">The name of the Level to lookup</param>
- <returns>a Level from the map with the name specified</returns>
- <remarks>
- <para>
- Returns the <see cref="T:log4net.Core.Level"/> from the
- map with the name specified. If the no level is
- found then <c>null</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LevelMap.AllLevels">
- <summary>
- Return all possible levels as a list of Level objects.
- </summary>
- <returns>all possible levels as a list of Level objects</returns>
- <remarks>
- <para>
- Return all possible levels as a list of Level objects.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LocationInfo">
- <summary>
- The internal representation of caller location information.
- </summary>
- <remarks>
- <para>
- This class uses the <c>System.Diagnostics.StackTrace</c> class to generate
- a call stack. The caller's information is then extracted from this stack.
- </para>
- <para>
- The <c>System.Diagnostics.StackTrace</c> class is not supported on the
- .NET Compact Framework 1.0 therefore caller location information is not
- available on that framework.
- </para>
- <para>
- The <c>System.Diagnostics.StackTrace</c> class has this to say about Release builds:
- </para>
- <para>
- "StackTrace information will be most informative with Debug build configurations.
- By default, Debug builds include debug symbols, while Release builds do not. The
- debug symbols contain most of the file, method name, line number, and column
- information used in constructing StackFrame and StackTrace objects. StackTrace
- might not report as many method calls as expected, due to code transformations
- that occur during optimization."
- </para>
- <para>
- This means that in a Release build the caller information may be incomplete or may
- not exist at all! Therefore caller location information cannot be relied upon in a Release build.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Core.LocationInfo.NA">
- <summary>
- When location information is not available the constant
- <c>NA</c> is returned. Current value of this string
- constant is <b>?</b>.
- </summary>
- </member>
- <member name="M:log4net.Core.LocationInfo.#ctor(System.Type)">
- <summary>
- Constructor
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LocationInfo"/>
- class based on the current thread.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LocationInfo.#ctor(System.String,System.String,System.String,System.String)">
- <summary>
- Constructor
- </summary>
- <param name="className">The fully qualified class name.</param>
- <param name="methodName">The method name.</param>
- <param name="fileName">The file name.</param>
- <param name="lineNumber">The line number of the method within the file.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LocationInfo"/>
- class with the specified data.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LocationInfo.ClassName">
- <summary>
- Gets the fully qualified class name of the caller making the logging
- request.
- </summary>
- <value>
- The fully qualified class name of the caller making the logging
- request.
- </value>
- <remarks>
- <para>
- Gets the fully qualified class name of the caller making the logging
- request.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LocationInfo.FileName">
- <summary>
- Gets the file name of the caller.
- </summary>
- <value>
- The file name of the caller.
- </value>
- <remarks>
- <para>
- Gets the file name of the caller.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LocationInfo.LineNumber">
- <summary>
- Gets the line number of the caller.
- </summary>
- <value>
- The line number of the caller.
- </value>
- <remarks>
- <para>
- Gets the line number of the caller.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LocationInfo.MethodName">
- <summary>
- Gets the method name of the caller.
- </summary>
- <value>
- The method name of the caller.
- </value>
- <remarks>
- <para>
- Gets the method name of the caller.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LocationInfo.FullInfo">
- <summary>
- Gets all available caller information
- </summary>
- <value>
- All available caller information, in the format
- <c>fully.qualified.classname.of.caller.methodName(Filename:line)</c>
- </value>
- <remarks>
- <para>
- Gets all available caller information, in the format
- <c>fully.qualified.classname.of.caller.methodName(Filename:line)</c>
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggerManager">
- <summary>
- Static manager that controls the creation of repositories
- </summary>
- <remarks>
- <para>
- Static manager that controls the creation of repositories
- </para>
- <para>
- This class is used by the wrapper managers (e.g. <see cref="T:log4net.LogManager"/>)
- to provide access to the <see cref="T:log4net.Core.ILogger"/> objects.
- </para>
- <para>
- This manager also holds the <see cref="T:log4net.Core.IRepositorySelector"/> that is used to
- lookup and create repositories. The selector can be set either programmatically using
- the <see cref="P:log4net.Core.LoggerManager.RepositorySelector"/> property, or by setting the <c>log4net.RepositorySelector</c>
- AppSetting in the applications config file to the fully qualified type name of the
- selector to use.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.LoggerManager.#ctor">
- <summary>
- Private constructor to prevent instances. Only static methods should be used.
- </summary>
- <remarks>
- <para>
- Private constructor to prevent instances. Only static methods should be used.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.#cctor">
- <summary>
- Hook the shutdown event
- </summary>
- <remarks>
- <para>
- On the full .NET runtime, the static constructor hooks up the
- <c>AppDomain.ProcessExit</c> and <c>AppDomain.DomainUnload</c>> events.
- These are used to shutdown the log4net system as the application exits.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.RegisterAppDomainEvents">
- <summary>
- Register for ProcessExit and DomainUnload events on the AppDomain
- </summary>
- <remarks>
- <para>
- This needs to be in a separate method because the events make
- a LinkDemand for the ControlAppDomain SecurityPermission. Because
- this is a LinkDemand it is demanded at JIT time. Therefore we cannot
- catch the exception in the method itself, we have to catch it in the
- caller.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLoggerRepository(System.String)">
- <summary>
- Return the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <param name="repository">the repository to lookup in</param>
- <returns>Return the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repository"/> argument.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLoggerRepository(System.Reflection.Assembly)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetRepository(System.String)">
- <summary>
- Return the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <param name="repository">the repository to lookup in</param>
- <returns>Return the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repository"/> argument.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetRepository(System.Reflection.Assembly)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- <remarks>
- <para>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.Exists(System.String,System.String)">
- <summary>
- Returns the named logger if it exists.
- </summary>
- <param name="repository">The repository to lookup in.</param>
- <param name="name">The fully qualified logger name to look for.</param>
- <returns>
- The logger found, or <c>null</c> if the named logger does not exist in the
- specified repository.
- </returns>
- <remarks>
- <para>
- If the named logger exists (in the specified repository) then it
- returns a reference to the logger, otherwise it returns
- <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.Exists(System.Reflection.Assembly,System.String)">
- <summary>
- Returns the named logger if it exists.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <param name="name">The fully qualified logger name to look for.</param>
- <returns>
- The logger found, or <c>null</c> if the named logger does not exist in the
- specified assembly's repository.
- </returns>
- <remarks>
- <para>
- If the named logger exists (in the specified assembly's repository) then it
- returns a reference to the logger, otherwise it returns
- <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetCurrentLoggers(System.String)">
- <summary>
- Returns all the currently defined loggers in the specified repository.
- </summary>
- <param name="repository">The repository to lookup in.</param>
- <returns>All the defined loggers.</returns>
- <remarks>
- <para>
- The root logger is <b>not</b> included in the returned array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetCurrentLoggers(System.Reflection.Assembly)">
- <summary>
- Returns all the currently defined loggers in the specified assembly's repository.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <returns>All the defined loggers.</returns>
- <remarks>
- <para>
- The root logger is <b>not</b> included in the returned array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLogger(System.String,System.String)">
- <summary>
- Retrieves or creates a named logger.
- </summary>
- <param name="repository">The repository to lookup in.</param>
- <param name="name">The name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- <remarks>
- <para>
- Retrieves a logger named as the <paramref name="name"/>
- parameter. If the named logger already exists, then the
- existing instance will be returned. Otherwise, a new instance is
- created.
- </para>
- <para>
- By default, loggers do not have a set level but inherit
- it from the hierarchy. This is one of the central features of
- log4net.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLogger(System.Reflection.Assembly,System.String)">
- <summary>
- Retrieves or creates a named logger.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <param name="name">The name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- <remarks>
- <para>
- Retrieves a logger named as the <paramref name="name"/>
- parameter. If the named logger already exists, then the
- existing instance will be returned. Otherwise, a new instance is
- created.
- </para>
- <para>
- By default, loggers do not have a set level but inherit
- it from the hierarchy. This is one of the central features of
- log4net.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLogger(System.String,System.Type)">
- <summary>
- Shorthand for <see cref="M:log4net.LogManager.GetLogger(System.String)"/>.
- </summary>
- <param name="repository">The repository to lookup in.</param>
- <param name="type">The <paramref name="type"/> of which the fullname will be used as the name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- <remarks>
- <para>
- Gets the logger for the fully qualified name of the type specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLogger(System.Reflection.Assembly,System.Type)">
- <summary>
- Shorthand for <see cref="M:log4net.LogManager.GetLogger(System.String)"/>.
- </summary>
- <param name="repositoryAssembly">the assembly to use to lookup the repository</param>
- <param name="type">The <paramref name="type"/> of which the fullname will be used as the name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- <remarks>
- <para>
- Gets the logger for the fully qualified name of the type specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.Shutdown">
- <summary>
- Shuts down the log4net system.
- </summary>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in all the
- default repositories.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>
- The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.ShutdownRepository(System.String)">
- <summary>
- Shuts down the repository for the repository specified.
- </summary>
- <param name="repository">The repository to shutdown.</param>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in the
- repository for the <paramref name="repository"/> specified.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>
- The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.ShutdownRepository(System.Reflection.Assembly)">
- <summary>
- Shuts down the repository for the repository specified.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in the
- repository for the repository. The repository is looked up using
- the <paramref name="repositoryAssembly"/> specified.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>
- The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.ResetConfiguration(System.String)">
- <summary>
- Resets all values contained in this repository instance to their defaults.
- </summary>
- <param name="repository">The repository to reset.</param>
- <remarks>
- <para>
- Resets all values contained in the repository instance to their
- defaults. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set its default "off" value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.ResetConfiguration(System.Reflection.Assembly)">
- <summary>
- Resets all values contained in this repository instance to their defaults.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository to reset.</param>
- <remarks>
- <para>
- Resets all values contained in the repository instance to their
- defaults. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set its default "off" value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateDomain(System.String)">
- <summary>
- Creates a repository with the specified name.
- </summary>
- <param name="repository">The name of the repository, this must be unique amongst repositories.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- Creates the default type of <see cref="T:log4net.Repository.ILoggerRepository"/> which is a
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> object.
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateRepository(System.String)">
- <summary>
- Creates a repository with the specified name.
- </summary>
- <param name="repository">The name of the repository, this must be unique amongst repositories.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- Creates the default type of <see cref="T:log4net.Repository.ILoggerRepository"/> which is a
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> object.
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateDomain(System.String,System.Type)">
- <summary>
- Creates a repository with the specified name and repository type.
- </summary>
- <param name="repository">The name of the repository, this must be unique to the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An Exception will be thrown if the repository already exists.
- </para>
- </remarks>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateRepository(System.String,System.Type)">
- <summary>
- Creates a repository with the specified name and repository type.
- </summary>
- <param name="repository">The name of the repository, this must be unique to the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An Exception will be thrown if the repository already exists.
- </para>
- </remarks>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateDomain(System.Reflection.Assembly,System.Type)">
- <summary>
- Creates a repository for the specified assembly and repository type.
- </summary>
- <param name="repositoryAssembly">The assembly to use to get the name of the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.LoggerManager.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateRepository(System.Reflection.Assembly,System.Type)">
- <summary>
- Creates a repository for the specified assembly and repository type.
- </summary>
- <param name="repositoryAssembly">The assembly to use to get the name of the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.LoggerManager.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetAllRepositories">
- <summary>
- Gets an array of all currently defined repositories.
- </summary>
- <returns>An array of all the known <see cref="T:log4net.Repository.ILoggerRepository"/> objects.</returns>
- <remarks>
- <para>
- Gets an array of all currently defined repositories.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetVersionInfo">
- <summary>
- Internal method to get pertinent version info.
- </summary>
- <returns>A string of version info.</returns>
- </member>
- <member name="M:log4net.Core.LoggerManager.OnDomainUnload(System.Object,System.EventArgs)">
- <summary>
- Called when the <see cref="E:System.AppDomain.DomainUnload"/> event fires
- </summary>
- <param name="sender">the <see cref="T:System.AppDomain"/> that is exiting</param>
- <param name="e">null</param>
- <remarks>
- <para>
- Called when the <see cref="E:System.AppDomain.DomainUnload"/> event fires.
- </para>
- <para>
- When the event is triggered the log4net system is <see cref="M:log4net.Core.LoggerManager.Shutdown"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.OnProcessExit(System.Object,System.EventArgs)">
- <summary>
- Called when the <see cref="E:System.AppDomain.ProcessExit"/> event fires
- </summary>
- <param name="sender">the <see cref="T:System.AppDomain"/> that is exiting</param>
- <param name="e">null</param>
- <remarks>
- <para>
- Called when the <see cref="E:System.AppDomain.ProcessExit"/> event fires.
- </para>
- <para>
- When the event is triggered the log4net system is <see cref="M:log4net.Core.LoggerManager.Shutdown"/>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggerManager.s_repositorySelector">
- <summary>
- Initialize the default repository selector
- </summary>
- </member>
- <member name="P:log4net.Core.LoggerManager.RepositorySelector">
- <summary>
- Gets or sets the repository selector used by the <see cref="T:log4net.LogManager"/>.
- </summary>
- <value>
- The repository selector used by the <see cref="T:log4net.LogManager"/>.
- </value>
- <remarks>
- <para>
- The repository selector (<see cref="T:log4net.Core.IRepositorySelector"/>) is used by
- the <see cref="T:log4net.LogManager"/> to create and select repositories
- (<see cref="T:log4net.Repository.ILoggerRepository"/>).
- </para>
- <para>
- The caller to <see cref="T:log4net.LogManager"/> supplies either a string name
- or an assembly (if not supplied the assembly is inferred using
- <see cref="M:System.Reflection.Assembly.GetCallingAssembly"/>).
- </para>
- <para>
- This context is used by the selector to lookup a specific repository.
- </para>
- <para>
- For the full .NET Framework, the default repository is <c>DefaultRepositorySelector</c>;
- for the .NET Compact Framework <c>CompactRepositorySelector</c> is the default
- repository.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggerWrapperImpl">
- <summary>
- Implementation of the <see cref="T:log4net.Core.ILoggerWrapper"/> interface.
- </summary>
- <remarks>
- <para>
- This class should be used as the base for all wrapper implementations.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.LoggerWrapperImpl.#ctor(log4net.Core.ILogger)">
- <summary>
- Constructs a new wrapper for the specified logger.
- </summary>
- <param name="logger">The logger to wrap.</param>
- <remarks>
- <para>
- Constructs a new wrapper for the specified logger.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggerWrapperImpl.m_logger">
- <summary>
- The logger that this object is wrapping
- </summary>
- </member>
- <member name="P:log4net.Core.LoggerWrapperImpl.Logger">
- <summary>
- Gets the implementation behind this wrapper object.
- </summary>
- <value>
- The <see cref="T:log4net.Core.ILogger"/> object that this object is implementing.
- </value>
- <remarks>
- <para>
- The <c>Logger</c> object may not be the same object as this object
- because of logger decorators.
- </para>
- <para>
- This gets the actual underlying objects that is used to process
- the log events.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggingEventData">
- <summary>
- Portable data structure used by <see cref="T:log4net.Core.LoggingEvent"/>
- </summary>
- <remarks>
- <para>
- Portable data structure used by <see cref="T:log4net.Core.LoggingEvent"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.LoggingEventData.LoggerName">
- <summary>
- The logger name.
- </summary>
- <remarks>
- <para>
- The logger name.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.Level">
- <summary>
- Level of logging event.
- </summary>
- <remarks>
- <para>
- Level of logging event. Level cannot be Serializable
- because it is a flyweight. Due to its special serialization it
- cannot be declared final either.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.Message">
- <summary>
- The application supplied message.
- </summary>
- <remarks>
- <para>
- The application supplied message of logging event.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.ThreadName">
- <summary>
- The name of thread
- </summary>
- <remarks>
- <para>
- The name of thread in which this logging event was generated
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.TimeStamp">
- <summary>
- The time the event was logged
- </summary>
- <remarks>
- <para>
- The TimeStamp is stored in the local time zone for this computer.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.LocationInfo">
- <summary>
- Location information for the caller.
- </summary>
- <remarks>
- <para>
- Location information for the caller.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.UserName">
- <summary>
- String representation of the user
- </summary>
- <remarks>
- <para>
- String representation of the user's windows name,
- like DOMAIN\username
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.Identity">
- <summary>
- String representation of the identity.
- </summary>
- <remarks>
- <para>
- String representation of the current thread's principal identity.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.ExceptionString">
- <summary>
- The string representation of the exception
- </summary>
- <remarks>
- <para>
- The string representation of the exception
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.Domain">
- <summary>
- String representation of the AppDomain.
- </summary>
- <remarks>
- <para>
- String representation of the AppDomain.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.Properties">
- <summary>
- Additional event specific properties
- </summary>
- <remarks>
- <para>
- A logger or an appender may attach additional
- properties to specific events. These properties
- have a string key and an object value.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.FixFlags">
- <summary>
- Flags passed to the <see cref="P:log4net.Core.LoggingEvent.Fix"/> property
- </summary>
- <remarks>
- <para>
- Flags passed to the <see cref="P:log4net.Core.LoggingEvent.Fix"/> property
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.FixFlags.Mdc">
- <summary>
- Fix the MDC
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.Ndc">
- <summary>
- Fix the NDC
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.Message">
- <summary>
- Fix the rendered message
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.ThreadName">
- <summary>
- Fix the thread name
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.LocationInfo">
- <summary>
- Fix the callers location information
- </summary>
- <remarks>
- CAUTION: Very slow to generate
- </remarks>
- </member>
- <member name="F:log4net.Core.FixFlags.UserName">
- <summary>
- Fix the callers windows user name
- </summary>
- <remarks>
- CAUTION: Slow to generate
- </remarks>
- </member>
- <member name="F:log4net.Core.FixFlags.Domain">
- <summary>
- Fix the domain friendly name
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.Identity">
- <summary>
- Fix the callers principal name
- </summary>
- <remarks>
- CAUTION: May be slow to generate
- </remarks>
- </member>
- <member name="F:log4net.Core.FixFlags.Exception">
- <summary>
- Fix the exception text
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.Properties">
- <summary>
- Fix the event properties
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.None">
- <summary>
- No fields fixed
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.All">
- <summary>
- All fields fixed
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.Partial">
- <summary>
- Partial fields fixed
- </summary>
- <remarks>
- <para>
- This set of partial fields gives good performance. The following fields are fixed:
- </para>
- <list type="bullet">
- <item><description><see cref="F:log4net.Core.FixFlags.Message"/></description></item>
- <item><description><see cref="F:log4net.Core.FixFlags.ThreadName"/></description></item>
- <item><description><see cref="F:log4net.Core.FixFlags.Exception"/></description></item>
- <item><description><see cref="F:log4net.Core.FixFlags.Domain"/></description></item>
- <item><description><see cref="F:log4net.Core.FixFlags.Properties"/></description></item>
- </list>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggingEvent">
- <summary>
- The internal representation of logging events.
- </summary>
- <remarks>
- <para>
- When an affirmative decision is made to log then a
- <see cref="T:log4net.Core.LoggingEvent"/> instance is created. This instance
- is passed around to the different log4net components.
- </para>
- <para>
- This class is of concern to those wishing to extend log4net.
- </para>
- <para>
- Some of the values in instances of <see cref="T:log4net.Core.LoggingEvent"/>
- are considered volatile, that is the values are correct at the
- time the event is delivered to appenders, but will not be consistent
- at any time afterwards. If an event is to be stored and then processed
- at a later time these volatile values must be fixed by calling
- <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/>. There is a performance penalty
- for incurred by calling <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> but it
- is essential to maintaining data consistency.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Douglas de la Torre</author>
- <author>Daniel Cazzulino</author>
- </member>
- <member name="F:log4net.Core.LoggingEvent.HostNameProperty">
- <summary>
- The key into the Properties map for the host name value.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.IdentityProperty">
- <summary>
- The key into the Properties map for the thread identity value.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.UserNameProperty">
- <summary>
- The key into the Properties map for the user name value.
- </summary>
- </member>
- <member name="M:log4net.Core.LoggingEvent.#ctor(System.Type,log4net.Repository.ILoggerRepository,System.String,log4net.Core.Level,System.Object,System.Exception)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Core.LoggingEvent"/> class
- from the supplied parameters.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="repository">The repository this event is logged in.</param>
- <param name="loggerName">The name of the logger of this event.</param>
- <param name="level">The level of this event.</param>
- <param name="message">The message of this event.</param>
- <param name="exception">The exception for this event.</param>
- <remarks>
- <para>
- Except <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/>, <see cref="P:log4net.Core.LoggingEvent.Level"/> and <see cref="P:log4net.Core.LoggingEvent.LoggerName"/>,
- all fields of <c>LoggingEvent</c> are filled when actually needed. Call
- <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> to cache all data locally
- to prevent inconsistencies.
- </para>
- <para>This method is called by the log4net framework
- to create a logging event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.#ctor(System.Type,log4net.Repository.ILoggerRepository,log4net.Core.LoggingEventData,log4net.Core.FixFlags)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Core.LoggingEvent"/> class
- using specific data.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="repository">The repository this event is logged in.</param>
- <param name="data">Data used to initialize the logging event.</param>
- <param name="fixedData">The fields in the <paranref name="data"/> struct that have already been fixed.</param>
- <remarks>
- <para>
- This constructor is provided to allow a <see cref="T:log4net.Core.LoggingEvent"/>
- to be created independently of the log4net framework. This can
- be useful if you require a custom serialization scheme.
- </para>
- <para>
- Use the <see cref="M:log4net.Core.LoggingEvent.GetLoggingEventData(log4net.Core.FixFlags)"/> method to obtain an
- instance of the <see cref="T:log4net.Core.LoggingEventData"/> class.
- </para>
- <para>
- The <paramref name="fixedData"/> parameter should be used to specify which fields in the
- <paramref name="data"/> struct have been preset. Fields not specified in the <paramref name="fixedData"/>
- will be captured from the environment if requested or fixed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.#ctor(System.Type,log4net.Repository.ILoggerRepository,log4net.Core.LoggingEventData)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Core.LoggingEvent"/> class
- using specific data.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="repository">The repository this event is logged in.</param>
- <param name="data">Data used to initialize the logging event.</param>
- <remarks>
- <para>
- This constructor is provided to allow a <see cref="T:log4net.Core.LoggingEvent"/>
- to be created independently of the log4net framework. This can
- be useful if you require a custom serialization scheme.
- </para>
- <para>
- Use the <see cref="M:log4net.Core.LoggingEvent.GetLoggingEventData(log4net.Core.FixFlags)"/> method to obtain an
- instance of the <see cref="T:log4net.Core.LoggingEventData"/> class.
- </para>
- <para>
- This constructor sets this objects <see cref="P:log4net.Core.LoggingEvent.Fix"/> flags to <see cref="F:log4net.Core.FixFlags.All"/>,
- this assumes that all the data relating to this event is passed in via the <paramref name="data"/>
- parameter and no other data should be captured from the environment.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.#ctor(log4net.Core.LoggingEventData)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Core.LoggingEvent"/> class
- using specific data.
- </summary>
- <param name="data">Data used to initialize the logging event.</param>
- <remarks>
- <para>
- This constructor is provided to allow a <see cref="T:log4net.Core.LoggingEvent"/>
- to be created independently of the log4net framework. This can
- be useful if you require a custom serialization scheme.
- </para>
- <para>
- Use the <see cref="M:log4net.Core.LoggingEvent.GetLoggingEventData(log4net.Core.FixFlags)"/> method to obtain an
- instance of the <see cref="T:log4net.Core.LoggingEventData"/> class.
- </para>
- <para>
- This constructor sets this objects <see cref="P:log4net.Core.LoggingEvent.Fix"/> flags to <see cref="F:log4net.Core.FixFlags.All"/>,
- this assumes that all the data relating to this event is passed in via the <paramref name="data"/>
- parameter and no other data should be captured from the environment.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Serialization constructor
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data.</param>
- <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LoggingEvent"/> class
- with serialized data.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.EnsureRepository(log4net.Repository.ILoggerRepository)">
- <summary>
- Ensure that the repository is set.
- </summary>
- <param name="repository">the value for the repository</param>
- </member>
- <member name="M:log4net.Core.LoggingEvent.WriteRenderedMessage(System.IO.TextWriter)">
- <summary>
- Write the rendered message to a TextWriter
- </summary>
- <param name="writer">the writer to write the message to</param>
- <remarks>
- <para>
- Unlike the <see cref="P:log4net.Core.LoggingEvent.RenderedMessage"/> property this method
- does store the message data in the internal cache. Therefore
- if called only once this method should be faster than the
- <see cref="P:log4net.Core.LoggingEvent.RenderedMessage"/> property, however if the message is
- to be accessed multiple times then the property will be more efficient.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Serializes this object into the <see cref="T:System.Runtime.Serialization.SerializationInfo"/> provided.
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> to populate with data.</param>
- <param name="context">The destination for this serialization.</param>
- <remarks>
- <para>
- The data in this event must be fixed before it can be serialized.
- </para>
- <para>
- The <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> method must be called during the
- <see cref="M:log4net.Appender.IAppender.DoAppend(log4net.Core.LoggingEvent)"/> method call if this event
- is to be used outside that method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetLoggingEventData">
- <summary>
- Gets the portable data for this <see cref="T:log4net.Core.LoggingEvent"/>.
- </summary>
- <returns>The <see cref="T:log4net.Core.LoggingEventData"/> for this event.</returns>
- <remarks>
- <para>
- A new <see cref="T:log4net.Core.LoggingEvent"/> can be constructed using a
- <see cref="T:log4net.Core.LoggingEventData"/> instance.
- </para>
- <para>
- Does a <see cref="F:log4net.Core.FixFlags.Partial"/> fix of the data
- in the logging event before returning the event data.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetLoggingEventData(log4net.Core.FixFlags)">
- <summary>
- Gets the portable data for this <see cref="T:log4net.Core.LoggingEvent"/>.
- </summary>
- <param name="fixFlags">The set of data to ensure is fixed in the LoggingEventData</param>
- <returns>The <see cref="T:log4net.Core.LoggingEventData"/> for this event.</returns>
- <remarks>
- <para>
- A new <see cref="T:log4net.Core.LoggingEvent"/> can be constructed using a
- <see cref="T:log4net.Core.LoggingEventData"/> instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetExceptionStrRep">
- <summary>
- Returns this event's exception's rendered using the
- <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </summary>
- <returns>
- This event's exception's rendered using the <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </returns>
- <remarks>
- <para>
- <b>Obsolete. Use <see cref="M:log4net.Core.LoggingEvent.GetExceptionString"/> instead.</b>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetExceptionString">
- <summary>
- Returns this event's exception's rendered using the
- <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </summary>
- <returns>
- This event's exception's rendered using the <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </returns>
- <remarks>
- <para>
- Returns this event's exception's rendered using the
- <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.FixVolatileData">
- <summary>
- Fix instance fields that hold volatile data.
- </summary>
- <remarks>
- <para>
- Some of the values in instances of <see cref="T:log4net.Core.LoggingEvent"/>
- are considered volatile, that is the values are correct at the
- time the event is delivered to appenders, but will not be consistent
- at any time afterwards. If an event is to be stored and then processed
- at a later time these volatile values must be fixed by calling
- <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/>. There is a performance penalty
- incurred by calling <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> but it
- is essential to maintaining data consistency.
- </para>
- <para>
- Calling <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> is equivalent to
- calling <see cref="M:log4net.Core.LoggingEvent.FixVolatileData(System.Boolean)"/> passing the parameter
- <c>false</c>.
- </para>
- <para>
- See <see cref="M:log4net.Core.LoggingEvent.FixVolatileData(System.Boolean)"/> for more
- information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.FixVolatileData(System.Boolean)">
- <summary>
- Fixes instance fields that hold volatile data.
- </summary>
- <param name="fastButLoose">Set to <c>true</c> to not fix data that takes a long time to fix.</param>
- <remarks>
- <para>
- Some of the values in instances of <see cref="T:log4net.Core.LoggingEvent"/>
- are considered volatile, that is the values are correct at the
- time the event is delivered to appenders, but will not be consistent
- at any time afterwards. If an event is to be stored and then processed
- at a later time these volatile values must be fixed by calling
- <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/>. There is a performance penalty
- for incurred by calling <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> but it
- is essential to maintaining data consistency.
- </para>
- <para>
- The <paramref name="fastButLoose"/> param controls the data that
- is fixed. Some of the data that can be fixed takes a long time to
- generate, therefore if you do not require those settings to be fixed
- they can be ignored by setting the <paramref name="fastButLoose"/> param
- to <c>true</c>. This setting will ignore the <see cref="P:log4net.Core.LoggingEvent.LocationInformation"/>
- and <see cref="P:log4net.Core.LoggingEvent.UserName"/> settings.
- </para>
- <para>
- Set <paramref name="fastButLoose"/> to <c>false</c> to ensure that all
- settings are fixed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.FixVolatileData(log4net.Core.FixFlags)">
- <summary>
- Fix the fields specified by the <see cref="T:log4net.Core.FixFlags"/> parameter
- </summary>
- <param name="flags">the fields to fix</param>
- <remarks>
- <para>
- Only fields specified in the <paramref name="flags"/> will be fixed.
- Fields will not be fixed if they have previously been fixed.
- It is not possible to 'unfix' a field.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.LookupProperty(System.String)">
- <summary>
- Lookup a composite property in this event
- </summary>
- <param name="key">the key for the property to lookup</param>
- <returns>the value for the property</returns>
- <remarks>
- <para>
- This event has composite properties that combine together properties from
- several different contexts in the following order:
- <list type="definition">
- <item>
- <term>this events properties</term>
- <description>
- This event has <see cref="P:log4net.Core.LoggingEvent.Properties"/> that can be set. These
- properties are specific to this event only.
- </description>
- </item>
- <item>
- <term>the thread properties</term>
- <description>
- The <see cref="P:log4net.ThreadContext.Properties"/> that are set on the current
- thread. These properties are shared by all events logged on this thread.
- </description>
- </item>
- <item>
- <term>the global properties</term>
- <description>
- The <see cref="P:log4net.GlobalContext.Properties"/> that are set globally. These
- properties are shared by all the threads in the AppDomain.
- </description>
- </item>
- </list>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetProperties">
- <summary>
- Get all the composite properties in this event
- </summary>
- <returns>the <see cref="T:log4net.Util.PropertiesDictionary"/> containing all the properties</returns>
- <remarks>
- <para>
- See <see cref="M:log4net.Core.LoggingEvent.LookupProperty(System.String)"/> for details of the composite properties
- stored by the event.
- </para>
- <para>
- This method returns a single <see cref="T:log4net.Util.PropertiesDictionary"/> containing all the
- properties defined for this event.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_data">
- <summary>
- The internal logging event data.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_compositeProperties">
- <summary>
- The internal logging event data.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_eventProperties">
- <summary>
- The internal logging event data.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_callerStackBoundaryDeclaringType">
- <summary>
- The fully qualified Type of the calling
- logger class in the stack frame (i.e. the declaring type of the method).
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_message">
- <summary>
- The application supplied message of logging event.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_thrownException">
- <summary>
- The exception that was thrown.
- </summary>
- <remarks>
- This is not serialized. The string representation
- is serialized instead.
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_repository">
- <summary>
- The repository that generated the logging event
- </summary>
- <remarks>
- This is not serialized.
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_fixFlags">
- <summary>
- The fix state for this event
- </summary>
- <remarks>
- These flags indicate which fields have been fixed.
- Not serialized.
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_cacheUpdatable">
- <summary>
- Indicated that the internal cache is updateable (ie not fixed)
- </summary>
- <remarks>
- This is a seperate flag to m_fixFlags as it allows incrementel fixing and simpler
- changes in the caching strategy.
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.StartTime">
- <summary>
- Gets the time when the current process started.
- </summary>
- <value>
- This is the time when this process started.
- </value>
- <remarks>
- <para>
- The TimeStamp is stored in the local time zone for this computer.
- </para>
- <para>
- Tries to get the start time for the current process.
- Failing that it returns the time of the first call to
- this property.
- </para>
- <para>
- Note that AppDomains may be loaded and unloaded within the
- same process without the process terminating and therefore
- without the process start time being reset.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Level">
- <summary>
- Gets the <see cref="P:log4net.Core.LoggingEvent.Level"/> of the logging event.
- </summary>
- <value>
- The <see cref="P:log4net.Core.LoggingEvent.Level"/> of the logging event.
- </value>
- <remarks>
- <para>
- Gets the <see cref="P:log4net.Core.LoggingEvent.Level"/> of the logging event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.TimeStamp">
- <summary>
- Gets the time of the logging event.
- </summary>
- <value>
- The time of the logging event.
- </value>
- <remarks>
- <para>
- The TimeStamp is stored in the local time zone for this computer.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.LoggerName">
- <summary>
- Gets the name of the logger that logged the event.
- </summary>
- <value>
- The name of the logger that logged the event.
- </value>
- <remarks>
- <para>
- Gets the name of the logger that logged the event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.LocationInformation">
- <summary>
- Gets the location information for this logging event.
- </summary>
- <value>
- The location information for this logging event.
- </value>
- <remarks>
- <para>
- The collected information is cached for future use.
- </para>
- <para>
- See the <see cref="T:log4net.Core.LocationInfo"/> class for more information on
- supported frameworks and the different behavior in Debug and
- Release builds.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.MessageObject">
- <summary>
- Gets the message object used to initialize this event.
- </summary>
- <value>
- The message object used to initialize this event.
- </value>
- <remarks>
- <para>
- Gets the message object used to initialize this event.
- Note that this event may not have a valid message object.
- If the event is serialized the message object will not
- be transferred. To get the text of the message the
- <see cref="P:log4net.Core.LoggingEvent.RenderedMessage"/> property must be used
- not this property.
- </para>
- <para>
- If there is no defined message object for this event then
- null will be returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.ExceptionObject">
- <summary>
- Gets the exception object used to initialize this event.
- </summary>
- <value>
- The exception object used to initialize this event.
- </value>
- <remarks>
- <para>
- Gets the exception object used to initialize this event.
- Note that this event may not have a valid exception object.
- If the event is serialized the exception object will not
- be transferred. To get the text of the exception the
- <see cref="M:log4net.Core.LoggingEvent.GetExceptionString"/> method must be used
- not this property.
- </para>
- <para>
- If there is no defined exception object for this event then
- null will be returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Repository">
- <summary>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that this event was created in.
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that this event was created in.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.RenderedMessage">
- <summary>
- Gets the message, rendered through the <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </summary>
- <value>
- The message rendered through the <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </value>
- <remarks>
- <para>
- The collected information is cached for future use.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.ThreadName">
- <summary>
- Gets the name of the current thread.
- </summary>
- <value>
- The name of the current thread, or the thread ID when
- the name is not available.
- </value>
- <remarks>
- <para>
- The collected information is cached for future use.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.UserName">
- <summary>
- Gets the name of the current user.
- </summary>
- <value>
- The name of the current user, or <c>NOT AVAILABLE</c> when the
- underlying runtime has no support for retrieving the name of the
- current user.
- </value>
- <remarks>
- <para>
- Calls <c>WindowsIdentity.GetCurrent().Name</c> to get the name of
- the current windows user.
- </para>
- <para>
- To improve performance, we could cache the string representation of
- the name, and reuse that as long as the identity stayed constant.
- Once the identity changed, we would need to re-assign and re-render
- the string.
- </para>
- <para>
- However, the <c>WindowsIdentity.GetCurrent()</c> call seems to
- return different objects every time, so the current implementation
- doesn't do this type of caching.
- </para>
- <para>
- Timing for these operations:
- </para>
- <list type="table">
- <listheader>
- <term>Method</term>
- <description>Results</description>
- </listheader>
- <item>
- <term><c>WindowsIdentity.GetCurrent()</c></term>
- <description>10000 loops, 00:00:00.2031250 seconds</description>
- </item>
- <item>
- <term><c>WindowsIdentity.GetCurrent().Name</c></term>
- <description>10000 loops, 00:00:08.0468750 seconds</description>
- </item>
- </list>
- <para>
- This means we could speed things up almost 40 times by caching the
- value of the <c>WindowsIdentity.GetCurrent().Name</c> property, since
- this takes (8.04-0.20) = 7.84375 seconds.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Identity">
- <summary>
- Gets the identity of the current thread principal.
- </summary>
- <value>
- The string name of the identity of the current thread principal.
- </value>
- <remarks>
- <para>
- Calls <c>System.Threading.Thread.CurrentPrincipal.Identity.Name</c> to get
- the name of the current thread principal.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Domain">
- <summary>
- Gets the AppDomain friendly name.
- </summary>
- <value>
- The AppDomain friendly name.
- </value>
- <remarks>
- <para>
- Gets the AppDomain friendly name.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Properties">
- <summary>
- Additional event specific properties.
- </summary>
- <value>
- Additional event specific properties.
- </value>
- <remarks>
- <para>
- A logger or an appender may attach additional
- properties to specific events. These properties
- have a string key and an object value.
- </para>
- <para>
- This property is for events that have been added directly to
- this event. The aggregate properties (which include these
- event properties) can be retrieved using <see cref="M:log4net.Core.LoggingEvent.LookupProperty(System.String)"/>
- and <see cref="M:log4net.Core.LoggingEvent.GetProperties"/>.
- </para>
- <para>
- Once the properties have been fixed <see cref="P:log4net.Core.LoggingEvent.Fix"/> this property
- returns the combined cached properties. This ensures that updates to
- this property are always reflected in the underlying storage. When
- returning the combined properties there may be more keys in the
- Dictionary than expected.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Fix">
- <summary>
- The fixed fields in this event
- </summary>
- <value>
- The set of fields that are fixed in this event
- </value>
- <remarks>
- <para>
- Fields will not be fixed if they have previously been fixed.
- It is not possible to 'unfix' a field.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LogImpl">
- <summary>
- Implementation of <see cref="T:log4net.ILog"/> wrapper interface.
- </summary>
- <remarks>
- <para>
- This implementation of the <see cref="T:log4net.ILog"/> interface
- forwards to the <see cref="T:log4net.Core.ILogger"/> held by the base class.
- </para>
- <para>
- This logger has methods to allow the caller to log at the following
- levels:
- </para>
- <list type="definition">
- <item>
- <term>DEBUG</term>
- <description>
- The <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/> and <see cref="M:log4net.Core.LogImpl.DebugFormat(System.String,System.Object[])"/> methods log messages
- at the <c>DEBUG</c> level. That is the level with that name defined in the
- repositories <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>. The default value
- for this level is <see cref="F:log4net.Core.Level.Debug"/>. The <see cref="P:log4net.Core.LogImpl.IsDebugEnabled"/>
- property tests if this level is enabled for logging.
- </description>
- </item>
- <item>
- <term>INFO</term>
- <description>
- The <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/> and <see cref="M:log4net.Core.LogImpl.InfoFormat(System.String,System.Object[])"/> methods log messages
- at the <c>INFO</c> level. That is the level with that name defined in the
- repositories <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>. The default value
- for this level is <see cref="F:log4net.Core.Level.Info"/>. The <see cref="P:log4net.Core.LogImpl.IsInfoEnabled"/>
- property tests if this level is enabled for logging.
- </description>
- </item>
- <item>
- <term>WARN</term>
- <description>
- The <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/> and <see cref="M:log4net.Core.LogImpl.WarnFormat(System.String,System.Object[])"/> methods log messages
- at the <c>WARN</c> level. That is the level with that name defined in the
- repositories <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>. The default value
- for this level is <see cref="F:log4net.Core.Level.Warn"/>. The <see cref="P:log4net.Core.LogImpl.IsWarnEnabled"/>
- property tests if this level is enabled for logging.
- </description>
- </item>
- <item>
- <term>ERROR</term>
- <description>
- The <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/> and <see cref="M:log4net.Core.LogImpl.ErrorFormat(System.String,System.Object[])"/> methods log messages
- at the <c>ERROR</c> level. That is the level with that name defined in the
- repositories <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>. The default value
- for this level is <see cref="F:log4net.Core.Level.Error"/>. The <see cref="P:log4net.Core.LogImpl.IsErrorEnabled"/>
- property tests if this level is enabled for logging.
- </description>
- </item>
- <item>
- <term>FATAL</term>
- <description>
- The <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/> and <see cref="M:log4net.Core.LogImpl.FatalFormat(System.String,System.Object[])"/> methods log messages
- at the <c>FATAL</c> level. That is the level with that name defined in the
- repositories <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>. The default value
- for this level is <see cref="F:log4net.Core.Level.Fatal"/>. The <see cref="P:log4net.Core.LogImpl.IsFatalEnabled"/>
- property tests if this level is enabled for logging.
- </description>
- </item>
- </list>
- <para>
- The values for these levels and their semantic meanings can be changed by
- configuring the <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/> for the repository.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.ILog">
- <summary>
- The ILog interface is use by application to log messages into
- the log4net framework.
- </summary>
- <remarks>
- <para>
- Use the <see cref="T:log4net.LogManager"/> to obtain logger instances
- that implement this interface. The <see cref="M:log4net.LogManager.GetLogger(System.Reflection.Assembly,System.Type)"/>
- static method is used to get logger instances.
- </para>
- <para>
- This class contains methods for logging at different levels and also
- has properties for determining if those logging levels are
- enabled in the current configuration.
- </para>
- <para>
- This interface can be implemented in different ways. This documentation
- specifies reasonable behavior that a caller can expect from the actual
- implementation, however different implementations reserve the right to
- do things differently.
- </para>
- </remarks>
- <example>Simple example of logging messages
- <code lang="C#">
- ILog log = LogManager.GetLogger("application-log");
-
- log.Info("Application Start");
- log.Debug("This is a debug message");
-
- if (log.IsDebugEnabled)
- {
- log.Debug("This is another debug message");
- }
- </code>
- </example>
- <seealso cref="T:log4net.LogManager"/>
- <seealso cref="M:log4net.LogManager.GetLogger(System.Reflection.Assembly,System.Type)"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.ILog.Debug(System.Object)">
- <overloads>Log a message object with the <see cref="F:log4net.Core.Level.Debug"/> level.</overloads>
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>DEBUG</c>
- enabled by comparing the level of this logger with the
- <see cref="F:log4net.Core.Level.Debug"/> level. If this logger is
- <c>DEBUG</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of
- the additivity flag.
- </para>
- <para><b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.Debug(System.Object,System.Exception)">
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Debug"/> level including
- the stack trace of the <see cref="T:System.Exception"/> passed
- as a parameter.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- See the <see cref="M:log4net.ILog.Debug(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.DebugFormat(System.String,System.Object[])">
- <overloads>Log a formatted string with the <see cref="F:log4net.Core.Level.Debug"/> level.</overloads>
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.DebugFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.DebugFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.DebugFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.DebugFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.Info(System.Object)">
- <overloads>Log a message object with the <see cref="F:log4net.Core.Level.Info"/> level.</overloads>
- <summary>
- Logs a message object with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <remarks>
- <para>
- This method first checks if this logger is <c>INFO</c>
- enabled by comparing the level of this logger with the
- <see cref="F:log4net.Core.Level.Info"/> level. If this logger is
- <c>INFO</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para><b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.ILog.Info(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- <param name="message">The message object to log.</param>
- <seealso cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.Info(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>INFO</c> level including
- the stack trace of the <see cref="T:System.Exception"/> passed
- as a parameter.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- See the <see cref="M:log4net.ILog.Info(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.InfoFormat(System.String,System.Object[])">
- <overloads>Log a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.</overloads>
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.InfoFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.InfoFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.InfoFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.InfoFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.Warn(System.Object)">
- <overloads>Log a message object with the <see cref="F:log4net.Core.Level.Warn"/> level.</overloads>
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <remarks>
- <para>
- This method first checks if this logger is <c>WARN</c>
- enabled by comparing the level of this logger with the
- <see cref="F:log4net.Core.Level.Warn"/> level. If this logger is
- <c>WARN</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para><b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- <param name="message">The message object to log.</param>
- <seealso cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.Warn(System.Object,System.Exception)">
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Warn"/> level including
- the stack trace of the <see cref="T:System.Exception"/> passed
- as a parameter.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- See the <see cref="M:log4net.ILog.Warn(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.WarnFormat(System.String,System.Object[])">
- <overloads>Log a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.</overloads>
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.WarnFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.WarnFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.WarnFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.WarnFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.Error(System.Object)">
- <overloads>Log a message object with the <see cref="F:log4net.Core.Level.Error"/> level.</overloads>
- <summary>
- Logs a message object with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>ERROR</c>
- enabled by comparing the level of this logger with the
- <see cref="F:log4net.Core.Level.Error"/> level. If this logger is
- <c>ERROR</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para><b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.ILog.Error(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.Error(System.Object,System.Exception)">
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Error"/> level including
- the stack trace of the <see cref="T:System.Exception"/> passed
- as a parameter.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- See the <see cref="M:log4net.ILog.Error(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.ErrorFormat(System.String,System.Object[])">
- <overloads>Log a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.</overloads>
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.ErrorFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.ErrorFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.ErrorFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.ErrorFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.Fatal(System.Object)">
- <overloads>Log a message object with the <see cref="F:log4net.Core.Level.Fatal"/> level.</overloads>
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <remarks>
- <para>
- This method first checks if this logger is <c>FATAL</c>
- enabled by comparing the level of this logger with the
- <see cref="F:log4net.Core.Level.Fatal"/> level. If this logger is
- <c>FATAL</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para><b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- <param name="message">The message object to log.</param>
- <seealso cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.Fatal(System.Object,System.Exception)">
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Fatal"/> level including
- the stack trace of the <see cref="T:System.Exception"/> passed
- as a parameter.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- See the <see cref="M:log4net.ILog.Fatal(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.FatalFormat(System.String,System.Object[])">
- <overloads>Log a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.</overloads>
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.FatalFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.FatalFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.FatalFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.FatalFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="P:log4net.ILog.IsDebugEnabled">
- <summary>
- Checks if this logger is enabled for the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <see cref="F:log4net.Core.Level.Debug"/> events, <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- This function is intended to lessen the computational cost of
- disabled log debug statements.
- </para>
- <para> For some ILog interface <c>log</c>, when you write:</para>
- <code lang="C#">
- log.Debug("This is entry number: " + i );
- </code>
- <para>
- You incur the cost constructing the message, string construction and concatenation in
- this case, regardless of whether the message is logged or not.
- </para>
- <para>
- If you are worried about speed (who isn't), then you should write:
- </para>
- <code lang="C#">
- if (log.IsDebugEnabled)
- {
- log.Debug("This is entry number: " + i );
- }
- </code>
- <para>
- This way you will not incur the cost of parameter
- construction if debugging is disabled for <c>log</c>. On
- the other hand, if the <c>log</c> is debug enabled, you
- will incur the cost of evaluating whether the logger is debug
- enabled twice. Once in <see cref="P:log4net.ILog.IsDebugEnabled"/> and once in
- the <see cref="M:log4net.ILog.Debug(System.Object)"/>. This is an insignificant overhead
- since evaluating a logger takes about 1% of the time it
- takes to actually log. This is the preferred style of logging.
- </para>
- <para>Alternatively if your logger is available statically then the is debug
- enabled state can be stored in a static variable like this:
- </para>
- <code lang="C#">
- private static readonly bool isDebugEnabled = log.IsDebugEnabled;
- </code>
- <para>
- Then when you come to log you can write:
- </para>
- <code lang="C#">
- if (isDebugEnabled)
- {
- log.Debug("This is entry number: " + i );
- }
- </code>
- <para>
- This way the debug enabled state is only queried once
- when the class is loaded. Using a <c>private static readonly</c>
- variable is the most efficient because it is a run time constant
- and can be heavily optimized by the JIT compiler.
- </para>
- <para>
- Of course if you use a static readonly variable to
- hold the enabled state of the logger then you cannot
- change the enabled state at runtime to vary the logging
- that is produced. You have to decide if you need absolute
- speed or runtime flexibility.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="M:log4net.ILog.DebugFormat(System.IFormatProvider,System.String,System.Object[])"/>
- </member>
- <member name="P:log4net.ILog.IsInfoEnabled">
- <summary>
- Checks if this logger is enabled for the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <see cref="F:log4net.Core.Level.Info"/> events, <c>false</c> otherwise.
- </value>
- <remarks>
- For more information see <see cref="P:log4net.ILog.IsDebugEnabled"/>.
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object)"/>
- <seealso cref="M:log4net.ILog.InfoFormat(System.IFormatProvider,System.String,System.Object[])"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.ILog.IsWarnEnabled">
- <summary>
- Checks if this logger is enabled for the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <see cref="F:log4net.Core.Level.Warn"/> events, <c>false</c> otherwise.
- </value>
- <remarks>
- For more information see <see cref="P:log4net.ILog.IsDebugEnabled"/>.
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object)"/>
- <seealso cref="M:log4net.ILog.WarnFormat(System.IFormatProvider,System.String,System.Object[])"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.ILog.IsErrorEnabled">
- <summary>
- Checks if this logger is enabled for the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <see cref="F:log4net.Core.Level.Error"/> events, <c>false</c> otherwise.
- </value>
- <remarks>
- For more information see <see cref="P:log4net.ILog.IsDebugEnabled"/>.
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object)"/>
- <seealso cref="M:log4net.ILog.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.ILog.IsFatalEnabled">
- <summary>
- Checks if this logger is enabled for the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <see cref="F:log4net.Core.Level.Fatal"/> events, <c>false</c> otherwise.
- </value>
- <remarks>
- For more information see <see cref="P:log4net.ILog.IsDebugEnabled"/>.
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object)"/>
- <seealso cref="M:log4net.ILog.FatalFormat(System.IFormatProvider,System.String,System.Object[])"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.Core.LogImpl.#ctor(log4net.Core.ILogger)">
- <summary>
- Construct a new wrapper for the specified logger.
- </summary>
- <param name="logger">The logger to wrap.</param>
- <remarks>
- <para>
- Construct a new wrapper for the specified logger.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.ReloadLevels(log4net.Repository.ILoggerRepository)">
- <summary>
- Virtual method called when the configuration of the repository changes
- </summary>
- <param name="repository">the repository holding the levels</param>
- <remarks>
- <para>
- Virtual method called when the configuration of the repository changes
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Debug(System.Object)">
- <summary>
- Logs a message object with the <c>DEBUG</c> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>DEBUG</c>
- enabled by comparing the level of this logger with the
- <c>DEBUG</c> level. If this logger is
- <c>DEBUG</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para>
- <b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.Core.LogImpl.Debug(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Debug(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>DEBUG</c> level
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Logs a message object with the <c>DEBUG</c> level including
- the stack trace of the <see cref="T:System.Exception"/> <paramref name="exception"/> passed
- as a parameter.
- </para>
- <para>
- See the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- </member>
- <member name="M:log4net.Core.LogImpl.DebugFormat(System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>DEBUG</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.DebugFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.DebugFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <c>DEBUG</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.DebugFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.DebugFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>DEBUG</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.DebugFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.DebugFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>DEBUG</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.DebugFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.DebugFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>DEBUG</c> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Info(System.Object)">
- <summary>
- Logs a message object with the <c>INFO</c> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>INFO</c>
- enabled by comparing the level of this logger with the
- <c>INFO</c> level. If this logger is
- <c>INFO</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of
- the additivity flag.
- </para>
- <para>
- <b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.Core.LogImpl.Info(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Info(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>INFO</c> level.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Logs a message object with the <c>INFO</c> level including
- the stack trace of the <see cref="T:System.Exception"/> <paramref name="exception"/>
- passed as a parameter.
- </para>
- <para>
- See the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- </member>
- <member name="M:log4net.Core.LogImpl.InfoFormat(System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>INFO</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.InfoFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.InfoFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <c>INFO</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.InfoFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.InfoFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>INFO</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.InfoFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.InfoFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>INFO</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.InfoFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.InfoFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>INFO</c> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Warn(System.Object)">
- <summary>
- Logs a message object with the <c>WARN</c> level.
- </summary>
- <param name="message">the message object to log</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>WARN</c>
- enabled by comparing the level of this logger with the
- <c>WARN</c> level. If this logger is
- <c>WARN</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger and
- also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para>
- <b>WARNING</b> Note that passing an <see cref="T:System.Exception"/> to this
- method will print the name of the <see cref="T:System.Exception"/> but no
- stack trace. To print a stack trace use the
- <see cref="M:log4net.Core.LogImpl.Warn(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Warn(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>WARN</c> level
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Logs a message object with the <c>WARN</c> level including
- the stack trace of the <see cref="T:System.Exception"/> <paramref name="exception"/>
- passed as a parameter.
- </para>
- <para>
- See the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- </member>
- <member name="M:log4net.Core.LogImpl.WarnFormat(System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>WARN</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.WarnFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.WarnFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <c>WARN</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.WarnFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.WarnFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>WARN</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.WarnFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.WarnFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>WARN</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.WarnFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.WarnFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>WARN</c> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Error(System.Object)">
- <summary>
- Logs a message object with the <c>ERROR</c> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>ERROR</c>
- enabled by comparing the level of this logger with the
- <c>ERROR</c> level. If this logger is
- <c>ERROR</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger and
- also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para>
- <b>WARNING</b> Note that passing an <see cref="T:System.Exception"/> to this
- method will print the name of the <see cref="T:System.Exception"/> but no
- stack trace. To print a stack trace use the
- <see cref="M:log4net.Core.LogImpl.Error(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Error(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>ERROR</c> level
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Logs a message object with the <c>ERROR</c> level including
- the stack trace of the <see cref="T:System.Exception"/> <paramref name="exception"/>
- passed as a parameter.
- </para>
- <para>
- See the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- </member>
- <member name="M:log4net.Core.LogImpl.ErrorFormat(System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>ERROR</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.ErrorFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <c>ERROR</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.ErrorFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>ERROR</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.ErrorFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>ERROR</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.ErrorFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>ERROR</c> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Fatal(System.Object)">
- <summary>
- Logs a message object with the <c>FATAL</c> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>FATAL</c>
- enabled by comparing the level of this logger with the
- <c>FATAL</c> level. If this logger is
- <c>FATAL</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger and
- also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para>
- <b>WARNING</b> Note that passing an <see cref="T:System.Exception"/> to this
- method will print the name of the <see cref="T:System.Exception"/> but no
- stack trace. To print a stack trace use the
- <see cref="M:log4net.Core.LogImpl.Fatal(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Fatal(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>FATAL</c> level
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Logs a message object with the <c>FATAL</c> level including
- the stack trace of the <see cref="T:System.Exception"/> <paramref name="exception"/>
- passed as a parameter.
- </para>
- <para>
- See the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- </member>
- <member name="M:log4net.Core.LogImpl.FatalFormat(System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>FATAL</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.FatalFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.FatalFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <c>FATAL</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.FatalFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.FatalFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>FATAL</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.FatalFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.FatalFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>FATAL</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.FatalFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.FatalFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>FATAL</c> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.LoggerRepositoryConfigurationChanged(System.Object,System.EventArgs)">
- <summary>
- Event handler for the <see cref="E:log4net.Repository.ILoggerRepository.ConfigurationChanged"/> event
- </summary>
- <param name="sender">the repository</param>
- <param name="e">Empty</param>
- </member>
- <member name="F:log4net.Core.LogImpl.ThisDeclaringType">
- <summary>
- The fully qualified name of this declaring type not the type of any subclass.
- </summary>
- </member>
- <member name="P:log4net.Core.LogImpl.IsDebugEnabled">
- <summary>
- Checks if this logger is enabled for the <c>DEBUG</c>
- level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <c>DEBUG</c> events,
- <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- This function is intended to lessen the computational cost of
- disabled log debug statements.
- </para>
- <para>
- For some <c>log</c> Logger object, when you write:
- </para>
- <code lang="C#">
- log.Debug("This is entry number: " + i );
- </code>
- <para>
- You incur the cost constructing the message, concatenation in
- this case, regardless of whether the message is logged or not.
- </para>
- <para>
- If you are worried about speed, then you should write:
- </para>
- <code lang="C#">
- if (log.IsDebugEnabled())
- {
- log.Debug("This is entry number: " + i );
- }
- </code>
- <para>
- This way you will not incur the cost of parameter
- construction if debugging is disabled for <c>log</c>. On
- the other hand, if the <c>log</c> is debug enabled, you
- will incur the cost of evaluating whether the logger is debug
- enabled twice. Once in <c>IsDebugEnabled</c> and once in
- the <c>Debug</c>. This is an insignificant overhead
- since evaluating a logger takes about 1% of the time it
- takes to actually log.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LogImpl.IsInfoEnabled">
- <summary>
- Checks if this logger is enabled for the <c>INFO</c> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <c>INFO</c> events,
- <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- See <see cref="P:log4net.Core.LogImpl.IsDebugEnabled"/> for more information and examples
- of using this method.
- </para>
- </remarks>
- <seealso cref="P:log4net.Core.LogImpl.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.Core.LogImpl.IsWarnEnabled">
- <summary>
- Checks if this logger is enabled for the <c>WARN</c> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <c>WARN</c> events,
- <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- See <see cref="P:log4net.Core.LogImpl.IsDebugEnabled"/> for more information and examples
- of using this method.
- </para>
- </remarks>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.Core.LogImpl.IsErrorEnabled">
- <summary>
- Checks if this logger is enabled for the <c>ERROR</c> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <c>ERROR</c> events,
- <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- See <see cref="P:log4net.Core.LogImpl.IsDebugEnabled"/> for more information and examples of using this method.
- </para>
- </remarks>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.Core.LogImpl.IsFatalEnabled">
- <summary>
- Checks if this logger is enabled for the <c>FATAL</c> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <c>FATAL</c> events,
- <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- See <see cref="P:log4net.Core.LogImpl.IsDebugEnabled"/> for more information and examples of using this method.
- </para>
- </remarks>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="T:log4net.Core.SecurityContext">
- <summary>
- A SecurityContext used by log4net when interacting with protected resources
- </summary>
- <remarks>
- <para>
- A SecurityContext used by log4net when interacting with protected resources
- for example with operating system services. This can be used to impersonate
- a principal that has been granted privileges on the system resources.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Core.SecurityContext.Impersonate(System.Object)">
- <summary>
- Impersonate this SecurityContext
- </summary>
- <param name="state">State supplied by the caller</param>
- <returns>An <see cref="T:System.IDisposable"/> instance that will
- revoke the impersonation of this SecurityContext, or <c>null</c></returns>
- <remarks>
- <para>
- Impersonate this security context. Further calls on the current
- thread should now be made in the security context provided
- by this object. When the <see cref="T:System.IDisposable"/> result
- <see cref="M:System.IDisposable.Dispose"/> method is called the security
- context of the thread should be reverted to the state it was in
- before <see cref="M:log4net.Core.SecurityContext.Impersonate(System.Object)"/> was called.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.SecurityContextProvider">
- <summary>
- The <see cref="T:log4net.Core.SecurityContextProvider"/> providers default <see cref="T:log4net.Core.SecurityContext"/> instances.
- </summary>
- <remarks>
- <para>
- A configured component that interacts with potentially protected system
- resources uses a <see cref="T:log4net.Core.SecurityContext"/> to provide the elevated
- privileges required. If the <see cref="T:log4net.Core.SecurityContext"/> object has
- been not been explicitly provided to the component then the component
- will request one from this <see cref="T:log4net.Core.SecurityContextProvider"/>.
- </para>
- <para>
- By default the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is
- an instance of <see cref="T:log4net.Core.SecurityContextProvider"/> which returns only
- <see cref="T:log4net.Util.NullSecurityContext"/> objects. This is a reasonable default
- where the privileges required are not know by the system.
- </para>
- <para>
- This default behavior can be overridden by subclassing the <see cref="T:log4net.Core.SecurityContextProvider"/>
- and overriding the <see cref="M:log4net.Core.SecurityContextProvider.CreateSecurityContext(System.Object)"/> method to return
- the desired <see cref="T:log4net.Core.SecurityContext"/> objects. The default provider
- can be replaced by programmatically setting the value of the
- <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> property.
- </para>
- <para>
- An alternative is to use the <c>log4net.Config.SecurityContextProviderAttribute</c>
- This attribute can be applied to an assembly in the same way as the
- <c>log4net.Config.XmlConfiguratorAttribute"</c>. The attribute takes
- the type to use as the <see cref="T:log4net.Core.SecurityContextProvider"/> as an argument.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.SecurityContextProvider.s_defaultProvider">
- <summary>
- The default provider
- </summary>
- </member>
- <member name="M:log4net.Core.SecurityContextProvider.#ctor">
- <summary>
- Protected default constructor to allow subclassing
- </summary>
- <remarks>
- <para>
- Protected default constructor to allow subclassing
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.SecurityContextProvider.CreateSecurityContext(System.Object)">
- <summary>
- Create a SecurityContext for a consumer
- </summary>
- <param name="consumer">The consumer requesting the SecurityContext</param>
- <returns>An impersonation context</returns>
- <remarks>
- <para>
- The default implementation is to return a <see cref="T:log4net.Util.NullSecurityContext"/>.
- </para>
- <para>
- Subclasses should override this method to provide their own
- behavior.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.SecurityContextProvider.DefaultProvider">
- <summary>
- Gets or sets the default SecurityContextProvider
- </summary>
- <value>
- The default SecurityContextProvider
- </value>
- <remarks>
- <para>
- The default provider is used by configured components that
- require a <see cref="T:log4net.Core.SecurityContext"/> and have not had one
- given to them.
- </para>
- <para>
- By default this is an instance of <see cref="T:log4net.Core.SecurityContextProvider"/>
- that returns <see cref="T:log4net.Util.NullSecurityContext"/> objects.
- </para>
- <para>
- The default provider can be set programmatically by setting
- the value of this property to a sub class of <see cref="T:log4net.Core.SecurityContextProvider"/>
- that has the desired behavior.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.WrapperCreationHandler">
- <summary>
- Delegate used to handle creation of new wrappers.
- </summary>
- <param name="logger">The logger to wrap in a wrapper.</param>
- <remarks>
- <para>
- Delegate used to handle creation of new wrappers. This delegate
- is called from the <see cref="M:log4net.Core.WrapperMap.CreateNewWrapperObject(log4net.Core.ILogger)"/>
- method to construct the wrapper for the specified logger.
- </para>
- <para>
- The delegate to use is supplied to the <see cref="T:log4net.Core.WrapperMap"/>
- constructor.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.WrapperMap">
- <summary>
- Maps between logger objects and wrapper objects.
- </summary>
- <remarks>
- <para>
- This class maintains a mapping between <see cref="T:log4net.Core.ILogger"/> objects and
- <see cref="T:log4net.Core.ILoggerWrapper"/> objects. Use the <see cref="M:log4net.Core.WrapperMap.GetWrapper(log4net.Core.ILogger)"/> method to
- lookup the <see cref="T:log4net.Core.ILoggerWrapper"/> for the specified <see cref="T:log4net.Core.ILogger"/>.
- </para>
- <para>
- New wrapper instances are created by the <see cref="M:log4net.Core.WrapperMap.CreateNewWrapperObject(log4net.Core.ILogger)"/>
- method. The default behavior is for this method to delegate construction
- of the wrapper to the <see cref="T:log4net.Core.WrapperCreationHandler"/> delegate supplied
- to the constructor. This allows specialization of the behavior without
- requiring subclassing of this type.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.WrapperMap.#ctor(log4net.Core.WrapperCreationHandler)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Core.WrapperMap"/>
- </summary>
- <param name="createWrapperHandler">The handler to use to create the wrapper objects.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.WrapperMap"/> class with
- the specified handler to create the wrapper objects.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.WrapperMap.GetWrapper(log4net.Core.ILogger)">
- <summary>
- Gets the wrapper object for the specified logger.
- </summary>
- <returns>The wrapper object for the specified logger</returns>
- <remarks>
- <para>
- If the logger is null then the corresponding wrapper is null.
- </para>
- <para>
- Looks up the wrapper it it has previously been requested and
- returns it. If the wrapper has never been requested before then
- the <see cref="M:log4net.Core.WrapperMap.CreateNewWrapperObject(log4net.Core.ILogger)"/> virtual method is
- called.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.WrapperMap.CreateNewWrapperObject(log4net.Core.ILogger)">
- <summary>
- Creates the wrapper object for the specified logger.
- </summary>
- <param name="logger">The logger to wrap in a wrapper.</param>
- <returns>The wrapper object for the logger.</returns>
- <remarks>
- <para>
- This implementation uses the <see cref="T:log4net.Core.WrapperCreationHandler"/>
- passed to the constructor to create the wrapper. This method
- can be overridden in a subclass.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.WrapperMap.RepositoryShutdown(log4net.Repository.ILoggerRepository)">
- <summary>
- Called when a monitored repository shutdown event is received.
- </summary>
- <param name="repository">The <see cref="T:log4net.Repository.ILoggerRepository"/> that is shutting down</param>
- <remarks>
- <para>
- This method is called when a <see cref="T:log4net.Repository.ILoggerRepository"/> that this
- <see cref="T:log4net.Core.WrapperMap"/> is holding loggers for has signaled its shutdown
- event <see cref="E:log4net.Repository.ILoggerRepository.ShutdownEvent"/>. The default
- behavior of this method is to release the references to the loggers
- and their wrappers generated for this repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.WrapperMap.ILoggerRepository_Shutdown(System.Object,System.EventArgs)">
- <summary>
- Event handler for repository shutdown event.
- </summary>
- <param name="sender">The sender of the event.</param>
- <param name="e">The event args.</param>
- </member>
- <member name="F:log4net.Core.WrapperMap.m_repositories">
- <summary>
- Map of logger repositories to hashtables of ILogger to ILoggerWrapper mappings
- </summary>
- </member>
- <member name="F:log4net.Core.WrapperMap.m_createWrapperHandler">
- <summary>
- The handler to use to create the extension wrapper objects.
- </summary>
- </member>
- <member name="F:log4net.Core.WrapperMap.m_shutdownHandler">
- <summary>
- Internal reference to the delegate used to register for repository shutdown events.
- </summary>
- </member>
- <member name="P:log4net.Core.WrapperMap.Repositories">
- <summary>
- Gets the map of logger repositories.
- </summary>
- <value>
- Map of logger repositories.
- </value>
- <remarks>
- <para>
- Gets the hashtable that is keyed on <see cref="T:log4net.Repository.ILoggerRepository"/>. The
- values are hashtables keyed on <see cref="T:log4net.Core.ILogger"/> with the
- value being the corresponding <see cref="T:log4net.Core.ILoggerWrapper"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.DateFormatter.AbsoluteTimeDateFormatter">
- <summary>
- Formats a <see cref="T:System.DateTime"/> as <c>"HH:mm:ss,fff"</c>.
- </summary>
- <remarks>
- <para>
- Formats a <see cref="T:System.DateTime"/> in the format <c>"HH:mm:ss,fff"</c> for example, <c>"15:49:37,459"</c>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.DateFormatter.IDateFormatter">
- <summary>
- Render a <see cref="T:System.DateTime"/> as a string.
- </summary>
- <remarks>
- <para>
- Interface to abstract the rendering of a <see cref="T:System.DateTime"/>
- instance into a string.
- </para>
- <para>
- The <see cref="M:log4net.DateFormatter.IDateFormatter.FormatDate(System.DateTime,System.IO.TextWriter)"/> method is used to render the
- date to a text writer.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.DateFormatter.IDateFormatter.FormatDate(System.DateTime,System.IO.TextWriter)">
- <summary>
- Formats the specified date as a string.
- </summary>
- <param name="dateToFormat">The date to format.</param>
- <param name="writer">The writer to write to.</param>
- <remarks>
- <para>
- Format the <see cref="T:System.DateTime"/> as a string and write it
- to the <see cref="T:System.IO.TextWriter"/> provided.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.AbsoluteTimeDateFormat">
- <summary>
- String constant used to specify AbsoluteTimeDateFormat in layouts. Current value is <b>ABSOLUTE</b>.
- </summary>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.DateAndTimeDateFormat">
- <summary>
- String constant used to specify DateTimeDateFormat in layouts. Current value is <b>DATE</b>.
- </summary>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.Iso8601TimeDateFormat">
- <summary>
- String constant used to specify ISO8601DateFormat in layouts. Current value is <b>ISO8601</b>.
- </summary>
- </member>
- <member name="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)">
- <summary>
- Renders the date into a string. Format is <c>"HH:mm:ss"</c>.
- </summary>
- <param name="dateToFormat">The date to render into a string.</param>
- <param name="buffer">The string builder to write to.</param>
- <remarks>
- <para>
- Subclasses should override this method to render the date
- into a string using a precision up to the second. This method
- will be called at most once per second and the result will be
- reused if it is needed again during the same second.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDate(System.DateTime,System.IO.TextWriter)">
- <summary>
- Renders the date into a string. Format is "HH:mm:ss,fff".
- </summary>
- <param name="dateToFormat">The date to render into a string.</param>
- <param name="writer">The writer to write to.</param>
- <remarks>
- <para>
- Uses the <see cref="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)"/> method to generate the
- time string up to the seconds and then appends the current
- milliseconds. The results from <see cref="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)"/> are
- cached and <see cref="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)"/> is called at most once
- per second.
- </para>
- <para>
- Sub classes should override <see cref="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)"/>
- rather than <see cref="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDate(System.DateTime,System.IO.TextWriter)"/>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.s_lastTimeToTheSecond">
- <summary>
- Last stored time with precision up to the second.
- </summary>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.s_lastTimeBuf">
- <summary>
- Last stored time with precision up to the second, formatted
- as a string.
- </summary>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.s_lastTimeString">
- <summary>
- Last stored time with precision up to the second, formatted
- as a string.
- </summary>
- </member>
- <member name="T:log4net.DateFormatter.DateTimeDateFormatter">
- <summary>
- Formats a <see cref="T:System.DateTime"/> as <c>"dd MMM yyyy HH:mm:ss,fff"</c>
- </summary>
- <remarks>
- <para>
- Formats a <see cref="T:System.DateTime"/> in the format
- <c>"dd MMM yyyy HH:mm:ss,fff"</c> for example,
- <c>"06 Nov 1994 15:49:37,459"</c>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Angelika Schnagl</author>
- </member>
- <member name="M:log4net.DateFormatter.DateTimeDateFormatter.#ctor">
- <summary>
- Default constructor.
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.DateFormatter.DateTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)">
- <summary>
- Formats the date without the milliseconds part
- </summary>
- <param name="dateToFormat">The date to format.</param>
- <param name="buffer">The string builder to write to.</param>
- <remarks>
- <para>
- Formats a DateTime in the format <c>"dd MMM yyyy HH:mm:ss"</c>
- for example, <c>"06 Nov 1994 15:49:37"</c>.
- </para>
- <para>
- The base class will append the <c>",fff"</c> milliseconds section.
- This method will only be called at most once per second.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.DateFormatter.DateTimeDateFormatter.m_dateTimeFormatInfo">
- <summary>
- The format info for the invariant culture.
- </summary>
- </member>
- <member name="T:log4net.DateFormatter.Iso8601DateFormatter">
- <summary>
- Formats the <see cref="T:System.DateTime"/> as <c>"yyyy-MM-dd HH:mm:ss,fff"</c>.
- </summary>
- <remarks>
- <para>
- Formats the <see cref="T:System.DateTime"/> specified as a string: <c>"yyyy-MM-dd HH:mm:ss,fff"</c>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.DateFormatter.Iso8601DateFormatter.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.DateFormatter.Iso8601DateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)">
- <summary>
- Formats the date without the milliseconds part
- </summary>
- <param name="dateToFormat">The date to format.</param>
- <param name="buffer">The string builder to write to.</param>
- <remarks>
- <para>
- Formats the date specified as a string: <c>"yyyy-MM-dd HH:mm:ss"</c>.
- </para>
- <para>
- The base class will append the <c>",fff"</c> milliseconds section.
- This method will only be called at most once per second.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.DateFormatter.SimpleDateFormatter">
- <summary>
- Formats the <see cref="T:System.DateTime"/> using the <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/> method.
- </summary>
- <remarks>
- <para>
- Formats the <see cref="T:System.DateTime"/> using the <see cref="T:System.DateTime"/> <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/> method.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.DateFormatter.SimpleDateFormatter.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="format">The format string.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.DateFormatter.SimpleDateFormatter"/> class
- with the specified format string.
- </para>
- <para>
- The format string must be compatible with the options
- that can be supplied to <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.DateFormatter.SimpleDateFormatter.FormatDate(System.DateTime,System.IO.TextWriter)">
- <summary>
- Formats the date using <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/>.
- </summary>
- <param name="dateToFormat">The date to convert to a string.</param>
- <param name="writer">The writer to write to.</param>
- <remarks>
- <para>
- Uses the date format string supplied to the constructor to call
- the <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/> method to format the date.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.DateFormatter.SimpleDateFormatter.m_formatString">
- <summary>
- The format string used to format the <see cref="T:System.DateTime"/>.
- </summary>
- <remarks>
- <para>
- The format string must be compatible with the options
- that can be supplied to <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.DenyAllFilter">
- <summary>
- This filter drops all <see cref="T:log4net.Core.LoggingEvent"/>.
- </summary>
- <remarks>
- <para>
- You can add this filter to the end of a filter chain to
- switch from the default "accept all unless instructed otherwise"
- filtering behavior to a "deny all unless instructed otherwise"
- behavior.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Filter.FilterSkeleton">
- <summary>
- Subclass this type to implement customized logging event filtering
- </summary>
- <remarks>
- <para>
- Users should extend this class to implement customized logging
- event filtering. Note that <see cref="T:log4net.Repository.Hierarchy.Logger"/> and
- <see cref="T:log4net.Appender.AppenderSkeleton"/>, the parent class of all standard
- appenders, have built-in filtering rules. It is suggested that you
- first use and understand the built-in rules before rushing to write
- your own custom filters.
- </para>
- <para>
- This abstract class assumes and also imposes that filters be
- organized in a linear chain. The <see cref="M:log4net.Filter.FilterSkeleton.Decide(log4net.Core.LoggingEvent)"/>
- method of each filter is called sequentially, in the order of their
- addition to the chain.
- </para>
- <para>
- The <see cref="M:log4net.Filter.FilterSkeleton.Decide(log4net.Core.LoggingEvent)"/> method must return one
- of the integer constants <see cref="F:log4net.Filter.FilterDecision.Deny"/>,
- <see cref="F:log4net.Filter.FilterDecision.Neutral"/> or <see cref="F:log4net.Filter.FilterDecision.Accept"/>.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned, then the log event is dropped
- immediately without consulting with the remaining filters.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Neutral"/> is returned, then the next filter
- in the chain is consulted. If there are no more filters in the
- chain, then the log event is logged. Thus, in the presence of no
- filters, the default behavior is to log all logging events.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned, then the log
- event is logged without consulting the remaining filters.
- </para>
- <para>
- The philosophy of log4net filters is largely inspired from the
- Linux ipchains.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Filter.IFilter">
- <summary>
- Implement this interface to provide customized logging event filtering
- </summary>
- <remarks>
- <para>
- Users should implement this interface to implement customized logging
- event filtering. Note that <see cref="T:log4net.Repository.Hierarchy.Logger"/> and
- <see cref="T:log4net.Appender.AppenderSkeleton"/>, the parent class of all standard
- appenders, have built-in filtering rules. It is suggested that you
- first use and understand the built-in rules before rushing to write
- your own custom filters.
- </para>
- <para>
- This abstract class assumes and also imposes that filters be
- organized in a linear chain. The <see cref="M:log4net.Filter.IFilter.Decide(log4net.Core.LoggingEvent)"/>
- method of each filter is called sequentially, in the order of their
- addition to the chain.
- </para>
- <para>
- The <see cref="M:log4net.Filter.IFilter.Decide(log4net.Core.LoggingEvent)"/> method must return one
- of the integer constants <see cref="F:log4net.Filter.FilterDecision.Deny"/>,
- <see cref="F:log4net.Filter.FilterDecision.Neutral"/> or <see cref="F:log4net.Filter.FilterDecision.Accept"/>.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned, then the log event is dropped
- immediately without consulting with the remaining filters.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Neutral"/> is returned, then the next filter
- in the chain is consulted. If there are no more filters in the
- chain, then the log event is logged. Thus, in the presence of no
- filters, the default behavior is to log all logging events.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned, then the log
- event is logged without consulting the remaining filters.
- </para>
- <para>
- The philosophy of log4net filters is largely inspired from the
- Linux ipchains.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Filter.IFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Decide if the logging event should be logged through an appender.
- </summary>
- <param name="loggingEvent">The LoggingEvent to decide upon</param>
- <returns>The decision of the filter</returns>
- <remarks>
- <para>
- If the decision is <see cref="F:log4net.Filter.FilterDecision.Deny"/>, then the event will be
- dropped. If the decision is <see cref="F:log4net.Filter.FilterDecision.Neutral"/>, then the next
- filter, if any, will be invoked. If the decision is <see cref="F:log4net.Filter.FilterDecision.Accept"/> then
- the event will be logged without consulting with other filters in
- the chain.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.IFilter.Next">
- <summary>
- Property to get and set the next filter
- </summary>
- <value>
- The next filter in the chain
- </value>
- <remarks>
- <para>
- Filters are typically composed into chains. This property allows the next filter in
- the chain to be accessed.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Filter.FilterSkeleton.m_next">
- <summary>
- Points to the next filter in the filter chain.
- </summary>
- <remarks>
- <para>
- See <see cref="P:log4net.Filter.FilterSkeleton.Next"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Filter.FilterSkeleton.ActivateOptions">
- <summary>
- Initialize the filter with the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Filter.FilterSkeleton.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Filter.FilterSkeleton.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Filter.FilterSkeleton.ActivateOptions"/> must be called again.
- </para>
- <para>
- Typically filter's options become active immediately on set,
- however this method must still be called.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Filter.FilterSkeleton.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Decide if the <see cref="T:log4net.Core.LoggingEvent"/> should be logged through an appender.
- </summary>
- <param name="loggingEvent">The <see cref="T:log4net.Core.LoggingEvent"/> to decide upon</param>
- <returns>The decision of the filter</returns>
- <remarks>
- <para>
- If the decision is <see cref="F:log4net.Filter.FilterDecision.Deny"/>, then the event will be
- dropped. If the decision is <see cref="F:log4net.Filter.FilterDecision.Neutral"/>, then the next
- filter, if any, will be invoked. If the decision is <see cref="F:log4net.Filter.FilterDecision.Accept"/> then
- the event will be logged without consulting with other filters in
- the chain.
- </para>
- <para>
- This method is marked <c>abstract</c> and must be implemented
- in a subclass.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.FilterSkeleton.Next">
- <summary>
- Property to get and set the next filter
- </summary>
- <value>
- The next filter in the chain
- </value>
- <remarks>
- <para>
- Filters are typically composed into chains. This property allows the next filter in
- the chain to be accessed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Filter.DenyAllFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.DenyAllFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Always returns the integer constant <see cref="F:log4net.Filter.FilterDecision.Deny"/>
- </summary>
- <param name="loggingEvent">the LoggingEvent to filter</param>
- <returns>Always returns <see cref="F:log4net.Filter.FilterDecision.Deny"/></returns>
- <remarks>
- <para>
- Ignores the event being logged and just returns
- <see cref="F:log4net.Filter.FilterDecision.Deny"/>. This can be used to change the default filter
- chain behavior from <see cref="F:log4net.Filter.FilterDecision.Accept"/> to <see cref="F:log4net.Filter.FilterDecision.Deny"/>. This filter
- should only be used as the last filter in the chain
- as any further filters will be ignored!
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.FilterDecision">
- <summary>
- The return result from <see cref="M:log4net.Filter.IFilter.Decide(log4net.Core.LoggingEvent)"/>
- </summary>
- <remarks>
- <para>
- The return result from <see cref="M:log4net.Filter.IFilter.Decide(log4net.Core.LoggingEvent)"/>
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Filter.FilterDecision.Deny">
- <summary>
- The log event must be dropped immediately without
- consulting with the remaining filters, if any, in the chain.
- </summary>
- </member>
- <member name="F:log4net.Filter.FilterDecision.Neutral">
- <summary>
- This filter is neutral with respect to the log event.
- The remaining filters, if any, should be consulted for a final decision.
- </summary>
- </member>
- <member name="F:log4net.Filter.FilterDecision.Accept">
- <summary>
- The log event must be logged immediately without
- consulting with the remaining filters, if any, in the chain.
- </summary>
- </member>
- <member name="T:log4net.Filter.LevelMatchFilter">
- <summary>
- This is a very simple filter based on <see cref="T:log4net.Core.Level"/> matching.
- </summary>
- <remarks>
- <para>
- The filter admits two options <see cref="P:log4net.Filter.LevelMatchFilter.LevelToMatch"/> and
- <see cref="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch"/>. If there is an exact match between the value
- of the <see cref="P:log4net.Filter.LevelMatchFilter.LevelToMatch"/> option and the <see cref="T:log4net.Core.Level"/> of the
- <see cref="T:log4net.Core.LoggingEvent"/>, then the <see cref="M:log4net.Filter.LevelMatchFilter.Decide(log4net.Core.LoggingEvent)"/> method returns <see cref="F:log4net.Filter.FilterDecision.Accept"/> in
- case the <see cref="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch"/> option value is set
- to <c>true</c>, if it is <c>false</c> then
- <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned. If the <see cref="T:log4net.Core.Level"/> does not match then
- the result will be <see cref="F:log4net.Filter.FilterDecision.Neutral"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Filter.LevelMatchFilter.m_acceptOnMatch">
- <summary>
- flag to indicate if the filter should <see cref="F:log4net.Filter.FilterDecision.Accept"/> on a match
- </summary>
- </member>
- <member name="F:log4net.Filter.LevelMatchFilter.m_levelToMatch">
- <summary>
- the <see cref="T:log4net.Core.Level"/> to match against
- </summary>
- </member>
- <member name="M:log4net.Filter.LevelMatchFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.LevelMatchFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Tests if the <see cref="T:log4net.Core.Level"/> of the logging event matches that of the filter
- </summary>
- <param name="loggingEvent">the event to filter</param>
- <returns>see remarks</returns>
- <remarks>
- <para>
- If the <see cref="T:log4net.Core.Level"/> of the event matches the level of the
- filter then the result of the function depends on the
- value of <see cref="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch"/>. If it is true then
- the function will return <see cref="F:log4net.Filter.FilterDecision.Accept"/>, it it is false then it
- will return <see cref="F:log4net.Filter.FilterDecision.Deny"/>. If the <see cref="T:log4net.Core.Level"/> does not match then
- the result will be <see cref="F:log4net.Filter.FilterDecision.Neutral"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch">
- <summary>
- <see cref="F:log4net.Filter.FilterDecision.Accept"/> when matching <see cref="P:log4net.Filter.LevelMatchFilter.LevelToMatch"/>
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch"/> property is a flag that determines
- the behavior when a matching <see cref="T:log4net.Core.Level"/> is found. If the
- flag is set to true then the filter will <see cref="F:log4net.Filter.FilterDecision.Accept"/> the
- logging event, otherwise it will <see cref="F:log4net.Filter.FilterDecision.Deny"/> the event.
- </para>
- <para>
- The default is <c>true</c> i.e. to <see cref="F:log4net.Filter.FilterDecision.Accept"/> the event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LevelMatchFilter.LevelToMatch">
- <summary>
- The <see cref="T:log4net.Core.Level"/> that the filter will match
- </summary>
- <remarks>
- <para>
- The level that this filter will attempt to match against the
- <see cref="T:log4net.Core.LoggingEvent"/> level. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.LevelRangeFilter">
- <summary>
- This is a simple filter based on <see cref="T:log4net.Core.Level"/> matching.
- </summary>
- <remarks>
- <para>
- The filter admits three options <see cref="P:log4net.Filter.LevelRangeFilter.LevelMin"/> and <see cref="P:log4net.Filter.LevelRangeFilter.LevelMax"/>
- that determine the range of priorities that are matched, and
- <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/>. If there is a match between the range
- of priorities and the <see cref="T:log4net.Core.Level"/> of the <see cref="T:log4net.Core.LoggingEvent"/>, then the
- <see cref="M:log4net.Filter.LevelRangeFilter.Decide(log4net.Core.LoggingEvent)"/> method returns <see cref="F:log4net.Filter.FilterDecision.Accept"/> in case the <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/>
- option value is set to <c>true</c>, if it is <c>false</c>
- then <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned. If there is no match, <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Filter.LevelRangeFilter.m_acceptOnMatch">
- <summary>
- Flag to indicate the behavior when matching a <see cref="T:log4net.Core.Level"/>
- </summary>
- </member>
- <member name="F:log4net.Filter.LevelRangeFilter.m_levelMin">
- <summary>
- the minimum <see cref="T:log4net.Core.Level"/> value to match
- </summary>
- </member>
- <member name="F:log4net.Filter.LevelRangeFilter.m_levelMax">
- <summary>
- the maximum <see cref="T:log4net.Core.Level"/> value to match
- </summary>
- </member>
- <member name="M:log4net.Filter.LevelRangeFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.LevelRangeFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Check if the event should be logged.
- </summary>
- <param name="loggingEvent">the logging event to check</param>
- <returns>see remarks</returns>
- <remarks>
- <para>
- If the <see cref="T:log4net.Core.Level"/> of the logging event is outside the range
- matched by this filter then <see cref="F:log4net.Filter.FilterDecision.Deny"/>
- is returned. If the <see cref="T:log4net.Core.Level"/> is matched then the value of
- <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/> is checked. If it is true then
- <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned, otherwise
- <see cref="F:log4net.Filter.FilterDecision.Neutral"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch">
- <summary>
- <see cref="F:log4net.Filter.FilterDecision.Accept"/> when matching <see cref="P:log4net.Filter.LevelRangeFilter.LevelMin"/> and <see cref="P:log4net.Filter.LevelRangeFilter.LevelMax"/>
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/> property is a flag that determines
- the behavior when a matching <see cref="T:log4net.Core.Level"/> is found. If the
- flag is set to true then the filter will <see cref="F:log4net.Filter.FilterDecision.Accept"/> the
- logging event, otherwise it will <see cref="F:log4net.Filter.FilterDecision.Neutral"/> the event.
- </para>
- <para>
- The default is <c>true</c> i.e. to <see cref="F:log4net.Filter.FilterDecision.Accept"/> the event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LevelRangeFilter.LevelMin">
- <summary>
- Set the minimum matched <see cref="T:log4net.Core.Level"/>
- </summary>
- <remarks>
- <para>
- The minimum level that this filter will attempt to match against the
- <see cref="T:log4net.Core.LoggingEvent"/> level. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LevelRangeFilter.LevelMax">
- <summary>
- Sets the maximum matched <see cref="T:log4net.Core.Level"/>
- </summary>
- <remarks>
- <para>
- The maximum level that this filter will attempt to match against the
- <see cref="T:log4net.Core.LoggingEvent"/> level. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.LoggerMatchFilter">
- <summary>
- Simple filter to match a string in the event's logger name.
- </summary>
- <remarks>
- <para>
- The works very similar to the <see cref="T:log4net.Filter.LevelMatchFilter"/>. It admits two
- options <see cref="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch"/> and <see cref="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch"/>. If the
- <see cref="P:log4net.Core.LoggingEvent.LoggerName"/> of the <see cref="T:log4net.Core.LoggingEvent"/> starts
- with the value of the <see cref="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch"/> option, then the
- <see cref="M:log4net.Filter.LoggerMatchFilter.Decide(log4net.Core.LoggingEvent)"/> method returns <see cref="F:log4net.Filter.FilterDecision.Accept"/> in
- case the <see cref="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch"/> option value is set to <c>true</c>,
- if it is <c>false</c> then <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned.
- </para>
- </remarks>
- <author>Daniel Cazzulino</author>
- </member>
- <member name="F:log4net.Filter.LoggerMatchFilter.m_acceptOnMatch">
- <summary>
- Flag to indicate the behavior when we have a match
- </summary>
- </member>
- <member name="F:log4net.Filter.LoggerMatchFilter.m_loggerToMatch">
- <summary>
- The logger name string to substring match against the event
- </summary>
- </member>
- <member name="M:log4net.Filter.LoggerMatchFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.LoggerMatchFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Check if this filter should allow the event to be logged
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>see remarks</returns>
- <remarks>
- <para>
- The rendered message is matched against the <see cref="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch"/>.
- If the <see cref="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch"/> equals the beginning of
- the incoming <see cref="P:log4net.Core.LoggingEvent.LoggerName"/> (<see cref="M:System.String.StartsWith(System.String)"/>)
- then a match will have occurred. If no match occurs
- this function will return <see cref="F:log4net.Filter.FilterDecision.Neutral"/>
- allowing other filters to check the event. If a match occurs then
- the value of <see cref="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch"/> is checked. If it is
- true then <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned otherwise
- <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch">
- <summary>
- <see cref="F:log4net.Filter.FilterDecision.Accept"/> when matching <see cref="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch"/>
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch"/> property is a flag that determines
- the behavior when a matching <see cref="T:log4net.Core.Level"/> is found. If the
- flag is set to true then the filter will <see cref="F:log4net.Filter.FilterDecision.Accept"/> the
- logging event, otherwise it will <see cref="F:log4net.Filter.FilterDecision.Deny"/> the event.
- </para>
- <para>
- The default is <c>true</c> i.e. to <see cref="F:log4net.Filter.FilterDecision.Accept"/> the event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch">
- <summary>
- The <see cref="P:log4net.Core.LoggingEvent.LoggerName"/> that the filter will match
- </summary>
- <remarks>
- <para>
- This filter will attempt to match this value against logger name in
- the following way. The match will be done against the beginning of the
- logger name (using <see cref="M:System.String.StartsWith(System.String)"/>). The match is
- case sensitive. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.MdcFilter">
- <summary>
- Simple filter to match a keyed string in the <see cref="T:log4net.MDC"/>
- </summary>
- <remarks>
- <para>
- Simple filter to match a keyed string in the <see cref="T:log4net.MDC"/>
- </para>
- <para>
- As the MDC has been replaced with layered properties the
- <see cref="T:log4net.Filter.PropertyFilter"/> should be used instead.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Filter.PropertyFilter">
- <summary>
- Simple filter to match a string an event property
- </summary>
- <remarks>
- <para>
- Simple filter to match a string in the value for a
- specific event property
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Filter.StringMatchFilter">
- <summary>
- Simple filter to match a string in the rendered message
- </summary>
- <remarks>
- <para>
- Simple filter to match a string in the rendered message
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Filter.StringMatchFilter.m_acceptOnMatch">
- <summary>
- Flag to indicate the behavior when we have a match
- </summary>
- </member>
- <member name="F:log4net.Filter.StringMatchFilter.m_stringToMatch">
- <summary>
- The string to substring match against the message
- </summary>
- </member>
- <member name="F:log4net.Filter.StringMatchFilter.m_stringRegexToMatch">
- <summary>
- A string regex to match
- </summary>
- </member>
- <member name="F:log4net.Filter.StringMatchFilter.m_regexToMatch">
- <summary>
- A regex object to match (generated from m_stringRegexToMatch)
- </summary>
- </member>
- <member name="M:log4net.Filter.StringMatchFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.StringMatchFilter.ActivateOptions">
- <summary>
- Initialize and precompile the Regex if required
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Filter.StringMatchFilter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Filter.StringMatchFilter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Filter.StringMatchFilter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Filter.StringMatchFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Check if this filter should allow the event to be logged
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>see remarks</returns>
- <remarks>
- <para>
- The rendered message is matched against the <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/>.
- If the <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/> occurs as a substring within
- the message then a match will have occurred. If no match occurs
- this function will return <see cref="F:log4net.Filter.FilterDecision.Neutral"/>
- allowing other filters to check the event. If a match occurs then
- the value of <see cref="P:log4net.Filter.StringMatchFilter.AcceptOnMatch"/> is checked. If it is
- true then <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned otherwise
- <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.StringMatchFilter.AcceptOnMatch">
- <summary>
- <see cref="F:log4net.Filter.FilterDecision.Accept"/> when matching <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/> or <see cref="P:log4net.Filter.StringMatchFilter.RegexToMatch"/>
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Filter.StringMatchFilter.AcceptOnMatch"/> property is a flag that determines
- the behavior when a matching <see cref="T:log4net.Core.Level"/> is found. If the
- flag is set to true then the filter will <see cref="F:log4net.Filter.FilterDecision.Accept"/> the
- logging event, otherwise it will <see cref="F:log4net.Filter.FilterDecision.Neutral"/> the event.
- </para>
- <para>
- The default is <c>true</c> i.e. to <see cref="F:log4net.Filter.FilterDecision.Accept"/> the event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.StringMatchFilter.StringToMatch">
- <summary>
- Sets the static string to match
- </summary>
- <remarks>
- <para>
- The string that will be substring matched against
- the rendered message. If the message contains this
- string then the filter will match. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.StringMatchFilter.AcceptOnMatch"/>.
- </para>
- <para>
- One of <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/> or <see cref="P:log4net.Filter.StringMatchFilter.RegexToMatch"/>
- must be specified.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.StringMatchFilter.RegexToMatch">
- <summary>
- Sets the regular expression to match
- </summary>
- <remarks>
- <para>
- The regular expression pattern that will be matched against
- the rendered message. If the message matches this
- pattern then the filter will match. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.StringMatchFilter.AcceptOnMatch"/>.
- </para>
- <para>
- One of <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/> or <see cref="P:log4net.Filter.StringMatchFilter.RegexToMatch"/>
- must be specified.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Filter.PropertyFilter.m_key">
- <summary>
- The key to use to lookup the string from the event properties
- </summary>
- </member>
- <member name="M:log4net.Filter.PropertyFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.PropertyFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Check if this filter should allow the event to be logged
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>see remarks</returns>
- <remarks>
- <para>
- The event property for the <see cref="P:log4net.Filter.PropertyFilter.Key"/> is matched against
- the <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/>.
- If the <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/> occurs as a substring within
- the property value then a match will have occurred. If no match occurs
- this function will return <see cref="F:log4net.Filter.FilterDecision.Neutral"/>
- allowing other filters to check the event. If a match occurs then
- the value of <see cref="P:log4net.Filter.StringMatchFilter.AcceptOnMatch"/> is checked. If it is
- true then <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned otherwise
- <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.PropertyFilter.Key">
- <summary>
- The key to lookup in the event properties and then match against.
- </summary>
- <remarks>
- <para>
- The key name to use to lookup in the properties map of the
- <see cref="T:log4net.Core.LoggingEvent"/>. The match will be performed against
- the value of this property if it exists.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.NdcFilter">
- <summary>
- Simple filter to match a string in the <see cref="T:log4net.NDC"/>
- </summary>
- <remarks>
- <para>
- Simple filter to match a string in the <see cref="T:log4net.NDC"/>
- </para>
- <para>
- As the MDC has been replaced with named stacks stored in the
- properties collections the <see cref="T:log4net.Filter.PropertyFilter"/> should
- be used instead.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Filter.NdcFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Sets the <see cref="P:log4net.Filter.PropertyFilter.Key"/> to <c>"NDC"</c>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.AppDomainPatternConverter">
- <summary>
- Write the event appdomain name to the output
- </summary>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LoggingEvent.Domain"/> to the output writer.
- </para>
- </remarks>
- <author>Daniel Cazzulino</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Layout.Pattern.PatternLayoutConverter">
- <summary>
- Abstract class that provides the formatting functionality that
- derived classes need.
- </summary>
- <remarks>
- Conversion specifiers in a conversion patterns are parsed to
- individual PatternConverters. Each of which is responsible for
- converting a logging event in a converter specific manner.
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Util.PatternConverter">
- <summary>
- Abstract class that provides the formatting functionality that
- derived classes need.
- </summary>
- <remarks>
- <para>
- Conversion specifiers in a conversion patterns are parsed to
- individual PatternConverters. Each of which is responsible for
- converting a logging event in a converter specific manner.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Util.PatternConverter.c_renderBufferSize">
- <summary>
- Initial buffer size
- </summary>
- </member>
- <member name="F:log4net.Util.PatternConverter.c_renderBufferMaxCapacity">
- <summary>
- Maximum buffer size before it is recycled
- </summary>
- </member>
- <member name="M:log4net.Util.PatternConverter.#ctor">
- <summary>
- Protected constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.PatternConverter"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Evaluate this pattern converter and write the output to a writer.
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">The state object on which the pattern converter should be executed.</param>
- <remarks>
- <para>
- Derived pattern converters must override this method in order to
- convert conversion specifiers in the appropriate way.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternConverter.SetNext(log4net.Util.PatternConverter)">
- <summary>
- Set the next pattern converter in the chains
- </summary>
- <param name="patternConverter">the pattern converter that should follow this converter in the chain</param>
- <returns>the next converter</returns>
- <remarks>
- <para>
- The PatternConverter can merge with its neighbor during this method (or a sub class).
- Therefore the return value may or may not be the value of the argument passed in.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternConverter.Format(System.IO.TextWriter,System.Object)">
- <summary>
- Write the pattern converter to the writer with appropriate formatting
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">The state object on which the pattern converter should be executed.</param>
- <remarks>
- <para>
- This method calls <see cref="M:log4net.Util.PatternConverter.Convert(System.IO.TextWriter,System.Object)"/> to allow the subclass to perform
- appropriate conversion of the pattern converter. If formatting options have
- been specified via the <see cref="P:log4net.Util.PatternConverter.FormattingInfo"/> then this method will
- apply those formattings before writing the output.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternConverter.SpacePad(System.IO.TextWriter,System.Int32)">
- <summary>
- Fast space padding method.
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> to which the spaces will be appended.</param>
- <param name="length">The number of spaces to be padded.</param>
- <remarks>
- <para>
- Fast space padding method.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.PatternConverter.m_option">
- <summary>
- The option string to the converter
- </summary>
- </member>
- <member name="M:log4net.Util.PatternConverter.WriteDictionary(System.IO.TextWriter,log4net.Repository.ILoggerRepository,System.Collections.IDictionary)">
- <summary>
- Write an dictionary to a <see cref="T:System.IO.TextWriter"/>
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="repository">a <see cref="T:log4net.Repository.ILoggerRepository"/> to use for object conversion</param>
- <param name="value">the value to write to the writer</param>
- <remarks>
- <para>
- Writes the <see cref="T:System.Collections.IDictionary"/> to a writer in the form:
- </para>
- <code>
- {key1=value1, key2=value2, key3=value3}
- </code>
- <para>
- If the <see cref="T:log4net.Repository.ILoggerRepository"/> specified
- is not null then it is used to render the key and value to text, otherwise
- the object's ToString method is called.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternConverter.WriteObject(System.IO.TextWriter,log4net.Repository.ILoggerRepository,System.Object)">
- <summary>
- Write an object to a <see cref="T:System.IO.TextWriter"/>
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="repository">a <see cref="T:log4net.Repository.ILoggerRepository"/> to use for object conversion</param>
- <param name="value">the value to write to the writer</param>
- <remarks>
- <para>
- Writes the Object to a writer. If the <see cref="T:log4net.Repository.ILoggerRepository"/> specified
- is not null then it is used to render the object to text, otherwise
- the object's ToString method is called.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternConverter.Next">
- <summary>
- Get the next pattern converter in the chain
- </summary>
- <value>
- the next pattern converter in the chain
- </value>
- <remarks>
- <para>
- Get the next pattern converter in the chain
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternConverter.FormattingInfo">
- <summary>
- Gets or sets the formatting info for this converter
- </summary>
- <value>
- The formatting info for this converter
- </value>
- <remarks>
- <para>
- Gets or sets the formatting info for this converter
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternConverter.Option">
- <summary>
- Gets or sets the option value for this converter
- </summary>
- <summary>
- The option for this converter
- </summary>
- <remarks>
- <para>
- Gets or sets the option value for this converter
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.PatternLayoutConverter.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Layout.Pattern.PatternLayoutConverter"/> class.
- </summary>
- </member>
- <member name="M:log4net.Layout.Pattern.PatternLayoutConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Derived pattern converters must override this method in order to
- convert conversion specifiers in the correct way.
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">The <see cref="T:log4net.Core.LoggingEvent"/> on which the pattern converter should be executed.</param>
- </member>
- <member name="M:log4net.Layout.Pattern.PatternLayoutConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Derived pattern converters must override this method in order to
- convert conversion specifiers in the correct way.
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">The state object on which the pattern converter should be executed.</param>
- </member>
- <member name="F:log4net.Layout.Pattern.PatternLayoutConverter.m_ignoresException">
- <summary>
- Flag indicating if this converter handles exceptions
- </summary>
- <remarks>
- <c>false</c> if this converter handles exceptions
- </remarks>
- </member>
- <member name="P:log4net.Layout.Pattern.PatternLayoutConverter.IgnoresException">
- <summary>
- Flag indicating if this converter handles the logging event exception
- </summary>
- <value><c>false</c> if this converter handles the logging event exception</value>
- <remarks>
- <para>
- If this converter handles the exception object contained within
- <see cref="T:log4net.Core.LoggingEvent"/>, then this property should be set to
- <c>false</c>. Otherwise, if the layout ignores the exception
- object, then the property should be set to <c>true</c>.
- </para>
- <para>
- Set this value to override a this default setting. The default
- value is <c>true</c>, this converter does not handle the exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.AppDomainPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the event appdomain name to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LoggingEvent.Domain"/> to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.DatePatternConverter">
- <summary>
- Date pattern converter, uses a <see cref="T:log4net.DateFormatter.IDateFormatter"/> to format
- the date of a <see cref="T:log4net.Core.LoggingEvent"/>.
- </summary>
- <remarks>
- <para>
- Render the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> to the writer as a string.
- </para>
- <para>
- The value of the <see cref="P:log4net.Util.PatternConverter.Option"/> determines
- the formatting of the date. The following values are allowed:
- <list type="definition">
- <listheader>
- <term>Option value</term>
- <description>Output</description>
- </listheader>
- <item>
- <term>ISO8601</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/> formatter.
- Formats using the <c>"yyyy-MM-dd HH:mm:ss,fff"</c> pattern.
- </description>
- </item>
- <item>
- <term>DATE</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> formatter.
- Formats using the <c>"dd MMM yyyy HH:mm:ss,fff"</c> for example, <c>"06 Nov 1994 15:49:37,459"</c>.
- </description>
- </item>
- <item>
- <term>ABSOLUTE</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/> formatter.
- Formats using the <c>"HH:mm:ss,yyyy"</c> for example, <c>"15:49:37,459"</c>.
- </description>
- </item>
- <item>
- <term>other</term>
- <description>
- Any other pattern string uses the <see cref="T:log4net.DateFormatter.SimpleDateFormatter"/> formatter.
- This formatter passes the pattern string to the <see cref="T:System.DateTime"/>
- <see cref="M:System.DateTime.ToString(System.String)"/> method.
- For details on valid patterns see
- <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationdatetimeformatinfoclasstopic.asp">DateTimeFormatInfo Class</a>.
- </description>
- </item>
- </list>
- </para>
- <para>
- The <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> is in the local time zone and is rendered in that zone.
- To output the time in Universal time see <see cref="T:log4net.Layout.Pattern.UtcDatePatternConverter"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Layout.Pattern.DatePatternConverter.m_dateFormatter">
- <summary>
- The <see cref="T:log4net.DateFormatter.IDateFormatter"/> used to render the date to a string
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.DateFormatter.IDateFormatter"/> used to render the date to a string
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.DatePatternConverter.ActivateOptions">
- <summary>
- Initialize the converter pattern based on the <see cref="P:log4net.Util.PatternConverter.Option"/> property.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.Pattern.DatePatternConverter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.Pattern.DatePatternConverter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.Pattern.DatePatternConverter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.DatePatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Convert the pattern into the rendered message
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Pass the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> to the <see cref="T:log4net.DateFormatter.IDateFormatter"/>
- for it to render it to the writer.
- </para>
- <para>
- The <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> passed is in the local time zone.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.ExceptionPatternConverter">
- <summary>
- Write the exception text to the output
- </summary>
- <remarks>
- <para>
- If an exception object is stored in the logging event
- it will be rendered into the pattern output with a
- trailing newline.
- </para>
- <para>
- If there is no exception then nothing will be output
- and no trailing newline will be appended.
- It is typical to put a newline before the exception
- and to have the exception as the last data in the pattern.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.ExceptionPatternConverter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Layout.Pattern.ExceptionPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the exception text to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- If an exception object is stored in the logging event
- it will be rendered into the pattern output with a
- trailing newline.
- </para>
- <para>
- If there is no exception then nothing will be output
- and no trailing newline will be appended.
- It is typical to put a newline before the exception
- and to have the exception as the last data in the pattern.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.FileLocationPatternConverter">
- <summary>
- Writes the caller location file name to the output
- </summary>
- <remarks>
- <para>
- Writes the value of the <see cref="P:log4net.Core.LocationInfo.FileName"/> for
- the event to the output writer.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.FileLocationPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the caller location file name to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the value of the <see cref="P:log4net.Core.LocationInfo.FileName"/> for
- the <paramref name="loggingEvent"/> to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.FullLocationPatternConverter">
- <summary>
- Write the caller location info to the output
- </summary>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LocationInfo.FullInfo"/> to the output writer.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.FullLocationPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the caller location info to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LocationInfo.FullInfo"/> to the output writer.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.IdentityPatternConverter">
- <summary>
- Writes the event identity to the output
- </summary>
- <remarks>
- <para>
- Writes the value of the <see cref="P:log4net.Core.LoggingEvent.Identity"/> to
- the output writer.
- </para>
- </remarks>
- <author>Daniel Cazzulino</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.IdentityPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Writes the event identity to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the value of the <paramref name="loggingEvent"/>
- <see cref="P:log4net.Core.LoggingEvent.Identity"/> to
- the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.LevelPatternConverter">
- <summary>
- Write the event level to the output
- </summary>
- <remarks>
- <para>
- Writes the display name of the event <see cref="P:log4net.Core.LoggingEvent.Level"/>
- to the writer.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.LevelPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the event level to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.Level.DisplayName"/> of the <paramref name="loggingEvent"/> <see cref="P:log4net.Core.LoggingEvent.Level"/>
- to the <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.LineLocationPatternConverter">
- <summary>
- Write the caller location line number to the output
- </summary>
- <remarks>
- <para>
- Writes the value of the <see cref="P:log4net.Core.LocationInfo.LineNumber"/> for
- the event to the output writer.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.LineLocationPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the caller location line number to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the value of the <see cref="P:log4net.Core.LocationInfo.LineNumber"/> for
- the <paramref name="loggingEvent"/> to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.LoggerPatternConverter">
- <summary>
- Converter for logger name
- </summary>
- <remarks>
- <para>
- Outputs the <see cref="P:log4net.Core.LoggingEvent.LoggerName"/> of the event.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Layout.Pattern.NamedPatternConverter">
- <summary>
- Converter to output and truncate <c>'.'</c> separated strings
- </summary>
- <remarks>
- <para>
- This abstract class supports truncating a <c>'.'</c> separated string
- to show a specified number of elements from the right hand side.
- This is used to truncate class names that are fully qualified.
- </para>
- <para>
- Subclasses should override the <see cref="M:log4net.Layout.Pattern.NamedPatternConverter.GetFullyQualifiedName(log4net.Core.LoggingEvent)"/> method to
- return the fully qualified string.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.NamedPatternConverter.ActivateOptions">
- <summary>
- Initialize the converter
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.Pattern.NamedPatternConverter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.Pattern.NamedPatternConverter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.Pattern.NamedPatternConverter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.NamedPatternConverter.GetFullyQualifiedName(log4net.Core.LoggingEvent)">
- <summary>
- Get the fully qualified string data
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>the fully qualified name</returns>
- <remarks>
- <para>
- Overridden by subclasses to get the fully qualified name before the
- precision is applied to it.
- </para>
- <para>
- Return the fully qualified <c>'.'</c> (dot/period) separated string.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.NamedPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Convert the pattern to the rendered message
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- Render the <see cref="M:log4net.Layout.Pattern.NamedPatternConverter.GetFullyQualifiedName(log4net.Core.LoggingEvent)"/> to the precision
- specified by the <see cref="P:log4net.Util.PatternConverter.Option"/> property.
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.LoggerPatternConverter.GetFullyQualifiedName(log4net.Core.LoggingEvent)">
- <summary>
- Gets the fully qualified name of the logger
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>The fully qualified logger name</returns>
- <remarks>
- <para>
- Returns the <see cref="P:log4net.Core.LoggingEvent.LoggerName"/> of the <paramref name="loggingEvent"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.MessagePatternConverter">
- <summary>
- Writes the event message to the output
- </summary>
- <remarks>
- <para>
- Uses the <see cref="M:log4net.Core.LoggingEvent.WriteRenderedMessage(System.IO.TextWriter)"/> method
- to write out the event message.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.MessagePatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Writes the event message to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Uses the <see cref="M:log4net.Core.LoggingEvent.WriteRenderedMessage(System.IO.TextWriter)"/> method
- to write out the event message.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.MethodLocationPatternConverter">
- <summary>
- Write the method name to the output
- </summary>
- <remarks>
- <para>
- Writes the caller location <see cref="P:log4net.Core.LocationInfo.MethodName"/> to
- the output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.MethodLocationPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the method name to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the caller location <see cref="P:log4net.Core.LocationInfo.MethodName"/> to
- the output.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.NdcPatternConverter">
- <summary>
- Converter to include event NDC
- </summary>
- <remarks>
- <para>
- Outputs the value of the event property named <c>NDC</c>.
- </para>
- <para>
- The <see cref="T:log4net.Layout.Pattern.PropertyPatternConverter"/> should be used instead.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.NdcPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the event NDC to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- As the thread context stacks are now stored in named event properties
- this converter simply looks up the value of the <c>NDC</c> property.
- </para>
- <para>
- The <see cref="T:log4net.Layout.Pattern.PropertyPatternConverter"/> should be used instead.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.PropertyPatternConverter">
- <summary>
- Property pattern converter
- </summary>
- <remarks>
- <para>
- Writes out the value of a named property. The property name
- should be set in the <see cref="P:log4net.Util.PatternConverter.Option"/>
- property.
- </para>
- <para>
- If the <see cref="P:log4net.Util.PatternConverter.Option"/> is set to <c>null</c>
- then all the properties are written as key value pairs.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.PropertyPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the property value to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes out the value of a named property. The property name
- should be set in the <see cref="P:log4net.Util.PatternConverter.Option"/>
- property.
- </para>
- <para>
- If the <see cref="P:log4net.Util.PatternConverter.Option"/> is set to <c>null</c>
- then all the properties are written as key value pairs.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.RelativeTimePatternConverter">
- <summary>
- Converter to output the relative time of the event
- </summary>
- <remarks>
- <para>
- Converter to output the time of the event relative to the start of the program.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.RelativeTimePatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the relative time to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes out the relative time of the event in milliseconds.
- That is the number of milliseconds between the event <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/>
- and the <see cref="P:log4net.Core.LoggingEvent.StartTime"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.RelativeTimePatternConverter.TimeDifferenceInMillis(System.DateTime,System.DateTime)">
- <summary>
- Helper method to get the time difference between two DateTime objects
- </summary>
- <param name="start">start time (in the current local time zone)</param>
- <param name="end">end time (in the current local time zone)</param>
- <returns>the time difference in milliseconds</returns>
- </member>
- <member name="T:log4net.Layout.Pattern.ThreadPatternConverter">
- <summary>
- Converter to include event thread name
- </summary>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LoggingEvent.ThreadName"/> to the output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.ThreadPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the ThreadName to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LoggingEvent.ThreadName"/> to the <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.TypeNamePatternConverter">
- <summary>
- Pattern converter for the class name
- </summary>
- <remarks>
- <para>
- Outputs the <see cref="P:log4net.Core.LocationInfo.ClassName"/> of the event.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.TypeNamePatternConverter.GetFullyQualifiedName(log4net.Core.LoggingEvent)">
- <summary>
- Gets the fully qualified name of the class
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>The fully qualified type name for the caller location</returns>
- <remarks>
- <para>
- Returns the <see cref="P:log4net.Core.LocationInfo.ClassName"/> of the <paramref name="loggingEvent"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.UserNamePatternConverter">
- <summary>
- Converter to include event user name
- </summary>
- <author>Douglas de la Torre</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.UserNamePatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Convert the pattern to the rendered message
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- </member>
- <member name="T:log4net.Layout.Pattern.UtcDatePatternConverter">
- <summary>
- Write the TimeStamp to the output
- </summary>
- <remarks>
- <para>
- Date pattern converter, uses a <see cref="T:log4net.DateFormatter.IDateFormatter"/> to format
- the date of a <see cref="T:log4net.Core.LoggingEvent"/>.
- </para>
- <para>
- Uses a <see cref="T:log4net.DateFormatter.IDateFormatter"/> to format the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/>
- in Universal time.
- </para>
- <para>
- See the <see cref="T:log4net.Layout.Pattern.DatePatternConverter"/> for details on the date pattern syntax.
- </para>
- </remarks>
- <seealso cref="T:log4net.Layout.Pattern.DatePatternConverter"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.UtcDatePatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the TimeStamp to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Pass the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> to the <see cref="T:log4net.DateFormatter.IDateFormatter"/>
- for it to render it to the writer.
- </para>
- <para>
- The <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> passed is in the local time zone, this is converted
- to Universal time before it is rendered.
- </para>
- </remarks>
- <seealso cref="T:log4net.Layout.Pattern.DatePatternConverter"/>
- </member>
- <member name="T:log4net.Layout.ExceptionLayout">
- <summary>
- A Layout that renders only the Exception text from the logging event
- </summary>
- <remarks>
- <para>
- A Layout that renders only the Exception text from the logging event.
- </para>
- <para>
- This Layout should only be used with appenders that utilize multiple
- layouts (e.g. <see cref="T:log4net.Appender.AdoNetAppender"/>).
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Layout.LayoutSkeleton">
- <summary>
- Extend this abstract class to create your own log layout format.
- </summary>
- <remarks>
- <para>
- This is the base implementation of the <see cref="T:log4net.Layout.ILayout"/>
- interface. Most layout objects should extend this class.
- </para>
- </remarks>
- <remarks>
- <note type="inheritinfo">
- <para>
- Subclasses must implement the <see cref="M:log4net.Layout.LayoutSkeleton.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)"/>
- method.
- </para>
- <para>
- Subclasses should set the <see cref="P:log4net.Layout.LayoutSkeleton.IgnoresException"/> in their default
- constructor.
- </para>
- </note>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Layout.ILayout">
- <summary>
- Interface implemented by layout objects
- </summary>
- <remarks>
- <para>
- An <see cref="T:log4net.Layout.ILayout"/> object is used to format a <see cref="T:log4net.Core.LoggingEvent"/>
- as text. The <see cref="M:log4net.Layout.ILayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)"/> method is called by an
- appender to transform the <see cref="T:log4net.Core.LoggingEvent"/> into a string.
- </para>
- <para>
- The layout can also supply <see cref="P:log4net.Layout.ILayout.Header"/> and <see cref="P:log4net.Layout.ILayout.Footer"/>
- text that is appender before any events and after all the events respectively.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.ILayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Implement this method to create your own layout format.
- </summary>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <param name="loggingEvent">The event to format</param>
- <remarks>
- <para>
- This method is called by an appender to format
- the <paramref name="loggingEvent"/> as text and output to a writer.
- </para>
- <para>
- If the caller does not have a <see cref="T:System.IO.TextWriter"/> and prefers the
- event to be formatted as a <see cref="T:System.String"/> then the following
- code can be used to format the event into a <see cref="T:System.IO.StringWriter"/>.
- </para>
- <code lang="C#">
- StringWriter writer = new StringWriter();
- Layout.Format(writer, loggingEvent);
- string formattedEvent = writer.ToString();
- </code>
- </remarks>
- </member>
- <member name="P:log4net.Layout.ILayout.ContentType">
- <summary>
- The content type output by this layout.
- </summary>
- <value>The content type</value>
- <remarks>
- <para>
- The content type output by this layout.
- </para>
- <para>
- This is a MIME type e.g. <c>"text/plain"</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.ILayout.Header">
- <summary>
- The header for the layout format.
- </summary>
- <value>the layout header</value>
- <remarks>
- <para>
- The Header text will be appended before any logging events
- are formatted and appended.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.ILayout.Footer">
- <summary>
- The footer for the layout format.
- </summary>
- <value>the layout footer</value>
- <remarks>
- <para>
- The Footer text will be appended after all the logging events
- have been formatted and appended.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.ILayout.IgnoresException">
- <summary>
- Flag indicating if this layout handle exceptions
- </summary>
- <value><c>false</c> if this layout handles exceptions</value>
- <remarks>
- <para>
- If this layout handles the exception object contained within
- <see cref="T:log4net.Core.LoggingEvent"/>, then the layout should return
- <c>false</c>. Otherwise, if the layout ignores the exception
- object, then the layout should return <c>true</c>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.LayoutSkeleton.m_header">
- <summary>
- The header text
- </summary>
- <remarks>
- <para>
- See <see cref="P:log4net.Layout.LayoutSkeleton.Header"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.LayoutSkeleton.m_footer">
- <summary>
- The footer text
- </summary>
- <remarks>
- <para>
- See <see cref="P:log4net.Layout.LayoutSkeleton.Footer"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.LayoutSkeleton.m_ignoresException">
- <summary>
- Flag indicating if this layout handles exceptions
- </summary>
- <remarks>
- <para>
- <c>false</c> if this layout handles exceptions
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.LayoutSkeleton.#ctor">
- <summary>
- Empty default constructor
- </summary>
- <remarks>
- <para>
- Empty default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.LayoutSkeleton.ActivateOptions">
- <summary>
- Activate component options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.LayoutSkeleton.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.LayoutSkeleton.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.LayoutSkeleton.ActivateOptions"/> must be called again.
- </para>
- <para>
- This method must be implemented by the subclass.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.LayoutSkeleton.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Implement this method to create your own layout format.
- </summary>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <param name="loggingEvent">The event to format</param>
- <remarks>
- <para>
- This method is called by an appender to format
- the <paramref name="loggingEvent"/> as text.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.LayoutSkeleton.ContentType">
- <summary>
- The content type output by this layout.
- </summary>
- <value>The content type is <c>"text/plain"</c></value>
- <remarks>
- <para>
- The content type output by this layout.
- </para>
- <para>
- This base class uses the value <c>"text/plain"</c>.
- To change this value a subclass must override this
- property.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.LayoutSkeleton.Header">
- <summary>
- The header for the layout format.
- </summary>
- <value>the layout header</value>
- <remarks>
- <para>
- The Header text will be appended before any logging events
- are formatted and appended.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.LayoutSkeleton.Footer">
- <summary>
- The footer for the layout format.
- </summary>
- <value>the layout footer</value>
- <remarks>
- <para>
- The Footer text will be appended after all the logging events
- have been formatted and appended.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.LayoutSkeleton.IgnoresException">
- <summary>
- Flag indicating if this layout handles exceptions
- </summary>
- <value><c>false</c> if this layout handles exceptions</value>
- <remarks>
- <para>
- If this layout handles the exception object contained within
- <see cref="T:log4net.Core.LoggingEvent"/>, then the layout should return
- <c>false</c>. Otherwise, if the layout ignores the exception
- object, then the layout should return <c>true</c>.
- </para>
- <para>
- Set this value to override a this default setting. The default
- value is <c>true</c>, this layout does not handle the exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.ExceptionLayout.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Constructs a ExceptionLayout
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.ExceptionLayout.ActivateOptions">
- <summary>
- Activate component options
- </summary>
- <remarks>
- <para>
- Part of the <see cref="T:log4net.Core.IOptionHandler"/> component activation
- framework.
- </para>
- <para>
- This method does nothing as options become effective immediately.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.ExceptionLayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Gets the exception text from the logging event
- </summary>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Write the exception string to the <see cref="T:System.IO.TextWriter"/>.
- The exception string is retrieved from <see cref="M:log4net.Core.LoggingEvent.GetExceptionString"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.IRawLayout">
- <summary>
- Interface for raw layout objects
- </summary>
- <remarks>
- <para>
- Interface used to format a <see cref="T:log4net.Core.LoggingEvent"/>
- to an object.
- </para>
- <para>
- This interface should not be confused with the
- <see cref="T:log4net.Layout.ILayout"/> interface. This interface is used in
- only certain specialized situations where a raw object is
- required rather than a formatted string. The <see cref="T:log4net.Layout.ILayout"/>
- is not generally useful than this interface.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.IRawLayout.Format(log4net.Core.LoggingEvent)">
- <summary>
- Implement this method to create your own layout format.
- </summary>
- <param name="loggingEvent">The event to format</param>
- <returns>returns the formatted event</returns>
- <remarks>
- <para>
- Implement this method to create your own layout format.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Layout2RawLayoutAdapter">
- <summary>
- Adapts any <see cref="T:log4net.Layout.ILayout"/> to a <see cref="T:log4net.Layout.IRawLayout"/>
- </summary>
- <remarks>
- <para>
- Where an <see cref="T:log4net.Layout.IRawLayout"/> is required this adapter
- allows a <see cref="T:log4net.Layout.ILayout"/> to be specified.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Layout.Layout2RawLayoutAdapter.m_layout">
- <summary>
- The layout to adapt
- </summary>
- </member>
- <member name="M:log4net.Layout.Layout2RawLayoutAdapter.#ctor(log4net.Layout.ILayout)">
- <summary>
- Construct a new adapter
- </summary>
- <param name="layout">the layout to adapt</param>
- <remarks>
- <para>
- Create the adapter for the specified <paramref name="layout"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Layout2RawLayoutAdapter.Format(log4net.Core.LoggingEvent)">
- <summary>
- Format the logging event as an object.
- </summary>
- <param name="loggingEvent">The event to format</param>
- <returns>returns the formatted event</returns>
- <remarks>
- <para>
- Format the logging event as an object.
- </para>
- <para>
- Uses the <see cref="T:log4net.Layout.ILayout"/> object supplied to
- the constructor to perform the formatting.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.PatternLayout">
- <summary>
- A flexible layout configurable with pattern string.
- </summary>
- <remarks>
- <para>
- The goal of this class is to <see cref="M:log4net.Layout.PatternLayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)"/> a
- <see cref="T:log4net.Core.LoggingEvent"/> as a string. The results
- depend on the <i>conversion pattern</i>.
- </para>
- <para>
- The conversion pattern is closely related to the conversion
- pattern of the printf function in C. A conversion pattern is
- composed of literal text and format control expressions called
- <i>conversion specifiers</i>.
- </para>
- <para>
- <i>You are free to insert any literal text within the conversion
- pattern.</i>
- </para>
- <para>
- Each conversion specifier starts with a percent sign (%) and is
- followed by optional <i>format modifiers</i> and a <i>conversion
- pattern name</i>. The conversion pattern name specifies the type of
- data, e.g. logger, level, date, thread name. The format
- modifiers control such things as field width, padding, left and
- right justification. The following is a simple example.
- </para>
- <para>
- Let the conversion pattern be <b>"%-5level [%thread]: %message%newline"</b> and assume
- that the log4net environment was set to use a PatternLayout. Then the
- statements
- </para>
- <code lang="C#">
- ILog log = LogManager.GetLogger(typeof(TestApp));
- log.Debug("Message 1");
- log.Warn("Message 2");
- </code>
- <para>would yield the output</para>
- <code>
- DEBUG [main]: Message 1
- WARN [main]: Message 2
- </code>
- <para>
- Note that there is no explicit separator between text and
- conversion specifiers. The pattern parser knows when it has reached
- the end of a conversion specifier when it reads a conversion
- character. In the example above the conversion specifier
- <b>%-5level</b> means the level of the logging event should be left
- justified to a width of five characters.
- </para>
- <para>
- The recognized conversion pattern names are:
- </para>
- <list type="table">
- <listheader>
- <term>Conversion Pattern Name</term>
- <description>Effect</description>
- </listheader>
- <item>
- <term>a</term>
- <description>Equivalent to <b>appdomain</b></description>
- </item>
- <item>
- <term>appdomain</term>
- <description>
- Used to output the friendly name of the AppDomain where the
- logging event was generated.
- </description>
- </item>
- <item>
- <term>c</term>
- <description>Equivalent to <b>logger</b></description>
- </item>
- <item>
- <term>C</term>
- <description>Equivalent to <b>type</b></description>
- </item>
- <item>
- <term>class</term>
- <description>Equivalent to <b>type</b></description>
- </item>
- <item>
- <term>d</term>
- <description>Equivalent to <b>date</b></description>
- </item>
- <item>
- <term>date</term>
- <description>
- <para>
- Used to output the date of the logging event in the local time zone.
- To output the date in universal time use the <c>%utcdate</c> pattern.
- The date conversion
- specifier may be followed by a <i>date format specifier</i> enclosed
- between braces. For example, <b>%date{HH:mm:ss,fff}</b> or
- <b>%date{dd MMM yyyy HH:mm:ss,fff}</b>. If no date format specifier is
- given then ISO8601 format is
- assumed (<see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>).
- </para>
- <para>
- The date format specifier admits the same syntax as the
- time pattern string of the <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- <para>
- For better results it is recommended to use the log4net date
- formatters. These can be specified using one of the strings
- "ABSOLUTE", "DATE" and "ISO8601" for specifying
- <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/>,
- <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> and respectively
- <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>. For example,
- <b>%date{ISO8601}</b> or <b>%date{ABSOLUTE}</b>.
- </para>
- <para>
- These dedicated date formatters perform significantly
- better than <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- </description>
- </item>
- <item>
- <term>exception</term>
- <description>
- <para>
- Used to output the exception passed in with the log message.
- </para>
- <para>
- If an exception object is stored in the logging event
- it will be rendered into the pattern output with a
- trailing newline.
- If there is no exception then nothing will be output
- and no trailing newline will be appended.
- It is typical to put a newline before the exception
- and to have the exception as the last data in the pattern.
- </para>
- </description>
- </item>
- <item>
- <term>F</term>
- <description>Equivalent to <b>file</b></description>
- </item>
- <item>
- <term>file</term>
- <description>
- <para>
- Used to output the file name where the logging request was
- issued.
- </para>
- <para>
- <b>WARNING</b> Generating caller location information is
- extremely slow. Its use should be avoided unless execution speed
- is not an issue.
- </para>
- <para>
- See the note below on the availability of caller location information.
- </para>
- </description>
- </item>
- <item>
- <term>identity</term>
- <description>
- <para>
- Used to output the user name for the currently active user
- (Principal.Identity.Name).
- </para>
- <para>
- <b>WARNING</b> Generating caller information is
- extremely slow. Its use should be avoided unless execution speed
- is not an issue.
- </para>
- </description>
- </item>
- <item>
- <term>l</term>
- <description>Equivalent to <b>location</b></description>
- </item>
- <item>
- <term>L</term>
- <description>Equivalent to <b>line</b></description>
- </item>
- <item>
- <term>location</term>
- <description>
- <para>
- Used to output location information of the caller which generated
- the logging event.
- </para>
- <para>
- The location information depends on the CLI implementation but
- usually consists of the fully qualified name of the calling
- method followed by the callers source the file name and line
- number between parentheses.
- </para>
- <para>
- The location information can be very useful. However, its
- generation is <b>extremely</b> slow. Its use should be avoided
- unless execution speed is not an issue.
- </para>
- <para>
- See the note below on the availability of caller location information.
- </para>
- </description>
- </item>
- <item>
- <term>level</term>
- <description>
- <para>
- Used to output the level of the logging event.
- </para>
- </description>
- </item>
- <item>
- <term>line</term>
- <description>
- <para>
- Used to output the line number from where the logging request
- was issued.
- </para>
- <para>
- <b>WARNING</b> Generating caller location information is
- extremely slow. Its use should be avoided unless execution speed
- is not an issue.
- </para>
- <para>
- See the note below on the availability of caller location information.
- </para>
- </description>
- </item>
- <item>
- <term>logger</term>
- <description>
- <para>
- Used to output the logger of the logging event. The
- logger conversion specifier can be optionally followed by
- <i>precision specifier</i>, that is a decimal constant in
- brackets.
- </para>
- <para>
- If a precision specifier is given, then only the corresponding
- number of right most components of the logger name will be
- printed. By default the logger name is printed in full.
- </para>
- <para>
- For example, for the logger name "a.b.c" the pattern
- <b>%logger{2}</b> will output "b.c".
- </para>
- </description>
- </item>
- <item>
- <term>m</term>
- <description>Equivalent to <b>message</b></description>
- </item>
- <item>
- <term>M</term>
- <description>Equivalent to <b>method</b></description>
- </item>
- <item>
- <term>message</term>
- <description>
- <para>
- Used to output the application supplied message associated with
- the logging event.
- </para>
- </description>
- </item>
- <item>
- <term>mdc</term>
- <description>
- <para>
- The MDC (old name for the ThreadContext.Properties) is now part of the
- combined event properties. This pattern is supported for compatibility
- but is equivalent to <b>property</b>.
- </para>
- </description>
- </item>
- <item>
- <term>method</term>
- <description>
- <para>
- Used to output the method name where the logging request was
- issued.
- </para>
- <para>
- <b>WARNING</b> Generating caller location information is
- extremely slow. Its use should be avoided unless execution speed
- is not an issue.
- </para>
- <para>
- See the note below on the availability of caller location information.
- </para>
- </description>
- </item>
- <item>
- <term>n</term>
- <description>Equivalent to <b>newline</b></description>
- </item>
- <item>
- <term>newline</term>
- <description>
- <para>
- Outputs the platform dependent line separator character or
- characters.
- </para>
- <para>
- This conversion pattern offers the same performance as using
- non-portable line separator strings such as "\n", or "\r\n".
- Thus, it is the preferred way of specifying a line separator.
- </para>
- </description>
- </item>
- <item>
- <term>ndc</term>
- <description>
- <para>
- Used to output the NDC (nested diagnostic context) associated
- with the thread that generated the logging event.
- </para>
- </description>
- </item>
- <item>
- <term>p</term>
- <description>Equivalent to <b>level</b></description>
- </item>
- <item>
- <term>P</term>
- <description>Equivalent to <b>property</b></description>
- </item>
- <item>
- <term>properties</term>
- <description>Equivalent to <b>property</b></description>
- </item>
- <item>
- <term>property</term>
- <description>
- <para>
- Used to output the an event specific property. The key to
- lookup must be specified within braces and directly following the
- pattern specifier, e.g. <b>%property{user}</b> would include the value
- from the property that is keyed by the string 'user'. Each property value
- that is to be included in the log must be specified separately.
- Properties are added to events by loggers or appenders. By default
- the <c>log4net:HostName</c> property is set to the name of machine on
- which the event was originally logged.
- </para>
- <para>
- If no key is specified, e.g. <b>%property</b> then all the keys and their
- values are printed in a comma separated list.
- </para>
- <para>
- The properties of an event are combined from a number of different
- contexts. These are listed below in the order in which they are searched.
- </para>
- <list type="definition">
- <item>
- <term>the event properties</term>
- <description>
- The event has <see cref="P:log4net.Core.LoggingEvent.Properties"/> that can be set. These
- properties are specific to this event only.
- </description>
- </item>
- <item>
- <term>the thread properties</term>
- <description>
- The <see cref="P:log4net.ThreadContext.Properties"/> that are set on the current
- thread. These properties are shared by all events logged on this thread.
- </description>
- </item>
- <item>
- <term>the global properties</term>
- <description>
- The <see cref="P:log4net.GlobalContext.Properties"/> that are set globally. These
- properties are shared by all the threads in the AppDomain.
- </description>
- </item>
- </list>
-
- </description>
- </item>
- <item>
- <term>r</term>
- <description>Equivalent to <b>timestamp</b></description>
- </item>
- <item>
- <term>t</term>
- <description>Equivalent to <b>thread</b></description>
- </item>
- <item>
- <term>timestamp</term>
- <description>
- <para>
- Used to output the number of milliseconds elapsed since the start
- of the application until the creation of the logging event.
- </para>
- </description>
- </item>
- <item>
- <term>thread</term>
- <description>
- <para>
- Used to output the name of the thread that generated the
- logging event. Uses the thread number if no name is available.
- </para>
- </description>
- </item>
- <item>
- <term>type</term>
- <description>
- <para>
- Used to output the fully qualified type name of the caller
- issuing the logging request. This conversion specifier
- can be optionally followed by <i>precision specifier</i>, that
- is a decimal constant in brackets.
- </para>
- <para>
- If a precision specifier is given, then only the corresponding
- number of right most components of the class name will be
- printed. By default the class name is output in fully qualified form.
- </para>
- <para>
- For example, for the class name "log4net.Layout.PatternLayout", the
- pattern <b>%type{1}</b> will output "PatternLayout".
- </para>
- <para>
- <b>WARNING</b> Generating the caller class information is
- slow. Thus, its use should be avoided unless execution speed is
- not an issue.
- </para>
- <para>
- See the note below on the availability of caller location information.
- </para>
- </description>
- </item>
- <item>
- <term>u</term>
- <description>Equivalent to <b>identity</b></description>
- </item>
- <item>
- <term>username</term>
- <description>
- <para>
- Used to output the WindowsIdentity for the currently
- active user.
- </para>
- <para>
- <b>WARNING</b> Generating caller WindowsIdentity information is
- extremely slow. Its use should be avoided unless execution speed
- is not an issue.
- </para>
- </description>
- </item>
- <item>
- <term>utcdate</term>
- <description>
- <para>
- Used to output the date of the logging event in universal time.
- The date conversion
- specifier may be followed by a <i>date format specifier</i> enclosed
- between braces. For example, <b>%utcdate{HH:mm:ss,fff}</b> or
- <b>%utcdate{dd MMM yyyy HH:mm:ss,fff}</b>. If no date format specifier is
- given then ISO8601 format is
- assumed (<see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>).
- </para>
- <para>
- The date format specifier admits the same syntax as the
- time pattern string of the <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- <para>
- For better results it is recommended to use the log4net date
- formatters. These can be specified using one of the strings
- "ABSOLUTE", "DATE" and "ISO8601" for specifying
- <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/>,
- <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> and respectively
- <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>. For example,
- <b>%utcdate{ISO8601}</b> or <b>%utcdate{ABSOLUTE}</b>.
- </para>
- <para>
- These dedicated date formatters perform significantly
- better than <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- </description>
- </item>
- <item>
- <term>w</term>
- <description>Equivalent to <b>username</b></description>
- </item>
- <item>
- <term>x</term>
- <description>Equivalent to <b>ndc</b></description>
- </item>
- <item>
- <term>X</term>
- <description>Equivalent to <b>mdc</b></description>
- </item>
- <item>
- <term>%</term>
- <description>
- <para>
- The sequence %% outputs a single percent sign.
- </para>
- </description>
- </item>
- </list>
- <para>
- The single letter patterns are deprecated in favor of the
- longer more descriptive pattern names.
- </para>
- <para>
- By default the relevant information is output as is. However,
- with the aid of format modifiers it is possible to change the
- minimum field width, the maximum field width and justification.
- </para>
- <para>
- The optional format modifier is placed between the percent sign
- and the conversion pattern name.
- </para>
- <para>
- The first optional format modifier is the <i>left justification
- flag</i> which is just the minus (-) character. Then comes the
- optional <i>minimum field width</i> modifier. This is a decimal
- constant that represents the minimum number of characters to
- output. If the data item requires fewer characters, it is padded on
- either the left or the right until the minimum width is
- reached. The default is to pad on the left (right justify) but you
- can specify right padding with the left justification flag. The
- padding character is space. If the data item is larger than the
- minimum field width, the field is expanded to accommodate the
- data. The value is never truncated.
- </para>
- <para>
- This behavior can be changed using the <i>maximum field
- width</i> modifier which is designated by a period followed by a
- decimal constant. If the data item is longer than the maximum
- field, then the extra characters are removed from the
- <i>beginning</i> of the data item and not from the end. For
- example, it the maximum field width is eight and the data item is
- ten characters long, then the first two characters of the data item
- are dropped. This behavior deviates from the printf function in C
- where truncation is done from the end.
- </para>
- <para>
- Below are various format modifier examples for the logger
- conversion specifier.
- </para>
- <div class="tablediv">
- <table class="dtTABLE" cellspacing="0">
- <tr>
- <th>Format modifier</th>
- <th>left justify</th>
- <th>minimum width</th>
- <th>maximum width</th>
- <th>comment</th>
- </tr>
- <tr>
- <td align="center">%20logger</td>
- <td align="center">false</td>
- <td align="center">20</td>
- <td align="center">none</td>
- <td>
- <para>
- Left pad with spaces if the logger name is less than 20
- characters long.
- </para>
- </td>
- </tr>
- <tr>
- <td align="center">%-20logger</td>
- <td align="center">true</td>
- <td align="center">20</td>
- <td align="center">none</td>
- <td>
- <para>
- Right pad with spaces if the logger
- name is less than 20 characters long.
- </para>
- </td>
- </tr>
- <tr>
- <td align="center">%.30logger</td>
- <td align="center">NA</td>
- <td align="center">none</td>
- <td align="center">30</td>
- <td>
- <para>
- Truncate from the beginning if the logger
- name is longer than 30 characters.
- </para>
- </td>
- </tr>
- <tr>
- <td align="center"><nobr>%20.30logger</nobr></td>
- <td align="center">false</td>
- <td align="center">20</td>
- <td align="center">30</td>
- <td>
- <para>
- Left pad with spaces if the logger name is shorter than 20
- characters. However, if logger name is longer than 30 characters,
- then truncate from the beginning.
- </para>
- </td>
- </tr>
- <tr>
- <td align="center">%-20.30logger</td>
- <td align="center">true</td>
- <td align="center">20</td>
- <td align="center">30</td>
- <td>
- <para>
- Right pad with spaces if the logger name is shorter than 20
- characters. However, if logger name is longer than 30 characters,
- then truncate from the beginning.
- </para>
- </td>
- </tr>
- </table>
- </div>
- <para>
- <b>Note about caller location information.</b><br/>
- The following patterns <c>%type %file %line %method %location %class %C %F %L %l %M</c>
- all generate caller location information.
- Location information uses the <c>System.Diagnostics.StackTrace</c> class to generate
- a call stack. The caller's information is then extracted from this stack.
- </para>
- <note type="caution">
- <para>
- The <c>System.Diagnostics.StackTrace</c> class is not supported on the
- .NET Compact Framework 1.0 therefore caller location information is not
- available on that framework.
- </para>
- </note>
- <note type="caution">
- <para>
- The <c>System.Diagnostics.StackTrace</c> class has this to say about Release builds:
- </para>
- <para>
- "StackTrace information will be most informative with Debug build configurations.
- By default, Debug builds include debug symbols, while Release builds do not. The
- debug symbols contain most of the file, method name, line number, and column
- information used in constructing StackFrame and StackTrace objects. StackTrace
- might not report as many method calls as expected, due to code transformations
- that occur during optimization."
- </para>
- <para>
- This means that in a Release build the caller information may be incomplete or may
- not exist at all! Therefore caller location information cannot be relied upon in a Release build.
- </para>
- </note>
- <para>
- Additional pattern converters may be registered with a specific <see cref="T:log4net.Layout.PatternLayout"/>
- instance using the <see cref="M:log4net.Layout.PatternLayout.AddConverter(System.String,System.Type)"/> method.
- </para>
- </remarks>
- <example>
- This is a more detailed pattern.
- <code><b>%timestamp [%thread] %level %logger %ndc - %message%newline</b></code>
- </example>
- <example>
- A similar pattern except that the relative time is
- right padded if less than 6 digits, thread name is right padded if
- less than 15 characters and truncated if longer and the logger
- name is left padded if shorter than 30 characters and truncated if
- longer.
- <code><b>%-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline</b></code>
- </example>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Douglas de la Torre</author>
- <author>Daniel Cazzulino</author>
- </member>
- <member name="F:log4net.Layout.PatternLayout.DefaultConversionPattern">
- <summary>
- Default pattern string for log output.
- </summary>
- <remarks>
- <para>
- Default pattern string for log output.
- Currently set to the string <b>"%message%newline"</b>
- which just prints the application supplied message.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.PatternLayout.DetailConversionPattern">
- <summary>
- A detailed conversion pattern
- </summary>
- <remarks>
- <para>
- A conversion pattern which includes Time, Thread, Logger, and Nested Context.
- Current value is <b>%timestamp [%thread] %level %logger %ndc - %message%newline</b>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.PatternLayout.s_globalRulesRegistry">
- <summary>
- Internal map of converter identifiers to converter types.
- </summary>
- <remarks>
- <para>
- This static map is overridden by the m_converterRegistry instance map
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.PatternLayout.m_pattern">
- <summary>
- the pattern
- </summary>
- </member>
- <member name="F:log4net.Layout.PatternLayout.m_head">
- <summary>
- the head of the pattern converter chain
- </summary>
- </member>
- <member name="F:log4net.Layout.PatternLayout.m_instanceRulesRegistry">
- <summary>
- patterns defined on this PatternLayout only
- </summary>
- </member>
- <member name="M:log4net.Layout.PatternLayout.#cctor">
- <summary>
- Initialize the global registry
- </summary>
- <remarks>
- <para>
- Defines the builtin global rules.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.#ctor">
- <summary>
- Constructs a PatternLayout using the DefaultConversionPattern
- </summary>
- <remarks>
- <para>
- The default pattern just produces the application supplied message.
- </para>
- <para>
- Note to Inheritors: This constructor calls the virtual method
- <see cref="M:log4net.Layout.PatternLayout.CreatePatternParser(System.String)"/>. If you override this method be
- aware that it will be called before your is called constructor.
- </para>
- <para>
- As per the <see cref="T:log4net.Core.IOptionHandler"/> contract the <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/>
- method must be called after the properties on this object have been
- configured.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.#ctor(System.String)">
- <summary>
- Constructs a PatternLayout using the supplied conversion pattern
- </summary>
- <param name="pattern">the pattern to use</param>
- <remarks>
- <para>
- Note to Inheritors: This constructor calls the virtual method
- <see cref="M:log4net.Layout.PatternLayout.CreatePatternParser(System.String)"/>. If you override this method be
- aware that it will be called before your is called constructor.
- </para>
- <para>
- When using this constructor the <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/> method
- need not be called. This may not be the case when using a subclass.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.CreatePatternParser(System.String)">
- <summary>
- Create the pattern parser instance
- </summary>
- <param name="pattern">the pattern to parse</param>
- <returns>The <see cref="T:log4net.Util.PatternParser"/> that will format the event</returns>
- <remarks>
- <para>
- Creates the <see cref="T:log4net.Util.PatternParser"/> used to parse the conversion string. Sets the
- global and instance rules on the <see cref="T:log4net.Util.PatternParser"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.ActivateOptions">
- <summary>
- Initialize layout options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Produces a formatted string as specified by the conversion pattern.
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <remarks>
- <para>
- Parse the <see cref="T:log4net.Core.LoggingEvent"/> using the patter format
- specified in the <see cref="P:log4net.Layout.PatternLayout.ConversionPattern"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.AddConverter(log4net.Layout.PatternLayout.ConverterInfo)">
- <summary>
- Add a converter to this PatternLayout
- </summary>
- <param name="converterInfo">the converter info</param>
- <remarks>
- <para>
- This version of the method is used by the configurator.
- Programmatic users should use the alternative <see cref="M:log4net.Layout.PatternLayout.AddConverter(System.String,System.Type)"/> method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.AddConverter(System.String,System.Type)">
- <summary>
- Add a converter to this PatternLayout
- </summary>
- <param name="name">the name of the conversion pattern for this converter</param>
- <param name="type">the type of the converter</param>
- <remarks>
- <para>
- Add a named pattern converter to this instance. This
- converter will be used in the formatting of the event.
- This method must be called before <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/>.
- </para>
- <para>
- The <paramref name="type"/> specified must extend the
- <see cref="T:log4net.Util.PatternConverter"/> type.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.PatternLayout.ConversionPattern">
- <summary>
- The pattern formatting string
- </summary>
- <remarks>
- <para>
- The <b>ConversionPattern</b> option. This is the string which
- controls formatting and consists of a mix of literal content and
- conversion specifiers.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.PatternLayout.ConverterInfo">
- <summary>
- Wrapper class used to map converter names to converter types
- </summary>
- <remarks>
- <para>
- Pattern converter info class used during configuration to
- pass to the <see cref="M:log4net.Layout.PatternLayout.AddConverter(log4net.Layout.PatternLayout.ConverterInfo)"/>
- method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.ConverterInfo.#ctor">
- <summary>
- default constructor
- </summary>
- </member>
- <member name="P:log4net.Layout.PatternLayout.ConverterInfo.Name">
- <summary>
- Gets or sets the name of the conversion pattern
- </summary>
- <remarks>
- <para>
- The name of the pattern in the format string
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.PatternLayout.ConverterInfo.Type">
- <summary>
- Gets or sets the type of the converter
- </summary>
- <remarks>
- <para>
- The value specified must extend the
- <see cref="T:log4net.Util.PatternConverter"/> type.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.RawLayoutConverter">
- <summary>
- Type converter for the <see cref="T:log4net.Layout.IRawLayout"/> interface
- </summary>
- <remarks>
- <para>
- Used to convert objects to the <see cref="T:log4net.Layout.IRawLayout"/> interface.
- Supports converting from the <see cref="T:log4net.Layout.ILayout"/> interface to
- the <see cref="T:log4net.Layout.IRawLayout"/> interface using the <see cref="T:log4net.Layout.Layout2RawLayoutAdapter"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Util.TypeConverters.IConvertFrom">
- <summary>
- Interface supported by type converters
- </summary>
- <remarks>
- <para>
- This interface supports conversion from arbitrary types
- to a single target type. See <see cref="T:log4net.Util.TypeConverters.TypeConverterAttribute"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.IConvertFrom.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Test if the <paramref name="sourceType"/> can be converted to the
- type supported by this converter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.IConvertFrom.ConvertFrom(System.Object)">
- <summary>
- Convert the source object to the type supported by this object
- </summary>
- <param name="source">the object to convert</param>
- <returns>the converted object</returns>
- <remarks>
- <para>
- Converts the <paramref name="source"/> to the type supported
- by this converter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.RawLayoutConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the sourceType be converted to an <see cref="T:log4net.Layout.IRawLayout"/>
- </summary>
- <param name="sourceType">the source to be to be converted</param>
- <returns><c>true</c> if the source type can be converted to <see cref="T:log4net.Layout.IRawLayout"/></returns>
- <remarks>
- <para>
- Test if the <paramref name="sourceType"/> can be converted to a
- <see cref="T:log4net.Layout.IRawLayout"/>. Only <see cref="T:log4net.Layout.ILayout"/> is supported
- as the <paramref name="sourceType"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.RawLayoutConverter.ConvertFrom(System.Object)">
- <summary>
- Convert the value to a <see cref="T:log4net.Layout.IRawLayout"/> object
- </summary>
- <param name="source">the value to convert</param>
- <returns>the <see cref="T:log4net.Layout.IRawLayout"/> object</returns>
- <remarks>
- <para>
- Convert the <paramref name="source"/> object to a
- <see cref="T:log4net.Layout.IRawLayout"/> object. If the <paramref name="source"/> object
- is a <see cref="T:log4net.Layout.ILayout"/> then the <see cref="T:log4net.Layout.Layout2RawLayoutAdapter"/>
- is used to adapt between the two interfaces, otherwise an
- exception is thrown.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.RawPropertyLayout">
- <summary>
- Extract the value of a property from the <see cref="T:log4net.Core.LoggingEvent"/>
- </summary>
- <remarks>
- <para>
- Extract the value of a property from the <see cref="T:log4net.Core.LoggingEvent"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.RawPropertyLayout.#ctor">
- <summary>
- Constructs a RawPropertyLayout
- </summary>
- </member>
- <member name="M:log4net.Layout.RawPropertyLayout.Format(log4net.Core.LoggingEvent)">
- <summary>
- Lookup the property for <see cref="P:log4net.Layout.RawPropertyLayout.Key"/>
- </summary>
- <param name="loggingEvent">The event to format</param>
- <returns>returns property value</returns>
- <remarks>
- <para>
- Looks up and returns the object value of the property
- named <see cref="P:log4net.Layout.RawPropertyLayout.Key"/>. If there is no property defined
- with than name then <c>null</c> will be returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.RawPropertyLayout.Key">
- <summary>
- The name of the value to lookup in the LoggingEvent Properties collection.
- </summary>
- <value>
- Value to lookup in the LoggingEvent Properties collection
- </value>
- <remarks>
- <para>
- String name of the property to lookup in the <see cref="T:log4net.Core.LoggingEvent"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.RawTimeStampLayout">
- <summary>
- Extract the date from the <see cref="T:log4net.Core.LoggingEvent"/>
- </summary>
- <remarks>
- <para>
- Extract the date from the <see cref="T:log4net.Core.LoggingEvent"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.RawTimeStampLayout.#ctor">
- <summary>
- Constructs a RawTimeStampLayout
- </summary>
- </member>
- <member name="M:log4net.Layout.RawTimeStampLayout.Format(log4net.Core.LoggingEvent)">
- <summary>
- Gets the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> as a <see cref="T:System.DateTime"/>.
- </summary>
- <param name="loggingEvent">The event to format</param>
- <returns>returns the time stamp</returns>
- <remarks>
- <para>
- Gets the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> as a <see cref="T:System.DateTime"/>.
- </para>
- <para>
- The time stamp is in local time. To format the time stamp
- in universal time use <see cref="T:log4net.Layout.RawUtcTimeStampLayout"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.RawUtcTimeStampLayout">
- <summary>
- Extract the date from the <see cref="T:log4net.Core.LoggingEvent"/>
- </summary>
- <remarks>
- <para>
- Extract the date from the <see cref="T:log4net.Core.LoggingEvent"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.RawUtcTimeStampLayout.#ctor">
- <summary>
- Constructs a RawUtcTimeStampLayout
- </summary>
- </member>
- <member name="M:log4net.Layout.RawUtcTimeStampLayout.Format(log4net.Core.LoggingEvent)">
- <summary>
- Gets the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> as a <see cref="T:System.DateTime"/>.
- </summary>
- <param name="loggingEvent">The event to format</param>
- <returns>returns the time stamp</returns>
- <remarks>
- <para>
- Gets the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> as a <see cref="T:System.DateTime"/>.
- </para>
- <para>
- The time stamp is in universal time. To format the time stamp
- in local time use <see cref="T:log4net.Layout.RawTimeStampLayout"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.SimpleLayout">
- <summary>
- A very simple layout
- </summary>
- <remarks>
- <para>
- SimpleLayout consists of the level of the log statement,
- followed by " - " and then the log message itself. For example,
- <code>
- DEBUG - Hello world
- </code>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.SimpleLayout.#ctor">
- <summary>
- Constructs a SimpleLayout
- </summary>
- </member>
- <member name="M:log4net.Layout.SimpleLayout.ActivateOptions">
- <summary>
- Initialize layout options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.SimpleLayout.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.SimpleLayout.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.SimpleLayout.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.SimpleLayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Produces a simple formatted output.
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <remarks>
- <para>
- Formats the event as the level of the even,
- followed by " - " and then the log message itself. The
- output is terminated by a newline.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.XmlLayout">
- <summary>
- Layout that formats the log events as XML elements.
- </summary>
- <remarks>
- <para>
- The output of the <see cref="T:log4net.Layout.XmlLayout"/> consists of a series of
- log4net:event elements. It does not output a complete well-formed XML
- file. The output is designed to be included as an <em>external entity</em>
- in a separate file to form a correct XML file.
- </para>
- <para>
- For example, if <c>abc</c> is the name of the file where
- the <see cref="T:log4net.Layout.XmlLayout"/> output goes, then a well-formed XML file would
- be:
- </para>
- <code lang="XML">
- &lt;?xml version="1.0" ?&gt;
-
- &lt;!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [&lt;!ENTITY data SYSTEM "abc"&gt;]&gt;
-
- &lt;log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2&gt;
- &amp;data;
- &lt;/log4net:events&gt;
- </code>
- <para>
- This approach enforces the independence of the <see cref="T:log4net.Layout.XmlLayout"/>
- and the appender where it is embedded.
- </para>
- <para>
- The <c>version</c> attribute helps components to correctly
- interpret output generated by <see cref="T:log4net.Layout.XmlLayout"/>. The value of
- this attribute should be "1.2" for release 1.2 and later.
- </para>
- <para>
- Alternatively the <c>Header</c> and <c>Footer</c> properties can be
- configured to output the correct XML header, open tag and close tag.
- When setting the <c>Header</c> and <c>Footer</c> properties it is essential
- that the underlying data store not be appendable otherwise the data
- will become invalid XML.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Layout.XmlLayoutBase">
- <summary>
- Layout that formats the log events as XML elements.
- </summary>
- <remarks>
- <para>
- This is an abstract class that must be subclassed by an implementation
- to conform to a specific schema.
- </para>
- <para>
- Deriving classes must implement the <see cref="M:log4net.Layout.XmlLayoutBase.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)"/> method.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.XmlLayoutBase.#ctor">
- <summary>
- Protected constructor to support subclasses
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Layout.XmlLayoutBase"/> class
- with no location info.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayoutBase.#ctor(System.Boolean)">
- <summary>
- Protected constructor to support subclasses
- </summary>
- <remarks>
- <para>
- The <paramref name="locationInfo" /> parameter determines whether
- location information will be output by the layout. If
- <paramref name="locationInfo" /> is set to <c>true</c>, then the
- file name and line number of the statement at the origin of the log
- statement will be output.
- </para>
- <para>
- If you are embedding this layout within an SMTPAppender
- then make sure to set the <b>LocationInfo</b> option of that
- appender as well.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayoutBase.ActivateOptions">
- <summary>
- Initialize layout options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.XmlLayoutBase.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.XmlLayoutBase.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.XmlLayoutBase.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayoutBase.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Produces a formatted string.
- </summary>
- <param name="loggingEvent">The event being logged.</param>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <remarks>
- <para>
- Format the <see cref="T:log4net.Core.LoggingEvent"/> and write it to the <see cref="T:System.IO.TextWriter"/>.
- </para>
- <para>
- This method creates an <see cref="T:System.Xml.XmlTextWriter"/> that writes to the
- <paramref name="writer"/>. The <see cref="T:System.Xml.XmlTextWriter"/> is passed
- to the <see cref="M:log4net.Layout.XmlLayoutBase.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)"/> method. Subclasses should override the
- <see cref="M:log4net.Layout.XmlLayoutBase.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)"/> method rather than this method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayoutBase.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)">
- <summary>
- Does the actual writing of the XML.
- </summary>
- <param name="writer">The writer to use to output the event to.</param>
- <param name="loggingEvent">The event to write.</param>
- <remarks>
- <para>
- Subclasses should override this method to format
- the <see cref="T:log4net.Core.LoggingEvent"/> as XML.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.XmlLayoutBase.m_locationInfo">
- <summary>
- Flag to indicate if location information should be included in
- the XML events.
- </summary>
- </member>
- <member name="F:log4net.Layout.XmlLayoutBase.m_protectCloseTextWriter">
- <summary>
- Writer adapter that ignores Close
- </summary>
- </member>
- <member name="F:log4net.Layout.XmlLayoutBase.m_invalidCharReplacement">
- <summary>
- The string to replace invalid chars with
- </summary>
- </member>
- <member name="P:log4net.Layout.XmlLayoutBase.LocationInfo">
- <summary>
- Gets a value indicating whether to include location information in
- the XML events.
- </summary>
- <value>
- <c>true</c> if location information should be included in the XML
- events; otherwise, <c>false</c>.
- </value>
- <remarks>
- <para>
- If <see cref="P:log4net.Layout.XmlLayoutBase.LocationInfo"/> is set to <c>true</c>, then the file
- name and line number of the statement at the origin of the log
- statement will be output.
- </para>
- <para>
- If you are embedding this layout within an <c>SMTPAppender</c>
- then make sure to set the <b>LocationInfo</b> option of that
- appender as well.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.XmlLayoutBase.InvalidCharReplacement">
- <summary>
- The string to replace characters that can not be expressed in XML with.
- <remarks>
- <para>
- Not all characters may be expressed in XML. This property contains the
- string to replace those that can not with. This defaults to a ?. Set it
- to the empty string to simply remove offending characters. For more
- details on the allowed character ranges see http://www.w3.org/TR/REC-xml/#charsets
- Character replacement will occur in the log message, the property names
- and the property values.
- </para>
- </remarks>
- </summary>
- </member>
- <member name="P:log4net.Layout.XmlLayoutBase.ContentType">
- <summary>
- Gets the content type output by this layout.
- </summary>
- <value>
- As this is the XML layout, the value is always <c>"text/xml"</c>.
- </value>
- <remarks>
- <para>
- As this is the XML layout, the value is always <c>"text/xml"</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayout.#ctor">
- <summary>
- Constructs an XmlLayout
- </summary>
- </member>
- <member name="M:log4net.Layout.XmlLayout.#ctor(System.Boolean)">
- <summary>
- Constructs an XmlLayout.
- </summary>
- <remarks>
- <para>
- The <b>LocationInfo</b> option takes a boolean value. By
- default, it is set to false which means there will be no location
- information output by this layout. If the the option is set to
- true, then the file name and line number of the statement
- at the origin of the log statement will be output.
- </para>
- <para>
- If you are embedding this layout within an SmtpAppender
- then make sure to set the <b>LocationInfo</b> option of that
- appender as well.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayout.ActivateOptions">
- <summary>
- Initialize layout options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.XmlLayout.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.XmlLayout.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.XmlLayout.ActivateOptions"/> must be called again.
- </para>
- <para>
- Builds a cache of the element names
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayout.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)">
- <summary>
- Does the actual writing of the XML.
- </summary>
- <param name="writer">The writer to use to output the event to.</param>
- <param name="loggingEvent">The event to write.</param>
- <remarks>
- <para>
- Override the base class <see cref="M:log4net.Layout.XmlLayoutBase.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)"/> method
- to write the <see cref="T:log4net.Core.LoggingEvent"/> to the <see cref="T:System.Xml.XmlWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.XmlLayout.m_prefix">
- <summary>
- The prefix to use for all generated element names
- </summary>
- </member>
- <member name="P:log4net.Layout.XmlLayout.Prefix">
- <summary>
- The prefix to use for all element names
- </summary>
- <remarks>
- <para>
- The default prefix is <b>log4net</b>. Set this property
- to change the prefix. If the prefix is set to an empty string
- then no prefix will be written.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.XmlLayout.Base64EncodeMessage">
- <summary>
- Set whether or not to base64 encode the message.
- </summary>
- <remarks>
- <para>
- By default the log message will be written as text to the xml
- output. This can cause problems when the message contains binary
- data. By setting this to true the contents of the message will be
- base64 encoded. If this is set then invalid character replacement
- (see <see cref="P:log4net.Layout.XmlLayoutBase.InvalidCharReplacement"/>) will not be performed
- on the log message.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.XmlLayout.Base64EncodeProperties">
- <summary>
- Set whether or not to base64 encode the property values.
- </summary>
- <remarks>
- <para>
- By default the properties will be written as text to the xml
- output. This can cause problems when one or more properties contain
- binary data. By setting this to true the values of the properties
- will be base64 encoded. If this is set then invalid character replacement
- (see <see cref="P:log4net.Layout.XmlLayoutBase.InvalidCharReplacement"/>) will not be performed
- on the property values.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.XmlLayoutSchemaLog4j">
- <summary>
- Layout that formats the log events as XML elements compatible with the log4j schema
- </summary>
- <remarks>
- <para>
- Formats the log events according to the http://logging.apache.org/log4j schema.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Layout.XmlLayoutSchemaLog4j.s_date1970">
- <summary>
- The 1st of January 1970 in UTC
- </summary>
- </member>
- <member name="M:log4net.Layout.XmlLayoutSchemaLog4j.#ctor">
- <summary>
- Constructs an XMLLayoutSchemaLog4j
- </summary>
- </member>
- <member name="M:log4net.Layout.XmlLayoutSchemaLog4j.#ctor(System.Boolean)">
- <summary>
- Constructs an XMLLayoutSchemaLog4j.
- </summary>
- <remarks>
- <para>
- The <b>LocationInfo</b> option takes a boolean value. By
- default, it is set to false which means there will be no location
- information output by this layout. If the the option is set to
- true, then the file name and line number of the statement
- at the origin of the log statement will be output.
- </para>
- <para>
- If you are embedding this layout within an SMTPAppender
- then make sure to set the <b>LocationInfo</b> option of that
- appender as well.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayoutSchemaLog4j.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)">
- <summary>
- Actually do the writing of the xml
- </summary>
- <param name="writer">the writer to use</param>
- <param name="loggingEvent">the event to write</param>
- <remarks>
- <para>
- Generate XML that is compatible with the log4j schema.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.XmlLayoutSchemaLog4j.Version">
- <summary>
- The version of the log4j schema to use.
- </summary>
- <remarks>
- <para>
- Only version 1.2 of the log4j schema is supported.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.ObjectRenderer.DefaultRenderer">
- <summary>
- The default object Renderer.
- </summary>
- <remarks>
- <para>
- The default renderer supports rendering objects and collections to strings.
- </para>
- <para>
- See the <see cref="M:log4net.ObjectRenderer.DefaultRenderer.RenderObject(log4net.ObjectRenderer.RendererMap,System.Object,System.IO.TextWriter)"/> method for details of the output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.ObjectRenderer.IObjectRenderer">
- <summary>
- Implement this interface in order to render objects as strings
- </summary>
- <remarks>
- <para>
- Certain types require special case conversion to
- string form. This conversion is done by an object renderer.
- Object renderers implement the <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>
- interface.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.ObjectRenderer.IObjectRenderer.RenderObject(log4net.ObjectRenderer.RendererMap,System.Object,System.IO.TextWriter)">
- <summary>
- Render the object <paramref name="obj"/> to a string
- </summary>
- <param name="rendererMap">The map used to lookup renderers</param>
- <param name="obj">The object to render</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- Render the object <paramref name="obj"/> to a
- string.
- </para>
- <para>
- The <paramref name="rendererMap"/> parameter is
- provided to lookup and render other objects. This is
- very useful where <paramref name="obj"/> contains
- nested objects of unknown type. The <see cref="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object,System.IO.TextWriter)"/>
- method can be used to render these objects.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.DefaultRenderer.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.DefaultRenderer.RenderObject(log4net.ObjectRenderer.RendererMap,System.Object,System.IO.TextWriter)">
- <summary>
- Render the object <paramref name="obj"/> to a string
- </summary>
- <param name="rendererMap">The map used to lookup renderers</param>
- <param name="obj">The object to render</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- Render the object <paramref name="obj"/> to a string.
- </para>
- <para>
- The <paramref name="rendererMap"/> parameter is
- provided to lookup and render other objects. This is
- very useful where <paramref name="obj"/> contains
- nested objects of unknown type. The <see cref="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object)"/>
- method can be used to render these objects.
- </para>
- <para>
- The default renderer supports rendering objects to strings as follows:
- </para>
- <list type="table">
- <listheader>
- <term>Value</term>
- <description>Rendered String</description>
- </listheader>
- <item>
- <term><c>null</c></term>
- <description>
- <para>"(null)"</para>
- </description>
- </item>
- <item>
- <term><see cref="T:System.Array"/></term>
- <description>
- <para>
- For a one dimensional array this is the
- array type name, an open brace, followed by a comma
- separated list of the elements (using the appropriate
- renderer), followed by a close brace.
- </para>
- <para>
- For example: <c>int[] {1, 2, 3}</c>.
- </para>
- <para>
- If the array is not one dimensional the
- <c>Array.ToString()</c> is returned.
- </para>
- </description>
- </item>
- <item>
- <term><see cref="T:System.Collections.IEnumerable"/>, <see cref="T:System.Collections.ICollection"/> &amp; <see cref="T:System.Collections.IEnumerator"/></term>
- <description>
- <para>
- Rendered as an open brace, followed by a comma
- separated list of the elements (using the appropriate
- renderer), followed by a close brace.
- </para>
- <para>
- For example: <c>{a, b, c}</c>.
- </para>
- <para>
- All collection classes that implement <see cref="T:System.Collections.ICollection"/> its subclasses,
- or generic equivalents all implement the <see cref="T:System.Collections.IEnumerable"/> interface.
- </para>
- </description>
- </item>
- <item>
- <term><see cref="T:System.Collections.DictionaryEntry"/></term>
- <description>
- <para>
- Rendered as the key, an equals sign ('='), and the value (using the appropriate
- renderer).
- </para>
- <para>
- For example: <c>key=value</c>.
- </para>
- </description>
- </item>
- <item>
- <term>other</term>
- <description>
- <para><c>Object.ToString()</c></para>
- </description>
- </item>
- </list>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.DefaultRenderer.RenderArray(log4net.ObjectRenderer.RendererMap,System.Array,System.IO.TextWriter)">
- <summary>
- Render the array argument into a string
- </summary>
- <param name="rendererMap">The map used to lookup renderers</param>
- <param name="array">the array to render</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- For a one dimensional array this is the
- array type name, an open brace, followed by a comma
- separated list of the elements (using the appropriate
- renderer), followed by a close brace. For example:
- <c>int[] {1, 2, 3}</c>.
- </para>
- <para>
- If the array is not one dimensional the
- <c>Array.ToString()</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.DefaultRenderer.RenderEnumerator(log4net.ObjectRenderer.RendererMap,System.Collections.IEnumerator,System.IO.TextWriter)">
- <summary>
- Render the enumerator argument into a string
- </summary>
- <param name="rendererMap">The map used to lookup renderers</param>
- <param name="enumerator">the enumerator to render</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- Rendered as an open brace, followed by a comma
- separated list of the elements (using the appropriate
- renderer), followed by a close brace. For example:
- <c>{a, b, c}</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.DefaultRenderer.RenderDictionaryEntry(log4net.ObjectRenderer.RendererMap,System.Collections.DictionaryEntry,System.IO.TextWriter)">
- <summary>
- Render the DictionaryEntry argument into a string
- </summary>
- <param name="rendererMap">The map used to lookup renderers</param>
- <param name="entry">the DictionaryEntry to render</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- Render the key, an equals sign ('='), and the value (using the appropriate
- renderer). For example: <c>key=value</c>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.ObjectRenderer.RendererMap">
- <summary>
- Map class objects to an <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>.
- </summary>
- <remarks>
- <para>
- Maintains a mapping between types that require special
- rendering and the <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/> that
- is used to render them.
- </para>
- <para>
- The <see cref="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object)"/> method is used to render an
- <c>object</c> using the appropriate renderers defined in this map.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.#ctor">
- <summary>
- Default Constructor
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object)">
- <summary>
- Render <paramref name="obj"/> using the appropriate renderer.
- </summary>
- <param name="obj">the object to render to a string</param>
- <returns>the object rendered as a string</returns>
- <remarks>
- <para>
- This is a convenience method used to render an object to a string.
- The alternative method <see cref="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object,System.IO.TextWriter)"/>
- should be used when streaming output to a <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object,System.IO.TextWriter)">
- <summary>
- Render <paramref name="obj"/> using the appropriate renderer.
- </summary>
- <param name="obj">the object to render to a string</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- Find the appropriate renderer for the type of the
- <paramref name="obj"/> parameter. This is accomplished by calling the
- <see cref="M:log4net.ObjectRenderer.RendererMap.Get(System.Type)"/> method. Once a renderer is found, it is
- applied on the object <paramref name="obj"/> and the result is returned
- as a <see cref="T:System.String"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.Get(System.Object)">
- <summary>
- Gets the renderer for the specified object type
- </summary>
- <param name="obj">the object to lookup the renderer for</param>
- <returns>the renderer for <paramref name="obj"/></returns>
- <remarks>
- <param>
- Gets the renderer for the specified object type.
- </param>
- <param>
- Syntactic sugar method that calls <see cref="M:log4net.ObjectRenderer.RendererMap.Get(System.Type)"/>
- with the type of the object parameter.
- </param>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.Get(System.Type)">
- <summary>
- Gets the renderer for the specified type
- </summary>
- <param name="type">the type to lookup the renderer for</param>
- <returns>the renderer for the specified type</returns>
- <remarks>
- <para>
- Returns the renderer for the specified type.
- If no specific renderer has been defined the
- <see cref="P:log4net.ObjectRenderer.RendererMap.DefaultRenderer"/> will be returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.SearchTypeAndInterfaces(System.Type)">
- <summary>
- Internal function to recursively search interfaces
- </summary>
- <param name="type">the type to lookup the renderer for</param>
- <returns>the renderer for the specified type</returns>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.Clear">
- <summary>
- Clear the map of renderers
- </summary>
- <remarks>
- <para>
- Clear the custom renderers defined by using
- <see cref="M:log4net.ObjectRenderer.RendererMap.Put(System.Type,log4net.ObjectRenderer.IObjectRenderer)"/>. The <see cref="P:log4net.ObjectRenderer.RendererMap.DefaultRenderer"/>
- cannot be removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.Put(System.Type,log4net.ObjectRenderer.IObjectRenderer)">
- <summary>
- Register an <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/> for <paramref name="typeToRender"/>.
- </summary>
- <param name="typeToRender">the type that will be rendered by <paramref name="renderer"/></param>
- <param name="renderer">the renderer for <paramref name="typeToRender"/></param>
- <remarks>
- <para>
- Register an object renderer for a specific source type.
- This renderer will be returned from a call to <see cref="M:log4net.ObjectRenderer.RendererMap.Get(System.Type)"/>
- specifying the same <paramref name="typeToRender"/> as an argument.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.ObjectRenderer.RendererMap.DefaultRenderer">
- <summary>
- Get the default renderer instance
- </summary>
- <value>the default renderer</value>
- <remarks>
- <para>
- Get the default renderer
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Plugin.IPlugin">
- <summary>
- Interface implemented by logger repository plugins.
- </summary>
- <remarks>
- <para>
- Plugins define additional behavior that can be associated
- with a <see cref="T:log4net.Repository.ILoggerRepository"/>.
- The <see cref="T:log4net.Plugin.PluginMap"/> held by the <see cref="P:log4net.Repository.ILoggerRepository.PluginMap"/>
- property is used to store the plugins for a repository.
- </para>
- <para>
- The <c>log4net.Config.PluginAttribute</c> can be used to
- attach plugins to repositories created using configuration
- attributes.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Plugin.IPlugin.Attach(log4net.Repository.ILoggerRepository)">
- <summary>
- Attaches the plugin to the specified <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </summary>
- <param name="repository">The <see cref="T:log4net.Repository.ILoggerRepository"/> that this plugin should be attached to.</param>
- <remarks>
- <para>
- A plugin may only be attached to a single repository.
- </para>
- <para>
- This method is called when the plugin is attached to the repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.IPlugin.Shutdown">
- <summary>
- Is called when the plugin is to shutdown.
- </summary>
- <remarks>
- <para>
- This method is called to notify the plugin that
- it should stop operating and should detach from
- the repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Plugin.IPlugin.Name">
- <summary>
- Gets the name of the plugin.
- </summary>
- <value>
- The name of the plugin.
- </value>
- <remarks>
- <para>
- Plugins are stored in the <see cref="T:log4net.Plugin.PluginMap"/>
- keyed by name. Each plugin instance attached to a
- repository must be a unique name.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Plugin.PluginCollection">
- <summary>
- A strongly-typed collection of <see cref="T:log4net.Plugin.IPlugin"/> objects.
- </summary>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.ReadOnly(log4net.Plugin.PluginCollection)">
- <summary>
- Creates a read-only wrapper for a <c>PluginCollection</c> instance.
- </summary>
- <param name="list">list to create a readonly wrapper arround</param>
- <returns>
- A <c>PluginCollection</c> wrapper that is read-only.
- </returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor">
- <summary>
- Initializes a new instance of the <c>PluginCollection</c> class
- that is empty and has the default initial capacity.
- </summary>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor(System.Int32)">
- <summary>
- Initializes a new instance of the <c>PluginCollection</c> class
- that has the specified initial capacity.
- </summary>
- <param name="capacity">
- The number of elements that the new <c>PluginCollection</c> is initially capable of storing.
- </param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor(log4net.Plugin.PluginCollection)">
- <summary>
- Initializes a new instance of the <c>PluginCollection</c> class
- that contains elements copied from the specified <c>PluginCollection</c>.
- </summary>
- <param name="c">The <c>PluginCollection</c> whose elements are copied to the new collection.</param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor(log4net.Plugin.IPlugin[])">
- <summary>
- Initializes a new instance of the <c>PluginCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Plugin.IPlugin"/> array.
- </summary>
- <param name="a">The <see cref="T:log4net.Plugin.IPlugin"/> array whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor(System.Collections.ICollection)">
- <summary>
- Initializes a new instance of the <c>PluginCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Plugin.IPlugin"/> collection.
- </summary>
- <param name="col">The <see cref="T:log4net.Plugin.IPlugin"/> collection whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor(log4net.Plugin.PluginCollection.Tag)">
- <summary>
- Allow subclasses to avoid our default constructors
- </summary>
- <param name="tag"></param>
- <exclude/>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.CopyTo(log4net.Plugin.IPlugin[])">
- <summary>
- Copies the entire <c>PluginCollection</c> to a one-dimensional
- <see cref="T:log4net.Plugin.IPlugin"/> array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Plugin.IPlugin"/> array to copy to.</param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.CopyTo(log4net.Plugin.IPlugin[],System.Int32)">
- <summary>
- Copies the entire <c>PluginCollection</c> to a one-dimensional
- <see cref="T:log4net.Plugin.IPlugin"/> array, starting at the specified index of the target array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Plugin.IPlugin"/> array to copy to.</param>
- <param name="start">The zero-based index in <paramref name="array"/> at which copying begins.</param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Add(log4net.Plugin.IPlugin)">
- <summary>
- Adds a <see cref="T:log4net.Plugin.IPlugin"/> to the end of the <c>PluginCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Plugin.IPlugin"/> to be added to the end of the <c>PluginCollection</c>.</param>
- <returns>The index at which the value has been added.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Clear">
- <summary>
- Removes all elements from the <c>PluginCollection</c>.
- </summary>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Clone">
- <summary>
- Creates a shallow copy of the <see cref="T:log4net.Plugin.PluginCollection"/>.
- </summary>
- <returns>A new <see cref="T:log4net.Plugin.PluginCollection"/> with a shallow copy of the collection data.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Contains(log4net.Plugin.IPlugin)">
- <summary>
- Determines whether a given <see cref="T:log4net.Plugin.IPlugin"/> is in the <c>PluginCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Plugin.IPlugin"/> to check for.</param>
- <returns><c>true</c> if <paramref name="item"/> is found in the <c>PluginCollection</c>; otherwise, <c>false</c>.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.IndexOf(log4net.Plugin.IPlugin)">
- <summary>
- Returns the zero-based index of the first occurrence of a <see cref="T:log4net.Plugin.IPlugin"/>
- in the <c>PluginCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Plugin.IPlugin"/> to locate in the <c>PluginCollection</c>.</param>
- <returns>
- The zero-based index of the first occurrence of <paramref name="item"/>
- in the entire <c>PluginCollection</c>, if found; otherwise, -1.
- </returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Insert(System.Int32,log4net.Plugin.IPlugin)">
- <summary>
- Inserts an element into the <c>PluginCollection</c> at the specified index.
- </summary>
- <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
- <param name="item">The <see cref="T:log4net.Plugin.IPlugin"/> to insert.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Plugin.PluginCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Remove(log4net.Plugin.IPlugin)">
- <summary>
- Removes the first occurrence of a specific <see cref="T:log4net.Plugin.IPlugin"/> from the <c>PluginCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Plugin.IPlugin"/> to remove from the <c>PluginCollection</c>.</param>
- <exception cref="T:System.ArgumentException">
- The specified <see cref="T:log4net.Plugin.IPlugin"/> was not found in the <c>PluginCollection</c>.
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.RemoveAt(System.Int32)">
- <summary>
- Removes the element at the specified index of the <c>PluginCollection</c>.
- </summary>
- <param name="index">The zero-based index of the element to remove.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero.</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Plugin.PluginCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through the <c>PluginCollection</c>.
- </summary>
- <returns>An <see cref="T:log4net.Plugin.PluginCollection.Enumerator"/> for the entire <c>PluginCollection</c>.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.AddRange(log4net.Plugin.PluginCollection)">
- <summary>
- Adds the elements of another <c>PluginCollection</c> to the current <c>PluginCollection</c>.
- </summary>
- <param name="x">The <c>PluginCollection</c> whose elements should be added to the end of the current <c>PluginCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Plugin.PluginCollection.Count"/> of the <c>PluginCollection</c>.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.AddRange(log4net.Plugin.IPlugin[])">
- <summary>
- Adds the elements of a <see cref="T:log4net.Plugin.IPlugin"/> array to the current <c>PluginCollection</c>.
- </summary>
- <param name="x">The <see cref="T:log4net.Plugin.IPlugin"/> array whose elements should be added to the end of the <c>PluginCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Plugin.PluginCollection.Count"/> of the <c>PluginCollection</c>.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.AddRange(System.Collections.ICollection)">
- <summary>
- Adds the elements of a <see cref="T:log4net.Plugin.IPlugin"/> collection to the current <c>PluginCollection</c>.
- </summary>
- <param name="col">The <see cref="T:log4net.Plugin.IPlugin"/> collection whose elements should be added to the end of the <c>PluginCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Plugin.PluginCollection.Count"/> of the <c>PluginCollection</c>.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.TrimToSize">
- <summary>
- Sets the capacity to the actual number of elements.
- </summary>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.ValidateIndex(System.Int32)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero.</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Plugin.PluginCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.ValidateIndex(System.Int32,System.Boolean)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero.</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Plugin.PluginCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.Count">
- <summary>
- Gets the number of elements actually contained in the <c>PluginCollection</c>.
- </summary>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.IsSynchronized">
- <summary>
- Gets a value indicating whether access to the collection is synchronized (thread-safe).
- </summary>
- <returns>true if access to the ICollection is synchronized (thread-safe); otherwise, false.</returns>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.SyncRoot">
- <summary>
- Gets an object that can be used to synchronize access to the collection.
- </summary>
- <value>
- An object that can be used to synchronize access to the collection.
- </value>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.Item(System.Int32)">
- <summary>
- Gets or sets the <see cref="T:log4net.Plugin.IPlugin"/> at the specified index.
- </summary>
- <value>
- The <see cref="T:log4net.Plugin.IPlugin"/> at the specified index.
- </value>
- <param name="index">The zero-based index of the element to get or set.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero.</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Plugin.PluginCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.IsFixedSize">
- <summary>
- Gets a value indicating whether the collection has a fixed size.
- </summary>
- <value><c>true</c> if the collection has a fixed size; otherwise, <c>false</c>. The default is <c>false</c>.</value>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.IsReadOnly">
- <summary>
- Gets a value indicating whether the IList is read-only.
- </summary>
- <value><c>true</c> if the collection is read-only; otherwise, <c>false</c>. The default is <c>false</c>.</value>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.Capacity">
- <summary>
- Gets or sets the number of elements the <c>PluginCollection</c> can contain.
- </summary>
- <value>
- The number of elements the <c>PluginCollection</c> can contain.
- </value>
- </member>
- <member name="T:log4net.Plugin.PluginCollection.IPluginCollectionEnumerator">
- <summary>
- Supports type-safe iteration over a <see cref="T:log4net.Plugin.PluginCollection"/>.
- </summary>
- <exclude/>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.IPluginCollectionEnumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.IPluginCollectionEnumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.IPluginCollectionEnumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- </member>
- <member name="T:log4net.Plugin.PluginCollection.Tag">
- <summary>
- Type visible only to our subclasses
- Used to access protected constructor
- </summary>
- <exclude/>
- </member>
- <member name="F:log4net.Plugin.PluginCollection.Tag.Default">
- <summary>
- A value
- </summary>
- </member>
- <member name="T:log4net.Plugin.PluginCollection.Enumerator">
- <summary>
- Supports simple iteration over a <see cref="T:log4net.Plugin.PluginCollection"/>.
- </summary>
- <exclude/>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Enumerator.#ctor(log4net.Plugin.PluginCollection)">
- <summary>
- Initializes a new instance of the <c>Enumerator</c> class.
- </summary>
- <param name="tc"></param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Enumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Enumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.Enumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- <value>
- The current element in the collection.
- </value>
- </member>
- <member name="T:log4net.Plugin.PluginCollection.ReadOnlyPluginCollection">
- <exclude/>
- </member>
- <member name="T:log4net.Plugin.PluginMap">
- <summary>
- Map of repository plugins.
- </summary>
- <remarks>
- <para>
- This class is a name keyed map of the plugins that are
- attached to a repository.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Plugin.PluginMap.#ctor(log4net.Repository.ILoggerRepository)">
- <summary>
- Constructor
- </summary>
- <param name="repository">The repository that the plugins should be attached to.</param>
- <remarks>
- <para>
- Initialize a new instance of the <see cref="T:log4net.Plugin.PluginMap"/> class with a
- repository that the plugins should be attached to.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.PluginMap.Add(log4net.Plugin.IPlugin)">
- <summary>
- Adds a <see cref="T:log4net.Plugin.IPlugin"/> to the map.
- </summary>
- <param name="plugin">The <see cref="T:log4net.Plugin.IPlugin"/> to add to the map.</param>
- <remarks>
- <para>
- The <see cref="T:log4net.Plugin.IPlugin"/> will be attached to the repository when added.
- </para>
- <para>
- If there already exists a plugin with the same name
- attached to the repository then the old plugin will
- be <see cref="M:log4net.Plugin.IPlugin.Shutdown"/> and replaced with
- the new plugin.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.PluginMap.Remove(log4net.Plugin.IPlugin)">
- <summary>
- Removes a <see cref="T:log4net.Plugin.IPlugin"/> from the map.
- </summary>
- <param name="plugin">The <see cref="T:log4net.Plugin.IPlugin"/> to remove from the map.</param>
- <remarks>
- <para>
- Remove a specific plugin from this map.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Plugin.PluginMap.Item(System.String)">
- <summary>
- Gets a <see cref="T:log4net.Plugin.IPlugin"/> by name.
- </summary>
- <param name="name">The name of the <see cref="T:log4net.Plugin.IPlugin"/> to lookup.</param>
- <returns>
- The <see cref="T:log4net.Plugin.IPlugin"/> from the map with the name specified, or
- <c>null</c> if no plugin is found.
- </returns>
- <remarks>
- <para>
- Lookup a plugin by name. If the plugin is not found <c>null</c>
- will be returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Plugin.PluginMap.AllPlugins">
- <summary>
- Gets all possible plugins as a list of <see cref="T:log4net.Plugin.IPlugin"/> objects.
- </summary>
- <value>All possible plugins as a list of <see cref="T:log4net.Plugin.IPlugin"/> objects.</value>
- <remarks>
- <para>
- Get a collection of all the plugins defined in this map.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Plugin.PluginSkeleton">
- <summary>
- Base implementation of <see cref="T:log4net.Plugin.IPlugin"/>
- </summary>
- <remarks>
- <para>
- Default abstract implementation of the <see cref="T:log4net.Plugin.IPlugin"/>
- interface. This base class can be used by implementors
- of the <see cref="T:log4net.Plugin.IPlugin"/> interface.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Plugin.PluginSkeleton.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="name">the name of the plugin</param>
- <remarks>
- Initializes a new Plugin with the specified name.
- </remarks>
- </member>
- <member name="M:log4net.Plugin.PluginSkeleton.Attach(log4net.Repository.ILoggerRepository)">
- <summary>
- Attaches this plugin to a <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </summary>
- <param name="repository">The <see cref="T:log4net.Repository.ILoggerRepository"/> that this plugin should be attached to.</param>
- <remarks>
- <para>
- A plugin may only be attached to a single repository.
- </para>
- <para>
- This method is called when the plugin is attached to the repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.PluginSkeleton.Shutdown">
- <summary>
- Is called when the plugin is to shutdown.
- </summary>
- <remarks>
- <para>
- This method is called to notify the plugin that
- it should stop operating and should detach from
- the repository.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Plugin.PluginSkeleton.m_name">
- <summary>
- The name of this plugin.
- </summary>
- </member>
- <member name="F:log4net.Plugin.PluginSkeleton.m_repository">
- <summary>
- The repository this plugin is attached to.
- </summary>
- </member>
- <member name="P:log4net.Plugin.PluginSkeleton.Name">
- <summary>
- Gets or sets the name of the plugin.
- </summary>
- <value>
- The name of the plugin.
- </value>
- <remarks>
- <para>
- Plugins are stored in the <see cref="T:log4net.Plugin.PluginMap"/>
- keyed by name. Each plugin instance attached to a
- repository must be a unique name.
- </para>
- <para>
- The name of the plugin must not change one the
- plugin has been attached to a repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Plugin.PluginSkeleton.LoggerRepository">
- <summary>
- The repository for this plugin
- </summary>
- <value>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that this plugin is attached to.
- </value>
- <remarks>
- <para>
- Gets or sets the <see cref="T:log4net.Repository.ILoggerRepository"/> that this plugin is
- attached to.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Plugin.RemoteLoggingServerPlugin">
- <summary>
- Plugin that listens for events from the <see cref="T:log4net.Appender.RemotingAppender"/>
- </summary>
- <remarks>
- <para>
- This plugin publishes an instance of <see cref="T:log4net.Appender.RemotingAppender.IRemoteLoggingSink"/>
- on a specified <see cref="P:log4net.Plugin.RemoteLoggingServerPlugin.SinkUri"/>. This listens for logging events delivered from
- a remote <see cref="T:log4net.Appender.RemotingAppender"/>.
- </para>
- <para>
- When an event is received it is relogged within the attached repository
- as if it had been raised locally.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Plugin.RemoteLoggingServerPlugin"/> class.
- </para>
- <para>
- The <see cref="P:log4net.Plugin.RemoteLoggingServerPlugin.SinkUri"/> property must be set.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.#ctor(System.String)">
- <summary>
- Construct with sink Uri.
- </summary>
- <param name="sinkUri">The name to publish the sink under in the remoting infrastructure.
- See <see cref="P:log4net.Plugin.RemoteLoggingServerPlugin.SinkUri"/> for more details.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Plugin.RemoteLoggingServerPlugin"/> class
- with specified name.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.Attach(log4net.Repository.ILoggerRepository)">
- <summary>
- Attaches this plugin to a <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </summary>
- <param name="repository">The <see cref="T:log4net.Repository.ILoggerRepository"/> that this plugin should be attached to.</param>
- <remarks>
- <para>
- A plugin may only be attached to a single repository.
- </para>
- <para>
- This method is called when the plugin is attached to the repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.Shutdown">
- <summary>
- Is called when the plugin is to shutdown.
- </summary>
- <remarks>
- <para>
- When the plugin is shutdown the remote logging
- sink is disconnected.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Plugin.RemoteLoggingServerPlugin.SinkUri">
- <summary>
- Gets or sets the URI of this sink.
- </summary>
- <value>
- The URI of this sink.
- </value>
- <remarks>
- <para>
- This is the name under which the object is marshaled.
- <see cref="M:System.Runtime.Remoting.RemotingServices.Marshal(System.MarshalByRefObject,System.String,System.Type)"/>
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl">
- <summary>
- Delivers <see cref="T:log4net.Core.LoggingEvent"/> objects to a remote sink.
- </summary>
- <remarks>
- <para>
- Internal class used to listen for logging events
- and deliver them to the local repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl.#ctor(log4net.Repository.ILoggerRepository)">
- <summary>
- Constructor
- </summary>
- <param name="repository">The repository to log to.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl"/> for the
- specified <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl.LogEvents(log4net.Core.LoggingEvent[])">
- <summary>
- Logs the events to the repository.
- </summary>
- <param name="events">The events to log.</param>
- <remarks>
- <para>
- The events passed are logged to the <see cref="T:log4net.Repository.ILoggerRepository"/>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl.InitializeLifetimeService">
- <summary>
- Obtains a lifetime service object to control the lifetime
- policy for this instance.
- </summary>
- <returns><c>null</c> to indicate that this instance should live forever.</returns>
- <remarks>
- <para>
- Obtains a lifetime service object to control the lifetime
- policy for this instance. This object should live forever
- therefore this implementation returns <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl.m_repository">
- <summary>
- The underlying <see cref="T:log4net.Repository.ILoggerRepository"/> that events should
- be logged to.
- </summary>
- </member>
- <member name="T:log4net.Repository.Hierarchy.DefaultLoggerFactory">
- <summary>
- Default implementation of <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>
- </summary>
- <remarks>
- <para>
- This default implementation of the <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>
- interface is used to create the default subclass
- of the <see cref="T:log4net.Repository.Hierarchy.Logger"/> object.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Repository.Hierarchy.ILoggerFactory">
- <summary>
- Interface abstracts creation of <see cref="T:log4net.Repository.Hierarchy.Logger"/> instances
- </summary>
- <remarks>
- <para>
- This interface is used by the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> to
- create new <see cref="T:log4net.Repository.Hierarchy.Logger"/> objects.
- </para>
- <para>
- The <see cref="M:log4net.Repository.Hierarchy.ILoggerFactory.CreateLogger(System.String)"/> method is called
- to create a named <see cref="T:log4net.Repository.Hierarchy.Logger"/>.
- </para>
- <para>
- Implement this interface to create new subclasses of <see cref="T:log4net.Repository.Hierarchy.Logger"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.ILoggerFactory.CreateLogger(System.String)">
- <summary>
- Create a new <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance
- </summary>
- <param name="name">The name of the <see cref="T:log4net.Repository.Hierarchy.Logger"/>.</param>
- <returns>The <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance for the specified name.</returns>
- <remarks>
- <para>
- Create a new <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance with the
- specified name.
- </para>
- <para>
- Called by the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> to create
- new named <see cref="T:log4net.Repository.Hierarchy.Logger"/> instances.
- </para>
- <para>
- If the <paramref name="name"/> is <c>null</c> then the root logger
- must be returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.DefaultLoggerFactory.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.DefaultLoggerFactory"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.DefaultLoggerFactory.CreateLogger(System.String)">
- <summary>
- Create a new <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance
- </summary>
- <param name="name">The name of the <see cref="T:log4net.Repository.Hierarchy.Logger"/>.</param>
- <returns>The <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance for the specified name.</returns>
- <remarks>
- <para>
- Create a new <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance with the
- specified name.
- </para>
- <para>
- Called by the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> to create
- new named <see cref="T:log4net.Repository.Hierarchy.Logger"/> instances.
- </para>
- <para>
- If the <paramref name="name"/> is <c>null</c> then the root logger
- must be returned.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.DefaultLoggerFactory.LoggerImpl">
- <summary>
- Default internal subclass of <see cref="T:log4net.Repository.Hierarchy.Logger"/>
- </summary>
- <remarks>
- <para>
- This subclass has no additional behavior over the
- <see cref="T:log4net.Repository.Hierarchy.Logger"/> class but does allow instances
- to be created.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.Logger">
- <summary>
- Implementation of <see cref="T:log4net.Core.ILogger"/> used by <see cref="P:log4net.Repository.Hierarchy.Logger.Hierarchy"/>
- </summary>
- <remarks>
- <para>
- Internal class used to provide implementation of <see cref="T:log4net.Core.ILogger"/>
- interface. Applications should use <see cref="T:log4net.LogManager"/> to get
- logger instances.
- </para>
- <para>
- This is one of the central classes in the log4net implementation. One of the
- distinctive features of log4net are hierarchical loggers and their
- evaluation. The <see cref="P:log4net.Repository.Hierarchy.Logger.Hierarchy"/> organizes the <see cref="T:log4net.Repository.Hierarchy.Logger"/>
- instances into a rooted tree hierarchy.
- </para>
- <para>
- The <see cref="T:log4net.Repository.Hierarchy.Logger"/> class is abstract. Only concrete subclasses of
- <see cref="T:log4net.Repository.Hierarchy.Logger"/> can be created. The <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>
- is used to create instances of this type for the <see cref="P:log4net.Repository.Hierarchy.Logger.Hierarchy"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Aspi Havewala</author>
- <author>Douglas de la Torre</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.#ctor(System.String)">
- <summary>
- This constructor created a new <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance and
- sets its name.
- </summary>
- <param name="name">The name of the <see cref="T:log4net.Repository.Hierarchy.Logger"/>.</param>
- <remarks>
- <para>
- This constructor is protected and designed to be used by
- a subclass that is not abstract.
- </para>
- <para>
- Loggers are constructed by <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>
- objects. See <see cref="T:log4net.Repository.Hierarchy.DefaultLoggerFactory"/> for the default
- logger creator.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.AddAppender(log4net.Appender.IAppender)">
- <summary>
- Add <paramref name="newAppender"/> to the list of appenders of this
- Logger instance.
- </summary>
- <param name="newAppender">An appender to add to this logger</param>
- <remarks>
- <para>
- Add <paramref name="newAppender"/> to the list of appenders of this
- Logger instance.
- </para>
- <para>
- If <paramref name="newAppender"/> is already in the list of
- appenders, then it won't be added again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.GetAppender(System.String)">
- <summary>
- Look for the appender named as <c>name</c>
- </summary>
- <param name="name">The name of the appender to lookup</param>
- <returns>The appender with the name specified, or <c>null</c>.</returns>
- <remarks>
- <para>
- Returns the named appender, or null if the appender is not found.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.RemoveAllAppenders">
- <summary>
- Remove all previously added appenders from this Logger instance.
- </summary>
- <remarks>
- <para>
- Remove all previously added appenders from this Logger instance.
- </para>
- <para>
- This is useful when re-reading configuration information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.RemoveAppender(log4net.Appender.IAppender)">
- <summary>
- Remove the appender passed as parameter form the list of appenders.
- </summary>
- <param name="appender">The appender to remove</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- Remove the appender passed as parameter form the list of appenders.
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.RemoveAppender(System.String)">
- <summary>
- Remove the appender passed as parameter form the list of appenders.
- </summary>
- <param name="name">The name of the appender to remove</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- Remove the named appender passed as parameter form the list of appenders.
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.Log(System.Type,log4net.Core.Level,System.Object,System.Exception)">
- <summary>
- This generic form is intended to be used by wrappers.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="level">The level of the message to be logged.</param>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Generate a logging event for the specified <paramref name="level"/> using
- the <paramref name="message"/> and <paramref name="exception"/>.
- </para>
- <para>
- This method must not throw any exception to the caller.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.Log(log4net.Core.LoggingEvent)">
- <summary>
- This is the most generic printing method that is intended to be used
- by wrappers.
- </summary>
- <param name="logEvent">The event being logged.</param>
- <remarks>
- <para>
- Logs the specified logging event through this logger.
- </para>
- <para>
- This method must not throw any exception to the caller.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.IsEnabledFor(log4net.Core.Level)">
- <summary>
- Checks if this logger is enabled for a given <see cref="P:log4net.Repository.Hierarchy.Logger.Level"/> passed as parameter.
- </summary>
- <param name="level">The level to check.</param>
- <returns>
- <c>true</c> if this logger is enabled for <c>level</c>, otherwise <c>false</c>.
- </returns>
- <remarks>
- <para>
- Test if this logger is going to log events of the specified <paramref name="level"/>.
- </para>
- <para>
- This method must not throw any exception to the caller.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.CallAppenders(log4net.Core.LoggingEvent)">
- <summary>
- Deliver the <see cref="T:log4net.Core.LoggingEvent"/> to the attached appenders.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Call the appenders in the hierarchy starting at
- <c>this</c>. If no appenders could be found, emit a
- warning.
- </para>
- <para>
- This method calls all the appenders inherited from the
- hierarchy circumventing any evaluation of whether to log or not
- to log the particular log request.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.CloseNestedAppenders">
- <summary>
- Closes all attached appenders implementing the <see cref="T:log4net.Core.IAppenderAttachable"/> interface.
- </summary>
- <remarks>
- <para>
- Used to ensure that the appenders are correctly shutdown.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.Log(log4net.Core.Level,System.Object,System.Exception)">
- <summary>
- This is the most generic printing method. This generic form is intended to be used by wrappers
- </summary>
- <param name="level">The level of the message to be logged.</param>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Generate a logging event for the specified <paramref name="level"/> using
- the <paramref name="message"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.ForcedLog(System.Type,log4net.Core.Level,System.Object,System.Exception)">
- <summary>
- Creates a new logging event and logs the event without further checks.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="level">The level of the message to be logged.</param>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Generates a logging event and delivers it to the attached
- appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.ForcedLog(log4net.Core.LoggingEvent)">
- <summary>
- Creates a new logging event and logs the event without further checks.
- </summary>
- <param name="logEvent">The event being logged.</param>
- <remarks>
- <para>
- Delivers the logging event to the attached appenders.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.ThisDeclaringType">
- <summary>
- The fully qualified type of the Logger class.
- </summary>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_name">
- <summary>
- The name of this logger.
- </summary>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_level">
- <summary>
- The assigned level of this logger.
- </summary>
- <remarks>
- <para>
- The <c>level</c> variable need not be
- assigned a value in which case it is inherited
- form the hierarchy.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_parent">
- <summary>
- The parent of this logger.
- </summary>
- <remarks>
- <para>
- The parent of this logger.
- All loggers have at least one ancestor which is the root logger.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_hierarchy">
- <summary>
- Loggers need to know what Hierarchy they are in.
- </summary>
- <remarks>
- <para>
- Loggers need to know what Hierarchy they are in.
- The hierarchy that this logger is a member of is stored
- here.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_appenderAttachedImpl">
- <summary>
- Helper implementation of the <see cref="T:log4net.Core.IAppenderAttachable"/> interface
- </summary>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_additive">
- <summary>
- Flag indicating if child loggers inherit their parents appenders
- </summary>
- <remarks>
- <para>
- Additivity is set to true by default, that is children inherit
- the appenders of their ancestors by default. If this variable is
- set to <c>false</c> then the appenders found in the
- ancestors of this logger are not used. However, the children
- of this logger will inherit its appenders, unless the children
- have their additivity flag set to <c>false</c> too. See
- the user manual for more details.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_appenderLock">
- <summary>
- Lock to protect AppenderAttachedImpl variable m_appenderAttachedImpl
- </summary>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Parent">
- <summary>
- Gets or sets the parent logger in the hierarchy.
- </summary>
- <value>
- The parent logger in the hierarchy.
- </value>
- <remarks>
- <para>
- Part of the Composite pattern that makes the hierarchy.
- The hierarchy is parent linked rather than child linked.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Additivity">
- <summary>
- Gets or sets a value indicating if child loggers inherit their parent's appenders.
- </summary>
- <value>
- <c>true</c> if child loggers inherit their parent's appenders.
- </value>
- <remarks>
- <para>
- Additivity is set to <c>true</c> by default, that is children inherit
- the appenders of their ancestors by default. If this variable is
- set to <c>false</c> then the appenders found in the
- ancestors of this logger are not used. However, the children
- of this logger will inherit its appenders, unless the children
- have their additivity flag set to <c>false</c> too. See
- the user manual for more details.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.EffectiveLevel">
- <summary>
- Gets the effective level for this logger.
- </summary>
- <returns>The nearest level in the logger hierarchy.</returns>
- <remarks>
- <para>
- Starting from this logger, searches the logger hierarchy for a
- non-null level and returns it. Otherwise, returns the level of the
- root logger.
- </para>
- <para>The Logger class is designed so that this method executes as
- quickly as possible.</para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Hierarchy">
- <summary>
- Gets or sets the <see cref="P:log4net.Repository.Hierarchy.Logger.Hierarchy"/> where this
- <c>Logger</c> instance is attached to.
- </summary>
- <value>The hierarchy that this logger belongs to.</value>
- <remarks>
- <para>
- This logger must be attached to a single <see cref="P:log4net.Repository.Hierarchy.Logger.Hierarchy"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Level">
- <summary>
- Gets or sets the assigned <see cref="P:log4net.Repository.Hierarchy.Logger.Level"/>, if any, for this Logger.
- </summary>
- <value>
- The <see cref="P:log4net.Repository.Hierarchy.Logger.Level"/> of this logger.
- </value>
- <remarks>
- <para>
- The assigned <see cref="P:log4net.Repository.Hierarchy.Logger.Level"/> can be <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Appenders">
- <summary>
- Get the appenders contained in this logger as an
- <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <returns>A collection of the appenders in this logger</returns>
- <remarks>
- <para>
- Get the appenders contained in this logger as an
- <see cref="T:System.Collections.ICollection"/>. If no appenders
- can be found, then a <see cref="T:log4net.Util.EmptyCollection"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Name">
- <summary>
- Gets the logger name.
- </summary>
- <value>
- The name of the logger.
- </value>
- <remarks>
- <para>
- The name of this logger
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Repository">
- <summary>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> where this
- <c>Logger</c> instance is attached to.
- </summary>
- <value>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that this logger belongs to.
- </value>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> where this
- <c>Logger</c> instance is attached to.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.DefaultLoggerFactory.LoggerImpl.#ctor(System.String)">
- <summary>
- Construct a new Logger
- </summary>
- <param name="name">the name of the logger</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.DefaultLoggerFactory.LoggerImpl"/> class
- with the specified name.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.LoggerCreationEventHandler">
- <summary>
- Delegate used to handle logger creation event notifications.
- </summary>
- <param name="sender">The <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> in which the <see cref="T:log4net.Repository.Hierarchy.Logger"/> has been created.</param>
- <param name="e">The <see cref="T:log4net.Repository.Hierarchy.LoggerCreationEventArgs"/> event args that hold the <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance that has been created.</param>
- <remarks>
- <para>
- Delegate used to handle logger creation event notifications.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.LoggerCreationEventArgs">
- <summary>
- Provides data for the <see cref="E:log4net.Repository.Hierarchy.Hierarchy.LoggerCreatedEvent"/> event.
- </summary>
- <remarks>
- <para>
- A <see cref="E:log4net.Repository.Hierarchy.Hierarchy.LoggerCreatedEvent"/> event is raised every time a
- <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> is created.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.LoggerCreationEventArgs.m_log">
- <summary>
- The <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> created
- </summary>
- </member>
- <member name="M:log4net.Repository.Hierarchy.LoggerCreationEventArgs.#ctor(log4net.Repository.Hierarchy.Logger)">
- <summary>
- Constructor
- </summary>
- <param name="log">The <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> that has been created.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.LoggerCreationEventArgs"/> event argument
- class,with the specified <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger">
- <summary>
- Gets the <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> that has been created.
- </summary>
- <value>
- The <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> that has been created.
- </value>
- <remarks>
- <para>
- The <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> that has been created.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.Hierarchy">
- <summary>
- Hierarchical organization of loggers
- </summary>
- <remarks>
- <para>
- <i>The casual user should not have to deal with this class
- directly.</i>
- </para>
- <para>
- This class is specialized in retrieving loggers by name and
- also maintaining the logger hierarchy. Implements the
- <see cref="T:log4net.Repository.ILoggerRepository"/> interface.
- </para>
- <para>
- The structure of the logger hierarchy is maintained by the
- <see cref="M:log4net.Repository.Hierarchy.Hierarchy.GetLogger(System.String)"/> method. The hierarchy is such that children
- link to their parent but parents do not have any references to their
- children. Moreover, loggers can be instantiated in any order, in
- particular descendant before ancestor.
- </para>
- <para>
- In case a descendant is created before a particular ancestor,
- then it creates a provision node for the ancestor and adds itself
- to the provision node. Other descendants of the same ancestor add
- themselves to the previously created provision node.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Repository.LoggerRepositorySkeleton">
- <summary>
- Base implementation of <see cref="T:log4net.Repository.ILoggerRepository"/>
- </summary>
- <remarks>
- <para>
- Default abstract implementation of the <see cref="T:log4net.Repository.ILoggerRepository"/> interface.
- </para>
- <para>
- Skeleton implementation of the <see cref="T:log4net.Repository.ILoggerRepository"/> interface.
- All <see cref="T:log4net.Repository.ILoggerRepository"/> types can extend this type.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Repository.ILoggerRepository">
- <summary>
- Interface implemented by logger repositories.
- </summary>
- <remarks>
- <para>
- This interface is implemented by logger repositories. e.g.
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.
- </para>
- <para>
- This interface is used by the <see cref="T:log4net.LogManager"/>
- to obtain <see cref="T:log4net.ILog"/> interfaces.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.Exists(System.String)">
- <summary>
- Check if the named logger exists in the repository. If so return
- its reference, otherwise returns <c>null</c>.
- </summary>
- <param name="name">The name of the logger to lookup</param>
- <returns>The Logger object with the name specified</returns>
- <remarks>
- <para>
- If the names logger exists it is returned, otherwise
- <c>null</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.GetCurrentLoggers">
- <summary>
- Returns all the currently defined loggers as an Array.
- </summary>
- <returns>All the defined loggers</returns>
- <remarks>
- <para>
- Returns all the currently defined loggers as an Array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.GetLogger(System.String)">
- <summary>
- Returns a named logger instance
- </summary>
- <param name="name">The name of the logger to retrieve</param>
- <returns>The logger object with the name specified</returns>
- <remarks>
- <para>
- Returns a named logger instance.
- </para>
- <para>
- If a logger of that name already exists, then it will be
- returned. Otherwise, a new logger will be instantiated and
- then linked with its existing ancestors as well as children.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.Shutdown">
- <summary>Shutdown the repository</summary>
- <remarks>
- <para>
- Shutting down a repository will <i>safely</i> close and remove
- all appenders in all loggers including the root logger.
- </para>
- <para>
- Some appenders need to be closed before the
- application exists. Otherwise, pending logging events might be
- lost.
- </para>
- <para>
- The <see cref="M:log4net.Repository.ILoggerRepository.Shutdown"/> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.ResetConfiguration">
- <summary>
- Reset the repositories configuration to a default state
- </summary>
- <remarks>
- <para>
- Reset all values contained in this instance to their
- default state.
- </para>
- <para>
- Existing loggers are not removed. They are just reset.
- </para>
- <para>
- This method should be used sparingly and with care as it will
- block all logging until it is completed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.Log(log4net.Core.LoggingEvent)">
- <summary>
- Log the <see cref="T:log4net.Core.LoggingEvent"/> through this repository.
- </summary>
- <param name="logEvent">the event to log</param>
- <remarks>
- <para>
- This method should not normally be used to log.
- The <see cref="T:log4net.ILog"/> interface should be used
- for routine logging. This interface can be obtained
- using the <see cref="M:log4net.LogManager.GetLogger(System.String)"/> method.
- </para>
- <para>
- The <c>logEvent</c> is delivered to the appropriate logger and
- that logger is then responsible for logging the event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.GetAppenders">
- <summary>
- Returns all the Appenders that are configured as an Array.
- </summary>
- <returns>All the Appenders</returns>
- <remarks>
- <para>
- Returns all the Appenders that are configured as an Array.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.Name">
- <summary>
- The name of the repository
- </summary>
- <value>
- The name of the repository
- </value>
- <remarks>
- <para>
- The name of the repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.RendererMap">
- <summary>
- RendererMap accesses the object renderer map for this repository.
- </summary>
- <value>
- RendererMap accesses the object renderer map for this repository.
- </value>
- <remarks>
- <para>
- RendererMap accesses the object renderer map for this repository.
- </para>
- <para>
- The RendererMap holds a mapping between types and
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/> objects.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.PluginMap">
- <summary>
- The plugin map for this repository.
- </summary>
- <value>
- The plugin map for this repository.
- </value>
- <remarks>
- <para>
- The plugin map holds the <see cref="T:log4net.Plugin.IPlugin"/> instances
- that have been attached to this repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.LevelMap">
- <summary>
- Get the level map for the Repository.
- </summary>
- <remarks>
- <para>
- Get the level map for the Repository.
- </para>
- <para>
- The level map defines the mappings between
- level names and <see cref="T:log4net.Core.Level"/> objects in
- this repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.Threshold">
- <summary>
- The threshold for all events in this repository
- </summary>
- <value>
- The threshold for all events in this repository
- </value>
- <remarks>
- <para>
- The threshold for all events in this repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.Configured">
- <summary>
- Flag indicates if this repository has been configured.
- </summary>
- <value>
- Flag indicates if this repository has been configured.
- </value>
- <remarks>
- <para>
- Flag indicates if this repository has been configured.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.ILoggerRepository.ShutdownEvent">
- <summary>
- Event to notify that the repository has been shutdown.
- </summary>
- <value>
- Event to notify that the repository has been shutdown.
- </value>
- <remarks>
- <para>
- Event raised when the repository has been shutdown.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.ILoggerRepository.ConfigurationReset">
- <summary>
- Event to notify that the repository has had its configuration reset.
- </summary>
- <value>
- Event to notify that the repository has had its configuration reset.
- </value>
- <remarks>
- <para>
- Event raised when the repository's configuration has been
- reset to default.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.ILoggerRepository.ConfigurationChanged">
- <summary>
- Event to notify that the repository has had its configuration changed.
- </summary>
- <value>
- Event to notify that the repository has had its configuration changed.
- </value>
- <remarks>
- <para>
- Event raised when the repository's configuration has been changed.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.Properties">
- <summary>
- Repository specific properties
- </summary>
- <value>
- Repository specific properties
- </value>
- <remarks>
- <para>
- These properties can be specified on a repository specific basis.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.#ctor">
- <summary>
- Default Constructor
- </summary>
- <remarks>
- <para>
- Initializes the repository with default (empty) properties.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.#ctor(log4net.Util.PropertiesDictionary)">
- <summary>
- Construct the repository using specific properties
- </summary>
- <param name="properties">the properties to set for this repository</param>
- <remarks>
- <para>
- Initializes the repository with specified properties.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.Exists(System.String)">
- <summary>
- Test if logger exists
- </summary>
- <param name="name">The name of the logger to lookup</param>
- <returns>The Logger object with the name specified</returns>
- <remarks>
- <para>
- Check if the named logger exists in the repository. If so return
- its reference, otherwise returns <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.GetCurrentLoggers">
- <summary>
- Returns all the currently defined loggers in the repository
- </summary>
- <returns>All the defined loggers</returns>
- <remarks>
- <para>
- Returns all the currently defined loggers in the repository as an Array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.GetLogger(System.String)">
- <summary>
- Return a new logger instance
- </summary>
- <param name="name">The name of the logger to retrieve</param>
- <returns>The logger object with the name specified</returns>
- <remarks>
- <para>
- Return a new logger instance.
- </para>
- <para>
- If a logger of that name already exists, then it will be
- returned. Otherwise, a new logger will be instantiated and
- then linked with its existing ancestors as well as children.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.Shutdown">
- <summary>
- Shutdown the repository
- </summary>
- <remarks>
- <para>
- Shutdown the repository. Can be overridden in a subclass.
- This base class implementation notifies the <see cref="E:log4net.Repository.LoggerRepositorySkeleton.ShutdownEvent"/>
- listeners and all attached plugins of the shutdown event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.ResetConfiguration">
- <summary>
- Reset the repositories configuration to a default state
- </summary>
- <remarks>
- <para>
- Reset all values contained in this instance to their
- default state.
- </para>
- <para>
- Existing loggers are not removed. They are just reset.
- </para>
- <para>
- This method should be used sparingly and with care as it will
- block all logging until it is completed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.Log(log4net.Core.LoggingEvent)">
- <summary>
- Log the logEvent through this repository.
- </summary>
- <param name="logEvent">the event to log</param>
- <remarks>
- <para>
- This method should not normally be used to log.
- The <see cref="T:log4net.ILog"/> interface should be used
- for routine logging. This interface can be obtained
- using the <see cref="M:log4net.LogManager.GetLogger(System.String)"/> method.
- </para>
- <para>
- The <c>logEvent</c> is delivered to the appropriate logger and
- that logger is then responsible for logging the event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.GetAppenders">
- <summary>
- Returns all the Appenders that are configured as an Array.
- </summary>
- <returns>All the Appenders</returns>
- <remarks>
- <para>
- Returns all the Appenders that are configured as an Array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.AddRenderer(System.Type,log4net.ObjectRenderer.IObjectRenderer)">
- <summary>
- Adds an object renderer for a specific class.
- </summary>
- <param name="typeToRender">The type that will be rendered by the renderer supplied.</param>
- <param name="rendererInstance">The object renderer used to render the object.</param>
- <remarks>
- <para>
- Adds an object renderer for a specific class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.OnShutdown(System.EventArgs)">
- <summary>
- Notify the registered listeners that the repository is shutting down
- </summary>
- <param name="e">Empty EventArgs</param>
- <remarks>
- <para>
- Notify any listeners that this repository is shutting down.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.OnConfigurationReset(System.EventArgs)">
- <summary>
- Notify the registered listeners that the repository has had its configuration reset
- </summary>
- <param name="e">Empty EventArgs</param>
- <remarks>
- <para>
- Notify any listeners that this repository's configuration has been reset.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.OnConfigurationChanged(System.EventArgs)">
- <summary>
- Notify the registered listeners that the repository has had its configuration changed
- </summary>
- <param name="e">Empty EventArgs</param>
- <remarks>
- <para>
- Notify any listeners that this repository's configuration has changed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.RaiseConfigurationChanged(System.EventArgs)">
- <summary>
- Raise a configuration changed event on this repository
- </summary>
- <param name="e">EventArgs.Empty</param>
- <remarks>
- <para>
- Applications that programmatically change the configuration of the repository should
- raise this event notification to notify listeners.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.Name">
- <summary>
- The name of the repository
- </summary>
- <value>
- The string name of the repository
- </value>
- <remarks>
- <para>
- The name of this repository. The name is
- used to store and lookup the repositories
- stored by the <see cref="T:log4net.Core.IRepositorySelector"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.Threshold">
- <summary>
- The threshold for all events in this repository
- </summary>
- <value>
- The threshold for all events in this repository
- </value>
- <remarks>
- <para>
- The threshold for all events in this repository
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.RendererMap">
- <summary>
- RendererMap accesses the object renderer map for this repository.
- </summary>
- <value>
- RendererMap accesses the object renderer map for this repository.
- </value>
- <remarks>
- <para>
- RendererMap accesses the object renderer map for this repository.
- </para>
- <para>
- The RendererMap holds a mapping between types and
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/> objects.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.PluginMap">
- <summary>
- The plugin map for this repository.
- </summary>
- <value>
- The plugin map for this repository.
- </value>
- <remarks>
- <para>
- The plugin map holds the <see cref="T:log4net.Plugin.IPlugin"/> instances
- that have been attached to this repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.LevelMap">
- <summary>
- Get the level map for the Repository.
- </summary>
- <remarks>
- <para>
- Get the level map for the Repository.
- </para>
- <para>
- The level map defines the mappings between
- level names and <see cref="T:log4net.Core.Level"/> objects in
- this repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.Configured">
- <summary>
- Flag indicates if this repository has been configured.
- </summary>
- <value>
- Flag indicates if this repository has been configured.
- </value>
- <remarks>
- <para>
- Flag indicates if this repository has been configured.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.LoggerRepositorySkeleton.ShutdownEvent">
- <summary>
- Event to notify that the repository has been shutdown.
- </summary>
- <value>
- Event to notify that the repository has been shutdown.
- </value>
- <remarks>
- <para>
- Event raised when the repository has been shutdown.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.LoggerRepositorySkeleton.ConfigurationReset">
- <summary>
- Event to notify that the repository has had its configuration reset.
- </summary>
- <value>
- Event to notify that the repository has had its configuration reset.
- </value>
- <remarks>
- <para>
- Event raised when the repository's configuration has been
- reset to default.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.LoggerRepositorySkeleton.ConfigurationChanged">
- <summary>
- Event to notify that the repository has had its configuration changed.
- </summary>
- <value>
- Event to notify that the repository has had its configuration changed.
- </value>
- <remarks>
- <para>
- Event raised when the repository's configuration has been changed.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.Properties">
- <summary>
- Repository specific properties
- </summary>
- <value>
- Repository specific properties
- </value>
- <remarks>
- These properties can be specified on a repository specific basis
- </remarks>
- </member>
- <member name="T:log4net.Repository.IBasicRepositoryConfigurator">
- <summary>
- Basic Configurator interface for repositories
- </summary>
- <remarks>
- <para>
- Interface used by basic configurator to configure a <see cref="T:log4net.Repository.ILoggerRepository"/>
- with a default <see cref="T:log4net.Appender.IAppender"/>.
- </para>
- <para>
- A <see cref="T:log4net.Repository.ILoggerRepository"/> should implement this interface to support
- configuration by the <see cref="T:log4net.Config.BasicConfigurator"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.IBasicRepositoryConfigurator.Configure(log4net.Appender.IAppender)">
- <summary>
- Initialize the repository using the specified appender
- </summary>
- <param name="appender">the appender to use to log all logging events</param>
- <remarks>
- <para>
- Configure the repository to route all logging events to the
- specified appender.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.IXmlRepositoryConfigurator">
- <summary>
- Configure repository using XML
- </summary>
- <remarks>
- <para>
- Interface used by Xml configurator to configure a <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </para>
- <para>
- A <see cref="T:log4net.Repository.ILoggerRepository"/> should implement this interface to support
- configuration by the <see cref="T:log4net.Config.XmlConfigurator"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.IXmlRepositoryConfigurator.Configure(System.Xml.XmlElement)">
- <summary>
- Initialize the repository using the specified config
- </summary>
- <param name="element">the element containing the root of the config</param>
- <remarks>
- <para>
- The schema for the XML configuration data is defined by
- the implementation.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.#ctor(log4net.Util.PropertiesDictionary)">
- <summary>
- Construct with properties
- </summary>
- <param name="properties">The properties to pass to this repository.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.#ctor(log4net.Repository.Hierarchy.ILoggerFactory)">
- <summary>
- Construct with a logger factory
- </summary>
- <param name="loggerFactory">The factory to use to create new logger instances.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> class with
- the specified <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.#ctor(log4net.Util.PropertiesDictionary,log4net.Repository.Hierarchy.ILoggerFactory)">
- <summary>
- Construct with properties and a logger factory
- </summary>
- <param name="properties">The properties to pass to this repository.</param>
- <param name="loggerFactory">The factory to use to create new logger instances.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> class with
- the specified <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.Exists(System.String)">
- <summary>
- Test if a logger exists
- </summary>
- <param name="name">The name of the logger to lookup</param>
- <returns>The Logger object with the name specified</returns>
- <remarks>
- <para>
- Check if the named logger exists in the hierarchy. If so return
- its reference, otherwise returns <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.GetCurrentLoggers">
- <summary>
- Returns all the currently defined loggers in the hierarchy as an Array
- </summary>
- <returns>All the defined loggers</returns>
- <remarks>
- <para>
- Returns all the currently defined loggers in the hierarchy as an Array.
- The root logger is <b>not</b> included in the returned
- enumeration.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.GetLogger(System.String)">
- <summary>
- Return a new logger instance named as the first parameter using
- the default factory.
- </summary>
- <remarks>
- <para>
- Return a new logger instance named as the first parameter using
- the default factory.
- </para>
- <para>
- If a logger of that name already exists, then it will be
- returned. Otherwise, a new logger will be instantiated and
- then linked with its existing ancestors as well as children.
- </para>
- </remarks>
- <param name="name">The name of the logger to retrieve</param>
- <returns>The logger object with the name specified</returns>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.Shutdown">
- <summary>
- Shutting down a hierarchy will <i>safely</i> close and remove
- all appenders in all loggers including the root logger.
- </summary>
- <remarks>
- <para>
- Shutting down a hierarchy will <i>safely</i> close and remove
- all appenders in all loggers including the root logger.
- </para>
- <para>
- Some appenders need to be closed before the
- application exists. Otherwise, pending logging events might be
- lost.
- </para>
- <para>
- The <c>Shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.ResetConfiguration">
- <summary>
- Reset all values contained in this hierarchy instance to their default.
- </summary>
- <remarks>
- <para>
- Reset all values contained in this hierarchy instance to their
- default. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set its default "off" value.
- </para>
- <para>
- Existing loggers are not removed. They are just reset.
- </para>
- <para>
- This method should be used sparingly and with care as it will
- block all logging until it is completed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.Log(log4net.Core.LoggingEvent)">
- <summary>
- Log the logEvent through this hierarchy.
- </summary>
- <param name="logEvent">the event to log</param>
- <remarks>
- <para>
- This method should not normally be used to log.
- The <see cref="T:log4net.ILog"/> interface should be used
- for routine logging. This interface can be obtained
- using the <see cref="M:log4net.LogManager.GetLogger(System.String)"/> method.
- </para>
- <para>
- The <c>logEvent</c> is delivered to the appropriate logger and
- that logger is then responsible for logging the event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.GetAppenders">
- <summary>
- Returns all the Appenders that are currently configured
- </summary>
- <returns>An array containing all the currently configured appenders</returns>
- <remarks>
- <para>
- Returns all the <see cref="T:log4net.Appender.IAppender"/> instances that are currently configured.
- All the loggers are searched for appenders. The appenders may also be containers
- for appenders and these are also searched for additional loggers.
- </para>
- <para>
- The list returned is unordered but does not contain duplicates.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.CollectAppender(System.Collections.ArrayList,log4net.Appender.IAppender)">
- <summary>
- Collect the appenders from an <see cref="T:log4net.Core.IAppenderAttachable"/>.
- The appender may also be a container.
- </summary>
- <param name="appenderList"></param>
- <param name="appender"></param>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.CollectAppenders(System.Collections.ArrayList,log4net.Core.IAppenderAttachable)">
- <summary>
- Collect the appenders from an <see cref="T:log4net.Core.IAppenderAttachable"/> container
- </summary>
- <param name="appenderList"></param>
- <param name="container"></param>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.log4net#Repository#IBasicRepositoryConfigurator#Configure(log4net.Appender.IAppender)">
- <summary>
- Initialize the log4net system using the specified appender
- </summary>
- <param name="appender">the appender to use to log all logging events</param>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.BasicRepositoryConfigure(log4net.Appender.IAppender)">
- <summary>
- Initialize the log4net system using the specified appender
- </summary>
- <param name="appender">the appender to use to log all logging events</param>
- <remarks>
- <para>
- This method provides the same functionality as the
- <see cref="M:log4net.Repository.IBasicRepositoryConfigurator.Configure(log4net.Appender.IAppender)"/> method implemented
- on this object, but it is protected and therefore can be called by subclasses.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.log4net#Repository#IXmlRepositoryConfigurator#Configure(System.Xml.XmlElement)">
- <summary>
- Initialize the log4net system using the specified config
- </summary>
- <param name="element">the element containing the root of the config</param>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.XmlRepositoryConfigure(System.Xml.XmlElement)">
- <summary>
- Initialize the log4net system using the specified config
- </summary>
- <param name="element">the element containing the root of the config</param>
- <remarks>
- <para>
- This method provides the same functionality as the
- <see cref="M:log4net.Repository.IBasicRepositoryConfigurator.Configure(log4net.Appender.IAppender)"/> method implemented
- on this object, but it is protected and therefore can be called by subclasses.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.IsDisabled(log4net.Core.Level)">
- <summary>
- Test if this hierarchy is disabled for the specified <see cref="T:log4net.Core.Level"/>.
- </summary>
- <param name="level">The level to check against.</param>
- <returns>
- <c>true</c> if the repository is disabled for the level argument, <c>false</c> otherwise.
- </returns>
- <remarks>
- <para>
- If this hierarchy has not been configured then this method will
- always return <c>true</c>.
- </para>
- <para>
- This method will return <c>true</c> if this repository is
- disabled for <c>level</c> object passed as parameter and
- <c>false</c> otherwise.
- </para>
- <para>
- See also the <see cref="P:log4net.Repository.ILoggerRepository.Threshold"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.Clear">
- <summary>
- Clear all logger definitions from the internal hashtable
- </summary>
- <remarks>
- <para>
- This call will clear all logger definitions from the internal
- hashtable. Invoking this method will irrevocably mess up the
- logger hierarchy.
- </para>
- <para>
- You should <b>really</b> know what you are doing before
- invoking this method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.GetLogger(System.String,log4net.Repository.Hierarchy.ILoggerFactory)">
- <summary>
- Return a new logger instance named as the first parameter using
- <paramref name="factory"/>.
- </summary>
- <param name="name">The name of the logger to retrieve</param>
- <param name="factory">The factory that will make the new logger instance</param>
- <returns>The logger object with the name specified</returns>
- <remarks>
- <para>
- If a logger of that name already exists, then it will be
- returned. Otherwise, a new logger will be instantiated by the
- <paramref name="factory"/> parameter and linked with its existing
- ancestors as well as children.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.OnLoggerCreationEvent(log4net.Repository.Hierarchy.Logger)">
- <summary>
- Sends a logger creation event to all registered listeners
- </summary>
- <param name="logger">The newly created logger</param>
- <remarks>
- Raises the logger creation event.
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.UpdateParents(log4net.Repository.Hierarchy.Logger)">
- <summary>
- Updates all the parents of the specified logger
- </summary>
- <param name="log">The logger to update the parents for</param>
- <remarks>
- <para>
- This method loops through all the <i>potential</i> parents of
- <paramref name="log"/>. There 3 possible cases:
- </para>
- <list type="number">
- <item>
- <term>No entry for the potential parent of <paramref name="log"/> exists</term>
- <description>
- We create a ProvisionNode for this potential
- parent and insert <paramref name="log"/> in that provision node.
- </description>
- </item>
- <item>
- <term>The entry is of type Logger for the potential parent.</term>
- <description>
- The entry is <paramref name="log"/>'s nearest existing parent. We
- update <paramref name="log"/>'s parent field with this entry. We also break from
- he loop because updating our parent's parent is our parent's
- responsibility.
- </description>
- </item>
- <item>
- <term>The entry is of type ProvisionNode for this potential parent.</term>
- <description>
- We add <paramref name="log"/> to the list of children for this
- potential parent.
- </description>
- </item>
- </list>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.UpdateChildren(log4net.Repository.Hierarchy.ProvisionNode,log4net.Repository.Hierarchy.Logger)">
- <summary>
- Replace a <see cref="T:log4net.Repository.Hierarchy.ProvisionNode"/> with a <see cref="T:log4net.Repository.Hierarchy.Logger"/> in the hierarchy.
- </summary>
- <param name="pn"></param>
- <param name="log"></param>
- <remarks>
- <para>
- We update the links for all the children that placed themselves
- in the provision node 'pn'. The second argument 'log' is a
- reference for the newly created Logger, parent of all the
- children in 'pn'.
- </para>
- <para>
- We loop on all the children 'c' in 'pn'.
- </para>
- <para>
- If the child 'c' has been already linked to a child of
- 'log' then there is no need to update 'c'.
- </para>
- <para>
- Otherwise, we set log's parent field to c's parent and set
- c's parent field to log.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.AddLevel(log4net.Repository.Hierarchy.Hierarchy.LevelEntry)">
- <summary>
- Define or redefine a Level using the values in the <see cref="T:log4net.Repository.Hierarchy.Hierarchy.LevelEntry"/> argument
- </summary>
- <param name="levelEntry">the level values</param>
- <remarks>
- <para>
- Define or redefine a Level using the values in the <see cref="T:log4net.Repository.Hierarchy.Hierarchy.LevelEntry"/> argument
- </para>
- <para>
- Supports setting levels via the configuration file.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.AddProperty(log4net.Repository.Hierarchy.Hierarchy.PropertyEntry)">
- <summary>
- Set a Property using the values in the <see cref="T:log4net.Repository.Hierarchy.Hierarchy.LevelEntry"/> argument
- </summary>
- <param name="propertyEntry">the property value</param>
- <remarks>
- <para>
- Set a Property using the values in the <see cref="T:log4net.Repository.Hierarchy.Hierarchy.LevelEntry"/> argument.
- </para>
- <para>
- Supports setting property values via the configuration file.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.Hierarchy.Hierarchy.LoggerCreatedEvent">
- <summary>
- Event used to notify that a logger has been created.
- </summary>
- <remarks>
- <para>
- Event raised when a logger is created.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.EmittedNoAppenderWarning">
- <summary>
- Has no appender warning been emitted
- </summary>
- <remarks>
- <para>
- Flag to indicate if we have already issued a warning
- about not having an appender warning.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.Root">
- <summary>
- Get the root of this hierarchy
- </summary>
- <remarks>
- <para>
- Get the root of this hierarchy.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.LoggerFactory">
- <summary>
- Gets or sets the default <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/> instance.
- </summary>
- <value>The default <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/></value>
- <remarks>
- <para>
- The logger factory is used to create logger instances.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.Hierarchy.LevelEntry">
- <summary>
- A class to hold the value, name and display name for a level
- </summary>
- <remarks>
- <para>
- A class to hold the value, name and display name for a level
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.LevelEntry.ToString">
- <summary>
- Override <c>Object.ToString</c> to return sensible debug info
- </summary>
- <returns>string info about this object</returns>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.LevelEntry.Value">
- <summary>
- Value of the level
- </summary>
- <remarks>
- <para>
- If the value is not set (defaults to -1) the value will be looked
- up for the current level with the same name.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.LevelEntry.Name">
- <summary>
- Name of the level
- </summary>
- <value>
- The name of the level
- </value>
- <remarks>
- <para>
- The name of the level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.LevelEntry.DisplayName">
- <summary>
- Display name for the level
- </summary>
- <value>
- The display name of the level
- </value>
- <remarks>
- <para>
- The display name of the level.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.Hierarchy.PropertyEntry">
- <summary>
- A class to hold the key and data for a property set in the config file
- </summary>
- <remarks>
- <para>
- A class to hold the key and data for a property set in the config file
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.PropertyEntry.ToString">
- <summary>
- Override <c>Object.ToString</c> to return sensible debug info
- </summary>
- <returns>string info about this object</returns>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.PropertyEntry.Key">
- <summary>
- Property Key
- </summary>
- <value>
- Property Key
- </value>
- <remarks>
- <para>
- Property Key.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.PropertyEntry.Value">
- <summary>
- Property Value
- </summary>
- <value>
- Property Value
- </value>
- <remarks>
- <para>
- Property Value.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.LoggerKey">
- <summary>
- Used internally to accelerate hash table searches.
- </summary>
- <remarks>
- <para>
- Internal class used to improve performance of
- string keyed hashtables.
- </para>
- <para>
- The hashcode of the string is cached for reuse.
- The string is stored as an interned value.
- When comparing two <see cref="T:log4net.Repository.Hierarchy.LoggerKey"/> objects for equality
- the reference equality of the interned strings is compared.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.LoggerKey.#ctor(System.String)">
- <summary>
- Construct key with string name
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.LoggerKey"/> class
- with the specified name.
- </para>
- <para>
- Stores the hashcode of the string and interns
- the string key to optimize comparisons.
- </para>
- <note>
- The Compact Framework 1.0 the <see cref="M:System.String.Intern(System.String)"/>
- method does not work. On the Compact Framework
- the string keys are not interned nor are they
- compared by reference.
- </note>
- </remarks>
- <param name="name">The name of the logger.</param>
- </member>
- <member name="M:log4net.Repository.Hierarchy.LoggerKey.GetHashCode">
- <summary>
- Returns a hash code for the current instance.
- </summary>
- <returns>A hash code for the current instance.</returns>
- <remarks>
- <para>
- Returns the cached hashcode.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.LoggerKey.Equals(System.Object)">
- <summary>
- Determines whether two <see cref="T:log4net.Repository.Hierarchy.LoggerKey"/> instances
- are equal.
- </summary>
- <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:log4net.Repository.Hierarchy.LoggerKey"/>.</param>
- <returns>
- <c>true</c> if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:log4net.Repository.Hierarchy.LoggerKey"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares the references of the interned strings.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.ProvisionNode">
- <summary>
- Provision nodes are used where no logger instance has been specified
- </summary>
- <remarks>
- <para>
- <see cref="T:log4net.Repository.Hierarchy.ProvisionNode"/> instances are used in the
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> when there is no specified
- <see cref="T:log4net.Repository.Hierarchy.Logger"/> for that node.
- </para>
- <para>
- A provision node holds a list of child loggers on behalf of
- a logger that does not exist.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.ProvisionNode.#ctor(log4net.Repository.Hierarchy.Logger)">
- <summary>
- Create a new provision node with child node
- </summary>
- <param name="log">A child logger to add to this node.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.ProvisionNode"/> class
- with the specified child logger.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.RootLogger">
- <summary>
- The <see cref="T:log4net.Repository.Hierarchy.RootLogger"/> sits at the root of the logger hierarchy tree.
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.Hierarchy.RootLogger"/> is a regular <see cref="T:log4net.Repository.Hierarchy.Logger"/> except
- that it provides several guarantees.
- </para>
- <para>
- First, it cannot be assigned a <c>null</c>
- level. Second, since the root logger cannot have a parent, the
- <see cref="P:log4net.Repository.Hierarchy.RootLogger.EffectiveLevel"/> property always returns the value of the
- level field without walking the hierarchy.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.RootLogger.#ctor(log4net.Core.Level)">
- <summary>
- Construct a <see cref="T:log4net.Repository.Hierarchy.RootLogger"/>
- </summary>
- <param name="level">The level to assign to the root logger.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.RootLogger"/> class with
- the specified logging level.
- </para>
- <para>
- The root logger names itself as "root". However, the root
- logger cannot be retrieved by name.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.RootLogger.EffectiveLevel">
- <summary>
- Gets the assigned level value without walking the logger hierarchy.
- </summary>
- <value>The assigned level value without walking the logger hierarchy.</value>
- <remarks>
- <para>
- Because the root logger cannot have a parent and its level
- must not be <c>null</c> this property just returns the
- value of <see cref="P:log4net.Repository.Hierarchy.Logger.Level"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.RootLogger.Level">
- <summary>
- Gets or sets the assigned <see cref="P:log4net.Repository.Hierarchy.RootLogger.Level"/> for the root logger.
- </summary>
- <value>
- The <see cref="P:log4net.Repository.Hierarchy.RootLogger.Level"/> of the root logger.
- </value>
- <remarks>
- <para>
- Setting the level of the root logger to a <c>null</c> reference
- may have catastrophic results. We prevent this here.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.XmlHierarchyConfigurator">
- <summary>
- Initializes the log4net environment using an XML DOM.
- </summary>
- <remarks>
- <para>
- Configures a <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> using an XML DOM.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.#ctor(log4net.Repository.Hierarchy.Hierarchy)">
- <summary>
- Construct the configurator for a hierarchy
- </summary>
- <param name="hierarchy">The hierarchy to build.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.XmlHierarchyConfigurator"/> class
- with the specified <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.Configure(System.Xml.XmlElement)">
- <summary>
- Configure the hierarchy by parsing a DOM tree of XML elements.
- </summary>
- <param name="element">The root element to parse.</param>
- <remarks>
- <para>
- Configure the hierarchy by parsing a DOM tree of XML elements.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.FindAppenderByReference(System.Xml.XmlElement)">
- <summary>
- Parse appenders by IDREF.
- </summary>
- <param name="appenderRef">The appender ref element.</param>
- <returns>The instance of the appender that the ref refers to.</returns>
- <remarks>
- <para>
- Parse an XML element that represents an appender and return
- the appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(System.Xml.XmlElement)">
- <summary>
- Parses an appender element.
- </summary>
- <param name="appenderElement">The appender element.</param>
- <returns>The appender instance or <c>null</c> when parsing failed.</returns>
- <remarks>
- <para>
- Parse an XML element that represents an appender and return
- the appender instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseLogger(System.Xml.XmlElement)">
- <summary>
- Parses a logger element.
- </summary>
- <param name="loggerElement">The logger element.</param>
- <remarks>
- <para>
- Parse an XML element that represents a logger.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseRoot(System.Xml.XmlElement)">
- <summary>
- Parses the root logger element.
- </summary>
- <param name="rootElement">The root element.</param>
- <remarks>
- <para>
- Parse an XML element that represents the root logger.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseChildrenOfLoggerElement(System.Xml.XmlElement,log4net.Repository.Hierarchy.Logger,System.Boolean)">
- <summary>
- Parses the children of a logger element.
- </summary>
- <param name="catElement">The category element.</param>
- <param name="log">The logger instance.</param>
- <param name="isRoot">Flag to indicate if the logger is the root logger.</param>
- <remarks>
- <para>
- Parse the child elements of a &lt;logger&gt; element.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseRenderer(System.Xml.XmlElement)">
- <summary>
- Parses an object renderer.
- </summary>
- <param name="element">The renderer element.</param>
- <remarks>
- <para>
- Parse an XML element that represents a renderer.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseLevel(System.Xml.XmlElement,log4net.Repository.Hierarchy.Logger,System.Boolean)">
- <summary>
- Parses a level element.
- </summary>
- <param name="element">The level element.</param>
- <param name="log">The logger object to set the level on.</param>
- <param name="isRoot">Flag to indicate if the logger is the root logger.</param>
- <remarks>
- <para>
- Parse an XML element that represents a level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.SetParameter(System.Xml.XmlElement,System.Object)">
- <summary>
- Sets a parameter on an object.
- </summary>
- <param name="element">The parameter element.</param>
- <param name="target">The object to set the parameter on.</param>
- <remarks>
- The parameter name must correspond to a writable property
- on the object. The value of the parameter is a string,
- therefore this function will attempt to set a string
- property first. If unable to set a string property it
- will inspect the property and its argument type. It will
- attempt to call a static method called <c>Parse</c> on the
- type of the property. This method will take a single
- string argument and return a value that can be used to
- set the property.
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.HasAttributesOrElements(System.Xml.XmlElement)">
- <summary>
- Test if an element has no attributes or child elements
- </summary>
- <param name="element">the element to inspect</param>
- <returns><c>true</c> if the element has any attributes or child elements, <c>false</c> otherwise</returns>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.IsTypeConstructible(System.Type)">
- <summary>
- Test if a <see cref="T:System.Type"/> is constructible with <c>Activator.CreateInstance</c>.
- </summary>
- <param name="type">the type to inspect</param>
- <returns><c>true</c> if the type is creatable using a default constructor, <c>false</c> otherwise</returns>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.FindMethodInfo(System.Type,System.String)">
- <summary>
- Look for a method on the <paramref name="targetType"/> that matches the <paramref name="name"/> supplied
- </summary>
- <param name="targetType">the type that has the method</param>
- <param name="name">the name of the method</param>
- <returns>the method info found</returns>
- <remarks>
- <para>
- The method must be a public instance method on the <paramref name="targetType"/>.
- The method must be named <paramref name="name"/> or "Add" followed by <paramref name="name"/>.
- The method must take a single parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ConvertStringTo(System.Type,System.String)">
- <summary>
- Converts a string value to a target type.
- </summary>
- <param name="type">The type of object to convert the string to.</param>
- <param name="value">The string value to use as the value of the object.</param>
- <returns>
- <para>
- An object of type <paramref name="type"/> with value <paramref name="value"/> or
- <c>null</c> when the conversion could not be performed.
- </para>
- </returns>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.CreateObjectFromXml(System.Xml.XmlElement,System.Type,System.Type)">
- <summary>
- Creates an object as specified in XML.
- </summary>
- <param name="element">The XML element that contains the definition of the object.</param>
- <param name="defaultTargetType">The object type to use if not explicitly specified.</param>
- <param name="typeConstraint">The type that the returned object must be or must inherit from.</param>
- <returns>The object or <c>null</c></returns>
- <remarks>
- <para>
- Parse an XML element and create an object instance based on the configuration
- data.
- </para>
- <para>
- The type of the instance may be specified in the XML. If not
- specified then the <paramref name="defaultTargetType"/> is used
- as the type. However the type is specified it must support the
- <paramref name="typeConstraint"/> type.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.m_appenderBag">
- <summary>
- key: appenderName, value: appender.
- </summary>
- </member>
- <member name="F:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.m_hierarchy">
- <summary>
- The Hierarchy being configured.
- </summary>
- </member>
- <member name="T:log4net.Repository.LoggerRepositoryShutdownEventHandler">
- <summary>
- Delegate used to handle logger repository shutdown event notifications
- </summary>
- <param name="sender">The <see cref="T:log4net.Repository.ILoggerRepository"/> that is shutting down.</param>
- <param name="e">Empty event args</param>
- <remarks>
- <para>
- Delegate used to handle logger repository shutdown event notifications.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.LoggerRepositoryConfigurationResetEventHandler">
- <summary>
- Delegate used to handle logger repository configuration reset event notifications
- </summary>
- <param name="sender">The <see cref="T:log4net.Repository.ILoggerRepository"/> that has had its configuration reset.</param>
- <param name="e">Empty event args</param>
- <remarks>
- <para>
- Delegate used to handle logger repository configuration reset event notifications.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.LoggerRepositoryConfigurationChangedEventHandler">
- <summary>
- Delegate used to handle event notifications for logger repository configuration changes.
- </summary>
- <param name="sender">The <see cref="T:log4net.Repository.ILoggerRepository"/> that has had its configuration changed.</param>
- <param name="e">Empty event arguments.</param>
- <remarks>
- <para>
- Delegate used to handle event notifications for logger repository configuration changes.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.AppDomainPatternConverter">
- <summary>
- Write the name of the current AppDomain to the output
- </summary>
- <remarks>
- <para>
- Write the name of the current AppDomain to the output writer
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.AppDomainPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the name of the current AppDomain to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Writes name of the current AppDomain to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.DatePatternConverter">
- <summary>
- Write the current date to the output
- </summary>
- <remarks>
- <para>
- Date pattern converter, uses a <see cref="T:log4net.DateFormatter.IDateFormatter"/> to format
- the current date and time to the writer as a string.
- </para>
- <para>
- The value of the <see cref="P:log4net.Util.PatternConverter.Option"/> determines
- the formatting of the date. The following values are allowed:
- <list type="definition">
- <listheader>
- <term>Option value</term>
- <description>Output</description>
- </listheader>
- <item>
- <term>ISO8601</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/> formatter.
- Formats using the <c>"yyyy-MM-dd HH:mm:ss,fff"</c> pattern.
- </description>
- </item>
- <item>
- <term>DATE</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> formatter.
- Formats using the <c>"dd MMM yyyy HH:mm:ss,fff"</c> for example, <c>"06 Nov 1994 15:49:37,459"</c>.
- </description>
- </item>
- <item>
- <term>ABSOLUTE</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/> formatter.
- Formats using the <c>"HH:mm:ss,fff"</c> for example, <c>"15:49:37,459"</c>.
- </description>
- </item>
- <item>
- <term>other</term>
- <description>
- Any other pattern string uses the <see cref="T:log4net.DateFormatter.SimpleDateFormatter"/> formatter.
- This formatter passes the pattern string to the <see cref="T:System.DateTime"/>
- <see cref="M:System.DateTime.ToString(System.String)"/> method.
- For details on valid patterns see
- <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationdatetimeformatinfoclasstopic.asp">DateTimeFormatInfo Class</a>.
- </description>
- </item>
- </list>
- </para>
- <para>
- The date and time is in the local time zone and is rendered in that zone.
- To output the time in Universal time see <see cref="T:log4net.Util.PatternStringConverters.UtcDatePatternConverter"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.PatternStringConverters.DatePatternConverter.m_dateFormatter">
- <summary>
- The <see cref="T:log4net.DateFormatter.IDateFormatter"/> used to render the date to a string
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.DateFormatter.IDateFormatter"/> used to render the date to a string
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.DatePatternConverter.ActivateOptions">
- <summary>
- Initialize the converter options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Util.PatternStringConverters.DatePatternConverter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Util.PatternStringConverters.DatePatternConverter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Util.PatternStringConverters.DatePatternConverter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.DatePatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the current date to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Pass the current date and time to the <see cref="T:log4net.DateFormatter.IDateFormatter"/>
- for it to render it to the writer.
- </para>
- <para>
- The date and time passed is in the local time zone.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.EnvironmentPatternConverter">
- <summary>
- Write an environment variable to the output
- </summary>
- <remarks>
- <para>
- Write an environment variable to the output writer.
- The value of the <see cref="P:log4net.Util.PatternConverter.Option"/> determines
- the name of the variable to output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.EnvironmentPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write an environment variable to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Writes the environment variable to the output <paramref name="writer"/>.
- The name of the environment variable to output must be set
- using the <see cref="P:log4net.Util.PatternConverter.Option"/>
- property.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.IdentityPatternConverter">
- <summary>
- Write the current thread identity to the output
- </summary>
- <remarks>
- <para>
- Write the current thread identity to the output writer
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.IdentityPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the current thread identity to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Writes the current thread identity to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.LiteralPatternConverter">
- <summary>
- Pattern converter for literal string instances in the pattern
- </summary>
- <remarks>
- <para>
- Writes the literal string value specified in the
- <see cref="P:log4net.Util.PatternConverter.Option"/> property to
- the output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.LiteralPatternConverter.SetNext(log4net.Util.PatternConverter)">
- <summary>
- Set the next converter in the chain
- </summary>
- <param name="pc">The next pattern converter in the chain</param>
- <returns>The next pattern converter</returns>
- <remarks>
- <para>
- Special case the building of the pattern converter chain
- for <see cref="T:log4net.Util.PatternStringConverters.LiteralPatternConverter"/> instances. Two adjacent
- literals in the pattern can be represented by a single combined
- pattern converter. This implementation detects when a
- <see cref="T:log4net.Util.PatternStringConverters.LiteralPatternConverter"/> is added to the chain
- after this converter and combines its value with this converter's
- literal value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.LiteralPatternConverter.Format(System.IO.TextWriter,System.Object)">
- <summary>
- Write the literal to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, not set</param>
- <remarks>
- <para>
- Override the formatting behavior to ignore the FormattingInfo
- because we have a literal instead.
- </para>
- <para>
- Writes the value of <see cref="P:log4net.Util.PatternConverter.Option"/>
- to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.LiteralPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Convert this pattern into the rendered message
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">null, not set</param>
- <remarks>
- <para>
- This method is not used.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.NewLinePatternConverter">
- <summary>
- Writes a newline to the output
- </summary>
- <remarks>
- <para>
- Writes the system dependent line terminator to the output.
- This behavior can be overridden by setting the <see cref="P:log4net.Util.PatternConverter.Option"/>:
- </para>
- <list type="definition">
- <listheader>
- <term>Option Value</term>
- <description>Output</description>
- </listheader>
- <item>
- <term>DOS</term>
- <description>DOS or Windows line terminator <c>"\r\n"</c></description>
- </item>
- <item>
- <term>UNIX</term>
- <description>UNIX line terminator <c>"\n"</c></description>
- </item>
- </list>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.NewLinePatternConverter.ActivateOptions">
- <summary>
- Initialize the converter
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Util.PatternStringConverters.NewLinePatternConverter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Util.PatternStringConverters.NewLinePatternConverter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Util.PatternStringConverters.NewLinePatternConverter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.ProcessIdPatternConverter">
- <summary>
- Write the current process ID to the output
- </summary>
- <remarks>
- <para>
- Write the current process ID to the output writer
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.ProcessIdPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the current process ID to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Write the current process ID to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.PropertyPatternConverter">
- <summary>
- Property pattern converter
- </summary>
- <remarks>
- <para>
- This pattern converter reads the thread and global properties.
- The thread properties take priority over global properties.
- See <see cref="P:log4net.ThreadContext.Properties"/> for details of the
- thread properties. See <see cref="P:log4net.GlobalContext.Properties"/> for
- details of the global properties.
- </para>
- <para>
- If the <see cref="P:log4net.Util.PatternConverter.Option"/> is specified then that will be used to
- lookup a single property. If no <see cref="P:log4net.Util.PatternConverter.Option"/> is specified
- then all properties will be dumped as a list of key value pairs.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.PropertyPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the property value to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Writes out the value of a named property. The property name
- should be set in the <see cref="P:log4net.Util.PatternConverter.Option"/>
- property.
- </para>
- <para>
- If the <see cref="P:log4net.Util.PatternConverter.Option"/> is set to <c>null</c>
- then all the properties are written as key value pairs.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.RandomStringPatternConverter">
- <summary>
- A Pattern converter that generates a string of random characters
- </summary>
- <remarks>
- <para>
- The converter generates a string of random characters. By default
- the string is length 4. This can be changed by setting the <see cref="P:log4net.Util.PatternConverter.Option"/>
- to the string value of the length required.
- </para>
- <para>
- The random characters in the string are limited to uppercase letters
- and numbers only.
- </para>
- <para>
- The random number generator used by this class is not cryptographically secure.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.PatternStringConverters.RandomStringPatternConverter.s_random">
- <summary>
- Shared random number generator
- </summary>
- </member>
- <member name="F:log4net.Util.PatternStringConverters.RandomStringPatternConverter.m_length">
- <summary>
- Length of random string to generate. Default length 4.
- </summary>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.RandomStringPatternConverter.ActivateOptions">
- <summary>
- Initialize the converter options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Util.PatternStringConverters.RandomStringPatternConverter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Util.PatternStringConverters.RandomStringPatternConverter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Util.PatternStringConverters.RandomStringPatternConverter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.RandomStringPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write a randoim string to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Write a randoim string to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.UserNamePatternConverter">
- <summary>
- Write the current threads username to the output
- </summary>
- <remarks>
- <para>
- Write the current threads username to the output writer
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.UserNamePatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the current threads username to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Write the current threads username to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.UtcDatePatternConverter">
- <summary>
- Write the UTC date time to the output
- </summary>
- <remarks>
- <para>
- Date pattern converter, uses a <see cref="T:log4net.DateFormatter.IDateFormatter"/> to format
- the current date and time in Universal time.
- </para>
- <para>
- See the <see cref="T:log4net.Util.PatternStringConverters.DatePatternConverter"/> for details on the date pattern syntax.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.PatternStringConverters.DatePatternConverter"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.UtcDatePatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the current date and time to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Pass the current date and time to the <see cref="T:log4net.DateFormatter.IDateFormatter"/>
- for it to render it to the writer.
- </para>
- <para>
- The date is in Universal time when it is rendered.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.PatternStringConverters.DatePatternConverter"/>
- </member>
- <member name="T:log4net.Util.TypeConverters.BooleanConverter">
- <summary>
- Type converter for Boolean.
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <c>bool</c> type.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.BooleanConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.BooleanConverter.ConvertFrom(System.Object)">
- <summary>
- Convert the source object to the type supported by this object
- </summary>
- <param name="source">the object to convert</param>
- <returns>the converted object</returns>
- <remarks>
- <para>
- Uses the <see cref="M:System.Boolean.Parse(System.String)"/> method to convert the
- <see cref="T:System.String"/> argument to a <see cref="T:System.Boolean"/>.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.BooleanConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- <summary>
- Exception base type for conversion errors.
- </summary>
- <remarks>
- <para>
- This type extends <see cref="T:System.ApplicationException"/>. It
- does not add any new functionality but does differentiate the
- type of exception being thrown.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="message">A message to include with the exception.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class
- with the specified message.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.#ctor(System.String,System.Exception)">
- <summary>
- Constructor
- </summary>
- <param name="message">A message to include with the exception.</param>
- <param name="innerException">A nested exception to include.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class
- with the specified message and inner exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Serialization constructor
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
- <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class
- with serialized data.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.Create(System.Type,System.Object)">
- <summary>
- Creates a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class.
- </summary>
- <param name="destinationType">The conversion destination type.</param>
- <param name="sourceValue">The value to convert.</param>
- <returns>An instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/>.</returns>
- <remarks>
- <para>
- Creates a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.Create(System.Type,System.Object,System.Exception)">
- <summary>
- Creates a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class.
- </summary>
- <param name="destinationType">The conversion destination type.</param>
- <param name="sourceValue">The value to convert.</param>
- <param name="innerException">A nested exception to include.</param>
- <returns>An instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/>.</returns>
- <remarks>
- <para>
- Creates a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.TypeConverters.ConverterRegistry">
- <summary>
- Register of type converters for specific types.
- </summary>
- <remarks>
- <para>
- Maintains a registry of type converters used to convert between
- types.
- </para>
- <para>
- Use the <see cref="M:log4net.Util.TypeConverters.ConverterRegistry.AddConverter(System.Type,System.Object)"/> and
- <see cref="M:log4net.Util.TypeConverters.ConverterRegistry.AddConverter(System.Type,System.Type)"/> methods to register new converters.
- The <see cref="M:log4net.Util.TypeConverters.ConverterRegistry.GetConvertTo(System.Type,System.Type)"/> and <see cref="M:log4net.Util.TypeConverters.ConverterRegistry.GetConvertFrom(System.Type)"/> methods
- lookup appropriate converters to use.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.#ctor">
- <summary>
- Private constructor
- </summary>
- <remarks>
- Initializes a new instance of the <see cref="T:log4net.Util.TypeConverters.ConverterRegistry"/> class.
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.#cctor">
- <summary>
- Static constructor.
- </summary>
- <remarks>
- <para>
- This constructor defines the intrinsic type converters.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.AddConverter(System.Type,System.Object)">
- <summary>
- Adds a converter for a specific type.
- </summary>
- <param name="destinationType">The type being converted to.</param>
- <param name="converter">The type converter to use to convert to the destination type.</param>
- <remarks>
- <para>
- Adds a converter instance for a specific type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.AddConverter(System.Type,System.Type)">
- <summary>
- Adds a converter for a specific type.
- </summary>
- <param name="destinationType">The type being converted to.</param>
- <param name="converterType">The type of the type converter to use to convert to the destination type.</param>
- <remarks>
- <para>
- Adds a converter <see cref="T:System.Type"/> for a specific type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.GetConvertTo(System.Type,System.Type)">
- <summary>
- Gets the type converter to use to convert values to the destination type.
- </summary>
- <param name="sourceType">The type being converted from.</param>
- <param name="destinationType">The type being converted to.</param>
- <returns>
- The type converter instance to use for type conversions or <c>null</c>
- if no type converter is found.
- </returns>
- <remarks>
- <para>
- Gets the type converter to use to convert values to the destination type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.GetConvertFrom(System.Type)">
- <summary>
- Gets the type converter to use to convert values to the destination type.
- </summary>
- <param name="destinationType">The type being converted to.</param>
- <returns>
- The type converter instance to use for type conversions or <c>null</c>
- if no type converter is found.
- </returns>
- <remarks>
- <para>
- Gets the type converter to use to convert values to the destination type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.GetConverterFromAttribute(System.Type)">
- <summary>
- Lookups the type converter to use as specified by the attributes on the
- destination type.
- </summary>
- <param name="destinationType">The type being converted to.</param>
- <returns>
- The type converter instance to use for type conversions or <c>null</c>
- if no type converter is found.
- </returns>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.CreateConverterInstance(System.Type)">
- <summary>
- Creates the instance of the type converter.
- </summary>
- <param name="converterType">The type of the type converter.</param>
- <returns>
- The type converter instance to use for type conversions or <c>null</c>
- if no type converter is found.
- </returns>
- <remarks>
- <para>
- The type specified for the type converter must implement
- the <see cref="T:log4net.Util.TypeConverters.IConvertFrom"/> or <see cref="T:log4net.Util.TypeConverters.IConvertTo"/> interfaces
- and must have a public default (no argument) constructor.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.TypeConverters.ConverterRegistry.s_type2converter">
- <summary>
- Mapping from <see cref="T:System.Type"/> to type converter.
- </summary>
- </member>
- <member name="T:log4net.Util.TypeConverters.EncodingConverter">
- <summary>
- Supports conversion from string to <see cref="T:System.Text.Encoding"/> type.
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <see cref="T:System.Text.Encoding"/> type.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.EncodingConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.EncodingConverter.ConvertFrom(System.Object)">
- <summary>
- Overrides the ConvertFrom method of IConvertFrom.
- </summary>
- <param name="source">the object to convert to an encoding</param>
- <returns>the encoding</returns>
- <remarks>
- <para>
- Uses the <see cref="M:System.Text.Encoding.GetEncoding(System.String)"/> method to
- convert the <see cref="T:System.String"/> argument to an <see cref="T:System.Text.Encoding"/>.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.EncodingConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="T:log4net.Util.TypeConverters.IConvertTo">
- <summary>
- Interface supported by type converters
- </summary>
- <remarks>
- <para>
- This interface supports conversion from a single type to arbitrary types.
- See <see cref="T:log4net.Util.TypeConverters.TypeConverterAttribute"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.IConvertTo.CanConvertTo(System.Type)">
- <summary>
- Returns whether this converter can convert the object to the specified type
- </summary>
- <param name="targetType">A Type that represents the type you want to convert to</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Test if the type supported by this converter can be converted to the
- <paramref name="targetType"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.IConvertTo.ConvertTo(System.Object,System.Type)">
- <summary>
- Converts the given value object to the specified type, using the arguments
- </summary>
- <param name="source">the object to convert</param>
- <param name="targetType">The Type to convert the value parameter to</param>
- <returns>the converted object</returns>
- <remarks>
- <para>
- Converts the <paramref name="source"/> (which must be of the type supported
- by this converter) to the <paramref name="targetType"/> specified..
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.TypeConverters.IPAddressConverter">
- <summary>
- Supports conversion from string to <see cref="T:System.Net.IPAddress"/> type.
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <see cref="T:System.Net.IPAddress"/> type.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.IPAddressConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.IPAddressConverter.ConvertFrom(System.Object)">
- <summary>
- Overrides the ConvertFrom method of IConvertFrom.
- </summary>
- <param name="source">the object to convert to an IPAddress</param>
- <returns>the IPAddress</returns>
- <remarks>
- <para>
- Uses the <see cref="M:System.Net.IPAddress.Parse(System.String)"/> method to convert the
- <see cref="T:System.String"/> argument to an <see cref="T:System.Net.IPAddress"/>.
- If that fails then the string is resolved as a DNS hostname.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.IPAddressConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="F:log4net.Util.TypeConverters.IPAddressConverter.validIpAddressChars">
- <summary>
- Valid characters in an IPv4 or IPv6 address string. (Does not support subnets)
- </summary>
- </member>
- <member name="T:log4net.Util.TypeConverters.PatternLayoutConverter">
- <summary>
- Supports conversion from string to <see cref="T:log4net.Layout.PatternLayout"/> type.
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <see cref="T:log4net.Layout.PatternLayout"/> type.
- </para>
- <para>
- The string is used as the <see cref="P:log4net.Layout.PatternLayout.ConversionPattern"/>
- of the <see cref="T:log4net.Layout.PatternLayout"/>.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternLayoutConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternLayoutConverter.ConvertFrom(System.Object)">
- <summary>
- Overrides the ConvertFrom method of IConvertFrom.
- </summary>
- <param name="source">the object to convert to a PatternLayout</param>
- <returns>the PatternLayout</returns>
- <remarks>
- <para>
- Creates and returns a new <see cref="T:log4net.Layout.PatternLayout"/> using
- the <paramref name="source"/> <see cref="T:System.String"/> as the
- <see cref="P:log4net.Layout.PatternLayout.ConversionPattern"/>.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.PatternLayoutConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="T:log4net.Util.TypeConverters.PatternStringConverter">
- <summary>
- Convert between string and <see cref="T:log4net.Util.PatternString"/>
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <see cref="T:log4net.Util.PatternString"/> type,
- and from a <see cref="T:log4net.Util.PatternString"/> type to a string.
- </para>
- <para>
- The string is used as the <see cref="P:log4net.Util.PatternString.ConversionPattern"/>
- of the <see cref="T:log4net.Util.PatternString"/>.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternStringConverter.CanConvertTo(System.Type)">
- <summary>
- Can the target type be converted to the type supported by this object
- </summary>
- <param name="targetType">A <see cref="T:System.Type"/> that represents the type you want to convert to</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="targetType"/> is
- assignable from a <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternStringConverter.ConvertTo(System.Object,System.Type)">
- <summary>
- Converts the given value object to the specified type, using the arguments
- </summary>
- <param name="source">the object to convert</param>
- <param name="targetType">The Type to convert the value parameter to</param>
- <returns>the converted object</returns>
- <remarks>
- <para>
- Uses the <see cref="M:log4net.Util.PatternString.Format"/> method to convert the
- <see cref="T:log4net.Util.PatternString"/> argument to a <see cref="T:System.String"/>.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- <paramref name="targetType"/>. To check for this condition use the
- <see cref="M:log4net.Util.TypeConverters.PatternStringConverter.CanConvertTo(System.Type)"/> method.
- </exception>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternStringConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternStringConverter.ConvertFrom(System.Object)">
- <summary>
- Overrides the ConvertFrom method of IConvertFrom.
- </summary>
- <param name="source">the object to convert to a PatternString</param>
- <returns>the PatternString</returns>
- <remarks>
- <para>
- Creates and returns a new <see cref="T:log4net.Util.PatternString"/> using
- the <paramref name="source"/> <see cref="T:System.String"/> as the
- <see cref="P:log4net.Util.PatternString.ConversionPattern"/>.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.PatternStringConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="T:log4net.Util.TypeConverters.TypeConverter">
- <summary>
- Supports conversion from string to <see cref="T:System.Type"/> type.
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <see cref="T:System.Type"/> type.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.TypeConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.TypeConverter.ConvertFrom(System.Object)">
- <summary>
- Overrides the ConvertFrom method of IConvertFrom.
- </summary>
- <param name="source">the object to convert to a Type</param>
- <returns>the Type</returns>
- <remarks>
- <para>
- Uses the <see cref="M:System.Type.GetType(System.String,System.Boolean)"/> method to convert the
- <see cref="T:System.String"/> argument to a <see cref="T:System.Type"/>.
- Additional effort is made to locate partially specified types
- by searching the loaded assemblies.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.TypeConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="T:log4net.Util.TypeConverters.TypeConverterAttribute">
- <summary>
- Attribute used to associate a type converter
- </summary>
- <remarks>
- <para>
- Class and Interface level attribute that specifies a type converter
- to use with the associated type.
- </para>
- <para>
- To associate a type converter with a target type apply a
- <c>TypeConverterAttribute</c> to the target type. Specify the
- type of the type converter on the attribute.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Util.TypeConverters.TypeConverterAttribute.m_typeName">
- <summary>
- The string type name of the type converter
- </summary>
- </member>
- <member name="M:log4net.Util.TypeConverters.TypeConverterAttribute.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.TypeConverterAttribute.#ctor(System.String)">
- <summary>
- Create a new type converter attribute for the specified type name
- </summary>
- <param name="typeName">The string type name of the type converter</param>
- <remarks>
- <para>
- The type specified must implement the <see cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- or the <see cref="T:log4net.Util.TypeConverters.IConvertTo"/> interfaces.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.TypeConverterAttribute.#ctor(System.Type)">
- <summary>
- Create a new type converter attribute for the specified type
- </summary>
- <param name="converterType">The type of the type converter</param>
- <remarks>
- <para>
- The type specified must implement the <see cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- or the <see cref="T:log4net.Util.TypeConverters.IConvertTo"/> interfaces.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.TypeConverters.TypeConverterAttribute.ConverterTypeName">
- <summary>
- The string type name of the type converter
- </summary>
- <value>
- The string type name of the type converter
- </value>
- <remarks>
- <para>
- The type specified must implement the <see cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- or the <see cref="T:log4net.Util.TypeConverters.IConvertTo"/> interfaces.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.AppenderAttachedImpl">
- <summary>
- A straightforward implementation of the <see cref="T:log4net.Core.IAppenderAttachable"/> interface.
- </summary>
- <remarks>
- <para>
- This is the default implementation of the <see cref="T:log4net.Core.IAppenderAttachable"/>
- interface. Implementors of the <see cref="T:log4net.Core.IAppenderAttachable"/> interface
- should aggregate an instance of this type.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.AppenderAttachedImpl"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(log4net.Core.LoggingEvent)">
- <summary>
- Append on on all attached appenders.
- </summary>
- <param name="loggingEvent">The event being logged.</param>
- <returns>The number of appenders called.</returns>
- <remarks>
- <para>
- Calls the <see cref="M:log4net.Appender.IAppender.DoAppend(log4net.Core.LoggingEvent)"/> method on all
- attached appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(log4net.Core.LoggingEvent[])">
- <summary>
- Append on on all attached appenders.
- </summary>
- <param name="loggingEvents">The array of events being logged.</param>
- <returns>The number of appenders called.</returns>
- <remarks>
- <para>
- Calls the <see cref="M:log4net.Appender.IAppender.DoAppend(log4net.Core.LoggingEvent)"/> method on all
- attached appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.CallAppend(log4net.Appender.IAppender,log4net.Core.LoggingEvent[])">
- <summary>
- Calls the DoAppende method on the <see cref="T:log4net.Appender.IAppender"/> with
- the <see cref="T:log4net.Core.LoggingEvent"/> objects supplied.
- </summary>
- <param name="appender">The appender</param>
- <param name="loggingEvents">The events</param>
- <remarks>
- <para>
- If the <paramref name="appender"/> supports the <see cref="T:log4net.Appender.IBulkAppender"/>
- interface then the <paramref name="loggingEvents"/> will be passed
- through using that interface. Otherwise the <see cref="T:log4net.Core.LoggingEvent"/>
- objects in the array will be passed one at a time.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.AddAppender(log4net.Appender.IAppender)">
- <summary>
- Attaches an appender.
- </summary>
- <param name="newAppender">The appender to add.</param>
- <remarks>
- <para>
- If the appender is already in the list it won't be added again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.GetAppender(System.String)">
- <summary>
- Gets an attached appender with the specified name.
- </summary>
- <param name="name">The name of the appender to get.</param>
- <returns>
- The appender with the name specified, or <c>null</c> if no appender with the
- specified name is found.
- </returns>
- <remarks>
- <para>
- Lookup an attached appender by name.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.RemoveAllAppenders">
- <summary>
- Removes all attached appenders.
- </summary>
- <remarks>
- <para>
- Removes and closes all attached appenders
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.RemoveAppender(log4net.Appender.IAppender)">
- <summary>
- Removes the specified appender from the list of attached appenders.
- </summary>
- <param name="appender">The appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.RemoveAppender(System.String)">
- <summary>
- Removes the appender with the specified name from the list of appenders.
- </summary>
- <param name="name">The name of the appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.AppenderAttachedImpl.m_appenderList">
- <summary>
- List of appenders
- </summary>
- </member>
- <member name="F:log4net.Util.AppenderAttachedImpl.m_appenderArray">
- <summary>
- Array of appenders, used to cache the m_appenderList
- </summary>
- </member>
- <member name="P:log4net.Util.AppenderAttachedImpl.Appenders">
- <summary>
- Gets all attached appenders.
- </summary>
- <returns>
- A collection of attached appenders, or <c>null</c> if there
- are no attached appenders.
- </returns>
- <remarks>
- <para>
- The read only collection of all currently attached appenders.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.CompositeProperties">
- <summary>
- This class aggregates several PropertiesDictionary collections together.
- </summary>
- <remarks>
- <para>
- Provides a dictionary style lookup over an ordered list of
- <see cref="T:log4net.Util.PropertiesDictionary"/> collections.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.CompositeProperties.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.CompositeProperties"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CompositeProperties.Add(log4net.Util.ReadOnlyPropertiesDictionary)">
- <summary>
- Add a Properties Dictionary to this composite collection
- </summary>
- <param name="properties">the properties to add</param>
- <remarks>
- <para>
- Properties dictionaries added first take precedence over dictionaries added
- later.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CompositeProperties.Flatten">
- <summary>
- Flatten this composite collection into a single properties dictionary
- </summary>
- <returns>the flattened dictionary</returns>
- <remarks>
- <para>
- Reduces the collection of ordered dictionaries to a single dictionary
- containing the resultant values for the keys.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.CompositeProperties.Item(System.String)">
- <summary>
- Gets the value of a property
- </summary>
- <value>
- The value for the property with the specified key
- </value>
- <remarks>
- <para>
- Looks up the value for the <paramref name="key"/> specified.
- The <see cref="T:log4net.Util.PropertiesDictionary"/> collections are searched
- in the order in which they were added to this collection. The value
- returned is the value held by the first collection that contains
- the specified key.
- </para>
- <para>
- If none of the collections contain the specified key then
- <c>null</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ContextPropertiesBase">
- <summary>
- Base class for Context Properties implementations
- </summary>
- <remarks>
- <para>
- This class defines a basic property get set accessor
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="P:log4net.Util.ContextPropertiesBase.Item(System.String)">
- <summary>
- Gets or sets the value of a property
- </summary>
- <value>
- The value for the property with the specified key
- </value>
- <remarks>
- <para>
- Gets or sets the value of a property
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.CountingQuietTextWriter">
- <summary>
- Subclass of <see cref="T:log4net.Util.QuietTextWriter"/> that maintains a count of
- the number of bytes written.
- </summary>
- <remarks>
- <para>
- This writer counts the number of bytes written.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Util.QuietTextWriter">
- <summary>
- <see cref="T:System.IO.TextWriter"/> that does not leak exceptions
- </summary>
- <remarks>
- <para>
- <see cref="T:log4net.Util.QuietTextWriter"/> does not throw exceptions when things go wrong.
- Instead, it delegates error handling to its <see cref="T:log4net.Core.IErrorHandler"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Util.TextWriterAdapter">
- <summary>
- Adapter that extends <see cref="T:System.IO.TextWriter"/> and forwards all
- messages to an instance of <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <remarks>
- <para>
- Adapter that extends <see cref="T:System.IO.TextWriter"/> and forwards all
- messages to an instance of <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.TextWriterAdapter.m_writer">
- <summary>
- The writer to forward messages to
- </summary>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.#ctor(System.IO.TextWriter)">
- <summary>
- Create an instance of <see cref="T:log4net.Util.TextWriterAdapter"/> that forwards all
- messages to a <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <param name="writer">The <see cref="T:System.IO.TextWriter"/> to forward to</param>
- <remarks>
- <para>
- Create an instance of <see cref="T:log4net.Util.TextWriterAdapter"/> that forwards all
- messages to a <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Close">
- <summary>
- Closes the writer and releases any system resources associated with the writer
- </summary>
- <remarks>
- <para>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Dispose(System.Boolean)">
- <summary>
- Dispose this writer
- </summary>
- <param name="disposing">flag indicating if we are being disposed</param>
- <remarks>
- <para>
- Dispose this writer
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Flush">
- <summary>
- Flushes any buffered output
- </summary>
- <remarks>
- <para>
- Clears all buffers for the writer and causes any buffered data to be written
- to the underlying device
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Write(System.Char)">
- <summary>
- Writes a character to the wrapped TextWriter
- </summary>
- <param name="value">the value to write to the TextWriter</param>
- <remarks>
- <para>
- Writes a character to the wrapped TextWriter
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Write(System.Char[],System.Int32,System.Int32)">
- <summary>
- Writes a character buffer to the wrapped TextWriter
- </summary>
- <param name="buffer">the data buffer</param>
- <param name="index">the start index</param>
- <param name="count">the number of characters to write</param>
- <remarks>
- <para>
- Writes a character buffer to the wrapped TextWriter
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Write(System.String)">
- <summary>
- Writes a string to the wrapped TextWriter
- </summary>
- <param name="value">the value to write to the TextWriter</param>
- <remarks>
- <para>
- Writes a string to the wrapped TextWriter
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.TextWriterAdapter.Writer">
- <summary>
- Gets or sets the underlying <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <value>
- The underlying <see cref="T:System.IO.TextWriter"/>.
- </value>
- <remarks>
- <para>
- Gets or sets the underlying <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.TextWriterAdapter.Encoding">
- <summary>
- The Encoding in which the output is written
- </summary>
- <value>
- The <see cref="P:log4net.Util.TextWriterAdapter.Encoding"/>
- </value>
- <remarks>
- <para>
- The Encoding in which the output is written
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.TextWriterAdapter.FormatProvider">
- <summary>
- Gets an object that controls formatting
- </summary>
- <value>
- The format provider
- </value>
- <remarks>
- <para>
- Gets an object that controls formatting
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.TextWriterAdapter.NewLine">
- <summary>
- Gets or sets the line terminator string used by the TextWriter
- </summary>
- <value>
- The line terminator to use
- </value>
- <remarks>
- <para>
- Gets or sets the line terminator string used by the TextWriter
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.QuietTextWriter.#ctor(System.IO.TextWriter,log4net.Core.IErrorHandler)">
- <summary>
- Constructor
- </summary>
- <param name="writer">the writer to actually write to</param>
- <param name="errorHandler">the error handler to report error to</param>
- <remarks>
- <para>
- Create a new QuietTextWriter using a writer and error handler
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.QuietTextWriter.Write(System.Char)">
- <summary>
- Writes a character to the underlying writer
- </summary>
- <param name="value">the char to write</param>
- <remarks>
- <para>
- Writes a character to the underlying writer
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.QuietTextWriter.Write(System.Char[],System.Int32,System.Int32)">
- <summary>
- Writes a buffer to the underlying writer
- </summary>
- <param name="buffer">the buffer to write</param>
- <param name="index">the start index to write from</param>
- <param name="count">the number of characters to write</param>
- <remarks>
- <para>
- Writes a buffer to the underlying writer
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.QuietTextWriter.Write(System.String)">
- <summary>
- Writes a string to the output.
- </summary>
- <param name="value">The string data to write to the output.</param>
- <remarks>
- <para>
- Writes a string to the output.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.QuietTextWriter.Close">
- <summary>
- Closes the underlying output writer.
- </summary>
- <remarks>
- <para>
- Closes the underlying output writer.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.QuietTextWriter.m_errorHandler">
- <summary>
- The error handler instance to pass all errors to
- </summary>
- </member>
- <member name="F:log4net.Util.QuietTextWriter.m_closed">
- <summary>
- Flag to indicate if this writer is closed
- </summary>
- </member>
- <member name="P:log4net.Util.QuietTextWriter.ErrorHandler">
- <summary>
- Gets or sets the error handler that all errors are passed to.
- </summary>
- <value>
- The error handler that all errors are passed to.
- </value>
- <remarks>
- <para>
- Gets or sets the error handler that all errors are passed to.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.QuietTextWriter.Closed">
- <summary>
- Gets a value indicating whether this writer is closed.
- </summary>
- <value>
- <c>true</c> if this writer is closed, otherwise <c>false</c>.
- </value>
- <remarks>
- <para>
- Gets a value indicating whether this writer is closed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CountingQuietTextWriter.#ctor(System.IO.TextWriter,log4net.Core.IErrorHandler)">
- <summary>
- Constructor
- </summary>
- <param name="writer">The <see cref="T:System.IO.TextWriter"/> to actually write to.</param>
- <param name="errorHandler">The <see cref="T:log4net.Core.IErrorHandler"/> to report errors to.</param>
- <remarks>
- <para>
- Creates a new instance of the <see cref="T:log4net.Util.CountingQuietTextWriter"/> class
- with the specified <see cref="T:System.IO.TextWriter"/> and <see cref="T:log4net.Core.IErrorHandler"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CountingQuietTextWriter.Write(System.Char)">
- <summary>
- Writes a character to the underlying writer and counts the number of bytes written.
- </summary>
- <param name="value">the char to write</param>
- <remarks>
- <para>
- Overrides implementation of <see cref="T:log4net.Util.QuietTextWriter"/>. Counts
- the number of bytes written.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CountingQuietTextWriter.Write(System.Char[],System.Int32,System.Int32)">
- <summary>
- Writes a buffer to the underlying writer and counts the number of bytes written.
- </summary>
- <param name="buffer">the buffer to write</param>
- <param name="index">the start index to write from</param>
- <param name="count">the number of characters to write</param>
- <remarks>
- <para>
- Overrides implementation of <see cref="T:log4net.Util.QuietTextWriter"/>. Counts
- the number of bytes written.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CountingQuietTextWriter.Write(System.String)">
- <summary>
- Writes a string to the output and counts the number of bytes written.
- </summary>
- <param name="str">The string data to write to the output.</param>
- <remarks>
- <para>
- Overrides implementation of <see cref="T:log4net.Util.QuietTextWriter"/>. Counts
- the number of bytes written.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.CountingQuietTextWriter.m_countBytes">
- <summary>
- Total number of bytes written.
- </summary>
- </member>
- <member name="P:log4net.Util.CountingQuietTextWriter.Count">
- <summary>
- Gets or sets the total number of bytes written.
- </summary>
- <value>
- The total number of bytes written.
- </value>
- <remarks>
- <para>
- Gets or sets the total number of bytes written.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.CyclicBuffer">
- <summary>
- A fixed size rolling buffer of logging events.
- </summary>
- <remarks>
- <para>
- An array backed fixed size leaky bucket.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.CyclicBuffer.#ctor(System.Int32)">
- <summary>
- Constructor
- </summary>
- <param name="maxSize">The maximum number of logging events in the buffer.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.CyclicBuffer"/> class with
- the specified maximum number of buffered logging events.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="maxSize"/> argument is not a positive integer.</exception>
- </member>
- <member name="M:log4net.Util.CyclicBuffer.Append(log4net.Core.LoggingEvent)">
- <summary>
- Appends a <paramref name="loggingEvent"/> to the buffer.
- </summary>
- <param name="loggingEvent">The event to append to the buffer.</param>
- <returns>The event discarded from the buffer, if the buffer is full, otherwise <c>null</c>.</returns>
- <remarks>
- <para>
- Append an event to the buffer. If the buffer still contains free space then
- <c>null</c> is returned. If the buffer is full then an event will be dropped
- to make space for the new event, the event dropped is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CyclicBuffer.PopOldest">
- <summary>
- Get and remove the oldest event in the buffer.
- </summary>
- <returns>The oldest logging event in the buffer</returns>
- <remarks>
- <para>
- Gets the oldest (first) logging event in the buffer and removes it
- from the buffer.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CyclicBuffer.PopAll">
- <summary>
- Pops all the logging events from the buffer into an array.
- </summary>
- <returns>An array of all the logging events in the buffer.</returns>
- <remarks>
- <para>
- Get all the events in the buffer and clear the buffer.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CyclicBuffer.Clear">
- <summary>
- Clear the buffer
- </summary>
- <remarks>
- <para>
- Clear the buffer of all events. The events in the buffer are lost.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.CyclicBuffer.Item(System.Int32)">
- <summary>
- Gets the <paramref name="i"/>th oldest event currently in the buffer.
- </summary>
- <value>The <paramref name="i"/>th oldest event currently in the buffer.</value>
- <remarks>
- <para>
- If <paramref name="i"/> is outside the range 0 to the number of events
- currently in the buffer, then <c>null</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.CyclicBuffer.MaxSize">
- <summary>
- Gets the maximum size of the buffer.
- </summary>
- <value>The maximum size of the buffer.</value>
- <remarks>
- <para>
- Gets the maximum size of the buffer
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.CyclicBuffer.Length">
- <summary>
- Gets the number of logging events in the buffer.
- </summary>
- <value>The number of logging events in the buffer.</value>
- <remarks>
- <para>
- This number is guaranteed to be in the range 0 to <see cref="P:log4net.Util.CyclicBuffer.MaxSize"/>
- (inclusive).
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.EmptyCollection">
- <summary>
- An always empty <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <remarks>
- <para>
- A singleton implementation of the <see cref="T:System.Collections.ICollection"/>
- interface that always represents an empty collection.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.EmptyCollection.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.EmptyCollection"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to enforce the singleton pattern.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyCollection.CopyTo(System.Array,System.Int32)">
- <summary>
- Copies the elements of the <see cref="T:System.Collections.ICollection"/> to an
- <see cref="T:System.Array"/>, starting at a particular Array index.
- </summary>
- <param name="array">The one-dimensional <see cref="T:System.Array"/>
- that is the destination of the elements copied from
- <see cref="T:System.Collections.ICollection"/>. The Array must have zero-based
- indexing.</param>
- <param name="index">The zero-based index in array at which
- copying begins.</param>
- <remarks>
- <para>
- As the collection is empty no values are copied into the array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyCollection.GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through a collection.
- </summary>
- <returns>
- An <see cref="T:System.Collections.IEnumerator"/> that can be used to
- iterate through the collection.
- </returns>
- <remarks>
- <para>
- As the collection is empty a <see cref="T:log4net.Util.NullEnumerator"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.EmptyCollection.s_instance">
- <summary>
- The singleton instance of the empty collection.
- </summary>
- </member>
- <member name="P:log4net.Util.EmptyCollection.Instance">
- <summary>
- Gets the singleton instance of the empty collection.
- </summary>
- <returns>The singleton instance of the empty collection.</returns>
- <remarks>
- <para>
- Gets the singleton instance of the empty collection.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyCollection.IsSynchronized">
- <summary>
- Gets a value indicating if access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread-safe).
- </summary>
- <value>
- <b>true</b> if access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread-safe); otherwise, <b>false</b>.
- </value>
- <remarks>
- <para>
- For the <see cref="T:log4net.Util.EmptyCollection"/> this property is always <c>true</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyCollection.Count">
- <summary>
- Gets the number of elements contained in the <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <value>
- The number of elements contained in the <see cref="T:System.Collections.ICollection"/>.
- </value>
- <remarks>
- <para>
- As the collection is empty the <see cref="P:log4net.Util.EmptyCollection.Count"/> is always <c>0</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyCollection.SyncRoot">
- <summary>
- Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <value>
- An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.
- </value>
- <remarks>
- <para>
- As the collection is empty and thread safe and synchronized this instance is also
- the <see cref="P:log4net.Util.EmptyCollection.SyncRoot"/> object.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.EmptyDictionary">
- <summary>
- An always empty <see cref="T:System.Collections.IDictionary"/>.
- </summary>
- <remarks>
- <para>
- A singleton implementation of the <see cref="T:System.Collections.IDictionary"/>
- interface that always represents an empty collection.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.EmptyDictionary"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to enforce the singleton pattern.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.CopyTo(System.Array,System.Int32)">
- <summary>
- Copies the elements of the <see cref="T:System.Collections.ICollection"/> to an
- <see cref="T:System.Array"/>, starting at a particular Array index.
- </summary>
- <param name="array">The one-dimensional <see cref="T:System.Array"/>
- that is the destination of the elements copied from
- <see cref="T:System.Collections.ICollection"/>. The Array must have zero-based
- indexing.</param>
- <param name="index">The zero-based index in array at which
- copying begins.</param>
- <remarks>
- <para>
- As the collection is empty no values are copied into the array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.System#Collections#IEnumerable#GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through a collection.
- </summary>
- <returns>
- An <see cref="T:System.Collections.IEnumerator"/> that can be used to
- iterate through the collection.
- </returns>
- <remarks>
- <para>
- As the collection is empty a <see cref="T:log4net.Util.NullEnumerator"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.Add(System.Object,System.Object)">
- <summary>
- Adds an element with the provided key and value to the
- <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <param name="key">The <see cref="T:System.Object"/> to use as the key of the element to add.</param>
- <param name="value">The <see cref="T:System.Object"/> to use as the value of the element to add.</param>
- <remarks>
- <para>
- As the collection is empty no new values can be added. A <see cref="T:System.InvalidOperationException"/>
- is thrown if this method is called.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">This dictionary is always empty and cannot be modified.</exception>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.Clear">
- <summary>
- Removes all elements from the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <remarks>
- <para>
- As the collection is empty no values can be removed. A <see cref="T:System.InvalidOperationException"/>
- is thrown if this method is called.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">This dictionary is always empty and cannot be modified.</exception>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.Contains(System.Object)">
- <summary>
- Determines whether the <see cref="T:log4net.Util.EmptyDictionary"/> contains an element
- with the specified key.
- </summary>
- <param name="key">The key to locate in the <see cref="T:log4net.Util.EmptyDictionary"/>.</param>
- <returns><c>false</c></returns>
- <remarks>
- <para>
- As the collection is empty the <see cref="M:log4net.Util.EmptyDictionary.Contains(System.Object)"/> method always returns <c>false</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through a collection.
- </summary>
- <returns>
- An <see cref="T:System.Collections.IEnumerator"/> that can be used to
- iterate through the collection.
- </returns>
- <remarks>
- <para>
- As the collection is empty a <see cref="T:log4net.Util.NullEnumerator"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.Remove(System.Object)">
- <summary>
- Removes the element with the specified key from the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <param name="key">The key of the element to remove.</param>
- <remarks>
- <para>
- As the collection is empty no values can be removed. A <see cref="T:System.InvalidOperationException"/>
- is thrown if this method is called.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">This dictionary is always empty and cannot be modified.</exception>
- </member>
- <member name="F:log4net.Util.EmptyDictionary.s_instance">
- <summary>
- The singleton instance of the empty dictionary.
- </summary>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.Instance">
- <summary>
- Gets the singleton instance of the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <returns>The singleton instance of the <see cref="T:log4net.Util.EmptyDictionary"/>.</returns>
- <remarks>
- <para>
- Gets the singleton instance of the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.IsSynchronized">
- <summary>
- Gets a value indicating if access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread-safe).
- </summary>
- <value>
- <b>true</b> if access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread-safe); otherwise, <b>false</b>.
- </value>
- <remarks>
- <para>
- For the <see cref="T:log4net.Util.EmptyCollection"/> this property is always <b>true</b>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.Count">
- <summary>
- Gets the number of elements contained in the <see cref="T:System.Collections.ICollection"/>
- </summary>
- <value>
- The number of elements contained in the <see cref="T:System.Collections.ICollection"/>.
- </value>
- <remarks>
- <para>
- As the collection is empty the <see cref="P:log4net.Util.EmptyDictionary.Count"/> is always <c>0</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.SyncRoot">
- <summary>
- Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <value>
- An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.
- </value>
- <remarks>
- <para>
- As the collection is empty and thread safe and synchronized this instance is also
- the <see cref="P:log4net.Util.EmptyDictionary.SyncRoot"/> object.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.IsFixedSize">
- <summary>
- Gets a value indicating whether the <see cref="T:log4net.Util.EmptyDictionary"/> has a fixed size.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- As the collection is empty <see cref="P:log4net.Util.EmptyDictionary.IsFixedSize"/> always returns <c>true</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.IsReadOnly">
- <summary>
- Gets a value indicating whether the <see cref="T:log4net.Util.EmptyDictionary"/> is read-only.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- As the collection is empty <see cref="P:log4net.Util.EmptyDictionary.IsReadOnly"/> always returns <c>true</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.Keys">
- <summary>
- Gets an <see cref="T:System.Collections.ICollection"/> containing the keys of the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <value>An <see cref="T:System.Collections.ICollection"/> containing the keys of the <see cref="T:log4net.Util.EmptyDictionary"/>.</value>
- <remarks>
- <para>
- As the collection is empty a <see cref="T:log4net.Util.EmptyCollection"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.Values">
- <summary>
- Gets an <see cref="T:System.Collections.ICollection"/> containing the values of the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <value>An <see cref="T:System.Collections.ICollection"/> containing the values of the <see cref="T:log4net.Util.EmptyDictionary"/>.</value>
- <remarks>
- <para>
- As the collection is empty a <see cref="T:log4net.Util.EmptyCollection"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.Item(System.Object)">
- <summary>
- Gets or sets the element with the specified key.
- </summary>
- <param name="key">The key of the element to get or set.</param>
- <value><c>null</c></value>
- <remarks>
- <para>
- As the collection is empty no values can be looked up or stored.
- If the index getter is called then <c>null</c> is returned.
- A <see cref="T:System.InvalidOperationException"/> is thrown if the setter is called.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">This dictionary is always empty and cannot be modified.</exception>
- </member>
- <member name="T:log4net.Util.FormattingInfo">
- <summary>
- Contain the information obtained when parsing formatting modifiers
- in conversion modifiers.
- </summary>
- <remarks>
- <para>
- Holds the formatting information extracted from the format string by
- the <see cref="T:log4net.Util.PatternParser"/>. This is used by the <see cref="T:log4net.Util.PatternConverter"/>
- objects when rendering the output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.FormattingInfo.#ctor">
- <summary>
- Defaut Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.FormattingInfo"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.FormattingInfo.#ctor(System.Int32,System.Int32,System.Boolean)">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.FormattingInfo"/> class
- with the specified parameters.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.FormattingInfo.Min">
- <summary>
- Gets or sets the minimum value.
- </summary>
- <value>
- The minimum value.
- </value>
- <remarks>
- <para>
- Gets or sets the minimum value.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.FormattingInfo.Max">
- <summary>
- Gets or sets the maximum value.
- </summary>
- <value>
- The maximum value.
- </value>
- <remarks>
- <para>
- Gets or sets the maximum value.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.FormattingInfo.LeftAlign">
- <summary>
- Gets or sets a flag indicating whether left align is enabled
- or not.
- </summary>
- <value>
- A flag indicating whether left align is enabled or not.
- </value>
- <remarks>
- <para>
- Gets or sets a flag indicating whether left align is enabled or not.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.GlobalContextProperties">
- <summary>
- Implementation of Properties collection for the <see cref="T:log4net.GlobalContext"/>
- </summary>
- <remarks>
- <para>
- This class implements a properties collection that is thread safe and supports both
- storing properties and capturing a read only copy of the current propertied.
- </para>
- <para>
- This class is optimized to the scenario where the properties are read frequently
- and are modified infrequently.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.GlobalContextProperties.m_readOnlyProperties">
- <summary>
- The read only copy of the properties.
- </summary>
- <remarks>
- <para>
- This variable is declared <c>volatile</c> to prevent the compiler and JIT from
- reordering reads and writes of this thread performed on different threads.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.GlobalContextProperties.m_syncRoot">
- <summary>
- Lock object used to synchronize updates within this instance
- </summary>
- </member>
- <member name="M:log4net.Util.GlobalContextProperties.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.GlobalContextProperties"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.GlobalContextProperties.Remove(System.String)">
- <summary>
- Remove a property from the global context
- </summary>
- <param name="key">the key for the entry to remove</param>
- <remarks>
- <para>
- Removing an entry from the global context properties is relatively expensive compared
- with reading a value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.GlobalContextProperties.Clear">
- <summary>
- Clear the global context properties
- </summary>
- </member>
- <member name="M:log4net.Util.GlobalContextProperties.GetReadOnlyProperties">
- <summary>
- Get a readonly immutable copy of the properties
- </summary>
- <returns>the current global context properties</returns>
- <remarks>
- <para>
- This implementation is fast because the GlobalContextProperties class
- stores a readonly copy of the properties.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.GlobalContextProperties.Item(System.String)">
- <summary>
- Gets or sets the value of a property
- </summary>
- <value>
- The value for the property with the specified key
- </value>
- <remarks>
- <para>
- Reading the value for a key is faster than setting the value.
- When the value is written a new read only copy of
- the properties is created.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.LevelMapping">
- <summary>
- Manages a mapping from levels to <see cref="T:log4net.Util.LevelMappingEntry"/>
- </summary>
- <remarks>
- <para>
- Manages an ordered mapping from <see cref="T:log4net.Core.Level"/> instances
- to <see cref="T:log4net.Util.LevelMappingEntry"/> subclasses.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.LevelMapping.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initialise a new instance of <see cref="T:log4net.Util.LevelMapping"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LevelMapping.Add(log4net.Util.LevelMappingEntry)">
- <summary>
- Add a <see cref="T:log4net.Util.LevelMappingEntry"/> to this mapping
- </summary>
- <param name="entry">the entry to add</param>
- <remarks>
- <para>
- If a <see cref="T:log4net.Util.LevelMappingEntry"/> has previously been added
- for the same <see cref="T:log4net.Core.Level"/> then that entry will be
- overwritten.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LevelMapping.Lookup(log4net.Core.Level)">
- <summary>
- Lookup the mapping for the specified level
- </summary>
- <param name="level">the level to lookup</param>
- <returns>the <see cref="T:log4net.Util.LevelMappingEntry"/> for the level or <c>null</c> if no mapping found</returns>
- <remarks>
- <para>
- Lookup the value for the specified level. Finds the nearest
- mapping value for the level that is equal to or less than the
- <paramref name="level"/> specified.
- </para>
- <para>
- If no mapping could be found then <c>null</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LevelMapping.ActivateOptions">
- <summary>
- Initialize options
- </summary>
- <remarks>
- <para>
- Caches the sorted list of <see cref="T:log4net.Util.LevelMappingEntry"/> in an array
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.LogicalThreadContextProperties">
- <summary>
- Implementation of Properties collection for the <see cref="T:log4net.LogicalThreadContext"/>
- </summary>
- <remarks>
- <para>
- Class implements a collection of properties that is specific to each thread.
- The class is not synchronized as each thread has its own <see cref="T:log4net.Util.PropertiesDictionary"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.LogicalThreadContextProperties.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.LogicalThreadContextProperties"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogicalThreadContextProperties.Remove(System.String)">
- <summary>
- Remove a property
- </summary>
- <param name="key">the key for the entry to remove</param>
- <remarks>
- <para>
- Remove the value for the specified <paramref name="key"/> from the context.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogicalThreadContextProperties.Clear">
- <summary>
- Clear all the context properties
- </summary>
- <remarks>
- <para>
- Clear all the context properties
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogicalThreadContextProperties.GetProperties(System.Boolean)">
- <summary>
- Get the PropertiesDictionary stored in the LocalDataStoreSlot for this thread.
- </summary>
- <param name="create">create the dictionary if it does not exist, otherwise return null if is does not exist</param>
- <returns>the properties for this thread</returns>
- <remarks>
- <para>
- The collection returned is only to be used on the calling thread. If the
- caller needs to share the collection between different threads then the
- caller must clone the collection before doings so.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.LogicalThreadContextProperties.Item(System.String)">
- <summary>
- Gets or sets the value of a property
- </summary>
- <value>
- The value for the property with the specified key
- </value>
- <remarks>
- <para>
- Get or set the property value for the <paramref name="key"/> specified.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.LogLog">
- <summary>
- Outputs log statements from within the log4net assembly.
- </summary>
- <remarks>
- <para>
- Log4net components cannot make log4net logging calls. However, it is
- sometimes useful for the user to learn about what log4net is
- doing.
- </para>
- <para>
- All log4net internal debug calls go to the standard output stream
- whereas internal error messages are sent to the standard error output
- stream.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.LogLog.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.LogLog"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.#cctor">
- <summary>
- Static constructor that initializes logging by reading
- settings from the application configuration file.
- </summary>
- <remarks>
- <para>
- The <c>log4net.Internal.Debug</c> application setting
- controls internal debugging. This setting should be set
- to <c>true</c> to enable debugging.
- </para>
- <para>
- The <c>log4net.Internal.Quiet</c> application setting
- suppresses all internal logging including error messages.
- This setting should be set to <c>true</c> to enable message
- suppression.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Debug(System.String)">
- <summary>
- Writes log4net internal debug messages to the
- standard output stream.
- </summary>
- <param name="message">The message to log.</param>
- <remarks>
- <para>
- All internal debug messages are prepended with
- the string "log4net: ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Debug(System.String,System.Exception)">
- <summary>
- Writes log4net internal debug messages to the
- standard output stream.
- </summary>
- <param name="message">The message to log.</param>
- <param name="exception">An exception to log.</param>
- <remarks>
- <para>
- All internal debug messages are prepended with
- the string "log4net: ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Warn(System.String)">
- <summary>
- Writes log4net internal warning messages to the
- standard error stream.
- </summary>
- <param name="message">The message to log.</param>
- <remarks>
- <para>
- All internal warning messages are prepended with
- the string "log4net:WARN ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Warn(System.String,System.Exception)">
- <summary>
- Writes log4net internal warning messages to the
- standard error stream.
- </summary>
- <param name="message">The message to log.</param>
- <param name="exception">An exception to log.</param>
- <remarks>
- <para>
- All internal warning messages are prepended with
- the string "log4net:WARN ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Error(System.String)">
- <summary>
- Writes log4net internal error messages to the
- standard error stream.
- </summary>
- <param name="message">The message to log.</param>
- <remarks>
- <para>
- All internal error messages are prepended with
- the string "log4net:ERROR ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Error(System.String,System.Exception)">
- <summary>
- Writes log4net internal error messages to the
- standard error stream.
- </summary>
- <param name="message">The message to log.</param>
- <param name="exception">An exception to log.</param>
- <remarks>
- <para>
- All internal debug messages are prepended with
- the string "log4net:ERROR ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.EmitOutLine(System.String)">
- <summary>
- Writes output to the standard output stream.
- </summary>
- <param name="message">The message to log.</param>
- <remarks>
- <para>
- Writes to both Console.Out and System.Diagnostics.Trace.
- Note that the System.Diagnostics.Trace is not supported
- on the Compact Framework.
- </para>
- <para>
- If the AppDomain is not configured with a config file then
- the call to System.Diagnostics.Trace may fail. This is only
- an issue if you are programmatically creating your own AppDomains.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.EmitErrorLine(System.String)">
- <summary>
- Writes output to the standard error stream.
- </summary>
- <param name="message">The message to log.</param>
- <remarks>
- <para>
- Writes to both Console.Error and System.Diagnostics.Trace.
- Note that the System.Diagnostics.Trace is not supported
- on the Compact Framework.
- </para>
- <para>
- If the AppDomain is not configured with a config file then
- the call to System.Diagnostics.Trace may fail. This is only
- an issue if you are programmatically creating your own AppDomains.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.LogLog.s_debugEnabled">
- <summary>
- Default debug level
- </summary>
- </member>
- <member name="F:log4net.Util.LogLog.s_quietMode">
- <summary>
- In quietMode not even errors generate any output.
- </summary>
- </member>
- <member name="P:log4net.Util.LogLog.InternalDebugging">
- <summary>
- Gets or sets a value indicating whether log4net internal logging
- is enabled or disabled.
- </summary>
- <value>
- <c>true</c> if log4net internal logging is enabled, otherwise
- <c>false</c>.
- </value>
- <remarks>
- <para>
- When set to <c>true</c>, internal debug level logging will be
- displayed.
- </para>
- <para>
- This value can be set by setting the application setting
- <c>log4net.Internal.Debug</c> in the application configuration
- file.
- </para>
- <para>
- The default value is <c>false</c>, i.e. debugging is
- disabled.
- </para>
- </remarks>
- <example>
- <para>
- The following example enables internal debugging using the
- application configuration file :
- </para>
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net.Internal.Debug" value="true" />
- </appSettings>
- </configuration>
- </code>
- </example>
- </member>
- <member name="P:log4net.Util.LogLog.QuietMode">
- <summary>
- Gets or sets a value indicating whether log4net should generate no output
- from internal logging, not even for errors.
- </summary>
- <value>
- <c>true</c> if log4net should generate no output at all from internal
- logging, otherwise <c>false</c>.
- </value>
- <remarks>
- <para>
- When set to <c>true</c> will cause internal logging at all levels to be
- suppressed. This means that no warning or error reports will be logged.
- This option overrides the <see cref="P:log4net.Util.LogLog.InternalDebugging"/> setting and
- disables all debug also.
- </para>
- <para>This value can be set by setting the application setting
- <c>log4net.Internal.Quiet</c> in the application configuration file.
- </para>
- <para>
- The default value is <c>false</c>, i.e. internal logging is not
- disabled.
- </para>
- </remarks>
- <example>
- The following example disables internal logging using the
- application configuration file :
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net.Internal.Quiet" value="true"/>
- </appSettings>
- </configuration>
- </code>
- </example>
- </member>
- <member name="P:log4net.Util.LogLog.IsDebugEnabled">
- <summary>
- Test if LogLog.Debug is enabled for output.
- </summary>
- <value>
- <c>true</c> if Debug is enabled
- </value>
- <remarks>
- <para>
- Test if LogLog.Debug is enabled for output.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.LogLog.IsWarnEnabled">
- <summary>
- Test if LogLog.Warn is enabled for output.
- </summary>
- <value>
- <c>true</c> if Warn is enabled
- </value>
- <remarks>
- <para>
- Test if LogLog.Warn is enabled for output.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.LogLog.IsErrorEnabled">
- <summary>
- Test if LogLog.Error is enabled for output.
- </summary>
- <value>
- <c>true</c> if Error is enabled
- </value>
- <remarks>
- <para>
- Test if LogLog.Error is enabled for output.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.NativeError">
- <summary>
- Represents a native error code and message.
- </summary>
- <remarks>
- <para>
- Represents a Win32 platform native error.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.NativeError.#ctor(System.Int32,System.String)">
- <summary>
- Create an instance of the <see cref="T:log4net.Util.NativeError"/> class with the specified
- error number and message.
- </summary>
- <param name="number">The number of the native error.</param>
- <param name="message">The message of the native error.</param>
- <remarks>
- <para>
- Create an instance of the <see cref="T:log4net.Util.NativeError"/> class with the specified
- error number and message.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NativeError.GetLastError">
- <summary>
- Create a new instance of the <see cref="T:log4net.Util.NativeError"/> class for the last Windows error.
- </summary>
- <returns>
- An instance of the <see cref="T:log4net.Util.NativeError"/> class for the last windows error.
- </returns>
- <remarks>
- <para>
- The message for the <see cref="M:System.Runtime.InteropServices.Marshal.GetLastWin32Error"/> error number is lookup up using the
- native Win32 <c>FormatMessage</c> function.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NativeError.GetError(System.Int32)">
- <summary>
- Create a new instance of the <see cref="T:log4net.Util.NativeError"/> class.
- </summary>
- <param name="number">the error number for the native error</param>
- <returns>
- An instance of the <see cref="T:log4net.Util.NativeError"/> class for the specified
- error number.
- </returns>
- <remarks>
- <para>
- The message for the specified error number is lookup up using the
- native Win32 <c>FormatMessage</c> function.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NativeError.GetErrorMessage(System.Int32)">
- <summary>
- Retrieves the message corresponding with a Win32 message identifier.
- </summary>
- <param name="messageId">Message identifier for the requested message.</param>
- <returns>
- The message corresponding with the specified message identifier.
- </returns>
- <remarks>
- <para>
- The message will be searched for in system message-table resource(s)
- using the native <c>FormatMessage</c> function.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NativeError.ToString">
- <summary>
- Return error information string
- </summary>
- <returns>error information string</returns>
- <remarks>
- <para>
- Return error information string
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NativeError.FormatMessage(System.Int32,System.IntPtr@,System.Int32,System.Int32,System.String@,System.Int32,System.IntPtr)">
- <summary>
- Formats a message string.
- </summary>
- <param name="dwFlags">Formatting options, and how to interpret the <paramref name="lpSource"/> parameter.</param>
- <param name="lpSource">Location of the message definition.</param>
- <param name="dwMessageId">Message identifier for the requested message.</param>
- <param name="dwLanguageId">Language identifier for the requested message.</param>
- <param name="lpBuffer">If <paramref name="dwFlags"/> includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the <c>LocalAlloc</c> function, and places the pointer to the buffer at the address specified in <paramref name="lpBuffer"/>.</param>
- <param name="nSize">If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies the maximum number of TCHARs that can be stored in the output buffer. If FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies the minimum number of TCHARs to allocate for an output buffer.</param>
- <param name="Arguments">Pointer to an array of values that are used as insert values in the formatted message.</param>
- <remarks>
- <para>
- The function requires a message definition as input. The message definition can come from a
- buffer passed into the function. It can come from a message table resource in an
- already-loaded module. Or the caller can ask the function to search the system's message
- table resource(s) for the message definition. The function finds the message definition
- in a message table resource based on a message identifier and a language identifier.
- The function copies the formatted message text to an output buffer, processing any embedded
- insert sequences if requested.
- </para>
- <para>
- To prevent the usage of unsafe code, this stub does not support inserting values in the formatted message.
- </para>
- </remarks>
- <returns>
- <para>
- If the function succeeds, the return value is the number of TCHARs stored in the output
- buffer, excluding the terminating null character.
- </para>
- <para>
- If the function fails, the return value is zero. To get extended error information,
- call <see cref="M:System.Runtime.InteropServices.Marshal.GetLastWin32Error"/>.
- </para>
- </returns>
- </member>
- <member name="P:log4net.Util.NativeError.Number">
- <summary>
- Gets the number of the native error.
- </summary>
- <value>
- The number of the native error.
- </value>
- <remarks>
- <para>
- Gets the number of the native error.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.NativeError.Message">
- <summary>
- Gets the message of the native error.
- </summary>
- <value>
- The message of the native error.
- </value>
- <remarks>
- <para>
- </para>
- Gets the message of the native error.
- </remarks>
- </member>
- <member name="T:log4net.Util.NullDictionaryEnumerator">
- <summary>
- An always empty <see cref="T:System.Collections.IDictionaryEnumerator"/>.
- </summary>
- <remarks>
- <para>
- A singleton implementation of the <see cref="T:System.Collections.IDictionaryEnumerator"/> over a collection
- that is empty and not modifiable.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.NullDictionaryEnumerator.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.NullDictionaryEnumerator"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to enforce the singleton pattern.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullDictionaryEnumerator.MoveNext">
- <summary>
- Test if the enumerator can advance, if so advance.
- </summary>
- <returns><c>false</c> as the <see cref="T:log4net.Util.NullDictionaryEnumerator"/> cannot advance.</returns>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="M:log4net.Util.NullDictionaryEnumerator.MoveNext"/>
- will always return <c>false</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullDictionaryEnumerator.Reset">
- <summary>
- Resets the enumerator back to the start.
- </summary>
- <remarks>
- <para>
- As the enumerator is over an empty collection <see cref="M:log4net.Util.NullDictionaryEnumerator.Reset"/> does nothing.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.NullDictionaryEnumerator.s_instance">
- <summary>
- The singleton instance of the <see cref="T:log4net.Util.NullDictionaryEnumerator"/>.
- </summary>
- </member>
- <member name="P:log4net.Util.NullDictionaryEnumerator.Instance">
- <summary>
- Gets the singleton instance of the <see cref="T:log4net.Util.NullDictionaryEnumerator"/>.
- </summary>
- <returns>The singleton instance of the <see cref="T:log4net.Util.NullDictionaryEnumerator"/>.</returns>
- <remarks>
- <para>
- Gets the singleton instance of the <see cref="T:log4net.Util.NullDictionaryEnumerator"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.NullDictionaryEnumerator.Current">
- <summary>
- Gets the current object from the enumerator.
- </summary>
- <remarks>
- Throws an <see cref="T:System.InvalidOperationException"/> because the
- <see cref="T:log4net.Util.NullDictionaryEnumerator"/> never has a current value.
- </remarks>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- will throw an <see cref="T:System.InvalidOperationException"/>.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">The collection is empty and <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- cannot be positioned over a valid location.</exception>
- </member>
- <member name="P:log4net.Util.NullDictionaryEnumerator.Key">
- <summary>
- Gets the current key from the enumerator.
- </summary>
- <remarks>
- Throws an exception because the <see cref="T:log4net.Util.NullDictionaryEnumerator"/>
- never has a current value.
- </remarks>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="P:log4net.Util.NullDictionaryEnumerator.Key"/>
- will throw an <see cref="T:System.InvalidOperationException"/>.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">The collection is empty and <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- cannot be positioned over a valid location.</exception>
- </member>
- <member name="P:log4net.Util.NullDictionaryEnumerator.Value">
- <summary>
- Gets the current value from the enumerator.
- </summary>
- <value>The current value from the enumerator.</value>
- <remarks>
- Throws an <see cref="T:System.InvalidOperationException"/> because the
- <see cref="T:log4net.Util.NullDictionaryEnumerator"/> never has a current value.
- </remarks>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="P:log4net.Util.NullDictionaryEnumerator.Value"/>
- will throw an <see cref="T:System.InvalidOperationException"/>.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">The collection is empty and <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- cannot be positioned over a valid location.</exception>
- </member>
- <member name="P:log4net.Util.NullDictionaryEnumerator.Entry">
- <summary>
- Gets the current entry from the enumerator.
- </summary>
- <remarks>
- Throws an <see cref="T:System.InvalidOperationException"/> because the
- <see cref="T:log4net.Util.NullDictionaryEnumerator"/> never has a current entry.
- </remarks>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="P:log4net.Util.NullDictionaryEnumerator.Entry"/>
- will throw an <see cref="T:System.InvalidOperationException"/>.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">The collection is empty and <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- cannot be positioned over a valid location.</exception>
- </member>
- <member name="T:log4net.Util.NullEnumerator">
- <summary>
- An always empty <see cref="T:System.Collections.IEnumerator"/>.
- </summary>
- <remarks>
- <para>
- A singleton implementation of the <see cref="T:System.Collections.IEnumerator"/> over a collection
- that is empty and not modifiable.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.NullEnumerator.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.NullEnumerator"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to enforce the singleton pattern.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullEnumerator.MoveNext">
- <summary>
- Test if the enumerator can advance, if so advance
- </summary>
- <returns><c>false</c> as the <see cref="T:log4net.Util.NullEnumerator"/> cannot advance.</returns>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="M:log4net.Util.NullEnumerator.MoveNext"/>
- will always return <c>false</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullEnumerator.Reset">
- <summary>
- Resets the enumerator back to the start.
- </summary>
- <remarks>
- <para>
- As the enumerator is over an empty collection <see cref="M:log4net.Util.NullEnumerator.Reset"/> does nothing.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.NullEnumerator.s_instance">
- <summary>
- The singleton instance of the <see cref="T:log4net.Util.NullEnumerator"/>.
- </summary>
- </member>
- <member name="P:log4net.Util.NullEnumerator.Instance">
- <summary>
- Get the singleton instance of the <see cref="T:log4net.Util.NullEnumerator"/>.
- </summary>
- <returns>The singleton instance of the <see cref="T:log4net.Util.NullEnumerator"/>.</returns>
- <remarks>
- <para>
- Gets the singleton instance of the <see cref="T:log4net.Util.NullEnumerator"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.NullEnumerator.Current">
- <summary>
- Gets the current object from the enumerator.
- </summary>
- <remarks>
- Throws an <see cref="T:System.InvalidOperationException"/> because the
- <see cref="T:log4net.Util.NullDictionaryEnumerator"/> never has a current value.
- </remarks>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="P:log4net.Util.NullEnumerator.Current"/>
- will throw an <see cref="T:System.InvalidOperationException"/>.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">The collection is empty and <see cref="P:log4net.Util.NullEnumerator.Current"/>
- cannot be positioned over a valid location.</exception>
- </member>
- <member name="T:log4net.Util.NullSecurityContext">
- <summary>
- A SecurityContext used when a SecurityContext is not required
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.Util.NullSecurityContext"/> is a no-op implementation of the
- <see cref="T:log4net.Core.SecurityContext"/> base class. It is used where a <see cref="T:log4net.Core.SecurityContext"/>
- is required but one has not been provided.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.NullSecurityContext.Instance">
- <summary>
- Singleton instance of <see cref="T:log4net.Util.NullSecurityContext"/>
- </summary>
- <remarks>
- <para>
- Singleton instance of <see cref="T:log4net.Util.NullSecurityContext"/>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullSecurityContext.#ctor">
- <summary>
- Private constructor
- </summary>
- <remarks>
- <para>
- Private constructor for singleton pattern.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullSecurityContext.Impersonate(System.Object)">
- <summary>
- Impersonate this SecurityContext
- </summary>
- <param name="state">State supplied by the caller</param>
- <returns><c>null</c></returns>
- <remarks>
- <para>
- No impersonation is done and <c>null</c> is always returned.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.OnlyOnceErrorHandler">
- <summary>
- Implements log4net's default error handling policy which consists
- of emitting a message for the first error in an appender and
- ignoring all subsequent errors.
- </summary>
- <remarks>
- <para>
- The error message is printed on the standard error output stream.
- </para>
- <para>
- This policy aims at protecting an otherwise working application
- from being flooded with error messages when logging fails.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.OnlyOnceErrorHandler.#ctor">
- <summary>
- Default Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.OnlyOnceErrorHandler"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OnlyOnceErrorHandler.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="prefix">The prefix to use for each message.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.OnlyOnceErrorHandler"/> class
- with the specified prefix.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OnlyOnceErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)">
- <summary>
- Log an Error
- </summary>
- <param name="message">The error message.</param>
- <param name="e">The exception.</param>
- <param name="errorCode">The internal error code.</param>
- <remarks>
- <para>
- Prints the message and the stack trace of the exception on the standard
- error output stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OnlyOnceErrorHandler.Error(System.String,System.Exception)">
- <summary>
- Log an Error
- </summary>
- <param name="message">The error message.</param>
- <param name="e">The exception.</param>
- <remarks>
- <para>
- Prints the message and the stack trace of the exception on the standard
- error output stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OnlyOnceErrorHandler.Error(System.String)">
- <summary>
- Log an error
- </summary>
- <param name="message">The error message.</param>
- <remarks>
- <para>
- Print a the error message passed as parameter on the standard
- error output stream.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.OnlyOnceErrorHandler.m_firstTime">
- <summary>
- Flag to indicate if it is the first error
- </summary>
- </member>
- <member name="F:log4net.Util.OnlyOnceErrorHandler.m_prefix">
- <summary>
- String to prefix each message with
- </summary>
- </member>
- <member name="P:log4net.Util.OnlyOnceErrorHandler.IsEnabled">
- <summary>
- Is error logging enabled
- </summary>
- <remarks>
- <para>
- Is error logging enabled. Logging is only enabled for the
- first error delivered to the <see cref="T:log4net.Util.OnlyOnceErrorHandler"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.OptionConverter">
- <summary>
- A convenience class to convert property values to specific types.
- </summary>
- <remarks>
- <para>
- Utility functions for converting types and parsing values.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.OptionConverter.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.OptionConverter"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.ToBoolean(System.String,System.Boolean)">
- <summary>
- Converts a string to a <see cref="T:System.Boolean"/> value.
- </summary>
- <param name="argValue">String to convert.</param>
- <param name="defaultValue">The default value.</param>
- <returns>The <see cref="T:System.Boolean"/> value of <paramref name="argValue"/>.</returns>
- <remarks>
- <para>
- If <paramref name="argValue"/> is "true", then <c>true</c> is returned.
- If <paramref name="argValue"/> is "false", then <c>false</c> is returned.
- Otherwise, <paramref name="defaultValue"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.ToFileSize(System.String,System.Int64)">
- <summary>
- Parses a file size into a number.
- </summary>
- <param name="argValue">String to parse.</param>
- <param name="defaultValue">The default value.</param>
- <returns>The <see cref="T:System.Int64"/> value of <paramref name="argValue"/>.</returns>
- <remarks>
- <para>
- Parses a file size of the form: number[KB|MB|GB] into a
- long value. It is scaled with the appropriate multiplier.
- </para>
- <para>
- <paramref name="defaultValue"/> is returned when <paramref name="argValue"/>
- cannot be converted to a <see cref="T:System.Int64"/> value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.ConvertStringTo(System.Type,System.String)">
- <summary>
- Converts a string to an object.
- </summary>
- <param name="target">The target type to convert to.</param>
- <param name="txt">The string to convert to an object.</param>
- <returns>
- The object converted from a string or <c>null</c> when the
- conversion failed.
- </returns>
- <remarks>
- <para>
- Converts a string to an object. Uses the converter registry to try
- to convert the string value into the specified target type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.CanConvertTypeTo(System.Type,System.Type)">
- <summary>
- Checks if there is an appropriate type conversion from the source type to the target type.
- </summary>
- <param name="sourceType">The type to convert from.</param>
- <param name="targetType">The type to convert to.</param>
- <returns><c>true</c> if there is a conversion from the source type to the target type.</returns>
- <remarks>
- Checks if there is an appropriate type conversion from the source type to the target type.
- <para>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.ConvertTypeTo(System.Object,System.Type)">
- <summary>
- Converts an object to the target type.
- </summary>
- <param name="sourceInstance">The object to convert to the target type.</param>
- <param name="targetType">The type to convert to.</param>
- <returns>The converted object.</returns>
- <remarks>
- <para>
- Converts an object to the target type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.InstantiateByClassName(System.String,System.Type,System.Object)">
- <summary>
- Instantiates an object given a class name.
- </summary>
- <param name="className">The fully qualified class name of the object to instantiate.</param>
- <param name="superClass">The class to which the new object should belong.</param>
- <param name="defaultValue">The object to return in case of non-fulfillment.</param>
- <returns>
- An instance of the <paramref name="className"/> or <paramref name="defaultValue"/>
- if the object could not be instantiated.
- </returns>
- <remarks>
- <para>
- Checks that the <paramref name="className"/> is a subclass of
- <paramref name="superClass"/>. If that test fails or the object could
- not be instantiated, then <paramref name="defaultValue"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.SubstituteVariables(System.String,System.Collections.IDictionary)">
- <summary>
- Performs variable substitution in string <paramref name="val"/> from the
- values of keys found in <paramref name="props"/>.
- </summary>
- <param name="value">The string on which variable substitution is performed.</param>
- <param name="props">The dictionary to use to lookup variables.</param>
- <returns>The result of the substitutions.</returns>
- <remarks>
- <para>
- The variable substitution delimiters are <b>${</b> and <b>}</b>.
- </para>
- <para>
- For example, if props contains <c>key=value</c>, then the call
- </para>
- <para>
- <code lang="C#">
- string s = OptionConverter.SubstituteVariables("Value of key is ${key}.");
- </code>
- </para>
- <para>
- will set the variable <c>s</c> to "Value of key is value.".
- </para>
- <para>
- If no value could be found for the specified key, then substitution
- defaults to an empty string.
- </para>
- <para>
- For example, if system properties contains no value for the key
- "nonExistentKey", then the call
- </para>
- <para>
- <code lang="C#">
- string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]");
- </code>
- </para>
- <para>
- will set <s>s</s> to "Value of nonExistentKey is []".
- </para>
- <para>
- An Exception is thrown if <paramref name="value"/> contains a start
- delimiter "${" which is not balanced by a stop delimiter "}".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.ParseEnum(System.Type,System.String,System.Boolean)">
- <summary>
- Converts the string representation of the name or numeric value of one or
- more enumerated constants to an equivalent enumerated object.
- </summary>
- <param name="enumType">The type to convert to.</param>
- <param name="value">The enum string value.</param>
- <param name="ignoreCase">If <c>true</c>, ignore case; otherwise, regard case.</param>
- <returns>An object of type <paramref name="enumType" /> whose value is represented by <paramref name="value" />.</returns>
- </member>
- <member name="T:log4net.Util.PatternParser">
- <summary>
- Most of the work of the <see cref="T:log4net.Layout.PatternLayout"/> class
- is delegated to the PatternParser class.
- </summary>
- <remarks>
- <para>
- The <c>PatternParser</c> processes a pattern string and
- returns a chain of <see cref="T:log4net.Util.PatternConverter"/> objects.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.PatternParser.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="pattern">The pattern to parse.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.PatternParser"/> class
- with the specified pattern string.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternParser.Parse">
- <summary>
- Parses the pattern into a chain of pattern converters.
- </summary>
- <returns>The head of a chain of pattern converters.</returns>
- <remarks>
- <para>
- Parses the pattern into a chain of pattern converters.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternParser.BuildCache">
- <summary>
- Build the unified cache of converters from the static and instance maps
- </summary>
- <returns>the list of all the converter names</returns>
- <remarks>
- <para>
- Build the unified cache of converters from the static and instance maps
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternParser.ParseInternal(System.String,System.String[])">
- <summary>
- Internal method to parse the specified pattern to find specified matches
- </summary>
- <param name="pattern">the pattern to parse</param>
- <param name="matches">the converter names to match in the pattern</param>
- <remarks>
- <para>
- The matches param must be sorted such that longer strings come before shorter ones.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternParser.ProcessLiteral(System.String)">
- <summary>
- Process a parsed literal
- </summary>
- <param name="text">the literal text</param>
- </member>
- <member name="M:log4net.Util.PatternParser.ProcessConverter(System.String,System.String,log4net.Util.FormattingInfo)">
- <summary>
- Process a parsed converter pattern
- </summary>
- <param name="converterName">the name of the converter</param>
- <param name="option">the optional option for the converter</param>
- <param name="formattingInfo">the formatting info for the converter</param>
- </member>
- <member name="M:log4net.Util.PatternParser.AddConverter(log4net.Util.PatternConverter)">
- <summary>
- Resets the internal state of the parser and adds the specified pattern converter
- to the chain.
- </summary>
- <param name="pc">The pattern converter to add.</param>
- </member>
- <member name="F:log4net.Util.PatternParser.m_head">
- <summary>
- The first pattern converter in the chain
- </summary>
- </member>
- <member name="F:log4net.Util.PatternParser.m_tail">
- <summary>
- the last pattern converter in the chain
- </summary>
- </member>
- <member name="F:log4net.Util.PatternParser.m_pattern">
- <summary>
- The pattern
- </summary>
- </member>
- <member name="F:log4net.Util.PatternParser.m_patternConverters">
- <summary>
- Internal map of converter identifiers to converter types
- </summary>
- <remarks>
- <para>
- This map overrides the static s_globalRulesRegistry map.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternParser.PatternConverters">
- <summary>
- Get the converter registry used by this parser
- </summary>
- <value>
- The converter registry used by this parser
- </value>
- <remarks>
- <para>
- Get the converter registry used by this parser
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternParser.StringLengthComparer">
- <summary>
- Sort strings by length
- </summary>
- <remarks>
- <para>
- <see cref="T:System.Collections.IComparer"/> that orders strings by string length.
- The longest strings are placed first
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternString">
- <summary>
- This class implements a patterned string.
- </summary>
- <remarks>
- <para>
- This string has embedded patterns that are resolved and expanded
- when the string is formatted.
- </para>
- <para>
- This class functions similarly to the <see cref="T:log4net.Layout.PatternLayout"/>
- in that it accepts a pattern and renders it to a string. Unlike the
- <see cref="T:log4net.Layout.PatternLayout"/> however the <c>PatternString</c>
- does not render the properties of a specific <see cref="T:log4net.Core.LoggingEvent"/> but
- of the process in general.
- </para>
- <para>
- The recognized conversion pattern names are:
- </para>
- <list type="table">
- <listheader>
- <term>Conversion Pattern Name</term>
- <description>Effect</description>
- </listheader>
- <item>
- <term>appdomain</term>
- <description>
- <para>
- Used to output the friendly name of the current AppDomain.
- </para>
- </description>
- </item>
- <item>
- <term>date</term>
- <description>
- <para>
- Used to output the date of the logging event in the local time zone.
- To output the date in universal time use the <c>%utcdate</c> pattern.
- The date conversion
- specifier may be followed by a <i>date format specifier</i> enclosed
- between braces. For example, <b>%date{HH:mm:ss,fff}</b> or
- <b>%date{dd MMM yyyy HH:mm:ss,fff}</b>. If no date format specifier is
- given then ISO8601 format is
- assumed (<see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>).
- </para>
- <para>
- The date format specifier admits the same syntax as the
- time pattern string of the <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- <para>
- For better results it is recommended to use the log4net date
- formatters. These can be specified using one of the strings
- "ABSOLUTE", "DATE" and "ISO8601" for specifying
- <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/>,
- <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> and respectively
- <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>. For example,
- <b>%date{ISO8601}</b> or <b>%date{ABSOLUTE}</b>.
- </para>
- <para>
- These dedicated date formatters perform significantly
- better than <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- </description>
- </item>
- <item>
- <term>env</term>
- <description>
- <para>
- Used to output the a specific environment variable. The key to
- lookup must be specified within braces and directly following the
- pattern specifier, e.g. <b>%env{COMPUTERNAME}</b> would include the value
- of the <c>COMPUTERNAME</c> environment variable.
- </para>
- <para>
- The <c>env</c> pattern is not supported on the .NET Compact Framework.
- </para>
- </description>
- </item>
- <item>
- <term>identity</term>
- <description>
- <para>
- Used to output the user name for the currently active user
- (Principal.Identity.Name).
- </para>
- </description>
- </item>
- <item>
- <term>newline</term>
- <description>
- <para>
- Outputs the platform dependent line separator character or
- characters.
- </para>
- <para>
- This conversion pattern name offers the same performance as using
- non-portable line separator strings such as "\n", or "\r\n".
- Thus, it is the preferred way of specifying a line separator.
- </para>
- </description>
- </item>
- <item>
- <term>processid</term>
- <description>
- <para>
- Used to output the system process ID for the current process.
- </para>
- </description>
- </item>
- <item>
- <term>property</term>
- <description>
- <para>
- Used to output a specific context property. The key to
- lookup must be specified within braces and directly following the
- pattern specifier, e.g. <b>%property{user}</b> would include the value
- from the property that is keyed by the string 'user'. Each property value
- that is to be included in the log must be specified separately.
- Properties are stored in logging contexts. By default
- the <c>log4net:HostName</c> property is set to the name of machine on
- which the event was originally logged.
- </para>
- <para>
- If no key is specified, e.g. <b>%property</b> then all the keys and their
- values are printed in a comma separated list.
- </para>
- <para>
- The properties of an event are combined from a number of different
- contexts. These are listed below in the order in which they are searched.
- </para>
- <list type="definition">
- <item>
- <term>the thread properties</term>
- <description>
- The <see cref="P:log4net.ThreadContext.Properties"/> that are set on the current
- thread. These properties are shared by all events logged on this thread.
- </description>
- </item>
- <item>
- <term>the global properties</term>
- <description>
- The <see cref="P:log4net.GlobalContext.Properties"/> that are set globally. These
- properties are shared by all the threads in the AppDomain.
- </description>
- </item>
- </list>
- </description>
- </item>
- <item>
- <term>random</term>
- <description>
- <para>
- Used to output a random string of characters. The string is made up of
- uppercase letters and numbers. By default the string is 4 characters long.
- The length of the string can be specified within braces directly following the
- pattern specifier, e.g. <b>%random{8}</b> would output an 8 character string.
- </para>
- </description>
- </item>
- <item>
- <term>username</term>
- <description>
- <para>
- Used to output the WindowsIdentity for the currently
- active user.
- </para>
- </description>
- </item>
- <item>
- <term>utcdate</term>
- <description>
- <para>
- Used to output the date of the logging event in universal time.
- The date conversion
- specifier may be followed by a <i>date format specifier</i> enclosed
- between braces. For example, <b>%utcdate{HH:mm:ss,fff}</b> or
- <b>%utcdate{dd MMM yyyy HH:mm:ss,fff}</b>. If no date format specifier is
- given then ISO8601 format is
- assumed (<see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>).
- </para>
- <para>
- The date format specifier admits the same syntax as the
- time pattern string of the <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- <para>
- For better results it is recommended to use the log4net date
- formatters. These can be specified using one of the strings
- "ABSOLUTE", "DATE" and "ISO8601" for specifying
- <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/>,
- <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> and respectively
- <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>. For example,
- <b>%utcdate{ISO8601}</b> or <b>%utcdate{ABSOLUTE}</b>.
- </para>
- <para>
- These dedicated date formatters perform significantly
- better than <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- </description>
- </item>
- <item>
- <term>%</term>
- <description>
- <para>
- The sequence %% outputs a single percent sign.
- </para>
- </description>
- </item>
- </list>
- <para>
- Additional pattern converters may be registered with a specific <see cref="T:log4net.Util.PatternString"/>
- instance using <see cref="M:log4net.Util.PatternString.AddConverter(log4net.Util.PatternString.ConverterInfo)"/> or
- <see cref="M:log4net.Util.PatternString.AddConverter(System.String,System.Type)"/>.
- </para>
- <para>
- See the <see cref="T:log4net.Layout.PatternLayout"/> for details on the
- <i>format modifiers</i> supported by the patterns.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.PatternString.s_globalRulesRegistry">
- <summary>
- Internal map of converter identifiers to converter types.
- </summary>
- </member>
- <member name="F:log4net.Util.PatternString.m_pattern">
- <summary>
- the pattern
- </summary>
- </member>
- <member name="F:log4net.Util.PatternString.m_head">
- <summary>
- the head of the pattern converter chain
- </summary>
- </member>
- <member name="F:log4net.Util.PatternString.m_instanceRulesRegistry">
- <summary>
- patterns defined on this PatternString only
- </summary>
- </member>
- <member name="M:log4net.Util.PatternString.#cctor">
- <summary>
- Initialize the global registry
- </summary>
- </member>
- <member name="M:log4net.Util.PatternString.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initialize a new instance of <see cref="T:log4net.Util.PatternString"/>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.#ctor(System.String)">
- <summary>
- Constructs a PatternString
- </summary>
- <param name="pattern">The pattern to use with this PatternString</param>
- <remarks>
- <para>
- Initialize a new instance of <see cref="T:log4net.Util.PatternString"/> with the pattern specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.ActivateOptions">
- <summary>
- Initialize object options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Util.PatternString.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Util.PatternString.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Util.PatternString.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.CreatePatternParser(System.String)">
- <summary>
- Create the <see cref="T:log4net.Util.PatternParser"/> used to parse the pattern
- </summary>
- <param name="pattern">the pattern to parse</param>
- <returns>The <see cref="T:log4net.Util.PatternParser"/></returns>
- <remarks>
- <para>
- Returns PatternParser used to parse the conversion string. Subclasses
- may override this to return a subclass of PatternParser which recognize
- custom conversion pattern name.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.Format(System.IO.TextWriter)">
- <summary>
- Produces a formatted string as specified by the conversion pattern.
- </summary>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <remarks>
- <para>
- Format the pattern to the <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.Format">
- <summary>
- Format the pattern as a string
- </summary>
- <returns>the pattern formatted as a string</returns>
- <remarks>
- <para>
- Format the pattern to a string.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.AddConverter(log4net.Util.PatternString.ConverterInfo)">
- <summary>
- Add a converter to this PatternString
- </summary>
- <param name="converterInfo">the converter info</param>
- <remarks>
- <para>
- This version of the method is used by the configurator.
- Programmatic users should use the alternative <see cref="M:log4net.Util.PatternString.AddConverter(System.String,System.Type)"/> method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.AddConverter(System.String,System.Type)">
- <summary>
- Add a converter to this PatternString
- </summary>
- <param name="name">the name of the conversion pattern for this converter</param>
- <param name="type">the type of the converter</param>
- <remarks>
- <para>
- Add a converter to this PatternString
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternString.ConversionPattern">
- <summary>
- Gets or sets the pattern formatting string
- </summary>
- <value>
- The pattern formatting string
- </value>
- <remarks>
- <para>
- The <b>ConversionPattern</b> option. This is the string which
- controls formatting and consists of a mix of literal content and
- conversion specifiers.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternString.ConverterInfo">
- <summary>
- Wrapper class used to map converter names to converter types
- </summary>
- <remarks>
- <para>
- Wrapper class used to map converter names to converter types
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.ConverterInfo.#ctor">
- <summary>
- default constructor
- </summary>
- </member>
- <member name="P:log4net.Util.PatternString.ConverterInfo.Name">
- <summary>
- Gets or sets the name of the conversion pattern
- </summary>
- <value>
- The name of the conversion pattern
- </value>
- <remarks>
- <para>
- Gets or sets the name of the conversion pattern
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternString.ConverterInfo.Type">
- <summary>
- Gets or sets the type of the converter
- </summary>
- <value>
- The type of the converter
- </value>
- <remarks>
- <para>
- Gets or sets the type of the converter
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PropertiesDictionary">
- <summary>
- String keyed object map.
- </summary>
- <remarks>
- <para>
- While this collection is serializable only member
- objects that are serializable will
- be serialized along with this collection.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Util.ReadOnlyPropertiesDictionary">
- <summary>
- String keyed object map that is read only.
- </summary>
- <remarks>
- <para>
- This collection is readonly and cannot be modified.
- </para>
- <para>
- While this collection is serializable only member
- objects that are serializable will
- be serialized along with this collection.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Util.ReadOnlyPropertiesDictionary.m_hashtable">
- <summary>
- The Hashtable used to store the properties data
- </summary>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ReadOnlyPropertiesDictionary"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.#ctor(log4net.Util.ReadOnlyPropertiesDictionary)">
- <summary>
- Copy Constructor
- </summary>
- <param name="propertiesDictionary">properties to copy</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ReadOnlyPropertiesDictionary"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Deserialization constructor
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data.</param>
- <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ReadOnlyPropertiesDictionary"/> class
- with serialized data.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.GetKeys">
- <summary>
- Gets the key names.
- </summary>
- <returns>An array of all the keys.</returns>
- <remarks>
- <para>
- Gets the key names.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.Contains(System.String)">
- <summary>
- Test if the dictionary contains a specified key
- </summary>
- <param name="key">the key to look for</param>
- <returns>true if the dictionary contains the specified key</returns>
- <remarks>
- <para>
- Test if the dictionary contains a specified key
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Serializes this object into the <see cref="T:System.Runtime.Serialization.SerializationInfo"/> provided.
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> to populate with data.</param>
- <param name="context">The destination for this serialization.</param>
- <remarks>
- <para>
- Serializes this object into the <see cref="T:System.Runtime.Serialization.SerializationInfo"/> provided.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#GetEnumerator">
- <summary>
- See <see cref="M:System.Collections.IDictionary.GetEnumerator"/>
- </summary>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Remove(System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Remove(System.Object)"/>
- </summary>
- <param name="key"></param>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Contains(System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Contains(System.Object)"/>
- </summary>
- <param name="key"></param>
- <returns></returns>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.Clear">
- <summary>
- Remove all properties from the properties collection
- </summary>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Add(System.Object,System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Add(System.Object,System.Object)"/>
- </summary>
- <param name="key"></param>
- <param name="value"></param>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#ICollection#CopyTo(System.Array,System.Int32)">
- <summary>
- See <see cref="M:System.Collections.ICollection.CopyTo(System.Array,System.Int32)"/>
- </summary>
- <param name="array"></param>
- <param name="index"></param>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IEnumerable#GetEnumerator">
- <summary>
- See <see cref="M:System.Collections.IEnumerable.GetEnumerator"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.Item(System.String)">
- <summary>
- Gets or sets the value of the property with the specified key.
- </summary>
- <value>
- The value of the property with the specified key.
- </value>
- <param name="key">The key of the property to get or set.</param>
- <remarks>
- <para>
- The property value will only be serialized if it is serializable.
- If it cannot be serialized it will be silently ignored if
- a serialization operation is performed.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.InnerHashtable">
- <summary>
- The hashtable used to store the properties
- </summary>
- <value>
- The internal collection used to store the properties
- </value>
- <remarks>
- <para>
- The hashtable used to store the properties
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#IsReadOnly">
- <summary>
- See <see cref="P:System.Collections.IDictionary.IsReadOnly"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Item(System.Object)">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Item(System.Object)"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Values">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Values"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Keys">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Keys"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#IsFixedSize">
- <summary>
- See <see cref="P:System.Collections.IDictionary.IsFixedSize"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#ICollection#IsSynchronized">
- <summary>
- See <see cref="P:System.Collections.ICollection.IsSynchronized"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.Count">
- <summary>
- The number of properties in this collection
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#ICollection#SyncRoot">
- <summary>
- See <see cref="P:System.Collections.ICollection.SyncRoot"/>
- </summary>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.PropertiesDictionary"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.#ctor(log4net.Util.ReadOnlyPropertiesDictionary)">
- <summary>
- Constructor
- </summary>
- <param name="propertiesDictionary">properties to copy</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.PropertiesDictionary"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.PropertiesDictionary"/> class
- with serialized data.
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data.</param>
- <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
- <remarks>
- <para>
- Because this class is sealed the serialization constructor is private.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.Remove(System.String)">
- <summary>
- Remove the entry with the specified key from this dictionary
- </summary>
- <param name="key">the key for the entry to remove</param>
- <remarks>
- <para>
- Remove the entry with the specified key from this dictionary
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#GetEnumerator">
- <summary>
- See <see cref="M:System.Collections.IDictionary.GetEnumerator"/>
- </summary>
- <returns>an enumerator</returns>
- <remarks>
- <para>
- Returns a <see cref="T:System.Collections.IDictionaryEnumerator"/> over the contest of this collection.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Remove(System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Remove(System.Object)"/>
- </summary>
- <param name="key">the key to remove</param>
- <remarks>
- <para>
- Remove the entry with the specified key from this dictionary
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Contains(System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Contains(System.Object)"/>
- </summary>
- <param name="key">the key to lookup in the collection</param>
- <returns><c>true</c> if the collection contains the specified key</returns>
- <remarks>
- <para>
- Test if this collection contains a specified key.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.Clear">
- <summary>
- Remove all properties from the properties collection
- </summary>
- <remarks>
- <para>
- Remove all properties from the properties collection
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Add(System.Object,System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Add(System.Object,System.Object)"/>
- </summary>
- <param name="key">the key</param>
- <param name="value">the value to store for the key</param>
- <remarks>
- <para>
- Store a value for the specified <see cref="T:System.String"/> <paramref name="key"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentException">Thrown if the <paramref name="key"/> is not a string</exception>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#ICollection#CopyTo(System.Array,System.Int32)">
- <summary>
- See <see cref="M:System.Collections.ICollection.CopyTo(System.Array,System.Int32)"/>
- </summary>
- <param name="array"></param>
- <param name="index"></param>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#IEnumerable#GetEnumerator">
- <summary>
- See <see cref="M:System.Collections.IEnumerable.GetEnumerator"/>
- </summary>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.Item(System.String)">
- <summary>
- Gets or sets the value of the property with the specified key.
- </summary>
- <value>
- The value of the property with the specified key.
- </value>
- <param name="key">The key of the property to get or set.</param>
- <remarks>
- <para>
- The property value will only be serialized if it is serializable.
- If it cannot be serialized it will be silently ignored if
- a serialization operation is performed.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#IsReadOnly">
- <summary>
- See <see cref="P:System.Collections.IDictionary.IsReadOnly"/>
- </summary>
- <value>
- <c>false</c>
- </value>
- <remarks>
- <para>
- This collection is modifiable. This property always
- returns <c>false</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Item(System.Object)">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Item(System.Object)"/>
- </summary>
- <value>
- The value for the key specified.
- </value>
- <remarks>
- <para>
- Get or set a value for the specified <see cref="T:System.String"/> <paramref name="key"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentException">Thrown if the <paramref name="key"/> is not a string</exception>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Values">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Values"/>
- </summary>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Keys">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Keys"/>
- </summary>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#IsFixedSize">
- <summary>
- See <see cref="P:System.Collections.IDictionary.IsFixedSize"/>
- </summary>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#ICollection#IsSynchronized">
- <summary>
- See <see cref="P:System.Collections.ICollection.IsSynchronized"/>
- </summary>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#ICollection#SyncRoot">
- <summary>
- See <see cref="P:System.Collections.ICollection.SyncRoot"/>
- </summary>
- </member>
- <member name="T:log4net.Util.ProtectCloseTextWriter">
- <summary>
- A <see cref="T:System.IO.TextWriter"/> that ignores the <see cref="M:log4net.Util.ProtectCloseTextWriter.Close"/> message
- </summary>
- <remarks>
- <para>
- This writer is used in special cases where it is necessary
- to protect a writer from being closed by a client.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.ProtectCloseTextWriter.#ctor(System.IO.TextWriter)">
- <summary>
- Constructor
- </summary>
- <param name="writer">the writer to actually write to</param>
- <remarks>
- <para>
- Create a new ProtectCloseTextWriter using a writer
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ProtectCloseTextWriter.Attach(System.IO.TextWriter)">
- <summary>
- Attach this instance to a different underlying <see cref="T:System.IO.TextWriter"/>
- </summary>
- <param name="writer">the writer to attach to</param>
- <remarks>
- <para>
- Attach this instance to a different underlying <see cref="T:System.IO.TextWriter"/>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ProtectCloseTextWriter.Close">
- <summary>
- Does not close the underlying output writer.
- </summary>
- <remarks>
- <para>
- Does not close the underlying output writer.
- This method does nothing.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ReaderWriterLock">
- <summary>
- Defines a lock that supports single writers and multiple readers
- </summary>
- <remarks>
- <para>
- <c>ReaderWriterLock</c> is used to synchronize access to a resource.
- At any given time, it allows either concurrent read access for
- multiple threads, or write access for a single thread. In a
- situation where a resource is changed infrequently, a
- <c>ReaderWriterLock</c> provides better throughput than a simple
- one-at-a-time lock, such as <see cref="T:System.Threading.Monitor"/>.
- </para>
- <para>
- If a platform does not support a <c>System.Threading.ReaderWriterLock</c>
- implementation then all readers and writers are serialized. Therefore
- the caller must not rely on multiple simultaneous readers.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.ReaderWriterLock.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ReaderWriterLock"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReaderWriterLock.AcquireReaderLock">
- <summary>
- Acquires a reader lock
- </summary>
- <remarks>
- <para>
- <see cref="M:log4net.Util.ReaderWriterLock.AcquireReaderLock"/> blocks if a different thread has the writer
- lock, or if at least one thread is waiting for the writer lock.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReaderWriterLock.ReleaseReaderLock">
- <summary>
- Decrements the lock count
- </summary>
- <remarks>
- <para>
- <see cref="M:log4net.Util.ReaderWriterLock.ReleaseReaderLock"/> decrements the lock count. When the count
- reaches zero, the lock is released.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReaderWriterLock.AcquireWriterLock">
- <summary>
- Acquires the writer lock
- </summary>
- <remarks>
- <para>
- This method blocks if another thread has a reader lock or writer lock.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReaderWriterLock.ReleaseWriterLock">
- <summary>
- Decrements the lock count on the writer lock
- </summary>
- <remarks>
- <para>
- ReleaseWriterLock decrements the writer lock count.
- When the count reaches zero, the writer lock is released.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ReusableStringWriter">
- <summary>
- A <see cref="T:System.IO.StringWriter"/> that can be <see cref="M:log4net.Util.ReusableStringWriter.Reset(System.Int32,System.Int32)"/> and reused
- </summary>
- <remarks>
- <para>
- A <see cref="T:System.IO.StringWriter"/> that can be <see cref="M:log4net.Util.ReusableStringWriter.Reset(System.Int32,System.Int32)"/> and reused.
- This uses a single buffer for string operations.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.ReusableStringWriter.#ctor(System.IFormatProvider)">
- <summary>
- Create an instance of <see cref="T:log4net.Util.ReusableStringWriter"/>
- </summary>
- <param name="formatProvider">the format provider to use</param>
- <remarks>
- <para>
- Create an instance of <see cref="T:log4net.Util.ReusableStringWriter"/>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReusableStringWriter.Dispose(System.Boolean)">
- <summary>
- Override Dispose to prevent closing of writer
- </summary>
- <param name="disposing">flag</param>
- <remarks>
- <para>
- Override Dispose to prevent closing of writer
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReusableStringWriter.Reset(System.Int32,System.Int32)">
- <summary>
- Reset this string writer so that it can be reused.
- </summary>
- <param name="maxCapacity">the maximum buffer capacity before it is trimmed</param>
- <param name="defaultSize">the default size to make the buffer</param>
- <remarks>
- <para>
- Reset this string writer so that it can be reused.
- The internal buffers are cleared and reset.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.SystemInfo">
- <summary>
- Utility class for system specific information.
- </summary>
- <remarks>
- <para>
- Utility class of static methods for system specific information.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Alexey Solofnenko</author>
- </member>
- <member name="M:log4net.Util.SystemInfo.#ctor">
- <summary>
- Private constructor to prevent instances.
- </summary>
- <remarks>
- <para>
- Only static methods are exposed from this type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.#cctor">
- <summary>
- Initialize default values for private static fields.
- </summary>
- <remarks>
- <para>
- Only static methods are exposed from this type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.AssemblyLocationInfo(System.Reflection.Assembly)">
- <summary>
- Gets the assembly location path for the specified assembly.
- </summary>
- <param name="myAssembly">The assembly to get the location for.</param>
- <returns>The location of the assembly.</returns>
- <remarks>
- <para>
- This method does not guarantee to return the correct path
- to the assembly. If only tries to give an indication as to
- where the assembly was loaded from.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.AssemblyQualifiedName(System.Type)">
- <summary>
- Gets the fully qualified name of the <see cref="T:System.Type"/>, including
- the name of the assembly from which the <see cref="T:System.Type"/> was
- loaded.
- </summary>
- <param name="type">The <see cref="T:System.Type"/> to get the fully qualified name for.</param>
- <returns>The fully qualified name for the <see cref="T:System.Type"/>.</returns>
- <remarks>
- <para>
- This is equivalent to the <c>Type.AssemblyQualifiedName</c> property,
- but this method works on the .NET Compact Framework 1.0 as well as
- the full .NET runtime.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.AssemblyShortName(System.Reflection.Assembly)">
- <summary>
- Gets the short name of the <see cref="T:System.Reflection.Assembly"/>.
- </summary>
- <param name="myAssembly">The <see cref="T:System.Reflection.Assembly"/> to get the name for.</param>
- <returns>The short name of the <see cref="T:System.Reflection.Assembly"/>.</returns>
- <remarks>
- <para>
- The short name of the assembly is the <see cref="P:System.Reflection.Assembly.FullName"/>
- without the version, culture, or public key. i.e. it is just the
- assembly's file name without the extension.
- </para>
- <para>
- Use this rather than <c>Assembly.GetName().Name</c> because that
- is not available on the Compact Framework.
- </para>
- <para>
- Because of a FileIOPermission security demand we cannot do
- the obvious Assembly.GetName().Name. We are allowed to get
- the <see cref="P:System.Reflection.Assembly.FullName"/> of the assembly so we
- start from there and strip out just the assembly name.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.AssemblyFileName(System.Reflection.Assembly)">
- <summary>
- Gets the file name portion of the <see cref="T:System.Reflection.Assembly"/>, including the extension.
- </summary>
- <param name="myAssembly">The <see cref="T:System.Reflection.Assembly"/> to get the file name for.</param>
- <returns>The file name of the assembly.</returns>
- <remarks>
- <para>
- Gets the file name portion of the <see cref="T:System.Reflection.Assembly"/>, including the extension.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.GetTypeFromString(System.Type,System.String,System.Boolean,System.Boolean)">
- <summary>
- Loads the type specified in the type string.
- </summary>
- <param name="relativeType">A sibling type to use to load the type.</param>
- <param name="typeName">The name of the type to load.</param>
- <param name="throwOnError">Flag set to <c>true</c> to throw an exception if the type cannot be loaded.</param>
- <param name="ignoreCase"><c>true</c> to ignore the case of the type name; otherwise, <c>false</c></param>
- <returns>The type loaded or <c>null</c> if it could not be loaded.</returns>
- <remarks>
- <para>
- If the type name is fully qualified, i.e. if contains an assembly name in
- the type name, the type will be loaded from the system using
- <see cref="M:System.Type.GetType(System.String,System.Boolean)"/>.
- </para>
- <para>
- If the type name is not fully qualified, it will be loaded from the assembly
- containing the specified relative type. If the type is not found in the assembly
- then all the loaded assemblies will be searched for the type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.GetTypeFromString(System.String,System.Boolean,System.Boolean)">
- <summary>
- Loads the type specified in the type string.
- </summary>
- <param name="typeName">The name of the type to load.</param>
- <param name="throwOnError">Flag set to <c>true</c> to throw an exception if the type cannot be loaded.</param>
- <param name="ignoreCase"><c>true</c> to ignore the case of the type name; otherwise, <c>false</c></param>
- <returns>The type loaded or <c>null</c> if it could not be loaded.</returns>
- <remarks>
- <para>
- If the type name is fully qualified, i.e. if contains an assembly name in
- the type name, the type will be loaded from the system using
- <see cref="M:System.Type.GetType(System.String,System.Boolean)"/>.
- </para>
- <para>
- If the type name is not fully qualified it will be loaded from the
- assembly that is directly calling this method. If the type is not found
- in the assembly then all the loaded assemblies will be searched for the type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.GetTypeFromString(System.Reflection.Assembly,System.String,System.Boolean,System.Boolean)">
- <summary>
- Loads the type specified in the type string.
- </summary>
- <param name="relativeAssembly">An assembly to load the type from.</param>
- <param name="typeName">The name of the type to load.</param>
- <param name="throwOnError">Flag set to <c>true</c> to throw an exception if the type cannot be loaded.</param>
- <param name="ignoreCase"><c>true</c> to ignore the case of the type name; otherwise, <c>false</c></param>
- <returns>The type loaded or <c>null</c> if it could not be loaded.</returns>
- <remarks>
- <para>
- If the type name is fully qualified, i.e. if contains an assembly name in
- the type name, the type will be loaded from the system using
- <see cref="M:System.Type.GetType(System.String,System.Boolean)"/>.
- </para>
- <para>
- If the type name is not fully qualified it will be loaded from the specified
- assembly. If the type is not found in the assembly then all the loaded assemblies
- will be searched for the type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.NewGuid">
- <summary>
- Generate a new guid
- </summary>
- <returns>A new Guid</returns>
- <remarks>
- <para>
- Generate a new guid
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.CreateArgumentOutOfRangeException(System.String,System.Object,System.String)">
- <summary>
- Create an <see cref="T:System.ArgumentOutOfRangeException"/>
- </summary>
- <param name="parameterName">The name of the parameter that caused the exception</param>
- <param name="actualValue">The value of the argument that causes this exception</param>
- <param name="message">The message that describes the error</param>
- <returns>the ArgumentOutOfRangeException object</returns>
- <remarks>
- <para>
- Create a new instance of the <see cref="T:System.ArgumentOutOfRangeException"/> class
- with a specified error message, the parameter name, and the value
- of the argument.
- </para>
- <para>
- The Compact Framework does not support the 3 parameter constructor for the
- <see cref="T:System.ArgumentOutOfRangeException"/> type. This method provides an
- implementation that works for all platforms.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.TryParse(System.String,System.Int32@)">
- <summary>
- Parse a string into an <see cref="T:System.Int32"/> value
- </summary>
- <param name="s">the string to parse</param>
- <param name="val">out param where the parsed value is placed</param>
- <returns><c>true</c> if the string was able to be parsed into an integer</returns>
- <remarks>
- <para>
- Attempts to parse the string into an integer. If the string cannot
- be parsed then this method returns <c>false</c>. The method does not throw an exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.TryParse(System.String,System.Int64@)">
- <summary>
- Parse a string into an <see cref="T:System.Int64"/> value
- </summary>
- <param name="s">the string to parse</param>
- <param name="val">out param where the parsed value is placed</param>
- <returns><c>true</c> if the string was able to be parsed into an integer</returns>
- <remarks>
- <para>
- Attempts to parse the string into an integer. If the string cannot
- be parsed then this method returns <c>false</c>. The method does not throw an exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.GetAppSetting(System.String)">
- <summary>
- Lookup an application setting
- </summary>
- <param name="key">the application settings key to lookup</param>
- <returns>the value for the key, or <c>null</c></returns>
- <remarks>
- <para>
- Configuration APIs are not supported under the Compact Framework
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.ConvertToFullPath(System.String)">
- <summary>
- Convert a path into a fully qualified local file path.
- </summary>
- <param name="path">The path to convert.</param>
- <returns>The fully qualified path.</returns>
- <remarks>
- <para>
- Converts the path specified to a fully
- qualified path. If the path is relative it is
- taken as relative from the application base
- directory.
- </para>
- <para>
- The path specified must be a local file path, a URI is not supported.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.CreateCaseInsensitiveHashtable">
- <summary>
- Creates a new case-insensitive instance of the <see cref="T:System.Collections.Hashtable"/> class with the default initial capacity.
- </summary>
- <returns>A new case-insensitive instance of the <see cref="T:System.Collections.Hashtable"/> class with the default initial capacity</returns>
- <remarks>
- <para>
- The new Hashtable instance uses the default load factor, the CaseInsensitiveHashCodeProvider, and the CaseInsensitiveComparer.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.SystemInfo.EmptyTypes">
- <summary>
- Gets an empty array of types.
- </summary>
- <remarks>
- <para>
- The <c>Type.EmptyTypes</c> field is not available on
- the .NET Compact Framework 1.0.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.SystemInfo.s_hostName">
- <summary>
- Cache the host name for the current machine
- </summary>
- </member>
- <member name="F:log4net.Util.SystemInfo.s_appFriendlyName">
- <summary>
- Cache the application friendly name
- </summary>
- </member>
- <member name="F:log4net.Util.SystemInfo.s_nullText">
- <summary>
- Text to output when a <c>null</c> is encountered.
- </summary>
- </member>
- <member name="F:log4net.Util.SystemInfo.s_notAvailableText">
- <summary>
- Text to output when an unsupported feature is requested.
- </summary>
- </member>
- <member name="F:log4net.Util.SystemInfo.s_processStartTime">
- <summary>
- Start time for the current process.
- </summary>
- </member>
- <member name="P:log4net.Util.SystemInfo.NewLine">
- <summary>
- Gets the system dependent line terminator.
- </summary>
- <value>
- The system dependent line terminator.
- </value>
- <remarks>
- <para>
- Gets the system dependent line terminator.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.ApplicationBaseDirectory">
- <summary>
- Gets the base directory for this <see cref="T:System.AppDomain"/>.
- </summary>
- <value>The base directory path for the current <see cref="T:System.AppDomain"/>.</value>
- <remarks>
- <para>
- Gets the base directory for this <see cref="T:System.AppDomain"/>.
- </para>
- <para>
- The value returned may be either a local file path or a URI.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.ConfigurationFileLocation">
- <summary>
- Gets the path to the configuration file for the current <see cref="T:System.AppDomain"/>.
- </summary>
- <value>The path to the configuration file for the current <see cref="T:System.AppDomain"/>.</value>
- <remarks>
- <para>
- The .NET Compact Framework 1.0 does not have a concept of a configuration
- file. For this runtime, we use the entry assembly location as the root for
- the configuration file name.
- </para>
- <para>
- The value returned may be either a local file path or a URI.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.EntryAssemblyLocation">
- <summary>
- Gets the path to the file that first executed in the current <see cref="T:System.AppDomain"/>.
- </summary>
- <value>The path to the entry assembly.</value>
- <remarks>
- <para>
- Gets the path to the file that first executed in the current <see cref="T:System.AppDomain"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.CurrentThreadId">
- <summary>
- Gets the ID of the current thread.
- </summary>
- <value>The ID of the current thread.</value>
- <remarks>
- <para>
- On the .NET framework, the <c>AppDomain.GetCurrentThreadId</c> method
- is used to obtain the thread ID for the current thread. This is the
- operating system ID for the thread.
- </para>
- <para>
- On the .NET Compact Framework 1.0 it is not possible to get the
- operating system thread ID for the current thread. The native method
- <c>GetCurrentThreadId</c> is implemented inline in a header file
- and cannot be called.
- </para>
- <para>
- On the .NET Framework 2.0 the <c>Thread.ManagedThreadId</c> is used as this
- gives a stable id unrelated to the operating system thread ID which may
- change if the runtime is using fibers.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.HostName">
- <summary>
- Get the host name or machine name for the current machine
- </summary>
- <value>
- The hostname or machine name
- </value>
- <remarks>
- <para>
- Get the host name or machine name for the current machine
- </para>
- <para>
- The host name (<see cref="M:System.Net.Dns.GetHostName"/>) or
- the machine name (<c>Environment.MachineName</c>) for
- the current machine, or if neither of these are available
- then <c>NOT AVAILABLE</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.ApplicationFriendlyName">
- <summary>
- Get this application's friendly name
- </summary>
- <value>
- The friendly name of this application as a string
- </value>
- <remarks>
- <para>
- If available the name of the application is retrieved from
- the <c>AppDomain</c> using <c>AppDomain.CurrentDomain.FriendlyName</c>.
- </para>
- <para>
- Otherwise the file name of the entry assembly is used.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.ProcessStartTime">
- <summary>
- Get the start time for the current process.
- </summary>
- <remarks>
- <para>
- This is the time at which the log4net library was loaded into the
- AppDomain. Due to reports of a hang in the call to <c>System.Diagnostics.Process.StartTime</c>
- this is not the start time for the current process.
- </para>
- <para>
- The log4net library should be loaded by an application early during its
- startup, therefore this start time should be a good approximation for
- the actual start time.
- </para>
- <para>
- Note that AppDomains may be loaded and unloaded within the
- same process without the process terminating, however this start time
- will be set per AppDomain.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.NullText">
- <summary>
- Text to output when a <c>null</c> is encountered.
- </summary>
- <remarks>
- <para>
- Use this value to indicate a <c>null</c> has been encountered while
- outputting a string representation of an item.
- </para>
- <para>
- The default value is <c>(null)</c>. This value can be overridden by specifying
- a value for the <c>log4net.NullText</c> appSetting in the application's
- .config file.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.NotAvailableText">
- <summary>
- Text to output when an unsupported feature is requested.
- </summary>
- <remarks>
- <para>
- Use this value when an unsupported feature is requested.
- </para>
- <para>
- The default value is <c>NOT AVAILABLE</c>. This value can be overridden by specifying
- a value for the <c>log4net.NotAvailableText</c> appSetting in the application's
- .config file.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.SystemStringFormat">
- <summary>
- Utility class that represents a format string.
- </summary>
- <remarks>
- <para>
- Utility class that represents a format string.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.#ctor(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Initialise the <see cref="T:log4net.Util.SystemStringFormat"/>
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
- <param name="format">A <see cref="T:System.String"/> containing zero or more format items.</param>
- <param name="args">An <see cref="T:System.Object"/> array containing zero or more objects to format.</param>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.ToString">
- <summary>
- Format the string and arguments
- </summary>
- <returns>the formatted string</returns>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.StringFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Replaces the format item in a specified <see cref="T:System.String"/> with the text equivalent
- of the value of a corresponding <see cref="T:System.Object"/> instance in a specified array.
- A specified parameter supplies culture-specific formatting information.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
- <param name="format">A <see cref="T:System.String"/> containing zero or more format items.</param>
- <param name="args">An <see cref="T:System.Object"/> array containing zero or more objects to format.</param>
- <returns>
- A copy of format in which the format items have been replaced by the <see cref="T:System.String"/>
- equivalent of the corresponding instances of <see cref="T:System.Object"/> in args.
- </returns>
- <remarks>
- <para>
- This method does not throw exceptions. If an exception thrown while formatting the result the
- exception and arguments are returned in the result string.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.StringFormatError(System.Exception,System.String,System.Object[])">
- <summary>
- Process an error during StringFormat
- </summary>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.RenderArray(System.Array,System.Text.StringBuilder)">
- <summary>
- Dump the contents of an array into a string builder
- </summary>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.RenderObject(System.Object,System.Text.StringBuilder)">
- <summary>
- Dump an object to a string
- </summary>
- </member>
- <member name="T:log4net.Util.ThreadContextProperties">
- <summary>
- Implementation of Properties collection for the <see cref="T:log4net.ThreadContext"/>
- </summary>
- <remarks>
- <para>
- Class implements a collection of properties that is specific to each thread.
- The class is not synchronized as each thread has its own <see cref="T:log4net.Util.PropertiesDictionary"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.ThreadContextProperties.s_threadLocalSlot">
- <summary>
- The thread local data slot to use to store a PropertiesDictionary.
- </summary>
- </member>
- <member name="M:log4net.Util.ThreadContextProperties.#ctor">
- <summary>
- Internal constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ThreadContextProperties"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextProperties.Remove(System.String)">
- <summary>
- Remove a property
- </summary>
- <param name="key">the key for the entry to remove</param>
- <remarks>
- <para>
- Remove a property
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextProperties.Clear">
- <summary>
- Clear all properties
- </summary>
- <remarks>
- <para>
- Clear all properties
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextProperties.GetProperties(System.Boolean)">
- <summary>
- Get the <c>PropertiesDictionary</c> for this thread.
- </summary>
- <param name="create">create the dictionary if it does not exist, otherwise return null if is does not exist</param>
- <returns>the properties for this thread</returns>
- <remarks>
- <para>
- The collection returned is only to be used on the calling thread. If the
- caller needs to share the collection between different threads then the
- caller must clone the collection before doing so.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextProperties.Item(System.String)">
- <summary>
- Gets or sets the value of a property
- </summary>
- <value>
- The value for the property with the specified key
- </value>
- <remarks>
- <para>
- Gets or sets the value of a property
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ThreadContextStack">
- <summary>
- Implementation of Stack for the <see cref="T:log4net.ThreadContext"/>
- </summary>
- <remarks>
- <para>
- Implementation of Stack for the <see cref="T:log4net.ThreadContext"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.ThreadContextStack.m_stack">
- <summary>
- The stack store.
- </summary>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.#ctor">
- <summary>
- Internal constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ThreadContextStack"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.Clear">
- <summary>
- Clears all the contextual information held in this stack.
- </summary>
- <remarks>
- <para>
- Clears all the contextual information held in this stack.
- Only call this if you think that this tread is being reused after
- a previous call execution which may not have completed correctly.
- You do not need to use this method if you always guarantee to call
- the <see cref="M:System.IDisposable.Dispose"/> method of the <see cref="T:System.IDisposable"/>
- returned from <see cref="M:log4net.Util.ThreadContextStack.Push(System.String)"/> even in exceptional circumstances,
- for example by using the <c>using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message"))</c>
- syntax.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.Pop">
- <summary>
- Removes the top context from this stack.
- </summary>
- <returns>The message in the context that was removed from the top of this stack.</returns>
- <remarks>
- <para>
- Remove the top context from this stack, and return
- it to the caller. If this stack is empty then an
- empty string (not <see langword="null"/>) is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.Push(System.String)">
- <summary>
- Pushes a new context message into this stack.
- </summary>
- <param name="message">The new context message.</param>
- <returns>
- An <see cref="T:System.IDisposable"/> that can be used to clean up the context stack.
- </returns>
- <remarks>
- <para>
- Pushes a new context onto this stack. An <see cref="T:System.IDisposable"/>
- is returned that can be used to clean up this stack. This
- can be easily combined with the <c>using</c> keyword to scope the
- context.
- </para>
- </remarks>
- <example>Simple example of using the <c>Push</c> method with the <c>using</c> keyword.
- <code lang="C#">
- using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message"))
- {
- log.Warn("This should have an ThreadContext Stack message");
- }
- </code>
- </example>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.GetFullMessage">
- <summary>
- Gets the current context information for this stack.
- </summary>
- <returns>The current context information.</returns>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.ToString">
- <summary>
- Gets the current context information for this stack.
- </summary>
- <returns>Gets the current context information</returns>
- <remarks>
- <para>
- Gets the current context information for this stack.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.log4net#Core#IFixingRequired#GetFixedObject">
- <summary>
- Get a portable version of this object
- </summary>
- <returns>the portable instance of this object</returns>
- <remarks>
- <para>
- Get a cross thread portable version of this object
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextStack.Count">
- <summary>
- The number of messages in the stack
- </summary>
- <value>
- The current number of messages in the stack
- </value>
- <remarks>
- <para>
- The current number of messages in the stack. That is
- the number of times <see cref="M:log4net.Util.ThreadContextStack.Push(System.String)"/> has been called
- minus the number of times <see cref="M:log4net.Util.ThreadContextStack.Pop"/> has been called.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextStack.InternalStack">
- <summary>
- Gets and sets the internal stack used by this <see cref="T:log4net.Util.ThreadContextStack"/>
- </summary>
- <value>The internal storage stack</value>
- <remarks>
- <para>
- This property is provided only to support backward compatability
- of the <see cref="T:log4net.NDC"/>. Tytpically the internal stack should not
- be modified.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ThreadContextStack.StackFrame">
- <summary>
- Inner class used to represent a single context frame in the stack.
- </summary>
- <remarks>
- <para>
- Inner class used to represent a single context frame in the stack.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.StackFrame.#ctor(System.String,log4net.Util.ThreadContextStack.StackFrame)">
- <summary>
- Constructor
- </summary>
- <param name="message">The message for this context.</param>
- <param name="parent">The parent context in the chain.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ThreadContextStack.StackFrame"/> class
- with the specified message and parent context.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextStack.StackFrame.Message">
- <summary>
- Get the message.
- </summary>
- <value>The message.</value>
- <remarks>
- <para>
- Get the message.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextStack.StackFrame.FullMessage">
- <summary>
- Gets the full text of the context down to the root level.
- </summary>
- <value>
- The full text of the context down to the root level.
- </value>
- <remarks>
- <para>
- Gets the full text of the context down to the root level.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ThreadContextStack.AutoPopStackFrame">
- <summary>
- Struct returned from the <see cref="M:log4net.Util.ThreadContextStack.Push(System.String)"/> method.
- </summary>
- <remarks>
- <para>
- This struct implements the <see cref="T:System.IDisposable"/> and is designed to be used
- with the <see langword="using"/> pattern to remove the stack frame at the end of the scope.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.ThreadContextStack.AutoPopStackFrame.m_frameStack">
- <summary>
- The ThreadContextStack internal stack
- </summary>
- </member>
- <member name="F:log4net.Util.ThreadContextStack.AutoPopStackFrame.m_frameDepth">
- <summary>
- The depth to trim the stack to when this instance is disposed
- </summary>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.AutoPopStackFrame.#ctor(System.Collections.Stack,System.Int32)">
- <summary>
- Constructor
- </summary>
- <param name="frameStack">The internal stack used by the ThreadContextStack.</param>
- <param name="frameDepth">The depth to return the stack to when this object is disposed.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ThreadContextStack.AutoPopStackFrame"/> class with
- the specified stack and return depth.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.AutoPopStackFrame.Dispose">
- <summary>
- Returns the stack to the correct depth.
- </summary>
- <remarks>
- <para>
- Returns the stack to the correct depth.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ThreadContextStacks">
- <summary>
- Implementation of Stacks collection for the <see cref="T:log4net.ThreadContext"/>
- </summary>
- <remarks>
- <para>
- Implementation of Stacks collection for the <see cref="T:log4net.ThreadContext"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.ThreadContextStacks.#ctor(log4net.Util.ContextPropertiesBase)">
- <summary>
- Internal constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ThreadContextStacks"/> class.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextStacks.Item(System.String)">
- <summary>
- Gets the named thread context stack
- </summary>
- <value>
- The named stack
- </value>
- <remarks>
- <para>
- Gets the named thread context stack
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.Transform">
- <summary>
- Utility class for transforming strings.
- </summary>
- <remarks>
- <para>
- Utility class for transforming strings.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.Transform.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.Transform"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.Transform.WriteEscapedXmlString(System.Xml.XmlWriter,System.String,System.String)">
- <summary>
- Write a string to an <see cref="T:System.Xml.XmlWriter"/>
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="textData">the string to write</param>
- <param name="invalidCharReplacement">The string to replace non XML compliant chars with</param>
- <remarks>
- <para>
- The test is escaped either using XML escape entities
- or using CDATA sections.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.Transform.MaskXmlInvalidCharacters(System.String,System.String)">
- <summary>
- Replace invalid XML characters in text string
- </summary>
- <param name="textData">the XML text input string</param>
- <param name="mask">the string to use in place of invalid characters</param>
- <returns>A string that does not contain invalid XML characters.</returns>
- <remarks>
- <para>
- Certain Unicode code points are not allowed in the XML InfoSet, for
- details see: <a href="http://www.w3.org/TR/REC-xml/#charsets">http://www.w3.org/TR/REC-xml/#charsets</a>.
- </para>
- <para>
- This method replaces any illegal characters in the input string
- with the mask string specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.Transform.CountSubstrings(System.String,System.String)">
- <summary>
- Count the number of times that the substring occurs in the text
- </summary>
- <param name="text">the text to search</param>
- <param name="substring">the substring to find</param>
- <returns>the number of times the substring occurs in the text</returns>
- <remarks>
- <para>
- The substring is assumed to be non repeating within itself.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.WindowsSecurityContext">
- <summary>
- Impersonate a Windows Account
- </summary>
- <remarks>
- <para>
- This <see cref="T:log4net.Core.SecurityContext"/> impersonates a Windows account.
- </para>
- <para>
- How the impersonation is done depends on the value of <see cref="M:log4net.Util.WindowsSecurityContext.Impersonate(System.Object)"/>.
- This allows the context to either impersonate a set of user credentials specified
- using username, domain name and password or to revert to the process credentials.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.ActivateOptions">
- <summary>
- Initialize the SecurityContext based on the options set.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Util.WindowsSecurityContext.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Util.WindowsSecurityContext.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Util.WindowsSecurityContext.ActivateOptions"/> must be called again.
- </para>
- <para>
- The security context will try to Logon the specified user account and
- capture a primary token for impersonation.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">The required <see cref="P:log4net.Util.WindowsSecurityContext.UserName"/>,
- <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> or <see cref="P:log4net.Util.WindowsSecurityContext.Password"/> properties were not specified.</exception>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.Impersonate(System.Object)">
- <summary>
- Impersonate the Windows account specified by the <see cref="P:log4net.Util.WindowsSecurityContext.UserName"/> and <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> properties.
- </summary>
- <param name="state">caller provided state</param>
- <returns>
- An <see cref="T:System.IDisposable"/> instance that will revoke the impersonation of this SecurityContext
- </returns>
- <remarks>
- <para>
- Depending on the <see cref="P:log4net.Util.WindowsSecurityContext.Credentials"/> property either
- impersonate a user using credentials supplied or revert
- to the process credentials.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.LogonUser(System.String,System.String,System.String)">
- <summary>
- Create a <see cref="T:System.Security.Principal.WindowsIdentity"/> given the userName, domainName and password.
- </summary>
- <param name="userName">the user name</param>
- <param name="domainName">the domain name</param>
- <param name="password">the password</param>
- <returns>the <see cref="T:System.Security.Principal.WindowsIdentity"/> for the account specified</returns>
- <remarks>
- <para>
- Uses the Windows API call LogonUser to get a principal token for the account. This
- token is used to initialize the WindowsIdentity.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.WindowsSecurityContext.Credentials">
- <summary>
- Gets or sets the impersonation mode for this security context
- </summary>
- <value>
- The impersonation mode for this security context
- </value>
- <remarks>
- <para>
- Impersonate either a user with user credentials or
- revert this thread to the credentials of the process.
- The value is one of the <see cref="T:log4net.Util.WindowsSecurityContext.ImpersonationMode"/>
- enum.
- </para>
- <para>
- The default value is <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User"/>
- </para>
- <para>
- When the mode is set to <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User"/>
- the user's credentials are established using the
- <see cref="P:log4net.Util.WindowsSecurityContext.UserName"/>, <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> and <see cref="P:log4net.Util.WindowsSecurityContext.Password"/>
- values.
- </para>
- <para>
- When the mode is set to <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.Process"/>
- no other properties need to be set. If the calling thread is
- impersonating then it will be reverted back to the process credentials.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.WindowsSecurityContext.UserName">
- <summary>
- Gets or sets the Windows username for this security context
- </summary>
- <value>
- The Windows username for this security context
- </value>
- <remarks>
- <para>
- This property must be set if <see cref="P:log4net.Util.WindowsSecurityContext.Credentials"/>
- is set to <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User"/> (the default setting).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.WindowsSecurityContext.DomainName">
- <summary>
- Gets or sets the Windows domain name for this security context
- </summary>
- <value>
- The Windows domain name for this security context
- </value>
- <remarks>
- <para>
- The default value for <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> is the local machine name
- taken from the <see cref="P:System.Environment.MachineName"/> property.
- </para>
- <para>
- This property must be set if <see cref="P:log4net.Util.WindowsSecurityContext.Credentials"/>
- is set to <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User"/> (the default setting).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.WindowsSecurityContext.Password">
- <summary>
- Sets the password for the Windows account specified by the <see cref="P:log4net.Util.WindowsSecurityContext.UserName"/> and <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> properties.
- </summary>
- <value>
- The password for the Windows account specified by the <see cref="P:log4net.Util.WindowsSecurityContext.UserName"/> and <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> properties.
- </value>
- <remarks>
- <para>
- This property must be set if <see cref="P:log4net.Util.WindowsSecurityContext.Credentials"/>
- is set to <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User"/> (the default setting).
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.WindowsSecurityContext.ImpersonationMode">
- <summary>
- The impersonation modes for the <see cref="T:log4net.Util.WindowsSecurityContext"/>
- </summary>
- <remarks>
- <para>
- See the <see cref="P:log4net.Util.WindowsSecurityContext.Credentials"/> property for
- details.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User">
- <summary>
- Impersonate a user using the credentials supplied
- </summary>
- </member>
- <member name="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.Process">
- <summary>
- Revert this the thread to the credentials of the process
- </summary>
- </member>
- <member name="T:log4net.Util.WindowsSecurityContext.DisposableImpersonationContext">
- <summary>
- Adds <see cref="T:System.IDisposable"/> to <see cref="T:System.Security.Principal.WindowsImpersonationContext"/>
- </summary>
- <remarks>
- <para>
- Helper class to expose the <see cref="T:System.Security.Principal.WindowsImpersonationContext"/>
- through the <see cref="T:System.IDisposable"/> interface.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.DisposableImpersonationContext.#ctor(System.Security.Principal.WindowsImpersonationContext)">
- <summary>
- Constructor
- </summary>
- <param name="impersonationContext">the impersonation context being wrapped</param>
- <remarks>
- <para>
- Constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.DisposableImpersonationContext.Dispose">
- <summary>
- Revert the impersonation
- </summary>
- <remarks>
- <para>
- Revert the impersonation
- </para>
- </remarks>
- </member>
- <member name="T:log4net.GlobalContext">
- <summary>
- The log4net Global Context.
- </summary>
- <remarks>
- <para>
- The <c>GlobalContext</c> provides a location for global debugging
- information to be stored.
- </para>
- <para>
- The global context has a properties map and these properties can
- be included in the output of log messages. The <see cref="T:log4net.Layout.PatternLayout"/>
- supports selecting and outputing these properties.
- </para>
- <para>
- By default the <c>log4net:HostName</c> property is set to the name of
- the current machine.
- </para>
- </remarks>
- <example>
- <code lang="C#">
- GlobalContext.Properties["hostname"] = Environment.MachineName;
- </code>
- </example>
- <threadsafety static="true" instance="true"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.GlobalContext.#ctor">
- <summary>
- Private Constructor.
- </summary>
- <remarks>
- Uses a private access modifier to prevent instantiation of this class.
- </remarks>
- </member>
- <member name="F:log4net.GlobalContext.s_properties">
- <summary>
- The global context properties instance
- </summary>
- </member>
- <member name="P:log4net.GlobalContext.Properties">
- <summary>
- The global properties map.
- </summary>
- <value>
- The global properties map.
- </value>
- <remarks>
- <para>
- The global properties map.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.LogicalThreadContext">
- <summary>
- The log4net Logical Thread Context.
- </summary>
- <remarks>
- <para>
- The <c>LogicalThreadContext</c> provides a location for <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/> specific debugging
- information to be stored.
- The <c>LogicalThreadContext</c> properties override any <see cref="T:log4net.ThreadContext"/> or <see cref="T:log4net.GlobalContext"/>
- properties with the same name.
- </para>
- <para>
- The Logical Thread Context has a properties map and a stack.
- The properties and stack can
- be included in the output of log messages. The <see cref="T:log4net.Layout.PatternLayout"/>
- supports selecting and outputting these properties.
- </para>
- <para>
- The Logical Thread Context provides a diagnostic context for the current call context.
- This is an instrument for distinguishing interleaved log
- output from different sources. Log output is typically interleaved
- when a server handles multiple clients near-simultaneously.
- </para>
- <para>
- The Logical Thread Context is managed on a per <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/> basis.
- </para>
- </remarks>
- <example>Example of using the thread context properties to store a username.
- <code lang="C#">
- LogicalThreadContext.Properties["user"] = userName;
- log.Info("This log message has a LogicalThreadContext Property called 'user'");
- </code>
- </example>
- <example>Example of how to push a message into the context stack
- <code lang="C#">
- using(LogicalThreadContext.Stacks["LDC"].Push("my context message"))
- {
- log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'");
-
- } // at the end of the using block the message is automatically popped
- </code>
- </example>
- <threadsafety static="true" instance="true"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.LogicalThreadContext.#ctor">
- <summary>
- Private Constructor.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.LogicalThreadContext.s_properties">
- <summary>
- The thread context properties instance
- </summary>
- </member>
- <member name="F:log4net.LogicalThreadContext.s_stacks">
- <summary>
- The thread context stacks instance
- </summary>
- </member>
- <member name="P:log4net.LogicalThreadContext.Properties">
- <summary>
- The thread properties map
- </summary>
- <value>
- The thread properties map
- </value>
- <remarks>
- <para>
- The <c>LogicalThreadContext</c> properties override any <see cref="T:log4net.ThreadContext"/>
- or <see cref="T:log4net.GlobalContext"/> properties with the same name.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.LogicalThreadContext.Stacks">
- <summary>
- The thread stacks
- </summary>
- <value>
- stack map
- </value>
- <remarks>
- <para>
- The logical thread stacks.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.LogManager">
- <summary>
- This class is used by client applications to request logger instances.
- </summary>
- <remarks>
- <para>
- This class has static methods that are used by a client to request
- a logger instance. The <see cref="M:log4net.LogManager.GetLogger(System.String)"/> method is
- used to retrieve a logger.
- </para>
- <para>
- See the <see cref="T:log4net.ILog"/> interface for more details.
- </para>
- </remarks>
- <example>Simple example of logging messages
- <code lang="C#">
- ILog log = LogManager.GetLogger("application-log");
-
- log.Info("Application Start");
- log.Debug("This is a debug message");
-
- if (log.IsDebugEnabled)
- {
- log.Debug("This is another debug message");
- }
- </code>
- </example>
- <threadsafety static="true" instance="true"/>
- <seealso cref="T:log4net.ILog"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.LogManager.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.LogManager"/> class.
- </summary>
- <remarks>
- Uses a private access modifier to prevent instantiation of this class.
- </remarks>
- </member>
- <member name="M:log4net.LogManager.Exists(System.String)">
- <overloads>Returns the named logger if it exists.</overloads>
- <summary>
- Returns the named logger if it exists.
- </summary>
- <remarks>
- <para>
- If the named logger exists (in the default repository) then it
- returns a reference to the logger, otherwise it returns <c>null</c>.
- </para>
- </remarks>
- <param name="name">The fully qualified logger name to look for.</param>
- <returns>The logger found, or <c>null</c> if no logger could be found.</returns>
- </member>
- <member name="M:log4net.LogManager.Exists(System.String,System.String)">
- <summary>
- Returns the named logger if it exists.
- </summary>
- <remarks>
- <para>
- If the named logger exists (in the specified repository) then it
- returns a reference to the logger, otherwise it returns
- <c>null</c>.
- </para>
- </remarks>
- <param name="repository">The repository to lookup in.</param>
- <param name="name">The fully qualified logger name to look for.</param>
- <returns>
- The logger found, or <c>null</c> if the logger doesn't exist in the specified
- repository.
- </returns>
- </member>
- <member name="M:log4net.LogManager.Exists(System.Reflection.Assembly,System.String)">
- <summary>
- Returns the named logger if it exists.
- </summary>
- <remarks>
- <para>
- If the named logger exists (in the repository for the specified assembly) then it
- returns a reference to the logger, otherwise it returns
- <c>null</c>.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <param name="name">The fully qualified logger name to look for.</param>
- <returns>
- The logger, or <c>null</c> if the logger doesn't exist in the specified
- assembly's repository.
- </returns>
- </member>
- <member name="M:log4net.LogManager.GetCurrentLoggers">
- <overloads>Get the currently defined loggers.</overloads>
- <summary>
- Returns all the currently defined loggers in the default repository.
- </summary>
- <remarks>
- <para>The root logger is <b>not</b> included in the returned array.</para>
- </remarks>
- <returns>All the defined loggers.</returns>
- </member>
- <member name="M:log4net.LogManager.GetCurrentLoggers(System.String)">
- <summary>
- Returns all the currently defined loggers in the specified repository.
- </summary>
- <param name="repository">The repository to lookup in.</param>
- <remarks>
- The root logger is <b>not</b> included in the returned array.
- </remarks>
- <returns>All the defined loggers.</returns>
- </member>
- <member name="M:log4net.LogManager.GetCurrentLoggers(System.Reflection.Assembly)">
- <summary>
- Returns all the currently defined loggers in the specified assembly's repository.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <remarks>
- The root logger is <b>not</b> included in the returned array.
- </remarks>
- <returns>All the defined loggers.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.String)">
- <overloads>Get or create a logger.</overloads>
- <summary>
- Retrieves or creates a named logger.
- </summary>
- <remarks>
- <para>
- Retrieves a logger named as the <paramref name="name"/>
- parameter. If the named logger already exists, then the
- existing instance will be returned. Otherwise, a new instance is
- created.
- </para>
- <para>By default, loggers do not have a set level but inherit
- it from the hierarchy. This is one of the central features of
- log4net.
- </para>
- </remarks>
- <param name="name">The name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.String,System.String)">
- <summary>
- Retrieves or creates a named logger.
- </summary>
- <remarks>
- <para>
- Retrieve a logger named as the <paramref name="name"/>
- parameter. If the named logger already exists, then the
- existing instance will be returned. Otherwise, a new instance is
- created.
- </para>
- <para>
- By default, loggers do not have a set level but inherit
- it from the hierarchy. This is one of the central features of
- log4net.
- </para>
- </remarks>
- <param name="repository">The repository to lookup in.</param>
- <param name="name">The name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.Reflection.Assembly,System.String)">
- <summary>
- Retrieves or creates a named logger.
- </summary>
- <remarks>
- <para>
- Retrieve a logger named as the <paramref name="name"/>
- parameter. If the named logger already exists, then the
- existing instance will be returned. Otherwise, a new instance is
- created.
- </para>
- <para>
- By default, loggers do not have a set level but inherit
- it from the hierarchy. This is one of the central features of
- log4net.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <param name="name">The name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.Type)">
- <summary>
- Shorthand for <see cref="M:log4net.LogManager.GetLogger(System.String)"/>.
- </summary>
- <remarks>
- Get the logger for the fully qualified name of the type specified.
- </remarks>
- <param name="type">The full name of <paramref name="type"/> will be used as the name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.String,System.Type)">
- <summary>
- Shorthand for <see cref="M:log4net.LogManager.GetLogger(System.String)"/>.
- </summary>
- <remarks>
- Gets the logger for the fully qualified name of the type specified.
- </remarks>
- <param name="repository">The repository to lookup in.</param>
- <param name="type">The full name of <paramref name="type"/> will be used as the name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.Reflection.Assembly,System.Type)">
- <summary>
- Shorthand for <see cref="M:log4net.LogManager.GetLogger(System.String)"/>.
- </summary>
- <remarks>
- Gets the logger for the fully qualified name of the type specified.
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <param name="type">The full name of <paramref name="type"/> will be used as the name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.Shutdown">
- <summary>
- Shuts down the log4net system.
- </summary>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in all the
- default repositories.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.LogManager.ShutdownRepository">
- <overloads>Shutdown a logger repository.</overloads>
- <summary>
- Shuts down the default repository.
- </summary>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in the
- default repository.
- </para>
- <para>Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.LogManager.ShutdownRepository(System.String)">
- <summary>
- Shuts down the repository for the repository specified.
- </summary>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in the
- <paramref name="repository"/> specified.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- <param name="repository">The repository to shutdown.</param>
- </member>
- <member name="M:log4net.LogManager.ShutdownRepository(System.Reflection.Assembly)">
- <summary>
- Shuts down the repository specified.
- </summary>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in the
- repository. The repository is looked up using
- the <paramref name="repositoryAssembly"/> specified.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>
- The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- </member>
- <member name="M:log4net.LogManager.ResetConfiguration">
- <overloads>Reset the configuration of a repository</overloads>
- <summary>
- Resets all values contained in this repository instance to their defaults.
- </summary>
- <remarks>
- <para>
- Resets all values contained in the repository instance to their
- defaults. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set to its default "off" value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.LogManager.ResetConfiguration(System.String)">
- <summary>
- Resets all values contained in this repository instance to their defaults.
- </summary>
- <remarks>
- <para>
- Reset all values contained in the repository instance to their
- defaults. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set to its default "off" value.
- </para>
- </remarks>
- <param name="repository">The repository to reset.</param>
- </member>
- <member name="M:log4net.LogManager.ResetConfiguration(System.Reflection.Assembly)">
- <summary>
- Resets all values contained in this repository instance to their defaults.
- </summary>
- <remarks>
- <para>
- Reset all values contained in the repository instance to their
- defaults. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set to its default "off" value.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository to reset.</param>
- </member>
- <member name="M:log4net.LogManager.GetLoggerRepository">
- <overloads>Get the logger repository.</overloads>
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the callers assembly (<see cref="M:System.Reflection.Assembly.GetCallingAssembly"/>).
- </para>
- </remarks>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> instance for the default repository.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLoggerRepository(System.String)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repository"/> argument.
- </para>
- </remarks>
- <param name="repository">The repository to lookup in.</param>
- </member>
- <member name="M:log4net.LogManager.GetLoggerRepository(System.Reflection.Assembly)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repositoryAssembly"/> argument.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- </member>
- <member name="M:log4net.LogManager.GetRepository">
- <overloads>Get a logger repository.</overloads>
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the callers assembly (<see cref="M:System.Reflection.Assembly.GetCallingAssembly"/>).
- </para>
- </remarks>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> instance for the default repository.</returns>
- </member>
- <member name="M:log4net.LogManager.GetRepository(System.String)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repository"/> argument.
- </para>
- </remarks>
- <param name="repository">The repository to lookup in.</param>
- </member>
- <member name="M:log4net.LogManager.GetRepository(System.Reflection.Assembly)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repositoryAssembly"/> argument.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- </member>
- <member name="M:log4net.LogManager.CreateDomain(System.Type)">
- <overloads>Create a domain</overloads>
- <summary>
- Creates a repository with the specified repository type.
- </summary>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.LogManager.GetRepository"/> will return
- the same repository instance.
- </para>
- </remarks>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- </member>
- <member name="M:log4net.LogManager.CreateRepository(System.Type)">
- <overloads>Create a logger repository.</overloads>
- <summary>
- Creates a repository with the specified repository type.
- </summary>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.LogManager.GetRepository"/> will return
- the same repository instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.LogManager.CreateDomain(System.String)">
- <summary>
- Creates a repository with the specified name.
- </summary>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- Creates the default type of <see cref="T:log4net.Repository.ILoggerRepository"/> which is a
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> object.
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <param name="repository">The name of the repository, this must be unique amongst repositories.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.LogManager.CreateRepository(System.String)">
- <summary>
- Creates a repository with the specified name.
- </summary>
- <remarks>
- <para>
- Creates the default type of <see cref="T:log4net.Repository.ILoggerRepository"/> which is a
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> object.
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <param name="repository">The name of the repository, this must be unique amongst repositories.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.LogManager.CreateDomain(System.String,System.Type)">
- <summary>
- Creates a repository with the specified name and repository type.
- </summary>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <param name="repository">The name of the repository, this must be unique to the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.LogManager.CreateRepository(System.String,System.Type)">
- <summary>
- Creates a repository with the specified name and repository type.
- </summary>
- <remarks>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <param name="repository">The name of the repository, this must be unique to the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.LogManager.CreateDomain(System.Reflection.Assembly,System.Type)">
- <summary>
- Creates a repository for the specified assembly and repository type.
- </summary>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.LogManager.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to get the name of the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- </member>
- <member name="M:log4net.LogManager.CreateRepository(System.Reflection.Assembly,System.Type)">
- <summary>
- Creates a repository for the specified assembly and repository type.
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.LogManager.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to get the name of the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- </member>
- <member name="M:log4net.LogManager.GetAllRepositories">
- <summary>
- Gets the list of currently defined repositories.
- </summary>
- <remarks>
- <para>
- Get an array of all the <see cref="T:log4net.Repository.ILoggerRepository"/> objects that have been created.
- </para>
- </remarks>
- <returns>An array of all the known <see cref="T:log4net.Repository.ILoggerRepository"/> objects.</returns>
- </member>
- <member name="M:log4net.LogManager.WrapLogger(log4net.Core.ILogger)">
- <summary>
- Looks up the wrapper object for the logger specified.
- </summary>
- <param name="logger">The logger to get the wrapper for.</param>
- <returns>The wrapper for the logger specified.</returns>
- </member>
- <member name="M:log4net.LogManager.WrapLoggers(log4net.Core.ILogger[])">
- <summary>
- Looks up the wrapper objects for the loggers specified.
- </summary>
- <param name="loggers">The loggers to get the wrappers for.</param>
- <returns>The wrapper objects for the loggers specified.</returns>
- </member>
- <member name="M:log4net.LogManager.WrapperCreationHandler(log4net.Core.ILogger)">
- <summary>
- Create the <see cref="T:log4net.Core.ILoggerWrapper"/> objects used by
- this manager.
- </summary>
- <param name="logger">The logger to wrap.</param>
- <returns>The wrapper for the logger specified.</returns>
- </member>
- <member name="F:log4net.LogManager.s_wrapperMap">
- <summary>
- The wrapper map to use to hold the <see cref="T:log4net.Core.LogImpl"/> objects.
- </summary>
- </member>
- <member name="T:log4net.MDC">
- <summary>
- Implementation of Mapped Diagnostic Contexts.
- </summary>
- <remarks>
- <note>
- <para>
- The MDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Properties"/>.
- The current MDC implementation forwards to the <c>ThreadContext.Properties</c>.
- </para>
- </note>
- <para>
- The MDC class is similar to the <see cref="T:log4net.NDC"/> class except that it is
- based on a map instead of a stack. It provides <i>mapped
- diagnostic contexts</i>. A <i>Mapped Diagnostic Context</i>, or
- MDC in short, is an instrument for distinguishing interleaved log
- output from different sources. Log output is typically interleaved
- when a server handles multiple clients near-simultaneously.
- </para>
- <para>
- The MDC is managed on a per thread basis.
- </para>
- </remarks>
- <threadsafety static="true" instance="true"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.MDC.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.MDC"/> class.
- </summary>
- <remarks>
- Uses a private access modifier to prevent instantiation of this class.
- </remarks>
- </member>
- <member name="M:log4net.MDC.Get(System.String)">
- <summary>
- Gets the context value identified by the <paramref name="key"/> parameter.
- </summary>
- <param name="key">The key to lookup in the MDC.</param>
- <returns>The string value held for the key, or a <c>null</c> reference if no corresponding value is found.</returns>
- <remarks>
- <note>
- <para>
- The MDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Properties"/>.
- The current MDC implementation forwards to the <c>ThreadContext.Properties</c>.
- </para>
- </note>
- <para>
- If the <paramref name="key"/> parameter does not look up to a
- previously defined context then <c>null</c> will be returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.MDC.Set(System.String,System.String)">
- <summary>
- Add an entry to the MDC
- </summary>
- <param name="key">The key to store the value under.</param>
- <param name="value">The value to store.</param>
- <remarks>
- <note>
- <para>
- The MDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Properties"/>.
- The current MDC implementation forwards to the <c>ThreadContext.Properties</c>.
- </para>
- </note>
- <para>
- Puts a context value (the <paramref name="val"/> parameter) as identified
- with the <paramref name="key"/> parameter into the current thread's
- context map.
- </para>
- <para>
- If a value is already defined for the <paramref name="key"/>
- specified then the value will be replaced. If the <paramref name="val"/>
- is specified as <c>null</c> then the key value mapping will be removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.MDC.Remove(System.String)">
- <summary>
- Removes the key value mapping for the key specified.
- </summary>
- <param name="key">The key to remove.</param>
- <remarks>
- <note>
- <para>
- The MDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Properties"/>.
- The current MDC implementation forwards to the <c>ThreadContext.Properties</c>.
- </para>
- </note>
- <para>
- Remove the specified entry from this thread's MDC
- </para>
- </remarks>
- </member>
- <member name="M:log4net.MDC.Clear">
- <summary>
- Clear all entries in the MDC
- </summary>
- <remarks>
- <note>
- <para>
- The MDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Properties"/>.
- The current MDC implementation forwards to the <c>ThreadContext.Properties</c>.
- </para>
- </note>
- <para>
- Remove all the entries from this thread's MDC
- </para>
- </remarks>
- </member>
- <member name="T:log4net.NDC">
- <summary>
- Implementation of Nested Diagnostic Contexts.
- </summary>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- A Nested Diagnostic Context, or NDC in short, is an instrument
- to distinguish interleaved log output from different sources. Log
- output is typically interleaved when a server handles multiple
- clients near-simultaneously.
- </para>
- <para>
- Interleaved log output can still be meaningful if each log entry
- from different contexts had a distinctive stamp. This is where NDCs
- come into play.
- </para>
- <para>
- Note that NDCs are managed on a per thread basis. The NDC class
- is made up of static methods that operate on the context of the
- calling thread.
- </para>
- </remarks>
- <example>How to push a message into the context
- <code lang="C#">
- using(NDC.Push("my context message"))
- {
- ... all log calls will have 'my context message' included ...
-
- } // at the end of the using block the message is automatically removed
- </code>
- </example>
- <threadsafety static="true" instance="true"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.NDC.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.NDC"/> class.
- </summary>
- <remarks>
- Uses a private access modifier to prevent instantiation of this class.
- </remarks>
- </member>
- <member name="M:log4net.NDC.Clear">
- <summary>
- Clears all the contextual information held on the current thread.
- </summary>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- Clears the stack of NDC data held on the current thread.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.NDC.CloneStack">
- <summary>
- Creates a clone of the stack of context information.
- </summary>
- <returns>A clone of the context info for this thread.</returns>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- The results of this method can be passed to the <see cref="M:log4net.NDC.Inherit(System.Collections.Stack)"/>
- method to allow child threads to inherit the context of their
- parent thread.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.NDC.Inherit(System.Collections.Stack)">
- <summary>
- Inherits the contextual information from another thread.
- </summary>
- <param name="stack">The context stack to inherit.</param>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- This thread will use the context information from the stack
- supplied. This can be used to initialize child threads with
- the same contextual information as their parent threads. These
- contexts will <b>NOT</b> be shared. Any further contexts that
- are pushed onto the stack will not be visible to the other.
- Call <see cref="M:log4net.NDC.CloneStack"/> to obtain a stack to pass to
- this method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.NDC.Pop">
- <summary>
- Removes the top context from the stack.
- </summary>
- <returns>
- The message in the context that was removed from the top
- of the stack.
- </returns>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- Remove the top context from the stack, and return
- it to the caller. If the stack is empty then an
- empty string (not <c>null</c>) is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.NDC.Push(System.String)">
- <summary>
- Pushes a new context message.
- </summary>
- <param name="message">The new context message.</param>
- <returns>
- An <see cref="T:System.IDisposable"/> that can be used to clean up
- the context stack.
- </returns>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- Pushes a new context onto the context stack. An <see cref="T:System.IDisposable"/>
- is returned that can be used to clean up the context stack. This
- can be easily combined with the <c>using</c> keyword to scope the
- context.
- </para>
- </remarks>
- <example>Simple example of using the <c>Push</c> method with the <c>using</c> keyword.
- <code lang="C#">
- using(log4net.NDC.Push("NDC_Message"))
- {
- log.Warn("This should have an NDC message");
- }
- </code>
- </example>
- </member>
- <member name="M:log4net.NDC.Remove">
- <summary>
- Removes the context information for this thread. It is
- not required to call this method.
- </summary>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- This method is not implemented.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.NDC.SetMaxDepth(System.Int32)">
- <summary>
- Forces the stack depth to be at most <paramref name="maxDepth"/>.
- </summary>
- <param name="maxDepth">The maximum depth of the stack</param>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- Forces the stack depth to be at most <paramref name="maxDepth"/>.
- This may truncate the head of the stack. This only affects the
- stack in the current thread. Also it does not prevent it from
- growing, it only sets the maximum depth at the time of the
- call. This can be used to return to a known context depth.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.NDC.Depth">
- <summary>
- Gets the current context depth.
- </summary>
- <value>The current context depth.</value>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- The number of context values pushed onto the context stack.
- </para>
- <para>
- Used to record the current depth of the context. This can then
- be restored using the <see cref="M:log4net.NDC.SetMaxDepth(System.Int32)"/> method.
- </para>
- </remarks>
- <seealso cref="M:log4net.NDC.SetMaxDepth(System.Int32)"/>
- </member>
- <member name="T:log4net.ThreadContext">
- <summary>
- The log4net Thread Context.
- </summary>
- <remarks>
- <para>
- The <c>ThreadContext</c> provides a location for thread specific debugging
- information to be stored.
- The <c>ThreadContext</c> properties override any <see cref="T:log4net.GlobalContext"/>
- properties with the same name.
- </para>
- <para>
- The thread context has a properties map and a stack.
- The properties and stack can
- be included in the output of log messages. The <see cref="T:log4net.Layout.PatternLayout"/>
- supports selecting and outputting these properties.
- </para>
- <para>
- The Thread Context provides a diagnostic context for the current thread.
- This is an instrument for distinguishing interleaved log
- output from different sources. Log output is typically interleaved
- when a server handles multiple clients near-simultaneously.
- </para>
- <para>
- The Thread Context is managed on a per thread basis.
- </para>
- </remarks>
- <example>Example of using the thread context properties to store a username.
- <code lang="C#">
- ThreadContext.Properties["user"] = userName;
- log.Info("This log message has a ThreadContext Property called 'user'");
- </code>
- </example>
- <example>Example of how to push a message into the context stack
- <code lang="C#">
- using(ThreadContext.Stacks["NDC"].Push("my context message"))
- {
- log.Info("This log message has a ThreadContext Stack message that includes 'my context message'");
-
- } // at the end of the using block the message is automatically popped
- </code>
- </example>
- <threadsafety static="true" instance="true"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.ThreadContext.#ctor">
- <summary>
- Private Constructor.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.ThreadContext.s_properties">
- <summary>
- The thread context properties instance
- </summary>
- </member>
- <member name="F:log4net.ThreadContext.s_stacks">
- <summary>
- The thread context stacks instance
- </summary>
- </member>
- <member name="P:log4net.ThreadContext.Properties">
- <summary>
- The thread properties map
- </summary>
- <value>
- The thread properties map
- </value>
- <remarks>
- <para>
- The <c>ThreadContext</c> properties override any <see cref="T:log4net.GlobalContext"/>
- properties with the same name.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.ThreadContext.Stacks">
- <summary>
- The thread stacks
- </summary>
- <value>
- stack map
- </value>
- <remarks>
- <para>
- The thread local stacks.
- </para>
- </remarks>
- </member>
- </members>
-</doc>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/lib/saxon/saxon-licence.txt b/M4-RCs/qpid/dotnet/Qpid.Common/lib/saxon/saxon-licence.txt
deleted file mode 100644
index 1bf2b1279d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/lib/saxon/saxon-licence.txt
+++ /dev/null
@@ -1,471 +0,0 @@
- MOZILLA PUBLIC LICENSE
- Version 1.1
-
- ---------------
-
-1. Definitions.
-
- 1.0.1. "Commercial Use" means distribution or otherwise making the
- Covered Code available to a third party.
-
- 1.1. "Contributor" means each entity that creates or contributes to
- the creation of Modifications.
-
- 1.2. "Contributor Version" means the combination of the Original
- Code, prior Modifications used by a Contributor, and the Modifications
- made by that particular Contributor.
-
- 1.3. "Covered Code" means the Original Code or Modifications or the
- combination of the Original Code and Modifications, in each case
- including portions thereof.
-
- 1.4. "Electronic Distribution Mechanism" means a mechanism generally
- accepted in the software development community for the electronic
- transfer of data.
-
- 1.5. "Executable" means Covered Code in any form other than Source
- Code.
-
- 1.6. "Initial Developer" means the individual or entity identified
- as the Initial Developer in the Source Code notice required by Exhibit
- A.
-
- 1.7. "Larger Work" means a work which combines Covered Code or
- portions thereof with code not governed by the terms of this License.
-
- 1.8. "License" means this document.
-
- 1.8.1. "Licensable" means having the right to grant, to the maximum
- extent possible, whether at the time of the initial grant or
- subsequently acquired, any and all of the rights conveyed herein.
-
- 1.9. "Modifications" means any addition to or deletion from the
- substance or structure of either the Original Code or any previous
- Modifications. When Covered Code is released as a series of files, a
- Modification is:
- A. Any addition to or deletion from the contents of a file
- containing Original Code or previous Modifications.
-
- B. Any new file that contains any part of the Original Code or
- previous Modifications.
-
- 1.10. "Original Code" means Source Code of computer software code
- which is described in the Source Code notice required by Exhibit A as
- Original Code, and which, at the time of its release under this
- License is not already Covered Code governed by this License.
-
- 1.10.1. "Patent Claims" means any patent claim(s), now owned or
- hereafter acquired, including without limitation, method, process,
- and apparatus claims, in any patent Licensable by grantor.
-
- 1.11. "Source Code" means the preferred form of the Covered Code for
- making modifications to it, including all modules it contains, plus
- any associated interface definition files, scripts used to control
- compilation and installation of an Executable, or source code
- differential comparisons against either the Original Code or another
- well known, available Covered Code of the Contributor's choice. The
- Source Code can be in a compressed or archival form, provided the
- appropriate decompression or de-archiving software is widely available
- for no charge.
-
- 1.12. "You" (or "Your") means an individual or a legal entity
- exercising rights under, and complying with all of the terms of, this
- License or a future version of this License issued under Section 6.1.
- For legal entities, "You" includes any entity which controls, is
- controlled by, or is under common control with You. For purposes of
- this definition, "control" means (a) the power, direct or indirect,
- to cause the direction or management of such entity, whether by
- contract or otherwise, or (b) ownership of more than fifty percent
- (50%) of the outstanding shares or beneficial ownership of such
- entity.
-
-2. Source Code License.
-
- 2.1. The Initial Developer Grant.
- The Initial Developer hereby grants You a world-wide, royalty-free,
- non-exclusive license, subject to third party intellectual property
- claims:
- (a) under intellectual property rights (other than patent or
- trademark) Licensable by Initial Developer to use, reproduce,
- modify, display, perform, sublicense and distribute the Original
- Code (or portions thereof) with or without Modifications, and/or
- as part of a Larger Work; and
-
- (b) under Patents Claims infringed by the making, using or
- selling of Original Code, to make, have made, use, practice,
- sell, and offer for sale, and/or otherwise dispose of the
- Original Code (or portions thereof).
-
- (c) the licenses granted in this Section 2.1(a) and (b) are
- effective on the date Initial Developer first distributes
- Original Code under the terms of this License.
-
- (d) Notwithstanding Section 2.1(b) above, no patent license is
- granted: 1) for code that You delete from the Original Code; 2)
- separate from the Original Code; or 3) for infringements caused
- by: i) the modification of the Original Code or ii) the
- combination of the Original Code with other software or devices.
-
- 2.2. Contributor Grant.
- Subject to third party intellectual property claims, each Contributor
- hereby grants You a world-wide, royalty-free, non-exclusive license
-
- (a) under intellectual property rights (other than patent or
- trademark) Licensable by Contributor, to use, reproduce, modify,
- display, perform, sublicense and distribute the Modifications
- created by such Contributor (or portions thereof) either on an
- unmodified basis, with other Modifications, as Covered Code
- and/or as part of a Larger Work; and
-
- (b) under Patent Claims infringed by the making, using, or
- selling of Modifications made by that Contributor either alone
- and/or in combination with its Contributor Version (or portions
- of such combination), to make, use, sell, offer for sale, have
- made, and/or otherwise dispose of: 1) Modifications made by that
- Contributor (or portions thereof); and 2) the combination of
- Modifications made by that Contributor with its Contributor
- Version (or portions of such combination).
-
- (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
- effective on the date Contributor first makes Commercial Use of
- the Covered Code.
-
- (d) Notwithstanding Section 2.2(b) above, no patent license is
- granted: 1) for any code that Contributor has deleted from the
- Contributor Version; 2) separate from the Contributor Version;
- 3) for infringements caused by: i) third party modifications of
- Contributor Version or ii) the combination of Modifications made
- by that Contributor with other software (except as part of the
- Contributor Version) or other devices; or 4) under Patent Claims
- infringed by Covered Code in the absence of Modifications made by
- that Contributor.
-
-3. Distribution Obligations.
-
- 3.1. Application of License.
- The Modifications which You create or to which You contribute are
- governed by the terms of this License, including without limitation
- Section 2.2. The Source Code version of Covered Code may be
- distributed only under the terms of this License or a future version
- of this License released under Section 6.1, and You must include a
- copy of this License with every copy of the Source Code You
- distribute. You may not offer or impose any terms on any Source Code
- version that alters or restricts the applicable version of this
- License or the recipients' rights hereunder. However, You may include
- an additional document offering the additional rights described in
- Section 3.5.
-
- 3.2. Availability of Source Code.
- Any Modification which You create or to which You contribute must be
- made available in Source Code form under the terms of this License
- either on the same media as an Executable version or via an accepted
- Electronic Distribution Mechanism to anyone to whom you made an
- Executable version available; and if made available via Electronic
- Distribution Mechanism, must remain available for at least twelve (12)
- months after the date it initially became available, or at least six
- (6) months after a subsequent version of that particular Modification
- has been made available to such recipients. You are responsible for
- ensuring that the Source Code version remains available even if the
- Electronic Distribution Mechanism is maintained by a third party.
-
- 3.3. Description of Modifications.
- You must cause all Covered Code to which You contribute to contain a
- file documenting the changes You made to create that Covered Code and
- the date of any change. You must include a prominent statement that
- the Modification is derived, directly or indirectly, from Original
- Code provided by the Initial Developer and including the name of the
- Initial Developer in (a) the Source Code, and (b) in any notice in an
- Executable version or related documentation in which You describe the
- origin or ownership of the Covered Code.
-
- 3.4. Intellectual Property Matters
- (a) Third Party Claims.
- If Contributor has knowledge that a license under a third party's
- intellectual property rights is required to exercise the rights
- granted by such Contributor under Sections 2.1 or 2.2,
- Contributor must include a text file with the Source Code
- distribution titled "LEGAL" which describes the claim and the
- party making the claim in sufficient detail that a recipient will
- know whom to contact. If Contributor obtains such knowledge after
- the Modification is made available as described in Section 3.2,
- Contributor shall promptly modify the LEGAL file in all copies
- Contributor makes available thereafter and shall take other steps
- (such as notifying appropriate mailing lists or newsgroups)
- reasonably calculated to inform those who received the Covered
- Code that new knowledge has been obtained.
-
- (b) Contributor APIs.
- If Contributor's Modifications include an application programming
- interface and Contributor has knowledge of patent licenses which
- are reasonably necessary to implement that API, Contributor must
- also include this information in the LEGAL file.
-
- (c) Representations.
- Contributor represents that, except as disclosed pursuant to
- Section 3.4(a) above, Contributor believes that Contributor's
- Modifications are Contributor's original creation(s) and/or
- Contributor has sufficient rights to grant the rights conveyed by
- this License.
-
- 3.5. Required Notices.
- You must duplicate the notice in Exhibit A in each file of the Source
- Code. If it is not possible to put such notice in a particular Source
- Code file due to its structure, then You must include such notice in a
- location (such as a relevant directory) where a user would be likely
- to look for such a notice. If You created one or more Modification(s)
- You may add your name as a Contributor to the notice described in
- Exhibit A. You must also duplicate this License in any documentation
- for the Source Code where You describe recipients' rights or ownership
- rights relating to Covered Code. You may choose to offer, and to
- charge a fee for, warranty, support, indemnity or liability
- obligations to one or more recipients of Covered Code. However, You
- may do so only on Your own behalf, and not on behalf of the Initial
- Developer or any Contributor. You must make it absolutely clear than
- any such warranty, support, indemnity or liability obligation is
- offered by You alone, and You hereby agree to indemnify the Initial
- Developer and every Contributor for any liability incurred by the
- Initial Developer or such Contributor as a result of warranty,
- support, indemnity or liability terms You offer.
-
- 3.6. Distribution of Executable Versions.
- You may distribute Covered Code in Executable form only if the
- requirements of Section 3.1-3.5 have been met for that Covered Code,
- and if You include a notice stating that the Source Code version of
- the Covered Code is available under the terms of this License,
- including a description of how and where You have fulfilled the
- obligations of Section 3.2. The notice must be conspicuously included
- in any notice in an Executable version, related documentation or
- collateral in which You describe recipients' rights relating to the
- Covered Code. You may distribute the Executable version of Covered
- Code or ownership rights under a license of Your choice, which may
- contain terms different from this License, provided that You are in
- compliance with the terms of this License and that the license for the
- Executable version does not attempt to limit or alter the recipient's
- rights in the Source Code version from the rights set forth in this
- License. If You distribute the Executable version under a different
- license You must make it absolutely clear that any terms which differ
- from this License are offered by You alone, not by the Initial
- Developer or any Contributor. You hereby agree to indemnify the
- Initial Developer and every Contributor for any liability incurred by
- the Initial Developer or such Contributor as a result of any such
- terms You offer.
-
- 3.7. Larger Works.
- You may create a Larger Work by combining Covered Code with other code
- not governed by the terms of this License and distribute the Larger
- Work as a single product. In such a case, You must make sure the
- requirements of this License are fulfilled for the Covered Code.
-
-4. Inability to Comply Due to Statute or Regulation.
-
- If it is impossible for You to comply with any of the terms of this
- License with respect to some or all of the Covered Code due to
- statute, judicial order, or regulation then You must: (a) comply with
- the terms of this License to the maximum extent possible; and (b)
- describe the limitations and the code they affect. Such description
- must be included in the LEGAL file described in Section 3.4 and must
- be included with all distributions of the Source Code. Except to the
- extent prohibited by statute or regulation, such description must be
- sufficiently detailed for a recipient of ordinary skill to be able to
- understand it.
-
-5. Application of this License.
-
- This License applies to code to which the Initial Developer has
- attached the notice in Exhibit A and to related Covered Code.
-
-6. Versions of the License.
-
- 6.1. New Versions.
- Netscape Communications Corporation ("Netscape") may publish revised
- and/or new versions of the License from time to time. Each version
- will be given a distinguishing version number.
-
- 6.2. Effect of New Versions.
- Once Covered Code has been published under a particular version of the
- License, You may always continue to use it under the terms of that
- version. You may also choose to use such Covered Code under the terms
- of any subsequent version of the License published by Netscape. No one
- other than Netscape has the right to modify the terms applicable to
- Covered Code created under this License.
-
- 6.3. Derivative Works.
- If You create or use a modified version of this License (which you may
- only do in order to apply it to code which is not already Covered Code
- governed by this License), You must (a) rename Your license so that
- the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
- "MPL", "NPL" or any confusingly similar phrase do not appear in your
- license (except to note that your license differs from this License)
- and (b) otherwise make it clear that Your version of the license
- contains terms which differ from the Mozilla Public License and
- Netscape Public License. (Filling in the name of the Initial
- Developer, Original Code or Contributor in the notice described in
- Exhibit A shall not of themselves be deemed to be modifications of
- this License.)
-
-7. DISCLAIMER OF WARRANTY.
-
- COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
- DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
- THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
- IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
- YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
- COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
- OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
- ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-8. TERMINATION.
-
- 8.1. This License and the rights granted hereunder will terminate
- automatically if You fail to comply with terms herein and fail to cure
- such breach within 30 days of becoming aware of the breach. All
- sublicenses to the Covered Code which are properly granted shall
- survive any termination of this License. Provisions which, by their
- nature, must remain in effect beyond the termination of this License
- shall survive.
-
- 8.2. If You initiate litigation by asserting a patent infringement
- claim (excluding declatory judgment actions) against Initial Developer
- or a Contributor (the Initial Developer or Contributor against whom
- You file such action is referred to as "Participant") alleging that:
-
- (a) such Participant's Contributor Version directly or indirectly
- infringes any patent, then any and all rights granted by such
- Participant to You under Sections 2.1 and/or 2.2 of this License
- shall, upon 60 days notice from Participant terminate prospectively,
- unless if within 60 days after receipt of notice You either: (i)
- agree in writing to pay Participant a mutually agreeable reasonable
- royalty for Your past and future use of Modifications made by such
- Participant, or (ii) withdraw Your litigation claim with respect to
- the Contributor Version against such Participant. If within 60 days
- of notice, a reasonable royalty and payment arrangement are not
- mutually agreed upon in writing by the parties or the litigation claim
- is not withdrawn, the rights granted by Participant to You under
- Sections 2.1 and/or 2.2 automatically terminate at the expiration of
- the 60 day notice period specified above.
-
- (b) any software, hardware, or device, other than such Participant's
- Contributor Version, directly or indirectly infringes any patent, then
- any rights granted to You by such Participant under Sections 2.1(b)
- and 2.2(b) are revoked effective as of the date You first made, used,
- sold, distributed, or had made, Modifications made by that
- Participant.
-
- 8.3. If You assert a patent infringement claim against Participant
- alleging that such Participant's Contributor Version directly or
- indirectly infringes any patent where such claim is resolved (such as
- by license or settlement) prior to the initiation of patent
- infringement litigation, then the reasonable value of the licenses
- granted by such Participant under Sections 2.1 or 2.2 shall be taken
- into account in determining the amount or value of any payment or
- license.
-
- 8.4. In the event of termination under Sections 8.1 or 8.2 above,
- all end user license agreements (excluding distributors and resellers)
- which have been validly granted by You or any distributor hereunder
- prior to termination shall survive termination.
-
-9. LIMITATION OF LIABILITY.
-
- UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
- (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
- DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
- OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
- ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
- CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
- WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
- COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
- INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
- LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
- RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
- PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
- EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
- THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
-
-10. U.S. GOVERNMENT END USERS.
-
- The Covered Code is a "commercial item," as that term is defined in
- 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
- software" and "commercial computer software documentation," as such
- terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
- C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
- all U.S. Government End Users acquire Covered Code with only those
- rights set forth herein.
-
-11. MISCELLANEOUS.
-
- This License represents the complete agreement concerning subject
- matter hereof. If any provision of this License is held to be
- unenforceable, such provision shall be reformed only to the extent
- necessary to make it enforceable. This License shall be governed by
- California law provisions (except to the extent applicable law, if
- any, provides otherwise), excluding its conflict-of-law provisions.
- With respect to disputes in which at least one party is a citizen of,
- or an entity chartered or registered to do business in the United
- States of America, any litigation relating to this License shall be
- subject to the jurisdiction of the Federal Courts of the Northern
- District of California, with venue lying in Santa Clara County,
- California, with the losing party responsible for costs, including
- without limitation, court costs and reasonable attorneys' fees and
- expenses. The application of the United Nations Convention on
- Contracts for the International Sale of Goods is expressly excluded.
- Any law or regulation which provides that the language of a contract
- shall be construed against the drafter shall not apply to this
- License.
-
-12. RESPONSIBILITY FOR CLAIMS.
-
- As between Initial Developer and the Contributors, each party is
- responsible for claims and damages arising, directly or indirectly,
- out of its utilization of rights under this License and You agree to
- work with Initial Developer and Contributors to distribute such
- responsibility on an equitable basis. Nothing herein is intended or
- shall be deemed to constitute any admission of liability.
-
-13. MULTIPLE-LICENSED CODE.
-
- Initial Developer may designate portions of the Covered Code as
- "Multiple-Licensed". "Multiple-Licensed" means that the Initial
- Developer permits you to utilize portions of the Covered Code under
- Your choice of the NPL or the alternative licenses, if any, specified
- by the Initial Developer in the file described in Exhibit A.
-
-EXHIBIT A -Mozilla Public License.
-
- ``The contents of this file are subject to the Mozilla Public License
- Version 1.1 (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.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- License for the specific language governing rights and limitations
- under the License.
-
- The Original Code is ______________________________________.
-
- The Initial Developer of the Original Code is ________________________.
- Portions created by ______________________ are Copyright (C) ______
- _______________________. All Rights Reserved.
-
- Contributor(s): ______________________________________.
-
- Alternatively, the contents of this file may be used under the terms
- of the _____ license (the "[___] License"), in which case the
- provisions of [______] License are applicable instead of those
- above. If you wish to allow use of your version of this file only
- under the terms of the [____] License and not to allow others to use
- your version of this file under the MPL, indicate your decision by
- deleting the provisions above and replace them with the notice and
- other provisions required by the [___] License. If you do not delete
- the provisions above, a recipient may use your version of this file
- under either the MPL or the [___] License."
-
- [NOTE: The text of this Exhibit A may differ slightly from the text of
- the notices in the Source Code files of the Original Code. You should
- use the text of this Exhibit A rather than the text found in the
- Original Code Source Code for Your Modifications.]
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/lib/saxon/saxon8.jar b/M4-RCs/qpid/dotnet/Qpid.Common/lib/saxon/saxon8.jar
deleted file mode 100644
index 197ce75c5b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/lib/saxon/saxon8.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/lib/seclib-1.0.0/Org.Mentalis.Security.dll b/M4-RCs/qpid/dotnet/Qpid.Common/lib/seclib-1.0.0/Org.Mentalis.Security.dll
deleted file mode 100644
index c3b95d71ba..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/lib/seclib-1.0.0/Org.Mentalis.Security.dll
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/lib/seclib-1.0.0/seclib-license.txt b/M4-RCs/qpid/dotnet/Qpid.Common/lib/seclib-1.0.0/seclib-license.txt
deleted file mode 100644
index e837183135..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/lib/seclib-1.0.0/seclib-license.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Source Code License
-
-Copyright © 2002-2006, The Mentalis.org Team
-All rights reserved.
-http://www.mentalis.org/
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-- Neither the name of the Mentalis.org Team, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/resources/registry.template b/M4-RCs/qpid/dotnet/Qpid.Common/resources/registry.template
deleted file mode 100644
index 1c0a695f10..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/resources/registry.template
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<registries>
- <registry name="MainRegistry"/>
-</registries>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/csharp.xsl b/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/csharp.xsl
deleted file mode 100644
index ed04a40403..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/csharp.xsl
+++ /dev/null
@@ -1,251 +0,0 @@
-<?xml version='1.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.
-
--->
-
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:amq="http://amq.org">
-
-<!-- this class contains the templates for generating C# source code for a given framing model -->
-<xsl:import href="utils.xsl"/>
-<xsl:output method="text" indent="yes" name="textFormat"/>
-
-<xsl:param name="registry_name"/>
-
-<xsl:template match="/">
- <xsl:apply-templates mode="generate-multi" select="frames"/>
- <xsl:apply-templates mode="generate-registry" select="frames"/>
-</xsl:template>
-
-<!-- processes all frames outputting the classes in a single stream -->
-<!-- (useful for debugging etc) -->
-<xsl:template match="frame" mode="generate-single">
- <xsl:call-template name="generate-class">
- <xsl:with-param name="f" select="."/>
- </xsl:call-template>
-</xsl:template>
-
-<!-- generates seperate file for each class/frame -->
-<xsl:template match="frame" mode="generate-multi">
- <xsl:variable name="uri" select="concat(@name, '.cs')"/>
- wrote <xsl:value-of select="$uri"/>
- <xsl:result-document href="{$uri}" format="textFormat">
- <xsl:call-template name="generate-class">
- <xsl:with-param name="f" select="."/>
- </xsl:call-template>
- </xsl:result-document>
-</xsl:template>
-
-<!-- main class generation template -->
-<xsl:template name="generate-class">
- <xsl:param name="f"/>
-using Apache.Qpid.Buffer;
-using System.Text;
-
-namespace Apache.Qpid.Framing
-{
- ///
- /// <summary>This class is autogenerated
- /// Do not modify.
- ///</summary>
- /// @author Code Generator Script by robert.j.greig@jpmorgan.com
- public class <xsl:value-of select="$f/@name"/> : AMQMethodBody , IEncodableAMQDataBlock
- {
- public const int CLASS_ID = <xsl:value-of select="$f/@class-id"/>;
- public const int METHOD_ID = <xsl:value-of select="$f/@method-id"/>;
-
- <xsl:for-each select="$f/field">
- <xsl:text>public </xsl:text><xsl:value-of select="@csharp-type"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="@name"/>;
- </xsl:for-each>
-
- protected override ushort Clazz
- {
- get
- {
- return <xsl:value-of select="$f/@class-id"/>;
- }
- }
-
- protected override ushort Method
- {
- get
- {
- return <xsl:value-of select="$f/@method-id"/>;
- }
- }
-
- protected override uint BodySize
- {
- get
- {
- <xsl:choose>
- <xsl:when test="$f/field">
- return (uint)
- <xsl:for-each select="$f/field">
- <xsl:if test="position() != 1">+
- </xsl:if>
- <xsl:value-of select="amq:field-length(.)"/>
- </xsl:for-each>
- ;
- </xsl:when>
- <xsl:otherwise>return 0;</xsl:otherwise>
- </xsl:choose>
- }
- }
-
- protected override void WriteMethodPayload(ByteBuffer buffer)
- {
- <xsl:for-each select="$f/field">
- <xsl:if test="@type != 'bit'">
- <xsl:value-of select="amq:encoder(.)"/>;
- </xsl:if>
- <xsl:if test="@type = 'bit' and @boolean-index = 1">
- <xsl:text>EncodingUtils.WriteBooleans(buffer, new bool[]{</xsl:text>
- <xsl:value-of select="$f/field[@type='bit']/@name" separator=", "/>});
- </xsl:if>
- </xsl:for-each>
- }
-
- protected override void PopulateMethodBodyFromBuffer(ByteBuffer buffer)
- {
- <xsl:for-each select="$f/field">
- <xsl:value-of select="amq:decoder(.)"/>;
- </xsl:for-each>
- }
-
- public override string ToString()
- {
- StringBuilder buf = new StringBuilder(base.ToString());
- <xsl:for-each select="$f/field">
- <xsl:text>buf.Append(" </xsl:text><xsl:value-of select="@name"/>: ").Append(<xsl:value-of select="@name"/>);
- </xsl:for-each>
- return buf.ToString();
- }
-
- public static AMQFrame CreateAMQFrame(ushort channelId<xsl:if test="$f/field">, </xsl:if><xsl:value-of select="$f/field/concat(@csharp-type, ' ', @name)" separator=", "/>)
- {
- <xsl:value-of select="@name"/> body = new <xsl:value-of select="@name"/>();
- <xsl:for-each select="$f/field">
- <xsl:value-of select="concat('body.', @name, ' = ', @name)"/>;
- </xsl:for-each>
- AMQFrame frame = new AMQFrame();
- frame.Channel = channelId;
- frame.BodyFrame = body;
- return frame;
- }
-}
-}
-</xsl:template>
-
-<xsl:template match="/" mode="generate-registry">
- <xsl:text>Matching root for registry mode!</xsl:text>
- <xsl:value-of select="."/>
- <xsl:apply-templates select="frames" mode="generate-registry"/>
-</xsl:template>
-
-<xsl:template match="registries" mode="generate-registry">
-Wrote MethodBodyDecoderRegistry.cs
- <xsl:result-document href="MethodBodyDecoderRegistry.cs" format="textFormat">
-using System;
-using System.Collections;
-using log4net;
-
-namespace Apache.Qpid.Framing
-{
-
-
- ///
- /// <summary>This class is autogenerated
- /// Do not modify.
- /// </summary>
- /// @author Code Generator Script by robert.j.greig@jpmorgan.com
-
- public class MethodBodyDecoderRegistry
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(MethodBodyDecoderRegistry));
-
- private static readonly Hashtable _classMethodProductToMethodBodyMap = new Hashtable();
-
- static MethodBodyDecoderRegistry()
- {
- <xsl:for-each select="registry">
- <xsl:value-of select="concat(@name, '.Register(_classMethodProductToMethodBodyMap)')"/>;
- </xsl:for-each>
- }
-
- public static AMQMethodBody Get(int clazz, int method)
- {
- Type bodyClass = (Type) _classMethodProductToMethodBodyMap[clazz * 1000 + method];
- if (bodyClass != null)
- {
- try
- {
- return (AMQMethodBody) Activator.CreateInstance(bodyClass);
- }
- catch (Exception e)
- {
- throw new AMQFrameDecodingException(_log, "Unable to instantiate body class for class " + clazz + " and method " + method + ": " + e, e);
- }
- }
- else
- {
- throw new AMQFrameDecodingException(_log, "Unable to find a suitable decoder for class " + clazz + " and method " + method);
- }
- }
- }
- }
- </xsl:result-document>
-</xsl:template>
-
-<xsl:template match="frames" mode="list-registry">
- <xsl:if test="$registry_name">
-
- <xsl:variable name="file" select="concat($registry_name, '.cs')"/>
- wrote <xsl:value-of select="$file"/>
- <xsl:result-document href="{$file}" format="textFormat">
-
-using System.Collections;
-namespace Apache.Qpid.Framing
-{
- /**
- * This class is autogenerated, do not modify. [From <xsl:value-of select="@protocol"/>]
- */
- class <xsl:value-of select="$registry_name"/>
- {
- internal static void Register(Hashtable map)
- {
- <xsl:for-each select="frame">
- <xsl:text>map[</xsl:text>
- <xsl:value-of select="@class-id"/>
- <xsl:text> * 1000 + </xsl:text>
- <xsl:value-of select="@method-id"/>
- <xsl:text>] = typeof(</xsl:text>
- <xsl:value-of select="@name"/>);
- </xsl:for-each>
- }
-}
-}
- </xsl:result-document>
-
- </xsl:if>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/framing.xsl b/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/framing.xsl
deleted file mode 100644
index 119f439599..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/framing.xsl
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version='1.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.
-
--->
-
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:amq="http://amq.org">
-
-<xsl:import href="prepare1.xsl"/>
-<xsl:import href="prepare2.xsl"/>
-<xsl:import href="prepare3.xsl"/>
-<xsl:import href="csharp.xsl"/>
-
-<xsl:output indent="yes"/>
-<xsl:output method="text" indent="yes" name="textFormat"/>
-
-<xsl:template match="/">
- <xsl:variable name="prepare1">
- <xsl:apply-templates mode="prepare1" select="."/>
- </xsl:variable>
-
- <xsl:variable name="prepare2">
- <xsl:apply-templates mode="prepare2" select="$prepare1"/>
- </xsl:variable>
-
- <xsl:variable name="model">
- <xsl:apply-templates mode="prepare3" select="$prepare2"/>
- </xsl:variable>
-
- <xsl:apply-templates mode="generate-multi" select="$model"/>
- <xsl:apply-templates mode="list-registry" select="$model"/>
-
- <!-- dump out the intermediary files for debugging -->
- <!--
- <xsl:result-document href="prepare1.out">
- <xsl:copy-of select="$prepare1"/>
- </xsl:result-document>
-
- <xsl:result-document href="prepare2.out">
- <xsl:copy-of select="$prepare2"/>
- </xsl:result-document>
-
- <xsl:result-document href="model.out">
- <xsl:copy-of select="$model"/>
- </xsl:result-document>
- -->
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/java.xsl b/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/java.xsl
deleted file mode 100644
index 7297c6ae62..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/java.xsl
+++ /dev/null
@@ -1,230 +0,0 @@
-<?xml version='1.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.
-
--->
-
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:amq="http://amq.org">
-
-<!-- this class contains the templates for generating java source code for a given framing model -->
-<xsl:import href="utils.xsl"/>
-<xsl:output method="text" indent="yes" name="textFormat"/>
-
-<xsl:param name="registry_name"/>
-
-<xsl:template match="/">
- <xsl:apply-templates mode="generate-multi" select="frames"/>
- <xsl:apply-templates mode="generate-registry" select="frames"/>
-</xsl:template>
-
-<!-- processes all frames outputting the classes in a single stream -->
-<!-- (useful for debugging etc) -->
-<xsl:template match="frame" mode="generate-single">
- <xsl:call-template name="generate-class">
- <xsl:with-param name="f" select="."/>
- </xsl:call-template>
-</xsl:template>
-
-<!-- generates seperate file for each class/frame -->
-<xsl:template match="frame" mode="generate-multi">
- <xsl:variable name="uri" select="concat(@name, '.java')"/>
- wrote <xsl:value-of select="$uri"/>
- <xsl:result-document href="{$uri}" format="textFormat">
- <xsl:call-template name="generate-class">
- <xsl:with-param name="f" select="."/>
- </xsl:call-template>
- </xsl:result-document>
-</xsl:template>
-
-<!-- main class generation template -->
-<xsl:template name="generate-class">
- <xsl:param name="f"/>
-package org.openamq.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-/**
- * This class is autogenerated, do not modify. [From <xsl:value-of select="$f/parent::frames/@protocol"/>]
- */
-public class <xsl:value-of select="$f/@name"/> extends AMQMethodBody implements EncodableAMQDataBlock
-{
- public static final int CLASS_ID = <xsl:value-of select="$f/@class-id"/>;
- public static final int METHOD_ID = <xsl:value-of select="$f/@method-id"/>;
-
- <xsl:for-each select="$f/field">
- <xsl:text>public </xsl:text><xsl:value-of select="@java-type"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="@name"/>;
- </xsl:for-each>
-
- protected int getClazz()
- {
- return <xsl:value-of select="$f/@class-id"/>;
- }
-
- protected int getMethod()
- {
- return <xsl:value-of select="$f/@method-id"/>;
- }
-
- protected int getBodySize()
- {
- <xsl:choose>
- <xsl:when test="$f/field">
- return
- <xsl:for-each select="$f/field">
- <xsl:if test="position() != 1">+
- </xsl:if>
- <xsl:value-of select="amq:field-length(.)"/>
- </xsl:for-each>
- ;
- </xsl:when>
- <xsl:otherwise>return 0;</xsl:otherwise>
- </xsl:choose>
- }
-
- protected void writeMethodPayload(ByteBuffer buffer)
- {
- <xsl:for-each select="$f/field">
- <xsl:if test="@type != 'bit'">
- <xsl:value-of select="amq:encoder(.)"/>;
- </xsl:if>
- <xsl:if test="@type = 'bit' and @boolean-index = 1">
- <xsl:text>EncodingUtils.writeBooleans(buffer, new boolean[]{</xsl:text>
- <xsl:value-of select="$f/field[@type='bit']/@name" separator=", "/>});
- </xsl:if>
- </xsl:for-each>
- }
-
- public void populateMethodBodyFromBuffer(ByteBuffer buffer) throws AMQFrameDecodingException
- {
- <xsl:for-each select="$f/field">
- <xsl:value-of select="amq:decoder(.)"/>;
- </xsl:for-each>
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(super.toString());
- <xsl:for-each select="$f/field">
- <xsl:text>buf.append(" </xsl:text><xsl:value-of select="@name"/>: ").append(<xsl:value-of select="@name"/>);
- </xsl:for-each>
- return buf.toString();
- }
-
- public static AMQFrame createAMQFrame(int channelId<xsl:if test="$f/field">, </xsl:if><xsl:value-of select="$f/field/concat(@java-type, ' ', @name)" separator=", "/>)
- {
- <xsl:value-of select="@name"/> body = new <xsl:value-of select="@name"/>();
- <xsl:for-each select="$f/field">
- <xsl:value-of select="concat('body.', @name, ' = ', @name)"/>;
- </xsl:for-each>
- AMQFrame frame = new AMQFrame();
- frame.channel = channelId;
- frame.bodyFrame = body;
- return frame;
- }
-}
-</xsl:template>
-
-<xsl:template match="/" mode="generate-registry">
- <xsl:text>Matching root for registry mode!</xsl:text>
- <xsl:value-of select="."/>
- <xsl:apply-templates select="frames" mode="generate-registry"/>
-</xsl:template>
-
-<xsl:template match="registries" mode="generate-registry">
-Wrote MethodBodyDecoderRegistry.java
- <xsl:result-document href="MethodBodyDecoderRegistry.java" format="textFormat">package org.openamq.framing;
-
-import java.util.Map;
-import java.util.HashMap;
-import org.apache.log4j.Logger;
-import org.openamq.AMQException;
-
-/**
- * This class is autogenerated, do not modify.
- */
-public final class MethodBodyDecoderRegistry
-{
- private static final Logger _log = Logger.getLogger(MethodBodyDecoderRegistry.class);
-
- private static final Map _classMethodProductToMethodBodyMap = new HashMap();
-
- static
- {
- <xsl:for-each select="registry">
- <xsl:value-of select="concat(@name, '.register(_classMethodProductToMethodBodyMap)')"/>;
- </xsl:for-each>
- }
-
- public static AMQMethodBody get(int clazz, int method) throws AMQFrameDecodingException
- {
- Class bodyClass = (Class) _classMethodProductToMethodBodyMap.get(new Integer(clazz * 1000 + method));
- if (bodyClass != null)
- {
- try
- {
- return (AMQMethodBody) bodyClass.newInstance();
- }
- catch (Exception e)
- {
- throw new AMQFrameDecodingException(_log, "Unable to instantiate body class for class " + clazz + " and method " + method + ": " + e, e);
- }
- }
- else
- {
- throw new AMQFrameDecodingException(_log, "Unable to find a suitable decoder for class " + clazz + " and method " + method);
- }
- }
-}
-</xsl:result-document>
-</xsl:template>
-
-<xsl:template match="frames" mode="list-registry">
- <xsl:if test="$registry_name">
-
- <xsl:variable name="file" select="concat($registry_name, '.java')"/>
- wrote <xsl:value-of select="$file"/>
- <xsl:result-document href="{$file}" format="textFormat">package org.openamq.framing;
-
-import java.util.Map;
-
-/**
- * This class is autogenerated, do not modify. [From <xsl:value-of select="@protocol"/>]
- */
-class <xsl:value-of select="$registry_name"/>
-{
- static void register(Map map)
- {
- <xsl:for-each select="frame">
- <xsl:text>map.put(new Integer(</xsl:text>
- <xsl:value-of select="@class-id"/>
- <xsl:text> * 1000 + </xsl:text>
- <xsl:value-of select="@method-id"/>
- <xsl:text>), </xsl:text>
- <xsl:value-of select="concat(@name, '.class')"/>);
- </xsl:for-each>
- }
-}
- </xsl:result-document>
-
- </xsl:if>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare1.xsl b/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare1.xsl
deleted file mode 100644
index e266b0a9cc..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare1.xsl
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version='1.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.
-
--->
-
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:amq="http://amq.org">
-
-<xsl:import href="utils.xsl"/>
-
-<xsl:output indent="yes"/>
-<xsl:param name="asl_base"/>
-
-<!-- pre-process, phase 1 -->
-
-<xsl:template match="/">
- <xsl:apply-templates select="protocol" mode="prepare1"/>
-</xsl:template>
-
-<xsl:template match="amqp" mode="prepare1">
- <frames>
- <xsl:attribute name="protocol">
- <xsl:value-of select="@comment"/>
- <xsl:text> (</xsl:text>
- <xsl:text>major=</xsl:text><xsl:value-of select="option[@name='protocol_major']/@value"/>
- <xsl:text>, minor=</xsl:text><xsl:value-of select="option[@name='protocol_minor']/@value"/>
- <xsl:text>)</xsl:text>
- </xsl:attribute>
- <xsl:apply-templates mode="prepare1" select="inherit"/>
- <xsl:apply-templates mode="prepare1" select="include"/>
- <xsl:apply-templates mode="prepare1" select="domain"/>
- <xsl:apply-templates mode="prepare1" select="class"/>
- </frames>
-</xsl:template>
-
-<xsl:template match="include" mode="prepare1">
- <xsl:if test="@filename != 'asl_constants.asl'">
- <!-- skip asl_constants.asl, we don't need it and it is not well formed so causes error warnings -->
- <xsl:apply-templates select="document(@filename)" mode="prepare1"/>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="inherit" mode="prepare1">
- <xsl:variable name="ibase" select="concat('file:///', $asl_base, '/', @name, '.asl')"/>
- <xsl:choose>
- <xsl:when test="document($ibase)">
- <xsl:apply-templates select="document($ibase)" mode="prepare1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>
- Could not inherit from <xsl:value-of select="$ibase"/>; file not found.
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="class[@index]" mode="prepare1">
- <xsl:apply-templates select="method" mode="prepare1"/>
-</xsl:template>
-
-<xsl:template match="method" mode="prepare1">
- <xsl:if test="parent::class[@index]"><!-- there is a template class that has no index, which we want to skip -->
- <frame>
- <xsl:attribute name="name"><xsl:value-of select="amq:class-name(parent::class/@name, @name)"/></xsl:attribute>
- <xsl:attribute name="class-id"><xsl:value-of select="parent::class/@index"/></xsl:attribute>
- <xsl:if test="@index">
- <xsl:attribute name="method-id"><xsl:value-of select="@index"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="not(@index)">
- <xsl:attribute name="method-id"><xsl:number count="method"/></xsl:attribute>
- </xsl:if>
-
- <xsl:apply-templates select="field" mode="prepare1"/>
- </frame>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="domain" mode="prepare1">
- <domain>
- <name><xsl:value-of select="@name"/></name>
- <type><xsl:value-of select="@type"/></type>
- </domain>
-</xsl:template>
-
-<xsl:template match="field" mode="prepare1">
- <field>
- <xsl:copy-of select="@name"/>
- <xsl:copy-of select="@type"/>
- <xsl:copy-of select="@domain"/>
- </field>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare2.xsl b/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare2.xsl
deleted file mode 100644
index 0a64eb6f86..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare2.xsl
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version='1.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.
-
--->
-
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:amq="http://amq.org">
-
-<xsl:import href="utils.xsl"/>
-
-<xsl:output indent="yes"/>
-
-<!-- pre-process, phase 2 -->
-
-<xsl:key name="domain-lookup" match="domain" use="name"/>
-
-<xsl:template match="/">
- <xsl:apply-templates mode="prepare2" select="frames"/>
-</xsl:template>
-
-<xsl:template match="field[@domain]" mode="prepare2">
- <field>
- <xsl:variable name="t1" select="key('domain-lookup', @domain)/type"/>
- <xsl:attribute name="name"><xsl:value-of select="amq:field-name(@name)"/></xsl:attribute>
- <xsl:attribute name="type"><xsl:value-of select="$t1"/></xsl:attribute>
- </field>
-</xsl:template>
-
-<xsl:template match="field[@type]" mode="prepare2">
- <field>
- <xsl:attribute name="name"><xsl:value-of select="amq:field-name(@name)"/></xsl:attribute>
- <xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
- </field>
-</xsl:template>
-
-<xsl:template match="frames" mode="prepare2">
- <frames>
- <xsl:copy-of select="@protocol"/>
- <xsl:apply-templates mode="prepare2"/>
- </frames>
-</xsl:template>
-
-<xsl:template match="frame" mode="prepare2">
- <xsl:element name="{name()}">
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates mode="prepare2" select="field"/>
- </xsl:element>
-</xsl:template>
-
-<xsl:template match="domain" mode="prepare2"></xsl:template>
-
-</xsl:stylesheet>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare3.xsl b/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare3.xsl
deleted file mode 100644
index a921160dd0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/prepare3.xsl
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version='1.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.
-
--->
-
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:amq="http://amq.org">
-
-<xsl:import href="utils.xsl"/>
-
-<xsl:output indent="yes"/>
-
-<!-- final preparation of the model -->
-
-<xsl:template match="/">
- <xsl:apply-templates mode="prepare3"/>
-</xsl:template>
-
-<xsl:template match="frames" mode="prepare3">
- <frames>
- <xsl:copy-of select="@protocol"/>
- <xsl:apply-templates mode="prepare3"/>
- </frames>
-</xsl:template>
-
-<xsl:template match="frame" mode="prepare3">
- <xsl:element name="frame">
- <xsl:copy-of select="@*"/>
- <xsl:if test="field[@type='bit']"><xsl:attribute name="has-bit-field">true</xsl:attribute></xsl:if>
- <xsl:apply-templates mode="prepare3"/>
- </xsl:element>
-</xsl:template>
-
-
-<xsl:template match="field" mode="prepare3">
- <field>
- <xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
- <!-- ensure the field name is processed to be a valid java name -->
- <xsl:attribute name="name"><xsl:value-of select="amq:field-name(@name)"/></xsl:attribute>
- <!-- add some attributes to make code generation easier -->
- <xsl:attribute name="csharp-type"><xsl:value-of select="amq:csharp-type(@type)"/></xsl:attribute>
- <xsl:if test="@type='bit'">
- <xsl:attribute name="boolean-index"><xsl:number count="field[@type='bit']"/></xsl:attribute>
- </xsl:if>
- </field>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/readme.txt b/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/readme.txt
deleted file mode 100644
index c2f98050a6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/readme.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-This directory contains the xsl stylesheets used to generate the code from the
-OpenAMQ protocol specification. They require an XSLT2.0 processor, currently
-Saxon 8 is used.
-
-The generation process is controlled by the framing.xsl stylesheet. This performs
-several phases of transformation, using the other stylesheets. The transformation
-in each phase is defined in a separate file, and these are designed to also allow
-then to be run individually.
-
-The generation takes the amq.asl as input, it also requires that the path to the
-directory where the base asl definitions reside (those definitions that the main
-amq.asl defintion inherits from) be passed in via a paramter called asl_base.
-
-The files involved are as follows:
-
- framing.xsl The control file for the entire generation process
-
- prepare1.xsl Resolves the separate files that make up the protocol
- definition, building a single tree containing all the
- information as a set of 'frame' elements, each of which
- has attributes for its name, and ids for the class and
- method it refers to and contains zero or more field
- elements.
-
- A method id is generated based on the order of the
- method elements within the class elements in the original
- specification. The class id is taken from the enclosing
- class element.
-
- prepare2.xsl Resolves domains into their corresponding types. (This is
- much easier when all the information is in a single tree,
- hence the separate frame).
-
- prepare3.xsl Converts names into valid java names and augments the
- tree to include information that makes the subsequent
- generation phase simpler e.g. the index of boolean
- fields as several boolean flags are combined into a
- single byte. (This is easier once the domains have been
- resolved, hence the separate phase).
-
- java.xsl Generates java classes for each frame, and a registry of
- all the frames to a 'magic' number generated from their
- class and method id.
-
- utils.xsl Contains some utility methods for e.g. producing valid
- java names.
-
-For debugging the framing.xsl can output the intermediary files. This can be
-enabled by uncommenting the relevant lines (a comment explaining this is
-provided inline).
-
- \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/registry.xsl b/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/registry.xsl
deleted file mode 100644
index 47a2a29069..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/registry.xsl
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version='1.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.
-
--->
-
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:amq="http://amq.org">
-
-<xsl:import href="csharp.xsl"/>
-
-<xsl:output method="text" indent="yes" name="textFormat"/>
-
-<xsl:template match="/">
- <xsl:apply-templates mode="generate-registry" select="registries"/>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/utils.xsl b/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/utils.xsl
deleted file mode 100644
index d097bbc4eb..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Common/stylesheets/utils.xsl
+++ /dev/null
@@ -1,185 +0,0 @@
-<?xml version='1.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.
-
--->
-
-<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:amq="http://amq.org">
-
-<!-- This file contains functions that are used in the generation of the java classes for framing -->
-
-<!-- retrieve the java type of a given amq type -->
-<xsl:function name="amq:csharp-type">
- <xsl:param name="t"/>
- <xsl:choose>
- <xsl:when test="$t='char'">char</xsl:when>
- <xsl:when test="$t='octet'">byte</xsl:when>
- <xsl:when test="$t='short'">ushort</xsl:when>
- <xsl:when test="$t='shortstr'">string</xsl:when>
- <xsl:when test="$t='longstr'">byte[]</xsl:when>
- <xsl:when test="$t='bit'">bool</xsl:when>
- <xsl:when test="$t='long'">uint</xsl:when>
- <xsl:when test="$t='longlong'">ulong</xsl:when>
- <xsl:when test="$t='table'">FieldTable</xsl:when>
- <xsl:otherwise>Object /*WARNING: undefined type*/</xsl:otherwise>
- </xsl:choose>
-</xsl:function>
-
-<!-- retrieve the code to get the field size of a given amq type -->
-<xsl:function name="amq:field-length">
- <xsl:param name="f"/>
- <xsl:choose>
- <xsl:when test="$f/@type='bit' and $f/@boolean-index=1">
- <xsl:value-of select="concat('1 /*', $f/@name, '*/')"/>
- </xsl:when>
- <xsl:when test="$f/@type='bit' and $f/@boolean-index &gt; 1">
- <xsl:value-of select="concat('0 /*', $f/@name, '*/')"/>
- </xsl:when>
- <xsl:when test="$f/@type='char'">
- <xsl:value-of select="concat('1 /*', $f/@name, '*/')"/>
- </xsl:when>
- <xsl:when test="$f/@type='octet'">
- <xsl:value-of select="concat('1 /*', $f/@name, '*/')"/>
- </xsl:when>
- <xsl:when test="$f/@type='short'">
- <xsl:value-of select="concat('2 /*', $f/@name, '*/')"/>
- </xsl:when>
- <xsl:when test="$f/@type='long'">
- <xsl:value-of select="concat('4 /*', $f/@name, '*/')"/>
- </xsl:when>
- <xsl:when test="$f/@type='longlong'">
- <xsl:value-of select="concat('8 /*', $f/@name, '*/')"/>
- </xsl:when>
- <xsl:when test="$f/@type='shortstr'">
- <xsl:value-of select="concat('(uint)EncodingUtils.EncodedShortStringLength(', $f/@name, ')')"/>
- </xsl:when>
- <xsl:when test="$f/@type='longstr'">
- <xsl:value-of select="concat('4 + (uint) (', $f/@name, ' == null ? 0 : ', $f/@name, '.Length)')"/>
- </xsl:when>
- <xsl:when test="$f/@type='table'">
- <xsl:value-of select="concat('(uint)EncodingUtils.EncodedFieldTableLength(', $f/@name, ')')"/>
- </xsl:when>
- <xsl:otherwise><xsl:text>/* WARNING: COULD NOT DETERMINE FIELD SIZE */</xsl:text></xsl:otherwise>
- </xsl:choose>
-</xsl:function>
-
-<!-- retrieve the code to encode a field of a given amq type -->
-<!-- Note:
- This method will not provide an encoder for a bit field.
- Bit fields should be encoded together separately. -->
-
-<xsl:function name="amq:encoder">
- <xsl:param name="f"/>
- <xsl:choose>
- <xsl:when test="$f/@type='char'">
- <xsl:value-of select="concat('buffer.Put(', $f/@name, ')')"/>
- </xsl:when>
- <xsl:when test="$f/@type='octet'">
- <xsl:value-of select="concat('buffer.Put(', $f/@name, ')')"/>
- </xsl:when>
- <xsl:when test="$f/@type='short'">
- <xsl:value-of select="concat('buffer.Put(', $f/@name, ')')"/>
- </xsl:when>
- <xsl:when test="$f/@type='long'">
- <xsl:value-of select="concat('buffer.Put(', $f/@name, ')')"/>
- </xsl:when>
- <xsl:when test="$f/@type='longlong'">
- <xsl:value-of select="concat('buffer.Put(', $f/@name, ')')"/>
- </xsl:when>
- <xsl:when test="$f/@type='shortstr'">
- <xsl:value-of select="concat('EncodingUtils.WriteShortStringBytes(buffer, ', $f/@name, ')')"/>
- </xsl:when>
- <xsl:when test="$f/@type='longstr'">
- <xsl:value-of select="concat('EncodingUtils.WriteLongstr(buffer, ', $f/@name, ')')"/>
- </xsl:when>
- <xsl:when test="$f/@type='table'">
- <xsl:value-of select="concat('EncodingUtils.WriteFieldTableBytes(buffer, ', $f/@name, ')')"/>
- </xsl:when>
- <xsl:otherwise><xsl:text>/* WARNING: COULD NOT DETERMINE ENCODER */</xsl:text></xsl:otherwise>
- </xsl:choose>
-</xsl:function>
-
-<!-- retrieve the code to decode a field of a given amq type -->
-<xsl:function name="amq:decoder">
- <xsl:param name="f"/>
- <xsl:choose>
- <xsl:when test="$f/@type='bit'">
- <xsl:if test="$f/@boolean-index = 1">
- <xsl:text>bool[] bools = EncodingUtils.ReadBooleans(buffer);</xsl:text>
- </xsl:if>
- <xsl:value-of select="concat($f/@name, ' = bools[', $f/@boolean-index - 1 , ']')"/>
- </xsl:when>
- <xsl:when test="$f/@type='char'">
- <xsl:value-of select="concat($f/@name, ' = buffer.GetChar()')"/>
- </xsl:when>
- <xsl:when test="$f/@type='octet'">
- <xsl:value-of select="concat($f/@name, ' = buffer.GetByte()')"/>
- </xsl:when>
- <xsl:when test="$f/@type='short'">
- <xsl:value-of select="concat($f/@name, ' = buffer.GetUInt16()')"/>
- </xsl:when>
- <xsl:when test="$f/@type='long'">
- <xsl:value-of select="concat($f/@name, ' = buffer.GetUInt32()')"/>
- </xsl:when>
- <xsl:when test="$f/@type='longlong'">
- <xsl:value-of select="concat($f/@name, ' = buffer.GetUInt64()')"/>
- </xsl:when>
- <xsl:when test="$f/@type='shortstr'">
- <xsl:value-of select="concat($f/@name, ' = EncodingUtils.ReadShortString(buffer)')"/>
- </xsl:when>
- <xsl:when test="$f/@type='longstr'">
- <xsl:value-of select="concat($f/@name, ' = EncodingUtils.ReadLongstr(buffer)')"/>
- </xsl:when>
- <xsl:when test="$f/@type='table'">
- <xsl:value-of select="concat($f/@name, ' = EncodingUtils.ReadFieldTable(buffer)')"/>
- </xsl:when>
- <xsl:otherwise><xsl:text>/* WARNING: COULD NOT DETERMINE DECODER */</xsl:text></xsl:otherwise>
- </xsl:choose>
-</xsl:function>
-
-<!-- create the class name for a frame, based on class and method (passed in) -->
-<xsl:function name="amq:class-name">
- <xsl:param name="class"/>
- <xsl:param name="method"/>
- <xsl:value-of select="concat(amq:upper-first($class),amq:upper-first(amq:field-name($method)), 'Body')"/>
-</xsl:function>
-
-<!-- get a valid field name, processing spaces and '-'s where appropriate -->
-<xsl:function name="amq:field-name">
- <xsl:param name="name"/>
- <xsl:choose>
- <xsl:when test="contains($name, ' ')">
- <xsl:value-of select="amq:upper-first(concat(substring-before($name, ' '), amq:upper-first(substring-after($name, ' '))))"/>
- </xsl:when>
- <xsl:when test="contains($name, '-')">
- <xsl:value-of select="amq:upper-first(concat(substring-before($name, '-'), amq:upper-first(substring-after($name, '-'))))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="amq:upper-first($name)"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:function>
-
-<!-- convert the first character of the input to upper-case -->
-<xsl:function name="amq:upper-first">
- <xsl:param name="in"/>
- <xsl:value-of select="concat(upper-case(substring($in, 1, 1)), substring($in, 2))"/>
-</xsl:function>
-
-</xsl:stylesheet>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index a11c78b1d9..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-using System.Reflection;
-using System.Runtime.InteropServices;
-using log4net.Config;
-[assembly: XmlConfigurator(ConfigFile="log4net.config")]
-
-// 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.Integration.Tests")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.Integration.Tests")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("7ebdea21-1352-4673-b66e-fdc0beff461f")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("2.1.0.0")]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/Qpid.Integration.Tests.csproj b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/Qpid.Integration.Tests.csproj
deleted file mode 100755
index e7d6e59cf5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/Qpid.Integration.Tests.csproj
+++ /dev/null
@@ -1,124 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <ProjectGuid>{DE21CEBC-F38C-43EA-B576-38CA9738A00A}</ProjectGuid>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <OutputType>Library</OutputType>
- <RootNamespace>Qpid.Integration.Tests</RootNamespace>
- <AssemblyName>Qpid.Integration.Tests</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <PublishUrl>http://localhost/Qpid.Integration.Tests/</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Web</InstallFrom>
- <UpdateEnabled>true</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>true</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
- <OutputPath>bin\Debug\</OutputPath>
- <DebugSymbols>True</DebugSymbols>
- <DebugType>Full</DebugType>
- <Optimize>False</Optimize>
- <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
- <OutputPath>bin\Release\</OutputPath>
- <DebugSymbols>False</DebugSymbols>
- <DebugType>None</DebugType>
- <Optimize>True</Optimize>
- <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
- <DefineConstants>TRACE</DefineConstants>
- </PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
- <ItemGroup>
- <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\client-010\lib\log4net\log4net.dll</HintPath>
- </Reference>
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\client-010\lib\nunit\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Client\Qpid.Client.csproj">
- <Project>{68987C05-3768-452C-A6FC-6BA1D372852F}</Project>
- <Name>Qpid.Client</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Common\Qpid.Common.csproj">
- <Project>{77064C42-24D2-4CEB-9EA2-0EF481A43205}</Project>
- <Name>Qpid.Common</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Messaging\Qpid.Messaging.csproj">
- <Project>{6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}</Project>
- <Name>Qpid.Messaging</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
- <Install>true</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>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- </ItemGroup>
-</Project>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/README.txt b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/README.txt
deleted file mode 100644
index 389e3b2c6c..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/README.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory contains NUnit tests, which are 'integration' oriented. These differ
-from 'pure unit' tests which run against the code only. The integration tests require
-a broker to be available to connect to, and apply test cases that interact with it.
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/default.build b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/default.build
deleted file mode 100644
index 187aa15894..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/default.build
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Apache.Qpid.Integration.Tests" default="test">
-
- <!-- Creates a .dll for this module. -->
- <target name="build">
-
- <csc target="library"
- define="${build.defines}"
- warnaserror="false"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
-
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/nunit.framework.dll" />
- <include name="${build.dir}/Apache.Qpid.Common.dll" />
- <include name="${build.dir}/Apache.Qpid.Messaging.dll" />
- <include name="${build.dir}/Apache.Qpid.Client.dll" />
- <include name="${build.dir}/Apache.Qpid.Sasl.dll" />
- </references>
- </csc>
-
- <!--<copy tofile="${build.dir}/${project::get-name()}.dll.config" file="App.config" />-->
- <copy todir="${build.dir}" file="log4net.config"/>
-
- </target>
-
- <!-- Runs all of the tests in this module. -->
- <target name="test" depends="build">
- <nunit2 verbose="true">
- <formatter type="${nant.formatter}" usefile="true" outputdir="${build.dir}/testresults/" extension="txt"/>
- <formatter type="Plain" usefile="false"/>
- <test>
- <assemblies>
- <include name="${build.dir}/${project::get-name()}.dll"/>
- </assemblies>
- <categories>
- <include name="Integration"/>
- </categories>
- </test>
- </nunit2>
- </target>
-
-</project>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.cs
deleted file mode 100644
index fba8253251..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.cs
+++ /dev/null
@@ -1,39 +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.Integration.Tests.framework
-{
- /// <summary>
- /// Assertion models an assertion on a test <see cref="Circuit"/>.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Indicate whether or not the assertion passes when applied.
- /// </table>
- /// </summary>
- public interface Assertion
- {
- /// <summary>
- /// Applies the assertion.
- /// </summary>
- /// <return> <tt>true</tt> if the assertion passes, <tt>false</tt> if it fails. </return>
- bool apply();
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.csx
deleted file mode 100644
index 183315fec1..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Assertion.csx
+++ /dev/null
@@ -1,39 +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.Integration.Tests.framework
-{
- /// <summary>
- /// Assertion models an assertion on a test <see cref="Circuit"/>.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Indicate whether or not the assertion passes when applied.
- /// </table>
- /// </summary>
- public interface Assertion
- {
- /// <summary>
- /// Applies the assertion.
- /// </summary>
- /// <return> <tt>true</tt> if the assertion passes, <tt>false</tt> if it fails. </return>
- public bool apply();
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/AssertionBase.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/AssertionBase.csx
deleted file mode 100644
index 7de3f6c4a5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/AssertionBase.csx
+++ /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.
- *
- */
-using System.Collections.Generic.LinkedList;
-using System.Collections.Generic.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// AssertionBase is a base class for implenmenting assertions. It provides a mechanism to store error messages, and
- /// report all error messages when its <see cref="#ToString()"/> method is called.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Collect error messages.
- /// </table>
- /// </summary>
- public abstract class AssertionBase : Assertion
- {
- /// <summary> Holds the error messages. </summary>
- IList<String> errors = new LinkedList<String>();
-
- /// <summary>
- /// Adds an error message to the assertion.
- /// </summary>
- /// <param name="error"> An error message to add to the assertion. </param>
- public void addError(string error)
- {
- errors.add(error);
- }
-
- /// <summary>
- /// Prints all of the error messages in the assertion into a string.
- /// </summary>
- /// <return> All of the error messages in the assertion as a string. </return>
- public string ToString()
- {
- string result = "";
-
- for (string error : errors)
- {
- result += error;
- }
-
- return result;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/BrokerLifecycleAware.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/BrokerLifecycleAware.csx
deleted file mode 100644
index 9ef1f54064..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/BrokerLifecycleAware.csx
+++ /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.Integration.Tests.framework
-{
- /// <summary>
- /// BrokerLifecycleAware is an awareness interface implemented by test cases that can run control the life-cycle of
- /// the brokers on which they run. Its purpose is to expose additional instrumentation of brokers during testing, that
- /// enables tests to use an automated failure mechanism to simulate broker failures, and to re-start failed brokers.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Indicate whether or not a test case is using an in-vm broker.
- /// <tr><td> Track which in-vm broker is currently in use.
- /// <tr><td> Accept setting of a failure mechanism. <td> <see cref="CauseFailure"/>.
- /// </table>
- /// </summary>
- ///
- /// <remarks> Need to think about how to present the brokers through this interface. Thinking numbering the available
- /// brokers from 1 will do. Then can kill 1 and assume failing onto 2. Restart 1 and kill 2 and fail back onto
- /// 1 again? </remarks>
- public interface BrokerLifecycleAware
- {
- public void setInVmBrokers();
-
- /// <summary>
- /// Indicates whether or not a test case is using in-vm brokers.
- /// </summary>
- /// <return> <tt>true</tt> if the test is using in-vm brokers, <tt>false</tt> otherwise. </return>
- public bool usingInVmBroker();
-
- /// <summary>
- /// Sets the currently live in-vm broker.
- /// </summary>
- /// <param name="i"> The currently live in-vm broker. </param>
- public void setLiveBroker(int i);
-
- /// <summary>
- /// Reports the currently live in-vm broker.
- /// </summary>
- /// <return> The currently live in-vm broker. </return>
- public int getLiveBroker();
-
- /// <summary>
- /// Accepts a failure mechanism.
- /// </summary>
- /// <param name="failureMechanism"> The failure mechanism. </param>
- public void setFailureMechanism(CauseFailure failureMechanism);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CauseFailure.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CauseFailure.csx
deleted file mode 100644
index 1fe8918e60..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CauseFailure.csx
+++ /dev/null
@@ -1,41 +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.Integration.Tests.framework
-{
- /// <summary>
- /// CauseFailure provides a method to cause a failure in a messaging broker, usually used in conjunction with fail-over
- /// or other failure mode testing. In some cases failures may be automated, for example by shutting down an in-vm broker,
- /// or by sending a special control signal to a broker over a network connection. In other cases, it may be preferable
- /// to ask a user interactively to cause a failure scenario, in which case an implementation may display a prompt or
- /// dialog box asking for notification once the failure has been caused. The purpose of this interface is to abstract
- /// the exact cause and nature of a failure out of failure test cases.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Cause messaging broker failure.
- /// </table>
- /// </summary>
- public interface CauseFailure
- {
- /// <summary> Causes the active message broker to fail. </summary>
- void causeFailure();
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CauseFailureUserPrompt.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CauseFailureUserPrompt.csx
deleted file mode 100644
index 96f4ec53d0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CauseFailureUserPrompt.csx
+++ /dev/null
@@ -1,63 +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 Apache.Qpid.Integration.Tests.framework.CauseFailure;
-
-using java.io.IOException;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// Causes a message broker failure by interactively prompting the user to cause it.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Cause messaging broker failure.
- /// </table>
- /// </summary>
- public class CauseFailureUserPrompt : CauseFailure
- {
- /// <summary> Causes the active message broker to fail.</summary>
- public void causeFailure()
- {
- waitForUser("Cause a broker failure now, then press Return.");
- }
-
- /// <summary>
- /// Outputs a prompt to the console and waits for the user to press return.
- /// </summary>
- /// <param name="prompt"> The prompt to display on the console. </param>
- private void waitForUser(string prompt)
- {
- System.out.println(prompt);
-
- try
- {
- System.in.read();
- }
- catch (IOException e)
- {
- // Ignored.
- }
-
- System.out.println("Continuing.");
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.cs
deleted file mode 100644
index d5f0ed15e2..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.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.
- *
- */
-using System.Collections.Generic;//.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A Circuit is the basic test unit against which test cases are to be written. A circuit consists of two 'ends', an
- /// instigating 'publisher' end and a more passive 'receivers' end.
- ///
- /// <p/>Once created, the life-cycle of a circuit may be controlled by <see cref="#start()"/>ing it, or <see cref="#close()"/>ing it.
- /// Once started, the circuit is ready to send messages over. Once closed the circuit can no longer be used.
- ///
- /// <p/>The state of the circuit may be taken with the <see cref="#check()"/> method, and asserted against by the
- /// <see cref="#applyAssertions(System.Collections.Generic.IList)"/> method.
- ///
- /// <p/>There is a default test procedure which may be performed against the circuit. The outline of this procedure is:
- ///
- /// <p/><pre>
- /// Start the circuit.
- /// Send test messages.
- /// Request a status report.
- /// Assert conditions on the publishing end of the circuit.
- /// Assert conditions on the receiving end of the circuit.
- /// Close the circuit.
- /// Pass with no failed assertions or fail with a list of failed assertions.
- /// </pre>
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Supply the publishing and receiving ends of a test messaging circuit.
- /// <tr><td> Start the circuit running.
- /// <tr><td> Close the circuit down.
- /// <tr><td> Take a reading of the circuits state.
- /// <tr><td> Apply assertions against the circuits state.
- /// <tr><td> Send test messages over the circuit.
- /// <tr><td> Perform the default test procedue on the circuit.
- /// </table>
- /// </summary>
- public interface Circuit
- {
- /// <summary> Gets the interface on the publishing end of the circuit. </summary>
- ///
- /// <return> The publishing end of the circuit. </return>
- Publisher GetPublisher();
-
- /// <summary> Gets the interface on the receiving end of the circuit. </summary>
- ///
- /// <return> The receiving end of the circuit. </return>
- Receiver GetReceiver();
-
- /// <summary> Connects and starts the circuit. After this method is called the circuit is ready to send messages. </summary>
- void Start();
-
- /// <summary>
- /// Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit,
- /// into a report, against which assertions may be checked.
- /// </summary>
- void Check();
-
- /// <summary> Closes the circuit. All associated resources are closed. </summary>
- void Close();
-
- /// <summary>
- /// Applied a list of assertions against the test circuit. The <see cref="#check()"/> method should be called before doing
- /// this, to ensure that the circuit has gathered its state into a report to assert against.
- /// </summary>
- ///
- /// <param name="assertions"> The list of assertions to apply to the circuit. </param>
- ///
- /// <return> Any assertions that failed. </return>
- IList<Assertion> ApplyAssertions(IList<Assertion> assertions);
-
- /// <summary>
- /// Runs the default test procedure against the circuit, and checks that all of the specified assertions hold.
- /// </summary>
- ///
- /// <param name="numMessages"> The number of messages to send using the default test procedure. </param>
- /// <param name="assertions"> The list of assertions to apply. </param>
- ///
- /// <return> Any assertions that failed. </return>
- IList<Assertion> Test(int numMessages, IList<Assertion> assertions);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.csx
deleted file mode 100644
index bf2c623cff..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Circuit.csx
+++ /dev/null
@@ -1,103 +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.Collections.Generic.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A Circuit is the basic test unit against which test cases are to be written. A circuit consists of two 'ends', an
- /// instigating 'publisher' end and a more passive 'receivers' end.
- ///
- /// <p/>Once created, the life-cycle of a circuit may be controlled by <see cref="#start()"/>ing it, or <see cref="#close()"/>ing it.
- /// Once started, the circuit is ready to send messages over. Once closed the circuit can no longer be used.
- ///
- /// <p/>The state of the circuit may be taken with the <see cref="#check()"/> method, and asserted against by the
- /// <see cref="#applyAssertions(System.Collections.Generic.IList)"/> method.
- ///
- /// <p/>There is a default test procedure which may be performed against the circuit. The outline of this procedure is:
- ///
- /// <p/><pre>
- /// Start the circuit.
- /// Send test messages.
- /// Request a status report.
- /// Assert conditions on the publishing end of the circuit.
- /// Assert conditions on the receiving end of the circuit.
- /// Close the circuit.
- /// Pass with no failed assertions or fail with a list of failed assertions.
- /// </pre>
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Supply the publishing and receiving ends of a test messaging circuit.
- /// <tr><td> Start the circuit running.
- /// <tr><td> Close the circuit down.
- /// <tr><td> Take a reading of the circuits state.
- /// <tr><td> Apply assertions against the circuits state.
- /// <tr><td> Send test messages over the circuit.
- /// <tr><td> Perform the default test procedue on the circuit.
- /// </table>
- /// </summary>
- public interface Circuit
- {
- /// <summary>
- /// Gets the interface on the publishing end of the circuit.
- /// </summary>
- /// <return> The publishing end of the circuit. </return>
- public Publisher getPublisher();
-
- /// <summary>
- /// Gets the interface on the receiving end of the circuit.
- /// </summary>
- /// <return> The receiving end of the circuit. </return>
- public Receiver getReceiver();
-
- /// <summary>
- /// Connects and starts the circuit. After this method is called the circuit is ready to send messages.
- public void start();
-
- /// <summary>
- /// Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit,
- /// into a report, against which assertions may be checked.
- public void check();
-
- /// <summary>
- /// Closes the circuit. All associated resources are closed.
- public void close();
-
- /// <summary>
- /// Applied a list of assertions against the test circuit. The <see cref="#check()"/> method should be called before doing
- /// this, to ensure that the circuit has gathered its state into a report to assert against.
- /// </summary>
- /// <param name="assertions"> The list of assertions to apply to the circuit. </param>
- ///
- /// <return> Any assertions that failed. </return>
- public IList<Assertion> applyAssertions(List<Assertion> assertions);
-
- /// <summary>
- /// Runs the default test procedure against the circuit, and checks that all of the specified assertions hold.
- /// </summary>
- /// <param name="numMessages"> The number of messages to send using the default test procedure. </param>
- /// <param name="assertions"> The list of assertions to apply. </param>
- ///
- /// <return> Any assertions that failed. </return>
- public IList<Assertion> test(int numMessages, List<Assertion> assertions);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CircuitEnd.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CircuitEnd.csx
deleted file mode 100644
index 6edaf428de..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CircuitEnd.csx
+++ /dev/null
@@ -1,86 +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 javax.jms.*;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A CircuitEnd is a pair consisting of one message producer and one message consumer, that represents one end of a
- /// test circuit. It is a standard unit of connectivity allowing a full-duplex conversation to be held, provided both
- /// the consumer and producer are instantiated and configured.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide a message producer for sending messages.
- /// <tr><td> Provide a message consumer for receiving messages.
- /// </table>
- /// </summary>
- ///
- /// <remarks> Update the <see cref="org.apache.qpid.util.ConversationFactory"/> so that it accepts these as the basic conversation
- /// connection units.</remarks>
- public interface CircuitEnd
- {
- /// <summary>
- /// Gets the message producer at this circuit end point.
- /// </summary>
- /// <return> The message producer at with this circuit end point. </return>
- public IMessagePublisher GetProducer();
-
- /// <summary>
- /// Gets the message consumer at this circuit end point.
- /// </summary>
- /// <return> The message consumer at this circuit end point. </return>
- public IMessageConsumer GetConsumer();
-
- /// <summary>
- /// Send the specified message over the producer at this end point.
- /// </summary>
- /// <param name="message"> The message to send. </param>
- ///
- /// <exception cref="JMSException"> Any JMS exception occuring during the send is allowed to fall through. </exception>
- public void Send(IMessage message);
-
- /// <summary>
- /// Gets the JMS Session associated with this circuit end point.
- /// </summary>
- /// <return> The JMS Session associated with this circuit end point. </return>
- public IChannel GetSession();
-
- /// <summary>
- /// Closes the message producers and consumers and the sessions, associated with this circuit end point.
- /// </summary>
- /// <exception cref="JMSException"> Any JMSExceptions occurring during the close are allowed to fall through. </exception>
- public void Close();
-
- /// <summary>
- /// Returns the message monitor for reporting on received messages on this circuit end.
- /// </summary>
- /// <return> The message monitor for this circuit end. </return>
- public MessageMonitor GetMessageMonitor();
-
- /// <summary>
- /// Returns the exception monitor for reporting on exceptions received on this circuit end.
- /// </summary>
- /// <return> The exception monitor for this circuit end. </return>
- public ExceptionMonitor GetExceptionMonitor();
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CircuitEndBase.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CircuitEndBase.csx
deleted file mode 100644
index db7fbde6ea..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/CircuitEndBase.csx
+++ /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.
- *
- */
-//using javax.jms.*;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A CircuitEndBase is a pair consisting of one message producer and one message consumer, that represents one end of a
- /// test circuit. It is a standard unit of connectivity allowing a full-duplex conversation to be held, provided both
- /// the consumer and producer are instantiated and configured.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide a message producer for sending messages.
- /// <tr><td> Provide a message consumer for receiving messages.
- /// </table>
- /// </summary>
- public class CircuitEndBase : CircuitEnd
- {
- /// <summary> Holds the single message producer. </summary>
- MessageProducer producer;
-
- /// <summary> Holds the single message consumer. </summary>
- MessageConsumer consumer;
-
- /// <summary> Holds the controlSession for the circuit end. </summary>
- Session session;
-
- /// <summary> Holds the message monitor for the circuit end. </summary>
- MessageMonitor messageMonitor;
-
- /// <summary> Holds the exception monitor for the circuit end. </summary>
- ExceptionMonitor exceptionMonitor;
-
- /// <summary>
- /// Creates a circuit end point on the specified producer, consumer and controlSession. Monitors are also configured
- /// for messages and exceptions received by the circuit end.
- /// </summary>
- /// <param name="producer"> The message producer for the circuit end point. </param>
- /// <param name="consumer"> The message consumer for the circuit end point. </param>
- /// <param name="session"> The controlSession for the circuit end point. </param>
- /// <param name="messageMonitor"> The monitor to notify of all messages received by the circuit end. </param>
- /// <param name="exceptionMonitor"> The monitor to notify of all exceptions received by the circuit end. </param>
- public CircuitEndBase(MessageProducer producer, MessageConsumer consumer, Session session, MessageMonitor messageMonitor,
- ExceptionMonitor exceptionMonitor)
- {
- this.producer = producer;
- this.consumer = consumer;
- this.session = session;
-
- this.messageMonitor = messageMonitor;
- this.exceptionMonitor = exceptionMonitor;
- }
-
- /// <summary>
- /// Gets the message producer at this circuit end point.
- /// </summary>
- /// <return> The message producer at with this circuit end point. </return>
- public IMessagePublisher GetProducer()
- {
- return producer;
- }
-
- /// <summary>
- /// Gets the message consumer at this circuit end point.
- /// </summary>
- /// <return> The message consumer at this circuit end point. </return>
- public IMessageConsumer GetConsumer()
- {
- return consumer;
- }
-
- /// <summary>
- /// Send the specified message over the producer at this end point.
- /// </summary>
- /// <param name="message"> The message to send. </param>
- /// <exception cref="javax.jms.JMSException"> Any JMS exception occuring during the send is allowed to fall through. </exception>
- public void Send(IMessage message)
- {
- producer.send(message);
- }
-
- /// <summary>
- /// Gets the JMS Session associated with this circuit end point.
- /// </summary>
- /// <return> The JMS Session associated with this circuit end point. </return>
- public IChannel GetSession()
- {
- return session;
- }
-
- /// <summary>
- /// Closes the message producers and consumers and the sessions, associated with this circuit end point.
- /// </summary>
- /// <exception cref="javax.jms.JMSException"> Any JMSExceptions occurring during the close are allowed to fall through. </exception>
- public void Close()
- {
- if (producer != null)
- {
- producer.Close();
- }
-
- if (consumer != null)
- {
- consumer.Close();
- }
- }
-
- /// <summary>
- /// Returns the message monitor for reporting on received messages on this circuit end.
- /// </summary>
- /// <return> The message monitor for this circuit end. </return>
- public MessageMonitor GetMessageMonitor()
- {
- return messageMonitor;
- }
-
- /// <summary>
- /// Returns the exception monitor for reporting on exceptions received on this circuit end.
- /// </summary>
- /// <return> The exception monitor for this circuit end. </return>
- public ExceptionMonitor GetExceptionMonitor()
- {
- return exceptionMonitor;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/ExceptionMonitor.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/ExceptionMonitor.csx
deleted file mode 100644
index b2a989b940..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/ExceptionMonitor.csx
+++ /dev/null
@@ -1,184 +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 log4net;
-
-using javax.jms.ExceptionListener;
-using javax.jms.JMSException;
-
-using java.io.PrintWriter;
-using java.io.StringWriter;
-using java.util.ArrayList;
-using System.Collections.Generic.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// An exception monitor, listens for JMS exception on a connection or consumer. It record all exceptions that it receives
- /// and provides methods to test the number and type of exceptions received.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Record all exceptions received.
- /// </table>
- /// </summary>
- public class ExceptionMonitor : ExceptionListener
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(ExceptionMonitor));
-
- /// <summary> Holds the received exceptions. </summary>
- IList<Exception> exceptions = new ArrayList<Exception>();
-
- /// <summary>
- /// Receives incoming exceptions.
- /// </summary>
- /// <param name="e"> The exception to record. </param>
- public synchronized void onException(JMSException e)
- {
- log.debug("public void onException(JMSException e): called", e);
-
- exceptions.add(e);
- }
-
- /// <summary>
- /// Checks that no exceptions have been received.
- /// </summary>
- /// <return> <tt>true</tt> if no exceptions have been received, <tt>false</tt> otherwise. </return>
- public synchronized bool assertNoExceptions()
- {
- return exceptions.isEmpty();
- }
-
- /// <summary>
- /// Checks that exactly one exception has been received.
- /// </summary>
- /// <return> <tt>true</tt> if exactly one exception been received, <tt>false</tt> otherwise. </return>
- public synchronized bool assertOneJMSException()
- {
- return exceptions.size() == 1;
- }
-
- /// <summary>
- /// Checks that exactly one exception, with a linked cause of the specified type, has been received.
- /// </summary>
- /// <param name="aClass"> The type of the linked cause. </param>
- ///
- /// <return> <tt>true</tt> if exactly one exception, with a linked cause of the specified type, been received, </return>
- /// <tt>false</tt> otherwise.
- public synchronized bool assertOneJMSExceptionWithLinkedCause(Class aClass)
- {
- if (exceptions.size() == 1)
- {
- Exception e = exceptions.get(0);
-
- if (e instanceof JMSException)
- {
- JMSException jmse = (JMSException) e;
-
- Exception linkedCause = jmse.getLinkedException();
-
- if ((linkedCause != null) && aClass.isInstance(linkedCause))
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /// <summary>
- /// Checks that at least one exception of the the specified type, has been received.
- /// </summary>
- /// <param name="exceptionClass"> The type of the exception. </param>
- ///
- /// <return> <tt>true</tt> if at least one exception of the specified type has been received, <tt>false</tt> otherwise. </return>
- public synchronized bool assertExceptionOfType(Class exceptionClass)
- {
- // Start by assuming that the exception has no been received.
- bool passed = false;
-
- // Scan all the exceptions for a match.
- for (Exception e : exceptions)
- {
- if (exceptionClass.isInstance(e))
- {
- passed = true;
-
- break;
- }
- }
-
- return passed;
- }
-
- /// <summary>
- /// Reports the number of exceptions held by this monitor.
- /// </summary>
- /// <return> The number of exceptions held by this monitor. </return>
- public synchronized int size()
- {
- return exceptions.size();
- }
-
- /// <summary>
- /// Clears the record of received exceptions.
- /// </summary>
- public synchronized void reset()
- {
- exceptions = new ArrayList<Exception>();
- }
-
- /// <summary>
- /// Provides a dump of the stack traces of all exceptions that this exception monitor was notified of. Mainly
- /// use for debugging/test failure reporting purposes.
- /// </summary>
- /// <return> A string containing a dump of the stack traces of all exceptions. </return>
- public synchronized string ToString()
- {
- string result = "ExceptionMonitor: holds " + exceptions.size() + " exceptions.\n\n";
-
- for (Exception ex : exceptions)
- {
- result += getStackTrace(ex) + "\n";
- }
-
- return result;
- }
-
- /// <summary>
- /// Prints an exception stack trace into a string.
- /// </summary>
- /// <param name="t"> The throwable to get the stack trace from. </param>
- ///
- /// <return> A string containing the throwables stack trace. </return>
- public static string getStackTrace(Throwable t)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw, true);
- t.printStackTrace(pw);
- pw.flush();
- sw.flush();
-
- return sw.ToString();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.cs
deleted file mode 100644
index a7a663e531..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.cs
+++ /dev/null
@@ -1,282 +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 log4net;
-using NUnit.Framework;
-//using org.apache.log4j.NDC;
-
-using Apache.Qpid.Integration.Tests.framework.sequencers;//.CircuitFactory;
-
-//using uk.co.thebadgerset.junit.extensions.AsymptoticTestCase;
-//using uk.co.thebadgerset.junit.extensions.SetupTaskAware;
-//using uk.co.thebadgerset.junit.extensions.SetupTaskHandler;
-//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-//using uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
-
-//using java.util.ArrayList;
-using System.Collections.Generic;//.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// FrameworkBaseCase provides a starting point for writing test cases against the test framework. Its main purpose is
- /// to provide some convenience methods for testing.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Create and clean up in-vm brokers on every test case.
- /// <tr><td> Produce lists of assertions from assertion creation calls.
- /// <tr><td> Produce JUnit failures from assertion failures.
- /// <tr><td> Convert failed assertions to error messages.
- /// </table>
- /// </summary>
- public class FrameworkBaseCase //extends AsymptoticTestCase : FrameworkTestContext, SetupTaskAware, BrokerLifecycleAware
- {
- /// <summary> Used for debugging purposes. </summary>
- private static ILog log = LogManager.GetLogger(typeof(FrameworkBaseCase));
-
- /// <summary> Holds the test sequencer to create and run test circuits with. </summary>
- protected CircuitFactory circuitFactory;// = new LocalCircuitFactory();
-
- /// <summary> Used to read the tests configurable properties through. </summary>
- protected TestModel testProps;
-
- /// <summary> A default setup task processor to delegate setup tasks to. </summary>
- //protected SetupTaskHandler taskHandler = new SetupTaskHandler();
-
- /// <summary> Flag used to track whether the test is in-vm or not. </summary>
- //protected bool isUsingInVM;
-
- /// <summary> Holds the failure mechanism. </summary>
- //protected CauseFailure failureMechanism = new CauseFailureUserPrompt();
-
- /*
- /// <summary>
- /// Creates a new test case with the specified name.
- /// </summary>
- /// <param name="name"> The test case name. </param>
- public FrameworkBaseCase(string name) : base(name)
- {
- }
- */
-
- /// <summary>
- /// Returns the test case sequencer that provides test circuit, and test sequence implementations. The sequencer
- /// that this base case returns by default is suitable for running a test circuit with both circuit ends colocated
- /// on the same JVM.
- /// </summary>
- /// <return> The test case sequencer. </return>
- protected CircuitFactory GetCircuitFactory()
- {
- return circuitFactory;
- }
-
- /// <summary>
- /// Overrides the default test circuit factory. Test decorators can use this to supply distributed test sequencers or
- /// other test circuit factory specializations.
- /// </summary>
- /// <param name="circuitFactory"> The new test circuit factory. </param>
- public void SetCircuitFactory(CircuitFactory circuitFactory)
- {
- this.circuitFactory = circuitFactory;
- }
-
- /*
- /// <summary>
- /// Reports the current test case name.
- /// </summary>
- /// <return> The current test case name. </return>
- public TestCaseVector GetTestCaseVector()
- {
- return new TestCaseVector(this.getName(), 0);
- }
- */
-
- /// <summary>
- /// Reports the current test case parameters.
- /// </summary>
- /// <return> The current test case parameters. </return>
- public TestModel getTestParameters()
- {
- return testProps;
- }
-
- /// <summary>
- /// Creates a list of assertions.
- /// </summary>
- /// <param name="asserts"> The assertions to compile in a list. </param>
- ///
- /// <return> A list of assertions. </return>
- protected IList<Assertion> AssertionList(params Assertion[] asserts)
- {
- IList<Assertion> result = new List<Assertion>();
-
- foreach (Assertion assertion in asserts)
- {
- result.Add(assertion);
- }
-
- return result;
- }
-
- /// <summary>
- /// Generates a JUnit assertion exception (failure) if any assertions are passed into this method, also concatenating
- /// all of the error messages in the assertions together to form an error message to diagnose the test failure with.
- /// </summary>
- /// <param name="asserts"> The list of failed assertions. </param>
- protected static void AssertNoFailures(List<Assertion> asserts)
- {
- log.Debug("protected void assertNoFailures(List<Assertion> asserts = " + asserts + "): called");
-
- // Check if there are no assertion failures, and return without doing anything if so.
- if ((asserts == null) || (asserts.Count == 0))
- {
- return;
- }
-
- // Compile all of the assertion failure messages together.
- string errorMessage = AssertionsToString(asserts);
-
- // Fail with the error message from all of the assertions.
- Assert.Fail(errorMessage);
- }
-
- /// <summary>
- /// Converts a list of failed assertions into an error message.
- /// </summary>
- /// <param name="asserts"> The failed assertions. </param>
- ///
- /// <return> The error message. </return>
- protected static string AssertionsToString(List<Assertion> asserts)
- {
- string errorMessage = "";
-
- foreach (Assertion assertion in asserts)
- {
- errorMessage += assertion.ToString() + "\n";
- }
-
- return errorMessage;
- }
-
- /// <summary>
- /// Ensures that the in-vm broker is created and initialized.
- /// </summary>
- ///
- /// <exception cref="Exception"> Any exceptions allowed to fall through and fail the test. </exception>
- [SetUp]
- protected void SetUp()
- {
- //NDC.Push(Name);
-
- //testProps = TestContextProperties.getInstance(TestModel.defaults);
-
- // Process all optional setup tasks. This may include in-vm broker creation, if a decorator has added it.
- //taskHandler.runSetupTasks();
- }
-
- /// <summary> Ensures that the in-vm broker is cleaned up after each test run. </summary>
- [TearDown]
- protected void TearDown()
- {
- //NDC.Pop();
-
- // Process all optional tear down tasks. This may include in-vm broker clean up, if a decorator has added it.
- //taskHandler.runTearDownTasks();
- }
-
- /*
- /// <summary>
- /// Adds the specified task to the tests setup.
- /// </summary>
- /// <param name="task"> The task to add to the tests setup. </param>
- public void chainSetupTask(Runnable task)
- {
- taskHandler.chainSetupTask(task);
- }
- */
-
- /*
- /// <summary>
- /// Adds the specified task to the tests tear down.
- /// </summary>
- /// <param name="task"> The task to add to the tests tear down. </param>
- public void chainTearDownTask(Runnable task)
- {
- taskHandler.chainTearDownTask(task);
- }
- */
-
- /*
- /// <summary>
- /// Should provide a translation from the junit method name of a test to its test case name as known to the test
- /// clients that will run the test. The purpose of this is to convert the JUnit method name into the correct test
- /// case name to place into the test invite. For example the method "testP2P" might map onto the interop test case
- /// name "TC2_BasicP2P".
- /// </summary>
- /// <param name="methodName"> The name of the JUnit test method. </param>
- ///
- /// <return> The name of the corresponding interop test case. </return>
- public string getTestCaseNameForTestMethod(string methodName)
- {
- return methodName;
- }
-
- public void setInVmBrokers()
- {
- isUsingInVM = true;
- }
-
- /// <summary>
- /// Indicates whether or not a test case is using in-vm brokers.
- /// </summary>
- /// <return> <tt>true</tt> if the test is using in-vm brokers, <tt>false</tt> otherwise. </return>
- public bool usingInVmBroker()
- {
- return isUsingInVM;
- }
-
- /// <summary>
- /// Sets the currently live in-vm broker.
- /// </summary>
- /// <param name="i"> The currently live in-vm broker. </param>
- public void setLiveBroker(int i)
- { }
-
- /// <summary>
- /// Reports the currently live in-vm broker.
- /// </summary>
- /// <return> The currently live in-vm broker. </return>
- public int getLiveBroker()
- {
- return 0;
- }
-
- /// <summary>
- /// Accepts a failure mechanism.
- /// </summary>
- /// <param name="failureMechanism"> The failure mechanism. </param>
- public void setFailureMechanism(CauseFailure failureMechanism)
- {
- this.failureMechanism = failureMechanism;
- }
- */
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.csx
deleted file mode 100644
index 00ed572603..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/FrameworkBaseCase.csx
+++ /dev/null
@@ -1,272 +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 log4net;
-using org.apache.log4j.NDC;
-
-using Apache.Qpid.Integration.Tests.framework.BrokerLifecycleAware;
-using Apache.Qpid.Integration.Tests.framework.sequencers.CircuitFactory;
-
-using uk.co.thebadgerset.junit.extensions.AsymptoticTestCase;
-using uk.co.thebadgerset.junit.extensions.SetupTaskAware;
-using uk.co.thebadgerset.junit.extensions.SetupTaskHandler;
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-using uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
-
-using java.util.ArrayList;
-using System.Collections.Generic.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// FrameworkBaseCase provides a starting point for writing test cases against the test framework. Its main purpose is
- /// to provide some convenience methods for testing.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Create and clean up in-vm brokers on every test case.
- /// <tr><td> Produce lists of assertions from assertion creation calls.
- /// <tr><td> Produce JUnit failures from assertion failures.
- /// <tr><td> Convert failed assertions to error messages.
- /// </table>
- /// </summary>
- public class FrameworkBaseCase extends AsymptoticTestCase : FrameworkTestContext, SetupTaskAware,
- BrokerLifecycleAware
- {
- /// <summary> Used for debugging purposes. </summary>
- private static ILog log = LogManager.GetLogger(typeof(FrameworkBaseCase));
-
- /// <summary> Holds the test sequencer to create and run test circuits with. </summary>
- protected CircuitFactory circuitFactory = new LocalCircuitFactory();
-
- /// <summary> Used to read the tests configurable properties through. </summary>
- protected ParsedProperties testProps;
-
- /// <summary> A default setup task processor to delegate setup tasks to. </summary>
- protected SetupTaskHandler taskHandler = new SetupTaskHandler();
-
- /// <summary> Flag used to track whether the test is in-vm or not. </summary>
- protected bool isUsingInVM;
-
- /// <summary> Holds the failure mechanism. </summary>
- protected CauseFailure failureMechanism = new CauseFailureUserPrompt();
-
- /// <summary>
- /// Creates a new test case with the specified name.
- /// </summary>
- /// <param name="name"> The test case name. </param>
- public FrameworkBaseCase(string name)
- {
- super(name);
- }
-
- /// <summary>
- /// Returns the test case sequencer that provides test circuit, and test sequence implementations. The sequencer
- /// that this base case returns by default is suitable for running a test circuit with both circuit ends colocated
- /// on the same JVM.
- /// </summary>
- /// <return> The test case sequencer. </return>
- protected CircuitFactory getCircuitFactory()
- {
- return circuitFactory;
- }
-
- /// <summary>
- /// Overrides the default test circuit factory. Test decorators can use this to supply distributed test sequencers or
- /// other test circuit factory specializations.
- /// </summary>
- /// <param name="circuitFactory"> The new test circuit factory. </param>
- public void setCircuitFactory(CircuitFactory circuitFactory)
- {
- this.circuitFactory = circuitFactory;
- }
-
- /// <summary>
- /// Reports the current test case name.
- /// </summary>
- /// <return> The current test case name. </return>
- public TestCaseVector getTestCaseVector()
- {
- return new TestCaseVector(this.getName(), 0);
- }
-
- /// <summary>
- /// Reports the current test case parameters.
- /// </summary>
- /// <return> The current test case parameters. </return>
- public MessagingTestConfigProperties getTestParameters()
- {
- return new MessagingTestConfigProperties(testProps);
- }
-
- /// <summary>
- /// Creates a list of assertions.
- /// </summary>
- /// <param name="asserts"> The assertions to compile in a list. </param>
- ///
- /// <return> A list of assertions. </return>
- protected IList<Assertion> assertionList(Assertion... asserts)
- {
- IList<Assertion> result = new ArrayList<Assertion>();
-
- for (Assertion assertion : asserts)
- {
- result.add(assertion);
- }
-
- return result;
- }
-
- /// <summary>
- /// Generates a JUnit assertion exception (failure) if any assertions are passed into this method, also concatenating
- /// all of the error messages in the assertions together to form an error message to diagnose the test failure with.
- /// </summary>
- /// <param name="asserts"> The list of failed assertions. </param>
- protected static void assertNoFailures(List<Assertion> asserts)
- {
- log.debug("protected void assertNoFailures(List<Assertion> asserts = " + asserts + "): called");
-
- // Check if there are no assertion failures, and return without doing anything if so.
- if ((asserts == null) || asserts.isEmpty())
- {
- return;
- }
-
- // Compile all of the assertion failure messages together.
- string errorMessage = assertionsToString(asserts);
-
- // Fail with the error message from all of the assertions.
- fail(errorMessage);
- }
-
- /// <summary>
- /// Converts a list of failed assertions into an error message.
- /// </summary>
- /// <param name="asserts"> The failed assertions. </param>
- ///
- /// <return> The error message. </return>
- protected static string assertionsToString(List<Assertion> asserts)
- {
- string errorMessage = "";
-
- for (Assertion assertion : asserts)
- {
- errorMessage += assertion.ToString() + "\n";
- }
-
- return errorMessage;
- }
-
- /// <summary>
- /// Ensures that the in-vm broker is created and initialized.
- /// </summary>
- ///
- /// <exception cref="Exception"> Any exceptions allowed to fall through and fail the test. </exception>
- protected void setUp() throws Exception
- {
- NDC.push(getName());
-
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- // Process all optional setup tasks. This may include in-vm broker creation, if a decorator has added it.
- taskHandler.runSetupTasks();
- }
-
- /// <summary> Ensures that the in-vm broker is cleaned up after each test run. </summary>
- protected void tearDown()
- {
- NDC.pop();
-
- // Process all optional tear down tasks. This may include in-vm broker clean up, if a decorator has added it.
- taskHandler.runTearDownTasks();
- }
-
- /// <summary>
- /// Adds the specified task to the tests setup.
- /// </summary>
- /// <param name="task"> The task to add to the tests setup. </param>
- public void chainSetupTask(Runnable task)
- {
- taskHandler.chainSetupTask(task);
- }
-
- /// <summary>
- /// Adds the specified task to the tests tear down.
- /// </summary>
- /// <param name="task"> The task to add to the tests tear down. </param>
- public void chainTearDownTask(Runnable task)
- {
- taskHandler.chainTearDownTask(task);
- }
-
- /// <summary>
- /// Should provide a translation from the junit method name of a test to its test case name as known to the test
- /// clients that will run the test. The purpose of this is to convert the JUnit method name into the correct test
- /// case name to place into the test invite. For example the method "testP2P" might map onto the interop test case
- /// name "TC2_BasicP2P".
- /// </summary>
- /// <param name="methodName"> The name of the JUnit test method. </param>
- ///
- /// <return> The name of the corresponding interop test case. </return>
- public string getTestCaseNameForTestMethod(string methodName)
- {
- return methodName;
- }
-
- public void setInVmBrokers()
- {
- isUsingInVM = true;
- }
-
- /// <summary>
- /// Indicates whether or not a test case is using in-vm brokers.
- /// </summary>
- /// <return> <tt>true</tt> if the test is using in-vm brokers, <tt>false</tt> otherwise. </return>
- public bool usingInVmBroker()
- {
- return isUsingInVM;
- }
-
- /// <summary>
- /// Sets the currently live in-vm broker.
- /// </summary>
- /// <param name="i"> The currently live in-vm broker. </param>
- public void setLiveBroker(int i)
- { }
-
- /// <summary>
- /// Reports the currently live in-vm broker.
- /// </summary>
- /// <return> The currently live in-vm broker. </return>
- public int getLiveBroker()
- {
- return 0;
- }
-
- /// <summary>
- /// Accepts a failure mechanism.
- /// </summary>
- /// <param name="failureMechanism"> The failure mechanism. </param>
- public void setFailureMechanism(CauseFailure failureMechanism)
- {
- this.failureMechanism = failureMechanism;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/LocalCircuitFactory.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/LocalCircuitFactory.csx
deleted file mode 100644
index 45ecf26ffe..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/LocalCircuitFactory.csx
+++ /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.
- *
- */
-using log4net;
-
-using Apache.Qpid.Integration.Tests.framework.localcircuit;//.LocalCircuitImpl;
-//using Apache.Qpid.Integration.Tests.framework.localcircuit.LocalPublisherImpl;
-//using Apache.Qpid.Integration.Tests.framework.localcircuit.LocalReceiverImpl;
-//using Apache.Qpid.Integration.Tests.framework.sequencers.CircuitFactory;
-//using org.apache.qpid.util.ConversationFactory;
-
-//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-//using javax.jms.*;
-
-using System.Collections.Generic;//.IList;
-//using java.util.Properties;
-//using java.util.concurrent.atomic.AtomicLong;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// LocalCircuitFactory is a circuit factory that creates test circuits with publishing and receiving ends rooted
- /// on the same JVM. The ends of the circuit are presented as <see cref="Publisher"/> and <see cref="Receiver"/> interfaces, which
- /// in turn provide methods to apply assertions to the circuit. The creation of the circuit ends, and the presentation
- /// of the ends as publisher/receiver interfaces, are designed to be overriden, so that circuits and assertions that
- /// use messaging features not available in JMS can be written. This provides an extension point for writing tests
- /// against proprietary features of JMS implementations.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide a standard test procedure over a test circuit.
- /// <tr><td> Construct test circuits appropriate to a tests context.
- /// </table>
- /// </summary>
- public class LocalCircuitFactory : CircuitFactory
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(LocalCircuitFactory));
-
- /// <summary> Used to create unique destination names for each test. </summary>
- protected static AtomicLong uniqueDestsId = new AtomicLong();
-
- /// <summary>
- /// Holds a test coordinating conversation with the test clients. This should consist of assigning the test roles,
- /// begining the test and gathering the test reports from the participants.
- /// </summary>
- /// <param name="testCircuit"> The test circuit. </param>
- /// <param name="assertions"> The list of assertions to apply to the test circuit. </param>
- /// <param name="testProperties"> The test case definition. </param>
- public void sequenceTest(Circuit testCircuit, IList<Assertion> assertions, Properties testProperties)
- {
- FrameworkBaseCase.assertNoFailures(testCircuit.test(1, assertions));
- }
-
- /// <summary>
- /// Creates a test circuit for the test, configered by the test parameters specified.
- /// </summary>
- /// <param name="testProperties"> The test parameters. </param>
- ///
- /// <return> A test circuit. </return>
- public Circuit createCircuit(TestModel testProperties)
- {
- Circuit result;
-
- // Create a standard publisher/receivers test client pair on a shared connection, individual sessions.
- try
- {
- // Get a unique offset to append to destination names to make them unique to the connection.
- long uniqueId = uniqueDestsId.incrementAndGet();
-
- // Set up the connection.
- Connection connection = TestUtils.createConnection(testProperties);
-
- // Add the connection exception listener to assert on exception conditions with.
- // ExceptionMonitor exceptionMonitor = new ExceptionMonitor();
- // connection.setExceptionListener(exceptionMonitor);
-
- // Set up the publisher.
- CircuitEndBase publisherEnd = createPublisherCircuitEnd(connection, testProps, uniqueId);
-
- // Set up the receiver.
- CircuitEndBase receiverEnd = createReceiverCircuitEnd(connection, testProps, uniqueId);
-
- // Start listening for incoming messages.
- connection.start();
-
- // Namespace everything up.
- LocalPublisherImpl publisher = createPublisherFromCircuitEnd(publisherEnd);
- LocalReceiverImpl receiver = createReceiverFromCircuitEnd(receiverEnd);
-
- result = new LocalCircuitImpl(testProperties, publisher, receiver, connection, publisher.getExceptionMonitor());
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Could not create publisher/receivers pair due to a JMSException.", e);
- }
-
- return result;
- }
-
- /// <summary>
- /// Creates a local <see cref="Receiver"/> from a <see cref="CircuitEnd"/>. Sub-classes may override this to provide more
- /// specialized receivers if necessary.
- /// </summary>
- /// <param name="receiverEnd"> The receiving circuit end. </param>
- ///
- /// <return> A <see cref="Receiver"/>. </return>
- protected LocalReceiverImpl createReceiverFromCircuitEnd(CircuitEndBase receiverEnd)
- {
- return new LocalReceiverImpl(receiverEnd);
- }
-
- /// <summary>
- /// Creates a local <see cref="Publisher"/> from a <see cref="CircuitEnd"/>. Sub-classes may override this to provide more
- /// specialized receivers if necessary.
- /// </summary>
- /// <param name="publisherEnd"> The publishing circuit end. </param>
- ///
- /// <return> A <see cref="Receiver"/>. </return>
- protected LocalPublisherImpl createPublisherFromCircuitEnd(CircuitEndBase publisherEnd)
- {
- return new LocalPublisherImpl(publisherEnd);
- }
-
- /// <summary>
- /// Builds a circuit end suitable for the publishing side of a test circuit, from standard test parameters.
- /// </summary>
- /// <param name="connection"> The connection to build the circuit end on. </param>
- /// <param name="testProps"> The test parameters to configure the circuit end construction. </param>
- /// <param name="uniqueId"> A unique number to being numbering destinations from, to make this circuit unique. </param>
- ///
- /// <return> A circuit end suitable for the publishing side of a test circuit. </return>
- ///
- /// <exception cref="JMSException"> Any underlying JMSExceptions are allowed to fall through and fail the creation. </exception>
- public CircuitEndBase createPublisherCircuitEnd(Connection connection, TestModel testProps, long uniqueId)
- throws JMSException
- {
- log.debug(
- "public CircuitEndBase createPublisherCircuitEnd(Connection connection, TestModel testProps, long uniqueId = "
- + uniqueId + "): called");
-
- // Check that the test properties do not contain AMQP/Qpid specific settings, and fail if they do.
- if (testProps.getImmediate() || testProps.getMandatory())
- {
- throw new RuntimeException(
- "Cannot create a pure JMS circuit as the test properties require AMQP specific options.");
- }
-
- Session session = connection.createSession(testProps.getPublisherTransacted(), testProps.getAckMode());
-
- Destination destination =
- testProps.getPubsub() ? session.createTopic(testProps.getSendDestinationNameRoot() + "_" + uniqueId)
- : session.createQueue(testProps.getSendDestinationNameRoot() + "_" + uniqueId);
-
- MessageProducer producer = testProps.getPublisherProducerBind() ? session.createProducer(destination) : null;
-
- MessageConsumer consumer =
- testProps.getPublisherConsumerBind()
- ? session.createConsumer(session.createQueue(testProps.getReceiveDestinationNameRoot() + "_" + uniqueId)) : null;
-
- MessageMonitor messageMonitor = new MessageMonitor();
-
- if (consumer != null)
- {
- consumer.setMessageListener(messageMonitor);
- }
-
- ExceptionMonitor exceptionMonitor = new ExceptionMonitor();
- connection.setExceptionListener(exceptionMonitor);
-
- if (!testProps.getPublisherConsumerActive() && (consumer != null))
- {
- consumer.close();
- }
-
- return new CircuitEndBase(producer, consumer, session, messageMonitor, exceptionMonitor);
- }
-
- /// <summary>
- /// Builds a circuit end suitable for the receiving side of a test circuit, from standard test parameters.
- /// </summary>
- /// <param name="connection"> The connection to build the circuit end on. </param>
- /// <param name="testProps"> The test parameters to configure the circuit end construction. </param>
- /// <param name="uniqueId"> A unique number to being numbering destinations from, to make this circuit unique. </param>
- ///
- /// <return> A circuit end suitable for the receiving side of a test circuit. </return>
- ///
- /// <exception cref="JMSException"> Any underlying JMSExceptions are allowed to fall through and fail the creation. </exception>
- public CircuitEndBase createReceiverCircuitEnd(Connection connection, TestModel testProps, long uniqueId)
- throws JMSException
- {
- log.debug(
- "public CircuitEndBase createReceiverCircuitEnd(Connection connection, TestModel testProps, long uniqueId = "
- + uniqueId + "): called");
-
- // Check that the test properties do not contain AMQP/Qpid specific settings, and fail if they do.
- if (testProps.getImmediate() || testProps.getMandatory())
- {
- throw new RuntimeException(
- "Cannot create a pure JMS circuit as the test properties require AMQP specific options.");
- }
-
- Session session = connection.createSession(testProps.getPublisherTransacted(), testProps.getAckMode());
-
- MessageProducer producer =
- testProps.getReceiverProducerBind()
- ? session.createProducer(session.createQueue(testProps.getReceiveDestinationNameRoot() + "_" + uniqueId)) : null;
-
- Destination destination =
- testProps.getPubsub() ? session.createTopic(testProps.getSendDestinationNameRoot() + "_" + uniqueId)
- : session.createQueue(testProps.getSendDestinationNameRoot() + "_" + uniqueId);
-
- MessageConsumer consumer =
- testProps.getReceiverConsumerBind()
- ? ((testProps.getDurableSubscription() && testProps.getPubsub())
- ? session.createDurableSubscriber((Topic) destination, "testsub") : session.createConsumer(destination))
- : null;
-
- MessageMonitor messageMonitor = new MessageMonitor();
-
- if (consumer != null)
- {
- consumer.setMessageListener(messageMonitor);
- }
-
- if (!testProps.getReceiverConsumerActive() && (consumer != null))
- {
- consumer.close();
- }
-
- return new CircuitEndBase(producer, consumer, session, messageMonitor, null);
- }
-
- /*
- /// <summary>
- /// Sets the sender test client to coordinate the test with.
- /// </summary>
- /// <param name="sender"> The contact details of the sending client in the test. </param>
- public void setSender(TestClientDetails sender)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Sets the receiving test client to coordinate the test with.
- /// </summary>
- /// <param name="receiver"> The contact details of the sending client in the test. </param>
- public void setReceiver(TestClientDetails receiver)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Supplies the sending test client.
- /// </summary>
- /// <return> The sending test client. </return>
- public TestClientDetails getSender()
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Supplies the receiving test client.
- /// </summary>
- /// <return> The receiving test client. </return>
- public IList<TestClientDetails> getReceivers()
- {
- throw new RuntimeException("Not implemented.");
- }
- */
-
- /*
- /// <summary>
- /// Accepts the conversation factory over which to hold the test coordinating conversation.
- /// </summary>
- /// <param name="conversationFactory"> The conversation factory to coordinate the test over. </param>
- public void setConversationFactory(ConversationFactory conversationFactory)
- {
- throw new RuntimeException("Not implemented.");
- }
- */
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/MessageMonitor.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/MessageMonitor.csx
deleted file mode 100644
index 440d0761e5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/MessageMonitor.csx
+++ /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.
- *
- */
-using log4net;
-using Apache.Qpid.Messaging;
-
-//using javax.jms.Message;
-//using javax.jms.MessageListener;
-
-//using java.util.concurrent.atomic.AtomicInteger;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// MessageMonitor is used to record information about messages received. This will provide methods to check various
- /// properties, such as the type, number and content of messages received in order to verify the correct behaviour of
- /// tests.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Count incoming messages.
- /// <tr><td> Record time ellapsed since the arrival of the first message.
- /// <tr><td> Reset all counts and timings.
- /// </table>
- /// </summary>
- public class MessageMonitor : MessageListener
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(MessageMonitor));
-
- /// <summary> Holds the count of messages received since the last query. </summary>
- protected AtomicInteger numMessages = new AtomicInteger();
-
- /// <summary> Holds the time of arrival of the first message. </summary>
- protected Long firstMessageTime = null;
-
- /// <summary>
- /// Handles received messages. Does Nothing.
- /// </summary>
- /// <param name="message"> The message. Ignored. </param>
- public void onMessage(Message message)
- {
- // log.debug("public void onMessage(Message message): called");
-
- numMessages.getAndIncrement();
- }
-
- /// <summary>
- /// Gets the count of messages.
- /// </summary>
- /// <return> The count of messages. </return>
- public int getNumMessage()
- {
- if (firstMessageTime == null)
- {
- firstMessageTime = System.nanoTime();
- }
-
- return numMessages.get();
- }
-
- /// <summary>
- /// Gets the time elapsed since the first message arrived, in nanos, or zero if no messages have arrived yet.
- /// </summary>
- /// <return> The time elapsed since the first message arrived, in nanos, or zero if no messages have arrived yet. </return>
- public long getTime()
- {
- if (firstMessageTime != null)
- {
- return System.nanoTime() - firstMessageTime;
- }
- else
- {
- return 0L;
- }
- }
-
- /// <summary> Resets the message count and timer to zero. </summary>
- public void reset()
- {
- numMessages.set(0);
- firstMessageTime = null;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/MessagingTestConfigProperties.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/MessagingTestConfigProperties.csx
deleted file mode 100644
index db19b5c2e0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/MessagingTestConfigProperties.csx
+++ /dev/null
@@ -1,652 +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 uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.Session;
-
-using java.util.Properties;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// MessagingTestConfigProperties defines a set of property names and default values for specifying a messaging topology,
- /// and test parameters for running a messaging test over that topology. A Properties object holding some of these
- /// properties, superimposed onto the defaults, is used to establish test topologies and control test behaviour.
- ///
- /// <p/>A complete list of the parameters, default values and comments on their usage is provided here:
- ///
- /// <p/><table><caption>Parameters</caption>
- /// <tr><th> Parameter <th> Default <th> Comments
- /// <tr><td> messageSize <td> 0 <td> Message size in bytes. Not including any headers.
- /// <tr><td> destinationName <td> ping <td> The root name to use to generate destination names to ping.
- /// <tr><td> persistent <td> false <td> Determines whether peristent delivery is used.
- /// <tr><td> transacted <td> false <td> Determines whether messages are sent/received in transactions.
- /// <tr><td> broker <td> tcp://localhost:5672 <td> Determines the broker to connect to.
- /// <tr><td> virtualHost <td> test <td> Determines the virtual host to send all ping over.
- /// <tr><td> rate <td> 0 <td> The maximum rate (in hertz) to send messages at. 0 means no limit.
- /// <tr><td> verbose <td> false <td> The verbose flag for debugging. Prints to console on every message.
- /// <tr><td> pubsub <td> false <td> Whether to ping topics or queues. Uses p2p by default.
- /// <tr><td> username <td> guest <td> The username to access the broker with.
- /// <tr><td> password <td> guest <td> The password to access the broker with.
- /// <tr><td> selector <td> null <td> Not used. Defines a message selector to filter pings with.
- /// <tr><td> destinationCount <td> 1 <td> The number of receivers listening to the pings.
- /// <tr><td> timeout <td> 30000 <td> In milliseconds. The timeout to stop waiting for replies.
- /// <tr><td> commitBatchSize <td> 1 <td> The number of messages per transaction in transactional mode.
- /// <tr><td> uniqueDests <td> true <td> Whether each receivers only listens to one ping destination or all.
- /// <tr><td> durableDests <td> false <td> Whether or not durable destinations are used.
- /// <tr><td> ackMode <td> AUTO_ACK <td> The message acknowledgement mode. Possible values are:
- /// 0 - SESSION_TRANSACTED
- /// 1 - AUTO_ACKNOWLEDGE
- /// 2 - CLIENT_ACKNOWLEDGE
- /// 3 - DUPS_OK_ACKNOWLEDGE
- /// 257 - NO_ACKNOWLEDGE
- /// 258 - PRE_ACKNOWLEDGE
- /// <tr><td> maxPending <td> 0 <td> The maximum size in bytes, of messages sent but not yet received.
- /// Limits the volume of messages currently buffered on the client
- /// or broker. Can help scale test clients by limiting amount of buffered
- /// data to avoid out of memory errors.
- /// </table>
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide the names and defaults of all test parameters.
- /// </table>
- /// </summary>
- ///
- /// <remarks> Put a type-safe wrapper around these properties, but continue to store the parameters as properties. This is
- /// simply to ensure that it is a simple matter to serialize/deserialize string/string pairs onto messages.</remarks>
- public class MessagingTestConfigProperties extends ParsedProperties
- {
- // ====================== Connection Properties ==================================
-
- /// <summary> Holds the name of the default connection configuration. </summary>
- public static final string CONNECTION_NAME = "broker";
-
- /// <summary> Holds the name of the property to get the initial context factory name from. </summary>
- public static final string INITIAL_CONTEXT_FACTORY_PROPNAME = "java.naming.factory.initial";
-
- /// <summary> Defines the class to use as the initial context factory by default. </summary>
- public static final string INITIAL_CONTEXT_FACTORY_DEFAULT = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
-
- /// <summary> Holds the name of the property to get the test broker url from. </summary>
- public static final string BROKER_PROPNAME = "qpid.test.broker";
-
- /// <summary> Holds the default broker url for the test. </summary>
- public static final string BROKER_DEFAULT = "vm://:1";
-
- /// <summary> Holds the name of the property to get the test broker virtual path. </summary>
- public static final string VIRTUAL_HOST_PROPNAME = "virtualHost";
-
- /// <summary> Holds the default virtual path for the test. </summary>
- public static final string VIRTUAL_HOST_DEFAULT = "";
-
- /// <summary> Holds the name of the property to get the broker access username from. </summary>
- public static final string USERNAME_PROPNAME = "username";
-
- /// <summary> Holds the default broker log on username. </summary>
- public static final string USERNAME_DEFAULT = "guest";
-
- /// <summary> Holds the name of the property to get the broker access password from. </summary>
- public static final string PASSWORD_PROPNAME = "password";
-
- /// <summary> Holds the default broker log on password. </summary>
- public static final string PASSWORD_DEFAULT = "guest";
-
- // ====================== Messaging Topology Properties ==========================
-
- /// <summary> Holds the name of the property to get the bind publisher procuder flag from. </summary>
- public static final string PUBLISHER_PRODUCER_BIND_PROPNAME = "publisherProducerBind";
-
- /// <summary> Holds the default value of the publisher producer flag. </summary>
- public static final bool PUBLISHER_PRODUCER_BIND_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the bind publisher procuder flag from. </summary>
- public static final string PUBLISHER_CONSUMER_BIND_PROPNAME = "publisherConsumerBind";
-
- /// <summary> Holds the default value of the publisher consumer flag. </summary>
- public static final bool PUBLISHER_CONSUMER_BIND_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the bind receivers procuder flag from. </summary>
- public static final string RECEIVER_PRODUCER_BIND_PROPNAME = "receiverProducerBind";
-
- /// <summary> Holds the default value of the receivers producer flag. </summary>
- public static final bool RECEIVER_PRODUCER_BIND_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the bind receivers procuder flag from. </summary>
- public static final string RECEIVER_CONSUMER_BIND_PROPNAME = "receiverConsumerBind";
-
- /// <summary> Holds the default value of the receivers consumer flag. </summary>
- public static final bool RECEIVER_CONSUMER_BIND_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the publishers consumer active flag from. </summary>
- public static final string PUBLISHER_CONSUMER_ACTIVE_PROPNAME = "publisherConsumerActive";
-
- /// <summary> Holds the default value of the publishers consumer active flag. </summary>
- public static final bool PUBLISHER_CONSUMER_ACTIVE_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the receivers consumer active flag from. </summary>
- public static final string RECEIVER_CONSUMER_ACTIVE_PROPNAME = "receiverConsumerActive";
-
- /// <summary> Holds the default value of the receivers consumer active flag. </summary>
- public static final bool RECEIVER_CONSUMER_ACTIVE_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the destination name root from. </summary>
- public static final string SEND_DESTINATION_NAME_ROOT_PROPNAME = "sendDestinationRoot";
-
- /// <summary> Holds the root of the name of the default destination to send to. </summary>
- public static final string SEND_DESTINATION_NAME_ROOT_DEFAULT = "sendTo";
-
- /// <summary> Holds the name of the property to get the destination name root from. </summary>
- public static final string RECEIVE_DESTINATION_NAME_ROOT_PROPNAME = "receiveDestinationRoot";
-
- /// <summary> Holds the root of the name of the default destination to send to. </summary>
- public static final string RECEIVE_DESTINATION_NAME_ROOT_DEFAULT = "receiveFrom";
-
- /// <summary> Holds the name of the proeprty to get the destination count from. </summary>
- public static final string DESTINATION_COUNT_PROPNAME = "destinationCount";
-
- /// <summary> Defines the default number of destinations to ping. </summary>
- public static final int DESTINATION_COUNT_DEFAULT = 1;
-
- /// <summary> Holds the name of the property to get the p2p or pub/sub messaging mode from. </summary>
- public static final string PUBSUB_PROPNAME = "pubsub";
-
- /// <summary> Holds the pub/sub mode default, true means ping a topic, false means ping a queue. </summary>
- public static final bool PUBSUB_DEFAULT = false;
-
- // ====================== JMS Options and Flags =================================
-
- /// <summary> Holds the name of the property to get the test delivery mode from. </summary>
- public static final string PERSISTENT_MODE_PROPNAME = "persistent";
-
- /// <summary> Holds the message delivery mode to use for the test. </summary>
- public static final bool PERSISTENT_MODE_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the test transactional mode from. </summary>
- public static final string TRANSACTED_PUBLISHER_PROPNAME = "transactedPublisher";
-
- /// <summary> Holds the transactional mode to use for the test. </summary>
- public static final bool TRANSACTED_PUBLISHER_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the test transactional mode from. </summary>
- public static final string TRANSACTED_RECEIVER_PROPNAME = "transactedReceiver";
-
- /// <summary> Holds the transactional mode to use for the test. </summary>
- public static final bool TRANSACTED_RECEIVER_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the no local flag from. </summary>
- public static final string NO_LOCAL_PROPNAME = "noLocal";
-
- /// <summary> Defines the default value of the no local flag to use when consuming messages. </summary>
- public static final bool NO_LOCAL_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the message acknowledgement mode from. </summary>
- public static final string ACK_MODE_PROPNAME = "ackMode";
-
- /// <summary> Defines the default message acknowledgement mode. </summary>
- public static final int ACK_MODE_DEFAULT = Session.AUTO_ACKNOWLEDGE;
-
- /// <summary> Holds the name of the property to get the durable subscriptions flag from, when doing pub/sub messaging. </summary>
- public static final string DURABLE_SUBSCRIPTION_PROPNAME = "durableSubscription";
-
- /// <summary> Defines the default value of the durable subscriptions flag. </summary>
- public static final bool DURABLE_SUBSCRIPTION_DEFAULT = false;
-
- // ====================== Qpid/AMQP Options and Flags ================================
-
- /// <summary> Holds the name of the property to set the exclusive flag from. </summary>
- public static final string EXCLUSIVE_PROPNAME = "exclusive";
-
- /// <summary> Defines the default value of the exclusive flag to use when consuming messages. </summary>
- public static final bool EXCLUSIVE_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the immediate flag from. </summary>
- public static final string IMMEDIATE_PROPNAME = "immediate";
-
- /// <summary> Defines the default value of the immediate flag to use when sending messages. </summary>
- public static final bool IMMEDIATE_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the mandatory flag from. </summary>
- public static final string MANDATORY_PROPNAME = "mandatory";
-
- /// <summary> Defines the default value of the mandatory flag to use when sending messages. </summary>
- public static final bool MANDATORY_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the durable destinations flag from. </summary>
- public static final string DURABLE_DESTS_PROPNAME = "durableDests";
-
- /// <summary> Default value for the durable destinations flag. </summary>
- public static final bool DURABLE_DESTS_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the prefetch size from. </summary>
- public static final string PREFETCH_PROPNAME = "prefetch";
-
- /// <summary> Defines the default prefetch size to use when consuming messages. </summary>
- public static final int PREFETCH_DEFAULT = 100;
-
- // ====================== Common Test Parameters ================================
-
- /// <summary> Holds the name of the property to get the test message size from. </summary>
- public static final string MESSAGE_SIZE_PROPNAME = "messageSize";
-
- /// <summary> Used to set up a default message size. </summary>
- public static final int MESSAGE_SIZE_DEAFULT = 0;
-
- /// <summary> Holds the name of the property to get the message rate from. </summary>
- public static final string RATE_PROPNAME = "rate";
-
- /// <summary> Defines the default rate (in pings per second) to send pings at. 0 means as fast as possible, no restriction. </summary>
- public static final int RATE_DEFAULT = 0;
-
- /// <summary> Holds the name of the proeprty to get the. </summary>
- public static final string SELECTOR_PROPNAME = "selector";
-
- /// <summary> Holds the default message selector. </summary>
- public static final string SELECTOR_DEFAULT = "";
-
- /// <summary> Holds the name of the property to get the waiting timeout for response messages. </summary>
- public static final string TIMEOUT_PROPNAME = "timeout";
-
- /// <summary> Default time to wait before assuming that a ping has timed out. </summary>
- public static final long TIMEOUT_DEFAULT = 30000;
-
- /// <summary> Holds the name of the property to get the commit batch size from. </summary>
- public static final string TX_BATCH_SIZE_PROPNAME = "commitBatchSize";
-
- /// <summary> Defines the default number of pings to send in each transaction when running transactionally. </summary>
- public static final int TX_BATCH_SIZE_DEFAULT = 1;
-
- /// <summary> Holds the name of the property to set the maximum amount of pending message data for a producer to hold. </summary>
- public static final string MAX_PENDING_PROPNAME = "maxPending";
-
- /// <summary> Defines the default maximum quantity of pending message data to allow producers to hold. </summary>
- public static final int MAX_PENDING_DEFAULT = 0;
-
- /// <summary> Holds the name of the property to get the publisher rollback flag from. </summary>
- public static final string ROLLBACK_PUBLISHER_PROPNAME = "rollbackPublisher";
-
- /// <summary> Holds the default publisher roll back setting. </summary>
- public static final bool ROLLBACK_PUBLISHER_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the publisher rollback flag from. </summary>
- public static final string ROLLBACK_RECEIVER_PROPNAME = "rollbackReceiver";
-
- /// <summary> Holds the default publisher roll back setting. </summary>
- public static final bool ROLLBACK_RECEIVER_DEFAULT = false;
-
- // ====================== Options that control the bahviour of the test framework. =========================
-
- /// <summary> Holds the name of the property to get the behavioural mode of not applicable assertions. </summary>
- public static final string NOT_APPLICABLE_ASSERTION_PROPNAME = "notApplicableAssertion";
-
- /// <summary> Holds the default behavioral mode of not applicable assertions, which is logging them as a warning. </summary>
- public static final string NOT_APPLICABLE_ASSERTION_DEFAULT = "warn";
-
- /// <summary> Holds the name of the property to get the verbose mode proeprty from. </summary>
- public static final string VERBOSE_PROPNAME = "verbose";
-
- /// <summary> Holds the default verbose mode. </summary>
- public static final bool VERBOSE_DEFAULT = false;
-
- /// <summary> Holds the default configuration properties. </summary>
- public static ParsedProperties defaults = new ParsedProperties();
-
- static
- {
- defaults.setPropertyIfNull(INITIAL_CONTEXT_FACTORY_PROPNAME, INITIAL_CONTEXT_FACTORY_DEFAULT);
- defaults.setPropertyIfNull(BROKER_PROPNAME, BROKER_DEFAULT);
- defaults.setPropertyIfNull(VIRTUAL_HOST_PROPNAME, VIRTUAL_HOST_DEFAULT);
- defaults.setPropertyIfNull(USERNAME_PROPNAME, USERNAME_DEFAULT);
- defaults.setPropertyIfNull(PASSWORD_PROPNAME, PASSWORD_DEFAULT);
-
- defaults.setPropertyIfNull(PUBLISHER_PRODUCER_BIND_PROPNAME, PUBLISHER_PRODUCER_BIND_DEFAULT);
- defaults.setPropertyIfNull(PUBLISHER_CONSUMER_BIND_PROPNAME, PUBLISHER_CONSUMER_BIND_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_PRODUCER_BIND_PROPNAME, RECEIVER_PRODUCER_BIND_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_CONSUMER_BIND_PROPNAME, RECEIVER_CONSUMER_BIND_DEFAULT);
- defaults.setPropertyIfNull(PUBLISHER_CONSUMER_ACTIVE_PROPNAME, PUBLISHER_CONSUMER_ACTIVE_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_CONSUMER_ACTIVE_PROPNAME, RECEIVER_CONSUMER_ACTIVE_DEFAULT);
- defaults.setPropertyIfNull(SEND_DESTINATION_NAME_ROOT_PROPNAME, SEND_DESTINATION_NAME_ROOT_DEFAULT);
- defaults.setPropertyIfNull(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME, RECEIVE_DESTINATION_NAME_ROOT_DEFAULT);
- defaults.setPropertyIfNull(DESTINATION_COUNT_PROPNAME, DESTINATION_COUNT_DEFAULT);
- defaults.setPropertyIfNull(PUBSUB_PROPNAME, PUBSUB_DEFAULT);
-
- defaults.setPropertyIfNull(PERSISTENT_MODE_PROPNAME, PERSISTENT_MODE_DEFAULT);
- defaults.setPropertyIfNull(TRANSACTED_PUBLISHER_PROPNAME, TRANSACTED_PUBLISHER_DEFAULT);
- defaults.setPropertyIfNull(TRANSACTED_RECEIVER_PROPNAME, TRANSACTED_RECEIVER_DEFAULT);
- defaults.setPropertyIfNull(NO_LOCAL_PROPNAME, NO_LOCAL_DEFAULT);
- defaults.setPropertyIfNull(ACK_MODE_PROPNAME, ACK_MODE_DEFAULT);
- defaults.setPropertyIfNull(DURABLE_SUBSCRIPTION_PROPNAME, DURABLE_SUBSCRIPTION_DEFAULT);
-
- defaults.setPropertyIfNull(EXCLUSIVE_PROPNAME, EXCLUSIVE_DEFAULT);
- defaults.setPropertyIfNull(IMMEDIATE_PROPNAME, IMMEDIATE_DEFAULT);
- defaults.setPropertyIfNull(MANDATORY_PROPNAME, MANDATORY_DEFAULT);
- defaults.setPropertyIfNull(DURABLE_DESTS_PROPNAME, DURABLE_DESTS_DEFAULT);
- defaults.setPropertyIfNull(PREFETCH_PROPNAME, PREFETCH_DEFAULT);
-
- defaults.setPropertyIfNull(MESSAGE_SIZE_PROPNAME, MESSAGE_SIZE_DEAFULT);
- defaults.setPropertyIfNull(RATE_PROPNAME, RATE_DEFAULT);
- defaults.setPropertyIfNull(SELECTOR_PROPNAME, SELECTOR_DEFAULT);
- defaults.setPropertyIfNull(TIMEOUT_PROPNAME, TIMEOUT_DEFAULT);
- defaults.setPropertyIfNull(TX_BATCH_SIZE_PROPNAME, TX_BATCH_SIZE_DEFAULT);
- defaults.setPropertyIfNull(MAX_PENDING_PROPNAME, MAX_PENDING_DEFAULT);
- defaults.setPropertyIfNull(ROLLBACK_PUBLISHER_PROPNAME, ROLLBACK_PUBLISHER_DEFAULT);
- defaults.setPropertyIfNull(ROLLBACK_RECEIVER_PROPNAME, ROLLBACK_RECEIVER_DEFAULT);
-
- defaults.setPropertyIfNull(NOT_APPLICABLE_ASSERTION_PROPNAME, NOT_APPLICABLE_ASSERTION_DEFAULT);
- defaults.setPropertyIfNull(VERBOSE_PROPNAME, VERBOSE_DEFAULT);
- }
-
- /// <summary> Creates a test configuration based on the defaults. </summary>
- public MessagingTestConfigProperties()
- {
- super(defaults);
- }
-
- /// <summary>
- /// Creates a test configuration based on the supplied properties.
- /// </summary>
- /// <param name="properties"> The test configuration. </param>
- public MessagingTestConfigProperties(Properties properties)
- {
- super(properties);
- }
-
- /// <summary>
- /// The size of test messages to send.
- /// </summary>
- /// <return> The size of test messages to send. </return>
- public int getMessageSize()
- {
- return getPropertyAsInteger(MESSAGE_SIZE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the publishing producer should be set up to publish to a destination.
- /// </summary>
- /// <return> Flag to indicate that the publishing producer should be set up to publish to a destination. </return>
- public bool getPublisherProducerBind()
- {
- return getPropertyAsBoolean(PUBLISHER_PRODUCER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the publishing consumer should be set up to receive from a destination.
- /// </summary>
- /// <return> Flag to indicate that the publishing consumer should be set up to receive from a destination. </return>
- public bool getPublisherConsumerBind()
- {
- return getPropertyAsBoolean(PUBLISHER_CONSUMER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the receiving producer should be set up to publish to a destination.
- /// </summary>
- /// <return> Flag to indicate that the receiving producer should be set up to publish to a destination. </return>
- public bool getReceiverProducerBind()
- {
- return getPropertyAsBoolean(RECEIVER_PRODUCER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the receiving consumer should be set up to receive from a destination.
- /// </summary>
- /// <return> Flag to indicate that the receiving consumer should be set up to receive from a destination. </return>
- public bool getReceiverConsumerBind()
- {
- return getPropertyAsBoolean(RECEIVER_CONSUMER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the publishing consumer should be created and actively listening.
- /// </summary>
- /// <return> Flag to indicate that the publishing consumer should be created. </return>
- public bool getPublisherConsumerActive()
- {
- return getPropertyAsBoolean(PUBLISHER_CONSUMER_ACTIVE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the receiving consumers should be created and actively listening.
- /// </summary>
- /// <return> Flag to indicate that the receiving consumers should be created and actively listening. </return>
- public bool getReceiverConsumerActive()
- {
- return getPropertyAsBoolean(RECEIVER_CONSUMER_ACTIVE_PROPNAME);
- }
-
- /// <summary>
- /// A root to create all test destination names from.
- /// </summary>
- /// <return> A root to create all test destination names from. </return>
- public string getSendDestinationNameRoot()
- {
- return getProperty(SEND_DESTINATION_NAME_ROOT_PROPNAME);
- }
-
- /// <summary>
- /// A root to create all receiving destination names from.
- /// </summary>
- /// <return> A root to create all receiving destination names from. </return>
- public string getReceiveDestinationNameRoot()
- {
- return getProperty(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that persistent messages should be used.
- /// </summary>
- /// <return> Flag to indicate that persistent messages should be used. </return>
- public bool getPersistentMode()
- {
- return getPropertyAsBoolean(PERSISTENT_MODE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that transactional messages should be sent by the publisher.
- /// </summary>
- /// <return> Flag to indicate that transactional messages should be sent by the publisher. </return>
- public bool getPublisherTransacted()
- {
- return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that transactional receives should be used by the receiver.
- /// </summary>
- /// <return> Flag to indicate that transactional receives should be used by the receiver. </return>
- public bool getReceiverTransacted()
- {
- return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME);
- }
-
- /// <summary>
- /// The name of the virtual host to run all tests over.
- /// </summary>
- /// <return> The name of the virtual host to run all tests over. </return>
- public string getVirtualHost()
- {
- return getProperty(VIRTUAL_HOST_PROPNAME);
- }
-
- /// <summary>
- /// Limiting rate for each sender in messages per second, or zero for unlimited.
- /// </summary>
- /// <return> Limiting rate for each sender in messages per second, or zero for unlimited. </return>
- public string getRate()
- {
- return getProperty(RATE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that test messages should be received publish/subscribe style by all receivers.
- /// </summary>
- /// <return> Flag to indicate that test messages should be received publish/subscribe style by all receivers. </return>
- public bool getPubsub()
- {
- return getPropertyAsBoolean(PUBSUB_PROPNAME);
- }
-
- /// <summary>
- /// The username credentials to run tests with.
- /// </summary>
- /// <return> The username credentials to run tests with. </return>
- public string getUsername()
- {
- return getProperty(USERNAME_PROPNAME);
- }
-
- /// <summary>
- /// The password credentials to run tests with.
- /// </summary>
- /// <return> The password credentials to run tests with. </return>
- public string getPassword()
- {
- return getProperty(PASSWORD_PROPNAME);
- }
-
- /// <summary>
- /// The timeout duration to fail tests on, should they receive no messages within it.
- /// </summary>
- /// <return> The timeout duration to fail tests on, should they receive no messages within it. </return>
- public long getTimeout()
- {
- return getPropertyAsLong(TIMEOUT_PROPNAME);
- }
-
- /// <summary>
- /// The number of messages to batch into each transaction in transational tests.
- /// </summary>
- /// <return> The number of messages to batch into each transaction in transational tests. </return>
- public int getTxBatchSize()
- {
- return getPropertyAsInteger(TX_BATCH_SIZE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that tests should use durable destinations.
- /// </summary>
- /// <return> Flag to indicate that tests should use durable destinations. </return>
- public bool getDurableDests()
- {
- return getPropertyAsBoolean(DURABLE_DESTS_PROPNAME);
- }
-
- /// <summary>
- /// The ack mode for message receivers to use.
- /// </summary>
- /// <return> The ack mode for message receivers to use. </return>
- public int getAckMode()
- {
- return getPropertyAsInteger(ACK_MODE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that tests should use durable subscriptions.
- /// </summary>
- /// <return> Flag to indicate that tests should use durable subscriptions. </return>
- public bool getDurableSubscription()
- {
- return getPropertyAsBoolean(DURABLE_SUBSCRIPTION_PROPNAME);
- }
-
- /// <summary>
- /// The maximum amount of in-flight data, in bytes, that tests should send at any time.
- /// </summary>
- /// <return> The maximum amount of in-flight data, in bytes, that tests should send at any time. </return>
- public int getMaxPending()
- {
- return getPropertyAsInteger(MAX_PENDING_PROPNAME);
- }
-
- /// <summary>
- /// The size of the prefetch queue to use.
- /// </summary>
- /// <return> The size of the prefetch queue to use. </return>
- public int getPrefetch()
- {
- return getPropertyAsInteger(PREFETCH_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that subscriptions should be no-local.
- /// </summary>
- /// <return> Flag to indicate that subscriptions should be no-local. </return>
- public bool getNoLocal()
- {
- return getPropertyAsBoolean(NO_LOCAL_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that subscriptions should be exclusive.
- /// </summary>
- /// <return> Flag to indicate that subscriptions should be exclusive. </return>
- public bool getExclusive()
- {
- return getPropertyAsBoolean(EXCLUSIVE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that messages must be delivered immediately.
- /// </summary>
- /// <return> Flag to indicate that messages must be delivered immediately. </return>
- public bool getImmediate()
- {
- return getPropertyAsBoolean(IMMEDIATE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that messages must be routable.
- /// </summary>
- /// <return> Flag to indicate that messages must be routable. </return>
- public bool getMandatory()
- {
- return getPropertyAsBoolean(MANDATORY_PROPNAME);
- }
-
- /// <summary>
- /// Gets the value of a flag to indicate that the publisher should rollback all messages sent.
- /// </summary>
- /// <return> A flag to indicate that the publisher should rollback all messages sent. </return>
- public bool getRollbackPublisher()
- {
- return getPropertyAsBoolean(ROLLBACK_PUBLISHER_PROPNAME);
- }
-
- /// <summary>
- /// Gets the value of a flag to indicate that the receiver should rollback all messages received, then receive them
- /// again.
- /// </summary>
- /// <return> A flag to indicate that the publisher should rollback all messages received. </return>
- public bool getRollbackReceiver()
- {
- return getPropertyAsBoolean(ROLLBACK_RECEIVER_PROPNAME);
- }
-
- /// <summary>
- /// Gets the behavioural mode of not applicable assertions. Should be one of 'quiet', 'warn' or 'fail'.
- /// </summary>
- /// <return> The behavioural mode of not applicable assertions. </return>
- public string getNotApplicableAssertionMode()
- {
- return getProperty(NOT_APPLICABLE_ASSERTION_PROPNAME);
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/NotApplicableAssertion.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/NotApplicableAssertion.csx
deleted file mode 100644
index 3e3505725f..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/NotApplicableAssertion.csx
+++ /dev/null
@@ -1,111 +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 log4net;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// NotApplicableAssertion is a messaging assertion that can be used when an assertion requested by a test-case is not
- /// applicable to the testing scenario. For example an assertion may relate to AMQP functionality, but a test case may be
- /// being run over a non-AMQP JMS implementation, in which case the request to create the assertion may return this
- /// instead of the proper assertion. The test framework is configurable to quietly drop these assertions, log them
- /// as warnings to the console, or raise them as test failures.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Quitely pass.
- /// <tr><td> Log a warning.
- /// <tr><td> Raise a test failure.
- /// </table>
- /// </summary>
- public class NotApplicableAssertion : Assertion
- {
- /// <summary> Used for logging to the console. </summary>
- private static ILog console = LogManager.GetLogger("CONSOLE." + NotApplicableAssertion.class.getName());
-
- /// <summary> The possible behavioural modes of this assertion. </summary>
- private enum Mode
- {
- /// <summary> Quietly ignore the assertion by passing. </summary>
- Quiet,
-
- /// <summary> Ignore the assertion by passing but log a warning about it. </summary>
- Warn,
-
- /// <summary> Fail the assertion. </summary>
- Fail;
- }
-
- /// <summary> The behavioural mode of the assertion. </summary>
- private Mode mode;
-
- /// <summary>
- /// Creates an assertion that is driven by the value of the 'notApplicableAssertion' property of the test
- /// configuration. Its value should match one of 'quiet', 'warn' or 'fail' and if it does not it is automatically
- /// read as 'fail'.
- /// </summary>
- /// <param name="testProperties"> The test configuration properties. </param>
- public NotApplicableAssertion(ParsedProperties testProperties)
- {
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProperties);
-
- string modeName = props.getNotApplicableAssertionMode();
-
- if ("quiet".equals(modeName))
- {
- mode = Mode.Quiet;
- }
- else if ("warn".equals(modeName))
- {
- mode = Mode.Warn;
- }
- else
- {
- mode = Mode.Fail;
- }
- }
-
- /// <summary>
- /// Applies the assertion.
- /// </summary>
- /// <return> <tt>true</tt> if the assertion passes, <tt>false</tt> if it fails. </return>
- public bool apply()
- {
- switch (mode)
- {
- case Quiet:
- return true;
-
- case Warn:
- console.warn("Warning: Not applicable assertion being ignored.");
-
- return true;
-
- case Fail:
- default:
- return false;
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.cs
deleted file mode 100644
index 72bd079277..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.cs
+++ /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.
- *
- */
-//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-using System;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A Publisher represents the status of the publishing side of a test circuit. Its main purpose is to provide assertions
- /// that can be applied to test the behaviour of the publishers.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide assertion that the publishers received no exceptions.
- /// </table>
- /// </summary>
- public interface Publisher
- {
- /// <summary>
- /// Provides an assertion that the publisher encountered no exceptions.
- /// </summary>
- ///
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the publisher encountered no exceptions. </return>
- Assertion NoExceptionsAssertion(TestModel testProps);
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- ///
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- Assertion ChannelClosedAssertion(TestModel testProps);
-
- /// <summary>
- /// Provides an assertion that the publisher got a given exception during the test.
- /// </summary>
- ///
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. </param>
- ///
- /// <return> An assertion that the publisher got a given exception during the test. </return>
- Assertion ExceptionAssertion(TestModel testProps, Type exceptionClass);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.csx
deleted file mode 100644
index b23b8c1e59..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Publisher.csx
+++ /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.
- *
- */
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A Publisher represents the status of the publishing side of a test circuit. Its main purpose is to provide assertions
- /// that can be applied to test the behaviour of the publishers.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide assertion that the publishers received no exceptions.
- /// </table>
- /// </summary>
- ///
- /// <remarks> There are mixtures of AMQP and JMS assertions in this interface. Either keep them here, but quietly (or with a
- /// warning or error) drop them from test cases where they are not relevant, or push them down into sub-classes.
- /// I am tempted to go with the dropping/warning/error approach, that would imply that it makes sense to pull
- /// the assertions back from AMQPPublisher to here.</remarks>
- public interface Publisher
- {
- // Assertions that are meaningfull to AMQP and to JMS.
-
- /// <summary>
- /// Provides an assertion that the publisher encountered no exceptions.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the publisher encountered no exceptions. </return>
- public Assertion noExceptionsAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to AMQP.
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- public Assertion channelClosedAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to Java/JMS.
-
- /// <summary>
- /// Provides an assertion that the publisher got a given exception during the test.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. </param>
- ///
- /// <return> An assertion that the publisher got a given exception during the test. </return>
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/README.txt b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/README.txt
deleted file mode 100644
index 927c3415e5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/README.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-What are all these .csx files?
-
-This code is being ported over from the java. Some of the conversion was automated using search/replace/regex under emacs, but that cannot do all of it. The files were saved as .csx files with the 'x' standing for in-cross-over state. They will gradually be copied into .cs files as the conversion is completed and they are able to compile.
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.cs
deleted file mode 100644
index 80320c68b6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.cs
+++ /dev/null
@@ -1,80 +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 uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-using System;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A Receiver is a <see cref="CircuitEnd"/> that represents the status of the receiving side of a test circuit. Its main
- /// purpose is to provide assertions that can be applied to check the behaviour of the receivers.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide assertion that the receivers received no exceptions.
- /// <tr><td> Provide assertion that the receivers received all test messages sent to it.
- /// </table>
- /// </summary>
- public interface Receiver
- {
- /// <summary>
- /// Provides an assertion that the receivers encountered no exceptions.
- /// </summary>
- ///
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers encountered no exceptions. </return>
- Assertion NoExceptionsAssertion(TestModel testProps);
-
- /// <summary>
- /// Provides an assertion that the receivers got all messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers got all messages that were sent to it. </return>
- Assertion AllMessagesReceivedAssertion(TestModel testProps);
-
- /// <summary>
- /// Provides an assertion that the receivers got none of the messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers got none of the messages that were sent to it. </return>
- Assertion NoMessagesReceivedAssertion(TestModel testProps);
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- Assertion ChannelClosedAssertion(TestModel testProps);
-
- /// <summary>
- /// Provides an assertion that the receiver got a given exception during the test.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. </param>
- ///
- /// <return> An assertion that the receiver got a given exception during the test. </return>
- Assertion ExceptionAssertion(TestModel testProps, Type exceptionClass);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.csx
deleted file mode 100644
index bafa57b34b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/Receiver.csx
+++ /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.
- *
- */
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A Receiver is a <see cref="CircuitEnd"/> that represents the status of the receiving side of a test circuit. Its main
- /// purpose is to provide assertions that can be applied to check the behaviour of the receivers.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide assertion that the receivers received no exceptions.
- /// <tr><td> Provide assertion that the receivers received all test messages sent to it.
- /// </table>
- /// </summary>
- ///
- /// <remarks> There are mixtures of AMQP and JMS assertions in this interface. Either keep them here, but quietly (or with a
- /// warning or error) drop them from test cases where they are not relevant, or push them down into sub-classes.
- /// I am tempted to go with the dropping/warning/error approach.</remarks>
- public interface Receiver
- {
- // Assertions that are meaningfull to AMQP and to JMS.
-
- /// <summary>
- /// Provides an assertion that the receivers encountered no exceptions.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers encountered no exceptions. </return>
- public Assertion noExceptionsAssertion(ParsedProperties testProps);
-
- /// <summary>
- /// Provides an assertion that the receivers got all messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers got all messages that were sent to it. </return>
- public Assertion allMessagesReceivedAssertion(ParsedProperties testProps);
-
- /// <summary>
- /// Provides an assertion that the receivers got none of the messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers got none of the messages that were sent to it. </return>
- public Assertion noMessagesReceivedAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to AMQP.
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- public Assertion channelClosedAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to Java/JMS.
-
- /// <summary>
- /// Provides an assertion that the receiver got a given exception during the test.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. </param>
- ///
- /// <return> An assertion that the receiver got a given exception during the test. </return>
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.cs
deleted file mode 100644
index 401e183fd0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.cs
+++ /dev/null
@@ -1,84 +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;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// TestClientDetails is used to encapsulate information about an interop test client. It pairs together the unique
- /// name of the client, and the route on which it listens to its control messages.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Record test clients control addresses together with their names.
- /// </table>
- /// </summary>
- public class TestClientDetails
- {
- /// <summary> The test clients name. </summary>
- public string clientName;
-
- /// <summary> The routing key of the test clients control topic. </summary>
- public string privateControlKey;
-
- /// <summary>
- /// Two TestClientDetails are considered to be equal, iff they have the same client name.
- /// </summary>
- /// <param name="o"> The object to compare to. </param>
- ///
- /// <return> <tt>If the object to compare to is a TestClientDetails equal to this one, <tt>false</tt> otherwise. </return>
- public override bool Equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
-
- if (!(o is TestClientDetails))
- {
- return false;
- }
-
- TestClientDetails testClientDetails = (TestClientDetails) o;
-
- return !((clientName != null) ? (!clientName.Equals(testClientDetails.clientName))
- : (testClientDetails.clientName != null));
- }
-
- /// <summary>
- /// Computes a hash code compatible with the equals method; based on the client name alone.
- /// </summary>
- /// <return> A hash code for this. </return>
- public override int GetHashCode()
- {
- return ((clientName != null) ? clientName.GetHashCode() : 0);
- }
-
- /// <summary>
- /// Outputs the client name and address details. Mostly used for debugging purposes.
- /// </summary>
- /// <return> The client name and address. </return>
- public override string ToString()
- {
- return "TestClientDetails: [ clientName = " + clientName + ", privateControlKey = " + privateControlKey + " ]";
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.csx
deleted file mode 100644
index 877367c762..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestClientDetails.csx
+++ /dev/null
@@ -1,82 +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.Integration.Tests.framework
-{
- /// <summary>
- /// TestClientDetails is used to encapsulate information about an interop test client. It pairs together the unique
- /// name of the client, and the route on which it listens to its control messages.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Record test clients control addresses together with their names.
- /// </table>
- /// </summary>
- public class TestClientDetails
- {
- /// <summary> The test clients name. </summary>
- public string clientName;
-
- /// <summary> The routing key of the test clients control topic. </summary>
- public string privateControlKey;
-
- /// <summary>
- /// Two TestClientDetails are considered to be equal, iff they have the same client name.
- /// </summary>
- /// <param name="o"> The object to compare to. </param>
- ///
- /// <return> <tt>If the object to compare to is a TestClientDetails equal to this one, <tt>false</tt> otherwise. </return>
- public bool equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
-
- if (!(o instanceof TestClientDetails))
- {
- return false;
- }
-
- final TestClientDetails testClientDetails = (TestClientDetails) o;
-
- return !((clientName != null) ? (!clientName.equals(testClientDetails.clientName))
- : (testClientDetails.clientName != null));
- }
-
- /// <summary>
- /// Computes a hash code compatible with the equals method; based on the client name alone.
- /// </summary>
- /// <return> A hash code for this. </return>
- public int hashCode()
- {
- return ((clientName != null) ? clientName.hashCode() : 0);
- }
-
- /// <summary>
- /// Outputs the client name and address details. Mostly used for debugging purposes.
- /// </summary>
- /// <return> The client name and address. </return>
- public string ToString()
- {
- return "TestClientDetails: [ clientName = " + clientName + ", privateControlKey = " + privateControlKey + " ]";
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestModel.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestModel.cs
deleted file mode 100644
index a4a1d7db9b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestModel.cs
+++ /dev/null
@@ -1,657 +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 uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-//using javax.jms.Session;
-
-//using java.util.Properties;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- public class TestModel //extends ParsedProperties
- {}
-
- /*
- /// <summary>
- /// MessagingTestConfigProperties defines a set of property names and default values for specifying a messaging topology,
- /// and test parameters for running a messaging test over that topology. A Properties object holding some of these
- /// properties, superimposed onto the defaults, is used to establish test topologies and control test behaviour.
- ///
- /// <p/>A complete list of the parameters, default values and comments on their usage is provided here:
- ///
- /// <p/><table><caption>Parameters</caption>
- /// <tr><th> Parameter <th> Default <th> Comments
- /// <tr><td> messageSize <td> 0 <td> Message size in bytes. Not including any headers.
- /// <tr><td> destinationName <td> ping <td> The root name to use to generate destination names to ping.
- /// <tr><td> persistent <td> false <td> Determines whether peristent delivery is used.
- /// <tr><td> transacted <td> false <td> Determines whether messages are sent/received in transactions.
- /// <tr><td> broker <td> tcp://localhost:5672 <td> Determines the broker to connect to.
- /// <tr><td> virtualHost <td> test <td> Determines the virtual host to send all ping over.
- /// <tr><td> rate <td> 0 <td> The maximum rate (in hertz) to send messages at. 0 means no limit.
- /// <tr><td> verbose <td> false <td> The verbose flag for debugging. Prints to console on every message.
- /// <tr><td> pubsub <td> false <td> Whether to ping topics or queues. Uses p2p by default.
- /// <tr><td> username <td> guest <td> The username to access the broker with.
- /// <tr><td> password <td> guest <td> The password to access the broker with.
- /// <tr><td> selector <td> null <td> Not used. Defines a message selector to filter pings with.
- /// <tr><td> destinationCount <td> 1 <td> The number of receivers listening to the pings.
- /// <tr><td> timeout <td> 30000 <td> In milliseconds. The timeout to stop waiting for replies.
- /// <tr><td> commitBatchSize <td> 1 <td> The number of messages per transaction in transactional mode.
- /// <tr><td> uniqueDests <td> true <td> Whether each receivers only listens to one ping destination or all.
- /// <tr><td> durableDests <td> false <td> Whether or not durable destinations are used.
- /// <tr><td> ackMode <td> AUTO_ACK <td> The message acknowledgement mode. Possible values are:
- /// 0 - SESSION_TRANSACTED
- /// 1 - AUTO_ACKNOWLEDGE
- /// 2 - CLIENT_ACKNOWLEDGE
- /// 3 - DUPS_OK_ACKNOWLEDGE
- /// 257 - NO_ACKNOWLEDGE
- /// 258 - PRE_ACKNOWLEDGE
- /// <tr><td> maxPending <td> 0 <td> The maximum size in bytes, of messages sent but not yet received.
- /// Limits the volume of messages currently buffered on the client
- /// or broker. Can help scale test clients by limiting amount of buffered
- /// data to avoid out of memory errors.
- /// </table>
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide the names and defaults of all test parameters.
- /// </table>
- /// </summary>
- ///
- /// <remarks> Put a type-safe wrapper around these properties, but continue to store the parameters as properties. This is
- /// simply to ensure that it is a simple matter to serialize/deserialize string/string pairs onto messages.</remarks>
- public class MessagingTestConfigProperties extends ParsedProperties
- {
- // ====================== Connection Properties ==================================
-
- /// <summary> Holds the name of the default connection configuration. </summary>
- public static final string CONNECTION_NAME = "broker";
-
- /// <summary> Holds the name of the property to get the initial context factory name from. </summary>
- public static final string INITIAL_CONTEXT_FACTORY_PROPNAME = "java.naming.factory.initial";
-
- /// <summary> Defines the class to use as the initial context factory by default. </summary>
- public static final string INITIAL_CONTEXT_FACTORY_DEFAULT = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
-
- /// <summary> Holds the name of the property to get the test broker url from. </summary>
- public static final string BROKER_PROPNAME = "qpid.test.broker";
-
- /// <summary> Holds the default broker url for the test. </summary>
- public static final string BROKER_DEFAULT = "vm://:1";
-
- /// <summary> Holds the name of the property to get the test broker virtual path. </summary>
- public static final string VIRTUAL_HOST_PROPNAME = "virtualHost";
-
- /// <summary> Holds the default virtual path for the test. </summary>
- public static final string VIRTUAL_HOST_DEFAULT = "";
-
- /// <summary> Holds the name of the property to get the broker access username from. </summary>
- public static final string USERNAME_PROPNAME = "username";
-
- /// <summary> Holds the default broker log on username. </summary>
- public static final string USERNAME_DEFAULT = "guest";
-
- /// <summary> Holds the name of the property to get the broker access password from. </summary>
- public static final string PASSWORD_PROPNAME = "password";
-
- /// <summary> Holds the default broker log on password. </summary>
- public static final string PASSWORD_DEFAULT = "guest";
-
- // ====================== Messaging Topology Properties ==========================
-
- /// <summary> Holds the name of the property to get the bind publisher procuder flag from. </summary>
- public static final string PUBLISHER_PRODUCER_BIND_PROPNAME = "publisherProducerBind";
-
- /// <summary> Holds the default value of the publisher producer flag. </summary>
- public static final bool PUBLISHER_PRODUCER_BIND_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the bind publisher procuder flag from. </summary>
- public static final string PUBLISHER_CONSUMER_BIND_PROPNAME = "publisherConsumerBind";
-
- /// <summary> Holds the default value of the publisher consumer flag. </summary>
- public static final bool PUBLISHER_CONSUMER_BIND_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the bind receivers procuder flag from. </summary>
- public static final string RECEIVER_PRODUCER_BIND_PROPNAME = "receiverProducerBind";
-
- /// <summary> Holds the default value of the receivers producer flag. </summary>
- public static final bool RECEIVER_PRODUCER_BIND_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the bind receivers procuder flag from. </summary>
- public static final string RECEIVER_CONSUMER_BIND_PROPNAME = "receiverConsumerBind";
-
- /// <summary> Holds the default value of the receivers consumer flag. </summary>
- public static final bool RECEIVER_CONSUMER_BIND_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the publishers consumer active flag from. </summary>
- public static final string PUBLISHER_CONSUMER_ACTIVE_PROPNAME = "publisherConsumerActive";
-
- /// <summary> Holds the default value of the publishers consumer active flag. </summary>
- public static final bool PUBLISHER_CONSUMER_ACTIVE_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the receivers consumer active flag from. </summary>
- public static final string RECEIVER_CONSUMER_ACTIVE_PROPNAME = "receiverConsumerActive";
-
- /// <summary> Holds the default value of the receivers consumer active flag. </summary>
- public static final bool RECEIVER_CONSUMER_ACTIVE_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the destination name root from. </summary>
- public static final string SEND_DESTINATION_NAME_ROOT_PROPNAME = "sendDestinationRoot";
-
- /// <summary> Holds the root of the name of the default destination to send to. </summary>
- public static final string SEND_DESTINATION_NAME_ROOT_DEFAULT = "sendTo";
-
- /// <summary> Holds the name of the property to get the destination name root from. </summary>
- public static final string RECEIVE_DESTINATION_NAME_ROOT_PROPNAME = "receiveDestinationRoot";
-
- /// <summary> Holds the root of the name of the default destination to send to. </summary>
- public static final string RECEIVE_DESTINATION_NAME_ROOT_DEFAULT = "receiveFrom";
-
- /// <summary> Holds the name of the proeprty to get the destination count from. </summary>
- public static final string DESTINATION_COUNT_PROPNAME = "destinationCount";
-
- /// <summary> Defines the default number of destinations to ping. </summary>
- public static final int DESTINATION_COUNT_DEFAULT = 1;
-
- /// <summary> Holds the name of the property to get the p2p or pub/sub messaging mode from. </summary>
- public static final string PUBSUB_PROPNAME = "pubsub";
-
- /// <summary> Holds the pub/sub mode default, true means ping a topic, false means ping a queue. </summary>
- public static final bool PUBSUB_DEFAULT = false;
-
- // ====================== JMS Options and Flags =================================
-
- /// <summary> Holds the name of the property to get the test delivery mode from. </summary>
- public static final string PERSISTENT_MODE_PROPNAME = "persistent";
-
- /// <summary> Holds the message delivery mode to use for the test. </summary>
- public static final bool PERSISTENT_MODE_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the test transactional mode from. </summary>
- public static final string TRANSACTED_PUBLISHER_PROPNAME = "transactedPublisher";
-
- /// <summary> Holds the transactional mode to use for the test. </summary>
- public static final bool TRANSACTED_PUBLISHER_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the test transactional mode from. </summary>
- public static final string TRANSACTED_RECEIVER_PROPNAME = "transactedReceiver";
-
- /// <summary> Holds the transactional mode to use for the test. </summary>
- public static final bool TRANSACTED_RECEIVER_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the no local flag from. </summary>
- public static final string NO_LOCAL_PROPNAME = "noLocal";
-
- /// <summary> Defines the default value of the no local flag to use when consuming messages. </summary>
- public static final bool NO_LOCAL_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the message acknowledgement mode from. </summary>
- public static final string ACK_MODE_PROPNAME = "ackMode";
-
- /// <summary> Defines the default message acknowledgement mode. </summary>
- public static final int ACK_MODE_DEFAULT = Session.AUTO_ACKNOWLEDGE;
-
- /// <summary> Holds the name of the property to get the durable subscriptions flag from, when doing pub/sub messaging. </summary>
- public static final string DURABLE_SUBSCRIPTION_PROPNAME = "durableSubscription";
-
- /// <summary> Defines the default value of the durable subscriptions flag. </summary>
- public static final bool DURABLE_SUBSCRIPTION_DEFAULT = false;
-
- // ====================== Qpid/AMQP Options and Flags ================================
-
- /// <summary> Holds the name of the property to set the exclusive flag from. </summary>
- public static final string EXCLUSIVE_PROPNAME = "exclusive";
-
- /// <summary> Defines the default value of the exclusive flag to use when consuming messages. </summary>
- public static final bool EXCLUSIVE_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the immediate flag from. </summary>
- public static final string IMMEDIATE_PROPNAME = "immediate";
-
- /// <summary> Defines the default value of the immediate flag to use when sending messages. </summary>
- public static final bool IMMEDIATE_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the mandatory flag from. </summary>
- public static final string MANDATORY_PROPNAME = "mandatory";
-
- /// <summary> Defines the default value of the mandatory flag to use when sending messages. </summary>
- public static final bool MANDATORY_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the durable destinations flag from. </summary>
- public static final string DURABLE_DESTS_PROPNAME = "durableDests";
-
- /// <summary> Default value for the durable destinations flag. </summary>
- public static final bool DURABLE_DESTS_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the prefetch size from. </summary>
- public static final string PREFETCH_PROPNAME = "prefetch";
-
- /// <summary> Defines the default prefetch size to use when consuming messages. </summary>
- public static final int PREFETCH_DEFAULT = 100;
-
- // ====================== Common Test Parameters ================================
-
- /// <summary> Holds the name of the property to get the test message size from. </summary>
- public static final string MESSAGE_SIZE_PROPNAME = "messageSize";
-
- /// <summary> Used to set up a default message size. </summary>
- public static final int MESSAGE_SIZE_DEAFULT = 0;
-
- /// <summary> Holds the name of the property to get the message rate from. </summary>
- public static final string RATE_PROPNAME = "rate";
-
- /// <summary> Defines the default rate (in pings per second) to send pings at. 0 means as fast as possible, no restriction. </summary>
- public static final int RATE_DEFAULT = 0;
-
- /// <summary> Holds the name of the proeprty to get the. </summary>
- public static final string SELECTOR_PROPNAME = "selector";
-
- /// <summary> Holds the default message selector. </summary>
- public static final string SELECTOR_DEFAULT = "";
-
- /// <summary> Holds the name of the property to get the waiting timeout for response messages. </summary>
- public static final string TIMEOUT_PROPNAME = "timeout";
-
- /// <summary> Default time to wait before assuming that a ping has timed out. </summary>
- public static final long TIMEOUT_DEFAULT = 30000;
-
- /// <summary> Holds the name of the property to get the commit batch size from. </summary>
- public static final string TX_BATCH_SIZE_PROPNAME = "commitBatchSize";
-
- /// <summary> Defines the default number of pings to send in each transaction when running transactionally. </summary>
- public static final int TX_BATCH_SIZE_DEFAULT = 1;
-
- /// <summary> Holds the name of the property to set the maximum amount of pending message data for a producer to hold. </summary>
- public static final string MAX_PENDING_PROPNAME = "maxPending";
-
- /// <summary> Defines the default maximum quantity of pending message data to allow producers to hold. </summary>
- public static final int MAX_PENDING_DEFAULT = 0;
-
- /// <summary> Holds the name of the property to get the publisher rollback flag from. </summary>
- public static final string ROLLBACK_PUBLISHER_PROPNAME = "rollbackPublisher";
-
- /// <summary> Holds the default publisher roll back setting. </summary>
- public static final bool ROLLBACK_PUBLISHER_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the publisher rollback flag from. </summary>
- public static final string ROLLBACK_RECEIVER_PROPNAME = "rollbackReceiver";
-
- /// <summary> Holds the default publisher roll back setting. </summary>
- public static final bool ROLLBACK_RECEIVER_DEFAULT = false;
-
- // ====================== Options that control the bahviour of the test framework. =========================
-
- /// <summary> Holds the name of the property to get the behavioural mode of not applicable assertions. </summary>
- public static final string NOT_APPLICABLE_ASSERTION_PROPNAME = "notApplicableAssertion";
-
- /// <summary> Holds the default behavioral mode of not applicable assertions, which is logging them as a warning. </summary>
- public static final string NOT_APPLICABLE_ASSERTION_DEFAULT = "warn";
-
- /// <summary> Holds the name of the property to get the verbose mode proeprty from. </summary>
- public static final string VERBOSE_PROPNAME = "verbose";
-
- /// <summary> Holds the default verbose mode. </summary>
- public static final bool VERBOSE_DEFAULT = false;
-
- /// <summary> Holds the default configuration properties. </summary>
- public static ParsedProperties defaults = new ParsedProperties();
-
- static
- {
- defaults.setPropertyIfNull(INITIAL_CONTEXT_FACTORY_PROPNAME, INITIAL_CONTEXT_FACTORY_DEFAULT);
- defaults.setPropertyIfNull(BROKER_PROPNAME, BROKER_DEFAULT);
- defaults.setPropertyIfNull(VIRTUAL_HOST_PROPNAME, VIRTUAL_HOST_DEFAULT);
- defaults.setPropertyIfNull(USERNAME_PROPNAME, USERNAME_DEFAULT);
- defaults.setPropertyIfNull(PASSWORD_PROPNAME, PASSWORD_DEFAULT);
-
- defaults.setPropertyIfNull(PUBLISHER_PRODUCER_BIND_PROPNAME, PUBLISHER_PRODUCER_BIND_DEFAULT);
- defaults.setPropertyIfNull(PUBLISHER_CONSUMER_BIND_PROPNAME, PUBLISHER_CONSUMER_BIND_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_PRODUCER_BIND_PROPNAME, RECEIVER_PRODUCER_BIND_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_CONSUMER_BIND_PROPNAME, RECEIVER_CONSUMER_BIND_DEFAULT);
- defaults.setPropertyIfNull(PUBLISHER_CONSUMER_ACTIVE_PROPNAME, PUBLISHER_CONSUMER_ACTIVE_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_CONSUMER_ACTIVE_PROPNAME, RECEIVER_CONSUMER_ACTIVE_DEFAULT);
- defaults.setPropertyIfNull(SEND_DESTINATION_NAME_ROOT_PROPNAME, SEND_DESTINATION_NAME_ROOT_DEFAULT);
- defaults.setPropertyIfNull(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME, RECEIVE_DESTINATION_NAME_ROOT_DEFAULT);
- defaults.setPropertyIfNull(DESTINATION_COUNT_PROPNAME, DESTINATION_COUNT_DEFAULT);
- defaults.setPropertyIfNull(PUBSUB_PROPNAME, PUBSUB_DEFAULT);
-
- defaults.setPropertyIfNull(PERSISTENT_MODE_PROPNAME, PERSISTENT_MODE_DEFAULT);
- defaults.setPropertyIfNull(TRANSACTED_PUBLISHER_PROPNAME, TRANSACTED_PUBLISHER_DEFAULT);
- defaults.setPropertyIfNull(TRANSACTED_RECEIVER_PROPNAME, TRANSACTED_RECEIVER_DEFAULT);
- defaults.setPropertyIfNull(NO_LOCAL_PROPNAME, NO_LOCAL_DEFAULT);
- defaults.setPropertyIfNull(ACK_MODE_PROPNAME, ACK_MODE_DEFAULT);
- defaults.setPropertyIfNull(DURABLE_SUBSCRIPTION_PROPNAME, DURABLE_SUBSCRIPTION_DEFAULT);
-
- defaults.setPropertyIfNull(EXCLUSIVE_PROPNAME, EXCLUSIVE_DEFAULT);
- defaults.setPropertyIfNull(IMMEDIATE_PROPNAME, IMMEDIATE_DEFAULT);
- defaults.setPropertyIfNull(MANDATORY_PROPNAME, MANDATORY_DEFAULT);
- defaults.setPropertyIfNull(DURABLE_DESTS_PROPNAME, DURABLE_DESTS_DEFAULT);
- defaults.setPropertyIfNull(PREFETCH_PROPNAME, PREFETCH_DEFAULT);
-
- defaults.setPropertyIfNull(MESSAGE_SIZE_PROPNAME, MESSAGE_SIZE_DEAFULT);
- defaults.setPropertyIfNull(RATE_PROPNAME, RATE_DEFAULT);
- defaults.setPropertyIfNull(SELECTOR_PROPNAME, SELECTOR_DEFAULT);
- defaults.setPropertyIfNull(TIMEOUT_PROPNAME, TIMEOUT_DEFAULT);
- defaults.setPropertyIfNull(TX_BATCH_SIZE_PROPNAME, TX_BATCH_SIZE_DEFAULT);
- defaults.setPropertyIfNull(MAX_PENDING_PROPNAME, MAX_PENDING_DEFAULT);
- defaults.setPropertyIfNull(ROLLBACK_PUBLISHER_PROPNAME, ROLLBACK_PUBLISHER_DEFAULT);
- defaults.setPropertyIfNull(ROLLBACK_RECEIVER_PROPNAME, ROLLBACK_RECEIVER_DEFAULT);
-
- defaults.setPropertyIfNull(NOT_APPLICABLE_ASSERTION_PROPNAME, NOT_APPLICABLE_ASSERTION_DEFAULT);
- defaults.setPropertyIfNull(VERBOSE_PROPNAME, VERBOSE_DEFAULT);
- }
-
- /// <summary> Creates a test configuration based on the defaults. </summary>
- public MessagingTestConfigProperties()
- {
- super(defaults);
- }
-
- /// <summary>
- /// Creates a test configuration based on the supplied properties.
- /// </summary>
- /// <param name="properties"> The test configuration. </param>
- public MessagingTestConfigProperties(Properties properties)
- {
- super(properties);
- }
-
- /// <summary>
- /// The size of test messages to send.
- /// </summary>
- /// <return> The size of test messages to send. </return>
- public int getMessageSize()
- {
- return getPropertyAsInteger(MESSAGE_SIZE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the publishing producer should be set up to publish to a destination.
- /// </summary>
- /// <return> Flag to indicate that the publishing producer should be set up to publish to a destination. </return>
- public bool getPublisherProducerBind()
- {
- return getPropertyAsBoolean(PUBLISHER_PRODUCER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the publishing consumer should be set up to receive from a destination.
- /// </summary>
- /// <return> Flag to indicate that the publishing consumer should be set up to receive from a destination. </return>
- public bool getPublisherConsumerBind()
- {
- return getPropertyAsBoolean(PUBLISHER_CONSUMER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the receiving producer should be set up to publish to a destination.
- /// </summary>
- /// <return> Flag to indicate that the receiving producer should be set up to publish to a destination. </return>
- public bool getReceiverProducerBind()
- {
- return getPropertyAsBoolean(RECEIVER_PRODUCER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the receiving consumer should be set up to receive from a destination.
- /// </summary>
- /// <return> Flag to indicate that the receiving consumer should be set up to receive from a destination. </return>
- public bool getReceiverConsumerBind()
- {
- return getPropertyAsBoolean(RECEIVER_CONSUMER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the publishing consumer should be created and actively listening.
- /// </summary>
- /// <return> Flag to indicate that the publishing consumer should be created. </return>
- public bool getPublisherConsumerActive()
- {
- return getPropertyAsBoolean(PUBLISHER_CONSUMER_ACTIVE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the receiving consumers should be created and actively listening.
- /// </summary>
- /// <return> Flag to indicate that the receiving consumers should be created and actively listening. </return>
- public bool getReceiverConsumerActive()
- {
- return getPropertyAsBoolean(RECEIVER_CONSUMER_ACTIVE_PROPNAME);
- }
-
- /// <summary>
- /// A root to create all test destination names from.
- /// </summary>
- /// <return> A root to create all test destination names from. </return>
- public string getSendDestinationNameRoot()
- {
- return getProperty(SEND_DESTINATION_NAME_ROOT_PROPNAME);
- }
-
- /// <summary>
- /// A root to create all receiving destination names from.
- /// </summary>
- /// <return> A root to create all receiving destination names from. </return>
- public string getReceiveDestinationNameRoot()
- {
- return getProperty(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that persistent messages should be used.
- /// </summary>
- /// <return> Flag to indicate that persistent messages should be used. </return>
- public bool getPersistentMode()
- {
- return getPropertyAsBoolean(PERSISTENT_MODE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that transactional messages should be sent by the publisher.
- /// </summary>
- /// <return> Flag to indicate that transactional messages should be sent by the publisher. </return>
- public bool getPublisherTransacted()
- {
- return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that transactional receives should be used by the receiver.
- /// </summary>
- /// <return> Flag to indicate that transactional receives should be used by the receiver. </return>
- public bool getReceiverTransacted()
- {
- return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME);
- }
-
- /// <summary>
- /// The name of the virtual host to run all tests over.
- /// </summary>
- /// <return> The name of the virtual host to run all tests over. </return>
- public string getVirtualHost()
- {
- return getProperty(VIRTUAL_HOST_PROPNAME);
- }
-
- /// <summary>
- /// Limiting rate for each sender in messages per second, or zero for unlimited.
- /// </summary>
- /// <return> Limiting rate for each sender in messages per second, or zero for unlimited. </return>
- public string getRate()
- {
- return getProperty(RATE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that test messages should be received publish/subscribe style by all receivers.
- /// </summary>
- /// <return> Flag to indicate that test messages should be received publish/subscribe style by all receivers. </return>
- public bool getPubsub()
- {
- return getPropertyAsBoolean(PUBSUB_PROPNAME);
- }
-
- /// <summary>
- /// The username credentials to run tests with.
- /// </summary>
- /// <return> The username credentials to run tests with. </return>
- public string getUsername()
- {
- return getProperty(USERNAME_PROPNAME);
- }
-
- /// <summary>
- /// The password credentials to run tests with.
- /// </summary>
- /// <return> The password credentials to run tests with. </return>
- public string getPassword()
- {
- return getProperty(PASSWORD_PROPNAME);
- }
-
- /// <summary>
- /// The timeout duration to fail tests on, should they receive no messages within it.
- /// </summary>
- /// <return> The timeout duration to fail tests on, should they receive no messages within it. </return>
- public long getTimeout()
- {
- return getPropertyAsLong(TIMEOUT_PROPNAME);
- }
-
- /// <summary>
- /// The number of messages to batch into each transaction in transational tests.
- /// </summary>
- /// <return> The number of messages to batch into each transaction in transational tests. </return>
- public int getTxBatchSize()
- {
- return getPropertyAsInteger(TX_BATCH_SIZE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that tests should use durable destinations.
- /// </summary>
- /// <return> Flag to indicate that tests should use durable destinations. </return>
- public bool getDurableDests()
- {
- return getPropertyAsBoolean(DURABLE_DESTS_PROPNAME);
- }
-
- /// <summary>
- /// The ack mode for message receivers to use.
- /// </summary>
- /// <return> The ack mode for message receivers to use. </return>
- public int getAckMode()
- {
- return getPropertyAsInteger(ACK_MODE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that tests should use durable subscriptions.
- /// </summary>
- /// <return> Flag to indicate that tests should use durable subscriptions. </return>
- public bool getDurableSubscription()
- {
- return getPropertyAsBoolean(DURABLE_SUBSCRIPTION_PROPNAME);
- }
-
- /// <summary>
- /// The maximum amount of in-flight data, in bytes, that tests should send at any time.
- /// </summary>
- /// <return> The maximum amount of in-flight data, in bytes, that tests should send at any time. </return>
- public int getMaxPending()
- {
- return getPropertyAsInteger(MAX_PENDING_PROPNAME);
- }
-
- /// <summary>
- /// The size of the prefetch queue to use.
- /// </summary>
- /// <return> The size of the prefetch queue to use. </return>
- public int getPrefetch()
- {
- return getPropertyAsInteger(PREFETCH_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that subscriptions should be no-local.
- /// </summary>
- /// <return> Flag to indicate that subscriptions should be no-local. </return>
- public bool getNoLocal()
- {
- return getPropertyAsBoolean(NO_LOCAL_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that subscriptions should be exclusive.
- /// </summary>
- /// <return> Flag to indicate that subscriptions should be exclusive. </return>
- public bool getExclusive()
- {
- return getPropertyAsBoolean(EXCLUSIVE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that messages must be delivered immediately.
- /// </summary>
- /// <return> Flag to indicate that messages must be delivered immediately. </return>
- public bool getImmediate()
- {
- return getPropertyAsBoolean(IMMEDIATE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that messages must be routable.
- /// </summary>
- /// <return> Flag to indicate that messages must be routable. </return>
- public bool getMandatory()
- {
- return getPropertyAsBoolean(MANDATORY_PROPNAME);
- }
-
- /// <summary>
- /// Gets the value of a flag to indicate that the publisher should rollback all messages sent.
- /// </summary>
- /// <return> A flag to indicate that the publisher should rollback all messages sent. </return>
- public bool getRollbackPublisher()
- {
- return getPropertyAsBoolean(ROLLBACK_PUBLISHER_PROPNAME);
- }
-
- /// <summary>
- /// Gets the value of a flag to indicate that the receiver should rollback all messages received, then receive them
- /// again.
- /// </summary>
- /// <return> A flag to indicate that the publisher should rollback all messages received. </return>
- public bool getRollbackReceiver()
- {
- return getPropertyAsBoolean(ROLLBACK_RECEIVER_PROPNAME);
- }
-
- /// <summary>
- /// Gets the behavioural mode of not applicable assertions. Should be one of 'quiet', 'warn' or 'fail'.
- /// </summary>
- /// <return> The behavioural mode of not applicable assertions. </return>
- public string getNotApplicableAssertionMode()
- {
- return getProperty(NOT_APPLICABLE_ASSERTION_PROPNAME);
- }
- }
- */
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestUtils.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestUtils.csx
deleted file mode 100644
index bb00bf2683..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/TestUtils.csx
+++ /dev/null
@@ -1,188 +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 log4net;
-
-using static Apache.Qpid.Integration.Tests.framework.MessagingTestConfigProperties.*;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.*;
-using javax.naming.Context;
-using javax.naming.InitialContext;
-using javax.naming.NamingException;
-
-using System.Collections.Generic.IDictionary;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// TestUtils provides static helper methods that are usefull for writing tests against QPid.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Create connections from test properties. <td> <see cref="MessagingTestConfigProperties"/>
- /// <tr><td> Create test messages.
- /// <tr><td> Inject a short pause in a test.
- /// <tr><td> Serialize properties into a message.
- /// </table>
- /// </summary>
- public class TestUtils
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(TestUtils));
-
- /// <summary> Some dummy data to stuff all test messages with. </summary>
- private static final byte[] MESSAGE_DATA_BYTES =
- "Test Message -- Test Message -- Test Message -- Test Message -- Test Message -- Test Message -- Test Message -- "
- .getBytes();
-
- /// <summary>
- /// Establishes a JMS connection using a set of properties and qpids built in JNDI implementation. This is a simple
- /// convenience method for code that does not anticipate handling connection failures. All exceptions that indicate
- /// that the connection has failed, are wrapped as rutime exceptions, presumably handled by a top level failure
- /// handler.
- ///
- /// <p/>This utility makes use of the following test parameters from <see cref="MessagingTestConfigProperties"/> to control
- /// the connection creation:
- ///
- /// <p/><table>
- /// <tr><td> <see cref="MessagingTestConfigProperties#USERNAME_PROPNAME"/> <td> The username.
- /// <tr><td> <see cref="MessagingTestConfigProperties#PASSWORD_PROPNAME"/> <td> The password.
- /// <tr><td> <see cref="MessagingTestConfigProperties#VIRTUAL_HOST_PROPNAME"/> <td> The virtual host name.
- /// <tr><td> <see cref="MessagingTestConfigProperties#BROKER_PROPNAME"/> <td> The broker URL.
- /// <tr><td> <see cref="MessagingTestConfigProperties#CONNECTION_NAME"/> <td> The broker name in the initial context.
- /// </summary>
- /// <param name="messagingProps"> Connection properties as defined in <see cref="MessagingTestConfigProperties"/>. </param>
- ///
- /// <return> A JMS conneciton. </return>
- public static Connection createConnection(ParsedProperties messagingProps)
- {
- log.debug("public static Connection createConnection(ParsedProperties messagingProps = " + messagingProps
- + "): called");
-
- try
- {
- // Extract the configured connection properties from the test configuration.
- string conUsername = messagingProps.getProperty(USERNAME_PROPNAME);
- string conPassword = messagingProps.getProperty(PASSWORD_PROPNAME);
- string virtualHost = messagingProps.getProperty(VIRTUAL_HOST_PROPNAME);
- string brokerUrl = messagingProps.getProperty(BROKER_PROPNAME);
-
- // Create the broker connection url.
- string connectionstring =
- "amqp://" + conUsername + ":" + conPassword + "@clientid/" + ((virtualHost != null) ? virtualHost : "")
- + "?brokerlist='" + brokerUrl + "'";
-
- // Create properties to create the initial context from, and inject the connection factory configuration
- // for the defined connection name into it.
- messagingProps.setProperty("connectionfactory." + CONNECTION_NAME, connectionString);
-
- Context ctx = new InitialContext(messagingProps);
-
- ConnectionFactory cf = (ConnectionFactory) ctx.lookup(CONNECTION_NAME);
-
- return cf.createConnection();
- }
- catch (NamingException e)
- {
- throw new RuntimeException("Got JNDI NamingException whilst looking up the connection factory.", e);
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Could not establish connection due to JMSException.", e);
- }
- }
-
- /// <summary>
- /// Creates a test message of the specified size, on the given JMS session.
- /// </summary>
- /// <param name="session"> The JMS session. </param>
- /// <param name="size"> The size of the message in bytes. </param>
- ///
- /// <return> A bytes message, of the specified size, filled with dummy data. </return>
- ///
- /// <exception cref="JMSException"> Any underlying JMSExceptions are allowed to fall through. </exception>
- public static Message createTestMessageOfSize(Session session, int size) throws JMSException
- {
- BytesMessage message = session.createBytesMessage();
-
- if (size > 0)
- {
- int div = MESSAGE_DATA_BYTES.length / size;
- int mod = MESSAGE_DATA_BYTES.length % size;
-
- for (int i = 0; i < div; i++)
- {
- message.writeBytes(MESSAGE_DATA_BYTES);
- }
-
- if (mod != 0)
- {
- message.writeBytes(MESSAGE_DATA_BYTES, 0, mod);
- }
- }
-
- return message;
- }
-
- /// <summary>
- /// Pauses for the specified length of time. In the event of failing to pause for at least that length of time
- /// due to interuption of the thread, a RutimeException is raised to indicate the failure. The interupted status
- /// of the thread is restores in that case. This method should only be used when it is expected that the pause
- /// will be succesfull, for example in test code that relies on inejecting a pause.
- /// </summary>
- /// <param name="t"> The minimum time to pause for in milliseconds. </param>
- public static void pause(long t)
- {
- try
- {
- Thread.sleep(t);
- }
- catch (InterruptedException e)
- {
- // Restore the interrupted status
- Thread.currentThread().interrupt();
-
- throw new RuntimeException("Failed to generate the requested pause length.", e);
- }
- }
-
- /// <summary>
- /// Sets properties of different types on a JMS Message.
- /// </summary>
- /// <param name="message"> The message to set properties on. </param>
- /// <param name="properties"> The property name/value pairs to set. </param>
- ///
- /// <exception cref="javax.jms.JMSException"> All underlying JMSExceptions are allowed to fall through. </exception>
- ///
- /// <remarks> Move this helper method somewhere else. For example, TestUtils.</remarks>
- public static void setPropertiesOnMessage(Message message, Map<Object, Object> properties) throws JMSException
- {
- for (Map.Entry<Object, Object> entry : properties.entrySet())
- {
- string name = entry.getKey().ToString();
- Object value = entry.getValue();
-
- message.setObjectProperty(name, value);
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/alljava.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/alljava.csx
deleted file mode 100644
index 23ebd53a5b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/alljava.csx
+++ /dev/null
@@ -1,7851 +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.Integration.Tests.framework
-{
- /// <summary>
- /// Assertion models an assertion on a test <see cref="Circuit"/>.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Indicate whether or not the assertion passes when applied.
- /// </table>
- /// </summary>
- public interface Assertion
- {
- /// <summary>
- /// Applies the assertion.
- /// </summary>
- /// <return> <tt>true</tt> if the assertion passes, <tt>false</tt> if it fails. </return>
- public bool apply();
- }
-}
-/*
- *
- * 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.Collections.Generic.LinkedList;
-using System.Collections.Generic.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// AssertionBase is a base class for implenmenting assertions. It provides a mechanism to store error messages, and
- /// report all error messages when its <see cref="#ToString()"/> method is called.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Collect error messages.
- /// </table>
- /// </summary>
- public abstract class AssertionBase : Assertion
- {
- /// <summary> Holds the error messages. </summary>
- IList<String> errors = new LinkedList<String>();
-
- /// <summary>
- /// Adds an error message to the assertion.
- /// </summary>
- /// <param name="error"> An error message to add to the assertion. </param>
- public void addError(string error)
- {
- errors.add(error);
- }
-
- /// <summary>
- /// Prints all of the error messages in the assertion into a string.
- /// </summary>
- /// <return> All of the error messages in the assertion as a string. </return>
- public string ToString()
- {
- string result = "";
-
- for (string error : errors)
- {
- result += error;
- }
-
- return result;
- }
- }
-}
-/*
- *
- * 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.Integration.Tests.framework
-{
- /// <summary>
- /// BrokerLifecycleAware is an awareness interface implemented by test cases that can run control the life-cycle of
- /// the brokers on which they run. Its purpose is to expose additional instrumentation of brokers during testing, that
- /// enables tests to use an automated failure mechanism to simulate broker failures, and to re-start failed brokers.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Indicate whether or not a test case is using an in-vm broker.
- /// <tr><td> Track which in-vm broker is currently in use.
- /// <tr><td> Accept setting of a failure mechanism. <td> <see cref="CauseFailure"/>.
- /// </table>
- /// </summary>
- ///
- /// <remarks> Need to think about how to present the brokers through this interface. Thinking numbering the available
- /// brokers from 1 will do. Then can kill 1 and assume failing onto 2. Restart 1 and kill 2 and fail back onto
- /// 1 again? </remarks>
- public interface BrokerLifecycleAware
- {
- public void setInVmBrokers();
-
- /// <summary>
- /// Indicates whether or not a test case is using in-vm brokers.
- /// </summary>
- /// <return> <tt>true</tt> if the test is using in-vm brokers, <tt>false</tt> otherwise. </return>
- public bool usingInVmBroker();
-
- /// <summary>
- /// Sets the currently live in-vm broker.
- /// </summary>
- /// <param name="i"> The currently live in-vm broker. </param>
- public void setLiveBroker(int i);
-
- /// <summary>
- /// Reports the currently live in-vm broker.
- /// </summary>
- /// <return> The currently live in-vm broker. </return>
- public int getLiveBroker();
-
- /// <summary>
- /// Accepts a failure mechanism.
- /// </summary>
- /// <param name="failureMechanism"> The failure mechanism. </param>
- public void setFailureMechanism(CauseFailure failureMechanism);
- }
-}
-/*
- *
- * 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.Integration.Tests.framework
-{
- /// <summary>
- /// CauseFailure provides a method to cause a failure in a messaging broker, usually used in conjunction with fail-over
- /// or other failure mode testing. In some cases failures may be automated, for example by shutting down an in-vm broker,
- /// or by sending a special control signal to a broker over a network connection. In other cases, it may be preferable
- /// to ask a user interactively to cause a failure scenario, in which case an implementation may display a prompt or
- /// dialog box asking for notification once the failure has been caused. The purpose of this interface is to abstract
- /// the exact cause and nature of a failure out of failure test cases.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Cause messaging broker failure.
- /// </table>
- /// </summary>
- public interface CauseFailure
- {
- /// <summary> Causes the active message broker to fail. </summary>
- void causeFailure();
- }
-}
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-using Apache.Qpid.Integration.Tests.framework.CauseFailure;
-
-using java.io.IOException;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// Causes a message broker failure by interactively prompting the user to cause it.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Cause messaging broker failure.
- /// </table>
- /// </summary>
- public class CauseFailureUserPrompt : CauseFailure
- {
- /// <summary> Causes the active message broker to fail.</summary>
- public void causeFailure()
- {
- waitForUser("Cause a broker failure now, then press Return.");
- }
-
- /// <summary>
- /// Outputs a prompt to the console and waits for the user to press return.
- /// </summary>
- /// <param name="prompt"> The prompt to display on the console. </param>
- private void waitForUser(string prompt)
- {
- System.out.println(prompt);
-
- try
- {
- System.in.read();
- }
- catch (IOException e)
- {
- // Ignored.
- }
-
- System.out.println("Continuing.");
- }
- }
-}
-/*
- *
- * 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.Collections.Generic.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A Circuit is the basic test unit against which test cases are to be written. A circuit consists of two 'ends', an
- /// instigating 'publisher' end and a more passive 'receivers' end.
- ///
- /// <p/>Once created, the life-cycle of a circuit may be controlled by <see cref="#start()"/>ing it, or <see cref="#close()"/>ing it.
- /// Once started, the circuit is ready to send messages over. Once closed the circuit can no longer be used.
- ///
- /// <p/>The state of the circuit may be taken with the <see cref="#check()"/> method, and asserted against by the
- /// <see cref="#applyAssertions(System.Collections.Generic.IList)"/> method.
- ///
- /// <p/>There is a default test procedure which may be performed against the circuit. The outline of this procedure is:
- ///
- /// <p/><pre>
- /// Start the circuit.
- /// Send test messages.
- /// Request a status report.
- /// Assert conditions on the publishing end of the circuit.
- /// Assert conditions on the receiving end of the circuit.
- /// Close the circuit.
- /// Pass with no failed assertions or fail with a list of failed assertions.
- /// </pre>
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Supply the publishing and receiving ends of a test messaging circuit.
- /// <tr><td> Start the circuit running.
- /// <tr><td> Close the circuit down.
- /// <tr><td> Take a reading of the circuits state.
- /// <tr><td> Apply assertions against the circuits state.
- /// <tr><td> Send test messages over the circuit.
- /// <tr><td> Perform the default test procedue on the circuit.
- /// </table>
- /// </summary>
- public interface Circuit
- {
- /// <summary>
- /// Gets the interface on the publishing end of the circuit.
- /// </summary>
- /// <return> The publishing end of the circuit. </return>
- public Publisher getPublisher();
-
- /// <summary>
- /// Gets the interface on the receiving end of the circuit.
- /// </summary>
- /// <return> The receiving end of the circuit. </return>
- public Receiver getReceiver();
-
- /// <summary>
- /// Connects and starts the circuit. After this method is called the circuit is ready to send messages.
- public void start();
-
- /// <summary>
- /// Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit,
- /// into a report, against which assertions may be checked.
- public void check();
-
- /// <summary>
- /// Closes the circuit. All associated resources are closed.
- public void close();
-
- /// <summary>
- /// Applied a list of assertions against the test circuit. The <see cref="#check()"/> method should be called before doing
- /// this, to ensure that the circuit has gathered its state into a report to assert against.
- /// </summary>
- /// <param name="assertions"> The list of assertions to apply to the circuit. </param>
- ///
- /// <return> Any assertions that failed. </return>
- public IList<Assertion> applyAssertions(List<Assertion> assertions);
-
- /// <summary>
- /// Runs the default test procedure against the circuit, and checks that all of the specified assertions hold.
- /// </summary>
- /// <param name="numMessages"> The number of messages to send using the default test procedure. </param>
- /// <param name="assertions"> The list of assertions to apply. </param>
- ///
- /// <return> Any assertions that failed. </return>
- public IList<Assertion> test(int numMessages, List<Assertion> assertions);
- }
-}
-/*
- *
- * 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 javax.jms.*;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A CircuitEnd is a pair consisting of one message producer and one message consumer, that represents one end of a
- /// test circuit. It is a standard unit of connectivity allowing a full-duplex conversation to be held, provided both
- /// the consumer and producer are instantiated and configured.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide a message producer for sending messages.
- /// <tr><td> Provide a message consumer for receiving messages.
- /// </table>
- /// </summary>
- ///
- /// <remarks> Update the <see cref="org.apache.qpid.util.ConversationFactory"/> so that it accepts these as the basic conversation
- /// connection units.</remarks>
- public interface CircuitEnd
- {
- /// <summary>
- /// Gets the message producer at this circuit end point.
- /// </summary>
- /// <return> The message producer at with this circuit end point. </return>
- public MessageProducer getProducer();
-
- /// <summary>
- /// Gets the message consumer at this circuit end point.
- /// </summary>
- /// <return> The message consumer at this circuit end point. </return>
- public MessageConsumer getConsumer();
-
- /// <summary>
- /// Send the specified message over the producer at this end point.
- /// </summary>
- /// <param name="message"> The message to send. </param>
- ///
- /// <exception cref="JMSException"> Any JMS exception occuring during the send is allowed to fall through. </exception>
- public void send(Message message) throws JMSException;
-
- /// <summary>
- /// Gets the JMS Session associated with this circuit end point.
- /// </summary>
- /// <return> The JMS Session associated with this circuit end point. </return>
- public Session getSession();
-
- /// <summary>
- /// Closes the message producers and consumers and the sessions, associated with this circuit end point.
- /// </summary>
- /// <exception cref="JMSException"> Any JMSExceptions occurring during the close are allowed to fall through. </exception>
- public void close() throws JMSException;
-
- /// <summary>
- /// Returns the message monitor for reporting on received messages on this circuit end.
- /// </summary>
- /// <return> The message monitor for this circuit end. </return>
- public MessageMonitor getMessageMonitor();
-
- /// <summary>
- /// Returns the exception monitor for reporting on exceptions received on this circuit end.
- /// </summary>
- /// <return> The exception monitor for this circuit end. </return>
- public ExceptionMonitor getExceptionMonitor();
- }
-}
-/*
- *
- * 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 javax.jms.*;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A CircuitEndBase is a pair consisting of one message producer and one message consumer, that represents one end of a
- /// test circuit. It is a standard unit of connectivity allowing a full-duplex conversation to be held, provided both
- /// the consumer and producer are instantiated and configured.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide a message producer for sending messages.
- /// <tr><td> Provide a message consumer for receiving messages.
- /// </table>
- /// </summary>
- public class CircuitEndBase : CircuitEnd
- {
- /// <summary> Holds the single message producer. </summary>
- MessageProducer producer;
-
- /// <summary> Holds the single message consumer. </summary>
- MessageConsumer consumer;
-
- /// <summary> Holds the controlSession for the circuit end. </summary>
- Session session;
-
- /// <summary> Holds the message monitor for the circuit end. </summary>
- MessageMonitor messageMonitor;
-
- /// <summary> Holds the exception monitor for the circuit end. </summary>
- ExceptionMonitor exceptionMonitor;
-
- /// <summary>
- /// Creates a circuit end point on the specified producer, consumer and controlSession. Monitors are also configured
- /// for messages and exceptions received by the circuit end.
- /// </summary>
- /// <param name="producer"> The message producer for the circuit end point. </param>
- /// <param name="consumer"> The message consumer for the circuit end point. </param>
- /// <param name="session"> The controlSession for the circuit end point. </param>
- /// <param name="messageMonitor"> The monitor to notify of all messages received by the circuit end. </param>
- /// <param name="exceptionMonitor"> The monitor to notify of all exceptions received by the circuit end. </param>
- public CircuitEndBase(MessageProducer producer, MessageConsumer consumer, Session session, MessageMonitor messageMonitor,
- ExceptionMonitor exceptionMonitor)
- {
- this.producer = producer;
- this.consumer = consumer;
- this.session = session;
-
- this.messageMonitor = messageMonitor;
- this.exceptionMonitor = exceptionMonitor;
- }
-
- /// <summary>
- /// Gets the message producer at this circuit end point.
- /// </summary>
- /// <return> The message producer at with this circuit end point. </return>
- public MessageProducer getProducer()
- {
- return producer;
- }
-
- /// <summary>
- /// Gets the message consumer at this circuit end point.
- /// </summary>
- /// <return> The message consumer at this circuit end point. </return>
- public MessageConsumer getConsumer()
- {
- return consumer;
- }
-
- /// <summary>
- /// Send the specified message over the producer at this end point.
- /// </summary>
- /// <param name="message"> The message to send. </param>
- /// <exception cref="javax.jms.JMSException"> Any JMS exception occuring during the send is allowed to fall through. </exception>
- public void send(Message message) throws JMSException
- {
- producer.send(message);
- }
-
- /// <summary>
- /// Gets the JMS Session associated with this circuit end point.
- /// </summary>
- /// <return> The JMS Session associated with this circuit end point. </return>
- public Session getSession()
- {
- return session;
- }
-
- /// <summary>
- /// Closes the message producers and consumers and the sessions, associated with this circuit end point.
- /// </summary>
- /// <exception cref="javax.jms.JMSException"> Any JMSExceptions occurring during the close are allowed to fall through. </exception>
- public void close() throws JMSException
- {
- if (producer != null)
- {
- producer.close();
- }
-
- if (consumer != null)
- {
- consumer.close();
- }
- }
-
- /// <summary>
- /// Returns the message monitor for reporting on received messages on this circuit end.
- /// </summary>
- /// <return> The message monitor for this circuit end. </return>
- public MessageMonitor getMessageMonitor()
- {
- return messageMonitor;
- }
-
- /// <summary>
- /// Returns the exception monitor for reporting on exceptions received on this circuit end.
- /// </summary>
- /// <return> The exception monitor for this circuit end. </return>
- public ExceptionMonitor getExceptionMonitor()
- {
- return exceptionMonitor;
- }
- }
-}
-/*
- *
- * 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.Integration.Tests.framework.clocksynch
-{
- /// <summary>
- /// ClockSynchFailureException represents failure of a <see cref="ClockSynchronizer"/> to achieve synchronization. For example,
- /// this could be because a reference signal is not available, or because a desired accurracy cannot be attained.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Represent failure to achieve synchronization.
- /// </table>
- /// </summary>
- public class ClockSynchFailureException extends Exception
- {
- /// <summary>
- /// Creates a clock synch failure exception.
- /// </summary>
- /// <param name="message"> The detail message (which is saved for later retrieval by the <see cref="#getMessage()"/> method). </param>
- /// <param name="cause"> The cause (which is saved for later retrieval by the <see cref="#getCause()"/> method). (A <tt>null</tt>
- /// value is permitted, and indicates that the cause is nonexistent or unknown.)</param>
- public ClockSynchFailureException(string message, Throwable cause)
- {
- super(message, cause);
- }
- }
-}
-/*
- *
- * 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.Integration.Tests.framework.clocksynch
-{
- /// <summary>
- /// ClockSynchronizer provides an interface through which two nodes may synchronize their clocks. It is expected that one
- /// node will act as the reference clock, to which no delta need be applied, and the other node will act as the slave,
- /// and which must apply a delta to its local clock to get a clock synchronized with the reference.
- ///
- /// <p/>The slave side will initiate the computation of a clock delta by calling the <see cref="#synch"/> method. This method
- /// will not return until the delta has been computed, at which point there is a method to return its value, as well as
- /// an estimate of the likely error (usually one standard deviation), in the synchronization. For convenience there is a
- /// <see cref="#nanoTime"/> method to return the value of System.nanoTime() with the delta added in.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Trigger a clock synchronization.
- /// <tr><td> Compute a clock delta to apply to the local clock.
- /// <tr><td> Estimate the error in the synchronzation.
- /// </table>
- /// </summary>
- public interface ClockSynchronizer
- {
- /// <summary>
- /// The slave side should call this to copute a clock delta with the reference.
- /// </summary>
- /// <exception cref="ClockSynchFailureException"> If synchronization cannot be achieved. </exception>
- public void synch() throws ClockSynchFailureException;
-
- /// <summary>
- /// Gets the clock delta in nano seconds.
- /// </summary>
- /// <return> The clock delta in nano seconds. </return>
- public long getDelta();
-
- /// <summary>
- /// Gets an estimate of the clock error in nan seconds.
- /// </summary>
- /// <return> An estimate of the clock error in nan seconds. </return>
- public long getEpsilon();
-
- /// <summary>
- /// Gets the local clock time with any computed delta added in.
- /// </summary>
- /// <return> The local clock time with any computed delta added in. </return>
- public long nanoTime();
- }
-}
-/*
- *
- * 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 log4net;
-
-using uk.co.thebadgerset.junit.extensions.ShutdownHookable;
-using uk.co.thebadgerset.junit.extensions.Throttle;
-
-namespace Apache.Qpid.Integration.Tests.framework.clocksynch
-{
- /// <summary>
- /// ClockSynchThread is a convenient utility for running a thread that periodically synchronizes the clock against
- /// a reference. Supply it with a <see cref="ClockSynchronizer"/> and a <see cref="Throttle"/> and it will continually keep the
- /// clock up-to-date at a rate determined by the throttle.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Continually sychronize the clock at a throttled rate.
- /// </table>
- /// </summary>
- public class ClockSynchThread extends Thread : ShutdownHookable
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(ClockSynchThread));
-
- /// <summary> Holds the clock syncher for the synch thread. </summary>
- private ClockSynchronizer clockSyncher;
-
- /// <summary> Holds the throttle to limit the synch rate. </summary>
- private Throttle throttle;
-
- /// <summary> Flag to indicate that the periodic clock syncher should keep running. </summary>
- bool doSynch = true;
-
- /// <summary>
- /// Creates a clock synchronizer thread from a clock synchronizer and a throttle.
- /// </summary>
- /// <param name="syncher"> The clock synchronizer. </param>
- /// <param name="throttle"> The throttle. </param>
- public ClockSynchThread(ClockSynchronizer syncher, Throttle throttle)
- {
- this.clockSyncher = syncher;
- this.throttle = throttle;
- }
-
- /// <summary> Terminates the synchronization thread. </summary>
- public void terminate()
- {
- doSynch = false;
- }
-
- /// <summary> Continually updates the clock, until <see cref="#terminate()"/> is called. </summary>
- public void run()
- {
- while (doSynch)
- {
- // Perform a clock clockSynch.
- try
- {
- // Wait controlled by the throttle before doing the next synch.
- throttle.throttle();
-
- clockSyncher.synch();
- log.debug("Clock synched, delta = " + clockSyncher.getDelta() + ", epsilon = " + clockSyncher.getEpsilon()
- + ".");
- }
- // Terminate the synch thread if the synchronization cannot be achieved.
- catch (ClockSynchFailureException e)
- {
- log.debug("Cannot synchronize the clock (reference service may be down). Terminating the synch thread.");
- doSynch = false;
- }
- }
- }
-
- /// <summary>
- /// Gets the clock synchronizer that is kept continually up to date.
- /// </summary>
- /// <return> The clock synchronizer that is kept continually up to date. </return>
- public ClockSynchronizer getClockSyncher()
- {
- return clockSyncher;
- }
-
- /// <summary>
- /// Supplies a shutdown hook, that terminates the synching thread.
- /// </summary>
- /// <return> The shut down hook. </return>
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- doSynch = false;
- }
- });
- }
- }
-}
-/*
- *
- * 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.Integration.Tests.framework.clocksynch
-{
-
- /// <summary>
- /// LocalClockSynchronizer is a fake <see cref="ClockSynchronizer"/> that simply calls System.nanoTime(). It exists so that
- /// the same tests can be run distributed or locally, taking timings against the ClockSynchronizer interface without
- /// being aware of how they are being run.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Supply the local clock with no delta.
- /// </table>
- /// </summary>
- public class LocalClockSynchronizer : ClockSynchronizer
- {
- /// <summary>
- /// The slave side should call this to copute a clock delta with the reference.
- /// </summary>
- /// <exception cref="Apache.Qpid.Integration.Tests.framework.clocksynch.ClockSynchFailureException"> If synchronization cannot be achieved. </exception>
- public void synch() throws ClockSynchFailureException
- { }
-
- /// <summary>
- /// Gets the clock delta in nano seconds.
- /// </summary>
- /// <return> The clock delta in nano seconds. </return>
- public long getDelta()
- {
- return 0L;
- }
-
- /// <summary>
- /// Gets an estimate of the clock error in nan seconds.
- /// </summary>
- /// <return> An estimate of the clock error in nan seconds. </return>
- public long getEpsilon()
- {
- return 0L;
- }
-
- /// <summary>
- /// Gets the local clock time with any computed delta added in.
- /// </summary>
- /// <return> The local clock time with any computed delta added in. </return>
- public long nanoTime()
- {
- return System.nanoTime();
- }
- }
-}
-/*
- *
- * 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 log4net;
-
-using uk.co.thebadgerset.junit.extensions.ShutdownHookable;
-
-using java.io.IOException;
-using java.net.*;
-using java.nio.ByteBuffer;
-
-namespace Apache.Qpid.Integration.Tests.framework.clocksynch
-{
- /// <summary>
- /// UDPClockReference supplies a refernce clock signal (generated from System.nanoTime()).
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Supply a reference clock signal.
- /// </table>
- /// </summary>
- ///
- /// <remarks> Port hard coded. Make configurable.</remarks>
- ///
- /// <remarks> Errors rethrown as runtimes, or silently terminate the service. Could add better error handling if needed.</remarks>
- public class UDPClockReference : Runnable, ShutdownHookable
- {
- /// <summary> Used for debugging. </summary>
- // private static ILog log = LogManager.GetLogger(typeof(UDPClockReference));
-
- /// <summary> Defines the timeout to use when polling the socket for time requests. </summary>
- private static final int TIMEOUT = 200;
-
- /// <summary> Defines the port to run the clock reference on. </summary>
- public static final int REFERENCE_PORT = 4444;
-
- /// <summary> Holds the socket to receive clock reference requests on. </summary>
- protected DatagramSocket socket = null;
-
- /// <summary> Flag used to indicate that the time server should keep running. Set to false to terminate. </summary>
- protected bool publish = true;
-
- /// <summary> Creates a clock reference service on the standard port. </summary>
- public UDPClockReference()
- {
- try
- {
- socket = new DatagramSocket(REFERENCE_PORT);
- socket.setSoTimeout(TIMEOUT);
- }
- catch (SocketException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /// <summary>
- /// Implements the run loop for this reference time server. This waits for incoming time requests, and replies to
- /// any, with a message with the local time stamp in it. Periodically (controlled by <see cref="#TIMEOUT"/>), the run
- /// loop will check if the <see cref="#publish"/> flag has been cleared, and terminate the reference time service if so.
- /// </summary>
- public void run()
- {
- byte[] buf = new byte[256];
- ByteBuffer bbuf = ByteBuffer.wrap(buf);
-
- while (publish)
- {
- try
- {
- // Wait for a reference time request.
- DatagramPacket packet = new DatagramPacket(buf, buf.length);
- bool timedOut = false;
-
- try
- {
- socket.receive(packet);
- }
- catch (SocketTimeoutException e)
- {
- timedOut = true;
- }
-
- if (!timedOut)
- {
- // Work out from the received packet, where to reply to.
- InetAddress address = packet.getAddress();
- int port = packet.getPort();
-
- // Respond to the time request by sending back the local clock as the reference time.
- bbuf.putLong(System.nanoTime());
- bbuf.flip();
- packet = new DatagramPacket(bbuf.array(), bbuf.capacity(), address, port);
-
- socket.send(packet);
- }
- }
- catch (IOException e)
- {
- publish = false;
- }
- }
-
- socket.close();
- }
-
- /// <summary>
- /// Supplies a shutdown hook.
- /// </summary>
- /// <return> The shut down hook. </return>
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- publish = false;
- }
- });
- }
-
- /// <summary>
- /// For testing purposes. Runs a reference clock on the default port.
- /// </summary>
- /// <param name="args"> None. </param>
- public static void main(String[] args)
- {
- try
- {
- // Create the clock reference service.
- UDPClockReference clock = new UDPClockReference();
-
- // Set up a shutdown hook for it.
- Runtime.getRuntime().addShutdownHook(clock.getShutdownHook());
-
- // Start the service.
- clock.run();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(1);
- }
- }
- }
-}
-/*
- *
- * 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 log4net;
-
-using uk.co.thebadgerset.junit.extensions.util.CommandLineParser;
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using java.io.IOException;
-using java.net.*;
-using java.nio.ByteBuffer;
-using java.util.Arrays;
-
-namespace Apache.Qpid.Integration.Tests.framework.clocksynch
-{
- /// <summary>
- /// UDPClockSynchronizer is a <see cref="ClockSynchronizer"/> that sends pings as UDP datagrams, and uses the following simple
- /// algorithm to perform clock synchronization:
- ///
- /// <ol>
- /// <li>Slave initiates synchronization with a Reference clock.</li>
- /// <li>Slave stamps current local time on a "time request" message and sends to the Reference.</li>
- /// <li>Upon receipt by Reference, Reference stamps Reference-time and returns.</li>
- /// <li>Upon receipt by Slave, Slave subtracts current time from sent time and divides by two to compute latency. It
- /// subtracts current time from Reference time to determine Slave-Reference time delta and adds in the
- /// half-latency to get the correct clock delta.</li>
- /// <li>The first result is immediately used to update the clock since it will get the local clock into at least
- /// the right ballpark.</li>
- /// <li>The Slave repeats steps 2 through 4, 15 more times.</li>
- /// <li>The results of the packet receipts are accumulated and sorted in lowest-latency to highest-latency order. The
- /// median latency is determined by picking the mid-point sample from this ordered list.</li>
- /// <li>All samples outside 1 standard-deviation from the median are discarded and the remaining samples
- /// are averaged using an arithmetic mean.</li>
- /// </ol>
- ///
- /// <p/>The use of UDP datagrams, instead of TCP based communication eliminates the hidden delays that TCP can introduce,
- /// as it can transparently re-order or re-send packets, or introduce delays as packets are naggled.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Trigger a clock synchronziation.
- /// <tr><td> Compute a clock delta to apply to the local clock.
- /// <tr><td> Estimate the error in the synchronzation.
- /// </table>
- /// </summary>
- public class UDPClockSynchronizer : ClockSynchronizer
- {
- /// <summary> Used for debugging. </summary>
- // private static ILog log = LogManager.GetLogger(typeof(UDPClockSynchronizer));
-
- /// <summary> Defines the timeout to use when waiting for responses to time requests. </summary>
- private static final int TIMEOUT = 50;
-
- /// <summary> The clock delta. </summary>
- private long delta = 0L;
-
- /// <summary> Holds an estimate of the clock error relative to the reference clock. </summary>
- private long epsilon = 0L;
-
- /// <summary> Holds the address of the reference clock. </summary>
- private InetAddress referenceAddress;
-
- /// <summary> Holds the socket to communicate with the reference service over. </summary>
- private DatagramSocket socket;
-
- /// <summary> Used to control the shutdown in the main test loop. </summary>
- private static bool doSynch = true;
-
- /// <summary>
- /// Creates a clock synchronizer against the specified address for the reference.
- /// </summary>
- /// <param name="address"> The address of the reference service. </param>
- public UDPClockSynchronizer(string address)
- {
- try
- {
- referenceAddress = InetAddress.getByName(address);
- }
- catch (UnknownHostException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /// <summary>
- /// The slave side should call this to compute a clock delta with the reference.
- /// </summary>
- /// <exception cref="ClockSynchFailureException"> If synchronization cannot be achieved, due to unavailability of the reference
- /// time service. </exception>
- public void synch() throws ClockSynchFailureException
- {
- try
- {
- socket = new DatagramSocket();
- socket.setSoTimeout(TIMEOUT);
-
- // Synchronize on a single ping, to get the clock into the right ball-park.
- synch(1);
-
- // Synchronize on 15 pings.
- synch(15);
-
- // And again, for greater accuracy, on 31.
- synch(31);
-
- socket.close();
- }
- catch (SocketException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /// <summary>
- /// Updates the synchronization delta by performing the specified number of reference clock requests.
- /// </summary>
- /// <param name="n"> The number of reference clock request cycles to perform. </param>
- ///
- /// <exception cref="ClockSynchFailureException"> If synchronization cannot be achieved, due to unavailability of the reference
- /// time service. </exception>
- protected void synch(int n) throws ClockSynchFailureException
- {
- // log.debug("protected void synch(int n = " + n + "): called");
-
- // Create an array of deltas by performing n reference pings.
- long[] delta = new long[n];
-
- for (int i = 0; i < n; i++)
- {
- delta[i] = ping();
- }
-
- // Reject any deltas that are larger than 1 s.d. above the median.
- long median = median(delta);
- long sd = standardDeviation(delta);
-
- // log.debug("median = " + median);
- // log.debug("sd = " + sd);
-
- long[] tempDeltas = new long[n];
- int count = 0;
-
- for (int i = 0; i < n; i++)
- {
- if ((delta[i] <= (median + sd)) && (delta[i] >= (median - sd)))
- {
- tempDeltas[count] = delta[i];
- count++;
- }
- else
- {
- // log.debug("Rejected: " + delta[i]);
- }
- }
-
- System.arraycopy(tempDeltas, 0, delta, 0, count);
-
- // Estimate the delta as the mean of the remaining deltas.
- this.delta += mean(delta);
-
- // Estimate the error as the standard deviation of the remaining deltas.
- this.epsilon = standardDeviation(delta);
-
- // log.debug("this.delta = " + this.delta);
- // log.debug("this.epsilon = " + this.epsilon);
- }
-
- /// <summary>
- /// Performs a single reference clock request cycle and returns the estimated delta relative to the local clock.
- /// This is computed as the half-latency of the requst cycle, plus the reference clock, minus the local clock.
- /// </summary>
- /// <return> The estimated clock delta. </return>
- ///
- /// <exception cref="ClockSynchFailureException"> If the reference service is not responding. </exception>
- protected long ping() throws ClockSynchFailureException
- {
- // log.debug("protected long ping(): called");
-
- try
- {
- byte[] buf = new byte[256];
-
- bool timedOut = false;
- long start = 0L;
- long refTime = 0L;
- long localTime = 0L;
- long latency = 0L;
- int failCount = 0;
-
- // Keep trying the ping until it gets a response, or 10 tries in a row all time out.
- do
- {
- // Start timing the request latency.
- start = nanoTime();
-
- // Get the reference time.
- DatagramPacket packet =
- new DatagramPacket(buf, buf.length, referenceAddress, UDPClockReference.REFERENCE_PORT);
- socket.send(packet);
- packet = new DatagramPacket(buf, buf.length);
-
- timedOut = false;
-
- try
- {
- socket.receive(packet);
- }
- catch (SocketTimeoutException e)
- {
- timedOut = true;
- failCount++;
-
- continue;
- }
-
- ByteBuffer bbuf = ByteBuffer.wrap(packet.getData());
- refTime = bbuf.getLong();
-
- // Stop timing the request latency.
- localTime = nanoTime();
- latency = localTime - start;
-
- // log.debug("refTime = " + refTime);
- // log.debug("localTime = " + localTime);
- // log.debug("start = " + start);
- // log.debug("latency = " + latency);
- // log.debug("delta = " + ((latency / 2) + (refTime - localTime)));
-
- }
- while (timedOut && (failCount < 10));
-
- // Fail completely if the fail count is too high.
- if (failCount >= 10)
- {
- throw new ClockSynchFailureException("Clock reference not responding.", null);
- }
-
- // Estimate delta as (ref clock + half-latency) - local clock.
- return (latency / 2) + (refTime - localTime);
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /// <summary>
- /// Gets the clock delta in nano seconds.
- /// </summary>
- /// <return> The clock delta in nano seconds. </return>
- public long getDelta()
- {
- return delta;
- }
-
- /// <summary>
- /// Gets an estimate of the clock error in nan seconds.
- /// </summary>
- /// <return> An estimate of the clock error in nan seconds. </return>
- public long getEpsilon()
- {
- return epsilon;
- }
-
- /// <summary>
- /// Gets the local clock time with any computed delta added in.
- /// </summary>
- /// <return> The local clock time with any computed delta added in. </return>
- public long nanoTime()
- {
- return System.nanoTime() + delta;
- }
-
- /// <summary>
- /// Computes the median of a series of values.
- /// </summary>
- /// <param name="values"> The values. </param>
- ///
- /// <return> The median. </return>
- public static long median(long[] values)
- {
- // log.debug("public static long median(long[] values = " + Arrays.ToString(values) + "): called");
-
- long median;
-
- // Order the list of values.
- long[] orderedValues = new long[values.length];
- System.arraycopy(values, 0, orderedValues, 0, values.length);
- Arrays.sort(orderedValues);
-
- // Check if the median is computed from a pair of middle value.
- if ((orderedValues.length % 2) == 0)
- {
- int middle = orderedValues.length / 2;
-
- median = (orderedValues[middle] + orderedValues[middle - 1]) / 2;
- }
- // The median is computed from a single middle value.
- else
- {
- median = orderedValues[orderedValues.length / 2];
- }
-
- // log.debug("median = " + median);
-
- return median;
- }
-
- /// <summary>
- /// Computes the mean of a series of values.
- /// </summary>
- /// <param name="values"> The values. </param>
- ///
- /// <return> The mean. </return>
- public static long mean(long[] values)
- {
- // log.debug("public static long mean(long[] values = " + Arrays.ToString(values) + "): called");
-
- long total = 0L;
-
- for (long value : values)
- {
- total += value;
- }
-
- long mean = total / values.length;
-
- // log.debug("mean = " + mean);
-
- return mean;
- }
-
- /// <summary>
- /// Computes the variance of series of values.
- /// </summary>
- /// <param name="values"> The values. </param>
- ///
- /// <return> The variance of the values. </return>
- public static long variance(long[] values)
- {
- // log.debug("public static long variance(long[] values = " + Arrays.ToString(values) + "): called");
-
- long mean = mean(values);
-
- long totalVariance = 0;
-
- for (long value : values)
- {
- long diff = (value - mean);
- totalVariance += diff/// diff;
- }
-
- long variance = totalVariance / values.length;
-
- // log.debug("variance = " + variance);
-
- return variance;
- }
-
- /// <summary>
- /// Computes the standard deviation of a series of values.
- /// </summary>
- /// <param name="values"> The values. </param>
- ///
- /// <return> The standard deviation. </return>
- public static long standardDeviation(long[] values)
- {
- // log.debug("public static long standardDeviation(long[] values = " + Arrays.ToString(values) + "): called");
-
- long sd = Double.valueOf(Math.sqrt(variance(values))).longValue();
-
- // log.debug("sd = " + sd);
-
- return sd;
- }
-
- /// <summary>
- /// For testing purposes. Supply address of reference clock as arg 1.
- /// </summary>
- /// <param name="args"> Address of reference clock as arg 1. </param>
- public static void main(String[] args)
- {
- ParsedProperties options =
- new ParsedProperties(CommandLineParser.processCommandLine(args,
- new CommandLineParser(
- new String[][]
- {
- { "1", "Address of clock reference service.", "address", "true" }
- }), System.getProperties()));
-
- string address = options.getProperty("1");
-
- // Create a clock synchronizer.
- UDPClockSynchronizer clockSyncher = new UDPClockSynchronizer(address);
-
- // Set up a shutdown hook for it.
- Runtime.getRuntime().addShutdownHook(new Thread(new Runnable()
- {
- public void run()
- {
- doSynch = false;
- }
- }));
-
- // Repeat the clock synching until the user kills the progam.
- while (doSynch)
- {
- // Perform a clock clockSynch.
- try
- {
- clockSyncher.synch();
-
- // Print out the clock delta and estimate of the error.
- System.out.println("Delta = " + clockSyncher.getDelta());
- System.out.println("Epsilon = " + clockSyncher.getEpsilon());
-
- try
- {
- Thread.sleep(250);
- }
- catch (InterruptedException e)
- {
- // Restore the interrupted status and terminate the loop.
- Thread.currentThread().interrupt();
- doSynch = false;
- }
- }
- // Terminate if the reference time service is unavailable.
- catch (ClockSynchFailureException e)
- {
- doSynch = false;
- }
- }
- }
- }
-}
-/*
- *
- * 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 log4net;
-
-using Apache.Qpid.Integration.Tests.framework.*;
-using org.apache.qpid.util.ConversationFactory;
-
-using uk.co.thebadgerset.junit.extensions.TimingController;
-using uk.co.thebadgerset.junit.extensions.TimingControllerAware;
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.Destination;
-using javax.jms.JMSException;
-using javax.jms.Message;
-using javax.jms.Session;
-
-using System.Collections.Generic.LinkedList;
-using System.Collections.Generic.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedcircuit
-{
- /// <summary>
- /// DistributedCircuitImpl is a distributed implementation of the test <see cref="Circuit"/>. Many publishers and receivers
- /// accross multiple machines may be combined to form a single test circuit. The test circuit extracts reports from
- /// all of its publishers and receivers, and applies its assertions to these reports.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Supply the publishing and receiving ends of a test messaging circuit.
- /// <tr><td> Start the circuit running.
- /// <tr><td> Close the circuit down.
- /// <tr><td> Take a reading of the circuits state.
- /// <tr><td> Apply assertions against the circuits state.
- /// <tr><td> Send test messages over the circuit.
- /// <tr><td> Perform the default test procedue on the circuit.
- /// </table>
- /// </summary>
- ///
- /// <remarks> There is a short pause after receiving sender reports before asking for receiver reports, because receivers may
- /// not have finished receiving all their test messages before the report request arrives. This is going to be a
- /// problem for taking test timings and needs to be eliminiated. Suggested solution: have receiver send back reports
- /// asynchronously, on test batch size boundaries, and do so automatically rather than having to have the report
- /// request sent to them. Number each test run, or otherwise uniquely identify it, when a receiver does not get
- /// any more messages on a test run for more than a timeout, it can assume the test is complete and send a final
- /// report. On the coordinator end a future will need to be created to wait for all final reports to come in, and
- /// to register results and timings for the test. This must work in such a way that a new test cycle can be started
- /// without waiting for the results of the old one to come in.</remarks>
- ///
- /// <remarks> Add in setting of timing controller, from timing aware test cases.</remarks>
- public class DistributedCircuitImpl : Circuit, TimingControllerAware
- {
- /// <summary> Used for debugging purposes. </summary>
- private static ILog log = LogManager.GetLogger(typeof(DistributedCircuitImpl));
-
- /// <summary> Holds the conversation factory over which to coordinate the test. </summary>
- protected ConversationFactory conversationFactory;
-
- /// <summary> Holds the controlSession over which to hold the control conversation. </summary>
- protected Session controlSession;
-
- /// <summary> Holds the sender nodes in the test circuit. </summary>
- protected IList<TestClientDetails> senders;
-
- /// <summary> Holds the receiver nodes in the test circuit. </summary>
- protected IList<TestClientDetails> receivers;
-
- /// <summary> Holds the sender control conversations. </summary>
- protected ConversationFactory.Conversation[] senderConversation;
-
- /// <summary> Holds the receiver control conversations. </summary>
- protected ConversationFactory.Conversation[] receiverConversation;
-
- /// <summary> Holds the control topics for the senders in the test circuit. </summary>
- protected Destination[] senderControlTopic;
-
- /// <summary> Holds the control topics for the receivers in the test circuit. </summary>
- protected Destination[] receiverControlTopic;
-
- /// <summary> Holds the number of messages to send per test run. </summary>
- protected int numMessages;
-
- /// <summary>
- /// Holds the timing controller for the circuit. This is used to log test times asynchronously, when reciever nodes
- /// return their reports after senders have completed a test case.
- TimingController timingController;
-
- /// <summary>
- /// Creates a distributed test circuit on the specified senders and receivers.
- /// </summary>
- /// <param name="session"> The controlSession for all control conversations. </param>
- /// <param name="senders"> The senders. </param>
- /// <param name="receivers"> The receivers. </param>
- /// <param name="senderConversation"> A control conversation with the senders. </param>
- /// <param name="receiverConversation"> A control conversation with the receivers. </param>
- /// <param name="senderControlTopic"> The senders control topic. </param>
- /// <param name="receiverControlTopic"> The receivers control topic. </param>
- protected DistributedCircuitImpl(Session session, IList<TestClientDetails> senders, List<TestClientDetails> receivers,
- ConversationFactory.Conversation[] senderConversation, ConversationFactory.Conversation[] receiverConversation,
- Destination[] senderControlTopic, Destination[] receiverControlTopic)
- {
- this.controlSession = session;
- this.senders = senders;
- this.receivers = receivers;
- this.senderConversation = senderConversation;
- this.receiverConversation = receiverConversation;
- this.senderControlTopic = senderControlTopic;
- this.receiverControlTopic = receiverControlTopic;
- }
-
- /// <summary>
- /// Creates a distributed test circuit from the specified test parameters, on the senders and receivers
- /// given.
- /// </summary>
- /// <param name="testProps"> The test parameters. </param>
- /// <param name="senders"> The sender ends in the test circuit. </param>
- /// <param name="receivers"> The receiver ends in the test circuit. </param>
- /// <param name="conversationFactory"> A conversation factory for creating the control conversations with senders and receivers. </param>
- ///
- /// <return> A connected and ready to start, test circuit. </return>
- public static Circuit createCircuit(ParsedProperties testProps, IList<TestClientDetails> senders,
- IList<TestClientDetails> receivers, ConversationFactory conversationFactory)
- {
- log.debug("public static Circuit createCircuit(ParsedProperties testProps, IList<TestClientDetails> senders, "
- + " IList<TestClientDetails> receivers, ConversationFactory conversationFactory)");
-
- try
- {
- Session session = conversationFactory.getSession();
-
- // Create control conversations with each of the senders.
- ConversationFactory.Conversation[] senderConversation = new ConversationFactory.Conversation[senders.size()];
- Destination[] senderControlTopic = new Destination[senders.size()];
-
- for (int i = 0; i < senders.size(); i++)
- {
- TestClientDetails sender = senders.get(i);
-
- senderControlTopic[i] = session.createTopic(sender.privateControlKey);
- senderConversation[i] = conversationFactory.startConversation();
- }
-
- log.debug("Sender conversations created.");
-
- // Create control conversations with each of the receivers.
- ConversationFactory.Conversation[] receiverConversation = new ConversationFactory.Conversation[receivers.size()];
- Destination[] receiverControlTopic = new Destination[receivers.size()];
-
- for (int i = 0; i < receivers.size(); i++)
- {
- TestClientDetails receiver = receivers.get(i);
-
- receiverControlTopic[i] = session.createTopic(receiver.privateControlKey);
- receiverConversation[i] = conversationFactory.startConversation();
- }
-
- log.debug("Receiver conversations created.");
-
- // Assign the sender role to each of the sending test clients.
- for (int i = 0; i < senders.size(); i++)
- {
- TestClientDetails sender = senders.get(i);
-
- Message assignSender = conversationFactory.getSession().createMessage();
- TestUtils.setPropertiesOnMessage(assignSender, testProps);
- assignSender.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignSender.setStringProperty("ROLE", "SENDER");
-
- senderConversation[i].send(senderControlTopic[i], assignSender);
- }
-
- log.debug("Sender role assignments sent.");
-
- // Assign the receivers role to each of the receiving test clients.
- for (int i = 0; i < receivers.size(); i++)
- {
- TestClientDetails receiver = receivers.get(i);
-
- Message assignReceiver = session.createMessage();
- TestUtils.setPropertiesOnMessage(assignReceiver, testProps);
- assignReceiver.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignReceiver.setStringProperty("ROLE", "RECEIVER");
-
- receiverConversation[i].send(receiverControlTopic[i], assignReceiver);
- }
-
- log.debug("Receiver role assignments sent.");
-
- // Wait for the senders and receivers to confirm their roles.
- for (int i = 0; i < senders.size(); i++)
- {
- senderConversation[i].receive();
- }
-
- log.debug("Got all sender role confirmations");
-
- for (int i = 0; i < receivers.size(); i++)
- {
- receiverConversation[i].receive();
- }
-
- log.debug("Got all receiver role confirmations");
-
- // Package everything up as a circuit.
- return new DistributedCircuitImpl(session, senders, receivers, senderConversation, receiverConversation,
- senderControlTopic, receiverControlTopic);
- }
- catch (JMSException e)
- {
- throw new RuntimeException("JMSException not handled.");
- }
- }
-
- /// <summary>
- /// Used by tests cases that can supply a <see cref="uk.co.thebadgerset.junit.extensions.TimingController"/> to set the
- /// controller on an aware test.
- /// </summary>
- /// <param name="controller"> The timing controller. </param>
- public void setTimingController(TimingController controller)
- {
- this.timingController = controller;
- }
-
- /// <summary>
- /// Gets the interface on the publishing end of the circuit.
- /// </summary>
- /// <return> The publishing end of the circuit. </return>
- public Publisher getPublisher()
- {
- throw new RuntimeException("Not Implemented.");
- }
-
- /// <summary>
- /// Gets the interface on the receiving end of the circuit.
- /// </summary>
- /// <return> The receiving end of the circuit. </return>
- public Receiver getReceiver()
- {
- throw new RuntimeException("Not Implemented.");
- }
-
- /// <summary>
- /// Connects and starts the circuit. After this method is called the circuit is ready to send messages.
- public void start()
- {
- log.debug("public void start(): called");
-
- try
- {
- // Start the test on each of the senders.
- Message start = controlSession.createMessage();
- start.setStringProperty("CONTROL_TYPE", "START");
- start.setIntProperty("MESSAGE_COUNT", numMessages);
-
- for (int i = 0; i < senders.size(); i++)
- {
- senderConversation[i].send(senderControlTopic[i], start);
- }
-
- log.debug("All senders told to start their tests.");
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Unhandled JMSException.", e);
- }
- }
-
- /// <summary>
- /// Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit,
- /// into a report, against which assertions may be checked.
- /// </summary>
- /// <remarks> Replace the asynch receiver report thread with a choice of direct or asynch executor, so that asynch
- /// or synch logging of test timings is optional. Also need to provide an onMessage method that is capable
- /// of receiving timing reports that receivers will generate during an ongoing test, on the test sample
- /// size boundaries. The message timing logging code should be factored out as a common method that can
- /// be called in response to the final report responses, or the onMessage method. Another alternative is
- /// to abandon the final report request altogether and just use the onMessage method? I think the two
- /// differ though, as the final report is used to apply assertions, and the ongoing report is just for
- /// periodic timing results... In which case, maybe there needs to be a way for the onMessage method
- /// to process just some of the incoming messages, and forward the rest on to the conversion helper, as
- /// a sort of pre-conversation helper filter? Make conversation expose its onMessage method (it should
- /// already) and allow another delivery thread to filter the incoming messages to the conversation.</remarks>
- public void check()
- {
- log.debug("public void check(): called");
-
- try
- {
- // Wait for all the test senders to return their reports.
- for (int i = 0; i < senders.size(); i++)
- {
- Message senderReport = senderConversation[i].receive();
- log.debug("Sender " + senderReport.getStringProperty("CLIENT_NAME") + " reports message count: "
- + senderReport.getIntProperty("MESSAGE_COUNT"));
- log.debug("Sender " + senderReport.getStringProperty("CLIENT_NAME") + " reports message time: "
- + senderReport.getLongProperty("TEST_TIME"));
- }
-
- log.debug("Got all sender test reports.");
-
- // Apply sender assertions to pass/fail the tests.
-
- // Inject a short pause to give the receivers time to finish receiving their test messages.
- TestUtils.pause(500);
-
- // Ask the receivers for their reports.
- Message statusRequest = controlSession.createMessage();
- statusRequest.setStringProperty("CONTROL_TYPE", "STATUS_REQUEST");
-
- for (int i = 0; i < receivers.size(); i++)
- {
- receiverConversation[i].send(receiverControlTopic[i], statusRequest);
- }
-
- log.debug("All receiver test reports requested.");
-
- // Wait for all receiver reports to come in, but do so asynchronously.
- Runnable gatherAllReceiverReports =
- new Runnable()
- {
- public void run()
- {
- try
- {
- // Wait for all the receivers to send their reports.
- for (int i = 0; i < receivers.size(); i++)
- {
- Message receiverReport = receiverConversation[i].receive();
-
- string clientName = receiverReport.getStringProperty("CLIENT_NAME");
- int messageCount = receiverReport.getIntProperty("MESSAGE_COUNT");
- long testTime = receiverReport.getLongProperty("TEST_TIME");
-
- log.debug("Receiver " + clientName + " reports message count: " + messageCount);
- log.debug("Receiver " + receiverReport.getStringProperty("CLIENT_NAME")
- + " reports message time: " + testTime);
-
- // Apply receiver assertions to pass/fail the tests.
-
- // Log the test timings on the asynchronous test timing controller.
- /*try
- {
- timingController.completeTest(true, messageCount, testTime);
- }
- // The timing controll can throw InterruptedException is the current test is to be
- // interrupted.
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }*/
- }
-
- log.debug("All receiver test reports received.");
- }
- catch (JMSException e)
- {
- throw new RuntimeException(e);
- }
- }
- };
-
- Thread receiverReportsThread = new Thread(gatherAllReceiverReports);
- receiverReportsThread.start();
-
- // return new Message[] { senderReport, receiverReport };
-
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Unhandled JMSException.", e);
- }
- }
-
- /// <summary> Closes the circuit. All associated resources are closed. </summary>
- public void close()
- {
- log.debug("public void close(): called");
-
- // End the current test on all senders and receivers.
- }
-
- /// <summary>
- /// Applies a list of assertions against the test circuit. The <see cref="#check()"/> method should be called before doing
- /// this, to ensure that the circuit has gathered its state into a report to assert against.
- /// </summary>
- /// <param name="assertions"> The list of assertions to apply. </param>
- ///
- /// <return> Any assertions that failed. </return>
- public IList<Assertion> applyAssertions(List<Assertion> assertions)
- {
- log.debug("public IList<Assertion> applyAssertions(List<Assertion> assertions = " + assertions + "): called");
-
- IList<Assertion> failures = new LinkedList<Assertion>();
-
- for (Assertion assertion : assertions)
- {
- if (!assertion.apply())
- {
- failures.add(assertion);
- }
- }
-
- return failures;
- }
-
- /// <summary>
- /// Runs the default test procedure against the circuit, and checks that all of the specified assertions hold.
- /// </summary>
- /// <param name="numMessages"> The number of messages to send using the default test procedure. </param>
- /// <param name="assertions"> The list of assertions to apply. </param>
- ///
- /// <return> Any assertions that failed. </return>
- ///
- /// <remarks> From check onwards needs to be handled as a future. The future must call back onto the test case to
- /// report results asynchronously.</remarks>
- public IList<Assertion> test(int numMessages, List<Assertion> assertions)
- {
- log.debug("public IList<Assertion> test(int numMessages = " + numMessages + ", List<Assertion> assertions = "
- + assertions + "): called");
-
- // Keep the number of messages to send per test run, where the send method can reference it.
- this.numMessages = numMessages;
-
- // Start the test running on all sender circuit ends.
- start();
-
- // Request status reports to be handed in.
- check();
-
- // Assert conditions on the publishing end of the circuit.
- // Assert conditions on the receiving end of the circuit.
- IList<Assertion> failures = applyAssertions(assertions);
-
- // Close the circuit ending the current test case.
- close();
-
- // Pass with no failed assertions or fail with a list of failed assertions.
- return failures;
- }
- }
-}
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-using Apache.Qpid.Integration.Tests.framework.Assertion;
-using Apache.Qpid.Integration.Tests.framework.Publisher;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedcircuit
-{
- /// <summary>
- /// DistributedPublisherImpl represents the status of the publishing side of a test circuit. Its main purpose is to
- /// provide assertions that can be applied to verify the behaviour of a non-local publisher.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide assertion that the publishers received no exceptions.
- /// <tr><td> Provide assertion that the publishers received a no consumers error code on every message.
- /// <tr><td> Provide assertion that the publishers received a no route error code on every message.
- /// </table>
- /// </summary>
- public class DistributedPublisherImpl : Publisher
- {
- /// <summary>
- /// Provides an assertion that the publisher encountered no exceptions.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <return> An assertion that the publisher encountered no exceptions. </return>
- public Assertion noExceptionsAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Provides an assertion that the publisher got a no consumers exception on every message.
- /// </summary>
- /// <return> An assertion that the publisher got a no consumers exception on every message. </return>
- public Assertion noConsumersAssertion()
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Provides an assertion that the publisher got a no rout exception on every message.
- /// </summary>
- /// <return> An assertion that the publisher got a no rout exception on every message. </return>
- public Assertion noRouteAssertion()
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- public Assertion channelClosedAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Provides an assertion that the publisher got a given exception during the test.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. </param>
- /// <return> An assertion that the publisher got a given exception during the test. </return>
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass)
- {
- throw new RuntimeException("Not implemented.");
- }
- }
-}
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-using Apache.Qpid.Integration.Tests.framework.Assertion;
-using Apache.Qpid.Integration.Tests.framework.Receiver;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedcircuit
-{
- /// <summary>
- /// DistributedReceiverImpl represents the status of the receiving side of a test circuit. Its main purpose is to
- /// provide assertions that can be applied to verify the behaviour of a non-local receiver.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide assertion that the receivers received no exceptions.
- /// <tr><td> Provide assertion that the receivers received all test messages sent to it.
- /// </table>
- /// </summary>
- public class DistributedReceiverImpl : Receiver
- {
- /// <summary>
- /// Provides an assertion that the receivers encountered no exceptions.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <return> An assertion that the receivers encountered no exceptions. </return>
- public Assertion noExceptionsAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Provides an assertion that the receivers got all messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <return> An assertion that the receivers got all messages that were sent to it. </return>
- public Assertion allMessagesReceivedAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Provides an assertion that the receivers got none of the messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <return> An assertion that the receivers got none of the messages that were sent to it. </return>
- public Assertion noMessagesReceivedAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- public Assertion channelClosedAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Provides an assertion that the receiver got a given exception during the test.
- ///
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. <return> An assertion that the receiver got a given exception during the test. </return> </param>
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass)
- {
- throw new RuntimeException("Not implemented.");
- }
- }
-}
-/*
- *
- * 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 log4net;
-
-using Apache.Qpid.Integration.Tests.framework.*;
-using Apache.Qpid.Integration.Tests.framework.distributedtesting.TestClientControlledTest;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-using uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
-
-using javax.jms.*;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedcircuit
-{
- /// <summary>
- /// A TestClientCircuitEnd is a <see cref="CircuitEnd"/> that may be controlled from a
- /// <see cref="Apache.Qpid.Integration.Tests.framework.distributedtesting.TestClient"/>, and that forms a single publishing or
- /// receiving end point in a distributed test <see cref="Apache.Qpid.Integration.Tests.framework.Circuit"/>.
- ///
- /// <p/>When operating in the SENDER role, this circuit end is capable of acting as part of the default circuit test
- /// procedure (described in the class comment for <see cref="Apache.Qpid.Integration.Tests.framework.Circuit"/>). That is, it will
- /// send the number of test messages required, using the test configuration parameters given in the test invite, and
- /// return a report on its activities to the circuit controller.
- ///
- /// <p/>When operation in the RECEIVER role, this circuit end acts as part of the default circuit test procedure. It will
- /// receive test messages, on the setup specified in the test configuration parameters, and keep count of the messages
- /// received, and time taken to receive them. When requested by the circuit controller to provide a report, it will
- /// return this report of its activities.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide a message producer for sending messages.
- /// <td> <see cref="CircuitEnd"/>, <see cref="LocalCircuitFactory"/>, <see cref="TestUtils"/>
- /// <tr><td> Provide a message consumer for receiving messages.
- /// <td> <see cref="CircuitEnd"/>, <see cref="LocalCircuitFactory"/>, <see cref="TestUtils"/>
- /// <tr><td> Supply the name of the test case that this implements.
- /// <tr><td> Accept/Reject invites based on test parameters. <td> <see cref="MessagingTestConfigProperties"/>
- /// <tr><td> Adapt to assigned roles. <td> <see cref="TestClientControlledTest.Roles"/>
- /// <tr><td> Perform test case actions. <td> <see cref="MessageMonitor"/>
- /// <tr><td> Generate test reports. <td> <see cref="MessageMonitor"/>
- /// </table>
- /// </summary>
- public class TestClientCircuitEnd : CircuitEnd, TestClientControlledTest
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(TestClientCircuitEnd));
-
- /// <summary> Holds the test parameters. </summary>
- ParsedProperties testProps;
-
- /// <summary> The number of test messages to send. </summary>
- private int numMessages;
-
- /// <summary> The role to be played by the test. </summary>
- private Roles role;
-
- /// <summary> The connection to send the test messages on. </summary>
- private Connection connection;
-
- /// <summary> Holds the circuit end for this test. </summary>
- CircuitEnd circuitEnd;
-
- /// <summary>
- /// Holds a message monitor for this circuit end, either the monitor on the consumer when in RECEIVER more, or
- /// a monitor updated on every message sent, when acting as a SENDER.
- MessageMonitor messageMonitor;
-
- /// <summary>
- /// Should provide the name of the test case that this class implements. The exact names are defined in the
- /// interop testing spec.
- /// </summary>
- /// <return> The name of the test case that this implements. </return>
- public string getName()
- {
- return "DEFAULT_CIRCUIT_TEST";
- }
-
- /// <summary>
- /// Determines whether the test invite that matched this test case is acceptable.
- /// </summary>
- /// <param name="inviteMessage"> The invitation to accept or reject. </param>
- /// <return> <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it. </return>
- /// </summary>
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- public bool acceptInvite(Message inviteMessage) throws JMSException
- {
- log.debug("public bool acceptInvite(Message inviteMessage): called");
-
- // Populate the test parameters from the invitation.
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- for (Object key : testProps.keySet())
- {
- string propName = (String) key;
-
- // If the test parameters is overridden by the invitation, use it instead.
- string inviteValue = inviteMessage.getStringProperty(propName);
-
- if (inviteValue != null)
- {
- testProps.setProperty(propName, inviteValue);
- log.debug("Test invite supplied override to " + propName + " of " + inviteValue);
- }
-
- }
-
- // Accept the invitation.
- return true;
- }
-
- /// <summary>
- /// Assigns the role to be played by this test case. The test parameters are fully specified in the
- /// assignment message. When this method return the test case will be ready to execute.
- /// </summary>
- /// <param name="role"> The role to be played; sender or receivers. </param>
- /// <param name="assignRoleMessage"> The role assingment message, contains the full test parameters. </param>
- ///
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
- {
- log.debug("public void assignRole(Roles role, Message assignRoleMessage): called");
-
- // Take note of the role to be played.
- this.role = role;
-
- // Extract and retain the test parameters.
- numMessages = 1; // assignRoleMessage.getIntProperty("NUM_MESSAGES");
-
- // Connect using the test parameters.
- connection = TestUtils.createConnection(testProps);
-
- // Create a circuit end that matches the assigned role and test parameters.
- LocalCircuitFactory circuitFactory = new LocalCircuitFactory();
-
- switch (role)
- {
- // Check if the sender role is being assigned, and set up a message producer if so.
- case SENDER:
-
- // Set up the publisher.
- circuitEnd = circuitFactory.createPublisherCircuitEnd(connection, testProps, 0L);
-
- // Create a custom message monitor that will be updated on every message sent.
- messageMonitor = new MessageMonitor();
-
- break;
-
- // Otherwise the receivers role is being assigned, so set this up to listen for messages.
- case RECEIVER:
-
- // Set up the receiver.
- circuitEnd = circuitFactory.createReceiverCircuitEnd(connection, testProps, 0L);
-
- // Use the message monitor from the consumer for stats.
- messageMonitor = getMessageMonitor();
-
- break;
- }
-
- // Reset all messaging stats for the report.
- messageMonitor.reset();
-
- connection.start();
- }
-
- /// <summary>
- /// Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
- /// </summary>
- /// <param name="numMessages"> The number of test messages to send. </param>
- ///
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- ///
- /// <remarks> Add round robin on destinations where multiple destinations being used.</remarks>
- ///
- /// <remarks> Add rate limiting when rate limit specified on publishers.</remarks>
- ///
- /// <remarks> Add Max pending message size protection. The receiver will have to send back some acks once in a while,
- /// to notify the publisher that its messages are being consumed. This makes the safety valve harder to
- /// implement than in the single VM case. For example, if the limit is 1000 messages, might want to get back
- /// an ack every 500, to notify the publisher that it can keep sending. What about pub/sub tests? Will it be
- /// necessary to wait for an ack from every receiver? This will have the effect of rate limiting to slow
- /// consumers too.</remarks>
- ///
- /// <remarks> Add commits on every commit batch size boundary.</remarks>
- public void start(int numMessages) throws JMSException
- {
- log.debug("public void start(): called");
-
- // If in the SENDER role, send the specified number of test messages to the circuit destinations.
- if (role.equals(Roles.SENDER))
- {
- Message testMessage = getSession().createMessage();
-
- for (int i = 0; i < numMessages; i++)
- {
- getProducer().send(testMessage);
-
- // Increment the message count and timings.
- messageMonitor.onMessage(testMessage);
- }
- }
- }
-
- /// <summary>
- /// Gets a report on the actions performed by the test case in its assigned role.
- /// </summary>
- /// <param name="session"> The controlSession to create the report message in. </param>
- /// <return> The report message. </return>
- ///
- /// <exception cref="JMSException"> Any JMSExceptions resulting from creating the report are allowed to fall through. </exception>
- public Message getReport(Session session) throws JMSException
- {
- Message report = session.createMessage();
- report.setStringProperty("CONTROL_TYPE", "REPORT");
-
- // Add the count of messages sent/received to the report.
- report.setIntProperty("MESSAGE_COUNT", messageMonitor.getNumMessage());
-
- // Add the time to send/receive messages to the report.
- report.setLongProperty("TEST_TIME", messageMonitor.getTime());
-
- // Add any exceptions detected to the report.
-
- return report;
- }
-
- /// <summary>
- /// Gets the message producer at this circuit end point.
- /// </summary>
- /// <return> The message producer at with this circuit end point. </return>
- public MessageProducer getProducer()
- {
- return circuitEnd.getProducer();
- }
-
- /// <summary>
- /// Gets the message consumer at this circuit end point.
- /// </summary>
- /// <return> The message consumer at this circuit end point. </return>
- public MessageConsumer getConsumer()
- {
- return circuitEnd.getConsumer();
- }
-
- /// <summary>
- /// Send the specified message over the producer at this end point.
- /// </summary>
- /// <param name="message"> The message to send. </param>
- ///
- /// <exception cref="JMSException"> Any JMS exception occuring during the send is allowed to fall through. </exception>
- public void send(Message message) throws JMSException
- {
- // Send the message on the circuit ends producer.
- circuitEnd.send(message);
- }
-
- /// <summary>
- /// Gets the JMS Session associated with this circuit end point.
- /// </summary>
- /// <return> The JMS Session associated with this circuit end point. </return>
- public Session getSession()
- {
- return circuitEnd.getSession();
- }
-
- /// <summary>
- /// Closes the message producers and consumers and the sessions, associated with this circuit end point.
- ///
- /// <exception cref="JMSException"> Any JMSExceptions occurring during the close are allowed to fall through. </exception>
- public void close() throws JMSException
- {
- // Close the producer and consumer.
- circuitEnd.close();
- }
-
- /// <summary>
- /// Returns the message monitor for reporting on received messages on this circuit end.
- /// </summary>
- /// <return> The message monitor for this circuit end. </return>
- public MessageMonitor getMessageMonitor()
- {
- return circuitEnd.getMessageMonitor();
- }
-
- /// <summary>
- /// Returns the exception monitor for reporting on exceptions received on this circuit end.
- /// </summary>
- /// <return> The exception monitor for this circuit end. </return>
- public ExceptionMonitor getExceptionMonitor()
- {
- return circuitEnd.getExceptionMonitor();
- }
- }
-}
-/*
- *
- * 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 junit.framework.Test;
-using junit.framework.TestResult;
-using junit.framework.TestSuite;
-
-using log4net;
-using org.apache.log4j.NDC;
-
-using Apache.Qpid.Integration.Tests.framework.FrameworkBaseCase;
-using Apache.Qpid.Integration.Tests.framework.MessagingTestConfigProperties;
-using Apache.Qpid.Integration.Tests.framework.TestClientDetails;
-using Apache.Qpid.Integration.Tests.framework.TestUtils;
-using Apache.Qpid.Integration.Tests.framework.clocksynch.UDPClockReference;
-using org.apache.qpid.util.ConversationFactory;
-
-using uk.co.thebadgerset.junit.extensions.TKTestRunner;
-using uk.co.thebadgerset.junit.extensions.WrappedSuiteTestDecorator;
-using uk.co.thebadgerset.junit.extensions.util.CommandLineParser;
-using uk.co.thebadgerset.junit.extensions.util.MathUtils;
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-using uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
-
-using javax.jms.*;
-
-using java.net.InetAddress;
-using java.util.*;
-using java.util.concurrent.LinkedBlockingQueue;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedtesting
-{
- /// <summary>
- /// <p/>Implements the coordinator client described in the interop testing specification
- /// (http://cwiki.apache.org/confluence/display/qpid/Interop+Testing+Specification). This coordinator is built on
- /// top of the JUnit testing framework.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Find out what test clients are available. <td> <see cref="ConversationFactory"/>
- /// <tr><td> Decorate available tests to run on all available clients. <td> <see cref="DistributedTestDecorator"/>
- /// <tr><td> Attach XML test result logger.
- /// <tr><td> Terminate the interop testing framework.
- /// </table>
- /// </summary>
- ///
- /// <remarks> Should accumulate failures over all tests, and return with success or fail code based on all results. May need
- /// to write a special TestResult to do this properly. At the moment only the last one used will be tested for
- /// errors, as the start method creates a fresh one for each test case run.</remarks>
- public class Coordinator extends TKTestRunner
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(Coordinator));
-
- /// <summary> Used for reporting to the console. </summary>
- private static ILog console = LogManager.GetLogger("CONSOLE");
-
- /// <summary> Defines the possible distributed test engines available to run coordinated test cases with. </summary>
- public enum TestEngine
- {
- /// <summary> Specifies the interop test engine. This tests all available clients in pairs. </summary>
- INTEROP,
-
- /// <summary> Specifies the fanout test engine. This sets up one publisher role, and many reciever roles. </summary>
- FANOUT
- }
-
- /// <summary>
- /// Holds the test context properties that provides the default test parameters, plus command line overrides.
- /// This is initialized with the default test parameters, to which command line overrides may be applied.
- protected static ParsedProperties testContextProperties =
- TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- /// <summary> Holds the URL of the broker to coordinate the tests on. </summary>
- protected string brokerUrl;
-
- /// <summary> Holds the virtual host to coordinate the tests on. If <tt>null</tt>, then the default virtual host is used. </summary>
- protected string virtualHost;
-
- /// <summary> Holds the list of all clients that enlisted, when the compulsory invite was issued. </summary>
- protected Set<TestClientDetails> enlistedClients = new HashSet<TestClientDetails>();
-
- /// <summary> Holds the conversation helper for the control conversation. </summary>
- protected ConversationFactory conversationFactory;
-
- /// <summary> Holds the connection that the coordinating messages are sent over. </summary>
- protected Connection connection;
-
- /// <summary> Holds the path of the directory to output test results too, if one is defined. </summary>
- protected string reportDir;
-
- /// <summary> Holds the coordinating test engine type to run the tests through. </summary>
- protected TestEngine engine;
-
- /// <summary> Flag that indicates that all test clients should be terminated upon completion of the test cases. </summary>
- protected bool terminate;
-
- /// <summary>
- /// Creates an interop test coordinator on the specified broker and virtual host.
- /// </summary>
- /// <param name="repetitions"> The number of times to repeat the test, or test batch size. </param>
- /// <param name="duration"> The length of time to run the tests for. -1 means no duration has been set. </param>
- /// <param name="threads"> The concurrency levels to ramp up to. </param>
- /// <param name="delay"> A delay in milliseconds between test runs. </param>
- /// <param name="params"> The sets of 'size' parameters to pass to test. </param>
- /// <param name="testCaseName"> The name of the test case to run. </param>
- /// <param name="reportDir"> The directory to output the test results to. </param>
- /// <param name="runName"> The name of the test run; used to name the output file. </param>
- /// <param name="verbose"> Whether to print comments during test run. </param>
- /// <param name="brokerUrl"> The URL of the broker to connect to. </param>
- /// <param name="virtualHost"> The virtual host to run all tests on. Optional, may be <tt>null</tt>. </param>
- /// <param name="engine"> The distributed test engine type to run the tests with. </param>
- /// <param name="terminate"> <tt>true</tt> if test client nodes should be terminated at the end of the tests. </param>
- /// <param name="csv"> <tt>true</tt> if the CSV results listener should be attached. </param>
- /// <param name="xml"> <tt>true</tt> if the XML results listener should be attached. </param>
- /// <param name="decoratorFactories"> List of factories for user specified decorators. </param>
- public Coordinator(Integer repetitions, Long duration, int[] threads, int delay, int[] params, string testCaseName,
- string reportDir, string runName, bool verbose, string brokerUrl, string virtualHost, TestEngine engine,
- bool terminate, bool csv, bool xml, IList<TestDecoratorFactory> decoratorFactories)
- {
- super(repetitions, duration, threads, delay, params, testCaseName, reportDir, runName, csv, xml, verbose,
- decoratorFactories);
-
- log.debug("public Coordinator(Integer repetitions = " + repetitions + " , Long duration = " + duration
- + ", int[] threads = " + Arrays.ToString(threads) + ", int delay = " + delay + ", int[] params = "
- + Arrays.ToString(params) + ", string testCaseName = " + testCaseName + ", string reportDir = " + reportDir
- + ", string runName = " + runName + ", bool verbose = " + verbose + ", string brokerUrl = " + brokerUrl
- + ", string virtualHost =" + virtualHost + ", TestEngine engine = " + engine + ", bool terminate = "
- + terminate + ", bool csv = " + csv + ", bool xml = " + xml + "): called");
-
- // Retain the connection parameters.
- this.brokerUrl = brokerUrl;
- this.virtualHost = virtualHost;
- this.reportDir = reportDir;
- this.engine = engine;
- this.terminate = terminate;
- }
-
- /// <summary>
- /// The entry point for the interop test coordinator. This client accepts the following command line arguments:
- ///
- /// <p/><table>
- /// <tr><td> -b <td> The broker URL. <td> Mandatory.
- /// <tr><td> -h <td> The virtual host. <td> Optional.
- /// <tr><td> -o <td> The directory to output test results to. <td> Optional.
- /// <tr><td> -e <td> The type of test distribution engine to use. <td> Optional. One of: interop, fanout.
- /// <tr><td> ... <td> Free arguments. The distributed test cases to run.
- /// <td> Mandatory. At least one must be defined.
- /// <tr><td> name=value <td> Trailing argument define name/value pairs. Added to the test contenxt properties.
- /// <td> Optional.
- /// </table>
- /// </summary>
- /// <param name="args"> The command line arguments. </param>
- public static void main(String[] args)
- {
- NDC.push("coordinator");
- log.debug("public static void main(String[] args = " + Arrays.ToString(args) + "): called");
- console.info("Qpid Distributed Test Coordinator.");
-
- // Override the default broker url to be localhost:5672.
- testContextProperties.setProperty(MessagingTestConfigProperties.BROKER_PROPNAME, "tcp://localhost:5672");
-
- try
- {
- // Use the command line parser to evaluate the command line with standard handling behaviour (print errors
- // and usage then exist if there are errors).
- // Any options and trailing name=value pairs are also injected into the test context properties object,
- // to override any defaults that may have been set up.
- ParsedProperties options =
- new ParsedProperties(CommandLineParser.processCommandLine(args,
- new CommandLineParser(
- new String[][]
- {
- { "b", "The broker URL.", "broker", "false" },
- { "h", "The virtual host to use.", "virtual host", "false" },
- { "o", "The name of the directory to output test timings to.", "dir", "false" },
- {
- "e", "The test execution engine to use. Default is interop.", "engine", "interop",
- "^interop$|^fanout$", "true"
- },
- { "t", "Terminate test clients on completion of tests.", null, "false" },
- { "-csv", "Output test results in CSV format.", null, "false" },
- { "-xml", "Output test results in XML format.", null, "false" },
- {
- "-trefaddr", "To specify an alternative to hostname for time singal reference.",
- "address", "false"
- },
- {
- "c", "The number of tests to run concurrently.", "num", "false",
- MathUtils.SEQUENCE_REGEXP
- },
- { "r", "The number of times to repeat each test.", "num", "false" },
- {
- "d", "The length of time to run the tests for.", "duration", "false",
- MathUtils.DURATION_REGEXP
- },
- {
- "f", "The maximum rate to call the tests at.", "frequency", "false",
- "^([1-9][0-9]*)/([1-9][0-9]*)$"
- },
- { "s", "The size parameter to run tests with.", "size", "false", MathUtils.SEQUENCE_REGEXP },
- { "v", "Verbose mode.", null, "false" },
- { "n", "A name for this test run, used to name the output file.", "name", "true" },
- {
- "X:decorators", "A list of additional test decorators to wrap the tests in.",
- "\"class.name[:class.name]*\"", "false"
- }
- }), testContextProperties));
-
- // Extract the command line options.
- string brokerUrl = options.getProperty("b");
- string virtualHost = options.getProperty("h");
- string reportDir = options.getProperty("o");
- reportDir = (reportDir == null) ? "." : reportDir;
- string testEngine = options.getProperty("e");
- TestEngine engine = "fanout".equals(testEngine) ? TestEngine.FANOUT : TestEngine.INTEROP;
- bool terminate = options.getPropertyAsBoolean("t");
- bool csvResults = options.getPropertyAsBoolean("-csv");
- bool xmlResults = options.getPropertyAsBoolean("-xml");
- string threadsstring = options.getProperty("c");
- Integer repetitions = options.getPropertyAsInteger("r");
- string durationstring = options.getProperty("d");
- string paramsstring = options.getProperty("s");
- bool verbose = options.getPropertyAsBoolean("v");
- string testRunName = options.getProperty("n");
- string decorators = options.getProperty("X:decorators");
-
- int[] threads = (threadsstring == null) ? null : MathUtils.parseSequence(threadsString);
- int[] params = (paramsstring == null) ? null : MathUtils.parseSequence(paramsString);
- Long duration = (durationstring == null) ? null : MathUtils.parseDuration(durationString);
-
- // If broker or virtual host settings were specified as command line options, override the defaults in the
- // test context properties with them.
-
- // Collection all of the test cases to be run.
- Collection<Class<? extends FrameworkBaseCase>> testCaseClasses =
- new ArrayList<Class<? extends FrameworkBaseCase>>();
-
- // Create a list of test decorator factories for use specified decorators to be applied.
- IList<TestDecoratorFactory> decoratorFactories = parseDecorators(decorators);
-
- // Scan for available test cases using a classpath scanner.
- // ClasspathScanner.getMatches(DistributedTestCase.class, "^Test.*", true);
-
- // Hard code the test classes till the classpath scanner is fixed.
- // Collections.addAll(testCaseClasses, InteropTestCase1DummyRun.class, InteropTestCase2BasicP2P.class,
- // InteropTestCase3BasicPubSub.class);
-
- // Parse all of the free arguments as test cases to run.
- for (int i = 1; true; i++)
- {
- string nextFreeArg = options.getProperty(Integer.ToString(i));
-
- // Terminate the loop once all free arguments have been consumed.
- if (nextFreeArg == null)
- {
- break;
- }
-
- try
- {
- Class nextClass = Class.forName(nextFreeArg);
-
- if (FrameworkBaseCase.class.isAssignableFrom(nextClass))
- {
- testCaseClasses.add(nextClass);
- console.info("Found distributed test case: " + nextFreeArg);
- }
- }
- catch (ClassNotFoundException e)
- {
- console.info("Unable to instantiate the test case: " + nextFreeArg + ".");
- }
- }
-
- // Check that some test classes were actually found.
- if (testCaseClasses.isEmpty())
- {
- throw new RuntimeException(
- "No test cases implementing FrameworkBaseCase were specified on the command line.");
- }
-
- // Extract the names of all the test classes, to pass to the start method.
- int i = 0;
- String[] testClassNames = new String[testCaseClasses.size()];
-
- for (Class testClass : testCaseClasses)
- {
- testClassNames[i++] = testClass.getName();
- }
-
- // Create a coordinator and begin its test procedure.
- Coordinator coordinator =
- new Coordinator(repetitions, duration, threads, 0, params, null, reportDir, testRunName, verbose, brokerUrl,
- virtualHost, engine, terminate, csvResults, xmlResults, decoratorFactories);
-
- TestResult testResult = coordinator.start(testClassNames);
-
- // Return different error codes, depending on whether or not there were test failures.
- if (testResult.failureCount() > 0)
- {
- System.exit(FAILURE_EXIT);
- }
- else
- {
- System.exit(SUCCESS_EXIT);
- }
- }
- catch (Exception e)
- {
- log.debug("Top level handler caught execption.", e);
- console.info(e.getMessage());
- e.printStackTrace();
- System.exit(EXCEPTION_EXIT);
- }
- }
-
- /// <summary>
- /// Starts all of the test classes to be run by this coordinator.
- /// </summary>
- /// <param name="testClassNames"> An array of all the coordinating test case implementations. </param>
- ///
- /// <return> A JUnit TestResult to run the tests with. </return>
- ///
- /// <exception cref="Exception"> Any underlying exceptions are allowed to fall through, and fail the test process. </exception>
- public TestResult start(String[] testClassNames) throws Exception
- {
- log.debug("public TestResult start(String[] testClassNames = " + Arrays.ToString(testClassNames) + ": called");
-
- // Connect to the broker.
- connection = TestUtils.createConnection(TestContextProperties.getInstance());
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Destination controlTopic = session.createTopic("iop.control");
- Destination responseQueue = session.createQueue("coordinator");
-
- conversationFactory = new ConversationFactory(connection, responseQueue, LinkedBlockingQueue.class);
- ConversationFactory.Conversation conversation = conversationFactory.startConversation();
-
- connection.start();
-
- // Broadcast the compulsory invitation to find out what clients are available to test.
- Message invite = session.createMessage();
- invite.setStringProperty("CONTROL_TYPE", "INVITE");
- invite.setJMSReplyTo(responseQueue);
-
- conversation.send(controlTopic, invite);
-
- // Wait for a short time, to give test clients an opportunity to reply to the invitation.
- Collection<Message> enlists = conversation.receiveAll(0, 500);
- enlistedClients = extractEnlists(enlists);
-
- for (TestClientDetails client : enlistedClients)
- {
- log.debug("Got enlisted test client: " + client);
- console.info("Test node " + client.clientName + " available.");
- }
-
- // Start the clock reference service running.
- UDPClockReference clockReference = new UDPClockReference();
- Thread clockRefThread = new Thread(clockReference);
- registerShutdownHook(clockReference);
- clockRefThread.start();
-
- // Broadcast to all clients to synchronize their clocks against the coordinators clock reference.
- Message clockSynchRequest = session.createMessage();
- clockSynchRequest.setStringProperty("CONTROL_TYPE", "CLOCK_SYNCH");
-
- string localAddress = InetAddress.getByName(InetAddress.getLocalHost().getHostName()).getHostAddress();
- clockSynchRequest.setStringProperty("ADDRESS", localAddress);
-
- conversation.send(controlTopic, clockSynchRequest);
-
- // Run the test in the suite using JUnit.
- TestResult result = null;
-
- for (string testClassName : testClassNames)
- {
- // Record the current test class, so that the test results can be output to a file incorporating this name.
- this.currentTestClassName = testClassName;
-
- result = super.start(new String[] { testClassName });
- }
-
- // At this point in time, all tests have completed. Broadcast the shutdown message, if the termination option
- // was set on the command line.
- if (terminate)
- {
- Message terminate = session.createMessage();
- terminate.setStringProperty("CONTROL_TYPE", "TERMINATE");
-
- conversation.send(controlTopic, terminate);
- }
-
- return result;
- }
-
- /// <summary>
- /// For a collection of enlist messages, this method pulls out of the client details for the enlisting clients.
- /// </summary>
- /// <param name="enlists"> The enlist messages. </param>
- ///
- /// <return> A set of enlisting clients, extracted from the enlist messages. </return>
- ///
- /// <exception cref="JMSException"> Any underlying JMSException is allowed to fall through. </exception>
- public static Set<TestClientDetails> extractEnlists(Collection<Message> enlists) throws JMSException
- {
- log.debug("public static Set<TestClientDetails> extractEnlists(Collection<Message> enlists = " + enlists
- + "): called");
-
- Set<TestClientDetails> enlistedClients = new HashSet<TestClientDetails>();
-
- // Retain the list of all available clients.
- for (Message enlist : enlists)
- {
- TestClientDetails clientDetails = new TestClientDetails();
- clientDetails.clientName = enlist.getStringProperty("CLIENT_NAME");
- clientDetails.privateControlKey = enlist.getStringProperty("CLIENT_PRIVATE_CONTROL_KEY");
-
- string replyType = enlist.getStringProperty("CONTROL_TYPE");
-
- if ("ENLIST".equals(replyType))
- {
- enlistedClients.add(clientDetails);
- }
- else if ("DECLINE".equals(replyType))
- {
- log.debug("Test client " + clientDetails.clientName + " declined the invite.");
- }
- else
- {
- log.warn("Got an unknown reply type, " + replyType + ", to the invite.");
- }
- }
-
- return enlistedClients;
- }
-
- /// <summary>
- /// Runs a test or suite of tests, using the super class implemenation. This method wraps the test to be run
- /// in any test decorators needed to add in the coordinators ability to invite test clients to participate in
- /// tests.
- /// </summary>
- /// <param name="test"> The test to run. </param>
- /// <param name="wait"> Undocumented. Nothing in the JUnit javadocs to say what this is for. </param>
- ///
- /// <return> The results of the test run. </return>
- public TestResult doRun(Test test, bool wait)
- {
- log.debug("public TestResult doRun(Test \"" + test + "\", bool " + wait + "): called");
-
- // Wrap all tests in the test suite with WrappedSuiteTestDecorators. This is quite ugly and a bit baffling,
- // but the reason it is done is because the JUnit implementation of TestDecorator has some bugs in it.
- WrappedSuiteTestDecorator targetTest = null;
-
- if (test instanceof TestSuite)
- {
- log.debug("targetTest is a TestSuite");
-
- TestSuite suite = (TestSuite) test;
-
- int numTests = suite.countTestCases();
- log.debug("There are " + numTests + " in the suite.");
-
- for (int i = 0; i < numTests; i++)
- {
- Test nextTest = suite.testAt(i);
- log.debug("suite.testAt(" + i + ") = " + nextTest);
-
- if (nextTest instanceof FrameworkBaseCase)
- {
- log.debug("nextTest is a FrameworkBaseCase");
- }
- }
-
- targetTest = new WrappedSuiteTestDecorator(suite);
- log.debug("Wrapped with a WrappedSuiteTestDecorator.");
- }
-
- // Apply any optional user specified decorators.
- targetTest = applyOptionalUserDecorators(targetTest);
-
- // Wrap the tests in a suitable distributed test decorator, to perform the invite/test cycle.
- targetTest = newTestDecorator(targetTest, enlistedClients, conversationFactory, connection);
-
- // TestSuite suite = new TestSuite();
- // suite.addTest(targetTest);
-
- // Wrap the tests in a scaled test decorator to them them as a 'batch' in one thread.
- // targetTest = new ScaledTestDecorator(targetTest, new int[] { 1 });
-
- return super.doRun(targetTest, wait);
- }
-
- /// <summary>
- /// Creates a wrapped test decorator, that is capable of inviting enlisted clients to participate in a specified
- /// test. This is the test engine that sets up the roles and sequences a distributed test case.
- /// </summary>
- /// <param name="targetTest"> The test decorator to wrap. </param>
- /// <param name="enlistedClients"> The enlisted clients available to run the test. </param>
- /// <param name="conversationFactory"> The conversation factory used to build conversation helper over the specified connection. </param>
- /// <param name="connection"> The connection to talk to the enlisted clients over. </param>
- ///
- /// <return> An invititing test decorator, that invites all the enlisted clients to participate in tests, in pairs. </return>
- protected DistributedTestDecorator newTestDecorator(WrappedSuiteTestDecorator targetTest,
- Set<TestClientDetails> enlistedClients, ConversationFactory conversationFactory, Connection connection)
- {
- switch (engine)
- {
- case FANOUT:
- return new FanOutTestDecorator(targetTest, enlistedClients, conversationFactory, connection);
- case INTEROP:
- default:
- return new InteropTestDecorator(targetTest, enlistedClients, conversationFactory, connection);
- }
- }
- }
-}
-/*
- *
- * 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 junit.framework.TestResult;
-
-using log4net;
-
-using Apache.Qpid.Integration.Tests.framework.FrameworkBaseCase;
-using Apache.Qpid.Integration.Tests.framework.TestClientDetails;
-using Apache.Qpid.Integration.Tests.framework.sequencers.CircuitFactory;
-using org.apache.qpid.util.ConversationFactory;
-
-using uk.co.thebadgerset.junit.extensions.WrappedSuiteTestDecorator;
-
-using javax.jms.Connection;
-using javax.jms.Destination;
-using javax.jms.JMSException;
-using javax.jms.Message;
-
-using java.util.*;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedtesting
-{
- /// <summary>
- /// DistributedTestDecorator is a base class for writing test decorators that invite test clients to participate in
- /// distributed test cases. It provides a helper method, <see cref="#signupClients"/>, that broadcasts an invitation and
- /// returns the set of test clients that are available to particiapte in the test.
- ///
- /// <p/>When used to wrap a <see cref="FrameworkBaseCase"/> test, it replaces the default <see cref="CircuitFactory"/> implementations
- /// with a suitable circuit factory for distributed tests. Concrete implementations can use this to configure the sending
- /// and receiving roles on the test.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Broadcast test invitations and collect enlists. <td> <see cref="ConversationFactory"/>.
- /// </table>
- /// </summary>
- public abstract class DistributedTestDecorator extends WrappedSuiteTestDecorator
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(DistributedTestDecorator));
-
- /// <summary> Holds the contact information for all test clients that are available and that may take part in the test. </summary>
- Set<TestClientDetails> allClients;
-
- /// <summary> Holds the conversation helper for the control level conversation for coordinating the test through. </summary>
- ConversationFactory conversationFactory;
-
- /// <summary> Holds the connection that the control conversation is held over. </summary>
- Connection connection;
-
- /// <summary> Holds the underlying test suite that this decorator wraps. </summary>
- WrappedSuiteTestDecorator testSuite;
-
- /// <summary> Holds the control topic, on which test invitations are broadcast. </summary>
- protected Destination controlTopic;
-
- /// <summary>
- /// Creates a wrapped suite test decorator from another one.
- /// </summary>
- /// <param name="suite"> The test suite. </param>
- /// <param name="availableClients"> The list of all clients that responded to the compulsory invite. </param>
- /// <param name="controlConversation"> The conversation helper for the control level, test coordination conversation. </param>
- /// <param name="controlConnection"> The connection that the coordination messages are sent over. </param>
- public DistributedTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> availableClients,
- ConversationFactory controlConversation, Connection controlConnection)
- {
- super(suite);
-
- log.debug("public DistributedTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> allClients = "
- + availableClients + ", ConversationHelper controlConversation = " + controlConversation + "): called");
-
- testSuite = suite;
- allClients = availableClients;
- conversationFactory = controlConversation;
- connection = controlConnection;
-
- // Set up the test control topic.
- try
- {
- controlTopic = conversationFactory.getSession().createTopic("iop.control");
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Unable to create the coordinating control topic to broadcast test invites on.", e);
- }
- }
-
- /// <summary>
- /// Should run all of the tests in the wrapped test suite.
- /// </summary>
- /// <param name="testResult"> The the results object to monitor the test results with. </param>
- public abstract void run(TestResult testResult);
-
- /// <summary>
- /// Should provide the distributed test sequencer to pass to <see cref="Apache.Qpid.Integration.Tests.framework.FrameworkBaseCase"/>
- /// tests.
- /// </summary>
- /// <return> A distributed test sequencer. </return>
- public abstract CircuitFactory getTestSequencer();
-
- /// <summary>
- /// Broadcasts an invitation to participate in a coordinating test case to find out what clients are available to
- /// run the test case.
- /// </summary>
- /// <param name="coordTest"> The coordinating test case to broadcast an inviate for. </param>
- ///
- /// <return> A set of test clients that accepted the invitation. </return>
- protected Set<TestClientDetails> signupClients(FrameworkBaseCase coordTest)
- {
- // Broadcast the invitation to find out what clients are available to test.
- Set<TestClientDetails> enlists;
- try
- {
- Message invite = conversationFactory.getSession().createMessage();
-
- ConversationFactory.Conversation conversation = conversationFactory.startConversation();
-
- invite.setStringProperty("CONTROL_TYPE", "INVITE");
- invite.setStringProperty("TEST_NAME", coordTest.getTestCaseNameForTestMethod(coordTest.getName()));
-
- conversation.send(controlTopic, invite);
-
- // Wait for a short time, to give test clients an opportunity to reply to the invitation.
- Collection<Message> replies = conversation.receiveAll(allClients.size(), 500);
- enlists = Coordinator.extractEnlists(replies);
- }
- catch (JMSException e)
- {
- throw new RuntimeException("There was a JMSException during the invite/enlist conversation.", e);
- }
-
- return enlists;
- }
-
- /// <summary>
- /// Prints a string summarizing this test decorator, mainly for debugging purposes.
- /// </summary>
- /// <return> string representation for debugging purposes. </return>
- public string ToString()
- {
- return "DistributedTestDecorator: [ testSuite = " + testSuite + " ]";
- }
- }
-}
-/*
- *
- * 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 junit.framework.Test;
-using junit.framework.TestResult;
-
-using log4net;
-
-using Apache.Qpid.Integration.Tests.framework.DropInTest;
-using Apache.Qpid.Integration.Tests.framework.FrameworkBaseCase;
-using Apache.Qpid.Integration.Tests.framework.TestClientDetails;
-using Apache.Qpid.Integration.Tests.framework.sequencers.CircuitFactory;
-using Apache.Qpid.Integration.Tests.framework.sequencers.FanOutCircuitFactory;
-using org.apache.qpid.util.ConversationFactory;
-
-using uk.co.thebadgerset.junit.extensions.WrappedSuiteTestDecorator;
-
-using javax.jms.Connection;
-using javax.jms.JMSException;
-using javax.jms.Message;
-using javax.jms.MessageListener;
-
-using System.Collections.Generic.Collection;
-using java.util.Iterator;
-using java.util.Set;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedtesting
-{
- /// <summary>
- /// FanOutTestDecorator is an <see cref="DistributedTestDecorator"/> that runs one test client in the sender role, and the remainder
- /// in the receivers role. It also has the capability to listen for new test cases joining the test beyond the initial start
- /// point. This feature can be usefull when experimenting with adding more load, in the form of more test clients, to assess
- /// its impact on a running test.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Execute coordinated test cases. <td> <see cref="FrameworkBaseCase"/>
- /// <tr><td> Accept test clients joining a running test.
- /// </table>
- /// </summary>
- public class FanOutTestDecorator extends DistributedTestDecorator : MessageListener
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(FanOutTestDecorator));
-
- /// <summary> Holds the currently running test case. </summary>
- FrameworkBaseCase currentTest = null;
-
- /// <summary>
- /// Creates a wrapped suite test decorator from another one.
- /// </summary>
- /// <param name="suite"> The test suite. </param>
- /// <param name="availableClients"> The list of all clients that responded to the compulsory invite. </param>
- /// <param name="controlConversation"> The conversation helper for the control level, test coordination conversation. </param>
- /// <param name="controlConnection"> The connection that the coordination messages are sent over. </param>
- public FanOutTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> availableClients,
- ConversationFactory controlConversation, Connection controlConnection)
- {
- super(suite, availableClients, controlConversation, controlConnection);
-
- log.debug("public DistributedTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> allClients = "
- + availableClients + ", ConversationHelper controlConversation = " + controlConversation + "): called");
-
- testSuite = suite;
- allClients = availableClients;
- conversationFactory = controlConversation;
- connection = controlConnection;
-
- // Sign available clients up to the test.
- for (Test test : getAllUnderlyingTests())
- {
- FrameworkBaseCase coordTest = (FrameworkBaseCase) test;
-
- // Get all of the clients able to participate in the test.
- Set<TestClientDetails> enlists = signupClients(coordTest);
-
- // Check that there were some clients available.
- if (enlists.size() == 0)
- {
- throw new RuntimeException("No clients to test with");
- }
-
- // Create a distributed test circuit factory for the test.
- CircuitFactory circuitFactory = getTestSequencer();
-
- // Set up the first client in the sender role, and the remainder in the receivers role.
- Iterator<TestClientDetails> clients = enlists.iterator();
- circuitFactory.setSender(clients.next());
-
- while (clients.hasNext())
- {
- // Set the sending and receiving client details on the test case.
- circuitFactory.setReceiver(clients.next());
- }
-
- // Pass down the connection to hold the coordinating conversation over.
- circuitFactory.setConversationFactory(conversationFactory);
-
- // If the current test case is a drop-in test, set it up as the currently running test for late joiners to
- // add in to. Otherwise the current test field is set to null, to indicate that late joiners are not allowed.
- currentTest = (coordTest instanceof DropInTest) ? coordTest : null;
-
- // Execute the test case.
- coordTest.setCircuitFactory(circuitFactory);
- }
- }
-
- /// <summary>
- /// Broadcasts a test invitation and accepts enlists from participating clients. The wrapped test cases are run
- /// with one test client in the sender role, and the remaining test clients in the receiving role.
- ///
- /// <p/>Any JMSExceptions during the invite/enlist conversation will be allowed to fall through as runtime
- /// exceptions, resulting in the non-completion of the test run.
- /// </summary>
- /// <param name="testResult"> The the results object to monitor the test results with. </param>
- ///
- /// <remarks> Better error recovery for failure of the invite/enlist conversation could be added.</remarks>
- public void run(TestResult testResult)
- {
- log.debug("public void run(TestResult testResult): called");
-
- // Listen for late joiners on the control topic.
- try
- {
- conversationFactory.getSession().createConsumer(controlTopic).setMessageListener(this);
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Unable to set up the message listener on the control topic.", e);
- }
-
- // Run all of the test cases in the test suite.
- /*for (Test test : getAllUnderlyingTests())
- {
- FrameworkBaseCase coordTest = (FrameworkBaseCase) test;
-
- // Get all of the clients able to participate in the test.
- Set<TestClientDetails> enlists = signupClients(coordTest);
-
- // Check that there were some clients available.
- if (enlists.size() == 0)
- {
- throw new RuntimeException("No clients to test with");
- }
-
- // Create a distributed test circuit factory for the test.
- CircuitFactory circuitFactory = getTestSequencer();
-
- // Set up the first client in the sender role, and the remainder in the receivers role.
- Iterator<TestClientDetails> clients = enlists.iterator();
- circuitFactory.setSender(clients.next());
-
- while (clients.hasNext())
- {
- // Set the sending and receiving client details on the test case.
- circuitFactory.setReceiver(clients.next());
- }
-
- // Pass down the connection to hold the coordinating conversation over.
- circuitFactory.setConversationFactory(conversationFactory);
-
- // If the current test case is a drop-in test, set it up as the currently running test for late joiners to
- // add in to. Otherwise the current test field is set to null, to indicate that late joiners are not allowed.
- currentTest = (coordTest instanceof DropInTest) ? coordTest : null;
-
- // Execute the test case.
- coordTest.setCircuitFactory(circuitFactory);
- }*/
-
- // Run all of the test cases in the test suite.
- for (Test test : getAllUnderlyingTests())
- {
- FrameworkBaseCase coordTest = (FrameworkBaseCase) test;
-
- coordTest.run(testResult);
-
- currentTest = null;
- }
- }
-
- /// <summary>
- /// Should provide the distributed test sequencer to pass to <see cref="Apache.Qpid.Integration.Tests.framework.FrameworkBaseCase"/>
- /// tests.
- /// </summary>
- /// <return> A distributed test sequencer. </return>
- public CircuitFactory getTestSequencer()
- {
- return new FanOutCircuitFactory();
- }
-
- /// <summary>
- /// Listens to incoming messages on the control topic. If the messages are 'join' messages, signalling a new
- /// test client wishing to join the current test, then the new client will be added to the current test in the
- /// receivers role.
- /// </summary>
- /// <param name="message"> The incoming control message. </param>
- public void onMessage(Message message)
- {
- try
- {
- // Check if the message is from a test client attempting to join a running test, and join it to the current
- // test case if so.
- if (message.getStringProperty("CONTROL_TYPE").equals("JOIN") && (currentTest != null))
- {
- ((DropInTest) currentTest).lateJoin(message);
- }
- }
- // There is not a lot can be done with this error, so it is deliberately ignored.
- catch (JMSException e)
- {
- log.debug("Unable to process message:" + message);
- }
- }
-
- /// <summary>
- /// Prints a string summarizing this test decorator, mainly for debugging purposes.
- /// </summary>
- /// <return> string representation for debugging purposes. </return>
- public string ToString()
- {
- return "FanOutTestDecorator: [ testSuite = " + testSuite + " ]";
- }
- }
-}
-/*
- *
- * 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 junit.framework.Test;
-using junit.framework.TestResult;
-
-using log4net;
-
-using Apache.Qpid.Integration.Tests.framework.FrameworkBaseCase;
-using Apache.Qpid.Integration.Tests.framework.TestClientDetails;
-using Apache.Qpid.Integration.Tests.framework.sequencers.CircuitFactory;
-using Apache.Qpid.Integration.Tests.framework.sequencers.InteropCircuitFactory;
-using org.apache.qpid.util.ConversationFactory;
-
-using uk.co.thebadgerset.junit.extensions.WrappedSuiteTestDecorator;
-
-using javax.jms.Connection;
-
-using java.util.*;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedtesting
-{
- /// <summary>
- /// DistributedTestDecorator is a test decorator, written to implement the interop test specification. Given a list
- /// of enlisted test clients, that are available to run interop tests, this decorator invites them to participate
- /// in each test in the wrapped test suite. Amongst all the clients that respond to the invite, all pairs are formed,
- /// and each pairing (in both directions, but excluding the reflexive pairings) is split into a sender and receivers
- /// role and a test case run between them. Any enlisted combinations that do not accept a test invite are automatically
- /// failed.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Broadcast test invitations and collect enlists. <td> <see cref="org.apache.qpid.util.ConversationFactory"/>.
- /// <tr><td> Output test failures for clients unwilling to run the test case. <td> <see cref="Coordinator"/>
- /// <tr><td> Execute distributed test cases. <td> <see cref="FrameworkBaseCase"/>
- /// <tr><td> Fail non-participating pairings. <td> <see cref="OptOutTestCase"/>
- /// </table>
- /// </summary>
- public class InteropTestDecorator extends DistributedTestDecorator
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(InteropTestDecorator));
-
- /// <summary>
- /// Creates a wrapped suite test decorator from another one.
- /// </summary>
- /// <param name="suite"> The test suite. </param>
- /// <param name="availableClients"> The list of all clients that responded to the compulsory invite. </param>
- /// <param name="controlConversation"> The conversation helper for the control level, test coordination conversation. </param>
- /// <param name="controlConnection"> The connection that the coordination messages are sent over. </param>
- public InteropTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> availableClients,
- ConversationFactory controlConversation, Connection controlConnection)
- {
- super(suite, availableClients, controlConversation, controlConnection);
- }
-
- /// <summary>
- /// Broadcasts a test invitation and accetps enlisting from participating clients. The wrapped test case is
- /// then repeated for every combination of test clients (provided the wrapped test case extends
- /// <see cref="FrameworkBaseCase"/>.
- ///
- /// <p/>Any JMSExceptions during the invite/enlist conversation will be allowed to fall through as runtime exceptions,
- /// resulting in the non-completion of the test run.
- /// </summary>
- /// <remarks> Better error recovery for failure of the invite/enlist conversation could be added.</remarks>
- /// <param name="testResult"> The the results object to monitor the test results with. </param>
- public void run(TestResult testResult)
- {
- log.debug("public void run(TestResult testResult): called");
-
- Collection<Test> tests = testSuite.getAllUnderlyingTests();
-
- for (Test test : getAllUnderlyingTests())
- {
- FrameworkBaseCase coordTest = (FrameworkBaseCase) test;
-
- // Broadcast the invitation to find out what clients are available to test.
- Set<TestClientDetails> enlists = signupClients(coordTest);
-
- // Compare the list of willing clients to the list of all available.
- Set<TestClientDetails> optOuts = new HashSet<TestClientDetails>(allClients);
- optOuts.removeAll(enlists);
-
- // Output test failures for clients that will not particpate in the test.
- Set<List<TestClientDetails>> failPairs = allPairs(optOuts, allClients);
-
- for (List<TestClientDetails> failPair : failPairs)
- {
- // Create a distributed test circuit factory for the test.
- CircuitFactory circuitFactory = getTestSequencer();
-
- // Create an automatic failure test for the opted out test pair.
- FrameworkBaseCase failTest = new OptOutTestCase("testOptOut");
- circuitFactory.setSender(failPair.get(0));
- circuitFactory.setReceiver(failPair.get(1));
- failTest.setCircuitFactory(circuitFactory);
-
- failTest.run(testResult);
- }
-
- // Loop over all combinations of clients, willing to run the test.
- Set<List<TestClientDetails>> enlistedPairs = allPairs(enlists, enlists);
-
- for (List<TestClientDetails> enlistedPair : enlistedPairs)
- {
- // Create a distributed test circuit factory for the test.
- CircuitFactory circuitFactory = getTestSequencer();
-
- // Set the sending and receiving client details on the test circuitFactory.
- circuitFactory.setSender(enlistedPair.get(0));
- circuitFactory.setReceiver(enlistedPair.get(1));
-
- // Pass down the connection to hold the coordination conversation over.
- circuitFactory.setConversationFactory(conversationFactory);
-
- // Execute the test case.
- coordTest.setCircuitFactory(circuitFactory);
- coordTest.run(testResult);
- }
- }
- }
-
- /// <summary>
- /// Should provide the distributed test sequencer to pass to <see cref="Apache.Qpid.Integration.Tests.framework.FrameworkBaseCase"/>
- /// tests.
- /// </summary>
- /// <return> A distributed test sequencer. </return>
- public CircuitFactory getTestSequencer()
- {
- return new InteropCircuitFactory();
- }
-
- /// <summary>
- /// Produces all pairs of combinations of elements from two sets. The ordering of the elements in the pair is
- /// important, that is the pair <l, r> is distinct from <r, l>; both pairs are generated. For any element, i, in
- /// both the left and right sets, the reflexive pair <i, i> is not generated.
- /// </summary>
- /// <param name="left"> The left set. </param>
- /// <param name="right"> The right set. </param>
- /// @param <E> The type of the content of the pairs.
- /// </summary>
- /// <return> All pairs formed from the permutations of all elements of the left and right sets. </return>
- private <E> Set<List<E>> allPairs(Set<E> left, Set<E> right)
- {
- log.debug("private <E> Set<List<E>> allPairs(Set<E> left = " + left + ", Set<E> right = " + right + "): called");
-
- Set<List<E>> results = new HashSet<List<E>>();
-
- // Form all pairs from left to right.
- // Form all pairs from right to left.
- for (E le : left)
- {
- for (E re : right)
- {
- if (!le.equals(re))
- {
- results.add(new Pair<E>(le, re));
- results.add(new Pair<E>(re, le));
- }
- }
- }
-
- log.debug("results = " + results);
-
- return results;
- }
-
- /// <summary> A simple implementation of a pair, using a list. </summary>
- private class Pair<T> extends ArrayList<T>
- {
- /// <summary>
- /// Creates a new pair of elements.
- /// </summary>
- /// <param name="first"> The first element. </param>
- /// <param name="second"> The second element. </param>
- public Pair(T first, T second)
- {
- super();
- super.add(first);
- super.add(second);
- }
- }
- }
-}
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-using Apache.Qpid.Integration.Tests.framework.sequencers.CircuitFactory;
-using Apache.Qpid.Integration.Tests.framework.FrameworkBaseCase;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedtesting
-{
- /// <summary>
- /// An OptOutTestCase is a test case that automatically fails. It is used when a list of test clients has been generated
- /// from a compulsory invite, but only some of those clients have responded to a specific test case invite. The clients
- /// that did not respond, may automatically be given a fail for some tests.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Fail the test with a suitable reason.
- /// </table>
- /// </summary>
- public class OptOutTestCase extends FrameworkBaseCase
- {
- /// <summary>
- /// Creates a new coordinating test case with the specified name.
- /// </summary>
- /// <param name="name"> The test case name. </param>
- public OptOutTestCase(string name)
- {
- super(name);
- }
-
- /// <summary> Generates an appropriate test failure assertion. </summary>
- public void testOptOut()
- {
- CircuitFactory circuitFactory = getCircuitFactory();
-
- fail("One of " + circuitFactory.getSender() + " and " + getCircuitFactory().getReceivers()
- + " opted out of the test.");
- }
-
- /// <summary>
- /// Should provide a translation from the junit method name of a test to its test case name as defined in the
- /// interop testing specification. For example the method "testP2P" might map onto the interop test case name
- /// "TC2_BasicP2P".
- /// </summary>
- /// <param name="methodName"> The name of the JUnit test method. </param>
- /// <return> The name of the corresponding interop test case. </return>
- public string getTestCaseNameForTestMethod(string methodName)
- {
- return "OptOutTest";
- }
- }
-}
-/*
- *
- * 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 log4net;
-using org.apache.log4j.NDC;
-
-using Apache.Qpid.Integration.Tests.framework.MessagingTestConfigProperties;
-using Apache.Qpid.Integration.Tests.framework.TestUtils;
-using Apache.Qpid.Integration.Tests.framework.clocksynch.ClockSynchThread;
-using Apache.Qpid.Integration.Tests.framework.clocksynch.UDPClockSynchronizer;
-using org.apache.qpid.util.ReflectionUtils;
-using org.apache.qpid.util.ReflectionUtilsException;
-
-using uk.co.thebadgerset.junit.extensions.SleepThrottle;
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-using uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
-
-using javax.jms.*;
-
-using java.util.*;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedtesting
-{
- /// <summary>
- /// Implements a test client as described in the interop testing spec
- /// (http://cwiki.apache.org/confluence/display/qpid/Interop+Testing+Specification). A test client is an agent that
- /// reacts to control message sequences send by the test <see cref="Coordinator"/>.
- ///
- /// <p/><table><caption>Messages Handled by TestClient</caption>
- /// <tr><th> Message <th> Action
- /// <tr><td> Invite(compulsory) <td> Reply with Enlist.
- /// <tr><td> Invite(test case) <td> Reply with Enlist if test case available.
- /// <tr><td> AssignRole(test case) <td> Reply with Accept Role if matches an enlisted test. Keep test parameters.
- /// <tr><td> Start <td> Send test messages defined by test parameters. Send report on messages sent.
- /// <tr><td> Status Request <td> Send report on messages received.
- /// <tr><td> Terminate <td> Terminate the test client.
- /// <tr><td> ClockSynch <td> Synch clock against the supplied UDP address.
- /// </table>
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Handle all incoming control messages. <td> <see cref="TestClientControlledTest"/>
- /// <tr><td> Configure and look up test cases by name. <td> <see cref="TestClientControlledTest"/>
- /// </table>
- /// </summary>
- public class TestClient : MessageListener
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(TestClient));
-
- /// <summary> Used for reporting to the console. </summary>
- private static ILog console = LogManager.GetLogger("CONSOLE");
-
- /// <summary> Holds the default identifying name of the test client. </summary>
- public static final string CLIENT_NAME = "java";
-
- /// <summary> Holds the URL of the broker to run the tests on. </summary>
- public static string brokerUrl;
-
- /// <summary> Holds the virtual host to run the tests on. If <tt>null</tt>, then the default virtual host is used. </summary>
- public static string virtualHost;
-
- /// <summary>
- /// Holds the test context properties that provides the default test parameters, plus command line overrides.
- /// This is initialized with the default test parameters, to which command line overrides may be applied.
- /// </summary>
- public static ParsedProperties testContextProperties =
- TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- /// <summary> Holds all the test cases loaded from the classpath. </summary>
- Map<String, TestClientControlledTest> testCases = new HashMap<String, TestClientControlledTest>();
-
- /// <summary> Holds the test case currently being run by this client. </summary>
- protected TestClientControlledTest currentTestCase;
-
- /// <summary> Holds the connection to the broker that the test is being coordinated on. </summary>
- protected Connection connection;
-
- /// <summary> Holds the message producer to hold the test coordination over. </summary>
- protected MessageProducer producer;
-
- /// <summary> Holds the JMS controlSession for the test coordination. </summary>
- protected Session session;
-
- /// <summary> Holds the name of this client, with a default value. </summary>
- protected string clientName = CLIENT_NAME;
-
- /// <summary> This flag indicates that the test client should attempt to join the currently running test case on start up. </summary>
- protected bool join;
-
- /// <summary> Holds the clock synchronizer for the test node. </summary>
- ClockSynchThread clockSynchThread;
-
- /// <summary>
- /// Creates a new interop test client, listenting to the specified broker and virtual host, with the specified client
- /// identifying name.
- /// </summary>
- /// <param name="pBrokerUrl"> The url of the broker to connect to. </param>
- /// <param name="pVirtualHost"> The virtual host to conect to. </param>
- /// <param name="clientName"> The client name to use. </param>
- /// <param name="join"> Flag to indicate that this client should attempt to join running tests. </param>
- public TestClient(string pBrokerUrl, string pVirtualHost, string clientName, bool join)
- {
- log.debug("public TestClient(string pBrokerUrl = " + pBrokerUrl + ", string pVirtualHost = " + pVirtualHost
- + ", string clientName = " + clientName + ", bool join = " + join + "): called");
-
- // Retain the connection parameters.
- brokerUrl = pBrokerUrl;
- virtualHost = pVirtualHost;
- this.clientName = clientName;
- this.join = join;
- }
-
- /// <summary>
- /// The entry point for the interop test coordinator. This client accepts the following command line arguments:
- ///
- /// <p/><table>
- /// <tr><td> -b <td> The broker URL. <td> Optional.
- /// <tr><td> -h <td> The virtual host. <td> Optional.
- /// <tr><td> -n <td> The test client name. <td> Optional.
- /// <tr><td> name=value <td> Trailing argument define name/value pairs. Added to system properties. <td> Optional.
- /// </table>
- /// </summary>
- /// <param name="args"> The command line arguments. </param>
- public static void main(String[] args)
- {
- log.debug("public static void main(String[] args = " + Arrays.ToString(args) + "): called");
- console.info("Qpid Distributed Test Client.");
-
- // Override the default broker url to be localhost:5672.
- testContextProperties.setProperty(MessagingTestConfigProperties.BROKER_PROPNAME, "tcp://localhost:5672");
-
- // Use the command line parser to evaluate the command line with standard handling behaviour (print errors
- // and usage then exist if there are errors).
- // Any options and trailing name=value pairs are also injected into the test context properties object,
- // to override any defaults that may have been set up.
- ParsedProperties options =
- new ParsedProperties(uk.co.thebadgerset.junit.extensions.util.CommandLineParser.processCommandLine(args,
- new uk.co.thebadgerset.junit.extensions.util.CommandLineParser(
- new String[][]
- {
- { "b", "The broker URL.", "broker", "false" },
- { "h", "The virtual host to use.", "virtual host", "false" },
- { "o", "The name of the directory to output test timings to.", "dir", "false" },
- { "n", "The name of the test client.", "name", "false" },
- { "j", "Join this test client to running test.", "false" }
- }), testContextProperties));
-
- // Extract the command line options.
- string brokerUrl = options.getProperty("b");
- string virtualHost = options.getProperty("h");
- string clientName = options.getProperty("n");
- clientName = (clientName == null) ? CLIENT_NAME : clientName;
- bool join = options.getPropertyAsBoolean("j");
-
- // To distinguish logging output set up an NDC on the client name.
- NDC.push(clientName);
-
- // Create a test client and start it running.
- TestClient client = new TestClient(brokerUrl, virtualHost, clientName, join);
-
- // Use a class path scanner to find all the interop test case implementations.
- // Hard code the test classes till the classpath scanner is fixed.
- Collection<Class<? extends TestClientControlledTest>> testCaseClasses =
- new ArrayList<Class<? extends TestClientControlledTest>>();
- // ClasspathScanner.getMatches(TestClientControlledTest.class, "^TestCase.*", true);
- testCaseClasses.addAll(loadTestCases("org.apache.qpid.interop.clienttestcases.TestCase1DummyRun",
- "org.apache.qpid.interop.clienttestcases.TestCase2BasicP2P",
- "org.apache.qpid.interop.clienttestcases.TestCase3BasicPubSub",
- "org.apache.qpid.interop.clienttestcases.TestCase4P2PMessageSize",
- "org.apache.qpid.interop.clienttestcases.TestCase5PubSubMessageSize",
- "Apache.Qpid.Integration.Tests.framework.distributedcircuit.TestClientCircuitEnd"));
-
- try
- {
- client.start(testCaseClasses);
- }
- catch (Exception e)
- {
- log.error("The test client was unable to start.", e);
- console.info(e.getMessage());
- System.exit(1);
- }
- }
-
- /// <summary>
- /// Parses a list of class names, and loads them if they are available on the class path.
- /// </summary>
- /// <param name="classNames"> The names of the classes to load. </param>
- ///
- /// <return> A list of the loaded test case classes. </return>
- public static IList<Class<? extends TestClientControlledTest>> loadTestCases(String... classNames)
- {
- IList<Class<? extends TestClientControlledTest>> testCases =
- new LinkedList<Class<? extends TestClientControlledTest>>();
-
- for (string className : classNames)
- {
- try
- {
- Class<?> cls = ReflectionUtils.forName(className);
- testCases.add((Class<? extends TestClientControlledTest>) cls);
- }
- catch (ReflectionUtilsException e)
- {
- // Ignore, class could not be found, so test not available.
- console.warn("Requested class " + className + " cannot be found, ignoring it.");
- }
- catch (ClassCastException e)
- {
- // Ignore, class was not of correct type to be a test case.
- console.warn("Requested class " + className + " is not an instance of TestClientControlledTest.");
- }
- }
-
- return testCases;
- }
-
- /// <summary>
- /// Starts the interop test client running. This causes it to start listening for incoming test invites.
- /// </summary>
- /// <param name="testCaseClasses"> The classes of the available test cases. The test case names from these are used to </param>
- /// matchin incoming test invites against.
- ///
- /// <exception cref="JMSException"> Any underlying JMSExceptions are allowed to fall through. </exception>
- protected void start(Collection<Class<? extends TestClientControlledTest>> testCaseClasses) throws JMSException
- {
- log.debug("protected void start(Collection<Class<? extends TestClientControlledTest>> testCaseClasses = "
- + testCaseClasses + "): called");
-
- // Create all the test case implementations and index them by the test names.
- for (Class<? extends TestClientControlledTest> nextClass : testCaseClasses)
- {
- try
- {
- TestClientControlledTest testCase = nextClass.newInstance();
- testCases.put(testCase.getName(), testCase);
- }
- catch (InstantiationException e)
- {
- log.warn("Could not instantiate test case class: " + nextClass.getName(), e);
- // Ignored.
- }
- catch (IllegalAccessException e)
- {
- log.warn("Could not instantiate test case class due to illegal access: " + nextClass.getName(), e);
- // Ignored.
- }
- }
-
- // Open a connection to communicate with the coordinator on.
- connection = TestUtils.createConnection(testContextProperties);
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Set this up to listen for control messages.
- Topic privateControlTopic = session.createTopic("iop.control." + clientName);
- MessageConsumer consumer = session.createConsumer(privateControlTopic);
- consumer.setMessageListener(this);
-
- Topic controlTopic = session.createTopic("iop.control");
- MessageConsumer consumer2 = session.createConsumer(controlTopic);
- consumer2.setMessageListener(this);
-
- // Create a producer to send replies with.
- producer = session.createProducer(null);
-
- // If the join flag was set, then broadcast a join message to notify the coordinator that a new test client
- // is available to join the current test case, if it supports it. This message may be ignored, or it may result
- // in this test client receiving a test invite.
- if (join)
- {
- Message joinMessage = session.createMessage();
-
- joinMessage.setStringProperty("CONTROL_TYPE", "JOIN");
- joinMessage.setStringProperty("CLIENT_NAME", clientName);
- joinMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
- producer.send(controlTopic, joinMessage);
- }
-
- // Start listening for incoming control messages.
- connection.start();
- }
-
- /// <summary>
- /// Handles all incoming control messages.
- /// </summary>
- /// <param name="message"> The incoming message. </param>
- public void onMessage(Message message)
- {
- NDC.push(clientName);
- log.debug("public void onMessage(Message message = " + message + "): called");
-
- try
- {
- string controlType = message.getStringProperty("CONTROL_TYPE");
- string testName = message.getStringProperty("TEST_NAME");
-
- log.debug("Received control of type '" + controlType + "' for the test '" + testName + "'");
-
- // Check if the message is a test invite.
- if ("INVITE".equals(controlType))
- {
- // Flag used to indicate that an enlist should be sent. Only enlist to compulsory invites or invites
- // for which test cases exist.
- bool enlist = false;
-
- if (testName != null)
- {
- log.debug("Got an invite to test: " + testName);
-
- // Check if the requested test case is available.
- TestClientControlledTest testCase = testCases.get(testName);
-
- if (testCase != null)
- {
- log.debug("Found implementing class for test '" + testName + "', enlisting for it.");
-
- // Check if the test case will accept the invitation.
- enlist = testCase.acceptInvite(message);
-
- log.debug("The test case "
- + (enlist ? " accepted the invite, enlisting for it."
- : " did not accept the invite, not enlisting."));
-
- // Make the requested test case the current test case.
- currentTestCase = testCase;
- }
- else
- {
- log.debug("Received an invite to the test '" + testName + "' but this test is not known.");
- }
- }
- else
- {
- log.debug("Got a compulsory invite, enlisting for it.");
-
- enlist = true;
- }
-
- if (enlist)
- {
- // Reply with the client name in an Enlist message.
- Message enlistMessage = session.createMessage();
- enlistMessage.setStringProperty("CONTROL_TYPE", "ENLIST");
- enlistMessage.setStringProperty("CLIENT_NAME", clientName);
- enlistMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
- enlistMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending enlist message '" + enlistMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), enlistMessage);
- }
- else
- {
- // Reply with the client name in an Decline message.
- Message enlistMessage = session.createMessage();
- enlistMessage.setStringProperty("CONTROL_TYPE", "DECLINE");
- enlistMessage.setStringProperty("CLIENT_NAME", clientName);
- enlistMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
- enlistMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending decline message '" + enlistMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), enlistMessage);
- }
- }
- else if ("ASSIGN_ROLE".equals(controlType))
- {
- // Assign the role to the current test case.
- string roleName = message.getStringProperty("ROLE");
-
- log.debug("Got a role assignment to role: " + roleName);
-
- TestClientControlledTest.Roles role = Enum.valueOf(TestClientControlledTest.Roles.class, roleName);
-
- currentTestCase.assignRole(role, message);
-
- // Reply by accepting the role in an Accept Role message.
- Message acceptRoleMessage = session.createMessage();
- acceptRoleMessage.setStringProperty("CLIENT_NAME", clientName);
- acceptRoleMessage.setStringProperty("CONTROL_TYPE", "ACCEPT_ROLE");
- acceptRoleMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending accept role message '" + acceptRoleMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), acceptRoleMessage);
- }
- else if ("START".equals(controlType) || "STATUS_REQUEST".equals(controlType))
- {
- if ("START".equals(controlType))
- {
- log.debug("Got a start notification.");
-
- // Extract the number of test messages to send from the start notification.
- int numMessages;
-
- try
- {
- numMessages = message.getIntProperty("MESSAGE_COUNT");
- }
- catch (NumberFormatException e)
- {
- // If the number of messages is not specified, use the default of one.
- numMessages = 1;
- }
-
- // Start the current test case.
- currentTestCase.start(numMessages);
- }
- else
- {
- log.debug("Got a status request.");
- }
-
- // Generate the report from the test case and reply with it as a Report message.
- Message reportMessage = currentTestCase.getReport(session);
- reportMessage.setStringProperty("CLIENT_NAME", clientName);
- reportMessage.setStringProperty("CONTROL_TYPE", "REPORT");
- reportMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending report message '" + reportMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), reportMessage);
- }
- else if ("TERMINATE".equals(controlType))
- {
- console.info("Received termination instruction from coordinator.");
-
- // Is a cleaner shutdown needed?
- connection.close();
- System.exit(0);
- }
- else if ("CLOCK_SYNCH".equals(controlType))
- {
- log.debug("Received clock synch command.");
- string address = message.getStringProperty("ADDRESS");
-
- log.debug("address = " + address);
-
- // Re-create (if necessary) and start the clock synch thread to synch the clock every ten seconds.
- if (clockSynchThread != null)
- {
- clockSynchThread.terminate();
- }
-
- SleepThrottle throttle = new SleepThrottle();
- throttle.setRate(0.1f);
-
- clockSynchThread = new ClockSynchThread(new UDPClockSynchronizer(address), throttle);
- clockSynchThread.start();
- }
- else
- {
- // Log a warning about this but otherwise ignore it.
- log.warn("Got an unknown control message, controlType = " + controlType + ", message = " + message);
- }
- }
- catch (JMSException e)
- {
- // Log a warning about this, but otherwise ignore it.
- log.warn("Got JMSException whilst handling message: " + message, e);
- }
- // Log any runtimes that fall through this message handler. These are fatal errors for the test client.
- catch (RuntimeException e)
- {
- log.error("The test client message handler got an unhandled exception: ", e);
- console.info("The message handler got an unhandled exception, terminating the test client.");
- System.exit(1);
- }
- finally
- {
- NDC.pop();
- }
- }
- }
-}
-/*
- *
- * 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 javax.jms.JMSException;
-using javax.jms.Message;
-using javax.jms.MessageListener;
-using javax.jms.Session;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedtesting
-{
- /// <summary>
- /// TestClientControlledTest provides an interface that classes implementing test cases to run on a <see cref="TestClient"/>
- /// node can use. Implementations must be Java beans, that is, to provide a default constructor and to implement the
- /// <see cref="#getName"/> method.
- ///
- /// <p/>The methods specified in this interface are called when the <see cref="TestClient"/> receives control instructions to
- /// apply to the test. There are control instructions to present the test case with the test invite, so that it may
- /// choose whether or not to participate in the test, assign the test to play the sender or receiver role, start the
- /// test and obtain the test status report.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Supply the name of the test case that this implements.
- /// <tr><td> Accept/Reject invites based on test parameters.
- /// <tr><td> Adapt to assigned roles.
- /// <tr><td> Perform test case actions.
- /// <tr><td> Generate test reports.
- /// </table>
- /// </summary>
- public interface TestClientControlledTest
- {
- /// <summary> Defines the possible test case roles that an interop test case can take on. </summary>
- public enum Roles
- {
- /// <summary> Specifies the sender role. </summary>
- SENDER,
-
- /// <summary> Specifies the receivers role. </summary>
- RECEIVER
- }
-
- /// <summary>
- /// Should provide the name of the test case that this class implements. The exact names are defined in the
- /// interop testing spec.
- /// </summary>
- /// <return> The name of the test case that this implements. </return>
- public string getName();
-
- /// <summary>
- /// Determines whether the test invite that matched this test case is acceptable.
- /// </summary>
- /// <param name="inviteMessage"> The invitation to accept or reject. </param>
- ///
- /// <return> <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it. </return>
- ///
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- public bool acceptInvite(Message inviteMessage) throws JMSException;
-
- /// <summary>
- /// Assigns the role to be played by this test case. The test parameters are fully specified in the
- /// assignment message. When this method return the test case will be ready to execute.
- /// </summary>
- /// <param name="role"> The role to be played; sender or receivers. </param>
- /// <param name="assignRoleMessage"> The role assingment message, contains the full test parameters. </param>
- ///
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException;
-
- /// <summary>
- /// Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
- /// </summary>
- /// <param name="numMessages"> The number of test messages to send. </param>
- ///
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- public void start(int numMessages) throws JMSException;
-
- /// <summary>
- /// Gets a report on the actions performed by the test case in its assigned role.
- /// </summary>
- /// <param name="session"> The controlSession to create the report message in. </param>
- ///
- /// <return> The report message. </return>
- ///
- /// <exception cref="JMSException"> Any JMSExceptions resulting from creating the report are allowed to fall through. </exception>
- public Message getReport(Session session) throws JMSException;
- }
-}
-/*
- *
- * 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 javax.jms.JMSException;
-using javax.jms.Message;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A DropIn test is a test case that can accept late joining test clients into a running test. This can be usefull,
- /// for interactive experimentation.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Accept late joining test clients.
- /// </table>
- /// </summary>
- public interface DropInTest
- {
- /// <summary>
- /// Should accept a late joining client into a running test case. The client will be enlisted with a control message
- /// with the 'CONTROL_TYPE' field set to the value 'LATEJOIN'. It should also provide values for the fields:
- ///
- /// <p/><table>
- /// <tr><td> CLIENT_NAME <td> A unique name for the new client.
- /// <tr><td> CLIENT_PRIVATE_CONTROL_KEY <td> The key for the route on which the client receives its control messages.
- /// </table>
- /// </summary>
- /// <param name="message"> The late joiners join message. </param>
- ///
- /// <exception cref="JMSException"> Any JMS Exception are allowed to fall through, indicating that the join failed. </exception>
- public void lateJoin(Message message) throws JMSException;
- }
-}
-/*
- *
- * 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 log4net;
-
-using javax.jms.ExceptionListener;
-using javax.jms.JMSException;
-
-using java.io.PrintWriter;
-using java.io.StringWriter;
-using java.util.ArrayList;
-using System.Collections.Generic.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// An exception monitor, listens for JMS exception on a connection or consumer. It record all exceptions that it receives
- /// and provides methods to test the number and type of exceptions received.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Record all exceptions received.
- /// </table>
- /// </summary>
- public class ExceptionMonitor : ExceptionListener
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(ExceptionMonitor));
-
- /// <summary> Holds the received exceptions. </summary>
- IList<Exception> exceptions = new ArrayList<Exception>();
-
- /// <summary>
- /// Receives incoming exceptions.
- /// </summary>
- /// <param name="e"> The exception to record. </param>
- public synchronized void onException(JMSException e)
- {
- log.debug("public void onException(JMSException e): called", e);
-
- exceptions.add(e);
- }
-
- /// <summary>
- /// Checks that no exceptions have been received.
- /// </summary>
- /// <return> <tt>true</tt> if no exceptions have been received, <tt>false</tt> otherwise. </return>
- public synchronized bool assertNoExceptions()
- {
- return exceptions.isEmpty();
- }
-
- /// <summary>
- /// Checks that exactly one exception has been received.
- /// </summary>
- /// <return> <tt>true</tt> if exactly one exception been received, <tt>false</tt> otherwise. </return>
- public synchronized bool assertOneJMSException()
- {
- return exceptions.size() == 1;
- }
-
- /// <summary>
- /// Checks that exactly one exception, with a linked cause of the specified type, has been received.
- /// </summary>
- /// <param name="aClass"> The type of the linked cause. </param>
- ///
- /// <return> <tt>true</tt> if exactly one exception, with a linked cause of the specified type, been received, </return>
- /// <tt>false</tt> otherwise.
- public synchronized bool assertOneJMSExceptionWithLinkedCause(Class aClass)
- {
- if (exceptions.size() == 1)
- {
- Exception e = exceptions.get(0);
-
- if (e instanceof JMSException)
- {
- JMSException jmse = (JMSException) e;
-
- Exception linkedCause = jmse.getLinkedException();
-
- if ((linkedCause != null) && aClass.isInstance(linkedCause))
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /// <summary>
- /// Checks that at least one exception of the the specified type, has been received.
- /// </summary>
- /// <param name="exceptionClass"> The type of the exception. </param>
- ///
- /// <return> <tt>true</tt> if at least one exception of the specified type has been received, <tt>false</tt> otherwise. </return>
- public synchronized bool assertExceptionOfType(Class exceptionClass)
- {
- // Start by assuming that the exception has no been received.
- bool passed = false;
-
- // Scan all the exceptions for a match.
- for (Exception e : exceptions)
- {
- if (exceptionClass.isInstance(e))
- {
- passed = true;
-
- break;
- }
- }
-
- return passed;
- }
-
- /// <summary>
- /// Reports the number of exceptions held by this monitor.
- /// </summary>
- /// <return> The number of exceptions held by this monitor. </return>
- public synchronized int size()
- {
- return exceptions.size();
- }
-
- /// <summary>
- /// Clears the record of received exceptions.
- /// </summary>
- public synchronized void reset()
- {
- exceptions = new ArrayList<Exception>();
- }
-
- /// <summary>
- /// Provides a dump of the stack traces of all exceptions that this exception monitor was notified of. Mainly
- /// use for debugging/test failure reporting purposes.
- /// </summary>
- /// <return> A string containing a dump of the stack traces of all exceptions. </return>
- public synchronized string ToString()
- {
- string result = "ExceptionMonitor: holds " + exceptions.size() + " exceptions.\n\n";
-
- for (Exception ex : exceptions)
- {
- result += getStackTrace(ex) + "\n";
- }
-
- return result;
- }
-
- /// <summary>
- /// Prints an exception stack trace into a string.
- /// </summary>
- /// <param name="t"> The throwable to get the stack trace from. </param>
- ///
- /// <return> A string containing the throwables stack trace. </return>
- public static string getStackTrace(Throwable t)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw, true);
- t.printStackTrace(pw);
- pw.flush();
- sw.flush();
-
- return sw.ToString();
- }
- }
-}
-/*
- *
- * 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 log4net;
-using org.apache.log4j.NDC;
-
-using Apache.Qpid.Integration.Tests.framework.BrokerLifecycleAware;
-using Apache.Qpid.Integration.Tests.framework.sequencers.CircuitFactory;
-
-using uk.co.thebadgerset.junit.extensions.AsymptoticTestCase;
-using uk.co.thebadgerset.junit.extensions.SetupTaskAware;
-using uk.co.thebadgerset.junit.extensions.SetupTaskHandler;
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-using uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
-
-using java.util.ArrayList;
-using System.Collections.Generic.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// FrameworkBaseCase provides a starting point for writing test cases against the test framework. Its main purpose is
- /// to provide some convenience methods for testing.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Create and clean up in-vm brokers on every test case.
- /// <tr><td> Produce lists of assertions from assertion creation calls.
- /// <tr><td> Produce JUnit failures from assertion failures.
- /// <tr><td> Convert failed assertions to error messages.
- /// </table>
- /// </summary>
- public class FrameworkBaseCase extends AsymptoticTestCase : FrameworkTestContext, SetupTaskAware,
- BrokerLifecycleAware
- {
- /// <summary> Used for debugging purposes. </summary>
- private static ILog log = LogManager.GetLogger(typeof(FrameworkBaseCase));
-
- /// <summary> Holds the test sequencer to create and run test circuits with. </summary>
- protected CircuitFactory circuitFactory = new LocalCircuitFactory();
-
- /// <summary> Used to read the tests configurable properties through. </summary>
- protected ParsedProperties testProps;
-
- /// <summary> A default setup task processor to delegate setup tasks to. </summary>
- protected SetupTaskHandler taskHandler = new SetupTaskHandler();
-
- /// <summary> Flag used to track whether the test is in-vm or not. </summary>
- protected bool isUsingInVM;
-
- /// <summary> Holds the failure mechanism. </summary>
- protected CauseFailure failureMechanism = new CauseFailureUserPrompt();
-
- /// <summary>
- /// Creates a new test case with the specified name.
- /// </summary>
- /// <param name="name"> The test case name. </param>
- public FrameworkBaseCase(string name)
- {
- super(name);
- }
-
- /// <summary>
- /// Returns the test case sequencer that provides test circuit, and test sequence implementations. The sequencer
- /// that this base case returns by default is suitable for running a test circuit with both circuit ends colocated
- /// on the same JVM.
- /// </summary>
- /// <return> The test case sequencer. </return>
- protected CircuitFactory getCircuitFactory()
- {
- return circuitFactory;
- }
-
- /// <summary>
- /// Overrides the default test circuit factory. Test decorators can use this to supply distributed test sequencers or
- /// other test circuit factory specializations.
- /// </summary>
- /// <param name="circuitFactory"> The new test circuit factory. </param>
- public void setCircuitFactory(CircuitFactory circuitFactory)
- {
- this.circuitFactory = circuitFactory;
- }
-
- /// <summary>
- /// Reports the current test case name.
- /// </summary>
- /// <return> The current test case name. </return>
- public TestCaseVector getTestCaseVector()
- {
- return new TestCaseVector(this.getName(), 0);
- }
-
- /// <summary>
- /// Reports the current test case parameters.
- /// </summary>
- /// <return> The current test case parameters. </return>
- public MessagingTestConfigProperties getTestParameters()
- {
- return new MessagingTestConfigProperties(testProps);
- }
-
- /// <summary>
- /// Creates a list of assertions.
- /// </summary>
- /// <param name="asserts"> The assertions to compile in a list. </param>
- ///
- /// <return> A list of assertions. </return>
- protected IList<Assertion> assertionList(Assertion... asserts)
- {
- IList<Assertion> result = new ArrayList<Assertion>();
-
- for (Assertion assertion : asserts)
- {
- result.add(assertion);
- }
-
- return result;
- }
-
- /// <summary>
- /// Generates a JUnit assertion exception (failure) if any assertions are passed into this method, also concatenating
- /// all of the error messages in the assertions together to form an error message to diagnose the test failure with.
- /// </summary>
- /// <param name="asserts"> The list of failed assertions. </param>
- protected static void assertNoFailures(List<Assertion> asserts)
- {
- log.debug("protected void assertNoFailures(List<Assertion> asserts = " + asserts + "): called");
-
- // Check if there are no assertion failures, and return without doing anything if so.
- if ((asserts == null) || asserts.isEmpty())
- {
- return;
- }
-
- // Compile all of the assertion failure messages together.
- string errorMessage = assertionsToString(asserts);
-
- // Fail with the error message from all of the assertions.
- fail(errorMessage);
- }
-
- /// <summary>
- /// Converts a list of failed assertions into an error message.
- /// </summary>
- /// <param name="asserts"> The failed assertions. </param>
- ///
- /// <return> The error message. </return>
- protected static string assertionsToString(List<Assertion> asserts)
- {
- string errorMessage = "";
-
- for (Assertion assertion : asserts)
- {
- errorMessage += assertion.ToString() + "\n";
- }
-
- return errorMessage;
- }
-
- /// <summary>
- /// Ensures that the in-vm broker is created and initialized.
- /// </summary>
- ///
- /// <exception cref="Exception"> Any exceptions allowed to fall through and fail the test. </exception>
- protected void setUp() throws Exception
- {
- NDC.push(getName());
-
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- // Process all optional setup tasks. This may include in-vm broker creation, if a decorator has added it.
- taskHandler.runSetupTasks();
- }
-
- /// <summary> Ensures that the in-vm broker is cleaned up after each test run. </summary>
- protected void tearDown()
- {
- NDC.pop();
-
- // Process all optional tear down tasks. This may include in-vm broker clean up, if a decorator has added it.
- taskHandler.runTearDownTasks();
- }
-
- /// <summary>
- /// Adds the specified task to the tests setup.
- /// </summary>
- /// <param name="task"> The task to add to the tests setup. </param>
- public void chainSetupTask(Runnable task)
- {
- taskHandler.chainSetupTask(task);
- }
-
- /// <summary>
- /// Adds the specified task to the tests tear down.
- /// </summary>
- /// <param name="task"> The task to add to the tests tear down. </param>
- public void chainTearDownTask(Runnable task)
- {
- taskHandler.chainTearDownTask(task);
- }
-
- /// <summary>
- /// Should provide a translation from the junit method name of a test to its test case name as known to the test
- /// clients that will run the test. The purpose of this is to convert the JUnit method name into the correct test
- /// case name to place into the test invite. For example the method "testP2P" might map onto the interop test case
- /// name "TC2_BasicP2P".
- /// </summary>
- /// <param name="methodName"> The name of the JUnit test method. </param>
- ///
- /// <return> The name of the corresponding interop test case. </return>
- public string getTestCaseNameForTestMethod(string methodName)
- {
- return methodName;
- }
-
- public void setInVmBrokers()
- {
- isUsingInVM = true;
- }
-
- /// <summary>
- /// Indicates whether or not a test case is using in-vm brokers.
- /// </summary>
- /// <return> <tt>true</tt> if the test is using in-vm brokers, <tt>false</tt> otherwise. </return>
- public bool usingInVmBroker()
- {
- return isUsingInVM;
- }
-
- /// <summary>
- /// Sets the currently live in-vm broker.
- /// </summary>
- /// <param name="i"> The currently live in-vm broker. </param>
- public void setLiveBroker(int i)
- { }
-
- /// <summary>
- /// Reports the currently live in-vm broker.
- /// </summary>
- /// <return> The currently live in-vm broker. </return>
- public int getLiveBroker()
- {
- return 0;
- }
-
- /// <summary>
- /// Accepts a failure mechanism.
- /// </summary>
- /// <param name="failureMechanism"> The failure mechanism. </param>
- public void setFailureMechanism(CauseFailure failureMechanism)
- {
- this.failureMechanism = failureMechanism;
- }
- }
-}
-/*
- *
- * 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.Integration.Tests.framework
-{
-
- /// <summary>
- /// A FrameworkTestContext provides context information to test code about the current test case being run; its name, its
- /// parameters.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide the name of the current test case.
- /// <tr><td> Provide the test parameters.
- /// </table>
- /// </summary>
- public interface FrameworkTestContext
- {
- /// <summary>
- /// Reports the current test case name.
- /// </summary>
- /// <return> The current test case name. </return>
- TestCaseVector getTestCaseVector();
-
- /// <summary>
- /// Reports the current test case parameters.
- /// </summary>
- /// <return> The current test case parameters. </return>
- MessagingTestConfigProperties getTestParameters();
- }
-}
-/*
- *
- * 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 log4net;
-
-using Apache.Qpid.Integration.Tests.framework.*;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.*;
-
-using System.Collections.Generic.LinkedList;
-using System.Collections.Generic.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework.localcircuit
-{
- /// <summary>
- /// LocalCircuitImpl provides an implementation of the test circuit. This is a local only circuit implementation that
- /// supports a single producer/consumer on each end of the circuit, with both ends of the circuit on the same JVM.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Supply the publishing and receiving ends of a test messaging circuit.
- /// <td> <see cref="LocalPublisherImpl"/>, <see cref="LocalReceiverImpl"/>
- /// <tr><td> Start the circuit running.
- /// <tr><td> Close the circuit down.
- /// <tr><td> Take a reading of the circuits state.
- /// <tr><td> Apply assertions against the circuits state. <td> <see cref="Assertion"/>
- /// <tr><td> Send test messages over the circuit.
- /// <tr><td> Perform the default test procedure on the circuit.
- /// <tr><td> Provide access to connection and controlSession exception monitors. <td> <see cref="ExceptionMonitor"/>
- /// </table>
- /// </summary>
- public class LocalCircuitImpl : Circuit
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(LocalCircuitImpl));
-
- /// <summary> Holds the test configuration for the circuit. </summary>
- private ParsedProperties testProps;
-
- /// <summary> Holds the publishing end of the circuit. </summary>
- private LocalPublisherImpl publisher;
-
- /// <summary> Holds the receiving end of the circuit. </summary>
- private LocalReceiverImpl receiver;
-
- /// <summary> Holds the connection for the publishing end of the circuit. </summary>
- private Connection connection;
-
- /// <summary> Holds the exception listener for the connection on the publishing end of the circuit. </summary>
- private ExceptionMonitor connectionExceptionMonitor;
-
- /// <summary> Holds the exception listener for the controlSession on the publishing end of the circuit. </summary>
- private ExceptionMonitor exceptionMonitor;
-
- /// <summary>
- /// Creates a test circuit using the specified test parameters. The publisher, receivers, connection and
- /// connection monitor must already have been created, to assemble the circuit.
- /// </summary>
- /// <param name="testProps"> The test parameters. </param>
- /// <param name="publisher"> The test publisher. </param>
- /// <param name="receiver"> The test receivers. </param>
- /// <param name="connection"> The connection. </param>
- /// <param name="connectionExceptionMonitor"> The connection exception monitor. </param>
- public LocalCircuitImpl(ParsedProperties testProps, LocalPublisherImpl publisher, LocalReceiverImpl receiver,
- Connection connection, ExceptionMonitor connectionExceptionMonitor)
- {
- this.testProps = testProps;
- this.publisher = publisher;
- this.receiver = receiver;
- this.connection = connection;
- this.connectionExceptionMonitor = connectionExceptionMonitor;
- this.exceptionMonitor = new ExceptionMonitor();
-
- // Set this as the parent circuit on the publisher and receivers.
- publisher.setCircuit(this);
- receiver.setCircuit(this);
- }
-
- /// <summary>
- /// Gets the interface on the publishing end of the circuit.
- /// </summary>
- /// <return> The publishing end of the circuit. </return>
- public Publisher getPublisher()
- {
- return publisher;
- }
-
- /// <summary>
- /// Gets the local publishing circuit end, for direct manipulation.
- /// </summary>
- /// <return> The local publishing circuit end. </return>
- public CircuitEnd getLocalPublisherCircuitEnd()
- {
- return publisher;
- }
-
- /// <summary>
- /// Gets the interface on the receiving end of the circuit.
- /// </summary>
- /// <return> The receiving end of the circuit. </return>
- public Receiver getReceiver()
- {
- return receiver;
- }
-
- /// <summary>
- /// Gets the local receiving circuit end, for direct manipulation.
- /// </summary>
- /// <return> The local receiving circuit end. </return>
- public CircuitEnd getLocalReceiverCircuitEnd()
- {
- return receiver;
- }
-
- /// <summary>
- /// Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit,
- /// into a report, against which assertions may be checked.
- /// </summary>
- public void check()
- { }
-
- /// <summary>
- /// Applied a list of assertions against the test circuit. The <see cref="#check()"/> method should be called before doing
- /// this, to ensure that the circuit has gathered its state into a report to assert against.
- /// </summary>
- /// <param name="assertions"> The list of assertions to apply. </param>
- /// <return> Any assertions that failed. </return>
- public IList<Assertion> applyAssertions(List<Assertion> assertions)
- {
- IList<Assertion> failures = new LinkedList<Assertion>();
-
- for (Assertion assertion : assertions)
- {
- if (!assertion.apply())
- {
- failures.add(assertion);
- }
- }
-
- return failures;
- }
-
- /// <summary> Connects and starts the circuit. After this method is called the circuit is ready to send messages. </summary>
- public void start()
- { }
-
- /// <summary> Closes the circuit. All associated resources are closed. </summary>
- public void close()
- {
- try
- {
- publisher.close();
- receiver.close();
- connection.close();
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Got JMSException during close:" + e.getMessage(), e);
- }
- }
-
- /// <summary> Sends a message on the test circuit. The exact nature of the message sent is controlled by the test parameters. </summary>
- protected void send()
- {
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- bool transactional = props.getPublisherTransacted();
- bool rollback = props.getRollbackPublisher();
-
- // Send a message through the publisher and log any exceptions raised.
- try
- {
- CircuitEnd end = getLocalPublisherCircuitEnd();
-
- end.send(createTestMessage(end));
-
- if (rollback)
- {
- end.getSession().rollback();
- }
- else if (transactional)
- {
- end.getSession().commit();
- }
- }
- catch (JMSException e)
- {
- exceptionMonitor.onException(e);
- }
- }
-
- /// <summary>
- /// Runs the default test procedure against the circuit, and checks that all of the specified assertions hold. The
- /// outline of the default test procedure is:
- ///
- /// <p/><pre>
- /// Start the circuit.
- /// Send test messages.
- /// Request a status report.
- /// Assert conditions on the publishing end of the circuit.
- /// Assert conditions on the receiving end of the circuit.
- /// Close the circuit.
- /// Pass with no failed assertions or fail with a list of failed assertions.
- /// </pre>
- /// </summary>
- /// <param name="numMessages"> The number of messages to send using the default test procedure. </param>
- /// <param name="assertions"> The list of assertions to apply. </param>
- /// <return> Any assertions that failed. </return>
- public IList<Assertion> test(int numMessages, List<Assertion> assertions)
- {
- // Start the test circuit.
- start();
-
- // Send the requested number of test messages.
- for (int i = 0; i < numMessages; i++)
- {
- send();
- }
-
- // Inject a short pause to allow time for exceptions to come back asynchronously.
- TestUtils.pause(500L);
-
- // Request a status report.
- check();
-
- // Clean up the publisher/receivers/controlSession/connections.
- close();
-
- // Apply all of the requested assertions, keeping record of any that fail.
- IList<Assertion> failures = applyAssertions(assertions);
-
- // Return any failed assertions to the caller.
- return failures;
- }
-
- /// <summary>
- /// Creates a message with the properties defined as per the test parameters.
- /// </summary>
- /// <param name="client"> The circuit end to create the message on. </param>
- ///
- /// <return> The test message. </return>
- ///
- /// <exception cref="JMSException"> Any JMSException occurring during creation of the message is allowed to fall through. </exception>
- private Message createTestMessage(CircuitEnd client) throws JMSException
- {
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- return TestUtils.createTestMessageOfSize(client.getSession(), props.getMessageSize());
- }
-
- /// <summary>
- /// Gets the exception monitor for the publishing ends connection.
- /// </summary>
- /// <return> The exception monitor for the publishing ends connection. </return>
- public ExceptionMonitor getConnectionExceptionMonitor()
- {
- return connectionExceptionMonitor;
- }
-
- /// <summary>
- /// Gets the exception monitor for the publishing ends controlSession.
- /// </summary>
- /// <return> The exception monitor for the publishing ends controlSession. </return>
- public ExceptionMonitor getExceptionMonitor()
- {
- return exceptionMonitor;
- }
- }
-}
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-using Apache.Qpid.Integration.Tests.framework.*;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.MessageConsumer;
-using javax.jms.MessageProducer;
-using javax.jms.Session;
-
-namespace Apache.Qpid.Integration.Tests.framework.localcircuit
-{
- /// <summary>
- /// Provides an implementation of the <see cref="Publisher"/> interface and wraps a single message producer and consumer on
- /// a single controlSession, as a <see cref="CircuitEnd"/>. A local publisher also acts as a circuit end, because for a locally
- /// located circuit the assertions may be applied directly, there does not need to be any inter-process messaging
- /// between the publisher and its single circuit end, in order to ascertain its status.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide a message producer for sending messages.
- /// <tr><td> Provide a message consumer for receiving messages.
- /// <tr><td> Provide assertion that the publisher received no exceptions.
- /// <tr><td> Provide assertion that the publisher received a no consumers error code.
- /// <tr><td> Provide assertion that the publisher received a no route error code.
- /// </table>
- /// </summary>
- public class LocalPublisherImpl extends CircuitEndBase : Publisher
- {
- /// <summary> Holds a reference to the containing circuit. </summary>
- protected LocalCircuitImpl circuit;
-
- /// <summary>
- /// Creates a circuit end point on the specified producer, consumer and controlSession. Monitors are also configured
- /// for messages and exceptions received by the circuit end.
- /// </summary>
- /// <param name="producer"> The message producer for the circuit end point. </param>
- /// <param name="consumer"> The message consumer for the circuit end point. </param>
- /// <param name="session"> The controlSession for the circuit end point. </param>
- /// <param name="messageMonitor"> The monitor to notify of all messages received by the circuit end. </param>
- /// <param name="exceptionMonitor"> The monitor to notify of all exceptions received by the circuit end. </param>
- public LocalPublisherImpl(MessageProducer producer, MessageConsumer consumer, Session session,
- MessageMonitor messageMonitor, ExceptionMonitor exceptionMonitor)
- {
- super(producer, consumer, session, messageMonitor, exceptionMonitor);
- }
-
- /// <summary>
- /// Creates a circuit end point from the producer, consumer and controlSession in a circuit end base implementation.
- /// </summary>
- /// <param name="end"> The circuit end base implementation to take producers and consumers from. </param>
- public LocalPublisherImpl(CircuitEndBase end)
- {
- super(end.getProducer(), end.getConsumer(), end.getSession(), end.getMessageMonitor(), end.getExceptionMonitor());
- }
-
- /// <summary> Provides an assertion that the publisher encountered no exceptions. </summary>
- ///
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the publisher encountered no exceptions. </return>
- public Assertion noExceptionsAssertion(ParsedProperties testProps)
- {
- return new AssertionBase()
- {
- public bool apply()
- {
- bool passed = true;
- ExceptionMonitor sessionExceptionMonitor = circuit.getExceptionMonitor();
- ExceptionMonitor connectionExceptionMonitor = circuit.getConnectionExceptionMonitor();
-
- if (!connectionExceptionMonitor.assertNoExceptions())
- {
- passed = false;
-
- addError("Was expecting no exceptions.\n");
- addError("Got the following exceptions on the connection, "
- + circuit.getConnectionExceptionMonitor());
- }
-
- if (!sessionExceptionMonitor.assertNoExceptions())
- {
- passed = false;
-
- addError("Was expecting no exceptions.\n");
- addError("Got the following exceptions on the producer, " + circuit.getExceptionMonitor());
- }
-
- return passed;
- }
- };
- }
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- public Assertion channelClosedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Provides an assertion that the publisher got a given exception during the test.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. </param>
- ///
- /// <return> An assertion that the publisher got a given exception during the test. </return>
- public Assertion exceptionAssertion(ParsedProperties testProps, final Class<? extends Exception> exceptionClass)
- {
- return new AssertionBase()
- {
- public bool apply()
- {
- bool passed = true;
- ExceptionMonitor connectionExceptionMonitor = circuit.getConnectionExceptionMonitor();
-
- if (!connectionExceptionMonitor.assertExceptionOfType(exceptionClass))
- {
- passed = false;
-
- addError("Was expecting linked exception type " + exceptionClass.getName()
- + " on the connection.\n");
- addError((connectionExceptionMonitor.size() > 0)
- ? ("Actually got the following exceptions on the connection, " + connectionExceptionMonitor)
- : "Got no exceptions on the connection.");
- }
-
- return passed;
- }
- };
- }
-
- /// <summary>
- /// Sets the contianing circuit.
- /// </summary>
- /// <param name="circuit"> The containing circuit. </param>
- public void setCircuit(LocalCircuitImpl circuit)
- {
- this.circuit = circuit;
- }
- }
-}
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-using Apache.Qpid.Integration.Tests.framework.*;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.MessageConsumer;
-using javax.jms.MessageProducer;
-using javax.jms.Session;
-
-namespace Apache.Qpid.Integration.Tests.framework.localcircuit
-{
- /// <summary>
- /// Provides an implementation of the <see cref="Receiver"/> interface that wraps a single message producer and consumer on
- /// a single controlSession, as a <see cref="CircuitEnd"/>. A local receiver also acts as a circuit end, because for a locally
- /// located circuit the assertions may be applied directly, there does not need to be any inter process messaging
- /// between the publisher and its single circuit end, in order to ascertain its status.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide a message producer for sending messages.
- /// <tr><td> Provide a message consumer for receiving messages.
- /// <tr><td> Provide assertion that the receivers received no exceptions.
- /// <tr><td> Provide assertion that the receivers received all test messages sent to it.
- /// </table>
- /// </summary>
- public class LocalReceiverImpl extends CircuitEndBase : Receiver
- {
- /// <summary> Holds a reference to the containing circuit. </summary>
- private LocalCircuitImpl circuit;
-
- /// <summary>
- /// Creates a circuit end point on the specified producer, consumer and controlSession. Monitors are also configured
- /// for messages and exceptions received by the circuit end.
- /// </summary>
- /// <param name="producer"> The message producer for the circuit end point. </param>
- /// <param name="consumer"> The message consumer for the circuit end point. </param>
- /// <param name="session"> The controlSession for the circuit end point. </param>
- /// <param name="messageMonitor"> The monitor to notify of all messages received by the circuit end. </param>
- /// <param name="exceptionMonitor"> The monitor to notify of all exceptions received by the circuit end. </param>
- public LocalReceiverImpl(MessageProducer producer, MessageConsumer consumer, Session session,
- MessageMonitor messageMonitor, ExceptionMonitor exceptionMonitor)
- {
- super(producer, consumer, session, messageMonitor, exceptionMonitor);
- }
-
- /// <summary>
- /// Creates a circuit end point from the producer, consumer and controlSession in a circuit end base implementation.
- /// </summary>
- /// <param name="end"> The circuit end base implementation to take producers and consumers from. </param>
- public LocalReceiverImpl(CircuitEndBase end)
- {
- super(end.getProducer(), end.getConsumer(), end.getSession(), end.getMessageMonitor(), end.getExceptionMonitor());
- }
-
- /// <summary>
- /// Provides an assertion that the receivers encountered no exceptions.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers encountered no exceptions. </return>
- public Assertion noExceptionsAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- public Assertion channelClosedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Provides an assertion that the receivers got all messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers got all messages that were sent to it. </return>
- public Assertion allMessagesReceivedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Provides an assertion that the receivers got none of the messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers got none of the messages that were sent to it. </return>
- public Assertion noMessagesReceivedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Provides an assertion that the receiver got a given exception during the test.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. <return> An assertion that the receiver got a given exception during the test. </return> </param>
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Sets the contianing circuit.
- /// </summary>
- /// <param name="circuit"> The containing circuit. </param>
- public void setCircuit(LocalCircuitImpl circuit)
- {
- this.circuit = circuit;
- }
- }
-}
-/*
- *
- * 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 log4net;
-
-using Apache.Qpid.Integration.Tests.framework.localcircuit.LocalCircuitImpl;
-using Apache.Qpid.Integration.Tests.framework.localcircuit.LocalPublisherImpl;
-using Apache.Qpid.Integration.Tests.framework.localcircuit.LocalReceiverImpl;
-using Apache.Qpid.Integration.Tests.framework.sequencers.CircuitFactory;
-using org.apache.qpid.util.ConversationFactory;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.*;
-
-using System.Collections.Generic.IList;
-using java.util.Properties;
-using java.util.concurrent.atomic.AtomicLong;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// LocalCircuitFactory is a circuit factory that creates test circuits with publishing and receiving ends rooted
- /// on the same JVM. The ends of the circuit are presented as <see cref="Publisher"/> and <see cref="Receiver"/> interfaces, which
- /// in turn provide methods to apply assertions to the circuit. The creation of the circuit ends, and the presentation
- /// of the ends as publisher/receiver interfaces, are designed to be overriden, so that circuits and assertions that
- /// use messaging features not available in JMS can be written. This provides an extension point for writing tests
- /// against proprietary features of JMS implementations.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide a standard test procedure over a test circuit.
- /// <tr><td> Construct test circuits appropriate to a tests context.
- /// </table>
- /// </summary>
- public class LocalCircuitFactory : CircuitFactory
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(LocalCircuitFactory));
-
- /// <summary> Used to create unique destination names for each test. </summary>
- protected static AtomicLong uniqueDestsId = new AtomicLong();
-
- /// <summary>
- /// Holds a test coordinating conversation with the test clients. This should consist of assigning the test roles,
- /// begining the test and gathering the test reports from the participants.
- /// </summary>
- /// <param name="testCircuit"> The test circuit. </param>
- /// <param name="assertions"> The list of assertions to apply to the test circuit. </param>
- /// <param name="testProperties"> The test case definition. </param>
- public void sequenceTest(Circuit testCircuit, IList<Assertion> assertions, Properties testProperties)
- {
- FrameworkBaseCase.assertNoFailures(testCircuit.test(1, assertions));
- }
-
- /// <summary>
- /// Creates a test circuit for the test, configered by the test parameters specified.
- /// </summary>
- /// <param name="testProperties"> The test parameters. </param>
- ///
- /// <return> A test circuit. </return>
- public Circuit createCircuit(ParsedProperties testProperties)
- {
- Circuit result;
-
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProperties);
-
- // Create a standard publisher/receivers test client pair on a shared connection, individual sessions.
- try
- {
- // Get a unique offset to append to destination names to make them unique to the connection.
- long uniqueId = uniqueDestsId.incrementAndGet();
-
- // Set up the connection.
- Connection connection = TestUtils.createConnection(testProperties);
-
- // Add the connection exception listener to assert on exception conditions with.
- // ExceptionMonitor exceptionMonitor = new ExceptionMonitor();
- // connection.setExceptionListener(exceptionMonitor);
-
- // Set up the publisher.
- CircuitEndBase publisherEnd = createPublisherCircuitEnd(connection, props, uniqueId);
-
- // Set up the receiver.
- CircuitEndBase receiverEnd = createReceiverCircuitEnd(connection, props, uniqueId);
-
- // Start listening for incoming messages.
- connection.start();
-
- // Namespace everything up.
- LocalPublisherImpl publisher = createPublisherFromCircuitEnd(publisherEnd);
- LocalReceiverImpl receiver = createReceiverFromCircuitEnd(receiverEnd);
-
- result = new LocalCircuitImpl(testProperties, publisher, receiver, connection, publisher.getExceptionMonitor());
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Could not create publisher/receivers pair due to a JMSException.", e);
- }
-
- return result;
- }
-
- /// <summary>
- /// Creates a local <see cref="Receiver"/> from a <see cref="CircuitEnd"/>. Sub-classes may override this to provide more
- /// specialized receivers if necessary.
- /// </summary>
- /// <param name="receiverEnd"> The receiving circuit end. </param>
- ///
- /// <return> A <see cref="Receiver"/>. </return>
- protected LocalReceiverImpl createReceiverFromCircuitEnd(CircuitEndBase receiverEnd)
- {
- return new LocalReceiverImpl(receiverEnd);
- }
-
- /// <summary>
- /// Creates a local <see cref="Publisher"/> from a <see cref="CircuitEnd"/>. Sub-classes may override this to provide more
- /// specialized receivers if necessary.
- /// </summary>
- /// <param name="publisherEnd"> The publishing circuit end. </param>
- ///
- /// <return> A <see cref="Receiver"/>. </return>
- protected LocalPublisherImpl createPublisherFromCircuitEnd(CircuitEndBase publisherEnd)
- {
- return new LocalPublisherImpl(publisherEnd);
- }
-
- /// <summary>
- /// Builds a circuit end suitable for the publishing side of a test circuit, from standard test parameters.
- /// </summary>
- /// <param name="connection"> The connection to build the circuit end on. </param>
- /// <param name="testProps"> The test parameters to configure the circuit end construction. </param>
- /// <param name="uniqueId"> A unique number to being numbering destinations from, to make this circuit unique. </param>
- ///
- /// <return> A circuit end suitable for the publishing side of a test circuit. </return>
- ///
- /// <exception cref="JMSException"> Any underlying JMSExceptions are allowed to fall through and fail the creation. </exception>
- public CircuitEndBase createPublisherCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId)
- throws JMSException
- {
- log.debug(
- "public CircuitEndBase createPublisherCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId = "
- + uniqueId + "): called");
-
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- // Check that the test properties do not contain AMQP/Qpid specific settings, and fail if they do.
- if (props.getImmediate() || props.getMandatory())
- {
- throw new RuntimeException(
- "Cannot create a pure JMS circuit as the test properties require AMQP specific options.");
- }
-
- Session session = connection.createSession(props.getPublisherTransacted(), props.getAckMode());
-
- Destination destination =
- props.getPubsub() ? session.createTopic(props.getSendDestinationNameRoot() + "_" + uniqueId)
- : session.createQueue(props.getSendDestinationNameRoot() + "_" + uniqueId);
-
- MessageProducer producer = props.getPublisherProducerBind() ? session.createProducer(destination) : null;
-
- MessageConsumer consumer =
- props.getPublisherConsumerBind()
- ? session.createConsumer(session.createQueue(props.getReceiveDestinationNameRoot() + "_" + uniqueId)) : null;
-
- MessageMonitor messageMonitor = new MessageMonitor();
-
- if (consumer != null)
- {
- consumer.setMessageListener(messageMonitor);
- }
-
- ExceptionMonitor exceptionMonitor = new ExceptionMonitor();
- connection.setExceptionListener(exceptionMonitor);
-
- if (!props.getPublisherConsumerActive() && (consumer != null))
- {
- consumer.close();
- }
-
- return new CircuitEndBase(producer, consumer, session, messageMonitor, exceptionMonitor);
- }
-
- /// <summary>
- /// Builds a circuit end suitable for the receiving side of a test circuit, from standard test parameters.
- /// </summary>
- /// <param name="connection"> The connection to build the circuit end on. </param>
- /// <param name="testProps"> The test parameters to configure the circuit end construction. </param>
- /// <param name="uniqueId"> A unique number to being numbering destinations from, to make this circuit unique. </param>
- ///
- /// <return> A circuit end suitable for the receiving side of a test circuit. </return>
- ///
- /// <exception cref="JMSException"> Any underlying JMSExceptions are allowed to fall through and fail the creation. </exception>
- public CircuitEndBase createReceiverCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId)
- throws JMSException
- {
- log.debug(
- "public CircuitEndBase createReceiverCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId = "
- + uniqueId + "): called");
-
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- // Check that the test properties do not contain AMQP/Qpid specific settings, and fail if they do.
- if (props.getImmediate() || props.getMandatory())
- {
- throw new RuntimeException(
- "Cannot create a pure JMS circuit as the test properties require AMQP specific options.");
- }
-
- Session session = connection.createSession(props.getPublisherTransacted(), props.getAckMode());
-
- MessageProducer producer =
- props.getReceiverProducerBind()
- ? session.createProducer(session.createQueue(props.getReceiveDestinationNameRoot() + "_" + uniqueId)) : null;
-
- Destination destination =
- props.getPubsub() ? session.createTopic(props.getSendDestinationNameRoot() + "_" + uniqueId)
- : session.createQueue(props.getSendDestinationNameRoot() + "_" + uniqueId);
-
- MessageConsumer consumer =
- props.getReceiverConsumerBind()
- ? ((props.getDurableSubscription() && props.getPubsub())
- ? session.createDurableSubscriber((Topic) destination, "testsub") : session.createConsumer(destination))
- : null;
-
- MessageMonitor messageMonitor = new MessageMonitor();
-
- if (consumer != null)
- {
- consumer.setMessageListener(messageMonitor);
- }
-
- if (!props.getReceiverConsumerActive() && (consumer != null))
- {
- consumer.close();
- }
-
- return new CircuitEndBase(producer, consumer, session, messageMonitor, null);
- }
-
- /// <summary>
- /// Sets the sender test client to coordinate the test with.
- /// </summary>
- /// <param name="sender"> The contact details of the sending client in the test. </param>
- public void setSender(TestClientDetails sender)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Sets the receiving test client to coordinate the test with.
- /// </summary>
- /// <param name="receiver"> The contact details of the sending client in the test. </param>
- public void setReceiver(TestClientDetails receiver)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Supplies the sending test client.
- /// </summary>
- /// <return> The sending test client. </return>
- public TestClientDetails getSender()
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Supplies the receiving test client.
- /// </summary>
- /// <return> The receiving test client. </return>
- public IList<TestClientDetails> getReceivers()
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Accepts the conversation factory over which to hold the test coordinating conversation.
- /// </summary>
- /// <param name="conversationFactory"> The conversation factory to coordinate the test over. </param>
- public void setConversationFactory(ConversationFactory conversationFactory)
- {
- throw new RuntimeException("Not implemented.");
- }
- }
-}
-/*
- *
- * 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.Integration.Tests.framework
-{
- /// <summary>
- /// MessageIdentityVector provides a message identification scheme, that matches individual messages with test cases.
- /// Test messages are being sent by a number of test clients, sending messages over a set of routes, and being received
- /// by another set of test clients. Each test is itself, being run within a test cycle, of which there could be many. It
- /// is the job of the test coordinator to request and receive reports from the available test clients, on what has been
- /// sent, what has been received, and what errors may have occurred, and to reconcile this information against the
- /// assertions being applied by the test case. In order to be able to figure out which messages belong to which test,
- /// there needs to be an identification scheme, that the coordinator can use to correlate messages in senders and
- /// receiver reports. Every message sent in a test can be associated with this information.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Identify a test case, a handling client id, a circuit end within the client, and a test cycle number.
- /// </table>
- /// </summary>
- public class MessageIdentityVector
- {
- /// <summary> Holds the test case vector component of the message identity vector. </summary>
- private TestCaseVector testCaseVector;
-
- /// <summary> The unique client id. </summary>
- private string clientId;
-
- /// <summary> The unique circuit end number within the client id. </summary>
- private int circuitEndId;
-
- /// <summary>
- /// Creates a new identity vector for test messages.
- /// </summary>
- /// <param name="testCase"> The name of the test case generating the messages. </param>
- /// <param name="clientId"> The unique id of the client implementing a circuit end that is handling the messages. </param>
- /// <param name="circuitEndId"> The unique id number of the circuit end within the client. </param>
- /// <param name="testCycleNumber"> The cycle iteration number of the test case. </param>
- public MessageIdentityVector(string testCase, string clientId, int circuitEndId, int testCycleNumber)
- {
- this.testCaseVector = new TestCaseVector(testCase, testCycleNumber);
- this.clientId = clientId;
- this.circuitEndId = circuitEndId;
- }
-
- /// <summary>
- /// Reports the test case vector component of the message identity vector.
- /// </summary>
- /// <return> The test case vector component of the message identity vector. </return>
- public TestCaseVector getTestCaseVector()
- {
- return testCaseVector;
- }
-
- /// <summary>
- /// Reports the name of the test case.
- /// </summary>
- /// <return> The name of the test case. </return>
- public string getTestCase()
- {
- return testCaseVector.getTestCase();
- }
-
- /// <summary>
- /// Reports the test iteration cycle number within the test case.
- /// </summary>
- /// <return> The test iteration cycle number within the test case. </return>
- public int getTestCycleNumber()
- {
- return testCaseVector.getTestCycleNumber();
- }
-
- /// <summary>
- /// Resports the client id.
- /// </summary>
- /// <return> The client id. </return>
- public string getClientId()
- {
- return clientId;
- }
-
- /// <summary>
- /// Reports the circuit end number within the test client.
- /// </summary>
- /// <return> The circuit end number within the test client. </return>
- public int getCircuitEndId()
- {
- return circuitEndId;
- }
-
- /// <summary>
- /// Compares this identity vector with another for equality. All fields must match.
- /// </summary>
- /// <param name="o"> The identity vector to compare with. </param>
- ///
- /// <return> <tt>true</tt> if the identity vector is identical to this one by all fields, <tt>false</tt> otherwise. </return>
- public bool equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
-
- if ((o == null) || (getClass() != o.getClass()))
- {
- return false;
- }
-
- MessageIdentityVector that = (MessageIdentityVector) o;
-
- if (circuitEndId != that.circuitEndId)
- {
- return false;
- }
-
- if ((clientId != null) ? (!clientId.equals(that.clientId)) : (that.clientId != null))
- {
- return false;
- }
-
- if ((testCaseVector != null) ? (!testCaseVector.equals(that.testCaseVector)) : (that.testCaseVector != null))
- {
- return false;
- }
-
- return true;
- }
-
- /// <summary>
- /// Computes a hash code for this identity vector based on all fields.
- /// </summary>
- /// <return> A hash code for this identity vector based on all fields. </return>
- public int hashCode()
- {
- int result;
- result = ((testCaseVector != null) ? testCaseVector.hashCode() : 0);
- result = (31 * result) + ((clientId != null) ? clientId.hashCode() : 0);
- result = (31 * result) + circuitEndId;
-
- return result;
- }
- }
-}
-/*
- *
- * 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 log4net;
-
-using javax.jms.Message;
-using javax.jms.MessageListener;
-
-using java.util.concurrent.atomic.AtomicInteger;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// MessageMonitor is used to record information about messages received. This will provide methods to check various
- /// properties, such as the type, number and content of messages received in order to verify the correct behaviour of
- /// tests.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Count incoming messages.
- /// <tr><td> Record time ellapsed since the arrival of the first message.
- /// <tr><td> Reset all counts and timings.
- /// </table>
- /// </summary>
- public class MessageMonitor : MessageListener
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(MessageMonitor));
-
- /// <summary> Holds the count of messages received since the last query. </summary>
- protected AtomicInteger numMessages = new AtomicInteger();
-
- /// <summary> Holds the time of arrival of the first message. </summary>
- protected Long firstMessageTime = null;
-
- /// <summary>
- /// Handles received messages. Does Nothing.
- /// </summary>
- /// <param name="message"> The message. Ignored. </param>
- public void onMessage(Message message)
- {
- // log.debug("public void onMessage(Message message): called");
-
- numMessages.getAndIncrement();
- }
-
- /// <summary>
- /// Gets the count of messages.
- /// </summary>
- /// <return> The count of messages. </return>
- public int getNumMessage()
- {
- if (firstMessageTime == null)
- {
- firstMessageTime = System.nanoTime();
- }
-
- return numMessages.get();
- }
-
- /// <summary>
- /// Gets the time elapsed since the first message arrived, in nanos, or zero if no messages have arrived yet.
- /// </summary>
- /// <return> The time elapsed since the first message arrived, in nanos, or zero if no messages have arrived yet. </return>
- public long getTime()
- {
- if (firstMessageTime != null)
- {
- return System.nanoTime() - firstMessageTime;
- }
- else
- {
- return 0L;
- }
- }
-
- /// <summary> Resets the message count and timer to zero. </summary>
- public void reset()
- {
- numMessages.set(0);
- firstMessageTime = null;
- }
- }
-}
-/*
- *
- * 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 uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.Session;
-
-using java.util.Properties;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// MessagingTestConfigProperties defines a set of property names and default values for specifying a messaging topology,
- /// and test parameters for running a messaging test over that topology. A Properties object holding some of these
- /// properties, superimposed onto the defaults, is used to establish test topologies and control test behaviour.
- ///
- /// <p/>A complete list of the parameters, default values and comments on their usage is provided here:
- ///
- /// <p/><table><caption>Parameters</caption>
- /// <tr><th> Parameter <th> Default <th> Comments
- /// <tr><td> messageSize <td> 0 <td> Message size in bytes. Not including any headers.
- /// <tr><td> destinationName <td> ping <td> The root name to use to generate destination names to ping.
- /// <tr><td> persistent <td> false <td> Determines whether peristent delivery is used.
- /// <tr><td> transacted <td> false <td> Determines whether messages are sent/received in transactions.
- /// <tr><td> broker <td> tcp://localhost:5672 <td> Determines the broker to connect to.
- /// <tr><td> virtualHost <td> test <td> Determines the virtual host to send all ping over.
- /// <tr><td> rate <td> 0 <td> The maximum rate (in hertz) to send messages at. 0 means no limit.
- /// <tr><td> verbose <td> false <td> The verbose flag for debugging. Prints to console on every message.
- /// <tr><td> pubsub <td> false <td> Whether to ping topics or queues. Uses p2p by default.
- /// <tr><td> username <td> guest <td> The username to access the broker with.
- /// <tr><td> password <td> guest <td> The password to access the broker with.
- /// <tr><td> selector <td> null <td> Not used. Defines a message selector to filter pings with.
- /// <tr><td> destinationCount <td> 1 <td> The number of receivers listening to the pings.
- /// <tr><td> timeout <td> 30000 <td> In milliseconds. The timeout to stop waiting for replies.
- /// <tr><td> commitBatchSize <td> 1 <td> The number of messages per transaction in transactional mode.
- /// <tr><td> uniqueDests <td> true <td> Whether each receivers only listens to one ping destination or all.
- /// <tr><td> durableDests <td> false <td> Whether or not durable destinations are used.
- /// <tr><td> ackMode <td> AUTO_ACK <td> The message acknowledgement mode. Possible values are:
- /// 0 - SESSION_TRANSACTED
- /// 1 - AUTO_ACKNOWLEDGE
- /// 2 - CLIENT_ACKNOWLEDGE
- /// 3 - DUPS_OK_ACKNOWLEDGE
- /// 257 - NO_ACKNOWLEDGE
- /// 258 - PRE_ACKNOWLEDGE
- /// <tr><td> maxPending <td> 0 <td> The maximum size in bytes, of messages sent but not yet received.
- /// Limits the volume of messages currently buffered on the client
- /// or broker. Can help scale test clients by limiting amount of buffered
- /// data to avoid out of memory errors.
- /// </table>
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide the names and defaults of all test parameters.
- /// </table>
- /// </summary>
- ///
- /// <remarks> Put a type-safe wrapper around these properties, but continue to store the parameters as properties. This is
- /// simply to ensure that it is a simple matter to serialize/deserialize string/string pairs onto messages.</remarks>
- public class MessagingTestConfigProperties extends ParsedProperties
- {
- // ====================== Connection Properties ==================================
-
- /// <summary> Holds the name of the default connection configuration. </summary>
- public static final string CONNECTION_NAME = "broker";
-
- /// <summary> Holds the name of the property to get the initial context factory name from. </summary>
- public static final string INITIAL_CONTEXT_FACTORY_PROPNAME = "java.naming.factory.initial";
-
- /// <summary> Defines the class to use as the initial context factory by default. </summary>
- public static final string INITIAL_CONTEXT_FACTORY_DEFAULT = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
-
- /// <summary> Holds the name of the property to get the test broker url from. </summary>
- public static final string BROKER_PROPNAME = "qpid.test.broker";
-
- /// <summary> Holds the default broker url for the test. </summary>
- public static final string BROKER_DEFAULT = "vm://:1";
-
- /// <summary> Holds the name of the property to get the test broker virtual path. </summary>
- public static final string VIRTUAL_HOST_PROPNAME = "virtualHost";
-
- /// <summary> Holds the default virtual path for the test. </summary>
- public static final string VIRTUAL_HOST_DEFAULT = "";
-
- /// <summary> Holds the name of the property to get the broker access username from. </summary>
- public static final string USERNAME_PROPNAME = "username";
-
- /// <summary> Holds the default broker log on username. </summary>
- public static final string USERNAME_DEFAULT = "guest";
-
- /// <summary> Holds the name of the property to get the broker access password from. </summary>
- public static final string PASSWORD_PROPNAME = "password";
-
- /// <summary> Holds the default broker log on password. </summary>
- public static final string PASSWORD_DEFAULT = "guest";
-
- // ====================== Messaging Topology Properties ==========================
-
- /// <summary> Holds the name of the property to get the bind publisher procuder flag from. </summary>
- public static final string PUBLISHER_PRODUCER_BIND_PROPNAME = "publisherProducerBind";
-
- /// <summary> Holds the default value of the publisher producer flag. </summary>
- public static final bool PUBLISHER_PRODUCER_BIND_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the bind publisher procuder flag from. </summary>
- public static final string PUBLISHER_CONSUMER_BIND_PROPNAME = "publisherConsumerBind";
-
- /// <summary> Holds the default value of the publisher consumer flag. </summary>
- public static final bool PUBLISHER_CONSUMER_BIND_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the bind receivers procuder flag from. </summary>
- public static final string RECEIVER_PRODUCER_BIND_PROPNAME = "receiverProducerBind";
-
- /// <summary> Holds the default value of the receivers producer flag. </summary>
- public static final bool RECEIVER_PRODUCER_BIND_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the bind receivers procuder flag from. </summary>
- public static final string RECEIVER_CONSUMER_BIND_PROPNAME = "receiverConsumerBind";
-
- /// <summary> Holds the default value of the receivers consumer flag. </summary>
- public static final bool RECEIVER_CONSUMER_BIND_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the publishers consumer active flag from. </summary>
- public static final string PUBLISHER_CONSUMER_ACTIVE_PROPNAME = "publisherConsumerActive";
-
- /// <summary> Holds the default value of the publishers consumer active flag. </summary>
- public static final bool PUBLISHER_CONSUMER_ACTIVE_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the receivers consumer active flag from. </summary>
- public static final string RECEIVER_CONSUMER_ACTIVE_PROPNAME = "receiverConsumerActive";
-
- /// <summary> Holds the default value of the receivers consumer active flag. </summary>
- public static final bool RECEIVER_CONSUMER_ACTIVE_DEFAULT = true;
-
- /// <summary> Holds the name of the property to get the destination name root from. </summary>
- public static final string SEND_DESTINATION_NAME_ROOT_PROPNAME = "sendDestinationRoot";
-
- /// <summary> Holds the root of the name of the default destination to send to. </summary>
- public static final string SEND_DESTINATION_NAME_ROOT_DEFAULT = "sendTo";
-
- /// <summary> Holds the name of the property to get the destination name root from. </summary>
- public static final string RECEIVE_DESTINATION_NAME_ROOT_PROPNAME = "receiveDestinationRoot";
-
- /// <summary> Holds the root of the name of the default destination to send to. </summary>
- public static final string RECEIVE_DESTINATION_NAME_ROOT_DEFAULT = "receiveFrom";
-
- /// <summary> Holds the name of the proeprty to get the destination count from. </summary>
- public static final string DESTINATION_COUNT_PROPNAME = "destinationCount";
-
- /// <summary> Defines the default number of destinations to ping. </summary>
- public static final int DESTINATION_COUNT_DEFAULT = 1;
-
- /// <summary> Holds the name of the property to get the p2p or pub/sub messaging mode from. </summary>
- public static final string PUBSUB_PROPNAME = "pubsub";
-
- /// <summary> Holds the pub/sub mode default, true means ping a topic, false means ping a queue. </summary>
- public static final bool PUBSUB_DEFAULT = false;
-
- // ====================== JMS Options and Flags =================================
-
- /// <summary> Holds the name of the property to get the test delivery mode from. </summary>
- public static final string PERSISTENT_MODE_PROPNAME = "persistent";
-
- /// <summary> Holds the message delivery mode to use for the test. </summary>
- public static final bool PERSISTENT_MODE_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the test transactional mode from. </summary>
- public static final string TRANSACTED_PUBLISHER_PROPNAME = "transactedPublisher";
-
- /// <summary> Holds the transactional mode to use for the test. </summary>
- public static final bool TRANSACTED_PUBLISHER_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the test transactional mode from. </summary>
- public static final string TRANSACTED_RECEIVER_PROPNAME = "transactedReceiver";
-
- /// <summary> Holds the transactional mode to use for the test. </summary>
- public static final bool TRANSACTED_RECEIVER_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the no local flag from. </summary>
- public static final string NO_LOCAL_PROPNAME = "noLocal";
-
- /// <summary> Defines the default value of the no local flag to use when consuming messages. </summary>
- public static final bool NO_LOCAL_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the message acknowledgement mode from. </summary>
- public static final string ACK_MODE_PROPNAME = "ackMode";
-
- /// <summary> Defines the default message acknowledgement mode. </summary>
- public static final int ACK_MODE_DEFAULT = Session.AUTO_ACKNOWLEDGE;
-
- /// <summary> Holds the name of the property to get the durable subscriptions flag from, when doing pub/sub messaging. </summary>
- public static final string DURABLE_SUBSCRIPTION_PROPNAME = "durableSubscription";
-
- /// <summary> Defines the default value of the durable subscriptions flag. </summary>
- public static final bool DURABLE_SUBSCRIPTION_DEFAULT = false;
-
- // ====================== Qpid/AMQP Options and Flags ================================
-
- /// <summary> Holds the name of the property to set the exclusive flag from. </summary>
- public static final string EXCLUSIVE_PROPNAME = "exclusive";
-
- /// <summary> Defines the default value of the exclusive flag to use when consuming messages. </summary>
- public static final bool EXCLUSIVE_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the immediate flag from. </summary>
- public static final string IMMEDIATE_PROPNAME = "immediate";
-
- /// <summary> Defines the default value of the immediate flag to use when sending messages. </summary>
- public static final bool IMMEDIATE_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the mandatory flag from. </summary>
- public static final string MANDATORY_PROPNAME = "mandatory";
-
- /// <summary> Defines the default value of the mandatory flag to use when sending messages. </summary>
- public static final bool MANDATORY_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the durable destinations flag from. </summary>
- public static final string DURABLE_DESTS_PROPNAME = "durableDests";
-
- /// <summary> Default value for the durable destinations flag. </summary>
- public static final bool DURABLE_DESTS_DEFAULT = false;
-
- /// <summary> Holds the name of the property to set the prefetch size from. </summary>
- public static final string PREFETCH_PROPNAME = "prefetch";
-
- /// <summary> Defines the default prefetch size to use when consuming messages. </summary>
- public static final int PREFETCH_DEFAULT = 100;
-
- // ====================== Common Test Parameters ================================
-
- /// <summary> Holds the name of the property to get the test message size from. </summary>
- public static final string MESSAGE_SIZE_PROPNAME = "messageSize";
-
- /// <summary> Used to set up a default message size. </summary>
- public static final int MESSAGE_SIZE_DEAFULT = 0;
-
- /// <summary> Holds the name of the property to get the message rate from. </summary>
- public static final string RATE_PROPNAME = "rate";
-
- /// <summary> Defines the default rate (in pings per second) to send pings at. 0 means as fast as possible, no restriction. </summary>
- public static final int RATE_DEFAULT = 0;
-
- /// <summary> Holds the name of the proeprty to get the. </summary>
- public static final string SELECTOR_PROPNAME = "selector";
-
- /// <summary> Holds the default message selector. </summary>
- public static final string SELECTOR_DEFAULT = "";
-
- /// <summary> Holds the name of the property to get the waiting timeout for response messages. </summary>
- public static final string TIMEOUT_PROPNAME = "timeout";
-
- /// <summary> Default time to wait before assuming that a ping has timed out. </summary>
- public static final long TIMEOUT_DEFAULT = 30000;
-
- /// <summary> Holds the name of the property to get the commit batch size from. </summary>
- public static final string TX_BATCH_SIZE_PROPNAME = "commitBatchSize";
-
- /// <summary> Defines the default number of pings to send in each transaction when running transactionally. </summary>
- public static final int TX_BATCH_SIZE_DEFAULT = 1;
-
- /// <summary> Holds the name of the property to set the maximum amount of pending message data for a producer to hold. </summary>
- public static final string MAX_PENDING_PROPNAME = "maxPending";
-
- /// <summary> Defines the default maximum quantity of pending message data to allow producers to hold. </summary>
- public static final int MAX_PENDING_DEFAULT = 0;
-
- /// <summary> Holds the name of the property to get the publisher rollback flag from. </summary>
- public static final string ROLLBACK_PUBLISHER_PROPNAME = "rollbackPublisher";
-
- /// <summary> Holds the default publisher roll back setting. </summary>
- public static final bool ROLLBACK_PUBLISHER_DEFAULT = false;
-
- /// <summary> Holds the name of the property to get the publisher rollback flag from. </summary>
- public static final string ROLLBACK_RECEIVER_PROPNAME = "rollbackReceiver";
-
- /// <summary> Holds the default publisher roll back setting. </summary>
- public static final bool ROLLBACK_RECEIVER_DEFAULT = false;
-
- // ====================== Options that control the bahviour of the test framework. =========================
-
- /// <summary> Holds the name of the property to get the behavioural mode of not applicable assertions. </summary>
- public static final string NOT_APPLICABLE_ASSERTION_PROPNAME = "notApplicableAssertion";
-
- /// <summary> Holds the default behavioral mode of not applicable assertions, which is logging them as a warning. </summary>
- public static final string NOT_APPLICABLE_ASSERTION_DEFAULT = "warn";
-
- /// <summary> Holds the name of the property to get the verbose mode proeprty from. </summary>
- public static final string VERBOSE_PROPNAME = "verbose";
-
- /// <summary> Holds the default verbose mode. </summary>
- public static final bool VERBOSE_DEFAULT = false;
-
- /// <summary> Holds the default configuration properties. </summary>
- public static ParsedProperties defaults = new ParsedProperties();
-
- static
- {
- defaults.setPropertyIfNull(INITIAL_CONTEXT_FACTORY_PROPNAME, INITIAL_CONTEXT_FACTORY_DEFAULT);
- defaults.setPropertyIfNull(BROKER_PROPNAME, BROKER_DEFAULT);
- defaults.setPropertyIfNull(VIRTUAL_HOST_PROPNAME, VIRTUAL_HOST_DEFAULT);
- defaults.setPropertyIfNull(USERNAME_PROPNAME, USERNAME_DEFAULT);
- defaults.setPropertyIfNull(PASSWORD_PROPNAME, PASSWORD_DEFAULT);
-
- defaults.setPropertyIfNull(PUBLISHER_PRODUCER_BIND_PROPNAME, PUBLISHER_PRODUCER_BIND_DEFAULT);
- defaults.setPropertyIfNull(PUBLISHER_CONSUMER_BIND_PROPNAME, PUBLISHER_CONSUMER_BIND_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_PRODUCER_BIND_PROPNAME, RECEIVER_PRODUCER_BIND_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_CONSUMER_BIND_PROPNAME, RECEIVER_CONSUMER_BIND_DEFAULT);
- defaults.setPropertyIfNull(PUBLISHER_CONSUMER_ACTIVE_PROPNAME, PUBLISHER_CONSUMER_ACTIVE_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_CONSUMER_ACTIVE_PROPNAME, RECEIVER_CONSUMER_ACTIVE_DEFAULT);
- defaults.setPropertyIfNull(SEND_DESTINATION_NAME_ROOT_PROPNAME, SEND_DESTINATION_NAME_ROOT_DEFAULT);
- defaults.setPropertyIfNull(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME, RECEIVE_DESTINATION_NAME_ROOT_DEFAULT);
- defaults.setPropertyIfNull(DESTINATION_COUNT_PROPNAME, DESTINATION_COUNT_DEFAULT);
- defaults.setPropertyIfNull(PUBSUB_PROPNAME, PUBSUB_DEFAULT);
-
- defaults.setPropertyIfNull(PERSISTENT_MODE_PROPNAME, PERSISTENT_MODE_DEFAULT);
- defaults.setPropertyIfNull(TRANSACTED_PUBLISHER_PROPNAME, TRANSACTED_PUBLISHER_DEFAULT);
- defaults.setPropertyIfNull(TRANSACTED_RECEIVER_PROPNAME, TRANSACTED_RECEIVER_DEFAULT);
- defaults.setPropertyIfNull(NO_LOCAL_PROPNAME, NO_LOCAL_DEFAULT);
- defaults.setPropertyIfNull(ACK_MODE_PROPNAME, ACK_MODE_DEFAULT);
- defaults.setPropertyIfNull(DURABLE_SUBSCRIPTION_PROPNAME, DURABLE_SUBSCRIPTION_DEFAULT);
-
- defaults.setPropertyIfNull(EXCLUSIVE_PROPNAME, EXCLUSIVE_DEFAULT);
- defaults.setPropertyIfNull(IMMEDIATE_PROPNAME, IMMEDIATE_DEFAULT);
- defaults.setPropertyIfNull(MANDATORY_PROPNAME, MANDATORY_DEFAULT);
- defaults.setPropertyIfNull(DURABLE_DESTS_PROPNAME, DURABLE_DESTS_DEFAULT);
- defaults.setPropertyIfNull(PREFETCH_PROPNAME, PREFETCH_DEFAULT);
-
- defaults.setPropertyIfNull(MESSAGE_SIZE_PROPNAME, MESSAGE_SIZE_DEAFULT);
- defaults.setPropertyIfNull(RATE_PROPNAME, RATE_DEFAULT);
- defaults.setPropertyIfNull(SELECTOR_PROPNAME, SELECTOR_DEFAULT);
- defaults.setPropertyIfNull(TIMEOUT_PROPNAME, TIMEOUT_DEFAULT);
- defaults.setPropertyIfNull(TX_BATCH_SIZE_PROPNAME, TX_BATCH_SIZE_DEFAULT);
- defaults.setPropertyIfNull(MAX_PENDING_PROPNAME, MAX_PENDING_DEFAULT);
- defaults.setPropertyIfNull(ROLLBACK_PUBLISHER_PROPNAME, ROLLBACK_PUBLISHER_DEFAULT);
- defaults.setPropertyIfNull(ROLLBACK_RECEIVER_PROPNAME, ROLLBACK_RECEIVER_DEFAULT);
-
- defaults.setPropertyIfNull(NOT_APPLICABLE_ASSERTION_PROPNAME, NOT_APPLICABLE_ASSERTION_DEFAULT);
- defaults.setPropertyIfNull(VERBOSE_PROPNAME, VERBOSE_DEFAULT);
- }
-
- /// <summary> Creates a test configuration based on the defaults. </summary>
- public MessagingTestConfigProperties()
- {
- super(defaults);
- }
-
- /// <summary>
- /// Creates a test configuration based on the supplied properties.
- /// </summary>
- /// <param name="properties"> The test configuration. </param>
- public MessagingTestConfigProperties(Properties properties)
- {
- super(properties);
- }
-
- /// <summary>
- /// The size of test messages to send.
- /// </summary>
- /// <return> The size of test messages to send. </return>
- public int getMessageSize()
- {
- return getPropertyAsInteger(MESSAGE_SIZE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the publishing producer should be set up to publish to a destination.
- /// </summary>
- /// <return> Flag to indicate that the publishing producer should be set up to publish to a destination. </return>
- public bool getPublisherProducerBind()
- {
- return getPropertyAsBoolean(PUBLISHER_PRODUCER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the publishing consumer should be set up to receive from a destination.
- /// </summary>
- /// <return> Flag to indicate that the publishing consumer should be set up to receive from a destination. </return>
- public bool getPublisherConsumerBind()
- {
- return getPropertyAsBoolean(PUBLISHER_CONSUMER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the receiving producer should be set up to publish to a destination.
- /// </summary>
- /// <return> Flag to indicate that the receiving producer should be set up to publish to a destination. </return>
- public bool getReceiverProducerBind()
- {
- return getPropertyAsBoolean(RECEIVER_PRODUCER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the receiving consumer should be set up to receive from a destination.
- /// </summary>
- /// <return> Flag to indicate that the receiving consumer should be set up to receive from a destination. </return>
- public bool getReceiverConsumerBind()
- {
- return getPropertyAsBoolean(RECEIVER_CONSUMER_BIND_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the publishing consumer should be created and actively listening.
- /// </summary>
- /// <return> Flag to indicate that the publishing consumer should be created. </return>
- public bool getPublisherConsumerActive()
- {
- return getPropertyAsBoolean(PUBLISHER_CONSUMER_ACTIVE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that the receiving consumers should be created and actively listening.
- /// </summary>
- /// <return> Flag to indicate that the receiving consumers should be created and actively listening. </return>
- public bool getReceiverConsumerActive()
- {
- return getPropertyAsBoolean(RECEIVER_CONSUMER_ACTIVE_PROPNAME);
- }
-
- /// <summary>
- /// A root to create all test destination names from.
- /// </summary>
- /// <return> A root to create all test destination names from. </return>
- public string getSendDestinationNameRoot()
- {
- return getProperty(SEND_DESTINATION_NAME_ROOT_PROPNAME);
- }
-
- /// <summary>
- /// A root to create all receiving destination names from.
- /// </summary>
- /// <return> A root to create all receiving destination names from. </return>
- public string getReceiveDestinationNameRoot()
- {
- return getProperty(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that persistent messages should be used.
- /// </summary>
- /// <return> Flag to indicate that persistent messages should be used. </return>
- public bool getPersistentMode()
- {
- return getPropertyAsBoolean(PERSISTENT_MODE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that transactional messages should be sent by the publisher.
- /// </summary>
- /// <return> Flag to indicate that transactional messages should be sent by the publisher. </return>
- public bool getPublisherTransacted()
- {
- return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that transactional receives should be used by the receiver.
- /// </summary>
- /// <return> Flag to indicate that transactional receives should be used by the receiver. </return>
- public bool getReceiverTransacted()
- {
- return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME);
- }
-
- /// <summary>
- /// The name of the virtual host to run all tests over.
- /// </summary>
- /// <return> The name of the virtual host to run all tests over. </return>
- public string getVirtualHost()
- {
- return getProperty(VIRTUAL_HOST_PROPNAME);
- }
-
- /// <summary>
- /// Limiting rate for each sender in messages per second, or zero for unlimited.
- /// </summary>
- /// <return> Limiting rate for each sender in messages per second, or zero for unlimited. </return>
- public string getRate()
- {
- return getProperty(RATE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that test messages should be received publish/subscribe style by all receivers.
- /// </summary>
- /// <return> Flag to indicate that test messages should be received publish/subscribe style by all receivers. </return>
- public bool getPubsub()
- {
- return getPropertyAsBoolean(PUBSUB_PROPNAME);
- }
-
- /// <summary>
- /// The username credentials to run tests with.
- /// </summary>
- /// <return> The username credentials to run tests with. </return>
- public string getUsername()
- {
- return getProperty(USERNAME_PROPNAME);
- }
-
- /// <summary>
- /// The password credentials to run tests with.
- /// </summary>
- /// <return> The password credentials to run tests with. </return>
- public string getPassword()
- {
- return getProperty(PASSWORD_PROPNAME);
- }
-
- /// <summary>
- /// The timeout duration to fail tests on, should they receive no messages within it.
- /// </summary>
- /// <return> The timeout duration to fail tests on, should they receive no messages within it. </return>
- public long getTimeout()
- {
- return getPropertyAsLong(TIMEOUT_PROPNAME);
- }
-
- /// <summary>
- /// The number of messages to batch into each transaction in transational tests.
- /// </summary>
- /// <return> The number of messages to batch into each transaction in transational tests. </return>
- public int getTxBatchSize()
- {
- return getPropertyAsInteger(TX_BATCH_SIZE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that tests should use durable destinations.
- /// </summary>
- /// <return> Flag to indicate that tests should use durable destinations. </return>
- public bool getDurableDests()
- {
- return getPropertyAsBoolean(DURABLE_DESTS_PROPNAME);
- }
-
- /// <summary>
- /// The ack mode for message receivers to use.
- /// </summary>
- /// <return> The ack mode for message receivers to use. </return>
- public int getAckMode()
- {
- return getPropertyAsInteger(ACK_MODE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that tests should use durable subscriptions.
- /// </summary>
- /// <return> Flag to indicate that tests should use durable subscriptions. </return>
- public bool getDurableSubscription()
- {
- return getPropertyAsBoolean(DURABLE_SUBSCRIPTION_PROPNAME);
- }
-
- /// <summary>
- /// The maximum amount of in-flight data, in bytes, that tests should send at any time.
- /// </summary>
- /// <return> The maximum amount of in-flight data, in bytes, that tests should send at any time. </return>
- public int getMaxPending()
- {
- return getPropertyAsInteger(MAX_PENDING_PROPNAME);
- }
-
- /// <summary>
- /// The size of the prefetch queue to use.
- /// </summary>
- /// <return> The size of the prefetch queue to use. </return>
- public int getPrefetch()
- {
- return getPropertyAsInteger(PREFETCH_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that subscriptions should be no-local.
- /// </summary>
- /// <return> Flag to indicate that subscriptions should be no-local. </return>
- public bool getNoLocal()
- {
- return getPropertyAsBoolean(NO_LOCAL_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that subscriptions should be exclusive.
- /// </summary>
- /// <return> Flag to indicate that subscriptions should be exclusive. </return>
- public bool getExclusive()
- {
- return getPropertyAsBoolean(EXCLUSIVE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that messages must be delivered immediately.
- /// </summary>
- /// <return> Flag to indicate that messages must be delivered immediately. </return>
- public bool getImmediate()
- {
- return getPropertyAsBoolean(IMMEDIATE_PROPNAME);
- }
-
- /// <summary>
- /// Flag to indicate that messages must be routable.
- /// </summary>
- /// <return> Flag to indicate that messages must be routable. </return>
- public bool getMandatory()
- {
- return getPropertyAsBoolean(MANDATORY_PROPNAME);
- }
-
- /// <summary>
- /// Gets the value of a flag to indicate that the publisher should rollback all messages sent.
- /// </summary>
- /// <return> A flag to indicate that the publisher should rollback all messages sent. </return>
- public bool getRollbackPublisher()
- {
- return getPropertyAsBoolean(ROLLBACK_PUBLISHER_PROPNAME);
- }
-
- /// <summary>
- /// Gets the value of a flag to indicate that the receiver should rollback all messages received, then receive them
- /// again.
- /// </summary>
- /// <return> A flag to indicate that the publisher should rollback all messages received. </return>
- public bool getRollbackReceiver()
- {
- return getPropertyAsBoolean(ROLLBACK_RECEIVER_PROPNAME);
- }
-
- /// <summary>
- /// Gets the behavioural mode of not applicable assertions. Should be one of 'quiet', 'warn' or 'fail'.
- /// </summary>
- /// <return> The behavioural mode of not applicable assertions. </return>
- public string getNotApplicableAssertionMode()
- {
- return getProperty(NOT_APPLICABLE_ASSERTION_PROPNAME);
- }
- }
-}
-/*
- *
- * 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 log4net;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// NotApplicableAssertion is a messaging assertion that can be used when an assertion requested by a test-case is not
- /// applicable to the testing scenario. For example an assertion may relate to AMQP functionality, but a test case may be
- /// being run over a non-AMQP JMS implementation, in which case the request to create the assertion may return this
- /// instead of the proper assertion. The test framework is configurable to quietly drop these assertions, log them
- /// as warnings to the console, or raise them as test failures.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Quitely pass.
- /// <tr><td> Log a warning.
- /// <tr><td> Raise a test failure.
- /// </table>
- /// </summary>
- public class NotApplicableAssertion : Assertion
- {
- /// <summary> Used for logging to the console. </summary>
- private static ILog console = LogManager.GetLogger("CONSOLE." + NotApplicableAssertion.class.getName());
-
- /// <summary> The possible behavioural modes of this assertion. </summary>
- private enum Mode
- {
- /// <summary> Quietly ignore the assertion by passing. </summary>
- Quiet,
-
- /// <summary> Ignore the assertion by passing but log a warning about it. </summary>
- Warn,
-
- /// <summary> Fail the assertion. </summary>
- Fail;
- }
-
- /// <summary> The behavioural mode of the assertion. </summary>
- private Mode mode;
-
- /// <summary>
- /// Creates an assertion that is driven by the value of the 'notApplicableAssertion' property of the test
- /// configuration. Its value should match one of 'quiet', 'warn' or 'fail' and if it does not it is automatically
- /// read as 'fail'.
- /// </summary>
- /// <param name="testProperties"> The test configuration properties. </param>
- public NotApplicableAssertion(ParsedProperties testProperties)
- {
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProperties);
-
- string modeName = props.getNotApplicableAssertionMode();
-
- if ("quiet".equals(modeName))
- {
- mode = Mode.Quiet;
- }
- else if ("warn".equals(modeName))
- {
- mode = Mode.Warn;
- }
- else
- {
- mode = Mode.Fail;
- }
- }
-
- /// <summary>
- /// Applies the assertion.
- /// </summary>
- /// <return> <tt>true</tt> if the assertion passes, <tt>false</tt> if it fails. </return>
- public bool apply()
- {
- switch (mode)
- {
- case Quiet:
- return true;
-
- case Warn:
- console.warn("Warning: Not applicable assertion being ignored.");
-
- return true;
-
- case Fail:
- default:
- return false;
- }
- }
- }
-}
-/*
- *
- * 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 uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A Publisher represents the status of the publishing side of a test circuit. Its main purpose is to provide assertions
- /// that can be applied to test the behaviour of the publishers.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide assertion that the publishers received no exceptions.
- /// </table>
- /// </summary>
- ///
- /// <remarks> There are mixtures of AMQP and JMS assertions in this interface. Either keep them here, but quietly (or with a
- /// warning or error) drop them from test cases where they are not relevant, or push them down into sub-classes.
- /// I am tempted to go with the dropping/warning/error approach, that would imply that it makes sense to pull
- /// the assertions back from AMQPPublisher to here.</remarks>
- public interface Publisher
- {
- // Assertions that are meaningfull to AMQP and to JMS.
-
- /// <summary>
- /// Provides an assertion that the publisher encountered no exceptions.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the publisher encountered no exceptions. </return>
- public Assertion noExceptionsAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to AMQP.
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- public Assertion channelClosedAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to Java/JMS.
-
- /// <summary>
- /// Provides an assertion that the publisher got a given exception during the test.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. </param>
- ///
- /// <return> An assertion that the publisher got a given exception during the test. </return>
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass);
- }
-}
-/*
- *
- * 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 uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// A Receiver is a <see cref="CircuitEnd"/> that represents the status of the receiving side of a test circuit. Its main
- /// purpose is to provide assertions that can be applied to check the behaviour of the receivers.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide assertion that the receivers received no exceptions.
- /// <tr><td> Provide assertion that the receivers received all test messages sent to it.
- /// </table>
- /// </summary>
- ///
- /// <remarks> There are mixtures of AMQP and JMS assertions in this interface. Either keep them here, but quietly (or with a
- /// warning or error) drop them from test cases where they are not relevant, or push them down into sub-classes.
- /// I am tempted to go with the dropping/warning/error approach.</remarks>
- public interface Receiver
- {
- // Assertions that are meaningfull to AMQP and to JMS.
-
- /// <summary>
- /// Provides an assertion that the receivers encountered no exceptions.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers encountered no exceptions. </return>
- public Assertion noExceptionsAssertion(ParsedProperties testProps);
-
- /// <summary>
- /// Provides an assertion that the receivers got all messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers got all messages that were sent to it. </return>
- public Assertion allMessagesReceivedAssertion(ParsedProperties testProps);
-
- /// <summary>
- /// Provides an assertion that the receivers got none of the messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers got none of the messages that were sent to it. </return>
- public Assertion noMessagesReceivedAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to AMQP.
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- public Assertion channelClosedAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to Java/JMS.
-
- /// <summary>
- /// Provides an assertion that the receiver got a given exception during the test.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. </param>
- ///
- /// <return> An assertion that the receiver got a given exception during the test. </return>
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass);
- }
-}
-/*
- *
- * 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 log4net;
-
-using Apache.Qpid.Integration.Tests.framework.Circuit;
-using Apache.Qpid.Integration.Tests.framework.TestClientDetails;
-using org.apache.qpid.util.ConversationFactory;
-
-using System.Collections.Generic.LinkedList;
-using System.Collections.Generic.IList;
-using java.util.Properties;
-
-namespace Apache.Qpid.Integration.Tests.framework.sequencers
-{
- /// <summary>
- /// BaseCircuitFactory provides some functionality common to all <see cref="CircuitFactory"/>s, such as the details of
- /// all <see cref="Apache.Qpid.Integration.Tests.framework.distributedtesting.TestClient"/>s that make up the end-points of
- /// the circuits that the factory creates, and an active <see cref="ConversationFactory"/> that can be used to generate
- /// control conversations with those circuit end-points.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Hold the details of the sending and receiving end-points to create circuits from.
- /// <tr><td> Provide a conversation factory to create control conversations with the end-points.
- /// </table>
- /// </summary>
- public abstract class BaseCircuitFactory : CircuitFactory
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(BaseCircuitFactory));
-
- /// <summary> Holds the contact details for the sending test client. </summary>
- protected TestClientDetails sender;
-
- /// <summary> Holds the contact details for the receving test client. </summary>
- protected IList<TestClientDetails> receivers = new LinkedList<TestClientDetails>();
-
- /// <summary> Holds the conversation factory over which to coordinate the test. </summary>
- protected ConversationFactory conversationFactory;
-
- /// <summary>
- /// Creates a test circuit for the test, configered by the test parameters specified.
- /// </summary>
- /// <param name="testProperties"> The test parameters. </param>
- /// <return> A test circuit. </return>
- public Circuit createCircuit(Properties testProperties)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Sets the sender test client to coordinate the test with.
- /// </summary>
- /// <param name="sender"> The contact details of the sending client in the test. </param>
- public void setSender(TestClientDetails sender)
- {
- log.debug("public void setSender(TestClientDetails sender = " + sender + "): called");
-
- this.sender = sender;
- }
-
- /// <summary>
- /// Sets the receiving test client to coordinate the test with.
- /// </summary>
- /// <param name="receiver"> The contact details of the sending client in the test. </param>
- public void setReceiver(TestClientDetails receiver)
- {
- log.debug("public void setReceiver(TestClientDetails receivers = " + receiver + "): called");
-
- this.receivers.add(receiver);
- }
-
- /// <summary>
- /// Supplies the sending test client.
- /// </summary>
- /// <return> The sending test client. </return>
- public TestClientDetails getSender()
- {
- return sender;
- }
-
- /// <summary>
- /// Supplies the receiving test client.
- /// </summary>
- /// <return> The receiving test client. </return>
- public IList<TestClientDetails> getReceivers()
- {
- return receivers;
- }
-
- /// <summary>
- /// Accepts the conversation factory over which to hold the test coordinating conversation.
- /// </summary>
- /// <param name="conversationFactory"> The conversation factory to coordinate the test over. </param>
- public void setConversationFactory(ConversationFactory conversationFactory)
- {
- this.conversationFactory = conversationFactory;
- }
-
- /// <summary>
- /// Provides the conversation factory for providing the distributed test sequencing conversations over the test
- /// connection.
- /// </summary>
- /// <return> The conversation factory to create test sequencing conversations with. </return>
- public ConversationFactory getConversationFactory()
- {
- return conversationFactory;
- }
- }
-}
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-using Apache.Qpid.Integration.Tests.framework.Assertion;
-using Apache.Qpid.Integration.Tests.framework.Circuit;
-using Apache.Qpid.Integration.Tests.framework.TestClientDetails;
-using org.apache.qpid.util.ConversationFactory;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.JMSException;
-using javax.jms.Message;
-
-using System.Collections.Generic.IList;
-using System.Collections.Generic.IDictionary;
-using java.util.Properties;
-
-namespace Apache.Qpid.Integration.Tests.framework.sequencers
-{
- /// <summary>
- /// A CircuitFactory is responsibile for creating test circuits appropriate to the context that a test case is
- /// running in, and providing an implementation of a standard test procedure over a test circuit.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide a standard test procedure over a test circuit.
- /// <tr><td> Construct test circuits appropriate to a tests context.
- /// </table>
- /// </summary>
- public interface CircuitFactory
- {
- /// <summary>
- /// Holds a test coordinating conversation with the test clients. This should consist of assigning the test roles,
- /// begining the test, gathering the test reports from the participants, and checking for assertion failures against
- /// the test reports.
- /// </summary>
- /// <param name="testCircuit"> The test circuit. </param>
- /// <param name="assertions"> The list of assertions to apply to the test circuit. </param>
- /// <param name="testProperties"> The test case definition. </param>
- ///
- /// @deprecated Use test circuits and Circuit.test instead.
- public void sequenceTest(Circuit testCircuit, IList<Assertion> assertions, Properties testProperties);
-
- /// <summary>
- /// Creates a test circuit for the test, configered by the test parameters specified.
- /// </summary>
- /// <param name="testProperties"> The test parameters. </param>
- ///
- /// <return> A test circuit. </return>
- public Circuit createCircuit(ParsedProperties testProperties);
-
- /// <summary>
- /// Sets the sender test client to coordinate the test with.
- /// </summary>
- /// <param name="sender"> The contact details of the sending client in the test. </param>
- public void setSender(TestClientDetails sender);
-
- /// <summary>
- /// Sets the receiving test client to coordinate the test with.
- /// </summary>
- /// <param name="receiver"> The contact details of the sending client in the test. </param>
- public void setReceiver(TestClientDetails receiver);
-
- /// <summary>
- /// Supplies the sending test client.
- /// </summary>
- /// <return> The sending test client. </return>
- public TestClientDetails getSender();
-
- /// <summary>
- /// Supplies the receiving test client.
- /// </summary>
- /// <return> The receiving test client. </return>
- public IList<TestClientDetails> getReceivers();
-
- /// <summary>
- /// Accepts the conversation factory over which to hold the test coordinating conversation.
- /// </summary>
- /// <param name="conversationFactory"> The conversation factory to coordinate the test over. </param>
- public void setConversationFactory(ConversationFactory conversationFactory);
- }
-}
-/*
- *
- * 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 log4net;
-
-using Apache.Qpid.Integration.Tests.framework.Assertion;
-using Apache.Qpid.Integration.Tests.framework.Circuit;
-using Apache.Qpid.Integration.Tests.framework.TestClientDetails;
-using Apache.Qpid.Integration.Tests.framework.TestUtils;
-using Apache.Qpid.Integration.Tests.framework.distributedcircuit.DistributedCircuitImpl;
-using org.apache.qpid.util.ConversationFactory;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.Destination;
-using javax.jms.JMSException;
-using javax.jms.Message;
-using javax.jms.Session;
-
-using System.Collections.Generic.LinkedList;
-using System.Collections.Generic.IList;
-using java.util.Properties;
-
-namespace Apache.Qpid.Integration.Tests.framework.sequencers
-{
- /// <summary>
- /// FanOutCircuitFactory is a circuit factory that creates distributed test circuits. Given a set of participating
- /// test client nodes, it assigns one node to the SENDER role and the remainder to the RECEIVER role.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Create distributed circuits from one to many test nodes, for fanout style testing.
- /// </table>
- /// </summary>
- ///
- /// <remarks> Adapt this to be an n*m topology circuit factory. Need to add circuit topology definitions to the test
- /// parameters. Place n senders onto the available test clients, and m receivers. Where n or m is larger than
- /// the available nodes, start stacking multiple test clients on each node. There will also be an option that
- /// indicates whether nodes can play both roles, and how many nodes out of all available may be assigned to
- /// each role.</remarks>
- ///
- /// <remarks> The createCircuit methods on this and InteropCircuitFactory are going to be identical. This is because the
- /// partitioning into senders and receivers is already done by the test decorators. Either eliminate these factories
- /// as unnesesary, or move the partitioning functionality into the factories, in which case the test decorators
- /// can probably be merged or eliminated. There is confusion over the placement of responsibilities between the
- /// factories and the test decorators... although the test decorators may well do more than just circuit creation
- /// in the future. For example, there may have to be a special decorator for test repetition that does one circuit
- /// creation, but the runs many tests over it, in which case the handling of responsibilities becomes clearer.</remarks>
- public class FanOutCircuitFactory extends BaseCircuitFactory
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(FanOutCircuitFactory));
-
- /// <summary>
- /// Creates a test circuit for the test, configered by the test parameters specified.
- /// </summary>
- /// <param name="testProperties"> The test parameters. </param>
- /// <return> A test circuit. </return>
- public Circuit createCircuit(ParsedProperties testProperties)
- {
- log.debug("public Circuit createCircuit(ParsedProperties testProperties): called");
-
- IList<TestClientDetails> senders = new LinkedList<TestClientDetails>();
- senders.add(getSender());
- IList<TestClientDetails> receivers = getReceivers();
- ConversationFactory conversationFactory = getConversationFactory();
-
- return DistributedCircuitImpl.createCircuit(testProperties, senders, receivers, conversationFactory);
- }
-
- /// <summary>
- /// Holds a test coordinating conversation with the test clients. This should consist of assigning the test roles,
- /// begining the test, gathering the test reports from the participants, and checking for assertion failures against
- /// the test reports.
- /// </summary>
- /// <param name="testCircuit"> The test circuit. </param>
- /// <param name="assertions"> The list of assertions to apply to the test circuit. </param>
- /// <param name="testProperties"> The test case definition. </param>
- ///
- /// @deprecated Scheduled for removal once existing tests converted over to use test circuits.
- public void sequenceTest(Circuit testCircuit, IList<Assertion> assertions, Properties testProperties)
- {
- log.debug("protected Message[] sequenceTest(Object... testProperties = " + testProperties + "): called");
-
- TestClientDetails sender = getSender();
- IList<TestClientDetails> receivers = getReceivers();
- ConversationFactory conversationFactory = getConversationFactory();
-
- try
- {
- // Create a conversation on the sender clients private control route.
- Session session = conversationFactory.getSession();
- Destination senderControlTopic = session.createTopic(sender.privateControlKey);
- ConversationFactory.Conversation senderConversation = conversationFactory.startConversation();
-
- // Assign the sender role to the sending test client.
- Message assignSender = conversationFactory.getSession().createMessage();
- TestUtils.setPropertiesOnMessage(assignSender, testProperties);
- assignSender.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignSender.setStringProperty("ROLE", "SENDER");
- assignSender.setStringProperty("CLIENT_NAME", "Sustained_SENDER");
-
- senderConversation.send(senderControlTopic, assignSender);
-
- // Wait for the sender to confirm its role.
- senderConversation.receive();
-
- // Assign the receivers roles.
- for (TestClientDetails receiver : receivers)
- {
- assignReceiverRole(receiver, testProperties, true);
- }
-
- // Start the test on the sender.
- Message start = session.createMessage();
- start.setStringProperty("CONTROL_TYPE", "START");
-
- senderConversation.send(senderControlTopic, start);
-
- // Wait for the test sender to return its report.
- Message senderReport = senderConversation.receive();
- TestUtils.pause(500);
-
- // Ask the receivers for their reports.
- Message statusRequest = session.createMessage();
- statusRequest.setStringProperty("CONTROL_TYPE", "STATUS_REQUEST");
-
- // Gather the reports from all of the receiving clients.
-
- // Return all of the test reports, the senders report first.
- // return new Message[] { senderReport };
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Unhandled JMSException.");
- }
- }
-
- /// <summary>
- /// Assigns the receivers role to the specified test client that is to act as a receivers during the test. This method
- /// does not always wait for the receiving clients to confirm their role assignments. This is because this method
- /// may be called from an 'onMessage' method, when a client is joining the test at a later point in time, and it
- /// is not possible to do a synchronous receive during an 'onMessage' method. There is a flag to indicate whether
- /// or not to wait for role confirmations.
- /// </summary>
- /// <param name="receiver"> The test client to assign the receivers role to. </param>
- /// <param name="testProperties"> The test parameters. </param>
- /// <param name="confirm"> Indicates whether role confirmation should be waited for. </param>
- ///
- /// <exception cref="JMSException"> Any JMSExceptions occurring during the conversation are allowed to fall through. </exception>
- ///
- /// @deprecated Scheduled for removal once existing tests converted over to use test circuits.
- protected void assignReceiverRole(TestClientDetails receiver, Properties testProperties, bool confirm)
- throws JMSException
- {
- log.info("assignReceiverRole(TestClientDetails receivers = " + receiver + ", Map<String, Object> testProperties = "
- + testProperties + "): called");
-
- ConversationFactory conversationFactory = getConversationFactory();
-
- // Create a conversation with the receiving test client.
- Session session = conversationFactory.getSession();
- Destination receiverControlTopic = session.createTopic(receiver.privateControlKey);
- ConversationFactory.Conversation receiverConversation = conversationFactory.startConversation();
-
- // Assign the receivers role to the receiving client.
- Message assignReceiver = session.createMessage();
- TestUtils.setPropertiesOnMessage(assignReceiver, testProperties);
- assignReceiver.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignReceiver.setStringProperty("ROLE", "RECEIVER");
- assignReceiver.setStringProperty("CLIENT_NAME", receiver.clientName);
-
- receiverConversation.send(receiverControlTopic, assignReceiver);
-
- // Wait for the role confirmation to come back.
- if (confirm)
- {
- receiverConversation.receive();
- }
- }
- }
-}
-/*
- *
- * 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 log4net;
-
-using Apache.Qpid.Integration.Tests.framework.Assertion;
-using Apache.Qpid.Integration.Tests.framework.Circuit;
-using Apache.Qpid.Integration.Tests.framework.TestClientDetails;
-using Apache.Qpid.Integration.Tests.framework.TestUtils;
-using Apache.Qpid.Integration.Tests.framework.distributedcircuit.DistributedCircuitImpl;
-using org.apache.qpid.util.ConversationFactory;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.Destination;
-using javax.jms.JMSException;
-using javax.jms.Message;
-using javax.jms.Session;
-
-using System.Collections.Generic.LinkedList;
-using System.Collections.Generic.IList;
-using java.util.Properties;
-
-namespace Apache.Qpid.Integration.Tests.framework.sequencers
-{
- /// <summary>
- /// InteropCircuitFactory is a circuit factory that creates distributed test circuits. Given a set of participating
- /// test client nodes, it assigns one node to the SENDER role and one the RECEIVER role.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Create distributed circuits from pairs of test nodes, for interop style testing.
- /// </table>
- /// </summary>
- ///
- /// <remarks> The partitioning of a set of nodes into sender and receiver roles is actually done by the interop test
- /// decorator. See the todo comment in FanOutCircuitFactory about merging the factories with the decorators, or
- /// more carefully dividing up responsibilities between them.</remarks>
- ///
- /// <remarks> The squenceTest code is deprecated, but currently still used by the interop tests. It will be removed once it
- /// have been fully replaced by the default test procedure.</remarks>
- public class InteropCircuitFactory extends BaseCircuitFactory
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(InteropCircuitFactory));
-
- /// <summary>
- /// Creates a test circuit for the test, configered by the test parameters specified.
- /// </summary>
- /// <param name="testProperties"> The test parameters. </param>
- /// <return> A test circuit. </return>
- public Circuit createCircuit(ParsedProperties testProperties)
- {
- log.debug("public Circuit createCircuit(ParsedProperties testProperties): called");
-
- IList<TestClientDetails> senders = new LinkedList<TestClientDetails>();
- senders.add(getSender());
- IList<TestClientDetails> receivers = getReceivers();
- ConversationFactory conversationFactory = getConversationFactory();
-
- return DistributedCircuitImpl.createCircuit(testProperties, senders, receivers, conversationFactory);
- }
-
- /// <summary>
- /// Holds a test coordinating conversation with the test clients. This should consist of assigning the test roles,
- /// begining the test, gathering the test reports from the participants, and checking for assertion failures against
- /// the test reports.
- /// </summary>
- /// <param name="testCircuit"> The test circuit. </param>
- /// <param name="assertions"> The list of assertions to apply to the test circuit. </param>
- /// <param name="testProperties"> The test case definition. </param>
- public void sequenceTest(Circuit testCircuit, IList<Assertion> assertions, Properties testProperties)
- {
- log.debug("protected Message[] sequenceTest(Object... testProperties = " + testProperties + "): called");
-
- TestClientDetails sender = getSender();
- IList<TestClientDetails> receivers = getReceivers();
- ConversationFactory conversationFactory = getConversationFactory();
-
- try
- {
- Session session = conversationFactory.getSession();
- Destination senderControlTopic = session.createTopic(sender.privateControlKey);
- Destination receiverControlTopic = session.createTopic(receivers.get(0).privateControlKey);
-
- ConversationFactory.Conversation senderConversation = conversationFactory.startConversation();
- ConversationFactory.Conversation receiverConversation = conversationFactory.startConversation();
-
- Message assignSender = conversationFactory.getSession().createMessage();
- TestUtils.setPropertiesOnMessage(assignSender, testProperties);
- assignSender.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignSender.setStringProperty("ROLE", "SENDER");
-
- senderConversation.send(senderControlTopic, assignSender);
-
- // Assign the receivers role the receiving client.
- Message assignReceiver = session.createMessage();
- TestUtils.setPropertiesOnMessage(assignReceiver, testProperties);
- assignReceiver.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignReceiver.setStringProperty("ROLE", "RECEIVER");
-
- receiverConversation.send(receiverControlTopic, assignReceiver);
-
- // Wait for the senders and receivers to confirm their roles.
- senderConversation.receive();
- receiverConversation.receive();
-
- // Start the test.
- Message start = session.createMessage();
- start.setStringProperty("CONTROL_TYPE", "START");
-
- senderConversation.send(senderControlTopic, start);
-
- // Wait for the test sender to return its report.
- Message senderReport = senderConversation.receive();
- TestUtils.pause(500);
-
- // Ask the receivers for its report.
- Message statusRequest = session.createMessage();
- statusRequest.setStringProperty("CONTROL_TYPE", "STATUS_REQUEST");
-
- receiverConversation.send(receiverControlTopic, statusRequest);
-
- // Wait for the receivers to send its report.
- Message receiverReport = receiverConversation.receive();
-
- // return new Message[] { senderReport, receiverReport };
-
- // Apply assertions.
- }
- catch (JMSException e)
- {
- throw new RuntimeException("JMSException not handled.");
- }
- }
- }
-}
-/*
- *
- * 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.Integration.Tests.framework
-{
- /// <summary>
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td>
- /// </table>
- /// </summary>
- public class TestCaseVector
- {
- /// <summary> The test case name. </summary>
- private string testCase;
-
- /// <summary> The test cycle number within the test case. </summary>
- private int testCycleNumber;
-
- public TestCaseVector(string testCase, int testCycleNumber)
- {
- this.testCase = testCase;
- this.testCycleNumber = testCycleNumber;
- }
-
- public string getTestCase()
- {
- return testCase;
- }
-
- public int getTestCycleNumber()
- {
- return testCycleNumber;
- }
-
- public bool equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
-
- if ((o == null) || (getClass() != o.getClass()))
- {
- return false;
- }
-
- TestCaseVector that = (TestCaseVector) o;
-
- if (testCycleNumber != that.testCycleNumber)
- {
- return false;
- }
-
- if ((testCase != null) ? (!testCase.equals(that.testCase)) : (that.testCase != null))
- {
- return false;
- }
-
- return true;
- }
-
- public int hashCode()
- {
- int result;
- result = ((testCase != null) ? testCase.hashCode() : 0);
- result = (31 * result) + testCycleNumber;
-
- return result;
- }
- }
-}
-/*
- *
- * 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.Integration.Tests.framework
-{
- /// <summary>
- /// TestClientDetails is used to encapsulate information about an interop test client. It pairs together the unique
- /// name of the client, and the route on which it listens to its control messages.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Record test clients control addresses together with their names.
- /// </table>
- /// </summary>
- public class TestClientDetails
- {
- /// <summary> The test clients name. </summary>
- public string clientName;
-
- /// <summary> The routing key of the test clients control topic. </summary>
- public string privateControlKey;
-
- /// <summary>
- /// Two TestClientDetails are considered to be equal, iff they have the same client name.
- /// </summary>
- /// <param name="o"> The object to compare to. </param>
- ///
- /// <return> <tt>If the object to compare to is a TestClientDetails equal to this one, <tt>false</tt> otherwise. </return>
- public bool equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
-
- if (!(o instanceof TestClientDetails))
- {
- return false;
- }
-
- final TestClientDetails testClientDetails = (TestClientDetails) o;
-
- return !((clientName != null) ? (!clientName.equals(testClientDetails.clientName))
- : (testClientDetails.clientName != null));
- }
-
- /// <summary>
- /// Computes a hash code compatible with the equals method; based on the client name alone.
- /// </summary>
- /// <return> A hash code for this. </return>
- public int hashCode()
- {
- return ((clientName != null) ? clientName.hashCode() : 0);
- }
-
- /// <summary>
- /// Outputs the client name and address details. Mostly used for debugging purposes.
- /// </summary>
- /// <return> The client name and address. </return>
- public string ToString()
- {
- return "TestClientDetails: [ clientName = " + clientName + ", privateControlKey = " + privateControlKey + " ]";
- }
- }
-}
-/*
- *
- * 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 log4net;
-
-using static Apache.Qpid.Integration.Tests.framework.MessagingTestConfigProperties.*;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.*;
-using javax.naming.Context;
-using javax.naming.InitialContext;
-using javax.naming.NamingException;
-
-using System.Collections.Generic.IDictionary;
-
-namespace Apache.Qpid.Integration.Tests.framework
-{
- /// <summary>
- /// TestUtils provides static helper methods that are usefull for writing tests against QPid.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Create connections from test properties. <td> <see cref="MessagingTestConfigProperties"/>
- /// <tr><td> Create test messages.
- /// <tr><td> Inject a short pause in a test.
- /// <tr><td> Serialize properties into a message.
- /// </table>
- /// </summary>
- public class TestUtils
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(TestUtils));
-
- /// <summary> Some dummy data to stuff all test messages with. </summary>
- private static final byte[] MESSAGE_DATA_BYTES =
- "Test Message -- Test Message -- Test Message -- Test Message -- Test Message -- Test Message -- Test Message -- "
- .getBytes();
-
- /// <summary>
- /// Establishes a JMS connection using a set of properties and qpids built in JNDI implementation. This is a simple
- /// convenience method for code that does not anticipate handling connection failures. All exceptions that indicate
- /// that the connection has failed, are wrapped as rutime exceptions, presumably handled by a top level failure
- /// handler.
- ///
- /// <p/>This utility makes use of the following test parameters from <see cref="MessagingTestConfigProperties"/> to control
- /// the connection creation:
- ///
- /// <p/><table>
- /// <tr><td> <see cref="MessagingTestConfigProperties#USERNAME_PROPNAME"/> <td> The username.
- /// <tr><td> <see cref="MessagingTestConfigProperties#PASSWORD_PROPNAME"/> <td> The password.
- /// <tr><td> <see cref="MessagingTestConfigProperties#VIRTUAL_HOST_PROPNAME"/> <td> The virtual host name.
- /// <tr><td> <see cref="MessagingTestConfigProperties#BROKER_PROPNAME"/> <td> The broker URL.
- /// <tr><td> <see cref="MessagingTestConfigProperties#CONNECTION_NAME"/> <td> The broker name in the initial context.
- /// </summary>
- /// <param name="messagingProps"> Connection properties as defined in <see cref="MessagingTestConfigProperties"/>. </param>
- ///
- /// <return> A JMS conneciton. </return>
- public static Connection createConnection(ParsedProperties messagingProps)
- {
- log.debug("public static Connection createConnection(ParsedProperties messagingProps = " + messagingProps
- + "): called");
-
- try
- {
- // Extract the configured connection properties from the test configuration.
- string conUsername = messagingProps.getProperty(USERNAME_PROPNAME);
- string conPassword = messagingProps.getProperty(PASSWORD_PROPNAME);
- string virtualHost = messagingProps.getProperty(VIRTUAL_HOST_PROPNAME);
- string brokerUrl = messagingProps.getProperty(BROKER_PROPNAME);
-
- // Create the broker connection url.
- string connectionstring =
- "amqp://" + conUsername + ":" + conPassword + "@clientid/" + ((virtualHost != null) ? virtualHost : "")
- + "?brokerlist='" + brokerUrl + "'";
-
- // Create properties to create the initial context from, and inject the connection factory configuration
- // for the defined connection name into it.
- messagingProps.setProperty("connectionfactory." + CONNECTION_NAME, connectionString);
-
- Context ctx = new InitialContext(messagingProps);
-
- ConnectionFactory cf = (ConnectionFactory) ctx.lookup(CONNECTION_NAME);
-
- return cf.createConnection();
- }
- catch (NamingException e)
- {
- throw new RuntimeException("Got JNDI NamingException whilst looking up the connection factory.", e);
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Could not establish connection due to JMSException.", e);
- }
- }
-
- /// <summary>
- /// Creates a test message of the specified size, on the given JMS session.
- /// </summary>
- /// <param name="session"> The JMS session. </param>
- /// <param name="size"> The size of the message in bytes. </param>
- ///
- /// <return> A bytes message, of the specified size, filled with dummy data. </return>
- ///
- /// <exception cref="JMSException"> Any underlying JMSExceptions are allowed to fall through. </exception>
- public static Message createTestMessageOfSize(Session session, int size) throws JMSException
- {
- BytesMessage message = session.createBytesMessage();
-
- if (size > 0)
- {
- int div = MESSAGE_DATA_BYTES.length / size;
- int mod = MESSAGE_DATA_BYTES.length % size;
-
- for (int i = 0; i < div; i++)
- {
- message.writeBytes(MESSAGE_DATA_BYTES);
- }
-
- if (mod != 0)
- {
- message.writeBytes(MESSAGE_DATA_BYTES, 0, mod);
- }
- }
-
- return message;
- }
-
- /// <summary>
- /// Pauses for the specified length of time. In the event of failing to pause for at least that length of time
- /// due to interuption of the thread, a RutimeException is raised to indicate the failure. The interupted status
- /// of the thread is restores in that case. This method should only be used when it is expected that the pause
- /// will be succesfull, for example in test code that relies on inejecting a pause.
- /// </summary>
- /// <param name="t"> The minimum time to pause for in milliseconds. </param>
- public static void pause(long t)
- {
- try
- {
- Thread.sleep(t);
- }
- catch (InterruptedException e)
- {
- // Restore the interrupted status
- Thread.currentThread().interrupt();
-
- throw new RuntimeException("Failed to generate the requested pause length.", e);
- }
- }
-
- /// <summary>
- /// Sets properties of different types on a JMS Message.
- /// </summary>
- /// <param name="message"> The message to set properties on. </param>
- /// <param name="properties"> The property name/value pairs to set. </param>
- ///
- /// <exception cref="javax.jms.JMSException"> All underlying JMSExceptions are allowed to fall through. </exception>
- ///
- /// <remarks> Move this helper method somewhere else. For example, TestUtils.</remarks>
- public static void setPropertiesOnMessage(Message message, Map<Object, Object> properties) throws JMSException
- {
- for (Map.Entry<Object, Object> entry : properties.entrySet())
- {
- string name = entry.getKey().ToString();
- Object value = entry.getValue();
-
- message.setObjectProperty(name, value);
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchFailureException.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchFailureException.csx
deleted file mode 100644
index a2bcc49b97..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchFailureException.csx
+++ /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.Integration.Tests.framework.clocksynch
-{
- /// <summary>
- /// ClockSynchFailureException represents failure of a <see cref="ClockSynchronizer"/> to achieve synchronization. For example,
- /// this could be because a reference signal is not available, or because a desired accurracy cannot be attained.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Represent failure to achieve synchronization.
- /// </table>
- /// </summary>
- public class ClockSynchFailureException extends Exception
- {
- /// <summary>
- /// Creates a clock synch failure exception.
- /// </summary>
- /// <param name="message"> The detail message (which is saved for later retrieval by the <see cref="#getMessage()"/> method). </param>
- /// <param name="cause"> The cause (which is saved for later retrieval by the <see cref="#getCause()"/> method). (A <tt>null</tt>
- /// value is permitted, and indicates that the cause is nonexistent or unknown.)</param>
- public ClockSynchFailureException(string message, Throwable cause)
- {
- super(message, cause);
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchThread.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchThread.csx
deleted file mode 100644
index 7d2fcae058..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchThread.csx
+++ /dev/null
@@ -1,117 +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 log4net;
-
-using uk.co.thebadgerset.junit.extensions.ShutdownHookable;
-using uk.co.thebadgerset.junit.extensions.Throttle;
-
-namespace Apache.Qpid.Integration.Tests.framework.clocksynch
-{
- /// <summary>
- /// ClockSynchThread is a convenient utility for running a thread that periodically synchronizes the clock against
- /// a reference. Supply it with a <see cref="ClockSynchronizer"/> and a <see cref="Throttle"/> and it will continually keep the
- /// clock up-to-date at a rate determined by the throttle.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Continually sychronize the clock at a throttled rate.
- /// </table>
- /// </summary>
- public class ClockSynchThread extends Thread : ShutdownHookable
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(ClockSynchThread));
-
- /// <summary> Holds the clock syncher for the synch thread. </summary>
- private ClockSynchronizer clockSyncher;
-
- /// <summary> Holds the throttle to limit the synch rate. </summary>
- private Throttle throttle;
-
- /// <summary> Flag to indicate that the periodic clock syncher should keep running. </summary>
- bool doSynch = true;
-
- /// <summary>
- /// Creates a clock synchronizer thread from a clock synchronizer and a throttle.
- /// </summary>
- /// <param name="syncher"> The clock synchronizer. </param>
- /// <param name="throttle"> The throttle. </param>
- public ClockSynchThread(ClockSynchronizer syncher, Throttle throttle)
- {
- this.clockSyncher = syncher;
- this.throttle = throttle;
- }
-
- /// <summary> Terminates the synchronization thread. </summary>
- public void terminate()
- {
- doSynch = false;
- }
-
- /// <summary> Continually updates the clock, until <see cref="#terminate()"/> is called. </summary>
- public void run()
- {
- while (doSynch)
- {
- // Perform a clock clockSynch.
- try
- {
- // Wait controlled by the throttle before doing the next synch.
- throttle.throttle();
-
- clockSyncher.synch();
- log.debug("Clock synched, delta = " + clockSyncher.getDelta() + ", epsilon = " + clockSyncher.getEpsilon()
- + ".");
- }
- // Terminate the synch thread if the synchronization cannot be achieved.
- catch (ClockSynchFailureException e)
- {
- log.debug("Cannot synchronize the clock (reference service may be down). Terminating the synch thread.");
- doSynch = false;
- }
- }
- }
-
- /// <summary>
- /// Gets the clock synchronizer that is kept continually up to date.
- /// </summary>
- /// <return> The clock synchronizer that is kept continually up to date. </return>
- public ClockSynchronizer getClockSyncher()
- {
- return clockSyncher;
- }
-
- /// <summary>
- /// Supplies a shutdown hook, that terminates the synching thread.
- /// </summary>
- /// <return> The shut down hook. </return>
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- doSynch = false;
- }
- });
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchronizer.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchronizer.csx
deleted file mode 100644
index 665b804b21..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/ClockSynchronizer.csx
+++ /dev/null
@@ -1,66 +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.Integration.Tests.framework.clocksynch
-{
- /// <summary>
- /// ClockSynchronizer provides an interface through which two nodes may synchronize their clocks. It is expected that one
- /// node will act as the reference clock, to which no delta need be applied, and the other node will act as the slave,
- /// and which must apply a delta to its local clock to get a clock synchronized with the reference.
- ///
- /// <p/>The slave side will initiate the computation of a clock delta by calling the <see cref="#synch"/> method. This method
- /// will not return until the delta has been computed, at which point there is a method to return its value, as well as
- /// an estimate of the likely error (usually one standard deviation), in the synchronization. For convenience there is a
- /// <see cref="#nanoTime"/> method to return the value of System.nanoTime() with the delta added in.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Trigger a clock synchronization.
- /// <tr><td> Compute a clock delta to apply to the local clock.
- /// <tr><td> Estimate the error in the synchronzation.
- /// </table>
- /// </summary>
- public interface ClockSynchronizer
- {
- /// <summary>
- /// The slave side should call this to copute a clock delta with the reference.
- /// </summary>
- /// <exception cref="ClockSynchFailureException"> If synchronization cannot be achieved. </exception>
- public void synch() throws ClockSynchFailureException;
-
- /// <summary>
- /// Gets the clock delta in nano seconds.
- /// </summary>
- /// <return> The clock delta in nano seconds. </return>
- public long getDelta();
-
- /// <summary>
- /// Gets an estimate of the clock error in nan seconds.
- /// </summary>
- /// <return> An estimate of the clock error in nan seconds. </return>
- public long getEpsilon();
-
- /// <summary>
- /// Gets the local clock time with any computed delta added in.
- /// </summary>
- /// <return> The local clock time with any computed delta added in. </return>
- public long nanoTime();
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/LocalClockSynchronizer.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/LocalClockSynchronizer.csx
deleted file mode 100644
index 1d19b92d90..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/LocalClockSynchronizer.csx
+++ /dev/null
@@ -1,70 +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.Integration.Tests.framework.clocksynch
-{
-
- /// <summary>
- /// LocalClockSynchronizer is a fake <see cref="ClockSynchronizer"/> that simply calls System.nanoTime(). It exists so that
- /// the same tests can be run distributed or locally, taking timings against the ClockSynchronizer interface without
- /// being aware of how they are being run.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Supply the local clock with no delta.
- /// </table>
- /// </summary>
- public class LocalClockSynchronizer : ClockSynchronizer
- {
- /// <summary>
- /// The slave side should call this to copute a clock delta with the reference.
- /// </summary>
- /// <exception cref="Apache.Qpid.Integration.Tests.framework.clocksynch.ClockSynchFailureException"> If synchronization cannot be achieved. </exception>
- public void synch() throws ClockSynchFailureException
- { }
-
- /// <summary>
- /// Gets the clock delta in nano seconds.
- /// </summary>
- /// <return> The clock delta in nano seconds. </return>
- public long getDelta()
- {
- return 0L;
- }
-
- /// <summary>
- /// Gets an estimate of the clock error in nan seconds.
- /// </summary>
- /// <return> An estimate of the clock error in nan seconds. </return>
- public long getEpsilon()
- {
- return 0L;
- }
-
- /// <summary>
- /// Gets the local clock time with any computed delta added in.
- /// </summary>
- /// <return> The local clock time with any computed delta added in. </return>
- public long nanoTime()
- {
- return System.nanoTime();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/UDPClockSynchronizer.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/UDPClockSynchronizer.csx
deleted file mode 100644
index 98b02a043b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/clocksynch/UDPClockSynchronizer.csx
+++ /dev/null
@@ -1,453 +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 log4net;
-
-using uk.co.thebadgerset.junit.extensions.util.CommandLineParser;
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using java.io.IOException;
-using java.net.*;
-using java.nio.ByteBuffer;
-using java.util.Arrays;
-
-namespace Apache.Qpid.Integration.Tests.framework.clocksynch
-{
- /// <summary>
- /// UDPClockSynchronizer is a <see cref="ClockSynchronizer"/> that sends pings as UDP datagrams, and uses the following simple
- /// algorithm to perform clock synchronization:
- ///
- /// <ol>
- /// <li>Slave initiates synchronization with a Reference clock.</li>
- /// <li>Slave stamps current local time on a "time request" message and sends to the Reference.</li>
- /// <li>Upon receipt by Reference, Reference stamps Reference-time and returns.</li>
- /// <li>Upon receipt by Slave, Slave subtracts current time from sent time and divides by two to compute latency. It
- /// subtracts current time from Reference time to determine Slave-Reference time delta and adds in the
- /// half-latency to get the correct clock delta.</li>
- /// <li>The first result is immediately used to update the clock since it will get the local clock into at least
- /// the right ballpark.</li>
- /// <li>The Slave repeats steps 2 through 4, 15 more times.</li>
- /// <li>The results of the packet receipts are accumulated and sorted in lowest-latency to highest-latency order. The
- /// median latency is determined by picking the mid-point sample from this ordered list.</li>
- /// <li>All samples outside 1 standard-deviation from the median are discarded and the remaining samples
- /// are averaged using an arithmetic mean.</li>
- /// </ol>
- ///
- /// <p/>The use of UDP datagrams, instead of TCP based communication eliminates the hidden delays that TCP can introduce,
- /// as it can transparently re-order or re-send packets, or introduce delays as packets are naggled.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Trigger a clock synchronziation.
- /// <tr><td> Compute a clock delta to apply to the local clock.
- /// <tr><td> Estimate the error in the synchronzation.
- /// </table>
- /// </summary>
- public class UDPClockSynchronizer : ClockSynchronizer
- {
- /// <summary> Used for debugging. </summary>
- // private static ILog log = LogManager.GetLogger(typeof(UDPClockSynchronizer));
-
- /// <summary> Defines the timeout to use when waiting for responses to time requests. </summary>
- private static final int TIMEOUT = 50;
-
- /// <summary> The clock delta. </summary>
- private long delta = 0L;
-
- /// <summary> Holds an estimate of the clock error relative to the reference clock. </summary>
- private long epsilon = 0L;
-
- /// <summary> Holds the address of the reference clock. </summary>
- private InetAddress referenceAddress;
-
- /// <summary> Holds the socket to communicate with the reference service over. </summary>
- private DatagramSocket socket;
-
- /// <summary> Used to control the shutdown in the main test loop. </summary>
- private static bool doSynch = true;
-
- /// <summary>
- /// Creates a clock synchronizer against the specified address for the reference.
- /// </summary>
- /// <param name="address"> The address of the reference service. </param>
- public UDPClockSynchronizer(string address)
- {
- try
- {
- referenceAddress = InetAddress.getByName(address);
- }
- catch (UnknownHostException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /// <summary>
- /// The slave side should call this to compute a clock delta with the reference.
- /// </summary>
- /// <exception cref="ClockSynchFailureException"> If synchronization cannot be achieved, due to unavailability of the reference
- /// time service. </exception>
- public void synch() throws ClockSynchFailureException
- {
- try
- {
- socket = new DatagramSocket();
- socket.setSoTimeout(TIMEOUT);
-
- // Synchronize on a single ping, to get the clock into the right ball-park.
- synch(1);
-
- // Synchronize on 15 pings.
- synch(15);
-
- // And again, for greater accuracy, on 31.
- synch(31);
-
- socket.close();
- }
- catch (SocketException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /// <summary>
- /// Updates the synchronization delta by performing the specified number of reference clock requests.
- /// </summary>
- /// <param name="n"> The number of reference clock request cycles to perform. </param>
- ///
- /// <exception cref="ClockSynchFailureException"> If synchronization cannot be achieved, due to unavailability of the reference
- /// time service. </exception>
- protected void synch(int n) throws ClockSynchFailureException
- {
- // log.debug("protected void synch(int n = " + n + "): called");
-
- // Create an array of deltas by performing n reference pings.
- long[] delta = new long[n];
-
- for (int i = 0; i < n; i++)
- {
- delta[i] = ping();
- }
-
- // Reject any deltas that are larger than 1 s.d. above the median.
- long median = median(delta);
- long sd = standardDeviation(delta);
-
- // log.debug("median = " + median);
- // log.debug("sd = " + sd);
-
- long[] tempDeltas = new long[n];
- int count = 0;
-
- for (int i = 0; i < n; i++)
- {
- if ((delta[i] <= (median + sd)) && (delta[i] >= (median - sd)))
- {
- tempDeltas[count] = delta[i];
- count++;
- }
- else
- {
- // log.debug("Rejected: " + delta[i]);
- }
- }
-
- System.arraycopy(tempDeltas, 0, delta, 0, count);
-
- // Estimate the delta as the mean of the remaining deltas.
- this.delta += mean(delta);
-
- // Estimate the error as the standard deviation of the remaining deltas.
- this.epsilon = standardDeviation(delta);
-
- // log.debug("this.delta = " + this.delta);
- // log.debug("this.epsilon = " + this.epsilon);
- }
-
- /// <summary>
- /// Performs a single reference clock request cycle and returns the estimated delta relative to the local clock.
- /// This is computed as the half-latency of the requst cycle, plus the reference clock, minus the local clock.
- /// </summary>
- /// <return> The estimated clock delta. </return>
- ///
- /// <exception cref="ClockSynchFailureException"> If the reference service is not responding. </exception>
- protected long ping() throws ClockSynchFailureException
- {
- // log.debug("protected long ping(): called");
-
- try
- {
- byte[] buf = new byte[256];
-
- bool timedOut = false;
- long start = 0L;
- long refTime = 0L;
- long localTime = 0L;
- long latency = 0L;
- int failCount = 0;
-
- // Keep trying the ping until it gets a response, or 10 tries in a row all time out.
- do
- {
- // Start timing the request latency.
- start = nanoTime();
-
- // Get the reference time.
- DatagramPacket packet =
- new DatagramPacket(buf, buf.length, referenceAddress, UDPClockReference.REFERENCE_PORT);
- socket.send(packet);
- packet = new DatagramPacket(buf, buf.length);
-
- timedOut = false;
-
- try
- {
- socket.receive(packet);
- }
- catch (SocketTimeoutException e)
- {
- timedOut = true;
- failCount++;
-
- continue;
- }
-
- ByteBuffer bbuf = ByteBuffer.wrap(packet.getData());
- refTime = bbuf.getLong();
-
- // Stop timing the request latency.
- localTime = nanoTime();
- latency = localTime - start;
-
- // log.debug("refTime = " + refTime);
- // log.debug("localTime = " + localTime);
- // log.debug("start = " + start);
- // log.debug("latency = " + latency);
- // log.debug("delta = " + ((latency / 2) + (refTime - localTime)));
-
- }
- while (timedOut && (failCount < 10));
-
- // Fail completely if the fail count is too high.
- if (failCount >= 10)
- {
- throw new ClockSynchFailureException("Clock reference not responding.", null);
- }
-
- // Estimate delta as (ref clock + half-latency) - local clock.
- return (latency / 2) + (refTime - localTime);
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /// <summary>
- /// Gets the clock delta in nano seconds.
- /// </summary>
- /// <return> The clock delta in nano seconds. </return>
- public long getDelta()
- {
- return delta;
- }
-
- /// <summary>
- /// Gets an estimate of the clock error in nan seconds.
- /// </summary>
- /// <return> An estimate of the clock error in nan seconds. </return>
- public long getEpsilon()
- {
- return epsilon;
- }
-
- /// <summary>
- /// Gets the local clock time with any computed delta added in.
- /// </summary>
- /// <return> The local clock time with any computed delta added in. </return>
- public long nanoTime()
- {
- return System.nanoTime() + delta;
- }
-
- /// <summary>
- /// Computes the median of a series of values.
- /// </summary>
- /// <param name="values"> The values. </param>
- ///
- /// <return> The median. </return>
- public static long median(long[] values)
- {
- // log.debug("public static long median(long[] values = " + Arrays.ToString(values) + "): called");
-
- long median;
-
- // Order the list of values.
- long[] orderedValues = new long[values.length];
- System.arraycopy(values, 0, orderedValues, 0, values.length);
- Arrays.sort(orderedValues);
-
- // Check if the median is computed from a pair of middle value.
- if ((orderedValues.length % 2) == 0)
- {
- int middle = orderedValues.length / 2;
-
- median = (orderedValues[middle] + orderedValues[middle - 1]) / 2;
- }
- // The median is computed from a single middle value.
- else
- {
- median = orderedValues[orderedValues.length / 2];
- }
-
- // log.debug("median = " + median);
-
- return median;
- }
-
- /// <summary>
- /// Computes the mean of a series of values.
- /// </summary>
- /// <param name="values"> The values. </param>
- ///
- /// <return> The mean. </return>
- public static long mean(long[] values)
- {
- // log.debug("public static long mean(long[] values = " + Arrays.ToString(values) + "): called");
-
- long total = 0L;
-
- for (long value : values)
- {
- total += value;
- }
-
- long mean = total / values.length;
-
- // log.debug("mean = " + mean);
-
- return mean;
- }
-
- /// <summary>
- /// Computes the variance of series of values.
- /// </summary>
- /// <param name="values"> The values. </param>
- ///
- /// <return> The variance of the values. </return>
- public static long variance(long[] values)
- {
- // log.debug("public static long variance(long[] values = " + Arrays.ToString(values) + "): called");
-
- long mean = mean(values);
-
- long totalVariance = 0;
-
- for (long value : values)
- {
- long diff = (value - mean);
- totalVariance += diff/// diff;
- }
-
- long variance = totalVariance / values.length;
-
- // log.debug("variance = " + variance);
-
- return variance;
- }
-
- /// <summary>
- /// Computes the standard deviation of a series of values.
- /// </summary>
- /// <param name="values"> The values. </param>
- ///
- /// <return> The standard deviation. </return>
- public static long standardDeviation(long[] values)
- {
- // log.debug("public static long standardDeviation(long[] values = " + Arrays.ToString(values) + "): called");
-
- long sd = Double.valueOf(Math.sqrt(variance(values))).longValue();
-
- // log.debug("sd = " + sd);
-
- return sd;
- }
-
- /// <summary>
- /// For testing purposes. Supply address of reference clock as arg 1.
- /// </summary>
- /// <param name="args"> Address of reference clock as arg 1. </param>
- public static void main(String[] args)
- {
- ParsedProperties options =
- new ParsedProperties(CommandLineParser.processCommandLine(args,
- new CommandLineParser(
- new String[][]
- {
- { "1", "Address of clock reference service.", "address", "true" }
- }), System.getProperties()));
-
- string address = options.getProperty("1");
-
- // Create a clock synchronizer.
- UDPClockSynchronizer clockSyncher = new UDPClockSynchronizer(address);
-
- // Set up a shutdown hook for it.
- Runtime.getRuntime().addShutdownHook(new Thread(new Runnable()
- {
- public void run()
- {
- doSynch = false;
- }
- }));
-
- // Repeat the clock synching until the user kills the progam.
- while (doSynch)
- {
- // Perform a clock clockSynch.
- try
- {
- clockSyncher.synch();
-
- // Print out the clock delta and estimate of the error.
- System.out.println("Delta = " + clockSyncher.getDelta());
- System.out.println("Epsilon = " + clockSyncher.getEpsilon());
-
- try
- {
- Thread.sleep(250);
- }
- catch (InterruptedException e)
- {
- // Restore the interrupted status and terminate the loop.
- Thread.currentThread().interrupt();
- doSynch = false;
- }
- }
- // Terminate if the reference time service is unavailable.
- catch (ClockSynchFailureException e)
- {
- doSynch = false;
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClient.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClient.csx
deleted file mode 100644
index 1126fec520..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClient.csx
+++ /dev/null
@@ -1,493 +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 log4net;
-using org.apache.log4j.NDC;
-
-using Apache.Qpid.Integration.Tests.framework.MessagingTestConfigProperties;
-using Apache.Qpid.Integration.Tests.framework.TestUtils;
-using Apache.Qpid.Integration.Tests.framework.clocksynch.ClockSynchThread;
-using Apache.Qpid.Integration.Tests.framework.clocksynch.UDPClockSynchronizer;
-using org.apache.qpid.util.ReflectionUtils;
-using org.apache.qpid.util.ReflectionUtilsException;
-
-using uk.co.thebadgerset.junit.extensions.SleepThrottle;
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-using uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
-
-using javax.jms.*;
-
-using java.util.*;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedtesting
-{
- /// <summary>
- /// Implements a test client as described in the interop testing spec
- /// (http://cwiki.apache.org/confluence/display/qpid/Interop+Testing+Specification). A test client is an agent that
- /// reacts to control message sequences send by the test <see cref="Coordinator"/>.
- ///
- /// <p/><table><caption>Messages Handled by TestClient</caption>
- /// <tr><th> Message <th> Action
- /// <tr><td> Invite(compulsory) <td> Reply with Enlist.
- /// <tr><td> Invite(test case) <td> Reply with Enlist if test case available.
- /// <tr><td> AssignRole(test case) <td> Reply with Accept Role if matches an enlisted test. Keep test parameters.
- /// <tr><td> Start <td> Send test messages defined by test parameters. Send report on messages sent.
- /// <tr><td> Status Request <td> Send report on messages received.
- /// <tr><td> Terminate <td> Terminate the test client.
- /// <tr><td> ClockSynch <td> Synch clock against the supplied UDP address.
- /// </table>
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Handle all incoming control messages. <td> <see cref="TestClientControlledTest"/>
- /// <tr><td> Configure and look up test cases by name. <td> <see cref="TestClientControlledTest"/>
- /// </table>
- /// </summary>
- public class TestClient : MessageListener
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(TestClient));
-
- /// <summary> Used for reporting to the console. </summary>
- private static ILog console = LogManager.GetLogger("CONSOLE");
-
- /// <summary> Holds the default identifying name of the test client. </summary>
- public static final string CLIENT_NAME = "java";
-
- /// <summary> Holds the URL of the broker to run the tests on. </summary>
- public static string brokerUrl;
-
- /// <summary> Holds the virtual host to run the tests on. If <tt>null</tt>, then the default virtual host is used. </summary>
- public static string virtualHost;
-
- /// <summary>
- /// Holds the test context properties that provides the default test parameters, plus command line overrides.
- /// This is initialized with the default test parameters, to which command line overrides may be applied.
- /// </summary>
- public static ParsedProperties testContextProperties =
- TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- /// <summary> Holds all the test cases loaded from the classpath. </summary>
- Map<String, TestClientControlledTest> testCases = new HashMap<String, TestClientControlledTest>();
-
- /// <summary> Holds the test case currently being run by this client. </summary>
- protected TestClientControlledTest currentTestCase;
-
- /// <summary> Holds the connection to the broker that the test is being coordinated on. </summary>
- protected Connection connection;
-
- /// <summary> Holds the message producer to hold the test coordination over. </summary>
- protected MessageProducer producer;
-
- /// <summary> Holds the JMS controlSession for the test coordination. </summary>
- protected Session session;
-
- /// <summary> Holds the name of this client, with a default value. </summary>
- protected string clientName = CLIENT_NAME;
-
- /// <summary> This flag indicates that the test client should attempt to join the currently running test case on start up. </summary>
- protected bool join;
-
- /// <summary> Holds the clock synchronizer for the test node. </summary>
- ClockSynchThread clockSynchThread;
-
- /// <summary>
- /// Creates a new interop test client, listenting to the specified broker and virtual host, with the specified client
- /// identifying name.
- /// </summary>
- /// <param name="pBrokerUrl"> The url of the broker to connect to. </param>
- /// <param name="pVirtualHost"> The virtual host to conect to. </param>
- /// <param name="clientName"> The client name to use. </param>
- /// <param name="join"> Flag to indicate that this client should attempt to join running tests. </param>
- public TestClient(string pBrokerUrl, string pVirtualHost, string clientName, bool join)
- {
- log.debug("public TestClient(string pBrokerUrl = " + pBrokerUrl + ", string pVirtualHost = " + pVirtualHost
- + ", string clientName = " + clientName + ", bool join = " + join + "): called");
-
- // Retain the connection parameters.
- brokerUrl = pBrokerUrl;
- virtualHost = pVirtualHost;
- this.clientName = clientName;
- this.join = join;
- }
-
- /// <summary>
- /// The entry point for the interop test coordinator. This client accepts the following command line arguments:
- ///
- /// <p/><table>
- /// <tr><td> -b <td> The broker URL. <td> Optional.
- /// <tr><td> -h <td> The virtual host. <td> Optional.
- /// <tr><td> -n <td> The test client name. <td> Optional.
- /// <tr><td> name=value <td> Trailing argument define name/value pairs. Added to system properties. <td> Optional.
- /// </table>
- /// </summary>
- /// <param name="args"> The command line arguments. </param>
- public static void main(String[] args)
- {
- log.debug("public static void main(String[] args = " + Arrays.ToString(args) + "): called");
- console.info("Qpid Distributed Test Client.");
-
- // Override the default broker url to be localhost:5672.
- testContextProperties.setProperty(MessagingTestConfigProperties.BROKER_PROPNAME, "tcp://localhost:5672");
-
- // Use the command line parser to evaluate the command line with standard handling behaviour (print errors
- // and usage then exist if there are errors).
- // Any options and trailing name=value pairs are also injected into the test context properties object,
- // to override any defaults that may have been set up.
- ParsedProperties options =
- new ParsedProperties(uk.co.thebadgerset.junit.extensions.util.CommandLineParser.processCommandLine(args,
- new uk.co.thebadgerset.junit.extensions.util.CommandLineParser(
- new String[][]
- {
- { "b", "The broker URL.", "broker", "false" },
- { "h", "The virtual host to use.", "virtual host", "false" },
- { "o", "The name of the directory to output test timings to.", "dir", "false" },
- { "n", "The name of the test client.", "name", "false" },
- { "j", "Join this test client to running test.", "false" }
- }), testContextProperties));
-
- // Extract the command line options.
- string brokerUrl = options.getProperty("b");
- string virtualHost = options.getProperty("h");
- string clientName = options.getProperty("n");
- clientName = (clientName == null) ? CLIENT_NAME : clientName;
- bool join = options.getPropertyAsBoolean("j");
-
- // To distinguish logging output set up an NDC on the client name.
- NDC.push(clientName);
-
- // Create a test client and start it running.
- TestClient client = new TestClient(brokerUrl, virtualHost, clientName, join);
-
- // Use a class path scanner to find all the interop test case implementations.
- // Hard code the test classes till the classpath scanner is fixed.
- Collection<Class<? extends TestClientControlledTest>> testCaseClasses =
- new ArrayList<Class<? extends TestClientControlledTest>>();
- // ClasspathScanner.getMatches(TestClientControlledTest.class, "^TestCase.*", true);
- testCaseClasses.addAll(loadTestCases("org.apache.qpid.interop.clienttestcases.TestCase1DummyRun",
- "org.apache.qpid.interop.clienttestcases.TestCase2BasicP2P",
- "org.apache.qpid.interop.clienttestcases.TestCase3BasicPubSub",
- "org.apache.qpid.interop.clienttestcases.TestCase4P2PMessageSize",
- "org.apache.qpid.interop.clienttestcases.TestCase5PubSubMessageSize",
- "Apache.Qpid.Integration.Tests.framework.distributedcircuit.TestClientCircuitEnd"));
-
- try
- {
- client.start(testCaseClasses);
- }
- catch (Exception e)
- {
- log.error("The test client was unable to start.", e);
- console.info(e.getMessage());
- System.exit(1);
- }
- }
-
- /// <summary>
- /// Parses a list of class names, and loads them if they are available on the class path.
- /// </summary>
- /// <param name="classNames"> The names of the classes to load. </param>
- ///
- /// <return> A list of the loaded test case classes. </return>
- public static IList<Class<? extends TestClientControlledTest>> loadTestCases(String... classNames)
- {
- IList<Class<? extends TestClientControlledTest>> testCases =
- new LinkedList<Class<? extends TestClientControlledTest>>();
-
- for (string className : classNames)
- {
- try
- {
- Class<?> cls = ReflectionUtils.forName(className);
- testCases.add((Class<? extends TestClientControlledTest>) cls);
- }
- catch (ReflectionUtilsException e)
- {
- // Ignore, class could not be found, so test not available.
- console.warn("Requested class " + className + " cannot be found, ignoring it.");
- }
- catch (ClassCastException e)
- {
- // Ignore, class was not of correct type to be a test case.
- console.warn("Requested class " + className + " is not an instance of TestClientControlledTest.");
- }
- }
-
- return testCases;
- }
-
- /// <summary>
- /// Starts the interop test client running. This causes it to start listening for incoming test invites.
- /// </summary>
- /// <param name="testCaseClasses"> The classes of the available test cases. The test case names from these are used to </param>
- /// matchin incoming test invites against.
- ///
- /// <exception cref="JMSException"> Any underlying JMSExceptions are allowed to fall through. </exception>
- protected void start(Collection<Class<? extends TestClientControlledTest>> testCaseClasses) throws JMSException
- {
- log.debug("protected void start(Collection<Class<? extends TestClientControlledTest>> testCaseClasses = "
- + testCaseClasses + "): called");
-
- // Create all the test case implementations and index them by the test names.
- for (Class<? extends TestClientControlledTest> nextClass : testCaseClasses)
- {
- try
- {
- TestClientControlledTest testCase = nextClass.newInstance();
- testCases.put(testCase.getName(), testCase);
- }
- catch (InstantiationException e)
- {
- log.warn("Could not instantiate test case class: " + nextClass.getName(), e);
- // Ignored.
- }
- catch (IllegalAccessException e)
- {
- log.warn("Could not instantiate test case class due to illegal access: " + nextClass.getName(), e);
- // Ignored.
- }
- }
-
- // Open a connection to communicate with the coordinator on.
- connection = TestUtils.createConnection(testContextProperties);
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Set this up to listen for control messages.
- Topic privateControlTopic = session.createTopic("iop.control." + clientName);
- MessageConsumer consumer = session.createConsumer(privateControlTopic);
- consumer.setMessageListener(this);
-
- Topic controlTopic = session.createTopic("iop.control");
- MessageConsumer consumer2 = session.createConsumer(controlTopic);
- consumer2.setMessageListener(this);
-
- // Create a producer to send replies with.
- producer = session.createProducer(null);
-
- // If the join flag was set, then broadcast a join message to notify the coordinator that a new test client
- // is available to join the current test case, if it supports it. This message may be ignored, or it may result
- // in this test client receiving a test invite.
- if (join)
- {
- Message joinMessage = session.createMessage();
-
- joinMessage.setStringProperty("CONTROL_TYPE", "JOIN");
- joinMessage.setStringProperty("CLIENT_NAME", clientName);
- joinMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
- producer.send(controlTopic, joinMessage);
- }
-
- // Start listening for incoming control messages.
- connection.start();
- }
-
- /// <summary>
- /// Handles all incoming control messages.
- /// </summary>
- /// <param name="message"> The incoming message. </param>
- public void onMessage(Message message)
- {
- NDC.push(clientName);
- log.debug("public void onMessage(Message message = " + message + "): called");
-
- try
- {
- string controlType = message.getStringProperty("CONTROL_TYPE");
- string testName = message.getStringProperty("TEST_NAME");
-
- log.debug("Received control of type '" + controlType + "' for the test '" + testName + "'");
-
- // Check if the message is a test invite.
- if ("INVITE".equals(controlType))
- {
- // Flag used to indicate that an enlist should be sent. Only enlist to compulsory invites or invites
- // for which test cases exist.
- bool enlist = false;
-
- if (testName != null)
- {
- log.debug("Got an invite to test: " + testName);
-
- // Check if the requested test case is available.
- TestClientControlledTest testCase = testCases.get(testName);
-
- if (testCase != null)
- {
- log.debug("Found implementing class for test '" + testName + "', enlisting for it.");
-
- // Check if the test case will accept the invitation.
- enlist = testCase.acceptInvite(message);
-
- log.debug("The test case "
- + (enlist ? " accepted the invite, enlisting for it."
- : " did not accept the invite, not enlisting."));
-
- // Make the requested test case the current test case.
- currentTestCase = testCase;
- }
- else
- {
- log.debug("Received an invite to the test '" + testName + "' but this test is not known.");
- }
- }
- else
- {
- log.debug("Got a compulsory invite, enlisting for it.");
-
- enlist = true;
- }
-
- if (enlist)
- {
- // Reply with the client name in an Enlist message.
- Message enlistMessage = session.createMessage();
- enlistMessage.setStringProperty("CONTROL_TYPE", "ENLIST");
- enlistMessage.setStringProperty("CLIENT_NAME", clientName);
- enlistMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
- enlistMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending enlist message '" + enlistMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), enlistMessage);
- }
- else
- {
- // Reply with the client name in an Decline message.
- Message enlistMessage = session.createMessage();
- enlistMessage.setStringProperty("CONTROL_TYPE", "DECLINE");
- enlistMessage.setStringProperty("CLIENT_NAME", clientName);
- enlistMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
- enlistMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending decline message '" + enlistMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), enlistMessage);
- }
- }
- else if ("ASSIGN_ROLE".equals(controlType))
- {
- // Assign the role to the current test case.
- string roleName = message.getStringProperty("ROLE");
-
- log.debug("Got a role assignment to role: " + roleName);
-
- TestClientControlledTest.Roles role = Enum.valueOf(TestClientControlledTest.Roles.class, roleName);
-
- currentTestCase.assignRole(role, message);
-
- // Reply by accepting the role in an Accept Role message.
- Message acceptRoleMessage = session.createMessage();
- acceptRoleMessage.setStringProperty("CLIENT_NAME", clientName);
- acceptRoleMessage.setStringProperty("CONTROL_TYPE", "ACCEPT_ROLE");
- acceptRoleMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending accept role message '" + acceptRoleMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), acceptRoleMessage);
- }
- else if ("START".equals(controlType) || "STATUS_REQUEST".equals(controlType))
- {
- if ("START".equals(controlType))
- {
- log.debug("Got a start notification.");
-
- // Extract the number of test messages to send from the start notification.
- int numMessages;
-
- try
- {
- numMessages = message.getIntProperty("MESSAGE_COUNT");
- }
- catch (NumberFormatException e)
- {
- // If the number of messages is not specified, use the default of one.
- numMessages = 1;
- }
-
- // Start the current test case.
- currentTestCase.start(numMessages);
- }
- else
- {
- log.debug("Got a status request.");
- }
-
- // Generate the report from the test case and reply with it as a Report message.
- Message reportMessage = currentTestCase.getReport(session);
- reportMessage.setStringProperty("CLIENT_NAME", clientName);
- reportMessage.setStringProperty("CONTROL_TYPE", "REPORT");
- reportMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending report message '" + reportMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), reportMessage);
- }
- else if ("TERMINATE".equals(controlType))
- {
- console.info("Received termination instruction from coordinator.");
-
- // Is a cleaner shutdown needed?
- connection.close();
- System.exit(0);
- }
- else if ("CLOCK_SYNCH".equals(controlType))
- {
- log.debug("Received clock synch command.");
- string address = message.getStringProperty("ADDRESS");
-
- log.debug("address = " + address);
-
- // Re-create (if necessary) and start the clock synch thread to synch the clock every ten seconds.
- if (clockSynchThread != null)
- {
- clockSynchThread.terminate();
- }
-
- SleepThrottle throttle = new SleepThrottle();
- throttle.setRate(0.1f);
-
- clockSynchThread = new ClockSynchThread(new UDPClockSynchronizer(address), throttle);
- clockSynchThread.start();
- }
- else
- {
- // Log a warning about this but otherwise ignore it.
- log.warn("Got an unknown control message, controlType = " + controlType + ", message = " + message);
- }
- }
- catch (JMSException e)
- {
- // Log a warning about this, but otherwise ignore it.
- log.warn("Got JMSException whilst handling message: " + message, e);
- }
- // Log any runtimes that fall through this message handler. These are fatal errors for the test client.
- catch (RuntimeException e)
- {
- log.error("The test client message handler got an unhandled exception: ", e);
- console.info("The message handler got an unhandled exception, terminating the test client.");
- System.exit(1);
- }
- finally
- {
- NDC.pop();
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClientCircuitEnd.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClientCircuitEnd.csx
deleted file mode 100644
index 5ac2c4bf5b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClientCircuitEnd.csx
+++ /dev/null
@@ -1,312 +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 log4net;
-
-using Apache.Qpid.Integration.Tests.framework.*;
-using Apache.Qpid.Integration.Tests.framework.distributedtesting.TestClientControlledTest;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-using uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
-
-using javax.jms.*;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedcircuit
-{
- /// <summary>
- /// A TestClientCircuitEnd is a <see cref="CircuitEnd"/> that may be controlled from a
- /// <see cref="Apache.Qpid.Integration.Tests.framework.distributedtesting.TestClient"/>, and that forms a single publishing or
- /// receiving end point in a distributed test <see cref="Apache.Qpid.Integration.Tests.framework.Circuit"/>.
- ///
- /// <p/>When operating in the SENDER role, this circuit end is capable of acting as part of the default circuit test
- /// procedure (described in the class comment for <see cref="Apache.Qpid.Integration.Tests.framework.Circuit"/>). That is, it will
- /// send the number of test messages required, using the test configuration parameters given in the test invite, and
- /// return a report on its activities to the circuit controller.
- ///
- /// <p/>When operation in the RECEIVER role, this circuit end acts as part of the default circuit test procedure. It will
- /// receive test messages, on the setup specified in the test configuration parameters, and keep count of the messages
- /// received, and time taken to receive them. When requested by the circuit controller to provide a report, it will
- /// return this report of its activities.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide a message producer for sending messages.
- /// <td> <see cref="CircuitEnd"/>, <see cref="LocalCircuitFactory"/>, <see cref="TestUtils"/>
- /// <tr><td> Provide a message consumer for receiving messages.
- /// <td> <see cref="CircuitEnd"/>, <see cref="LocalCircuitFactory"/>, <see cref="TestUtils"/>
- /// <tr><td> Supply the name of the test case that this implements.
- /// <tr><td> Accept/Reject invites based on test parameters. <td> <see cref="MessagingTestConfigProperties"/>
- /// <tr><td> Adapt to assigned roles. <td> <see cref="TestClientControlledTest.Roles"/>
- /// <tr><td> Perform test case actions. <td> <see cref="MessageMonitor"/>
- /// <tr><td> Generate test reports. <td> <see cref="MessageMonitor"/>
- /// </table>
- /// </summary>
- public class TestClientCircuitEnd : CircuitEnd, TestClientControlledTest
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(TestClientCircuitEnd));
-
- /// <summary> Holds the test parameters. </summary>
- ParsedProperties testProps;
-
- /// <summary> The number of test messages to send. </summary>
- private int numMessages;
-
- /// <summary> The role to be played by the test. </summary>
- private Roles role;
-
- /// <summary> The connection to send the test messages on. </summary>
- private Connection connection;
-
- /// <summary> Holds the circuit end for this test. </summary>
- CircuitEnd circuitEnd;
-
- /// <summary>
- /// Holds a message monitor for this circuit end, either the monitor on the consumer when in RECEIVER more, or
- /// a monitor updated on every message sent, when acting as a SENDER.
- MessageMonitor messageMonitor;
-
- /// <summary>
- /// Should provide the name of the test case that this class implements. The exact names are defined in the
- /// interop testing spec.
- /// </summary>
- /// <return> The name of the test case that this implements. </return>
- public string getName()
- {
- return "DEFAULT_CIRCUIT_TEST";
- }
-
- /// <summary>
- /// Determines whether the test invite that matched this test case is acceptable.
- /// </summary>
- /// <param name="inviteMessage"> The invitation to accept or reject. </param>
- /// <return> <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it. </return>
- /// </summary>
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- public bool acceptInvite(Message inviteMessage) throws JMSException
- {
- log.debug("public bool acceptInvite(Message inviteMessage): called");
-
- // Populate the test parameters from the invitation.
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- for (Object key : testProps.keySet())
- {
- string propName = (String) key;
-
- // If the test parameters is overridden by the invitation, use it instead.
- string inviteValue = inviteMessage.getStringProperty(propName);
-
- if (inviteValue != null)
- {
- testProps.setProperty(propName, inviteValue);
- log.debug("Test invite supplied override to " + propName + " of " + inviteValue);
- }
-
- }
-
- // Accept the invitation.
- return true;
- }
-
- /// <summary>
- /// Assigns the role to be played by this test case. The test parameters are fully specified in the
- /// assignment message. When this method return the test case will be ready to execute.
- /// </summary>
- /// <param name="role"> The role to be played; sender or receivers. </param>
- /// <param name="assignRoleMessage"> The role assingment message, contains the full test parameters. </param>
- ///
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
- {
- log.debug("public void assignRole(Roles role, Message assignRoleMessage): called");
-
- // Take note of the role to be played.
- this.role = role;
-
- // Extract and retain the test parameters.
- numMessages = 1; // assignRoleMessage.getIntProperty("NUM_MESSAGES");
-
- // Connect using the test parameters.
- connection = TestUtils.createConnection(testProps);
-
- // Create a circuit end that matches the assigned role and test parameters.
- LocalCircuitFactory circuitFactory = new LocalCircuitFactory();
-
- switch (role)
- {
- // Check if the sender role is being assigned, and set up a message producer if so.
- case SENDER:
-
- // Set up the publisher.
- circuitEnd = circuitFactory.createPublisherCircuitEnd(connection, testProps, 0L);
-
- // Create a custom message monitor that will be updated on every message sent.
- messageMonitor = new MessageMonitor();
-
- break;
-
- // Otherwise the receivers role is being assigned, so set this up to listen for messages.
- case RECEIVER:
-
- // Set up the receiver.
- circuitEnd = circuitFactory.createReceiverCircuitEnd(connection, testProps, 0L);
-
- // Use the message monitor from the consumer for stats.
- messageMonitor = getMessageMonitor();
-
- break;
- }
-
- // Reset all messaging stats for the report.
- messageMonitor.reset();
-
- connection.start();
- }
-
- /// <summary>
- /// Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
- /// </summary>
- /// <param name="numMessages"> The number of test messages to send. </param>
- ///
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- ///
- /// <remarks> Add round robin on destinations where multiple destinations being used.</remarks>
- ///
- /// <remarks> Add rate limiting when rate limit specified on publishers.</remarks>
- ///
- /// <remarks> Add Max pending message size protection. The receiver will have to send back some acks once in a while,
- /// to notify the publisher that its messages are being consumed. This makes the safety valve harder to
- /// implement than in the single VM case. For example, if the limit is 1000 messages, might want to get back
- /// an ack every 500, to notify the publisher that it can keep sending. What about pub/sub tests? Will it be
- /// necessary to wait for an ack from every receiver? This will have the effect of rate limiting to slow
- /// consumers too.</remarks>
- ///
- /// <remarks> Add commits on every commit batch size boundary.</remarks>
- public void start(int numMessages) throws JMSException
- {
- log.debug("public void start(): called");
-
- // If in the SENDER role, send the specified number of test messages to the circuit destinations.
- if (role.equals(Roles.SENDER))
- {
- Message testMessage = getSession().createMessage();
-
- for (int i = 0; i < numMessages; i++)
- {
- getProducer().send(testMessage);
-
- // Increment the message count and timings.
- messageMonitor.onMessage(testMessage);
- }
- }
- }
-
- /// <summary>
- /// Gets a report on the actions performed by the test case in its assigned role.
- /// </summary>
- /// <param name="session"> The controlSession to create the report message in. </param>
- /// <return> The report message. </return>
- ///
- /// <exception cref="JMSException"> Any JMSExceptions resulting from creating the report are allowed to fall through. </exception>
- public Message getReport(Session session) throws JMSException
- {
- Message report = session.createMessage();
- report.setStringProperty("CONTROL_TYPE", "REPORT");
-
- // Add the count of messages sent/received to the report.
- report.setIntProperty("MESSAGE_COUNT", messageMonitor.getNumMessage());
-
- // Add the time to send/receive messages to the report.
- report.setLongProperty("TEST_TIME", messageMonitor.getTime());
-
- // Add any exceptions detected to the report.
-
- return report;
- }
-
- /// <summary>
- /// Gets the message producer at this circuit end point.
- /// </summary>
- /// <return> The message producer at with this circuit end point. </return>
- public MessageProducer getProducer()
- {
- return circuitEnd.getProducer();
- }
-
- /// <summary>
- /// Gets the message consumer at this circuit end point.
- /// </summary>
- /// <return> The message consumer at this circuit end point. </return>
- public MessageConsumer getConsumer()
- {
- return circuitEnd.getConsumer();
- }
-
- /// <summary>
- /// Send the specified message over the producer at this end point.
- /// </summary>
- /// <param name="message"> The message to send. </param>
- ///
- /// <exception cref="JMSException"> Any JMS exception occuring during the send is allowed to fall through. </exception>
- public void send(Message message) throws JMSException
- {
- // Send the message on the circuit ends producer.
- circuitEnd.send(message);
- }
-
- /// <summary>
- /// Gets the JMS Session associated with this circuit end point.
- /// </summary>
- /// <return> The JMS Session associated with this circuit end point. </return>
- public Session getSession()
- {
- return circuitEnd.getSession();
- }
-
- /// <summary>
- /// Closes the message producers and consumers and the sessions, associated with this circuit end point.
- ///
- /// <exception cref="JMSException"> Any JMSExceptions occurring during the close are allowed to fall through. </exception>
- public void close() throws JMSException
- {
- // Close the producer and consumer.
- circuitEnd.close();
- }
-
- /// <summary>
- /// Returns the message monitor for reporting on received messages on this circuit end.
- /// </summary>
- /// <return> The message monitor for this circuit end. </return>
- public MessageMonitor getMessageMonitor()
- {
- return circuitEnd.getMessageMonitor();
- }
-
- /// <summary>
- /// Returns the exception monitor for reporting on exceptions received on this circuit end.
- /// </summary>
- /// <return> The exception monitor for this circuit end. </return>
- public ExceptionMonitor getExceptionMonitor()
- {
- return circuitEnd.getExceptionMonitor();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClientControlledTest.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClientControlledTest.csx
deleted file mode 100644
index cfb06aa642..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/distributedcircuit/TestClientControlledTest.csx
+++ /dev/null
@@ -1,104 +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 javax.jms.JMSException;
-using javax.jms.Message;
-using javax.jms.MessageListener;
-using javax.jms.Session;
-
-namespace Apache.Qpid.Integration.Tests.framework.distributedtesting
-{
- /// <summary>
- /// TestClientControlledTest provides an interface that classes implementing test cases to run on a <see cref="TestClient"/>
- /// node can use. Implementations must be Java beans, that is, to provide a default constructor and to implement the
- /// <see cref="#getName"/> method.
- ///
- /// <p/>The methods specified in this interface are called when the <see cref="TestClient"/> receives control instructions to
- /// apply to the test. There are control instructions to present the test case with the test invite, so that it may
- /// choose whether or not to participate in the test, assign the test to play the sender or receiver role, start the
- /// test and obtain the test status report.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Supply the name of the test case that this implements.
- /// <tr><td> Accept/Reject invites based on test parameters.
- /// <tr><td> Adapt to assigned roles.
- /// <tr><td> Perform test case actions.
- /// <tr><td> Generate test reports.
- /// </table>
- /// </summary>
- public interface TestClientControlledTest
- {
- /// <summary> Defines the possible test case roles that an interop test case can take on. </summary>
- public enum Roles
- {
- /// <summary> Specifies the sender role. </summary>
- SENDER,
-
- /// <summary> Specifies the receivers role. </summary>
- RECEIVER
- }
-
- /// <summary>
- /// Should provide the name of the test case that this class implements. The exact names are defined in the
- /// interop testing spec.
- /// </summary>
- /// <return> The name of the test case that this implements. </return>
- public string getName();
-
- /// <summary>
- /// Determines whether the test invite that matched this test case is acceptable.
- /// </summary>
- /// <param name="inviteMessage"> The invitation to accept or reject. </param>
- ///
- /// <return> <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it. </return>
- ///
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- public bool acceptInvite(Message inviteMessage) throws JMSException;
-
- /// <summary>
- /// Assigns the role to be played by this test case. The test parameters are fully specified in the
- /// assignment message. When this method return the test case will be ready to execute.
- /// </summary>
- /// <param name="role"> The role to be played; sender or receivers. </param>
- /// <param name="assignRoleMessage"> The role assingment message, contains the full test parameters. </param>
- ///
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException;
-
- /// <summary>
- /// Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
- /// </summary>
- /// <param name="numMessages"> The number of test messages to send. </param>
- ///
- /// <exception cref="JMSException"> Any JMSException resulting from reading the message are allowed to fall through. </exception>
- public void start(int numMessages) throws JMSException;
-
- /// <summary>
- /// Gets a report on the actions performed by the test case in its assigned role.
- /// </summary>
- /// <param name="session"> The controlSession to create the report message in. </param>
- ///
- /// <return> The report message. </return>
- ///
- /// <exception cref="JMSException"> Any JMSExceptions resulting from creating the report are allowed to fall through. </exception>
- public Message getReport(Session session) throws JMSException;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalCircuitImpl.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalCircuitImpl.csx
deleted file mode 100644
index 0594e4d781..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalCircuitImpl.csx
+++ /dev/null
@@ -1,290 +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 log4net;
-
-using Apache.Qpid.Integration.Tests.framework.*;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.*;
-
-using System.Collections.Generic.LinkedList;
-using System.Collections.Generic.IList;
-
-namespace Apache.Qpid.Integration.Tests.framework.localcircuit
-{
- /// <summary>
- /// LocalCircuitImpl provides an implementation of the test circuit. This is a local only circuit implementation that
- /// supports a single producer/consumer on each end of the circuit, with both ends of the circuit on the same JVM.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Supply the publishing and receiving ends of a test messaging circuit.
- /// <td> <see cref="LocalPublisherImpl"/>, <see cref="LocalReceiverImpl"/>
- /// <tr><td> Start the circuit running.
- /// <tr><td> Close the circuit down.
- /// <tr><td> Take a reading of the circuits state.
- /// <tr><td> Apply assertions against the circuits state. <td> <see cref="Assertion"/>
- /// <tr><td> Send test messages over the circuit.
- /// <tr><td> Perform the default test procedure on the circuit.
- /// <tr><td> Provide access to connection and controlSession exception monitors. <td> <see cref="ExceptionMonitor"/>
- /// </table>
- /// </summary>
- public class LocalCircuitImpl : Circuit
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(LocalCircuitImpl));
-
- /// <summary> Holds the test configuration for the circuit. </summary>
- private ParsedProperties testProps;
-
- /// <summary> Holds the publishing end of the circuit. </summary>
- private LocalPublisherImpl publisher;
-
- /// <summary> Holds the receiving end of the circuit. </summary>
- private LocalReceiverImpl receiver;
-
- /// <summary> Holds the connection for the publishing end of the circuit. </summary>
- private Connection connection;
-
- /// <summary> Holds the exception listener for the connection on the publishing end of the circuit. </summary>
- private ExceptionMonitor connectionExceptionMonitor;
-
- /// <summary> Holds the exception listener for the controlSession on the publishing end of the circuit. </summary>
- private ExceptionMonitor exceptionMonitor;
-
- /// <summary>
- /// Creates a test circuit using the specified test parameters. The publisher, receivers, connection and
- /// connection monitor must already have been created, to assemble the circuit.
- /// </summary>
- /// <param name="testProps"> The test parameters. </param>
- /// <param name="publisher"> The test publisher. </param>
- /// <param name="receiver"> The test receivers. </param>
- /// <param name="connection"> The connection. </param>
- /// <param name="connectionExceptionMonitor"> The connection exception monitor. </param>
- public LocalCircuitImpl(ParsedProperties testProps, LocalPublisherImpl publisher, LocalReceiverImpl receiver,
- Connection connection, ExceptionMonitor connectionExceptionMonitor)
- {
- this.testProps = testProps;
- this.publisher = publisher;
- this.receiver = receiver;
- this.connection = connection;
- this.connectionExceptionMonitor = connectionExceptionMonitor;
- this.exceptionMonitor = new ExceptionMonitor();
-
- // Set this as the parent circuit on the publisher and receivers.
- publisher.setCircuit(this);
- receiver.setCircuit(this);
- }
-
- /// <summary>
- /// Gets the interface on the publishing end of the circuit.
- /// </summary>
- /// <return> The publishing end of the circuit. </return>
- public Publisher getPublisher()
- {
- return publisher;
- }
-
- /// <summary>
- /// Gets the local publishing circuit end, for direct manipulation.
- /// </summary>
- /// <return> The local publishing circuit end. </return>
- public CircuitEnd getLocalPublisherCircuitEnd()
- {
- return publisher;
- }
-
- /// <summary>
- /// Gets the interface on the receiving end of the circuit.
- /// </summary>
- /// <return> The receiving end of the circuit. </return>
- public Receiver getReceiver()
- {
- return receiver;
- }
-
- /// <summary>
- /// Gets the local receiving circuit end, for direct manipulation.
- /// </summary>
- /// <return> The local receiving circuit end. </return>
- public CircuitEnd getLocalReceiverCircuitEnd()
- {
- return receiver;
- }
-
- /// <summary>
- /// Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit,
- /// into a report, against which assertions may be checked.
- /// </summary>
- public void check()
- { }
-
- /// <summary>
- /// Applied a list of assertions against the test circuit. The <see cref="#check()"/> method should be called before doing
- /// this, to ensure that the circuit has gathered its state into a report to assert against.
- /// </summary>
- /// <param name="assertions"> The list of assertions to apply. </param>
- /// <return> Any assertions that failed. </return>
- public IList<Assertion> applyAssertions(List<Assertion> assertions)
- {
- IList<Assertion> failures = new LinkedList<Assertion>();
-
- for (Assertion assertion : assertions)
- {
- if (!assertion.apply())
- {
- failures.add(assertion);
- }
- }
-
- return failures;
- }
-
- /// <summary> Connects and starts the circuit. After this method is called the circuit is ready to send messages. </summary>
- public void start()
- { }
-
- /// <summary> Closes the circuit. All associated resources are closed. </summary>
- public void close()
- {
- try
- {
- publisher.close();
- receiver.close();
- connection.close();
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Got JMSException during close:" + e.getMessage(), e);
- }
- }
-
- /// <summary> Sends a message on the test circuit. The exact nature of the message sent is controlled by the test parameters. </summary>
- protected void send()
- {
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- bool transactional = props.getPublisherTransacted();
- bool rollback = props.getRollbackPublisher();
-
- // Send a message through the publisher and log any exceptions raised.
- try
- {
- CircuitEnd end = getLocalPublisherCircuitEnd();
-
- end.send(createTestMessage(end));
-
- if (rollback)
- {
- end.getSession().rollback();
- }
- else if (transactional)
- {
- end.getSession().commit();
- }
- }
- catch (JMSException e)
- {
- exceptionMonitor.onException(e);
- }
- }
-
- /// <summary>
- /// Runs the default test procedure against the circuit, and checks that all of the specified assertions hold. The
- /// outline of the default test procedure is:
- ///
- /// <p/><pre>
- /// Start the circuit.
- /// Send test messages.
- /// Request a status report.
- /// Assert conditions on the publishing end of the circuit.
- /// Assert conditions on the receiving end of the circuit.
- /// Close the circuit.
- /// Pass with no failed assertions or fail with a list of failed assertions.
- /// </pre>
- /// </summary>
- /// <param name="numMessages"> The number of messages to send using the default test procedure. </param>
- /// <param name="assertions"> The list of assertions to apply. </param>
- /// <return> Any assertions that failed. </return>
- public IList<Assertion> test(int numMessages, List<Assertion> assertions)
- {
- // Start the test circuit.
- start();
-
- // Send the requested number of test messages.
- for (int i = 0; i < numMessages; i++)
- {
- send();
- }
-
- // Inject a short pause to allow time for exceptions to come back asynchronously.
- TestUtils.pause(500L);
-
- // Request a status report.
- check();
-
- // Clean up the publisher/receivers/controlSession/connections.
- close();
-
- // Apply all of the requested assertions, keeping record of any that fail.
- IList<Assertion> failures = applyAssertions(assertions);
-
- // Return any failed assertions to the caller.
- return failures;
- }
-
- /// <summary>
- /// Creates a message with the properties defined as per the test parameters.
- /// </summary>
- /// <param name="client"> The circuit end to create the message on. </param>
- ///
- /// <return> The test message. </return>
- ///
- /// <exception cref="JMSException"> Any JMSException occurring during creation of the message is allowed to fall through. </exception>
- private Message createTestMessage(CircuitEnd client) throws JMSException
- {
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- return TestUtils.createTestMessageOfSize(client.getSession(), props.getMessageSize());
- }
-
- /// <summary>
- /// Gets the exception monitor for the publishing ends connection.
- /// </summary>
- /// <return> The exception monitor for the publishing ends connection. </return>
- public ExceptionMonitor getConnectionExceptionMonitor()
- {
- return connectionExceptionMonitor;
- }
-
- /// <summary>
- /// Gets the exception monitor for the publishing ends controlSession.
- /// </summary>
- /// <return> The exception monitor for the publishing ends controlSession. </return>
- public ExceptionMonitor getExceptionMonitor()
- {
- return exceptionMonitor;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalPublisherImpl.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalPublisherImpl.csx
deleted file mode 100644
index ecc94067ae..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalPublisherImpl.csx
+++ /dev/null
@@ -1,164 +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 Apache.Qpid.Integration.Tests.framework.*;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.MessageConsumer;
-using javax.jms.MessageProducer;
-using javax.jms.Session;
-
-namespace Apache.Qpid.Integration.Tests.framework.localcircuit
-{
- /// <summary>
- /// Provides an implementation of the <see cref="Publisher"/> interface and wraps a single message producer and consumer on
- /// a single controlSession, as a <see cref="CircuitEnd"/>. A local publisher also acts as a circuit end, because for a locally
- /// located circuit the assertions may be applied directly, there does not need to be any inter-process messaging
- /// between the publisher and its single circuit end, in order to ascertain its status.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide a message producer for sending messages.
- /// <tr><td> Provide a message consumer for receiving messages.
- /// <tr><td> Provide assertion that the publisher received no exceptions.
- /// <tr><td> Provide assertion that the publisher received a no consumers error code.
- /// <tr><td> Provide assertion that the publisher received a no route error code.
- /// </table>
- /// </summary>
- public class LocalPublisherImpl extends CircuitEndBase : Publisher
- {
- /// <summary> Holds a reference to the containing circuit. </summary>
- protected LocalCircuitImpl circuit;
-
- /// <summary>
- /// Creates a circuit end point on the specified producer, consumer and controlSession. Monitors are also configured
- /// for messages and exceptions received by the circuit end.
- /// </summary>
- /// <param name="producer"> The message producer for the circuit end point. </param>
- /// <param name="consumer"> The message consumer for the circuit end point. </param>
- /// <param name="session"> The controlSession for the circuit end point. </param>
- /// <param name="messageMonitor"> The monitor to notify of all messages received by the circuit end. </param>
- /// <param name="exceptionMonitor"> The monitor to notify of all exceptions received by the circuit end. </param>
- public LocalPublisherImpl(MessageProducer producer, MessageConsumer consumer, Session session,
- MessageMonitor messageMonitor, ExceptionMonitor exceptionMonitor)
- {
- super(producer, consumer, session, messageMonitor, exceptionMonitor);
- }
-
- /// <summary>
- /// Creates a circuit end point from the producer, consumer and controlSession in a circuit end base implementation.
- /// </summary>
- /// <param name="end"> The circuit end base implementation to take producers and consumers from. </param>
- public LocalPublisherImpl(CircuitEndBase end)
- {
- super(end.getProducer(), end.getConsumer(), end.getSession(), end.getMessageMonitor(), end.getExceptionMonitor());
- }
-
- /// <summary> Provides an assertion that the publisher encountered no exceptions. </summary>
- ///
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the publisher encountered no exceptions. </return>
- public Assertion noExceptionsAssertion(ParsedProperties testProps)
- {
- return new AssertionBase()
- {
- public bool apply()
- {
- bool passed = true;
- ExceptionMonitor sessionExceptionMonitor = circuit.getExceptionMonitor();
- ExceptionMonitor connectionExceptionMonitor = circuit.getConnectionExceptionMonitor();
-
- if (!connectionExceptionMonitor.assertNoExceptions())
- {
- passed = false;
-
- addError("Was expecting no exceptions.\n");
- addError("Got the following exceptions on the connection, "
- + circuit.getConnectionExceptionMonitor());
- }
-
- if (!sessionExceptionMonitor.assertNoExceptions())
- {
- passed = false;
-
- addError("Was expecting no exceptions.\n");
- addError("Got the following exceptions on the producer, " + circuit.getExceptionMonitor());
- }
-
- return passed;
- }
- };
- }
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- public Assertion channelClosedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Provides an assertion that the publisher got a given exception during the test.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. </param>
- ///
- /// <return> An assertion that the publisher got a given exception during the test. </return>
- public Assertion exceptionAssertion(ParsedProperties testProps, final Class<? extends Exception> exceptionClass)
- {
- return new AssertionBase()
- {
- public bool apply()
- {
- bool passed = true;
- ExceptionMonitor connectionExceptionMonitor = circuit.getConnectionExceptionMonitor();
-
- if (!connectionExceptionMonitor.assertExceptionOfType(exceptionClass))
- {
- passed = false;
-
- addError("Was expecting linked exception type " + exceptionClass.getName()
- + " on the connection.\n");
- addError((connectionExceptionMonitor.size() > 0)
- ? ("Actually got the following exceptions on the connection, " + connectionExceptionMonitor)
- : "Got no exceptions on the connection.");
- }
-
- return passed;
- }
- };
- }
-
- /// <summary>
- /// Sets the contianing circuit.
- /// </summary>
- /// <param name="circuit"> The containing circuit. </param>
- public void setCircuit(LocalCircuitImpl circuit)
- {
- this.circuit = circuit;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalReceiverImpl.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalReceiverImpl.csx
deleted file mode 100644
index b174a4c912..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/localcircuit/LocalReceiverImpl.csx
+++ /dev/null
@@ -1,137 +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 Apache.Qpid.Integration.Tests.framework.*;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.MessageConsumer;
-using javax.jms.MessageProducer;
-using javax.jms.Session;
-
-namespace Apache.Qpid.Integration.Tests.framework.localcircuit
-{
- /// <summary>
- /// Provides an implementation of the <see cref="Receiver"/> interface that wraps a single message producer and consumer on
- /// a single controlSession, as a <see cref="CircuitEnd"/>. A local receiver also acts as a circuit end, because for a locally
- /// located circuit the assertions may be applied directly, there does not need to be any inter process messaging
- /// between the publisher and its single circuit end, in order to ascertain its status.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Provide a message producer for sending messages.
- /// <tr><td> Provide a message consumer for receiving messages.
- /// <tr><td> Provide assertion that the receivers received no exceptions.
- /// <tr><td> Provide assertion that the receivers received all test messages sent to it.
- /// </table>
- /// </summary>
- public class LocalReceiverImpl extends CircuitEndBase : Receiver
- {
- /// <summary> Holds a reference to the containing circuit. </summary>
- private LocalCircuitImpl circuit;
-
- /// <summary>
- /// Creates a circuit end point on the specified producer, consumer and controlSession. Monitors are also configured
- /// for messages and exceptions received by the circuit end.
- /// </summary>
- /// <param name="producer"> The message producer for the circuit end point. </param>
- /// <param name="consumer"> The message consumer for the circuit end point. </param>
- /// <param name="session"> The controlSession for the circuit end point. </param>
- /// <param name="messageMonitor"> The monitor to notify of all messages received by the circuit end. </param>
- /// <param name="exceptionMonitor"> The monitor to notify of all exceptions received by the circuit end. </param>
- public LocalReceiverImpl(MessageProducer producer, MessageConsumer consumer, Session session,
- MessageMonitor messageMonitor, ExceptionMonitor exceptionMonitor)
- {
- super(producer, consumer, session, messageMonitor, exceptionMonitor);
- }
-
- /// <summary>
- /// Creates a circuit end point from the producer, consumer and controlSession in a circuit end base implementation.
- /// </summary>
- /// <param name="end"> The circuit end base implementation to take producers and consumers from. </param>
- public LocalReceiverImpl(CircuitEndBase end)
- {
- super(end.getProducer(), end.getConsumer(), end.getSession(), end.getMessageMonitor(), end.getExceptionMonitor());
- }
-
- /// <summary>
- /// Provides an assertion that the receivers encountered no exceptions.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers encountered no exceptions. </return>
- public Assertion noExceptionsAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the AMQP channel was forcibly closed by an error condition. </return>
- public Assertion channelClosedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Provides an assertion that the receivers got all messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers got all messages that were sent to it. </return>
- public Assertion allMessagesReceivedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Provides an assertion that the receivers got none of the messages that were sent to it.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- ///
- /// <return> An assertion that the receivers got none of the messages that were sent to it. </return>
- public Assertion noMessagesReceivedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Provides an assertion that the receiver got a given exception during the test.
- /// </summary>
- /// <param name="testProps"> The test configuration properties. </param>
- /// <param name="exceptionClass"> The exception class to check for. <return> An assertion that the receiver got a given exception during the test. </return> </param>
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /// <summary>
- /// Sets the contianing circuit.
- /// </summary>
- /// <param name="circuit"> The containing circuit. </param>
- public void setCircuit(LocalCircuitImpl circuit)
- {
- this.circuit = circuit;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/BaseCircuitFactory.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/BaseCircuitFactory.csx
deleted file mode 100644
index 79ddfd878f..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/BaseCircuitFactory.csx
+++ /dev/null
@@ -1,128 +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 log4net;
-
-using Apache.Qpid.Integration.Tests.framework.Circuit;
-using Apache.Qpid.Integration.Tests.framework.TestClientDetails;
-using org.apache.qpid.util.ConversationFactory;
-
-using System.Collections.Generic.LinkedList;
-using System.Collections.Generic.IList;
-using java.util.Properties;
-
-namespace Apache.Qpid.Integration.Tests.framework.sequencers
-{
- /// <summary>
- /// BaseCircuitFactory provides some functionality common to all <see cref="CircuitFactory"/>s, such as the details of
- /// all <see cref="Apache.Qpid.Integration.Tests.framework.distributedtesting.TestClient"/>s that make up the end-points of
- /// the circuits that the factory creates, and an active <see cref="ConversationFactory"/> that can be used to generate
- /// control conversations with those circuit end-points.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Hold the details of the sending and receiving end-points to create circuits from.
- /// <tr><td> Provide a conversation factory to create control conversations with the end-points.
- /// </table>
- /// </summary>
- public abstract class BaseCircuitFactory : CircuitFactory
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(BaseCircuitFactory));
-
- /// <summary> Holds the contact details for the sending test client. </summary>
- protected TestClientDetails sender;
-
- /// <summary> Holds the contact details for the receving test client. </summary>
- protected IList<TestClientDetails> receivers = new LinkedList<TestClientDetails>();
-
- /// <summary> Holds the conversation factory over which to coordinate the test. </summary>
- protected ConversationFactory conversationFactory;
-
- /// <summary>
- /// Creates a test circuit for the test, configered by the test parameters specified.
- /// </summary>
- /// <param name="testProperties"> The test parameters. </param>
- /// <return> A test circuit. </return>
- public Circuit createCircuit(Properties testProperties)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /// <summary>
- /// Sets the sender test client to coordinate the test with.
- /// </summary>
- /// <param name="sender"> The contact details of the sending client in the test. </param>
- public void setSender(TestClientDetails sender)
- {
- log.debug("public void setSender(TestClientDetails sender = " + sender + "): called");
-
- this.sender = sender;
- }
-
- /// <summary>
- /// Sets the receiving test client to coordinate the test with.
- /// </summary>
- /// <param name="receiver"> The contact details of the sending client in the test. </param>
- public void setReceiver(TestClientDetails receiver)
- {
- log.debug("public void setReceiver(TestClientDetails receivers = " + receiver + "): called");
-
- this.receivers.add(receiver);
- }
-
- /// <summary>
- /// Supplies the sending test client.
- /// </summary>
- /// <return> The sending test client. </return>
- public TestClientDetails getSender()
- {
- return sender;
- }
-
- /// <summary>
- /// Supplies the receiving test client.
- /// </summary>
- /// <return> The receiving test client. </return>
- public IList<TestClientDetails> getReceivers()
- {
- return receivers;
- }
-
- /// <summary>
- /// Accepts the conversation factory over which to hold the test coordinating conversation.
- /// </summary>
- /// <param name="conversationFactory"> The conversation factory to coordinate the test over. </param>
- public void setConversationFactory(ConversationFactory conversationFactory)
- {
- this.conversationFactory = conversationFactory;
- }
-
- /// <summary>
- /// Provides the conversation factory for providing the distributed test sequencing conversations over the test
- /// connection.
- /// </summary>
- /// <return> The conversation factory to create test sequencing conversations with. </return>
- public ConversationFactory getConversationFactory()
- {
- return conversationFactory;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.cs
deleted file mode 100644
index 463cf06dfb..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.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.
- *
- */
-using Apache.Qpid.Integration.Tests.framework;
-//using org.apache.qpid.util.ConversationFactory;
-
-//using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-//using javax.jms.JMSException;
-//using javax.jms.Message;
-
-using System.Collections.Generic;//.IList;
-//using System.Collections.Generic.IDictionary;
-//using java.util.Properties;
-
-namespace Apache.Qpid.Integration.Tests.framework.sequencers
-{
- /// <summary>
- /// A CircuitFactory is responsibile for creating test circuits appropriate to the context that a test case is
- /// running in, and providing an implementation of a standard test procedure over a test circuit.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide a standard test procedure over a test circuit.
- /// <tr><td> Construct test circuits appropriate to a tests context.
- /// </table>
- /// </summary>
- public interface CircuitFactory
- {
- /// <summary>
- /// Creates a test circuit for the test, configered by the test parameters specified.
- /// </summary>
- /// <param name="testProperties"> The test parameters. </param>
- ///
- /// <return> A test circuit. </return>
- Circuit CreateCircuit(TestModel testProperties);
-
- /// <summary>
- /// Sets the sender test client to coordinate the test with.
- /// </summary>
- /// <param name="sender"> The contact details of the sending client in the test. </param>
- void SetSender(TestClientDetails sender);
-
- /// <summary>
- /// Sets the receiving test client to coordinate the test with.
- /// </summary>
- /// <param name="receiver"> The contact details of the sending client in the test. </param>
- void SetReceiver(TestClientDetails receiver);
-
- /// <summary>
- /// Supplies the sending test client.
- /// </summary>
- /// <return> The sending test client. </return>
- TestClientDetails GetSender();
-
- /// <summary>
- /// Supplies the receiving test client.
- /// </summary>
- /// <return> The receiving test client. </return>
- IList<TestClientDetails> GetReceivers();
-
- /// <summary>
- /// Accepts the conversation factory over which to hold the test coordinating conversation.
- /// </summary>
- /// <param name="conversationFactory"> The conversation factory to coordinate the test over. </param>
- //void setConversationFactory(ConversationFactory conversationFactory);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.csx b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.csx
deleted file mode 100644
index 26632266a4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/framework/sequencers/CircuitFactory.csx
+++ /dev/null
@@ -1,99 +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 Apache.Qpid.Integration.Tests.framework.Assertion;
-using Apache.Qpid.Integration.Tests.framework.Circuit;
-using Apache.Qpid.Integration.Tests.framework.TestClientDetails;
-using org.apache.qpid.util.ConversationFactory;
-
-using uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-using javax.jms.JMSException;
-using javax.jms.Message;
-
-using System.Collections.Generic.IList;
-using System.Collections.Generic.IDictionary;
-using java.util.Properties;
-
-namespace Apache.Qpid.Integration.Tests.framework.sequencers
-{
- /// <summary>
- /// A CircuitFactory is responsibile for creating test circuits appropriate to the context that a test case is
- /// running in, and providing an implementation of a standard test procedure over a test circuit.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Provide a standard test procedure over a test circuit.
- /// <tr><td> Construct test circuits appropriate to a tests context.
- /// </table>
- /// </summary>
- public interface CircuitFactory
- {
- /// <summary>
- /// Holds a test coordinating conversation with the test clients. This should consist of assigning the test roles,
- /// begining the test, gathering the test reports from the participants, and checking for assertion failures against
- /// the test reports.
- /// </summary>
- /// <param name="testCircuit"> The test circuit. </param>
- /// <param name="assertions"> The list of assertions to apply to the test circuit. </param>
- /// <param name="testProperties"> The test case definition. </param>
- ///
- /// @deprecated Use test circuits and Circuit.test instead.
- public void sequenceTest(Circuit testCircuit, IList<Assertion> assertions, Properties testProperties);
-
- /// <summary>
- /// Creates a test circuit for the test, configered by the test parameters specified.
- /// </summary>
- /// <param name="testProperties"> The test parameters. </param>
- ///
- /// <return> A test circuit. </return>
- public Circuit createCircuit(ParsedProperties testProperties);
-
- /// <summary>
- /// Sets the sender test client to coordinate the test with.
- /// </summary>
- /// <param name="sender"> The contact details of the sending client in the test. </param>
- public void setSender(TestClientDetails sender);
-
- /// <summary>
- /// Sets the receiving test client to coordinate the test with.
- /// </summary>
- /// <param name="receiver"> The contact details of the sending client in the test. </param>
- public void setReceiver(TestClientDetails receiver);
-
- /// <summary>
- /// Supplies the sending test client.
- /// </summary>
- /// <return> The sending test client. </return>
- public TestClientDetails getSender();
-
- /// <summary>
- /// Supplies the receiving test client.
- /// </summary>
- /// <return> The receiving test client. </return>
- public IList<TestClientDetails> getReceivers();
-
- /// <summary>
- /// Accepts the conversation factory over which to hold the test coordinating conversation.
- /// </summary>
- /// <param name="conversationFactory"> The conversation factory to coordinate the test over. </param>
- public void setConversationFactory(ConversationFactory conversationFactory);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interactive/FailoverTest.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interactive/FailoverTest.cs
deleted file mode 100644
index 547266a7a5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interactive/FailoverTest.cs
+++ /dev/null
@@ -1,397 +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;
-using System.Runtime.InteropServices;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Integration.Tests.interactive
-{
- [TestFixture, Category("Interactive")]
- public class FailoverTest : IConnectionListener
- {
- private static readonly ILog _log = LogManager.GetLogger(typeof(FailoverTest));
-
- /// <summary>Specifies the number of times to run the test cycle.</summary>
- const int NUM_MESSAGES = 10;
-
- /// <summary>Determines how many messages to send within each commit.</summary>
- const int COMMIT_BATCH_SIZE = 1;
-
- /// <summary>Specifies the duration of the pause to place between each message sent in the test.</summary>
- //const int SLEEP_MILLIS = 1;
-
- /// <summary>Specified the maximum time in milliseconds to wait for the test to complete.</summary>
- const int TIMEOUT = 10000;
-
- /// <summary>Defines the number of test messages to send, before prompting the user to fail a broker.</summary>
- const int FAIL_POINT = 5;
-
- /// <summary>Specified the ack mode to use for the test.</summary>
- AcknowledgeMode _acknowledgeMode = AcknowledgeMode.AutoAcknowledge;
-
- /// <summary>Determines whether this test runs transactionally or not. </summary>
- bool transacted = false;
-
- /// <summary>Holds the connection to run the test over.</summary>
- AMQConnection _connection;
-
- /// <summary>Holds the channel for the test message publisher. </summary>
- IChannel publishingChannel;
-
- /// <summary>Holds the test message publisher. </summary>
- IMessagePublisher publisher;
-
- /// <summary>Used to keep count of the number of messages sent. </summary>
- int messagesSent;
-
- /// <summary>Used to keep count of the number of messages received. </summary>
- int messagesReceived;
-
- /// <summary>Used to wait for test completion on. </summary>
- private static object testComplete = new Object();
-
- /// <summary>Used to wait for failover completion on. </summary>
- private static object failoverComplete = new Object();
-
- bool failedOver=false;
-
- /// <summary>Used to record the extra message count (1) if the message sent right after failover actually made it to the new broker.</summary>
- int _extraMessage = 0;
-
- /// <summary>
- /// Creates the test connection with a fail-over set up, and a producer/consumer pair on that connection.
- /// </summary>
- /// [SetUp]
- public void Init(IConnectionInfo connectionInfo)
- {
- //log4net.Config.BasicConfigurator.Configure();
- // Reset all counts.
- messagesSent = 0;
- messagesReceived = 0;
- failedOver=false;
- _extraMessage = 0;
-
- PromptAndWait("Ensure both brokers are running, then press Enter");
-
- // Create a connection for the test.
- _connection = new AMQConnection(connectionInfo);
- _connection.ConnectionListener = this;
-
- // Create a consumer to receive the test messages.
- IChannel receivingChannel = _connection.CreateChannel(false, _acknowledgeMode);
-
- string queueName = receivingChannel.GenerateUniqueName();
- receivingChannel.DeclareQueue(queueName, false, true, true);
- receivingChannel.Bind(queueName, "amq.direct", queueName);
-
- IMessageConsumer consumer = receivingChannel.CreateConsumerBuilder(queueName)
- .WithPrefetchLow(30)
- .WithPrefetchHigh(60).Create();
-
- consumer.OnMessage = new MessageReceivedDelegate(OnMessage);
- _connection.Start();
-
- // Create a publisher to send the test messages.
- publishingChannel = _connection.CreateChannel(transacted, AcknowledgeMode.NoAcknowledge);
- publisher = publishingChannel.CreatePublisherBuilder()
- .WithRoutingKey(queueName)
- .Create();
-
- _log.Debug("connection = " + _connection);
- _log.Debug("connectionInfo = " + connectionInfo);
- _log.Debug("connection.AsUrl = " + _connection.toURL());
- _log.Debug("AcknowledgeMode is " + _acknowledgeMode);
- }
-
- /// <summary>
- /// Clean up the test connection.
- /// </summary>
- [TearDown]
- public virtual void Shutdown()
- {
- if (!failedOver)
- {
- Assert.Fail("The failover callback never occured.");
- }
-
- Console.WriteLine("Test done shutting down");
- Thread.Sleep(2000);
- _connection.Close();
- }
-
- /// <summary>
- /// Runs a failover test, building up the connection information from its component parts. In particular the brokers
- /// to fail between are seperately added into the connection info.
- /// </summary>
- /*[Test]
- public void TestWithBasicInfo()
- {
- _log.Debug("public void TestWithBasicInfo(): called");
-
- // Manually create the connection parameters.
- QpidConnectionInfo connectionInfo = new QpidConnectionInfo();
- connectionInfo.AddBrokerInfo(new AmqBrokerInfo("amqp", "localhost", 5672, false));
- connectionInfo.AddBrokerInfo(new AmqBrokerInfo("amqp", "localhost", 5673, false));
-
- Init(connectionInfo);
- DoFailoverTest();
- }*/
-
- /// <summary>
- /// Runs a failover test, with the failover configuration specified in the Qpid connection URL format.
- /// </summary>
- [Test]
- public void TestWithUrl()
- {
- _log.Debug("public void runTestWithUrl(): called");
-
- // Parse the connection parameters from a URL.
- String clientId = "failover" + DateTime.Now.Ticks;
- string defaultUrl = "amqp://guest:guest@" + clientId + "/test" +
- "?brokerlist='tcp://localhost:9672;tcp://localhost:9673'&failover='roundrobin'";
- IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(defaultUrl);
-
- Init(connectionInfo);
- DoFailoverTest(0);
- }
-
- /// <summary>
- /// Send the test messages, prompting at the fail point for the user to cause a broker failure. The test checks that all messages sent
- /// are received within the test time limit.
- /// </summary>
- ///
- /// <param name="connectionInfo">The connection parameters, specifying the brokers to fail between.</param>
- void DoFailoverTest(int delay)
- {
- _log.Debug("void DoFailoverTest(IConnectionInfo connectionInfo): called");
-
- // Wait for all of the test messages to be received, checking that this occurs within the test time limit.
- bool withinTimeout = false;
-
- for (int i = 1; i <= NUM_MESSAGES; ++i)
- {
- SendMessage();
-
- // Prompt the user to cause a failure if at the fail point.
- if (i == FAIL_POINT)
- {
- for( int min = delay ; min > 0 ; min--)
- {
- Console.WriteLine("Waiting for "+min+" minutes to test connection time bug.");
- Thread.Sleep(60*1000);
- }
-
- PromptAndWait("Cause a broker failure now, then press return.");
- Console.WriteLine("NOTE: ensure that the delay between killing the broker and continuing here is less than 20 second");
-
- Console.WriteLine("Sending a message to ensure send right after works");
-
- SendMessage();
-
- Console.WriteLine("Waiting for fail-over to complete before continuing...");
-
-
- lock(failoverComplete)
- {
- if (!failedOver)
- {
- withinTimeout = Monitor.Wait(failoverComplete, TIMEOUT);
- }
- else
- {
- withinTimeout=true;
- }
- }
-
- if (!withinTimeout)
- {
- PromptAndWait("Failover has not yet occured. Press enter to give up waiting.");
- }
- }
- }
-
- lock(testComplete)
- {
- withinTimeout = Monitor.Wait(testComplete, TIMEOUT);
- }
-
- if (!withinTimeout)
- {
- Assert.Fail("Test timed out, before all messages received.");
- }
-
- _log.Debug("void DoFailoverTest(IConnectionInfo connectionInfo): exiting");
- }
-
- [Test]
- public void Test5MinuteWait()
- {
- String clientId = "failover" + DateTime.Now.Ticks;
-
- QpidConnectionInfo connectionInfo = new QpidConnectionInfo();
- connectionInfo.Username = "guest";
- connectionInfo.Password = "guest";
- connectionInfo.ClientName = clientId;
- connectionInfo.VirtualHost = "/test";
- connectionInfo.AddBrokerInfo(new AmqBrokerInfo("amqp", "localhost", 9672, false));
- connectionInfo.AddBrokerInfo(new AmqBrokerInfo("amqp", "localhost", 9673, false));
-
- Init(connectionInfo);
- DoFailoverTest(5);
- }
-
- void SendMessage()
- {
- ITextMessage msg = publishingChannel.CreateTextMessage("message=" + messagesSent);
-
- publisher.Send(msg);
- messagesSent++;
-
- if (transacted)
- {
- publishingChannel.Commit();
- }
-
- Console.WriteLine("messagesSent = " + messagesSent);
- }
-
- /// <summary>
- /// Receives all of the test messages.
- /// </summary>
- ///
- /// <param name="message">The newly arrived test message.</param>
- public void OnMessage(IMessage message)
- {
- try
- {
- if (_acknowledgeMode == AcknowledgeMode.ClientAcknowledge)
- {
- message.Acknowledge();
- }
-
- messagesReceived++;
-
- _log.Debug("messagesReceived = " + messagesReceived);
-
- // Check if all of the messages in the test have been received, in which case notify the message producer that the test has
- // succesfully completed.
- if (messagesReceived == NUM_MESSAGES + _extraMessage)
- {
- lock (testComplete)
- {
- failedOver = true;
- Monitor.Pulse(testComplete);
- }
- }
- }
- catch (QpidException e)
- {
- _log.Fatal("Exception received. About to stop.", e);
- Stop();
- }
- }
-
- /// <summary>Prompts the user on stdout and waits for a reply on stdin, using the specified prompt message.</summary>
- ///
- /// <param name="message">The message to prompt the user with.</param>
- private void PromptAndWait(string message)
- {
- Console.WriteLine("\n" + message);
- Console.ReadLine();
- }
-
- // <summary>Closes the test connection.</summary>
- private void Stop()
- {
- _log.Debug("Stopping...");
- try
- {
- _connection.Close();
- }
- catch (QpidException e)
- {
- _log.Debug("Failed to shutdown: ", e);
- }
- }
-
- /// <summary>
- /// Called when bytes have been transmitted to the server
- /// </summary>
- ///
- /// <param>count the number of bytes sent in total since the connection was opened</param>
- public void BytesSent(long count) {}
-
- /// <summary>
- /// Called when some bytes have been received on a connection
- /// </summary>
- ///
- /// <param>count the number of bytes received in total since the connection was opened</param>
- public void BytesReceived(long count) {}
-
- /// <summary>
- /// Called after the infrastructure has detected that failover is required but before attempting failover.
- /// </summary>
- ///
- /// <param>redirect true if the broker requested redirect. false if failover is occurring due to a connection error.</param>
- ///
- /// <return>true to continue failing over, false to veto failover and raise a connection exception</return>
- public bool PreFailover(bool redirect)
- {
- _log.Debug("public bool PreFailover(bool redirect): called");
- return true;
- }
-
- /// <summary>
- /// Called after connection has been made to another broker after failover has been started but before
- /// any resubscription has been done.
- /// </summary>
- ///
- /// <return> true to continue with resubscription, false to prevent automatic resubscription. This is useful in
- /// cases where the application wants to handle resubscription. Note that in the latter case all sessions, producers
- /// and consumers are invalidated.
- /// </return>
- public bool PreResubscribe()
- {
- _log.Debug("public bool PreResubscribe(): called");
- return true;
- }
-
- /// <summary>
- /// Called once failover has completed successfully. This is called irrespective of whether the client has
- /// vetoed automatic resubscription.
- /// </summary>
- public void FailoverComplete()
- {
- failedOver = true;
- _log.Debug("public void FailoverComplete(): called");
- Console.WriteLine("public void FailoverComplete(): called");
- lock (failoverComplete)
- {
- Monitor.Pulse(failoverComplete);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interactive/SendReceiveTest.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interactive/SendReceiveTest.cs
deleted file mode 100644
index ebc9307c2e..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interactive/SendReceiveTest.cs
+++ /dev/null
@@ -1,181 +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;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-using Apache.Qpid.Integration.Tests.testcases;
-
-namespace Apache.Qpid.Integration.Tests.interactive
-{
- /// <summary>
- /// SendReceiveTest provides a quick interactive send-receive test, where the user is prompted to trigger each send or receive.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Run an interactive send-receive loop prompting user to trigger each event.
- /// </table>
- /// </summary>
- [TestFixture, Category("Interactive")]
- public class SendReceiveTest : BaseMessagingTestFixture
- {
- /// <summary>Used for debugging purposes.</summary>
- private static ILog log = LogManager.GetLogger(typeof(SendReceiveTest));
-
- /// <summary>Defines the name of the test topic to use with the tests.</summary>
- public const string TEST_ROUTING_KEY = "quicktestkey";
-
- /// <summary>The number of consumers to test.</summary>
- private const int CONSUMER_COUNT = 5;
-
- /// <summary>The number of test messages to send.</summary>
- private const int MESSAGE_COUNT = 10;
-
- /// <summary>Monitor used to signal succesfull receipt of all test messages.</summary>
- AutoResetEvent _finishedEvent;
-
- /// <summary>Used to count test messages received so far.</summary>
- private int _messageReceivedCount;
-
- /// <summary>Used to hold the expected number of messages to receive.</summary>
- private int expectedMessageCount;
-
- /// <summary>Flag used to indicate that all messages really were received, and that the test did not just time out. </summary>
- private bool allReceived;
-
- /// <summary> Creates one producing end-point and many consuming end-points connected on a topic. </summary>
- [SetUp]
- public override void Init()
- {
- base.Init();
-
- // Reset all test counts and flags.
- _messageReceivedCount = 0;
- allReceived = false;
- _finishedEvent = new AutoResetEvent(false);
- }
-
- /// <summary> Cleans up all test end-points. </summary>
- [TearDown]
- public override void Shutdown()
- {
- try
- {
- // Close all end points for producer and consumers.
- // Producer is on 0, and consumers on 1 .. n, so loop is from 0 to n inclusive.
- for (int i = 0; i <= CONSUMER_COUNT; i++)
- {
- CloseEndPoint(i);
- }
- }
- finally
- {
- base.Shutdown();
- }
- }
-
- /// <summary> Check that all consumers on a topic each receive all message on it. </summary>
- [Test]
- public void AllConsumerReceiveAllMessagesOnTopic()
- {
- // Create end-points for all the consumers in the test.
- for (int i = 1; i <= CONSUMER_COUNT; i++)
- {
- SetUpEndPoint(i, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, ExchangeNameDefaults.TOPIC,
- true, false, null);
- testConsumer[i].OnMessage += new MessageReceivedDelegate(OnMessage);
- }
-
- // Create an end-point to publish to the test topic.
- SetUpEndPoint(0, true, false, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, ExchangeNameDefaults.TOPIC,
- true, false, null);
-
- expectedMessageCount = (MESSAGE_COUNT * CONSUMER_COUNT);
-
- PromptAndWait("Press to send...");
-
- for (int i = 0; i < MESSAGE_COUNT; i++)
- {
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
- }
-
- _finishedEvent.WaitOne(new TimeSpan(0, 0, 0, 10), false);
-
- PromptAndWait("Press to complete test...");
-
- // Check that all messages really were received.
- Assert.IsTrue(allReceived, "All messages were not received, only got " + _messageReceivedCount + " but wanted " + expectedMessageCount);
- }
-
- /// <summary> Check that consumers on the same queue receive each message once accross all consumers. </summary>
- //[Test]
- public void AllConsumerReceiveAllMessagesOnDirect()
- {
- // Create end-points for all the consumers in the test.
- for (int i = 1; i <= CONSUMER_COUNT; i++)
- {
- SetUpEndPoint(i, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, ExchangeNameDefaults.DIRECT,
- true, false, null);
- testConsumer[i].OnMessage += new MessageReceivedDelegate(OnMessage);
- }
-
- // Create an end-point to publish to the test topic.
- SetUpEndPoint(0, true, false, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, ExchangeNameDefaults.DIRECT,
- true, false, null);
-
- expectedMessageCount = MESSAGE_COUNT;
-
- for (int i = 0; i < MESSAGE_COUNT; i++)
- {
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
- }
-
- _finishedEvent.WaitOne(new TimeSpan(0, 0, 0, 10), false);
-
- // Check that all messages really were received.
- Assert.IsTrue(allReceived, "All messages were not received, only got: " + _messageReceivedCount + " but wanted " + expectedMessageCount);
- }
-
- /// <summary> Atomically increments the message count on every message, and signals once all messages in the test are received. </summary>
- public void OnMessage(IMessage m)
- {
- int newCount = Interlocked.Increment(ref _messageReceivedCount);
-
- if (newCount >= expectedMessageCount)
- {
- allReceived = true;
- _finishedEvent.Set();
- }
- }
-
- /// <summary>Prompts the user on stdout and waits for a reply on stdin, using the specified prompt message.</summary>
- ///
- /// <param name="message">The message to prompt the user with.</param>
- private void PromptAndWait(string message)
- {
- Console.WriteLine("\n" + message);
- Console.ReadLine();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/InteropClientTestCase.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/InteropClientTestCase.cs
deleted file mode 100644
index c1283454c5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/InteropClientTestCase.cs
+++ /dev/null
@@ -1,87 +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;
-using System.Text;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Integration.Tests.interop
-{
- /// <summary> Defines the possible test case roles that an interop test case can take on. </summary>
- public enum Roles { SENDER, RECEIVER };
-
- /// <summary>
- /// InteropClientTestCase provides an interface that classes implementing test cases from the interop testing spec
- /// (http://cwiki.apache.org/confluence/display/qpid/Interop+Testing+Specification) should implement.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Supply the name of the test case that this implements.
- /// <tr><td> Accept/Reject invites based on test parameters.
- /// <tr><td> Adapt to assigned roles.
- /// <tr><td> Perform test case actions.
- /// <tr><td> Generate test reports.
- /// </table>
- /// </summary>
- interface InteropClientTestCase
- {
- /// <summary>
- /// Should provide the name of the test case that this class implements. The exact names are defined in the
- /// interop testing spec.
- /// </summary>
- ///
- /// <returns> The name of the test case that this implements. </returns>
- string GetName();
-
- /// <summary>
- /// Determines whether the test invite that matched this test case is acceptable.
- /// </summary>
- ///
- /// <param name="inviteMessage"> The invitation to accept or reject. </param>
- ///
- /// <returns> <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it. </returns>
- ///
- /// @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- bool AcceptInvite(IMessage inviteMessage);
-
- /// <summary>
- /// Assigns the role to be played by this test case. The test parameters are fully specified in the
- /// assignment message. When this method return the test case will be ready to execute.
- /// </summary>
- ///
- /// <param name="role"> The role to be played; sender or receiver. </param>
- /// <param name="assignRoleMessage"> The role assingment message, contains the full test parameters. </param>
- void AssignRole(Roles role, IMessage assignRoleMessage);
-
- /// <summary>
- /// Performs the test case actions.
- /// </summary>
- void Start();
-
- /// <summary>
- /// Gets a report on the actions performed by the test case in its assigned role.
- /// </summary>
- ///
- /// <param name="session"> The session to create the report message in. </param>
- ///
- /// <returns> The report message. </returns>
- IMessage GetReport(IChannel channel);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase1DummyRun.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase1DummyRun.cs
deleted file mode 100644
index a63bb84517..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase1DummyRun.cs
+++ /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.
- *
- */
-using System;
-using System.Text;
-using log4net;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Integration.Tests.interop.TestCases
-{
- /// <summary>
- /// Implements tet case 1, dummy run. This test case sends no test messages, it exists to confirm that the test harness
- /// is interacting with the coordinator correctly.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Supply the name of the test case that this implements.
- /// <tr><td> Accept/Reject invites based on test parameters.
- /// <tr><td> Adapt to assigned roles.
- /// <tr><td> Perform test case actions.
- /// <tr><td> Generate test reports.
- /// </table>
- /// </summary>
- public class TestCase1DummyRun : InteropClientTestCase
- {
- private static ILog log = LogManager.GetLogger(typeof(TestCase1DummyRun));
-
- public String GetName()
- {
- log.Debug("public String getName(): called");
-
- return "TC1_DummyRun";
- }
-
- public bool AcceptInvite(IMessage inviteMessage)
- {
- log.Debug("public boolean acceptInvite(Message inviteMessage): called");
-
- // Test parameters don't matter, accept all invites.
- return true;
- }
-
- public void AssignRole(Roles role, IMessage assignRoleMessage)
- {
- log.Debug("public void assignRole(Roles role, Message assignRoleMessage): called");
-
- // Do nothing, both roles are the same.
- }
-
- public void Start()
- {
- log.Debug("public void start(): called");
-
- // Do nothing.
- }
-
- public IMessage GetReport(IChannel channel)
- {
- log.Debug("public Message getReport(Session session): called");
-
- // Generate a dummy report, the coordinator expects a report but doesn't care what it is.
- return channel.CreateTextMessage("Dummy Run, Ok.");
- }
-
- public void OnMessage(IMessage message)
- {
- log.Debug("public void onMessage(Message message = " + message + "): called");
-
- // Ignore any messages.
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase2BasicP2P.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase2BasicP2P.cs
deleted file mode 100644
index 3460d9091f..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase2BasicP2P.cs
+++ /dev/null
@@ -1,205 +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;
-using System.Text;
-using log4net;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Integration.Tests.interop.TestCases
-{
- /// <summary>
- /// Implements test case 2, basic P2P. Sends/receives a specified number of messages to a specified route on the
- /// default direct exchange. Produces reports on the actual number of messages sent/received.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Supply the name of the test case that this implements.
- /// <tr><td> Accept/Reject invites based on test parameters.
- /// <tr><td> Adapt to assigned roles.
- /// <tr><td> Send required number of test messages.
- /// <tr><td> Generate test reports.
- /// </table>
- /// </summary>
- public class TestCase2BasicP2P : InteropClientTestCase
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(TestCase2BasicP2P));
-
- /// <summary> Holds the count of test messages received. </summary>
- private int messageCount;
-
- /// <summary> The role to be played by the test. </summary>
- private Roles role;
-
- /// <summary> The number of test messages to send. </summary>
- private int numMessages;
-
- /// <summary> The routing key to send them to on the default direct exchange. </summary>
- private string sendDestination;
-
- /// <summary> The connection to send the test messages on. </summary>
- private IConnection connection;
-
- /// <summary> The session to send the test messages on. </summary>
- private IChannel channel;
-
- /// <summary> The producer to send the test messages with. </summary>
- private IMessagePublisher publisher;
-
- /// <summary>
- /// Should provide the name of the test case that this class implements. The exact names are defined in the
- /// interop testing spec.
- /// </summary>
- ///
- /// <returns> The name of the test case that this implements. </returns>
- public String GetName()
- {
- log.Debug("public String GetName(): called");
-
- return "TC2_BasicP2P";
- }
-
- /// <summary>
- /// Determines whether the test invite that matched this test case is acceptable.
- /// </summary>
- ///
- /// <param name="inviteMessage"> The invitation to accept or reject. </param>
- ///
- /// <returns> <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it. </returns>
- public bool AcceptInvite(IMessage inviteMessage)
- {
- log.Debug("public boolean AcceptInvite(Message inviteMessage = " + inviteMessage + "): called");
-
- // All invites are acceptable.
- return true;
- }
-
- /// <summary>
- /// Assigns the role to be played by this test case. The test parameters are fully specified in the
- /// assignment message. When this method return the test case will be ready to execute.
- /// </summary>
- ///
- /// <param name="role"> The role to be played; sender or receiver. </param>
- /// <param name="assignRoleMessage"> The role assingment message, contains the full test parameters. </param>
- public void AssignRole(Roles role, IMessage assignRoleMessage)
- {
- log.Debug("public void AssignRole(Roles role = " + role + ", Message assignRoleMessage = " + assignRoleMessage
- + "): called");
-
- // Reset the message count for a new test.
- messageCount = 0;
-
- // Take note of the role to be played.
- this.role = role;
-
- // Create a new connection to pass the test messages on.
- connection =
- TestClient.CreateConnection(TestClient.brokerUrl, TestClient.virtualHost);
- channel = connection.CreateChannel(false, AcknowledgeMode.AutoAcknowledge);
-
- // Extract and retain the test parameters.
- numMessages = assignRoleMessage.Headers.GetInt("P2P_NUM_MESSAGES");
- string queueAndKeyName = assignRoleMessage.Headers.GetString("P2P_QUEUE_AND_KEY_NAME");
- channel.DeclareQueue(queueAndKeyName, false, true, true);
- channel.Bind(queueAndKeyName, ExchangeNameDefaults.DIRECT, queueAndKeyName);
- sendDestination = queueAndKeyName;
-
- log.Debug("numMessages = " + numMessages);
- log.Debug("sendDestination = " + sendDestination);
- log.Debug("role = " + role);
-
- switch (role)
- {
- // Check if the sender role is being assigned, and set up a message producer if so.
- case Roles.SENDER:
- publisher = channel.CreatePublisherBuilder()
- .WithExchangeName(ExchangeNameDefaults.DIRECT)
- .WithRoutingKey(sendDestination)
- .Create();
- break;
-
- // Otherwise the receiver role is being assigned, so set this up to listen for messages.
- case Roles.RECEIVER:
- IMessageConsumer consumer = channel.CreateConsumerBuilder(sendDestination).Create();
- consumer.OnMessage += new MessageReceivedDelegate(OnMessage);
-
- break;
- }
-
- connection.Start();
- }
-
- /// <summary> Performs the test case actions. </summary>
- public void Start()
- {
- log.Debug("public void start(): called");
-
- // Check that the sender role is being performed.
- if (role == Roles.SENDER)
- {
- IMessage testMessage = channel.CreateTextMessage("test");
-
- for (int i = 0; i < numMessages; i++)
- {
- publisher.Send(testMessage);
-
- // Increment the message count.
- messageCount++;
- }
- }
- }
-
- /// <summary>
- /// Gets a report on the actions performed by the test case in its assigned role.
- /// </summary>
- ///
- /// <param name="session"> The session to create the report message in. </param>
- ///
- /// <returns> The report message. </returns>
- public IMessage GetReport(IChannel channel)
- {
- log.Debug("public Message GetReport(IChannel channel): called");
-
- // Close the test connection.
- //connection.Stop();
-
- // Generate a report message containing the count of the number of messages passed.
- IMessage report = channel.CreateMessage();
- //report.Headers.SetString("CONTROL_TYPE", "REPORT");
- report.Headers.SetInt("MESSAGE_COUNT", messageCount);
-
- return report;
- }
-
- /// <summary>
- /// Counts incoming test messages.
- /// </summary>
- ///
- /// <param name="message"> The incoming test message. </param>
- public void OnMessage(IMessage message)
- {
- log.Debug("public void OnMessage(IMessage message = " + message + "): called");
-
- // Increment the message count.
- messageCount++;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase3BasicPubSub.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase3BasicPubSub.cs
deleted file mode 100644
index fd0db10fa5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestCases/TestCase3BasicPubSub.cs
+++ /dev/null
@@ -1,244 +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;
-using System.Text;
-using log4net;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Integration.Tests.interop.TestCases
-{
- /// <summary>
- /// Implements test case 3, basic pub/sub. Sends/received a specified number of messages to a specified route on the
- /// default topic exchange, using the specified number of receiver connections. Produces reports on the actual number of
- /// messages sent/received.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Supply the name of the test case that this implements.
- /// <tr><td> Accept/Reject invites based on test parameters.
- /// <tr><td> Adapt to assigned roles.
- /// <tr><td> Send required number of test messages using pub/sub.
- /// <tr><td> Generate test reports.
- /// </table>
- /// </summary>
- public class TestCase3BasicPubSub : InteropClientTestCase
- {
- /// <summary> Used for debugging. </summary>
- private static ILog log = LogManager.GetLogger(typeof(TestCase3BasicPubSub));
-
- /// <summary> Holds the count of test messages received. </summary>
- private int messageCount;
-
- /// <summary> The role to be played by the test. </summary>
- private Roles role;
-
- /// <summary> The number of test messages to send. </summary>
- private int numMessages;
-
- /// <summary> The number of receiver connection to use. </summary>
- private int numReceivers;
-
- /// <summary> The routing key to send them to on the default direct exchange. </summary>
- private string sendDestination;
-
- /// <summary> The connections to send/receive the test messages on. </summary>
- private IConnection[] connection;
-
- /// <summary> The sessions to send/receive the test messages on. </summary>
- private IChannel[] channel;
-
- /// <summary> The producer to send the test messages with. </summary>
- IMessagePublisher publisher;
-
- /// <summary>
- /// Should provide the name of the test case that this class implements. The exact names are defined in the
- /// interop testing spec.
- /// </summary>
- ///
- /// <returns> The name of the test case that this implements. </returns>
- public String GetName()
- {
- log.Debug("public String GetName(): called");
-
- return "TC3_BasicPubSub";
- }
-
- /// <summary>
- /// Determines whether the test invite that matched this test case is acceptable.
- /// </summary>
- ///
- /// <param name="inviteMessage"> The invitation to accept or reject. </param>
- ///
- /// <returns> <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it. </returns>
- public bool AcceptInvite(IMessage inviteMessage)
- {
- log.Debug("public boolean AcceptInvite(IMessage inviteMessage = " + inviteMessage + "): called");
-
- // All invites are acceptable.
- return true;
- }
-
- /// <summary>
- /// Assigns the role to be played by this test case. The test parameters are fully specified in the
- /// assignment message. When this method return the test case will be ready to execute.
- /// </summary>
- ///
- /// <param name="role"> The role to be played; sender or receiver. </param>
- /// <param name="assignRoleMessage"> The role assingment message, contains the full test parameters. </param>
- public void AssignRole(Roles role, IMessage assignRoleMessage)
- {
- log.Debug("public void assignRole(Roles role = " + role + ", IMessage assignRoleMessage = " + assignRoleMessage
- + "): called");
-
- // Reset the message count for a new test.
- messageCount = 0;
-
- // Take note of the role to be played.
- this.role = role;
-
- // Extract and retain the test parameters.
- numMessages = assignRoleMessage.Headers.GetInt("PUBSUB_NUM_MESSAGES");
- numReceivers = assignRoleMessage.Headers.GetInt("PUBSUB_NUM_RECEIVERS");
- string sendKey = assignRoleMessage.Headers.GetString("PUBSUB_KEY");
- sendDestination = sendKey;
-
- log.Debug("numMessages = " + numMessages);
- log.Debug("numReceivers = " + numReceivers);
- log.Debug("sendKey = " + sendKey);
- log.Debug("role = " + role);
-
- switch (role)
- {
- // Check if the sender role is being assigned, and set up a single message producer if so.
- case Roles.SENDER:
- // Create a new connection to pass the test messages on.
- connection = new IConnection[1];
- channel = new IChannel[1];
-
- connection[0] =
- TestClient.CreateConnection(TestClient.brokerUrl, TestClient.virtualHost);
- channel[0] = connection[0].CreateChannel(false, AcknowledgeMode.AutoAcknowledge);
-
- // Extract and retain the test parameters.
- publisher = channel[0].CreatePublisherBuilder()
- .WithExchangeName(ExchangeNameDefaults.TOPIC)
- .WithRoutingKey(sendDestination)
- .WithMandatory(false)
- .WithImmediate(false)
- .Create();
- break;
-
- // Otherwise the receiver role is being assigned, so set this up to listen for messages on the required number
- // of receiver connections.
- case Roles.RECEIVER:
- // Create the required number of receiver connections.
- connection = new IConnection[numReceivers];
- channel = new IChannel[numReceivers];
-
- for (int i = 0; i < numReceivers; i++)
- {
- connection[i] =
- TestClient.CreateConnection(TestClient.brokerUrl, TestClient.virtualHost);
- channel[i] = connection[i].CreateChannel(false, AcknowledgeMode.AutoAcknowledge);
-
- IMessageConsumer consumer = channel[i].CreateConsumerBuilder(sendDestination).Create();
- consumer.OnMessage += new MessageReceivedDelegate(OnMessage);
- }
-
- break;
- }
-
- // Start all the connection dispatcher threads running.
- foreach (IConnection con in connection)
- {
- con.Start();
- }
- }
-
- /// <summary>
- /// Performs the test case actions.
- /// </summary>
- public void Start()
- {
- log.Debug("public void Start(): called");
-
- // Check that the sender role is being performed.
- if (role == Roles.SENDER)
- {
- IMessage testMessage = channel[0].CreateTextMessage("test");
-
- for (int i = 0; i < numMessages; i++)
- {
- publisher.Send(testMessage);
-
- // Increment the message count.
- messageCount++;
- }
- }
- }
-
- /// <summary>
- /// Gets a report on the actions performed by the test case in its assigned role.
- /// </summary>
- ///
- /// <param name="session"> The session to create the report message in. </param>
- ///
- /// <returns> The report message. </returns>
- public IMessage GetReport(IChannel channel)
- {
- log.Debug("public IMessage getReport(IChannel channel): called");
-
- // Close the test connections.
- /*foreach (IConnection con in connection)
- {
- try
- {
- con.Stop();
- }
- catch (AMQConnectionClosedException e)
- {
- // The connection has already died due to an error. Log this as a warning.
- log.Warn("Connection already closed.");
- }
- }*/
-
- // Generate a report message containing the count of the number of messages passed.
- IMessage report = channel.CreateMessage();
- //report.Headers.SetString("CONTROL_TYPE", "REPORT");
- report.Headers.SetInt("MESSAGE_COUNT", messageCount);
-
- return report;
- }
-
- /// <summary>
- /// Counts incoming test messages.
- /// </summary>
- ///
- /// <param name="message"> The incoming test message. </param>
- public void OnMessage(IMessage message)
- {
- log.Debug("public void onMessage(IMessage message = " + message + "): called");
-
- // Increment the message count.
- messageCount++;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestClient.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestClient.cs
deleted file mode 100644
index 82a9de742a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/interop/TestClient.cs
+++ /dev/null
@@ -1,379 +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;
-using System.Collections;
-using System.Text;
-using System.Threading;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-using log4net;
-using Apache.Qpid.Integration.Tests.interop.TestCases;
-
-namespace Apache.Qpid.Integration.Tests.interop
-{
- /// <summary>
- /// Implements a test client as described in the interop testing spec
- /// (http://cwiki.apache.org/confluence/display/qpid/Interop+Testing+Specification). A test client is an agent that
- /// reacts to control message sequences send by the test coordinator.
- ///
- /// <p/><table><caption>Messages Handled by TestClient</caption>
- /// <tr><th> Message <th> Action
- /// <tr><td> Invite(compulsory) <td> Reply with Enlist.
- /// <tr><td> Invite(test case) <td> Reply with Enlist if test case available.
- /// <tr><td> AssignRole(test case) <td> Reply with Accept Role if matches an enlisted test. Keep test parameters.
- /// <tr><td> Start <td> Send test messages defined by test parameters. Send report on messages sent.
- /// <tr><td> Status Request <td> Send report on messages received.
- /// </table>
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Handle all incoming control messages. <td> {@link InteropClientTestCase}
- /// <tr><td> Configure and look up test cases by name. <td> {@link InteropClientTestCase}
- /// </table>
- /// </summary>
- public class TestClient
- {
- private static ILog log = LogManager.GetLogger(typeof(TestClient));
-
- /// <summary> Defines the default broker for the tests, localhost, default port. </summary>
- public static string DEFAULT_BROKER_URL = "amqp://guest:guest@clientid/?brokerlist='tcp://localhost:5672'";
-
- /// <summary> Defines the default virtual host to use for the tests, none. </summary>
- public static string DEFAULT_VIRTUAL_HOST = "";
-
- /// <summary> Defines the default identifying name of this test client. </summary>
- public static string DEFAULT_CLIENT_NAME = "dotnet";
-
- /// <summary> Holds the URL of the broker to run the tests on. </summary>
- public static string brokerUrl;
-
- /// <summary> Holds the virtual host to run the tests on. If <tt>null</tt>, then the default virtual host is used. </summary>
- public static string virtualHost;
-
- /// <summary> The clients identifying name to print in test results and to distinguish from other clients. </summary>
- private string clientName;
-
- /// <summary> Holds all the test cases. </summary>
- private IDictionary testCases = new Hashtable();
-
- InteropClientTestCase currentTestCase;
-
- private MessagePublisherBuilder publisherBuilder;
-
- private IChannel channel;
-
- /// <summary> Monitor to wait for termination events on. </summary>
- private static object terminationMonitor = new Object();
-
- /// <summary>
- /// Creates a new interop test client, listenting to the specified broker and virtual host, with the specified
- /// client identifying name.
- /// </summary>
- ///
- /// <param name="brokerUrl"> The url of the broker to connect to. </param>
- /// <param name="virtualHost"> The virtual host to conect to. </param>
- /// <param name="clientName"> The client name to use. </param>
- public TestClient(string brokerUrl, string virtualHost, string clientName)
- {
- log.Info("public TestClient(string brokerUrl = " + brokerUrl + ", string virtualHost = " + virtualHost
- + ", string clientName = " + clientName + "): called");
-
- // Retain the connection parameters.
- TestClient.brokerUrl = brokerUrl;
- TestClient.virtualHost = virtualHost;
- this.clientName = clientName;
- }
-
-
- /// <summary>
- /// The entry point for the interop test coordinator. This client accepts the following command line arguments:
- /// </summary>
- ///
- /// <p/><table>
- /// <tr><td> -b <td> The broker URL. <td> Optional.
- /// <tr><td> -h <td> The virtual host. <td> Optional.
- /// <tr><td> -n <td> The test client name. <td> Optional.
- /// <tr><td> name=value <td> Trailing argument define name/value pairs. Added to system properties. <td> Optional.
- /// </table>
- ///
- /// <param name="args"> The command line arguments. </param>
- public static void Main(string[] args)
- {
- // Extract the command line options (Not exactly Posix but it will do for now...).
- string brokerUrl = DEFAULT_BROKER_URL;
- string virtualHost = DEFAULT_VIRTUAL_HOST;
- string clientName = DEFAULT_CLIENT_NAME;
-
- foreach (string nextArg in args)
- {
- if (nextArg.StartsWith("-b"))
- {
- brokerUrl = nextArg.Substring(2);
- }
- else if (nextArg.StartsWith("-h"))
- {
- virtualHost = nextArg.Substring(2);
- }
- else if (nextArg.StartsWith("-n"))
- {
- clientName = nextArg.Substring(2);
- }
- }
-
- NDC.Push(clientName);
-
- // Create a test client and start it running.
- TestClient client = new TestClient(brokerUrl, virtualHost, clientName);
-
- try
- {
- client.Start();
- }
- catch (Exception e)
- {
- log.Error("The test client was unable to start.", e);
- System.Environment.Exit(1);
- }
-
- // Wait for a signal on the termination monitor before quitting.
- lock (terminationMonitor)
- {
- Monitor.Wait(terminationMonitor);
- }
-
- NDC.Pop();
- }
-
- /// <summary>
- /// Starts the interop test client running. This causes it to start listening for incoming test invites.
- /// </summary>
- private void Start()
- {
- log.Info("private void Start(): called");
-
- // Use a class path scanner to find all the interop test case implementations.
- ArrayList testCaseClasses = new ArrayList();
-
- // ClasspathScanner.getMatches(InteropClientTestCase.class, "^TestCase.*", true);
- // Hard code the test classes till the classpath scanner is fixed.
- testCaseClasses.Add(typeof(TestCase1DummyRun));
- testCaseClasses.Add(typeof(TestCase2BasicP2P));
- testCaseClasses.Add(typeof(TestCase3BasicPubSub));
-
- // Create all the test case implementations and index them by the test names.
- foreach (Type testClass in testCaseClasses)
- {
- InteropClientTestCase testCase = (InteropClientTestCase)Activator.CreateInstance(testClass);
- testCases.Add(testCase.GetName(), testCase);
-
- log.Info("Found test case: " + testClass);
- }
-
- // Open a connection to communicate with the coordinator on.
- log.Info("brokerUrl = " + brokerUrl);
- IConnection connection = CreateConnection(brokerUrl, virtualHost);
-
- channel = connection.CreateChannel(false, AcknowledgeMode.AutoAcknowledge);
-
- // Set this up to listen for control messages.
- string responseQueueName = channel.GenerateUniqueName();
- channel.DeclareQueue(responseQueueName, false, true, true);
-
- channel.Bind(responseQueueName, ExchangeNameDefaults.TOPIC, "iop.control." + clientName);
- channel.Bind(responseQueueName, ExchangeNameDefaults.TOPIC, "iop.control");
-
- IMessageConsumer consumer = channel.CreateConsumerBuilder(responseQueueName)
- .Create();
- consumer.OnMessage += new MessageReceivedDelegate(OnMessage);
-
- // Create a publisher to send replies with.
- publisherBuilder = channel.CreatePublisherBuilder()
- .WithExchangeName(ExchangeNameDefaults.DIRECT);
-
-
- // Start listening for incoming control messages.
- connection.Start();
- Console.WriteLine("Test client " + clientName + " ready to receive test control messages...");
- }
-
- /// <summary>
- /// Establishes an AMQ connection. This is a simple convenience method for code that does not anticipate handling connection failures.
- /// All exceptions that indicate that the connection has failed, are allowed to fall through.
- /// </summary>
- ///
- /// <param name="brokerUrl"> The broker url to connect to, <tt>null</tt> to use the default from the properties. </param>
- /// <param name="virtualHost"> The virtual host to connectio to, <tt>null</tt> to use the default. </param>
- ///
- /// <returns> A JMS conneciton. </returns>
- public static IConnection CreateConnection(string brokerUrl, string virtualHost)
- {
- log.Info("public static Connection createConnection(string brokerUrl = " + brokerUrl + ", string virtualHost = "
- + virtualHost + "): called");
-
- // Create a connection to the broker.
- IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(brokerUrl);
- connectionInfo.VirtualHost = virtualHost;
- IConnection connection = new AMQConnection(connectionInfo);
-
- return connection;
- }
-
- /// <summary>
- /// Handles all incoming control messages.
- /// </summary>
- ///
- /// <param name="message"> The incoming message. </param>
- public void OnMessage(IMessage message)
- {
- log.Info("public void OnMessage(IMessage message = " + message + "): called");
-
- try
- {
- string controlType = message.Headers.GetString("CONTROL_TYPE");
- string testName = message.Headers.GetString("TEST_NAME");
-
- // Check if the message is a test invite.
- if ("INVITE" == controlType)
- {
- string testCaseName = message.Headers.GetString("TEST_NAME");
-
- // Flag used to indicate that an enlist should be sent. Only enlist to compulsory invites or invites
- // for which test cases exist.
- bool enlist = false;
-
- if (testCaseName != null)
- {
- log.Info("Got an invite to test: " + testCaseName);
-
- // Check if the requested test case is available.
- InteropClientTestCase testCase = (InteropClientTestCase)testCases[testCaseName];
-
- if (testCase != null)
- {
- // Make the requested test case the current test case.
- currentTestCase = testCase;
- enlist = true;
- }
- }
- else
- {
- log.Info("Got a compulsory invite.");
-
- enlist = true;
- }
-
- log.Info("enlist = " + enlist);
-
- if (enlist)
- {
- // Reply with the client name in an Enlist message.
- IMessage enlistMessage = channel.CreateMessage();
- enlistMessage.Headers.SetString("CONTROL_TYPE", "ENLIST");
- enlistMessage.Headers.SetString("CLIENT_NAME", clientName);
- enlistMessage.Headers.SetString("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
- enlistMessage.CorrelationId = message.CorrelationId;
-
- Send(enlistMessage, message.ReplyToRoutingKey);
- }
- }
- else if ("ASSIGN_ROLE" == controlType)
- {
- // Assign the role to the current test case.
- string roleName = message.Headers.GetString("ROLE");
-
- log.Info("Got a role assignment to role: " + roleName);
-
- Roles role;
-
- if (roleName == "SENDER")
- {
- role = Roles.SENDER;
- }
- else
- {
- role = Roles.RECEIVER;
- }
-
- currentTestCase.AssignRole(role, message);
-
- // Reply by accepting the role in an Accept Role message.
- IMessage acceptRoleMessage = channel.CreateMessage();
- acceptRoleMessage.Headers.SetString("CONTROL_TYPE", "ACCEPT_ROLE");
- acceptRoleMessage.CorrelationId = message.CorrelationId;
-
- Send(acceptRoleMessage, message.ReplyToRoutingKey);
- }
- else if ("START" == controlType || "STATUS_REQUEST" == controlType)
- {
- if ("START" == controlType)
- {
- log.Info("Got a start notification.");
-
- // Start the current test case.
- currentTestCase.Start();
- }
- else
- {
- log.Info("Got a status request.");
- }
-
- // Generate the report from the test case and reply with it as a Report message.
- IMessage reportMessage = currentTestCase.GetReport(channel);
- reportMessage.Headers.SetString("CONTROL_TYPE", "REPORT");
- reportMessage.CorrelationId = message.CorrelationId;
-
- Send(reportMessage, message.ReplyToRoutingKey);
- }
- else if ("TERMINATE" == controlType)
- {
- Console.WriteLine("Received termination instruction from coordinator.");
-
- // Is a cleaner shutdown needed?
- System.Environment.Exit(1);
- }
- else
- {
- // Log a warning about this but otherwise ignore it.
- log.Warn("Got an unknown control message, controlType = " + controlType + ", message = " + message);
- }
- }
- catch (QpidException e)
- {
- // Log a warning about this, but otherwise ignore it.
- log.Warn("A QpidException occurred whilst handling a message.");
- log.Info("Got QpidException whilst handling message: " + message, e);
- }
- }
-
- /// <summary>
- /// Send the specified message using the specified routing key on the direct exchange.
- /// </summary>
- ///
- /// <param name="message"> The message to send.</param>
- /// <param name="routingKey"> The routing key to send the message with.</param>
- public void Send(IMessage message, string routingKey)
- {
- IMessagePublisher publisher = publisherBuilder.WithRoutingKey(routingKey).Create();
- publisher.Send(message);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/log4net.config b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/log4net.config
deleted file mode 100644
index 73bfc77a3e..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/log4net.config
+++ /dev/null
@@ -1,69 +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.
-
--->
-
-<log4net>
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="console" type="log4net.Appender.ConsoleAppender" >
- <layout type="log4net.Layout.PatternLayout">
- <conversionPattern value="%m%n"/>
- </layout>
- <threshold value="info"/>
- </appender>
-
- <!-- ====================================== -->
- <!-- Append messages to the socket appender -->
- <!-- ====================================== -->
-
- <appender name="UdpAppender" type="log4net.Appender.UdpAppender">
- <remoteAddress value="127.0.0.1"/>
- <remotePort value="4445"/>
- <layout type="log4net.Layout.XmlLayoutSchemaLog4j">
- <locationInfo value="true"/>
- </layout>
- <threshold value="debug"/>
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <logger name="Qpid">
- <level value="debug"/>
- </logger>
-
- <logger name="CONSOLE">
- <level value="info"/>
- <appender-ref ref="console"/>
- </logger>
-
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root>
- <appender-ref ref="UdpAppender"/>
- </root>
-
-</log4net>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/old/ServiceProvidingClient.tmp b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/old/ServiceProvidingClient.tmp
deleted file mode 100644
index b1e7a50aaa..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/old/ServiceProvidingClient.tmp
+++ /dev/null
@@ -1,150 +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;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- [TestFixture, Category("Integration")]
- public class ServiceProvidingClient : BaseMessagingTestFixture
- {
- private static ILog _logger = LogManager.GetLogger(typeof(ServiceProvidingClient));
-
- private int _messageCount;
-
- private string _replyToExchangeName;
- private string _replyToRoutingKey;
- const int PACK = 100;
-
- private IMessagePublisher _destinationPublisher;
- private IMessageConsumer _consumer;
-
- private string _serviceName = "ServiceQ1";
-
- private string _selector = null;
-
- [SetUp]
- public override void Init()
- {
- base.Init();
-
- _logger.Info("Starting...");
- _logger.Info("Service (queue) name is '" + _serviceName + "'...");
-
- _connection.ExceptionListener = new ExceptionListenerDelegate(OnConnectionException);
-
- _logger.Info("Message selector is <" + _selector + ">...");
-
- _channel.DeclareQueue(_serviceName, false, false, false);
-
- _consumer = _channel.CreateConsumerBuilder(_serviceName)
- .WithPrefetchLow(100)
- .WithPrefetchHigh(500)
- .WithNoLocal(true)
- .Create();
- _consumer.OnMessage = new MessageReceivedDelegate(OnMessage);
- }
-
- public override void Shutdown()
- {
- _consumer.Dispose();
- base.Shutdown();
- }
-
- private void OnConnectionException(Exception e)
- {
- _logger.Info("Connection exception occurred", e);
- // XXX: Test still doesn't shutdown when broker terminates. Is there no heartbeat?
- }
-
- [Test]
- public void Test()
- {
- _connection.Start();
- _logger.Info("Waiting...");
-
- ServiceRequestingClient client = new ServiceRequestingClient();
- client.Init();
- client.SendMessages();
- }
-
- private void OnMessage(IMessage message)
- {
-// _logger.Info("Got message '" + message + "'");
-
- ITextMessage tm = (ITextMessage)message;
-
- try
- {
- string replyToExchangeName = tm.ReplyToExchangeName;
- string replyToRoutingKey = tm.ReplyToRoutingKey;
-
- _replyToExchangeName = replyToExchangeName;
- _replyToRoutingKey = replyToRoutingKey;
- _logger.Debug("About to create a producer");
-
-// Console.WriteLine("ReplyTo.ExchangeName = " + _replyToExchangeName);
-// Console.WriteLine("ReplyTo.RoutingKey = " + _replyToRoutingKey);
-
- _destinationPublisher = _channel.CreatePublisherBuilder()
- .WithExchangeName(_replyToExchangeName)
- .WithRoutingKey(_replyToRoutingKey)
- .WithDeliveryMode(DeliveryMode.NonPersistent)
- .Create();
- _destinationPublisher.DisableMessageTimestamp = true;
- _logger.Debug("After create a producer");
- }
- catch (QpidException e)
- {
- _logger.Error("Error creating destination", e);
- throw e;
- }
- _messageCount++;
- if (_messageCount % PACK == 0)
- {
- _logger.Info("Received message total: " + _messageCount);
- _logger.Info(string.Format("Sending response to '{0}:{1}'",
- _replyToExchangeName, _replyToRoutingKey));
- }
-
- try
- {
- String payload = "This is a response: sing together: 'Mahnah mahnah...'" + tm.Text;
- ITextMessage msg = _channel.CreateTextMessage(payload);
- if ( tm.Headers.Contains("timeSent") )
- {
- msg.Headers["timeSent"] = tm.Headers["timeSent"];
- }
- _destinationPublisher.Send(msg);
- } catch ( QpidException e )
- {
- _logger.Error("Error sending message: " + e, e);
- throw e;
- } finally
- {
- _destinationPublisher.Dispose();
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/old/ServiceRequestingClient.tmp b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/old/ServiceRequestingClient.tmp
deleted file mode 100644
index da0f764bcd..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/old/ServiceRequestingClient.tmp
+++ /dev/null
@@ -1,182 +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;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- public class ServiceRequestingClient : BaseMessagingTestFixture
- {
- private const int MESSAGE_SIZE = 1024;
- private static string MESSAGE_DATA = new string('x', MESSAGE_SIZE);
-
- private const int PACK = 100;
- private const int NUM_MESSAGES = PACK*10; // increase when in standalone
-
- private static ILog _log = LogManager.GetLogger(typeof(ServiceRequestingClient));
-
- ManualResetEvent _finishedEvent = new ManualResetEvent(false);
-
- private int _expectedMessageCount = NUM_MESSAGES;
-
- private long _startTime = 0;
-
- private string _commandQueueName = "ServiceQ1";
-
- private IMessagePublisher _publisher;
-
- Avergager averager = new Avergager();
-
- private void InitialiseProducer()
- {
- try
- {
- _publisher = _channel.CreatePublisherBuilder()
- .WithRoutingKey(_commandQueueName)
- .WithDeliveryMode(DeliveryMode.NonPersistent)
- .Create();
- _publisher.DisableMessageTimestamp = true; // XXX: need a "with" for this in builder?
- }
- catch (QpidException e)
- {
- _log.Error("Error: " + e, e);
- }
- }
-
- [Test]
- public void SendMessages()
- {
- InitialiseProducer();
-
- string replyQueueName = _channel.GenerateUniqueName();
-
- _channel.DeclareQueue(replyQueueName, false, true, true);
-
- IMessageConsumer messageConsumer = _channel.CreateConsumerBuilder(replyQueueName)
- .WithPrefetchLow(100)
- .WithPrefetchHigh(200)
- .WithNoLocal(true)
- .WithExclusive(true).Create();
-
- _startTime = DateTime.Now.Ticks;
-
- messageConsumer.OnMessage = new MessageReceivedDelegate(OnMessage);
- _connection.Start();
- for (int i = 0; i < _expectedMessageCount; i++)
- {
- ITextMessage msg;
- try
- {
- msg = _channel.CreateTextMessage(MESSAGE_DATA + i);
- }
- catch (Exception e)
- {
- _log.Error("Error creating message: " + e, e);
- break;
- }
- msg.ReplyToRoutingKey = replyQueueName;
-
- // Added timestamp.
- long timeNow = DateTime.Now.Ticks;
- string timeSentString = String.Format("{0:G}", timeNow);
- msg.Headers.SetLong("timeSent", timeNow);
-
- _publisher.Send(msg);
- }
-
- // Assert that the test finishes within a reasonable amount of time.
- const int waitSeconds = 40;
- const int waitMilliseconds = waitSeconds * 1000;
- _log.Info("Finished sending " + _expectedMessageCount + " messages");
- _log.Info(String.Format("Waiting {0} seconds to receive last message...", waitSeconds));
- Assert.IsTrue(_finishedEvent.WaitOne(waitMilliseconds, false),
- String.Format("Expected to finish in {0} seconds", waitSeconds));
- }
-
- public void OnMessage(IMessage m)
- {
- if (_log.IsDebugEnabled)
- {
- _log.Debug("Message received: " + m);
- }
-
- if (!m.Headers.Contains("timeSent"))
- {
- throw new Exception("Set timeSent!");
- }
-
- long sentAt = m.Headers.GetLong("timeSent");
- long now = DateTime.Now.Ticks;
- long latencyTicks = now - sentAt;
- long latencyMilliseconds = latencyTicks / TimeSpan.TicksPerMillisecond;
-
- averager.Add(latencyMilliseconds);
-
- if (averager.Num % PACK == 0)
- {
- _log.Info("Ticks per millisecond = " + TimeSpan.TicksPerMillisecond);
- _log.Info(String.Format("Average latency (ms) = {0}", averager));
- _log.Info("Received message count: " + averager.Num);
- }
-
- if (averager.Num == _expectedMessageCount)
- {
- _log.Info(String.Format("Final average latency (ms) = {0}", averager));
-
- double timeTakenSeconds = (DateTime.Now.Ticks - _startTime) * 1.0 / (TimeSpan.TicksPerMillisecond * 1000);
- _log.Info("Total time taken to receive " + _expectedMessageCount + " messages was " +
- timeTakenSeconds + "s, equivalent to " +
- (_expectedMessageCount/timeTakenSeconds) + " messages per second");
-
- _finishedEvent.Set(); // Notify main thread to quit.
- }
- }
- }
-
- class Avergager
- {
- long num = 0;
- long sum = 0;
-
- long min = long.MaxValue;
- long max = long.MinValue;
-
- public void Add(long item)
- {
- ++num;
- sum += item;
- if (item < min) min = item;
- if (item > max) max = item;
- }
-
- public long Average { get { return sum/num; }}
-
- public long Num { get { return num; } }
-
- public override string ToString()
- {
- return String.Format("average={0} min={1} max={2}", Average, min, max);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/BaseMessagingTestFixture.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/BaseMessagingTestFixture.cs
deleted file mode 100644
index d4b61a2788..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/BaseMessagingTestFixture.cs
+++ /dev/null
@@ -1,261 +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;
-using System.Text;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- /// <summary>
- /// Provides a basis for writing Unit tests that communicate with an AMQ protocol broker. By default it creates a connection
- /// to a message broker running on localhost on the standard AMQ port, 5672, using guest:guest login credentials. It also
- /// creates a standard auto-ack channel on this connection.
- /// </summary>
- public class BaseMessagingTestFixture
- {
- private static ILog log = LogManager.GetLogger(typeof(BaseMessagingTestFixture));
-
- /// <summary> Used to build dummy data to fill test messages with. </summary>
- private const string MESSAGE_DATA_BYTES = "-- Test Message -- Test Message -- Test Message -- Test Message -- Test Message ";
-
- /// <summary> The default timeout in milliseconds to use on receives. </summary>
- private const long RECEIVE_WAIT = 2000;
-
- /// <summary> The default AMQ connection URL to use for tests. </summary>
- public const string connectionUri = "amqp://guest:guest@test/test?brokerlist='tcp://localhost:5672'";
-
- /// <summary> The default AMQ connection URL parsed as a connection info. </summary>
- protected IConnectionInfo connectionInfo;
-
- /// <summary> Holds an array of connections for building mutiple test end-points. </summary>
- protected IConnection[] testConnection = new IConnection[10];
-
- /// <summary> Holds an array of channels for building mutiple test end-points. </summary>
- protected IChannel[] testChannel = new IChannel[10];
-
- /// <summary> Holds an array of queues for building mutiple test end-points. </summary>
- protected String[] testQueue = new String[10];
-
- /// <summary> Holds an array of producers for building mutiple test end-points. </summary>
- protected IMessagePublisher[] testProducer = new IMessagePublisher[10];
-
- /// <summary> Holds an array of consumers for building mutiple test end-points. </summary>
- protected IMessageConsumer[] testConsumer = new IMessageConsumer[10];
-
- /// <summary> A counter used to supply unique ids. </summary>
- private static int uniqueId = 0;
-
- /// <summary> Used to hold unique ids per test. </summary>
- protected Guid testId;
-
- /// <summary> Creates the test connection and channel. </summary>
- [SetUp]
- public virtual void Init()
- {
- log.Debug("public virtual void Init(): called");
-
- // Set up a unique id for this test.
- testId = System.Guid.NewGuid();
- }
-
- /// <summary>
- /// Disposes of the test connection. This is called manually because the connection is a field so dispose will not be automatically
- /// called on it.
- /// </summary>
- [TearDown]
- public virtual void Shutdown()
- {
- log.Debug("public virtual void Shutdown(): called");
- }
-
- /// <summary> Sets up the nth test end-point. </summary>
- ///
- /// <param name="n">The index of the test end-point to set up.</param>
- /// <param name="producer"><tt>true</tt> to set up a producer on the end-point.</param>
- /// <param name="consumer"><tt>true</tt> to set up a consumer on the end-point.</param>
- /// <param name="routingKey">The routing key for the producer to send on.</param>
- /// <param name="ackMode">The ack mode for the end-points channel.</param>
- /// <param name="transacted"><tt>true</tt> to use transactions on the end-points channel.</param>
- /// <param name="exchangeName">The exchange to produce or consume on.</param>
- /// <param name="declareBind"><tt>true</tt> if the consumers queue should be declared and bound, <tt>false</tt> if it has already been.</param>
- /// <param name="durable"><tt>true</tt> to declare the consumers queue as durable.</param>
- /// <param name="subscriptionName">If durable is true, the fixed unique queue name to use.</param>
- public void SetUpEndPoint(int n, bool producer, bool consumer, string routingKey, AcknowledgeMode ackMode, bool transacted,
- string exchangeName, bool declareBind, bool durable, string subscriptionName)
- {
- // Allow client id to be fixed, or undefined.
- {
- // Use unique id for end point.
- connectionInfo = QpidConnectionInfo.FromUrl(connectionUri);
-
- connectionInfo.ClientName = "test" + n;
- }
-
- testConnection[n] = new AMQConnection(connectionInfo);
- testConnection[n].Start();
- testChannel[n] = testConnection[n].CreateChannel(transacted, ackMode);
-
- if (producer)
- {
- testProducer[n] = testChannel[n].CreatePublisherBuilder()
- .WithExchangeName(exchangeName)
- .WithRoutingKey(routingKey)
- .Create();
- }
-
- if (consumer)
- {
- string queueName;
-
- // Use the subscription name as the queue name if the subscription is durable, otherwise use a generated name.
- if (durable)
- {
- // The durable queue is declared without auto-delete, and passively, in case it has already been declared.
- queueName = subscriptionName;
-
- if (declareBind)
- {
- testChannel[n].DeclareQueue(queueName, durable, true, false);
- testChannel[n].Bind(queueName, exchangeName, routingKey);
- }
- }
- else
- {
- queueName = testChannel[n].GenerateUniqueName();
-
- if (declareBind)
- {
- if (durable)
- {
- testQueue[n] = queueName;
- }
- testChannel[n].DeclareQueue(queueName, durable, true, true);
- testChannel[n].Bind(queueName, exchangeName, routingKey);
- }
- }
-
- testConsumer[n] = testChannel[n].CreateConsumerBuilder(queueName).Create();
- }
- }
-
- /// <summary> Closes down the nth test end-point. </summary>
- public void CloseEndPoint(int n)
- {
- log.Debug("public void CloseEndPoint(int n): called");
-
- if (testProducer[n] != null)
- {
- testProducer[n].Close();
- testProducer[n].Dispose();
- testProducer[n] = null;
- }
-
- if (testConsumer[n] != null)
- {
- if (testQueue[n] != null)
- {
- testChannel[n].DeleteQueue(testQueue[n], false, false, true);
- }
- testConsumer[n].Close();
- testConsumer[n].Dispose();
- testConsumer[n] = null;
- }
-
- if (testConnection[n] != null)
- {
- testConnection[n].Stop();
- testConnection[n].Close();
- testConnection[n].Dispose();
- testConnection[n] = null;
- }
- }
-
- /// <summary>
- /// Consumes n messages, checking that the n+1th is not available within a timeout, and that the consumed messages
- /// are text messages with contents equal to the specified message body.
- /// </summary>
- ///
- /// <param name="n">The number of messages to consume.</param>
- /// <param name="body">The body text to match against all messages.</param>
- /// <param name="consumer">The message consumer to recieve the messages on.</param>
- public static void ConsumeNMessagesOnly(int n, string body, IMessageConsumer consumer)
- {
- ConsumeNMessages(n, body, consumer);
-
- // Check that one more than n cannot be received.
- IMessage msg = consumer.Receive(RECEIVE_WAIT);
- Assert.IsNull(msg, "Consumer got more messages than the number requested (" + n + ").");
- }
-
- /// <summary>
- /// Consumes n messages, checking that the n+1th is not available within a timeout, and that the consumed messages
- /// are text messages with contents equal to the specified message body.
- /// </summary>
- ///
- /// <param name="n">The number of messages to consume.</param>
- /// <param name="body">The body text to match against all messages.</param>
- /// <param name="consumer">The message consumer to recieve the messages on.</param>
- public static void ConsumeNMessages(int n, string body, IMessageConsumer consumer)
- {
- IMessage msg;
-
- // Try to receive n messages.
- for (int i = 0; i < n; i++)
- {
- msg = consumer.Receive(RECEIVE_WAIT);
- Assert.IsNotNull(msg, "Consumer did not receive message number: " + i);
- Assert.AreEqual(body, ((ITextMessage)msg).Text, "Incorrect Message recevied on consumer1.");
- }
- }
-
- /// <summary>Creates the requested number of bytes of dummy text. Usually used for filling test messages. </summary>
- ///
- /// <param name="size">The number of bytes of dummy text to generate.</param>
- ///
- /// <return>The requested number of bytes of dummy text.</return>
- public static String GetData(int size)
- {
- StringBuilder buf = new StringBuilder(size);
-
- if (size > 0)
- {
- int div = MESSAGE_DATA_BYTES.Length / size;
- int mod = MESSAGE_DATA_BYTES.Length % size;
-
- for (int i = 0; i < div; i++)
- {
- buf.Append(MESSAGE_DATA_BYTES);
- }
-
- if (mod != 0)
- {
- buf.Append(MESSAGE_DATA_BYTES, 0, mod);
- }
- }
-
- return buf.ToString();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ChannelQueueTest.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ChannelQueueTest.cs
deleted file mode 100644
index e34864aefd..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ChannelQueueTest.cs
+++ /dev/null
@@ -1,237 +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;
-using System.Net;
-using System.Threading;
-using log4net;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-using Apache.Qpid.Messaging;
-using NUnit.Framework;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- /// <summary>
- /// Test the queue methods
- /// </summary>
- [TestFixture, Category("Integration")]
- public class ChannelQueueTest
- {
- private static ILog _logger = LogManager.GetLogger(typeof(ChannelQueueTest));
-
- /// <summary> The default AMQ connection URL to use for tests. </summary>
- const string DEFAULT_URI = "amqp://guest:guest@default/test?brokerlist='tcp://localhost:5672'";
- const string _routingKey = "ServiceQ1";
-
- private ExceptionListenerDelegate _exceptionDelegate;
- private AutoResetEvent _evt = new AutoResetEvent(false);
- private Exception _lastException = null;
-
- private IMessageConsumer _consumer;
- private IMessagePublisher _publisher;
- private IChannel _channel;
- private IConnection _connection;
-
- private string _queueName;
-
- [SetUp]
- public virtual void Init()
- {
- _logger.Info("public virtual void Init(): called");
-
- // Create a connection to the broker.
- IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(DEFAULT_URI);
- _connection = new AMQConnection(connectionInfo);
- _logger.Info("Starting...");
-
- // Register this to listen for exceptions on the test connection.
- _exceptionDelegate = new ExceptionListenerDelegate(OnException);
- _connection.ExceptionListener += _exceptionDelegate;
-
- // Establish a session on the broker.
- _channel = _connection.CreateChannel(false, AcknowledgeMode.AutoAcknowledge, 1);
-
- // Create a durable, non-temporary, non-exclusive queue.
- _queueName = _channel.GenerateUniqueName();
- _channel.DeclareQueue(_queueName, true, false, false);
-
- _channel.Bind(_queueName, ExchangeNameDefaults.TOPIC, _routingKey);
-
- // Clear the most recent message and exception.
- _lastException = null;
- }
-
- [TearDown]
- public virtual void ShutDown()
- {
- _logger.Info("public virtual void Shutdown(): called");
-
- if (_connection != null)
- {
- _logger.Info("Disposing connection.");
- _connection.Dispose();
- _logger.Info("Connection disposed.");
- }
- }
-
- [Test]
- public void DeleteUsedQueue()
- {
- // Create the consumer
- _consumer = _channel.CreateConsumerBuilder(_queueName)
- .WithPrefetchLow(100)
- .Create();
- _logger.Info("Consumer was created...");
-
- // delete the queue
- _channel.DeleteQueue(_queueName, false, true, true);
- _logger.InfoFormat("Queue {0} was delete", _queueName);
-
- Assert.IsNull(_lastException);
- }
-
- [Test]
- public void DeleteUnusedQueue()
- {
- // delete the queue
- _channel.DeleteQueue(_queueName, true, true, true);
- _logger.InfoFormat("Queue {0} was delete", _queueName);
-
- Assert.IsNull(_lastException);
- }
-
- [Test]
- public void DeleteNonEmptyQueue()
- {
- // Create the publisher
- _publisher = _channel.CreatePublisherBuilder()
- .WithExchangeName(ExchangeNameDefaults.TOPIC)
- .WithRoutingKey(_routingKey)
- .Create();
- _logger.Info("Publisher created...");
- SendTestMessage("DeleteNonEmptyQueue Message 1");
-
- try
- {
- _channel.DeleteQueue(_queueName, true, false, true);
- }
- catch (AMQException)
- {
- Assert.Fail("The test fails");
- }
- }
-
- [Test]
- public void DeleteEmptyQueue()
- {
- // Create the publisher
- _publisher = _channel.CreatePublisherBuilder()
- .WithExchangeName(ExchangeNameDefaults.TOPIC)
- .WithRoutingKey(_routingKey)
- .Create();
- _logger.Info("Publisher created...");
-
- // delete an empty queue with ifEmpty = true
- _channel.DeleteQueue(_queueName, false, true, true);
-
- Assert.IsNull(_lastException);
- }
-
- [Test]
- public void DeleteQueueWithResponse()
- {
- // Create the publisher
- _publisher = _channel.CreatePublisherBuilder()
- .WithExchangeName(ExchangeNameDefaults.TOPIC)
- .WithRoutingKey(_routingKey)
- .Create();
- _logger.Info("Publisher created...");
-
- SendTestMessage("DeleteQueueWithResponse Message 1");
- SendTestMessage("DeleteQueueWithResponse Message 2");
-
- // delete the queue, the server must respond
- _channel.DeleteQueue(_queueName, false, false, false);
- }
-
- [Test]
- public void PurgeQueueWithResponse()
- {
- _publisher = _channel.CreatePublisherBuilder()
- .WithExchangeName(ExchangeNameDefaults.TOPIC)
- .WithRoutingKey(_routingKey)
- .Create();
- _logger.Info("Pubisher created");
-
- SendTestMessage("Message 1");
- SendTestMessage("Message 2");
-
- _channel.PurgeQueue(_queueName, false);
- }
-
- [Test]
- public void PurgeQueueWithOutResponse()
- {
- _publisher = _channel.CreatePublisherBuilder()
- .WithExchangeName(ExchangeNameDefaults.TOPIC)
- .WithRoutingKey(_routingKey)
- .Create();
- _logger.Info("Pubisher created");
-
- SendTestMessage("Message 1");
- SendTestMessage("Message 2");
-
- _channel.PurgeQueue(_queueName, true);
- }
-
-
- /// <summary>
- /// Callback method to handle any exceptions raised by the test connection.</summary> ///
- /// <param name="e">The connection exception.</param>
- public void OnException(Exception e)
- {
- // Preserve the most recent exception in case test cases need to examine it.
- _lastException = e;
-
- // Notify any waiting threads that an exception event has occurred.
- _evt.Set();
- }
-
- /// <summary>
- /// Sends the specified message to the test publisher, and confirms that it was received by the test consumer or not
- /// depending on whether or not the message should be received by the consumer.
- ///
- /// Any exceptions raised by the connection will cause an Assert failure exception to be raised.
- /// </summary>
- ///
- /// <param name="msgSend">The message to send.</param>
- private void SendTestMessage(string msg)
- {
- // create the IMessage object
- IMessage msgSend = _channel.CreateTextMessage(msg);
-
- // send the message
- _publisher.Send(msgSend);
- _logger.InfoFormat("The messages \"{0}\" was sent", msg);
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/CommitRollbackTest.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/CommitRollbackTest.cs
deleted file mode 100644
index 72074da809..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/CommitRollbackTest.cs
+++ /dev/null
@@ -1,261 +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;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- /// <summary>
- /// CommitRollbackTest
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Check that an uncommitted send cannot be received.
- /// <tr><td> Check that a committed send can be received.
- /// <tr><td> Check that a rolled back send cannot be received.
- /// <tr><td> Check that an uncommitted receive can be re-received.
- /// <tr><td> Check that a committed receive cannot be re-received.
- /// <tr><td> Check that a rolled back receive can be re-received.
- /// </table>
- /// </summary>
- [TestFixture, Category("Integration")]
- public class CommitRollbackTest : BaseMessagingTestFixture
- {
- /// <summary>Used for debugging purposes.</summary>
- private static ILog log = LogManager.GetLogger(typeof(CommitRollbackTest));
-
- /// <summary>Defines the name of the test topic to use with the tests.</summary>
- public const string TEST_ROUTING_KEY = "commitrollbacktestkey";
-
- /// <summary>Used to count test messages received so far.</summary>
- private int messageReceivedCount;
-
- /// <summary>Used to hold the expected number of messages to receive.</summary>
- private int expectedMessageCount;
-
- /// <summary>Monitor used to signal succesfull receipt of all test messages.</summary>
- AutoResetEvent finishedEvent;
-
- /// <summary>Flag used to indicate that all messages really were received, and that the test did not just time out. </summary>
- private bool allReceived;
-
- [SetUp]
- public override void Init()
- {
- base.Init();
-
- // Create one producer and one consumer, p2p, tx, consumer with queue bound to producers routing key.
- SetUpEndPoint(0, true, false, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.DIRECT,
- true, false, null);
- SetUpEndPoint(1, true, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.DIRECT,
- true, false, null);
-
- // Clear counts
- messageReceivedCount = 0;
- expectedMessageCount = 0;
- finishedEvent = new AutoResetEvent(false);
- allReceived = false;
- }
-
- [TearDown]
- public override void Shutdown()
- {
- try
- {
- // Clean up after the test.
- CloseEndPoint(0);
- CloseEndPoint(1);
- }
- finally
- {
- base.Shutdown();
- }
- }
-
- /// <summary> Check that an uncommitted send cannot be received. </summary>
- [Test]
- public void TestUncommittedSendNotReceived()
- {
- // Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
-
- // Try to receive messages.
- ConsumeNMessagesOnly(0, "A", testConsumer[1]);
- testChannel[1].Commit();
- }
-
- /// <summary> Check that a committed send can be received. </summary>
- [Test]
- public void TestCommittedSendReceived()
- {
- // Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("B"));
- testChannel[0].Commit();
-
- // Try to receive messages.
- ConsumeNMessagesOnly(1, "B", testConsumer[1]);
- testChannel[1].Commit();
- }
-
- /// <summary> Check that a rolled back send cannot be received. </summary>
- [Test]
- public void TestRolledBackSendNotReceived()
- {
- // Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("B"));
- testChannel[0].Rollback();
-
- // Try to receive messages.
- ConsumeNMessagesOnly(0, "B", testConsumer[1]);
- testChannel[1].Commit();
- }
-
- /// <summary> Check that an uncommitted receive can be re-received. </summary>
- [Test]
- public void TestUncommittedReceiveCanBeRereceived()
- {
- // Create a third end-point as an alternative delivery route for the message.
- SetUpEndPoint(2, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.DIRECT,
- true, false, null);
-
- // Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("C"));
- testChannel[0].Commit();
-
- // Try to receive messages.
- ConsumeNMessagesOnly(1, "C", testConsumer[1]);
-
- // Close end-point 1 without committing the message, then re-open to consume again.
- CloseEndPoint(1);
-
- // Check that the message was released from the rolled back end-point an can be received on the alternative one instead.
- ConsumeNMessagesOnly(1, "C", testConsumer[2]);
-
- CloseEndPoint(2);
- }
-
- /// <summary> Check that a committed receive cannot be re-received. </summary>
- [Test]
- public void TestCommittedReceiveNotRereceived()
- {
- // Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("D"));
- testChannel[0].Commit();
-
- // Try to receive messages.
- ConsumeNMessagesOnly(1, "D", testConsumer[1]);
- testChannel[1].Commit();
-
- // Try to receive messages.
- ConsumeNMessagesOnly(0, "D", testConsumer[1]);
- }
-
- /// <summary> Check that a rolled back receive can be re-received. </summary>
- [Test]
- public void TestRolledBackReceiveCanBeRereceived()
- {
- // Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("E"));
- testChannel[0].Commit();
-
- // Try to receive messages.
- ConsumeNMessagesOnly(1, "E", testConsumer[1]);
-
- testChannel[1].Rollback();
-
- // Try to receive messages.
- ConsumeNMessagesOnly(1, "E", testConsumer[1]);
-
- }
-
- [Test]
- public void TestReceiveAndSendRollback()
- {
- // Send messages
- testProducer[0].Send(testChannel[0].CreateTextMessage("F"));
- testChannel[0].Commit();
-
- // Try to receive messages.
- ConsumeNMessagesOnly(1, "F", testConsumer[1]);
- testProducer[1].Send(testChannel[1].CreateTextMessage("G"));
- testChannel[1].Rollback();
-
- // Try to receive messages.
- ConsumeNMessagesOnly(1, "F", testConsumer[1]);
-
- }
-
- [Test]
- public void TestReceivePrePublished()
- {
- // Send messages
- for (int i = 0; i < 10; ++i)
- {
- testProducer[0].Send(testChannel[0].CreateTextMessage("G"+i));
- testChannel[0].Commit();
- }
-
- for (int i = 0; i < 10; ++i)
- {
- ConsumeNMessages(1, "G"+i, testConsumer[1]);
- }
- testChannel[1].Commit();
- }
-
- [Test]
- public void TestReceivePrePublishedOnMessageHandler()
- {
- testConsumer[1].OnMessage += new MessageReceivedDelegate(OnMessage);
- // Send messages
- for (int i = 0; i < 10; ++i)
- {
- testProducer[0].Send(testChannel[0].CreateTextMessage("G"+i));
- testChannel[0].Commit();
- }
- expectedMessageCount = 10;
-
- finishedEvent.WaitOne(new TimeSpan(0, 0, 0, 30), false);
-
- // Check that all messages really were received.
- Assert.IsTrue(allReceived, "All messages were not received, only got: " + messageReceivedCount + " but wanted " + expectedMessageCount);
-
- testChannel[1].Commit();
- }
-
- /// <summary> Atomically increments the message count on every message, and signals once all messages in the test are received. </summary>
- public void OnMessage(IMessage m)
- {
- int newCount = Interlocked.Increment(ref messageReceivedCount);
-
- if (newCount >= expectedMessageCount)
- {
- allReceived = true;
- finishedEvent.Set();
- }
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ConnectionTest.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ConnectionTest.cs
deleted file mode 100644
index 357f164346..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ConnectionTest.cs
+++ /dev/null
@@ -1,73 +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;
-using NUnit.Framework;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- [TestFixture, Category("Integration")]
- public class ConnectionTest
- {
- private AmqBrokerInfo _broker =
- new AmqBrokerInfo("amqp", "localhost", 5672, false);
-
- [Test]
- public void SimpleConnection()
- {
- IConnectionInfo connectionInfo = new QpidConnectionInfo();
- connectionInfo.VirtualHost = "test";
- connectionInfo.AddBrokerInfo(_broker);
- using (IConnection connection = new AMQConnection(connectionInfo))
- {
- Console.WriteLine("connection = " + connection);
- }
- }
-
- [Test]
- [ExpectedException(typeof(AMQAuthenticationException))]
- public void PasswordFailureConnection()
- {
- IConnectionInfo connectionInfo = new QpidConnectionInfo();
- connectionInfo.VirtualHost = "test";
- connectionInfo.Password = "rubbish";
- connectionInfo.AddBrokerInfo(_broker);
-
- using (IConnection connection = new AMQConnection(connectionInfo))
- {
- Console.WriteLine("connection = " + connection);
- // wrong
- Assert.Fail("Authentication succeeded but should've failed");
- }
- }
-
- [Test]
- [ExpectedException(typeof(AMQConnectionException))]
- public void ConnectionFailure()
- {
- string url = "amqp://guest:guest@clientid/testpath?brokerlist='tcp://localhost:5673?retries='0''";
- new AMQConnection(QpidConnectionInfo.FromUrl(url));
- Assert.Fail("Connection should not be established");
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/DurableSubscriptionTest.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/DurableSubscriptionTest.cs
deleted file mode 100644
index ac975100b1..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/DurableSubscriptionTest.cs
+++ /dev/null
@@ -1,166 +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;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- /// <summary>
- /// DurableSubscriptionTest checks that durable subscriptions work, by sending messages that can be picked up by
- /// a subscription that is currently off-line, and checking that the subscriber gets all of its messages when it
- /// does come on-line.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td>
- /// </table>
- /// </summary>
- [TestFixture, Category("Integration")]
- public class DurableSubscriptionTest : BaseMessagingTestFixture
- {
- /// <summary>Used for debugging purposes.</summary>
- private static ILog log = LogManager.GetLogger(typeof(DurableSubscriptionTest));
-
- /// <summary>Defines the name of the test topic to use with the tests.</summary>
- public const string TEST_ROUTING_KEY = "durablesubtestkey";
-
- [SetUp]
- public override void Init()
- {
- base.Init();
- }
-
- [TearDown]
- public override void Shutdown()
- {
- base.Shutdown();
- }
-
- [Test]
- public void TestDurableSubscriptionNoAck()
- {
- TestDurableSubscription(AcknowledgeMode.NoAcknowledge);
- }
-
- [Test]
- public void TestDurableSubscriptionAutoAck()
- {
- TestDurableSubscription(AcknowledgeMode.AutoAcknowledge);
- }
-
- private void TestDurableSubscription(AcknowledgeMode ackMode)
- {
- // Create a topic with one producer and two consumers.
- SetUpEndPoint(0, true, false, TEST_ROUTING_KEY + testId, ackMode, false, ExchangeNameDefaults.TOPIC, true, false, null);
- SetUpEndPoint(1, false, true, TEST_ROUTING_KEY + testId, ackMode, false, ExchangeNameDefaults.TOPIC, true, false, null);
- SetUpEndPoint(2, false, true, TEST_ROUTING_KEY + testId, ackMode, false, ExchangeNameDefaults.TOPIC, true,
- true, "TestSubscription" + testId);
-
- Thread.Sleep(500);
-
- // Send messages and receive on both consumers.
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
-
- ConsumeNMessagesOnly(1, "A", testConsumer[1]);
- ConsumeNMessagesOnly(1, "A", testConsumer[2]);
-
- // Detach one consumer.
- CloseEndPoint(2);
-
- // Send message and receive on one consumer.
- testProducer[0].Send(testChannel[0].CreateTextMessage("B"));
-
- ConsumeNMessagesOnly(1, "B", testConsumer[1]);
-
- // Re-attach consumer, check that it gets the messages that it missed.
- SetUpEndPoint(2, false, true, TEST_ROUTING_KEY + testId, ackMode, false, ExchangeNameDefaults.TOPIC, true,
- true, "TestSubscription" + testId);
-
- ConsumeNMessagesOnly(1, "B", testConsumer[2]);
-
- // Clean up any open consumers at the end of the test.
- CloseEndPoint(2);
- CloseEndPoint(1);
- CloseEndPoint(0);
- }
-
- /// <summary> Check that an uncommitted receive can be re-received, on re-consume from the same durable subscription. </summary>
- [Test]
- public void TestUncommittedReceiveCanBeRereceivedNewConnection()
- {
- SetUpEndPoint(0, true, false, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
- true, false, null);
- SetUpEndPoint(1, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
- true, true, "foo"+testId);
-
- // Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("C"));
- testChannel[0].Commit();
-
- // Try to receive messages, but don't commit them.
- ConsumeNMessagesOnly(1, "C", testConsumer[1]);
-
- // Close end-point 1 without committing the message, then re-open the subscription to consume again.
- CloseEndPoint(1);
- SetUpEndPoint(1, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
- true, true, "foo"+testId);
-
- // Check that the message was released from the rolled back end-point an can be received on the alternative one instead.
- ConsumeNMessagesOnly(1, "C", testConsumer[1]);
- testChannel[1].Commit();
- CloseEndPoint(1);
- CloseEndPoint(0);
- }
-
- /// <summary> Check that a rolled back receive can be re-received, on re-consume from the same durable subscription. </summary>
- [Test]
- public void TestRolledBackReceiveCanBeRereceivedNewConnection()
- {
- SetUpEndPoint(0, true, false, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
- true, false, null);
- SetUpEndPoint(1, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
- true, true, "foo"+testId);
-
- // Send messages.
- testProducer[0].Send(testChannel[0].CreateTextMessage("D"));
- testChannel[0].Commit();
-
- // Try to receive messages, but roll them back.
- ConsumeNMessagesOnly(1, "D", testConsumer[1]);
- testChannel[1].Rollback();
-
- // Close end-point 1 without committing the message, then re-open the subscription to consume again.
- CloseEndPoint(1);
- SetUpEndPoint(1, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, true, ExchangeNameDefaults.TOPIC,
- true, true, "foo"+testId);
-
- // Check that the message was released from the rolled back end-point an can be received on the alternative one instead.
- ConsumeNMessagesOnly(1, "D", testConsumer[1]);
- testChannel[1].Commit();
- CloseEndPoint(1);
- CloseEndPoint(0);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/HeadersExchangeTest.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/HeadersExchangeTest.cs
deleted file mode 100644
index 5e17cf1d2d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/HeadersExchangeTest.cs
+++ /dev/null
@@ -1,282 +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;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- /// <summary>
- /// Sets up a producer/consumer pair to send test messages through a header exchange. The header exchange matching pattern is tested to
- /// verify that it correctly matches or filters out messages based on their headers.
- ///
- /// Check that a message matching all fields of a headers exchange is passed by the exchange.
- /// Check that a message containing values for empty fields of a headers exchange is passed by the exchange.
- /// Check that a message matching only some fields of a headers exhcnage is not passed by the exchange.
- /// Check that a message with additional fields to the correct matching fields of a headers exchange is passed by the exchange.
- /// </summary>
- ///
- /// <todo>Remove the HeadersMatchingProducer class and rename this to HeaderExchangeTest. The producer and consumer are implemented
- /// in a single test class to make running this as part of an automated test suite possible.</todo>
- ///
- /// <todo>Consider not using a delegate to callback the OnMessage method. Easier to just call receive on the consumer but using the
- /// callback does demonstrate how to do so.</todo>
- [TestFixture, Category("Integration")]
- public class HeadersExchangeTest : BaseMessagingTestFixture
- {
- private static ILog _logger = LogManager.GetLogger(typeof(HeadersExchangeTest));
-
- /// <summary> Holds the default test timeout for broker communications before tests give up. </summary>
- private static readonly int TIMEOUT = 2000;
-
- /// <summary> Holds the name of the headers exchange to create to send test messages on. </summary>
- private string _exchangeName = "ServiceQ1";
-
- /// <summary> Used to preserve the most recent exception in case test cases need to examine it. </summary>
- private Exception _lastException = null;
-
- /// <summary> Used to preserve the most recent message from the test consumer. </summary>
- private IMessage _lastMessage = null;
-
- /// <summary> The test consumer to get messages from the broker with. </summary>
- private IMessageConsumer _consumer;
-
- private IMessagePublisher _publisher;
-
- private AutoResetEvent _evt = new AutoResetEvent(false);
-
- private MessageReceivedDelegate _msgRecDelegate;
- private ExceptionListenerDelegate _exceptionDelegate;
-
- /// <summary> Holds the test connection. </summary>
- protected IConnection _connection;
-
- /// <summary> Holds the test channel. </summary>
- protected IChannel _channel;
-
- [SetUp]
- public override void Init()
- {
- // Ensure that the base init method is called. It establishes a connection with the broker.
- base.Init();
-
- connectionInfo = QpidConnectionInfo.FromUrl(connectionUri);
- _connection = new AMQConnection(connectionInfo);
- _channel = _connection.CreateChannel(false, AcknowledgeMode.AutoAcknowledge, 500, 300);
-
- _logger.Info("Starting...");
- _logger.Info("Exchange name is '" + _exchangeName + "'...");
-
- // Register this to listen for exceptions on the test connection.
- _exceptionDelegate = new ExceptionListenerDelegate(OnException);
- _connection.ExceptionListener += _exceptionDelegate;
-
- // Declare a new headers exchange with the name of the test service.
- _channel.DeclareExchange(_exchangeName, ExchangeClassConstants.HEADERS);
-
- // Create a non-durable, temporary (aka auto-delete), exclusive queue.
- string queueName = _channel.GenerateUniqueName();
- _channel.DeclareQueue(queueName, false, true, true);
-
- // Bind the queue to the new headers exchange, setting up some header patterns for the exchange to match.
- _channel.Bind(queueName, _exchangeName, null, CreatePatternAsFieldTable());
-
- // Create a test consumer to consume messages from the test exchange.
- _consumer = _channel.CreateConsumerBuilder(queueName)
- .WithPrefetchLow(100)
- .WithPrefetchHigh(500)
- .WithNoLocal(false) // make sure we get our own messages
- .Create();
-
- // Register this to listen for messages on the consumer.
- _msgRecDelegate = new MessageReceivedDelegate(OnMessage);
- _consumer.OnMessage += _msgRecDelegate;
-
- // Clear the most recent message and exception.
- _lastException = null;
- _lastMessage = null;
-
- _publisher = _channel.CreatePublisherBuilder()
- .WithExchangeName(_exchangeName)
- .WithMandatory(true)
- .Create();
-
- _publisher.DeliveryMode = DeliveryMode.NonPersistent;
-
- // Start all channel
- _connection.Start();
- }
-
- /// <summary>
- /// Deregisters the on message delegate before closing the connection.
- /// </summary>
- [TearDown]
- public override void Shutdown()
- {
- _logger.Info("public void Shutdown(): called");
-
- //_consumer.OnMessage -= _msgRecDelegate;
- //_connection.ExceptionListener -= _exceptionDelegate;
-
- _connection.Stop();
- _connection.Close();
- _connection.Dispose();
-
- base.Shutdown();
- }
-
- /// <summary>
- /// Callback method that is passed any messages received on the test channel.
- /// </summary>
- ///
- /// <param name="message">The received message.</param>
- public void OnMessage(IMessage message)
- {
- _logger.Debug(string.Format("message.Type = {0}", message.GetType()));
- _logger.Debug("Got message '" + message + "'");
-
- // Preserve the most recent exception so that test cases can examine it.
- _lastMessage = message;
-
- // Notify any waiting threads that a message has been received.
- _evt.Set();
- }
-
- /// <summary>Callback method to handle any exceptions raised by the test connection.</summary>
- ///
- /// <param name="e">The connection exception.</param>
- public void OnException(Exception e)
- {
- // Preserve the most recent exception in case test cases need to examine it.
- _lastException = e;
-
- // Notify any waiting threads that an exception event has occurred.
- _evt.Set();
- }
-
- /// <summary>Check that a message matching all fields of a headers exchange is passed by the exchange.</summary>
- [Test]
- public void TestMatchAll()
- {
- IMessage msg = _channel.CreateTextMessage("matches match2=''");
- msg.Headers["match1"] = "foo";
- msg.Headers["match2"] = "";
-
- // Use the SendTestMessage helper method to verify that the message was sent and received.
- SendTestMessage(msg, true);
- }
-
- /// <summary>Check that a message containing values for empty fields of a headers exchange is passed by the exchange.</summary>
- [Test]
- public void TestMatchEmptyMatchesAnything()
- {
- // Send a test message that matches the headers exchange.
- IMessage msg = _channel.CreateTextMessage("matches match1='foo' and match2='bar'");
- msg.Headers["match1"] = "foo";
- msg.Headers["match2"] = "bar";
-
- // Use the SendTestMessage helper method to verify that the message was sent and received.
- SendTestMessage(msg, true);
- }
-
- /// <summary>Check that a message matching only some fields of a headers exchange is not passed by the exchange.</summary>
- [Test]
- public void TestMatchOneFails()
- {
- IMessage msg = _channel.CreateTextMessage("not match - only match1");
- msg.Headers["match1"] = "foo";
-
- // Use the SendTestMessage helper method to verify that the message was sent and not received.
- SendTestMessage(msg, false);
- }
-
- /// <summary>
- /// Check that a message with additional fields to the correct matching fields of a headers exchange is passed by
- /// the exchange.
- /// </summary>
- [Test]
- public void TestMatchExtraFields()
- {
- IMessage msg = _channel.CreateTextMessage("matches - extra headers");
- msg.Headers["match1"] = "foo";
- msg.Headers["match2"] = "bar";
- msg.Headers["match3"] = "not required";
-
- // Use the SendTestMessage helper method to verify that the message was sent and received.
- SendTestMessage(msg, true);
- }
-
- /// <summary>
- /// Sends the specified message to the test publisher, and confirms that it was received by the test consumer or not
- /// depending on whether or not the message should be received by the consumer.
- ///
- /// Any exceptions raised by the connection will cause an Assert failure exception to be raised.
- /// </summary>
- ///
- /// <param name="msgSend">The message to send.</param>
- /// <param name="shouldPass">A flag to indicate whether or not the message should be received by the consumer.</param>
- private void SendTestMessage(IMessage msgSend, bool shouldPass)
- {
- _publisher.Send(msgSend);
- _evt.WaitOne(TIMEOUT, true);
-
- // Check that an exception other than not routable was raised in which case re-raise it as a test error.
- if (_lastException != null && !(_lastException.InnerException is AMQUndeliveredException))
- {
- Assert.Fail("Exception {0} was raised by the broker connection.", _lastException);
- }
- // Check that a message was returned if the test is expecting the message to pass.
- else if (shouldPass)
- {
- Assert.IsNotNull(_lastMessage, "Did not get a matching message from the headers exchange.");
- }
- // Check that a not routable exception was raised if the test is expecting the message to fail.
- else if (_lastException != null && _lastException.InnerException is AMQUndeliveredException)
- {
- Assert.IsNull(_lastMessage, "Message could not be routed so consumer should not have received it.");
- }
- // The broker did not respond within the test timeout so fail the test.
- else
- {
- Assert.Fail("The test timed out without a response from the broker.");
- }
- }
-
- /// <summary> Returns a field table containing patterns to match the test header exchange against. </summary>
- ///
- /// <returns> A field table containing test patterns. </returns>
- private FieldTable CreatePatternAsFieldTable()
- {
- FieldTable matchTable = new FieldTable();
-
- matchTable["match1"] = "foo";
- matchTable["match2"] = "";
- matchTable["x-match"] = "all";
-
- return matchTable;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/MandatoryMessageTest.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/MandatoryMessageTest.cs
deleted file mode 100644
index 6cfdad1f94..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/MandatoryMessageTest.cs
+++ /dev/null
@@ -1,149 +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;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- /// <summary>
- /// MandatoryMessageTest checks that messages sent with the 'mandatory' flag, must either be routed to a valid
- /// queue or returned to the sender when no route is available.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Check default exchange returns unroutable mandatory messages.
- /// <tr><td> Check direct exchange returns unroutable mandatory messages.
- /// <tr><td> Check headers exchange returns unroutable mandatory messages.
- /// <tr><td> Check topic exchange returns unroutable mandatory messages.
- /// </table>
- /// </summary>
- [TestFixture, Category("Integration")]
- public class MandatoryMessageTest : BaseMessagingTestFixture
- {
- /// <summary>Used for debugging purposes.</summary>
- private static ILog log = LogManager.GetLogger(typeof(MandatoryMessageTest));
-
- /// <summary>Defines the maximum time in milliseconds, to wait for redelivery to occurr.</summary>
- public const int TIMEOUT = 1000;
-
- /// <summary>Defines the name of the routing key to use with the tests.</summary>
- public const string TEST_ROUTING_KEY = "unboundkey";
-
- /// <summary>Condition used to coordinate receipt of redelivery exception to the sending thread.</summary>
- private ManualResetEvent errorEvent;
-
- /// <summary>Holds the last received error condition, for examination by the tests sending thread.</summary>
- private Exception lastErrorException;
-
- /// <summary> Holds the test connection. </summary>
- protected IConnection _connection;
-
- /// <summary> Holds the test channel. </summary>
- protected IChannel _channel;
-
- [SetUp]
- public override void Init()
- {
- base.Init();
-
- errorEvent = new ManualResetEvent(false);
- lastErrorException = null;
- }
-
- [TearDown]
- public override void Shutdown()
- {
- base.Shutdown();
- }
-
- /// <summary>
- /// Handles all exception conditions on the connection. The error event is notified and the exception recorded as the last seen.
- /// </summary>
- ///
- /// <param name="e">The asynchronous exception on the connection.</param>
- public void OnException(Exception e)
- {
- lastErrorException = e;
- errorEvent.Set();
- }
-
- [Test]
- public void SendUndeliverableMessageOnDirectExchange()
- {
- SendOne(ExchangeNameDefaults.DIRECT);
- }
-
- [Test]
- public void SendUndeliverableMessageOnTopicExchange()
- {
- SendOne(ExchangeNameDefaults.TOPIC);
- }
-
- [Test]
- public void SendUndeliverableMessageOnHeadersExchange()
- {
- SendOne(ExchangeNameDefaults.HEADERS);
- }
-
- /// <summary>
- /// Sends a single message to the specified exchange with the routing key 'unboundkey', marked as mandatory.
- /// A check is performed to assert that a redelivery error is returned from the broker for the message.
- /// </summary>
- ///
- /// <param name="exchangeName">The name of the exchange to send to.</param>
- private void SendOne(string exchangeName)
- {
- log.Debug("private void SendOne(string exchangeName = " + exchangeName + "): called");
-
- // Send a test message to a unbound key on the specified exchange.
- SetUpEndPoint(0, false, false, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, exchangeName,
- true, false, null);
- testProducer[0] = testChannel[0].CreatePublisherBuilder()
- .WithRoutingKey(TEST_ROUTING_KEY + testId)
- .WithMandatory(true)
- .WithExchangeName(exchangeName)
- .Create();
-
- // Set up the exception listener on the connection.
- testConnection[0].ExceptionListener = new ExceptionListenerDelegate(OnException);
-
- // Send message that should fail.
- testProducer[0].Send(testChannel[0].CreateTextMessage("Test Message"));
-
- // Wait for up to the timeout for a redelivery exception to be returned.
- errorEvent.WaitOne(TIMEOUT, true);
-
- // Asserts that a redelivery exception was returned, and is of the correct type.
- Type expectedException = typeof(AMQUndeliveredException);
- Exception ex = lastErrorException;
-
- Assert.IsNotNull(ex, "No exception was thrown by the test. Expected " + expectedException);
- Assert.IsInstanceOfType(expectedException, ex.InnerException);
-
- CloseEndPoint(0);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs
deleted file mode 100644
index 876e7c7bf7..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/ProducerMultiConsumerTest.cs
+++ /dev/null
@@ -1,167 +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;
-using System.Text;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- /// ProducerMultiConsumerTest provides some tests for one producer and multiple consumers.
- ///
- /// <p><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Check that all consumers on a topic each receive all message on it.
- /// <tr><td> Check that consumers on the same queue receive each message once accross all consumers.
- /// </table>
- /// </summary>
- [TestFixture, Category("Integration")]
- public class ProducerMultiConsumerTest : BaseMessagingTestFixture
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(ProducerMultiConsumerTest));
-
- /// <summary>Base name for the routing key used for this test (made unique by adding in test id).</summary>
- private const string TEST_ROUTING_KEY = "ProducerMultiConsumerTest";
-
- /// <summary>The number of consumers to test.</summary>
- private const int CONSUMER_COUNT = 5;
-
- /// <summary>The number of test messages to send.</summary>
- private const int MESSAGE_COUNT = 10;
-
- /// <summary>Monitor used to signal succesfull receipt of all test messages.</summary>
- AutoResetEvent _finishedEvent;
-
- /// <summary>Used to count test messages received so far.</summary>
- private int _messageReceivedCount;
-
- /// <summary>Used to hold the expected number of messages to receive.</summary>
- private int expectedMessageCount;
-
- /// <summary>Flag used to indicate that all messages really were received, and that the test did not just time out. </summary>
- private bool allReceived;
-
- /// <summary> Creates one producing end-point and many consuming end-points connected on a topic. </summary>
- [SetUp]
- public override void Init()
- {
- base.Init();
-
- // Reset all test counts and flags.
- _messageReceivedCount = 0;
- allReceived = false;
- _finishedEvent = new AutoResetEvent(false);
- }
-
- /// <summary> Cleans up all test end-points. </summary>
- [TearDown]
- public override void Shutdown()
- {
- try
- {
- // Close all end points for producer and consumers.
- // Producer is on 0, and consumers on 1 .. n, so loop is from 0 to n inclusive.
- for (int i = 0; i <= CONSUMER_COUNT; i++)
- {
- CloseEndPoint(i);
- }
- }
- finally
- {
- base.Shutdown();
- }
- }
-
- /// <summary> Check that all consumers on a topic each receive all message on it. </summary>
- [Test]
- public void AllConsumerReceiveAllMessagesOnTopic()
- {
- // Create end-points for all the consumers in the test.
- for (int i = 1; i <= CONSUMER_COUNT; i++)
- {
- SetUpEndPoint(i, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, ExchangeNameDefaults.TOPIC,
- true, false, null);
- testConsumer[i].OnMessage += new MessageReceivedDelegate(OnMessage);
- }
-
- // Create an end-point to publish to the test topic.
- SetUpEndPoint(0, true, false, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, ExchangeNameDefaults.TOPIC,
- true, false, null);
-
- expectedMessageCount = (MESSAGE_COUNT * CONSUMER_COUNT);
-
- for (int i = 0; i < MESSAGE_COUNT; i++)
- {
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
- }
-
- _finishedEvent.WaitOne(new TimeSpan(0, 0, 0, 30), false);
-
- // Check that all messages really were received.
- Assert.IsTrue(allReceived, "All messages were not received, only got " + _messageReceivedCount + " but wanted " + expectedMessageCount);
- }
-
- /// <summary> Check that consumers on the same queue receive each message once accross all consumers. </summary>
- [Test]
- public void AllConsumerReceiveAllMessagesOnDirect()
- {
- // Create end-points for all the consumers in the test.
- for (int i = 1; i <= CONSUMER_COUNT; i++)
- {
- SetUpEndPoint(i, false, true, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, ExchangeNameDefaults.DIRECT,
- true, false, null);
- testConsumer[i].OnMessage += new MessageReceivedDelegate(OnMessage);
- }
-
- // Create an end-point to publish to the test topic.
- SetUpEndPoint(0, true, false, TEST_ROUTING_KEY + testId, AcknowledgeMode.AutoAcknowledge, false, ExchangeNameDefaults.DIRECT,
- true, false, null);
-
- expectedMessageCount = (MESSAGE_COUNT * CONSUMER_COUNT);
-
- for (int i = 0; i < MESSAGE_COUNT; i++)
- {
- testProducer[0].Send(testChannel[0].CreateTextMessage("A"));
- }
-
- _finishedEvent.WaitOne(new TimeSpan(0, 0, 0, 30), false);
-
- // Check that all messages really were received.
- Assert.IsTrue(allReceived, "All messages were not received, only got: " + _messageReceivedCount + " but wanted " + expectedMessageCount);
- }
-
- /// <summary> Atomically increments the message count on every message, and signals once all messages in the test are received. </summary>
- public void OnMessage(IMessage m)
- {
- int newCount = Interlocked.Increment(ref _messageReceivedCount);
-
- if (newCount >= expectedMessageCount)
- {
- allReceived = true;
- _finishedEvent.Set();
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/Qpid.Integration.Tests.csproj b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/Qpid.Integration.Tests.csproj
deleted file mode 100755
index 1df37f6c1b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/Qpid.Integration.Tests.csproj
+++ /dev/null
@@ -1,63 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <ProjectGuid>{EFEB9E41-B66E-4674-85F7-18FAD056AD67}</ProjectGuid>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <OutputType>Exe</OutputType>
- <RootNamespace>Qpid.Integration.Tests</RootNamespace>
- <AssemblyName>Qpid.Integration.Tests</AssemblyName>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
- <OutputPath>bin\Debug\</OutputPath>
- <DebugSymbols>True</DebugSymbols>
- <DebugType>Full</DebugType>
- <Optimize>False</Optimize>
- <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
- <OutputPath>bin\Release\</OutputPath>
- <DebugSymbols>False</DebugSymbols>
- <DebugType>None</DebugType>
- <Optimize>True</Optimize>
- <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
- <DefineConstants>TRACE</DefineConstants>
- </PropertyGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="BaseMessagingTestFixture.cs" />
- <Compile Include="ChannelQueueTest.cs" />
- <Compile Include="CommitRollbackTest.cs" />
- <Compile Include="ConnectionTest.cs" />
- <Compile Include="DurableSubscriptionTest.cs" />
- <Compile Include="HeadersExchangeTest.cs" />
- <Compile Include="MandatoryMessageTest.cs" />
- <Compile Include="ProducerMultiConsumerTest.cs" />
- <Compile Include="SslConnectionTest.cs" />
- </ItemGroup>
-</Project>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/SslConnectionTest.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/SslConnectionTest.cs
deleted file mode 100644
index 1c104d1451..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/SslConnectionTest.cs
+++ /dev/null
@@ -1,64 +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;
-using System.IO;
-using System.Reflection;
-using System.Security.Cryptography.X509Certificates;
-using NUnit.Framework;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- /// <summary>
- /// Test SSL/TLS connections to the broker
- /// </summary>
- [TestFixture, Category("Integration")]
- public class SslConnectionTest
- {
- /// <summary>
- /// Make a test TLS connection to the broker
- /// without using client-certificates
- /// </summary>
- //[Test]
- public void DoSslConnection()
- {
- // because for tests we don't usually trust the server certificate
- // we need here to tell the client to ignore certificate validation errors
- SslOptions sslConfig = new SslOptions(null, true);
-
- MakeBrokerConnection(sslConfig);
- }
-
- private static void MakeBrokerConnection(SslOptions options)
- {
- IConnectionInfo connectionInfo = new QpidConnectionInfo();
- connectionInfo.VirtualHost = "test";
- connectionInfo.AddBrokerInfo(new AmqBrokerInfo("amqp", "localhost", 8672, options));
-
- using ( IConnection connection = new AMQConnection(connectionInfo) )
- {
- Console.WriteLine("connection = " + connection);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/SustainedTest.cs b/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/SustainedTest.cs
deleted file mode 100644
index aca3f396d6..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Integration.Tests/testcases/SustainedTest.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.
- *
- */
-using System;
-using System.IO;
-using System.Reflection;
-using System.Threading;
-using NUnit.Framework;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Client;
-using Apache.Qpid.Messaging;
-using log4net;
-
-namespace Apache.Qpid.Integration.Tests.testcases
-{
- /// <summary>
- /// Runs through the range of ack modes for each test case, sending and recieving a large number of messages
- /// </summary>
- [TestFixture, Category("Integration")]
- public class SustainedTest : BaseMessagingTestFixture
- {
- /// <summary>The number of test messages to send.</summary>
- private const int MESSAGE_COUNT = 50;//00;
-
- /// <summary>Base name for the routing key used for this test (made unique by adding in test id).</summary>
- private const string TEST_ROUTING_KEY = "MessageOrderTest";
-
- /// <summary>
- /// The logger
- /// </summary>
- private static ILog _logger = LogManager.GetLogger(typeof(SustainedTest));
-
- [Test]
- public void MessageOrderTestAutoAck()
- {
- MessageOrderTest(AcknowledgeMode.AutoAcknowledge);
- }
-
- [Test]
- public void MessageOrderTestNoAck()
- {
- MessageOrderTest(AcknowledgeMode.NoAcknowledge);
- }
-
- public void MessageOrderTest(AcknowledgeMode consumerMode)
- {
-
- // Consumer
- SetUpEndPoint(1, false, true, TEST_ROUTING_KEY, consumerMode, false, ExchangeNameDefaults.DIRECT,
- true, false, null);
-
-
- Console.WriteLine("Starting producer thread");
- Thread prodThread = new Thread(new ThreadStart(SendMessages));
- prodThread.Start();
-
- Thread.Sleep(2000);
- Console.WriteLine("Starting consuming");
- for (int i = 0; i < MESSAGE_COUNT; i++)
- {
- if ((i % 10) == 0)
- {
- Console.WriteLine("Consuming message "+i);
- }
- ConsumeNMessages(1, "Msg"+i, testConsumer[1]);
- }
- prodThread.Join();
- CloseEndPoint(0);
- CloseEndPoint(1);
- }
-
- private static void SendMessages()
- {
- AMQConnection conn = new AMQConnection(QpidConnectionInfo.FromUrl(BaseMessagingTestFixture.connectionUri));
- conn.Start();
- IChannel channel = conn.CreateChannel(false, AcknowledgeMode.AutoAcknowledge);
- IMessagePublisher producer = channel.CreatePublisherBuilder().
- WithExchangeName(ExchangeNameDefaults.DIRECT).
- WithRoutingKey(TEST_ROUTING_KEY).
- Create();
-
- for (int i = 0; i < MESSAGE_COUNT ; i++)
- {
- if ((i % 10) == 0)
- {
- Console.WriteLine("Sending message "+i);
- }
- producer.Send(channel.CreateTextMessage("Msg" + i));
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/AcknowledgeMode.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/AcknowledgeMode.cs
deleted file mode 100644
index 4896b64f68..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/AcknowledgeMode.cs
+++ /dev/null
@@ -1,42 +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.Messaging
-{
- public enum AcknowledgeMode
- {
- AutoAcknowledge,
- ClientAcknowledge,
- DupsOkAcknowledge,
- SessionTransacted,
-
- /// <summary>
- /// Indicates that no client acknowledgements are required. Broker assumes that once it has
- /// delivered a message packet successfully it is acknowledged.
- /// </summary>
- NoAcknowledge,
-
- /// <summary>
- /// Pre acknowledge means that an ack is sent per message but sent before user code has processed
- /// the message (i.e. before the onMessage() call or the receive() method has returned).
- /// </summary>
- PreAcknowledge
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/ChannelLimitReachedException.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/ChannelLimitReachedException.cs
deleted file mode 100644
index 8b43422f5c..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/ChannelLimitReachedException.cs
+++ /dev/null
@@ -1,60 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Messaging
-{
- [Serializable]
- public class ChannelLimitReachedException : ResourceAllocationException
- {
- private long _limit;
-
- public ChannelLimitReachedException(long limit)
- : base("Unable to create session since maximum number of sessions per connection is " +
- limit + ". Either close one or more sessions or increase the " +
- "maximum number of sessions per connection (or contact your OpenAMQ administrator.")
- {
- _limit = limit;
- }
-
- protected ChannelLimitReachedException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- _limit = info.GetInt64("Limit");
- }
-
- public long Limit
- {
- get
- {
- return _limit;
- }
- }
-
- public override void GetObjectData(SerializationInfo info, StreamingContext context)
- {
- base.GetObjectData(info, context);
- info.AddValue("Limit", _limit);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/DeliveryMode.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/DeliveryMode.cs
deleted file mode 100644
index 3c4713ee2a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/DeliveryMode.cs
+++ /dev/null
@@ -1,28 +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.Messaging
-{
- public enum DeliveryMode
- {
- NonPersistent,
- Persistent
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/ExchangeClassConstants.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/ExchangeClassConstants.cs
deleted file mode 100644
index 984e8b0f17..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/ExchangeClassConstants.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.Messaging
-{
- public class ExchangeClassConstants
- {
- public readonly static string TOPIC = "topic";
- public readonly static string DIRECT = "direct";
- public readonly static string HEADERS = "headers";
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/ExchangeNameDefaults.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/ExchangeNameDefaults.cs
deleted file mode 100644
index 2689fb5e46..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/ExchangeNameDefaults.cs
+++ /dev/null
@@ -1,42 +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.Messaging
-{
- public class ExchangeNameDefaults
- {
- public readonly static string TOPIC = "amq.topic";
- public readonly static string DIRECT = "amq.direct";
- public readonly static string HEADERS = "amq.match";
- public readonly static string FANOUT = "amq.fanout";
-
- /// <summary> Defines the identifying type name of topic exchanges. </summary>
- public readonly static string TOPIC_EXCHANGE_CLASS = "topic";
-
- /// <summary> Defines the identifying type name of direct exchanges. </summary>
- public readonly static string DIRECT_EXCHANGE_CLASS = "direct";
-
- /// <summary> Defines the identifying type name of headers exchanges. </summary>
- public readonly static string HEADERS_EXCHANGE_CLASS = "headers";
-
- /// <summary> Defines the identifying type name of fanout exchanges. </summary>
- public readonly static string FANOUT_EXCHANGE_CLASS = "fanout";
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/IBytesMessage.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/IBytesMessage.cs
deleted file mode 100644
index 5be942423d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/IBytesMessage.cs
+++ /dev/null
@@ -1,63 +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.Messaging
-{
- public interface IBytesMessage : IMessage
- {
- long BodyLength { get; }
-
- bool ReadBoolean();
- void WriteBoolean(bool value);
-
- byte ReadByte();
- int ReadBytes(byte[] array);
- int ReadBytes(byte[] array, int length);
- void WriteByte(byte value);
- void WriteBytes(byte[] value);
- void WriteBytes(byte[] value, int offset, int length);
-
- char ReadChar();
- void WriteChar(char value);
-
- double ReadDouble();
- void WriteDouble(double value);
-
- float ReadFloat();
- void WriteFloat(float value);
-
- int ReadInt();
- void WriteInt(int value);
-
- long ReadLong();
- void WriteLong(long value);
-
- short ReadShort();
- void WriteShort(short value);
-
- short ReadSignedByte();
- void WriteSignedByte(short value);
-
- string ReadUTF();
- void WriteUTF(string value);
-
- void Reset();
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/IChannel.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/IChannel.cs
deleted file mode 100644
index 461867b34a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/IChannel.cs
+++ /dev/null
@@ -1,252 +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;
-
-namespace Apache.Qpid.Messaging
-{
- public delegate void MessageReceivedDelegate(IMessage msg);
-
- /// <summary>
- /// IChannel provides methods to access the commands in AMQP that operate at the channel level. This can be summarized as
- /// the ability to declare queues and exchanges, bind queues to exchanges, create messages of various types, declare transaction
- /// boundaries (commit and rollback), and to set up producers and consumers on the channel.
- ///
- /// <p/>You can create a channel by using the CreateChannel() method
- /// of the connection object.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities
- /// <tr><td> Declare queues.
- /// <tr><td> Declare exchanges.
- /// <tr><td> Bind queues to exchanges.
- /// <tr><td> Create messages.
- /// <tr><td> Set up message consumers on the channel.
- /// <tr><td> Set up message producers on the channel.
- /// <tr><td> Commit the current transaction.
- /// <tr><td> Roll-back the current transaction.
- /// <tr><td> Close the channel.
- /// </table>
- /// </summary>
- public interface IChannel : IDisposable, ICloseable
- {
- /// <summary>
- /// Acknowledge mode for messages received.
- /// </summary>
- AcknowledgeMode AcknowledgeMode { get; }
-
- /// <summary>
- /// True if the channel should use transactions.
- /// </summary>
- bool Transacted { get; }
-
- /// <summary>
- /// Prefetch value to be used as the default for
- /// consumers created on this channel.
- /// </summary>
- int DefaultPrefetch { get; }
-
- /// <summary>
- /// Prefetch low value to be used as the default for
- /// consumers created on this channel.
- /// </summary>
- int DefaultPrefetchLow { get; }
-
- /// <summary>
- /// Prefetch high value to be used as the default for
- /// consumers created on this channel.
- /// </summary>
- int DefaultPrefetchHigh { get; }
-
- /// <summary>
- /// Declare a new exchange.
- /// </summary>
- /// <param name="exchangeName">Name of the exchange</param>
- /// <param name="exchangeClass">Class of the exchange, from <see cref="ExchangeClassConstants"/></param>
- void DeclareExchange(string exchangeName, string exchangeClass);
-
- /// <summary>
- /// Declare a new exchange using the default exchange class.
- /// </summary>
- /// <param name="exchangeName">Name of the exchange</param>
- void DeleteExchange(string exchangeName);
-
- /// <summary>
- /// Declare a new queue with the specified set of arguments.
- /// </summary>
- /// <param name="queueName">Name of the queue</param>
- /// <param name="isDurable">True if the queue should be durable</param>
- /// <param name="isExclusive">True if the queue should be exclusive to this channel</param>
- /// <param name="isAutoDelete">True if the queue should be deleted when the channel closes</param>
- void DeclareQueue(string queueName, bool isDurable, bool isExclusive, bool isAutoDelete);
-
- /// <summary>
- /// Delete a queue with the specifies arguments.
- /// </summary>
- /// <param name="queueName">Name of the queue to delete</param>
- /// <param name="ifUnused">If true, the queue will not deleted if it has no consumers</param>
- /// <param name="ifEmpty">If true, the queue will not deleted if it has no messages</param>
- /// <param name="noWait">If true, the server will not respond to the method</param>
- void DeleteQueue(string queueName, bool ifUnused, bool ifEmpty, bool noWait);
-
- /// <summary>
- /// Generate a new Unique name to use for a queue.
- /// </summary>
- /// <returns>A unique name to this channel</returns>
- string GenerateUniqueName();
-
- /// <summary>
- /// Removes all messages from a queue.
- /// </summary>
- /// <param name="queueName">Name of the queue to delete</param>
- /// <param name="noWait">If true, the server will not respond to the method</param>
- void PurgeQueue(string queueName, bool noWait);
-
- /// <summary>
- /// Bind a queue to the specified exchange.
- /// </summary>
- /// <param name="queueName">Name of queue to bind</param>
- /// <param name="exchangeName">Name of exchange to bind to</param>
- /// <param name="routingKey">Routing key</param>
- void Bind(string queueName, string exchangeName, string routingKey);
-
- /// <summary>
- /// Bind a queue to the specified exchange.
- /// </summary>
- /// <param name="queueName">Name of queue to bind</param>
- /// <param name="exchangeName">Name of exchange to bind to</param>
- /// <param name="routingKey">Routing key</param>
- /// <param name="args">Table of arguments for the binding. Used to bind with a Headers Exchange</param>
- void Bind(string queueName, string exchangeName, string routingKey, IFieldTable args);
-
- /// <summary>
- /// Create a new empty message with no body.
- /// </summary>
- /// <returns>The new message</returns>
- IMessage CreateMessage();
-
- /// <summary>
- /// Create a new message of the specified MIME type.
- /// </summary>
- /// <param name="mimeType">The mime type to create</param>
- /// <returns>The new message</returns>
- IMessage CreateMessage(string mimeType);
-
- /// <summary>
- /// Creates a new message for bytes (application/octet-stream).
- /// </summary>
- /// <returns>The new message</returns>
- IBytesMessage CreateBytesMessage();
-
- /// <summary>
- /// Creates a new text message (text/plain) with empty content.
- /// </summary>
- /// <returns>The new message</returns>
- ITextMessage CreateTextMessage();
-
- /// <summary>
- /// Creates a new text message (text/plain) with a body.
- /// </summary>
- /// <param name="initialValue">Initial body of the message</param>
- /// <returns>The new message</returns>
- ITextMessage CreateTextMessage(string initialValue);
-
- #region Consuming
-
- /// <summary>
- /// Creates a new Consumer using the builder pattern.
- /// </summary>
- /// <param name="queueName">Name of queue to receive messages from</param>
- /// <returns>The builder object</returns>
- MessageConsumerBuilder CreateConsumerBuilder(string queueName);
-
- /// <summary>
- /// Creates a new consumer.
- /// </summary>
- /// <param name="queueName">Name of queue to receive messages from</param>
- /// <param name="prefetchLow">Low prefetch value</param>
- /// <param name="prefetchHigh">High prefetch value</param>
- /// <param name="noLocal">If true, messages sent on this channel will not be received by this consumer</param>
- /// <param name="exclusive">If true, the consumer opens the queue in exclusive mode</param>
- /// <returns>The new consumer</returns>
- IMessageConsumer CreateConsumer(string queueName,
- int prefetchLow,
- int prefetchHigh,
- bool noLocal,
- bool exclusive);
-
- /// <summary>
- /// Unsubscribe from a queue.
- /// </summary>
- /// <param name="subscriptionName">Subscription name</param>
- void Unsubscribe(string subscriptionName);
-
- #endregion
-
- #region Publishing
-
- /// <summary>
- /// Create a new message publisher using the builder pattern.
- /// </summary>
- /// <returns>The builder object</returns>
- MessagePublisherBuilder CreatePublisherBuilder();
-
- /// <summary>
- /// Create a new message publisher.
- /// </summary>
- /// <param name="exchangeName">Name of exchange to publish to</param>
- /// <param name="routingKey">Routing key</param>
- /// <param name="deliveryMode">Default delivery mode</param>
- /// <param name="timeToLive">Default TTL time of messages</param>
- /// <param name="immediate">If true, sent immediately</param>
- /// <param name="mandatory">If true, the broker will return an error
- /// (as a connection exception) if the message cannot be delivered</param>
- /// <param name="priority">Default message priority</param>
- /// <returns>The new message publisher</returns>
- IMessagePublisher CreatePublisher(string exchangeName,
- string routingKey,
- DeliveryMode deliveryMode,
- long timeToLive,
- bool immediate,
- bool mandatory,
- int priority);
-
- #endregion
-
- #region Transactions
-
- /// <summary>
- /// Recover after transaction failure.
- /// </summary>
- void Recover();
-
- /// <summary>
- /// Commit the transaction.
- /// </summary>
- void Commit();
-
- /// <summary>
- /// Rollback the transaction.
- /// </summary>
- void Rollback();
-
- #endregion
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/ICloseable.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/ICloseable.cs
deleted file mode 100644
index 3c9d66047d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/ICloseable.cs
+++ /dev/null
@@ -1,38 +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;
-
-namespace Apache.Qpid.Messaging
-{
- /// <summary>An ICloseable is a resource that can be explicitly closed. Generally speaking a closed resource can no longer be used, and the
- /// act of closing a resource is usually interpreted as a signal that the closed item can have its resource cleaned up and de-allocated.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Close (and clean-up) a resource.
- /// </table>
- /// </summary>
- public interface ICloseable
- {
- /// <summary> Close the resource. </summary>
- void Close();
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/IConnection.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/IConnection.cs
deleted file mode 100644
index f664137e02..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/IConnection.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;
-
-namespace Apache.Qpid.Messaging
-{
- public delegate void ExceptionListenerDelegate(Exception ex);
-
- public interface IConnection : IDisposable, ICloseable
- {
- /// <summary>
- /// The connection listener that has been registered with this connection.
- /// </summary>
- IConnectionListener ConnectionListener
- {
- get;
- set;
- }
-
- ExceptionListenerDelegate ExceptionListener { get; set; }
-
- string ClientID { get; set; }
-
- /// <return>the maximum number of sessions supported by this Connection</return>
- int MaximumChannelCount
- {
- get;
- }
-
- IChannel CreateChannel(bool transacted, AcknowledgeMode acknowledgeMode);
- IChannel CreateChannel(bool transacted, AcknowledgeMode acknowledgeMode, int prefetch);
- IChannel CreateChannel(bool transacted, AcknowledgeMode acknowledgeMode, int prefetchHigh, int prefetchLow);
-
- void Start();
- void Stop();
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/IConnectionFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/IConnectionFactory.cs
deleted file mode 100644
index f141d509be..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/IConnectionFactory.cs
+++ /dev/null
@@ -1,28 +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.Messaging
-{
- public interface IConnectionFactory
- {
- IConnection CreateConnection();
- IConnection CreateConnection(string userId, string password);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/IConnectionListener.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/IConnectionListener.cs
deleted file mode 100644
index 02d9eb38da..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/IConnectionListener.cs
+++ /dev/null
@@ -1,59 +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.Messaging
-{
- public interface IConnectionListener
- {
- /// <summary>
- /// Called when bytes have been transmitted to the server
- /// </summary>
- /// <param>count the number of bytes sent in total since the connection was opened</param>
- void BytesSent(long count);
-
- /// <summary>
- /// Called when some bytes have been received on a connection
- /// </summary>
- /// <param>count the number of bytes received in total since the connection was opened</param>
- void BytesReceived(long count);
-
- /// <summary>
- /// Called after the infrastructure has detected that failover is required but before attempting failover.
- /// </summary>
- /// <param>redirect true if the broker requested redirect. false if failover is occurring due to a connection error.</param>
- /// <return>true to continue failing over, false to veto failover and raise a connection exception</return>
- bool PreFailover(bool redirect);
-
- /// <summary>
- /// Called after connection has been made to another broker after failover has been started but before
- /// any resubscription has been done.
- /// <return> true to continue with resubscription, false to prevent automatic resubscription. This is useful in
- /// cases where the application wants to handle resubscription. Note that in the latter case all sessions, producers
- /// and consumers are invalidated.
- /// </return
- bool PreResubscribe();
-
- /// <summary>
- /// Called once failover has completed successfully. This is called irrespective of whether the client has
- /// vetoed automatic resubscription.
- /// </summary>
- void FailoverComplete();
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/IFieldTable.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/IFieldTable.cs
deleted file mode 100644
index 730ce399d4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/IFieldTable.cs
+++ /dev/null
@@ -1,42 +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.Collections;
-
-namespace Apache.Qpid.Messaging
-{
- public interface IFieldTable : IEnumerable
- {
- int Count { get; }
-
- object this[string key] { get; set; }
-
- /// <summary>
- /// Adds all the items from another field table in this one.
- /// Will overwrite any items in the current table with the same key.
- /// </summary>
- /// <param name="source">the source field table</param>
- void AddAll(IFieldTable source);
-
- bool Contains(string s);
- void Clear();
- void Remove(string key);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/IHeaders.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/IHeaders.cs
deleted file mode 100644
index 7fdf26ebda..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/IHeaders.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.Messaging
-{
- /// <summary>
- /// IHeaders represents the header fields of an AMQ message and provides methods to access those fields. There are accessor methods to
- /// get and set each header field for each supported header field data type.
- ///
- /// <para/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th>Responsibilities</th></tr>
- /// <tr><td>Provide accessors for all supported header field types.</td></tr>
- /// <tr><td>Check if a set of headers contains a named property.</td></tr>
- /// </table>
- ///
- /// </summary>
- public interface IHeaders
- {
- bool Contains(string name);
-
- object this[string name] { get; set; }
-
- bool GetBoolean(string name);
- void SetBoolean(string name, bool value);
-
- byte GetByte(string name);
- void SetByte(string name, byte value);
-
- //sbyte GetSByte(string name);
- //void SetSByte(string name, sbyte value);
-
- short GetShort(string name);
- void SetShort(string name, short value);
-
- int GetInt(string name);
- void SetInt(string name, int value);
-
- long GetLong(string name);
- void SetLong(string name, long value);
-
- float GetFloat(string name);
- void SetFloat(string name, float value);
-
- double GetDouble(string name);
- void SetDouble(string name, double value);
-
- string GetString(string name);
- void SetString(string name, string value);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/IMessage.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/IMessage.cs
deleted file mode 100644
index 20ae5ee130..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/IMessage.cs
+++ /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.
- *
- */
-namespace Apache.Qpid.Messaging
-{
- public interface IMessage
- {
- /// <summary>
- /// The MIME Content Type
- /// </summary>
- string ContentType { get; set;}
- /// <summary>
- /// The MIME Content Encoding
- /// </summary>
- string ContentEncoding { get; set; }
- /// <summary>
- /// The application correlation identifier
- /// </summary>
- string CorrelationId { get; set; }
- /// <summary>
- /// The application correlation identifier, as an array of bytes
- /// </summary>
- byte[] CorrelationIdAsBytes { get; set; }
- /// <summary>
- /// Non-persistent (1) or persistent (2)
- /// </summary>
- DeliveryMode DeliveryMode { get; set; }
- /// <summary>
- /// Message expiration specification
- /// </summary>
- long Expiration { get; set; }
- /// <summary>
- /// The application message identifier
- /// </summary>
- string MessageId { get; set; }
- /// <summary>
- /// The message priority, 0 to 9
- /// </summary>
- byte Priority { get; set; }
- /// <summary>
- /// True if the message has been redelivered
- /// </summary>
- bool Redelivered { get; set; }
- /// <summary>
- /// Exchange name of the reply-to address
- /// </summary>
- string ReplyToExchangeName { get; set; }
- /// <summary>
- /// Routing key of the reply-to address
- /// </summary>
- string ReplyToRoutingKey { get; set; }
- /// <summary>
- /// The message timestamp
- /// </summary>
- long Timestamp { get; set; }
- /// <summary>
- /// The message type name
- /// </summary>
- string Type { get; set; }
- /// <summary>
- /// Message headers
- /// </summary>
- IHeaders Headers { get; }
- /// <summary>
- /// The creating user id
- /// </summary>
- string UserId { get; set; }
- /// <summary>
- /// The creating application id
- /// </summary>
- string AppId { get; set; }
- /// <summary>
- /// Intra-cluster routing identifier
- /// </summary>
- string ClusterId { get; set; }
-
- void Acknowledge();
- void ClearBody();
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/IMessageConsumer.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/IMessageConsumer.cs
deleted file mode 100644
index 86b5405707..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/IMessageConsumer.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.
- *
- */
-using System;
-
-namespace Apache.Qpid.Messaging
-{
- /// <summary>
- /// Describes an object that can be used to receive (consume)
- /// messages from an AMQP queue.
- /// </summary>
- /// <remarks>
- /// Consumers are created using either
- /// <see cref="IChannel.CreateConsumer"/> or using
- /// the builder pattern (preferred) with
- /// <see cref="IChannel.CreateConsumerBuilder"/>.
- ///
- /// <para>
- /// Consumers offer two different ways of receiving messages:
- /// You can attach a delegate to the <see cref="OnMessage"/>
- /// event and be notified when a message arrives, or you can
- /// use the <see cref="Receive"/> and <see cref="ReceiveNoWait"/>
- /// methods to control when you receive messages. Be aware that you can use
- /// one or the other, but not both at the same time.
- /// </para>
- /// <para>
- /// Regardless of which method you choose, the prefetch settings
- /// specified when creating the channel will still control when messages
- /// are actually received from the AMQP broker. Any messages that arrive
- /// between the prefetch window will be queued by the channel
- /// until they can be delivered to the consumer (either though the event
- /// or until the consumer actively calls <see cref="Receive"/>).
- /// </para>
- /// </remarks>
- public interface IMessageConsumer : IDisposable, ICloseable
- {
- /// <summary>
- /// Fired when a message is received from the broker by the consumer
- /// </summary>
- MessageReceivedDelegate OnMessage { get; set; }
-
- /// <summary>
- /// Wait infinitely for a message to be received from the broker
- /// </summary>
- /// <returns>The message received</returns>
- IMessage Receive();
-
- /// <summary>
- /// Wait the specified time until a message is receive from the broker
- /// </summary>
- /// <param name="delay">Maximum number of milliseconds to wait for a message</param>
- /// <returns>The message received, or null if the timeout expires</returns>
- IMessage Receive(long delay);
-
- /// <summary>
- /// Return a message if one is already available in the channel.
- /// Does not wait for one to be received from the broker.
- /// </summary>
- /// <returns>The message, if it was available, otherwise null</returns>
- IMessage ReceiveNoWait();
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/IMessagePublisher.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/IMessagePublisher.cs
deleted file mode 100644
index d895a9749b..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/IMessagePublisher.cs
+++ /dev/null
@@ -1,92 +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;
-
-namespace Apache.Qpid.Messaging
-{
- /// <summary>
- /// Defines an object capable of publishing messages
- /// to an AMQP broker.
- /// </summary>
- /// <remarks>
- /// A publisher can be created using either
- /// <see cref="IChannel.CreatePublisher"/> or
- /// using the builder pattern (preferred) with
- /// <see cref="IChannel.CreatePublisherBuilder"/>
- /// </remarks>
- public interface IMessagePublisher : IDisposable, ICloseable
- {
- /// <summary>
- /// Default delivery mode to use with this publisher
- /// </summary>
- DeliveryMode DeliveryMode { get; set; }
- /// <summary>
- /// Name of exchange messages are published to
- /// </summary>
- string ExchangeName { get; }
- /// <summary>
- /// Routing key used when publishing messages
- /// </summary>
- string RoutingKey { get; }
- /// <summary>
- /// If true, a message ID will not be generated by the publisher
- /// when sending the message
- /// </summary>
- bool DisableMessageID { get; set; }
- /// <summary>
- /// If true, no timestamp will be added to the message
- /// when publishing it
- /// </summary>
- bool DisableMessageTimestamp { get; set; }
- /// <summary>
- /// Default priority used when publishing messages
- /// </summary>
- int Priority { get; set; }
- /// <summary>
- /// Default time to live used when publishing messages
- /// </summary>
- long TimeToLive { get; set; }
- /// <summary>
- /// Set the default MIME type for messages produced by this producer.
- /// This reduces the overhead of each message.
- /// </summary>
- string MimeType { get; set; }
- /// <summary>
- /// Set the default encoding for messages produced by this producer.
- /// This reduces the overhead of each message.
- /// </summary>
- string Encoding { get; set; }
-
- /// <summary>
- /// Publish a message, using any default values configured
- /// </summary>
- /// <param name="msg">Message to publish</param>
- void Send(IMessage msg);
- /// <summary>
- /// Publish a message with the specified options
- /// </summary>
- /// <param name="msg">Message to publish</param>
- /// <param name="deliveryMode">Delivery mode to use</param>
- /// <param name="priority">Priority of the message</param>
- /// <param name="timeToLive">Time to live of the message</param>
- void Send(IMessage msg, DeliveryMode deliveryMode, int priority, long timeToLive);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/ITextMessage.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/ITextMessage.cs
deleted file mode 100644
index 902beb70f8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/ITextMessage.cs
+++ /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.
- *
- */
-namespace Apache.Qpid.Messaging
-{
- public interface ITextMessage : IMessage
- {
- string Text { get; set; }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs
deleted file mode 100644
index fbf94d7c27..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs
+++ /dev/null
@@ -1,105 +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.Messaging
-{
- /// <summary>
- /// MessageConsumerBuilder provides a builder with a fluent interface to assist with creating message consumers on a channel.
- ///
- /// <p/><table id="crc"><caption>CRC Card</caption>
- /// <tr><th> Responsibilities <th> Collaborations
- /// <tr><td> Create message consumers from consume parameters. <td> <see cref="IChannel">
- /// </table>
- /// </summary>
- ///
- /// <remarks>It may be better to replace the Create method with a DeclareBindAndCreate method, that declares and binds the consumers queue,
- /// as well as creating the consumer. This is a common use case, so the method will generally be usefull. Need to consider situations where
- /// the declare and bind is not to be done, for example when resubscribing to a durable subscription. There may be others too.</remarks>
- public class MessageConsumerBuilder
- {
- private bool _noLocal = false;
-
- private bool _exclusive = false;
-
- //private bool _durable = false;
- //private string _subscriptionName = null;
-
- private IChannel _channel;
-
- private readonly string _queueName;
-
- private int _prefetchLow;
-
- private int _prefetchHigh;
-
- public MessageConsumerBuilder(IChannel channel, string queueName)
- {
- _channel = channel;
- _queueName = queueName;
- _prefetchHigh = _channel.DefaultPrefetchHigh;
- _prefetchLow = _channel.DefaultPrefetchLow;
- }
-
- public MessageConsumerBuilder WithPrefetchLow(int prefetchLow)
- {
- _prefetchLow = prefetchLow;
- return this;
- }
-
- public MessageConsumerBuilder WithPrefetchHigh(int prefetchHigh)
- {
- _prefetchHigh = prefetchHigh;
- return this;
- }
-
- public MessageConsumerBuilder WithNoLocal(bool noLocal)
- {
- _noLocal = noLocal;
- return this;
- }
-
- public MessageConsumerBuilder WithExclusive(bool exclusive)
- {
- _exclusive = exclusive;
- return this;
- }
-
- /*
- public MessageConsumerBuilder WithDurable(bool durable)
- {
- _durable = durable;
- return this;
- }
- */
-
- /*
- public MessageConsumerBuilder WithSubscriptionName(string subscriptionName)
- {
- _subscriptionName = subscriptionName;
- return this;
- }
- */
-
- public IMessageConsumer Create()
- {
- return _channel.CreateConsumer(_queueName, _prefetchLow, _prefetchHigh, _noLocal, _exclusive);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/MessageNotReadableException.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/MessageNotReadableException.cs
deleted file mode 100644
index 2afcffd531..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/MessageNotReadableException.cs
+++ /dev/null
@@ -1,39 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Messaging
-{
- [Serializable]
- public class MessageNotReadableException : QpidException
- {
- public MessageNotReadableException(string reason) : base(reason)
- {
- }
-
- protected MessageNotReadableException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/MessageNotWritableException.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/MessageNotWritableException.cs
deleted file mode 100644
index 9b00f01948..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/MessageNotWritableException.cs
+++ /dev/null
@@ -1,38 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Messaging
-{
- [Serializable]
- public class MessageNotWriteableException : QpidException
- {
- public MessageNotWriteableException(string reason) : base(reason)
- {
- }
-
- protected MessageNotWriteableException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/MessagePublisherBuilder.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/MessagePublisherBuilder.cs
deleted file mode 100644
index 79c7575d0a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/MessagePublisherBuilder.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.Messaging
-{
- public class MessagePublisherBuilder
- {
- /// <summary>
- /// Default value for immediate flag is false, i.e. a consumer does not need to be attached to a queue
- /// </summary>
- const bool DEFAULT_IMMEDIATE = false;
-
- /// <summary>
- /// Default value for mandatory flag is true, i.e. server will not silently drop messages where no queue is
- /// connected to the exchange for the message
- /// </summary>
- const bool DEFAULT_MANDATORY = true;
-
- IChannel _channel;
- string _exchangeName = null;
- string _routingKey = null;
- DeliveryMode _deliveryMode = DeliveryMode.Persistent;
- long _timeToLive;
- bool _immediate = DEFAULT_IMMEDIATE;
- bool _mandatory = DEFAULT_MANDATORY;
- int _priority = 0;
-
- public MessagePublisherBuilder(IChannel channel)
- {
- _channel = channel;
- }
-
- public MessagePublisherBuilder WithRoutingKey(string routingKey)
- {
- _routingKey = routingKey;
- return this;
- }
-
- public MessagePublisherBuilder WithExchangeName(string exchangeName)
- {
- _exchangeName = exchangeName;
- return this;
- }
-
- public MessagePublisherBuilder WithDeliveryMode(DeliveryMode deliveryMode)
- {
- _deliveryMode = deliveryMode;
- return this;
- }
-
- public MessagePublisherBuilder WithTimeToLive(long timeToLive)
- {
- _timeToLive = timeToLive;
- return this;
- }
-
- public MessagePublisherBuilder WithImmediate(bool immediate)
- {
- _immediate = immediate;
- return this;
- }
-
- public MessagePublisherBuilder WithMandatory(bool mandatory)
- {
- _mandatory = mandatory;
- return this;
- }
-
- public IMessagePublisher Create()
- {
- return _channel.CreatePublisher(_exchangeName, _routingKey, _deliveryMode, _timeToLive, _immediate, _mandatory, _priority);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/Properties/AssemblyInfo.cs
deleted file mode 100644
index ab14b1faf0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-using System;
-using System.Reflection;
-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.Messaging")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.Messaging")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("e74f1805-b355-42e0-ba70-afc7c8570f03")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-
-[assembly: CLSCompliant(true)]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/Qpid.Messaging.csproj b/M4-RCs/qpid/dotnet/Qpid.Messaging/Qpid.Messaging.csproj
deleted file mode 100644
index 37b80d1515..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/Qpid.Messaging.csproj
+++ /dev/null
@@ -1,115 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Messaging</RootNamespace>
- <AssemblyName>Apache.Qpid.Messaging</AssemblyName>
- <SignAssembly>true</SignAssembly>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <PublishUrl>http://localhost/Apache.Qpid.Messaging/</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Web</InstallFrom>
- <UpdateEnabled>true</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>true</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\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\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
- <Install>true</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>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/Qpid.Messaging/QpidException.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/QpidException.cs
deleted file mode 100644
index 3e39f2293d..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/QpidException.cs
+++ /dev/null
@@ -1,43 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Messaging
-{
- [Serializable]
- public class QpidException : Exception
- {
- public QpidException(string reason) : base(reason)
- {
- }
-
- public QpidException(string reason, Exception e)
- : base(reason, e)
- {
- }
-
- protected QpidException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/ResourceAllocationException.cs b/M4-RCs/qpid/dotnet/Qpid.Messaging/ResourceAllocationException.cs
deleted file mode 100644
index 954dcdd94c..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/ResourceAllocationException.cs
+++ /dev/null
@@ -1,39 +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;
-using System.Runtime.Serialization;
-
-namespace Apache.Qpid.Messaging
-{
- [Serializable]
- public class ResourceAllocationException : QpidException
- {
- public ResourceAllocationException(string reason) : base(reason)
- {
- }
-
- protected ResourceAllocationException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/Qpid.Messaging/default.build b/M4-RCs/qpid/dotnet/Qpid.Messaging/default.build
deleted file mode 100644
index e351def886..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Messaging/default.build
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Apache.Qpid.Messaging" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.NET.FxCop b/M4-RCs/qpid/dotnet/Qpid.NET.FxCop
deleted file mode 100644
index cfc5445e40..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.NET.FxCop
+++ /dev/null
@@ -1,16755 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<FxCopProject Version="1.35" Name="My FxCop Project">
- <ProjectOptions>
- <SharedProject>True</SharedProject>
- <Stylesheet Apply="False">http://www.gotdotnet.com/team/fxcop//xsl/1.35/FxCopReport.xsl</Stylesheet>
- <SaveMessages>
- <Project Status="Active, Excluded" NewOnly="False" />
- <Report Status="Active" NewOnly="False" />
- </SaveMessages>
- <ProjectFile Compress="True" DefaultTargetCheck="True" DefaultRuleCheck="True" SaveByRuleGroup="" Deterministic="True" />
- <EnableMultithreadedLoad>True</EnableMultithreadedLoad>
- <EnableMultithreadedAnalysis>True</EnableMultithreadedAnalysis>
- <SourceLookup>True</SourceLookup>
- <AnalysisExceptionsThreshold>10</AnalysisExceptionsThreshold>
- <RuleExceptionsThreshold>1</RuleExceptionsThreshold>
- <Spelling Locale="en-us" />
- <VersionAware>False</VersionAware>
- <OverrideRuleVisibilities>False</OverrideRuleVisibilities>
- <CustomDictionaries SearchFxCopDir="True" SearchUserProfile="True" SearchProjectDir="True" />
- <SearchGlobalAssemblyCache>False</SearchGlobalAssemblyCache>
- <DeadlockDetectionTimeout>120</DeadlockDetectionTimeout>
- </ProjectOptions>
- <Targets>
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Buffer.dll" Analyze="True" AnalyzeAllChildren="True" />
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Client.dll" Analyze="True" AnalyzeAllChildren="True" />
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Client.Tests.dll" Analyze="True" AnalyzeAllChildren="True" />
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Client.Transport.Socket.Blocking.dll" Analyze="True" AnalyzeAllChildren="True" />
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Codec.dll" Analyze="True" AnalyzeAllChildren="True" />
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Common.dll" Analyze="True" AnalyzeAllChildren="True" />
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Messaging.dll" Analyze="True" AnalyzeAllChildren="True" />
- </Targets>
- <Rules>
- <RuleFiles>
- <RuleFile Name="$(FxCopDir)\Rules\DesignRules.dll" Enabled="True" AllRulesEnabled="True" />
- <RuleFile Name="$(FxCopDir)\Rules\GlobalizationRules.dll" Enabled="True" AllRulesEnabled="True" />
- <RuleFile Name="$(FxCopDir)\Rules\InteroperabilityRules.dll" Enabled="True" AllRulesEnabled="True" />
- <RuleFile Name="$(FxCopDir)\Rules\MobilityRules.dll" Enabled="True" AllRulesEnabled="True" />
- <RuleFile Name="$(FxCopDir)\Rules\NamingRules.dll" Enabled="True" AllRulesEnabled="True" />
- <RuleFile Name="$(FxCopDir)\Rules\PerformanceRules.dll" Enabled="True" AllRulesEnabled="True" />
- <RuleFile Name="$(FxCopDir)\Rules\PortabilityRules.dll" Enabled="True" AllRulesEnabled="True" />
- <RuleFile Name="$(FxCopDir)\Rules\SecurityRules.dll" Enabled="True" AllRulesEnabled="True" />
- <RuleFile Name="$(FxCopDir)\Rules\UsageRules.dll" Enabled="True" AllRulesEnabled="True" />
- </RuleFiles>
- <Groups />
- <Settings />
- </Rules>
- <FxCopReport Version="1.35">
- <Namespaces>
- <Namespace Name="Qpid">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Buffer">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Buffer</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.Failover">
- <Messages>
- <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.Failover</Item>
- </Issue>
- </Message>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Failover</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.Handler">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Handler</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.Message">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Message</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.Protocol">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Protocol</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.Protocol.Listener">
- <Messages>
- <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.Protocol.Listener</Item>
- </Issue>
- </Message>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Protocol.Listener</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.qms">
- <Messages>
- <Message TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid.Client.qms</Item>
- </Issue>
- </Message>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.qms</Item>
- </Issue>
- </Message>
- <Message Id="qms" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>qms</Item>
- <Item>Qpid.Client.qms</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.qms.failover">
- <Messages>
- <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.qms.failover</Item>
- </Issue>
- </Message>
- <Message TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid.Client.qms.failover</Item>
- </Issue>
- <Issue Name="Namespace">
- <Item>Qpid.Client.qms.failover</Item>
- </Issue>
- </Message>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.qms.failover</Item>
- </Issue>
- </Message>
- <Message Id="qms" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>qms</Item>
- <Item>Qpid.Client.qms.failover</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.State">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.State</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.Tests">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Tests</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.Tests.connection">
- <Messages>
- <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.Tests.connection</Item>
- </Issue>
- </Message>
- <Message TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid.Client.Tests.connection</Item>
- </Issue>
- </Message>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Tests.connection</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.Tests.failover">
- <Messages>
- <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.Tests.failover</Item>
- </Issue>
- </Message>
- <Message TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid.Client.Tests.failover</Item>
- </Issue>
- </Message>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Tests.failover</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.Tests.url">
- <Messages>
- <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.Tests.url</Item>
- </Issue>
- </Message>
- <Message TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid.Client.Tests.url</Item>
- </Issue>
- </Message>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Tests.url</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.Transport">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Transport</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Client.Transport.Socket.Blocking">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Transport.Socket.Blocking</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Codec">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Codec</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Codec.Demux">
- <Messages>
- <Message Id="Demux" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Demux</Item>
- <Item>Qpid.Codec.Demux</Item>
- </Issue>
- </Message>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Codec.Demux</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Codec.Support">
- <Messages>
- <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Codec.Support</Item>
- </Issue>
- </Message>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Codec.Support</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Collections">
- <Messages>
- <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Collections</Item>
- </Issue>
- </Message>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Collections</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Common">
- <Messages>
- <Message TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Common</Item>
- </Issue>
- </Message>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Common</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Framing">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Framing</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- <Namespace Name="Qpid.Messaging">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Namespace">
- <Item>Qpid</Item>
- <Item>Qpid.Messaging</Item>
- </Issue>
- </Message>
- </Messages>
- </Namespace>
- </Namespaces>
- <Targets>
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Buffer.dll">
- <Modules>
- <Module Name="qpid.buffer.dll">
- <Messages>
- <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Buffer</Item>
- </Issue>
- </Message>
- <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoStrongName">
- <Item>Qpid.Buffer</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoAttr">
- <Item>Qpid.Buffer</Item>
- </Issue>
- </Message>
- </Messages>
- <Namespaces>
- <Namespace Name="Qpid.Buffer">
- <Types>
- <Type Name="BufferOverflowException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Buffer.BufferOverflowException</Item>
- <Item>protected BufferOverflowException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Buffer.BufferOverflowException</Item>
- <Item>public BufferOverflowException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Buffer.BufferOverflowException</Item>
- <Item>public BufferOverflowException(String, Exception)</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkISerializableTypesWithSerializable" Category="Microsoft.Usage" CheckId="CA2237" Created="2006-12-04 13:11:47Z">
- <Issue Level="Error">
- <Item>BufferOverflowException</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="BufferUnderflowException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Buffer.BufferUnderflowException</Item>
- <Item>protected BufferUnderflowException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Buffer.BufferUnderflowException</Item>
- <Item>public BufferUnderflowException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Buffer.BufferUnderflowException</Item>
- <Item>public BufferUnderflowException(String, Exception)</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkISerializableTypesWithSerializable" Category="Microsoft.Usage" CheckId="CA2237" Created="2006-12-04 13:11:47Z">
- <Issue Level="Error">
- <Item>BufferUnderflowException</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="ByteBuffer">
- <Members>
- <Member Name="_containerStack">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_containerStack</Item>
- </Issue>
- </Message>
- <Message TypeName="NonConstantFieldsShouldNotBeVisible" Category="Microsoft.Usage" CheckId="CA2211" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_containerStack</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_heapBufferStacks">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_heapBufferStacks</Item>
- </Issue>
- </Message>
- <Message TypeName="NonConstantFieldsShouldNotBeVisible" Category="Microsoft.Usage" CheckId="CA2211" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_heapBufferStacks</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Allocate0(System.Int32,System.Boolean):Qpid.Buffer.ByteBuffer">
- <Messages>
- <Message Id="System.NotSupportedException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ByteBuffer.Allocate0(Int32, Boolean):ByteBuffer</Item>
- <Item>1</Item>
- <Item>NotSupportedException.NotSupportedException(String)</Item>
- <Item>Direct buffers not currently implemented</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Equals(System.Object):System.Boolean">
- <Messages>
- <Message TypeName="DoNotCastUnnecessarily" Category="Microsoft.Performance" CheckId="CA1800" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>obj</Item>
- <Item>Qpid.Buffer.ByteBuffer</Item>
- <Item>ByteBuffer.Equals(Object):Boolean</Item>
- <Item>castclass</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetBufferStackIndex(System.Collections.Stack[],System.Int32):System.Int32">
- <Messages>
- <Message Id="System.ArgumentOutOfRangeException.#ctor(System.String,System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ByteBuffer.GetBufferStackIndex(Stack[], Int32):Int32</Item>
- <Item>2</Item>
- <Item>ArgumentOutOfRangeException.ArgumentOutOfRangeException(String, String)</Item>
- <Item>Buffer size is too big: __</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetUnsignedInt():System.UInt32">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetUnsignedInt</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetUnsignedLong():System.UInt64">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetUnsignedLong</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetUnsignedShort():System.UInt16">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetUnsignedShort</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MINIMUM_CAPACITY">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>MINIMUM_CAPACITY</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ByteBuffer.MINIMUM_CAPACITY</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Put(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message Id="0#buf" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ByteBuffer.Put(ByteBuffer):Void</Item>
- <Item>buf</Item>
- <Item>buf</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Release0(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message Id="0#buf" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ByteBuffer.Release0(ByteBuffer):Void</Item>
- <Item>buf</Item>
- <Item>buf</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buf'</Item>
- <Item>ByteBuffer.Release0(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ByteBufferHexDumper">
- <Messages>
- <Message TypeName="StaticHolderTypesShouldNotHaveConstructors" Category="Microsoft.Design" CheckId="CA1053" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ByteBufferHexDumper</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".cctor()">
- <Messages>
- <Message TypeName="InitializeReferenceTypeStaticFieldsInline" Category="Microsoft.Performance" CheckId="CA1810" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Buffer.ByteBufferHexDumper</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetHexDump(Qpid.Buffer.ByteBuffer):System.String">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'input'</Item>
- <Item>ByteBufferHexDumper.GetHexDump(ByteBuffer):String</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ByteBufferProxy">
- <Members>
- <Member Name=".ctor(Qpid.Buffer.ByteBuffer)">
- <Messages>
- <Message Id="0#buf" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ByteBufferProxy.ByteBufferProxy(ByteBuffer)</Item>
- <Item>buf</Item>
- <Item>buf</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_buf">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_buf</Item>
- </Issue>
- </Message>
- <Message Id="_buf" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_buf</Item>
- <Item>ByteBufferProxy._buf</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_buf</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="HeapByteBuffer">
- <Members>
- <Member Name="CheckSpace(System.Int32):System.Void">
- <Messages>
- <Message Id="Qpid.Buffer.BufferOverflowException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>HeapByteBuffer.CheckSpace(Int32):Void</Item>
- <Item>1</Item>
- <Item>BufferOverflowException.BufferOverflowException(String)</Item>
- <Item>Attempt to write ____ byte(s) to buffer where position is ____ and limit is __</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CheckSpaceForReading(System.Int32):System.Void">
- <Messages>
- <Message Id="Qpid.Buffer.BufferUnderflowException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>HeapByteBuffer.CheckSpaceForReading(Int32):Void</Item>
- <Item>1</Item>
- <Item>BufferUnderflowException.BufferUnderflowException(String)</Item>
- <Item>Attempt to read ____ byte(s) to buffer where position is ____ and limit is __</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetString(System.UInt32,System.Text.Encoding):System.String">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'encoder'</Item>
- <Item>HeapByteBuffer.GetString(UInt32, Encoding):String</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Limit">
- <Accessors>
- <Accessor Name="set_Limit(System.Int32):System.Void">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>HeapByteBuffer.set_Limit(Int32):Void</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>Limit must not be greater than Capacity</Item>
- </Issue>
- <Issue>
- <Item>HeapByteBuffer.set_Limit(Int32):Void</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>Limit must not be negative</Item>
- </Issue>
- </Message>
- </Messages>
- </Accessor>
- </Accessors>
- </Member>
- <Member Name="Mark():System.Void">
- <Messages>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>HeapByteBuffer.Mark():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Put(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message TypeName="DoNotCastUnnecessarily" Category="Microsoft.Performance" CheckId="CA1800" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>src</Item>
- <Item>Qpid.Buffer.HeapByteBuffer</Item>
- <Item>HeapByteBuffer.Put(ByteBuffer):Void</Item>
- <Item>castclass</Item>
- </Issue>
- </Message>
- <Message Id="Qpid.Buffer.BufferOverflowException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>HeapByteBuffer.Put(ByteBuffer):Void</Item>
- <Item>1</Item>
- <Item>BufferOverflowException.BufferOverflowException(String)</Item>
- <Item>Not enought capacity in this buffer for ____ elements - only ____ remaining</Item>
- </Issue>
- </Message>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>HeapByteBuffer.Put(ByteBuffer):Void</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>Cannot copy self into self!</Item>
- </Issue>
- </Message>
- <Message Id="enought" TypeName="LiteralsShouldBeSpelledCorrectly" Category="Microsoft.Usage" CheckId="CA2204" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>enought</Item>
- <Item>Not enought capacity in this buffer for ____ elements - only ____ remaining</Item>
- </Issue>
- </Message>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>src</Item>
- <Item>HeapByteBuffer.Put(ByteBuffer):Void</Item>
- <Item>buf</Item>
- <Item>ByteBuffer.Put(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'src'</Item>
- <Item>HeapByteBuffer.Put(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Put(System.Byte[]):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'data'</Item>
- <Item>HeapByteBuffer.Put(Byte[]):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Reset():System.Void">
- <Messages>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>HeapByteBuffer.Reset():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="wrap(System.Byte[]):Qpid.Buffer.HeapByteBuffer">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>wrap</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'bytes'</Item>
- <Item>HeapByteBuffer.wrap(Byte[]):HeapByteBuffer</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="wrap(System.Byte[],System.Int32):Qpid.Buffer.HeapByteBuffer">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>wrap</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="RefCountingByteBuffer">
- <Members>
- <Member Name="Acquire():System.Void">
- <Messages>
- <Message Id="System.Exception.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RefCountingByteBuffer.Acquire():Void</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String)</Item>
- <Item>Already released buffer</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>RefCountingByteBuffer.Acquire():Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Buf">
- <Messages>
- <Message Id="Buf" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Buf</Item>
- <Item>RefCountingByteBuffer.Buf:ByteBuffer</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Init(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message Id="0#buf" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>RefCountingByteBuffer.Init(ByteBuffer):Void</Item>
- <Item>buf</Item>
- <Item>buf</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buf'</Item>
- <Item>RefCountingByteBuffer.Init(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Put(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buf'</Item>
- <Item>RefCountingByteBuffer.Put(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Put(System.Byte[]):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'data'</Item>
- <Item>RefCountingByteBuffer.Put(Byte[]):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Release():System.Void">
- <Messages>
- <Message Id="System.Exception.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RefCountingByteBuffer.Release():Void</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String)</Item>
- <Item>Already released buffer. Release called too many times</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>RefCountingByteBuffer.Release():Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- </Namespaces>
- </Module>
- </Modules>
- </Target>
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Client.dll">
- <Modules>
- <Module Name="qpid.client.dll">
- <Messages>
- <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client</Item>
- </Issue>
- </Message>
- <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoStrongName">
- <Item>Qpid.Client</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoAttr">
- <Item>Qpid.Client</Item>
- </Issue>
- </Message>
- </Messages>
- <Namespaces>
- <Namespace Name="Qpid.Client">
- <Types>
- <Type Name="AmqBrokerInfo">
- <Messages>
- <Message Id="Amq" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Amq</Item>
- <Item>Qpid.Client.AmqBrokerInfo</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(System.String)">
- <Messages>
- <Message Id="url" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>url</Item>
- <Item>AmqBrokerInfo.AmqBrokerInfo(String)</Item>
- </Issue>
- </Message>
- <Message Id="0#" TypeName="UriParametersShouldNotBeStrings" Category="Microsoft.Design" CheckId="CA1054" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>url</Item>
- <Item>AmqBrokerInfo.AmqBrokerInfo(String)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DEFAULT_CONNECT_TIMEOUT">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DEFAULT_CONNECT_TIMEOUT</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AmqBrokerInfo.DEFAULT_CONNECT_TIMEOUT</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Equals(System.Object):System.Boolean">
- <Messages>
- <Message TypeName="DoNotCastUnnecessarily" Category="Microsoft.Performance" CheckId="CA1800" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>obj</Item>
- <Item>Qpid.Client.qms.BrokerInfo</Item>
- <Item>AmqBrokerInfo.Equals(Object):Boolean</Item>
- <Item>castclass</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetHashCode():System.Int32">
- <Messages>
- <Message Id="System.String.ToLower" TypeName="SpecifyCultureInfo" Category="Microsoft.Globalization" CheckId="CA1304" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqBrokerInfo.GetHashCode():Int32</Item>
- <Item>System.String.ToLower</Item>
- <Item>System.String.ToLower(System.Globalization.CultureInfo)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="getTimeout():System.Int64">
- <Messages>
- <Message Id="System.Int64.Parse(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqBrokerInfo.getTimeout():Int64</Item>
- <Item>System.Int64.Parse(System.String)</Item>
- <Item>System.Int64.Parse(System.String,System.IFormatProvider)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setHost(System.String):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_host</Item>
- <Item>AmqBrokerInfo.setHost(String):Void</Item>
- <Item>host</Item>
- <Item>BrokerInfo.setHost(String):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setPort(System.Int32):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_port</Item>
- <Item>AmqBrokerInfo.setPort(Int32):Void</Item>
- <Item>port</Item>
- <Item>BrokerInfo.setPort(Int32):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setTimeout(System.Int64):System.Void">
- <Messages>
- <Message Id="System.Int64.ToString" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqBrokerInfo.setTimeout(Int64):Void</Item>
- <Item>System.Int64.ToString</Item>
- <Item>System.Int64.ToString(System.IFormatProvider)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setTransport(System.String):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_transport</Item>
- <Item>AmqBrokerInfo.setTransport(String):Void</Item>
- <Item>transport</Item>
- <Item>BrokerInfo.setTransport(String):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="StringEqualsIgnoreCase(System.String,System.String):System.Boolean">
- <Messages>
- <Message Id="one" TypeName="AvoidUnnecessaryStringCreation" Category="Microsoft.Performance" CheckId="CA1807" Created="2006-12-04 13:11:47Z">
- <Issue Name="UseStringCompareParameter">
- <Item>AmqBrokerInfo.StringEqualsIgnoreCase(String, String):Boolean</Item>
- <Item>String.Equals(String):Boolean</Item>
- <Item>one</Item>
- </Issue>
- </Message>
- <Message Id="two" TypeName="AvoidUnnecessaryStringCreation" Category="Microsoft.Performance" CheckId="CA1807" Created="2006-12-04 13:11:47Z">
- <Issue Name="UseStringCompareParameter">
- <Item>AmqBrokerInfo.StringEqualsIgnoreCase(String, String):Boolean</Item>
- <Item>String.Equals(String):Boolean</Item>
- <Item>two</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="NonBreaking">
- <Issue>
- <Item>AmqBrokerInfo.StringEqualsIgnoreCase(String, String):Boolean</Item>
- </Issue>
- </Message>
- <Message Id="System.String.ToLower" TypeName="SpecifyCultureInfo" Category="Microsoft.Globalization" CheckId="CA1304" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqBrokerInfo.StringEqualsIgnoreCase(String, String):Boolean</Item>
- <Item>System.String.ToLower</Item>
- <Item>System.String.ToLower(System.Globalization.CultureInfo)</Item>
- </Issue>
- <Issue>
- <Item>AmqBrokerInfo.StringEqualsIgnoreCase(String, String):Boolean</Item>
- <Item>System.String.ToLower</Item>
- <Item>System.String.ToLower(System.Globalization.CultureInfo)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ToString():System.String">
- <Messages>
- <Message Id="this._transport" TypeName="AvoidUnnecessaryStringCreation" Category="Microsoft.Performance" CheckId="CA1807" Created="2006-12-04 13:11:47Z">
- <Issue Name="UseStringCompareLocal">
- <Item>AmqBrokerInfo.ToString():String</Item>
- <Item>String.Equals(String):Boolean</Item>
- <Item>this._transport</Item>
- </Issue>
- </Message>
- <Message Id="System.String.ToLower" TypeName="SpecifyCultureInfo" Category="Microsoft.Globalization" CheckId="CA1304" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqBrokerInfo.ToString():String</Item>
- <Item>System.String.ToLower</Item>
- <Item>System.String.ToLower(System.Globalization.CultureInfo)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="URL_FORMAT_EXAMPLE">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>URL_FORMAT_EXAMPLE</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>URL_FORMAT_EXAMPLE</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AmqChannel">
- <Messages>
- <Message Id="Amq" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Amq</Item>
- <Item>Qpid.Client.AmqChannel</Item>
- </Issue>
- </Message>
- <Message TypeName="ImplementIDisposableCorrectly" Category="Microsoft.Design" CheckId="CA1063" Created="2006-12-04 13:11:47Z">
- <Issue Name="ProvideDisposeBool">
- <Item>Qpid.Client.AmqChannel</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".cctor()">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.AmqChannel()</Item>
- <Item>_nextSessionNumber</Item>
- <Item>System.Int32</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name=".ctor(Qpid.Client.AMQConnection,System.UInt16,System.Boolean,Qpid.Messaging.AcknowledgeMode,Qpid.Client.Message.MessageFactoryRegistry,System.Int32)">
- <Messages>
- <Message Id="defaultPrefetch" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2006-12-04 13:11:47Z" FixCategory="NonBreaking">
- <Issue>
- <Item>defaultPrefetch</Item>
- <Item>AmqChannel.AmqChannel(AMQConnection, UInt16, Boolean, AcknowledgeMode, MessageFactoryRegistry, Int32)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CheckNotTransacted():System.Void">
- <Messages>
- <Message Id="System.InvalidOperationException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.CheckNotTransacted():Void</Item>
- <Item>1</Item>
- <Item>InvalidOperationException.InvalidOperationException(String)</Item>
- <Item>Channel is transacted</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CheckTransacted():System.Void">
- <Messages>
- <Message Id="System.InvalidOperationException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.CheckTransacted():Void</Item>
- <Item>1</Item>
- <Item>InvalidOperationException.InvalidOperationException(String)</Item>
- <Item>Channel is not transacted</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ClosedWithException(System.Exception):System.Void">
- <Messages>
- <Message TypeName="DoNotCastUnnecessarily" Category="Microsoft.Performance" CheckId="CA1800" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>e</Item>
- <Item>Qpid.AMQException</Item>
- <Item>AmqChannel.ClosedWithException(Exception):Void</Item>
- <Item>castclass</Item>
- </Issue>
- </Message>
- <Message Id="Qpid.AMQException.#ctor(System.String,System.Exception)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.ClosedWithException(Exception):Void</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String, Exception)</Item>
- <Item>Closing session forcibly</Item>
- </Issue>
- </Message>
- <Message Id="0#e" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>AmqChannel.ClosedWithException(Exception):Void</Item>
- <Item>e</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumeFromQueue(System.String,System.Boolean,System.Boolean,Qpid.Messaging.AcknowledgeMode):System.String">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.ConsumeFromQueue(String, Boolean, Boolean, AcknowledgeMode):String</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateConsumer(System.String,System.Int32,System.Int32,System.Boolean,System.Boolean,System.Boolean,System.String):Qpid.Messaging.IMessageConsumer">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object[])" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.CreateConsumer(String, Int32, Int32, Boolean, Boolean, Boolean, String):IMessageConsumer</Item>
- <Item>System.String.Format(System.String,System.Object[])</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreatePublisher(System.String,System.String,Qpid.Messaging.DeliveryMode,System.Int64,System.Boolean,System.Boolean,System.Int32):Qpid.Messaging.IMessagePublisher">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.CreatePublisher(String, String, DeliveryMode, Int64, Boolean, Boolean, Int32):IMessagePublisher</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateTextMessage(System.String):Qpid.Messaging.ITextMessage">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>text</Item>
- <Item>AmqChannel.CreateTextMessage(String):ITextMessage</Item>
- <Item>initialValue</Item>
- <Item>IChannel.CreateTextMessage(String):ITextMessage</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeclareExchange(System.String,System.String):System.Void">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.DeclareExchange(String, String):Void</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeclareExchange(System.UInt16,System.UInt16,System.String,System.String,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,Qpid.Framing.FieldTable):System.Void">
- <Messages>
- <Message Id="System.NotImplementedException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.DeclareExchange(UInt16, UInt16, String, String, Boolean, Boolean, Boolean, Boolean, Boolean, FieldTable):Void</Item>
- <Item>1</Item>
- <Item>NotImplementedException.NotImplementedException(String)</Item>
- <Item>Don't use nowait=false with DeclareExchange</Item>
- </Issue>
- </Message>
- <Message Id="nowait" TypeName="LiteralsShouldBeSpelledCorrectly" Category="Microsoft.Usage" CheckId="CA2204" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>nowait</Item>
- <Item>Don't use nowait=false with DeclareExchange</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.DeclareExchange(UInt16, UInt16, String, String, Boolean, Boolean, Boolean, Boolean, Boolean, FieldTable):Void</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Dispose():System.Void">
- <Messages>
- <Message TypeName="ImplementIDisposableCorrectly" Category="Microsoft.Design" CheckId="CA1063" Created="2006-12-04 13:11:47Z">
- <Issue Name="DisposeImplementation">
- <Item>AmqChannel.Dispose():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DoBasicPublish(System.String,System.String,System.Boolean,System.Boolean,Qpid.Client.Message.AbstractQmsMessage,Qpid.Messaging.DeliveryMode,System.UInt32,System.Int32,System.Boolean):System.Void">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.DoBasicPublish(String, String, Boolean, Boolean, AbstractQmsMessage, DeliveryMode, UInt32, Int32, Boolean):Void</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- <Issue>
- <Item>AmqChannel.DoBasicPublish(String, String, Boolean, Boolean, AbstractQmsMessage, DeliveryMode, UInt32, Int32, Boolean):Void</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DoBind(System.String,System.String,System.String,Qpid.Framing.FieldTable):System.Void">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object[])" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.DoBind(String, String, String, FieldTable):Void</Item>
- <Item>System.String.Format(System.String,System.Object[])</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DoQueueDeclare(System.String,System.Boolean,System.Boolean,System.Boolean):System.Void">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object[])" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.DoQueueDeclare(String, Boolean, Boolean, Boolean):Void</Item>
- <Item>System.String.Format(System.String,System.Object[])</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplayOnFailOver():System.Void">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqChannel.ReplayOnFailOver():Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- <Issue>
- <Item>AmqChannel.ReplayOnFailOver():Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Run():System.Void">
- <Messages>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>AmqChannel.Run():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Unsubscribe(System.String):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>name</Item>
- <Item>AmqChannel.Unsubscribe(String):Void</Item>
- <Item>subscriptionName</Item>
- <Item>IChannel.Unsubscribe(String):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AmqChannel+Dispatcher">
- <Members>
- <Member Name=".ctor(Qpid.Client.AmqChannel)">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Dispatcher.Dispatcher(AmqChannel)</Item>
- <Item>_stopped</Item>
- <Item>System.Int32</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DispatchMessage(Qpid.Client.Message.UnprocessedMessage):System.Void">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Dispatcher.DispatchMessage(UnprocessedMessage):Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQConnection">
- <Messages>
- <Message TypeName="ImplementIDisposableCorrectly" Category="Microsoft.Design" CheckId="CA1063" Created="2006-12-04 13:11:47Z">
- <Issue Name="ProvideDisposeBool">
- <Item>Qpid.Client.AMQConnection</Item>
- </Issue>
- </Message>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQConnection</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(Qpid.Client.qms.ConnectionInfo)">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.AMQConnection(ConnectionInfo)</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.AMQConnection(ConnectionInfo)</Item>
- <Item>_connected</Item>
- <Item>System.Boolean</Item>
- <Item>false</Item>
- </Issue>
- <Issue>
- <Item>AMQConnection.AMQConnection(ConnectionInfo)</Item>
- <Item>_lastAMQException</Item>
- <Item>Qpid.AMQException</Item>
- <Item>null</Item>
- </Issue>
- <Issue>
- <Item>AMQConnection.AMQConnection(ConnectionInfo)</Item>
- <Item>_nextChannelId</Item>
- <Item>System.Int32</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- <Message Id="Qpid.Client.AMQConnectionException.#ctor(System.String,System.Exception)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.AMQConnection(ConnectionInfo)</Item>
- <Item>1</Item>
- <Item>AMQConnectionException.AMQConnectionException(String, Exception)</Item>
- <Item>Unable to connect</Item>
- </Issue>
- </Message>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.AMQConnection(ConnectionInfo)</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>ConnectionInfo must be specified</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="AttemptReconnection():System.Boolean">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.AttemptReconnection():Boolean</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="AttemptReconnection(System.String,System.Int32,System.Boolean):System.Boolean">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.AttemptReconnection(String, Int32, Boolean):Boolean</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>useSSL</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CloseSession(Qpid.Client.AmqChannel):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'channel'</Item>
- <Item>AMQConnection.CloseSession(AmqChannel):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Dispose():System.Void">
- <Messages>
- <Message TypeName="ImplementIDisposableCorrectly" Category="Microsoft.Design" CheckId="CA1063" Created="2006-12-04 13:11:47Z">
- <Issue Name="DisposeImplementation">
- <Item>AMQConnection.Dispose():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ExceptionReceived(System.Exception):System.Void">
- <Messages>
- <Message TypeName="DoNotCastUnnecessarily" Category="Microsoft.Performance" CheckId="CA1800" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>cause</Item>
- <Item>Qpid.Messaging.QpidException</Item>
- <Item>AMQConnection.ExceptionReceived(Exception):Void</Item>
- <Item>castclass</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="FireFailoverComplete():System.Void">
- <Messages>
- <Message TypeName="UseEventsWhereAppropriate" Category="Microsoft.Design" CheckId="CA1030" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FireFailoverComplete</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="FirePreFailover(System.Boolean):System.Boolean">
- <Messages>
- <Message TypeName="UseEventsWhereAppropriate" Category="Microsoft.Design" CheckId="CA1030" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FirePreFailover</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="FirePreResubscribe():System.Boolean">
- <Messages>
- <Message Id="Resubscribe" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Resubscribe</Item>
- <Item>AMQConnection.FirePreResubscribe():Boolean</Item>
- </Issue>
- </Message>
- <Message TypeName="UseEventsWhereAppropriate" Category="Microsoft.Design" CheckId="CA1030" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FirePreResubscribe</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="LoadTransportFromAssembly(System.String,System.Int32,System.String,System.String):Qpid.Client.Transport.ITransport">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.LoadTransportFromAssembly(String, Int32, String, String):ITransport</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.LoadTransportFromAssembly(String, Int32, String, String):ITransport</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MakeBrokerConnection(Qpid.Client.qms.BrokerInfo):System.Void">
- <Messages>
- <Message TypeName="RethrowToPreserveStackDetails" Category="Microsoft.Usage" CheckId="CA2200" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.MakeBrokerConnection(BrokerInfo):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReopenChannel(System.UInt16,System.UInt16,System.Boolean):System.Void">
- <Messages>
- <Message Id="Qpid.AMQException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.ReopenChannel(UInt16, UInt16, Boolean):Void</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String)</Item>
- <Item>Error reopening channel ____ after failover: __</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.ReopenChannel(UInt16, UInt16, Boolean):Void</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ResubscribeChannels():System.Void">
- <Messages>
- <Message Id="Resubscribe" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Resubscribe</Item>
- <Item>AMQConnection.ResubscribeChannels():Void</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQConnection.ResubscribeChannels():Void</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="StartHeartBeatThread(System.Int32):System.Void">
- <Messages>
- <Message Id="HeartBeat" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2006-12-04 13:11:47Z">
- <Issue Name="ShouldBeDiscreteTerm">
- <Item>HeartBeat</Item>
- <Item>method</Item>
- <Item>StartHeartBeatThread</Item>
- <Item>Heartbeat</Item>
- </Issue>
- </Message>
- <Message Id="heartbeatSeconds*1000" TypeName="OperationsShouldNotOverflow" Category="Microsoft.Usage" CheckId="CA2233" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>heartbeatSeconds*1000</Item>
- <Item>AMQConnection.StartHeartBeatThread(Int32):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="StopHeartBeatThread():System.Void">
- <Messages>
- <Message Id="HeartBeat" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2006-12-04 13:11:47Z">
- <Issue Name="ShouldBeDiscreteTerm">
- <Item>HeartBeat</Item>
- <Item>method</Item>
- <Item>StopHeartBeatThread</Item>
- <Item>Heartbeat</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="toURL():System.String">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>toURL</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AMQConnection.toURL():String</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Username">
- <Messages>
- <Message Id="Username" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2006-12-04 13:11:47Z">
- <Issue Name="ShouldBeCompoundWord">
- <Item>Username</Item>
- <Item>property</Item>
- <Item>Username</Item>
- <Item>UserName</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQConnectionException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.AMQConnectionException</Item>
- <Item>protected AMQConnectionException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Client.AMQConnectionException</Item>
- <Item>public AMQConnectionException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Client.AMQConnectionException</Item>
- <Item>public AMQConnectionException(String)</Item>
- </Issue>
- </Message>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQConnectionException</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(System.String,System.Exception)">
- <Messages>
- <Message Id="1#e" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>AMQConnectionException.AMQConnectionException(String, Exception)</Item>
- <Item>e</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQDestination">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQDestination</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="_destinationName">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_destinationName</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_destinationName</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_exchangeClass">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_exchangeClass</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_exchangeClass</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_exchangeName">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_exchangeName</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_exchangeName</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_isAutoDelete">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_isAutoDelete</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_isAutoDelete</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_isDurable">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_isDurable</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_isDurable</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_isExclusive">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_isExclusive</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_isExclusive</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_queueName">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_queueName</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_queueName</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Equals(System.Object):System.Boolean">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>o</Item>
- <Item>AMQDestination.Equals(Object):Boolean</Item>
- <Item>obj</Item>
- <Item>Object.Equals(Object):Boolean</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="StringsNotEqualNullSafe(System.String,System.String):System.Boolean">
- <Messages>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="NonBreaking">
- <Issue>
- <Item>AMQDestination.StringsNotEqualNullSafe(String, String):Boolean</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicMessageConsumer">
- <Messages>
- <Message TypeName="ImplementIDisposableCorrectly" Category="Microsoft.Design" CheckId="CA1063" Created="2006-12-04 13:11:47Z">
- <Issue Name="ProvideDisposeBool">
- <Item>Qpid.Client.BasicMessageConsumer</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="Dispose():System.Void">
- <Messages>
- <Message TypeName="ImplementIDisposableCorrectly" Category="Microsoft.Design" CheckId="CA1063" Created="2006-12-04 13:11:47Z">
- <Issue Name="DisposeImplementation">
- <Item>BasicMessageConsumer.Dispose():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="NotifyMessage(Qpid.Client.Message.UnprocessedMessage,System.Int32):System.Void">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageConsumer.NotifyMessage(UnprocessedMessage, Int32):Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- <Message Id="channelId" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2006-12-04 13:11:47Z" FixCategory="NonBreaking">
- <Issue>
- <Item>channelId</Item>
- <Item>BasicMessageConsumer.NotifyMessage(UnprocessedMessage, Int32):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OnMessage">
- <Accessors>
- <Accessor Name="set_OnMessage(Qpid.Messaging.MessageReceivedDelegate):System.Void">
- <Messages>
- <Message Id="System.InvalidOperationException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageConsumer.set_OnMessage(MessageReceivedDelegate):Void</Item>
- <Item>1</Item>
- <Item>InvalidOperationException.InvalidOperationException(String)</Item>
- <Item>Another thread is already receiving...</Item>
- </Issue>
- </Message>
- </Messages>
- </Accessor>
- </Accessors>
- </Member>
- <Member Name="Receive(System.Int64):Qpid.Messaging.IMessage">
- <Messages>
- <Message Id="System.InvalidOperationException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageConsumer.Receive(Int64):IMessage</Item>
- <Item>1</Item>
- <Item>InvalidOperationException.InvalidOperationException(String)</Item>
- <Item>Another thread is already receiving (possibly asynchronously)...</Item>
- </Issue>
- </Message>
- <Message Id="System.NotImplementedException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageConsumer.Receive(Int64):IMessage</Item>
- <Item>1</Item>
- <Item>NotImplementedException.NotImplementedException(String)</Item>
- <Item>Need to implement synchronousQueue.Poll(timeout</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReceiveNoWait():Qpid.Messaging.IMessage">
- <Messages>
- <Message Id="System.InvalidOperationException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageConsumer.ReceiveNoWait():IMessage</Item>
- <Item>1</Item>
- <Item>InvalidOperationException.InvalidOperationException(String)</Item>
- <Item>Another thread is already receiving (possibly asynchronously)...</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReturnMessageOrThrow(System.Object):Qpid.Messaging.IMessage">
- <Messages>
- <Message TypeName="DoNotCastUnnecessarily" Category="Microsoft.Performance" CheckId="CA1800" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>o</Item>
- <Item>System.Exception</Item>
- <Item>BasicMessageConsumer.ReturnMessageOrThrow(Object):IMessage</Item>
- <Item>castclass</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="NonBreaking">
- <Issue>
- <Item>BasicMessageConsumer.ReturnMessageOrThrow(Object):IMessage</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicMessageProducer">
- <Messages>
- <Message TypeName="ImplementIDisposableCorrectly" Category="Microsoft.Design" CheckId="CA1063" Created="2006-12-04 13:11:47Z">
- <Issue Name="ProvideDisposeBool">
- <Item>Qpid.Client.BasicMessageProducer</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(System.String,System.String,System.Boolean,System.UInt16,Qpid.Client.AmqChannel,System.Int64,Qpid.Messaging.DeliveryMode,System.Int64,System.Boolean,System.Boolean,System.Int32)">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'channel'</Item>
- <Item>BasicMessageProducer.BasicMessageProducer(String, String, Boolean, UInt16, AmqChannel, Int64, DeliveryMode, Int64, Boolean, Boolean, Int32)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_channelId">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageProducer._channelId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_encoding">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageProducer._encoding</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_immediate">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageProducer._immediate</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_logger">
- <Messages>
- <Message TypeName="DoNotDeclareReadOnlyMutableReferenceTypes" Category="Microsoft.Security" CheckId="CA2104" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageProducer._logger</Item>
- <Item>log4net.ILog</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_logger</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_logger</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_mandatory">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageProducer._mandatory</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_mimeType">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageProducer._mimeType</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_transacted">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageProducer._transacted</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DEFAULT_IMMEDIATE">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DEFAULT_IMMEDIATE</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicMessageProducer.DEFAULT_IMMEDIATE</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DEFAULT_MANDATORY">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DEFAULT_MANDATORY</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicMessageProducer.DEFAULT_MANDATORY</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DisableMessageID">
- <Accessors>
- <Accessor Name="get_DisableMessageID():System.Boolean">
- <Messages>
- <Message Id="System.Exception.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageProducer.get_DisableMessageID():Boolean</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String)</Item>
- <Item>The method or operation is not implemented.</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>BasicMessageProducer.get_DisableMessageID():Boolean</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Accessor>
- <Accessor Name="set_DisableMessageID(System.Boolean):System.Void">
- <Messages>
- <Message Id="System.Exception.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicMessageProducer.set_DisableMessageID(Boolean):Void</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String)</Item>
- <Item>The method or operation is not implemented.</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>BasicMessageProducer.set_DisableMessageID(Boolean):Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Accessor>
- </Accessors>
- </Member>
- <Member Name="Dispose():System.Void">
- <Messages>
- <Message TypeName="ImplementIDisposableCorrectly" Category="Microsoft.Design" CheckId="CA1063" Created="2006-12-04 13:11:47Z">
- <Issue Name="DisposeImplementation">
- <Item>BasicMessageProducer.Dispose():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Encoding">
- <Messages>
- <Message TypeName="PropertiesShouldNotBeWriteOnly" Category="Microsoft.Design" CheckId="CA1044" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Encoding</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MimeType">
- <Messages>
- <Message TypeName="PropertiesShouldNotBeWriteOnly" Category="Microsoft.Design" CheckId="CA1044" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MimeType</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Priority">
- <Accessors>
- <Accessor Name="set_Priority(System.Int32):System.Void">
- <Messages>
- <Message TypeName="InstantiateArgumentExceptionsCorrectly" Category="Microsoft.Usage" CheckId="CA2208" Created="2006-12-04 13:11:47Z">
- <Issue Name="OneArgumentShouldBeParameterName">
- <Item>System.ArgumentOutOfRangeException</Item>
- <Item>ArgumentOutOfRangeException.ArgumentOutOfRangeException(String)</Item>
- <Item>Priority of ____ is illegal. Value must be in range 0 to 9</Item>
- </Issue>
- </Message>
- </Messages>
- </Accessor>
- </Accessors>
- </Member>
- <Member Name="TimeToLive">
- <Accessors>
- <Accessor Name="set_TimeToLive(System.Int64):System.Void">
- <Messages>
- <Message TypeName="InstantiateArgumentExceptionsCorrectly" Category="Microsoft.Usage" CheckId="CA2208" Created="2006-12-04 13:11:47Z">
- <Issue Name="OneArgumentShouldBeParameterName">
- <Item>System.ArgumentOutOfRangeException</Item>
- <Item>ArgumentOutOfRangeException.ArgumentOutOfRangeException(String)</Item>
- <Item>Time to live must be non-negative - supplied value was __</Item>
- </Issue>
- </Message>
- </Messages>
- </Accessor>
- </Accessors>
- </Member>
- </Members>
- </Type>
- <Type Name="Closeable">
- <Messages>
- <Message TypeName="IdentifiersShouldDifferByMoreThanCase" Category="Microsoft.Naming" CheckId="CA1708" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>'CLOSED'</Item>
- <Item>Closed</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="_closed">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_closed</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_closed</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_closingLock">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_closingLock</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_closingLock</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CheckNotClosed():System.Void">
- <Messages>
- <Message Id="System.InvalidOperationException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Closeable.CheckNotClosed():Void</Item>
- <Item>1</Item>
- <Item>InvalidOperationException.InvalidOperationException(String)</Item>
- <Item>Object ____ has been closed</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CLOSED">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Closeable.CLOSED</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="NOT_CLOSED">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>NOT_CLOSED</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Closeable.NOT_CLOSED</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionTuneParameters">
- <Members>
- <Member Name="TxnLimit">
- <Messages>
- <Message Id="Txn" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Txn</Item>
- <Item>ConnectionTuneParameters.TxnLimit:UInt32</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QpidConnectionInfo">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qpid</Item>
- <Item>Qpid.Client.QpidConnectionInfo</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor()">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>QpidConnectionInfo.QpidConnectionInfo()</Item>
- <Item>_failoverMethod</Item>
- <Item>System.String</Item>
- <Item>null</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>QpidConnectionInfo.QpidConnectionInfo()</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_logger">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>QpidConnectionInfo._logger</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="AddBrokerInfo(Qpid.Client.qms.BrokerInfo):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>brokerInfo</Item>
- <Item>QpidConnectionInfo.AddBrokerInfo(BrokerInfo):Void</Item>
- <Item>broker</Item>
- <Item>ConnectionInfo.AddBrokerInfo(BrokerInfo):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="AsUrl():System.String">
- <Messages>
- <Message TypeName="DoNotConcatenateStringsInsideLoops" Category="Microsoft.Performance" CheckId="CA1818" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>QpidConnectionInfo.AsUrl():String</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="FromUrl(System.String):Qpid.Client.qms.ConnectionInfo">
- <Messages>
- <Message Id="0#" TypeName="UriParametersShouldNotBeStrings" Category="Microsoft.Design" CheckId="CA1054" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>url</Item>
- <Item>QpidConnectionInfo.FromUrl(String):ConnectionInfo</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QpidConnectionUrl">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qpid</Item>
- <Item>Qpid.Client.QpidConnectionUrl</Item>
- </Issue>
- </Message>
- <Message TypeName="StaticHolderTypesShouldNotHaveConstructors" Category="Microsoft.Design" CheckId="CA1053" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>QpidConnectionUrl</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="FromUri(System.Uri):Qpid.Client.qms.ConnectionInfo">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>QpidConnectionUrl.FromUri(Uri):ConnectionInfo</Item>
- </Issue>
- </Message>
- <Message Id="uri" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2006-12-04 13:11:47Z" FixCategory="NonBreaking">
- <Issue>
- <Item>uri</Item>
- <Item>QpidConnectionUrl.FromUri(Uri):ConnectionInfo</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="FromUrl(System.String):Qpid.Client.qms.ConnectionInfo">
- <Messages>
- <Message Id="url" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2006-12-04 13:11:47Z" FixCategory="NonBreaking">
- <Issue>
- <Item>url</Item>
- <Item>QpidConnectionUrl.FromUrl(String):ConnectionInfo</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.Failover">
- <Types>
- <Type Name="FailoverException">
- <Messages>
- <Message TypeName="ExceptionsShouldBePublic" Category="Microsoft.Design" CheckId="CA1064" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.Failover.FailoverException</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="FailoverHandler">
- <Messages>
- <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>Qpid.Client.Failover.FailoverHandler</Item>
- <Item>System.Threading.ManualResetEvent</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="getHost():System.String">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>getHost</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="getPort():System.Int32">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>getPort</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Run():System.Void">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverHandler.Run():Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- <Issue>
- <Item>FailoverHandler.Run():Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- <Message Id="Qpid.AMQDisconnectedException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverHandler.Run():Void</Item>
- <Item>1</Item>
- <Item>AMQDisconnectedException.AMQDisconnectedException(String)</Item>
- <Item>Redirect was vetoed by client</Item>
- </Issue>
- <Issue>
- <Item>FailoverHandler.Run():Void</Item>
- <Item>1</Item>
- <Item>AMQDisconnectedException.AMQDisconnectedException(String)</Item>
- <Item>Server closed connection and no failover was successful</Item>
- </Issue>
- </Message>
- <Message Id="Qpid.Client.Failover.FailoverException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverHandler.Run():Void</Item>
- <Item>1</Item>
- <Item>FailoverException.FailoverException(String)</Item>
- <Item>Failing over about to start</Item>
- </Issue>
- </Message>
- <Message Id="System.InvalidOperationException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverHandler.Run():Void</Item>
- <Item>1</Item>
- <Item>InvalidOperationException.InvalidOperationException(String)</Item>
- <Item>FailoverHandler must Run on a non-background thread.</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setHost(System.String):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setHost</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setPort(System.Int32):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setPort</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FailoverSupport">
- <Members>
- <Member Name="execute(Qpid.Client.AMQConnection):System.Object">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>execute</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'con'</Item>
- <Item>FailoverSupport.execute(AMQConnection):Object</Item>
- </Issue>
- <Issue>
- <Item>'con'</Item>
- <Item>FailoverSupport.execute(AMQConnection):Object</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="operation():System.Object">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>operation</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.Handler">
- <Types>
- <Type Name="BasicDeliverMethodHandler">
- <Members>
- <Member Name="MethodReceived(Qpid.Client.State.AMQStateManager,Qpid.Client.Protocol.AMQMethodEvent):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'evt'</Item>
- <Item>BasicDeliverMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicReturnMethodHandler">
- <Members>
- <Member Name="MethodReceived(Qpid.Client.State.AMQStateManager,Qpid.Client.Protocol.AMQMethodEvent):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'evt'</Item>
- <Item>BasicReturnMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ChannelCloseMethodHandler">
- <Members>
- <Member Name="MethodReceived(Qpid.Client.State.AMQStateManager,Qpid.Client.Protocol.AMQMethodEvent):System.Void">
- <Messages>
- <Message Id="Qpid.AMQChannelClosedException.#ctor(System.Int32,System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ChannelCloseMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- <Item>2</Item>
- <Item>AMQChannelClosedException.AMQChannelClosedException(Int32, String)</Item>
- <Item>Error: __</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'evt'</Item>
- <Item>ChannelCloseMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionCloseMethodHandler">
- <Members>
- <Member Name="MethodReceived(Qpid.Client.State.AMQStateManager,Qpid.Client.Protocol.AMQMethodEvent):System.Void">
- <Messages>
- <Message Id="Qpid.AMQConnectionClosedException.#ctor(System.Int32,System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConnectionCloseMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- <Item>2</Item>
- <Item>AMQConnectionClosedException.AMQConnectionClosedException(Int32, String)</Item>
- <Item>Error: __</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'evt'</Item>
- <Item>ConnectionCloseMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- <Issue>
- <Item>'stateManager'</Item>
- <Item>ConnectionCloseMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionCloseOkHandler">
- <Members>
- <Member Name="MethodReceived(Qpid.Client.State.AMQStateManager,Qpid.Client.Protocol.AMQMethodEvent):System.Void">
- <Messages>
- <Message Id="method" TypeName="RemoveUnusedLocals" Category="Microsoft.Performance" CheckId="CA1804" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConnectionCloseOkHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- <Item>method</Item>
- <Item>Qpid.Framing.ConnectionCloseOkBody</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'evt'</Item>
- <Item>ConnectionCloseOkHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- <Issue>
- <Item>'stateManager'</Item>
- <Item>ConnectionCloseOkHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionOpenOkMethodHandler">
- <Members>
- <Member Name="MethodReceived(Qpid.Client.State.AMQStateManager,Qpid.Client.Protocol.AMQMethodEvent):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'stateManager'</Item>
- <Item>ConnectionOpenOkMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionRedirectMethodHandler">
- <Members>
- <Member Name="_logger">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConnectionRedirectMethodHandler._logger</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetInstance():Qpid.Client.Handler.ConnectionRedirectMethodHandler">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetInstance</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionSecureMethodHandler">
- <Members>
- <Member Name="MethodReceived(Qpid.Client.State.AMQStateManager,Qpid.Client.Protocol.AMQMethodEvent):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'evt'</Item>
- <Item>ConnectionSecureMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionStartMethodHandler">
- <Members>
- <Member Name="GetFullSystemInfo():System.String">
- <Messages>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="NonBreaking">
- <Issue>
- <Item>ConnectionStartMethodHandler.GetFullSystemInfo():String</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MethodReceived(Qpid.Client.State.AMQStateManager,Qpid.Client.Protocol.AMQMethodEvent):System.Void">
- <Messages>
- <Message Id="Qpid.AMQException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConnectionStartMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String)</Item>
- <Item>No locales sent from server, passed: __</Item>
- </Issue>
- <Issue>
- <Item>ConnectionStartMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String)</Item>
- <Item>No supported security mechanism found, passed: __</Item>
- </Issue>
- </Message>
- <Message Id="Qpid.AMQException.#ctor(log4net.ILog,System.String,System.Exception)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConnectionStartMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- <Item>2</Item>
- <Item>AMQException.AMQException(ILog, String, Exception)</Item>
- <Item>Unable to decode data: __</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'evt'</Item>
- <Item>ConnectionStartMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- <Issue>
- <Item>'stateManager'</Item>
- <Item>ConnectionStartMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionTuneMethodHandler">
- <Members>
- <Member Name="MethodReceived(Qpid.Client.State.AMQStateManager,Qpid.Client.Protocol.AMQMethodEvent):System.Void">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConnectionTuneMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'evt'</Item>
- <Item>ConnectionTuneMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- <Issue>
- <Item>'stateManager'</Item>
- <Item>ConnectionTuneMethodHandler.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.Message">
- <Types>
- <Type Name="AbstractQmsMessage">
- <Messages>
- <Message Id="Qms" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qms</Item>
- <Item>Qpid.Client.Message.AbstractQmsMessage</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="_data">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_data</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_data</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_redelivered">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_redelivered</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_redelivered</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetExchangeName(System.String,System.String&amp;):System.String">
- <Messages>
- <Message TypeName="ProvideCorrectArgumentsToFormattingMethods" Category="Microsoft.Usage" CheckId="CA2241" Created="2006-12-04 13:11:47Z">
- <Issue Name="MissingSpecifier">
- <Item>String.Format(String, Object[]):String</Item>
- <Item>AbstractQmsMessage.GetExchangeName(String, String&amp;):String</Item>
- <Item>'stack2'</Item>
- <Item>split = {0}</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AbstractQmsMessage.GetExchangeName(String, String&amp;):String</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- <Issue>
- <Item>AbstractQmsMessage.GetExchangeName(String, String&amp;):String</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- <Issue>
- <Item>AbstractQmsMessage.GetExchangeName(String, String&amp;):String</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object[])" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AbstractQmsMessage.GetExchangeName(String, String&amp;):String</Item>
- <Item>System.String.Format(System.String,System.Object[])</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- <Issue>
- <Item>AbstractQmsMessage.GetExchangeName(String, String&amp;):String</Item>
- <Item>System.String.Format(System.String,System.Object[])</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ToString():System.String">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AbstractQmsMessage.ToString():String</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteReplyToHeader(Qpid.Client.Message.AbstractQmsMessage+Dest):System.Void">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AbstractQmsMessage.WriteReplyToHeader(Dest):Void</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AbstractQmsMessageFactory">
- <Messages>
- <Message Id="Qms" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qms</Item>
- <Item>Qpid.Client.Message.AbstractQmsMessageFactory</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CreateMessage(System.Int64,Qpid.Buffer.ByteBuffer,Qpid.Framing.ContentHeaderBody):Qpid.Client.Message.AbstractQmsMessage">
- <Messages>
- <Message Id="0#Nbr" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>AbstractQmsMessageFactory.CreateMessage(Int64, ByteBuffer, ContentHeaderBody):AbstractQmsMessage</Item>
- <Item>Nbr</Item>
- <Item>messageNbr</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateMessage(System.Int64,System.Boolean,Qpid.Framing.ContentHeaderBody,System.Collections.IList):Qpid.Client.Message.AbstractQmsMessage">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>messageNbr</Item>
- <Item>AbstractQmsMessageFactory.CreateMessage(Int64, Boolean, ContentHeaderBody, IList):AbstractQmsMessage</Item>
- <Item>deliverTag</Item>
- <Item>IMessageFactory.CreateMessage(Int64, Boolean, ContentHeaderBody, IList):AbstractQmsMessage</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateMessageWithBody(System.Int64,Qpid.Framing.ContentHeaderBody,System.Collections.IList):Qpid.Client.Message.AbstractQmsMessage">
- <Messages>
- <Message Id="0#Nbr" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>AbstractQmsMessageFactory.CreateMessageWithBody(Int64, ContentHeaderBody, IList):AbstractQmsMessage</Item>
- <Item>Nbr</Item>
- <Item>messageNbr</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'bodies'</Item>
- <Item>AbstractQmsMessageFactory.CreateMessageWithBody(Int64, ContentHeaderBody, IList):AbstractQmsMessage</Item>
- </Issue>
- <Issue>
- <Item>'bodies'</Item>
- <Item>AbstractQmsMessageFactory.CreateMessageWithBody(Int64, ContentHeaderBody, IList):AbstractQmsMessage</Item>
- </Issue>
- <Issue>
- <Item>'contentHeader'</Item>
- <Item>AbstractQmsMessageFactory.CreateMessageWithBody(Int64, ContentHeaderBody, IList):AbstractQmsMessage</Item>
- </Issue>
- <Issue>
- <Item>'contentHeader'</Item>
- <Item>AbstractQmsMessageFactory.CreateMessageWithBody(Int64, ContentHeaderBody, IList):AbstractQmsMessage</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQMessage">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQMessage</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="_channel">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_channel</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_channel</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_contentHeaderProperties">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_contentHeaderProperties</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_contentHeaderProperties</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="MessageFactoryRegistry">
- <Members>
- <Member Name="CreateMessage(System.Int64,System.Boolean,Qpid.Framing.ContentHeaderBody,System.Collections.IList):Qpid.Client.Message.AbstractQmsMessage">
- <Messages>
- <Message Id="Qpid.AMQException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MessageFactoryRegistry.CreateMessage(Int64, Boolean, ContentHeaderBody, IList):AbstractQmsMessage</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String)</Item>
- <Item>Unsupport MIME type of __</Item>
- </Issue>
- </Message>
- <Message Id="0#Nbr" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>MessageFactoryRegistry.CreateMessage(Int64, Boolean, ContentHeaderBody, IList):AbstractQmsMessage</Item>
- <Item>Nbr</Item>
- <Item>messageNbr</Item>
- </Issue>
- </Message>
- <Message Id="Unsupport" TypeName="LiteralsShouldBeSpelledCorrectly" Category="Microsoft.Usage" CheckId="CA2204" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Unsupport</Item>
- <Item>Unsupport MIME type of __</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'contentHeader'</Item>
- <Item>MessageFactoryRegistry.CreateMessage(Int64, Boolean, ContentHeaderBody, IList):AbstractQmsMessage</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateMessage(System.String):Qpid.Client.Message.AbstractQmsMessage">
- <Messages>
- <Message Id="Qpid.AMQException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MessageFactoryRegistry.CreateMessage(String):AbstractQmsMessage</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String)</Item>
- <Item>Unsupport MIME type of __</Item>
- </Issue>
- </Message>
- <Message TypeName="InstantiateArgumentExceptionsCorrectly" Category="Microsoft.Usage" CheckId="CA2208" Created="2006-12-04 13:11:47Z">
- <Issue Name="OneArgumentShouldBeParameterName">
- <Item>System.ArgumentNullException</Item>
- <Item>ArgumentNullException.ArgumentNullException(String)</Item>
- <Item>Mime type must not be null</Item>
- </Issue>
- </Message>
- <Message Id="Unsupport" TypeName="LiteralsShouldBeSpelledCorrectly" Category="Microsoft.Usage" CheckId="CA2204" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Unsupport</Item>
- <Item>Unsupport MIME type of __</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RegisterFactory(System.String,Qpid.Client.Message.IMessageFactory):System.Void">
- <Messages>
- <Message TypeName="InstantiateArgumentExceptionsCorrectly" Category="Microsoft.Usage" CheckId="CA2208" Created="2006-12-04 13:11:47Z">
- <Issue Name="OneArgumentShouldBeParameterName">
- <Item>System.ArgumentNullException</Item>
- <Item>ArgumentNullException.ArgumentNullException(String)</Item>
- <Item>Message factory</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QpidBytesMessage">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Message.QpidBytesMessage</Item>
- </Issue>
- </Message>
- <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>Qpid.Client.Message.QpidBytesMessage</Item>
- <Item>System.IO.MemoryStream, System.IO.BinaryWriter, System.IO.BinaryReader</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="ReadBytes(System.Byte[]):System.Int32">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>bytes</Item>
- <Item>QpidBytesMessage.ReadBytes(Byte[]):Int32</Item>
- <Item>array</Item>
- <Item>IBytesMessage.ReadBytes(Byte[]):Int32</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReadBytes(System.Byte[],System.Int32):System.Int32">
- <Messages>
- <Message TypeName="InstantiateArgumentExceptionsCorrectly" Category="Microsoft.Usage" CheckId="CA2208" Created="2006-12-04 13:11:47Z">
- <Issue Name="OneArgumentShouldBeParameterName">
- <Item>System.ArgumentOutOfRangeException</Item>
- <Item>ArgumentOutOfRangeException.ArgumentOutOfRangeException(String)</Item>
- <Item>count must be &gt;= 0</Item>
- </Issue>
- </Message>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>bytes</Item>
- <Item>QpidBytesMessage.ReadBytes(Byte[], Int32):Int32</Item>
- <Item>array</Item>
- <Item>IBytesMessage.ReadBytes(Byte[], Int32):Int32</Item>
- </Issue>
- </Message>
- <Message Id="1#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>count</Item>
- <Item>QpidBytesMessage.ReadBytes(Byte[], Int32):Int32</Item>
- <Item>length</Item>
- <Item>IBytesMessage.ReadBytes(Byte[], Int32):Int32</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Write(System.Double):System.Void">
- <Messages>
- <Message Id="0#v" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>QpidBytesMessage.Write(Double):Void</Item>
- <Item>v</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Write(System.Int32):System.Void">
- <Messages>
- <Message Id="0#i" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>QpidBytesMessage.Write(Int32):Void</Item>
- <Item>i</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Write(System.Int64):System.Void">
- <Messages>
- <Message Id="0#l" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>QpidBytesMessage.Write(Int64):Void</Item>
- <Item>l</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Write(System.Single):System.Void">
- <Messages>
- <Message Id="0#v" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>QpidBytesMessage.Write(Single):Void</Item>
- <Item>v</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteBoolean(System.Boolean):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>b</Item>
- <Item>QpidBytesMessage.WriteBoolean(Boolean):Void</Item>
- <Item>value</Item>
- <Item>IBytesMessage.WriteBoolean(Boolean):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteByte(System.Byte):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>b</Item>
- <Item>QpidBytesMessage.WriteByte(Byte):Void</Item>
- <Item>value</Item>
- <Item>IBytesMessage.WriteByte(Byte):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteBytes(System.Byte[]):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>bytes</Item>
- <Item>QpidBytesMessage.WriteBytes(Byte[]):Void</Item>
- <Item>value</Item>
- <Item>IBytesMessage.WriteBytes(Byte[]):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteBytes(System.Byte[],System.Int32,System.Int32):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>bytes</Item>
- <Item>QpidBytesMessage.WriteBytes(Byte[], Int32, Int32):Void</Item>
- <Item>value</Item>
- <Item>IBytesMessage.WriteBytes(Byte[], Int32, Int32):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteChar(System.Char):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>c</Item>
- <Item>QpidBytesMessage.WriteChar(Char):Void</Item>
- <Item>value</Item>
- <Item>IBytesMessage.WriteChar(Char):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteShort(System.Int16):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>i</Item>
- <Item>QpidBytesMessage.WriteShort(Int16):Void</Item>
- <Item>value</Item>
- <Item>IBytesMessage.WriteShort(Int16):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QpidBytesMessageFactory">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Message.QpidBytesMessageFactory</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CreateMessage(System.Int64,Qpid.Buffer.ByteBuffer,Qpid.Framing.ContentHeaderBody):Qpid.Client.Message.AbstractQmsMessage">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>deliveryTag</Item>
- <Item>QpidBytesMessageFactory.CreateMessage(Int64, ByteBuffer, ContentHeaderBody):AbstractQmsMessage</Item>
- <Item>messageNbr</Item>
- <Item>AbstractQmsMessageFactory.CreateMessage(Int64, ByteBuffer, ContentHeaderBody):AbstractQmsMessage</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QpidHeaders">
- <Members>
- <Member Name="CheckPropertyName(System.String):System.Void">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>QpidHeaders.CheckPropertyName(String):Void</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>Property name must not be the empty string</Item>
- </Issue>
- </Message>
- <Message TypeName="TestForEmptyStringsUsingStringLength" Category="Microsoft.Performance" CheckId="CA1820" Created="2006-12-04 13:11:47Z">
- <Issue Name="IsNullOrEmpty">
- <Item>Equals</Item>
- <Item>""</Item>
- <Item>QpidHeaders.CheckPropertyName(String):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Clear():System.Void">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>QpidHeaders.Clear():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QpidTextMessage">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Message.QpidTextMessage</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(Qpid.Buffer.ByteBuffer)">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>QpidTextMessage.QpidTextMessage(ByteBuffer)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name=".ctor(System.String)">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>QpidTextMessage.QpidTextMessage(String)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QpidTextMessageFactory">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qpid</Item>
- <Item>Qpid.Client.Message.QpidTextMessageFactory</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CreateMessage(System.Int64,Qpid.Buffer.ByteBuffer,Qpid.Framing.ContentHeaderBody):Qpid.Client.Message.AbstractQmsMessage">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>deliveryTag</Item>
- <Item>QpidTextMessageFactory.CreateMessage(Int64, ByteBuffer, ContentHeaderBody):AbstractQmsMessage</Item>
- <Item>messageNbr</Item>
- <Item>AbstractQmsMessageFactory.CreateMessage(Int64, ByteBuffer, ContentHeaderBody):AbstractQmsMessage</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="UnexpectedBodyReceivedException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.Message.UnexpectedBodyReceivedException</Item>
- <Item>protected UnexpectedBodyReceivedException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Client.Message.UnexpectedBodyReceivedException</Item>
- <Item>public UnexpectedBodyReceivedException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Client.Message.UnexpectedBodyReceivedException</Item>
- <Item>public UnexpectedBodyReceivedException(String)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Client.Message.UnexpectedBodyReceivedException</Item>
- <Item>public UnexpectedBodyReceivedException(String, Exception)</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(log4net.ILog,System.String,System.Exception)">
- <Messages>
- <Message Id="2#t" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>UnexpectedBodyReceivedException.UnexpectedBodyReceivedException(ILog, String, Exception)</Item>
- <Item>t</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="UnprocessedMessage">
- <Members>
- <Member Name=".ctor()">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>UnprocessedMessage.UnprocessedMessage()</Item>
- <Item>_bytesReceived</Item>
- <Item>System.UInt64</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Bodies">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Bodies</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="BounceBody">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BounceBody</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ChannelId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ChannelId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ContentHeader">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ContentHeader</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeliverBody">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DeliverBody</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReceiveBody(Qpid.Framing.ContentBody):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'body'</Item>
- <Item>UnprocessedMessage.ReceiveBody(ContentBody):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.Protocol">
- <Types>
- <Type Name="AMQMethodEvent">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQMethodEvent</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="AMQProtocolListener">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQProtocolListener</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(Qpid.Client.AMQConnection,Qpid.Client.State.AMQStateManager)">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQProtocolListener.AMQProtocolListener(AMQConnection, AMQStateManager)</Item>
- <Item>_protocolSession</Item>
- <Item>Qpid.Client.Protocol.AMQProtocolSession</Item>
- <Item>null</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OnException(System.Exception):System.Void">
- <Messages>
- <Message Id="Qpid.AMQException.#ctor(System.String,System.Exception)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQProtocolListener.OnException(Exception):Void</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String, Exception)</Item>
- <Item>Protocol handler error: __</Item>
- </Issue>
- </Message>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>cause</Item>
- <Item>AMQProtocolListener.OnException(Exception):Void</Item>
- <Item>e</Item>
- <Item>IProtocolListener.OnException(Exception):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OnMessage(Qpid.Framing.IDataBlock):System.Void">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQProtocolListener.OnMessage(IDataBlock):Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- <Message Id="Qpid.AMQException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQProtocolListener.OnMessage(IDataBlock):Void</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String)</Item>
- <Item>AMQMethodEvent ____ was not processed by any listener.</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQProtocolListener.OnMessage(IDataBlock):Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'message'</Item>
- <Item>AMQProtocolListener.OnMessage(IDataBlock):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PropagateExceptionToWaiters(System.Exception):System.Void">
- <Messages>
- <Message Id="0#e" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>AMQProtocolListener.PropagateExceptionToWaiters(Exception):Void</Item>
- <Item>e</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ProtocolSession">
- <Messages>
- <Message TypeName="PropertiesShouldNotBeWriteOnly" Category="Microsoft.Design" CheckId="CA1044" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProtocolSession</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RemoveFrameListener(Qpid.Client.Protocol.Listener.IAMQMethodListener):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'listener'</Item>
- <Item>AMQProtocolListener.RemoveFrameListener(IAMQMethodListener):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WhenClosed():System.Void">
- <Messages>
- <Message Id="Qpid.AMQDisconnectedException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQProtocolListener.WhenClosed():Void</Item>
- <Item>1</Item>
- <Item>AMQDisconnectedException.AMQDisconnectedException(String)</Item>
- <Item>Server closed connection and reconnection not permitted.</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQProtocolSession">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQProtocolSession</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="AddSessionByChannel(System.UInt16,Qpid.Client.AmqChannel):System.Void">
- <Messages>
- <Message TypeName="InstantiateArgumentExceptionsCorrectly" Category="Microsoft.Usage" CheckId="CA2208" Created="2006-12-04 13:11:47Z">
- <Issue Name="OneArgumentShouldBeParameterName">
- <Item>System.ArgumentNullException</Item>
- <Item>ArgumentNullException.ArgumentNullException(String)</Item>
- <Item>Attempt to register a null channel</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="AMQConnection">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AMQProtocolSession.AMQConnection:AMQConnection</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CloseSession(Qpid.Client.AmqChannel):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'channel'</Item>
- <Item>AMQProtocolSession.CloseSession(AmqChannel):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConnectionTuneParameters">
- <Accessors>
- <Accessor Name="set_ConnectionTuneParameters(Qpid.Client.ConnectionTuneParameters):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'value'</Item>
- <Item>AMQProtocolSession.set_ConnectionTuneParameters(ConnectionTuneParameters):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Accessor>
- </Accessors>
- </Member>
- <Member Name="MessageContentBodyReceived(System.UInt16,Qpid.Framing.ContentBody):System.Void">
- <Messages>
- <Message Id="Qpid.AMQException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQProtocolSession.MessageContentBodyReceived(UInt16, ContentBody):Void</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String)</Item>
- <Item>Error: received content body without having received a BasicDeliver frame first</Item>
- </Issue>
- </Message>
- <Message TypeName="RethrowToPreserveStackDetails" Category="Microsoft.Usage" CheckId="CA2200" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQProtocolSession.MessageContentBodyReceived(UInt16, ContentBody):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MessageContentHeaderReceived(System.UInt16,Qpid.Framing.ContentHeaderBody):System.Void">
- <Messages>
- <Message Id="Qpid.AMQException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQProtocolSession.MessageContentHeaderReceived(UInt16, ContentHeaderBody):Void</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String)</Item>
- <Item>Error: received content header without having received a JMSDeliver frame first</Item>
- </Issue>
- <Issue>
- <Item>AMQProtocolSession.MessageContentHeaderReceived(UInt16, ContentHeaderBody):Void</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String)</Item>
- <Item>Error: received duplicate content header or did not receive correct number of content body frames</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="UnprocessedMessageReceived(Qpid.Client.Message.UnprocessedMessage):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'message'</Item>
- <Item>AMQProtocolSession.UnprocessedMessageReceived(UnprocessedMessage):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Username">
- <Messages>
- <Message Id="Username" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2006-12-04 13:11:47Z">
- <Issue Name="ShouldBeCompoundWord">
- <Item>Username</Item>
- <Item>property</Item>
- <Item>Username</Item>
- <Item>UserName</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IProtocolListener">
- <Members>
- <Member Name="OnException(System.Exception):System.Void">
- <Messages>
- <Message Id="0#e" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>IProtocolListener.OnException(Exception):Void</Item>
- <Item>e</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ProtocolWriter">
- <Members>
- <Member Name="SyncWrite(Qpid.Framing.AMQFrame,System.Type):Qpid.Client.Protocol.AMQMethodEvent">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'frame'</Item>
- <Item>ProtocolWriter.SyncWrite(AMQFrame, Type):AMQMethodEvent</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.Protocol.Listener">
- <Types>
- <Type Name="BlockingMethodFrameListener">
- <Messages>
- <Message TypeName="AbstractTypesShouldNotHaveConstructors" Category="Microsoft.Design" CheckId="CA1012" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BlockingMethodFrameListener</Item>
- </Issue>
- </Message>
- <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>Qpid.Client.Protocol.Listener.BlockingMethodFrameListener</Item>
- <Item>System.Threading.ManualResetEvent</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(System.UInt16)">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BlockingMethodFrameListener.BlockingMethodFrameListener(UInt16)</Item>
- <Item>_doneEvt</Item>
- <Item>Qpid.Client.Protocol.AMQMethodEvent</Item>
- <Item>null</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_channelId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_channelId</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_channelId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_doneEvt">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_doneEvt</Item>
- </Issue>
- </Message>
- <Message Id="Evt" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Evt</Item>
- <Item>BlockingMethodFrameListener._doneEvt</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_doneEvt</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MethodReceived(Qpid.Client.Protocol.AMQMethodEvent):System.Boolean">
- <Messages>
- <Message TypeName="RethrowToPreserveStackDetails" Category="Microsoft.Usage" CheckId="CA2200" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BlockingMethodFrameListener.MethodReceived(AMQMethodEvent):Boolean</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'evt'</Item>
- <Item>BlockingMethodFrameListener.MethodReceived(AMQMethodEvent):Boolean</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IAMQMethodListener">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>IAMQMethodListener</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="Error(System.Exception):System.Void">
- <Messages>
- <Message Id="0#e" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>IAMQMethodListener.Error(Exception):Void</Item>
- <Item>e</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MethodReceived(Qpid.Client.Protocol.AMQMethodEvent):System.Boolean">
- <Messages>
- <Message Id="0#evt" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IAMQMethodListener.MethodReceived(AMQMethodEvent):Boolean</Item>
- <Item>evt</Item>
- <Item>evt</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.qms">
- <Types>
- <Type Name="BrokerInfo">
- <Messages>
- <Message TypeName="IdentifiersShouldHaveCorrectPrefix" Category="Microsoft.Naming" CheckId="CA1715" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BrokerInfo</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="getHost():System.String">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>getHost</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="getOption(System.String):System.String">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>getOption</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="getPort():System.Int32">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>getPort</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="getTimeout():System.Int64">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>getTimeout</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="getTransport():System.String">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>getTransport</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setHost(System.String):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setHost</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setOption(System.String,System.String):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setOption</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setPort(System.Int32):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setPort</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setTimeout(System.Int64):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setTimeout</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setTransport(System.String):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setTransport</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="useSSL():System.Boolean">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>useSSL</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BrokerInfo.useSSL():Boolean</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="useSSL(System.Boolean):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>useSSL</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BrokerInfo.useSSL(Boolean):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BrokerInfoConstants">
- <Members>
- <Member Name="DEFAULT_CONNECT_TIMEOUT">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DEFAULT_CONNECT_TIMEOUT</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BrokerInfoConstants.DEFAULT_CONNECT_TIMEOUT</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DEFAULT_PORT">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DEFAULT_PORT</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BrokerInfoConstants.DEFAULT_PORT</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DEFAULT_TRANSPORT">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DEFAULT_TRANSPORT</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BrokerInfoConstants.DEFAULT_TRANSPORT</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OPTIONS_CONNECT_TIMEOUT">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>OPTIONS_CONNECT_TIMEOUT</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BrokerInfoConstants.OPTIONS_CONNECT_TIMEOUT</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OPTIONS_RETRY">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>OPTIONS_RETRY</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BrokerInfoConstants.OPTIONS_RETRY</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OPTIONS_SSL">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>OPTIONS_SSL</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BrokerInfoConstants.OPTIONS_SSL</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="URL_FORMAT_EXAMPLE">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>URL_FORMAT_EXAMPLE</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>URL_FORMAT_EXAMPLE</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionInfo">
- <Messages>
- <Message TypeName="IdentifiersShouldHaveCorrectPrefix" Category="Microsoft.Naming" CheckId="CA1715" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConnectionInfo</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="AsUrl():System.String">
- <Messages>
- <Message TypeName="UriReturnValuesShouldNotBeStrings" Category="Microsoft.Design" CheckId="CA1055" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConnectionInfo.AsUrl():String</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetAllBrokerInfos():System.Collections.IList">
- <Messages>
- <Message Id="Infos" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Infos</Item>
- <Item>ConnectionInfo.GetAllBrokerInfos():IList</Item>
- </Issue>
- </Message>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetAllBrokerInfos</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetBrokerCount():System.Int32">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetBrokerCount</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetClientName():System.String">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetClientName</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetFailoverMethod():System.String">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetFailoverMethod</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetPassword():System.String">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetPassword</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetUsername():System.String">
- <Messages>
- <Message Id="Username" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2006-12-04 13:11:47Z">
- <Issue Name="ShouldBeCompoundWord">
- <Item>Username</Item>
- <Item>method</Item>
- <Item>GetUsername</Item>
- <Item>UserName</Item>
- </Issue>
- </Message>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetUsername</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetVirtualHost():System.String">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetVirtualHost</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setUsername(System.String):System.Void">
- <Messages>
- <Message Id="Username" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2006-12-04 13:11:47Z">
- <Issue Name="ShouldBeCompoundWord">
- <Item>Username</Item>
- <Item>method</Item>
- <Item>setUsername</Item>
- <Item>UserName</Item>
- </Issue>
- </Message>
- <Message Id="username" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2006-12-04 13:11:47Z">
- <Issue Name="ShouldBeCompoundWord">
- <Item>username</Item>
- <Item>parameter</Item>
- <Item>username</Item>
- <Item>userName</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setUsername</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionUrlConstants">
- <Messages>
- <Message TypeName="AvoidUninstantiatedInternalClasses" Category="Microsoft.Performance" CheckId="CA1812" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.qms.ConnectionUrlConstants</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="FailoverPolicy">
- <Members>
- <Member Name=".ctor(Qpid.Client.qms.ConnectionInfo)">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverPolicy.FailoverPolicy(ConnectionInfo)</Item>
- <Item>_methodsRetries</Item>
- <Item>System.Int32</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- <Message Id="System.NotImplementedException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverPolicy.FailoverPolicy(ConnectionInfo)</Item>
- <Item>1</Item>
- <Item>NotImplementedException.NotImplementedException(String)</Item>
- <Item>Dynamic loading of FailoverMethods not yet implemented.</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'connectionInfo'</Item>
- <Item>FailoverPolicy.FailoverPolicy(ConnectionInfo)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="addMethod(Qpid.Client.qms.failover.FailoverMethod):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>addMethod</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="attainedConnection():System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>attainedConnection</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetCurrentBrokerInfo():Qpid.Client.qms.BrokerInfo">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetCurrentBrokerInfo</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="getCurrentMethod():Qpid.Client.qms.failover.FailoverMethod">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>getCurrentMethod</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetNextBrokerInfo():Qpid.Client.qms.BrokerInfo">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetNextBrokerInfo</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setBroker(Qpid.Client.qms.BrokerInfo):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setBroker</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setMethodRetries(System.Int32):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setMethodRetries</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="toString():System.String">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>toString</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="UrlSyntaxException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.qms.UrlSyntaxException</Item>
- <Item>protected UrlSyntaxException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Client.qms.UrlSyntaxException</Item>
- <Item>public UrlSyntaxException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Client.qms.UrlSyntaxException</Item>
- <Item>public UrlSyntaxException(String)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Client.qms.UrlSyntaxException</Item>
- <Item>public UrlSyntaxException(String, Exception)</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkISerializableTypesWithSerializable" Category="Microsoft.Usage" CheckId="CA2237" Created="2006-12-04 13:11:47Z">
- <Issue Level="Error">
- <Item>UrlSyntaxException</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(System.String,System.String,System.Int32,System.Int32)">
- <Messages>
- <Message Id="0#" TypeName="UriParametersShouldNotBeStrings" Category="Microsoft.Design" CheckId="CA1054" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>url</Item>
- <Item>UrlSyntaxException.UrlSyntaxException(String, String, Int32, Int32)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetIndex():System.Int32">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>GetIndex</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetReason():System.String">
- <Messages>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>UrlSyntaxException.GetReason():String</Item>
- </Issue>
- </Message>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetReason</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="toString():System.String">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>toString</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.qms.failover">
- <Types>
- <Type Name="FailoverMethod">
- <Messages>
- <Message TypeName="IdentifiersShouldHaveCorrectPrefix" Category="Microsoft.Naming" CheckId="CA1715" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverMethod</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="attainedConnection():System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>attainedConnection</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="failoverAllowed():System.Boolean">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>failoverAllowed</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetCurrentBrokerInfo():Qpid.Client.qms.BrokerInfo">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetCurrentBrokerInfo</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="getNextBrokerDetails():Qpid.Client.qms.BrokerInfo">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>getNextBrokerDetails</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="methodName():System.String">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>methodName</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="reset():System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>reset</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setBroker(Qpid.Client.qms.BrokerInfo):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setBroker</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setRetries(System.Int32):System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>setRetries</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FailoverMethodConstants">
- <Members>
- <Member Name="RANDOM">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FailoverMethodConstants.RANDOM</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ROUND_ROBIN">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ROUND_ROBIN</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FailoverMethodConstants.ROUND_ROBIN</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FailoverRoundRobin">
- <Members>
- <Member Name=".ctor(Qpid.Client.qms.ConnectionInfo)">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverRoundRobin.FailoverRoundRobin(ConnectionInfo)</Item>
- <Item>_currentCycleRetries</Item>
- <Item>System.Int32</Item>
- <Item>0</Item>
- </Issue>
- <Issue>
- <Item>FailoverRoundRobin.FailoverRoundRobin(ConnectionInfo)</Item>
- <Item>_cycleRetries</Item>
- <Item>System.Int32</Item>
- <Item>0</Item>
- </Issue>
- <Issue>
- <Item>FailoverRoundRobin.FailoverRoundRobin(ConnectionInfo)</Item>
- <Item>_serverRetries</Item>
- <Item>System.Int32</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverRoundRobin.FailoverRoundRobin(ConnectionInfo)</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>At least one broker details must be specified.</Item>
- </Issue>
- </Message>
- <Message Id="System.Int32.Parse(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverRoundRobin.FailoverRoundRobin(ConnectionInfo)</Item>
- <Item>System.Int32.Parse(System.String)</Item>
- <Item>System.Int32.Parse(System.String,System.IFormatProvider)</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'connectionDetails'</Item>
- <Item>FailoverRoundRobin.FailoverRoundRobin(ConnectionInfo)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DEFAULT_CYCLE_RETRIES">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DEFAULT_CYCLE_RETRIES</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FailoverRoundRobin.DEFAULT_CYCLE_RETRIES</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DEFAULT_SERVER_RETRIES">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DEFAULT_SERVER_RETRIES</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FailoverRoundRobin.DEFAULT_SERVER_RETRIES</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setBroker(Qpid.Client.qms.BrokerInfo):System.Void">
- <Messages>
- <Message Id="System.Int32.Parse(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverRoundRobin.setBroker(BrokerInfo):Void</Item>
- <Item>System.Int32.Parse(System.String)</Item>
- <Item>System.Int32.Parse(System.String,System.IFormatProvider)</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'broker'</Item>
- <Item>FailoverRoundRobin.setBroker(BrokerInfo):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FailoverSingleServer">
- <Members>
- <Member Name=".ctor(Qpid.Client.qms.ConnectionInfo)">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverSingleServer.FailoverSingleServer(ConnectionInfo)</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>BrokerInfo details required for connection.</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'connectionDetails'</Item>
- <Item>FailoverSingleServer.FailoverSingleServer(ConnectionInfo)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DEFAULT_SERVER_RETRIES">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DEFAULT_SERVER_RETRIES</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FailoverSingleServer.DEFAULT_SERVER_RETRIES</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setBroker(Qpid.Client.qms.BrokerInfo):System.Void">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverSingleServer.setBroker(BrokerInfo):Void</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>BrokerInfo details cannot be null</Item>
- </Issue>
- </Message>
- <Message Id="System.Int32.Parse(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverSingleServer.setBroker(BrokerInfo):Void</Item>
- <Item>System.Int32.Parse(System.String)</Item>
- <Item>System.Int32.Parse(System.String,System.IFormatProvider)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="setRetries(System.Int32):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>retries</Item>
- <Item>FailoverSingleServer.setRetries(Int32):Void</Item>
- <Item>maxRetries</Item>
- <Item>FailoverMethod.setRetries(Int32):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="toString():System.String">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>toString</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.State">
- <Types>
- <Type Name="AMQState">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQState</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="ALL">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AMQState.ALL</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CONNECTION_CLOSED">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CONNECTION_CLOSED</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AMQState.CONNECTION_CLOSED</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CONNECTION_CLOSING">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CONNECTION_CLOSING</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AMQState.CONNECTION_CLOSING</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CONNECTION_NOT_OPENED">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CONNECTION_NOT_OPENED</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AMQState.CONNECTION_NOT_OPENED</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CONNECTION_NOT_STARTED">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CONNECTION_NOT_STARTED</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AMQState.CONNECTION_NOT_STARTED</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CONNECTION_NOT_TUNED">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CONNECTION_NOT_TUNED</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AMQState.CONNECTION_NOT_TUNED</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CONNECTION_OPEN">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CONNECTION_OPEN</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AMQState.CONNECTION_OPEN</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQStateChangedEvent">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQStateChangedEvent</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="AMQStateManager">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQStateManager</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="AttainState(Qpid.Client.State.AMQState):System.Void">
- <Messages>
- <Message Id="0#s" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>AMQStateManager.AttainState(AMQState):Void</Item>
- <Item>s</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MethodReceived(Qpid.Client.Protocol.AMQMethodEvent):System.Boolean">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQStateManager.MethodReceived(AMQMethodEvent):Boolean</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'evt'</Item>
- <Item>AMQStateManager.MethodReceived(AMQMethodEvent):Boolean</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IAMQStateListener">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>IAMQStateListener</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="StateChanged(Qpid.Client.State.AMQStateChangedEvent):System.Void">
- <Messages>
- <Message Id="0#evt" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IAMQStateListener.StateChanged(AMQStateChangedEvent):Void</Item>
- <Item>evt</Item>
- <Item>evt</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IllegalStateTransitionException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.State.IllegalStateTransitionException</Item>
- <Item>protected IllegalStateTransitionException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Client.State.IllegalStateTransitionException</Item>
- <Item>public IllegalStateTransitionException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Client.State.IllegalStateTransitionException</Item>
- <Item>public IllegalStateTransitionException(String)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Client.State.IllegalStateTransitionException</Item>
- <Item>public IllegalStateTransitionException(String, Exception)</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(Qpid.Client.State.AMQState,System.Type)">
- <Messages>
- <Message Id="Qpid.AMQException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IllegalStateTransitionException.IllegalStateTransitionException(AMQState, Type)</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String)</Item>
- <Item>No valid state transition defined for receiving frame ____ from state __</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IStateAwareMethodListener">
- <Members>
- <Member Name="MethodReceived(Qpid.Client.State.AMQStateManager,Qpid.Client.Protocol.AMQMethodEvent):System.Void">
- <Messages>
- <Message Id="1#evt" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IStateAwareMethodListener.MethodReceived(AMQStateManager, AMQMethodEvent):Void</Item>
- <Item>evt</Item>
- <Item>evt</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IStateListener">
- <Members>
- <Member Name="Error(System.Exception):System.Void">
- <Messages>
- <Message Id="0#e" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>IStateListener.Error(Exception):Void</Item>
- <Item>e</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="StateWaiter">
- <Messages>
- <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>Qpid.Client.State.StateWaiter</Item>
- <Item>System.Threading.ManualResetEvent</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="WaituntilStateHasChanged():System.Void">
- <Messages>
- <Message Id="Qpid.AMQException.#ctor(System.String,System.Exception)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>StateWaiter.WaituntilStateHasChanged():Void</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String, Exception)</Item>
- <Item>Error: __</Item>
- </Issue>
- </Message>
- <Message Id="Waituntil" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Waituntil</Item>
- <Item>StateWaiter.WaituntilStateHasChanged():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.Transport">
- <Types>
- <Type Name="AmqpChannel">
- <Messages>
- <Message Id="Amqp" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Amqp</Item>
- <Item>Qpid.Client.Transport.AmqpChannel</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(Qpid.Client.Transport.IByteChannel)">
- <Messages>
- <Message Id="0#" TypeName="AvoidTypeNamesInParameters" Category="Microsoft.Naming" CheckId="CA1720" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>byteChannel</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Read():System.Collections.Queue">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqpChannel.Read():Queue</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Write(Qpid.Framing.IDataBlock):System.Void">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AmqpChannel.Write(IDataBlock):Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQProtocolProvider">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQProtocolProvider</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="IProtocolWriter">
- <Members>
- <Member Name="Write(Qpid.Framing.IDataBlock):System.Void">
- <Messages>
- <Message Id="0#o" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>IProtocolWriter.Write(IDataBlock):Void</Item>
- <Item>o</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ITransport">
- <Members>
- <Member Name="getLocalEndPoint():System.String">
- <Messages>
- <Message Id="EndPoint" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2006-12-04 13:11:47Z">
- <Issue Name="ShouldBeDiscreteTerm">
- <Item>EndPoint</Item>
- <Item>method</Item>
- <Item>getLocalEndPoint</Item>
- <Item>Endpoint</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>getLocalEndPoint</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="SingleProtocolEncoderOutput">
- <Members>
- <Member Name="buffer">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>buffer</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Write(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message Id="System.InvalidOperationException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>SingleProtocolEncoderOutput.Write(ByteBuffer):Void</Item>
- <Item>1</Item>
- <Item>InvalidOperationException.InvalidOperationException(String)</Item>
- <Item>{0} does not allow the writing of more than one buffer</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- </Namespaces>
- </Module>
- </Modules>
- </Target>
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Client.Tests.dll">
- <Modules>
- <Module Name="qpid.client.tests.dll">
- <Messages>
- <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.Tests</Item>
- </Issue>
- </Message>
- <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoStrongName">
- <Item>Qpid.Client.Tests</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoAttr">
- <Item>Qpid.Client.Tests</Item>
- </Issue>
- </Message>
- </Messages>
- <Namespaces>
- <Namespace Name="Qpid.Client.Tests">
- <Types>
- <Type Name="Avergager">
- <Members>
- <Member Name=".ctor()">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Avergager.Avergager()</Item>
- <Item>num</Item>
- <Item>System.Int64</Item>
- <Item>0</Item>
- </Issue>
- <Issue>
- <Item>Avergager.Avergager()</Item>
- <Item>sum</Item>
- <Item>System.Int64</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ToString():System.String">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Avergager.ToString():String</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BaseMessagingTestFixture">
- <Messages>
- <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>Qpid.Client.Tests.BaseMessagingTestFixture</Item>
- <Item>Qpid.Client.AMQConnection</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="_channel">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_channel</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_channel</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_connection">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>_connection</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>_connection</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Init():System.Void">
- <Messages>
- <Message TypeName="RethrowToPreserveStackDetails" Category="Microsoft.Usage" CheckId="CA2200" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BaseMessagingTestFixture.Init():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="HeadersMatchingConsumer">
- <Messages>
- <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>Qpid.Client.Tests.HeadersMatchingConsumer</Item>
- <Item>System.Threading.AutoResetEvent</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CreatePatternAsFieldTable():Qpid.Framing.FieldTable">
- <Messages>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="NonBreaking">
- <Issue>
- <Item>HeadersMatchingConsumer.CreatePatternAsFieldTable():FieldTable</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OnException(System.Exception):System.Void">
- <Messages>
- <Message Id="0#e" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>HeadersMatchingConsumer.OnException(Exception):Void</Item>
- <Item>e</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'e'</Item>
- <Item>HeadersMatchingConsumer.OnException(Exception):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OnMessage(Qpid.Messaging.IMessage):System.Void">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>HeadersMatchingConsumer.OnMessage(IMessage):Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'message'</Item>
- <Item>HeadersMatchingConsumer.OnMessage(IMessage):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ProducerMultiConsumer">
- <Messages>
- <Message Id="Multi" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Multi</Item>
- <Item>Qpid.Client.Tests.ProducerMultiConsumer</Item>
- </Issue>
- </Message>
- <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>Qpid.Client.Tests.ProducerMultiConsumer</Item>
- <Item>System.Threading.AutoResetEvent</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor()">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProducerMultiConsumer.ProducerMultiConsumer()</Item>
- <Item>_messageReceivedCount</Item>
- <Item>System.Int32</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OnMessage(Qpid.Messaging.IMessage):System.Void">
- <Messages>
- <Message Id="0#m" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>ProducerMultiConsumer.OnMessage(IMessage):Void</Item>
- <Item>m</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RunTest():System.Void">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProducerMultiConsumer.RunTest():Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ServiceProvidingClient">
- <Messages>
- <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>Qpid.Client.Tests.ServiceProvidingClient</Item>
- <Item>System.Threading.AutoResetEvent</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor()">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ServiceProvidingClient.ServiceProvidingClient()</Item>
- <Item>_selector</Item>
- <Item>System.String</Item>
- <Item>null</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OnMessage(Qpid.Messaging.IMessage):System.Void">
- <Messages>
- <Message TypeName="RethrowToPreserveStackDetails" Category="Microsoft.Usage" CheckId="CA2200" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ServiceProvidingClient.OnMessage(IMessage):Void</Item>
- </Issue>
- <Issue>
- <Item>ServiceProvidingClient.OnMessage(IMessage):Void</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ServiceProvidingClient.OnMessage(IMessage):Void</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- <Issue>
- <Item>ServiceProvidingClient.OnMessage(IMessage):Void</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ServiceRequestingClient">
- <Messages>
- <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>Qpid.Client.Tests.ServiceRequestingClient</Item>
- <Item>System.Threading.AutoResetEvent</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="Main(System.String[]):System.Void">
- <Messages>
- <Message Id="args" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>args</Item>
- <Item>ServiceRequestingClient.Main(String[]):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OnMessage(Qpid.Messaging.IMessage):System.Void">
- <Messages>
- <Message Id="System.Exception.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ServiceRequestingClient.OnMessage(IMessage):Void</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String)</Item>
- <Item>Set timeSent!</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>ServiceRequestingClient.OnMessage(IMessage):Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- <Message Id="0#m" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>ServiceRequestingClient.OnMessage(IMessage):Void</Item>
- <Item>m</Item>
- </Issue>
- </Message>
- <Message Id="System.Int64.Parse(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ServiceRequestingClient.OnMessage(IMessage):Void</Item>
- <Item>System.Int64.Parse(System.String)</Item>
- <Item>System.Int64.Parse(System.String,System.IFormatProvider)</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ServiceRequestingClient.OnMessage(IMessage):Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- <Issue>
- <Item>ServiceRequestingClient.OnMessage(IMessage):Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'m'</Item>
- <Item>ServiceRequestingClient.OnMessage(IMessage):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="SendMessages():System.Void">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ServiceRequestingClient.SendMessages():Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- <Issue>
- <Item>ServiceRequestingClient.SendMessages():Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- <Issue>
- <Item>ServiceRequestingClient.SendMessages():Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ServiceRequestingClient.SendMessages():Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- <Issue>
- <Item>ServiceRequestingClient.SendMessages():Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- <Issue>
- <Item>ServiceRequestingClient.SendMessages():Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="UndeliverableTest">
- <Members>
- <Member Name="OnException(System.Exception):System.Void">
- <Messages>
- <Message TypeName="DoNotCastUnnecessarily" Category="Microsoft.Performance" CheckId="CA1800" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>e</Item>
- <Item>Qpid.Messaging.QpidException</Item>
- <Item>UndeliverableTest.OnException(Exception):Void</Item>
- <Item>castclass</Item>
- </Issue>
- </Message>
- <Message Id="0#e" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>UndeliverableTest.OnException(Exception):Void</Item>
- <Item>e</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>UndeliverableTest.OnException(Exception):Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.Tests.connection">
- <Types>
- <Type Name="ConnectionTest">
- <Members>
- <Member Name="passwordFailureConnection():System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>passwordFailureConnection</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>ConnectionTest.passwordFailureConnection():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="simpleConnection():System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>simpleConnection</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>ConnectionTest.simpleConnection():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.Tests.failover">
- <Types>
- <Type Name="FailoverTest">
- <Members>
- <Member Name="DoFailoverTest(Qpid.Messaging.IConnection):System.Void">
- <Messages>
- <Message Id="Qpid.Client.Tests.failover.FailoverTest+MsgListener" TypeName="DoNotIgnoreMethodResults" Category="Microsoft.Usage" CheckId="CA1806" Created="2006-12-04 13:11:47Z">
- <Issue Name="ObjectCreation">
- <Item>FailoverTest.DoFailoverTest(IConnection):Void</Item>
- <Item>Qpid.Client.Tests.failover.FailoverTest+MsgListener</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverTest.DoFailoverTest(IConnection):Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OnMessage(Qpid.Messaging.IMessage):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'message'</Item>
- <Item>FailoverTest.OnMessage(IMessage):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="TestWithBasicInfo():System.Void">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverTest.TestWithBasicInfo():Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FailoverTest+MsgListener">
- <Members>
- <Member Name="init(Qpid.Messaging.IMessage):Qpid.Messaging.IMessagePublisher">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MsgListener.init(IMessage):IMessagePublisher</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FailoverTxTest">
- <Messages>
- <Message TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Tx</Item>
- <Item>Qpid.Client.Tests.failover.FailoverTxTest</Item>
- </Issue>
- </Message>
- <Message TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>Qpid.Client.Tests.failover.FailoverTxTest</Item>
- <Item>Qpid.Client.AMQConnection</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="OnMessage(Qpid.Messaging.IMessage):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'message'</Item>
- <Item>FailoverTxTest.OnMessage(IMessage):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="TestWithBasicInfo():System.Void">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FailoverTxTest.TestWithBasicInfo():Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Client.Transport">
- <Types>
- <Type Name="BlockingIo">
- <Messages>
- <Message TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Io</Item>
- <Item>Qpid.Client.Transport.BlockingIo</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="connectFromOutside():System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>connectFromOutside</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>BlockingIo.connectFromOutside():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="connectionAndSleepForHeartbeats():System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>connectionAndSleepForHeartbeats</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>BlockingIo.connectionAndSleepForHeartbeats():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="regularConnection():System.Void">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>regularConnection</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>BlockingIo.regularConnection():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- </Namespaces>
- </Module>
- </Modules>
- </Target>
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Client.Transport.Socket.Blocking.dll">
- <Modules>
- <Module Name="qpid.client.transport.socket.blocking.dll">
- <Messages>
- <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Client.Transport.Socket.Blocking</Item>
- </Issue>
- </Message>
- <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoStrongName">
- <Item>Qpid.Client.Transport.Socket.Blocking</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoAttr">
- <Item>Qpid.Client.Transport.Socket.Blocking</Item>
- </Issue>
- </Message>
- </Messages>
- <Namespaces>
- <Namespace Name="Qpid.Client.Transport.Socket.Blocking">
- <Types>
- <Type Name="BlockingSocketProcessor">
- <Members>
- <Member Name="Write(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BlockingSocketProcessor.Write(ByteBuffer):Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BlockingSocketTransport">
- <Members>
- <Member Name=".ctor(System.String,System.Int32,Qpid.Client.AMQConnection)">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'connection'</Item>
- <Item>BlockingSocketTransport.BlockingSocketTransport(String, Int32, AMQConnection)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_log">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BlockingSocketTransport._log</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BlockingSocketTransport+ReaderRunner">
- <Members>
- <Member Name="Run():System.Void">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReaderRunner.Run():Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ByteChannel">
- <Members>
- <Member Name="Read():Qpid.Buffer.ByteBuffer">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ByteChannel.Read():ByteBuffer</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Write(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ByteChannel.Write(ByteBuffer):Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- </Namespaces>
- </Module>
- </Modules>
- </Target>
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Codec.dll">
- <Modules>
- <Module Name="qpid.codec.dll">
- <Messages>
- <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Codec</Item>
- </Issue>
- </Message>
- <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoStrongName">
- <Item>Qpid.Codec</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoAttr">
- <Item>Qpid.Codec</Item>
- </Issue>
- </Message>
- </Messages>
- <Namespaces>
- <Namespace Name="Qpid.Codec">
- <Types>
- <Type Name="CumulativeProtocolDecoder">
- <Members>
- <Member Name="DecodeAll(Qpid.Buffer.ByteBuffer,Qpid.Codec.IProtocolDecoderOutput):System.Void">
- <Messages>
- <Message Id="System.Exception.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>CumulativeProtocolDecoder.DecodeAll(ByteBuffer, IProtocolDecoderOutput):Void</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String)</Item>
- <Item>doDecode() can't return true when buffer is not consumed.</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>CumulativeProtocolDecoder.DecodeAll(ByteBuffer, IProtocolDecoderOutput):Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Dispose():System.Void">
- <Messages>
- <Message TypeName="ImplementIDisposableCorrectly" Category="Microsoft.Design" CheckId="CA1063" Created="2006-12-04 13:11:47Z">
- <Issue Name="DisposeImplementation">
- <Item>CumulativeProtocolDecoder.Dispose():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IProtocolEncoderOutput">
- <Members>
- <Member Name="Write(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message Id="0#buf" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IProtocolEncoderOutput.Write(ByteBuffer):Void</Item>
- <Item>buf</Item>
- <Item>buf</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ProtocolCodecException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Codec.ProtocolCodecException</Item>
- <Item>protected ProtocolCodecException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Codec.ProtocolCodecException</Item>
- <Item>public ProtocolCodecException(String, Exception)</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkISerializableTypesWithSerializable" Category="Microsoft.Usage" CheckId="CA2237" Created="2006-12-04 13:11:47Z">
- <Issue Level="Error">
- <Item>ProtocolCodecException</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(System.Exception)">
- <Messages>
- <Message Id="System.Exception.#ctor(System.String,System.Exception)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProtocolCodecException.ProtocolCodecException(Exception)</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String, Exception)</Item>
- <Item>Codec Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ProtocolDecoderException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Codec.ProtocolDecoderException</Item>
- <Item>protected ProtocolDecoderException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Codec.ProtocolDecoderException</Item>
- <Item>public ProtocolDecoderException(String, Exception)</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="ProtocolEncoderException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Codec.ProtocolEncoderException</Item>
- <Item>protected ProtocolEncoderException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Codec.ProtocolEncoderException</Item>
- <Item>public ProtocolEncoderException(String, Exception)</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Codec.Demux">
- <Types>
- <Type Name="DemuxingProtocolCodecFactory">
- <Messages>
- <Message Id="Demuxing" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Demuxing</Item>
- <Item>Qpid.Codec.Demux.DemuxingProtocolCodecFactory</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="DisposeCodecResources():System.Void">
- <Messages>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>DemuxingProtocolCodecFactory.DisposeCodecResources():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Register(System.Type):System.Void">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DemuxingProtocolCodecFactory.Register(Type):Void</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>Unregisterable type: __</Item>
- </Issue>
- </Message>
- <Message Id="Unregisterable" TypeName="LiteralsShouldBeSpelledCorrectly" Category="Microsoft.Usage" CheckId="CA2204" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Unregisterable</Item>
- <Item>Unregisterable type: __</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="DemuxingProtocolCodecFactory+DefaultConstructorMessageDecoderFactory">
- <Members>
- <Member Name=".ctor(System.Type)">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DefaultConstructorMessageDecoderFactory.DefaultConstructorMessageDecoderFactory(Type)</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>decoderClass is not assignable to MessageDecoder</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="NewDecoder():Qpid.Codec.Demux.IMessageDecoder">
- <Messages>
- <Message Id="System.Exception.#ctor(System.String,System.Exception)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DefaultConstructorMessageDecoderFactory.NewDecoder():IMessageDecoder</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String, Exception)</Item>
- <Item>Failed to create a new instance of __</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>DefaultConstructorMessageDecoderFactory.NewDecoder():IMessageDecoder</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="DemuxingProtocolCodecFactory+DefaultConstructorMessageEncoderFactory">
- <Members>
- <Member Name=".ctor(System.Type)">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DefaultConstructorMessageEncoderFactory.DefaultConstructorMessageEncoderFactory(Type)</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>encoderClass is not assignable to MessageEncoder</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="NewEncoder():Qpid.Codec.Demux.IMessageEncoder">
- <Messages>
- <Message Id="System.Exception.#ctor(System.String,System.Exception)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DefaultConstructorMessageEncoderFactory.NewEncoder():IMessageEncoder</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String, Exception)</Item>
- <Item>Failed to create a new instance of __</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>DefaultConstructorMessageEncoderFactory.NewEncoder():IMessageEncoder</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="DemuxingProtocolCodecFactory+ProtocolDecoderImpl">
- <Members>
- <Member Name="DoDecode(Qpid.Buffer.ByteBuffer,Qpid.Codec.IProtocolDecoderOutput):System.Boolean">
- <Messages>
- <Message Id="Qpid.Codec.ProtocolDecoderException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProtocolDecoderImpl.DoDecode(ByteBuffer, IProtocolDecoderOutput):Boolean</Item>
- <Item>1</Item>
- <Item>ProtocolDecoderException.ProtocolDecoderException(String)</Item>
- <Item>Message decoder returned NOT_OK.</Item>
- </Issue>
- </Message>
- <Message Id="System.Exception.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProtocolDecoderImpl.DoDecode(ByteBuffer, IProtocolDecoderOutput):Boolean</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String)</Item>
- <Item>Unexpected decode result (see your decode()): __</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>ProtocolDecoderImpl.DoDecode(ByteBuffer, IProtocolDecoderOutput):Boolean</Item>
- <Item>System.Exception</Item>
- </Issue>
- <Issue Name="TooGeneric">
- <Item>ProtocolDecoderImpl.DoDecode(ByteBuffer, IProtocolDecoderOutput):Boolean</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="MessageDecoderResult">
- <Members>
- <Member Name="NEED_DATA">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>NEED_DATA</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>MessageDecoderResult.NEED_DATA</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="NOT_OK">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>NOT_OK</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberOk">
- <Item>MessageDecoderResult.NOT_OK</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OK">
- <Messages>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberOk">
- <Item>MessageDecoderResult.OK</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- </Namespaces>
- </Module>
- </Modules>
- </Target>
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Common.dll">
- <Modules>
- <Module Name="qpid.common.dll">
- <Messages>
- <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Common</Item>
- </Issue>
- </Message>
- <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoStrongName">
- <Item>Qpid.Common</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoAttr">
- <Item>Qpid.Common</Item>
- </Issue>
- </Message>
- </Messages>
- <Namespaces>
- <Namespace Name="Qpid">
- <Types>
- <Type Name="AMQChannelClosedException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.AMQChannelClosedException</Item>
- <Item>protected AMQChannelClosedException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQChannelClosedException</Item>
- <Item>public AMQChannelClosedException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQChannelClosedException</Item>
- <Item>public AMQChannelClosedException(String)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQChannelClosedException</Item>
- <Item>public AMQChannelClosedException(String, Exception)</Item>
- </Issue>
- </Message>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQChannelClosedException</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="AMQConnectionClosedException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.AMQConnectionClosedException</Item>
- <Item>protected AMQConnectionClosedException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQConnectionClosedException</Item>
- <Item>public AMQConnectionClosedException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQConnectionClosedException</Item>
- <Item>public AMQConnectionClosedException(String)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQConnectionClosedException</Item>
- <Item>public AMQConnectionClosedException(String, Exception)</Item>
- </Issue>
- </Message>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQConnectionClosedException</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="AMQDisconnectedException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.AMQDisconnectedException</Item>
- <Item>protected AMQDisconnectedException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQDisconnectedException</Item>
- <Item>public AMQDisconnectedException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQDisconnectedException</Item>
- <Item>public AMQDisconnectedException(String, Exception)</Item>
- </Issue>
- </Message>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQDisconnectedException</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="AMQException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.AMQException</Item>
- <Item>protected AMQException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQException</Item>
- <Item>public AMQException()</Item>
- </Issue>
- </Message>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQException</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkISerializableTypesWithSerializable" Category="Microsoft.Usage" CheckId="CA2237" Created="2006-12-04 13:11:47Z">
- <Issue Level="Error">
- <Item>AMQException</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(log4net.ILog,System.Int32,System.String)">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'logger'</Item>
- <Item>AMQException.AMQException(ILog, Int32, String)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name=".ctor(log4net.ILog,System.Int32,System.String,System.Exception)">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'logger'</Item>
- <Item>AMQException.AMQException(ILog, Int32, String, Exception)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name=".ctor(log4net.ILog,System.String)">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'logger'</Item>
- <Item>AMQException.AMQException(ILog, String)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name=".ctor(log4net.ILog,System.String,System.Exception)">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'logger'</Item>
- <Item>AMQException.AMQException(ILog, String, Exception)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQUndeliveredException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.AMQUndeliveredException</Item>
- <Item>protected AMQUndeliveredException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQUndeliveredException</Item>
- <Item>public AMQUndeliveredException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQUndeliveredException</Item>
- <Item>public AMQUndeliveredException(String)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.AMQUndeliveredException</Item>
- <Item>public AMQUndeliveredException(String, Exception)</Item>
- </Issue>
- </Message>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQUndeliveredException</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="GetUndeliveredMessage():System.Object">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="50">
- <Item>GetUndeliveredMessage</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Collections">
- <Types>
- <Type Name="BlockingQueue">
- <Members>
- <Member Name="EnqueueBlocking(System.Object):System.Void">
- <Messages>
- <Message Id="0#e" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>BlockingQueue.EnqueueBlocking(Object):Void</Item>
- <Item>e</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="EnqueueNoThrow(System.Object):System.Boolean">
- <Messages>
- <Message Id="0#e" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>BlockingQueue.EnqueueNoThrow(Object):Boolean</Item>
- <Item>e</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="LinkedBlockingQueue">
- <Messages>
- <Message TypeName="ICollectionImplementationsHaveStronglyTypedMembers" Category="Microsoft.Design" CheckId="CA1035" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>LinkedBlockingQueue</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(System.Int32)">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>LinkedBlockingQueue.LinkedBlockingQueue(Int32)</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>Capacity must be positive, was passed __</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="EnqueueBlocking(System.Object):System.Void">
- <Messages>
- <Message TypeName="InstantiateArgumentExceptionsCorrectly" Category="Microsoft.Usage" CheckId="CA2208" Created="2006-12-04 13:11:47Z">
- <Issue Name="OneArgumentShouldBeParameterName">
- <Item>System.ArgumentNullException</Item>
- <Item>ArgumentNullException.ArgumentNullException(String)</Item>
- <Item>Object must not be null</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="EnqueueNoThrow(System.Object):System.Boolean">
- <Messages>
- <Message TypeName="InstantiateArgumentExceptionsCorrectly" Category="Microsoft.Usage" CheckId="CA2208" Created="2006-12-04 13:11:47Z">
- <Issue Name="OneArgumentShouldBeParameterName">
- <Item>System.ArgumentNullException</Item>
- <Item>ArgumentNullException.ArgumentNullException(String)</Item>
- <Item>e must not be null</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="LinkedHashtable">
- <Messages>
- <Message TypeName="ICollectionImplementationsHaveStronglyTypedMembers" Category="Microsoft.Design" CheckId="CA1035" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>LinkedHashtable</Item>
- </Issue>
- </Message>
- <Message TypeName="IdentifiersShouldHaveCorrectSuffix" Category="Microsoft.Naming" CheckId="CA1710" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Collections.LinkedHashtable</Item>
- <Item>Dictionary</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="Add(System.Object,System.Object):System.Void">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>LinkedHashtable.Add(Object, Object):Void</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>LinkedHashtable already contains key. key=__</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MoveToHead(System.Object):System.Void">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>LinkedHashtable.MoveToHead(Object):Void</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>Key ____ not found</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Tail">
- <Accessors>
- <Accessor Name="get_Tail():Qpid.Collections.LinkedHashtable+LinkedDictionaryEntry">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>LinkedHashtable.get_Tail():LinkedDictionaryEntry</Item>
- </Issue>
- </Message>
- </Messages>
- </Accessor>
- </Accessors>
- </Member>
- </Members>
- </Type>
- <Type Name="LinkedHashtable+LHTEnumerator">
- <Members>
- <Member Name=".ctor(Qpid.Collections.LinkedHashtable)">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>LHTEnumerator.LHTEnumerator(LinkedHashtable)</Item>
- <Item>_needsReset</Item>
- <Item>System.Boolean</Item>
- <Item>false</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Current">
- <Accessors>
- <Accessor Name="get_Current():System.Object">
- <Messages>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>LHTEnumerator.get_Current():Object</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Accessor>
- </Accessors>
- </Member>
- </Members>
- </Type>
- <Type Name="SynchronousQueue">
- <Messages>
- <Message TypeName="ICollectionImplementationsHaveStronglyTypedMembers" Category="Microsoft.Design" CheckId="CA1035" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>SynchronousQueue</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(System.Boolean)">
- <Messages>
- <Message Id="strict" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>strict</Item>
- <Item>SynchronousQueue.SynchronousQueue(Boolean)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_qlock">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>SynchronousQueue._qlock</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_waitingConsumers">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>SynchronousQueue._waitingConsumers</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="_waitingProducers">
- <Messages>
- <Message TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>SynchronousQueue._waitingProducers</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="SynchronousQueue+FifoWaitQueue">
- <Messages>
- <Message TypeName="AvoidUninstantiatedInternalClasses" Category="Microsoft.Performance" CheckId="CA1812" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Collections.SynchronousQueue+FifoWaitQueue</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="SynchronousQueue+LifoWaitQueue">
- <Messages>
- <Message TypeName="AvoidUninstantiatedInternalClasses" Category="Microsoft.Performance" CheckId="CA1812" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Collections.SynchronousQueue+LifoWaitQueue</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="SynchronousQueue+Node">
- <Members>
- <Member Name=".ctor(System.Object)">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Node.Node(Object)</Item>
- <Item>state</Item>
- <Item>System.Int32</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name=".ctor(System.Object,Qpid.Collections.SynchronousQueue+Node)">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Node.Node(Object, Node)</Item>
- <Item>state</Item>
- <Item>System.Int32</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Attempt(System.Int64):System.Boolean">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Node.Attempt(Int64):Boolean</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Extract():System.Object">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Node.Extract():Object</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetItem():System.Object">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Node.GetItem():Object</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="SetItem(System.Object):System.Boolean">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Node.SetItem(Object):Boolean</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WaitForPut():System.Object">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Node.WaitForPut():Object</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WaitForPut(System.Int64):System.Object">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Node.WaitForPut(Int64):Object</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WaitForTake():System.Void">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Node.WaitForTake():Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WaitForTake(System.Int64):System.Boolean">
- <Messages>
- <Message TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Node.WaitForTake(Int64):Boolean</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Common">
- <Types>
- <Type Name="AssemblySettings">
- <Members>
- <Member Name="GetConfig(System.Reflection.Assembly):System.Collections.IDictionary">
- <Messages>
- <Message TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AssemblySettings.GetConfig(Assembly):IDictionary</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'asm'</Item>
- <Item>AssemblySettings.GetConfig(Assembly):IDictionary</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- <Namespace Name="Qpid.Framing">
- <Types>
- <Type Name="AccessRequestBody">
- <Members>
- <Member Name="Active">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Active</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AccessRequestBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>AccessRequestBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Realm</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exclusive</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Passive</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Active</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Write</Item>
- </Issue>
- </Message>
- <Message Id="6#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Read</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AccessRequestBody.CreateAMQFrame(UInt16, String, Boolean, Boolean, Boolean, Boolean, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exclusive">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exclusive</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AccessRequestBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>AccessRequestBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Passive">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Passive</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Read">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Read</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Realm">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Realm</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Write">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Write</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AccessRequestOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AccessRequestOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>AccessRequestOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AccessRequestOkBody.CreateAMQFrame(UInt16, UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AccessRequestOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>AccessRequestOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQDataBlockDecoder">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQDataBlockDecoder</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor()">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQDataBlockDecoder.AMQDataBlockDecoder()</Item>
- <Item>_disabled</Item>
- <Item>System.Boolean</Item>
- <Item>false</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAndPopulateFrame(Qpid.Buffer.ByteBuffer):System.Object">
- <Messages>
- <Message Id="Qpid.Framing.AMQFrameDecodingException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQDataBlockDecoder.CreateAndPopulateFrame(ByteBuffer):Object</Item>
- <Item>1</Item>
- <Item>AMQFrameDecodingException.AMQFrameDecodingException(String)</Item>
- <Item>Unsupported body type: __</Item>
- </Issue>
- </Message>
- <Message Id="marker" TypeName="RemoveUnusedLocals" Category="Microsoft.Performance" CheckId="CA1804" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQDataBlockDecoder.CreateAndPopulateFrame(ByteBuffer):Object</Item>
- <Item>marker</Item>
- <Item>System.Byte</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'input'</Item>
- <Item>AMQDataBlockDecoder.CreateAndPopulateFrame(ByteBuffer):Object</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Decodable(Qpid.Buffer.ByteBuffer):Qpid.Codec.Demux.MessageDecoderResult">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>input</Item>
- <Item>AMQDataBlockDecoder.Decodable(ByteBuffer):MessageDecoderResult</Item>
- <Item>buffer</Item>
- <Item>IMessageDecoder.Decodable(ByteBuffer):MessageDecoderResult</Item>
- </Issue>
- </Message>
- <Message Id="System.String.Format(System.String,System.Object,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQDataBlockDecoder.Decodable(ByteBuffer):MessageDecoderResult</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'input'</Item>
- <Item>AMQDataBlockDecoder.Decodable(ByteBuffer):MessageDecoderResult</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Decode(Qpid.Buffer.ByteBuffer,Qpid.Codec.IProtocolDecoderOutput):Qpid.Codec.Demux.MessageDecoderResult">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>input</Item>
- <Item>AMQDataBlockDecoder.Decode(ByteBuffer, IProtocolDecoderOutput):MessageDecoderResult</Item>
- <Item>buffer</Item>
- <Item>IMessageDecoder.Decode(ByteBuffer, IProtocolDecoderOutput):MessageDecoderResult</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'output'</Item>
- <Item>AMQDataBlockDecoder.Decode(ByteBuffer, IProtocolDecoderOutput):MessageDecoderResult</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Disabled">
- <Messages>
- <Message TypeName="PropertiesShouldNotBeWriteOnly" Category="Microsoft.Design" CheckId="CA1044" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Disabled</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQDataBlockEncoder">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQDataBlockEncoder</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="Encode(System.Object,Qpid.Codec.IProtocolEncoderOutput):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'output'</Item>
- <Item>AMQDataBlockEncoder.Encode(Object, IProtocolEncoderOutput):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQFrame">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="PopulateFromBuffer(Qpid.Buffer.ByteBuffer,System.UInt16,System.UInt32,Qpid.Framing.IBodyFactory):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'bodyFactory'</Item>
- <Item>AMQFrame.PopulateFromBuffer(ByteBuffer, UInt16, UInt32, IBodyFactory):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WritePayload(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>AMQFrame.WritePayload(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQFrameDecodingException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Framing.AMQFrameDecodingException</Item>
- <Item>protected AMQFrameDecodingException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Framing.AMQFrameDecodingException</Item>
- <Item>public AMQFrameDecodingException()</Item>
- </Issue>
- </Message>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQFrameDecodingException</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="AMQMethodBody">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQMethodBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="Clazz">
- <Messages>
- <Message Id="Clazz" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Clazz</Item>
- <Item>AMQMethodBody.Clazz:UInt16</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ToString():System.String">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object,System.Object,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AMQMethodBody.ToString():String</Item>
- <Item>System.String.Format(System.String,System.Object,System.Object,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="TYPE">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>AMQMethodBody.TYPE</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WritePayload(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>AMQMethodBody.WritePayload(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQMethodBodyFactory">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQMethodBodyFactory</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CreateBody(Qpid.Buffer.ByteBuffer):Qpid.Framing.IBody">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'inbuf'</Item>
- <Item>AMQMethodBodyFactory.CreateBody(ByteBuffer):IBody</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetInstance():Qpid.Framing.AMQMethodBodyFactory">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>GetInstance</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="AMQProtocolHeaderException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Framing.AMQProtocolHeaderException</Item>
- <Item>protected AMQProtocolHeaderException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Framing.AMQProtocolHeaderException</Item>
- <Item>public AMQProtocolHeaderException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Framing.AMQProtocolHeaderException</Item>
- <Item>public AMQProtocolHeaderException(String, Exception)</Item>
- </Issue>
- </Message>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>AMQProtocolHeaderException</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="BasicAckBody">
- <Messages>
- <Message Id="Ack" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Ack</Item>
- <Item>Qpid.Framing.BasicAckBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicAckBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicAckBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt64,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Multiple</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicAckBody.CreateAMQFrame(UInt16, UInt64, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeliveryTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicAckBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicAckBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Multiple">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Multiple</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicCancelBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicCancelBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicCancelBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="2#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>BasicCancelBody.CreateAMQFrame(UInt16, String, Boolean):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicCancelBody.CreateAMQFrame(UInt16, String, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicCancelBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicCancelBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>BasicCancelBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicCancelOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicCancelOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicCancelOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicCancelOkBody.CreateAMQFrame(UInt16, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicCancelOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicCancelOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicConsumeBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicConsumeBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicConsumeBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.String,System.Boolean,System.Boolean,System.Boolean,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Queue</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>NoLocal</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>NoAck</Item>
- </Issue>
- </Message>
- <Message Id="6#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exclusive</Item>
- </Issue>
- </Message>
- <Message Id="7#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="5#Ack" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>BasicConsumeBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean, Boolean, Boolean):AMQFrame</Item>
- <Item>Ack</Item>
- <Item>NoAck</Item>
- </Issue>
- </Message>
- <Message Id="7#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>BasicConsumeBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean, Boolean, Boolean):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicConsumeBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean, Boolean, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exclusive">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exclusive</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicConsumeBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicConsumeBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="NoAck">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>NoAck</Item>
- </Issue>
- </Message>
- <Message Id="Ack" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Ack</Item>
- <Item>BasicConsumeBody.NoAck</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="NoLocal">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>NoLocal</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>BasicConsumeBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Queue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Queue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicConsumeOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicConsumeOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicConsumeOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicConsumeOkBody.CreateAMQFrame(UInt16, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicConsumeOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicConsumeOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicContentHeaderProperties">
- <Members>
- <Member Name="AppId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AppId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ClusterId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ClusterId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ContentType">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ContentType</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CorrelationId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>CorrelationId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeliveryMode">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DeliveryMode</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Encoding">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Encoding</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Expiration">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Expiration</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Headers">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Headers</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MessageId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MessageId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PopulatePropertiesFromBuffer(Qpid.Buffer.ByteBuffer,System.UInt16):System.Void">
- <Messages>
- <Message Id="System.UInt32.Parse(System.String)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicContentHeaderProperties.PopulatePropertiesFromBuffer(ByteBuffer, UInt16):Void</Item>
- <Item>System.UInt32.Parse(System.String)</Item>
- <Item>System.UInt32.Parse(System.String,System.IFormatProvider)</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>BasicContentHeaderProperties.PopulatePropertiesFromBuffer(ByteBuffer, UInt16):Void</Item>
- </Issue>
- <Issue>
- <Item>'buffer'</Item>
- <Item>BasicContentHeaderProperties.PopulatePropertiesFromBuffer(ByteBuffer, UInt16):Void</Item>
- </Issue>
- <Issue>
- <Item>'buffer'</Item>
- <Item>BasicContentHeaderProperties.PopulatePropertiesFromBuffer(ByteBuffer, UInt16):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Priority">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Priority</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PropertyListSize">
- <Accessors>
- <Accessor Name="get_PropertyListSize():System.UInt32">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicContentHeaderProperties.get_PropertyListSize():UInt32</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Accessor>
- </Accessors>
- </Member>
- <Member Name="ReplyTo">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyTo</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Timestamp">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Timestamp</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Type">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Type</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="UserId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>UserId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WritePropertyListPayload(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object)" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BasicContentHeaderProperties.WritePropertyListPayload(ByteBuffer):Void</Item>
- <Item>System.String.Format(System.String,System.Object)</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>BasicContentHeaderProperties.WritePropertyListPayload(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicDeliverBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicDeliverBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicDeliverBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.UInt64,System.Boolean,System.String,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Redelivered</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicDeliverBody.CreateAMQFrame(UInt16, String, UInt64, Boolean, String, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeliveryTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicDeliverBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicDeliverBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Redelivered">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Redelivered</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RoutingKey">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicGetBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicGetBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicGetBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Queue</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>NoAck</Item>
- </Issue>
- </Message>
- <Message Id="3#Ack" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>BasicGetBody.CreateAMQFrame(UInt16, UInt16, String, Boolean):AMQFrame</Item>
- <Item>Ack</Item>
- <Item>NoAck</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicGetBody.CreateAMQFrame(UInt16, UInt16, String, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicGetBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicGetBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="NoAck">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>NoAck</Item>
- </Issue>
- </Message>
- <Message Id="Ack" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Ack</Item>
- <Item>BasicGetBody.NoAck</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Queue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Queue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicGetEmptyBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicGetEmptyBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicGetEmptyBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ClusterId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ClusterId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ClusterId</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicGetEmptyBody.CreateAMQFrame(UInt16, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicGetEmptyBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicGetEmptyBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicGetOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicGetOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicGetOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt64,System.Boolean,System.String,System.String,System.UInt32):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Redelivered</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>MessageCount</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicGetOkBody.CreateAMQFrame(UInt16, UInt64, Boolean, String, String, UInt32):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeliveryTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MessageCount">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MessageCount</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicGetOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicGetOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Redelivered">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Redelivered</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RoutingKey">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicPublishBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicPublishBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicPublishBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.String,System.Boolean,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Mandatory</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Immediate</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicPublishBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Immediate">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Immediate</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Mandatory">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Mandatory</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicPublishBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicPublishBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RoutingKey">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicQosBody">
- <Messages>
- <Message Id="Qos" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qos</Item>
- <Item>Qpid.Framing.BasicQosBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicQosBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicQosBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt32,System.UInt16,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>PrefetchSize</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>PrefetchCount</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Global</Item>
- </Issue>
- </Message>
- <Message Id="1#Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>BasicQosBody.CreateAMQFrame(UInt16, UInt32, UInt16, Boolean):AMQFrame</Item>
- <Item>Prefetch</Item>
- <Item>PrefetchSize</Item>
- </Issue>
- </Message>
- <Message Id="2#Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>BasicQosBody.CreateAMQFrame(UInt16, UInt32, UInt16, Boolean):AMQFrame</Item>
- <Item>Prefetch</Item>
- <Item>PrefetchCount</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicQosBody.CreateAMQFrame(UInt16, UInt32, UInt16, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Global">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Global</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicQosBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicQosBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PrefetchCount">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>PrefetchCount</Item>
- </Issue>
- </Message>
- <Message Id="Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Prefetch</Item>
- <Item>BasicQosBody.PrefetchCount</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PrefetchSize">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>PrefetchSize</Item>
- </Issue>
- </Message>
- <Message Id="Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Prefetch</Item>
- <Item>BasicQosBody.PrefetchSize</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicQosOkBody">
- <Messages>
- <Message Id="Qos" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qos</Item>
- <Item>Qpid.Framing.BasicQosOkBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicQosOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicQosOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicQosOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicQosOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicQosOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicRecoverBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicRecoverBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicRecoverBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Requeue</Item>
- </Issue>
- </Message>
- <Message Id="1#Requeue" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>BasicRecoverBody.CreateAMQFrame(UInt16, Boolean):AMQFrame</Item>
- <Item>Requeue</Item>
- <Item>Requeue</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicRecoverBody.CreateAMQFrame(UInt16, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicRecoverBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicRecoverBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Requeue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Requeue</Item>
- </Issue>
- </Message>
- <Message Id="Requeue" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Requeue</Item>
- <Item>BasicRecoverBody.Requeue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicRejectBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicRejectBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicRejectBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt64,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Requeue</Item>
- </Issue>
- </Message>
- <Message Id="2#Requeue" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>BasicRejectBody.CreateAMQFrame(UInt16, UInt64, Boolean):AMQFrame</Item>
- <Item>Requeue</Item>
- <Item>Requeue</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicRejectBody.CreateAMQFrame(UInt16, UInt64, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeliveryTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicRejectBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicRejectBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Requeue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Requeue</Item>
- </Issue>
- </Message>
- <Message Id="Requeue" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Requeue</Item>
- <Item>BasicRejectBody.Requeue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="BasicReturnBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicReturnBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicReturnBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.String,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicReturnBody.CreateAMQFrame(UInt16, UInt16, String, String, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>BasicReturnBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>BasicReturnBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyCode">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyText">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RoutingKey">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ChannelAlertBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelAlertBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelAlertBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,Qpid.Framing.FieldTable):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Details</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelAlertBody.CreateAMQFrame(UInt16, UInt16, String, FieldTable):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Details">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Details</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelAlertBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelAlertBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyCode">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyText">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ChannelCloseBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelCloseBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelCloseBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ClassId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ClassId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.UInt16,System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ClassId</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>MethodId</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelCloseBody.CreateAMQFrame(UInt16, UInt16, String, UInt16, UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelCloseBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelCloseBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MethodId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MethodId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyCode">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyText">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ChannelCloseOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelCloseOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelCloseOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelCloseOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelCloseOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelCloseOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ChannelFlowBody">
- <Members>
- <Member Name="Active">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Active</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelFlowBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelFlowBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Active</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelFlowBody.CreateAMQFrame(UInt16, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelFlowBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelFlowBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ChannelFlowOkBody">
- <Members>
- <Member Name="Active">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Active</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelFlowOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelFlowOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Active</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelFlowOkBody.CreateAMQFrame(UInt16, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelFlowOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelFlowOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ChannelOpenBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelOpenBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelOpenBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>OutOfBand</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelOpenBody.CreateAMQFrame(UInt16, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelOpenBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelOpenBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="OutOfBand">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>OutOfBand</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ChannelOpenOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelOpenOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelOpenOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelOpenOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ChannelOpenOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ChannelOpenOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="CompositeAMQDataBlock">
- <Messages>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>CompositeAMQDataBlock</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="Blocks">
- <Messages>
- <Message TypeName="PropertiesShouldNotReturnArrays" Category="Microsoft.Performance" CheckId="CA1819" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>CompositeAMQDataBlock.Blocks:IDataBlock[]</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionCloseBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionCloseBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionCloseBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ClassId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ClassId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.UInt16,System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ClassId</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>MethodId</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionCloseBody.CreateAMQFrame(UInt16, UInt16, String, UInt16, UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionCloseBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionCloseBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MethodId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MethodId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyCode">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyText">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionCloseOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionCloseOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionCloseOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionCloseOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionCloseOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionCloseOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionOpenBody">
- <Members>
- <Member Name="Capabilities">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Capabilities</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionOpenBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionOpenBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.String,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>VirtualHost</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Capabilities</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Insist</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionOpenBody.CreateAMQFrame(UInt16, String, String, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Insist">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Insist</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionOpenBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionOpenBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="VirtualHost">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>VirtualHost</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionOpenOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionOpenOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionOpenOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>KnownHosts</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionOpenOkBody.CreateAMQFrame(UInt16, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="KnownHosts">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>KnownHosts</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionOpenOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionOpenOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionRedirectBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionRedirectBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionRedirectBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Host</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>KnownHosts</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionRedirectBody.CreateAMQFrame(UInt16, String, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Host">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Host</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="KnownHosts">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>KnownHosts</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionRedirectBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionRedirectBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionSecureBody">
- <Members>
- <Member Name="Challenge">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Challenge</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionSecureBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionSecureBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.Byte[]):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Challenge</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionSecureBody.CreateAMQFrame(UInt16, Byte[]):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionSecureBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionSecureBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionSecureOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionSecureOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionSecureOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.Byte[]):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Response</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionSecureOkBody.CreateAMQFrame(UInt16, Byte[]):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionSecureOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionSecureOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Response">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Response</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionStartBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionStartBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionStartBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.Byte,System.Byte,Qpid.Framing.FieldTable,System.Byte[],System.Byte[]):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>VersionMajor</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>VersionMinor</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ServerProperties</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Mechanisms</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Locales</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionStartBody.CreateAMQFrame(UInt16, Byte, Byte, FieldTable, Byte[], Byte[]):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Locales">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Locales</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Mechanisms">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Mechanisms</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionStartBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionStartBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ServerProperties">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ServerProperties</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="VersionMajor">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>VersionMajor</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="VersionMinor">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>VersionMinor</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionStartOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionStartOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionStartOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ClientProperties">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ClientProperties</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,Qpid.Framing.FieldTable,System.String,System.Byte[],System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ClientProperties</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Mechanism</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Response</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Locale</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionStartOkBody.CreateAMQFrame(UInt16, FieldTable, String, Byte[], String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Locale">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Locale</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Mechanism">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Mechanism</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionStartOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionStartOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Response">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Response</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionTuneBody">
- <Members>
- <Member Name="ChannelMax">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ChannelMax</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionTuneBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionTuneBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.UInt32,System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ChannelMax</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>FrameMax</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Heartbeat</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionTuneBody.CreateAMQFrame(UInt16, UInt16, UInt32, UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="FrameMax">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FrameMax</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Heartbeat">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Heartbeat</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionTuneBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionTuneBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ConnectionTuneOkBody">
- <Members>
- <Member Name="ChannelMax">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ChannelMax</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionTuneOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionTuneOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.UInt32,System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ChannelMax</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>FrameMax</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Heartbeat</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionTuneOkBody.CreateAMQFrame(UInt16, UInt16, UInt32, UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="FrameMax">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FrameMax</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Heartbeat">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Heartbeat</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ConnectionTuneOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ConnectionTuneOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ContentBody">
- <Members>
- <Member Name="CreateAMQFrame(System.UInt16,Qpid.Framing.ContentBody):Qpid.Framing.AMQFrame">
- <Messages>
- <Message TypeName="ConsiderPassingBaseTypesAsParameters" Category="Microsoft.Design" CheckId="CA1011" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>body</Item>
- <Item>ContentBody.CreateAMQFrame(UInt16, ContentBody):AMQFrame</Item>
- <Item>Qpid.Framing.ContentBody</Item>
- <Item>Qpid.Framing.IBody</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ContentBody.CreateAMQFrame(UInt16, ContentBody):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Payload">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Payload</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PopulateFromBuffer(Qpid.Buffer.ByteBuffer,System.UInt32):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>ContentBody.PopulateFromBuffer(ByteBuffer, UInt32):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="TYPE">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ContentBody.TYPE</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WritePayload(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>ContentBody.WritePayload(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ContentBodyFactory">
- <Members>
- <Member Name="GetInstance():Qpid.Framing.ContentBodyFactory">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>GetInstance</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ContentHeaderBody">
- <Members>
- <Member Name="BodySize">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>BodySize</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ClassId">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ClassId</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,Qpid.Framing.ContentHeaderBody):Qpid.Framing.AMQFrame">
- <Messages>
- <Message TypeName="ConsiderPassingBaseTypesAsParameters" Category="Microsoft.Design" CheckId="CA1011" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>body</Item>
- <Item>ContentHeaderBody.CreateAMQFrame(UInt16, ContentHeaderBody):AMQFrame</Item>
- <Item>Qpid.Framing.ContentHeaderBody</Item>
- <Item>Qpid.Framing.IBody</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ContentHeaderBody.CreateAMQFrame(UInt16, ContentHeaderBody):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.UInt16,Qpid.Framing.BasicContentHeaderProperties,System.UInt32):Qpid.Framing.AMQFrame">
- <Messages>
- <Message TypeName="ConsiderPassingBaseTypesAsParameters" Category="Microsoft.Design" CheckId="CA1011" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>properties</Item>
- <Item>ContentHeaderBody.CreateAMQFrame(UInt16, UInt16, UInt16, BasicContentHeaderProperties, UInt32):AMQFrame</Item>
- <Item>Qpid.Framing.BasicContentHeaderProperties</Item>
- <Item>Qpid.Framing.IContentHeaderProperties</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ContentHeaderBody.CreateAMQFrame(UInt16, UInt16, UInt16, BasicContentHeaderProperties, UInt32):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PopulateFromBuffer(Qpid.Buffer.ByteBuffer,System.UInt32):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>ContentHeaderBody.PopulateFromBuffer(ByteBuffer, UInt32):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Properties">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Properties</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ToString():System.String">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object[])" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ContentHeaderBody.ToString():String</Item>
- <Item>System.String.Format(System.String,System.Object[])</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="TYPE">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ContentHeaderBody.TYPE</Item>
- </Issue>
- </Message>
- <Message TypeName="UseLiteralsWhereAppropriate" Category="Microsoft.Performance" CheckId="CA1802" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>TYPE</Item>
- <Item>2</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Weight">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Weight</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WritePayload(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>ContentHeaderBody.WritePayload(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ContentHeaderBodyFactory">
- <Members>
- <Member Name="GetInstance():Qpid.Framing.ContentHeaderBodyFactory">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>GetInstance</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ContentHeaderPropertiesFactory">
- <Members>
- <Member Name="CreateContentHeaderProperties(System.UInt16,System.UInt16,Qpid.Buffer.ByteBuffer):Qpid.Framing.IContentHeaderProperties">
- <Messages>
- <Message Id="Qpid.Framing.AMQFrameDecodingException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ContentHeaderPropertiesFactory.CreateContentHeaderProperties(UInt16, UInt16, ByteBuffer):IContentHeaderProperties</Item>
- <Item>1</Item>
- <Item>AMQFrameDecodingException.AMQFrameDecodingException(String)</Item>
- <Item>Unsupport content header class id: __</Item>
- </Issue>
- </Message>
- <Message Id="Unsupport" TypeName="LiteralsShouldBeSpelledCorrectly" Category="Microsoft.Usage" CheckId="CA2204" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Unsupport</Item>
- <Item>Unsupport content header class id: __</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>ContentHeaderPropertiesFactory.CreateContentHeaderProperties(UInt16, UInt16, ByteBuffer):IContentHeaderProperties</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="GetInstance():Qpid.Framing.ContentHeaderPropertiesFactory">
- <Messages>
- <Message TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>GetInstance</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="DtxSelectBody">
- <Messages>
- <Message Id="Dtx" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Dtx</Item>
- <Item>Qpid.Framing.DtxSelectBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxSelectBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>DtxSelectBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxSelectBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxSelectBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>DtxSelectBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="DtxSelectOkBody">
- <Messages>
- <Message Id="Dtx" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Dtx</Item>
- <Item>Qpid.Framing.DtxSelectOkBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxSelectOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>DtxSelectOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxSelectOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxSelectOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>DtxSelectOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="DtxStartBody">
- <Messages>
- <Message Id="Dtx" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Dtx</Item>
- <Item>Qpid.Framing.DtxStartBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxStartBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>DtxStartBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>DtxIdentifier</Item>
- </Issue>
- </Message>
- <Message Id="1#Dtx" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>DtxStartBody.CreateAMQFrame(UInt16, String):AMQFrame</Item>
- <Item>Dtx</Item>
- <Item>DtxIdentifier</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxStartBody.CreateAMQFrame(UInt16, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DtxIdentifier">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DtxIdentifier</Item>
- </Issue>
- </Message>
- <Message Id="Dtx" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Dtx</Item>
- <Item>DtxStartBody.DtxIdentifier</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxStartBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>DtxStartBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="DtxStartOkBody">
- <Messages>
- <Message Id="Dtx" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Dtx</Item>
- <Item>Qpid.Framing.DtxStartOkBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxStartOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>DtxStartOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxStartOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DtxStartOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>DtxStartOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="EncodingUtils">
- <Messages>
- <Message Id="Utils" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Utils</Item>
- <Item>Qpid.Framing.EncodingUtils</Item>
- </Issue>
- </Message>
- <Message TypeName="StaticHolderTypesShouldNotHaveConstructors" Category="Microsoft.Design" CheckId="CA1053" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>EncodingUtils</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="EncodedLongStringLength(System.String):System.UInt32">
- <Messages>
- <Message Id="0#s" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>EncodingUtils.EncodedLongStringLength(String):UInt32</Item>
- <Item>s</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="EncodedLongstrLength(System.Byte[]):System.Int32">
- <Messages>
- <Message Id="Longstr" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Longstr</Item>
- <Item>EncodingUtils.EncodedLongstrLength(Byte[]):Int32</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="EncodedShortStringLength(System.String):System.UInt16">
- <Messages>
- <Message Id="0#s" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>EncodingUtils.EncodedShortStringLength(String):UInt16</Item>
- <Item>s</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReadBooleans(Qpid.Buffer.ByteBuffer):System.Boolean[]">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.ReadBooleans(ByteBuffer):Boolean[]</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReadFieldTable(Qpid.Buffer.ByteBuffer):Qpid.Framing.FieldTable">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.ReadFieldTable(ByteBuffer):FieldTable</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReadLongstr(Qpid.Buffer.ByteBuffer):System.Byte[]">
- <Messages>
- <Message Id="Longstr" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Longstr</Item>
- <Item>EncodingUtils.ReadLongstr(ByteBuffer):Byte[]</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.ReadLongstr(ByteBuffer):Byte[]</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReadLongString(Qpid.Buffer.ByteBuffer):System.String">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.ReadLongString(ByteBuffer):String</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReadShortString(Qpid.Buffer.ByteBuffer):System.String">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.ReadShortString(ByteBuffer):String</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteBooleans(Qpid.Buffer.ByteBuffer,System.Boolean[]):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.WriteBooleans(ByteBuffer, Boolean[]):Void</Item>
- </Issue>
- <Issue>
- <Item>'values'</Item>
- <Item>EncodingUtils.WriteBooleans(ByteBuffer, Boolean[]):Void</Item>
- </Issue>
- <Issue>
- <Item>'values'</Item>
- <Item>EncodingUtils.WriteBooleans(ByteBuffer, Boolean[]):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteFieldTableBytes(Qpid.Buffer.ByteBuffer,Qpid.Framing.FieldTable):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.WriteFieldTableBytes(ByteBuffer, FieldTable):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteLongstr(Qpid.Buffer.ByteBuffer,System.Byte[]):System.Void">
- <Messages>
- <Message Id="Longstr" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Longstr</Item>
- <Item>EncodingUtils.WriteLongstr(ByteBuffer, Byte[]):Void</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.WriteLongstr(ByteBuffer, Byte[]):Void</Item>
- </Issue>
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.WriteLongstr(ByteBuffer, Byte[]):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteLongStringBytes(Qpid.Buffer.ByteBuffer,System.String):System.Void">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>EncodingUtils.WriteLongStringBytes(ByteBuffer, String):Void</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>String too long</Item>
- </Issue>
- </Message>
- <Message Id="1#s" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>EncodingUtils.WriteLongStringBytes(ByteBuffer, String):Void</Item>
- <Item>s</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.WriteLongStringBytes(ByteBuffer, String):Void</Item>
- </Issue>
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.WriteLongStringBytes(ByteBuffer, String):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteShortStringBytes(Qpid.Buffer.ByteBuffer,System.String):System.Void">
- <Messages>
- <Message Id="1#s" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>EncodingUtils.WriteShortStringBytes(ByteBuffer, String):Void</Item>
- <Item>s</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.WriteShortStringBytes(ByteBuffer, String):Void</Item>
- </Issue>
- <Issue>
- <Item>'buffer'</Item>
- <Item>EncodingUtils.WriteShortStringBytes(ByteBuffer, String):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ExchangeDeclareBody">
- <Members>
- <Member Name="Arguments">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Arguments</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="AutoDelete">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AutoDelete</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeclareBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ExchangeDeclareBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.String,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,Qpid.Framing.FieldTable):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Type</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Passive</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Durable</Item>
- </Issue>
- </Message>
- <Message Id="6#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>AutoDelete</Item>
- </Issue>
- </Message>
- <Message Id="7#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Internal</Item>
- </Issue>
- </Message>
- <Message Id="8#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="9#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Arguments</Item>
- </Issue>
- </Message>
- <Message Id="8#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ExchangeDeclareBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean, Boolean, Boolean, Boolean, FieldTable):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeclareBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean, Boolean, Boolean, Boolean, FieldTable):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Durable">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Durable</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Internal">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Internal</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeclareBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ExchangeDeclareBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>ExchangeDeclareBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Passive">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Passive</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Type">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Type</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ExchangeDeclareOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeclareOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ExchangeDeclareOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeclareOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeclareOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ExchangeDeclareOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ExchangeDeleteBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeleteBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ExchangeDeleteBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.Boolean,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IfUnused</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="4#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ExchangeDeleteBody.CreateAMQFrame(UInt16, UInt16, String, Boolean, Boolean):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeleteBody.CreateAMQFrame(UInt16, UInt16, String, Boolean, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="IfUnused">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IfUnused</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeleteBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ExchangeDeleteBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>ExchangeDeleteBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ExchangeDeleteOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeleteOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ExchangeDeleteOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeleteOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeDeleteOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>ExchangeDeleteOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FieldTable">
- <Messages>
- <Message TypeName="CollectionsShouldImplementGenericInterface" Category="Microsoft.Design" CheckId="CA1010" Created="2006-12-04 13:11:47Z">
- <Issue Certainty="60">
- <Item>FieldTable</Item>
- <Item>IEnumerable</Item>
- </Issue>
- </Message>
- <Message TypeName="IdentifiersShouldHaveCorrectSuffix" Category="Microsoft.Naming" CheckId="CA1710" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Framing.FieldTable</Item>
- <Item>Collection</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor()">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FieldTable.FieldTable()</Item>
- <Item>_encodedSize</Item>
- <Item>System.UInt32</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name=".ctor(Qpid.Buffer.ByteBuffer,System.UInt32)">
- <Messages>
- <Message Id="Qpid.Framing.AMQFrameDecodingException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FieldTable.FieldTable(ByteBuffer, UInt32)</Item>
- <Item>1</Item>
- <Item>AMQFrameDecodingException.AMQFrameDecodingException(String)</Item>
- <Item>Unsupported field table type: __</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>FieldTable.FieldTable(ByteBuffer, UInt32)</Item>
- </Issue>
- <Issue>
- <Item>'buffer'</Item>
- <Item>FieldTable.FieldTable(ByteBuffer, UInt32)</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="AddAll(Qpid.Messaging.IFieldTable):System.Void">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ft</Item>
- <Item>FieldTable.AddAll(IFieldTable):Void</Item>
- <Item>source</Item>
- <Item>IFieldTable.AddAll(IFieldTable):Void</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'ft'</Item>
- <Item>FieldTable.AddAll(IFieldTable):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="AdjustEncodingSizeWhenAdding(System.Object,System.Object):System.Void">
- <Messages>
- <Message TypeName="DoNotCastUnnecessarily" Category="Microsoft.Performance" CheckId="CA1800" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>value</Item>
- <Item>System.String</Item>
- <Item>FieldTable.AdjustEncodingSizeWhenAdding(Object, Object):Void</Item>
- <Item>castclass</Item>
- </Issue>
- </Message>
- <Message Id="System.Exception.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FieldTable.AdjustEncodingSizeWhenAdding(Object, Object):Void</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String)</Item>
- <Item>Unsupported value type: __</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>FieldTable.AdjustEncodingSizeWhenAdding(Object, Object):Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="AdjustEncodingSizeWhenRemoving(System.Object,System.Object):System.Void">
- <Messages>
- <Message TypeName="DoNotCastUnnecessarily" Category="Microsoft.Performance" CheckId="CA1800" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>value</Item>
- <Item>System.String</Item>
- <Item>FieldTable.AdjustEncodingSizeWhenRemoving(Object, Object):Void</Item>
- <Item>castclass</Item>
- </Issue>
- </Message>
- <Message Id="System.Exception.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FieldTable.AdjustEncodingSizeWhenRemoving(Object, Object):Void</Item>
- <Item>1</Item>
- <Item>Exception.Exception(String)</Item>
- <Item>Illegal value type: __</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201" Created="2006-12-04 13:11:47Z">
- <Issue Name="TooGeneric">
- <Item>FieldTable.AdjustEncodingSizeWhenRemoving(Object, Object):Void</Item>
- <Item>System.Exception</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CheckKey(System.Object):System.Void">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FieldTable.CheckKey(Object):Void</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>All keys must be Strings - was passed: __</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="NonBreaking">
- <Issue>
- <Item>FieldTable.CheckKey(Object):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CheckValue(System.Object):System.Void">
- <Messages>
- <Message Id="System.ArgumentException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FieldTable.CheckValue(Object):Void</Item>
- <Item>1</Item>
- <Item>ArgumentException.ArgumentException(String)</Item>
- <Item>All values must be type string or int or long or uint, was passed: __</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="NonBreaking">
- <Issue>
- <Item>FieldTable.CheckValue(Object):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WritePayload(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message TypeName="DoNotCastUnnecessarily" Category="Microsoft.Performance" CheckId="CA1800" Created="2006-12-04 13:11:47Z">
- <Issue Name="Local">
- <Item>value</Item>
- <Item>System.Byte[]</Item>
- <Item>FieldTable.WritePayload(ByteBuffer):Void</Item>
- <Item>castclass</Item>
- </Issue>
- <Issue Name="Local">
- <Item>value</Item>
- <Item>System.String</Item>
- <Item>FieldTable.WritePayload(ByteBuffer):Void</Item>
- <Item>castclass</Item>
- </Issue>
- </Message>
- <Message Id="System.InvalidOperationException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FieldTable.WritePayload(ByteBuffer):Void</Item>
- <Item>1</Item>
- <Item>InvalidOperationException.InvalidOperationException(String)</Item>
- <Item>Unsupported type in FieldTable: __</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteToBuffer(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>FieldTable.WriteToBuffer(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileAckBody">
- <Messages>
- <Message Id="Ack" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Ack</Item>
- <Item>Qpid.Framing.FileAckBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileAckBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileAckBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt64,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Multiple</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileAckBody.CreateAMQFrame(UInt16, UInt64, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeliveryTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileAckBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileAckBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Multiple">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Multiple</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileCancelBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileCancelBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileCancelBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="2#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>FileCancelBody.CreateAMQFrame(UInt16, String, Boolean):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileCancelBody.CreateAMQFrame(UInt16, String, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileCancelBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileCancelBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>FileCancelBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileCancelOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileCancelOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileCancelOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileCancelOkBody.CreateAMQFrame(UInt16, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileCancelOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileCancelOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileConsumeBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileConsumeBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileConsumeBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.String,System.Boolean,System.Boolean,System.Boolean,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Queue</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>NoLocal</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>NoAck</Item>
- </Issue>
- </Message>
- <Message Id="6#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exclusive</Item>
- </Issue>
- </Message>
- <Message Id="7#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="5#Ack" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>FileConsumeBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean, Boolean, Boolean):AMQFrame</Item>
- <Item>Ack</Item>
- <Item>NoAck</Item>
- </Issue>
- </Message>
- <Message Id="7#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>FileConsumeBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean, Boolean, Boolean):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileConsumeBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean, Boolean, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exclusive">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exclusive</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileConsumeBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileConsumeBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="NoAck">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>NoAck</Item>
- </Issue>
- </Message>
- <Message Id="Ack" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Ack</Item>
- <Item>FileConsumeBody.NoAck</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="NoLocal">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>NoLocal</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>FileConsumeBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Queue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Queue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileConsumeOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileConsumeOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileConsumeOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileConsumeOkBody.CreateAMQFrame(UInt16, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileConsumeOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileConsumeOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileDeliverBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileDeliverBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileDeliverBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.UInt64,System.Boolean,System.String,System.String,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Redelivered</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- <Message Id="6#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Identifier</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileDeliverBody.CreateAMQFrame(UInt16, String, UInt64, Boolean, String, String, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeliveryTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Identifier">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Identifier</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileDeliverBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileDeliverBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Redelivered">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Redelivered</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RoutingKey">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileOpenBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileOpenBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileOpenBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ContentSize">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ContentSize</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.UInt64):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Identifier</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ContentSize</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileOpenBody.CreateAMQFrame(UInt16, String, UInt64):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Identifier">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Identifier</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileOpenBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileOpenBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileOpenOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileOpenOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileOpenOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt64):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>StagedSize</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileOpenOkBody.CreateAMQFrame(UInt16, UInt64):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileOpenOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileOpenOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="StagedSize">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>StagedSize</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FilePublishBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FilePublishBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FilePublishBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.String,System.Boolean,System.Boolean,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Mandatory</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Immediate</Item>
- </Issue>
- </Message>
- <Message Id="6#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Identifier</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FilePublishBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Identifier">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Identifier</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Immediate">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Immediate</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Mandatory">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Mandatory</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FilePublishBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FilePublishBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RoutingKey">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileQosBody">
- <Messages>
- <Message Id="Qos" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qos</Item>
- <Item>Qpid.Framing.FileQosBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileQosBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileQosBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt32,System.UInt16,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>PrefetchSize</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>PrefetchCount</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Global</Item>
- </Issue>
- </Message>
- <Message Id="1#Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>FileQosBody.CreateAMQFrame(UInt16, UInt32, UInt16, Boolean):AMQFrame</Item>
- <Item>Prefetch</Item>
- <Item>PrefetchSize</Item>
- </Issue>
- </Message>
- <Message Id="2#Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>FileQosBody.CreateAMQFrame(UInt16, UInt32, UInt16, Boolean):AMQFrame</Item>
- <Item>Prefetch</Item>
- <Item>PrefetchCount</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileQosBody.CreateAMQFrame(UInt16, UInt32, UInt16, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Global">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Global</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileQosBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileQosBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PrefetchCount">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>PrefetchCount</Item>
- </Issue>
- </Message>
- <Message Id="Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Prefetch</Item>
- <Item>FileQosBody.PrefetchCount</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PrefetchSize">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>PrefetchSize</Item>
- </Issue>
- </Message>
- <Message Id="Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Prefetch</Item>
- <Item>FileQosBody.PrefetchSize</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileQosOkBody">
- <Messages>
- <Message Id="Qos" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qos</Item>
- <Item>Qpid.Framing.FileQosOkBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileQosOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileQosOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileQosOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileQosOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileQosOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileRejectBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileRejectBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileRejectBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt64,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Requeue</Item>
- </Issue>
- </Message>
- <Message Id="2#Requeue" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>FileRejectBody.CreateAMQFrame(UInt16, UInt64, Boolean):AMQFrame</Item>
- <Item>Requeue</Item>
- <Item>Requeue</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileRejectBody.CreateAMQFrame(UInt16, UInt64, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeliveryTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileRejectBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileRejectBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Requeue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Requeue</Item>
- </Issue>
- </Message>
- <Message Id="Requeue" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Requeue</Item>
- <Item>FileRejectBody.Requeue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileReturnBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileReturnBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileReturnBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.String,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileReturnBody.CreateAMQFrame(UInt16, UInt16, String, String, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileReturnBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileReturnBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyCode">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyText">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RoutingKey">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="FileStageBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileStageBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileStageBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileStageBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>FileStageBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>FileStageBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="HeartbeatBody">
- <Members>
- <Member Name="FRAME">
- <Messages>
- <Message TypeName="NonConstantFieldsShouldNotBeVisible" Category="Microsoft.Usage" CheckId="CA2211" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>FRAME</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PopulateFromBuffer(Qpid.Buffer.ByteBuffer,System.UInt32):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>HeartbeatBody.PopulateFromBuffer(ByteBuffer, UInt32):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="TYPE">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>HeartbeatBody.TYPE</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="HeartbeatBodyFactory">
- <Members>
- <Member Name="CreateBody(Qpid.Buffer.ByteBuffer):Qpid.Framing.IBody">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>input</Item>
- <Item>HeartbeatBodyFactory.CreateBody(ByteBuffer):IBody</Item>
- <Item>inbuf</Item>
- <Item>IBodyFactory.CreateBody(ByteBuffer):IBody</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IBodyFactory">
- <Members>
- <Member Name="CreateBody(Qpid.Buffer.ByteBuffer):Qpid.Framing.IBody">
- <Messages>
- <Message Id="0#inbuf" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IBodyFactory.CreateBody(ByteBuffer):IBody</Item>
- <Item>inbuf</Item>
- <Item>inbuf</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IEncodableAMQDataBlock">
- <Messages>
- <Message TypeName="AvoidEmptyInterfaces" Category="Microsoft.Design" CheckId="CA1040" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IEncodableAMQDataBlock</Item>
- </Issue>
- </Message>
- <Message TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>IEncodableAMQDataBlock</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="MainRegistry">
- <Messages>
- <Message TypeName="AvoidUninstantiatedInternalClasses" Category="Microsoft.Performance" CheckId="CA1812" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Framing.MainRegistry</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="MethodBodyDecoderRegistry">
- <Messages>
- <Message TypeName="StaticHolderTypesShouldNotHaveConstructors" Category="Microsoft.Design" CheckId="CA1053" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MethodBodyDecoderRegistry</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".cctor()">
- <Messages>
- <Message TypeName="InitializeReferenceTypeStaticFieldsInline" Category="Microsoft.Performance" CheckId="CA1810" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Framing.MethodBodyDecoderRegistry</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Get(System.Int32,System.Int32):Qpid.Framing.AMQMethodBody">
- <Messages>
- <Message Id="Qpid.Framing.AMQFrameDecodingException.#ctor(log4net.ILog,System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MethodBodyDecoderRegistry.Get(Int32, Int32):AMQMethodBody</Item>
- <Item>2</Item>
- <Item>AMQFrameDecodingException.AMQFrameDecodingException(ILog, String)</Item>
- <Item>Unable to find a suitable decoder for class ____ and method __</Item>
- </Issue>
- </Message>
- <Message Id="Qpid.Framing.AMQFrameDecodingException.#ctor(log4net.ILog,System.String,System.Exception)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MethodBodyDecoderRegistry.Get(Int32, Int32):AMQMethodBody</Item>
- <Item>2</Item>
- <Item>AMQFrameDecodingException.AMQFrameDecodingException(ILog, String, Exception)</Item>
- <Item>Unable to instantiate body class for class ____ and method ____: __</Item>
- </Issue>
- </Message>
- <Message Id="0#clazz" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>MethodBodyDecoderRegistry.Get(Int32, Int32):AMQMethodBody</Item>
- <Item>clazz</Item>
- <Item>clazz</Item>
- </Issue>
- </Message>
- <Message Id="clazz*1000" TypeName="OperationsShouldNotOverflow" Category="Microsoft.Usage" CheckId="CA2233" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>clazz*1000</Item>
- <Item>MethodBodyDecoderRegistry.Get(Int32, Int32):AMQMethodBody</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ProtocolInitiation">
- <Members>
- <Member Name=".cctor()">
- <Messages>
- <Message TypeName="InitializeReferenceTypeStaticFieldsInline" Category="Microsoft.Performance" CheckId="CA1810" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Framing.ProtocolInitiation</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name=".ctor()">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProtocolInitiation.ProtocolInitiation()</Item>
- <Item>ProtocolMinor</Item>
- <Item>System.Byte</Item>
- <Item>0</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CURRENT_PROTOCOL_VERSION_MAJOR">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CURRENT_PROTOCOL_VERSION_MAJOR</Item>
- </Issue>
- </Message>
- <Message TypeName="NonConstantFieldsShouldNotBeVisible" Category="Microsoft.Usage" CheckId="CA2211" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>CURRENT_PROTOCOL_VERSION_MAJOR</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Header">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Header</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PopulateFromBuffer(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message Id="Qpid.AMQException.#ctor(System.String)" TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProtocolInitiation.PopulateFromBuffer(ByteBuffer):Void</Item>
- <Item>1</Item>
- <Item>AMQException.AMQException(String)</Item>
- <Item>Method not implemented</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>ProtocolInitiation.PopulateFromBuffer(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- <Message Id="buffer" TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801" Created="2006-12-04 13:11:47Z" FixCategory="Breaking">
- <Issue>
- <Item>buffer</Item>
- <Item>ProtocolInitiation.PopulateFromBuffer(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ProtocolClass">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProtocolClass</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ProtocolInstance">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProtocolInstance</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ProtocolMajor">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProtocolMajor</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ProtocolMinor">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProtocolMinor</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ToString():System.String">
- <Messages>
- <Message Id="System.String.Format(System.String,System.Object[])" TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ProtocolInitiation.ToString():String</Item>
- <Item>System.String.Format(System.String,System.Object[])</Item>
- <Item>System.String.Format(System.IFormatProvider,System.String,System.Object[])</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WritePayload(Qpid.Buffer.ByteBuffer):System.Void">
- <Messages>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'buffer'</Item>
- <Item>ProtocolInitiation.WritePayload(ByteBuffer):Void</Item>
- </Issue>
- <Issue>
- <Item>'buffer'</Item>
- <Item>ProtocolInitiation.WritePayload(ByteBuffer):Void</Item>
- </Issue>
- <Issue>
- <Item>'buffer'</Item>
- <Item>ProtocolInitiation.WritePayload(ByteBuffer):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ProtocolInitiation+Decoder">
- <Messages>
- <Message TypeName="NestedTypesShouldNotBeVisible" Category="Microsoft.Design" CheckId="CA1034" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Framing.ProtocolInitiation+Decoder</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor()">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Decoder.Decoder()</Item>
- <Item>_disabled</Item>
- <Item>System.Boolean</Item>
- <Item>false</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Decodable(Qpid.Buffer.ByteBuffer):Qpid.Codec.Demux.MessageDecoderResult">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>inbuf</Item>
- <Item>Decoder.Decodable(ByteBuffer):MessageDecoderResult</Item>
- <Item>buffer</Item>
- <Item>IMessageDecoder.Decodable(ByteBuffer):MessageDecoderResult</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'inbuf'</Item>
- <Item>Decoder.Decodable(ByteBuffer):MessageDecoderResult</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Decode(Qpid.Buffer.ByteBuffer,Qpid.Codec.IProtocolDecoderOutput):Qpid.Codec.Demux.MessageDecoderResult">
- <Messages>
- <Message Id="0#" TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>inbuf</Item>
- <Item>Decoder.Decode(ByteBuffer, IProtocolDecoderOutput):MessageDecoderResult</Item>
- <Item>buffer</Item>
- <Item>IMessageDecoder.Decode(ByteBuffer, IProtocolDecoderOutput):MessageDecoderResult</Item>
- </Issue>
- </Message>
- <Message TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>'inbuf'</Item>
- <Item>Decoder.Decode(ByteBuffer, IProtocolDecoderOutput):MessageDecoderResult</Item>
- </Issue>
- <Issue>
- <Item>'output'</Item>
- <Item>Decoder.Decode(ByteBuffer, IProtocolDecoderOutput):MessageDecoderResult</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Disabled">
- <Messages>
- <Message TypeName="PropertiesShouldNotBeWriteOnly" Category="Microsoft.Design" CheckId="CA1044" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Disabled</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QueueBindBody">
- <Members>
- <Member Name="Arguments">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Arguments</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueBindBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueBindBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.String,System.String,System.Boolean,Qpid.Framing.FieldTable):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Queue</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="6#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Arguments</Item>
- </Issue>
- </Message>
- <Message Id="5#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>QueueBindBody.CreateAMQFrame(UInt16, UInt16, String, String, String, Boolean, FieldTable):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueBindBody.CreateAMQFrame(UInt16, UInt16, String, String, String, Boolean, FieldTable):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueBindBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueBindBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>QueueBindBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Queue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Queue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RoutingKey">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QueueBindOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueBindOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueBindOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueBindOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueBindOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueBindOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QueueDeclareBody">
- <Members>
- <Member Name="Arguments">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Arguments</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="AutoDelete">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>AutoDelete</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeclareBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueDeclareBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,Qpid.Framing.FieldTable):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Queue</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Passive</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Durable</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exclusive</Item>
- </Issue>
- </Message>
- <Message Id="6#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>AutoDelete</Item>
- </Issue>
- </Message>
- <Message Id="7#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="8#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Arguments</Item>
- </Issue>
- </Message>
- <Message Id="7#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>QueueDeclareBody.CreateAMQFrame(UInt16, UInt16, String, Boolean, Boolean, Boolean, Boolean, Boolean, FieldTable):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeclareBody.CreateAMQFrame(UInt16, UInt16, String, Boolean, Boolean, Boolean, Boolean, Boolean, FieldTable):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Durable">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Durable</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exclusive">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exclusive</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeclareBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueDeclareBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>QueueDeclareBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Passive">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Passive</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Queue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Queue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QueueDeclareOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeclareOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueDeclareOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerCount">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerCount</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.UInt32,System.UInt32):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Queue</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>MessageCount</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerCount</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeclareOkBody.CreateAMQFrame(UInt16, String, UInt32, UInt32):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MessageCount">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MessageCount</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeclareOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueDeclareOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Queue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Queue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QueueDeleteBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeleteBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueDeleteBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.Boolean,System.Boolean,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Queue</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IfUnused</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IfEmpty</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="5#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>QueueDeleteBody.CreateAMQFrame(UInt16, UInt16, String, Boolean, Boolean, Boolean):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeleteBody.CreateAMQFrame(UInt16, UInt16, String, Boolean, Boolean, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="IfEmpty">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IfEmpty</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="IfUnused">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IfUnused</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeleteBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueDeleteBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>QueueDeleteBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Queue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Queue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QueueDeleteOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeleteOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueDeleteOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt32):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>MessageCount</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeleteOkBody.CreateAMQFrame(UInt16, UInt32):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MessageCount">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MessageCount</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueueDeleteOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueueDeleteOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QueuePurgeBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueuePurgeBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueuePurgeBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Queue</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="3#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>QueuePurgeBody.CreateAMQFrame(UInt16, UInt16, String, Boolean):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueuePurgeBody.CreateAMQFrame(UInt16, UInt16, String, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueuePurgeBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueuePurgeBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>QueuePurgeBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Queue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Queue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="QueuePurgeOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueuePurgeOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueuePurgeOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt32):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>MessageCount</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueuePurgeOkBody.CreateAMQFrame(UInt16, UInt32):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MessageCount">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MessageCount</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>QueuePurgeOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>QueuePurgeOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="StreamCancelBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamCancelBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamCancelBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="2#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>StreamCancelBody.CreateAMQFrame(UInt16, String, Boolean):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamCancelBody.CreateAMQFrame(UInt16, String, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamCancelBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamCancelBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>StreamCancelBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="StreamCancelOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamCancelOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamCancelOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamCancelOkBody.CreateAMQFrame(UInt16, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamCancelOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamCancelOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="StreamConsumeBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamConsumeBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamConsumeBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.String,System.Boolean,System.Boolean,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Queue</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>NoLocal</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exclusive</Item>
- </Issue>
- </Message>
- <Message Id="6#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="6#Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>StreamConsumeBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean, Boolean):AMQFrame</Item>
- <Item>Nowait</Item>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamConsumeBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exclusive">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exclusive</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamConsumeBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamConsumeBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="NoLocal">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>NoLocal</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Nowait">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Nowait</Item>
- </Issue>
- </Message>
- <Message Id="Nowait" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Nowait</Item>
- <Item>StreamConsumeBody.Nowait</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Queue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Queue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="StreamConsumeOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamConsumeOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamConsumeOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamConsumeOkBody.CreateAMQFrame(UInt16, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamConsumeOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamConsumeOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="StreamDeliverBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamDeliverBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamDeliverBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumerTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.UInt64,System.String,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumerTag</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Queue</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamDeliverBody.CreateAMQFrame(UInt16, String, UInt64, String, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DeliveryTag">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DeliveryTag</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamDeliverBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamDeliverBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Queue">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Queue</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="StreamPublishBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamPublishBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamPublishBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.String,System.Boolean,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Ticket</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Mandatory</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Immediate</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamPublishBody.CreateAMQFrame(UInt16, UInt16, String, String, Boolean, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Immediate">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Immediate</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Mandatory">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Mandatory</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamPublishBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamPublishBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RoutingKey">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Ticket">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Ticket</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="StreamQosBody">
- <Messages>
- <Message Id="Qos" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qos</Item>
- <Item>Qpid.Framing.StreamQosBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamQosBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamQosBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ConsumeRate">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ConsumeRate</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt32,System.UInt16,System.UInt32,System.Boolean):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>PrefetchSize</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>PrefetchCount</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ConsumeRate</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Global</Item>
- </Issue>
- </Message>
- <Message Id="1#Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>StreamQosBody.CreateAMQFrame(UInt16, UInt32, UInt16, UInt32, Boolean):AMQFrame</Item>
- <Item>Prefetch</Item>
- <Item>PrefetchSize</Item>
- </Issue>
- </Message>
- <Message Id="2#Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>StreamQosBody.CreateAMQFrame(UInt16, UInt32, UInt16, UInt32, Boolean):AMQFrame</Item>
- <Item>Prefetch</Item>
- <Item>PrefetchCount</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamQosBody.CreateAMQFrame(UInt16, UInt32, UInt16, UInt32, Boolean):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Global">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Global</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamQosBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamQosBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PrefetchCount">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>PrefetchCount</Item>
- </Issue>
- </Message>
- <Message Id="Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Prefetch</Item>
- <Item>StreamQosBody.PrefetchCount</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="PrefetchSize">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>PrefetchSize</Item>
- </Issue>
- </Message>
- <Message Id="Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Prefetch</Item>
- <Item>StreamQosBody.PrefetchSize</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="StreamQosOkBody">
- <Messages>
- <Message Id="Qos" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qos</Item>
- <Item>Qpid.Framing.StreamQosOkBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamQosOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamQosOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamQosOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamQosOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamQosOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="StreamReturnBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamReturnBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamReturnBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt16,System.String,System.String,System.String):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Exchange</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamReturnBody.CreateAMQFrame(UInt16, UInt16, String, String, String):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Exchange">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Exchange</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>StreamReturnBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>StreamReturnBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyCode">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyCode</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ReplyText">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ReplyText</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="RoutingKey">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>RoutingKey</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TestContentBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestContentBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestContentBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestContentBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestContentBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestContentBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TestContentOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestContentOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestContentOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="ContentChecksum">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>ContentChecksum</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt32):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>ContentChecksum</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestContentOkBody.CreateAMQFrame(UInt16, UInt32):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestContentOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestContentOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TestIntegerBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestIntegerBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestIntegerBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.Byte,System.UInt16,System.UInt32,System.UInt64,System.Byte):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Integer1</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Integer2</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Integer3</Item>
- </Issue>
- </Message>
- <Message Id="4#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Integer4</Item>
- </Issue>
- </Message>
- <Message Id="5#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Operation</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestIntegerBody.CreateAMQFrame(UInt16, Byte, UInt16, UInt32, UInt64, Byte):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Integer1">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Integer1</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Integer2">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Integer2</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Integer3">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Integer3</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Integer4">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Integer4</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestIntegerBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestIntegerBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Operation">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Operation</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TestIntegerOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestIntegerOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestIntegerOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt64):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Result</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestIntegerOkBody.CreateAMQFrame(UInt16, UInt64):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestIntegerOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestIntegerOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Result">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Result</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TestStringBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestStringBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestStringBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.String,System.Byte[],System.Byte):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>String1</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>String2</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Operation</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestStringBody.CreateAMQFrame(UInt16, String, Byte[], Byte):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestStringBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestStringBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Operation">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Operation</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="String1">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>String1</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="String2">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>String2</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TestStringOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestStringOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestStringOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.Byte[]):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Result</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestStringOkBody.CreateAMQFrame(UInt16, Byte[]):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestStringOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestStringOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Result">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Result</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TestTableBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestTableBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestTableBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,Qpid.Framing.FieldTable,System.Byte,System.Byte):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="2#" TypeName="AvoidLanguageSpecificTypeNamesInParameters" Category="Microsoft.Naming" CheckId="CA1718" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IntegerOp</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="AvoidTypeNamesInParameters" Category="Microsoft.Naming" CheckId="CA1720" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IntegerOp</Item>
- </Issue>
- </Message>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Table</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IntegerOp</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>StringOp</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestTableBody.CreateAMQFrame(UInt16, FieldTable, Byte, Byte):AMQFrame</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Op</Item>
- <Item>IntegerOp</Item>
- </Issue>
- </Message>
- <Message Id="3#" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>Op</Item>
- <Item>StringOp</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="IntegerOp">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IntegerOp</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestTableBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestTableBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="StringOp">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>StringOp</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Table">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Table</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TestTableOkBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestTableOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestTableOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,System.UInt64,System.Byte[]):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="1#" TypeName="AvoidLanguageSpecificTypeNamesInParameters" Category="Microsoft.Naming" CheckId="CA1718" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IntegerResult</Item>
- </Issue>
- </Message>
- <Message Id="1#" TypeName="AvoidTypeNamesInParameters" Category="Microsoft.Naming" CheckId="CA1720" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IntegerResult</Item>
- </Issue>
- </Message>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IntegerResult</Item>
- </Issue>
- </Message>
- <Message Id="2#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>StringResult</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestTableOkBody.CreateAMQFrame(UInt16, UInt64, Byte[]):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="IntegerResult">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IntegerResult</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TestTableOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TestTableOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="StringResult">
- <Messages>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>StringResult</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TunnelRequestBody">
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TunnelRequestBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TunnelRequestBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16,Qpid.Framing.FieldTable):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="MetaData" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2006-12-04 13:11:47Z">
- <Issue Name="ShouldBeDiscreteTerm">
- <Item>MetaData</Item>
- <Item>parameter</Item>
- <Item>MetaData</Item>
- <Item>Metadata</Item>
- </Issue>
- </Message>
- <Message Id="1#" TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>MetaData</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TunnelRequestBody.CreateAMQFrame(UInt16, FieldTable):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MetaData">
- <Messages>
- <Message Id="MetaData" TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702" Created="2006-12-04 13:11:47Z">
- <Issue Name="ShouldBeDiscreteTerm">
- <Item>MetaData</Item>
- <Item>field</Item>
- <Item>MetaData</Item>
- <Item>Metadata</Item>
- </Issue>
- </Message>
- <Message TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MetaData</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TunnelRequestBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TunnelRequestBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TxCommitBody">
- <Messages>
- <Message TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Tx</Item>
- <Item>Qpid.Framing.TxCommitBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxCommitBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxCommitBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxCommitBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxCommitBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxCommitBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TxCommitOkBody">
- <Messages>
- <Message TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Tx</Item>
- <Item>Qpid.Framing.TxCommitOkBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxCommitOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxCommitOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxCommitOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxCommitOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxCommitOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TxRollbackBody">
- <Messages>
- <Message TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Tx</Item>
- <Item>Qpid.Framing.TxRollbackBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxRollbackBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxRollbackBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxRollbackBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxRollbackBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxRollbackBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TxRollbackOkBody">
- <Messages>
- <Message TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Tx</Item>
- <Item>Qpid.Framing.TxRollbackOkBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxRollbackOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxRollbackOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxRollbackOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxRollbackOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxRollbackOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TxSelectBody">
- <Messages>
- <Message TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Tx</Item>
- <Item>Qpid.Framing.TxSelectBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxSelectBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxSelectBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxSelectBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxSelectBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxSelectBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="TxSelectOkBody">
- <Messages>
- <Message TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Tx</Item>
- <Item>Qpid.Framing.TxSelectOkBody</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="CLASS_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxSelectOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxSelectOkBody.CLASS_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateAMQFrame(System.UInt16):Qpid.Framing.AMQFrame">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxSelectOkBody.CreateAMQFrame(UInt16):AMQFrame</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="METHOD_ID">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>TxSelectOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>TxSelectOkBody.METHOD_ID</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- </Types>
- </Namespace>
- </Namespaces>
- </Module>
- </Modules>
- </Target>
- <Target Name="$(ProjectDir)/Qpid.Client.Tests/bin/Debug/Qpid.Messaging.dll">
- <Modules>
- <Module Name="qpid.messaging.dll">
- <Messages>
- <Message TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Messaging</Item>
- </Issue>
- </Message>
- <Message TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210" Created="2006-12-04 13:11:47Z">
- <Issue Name="NoStrongName">
- <Item>Qpid.Messaging</Item>
- </Issue>
- </Message>
- </Messages>
- <Namespaces>
- <Namespace Name="Qpid.Messaging">
- <Types>
- <Type Name="AcknowledgeMode">
- <Members>
- <Member Name="DupsOkAcknowledge">
- <Messages>
- <Message Id="Dups" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Dups</Item>
- <Item>AcknowledgeMode.DupsOkAcknowledge</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ChannelLimitReachedException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Messaging.ChannelLimitReachedException</Item>
- <Item>protected ChannelLimitReachedException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Messaging.ChannelLimitReachedException</Item>
- <Item>public ChannelLimitReachedException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Messaging.ChannelLimitReachedException</Item>
- <Item>public ChannelLimitReachedException(String)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Messaging.ChannelLimitReachedException</Item>
- <Item>public ChannelLimitReachedException(String, Exception)</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="ExceptionListenerDelegate">
- <Messages>
- <Message TypeName="IdentifiersShouldNotHaveIncorrectSuffix" Category="Microsoft.Naming" CheckId="CA1711" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Messaging.ExceptionListenerDelegate</Item>
- <Item>Delegate</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="ExchangeClassConstants">
- <Members>
- <Member Name="DIRECT">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeClassConstants.DIRECT</Item>
- </Issue>
- </Message>
- <Message TypeName="UseLiteralsWhereAppropriate" Category="Microsoft.Performance" CheckId="CA1802" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DIRECT</Item>
- <Item>direct</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="HEADERS">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeClassConstants.HEADERS</Item>
- </Issue>
- </Message>
- <Message TypeName="UseLiteralsWhereAppropriate" Category="Microsoft.Performance" CheckId="CA1802" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>HEADERS</Item>
- <Item>headers</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="TOPIC">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeClassConstants.TOPIC</Item>
- </Issue>
- </Message>
- <Message TypeName="UseLiteralsWhereAppropriate" Category="Microsoft.Performance" CheckId="CA1802" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>TOPIC</Item>
- <Item>topic</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ExchangeNameDefaults">
- <Members>
- <Member Name="DIRECT">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeNameDefaults.DIRECT</Item>
- </Issue>
- </Message>
- <Message TypeName="UseLiteralsWhereAppropriate" Category="Microsoft.Performance" CheckId="CA1802" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>DIRECT</Item>
- <Item>amq.direct</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="HEADERS">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeNameDefaults.HEADERS</Item>
- </Issue>
- </Message>
- <Message TypeName="UseLiteralsWhereAppropriate" Category="Microsoft.Performance" CheckId="CA1802" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>HEADERS</Item>
- <Item>amq.match</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="TOPIC">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>ExchangeNameDefaults.TOPIC</Item>
- </Issue>
- </Message>
- <Message TypeName="UseLiteralsWhereAppropriate" Category="Microsoft.Performance" CheckId="CA1802" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>TOPIC</Item>
- <Item>amq.topic</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IBytesMessage">
- <Members>
- <Member Name="ReadUTF():System.String">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>IBytesMessage.ReadUTF():String</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WriteUTF(System.String):System.Void">
- <Messages>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>IBytesMessage.WriteUTF(String):Void</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IChannel">
- <Members>
- <Member Name="CreateConsumer(System.String,System.Int32,System.Int32,System.Boolean,System.Boolean,System.Boolean,System.String):Qpid.Messaging.IMessageConsumer">
- <Messages>
- <Message Id="1#prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IChannel.CreateConsumer(String, Int32, Int32, Boolean, Boolean, Boolean, String):IMessageConsumer</Item>
- <Item>prefetch</Item>
- <Item>prefetchLow</Item>
- </Issue>
- </Message>
- <Message Id="2#prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IChannel.CreateConsumer(String, Int32, Int32, Boolean, Boolean, Boolean, String):IMessageConsumer</Item>
- <Item>prefetch</Item>
- <Item>prefetchHigh</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DefaultPrefetch">
- <Messages>
- <Message Id="Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Prefetch</Item>
- <Item>IChannel.DefaultPrefetch:Int32</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IConnection">
- <Members>
- <Member Name="ClientID">
- <Messages>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>IConnection.ClientID:String</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="CreateChannel(System.Boolean,Qpid.Messaging.AcknowledgeMode,System.Int32):Qpid.Messaging.IChannel">
- <Messages>
- <Message Id="2#prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>IConnection.CreateChannel(Boolean, AcknowledgeMode, Int32):IChannel</Item>
- <Item>prefetch</Item>
- <Item>prefetch</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IConnectionListener">
- <Members>
- <Member Name="PreResubscribe():System.Boolean">
- <Messages>
- <Message Id="Resubscribe" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Resubscribe</Item>
- <Item>IConnectionListener.PreResubscribe():Boolean</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IFieldTable">
- <Messages>
- <Message TypeName="IdentifiersShouldHaveCorrectSuffix" Category="Microsoft.Naming" CheckId="CA1710" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Messaging.IFieldTable</Item>
- <Item>Collection</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name="Contains(System.String):System.Boolean">
- <Messages>
- <Message Id="0#s" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>IFieldTable.Contains(String):Boolean</Item>
- <Item>s</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IMessage">
- <Members>
- <Member Name="CorrelationIdAsBytes">
- <Messages>
- <Message TypeName="PropertiesShouldNotReturnArrays" Category="Microsoft.Performance" CheckId="CA1819" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>IMessage.CorrelationIdAsBytes:Byte[]</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="IMessagePublisher">
- <Members>
- <Member Name="DisableMessageID">
- <Messages>
- <Message Id="Member" TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706" Created="2006-12-04 13:11:47Z">
- <Issue Name="MemberId">
- <Item>IMessagePublisher.DisableMessageID:Boolean</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="Encoding">
- <Messages>
- <Message TypeName="PropertiesShouldNotBeWriteOnly" Category="Microsoft.Design" CheckId="CA1044" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Encoding</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="MimeType">
- <Messages>
- <Message TypeName="PropertiesShouldNotBeWriteOnly" Category="Microsoft.Design" CheckId="CA1044" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MimeType</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="MessageConsumerBuilder">
- <Members>
- <Member Name=".ctor(Qpid.Messaging.IChannel,System.String)">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MessageConsumerBuilder.MessageConsumerBuilder(IChannel, String)</Item>
- <Item>_durable</Item>
- <Item>System.Boolean</Item>
- <Item>false</Item>
- </Issue>
- <Issue>
- <Item>MessageConsumerBuilder.MessageConsumerBuilder(IChannel, String)</Item>
- <Item>_exclusive</Item>
- <Item>System.Boolean</Item>
- <Item>false</Item>
- </Issue>
- <Issue>
- <Item>MessageConsumerBuilder.MessageConsumerBuilder(IChannel, String)</Item>
- <Item>_noLocal</Item>
- <Item>System.Boolean</Item>
- <Item>false</Item>
- </Issue>
- <Issue>
- <Item>MessageConsumerBuilder.MessageConsumerBuilder(IChannel, String)</Item>
- <Item>_subscriptionName</Item>
- <Item>System.String</Item>
- <Item>null</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="DEFAULT_PREFETCH_HIGH">
- <Messages>
- <Message Id="Member" TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>DEFAULT_PREFETCH_HIGH</Item>
- </Issue>
- </Message>
- <Message Id="Member" TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>MessageConsumerBuilder.DEFAULT_PREFETCH_HIGH</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WithPrefetchHigh(System.Int32):Qpid.Messaging.MessageConsumerBuilder">
- <Messages>
- <Message Id="0#prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>MessageConsumerBuilder.WithPrefetchHigh(Int32):MessageConsumerBuilder</Item>
- <Item>prefetch</Item>
- <Item>prefetchHigh</Item>
- </Issue>
- </Message>
- <Message Id="Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Prefetch</Item>
- <Item>MessageConsumerBuilder.WithPrefetchHigh(Int32):MessageConsumerBuilder</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- <Member Name="WithPrefetchLow(System.Int32):Qpid.Messaging.MessageConsumerBuilder">
- <Messages>
- <Message Id="0#prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Parameter">
- <Item>MessageConsumerBuilder.WithPrefetchLow(Int32):MessageConsumerBuilder</Item>
- <Item>prefetch</Item>
- <Item>prefetchLow</Item>
- </Issue>
- </Message>
- <Message Id="Prefetch" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Member">
- <Item>Prefetch</Item>
- <Item>MessageConsumerBuilder.WithPrefetchLow(Int32):MessageConsumerBuilder</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="MessageNotReadableException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Messaging.MessageNotReadableException</Item>
- <Item>protected MessageNotReadableException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Messaging.MessageNotReadableException</Item>
- <Item>public MessageNotReadableException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Messaging.MessageNotReadableException</Item>
- <Item>public MessageNotReadableException(String, Exception)</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="MessageNotWriteableException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Messaging.MessageNotWriteableException</Item>
- <Item>protected MessageNotWriteableException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Messaging.MessageNotWriteableException</Item>
- <Item>public MessageNotWriteableException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Messaging.MessageNotWriteableException</Item>
- <Item>public MessageNotWriteableException(String, Exception)</Item>
- </Issue>
- </Message>
- <Message Id="Writeable" TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Writeable</Item>
- <Item>MessageNotWriteableException</Item>
- <Item>Writable</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="MessagePublisherBuilder">
- <Members>
- <Member Name=".ctor(Qpid.Messaging.IChannel)">
- <Messages>
- <Message TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>MessagePublisherBuilder.MessagePublisherBuilder(IChannel)</Item>
- <Item>_exchangeName</Item>
- <Item>System.String</Item>
- <Item>null</Item>
- </Issue>
- <Issue>
- <Item>MessagePublisherBuilder.MessagePublisherBuilder(IChannel)</Item>
- <Item>_immediate</Item>
- <Item>System.Boolean</Item>
- <Item>false</Item>
- </Issue>
- <Issue>
- <Item>MessagePublisherBuilder.MessagePublisherBuilder(IChannel)</Item>
- <Item>_priority</Item>
- <Item>System.Int32</Item>
- <Item>0</Item>
- </Issue>
- <Issue>
- <Item>MessagePublisherBuilder.MessagePublisherBuilder(IChannel)</Item>
- <Item>_routingKey</Item>
- <Item>System.String</Item>
- <Item>null</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="MessageReceivedDelegate">
- <Messages>
- <Message TypeName="IdentifiersShouldNotHaveIncorrectSuffix" Category="Microsoft.Naming" CheckId="CA1711" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Messaging.MessageReceivedDelegate</Item>
- <Item>Delegate</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- <Type Name="QpidException">
- <Messages>
- <Message Id="Qpid" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="Type">
- <Item>Qpid</Item>
- <Item>Qpid.Messaging.QpidException</Item>
- </Issue>
- </Message>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Messaging.QpidException</Item>
- <Item>protected QpidException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Messaging.QpidException</Item>
- <Item>public QpidException()</Item>
- </Issue>
- </Message>
- <Message TypeName="MarkISerializableTypesWithSerializable" Category="Microsoft.Usage" CheckId="CA2237" Created="2006-12-04 13:11:47Z">
- <Issue Level="Error">
- <Item>QpidException</Item>
- </Issue>
- </Message>
- </Messages>
- <Members>
- <Member Name=".ctor(System.String,System.Exception)">
- <Messages>
- <Message Id="1#e" TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704" Created="2006-12-04 13:11:47Z">
- <Issue Name="ParameterOneLetter">
- <Item>QpidException.QpidException(String, Exception)</Item>
- <Item>e</Item>
- </Issue>
- </Message>
- </Messages>
- </Member>
- </Members>
- </Type>
- <Type Name="ResourceAllocationException">
- <Messages>
- <Message TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032" Created="2006-12-04 13:11:47Z">
- <Issue>
- <Item>Qpid.Messaging.ResourceAllocationException</Item>
- <Item>protected ResourceAllocationException(SerializationInfo, StreamingContext)</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Messaging.ResourceAllocationException</Item>
- <Item>public ResourceAllocationException()</Item>
- </Issue>
- <Issue>
- <Item>Qpid.Messaging.ResourceAllocationException</Item>
- <Item>public ResourceAllocationException(String, Exception)</Item>
- </Issue>
- </Message>
- </Messages>
- </Type>
- </Types>
- </Namespace>
- </Namespaces>
- </Module>
- </Modules>
- </Target>
- </Targets>
- <Rules>
- <Rule TypeName="AbstractTypesShouldNotHaveConstructors" Category="Microsoft.Design" CheckId="CA1012">
- <Resolution Name="Default">Change the accessibility of all public constructors in '{0}' to protected.</Resolution>
- </Rule>
- <Rule TypeName="AssembliesShouldDeclareMinimumSecurity" Category="Microsoft.Usage" CheckId="CA2209">
- <Resolution Name="Default">No valid permission requests were found for assembly '{0}'. You should always specify the minimum security permissions using SecurityAction.RequestMinimum.</Resolution>
- </Rule>
- <Rule TypeName="AssembliesShouldHaveValidStrongNames" Category="Microsoft.Design" CheckId="CA2210">
- <Resolution Name="NoStrongName">Sign '{0}' with a strong name key.</Resolution>
- </Rule>
- <Rule TypeName="AvoidEmptyInterfaces" Category="Microsoft.Design" CheckId="CA1040">
- <Resolution Name="Default">Define a custom attribute to replace '{0}'.</Resolution>
- </Rule>
- <Rule TypeName="AvoidLanguageSpecificTypeNamesInParameters" Category="Microsoft.Naming" CheckId="CA1718">
- <Resolution Name="Default">Use a generic name for parameter '{0}'. If this is not possible, replace the type identifier with a universal type name.</Resolution>
- </Rule>
- <Rule TypeName="AvoidNamespacesWithFewTypes" Category="Microsoft.Design" CheckId="CA1020">
- <Resolution Name="Default">Consider merging the types defined in '{0}' with another namespace.</Resolution>
- </Rule>
- <Rule TypeName="AvoidTypeNamesInParameters" Category="Microsoft.Naming" CheckId="CA1720">
- <Resolution Name="Default">Remove the type identifier from parameter name '{0}'.</Resolution>
- </Rule>
- <Rule TypeName="AvoidUncalledPrivateCode" Category="Microsoft.Performance" CheckId="CA1811">
- <Resolution Name="Default">'{0}' appears to have no upstream public or protected callers.</Resolution>
- </Rule>
- <Rule TypeName="AvoidUninstantiatedInternalClasses" Category="Microsoft.Performance" CheckId="CA1812">
- <Resolution Name="Default">'{0}' is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static methods, consider adding a private constructor to prevent the compiler from generating a default constructor.</Resolution>
- </Rule>
- <Rule TypeName="AvoidUnnecessaryStringCreation" Category="Microsoft.Performance" CheckId="CA1807">
- <Resolution Name="UseStringCompareLocal">{0} calls {1} after converting '{2}', a local, to upper or lowercase. If possible, eliminate the string creation and call the overload of String.Compare that performs a case-insensitive comparison.</Resolution>
- <Resolution Name="UseStringCompareParameter">{0} calls {1} after converting '{2}', a parameter, to upper or lowercase. If possible, eliminate the string creation and call the overload of String.Compare that performs a case-insensitive comparison.</Resolution>
- </Rule>
- <Rule TypeName="AvoidUnusedPrivateFields" Category="Microsoft.Performance" CheckId="CA1823">
- <Resolution Name="Default">It appears that field '{0}' is never used or is only ever assigned to. Use this field or remove it.</Resolution>
- </Rule>
- <Rule TypeName="CollectionsShouldImplementGenericInterface" Category="Microsoft.Design" CheckId="CA1010">
- <Resolution Name="Default">'{0}' appears to be a non-generic, strongly typed collection. Add an implementation to the instance of {1}&lt;T&gt; where T is {0}'s underlying element type.</Resolution>
- </Rule>
- <Rule TypeName="CompoundWordsShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1702">
- <Resolution Name="ShouldBeCompoundWord">The discrete term '{0}' in {1} '{2}' should be expressed as a compound term, '{3}'.</Resolution>
- <Resolution Name="ShouldBeDiscreteTerm">The compound word '{0}' in {1} '{2}' exists as a discrete term. If your usage is intended to be single word, case it as '{3}'.</Resolution>
- </Rule>
- <Rule TypeName="ConsiderPassingBaseTypesAsParameters" Category="Microsoft.Design" CheckId="CA1011">
- <Resolution Name="Default">Consider changing the type of parameter '{0}' in {1} from {2} to its base type {3}. This method appears to only require base class members in its implementation. Suppress this violation if there is a compelling reason to require the more derived type in the method signature.</Resolution>
- </Rule>
- <Rule TypeName="DoNotCastUnnecessarily" Category="Microsoft.Performance" CheckId="CA1800">
- <Resolution Name="Local">'{0}', a local, is cast to type '{1}' multiple times in method {2}. Cache the result of the 'as' operator or direct cast in order to eliminate the redundant {3} instruction.</Resolution>
- <Resolution Name="Parameter">'{0}', a parameter, is cast to type '{1}' multiple times in method {2}. Cache the result of the 'as' operator or direct cast in order to eliminate the redundant {3} instruction.</Resolution>
- </Rule>
- <Rule TypeName="DoNotCatchGeneralExceptionTypes" Category="Microsoft.Design" CheckId="CA1031">
- <Resolution Name="Default">Modify '{0}' to catch a more specific exception than '{1}' or rethrow the exception.</Resolution>
- </Rule>
- <Rule TypeName="DoNotConcatenateStringsInsideLoops" Category="Microsoft.Performance" CheckId="CA1818">
- <Resolution Name="Default">Change {0} to use StringBuilder instead of String.Concat or +=</Resolution>
- </Rule>
- <Rule TypeName="DoNotDeclareReadOnlyMutableReferenceTypes" Category="Microsoft.Security" CheckId="CA2104">
- <Resolution Name="Default">Remove the readonly declaration from '{0}' or change the field to one that is an immutable reference type. If the reference type '{1}' is, in fact, immutable, exclude this message.</Resolution>
- </Rule>
- <Rule TypeName="DoNotDeclareVisibleInstanceFields" Category="Microsoft.Design" CheckId="CA1051">
- <Resolution Name="Default">Make '{0}' private or internal (Friend in VB, public private in C++) and provide a public or protected property to access it.</Resolution>
- </Rule>
- <Rule TypeName="DoNotIgnoreMethodResults" Category="Microsoft.Usage" CheckId="CA1806">
- <Resolution Name="ObjectCreation">{0} creates an instance of {1} which is either not assigned to a variable or is never used. Remove the object creation if it is unnecessary or use it within the method.</Resolution>
- </Rule>
- <Rule TypeName="DoNotInitializeUnnecessarily" Category="Microsoft.Performance" CheckId="CA1805">
- <Resolution Name="Default">{0} initializes field {1} of type {2} to {3}. Remove this initialization as it will be done automatically by the runtime.</Resolution>
- </Rule>
- <Rule TypeName="DoNotPassLiteralsAsLocalizedParameters" Category="Microsoft.Globalization" CheckId="CA1303">
- <Resolution Name="Default">{0} passes a literal as parameter {1} of a call to {2}. Retrieve the following string argument from a resource table instead: '{3}'</Resolution>
- </Rule>
- <Rule TypeName="DoNotRaiseReservedExceptionTypes" Category="Microsoft.Usage" CheckId="CA2201">
- <Resolution Name="TooGeneric">{0} creates an exception of type '{1}', an exception type that is not sufficiently specific and should never be raised by user code. If this exception instance might be thrown, use a different exception type.</Resolution>
- </Rule>
- <Rule TypeName="ExceptionsShouldBePublic" Category="Microsoft.Design" CheckId="CA1064">
- <Resolution Name="Default">Make exception class {0} public.</Resolution>
- </Rule>
- <Rule TypeName="ICollectionImplementationsHaveStronglyTypedMembers" Category="Microsoft.Design" CheckId="CA1035">
- <Resolution Name="Default">'{0}' should provide a strongly typed implementation of ICollection.CopyTo.</Resolution>
- </Rule>
- <Rule TypeName="IdentifiersShouldBeCasedCorrectly" Category="Microsoft.Naming" CheckId="CA1709">
- <Resolution Name="Member">Correct the casing of member name '{0}'.</Resolution>
- <Resolution Name="Namespace">Correct the casing of namespace name '{0}'.</Resolution>
- <Resolution Name="Parameter">Correct the casing of parameter name '{0}'.</Resolution>
- </Rule>
- <Rule TypeName="IdentifiersShouldBeSpelledCorrectly" Category="Microsoft.Naming" CheckId="CA1704">
- <Resolution Name="Member">Correct the spelling of the unrecognized token '{0}' in member name '{1}'.</Resolution>
- <Resolution Name="Namespace">Correct the spelling of the unrecognized token '{0}' in namespace '{1}'.</Resolution>
- <Resolution Name="Parameter">In method {0}, correct the spelling of the unrecognized token '{1}' in parameter name '{2}' or strip it entirely if it represents any sort of hungarian notation.</Resolution>
- <Resolution Name="ParameterOneLetter">In method {0}, consider providing a more meaningful name than the one-letter parameter name '{1}'.</Resolution>
- <Resolution Name="Type">Correct the spelling of the unrecognized token '{0}' in type name '{1}'.</Resolution>
- </Rule>
- <Rule TypeName="IdentifiersShouldDifferByMoreThanCase" Category="Microsoft.Naming" CheckId="CA1708">
- <Resolution Name="Member">Change member names {0} and '{1}' so that they differ by more than case.</Resolution>
- </Rule>
- <Rule TypeName="IdentifiersShouldHaveCorrectPrefix" Category="Microsoft.Naming" CheckId="CA1715">
- <Resolution Name="Default">Prefix interface name '{0}' with 'I'.</Resolution>
- </Rule>
- <Rule TypeName="IdentifiersShouldHaveCorrectSuffix" Category="Microsoft.Naming" CheckId="CA1710">
- <Resolution Name="Default">Rename '{0}' to end in '{1}'.</Resolution>
- </Rule>
- <Rule TypeName="IdentifiersShouldNotContainUnderscores" Category="Microsoft.Naming" CheckId="CA1707">
- <Resolution Name="Member">Remove all underscores from member '{0}'.</Resolution>
- </Rule>
- <Rule TypeName="IdentifiersShouldNotHaveIncorrectSuffix" Category="Microsoft.Naming" CheckId="CA1711">
- <Resolution Name="Default">Rename '{0}' so that it does not end in '{1}'.</Resolution>
- </Rule>
- <Rule TypeName="ImplementIDisposableCorrectly" Category="Microsoft.Design" CheckId="CA1063">
- <Resolution Name="DisposeImplementation">Modify {0} so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance ('this' or 'Me' in VB), and then returns.</Resolution>
- <Resolution Name="ProvideDisposeBool">Provide an overridable implementation of Dispose(bool) on {0} or mark the type as sealed. A call to Dispose(false) should only clean up native resources. A call to Dispose(true) should clean up both managed and native resources.</Resolution>
- </Rule>
- <Rule TypeName="ImplementStandardExceptionConstructors" Category="Microsoft.Design" CheckId="CA1032">
- <Resolution Name="Default">Add the following constructor to {0}: {1}.</Resolution>
- </Rule>
- <Rule TypeName="InitializeReferenceTypeStaticFieldsInline" Category="Microsoft.Performance" CheckId="CA1810">
- <Resolution Name="Default">Initialize all static fields in {0} when those fields are declared and remove the explicit static constructor.</Resolution>
- </Rule>
- <Rule TypeName="InstantiateArgumentExceptionsCorrectly" Category="Microsoft.Usage" CheckId="CA2208">
- <Resolution Name="OneArgumentShouldBeParameterName">Calls to {0}'s constructor '{1}' should contain one of the method's parameter names instead of '{2}'. Note that the provided parameter name should have the exact casing as declared on the method.</Resolution>
- </Rule>
- <Rule TypeName="LiteralsShouldBeSpelledCorrectly" Category="Microsoft.Usage" CheckId="CA2204">
- <Resolution Name="Default">Correct the spelling of the unrecognized token '{0}' in the literal '{1}'.</Resolution>
- </Rule>
- <Rule TypeName="LongAcronymsShouldBePascalCased" Category="Microsoft.Naming" CheckId="CA1705">
- <Resolution Name="Member">Correct the capitalization of member name '{0}'.</Resolution>
- <Resolution Name="Parameter">Correct the capitalization of parameter name '{0}'.</Resolution>
- <Resolution Name="Type">Correct the capitalization of type name '{0}'.</Resolution>
- </Rule>
- <Rule TypeName="MarkAssembliesWithClsCompliant" Category="Microsoft.Design" CheckId="CA1014">
- <Resolution Name="NoAttr">'{0}' should be marked with CLSCompliantAttribute and its value should be true.</Resolution>
- </Rule>
- <Rule TypeName="MarkISerializableTypesWithSerializable" Category="Microsoft.Usage" CheckId="CA2237">
- <Resolution Name="Default">Add [Serializable] to '{0}' as this type implements ISerializable.</Resolution>
- </Rule>
- <Rule TypeName="MarkMembersAsStatic" Category="Microsoft.Performance" CheckId="CA1822">
- <Resolution Name="Default">The 'this' parameter (or 'Me' in VB) of {0} is never used. Mark the member as static (or Shared in VB) or use 'this'/'Me' in the method body or at least one property accessor, if appropriate.</Resolution>
- </Rule>
- <Rule TypeName="NestedTypesShouldNotBeVisible" Category="Microsoft.Design" CheckId="CA1034">
- <Resolution Name="Default">Do not nest type '{0}'. Alternatively, change its accessibility so that it is not externally visible.</Resolution>
- </Rule>
- <Rule TypeName="NonConstantFieldsShouldNotBeVisible" Category="Microsoft.Usage" CheckId="CA2211">
- <Resolution Name="Default">Consider making '{0}' non-public or a constant.</Resolution>
- </Rule>
- <Rule TypeName="OperationsShouldNotOverflow" Category="Microsoft.Usage" CheckId="CA2233">
- <Resolution Name="Default">Correct the potential overflow in the operation '{0}' in '{1}'.</Resolution>
- </Rule>
- <Rule TypeName="ParameterNamesShouldMatchBaseDeclaration" Category="Microsoft.Naming" CheckId="CA1725">
- <Resolution Name="Default">Change parameter name '{0}' of method {1} to '{2}' in order to match the identifier as it has been declared in {3}.</Resolution>
- </Rule>
- <Rule TypeName="PropertiesShouldNotBeWriteOnly" Category="Microsoft.Design" CheckId="CA1044">
- <Resolution Name="Default">Add a property getter to '{0}'.</Resolution>
- </Rule>
- <Rule TypeName="PropertiesShouldNotReturnArrays" Category="Microsoft.Performance" CheckId="CA1819">
- <Resolution Name="Default">Change {0} to return a collection or make it a method.</Resolution>
- </Rule>
- <Rule TypeName="ProvideCorrectArgumentsToFormattingMethods" Category="Microsoft.Usage" CheckId="CA2241">
- <Resolution Name="MissingSpecifier">A call to {0} in {1} does not appear to provide a format specifier for argument {2}. The complete format string provided is '{3}'.</Resolution>
- </Rule>
- <Rule TypeName="RemoveUnusedLocals" Category="Microsoft.Performance" CheckId="CA1804">
- <Resolution Name="Default">{0} declares a local, '{1}', of type {2}, which is never used or is only assigned to. Use this local or remove it.</Resolution>
- </Rule>
- <Rule TypeName="RethrowToPreserveStackDetails" Category="Microsoft.Usage" CheckId="CA2200">
- <Resolution Name="Default">{0} rethrows a caught exception and specifies it explicitly as an argument. Use 'throw' without an argument instead, in order to preserve the stack location where the exception was initially raised.</Resolution>
- </Rule>
- <Rule TypeName="ReviewUnusedParameters" Category="Microsoft.Usage" CheckId="CA1801">
- <Resolution Name="Default">Parameter '{0}' of {1} is never used. Remove the parameter or use it in the method body.</Resolution>
- </Rule>
- <Rule TypeName="ShortAcronymsShouldBeUppercase" Category="Microsoft.Naming" CheckId="CA1706">
- <Resolution Name="MemberId">'Id' is an abbreviation and therefore is not subject to acronym casing guidelines. Correct the capitalization of 'ID' in member name '{0}' by changing it to 'Id'.</Resolution>
- <Resolution Name="MemberOk">To insure consistency with legacy api, 'OK' is not subject to acronym casing guidelines. Correct the capitalization of 'OK' in member name '{0}' by changing it to 'Ok'.</Resolution>
- <Resolution Name="Parameter">Correct the capitalization of '{0}' in parameter name '{1}'.</Resolution>
- <Resolution Name="Type">Correct the capitalization of '{0}' in type name '{1}'.</Resolution>
- </Rule>
- <Rule TypeName="SpecifyCultureInfo" Category="Microsoft.Globalization" CheckId="CA1304">
- <Resolution Name="Default">{0} makes a call to {1} that does not explicitly provide a CultureInfo. This should be replaced with a call to {2}.</Resolution>
- </Rule>
- <Rule TypeName="SpecifyIFormatProvider" Category="Microsoft.Globalization" CheckId="CA1305">
- <Resolution Name="Default">{0} makes a call to {1} that does not explicitly provide an IFormatProvider. This should be replaced with a call to {2}.</Resolution>
- </Rule>
- <Rule TypeName="StaticHolderTypesShouldNotHaveConstructors" Category="Microsoft.Design" CheckId="CA1053">
- <Resolution Name="Default">Remove the public constructors from '{0}'.</Resolution>
- </Rule>
- <Rule TypeName="TestForEmptyStringsUsingStringLength" Category="Microsoft.Performance" CheckId="CA1820">
- <Resolution Name="IsNullOrEmpty">Replace the call to String.{0}({1}) in '{2}' with a call to String.IsNullOrEmpty.</Resolution>
- </Rule>
- <Rule TypeName="TypesThatOwnDisposableFieldsShouldBeDisposable" Category="Microsoft.Design" CheckId="CA1001">
- <Resolution Name="Default">Implement IDisposable on '{0}' as it instantiates members of the following IDisposable types: {1}</Resolution>
- </Rule>
- <Rule TypeName="UriParametersShouldNotBeStrings" Category="Microsoft.Design" CheckId="CA1054">
- <Resolution Name="Default">Change the type of parameter '{0}' of method {1} from string to System.Uri, or provide an overload of {1}, that allows '{0}' to be passed as a System.Uri object.</Resolution>
- </Rule>
- <Rule TypeName="UriReturnValuesShouldNotBeStrings" Category="Microsoft.Design" CheckId="CA1055">
- <Resolution Name="Default">Change the return type of {0} from string to System.Uri.</Resolution>
- </Rule>
- <Rule TypeName="UseEventsWhereAppropriate" Category="Microsoft.Design" CheckId="CA1030">
- <Resolution Name="Default">Consider making '{0}' an event.</Resolution>
- </Rule>
- <Rule TypeName="UseLiteralsWhereAppropriate" Category="Microsoft.Performance" CheckId="CA1802">
- <Resolution Name="Default">Field '{0}' is declared as 'static readonly' but is initialized with a constant value '{1}'. Mark this field as 'const' instead.</Resolution>
- </Rule>
- <Rule TypeName="UsePreferredTerms" Category="Microsoft.Naming" CheckId="CA1726">
- <Resolution Name="Type">Replace the term '{0}' in type name '{1}' with the preferred alternate '{2}'.</Resolution>
- </Rule>
- <Rule TypeName="UsePropertiesWhereAppropriate" Category="Microsoft.Design" CheckId="CA1024">
- <Resolution Name="Default">Change '{0}' to a property if appropriate.</Resolution>
- </Rule>
- <Rule TypeName="ValidateArgumentsOfPublicMethods" Category="Microsoft.Design" CheckId="CA1062">
- <Resolution Name="Default">Validate parameter {0} passed to externally visible method {1}.</Resolution>
- </Rule>
- </Rules>
- </FxCopReport>
-</FxCopProject>
diff --git a/M4-RCs/qpid/dotnet/Qpid.NET.sln b/M4-RCs/qpid/dotnet/Qpid.NET.sln
deleted file mode 100644
index 07deccf237..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.NET.sln
+++ /dev/null
@@ -1,96 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qpid.Messaging", "Qpid.Messaging\Qpid.Messaging.csproj", "{6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qpid.Common.Tests", "Qpid.Common.Tests\Qpid.Common.Tests.csproj", "{F83624B0-762B-4D82-900D-FF4C1B36E36E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qpid.Buffer", "Qpid.Buffer\Qpid.Buffer.csproj", "{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qpid.Codec", "Qpid.Codec\Qpid.Codec.csproj", "{22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qpid.Client", "Qpid.Client\Qpid.Client.csproj", "{68987C05-3768-452C-A6FC-6BA1D372852F}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qpid.Common", "Qpid.Common\Qpid.Common.csproj", "{77064C42-24D2-4CEB-9EA2-0EF481A43205}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qpid.Client.Tests", "Qpid.Client.Tests\Qpid.Client.Tests.csproj", "{BA1B0032-4CE6-40DD-A2DC-119F0FFA0A1D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qpid.Sasl", "Qpid.Sasl\Qpid.Sasl.csproj", "{1465B0EE-6452-42A6-AB73-B2F9EABEEE75}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qpid.Sasl.Tests", "Qpid.Sasl.Tests\Qpid.Sasl.Tests.csproj", "{587B3520-EBB9-41ED-B019-E96116B651CE}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qpid.Buffer.Tests", "Qpid.Buffer.Tests\Qpid.Buffer.Tests.csproj", "{74640962-99D0-4D06-B57A-9CD66517CF52}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TopicPublisher", "TopicPublisher\TopicPublisher.csproj", "{A06C9FFD-22FF-4654-856D-897C230978AF}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TopicListener", "TopicListener\TopicListener.csproj", "{9A112DF2-146F-4CF4-919B-9D3BE7D088E9}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestClient", "TestClient\TestClient.csproj", "{6E0374D9-99BE-4D4F-B41D-B227E37E04C6}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qpid.Integration.Tests", "Qpid.Integration.Tests\Qpid.Integration.Tests.csproj", "{DE21CEBC-F38C-43EA-B576-38CA9738A00A}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}.Release|Any CPU.Build.0 = Release|Any CPU
- {F83624B0-762B-4D82-900D-FF4C1B36E36E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F83624B0-762B-4D82-900D-FF4C1B36E36E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F83624B0-762B-4D82-900D-FF4C1B36E36E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F83624B0-762B-4D82-900D-FF4C1B36E36E}.Release|Any CPU.Build.0 = Release|Any CPU
- {44384DF2-B0A4-4580-BDBC-EE4BAA87D995}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {44384DF2-B0A4-4580-BDBC-EE4BAA87D995}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {44384DF2-B0A4-4580-BDBC-EE4BAA87D995}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {44384DF2-B0A4-4580-BDBC-EE4BAA87D995}.Release|Any CPU.Build.0 = Release|Any CPU
- {22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}.Release|Any CPU.Build.0 = Release|Any CPU
- {68987C05-3768-452C-A6FC-6BA1D372852F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {68987C05-3768-452C-A6FC-6BA1D372852F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {68987C05-3768-452C-A6FC-6BA1D372852F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {68987C05-3768-452C-A6FC-6BA1D372852F}.Release|Any CPU.Build.0 = Release|Any CPU
- {77064C42-24D2-4CEB-9EA2-0EF481A43205}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {77064C42-24D2-4CEB-9EA2-0EF481A43205}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {77064C42-24D2-4CEB-9EA2-0EF481A43205}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {77064C42-24D2-4CEB-9EA2-0EF481A43205}.Release|Any CPU.Build.0 = Release|Any CPU
- {BA1B0032-4CE6-40DD-A2DC-119F0FFA0A1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BA1B0032-4CE6-40DD-A2DC-119F0FFA0A1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BA1B0032-4CE6-40DD-A2DC-119F0FFA0A1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BA1B0032-4CE6-40DD-A2DC-119F0FFA0A1D}.Release|Any CPU.Build.0 = Release|Any CPU
- {1465B0EE-6452-42A6-AB73-B2F9EABEEE75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1465B0EE-6452-42A6-AB73-B2F9EABEEE75}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1465B0EE-6452-42A6-AB73-B2F9EABEEE75}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1465B0EE-6452-42A6-AB73-B2F9EABEEE75}.Release|Any CPU.Build.0 = Release|Any CPU
- {587B3520-EBB9-41ED-B019-E96116B651CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {587B3520-EBB9-41ED-B019-E96116B651CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {587B3520-EBB9-41ED-B019-E96116B651CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {587B3520-EBB9-41ED-B019-E96116B651CE}.Release|Any CPU.Build.0 = Release|Any CPU
- {74640962-99D0-4D06-B57A-9CD66517CF52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {74640962-99D0-4D06-B57A-9CD66517CF52}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {74640962-99D0-4D06-B57A-9CD66517CF52}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {74640962-99D0-4D06-B57A-9CD66517CF52}.Release|Any CPU.Build.0 = Release|Any CPU
- {A06C9FFD-22FF-4654-856D-897C230978AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A06C9FFD-22FF-4654-856D-897C230978AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A06C9FFD-22FF-4654-856D-897C230978AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A06C9FFD-22FF-4654-856D-897C230978AF}.Release|Any CPU.Build.0 = Release|Any CPU
- {9A112DF2-146F-4CF4-919B-9D3BE7D088E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9A112DF2-146F-4CF4-919B-9D3BE7D088E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9A112DF2-146F-4CF4-919B-9D3BE7D088E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9A112DF2-146F-4CF4-919B-9D3BE7D088E9}.Release|Any CPU.Build.0 = Release|Any CPU
- {6E0374D9-99BE-4D4F-B41D-B227E37E04C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6E0374D9-99BE-4D4F-B41D-B227E37E04C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DE21CEBC-F38C-43EA-B576-38CA9738A00A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DE21CEBC-F38C-43EA-B576-38CA9738A00A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DE21CEBC-F38C-43EA-B576-38CA9738A00A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DE21CEBC-F38C-43EA-B576-38CA9738A00A}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/App.config b/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/App.config
deleted file mode 100644
index 021399939e..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/App.config
+++ /dev/null
@@ -1,33 +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.
-
--->
-
-<configuration>
- <configSections>
- <section name="qpid.sasl" type="Apache.Qpid.Sasl.Configuration.SaslConfigurationSectionHandler, Apache.Qpid.Sasl"/>
- </configSections>
-
- <qpid.sasl>
- <clientFactories>
- <add type="Apache.Qpid.Sasl.Tests.TestClientFactory, Apache.Qpid.Sasl.Tests"/>
- </clientFactories>
- </qpid.sasl>
-</configuration>
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/AnonymousSaslClientTests.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/AnonymousSaslClientTests.cs
deleted file mode 100644
index 09260736f0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/AnonymousSaslClientTests.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.
- *
- */
-
-using System;
-using System.Collections;
-using System.Text;
-
-using NUnit.Framework;
-using Apache.Qpid.Sasl;
-using Apache.Qpid.Sasl.Mechanisms;
-
-namespace Apache.Qpid.Sasl.Tests.Mechanisms
-{
- [TestFixture]
- public class AnonymousSaslClientTests : ISaslCallbackHandler
- {
- private const string AUTHID = "nobody@nowhere.com";
-
- [Test]
- public void ReturnsRightMechanismName()
- {
- ISaslClient client = new AnonymousSaslClient(AUTHID, new Hashtable(), this);
-
- Assert.AreEqual("ANONYMOUS", client.MechanismName);
- }
-
- [Test]
- public void HasInitialResponseReturnsTrue()
- {
- ISaslClient client = new AnonymousSaslClient(AUTHID, new Hashtable(), this);
-
- Assert.IsTrue(client.HasInitialResponse);
- }
-
- [Test]
- public void CanEvaluateChallenge()
- {
- Hashtable props = new Hashtable();
- ISaslClient client = new AnonymousSaslClient(AUTHID, props, this);
-
- Assert.IsFalse(client.IsComplete);
- byte[] response = client.EvaluateChallenge(new byte[0]);
- Assert.AreEqual(AUTHID, Encoding.UTF8.GetString(response));
-
- Assert.IsTrue(client.IsComplete);
- }
-
- void ISaslCallbackHandler.Handle(ISaslCallback[] callbacks)
- {
- }
-
- } // class AnonymousSaslClientTests
-
-} // namespace Apache.Qpid.Sasl.Tests.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/CramMD5SaslClientTests.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/CramMD5SaslClientTests.cs
deleted file mode 100644
index e8b0ae5468..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/CramMD5SaslClientTests.cs
+++ /dev/null
@@ -1,90 +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;
-using System.Collections;
-using System.Text;
-
-using NUnit.Framework;
-using Apache.Qpid.Sasl;
-using Apache.Qpid.Sasl.Mechanisms;
-
-namespace Apache.Qpid.Sasl.Tests.Mechanisms
-{
- [TestFixture]
- public class CramMD5SaslClientTests : ISaslCallbackHandler
- {
- private const string USERNAME = "testuser";
- private const string PASSWORD = "tanstaaftanstaaf";
- private const string AUTHID = "test";
-
- [Test]
- public void ReturnsRightMechanismName()
- {
- ISaslClient client = new CramMD5SaslClient(AUTHID, new Hashtable(), this);
-
- Assert.AreEqual("CRAM-MD5", client.MechanismName);
- }
-
- [Test]
- public void HasInitialResponseReturnsFalse()
- {
- ISaslClient client = new CramMD5SaslClient(AUTHID, new Hashtable(), this);
-
- Assert.IsFalse(client.HasInitialResponse);
- }
-
- [Test]
- public void CanEvaluateChallenge()
- {
- Hashtable props = new Hashtable();
-
- ISaslClient client = new CramMD5SaslClient(AUTHID, props, this);
-
- Assert.IsFalse(client.IsComplete);
-
- byte[] challenge =
- Encoding.UTF8.GetBytes("<1896.697170952@postoffice.reston.mci.net>");
- byte[] response = client.EvaluateChallenge(challenge);
- string[] parts = Encoding.UTF8.GetString(response).Split(' ');
-
- Assert.AreEqual(2, parts.Length);
- Assert.AreEqual(USERNAME, parts[0]);
- Assert.AreEqual("b913a602c7eda7a495b4e6e7334d3890", parts[1]);
- Assert.IsTrue(client.IsComplete);
- }
-
- void ISaslCallbackHandler.Handle(ISaslCallback[] callbacks)
- {
- foreach ( ISaslCallback cb in callbacks )
- {
- if ( cb is NameCallback )
- {
- ((NameCallback)cb).Text = USERNAME;
- } else if ( cb is PasswordCallback )
- {
- ((PasswordCallback)cb).Text = PASSWORD;
- }
- }
- }
- } // class CramMD5SaslClientTests
-
-} // namespace Apache.Qpid.Sasl.Tests.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/DigestSaslClientTests.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/DigestSaslClientTests.cs
deleted file mode 100644
index eb7e7ebbd5..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/DigestSaslClientTests.cs
+++ /dev/null
@@ -1,249 +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;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Text;
-
-using NUnit.Framework;
-using Apache.Qpid.Sasl;
-using Apache.Qpid.Sasl.Mechanisms;
-
-namespace Apache.Qpid.Sasl.Tests.Mechanisms
-{
- [TestFixture]
- public class DigestSaslClientTests : ISaslCallbackHandler
- {
- private const string USERNAME = "chris";
- private const string PASSWORD = "secret";
- private const string AUTHID = null;
- private const string PROTOCOL = "IMAP";
- private const string SERVERNAME = "elwood.innosoft.com";
-
- #region Digest Challenge Parsing Tests
- //
- // Digest Challenge Parsing Tests
- //
-
- [Test]
- public void CanParseSimpleString()
- {
- string challenge = "realm=\"elwood.innosoft.com\", algorithm=md5-sess";
- StringDictionary values = DigestChallenge.ParseParameters(challenge);
- Assert.AreEqual(2, values.Count);
- Assert.AreEqual("elwood.innosoft.com", values["realm"]);
- Assert.AreEqual("md5-sess", values["algorithm"]);
- }
-
- [Test]
- public void CanParseEscapedQuotes()
- {
- string challenge = "realm=\"elwood\\\".innosoft.com\", algorithm=md5-sess";
- StringDictionary values = DigestChallenge.ParseParameters(challenge);
- Assert.AreEqual(2, values.Count);
- Assert.AreEqual("elwood\\\".innosoft.com", values["realm"]);
- Assert.AreEqual("md5-sess", values["algorithm"]);
- }
-
- [Test]
- public void CanParseEmbeddedDelimiter()
- {
- string challenge = "realm=\"elwood,innosoft.com\", algorithm=md5-sess";
- StringDictionary values = DigestChallenge.ParseParameters(challenge);
- Assert.AreEqual(2, values.Count);
- Assert.AreEqual("elwood,innosoft.com", values["realm"]);
- Assert.AreEqual("md5-sess", values["algorithm"]);
- }
-
- [Test]
- public void CanParse1()
- {
- string challenge = "realm=\"elwood.innosoft.com\",nonce=\"OA6MG9tEQGm2hh\",qop=\"auth\",algorithm=md5-sess,charset=utf-8";
- DigestChallenge parsed = DigestChallenge.Parse(challenge);
-
- Assert.AreEqual("elwood.innosoft.com", parsed.Realm);
- Assert.AreEqual("OA6MG9tEQGm2hh", parsed.Nonce);
- Assert.Contains("auth", parsed.QopOptions);
- Assert.AreEqual("md5-sess", parsed.Algorithm);
- Assert.AreEqual("utf-8", parsed.Charset);
- }
-
- #endregion // Digest Challenge Parsing Tests
-
-
- #region Digest Response Tests
- //
- // Digest Response Tests
- //
-
- [Test]
- public void CanWriteResponse()
- {
- DigestResponse resp = new DigestResponse();
- resp.Username = "user";
- resp.Realm = "nowhere.com";
- resp.Nonce = "OA9BSXrbuRhWay";
- resp.Cnonce = "OA9BSuZWMSpW8m";
- resp.NonceCount = 16;
- resp.DigestUri = "acap/elwood.innosoft.com";
- resp.Response = "6084c6db3fede7352c551284490fd0fc";
- resp.Qop = "auth";
- resp.MaxBuffer = 65536;
- resp.Cipher = "3des";
- resp.Authzid = "user2";
- resp.AuthParam = "ap";
- resp.Charset = "utf-8";
-
- string expected = "username=\"user\",realm=\"nowhere.com\",nonce=\"OA9BSXrbuRhWay\",cnonce=\"OA9BSuZWMSpW8m\",nc=00000010,qop=auth,digest-uri=\"acap/elwood.innosoft.com\",response=\"6084c6db3fede7352c551284490fd0fc\",maxbuf=65536,charset=utf-8,cipher=3des,authzid=\"user2\",auth-param=\"ap\"";
- Assert.AreEqual(expected, resp.ToString());
- }
-
- [Test]
- public void CanWriteEscapedSecuence()
- {
- DigestResponse resp = new DigestResponse();
- resp.Username = "us\"er";
-
- string expected = "username=\"us\\\"er\",nc=00000000,maxbuf=0";
- Assert.AreEqual(expected, resp.ToString());
- }
-
- #endregion // Digest Response Tests
-
-
- #region Authentication Tests
- //
- // Authentication Tests
- //
-
- [Test]
- public void ReturnsRightMechanismName()
- {
- ISaslClient client = CreateClient();
-
- Assert.AreEqual("DIGEST-MD5", client.MechanismName);
- }
-
- [Test]
- public void HasInitialResponseReturnsFalse()
- {
- ISaslClient client = CreateClient();
-
- Assert.IsFalse(client.HasInitialResponse);
- }
-
- [Test]
- public void CanAuthenticate()
- {
- string challenge = "realm=\"elwood.innosoft.com\",nonce=\"OA6MG9tEQGm2hh\",qop=\"auth\",algorithm=md5-sess,charset=utf-8";
- DigestSaslClient client = CreateClient();
- client.Cnonce = "OA6MHXh6VqTrRk";
-
- byte[] bresp = client.EvaluateChallenge(Encoding.UTF8.GetBytes(challenge));
- string response = Encoding.UTF8.GetString(bresp);
- string expectedResp = "username=\"chris\",realm=\"elwood.innosoft.com\",nonce=\"OA6MG9tEQGm2hh\",cnonce=\"" +
- client.Cnonce + "\",nc=00000001,qop=auth,digest-uri=\"imap/elwood.innosoft.com\",response=\"d388dad90d4bbd760a152321f2143af7\",maxbuf=65536,charset=utf-8";
-
- Assert.AreEqual(expectedResp, response);
- Assert.IsFalse(client.IsComplete);
-
- string challenge2 = "rspauth=ea40f60335c427b5527b84dbabcdfffd";
- bresp = client.EvaluateChallenge(Encoding.UTF8.GetBytes(challenge2));
- // client responds with zero-length array
- Assert.AreEqual(0, bresp.Length);
- Assert.IsTrue(client.IsComplete);
- }
-
- [Test]
- [ExpectedException(typeof(ArgumentNullException))]
- public void ThrowsExceptionWhenChallengeIsMissing()
- {
- DigestSaslClient client = CreateClient();
- client.EvaluateChallenge(null);
- }
-
-
- [Test]
- [ExpectedException(typeof(SaslException))]
- public void ThrowsExceptionWhenNonceMissing()
- {
- string challenge = "realm=\"elwood.innosoft.com\"";
- DigestSaslClient client = CreateClient();
-
- client.EvaluateChallenge(Encoding.UTF8.GetBytes(challenge));
- }
-
- [Test]
- [ExpectedException(typeof(SaslException))]
- public void ThrowsExceptionWhenAlgorithmMissing()
- {
- string challenge = "realm=\"elwood.innosoft.com\",nonce=\"asdasadsad\"";
- DigestSaslClient client = CreateClient();
-
- client.EvaluateChallenge(Encoding.UTF8.GetBytes(challenge));
- }
-
- [Test]
- [ExpectedException(typeof(SaslException))]
- public void ThrowsExceptionWhenSecondChallengeInvalid()
- {
- string challenge = "realm=\"elwood.innosoft.com\",nonce=\"OA6MG9tEQGm2hh\",qop=\"auth\",algorithm=md5-sess,charset=utf-8";
- DigestSaslClient client = CreateClient();
-
- byte[] bresp = client.EvaluateChallenge(Encoding.UTF8.GetBytes(challenge));
- Encoding.UTF8.GetString(bresp);
-
- // repeat challenge 1, which is incorrect
- client.EvaluateChallenge(Encoding.UTF8.GetBytes(challenge));
- }
-
- private DigestSaslClient CreateClient()
- {
- return new DigestSaslClient(
- AUTHID, SERVERNAME, PROTOCOL,
- new Hashtable(), this
- );
- }
-
- void ISaslCallbackHandler.Handle(ISaslCallback[] callbacks)
- {
- foreach ( ISaslCallback cb in callbacks )
- {
- if ( cb is NameCallback )
- {
- ((NameCallback)cb).Text = USERNAME;
- } else if ( cb is PasswordCallback )
- {
- ((PasswordCallback)cb).Text = PASSWORD;
- } else if ( cb is RealmCallback )
- {
- ((RealmCallback)cb).Text = SERVERNAME;
- }
- }
- }
-
- #endregion // Authentication Tests
-
-
- } // class DigestSaslClientTests
-
-} // namespace Apache.Qpid.Sasl.Tests.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/ExternalSaslClientTests.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/ExternalSaslClientTests.cs
deleted file mode 100644
index 1864a6c957..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/ExternalSaslClientTests.cs
+++ /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.
- *
- */
-
-using System;
-using System.Collections;
-using System.Text;
-
-using NUnit.Framework;
-using Apache.Qpid.Sasl;
-using Apache.Qpid.Sasl.Mechanisms;
-
-namespace Apache.Qpid.Sasl.Tests.Mechanisms
-{
- [TestFixture]
- public class ExternalSaslClientTests : ISaslCallbackHandler
- {
- private const string AUTHID = "nobody@nowhere.com";
-
- [Test]
- public void ReturnsRightMechanismName()
- {
- ISaslClient client = new ExternalSaslClient(AUTHID, new Hashtable(), this);
-
- Assert.AreEqual("EXTERNAL", client.MechanismName);
- }
-
- [Test]
- public void HasInitialResponseReturnsTrue()
- {
- ISaslClient client = new ExternalSaslClient(AUTHID, new Hashtable(), this);
-
- Assert.IsTrue(client.HasInitialResponse);
- }
-
- [Test]
- public void CanEvaluateChallenge()
- {
- ISaslClient client = new ExternalSaslClient(AUTHID, new Hashtable(), this);
-
- Assert.IsFalse(client.IsComplete);
- byte[] response = client.EvaluateChallenge(new byte[0]);
- Assert.AreEqual(AUTHID, Encoding.UTF8.GetString(response));
-
- Assert.IsTrue(client.IsComplete);
- }
-
- void ISaslCallbackHandler.Handle(ISaslCallback[] callbacks)
- {
- }
-
- } // class AnonymousSaslClientTests
-
-} // namespace Apache.Qpid.Sasl.Tests.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/PlainSaslClientTests.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/PlainSaslClientTests.cs
deleted file mode 100644
index 4c82f7b126..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Mechanisms/PlainSaslClientTests.cs
+++ /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.
- *
- */
-
-using System;
-using System.Collections;
-using System.Text;
-
-using NUnit.Framework;
-using Apache.Qpid.Sasl;
-using Apache.Qpid.Sasl.Mechanisms;
-
-namespace Apache.Qpid.Sasl.Tests.Mechanisms
-{
- [TestFixture]
- public class PlainSaslClientTests : ISaslCallbackHandler
- {
- private const string USERNAME = "testuser";
- private const string PASSWORD = "thepasswd";
- private const string AUTHID = "theauth";
-
- [Test]
- public void ReturnsRightMechanismName()
- {
- ISaslClient client = new PlainSaslClient(AUTHID, new Hashtable(), this);
-
- Assert.AreEqual("PLAIN", client.MechanismName);
- }
-
- [Test]
- public void HasInitialResponseReturnsTrue()
- {
- ISaslClient client = new PlainSaslClient(AUTHID, new Hashtable(), this);
-
- Assert.IsTrue(client.HasInitialResponse);
- }
-
- [Test]
- public void CanEvaluateChallenge()
- {
- Hashtable props = new Hashtable();
- ISaslClient client = new PlainSaslClient(AUTHID, props, this);
-
- Assert.IsFalse(client.IsComplete);
- byte[] response = client.EvaluateChallenge(new byte[0]);
- string[] parts = Encoding.UTF8.GetString(response).Split('\0');
-
- Assert.AreEqual(3, parts.Length);
- Assert.AreEqual(AUTHID, parts[0]);
- Assert.AreEqual(USERNAME, parts[1]);
- Assert.AreEqual(PASSWORD, parts[2]);
- Assert.IsTrue(client.IsComplete);
- }
-
- void ISaslCallbackHandler.Handle(ISaslCallback[] callbacks)
- {
- foreach ( ISaslCallback cb in callbacks )
- {
- if ( cb is NameCallback )
- {
- ((NameCallback)cb).Text = USERNAME;
- } else if ( cb is PasswordCallback )
- {
- ((PasswordCallback)cb).Text = PASSWORD;
- }
- }
- }
-
- } // class PlainSaslClientTests
-
-} // namespace Apache.Qpid.Sasl.Tests.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index 58e62109a2..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-
-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.Sasl.Tests")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.Sasl.Tests")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("84cc3267-8019-4fad-a426-0a40155b3352")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Qpid.Sasl.Tests.csproj b/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Qpid.Sasl.Tests.csproj
deleted file mode 100644
index f1a7b07e5a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/Qpid.Sasl.Tests.csproj
+++ /dev/null
@@ -1,86 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{587B3520-EBB9-41ED-B019-E96116B651CE}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Sasl.Tests</RootNamespace>
- <AssemblyName>Apache.Qpid.Sasl.Tests</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <UseVSHostingProcess>true</UseVSHostingProcess>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>..\bin\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Qpid.Client.Tests\lib\nunit\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Sasl\Qpid.Sasl.csproj">
- <Project>{1465B0EE-6452-42A6-AB73-B2F9EABEEE75}</Project>
- <Name>Qpid.Sasl</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="App.config" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/SaslTests.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/SaslTests.cs
deleted file mode 100644
index 5b27949b98..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/SaslTests.cs
+++ /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.
- *
- */
-
-using System;
-using System.Collections;
-using System.Text;
-
-using NUnit.Framework;
-using Apache.Qpid.Sasl;
-using Apache.Qpid.Sasl.Mechanisms;
-
-namespace Apache.Qpid.Sasl.Tests
-{
- [TestFixture]
- public class SaslTests : ISaslCallbackHandler
- {
-
- [Test]
- public void CanCreatePlain()
- {
- Hashtable props = new Hashtable();
- string[] mechanisms = new string[] { "PLAIN", "OTHER" };
- ISaslClient client = Sasl.CreateClient(mechanisms, "", "", "", props, this);
-
- Assert.IsNotNull(client);
- Assert.IsInstanceOfType(typeof(PlainSaslClient), client);
- }
-
- [Test]
- public void CanCreateCramMD5()
- {
- Hashtable props = new Hashtable();
- string[] mechanisms = new string[] { "CRAM-MD5", "OTHER" };
- ISaslClient client = Sasl.CreateClient(mechanisms, "", "", "", props, this);
-
- Assert.IsNotNull(client);
- Assert.IsInstanceOfType(typeof(CramMD5SaslClient), client);
- }
-
- [Test]
- public void CanCreateAnonymous()
- {
- Hashtable props = new Hashtable();
- string[] mechanisms = new string[] { "ANONYMOUS", "OTHER" };
- ISaslClient client = Sasl.CreateClient(mechanisms, "", "", "", props, this);
-
- Assert.IsNotNull(client);
- Assert.IsInstanceOfType(typeof(AnonymousSaslClient), client);
- }
-
- [Test]
- public void CanCreateDigest()
- {
- Hashtable props = new Hashtable();
- string[] mechanisms = new string[] { "DIGEST-MD5", "OTHER" };
- ISaslClient client = Sasl.CreateClient(mechanisms, "", "", "", props, this);
-
- Assert.IsNotNull(client);
- Assert.IsInstanceOfType(typeof(DigestSaslClient), client);
- }
-
- [Test]
- public void CanCreateExternal()
- {
- Hashtable props = new Hashtable();
- string[] mechanisms = new string[] { "EXTERNAL", "OTHER" };
- ISaslClient client = Sasl.CreateClient(mechanisms, "", "", "", props, this);
-
- Assert.IsNotNull(client);
- Assert.IsInstanceOfType(typeof(ExternalSaslClient), client);
- }
-
- [Test]
- public void ReturnsNullIfNoFactoryFound()
- {
- Hashtable props = new Hashtable();
- props.Add(SaslProperties.PolicyNoPlainText, true);
- string[] mechanisms = new string[] { "PLAIN", "OTHER" };
- ISaslClient client = Sasl.CreateClient(mechanisms, "", "", "", props, this);
-
- Assert.IsNull(client);
- }
-
- [Test]
- public void ParsesConfigurationSection()
- {
- // if the TEST mechanism is available, then we know
- // the configuration section worked!
- Hashtable props = new Hashtable();
- string[] mechanisms = new string[] { "TEST" };
- ISaslClient client = Sasl.CreateClient(mechanisms, "", "", "", props, this);
-
- Assert.IsNotNull(client);
- Assert.IsInstanceOfType(typeof(TestSaslClient), client);
- }
-
- [Test]
- public void ChoosesStrongerMechanism()
- {
- Hashtable props = new Hashtable();
- string[] mechanisms = new string[] { "PLAIN", "OTHER", "CRAM-MD5" };
- ISaslClient client = Sasl.CreateClient(mechanisms, "", "", "", props, this);
-
- Assert.IsNotNull(client);
- Assert.IsInstanceOfType(typeof(CramMD5SaslClient), client);
- }
-
-
- void ISaslCallbackHandler.Handle(ISaslCallback[] callbacks)
- {
- }
-
- } // class SaslTests
-
-} // namespace Apache.Qpid.Sasl.Tests
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/TestClientFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/TestClientFactory.cs
deleted file mode 100644
index 73c68ea2b3..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/TestClientFactory.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.
- *
- */
-
-using System;
-using System.Collections;
-using System.Text;
-
-using NUnit.Framework;
-using Apache.Qpid.Sasl;
-using Apache.Qpid.Sasl.Mechanisms;
-
-namespace Apache.Qpid.Sasl.Tests
-{
- public class TestClientFactory : ISaslClientFactory
- {
- public string[] GetSupportedMechanisms(IDictionary props)
- {
- return new string[] { TestSaslClient.Mechanism };
- }
-
- public ISaslClient CreateClient(string[] mechanisms, string authorizationId, string protocol, string serverName, IDictionary props, ISaslCallbackHandler handler)
- {
- foreach ( string mech in mechanisms )
- {
- if ( mech == TestSaslClient.Mechanism )
- return new TestSaslClient(props, handler);
- }
- return null;
- }
-
- } // class TestClientFactory
-
- internal class TestSaslClient : SaslClient
- {
- public const string Mechanism = "TEST";
-
- public override string MechanismName
- {
- get { return Mechanism; }
- }
- public override bool HasInitialResponse
- {
- get { return false; }
- }
-
- public TestSaslClient(IDictionary props, ISaslCallbackHandler handler)
- : base("", "", "", props, handler)
- {
- }
-
- public override byte[] EvaluateChallenge(byte[] challenge)
- {
- throw new NotImplementedException();
- }
- } // class TestSaslClient
-
-} // namespace Apache.Qpid.Sasl.Tests
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/default.build b/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/default.build
deleted file mode 100644
index 5b51c0a6fa..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl.Tests/default.build
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Apache.Qpid.Sasl" default="test">
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- warnaserror="true" debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.Tests.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/nunit.framework.dll" />
- <include name="${build.dir}/${project::get-name()}.dll" />
- </references>
-
- </csc>
- <copy
- tofile="${build.dir}/${project::get-name()}.Tests.dll.config"
- file="App.config"
- />
- </target>
- <target name="test" depends="build">
- <nunit2>
- <formatter type="${nant.formatter}" usefile="false" />
- <test assemblyname="${build.dir}/${project::get-name()}.Tests.dll" />
- </nunit2>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/Callbacks.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/Callbacks.cs
deleted file mode 100644
index 90e36beeb8..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/Callbacks.cs
+++ /dev/null
@@ -1,106 +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;
-using System.Text;
-
-namespace Apache.Qpid.Sasl
-{
- /// <summary>
- /// Marker interface for Sasl Callbacks
- /// </summary>
- public interface ISaslCallback
- {
- } // interface ISaslCallback
-
- public abstract class TextSaslCallback : ISaslCallback
- {
- private string _prompt;
- private string _text;
- private string _defaultText;
-
- public string Prompt
- {
- get { return _prompt; }
- set { _prompt = value; }
- }
-
- public string Text
- {
- get {
- if ( _text == null || _text.Length == 0 )
- return DefaultText;
- else
- return _text;
- }
- set { _text = value; }
- }
-
- public string DefaultText
- {
- get { return _defaultText; }
- set { _defaultText = value; }
- }
-
- protected TextSaslCallback(string prompt, string text, string defaultText)
- {
- _prompt = prompt;
- _text = text;
- _defaultText = defaultText;
- }
-
- } // class TextSaslCallback
-
- public class NameCallback : TextSaslCallback
- {
- public NameCallback()
- : this(Environment.UserName)
- {
- }
- public NameCallback(string defaultText)
- : base("username:", "", defaultText)
- {
- }
- } // class NameCallback
-
- public class PasswordCallback : TextSaslCallback
- {
- public PasswordCallback()
- : base("password:", "", "")
- {
- }
- } // class PasswordCallback
-
- public class RealmCallback : TextSaslCallback
- {
- public RealmCallback()
- : this("localhost")
- {
- }
- public RealmCallback(string defaultText)
- : base("realm:", "", defaultText)
- {
- }
- } // class RealmCallback
-
-} // namespace Apache.Qpid.Sasl
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/Configuration/SaslConfiguration.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/Configuration/SaslConfiguration.cs
deleted file mode 100644
index 3446261724..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/Configuration/SaslConfiguration.cs
+++ /dev/null
@@ -1,90 +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;
-using System.Collections;
-using System.Configuration;
-using System.Text;
-using System.Xml;
-
-namespace Apache.Qpid.Sasl.Configuration
-{
- /// <summary>
- /// Represents an Sasl configuration section
- /// in the config file
- /// </summary>
- internal class SaslConfiguration
- {
- private IList _clientFactories;
-
- /// <summary>
- /// Set of configured client factores
- /// </summary>
- public IList ClientFactories
- {
- get { return _clientFactories; }
- }
-
- internal SaslConfiguration(IList clientFactoryTypes)
- {
- _clientFactories = new ArrayList();
- foreach ( Type type in clientFactoryTypes )
- {
- _clientFactories.Add(Activator.CreateInstance(type));
- }
- }
-
- /// <summary>
- /// Get the configuration for the library
- /// </summary>
- /// <returns>The configuration from app.config or a default configuration</returns>
- internal static SaslConfiguration GetConfiguration()
- {
- // 'obsolete' warning, but needed for .NET 1.1 compatibility
- SaslConfiguration config = (SaslConfiguration)
- ConfigurationSettings.GetConfig("qpid.sasl");
- if ( config == null )
- {
- // create default configuration
- IList clientFactories = GetDefaultClientFactories();
- config = new SaslConfiguration(clientFactories);
- }
- return config;
- }
-
- /// <summary>
- /// Create a list filled with the default client
- /// factories supported by the library
- /// </summary>
- /// <returns>The list of client factory types</returns>
- internal static IList GetDefaultClientFactories()
- {
- IList clientFactories = new ArrayList();
- clientFactories.Add(typeof(DefaultClientFactory));
- return clientFactories;
- }
-
-
- } // class SaslConfiguration
-
-} // namespace Apache.Qpid.Sasl.Configuration
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/Configuration/SaslConfigurationSectionHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/Configuration/SaslConfigurationSectionHandler.cs
deleted file mode 100644
index 21f6b92414..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/Configuration/SaslConfigurationSectionHandler.cs
+++ /dev/null
@@ -1,84 +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;
-using System.Collections;
-using System.Configuration;
-using System.Text;
-using System.Xml;
-
-namespace Apache.Qpid.Sasl.Configuration
-{
- /// <summary>
- /// Defines the configuration section to configure extra
- /// Sasl client factories
- /// </summary>
- public class SaslConfigurationSectionHandler
- : IConfigurationSectionHandler
- {
- public object Create(object parent, object configContext, XmlNode section)
- {
- IList clientFactories = SaslConfiguration.GetDefaultClientFactories();
-
- foreach ( XmlNode node in section.ChildNodes )
- {
- if ( node.LocalName == "clientFactories" )
- {
- ProcessFactories(node, clientFactories);
- }
- }
-
- SaslConfiguration config = new SaslConfiguration(clientFactories);
- return config;
- }
-
-
- private void ProcessFactories(XmlNode node, IList factories)
- {
- foreach ( XmlNode child in node.ChildNodes )
- {
- Type type;
- switch ( child.LocalName )
- {
- case "add":
- type = Type.GetType(child.Attributes["type"].Value);
- if ( !factories.Contains(type) )
- factories.Add(type);
- break;
- case "remove":
- type = Type.GetType(child.Attributes["type"].Value);
- if ( factories.Contains(type) )
- factories.Remove(type);
- break;
- case "clear":
- factories.Clear();
- break;
- default:
- // gives obsolete warning but needed for .NET 1.1 support
- throw new ConfigurationException(string.Format("Unknown element '{0}' in section '{0}'", child.LocalName, node.LocalName));
- }
- }
- }
- } // class SaslConfigurationSectionHandler
-
-} // namespace Apache.Qpid.Sasl.Configuration
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/DefaultClientFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/DefaultClientFactory.cs
deleted file mode 100644
index d552aa80c0..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/DefaultClientFactory.cs
+++ /dev/null
@@ -1,95 +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;
-using System.Collections;
-
-using Apache.Qpid.Sasl.Mechanisms;
-
-namespace Apache.Qpid.Sasl
-{
- public class DefaultClientFactory : ISaslClientFactory
- {
- private static readonly string[] SUPPORTED = new string[] {
- DigestSaslClient.Mechanism,
- CramMD5SaslClient.Mechanism,
- PlainSaslClient.Mechanism,
- AnonymousSaslClient.Mechanism,
- ExternalSaslClient.Mechanism,
- };
-
- public string[] GetSupportedMechanisms(IDictionary props)
- {
- if ( props == null )
- throw new ArgumentNullException("props");
-
- ArrayList vetoed = new ArrayList();
-
- if ( props.Contains(SaslProperties.PolicyNoPlainText) ||
- props.Contains(SaslProperties.PolicyNoDictionary) ||
- props.Contains(SaslProperties.PolicyNoActive) ||
- props.Contains(SaslProperties.PolicyForwardSecrecy) ||
- props.Contains(SaslProperties.PolicyPassCredentials) )
- {
- vetoed.Add(CramMD5SaslClient.Mechanism);
- vetoed.Add(PlainSaslClient.Mechanism);
- vetoed.Add(AnonymousSaslClient.Mechanism);
- vetoed.Add(ExternalSaslClient.Mechanism);
- }
- if ( props.Contains(SaslProperties.PolicyNoAnonymous) )
- {
- vetoed.Add(AnonymousSaslClient.Mechanism);
- }
-
- ArrayList available = new ArrayList();
- foreach ( string mech in SUPPORTED )
- {
- if ( !vetoed.Contains(mech) )
- available.Add(mech);
- }
- return (string[])available.ToArray(typeof(string));
- }
-
- public ISaslClient CreateClient(
- string[] mechanisms, string authorizationId,
- string protocol, string serverName,
- IDictionary props, ISaslCallbackHandler handler
- )
- {
- IList mechs = mechanisms;
- if ( mechs.Contains(ExternalSaslClient.Mechanism) )
- return new ExternalSaslClient(authorizationId, props, handler);
- if ( mechs.Contains(DigestSaslClient.Mechanism) )
- return new DigestSaslClient(authorizationId, serverName, protocol, props, handler);
- if ( mechs.Contains(CramMD5SaslClient.Mechanism) )
- return new CramMD5SaslClient(authorizationId, props, handler);
- if ( mechs.Contains(PlainSaslClient.Mechanism) )
- return new PlainSaslClient(authorizationId, props, handler);
- if ( mechs.Contains(AnonymousSaslClient.Mechanism) )
- return new AnonymousSaslClient(authorizationId, props, handler);
- // unknown mechanism
- return null;
- }
- } // class DefaultClientFactory
-
-} // namespace Apache.Qpid.Sasl
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslCallbackHandler.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslCallbackHandler.cs
deleted file mode 100644
index 0dfc482333..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslCallbackHandler.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.
- *
- */
-
-using System;
-using System.Text;
-
-namespace Apache.Qpid.Sasl
-{
- public interface ISaslCallbackHandler
- {
- void Handle(ISaslCallback[] callbacks);
-
- } // interface ISaslCallbackHandler
-
-} // namespace Apache.Qpid.Sasl
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslClient.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslClient.cs
deleted file mode 100644
index 526cc1f43a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslClient.cs
+++ /dev/null
@@ -1,42 +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;
-using System.Text;
-
-namespace Apache.Qpid.Sasl
-{
- public interface ISaslClient
- {
- string MechanismName { get; }
- bool HasInitialResponse { get; }
- bool IsComplete { get; }
-
- byte[] EvaluateChallenge(byte[] challenge);
- object GetNegotiatedProperty(string propName);
- byte[] Unwrap(byte[] buffer, int offset, int length);
- byte[] Wrap(byte[] buffer, int offset, int lenght);
-
- } // interface ISaslClient
-
-} // namespace Apache.Qpid.Sasl
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslClientFactory.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslClientFactory.cs
deleted file mode 100644
index fc81057ec4..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/ISaslClientFactory.cs
+++ /dev/null
@@ -1,40 +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;
-using System.Collections;
-using System.Text;
-
-namespace Apache.Qpid.Sasl
-{
- public interface ISaslClientFactory
- {
- string[] GetSupportedMechanisms(IDictionary props);
- ISaslClient CreateClient(
- string[] mechanisms, string authorizationId,
- string protocol, string serverName,
- IDictionary props, ISaslCallbackHandler handler
- );
- } // interface ISaslClientFactory
-
-} // namespace Apache.Qpid.Sasl
-
-
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/MD5HMAC.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/MD5HMAC.cs
deleted file mode 100644
index 134332284a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/MD5HMAC.cs
+++ /dev/null
@@ -1,115 +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;
-using System.Security.Cryptography;
-
-namespace Apache.Qpid.Sasl
-{
- /// <summary>
- /// Rough HMAC MD5 implementation as presented in
- /// RFC 2104. Used because the HMACMD5 class in the
- /// .NET framework is not available in v1.1.
- /// </summary>
- public sealed class MD5HMAC : IDisposable
- {
- private const int BLOCK_LEN = 64;
- private MD5 _hash;
- private byte[] _key;
- private byte[] _ipad;
- private byte[] _opad;
-
- public MD5HMAC(byte[] key)
- {
- if ( key == null || key.Length == 0 )
- throw new ArgumentNullException("key");
-
- _hash = new MD5CryptoServiceProvider();
-
- byte[] theKey = key;
- if ( theKey.Length > BLOCK_LEN )
- {
- theKey = _hash.ComputeHash(theKey);
- }
- // pad key with 0's up to BLOCK_LEN
- _key = new byte[BLOCK_LEN];
- Array.Copy(theKey, _key, theKey.Length);
-
- CreatePads();
- }
-
- public byte[] ComputeHash(byte[] input)
- {
- // H(K XOR opad, H(K XOR ipad, text))
- return H(_opad, H(_ipad, input));
- }
-
- public void Dispose()
- {
- if ( _hash != null )
- {
- ((IDisposable)_hash).Dispose();
- _hash = null;
- }
- }
-
- #region Private Methods
- //
- // Private Methods
- //
-
- private void CreatePads()
- {
- _ipad = new byte[BLOCK_LEN];
- _opad = new byte[BLOCK_LEN];
- for ( int i = 0; i < BLOCK_LEN; i++ )
- {
- _ipad[i] = 0x36;
- _opad[i] = 0x5c;
- }
-
- XOR(_ipad, _key);
- XOR(_opad, _key);
- }
-
- private static void XOR(byte[] dest, byte[] other)
- {
- // assume both are same size
- for ( int i = 0; i < dest.Length; i++ )
- {
- dest[i] ^= other[i];
- }
- }
-
- private byte[] H(byte[] v1, byte[] v2)
- {
- byte[] total = new byte[v1.Length + v2.Length];
- Array.Copy(v1, total, v1.Length);
- Array.Copy(v2, 0, total, v1.Length, v2.Length);
-
- return _hash.ComputeHash(total);
- }
-
- #endregion // Private Methods
-
- } // class MD5HMAC
-
-} // namespace Apache.Qpid.Sasl
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/AnonymousSaslClient.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/AnonymousSaslClient.cs
deleted file mode 100644
index 5e8c56ff51..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/AnonymousSaslClient.cs
+++ /dev/null
@@ -1,69 +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;
-using System.Collections;
-using System.Text;
-
-namespace Apache.Qpid.Sasl.Mechanisms
-{
- /// <summary>
- /// Implements the ANONYMOUS authentication mechanism
- /// as outlined in RFC 2245
- /// </summary>
- public class AnonymousSaslClient : SaslClient
- {
- public const string Mechanism = "ANONYMOUS";
-
- public AnonymousSaslClient(
- string authid, IDictionary properties,
- ISaslCallbackHandler handler)
- : base(authid, null, null, properties, handler)
- {
- }
-
- #region ISaslClient Implementation
- //
- // ISaslClient Implementation
- //
-
- public override string MechanismName
- {
- get { return Mechanism; }
- }
-
- public override bool HasInitialResponse
- {
- get { return true; }
- }
-
- public override byte[] EvaluateChallenge(byte[] challenge)
- {
- // ignore challenge
- SetComplete();
- return Encoding.UTF8.GetBytes(AuthorizationId);
- }
-
- #endregion // ISaslClient Implementation
-
- } // class AnonymousSaslClient
-
-} // namespace Apache.Qpid.Sasl.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/CramMD5SaslClient.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/CramMD5SaslClient.cs
deleted file mode 100644
index 672cc64c6a..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/CramMD5SaslClient.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.
- *
- */
-
-using System;
-using System.Collections;
-using System.Security.Cryptography;
-using System.Text;
-
-namespace Apache.Qpid.Sasl.Mechanisms
-{
- /// <summary>
- /// Implements the CRAM-MD5 authentication mechanism as outlined
- /// in RFC 2195
- /// </summary>
- public class CramMD5SaslClient : SaslClient
- {
- public const string Mechanism = "CRAM-MD5";
- private const int MinPwdLen = 16;
-
- public CramMD5SaslClient(
- string authorizationId,
- IDictionary properties,
- ISaslCallbackHandler handler)
- : base(authorizationId, null, null, properties, handler)
- {
- }
-
- #region ISaslClient Implementation
- //
- // ISaslClient Implementation
- //
-
- public override string MechanismName
- {
- get { return Mechanism; }
- }
-
- public override bool HasInitialResponse
- {
- get { return false; }
- }
-
- public override byte[] EvaluateChallenge(byte[] challenge)
- {
- if ( challenge == null || challenge.Length == 0 )
- throw new ArgumentNullException("challenge");
-
- NameCallback nameCB = new NameCallback(AuthorizationId);
- PasswordCallback pwdCB = new PasswordCallback();
- ISaslCallback[] callbacks = { nameCB, pwdCB };
- Handler.Handle(callbacks);
-
- string username = nameCB.Text;
- string passwd = pwdCB.Text.PadRight(MinPwdLen, '\0');
-
- byte[] secret = Encoding.UTF8.GetBytes(passwd);
-
- //using ( HMAC hmac = new HMACMD5(secret) )
- using ( MD5HMAC hmac = new MD5HMAC(secret) )
- {
- byte[] value = hmac.ComputeHash(challenge);
- string encoded = ToHex(value);
- SetComplete();
- return Encoding.UTF8.GetBytes(username + " " + encoded);
- }
-
- }
-
- #endregion // ISaslClient Implementation
-
- } // class CramMD5SaslClient
-
-} // namespace Apache.Qpid.Sasl.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/DigestSaslClient.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/DigestSaslClient.cs
deleted file mode 100644
index 59d3a88991..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/DigestSaslClient.cs
+++ /dev/null
@@ -1,576 +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;
-using System.Collections;
-using System.Collections.Specialized;
-using System.Globalization;
-using System.Security.Cryptography;
-using System.Text;
-
-namespace Apache.Qpid.Sasl.Mechanisms
-{
-
- /// <summary>
- /// Implements the DIGEST MD5 authentication mechanism
- /// as outlined in RFC 2831
- /// </summary>
- public class DigestSaslClient : SaslClient
- {
- public const string Mechanism = "DIGEST-MD5";
- private static readonly MD5 _md5 = new MD5CryptoServiceProvider();
- private int _state;
- private string _cnonce;
- private Encoding _encoding = Encoding.UTF8;
-
- public string Cnonce
- {
- get { return _cnonce; }
- set { _cnonce = value; }
- }
-
- public DigestSaslClient(
- string authid, string serverName, string protocol,
- IDictionary properties, ISaslCallbackHandler handler)
- : base(authid, serverName, protocol, properties, handler)
- {
- _cnonce = Guid.NewGuid().ToString("N");
- }
-
- #region ISaslClient Implementation
- //
- // ISaslClient Implementation
- //
-
- public override string MechanismName
- {
- get { return Mechanism; }
- }
-
- public override bool HasInitialResponse
- {
- get { return false; }
- }
-
- public override byte[] EvaluateChallenge(byte[] challenge)
- {
- if ( challenge == null || challenge.Length <= 0 )
- throw new ArgumentNullException("challenge");
-
- switch ( _state++ )
- {
- case 0: return OnInitialChallenge(challenge);
- case 1: return OnFinalResponse(challenge);
- }
- throw new SaslException("Invalid State for authentication");
- }
-
- #endregion // ISaslClient Implementation
-
-
- #region Private Methods
- //
- // Private Methods
- //
-
- /// <summary>
- /// Process the first challenge from the server
- /// and calculate a response
- /// </summary>
- /// <param name="challenge">The server issued challenge</param>
- /// <returns>Client response</returns>
- private byte[] OnInitialChallenge(byte[] challenge)
- {
- DigestChallenge dch =
- DigestChallenge.Parse(_encoding.GetString(challenge));
- // validate input challenge
- if ( dch.Nonce == null || dch.Nonce.Length == 0 )
- throw new SaslException("Nonce value missing in server challenge");
- if ( dch.Algorithm != "md5-sess" )
- throw new SaslException("Invalid or missing algorithm value in server challenge");
-
-
- NameCallback nameCB = new NameCallback(AuthorizationId);
- PasswordCallback pwdCB = new PasswordCallback();
- RealmCallback realmCB = new RealmCallback(dch.Realm);
- ISaslCallback[] callbacks = { nameCB, pwdCB, realmCB };
- Handler.Handle(callbacks);
-
- DigestResponse response = new DigestResponse();
- response.Username = nameCB.Text;
- response.Realm = realmCB.Text;
- response.Nonce = dch.Nonce;
- response.Cnonce = Cnonce;
- response.NonceCount = 1;
- response.Qop = DigestQop.Auth; // only auth supported for now
- response.DigestUri = Protocol.ToLower() + "/" + ServerName;
- response.MaxBuffer = dch.MaxBuffer;
- response.Charset = dch.Charset;
- response.Cipher = null; // not supported for now
- response.Authzid = AuthorizationId;
- response.AuthParam = dch.AuthParam;
-
- response.Response = CalculateResponse(
- nameCB.Text, realmCB.Text, pwdCB.Text,
- dch.Nonce, response.NonceCount, response.Qop, response.DigestUri
- );
-
- return _encoding.GetBytes(response.ToString());
- }
-
- /// <summary>
- /// Process the second server challenge
- /// </summary>
- /// <param name="challenge">Server issued challenge</param>
- /// <returns>The client response</returns>
- private byte[] OnFinalResponse(byte[] challenge)
- {
- DigestChallenge dch =
- DigestChallenge.Parse(_encoding.GetString(challenge));
-
- if ( dch.Rspauth == null || dch.Rspauth.Length == 0 )
- throw new SaslException("Expected 'rspauth' in server challenge not found");
-
- SetComplete();
- return new byte[0];
- }
-
-
-
- /// <summary>
- /// Calculate the response field of the client response
- /// </summary>
- /// <param name="username">The user name</param>
- /// <param name="realm">The realm</param>
- /// <param name="passwd">The user's password</param>
- /// <param name="nonce">Server nonce value</param>
- /// <param name="nc">Client nonce count (always 1)</param>
- /// <param name="qop">Quality of Protection</param>
- /// <param name="digestUri">Digest-URI</param>
- /// <returns>The value for the response field</returns>
- private string CalculateResponse(
- string username, string realm, string passwd,
- string nonce, int nc, string qop, string digestUri
- )
- {
- string a1 = CalcHexA1(username, realm, passwd, nonce);
- string a2 = CalcHexA2(digestUri, qop);
-
- string ncs = nc.ToString("x8", CultureInfo.InvariantCulture);
- StringBuilder prekd = new StringBuilder();
- prekd.Append(a1).Append(':').Append(nonce).Append(':')
- .Append(ncs).Append(':').Append(Cnonce)
- .Append(':').Append(qop).Append(':').Append(a2);
-
- return ToHex(CalcH(_encoding.GetBytes(prekd.ToString())));
- }
-
- private string CalcHexA1(
- string username, string realm,
- string passwd, string nonce
- )
- {
- bool hasAuthId = AuthorizationId != null && AuthorizationId.Length > 0;
-
- string premd = username + ":" + realm + ":" + passwd;
- byte[] temp1 = CalcH(_encoding.GetBytes(premd));
-
-
- int a1len = 16 + 1 + nonce.Length + 1 + Cnonce.Length;
- if ( hasAuthId )
- a1len += 1 + AuthorizationId.Length;
-
- byte[] buffer = new byte[a1len];
- Array.Copy(temp1, buffer, temp1.Length);
-
- string p2 = ":" + nonce + ":" + Cnonce;
- if ( hasAuthId )
- p2 += ":" + AuthorizationId;
-
- byte[] temp2 = _encoding.GetBytes(p2);
- Array.Copy(temp2, 0, buffer, 16, temp2.Length);
-
- return ToHex(CalcH(buffer));
- }
-
- private string CalcHexA2(string digestUri, string qop)
- {
- string a2 = "AUTHENTICATE:" + digestUri;
- if ( qop != DigestQop.Auth )
- a2 += ":00000000000000000000000000000000";
- return ToHex(CalcH(_encoding.GetBytes(a2)));
- }
-
- private static byte[] CalcH(byte[] value)
- {
- return _md5.ComputeHash(value);
- }
-
- #endregion // Private Methods
-
-
- } // class DigestSaslClient
-
-
- /// <summary>
- /// Available QOP options in the DIGEST scheme
- /// </summary>
- public sealed class DigestQop
- {
- public const string Auth = "auth";
- public const string AuthInt = "auth-int";
- public const string AuthConf = "auth-conf";
- } // class DigestQop
-
-
- /// <summary>
- /// Represents and parses a digest server challenge
- /// </summary>
- public class DigestChallenge
- {
- private string _realm = "localhost";
- private string _nonce;
- private string[] _qopOptions = { DigestQop.Auth };
- private bool _stale;
- private int _maxBuffer = 65536;
- private string _charset = "ISO 8859-1";
- private string _algorithm;
- private string[] _cipherOptions;
- private string _authParam;
- private string _rspauth;
-
- #region Properties
- //
- // Properties
- //
-
- public string Realm
- {
- get { return _realm; }
- }
-
- public string Nonce
- {
- get { return _nonce; }
- }
-
- public string[] QopOptions
- {
- get { return _qopOptions; }
- }
-
- public bool Stale
- {
- get { return _stale; }
- }
-
- public int MaxBuffer
- {
- get { return _maxBuffer; }
- set { _maxBuffer = value; }
- }
-
- public string Charset
- {
- get { return _charset; }
- }
-
- public string Algorithm
- {
- get { return _algorithm; }
- }
-
- public string[] CipherOptions
- {
- get { return _cipherOptions; }
- }
-
- public string AuthParam
- {
- get { return _authParam; }
- }
-
- public string Rspauth
- {
- get { return _rspauth; }
- }
-
- #endregion // Properties
-
- public static DigestChallenge Parse(string challenge)
- {
- DigestChallenge parsed = new DigestChallenge();
- StringDictionary parts = ParseParameters(challenge);
- foreach ( string optname in parts.Keys )
- {
- switch ( optname )
- {
- case "realm":
- parsed._realm = parts[optname];
- break;
- case "nonce":
- parsed._nonce = parts[optname];
- break;
- case "qop-options":
- parsed._qopOptions = GetOptions(parts[optname]);
- break;
- case "cipher-opts":
- parsed._cipherOptions = GetOptions(parts[optname]);
- break;
- case "stale":
- parsed._stale = Convert.ToBoolean(parts[optname], CultureInfo.InvariantCulture);
- break;
- case "maxbuf":
- parsed._maxBuffer = Convert.ToInt32(parts[optname], CultureInfo.InvariantCulture);
- break;
- case "charset":
- parsed._charset = parts[optname];
- break;
- case "algorithm":
- parsed._algorithm = parts[optname];
- break;
- case "auth-param":
- parsed._authParam = parts[optname];
- break;
- case "rspauth":
- parsed._rspauth = parts[optname];
- break;
- }
- }
-
- return parsed;
- }
-
-
- public static StringDictionary ParseParameters(string source)
- {
- if ( source == null )
- throw new ArgumentNullException("source");
-
- StringDictionary ret = new StringDictionary();
-
- string remaining = source.Trim();
- while ( remaining.Length > 0 )
- {
- int equals = remaining.IndexOf('=');
- if ( equals < 0 )
- break;
-
- string optname = remaining.Substring(0, equals).Trim();
- remaining = remaining.Substring(equals + 1);
-
- string value = ParseQuoted(ref remaining);
- ret[optname] = value.Trim();
- }
- return ret;
- }
-
- private static string ParseQuoted(ref string str)
- {
- string ns = str.TrimStart();
-
- int start = 0;
- bool quoted = ns[0] == '\"';
- if ( quoted ) start++;
- bool inquotes = quoted;
- bool escaped = false;
-
- int pos = start;
- for ( ; pos < ns.Length; pos++ )
- {
- if ( !inquotes && ns[pos] == ',' )
- break;
-
- // at end of quotes?
- if ( quoted && !escaped && ns[pos] == '\"' )
- inquotes = false;
- // is this char an escape for the next one?
- escaped = inquotes && ns[pos] == '\\';
- }
- // pos has end of string
- string value = ns.Substring(start, pos-start).Trim();
- if ( quoted )
- {
- // remove trailing quote
- value = value.Substring(0, value.Length - 1);
- }
- str = ns.Substring(pos < ns.Length-1 ? pos+1 : pos);
- return value;
- }
-
- private static string[] GetOptions(string value)
- {
- return value.Split(' ');
- }
-
- } // class DigestChallenge
-
-
- /// <summary>
- /// Represents and knows how to write a
- /// digest client response
- /// </summary>
- public class DigestResponse
- {
- private string _username;
- private string _realm;
- private string _nonce;
- private string _cnonce;
- private int _nonceCount;
- private string _qop;
- private string _digestUri;
- private string _response;
- private int _maxBuffer;
- private string _charset;
- private string _cipher;
- private string _authzid;
- private string _authParam;
-
- #region Properties
- //
- // Properties
- //
-
- public string Username
- {
- get { return _username; }
- set { _username = value; }
- }
-
- public string Realm
- {
- get { return _realm; }
- set { _realm = value; }
- }
-
- public string Nonce
- {
- get { return _nonce; }
- set { _nonce = value; }
- }
-
- public string Cnonce
- {
- get { return _cnonce; }
- set { _cnonce = value; }
- }
-
- public int NonceCount
- {
- get { return _nonceCount; }
- set { _nonceCount = value; }
- }
-
- public string Qop
- {
- get { return _qop; }
- set { _qop = value; }
- }
-
- public string DigestUri
- {
- get { return _digestUri; }
- set { _digestUri = value; }
- }
-
- public string Response
- {
- get { return _response; }
- set { _response = value; }
- }
-
- public int MaxBuffer
- {
- get { return _maxBuffer; }
- set { _maxBuffer = value; }
- }
-
- public string Charset
- {
- get { return _charset; }
- set { _charset = value; }
- }
-
- public string Cipher
- {
- get { return _cipher; }
- set { _cipher = value; }
- }
-
- public string Authzid
- {
- get { return _authzid; }
- set { _authzid = value; }
- }
-
- public string AuthParam
- {
- get { return _authParam; }
- set { _authParam = value; }
- }
-
- #endregion // Properties
-
-
- public override string ToString()
- {
- StringBuilder buffer = new StringBuilder();
- Pair(buffer, "username", Username, true);
- Pair(buffer, "realm", Realm, true);
- Pair(buffer, "nonce", Nonce, true);
- Pair(buffer, "cnonce", Cnonce, true);
- string nc = NonceCount.ToString("x8", CultureInfo.InvariantCulture);
- Pair(buffer, "nc", nc, false);
- Pair(buffer, "qop", Qop, false);
- Pair(buffer, "digest-uri", DigestUri, true);
- Pair(buffer, "response", Response, true);
- string maxBuffer = MaxBuffer.ToString(CultureInfo.InvariantCulture);
- Pair(buffer, "maxbuf", maxBuffer, false);
- Pair(buffer, "charset", Charset, false);
- Pair(buffer, "cipher", Cipher, false);
- Pair(buffer, "authzid", Authzid, true);
- Pair(buffer, "auth-param", AuthParam, true);
-
- return buffer.ToString().TrimEnd(',');
- }
-
- private static void Pair(StringBuilder buffer, string name, string value, bool quoted)
- {
- if ( value != null && value.Length > 0 )
- {
- buffer.Append(name);
- buffer.Append('=');
- if ( quoted )
- {
- buffer.Append('\"');
- buffer.Append(value.Replace("\"", "\\\""));
- buffer.Append('\"');
- } else
- {
- buffer.Append(value);
- }
- buffer.Append(',');
- }
- }
-
- } // class DigestResponse
-
-} // namespace Apache.Qpid.Sasl.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/ExternalSaslClient.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/ExternalSaslClient.cs
deleted file mode 100644
index 5b513bda87..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/ExternalSaslClient.cs
+++ /dev/null
@@ -1,69 +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;
-using System.Collections;
-using System.Text;
-
-namespace Apache.Qpid.Sasl.Mechanisms
-{
- /// <summary>
- /// Implements the EXTERNAL authentication mechanism
- /// as outlined in RFC 2222
- /// </summary>
- public class ExternalSaslClient : SaslClient
- {
- public const string Mechanism = "EXTERNAL";
-
- public ExternalSaslClient(
- string authid, IDictionary properties,
- ISaslCallbackHandler handler)
- : base(authid, null, null, properties, handler)
- {
- }
-
- #region ISaslClient Implementation
- //
- // ISaslClient Implementation
- //
-
- public override string MechanismName
- {
- get { return Mechanism; }
- }
-
- public override bool HasInitialResponse
- {
- get { return true; }
- }
-
- public override byte[] EvaluateChallenge(byte[] challenge)
- {
- // ignore challenge
- SetComplete();
- return Encoding.UTF8.GetBytes(AuthorizationId);
- }
-
- #endregion // ISaslClient Implementation
-
- } // class ExternalSaslClient
-
-} // namespace Apache.Qpid.Sasl.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/PlainSaslClient.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/PlainSaslClient.cs
deleted file mode 100644
index 3addeb2e83..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/Mechanisms/PlainSaslClient.cs
+++ /dev/null
@@ -1,81 +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;
-using System.Collections;
-using System.Text;
-
-namespace Apache.Qpid.Sasl.Mechanisms
-{
-
- /// <summary>
- /// Implements the PLAIN authentication mechanism
- /// as outlined in RFC 4616
- /// </summary>
- public class PlainSaslClient : SaslClient
- {
- public const string Mechanism = "PLAIN";
-
- public PlainSaslClient(
- string authid, IDictionary properties,
- ISaslCallbackHandler handler)
- : base(authid, null, null, properties, handler)
- {
- }
-
- #region ISaslClient Implementation
- //
- // ISaslClient Implementation
- //
-
- public override string MechanismName
- {
- get { return Mechanism; }
- }
-
- public override bool HasInitialResponse
- {
- get { return true; }
- }
-
- public override byte[] EvaluateChallenge(byte[] challenge)
- {
- // ignore challenge
-
- NameCallback nameCB = new NameCallback();
- PasswordCallback pwdCB = new PasswordCallback();
- ISaslCallback[] callbacks = { nameCB, pwdCB };
- Handler.Handle(callbacks);
-
- string username = nameCB.Text;
- string authid = AuthorizationId;
- string passwd = pwdCB.Text;
-
- string response =
- string.Format("{0}\0{1}\0{2}", authid, username, passwd);
- SetComplete();
- return Encoding.UTF8.GetBytes(response);
- }
-
- #endregion // ISaslClient Implementation
-
- } // class PlainSaslClient
-} // namespace Apache.Qpid.Sasl.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/Properties/AssemblyInfo.cs
deleted file mode 100644
index 982b6c932f..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/Properties/AssemblyInfo.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.
- *
- */
-using System;
-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.Sasl")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Apache.Qpid.Sasl")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("27ea23e4-6f84-4a54-8f1f-5725e6d767cc")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: CLSCompliant(true)]
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/Qpid.Sasl.csproj b/M4-RCs/qpid/dotnet/Qpid.Sasl/Qpid.Sasl.csproj
deleted file mode 100644
index 8c1d568aa3..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/Qpid.Sasl.csproj
+++ /dev/null
@@ -1,73 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{1465B0EE-6452-42A6-AB73-B2F9EABEEE75}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Sasl</RootNamespace>
- <AssemblyName>Apache.Qpid.Sasl</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <UseVSHostingProcess>true</UseVSHostingProcess>
- </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.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/Qpid.Sasl/Sasl.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/Sasl.cs
deleted file mode 100644
index 5a744a30d9..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/Sasl.cs
+++ /dev/null
@@ -1,115 +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;
-using System.Collections;
-using System.Configuration;
-using System.Text;
-
-using Apache.Qpid.Sasl.Configuration;
-
-namespace Apache.Qpid.Sasl
-{
- /// <summary>
- /// Static class used to access the SASL functionality.
- /// The core SASL mechanism is described in RFC 2222.
- /// </summary>
- /// <remarks>
- /// Only client side mechanisms are implemented.
- /// <para>
- /// New client side factories can be added programatically using the
- /// RegisterClientFactory method, or through the application
- /// configuration file, like this:
- /// </para>
- /// <example><![CDATA[
- /// <configuration>
- /// <configSections>
- /// <section name="qpid.sasl" type="Apache.Qpid.Sasl.Configuration.SaslConfigurationSectionHandler, Apache.Qpid.Sasl"/>
- /// </configSections>
- ///
- /// <qpid.sasl>
- /// <clientFactories>
- /// <add type="Apache.Qpid.Sasl.Tests.TestClientFactory, Apache.Qpid.Sasl.Tests"/>
- /// </clientFactories>
- /// </qpid.sasl>
- /// </configuration>
- /// ]]></example>
- /// </remarks>
- public sealed class Sasl
- {
- private static IList _clientFactories;
-
-
- static Sasl()
- {
- SaslConfiguration config = SaslConfiguration.GetConfiguration();
- _clientFactories = config.ClientFactories;
- }
- private Sasl()
- {
- }
-
- public static ISaslClient CreateClient(
- string[] mechanisms, string authorizationId,
- string protocol, string serverName,
- IDictionary props, ISaslCallbackHandler handler
- )
- {
- ISaslClientFactory factory = FindFactory(mechanisms, props);
- if ( factory == null )
- return null;
-
- return factory.CreateClient (
- mechanisms, authorizationId,
- protocol, serverName, props, handler
- );
- }
-
- public static void RegisterClientFactory(ISaslClientFactory factory)
- {
- lock ( _clientFactories )
- {
- _clientFactories.Add(factory);
- }
- }
-
- private static ISaslClientFactory FindFactory(string[] mechanisms, IDictionary props)
- {
- lock ( _clientFactories )
- {
- foreach ( ISaslClientFactory factory in _clientFactories )
- {
- string[] mechs = factory.GetSupportedMechanisms(props);
- foreach ( string m1 in mechs )
- {
- foreach (string m2 in mechanisms )
- {
- if ( m1 == m2 )
- return factory;
- }
- }
- }
- return null;
- }
- }
- } // class Sasl
-
-} // namespace Apache.Qpid.Sasl.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/SaslClient.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/SaslClient.cs
deleted file mode 100644
index 1390b1b352..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/SaslClient.cs
+++ /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.
- *
- */
-
-using System;
-using System.Collections;
-using System.Globalization;
-using System.Text;
-
-namespace Apache.Qpid.Sasl
-{
- public abstract class SaslClient : ISaslClient
- {
- private bool _isComplete;
- private IDictionary _properties;
- private string _authorizationId;
- private string _serverName;
- private string _protocol;
- private ISaslCallbackHandler _handler;
-
- protected string AuthorizationId
- {
- get { return _authorizationId; }
- }
- protected string ServerName
- {
- get { return _serverName; }
- }
-
- protected string Protocol
- {
- get { return _protocol; }
- }
-
- protected ISaslCallbackHandler Handler
- {
- get { return _handler; }
- }
-
- protected IDictionary Properties
- {
- get { return _properties; }
- }
-
- protected SaslClient(
- string authid, string serverName,
- string protocol, IDictionary properties,
- ISaslCallbackHandler handler)
- {
- if ( properties == null )
- throw new ArgumentNullException("properties");
- if ( handler == null )
- throw new ArgumentNullException("handler");
-
- _authorizationId = authid==null ? "" : authid;
- _serverName = serverName;
- _protocol = protocol;
- _properties = properties;
- _handler = handler;
-
- if ( _serverName == null || _serverName.Length == 0 )
- {
- _serverName = System.Net.Dns.GetHostName();
- }
- }
-
-
-
-
- #region ISaslClient Implementation
- //
- // ISaslClient Implementation
- //
-
- public abstract string MechanismName { get; }
-
- public abstract bool HasInitialResponse { get; }
-
- public bool IsComplete
- {
- get { return _isComplete; }
- }
-
- public abstract byte[] EvaluateChallenge(byte[] challenge);
-
- public virtual object GetNegotiatedProperty(string propName)
- {
- return null;
- }
-
- public virtual byte[] Unwrap(byte[] buffer, int offset, int length)
- {
- throw new NotImplementedException();
- }
-
- public virtual byte[] Wrap(byte[] buffer, int offset, int lenght)
- {
- throw new NotImplementedException();
- }
-
- #endregion // ISaslClient Implementation
-
-
- #region Helper Methods
- //
- // Helper Methods
- //
-
- protected void SetComplete()
- {
- _isComplete = true;
- }
-
- protected static string ToHex(byte[] buffer)
- {
- StringBuilder builder = new StringBuilder();
- foreach ( byte b in buffer )
- {
- builder.Append(b.ToString("x2", CultureInfo.InvariantCulture));
- }
- return builder.ToString();
- }
-
- #endregion // Helper Methods
-
- } // class SaslClient
-
-} // namespace Apache.Qpid.Sasl.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/SaslException.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/SaslException.cs
deleted file mode 100644
index 8f6e00a7ba..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/SaslException.cs
+++ /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.
- *
- */
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-using System.Text;
-
-namespace Apache.Qpid.Sasl
-{
- /// <summary>
- /// Reports an exception during the processing of an SASL
- /// Operation. Only used for authentication-relared errors
- /// </summary>
- [Serializable]
- public class SaslException : Exception
- {
- public SaslException()
- {
- }
-
- public SaslException(string message)
- : base(message)
- {
- }
- public SaslException(string message, Exception innerException)
- : base(message, innerException)
- {
- }
-
- protected SaslException(SerializationInfo info, StreamingContext ctxt)
- : base(info, ctxt)
- {
- }
-
- } // class SaslException
-
-} // namespace Apache.Qpid.Sasl.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/SaslProperties.cs b/M4-RCs/qpid/dotnet/Qpid.Sasl/SaslProperties.cs
deleted file mode 100644
index 0658acda21..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/SaslProperties.cs
+++ /dev/null
@@ -1,42 +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;
-using System.Collections;
-using System.Text;
-
-namespace Apache.Qpid.Sasl
-{
- public sealed class SaslProperties
- {
- public const string PolicyNoPlainText = "NOPLAINTEXT";
- public const string PolicyNoActive = "NOACTIVE";
- public const string PolicyNoDictionary = "NODICTIONARY";
- public const string PolicyNoAnonymous = "NOANONYMOUS";
- public const string PolicyForwardSecrecy = "FORWARD_SECRECY";
- public const string PolicyPassCredentials = "PASS_CREDENTIALS";
-
- public const string Qop = "QOP";
- public const string Strength = "STRENGTH";
-
- } // class SaslProperties
-
-} // namespace Apache.Qpid.Sasl.Mechanisms
diff --git a/M4-RCs/qpid/dotnet/Qpid.Sasl/default.build b/M4-RCs/qpid/dotnet/Qpid.Sasl/default.build
deleted file mode 100644
index 57049ee2ee..0000000000
--- a/M4-RCs/qpid/dotnet/Qpid.Sasl/default.build
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Apache.Qpid.Sasl" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/README.txt b/M4-RCs/qpid/dotnet/README.txt
deleted file mode 100644
index 0199ad6410..0000000000
--- a/M4-RCs/qpid/dotnet/README.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-Info
-====
-
-There are two separate .NET clients: one that implements AMQP 0-8 (and
-can communicate with the Java broker) and another that implements
-0-10 (and can communicate with the C++ broker).
-
-This README contains instructions for building the 0-8 client.
-
-Instructions for building and installing the 0-10 client are located in client-010/README.txt.
-
-Setup
-=====
-
-Essential:
-
- .NET 2.0 or later
- Ant 1.6.5 (Java build tool, http://ant.apache.org)
-
-Either:
- NAnt 0.85 - only required for builds outside Visual Studio
-OR
- Microsoft Visual Studio 2008 (VS2008)
-
-Ensure that your PATH includes ant, e.g.:
-
- $ PATH=c:\java\ant\bin:%PATH%
-
-If using nant, set up PATH to include Nant.exe, e.g.:
-
- $ set PATH=C:\dotnet\nant\bin;%PATH%
-
-If using msbuild, it is recommended to use a "Visual Studio Command Prompt"
-
-Building
-========
-
-Generate framing from /Qpid.Common/amqp.xml specification file by running this script:
-
- $ build-framing.bat
-
-Alternatively, just switch to /Qpid.Common and run "ant" there.
-
-You can build from Visual Studio 2008 or from the command-line by running msbuild.
-
-The script build-msbuild.bat provides some standard options to do a full build.
-
-If you are using nant, the script build-nant.bat contains standard arguments that do a full build.
-
-To build for Mono on Linux (to bin/mono-2.0) the build-mono shell script is provided.
-
-Releasing
-=========
-
-nant can be used to create a release zip archive. A script is provided:
-
-For .NET 2.0
-
- $ release net-2.0
-
-Generates ./bin/net-2.0/release/Qpid.NET-net-2.0-yyyyMMdd.zip
-
-For Mono
-
- $ release mono-2.0
-
-Generates ./bin/mono-2.0/release/Qpid.NET-mono-2.0-yyyyMMdd.zip
-
diff --git a/M4-RCs/qpid/dotnet/RELEASE_NOTES.txt b/M4-RCs/qpid/dotnet/RELEASE_NOTES.txt
deleted file mode 100644
index 237f0278d9..0000000000
--- a/M4-RCs/qpid/dotnet/RELEASE_NOTES.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Apache Incubator Qpid .NET M4 Release Notes
--------------------------------------------
-
-The Qpid M4 release contains seperate clients that support the AMQP
-0-10 and AMQP 0-8 protocols.
-
-For full details of Qpid capabilities, as they currently stand, see our
-detailed project documentation at:
-
-http://cwiki.apache.org/confluence/display/qpid/Qpid+.Net+Documentation
-
-From the link above you can access our Getting Started Guide, FAQ, Build How To
-and developer documentation.
-
-
-Known Issues/Outstanding Work
------------------------------
-
-You can view the outstanding task list for Qpid by visiting our JIRA:
-http://issues.apache.org/jira/browse/QPID
-
-
-Changes since M3
-----------------
-
-The major change since M3 has been the addition of a new client which implements 0-10 support.
diff --git a/M4-RCs/qpid/dotnet/TestClient/Program.cs b/M4-RCs/qpid/dotnet/TestClient/Program.cs
deleted file mode 100644
index c612708e8e..0000000000
--- a/M4-RCs/qpid/dotnet/TestClient/Program.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 TopicListener
-{
- class Program
- {
- static void Main(string[] args)
- {
- Apache.Qpid.Integration.Tests.interop.TestClient.Main(args);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/TestClient/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/TestClient/Properties/AssemblyInfo.cs
deleted file mode 100644
index d886ebb8ca..0000000000
--- a/M4-RCs/qpid/dotnet/TestClient/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-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("TestClient")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("TestClient")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("1c2db1cd-239f-495a-b6b4-c815ea534489")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/TestClient/TestClient.csproj b/M4-RCs/qpid/dotnet/TestClient/TestClient.csproj
deleted file mode 100644
index 3b54a27b44..0000000000
--- a/M4-RCs/qpid/dotnet/TestClient/TestClient.csproj
+++ /dev/null
@@ -1,115 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{6E0374D9-99BE-4D4F-B41D-B227E37E04C6}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>TestClient</RootNamespace>
- <AssemblyName>TestClient</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\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\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Buffer.Tests\Qpid.Buffer.Tests.csproj">
- <Project>{74640962-99D0-4D06-B57A-9CD66517CF52}</Project>
- <Name>Qpid.Buffer.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Buffer\Qpid.Buffer.csproj">
- <Project>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</Project>
- <Name>Qpid.Buffer</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Client.Tests\Qpid.Client.Tests.csproj">
- <Project>{BA1B0032-4CE6-40DD-A2DC-119F0FFA0A1D}</Project>
- <Name>Qpid.Client.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Client\Qpid.Client.csproj">
- <Project>{68987C05-3768-452C-A6FC-6BA1D372852F}</Project>
- <Name>Qpid.Client</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Codec\Qpid.Codec.csproj">
- <Project>{22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}</Project>
- <Name>Qpid.Codec</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Common.Tests\Qpid.Common.Tests.csproj">
- <Project>{F83624B0-762B-4D82-900D-FF4C1B36E36E}</Project>
- <Name>Qpid.Common.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Common\Qpid.Common.csproj">
- <Project>{77064C42-24D2-4CEB-9EA2-0EF481A43205}</Project>
- <Name>Qpid.Common</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Messaging\Qpid.Messaging.csproj">
- <Project>{6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}</Project>
- <Name>Qpid.Messaging</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Sasl.Tests\Qpid.Sasl.Tests.csproj">
- <Project>{587B3520-EBB9-41ED-B019-E96116B651CE}</Project>
- <Name>Qpid.Sasl.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Sasl\Qpid.Sasl.csproj">
- <Project>{1465B0EE-6452-42A6-AB73-B2F9EABEEE75}</Project>
- <Name>Qpid.Sasl</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/TestClient/default.build b/M4-RCs/qpid/dotnet/TestClient/default.build
deleted file mode 100644
index ce1114425e..0000000000
--- a/M4-RCs/qpid/dotnet/TestClient/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="TestClient" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- unsafe="true"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}\Apache.Qpid.Integration.Tests.dll"/>
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/TopicListener/Program.cs b/M4-RCs/qpid/dotnet/TopicListener/Program.cs
deleted file mode 100644
index 468aeafe43..0000000000
--- a/M4-RCs/qpid/dotnet/TopicListener/Program.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 TopicListener
-{
- class Program
- {
- static void Main(string[] args)
- {
- Apache.Qpid.Client.Tests.interop.TopicListener.Main(args);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/TopicListener/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/TopicListener/Properties/AssemblyInfo.cs
deleted file mode 100644
index 12e19aaf68..0000000000
--- a/M4-RCs/qpid/dotnet/TopicListener/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-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("TopicListener")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("TopicListener")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("1c2db1cd-239f-495a-b6b4-c815ea534489")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/TopicListener/TopicListener.csproj b/M4-RCs/qpid/dotnet/TopicListener/TopicListener.csproj
deleted file mode 100644
index a1e95cd668..0000000000
--- a/M4-RCs/qpid/dotnet/TopicListener/TopicListener.csproj
+++ /dev/null
@@ -1,115 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{9A112DF2-146F-4CF4-919B-9D3BE7D088E9}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>TopicListener</RootNamespace>
- <AssemblyName>TopicListener</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\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\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Buffer.Tests\Qpid.Buffer.Tests.csproj">
- <Project>{74640962-99D0-4D06-B57A-9CD66517CF52}</Project>
- <Name>Qpid.Buffer.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Buffer\Qpid.Buffer.csproj">
- <Project>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</Project>
- <Name>Qpid.Buffer</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Client.Tests\Qpid.Client.Tests.csproj">
- <Project>{BA1B0032-4CE6-40DD-A2DC-119F0FFA0A1D}</Project>
- <Name>Qpid.Client.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Client\Qpid.Client.csproj">
- <Project>{68987C05-3768-452C-A6FC-6BA1D372852F}</Project>
- <Name>Qpid.Client</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Codec\Qpid.Codec.csproj">
- <Project>{22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}</Project>
- <Name>Qpid.Codec</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Common.Tests\Qpid.Common.Tests.csproj">
- <Project>{F83624B0-762B-4D82-900D-FF4C1B36E36E}</Project>
- <Name>Qpid.Common.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Common\Qpid.Common.csproj">
- <Project>{77064C42-24D2-4CEB-9EA2-0EF481A43205}</Project>
- <Name>Qpid.Common</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Messaging\Qpid.Messaging.csproj">
- <Project>{6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}</Project>
- <Name>Qpid.Messaging</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Sasl.Tests\Qpid.Sasl.Tests.csproj">
- <Project>{587B3520-EBB9-41ED-B019-E96116B651CE}</Project>
- <Name>Qpid.Sasl.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Sasl\Qpid.Sasl.csproj">
- <Project>{1465B0EE-6452-42A6-AB73-B2F9EABEEE75}</Project>
- <Name>Qpid.Sasl</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/TopicListener/default.build b/M4-RCs/qpid/dotnet/TopicListener/default.build
deleted file mode 100644
index f9b0f97094..0000000000
--- a/M4-RCs/qpid/dotnet/TopicListener/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="TopicListener" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- unsafe="true"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}\Apache.Qpid.Client.Tests.dll"/>
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/TopicPublisher/Program.cs b/M4-RCs/qpid/dotnet/TopicPublisher/Program.cs
deleted file mode 100644
index 895ecf7d21..0000000000
--- a/M4-RCs/qpid/dotnet/TopicPublisher/Program.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 TopicPublisher
-{
- class Program
- {
- static void Main(string[] args)
- {
- Apache.Qpid.Client.Tests.interop.TopicPublisher.Main(args);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/TopicPublisher/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/TopicPublisher/Properties/AssemblyInfo.cs
deleted file mode 100644
index c7e5c0fa74..0000000000
--- a/M4-RCs/qpid/dotnet/TopicPublisher/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-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("TopicPublisher")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("TopicPublisher")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("93fa1c32-c0f8-47e5-b167-dc581e33eb9b")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("2.1.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/TopicPublisher/TopicPublisher.csproj b/M4-RCs/qpid/dotnet/TopicPublisher/TopicPublisher.csproj
deleted file mode 100644
index 695d39ffe7..0000000000
--- a/M4-RCs/qpid/dotnet/TopicPublisher/TopicPublisher.csproj
+++ /dev/null
@@ -1,111 +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.
-
--->
-
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{A06C9FFD-22FF-4654-856D-897C230978AF}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>TopicPublisher</RootNamespace>
- <AssemblyName>TopicPublisher</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>..\bin\net-2.0\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\net-2.0\release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Qpid.Buffer\Qpid.Buffer.csproj">
- <Project>{44384DF2-B0A4-4580-BDBC-EE4BAA87D995}</Project>
- <Name>Qpid.Buffer</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Client.Tests\Qpid.Client.Tests.csproj">
- <Project>{BA1B0032-4CE6-40DD-A2DC-119F0FFA0A1D}</Project>
- <Name>Qpid.Client.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Client\Qpid.Client.csproj">
- <Project>{68987C05-3768-452C-A6FC-6BA1D372852F}</Project>
- <Name>Qpid.Client</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Codec\Qpid.Codec.csproj">
- <Project>{22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}</Project>
- <Name>Qpid.Codec</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Common.Tests\Qpid.Common.Tests.csproj">
- <Project>{F83624B0-762B-4D82-900D-FF4C1B36E36E}</Project>
- <Name>Qpid.Common.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Common\Qpid.Common.csproj">
- <Project>{77064C42-24D2-4CEB-9EA2-0EF481A43205}</Project>
- <Name>Qpid.Common</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Messaging\Qpid.Messaging.csproj">
- <Project>{6688F826-C58E-4C1B-AA1F-22AFAB4B7D07}</Project>
- <Name>Qpid.Messaging</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Sasl.Tests\Qpid.Sasl.Tests.csproj">
- <Project>{587B3520-EBB9-41ED-B019-E96116B651CE}</Project>
- <Name>Qpid.Sasl.Tests</Name>
- </ProjectReference>
- <ProjectReference Include="..\Qpid.Sasl\Qpid.Sasl.csproj">
- <Project>{1465B0EE-6452-42A6-AB73-B2F9EABEEE75}</Project>
- <Name>Qpid.Sasl</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/TopicPublisher/default.build b/M4-RCs/qpid/dotnet/TopicPublisher/default.build
deleted file mode 100644
index 9b01c2a1bc..0000000000
--- a/M4-RCs/qpid/dotnet/TopicPublisher/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="TopicPublisher" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- unsafe="true"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}\Apache.Qpid.Client.Tests.dll"/>
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/build-framing.bat b/M4-RCs/qpid/dotnet/build-framing.bat
deleted file mode 100644
index ae9bc749a9..0000000000
--- a/M4-RCs/qpid/dotnet/build-framing.bat
+++ /dev/null
@@ -1,23 +0,0 @@
-@REM
-@REM
-@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.
-@REM
-@REM
-
-cd Qpid.Common
-ant
diff --git a/M4-RCs/qpid/dotnet/build-mono b/M4-RCs/qpid/dotnet/build-mono
deleted file mode 100755
index 275922e623..0000000000
--- a/M4-RCs/qpid/dotnet/build-mono
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-nant -t:mono-2.0
diff --git a/M4-RCs/qpid/dotnet/build-msbuild.bat b/M4-RCs/qpid/dotnet/build-msbuild.bat
deleted file mode 100644
index 1fe4b5d64c..0000000000
--- a/M4-RCs/qpid/dotnet/build-msbuild.bat
+++ /dev/null
@@ -1,22 +0,0 @@
-@REM
-@REM
-@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.
-@REM
-@REM
-
-MSBuild.exe Qpid.NET.sln /p:Configuration=Release /t:rebuild
diff --git a/M4-RCs/qpid/dotnet/build-nant-release b/M4-RCs/qpid/dotnet/build-nant-release
deleted file mode 100755
index 611a1efe08..0000000000
--- a/M4-RCs/qpid/dotnet/build-nant-release
+++ /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.
-#
-#
-
-#!/bin/bash
-#
-#
-# 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.
-#
-#
-
-
-Usage()
-{
- echo "usage: $0 net-2.0|mono-2.0"
- exit 2
-}
-
-if [[ $# -ne 1 ]]; then
- Usage
-fi
-
-nant -t:$1 release-pkg -D:build.config=release
diff --git a/M4-RCs/qpid/dotnet/build-nant.bat b/M4-RCs/qpid/dotnet/build-nant.bat
deleted file mode 100644
index 785450a9f7..0000000000
--- a/M4-RCs/qpid/dotnet/build-nant.bat
+++ /dev/null
@@ -1,22 +0,0 @@
-@REM
-@REM
-@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.
-@REM
-@REM
-
-nant -t:net-2.0
diff --git a/M4-RCs/qpid/dotnet/client-010/LICENSE.txt b/M4-RCs/qpid/dotnet/client-010/LICENSE.txt
deleted file mode 100644
index 981d2f83c3..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/LICENSE.txt
+++ /dev/null
@@ -1,757 +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.
-
-
-=========================================================================
-== Saxon XSLT License ==
-=========================================================================
-
-Mozilla Public License Version 1.0
-
-1. Definitions.
-
- 1.1. "Contributor" means each entity that creates or contributes
- to the creation of Modifications.
-
- 1.2. "Contributor Version" means the combination of the
- Original Code, prior Modifications used by a Contributor, and the
- Modifications made by that particular Contributor.
-
- 1.3. "Covered Code" means the Original Code or Modifications
- or the combination of the Original Code and Modifications, in each case
- including portions thereof.
-
- 1.4. "Electronic Distribution Mechanism" means a mechanism
- generally accepted in the software development community for the
- electronic transfer of data.
-
- 1.5. "Executable" means Covered Code in any form other than
- Source Code.
-
- 1.6. "Initial Developer" means the individual or entity
- identified as the Initial Developer in the Source Code notice required by
- Exhibit A.
-
- 1.7. "Larger Work" means a work which combines Covered Code
- or portions thereof with code not governed by the terms of this License.
-
- 1.8. "License" means this document.
-
- 1.9. "Modifications" means any addition to or deletion from
- the substance or structure of either the Original Code or any previous
- Modifications. When Covered Code is released as a series of files, a
- Modification is:
-
- A. Any addition to or deletion from the contents of a file
- containing Original Code or previous Modifications.
-
- B. Any new file that contains any part of the Original
- Code or previous Modifications.
-
- 1.10. "Original Code" means Source Code of computer software
- code which is described in the Source Code notice required by Exhibit
- A as Original Code, and which, at the time of its release under this
- License is not already Covered Code governed by this License.
-
- 1.11. "Source Code" means the preferred form of the Covered
- Code for making modifications to it, including all modules it contains,
- plus any associated interface definition files, scripts used to control
- compilation and installation of an Executable, or a list of source code
- differential comparisons against either the Original Code or another well
- known, available Covered Code of the Contributor's choice. The Source
- Code can be in a compressed or archival form, provided the appropriate
- decompression or de-archiving software is widely available for no charge.
-
- 1.12. "You" means an individual or a legal entity exercising
- rights under, and complying with all of the terms of, this License or a
- future version of this License issued under Section 6.1. For legal
- entities, "You" includes any entity which controls, is controlled by,
- or is under common control with You. For purposes of this definition,
- "control" means (a) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or otherwise,
- or (b) ownership of fifty percent (50%) or more of the outstanding shares
- or beneficial ownership of such entity.
-
-2. Source Code License.
-
- 2.1. The Initial Developer Grant.
-
-
- The Initial Developer hereby grants You a world-wide, royalty-free,
- non-exclusive license, subject to third party intellectual property
- claims:
-
- (a) to use, reproduce, modify, display, perform, sublicense
- and distribute the Original Code (or portions thereof) with or
- without Modifications, or as part of a Larger Work; and
-
- (b) under patents now or hereafter owned or controlled by
- Initial Developer, to make, have made, use and sell ("Utilize") the
- Original Code (or portions thereof), but solely to the extent that
- any such patent is reasonably necessary to enable You to Utilize the
- Original Code (or portions thereof) and not to any greater extent
- that may be necessary to Utilize further Modifications or
- combinations.
-
- 2.2. Contributor Grant.
-
-
- Each Contributor hereby grants You a world-wide, royalty-free,
- non-exclusive license, subject to third party intellectual property
- claims:
-
- (a) to use, reproduce, modify, display, perform, sublicense and
- distribute the Modifications created by such Contributor (or portions
- thereof) either on an unmodified basis, with other Modifications, as
- Covered Code or as part of a Larger Work; and
-
- (b) under patents now or hereafter owned or controlled by
- Contributor, to Utilize the Contributor Version (or portions thereof),
- but solely to the extent that any such patent is reasonably necessary to
- enable You to Utilize the Contributor Version (or portions thereof), and
- not to any greater extent that may be necessary to Utilize further
- Modifications or combinations.
-
-3. Distribution Obligations.
-
- 3.1. Application of License.
-
-
- The Modifications which You create or to which You contribute are
- governed by the terms of this License, including without limitation
- Section 2.2. The Source Code version of Covered Code may be
- distributed only under the terms of this License or a future version of
- this License released under Section 6.1, and You must include a
- copy of this License with every copy of the Source Code You
- distribute. You may not offer or impose any terms on any Source Code
- version that alters or restricts the applicable version of this License
- or the recipients' rights hereunder. However, You may include an
- additional document offering the additional rights described in Section
- 3.5.
-
- 3.2. Availability of Source Code.
-
-
- Any Modification which You create or to which You contribute must be
- made available in Source Code form under the terms of this License either
- on the same media as an Executable version or via an accepted Electronic
- Distribution Mechanism to anyone to whom you made an Executable version
- available; and if made available via Electronic Distribution Mechanism,
- must remain available for at least twelve (12) months after the date it
- initially became available, or at least six (6) months after a subsequent
- version of that particular Modification has been made available to such
- recipients. You are responsible for ensuring that the Source Code version
- remains available even if the Electronic Distribution Mechanism is
- maintained by a third party.
-
- 3.3. Description of Modifications.
-
-
- You must cause all Covered Code to which you contribute to contain a
- file documenting the changes You made to create that Covered Code and the
- date of any change. You must include a prominent statement that the
- Modification is derived, directly or indirectly, from Original Code
- provided by the Initial Developer and including the name of the Initial
- Developer in (a) the Source Code, and (b) in any notice in an Executable
- version or related documentation in which You describe the origin or
- ownership of the Covered Code.
-
- 3.4. Intellectual Property Matters
-
- (a) Third Party Claims.
-
-
- If You have knowledge that a party claims an intellectual
- property right in particular functionality or code (or its
- utilization under this License), you must include a text file with
- the source code distribution titled "LEGAL" which describes the
- claim and the party making the claim in sufficient detail that a
- recipient will know whom to contact. If you obtain such knowledge
- after You make Your Modification available as described in Section
- 3.2, You shall promptly modify the LEGAL file in all copies
- You make available thereafter and shall take other steps (such as
- notifying appropriate mailing lists or newsgroups) reasonably
- calculated to inform those who received the Covered Code that new
- knowledge has been obtained.
-
- (b) Contributor APIs.
-
-
- If Your Modification is an application programming interface and
- You own or control patents which are reasonably necessary to
- implement that API, you must also include this information in the
- LEGAL file.
-
- 3.5. Required Notices.
-
-
- You must duplicate the notice in Exhibit A in each file of the
- Source Code, and this License in any documentation for the Source Code,
- where You describe recipients' rights relating to Covered Code. If You
- created one or more Modification(s), You may add your name as a
- Contributor to the notice described in Exhibit A. If it is not
- possible to put such notice in a particular Source Code file due to its
- structure, then you must include such notice in a location (such as a
- relevant directory file) where a user would be likely to look for such a
- notice. You may choose to offer, and to charge a fee for, warranty,
- support, indemnity or liability obligations to one or more recipients of
- Covered Code. However, You may do so only on Your own behalf, and not on
- behalf of the Initial Developer or any Contributor. You must make it
- absolutely clear than any such warranty, support, indemnity or liability
- obligation is offered by You alone, and You hereby agree to indemnify the
- Initial Developer and every Contributor for any liability incurred by the
- Initial Developer or such Contributor as a result of warranty, support,
- indemnity or liability terms You offer.
-
- 3.6. Distribution of Executable Versions.
-
-
- You may distribute Covered Code in Executable form only if the
- requirements of Section 3.1-3.5 have been met for that Covered
- Code, and if You include a notice stating that the Source Code version of
- the Covered Code is available under the terms of this License, including
- a description of how and where You have fulfilled the obligations of
- Section 3.2. The notice must be conspicuously included in any
- notice in an Executable version, related documentation or collateral in
- which You describe recipients' rights relating to the Covered Code. You
- may distribute the Executable version of Covered Code under a license of
- Your choice, which may contain terms different from this License,
- provided that You are in compliance with the terms of this License and
- that the license for the Executable version does not attempt to limit or
- alter the recipient's rights in the Source Code version from the rights
- set forth in this License. If You distribute the Executable version under
- a different license You must make it absolutely clear that any terms
- which differ from this License are offered by You alone, not by the
- Initial Developer or any Contributor. You hereby agree to indemnify the
- Initial Developer and every Contributor for any liability incurred by the
- Initial Developer or such Contributor as a result of any such terms You
- offer.
-
- 3.7. Larger Works.
-
-
- You may create a Larger Work by combining Covered Code with other
- code not governed by the terms of this License and distribute the Larger
- Work as a single product. In such a case, You must make sure the
- requirements of this License are fulfilled for the Covered Code.
-
-4. Inability to Comply Due to Statute or Regulation.
-
- If it is impossible for You to comply with any of the terms of this
- License with respect to some or all of the Covered Code due to statute or
- regulation then You must: (a) comply with the terms of this License to
- the maximum extent possible; and (b) describe the limitations and the
- code they affect. Such description must be included in the LEGAL file
- described in Section 3.4 and must be included with all
- distributions of the Source Code. Except to the extent prohibited by
- statute or regulation, such description must be sufficiently detailed for
- a recipient of ordinary skill
- to be able to understand it.
-
-5. Application of this License.
-
- This License applies to code to which the Initial Developer has attached
- the notice in Exhibit A, and to related Covered Code.
-
-6. Versions of the License.
-
- 6.1. New Versions.
-
-
- Netscape Communications Corporation ("Netscape") may publish
- revised and/or new versions of the License from time to time. Each
- version will be given a distinguishing version number.
-
- 6.2. Effect of New Versions.
-
-
- Once Covered Code has been published under a particular version of
- the License, You may always continue to use it under the terms of that
- version. You may also choose to use such Covered Code under the terms of
- any subsequent version of the License published by Netscape. No one other
- than Netscape has the right to modify the terms applicable to Covered
- Code created under this License.
-
- 6.3. Derivative Works.
-
-
- If you create or use a modified version of this License (which you
- may only do in order to apply it to code which is not already Covered
- Code governed by this License), you must (a) rename Your license so that
- the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "NPL"
- or any confusingly similar phrase do not appear anywhere in your license
- and (b) otherwise make it clear that your version of the license contains
- terms which differ from the Mozilla Public License and Netscape Public
- License. (Filling in the name of the Initial Developer, Original Code or
- Contributor in the notice described in Exhibit A shall not of
- themselves be deemed to be modifications of this License.)
-
-7. DISCLAIMER OF WARRANTY.
-
- COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS,
- MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
- RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH
- YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE
- INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY
- NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
- CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE
- IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-8. TERMINATION.
-
- This License and the rights granted hereunder will terminate
- automatically if You fail to comply with terms herein and fail to cure
- such breach within 30 days of becoming aware of the breach. All
- sublicenses to the Covered Code which are properly granted shall survive
- any termination of this License. Provisions which, by their nature, must
- remain in effect beyond the termination of this License shall survive.
-
-9. LIMITATION OF LIABILITY.
-
- UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
- NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY
- OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF
- ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
- INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER
- INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK
- STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
- COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED
- OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL
- NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH
- PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
- LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION
- OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION
- MAY NOT APPLY TO YOU.
-
-10. U.S. GOVERNMENT END USERS.
-
- The Covered Code is a "commercial item," as that term is defined in 48
- C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software"
- and "commercial computer software documentation," as such terms are
- used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212
- and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all
- U.S. Government End Users acquire Covered Code with only those rights set
- forth herein.
-
-11. MISCELLANEOUS.
-
- This License represents the complete agreement concerning subject matter
- hereof. If any provision of this License is held to be unenforceable,
- such provision shall be reformed only to the extent necessary to make it
- enforceable. This License shall be governed by California law provisions
- (except to the extent applicable law, if any, provides otherwise),
- excluding its conflict-of-law provisions. With respect to disputes in
- which at least one party is a citizen of, or an entity chartered or
- registered to do business in, the United States of America: (a) unless
- otherwise agreed in writing, all disputes relating to this License
- (excepting any dispute relating to intellectual property rights) shall be
- subject to final and binding arbitration, with the losing party paying
- all costs of arbitration; (b) any arbitration relating to this Agreement
- shall be held in Santa Clara County, California, under the auspices of
- JAMS/EndDispute; and (c) any litigation relating to this Agreement shall
- be subject to the jurisdiction of the Federal Courts of the Northern
- District of California, with venue lying in Santa Clara County,
- California, with the losing party responsible for costs, including
- without limitation, court costs and reasonable attorneys fees and
- expenses. The application of the United Nations Convention on Contracts
- for the International Sale of Goods is expressly excluded. Any law or
- regulation which provides that the language of a contract shall be
- construed against the drafter shall not apply to this License.
-
-12. RESPONSIBILITY FOR CLAIMS.
-
- Except in cases where another Contributor has failed to comply with
- Section 3.4, You are responsible for damages arising, directly or
- indirectly, out of Your utilization of rights under this License, based
- on the number of copies of Covered Code you made available, the revenues
- you received from utilizing such rights, and other relevant factors. You
- agree to work with affected parties to distribute responsibility on an
- equitable basis.
-
-EXHIBIT A.
-
- "The contents of this file are subject to the Mozilla Public License
- Version 1.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.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- License for the specific language governing rights and limitations under
- the License.
-
- The Original Code is ______________________________________.
-
- The Initial Developer of the Original Code is
- ________________________. Portions created by ______________________ are
- Copyright (C) ______ _______________________. All Rights Reserved.
-
- Contributor(s): ______________________________________."
-
-
-=========================================================================
-== Nunit License ==
-=========================================================================
-Copyright (c) 2002 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
-Copyright (c) 2000-2002 Philip A. Craig
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
-
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
-
- 3. This notice may not be removed or altered from any source
- distribution.
-
-=========================================================================
-== Mentalis Security LibraryLicense ==
-=========================================================================
-
-Source Code License
-
-Copyright © 2002-2007, The Mentalis.org Team
-All rights reserved.
-http://www.mentalis.org/
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-- Neither the name of the Mentalis.org Team, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=========================================================================
-== AMQP License ==
-=========================================================================
-
- Copyright Notice
- ================
- (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc.,
- iMatix Corporation, IONA\ufffd Technologies, Red Hat, Inc.,
- TWIST Process Innovations, and 29West Inc. 2006. All rights reserved.
-
- License
- =======
- JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
- Corporation, IONA\ufffd Technologies, Red Hat, Inc., TWIST Process Innovations, and
- 29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide,
- perpetual, royalty-free, nontransferable, nonexclusive license to
- (i) copy, display, and implement the Advanced Messaging Queue Protocol
- ("AMQP") Specification and (ii) the Licensed Claims that are held by
- the Authors, all for the purpose of implementing the Advanced Messaging
- Queue Protocol Specification. Your license and any rights under this
- Agreement will terminate immediately without notice from
- any Author if you bring any claim, suit, demand, or action related to
- the Advanced Messaging Queue Protocol Specification against any Author.
- Upon termination, you shall destroy all copies of the Advanced Messaging
- Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or
- patent application, throughout the world, excluding design patents and
- design registrations, owned or controlled, or that can be sublicensed
- without fee and in compliance with the requirements of this
- Agreement, by an Author or its affiliates now or at any
- future time and which would necessarily be infringed by implementation
- of the Advanced Messaging Queue Protocol Specification. A claim is
- necessarily infringed hereunder only when it is not possible to avoid
- infringing it because there is no plausible non-infringing alternative
- for implementing the required portions of the Advanced Messaging Queue
- Protocol Specification. Notwithstanding the foregoing, Licensed Claims
- shall not include any claims other than as set forth above even if
- contained in the same patent as Licensed Claims; or that read solely
- on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging
- Queue Protocol Specification, or that, if licensed, would require a
- payment of royalties by the licensor to unaffiliated third parties.
- Moreover, Licensed Claims shall not include (i) any enabling technologies
- that may be necessary to make or use any Licensed Product but are not
- themselves expressly set forth in the Advanced Messaging Queue Protocol
- Specification (e.g., semiconductor manufacturing technology, compiler
- technology, object oriented technology, networking technology, operating
- system technology, and the like); or (ii) the implementation of other
- published standards developed elsewhere and merely referred to in the
- body of the Advanced Messaging Queue Protocol Specification, or
- (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced
- Messaging Queue Protocol Specification. For purposes of this definition,
- the Advanced Messaging Queue Protocol Specification shall be deemed to
- include both architectural and interconnection requirements essential
- for interoperability and may also include supporting source code artifacts
- where such architectural, interconnection requirements and source code
- artifacts are expressly identified as being required or documentation to
- achieve compliance with the Advanced Messaging Queue Protocol Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions
- of products (hardware, software or combinations thereof) that implement
- and are compliant with all relevant portions of the Advanced Messaging
- Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any
- use you may make of the Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS,"
- AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
- IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE
- CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE
- SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY
- PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
- USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE
- PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner,
- including advertising or publicity pertaining to the Advanced Messaging
- Queue Protocol Specification or its contents without specific, written
- prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you
- shall destroy all copies of the Advanced Messaging Queue Protocol
- Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the
- Octagon Symbol are trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA
- Technologies PLC and/or its subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered
- trademarks of Red Hat, Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of
- Sun Microsystems, Inc. in the United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service
- marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
diff --git a/M4-RCs/qpid/dotnet/client-010/NOTICE.txt b/M4-RCs/qpid/dotnet/client-010/NOTICE.txt
deleted file mode 100644
index 0b22ed3ab2..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/NOTICE.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-=========================================================================
-== NOTICE file corresponding to the section 4 d of ==
-== the Apache License, Version 2.0, ==
-== in this case for the Apache Ant distribution. ==
-=========================================================================
-
-Apache Qpid.NET
-Copyright 2006 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-
-This product also includes software developed by:
-
- - The SAXON XSLT Processor from Michael Kay distributed under the Mozilla
- Public License v1.0, which is available for download at
- http://saxon.sourceforge.net/
-
- - The nunit library, Copyright © 2002 James W. Newkirk, Michael C. Two,
- Alexei A. Vorontsov or Copyright © 2000-2002 Philip A. Craig. Available
- under terms based on the zlib/libpng licence. Available from
- http://www.nunit.org/
-
- - The Mentalis Security Library, Copyright © 2002-2006, , The Mentalis.org Team
- under tterms based on the BSD license (http://www.mentalis.org/site/license.qpx).
- Available from http://www.mentalis.org/soft/projects/seclib/
-
-This product includes software, Apache Log4Net
-(http://logging.apache.org/log4net)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-
diff --git a/M4-RCs/qpid/dotnet/client-010/README.txt b/M4-RCs/qpid/dotnet/client-010/README.txt
deleted file mode 100644
index 54875f4356..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/README.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-Info
-====
-
-AMQP 0.10 Native .NET client supporting WCF and xcel
-
-This client is self contained, all dependancies are in this
-directory.
-
-
-Setup
-=====
-
-Install:
- Microsoft Visual Studio 2005 (VS2005)
- NAnt 0.85 - only required for builds outside VS2005 (.net 1.1, .net 2.0, mono 2.0)
- Ant 1.6.5
- Cygwin (or alternatively build via cmd but alter instructions below accordingly)
-
-Set up PATH to include Nant.exe:
-
- $ PATH=/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v2.0.50727:$PATH
-
-Set up PATH to include ant:
-
- $ PATH=$ANT_HOME/bin:$PATH
-
-
-Building
-========
-
-Generate code from <project home>/dotnet/client-010/gentool:
-
- $ cd <project home>/dotnet/client-010/gentool
- $ ant
-
-You can build from Visual Studio 2005 normally. Alternatively, you
-can build debug releases for any supported framework from the
-command line using Nant:
-
-To build .NET 2.0 executables (to bin/net-2.0):
-
- $ cd <project home>/dotnet/client-010/
- $ nant
-
-
-To build for Mono on Linux (to bin/mono-2.0):
-
- $ cd <project home>/dotnet/client-010/
- $ nant -t:mono-2.0
-
-Releasing
-=========
-
-For .NET 2.0
-
- $ cd <project home>/dotnet/client-010/
- $ nant release-pkg
-
-Generates ./bin/net-2.0/release/Qpid.NET-net-2.0-yyyyMMdd.zip
-
-For Mono
-
- $ cd <project home>/dotnet/client-010/
- $ nant -t:mono-2.0 release-pkg
-
-Generates ./bin/mono-2.0/release/Qpid.NET-mono-2.0-yyyyMMdd.zip
-
diff --git a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/Excel.exe.config b/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/Excel.exe.config
deleted file mode 100644
index 69e5bc36d6..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/Excel.exe.config
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<configuration>
- <appSettings>
- <add key="Host" value="localhost" />
- <add key="Port" value="5672" />
- <add key="VirtualHost" value="test" />
- <add key="UserName" value="guest" />
- <add key="Password" value="guest" />
- <!-- <add key="ProcessorAssembly" value="C:\Project\qpid\dotnet\client-010\addins\ExcelAddInMessageProcessor\bin\Debug\ExcelAddInMessageProcessor.dll"/>
- <add key="ProcessorClass" value="ExcelAddInMessageProcessor.Processor"/> -->
- </appSettings>
-</configuration> \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs b/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs
deleted file mode 100644
index d77f3761a8..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.cs
+++ /dev/null
@@ -1,290 +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;
-using System.Collections.Generic;
-using System.Configuration;
-using System.IO;
-using System.Reflection;
-using System.Runtime.InteropServices;
-using System.Text;
-using Microsoft.Office.Interop.Excel;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-
-namespace ExcelAddIn
-{
- public delegate string ProcessMessage(IMessage m);
-
- /// <summary>
- /// This interface must be implemented so to use a user defined message processor
- /// </summary>
- public interface MessageProcessor
- {
- string ProcessMessage(IMessage m);
- }
-
- [ComVisible(true), ProgId("Qpid")]
- public class ExcelAddIn : IRtdServer
- {
- private IRTDUpdateEvent _onMessage;
- private readonly Dictionary<int, IMessage> _topicMessages = new Dictionary<int, IMessage>();
- private readonly Dictionary<string, QpidListener> _queueListener = new Dictionary<string, QpidListener>();
- private readonly Dictionary<int, string> _topicQueueName = new Dictionary<int, string>();
- private Client _client;
- private ClientSession _session;
- private ProcessMessage _messageProcessor;
-
- #region properties
-
- public IRTDUpdateEvent OnMessage
- {
- get { return _onMessage; }
- }
-
- public Dictionary<int, IMessage> TopicMessages
- {
- get { return _topicMessages; }
- }
-
- public ClientSession Session
- {
- get { return _session; }
- }
-
- #endregion
-
-
- #region IRtdServer Members
-
- /// <summary>
- /// Called when Excel requests the first RTD topic for the server.
- /// Connect to the broker, returns a on success and 0 otherwise
- /// </summary>
- /// <param name="CallbackObject"></param>
- /// <returns></returns>
- public int ServerStart(IRTDUpdateEvent CallbackObject)
- {
- _onMessage = CallbackObject;
- string host = "localhost";
- string port = "5673";
- string virtualhost = "test";
- string username = "guest";
- string password = "guest";
- _messageProcessor = getMessage;
-
- if( ConfigurationManager.AppSettings["Host"] != null )
- {
- host = ConfigurationManager.AppSettings["Host"];
- }
- if (ConfigurationManager.AppSettings["Port"] != null)
- {
- port = ConfigurationManager.AppSettings["Port"];
- }
- if (ConfigurationManager.AppSettings["VirtualHost"] != null)
- {
- virtualhost = ConfigurationManager.AppSettings["VirtualHost"];
- }
- if (ConfigurationManager.AppSettings["UserName"] != null)
- {
- username = ConfigurationManager.AppSettings["UserName"];
- }
- if (ConfigurationManager.AppSettings["Password"] != null)
- {
- password = ConfigurationManager.AppSettings["Password"];
- }
- if (ConfigurationManager.AppSettings["ProcessorAssembly"] != null)
- {
- try
- {
- Assembly a = Assembly.LoadFrom(ConfigurationManager.AppSettings["ProcessorAssembly"]);
- Object o = a.CreateInstance(ConfigurationManager.AppSettings["ProcessorClass"]);
- MessageProcessor p = (MessageProcessor) o;
- _messageProcessor = p.ProcessMessage;
- }
- catch (Exception e)
- {
- System.Windows.Forms.MessageBox.Show("Error: \n" + e.StackTrace);
- return 0;
- }
- }
-
- System.Windows.Forms.MessageBox.Show("Connection parameters: \n host: " + host + "\n port: "
- + port + "\n user: " + username);
- try
- {
- _client = new Client();
- _client.connect(host, Convert.ToInt16(port), virtualhost, username, password);
- // create a session
- _session = _client.createSession(0);
- }
- catch (Exception e)
- {
- System.Windows.Forms.MessageBox.Show("Error: \n" + e.StackTrace);
- return 0;
- }
-
- // always successful
- return 1;
- }
-
- /// <summary>
- /// Called whenever Excel requests a new RTD topic from the RealTimeData server.
- /// </summary>
- /// <param name="TopicID"></param>
- /// <param name="Strings"></param>
- /// <param name="GetNewValues"></param>
- /// <returns></returns>
- public object ConnectData(int TopicID, ref Array Strings, ref bool GetNewValues)
- {
- try
- {
- string queuename = "defaultExcelAddInQueue";
- string destinationName = "ExcelAddIn-" + queuename;
- if( Strings.Length > 0 )
- {
- queuename = (string) Strings.GetValue(0);
- }
- // Error message if the queue does not exist
- QueueQueryResult result = (QueueQueryResult)_session.queueQuery(queuename).Result;
- if( result.getQueue() == null )
- {
- System.Windows.Forms.MessageBox.Show("Error: \n queue " + queuename + " does not exist");
- return "error";
- }
-
- QpidListener listener;
- _topicMessages.Add(TopicID, null);
- _topicQueueName.Add(TopicID, queuename);
- if (_queueListener.ContainsKey(queuename))
- {
- listener = _queueListener[queuename];
- listener.addTopic(TopicID);
- }
- else
- {
- listener = new QpidListener(this);
- listener.addTopic(TopicID);
- _queueListener.Add(queuename, listener);
- _session.attachMessageListener(listener, destinationName);
- _session.messageSubscribe(queuename, destinationName, MessageAcceptMode.EXPLICIT,
- MessageAcquireMode.PRE_ACQUIRED, null, 0, null);
- // issue credits
- _session.messageSetFlowMode(destinationName, MessageFlowMode.WINDOW);
- _session.messageFlow(destinationName, MessageCreditUnit.BYTE, ClientSession.MESSAGE_FLOW_MAX_BYTES);
- _session.messageFlow(destinationName, MessageCreditUnit.MESSAGE, 1000);
- _session.sync();
- }
- }
- catch (Exception e)
- {
- System.Windows.Forms.MessageBox.Show("Error: \n" + e.StackTrace);
- return "error";
- }
- return "waiting";
- }
-
- /// <summary>
- /// Called whenever Excel no longer requires a specific topic.
- /// </summary>
- /// <param name="TopicID"></param>
- public void DisconnectData(int TopicID)
- {
- _topicMessages.Remove(TopicID);
- string queueName = _topicQueueName[TopicID];
- if (_topicQueueName.Remove(TopicID) && !_topicQueueName.ContainsValue(queueName))
- {
- _session.messageStop("ExcelAddIn-" + queueName);
- _session.MessageListeners.Remove("ExcelAddIn-" + queueName);
- }
- }
-
- public int Heartbeat()
- {
- return 1;
- }
-
- public Array RefreshData(ref int TopicCount)
- {
- Array result = new object[2, _topicMessages.Count];
- foreach (KeyValuePair<int, IMessage> pair in _topicMessages)
- {
- result.SetValue(pair.Key, 0, pair.Key);
- string value = _messageProcessor(pair.Value);
- result.SetValue(value, 1, pair.Key);
- }
- TopicCount = _topicMessages.Count;
- return result;
- }
-
- public void ServerTerminate()
- {
-
- }
-
- #endregion
- //END IRTDServer METHODS
-
- private string getMessage(IMessage m)
- {
- string res;
- BinaryReader reader = new BinaryReader(m.Body, Encoding.UTF8);
- byte[] body = new byte[m.Body.Length - m.Body.Position];
- reader.Read(body, 0, body.Length);
- ASCIIEncoding enc = new ASCIIEncoding();
- res = enc.GetString(body);
- return res;
- }
-
- }
-
- class QpidListener : IMessageListener
- {
- private readonly ExcelAddIn _excel;
- private readonly List<int> _topics = new List<int>();
-
- public QpidListener(ExcelAddIn excel)
- {
- _excel = excel;
- }
-
- public void addTopic(int topic)
- {
- _topics.Add(topic);
- }
-
- public void messageTransfer(IMessage m)
- {
- foreach (int i in _topics)
- {
- if (_excel.TopicMessages.ContainsKey(i))
- {
- _excel.TopicMessages[i] = m;
- }
- }
- // ack this message
- RangeSet rs = new RangeSet();
- rs.add(m.Id);
- _excel.Session.messageAccept(rs);
- _excel.OnMessage.UpdateNotify();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj b/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj
deleted file mode 100644
index ea2d6b7198..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/ExcelAddIn.csproj
+++ /dev/null
@@ -1,67 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{85EFD719-39F6-4471-90FF-9E621430344B}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>ExcelAddIn</RootNamespace>
- <AssemblyName>Qpid Excel AddIn</AssemblyName>
- <StartupObject>
- </StartupObject>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- <OldToolsVersion>2.0</OldToolsVersion>
- </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>
- <RegisterForComInterop>true</RegisterForComInterop>
- <DocumentationFile>bin\Debug\Qpid Excel AddIn.XML</DocumentationFile>
- </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="Microsoft.Office.Interop.Excel, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
- <Reference Include="System" />
- <Reference Include="System.configuration" />
- <Reference Include="System.Data" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="Excel.exe.config" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/Properties/AssemblyInfo.cs
deleted file mode 100644
index db5fa500bc..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddIn/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-
-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("Qpid Excel AddIn")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Qpid Excel AddIn")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("3bbd4414-60df-407f-9c64-c14b221167af")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj b/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj
deleted file mode 100644
index 7929933ef7..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/ExcelAddInMessageProcessor.csproj
+++ /dev/null
@@ -1,61 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{C2AE83A3-D5D1-469D-8611-A4738B9997CF}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>ExcelAddInMessageProcessor</RootNamespace>
- <AssemblyName>ExcelAddInMessageProcessor</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- <ProjectReference Include="..\ExcelAddIn\ExcelAddIn.csproj">
- <Project>{85EFD719-39F6-4471-90FF-9E621430344B}</Project>
- <Name>ExcelAddIn</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs b/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs
deleted file mode 100644
index 0b2d27519f..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Processor.cs
+++ /dev/null
@@ -1,44 +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.IO;
-using System.Text;
-using org.apache.qpid.client;
-
-namespace ExcelAddInMessageProcessor
-{
- class Processor : ExcelAddIn.MessageProcessor
- {
- public string ProcessMessage(IMessage m)
- {
- BinaryReader reader = new BinaryReader(m.Body, Encoding.UTF8);
- byte[] body = new byte[m.Body.Length - m.Body.Position];
- reader.Read(body, 0, body.Length);
- ASCIIEncoding enc = new ASCIIEncoding();
- string res = enc.GetString(body);
- if (m.ApplicationHeaders.ContainsKey("price"))
- {
- res = res + ": price: " + m.ApplicationHeaders["price"];
- }
- return res;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs
deleted file mode 100644
index f6bef8ac1d..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInMessageProcessor/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-
-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("ExcelAddInMessageProcessor")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("ExcelAddInMessageProcessor")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("d20b2d75-7b8b-4f7d-8a81-40a4cce94195")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj b/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj
deleted file mode 100644
index 0969c61bd4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/ExcelAddInProducer.csproj
+++ /dev/null
@@ -1,57 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{80F00C3B-EB38-4B3B-9F77-68977A30B155}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>ExcelAddInProducer</RootNamespace>
- <AssemblyName>Qpid Excel AddIn Producer</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/Program.cs b/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/Program.cs
deleted file mode 100644
index 9c9edcb249..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/Program.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;
-using System.Text;
-using System.Threading;
-using org.apache.qpid.client;
-
-namespace ExcelAddInProducer
-{
- class Program
- {
- static void Main(string[] args)
- {
- Client client = new Client();
- Console.WriteLine("Client created");
- client.connect("192.168.1.14", 5672, "test", "guest", "guest");
- Console.WriteLine("Connection established");
-
- ClientSession ssn = client.createSession(50000);
- Console.WriteLine("Session created");
- ssn.queueDeclare("queue1", null, null);
- ssn.exchangeBind("queue1", "amq.direct", "queue1", null);
- IMessage message = new Message();
- message.ApplicationHeaders.Add("price", 0);
- for (int i = 0; i < 100; i++)
- {
- message.clearData();
- message.appendData( Encoding.UTF8.GetBytes("test: " + i));
- message.ApplicationHeaders["price"] = i;
- ssn.messageTransfer("amq.direct", "queue1", message);
- Thread.Sleep(1000);
- }
-
- client.close();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/Properties/AssemblyInfo.cs
deleted file mode 100644
index edac96cfc4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/addins/ExcelAddInProducer/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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("Qpid Excel AddIn Producer")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Qpid Excel AddIn Producer")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("3416a5c2-eb70-4d77-b401-dfa659bd419e")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/addins/README.txt b/M4-RCs/qpid/dotnet/client-010/addins/README.txt
deleted file mode 100644
index 486a708910..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/addins/README.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-This project contains three sub-projects:
-- The RTD excell Addin
-- A sample client sending messages to queue1
-- A ample message processor
-
-RDT AddIn
-Excel provides a function called RTD (real-time data) that lets you specify a COM server via its ProgId here "Qpid" so that you can push qpid messages into Excel.
-For using the Qpid RTD follows those steps:
-
-1) Copy the configuration Excel.exe.config into C:\Program Files\Microsoft Office\Office12
-2) Edit Excel.exe.xml and set the targeted Qpid broker host, port number
-3) Select the cell or cell range to contain the information
-4) enter the following formula =rtd("Qpid",,"myQueue") Where MyQueue is the queue from which you wish to receive messages from
-
-Note: The Qpid RTD is a COM-AddIn that must be registered with Excel. This is done automatically when compiling the Addin with visual studio.
-
-The default behavior of the RDT AddIn is to display the message payload. This could be altered by specifying your own message processor.
-A Message processor is a class that implements the API ExcelAddIn.MessageProcessor. For example, the provided processor in client-010\addins\ExcelAddInMessageProcessor displays the message body and the the header price when specified.
-
-To use you own message processor follows those steps:
-1) Write your own message processor that extends ExcelAddIn.MessageProcessor
-2) Edit Excel.exe.config and uncomment the entries:
- <add key="ProcessorAssembly" value="<path>\qpid\dotnet\client-010\addins\ExcelAddInMessageProcessor\bin\Debug\ExcelAddInMessageProcessor.dll"/>
- <add key="ProcessorClass" value="ExcelAddInMessageProcessor.Processor"/>
-- ProcessorAssembly is the path on the Assembly that contains your processor class
-- ProcessorClass is your processor class name
-3) run excel and define a rtd function
-
-Note: the provided ExcelAddInProducer can be used for testing the provided message processor. As messages are sent to queue1 the following rtd fucntion should be used =rtd("Qpiud",,"queue1") \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/Client.csproj b/M4-RCs/qpid/dotnet/client-010/client/Client.csproj
deleted file mode 100644
index e449781722..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/Client.csproj
+++ /dev/null
@@ -1,55 +0,0 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{B911FFD7-754F-4735-A188-218D5065BE79}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>client</RootNamespace>
- <AssemblyName>Qpid Client</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\log4net\log4net.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="**\*.cs" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/client/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/client/Properties/AssemblyInfo.cs
deleted file mode 100644
index 5ab0be9a99..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-
-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("Qpid Client")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Qpid Client")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("dac7ef42-e9c8-45a5-8050-1301b6f8160e")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client.sln b/M4-RCs/qpid/dotnet/client-010/client/client.sln
deleted file mode 100644
index c94509e72a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client.sln
+++ /dev/null
@@ -1,104 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "Client.csproj", "{B911FFD7-754F-4735-A188-218D5065BE79}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo", "..\demo\Demo.csproj", "{E4C46FBC-7560-406D-BFEF-CA010E584DF4}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelAddIn", "..\addins\ExcelAddIn\ExcelAddIn.csproj", "{85EFD719-39F6-4471-90FF-9E621430344B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelAddInProducer", "..\addins\ExcelAddInProducer\ExcelAddInProducer.csproj", "{80F00C3B-EB38-4B3B-9F77-68977A30B155}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example-direct-producer", "..\examples\direct\example-direct-producer\example-direct-producer.csproj", "{96FCB250-8142-40EE-9BDD-CA839EE21021}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example-direct-Listener", "..\examples\direct\example-direct-Listener\example-direct-Listener.csproj", "{AE65B1B9-8779-4CB1-91AF-E7F6C7A736D7}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example-pub-sub-Listener", "..\examples\pub-sub\example-pub-sub-Listener\example-pub-sub-Listener.csproj", "{2BCDC2CC-5BDA-4CC7-944D-2899AD8A53C7}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example-pub-sub-Publisher", "..\examples\pub-sub\example-pub-sub-Publisher\example-pub-sub-Publisher.csproj", "{F8857634-A134-44E7-A953-F2B22688C599}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "..\test\Test.csproj", "{95CB4C90-7C53-44A9-B11C-96235F158ACA}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example-request-response-Client", "..\examples\request-response\example-request-response-Client\example-request-response-Client.csproj", "{1BC63815-4029-4039-9207-35E7E06ECC99}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example-request-response-Server", "..\examples\request-response\example-request-response-Server\example-request-response-Server.csproj", "{922FBA9C-E483-4AEF-ABE8-AC87421E829B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example-fanout-Producer", "..\examples\fanout\example-fanout-Producer\example-fanout-Producer.csproj", "{4513BF94-D54A-42FE-8506-FE2CD57B2C51}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "example-fanout-Listener", "..\examples\fanout\example-fanout-Listener\example-fanout-Listener.csproj", "{18A0792B-DC3A-4EC5-93D6-DB8A111D8F15}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "perftest", "..\perftest\perftest.csproj", "{7F7E8DE7-FDF2-4A52-A4CE-D3756B05273C}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExcelAddInMessageProcessor", "..\addins\ExcelAddInMessageProcessor\ExcelAddInMessageProcessor.csproj", "{C2AE83A3-D5D1-469D-8611-A4738B9997CF}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {B911FFD7-754F-4735-A188-218D5065BE79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B911FFD7-754F-4735-A188-218D5065BE79}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B911FFD7-754F-4735-A188-218D5065BE79}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B911FFD7-754F-4735-A188-218D5065BE79}.Release|Any CPU.Build.0 = Release|Any CPU
- {E4C46FBC-7560-406D-BFEF-CA010E584DF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E4C46FBC-7560-406D-BFEF-CA010E584DF4}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E4C46FBC-7560-406D-BFEF-CA010E584DF4}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E4C46FBC-7560-406D-BFEF-CA010E584DF4}.Release|Any CPU.Build.0 = Release|Any CPU
- {85EFD719-39F6-4471-90FF-9E621430344B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {85EFD719-39F6-4471-90FF-9E621430344B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {85EFD719-39F6-4471-90FF-9E621430344B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {85EFD719-39F6-4471-90FF-9E621430344B}.Release|Any CPU.Build.0 = Release|Any CPU
- {80F00C3B-EB38-4B3B-9F77-68977A30B155}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {80F00C3B-EB38-4B3B-9F77-68977A30B155}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {80F00C3B-EB38-4B3B-9F77-68977A30B155}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {80F00C3B-EB38-4B3B-9F77-68977A30B155}.Release|Any CPU.Build.0 = Release|Any CPU
- {96FCB250-8142-40EE-9BDD-CA839EE21021}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {96FCB250-8142-40EE-9BDD-CA839EE21021}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {96FCB250-8142-40EE-9BDD-CA839EE21021}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {96FCB250-8142-40EE-9BDD-CA839EE21021}.Release|Any CPU.Build.0 = Release|Any CPU
- {AE65B1B9-8779-4CB1-91AF-E7F6C7A736D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AE65B1B9-8779-4CB1-91AF-E7F6C7A736D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AE65B1B9-8779-4CB1-91AF-E7F6C7A736D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AE65B1B9-8779-4CB1-91AF-E7F6C7A736D7}.Release|Any CPU.Build.0 = Release|Any CPU
- {2BCDC2CC-5BDA-4CC7-944D-2899AD8A53C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {2BCDC2CC-5BDA-4CC7-944D-2899AD8A53C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {2BCDC2CC-5BDA-4CC7-944D-2899AD8A53C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {2BCDC2CC-5BDA-4CC7-944D-2899AD8A53C7}.Release|Any CPU.Build.0 = Release|Any CPU
- {F8857634-A134-44E7-A953-F2B22688C599}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F8857634-A134-44E7-A953-F2B22688C599}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F8857634-A134-44E7-A953-F2B22688C599}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F8857634-A134-44E7-A953-F2B22688C599}.Release|Any CPU.Build.0 = Release|Any CPU
- {95CB4C90-7C53-44A9-B11C-96235F158ACA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {95CB4C90-7C53-44A9-B11C-96235F158ACA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {95CB4C90-7C53-44A9-B11C-96235F158ACA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {95CB4C90-7C53-44A9-B11C-96235F158ACA}.Release|Any CPU.Build.0 = Release|Any CPU
- {1BC63815-4029-4039-9207-35E7E06ECC99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1BC63815-4029-4039-9207-35E7E06ECC99}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1BC63815-4029-4039-9207-35E7E06ECC99}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1BC63815-4029-4039-9207-35E7E06ECC99}.Release|Any CPU.Build.0 = Release|Any CPU
- {922FBA9C-E483-4AEF-ABE8-AC87421E829B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {922FBA9C-E483-4AEF-ABE8-AC87421E829B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {922FBA9C-E483-4AEF-ABE8-AC87421E829B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {922FBA9C-E483-4AEF-ABE8-AC87421E829B}.Release|Any CPU.Build.0 = Release|Any CPU
- {4513BF94-D54A-42FE-8506-FE2CD57B2C51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4513BF94-D54A-42FE-8506-FE2CD57B2C51}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4513BF94-D54A-42FE-8506-FE2CD57B2C51}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4513BF94-D54A-42FE-8506-FE2CD57B2C51}.Release|Any CPU.Build.0 = Release|Any CPU
- {18A0792B-DC3A-4EC5-93D6-DB8A111D8F15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {18A0792B-DC3A-4EC5-93D6-DB8A111D8F15}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {18A0792B-DC3A-4EC5-93D6-DB8A111D8F15}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {18A0792B-DC3A-4EC5-93D6-DB8A111D8F15}.Release|Any CPU.Build.0 = Release|Any CPU
- {7F7E8DE7-FDF2-4A52-A4CE-D3756B05273C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7F7E8DE7-FDF2-4A52-A4CE-D3756B05273C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7F7E8DE7-FDF2-4A52-A4CE-D3756B05273C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7F7E8DE7-FDF2-4A52-A4CE-D3756B05273C}.Release|Any CPU.Build.0 = Release|Any CPU
- {C2AE83A3-D5D1-469D-8611-A4738B9997CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C2AE83A3-D5D1-469D-8611-A4738B9997CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C2AE83A3-D5D1-469D-8611-A4738B9997CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C2AE83A3-D5D1-469D-8611-A4738B9997CF}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client.suo b/M4-RCs/qpid/dotnet/client-010/client/client.suo
deleted file mode 100644
index cfdbf4be93..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client.suo
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client/Client.cs b/M4-RCs/qpid/dotnet/client-010/client/client/Client.cs
deleted file mode 100644
index 4871a1c3d9..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client/Client.cs
+++ /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.
-*/
-using System;
-using System.Text;
-using System.Threading;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.network.io;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.client
-{
- public class Client : ClientInterface
- {
- private Connection _conn;
- private static readonly Logger _log = Logger.get(typeof (Client));
- private const long timeout = 60000;
- private bool _closed;
- private readonly Object _closeOK;
- private ClosedListener _closedListner;
-
- public bool Closed
- {
- get { return _closed; }
- set { _closed = value; }
- }
-
- public Object CloseOk
- {
- get { return _closeOK; }
- }
-
- public Client()
- {
- _closed = false;
- _closeOK = new object();
- }
-
- #region Interface ClientInterface
-
- /// <summary>
- /// Establishes a connection with a broker using the provided user auths
- ///
- /// </summary>
- /// <param name="host">Host name on which a broker is deployed</param>
- /// <param name="port">Broker port </param>
- /// <param name="virtualHost">virtual host name</param>
- /// <param name="username">User Name</param>
- /// <param name="password">Password</param>
- public void connect(String host, int port, String virtualHost, String username, String password)
- {
- _log.debug(String.Format("Client Connecting to host {0}; port {1}; virtualHost {2}; username {3}", host,
- port, virtualHost, username));
- ConnectionDelegate connectionDelegate = new ClientConnectionDelegate(this, username, password);
- ManualResetEvent negotiationComplete = new ManualResetEvent(false);
- connectionDelegate.setCondition(negotiationComplete);
- connectionDelegate.VirtualHost = virtualHost;
- _conn = IoTransport.connect(host, port, connectionDelegate);
-
- _conn.send(new ProtocolHeader(1, 0, 10));
- negotiationComplete.WaitOne();
- }
-
- /// <summary>
- /// Establishes a connection with a broker using SSL
- ///
- /// </summary>
- /// <param name="host">Host name on which a broker is deployed</param>
- /// <param name="port">Broker port </param>
- /// <param name="virtualHost">virtual host name</param>
- /// <param name="username">User Name</param>
- /// <param name="password">Password</param>
- /// <param name="serverName">Name of the SSL server</param>
- /// <param name="certPath">Path to the X509 certificate to be used for client authentication</param>
- /// <param name="rejectUntrusted">If true connection will not be established if the broker is not trusted</param>
- public void connectSSL(String host, int port, String virtualHost, String username, String password, string serverName, string certPath, bool rejectUntrusted)
- {
- _log.debug(String.Format("Client Connecting to host {0}; port {1}; virtualHost {2}; username {3}", host,
- port, virtualHost, username));
- _log.debug(String.Format("SSL paramters: serverName: {0}; certPath: {1}; rejectUntrusted: {2}", serverName, certPath, rejectUntrusted));
- ConnectionDelegate connectionDelegate = new ClientConnectionDelegate(this, username, password);
- ManualResetEvent negotiationComplete = new ManualResetEvent(false);
- connectionDelegate.setCondition(negotiationComplete);
- connectionDelegate.VirtualHost = virtualHost;
- _conn = IoSSLTransport.connect(host, port, serverName, certPath, rejectUntrusted, connectionDelegate);
-
- _conn.send(new ProtocolHeader(1, 0, 10));
- negotiationComplete.WaitOne();
- }
-
- public void close()
- {
- Channel ch = _conn.getChannel(0);
- ch.connectionClose(ConnectionCloseCode.NORMAL, "client is closing");
- lock (CloseOk)
- {
- DateTime start = DateTime.Now;
- long elapsed = 0;
- while (!Closed && elapsed < timeout)
- {
- Monitor.Wait(CloseOk, (int) (timeout - elapsed));
- elapsed = DateTime.Now.Subtract(start).Milliseconds;
- }
- if (!Closed)
- {
- throw new Exception("Timed out when closing connection");
- }
- _conn.close();
- }
- }
-
- public ClientSession createSession(long expiryInSeconds)
- {
- Channel ch = _conn.getChannel();
- ClientSession ssn = new ClientSession(Encoding.UTF8.GetBytes(UUID.randomUUID().ToString()));
- ssn.attach(ch);
- ssn.sessionAttach(ssn.getName());
- ssn.sessionRequestTimeout(expiryInSeconds);
- return ssn;
- }
-
- public ClosedListener ClosedListener
- {
- set { _closedListner = value; }
- get { return _closedListner; }
- }
-
- #endregion
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client/ClientConnectionDelegate.cs b/M4-RCs/qpid/dotnet/client-010/client/client/ClientConnectionDelegate.cs
deleted file mode 100644
index 5ed4187b36..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client/ClientConnectionDelegate.cs
+++ /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.
-*/
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using System.Threading;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.client
-{
- internal class ClientConnectionDelegate : ClientDelegate
- {
- private static readonly Logger log = Logger.get(typeof (ClientConnectionDelegate));
- private readonly Client _client;
- private string _username;
- private string _password;
-
- public ClientConnectionDelegate(Client client, string username, string pasword)
- {
- _client = client;
- _username = username;
- _password = pasword;
- }
-
- public override SessionDelegate getSessionDelegate()
- {
- return new ClientSessionDelegate();
- }
-
- public override void exception(Exception t)
- {
- throw t;
- }
-
- public override void connectionStart(Channel context, ConnectionStart mystruct)
- {
- const string mechanism = "PLAIN";
- MemoryStream stResponse = new MemoryStream();
- byte[] part = Encoding.UTF8.GetBytes(_username);
- stResponse.WriteByte(0);
- stResponse.Write(part, 0, part.Length);
- stResponse.WriteByte(0);
- part = Encoding.UTF8.GetBytes(_password);
- stResponse.Write(part, 0, part.Length);
- Dictionary<String, Object> props = new Dictionary<String, Object>();
- context.connectionStartOk(props, mechanism, stResponse.ToArray(), "utf8");
- }
-
- public override void closed()
- {
- log.debug("Delegate closed");
- lock (_client.CloseOk)
- {
- try
- {
- _client.Closed = true;
- Monitor.PulseAll(_client.CloseOk);
- }
- catch (Exception e)
- {
- throw new SystemException("Error when closing client", e);
- }
- }
- }
-
- public override void connectionClose(Channel context, ConnectionClose connectionClose)
- {
- base.connectionClose(context, connectionClose);
- ErrorCode errorCode = ErrorCode.getErrorCode((int) connectionClose.getReplyCode());
- if (_client.ClosedListener == null && errorCode.Code != (int) QpidErrorCode.NO_ERROR)
- {
- throw new Exception ("Server closed the connection: Reason " +
- connectionClose.getReplyText());
- }
- _client.ClosedListener.onClosed(errorCode, connectionClose.getReplyText(), null);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client/ClientInterface.cs b/M4-RCs/qpid/dotnet/client-010/client/client/ClientInterface.cs
deleted file mode 100644
index 85be5886c6..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client/ClientInterface.cs
+++ /dev/null
@@ -1,59 +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;
-
-namespace org.apache.qpid.client
-{
- public interface ClientInterface
- {
- /// <summary>
- /// Establish a connection with the broker using the given parameters
- ///
- /// </summary>
- /// <param name="host">host name</param>
- /// <param name="port">port number</param>
- /// <param name="virtualHost">virtualHost the virtual host name</param>
- /// <param name="username"> username user name</param>
- /// <param name="passwor">password password</param>
- void connect(String host, int port, String virtualHost, String username, String passwor);
-
- /// <summary>
- /// Close this client
- /// </summary>
- void close();
-
- /// <summary>
- /// Create a session for this connection.
- /// The returned session is suspended
- /// (i.e. this session is not attached to an underlying channel)
- /// </summary>
- /// <param name="expiryInSeconds">Expiry time expressed in seconds, if the value is less than
- /// or equal to 0 then the session does not expire.</param>
- /// <returns>A newly created (suspended) session.</returns>
- ClientSession createSession(long expiryInSeconds);
-
- /// <summary>
- /// If the communication layer detects a serious problem with a connection, it
- // informs the client's ClosedListener
- /// </summary>
- ///
- ClosedListener ClosedListener { set; }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client/ClientSession.cs b/M4-RCs/qpid/dotnet/client-010/client/client/ClientSession.cs
deleted file mode 100644
index 2dbc27ecd9..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client/ClientSession.cs
+++ /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.
- *
- */
-
-
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.client
-{
- /// <summary> Implements a Qpid Sesion.</summary>
- public class ClientSession : Session
- {
- public static short TRANSFER_ACQUIRE_MODE_NO_ACQUIRE = 1;
- public static short TRANSFER_ACQUIRE_MODE_PRE_ACQUIRE = 0;
- public static short TRANSFER_CONFIRM_MODE_REQUIRED = 0;
- public static short TRANSFER_CONFIRM_MODE_NOT_REQUIRED = 1;
- public static short MESSAGE_FLOW_MODE_CREDIT = 0;
- public static short MESSAGE_FLOW_MODE_WINDOW = 1;
- public static short MESSAGE_FLOW_UNIT_MESSAGE = 0;
- public static short MESSAGE_FLOW_UNIT_BYTE = 1;
- public static long MESSAGE_FLOW_MAX_BYTES = 0xFFFFFFFF;
- public static short MESSAGE_REJECT_CODE_GENERIC = 0;
- public static short MESSAGE_REJECT_CODE_IMMEDIATE_DELIVERY_FAILED = 1;
- public static short MESSAGE_ACQUIRE_ANY_AVAILABLE_MESSAGE = 0;
- public static short MESSAGE_ACQUIRE_MESSAGES_IF_ALL_ARE_AVAILABLE = 1;
-
- private Dictionary<String, IMessageListener> _listeners = new Dictionary<String, IMessageListener>();
-
- public ClientSession(byte[] name) : base(name)
- {
- }
-
- public void attachMessageListener(IMessageListener listener, string Destination)
- {
- _listeners.Add(Destination, listener);
- }
-
- public Dictionary<String, IMessageListener> MessageListeners
- {
- get { return _listeners; }
- }
-
- public void messageTransfer(String destination, string routingkey, IMessage message)
- {
- message.DeliveryProperties.setRoutingKey(routingkey);
- messageTransfer(destination, message);
- }
-
- public void messageTransfer(String destination, IMessage message)
- {
- byte[] body = new byte[message.Body.Position];
- message.Body.Seek(0, SeekOrigin.Begin);
- message.Body.Read(body, 0, body.Length);
- message.MessageProperties.setMessageId(UUID.randomUUID());
- messageTransfer(destination,
- MessageAcceptMode.NONE,
- MessageAcquireMode.PRE_ACQUIRED,
- message.Header,
- body);
- }
-
- public void queueDeclare(String queue)
- {
- queueDeclare(queue, null, null);
- }
-
- public void queueDeclare(String queue, params Option[] options)
- {
- queueDeclare(queue, null, null, options);
- }
-
- public void exchangeBind(String queue, String exchange, String bindingKey)
- {
- exchangeBind(queue, exchange, bindingKey, null);
- }
-
- public void messageSubscribe(String queue)
- {
- messageSubscribe(queue, queue, MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED, null, 0, null);
- // issue credits
- messageSetFlowMode(queue, MessageFlowMode.WINDOW);
- messageFlow(queue, MessageCreditUnit.BYTE, ClientSession.MESSAGE_FLOW_MAX_BYTES);
- messageFlow(queue, MessageCreditUnit.MESSAGE, 10000);
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client/ClientSessionDelegate.cs b/M4-RCs/qpid/dotnet/client-010/client/client/ClientSessionDelegate.cs
deleted file mode 100644
index 1b40e2ba45..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client/ClientSessionDelegate.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 org.apache.qpid.transport;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.client
-{
- public class ClientSessionDelegate : SessionDelegate
- {
- private static readonly Logger _log = Logger.get(typeof (ClientSessionDelegate));
-
- // --------------------------------------------
- // Message methods
- // --------------------------------------------
- public override void messageTransfer(Session session, MessageTransfer xfr)
- {
- if (((ClientSession) session).MessageListeners.ContainsKey(xfr.getDestination()))
- {
- IMessageListener listener = ((ClientSession)session).MessageListeners[xfr.getDestination()];
- listener.messageTransfer( new Message(xfr));
- }
- else
- {
- _log.warn("No listener set for: {0}", xfr);
- }
- }
-
- public override void messageReject(Session session, MessageReject mstruct)
- {
- foreach (Range range in mstruct.getTransfers())
- {
- for (long l = range.Lower; l <= range.Upper; l++)
- {
- _log.warn("message rejected: " + session.getCommand((int) l));
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client/ClosedListenerInterface.cs b/M4-RCs/qpid/dotnet/client-010/client/client/ClosedListenerInterface.cs
deleted file mode 100644
index 8089c3bd90..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client/ClosedListenerInterface.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.
-*/
-
-using System;
-
-namespace org.apache.qpid.client
-{
- public interface ClosedListener
- {
-
- void onClosed(ErrorCode errorCode, String reason, Exception t);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client/ErrorCode.cs b/M4-RCs/qpid/dotnet/client-010/client/client/ErrorCode.cs
deleted file mode 100644
index 226f078dac..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client/ErrorCode.cs
+++ /dev/null
@@ -1,140 +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;
-
-namespace org.apache.qpid.client
-{
- public enum QpidErrorCode
- {
- NO_ERROR = 200,
- CONTENT_TOO_LARGE = 311,
- NO_ROUTE = 312,
- NO_CONSUMERS = 313,
- CONNECTION_FORCED = 320,
- INVALID_PATH = 402,
- ACCESS_REFUSED = 403,
- NOT_FOUND = 404,
- RESOURCE_LOCKED = 405,
- PRE_CONDITION_FAILED = 406,
- FRAME_ERROR = 501,
- SYNTAX_ERROR = 502,
- COMMAND_INVALID = 503,
- SESSION_ERROR = 504,
- NOT_ALLOWED = 530,
- NOT_IMPLEMENTED = 540,
- INTERNAL_ERROR = 541,
- INVALID_ARGUMENT = 542,
- UNDEFINED = 1
- }
-
- public struct ErrorCode
- {
- private int _code;
- private String _desc;
- private readonly bool _hardError;
-
- public ErrorCode(int code, String desc, bool hardError)
- {
- _code = code;
- _desc = desc;
- _hardError = hardError;
- }
-
- public int Code
- {
- get { return _code; }
- set { _code = value; }
- }
-
- public String Description
- {
- get { return _desc; }
- set { _desc = value; }
- }
-
- public bool ISHardError
- {
- get { return _hardError; }
- }
-
- public static ErrorCode getErrorCode(int code)
- {
- switch (code)
- {
- case 200:
- return
- new ErrorCode(200, "reply-success", true);
- case 311:
- return
- new ErrorCode(311, "content-too-large", false);
- case 312:
- return
- new ErrorCode(312, "no-route", false);
- case 313:
- return
- new ErrorCode(313, "content-consumers", false);
- case 320:
- return
- new ErrorCode(320, "connection-forced", true);
- case 402:
- return
- new ErrorCode(402, "invalid-path", true);
- case 403:
- return
- new ErrorCode(403, "access-refused", false);
- case 404:
- return
- new ErrorCode(404, "not-found", false);
- case 405:
- return
- new ErrorCode(405, "resource-locked", false);
- case 406:
- return
- new ErrorCode(406, "precondition-failed", false);
- case 501:
- return
- new ErrorCode(501, "frame_error", true);
- case 502:
- return
- new ErrorCode(502, "syntax_error", true);
- case 503:
- return
- new ErrorCode(503, "command_invalid", true);
- case 504:
- return
- new ErrorCode(504, "sesion_error", true);
- case 530:
- return
- new ErrorCode(530, "not_allowed", true);
- case 540:
- return
- new ErrorCode(540, "not_implemented", true);
- case 541:
- return
- new ErrorCode(541, "internal_error", true);
- case 542:
- return
- new ErrorCode(542, "invalid_argument", true);
- default:
- return new ErrorCode(1, "undefined", true);
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client/IMessage.cs b/M4-RCs/qpid/dotnet/client-010/client/client/IMessage.cs
deleted file mode 100644
index 10b92de7ff..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client/IMessage.cs
+++ /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.
-*
-*/
-using System;
-using System.Collections.Generic;
-using System.IO;
-using org.apache.qpid.transport;
-
-namespace org.apache.qpid.client
-{
- public interface IMessage
- {
- int Id { get; }
-
- Header Header { get; set; }
-
- MessageProperties MessageProperties { get; set; }
-
- DeliveryProperties DeliveryProperties { get; set; }
-
- Dictionary<String, Object> ApplicationHeaders { get; set; }
-
- void appendData(byte[] bytes);
-
- MemoryStream Body { get; }
-
- string Destination { get; }
-
- void clearData();
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client/Message.cs b/M4-RCs/qpid/dotnet/client-010/client/client/Message.cs
deleted file mode 100644
index 567ca5cae7..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client/Message.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.
-*
-*/
-using System.Collections.Generic;
-using System.IO;
-using org.apache.qpid.transport;
-
-namespace org.apache.qpid.client
-{
- public class Message : IMessage
- {
- private readonly MessageTransfer _message;
-
- public Message(MessageTransfer m)
- {
- _message = m;
- }
-
- public Message()
- {
- _message = new MessageTransfer();
- _message.Header = new Header( new MessageProperties(), new DeliveryProperties());
- ((MessageProperties) _message.Header.Structs[0]).setApplicationHeaders(new Dictionary<string, object>());
- }
-
- public MessageProperties MessageProperties
- {
- get
- {
- if (_message.Header != null && Header.Structs.Length > 1)
- return (MessageProperties) Header.Structs[0];
- return null;
- }
- set
- {
- if (_message.Header != null)
- {
- Header.Structs[0] = value;
- }
- }
- }
-
- public DeliveryProperties DeliveryProperties
- {
- get
- {
- if (Header != null)
- {
- if( Header.Structs.Length > 1 )
- return (DeliveryProperties)Header.Structs[1];
- return (DeliveryProperties)Header.Structs[0];
- }
-
- return null;
- }
- set
- {
- if (Header != null)
- {
- Header.Structs[1] = value;
- }
- }
- }
-
- public Dictionary<string, object> ApplicationHeaders
- {
- get
- {
- if (Header != null)
- return ((MessageProperties) Header.Structs[0]).getApplicationHeaders();
- return null;
- }
- set
- {
- if (Header != null)
- {
- ((MessageProperties) Header.Structs[0]).setApplicationHeaders(value);
- }
- }
- }
-
- public void appendData(byte[] bytes)
- {
- Body.Write(bytes, 0, bytes.Length);
- }
-
- public void clearData()
- {
- Body.Seek(0, SeekOrigin.Begin);
- }
-
- public Header Header
- {
- get{ return _message.Header;}
- set{ _message.Header = value;}
- }
-
- public MemoryStream Body
- {
- get { return _message.Body; }
- set { _message.Body = value; }
- }
-
- public int Id
- {
- get { return _message.Id; }
- }
-
- public string Destination
- {
- get{ return _message.getDestination();}
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs b/M4-RCs/qpid/dotnet/client-010/client/client/MessageListenerInterface.cs
deleted file mode 100644
index 978248e04c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/client/MessageListenerInterface.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 org.apache.qpid.client
-{
- public interface IMessageListener
- {
- /// <summary>
- /// Inform the listener of the message transfer
- /// </summary>
- /// <param name="xfr">The message transfer object</param>
- void messageTransfer(IMessage xfr);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/default.build b/M4-RCs/qpid/dotnet/client-010/client/default.build
deleted file mode 100644
index 139796a58d..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/default.build
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="qpid.client" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Binary.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Binary.cs
deleted file mode 100644
index ab829dfb69..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Binary.cs
+++ /dev/null
@@ -1,129 +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 org.apache.qpid.transport
-{
-
-
- /// <summary>
- /// Binary
- /// </summary>
-
- public sealed class Binary
- {
-
- private readonly byte[] bytes;
- private readonly int offset_Renamed_Field;
- private readonly int size_Renamed_Field;
- private int hash = 0;
-
- public Binary(byte[] bytes, int offset, int size)
- {
- if (offset + size > bytes.Length)
- {
- throw new System.IndexOutOfRangeException();
- }
-
- this.bytes = bytes;
- offset_Renamed_Field = offset;
- size_Renamed_Field = size;
- }
-
- public Binary(byte[] bytes):this(bytes, 0, bytes.Length)
- {
- }
-
- public byte[] array()
- {
- return bytes;
- }
-
- public int offset()
- {
- return offset_Renamed_Field;
- }
-
- public int size()
- {
- return size_Renamed_Field;
- }
-
- public Binary slice(int low, int high)
- {
- int sz;
-
- if (high < 0)
- {
- sz = size_Renamed_Field + high;
- }
- else
- {
- sz = high - low;
- }
-
- if (sz < 0)
- {
- sz = 0;
- }
-
- return new Binary(bytes, offset_Renamed_Field + low, sz);
- }
-
- public override int GetHashCode()
- {
- if (hash == 0)
- {
- int hc = 0;
- for (int i = 0; i < size_Renamed_Field; i++)
- {
- hc = 31 * hc + (0xFF & bytes[offset_Renamed_Field + i]);
- }
- hash = hc;
- }
-
- return hash;
- }
-
- public override bool Equals(System.Object o)
- {
- if (!(o is Binary))
- {
- return false;
- }
-
- Binary buf = (Binary) o;
- if (size_Renamed_Field != buf.size_Renamed_Field)
- {
- return false;
- }
-
- for (int i = 0; i < size_Renamed_Field; i++)
- {
- if (bytes[offset_Renamed_Field + i] != buf.bytes[buf.offset_Renamed_Field + i])
- {
- return false;
- }
- }
-
- return true;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Binding.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Binding.cs
deleted file mode 100644
index e07e85990d..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Binding.cs
+++ /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.
-*
-*/
-using System;
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// Binding
- /// </summary>
- internal interface Binding<E, T>
- {
- E endpoint(Sender<T> sender);
-
- Receiver<R> receiver<R>(E endpoint) where R : EventArgs;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Channel.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Channel.cs
deleted file mode 100644
index 6915c123e7..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Channel.cs
+++ /dev/null
@@ -1,174 +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;
-using org.apache.qpid.transport.network;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// Channel
- /// </summary>
- public class Channel : Invoker, ProtocolDelegate<Object>
- {
- private static readonly Logger log = Logger.get(typeof (Channel));
-
- private readonly Connection _connection;
- private readonly int _channel;
- private readonly MethodDelegate<Channel> _methoddelegate;
- private readonly SessionDelegate _sessionDelegate;
- // session may be null
- private Session _session;
-
- public Channel(Connection connection, int channel, SessionDelegate sessionDelegate)
- {
- _connection = connection;
- _channel = channel;
- _methoddelegate = new ChannelDelegate();
- _sessionDelegate = sessionDelegate;
- }
-
- public Connection Connection
- {
- get { return _connection; }
- }
-
- // Invoked when a network event is received
- public void On_ReceivedEvent(object sender, ReceivedPayload<ProtocolEvent> payload)
- {
- if (payload.Payload.Channel == _channel)
- {
- payload.Payload.ProcessProtocolEvent(null, this);
- }
- }
-
- #region ProtocolDelegate<T>
-
- public void Init(Object v, ProtocolHeader hdr)
- {
- _connection.ConnectionDelegate.init(this, hdr);
- }
-
- public void Control(Object v, Method method)
- {
- switch (method.EncodedTrack)
- {
- case Frame.L1:
- method.dispatch(this, _connection.ConnectionDelegate);
- break;
- case Frame.L2:
- method.dispatch(this, _methoddelegate);
- break;
- case Frame.L3:
- method.ProcessProtocolEvent(_session, _sessionDelegate);
- break;
- default:
- throw new Exception("unknown track: " + method.EncodedTrack);
- }
- }
-
- public void Command(Object v, Method method)
- {
- method.ProcessProtocolEvent(_session, _sessionDelegate);
- }
-
- public void Error(Object v, ProtocolError error)
- {
- throw new Exception(error.Message);
- }
-
- #endregion
-
- public void exception(Exception t)
- {
- _session.exception(t);
- }
-
- public void closedFromConnection()
- {
- log.debug("channel closed: ", this);
- if (_session != null)
- {
- _session.closed();
- }
- }
-
- public void closed()
- {
- log.debug("channel closed: ", this);
- if (_session != null)
- {
- _session.closed();
- }
- _connection.removeChannel(_channel);
- }
-
- public int EncodedChannel
- {
- get { return _channel; }
- }
-
- public Session Session
- {
- get { return _session; }
- set { _session = value; }
- }
-
- public void closeCode(ConnectionClose close)
- {
- if (_session != null)
- {
- _session.closeCode(close);
- }
- }
-
- private void emit(ProtocolEvent pevent)
- {
- pevent.Channel = _channel;
- _connection.send(pevent);
- }
-
- public void method(Method m)
- {
- emit(m);
-
- if (!m.Batch)
- {
- _connection.flush();
- }
- }
-
- protected override void invoke(Method m)
- {
- method(m);
- }
-
- public override Future invoke(Method m, Future future)
- {
- throw new Exception("UnsupportedOperation");
- }
-
- public String toString()
- {
- return String.Format("{0}:{1}", _connection, _channel);
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs
deleted file mode 100644
index 34126ddbf4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/ChannelDelegate.cs
+++ /dev/null
@@ -1,41 +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 org.apache.qpid.transport
-{
- /// <summary>
- /// ChannelDelegate
- ///
- /// </summary>
- internal class ChannelDelegate : MethodDelegate<Channel>
- {
- public override void sessionDetached(Channel channel, SessionDetached closed)
- {
- channel.closed();
- }
-
- public override void sessionDetach(Channel channel, SessionDetach dtc)
- {
- channel.Session.closed();
- channel.sessionDetached(dtc.getName(), SessionDetachCode.NORMAL);
- channel.closed();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/ClientDelegate.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/ClientDelegate.cs
deleted file mode 100644
index fa0062ef19..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/ClientDelegate.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.
-*
-*/
-using org.apache.qpid.transport;
-
-namespace org.apache.qpid.transport
-{
- abstract class ClientDelegate : ConnectionDelegate
- {
- public override void init(Channel ch, ProtocolHeader hdr)
- {
- if (hdr.Major != 0 && hdr.Minor != 10)
- {
- throw new ProtocolVersionException((sbyte) hdr.Major, (sbyte) hdr.Minor);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Connection.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Connection.cs
deleted file mode 100644
index 863f90e093..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Connection.cs
+++ /dev/null
@@ -1,172 +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;
-using System.Collections.Generic;
-using Logger = org.apache.qpid.transport.util.Logger;
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// Connection
- /// </summary>
- public class Connection
- {
- private static readonly Logger log = Logger.get(typeof (Connection));
-
- private readonly Sender<ProtocolEvent> _sender;
- private readonly ConnectionDelegate _connDdelegate;
- private int _channelMax = 1;
- private int _connectionId;
- private readonly Receiver<ReceivedPayload<ProtocolEvent>> _receiver;
-
- private readonly Dictionary<int, Channel> _channels = new Dictionary<int, Channel>();
-
- public Connection(Receiver<ReceivedPayload<ProtocolEvent>> receiver, Sender<ProtocolEvent> sender, ConnectionDelegate connDdelegate)
- {
- _receiver = receiver;
- _sender = sender;
- _connDdelegate = connDdelegate;
- }
-
- public int ConnectionId
- {
- get { return _connectionId; }
- set { _connectionId = value; }
- }
-
- public ConnectionDelegate ConnectionDelegate
- {
- get { return _connDdelegate; }
- }
-
- public int ChannelMax
- {
- get { return _channelMax; }
- set { _channelMax = value; }
- }
-
- public void send(ProtocolEvent pevent)
- {
- log.debug("SEND: [{0}] {1}", this, pevent);
- _sender.send(pevent);
- }
-
- public void flush()
- {
- log.debug("FLUSH: [{0}]", this);
- _sender.flush();
- }
-
-
- public Channel getChannel()
- {
- lock (_channels)
- {
- for (int i = 0; i < ChannelMax; i++)
- {
- if (!_channels.ContainsKey(i))
- {
- return getChannel(i);
- }
- }
- throw new Exception("no more _channels available");
- }
- }
-
- public Channel getChannel(int number)
- {
- lock (_channels)
- {
- Channel channel = null;
- if (_channels.Count > 0)
- {
- if( _channels.ContainsKey(number))
- channel = _channels[number];
- }
- if (channel == null)
- {
- channel = new Channel(this, number, _connDdelegate.getSessionDelegate());
- _receiver.Received += channel.On_ReceivedEvent;
- _channels.Add(number, channel);
- }
- return channel;
- }
- }
-
- public void removeChannel(int number)
- {
- lock (_channels)
- {
- _receiver.Received -= _channels[number].On_ReceivedEvent;
- _channels.Remove(number);
- }
- }
-
- public void On_ReceivedEvent(object sender, ReceivedPayload<ProtocolEvent> payload)
- {
- log.debug("RECV: [{0}] {1}", this, payload.Payload);
- if (_channels.ContainsKey(payload.Payload.Channel)) return;
- Channel channel = getChannel(payload.Payload.Channel);
- channel.On_ReceivedEvent(sender, payload);
- }
-
- public void On_ReceivedException(Object sender, ExceptionArgs arg)
- {
- _connDdelegate.exception(arg.Exception);
- }
-
- public void On_ReceivedClosed(Object sender, EventArgs arg)
- {
- log.debug("Connection closed: {0}", this);
- lock (_channels)
- {
- foreach (Channel ch in _channels.Values)
- {
- ch.closedFromConnection();
- }
- }
- _channels.Clear();
- _connDdelegate.closed();
- }
-
-
- public void closeCode(ConnectionClose close)
- {
- lock (_channels)
- {
- foreach (Channel ch in _channels.Values)
- {
- ch.closeCode(close);
- }
- }
- }
-
- public void close()
- {
- _sender.close();
- }
-
- public String toString()
- {
- return String.Format("conn:{0}", this);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/ConnectionDelegate.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/ConnectionDelegate.cs
deleted file mode 100644
index 1f76840b98..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/ConnectionDelegate.cs
+++ /dev/null
@@ -1,108 +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;
-using System.Collections.Generic;
-using System.Threading;
-using Logger = org.apache.qpid.transport.util.Logger;
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// ConnectionDelegate
- ///
- /// Currently only implemented client specific methods
- /// </summary>
- public abstract class ConnectionDelegate : MethodDelegate<Channel>
- {
- private static readonly Logger log = Logger.get(typeof(ConnectionDelegate));
- private String _virtualHost;
-
- private ManualResetEvent _negotiationComplete;
-
- public abstract SessionDelegate getSessionDelegate();
-
- public abstract void exception(Exception t);
-
- public abstract void closed();
-
- public void setCondition(ManualResetEvent negotiationComplete)
- {
- _negotiationComplete = negotiationComplete;
- }
-
- public virtual void init(Channel ch, ProtocolHeader hdr)
- {
- ch.Connection.send(new ProtocolHeader((byte)1, hdr.Major, hdr.Minor));
- List<Object> plain = new List<Object>();
- plain.Add("PLAIN");
- List<Object> utf8 = new List<Object>();
- utf8.Add("utf8");
- ch.connectionStart(null, plain, utf8);
- }
-
- public String VirtualHost
- {
- get { return _virtualHost; }
- set { _virtualHost = value; }
- }
-
- // ----------------------------------------------
- // Client side
- //-----------------------------------------------
- public override void connectionStart(Channel context, ConnectionStart mstruct)
- {
- Dictionary<String, Object> props = new Dictionary<String, Object>();
- context.connectionStartOk(props, null, null, "utf8");
- }
-
- public override void connectionSecure(Channel context, ConnectionSecure mstruct)
- { // todo SASL
- context.connectionSecureOk(new byte[0]);
- }
-
- public override void connectionTune(Channel context, ConnectionTune mstruct)
- {
- context.Connection.ChannelMax = mstruct.getChannelMax();
- context.connectionTuneOk(mstruct.getChannelMax(), mstruct.getMaxFrameSize(), mstruct.getHeartbeatMax());
- context.connectionOpen(_virtualHost, null, Option.INSIST);
- }
-
- public override void connectionOpenOk(Channel context, ConnectionOpenOk mstruct)
- {
- List<Object> knownHosts = mstruct.getKnownHosts();
- if (_negotiationComplete != null)
- {
- _negotiationComplete.Set();
- }
- }
-
- public override void connectionRedirect(Channel context, ConnectionRedirect mstruct)
- {
- // not going to bother at the moment
- }
-
- public override void connectionClose(Channel ch, ConnectionClose close)
- {
- ch.Connection.closeCode(close);
- ch.connectionCloseOk();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Field.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Field.cs
deleted file mode 100644
index e8c3cb3497..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Field.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.
-*
-*/
-using System;
-using Decoder = org.apache.qpid.transport.codec.Decoder;
-using Encoder = org.apache.qpid.transport.codec.Encoder;
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// Field
- /// </summary>
- public abstract class Field<C, T>
- {
- private C container;
- private T type;
- private String name;
- private int index;
-
- protected Field(C container, T type, String name, int index)
- {
- this.container = container;
- this.type = type;
- this.name = name;
- this.index = index;
- }
-
- public C Container
- {
- get { return container; }
- }
-
- public T Type
- {
- get { return type; }
- }
-
- public String Name
- {
- get { return name; }
- }
-
- public int Index
- {
- get { return index; }
- }
-
- public abstract bool has(Object mystruct);
-
- public abstract void has(Object mystruct, bool value);
-
- public abstract T get(Object mystruct);
-
- public abstract void read(Decoder dec, Object mystruct);
-
- public abstract void write(Encoder enc, Object mystruct);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Future.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Future.cs
deleted file mode 100644
index ddb07f1dda..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Future.cs
+++ /dev/null
@@ -1,38 +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 org.apache.qpid.transport
-{
- /// <summary>
- /// Future
- /// </summary>
- public interface Future
- {
- Struct Result
- {
- get; set;
- }
-
- Session Session
- { set;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Header.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Header.cs
deleted file mode 100644
index 74b8a7fe2e..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Header.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.
-*
-*/
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// Header
- /// </summary>
- public class Header
- {
- private readonly Struct[] _mystructs;
-
- public Header(List<Struct> structs)
- : this(structs.ToArray())
- {
- }
-
- public Header(params Struct[] structs)
- {
- _mystructs = structs;
- }
-
- public Struct[] Structs
- {
- get { return _mystructs; }
- }
-
-
- public Struct get(Struct klass)
- {
- foreach (Struct st in _mystructs)
- {
- if (Equals(st.GetType(), klass.GetType()))
- {
- return st;
- }
- }
- return null;
- }
-
- public String toString()
- {
- StringBuilder str = new StringBuilder();
- str.Append(" Header(");
- bool first = true;
- foreach (Struct s in _mystructs)
- {
- if (first)
- {
- first = false;
- }
- else
- {
- str.Append(", ");
- }
- str.Append(s);
- }
- str.Append(")");
- return str.ToString();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Method.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Method.cs
deleted file mode 100644
index c15343ba73..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Method.cs
+++ /dev/null
@@ -1,150 +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;
-using System.IO;
-using System.Text;
-using Frame = org.apache.qpid.transport.network.Frame;
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// Method
- /// </summary>
- public abstract class Method : Struct, ProtocolEvent
- {
- public new static Method create(int type)
- {
- return (Method) StructFactory.createInstruction(type);
- }
-
- // XXX: command subclass?
- private int id;
- private int channel;
- private bool idSet;
- private bool sync;
- private bool batch;
-
- public int Id
- {
- get { return id; }
- set
- {
- id = value;
- idSet = true;
- }
- }
-
-
- public bool Sync
- {
- get { return sync; }
- set { sync = value; }
- }
-
- public bool Batch
- {
- get { return batch; }
- set { batch = value; }
- }
-
- public abstract bool hasPayload();
-
- public virtual Header Header
- {
- get { return null; }
- set { throw new Exception(); }
- }
-
- public virtual MemoryStream Body
- {
- get { return null; }
- set { throw new Exception(); }
- }
-
-
- public abstract void dispatch<C>(C context, MethodDelegate<C> mdelegate );
-
- #region ProtocolEvent
-
- public int Channel
- {
- get { return channel; }
- set { channel = value; }
- }
-
- public abstract byte EncodedTrack { get; set; }
-
- public void ProcessProtocolEvent<C>(C context, ProtocolDelegate<C> protocoldelegate)
- {
- if (EncodedTrack == Frame.L4)
- {
- protocoldelegate.Command(context, this);
- }
- else
- {
- protocoldelegate.Control(context, this);
- }
- }
-
- #endregion
-
- public new String toString()
- {
- StringBuilder str = new StringBuilder();
-
- str.Append("ch=");
- str.Append(channel);
-
- if (EncodedTrack == Frame.L4 && idSet)
- {
- str.Append(" id=");
- str.Append(id);
- }
-
- if (sync || batch)
- {
- str.Append(" ");
- str.Append("[");
- if (Sync)
- {
- str.Append("S");
- }
- if (Batch)
- {
- str.Append("B");
- }
- str.Append("]");
- }
- str.Append(" ");
- str.Append(base.toString());
- if (Header != null)
- {
- str.Append(Header.toString());
- }
- if (Body != null)
- {
- str.Append("\n body=");
- str.Append(Body.ToString());
- }
- return str.ToString();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolDelegate.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolDelegate.cs
deleted file mode 100644
index d269b01b79..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolDelegate.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 org.apache.qpid.transport
-{
- /// <summary>
- /// ProtocolDelegate
- /// </summary>
- public interface ProtocolDelegate<T>
- {
- void Init(T context, ProtocolHeader header);
-
- void Control(T context, Method control);
-
- void Command(T context, Method command);
-
- void Error(T context, ProtocolError error);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolError.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolError.cs
deleted file mode 100644
index 933a18c78a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolError.cs
+++ /dev/null
@@ -1,86 +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;
-using NetworkDelegate = org.apache.qpid.transport.network.NetworkDelegate;
-using NetworkEvent = org.apache.qpid.transport.network.NetworkEvent;
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// ProtocolError
- /// </summary>
- public sealed class ProtocolError : NetworkEvent, ProtocolEvent
- {
- private int channel;
- private byte track;
- private String format;
- private Object[] args;
-
- public ProtocolError(byte track, String format, params Object[] args)
- {
- this.track = track;
- this.format = format;
- this.args = args;
- }
-
- #region NetworkEvent Methods
-
- public void ProcessNetworkEvent(NetworkDelegate ndelegate)
- {
- ndelegate.Error(this);
- }
-
- #endregion
-
- #region ProtocolEvent Methods
-
- public int Channel
- {
- get { return channel; }
- set { channel = value; }
- }
-
- public byte EncodedTrack
- {
- get { return track; }
- set { throw new NotImplementedException(); }
- }
-
- public void ProcessProtocolEvent<C>(C context, ProtocolDelegate<C> protocoldelegate)
- {
- protocoldelegate.Error(context, this);
- }
-
- #endregion
-
- public String Message
- {
- get { return String.Format(format, args); }
- }
-
-
- public String toString()
- {
- return String.Format("protocol error: {0}", Message);
- }
-
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolEvent.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolEvent.cs
deleted file mode 100644
index 0f6529dfd3..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolEvent.cs
+++ /dev/null
@@ -1,42 +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 org.apache.qpid.transport
-{
- /// <summary>
- /// ProtocolEvent
- /// </summary>
- public interface ProtocolEvent
- {
- int Channel
- {
- get;
- set;
- }
-
- byte EncodedTrack
- {
- set;
- get;
- }
-
- void ProcessProtocolEvent<C>(C context, ProtocolDelegate<C> protocoldelegate);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolHeader.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolHeader.cs
deleted file mode 100644
index 39a3f5670c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/ProtocolHeader.cs
+++ /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.
-*
-*/
-using System;
-using System.IO;
-using System.Text;
-using NetworkDelegate = org.apache.qpid.transport.network.NetworkDelegate;
-using NetworkEvent = org.apache.qpid.transport.network.NetworkEvent;
-using Frame = org.apache.qpid.transport.network.Frame;
-
-namespace org.apache.qpid.transport
-{
- /// <summary> ProtocolHeader
- ///
- /// </summary>
- public sealed class ProtocolHeader : NetworkEvent, ProtocolEvent
- {
- private readonly char[] AMQP = new char[] {'A', 'M', 'Q', 'P'};
- private const byte CLASS = 1;
-
- private readonly byte instance;
- private readonly byte major;
- private readonly byte minor;
- private int channel;
-
- public ProtocolHeader(byte instance, byte major, byte minor)
- {
- this.instance = instance;
- this.major = major;
- this.minor = minor;
- }
-
- public ProtocolHeader(int instance, int major, int minor) : this((byte)instance, (byte)major, (byte)minor)
- {
- }
-
- #region NetworkEvent Methods
-
- public void ProcessNetworkEvent(NetworkDelegate ndelegate)
- {
- ndelegate.Init(this);
- }
-
- #endregion
-
- #region ProtocolEvent Methods
-
- public int Channel
- {
- get
- {
- return channel;
- }
- set
- {
- channel = value;
- }
- }
-
- public byte EncodedTrack
- {
- get
- {
- return Frame.L1;
- }
- set { throw new NotImplementedException(); }
- }
-
- public void ProcessProtocolEvent<C>(C context, ProtocolDelegate<C> protocoldelegate)
- {
- protocoldelegate.Init(context, this);
- }
-
- #endregion
-
- public byte Instance
- {
- get { return instance; }
- }
-
- public byte Major
- {
- get { return major; }
- }
-
- public byte Minor
- {
- get { return minor; }
- }
-
- public MemoryStream ToMemoryStream()
- {
- MemoryStream buf = new MemoryStream(8);
- BinaryWriter writer = new BinaryWriter(buf);
- writer.Write(AMQP);
- writer.Write(CLASS);
- writer.Write(instance);
- writer.Write((sbyte) major);
- writer.Write((sbyte) minor);
- return buf;
- }
-
- public String toString()
- {
- return String.Format("AMQP.{0:d} {1:d}-{2:d}", instance, major, minor);
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Range.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Range.cs
deleted file mode 100644
index a5bc4f0488..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Range.cs
+++ /dev/null
@@ -1,117 +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;
-using System.Collections.Generic;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport
-{
-
- /// <summary>
- /// Range
- /// </summary>
-
-
- public sealed class Range
- {
- private int _lower;
- private int _upper;
-
- public Range(int lower, int upper)
- {
- _lower = lower;
- _upper = upper;
- }
-
- public int Lower
- {
- get { return _lower; }
- set { _lower = value; }
- }
- public int Upper
- {
- get { return _upper; }
- set { _upper = value; }
- }
-
- public bool includes(int value)
- {
- return Serial.le(_lower, value) && Serial.le(value, _upper);
- }
-
- public bool includes(Range range)
- {
- return includes(range._lower) && includes(range._upper);
- }
-
- public bool intersects(Range range)
- {
- return (includes(range._lower) || includes(range._upper) ||
- range.includes(_lower) || range.includes(_upper));
- }
-
- public bool touches(Range range)
- {
- return (intersects(range) ||
- includes(range._upper + 1) || includes(range._lower - 1) ||
- range.includes(_upper + 1) || range.includes(_lower - 1));
- }
-
- public Range span(Range range)
- {
- return new Range(Serial.min(_lower, range._lower), Serial.max(_upper, range._upper));
- }
-
- public List<Range> subtract(Range range)
- {
- List<Range> result = new List<Range>();
-
- if (includes(range._lower) && Serial.le(_lower, range._lower - 1))
- {
- result.Add(new Range(_lower, range._lower - 1));
- }
-
- if (includes(range._upper) && Serial.le(range._upper + 1, _upper))
- {
- result.Add(new Range(range._upper + 1, _upper));
- }
-
- if (result.Count == 0 && !range.includes(this))
- {
- result.Add(this);
- }
-
- return result;
- }
-
- public Range intersect(Range range)
- {
- int l = Serial.max(_lower, range._lower);
- int r = Serial.min(_upper, range._upper);
- return Serial.gt(l, r) ? null : new Range(l, r);
- }
-
- public String toString()
- {
- return "[" + _lower + ", " + _upper + "]";
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/RangeSet.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/RangeSet.cs
deleted file mode 100644
index 0c502541ec..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/RangeSet.cs
+++ /dev/null
@@ -1,150 +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;
-using System.Collections;
-using System.Collections.Generic;
-using System.Text;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// RangeSet
- /// </summary>
- public sealed class RangeSet : IEnumerable<Range>
- {
- private readonly List<Range> _ranges = new List<Range>();
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetEnumerator();
- }
-
- public IEnumerator<Range> GetEnumerator()
- {
- return _ranges.GetEnumerator();
- }
-
-
- public int size()
- {
- return _ranges.Count;
- }
-
-
- public Range getFirst()
- {
- return _ranges[0];
- }
-
- public bool includes(Range range)
- {
- foreach (Range r in this)
- {
- if (r.includes(range))
- {
- return true;
- }
- }
-
- return false;
- }
-
- public bool includes(int n)
- {
- foreach (Range r in this)
- {
- if (r.includes(n))
- {
- return true;
- }
- }
-
- return false;
- }
-
- public void add(Range range)
- {
- for (int i = 0; i < _ranges.Count; i++)
- {
- Range r = _ranges[i];
- if (range.touches(r))
- {
- _ranges.Remove(r);
- range = range.span(r);
- }
- else if (Serial.lt(range.Upper, r.Lower))
- {
- _ranges.Insert(i - 1 , range);
- return;
- }
- }
- _ranges.Add(range);
- }
-
- public void add(int lower, int upper)
- {
- add(new Range(lower, upper));
- }
-
- public void add(int value)
- {
- add(value, value);
- }
-
- public void clear()
- {
- _ranges.Clear();
- }
-
- public RangeSet copy()
- {
- RangeSet copy = new RangeSet();
- foreach (Range r in _ranges)
- {
- copy._ranges.Add(r);
- }
- return copy;
- }
-
- public String toString()
- {
- StringBuilder str = new StringBuilder();
- str.Append("{");
- bool first = true;
- foreach (Range range in _ranges)
- {
- if (first)
- {
- first = false;
- }
- else
- {
- str.Append(", ");
- }
- str.Append(range);
- }
- str.Append("}");
- return str.ToString();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/ReceivedPayload.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/ReceivedPayload.cs
deleted file mode 100644
index 792ca4f977..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/ReceivedPayload.cs
+++ /dev/null
@@ -1,43 +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;
-
-namespace org.apache.qpid.transport
-{
- public class ReceivedPayload<T> : EventArgs
- {
- public ReceivedPayload()
- {
- }
-
- public ReceivedPayload(T payload)
- {
- m_payload = payload;
- }
- private T m_payload;
-
- public T Payload
- {
- get { return m_payload; }
- set { m_payload = value; }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Receiver.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Receiver.cs
deleted file mode 100644
index 7b61d7f684..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Receiver.cs
+++ /dev/null
@@ -1,38 +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;
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// a receiver will raise an event when:
- /// - data is received
- /// - an exception is thrown
- /// - it is closed
- /// </summary>
- public interface Receiver <T> where T : EventArgs
- {
- event EventHandler<T> Received;
- event EventHandler<ExceptionArgs> Exception;
- event EventHandler Closed;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Sender.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Sender.cs
deleted file mode 100644
index 564dd83789..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Sender.cs
+++ /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.
-*
-*/
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// Sender
- /// </summary>
- public interface Sender<T>
- {
- void send(T msg);
- void flush();
- void close();
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Session.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Session.cs
deleted file mode 100644
index 5de379ab45..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Session.cs
+++ /dev/null
@@ -1,522 +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;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using System.Threading;
-using org.apache.qpid.transport.util;
-using Frame = org.apache.qpid.transport.network.Frame;
-using Logger = org.apache.qpid.transport.util.Logger;
-
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// Session
- ///
- /// </summary>
- public class Session : Invoker
- {
- private static readonly Logger log = Logger.get(typeof (Session));
- private static readonly bool ENABLE_REPLAY;
-
- static Session()
- {
- const string enableReplay = "enable_command_replay";
- try
- {
- String var = Environment.GetEnvironmentVariable(enableReplay);
- if (var != null)
- {
- ENABLE_REPLAY = bool.Parse(var);
- }
- }
- catch (Exception)
- {
- ENABLE_REPLAY = false;
- }
- }
-
- private readonly byte[] _name;
- private const long _timeout = 600000;
- private bool _autoSync = false;
-
- // channel may be null
- private Channel _channel;
-
- // incoming command count
- private int _commandsIn = 0;
- // completed incoming commands
- private readonly Object _processedLock = new Object();
- private RangeSet _processed = new RangeSet();
- private int _maxProcessed = - 1;
- private int _syncPoint = -1;
-
- // outgoing command count
- private int _commandsOut = 0;
- private readonly Dictionary<int, Method> _commands = new Dictionary<int, Method>();
- private int _maxComplete = - 1;
- private bool _needSync = false;
- private bool _closed;
- private readonly Dictionary<int, Future> _results = new Dictionary<int, Future>();
- private readonly List<ExecutionException> _exceptions = new List<ExecutionException>();
-
-
- public bool Closed
- {
- get
- {
- lock (this)
- {
- return _closed;
- }
- }
- set
- {
- lock (this)
- {
- _closed = value;
- }
- }
- }
-
- public string Name
- {
- get
- {
- ASCIIEncoding enc = new ASCIIEncoding();
- return enc.GetString(_name);
- }
- }
-
- public Session(byte[] name)
- {
- _name = name;
- }
-
- public byte[] getName()
- {
- return _name;
- }
-
- public void setAutoSync(bool value)
- {
- lock (_commands)
- {
- _autoSync = value;
- }
- }
-
- public Dictionary<int, Method> getOutstandingCommands()
- {
- return _commands;
- }
-
- public int getCommandsOut()
- {
- return _commandsOut;
- }
-
- public int CommandsIn
- {
- get { return _commandsIn; }
- set { _commandsIn = value; }
- }
-
- public int nextCommandId()
- {
- return _commandsIn++;
- }
-
- public void identify(Method cmd)
- {
- int id = nextCommandId();
- cmd.Id = id;
-
- if (log.isDebugEnabled())
- {
- log.debug("ID: [{0}] %{1}", _channel, id);
- }
-
- //if ((id % 65536) == 0)
- if ((id & 0xff) == 0)
- {
- flushProcessed(Option.TIMELY_REPLY);
- }
- }
-
- public void processed(Method command)
- {
- processed(command.Id);
- }
-
- public void processed(int command)
- {
- processed(new Range(command, command));
- }
-
- public void processed(int lower, int upper)
- {
- processed(new Range(lower, upper));
- }
-
- public void processed(Range range)
- {
- log.debug("{0} processed({1})", this, range);
-
- bool flush;
- lock (_processedLock)
- {
- _processed.add(range);
- Range first = _processed.getFirst();
- int lower = first.Lower;
- int upper = first.Upper;
- int old = _maxProcessed;
- if (Serial.le(lower, _maxProcessed + 1))
- {
- _maxProcessed = Serial.max(_maxProcessed, upper);
- }
- flush = Serial.lt(old, _syncPoint) && Serial.ge(_maxProcessed, _syncPoint);
- _syncPoint = _maxProcessed;
- }
- if (flush)
- {
- flushProcessed();
- }
- }
-
- public void flushProcessed(params Option[] options)
- {
- RangeSet copy;
- lock (_processedLock)
- {
- copy = _processed.copy();
- }
- sessionCompleted(copy, options);
- }
-
- public void knownComplete(RangeSet kc)
- {
- lock (_processedLock)
- {
- RangeSet newProcessed = new RangeSet();
- foreach (Range pr in _processed)
- {
- foreach (Range kr in kc)
- {
- foreach (Range r in pr.subtract(kr))
- {
- newProcessed.add(r);
- }
- }
- }
- _processed = newProcessed;
- }
- }
-
- public void syncPoint()
- {
- int id = CommandsIn - 1;
- log.debug("{0} synced to {1}", this, id);
- bool flush;
- lock (_processedLock)
- {
- _syncPoint = id;
- flush = Serial.ge(_maxProcessed, _syncPoint);
- }
- if (flush)
- {
- flushProcessed();
- }
- }
-
- public void attach(Channel channel)
- {
- _channel = channel;
- _channel.Session = this;
- }
-
- public Method getCommand(int id)
- {
- lock (_commands)
- {
- return _commands[id];
- }
- }
-
- public bool complete(int lower, int upper)
- {
- //avoid autoboxing
- if (log.isDebugEnabled())
- {
- log.debug("{0} complete({1}, {2})", this, lower, upper);
- }
- lock (_commands)
- {
- int old = _maxComplete;
- for (int id = Serial.max(_maxComplete, lower); Serial.le(id, upper); id++)
- {
- _commands.Remove(id);
- }
- if (Serial.le(lower, _maxComplete + 1))
- {
- _maxComplete = Serial.max(_maxComplete, upper);
- }
- log.debug("{0} commands remaining: {1}", this, _commands);
- Monitor.PulseAll(_commands);
- return Serial.gt(_maxComplete, old);
- }
- }
-
- protected override void invoke(Method m)
- {
- if (Closed)
- {
- List<ExecutionException> exc = getExceptions();
- if (exc.Count > 0)
- {
- throw new SessionException(exc);
- }
- else if (_close != null)
- {
- throw new ConnectionException(_close);
- }
- else
- {
- throw new SessionClosedException();
- }
- }
-
- if (m.EncodedTrack == Frame.L4)
- {
- lock (_commands)
- {
- int next = _commandsOut++;
- m.Id = next;
- if (next == 0)
- {
- sessionCommandPoint(0, 0);
- }
- if (ENABLE_REPLAY)
- {
- _commands.Add(next, m);
- }
- if (_autoSync)
- {
- m.Sync = true;
- }
- _needSync = ! m.Sync;
- _channel.method(m);
- if (_autoSync)
- {
- sync();
- }
-
- // flush every 64K commands to avoid ambiguity on
- // wraparound
- if ((next%65536) == 0)
- {
- sessionFlush(Option.COMPLETED);
- }
- }
- }
- else
- {
- _channel.method(m);
- }
- }
-
- public void sync()
- {
- sync(_timeout);
- }
-
- public void sync(long timeout)
- {
- log.debug("{0} sync()", this);
- lock (_commands)
- {
- int point = _commandsOut - 1;
-
- if (_needSync && Serial.lt(_maxComplete, point))
- {
- executionSync(Option.SYNC);
- }
-
- DateTime start = DateTime.Now;
- long elapsed = 0;
-
- while (! Closed && elapsed < timeout && Serial.lt(_maxComplete, point))
- {
- log.debug("{0} waiting for[{1}]: {2}, {3}", this, point,
- _maxComplete, _commands);
- Monitor.Wait(_commands, (int) (timeout - elapsed));
- elapsed = DateTime.Now.Subtract(start).Milliseconds;
- }
-
- if (Serial.lt(_maxComplete, point))
- {
- if (Closed)
- {
- throw new SessionException(getExceptions());
- }
- else
- {
- throw new Exception
- (String.Format
- ("timed out waiting for sync: complete = {0}, point = {1}", _maxComplete, point));
- }
- }
- }
- }
-
-
- public void result(int command, Struct result)
- {
- Future future;
- lock (_results)
- {
- if (_results.ContainsKey(command))
- {
- future = _results[command];
- _results.Remove(command);
- }
- else
- {
- throw new Exception(String.Format("Cannot ger result {0} for {1}", command, result));
- }
- }
- future.Result = result;
- }
-
- public void addException(ExecutionException exc)
- {
- lock (_exceptions)
- {
- _exceptions.Add(exc);
- }
- }
-
- private ConnectionClose _close = null;
-
- public void closeCode(ConnectionClose close)
- {
- _close = close;
- }
-
- public List<ExecutionException> getExceptions()
- {
- lock (_exceptions)
- {
- return new List<ExecutionException>(_exceptions);
- }
- }
-
- public override Future invoke(Method m, Future future)
- {
- lock (_commands)
- {
- future.Session = this;
- int command = _commandsOut;
- lock (_results)
- {
- _results.Add(command, future);
- }
- invoke(m);
- }
- return future;
- }
-
-
- public void messageTransfer(String destination,
- MessageAcceptMode acceptMode,
- MessageAcquireMode acquireMode,
- Header header,
- byte[] body,
- params Option[] options)
- {
- MemoryStream mbody = new MemoryStream();
- mbody.Write(body,0, body.Length);
- messageTransfer(destination, acceptMode, acquireMode, header,
- mbody, options);
- }
-
- public void messageTransfer(String destination,
- MessageAcceptMode acceptMode,
- MessageAcquireMode acquireMode,
- Header header,
- String body,
- params Option[] options)
- {
- messageTransfer(destination, acceptMode, acquireMode, header,
- new MemoryStream(Convert.ToByte(body)), options);
- }
-
- public void close()
- {
- sessionRequestTimeout(0);
- sessionDetach(_name);
- lock (_commands)
- {
- DateTime start = DateTime.Now;
- long elapsed = 0;
-
- while (! Closed && elapsed < _timeout)
- {
- Monitor.Wait(_commands, (int) (_timeout - elapsed));
- elapsed = DateTime.Now.Subtract(start).Milliseconds;
- }
- }
- }
-
- public void exception(Exception t)
- {
- log.error(t, "Caught exception");
- }
-
- public void closed()
- {
- Closed = true;
- lock (_commands)
- {
- Monitor.PulseAll(_commands);
- }
- lock (_results)
- {
- foreach (Future result in _results.Values)
- {
- lock (result)
- {
- Monitor.PulseAll(result);
- }
- }
- }
- _channel.Session = null;
- _channel = null;
- }
-
- public String toString()
- {
- return String.Format("session:{0}", _name);
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/SessionDelegate.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/SessionDelegate.cs
deleted file mode 100644
index e4b58b20ff..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/SessionDelegate.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 org.apache.qpid.transport
-{
- /// <summary>
- /// SessionDelegate
- ///
- /// </summary>
- public abstract class SessionDelegate : MethodDelegate<Session>, ProtocolDelegate<Session>
- {
- public void Init(Session ssn, ProtocolHeader hdr)
- {
- }
-
- public void Control(Session ssn, Method method)
- {
- method.dispatch(ssn, this);
- }
-
- public void Command(Session ssn, Method method)
- {
- ssn.identify(method);
- method.dispatch(ssn, this);
- if (!method.hasPayload())
- {
- ssn.processed(method);
- }
- }
-
- public void Error(Session ssn, ProtocolError error)
- {
- }
-
- public override void executionResult(Session ssn, ExecutionResult result)
- {
- ssn.result(result.getCommandId(), result.getValue());
- }
-
- public override void executionException(Session ssn, ExecutionException exc)
- {
- ssn.addException(exc);
- }
-
- public override void sessionCompleted(Session ssn, SessionCompleted cmp)
- {
- RangeSet ranges = cmp.getCommands();
- RangeSet known = null;
- if (cmp.getTimelyReply())
- {
- known = new RangeSet();
- }
-
- if (ranges != null)
- {
- foreach (Range range in ranges)
- {
- bool advanced = ssn.complete(range.Lower, range.Upper);
- if (advanced && known != null)
- {
- known.add(range);
- }
- }
- }
-
- if (known != null)
- {
- ssn.sessionKnownCompleted(known);
- }
- }
-
- public override void sessionKnownCompleted(Session ssn, SessionKnownCompleted kcmp)
- {
- RangeSet kc = kcmp.getCommands();
- if (kc != null)
- {
- ssn.knownComplete(kc);
- }
- }
-
- public override void sessionFlush(Session ssn, SessionFlush flush)
- {
- if (flush.getCompleted())
- {
- ssn.flushProcessed();
- }
- if (flush.getConfirmed())
- {
- ssn.flushProcessed();
- }
- if (flush.getExpected())
- {
- // to be done
- //throw new Exception("not implemented");
- }
- }
-
- public override void sessionCommandPoint(Session ssn, SessionCommandPoint scp)
- {
- ssn.CommandsIn = scp.getCommandId();
- }
-
- public override void executionSync(Session ssn, ExecutionSync sync)
- {
- ssn.syncPoint();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/Struct.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/Struct.cs
deleted file mode 100644
index fead22268b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/Struct.cs
+++ /dev/null
@@ -1,122 +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;
-using System.Collections.Generic;
-using System.Text;
-using Decoder = org.apache.qpid.transport.codec.Decoder;
-using Encodable = org.apache.qpid.transport.codec.Encodable;
-using Encoder = org.apache.qpid.transport.codec.Encoder;
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// Struct
- /// </summary>
-
- public abstract class Struct : Encodable
- {
- public static Struct create(int type)
- {
- return StructFactory.create(type);
- }
-
- bool dirty = true;
-
- public bool Dirty
- {
- get { return dirty; }
- set { dirty = value; }
- }
-
- public abstract int getStructType();
-
- public abstract int getSizeWidth();
-
- public abstract int getPackWidth();
-
- public int getEncodedType()
- {
- int type = getStructType();
- if (type < 0)
- {
- throw new Exception();
- }
- return type;
- }
-
- private bool isBit<C, T>(Field<C, T> f)
- {
- return Equals(f.Type, typeof(Boolean));
- }
-
- private bool packed()
- {
- return getPackWidth() > 0;
- }
-
- private bool encoded<C, T>(Field<C, T> f)
- {
- return !packed() || !isBit(f) && f.has(this);
- }
-
- private int getFlagWidth()
- {
- return (Fields.Count + 7) / 8;
- }
-
- private int getFlagCount()
- {
- return 8 * getPackWidth();
- }
-
- public abstract void read(Decoder dec);
-
- public abstract void write(Encoder enc);
-
- public abstract Dictionary<String, Object> Fields
- {
- get;
- }
-
- public String toString()
- {
- StringBuilder str = new StringBuilder();
- str.Append(GetType());
- str.Append("(");
- bool first = true;
- foreach (KeyValuePair<String, Object> me in Fields)
- {
- if (first)
- {
- first = false;
- }
- else
- {
- str.Append(", ");
- }
- str.Append(me.Key);
- str.Append("=");
- str.Append(me.Value);
- }
- str.Append(")");
- return str.ToString();
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/AbstractDecoder.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/codec/AbstractDecoder.cs
deleted file mode 100644
index 44aecb0933..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/AbstractDecoder.cs
+++ /dev/null
@@ -1,392 +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;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Text;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport.codec
-{
- /// <summary>
- /// AbstractDecoder
- /// </summary>
- public abstract class AbstractDecoder : Decoder
- {
- private readonly Dictionary<Binary, String> str8cache = new Dictionary<Binary, String>();
-
- protected abstract byte doGet();
-
- protected abstract void doGet(byte[] bytes);
- public abstract bool hasRemaining();
-
- protected byte get()
- {
- return doGet();
- }
-
- protected void get(byte[] bytes)
- {
- doGet(bytes);
- }
-
- protected Binary get(int size)
- {
- byte[] bytes = new byte[size];
- get(bytes);
- return new Binary(bytes);
- }
-
- protected short uget()
- {
- return (short) (0xFF & get());
- }
-
- public virtual short readUint8()
- {
- return uget();
- }
-
- public abstract int readUint16();
-
-
- public abstract long readUint32();
-
-
- public int readSequenceNo()
- {
- return (int) readUint32();
- }
-
- public virtual long readUint64()
- {
- long l = 0;
- for (int i = 0; i < 8; i++)
- {
- l |= ((long) (0xFF & get())) << (56 - i*8);
- }
- return l;
- }
-
- public long readDatetime()
- {
- return readUint64();
- }
-
- private static String decode(byte[] bytes, int offset, int length, Encoding encoding)
- {
- return encoding.GetString(bytes, offset, length);
- }
-
- private static String decode(byte[] bytes, Encoding encoding)
- {
- return decode(bytes, 0, bytes.Length, encoding);
- }
-
- public String readStr8()
- {
- short size = readUint8();
- Binary bin = get(size);
- String str;
- if (! str8cache.TryGetValue(bin, out str))
- {
- str = decode(bin.array(), bin.offset(), bin.size(), Encoding.UTF8);
- str8cache.Add(bin, str);
- }
- return str;
- }
-
- public String readStr16()
- {
- int size = readUint16();
- byte[] bytes = new byte[size];
- get(bytes);
- return decode(bytes, Encoding.UTF8);
- }
-
- public byte[] readVbin8()
- {
- int size = readUint8();
- byte[] bytes = new byte[size];
- get(bytes);
- return bytes;
- }
-
- public byte[] readVbin16()
- {
- int size = readUint16();
- byte[] bytes = new byte[size];
- get(bytes);
- return bytes;
- }
-
- public byte[] readVbin32()
- {
- int size = (int) readUint32();
- byte[] bytes = new byte[size];
- get(bytes);
- return bytes;
- }
-
- public RangeSet readSequenceSet()
- {
- int count = readUint16()/8;
- if (count == 0)
- {
- return null;
- }
- RangeSet ranges = new RangeSet();
- for (int i = 0; i < count; i++)
- {
- ranges.add(readSequenceNo(), readSequenceNo());
- }
- return ranges;
- }
-
- public RangeSet readByteRanges()
- {
- throw new Exception("not implemented");
- }
-
- public UUID readUuid()
- {
- long msb = readUint64();
- long lsb = readUint64();
- return new UUID(msb, lsb);
- }
-
- public String readContent()
- {
- throw new Exception("Deprecated");
- }
-
- public Struct readStruct(int type)
- {
- Struct st = Struct.create(type);
- int width = st.getSizeWidth();
- if (width > 0)
- {
- long size = readSize(width);
- if (size == 0)
- {
- return null;
- }
- }
- if (type > 0)
- {
- int code = readUint16();
- Debug.Assert(code == type);
- }
- st.read(this);
- return st;
- }
-
- public Struct readStruct32()
- {
- long size = readUint32();
- if (size == 0)
- {
- return null;
- }
- int type = readUint16();
- Struct result = Struct.create(type);
- result.read(this);
- return result;
- }
-
- public Dictionary<String, Object> readMap()
- {
- long size = readUint32();
-
- if (size == 0)
- {
- return null;
- }
-
- long count = readUint32();
-
- Dictionary<String, Object> result = new Dictionary<String, Object>();
- for (int i = 0; i < count; i++)
- {
- String key = readStr8();
- byte code = get();
- QpidType t = getType(code);
- Object value = read(t);
- result.Add(key, value);
- }
-
- return result;
- }
-
- public List<Object> readList()
- {
- long size = readUint32();
-
- if (size == 0)
- {
- return null;
- }
-
- long count = readUint32();
-
- List<Object> result = new List<Object>();
- for (int i = 0; i < count; i++)
- {
- byte code = get();
- QpidType t = getType(code);
- Object value = read(t);
- result.Add(value);
- }
- return result;
- }
-
- public List<Object> readArray()
- {
- long size = readUint32();
-
- if (size == 0)
- {
- return null;
- }
-
- byte code = get();
- QpidType t = getType(code);
- long count = readUint32();
-
- List<Object> result = new List<Object>();
- for (int i = 0; i < count; i++)
- {
- Object value = read(t);
- result.Add(value);
- }
- return result;
- }
-
- private QpidType getType(byte code)
- {
- return QpidType.get(code);
- }
-
- private long readSize(QpidType t)
- {
- return t.Fixed ? t.Width : readSize(t.Width);
- }
-
- private long readSize(int width)
- {
- switch (width)
- {
- case 1:
- return readUint8();
- case 2:
- return readUint16();
- case 4:
- return readUint32();
- default:
- throw new Exception("illegal width: " + width);
- }
- }
-
- private byte[] readBytes(QpidType t)
- {
- long size = readSize(t);
- byte[] result = new byte[(int) size];
- get(result);
- return result;
- }
-
- private Object read(QpidType t)
- {
- switch (t.Code)
- {
- case Code.BIN8:
- case Code.UINT8:
- return readUint8();
- case Code.INT8:
- return get();
- case Code.CHAR:
- return (char) get();
- case Code.BOOLEAN:
- return get() > 0;
-
- case Code.BIN16:
- case Code.UINT16:
- return readUint16();
- case Code.INT16:
- return (short) readUint16();
-
- case Code.BIN32:
- case Code.UINT32:
- return readUint32();
-
- case Code.CHAR_UTF32:
- case Code.INT32:
- return (int) readUint32();
-
- case Code.FLOAT:
- return (float)BitConverter.Int64BitsToDouble(readUint32() << 32);
-
- case Code.BIN64:
- case Code.UINT64:
- case Code.INT64:
- case Code.DATETIME:
- return readUint64();
-
- case Code.DOUBLE:
- return BitConverter.Int64BitsToDouble(readUint64());
- case Code.UUID:
- return readUuid();
- case Code.STR8:
- return readStr8();
- case Code.STR16:
- return readStr16();
- case Code.STR8_LATIN:
- case Code.STR8_UTF16:
- case Code.STR16_LATIN:
- case Code.STR16_UTF16:
- // XXX: need to do character conversion
- return Encoding.UTF8.GetString(readBytes(t));
-
- case Code.MAP:
- return readMap();
- case Code.LIST:
- return readList();
- case Code.ARRAY:
- return readArray();
- case Code.STRUCT32:
- return readStruct32();
-
- case Code.BIN40:
- case Code.DEC32:
- case Code.BIN72:
- case Code.DEC64:
- // XXX: what types are we supposed to use here?
- return readBytes(t);
-
- case Code.VOID:
- return null;
-
- default:
- return readBytes(t);
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/AbstractEncoder.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/codec/AbstractEncoder.cs
deleted file mode 100644
index c89b96462e..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/AbstractEncoder.cs
+++ /dev/null
@@ -1,583 +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;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Text;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport.codec
-{
- /// <summary>
- /// AbstractEncoder
- /// </summary>
- public abstract class AbstractEncoder : Encoder
- {
- private static readonly Dictionary<Type, Code> ENCODINGS = new Dictionary<Type, Code>();
- private readonly Dictionary<String, byte[]> str8cache = new Dictionary<String, byte[]>();
-
- static AbstractEncoder()
- {
- ENCODINGS.Add(typeof (Boolean), Code.BOOLEAN);
- ENCODINGS.Add(typeof (String), Code.STR16);
- ENCODINGS.Add(typeof (long), Code.INT64);
- ENCODINGS.Add(typeof (int), Code.INT32);
- ENCODINGS.Add(typeof (short), Code.INT16);
- ENCODINGS.Add(typeof (Byte), Code.INT8);
- ENCODINGS.Add(typeof (Dictionary<String, Object>), Code.MAP);
- ENCODINGS.Add(typeof (List<Object>), Code.LIST);
- ENCODINGS.Add(typeof (float), Code.FLOAT);
- ENCODINGS.Add(typeof (Double), Code.DOUBLE);
- ENCODINGS.Add(typeof (char), Code.CHAR);
- ENCODINGS.Add(typeof (byte[]), Code.VBIN32);
- }
-
- protected abstract void doPut(byte b);
-
- protected abstract void doPut(MemoryStream src);
-
-
- protected void put(byte b)
- {
- doPut(b);
- }
-
- protected void put(MemoryStream src)
- {
- doPut(src);
- }
-
- protected virtual void put(byte[] bytes)
- {
- put(new MemoryStream(bytes));
- }
-
- protected abstract int beginSize8();
- protected abstract void endSize8(int pos);
-
- protected abstract int beginSize16();
- protected abstract void endSize16(int pos);
-
- protected abstract int beginSize32();
- protected abstract void endSize32(int pos);
-
- public virtual void writeUint8(short b)
- {
- Debug.Assert(b < 0x100);
- put((byte) b);
- }
-
- public virtual void writeUint16(int s)
- {
- Debug.Assert(s < 0x10000);
- put((byte) Functions.lsb(s >> 8));
- put((byte) Functions.lsb(s));
- }
-
- public virtual void writeUint32(long i)
- {
- Debug.Assert(i < 0x100000000L);
- put((byte) Functions.lsb(i >> 24));
- put((byte) Functions.lsb(i >> 16));
- put((byte) Functions.lsb(i >> 8));
- put((byte) Functions.lsb(i));
- }
-
- public void writeSequenceNo(int i)
- {
- writeUint32(i);
- }
-
- public virtual void writeUint64(long l)
- {
- for (int i = 0; i < 8; i++)
- {
- put((byte) Functions.lsb(l >> (56 - i*8)));
- }
- }
-
-
- public void writeDatetime(long l)
- {
- writeUint64(l);
- }
-
- private static byte[] encode(String s, Encoding encoding)
- {
- return encoding.GetBytes(s);
- }
-
- public void writeStr8(String s)
- {
- if (s == null)
- {
- s = "";
- }
-
- byte[] bytes;
- if (! str8cache.ContainsKey(s))
- {
- bytes = encode(s, Encoding.UTF8);
- str8cache.Add(s, bytes);
- }
- else
- {
- bytes = str8cache[s];
- }
- writeUint8((short) bytes.Length);
- put(bytes);
- }
-
- public void writeStr16(String s)
- {
- if (s == null)
- {
- s = "";
- }
-
- byte[] bytes = encode(s, Encoding.UTF8);
- writeUint16(bytes.Length);
- put(bytes);
- }
-
- public void writeVbin8(byte[] bytes)
- {
- if (bytes == null)
- {
- bytes = new byte[0];
- }
- if (bytes.Length > 255)
- {
- throw new Exception("array too long: " + bytes.Length);
- }
- writeUint8((short) bytes.Length);
- put(bytes);
- }
-
- public void writeVbin16(byte[] bytes)
- {
- if (bytes == null)
- {
- bytes = new byte[0];
- }
- writeUint16(bytes.Length);
- put(bytes);
- }
-
- public void writeVbin32(byte[] bytes)
- {
- if (bytes == null)
- {
- bytes = new byte[0];
- }
- writeUint32(bytes.Length);
- put(bytes);
- }
-
- public void writeSequenceSet(RangeSet ranges)
- {
- if (ranges == null)
- {
- writeUint16(0);
- }
- else
- {
- writeUint16(ranges.size()*8);
- foreach (Range range in ranges)
- {
- writeSequenceNo(range.Lower);
- writeSequenceNo(range.Upper);
- }
- }
- }
-
- public void writeByteRanges(RangeSet ranges)
- {
- throw new Exception("not implemented");
- }
-
- public void writeUuid(UUID uuid)
- {
- long msb = 0;
- long lsb = 0;
- if (uuid != null)
- {
- msb = uuid.MostSignificantBits;
- lsb = uuid.LeastSignificantBits;
- }
- writeUint64(msb);
- writeUint64(lsb);
- }
-
- public void writeStruct(int type, Struct s)
- {
- if (s == null)
- {
- s = Struct.create(type);
- }
-
- int width = s.getSizeWidth();
- int pos = -1;
- if (width > 0)
- {
- pos = beginSize(width);
- }
-
- if (type > 0)
- {
- writeUint16(type);
- }
-
- s.write(this);
-
- if (width > 0)
- {
- endSize(width, pos);
- }
- }
-
- public void writeStruct32(Struct s)
- {
- if (s == null)
- {
- writeUint32(0);
- }
- else
- {
- int pos = beginSize32();
- writeUint16(s.getEncodedType());
- s.write(this);
- endSize32(pos);
- }
- }
-
- private Code encoding(Object value)
- {
- if (value == null)
- {
- return Code.VOID;
- }
-
- Type klass = value.GetType();
- Code type = resolve(klass);
-
- if (type == Code.VOID)
- {
- throw new Exception
- ("unable to resolve type: " + klass + ", " + value);
- }
- else
- {
- return type;
- }
- }
-
- private static Code resolve(Type klass)
- {
- Code type;
- if(ENCODINGS.ContainsKey(klass))
- {
- return ENCODINGS[klass];
- }
-
- Type sup = klass.BaseType;
- if (sup != null)
- {
- type = resolve(sup);
-
- if (type != Code.VOID)
- {
- return type;
- }
- }
- foreach (Type iface in klass.GetInterfaces())
- {
- type = resolve(iface);
- if (type != Code.VOID)
- {
- return type;
- }
- }
- return Code.VOID;
- }
-
- public void writeMap(Dictionary<String, Object> map)
- {
- int pos = beginSize32();
- if (map != null)
- {
- writeUint32(map.Count);
- writeMapEntries(map);
- }
- endSize32(pos);
- }
-
- protected void writeMapEntries(Dictionary<String, Object> map)
- {
- foreach (KeyValuePair<String, Object> entry in map)
- {
- String key = entry.Key;
- Object value = entry.Value;
- Code type = encoding(value);
- writeStr8(key);
- put((byte) type);
- write(type, value);
- }
- }
-
- public void writeList(List<Object> list)
- {
- int pos = beginSize32();
- if (list != null)
- {
- writeUint32(list.Count);
- writeListEntries(list);
- }
- endSize32(pos);
- }
-
- protected void writeListEntries(List<Object> list)
- {
- foreach (Object value in list)
- {
- Code type = encoding(value);
- put((byte) type);
- write(type, value);
- }
- }
-
- public void writeArray(List<Object> array)
- {
- int pos = beginSize32();
- if (array != null)
- {
- writeArrayEntries(array);
- }
- endSize32(pos);
- }
-
- protected void writeArrayEntries(List<Object> array)
- {
- Code type;
-
- if (array.Count == 0)
- {
- return;
- }
- else
- {
- type = encoding(array[0]);
- }
- put((byte) type);
- writeUint32(array.Count);
-
- foreach (Object value in array)
- {
- write(type, value);
- }
- }
-
- private void writeSize(QpidType t, int size)
- {
- if (t.Fixed)
- {
- if (size != t.width)
- {
- throw new Exception("size does not match fixed width " + t.width + ": " + size);
- }
- }
- else
- {
- writeSize(t.width, size);
- }
- }
-
- private void writeSize(int width, int size)
- {
- // XXX: should check lengths
- switch (width)
- {
- case 1:
- writeUint8((short) size);
- break;
- case 2:
- writeUint16(size);
- break;
- case 4:
- writeUint32(size);
- break;
- default:
- throw new Exception("illegal width: " + width);
- }
- }
-
- private int beginSize(int width)
- {
- switch (width)
- {
- case 1:
- return beginSize8();
- case 2:
- return beginSize16();
- case 4:
- return beginSize32();
- default:
- throw new Exception("illegal width: " + width);
- }
- }
-
- private void endSize(int width, int pos)
- {
- switch (width)
- {
- case 1:
- endSize8(pos);
- break;
- case 2:
- endSize16(pos);
- break;
- case 4:
- endSize32(pos);
- break;
- default:
- throw new Exception("illegal width: " + width);
- }
- }
-
- private void writeBytes(QpidType t, byte[] bytes)
- {
- writeSize(t, bytes.Length);
- put(bytes);
- }
-
- private void write(Code t, Object value)
- {
- switch (t)
- {
- case Code.BIN8:
- case Code.UINT8:
- writeUint8((short) value);
- break;
- case Code.INT8:
- put((Byte) value);
- break;
- case Code.CHAR:
- byte[] b = BitConverter.GetBytes((char) value);
- put(b[0]);
- break;
- case Code.BOOLEAN:
- if ((bool) value)
- {
- put(1);
- }
- else
- {
- put(0);
- }
-
- break;
-
- case Code.BIN16:
- case Code.UINT16:
- writeUint16((int) value);
- break;
-
- case Code.INT16:
- writeUint16((short) value);
- break;
-
- case Code.BIN32:
- case Code.UINT32:
- writeUint32((long) value);
- break;
-
- case Code.CHAR_UTF32:
- case Code.INT32:
- writeUint32((int) value);
- break;
-
- case Code.FLOAT:
- writeUint32(BitConverter.DoubleToInt64Bits((float) value) >> 32);
- break;
-
- case Code.BIN64:
- case Code.UINT64:
- case Code.INT64:
- case Code.DATETIME:
- writeUint64((long) value);
- break;
-
- case Code.DOUBLE:
- writeUint64( BitConverter.DoubleToInt64Bits((double) value));
- break;
-
- case Code.UUID:
- writeUuid((UUID) value);
- break;
-
- case Code.STR8:
- writeStr8((string) value);
- break;
-
- case Code.STR16:
- writeStr16((string) value);
- break;
-
- case Code.STR8_LATIN:
- case Code.STR8_UTF16:
- case Code.STR16_LATIN:
- case Code.STR16_UTF16:
- // XXX: need to do character conversion
- writeBytes(QpidType.get((byte) t), encode((string) value, Encoding.Unicode));
- break;
-
- case Code.MAP:
- writeMap((Dictionary<String, Object>) value);
- break;
- case Code.LIST:
- writeList((List<Object>) value);
- break;
- case Code.ARRAY:
- writeList((List<Object>) value);
- break;
- case Code.STRUCT32:
- writeStruct32((Struct) value);
- break;
-
- case Code.BIN40:
- case Code.DEC32:
- case Code.BIN72:
- case Code.DEC64:
- // XXX: what types are we supposed to use here?
- writeBytes(QpidType.get((byte) t), (byte[]) value);
- break;
-
- case Code.VOID:
- break;
-
- default:
- writeBytes(QpidType.get((byte) t), (byte[]) value);
- break;
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/Decoder.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/codec/Decoder.cs
deleted file mode 100644
index 207bd60df1..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/Decoder.cs
+++ /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.
-*
-*/
-
-using System;
-using System.Collections.Generic;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport.codec
-{
- /// <summary>
- /// Decoder
- /// </summary>
-
- public interface Decoder
- {
-
- bool hasRemaining();
-
- short readUint8();
- int readUint16();
- long readUint32();
- long readUint64();
-
- long readDatetime();
-
- UUID readUuid();
-
- int readSequenceNo();
- RangeSet readSequenceSet(); // XXX
- RangeSet readByteRanges(); // XXX
-
- String readStr8();
- String readStr16();
-
- byte[] readVbin8();
- byte[] readVbin16();
- byte[] readVbin32();
-
- Struct readStruct32();
- Dictionary<String, Object> readMap();
- List<Object> readList();
- List<Object> readArray();
-
- Struct readStruct(int type);
- }
-
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/Encodable.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/codec/Encodable.cs
deleted file mode 100644
index 12ab7c52f1..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/Encodable.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 org.apache.qpid.transport.codec
-{
-
-
- /// <summary>
- /// Encodable
- /// </summary>
-
- public interface Encodable
- {
-
- void write(Encoder enc);
-
- void read(Decoder dec);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/Encoder.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/codec/Encoder.cs
deleted file mode 100644
index 32950ee02e..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/Encoder.cs
+++ /dev/null
@@ -1,62 +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;
-using System.Collections.Generic;
-using org.apache.qpid.transport.util;
-using RangeSet = org.apache.qpid.transport.RangeSet;
-using Struct = org.apache.qpid.transport.Struct;
-namespace org.apache.qpid.transport.codec
-{
- /// <summary>
- /// Encoder
- /// </summary>
-
- public interface Encoder
- {
-
- void writeUint8(short b);
- void writeUint16(int s);
- void writeUint32(long i);
- void writeUint64(long l);
-
- void writeDatetime(long l);
- void writeUuid(UUID uuid);
-
- void writeSequenceNo(int s);
- void writeSequenceSet(RangeSet ranges); // XXX
- void writeByteRanges(RangeSet ranges); // XXX
-
- void writeStr8(string s);
- void writeStr16(string s);
-
- void writeVbin8(byte[] bytes);
- void writeVbin16(byte[] bytes);
- void writeVbin32(byte[] bytes);
-
- void writeStruct32(Struct s);
- void writeMap(Dictionary<String, Object> map);
- void writeList(List<Object> list);
- void writeArray(List<Object> array);
-
- void writeStruct(int type, Struct s);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/MSDecoder.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/codec/MSDecoder.cs
deleted file mode 100644
index cc8971d38b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/MSDecoder.cs
+++ /dev/null
@@ -1,82 +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;
-using System.IO;
-using System.Text;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport.codec
-{
-
-
- /// <summary>
- /// MSDecoder
- ///
- /// </summary>
-
-
- public sealed class MSDecoder:AbstractDecoder
- {
-
- private BinaryReader reader;
-
- public void init(MemoryStream st)
- {
- reader = new BinaryReader(st, Encoding.BigEndianUnicode);
- }
-
- protected override byte doGet()
- {
- return reader.ReadByte();
- }
-
- protected override void doGet(byte[] bytes)
- {
- reader.Read(bytes, 0, bytes.Length);
- }
-
- public override bool hasRemaining()
- {
- return (reader.BaseStream.Position < reader.BaseStream.Length);
- }
-
- public override short readUint8()
- {
- return (short) (0xFF & reader.ReadByte());
- }
-
- public override int readUint16()
- {
- return ByteEncoder.GetBigEndian((UInt16) reader.ReadInt16());
- }
-
- public override long readUint32()
- {
- return ByteEncoder.GetBigEndian((UInt32) reader.ReadInt32());
- }
-
- public override long readUint64()
- {
- return (long) ByteEncoder.GetBigEndian(reader.ReadInt64());
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/MSEncoder.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/codec/MSEncoder.cs
deleted file mode 100644
index b2ccbb89ae..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/codec/MSEncoder.cs
+++ /dev/null
@@ -1,141 +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;
-using System.Diagnostics;
-using System.IO;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport.codec
-{
- /// <summary>
- /// MSEncoder
- /// </summary>
- public sealed class MSEncoder : AbstractEncoder
- {
- private readonly MemoryStream _out;
- private readonly BinaryWriter _writer;
-
- public MSEncoder(int capacity)
- {
- _out = new MemoryStream(capacity);
- _writer = new BinaryWriter(_out);
- }
-
- public void init()
- {
- _out.Seek(0, SeekOrigin.Begin);
- }
-
- public MemoryStream segment()
- {
- int length = (int) _out.Position;
- MemoryStream result = new MemoryStream(_out.ToArray(), 0, length);
- result.Seek(length, SeekOrigin.Begin);
- _out.Seek(0, SeekOrigin.Begin);
- return result;
- }
-
-
- protected override void doPut(byte b)
- {
- _writer.Write(b);
- }
-
- protected override void doPut(MemoryStream src)
- {
- _writer.Write(src.ToArray());
- }
-
- protected override void put(byte[] bytes)
- {
- _writer.Write(bytes);
- }
-
- public override void writeUint8(short b)
- {
- Debug.Assert(b < 0x100);
- _writer.Write((byte) b);
- }
-
- public override void writeUint16(int s)
- {
- Debug.Assert(s < 0x10000);
- _writer.Write(ByteEncoder.GetBigEndian((UInt16) s));
- }
-
- public override void writeUint32(long i)
- {
- Debug.Assert(i < 0x100000000L);
- _writer.Write(ByteEncoder.GetBigEndian((UInt32) i));
- }
-
- public override void writeUint64(long l)
- {
- _writer.Write(ByteEncoder.GetBigEndian(l));
- }
-
- protected override int beginSize8()
- {
- int pos = (int) _out.Position;
- _writer.Write((byte) 0);
- return pos;
- }
-
- protected override void endSize8(int pos)
- {
- int cur = (int) _out.Position;
- _out.Seek(pos, SeekOrigin.Begin);
- _writer.Write((byte) (cur - pos - 1));
- _out.Seek(cur, SeekOrigin.Begin);
- }
-
- protected override int beginSize16()
- {
- int pos = (int) _out.Position;
- _writer.Write((short) 0);
- return pos;
- }
-
- protected override void endSize16(int pos)
- {
- int cur = (int) _out.Position;
- _out.Seek(pos, SeekOrigin.Begin);
- _writer.Write((short) (cur - pos - 2));
- _out.Seek(cur, SeekOrigin.Begin);
- }
-
- protected override int beginSize32()
- {
- int pos = (int) _out.Position;
- _writer.Write(0);
- return pos;
- }
-
- protected override void endSize32(int pos)
- {
- int cur = (int) _out.Position;
- _out.Seek(pos, SeekOrigin.Begin);
- _writer.Write(ByteEncoder.GetBigEndian((Int32) cur - pos - 4));
- _out.Seek(cur, SeekOrigin.Begin);
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/ConnectionException.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/exception/ConnectionException.cs
deleted file mode 100644
index d380024c39..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/ConnectionException.cs
+++ /dev/null
@@ -1,49 +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;
-namespace org.apache.qpid.transport
-{
-
-
- /// <summary>
- /// ConnectionException
- /// </summary>
-
- [Serializable]
- public class ConnectionException : Exception
- {
- virtual public ConnectionClose Close
- {
- get
- {
- return _close;
- }
-
- }
-
- private ConnectionClose _close;
-
- public ConnectionException(ConnectionClose close):base(close.getReplyText())
- {
- _close = close;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs
deleted file mode 100644
index e9cc1b6cad..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/ExceptionArgs.cs
+++ /dev/null
@@ -1,41 +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;
-
-namespace org.apache.qpid.transport
-{
- public class ExceptionArgs : EventArgs
- {
- public ExceptionArgs(Exception e)
- {
- m_exception = e;
- }
- private Exception m_exception;
-
- public Exception Exception
- {
- get { return m_exception; }
- set { m_exception = value; }
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/ProtocolVersionException.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/exception/ProtocolVersionException.cs
deleted file mode 100644
index 2182ab9ba4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/ProtocolVersionException.cs
+++ /dev/null
@@ -1,59 +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;
-namespace org.apache.qpid.transport
-{
-
-
- /// <summary> ProtocolVersionException
- ///
- /// </summary>
-
- [Serializable]
- public sealed class ProtocolVersionException:TransportException
- {
- public sbyte Major
- {
- get
- {
- return this.major;
- }
-
- }
- public sbyte Minor
- {
- get
- {
- return this.minor;
- }
-
- }
-
- private sbyte major;
- private sbyte minor;
-
- public ProtocolVersionException(sbyte major, sbyte minor):base(String.Format("version missmatch: %{0}-{1}", major, minor))
- {
- this.major = major;
- this.minor = minor;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/SessionClosedException.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/exception/SessionClosedException.cs
deleted file mode 100644
index 9f3080ac96..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/SessionClosedException.cs
+++ /dev/null
@@ -1,38 +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.Collections.Generic;
-
-namespace org.apache.qpid.transport
-{
-
-
- /// <summary>
- /// SessionClosedException
- /// </summary>
-
- public class SessionClosedException : SessionException
- {
-
- public SessionClosedException(): base(new List<ExecutionException>())
- {
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/SessionException.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/exception/SessionException.cs
deleted file mode 100644
index b586019802..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/SessionException.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.
-*
-*/
-using System;
-using System.Collections.Generic;
-
-namespace org.apache.qpid.transport
-{
- /// <summary>
- /// SessionException
- /// </summary>
- public class SessionException : Exception
- {
- private readonly List<ExecutionException> _exceptions;
-
- public SessionException(List<ExecutionException> exceptions)
- : base(exceptions.Count == 0 ? "" : exceptions.ToString())
-
- {
- _exceptions = exceptions;
- }
-
- public List<ExecutionException> Exceptions
- {
- get { return _exceptions; }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/TransportException.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/exception/TransportException.cs
deleted file mode 100644
index 1c216d51e4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/exception/TransportException.cs
+++ /dev/null
@@ -1,46 +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;
-namespace org.apache.qpid.transport
-{
-
-
- /// <summary>
- /// TransportException
- /// </summary>
-
-
- public class TransportException : Exception
- {
- public TransportException(String msg) : base(msg)
- {
- }
-
- public TransportException(String msg, Exception cause) : base(msg, cause)
- {
- }
-
- public TransportException(Exception cause): base("Transport Exception", cause)
- {
- }
-
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/Assembler.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/Assembler.cs
deleted file mode 100644
index 6f81c8edee..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/Assembler.cs
+++ /dev/null
@@ -1,282 +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;
-using System.Collections.Generic;
-using System.IO;
-using org.apache.qpid.transport.codec;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport.network
-{
- /// <summary>
- /// Assembler
- /// </summary>
- public delegate void Processor(NetworkDelegate ndelegate);
-
- public class Assembler : NetworkDelegate, Receiver<ReceivedPayload<ProtocolEvent>>
- {
- private static readonly Logger log = Logger.get(typeof (Assembler));
- private readonly Dictionary<int, List<byte[]>> segments;
- private readonly Method[] incomplete;
- [ThreadStatic] static MSDecoder _decoder;
- private readonly Object m_objectLock = new object();
-
- // the event raised when a buffer is read from the wire
- public event EventHandler<ReceivedPayload<ProtocolEvent>> ReceivedEvent;
- public event EventHandler<ExceptionArgs> ExceptionProcessing;
- public event EventHandler HandlerClosed;
-
- event EventHandler<ReceivedPayload<ProtocolEvent>> Receiver<ReceivedPayload<ProtocolEvent>>.Received
- {
- add
- {
- lock (m_objectLock)
- {
- ReceivedEvent += value;
- }
- }
- remove
- {
- lock (m_objectLock)
- {
- ReceivedEvent -= value;
- }
- }
- }
-
- event EventHandler<ExceptionArgs> Receiver<ReceivedPayload<ProtocolEvent>>.Exception
- {
- add
- {
- lock (m_objectLock)
- {
- ExceptionProcessing += value;
- }
- }
- remove
- {
- lock (m_objectLock)
- {
- ExceptionProcessing -= value;
- }
- }
- }
-
- event EventHandler Receiver<ReceivedPayload<ProtocolEvent>>.Closed
- {
- add
- {
- lock (m_objectLock)
- {
- HandlerClosed += value;
- }
- }
- remove
- {
- lock (m_objectLock)
- {
- HandlerClosed -= value;
- }
- }
- }
-
- public Assembler()
- {
- segments = new Dictionary<int, List<byte[]>>();
- incomplete = new Method[64*1024];
- }
-
- // Invoked when a network event is received
- public void On_ReceivedEvent(object sender, ReceivedPayload<NetworkEvent> payload)
- {
- payload.Payload.ProcessNetworkEvent(this);
- }
-
- #region Interface NetworkDelegate
-
- public void Init(ProtocolHeader header)
- {
- Emit(0, header);
- }
-
- public void Error(ProtocolError error)
- {
- Emit(0, error);
- }
-
- public void Frame(Frame frame)
- {
- MemoryStream segment;
- if (frame.isFirstFrame() && frame.isLastFrame())
- {
- byte[] tmp = new byte[frame.BodySize];
- frame.Body.Read(tmp, 0, tmp.Length);
- segment = new MemoryStream();
- BinaryWriter w = new BinaryWriter(segment);
- w.Write(tmp);
- assemble(frame, new MemoryStream(tmp));
- }
- else
- {
- List<byte[]> frames;
- if (frame.isFirstFrame())
- {
- frames = new List<byte[]>();
- setSegment(frame, frames);
- }
- else
- {
- frames = getSegment(frame);
- }
- byte[] tmp = new byte[frame.BodySize];
- frame.Body.Read(tmp, 0, tmp.Length);
- frames.Add(tmp);
-
- if (frame.isLastFrame())
- {
- clearSegment(frame);
- segment = new MemoryStream();
- BinaryWriter w = new BinaryWriter(segment);
- foreach (byte[] f in frames)
- {
- w.Write(f);
- }
- assemble(frame, segment);
- }
- }
- }
-
- #endregion
-
- #region Private Support Functions
-
-
- private MSDecoder getDecoder()
- {
- if( _decoder == null )
- {
- _decoder = new MSDecoder();
- }
- return _decoder;
- }
-
- private void assemble(Frame frame, MemoryStream segment)
- {
- MSDecoder decoder = getDecoder();
- decoder.init(segment);
- int channel = frame.Channel;
- Method command;
- switch (frame.Type)
- {
- case SegmentType.CONTROL:
- int controlType = decoder.readUint16();
- Method control = Method.create(controlType);
- control.read(decoder);
- Emit(channel, control);
- break;
- case SegmentType.COMMAND:
- int commandType = decoder.readUint16();
- // read in the session header, right now we don't use it
- decoder.readUint16();
- command = Method.create(commandType);
- command.read(decoder);
- if (command.hasPayload())
- {
- incomplete[channel] = command;
- }
- else
- {
- Emit(channel, command);
- }
- break;
- case SegmentType.HEADER:
- command = incomplete[channel];
- List<Struct> structs = new List<Struct>();
- while (decoder.hasRemaining())
- {
- structs.Add(decoder.readStruct32());
- }
- command.Header = new Header(structs);
- if (frame.isLastSegment())
- {
- incomplete[channel] = null;
- Emit(channel, command);
- }
- break;
- case SegmentType.BODY:
- command = incomplete[channel];
- segment.Seek(0, SeekOrigin.Begin);
- command.Body = segment;
- incomplete[channel] = null;
- Emit(channel, command);
- break;
- default:
- throw new Exception("unknown frame type: " + frame.Type);
- }
- }
-
- private int segmentKey(Frame frame)
- {
- return (frame.Track + 1)*frame.Channel;
- }
-
- private List<byte[]> getSegment(Frame frame)
- {
- return segments[segmentKey(frame)];
- }
-
- private void setSegment(Frame frame, List<byte[]> segment)
- {
- int key = segmentKey(frame);
- if (segments.ContainsKey(key))
- {
- Error(new ProtocolError(network.Frame.L2, "segment in progress: %s",
- frame));
- }
- segments.Add(segmentKey(frame), segment);
- }
-
- private void clearSegment(Frame frame)
- {
- segments.Remove(segmentKey(frame));
- }
-
- // Emit a protocol event
- private void Emit(int channel, ProtocolEvent protevent)
- {
- protevent.Channel = channel;
- log.debug("Assembler: protocol event:", protevent);
- ReceivedPayload<ProtocolEvent> payload = new ReceivedPayload<ProtocolEvent>();
- payload.Payload = protevent;
- if (ReceivedEvent != null)
- {
- ReceivedEvent(this, payload);
- }
- else
- {
- log.debug("No listener for event: {0}", protevent);
- }
- }
-
- #endregion
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/Disassembler.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/Disassembler.cs
deleted file mode 100644
index 4cf16a98fe..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/Disassembler.cs
+++ /dev/null
@@ -1,222 +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;
-using System.IO;
-using org.apache.qpid.transport.codec;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport.network
-{
- /// <summary>
- /// Disassembler
- /// </summary>
- public sealed class Disassembler : Sender<ProtocolEvent>, ProtocolDelegate<Object>
- {
- private readonly IIOSender<MemoryStream> _sender;
- private readonly int _maxPayload;
- private readonly MemoryStream _header;
- private readonly BinaryWriter _writer;
- private readonly Object _sendlock = new Object();
- [ThreadStatic] static MSEncoder _encoder;
-
-
- public Disassembler(IIOSender<MemoryStream> sender, int maxFrame)
- {
- if (maxFrame <= Frame.HEADER_SIZE || maxFrame >= 64*1024)
- {
- throw new Exception(String.Format("maxFrame must be > {0} and < 64K: ", Frame.HEADER_SIZE) + maxFrame);
- }
- _sender = sender;
- _maxPayload = maxFrame - Frame.HEADER_SIZE;
- _header = new MemoryStream(Frame.HEADER_SIZE);
- _writer = new BinaryWriter(_header);
- }
-
- #region Sender Interface
-
- public void send(ProtocolEvent pevent)
- {
- pevent.ProcessProtocolEvent(null, this);
- }
-
- public void flush()
- {
- lock (_sendlock)
- {
- _sender.flush();
- }
- }
-
- public void close()
- {
- lock (_sendlock)
- {
- _sender.close();
- }
- }
-
- #endregion
-
- #region ProtocolDelegate<Object> Interface
-
- public void Init(Object v, ProtocolHeader header)
- {
- lock (_sendlock)
- {
- _sender.send(header.ToMemoryStream());
- _sender.flush();
- }
- }
-
- public void Control(Object v, Method method)
- {
- invokeMethod(method, SegmentType.CONTROL);
- }
-
- public void Command(Object v, Method method)
- {
- invokeMethod(method, SegmentType.COMMAND);
- }
-
- public void Error(Object v, ProtocolError error)
- {
- throw new Exception("Error: " + error);
- }
-
- #endregion
-
- #region private
-
- private void frame(byte flags, byte type, byte track, int channel, int size, MemoryStream buf)
- {
- lock (_sendlock)
- {
- _writer.Write(flags);
- _writer.Write(type);
- _writer.Write(ByteEncoder.GetBigEndian((UInt16)(size + Frame.HEADER_SIZE)));
- _writer.Write((byte)0);
- _writer.Write(track);
- _writer.Write(ByteEncoder.GetBigEndian((UInt16)( channel)));
- _writer.Write((byte)0);
- _writer.Write((byte)0);
- _writer.Write((byte)0);
- _writer.Write((byte)0);
- _sender.send(_header);
- _header.Seek(0, SeekOrigin.Begin);
- _sender.send(buf, size);
- }
- }
-
- private void fragment(byte flags, SegmentType type, ProtocolEvent mevent, MemoryStream buf)
- {
- byte typeb = (byte) type;
- byte track = mevent.EncodedTrack == Frame.L4 ? (byte) 1 : (byte) 0;
- int remaining = (int) buf.Length;
- buf.Seek(0, SeekOrigin.Begin);
- bool first = true;
- while (true)
- {
- int size = Math.Min(_maxPayload, remaining);
- remaining -= size;
-
- byte newflags = flags;
- if (first)
- {
- newflags |= Frame.FIRST_FRAME;
- first = false;
- }
- if (remaining == 0)
- {
- newflags |= Frame.LAST_FRAME;
- }
-
- frame(newflags, typeb, track, mevent.Channel, size, buf);
-
- if (remaining == 0)
- {
- break;
- }
- }
- }
-
- private MSEncoder getEncoder()
- {
- if( _encoder == null)
- {
- _encoder = new MSEncoder(4 * 1024);
- }
- return _encoder;
- }
-
- private void invokeMethod(Method method, SegmentType type)
- {
- MSEncoder encoder = getEncoder();
- encoder.init();
- encoder.writeUint16(method.getEncodedType());
- if (type == SegmentType.COMMAND)
- {
- if (method.Sync)
- {
- encoder.writeUint16(0x0101);
- }
- else
- {
- encoder.writeUint16(0x0100);
- }
- }
- method.write(_encoder);
- MemoryStream methodSeg = encoder.segment();
-
- byte flags = Frame.FIRST_SEG;
-
- bool payload = method.hasPayload();
- if (!payload)
- {
- flags |= Frame.LAST_SEG;
- }
-
- MemoryStream headerSeg = null;
- if (payload)
- {
- Header hdr = method.Header;
- Struct[] structs = hdr.Structs;
-
- foreach (Struct st in structs)
- {
- encoder.writeStruct32(st);
- }
- headerSeg = encoder.segment();
- }
-
- lock (_sendlock)
- {
- fragment(flags, type, method, methodSeg);
- if (payload)
- {
- fragment( 0x0, SegmentType.HEADER, method, headerSeg);
- fragment(Frame.LAST_SEG, SegmentType.BODY, method, method.Body);
- }
- }
- }
-
- #endregion
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/Frame.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/Frame.cs
deleted file mode 100644
index 5b7e15b1aa..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/Frame.cs
+++ /dev/null
@@ -1,143 +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;
-using System.IO;
-
-namespace org.apache.qpid.transport.network
-{
- public sealed class Frame : NetworkEvent
- {
- internal static int HEADER_SIZE = 12;
-
- // XXX: enums?
- public const byte L1 = 0;
- public const byte L2 = 1;
- public const byte L3 = 2;
- public const byte L4 = 3;
-
- public static byte RESERVED = 0x0;
-
- public static byte VERSION = 0x0;
-
- public static byte FIRST_SEG = 0x8;
- public static byte LAST_SEG = 0x4;
- public static byte FIRST_FRAME = 0x2;
- public static byte LAST_FRAME = 0x1;
-
- private readonly byte flags;
- private readonly SegmentType type;
- private readonly byte track;
- private readonly int channel;
- private readonly MemoryStream body;
- private int _bodySize;
-
-
- public Frame(byte flags, SegmentType type, byte track, int channel, int bodySize,
- MemoryStream body)
- {
- this.flags = flags;
- this.type = type;
- this.track = track;
- this.channel = channel;
- this.body = body;
- _bodySize = bodySize;
- }
-
- public int BodySize
- {
- get { return _bodySize; }
- }
-
- public MemoryStream Body
- {
- get { return body; }
- }
-
- public byte Flags
- {
- get { return flags; }
- }
-
- public int Channel
- {
- get { return channel; }
- }
-
- public int Size
- {
- get { return (int) body.Length;}
- }
-
- public SegmentType Type
- {
- get { return type; }
- }
-
- public byte Track
- {
- get { return track; }
- }
-
- private bool flag(byte mask)
- {
- return (flags & mask) != 0;
- }
-
- public bool isFirstSegment()
- {
- return flag(FIRST_SEG);
- }
-
- public bool isLastSegment()
- {
- return flag(LAST_SEG);
- }
-
- public bool isFirstFrame()
- {
- return flag(FIRST_FRAME);
- }
-
- public bool isLastFrame()
- {
- return flag(LAST_FRAME);
- }
-
- #region NetworkEvent Methods
-
- public void ProcessNetworkEvent(NetworkDelegate ndelegate)
- {
- ndelegate.Frame(this);
- }
-
- #endregion
-
- public String toString()
- {
- return String.Format
- ("[{0:d} {1:d} {2:d} {3} {4}{5}{6}{7}] ", Channel, Size, Track, Type,
- isFirstSegment() ? 1 : 0, isLastSegment() ? 1 : 0,
- isFirstFrame() ? 1 : 0, isLastFrame() ? 1 : 0);
- }
-
-
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/IIoSender.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/IIoSender.cs
deleted file mode 100644
index 67a52ef707..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/IIoSender.cs
+++ /dev/null
@@ -1,28 +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 org.apache.qpid.transport.network
-{
- public interface IIOSender<T>:Sender<T>
- {
- void send(T body, int siz);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/InputHandler.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/InputHandler.cs
deleted file mode 100644
index f3bffdb821..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/InputHandler.cs
+++ /dev/null
@@ -1,282 +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;
-using System.IO;
-using System.Text;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport.network
-{
- /// <summary>
- /// InputHandler
- /// </summary>
- public sealed class InputHandler : Receiver<ReceivedPayload<NetworkEvent>>
- {
- public enum State
- {
- PROTO_HDR,
- FRAME_HDR,
- FRAME_BODY,
- ERROR
- }
-
- private static readonly Logger log = Logger.get(typeof(InputHandler));
- private readonly Object m_objectLock = new object();
-
- // the event raised when a buffer is read from the wire
- public event EventHandler<ReceivedPayload<NetworkEvent>> ReceivedEvent;
- public event EventHandler<ExceptionArgs> ExceptionProcessing;
- public event EventHandler HandlerClosed;
-
- event EventHandler<ReceivedPayload<NetworkEvent>> Receiver<ReceivedPayload<NetworkEvent>>.Received
- {
- add
- {
- lock (m_objectLock)
- {
- ReceivedEvent += value;
- }
- }
- remove
- {
- lock (m_objectLock)
- {
- ReceivedEvent -= value;
- }
- }
- }
-
- event EventHandler<ExceptionArgs> Receiver<ReceivedPayload<NetworkEvent>>.Exception
- {
- add
- {
- lock (m_objectLock)
- {
- ExceptionProcessing += value;
- }
- }
- remove
- {
- lock (m_objectLock)
- {
- ExceptionProcessing -= value;
- }
- }
- }
-
- event EventHandler Receiver<ReceivedPayload<NetworkEvent>>.Closed
- {
- add
- {
- lock (m_objectLock)
- {
- HandlerClosed += value;
- }
- }
- remove
- {
- lock (m_objectLock)
- {
- HandlerClosed -= value;
- }
- }
- }
-
- private State state;
- private MemoryStream input;
- private int needed;
-
- private byte flags;
- private SegmentType type;
- private byte track;
- private int channel;
-
- public InputHandler(State state)
- {
- this.state = state;
- switch (state)
- {
- case State.PROTO_HDR:
- needed = 8;
- break;
- case State.FRAME_HDR:
- needed = Frame.HEADER_SIZE;
- break;
- }
- }
-
- // The command listening for a buffer read.
- public void On_ReceivedBuffer(object sender, ReceivedPayload<MemoryStream> payload)
- {
- MemoryStream buf = payload.Payload;
- int remaining = (int) buf.Length;
- if( input != null )
- {
- remaining += (int) input.Length;
- }
- try
- {
- while (remaining > 0)
- {
- if (remaining >= needed)
- {
- if (input != null)
- {
- byte[] tmp = new byte[buf.Length];
- buf.Read(tmp, 0, tmp.Length);
- input.Write(tmp, 0, tmp.Length);
- input.Seek(0, SeekOrigin.Begin);
- buf = input;
- }
- int startPos = (int)buf.Position;
- int consumed = needed;
- state = next(buf);
- if ((buf.Position - startPos) < consumed)
- {
- buf.Seek(consumed - (buf.Position - startPos), SeekOrigin.Current);
- }
- remaining -= consumed;
- input = null;
- }
- else
- {
- byte[] tmp;
- if (input == null)
- {
- input = new MemoryStream();
- tmp = new byte[remaining];
- }
- else
- {
- // this is a full buffer
- tmp = new byte[buf.Length];
- }
- buf.Read(tmp, 0, tmp.Length);
- input.Write(tmp, 0, tmp.Length);
- remaining = 0;
- }
- }
- }
- catch (Exception t)
- {
- Console.Write(t);
- if (ExceptionProcessing != null)
- {
- ExceptionProcessing(this, new ExceptionArgs(t));
- }
- }
- }
-
- #region Private Support Functions
-
- private State next(MemoryStream buf)
- {
- BinaryReader reader = new BinaryReader(buf);
-
- switch (state)
- {
- case State.PROTO_HDR:
- char a = reader.ReadChar();
- char m = reader.ReadChar();
- char q = reader.ReadChar();
- char p = reader.ReadChar();
- if (a != 'A' &&
- m != 'M' &&
- q != 'Q' &&
- p != 'P')
- {
- Error("bad protocol header: {0}", buf.ToString());
- return State.ERROR;
- }
- reader.ReadByte();
- byte instance = reader.ReadByte();
- byte major = reader.ReadByte();
- byte minor = reader.ReadByte();
- Fire_NetworkEvent(new ProtocolHeader(instance, major, minor));
- needed = Frame.HEADER_SIZE;
- return State.FRAME_HDR;
- case State.FRAME_HDR:
- reader = new BinaryReader(buf, Encoding.BigEndianUnicode);
- flags = reader.ReadByte();
- type = SegmentTypeGetter.get(reader.ReadByte()); // generated code
- int size = reader.ReadUInt16();
- size = ByteEncoder.GetBigEndian((UInt16)size);
- size -= Frame.HEADER_SIZE;
- if (size < 0 || size > (64 * 1024 - 12))
- {
- Error("bad frame size: {0:d}", size);
- return State.ERROR;
- }
- reader.ReadByte();
- byte b = reader.ReadByte();
- if ((b & 0xF0) != 0)
- {
- Error("non-zero reserved bits in upper nibble of " +
- "frame header byte 5: {0}", b);
- return State.ERROR;
- }
- track = (byte)(b & 0xF);
- channel = reader.ReadUInt16();
- channel = ByteEncoder.GetBigEndian((UInt16)channel);
- if (size == 0)
- {
- Fire_NetworkEvent(new Frame(flags, type, track, channel, 0, new MemoryStream()));
- needed = Frame.HEADER_SIZE;
- return State.FRAME_HDR;
- }
- needed = size;
- return State.FRAME_BODY;
- case State.FRAME_BODY:
- Fire_NetworkEvent(new Frame(flags, type, track, channel, needed, buf));
- needed = Frame.HEADER_SIZE;
- return State.FRAME_HDR;
- default:
- if (ExceptionProcessing != null)
- {
- ExceptionProcessing(this, new ExceptionArgs(new Exception("Error creating frame")));
- }
- throw new Exception("Error creating frame");
- }
- }
-
- private void Error(String fmt, params Object[] args)
- {
- Fire_NetworkEvent(new ProtocolError(Frame.L1, fmt, args));
- }
-
- private void Fire_NetworkEvent(NetworkEvent netevent)
- {
- log.debug("InputHandler: network event:", netevent);
- ReceivedPayload<NetworkEvent> payload = new ReceivedPayload<NetworkEvent>();
- payload.Payload = netevent;
- if (ReceivedEvent != null)
- {
- ReceivedEvent(this, payload);
- }
- else
- {
- log.debug("Nobody listening for event: {0}");
- }
- }
-
- #endregion
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/NetworkDelegate.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/NetworkDelegate.cs
deleted file mode 100644
index 9549f5c295..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/NetworkDelegate.cs
+++ /dev/null
@@ -1,40 +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 ProtocolError = org.apache.qpid.transport.ProtocolError;
-using ProtocolHeader = org.apache.qpid.transport.ProtocolHeader;
-namespace org.apache.qpid.transport.network
-{
-
-
- /// <summary>
- /// NetworkDelegate
- /// </summary>
-
- public interface NetworkDelegate
- {
-
- void Init(ProtocolHeader header);
-
- void Frame(Frame frame);
-
- void Error(ProtocolError error);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/NetworkEvent.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/NetworkEvent.cs
deleted file mode 100644
index c682e77560..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/NetworkEvent.cs
+++ /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.
-*
-*/
-namespace org.apache.qpid.transport.network
-{
-
- /// <summary>
- /// NetworkEvent
- /// </summary>
-
- public interface NetworkEvent
- {
- void ProcessNetworkEvent(NetworkDelegate networkDelegate);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IIoTransport.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IIoTransport.cs
deleted file mode 100644
index aab017dad1..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IIoTransport.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.
-*/
-using System.IO;
-using System.Net.Sockets;
-
-namespace org.apache.qpid.transport.network.io
-{
- public interface IIoTransport
- {
- Connection Connection
- {
- get;
- set;
- }
-
- Receiver<ReceivedPayload<MemoryStream>> Receiver
- {
- get;
- set;
- }
-
- IoSender Sender
- {
- get;
- set;
- }
-
-
- Stream Stream
- {
- get;
- set;
- }
-
- TcpClient Socket
- {
- get;
- set;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoReceiver.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoReceiver.cs
deleted file mode 100644
index 4c59cf0a6c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoReceiver.cs
+++ /dev/null
@@ -1,189 +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;
-using System.IO;
-using System.Threading;
-using Logger = org.apache.qpid.transport.util.Logger;
-
-
-namespace org.apache.qpid.transport.network.io
-{
- /// <summary>
- /// IoReceiver
- /// </summary>
- public sealed class IoReceiver : Receiver<ReceivedPayload<MemoryStream>>
- {
- private static readonly Logger log = Logger.get(typeof(IoReceiver));
- private readonly int m_bufferSize;
- private readonly Stream m_bufStream;
- private readonly int m_timeout;
- private readonly Thread m_thread;
- private bool m_closed;
- private readonly Object m_objectLock = new object();
-
- // the event raised when a buffer is read from the wire
- event EventHandler<ReceivedPayload<MemoryStream>> ReceivedBuffer;
- event EventHandler<ExceptionArgs> ExceptionReading;
- event EventHandler ReceiverClosed;
-
- event EventHandler<ReceivedPayload<MemoryStream>> Receiver<ReceivedPayload<MemoryStream>>.Received
- {
- add
- {
- lock (m_objectLock)
- {
- ReceivedBuffer += value;
- }
- }
- remove
- {
- lock (m_objectLock)
- {
- ReceivedBuffer -= value;
- }
- }
- }
-
- event EventHandler<ExceptionArgs> Receiver<ReceivedPayload<MemoryStream>>.Exception
- {
- add
- {
- lock (m_objectLock)
- {
- ExceptionReading += value;
- }
- }
- remove
- {
- lock (m_objectLock)
- {
- ExceptionReading -= value;
- }
- }
- }
-
- event EventHandler Receiver<ReceivedPayload<MemoryStream>>.Closed
- {
- add
- {
- lock (m_objectLock)
- {
- ReceiverClosed += value;
- }
- }
- remove
- {
- lock (m_objectLock)
- {
- ReceiverClosed -= value;
- }
- }
- }
-
- public IoReceiver(Stream stream, int bufferSize, int timeout)
- {
- m_bufferSize = bufferSize;
- m_bufStream = stream;
- m_timeout = timeout;
- m_thread = new Thread(Go);
- m_thread.Name = String.Format("IoReceiver - {0}", stream);
- m_thread.IsBackground = true;
- m_thread.Start();
- }
-
- public void close()
- {
- Mutex mut = new Mutex();
- mut.WaitOne();
- if (!m_closed)
- {
- m_closed = true;
- try
- {
- log.debug("Receiver closing");
- m_bufStream.Close();
- m_thread.Join(m_timeout);
- if (m_thread.IsAlive)
- {
- throw new TransportException("join timed out");
- }
- }
- catch (ThreadInterruptedException e)
- {
- throw new TransportException(e);
- }
- catch (IOException e)
- {
- throw new TransportException(e);
- }
- }
- mut.ReleaseMutex();
- }
-
- void Go()
- {
- // create a BufferedStream on top of the NetworkStream.
- int threshold = m_bufferSize/2;
- byte[] buffer = new byte[m_bufferSize];
- try
- {
- int read;
- int offset = 0;
- ReceivedPayload<MemoryStream> payload = new ReceivedPayload<MemoryStream>();
- while ((read = m_bufStream.Read(buffer, offset, m_bufferSize - offset)) > 0)
- {
- MemoryStream memStream = new MemoryStream(buffer, offset, read);
- if (ReceivedBuffer != null)
- {
- // call the event
- payload.Payload = memStream;
- ReceivedBuffer(this, payload);
- }
- offset += read;
- if (offset > threshold)
- {
- offset = 0;
- buffer = new byte[m_bufferSize];
- }
- }
- log.debug("Receiver thread terminating");
- }
- catch (IOException e)
- {
- // IOException is thrown when the socket is closed according to the docs
- }
- catch (Exception t)
- {
- if (ExceptionReading != null)
- {
- ExceptionReading(this, new ExceptionArgs(t));
- }
- }
- finally
- {
- if (ReceiverClosed != null)
- {
- ReceiverClosed(this, new EventArgs());
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoSSLTransport.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoSSLTransport.cs
deleted file mode 100644
index 8c5f161a35..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoSSLTransport.cs
+++ /dev/null
@@ -1,194 +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;
-using System.IO;
-using System.Net.Security;
-using System.Net.Sockets;
-using System.Security.Authentication;
-using System.Security.Cryptography.X509Certificates;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport.network.io
-{
- public sealed class IoSSLTransport : IIoTransport
- {
- // constants
- private const int DEFAULT_READ_WRITE_BUFFER_SIZE = 64*1024;
- private const int TIMEOUT = 60000;
- private const int QUEUE_SIZE = 1000;
- // props
- private static readonly Logger log = Logger.get(typeof (IoSSLTransport));
- private Stream m_stream;
- private IoSender m_sender;
- private Receiver<ReceivedPayload<MemoryStream>> m_receiver;
- private TcpClient m_socket;
- private Connection m_con;
- private readonly bool _rejectUntrusted;
-
- public static Connection connect(String host, int port, string serverName, string certPath, bool rejectUntrusted, ConnectionDelegate conndel)
- {
- IIoTransport transport = new IoSSLTransport(host, port, serverName, certPath, rejectUntrusted, conndel);
- return transport.Connection;
- }
-
- public IoSSLTransport(String host, int port, string serverName, string certPath, bool rejectUntrusted, ConnectionDelegate conndel)
- {
- _rejectUntrusted = rejectUntrusted;
- createSocket(host, port, serverName, certPath);
- Sender = new IoSender(this, QUEUE_SIZE, TIMEOUT);
- Receiver = new IoReceiver(Stream, Socket.ReceiveBufferSize*2, TIMEOUT);
- Assembler assembler = new Assembler();
- InputHandler inputHandler = new InputHandler(InputHandler.State.PROTO_HDR);
- Connection = new Connection(assembler, new Disassembler(Sender, 64*1024 - 1), conndel);
- // Input handler listen to Receiver events
- Receiver.Received += inputHandler.On_ReceivedBuffer;
- // Assembler listen to inputhandler events
- inputHandler.ReceivedEvent += assembler.On_ReceivedEvent;
- // Connection listen to asembler protocol event
- Receiver.Closed += Connection.On_ReceivedClosed;
- Receiver.Exception += Connection.On_ReceivedException;
- inputHandler.HandlerClosed += Connection.On_ReceivedClosed;
- inputHandler.ExceptionProcessing += Connection.On_ReceivedException;
- assembler.HandlerClosed += Connection.On_ReceivedClosed;
- assembler.ExceptionProcessing += Connection.On_ReceivedException;
- assembler.ReceivedEvent += Connection.On_ReceivedEvent;
- }
-
- public Connection Connection
- {
- get { return m_con; }
- set { m_con = value; }
- }
-
- public Receiver<ReceivedPayload<MemoryStream>> Receiver
- {
- get { return m_receiver; }
- set { m_receiver = value; }
- }
-
- public IoSender Sender
- {
- get { return m_sender; }
- set { m_sender = value; }
- }
-
-
- public Stream Stream
- {
- get { return m_stream; }
- set { m_stream = value; }
- }
-
- public TcpClient Socket
- {
- get { return m_socket; }
- set { m_socket = value; }
- }
-
- #region Private Support Functions
-
- private void createSocket(String host, int port, string serverName, string certPath)
- {
- TcpClient socket;
- try
- {
- socket = new TcpClient();
- String noDelay = Environment.GetEnvironmentVariable("qpid.tcpNoDelay");
- String writeBufferSize = Environment.GetEnvironmentVariable("qpid.writeBufferSize");
- String readBufferSize = Environment.GetEnvironmentVariable("qpid.readBufferSize");
- socket.NoDelay = noDelay != null && bool.Parse(noDelay);
- socket.ReceiveBufferSize = readBufferSize == null
- ? DEFAULT_READ_WRITE_BUFFER_SIZE
- : int.Parse(readBufferSize);
- socket.SendBufferSize = writeBufferSize == null
- ? DEFAULT_READ_WRITE_BUFFER_SIZE
- : int.Parse(writeBufferSize);
-
- log.debug("NoDelay : {0}", socket.NoDelay);
- log.debug("ReceiveBufferSize : {0}", socket.ReceiveBufferSize);
- log.debug("SendBufferSize : {0}", socket.SendBufferSize);
- log.debug("Openning connection with host : {0}; port: {1}", host, port);
-
- socket.Connect(host, port);
- Socket = socket;
- }
- catch (Exception e)
- {
- throw new TransportException("Error connecting to broker", e);
- }
- try
- {
- //Initializes a new instance of the SslStream class using the specified Stream, stream closure behavior, certificate validation delegate and certificate selection delegate
- SslStream sslStream = new SslStream(socket.GetStream(), false, ValidateServerCertificate, LocalCertificateSelection);
- if (certPath != null)
- {
- X509CertificateCollection col = new X509CertificateCollection();
- X509Certificate cert = X509Certificate.CreateFromCertFile(certPath);
- col.Add(cert);
- sslStream.AuthenticateAsClient(serverName, col, SslProtocols.Default, true);
- }
- else
- {
- sslStream.AuthenticateAsClient(serverName);
- }
- Stream = sslStream;
- }
- catch (AuthenticationException e)
- {
- log.warn("Exception: {0}", e.Message);
- if (e.InnerException != null)
- {
- log.warn("Inner exception: {0}", e.InnerException.Message);
- }
- socket.Close();
- throw new TransportException("Authentication failed - closing the connection.");
- }
- }
-
- // The following method is invoked by the RemoteCertificateValidationDelegate.
- public bool ValidateServerCertificate(
- object sender,
- X509Certificate certificate,
- X509Chain chain,
- SslPolicyErrors sslPolicyErrors)
- {
- bool result = true;
- if (sslPolicyErrors != SslPolicyErrors.None && _rejectUntrusted )
- {
- log.warn("Certificate error: {0}", sslPolicyErrors);
- // Do not allow this client to communicate with unauthenticated servers.
- result = false;
- }
- return result;
- }
-
- public X509Certificate LocalCertificateSelection(
- Object sender,
- string targetHost,
- X509CertificateCollection localCertificates,
- X509Certificate remoteCertificate,
- string[] acceptableIssuers
- )
- {
- return remoteCertificate;
- }
-
- #endregion
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoSender.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoSender.cs
deleted file mode 100644
index 924d871dd2..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoSender.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.
-*/
-using System;
-using System.IO;
-using System.Threading;
-using common.org.apache.qpid.transport.util;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport.network.io
-{
- public sealed class IoSender : IIOSender<MemoryStream>
- {
- private static readonly Logger log = Logger.get(typeof (IoReceiver));
- private readonly Stream bufStream;
- private bool closed;
- private readonly Mutex mutClosed = new Mutex();
- private readonly CircularBuffer<byte[]> queue;
- private readonly Thread thread;
- private readonly int timeout;
- private readonly MemoryStream _tobeSent = new MemoryStream();
- public IoSender(IIoTransport transport, int queueSize, int timeout)
- {
- this.timeout = timeout;
- bufStream = transport.Stream;
- queue = new CircularBuffer<byte[]>(queueSize);
- thread = new Thread(Go);
- log.debug("Creating IoSender thread");
- thread.Name = String.Format("IoSender - {0}", transport.Socket) ;
- thread.IsBackground = true;
- thread.Start();
- }
-
- public void send(MemoryStream str)
- {
- int pos = (int) str.Position;
- str.Seek(0, SeekOrigin.Begin);
- send(str, pos);
- }
-
- public void send(MemoryStream str, int size)
- {
- mutClosed.WaitOne();
- if (closed)
- {
- throw new TransportException("sender is closed");
- }
- mutClosed.ReleaseMutex();
- byte[] buf = new byte[size];
- str.Read(buf, 0, size);
- _tobeSent.Write(buf, 0, size);
- }
-
- public void flush()
- {
- int length = (int)_tobeSent.Position;
- byte[] buf = new byte[length];
- _tobeSent.Seek(0, SeekOrigin.Begin);
- _tobeSent.Read(buf, 0, length);
- queue.Enqueue(buf);
- // bufStream.Write(buf, 0, length);
- // _tobeSent = new MemoryStream();
- // _writer.Write(buf, 0, length);
- // _writer.Flush();
- _tobeSent.Seek(0, SeekOrigin.Begin);
- }
-
- public void close()
- {
- log.debug("Closing Sender");
- mutClosed.WaitOne();
- if (!closed)
- {
- try
- {
- closed = true;
- queue.close();
- thread.Join(timeout);
- if (thread.IsAlive)
- {
- throw new TransportException("join timed out");
- }
- }
- catch (ThreadInterruptedException e)
- {
- throw new TransportException(e);
- }
- catch (IOException e)
- {
- throw new TransportException(e);
- }
- }
- mutClosed.ReleaseMutex();
- }
-
- private void Go()
- {
- while (! closed)
- {
- //MemoryStream st = queue.Dequeue();
- byte[] st = queue.Dequeue();
- if (st != null)
- {
- try
- {
- // int length = (int) st.Length;
- // byte[] buf = new byte[length];
- // st.Read(buf, 0, length);
- bufStream.Write(st, 0, st.Length);
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- }
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoTransport.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoTransport.cs
deleted file mode 100644
index 3a2397870d..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/network/io/IoTransport.cs
+++ /dev/null
@@ -1,143 +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;
-using System.IO;
-using System.Net.Sockets;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport.network.io
-{
- /// <summary>
- /// This class provides a socket based transport using sync io classes.
- ///
- /// The following params are configurable via JVM arguments
- /// TCP_NO_DELAY - qpid.tcpNoDelay
- /// SO_RCVBUF - qpid.readBufferSize
- /// SO_SNDBUF - qpid.writeBufferSize
- /// </summary>
- public sealed class IoTransport : IIoTransport
- {
- // constants
- private const int DEFAULT_READ_WRITE_BUFFER_SIZE = 64*1024;
- private const int TIMEOUT = 60000;
- private const int QUEUE_SIZE = 1000;
- // props
- private static readonly Logger log = Logger.get(typeof (IoTransport));
- private Stream m_stream;
- private IoSender m_sender;
- private Receiver<ReceivedPayload<MemoryStream>> m_receiver;
- private TcpClient m_socket;
- private Connection m_con;
-
- public static Connection connect(String host, int port, ConnectionDelegate conndel)
- {
- IoTransport transport = new IoTransport(host, port, conndel);
- return transport.Connection;
- }
-
- public IoTransport(String host, int port, ConnectionDelegate conndel)
- {
- createSocket(host, port);
- Sender = new IoSender(this, QUEUE_SIZE, TIMEOUT);
- Receiver = new IoReceiver(Stream, Socket.ReceiveBufferSize * 2, TIMEOUT);
- Assembler assembler = new Assembler();
- InputHandler inputHandler = new InputHandler(InputHandler.State.PROTO_HDR);
- Connection = new Connection(assembler, new Disassembler(Sender, 64 * 1024 - 1), conndel);
- // Input handler listen to Receiver events
- Receiver.Received += inputHandler.On_ReceivedBuffer;
- // Assembler listen to inputhandler events
- inputHandler.ReceivedEvent += assembler.On_ReceivedEvent;
- // Connection listen to asembler protocol event
- Receiver.Closed += Connection.On_ReceivedClosed;
- Receiver.Exception += Connection.On_ReceivedException;
- inputHandler.HandlerClosed += Connection.On_ReceivedClosed;
- inputHandler.ExceptionProcessing += Connection.On_ReceivedException;
- assembler.HandlerClosed += Connection.On_ReceivedClosed;
- assembler.ExceptionProcessing += Connection.On_ReceivedException;
- assembler.ReceivedEvent += Connection.On_ReceivedEvent;
- }
-
- public Connection Connection
- {
- get { return m_con; }
- set { m_con = value; }
- }
-
- public Receiver<ReceivedPayload<MemoryStream>> Receiver
- {
- get { return m_receiver; }
- set { m_receiver = value; }
- }
-
- public IoSender Sender
- {
- get { return m_sender; }
- set { m_sender = value; }
- }
-
-
- public Stream Stream
- {
- get { return m_stream; }
- set { m_stream = value; }
- }
-
- public TcpClient Socket
- {
- get { return m_socket; }
- set { m_socket = value; }
- }
-
- #region Private Support Functions
-
- private void createSocket(String host, int port)
- {
- try
- {
- TcpClient socket = new TcpClient();
- String noDelay = Environment.GetEnvironmentVariable("qpid.tcpNoDelay");
- String writeBufferSize = Environment.GetEnvironmentVariable("qpid.writeBufferSize");
- String readBufferSize = Environment.GetEnvironmentVariable("qpid.readBufferSize");
- socket.NoDelay = noDelay != null && bool.Parse(noDelay);
- socket.ReceiveBufferSize = readBufferSize == null ? DEFAULT_READ_WRITE_BUFFER_SIZE : int.Parse(readBufferSize);
- socket.SendBufferSize = writeBufferSize == null ? DEFAULT_READ_WRITE_BUFFER_SIZE : int.Parse(writeBufferSize);
-
- log.debug("NoDelay : {0}", socket.NoDelay);
- log.debug("ReceiveBufferSize : {0}", socket.ReceiveBufferSize);
- log.debug("SendBufferSize : {0}", socket.SendBufferSize);
- log.debug("Openning connection with host : {0}; port: {1}", host, port);
-
- socket.Connect(host, port);
- Socket = socket;
- Stream = socket.GetStream();
- }
- catch (SocketException e)
- {
- Console.WriteLine(e.StackTrace);
- throw new TransportException("Error connecting to broker", e);
- }
- catch (IOException e)
- {
- throw new TransportException("Error connecting to broker", e);
- }
- }
-
- #endregion
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/util/ByteEncoder.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/util/ByteEncoder.cs
deleted file mode 100644
index ac493a9b62..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/util/ByteEncoder.cs
+++ /dev/null
@@ -1,193 +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;
-
-namespace org.apache.qpid.transport.util
-{
- public static class ByteEncoder
- {
- #region Endian conversion helper routines
- /// <summary>
- /// Returns the value encoded in Big Endian (PPC, XDR) format.
- /// </summary>
- /// <param name="value">Value to encode.</param>
- /// <returns>Big-endian encoded value.</returns>
- public static Int32 GetBigEndian(Int32 value)
- {
- if (BitConverter.IsLittleEndian)
- {
- return swapByteOrder(value);
- }
- return value;
- }
-
- /// <summary>
- /// Returns the value encoded in Big Endian (PPC, XDR) format.
- /// </summary>
- /// <param name="value">Value to encode.</param>
- /// <returns>Big-endian encoded value.</returns>
- public static UInt16 GetBigEndian(UInt16 value)
- {
- if (BitConverter.IsLittleEndian)
- {
- return swapByteOrder(value);
- }
- return value;
- }
-
- /// <summary>
- /// Returns the value encoded in Big Endian (PPC, XDR) format.
- /// </summary>
- /// <param name="value">Value to encode.</param>
- /// <returns>Big-endian encoded value.</returns>
- public static UInt32 GetBigEndian(UInt32 value)
- {
- if (BitConverter.IsLittleEndian)
- {
- return swapByteOrder(value);
- }
- return value;
- }
-
- /// <summary>
- /// Returns the value encoded in Big Endian (PPC, XDR) format.
- /// </summary>
- /// <param name="value">Value to encode.</param>
- /// <returns>Big-endian encoded value.</returns>
- public static long GetBigEndian(long value)
- {
- if (BitConverter.IsLittleEndian)
- {
- return swapByteOrder(value);
- }
- return value;
- }
-
- /// <summary>
- /// Returns the value encoded in Little Endian (x86, NDR) format.
- /// </summary>
- /// <param name="value">Value to encode.</param>
- /// <returns>Little-endian encoded value.</returns>
- public static Int32 GetLittleEndian(Int32 value)
- {
- if (BitConverter.IsLittleEndian)
- {
- return value;
- }
- return swapByteOrder(value);
- }
-
- /// <summary>
- /// Returns the value encoded in Little Endian (x86, NDR) format.
- /// </summary>
- /// <param name="value">Value to encode.</param>
- /// <returns>Little-endian encoded value.</returns>
- public static UInt32 GetLittleEndian(UInt32 value)
- {
- if (BitConverter.IsLittleEndian)
- {
- return value;
- }
- return swapByteOrder(value);
- }
-
- /// <summary>
- /// Returns the value encoded in Little Endian (x86, NDR) format.
- /// </summary>
- /// <param name="value">Value to encode.</param>
- /// <returns>Little-endian encoded value.</returns>
- public static UInt16 GetLittleEndian(UInt16 value)
- {
- if (BitConverter.IsLittleEndian)
- {
- return value;
- }
- return swapByteOrder(value);
- }
-
- /// <summary>
- /// Returns the value encoded in Little Endian (x86, NDR) format.
- /// </summary>
- /// <param name="value">Value to encode.</param>
- /// <returns>Little-endian encoded value.</returns>
- public static long GetLittleEndian(long value)
- {
- if (BitConverter.IsLittleEndian)
- {
- return value;
- }
- return swapByteOrder(value);
- }
-
- /// <summary>
- /// Swaps the Byte order of an <see cref="Int32"/>.
- /// </summary>
- /// <param name="value"><see cref="Int32"/> to swap the bytes of.</param>
- /// <returns>Byte order swapped <see cref="Int32"/>.</returns>
- private static Int32 swapByteOrder(Int32 value)
- {
- Int32 swapped = (Int32)((0x000000FF) & (value >> 24)
- | (0x0000FF00) & (value >> 8)
- | (0x00FF0000) & (value << 8)
- | (0xFF000000) & (value << 24));
- return swapped;
- }
-
- /// <summary>
- /// Swaps the byte order of a <see cref="UInt16"/>.
- /// </summary>
- /// <param name="value"><see cref="UInt16"/> to swap the bytes of.</param>
- /// <returns>Byte order swapped <see cref="UInt16"/>.</returns>
- private static UInt16 swapByteOrder(UInt16 value)
- {
- return (UInt16)((0x00FF & (value >> 8))
- | (0xFF00 & (value << 8)));
- }
-
- /// <summary>
- /// Swaps the byte order of a <see cref="UInt32"/>.
- /// </summary>
- /// <param name="value"><see cref="UInt32"/> to swap the bytes of.</param>
- /// <returns>Byte order swapped <see cref="UInt32"/>.</returns>
- private static UInt32 swapByteOrder(UInt32 value)
- {
- UInt32 swapped = ((0x000000FF) & (value >> 24)
- | (0x0000FF00) & (value >> 8)
- | (0x00FF0000) & (value << 8)
- | (0xFF000000) & (value << 24));
- return swapped;
- }
-
- /// <summary>
- /// Swaps the byte order of a <see cref="Double"/> (double precision IEEE 754)
- /// </summary>
- /// <param name="value"><see cref="Double"/> to swap.</param>
- /// <returns>Byte order swapped <see cref="Double"/> value.</returns>
- private static long swapByteOrder(long value)
- {
- Byte[] buffer = BitConverter.GetBytes(value);
- Array.Reverse(buffer, 0, buffer.Length);
- return BitConverter.ToInt64(buffer, 0);
- }
- #endregion
- }
-
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/util/CircularBuffer.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/util/CircularBuffer.cs
deleted file mode 100644
index 05c26bcc49..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/util/CircularBuffer.cs
+++ /dev/null
@@ -1,132 +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;
-using System.Threading;
-
-namespace common.org.apache.qpid.transport.util
-{
- public class CircularBuffer<T>
- {
- private readonly T[] buffer;
- private Int32 nrp, nwp;
- private readonly Int32 len;
- private Int32 countValue;
- private readonly Int32 add;
-
-
- /// <summary>
- /// Constructor creates N=len element
- /// Circular Buffer that olds MemoryStream
- /// </summary>
- public CircularBuffer(Int32 len)
- {
- buffer = new T[len];
- this.len = len;
- add = 1 - len;
- nrp = 0;
- nwp = 0;
- countValue = 0;
- }
-
-
- public void Enqueue(T t)
- {
- lock (this)
- {
- if (countValue >= (len - 1))
- {
- // wait for room to be available
- Monitor.Wait(this);
- }
- bool notifyDequeue = countValue <= 0;
- load(t);
- if (notifyDequeue) //notifyDequeue)
- {
- Monitor.PulseAll(this);
- }
- }
- }
-
-
- public T Dequeue()
- {
- lock (this)
- {
- if (countValue <= 0)
- {
- Monitor.Wait(this);
- }
- bool notifyEnqueue = countValue >= (len - 1);
- T temp = get();
- if (notifyEnqueue) //notifyEnqueue)
- {
- Monitor.PulseAll(this);
- }
- return temp;
- }
- }
-
- public void close()
- {
- nrp = 0;
- nwp = 0;
- countValue = 0;
- Array.Clear(buffer, 0, len);
- lock (this)
- {
- Monitor.PulseAll(this);
- }
- }
-
- #region Private Support Functions
-
- private void load(T t)
- {
- Int32 i = nwp;
- buffer[i] = t;
- i += add;
- if (i < 0) i += len;
- nwp = i;
- updateCount();
- }
-
- private void updateCount()
- {
- countValue = nwp - nrp;
- if (countValue <= 0 )
- countValue += len; // modulo buffer size
- }
-
- private T get()
- {
- Int32 i = nrp;
- T temp = buffer[i];
- i += add;
- if (i < 0) i += len;
- nrp = i;
- countValue--;
- return (temp);
- }
-
- #endregion
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/util/Functions.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/util/Functions.cs
deleted file mode 100644
index f5777d8ee9..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/util/Functions.cs
+++ /dev/null
@@ -1,41 +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 org.apache.qpid.transport.util
-{
-
- /// <summary>
- /// Functions
- /// </summary>
-
- public class Functions
- {
- public static sbyte lsb(int i)
- {
- return (sbyte) (0xFF & i);
- }
-
- public static sbyte lsb(long l)
- {
- return (sbyte) (0xFF & l);
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/util/Logger.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/util/Logger.cs
deleted file mode 100644
index 04473575c2..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/util/Logger.cs
+++ /dev/null
@@ -1,114 +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;
-using log4net;
-
-namespace org.apache.qpid.transport.util
-{
-
- /// <summary> Logger
- ///
- /// </summary>
-
- public sealed class Logger
- {
- private readonly ILog log;
-
- public static Logger get(Type type)
- {
- return new Logger(LogManager.GetLogger(type));
- }
-
- private Logger(ILog log)
- {
- this.log = log;
- }
-
- public bool isDebugEnabled()
- {
- return log.IsDebugEnabled;
- }
-
- public void debug(String message, params Object[] args)
- {
- if (log.IsDebugEnabled)
- {
- log.Debug(String.Format(message, args));
- }
- }
-
- public void debug(Exception t, String message, params Object[] args)
- {
- if (log.IsDebugEnabled)
- {
- log.Debug(String.Format(message, args), t);
- }
- }
-
- public void error(String message, params Object[] args)
- {
- if (log.IsErrorEnabled)
- {
- log.Error(String.Format(message, args));
- }
- }
-
- public void error(Exception t, String message, params Object[] args)
- {
- if (log.IsErrorEnabled)
- {
- log.Error(String.Format(message, args), t);
- }
- }
-
- public void warn(String message, params Object[] args)
- {
- if (log.IsWarnEnabled)
- {
- log.Warn(String.Format(message, args));
- }
- }
-
- public void warn(Exception t, String message, params Object[] args)
- {
- if (log.IsWarnEnabled)
- {
- log.Warn(String.Format(message, args), t);
- }
- }
-
- public void info(String message, params Object[] args)
- {
- if (log.IsInfoEnabled)
- {
- log.Info(String.Format(message, args));
- }
- }
-
- public void info(Exception t, String message, params Object[] args)
- {
- if (log.IsInfoEnabled)
- {
- log.Info(String.Format(message, args), t);
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/util/ResultFuture.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/util/ResultFuture.cs
deleted file mode 100644
index 5b31c9d71a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/util/ResultFuture.cs
+++ /dev/null
@@ -1,80 +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;
-using System.Threading;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.util;
-
-namespace common.org.apache.qpid.transport.util
-{
- public class ResultFuture : Future
- {
- const long _timeout = 60000;
- private Struct _result;
- private Session _session;
- private static readonly Logger log = Logger.get(typeof(ResultFuture));
-
- public Struct get(long timeout)
- {
- lock (this)
- {
- DateTime start = DateTime.Now;
- long elapsed = 0;
- while (! _session.Closed && timeout - elapsed > 0 && _result == null)
- {
- log.debug("{0} waiting for result: {1}", _session, this );
- Monitor.Wait(this, (int) (timeout - elapsed));
- elapsed = (long) (DateTime.Now.Subtract(start)).TotalMilliseconds;
- }
- }
- if( _session.Closed )
- {
- throw new SessionException(_session.getExceptions());
- }
- return _result;
- }
-
- public Struct Result
- {
- get { return get(_timeout); }
- set
- {
- lock (this)
- {
- _result = value;
- Monitor.PulseAll(this);
- }
- }
- }
-
- public Session Session
- {
- set { _session = value; }
- }
-
- public String toString()
- {
- return String.Format("Future({0})", _result);
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/util/Serial.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/util/Serial.cs
deleted file mode 100644
index e47a6745a5..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/util/Serial.cs
+++ /dev/null
@@ -1,94 +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 org.apache.qpid.transport.util
-{
- /// <summary>
- /// This class provides basic serial number comparisons as defined in
- /// RFC 1982.
- /// </summary>
- public class Serial
- {
- ///
- ///
- ///Compares two numbers using serial arithmetic.
- ///
- /// param s1 the first serial number
- /// param s2 the second serial number
- ///
- /// return a negative integer, zero, or a positive integer as the
- /// first argument is less than, equal to, or greater than the
- /// second
- ///
- public static int compare(int s1, int s2)
- {
- return s1 - s2;
- }
-
- public static bool lt(int s1, int s2)
- {
- return compare(s1, s2) < 0;
- }
-
- public static bool le(int s1, int s2)
- {
- return compare(s1, s2) <= 0;
- }
-
- public static bool gt(int s1, int s2)
- {
- return compare(s1, s2) > 0;
- }
-
- public static bool ge(int s1, int s2)
- {
- return compare(s1, s2) >= 0;
- }
-
- public static bool eq(int s1, int s2)
- {
- return s1 == s2;
- }
-
- public static int min(int s1, int s2)
- {
- if (lt(s1, s2))
- {
- return s1;
- }
- else
- {
- return s2;
- }
- }
-
- public static int max(int s1, int s2)
- {
- if (gt(s1, s2))
- {
- return s1;
- }
- else
- {
- return s2;
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/client/transport/util/UUID.cs b/M4-RCs/qpid/dotnet/client-010/client/transport/util/UUID.cs
deleted file mode 100644
index 788c5b99c8..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/client/transport/util/UUID.cs
+++ /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.
-*
-*/
-
-using System;
-
-namespace org.apache.qpid.transport.util
-{
- public class UUID
- {
- private long _mostSigBits;
-
- private long _leastSigBits;
-
-
- public UUID(long mostSigBits, long leastSigBits)
- {
- _mostSigBits = mostSigBits;
- _leastSigBits = leastSigBits;
- }
-
- public long MostSignificantBits
- {
- get { return _mostSigBits; }
- set { _mostSigBits = value; }
- }
-
- public long LeastSignificantBits
- {
- get { return _leastSigBits; }
- set { _leastSigBits = value; }
- }
-
- private UUID(byte[] r)
- {
- MostSignificantBits = 0;
- LeastSignificantBits = 0;
- for (int i = 0; i < 8; i++)
- MostSignificantBits = (MostSignificantBits << 8) | (r[i] & 0xff);
- for (int i = 8; i < 16; i++)
- LeastSignificantBits = (LeastSignificantBits << 8) | (r[i] & 0xff);
- }
-
- public static UUID randomUUID()
- {
- byte[] randomBytes = new byte[16];
- Random random = new Random();
- random.NextBytes(randomBytes);
- randomBytes[6] &= 0x0f;
- randomBytes[6] |= 0x40;
- randomBytes[8] &= 0x3f;
- randomBytes[8] |= 0x80;
- return new UUID(randomBytes);
- }
-
- public new String ToString()
- {
- return (digits(_mostSigBits >> 32, 8) + "-" +
- digits(_mostSigBits >> 16, 4) + "-" +
- digits(_mostSigBits, 4) + "-" +
- digits(_leastSigBits >> 48, 4) + "-" +
- digits(_leastSigBits, 12));
- }
-
- private static String digits(long val, int digits)
- {
- long hi = 1L << (digits * 4);
- return Convert.ToString((hi | (val & (hi - 1))), 16);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/default.build b/M4-RCs/qpid/dotnet/client-010/default.build
deleted file mode 100644
index 75eadf0a0c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/default.build
+++ /dev/null
@@ -1,274 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Qpid.NET" default="build">
-
- <!-- Determines the formatter to use to format output of test results. -->
- <property name="nant.formatter" value="Plain" />
-
- <!-- Determines whether a 'debug' or 'release' build is to be done. Defaults to 'debug' -->
- <property name="build.config" value="debug" />
-
- <!-- Sets build properties consistently accross all assemblies in the project. -->
- <property name="build.version.major" value="0"/>
- <property name="build.version.minor" value="10"/>
- <property name="build.version.build" value="0"/>
- <property name="build.version.revision" value="0"/>
- <property name="build.company" value="Apache Software Foundation"/>
- <property name="build.copyright" value="Apache Software Foundation"/>
- <property name="build.description" value="Built from svn revision number: "/>
-
- <!-- Fileset with build files for each 'core' assembly. -->
- <fileset id="src.builds">
- <include name="client/default.build" />
- <include name="demo/default.build" />
- </fileset>
-
- <!-- Fileset with build files for each 'core' assembly. -->
- <fileset id="examples.builds">
- <include name="examples/request-response/example-request-response-Client/default.build" />
- <include name="examples/request-response/example-request-response-Server/default.build" />
- <include name="examples/direct/example-direct-Listener/default.build" />
- <include name="examples/direct/example-direct-producer/default.build" />
- <include name="examples/fanout/example-fanout-Listener/default.build" />
- <include name="examples/fanout/example-fanout-Producer/default.build" />
- <include name="examples/pub-sub/example-pub-sub-Listener/default.build" />
- <include name="examples/pub-sub/example-pub-sub-Publisher/default.build" />
- </fileset>
-
- <!-- Fileset with build files for 'integration' test assemblies. -->
- <fileset id="tests.builds">
- <include name="test/default.build" />
- </fileset>
-
- <!-- Fileset with build files for 'performence' test assemblies. -->
- <fileset id="perftest.builds">
- <include name="perftest/default.build" />
- </fileset>
-
- <!-- Prepare environment for a debug build. -->
- <target name="debug">
- <property name="build.debug" value="true" />
- <property name="build.defines" value="DEBUG;TRACE"/>
- </target>
-
- <!-- Prepare environment for a release build. -->
- <target name="release">
- <property name="build.debug" value="false" />
- <property name="build.defines" value=""/>
- </target>
-
- <!-- Prepare environment for build. -->
- <target name="init">
- <property name="base.dir" value="${project::get-base-directory()}" />
- <property name="build.dir" value="${base.dir}/bin/${framework::get-target-framework()}/${build.config}" />
- <call target="${build.config}" />
- </target>
-
- <!-- Cleans up the build output directory. -->
- <target name="clean" depends="init">
- <delete dir="${build.dir}" failonerror="false" />
- </target>
-
- <!-- Runs 'svnversion' to get the repository revision into the build property 'build.svnversion'. -->
- <target name="svnversion" description="Runs svnversion to get the current repository version into a build script property.">
- <exec program="svnversion" output="svnversion_tmp.txt">
- <arg value="-n"/>
- </exec>
-
- <loadfile file="svnversion_tmp.txt" property="build.svnversion"/>
- <delete file="svnversion_tmp.txt"/>
-
- <!-- For some competely retarted reason the '-n' parameter to svnversion doesn't really work under windows...
- Here is some code to strip the unwanted newlines. -->
- <script language="C#">
- <code><![CDATA[
- public static void ScriptMain(Project project)
- {
- project.Properties["build.svnversion"] = project.Properties["build.svnversion"].Trim("\n\r".ToCharArray());
- }
- ]]>
- </code>
- </script>
-
- </target>
-
- <!-- Performs a regex find-and-replace on assembly info files, substituting fields defined as build properties. -->
- <target name="setversion" description="Stamp the version info onto assemblyinfo.cs files" depends="svnversion">
-
- <echo>build.svnversion = ${build.svnversion}</echo>
-
- <foreach item="File" property="filename">
- <in>
- <items basedir=".">
- <include name="**\AssemblyInfo.cs"></include>
- </items>
- </in>
- <do>
- <script language="C#">
- <code><![CDATA[
- public static void ScriptMain(Project project)
- {
- // Read in the entire file to perform the substitution in.
- StreamReader reader = new StreamReader(project.Properties["filename"]);
- string contents = reader.ReadToEnd();
- reader.Close();
-
- // Substitute the version numbers.
- string replacement = string.Format("[assembly: AssemblyVersion(\"{0}.{1}.{2}.{3}\")]",
- project.Properties["build.version.major"],
- project.Properties["build.version.minor"],
- project.Properties["build.version.build"],
- project.Properties["build.version.revision"]);
- contents = Regex.Replace(contents, @"\[assembly: AssemblyVersion\("".*""\)\]", replacement);
-
- // Substitute the company name and copyright.
- replacement = string.Format("[assembly: AssemblyCompany(\"{0}\")]",
- project.Properties["build.company"]);
- contents = Regex.Replace(contents, @"\[assembly: AssemblyCompany\("".*""\)\]", replacement);
-
- replacement = string.Format("[assembly: AssemblyCopyright(\"{0}\")]",
- project.Properties["build.copyright"]);
- contents = Regex.Replace(contents, @"\[assembly: AssemblyCopyright\("".*""\)\]", replacement);
-
- // Update the description.
- //replacement = string.Format("[assembly: AssemblyDescription(\"{0} {1}\")]",
- // project.Properties["build.description"],
- // project.Properties["build.svnversion"]);
- replacement = string.Format("[assembly: AssemblyDescription(\"{0}\")]",
- project.Properties["build.description"]);
- contents = Regex.Replace(contents, @"\[assembly: AssemblyDescription\("".*""\)\]", replacement);
-
- // Write out the file with the substituted version.
- StreamWriter writer = new StreamWriter(project.Properties["filename"], false);
- writer.Write(contents);
- writer.Close();
- }
- ]]>
- </code>
- </script>
- </do>
- </foreach>
- </target>
-
- <!-- Do the build. -->
- <target name="build" depends="init, setversion">
- <echo message="Building all modules including tests."/>
-
- <!-- Make sure output folder exists. -->
- <mkdir dir="${build.dir}" />
-
- <echo message="Output folder: ${build.dir}"/>
-
- <!-- copy reference assemblies over to the output dir -->
- <copy todir="${build.dir}" file="lib/log4net/log4net.dll"/>
- <copy todir="${build.dir}" file="lib/nunit/nunit.framework.dll"/>
- <copy todir="${build.dir}" file="lib/plossum/C5.dll"/>
- <copy todir="${build.dir}" file="lib/plossum/Plossum CommandLine.dll"/>
-
- <!-- Compile assemblies. -->
- <nant target="build">
- <buildfiles refid="src.builds" />
- </nant>
-
- <!-- Compile test assemblies. -->
- <nant target="build">
- <buildfiles refid="examples.builds" />
- </nant>
-
- <!-- Compile test assemblies. -->
- <nant target="build">
- <buildfiles refid="tests.builds" />
- </nant>
-
- <!-- Compile test assemblies. -->
- <nant target="build">
- <buildfiles refid="perftest.builds" />
- </nant>
-
- <!-- copy config files over to the output dir -->
- <copy todir="${build.dir}" file="test/test.config"/>
- <copy todir="${build.dir}" file="log.xml"/>
-
-
- </target>
-
- <!-- Runs all 'pure unit' tests. -->
- <target name="test" depends="build">
- <echo message="Running all pure unit tests."/>
- <nant target="test">
- <buildfiles refid="tests.builds" />
- </nant>
- </target>
-
- <!-- Creates a release package. -->
- <target name="release-pkg">
- <echo message="Building and packaging a release."/>
-
- <call target="clean"/>
- <call target="build"/>
-
- <property name="build.date" value="${datetime::now()}"/>
-
- <zip zipfile="${build.dir}/Qpid.NET-${framework::get-target-framework()}-${datetime::get-year(build.date)}${datetime::get-month(build.date)}${datetime::get-day(build.date)}.zip">
- <fileset basedir="${build.dir}" prefix="qpid/lib">
- <include name="**/*.*"/>
- <exclude name="**/*.tests.*"/>
- <exclude name="**/example*.*"/>
- <exclude name="**/nunit.framework.dll"/>
- <exclude name="**/*.exe"/>
- <exclude name="**/*.pdb"/>
- </fileset>
-
- <fileset basedir="${build.dir}" prefix="qpid/examples/direct">
- <include name="**/example*direct*.exe"/>
- </fileset>
-
- <fileset basedir="${build.dir}" prefix="qpid/examples/fanout">
- <include name="**/example*fanout*.exe"/>
- </fileset>
-
- <fileset basedir="${build.dir}" prefix="qpid/examples/pub-sub">
- <include name="**/example*pub-sub*.exe"/>
- </fileset>
-
- <fileset basedir="${build.dir}" prefix="qpid/examples/request-response">
- <include name="**/example*request-response*.exe"/>
- </fileset>
-
- <fileset basedir="${base.dir}/.." prefix="qpid">
- <include name="LICENSE.txt"/>
- <include name="NOTICE.txt"/>
- <include name="RELEASE_NOTES.txt"/>
- <include name="DISCLAIMER"/>
- </fileset>
-
-
- <fileset basedir="${base.dir}" prefix="qpid">
- <include name="README.txt"/>
- </fileset>
- </zip>
- </target>
-
-</project>
-
-
diff --git a/M4-RCs/qpid/dotnet/client-010/demo/Demo.csproj b/M4-RCs/qpid/dotnet/client-010/demo/Demo.csproj
deleted file mode 100644
index ce326f5822..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/demo/Demo.csproj
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{E4C46FBC-7560-406D-BFEF-CA010E584DF4}</ProjectGuid>
- <OutputType>WinExe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>demo</RootNamespace>
- <AssemblyName>Qpid Demo</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\log4net\log4net.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Deployment" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="*.cs" />
- <EmbeddedResource Include="Properties\Resources.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>Resources.Designer.cs</LastGenOutput>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- <Compile Include="Properties\Resources.Designer.cs">
- <AutoGen>True</AutoGen>
- <DependentUpon>Resources.resx</DependentUpon>
- <DesignTime>True</DesignTime>
- </Compile>
- <None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
- <LastGenOutput>Settings.Designer.cs</LastGenOutput>
- </None>
- <Compile Include="Properties\Settings.Designer.cs">
- <AutoGen>True</AutoGen>
- <DependentUpon>Settings.settings</DependentUpon>
- <DesignTimeSharedInput>True</DesignTimeSharedInput>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/demo/Program.cs b/M4-RCs/qpid/dotnet/client-010/demo/Program.cs
deleted file mode 100644
index 6ed0f5c393..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/demo/Program.cs
+++ /dev/null
@@ -1,117 +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;
-using System.IO;
-using System.Text;
-using System.Threading;
-using log4net.Config;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.util;
-
-namespace WindowsClient
-{
- class Program
- {
- static void Main(string[] args)
- {
- XmlConfigurator.Configure(new FileInfo("..\\..\\log.xml"));
- // DOMConfigurator.Configure()
- Client client = new Client();
- Console.WriteLine("Client created");
- client.connect("192.168.1.14", 5673, "test", "guest", "guest");
- Console.WriteLine("Connection established");
-
- ClientSession ssn = client.createSession(50000);
- Console.WriteLine("Session created");
- ssn.queueDeclare("queue1", null, null);
- ssn.exchangeBind("queue1", "amq.direct", "queue1", null);
-
-
- Object wl = new Object();
- ssn.attachMessageListener(new MyListener(ssn, wl), "myDest");
-
- ssn.messageSubscribe("queue1", "myDest", MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED, null,
- 0, null);
- DateTime start = DateTime.Now;
-
- // issue credits
- ssn.messageSetFlowMode("myDest", MessageFlowMode.WINDOW);
- ssn.messageFlow("myDest", MessageCreditUnit.BYTE, ClientSession.MESSAGE_FLOW_MAX_BYTES);
- ssn.messageFlow("myDest", MessageCreditUnit.MESSAGE, 10000);
- ssn.sync();
-
- for (int i = 0; i < 10000; i ++)
- {
- ssn.messageTransfer("amq.direct", MessageAcceptMode.NONE, MessageAcquireMode.PRE_ACQUIRED,
- new Header(new DeliveryProperties().setRoutingKey("queue1"),
- new MessageProperties().setMessageId(UUID.randomUUID())),
- Encoding.UTF8.GetBytes("test: " + i));
- }
-
- lock(wl)
- {
- Monitor.Wait(wl);
- }
- DateTime now = DateTime.Now;
- Console.WriteLine("Start time " + start + " now: " + now);
-
- Console.WriteLine("Done time: " + (now - start));
- lock (wl)
- {
- Monitor.Wait(wl, 30000);
- }
- client.close();
- }
- }
-
- class MyListener : IMessageListener
- {
- private readonly Object _wl;
- private ClientSession _session;
- private int _count;
-
- public MyListener(ClientSession session, object wl)
- {
- _wl = wl;
- _session = session;
- _count = 0;
- }
-
- public void messageTransfer(IMessage m)
- {
- BinaryReader reader = new BinaryReader(m.Body, Encoding.UTF8);
- byte[] body = new byte[m.Body.Length - m.Body.Position];
- reader.Read(body, 0, body.Length);
- ASCIIEncoding enc = new ASCIIEncoding();
- // Console.WriteLine("Got a message: " + enc.GetString(body) + " count = " + _count);
- _count++;
- if (_count == 10000)
- {
- lock (_wl)
- {
- Monitor.PulseAll(_wl);
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/demo/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/demo/Properties/AssemblyInfo.cs
deleted file mode 100644
index 5b993bb917..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/demo/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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("Qpid Demo")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Qpid Demo")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("434bc34e-b59b-4800-87cf-c2d301cb5082")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/demo/Properties/Resources.Designer.cs b/M4-RCs/qpid/dotnet/client-010/demo/Properties/Resources.Designer.cs
deleted file mode 100644
index 6e11238248..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/demo/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.3053
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace demo.Properties {
- using System;
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources() {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
- get {
- if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("demo.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
- get {
- return resourceCulture;
- }
- set {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/demo/Properties/Resources.resx b/M4-RCs/qpid/dotnet/client-010/demo/Properties/Resources.resx
deleted file mode 100644
index ffecec851a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/demo/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
-</root> \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/demo/Properties/Settings.Designer.cs b/M4-RCs/qpid/dotnet/client-010/demo/Properties/Settings.Designer.cs
deleted file mode 100644
index 467ca52f9f..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/demo/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,26 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.3053
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace demo.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/demo/Properties/Settings.settings b/M4-RCs/qpid/dotnet/client-010/demo/Properties/Settings.settings
deleted file mode 100644
index abf36c5d3d..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/demo/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
- <Profiles>
- <Profile Name="(Default)" />
- </Profiles>
- <Settings />
-</SettingsFile>
diff --git a/M4-RCs/qpid/dotnet/client-010/demo/default.build b/M4-RCs/qpid/dotnet/client-010/demo/default.build
deleted file mode 100644
index 8c64f8c045..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/demo/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="qpid.client.demo" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/qpid.client.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/Listener.cs b/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/Listener.cs
deleted file mode 100644
index dd044e8aed..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/Listener.cs
+++ /dev/null
@@ -1,112 +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;
-using System.IO;
-using System.Text;
-using System.Threading;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-
-namespace org.apache.qpid.example.direct
-{
- /// <summary>
- /// This program is one of three programs designed to be used
- /// together. These programs use the "amq.direct" exchange.
- ///
- /// Producer:
- ///
- /// Publishes to a broker, specifying a routing key.
- ///
- /// Listener (this program):
- ///
- /// Reads from a queue on the broker using a message listener.
- ///
- /// </summary>
- public class Listener
- {
- private static void Main(string[] args)
- {
- string host = args.Length > 0 ? args[0] : "localhost";
- int port = args.Length > 1 ? Convert.ToInt32(args[1]) : 5672;
- Client connection = new Client();
- try
- {
- connection.connect(host, port, "test", "guest", "guest");
- ClientSession session = connection.createSession(50000);
-
- //--------- Main body of program --------------------------------------------
- // Create a queue named "message_queue", and route all messages whose
- // routing key is "routing_key" to this newly created queue.
-
- session.queueDeclare("message_queue");
- session.exchangeBind("message_queue", "amq.direct", "routing_key");
-
- lock (session)
- {
- // Create a listener and subscribe it to the queue named "message_queue"
- IMessageListener listener = new MessageListener(session);
- session.attachMessageListener(listener, "message_queue");
- session.messageSubscribe("message_queue");
- // Receive messages until all messages are received
- Monitor.Wait(session);
- }
-
- //---------------------------------------------------------------------------
-
- connection.close();
- }
- catch (Exception e)
- {
- Console.WriteLine("Error: \n" + e.StackTrace);
- }
- }
- }
-
- public class MessageListener : IMessageListener
- {
- private readonly ClientSession _session;
- private readonly RangeSet _range = new RangeSet();
- public MessageListener(ClientSession session)
- {
- _session = session;
- }
-
- public void messageTransfer(IMessage m)
- {
- BinaryReader reader = new BinaryReader(m.Body, Encoding.UTF8);
- byte[] body = new byte[m.Body.Length - m.Body.Position];
- reader.Read(body, 0, body.Length);
- ASCIIEncoding enc = new ASCIIEncoding();
- string message = enc.GetString(body);
- Console.WriteLine("Message: " + message);
- // Add this message to the list of message to be acknowledged
- _range.add(m.Id);
- if( message.Equals("That's all, folks!") )
- {
- // Acknowledge all the received messages
- _session.messageAccept(_range);
- lock(_session)
- {
- Monitor.Pulse(_session);
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/Properties/AssemblyInfo.cs
deleted file mode 100644
index cfcafd19a2..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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("example-direct-Listener")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("example-direct-Listener")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("6a24bfe4-4714-4d2a-acf4-96cf9a678a06")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/default.build b/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/default.build
deleted file mode 100644
index f611fee6f6..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="example-direct-Listener" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/qpid.client.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/example-direct-Listener.csproj b/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/example-direct-Listener.csproj
deleted file mode 100644
index 3c9ae20af8..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-Listener/example-direct-Listener.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{AE65B1B9-8779-4CB1-91AF-E7F6C7A736D7}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>example_direct_Listener</RootNamespace>
- <AssemblyName>example-direct-Listener</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Listener.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/Producer.cs b/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/Producer.cs
deleted file mode 100644
index c9f1a475a4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/Producer.cs
+++ /dev/null
@@ -1,87 +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;
-using System.Text;
-using org.apache.qpid.client;
-
-namespace org.apache.qpid.example.direct
-{
- /// <summary>
- /// This program is one of three programs designed to be used
- /// together. These programs use the "amq.direct" exchange.
- ///
- /// Producer (this program):
- ///
- /// Publishes to a broker, specifying a routing key.
- ///
- /// Listener:
- ///
- /// Reads from a queue on the broker using a message listener.
- ///
- /// </summary>
- class Producer
- {
- static void Main(string[] args)
- {
- string host = args.Length > 0 ? args[0] : "localhost";
- int port = args.Length > 1 ? Convert.ToInt32(args[1]) : 5672;
- Client connection = new Client();
- try
- {
- connection.connect(host, port, "test", "guest", "guest");
- ClientSession session = connection.createSession(50000);
-
- //--------- Main body of program --------------------------------------------
-
- IMessage message = new Message();
-
- // The routing key is a message property. We will use the same
- // routing key for each message, so we'll set this property
- // just once. (In most simple cases, there is no need to set
- // other message properties.)
-
- message.DeliveryProperties.setRoutingKey("routing_key");
-
- // Asynchronous transfer sends messages as quickly as
- // possible without waiting for confirmation.
- for (int i = 0; i < 10; i++)
- {
- message.clearData();
- message.appendData(Encoding.UTF8.GetBytes("Message " + i));
- session.messageTransfer("amq.direct", message);
- }
-
- // And send a syncrhonous final message to indicate termination.
- message.clearData();
- message.appendData(Encoding.UTF8.GetBytes("That's all, folks!"));
- session.messageTransfer("amq.direct", "routing_key", message);
- session.sync();
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- }
- catch (Exception e)
- {
- Console.WriteLine("Error: \n" + e.StackTrace);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/Properties/AssemblyInfo.cs
deleted file mode 100644
index 3ca7a80095..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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("example-direct-producer")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("example-direct-producer")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("006144c2-5e45-4543-8e16-c09cd4309ed7")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/default.build b/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/default.build
deleted file mode 100644
index 3382349ae6..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="example-direct-Producer" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/qpid.client.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/example-direct-producer.csproj b/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/example-direct-producer.csproj
deleted file mode 100644
index 18dcc3a0d6..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/example-direct-producer/example-direct-producer.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{96FCB250-8142-40EE-9BDD-CA839EE21021}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>example_direct_producer</RootNamespace>
- <AssemblyName>example-direct-producer</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Producer.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/examples/direct/verify b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify
deleted file mode 100644
index 7da08480a2..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify
+++ /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.
-##
-##
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/direct
-
-direct_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-direct-Listener.exe localhost 5672
-}
-
-direct_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-direct-Producer.exe localhost 5672
-}
-
-clients $cpp/declare_queues direct_producer_dotnet direct_listener_dotnet
-outputs $cpp/declare_queues.out ./direct_producer_dotnet.out ./direct_listener_dotnet.out
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify.in b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify.in
deleted file mode 100644
index f57d931663..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify.in
+++ /dev/null
@@ -1,14 +0,0 @@
-==== declare_queues.out
-==== direct_producer_dotnet.out
-==== direct_listener_dotnet.out
-Message: Message 0
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: That's all, folks!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_cpp_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_cpp_dotnet
deleted file mode 100644
index 86fb7dddd4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_cpp_dotnet
+++ /dev/null
@@ -1,10 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/direct
-
-direct_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-direct-Listener.exe localhost 5672
-}
-
-clients $cpp/declare_queues $cpp/direct_producer direct_listener_dotnet
-outputs $cpp/declare_queues.out $cpp/direct_producer.out ./direct_listener_dotnet.out \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_cpp_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_cpp_dotnet.in
deleted file mode 100644
index b3543cefe5..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_cpp_dotnet.in
+++ /dev/null
@@ -1,14 +0,0 @@
-==== declare_queues.out
-==== direct_producer.out
-==== direct_listener_dotnet.out
-Message: Message 0
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: That's all, folks!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_cpp b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_cpp
deleted file mode 100644
index fe86159fcc..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/direct
-
-direct_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-direct-Producer.exe localhost 5672
-}
-
-clients $cpp/declare_queues direct_producer_dotnet $cpp/listener
-outputs $cpp/declare_queues.out ./direct_producer_dotnet.out $cpp/listener.out \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_cpp.in b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_cpp.in
deleted file mode 100644
index fcb6cd66de..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_cpp.in
+++ /dev/null
@@ -1,15 +0,0 @@
-==== declare_queues.out
-==== direct_producer_dotnet.out
-==== listener.out
-Message: Message 0
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: That's all, folks!
-Shutting down listener for message_queue
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_java b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_java
deleted file mode 100644
index 528f3eb664..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_java
+++ /dev/null
@@ -1,15 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/direct
-
-direct_consumer_java()
-{
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.direct.Consumer
-}
-
-direct_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-direct-Producer.exe localhost 5672
-}
-
-clients $cpp/declare_queues direct_producer_dotnet direct_consumer_java
-outputs $cpp/declare_queues.out ./direct_producer_dotnet.out ./direct_consumer_java.out
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_java.in b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_java.in
deleted file mode 100644
index cd87551305..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_java.in
+++ /dev/null
@@ -1,20 +0,0 @@
-==== declare_queues.out
-==== direct_producer_dotnet.out
-==== direct_consumer_java.out
-Consumer: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Consumer: Creating a non-transacted, auto-acknowledged session
-Consumer: Creating a MessageConsumer
-Consumer: Starting connection so MessageConsumer can receive messages
-Consumer: Received message: Message 0
-Consumer: Received message: Message 1
-Consumer: Received message: Message 2
-Consumer: Received message: Message 3
-Consumer: Received message: Message 4
-Consumer: Received message: Message 5
-Consumer: Received message: Message 6
-Consumer: Received message: Message 7
-Consumer: Received message: Message 8
-Consumer: Received message: Message 9
-Consumer: Received final message That's all, folks!
-Consumer: Closing connection
-Consumer: Closing JNDI context
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_python b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_python
deleted file mode 100644
index 0c70465bc5..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_python
+++ /dev/null
@@ -1,10 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/direct
-
-direct_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-direct-Producer.exe localhost 5672
-}
-
-clients $py/declare_queues.py direct_producer_dotnet $py/direct_consumer.py
-outputs $py/declare_queues.py.out ./direct_producer_dotnet.out $py/direct_consumer.py.out
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_python.in b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_python.in
deleted file mode 100644
index 7059b3079c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_dotnet_python.in
+++ /dev/null
@@ -1,14 +0,0 @@
-==== declare_queues.py.out
-==== direct_producer_dotnet.out
-==== direct_consumer.py.out
-Message 0
-Message 1
-Message 2
-Message 3
-Message 4
-Message 5
-Message 6
-Message 7
-Message 8
-Message 9
-That's all, folks!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_java_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_java_dotnet
deleted file mode 100644
index 50eb73f9f5..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_java_dotnet
+++ /dev/null
@@ -1,15 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/direct
-
-direct_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-direct-Listener.exe localhost 5672
-}
-
-direct_producer_java()
-{
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.direct.Producer
-}
-
-clients $cpp/declare_queues direct_producer_java direct_listener_dotnet
-outputs $cpp/declare_queues.out ./direct_producer_java.out ./direct_listener_dotnet.out
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_java_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_java_dotnet.in
deleted file mode 100644
index 23628b89de..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_java_dotnet.in
+++ /dev/null
@@ -1,29 +0,0 @@
-==== declare_queues.out
-==== direct_producer_java.out
-Producer: Creating a non-transacted, auto-acknowledged session
-Producer: Creating a Message Producer
-Producer: Creating a TestMessage to send to the destination
-Producer: Sending message: 1
-Producer: Sending message: 2
-Producer: Sending message: 3
-Producer: Sending message: 4
-Producer: Sending message: 5
-Producer: Sending message: 6
-Producer: Sending message: 7
-Producer: Sending message: 8
-Producer: Sending message: 9
-Producer: Sending message: 10
-Producer: Closing connection
-Producer: Closing JNDI context
-==== direct_listener_dotnet.out
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: Message 10
-Message: That's all, folks!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_python_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_python_dotnet
deleted file mode 100644
index 086b31caf4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_python_dotnet
+++ /dev/null
@@ -1,10 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/direct
-
-direct_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-direct-Listener.exe localhost 5672
-}
-
-clients $py/declare_queues.py $py/direct_producer.py direct_listener_dotnet
-outputs $py/declare_queues.py.out $py/direct_producer.py.out ./direct_listener_dotnet.out
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_python_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_python_dotnet.in
deleted file mode 100644
index a556e7ad86..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/direct/verify_python_dotnet.in
+++ /dev/null
@@ -1,14 +0,0 @@
-==== declare_queues.py.out
-==== direct_producer.py.out
-==== direct_listener_dotnet.out
-Message: message 0
-Message: message 1
-Message: message 2
-Message: message 3
-Message: message 4
-Message: message 5
-Message: message 6
-Message: message 7
-Message: message 8
-Message: message 9
-Message: That's all, folks!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/Listener.cs b/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/Listener.cs
deleted file mode 100644
index 4d3da690a9..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/Listener.cs
+++ /dev/null
@@ -1,121 +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;
-using System.IO;
-using System.Text;
-using System.Threading;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-
-namespace org.apache.qpid.example.fanout
-{
- /// <summary>
- /// This program is one of two programs designed to be used
- /// together.
- ///
- /// Producer (this program):
- ///
- /// Publishes to a broker, specifying a routing key.
- ///
- /// Listener:
- ///
- /// Reads from a queue on the broker using a message listener.
- ///
- /// </summary>
- public class Listener
- {
- private static void Main(string[] args)
- {
- string host = args.Length > 0 ? args[0] : "localhost";
- int port = args.Length > 1 ? Convert.ToInt32(args[1]) : 5672;
- Client connection = new Client();
- try
- {
- connection.connect(host, port, "test", "guest", "guest");
- ClientSession session = connection.createSession(50000);
-
- //--------- Main body of program --------------------------------------------
- // Each client creates its own private queue, using the
- // session id to guarantee a unique name. It then routes
- // all messages from the fanout exchange to its own queue
- // by binding to the queue.
- //
- // The binding specifies a binding key, but for a fanout
- // exchange, the binding key is optional and is not used
- // for routing decisions. It can be useful for tracking
- // messages and routing in logs.
-
- string myQueue = session.Name;
- session.queueDeclare(myQueue, Option.EXCLUSIVE, Option.AUTO_DELETE);
- session.exchangeBind(myQueue, "amq.fanout", "my-key");
-
- lock (session)
- {
- Console.WriteLine("Listening");
- // Create a listener and subscribe it to my queue.
- IMessageListener listener = new MessageListener(session);
- session.attachMessageListener(listener, myQueue);
- session.messageSubscribe(myQueue);
- // Receive messages until all messages are received
- Monitor.Wait(session);
- }
-
- //---------------------------------------------------------------------------
-
- connection.close();
- }
- catch (Exception e)
- {
- Console.WriteLine("Error: \n" + e.StackTrace);
- }
- }
- }
-
- public class MessageListener : IMessageListener
- {
- private readonly ClientSession _session;
- private readonly RangeSet _range = new RangeSet();
- public MessageListener(ClientSession session)
- {
- _session = session;
- }
-
- public void messageTransfer(IMessage m)
- {
- BinaryReader reader = new BinaryReader(m.Body, Encoding.UTF8);
- byte[] body = new byte[m.Body.Length - m.Body.Position];
- reader.Read(body, 0, body.Length);
- ASCIIEncoding enc = new ASCIIEncoding();
- string message = enc.GetString(body);
- Console.WriteLine("Message: " + message);
- // Add this message to the list of message to be acknowledged
- _range.add(m.Id);
- if (message.Equals("That's all, folks!"))
- {
- // Acknowledge all the received messages
- _session.messageAccept(_range);
- lock (_session)
- {
- Monitor.Pulse(_session);
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/Properties/AssemblyInfo.cs
deleted file mode 100644
index 6454ae44db..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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("example-fanout-Listener")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("example-fanout-Listener")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("68686ef9-aa0a-4334-9c52-d7e6fc507bec")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/default.build b/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/default.build
deleted file mode 100644
index bdf5cc80c5..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="example-fanout-Listener" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/qpid.client.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/example-fanout-Listener.csproj b/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/example-fanout-Listener.csproj
deleted file mode 100644
index c2c8833e34..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Listener/example-fanout-Listener.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{18A0792B-DC3A-4EC5-93D6-DB8A111D8F15}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>example_fanout_Listener</RootNamespace>
- <AssemblyName>example-fanout-Listener</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Listener.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/Producer.cs b/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/Producer.cs
deleted file mode 100644
index f2818a4099..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/Producer.cs
+++ /dev/null
@@ -1,84 +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;
-using System.Text;
-using org.apache.qpid.client;
-
-namespace org.apache.qpid.example.fanout
-{
- /// <summary>
- /// This program is one of two programs designed to be used
- /// together. These programs do not specify the exchange type - the
- /// default exchange type is the direct exchange.
- ///
- ///
- /// Producer (this program):
- ///
- /// Publishes to a broker, specifying a routing key.
- ///
- /// Listener:
- ///
- /// Reads from a queue on the broker using a message listener.
- ///
- /// </summary>
- class Producer
- {
- static void Main(string[] args)
- {
- string host = args.Length > 0 ? args[0] : "localhost";
- int port = args.Length > 1 ? Convert.ToInt32(args[1]) : 5672;
- Client connection = new Client();
- try
- {
- connection.connect(host, port, "test", "guest", "guest");
- ClientSession session = connection.createSession(50000);
-
- //--------- Main body of program --------------------------------------------
-
- // Unlike topic exchanges and direct exchanges, a fanout
- // exchange need not set a routing key.
- IMessage message = new Message();
-
- // Asynchronous transfer sends messages as quickly as
- // possible without waiting for confirmation.
- for (int i = 0; i < 10; i++)
- {
- message.clearData();
- message.appendData(Encoding.UTF8.GetBytes("Message " + i));
- session.messageTransfer("amq.fanout", message);
- }
-
- // And send a syncrhonous final message to indicate termination.
- message.clearData();
- message.appendData(Encoding.UTF8.GetBytes("That's all, folks!"));
- session.messageTransfer("amq.fanout", message);
- session.sync();
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- }
- catch (Exception e)
- {
- Console.WriteLine("Error: \n" + e.StackTrace);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/Properties/AssemblyInfo.cs
deleted file mode 100644
index 3054ba09db..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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("example-fanout-Producer")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("example-fanout-Producer")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("01c0ba10-2f23-409b-9adc-bc514a13131a")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/default.build b/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/default.build
deleted file mode 100644
index 874854a51b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="example-fanout-Producer" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/qpid.client.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/example-fanout-Producer.csproj b/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/example-fanout-Producer.csproj
deleted file mode 100644
index 83959fe3af..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/example-fanout-Producer/example-fanout-Producer.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{4513BF94-D54A-42FE-8506-FE2CD57B2C51}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>example_fanout_Producer</RootNamespace>
- <AssemblyName>example-fanout-Producer</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Producer.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify
deleted file mode 100644
index 51b7327243..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify
+++ /dev/null
@@ -1,36 +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.
-#
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-
-fanout_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-fanout-Listener.exe localhost 5672
-}
-
-fanout_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-fanout-Producer.exe localhost 5672
-}
-
-background "Listening" fanout_listener_dotnet
-clients fanout_producer_dotnet
-outputs ./fanout_listener_dotnet.out ./fanout_producer_dotnet.out
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify.in b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify.in
deleted file mode 100644
index 37a4a4aaa8..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify.in
+++ /dev/null
@@ -1,14 +0,0 @@
-==== fanout_listener_dotnet.out
-Listening
-Message: Message 0
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: That's all, folks!
-==== fanout_producer_dotnet.out
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_cpp_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_cpp_dotnet
deleted file mode 100644
index b9b0d94857..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_cpp_dotnet
+++ /dev/null
@@ -1,11 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/fanout
-
-fanout_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-fanout-Listener.exe localhost 5672
-}
-
-background "Listening" fanout_listener_dotnet
-clients $cpp/fanout_producer
-outputs $cpp/fanout_producer.out "./fanout_listener_dotnet.out | remove_uuid"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_cpp_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_cpp_dotnet.in
deleted file mode 100644
index 0a72d8fd3c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_cpp_dotnet.in
+++ /dev/null
@@ -1,14 +0,0 @@
-==== fanout_producer.out
-==== fanout_listener_dotnet.out | remove_uuid
-Listening
-Message: Message 0
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: That's all, folks!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_cpp b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_cpp
deleted file mode 100644
index 1b27ea8653..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/fanout
-
-fanout_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-fanout-Producer.exe localhost 5672
-}
-
-
-background "Listening" $cpp/listener
-clients fanout_producer_dotnet
-outputs ./fanout_producer_dotnet.out "$cpp/listener.out | remove_uuid"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_cpp.in b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_cpp.in
deleted file mode 100644
index 588559938f..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_cpp.in
+++ /dev/null
@@ -1,15 +0,0 @@
-==== fanout_producer_dotnet.out
-==== listener.out | remove_uuid
-Listening
-Message: Message 0
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: That's all, folks!
-Shutting down listener for
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_java b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_java
deleted file mode 100644
index 88576814d7..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_java
+++ /dev/null
@@ -1,16 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-
-fanout_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-fanout-Producer.exe localhost 5672
-}
-
-
-fanout_listener_java()
-{
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.fanout.Listener $1
-}
-
-background "can receive messages" fanout_listener_java fanoutQueue1
-clients fanout_producer_dotnet
-outputs ./fanout_producer_dotnet.out "./fanout_listener_java.out | remove_uuid"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_java.in b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_java.in
deleted file mode 100644
index 06d3a6e66b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_java.in
+++ /dev/null
@@ -1,19 +0,0 @@
-==== fanout_producer_dotnet.out
-==== fanout_listener_java.out | remove_uuid
-Listener: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Creating a MessageConsumer
-Listener: Starting connection so MessageConsumer can receive messages
-Listener: Received message: Message 0
-Listener: Received message: Message 1
-Listener: Received message: Message 2
-Listener: Received message: Message 3
-Listener: Received message: Message 4
-Listener: Received message: Message 5
-Listener: Received message: Message 6
-Listener: Received message: Message 7
-Listener: Received message: Message 8
-Listener: Received message: Message 9
-Listener: Received final message That's all, folks!
-Listener: Closing connection
-Listener: Closing JNDI context
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_python b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_python
deleted file mode 100644
index a09b26ca6a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_python
+++ /dev/null
@@ -1,11 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/fanout
-
-fanout_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-fanout-Producer.exe localhost 5672
-}
-
-background "Subscribed" $py/fanout_consumer.py
-clients fanout_producer_dotnet
-outputs ./fanout_producer_dotnet.out "$py/fanout_consumer.py.out | remove_uuid"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_python.in b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_python.in
deleted file mode 100644
index e9959c2e25..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_dotnet_python.in
+++ /dev/null
@@ -1,14 +0,0 @@
-==== fanout_producer_dotnet.out
-==== fanout_consumer.py.out | remove_uuid
-Subscribed to queue
-Message 0
-Message 1
-Message 2
-Message 3
-Message 4
-Message 5
-Message 6
-Message 7
-Message 8
-Message 9
-That's all, folks!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_java_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_java_dotnet
deleted file mode 100644
index d72954de0e..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_java_dotnet
+++ /dev/null
@@ -1,16 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-
-fanout_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-fanout-Listener.exe localhost 5672
-}
-
-
-fanout_producer_java()
-{
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.fanout.Producer
-}
-
-background "Listening" fanout_listener_dotnet
-clients fanout_producer_java
-outputs fanout_producer_java.out "./fanout_listener_dotnet.out | remove_uuid"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_java_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_java_dotnet.in
deleted file mode 100644
index acf1b61221..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_java_dotnet.in
+++ /dev/null
@@ -1,29 +0,0 @@
-==== fanout_producer_java.out
-Producer: Creating a non-transacted, auto-acknowledged session
-Producer: Creating a Message Producer
-Producer: Creating a TestMessage to send to the destination
-Producer: Sending message: 1
-Producer: Sending message: 2
-Producer: Sending message: 3
-Producer: Sending message: 4
-Producer: Sending message: 5
-Producer: Sending message: 6
-Producer: Sending message: 7
-Producer: Sending message: 8
-Producer: Sending message: 9
-Producer: Sending message: 10
-Producer: Closing connection
-Producer: Closing JNDI context
-==== fanout_listener_dotnet.out | remove_uuid
-Listening
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: Message 10
-Message: That's all, folks!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_python_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_python_dotnet
deleted file mode 100644
index ac472c0f72..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_python_dotnet
+++ /dev/null
@@ -1,11 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/fanout
-
-fanout_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-fanout-Listener.exe localhost 5672
-}
-
-background "Listening" fanout_listener_dotnet
-clients $py/fanout_producer.py
-outputs $py/fanout_producer.py.out "./fanout_listener_dotnet.out | remove_uuid"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_python_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_python_dotnet.in
deleted file mode 100644
index b489c63a2c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/fanout/verify_python_dotnet.in
+++ /dev/null
@@ -1,14 +0,0 @@
-==== fanout_producer.py.out
-==== fanout_listener_dotnet.out | remove_uuid
-Listening
-Message: message 0
-Message: message 1
-Message: message 2
-Message: message 3
-Message: message 4
-Message: message 5
-Message: message 6
-Message: message 7
-Message: message 8
-Message: message 9
-Message: That's all, folks!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/Listener.cs b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/Listener.cs
deleted file mode 100644
index 0f09307cd4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/Listener.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.
-*/
-
-using System;
-using System.IO;
-using System.Text;
-using System.Threading;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-
-namespace org.apache.qpid.example.pubsub
-{
- /// <summary>
- /// This program is one of two programs designed to be used
- /// together. These programs use the topic exchange.
- ///
- /// Publisher:
- ///
- /// Publishes to a broker, specifying a routing key.
- ///
- /// Listener (this program):
- ///
- /// Reads from a queue on the broker using a message listener.
- ///
- /// </summary>
- internal class Listener
- {
- public static int _count = 4;
-
- private static void Main(string[] args)
- {
- string host = args.Length > 0 ? args[0] : "localhost";
- int port = args.Length > 1 ? Convert.ToInt32(args[1]) : 5672;
- Client connection = new Client();
- try
- {
- connection.connect(host, port, "test", "guest", "guest");
- ClientSession session = connection.createSession(50000);
-
- //--------- Main body of program --------------------------------------------
-
- lock (session)
- {
- Console.WriteLine("Listening for messages ...");
- // Create a listener
- prepareQueue("usa", "usa.#", session);
- prepareQueue("europe", "europe.#", session);
- prepareQueue("news", "#.news", session);
- prepareQueue("weather", "#.weather", session);
- while (_count > 0)
- {
- Monitor.Wait(session);
- }
- }
-
- //---------------------------------------------------------------------------
-
- connection.close();
- }
- catch (Exception e)
- {
- Console.WriteLine("Error: \n" + e.StackTrace);
- }
- }
-
- private static void prepareQueue(string queue, string routing_key, ClientSession session)
- {
- // Create a unique queue name for this consumer by concatenating
- // the queue name parameter with the Session ID.
- Console.WriteLine("Declaring queue: " + queue);
- session.queueDeclare(queue, Option.EXCLUSIVE, Option.AUTO_DELETE);
-
- // Route messages to the new queue if they match the routing key.
- // Also route any messages to with the "control" routing key to
- // this queue so we know when it's time to stop. A publisher sends
- // a message with the content "That's all, Folks!", using the
- // "control" routing key, when it is finished.
-
- session.exchangeBind(queue, "amq.topic", routing_key);
- session.exchangeBind(queue, "amq.topic", "control");
-
- // subscribe the listener to the queue
- IMessageListener listener = new MessageListener(session);
- session.attachMessageListener(listener, queue);
- session.messageSubscribe(queue);
- }
- }
-
- public class MessageListener : IMessageListener
- {
- private readonly ClientSession _session;
- private readonly RangeSet _range = new RangeSet();
-
- public MessageListener(ClientSession session)
- {
- _session = session;
- }
-
- public void messageTransfer(IMessage m)
- {
- BinaryReader reader = new BinaryReader(m.Body, Encoding.UTF8);
- byte[] body = new byte[m.Body.Length - m.Body.Position];
- reader.Read(body, 0, body.Length);
- ASCIIEncoding enc = new ASCIIEncoding();
- string message = enc.GetString(body);
- Console.WriteLine("Message: " + message + " from " + m.Destination);
- // Add this message to the list of message to be acknowledged
- _range.add(m.Id);
- if (message.Equals("That's all, folks!"))
- {
- Console.WriteLine("Shutting down listener for " + m.DeliveryProperties.getRoutingKey());
- Listener._count--;
- // Acknowledge all the received messages
- _session.messageAccept(_range);
- lock (_session)
- {
- Monitor.Pulse(_session);
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/Properties/AssemblyInfo.cs
deleted file mode 100644
index 6a1f505206..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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("example-pub-sub-Listener")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("example-pub-sub-Listener")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("74ab02ae-95d1-4bad-a7cf-9964005b9b05")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/default.build b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/default.build
deleted file mode 100644
index ddd3168d08..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="example-pub-sub-Listener" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/qpid.client.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/example-pub-sub-Listener.csproj b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/example-pub-sub-Listener.csproj
deleted file mode 100644
index 0b9d259373..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Listener/example-pub-sub-Listener.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{2BCDC2CC-5BDA-4CC7-944D-2899AD8A53C7}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>example_pub_sub_Listener</RootNamespace>
- <AssemblyName>example-pub-sub-Listener</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Listener.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/Properties/AssemblyInfo.cs
deleted file mode 100644
index fbbe6f04fc..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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("example-pub-sub-Publisher")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("example-pub-sub-Publisher")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("f6d282a0-9dc5-46cf-a4cd-44ae402d667f")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/Publisher.cs b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/Publisher.cs
deleted file mode 100644
index 6c78eb5193..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/Publisher.cs
+++ /dev/null
@@ -1,93 +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;
-using System.Text;
-using org.apache.qpid.client;
-
-namespace org.apache.qpid.example.pubsub
-{
- /// <summary>
- /// This program is one of two programs designed to be used
- /// together. These programs use the topic exchange.
- ///
- /// Publisher (this program):
- ///
- /// Publishes to a broker, specifying a routing key.
- ///
- /// Listener:
- ///
- /// Reads from a queue on the broker using a message listener.
- ///
- /// </summary>
- internal class Publisher
- {
- private static void Main(string[] args)
- {
- string host = args.Length > 0 ? args[0] : "localhost";
- int port = args.Length > 1 ? Convert.ToInt32(args[1]) : 5672;
- Client connection = new Client();
- try
- {
- connection.connect(host, port, "test", "guest", "guest");
- ClientSession session = connection.createSession(50000);
-
- //--------- Main body of program --------------------------------------------
-
- publishMessages(session, "usa.news");
- publishMessages(session, "usa.weather");
- publishMessages(session, "europe.news");
- publishMessages(session, "europe.weather");
-
- noMoreMessages(session);
-
- //-----------------------------------------------------------------------------
-
- connection.close();
- }
- catch (Exception e)
- {
- Console.WriteLine("Error: \n" + e.StackTrace);
- }
- }
-
- private static void publishMessages(ClientSession session, string routing_key)
- {
- IMessage message = new Message();
- // Asynchronous transfer sends messages as quickly as
- // possible without waiting for confirmation.
- for (int i = 0; i < 10; i++)
- {
- message.clearData();
- message.appendData(Encoding.UTF8.GetBytes("Message " + i));
- session.messageTransfer("amq.topic", routing_key, message);
- }
- }
-
- private static void noMoreMessages(ClientSession session)
- {
- IMessage message = new Message();
- // And send a syncrhonous final message to indicate termination.
- message.clearData();
- message.appendData(Encoding.UTF8.GetBytes("That's all, folks!"));
- session.messageTransfer("amq.topic", "control", message);
- session.sync();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/default.build b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/default.build
deleted file mode 100644
index 0a9c574d6e..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="example-pub-sub-Publisher" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/qpid.client.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/example-pub-sub-Publisher.csproj b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/example-pub-sub-Publisher.csproj
deleted file mode 100644
index 7c47550420..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/example-pub-sub-Publisher/example-pub-sub-Publisher.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{F8857634-A134-44E7-A953-F2B22688C599}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>example_pub_sub_Publisher</RootNamespace>
- <AssemblyName>example-pub-sub-Publisher</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Publisher.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify
deleted file mode 100644
index 45d80c4866..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify
+++ /dev/null
@@ -1,36 +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.
-#
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-
-pubsub_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-pub-sub-Listener.exe localhost 5672
-}
-
-pubsub_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-pub-sub-Publisher.exe localhost 5672
-}
-
-background "Listening for messages ..." pubsub_listener_dotnet
-clients pubsub_producer_dotnet
-outputs pubsub_producer_dotnet.out "pubsub_listener_dotnet.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify.in b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify.in
deleted file mode 100644
index 6a5adc4d89..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify.in
+++ /dev/null
@@ -1,95 +0,0 @@
-==== pubsub_producer_dotnet.out
-==== pubsub_listener_dotnet.out | remove_uuid | sort
-Declaring queue: europe
-Declaring queue: news
-Declaring queue: usa
-Declaring queue: weather
-Listening for messages ...
-Message: Message 0 from europe
-Message: Message 0 from europe
-Message: Message 0 from news
-Message: Message 0 from news
-Message: Message 0 from usa
-Message: Message 0 from usa
-Message: Message 0 from weather
-Message: Message 0 from weather
-Message: Message 1 from europe
-Message: Message 1 from europe
-Message: Message 1 from news
-Message: Message 1 from news
-Message: Message 1 from usa
-Message: Message 1 from usa
-Message: Message 1 from weather
-Message: Message 1 from weather
-Message: Message 2 from europe
-Message: Message 2 from europe
-Message: Message 2 from news
-Message: Message 2 from news
-Message: Message 2 from usa
-Message: Message 2 from usa
-Message: Message 2 from weather
-Message: Message 2 from weather
-Message: Message 3 from europe
-Message: Message 3 from europe
-Message: Message 3 from news
-Message: Message 3 from news
-Message: Message 3 from usa
-Message: Message 3 from usa
-Message: Message 3 from weather
-Message: Message 3 from weather
-Message: Message 4 from europe
-Message: Message 4 from europe
-Message: Message 4 from news
-Message: Message 4 from news
-Message: Message 4 from usa
-Message: Message 4 from usa
-Message: Message 4 from weather
-Message: Message 4 from weather
-Message: Message 5 from europe
-Message: Message 5 from europe
-Message: Message 5 from news
-Message: Message 5 from news
-Message: Message 5 from usa
-Message: Message 5 from usa
-Message: Message 5 from weather
-Message: Message 5 from weather
-Message: Message 6 from europe
-Message: Message 6 from europe
-Message: Message 6 from news
-Message: Message 6 from news
-Message: Message 6 from usa
-Message: Message 6 from usa
-Message: Message 6 from weather
-Message: Message 6 from weather
-Message: Message 7 from europe
-Message: Message 7 from europe
-Message: Message 7 from news
-Message: Message 7 from news
-Message: Message 7 from usa
-Message: Message 7 from usa
-Message: Message 7 from weather
-Message: Message 7 from weather
-Message: Message 8 from europe
-Message: Message 8 from europe
-Message: Message 8 from news
-Message: Message 8 from news
-Message: Message 8 from usa
-Message: Message 8 from usa
-Message: Message 8 from weather
-Message: Message 8 from weather
-Message: Message 9 from europe
-Message: Message 9 from europe
-Message: Message 9 from news
-Message: Message 9 from news
-Message: Message 9 from usa
-Message: Message 9 from usa
-Message: Message 9 from weather
-Message: Message 9 from weather
-Message: That's all, folks! from europe
-Message: That's all, folks! from news
-Message: That's all, folks! from usa
-Message: That's all, folks! from weather
-Shutting down listener for control
-Shutting down listener for control
-Shutting down listener for control
-Shutting down listener for control
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_cpp_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_cpp_dotnet
deleted file mode 100644
index 86d60578ad..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_cpp_dotnet
+++ /dev/null
@@ -1,12 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/pub-sub
-
-pubsub_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-pub-sub-Listener.exe localhost 5672
-}
-
-
-background "Listening for messages ..." pubsub_listener_dotnet
-clients $cpp/topic_publisher
-outputs $cpp/topic_publisher.out "pubsub_listener_dotnet.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_cpp_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_cpp_dotnet.in
deleted file mode 100644
index 4e058f7645..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_cpp_dotnet.in
+++ /dev/null
@@ -1,55 +0,0 @@
-==== topic_publisher.out
-==== pubsub_listener_dotnet.out | remove_uuid | sort
-Declaring queue: europe
-Declaring queue: news
-Declaring queue: usa
-Declaring queue: weather
-Listening for messages ...
-Message: Message 0 from europe
-Message: Message 0 from europe
-Message: Message 0 from news
-Message: Message 0 from news
-Message: Message 0 from usa
-Message: Message 0 from usa
-Message: Message 0 from weather
-Message: Message 0 from weather
-Message: Message 1 from europe
-Message: Message 1 from europe
-Message: Message 1 from news
-Message: Message 1 from news
-Message: Message 1 from usa
-Message: Message 1 from usa
-Message: Message 1 from weather
-Message: Message 1 from weather
-Message: Message 2 from europe
-Message: Message 2 from europe
-Message: Message 2 from news
-Message: Message 2 from news
-Message: Message 2 from usa
-Message: Message 2 from usa
-Message: Message 2 from weather
-Message: Message 2 from weather
-Message: Message 3 from europe
-Message: Message 3 from europe
-Message: Message 3 from news
-Message: Message 3 from news
-Message: Message 3 from usa
-Message: Message 3 from usa
-Message: Message 3 from weather
-Message: Message 3 from weather
-Message: Message 4 from europe
-Message: Message 4 from europe
-Message: Message 4 from news
-Message: Message 4 from news
-Message: Message 4 from usa
-Message: Message 4 from usa
-Message: Message 4 from weather
-Message: Message 4 from weather
-Message: That's all, folks! from europe
-Message: That's all, folks! from news
-Message: That's all, folks! from usa
-Message: That's all, folks! from weather
-Shutting down listener for control
-Shutting down listener for control
-Shutting down listener for control
-Shutting down listener for control
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_cpp b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_cpp
deleted file mode 100644
index 66d0f5ba52..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/pub-sub
-
-pubsub_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-pub-sub-Publisher.exe localhost 5672
-}
-
-background "Listening" $cpp/topic_listener
-clients pubsub_producer_dotnet
-outputs pubsub_producer_dotnet.out "$cpp/topic_listener.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_cpp.in b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_cpp.in
deleted file mode 100644
index 64ac27846d..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_cpp.in
+++ /dev/null
@@ -1,99 +0,0 @@
-==== pubsub_producer_dotnet.out
-==== topic_listener.out | remove_uuid | sort
-Declaring queue: europe
-Declaring queue: news
-Declaring queue: usa
-Declaring queue: weather
-Listening for messages ...
-Message: Message 0 from europe
-Message: Message 0 from europe
-Message: Message 0 from news
-Message: Message 0 from news
-Message: Message 0 from usa
-Message: Message 0 from usa
-Message: Message 0 from weather
-Message: Message 0 from weather
-Message: Message 1 from europe
-Message: Message 1 from europe
-Message: Message 1 from news
-Message: Message 1 from news
-Message: Message 1 from usa
-Message: Message 1 from usa
-Message: Message 1 from weather
-Message: Message 1 from weather
-Message: Message 2 from europe
-Message: Message 2 from europe
-Message: Message 2 from news
-Message: Message 2 from news
-Message: Message 2 from usa
-Message: Message 2 from usa
-Message: Message 2 from weather
-Message: Message 2 from weather
-Message: Message 3 from europe
-Message: Message 3 from europe
-Message: Message 3 from news
-Message: Message 3 from news
-Message: Message 3 from usa
-Message: Message 3 from usa
-Message: Message 3 from weather
-Message: Message 3 from weather
-Message: Message 4 from europe
-Message: Message 4 from europe
-Message: Message 4 from news
-Message: Message 4 from news
-Message: Message 4 from usa
-Message: Message 4 from usa
-Message: Message 4 from weather
-Message: Message 4 from weather
-Message: Message 5 from europe
-Message: Message 5 from europe
-Message: Message 5 from news
-Message: Message 5 from news
-Message: Message 5 from usa
-Message: Message 5 from usa
-Message: Message 5 from weather
-Message: Message 5 from weather
-Message: Message 6 from europe
-Message: Message 6 from europe
-Message: Message 6 from news
-Message: Message 6 from news
-Message: Message 6 from usa
-Message: Message 6 from usa
-Message: Message 6 from weather
-Message: Message 6 from weather
-Message: Message 7 from europe
-Message: Message 7 from europe
-Message: Message 7 from news
-Message: Message 7 from news
-Message: Message 7 from usa
-Message: Message 7 from usa
-Message: Message 7 from weather
-Message: Message 7 from weather
-Message: Message 8 from europe
-Message: Message 8 from europe
-Message: Message 8 from news
-Message: Message 8 from news
-Message: Message 8 from usa
-Message: Message 8 from usa
-Message: Message 8 from weather
-Message: Message 8 from weather
-Message: Message 9 from europe
-Message: Message 9 from europe
-Message: Message 9 from news
-Message: Message 9 from news
-Message: Message 9 from usa
-Message: Message 9 from usa
-Message: Message 9 from weather
-Message: Message 9 from weather
-Message: That's all, folks! from europe
-Message: That's all, folks! from news
-Message: That's all, folks! from usa
-Message: That's all, folks! from weather
-Shutting down listener for europe
-Shutting down listener for news
-Shutting down listener for usa
-Shutting down listener for weather
-Subscribing to queue europe
-Subscribing to queue news
-Subscribing to queue usa
-Subscribing to queue weather
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_java b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_java
deleted file mode 100644
index 0b90416a7e..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_java
+++ /dev/null
@@ -1,15 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-
-topic_listener_java()
-{
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.pubsub.Listener
-}
-
-pubsub_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-pub-sub-Publisher.exe localhost 5672
-}
-
-background "can receive messages" topic_listener_java
-clients pubsub_producer_dotnet
-outputs pubsub_producer_dotnet.out "topic_listener_java.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_java.in b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_java.in
deleted file mode 100644
index 5db02e64b1..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_java.in
+++ /dev/null
@@ -1,95 +0,0 @@
-==== pubsub_producer_dotnet.out
-==== topic_listener_java.out | remove_uuid | sort
-Listener: Closing connection
-Listener: Closing JNDI context
-Listener: Creating a Message Subscriber for topic europe
-Listener: Creating a Message Subscriber for topic news
-Listener: Creating a Message Subscriber for topic usa
-Listener: Creating a Message Subscriber for topic weather
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Received message for topic: europe: Message 0
-Listener: Received message for topic: europe: Message 0
-Listener: Received message for topic: europe: Message 1
-Listener: Received message for topic: europe: Message 1
-Listener: Received message for topic: europe: Message 2
-Listener: Received message for topic: europe: Message 2
-Listener: Received message for topic: europe: Message 3
-Listener: Received message for topic: europe: Message 3
-Listener: Received message for topic: europe: Message 4
-Listener: Received message for topic: europe: Message 4
-Listener: Received message for topic: europe: Message 5
-Listener: Received message for topic: europe: Message 5
-Listener: Received message for topic: europe: Message 6
-Listener: Received message for topic: europe: Message 6
-Listener: Received message for topic: europe: Message 7
-Listener: Received message for topic: europe: Message 7
-Listener: Received message for topic: europe: Message 8
-Listener: Received message for topic: europe: Message 8
-Listener: Received message for topic: europe: Message 9
-Listener: Received message for topic: europe: Message 9
-Listener: Received message for topic: news: Message 0
-Listener: Received message for topic: news: Message 0
-Listener: Received message for topic: news: Message 1
-Listener: Received message for topic: news: Message 1
-Listener: Received message for topic: news: Message 2
-Listener: Received message for topic: news: Message 2
-Listener: Received message for topic: news: Message 3
-Listener: Received message for topic: news: Message 3
-Listener: Received message for topic: news: Message 4
-Listener: Received message for topic: news: Message 4
-Listener: Received message for topic: news: Message 5
-Listener: Received message for topic: news: Message 5
-Listener: Received message for topic: news: Message 6
-Listener: Received message for topic: news: Message 6
-Listener: Received message for topic: news: Message 7
-Listener: Received message for topic: news: Message 7
-Listener: Received message for topic: news: Message 8
-Listener: Received message for topic: news: Message 8
-Listener: Received message for topic: news: Message 9
-Listener: Received message for topic: news: Message 9
-Listener: Received message for topic: usa: Message 0
-Listener: Received message for topic: usa: Message 0
-Listener: Received message for topic: usa: Message 1
-Listener: Received message for topic: usa: Message 1
-Listener: Received message for topic: usa: Message 2
-Listener: Received message for topic: usa: Message 2
-Listener: Received message for topic: usa: Message 3
-Listener: Received message for topic: usa: Message 3
-Listener: Received message for topic: usa: Message 4
-Listener: Received message for topic: usa: Message 4
-Listener: Received message for topic: usa: Message 5
-Listener: Received message for topic: usa: Message 5
-Listener: Received message for topic: usa: Message 6
-Listener: Received message for topic: usa: Message 6
-Listener: Received message for topic: usa: Message 7
-Listener: Received message for topic: usa: Message 7
-Listener: Received message for topic: usa: Message 8
-Listener: Received message for topic: usa: Message 8
-Listener: Received message for topic: usa: Message 9
-Listener: Received message for topic: usa: Message 9
-Listener: Received message for topic: weather: Message 0
-Listener: Received message for topic: weather: Message 0
-Listener: Received message for topic: weather: Message 1
-Listener: Received message for topic: weather: Message 1
-Listener: Received message for topic: weather: Message 2
-Listener: Received message for topic: weather: Message 2
-Listener: Received message for topic: weather: Message 3
-Listener: Received message for topic: weather: Message 3
-Listener: Received message for topic: weather: Message 4
-Listener: Received message for topic: weather: Message 4
-Listener: Received message for topic: weather: Message 5
-Listener: Received message for topic: weather: Message 5
-Listener: Received message for topic: weather: Message 6
-Listener: Received message for topic: weather: Message 6
-Listener: Received message for topic: weather: Message 7
-Listener: Received message for topic: weather: Message 7
-Listener: Received message for topic: weather: Message 8
-Listener: Received message for topic: weather: Message 8
-Listener: Received message for topic: weather: Message 9
-Listener: Received message for topic: weather: Message 9
-Listener: Setting an ExceptionListener on the connection as sample uses a TopicSubscriber
-Listener: Shutting down listener for europe
-Listener: Shutting down listener for news
-Listener: Shutting down listener for usa
-Listener: Shutting down listener for weather
-Listener: Starting connection so TopicSubscriber can receive messages
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_python b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_python
deleted file mode 100644
index dd62dbcbeb..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_python
+++ /dev/null
@@ -1,11 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/pubsub
-
-pubsub_producer_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-pub-sub-Publisher.exe localhost 5672
-}
-
-background "Queues created" $py/topic_subscriber.py
-clients pubsub_producer_dotnet
-outputs ./pubsub_producer_dotnet.out "$py/topic_subscriber.py.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_python.in b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_python.in
deleted file mode 100644
index 130efa2b0e..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_dotnet_python.in
+++ /dev/null
@@ -1,95 +0,0 @@
-==== pubsub_producer_dotnet.out
-==== topic_subscriber.py.out | remove_uuid | sort
-Message 0
-Message 0
-Message 0
-Message 0
-Message 0
-Message 0
-Message 0
-Message 0
-Message 1
-Message 1
-Message 1
-Message 1
-Message 1
-Message 1
-Message 1
-Message 1
-Message 2
-Message 2
-Message 2
-Message 2
-Message 2
-Message 2
-Message 2
-Message 2
-Message 3
-Message 3
-Message 3
-Message 3
-Message 3
-Message 3
-Message 3
-Message 3
-Message 4
-Message 4
-Message 4
-Message 4
-Message 4
-Message 4
-Message 4
-Message 4
-Message 5
-Message 5
-Message 5
-Message 5
-Message 5
-Message 5
-Message 5
-Message 5
-Message 6
-Message 6
-Message 6
-Message 6
-Message 6
-Message 6
-Message 6
-Message 6
-Message 7
-Message 7
-Message 7
-Message 7
-Message 7
-Message 7
-Message 7
-Message 7
-Message 8
-Message 8
-Message 8
-Message 8
-Message 8
-Message 8
-Message 8
-Message 8
-Message 9
-Message 9
-Message 9
-Message 9
-Message 9
-Message 9
-Message 9
-Message 9
-Messages on 'europe' queue:
-Messages on 'news' queue:
-Messages on 'usa' queue:
-Messages on 'weather' queue:
-Queues created - please start the topic producer
-Subscribing local queue 'local_europe' to europe-'
-Subscribing local queue 'local_news' to news-'
-Subscribing local queue 'local_usa' to usa-'
-Subscribing local queue 'local_weather' to weather-'
-That's all, folks!
-That's all, folks!
-That's all, folks!
-That's all, folks!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_java_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_java_dotnet
deleted file mode 100644
index 52069957c5..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_java_dotnet
+++ /dev/null
@@ -1,15 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-
-pubsub_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-pub-sub-Listener.exe localhost 5672
-}
-
-topic_publisher_java()
-{
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.pubsub.Publisher
-}
-
-background "Listening for messages ..." pubsub_listener_dotnet
-clients topic_publisher_java
-outputs topic_publisher_java.out "pubsub_listener_dotnet.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_java_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_java_dotnet.in
deleted file mode 100644
index 1b37f711c4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_java_dotnet.in
+++ /dev/null
@@ -1,95 +0,0 @@
-==== topic_publisher_java.out
-Publisher: Creating a non-transacted, auto-acknowledged session
-Publisher: Creating a TestMessage to send to the topics
-Publisher: Creating a Message Publisher for topic usa.weather
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic usa.news
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic europe.weather
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic europe.news
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Closing connection
-Publisher: Closing JNDI context
-==== pubsub_listener_dotnet.out | remove_uuid | sort
-Declaring queue: europe
-Declaring queue: news
-Declaring queue: usa
-Declaring queue: weather
-Listening for messages ...
-Message: message 1 from europe
-Message: message 1 from europe
-Message: message 1 from news
-Message: message 1 from news
-Message: message 1 from usa
-Message: message 1 from usa
-Message: message 1 from weather
-Message: message 1 from weather
-Message: message 2 from europe
-Message: message 2 from europe
-Message: message 2 from news
-Message: message 2 from news
-Message: message 2 from usa
-Message: message 2 from usa
-Message: message 2 from weather
-Message: message 2 from weather
-Message: message 3 from europe
-Message: message 3 from europe
-Message: message 3 from news
-Message: message 3 from news
-Message: message 3 from usa
-Message: message 3 from usa
-Message: message 3 from weather
-Message: message 3 from weather
-Message: message 4 from europe
-Message: message 4 from europe
-Message: message 4 from news
-Message: message 4 from news
-Message: message 4 from usa
-Message: message 4 from usa
-Message: message 4 from weather
-Message: message 4 from weather
-Message: message 5 from europe
-Message: message 5 from europe
-Message: message 5 from news
-Message: message 5 from news
-Message: message 5 from usa
-Message: message 5 from usa
-Message: message 5 from weather
-Message: message 5 from weather
-Message: message 6 from europe
-Message: message 6 from europe
-Message: message 6 from news
-Message: message 6 from news
-Message: message 6 from usa
-Message: message 6 from usa
-Message: message 6 from weather
-Message: message 6 from weather
-Message: That's all, folks! from europe
-Message: That's all, folks! from news
-Message: That's all, folks! from usa
-Message: That's all, folks! from weather
-Shutting down listener for control
-Shutting down listener for control
-Shutting down listener for control
-Shutting down listener for control
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_python_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_python_dotnet
deleted file mode 100644
index 0366e3a9ac..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_python_dotnet
+++ /dev/null
@@ -1,11 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/pubsub
-
-pubsub_listener_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-pub-sub-Listener.exe localhost 5672
-}
-
-background "Listening for messages ..." pubsub_listener_dotnet
-clients $py/topic_publisher.py
-outputs $py/topic_publisher.py.out "pubsub_listener_dotnet.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_python_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_python_dotnet.in
deleted file mode 100644
index ac1b681b32..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/pub-sub/verify_python_dotnet.in
+++ /dev/null
@@ -1,55 +0,0 @@
-==== topic_publisher.py.out
-==== pubsub_listener_dotnet.out | remove_uuid | sort
-Declaring queue: europe
-Declaring queue: news
-Declaring queue: usa
-Declaring queue: weather
-Listening for messages ...
-Message: europe.news 0 from europe
-Message: europe.news 0 from news
-Message: europe.news 1 from europe
-Message: europe.news 1 from news
-Message: europe.news 2 from europe
-Message: europe.news 2 from news
-Message: europe.news 3 from europe
-Message: europe.news 3 from news
-Message: europe.news 4 from europe
-Message: europe.news 4 from news
-Message: europe.weather 0 from europe
-Message: europe.weather 0 from weather
-Message: europe.weather 1 from europe
-Message: europe.weather 1 from weather
-Message: europe.weather 2 from europe
-Message: europe.weather 2 from weather
-Message: europe.weather 3 from europe
-Message: europe.weather 3 from weather
-Message: europe.weather 4 from europe
-Message: europe.weather 4 from weather
-Message: That's all, folks! from europe
-Message: That's all, folks! from news
-Message: That's all, folks! from usa
-Message: That's all, folks! from weather
-Message: usa.news 0 from news
-Message: usa.news 0 from usa
-Message: usa.news 1 from news
-Message: usa.news 1 from usa
-Message: usa.news 2 from news
-Message: usa.news 2 from usa
-Message: usa.news 3 from news
-Message: usa.news 3 from usa
-Message: usa.news 4 from news
-Message: usa.news 4 from usa
-Message: usa.weather 0 from usa
-Message: usa.weather 0 from weather
-Message: usa.weather 1 from usa
-Message: usa.weather 1 from weather
-Message: usa.weather 2 from usa
-Message: usa.weather 2 from weather
-Message: usa.weather 3 from usa
-Message: usa.weather 3 from weather
-Message: usa.weather 4 from usa
-Message: usa.weather 4 from weather
-Shutting down listener for control
-Shutting down listener for control
-Shutting down listener for control
-Shutting down listener for control
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/Client.cs b/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/Client.cs
deleted file mode 100644
index 1d361199f1..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/Client.cs
+++ /dev/null
@@ -1,137 +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;
-using System.IO;
-using System.Text;
-using System.Threading;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-
-namespace org.apache.qpid.example.requestresponse
-{
- /// <summary>
- /// This program is one of two programs that illustrate the
- /// request/response pattern.
- ///
- /// Client (this program):
- /// Make requests of a service, print the response.
- ///
- /// Server:
- /// Accept requests, set the letters to uppercase in each message, and
- /// return it as a response.
- ///
- /// </summary>
- internal class Client
- {
- private static void Main(string[] args)
- {
- string host = args.Length > 0 ? args[0] : "localhost";
- int port = args.Length > 1 ? Convert.ToInt32(args[1]) : 5672;
- client.Client connection = new client.Client();
- try
- {
- connection.connect(host, port, "test", "guest", "guest");
- ClientSession session = connection.createSession(50000);
- IMessage request = new Message();
-
- //--------- Main body of program --------------------------------------------
- // Create a response queue so the server can send us responses
- // to our requests. Use the client's session ID as the name
- // of the response queue.
- string response_queue = "client" + session.getName();
- // Use the name of the response queue as the routing key
- session.queueDeclare(response_queue);
- session.exchangeBind(response_queue, "amq.direct", response_queue);
-
- // Each client sends the name of their own response queue so
- // the service knows where to route messages.
- request.DeliveryProperties.setRoutingKey("request");
- request.MessageProperties.setReplyTo(new ReplyTo("amq.direct", response_queue));
-
- lock (session)
- {
- // Create a listener for the response queue and listen for response messages.
- Console.WriteLine("Activating response queue listener for: " + response_queue);
- IMessageListener listener = new ClientMessageListener(session);
- session.attachMessageListener(listener, response_queue);
- session.messageSubscribe(response_queue);
-
- // Now send some requests ...
- string[] strs = {
- "Twas brillig, and the slithy toves",
- "Did gire and gymble in the wabe.",
- "All mimsy were the borogroves,",
- "And the mome raths outgrabe.",
- "That's all, folks!"
- };
- foreach (string s in strs)
- {
- request.clearData();
- request.appendData(Encoding.UTF8.GetBytes(s));
- session.messageTransfer("amq.direct", request);
- }
- Console.WriteLine("Waiting for all responses to arrive ...");
- Monitor.Wait(session);
- }
- //---------------------------------------------------------------------------
-
- connection.close();
- }
- catch (Exception e)
- {
- Console.WriteLine("Error: \n" + e.StackTrace);
- }
- }
- }
-
- public class ClientMessageListener : IMessageListener
- {
- private readonly ClientSession _session;
- private readonly RangeSet _range = new RangeSet();
- private int _counter;
- public ClientMessageListener(ClientSession session)
- {
- _session = session;
- }
-
- public void messageTransfer(IMessage m)
- {
- _counter++;
- BinaryReader reader = new BinaryReader(m.Body, Encoding.UTF8);
- byte[] body = new byte[m.Body.Length - m.Body.Position];
- reader.Read(body, 0, body.Length);
- ASCIIEncoding enc = new ASCIIEncoding();
- string message = enc.GetString(body);
- Console.WriteLine("Response: " + message);
- // Add this message to the list of message to be acknowledged
- _range.add(m.Id);
- if (_counter == 4)
- {
- Console.WriteLine("Shutting down listener for " + m.DeliveryProperties.getRoutingKey());
- // Acknowledge all the received messages
- _session.messageAccept(_range);
- lock (_session)
- {
- Monitor.Pulse(_session);
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/Properties/AssemblyInfo.cs
deleted file mode 100644
index 59c9f10f62..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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("example-request-response-Client")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("example-request-response-Client")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("08bf6aed-bf79-4d16-9a28-6363d5322cdd")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/default.build b/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/default.build
deleted file mode 100644
index 60713af386..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="example-request-response-Client" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/qpid.client.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/example-request-response-Client.csproj b/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/example-request-response-Client.csproj
deleted file mode 100644
index c92a920953..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Client/example-request-response-Client.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{1BC63815-4029-4039-9207-35E7E06ECC99}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>example_request_response_Client</RootNamespace>
- <AssemblyName>example-request-response-Client</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Client.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/Properties/AssemblyInfo.cs
deleted file mode 100644
index 468cdf557a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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("example-request-response-Server")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("example-request-response-Server")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("ef3456e2-7c19-47aa-8dd6-aeaa88c5c4ad")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/Server.cs b/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/Server.cs
deleted file mode 100644
index 2ce493626f..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/Server.cs
+++ /dev/null
@@ -1,136 +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;
-using System.IO;
-using System.Text;
-using System.Threading;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-
-namespace org.apache.qpid.example.requestresponse
-{
- /// <summary>
- /// This program is one of two programs that illustrate the
- /// request/response pattern.
- ///
- /// Client:
- /// Make requests of a service, print the response.
- ///
- /// Server (this program):
- /// Accept requests, set the letters to uppercase in each message, and
- /// return it as a response.
- ///
- /// </summary>
- class Server
- {
- static void Main(string[] args)
- {
- string host = args.Length > 0 ? args[0] : "localhost";
- int port = args.Length > 1 ? Convert.ToInt32(args[1]) : 5672;
- client.Client connection = new client.Client();
- try
- {
- connection.connect(host, port, "test", "guest", "guest");
- ClientSession session = connection.createSession(50000);
-
- //--------- Main body of program --------------------------------------------
- // Create a request queue for clients to use when making
- // requests.
- const string request_queue = "request";
- // Use the name of the request queue as the routing key
- session.queueDeclare(request_queue);
- session.exchangeBind(request_queue, "amq.direct", request_queue);
-
- lock (session)
- {
- // Create a listener and subscribe it to the request_queue
- IMessageListener listener = new MessageListener(session);
- session.attachMessageListener(listener, request_queue);
- session.messageSubscribe(request_queue);
- // Receive messages until all messages are received
- Console.WriteLine("Waiting for requests");
- Monitor.Wait(session);
- }
-
- //---------------------------------------------------------------------------
-
- connection.close();
- }
- catch (Exception e)
- {
- Console.WriteLine("Error: \n" + e.StackTrace);
- }
- }
- }
-
- public class MessageListener : IMessageListener
- {
- private readonly ClientSession _session;
- private readonly RangeSet _range = new RangeSet();
- public MessageListener(ClientSession session)
- {
- _session = session;
- }
-
- public void messageTransfer(IMessage request)
- {
- IMessage response = new Message();
-
- // Get routing key for response from the request's replyTo property
- string routingKey;
- if( request.MessageProperties.hasReplyTo() )
- {
- routingKey = request.MessageProperties.getReplyTo().getRoutingKey();
- }
- else
- {
- Console.WriteLine("Error: \n No routing key for request " + request);
- return;
- }
-
- BinaryReader reader = new BinaryReader(request.Body, Encoding.UTF8);
- byte[] body = new byte[request.Body.Length - request.Body.Position];
- reader.Read(body, 0, body.Length);
- ASCIIEncoding enc = new ASCIIEncoding();
- string message = enc.GetString(body);
- Console.WriteLine("Request: " + message);
-
- // Transform message content to upper case
- string responseBody = message.ToUpper();
-
- // Send it back to the user
- response.clearData();
- response.appendData(Encoding.UTF8.GetBytes(responseBody));
- _session.messageTransfer("amq.direct", routingKey, response);
-
- // Add this message to the list of message to be acknowledged
- _range.add(request.Id);
- if (message.Equals("That's all, folks!"))
- {
- // Acknowledge all the received messages
- _session.messageAccept(_range);
- lock (_session)
- {
- Monitor.Pulse(_session);
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/default.build b/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/default.build
deleted file mode 100644
index 1a1bea225d..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/default.build
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="example-request-response-Server" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/qpid.client.dll" />
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/example-request-response-Server.csproj b/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/example-request-response-Server.csproj
deleted file mode 100644
index be61ddaf01..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/example-request-response-Server/example-request-response-Server.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{922FBA9C-E483-4AEF-ABE8-AC87421E829B}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>example_request_response_Server</RootNamespace>
- <AssemblyName>example-request-response-Server</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Server.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify
deleted file mode 100644
index fa69461f68..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify
+++ /dev/null
@@ -1,36 +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.
-#
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-
-server_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-request-response-Server.exe localhost 5672
-}
-
-client_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-request-response-Client.exe localhost 5672
-}
-
-background "Waiting for requests" server_dotnet
-clients client_dotnet
-outputs ./server_dotnet.out ./client_dotnet.out
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify.in b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify.in
deleted file mode 100644
index 5357591289..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify.in
+++ /dev/null
@@ -1,16 +0,0 @@
-==== server_dotnet.out
-Waiting for requests
-Request: Twas brillig, and the slithy toves
-Request: Did gire and gymble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
-Request: That's all, folks!
-==== client_dotnet.out
-Activating response queue listener for: clientSystem.Byte[]
-Waiting for all responses to arrive ...
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GIRE AND GYMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-Shutting down listener for clientSystem.Byte[]
-Response: THAT'S ALL, FOLKS!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_cpp_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_cpp_dotnet
deleted file mode 100644
index 3cc0370ada..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_cpp_dotnet
+++ /dev/null
@@ -1,12 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/request-response
-
-client_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-request-response-Client.exe localhost 5672
-}
-
-background "Waiting" $cpp/server
-clients client_dotnet
-kill %%
-outputs ./client_dotnet.out "$cpp/server.out | remove_uuid"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_cpp_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_cpp_dotnet.in
deleted file mode 100644
index 0f4b5341b2..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_cpp_dotnet.in
+++ /dev/null
@@ -1,17 +0,0 @@
-==== client_dotnet.out
-Activating response queue listener for: clientSystem.Byte[]
-Waiting for all responses to arrive ...
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GIRE AND GYMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-Shutting down listener for clientSystem.Byte[]
-Response: THAT'S ALL, FOLKS!
-==== server.out | remove_uuid
-Activating request queue listener for: request
-Waiting for requests
-Request: Twas brillig, and the slithy toves (clientSystem.Byte[])
-Request: Did gire and gymble in the wabe. (clientSystem.Byte[])
-Request: All mimsy were the borogroves, (clientSystem.Byte[])
-Request: And the mome raths outgrabe. (clientSystem.Byte[])
-Request: That's all, folks! (clientSystem.Byte[])
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_cpp b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_cpp
deleted file mode 100644
index 81b86a0b41..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/request-response
-
-server_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-request-response-Server.exe localhost 5672
-}
-
-background "Waiting for requests" server_dotnet
-clients $cpp/client
-kill %%
-outputs "$cpp/client.out | remove_uuid" ./server_dotnet.out
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_cpp.in b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_cpp.in
deleted file mode 100644
index 849fad39c6..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_cpp.in
+++ /dev/null
@@ -1,18 +0,0 @@
-==== client.out | remove_uuid
-Activating response queue listener for: client
-Request: Twas brillig, and the slithy toves
-Request: Did gire and gymble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
-Waiting for all responses to arrive ...
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GIRE AND GYMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-Shutting down listener for client
-==== server_dotnet.out
-Waiting for requests
-Request: Twas brillig, and the slithy toves
-Request: Did gire and gymble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_java b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_java
deleted file mode 100644
index 56477c623a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_java
+++ /dev/null
@@ -1,16 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-
-server_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-request-response-Server.exe localhost 5672
-}
-
-client_java()
-{
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.requestResponse.Client
-}
-
-background "Waiting for requests" server_dotnet
-clients client_java
-kill %%
-outputs ./server_dotnet.out "client_java.out | remove_uuid"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_java.in b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_java.in
deleted file mode 100644
index 96e8b8a255..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_java.in
+++ /dev/null
@@ -1,21 +0,0 @@
-==== server_dotnet.out
-Waiting for requests
-Request: Twas brillig, and the slithy toves
-Request: Did gire and gymble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
-==== client_java.out | remove_uuid
-Client: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Client: Creating a non-transacted, auto-acknowledged session
-Client: Creating a QueueRequestor
-Client: Starting connection
-Client: Request Content= Twas brillig, and the slithy toves
-Client: Response Content= TWAS BRILLIG, AND THE SLITHY TOVES
-Client: Request Content= Did gire and gymble in the wabe.
-Client: Response Content= DID GIRE AND GYMBLE IN THE WABE.
-Client: Request Content= All mimsy were the borogroves,
-Client: Response Content= ALL MIMSY WERE THE BOROGROVES,
-Client: Request Content= And the mome raths outgrabe.
-Client: Response Content= AND THE MOME RATHS OUTGRABE.
-Client: Closing connection
-Client: Closing JNDI context
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_python b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_python
deleted file mode 100644
index 8ae2f41361..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_python
+++ /dev/null
@@ -1,12 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/request-response
-
-server_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-request-response-Server.exe localhost 5672
-}
-
-background "Waiting for requests" server_dotnet
-clients $py/client.py
-kill %%
-outputs "$py/client.py.out | remove_uuid" "server_dotnet.out | remove_uuid"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_python.in b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_python.in
deleted file mode 100644
index 4455f4e133..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_dotnet_python.in
+++ /dev/null
@@ -1,17 +0,0 @@
-==== client.py.out | remove_uuid
-Request: Twas brillig, and the slithy toves
-Request: Did gyre and gimble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
-Messages on queue: reply_to:
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GYRE AND GIMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-No more messages!
-==== server_dotnet.out | remove_uuid
-Waiting for requests
-Request: Twas brillig, and the slithy toves
-Request: Did gyre and gimble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_java_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_java_dotnet
deleted file mode 100644
index 6950a6a4ec..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_java_dotnet
+++ /dev/null
@@ -1,15 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-
-server_java()
-{
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.requestResponse.Server
-}
-
-client_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-request-response-Client.exe localhost 5672
-}
-background "can receive messages" server_java
-clients client_dotnet
-kill %%
-outputs "server_java.out | remove_uuid" ./client_dotnet.out
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_java_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_java_dotnet.in
deleted file mode 100644
index 16b1853f37..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_java_dotnet.in
+++ /dev/null
@@ -1,36 +0,0 @@
-==== server_java.out | remove_uuid
-Server: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Server: Creating a non-transacted, auto-acknowledged session
-Server: Creating a MessageConsumer
-Server: Creating a MessageProducer
-Server: Starting connection so MessageConsumer can receive messages
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = TWAS BRILLIG, AND THE SLITHY TOVES
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = DID GIRE AND GYMBLE IN THE WABE.
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = ALL MIMSY WERE THE BOROGROVES,
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = AND THE MOME RATHS OUTGRABE.
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = THAT'S ALL, FOLKS!
-
-Server: Receiving the message
-==== client_dotnet.out
-Activating response queue listener for: clientSystem.Byte[]
-Waiting for all responses to arrive ...
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GIRE AND GYMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-Shutting down listener for clientSystem.Byte[]
-Response: THAT'S ALL, FOLKS!
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_python_dotnet b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_python_dotnet
deleted file mode 100644
index f1b5d662bd..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_python_dotnet
+++ /dev/null
@@ -1,12 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/request-response
-
-client_dotnet()
-{
-mono $DOTNET_EXAMPLES/example-request-response-Client.exe localhost 5672
-}
-
-background "Request server running" $py/server.py
-clients client_dotnet
-kill %%
-outputs "client_dotnet.out | remove_uuid" "$py/server.py.out | remove_uuid"
diff --git a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_python_dotnet.in b/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_python_dotnet.in
deleted file mode 100644
index d982a61a04..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/examples/request-response/verify_python_dotnet.in
+++ /dev/null
@@ -1,12 +0,0 @@
-==== client_dotnet.out | remove_uuid
-Activating response queue listener for: clientSystem.Byte[]
-Waiting for all responses to arrive ...
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GIRE AND GYMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-Shutting down listener for clientSystem.Byte[]
-Response: THAT'S ALL, FOLKS!
-==== server.py.out | remove_uuid
-Request server running - run your client now.
-(Times out after 100 seconds ...)
diff --git a/M4-RCs/qpid/dotnet/client-010/gentool/Composite.tpl b/M4-RCs/qpid/dotnet/client-010/gentool/Composite.tpl
deleted file mode 100644
index 8f16d20189..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/gentool/Composite.tpl
+++ /dev/null
@@ -1,294 +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;
-using org.apache.qpid.transport.codec;
-using System.Collections.Generic;
-using org.apache.qpid.transport.util;
-using org.apache.qpid.transport.network;
-using System.IO;
-
-namespace org.apache.qpid.transport
-{
-
-${
-from genutil import *
-
-cls = klass(type)["@name"]
-
-segments = type["segments"]
-
-if type.name in ("control", "command"):
- override = "override"
- base = "Method"
- size = 0
- pack = 2
- if segments:
- payload = "true"
- else:
- payload = "false"
- if type.name == "control" and cls == "connection":
- track = "Frame.L1"
- elif cls == "session" and type["@name"] in ("attach", "attached", "detach", "detached"):
- track = "Frame.L2"
- elif type.name == "command":
- track = "Frame.L4"
- else:
- track = "Frame.L3"
-else:
- override = ""
- base = "Struct"
- size = type["@size"]
- pack = num(type["@pack"])
- payload = "false"
- track = "4"
-
-PACK_TYPES = {
- 1: "byte",
- 2: "int",
- 4: "int"
-}
-
-typecode = code(type)
-}
-
-public sealed class $name : $base {
-
- public const int TYPE = $typecode;
-
- public override int getStructType() {
- return TYPE;
- }
-
- public override int getSizeWidth() {
- return $size;
- }
-
- public override int getPackWidth() {
- return $pack;
- }
-
- public $override bool hasPayload() {
- return $payload;
- }
-
- public $override byte EncodedTrack
- {
- get{ return $track; }
- set { throw new NotImplementedException(); }
- }
-
-${
-from dotnetgenutil import *
-if pack > 0:
- out(" private $(PACK_TYPES[pack]) packing_flags = 0;\n");
-
-fields = get_fields(type)
-params = get_dotnetparameters(type, fields)
-options = get_options(fields)
-
-for f in fields:
- if not f.empty:
- out(" private $(f.type) _$(f.name);\n")
-
-if segments:
- out(" private Header _header;\n")
- out(" private MemoryStream _body = new MemoryStream();\n")
-}
-
-${
-if fields:
- out(" public $name() {}\n")
-}
-
- public $name($(", ".join(params))) {
-${
-for f in fields:
- if f.option: continue
- out(" $(f.set)($(f.name));\n")
-
-if segments:
- out(" Header = header;\n")
- out(" Body = body;\n")
-
-if options or base == "Method":
- out("""
- for (int i=0; i < _options.Length; i++) {
- switch (_options[i]) {
-""")
-
- for f in options:
- out(" case Option.$(f.option): packing_flags |= $(f.flag_mask(pack)); break;\n")
-
- if base == "Method":
- out(""" case Option.SYNC: Sync = true; break;
- case Option.BATCH: Batch = true; break;
-""")
- out(""" case Option.NONE: break;
- default: throw new Exception("invalid option: " + _options[i]);
- }
- }
-""")
-}
- }
-
- public $override void dispatch<C>(C context, MethodDelegate<C> mdelegate) {
- mdelegate.$(dromedary(name))(context, this);
- }
-
-${
-for f in fields:
- if pack > 0:
- out("""
- public bool $(f.has)() {
- return (packing_flags & $(f.flag_mask(pack))) != 0;
- }
-
- public $name $(f.clear)() {
- packing_flags = (byte) (packing_flags & ~$(f.flag_mask(pack)));
-${
-if (not f.empty and not (f.default == "null")):
- out(" _$(f.name) = $(f.default);")
-}
- Dirty = true;
- return this;
- }
-""")
-
- out("""
- public $(f.type) $(f.get)() {
-${
-if f.empty:
- out(" return $(f.has)();")
-else:
- out(" return _$(f.name);")
-}
- }
-
- public $name $(f.set)($(f.type) value) {
-${
-if not f.empty:
- out(" _$(f.name) = value;")
-}
-${
-if pack > 0:
- out(" packing_flags |= $(f.flag_mask(pack));")
-}
- Dirty = true;
- return this;
- }
-
- public $name $(f.name)($(f.type) value) {
- return $(f.set)(value);
- }
-""")
-}
-
-${
-if segments:
- out(""" public override Header Header {
- get { return _header;}
- set { _header = value;}
- }
-
- public $name header(Header header) {
- Header = header;
- return this;
- }
-
- public override MemoryStream Body
- {
- get{ return _body;}
- set{ _body = value;}
- }
-
- public $name body(MemoryStream body)
- {
- Body = body;
- return this;
- }
-""")
-}
-
- public override void write(Encoder enc)
- {
-${
-if pack > 0:
- out(" enc.writeUint%s(packing_flags);\n" % (pack*8));
-
-for f in fields:
- if f.empty:
- continue
- if pack > 0:
- out(" if ((packing_flags & $(f.flag_mask(pack))) != 0)\n ")
- pre = ""
- post = ""
- if f.type_node.name == "struct":
- pre = "%s.TYPE, " % cname(f.type_node)
- elif f.type_node.name == "domain":
- post = ""
- pre = "(short)"
- out(" enc.write$(f.coder)($(pre)_$(f.name)$(post));\n")
-}
- }
-
- public override void read(Decoder dec)
- {
-${
-if pack > 0:
- out(" packing_flags = ($(PACK_TYPES[pack])) dec.readUint%s();\n" % (pack*8));
-
-for f in fields:
- if f.empty:
- continue
- if pack > 0:
- out(" if ((packing_flags & $(f.flag_mask(pack))) != 0)\n ")
- pre = ""
- post = ""
- arg = ""
- if f.type_node.name == "struct":
- pre = "(%s)" % cname(f.type_node)
- arg = "%s.TYPE" % cname(f.type_node)
- elif f.type_node.name == "domain":
- pre = "%sGetter.get(" % cname(f.type_node)
- post = ")"
- out(" _$(f.name) = $(pre)dec.read$(f.coder)($(arg))$(post);\n")
-}
- }
-
- public override Dictionary<String,Object> Fields
- {
- get{
- Dictionary<String,Object> result = new Dictionary<String,Object>();
-
-${
-for f in fields:
- if pack > 0:
- out(" if ((packing_flags & $(f.flag_mask(pack))) != 0)\n ")
- out(' result.Add("_$(f.name)", $(f.get)());\n')
-}
-
- return result;
- }
- }
-
-}
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/gentool/Constant.tpl b/M4-RCs/qpid/dotnet/client-010/gentool/Constant.tpl
deleted file mode 100644
index 191a1dbd6e..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/gentool/Constant.tpl
+++ /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 org.apache.qpid.transport
-{
-
-${from genutil import *}
-
-public class Constant
-{
-${
-constants = spec.query["amqp/constant"]
-
-for c in constants:
- name = scream(c["@name"])
- value = c["@value"]
- out(" public const int $name = $value;\n")
-}}
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/gentool/Enum.tpl b/M4-RCs/qpid/dotnet/client-010/gentool/Enum.tpl
deleted file mode 100644
index b3b6d93f8a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/gentool/Enum.tpl
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-namespace org.apache.qpid.transport
-{
-${
-from genutil import *
-
-vtype = jtype(resolve_type(type))
-
-out(" public enum $name : $vtype")
-
-choices = [(scream(ch["@name"]), "= %s" % (ch["@value"]))
- for ch in type.query["enum/choice"]]
-}
- {
- $(",\n ".join(["%s%s" % ch for ch in choices]))
- }
-
-${
-
-out(" public struct $name")
-out("Getter")
-}
- {
- public static $name get($vtype value)
- {
- switch (value)
- {
-${
-choices = [(scream(ch["@name"]), "%s" % (ch["@value"]))
- for ch in type.query["enum/choice"]]
-
-for ch, value in choices:
- out(' case $value: return $name.$ch;\n')
-} default: throw new Exception("no such value: " + value);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/gentool/Invoker.tpl b/M4-RCs/qpid/dotnet/client-010/gentool/Invoker.tpl
deleted file mode 100644
index ca9abacc24..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/gentool/Invoker.tpl
+++ /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.
- *
- */
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using common.org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.transport
-{
-
-public abstract class Invoker {
-
- protected abstract void invoke(Method method);
- public abstract Future invoke(Method method, Future resultClass);
-
-${
-from dotnetgenutil import *
-
-for c in composites:
- name = cname(c)
- fields = get_fields(c)
- params = get_dotnetparameters(c, fields)
- args = get_arguments(c, fields)
- result = c["result"]
- if result:
- if not result["@type"]:
- rname = cname(result["struct"])
- else:
- rname = cname(result, "@type")
- jresult = "Future"
- jreturn = "return "
- jclass = ", new ResultFuture()"
- jinvoke = "invoke"
- else:
- jinvoke = "invoke"
- jresult = "void"
- jreturn = ""
- jclass = ""
-
- out("""
- public $jresult $(dromedary(name))($(", ".join(params))) {
- $(jreturn)$jinvoke(new $name($(", ".join(args)))$jclass);
- }
-""")
-}
-
-}
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/gentool/MethodDelegate.tpl b/M4-RCs/qpid/dotnet/client-010/gentool/MethodDelegate.tpl
deleted file mode 100644
index 49891e2b08..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/gentool/MethodDelegate.tpl
+++ /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 org.apache.qpid.transport
-{
-
-public abstract class MethodDelegate<C> {
-
-${
-from genutil import *
-
-for c in composites:
- name = cname(c)
- out(" public virtual void $(dromedary(name))(C context, $name mystruct) {}\n")
-}
-}
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/gentool/Option.tpl b/M4-RCs/qpid/dotnet/client-010/gentool/Option.tpl
deleted file mode 100644
index d6e1a44870..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/gentool/Option.tpl
+++ /dev/null
@@ -1,42 +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 org.apache.qpid.transport
-{
-public enum Option {
-
-${
-from genutil import *
-
-options = {}
-
-for c in composites:
- for f in c.query["field"]:
- t = resolve_type(f)
- if t["@name"] == "bit":
- option = scream(f["@name"])
- if not options.has_key(option):
- options[option] = None
- out(" $option,\n")}
- BATCH,
- NONE
-}
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/gentool/StructFactory.tpl b/M4-RCs/qpid/dotnet/client-010/gentool/StructFactory.tpl
deleted file mode 100644
index 2a11e2530c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/gentool/StructFactory.tpl
+++ /dev/null
@@ -1,64 +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;
-
-namespace org.apache.qpid.transport
-{
-
-class StructFactory {
-
- public static Struct create(int type)
- {
- switch (type)
- {
-${
-from genutil import *
-
-fragment = """ case $name.TYPE:
- return new $name();
-"""
-
-for c in composites:
- name = cname(c)
- if c.name == "struct":
- out(fragment)
-} default:
- throw new Exception("type: " + type);
- }
- }
-
- public static Struct createInstruction(int type)
- {
- switch (type)
- {
-${
-for c in composites:
- name = cname(c)
- if c.name in ("command", "control"):
- out(fragment)
-} default:
- throw new Exception("type: " + type);
- }
- }
-
-}
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/gentool/Type.tpl b/M4-RCs/qpid/dotnet/client-010/gentool/Type.tpl
deleted file mode 100644
index c8ec7ac153..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/gentool/Type.tpl
+++ /dev/null
@@ -1,103 +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;
-
-namespace org.apache.qpid.transport
-{
-
-${from genutil import *}
-
-public struct QpidType
-{
- public Code code;
- public int width;
- public bool isfixed;
-
- public Code Code
- {
- get { return code; }
- set { code = value; }
- }
-
- public int Width
- {
- get { return width; }
- set { width = value; }
- }
-
- public bool Fixed
- {
- get { return isfixed; }
- set { isfixed = value; }
- }
-
- QpidType(Code code, int width, bool isfixed)
- {
- this.code = code;
- this.width = width;
- this.isfixed = isfixed;
- }
-
- public static QpidType get(byte code)
- {
- switch (code)
- {
-${
-types = spec.query["amqp/type"] + spec.query["amqp/class/type"]
-codes = {}
-first = True
-for t in types:
- code = t["@code"]
- fix_width = t["@fixed-width"]
- var_width = t["@variable-width"]
-
- if code is None:
- continue
-
- if fix_width is None:
- width = var_width
- fixed = "false"
- else:
- width = fix_width
- fixed = "true"
-
- name = scream(t["@name"])
- codes[code] = name
-
- out(" case $code : return new QpidType(Code.$name, $width, $fixed);\n")
-}
- default: throw new Exception("unknown code: " + code);
- }
- }
-}
-
-public enum Code : byte
- {
-${
-keys = list(codes.keys())
-keys.sort()
-
-for code in keys:
- out(" $(codes[code]) = $code,\n")
-}
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/gentool/build.xml b/M4-RCs/qpid/dotnet/client-010/gentool/build.xml
deleted file mode 100644
index dc8e51acfb..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/gentool/build.xml
+++ /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.
- -
- -->
-<project name="GenTool" default="build">
-
- <property name="generated.dir" location="../client/" />
- <property name="gentools.timestamp" location="${generated.dir}/gentools.timestamp" />
- <property name="jython.timestamp" location="${generated.dir}/jython.timestamp" />
- <property name="java.basedir" location="../../../java/common" />
- <property name="mllib.dir" location="../../../python" />
- <property name="xml.spec.dir" location="../../../specs" />
-
-
- <target name="check_jython_deps">
- <uptodate property="jython.notRequired" targetfile="${jython.timestamp}">
- <srcfiles dir="${xml.spec.dir}" includes="amqp.0-10-qpid-errata.xml" />
- </uptodate>
- </target>
-
- <target name="build" depends="check_jython_deps" unless="jython.notRequired">
- <java classname="org.python.util.jython" fork="true" failonerror="true">
- <arg value="-Dpython.cachedir.skip=true"/>
- <arg value="-Dpython.path=${java.basedir}/../lib/jython-lib.jar/Lib${path.separator}${mllib.dir}${path.separator}${java.basedir}${path.separator}${basedir}"/>
- <arg value="${basedir}/codegen"/>
- <arg value="${generated.dir}"/>
- <arg value="${xml.spec.dir}/amqp.0-10-qpid-errata.xml"/>
- <arg value="${basedir}"/>
- <classpath>
- <pathelement location="${java.basedir}/../lib/jython-2.2-rc2.jar"/>
- </classpath>
- </java>
- <touch file="${jython.timestamp}" />
- </target>
-
-</project>
diff --git a/M4-RCs/qpid/dotnet/client-010/gentool/codegen b/M4-RCs/qpid/dotnet/client-010/gentool/codegen
deleted file mode 100644
index 8a3a6de7ee..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/gentool/codegen
+++ /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 os, sys, mllib
-from templating import Parser
-from dotnetgenutil import *
-
-out_dir = sys.argv[1]
-spec_file = sys.argv[2]
-tpl_dir = sys.argv[3]
-pkg_dir = os.path.join(out_dir, "generated")
-
-if not os.path.exists(pkg_dir):
- os.makedirs(pkg_dir)
-
-spec = mllib.xml_parse(spec_file)
-
-def excludes(nd):
- if (nd.parent is not None and
- nd.parent.name == "class" and
- nd.parent["@name"] in ("file", "stream")):
- return False
- else:
- return True
-
-def execute(output, template, **kwargs):
- f = open(os.path.join(tpl_dir, template))
- input = f.read()
- f.close()
- p = Parser(**kwargs)
- p.parse(input)
- fname = os.path.join(pkg_dir, output)
- f = open(fname, "w")
- f.write(p.output)
- f.close()
-
-execute("Type.cs", "Type.tpl", spec = spec)
-execute("Constant.cs", "Constant.tpl", spec = spec)
-
-structs = spec.query["amqp/struct"] + \
- spec.query["amqp/class/struct", excludes] + \
- spec.query["amqp/class/command/result/struct", excludes]
-controls = spec.query["amqp/class/control", excludes]
-commands = spec.query["amqp/class/command", excludes]
-
-composites = structs + controls + commands
-
-for c in composites:
- name = cname(c)
- execute("%s.cs" % name, "Composite.tpl", type = c, name = name)
-
-execute("MethodDelegate.cs", "MethodDelegate.tpl", composites = composites)
-execute("Option.cs", "Option.tpl", composites = composites)
-execute("Invoker.cs", "Invoker.tpl", composites = controls + commands)
-execute("StructFactory.cs", "StructFactory.tpl", composites = composites)
-
-def is_enum(nd):
- return nd["enum"] is not None
-
-enums = spec.query["amqp/domain", is_enum] + \
- spec.query["amqp/class/domain", is_enum]
-
-for e in enums:
- name = cname(e)
- execute("%s.cs" % name, "Enum.tpl", name = name, type = e)
diff --git a/M4-RCs/qpid/dotnet/client-010/gentool/dotnetgenutil.py b/M4-RCs/qpid/dotnet/client-010/gentool/dotnetgenutil.py
deleted file mode 100644
index a071ad3bde..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/gentool/dotnetgenutil.py
+++ /dev/null
@@ -1,273 +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.
-#
-#
-
-
-def camel(offset, *args):
- parts = []
- for a in args:
- parts.extend(a.split("-"))
- return "".join(parts[:offset] + [p[0].upper() + p[1:] for p in parts[offset:]])
-
-def dromedary(s):
- return s[0].lower() + s[1:]
-
-def scream(*args):
- return "_".join([a.replace("-", "_").upper() for a in args])
-
-def num(x, default=None):
- if x is not None and x != "":
- return int(x, 0)
- else:
- return default
-
-def klass(nd):
- parent = nd.parent
- while parent is not None:
- if hasattr(parent, "name") and parent.name == "class":
- return parent
- parent = parent.parent
-
-untyped = -1
-
-def code(nd):
- global untyped
- cd = num(nd["@code"])
- if cd is None:
- cd = untyped
- untyped -= 1
- return cd
-
- cls = klass(nd)
- if cls:
- cd |= (num(cls["@code"]) << 8)
- return cd
-
-def root(nd):
- if nd.parent is None:
- return nd
- else:
- return root(nd.parent)
-
-def qname(nd):
- name = nd["@name"]
- cls = klass(nd)
- if cls != None:
- return "%s.%s" % (cls["@name"], name)
- else:
- return name
-
-RESOLVED = {}
-
-def resolve(node, name):
- key = (node, name)
- if RESOLVED.has_key(key):
- return RESOLVED[key]
- else:
- spec = root(node)
- cls = klass(node)
- if cls:
- for nd in cls.query["#tag"]:
- if nd["@name"] == name:
- RESOLVED[key] = nd
- return nd
- for nd in spec.query["amqp/#tag"] + spec.query["amqp/class/#tag"]:
- if name == qname(nd):
- RESOLVED[key] = nd
- return nd
- raise Exception("unresolved name: %s" % name)
-
-def resolve_type(nd):
- if hasattr(nd, "_resolved_type"):
- return nd._resolved_type
- else:
- name = nd["@type"]
- type = resolve(nd, name)
- if type.name == "domain" and not type["enum"]:
- type = resolve_type(type)
- nd._resolved_type = type
- return type
-
-TYPES = {
- "bit": "bool",
- "uint8": "short",
- "uint16": "int",
- "uint32": "long",
- "uint64": "long",
- "datetime": "long",
- "uuid": "UUID",
- "sequence-no": "int",
- "sequence-set": "RangeSet", # XXX
- "byte-ranges": "RangeSet", # XXX
- "str8": "String",
- "str16": "String",
- "vbin8": "byte[]",
- "vbin16": "byte[]",
- "vbin32": "byte[]",
- "struct32": "Struct",
- "map": "Dictionary<String,Object>",
- "array": "List<Object>"
- }
-
-def cname(nd, field="@name"):
- cls = klass(nd)
- if cls:
- if (nd.name in ("struct", "result") and
- cls["@name"] != "session" and
- nd[field] != "header"):
- return camel(0, nd[field])
- else:
- return camel(0, cls["@name"], nd[field])
- else:
- return camel(0, nd[field])
-
-def jtype(nd):
- if nd.name == "struct" or nd["enum"]:
- return cname(nd)
- else:
- return TYPES[nd["@name"]]
-
-REFS = {
- "bool": "Boolean",
- "byte": "Byte",
- "short": "Short",
- "int": "Integer",
- "long": "Long",
- "float": "Float",
- "double": "Double",
- "char": "Character"
-}
-
-def jref(jt):
- return REFS.get(jt, jt)
-
-def jclass(jt):
- idx = jt.find('<')
- if idx > 0:
- return jt[:idx]
- else:
- return jt
-
-DEFAULTS = {
- "long": 0,
- "int": 0,
- "short": 0,
- "byte": 0,
- "char": 0,
- "bool": "false"
- }
-
-class Field:
-
- def __init__(self, index, nd):
- self.index = index
- self.name = camel(1, nd["@name"])
- self.type_node = resolve_type(nd)
- if self.type_node.name == "domain":
- self.prim_type = resolve_type(self.type_node)
- else:
- self.prim_type = self.type_node
- self.variable_width = num(self.prim_type["@variable-width"], 0)
- self.fixed_width = num(self.prim_type["@fixed-width"], 0)
- self.empty = self.variable_width == 0 and self.fixed_width == 0 and self.prim_type.name != "struct"
- tname = cname(self.type_node)
- if self.type_node.name == "struct":
- self.read = "(%s) dec.readStruct(%s.TYPE)" % (tname, tname)
- self.write = "enc.writeStruct(%s.TYPE, check(struct).%s)" % (tname, self.name)
- self.coder = "Struct"
- elif self.type_node.name == "domain":
- self.coder = camel(0, self.prim_type["@name"])
- self.read = "%s.get(dec.read%s())" % (tname, self.coder)
- self.write = "enc.write%s(check(struct).%s.getValue())" % (self.coder, self.name)
- else:
- self.coder = camel(0, self.type_node["@name"])
- self.read = "dec.read%s()" % self.coder
- self.write = "enc.write%s(check(struct).%s)" % (self.coder, self.name)
- self.type = jtype(self.type_node)
- self.default = DEFAULTS.get(self.type, "null")
- self.has = camel(1, "has", self.name)
- self.get = camel(1, "get", self.name)
- self.set = camel(1, "set", self.name)
- self.clear = camel(1, "clear", self.name)
- if self.type == "bool":
- self.option = scream(nd["@name"])
- else:
- self.option = None
-
- def flag_mask(self, pack):
- flag = pack * 8 - 8 - (self.index/8)*8 + (self.index % 8)
- return 1 << flag
-
-
-def get_fields(nd):
- fields = []
- index = 0
- for f in nd.query["field"]:
- fields.append(Field(index, f))
- index += 1
- return fields
-
-def get_parameters(type, fields):
- params = []
- options = False
- for f in fields:
- if f.option:
- options = True
- else:
- params.append("%s %s" % (f.type, f.name))
- if type["segments"]:
- params.append("Header header")
- params.append("MemoryStream body")
- if options or type.name in ("control", "command"):
- params.append("Option ... _options")
- return params
-
-def get_arguments(type, fields):
- args = []
- options = False
- for f in fields:
- if f.option:
- options = True
- else:
- args.append(f.name)
- if type["segments"]:
- args.append("header")
- args.append("body")
- if options or type.name in ("control", "command"):
- args.append("_options")
- return args
-
-def get_options(fields):
- return [f for f in fields if f.option]
-
-def get_dotnetparameters(type, fields):
- params = []
- options = False
- for f in fields:
- if f.option:
- options = True
- else:
- params.append("%s %s" % (f.type, f.name))
- if type["segments"]:
- params.append("Header header")
- params.append("MemoryStream body")
- if options or type.name in ("control", "command"):
- params.append("params Option[] _options")
- return params
diff --git a/M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net-licence.txt b/M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net-licence.txt
deleted file mode 100644
index 29f81d812f..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net-licence.txt
+++ /dev/null
@@ -1,201 +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/M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net.dll b/M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net.dll
deleted file mode 100644
index 995816f27b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net.dll
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net.xml b/M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net.xml
deleted file mode 100644
index 5beb669ab0..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/lib/log4net/log4net.xml
+++ /dev/null
@@ -1,28676 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<doc>
- <assembly>
- <name>log4net</name>
- </assembly>
- <members>
- <member name="T:log4net.Appender.AdoNetAppender">
- <summary>
- Appender that logs to a database.
- </summary>
- <remarks>
- <para>
- <see cref="T:log4net.Appender.AdoNetAppender"/> appends logging events to a table within a
- database. The appender can be configured to specify the connection
- string by setting the <see cref="P:log4net.Appender.AdoNetAppender.ConnectionString"/> property.
- The connection type (provider) can be specified by setting the <see cref="P:log4net.Appender.AdoNetAppender.ConnectionType"/>
- property. For more information on database connection strings for
- your specific database see <a href="http://www.connectionstrings.com/">http://www.connectionstrings.com/</a>.
- </para>
- <para>
- Records are written into the database either using a prepared
- statement or a stored procedure. The <see cref="P:log4net.Appender.AdoNetAppender.CommandType"/> property
- is set to <see cref="F:System.Data.CommandType.Text"/> (<c>System.Data.CommandType.Text</c>) to specify a prepared statement
- or to <see cref="F:System.Data.CommandType.StoredProcedure"/> (<c>System.Data.CommandType.StoredProcedure</c>) to specify a stored
- procedure.
- </para>
- <para>
- The prepared statement text or the name of the stored procedure
- must be set in the <see cref="P:log4net.Appender.AdoNetAppender.CommandText"/> property.
- </para>
- <para>
- The prepared statement or stored procedure can take a number
- of parameters. Parameters are added using the <see cref="M:log4net.Appender.AdoNetAppender.AddParameter(log4net.Appender.AdoNetAppenderParameter)"/>
- method. This adds a single <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> to the
- ordered list of parameters. The <see cref="T:log4net.Appender.AdoNetAppenderParameter"/>
- type may be subclassed if required to provide database specific
- functionality. The <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> specifies
- the parameter name, database type, size, and how the value should
- be generated using a <see cref="T:log4net.Layout.ILayout"/>.
- </para>
- </remarks>
- <example>
- An example of a SQL Server table that could be logged to:
- <code lang="SQL">
- CREATE TABLE [dbo].[Log] (
- [ID] [int] IDENTITY (1, 1) NOT NULL ,
- [Date] [datetime] NOT NULL ,
- [Thread] [varchar] (255) NOT NULL ,
- [Level] [varchar] (20) NOT NULL ,
- [Logger] [varchar] (255) NOT NULL ,
- [Message] [varchar] (4000) NOT NULL
- ) ON [PRIMARY]
- </code>
- </example>
- <example>
- An example configuration to log to the above table:
- <code lang="XML" escaped="true">
- <appender name="AdoNetAppender_SqlServer" type="log4net.Appender.AdoNetAppender">
- <connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
- <connectionString value="data source=SQLSVR;initial catalog=test_log4net;integrated security=false;persist security info=True;User ID=sa;Password=sa"/>
- <commandText value="INSERT INTO Log ([Date],[Thread],[Level],[Logger],[Message]) VALUES (@log_date, @thread, @log_level, @logger, @message)"/>
- <parameter>
- <parameterName value="@log_date"/>
- <dbType value="DateTime"/>
- <layout type="log4net.Layout.PatternLayout" value="%date{yyyy'-'MM'-'dd HH':'mm':'ss'.'fff}"/>
- </parameter>
- <parameter>
- <parameterName value="@thread"/>
- <dbType value="String"/>
- <size value="255"/>
- <layout type="log4net.Layout.PatternLayout" value="%thread"/>
- </parameter>
- <parameter>
- <parameterName value="@log_level"/>
- <dbType value="String"/>
- <size value="50"/>
- <layout type="log4net.Layout.PatternLayout" value="%level"/>
- </parameter>
- <parameter>
- <parameterName value="@logger"/>
- <dbType value="String"/>
- <size value="255"/>
- <layout type="log4net.Layout.PatternLayout" value="%logger"/>
- </parameter>
- <parameter>
- <parameterName value="@message"/>
- <dbType value="String"/>
- <size value="4000"/>
- <layout type="log4net.Layout.PatternLayout" value="%message"/>
- </parameter>
- </appender>
- </code>
- </example>
- <author>Julian Biddle</author>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Lance Nehring</author>
- </member>
- <member name="T:log4net.Appender.BufferingAppenderSkeleton">
- <summary>
- Abstract base class implementation of <see cref="T:log4net.Appender.IAppender"/> that
- buffers events in a fixed size buffer.
- </summary>
- <remarks>
- <para>
- This base class should be used by appenders that need to buffer a
- number of events before logging them. For example the <see cref="T:log4net.Appender.AdoNetAppender"/>
- buffers events and then submits the entire contents of the buffer to
- the underlying database in one go.
- </para>
- <para>
- Subclasses should override the <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>
- method to deliver the buffered events.
- </para>
- <para>The BufferingAppenderSkeleton maintains a fixed size cyclic
- buffer of events. The size of the buffer is set using
- the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> property.
- </para>
- <para>A <see cref="T:log4net.Core.ITriggeringEventEvaluator"/> is used to inspect
- each event as it arrives in the appender. If the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/>
- triggers, then the current buffer is sent immediately
- (see <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>). Otherwise the event
- is stored in the buffer. For example, an evaluator can be used to
- deliver the events immediately when an ERROR event arrives.
- </para>
- <para>
- The buffering appender can be configured in a <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> mode.
- By default the appender is NOT lossy. When the buffer is full all
- the buffered events are sent with <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>.
- If the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> property is set to <c>true</c> then the
- buffer will not be sent when it is full, and new events arriving
- in the appender will overwrite the oldest event in the buffer.
- In lossy mode the buffer will only be sent when the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/>
- triggers. This can be useful behavior when you need to know about
- ERROR events but not about events with a lower level, configure an
- evaluator that will trigger when an ERROR event arrives, the whole
- buffer will be sent which gives a history of events leading up to
- the ERROR event.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Appender.AppenderSkeleton">
- <summary>
- Abstract base class implementation of <see cref="T:log4net.Appender.IAppender"/>.
- </summary>
- <remarks>
- <para>
- This class provides the code for common functionality, such
- as support for threshold filtering and support for general filters.
- </para>
- <para>
- Appenders can also implement the <see cref="T:log4net.Core.IOptionHandler"/> interface. Therefore
- they would require that the <see cref="M:log4net.Core.IOptionHandler.ActivateOptions"/> method
- be called after the appenders properties have been configured.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Appender.IAppender">
- <summary>
- Implement this interface for your own strategies for printing log statements.
- </summary>
- <remarks>
- <para>
- Implementors should consider extending the <see cref="T:log4net.Appender.AppenderSkeleton"/>
- class which provides a default implementation of this interface.
- </para>
- <para>
- Appenders can also implement the <see cref="T:log4net.Core.IOptionHandler"/> interface. Therefore
- they would require that the <see cref="M:log4net.Core.IOptionHandler.ActivateOptions"/> method
- be called after the appenders properties have been configured.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.IAppender.Close">
- <summary>
- Closes the appender and releases resources.
- </summary>
- <remarks>
- <para>
- Releases any resources allocated within the appender such as file handles,
- network connections, etc.
- </para>
- <para>
- It is a programming error to append to a closed appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.IAppender.DoAppend(log4net.Core.LoggingEvent)">
- <summary>
- Log the logging event in Appender specific way.
- </summary>
- <param name="loggingEvent">The event to log</param>
- <remarks>
- <para>
- This method is called to log a message into this appender.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.IAppender.Name">
- <summary>
- Gets or sets the name of this appender.
- </summary>
- <value>The name of the appender.</value>
- <remarks>
- <para>The name uniquely identifies the appender.</para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.IBulkAppender">
- <summary>
- Interface for appenders that support bulk logging.
- </summary>
- <remarks>
- <para>
- This interface extends the <see cref="T:log4net.Appender.IAppender"/> interface to
- support bulk logging of <see cref="T:log4net.Core.LoggingEvent"/> objects. Appenders
- should only implement this interface if they can bulk log efficiently.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.IBulkAppender.DoAppend(log4net.Core.LoggingEvent[])">
- <summary>
- Log the array of logging events in Appender specific way.
- </summary>
- <param name="loggingEvents">The events to log</param>
- <remarks>
- <para>
- This method is called to log an array of events into this appender.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.IOptionHandler">
- <summary>
- Interface used to delay activate a configured object.
- </summary>
- <remarks>
- <para>
- This allows an object to defer activation of its options until all
- options have been set. This is required for components which have
- related options that remain ambiguous until all are set.
- </para>
- <para>
- If a component implements this interface then the <see cref="M:log4net.Core.IOptionHandler.ActivateOptions"/> method
- must be called by the container after its all the configured properties have been set
- and before the component can be used.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Core.IOptionHandler.ActivateOptions">
- <summary>
- Activate the options that were previously set with calls to properties.
- </summary>
- <remarks>
- <para>
- This allows an object to defer activation of its options until all
- options have been set. This is required for components which have
- related options that remain ambiguous until all are set.
- </para>
- <para>
- If a component implements this interface then this method must be called
- after its properties have been set before the component can be used.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.c_renderBufferSize">
- <summary>
- Initial buffer size
- </summary>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.c_renderBufferMaxCapacity">
- <summary>
- Maximum buffer size before it is recycled
- </summary>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>Empty default constructor</para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.Finalize">
- <summary>
- Finalizes this appender by calling the implementation's
- <see cref="M:log4net.Appender.AppenderSkeleton.Close"/> method.
- </summary>
- <remarks>
- <para>
- If this appender has not been closed then the <c>Finalize</c> method
- will call <see cref="M:log4net.Appender.AppenderSkeleton.Close"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.AppenderSkeleton.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.AppenderSkeleton.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.AppenderSkeleton.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.Close">
- <summary>
- Closes the appender and release resources.
- </summary>
- <remarks>
- <para>
- Release any resources allocated within the appender such as file handles,
- network connections, etc.
- </para>
- <para>
- It is a programming error to append to a closed appender.
- </para>
- <para>
- This method cannot be overridden by subclasses. This method
- delegates the closing of the appender to the <see cref="M:log4net.Appender.AppenderSkeleton.OnClose"/>
- method which must be overridden in the subclass.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)">
- <summary>
- Performs threshold checks and invokes filters before
- delegating actual logging to the subclasses specific
- <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- This method cannot be overridden by derived classes. A
- derived class should override the <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> method
- which is called by this method.
- </para>
- <para>
- The implementation of this method is as follows:
- </para>
- <para>
- <list type="bullet">
- <item>
- <description>
- Checks that the severity of the <paramref name="loggingEvent"/>
- is greater than or equal to the <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/> of this
- appender.</description>
- </item>
- <item>
- <description>
- Checks that the <see cref="T:log4net.Filter.IFilter"/> chain accepts the
- <paramref name="loggingEvent"/>.
- </description>
- </item>
- <item>
- <description>
- Calls <see cref="M:log4net.Appender.AppenderSkeleton.PreAppendCheck"/> and checks that
- it returns <c>true</c>.</description>
- </item>
- </list>
- </para>
- <para>
- If all of the above steps succeed then the <paramref name="loggingEvent"/>
- will be passed to the abstract <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent[])">
- <summary>
- Performs threshold checks and invokes filters before
- delegating actual logging to the subclasses specific
- <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent[])"/> method.
- </summary>
- <param name="loggingEvents">The array of events to log.</param>
- <remarks>
- <para>
- This method cannot be overridden by derived classes. A
- derived class should override the <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent[])"/> method
- which is called by this method.
- </para>
- <para>
- The implementation of this method is as follows:
- </para>
- <para>
- <list type="bullet">
- <item>
- <description>
- Checks that the severity of the <paramref name="loggingEvent"/>
- is greater than or equal to the <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/> of this
- appender.</description>
- </item>
- <item>
- <description>
- Checks that the <see cref="T:log4net.Filter.IFilter"/> chain accepts the
- <paramref name="loggingEvent"/>.
- </description>
- </item>
- <item>
- <description>
- Calls <see cref="M:log4net.Appender.AppenderSkeleton.PreAppendCheck"/> and checks that
- it returns <c>true</c>.</description>
- </item>
- </list>
- </para>
- <para>
- If all of the above steps succeed then the <paramref name="loggingEvents"/>
- will be passed to the <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent[])"/> method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.FilterEvent(log4net.Core.LoggingEvent)">
- <summary>
- Test if the logging event should we output by this appender
- </summary>
- <param name="loggingEvent">the event to test</param>
- <returns><c>true</c> if the event should be output, <c>false</c> if the event should be ignored</returns>
- <remarks>
- <para>
- This method checks the logging event against the threshold level set
- on this appender and also against the filters specified on this
- appender.
- </para>
- <para>
- The implementation of this method is as follows:
- </para>
- <para>
- <list type="bullet">
- <item>
- <description>
- Checks that the severity of the <paramref name="loggingEvent"/>
- is greater than or equal to the <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/> of this
- appender.</description>
- </item>
- <item>
- <description>
- Checks that the <see cref="T:log4net.Filter.IFilter"/> chain accepts the
- <paramref name="loggingEvent"/>.
- </description>
- </item>
- </list>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.AddFilter(log4net.Filter.IFilter)">
- <summary>
- Adds a filter to the end of the filter chain.
- </summary>
- <param name="filter">the filter to add to this appender</param>
- <remarks>
- <para>
- The Filters are organized in a linked list.
- </para>
- <para>
- Setting this property causes the new filter to be pushed onto the
- back of the filter chain.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.ClearFilters">
- <summary>
- Clears the filter list for this appender.
- </summary>
- <remarks>
- <para>
- Clears the filter list for this appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.IsAsSevereAsThreshold(log4net.Core.Level)">
- <summary>
- Checks if the message level is below this appender's threshold.
- </summary>
- <param name="level"><see cref="T:log4net.Core.Level"/> to test against.</param>
- <remarks>
- <para>
- If there is no threshold set, then the return value is always <c>true</c>.
- </para>
- </remarks>
- <returns>
- <c>true</c> if the <paramref name="level"/> meets the <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/>
- requirements of this appender.
- </returns>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.OnClose">
- <summary>
- Is called when the appender is closed. Derived classes should override
- this method if resources need to be released.
- </summary>
- <remarks>
- <para>
- Releases any resources allocated within the appender such as file handles,
- network connections, etc.
- </para>
- <para>
- It is a programming error to append to a closed appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)">
- <summary>
- Subclasses of <see cref="T:log4net.Appender.AppenderSkeleton"/> should implement this method
- to perform actual logging.
- </summary>
- <param name="loggingEvent">The event to append.</param>
- <remarks>
- <para>
- A subclass must implement this method to perform
- logging of the <paramref name="loggingEvent"/>.
- </para>
- <para>This method will be called by <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/>
- if all the conditions listed for that method are met.
- </para>
- <para>
- To restrict the logging of events in the appender
- override the <see cref="M:log4net.Appender.AppenderSkeleton.PreAppendCheck"/> method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent[])">
- <summary>
- Append a bulk array of logging events.
- </summary>
- <param name="loggingEvents">the array of logging events</param>
- <remarks>
- <para>
- This base class implementation calls the <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/>
- method for each element in the bulk array.
- </para>
- <para>
- A sub class that can better process a bulk array of events should
- override this method in addition to <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.PreAppendCheck">
- <summary>
- Called before <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> as a precondition.
- </summary>
- <remarks>
- <para>
- This method is called by <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/>
- before the call to the abstract <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> method.
- </para>
- <para>
- This method can be overridden in a subclass to extend the checks
- made before the event is passed to the <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> method.
- </para>
- <para>
- A subclass should ensure that they delegate this call to
- this base class if it is overridden.
- </para>
- </remarks>
- <returns><c>true</c> if the call to <see cref="M:log4net.Appender.AppenderSkeleton.Append(log4net.Core.LoggingEvent)"/> should proceed.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.RenderLoggingEvent(log4net.Core.LoggingEvent)">
- <summary>
- Renders the <see cref="T:log4net.Core.LoggingEvent"/> to a string.
- </summary>
- <param name="loggingEvent">The event to render.</param>
- <returns>The event rendered as a string.</returns>
- <remarks>
- <para>
- Helper method to render a <see cref="T:log4net.Core.LoggingEvent"/> to
- a string. This appender must have a <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/>
- set to render the <paramref name="loggingEvent"/> to
- a string.
- </para>
- <para>If there is exception data in the logging event and
- the layout does not process the exception, this method
- will append the exception text to the rendered string.
- </para>
- <para>
- Where possible use the alternative version of this method
- <see cref="M:log4net.Appender.AppenderSkeleton.RenderLoggingEvent(System.IO.TextWriter,log4net.Core.LoggingEvent)"/>.
- That method streams the rendering onto an existing Writer
- which can give better performance if the caller already has
- a <see cref="T:System.IO.TextWriter"/> open and ready for writing.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AppenderSkeleton.RenderLoggingEvent(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Renders the <see cref="T:log4net.Core.LoggingEvent"/> to a string.
- </summary>
- <param name="loggingEvent">The event to render.</param>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <remarks>
- <para>
- Helper method to render a <see cref="T:log4net.Core.LoggingEvent"/> to
- a string. This appender must have a <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/>
- set to render the <paramref name="loggingEvent"/> to
- a string.
- </para>
- <para>If there is exception data in the logging event and
- the layout does not process the exception, this method
- will append the exception text to the rendered string.
- </para>
- <para>
- Use this method in preference to <see cref="M:log4net.Appender.AppenderSkeleton.RenderLoggingEvent(log4net.Core.LoggingEvent)"/>
- where possible. If, however, the caller needs to render the event
- to a string then <see cref="M:log4net.Appender.AppenderSkeleton.RenderLoggingEvent(log4net.Core.LoggingEvent)"/> does
- provide an efficient mechanism for doing so.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_layout">
- <summary>
- The layout of this appender.
- </summary>
- <remarks>
- See <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/> for more information.
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_name">
- <summary>
- The name of this appender.
- </summary>
- <remarks>
- See <see cref="P:log4net.Appender.AppenderSkeleton.Name"/> for more information.
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_threshold">
- <summary>
- The level threshold of this appender.
- </summary>
- <remarks>
- <para>
- There is no level threshold filtering by default.
- </para>
- <para>
- See <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_errorHandler">
- <summary>
- It is assumed and enforced that errorHandler is never null.
- </summary>
- <remarks>
- <para>
- It is assumed and enforced that errorHandler is never null.
- </para>
- <para>
- See <see cref="P:log4net.Appender.AppenderSkeleton.ErrorHandler"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_headFilter">
- <summary>
- The first filter in the filter chain.
- </summary>
- <remarks>
- <para>
- Set to <c>null</c> initially.
- </para>
- <para>
- See <see cref="T:log4net.Filter.IFilter"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_tailFilter">
- <summary>
- The last filter in the filter chain.
- </summary>
- <remarks>
- See <see cref="T:log4net.Filter.IFilter"/> for more information.
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_closed">
- <summary>
- Flag indicating if this appender is closed.
- </summary>
- <remarks>
- See <see cref="M:log4net.Appender.AppenderSkeleton.Close"/> for more information.
- </remarks>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_recursiveGuard">
- <summary>
- The guard prevents an appender from repeatedly calling its own DoAppend method
- </summary>
- </member>
- <member name="F:log4net.Appender.AppenderSkeleton.m_renderWriter">
- <summary>
- StringWriter used to render events
- </summary>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.Threshold">
- <summary>
- Gets or sets the threshold <see cref="T:log4net.Core.Level"/> of this appender.
- </summary>
- <value>
- The threshold <see cref="T:log4net.Core.Level"/> of the appender.
- </value>
- <remarks>
- <para>
- All log events with lower level than the threshold level are ignored
- by the appender.
- </para>
- <para>
- In configuration files this option is specified by setting the
- value of the <see cref="P:log4net.Appender.AppenderSkeleton.Threshold"/> option to a level
- string, such as "DEBUG", "INFO" and so on.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.ErrorHandler">
- <summary>
- Gets or sets the <see cref="T:log4net.Core.IErrorHandler"/> for this appender.
- </summary>
- <value>The <see cref="T:log4net.Core.IErrorHandler"/> of the appender</value>
- <remarks>
- <para>
- The <see cref="T:log4net.Appender.AppenderSkeleton"/> provides a default
- implementation for the <see cref="P:log4net.Appender.AppenderSkeleton.ErrorHandler"/> property.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.FilterHead">
- <summary>
- The filter chain.
- </summary>
- <value>The head of the filter chain filter chain.</value>
- <remarks>
- <para>
- Returns the head Filter. The Filters are organized in a linked list
- and so all Filters on this Appender are available through the result.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.Layout">
- <summary>
- Gets or sets the <see cref="T:log4net.Layout.ILayout"/> for this appender.
- </summary>
- <value>The layout of the appender.</value>
- <remarks>
- <para>
- See <see cref="P:log4net.Appender.AppenderSkeleton.RequiresLayout"/> for more information.
- </para>
- </remarks>
- <seealso cref="P:log4net.Appender.AppenderSkeleton.RequiresLayout"/>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.Name">
- <summary>
- Gets or sets the name of this appender.
- </summary>
- <value>The name of the appender.</value>
- <remarks>
- <para>
- The name uniquely identifies the appender.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AppenderSkeleton.RequiresLayout">
- <summary>
- Tests if this appender requires a <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/> to be set.
- </summary>
- <remarks>
- <para>
- In the rather exceptional case, where the appender
- implementation admits a layout but can also work without it,
- then the appender should return <c>true</c>.
- </para>
- <para>
- This default implementation always returns <c>true</c>.
- </para>
- </remarks>
- <returns>
- <c>true</c> if the appender requires a layout object, otherwise <c>false</c>.
- </returns>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.DEFAULT_BUFFER_SIZE">
- <summary>
- The default buffer size.
- </summary>
- <remarks>
- The default size of the cyclic buffer used to store events.
- This is set to 512 by default.
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.BufferingAppenderSkeleton"/> class.
- </summary>
- <remarks>
- <para>
- Protected default constructor to allow subclassing.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.#ctor(System.Boolean)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.BufferingAppenderSkeleton"/> class.
- </summary>
- <param name="eventMustBeFixed">the events passed through this appender must be
- fixed by the time that they arrive in the derived class' <c>SendBuffer</c> method.</param>
- <remarks>
- <para>
- Protected constructor to allow subclassing.
- </para>
- <para>
- The <paramref name="eventMustBeFixed"/> should be set if the subclass
- expects the events delivered to be fixed even if the
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> is set to zero, i.e. when no buffering occurs.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.Flush">
- <summary>
- Flush the currently buffered events
- </summary>
- <remarks>
- <para>
- Flushes any events that have been buffered.
- </para>
- <para>
- If the appender is buffering in <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> mode then the contents
- of the buffer will NOT be flushed to the appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.Flush(System.Boolean)">
- <summary>
- Flush the currently buffered events
- </summary>
- <param name="flushLossyBuffer">set to <c>true</c> to flush the buffer of lossy events</param>
- <remarks>
- <para>
- Flushes events that have been buffered. If <paramref name="flushLossyBuffer"/> is
- <c>false</c> then events will only be flushed if this buffer is non-lossy mode.
- </para>
- <para>
- If the appender is buffering in <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> mode then the contents
- of the buffer will only be flushed if <paramref name="flushLossyBuffer"/> is <c>true</c>.
- In this case the contents of the buffer will be tested against the
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.LossyEvaluator"/> and if triggering will be output. All other buffered
- events will be discarded.
- </para>
- <para>
- If <paramref name="flushLossyBuffer"/> is <c>true</c> then the buffer will always
- be emptied by calling this method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.BufferingAppenderSkeleton.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.BufferingAppenderSkeleton.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.BufferingAppenderSkeleton.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.OnClose">
- <summary>
- Close this appender instance.
- </summary>
- <remarks>
- <para>
- Close this appender instance. If this appender is marked
- as not <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> then the remaining events in
- the buffer must be sent when the appender is closed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">the event to log</param>
- <remarks>
- <para>
- Stores the <paramref name="loggingEvent"/> in the cyclic buffer.
- </para>
- <para>
- The buffer will be sent (i.e. passed to the <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>
- method) if one of the following conditions is met:
- </para>
- <list type="bullet">
- <item>
- <description>The cyclic buffer is full and this appender is
- marked as not lossy (see <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/>)</description>
- </item>
- <item>
- <description>An <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> is set and
- it is triggered for the <paramref name="loggingEvent"/>
- specified.</description>
- </item>
- </list>
- <para>
- Before the event is stored in the buffer it is fixed
- (see <see cref="M:log4net.Core.LoggingEvent.FixVolatileData(log4net.Core.FixFlags)"/>) to ensure that
- any data referenced by the event will be valid when the buffer
- is processed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.SendFromBuffer(log4net.Core.LoggingEvent,log4net.Util.CyclicBuffer)">
- <summary>
- Sends the contents of the buffer.
- </summary>
- <param name="firstLoggingEvent">The first logging event.</param>
- <param name="buffer">The buffer containing the events that need to be send.</param>
- <remarks>
- <para>
- The subclass must override <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Sends the events.
- </summary>
- <param name="events">The events that need to be send.</param>
- <remarks>
- <para>
- The subclass must override this method to process the buffered events.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_bufferSize">
- <summary>
- The size of the cyclic buffer used to hold the logging events.
- </summary>
- <remarks>
- Set to <see cref="F:log4net.Appender.BufferingAppenderSkeleton.DEFAULT_BUFFER_SIZE"/> by default.
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_cb">
- <summary>
- The cyclic buffer used to store the logging events.
- </summary>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_evaluator">
- <summary>
- The triggering event evaluator that causes the buffer to be sent immediately.
- </summary>
- <remarks>
- The object that is used to determine if an event causes the entire
- buffer to be sent immediately. This field can be <c>null</c>, which
- indicates that event triggering is not to be done. The evaluator
- can be set using the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> property. If this appender
- has the <see cref="F:log4net.Appender.BufferingAppenderSkeleton.m_lossy"/> (<see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> property) set to
- <c>true</c> then an <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> must be set.
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_lossy">
- <summary>
- Indicates if the appender should overwrite events in the cyclic buffer
- when it becomes full, or if the buffer should be flushed when the
- buffer is full.
- </summary>
- <remarks>
- If this field is set to <c>true</c> then an <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> must
- be set.
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_lossyEvaluator">
- <summary>
- The triggering event evaluator filters discarded events.
- </summary>
- <remarks>
- The object that is used to determine if an event that is discarded should
- really be discarded or if it should be sent to the appenders.
- This field can be <c>null</c>, which indicates that all discarded events will
- be discarded.
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_fixFlags">
- <summary>
- Value indicating which fields in the event should be fixed
- </summary>
- <remarks>
- By default all fields are fixed
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingAppenderSkeleton.m_eventMustBeFixed">
- <summary>
- The events delivered to the subclass must be fixed.
- </summary>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.Lossy">
- <summary>
- Gets or sets a value that indicates whether the appender is lossy.
- </summary>
- <value>
- <c>true</c> if the appender is lossy, otherwise <c>false</c>. The default is <c>false</c>.
- </value>
- <remarks>
- <para>
- This appender uses a buffer to store logging events before
- delivering them. A triggering event causes the whole buffer
- to be send to the remote sink. If the buffer overruns before
- a triggering event then logging events could be lost. Set
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> to <c>false</c> to prevent logging events
- from being lost.
- </para>
- <para>If <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> is set to <c>true</c> then an
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> must be specified.</para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize">
- <summary>
- Gets or sets the size of the cyclic buffer used to hold the
- logging events.
- </summary>
- <value>
- The size of the cyclic buffer used to hold the logging events.
- </value>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> option takes a positive integer
- representing the maximum number of logging events to collect in
- a cyclic buffer. When the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> is reached,
- oldest events are deleted as new events are added to the
- buffer. By default the size of the cyclic buffer is 512 events.
- </para>
- <para>
- If the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> is set to a value less than
- or equal to 1 then no buffering will occur. The logging event
- will be delivered synchronously (depending on the <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/>
- and <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> properties). Otherwise the event will
- be buffered.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator">
- <summary>
- Gets or sets the <see cref="T:log4net.Core.ITriggeringEventEvaluator"/> that causes the
- buffer to be sent immediately.
- </summary>
- <value>
- The <see cref="T:log4net.Core.ITriggeringEventEvaluator"/> that causes the buffer to be
- sent immediately.
- </value>
- <remarks>
- <para>
- The evaluator will be called for each event that is appended to this
- appender. If the evaluator triggers then the current buffer will
- immediately be sent (see <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>).
- </para>
- <para>If <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Lossy"/> is set to <c>true</c> then an
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.Evaluator"/> must be specified.</para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.LossyEvaluator">
- <summary>
- Gets or sets the value of the <see cref="T:log4net.Core.ITriggeringEventEvaluator"/> to use.
- </summary>
- <value>
- The value of the <see cref="T:log4net.Core.ITriggeringEventEvaluator"/> to use.
- </value>
- <remarks>
- <para>
- The evaluator will be called for each event that is discarded from this
- appender. If the evaluator triggers then the current buffer will immediately
- be sent (see <see cref="M:log4net.Appender.BufferingAppenderSkeleton.SendBuffer(log4net.Core.LoggingEvent[])"/>).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.OnlyFixPartialEventData">
- <summary>
- Gets or sets a value indicating if only part of the logging event data
- should be fixed.
- </summary>
- <value>
- <c>true</c> if the appender should only fix part of the logging event
- data, otherwise <c>false</c>. The default is <c>false</c>.
- </value>
- <remarks>
- <para>
- Setting this property to <c>true</c> will cause only part of the
- event data to be fixed and serialized. This will improve performance.
- </para>
- <para>
- See <see cref="M:log4net.Core.LoggingEvent.FixVolatileData(log4net.Core.FixFlags)"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.BufferingAppenderSkeleton.Fix">
- <summary>
- Gets or sets a the fields that will be fixed in the event
- </summary>
- <value>
- The event fields that will be fixed before the event is buffered
- </value>
- <remarks>
- <para>
- The logging event needs to have certain thread specific values
- captured before it can be buffered. See <see cref="P:log4net.Core.LoggingEvent.Fix"/>
- for details.
- </para>
- </remarks>
- <seealso cref="P:log4net.Core.LoggingEvent.Fix"/>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.AdoNetAppender"/> class.
- </summary>
- <remarks>
- Public default constructor to initialize a new instance of this class.
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.AdoNetAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.AdoNetAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.AdoNetAppender.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.OnClose">
- <summary>
- Override the parent method to close the database
- </summary>
- <remarks>
- <para>
- Closes the database command and database connection.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Inserts the events into the database.
- </summary>
- <param name="events">The events to insert into the database.</param>
- <remarks>
- <para>
- Insert all the events specified in the <paramref name="events"/>
- array into the database.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.AddParameter(log4net.Appender.AdoNetAppenderParameter)">
- <summary>
- Adds a parameter to the command.
- </summary>
- <param name="parameter">The parameter to add to the command.</param>
- <remarks>
- <para>
- Adds a parameter to the ordered list of command parameters.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.SendBuffer(System.Data.IDbTransaction,log4net.Core.LoggingEvent[])">
- <summary>
- Writes the events to the database using the transaction specified.
- </summary>
- <param name="dbTran">The transaction that the events will be executed under.</param>
- <param name="events">The array of events to insert into the database.</param>
- <remarks>
- <para>
- The transaction argument can be <c>null</c> if the appender has been
- configured not to use transactions. See <see cref="P:log4net.Appender.AdoNetAppender.UseTransactions"/>
- property for more information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.GetLogStatement(log4net.Core.LoggingEvent)">
- <summary>
- Formats the log message into database statement text.
- </summary>
- <param name="logEvent">The event being logged.</param>
- <remarks>
- This method can be overridden by subclasses to provide
- more control over the format of the database statement.
- </remarks>
- <returns>
- Text that can be passed to a <see cref="T:System.Data.IDbCommand"/>.
- </returns>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.InitializeDatabaseConnection">
- <summary>
- Connects to the database.
- </summary>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.ResolveConnectionType">
- <summary>
- Retrieves the class type of the ADO.NET provider.
- </summary>
- <remarks>
- <para>
- Gets the Type of the ADO.NET provider to use to connect to the
- database. This method resolves the type specified in the
- <see cref="P:log4net.Appender.AdoNetAppender.ConnectionType"/> property.
- </para>
- <para>
- Subclasses can override this method to return a different type
- if necessary.
- </para>
- </remarks>
- <returns>The <see cref="T:System.Type"/> of the ADO.NET provider</returns>
- </member>
- <member name="M:log4net.Appender.AdoNetAppender.InitializeDatabaseCommand">
- <summary>
- Prepares the database command and initialize the parameters.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_usePreparedCommand">
- <summary>
- Flag to indicate if we are using a command object
- </summary>
- <remarks>
- <para>
- Set to <c>true</c> when the appender is to use a prepared
- statement or stored procedure to insert into the database.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_parameters">
- <summary>
- The list of <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> objects.
- </summary>
- <remarks>
- <para>
- The list of <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> objects.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_securityContext">
- <summary>
- The security context to use for privileged calls
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_dbConnection">
- <summary>
- The <see cref="T:System.Data.IDbConnection"/> that will be used
- to insert logging events into a database.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_dbCommand">
- <summary>
- The database command.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_connectionString">
- <summary>
- Database connection string.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_connectionType">
- <summary>
- String type name of the <see cref="T:System.Data.IDbConnection"/> type name.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_commandText">
- <summary>
- The text of the command.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_commandType">
- <summary>
- The command type.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_useTransactions">
- <summary>
- Indicates whether to use transactions when writing to the database.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppender.m_reconnectOnError">
- <summary>
- Indicates whether to use transactions when writing to the database.
- </summary>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.ConnectionString">
- <summary>
- Gets or sets the database connection string that is used to connect to
- the database.
- </summary>
- <value>
- The database connection string used to connect to the database.
- </value>
- <remarks>
- <para>
- The connections string is specific to the connection type.
- See <see cref="P:log4net.Appender.AdoNetAppender.ConnectionType"/> for more information.
- </para>
- </remarks>
- <example>Connection string for MS Access via ODBC:
- <code>"DSN=MS Access Database;UID=admin;PWD=;SystemDB=C:\data\System.mdw;SafeTransactions = 0;FIL=MS Access;DriverID = 25;DBQ=C:\data\train33.mdb"</code>
- </example>
- <example>Another connection string for MS Access via ODBC:
- <code>"Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\Work\cvs_root\log4net-1.2\access.mdb;UID=;PWD=;"</code>
- </example>
- <example>Connection string for MS Access via OLE DB:
- <code>"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Work\cvs_root\log4net-1.2\access.mdb;User Id=;Password=;"</code>
- </example>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.ConnectionType">
- <summary>
- Gets or sets the type name of the <see cref="T:System.Data.IDbConnection"/> connection
- that should be created.
- </summary>
- <value>
- The type name of the <see cref="T:System.Data.IDbConnection"/> connection.
- </value>
- <remarks>
- <para>
- The type name of the ADO.NET provider to use.
- </para>
- <para>
- The default is to use the OLE DB provider.
- </para>
- </remarks>
- <example>Use the OLE DB Provider. This is the default value.
- <code>System.Data.OleDb.OleDbConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</code>
- </example>
- <example>Use the MS SQL Server Provider.
- <code>System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</code>
- </example>
- <example>Use the ODBC Provider.
- <code>Microsoft.Data.Odbc.OdbcConnection,Microsoft.Data.Odbc,version=1.0.3300.0,publicKeyToken=b77a5c561934e089,culture=neutral</code>
- This is an optional package that you can download from
- <a href="http://msdn.microsoft.com/downloads">http://msdn.microsoft.com/downloads</a>
- search for <b>ODBC .NET Data Provider</b>.
- </example>
- <example>Use the Oracle Provider.
- <code>System.Data.OracleClient.OracleConnection, System.Data.OracleClient, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</code>
- This is an optional package that you can download from
- <a href="http://msdn.microsoft.com/downloads">http://msdn.microsoft.com/downloads</a>
- search for <b>.NET Managed Provider for Oracle</b>.
- </example>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.CommandText">
- <summary>
- Gets or sets the command text that is used to insert logging events
- into the database.
- </summary>
- <value>
- The command text used to insert logging events into the database.
- </value>
- <remarks>
- <para>
- Either the text of the prepared statement or the
- name of the stored procedure to execute to write into
- the database.
- </para>
- <para>
- The <see cref="P:log4net.Appender.AdoNetAppender.CommandType"/> property determines if
- this text is a prepared statement or a stored procedure.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.CommandType">
- <summary>
- Gets or sets the command type to execute.
- </summary>
- <value>
- The command type to execute.
- </value>
- <remarks>
- <para>
- This value may be either <see cref="F:System.Data.CommandType.Text"/> (<c>System.Data.CommandType.Text</c>) to specify
- that the <see cref="P:log4net.Appender.AdoNetAppender.CommandText"/> is a prepared statement to execute,
- or <see cref="F:System.Data.CommandType.StoredProcedure"/> (<c>System.Data.CommandType.StoredProcedure</c>) to specify that the
- <see cref="P:log4net.Appender.AdoNetAppender.CommandText"/> property is the name of a stored procedure
- to execute.
- </para>
- <para>
- The default value is <see cref="F:System.Data.CommandType.Text"/> (<c>System.Data.CommandType.Text</c>).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.UseTransactions">
- <summary>
- Should transactions be used to insert logging events in the database.
- </summary>
- <value>
- <c>true</c> if transactions should be used to insert logging events in
- the database, otherwise <c>false</c>. The default value is <c>true</c>.
- </value>
- <remarks>
- <para>
- Gets or sets a value that indicates whether transactions should be used
- to insert logging events in the database.
- </para>
- <para>
- When set a single transaction will be used to insert the buffered events
- into the database. Otherwise each event will be inserted without using
- an explicit transaction.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.SecurityContext">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.AdoNetAppender.SecurityContext"/> used to call the NetSend method.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.AdoNetAppender.SecurityContext"/> used to call the NetSend method.
- </value>
- <remarks>
- <para>
- Unless a <see cref="P:log4net.Appender.AdoNetAppender.SecurityContext"/> specified here for this appender
- the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is queried for the
- security context to use. The default behavior is to use the security context
- of the current thread.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.ReconnectOnError">
- <summary>
- Should this appender try to reconnect to the database on error.
- </summary>
- <value>
- <c>true</c> if the appender should try to reconnect to the database after an
- error has occurred, otherwise <c>false</c>. The default value is <c>false</c>,
- i.e. not to try to reconnect.
- </value>
- <remarks>
- <para>
- The default behaviour is for the appender not to try to reconnect to the
- database if an error occurs. Subsequent logging events are discarded.
- </para>
- <para>
- To force the appender to attempt to reconnect to the database set this
- property to <c>true</c>.
- </para>
- <note>
- When the appender attempts to connect to the database there may be a
- delay of up to the connection timeout specified in the connection string.
- This delay will block the calling application's thread.
- Until the connection can be reestablished this potential delay may occur multiple times.
- </note>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppender.Connection">
- <summary>
- Gets or sets the underlying <see cref="T:System.Data.IDbConnection"/>.
- </summary>
- <value>
- The underlying <see cref="T:System.Data.IDbConnection"/>.
- </value>
- <remarks>
- <see cref="T:log4net.Appender.AdoNetAppender"/> creates a <see cref="T:System.Data.IDbConnection"/> to insert
- logging events into a database. Classes deriving from <see cref="T:log4net.Appender.AdoNetAppender"/>
- can use this property to get or set this <see cref="T:System.Data.IDbConnection"/>. Use the
- underlying <see cref="T:System.Data.IDbConnection"/> returned from <see cref="P:log4net.Appender.AdoNetAppender.Connection"/> if
- you require access beyond that which <see cref="T:log4net.Appender.AdoNetAppender"/> provides.
- </remarks>
- </member>
- <member name="T:log4net.Appender.AdoNetAppenderParameter">
- <summary>
- Parameter type used by the <see cref="T:log4net.Appender.AdoNetAppender"/>.
- </summary>
- <remarks>
- <para>
- This class provides the basic database parameter properties
- as defined by the <see cref="T:System.Data.IDbDataParameter"/> interface.
- </para>
- <para>This type can be subclassed to provide database specific
- functionality. The two methods that are called externally are
- <see cref="M:log4net.Appender.AdoNetAppenderParameter.Prepare(System.Data.IDbCommand)"/> and <see cref="M:log4net.Appender.AdoNetAppenderParameter.FormatValue(System.Data.IDbCommand,log4net.Core.LoggingEvent)"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppenderParameter.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.AdoNetAppenderParameter"/> class.
- </summary>
- <remarks>
- Default constructor for the AdoNetAppenderParameter class.
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppenderParameter.Prepare(System.Data.IDbCommand)">
- <summary>
- Prepare the specified database command object.
- </summary>
- <param name="command">The command to prepare.</param>
- <remarks>
- <para>
- Prepares the database command object by adding
- this parameter to its collection of parameters.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AdoNetAppenderParameter.FormatValue(System.Data.IDbCommand,log4net.Core.LoggingEvent)">
- <summary>
- Renders the logging event and set the parameter value in the command.
- </summary>
- <param name="command">The command containing the parameter.</param>
- <param name="loggingEvent">The event to be rendered.</param>
- <remarks>
- <para>
- Renders the logging event using this parameters layout
- object. Sets the value of the parameter on the command object.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_parameterName">
- <summary>
- The name of this parameter.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_dbType">
- <summary>
- The database type for this parameter.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_inferType">
- <summary>
- Flag to infer type rather than use the DbType
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_precision">
- <summary>
- The precision for this parameter.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_scale">
- <summary>
- The scale for this parameter.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_size">
- <summary>
- The size for this parameter.
- </summary>
- </member>
- <member name="F:log4net.Appender.AdoNetAppenderParameter.m_layout">
- <summary>
- The <see cref="T:log4net.Layout.IRawLayout"/> to use to render the
- logging event into an object for this parameter.
- </summary>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.ParameterName">
- <summary>
- Gets or sets the name of this parameter.
- </summary>
- <value>
- The name of this parameter.
- </value>
- <remarks>
- <para>
- The name of this parameter. The parameter name
- must match up to a named parameter to the SQL stored procedure
- or prepared statement.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.DbType">
- <summary>
- Gets or sets the database type for this parameter.
- </summary>
- <value>
- The database type for this parameter.
- </value>
- <remarks>
- <para>
- The database type for this parameter. This property should
- be set to the database type from the <see cref="P:log4net.Appender.AdoNetAppenderParameter.DbType"/>
- enumeration. See <see cref="P:System.Data.IDataParameter.DbType"/>.
- </para>
- <para>
- This property is optional. If not specified the ADO.NET provider
- will attempt to infer the type from the value.
- </para>
- </remarks>
- <seealso cref="P:System.Data.IDataParameter.DbType"/>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.Precision">
- <summary>
- Gets or sets the precision for this parameter.
- </summary>
- <value>
- The precision for this parameter.
- </value>
- <remarks>
- <para>
- The maximum number of digits used to represent the Value.
- </para>
- <para>
- This property is optional. If not specified the ADO.NET provider
- will attempt to infer the precision from the value.
- </para>
- </remarks>
- <seealso cref="P:System.Data.IDbDataParameter.Precision"/>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.Scale">
- <summary>
- Gets or sets the scale for this parameter.
- </summary>
- <value>
- The scale for this parameter.
- </value>
- <remarks>
- <para>
- The number of decimal places to which Value is resolved.
- </para>
- <para>
- This property is optional. If not specified the ADO.NET provider
- will attempt to infer the scale from the value.
- </para>
- </remarks>
- <seealso cref="P:System.Data.IDbDataParameter.Scale"/>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.Size">
- <summary>
- Gets or sets the size for this parameter.
- </summary>
- <value>
- The size for this parameter.
- </value>
- <remarks>
- <para>
- The maximum size, in bytes, of the data within the column.
- </para>
- <para>
- This property is optional. If not specified the ADO.NET provider
- will attempt to infer the size from the value.
- </para>
- </remarks>
- <seealso cref="P:System.Data.IDbDataParameter.Size"/>
- </member>
- <member name="P:log4net.Appender.AdoNetAppenderParameter.Layout">
- <summary>
- Gets or sets the <see cref="T:log4net.Layout.IRawLayout"/> to use to
- render the logging event into an object for this
- parameter.
- </summary>
- <value>
- The <see cref="T:log4net.Layout.IRawLayout"/> used to render the
- logging event into an object for this parameter.
- </value>
- <remarks>
- <para>
- The <see cref="T:log4net.Layout.IRawLayout"/> that renders the value for this
- parameter.
- </para>
- <para>
- The <see cref="T:log4net.Layout.RawLayoutConverter"/> can be used to adapt
- any <see cref="T:log4net.Layout.ILayout"/> into a <see cref="T:log4net.Layout.IRawLayout"/>
- for use in the property.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.AnsiColorTerminalAppender">
- <summary>
- Appends logging events to the terminal using ANSI color escape sequences.
- </summary>
- <remarks>
- <para>
- AnsiColorTerminalAppender appends log events to the standard output stream
- or the error output stream using a layout specified by the
- user. It also allows the color of a specific level of message to be set.
- </para>
- <note>
- This appender expects the terminal to understand the VT100 control set
- in order to interpret the color codes. If the terminal or console does not
- understand the control codes the behavior is not defined.
- </note>
- <para>
- By default, all output is written to the console's standard output stream.
- The <see cref="P:log4net.Appender.AnsiColorTerminalAppender.Target"/> property can be set to direct the output to the
- error stream.
- </para>
- <para>
- NOTE: This appender writes each message to the <c>System.Console.Out</c> or
- <c>System.Console.Error</c> that is set at the time the event is appended.
- Therefore it is possible to programmatically redirect the output of this appender
- (for example NUnit does this to capture program output). While this is the desired
- behavior of this appender it may have security implications in your application.
- </para>
- <para>
- When configuring the ANSI colored terminal appender, a mapping should be
- specified to map a logging level to a color. For example:
- </para>
- <code lang="XML" escaped="true">
- <mapping>
- <level value="ERROR"/>
- <foreColor value="White"/>
- <backColor value="Red"/>
- <attributes value="Bright,Underscore"/>
- </mapping>
- <mapping>
- <level value="DEBUG"/>
- <backColor value="Green"/>
- </mapping>
- </code>
- <para>
- The Level is the standard log4net logging level and ForeColor and BackColor can be any
- of the following values:
- <list type="bullet">
- <item><term>Blue</term><description></description></item>
- <item><term>Green</term><description></description></item>
- <item><term>Red</term><description></description></item>
- <item><term>White</term><description></description></item>
- <item><term>Yellow</term><description></description></item>
- <item><term>Purple</term><description></description></item>
- <item><term>Cyan</term><description></description></item>
- </list>
- These color values cannot be combined together to make new colors.
- </para>
- <para>
- The attributes can be any combination of the following:
- <list type="bullet">
- <item><term>Bright</term><description>foreground is brighter</description></item>
- <item><term>Dim</term><description>foreground is dimmer</description></item>
- <item><term>Underscore</term><description>message is underlined</description></item>
- <item><term>Blink</term><description>foreground is blinking (does not work on all terminals)</description></item>
- <item><term>Reverse</term><description>foreground and background are reversed</description></item>
- <item><term>Hidden</term><description>output is hidden</description></item>
- <item><term>Strikethrough</term><description>message has a line through it</description></item>
- </list>
- While any of these attributes may be combined together not all combinations
- work well together, for example setting both <i>Bright</i> and <i>Dim</i> attributes makes
- no sense.
- </para>
- </remarks>
- <author>Patrick Wagstrom</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.ConsoleOut">
- <summary>
- The <see cref="P:log4net.Appender.AnsiColorTerminalAppender.Target"/> to use when writing to the Console
- standard output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.AnsiColorTerminalAppender.Target"/> to use when writing to the Console
- standard output stream.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.ConsoleError">
- <summary>
- The <see cref="P:log4net.Appender.AnsiColorTerminalAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.AnsiColorTerminalAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.PostEventCodes">
- <summary>
- Ansi code to reset terminal
- </summary>
- </member>
- <member name="M:log4net.Appender.AnsiColorTerminalAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.AnsiColorTerminalAppender"/> class.
- </summary>
- <remarks>
- The instance of the <see cref="T:log4net.Appender.AnsiColorTerminalAppender"/> class is set up to write
- to the standard output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.AnsiColorTerminalAppender.AddMapping(log4net.Appender.AnsiColorTerminalAppender.LevelColors)">
- <summary>
- Add a mapping of level to color
- </summary>
- <param name="mapping">The mapping to add</param>
- <remarks>
- <para>
- Add a <see cref="T:log4net.Appender.AnsiColorTerminalAppender.LevelColors"/> mapping to this appender.
- Each mapping defines the foreground and background colours
- for a level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AnsiColorTerminalAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the event to the console.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AnsiColorTerminalAppender.ActivateOptions">
- <summary>
- Initialize the options for this appender
- </summary>
- <remarks>
- <para>
- Initialize the level to color mappings set on this appender.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.m_writeToErrorStream">
- <summary>
- Flag to write output to the error stream rather than the standard output stream
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.m_levelMapping">
- <summary>
- Mapping from level object to color value
- </summary>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.Target">
- <summary>
- Target is the value of the console output stream.
- </summary>
- <value>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </value>
- <remarks>
- <para>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes">
- <summary>
- The enum of possible display attributes
- </summary>
- <remarks>
- <para>
- The following flags can be combined together to
- form the ANSI color attributes.
- </para>
- </remarks>
- <seealso cref="T:log4net.Appender.AnsiColorTerminalAppender"/>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Bright">
- <summary>
- text is bright
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Dim">
- <summary>
- text is dim
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Underscore">
- <summary>
- text is underlined
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Blink">
- <summary>
- text is blinking
- </summary>
- <remarks>
- Not all terminals support this attribute
- </remarks>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Reverse">
- <summary>
- text and background colors are reversed
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Hidden">
- <summary>
- text is hidden
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiAttributes.Strikethrough">
- <summary>
- text is displayed with a strikethrough
- </summary>
- </member>
- <member name="T:log4net.Appender.AnsiColorTerminalAppender.AnsiColor">
- <summary>
- The enum of possible foreground or background color values for
- use with the color mapping method
- </summary>
- <remarks>
- <para>
- The output can be in one for the following ANSI colors.
- </para>
- </remarks>
- <seealso cref="T:log4net.Appender.AnsiColorTerminalAppender"/>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Black">
- <summary>
- color is black
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Red">
- <summary>
- color is red
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Green">
- <summary>
- color is green
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Yellow">
- <summary>
- color is yellow
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Blue">
- <summary>
- color is blue
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Magenta">
- <summary>
- color is magenta
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.Cyan">
- <summary>
- color is cyan
- </summary>
- </member>
- <member name="F:log4net.Appender.AnsiColorTerminalAppender.AnsiColor.White">
- <summary>
- color is white
- </summary>
- </member>
- <member name="T:log4net.Appender.AnsiColorTerminalAppender.LevelColors">
- <summary>
- A class to act as a mapping between the level that a logging call is made at and
- the color it should be displayed as.
- </summary>
- <remarks>
- <para>
- Defines the mapping between a level and the color it should be displayed in.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.LevelMappingEntry">
- <summary>
- An entry in the <see cref="T:log4net.Util.LevelMapping"/>
- </summary>
- <remarks>
- <para>
- This is an abstract base class for types that are stored in the
- <see cref="T:log4net.Util.LevelMapping"/> object.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.LevelMappingEntry.#ctor">
- <summary>
- Default protected constructor
- </summary>
- <remarks>
- <para>
- Default protected constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LevelMappingEntry.ActivateOptions">
- <summary>
- Initialize any options defined on this entry
- </summary>
- <remarks>
- <para>
- Should be overridden by any classes that need to initialise based on their options
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.LevelMappingEntry.Level">
- <summary>
- The level that is the key for this mapping
- </summary>
- <value>
- The <see cref="P:log4net.Util.LevelMappingEntry.Level"/> that is the key for this mapping
- </value>
- <remarks>
- <para>
- Get or set the <see cref="P:log4net.Util.LevelMappingEntry.Level"/> that is the key for this
- mapping subclass.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AnsiColorTerminalAppender.LevelColors.ActivateOptions">
- <summary>
- Initialize the options for the object
- </summary>
- <remarks>
- <para>
- Combine the <see cref="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.ForeColor"/> and <see cref="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.BackColor"/> together
- and append the attributes.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.ForeColor">
- <summary>
- The mapped foreground color for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped foreground color for the specified level
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.BackColor">
- <summary>
- The mapped background color for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped background color for the specified level
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.Attributes">
- <summary>
- The color attributes for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The color attributes for the specified level
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.CombinedColor">
- <summary>
- The combined <see cref="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.ForeColor"/>, <see cref="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.BackColor"/> and
- <see cref="P:log4net.Appender.AnsiColorTerminalAppender.LevelColors.Attributes"/> suitable for setting the ansi terminal color.
- </summary>
- </member>
- <member name="T:log4net.Appender.AppenderCollection">
- <summary>
- A strongly-typed collection of <see cref="T:log4net.Appender.IAppender"/> objects.
- </summary>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.ReadOnly(log4net.Appender.AppenderCollection)">
- <summary>
- Creates a read-only wrapper for a <c>AppenderCollection</c> instance.
- </summary>
- <param name="list">list to create a readonly wrapper arround</param>
- <returns>
- An <c>AppenderCollection</c> wrapper that is read-only.
- </returns>
- </member>
- <member name="F:log4net.Appender.AppenderCollection.EmptyCollection">
- <summary>
- An empty readonly static AppenderCollection
- </summary>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor">
- <summary>
- Initializes a new instance of the <c>AppenderCollection</c> class
- that is empty and has the default initial capacity.
- </summary>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor(System.Int32)">
- <summary>
- Initializes a new instance of the <c>AppenderCollection</c> class
- that has the specified initial capacity.
- </summary>
- <param name="capacity">
- The number of elements that the new <c>AppenderCollection</c> is initially capable of storing.
- </param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor(log4net.Appender.AppenderCollection)">
- <summary>
- Initializes a new instance of the <c>AppenderCollection</c> class
- that contains elements copied from the specified <c>AppenderCollection</c>.
- </summary>
- <param name="c">The <c>AppenderCollection</c> whose elements are copied to the new collection.</param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor(log4net.Appender.IAppender[])">
- <summary>
- Initializes a new instance of the <c>AppenderCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Appender.IAppender"/> array.
- </summary>
- <param name="a">The <see cref="T:log4net.Appender.IAppender"/> array whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor(System.Collections.ICollection)">
- <summary>
- Initializes a new instance of the <c>AppenderCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Appender.IAppender"/> collection.
- </summary>
- <param name="col">The <see cref="T:log4net.Appender.IAppender"/> collection whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.#ctor(log4net.Appender.AppenderCollection.Tag)">
- <summary>
- Allow subclasses to avoid our default constructors
- </summary>
- <param name="tag"></param>
- <exclude/>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.CopyTo(log4net.Appender.IAppender[])">
- <summary>
- Copies the entire <c>AppenderCollection</c> to a one-dimensional
- <see cref="T:log4net.Appender.IAppender"/> array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Appender.IAppender"/> array to copy to.</param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.CopyTo(log4net.Appender.IAppender[],System.Int32)">
- <summary>
- Copies the entire <c>AppenderCollection</c> to a one-dimensional
- <see cref="T:log4net.Appender.IAppender"/> array, starting at the specified index of the target array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Appender.IAppender"/> array to copy to.</param>
- <param name="start">The zero-based index in <paramref name="array"/> at which copying begins.</param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Add(log4net.Appender.IAppender)">
- <summary>
- Adds a <see cref="T:log4net.Appender.IAppender"/> to the end of the <c>AppenderCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Appender.IAppender"/> to be added to the end of the <c>AppenderCollection</c>.</param>
- <returns>The index at which the value has been added.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Clear">
- <summary>
- Removes all elements from the <c>AppenderCollection</c>.
- </summary>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Clone">
- <summary>
- Creates a shallow copy of the <see cref="T:log4net.Appender.AppenderCollection"/>.
- </summary>
- <returns>A new <see cref="T:log4net.Appender.AppenderCollection"/> with a shallow copy of the collection data.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Contains(log4net.Appender.IAppender)">
- <summary>
- Determines whether a given <see cref="T:log4net.Appender.IAppender"/> is in the <c>AppenderCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Appender.IAppender"/> to check for.</param>
- <returns><c>true</c> if <paramref name="item"/> is found in the <c>AppenderCollection</c>; otherwise, <c>false</c>.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.IndexOf(log4net.Appender.IAppender)">
- <summary>
- Returns the zero-based index of the first occurrence of a <see cref="T:log4net.Appender.IAppender"/>
- in the <c>AppenderCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Appender.IAppender"/> to locate in the <c>AppenderCollection</c>.</param>
- <returns>
- The zero-based index of the first occurrence of <paramref name="item"/>
- in the entire <c>AppenderCollection</c>, if found; otherwise, -1.
- </returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Insert(System.Int32,log4net.Appender.IAppender)">
- <summary>
- Inserts an element into the <c>AppenderCollection</c> at the specified index.
- </summary>
- <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
- <param name="item">The <see cref="T:log4net.Appender.IAppender"/> to insert.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Appender.AppenderCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Remove(log4net.Appender.IAppender)">
- <summary>
- Removes the first occurrence of a specific <see cref="T:log4net.Appender.IAppender"/> from the <c>AppenderCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Appender.IAppender"/> to remove from the <c>AppenderCollection</c>.</param>
- <exception cref="T:System.ArgumentException">
- The specified <see cref="T:log4net.Appender.IAppender"/> was not found in the <c>AppenderCollection</c>.
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.RemoveAt(System.Int32)">
- <summary>
- Removes the element at the specified index of the <c>AppenderCollection</c>.
- </summary>
- <param name="index">The zero-based index of the element to remove.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Appender.AppenderCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through the <c>AppenderCollection</c>.
- </summary>
- <returns>An <see cref="T:log4net.Appender.AppenderCollection.Enumerator"/> for the entire <c>AppenderCollection</c>.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.AddRange(log4net.Appender.AppenderCollection)">
- <summary>
- Adds the elements of another <c>AppenderCollection</c> to the current <c>AppenderCollection</c>.
- </summary>
- <param name="x">The <c>AppenderCollection</c> whose elements should be added to the end of the current <c>AppenderCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Appender.AppenderCollection.Count"/> of the <c>AppenderCollection</c>.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.AddRange(log4net.Appender.IAppender[])">
- <summary>
- Adds the elements of a <see cref="T:log4net.Appender.IAppender"/> array to the current <c>AppenderCollection</c>.
- </summary>
- <param name="x">The <see cref="T:log4net.Appender.IAppender"/> array whose elements should be added to the end of the <c>AppenderCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Appender.AppenderCollection.Count"/> of the <c>AppenderCollection</c>.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.AddRange(System.Collections.ICollection)">
- <summary>
- Adds the elements of a <see cref="T:log4net.Appender.IAppender"/> collection to the current <c>AppenderCollection</c>.
- </summary>
- <param name="col">The <see cref="T:log4net.Appender.IAppender"/> collection whose elements should be added to the end of the <c>AppenderCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Appender.AppenderCollection.Count"/> of the <c>AppenderCollection</c>.</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.TrimToSize">
- <summary>
- Sets the capacity to the actual number of elements.
- </summary>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.ToArray">
- <summary>
- Return the collection elements as an array
- </summary>
- <returns>the array</returns>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.ValidateIndex(System.Int32)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Appender.AppenderCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.ValidateIndex(System.Int32,System.Boolean)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Appender.AppenderCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.Count">
- <summary>
- Gets the number of elements actually contained in the <c>AppenderCollection</c>.
- </summary>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.IsSynchronized">
- <summary>
- Gets a value indicating whether access to the collection is synchronized (thread-safe).
- </summary>
- <returns>true if access to the ICollection is synchronized (thread-safe); otherwise, false.</returns>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.SyncRoot">
- <summary>
- Gets an object that can be used to synchronize access to the collection.
- </summary>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.Item(System.Int32)">
- <summary>
- Gets or sets the <see cref="T:log4net.Appender.IAppender"/> at the specified index.
- </summary>
- <param name="index">The zero-based index of the element to get or set.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Appender.AppenderCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.IsFixedSize">
- <summary>
- Gets a value indicating whether the collection has a fixed size.
- </summary>
- <value>true if the collection has a fixed size; otherwise, false. The default is false</value>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.IsReadOnly">
- <summary>
- Gets a value indicating whether the IList is read-only.
- </summary>
- <value>true if the collection is read-only; otherwise, false. The default is false</value>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.Capacity">
- <summary>
- Gets or sets the number of elements the <c>AppenderCollection</c> can contain.
- </summary>
- </member>
- <member name="T:log4net.Appender.AppenderCollection.IAppenderCollectionEnumerator">
- <summary>
- Supports type-safe iteration over a <see cref="T:log4net.Appender.AppenderCollection"/>.
- </summary>
- <exclude/>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.IAppenderCollectionEnumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.IAppenderCollectionEnumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.IAppenderCollectionEnumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- </member>
- <member name="T:log4net.Appender.AppenderCollection.Tag">
- <summary>
- Type visible only to our subclasses
- Used to access protected constructor
- </summary>
- <exclude/>
- </member>
- <member name="F:log4net.Appender.AppenderCollection.Tag.Default">
- <summary>
- A value
- </summary>
- </member>
- <member name="T:log4net.Appender.AppenderCollection.Enumerator">
- <summary>
- Supports simple iteration over a <see cref="T:log4net.Appender.AppenderCollection"/>.
- </summary>
- <exclude/>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Enumerator.#ctor(log4net.Appender.AppenderCollection)">
- <summary>
- Initializes a new instance of the <c>Enumerator</c> class.
- </summary>
- <param name="tc"></param>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Enumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Appender.AppenderCollection.Enumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Appender.AppenderCollection.Enumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- </member>
- <member name="T:log4net.Appender.AppenderCollection.ReadOnlyAppenderCollection">
- <exclude/>
- </member>
- <member name="T:log4net.Appender.AspNetTraceAppender">
- <summary>
- <para>
- Appends log events to the ASP.NET <see cref="T:System.Web.TraceContext"/> system.
- </para>
- </summary>
- <remarks>
- <para>
- Diagnostic information and tracing messages that you specify are appended to the output
- of the page that is sent to the requesting browser. Optionally, you can view this information
- from a separate trace viewer (Trace.axd) that displays trace information for every page in a
- given application.
- </para>
- <para>
- Trace statements are processed and displayed only when tracing is enabled. You can control
- whether tracing is displayed to a page, to the trace viewer, or both.
- </para>
- <para>
- The logging event is passed to the <see cref="M:System.Web.TraceContext.Write(System.String)"/> or
- <see cref="M:System.Web.TraceContext.Warn(System.String)"/> method depending on the level of the logging event.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.AspNetTraceAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.AspNetTraceAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.AspNetTraceAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Write the logging event to the ASP.NET trace
- </summary>
- <param name="loggingEvent">the event to log</param>
- <remarks>
- <para>
- Write the logging event to the ASP.NET trace
- <c>HttpContext.Current.Trace</c>
- (<see cref="T:System.Web.TraceContext"/>).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.AspNetTraceAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.BufferingForwardingAppender">
- <summary>
- Buffers events and then forwards them to attached appenders.
- </summary>
- <remarks>
- <para>
- The events are buffered in this appender until conditions are
- met to allow the appender to deliver the events to the attached
- appenders. See <see cref="T:log4net.Appender.BufferingAppenderSkeleton"/> for the
- conditions that cause the buffer to be sent.
- </para>
- <para>The forwarding appender can be used to specify different
- thresholds and filters for the same appender at different locations
- within the hierarchy.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Core.IAppenderAttachable">
- <summary>
- Interface for attaching appenders to objects.
- </summary>
- <remarks>
- <para>
- Interface for attaching, removing and retrieving appenders.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.IAppenderAttachable.AddAppender(log4net.Appender.IAppender)">
- <summary>
- Attaches an appender.
- </summary>
- <param name="appender">The appender to add.</param>
- <remarks>
- <para>
- Add the specified appender. The implementation may
- choose to allow or deny duplicate appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IAppenderAttachable.GetAppender(System.String)">
- <summary>
- Gets an attached appender with the specified name.
- </summary>
- <param name="name">The name of the appender to get.</param>
- <returns>
- The appender with the name specified, or <c>null</c> if no appender with the
- specified name is found.
- </returns>
- <remarks>
- <para>
- Returns an attached appender with the <paramref name="name"/> specified.
- If no appender with the specified name is found <c>null</c> will be
- returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IAppenderAttachable.RemoveAllAppenders">
- <summary>
- Removes all attached appenders.
- </summary>
- <remarks>
- <para>
- Removes and closes all attached appenders
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IAppenderAttachable.RemoveAppender(log4net.Appender.IAppender)">
- <summary>
- Removes the specified appender from the list of attached appenders.
- </summary>
- <param name="appender">The appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IAppenderAttachable.RemoveAppender(System.String)">
- <summary>
- Removes the appender with the specified name from the list of appenders.
- </summary>
- <param name="name">The name of the appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.IAppenderAttachable.Appenders">
- <summary>
- Gets all attached appenders.
- </summary>
- <value>
- A collection of attached appenders.
- </value>
- <remarks>
- <para>
- Gets a collection of attached appenders.
- If there are no attached appenders the
- implementation should return an empty
- collection rather than <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.BufferingForwardingAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.OnClose">
- <summary>
- Closes the appender and releases resources.
- </summary>
- <remarks>
- <para>
- Releases any resources allocated within the appender such as file handles,
- network connections, etc.
- </para>
- <para>
- It is a programming error to append to a closed appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Send the events.
- </summary>
- <param name="events">The events that need to be send.</param>
- <remarks>
- <para>
- Forwards the events to the attached appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.AddAppender(log4net.Appender.IAppender)">
- <summary>
- Adds an <see cref="T:log4net.Appender.IAppender"/> to the list of appenders of this
- instance.
- </summary>
- <param name="newAppender">The <see cref="T:log4net.Appender.IAppender"/> to add to this appender.</param>
- <remarks>
- <para>
- If the specified <see cref="T:log4net.Appender.IAppender"/> is already in the list of
- appenders, then it won't be added again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.GetAppender(System.String)">
- <summary>
- Looks for the appender with the specified name.
- </summary>
- <param name="name">The name of the appender to lookup.</param>
- <returns>
- The appender with the specified name, or <c>null</c>.
- </returns>
- <remarks>
- <para>
- Get the named appender attached to this buffering appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.RemoveAllAppenders">
- <summary>
- Removes all previously added appenders from this appender.
- </summary>
- <remarks>
- <para>
- This is useful when re-reading configuration information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.RemoveAppender(log4net.Appender.IAppender)">
- <summary>
- Removes the specified appender from the list of appenders.
- </summary>
- <param name="appender">The appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </remarks>
- </member>
- <member name="M:log4net.Appender.BufferingForwardingAppender.RemoveAppender(System.String)">
- <summary>
- Removes the appender with the specified name from the list of appenders.
- </summary>
- <param name="name">The name of the appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </remarks>
- </member>
- <member name="F:log4net.Appender.BufferingForwardingAppender.m_appenderAttachedImpl">
- <summary>
- Implementation of the <see cref="T:log4net.Core.IAppenderAttachable"/> interface
- </summary>
- </member>
- <member name="P:log4net.Appender.BufferingForwardingAppender.Appenders">
- <summary>
- Gets the appenders contained in this appender as an
- <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <remarks>
- If no appenders can be found, then an <see cref="T:log4net.Util.EmptyCollection"/>
- is returned.
- </remarks>
- <returns>
- A collection of the appenders in this appender.
- </returns>
- </member>
- <member name="T:log4net.Appender.ColoredConsoleAppender">
- <summary>
- Appends logging events to the console.
- </summary>
- <remarks>
- <para>
- ColoredConsoleAppender appends log events to the standard output stream
- or the error output stream using a layout specified by the
- user. It also allows the color of a specific type of message to be set.
- </para>
- <para>
- By default, all output is written to the console's standard output stream.
- The <see cref="P:log4net.Appender.ColoredConsoleAppender.Target"/> property can be set to direct the output to the
- error stream.
- </para>
- <para>
- NOTE: This appender writes directly to the application's attached console
- not to the <c>System.Console.Out</c> or <c>System.Console.Error</c> <c>TextWriter</c>.
- The <c>System.Console.Out</c> and <c>System.Console.Error</c> streams can be
- programmatically redirected (for example NUnit does this to capture program output).
- This appender will ignore these redirections because it needs to use Win32
- API calls to colorize the output. To respect these redirections the <see cref="T:log4net.Appender.ConsoleAppender"/>
- must be used.
- </para>
- <para>
- When configuring the colored console appender, mapping should be
- specified to map a logging level to a color. For example:
- </para>
- <code lang="XML" escaped="true">
- <mapping>
- <level value="ERROR"/>
- <foreColor value="White"/>
- <backColor value="Red, HighIntensity"/>
- </mapping>
- <mapping>
- <level value="DEBUG"/>
- <backColor value="Green"/>
- </mapping>
- </code>
- <para>
- The Level is the standard log4net logging level and ForeColor and BackColor can be any
- combination of the following values:
- <list type="bullet">
- <item><term>Blue</term><description></description></item>
- <item><term>Green</term><description></description></item>
- <item><term>Red</term><description></description></item>
- <item><term>White</term><description></description></item>
- <item><term>Yellow</term><description></description></item>
- <item><term>Purple</term><description></description></item>
- <item><term>Cyan</term><description></description></item>
- <item><term>HighIntensity</term><description></description></item>
- </list>
- </para>
- </remarks>
- <author>Rick Hobbs</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.ConsoleOut">
- <summary>
- The <see cref="P:log4net.Appender.ColoredConsoleAppender.Target"/> to use when writing to the Console
- standard output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.ColoredConsoleAppender.Target"/> to use when writing to the Console
- standard output stream.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.ConsoleError">
- <summary>
- The <see cref="P:log4net.Appender.ColoredConsoleAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.ColoredConsoleAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ColoredConsoleAppender"/> class.
- </summary>
- <remarks>
- The instance of the <see cref="T:log4net.Appender.ColoredConsoleAppender"/> class is set up to write
- to the standard output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.#ctor(log4net.Layout.ILayout)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ColoredConsoleAppender"/> class
- with the specified layout.
- </summary>
- <param name="layout">the layout to use for this appender</param>
- <remarks>
- The instance of the <see cref="T:log4net.Appender.ColoredConsoleAppender"/> class is set up to write
- to the standard output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.#ctor(log4net.Layout.ILayout,System.Boolean)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ColoredConsoleAppender"/> class
- with the specified layout.
- </summary>
- <param name="layout">the layout to use for this appender</param>
- <param name="writeToErrorStream">flag set to <c>true</c> to write to the console error stream</param>
- <remarks>
- When <paramref name="writeToErrorStream"/> is set to <c>true</c>, output is written to
- the standard error output stream. Otherwise, output is written to the standard
- output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.AddMapping(log4net.Appender.ColoredConsoleAppender.LevelColors)">
- <summary>
- Add a mapping of level to color - done by the config file
- </summary>
- <param name="mapping">The mapping to add</param>
- <remarks>
- <para>
- Add a <see cref="T:log4net.Appender.ColoredConsoleAppender.LevelColors"/> mapping to this appender.
- Each mapping defines the foreground and background colors
- for a level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the event to the console.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.ActivateOptions">
- <summary>
- Initialize the options for this appender
- </summary>
- <remarks>
- <para>
- Initialize the level to color mappings set on this appender.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.m_writeToErrorStream">
- <summary>
- Flag to write output to the error stream rather than the standard output stream
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.m_levelMapping">
- <summary>
- Mapping from level object to color value
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.m_consoleOutputWriter">
- <summary>
- The console output stream writer to write to
- </summary>
- <remarks>
- <para>
- This writer is not thread safe.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ColoredConsoleAppender.Target">
- <summary>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </summary>
- <value>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </value>
- <remarks>
- <para>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ColoredConsoleAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.ColoredConsoleAppender.Colors">
- <summary>
- The enum of possible color values for use with the color mapping method
- </summary>
- <remarks>
- <para>
- The following flags can be combined together to
- form the colors.
- </para>
- </remarks>
- <seealso cref="T:log4net.Appender.ColoredConsoleAppender"/>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Blue">
- <summary>
- color is blue
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Green">
- <summary>
- color is green
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Red">
- <summary>
- color is red
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.White">
- <summary>
- color is white
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Yellow">
- <summary>
- color is yellow
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Purple">
- <summary>
- color is purple
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.Cyan">
- <summary>
- color is cyan
- </summary>
- </member>
- <member name="F:log4net.Appender.ColoredConsoleAppender.Colors.HighIntensity">
- <summary>
- color is intensified
- </summary>
- </member>
- <member name="T:log4net.Appender.ColoredConsoleAppender.LevelColors">
- <summary>
- A class to act as a mapping between the level that a logging call is made at and
- the color it should be displayed as.
- </summary>
- <remarks>
- <para>
- Defines the mapping between a level and the color it should be displayed in.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ColoredConsoleAppender.LevelColors.ActivateOptions">
- <summary>
- Initialize the options for the object
- </summary>
- <remarks>
- <para>
- Combine the <see cref="P:log4net.Appender.ColoredConsoleAppender.LevelColors.ForeColor"/> and <see cref="P:log4net.Appender.ColoredConsoleAppender.LevelColors.BackColor"/> together.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ColoredConsoleAppender.LevelColors.ForeColor">
- <summary>
- The mapped foreground color for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped foreground color for the specified level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ColoredConsoleAppender.LevelColors.BackColor">
- <summary>
- The mapped background color for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped background color for the specified level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ColoredConsoleAppender.LevelColors.CombinedColor">
- <summary>
- The combined <see cref="P:log4net.Appender.ColoredConsoleAppender.LevelColors.ForeColor"/> and <see cref="P:log4net.Appender.ColoredConsoleAppender.LevelColors.BackColor"/> suitable for
- setting the console color.
- </summary>
- </member>
- <member name="T:log4net.Appender.ConsoleAppender">
- <summary>
- Appends logging events to the console.
- </summary>
- <remarks>
- <para>
- ConsoleAppender appends log events to the standard output stream
- or the error output stream using a layout specified by the
- user.
- </para>
- <para>
- By default, all output is written to the console's standard output stream.
- The <see cref="P:log4net.Appender.ConsoleAppender.Target"/> property can be set to direct the output to the
- error stream.
- </para>
- <para>
- NOTE: This appender writes each message to the <c>System.Console.Out</c> or
- <c>System.Console.Error</c> that is set at the time the event is appended.
- Therefore it is possible to programmatically redirect the output of this appender
- (for example NUnit does this to capture program output). While this is the desired
- behavior of this appender it may have security implications in your application.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Appender.ConsoleAppender.ConsoleOut">
- <summary>
- The <see cref="P:log4net.Appender.ConsoleAppender.Target"/> to use when writing to the Console
- standard output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.ConsoleAppender.Target"/> to use when writing to the Console
- standard output stream.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.ConsoleAppender.ConsoleError">
- <summary>
- The <see cref="P:log4net.Appender.ConsoleAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.ConsoleAppender.Target"/> to use when writing to the Console
- standard error output stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ConsoleAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ConsoleAppender"/> class.
- </summary>
- <remarks>
- The instance of the <see cref="T:log4net.Appender.ConsoleAppender"/> class is set up to write
- to the standard output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ConsoleAppender.#ctor(log4net.Layout.ILayout)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ConsoleAppender"/> class
- with the specified layout.
- </summary>
- <param name="layout">the layout to use for this appender</param>
- <remarks>
- The instance of the <see cref="T:log4net.Appender.ConsoleAppender"/> class is set up to write
- to the standard output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ConsoleAppender.#ctor(log4net.Layout.ILayout,System.Boolean)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ConsoleAppender"/> class
- with the specified layout.
- </summary>
- <param name="layout">the layout to use for this appender</param>
- <param name="writeToErrorStream">flag set to <c>true</c> to write to the console error stream</param>
- <remarks>
- When <paramref name="writeToErrorStream"/> is set to <c>true</c>, output is written to
- the standard error output stream. Otherwise, output is written to the standard
- output stream.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ConsoleAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the event to the console.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ConsoleAppender.Target">
- <summary>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </summary>
- <value>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </value>
- <remarks>
- <para>
- Target is the value of the console output stream.
- This is either <c>"Console.Out"</c> or <c>"Console.Error"</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.ConsoleAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.DebugAppender">
- <summary>
- Appends log events to the <see cref="T:System.Diagnostics.Debug"/> system.
- </summary>
- <remarks>
- <para>
- The application configuration file can be used to control what listeners
- are actually used. See the MSDN documentation for the
- <see cref="T:System.Diagnostics.Debug"/> class for details on configuring the
- debug system.
- </para>
- <para>
- Events are written using the <see cref="M:System.Diagnostics.Debug.Write(System.String,System.String)"/>
- method. The event's logger name is passed as the value for the category name to the Write method.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.DebugAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.DebugAppender"/>.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.DebugAppender.#ctor(log4net.Layout.ILayout)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.DebugAppender"/>
- with a specified layout.
- </summary>
- <param name="layout">The layout to use with this appender.</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.DebugAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Writes the logging event to the <see cref="T:System.Diagnostics.Debug"/> system.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the logging event to the <see cref="T:System.Diagnostics.Debug"/> system.
- If <see cref="P:log4net.Appender.DebugAppender.ImmediateFlush"/> is <c>true</c> then the <see cref="M:System.Diagnostics.Debug.Flush"/>
- is called.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.DebugAppender.m_immediateFlush">
- <summary>
- Immediate flush means that the underlying writer or output stream
- will be flushed at the end of each append operation.
- </summary>
- <remarks>
- <para>
- Immediate flush is slower but ensures that each append request is
- actually written. If <see cref="P:log4net.Appender.DebugAppender.ImmediateFlush"/> is set to
- <c>false</c>, then there is a good chance that the last few
- logs events are not actually written to persistent media if and
- when the application crashes.
- </para>
- <para>
- The default value is <c>true</c>.</para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.DebugAppender.ImmediateFlush">
- <summary>
- Gets or sets a value that indicates whether the appender will
- flush at the end of each write.
- </summary>
- <remarks>
- <para>The default behavior is to flush at the end of each
- write. If the option is set to<c>false</c>, then the underlying
- stream can defer writing to physical medium to a later time.
- </para>
- <para>
- Avoiding the flush operation at the end of each append results
- in a performance gain of 10 to 20 percent. However, there is safety
- trade-off involved in skipping flushing. Indeed, when flushing is
- skipped, then it is likely that the last few log events will not
- be recorded on disk when the application exits. This is a high
- price to pay even for a 20% performance gain.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.DebugAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.EventLogAppender">
- <summary>
- Writes events to the system event log.
- </summary>
- <remarks>
- <para>
- The <c>EventID</c> of the event log entry can be
- set using the <c>EventLogEventID</c> property (<see cref="P:log4net.Core.LoggingEvent.Properties"/>)
- on the <see cref="T:log4net.Core.LoggingEvent"/>.
- </para>
- <para>
- There is a limit of 32K characters for an event log message
- </para>
- <para>
- When configuring the EventLogAppender a mapping can be
- specified to map a logging level to an event log entry type. For example:
- </para>
- <code lang="XML">
- &lt;mapping&gt;
- &lt;level value="ERROR" /&gt;
- &lt;eventLogEntryType value="Error" /&gt;
- &lt;/mapping&gt;
- &lt;mapping&gt;
- &lt;level value="DEBUG" /&gt;
- &lt;eventLogEntryType value="Information" /&gt;
- &lt;/mapping&gt;
- </code>
- <para>
- The Level is the standard log4net logging level and eventLogEntryType can be any value
- from the <see cref="T:System.Diagnostics.EventLogEntryType"/> enum, i.e.:
- <list type="bullet">
- <item><term>Error</term><description>an error event</description></item>
- <item><term>Warning</term><description>a warning event</description></item>
- <item><term>Information</term><description>an informational event</description></item>
- </list>
- </para>
- </remarks>
- <author>Aspi Havewala</author>
- <author>Douglas de la Torre</author>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Thomas Voss</author>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.EventLogAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.#ctor(log4net.Layout.ILayout)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.EventLogAppender"/> class
- with the specified <see cref="T:log4net.Layout.ILayout"/>.
- </summary>
- <param name="layout">The <see cref="T:log4net.Layout.ILayout"/> to use with this appender.</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.AddMapping(log4net.Appender.EventLogAppender.Level2EventLogEntryType)">
- <summary>
- Add a mapping of level to <see cref="T:System.Diagnostics.EventLogEntryType"/> - done by the config file
- </summary>
- <param name="mapping">The mapping to add</param>
- <remarks>
- <para>
- Add a <see cref="T:log4net.Appender.EventLogAppender.Level2EventLogEntryType"/> mapping to this appender.
- Each mapping defines the event log entry type for a level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.EventLogAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.EventLogAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.EventLogAppender.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.CreateEventSource(System.String,System.String,System.String)">
- <summary>
- Create an event log source
- </summary>
- <remarks>
- Uses different API calls under NET_2_0
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/>
- method.
- </summary>
- <param name="loggingEvent">the event to log</param>
- <remarks>
- <para>Writes the event to the system event log using the
- <see cref="P:log4net.Appender.EventLogAppender.ApplicationName"/>.</para>
-
- <para>If the event has an <c>EventID</c> property (see <see cref="P:log4net.Core.LoggingEvent.Properties"/>)
- set then this integer will be used as the event log event id.</para>
-
- <para>
- There is a limit of 32K characters for an event log message
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.EventLogAppender.GetEntryType(log4net.Core.Level)">
- <summary>
- Get the equivalent <see cref="T:System.Diagnostics.EventLogEntryType"/> for a <see cref="T:log4net.Core.Level"/> <paramref name="p"/>
- </summary>
- <param name="level">the Level to convert to an EventLogEntryType</param>
- <returns>The equivalent <see cref="T:System.Diagnostics.EventLogEntryType"/> for a <see cref="T:log4net.Core.Level"/> <paramref name="p"/></returns>
- <remarks>
- Because there are fewer applicable <see cref="T:System.Diagnostics.EventLogEntryType"/>
- values to use in logging levels than there are in the
- <see cref="T:log4net.Core.Level"/> this is a one way mapping. There is
- a loss of information during the conversion.
- </remarks>
- </member>
- <member name="F:log4net.Appender.EventLogAppender.m_logName">
- <summary>
- The log name is the section in the event logs where the messages
- are stored.
- </summary>
- </member>
- <member name="F:log4net.Appender.EventLogAppender.m_applicationName">
- <summary>
- Name of the application to use when logging. This appears in the
- application column of the event log named by <see cref="F:log4net.Appender.EventLogAppender.m_logName"/>.
- </summary>
- </member>
- <member name="F:log4net.Appender.EventLogAppender.m_machineName">
- <summary>
- The name of the machine which holds the event log. This is
- currently only allowed to be '.' i.e. the current machine.
- </summary>
- </member>
- <member name="F:log4net.Appender.EventLogAppender.m_levelMapping">
- <summary>
- Mapping from level object to EventLogEntryType
- </summary>
- </member>
- <member name="F:log4net.Appender.EventLogAppender.m_securityContext">
- <summary>
- The security context to use for privileged calls
- </summary>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.LogName">
- <summary>
- The name of the log where messages will be stored.
- </summary>
- <value>
- The string name of the log where messages will be stored.
- </value>
- <remarks>
- <para>This is the name of the log as it appears in the Event Viewer
- tree. The default value is to log into the <c>Application</c>
- log, this is where most applications write their events. However
- if you need a separate log for your application (or applications)
- then you should set the <see cref="P:log4net.Appender.EventLogAppender.LogName"/> appropriately.</para>
- <para>This should not be used to distinguish your event log messages
- from those of other applications, the <see cref="P:log4net.Appender.EventLogAppender.ApplicationName"/>
- property should be used to distinguish events. This property should be
- used to group together events into a single log.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.ApplicationName">
- <summary>
- Property used to set the Application name. This appears in the
- event logs when logging.
- </summary>
- <value>
- The string used to distinguish events from different sources.
- </value>
- <remarks>
- Sets the event log source property.
- </remarks>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.MachineName">
- <summary>
- This property is used to return the name of the computer to use
- when accessing the event logs. Currently, this is the current
- computer, denoted by a dot "."
- </summary>
- <value>
- The string name of the machine holding the event log that
- will be logged into.
- </value>
- <remarks>
- This property cannot be changed. It is currently set to '.'
- i.e. the local machine. This may be changed in future.
- </remarks>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.SecurityContext">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.EventLogAppender.SecurityContext"/> used to write to the EventLog.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.EventLogAppender.SecurityContext"/> used to write to the EventLog.
- </value>
- <remarks>
- <para>
- The system security context used to write to the EventLog.
- </para>
- <para>
- Unless a <see cref="P:log4net.Appender.EventLogAppender.SecurityContext"/> specified here for this appender
- the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is queried for the
- security context to use. The default behavior is to use the security context
- of the current thread.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.EventLogAppender.Level2EventLogEntryType">
- <summary>
- A class to act as a mapping between the level that a logging call is made at and
- the color it should be displayed as.
- </summary>
- <remarks>
- <para>
- Defines the mapping between a level and its event log entry type.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.EventLogAppender.Level2EventLogEntryType.EventLogEntryType">
- <summary>
- The <see cref="P:log4net.Appender.EventLogAppender.Level2EventLogEntryType.EventLogEntryType"/> for this entry
- </summary>
- <remarks>
- <para>
- Required property.
- The <see cref="P:log4net.Appender.EventLogAppender.Level2EventLogEntryType.EventLogEntryType"/> for this entry
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.FileAppender">
- <summary>
- Appends logging events to a file.
- </summary>
- <remarks>
- <para>
- Logging events are sent to the file specified by
- the <see cref="P:log4net.Appender.FileAppender.File"/> property.
- </para>
- <para>
- The file can be opened in either append or overwrite mode
- by specifying the <see cref="P:log4net.Appender.FileAppender.AppendToFile"/> property.
- If the file path is relative it is taken as relative from
- the application base directory. The file encoding can be
- specified by setting the <see cref="P:log4net.Appender.FileAppender.Encoding"/> property.
- </para>
- <para>
- The layout's <see cref="P:log4net.Layout.ILayout.Header"/> and <see cref="P:log4net.Layout.ILayout.Footer"/>
- values will be written each time the file is opened and closed
- respectively. If the <see cref="P:log4net.Appender.FileAppender.AppendToFile"/> property is <see langword="true"/>
- then the file may contain multiple copies of the header and footer.
- </para>
- <para>
- This appender will first try to open the file for writing when <see cref="M:log4net.Appender.FileAppender.ActivateOptions"/>
- is called. This will typically be during configuration.
- If the file cannot be opened for writing the appender will attempt
- to open the file again each time a message is logged to the appender.
- If the file cannot be opened for writing when a message is logged then
- the message will be discarded by this appender.
- </para>
- <para>
- The <see cref="T:log4net.Appender.FileAppender"/> supports pluggable file locking models via
- the <see cref="P:log4net.Appender.FileAppender.LockingModel"/> property.
- The default behavior, implemented by <see cref="T:log4net.Appender.FileAppender.ExclusiveLock"/>
- is to obtain an exclusive write lock on the file until this appender is closed.
- The alternative model, <see cref="T:log4net.Appender.FileAppender.MinimalLock"/>, only holds a
- write lock while the appender is writing a logging event.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Rodrigo B. de Oliveira</author>
- <author>Douglas de la Torre</author>
- <author>Niall Daley</author>
- </member>
- <member name="T:log4net.Appender.TextWriterAppender">
- <summary>
- Sends logging events to a <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <remarks>
- <para>
- An Appender that writes to a <see cref="T:System.IO.TextWriter"/>.
- </para>
- <para>
- This appender may be used stand alone if initialized with an appropriate
- writer, however it is typically used as a base class for an appender that
- can open a <see cref="T:System.IO.TextWriter"/> to write to.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Douglas de la Torre</author>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.TextWriterAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.#ctor(log4net.Layout.ILayout,System.IO.Stream)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.TextWriterAppender"/> class and
- sets the output destination to a new <see cref="T:System.IO.StreamWriter"/> initialized
- with the specified <see cref="T:System.IO.Stream"/>.
- </summary>
- <param name="layout">The layout to use with this appender.</param>
- <param name="os">The <see cref="T:System.IO.Stream"/> to output to.</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.#ctor(log4net.Layout.ILayout,System.IO.TextWriter)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.TextWriterAppender"/> class and sets
- the output destination to the specified <see cref="T:System.IO.StreamWriter"/>.
- </summary>
- <param name="layout">The layout to use with this appender</param>
- <param name="writer">The <see cref="T:System.IO.TextWriter"/> to output to</param>
- <remarks>
- The <see cref="T:System.IO.TextWriter"/> must have been previously opened.
- </remarks>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.PreAppendCheck">
- <summary>
- This method determines if there is a sense in attempting to append.
- </summary>
- <remarks>
- <para>
- This method checked if an output target has been set and if a
- layout has been set.
- </para>
- </remarks>
- <returns><c>false</c> if any of the preconditions fail.</returns>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/>
- method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes a log statement to the output stream if the output stream exists
- and is writable.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.Append(log4net.Core.LoggingEvent[])">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent[])"/>
- method.
- </summary>
- <param name="loggingEvents">The array of events to log.</param>
- <remarks>
- <para>
- This method writes all the bulk logged events to the output writer
- before flushing the stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.OnClose">
- <summary>
- Close this appender instance. The underlying stream or writer is also closed.
- </summary>
- <remarks>
- Closed appenders cannot be reused.
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.WriteFooterAndCloseWriter">
- <summary>
- Writes the footer and closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <remarks>
- <para>
- Writes the footer and closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.CloseWriter">
- <summary>
- Closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <remarks>
- <para>
- Closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.Reset">
- <summary>
- Clears internal references to the underlying <see cref="T:System.IO.TextWriter"/>
- and other variables.
- </summary>
- <remarks>
- <para>
- Subclasses can override this method for an alternate closing behavior.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.WriteFooter">
- <summary>
- Writes a footer as produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Footer"/> property.
- </summary>
- <remarks>
- <para>
- Writes a footer as produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Footer"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.WriteHeader">
- <summary>
- Writes a header produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Header"/> property.
- </summary>
- <remarks>
- <para>
- Writes a header produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Header"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TextWriterAppender.PrepareWriter">
- <summary>
- Called to allow a subclass to lazily initialize the writer
- </summary>
- <remarks>
- <para>
- This method is called when an event is logged and the <see cref="P:log4net.Appender.TextWriterAppender.Writer"/> or
- <see cref="P:log4net.Appender.TextWriterAppender.QuietWriter"/> have not been set. This allows a subclass to
- attempt to initialize the writer multiple times.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.TextWriterAppender.m_qtw">
- <summary>
- This is the <see cref="T:log4net.Util.QuietTextWriter"/> where logging events
- will be written to.
- </summary>
- </member>
- <member name="F:log4net.Appender.TextWriterAppender.m_immediateFlush">
- <summary>
- Immediate flush means that the underlying <see cref="T:System.IO.TextWriter"/>
- or output stream will be flushed at the end of each append operation.
- </summary>
- <remarks>
- <para>
- Immediate flush is slower but ensures that each append request is
- actually written. If <see cref="P:log4net.Appender.TextWriterAppender.ImmediateFlush"/> is set to
- <c>false</c>, then there is a good chance that the last few
- logging events are not actually persisted if and when the application
- crashes.
- </para>
- <para>
- The default value is <c>true</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TextWriterAppender.ImmediateFlush">
- <summary>
- Gets or set whether the appender will flush at the end
- of each append operation.
- </summary>
- <value>
- <para>
- The default behavior is to flush at the end of each
- append operation.
- </para>
- <para>
- If this option is set to <c>false</c>, then the underlying
- stream can defer persisting the logging event to a later
- time.
- </para>
- </value>
- <remarks>
- Avoiding the flush operation at the end of each append results in
- a performance gain of 10 to 20 percent. However, there is safety
- trade-off involved in skipping flushing. Indeed, when flushing is
- skipped, then it is likely that the last few log events will not
- be recorded on disk when the application exits. This is a high
- price to pay even for a 20% performance gain.
- </remarks>
- </member>
- <member name="P:log4net.Appender.TextWriterAppender.Writer">
- <summary>
- Sets the <see cref="T:System.IO.TextWriter"/> where the log output will go.
- </summary>
- <remarks>
- <para>
- The specified <see cref="T:System.IO.TextWriter"/> must be open and writable.
- </para>
- <para>
- The <see cref="T:System.IO.TextWriter"/> will be closed when the appender
- instance is closed.
- </para>
- <para>
- <b>Note:</b> Logging to an unopened <see cref="T:System.IO.TextWriter"/> will fail.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TextWriterAppender.ErrorHandler">
- <summary>
- Gets or set the <see cref="T:log4net.Core.IErrorHandler"/> and the underlying
- <see cref="T:log4net.Util.QuietTextWriter"/>, if any, for this appender.
- </summary>
- <value>
- The <see cref="T:log4net.Core.IErrorHandler"/> for this appender.
- </value>
- </member>
- <member name="P:log4net.Appender.TextWriterAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TextWriterAppender.QuietWriter">
- <summary>
- Gets or sets the <see cref="T:log4net.Util.QuietTextWriter"/> where logging events
- will be written to.
- </summary>
- <value>
- The <see cref="T:log4net.Util.QuietTextWriter"/> where logging events are written.
- </value>
- <remarks>
- <para>
- This is the <see cref="T:log4net.Util.QuietTextWriter"/> where logging events
- will be written to.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.#ctor(log4net.Layout.ILayout,System.String,System.Boolean)">
- <summary>
- Construct a new appender using the layout, file and append mode.
- </summary>
- <param name="layout">the layout to use with this appender</param>
- <param name="filename">the full path to the file to write to</param>
- <param name="append">flag to indicate if the file should be appended to</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.#ctor(log4net.Layout.ILayout,System.String)">
- <summary>
- Construct a new appender using the layout and file specified.
- The file will be appended to.
- </summary>
- <param name="layout">the layout to use with this appender</param>
- <param name="filename">the full path to the file to write to</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ActivateOptions">
- <summary>
- Activate the options on the file appender.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.FileAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.FileAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.FileAppender.ActivateOptions"/> must be called again.
- </para>
- <para>
- This will cause the file to be opened.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.Reset">
- <summary>
- Closes any previously opened file and calls the parent's <see cref="M:log4net.Appender.TextWriterAppender.Reset"/>.
- </summary>
- <remarks>
- <para>
- Resets the filename and the file stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.PrepareWriter">
- <summary>
- Called to initialize the file writer
- </summary>
- <remarks>
- <para>
- Will be called for each logged message until the file is
- successfully opened.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/>
- method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes a log statement to the output stream if the output stream exists
- and is writable.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.Append(log4net.Core.LoggingEvent[])">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent[])"/>
- method.
- </summary>
- <param name="loggingEvents">The array of events to log.</param>
- <remarks>
- <para>
- Acquires the output file locks once before writing all the events to
- the stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.WriteFooter">
- <summary>
- Writes a footer as produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Footer"/> property.
- </summary>
- <remarks>
- <para>
- Writes a footer as produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Footer"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.WriteHeader">
- <summary>
- Writes a header produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Header"/> property.
- </summary>
- <remarks>
- <para>
- Writes a header produced by the embedded layout's <see cref="P:log4net.Layout.ILayout.Header"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.CloseWriter">
- <summary>
- Closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <remarks>
- <para>
- Closes the underlying <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.CloseFile">
- <summary>
- Closes the previously opened file.
- </summary>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Layout.ILayout.Footer"/> to the file and then
- closes the file.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.SafeOpenFile(System.String,System.Boolean)">
- <summary>
- Sets and <i>opens</i> the file where the log output will go. The specified file must be writable.
- </summary>
- <param name="fileName">The path to the log file. Must be a fully qualified path.</param>
- <param name="append">If true will append to fileName. Otherwise will truncate fileName</param>
- <remarks>
- <para>
- Calls <see cref="M:log4net.Appender.FileAppender.OpenFile(System.String,System.Boolean)"/> but guarantees not to throw an exception.
- Errors are passed to the <see cref="P:log4net.Appender.TextWriterAppender.ErrorHandler"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.OpenFile(System.String,System.Boolean)">
- <summary>
- Sets and <i>opens</i> the file where the log output will go. The specified file must be writable.
- </summary>
- <param name="fileName">The path to the log file. Must be a fully qualified path.</param>
- <param name="append">If true will append to fileName. Otherwise will truncate fileName</param>
- <remarks>
- <para>
- If there was already an opened file, then the previous file
- is closed first.
- </para>
- <para>
- This method will ensure that the directory structure
- for the <paramref name="fileName"/> specified exists.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.SetQWForFiles(System.IO.Stream)">
- <summary>
- Sets the quiet writer used for file output
- </summary>
- <param name="fileStream">the file stream that has been opened for writing</param>
- <remarks>
- <para>
- This implementation of <see cref="M:log4net.Appender.FileAppender.SetQWForFiles(System.IO.Stream)"/> creates a <see cref="T:System.IO.StreamWriter"/>
- over the <paramref name="fileStream"/> and passes it to the
- <see cref="M:log4net.Appender.FileAppender.SetQWForFiles(System.IO.TextWriter)"/> method.
- </para>
- <para>
- This method can be overridden by sub classes that want to wrap the
- <see cref="T:System.IO.Stream"/> in some way, for example to encrypt the output
- data using a <c>System.Security.Cryptography.CryptoStream</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.SetQWForFiles(System.IO.TextWriter)">
- <summary>
- Sets the quiet writer being used.
- </summary>
- <param name="writer">the writer over the file stream that has been opened for writing</param>
- <remarks>
- <para>
- This method can be overridden by sub classes that want to
- wrap the <see cref="T:System.IO.TextWriter"/> in some way.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ConvertToFullPath(System.String)">
- <summary>
- Convert a path into a fully qualified path.
- </summary>
- <param name="path">The path to convert.</param>
- <returns>The fully qualified path.</returns>
- <remarks>
- <para>
- Converts the path specified to a fully
- qualified path. If the path is relative it is
- taken as relative from the application base
- directory.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_appendToFile">
- <summary>
- Flag to indicate if we should append to the file
- or overwrite the file. The default is to append.
- </summary>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_fileName">
- <summary>
- The name of the log file.
- </summary>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_encoding">
- <summary>
- The encoding to use for the file stream.
- </summary>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_securityContext">
- <summary>
- The security context to use for privileged calls
- </summary>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_stream">
- <summary>
- The stream to log to. Has added locking semantics
- </summary>
- </member>
- <member name="F:log4net.Appender.FileAppender.m_lockingModel">
- <summary>
- The locking model to use
- </summary>
- </member>
- <member name="P:log4net.Appender.FileAppender.File">
- <summary>
- Gets or sets the path to the file that logging will be written to.
- </summary>
- <value>
- The path to the file that logging will be written to.
- </value>
- <remarks>
- <para>
- If the path is relative it is taken as relative from
- the application base directory.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.FileAppender.AppendToFile">
- <summary>
- Gets or sets a flag that indicates whether the file should be
- appended to or overwritten.
- </summary>
- <value>
- Indicates whether the file should be appended to or overwritten.
- </value>
- <remarks>
- <para>
- If the value is set to false then the file will be overwritten, if
- it is set to true then the file will be appended to.
- </para>
- The default value is true.
- </remarks>
- </member>
- <member name="P:log4net.Appender.FileAppender.Encoding">
- <summary>
- Gets or sets <see cref="P:log4net.Appender.FileAppender.Encoding"/> used to write to the file.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.FileAppender.Encoding"/> used to write to the file.
- </value>
- <remarks>
- <para>
- The default encoding set is <see cref="P:System.Text.Encoding.Default"/>
- which is the encoding for the system's current ANSI code page.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.FileAppender.SecurityContext">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.FileAppender.SecurityContext"/> used to write to the file.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.FileAppender.SecurityContext"/> used to write to the file.
- </value>
- <remarks>
- <para>
- Unless a <see cref="P:log4net.Appender.FileAppender.SecurityContext"/> specified here for this appender
- the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is queried for the
- security context to use. The default behavior is to use the security context
- of the current thread.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.FileAppender.LockingModel">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.FileAppender.LockingModel"/> used to handle locking of the file.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.FileAppender.LockingModel"/> used to lock the file.
- </value>
- <remarks>
- <para>
- Gets or sets the <see cref="P:log4net.Appender.FileAppender.LockingModel"/> used to handle locking of the file.
- </para>
- <para>
- There are two built in locking models, <see cref="T:log4net.Appender.FileAppender.ExclusiveLock"/> and <see cref="T:log4net.Appender.FileAppender.MinimalLock"/>.
- The former locks the file from the start of logging to the end and the
- later lock only for the minimal amount of time when logging each message.
- </para>
- <para>
- The default locking model is the <see cref="T:log4net.Appender.FileAppender.ExclusiveLock"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.FileAppender.LockingStream">
- <summary>
- Write only <see cref="T:System.IO.Stream"/> that uses the <see cref="T:log4net.Appender.FileAppender.LockingModelBase"/>
- to manage access to an underlying resource.
- </summary>
- </member>
- <member name="M:log4net.Appender.FileAppender.LockingStream.BeginWrite(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)">
- <summary>
- True asynchronous writes are not supported, the implementation forces a synchronous write.
- </summary>
- </member>
- <member name="T:log4net.Core.LogException">
- <summary>
- Exception base type for log4net.
- </summary>
- <remarks>
- <para>
- This type extends <see cref="T:System.ApplicationException"/>. It
- does not add any new functionality but does differentiate the
- type of exception being thrown.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.LogException.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LogException"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogException.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="message">A message to include with the exception.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LogException"/> class with
- the specified message.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogException.#ctor(System.String,System.Exception)">
- <summary>
- Constructor
- </summary>
- <param name="message">A message to include with the exception.</param>
- <param name="innerException">A nested exception to include.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LogException"/> class
- with the specified message and inner exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Serialization constructor
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
- <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LogException"/> class
- with serialized data.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.FileAppender.LockingModelBase">
- <summary>
- Locking model base class
- </summary>
- <remarks>
- <para>
- Base class for the locking models available to the <see cref="T:log4net.Appender.FileAppender"/> derived loggers.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.LockingModelBase.OpenFile(System.String,System.Boolean,System.Text.Encoding)">
- <summary>
- Open the output file
- </summary>
- <param name="filename">The filename to use</param>
- <param name="append">Whether to append to the file, or overwrite</param>
- <param name="encoding">The encoding to use</param>
- <remarks>
- <para>
- Open the file specified and prepare for logging.
- No writes will be made until <see cref="M:log4net.Appender.FileAppender.LockingModelBase.AcquireLock"/> is called.
- Must be called before any calls to <see cref="M:log4net.Appender.FileAppender.LockingModelBase.AcquireLock"/>,
- <see cref="M:log4net.Appender.FileAppender.LockingModelBase.ReleaseLock"/> and <see cref="M:log4net.Appender.FileAppender.LockingModelBase.CloseFile"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.LockingModelBase.CloseFile">
- <summary>
- Close the file
- </summary>
- <remarks>
- <para>
- Close the file. No further writes will be made.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.LockingModelBase.AcquireLock">
- <summary>
- Acquire the lock on the file
- </summary>
- <returns>A stream that is ready to be written to.</returns>
- <remarks>
- <para>
- Acquire the lock on the file in preparation for writing to it.
- Return a stream pointing to the file. <see cref="M:log4net.Appender.FileAppender.LockingModelBase.ReleaseLock"/>
- must be called to release the lock on the output file.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.LockingModelBase.ReleaseLock">
- <summary>
- Release the lock on the file
- </summary>
- <remarks>
- <para>
- Release the lock on the file. No further writes will be made to the
- stream until <see cref="M:log4net.Appender.FileAppender.LockingModelBase.AcquireLock"/> is called again.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.FileAppender.LockingModelBase.CurrentAppender">
- <summary>
- Gets or sets the <see cref="T:log4net.Appender.FileAppender"/> for this LockingModel
- </summary>
- <value>
- The <see cref="T:log4net.Appender.FileAppender"/> for this LockingModel
- </value>
- <remarks>
- <para>
- The file appender this locking model is attached to and working on
- behalf of.
- </para>
- <para>
- The file appender is used to locate the security context and the error handler to use.
- </para>
- <para>
- The value of this property will be set before <see cref="M:log4net.Appender.FileAppender.LockingModelBase.OpenFile(System.String,System.Boolean,System.Text.Encoding)"/> is
- called.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.FileAppender.ExclusiveLock">
- <summary>
- Hold an exclusive lock on the output file
- </summary>
- <remarks>
- <para>
- Open the file once for writing and hold it open until <see cref="M:log4net.Appender.FileAppender.ExclusiveLock.CloseFile"/> is called.
- Maintains an exclusive lock on the file during this time.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ExclusiveLock.OpenFile(System.String,System.Boolean,System.Text.Encoding)">
- <summary>
- Open the file specified and prepare for logging.
- </summary>
- <param name="filename">The filename to use</param>
- <param name="append">Whether to append to the file, or overwrite</param>
- <param name="encoding">The encoding to use</param>
- <remarks>
- <para>
- Open the file specified and prepare for logging.
- No writes will be made until <see cref="M:log4net.Appender.FileAppender.ExclusiveLock.AcquireLock"/> is called.
- Must be called before any calls to <see cref="M:log4net.Appender.FileAppender.ExclusiveLock.AcquireLock"/>,
- <see cref="M:log4net.Appender.FileAppender.ExclusiveLock.ReleaseLock"/> and <see cref="M:log4net.Appender.FileAppender.ExclusiveLock.CloseFile"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ExclusiveLock.CloseFile">
- <summary>
- Close the file
- </summary>
- <remarks>
- <para>
- Close the file. No further writes will be made.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ExclusiveLock.AcquireLock">
- <summary>
- Acquire the lock on the file
- </summary>
- <returns>A stream that is ready to be written to.</returns>
- <remarks>
- <para>
- Does nothing. The lock is already taken
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.ExclusiveLock.ReleaseLock">
- <summary>
- Release the lock on the file
- </summary>
- <remarks>
- <para>
- Does nothing. The lock will be released when the file is closed.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.FileAppender.MinimalLock">
- <summary>
- Acquires the file lock for each write
- </summary>
- <remarks>
- <para>
- Opens the file once for each <see cref="M:log4net.Appender.FileAppender.MinimalLock.AcquireLock"/>/<see cref="M:log4net.Appender.FileAppender.MinimalLock.ReleaseLock"/> cycle,
- thus holding the lock for the minimal amount of time. This method of locking
- is considerably slower than <see cref="T:log4net.Appender.FileAppender.ExclusiveLock"/> but allows
- other processes to move/delete the log file whilst logging continues.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.MinimalLock.OpenFile(System.String,System.Boolean,System.Text.Encoding)">
- <summary>
- Prepares to open the file when the first message is logged.
- </summary>
- <param name="filename">The filename to use</param>
- <param name="append">Whether to append to the file, or overwrite</param>
- <param name="encoding">The encoding to use</param>
- <remarks>
- <para>
- Open the file specified and prepare for logging.
- No writes will be made until <see cref="M:log4net.Appender.FileAppender.MinimalLock.AcquireLock"/> is called.
- Must be called before any calls to <see cref="M:log4net.Appender.FileAppender.MinimalLock.AcquireLock"/>,
- <see cref="M:log4net.Appender.FileAppender.MinimalLock.ReleaseLock"/> and <see cref="M:log4net.Appender.FileAppender.MinimalLock.CloseFile"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.MinimalLock.CloseFile">
- <summary>
- Close the file
- </summary>
- <remarks>
- <para>
- Close the file. No further writes will be made.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.MinimalLock.AcquireLock">
- <summary>
- Acquire the lock on the file
- </summary>
- <returns>A stream that is ready to be written to.</returns>
- <remarks>
- <para>
- Acquire the lock on the file in preparation for writing to it.
- Return a stream pointing to the file. <see cref="M:log4net.Appender.FileAppender.MinimalLock.ReleaseLock"/>
- must be called to release the lock on the output file.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.FileAppender.MinimalLock.ReleaseLock">
- <summary>
- Release the lock on the file
- </summary>
- <remarks>
- <para>
- Release the lock on the file. No further writes will be made to the
- stream until <see cref="M:log4net.Appender.FileAppender.MinimalLock.AcquireLock"/> is called again.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.ForwardingAppender">
- <summary>
- This appender forwards logging events to attached appenders.
- </summary>
- <remarks>
- <para>
- The forwarding appender can be used to specify different thresholds
- and filters for the same appender at different locations within the hierarchy.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.ForwardingAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.OnClose">
- <summary>
- Closes the appender and releases resources.
- </summary>
- <remarks>
- <para>
- Releases any resources allocated within the appender such as file handles,
- network connections, etc.
- </para>
- <para>
- It is a programming error to append to a closed appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Forward the logging event to the attached appenders
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Delivers the logging event to all the attached appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.Append(log4net.Core.LoggingEvent[])">
- <summary>
- Forward the logging events to the attached appenders
- </summary>
- <param name="loggingEvents">The array of events to log.</param>
- <remarks>
- <para>
- Delivers the logging events to all the attached appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.AddAppender(log4net.Appender.IAppender)">
- <summary>
- Adds an <see cref="T:log4net.Appender.IAppender"/> to the list of appenders of this
- instance.
- </summary>
- <param name="newAppender">The <see cref="T:log4net.Appender.IAppender"/> to add to this appender.</param>
- <remarks>
- <para>
- If the specified <see cref="T:log4net.Appender.IAppender"/> is already in the list of
- appenders, then it won't be added again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.GetAppender(System.String)">
- <summary>
- Looks for the appender with the specified name.
- </summary>
- <param name="name">The name of the appender to lookup.</param>
- <returns>
- The appender with the specified name, or <c>null</c>.
- </returns>
- <remarks>
- <para>
- Get the named appender attached to this appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.RemoveAllAppenders">
- <summary>
- Removes all previously added appenders from this appender.
- </summary>
- <remarks>
- <para>
- This is useful when re-reading configuration information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.RemoveAppender(log4net.Appender.IAppender)">
- <summary>
- Removes the specified appender from the list of appenders.
- </summary>
- <param name="appender">The appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </remarks>
- </member>
- <member name="M:log4net.Appender.ForwardingAppender.RemoveAppender(System.String)">
- <summary>
- Removes the appender with the specified name from the list of appenders.
- </summary>
- <param name="name">The name of the appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </remarks>
- </member>
- <member name="F:log4net.Appender.ForwardingAppender.m_appenderAttachedImpl">
- <summary>
- Implementation of the <see cref="T:log4net.Core.IAppenderAttachable"/> interface
- </summary>
- </member>
- <member name="P:log4net.Appender.ForwardingAppender.Appenders">
- <summary>
- Gets the appenders contained in this appender as an
- <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <remarks>
- If no appenders can be found, then an <see cref="T:log4net.Util.EmptyCollection"/>
- is returned.
- </remarks>
- <returns>
- A collection of the appenders in this appender.
- </returns>
- </member>
- <member name="T:log4net.Appender.LocalSyslogAppender">
- <summary>
- Logs events to a local syslog service.
- </summary>
- <remarks>
- <note>
- This appender uses the POSIX libc library functions <c>openlog</c>, <c>syslog</c>, and <c>closelog</c>.
- If these functions are not available on the local system then this appender will not work!
- </note>
- <para>
- The functions <c>openlog</c>, <c>syslog</c>, and <c>closelog</c> are specified in SUSv2 and
- POSIX 1003.1-2001 standards. These are used to log messages to the local syslog service.
- </para>
- <para>
- This appender talks to a local syslog service. If you need to log to a remote syslog
- daemon and you cannot configure your local syslog service to do this you may be
- able to use the <see cref="T:log4net.Appender.RemoteSyslogAppender"/> to log via UDP.
- </para>
- <para>
- Syslog messages must have a facility and and a severity. The severity
- is derived from the Level of the logging event.
- The facility must be chosen from the set of defined syslog
- <see cref="T:log4net.Appender.LocalSyslogAppender.SyslogFacility"/> values. The facilities list is predefined
- and cannot be extended.
- </para>
- <para>
- An identifier is specified with each log message. This can be specified
- by setting the <see cref="P:log4net.Appender.LocalSyslogAppender.Identity"/> property. The identity (also know
- as the tag) must not contain white space. The default value for the
- identity is the application name (from <see cref="P:log4net.Util.SystemInfo.ApplicationFriendlyName"/>).
- </para>
- </remarks>
- <author>Rob Lyon</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.LocalSyslogAppender"/> class.
- </summary>
- <remarks>
- This instance of the <see cref="T:log4net.Appender.LocalSyslogAppender"/> class is set up to write
- to a local syslog service.
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.AddMapping(log4net.Appender.LocalSyslogAppender.LevelSeverity)">
- <summary>
- Add a mapping of level to severity
- </summary>
- <param name="mapping">The mapping to add</param>
- <remarks>
- <para>
- Adds a <see cref="T:log4net.Appender.LocalSyslogAppender.LevelSeverity"/> to this appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.LocalSyslogAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.LocalSyslogAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.LocalSyslogAppender.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the event to a remote syslog daemon.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.OnClose">
- <summary>
- Close the syslog when the appender is closed
- </summary>
- <remarks>
- <para>
- Close the syslog when the appender is closed
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.GetSeverity(log4net.Core.Level)">
- <summary>
- Translates a log4net level to a syslog severity.
- </summary>
- <param name="level">A log4net level.</param>
- <returns>A syslog severity.</returns>
- <remarks>
- <para>
- Translates a log4net level to a syslog severity.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.GeneratePriority(log4net.Appender.LocalSyslogAppender.SyslogFacility,log4net.Appender.LocalSyslogAppender.SyslogSeverity)">
- <summary>
- Generate a syslog priority.
- </summary>
- <param name="facility">The syslog facility.</param>
- <param name="severity">The syslog severity.</param>
- <returns>A syslog priority.</returns>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.m_facility">
- <summary>
- The facility. The default facility is <see cref="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.User"/>.
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.m_identity">
- <summary>
- The message identity
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.m_handleToIdentity">
- <summary>
- Marshaled handle to the identity string. We have to hold on to the
- string as the <c>openlog</c> and <c>syslog</c> APIs just hold the
- pointer to the ident and dereference it for each log message.
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.m_levelMapping">
- <summary>
- Mapping from level object to syslog severity
- </summary>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.openlog(System.IntPtr,System.Int32,log4net.Appender.LocalSyslogAppender.SyslogFacility)">
- <summary>
- Open connection to system logger.
- </summary>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.syslog(System.Int32,System.String,System.String)">
- <summary>
- Generate a log message.
- </summary>
- <remarks>
- <para>
- The libc syslog method takes a format string and a variable argument list similar
- to the classic printf function. As this type of vararg list is not supported
- by C# we need to specify the arguments explicitly. Here we have specified the
- format string with a single message argument. The caller must set the format
- string to <c>"%s"</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.LocalSyslogAppender.closelog">
- <summary>
- Close descriptor used to write to system logger.
- </summary>
- </member>
- <member name="P:log4net.Appender.LocalSyslogAppender.Identity">
- <summary>
- Message identity
- </summary>
- <remarks>
- <para>
- An identifier is specified with each log message. This can be specified
- by setting the <see cref="P:log4net.Appender.LocalSyslogAppender.Identity"/> property. The identity (also know
- as the tag) must not contain white space. The default value for the
- identity is the application name (from <see cref="P:log4net.Util.SystemInfo.ApplicationFriendlyName"/>).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.LocalSyslogAppender.Facility">
- <summary>
- Syslog facility
- </summary>
- <remarks>
- Set to one of the <see cref="T:log4net.Appender.LocalSyslogAppender.SyslogFacility"/> values. The list of
- facilities is predefined and cannot be extended. The default value
- is <see cref="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.User"/>.
- </remarks>
- </member>
- <member name="P:log4net.Appender.LocalSyslogAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="P:log4net.Appender.AppenderSkeleton.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.LocalSyslogAppender.SyslogSeverity">
- <summary>
- syslog severities
- </summary>
- <remarks>
- <para>
- The log4net Level maps to a syslog severity using the
- <see cref="M:log4net.Appender.LocalSyslogAppender.AddMapping(log4net.Appender.LocalSyslogAppender.LevelSeverity)"/> method and the <see cref="T:log4net.Appender.LocalSyslogAppender.LevelSeverity"/>
- class. The severity is set on <see cref="P:log4net.Appender.LocalSyslogAppender.LevelSeverity.Severity"/>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Emergency">
- <summary>
- system is unusable
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Alert">
- <summary>
- action must be taken immediately
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Critical">
- <summary>
- critical conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Error">
- <summary>
- error conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Warning">
- <summary>
- warning conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Notice">
- <summary>
- normal but significant condition
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Informational">
- <summary>
- informational
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogSeverity.Debug">
- <summary>
- debug-level messages
- </summary>
- </member>
- <member name="T:log4net.Appender.LocalSyslogAppender.SyslogFacility">
- <summary>
- syslog facilities
- </summary>
- <remarks>
- <para>
- The syslog facility defines which subsystem the logging comes from.
- This is set on the <see cref="P:log4net.Appender.LocalSyslogAppender.Facility"/> property.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Kernel">
- <summary>
- kernel messages
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.User">
- <summary>
- random user-level messages
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Mail">
- <summary>
- mail system
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Daemons">
- <summary>
- system daemons
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Authorization">
- <summary>
- security/authorization messages
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Syslog">
- <summary>
- messages generated internally by syslogd
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Printer">
- <summary>
- line printer subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.News">
- <summary>
- network news subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Uucp">
- <summary>
- UUCP subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Clock">
- <summary>
- clock (cron/at) daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Authorization2">
- <summary>
- security/authorization messages (private)
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Ftp">
- <summary>
- ftp daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Ntp">
- <summary>
- NTP subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Audit">
- <summary>
- log audit
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Alert">
- <summary>
- log alert
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Clock2">
- <summary>
- clock daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local0">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local1">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local2">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local3">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local4">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local5">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local6">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.LocalSyslogAppender.SyslogFacility.Local7">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="T:log4net.Appender.LocalSyslogAppender.LevelSeverity">
- <summary>
- A class to act as a mapping between the level that a logging call is made at and
- the syslog severity that is should be logged at.
- </summary>
- <remarks>
- <para>
- A class to act as a mapping between the level that a logging call is made at and
- the syslog severity that is should be logged at.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.LocalSyslogAppender.LevelSeverity.Severity">
- <summary>
- The mapped syslog severity for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped syslog severity for the specified level
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.MemoryAppender">
- <summary>
- Stores logging events in an array.
- </summary>
- <remarks>
- <para>
- The memory appender stores all the logging events
- that are appended in an in-memory array.
- </para>
- <para>
- Use the <see cref="M:log4net.Appender.MemoryAppender.GetEvents"/> method to get
- the current list of events that have been appended.
- </para>
- <para>
- Use the <see cref="M:log4net.Appender.MemoryAppender.Clear"/> method to clear the
- current list of events.
- </para>
- </remarks>
- <author>Julian Biddle</author>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.MemoryAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.MemoryAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.MemoryAppender.GetEvents">
- <summary>
- Gets the events that have been logged.
- </summary>
- <returns>The events that have been logged</returns>
- <remarks>
- <para>
- Gets the events that have been logged.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.MemoryAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">the event to log</param>
- <remarks>
- <para>Stores the <paramref name="loggingEvent"/> in the events list.</para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.MemoryAppender.Clear">
- <summary>
- Clear the list of events
- </summary>
- <remarks>
- Clear the list of events
- </remarks>
- </member>
- <member name="F:log4net.Appender.MemoryAppender.m_eventsList">
- <summary>
- The list of events that have been appended.
- </summary>
- </member>
- <member name="F:log4net.Appender.MemoryAppender.m_fixFlags">
- <summary>
- Value indicating which fields in the event should be fixed
- </summary>
- <remarks>
- By default all fields are fixed
- </remarks>
- </member>
- <member name="P:log4net.Appender.MemoryAppender.OnlyFixPartialEventData">
- <summary>
- Gets or sets a value indicating whether only part of the logging event
- data should be fixed.
- </summary>
- <value>
- <c>true</c> if the appender should only fix part of the logging event
- data, otherwise <c>false</c>. The default is <c>false</c>.
- </value>
- <remarks>
- <para>
- Setting this property to <c>true</c> will cause only part of the event
- data to be fixed and stored in the appender, hereby improving performance.
- </para>
- <para>
- See <see cref="M:log4net.Core.LoggingEvent.FixVolatileData(System.Boolean)"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.MemoryAppender.Fix">
- <summary>
- Gets or sets the fields that will be fixed in the event
- </summary>
- <remarks>
- <para>
- The logging event needs to have certain thread specific values
- captured before it can be buffered. See <see cref="P:log4net.Core.LoggingEvent.Fix"/>
- for details.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.NetSendAppender">
- <summary>
- Logs entries by sending network messages using the
- <see cref="M:log4net.Appender.NetSendAppender.NetMessageBufferSend(System.String,System.String,System.String,System.String,System.Int32)"/> native function.
- </summary>
- <remarks>
- <para>
- You can send messages only to names that are active
- on the network. If you send the message to a user name,
- that user must be logged on and running the Messenger
- service to receive the message.
- </para>
- <para>
- The receiver will get a top most window displaying the
- messages one at a time, therefore this appender should
- not be used to deliver a high volume of messages.
- </para>
- <para>
- The following table lists some possible uses for this appender :
- </para>
- <para>
- <list type="table">
- <listheader>
- <term>Action</term>
- <description>Property Value(s)</description>
- </listheader>
- <item>
- <term>Send a message to a user account on the local machine</term>
- <description>
- <para>
- <paramref name="Server"/> = &lt;name of the local machine&gt;
- </para>
- <para>
- <paramref name="Recipient"/> = &lt;user name&gt;
- </para>
- </description>
- </item>
- <item>
- <term>Send a message to a user account on a remote machine</term>
- <description>
- <para>
- <paramref name="Server"/> = &lt;name of the remote machine&gt;
- </para>
- <para>
- <paramref name="Recipient"/> = &lt;user name&gt;
- </para>
- </description>
- </item>
- <item>
- <term>Send a message to a domain user account</term>
- <description>
- <para>
- <paramref name="Server"/> = &lt;name of a domain controller | uninitialized&gt;
- </para>
- <para>
- <paramref name="Recipient"/> = &lt;user name&gt;
- </para>
- </description>
- </item>
- <item>
- <term>Send a message to all the names in a workgroup or domain</term>
- <description>
- <para>
- <paramref name="Recipient"/> = &lt;workgroup name | domain name&gt;*
- </para>
- </description>
- </item>
- <item>
- <term>Send a message from the local machine to a remote machine</term>
- <description>
- <para>
- <paramref name="Server"/> = &lt;name of the local machine | uninitialized&gt;
- </para>
- <para>
- <paramref name="Recipient"/> = &lt;name of the remote machine&gt;
- </para>
- </description>
- </item>
- </list>
- </para>
- <para>
- <b>Note :</b> security restrictions apply for sending
- network messages, see <see cref="M:log4net.Appender.NetSendAppender.NetMessageBufferSend(System.String,System.String,System.String,System.String,System.Int32)"/>
- for more information.
- </para>
- </remarks>
- <example>
- <para>
- An example configuration section to log information
- using this appender from the local machine, named
- LOCAL_PC, to machine OPERATOR_PC :
- </para>
- <code lang="XML" escaped="true">
- <appender name="NetSendAppender_Operator" type="log4net.Appender.NetSendAppender">
- <server value="LOCAL_PC"/>
- <recipient value="OPERATOR_PC"/>
- <layout type="log4net.Layout.PatternLayout" value="%-5p %c [%x] - %m%n"/>
- </appender>
- </code>
- </example>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Appender.NetSendAppender.m_server">
- <summary>
- The DNS or NetBIOS name of the server on which the function is to execute.
- </summary>
- </member>
- <member name="F:log4net.Appender.NetSendAppender.m_sender">
- <summary>
- The sender of the network message.
- </summary>
- </member>
- <member name="F:log4net.Appender.NetSendAppender.m_recipient">
- <summary>
- The message alias to which the message should be sent.
- </summary>
- </member>
- <member name="F:log4net.Appender.NetSendAppender.m_securityContext">
- <summary>
- The security context to use for privileged calls
- </summary>
- </member>
- <member name="M:log4net.Appender.NetSendAppender.#ctor">
- <summary>
- Initializes the appender.
- </summary>
- <remarks>
- The default constructor initializes all fields to their default values.
- </remarks>
- </member>
- <member name="M:log4net.Appender.NetSendAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.NetSendAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.NetSendAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.NetSendAppender.ActivateOptions"/> must be called again.
- </para>
- <para>
- The appender will be ignored if no <see cref="P:log4net.Appender.NetSendAppender.Recipient"/> was specified.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">The required property <see cref="P:log4net.Appender.NetSendAppender.Recipient"/> was not specified.</exception>
- </member>
- <member name="M:log4net.Appender.NetSendAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Sends the event using a network message.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.NetSendAppender.NetMessageBufferSend(System.String,System.String,System.String,System.String,System.Int32)">
- <summary>
- Sends a buffer of information to a registered message alias.
- </summary>
- <param name="serverName">The DNS or NetBIOS name of the server on which the function is to execute.</param>
- <param name="msgName">The message alias to which the message buffer should be sent</param>
- <param name="fromName">The originator of the message.</param>
- <param name="buffer">The message text.</param>
- <param name="bufferSize">The length, in bytes, of the message text.</param>
- <remarks>
- <para>
- The following restrictions apply for sending network messages:
- </para>
- <para>
- <list type="table">
- <listheader>
- <term>Platform</term>
- <description>Requirements</description>
- </listheader>
- <item>
- <term>Windows NT</term>
- <description>
- <para>
- No special group membership is required to send a network message.
- </para>
- <para>
- Admin, Accounts, Print, or Server Operator group membership is required to
- successfully send a network message on a remote server.
- </para>
- </description>
- </item>
- <item>
- <term>Windows 2000 or later</term>
- <description>
- <para>
- If you send a message on a domain controller that is running Active Directory,
- access is allowed or denied based on the access control list (ACL) for the securable
- object. The default ACL permits only Domain Admins and Account Operators to send a network message.
- </para>
- <para>
- On a member server or workstation, only Administrators and Server Operators can send a network message.
- </para>
- </description>
- </item>
- </list>
- </para>
- <para>
- For more information see <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/netmgmt/security_requirements_for_the_network_management_functions.asp">Security Requirements for the Network Management Functions</a>.
- </para>
- </remarks>
- <returns>
- <para>
- If the function succeeds, the return value is zero.
- </para>
- </returns>
- </member>
- <member name="P:log4net.Appender.NetSendAppender.Sender">
- <summary>
- Gets or sets the sender of the message.
- </summary>
- <value>
- The sender of the message.
- </value>
- <remarks>
- If this property is not specified, the message is sent from the local computer.
- </remarks>
- </member>
- <member name="P:log4net.Appender.NetSendAppender.Recipient">
- <summary>
- Gets or sets the message alias to which the message should be sent.
- </summary>
- <value>
- The recipient of the message.
- </value>
- <remarks>
- This property should always be specified in order to send a message.
- </remarks>
- </member>
- <member name="P:log4net.Appender.NetSendAppender.Server">
- <summary>
- Gets or sets the DNS or NetBIOS name of the remote server on which the function is to execute.
- </summary>
- <value>
- DNS or NetBIOS name of the remote server on which the function is to execute.
- </value>
- <remarks>
- <para>
- For Windows NT 4.0 and earlier, the string should begin with \\.
- </para>
- <para>
- If this property is not specified, the local computer is used.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.NetSendAppender.SecurityContext">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.NetSendAppender.SecurityContext"/> used to call the NetSend method.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.NetSendAppender.SecurityContext"/> used to call the NetSend method.
- </value>
- <remarks>
- <para>
- Unless a <see cref="P:log4net.Appender.NetSendAppender.SecurityContext"/> specified here for this appender
- the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is queried for the
- security context to use. The default behavior is to use the security context
- of the current thread.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.NetSendAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.OutputDebugStringAppender">
- <summary>
- Appends log events to the OutputDebugString system.
- </summary>
- <remarks>
- <para>
- OutputDebugStringAppender appends log events to the
- OutputDebugString system.
- </para>
- <para>
- The string is passed to the native <c>OutputDebugString</c>
- function.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.OutputDebugStringAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.OutputDebugStringAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.OutputDebugStringAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Write the logging event to the output debug string API
- </summary>
- <param name="loggingEvent">the event to log</param>
- <remarks>
- <para>
- Write the logging event to the output debug string API
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.OutputDebugStringAppender.OutputDebugString(System.String)">
- <summary>
- Stub for OutputDebugString native method
- </summary>
- <param name="message">the string to output</param>
- <remarks>
- <para>
- Stub for OutputDebugString native method
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.OutputDebugStringAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RemoteSyslogAppender">
- <summary>
- Logs events to a remote syslog daemon.
- </summary>
- <remarks>
- <para>
- The BSD syslog protocol is used to remotely log to
- a syslog daemon. The syslogd listens for for messages
- on UDP port 514.
- </para>
- <para>
- The syslog UDP protocol is not authenticated. Most syslog daemons
- do not accept remote log messages because of the security implications.
- You may be able to use the LocalSyslogAppender to talk to a local
- syslog service.
- </para>
- <para>
- There is an RFC 3164 that claims to document the BSD Syslog Protocol.
- This RFC can be seen here: http://www.faqs.org/rfcs/rfc3164.html.
- This appender generates what the RFC calls an "Original Device Message",
- i.e. does not include the TIMESTAMP or HOSTNAME fields. By observation
- this format of message will be accepted by all current syslog daemon
- implementations. The daemon will attach the current time and the source
- hostname or IP address to any messages received.
- </para>
- <para>
- Syslog messages must have a facility and and a severity. The severity
- is derived from the Level of the logging event.
- The facility must be chosen from the set of defined syslog
- <see cref="T:log4net.Appender.RemoteSyslogAppender.SyslogFacility"/> values. The facilities list is predefined
- and cannot be extended.
- </para>
- <para>
- An identifier is specified with each log message. This can be specified
- by setting the <see cref="P:log4net.Appender.RemoteSyslogAppender.Identity"/> property. The identity (also know
- as the tag) must not contain white space. The default value for the
- identity is the application name (from <see cref="P:log4net.Core.LoggingEvent.Domain"/>).
- </para>
- </remarks>
- <author>Rob Lyon</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Appender.UdpAppender">
- <summary>
- Sends logging events as connectionless UDP datagrams to a remote host or a
- multicast group using an <see cref="T:System.Net.Sockets.UdpClient"/>.
- </summary>
- <remarks>
- <para>
- UDP guarantees neither that messages arrive, nor that they arrive in the correct order.
- </para>
- <para>
- To view the logging results, a custom application can be developed that listens for logging
- events.
- </para>
- <para>
- When decoding events send via this appender remember to use the same encoding
- to decode the events as was used to send the events. See the <see cref="P:log4net.Appender.UdpAppender.Encoding"/>
- property to specify the encoding to use.
- </para>
- </remarks>
- <example>
- This example shows how to log receive logging events that are sent
- on IP address 244.0.0.1 and port 8080 to the console. The event is
- encoded in the packet as a unicode string and it is decoded as such.
- <code lang="C#">
- IPEndPoint remoteEndPoint = new IPEndPoint(IPAddress.Any, 0);
- UdpClient udpClient;
- byte[] buffer;
- string loggingEvent;
-
- try
- {
- udpClient = new UdpClient(8080);
-
- while(true)
- {
- buffer = udpClient.Receive(ref remoteEndPoint);
- loggingEvent = System.Text.Encoding.Unicode.GetString(buffer);
- Console.WriteLine(loggingEvent);
- }
- }
- catch(Exception e)
- {
- Console.WriteLine(e.ToString());
- }
- </code>
- <code lang="Visual Basic">
- Dim remoteEndPoint as IPEndPoint
- Dim udpClient as UdpClient
- Dim buffer as Byte()
- Dim loggingEvent as String
-
- Try
- remoteEndPoint = new IPEndPoint(IPAddress.Any, 0)
- udpClient = new UdpClient(8080)
-
- While True
- buffer = udpClient.Receive(ByRef remoteEndPoint)
- loggingEvent = System.Text.Encoding.Unicode.GetString(buffer)
- Console.WriteLine(loggingEvent)
- Wend
- Catch e As Exception
- Console.WriteLine(e.ToString())
- End Try
- </code>
- <para>
- An example configuration section to log information using this appender to the
- IP 224.0.0.1 on port 8080:
- </para>
- <code lang="XML" escaped="true">
- <appender name="UdpAppender" type="log4net.Appender.UdpAppender">
- <remoteAddress value="224.0.0.1"/>
- <remotePort value="8080"/>
- <layout type="log4net.Layout.PatternLayout" value="%-5level %logger [%ndc] - %message%newline"/>
- </appender>
- </code>
- </example>
- <author>Gert Driesen</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.UdpAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.UdpAppender"/> class.
- </summary>
- <remarks>
- The default constructor initializes all fields to their default values.
- </remarks>
- </member>
- <member name="M:log4net.Appender.UdpAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.UdpAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.UdpAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.UdpAppender.ActivateOptions"/> must be called again.
- </para>
- <para>
- The appender will be ignored if no <see cref="P:log4net.Appender.UdpAppender.RemoteAddress"/> was specified or
- an invalid remote or local TCP port number was specified.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">The required property <see cref="P:log4net.Appender.UdpAppender.RemoteAddress"/> was not specified.</exception>
- <exception cref="T:System.ArgumentOutOfRangeException">The TCP port number assigned to <see cref="P:log4net.Appender.UdpAppender.LocalPort"/> or <see cref="P:log4net.Appender.UdpAppender.RemotePort"/> is less than <see cref="F:System.Net.IPEndPoint.MinPort"/> or greater than <see cref="F:System.Net.IPEndPoint.MaxPort"/>.</exception>
- </member>
- <member name="M:log4net.Appender.UdpAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Sends the event using an UDP datagram.
- </para>
- <para>
- Exceptions are passed to the <see cref="P:log4net.Appender.AppenderSkeleton.ErrorHandler"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.UdpAppender.OnClose">
- <summary>
- Closes the UDP connection and releases all resources associated with
- this <see cref="T:log4net.Appender.UdpAppender"/> instance.
- </summary>
- <remarks>
- <para>
- Disables the underlying <see cref="T:System.Net.Sockets.UdpClient"/> and releases all managed
- and unmanaged resources associated with the <see cref="T:log4net.Appender.UdpAppender"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.UdpAppender.InitializeClientConnection">
- <summary>
- Initializes the underlying <see cref="T:System.Net.Sockets.UdpClient"/> connection.
- </summary>
- <remarks>
- <para>
- The underlying <see cref="T:System.Net.Sockets.UdpClient"/> is initialized and binds to the
- port number from which you intend to communicate.
- </para>
- <para>
- Exceptions are passed to the <see cref="P:log4net.Appender.AppenderSkeleton.ErrorHandler"/>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_remoteAddress">
- <summary>
- The IP address of the remote host or multicast group to which
- the logging event will be sent.
- </summary>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_remotePort">
- <summary>
- The TCP port number of the remote host or multicast group to
- which the logging event will be sent.
- </summary>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_remoteEndPoint">
- <summary>
- The cached remote endpoint to which the logging events will be sent.
- </summary>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_localPort">
- <summary>
- The TCP port number from which the <see cref="T:System.Net.Sockets.UdpClient"/> will communicate.
- </summary>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_client">
- <summary>
- The <see cref="T:System.Net.Sockets.UdpClient"/> instance that will be used for sending the
- logging events.
- </summary>
- </member>
- <member name="F:log4net.Appender.UdpAppender.m_encoding">
- <summary>
- The encoding to use for the packet.
- </summary>
- </member>
- <member name="P:log4net.Appender.UdpAppender.RemoteAddress">
- <summary>
- Gets or sets the IP address of the remote host or multicast group to which
- the underlying <see cref="T:System.Net.Sockets.UdpClient"/> should sent the logging event.
- </summary>
- <value>
- The IP address of the remote host or multicast group to which the logging event
- will be sent.
- </value>
- <remarks>
- <para>
- Multicast addresses are identified by IP class <b>D</b> addresses (in the range 224.0.0.0 to
- 239.255.255.255). Multicast packets can pass across different networks through routers, so
- it is possible to use multicasts in an Internet scenario as long as your network provider
- supports multicasting.
- </para>
- <para>
- Hosts that want to receive particular multicast messages must register their interest by joining
- the multicast group. Multicast messages are not sent to networks where no host has joined
- the multicast group. Class <b>D</b> IP addresses are used for multicast groups, to differentiate
- them from normal host addresses, allowing nodes to easily detect if a message is of interest.
- </para>
- <para>
- Static multicast addresses that are needed globally are assigned by IANA. A few examples are listed in the table below:
- </para>
- <para>
- <list type="table">
- <listheader>
- <term>IP Address</term>
- <description>Description</description>
- </listheader>
- <item>
- <term>224.0.0.1</term>
- <description>
- <para>
- Sends a message to all system on the subnet.
- </para>
- </description>
- </item>
- <item>
- <term>224.0.0.2</term>
- <description>
- <para>
- Sends a message to all routers on the subnet.
- </para>
- </description>
- </item>
- <item>
- <term>224.0.0.12</term>
- <description>
- <para>
- The DHCP server answers messages on the IP address 224.0.0.12, but only on a subnet.
- </para>
- </description>
- </item>
- </list>
- </para>
- <para>
- A complete list of actually reserved multicast addresses and their owners in the ranges
- defined by RFC 3171 can be found at the <A href="http://www.iana.org/assignments/multicast-addresses">IANA web site</A>.
- </para>
- <para>
- The address range 239.0.0.0 to 239.255.255.255 is reserved for administrative scope-relative
- addresses. These addresses can be reused with other local groups. Routers are typically
- configured with filters to prevent multicast traffic in this range from flowing outside
- of the local network.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.UdpAppender.RemotePort">
- <summary>
- Gets or sets the TCP port number of the remote host or multicast group to which
- the underlying <see cref="T:System.Net.Sockets.UdpClient"/> should sent the logging event.
- </summary>
- <value>
- An integer value in the range <see cref="F:System.Net.IPEndPoint.MinPort"/> to <see cref="F:System.Net.IPEndPoint.MaxPort"/>
- indicating the TCP port number of the remote host or multicast group to which the logging event
- will be sent.
- </value>
- <remarks>
- The underlying <see cref="T:System.Net.Sockets.UdpClient"/> will send messages to this TCP port number
- on the remote host or multicast group.
- </remarks>
- <exception cref="T:System.ArgumentOutOfRangeException">The value specified is less than <see cref="F:System.Net.IPEndPoint.MinPort"/> or greater than <see cref="F:System.Net.IPEndPoint.MaxPort"/>.</exception>
- </member>
- <member name="P:log4net.Appender.UdpAppender.LocalPort">
- <summary>
- Gets or sets the TCP port number from which the underlying <see cref="T:System.Net.Sockets.UdpClient"/> will communicate.
- </summary>
- <value>
- An integer value in the range <see cref="F:System.Net.IPEndPoint.MinPort"/> to <see cref="F:System.Net.IPEndPoint.MaxPort"/>
- indicating the TCP port number from which the underlying <see cref="T:System.Net.Sockets.UdpClient"/> will communicate.
- </value>
- <remarks>
- <para>
- The underlying <see cref="T:System.Net.Sockets.UdpClient"/> will bind to this port for sending messages.
- </para>
- <para>
- Setting the value to 0 (the default) will cause the udp client not to bind to
- a local port.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentOutOfRangeException">The value specified is less than <see cref="F:System.Net.IPEndPoint.MinPort"/> or greater than <see cref="F:System.Net.IPEndPoint.MaxPort"/>.</exception>
- </member>
- <member name="P:log4net.Appender.UdpAppender.Encoding">
- <summary>
- Gets or sets <see cref="P:log4net.Appender.UdpAppender.Encoding"/> used to write the packets.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.UdpAppender.Encoding"/> used to write the packets.
- </value>
- <remarks>
- <para>
- The <see cref="P:log4net.Appender.UdpAppender.Encoding"/> used to write the packets.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.UdpAppender.Client">
- <summary>
- Gets or sets the underlying <see cref="T:System.Net.Sockets.UdpClient"/>.
- </summary>
- <value>
- The underlying <see cref="T:System.Net.Sockets.UdpClient"/>.
- </value>
- <remarks>
- <see cref="T:log4net.Appender.UdpAppender"/> creates a <see cref="T:System.Net.Sockets.UdpClient"/> to send logging events
- over a network. Classes deriving from <see cref="T:log4net.Appender.UdpAppender"/> can use this
- property to get or set this <see cref="T:System.Net.Sockets.UdpClient"/>. Use the underlying <see cref="T:System.Net.Sockets.UdpClient"/>
- returned from <see cref="P:log4net.Appender.UdpAppender.Client"/> if you require access beyond that which
- <see cref="T:log4net.Appender.UdpAppender"/> provides.
- </remarks>
- </member>
- <member name="P:log4net.Appender.UdpAppender.RemoteEndPoint">
- <summary>
- Gets or sets the cached remote endpoint to which the logging events should be sent.
- </summary>
- <value>
- The cached remote endpoint to which the logging events will be sent.
- </value>
- <remarks>
- The <see cref="M:log4net.Appender.UdpAppender.ActivateOptions"/> method will initialize the remote endpoint
- with the values of the <see cref="P:log4net.Appender.UdpAppender.RemoteAddress"/> and <see cref="P:log4net.Appender.UdpAppender.RemotePort"/>
- properties.
- </remarks>
- </member>
- <member name="P:log4net.Appender.UdpAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.DefaultSyslogPort">
- <summary>
- Syslog port 514
- </summary>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.RemoteSyslogAppender"/> class.
- </summary>
- <remarks>
- This instance of the <see cref="T:log4net.Appender.RemoteSyslogAppender"/> class is set up to write
- to a remote syslog daemon.
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.AddMapping(log4net.Appender.RemoteSyslogAppender.LevelSeverity)">
- <summary>
- Add a mapping of level to severity
- </summary>
- <param name="mapping">The mapping to add</param>
- <remarks>
- <para>
- Add a <see cref="T:log4net.Appender.RemoteSyslogAppender.LevelSeverity"/> mapping to this appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- This method is called by the <see cref="M:log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the event to a remote syslog daemon.
- </para>
- <para>
- The format of the output will depend on the appender's layout.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.ActivateOptions">
- <summary>
- Initialize the options for this appender
- </summary>
- <remarks>
- <para>
- Initialize the level to syslog severity mappings set on this appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.GetSeverity(log4net.Core.Level)">
- <summary>
- Translates a log4net level to a syslog severity.
- </summary>
- <param name="level">A log4net level.</param>
- <returns>A syslog severity.</returns>
- <remarks>
- <para>
- Translates a log4net level to a syslog severity.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemoteSyslogAppender.GeneratePriority(log4net.Appender.RemoteSyslogAppender.SyslogFacility,log4net.Appender.RemoteSyslogAppender.SyslogSeverity)">
- <summary>
- Generate a syslog priority.
- </summary>
- <param name="facility">The syslog facility.</param>
- <param name="severity">The syslog severity.</param>
- <returns>A syslog priority.</returns>
- <remarks>
- <para>
- Generate a syslog priority.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.m_facility">
- <summary>
- The facility. The default facility is <see cref="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.User"/>.
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.m_identity">
- <summary>
- The message identity
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.m_levelMapping">
- <summary>
- Mapping from level object to syslog severity
- </summary>
- </member>
- <member name="P:log4net.Appender.RemoteSyslogAppender.Identity">
- <summary>
- Message identity
- </summary>
- <remarks>
- <para>
- An identifier is specified with each log message. This can be specified
- by setting the <see cref="P:log4net.Appender.RemoteSyslogAppender.Identity"/> property. The identity (also know
- as the tag) must not contain white space. The default value for the
- identity is the application name (from <see cref="P:log4net.Core.LoggingEvent.Domain"/>).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RemoteSyslogAppender.Facility">
- <summary>
- Syslog facility
- </summary>
- <remarks>
- Set to one of the <see cref="T:log4net.Appender.RemoteSyslogAppender.SyslogFacility"/> values. The list of
- facilities is predefined and cannot be extended. The default value
- is <see cref="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.User"/>.
- </remarks>
- </member>
- <member name="T:log4net.Appender.RemoteSyslogAppender.SyslogSeverity">
- <summary>
- syslog severities
- </summary>
- <remarks>
- <para>
- The syslog severities.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Emergency">
- <summary>
- system is unusable
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Alert">
- <summary>
- action must be taken immediately
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Critical">
- <summary>
- critical conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Error">
- <summary>
- error conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Warning">
- <summary>
- warning conditions
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Notice">
- <summary>
- normal but significant condition
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Informational">
- <summary>
- informational
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogSeverity.Debug">
- <summary>
- debug-level messages
- </summary>
- </member>
- <member name="T:log4net.Appender.RemoteSyslogAppender.SyslogFacility">
- <summary>
- syslog facilities
- </summary>
- <remarks>
- <para>
- The syslog facilities
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Kernel">
- <summary>
- kernel messages
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.User">
- <summary>
- random user-level messages
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Mail">
- <summary>
- mail system
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Daemons">
- <summary>
- system daemons
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Authorization">
- <summary>
- security/authorization messages
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Syslog">
- <summary>
- messages generated internally by syslogd
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Printer">
- <summary>
- line printer subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.News">
- <summary>
- network news subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Uucp">
- <summary>
- UUCP subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Clock">
- <summary>
- clock (cron/at) daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Authorization2">
- <summary>
- security/authorization messages (private)
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Ftp">
- <summary>
- ftp daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Ntp">
- <summary>
- NTP subsystem
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Audit">
- <summary>
- log audit
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Alert">
- <summary>
- log alert
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Clock2">
- <summary>
- clock daemon
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local0">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local1">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local2">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local3">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local4">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local5">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local6">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="F:log4net.Appender.RemoteSyslogAppender.SyslogFacility.Local7">
- <summary>
- reserved for local use
- </summary>
- </member>
- <member name="T:log4net.Appender.RemoteSyslogAppender.LevelSeverity">
- <summary>
- A class to act as a mapping between the level that a logging call is made at and
- the syslog severity that is should be logged at.
- </summary>
- <remarks>
- <para>
- A class to act as a mapping between the level that a logging call is made at and
- the syslog severity that is should be logged at.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RemoteSyslogAppender.LevelSeverity.Severity">
- <summary>
- The mapped syslog severity for the specified level
- </summary>
- <remarks>
- <para>
- Required property.
- The mapped syslog severity for the specified level
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RemotingAppender">
- <summary>
- Delivers logging events to a remote logging sink.
- </summary>
- <remarks>
- <para>
- This Appender is designed to deliver events to a remote sink.
- That is any object that implements the <see cref="T:log4net.Appender.RemotingAppender.IRemoteLoggingSink"/>
- interface. It delivers the events using .NET remoting. The
- object to deliver events to is specified by setting the
- appenders <see cref="P:log4net.Appender.RemotingAppender.Sink"/> property.</para>
- <para>
- The RemotingAppender buffers events before sending them. This allows it to
- make more efficient use of the remoting infrastructure.</para>
- <para>
- Once the buffer is full the events are still not sent immediately.
- They are scheduled to be sent using a pool thread. The effect is that
- the send occurs asynchronously. This is very important for a
- number of non obvious reasons. The remoting infrastructure will
- flow thread local variables (stored in the <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/>),
- if they are marked as <see cref="T:System.Runtime.Remoting.Messaging.ILogicalThreadAffinative"/>, across the
- remoting boundary. If the server is not contactable then
- the remoting infrastructure will clear the <see cref="T:System.Runtime.Remoting.Messaging.ILogicalThreadAffinative"/>
- objects from the <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/>. To prevent a logging failure from
- having side effects on the calling application the remoting call must be made
- from a separate thread to the one used by the application. A <see cref="T:System.Threading.ThreadPool"/>
- thread is used for this. If no <see cref="T:System.Threading.ThreadPool"/> thread is available then
- the events will block in the thread pool manager until a thread is available.</para>
- <para>
- Because the events are sent asynchronously using pool threads it is possible to close
- this appender before all the queued events have been sent.
- When closing the appender attempts to wait until all the queued events have been sent, but
- this will timeout after 30 seconds regardless.</para>
- <para>
- If this appender is being closed because the <see cref="E:System.AppDomain.ProcessExit"/>
- event has fired it may not be possible to send all the queued events. During process
- exit the runtime limits the time that a <see cref="E:System.AppDomain.ProcessExit"/>
- event handler is allowed to run for. If the runtime terminates the threads before
- the queued events have been sent then they will be lost. To ensure that all events
- are sent the appender must be closed before the application exits. See
- <see cref="M:log4net.Core.LoggerManager.Shutdown"/> for details on how to shutdown
- log4net programmatically.</para>
- </remarks>
- <seealso cref="T:log4net.Appender.RemotingAppender.IRemoteLoggingSink"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Daniel Cazzulino</author>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.RemotingAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.RemotingAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.RemotingAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.RemotingAppender.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Send the contents of the buffer to the remote sink.
- </summary>
- <remarks>
- The events are not sent immediately. They are scheduled to be sent
- using a pool thread. The effect is that the send occurs asynchronously.
- This is very important for a number of non obvious reasons. The remoting
- infrastructure will flow thread local variables (stored in the <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/>),
- if they are marked as <see cref="T:System.Runtime.Remoting.Messaging.ILogicalThreadAffinative"/>, across the
- remoting boundary. If the server is not contactable then
- the remoting infrastructure will clear the <see cref="T:System.Runtime.Remoting.Messaging.ILogicalThreadAffinative"/>
- objects from the <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/>. To prevent a logging failure from
- having side effects on the calling application the remoting call must be made
- from a separate thread to the one used by the application. A <see cref="T:System.Threading.ThreadPool"/>
- thread is used for this. If no <see cref="T:System.Threading.ThreadPool"/> thread is available then
- the events will block in the thread pool manager until a thread is available.
- </remarks>
- <param name="events">The events to send.</param>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.OnClose">
- <summary>
- Override base class close.
- </summary>
- <remarks>
- <para>
- This method waits while there are queued work items. The events are
- sent asynchronously using <see cref="T:System.Threading.ThreadPool"/> work items. These items
- will be sent once a thread pool thread is available to send them, therefore
- it is possible to close the appender before all the queued events have been
- sent.</para>
- <para>
- This method attempts to wait until all the queued events have been sent, but this
- method will timeout after 30 seconds regardless.</para>
- <para>
- If the appender is being closed because the <see cref="E:System.AppDomain.ProcessExit"/>
- event has fired it may not be possible to send all the queued events. During process
- exit the runtime limits the time that a <see cref="E:System.AppDomain.ProcessExit"/>
- event handler is allowed to run for.</para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.BeginAsyncSend">
- <summary>
- A work item is being queued into the thread pool
- </summary>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.EndAsyncSend">
- <summary>
- A work item from the thread pool has completed
- </summary>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.SendBufferCallback(System.Object)">
- <summary>
- Send the contents of the buffer to the remote sink.
- </summary>
- <remarks>
- This method is designed to be used with the <see cref="T:System.Threading.ThreadPool"/>.
- This method expects to be passed an array of <see cref="T:log4net.Core.LoggingEvent"/>
- objects in the state param.
- </remarks>
- <param name="state">the logging events to send</param>
- </member>
- <member name="F:log4net.Appender.RemotingAppender.m_sinkUrl">
- <summary>
- The URL of the remote sink.
- </summary>
- </member>
- <member name="F:log4net.Appender.RemotingAppender.m_sinkObj">
- <summary>
- The local proxy (.NET remoting) for the remote logging sink.
- </summary>
- </member>
- <member name="F:log4net.Appender.RemotingAppender.m_queuedCallbackCount">
- <summary>
- The number of queued callbacks currently waiting or executing
- </summary>
- </member>
- <member name="F:log4net.Appender.RemotingAppender.m_workQueueEmptyEvent">
- <summary>
- Event used to signal when there are no queued work items
- </summary>
- <remarks>
- This event is set when there are no queued work items. In this
- state it is safe to close the appender.
- </remarks>
- </member>
- <member name="P:log4net.Appender.RemotingAppender.Sink">
- <summary>
- Gets or sets the URL of the well-known object that will accept
- the logging events.
- </summary>
- <value>
- The well-known URL of the remote sink.
- </value>
- <remarks>
- <para>
- The URL of the remoting sink that will accept logging events.
- The sink must implement the <see cref="T:log4net.Appender.RemotingAppender.IRemoteLoggingSink"/>
- interface.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RemotingAppender.IRemoteLoggingSink">
- <summary>
- Interface used to deliver <see cref="T:log4net.Core.LoggingEvent"/> objects to a remote sink.
- </summary>
- <remarks>
- This interface must be implemented by a remoting sink
- if the <see cref="T:log4net.Appender.RemotingAppender"/> is to be used
- to deliver logging events to the sink.
- </remarks>
- </member>
- <member name="M:log4net.Appender.RemotingAppender.IRemoteLoggingSink.LogEvents(log4net.Core.LoggingEvent[])">
- <summary>
- Delivers logging events to the remote sink
- </summary>
- <param name="events">Array of events to log.</param>
- <remarks>
- <para>
- Delivers logging events to the remote sink
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RollingFileAppender">
- <summary>
- Appender that rolls log files based on size or date or both.
- </summary>
- <remarks>
- <para>
- RollingFileAppender can roll log files based on size or date or both
- depending on the setting of the <see cref="P:log4net.Appender.RollingFileAppender.RollingStyle"/> property.
- When set to <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Size"/> the log file will be rolled
- once its size exceeds the <see cref="P:log4net.Appender.RollingFileAppender.MaximumFileSize"/>.
- When set to <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Date"/> the log file will be rolled
- once the date boundary specified in the <see cref="P:log4net.Appender.RollingFileAppender.DatePattern"/> property
- is crossed.
- When set to <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Composite"/> the log file will be
- rolled once the date boundary specified in the <see cref="P:log4net.Appender.RollingFileAppender.DatePattern"/> property
- is crossed, but within a date boundary the file will also be rolled
- once its size exceeds the <see cref="P:log4net.Appender.RollingFileAppender.MaximumFileSize"/>.
- When set to <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Once"/> the log file will be rolled when
- the appender is configured. This effectively means that the log file can be
- rolled once per program execution.
- </para>
- <para>
- A of few additional optional features have been added:
- <list type="bullet">
- <item>Attach date pattern for current log file <see cref="P:log4net.Appender.RollingFileAppender.StaticLogFileName"/></item>
- <item>Backup number increments for newer files <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/></item>
- <item>Infinite number of backups by file size <see cref="P:log4net.Appender.RollingFileAppender.MaxSizeRollBackups"/></item>
- </list>
- </para>
-
- <note>
- <para>
- For large or infinite numbers of backup files a <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/>
- greater than zero is highly recommended, otherwise all the backup files need
- to be renamed each time a new backup is created.
- </para>
- <para>
- When Date/Time based rolling is used setting <see cref="P:log4net.Appender.RollingFileAppender.StaticLogFileName"/>
- to <see langword="true"/> will reduce the number of file renamings to few or none.
- </para>
- </note>
-
- <note type="caution">
- <para>
- Changing <see cref="P:log4net.Appender.RollingFileAppender.StaticLogFileName"/> or <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/> without clearing
- the log file directory of backup files will cause unexpected and unwanted side effects.
- </para>
- </note>
-
- <para>
- If Date/Time based rolling is enabled this appender will attempt to roll existing files
- in the directory without a Date/Time tag based on the last write date of the base log file.
- The appender only rolls the log file when a message is logged. If Date/Time based rolling
- is enabled then the appender will not roll the log file at the Date/Time boundary but
- at the point when the next message is logged after the boundary has been crossed.
- </para>
-
- <para>
- The <see cref="T:log4net.Appender.RollingFileAppender"/> extends the <see cref="T:log4net.Appender.FileAppender"/> and
- has the same behavior when opening the log file.
- The appender will first try to open the file for writing when <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/>
- is called. This will typically be during configuration.
- If the file cannot be opened for writing the appender will attempt
- to open the file again each time a message is logged to the appender.
- If the file cannot be opened for writing when a message is logged then
- the message will be discarded by this appender.
- </para>
- <para>
- When rolling a backup file necessitates deleting an older backup file the
- file to be deleted is moved to a temporary name before being deleted.
- </para>
-
- <note type="caution">
- <para>
- A maximum number of backup files when rolling on date/time boundaries is not supported.
- </para>
- </note>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Aspi Havewala</author>
- <author>Douglas de la Torre</author>
- <author>Edward Smit</author>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.RollingFileAppender"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.SetQWForFiles(System.IO.TextWriter)">
- <summary>
- Sets the quiet writer being used.
- </summary>
- <remarks>
- This method can be overridden by sub classes.
- </remarks>
- <param name="writer">the writer to set</param>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Write out a logging event.
- </summary>
- <param name="loggingEvent">the event to write to file.</param>
- <remarks>
- <para>
- Handles append time behavior for RollingFileAppender. This checks
- if a roll over either by date (checked first) or time (checked second)
- is need and then appends to the file last.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.Append(log4net.Core.LoggingEvent[])">
- <summary>
- Write out an array of logging events.
- </summary>
- <param name="loggingEvents">the events to write to file.</param>
- <remarks>
- <para>
- Handles append time behavior for RollingFileAppender. This checks
- if a roll over either by date (checked first) or time (checked second)
- is need and then appends to the file last.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.AdjustFileBeforeAppend">
- <summary>
- Performs any required rolling before outputting the next event
- </summary>
- <remarks>
- <para>
- Handles append time behavior for RollingFileAppender. This checks
- if a roll over either by date (checked first) or time (checked second)
- is need and then appends to the file last.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.OpenFile(System.String,System.Boolean)">
- <summary>
- Creates and opens the file for logging. If <see cref="P:log4net.Appender.RollingFileAppender.StaticLogFileName"/>
- is false then the fully qualified name is determined and used.
- </summary>
- <param name="fileName">the name of the file to open</param>
- <param name="append">true to append to existing file</param>
- <remarks>
- <para>This method will ensure that the directory structure
- for the <paramref name="fileName"/> specified exists.</para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.GetNextOutputFileName(System.String)">
- <summary>
- Get the current output file name
- </summary>
- <param name="fileName">the base file name</param>
- <returns>the output file name</returns>
- <remarks>
- The output file name is based on the base fileName specified.
- If <see cref="P:log4net.Appender.RollingFileAppender.StaticLogFileName"/> is set then the output
- file name is the same as the base file passed in. Otherwise
- the output file depends on the date pattern, on the count
- direction or both.
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.DetermineCurSizeRollBackups">
- <summary>
- Determines curSizeRollBackups (only within the current roll point)
- </summary>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.GetWildcardPatternForFile(System.String)">
- <summary>
- Generates a wildcard pattern that can be used to find all files
- that are similar to the base file name.
- </summary>
- <param name="baseFileName"></param>
- <returns></returns>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.GetExistingFiles(System.String)">
- <summary>
- Builds a list of filenames for all files matching the base filename plus a file
- pattern.
- </summary>
- <param name="baseFilePath"></param>
- <returns></returns>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.RollOverIfDateBoundaryCrossing">
- <summary>
- Initiates a roll over if needed for crossing a date boundary since the last run.
- </summary>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.ExistingInit">
- <summary>
- Initializes based on existing conditions at time of <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/>.
- </summary>
- <remarks>
- <para>
- Initializes based on existing conditions at time of <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/>.
- The following is done
- <list type="bullet">
- <item>determine curSizeRollBackups (only within the current roll point)</item>
- <item>initiates a roll over if needed for crossing a date boundary since the last run.</item>
- </list>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.InitializeFromOneFile(System.String,System.String)">
- <summary>
- Does the work of bumping the 'current' file counter higher
- to the highest count when an incremental file name is seen.
- The highest count is either the first file (when count direction
- is greater than 0) or the last file (when count direction less than 0).
- In either case, we want to know the highest count that is present.
- </summary>
- <param name="baseFile"></param>
- <param name="curFileName"></param>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.InitializeRollBackups(System.String,System.Collections.ArrayList)">
- <summary>
- Takes a list of files and a base file name, and looks for
- 'incremented' versions of the base file. Bumps the max
- count up to the highest count seen.
- </summary>
- <param name="baseFile"></param>
- <param name="arrayFiles"></param>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.ComputeCheckPeriod(System.String)">
- <summary>
- Calculates the RollPoint for the datePattern supplied.
- </summary>
- <param name="datePattern">the date pattern to calculate the check period for</param>
- <returns>The RollPoint that is most accurate for the date pattern supplied</returns>
- <remarks>
- Essentially the date pattern is examined to determine what the
- most suitable roll point is. The roll point chosen is the roll point
- with the smallest period that can be detected using the date pattern
- supplied. i.e. if the date pattern only outputs the year, month, day
- and hour then the smallest roll point that can be detected would be
- and hourly roll point as minutes could not be detected.
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.RollingFileAppender.ActivateOptions"/> must be called again.
- </para>
- <para>
- Sets initial conditions including date/time roll over information, first check,
- scheduledFilename, and calls <see cref="M:log4net.Appender.RollingFileAppender.ExistingInit"/> to initialize
- the current number of backups.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.RollOverTime(System.Boolean)">
- <summary>
- Rollover the file(s) to date/time tagged file(s).
- </summary>
- <param name="fileIsOpen">set to true if the file to be rolled is currently open</param>
- <remarks>
- <para>
- Rollover the file(s) to date/time tagged file(s).
- Resets curSizeRollBackups.
- If fileIsOpen is set then the new file is opened (through SafeOpenFile).
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.RollFile(System.String,System.String)">
- <summary>
- Renames file <paramref name="fromFile"/> to file <paramref name="toFile"/>.
- </summary>
- <param name="fromFile">Name of existing file to roll.</param>
- <param name="toFile">New name for file.</param>
- <remarks>
- <para>
- Renames file <paramref name="fromFile"/> to file <paramref name="toFile"/>. It
- also checks for existence of target file and deletes if it does.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.FileExists(System.String)">
- <summary>
- Test if a file exists at a specified path
- </summary>
- <param name="path">the path to the file</param>
- <returns>true if the file exists</returns>
- <remarks>
- <para>
- Test if a file exists at a specified path
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.DeleteFile(System.String)">
- <summary>
- Deletes the specified file if it exists.
- </summary>
- <param name="fileName">The file to delete.</param>
- <remarks>
- <para>
- Delete a file if is exists.
- The file is first moved to a new filename then deleted.
- This allows the file to be removed even when it cannot
- be deleted, but it still can be moved.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.RollOverSize">
- <summary>
- Implements file roll base on file size.
- </summary>
- <remarks>
- <para>
- If the maximum number of size based backups is reached
- (<c>curSizeRollBackups == maxSizeRollBackups</c>) then the oldest
- file is deleted -- its index determined by the sign of countDirection.
- If <c>countDirection</c> &lt; 0, then files
- {<c>File.1</c>, ..., <c>File.curSizeRollBackups -1</c>}
- are renamed to {<c>File.2</c>, ...,
- <c>File.curSizeRollBackups</c>}. Moreover, <c>File</c> is
- renamed <c>File.1</c> and closed.
- </para>
- <para>
- A new file is created to receive further log output.
- </para>
- <para>
- If <c>maxSizeRollBackups</c> is equal to zero, then the
- <c>File</c> is truncated with no backup files created.
- </para>
- <para>
- If <c>maxSizeRollBackups</c> &lt; 0, then <c>File</c> is
- renamed if needed and no files are deleted.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.RollOverRenameFiles(System.String)">
- <summary>
- Implements file roll.
- </summary>
- <param name="baseFileName">the base name to rename</param>
- <remarks>
- <para>
- If the maximum number of size based backups is reached
- (<c>curSizeRollBackups == maxSizeRollBackups</c>) then the oldest
- file is deleted -- its index determined by the sign of countDirection.
- If <c>countDirection</c> &lt; 0, then files
- {<c>File.1</c>, ..., <c>File.curSizeRollBackups -1</c>}
- are renamed to {<c>File.2</c>, ...,
- <c>File.curSizeRollBackups</c>}.
- </para>
- <para>
- If <c>maxSizeRollBackups</c> is equal to zero, then the
- <c>File</c> is truncated with no backup files created.
- </para>
- <para>
- If <c>maxSizeRollBackups</c> &lt; 0, then <c>File</c> is
- renamed if needed and no files are deleted.
- </para>
- <para>
- This is called by <see cref="M:log4net.Appender.RollingFileAppender.RollOverSize"/> to rename the files.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.RollingFileAppender.NextCheckDate(System.DateTime,log4net.Appender.RollingFileAppender.RollPoint)">
- <summary>
- Get the start time of the next window for the current rollpoint
- </summary>
- <param name="currentDateTime">the current date</param>
- <param name="rollPoint">the type of roll point we are working with</param>
- <returns>the start time for the next roll point an interval after the currentDateTime date</returns>
- <remarks>
- <para>
- Returns the date of the next roll point after the currentDateTime date passed to the method.
- </para>
- <para>
- The basic strategy is to subtract the time parts that are less significant
- than the rollpoint from the current time. This should roll the time back to
- the start of the time window for the current rollpoint. Then we add 1 window
- worth of time and get the start time of the next window for the rollpoint.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_dateTime">
- <summary>
- This object supplies the current date/time. Allows test code to plug in
- a method to control this class when testing date/time based rolling.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_datePattern">
- <summary>
- The date pattern. By default, the pattern is set to <c>".yyyy-MM-dd"</c>
- meaning daily rollover.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_scheduledFilename">
- <summary>
- The actual formatted filename that is currently being written to
- or will be the file transferred to on roll over
- (based on staticLogFileName).
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_nextCheck">
- <summary>
- The timestamp when we shall next recompute the filename.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_now">
- <summary>
- Holds date of last roll over
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_rollPoint">
- <summary>
- The type of rolling done
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_maxFileSize">
- <summary>
- The default maximum file size is 10MB
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_maxSizeRollBackups">
- <summary>
- There is zero backup files by default
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_curSizeRollBackups">
- <summary>
- How many sized based backups have been made so far
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_countDirection">
- <summary>
- The rolling file count direction.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_rollingStyle">
- <summary>
- The rolling mode used in this appender.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_rollDate">
- <summary>
- Cache flag set if we are rolling by date.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_rollSize">
- <summary>
- Cache flag set if we are rolling by size.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_staticLogFileName">
- <summary>
- Value indicating whether to always log to the same file.
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.m_baseFileName">
- <summary>
- FileName provided in configuration. Used for rolling properly
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.s_date1970">
- <summary>
- The 1st of January 1970 in UTC
- </summary>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.DatePattern">
- <summary>
- Gets or sets the date pattern to be used for generating file names
- when rolling over on date.
- </summary>
- <value>
- The date pattern to be used for generating file names when rolling
- over on date.
- </value>
- <remarks>
- <para>
- Takes a string in the same format as expected by
- <see cref="T:log4net.DateFormatter.SimpleDateFormatter"/>.
- </para>
- <para>
- This property determines the rollover schedule when rolling over
- on date.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.MaxSizeRollBackups">
- <summary>
- Gets or sets the maximum number of backup files that are kept before
- the oldest is erased.
- </summary>
- <value>
- The maximum number of backup files that are kept before the oldest is
- erased.
- </value>
- <remarks>
- <para>
- If set to zero, then there will be no backup files and the log file
- will be truncated when it reaches <see cref="P:log4net.Appender.RollingFileAppender.MaxFileSize"/>.
- </para>
- <para>
- If a negative number is supplied then no deletions will be made. Note
- that this could result in very slow performance as a large number of
- files are rolled over unless <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/> is used.
- </para>
- <para>
- The maximum applies to <b>each</b> time based group of files and
- <b>not</b> the total.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.MaxFileSize">
- <summary>
- Gets or sets the maximum size that the output file is allowed to reach
- before being rolled over to backup files.
- </summary>
- <value>
- The maximum size in bytes that the output file is allowed to reach before being
- rolled over to backup files.
- </value>
- <remarks>
- <para>
- This property is equivalent to <see cref="P:log4net.Appender.RollingFileAppender.MaximumFileSize"/> except
- that it is required for differentiating the setter taking a
- <see cref="T:System.Int64"/> argument from the setter taking a <see cref="T:System.String"/>
- argument.
- </para>
- <para>
- The default maximum file size is 10MB (10*1024*1024).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.MaximumFileSize">
- <summary>
- Gets or sets the maximum size that the output file is allowed to reach
- before being rolled over to backup files.
- </summary>
- <value>
- The maximum size that the output file is allowed to reach before being
- rolled over to backup files.
- </value>
- <remarks>
- <para>
- This property allows you to specify the maximum size with the
- suffixes "KB", "MB" or "GB" so that the size is interpreted being
- expressed respectively in kilobytes, megabytes or gigabytes.
- </para>
- <para>
- For example, the value "10KB" will be interpreted as 10240 bytes.
- </para>
- <para>
- The default maximum file size is 10MB.
- </para>
- <para>
- If you have the option to set the maximum file size programmatically
- consider using the <see cref="P:log4net.Appender.RollingFileAppender.MaxFileSize"/> property instead as this
- allows you to set the size in bytes as a <see cref="T:System.Int64"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.CountDirection">
- <summary>
- Gets or sets the rolling file count direction.
- </summary>
- <value>
- The rolling file count direction.
- </value>
- <remarks>
- <para>
- Indicates if the current file is the lowest numbered file or the
- highest numbered file.
- </para>
- <para>
- By default newer files have lower numbers (<see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/> &lt; 0),
- i.e. log.1 is most recent, log.5 is the 5th backup, etc...
- </para>
- <para>
- <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/> &gt;= 0 does the opposite i.e.
- log.1 is the first backup made, log.5 is the 5th backup made, etc.
- For infinite backups use <see cref="P:log4net.Appender.RollingFileAppender.CountDirection"/> &gt;= 0 to reduce
- rollover costs.
- </para>
- <para>The default file count direction is -1.</para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.RollingStyle">
- <summary>
- Gets or sets the rolling style.
- </summary>
- <value>The rolling style.</value>
- <remarks>
- <para>
- The default rolling style is <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Composite"/>.
- </para>
- <para>
- When set to <see cref="F:log4net.Appender.RollingFileAppender.RollingMode.Once"/> this appender's
- <see cref="P:log4net.Appender.FileAppender.AppendToFile"/> property is set to <c>false</c>, otherwise
- the appender would append to a single file rather than rolling
- the file each time it is opened.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.StaticLogFileName">
- <summary>
- Gets or sets a value indicating whether to always log to
- the same file.
- </summary>
- <value>
- <c>true</c> if always should be logged to the same file, otherwise <c>false</c>.
- </value>
- <remarks>
- <para>
- By default file.log is always the current file. Optionally
- file.log.yyyy-mm-dd for current formatted datePattern can by the currently
- logging file (or file.log.curSizeRollBackup or even
- file.log.yyyy-mm-dd.curSizeRollBackup).
- </para>
- <para>
- This will make time based rollovers with a large number of backups
- much faster as the appender it won't have to rename all the backups!
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RollingFileAppender.RollingMode">
- <summary>
- Style of rolling to use
- </summary>
- <remarks>
- <para>
- Style of rolling to use
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollingMode.Once">
- <summary>
- Roll files once per program execution
- </summary>
- <remarks>
- <para>
- Roll files once per program execution.
- Well really once each time this appender is
- configured.
- </para>
- <para>
- Setting this option also sets <c>AppendToFile</c> to
- <c>false</c> on the <c>RollingFileAppender</c>, otherwise
- this appender would just be a normal file appender.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollingMode.Size">
- <summary>
- Roll files based only on the size of the file
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollingMode.Date">
- <summary>
- Roll files based only on the date
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollingMode.Composite">
- <summary>
- Roll files based on both the size and date of the file
- </summary>
- </member>
- <member name="T:log4net.Appender.RollingFileAppender.RollPoint">
- <summary>
- The code assumes that the following 'time' constants are in a increasing sequence.
- </summary>
- <remarks>
- <para>
- The code assumes that the following 'time' constants are in a increasing sequence.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.InvalidRollPoint">
- <summary>
- Roll the log not based on the date
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.TopOfMinute">
- <summary>
- Roll the log for each minute
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.TopOfHour">
- <summary>
- Roll the log for each hour
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.HalfDay">
- <summary>
- Roll the log twice a day (midday and midnight)
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.TopOfDay">
- <summary>
- Roll the log each day (midnight)
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.TopOfWeek">
- <summary>
- Roll the log each week
- </summary>
- </member>
- <member name="F:log4net.Appender.RollingFileAppender.RollPoint.TopOfMonth">
- <summary>
- Roll the log each month
- </summary>
- </member>
- <member name="T:log4net.Appender.RollingFileAppender.IDateTime">
- <summary>
- This interface is used to supply Date/Time information to the <see cref="T:log4net.Appender.RollingFileAppender"/>.
- </summary>
- <remarks>
- This interface is used to supply Date/Time information to the <see cref="T:log4net.Appender.RollingFileAppender"/>.
- Used primarily to allow test classes to plug themselves in so they can
- supply test date/times.
- </remarks>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.IDateTime.Now">
- <summary>
- Gets the <i>current</i> time.
- </summary>
- <value>The <i>current</i> time.</value>
- <remarks>
- <para>
- Gets the <i>current</i> time.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.RollingFileAppender.DefaultDateTime">
- <summary>
- Default implementation of <see cref="T:log4net.Appender.RollingFileAppender.IDateTime"/> that returns the current time.
- </summary>
- </member>
- <member name="P:log4net.Appender.RollingFileAppender.DefaultDateTime.Now">
- <summary>
- Gets the <b>current</b> time.
- </summary>
- <value>The <b>current</b> time.</value>
- <remarks>
- <para>
- Gets the <b>current</b> time.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.SmtpAppender">
- <summary>
- Send an e-mail when a specific logging event occurs, typically on errors
- or fatal errors.
- </summary>
- <remarks>
- <para>
- The number of logging events delivered in this e-mail depend on
- the value of <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> option. The
- <see cref="T:log4net.Appender.SmtpAppender"/> keeps only the last
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> logging events in its
- cyclic buffer. This keeps memory requirements at a reasonable level while
- still delivering useful application context.
- </para>
- <note type="caution">
- Authentication and setting the server Port are only available on the MS .NET 1.1 runtime.
- For these features to be enabled you need to ensure that you are using a version of
- the log4net assembly that is built against the MS .NET 1.1 framework and that you are
- running the your application on the MS .NET 1.1 runtime. On all other platforms only sending
- unauthenticated messages to a server listening on port 25 (the default) is supported.
- </note>
- <para>
- Authentication is supported by setting the <see cref="P:log4net.Appender.SmtpAppender.Authentication"/> property to
- either <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/> or <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Ntlm"/>.
- If using <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/> authentication then the <see cref="P:log4net.Appender.SmtpAppender.Username"/>
- and <see cref="P:log4net.Appender.SmtpAppender.Password"/> properties must also be set.
- </para>
- <para>
- To set the SMTP server port use the <see cref="P:log4net.Appender.SmtpAppender.Port"/> property. The default port is 25.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.SmtpAppender.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.SmtpAppender.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Sends the contents of the cyclic buffer as an e-mail message.
- </summary>
- <param name="events">The logging events to send.</param>
- </member>
- <member name="M:log4net.Appender.SmtpAppender.SendEmail(System.String)">
- <summary>
- Send the email message
- </summary>
- <param name="messageBody">the body text to include in the mail</param>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.To">
- <summary>
- Gets or sets a semicolon-delimited list of recipient e-mail addresses.
- </summary>
- <value>
- A semicolon-delimited list of e-mail addresses.
- </value>
- <remarks>
- <para>
- A semicolon-delimited list of recipient e-mail addresses.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.From">
- <summary>
- Gets or sets the e-mail address of the sender.
- </summary>
- <value>
- The e-mail address of the sender.
- </value>
- <remarks>
- <para>
- The e-mail address of the sender.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Subject">
- <summary>
- Gets or sets the subject line of the e-mail message.
- </summary>
- <value>
- The subject line of the e-mail message.
- </value>
- <remarks>
- <para>
- The subject line of the e-mail message.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.SmtpHost">
- <summary>
- Gets or sets the name of the SMTP relay mail server to use to send
- the e-mail messages.
- </summary>
- <value>
- The name of the e-mail relay server. If SmtpServer is not set, the
- name of the local SMTP server is used.
- </value>
- <remarks>
- <para>
- The name of the e-mail relay server. If SmtpServer is not set, the
- name of the local SMTP server is used.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.LocationInfo">
- <summary>
- Obsolete
- </summary>
- <remarks>
- Use the BufferingAppenderSkeleton Fix methods instead
- </remarks>
- <remarks>
- <para>
- Obsolete property.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Authentication">
- <summary>
- The mode to use to authentication with the SMTP server
- </summary>
- <remarks>
- <note type="caution">Authentication is only available on the MS .NET 1.1 runtime.</note>
- <para>
- Valid Authentication mode values are: <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.None"/>,
- <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/>, and <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Ntlm"/>.
- The default value is <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.None"/>. When using
- <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/> you must specify the <see cref="P:log4net.Appender.SmtpAppender.Username"/>
- and <see cref="P:log4net.Appender.SmtpAppender.Password"/> to use to authenticate.
- When using <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Ntlm"/> the Windows credentials for the current
- thread, if impersonating, or the process will be used to authenticate.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Username">
- <summary>
- The username to use to authenticate with the SMTP server
- </summary>
- <remarks>
- <note type="caution">Authentication is only available on the MS .NET 1.1 runtime.</note>
- <para>
- A <see cref="P:log4net.Appender.SmtpAppender.Username"/> and <see cref="P:log4net.Appender.SmtpAppender.Password"/> must be specified when
- <see cref="P:log4net.Appender.SmtpAppender.Authentication"/> is set to <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/>,
- otherwise the username will be ignored.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Password">
- <summary>
- The password to use to authenticate with the SMTP server
- </summary>
- <remarks>
- <note type="caution">Authentication is only available on the MS .NET 1.1 runtime.</note>
- <para>
- A <see cref="P:log4net.Appender.SmtpAppender.Username"/> and <see cref="P:log4net.Appender.SmtpAppender.Password"/> must be specified when
- <see cref="P:log4net.Appender.SmtpAppender.Authentication"/> is set to <see cref="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic"/>,
- otherwise the password will be ignored.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Port">
- <summary>
- The port on which the SMTP server is listening
- </summary>
- <remarks>
- <note type="caution">Server Port is only available on the MS .NET 1.1 runtime.</note>
- <para>
- The port on which the SMTP server is listening. The default
- port is <c>25</c>. The Port can only be changed when running on
- the MS .NET 1.1 runtime.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.Priority">
- <summary>
- Gets or sets the priority of the e-mail message
- </summary>
- <value>
- One of the <see cref="T:System.Web.Mail.MailPriority"/> values.
- </value>
- <remarks>
- <para>
- Sets the priority of the e-mails generated by this
- appender. The default priority is <see cref="F:System.Web.Mail.MailPriority.Normal"/>.
- </para>
- <para>
- If you are using this appender to report errors then
- you may want to set the priority to <see cref="F:System.Web.Mail.MailPriority.High"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.SmtpAppender.SmtpAuthentication">
- <summary>
- Values for the <see cref="P:log4net.Appender.SmtpAppender.Authentication"/> property.
- </summary>
- <remarks>
- <para>
- SMTP authentication modes.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.SmtpAppender.SmtpAuthentication.None">
- <summary>
- No authentication
- </summary>
- </member>
- <member name="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Basic">
- <summary>
- Basic authentication.
- </summary>
- <remarks>
- Requires a username and password to be supplied
- </remarks>
- </member>
- <member name="F:log4net.Appender.SmtpAppender.SmtpAuthentication.Ntlm">
- <summary>
- Integrated authentication
- </summary>
- <remarks>
- Uses the Windows credentials from the current thread or process to authenticate.
- </remarks>
- </member>
- <member name="T:log4net.Appender.SmtpPickupDirAppender">
- <summary>
- Send an email when a specific logging event occurs, typically on errors
- or fatal errors. Rather than sending via smtp it writes a file into the
- directory specified by <see cref="P:log4net.Appender.SmtpPickupDirAppender.PickupDir"/>. This allows services such
- as the IIS SMTP agent to manage sending the messages.
- </summary>
- <remarks>
- <para>
- The configuration for this appender is identical to that of the <c>SMTPAppender</c>,
- except that instead of specifying the <c>SMTPAppender.SMTPHost</c> you specify
- <see cref="P:log4net.Appender.SmtpPickupDirAppender.PickupDir"/>.
- </para>
- <para>
- The number of logging events delivered in this e-mail depend on
- the value of <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> option. The
- <see cref="T:log4net.Appender.SmtpPickupDirAppender"/> keeps only the last
- <see cref="P:log4net.Appender.BufferingAppenderSkeleton.BufferSize"/> logging events in its
- cyclic buffer. This keeps memory requirements at a reasonable level while
- still delivering useful application context.
- </para>
- </remarks>
- <author>Niall Daley</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.SmtpPickupDirAppender.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.SmtpPickupDirAppender.SendBuffer(log4net.Core.LoggingEvent[])">
- <summary>
- Sends the contents of the cyclic buffer as an e-mail message.
- </summary>
- <param name="events">The logging events to send.</param>
- <remarks>
- <para>
- Sends the contents of the cyclic buffer as an e-mail message.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.SmtpPickupDirAppender.ActivateOptions">
- <summary>
- Activate the options on this appender.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.SmtpPickupDirAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.SmtpPickupDirAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.SmtpPickupDirAppender.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.SmtpPickupDirAppender.ConvertToFullPath(System.String)">
- <summary>
- Convert a path into a fully qualified path.
- </summary>
- <param name="path">The path to convert.</param>
- <returns>The fully qualified path.</returns>
- <remarks>
- <para>
- Converts the path specified to a fully
- qualified path. If the path is relative it is
- taken as relative from the application base
- directory.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.SmtpPickupDirAppender.m_securityContext">
- <summary>
- The security context to use for privileged calls
- </summary>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.To">
- <summary>
- Gets or sets a semicolon-delimited list of recipient e-mail addresses.
- </summary>
- <value>
- A semicolon-delimited list of e-mail addresses.
- </value>
- <remarks>
- <para>
- A semicolon-delimited list of e-mail addresses.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.From">
- <summary>
- Gets or sets the e-mail address of the sender.
- </summary>
- <value>
- The e-mail address of the sender.
- </value>
- <remarks>
- <para>
- The e-mail address of the sender.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.Subject">
- <summary>
- Gets or sets the subject line of the e-mail message.
- </summary>
- <value>
- The subject line of the e-mail message.
- </value>
- <remarks>
- <para>
- The subject line of the e-mail message.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.PickupDir">
- <summary>
- Gets or sets the path to write the messages to.
- </summary>
- <remarks>
- <para>
- Gets or sets the path to write the messages to. This should be the same
- as that used by the agent sending the messages.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.SecurityContext">
- <summary>
- Gets or sets the <see cref="P:log4net.Appender.SmtpPickupDirAppender.SecurityContext"/> used to write to the pickup directory.
- </summary>
- <value>
- The <see cref="P:log4net.Appender.SmtpPickupDirAppender.SecurityContext"/> used to write to the pickup directory.
- </value>
- <remarks>
- <para>
- Unless a <see cref="P:log4net.Appender.SmtpPickupDirAppender.SecurityContext"/> specified here for this appender
- the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is queried for the
- security context to use. The default behavior is to use the security context
- of the current thread.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.SmtpPickupDirAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.TelnetAppender">
- <summary>
- Appender that allows clients to connect via Telnet to receive log messages
- </summary>
- <remarks>
- <para>
- The TelnetAppender accepts socket connections and streams logging messages
- back to the client.
- The output is provided in a telnet-friendly way so that a log can be monitored
- over a TCP/IP socket.
- This allows simple remote monitoring of application logging.
- </para>
- <para>
- The default <see cref="P:log4net.Appender.TelnetAppender.Port"/> is 23 (the telnet port).
- </para>
- </remarks>
- <author>Keith Long</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.OnClose">
- <summary>
- Overrides the parent method to close the socket handler
- </summary>
- <remarks>
- <para>
- Closes all the outstanding connections.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.ActivateOptions">
- <summary>
- Initialize the appender based on the options set.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Appender.TelnetAppender.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Appender.TelnetAppender.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Appender.TelnetAppender.ActivateOptions"/> must be called again.
- </para>
- <para>
- Create the socket handler and wait for connections
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Writes the logging event to each connected client.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the logging event to each connected client.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TelnetAppender.Port">
- <summary>
- Gets or sets the TCP port number on which this <see cref="T:log4net.Appender.TelnetAppender"/> will listen for connections.
- </summary>
- <value>
- An integer value in the range <see cref="F:System.Net.IPEndPoint.MinPort"/> to <see cref="F:System.Net.IPEndPoint.MaxPort"/>
- indicating the TCP port number on which this <see cref="T:log4net.Appender.TelnetAppender"/> will listen for connections.
- </value>
- <remarks>
- <para>
- The default value is 23 (the telnet port).
- </para>
- </remarks>
- <exception cref="T:System.ArgumentOutOfRangeException">The value specified is less than <see cref="F:System.Net.IPEndPoint.MinPort"/>
- or greater than <see cref="F:System.Net.IPEndPoint.MaxPort"/>.</exception>
- </member>
- <member name="P:log4net.Appender.TelnetAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.TelnetAppender.SocketHandler">
- <summary>
- Helper class to manage connected clients
- </summary>
- <remarks>
- <para>
- The SocketHandler class is used to accept connections from
- clients. It is threaded so that clients can connect/disconnect
- asynchronously.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.#ctor(System.Int32)">
- <summary>
- Opens a new server port on <paramref ref="port"/>
- </summary>
- <param name="port">the local port to listen on for connections</param>
- <remarks>
- <para>
- Creates a socket handler on the specified local server port.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.Send(System.String)">
- <summary>
- Sends a string message to each of the connected clients
- </summary>
- <param name="message">the text to send</param>
- <remarks>
- <para>
- Sends a string message to each of the connected clients
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.AddClient(log4net.Appender.TelnetAppender.SocketHandler.SocketClient)">
- <summary>
- Add a client to the internal clients list
- </summary>
- <param name="client">client to add</param>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.RemoveClient(log4net.Appender.TelnetAppender.SocketHandler.SocketClient)">
- <summary>
- Remove a client from the internal clients list
- </summary>
- <param name="client">client to remove</param>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.OnConnect(System.IAsyncResult)">
- <summary>
- Callback used to accept a connection on the server socket
- </summary>
- <param name="asyncResult">The result of the asynchronous operation</param>
- <remarks>
- <para>
- On connection adds to the list of connections
- if there are two many open connections you will be disconnected
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.Dispose">
- <summary>
- Close all network connections
- </summary>
- <remarks>
- <para>
- Make sure we close all network connections
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TelnetAppender.SocketHandler.HasConnections">
- <summary>
- Test if this handler has active connections
- </summary>
- <value>
- <c>true</c> if this handler has active connections
- </value>
- <remarks>
- <para>
- This property will be <c>true</c> while this handler has
- active connections, that is at least one connection that
- the handler will attempt to send a message to.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.TelnetAppender.SocketHandler.SocketClient">
- <summary>
- Class that represents a client connected to this handler
- </summary>
- <remarks>
- <para>
- Class that represents a client connected to this handler
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.SocketClient.#ctor(System.Net.Sockets.Socket)">
- <summary>
- Create this <see cref="T:log4net.Appender.TelnetAppender.SocketHandler.SocketClient"/> for the specified <see cref="T:System.Net.Sockets.Socket"/>
- </summary>
- <param name="socket">the client's socket</param>
- <remarks>
- <para>
- Opens a stream writer on the socket.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.SocketClient.Send(System.String)">
- <summary>
- Write a string to the client
- </summary>
- <param name="message">string to send</param>
- <remarks>
- <para>
- Write a string to the client
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TelnetAppender.SocketHandler.SocketClient.Dispose">
- <summary>
- Cleanup the clients connection
- </summary>
- <remarks>
- <para>
- Close the socket connection.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Appender.TraceAppender">
- <summary>
- Appends log events to the <see cref="T:System.Diagnostics.Trace"/> system.
- </summary>
- <remarks>
- <para>
- The application configuration file can be used to control what listeners
- are actually used. See the MSDN documentation for the
- <see cref="T:System.Diagnostics.Trace"/> class for details on configuring the
- trace system.
- </para>
- <para>
- Events are written using the <c>System.Diagnostics.Trace.Write(string,string)</c>
- method. The event's logger name is passed as the value for the category name to the Write method.
- </para>
- <para>
- <b>Compact Framework</b><br/>
- The Compact Framework does not support the <see cref="T:System.Diagnostics.Trace"/>
- class for any operation except <c>Assert</c>. When using the Compact Framework this
- appender will write to the <see cref="T:System.Diagnostics.Debug"/> system rather than
- the Trace system. This appender will therefore behave like the <see cref="T:log4net.Appender.DebugAppender"/>.
- </para>
- </remarks>
- <author>Douglas de la Torre</author>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Appender.TraceAppender.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.TraceAppender"/>.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TraceAppender.#ctor(log4net.Layout.ILayout)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Appender.TraceAppender"/>
- with a specified layout.
- </summary>
- <param name="layout">The layout to use with this appender.</param>
- <remarks>
- <para>
- Obsolete constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Appender.TraceAppender.Append(log4net.Core.LoggingEvent)">
- <summary>
- Writes the logging event to the <see cref="T:System.Diagnostics.Trace"/> system.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Writes the logging event to the <see cref="T:System.Diagnostics.Trace"/> system.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Appender.TraceAppender.m_immediateFlush">
- <summary>
- Immediate flush means that the underlying writer or output stream
- will be flushed at the end of each append operation.
- </summary>
- <remarks>
- <para>
- Immediate flush is slower but ensures that each append request is
- actually written. If <see cref="P:log4net.Appender.TraceAppender.ImmediateFlush"/> is set to
- <c>false</c>, then there is a good chance that the last few
- logs events are not actually written to persistent media if and
- when the application crashes.
- </para>
- <para>
- The default value is <c>true</c>.</para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TraceAppender.ImmediateFlush">
- <summary>
- Gets or sets a value that indicates whether the appender will
- flush at the end of each write.
- </summary>
- <remarks>
- <para>The default behavior is to flush at the end of each
- write. If the option is set to<c>false</c>, then the underlying
- stream can defer writing to physical medium to a later time.
- </para>
- <para>
- Avoiding the flush operation at the end of each append results
- in a performance gain of 10 to 20 percent. However, there is safety
- trade-off involved in skipping flushing. Indeed, when flushing is
- skipped, then it is likely that the last few log events will not
- be recorded on disk when the application exits. This is a high
- price to pay even for a 20% performance gain.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Appender.TraceAppender.RequiresLayout">
- <summary>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- This appender requires a <see cref="N:log4net.Layout"/> to be set.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.AliasDomainAttribute">
- <summary>
- Assembly level attribute that specifies a domain to alias to this assembly's repository.
- </summary>
- <remarks>
- <para>
- <b>AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute.</b>
- </para>
- <para>
- An assembly's logger repository is defined by its <see cref="T:log4net.Config.DomainAttribute"/>,
- however this can be overridden by an assembly loaded before the target assembly.
- </para>
- <para>
- An assembly can alias another assembly's domain to its repository by
- specifying this attribute with the name of the target domain.
- </para>
- <para>
- This attribute can only be specified on the assembly and may be used
- as many times as necessary to alias all the required domains.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Config.AliasRepositoryAttribute">
- <summary>
- Assembly level attribute that specifies a repository to alias to this assembly's repository.
- </summary>
- <remarks>
- <para>
- An assembly's logger repository is defined by its <see cref="T:log4net.Config.RepositoryAttribute"/>,
- however this can be overridden by an assembly loaded before the target assembly.
- </para>
- <para>
- An assembly can alias another assembly's repository to its repository by
- specifying this attribute with the name of the target repository.
- </para>
- <para>
- This attribute can only be specified on the assembly and may be used
- as many times as necessary to alias all the required repositories.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.AliasRepositoryAttribute.#ctor(System.String)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.AliasRepositoryAttribute"/> class with
- the specified repository to alias to this assembly's repository.
- </summary>
- <param name="name">The repository to alias to this assemby's repository.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Config.AliasRepositoryAttribute"/> class with
- the specified repository to alias to this assembly's repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.AliasRepositoryAttribute.Name">
- <summary>
- Gets or sets the repository to alias to this assemby's repository.
- </summary>
- <value>
- The repository to alias to this assemby's repository.
- </value>
- <remarks>
- <para>
- The name of the repository to alias to this assemby's repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.AliasDomainAttribute.#ctor(System.String)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.AliasDomainAttribute"/> class with
- the specified domain to alias to this assembly's repository.
- </summary>
- <param name="name">The domain to alias to this assemby's repository.</param>
- <remarks>
- <para>
- Obsolete. Use <see cref="T:log4net.Config.AliasRepositoryAttribute"/> instead of <see cref="T:log4net.Config.AliasDomainAttribute"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.BasicConfigurator">
- <summary>
- Use this class to quickly configure a <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.
- </summary>
- <remarks>
- <para>
- Allows very simple programmatic configuration of log4net.
- </para>
- <para>
- Only one appender can be configured using this configurator.
- The appender is set at the root of the hierarchy and all logging
- events will be delivered to that appender.
- </para>
- <para>
- Appenders can also implement the <see cref="T:log4net.Core.IOptionHandler"/> interface. Therefore
- they would require that the <see cref="M:log4net.Core.IOptionHandler.ActivateOptions"/> method
- be called after the appenders properties have been configured.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.BasicConfigurator.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.BasicConfigurator"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.BasicConfigurator.Configure">
- <summary>
- Initializes the log4net system with a default configuration.
- </summary>
- <remarks>
- <para>
- Initializes the log4net logging system using a <see cref="T:log4net.Appender.ConsoleAppender"/>
- that will write to <c>Console.Out</c>. The log messages are
- formatted using the <see cref="T:log4net.Layout.PatternLayout"/> layout object
- with the <see cref="F:log4net.Layout.PatternLayout.DetailConversionPattern"/>
- layout style.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.BasicConfigurator.Configure(log4net.Appender.IAppender)">
- <summary>
- Initializes the log4net system using the specified appender.
- </summary>
- <param name="appender">The appender to use to log all logging events.</param>
- <remarks>
- <para>
- Initializes the log4net system using the specified appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.BasicConfigurator.Configure(log4net.Repository.ILoggerRepository)">
- <summary>
- Initializes the <see cref="T:log4net.Repository.ILoggerRepository"/> with a default configuration.
- </summary>
- <param name="repository">The repository to configure.</param>
- <remarks>
- <para>
- Initializes the specified repository using a <see cref="T:log4net.Appender.ConsoleAppender"/>
- that will write to <c>Console.Out</c>. The log messages are
- formatted using the <see cref="T:log4net.Layout.PatternLayout"/> layout object
- with the <see cref="F:log4net.Layout.PatternLayout.DetailConversionPattern"/>
- layout style.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.BasicConfigurator.Configure(log4net.Repository.ILoggerRepository,log4net.Appender.IAppender)">
- <summary>
- Initializes the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified appender.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="appender">The appender to use to log all logging events.</param>
- <remarks>
- <para>
- Initializes the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified appender.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.ConfiguratorAttribute">
- <summary>
- Base class for all log4net configuration attributes.
- </summary>
- <remarks>
- This is an abstract class that must be extended by
- specific configurators. This attribute allows the
- configurator to be parameterized by an assembly level
- attribute.
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.ConfiguratorAttribute.#ctor(System.Int32)">
- <summary>
- Constructor used by subclasses.
- </summary>
- <param name="priority">the ordering priority for this configurator</param>
- <remarks>
- <para>
- The <paramref name="priority"/> is used to order the configurator
- attributes before they are invoked. Higher priority configurators are executed
- before lower priority ones.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.ConfiguratorAttribute.Configure(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly.
- </summary>
- <param name="sourceAssembly">The assembly that this attribute was defined on.</param>
- <param name="targetRepository">The repository to configure.</param>
- <remarks>
- <para>
- Abstract method implemented by a subclass. When this method is called
- the subclass should configure the <paramref name="targetRepository"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.ConfiguratorAttribute.CompareTo(System.Object)">
- <summary>
- Compare this instance to another ConfiguratorAttribute
- </summary>
- <param name="obj">the object to compare to</param>
- <returns>see <see cref="M:System.IComparable.CompareTo(System.Object)"/></returns>
- <remarks>
- <para>
- Compares the priorities of the two <see cref="T:log4net.Config.ConfiguratorAttribute"/> instances.
- Sorts by priority in descending order. Objects with the same priority are
- randomly ordered.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.DomainAttribute">
- <summary>
- Assembly level attribute that specifies the logging domain for the assembly.
- </summary>
- <remarks>
- <para>
- <b>DomainAttribute is obsolete. Use RepositoryAttribute instead of DomainAttribute.</b>
- </para>
- <para>
- Assemblies are mapped to logging domains. Each domain has its own
- logging repository. This attribute specified on the assembly controls
- the configuration of the domain. The <see cref="P:log4net.Config.RepositoryAttribute.Name"/> property specifies the name
- of the domain that this assembly is a part of. The <see cref="P:log4net.Config.RepositoryAttribute.RepositoryType"/>
- specifies the type of the repository objects to create for the domain. If
- this attribute is not specified and a <see cref="P:log4net.Config.RepositoryAttribute.Name"/> is not specified
- then the assembly will be part of the default shared logging domain.
- </para>
- <para>
- This attribute can only be specified on the assembly and may only be used
- once per assembly.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Config.RepositoryAttribute">
- <summary>
- Assembly level attribute that specifies the logging repository for the assembly.
- </summary>
- <remarks>
- <para>
- Assemblies are mapped to logging repository. This attribute specified
- on the assembly controls
- the configuration of the repository. The <see cref="P:log4net.Config.RepositoryAttribute.Name"/> property specifies the name
- of the repository that this assembly is a part of. The <see cref="P:log4net.Config.RepositoryAttribute.RepositoryType"/>
- specifies the type of the <see cref="T:log4net.Repository.ILoggerRepository"/> object
- to create for the assembly. If this attribute is not specified or a <see cref="P:log4net.Config.RepositoryAttribute.Name"/>
- is not specified then the assembly will be part of the default shared logging repository.
- </para>
- <para>
- This attribute can only be specified on the assembly and may only be used
- once per assembly.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.RepositoryAttribute.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.RepositoryAttribute"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.RepositoryAttribute.#ctor(System.String)">
- <summary>
- Initialize a new instance of the <see cref="T:log4net.Config.RepositoryAttribute"/> class
- with the name of the repository.
- </summary>
- <param name="name">The name of the repository.</param>
- <remarks>
- <para>
- Initialize the attribute with the name for the assembly's repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.RepositoryAttribute.Name">
- <summary>
- Gets or sets the name of the logging repository.
- </summary>
- <value>
- The string name to use as the name of the repository associated with this
- assembly.
- </value>
- <remarks>
- <para>
- This value does not have to be unique. Several assemblies can share the
- same repository. They will share the logging configuration of the repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.RepositoryAttribute.RepositoryType">
- <summary>
- Gets or sets the type of repository to create for this assembly.
- </summary>
- <value>
- The type of repository to create for this assembly.
- </value>
- <remarks>
- <para>
- The type of the repository to create for the assembly.
- The type must implement the <see cref="T:log4net.Repository.ILoggerRepository"/>
- interface.
- </para>
- <para>
- This will be the type of repository created when
- the repository is created. If multiple assemblies reference the
- same repository then the repository is only created once using the
- <see cref="P:log4net.Config.RepositoryAttribute.RepositoryType"/> of the first assembly to call into the
- repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.DomainAttribute.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.DomainAttribute"/> class.
- </summary>
- <remarks>
- <para>
- Obsolete. Use RepositoryAttribute instead of DomainAttribute.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.DomainAttribute.#ctor(System.String)">
- <summary>
- Initialize a new instance of the <see cref="T:log4net.Config.DomainAttribute"/> class
- with the name of the domain.
- </summary>
- <param name="name">The name of the domain.</param>
- <remarks>
- <para>
- Obsolete. Use RepositoryAttribute instead of DomainAttribute.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.DOMConfigurator">
- <summary>
- Use this class to initialize the log4net environment using an Xml tree.
- </summary>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- Configures a <see cref="T:log4net.Repository.ILoggerRepository"/> using an Xml tree.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.#ctor">
- <summary>
- Private constructor
- </summary>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure">
- <summary>
- Automatically configures the log4net system based on the
- application's configuration settings.
- </summary>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- Each application has a configuration file. This has the
- same name as the application with '.config' appended.
- This file is XML and calling this function prompts the
- configurator to look in that file for a section called
- <c>log4net</c> that contains the configuration data.
- </remarks>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(log4net.Repository.ILoggerRepository)">
- <summary>
- Automatically configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using settings
- stored in the application's configuration file.
- </summary>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- Each application has a configuration file. This has the
- same name as the application with '.config' appended.
- This file is XML and calling this function prompts the
- configurator to look in that file for a section called
- <c>log4net</c> that contains the configuration data.
- </remarks>
- <param name="repository">The repository to configure.</param>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(System.Xml.XmlElement)">
- <summary>
- Configures log4net using a <c>log4net</c> element
- </summary>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- Loads the log4net configuration from the XML element
- supplied as <paramref name="element"/>.
- </remarks>
- <param name="element">The element to parse.</param>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(log4net.Repository.ILoggerRepository,System.Xml.XmlElement)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified XML
- element.
- </summary>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- Loads the log4net configuration from the XML element
- supplied as <paramref name="element"/>.
- </remarks>
- <param name="repository">The repository to configure.</param>
- <param name="element">The element to parse.</param>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(System.IO.FileInfo)">
- <summary>
- Configures log4net using the specified configuration file.
- </summary>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the log4net configuration data.
- </para>
- <para>
- The log4net configuration file can possible be specified in the application's
- configuration file (either <c>MyAppName.exe.config</c> for a
- normal application on <c>Web.config</c> for an ASP.NET application).
- </para>
- <example>
- The following example configures log4net using a configuration file, of which the
- location is stored in the application's configuration file :
- </example>
- <code lang="C#">
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
- </code>
- <para>
- In the <c>.config</c> file, the path to the log4net can be specified like this :
- </para>
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net-config-file" value="log.config"/>
- </appSettings>
- </configuration>
- </code>
- </remarks>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(System.IO.Stream)">
- <summary>
- Configures log4net using the specified configuration file.
- </summary>
- <param name="configStream">A stream to load the XML configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the log4net configuration data.
- </para>
- <para>
- Note that this method will NOT close the stream parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified configuration
- file.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The log4net configuration file can possible be specified in the application's
- configuration file (either <c>MyAppName.exe.config</c> for a
- normal application on <c>Web.config</c> for an ASP.NET application).
- </para>
- <example>
- The following example configures log4net using a configuration file, of which the
- location is stored in the application's configuration file :
- </example>
- <code lang="C#">
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- DOMConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
- </code>
- <para>
- In the <c>.config</c> file, the path to the log4net can be specified like this :
- </para>
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net-config-file" value="log.config"/>
- </appSettings>
- </configuration>
- </code>
- </remarks>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.Configure(log4net.Repository.ILoggerRepository,System.IO.Stream)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified configuration
- file.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configStream">The stream to load the XML configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- Note that this method will NOT close the stream parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.ConfigureAndWatch(System.IO.FileInfo)">
- <summary>
- Configures log4net using the file specified, monitors the file for changes
- and reloads the configuration if a change is detected.
- </summary>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The configuration file will be monitored using a <see cref="T:System.IO.FileSystemWatcher"/>
- and depends on the behavior of that class.
- </para>
- <para>
- For more information on how to configure log4net using
- a separate configuration file, see <see cref="M:log4net.Config.DOMConfigurator.Configure(System.IO.FileInfo)"/>.
- </para>
- </remarks>
- <seealso cref="M:log4net.Config.DOMConfigurator.Configure(System.IO.FileInfo)"/>
- </member>
- <member name="M:log4net.Config.DOMConfigurator.ConfigureAndWatch(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the file specified,
- monitors the file for changes and reloads the configuration if a change
- is detected.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- <b>DOMConfigurator is obsolete. Use XmlConfigurator instead of DOMConfigurator.</b>
- </para>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The configuration file will be monitored using a <see cref="T:System.IO.FileSystemWatcher"/>
- and depends on the behavior of that class.
- </para>
- <para>
- For more information on how to configure log4net using
- a separate configuration file, see <see cref="M:log4net.Config.DOMConfigurator.Configure(System.IO.FileInfo)"/>.
- </para>
- </remarks>
- <seealso cref="M:log4net.Config.DOMConfigurator.Configure(System.IO.FileInfo)"/>
- </member>
- <member name="T:log4net.Config.DOMConfiguratorAttribute">
- <summary>
- Assembly level attribute to configure the <see cref="T:log4net.Config.XmlConfigurator"/>.
- </summary>
- <remarks>
- <para>
- <b>AliasDomainAttribute is obsolete. Use AliasRepositoryAttribute instead of AliasDomainAttribute.</b>
- </para>
- <para>
- This attribute may only be used at the assembly scope and can only
- be used once per assembly.
- </para>
- <para>
- Use this attribute to configure the <see cref="T:log4net.Config.XmlConfigurator"/>
- without calling one of the <see cref="M:log4net.Config.XmlConfigurator.Configure"/>
- methods.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Config.XmlConfiguratorAttribute">
- <summary>
- Assembly level attribute to configure the <see cref="T:log4net.Config.XmlConfigurator"/>.
- </summary>
- <remarks>
- <para>
- This attribute may only be used at the assembly scope and can only
- be used once per assembly.
- </para>
- <para>
- Use this attribute to configure the <see cref="T:log4net.Config.XmlConfigurator"/>
- without calling one of the <see cref="M:log4net.Config.XmlConfigurator.Configure"/>
- methods.
- </para>
- <para>
- If neither of the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> or <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/>
- properties are set the configuration is loaded from the application's .config file.
- If set the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> property takes priority over the
- <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/> property. The <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> property
- specifies a path to a file to load the config from. The path is relative to the
- application's base directory; <see cref="P:System.AppDomain.BaseDirectory"/>.
- The <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/> property is used as a postfix to the assembly file name.
- The config file must be located in the application's base directory; <see cref="P:System.AppDomain.BaseDirectory"/>.
- For example in a console application setting the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/> to
- <c>config</c> has the same effect as not specifying the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> or
- <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/> properties.
- </para>
- <para>
- The <see cref="P:log4net.Config.XmlConfiguratorAttribute.Watch"/> property can be set to cause the <see cref="T:log4net.Config.XmlConfigurator"/>
- to watch the configuration file for changes.
- </para>
- <note>
- <para>
- Log4net will only look for assembly level configuration attributes once.
- When using the log4net assembly level attributes to control the configuration
- of log4net you must ensure that the first call to any of the
- <see cref="T:log4net.Core.LoggerManager"/> methods is made from the assembly with the configuration
- attributes.
- </para>
- <para>
- If you cannot guarantee the order in which log4net calls will be made from
- different assemblies you must use programmatic configuration instead, i.e.
- call the <see cref="M:log4net.Config.XmlConfigurator.Configure"/> method directly.
- </para>
- </note>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.XmlConfiguratorAttribute.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfiguratorAttribute.Configure(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly.
- </summary>
- <param name="sourceAssembly">The assembly that this attribute was defined on.</param>
- <param name="targetRepository">The repository to configure.</param>
- <remarks>
- <para>
- Configure the repository using the <see cref="T:log4net.Config.XmlConfigurator"/>.
- The <paramref name="targetRepository"/> specified must extend the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>
- class otherwise the <see cref="T:log4net.Config.XmlConfigurator"/> will not be able to
- configure it.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="repository"/> does not extend <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.</exception>
- </member>
- <member name="M:log4net.Config.XmlConfiguratorAttribute.ConfigureFromFile(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Attempt to load configuration from the local file system
- </summary>
- <param name="sourceAssembly">The assembly that this attribute was defined on.</param>
- <param name="targetRepository">The repository to configure.</param>
- </member>
- <member name="M:log4net.Config.XmlConfiguratorAttribute.ConfigureFromFile(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Configure the specified repository using a <see cref="T:System.IO.FileInfo"/>
- </summary>
- <param name="targetRepository">The repository to configure.</param>
- <param name="configFile">the FileInfo pointing to the config file</param>
- </member>
- <member name="M:log4net.Config.XmlConfiguratorAttribute.ConfigureFromUri(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Attempt to load configuration from a URI
- </summary>
- <param name="sourceAssembly">The assembly that this attribute was defined on.</param>
- <param name="targetRepository">The repository to configure.</param>
- </member>
- <member name="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile">
- <summary>
- Gets or sets the filename of the configuration file.
- </summary>
- <value>
- The filename of the configuration file.
- </value>
- <remarks>
- <para>
- If specified, this is the name of the configuration file to use with
- the <see cref="T:log4net.Config.XmlConfigurator"/>. This file path is relative to the
- <b>application base</b> directory (<see cref="P:System.AppDomain.BaseDirectory"/>).
- </para>
- <para>
- The <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> takes priority over the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension">
- <summary>
- Gets or sets the extension of the configuration file.
- </summary>
- <value>
- The extension of the configuration file.
- </value>
- <remarks>
- <para>
- If specified this is the extension for the configuration file.
- The path to the config file is built by using the <b>application
- base</b> directory (<see cref="P:System.AppDomain.BaseDirectory"/>),
- the <b>assembly file name</b> and the config file extension.
- </para>
- <para>
- If the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/> is set to <c>MyExt</c> then
- possible config file names would be: <c>MyConsoleApp.exe.MyExt</c> or
- <c>MyClassLibrary.dll.MyExt</c>.
- </para>
- <para>
- The <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFile"/> takes priority over the <see cref="P:log4net.Config.XmlConfiguratorAttribute.ConfigFileExtension"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.XmlConfiguratorAttribute.Watch">
- <summary>
- Gets or sets a value indicating whether to watch the configuration file.
- </summary>
- <value>
- <c>true</c> if the configuration should be watched, <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- If this flag is specified and set to <c>true</c> then the framework
- will watch the configuration file and will reload the config each time
- the file is modified.
- </para>
- <para>
- The config file can only be watched if it is loaded from local disk.
- In a No-Touch (Smart Client) deployment where the application is downloaded
- from a web server the config file may not reside on the local disk
- and therefore it may not be able to watch it.
- </para>
- <note>
- Watching configuration is not supported on the SSCLI.
- </note>
- </remarks>
- </member>
- <member name="T:log4net.Config.Log4NetConfigurationSectionHandler">
- <summary>
- Class to register for the log4net section of the configuration file
- </summary>
- <remarks>
- The log4net section of the configuration file needs to have a section
- handler registered. This is the section handler used. It simply returns
- the XML element that is the root of the section.
- </remarks>
- <example>
- Example of registering the log4net section handler :
- <code lang="XML" escaped="true">
- <configuration>
- <configSections>
- <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
- </configSections>
- <log4net>
- log4net configuration XML goes here
- </log4net>
- </configuration>
- </code>
- </example>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.Log4NetConfigurationSectionHandler.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/> class.
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.Log4NetConfigurationSectionHandler.Create(System.Object,System.Object,System.Xml.XmlNode)">
- <summary>
- Parses the configuration section.
- </summary>
- <param name="parent">The configuration settings in a corresponding parent configuration section.</param>
- <param name="configContext">The configuration context when called from the ASP.NET configuration system. Otherwise, this parameter is reserved and is a null reference.</param>
- <param name="section">The <see cref="T:System.Xml.XmlNode"/> for the log4net section.</param>
- <returns>The <see cref="T:System.Xml.XmlNode"/> for the log4net section.</returns>
- <remarks>
- <para>
- Returns the <see cref="T:System.Xml.XmlNode"/> containing the configuration data,
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.PluginAttribute">
- <summary>
- Assembly level attribute that specifies a plugin to attach to
- the repository.
- </summary>
- <remarks>
- <para>
- Specifies the type of a plugin to create and attach to the
- assembly's repository. The plugin type must implement the
- <see cref="T:log4net.Plugin.IPlugin"/> interface.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Plugin.IPluginFactory">
- <summary>
- Interface used to create plugins.
- </summary>
- <remarks>
- <para>
- Interface used to create a plugin.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Plugin.IPluginFactory.CreatePlugin">
- <summary>
- Creates the plugin object.
- </summary>
- <returns>the new plugin instance</returns>
- <remarks>
- <para>
- Create and return a new plugin instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.PluginAttribute.#ctor(System.String)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.PluginAttribute"/> class
- with the specified type.
- </summary>
- <param name="typeName">The type name of plugin to create.</param>
- <remarks>
- <para>
- Create the attribute with the plugin type specified.
- </para>
- <para>
- Where possible use the constructor that takes a <see cref="T:System.Type"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.PluginAttribute.#ctor(System.Type)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.PluginAttribute"/> class
- with the specified type.
- </summary>
- <param name="type">The type of plugin to create.</param>
- <remarks>
- <para>
- Create the attribute with the plugin type specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.PluginAttribute.CreatePlugin">
- <summary>
- Creates the plugin object defined by this attribute.
- </summary>
- <remarks>
- <para>
- Creates the instance of the <see cref="T:log4net.Plugin.IPlugin"/> object as
- specified by this attribute.
- </para>
- </remarks>
- <returns>The plugin object.</returns>
- </member>
- <member name="M:log4net.Config.PluginAttribute.ToString">
- <summary>
- Returns a representation of the properties of this object.
- </summary>
- <remarks>
- <para>
- Overrides base class <see cref="M:System.Object.ToString"/> method to
- return a representation of the properties of this object.
- </para>
- </remarks>
- <returns>A representation of the properties of this object</returns>
- </member>
- <member name="P:log4net.Config.PluginAttribute.Type">
- <summary>
- Gets or sets the type for the plugin.
- </summary>
- <value>
- The type for the plugin.
- </value>
- <remarks>
- <para>
- The type for the plugin.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.PluginAttribute.TypeName">
- <summary>
- Gets or sets the type name for the plugin.
- </summary>
- <value>
- The type name for the plugin.
- </value>
- <remarks>
- <para>
- The type name for the plugin.
- </para>
- <para>
- Where possible use the <see cref="P:log4net.Config.PluginAttribute.Type"/> property instead.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.SecurityContextProviderAttribute">
- <summary>
- Assembly level attribute to configure the <see cref="T:log4net.Core.SecurityContextProvider"/>.
- </summary>
- <remarks>
- <para>
- This attribute may only be used at the assembly scope and can only
- be used once per assembly.
- </para>
- <para>
- Use this attribute to configure the <see cref="T:log4net.Config.XmlConfigurator"/>
- without calling one of the <see cref="M:log4net.Config.XmlConfigurator.Configure"/>
- methods.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Config.SecurityContextProviderAttribute.#ctor(System.Type)">
- <summary>
- Construct provider attribute with type specified
- </summary>
- <param name="providerType">the type of the provider to use</param>
- <remarks>
- <para>
- The provider specified must subclass the <see cref="T:log4net.Core.SecurityContextProvider"/>
- class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.SecurityContextProviderAttribute.Configure(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Configures the SecurityContextProvider
- </summary>
- <param name="sourceAssembly">The assembly that this attribute was defined on.</param>
- <param name="targetRepository">The repository to configure.</param>
- <remarks>
- <para>
- Creates a provider instance from the <see cref="P:log4net.Config.SecurityContextProviderAttribute.ProviderType"/> specified.
- Sets this as the default security context provider <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Config.SecurityContextProviderAttribute.ProviderType">
- <summary>
- Gets or sets the type of the provider to use.
- </summary>
- <value>
- the type of the provider to use.
- </value>
- <remarks>
- <para>
- The provider specified must subclass the <see cref="T:log4net.Core.SecurityContextProvider"/>
- class.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.XmlConfigurator">
- <summary>
- Use this class to initialize the log4net environment using an Xml tree.
- </summary>
- <remarks>
- <para>
- Configures a <see cref="T:log4net.Repository.ILoggerRepository"/> using an Xml tree.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.#ctor">
- <summary>
- Private constructor
- </summary>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure">
- <summary>
- Automatically configures the log4net system based on the
- application's configuration settings.
- </summary>
- <remarks>
- <para>
- Each application has a configuration file. This has the
- same name as the application with '.config' appended.
- This file is XML and calling this function prompts the
- configurator to look in that file for a section called
- <c>log4net</c> that contains the configuration data.
- </para>
- <para>
- To use this method to configure log4net you must specify
- the <see cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/> section
- handler for the <c>log4net</c> configuration section. See the
- <see cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/> for an example.
- </para>
- </remarks>
- <seealso cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(log4net.Repository.ILoggerRepository)">
- <summary>
- Automatically configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using settings
- stored in the application's configuration file.
- </summary>
- <remarks>
- <para>
- Each application has a configuration file. This has the
- same name as the application with '.config' appended.
- This file is XML and calling this function prompts the
- configurator to look in that file for a section called
- <c>log4net</c> that contains the configuration data.
- </para>
- <para>
- To use this method to configure log4net you must specify
- the <see cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/> section
- handler for the <c>log4net</c> configuration section. See the
- <see cref="T:log4net.Config.Log4NetConfigurationSectionHandler"/> for an example.
- </para>
- </remarks>
- <param name="repository">The repository to configure.</param>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(System.Xml.XmlElement)">
- <summary>
- Configures log4net using a <c>log4net</c> element
- </summary>
- <remarks>
- <para>
- Loads the log4net configuration from the XML element
- supplied as <paramref name="element"/>.
- </para>
- </remarks>
- <param name="element">The element to parse.</param>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(log4net.Repository.ILoggerRepository,System.Xml.XmlElement)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified XML
- element.
- </summary>
- <remarks>
- Loads the log4net configuration from the XML element
- supplied as <paramref name="element"/>.
- </remarks>
- <param name="repository">The repository to configure.</param>
- <param name="element">The element to parse.</param>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(System.IO.FileInfo)">
- <summary>
- Configures log4net using the specified configuration file.
- </summary>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the log4net configuration data.
- </para>
- <para>
- The log4net configuration file can possible be specified in the application's
- configuration file (either <c>MyAppName.exe.config</c> for a
- normal application on <c>Web.config</c> for an ASP.NET application).
- </para>
- <para>
- The first element matching <c>&lt;configuration&gt;</c> will be read as the
- configuration. If this file is also a .NET .config file then you must specify
- a configuration section for the <c>log4net</c> element otherwise .NET will
- complain. Set the type for the section handler to <see cref="T:System.Configuration.IgnoreSectionHandler"/>, for example:
- <code lang="XML" escaped="true">
- <configSections>
- <section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>
- </configSections>
- </code>
- </para>
- <example>
- The following example configures log4net using a configuration file, of which the
- location is stored in the application's configuration file :
- </example>
- <code lang="C#">
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
- </code>
- <para>
- In the <c>.config</c> file, the path to the log4net can be specified like this :
- </para>
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net-config-file" value="log.config"/>
- </appSettings>
- </configuration>
- </code>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(System.Uri)">
- <summary>
- Configures log4net using the specified configuration URI.
- </summary>
- <param name="configUri">A URI to load the XML configuration from.</param>
- <remarks>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the log4net configuration data.
- </para>
- <para>
- The <see cref="T:System.Net.WebRequest"/> must support the URI scheme specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(System.IO.Stream)">
- <summary>
- Configures log4net using the specified configuration data stream.
- </summary>
- <param name="configStream">A stream to load the XML configuration from.</param>
- <remarks>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the log4net configuration data.
- </para>
- <para>
- Note that this method will NOT close the stream parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified configuration
- file.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The log4net configuration file can possible be specified in the application's
- configuration file (either <c>MyAppName.exe.config</c> for a
- normal application on <c>Web.config</c> for an ASP.NET application).
- </para>
- <para>
- The first element matching <c>&lt;configuration&gt;</c> will be read as the
- configuration. If this file is also a .NET .config file then you must specify
- a configuration section for the <c>log4net</c> element otherwise .NET will
- complain. Set the type for the section handler to <see cref="T:System.Configuration.IgnoreSectionHandler"/>, for example:
- <code lang="XML" escaped="true">
- <configSections>
- <section name="log4net" type="System.Configuration.IgnoreSectionHandler"/>
- </configSections>
- </code>
- </para>
- <example>
- The following example configures log4net using a configuration file, of which the
- location is stored in the application's configuration file :
- </example>
- <code lang="C#">
- using log4net.Config;
- using System.IO;
- using System.Configuration;
-
- ...
-
- XmlConfigurator.Configure(new FileInfo(ConfigurationSettings.AppSettings["log4net-config-file"]));
- </code>
- <para>
- In the <c>.config</c> file, the path to the log4net can be specified like this :
- </para>
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net-config-file" value="log.config"/>
- </appSettings>
- </configuration>
- </code>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(log4net.Repository.ILoggerRepository,System.Uri)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified configuration
- URI.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configUri">A URI to load the XML configuration from.</param>
- <remarks>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The <see cref="T:System.Net.WebRequest"/> must support the URI scheme specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.Configure(log4net.Repository.ILoggerRepository,System.IO.Stream)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the specified configuration
- file.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configStream">The stream to load the XML configuration from.</param>
- <remarks>
- <para>
- The configuration data must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- Note that this method will NOT close the stream parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatch(System.IO.FileInfo)">
- <summary>
- Configures log4net using the file specified, monitors the file for changes
- and reloads the configuration if a change is detected.
- </summary>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The configuration file will be monitored using a <see cref="T:System.IO.FileSystemWatcher"/>
- and depends on the behavior of that class.
- </para>
- <para>
- For more information on how to configure log4net using
- a separate configuration file, see <see cref="M:log4net.Config.XmlConfigurator.Configure(System.IO.FileInfo)"/>.
- </para>
- </remarks>
- <seealso cref="M:log4net.Config.XmlConfigurator.Configure(System.IO.FileInfo)"/>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatch(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Configures the <see cref="T:log4net.Repository.ILoggerRepository"/> using the file specified,
- monitors the file for changes and reloads the configuration if a change
- is detected.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The XML file to load the configuration from.</param>
- <remarks>
- <para>
- The configuration file must be valid XML. It must contain
- at least one element called <c>log4net</c> that holds
- the configuration data.
- </para>
- <para>
- The configuration file will be monitored using a <see cref="T:System.IO.FileSystemWatcher"/>
- and depends on the behavior of that class.
- </para>
- <para>
- For more information on how to configure log4net using
- a separate configuration file, see <see cref="M:log4net.Config.XmlConfigurator.Configure(System.IO.FileInfo)"/>.
- </para>
- </remarks>
- <seealso cref="M:log4net.Config.XmlConfigurator.Configure(System.IO.FileInfo)"/>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureFromXml(log4net.Repository.ILoggerRepository,System.Xml.XmlElement)">
- <summary>
- Configures the specified repository using a <c>log4net</c> element.
- </summary>
- <param name="repository">The hierarchy to configure.</param>
- <param name="element">The element to parse.</param>
- <remarks>
- <para>
- Loads the log4net configuration from the XML element
- supplied as <paramref name="element"/>.
- </para>
- <para>
- This method is ultimately called by one of the Configure methods
- to load the configuration from an <see cref="T:System.Xml.XmlElement"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler">
- <summary>
- Class used to watch config files.
- </summary>
- <remarks>
- <para>
- Uses the <see cref="T:System.IO.FileSystemWatcher"/> to monitor
- changes to a specified file. Because multiple change notifications
- may be raised when the file is modified, a timer is used to
- compress the notifications into a single event. The timer
- waits for <see cref="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.TimeoutMillis"/> time before delivering
- the event notification. If any further <see cref="T:System.IO.FileSystemWatcher"/>
- change notifications arrive while the timer is waiting it
- is reset and waits again for <see cref="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.TimeoutMillis"/> to
- elapse.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.TimeoutMillis">
- <summary>
- The default amount of time to wait after receiving notification
- before reloading the config file.
- </summary>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.StartWatching(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Watch a specified config file used to configure a repository
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The configuration file to watch.</param>
- <remarks>
- <para>
- Watch a specified config file used to configure a repository
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.m_configFile">
- <summary>
- Holds the FileInfo used to configure the XmlConfigurator
- </summary>
- </member>
- <member name="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.m_repository">
- <summary>
- Holds the repository being configured.
- </summary>
- </member>
- <member name="F:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.m_timer">
- <summary>
- The timer used to compress the notification events.
- </summary>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.#ctor(log4net.Repository.ILoggerRepository,System.IO.FileInfo)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler"/> class.
- </summary>
- <param name="repository">The repository to configure.</param>
- <param name="configFile">The configuration file to watch.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.ConfigureAndWatchHandler_OnChanged(System.Object,System.IO.FileSystemEventArgs)">
- <summary>
- Event handler used by <see cref="T:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler"/>.
- </summary>
- <param name="source">The <see cref="T:System.IO.FileSystemWatcher"/> firing the event.</param>
- <param name="e">The argument indicates the file that caused the event to be fired.</param>
- <remarks>
- <para>
- This handler reloads the configuration from the file when the event is fired.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.ConfigureAndWatchHandler_OnRenamed(System.Object,System.IO.RenamedEventArgs)">
- <summary>
- Event handler used by <see cref="T:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler"/>.
- </summary>
- <param name="source">The <see cref="T:System.IO.FileSystemWatcher"/> firing the event.</param>
- <param name="e">The argument indicates the file that caused the event to be fired.</param>
- <remarks>
- <para>
- This handler reloads the configuration from the file when the event is fired.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Config.XmlConfigurator.ConfigureAndWatchHandler.OnWatchedFileChange(System.Object)">
- <summary>
- Called by the timer when the configuration has been updated.
- </summary>
- <param name="state">null</param>
- </member>
- <member name="T:log4net.Core.CompactRepositorySelector">
- <summary>
- The implementation of the <see cref="T:log4net.Core.IRepositorySelector"/> interface suitable
- for use with the compact framework
- </summary>
- <remarks>
- <para>
- This <see cref="T:log4net.Core.IRepositorySelector"/> implementation is a simple
- mapping between repository name and <see cref="T:log4net.Repository.ILoggerRepository"/>
- object.
- </para>
- <para>
- The .NET Compact Framework 1.0 does not support retrieving assembly
- level attributes therefore unlike the <c>DefaultRepositorySelector</c>
- this selector does not examine the calling assembly for attributes.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Core.IRepositorySelector">
- <summary>
- Interface used by the <see cref="T:log4net.LogManager"/> to select the <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.LogManager"/> uses a <see cref="T:log4net.Core.IRepositorySelector"/>
- to specify the policy for selecting the correct <see cref="T:log4net.Repository.ILoggerRepository"/>
- to return to the caller.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.GetRepository(System.Reflection.Assembly)">
- <summary>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly.
- </summary>
- <param name="assembly">The assembly to use to lookup to the <see cref="T:log4net.Repository.ILoggerRepository"/></param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> for the assembly.</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly.
- </para>
- <para>
- How the association between <see cref="T:System.Reflection.Assembly"/> and <see cref="T:log4net.Repository.ILoggerRepository"/>
- is made is not defined. The implementation may choose any method for
- this association. The results of this method must be repeatable, i.e.
- when called again with the same arguments the result must be the
- save value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.GetRepository(System.String)">
- <summary>
- Gets the named <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </summary>
- <param name="repositoryName">The name to use to lookup to the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <returns>The named <see cref="T:log4net.Repository.ILoggerRepository"/></returns>
- <remarks>
- Lookup a named <see cref="T:log4net.Repository.ILoggerRepository"/>. This is the repository created by
- calling <see cref="M:log4net.Core.IRepositorySelector.CreateRepository(System.String,System.Type)"/>.
- </remarks>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.CreateRepository(System.Reflection.Assembly,System.Type)">
- <summary>
- Creates a new repository for the assembly specified.
- </summary>
- <param name="assembly">The assembly to use to create the domain to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryType">The type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <returns>The repository created.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the domain
- specified such that a call to <see cref="M:log4net.Core.IRepositorySelector.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- <para>
- How the association between <see cref="T:System.Reflection.Assembly"/> and <see cref="T:log4net.Repository.ILoggerRepository"/>
- is made is not defined. The implementation may choose any method for
- this association.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.CreateRepository(System.String,System.Type)">
- <summary>
- Creates a new repository with the name specified.
- </summary>
- <param name="repositoryName">The name to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryType">The type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <returns>The repository created.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the name
- specified such that a call to <see cref="M:log4net.Core.IRepositorySelector.GetRepository(System.String)"/> with the
- same name will return the same repository instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.ExistsRepository(System.String)">
- <summary>
- Test if a named repository exists
- </summary>
- <param name="repositoryName">the named repository to check</param>
- <returns><c>true</c> if the repository exists</returns>
- <remarks>
- <para>
- Test if a named repository exists. Use <see cref="M:log4net.Core.IRepositorySelector.CreateRepository(System.Reflection.Assembly,System.Type)"/>
- to create a new repository and <see cref="M:log4net.Core.IRepositorySelector.GetRepository(System.Reflection.Assembly)"/> to retrieve
- a repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IRepositorySelector.GetAllRepositories">
- <summary>
- Gets an array of all currently defined repositories.
- </summary>
- <returns>
- An array of the <see cref="T:log4net.Repository.ILoggerRepository"/> instances created by
- this <see cref="T:log4net.Core.IRepositorySelector"/>.</returns>
- <remarks>
- <para>
- Gets an array of all of the repositories created by this selector.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Core.IRepositorySelector.LoggerRepositoryCreatedEvent">
- <summary>
- Event to notify that a logger repository has been created.
- </summary>
- <value>
- Event to notify that a logger repository has been created.
- </value>
- <remarks>
- <para>
- Event raised when a new repository is created.
- The event source will be this selector. The event args will
- be a <see cref="T:log4net.Core.LoggerRepositoryCreationEventArgs"/> which
- holds the newly created <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.#ctor(System.Type)">
- <summary>
- Create a new repository selector
- </summary>
- <param name="defaultRepositoryType">the type of the repositories to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/></param>
- <remarks>
- <para>
- Create an new compact repository selector.
- The default type for repositories must be specified,
- an appropriate value would be <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">throw if <paramref name="defaultRepositoryType"/> is null</exception>
- <exception cref="T:System.ArgumentOutOfRangeException">throw if <paramref name="defaultRepositoryType"/> does not implement <see cref="T:log4net.Repository.ILoggerRepository"/></exception>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.GetRepository(System.Reflection.Assembly)">
- <summary>
- Get the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly
- </summary>
- <param name="assembly">not used</param>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/></returns>
- <remarks>
- <para>
- The <paramref name="assembly"/> argument is not used. This selector does not create a
- separate repository for each assembly.
- </para>
- <para>
- As a named repository is not specified the default repository is
- returned. The default repository is named <c>log4net-default-repository</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.GetRepository(System.String)">
- <summary>
- Get the named <see cref="T:log4net.Repository.ILoggerRepository"/>
- </summary>
- <param name="repositoryName">the name of the repository to lookup</param>
- <returns>The named <see cref="T:log4net.Repository.ILoggerRepository"/></returns>
- <remarks>
- <para>
- Get the named <see cref="T:log4net.Repository.ILoggerRepository"/>. The default
- repository is <c>log4net-default-repository</c>. Other repositories
- must be created using the <see cref="M:log4net.Core.CompactRepositorySelector.CreateRepository(System.String,System.Type)"/>.
- If the named repository does not exist an exception is thrown.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">throw if <paramref name="repositoryName"/> is null</exception>
- <exception cref="T:log4net.Core.LogException">throw if the <paramref name="repositoryName"/> does not exist</exception>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.CreateRepository(System.Reflection.Assembly,System.Type)">
- <summary>
- Create a new repository for the assembly specified
- </summary>
- <param name="assembly">not used</param>
- <param name="repositoryType">the type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/></param>
- <returns>the repository created</returns>
- <remarks>
- <para>
- The <paramref name="assembly"/> argument is not used. This selector does not create a
- separate repository for each assembly.
- </para>
- <para>
- If the <paramref name="repositoryType"/> is <c>null</c> then the
- default repository type specified to the constructor is used.
- </para>
- <para>
- As a named repository is not specified the default repository is
- returned. The default repository is named <c>log4net-default-repository</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.CreateRepository(System.String,System.Type)">
- <summary>
- Create a new repository for the repository specified
- </summary>
- <param name="repositoryName">the repository to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/></param>
- <param name="repositoryType">the type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.
- If this param is null then the default repository type is used.</param>
- <returns>the repository created</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.CompactRepositorySelector.GetRepository(System.String)"/> with the
- same repository specified will return the same repository instance.
- </para>
- <para>
- If the named repository already exists an exception will be thrown.
- </para>
- <para>
- If <paramref name="repositoryType"/> is <c>null</c> then the default
- repository type specified to the constructor is used.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">throw if <paramref name="repositoryName"/> is null</exception>
- <exception cref="T:log4net.Core.LogException">throw if the <paramref name="repositoryName"/> already exists</exception>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.ExistsRepository(System.String)">
- <summary>
- Test if a named repository exists
- </summary>
- <param name="repositoryName">the named repository to check</param>
- <returns><c>true</c> if the repository exists</returns>
- <remarks>
- <para>
- Test if a named repository exists. Use <see cref="M:log4net.Core.CompactRepositorySelector.CreateRepository(System.String,System.Type)"/>
- to create a new repository and <see cref="M:log4net.Core.CompactRepositorySelector.GetRepository(System.String)"/> to retrieve
- a repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.GetAllRepositories">
- <summary>
- Gets a list of <see cref="T:log4net.Repository.ILoggerRepository"/> objects
- </summary>
- <returns>an array of all known <see cref="T:log4net.Repository.ILoggerRepository"/> objects</returns>
- <remarks>
- <para>
- Gets an array of all of the repositories created by this selector.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.CompactRepositorySelector.OnLoggerRepositoryCreatedEvent(log4net.Repository.ILoggerRepository)">
- <summary>
- Notify the registered listeners that the repository has been created
- </summary>
- <param name="repository">The repository that has been created</param>
- <remarks>
- <para>
- Raises the <event cref="E:log4net.Core.CompactRepositorySelector.LoggerRepositoryCreatedEvent">LoggerRepositoryCreatedEvent</event>
- event.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Core.CompactRepositorySelector.LoggerRepositoryCreatedEvent">
- <summary>
- Event to notify that a logger repository has been created.
- </summary>
- <value>
- Event to notify that a logger repository has been created.
- </value>
- <remarks>
- <para>
- Event raised when a new repository is created.
- The event source will be this selector. The event args will
- be a <see cref="T:log4net.Core.LoggerRepositoryCreationEventArgs"/> which
- holds the newly created <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.DefaultRepositorySelector">
- <summary>
- The default implementation of the <see cref="T:log4net.Core.IRepositorySelector"/> interface.
- </summary>
- <remarks>
- <para>
- Uses attributes defined on the calling assembly to determine how to
- configure the hierarchy for the repository.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.#ctor(System.Type)">
- <summary>
- Creates a new repository selector.
- </summary>
- <param name="defaultRepositoryType">The type of the repositories to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/></param>
- <remarks>
- <para>
- Create an new repository selector.
- The default type for repositories must be specified,
- an appropriate value would be <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException"><paramref name="defaultRepositoryType"/> is <see langword="null"/>.</exception>
- <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="defaultRepositoryType"/> does not implement <see cref="T:log4net.Repository.ILoggerRepository"/>.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.Reflection.Assembly)">
- <summary>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified assembly.
- </summary>
- <param name="repositoryAssembly">The assembly use to lookup the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <remarks>
- <para>
- The type of the <see cref="T:log4net.Repository.ILoggerRepository"/> created and the repository
- to create can be overridden by specifying the <see cref="T:log4net.Config.RepositoryAttribute"/>
- attribute on the <paramref name="repositoryAssembly"/>.
- </para>
- <para>
- The default values are to use the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>
- implementation of the <see cref="T:log4net.Repository.ILoggerRepository"/> interface and to use the
- <see cref="P:System.Reflection.AssemblyName.Name"/> as the name of the repository.
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be automatically configured using
- any <see cref="T:log4net.Config.ConfiguratorAttribute"/> attributes defined on
- the <paramref name="repositoryAssembly"/>.
- </para>
- </remarks>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> for the assembly</returns>
- <exception cref="T:System.ArgumentNullException"><paramref name="repositoryAssembly"/> is <see langword="null"/>.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.String)">
- <summary>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified repository.
- </summary>
- <param name="repositoryName">The repository to use to lookup the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> for the specified repository.</returns>
- <remarks>
- <para>
- Returns the named repository. If <paramref name="repositoryName"/> is <c>null</c>
- a <see cref="T:System.ArgumentNullException"/> is thrown. If the repository
- does not exist a <see cref="T:log4net.Core.LogException"/> is thrown.
- </para>
- <para>
- Use <see cref="M:log4net.Core.DefaultRepositorySelector.CreateRepository(System.String,System.Type)"/> to create a repository.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException"><paramref name="repositoryName"/> is <see langword="null"/>.</exception>
- <exception cref="T:log4net.Core.LogException"><paramref name="repositoryName"/> does not exist.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.CreateRepository(System.Reflection.Assembly,System.Type)">
- <summary>
- Create a new repository for the assembly specified
- </summary>
- <param name="repositoryAssembly">the assembly to use to create the repository to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryType">The type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <returns>The repository created.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- <para>
- The type of the <see cref="T:log4net.Repository.ILoggerRepository"/> created and
- the repository to create can be overridden by specifying the
- <see cref="T:log4net.Config.RepositoryAttribute"/> attribute on the
- <paramref name="repositoryAssembly"/>. The default values are to use the
- <paramref name="repositoryType"/> implementation of the
- <see cref="T:log4net.Repository.ILoggerRepository"/> interface and to use the
- <see cref="P:System.Reflection.AssemblyName.Name"/> as the name of the repository.
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be automatically
- configured using any <see cref="T:log4net.Config.ConfiguratorAttribute"/>
- attributes defined on the <paramref name="repositoryAssembly"/>.
- </para>
- <para>
- If a repository for the <paramref name="repositoryAssembly"/> already exists
- that repository will be returned. An error will not be raised and that
- repository may be of a different type to that specified in <paramref name="repositoryType"/>.
- Also the <see cref="T:log4net.Config.RepositoryAttribute"/> attribute on the
- assembly may be used to override the repository type specified in
- <paramref name="repositoryType"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException"><paramref name="repositoryAssembly"/> is <see langword="null"/>.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.CreateRepository(System.Reflection.Assembly,System.Type,System.String,System.Boolean)">
- <summary>
- Creates a new repository for the assembly specified.
- </summary>
- <param name="repositoryAssembly">the assembly to use to create the repository to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryType">The type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryName">The name to assign to the created repository</param>
- <param name="readAssemblyAttributes">Set to <c>true</c> to read and apply the assembly attributes</param>
- <returns>The repository created.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- <para>
- The type of the <see cref="T:log4net.Repository.ILoggerRepository"/> created and
- the repository to create can be overridden by specifying the
- <see cref="T:log4net.Config.RepositoryAttribute"/> attribute on the
- <paramref name="repositoryAssembly"/>. The default values are to use the
- <paramref name="repositoryType"/> implementation of the
- <see cref="T:log4net.Repository.ILoggerRepository"/> interface and to use the
- <see cref="P:System.Reflection.AssemblyName.Name"/> as the name of the repository.
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be automatically
- configured using any <see cref="T:log4net.Config.ConfiguratorAttribute"/>
- attributes defined on the <paramref name="repositoryAssembly"/>.
- </para>
- <para>
- If a repository for the <paramref name="repositoryAssembly"/> already exists
- that repository will be returned. An error will not be raised and that
- repository may be of a different type to that specified in <paramref name="repositoryType"/>.
- Also the <see cref="T:log4net.Config.RepositoryAttribute"/> attribute on the
- assembly may be used to override the repository type specified in
- <paramref name="repositoryType"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException"><paramref name="repositoryAssembly"/> is <see langword="null"/>.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.CreateRepository(System.String,System.Type)">
- <summary>
- Creates a new repository for the specified repository.
- </summary>
- <param name="repositoryName">The repository to associate with the <see cref="T:log4net.Repository.ILoggerRepository"/>.</param>
- <param name="repositoryType">The type of repository to create, must implement <see cref="T:log4net.Repository.ILoggerRepository"/>.
- If this param is <see langword="null"/> then the default repository type is used.</param>
- <returns>The new repository.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.String)"/> with the
- same repository specified will return the same repository instance.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException"><paramref name="repositoryName"/> is <see langword="null"/>.</exception>
- <exception cref="T:log4net.Core.LogException"><paramref name="repositoryName"/> already exists.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.ExistsRepository(System.String)">
- <summary>
- Test if a named repository exists
- </summary>
- <param name="repositoryName">the named repository to check</param>
- <returns><c>true</c> if the repository exists</returns>
- <remarks>
- <para>
- Test if a named repository exists. Use <see cref="M:log4net.Core.DefaultRepositorySelector.CreateRepository(System.String,System.Type)"/>
- to create a new repository and <see cref="M:log4net.Core.DefaultRepositorySelector.GetRepository(System.String)"/> to retrieve
- a repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.GetAllRepositories">
- <summary>
- Gets a list of <see cref="T:log4net.Repository.ILoggerRepository"/> objects
- </summary>
- <returns>an array of all known <see cref="T:log4net.Repository.ILoggerRepository"/> objects</returns>
- <remarks>
- <para>
- Gets an array of all of the repositories created by this selector.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.AliasRepository(System.String,log4net.Repository.ILoggerRepository)">
- <summary>
- Aliases a repository to an existing repository.
- </summary>
- <param name="repositoryAlias">The repository to alias.</param>
- <param name="repositoryTarget">The repository that the repository is aliased to.</param>
- <remarks>
- <para>
- The repository specified will be aliased to the repository when created.
- The repository must not already exist.
- </para>
- <para>
- When the repository is created it must utilize the same repository type as
- the repository it is aliased to, otherwise the aliasing will fail.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">
- <para><paramref name="repositoryAlias"/> is <see langword="null"/>.</para>
- <para>-or-</para>
- <para><paramref name="repositoryTarget"/> is <see langword="null"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.OnLoggerRepositoryCreatedEvent(log4net.Repository.ILoggerRepository)">
- <summary>
- Notifies the registered listeners that the repository has been created.
- </summary>
- <param name="repository">The repository that has been created.</param>
- <remarks>
- <para>
- Raises the <see cref="E:log4net.Core.DefaultRepositorySelector.LoggerRepositoryCreatedEvent"/> event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.GetInfoForAssembly(System.Reflection.Assembly,System.String@,System.Type@)">
- <summary>
- Gets the repository name and repository type for the specified assembly.
- </summary>
- <param name="assembly">The assembly that has a <see cref="T:log4net.Config.RepositoryAttribute"/>.</param>
- <param name="repositoryName">in/out param to hold the repository name to use for the assembly, caller should set this to the default value before calling.</param>
- <param name="repositoryType">in/out param to hold the type of the repository to create for the assembly, caller should set this to the default value before calling.</param>
- <exception cref="T:System.ArgumentNullException"><paramref name="assembly"/> is <see langword="null"/>.</exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.ConfigureRepository(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Configures the repository using information from the assembly.
- </summary>
- <param name="assembly">The assembly containing <see cref="T:log4net.Config.ConfiguratorAttribute"/>
- attributes which define the configuration for the repository.</param>
- <param name="repository">The repository to configure.</param>
- <exception cref="T:System.ArgumentNullException">
- <para><paramref name="assembly"/> is <see langword="null"/>.</para>
- <para>-or-</para>
- <para><paramref name="repository"/> is <see langword="null"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.LoadPlugins(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Loads the attribute defined plugins on the assembly.
- </summary>
- <param name="assembly">The assembly that contains the attributes.</param>
- <param name="repository">The repository to add the plugins to.</param>
- <exception cref="T:System.ArgumentNullException">
- <para><paramref name="assembly"/> is <see langword="null"/>.</para>
- <para>-or-</para>
- <para><paramref name="repository"/> is <see langword="null"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.DefaultRepositorySelector.LoadAliases(System.Reflection.Assembly,log4net.Repository.ILoggerRepository)">
- <summary>
- Loads the attribute defined aliases on the assembly.
- </summary>
- <param name="assembly">The assembly that contains the attributes.</param>
- <param name="repository">The repository to alias to.</param>
- <exception cref="T:System.ArgumentNullException">
- <para><paramref name="assembly"/> is <see langword="null"/>.</para>
- <para>-or-</para>
- <para><paramref name="repository"/> is <see langword="null"/>.</para>
- </exception>
- </member>
- <member name="E:log4net.Core.DefaultRepositorySelector.LoggerRepositoryCreatedEvent">
- <summary>
- Event to notify that a logger repository has been created.
- </summary>
- <value>
- Event to notify that a logger repository has been created.
- </value>
- <remarks>
- <para>
- Event raised when a new repository is created.
- The event source will be this selector. The event args will
- be a <see cref="T:log4net.Core.LoggerRepositoryCreationEventArgs"/> which
- holds the newly created <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.ErrorCode">
- <summary>
- Defined error codes that can be passed to the <see cref="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)"/> method.
- </summary>
- <remarks>
- <para>
- Values passed to the <see cref="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)"/> method.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.ErrorCode.GenericFailure">
- <summary>
- A general error
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.WriteFailure">
- <summary>
- Error while writing output
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.FlushFailure">
- <summary>
- Failed to flush file
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.CloseFailure">
- <summary>
- Failed to close file
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.FileOpenFailure">
- <summary>
- Unable to open output file
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.MissingLayout">
- <summary>
- No layout specified
- </summary>
- </member>
- <member name="F:log4net.Core.ErrorCode.AddressParseFailure">
- <summary>
- Failed to parse address
- </summary>
- </member>
- <member name="T:log4net.Core.IErrorHandler">
- <summary>
- Appenders may delegate their error handling to an <see cref="T:log4net.Core.IErrorHandler"/>.
- </summary>
- <remarks>
- <para>
- Error handling is a particularly tedious to get right because by
- definition errors are hard to predict and to reproduce.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)">
- <summary>
- Handles the error and information about the error condition is passed as
- a parameter.
- </summary>
- <param name="message">The message associated with the error.</param>
- <param name="e">The <see cref="T:System.Exception"/> that was thrown when the error occurred.</param>
- <param name="errorCode">The error code associated with the error.</param>
- <remarks>
- <para>
- Handles the error and information about the error condition is passed as
- a parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception)">
- <summary>
- Prints the error message passed as a parameter.
- </summary>
- <param name="message">The message associated with the error.</param>
- <param name="e">The <see cref="T:System.Exception"/> that was thrown when the error occurred.</param>
- <remarks>
- <para>
- See <see cref="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.IErrorHandler.Error(System.String)">
- <summary>
- Prints the error message passed as a parameter.
- </summary>
- <param name="message">The message associated with the error.</param>
- <remarks>
- <para>
- See <see cref="M:log4net.Core.IErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.IFixingRequired">
- <summary>
- Interface for objects that require fixing.
- </summary>
- <remarks>
- <para>
- Interface that indicates that the object requires fixing before it
- can be taken outside the context of the appender's
- <see cref="M:log4net.Appender.IAppender.DoAppend(log4net.Core.LoggingEvent)"/> method.
- </para>
- <para>
- When objects that implement this interface are stored
- in the context properties maps <see cref="T:log4net.GlobalContext"/>
- <see cref="P:log4net.GlobalContext.Properties"/> and <see cref="T:log4net.ThreadContext"/>
- <see cref="P:log4net.ThreadContext.Properties"/> are fixed
- (see <see cref="P:log4net.Core.LoggingEvent.Fix"/>) the <see cref="M:log4net.Core.IFixingRequired.GetFixedObject"/>
- method will be called.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Core.IFixingRequired.GetFixedObject">
- <summary>
- Get a portable version of this object
- </summary>
- <returns>the portable instance of this object</returns>
- <remarks>
- <para>
- Get a portable instance object that represents the current
- state of this object. The portable object can be stored
- and logged from any thread with identical results.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.ILogger">
- <summary>
- Interface that all loggers implement
- </summary>
- <remarks>
- <para>
- This interface supports logging events and testing if a level
- is enabled for logging.
- </para>
- <para>
- These methods will not throw exceptions. Note to implementor, ensure
- that the implementation of these methods cannot allow an exception
- to be thrown to the caller.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.ILogger.Log(System.Type,log4net.Core.Level,System.Object,System.Exception)">
- <summary>
- This generic form is intended to be used by wrappers.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="level">The level of the message to be logged.</param>
- <param name="message">The message object to log.</param>
- <param name="exception">the exception to log, including its stack trace. Pass <c>null</c> to not log an exception.</param>
- <remarks>
- <para>
- Generates a logging event for the specified <paramref name="level"/> using
- the <paramref name="message"/> and <paramref name="exception"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.ILogger.Log(log4net.Core.LoggingEvent)">
- <summary>
- This is the most generic printing method that is intended to be used
- by wrappers.
- </summary>
- <param name="logEvent">The event being logged.</param>
- <remarks>
- <para>
- Logs the specified logging event through this logger.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.ILogger.IsEnabledFor(log4net.Core.Level)">
- <summary>
- Checks if this logger is enabled for a given <see cref="T:log4net.Core.Level"/> passed as parameter.
- </summary>
- <param name="level">The level to check.</param>
- <returns>
- <c>true</c> if this logger is enabled for <c>level</c>, otherwise <c>false</c>.
- </returns>
- <remarks>
- <para>
- Test if this logger is going to log events of the specified <paramref name="level"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.ILogger.Name">
- <summary>
- Gets the name of the logger.
- </summary>
- <value>
- The name of the logger.
- </value>
- <remarks>
- <para>
- The name of this logger
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.ILogger.Repository">
- <summary>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> where this
- <c>Logger</c> instance is attached to.
- </summary>
- <value>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that this logger belongs to.
- </value>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> where this
- <c>Logger</c> instance is attached to.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.ILoggerWrapper">
- <summary>
- Base interface for all wrappers
- </summary>
- <remarks>
- <para>
- Base interface for all wrappers.
- </para>
- <para>
- All wrappers must implement this interface.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="P:log4net.Core.ILoggerWrapper.Logger">
- <summary>
- Get the implementation behind this wrapper object.
- </summary>
- <value>
- The <see cref="T:log4net.Core.ILogger"/> object that in implementing this object.
- </value>
- <remarks>
- <para>
- The <see cref="T:log4net.Core.ILogger"/> object that in implementing this
- object. The <c>Logger</c> object may not
- be the same object as this object because of logger decorators.
- This gets the actual underlying objects that is used to process
- the log events.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggerRepositoryCreationEventHandler">
- <summary>
- Delegate used to handle logger repository creation event notifications
- </summary>
- <param name="sender">The <see cref="T:log4net.Core.IRepositorySelector"/> which created the repository.</param>
- <param name="e">The <see cref="T:log4net.Core.LoggerRepositoryCreationEventArgs"/> event args
- that holds the <see cref="T:log4net.Repository.ILoggerRepository"/> instance that has been created.</param>
- <remarks>
- <para>
- Delegate used to handle logger repository creation event notifications.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggerRepositoryCreationEventArgs">
- <summary>
- Provides data for the <see cref="E:log4net.Core.IRepositorySelector.LoggerRepositoryCreatedEvent"/> event.
- </summary>
- <remarks>
- <para>
- A <see cref="E:log4net.Core.IRepositorySelector.LoggerRepositoryCreatedEvent"/>
- event is raised every time a <see cref="T:log4net.Repository.ILoggerRepository"/> is created.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggerRepositoryCreationEventArgs.m_repository">
- <summary>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created
- </summary>
- </member>
- <member name="M:log4net.Core.LoggerRepositoryCreationEventArgs.#ctor(log4net.Repository.ILoggerRepository)">
- <summary>
- Construct instance using <see cref="T:log4net.Repository.ILoggerRepository"/> specified
- </summary>
- <param name="repository">the <see cref="T:log4net.Repository.ILoggerRepository"/> that has been created</param>
- <remarks>
- <para>
- Construct instance using <see cref="T:log4net.Repository.ILoggerRepository"/> specified
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggerRepositoryCreationEventArgs.LoggerRepository">
- <summary>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that has been created
- </summary>
- <value>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that has been created
- </value>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that has been created
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.ITriggeringEventEvaluator">
- <summary>
- Test if an <see cref="T:log4net.Core.LoggingEvent"/> triggers an action
- </summary>
- <remarks>
- <para>
- Implementations of this interface allow certain appenders to decide
- when to perform an appender specific action.
- </para>
- <para>
- The action or behavior triggered is defined by the implementation.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Core.ITriggeringEventEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)">
- <summary>
- Test if this event triggers the action
- </summary>
- <param name="loggingEvent">The event to check</param>
- <returns><c>true</c> if this event triggers the action, otherwise <c>false</c></returns>
- <remarks>
- <para>
- Return <c>true</c> if this event triggers the action
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.Level">
- <summary>
- Defines the default set of levels recognized by the system.
- </summary>
- <remarks>
- <para>
- Each <see cref="T:log4net.Core.LoggingEvent"/> has an associated <see cref="T:log4net.Core.Level"/>.
- </para>
- <para>
- Levels have a numeric <see cref="P:log4net.Core.Level.Value"/> that defines the relative
- ordering between levels. Two Levels with the same <see cref="P:log4net.Core.Level.Value"/>
- are deemed to be equivalent.
- </para>
- <para>
- The levels that are recognized by log4net are set for each <see cref="T:log4net.Repository.ILoggerRepository"/>
- and each repository can have different levels defined. The levels are stored
- in the <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/> on the repository. Levels are
- looked up by name from the <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>.
- </para>
- <para>
- When logging at level INFO the actual level used is not <see cref="F:log4net.Core.Level.Info"/> but
- the value of <c>LoggerRepository.LevelMap["INFO"]</c>. The default value for this is
- <see cref="F:log4net.Core.Level.Info"/>, but this can be changed by reconfiguring the level map.
- </para>
- <para>
- Each level has a <see cref="P:log4net.Core.Level.DisplayName"/> in addition to its <see cref="P:log4net.Core.Level.Name"/>. The
- <see cref="P:log4net.Core.Level.DisplayName"/> is the string that is written into the output log. By default
- the display name is the same as the level name, but this can be used to alias levels
- or to localize the log output.
- </para>
- <para>
- Some of the predefined levels recognized by the system are:
- </para>
- <list type="bullet">
- <item>
- <description><see cref="F:log4net.Core.Level.Off"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.Fatal"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.Error"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.Warn"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.Info"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.Debug"/>.</description>
- </item>
- <item>
- <description><see cref="F:log4net.Core.Level.All"/>.</description>
- </item>
- </list>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.Level.#ctor(System.Int32,System.String,System.String)">
- <summary>
- Constructor
- </summary>
- <param name="level">Integer value for this level, higher values represent more severe levels.</param>
- <param name="levelName">The string name of this level.</param>
- <param name="displayName">The display name for this level. This may be localized or otherwise different from the name</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.Level"/> class with
- the specified level name and value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.#ctor(System.Int32,System.String)">
- <summary>
- Constructor
- </summary>
- <param name="level">Integer value for this level, higher values represent more severe levels.</param>
- <param name="levelName">The string name of this level.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.Level"/> class with
- the specified level name and value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.ToString">
- <summary>
- Returns the <see cref="T:System.String"/> representation of the current
- <see cref="T:log4net.Core.Level"/>.
- </summary>
- <returns>
- A <see cref="T:System.String"/> representation of the current <see cref="T:log4net.Core.Level"/>.
- </returns>
- <remarks>
- <para>
- Returns the level <see cref="P:log4net.Core.Level.Name"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.Equals(System.Object)">
- <summary>
- Compares levels.
- </summary>
- <param name="o">The object to compare against.</param>
- <returns><c>true</c> if the objects are equal.</returns>
- <remarks>
- <para>
- Compares the levels of <see cref="T:log4net.Core.Level"/> instances, and
- defers to base class if the target object is not a <see cref="T:log4net.Core.Level"/>
- instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.GetHashCode">
- <summary>
- Returns a hash code
- </summary>
- <returns>A hash code for the current <see cref="T:log4net.Core.Level"/>.</returns>
- <remarks>
- <para>
- Returns a hash code suitable for use in hashing algorithms and data
- structures like a hash table.
- </para>
- <para>
- Returns the hash code of the level <see cref="P:log4net.Core.Level.Value"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.CompareTo(System.Object)">
- <summary>
- Compares this instance to a specified object and returns an
- indication of their relative values.
- </summary>
- <param name="r">A <see cref="T:log4net.Core.Level"/> instance or <see langword="null"/> to compare with this instance.</param>
- <returns>
- A 32-bit signed integer that indicates the relative order of the
- values compared. The return value has these meanings:
- <list type="table">
- <listheader>
- <term>Value</term>
- <description>Meaning</description>
- </listheader>
- <item>
- <term>Less than zero</term>
- <description>This instance is less than <paramref name="r"/>.</description>
- </item>
- <item>
- <term>Zero</term>
- <description>This instance is equal to <paramref name="r"/>.</description>
- </item>
- <item>
- <term>Greater than zero</term>
- <description>
- <para>This instance is greater than <paramref name="r"/>.</para>
- <para>-or-</para>
- <para><paramref name="r"/> is <see langword="null"/>.</para>
- </description>
- </item>
- </list>
- </returns>
- <remarks>
- <para>
- <paramref name="r"/> must be an instance of <see cref="T:log4net.Core.Level"/>
- or <see langword="null"/>; otherwise, an exception is thrown.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentException"><paramref name="r"/> is not a <see cref="T:log4net.Core.Level"/>.</exception>
- </member>
- <member name="M:log4net.Core.Level.op_GreaterThan(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether a specified <see cref="T:log4net.Core.Level"/>
- is greater than another specified <see cref="T:log4net.Core.Level"/>.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/></param>
- <param name="r">A <see cref="T:log4net.Core.Level"/></param>
- <returns>
- <c>true</c> if <paramref name="l"/> is greater than
- <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.op_LessThan(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether a specified <see cref="T:log4net.Core.Level"/>
- is less than another specified <see cref="T:log4net.Core.Level"/>.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/></param>
- <param name="r">A <see cref="T:log4net.Core.Level"/></param>
- <returns>
- <c>true</c> if <paramref name="l"/> is less than
- <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.op_GreaterThanOrEqual(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether a specified <see cref="T:log4net.Core.Level"/>
- is greater than or equal to another specified <see cref="T:log4net.Core.Level"/>.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/></param>
- <param name="r">A <see cref="T:log4net.Core.Level"/></param>
- <returns>
- <c>true</c> if <paramref name="l"/> is greater than or equal to
- <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.op_LessThanOrEqual(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether a specified <see cref="T:log4net.Core.Level"/>
- is less than or equal to another specified <see cref="T:log4net.Core.Level"/>.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/></param>
- <param name="r">A <see cref="T:log4net.Core.Level"/></param>
- <returns>
- <c>true</c> if <paramref name="l"/> is less than or equal to
- <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.op_Equality(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether two specified <see cref="T:log4net.Core.Level"/>
- objects have the same value.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/> or <see langword="null"/>.</param>
- <param name="r">A <see cref="T:log4net.Core.Level"/> or <see langword="null"/>.</param>
- <returns>
- <c>true</c> if the value of <paramref name="l"/> is the same as the
- value of <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.op_Inequality(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Returns a value indicating whether two specified <see cref="T:log4net.Core.Level"/>
- objects have different values.
- </summary>
- <param name="l">A <see cref="T:log4net.Core.Level"/> or <see langword="null"/>.</param>
- <param name="r">A <see cref="T:log4net.Core.Level"/> or <see langword="null"/>.</param>
- <returns>
- <c>true</c> if the value of <paramref name="l"/> is different from
- the value of <paramref name="r"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.Level.Compare(log4net.Core.Level,log4net.Core.Level)">
- <summary>
- Compares two specified <see cref="T:log4net.Core.Level"/> instances.
- </summary>
- <param name="l">The first <see cref="T:log4net.Core.Level"/> to compare.</param>
- <param name="r">The second <see cref="T:log4net.Core.Level"/> to compare.</param>
- <returns>
- A 32-bit signed integer that indicates the relative order of the
- two values compared. The return value has these meanings:
- <list type="table">
- <listheader>
- <term>Value</term>
- <description>Meaning</description>
- </listheader>
- <item>
- <term>Less than zero</term>
- <description><paramref name="l"/> is less than <paramref name="r"/>.</description>
- </item>
- <item>
- <term>Zero</term>
- <description><paramref name="l"/> is equal to <paramref name="r"/>.</description>
- </item>
- <item>
- <term>Greater than zero</term>
- <description><paramref name="l"/> is greater than <paramref name="r"/>.</description>
- </item>
- </list>
- </returns>
- <remarks>
- <para>
- Compares two levels.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.Level.Off">
- <summary>
- The <see cref="F:log4net.Core.Level.Off"/> level designates a higher level than all the rest.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Emergency">
- <summary>
- The <see cref="F:log4net.Core.Level.Emergency"/> level designates very severe error events.
- System unusable, emergencies.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Fatal">
- <summary>
- The <see cref="F:log4net.Core.Level.Fatal"/> level designates very severe error events
- that will presumably lead the application to abort.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Alert">
- <summary>
- The <see cref="F:log4net.Core.Level.Alert"/> level designates very severe error events.
- Take immediate action, alerts.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Critical">
- <summary>
- The <see cref="F:log4net.Core.Level.Critical"/> level designates very severe error events.
- Critical condition, critical.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Severe">
- <summary>
- The <see cref="F:log4net.Core.Level.Severe"/> level designates very severe error events.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Error">
- <summary>
- The <see cref="F:log4net.Core.Level.Error"/> level designates error events that might
- still allow the application to continue running.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Warn">
- <summary>
- The <see cref="F:log4net.Core.Level.Warn"/> level designates potentially harmful
- situations.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Notice">
- <summary>
- The <see cref="F:log4net.Core.Level.Notice"/> level designates informational messages
- that highlight the progress of the application at the highest level.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Info">
- <summary>
- The <see cref="F:log4net.Core.Level.Info"/> level designates informational messages that
- highlight the progress of the application at coarse-grained level.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Debug">
- <summary>
- The <see cref="F:log4net.Core.Level.Debug"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Fine">
- <summary>
- The <see cref="F:log4net.Core.Level.Fine"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Trace">
- <summary>
- The <see cref="F:log4net.Core.Level.Trace"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Finer">
- <summary>
- The <see cref="F:log4net.Core.Level.Finer"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Verbose">
- <summary>
- The <see cref="F:log4net.Core.Level.Verbose"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.Finest">
- <summary>
- The <see cref="F:log4net.Core.Level.Finest"/> level designates fine-grained informational
- events that are most useful to debug an application.
- </summary>
- </member>
- <member name="F:log4net.Core.Level.All">
- <summary>
- The <see cref="F:log4net.Core.Level.All"/> level designates the lowest level possible.
- </summary>
- </member>
- <member name="P:log4net.Core.Level.Name">
- <summary>
- Gets the name of this level.
- </summary>
- <value>
- The name of this level.
- </value>
- <remarks>
- <para>
- Gets the name of this level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.Level.Value">
- <summary>
- Gets the value of this level.
- </summary>
- <value>
- The value of this level.
- </value>
- <remarks>
- <para>
- Gets the value of this level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.Level.DisplayName">
- <summary>
- Gets the display name of this level.
- </summary>
- <value>
- The display name of this level.
- </value>
- <remarks>
- <para>
- Gets the display name of this level.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LevelCollection">
- <summary>
- A strongly-typed collection of <see cref="T:log4net.Core.Level"/> objects.
- </summary>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Core.LevelCollection.ReadOnly(log4net.Core.LevelCollection)">
- <summary>
- Creates a read-only wrapper for a <c>LevelCollection</c> instance.
- </summary>
- <param name="list">list to create a readonly wrapper arround</param>
- <returns>
- A <c>LevelCollection</c> wrapper that is read-only.
- </returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor">
- <summary>
- Initializes a new instance of the <c>LevelCollection</c> class
- that is empty and has the default initial capacity.
- </summary>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor(System.Int32)">
- <summary>
- Initializes a new instance of the <c>LevelCollection</c> class
- that has the specified initial capacity.
- </summary>
- <param name="capacity">
- The number of elements that the new <c>LevelCollection</c> is initially capable of storing.
- </param>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor(log4net.Core.LevelCollection)">
- <summary>
- Initializes a new instance of the <c>LevelCollection</c> class
- that contains elements copied from the specified <c>LevelCollection</c>.
- </summary>
- <param name="c">The <c>LevelCollection</c> whose elements are copied to the new collection.</param>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor(log4net.Core.Level[])">
- <summary>
- Initializes a new instance of the <c>LevelCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Core.Level"/> array.
- </summary>
- <param name="a">The <see cref="T:log4net.Core.Level"/> array whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor(System.Collections.ICollection)">
- <summary>
- Initializes a new instance of the <c>LevelCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Core.Level"/> collection.
- </summary>
- <param name="col">The <see cref="T:log4net.Core.Level"/> collection whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Core.LevelCollection.#ctor(log4net.Core.LevelCollection.Tag)">
- <summary>
- Allow subclasses to avoid our default constructors
- </summary>
- <param name="tag"></param>
- </member>
- <member name="M:log4net.Core.LevelCollection.CopyTo(log4net.Core.Level[])">
- <summary>
- Copies the entire <c>LevelCollection</c> to a one-dimensional
- <see cref="T:log4net.Core.Level"/> array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Core.Level"/> array to copy to.</param>
- </member>
- <member name="M:log4net.Core.LevelCollection.CopyTo(log4net.Core.Level[],System.Int32)">
- <summary>
- Copies the entire <c>LevelCollection</c> to a one-dimensional
- <see cref="T:log4net.Core.Level"/> array, starting at the specified index of the target array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Core.Level"/> array to copy to.</param>
- <param name="start">The zero-based index in <paramref name="array"/> at which copying begins.</param>
- </member>
- <member name="M:log4net.Core.LevelCollection.Add(log4net.Core.Level)">
- <summary>
- Adds a <see cref="T:log4net.Core.Level"/> to the end of the <c>LevelCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Core.Level"/> to be added to the end of the <c>LevelCollection</c>.</param>
- <returns>The index at which the value has been added.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.Clear">
- <summary>
- Removes all elements from the <c>LevelCollection</c>.
- </summary>
- </member>
- <member name="M:log4net.Core.LevelCollection.Clone">
- <summary>
- Creates a shallow copy of the <see cref="T:log4net.Core.LevelCollection"/>.
- </summary>
- <returns>A new <see cref="T:log4net.Core.LevelCollection"/> with a shallow copy of the collection data.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.Contains(log4net.Core.Level)">
- <summary>
- Determines whether a given <see cref="T:log4net.Core.Level"/> is in the <c>LevelCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Core.Level"/> to check for.</param>
- <returns><c>true</c> if <paramref name="item"/> is found in the <c>LevelCollection</c>; otherwise, <c>false</c>.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.IndexOf(log4net.Core.Level)">
- <summary>
- Returns the zero-based index of the first occurrence of a <see cref="T:log4net.Core.Level"/>
- in the <c>LevelCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Core.Level"/> to locate in the <c>LevelCollection</c>.</param>
- <returns>
- The zero-based index of the first occurrence of <paramref name="item"/>
- in the entire <c>LevelCollection</c>, if found; otherwise, -1.
- </returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.Insert(System.Int32,log4net.Core.Level)">
- <summary>
- Inserts an element into the <c>LevelCollection</c> at the specified index.
- </summary>
- <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
- <param name="item">The <see cref="T:log4net.Core.Level"/> to insert.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Core.LevelCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.Remove(log4net.Core.Level)">
- <summary>
- Removes the first occurrence of a specific <see cref="T:log4net.Core.Level"/> from the <c>LevelCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Core.Level"/> to remove from the <c>LevelCollection</c>.</param>
- <exception cref="T:System.ArgumentException">
- The specified <see cref="T:log4net.Core.Level"/> was not found in the <c>LevelCollection</c>.
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.RemoveAt(System.Int32)">
- <summary>
- Removes the element at the specified index of the <c>LevelCollection</c>.
- </summary>
- <param name="index">The zero-based index of the element to remove.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Core.LevelCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through the <c>LevelCollection</c>.
- </summary>
- <returns>An <see cref="T:log4net.Core.LevelCollection.Enumerator"/> for the entire <c>LevelCollection</c>.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.AddRange(log4net.Core.LevelCollection)">
- <summary>
- Adds the elements of another <c>LevelCollection</c> to the current <c>LevelCollection</c>.
- </summary>
- <param name="x">The <c>LevelCollection</c> whose elements should be added to the end of the current <c>LevelCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Core.LevelCollection.Count"/> of the <c>LevelCollection</c>.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.AddRange(log4net.Core.Level[])">
- <summary>
- Adds the elements of a <see cref="T:log4net.Core.Level"/> array to the current <c>LevelCollection</c>.
- </summary>
- <param name="x">The <see cref="T:log4net.Core.Level"/> array whose elements should be added to the end of the <c>LevelCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Core.LevelCollection.Count"/> of the <c>LevelCollection</c>.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.AddRange(System.Collections.ICollection)">
- <summary>
- Adds the elements of a <see cref="T:log4net.Core.Level"/> collection to the current <c>LevelCollection</c>.
- </summary>
- <param name="col">The <see cref="T:log4net.Core.Level"/> collection whose elements should be added to the end of the <c>LevelCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Core.LevelCollection.Count"/> of the <c>LevelCollection</c>.</returns>
- </member>
- <member name="M:log4net.Core.LevelCollection.TrimToSize">
- <summary>
- Sets the capacity to the actual number of elements.
- </summary>
- </member>
- <member name="M:log4net.Core.LevelCollection.ValidateIndex(System.Int32)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Core.LevelCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.ValidateIndex(System.Int32,System.Boolean)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Core.LevelCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Core.LevelCollection.Count">
- <summary>
- Gets the number of elements actually contained in the <c>LevelCollection</c>.
- </summary>
- </member>
- <member name="P:log4net.Core.LevelCollection.IsSynchronized">
- <summary>
- Gets a value indicating whether access to the collection is synchronized (thread-safe).
- </summary>
- <value>true if access to the ICollection is synchronized (thread-safe); otherwise, false.</value>
- </member>
- <member name="P:log4net.Core.LevelCollection.SyncRoot">
- <summary>
- Gets an object that can be used to synchronize access to the collection.
- </summary>
- </member>
- <member name="P:log4net.Core.LevelCollection.Item(System.Int32)">
- <summary>
- Gets or sets the <see cref="T:log4net.Core.Level"/> at the specified index.
- </summary>
- <param name="index">The zero-based index of the element to get or set.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Core.LevelCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Core.LevelCollection.IsFixedSize">
- <summary>
- Gets a value indicating whether the collection has a fixed size.
- </summary>
- <value>true if the collection has a fixed size; otherwise, false. The default is false</value>
- </member>
- <member name="P:log4net.Core.LevelCollection.IsReadOnly">
- <summary>
- Gets a value indicating whether the IList is read-only.
- </summary>
- <value>true if the collection is read-only; otherwise, false. The default is false</value>
- </member>
- <member name="P:log4net.Core.LevelCollection.Capacity">
- <summary>
- Gets or sets the number of elements the <c>LevelCollection</c> can contain.
- </summary>
- </member>
- <member name="T:log4net.Core.LevelCollection.ILevelCollectionEnumerator">
- <summary>
- Supports type-safe iteration over a <see cref="T:log4net.Core.LevelCollection"/>.
- </summary>
- </member>
- <member name="M:log4net.Core.LevelCollection.ILevelCollectionEnumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.ILevelCollectionEnumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Core.LevelCollection.ILevelCollectionEnumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- </member>
- <member name="T:log4net.Core.LevelCollection.Tag">
- <summary>
- Type visible only to our subclasses
- Used to access protected constructor
- </summary>
- </member>
- <member name="F:log4net.Core.LevelCollection.Tag.Default">
- <summary>
- A value
- </summary>
- </member>
- <member name="T:log4net.Core.LevelCollection.Enumerator">
- <summary>
- Supports simple iteration over a <see cref="T:log4net.Core.LevelCollection"/>.
- </summary>
- </member>
- <member name="M:log4net.Core.LevelCollection.Enumerator.#ctor(log4net.Core.LevelCollection)">
- <summary>
- Initializes a new instance of the <c>Enumerator</c> class.
- </summary>
- <param name="tc"></param>
- </member>
- <member name="M:log4net.Core.LevelCollection.Enumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Core.LevelCollection.Enumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Core.LevelCollection.Enumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- </member>
- <member name="T:log4net.Core.LevelEvaluator">
- <summary>
- An evaluator that triggers at a threshold level
- </summary>
- <remarks>
- <para>
- This evaluator will trigger if the level of the event
- passed to <see cref="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)"/>
- is equal to or greater than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>
- level.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.LevelEvaluator.m_threshold">
- <summary>
- The threshold for triggering
- </summary>
- </member>
- <member name="M:log4net.Core.LevelEvaluator.#ctor">
- <summary>
- Create a new evaluator using the <see cref="F:log4net.Core.Level.Off"/> threshold.
- </summary>
- <remarks>
- <para>
- Create a new evaluator using the <see cref="F:log4net.Core.Level.Off"/> threshold.
- </para>
- <para>
- This evaluator will trigger if the level of the event
- passed to <see cref="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)"/>
- is equal to or greater than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>
- level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelEvaluator.#ctor(log4net.Core.Level)">
- <summary>
- Create a new evaluator using the specified <see cref="T:log4net.Core.Level"/> threshold.
- </summary>
- <param name="threshold">the threshold to trigger at</param>
- <remarks>
- <para>
- Create a new evaluator using the specified <see cref="T:log4net.Core.Level"/> threshold.
- </para>
- <para>
- This evaluator will trigger if the level of the event
- passed to <see cref="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)"/>
- is equal to or greater than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>
- level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)">
- <summary>
- Is this <paramref name="loggingEvent"/> the triggering event?
- </summary>
- <param name="loggingEvent">The event to check</param>
- <returns>This method returns <c>true</c>, if the event level
- is equal or higher than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>.
- Otherwise it returns <c>false</c></returns>
- <remarks>
- <para>
- This evaluator will trigger if the level of the event
- passed to <see cref="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)"/>
- is equal to or greater than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>
- level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LevelEvaluator.Threshold">
- <summary>
- the threshold to trigger at
- </summary>
- <value>
- The <see cref="T:log4net.Core.Level"/> that will cause this evaluator to trigger
- </value>
- <remarks>
- <para>
- This evaluator will trigger if the level of the event
- passed to <see cref="M:log4net.Core.LevelEvaluator.IsTriggeringEvent(log4net.Core.LoggingEvent)"/>
- is equal to or greater than the <see cref="P:log4net.Core.LevelEvaluator.Threshold"/>
- level.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LevelMap">
- <summary>
- Mapping between string name and Level object
- </summary>
- <remarks>
- <para>
- Mapping between string name and <see cref="T:log4net.Core.Level"/> object.
- This mapping is held separately for each <see cref="T:log4net.Repository.ILoggerRepository"/>.
- The level name is case insensitive.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.LevelMap.m_mapName2Level">
- <summary>
- Mapping from level name to Level object. The
- level name is case insensitive
- </summary>
- </member>
- <member name="M:log4net.Core.LevelMap.#ctor">
- <summary>
- Construct the level map
- </summary>
- <remarks>
- <para>
- Construct the level map.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelMap.Clear">
- <summary>
- Clear the internal maps of all levels
- </summary>
- <remarks>
- <para>
- Clear the internal maps of all levels
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelMap.Add(System.String,System.Int32)">
- <summary>
- Create a new Level and add it to the map
- </summary>
- <param name="name">the string to display for the Level</param>
- <param name="value">the level value to give to the Level</param>
- <remarks>
- <para>
- Create a new Level and add it to the map
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LevelMap.Add(System.String,System.Int32,System.String)"/>
- </member>
- <member name="M:log4net.Core.LevelMap.Add(System.String,System.Int32,System.String)">
- <summary>
- Create a new Level and add it to the map
- </summary>
- <param name="name">the string to display for the Level</param>
- <param name="value">the level value to give to the Level</param>
- <param name="displayName">the display name to give to the Level</param>
- <remarks>
- <para>
- Create a new Level and add it to the map
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelMap.Add(log4net.Core.Level)">
- <summary>
- Add a Level to the map
- </summary>
- <param name="level">the Level to add</param>
- <remarks>
- <para>
- Add a Level to the map
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LevelMap.LookupWithDefault(log4net.Core.Level)">
- <summary>
- Lookup a named level from the map
- </summary>
- <param name="defaultLevel">the name of the level to lookup is taken from this level.
- If the level is not set on the map then this level is added</param>
- <returns>the level in the map with the name specified</returns>
- <remarks>
- <para>
- Lookup a named level from the map. The name of the level to lookup is taken
- from the <see cref="P:log4net.Core.Level.Name"/> property of the <paramref name="defaultLevel"/>
- argument.
- </para>
- <para>
- If no level with the specified name is found then the
- <paramref name="defaultLevel"/> argument is added to the level map
- and returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LevelMap.Item(System.String)">
- <summary>
- Lookup a <see cref="T:log4net.Core.Level"/> by name
- </summary>
- <param name="name">The name of the Level to lookup</param>
- <returns>a Level from the map with the name specified</returns>
- <remarks>
- <para>
- Returns the <see cref="T:log4net.Core.Level"/> from the
- map with the name specified. If the no level is
- found then <c>null</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LevelMap.AllLevels">
- <summary>
- Return all possible levels as a list of Level objects.
- </summary>
- <returns>all possible levels as a list of Level objects</returns>
- <remarks>
- <para>
- Return all possible levels as a list of Level objects.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LocationInfo">
- <summary>
- The internal representation of caller location information.
- </summary>
- <remarks>
- <para>
- This class uses the <c>System.Diagnostics.StackTrace</c> class to generate
- a call stack. The caller's information is then extracted from this stack.
- </para>
- <para>
- The <c>System.Diagnostics.StackTrace</c> class is not supported on the
- .NET Compact Framework 1.0 therefore caller location information is not
- available on that framework.
- </para>
- <para>
- The <c>System.Diagnostics.StackTrace</c> class has this to say about Release builds:
- </para>
- <para>
- "StackTrace information will be most informative with Debug build configurations.
- By default, Debug builds include debug symbols, while Release builds do not. The
- debug symbols contain most of the file, method name, line number, and column
- information used in constructing StackFrame and StackTrace objects. StackTrace
- might not report as many method calls as expected, due to code transformations
- that occur during optimization."
- </para>
- <para>
- This means that in a Release build the caller information may be incomplete or may
- not exist at all! Therefore caller location information cannot be relied upon in a Release build.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Core.LocationInfo.NA">
- <summary>
- When location information is not available the constant
- <c>NA</c> is returned. Current value of this string
- constant is <b>?</b>.
- </summary>
- </member>
- <member name="M:log4net.Core.LocationInfo.#ctor(System.Type)">
- <summary>
- Constructor
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LocationInfo"/>
- class based on the current thread.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LocationInfo.#ctor(System.String,System.String,System.String,System.String)">
- <summary>
- Constructor
- </summary>
- <param name="className">The fully qualified class name.</param>
- <param name="methodName">The method name.</param>
- <param name="fileName">The file name.</param>
- <param name="lineNumber">The line number of the method within the file.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LocationInfo"/>
- class with the specified data.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LocationInfo.ClassName">
- <summary>
- Gets the fully qualified class name of the caller making the logging
- request.
- </summary>
- <value>
- The fully qualified class name of the caller making the logging
- request.
- </value>
- <remarks>
- <para>
- Gets the fully qualified class name of the caller making the logging
- request.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LocationInfo.FileName">
- <summary>
- Gets the file name of the caller.
- </summary>
- <value>
- The file name of the caller.
- </value>
- <remarks>
- <para>
- Gets the file name of the caller.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LocationInfo.LineNumber">
- <summary>
- Gets the line number of the caller.
- </summary>
- <value>
- The line number of the caller.
- </value>
- <remarks>
- <para>
- Gets the line number of the caller.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LocationInfo.MethodName">
- <summary>
- Gets the method name of the caller.
- </summary>
- <value>
- The method name of the caller.
- </value>
- <remarks>
- <para>
- Gets the method name of the caller.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LocationInfo.FullInfo">
- <summary>
- Gets all available caller information
- </summary>
- <value>
- All available caller information, in the format
- <c>fully.qualified.classname.of.caller.methodName(Filename:line)</c>
- </value>
- <remarks>
- <para>
- Gets all available caller information, in the format
- <c>fully.qualified.classname.of.caller.methodName(Filename:line)</c>
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggerManager">
- <summary>
- Static manager that controls the creation of repositories
- </summary>
- <remarks>
- <para>
- Static manager that controls the creation of repositories
- </para>
- <para>
- This class is used by the wrapper managers (e.g. <see cref="T:log4net.LogManager"/>)
- to provide access to the <see cref="T:log4net.Core.ILogger"/> objects.
- </para>
- <para>
- This manager also holds the <see cref="T:log4net.Core.IRepositorySelector"/> that is used to
- lookup and create repositories. The selector can be set either programmatically using
- the <see cref="P:log4net.Core.LoggerManager.RepositorySelector"/> property, or by setting the <c>log4net.RepositorySelector</c>
- AppSetting in the applications config file to the fully qualified type name of the
- selector to use.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.LoggerManager.#ctor">
- <summary>
- Private constructor to prevent instances. Only static methods should be used.
- </summary>
- <remarks>
- <para>
- Private constructor to prevent instances. Only static methods should be used.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.#cctor">
- <summary>
- Hook the shutdown event
- </summary>
- <remarks>
- <para>
- On the full .NET runtime, the static constructor hooks up the
- <c>AppDomain.ProcessExit</c> and <c>AppDomain.DomainUnload</c>> events.
- These are used to shutdown the log4net system as the application exits.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.RegisterAppDomainEvents">
- <summary>
- Register for ProcessExit and DomainUnload events on the AppDomain
- </summary>
- <remarks>
- <para>
- This needs to be in a separate method because the events make
- a LinkDemand for the ControlAppDomain SecurityPermission. Because
- this is a LinkDemand it is demanded at JIT time. Therefore we cannot
- catch the exception in the method itself, we have to catch it in the
- caller.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLoggerRepository(System.String)">
- <summary>
- Return the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <param name="repository">the repository to lookup in</param>
- <returns>Return the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repository"/> argument.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLoggerRepository(System.Reflection.Assembly)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetRepository(System.String)">
- <summary>
- Return the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <param name="repository">the repository to lookup in</param>
- <returns>Return the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repository"/> argument.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetRepository(System.Reflection.Assembly)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- <remarks>
- <para>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.Exists(System.String,System.String)">
- <summary>
- Returns the named logger if it exists.
- </summary>
- <param name="repository">The repository to lookup in.</param>
- <param name="name">The fully qualified logger name to look for.</param>
- <returns>
- The logger found, or <c>null</c> if the named logger does not exist in the
- specified repository.
- </returns>
- <remarks>
- <para>
- If the named logger exists (in the specified repository) then it
- returns a reference to the logger, otherwise it returns
- <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.Exists(System.Reflection.Assembly,System.String)">
- <summary>
- Returns the named logger if it exists.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <param name="name">The fully qualified logger name to look for.</param>
- <returns>
- The logger found, or <c>null</c> if the named logger does not exist in the
- specified assembly's repository.
- </returns>
- <remarks>
- <para>
- If the named logger exists (in the specified assembly's repository) then it
- returns a reference to the logger, otherwise it returns
- <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetCurrentLoggers(System.String)">
- <summary>
- Returns all the currently defined loggers in the specified repository.
- </summary>
- <param name="repository">The repository to lookup in.</param>
- <returns>All the defined loggers.</returns>
- <remarks>
- <para>
- The root logger is <b>not</b> included in the returned array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetCurrentLoggers(System.Reflection.Assembly)">
- <summary>
- Returns all the currently defined loggers in the specified assembly's repository.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <returns>All the defined loggers.</returns>
- <remarks>
- <para>
- The root logger is <b>not</b> included in the returned array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLogger(System.String,System.String)">
- <summary>
- Retrieves or creates a named logger.
- </summary>
- <param name="repository">The repository to lookup in.</param>
- <param name="name">The name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- <remarks>
- <para>
- Retrieves a logger named as the <paramref name="name"/>
- parameter. If the named logger already exists, then the
- existing instance will be returned. Otherwise, a new instance is
- created.
- </para>
- <para>
- By default, loggers do not have a set level but inherit
- it from the hierarchy. This is one of the central features of
- log4net.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLogger(System.Reflection.Assembly,System.String)">
- <summary>
- Retrieves or creates a named logger.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <param name="name">The name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- <remarks>
- <para>
- Retrieves a logger named as the <paramref name="name"/>
- parameter. If the named logger already exists, then the
- existing instance will be returned. Otherwise, a new instance is
- created.
- </para>
- <para>
- By default, loggers do not have a set level but inherit
- it from the hierarchy. This is one of the central features of
- log4net.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLogger(System.String,System.Type)">
- <summary>
- Shorthand for <see cref="M:log4net.LogManager.GetLogger(System.String)"/>.
- </summary>
- <param name="repository">The repository to lookup in.</param>
- <param name="type">The <paramref name="type"/> of which the fullname will be used as the name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- <remarks>
- <para>
- Gets the logger for the fully qualified name of the type specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetLogger(System.Reflection.Assembly,System.Type)">
- <summary>
- Shorthand for <see cref="M:log4net.LogManager.GetLogger(System.String)"/>.
- </summary>
- <param name="repositoryAssembly">the assembly to use to lookup the repository</param>
- <param name="type">The <paramref name="type"/> of which the fullname will be used as the name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- <remarks>
- <para>
- Gets the logger for the fully qualified name of the type specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.Shutdown">
- <summary>
- Shuts down the log4net system.
- </summary>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in all the
- default repositories.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>
- The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.ShutdownRepository(System.String)">
- <summary>
- Shuts down the repository for the repository specified.
- </summary>
- <param name="repository">The repository to shutdown.</param>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in the
- repository for the <paramref name="repository"/> specified.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>
- The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.ShutdownRepository(System.Reflection.Assembly)">
- <summary>
- Shuts down the repository for the repository specified.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in the
- repository for the repository. The repository is looked up using
- the <paramref name="repositoryAssembly"/> specified.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>
- The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.ResetConfiguration(System.String)">
- <summary>
- Resets all values contained in this repository instance to their defaults.
- </summary>
- <param name="repository">The repository to reset.</param>
- <remarks>
- <para>
- Resets all values contained in the repository instance to their
- defaults. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set its default "off" value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.ResetConfiguration(System.Reflection.Assembly)">
- <summary>
- Resets all values contained in this repository instance to their defaults.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository to reset.</param>
- <remarks>
- <para>
- Resets all values contained in the repository instance to their
- defaults. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set its default "off" value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateDomain(System.String)">
- <summary>
- Creates a repository with the specified name.
- </summary>
- <param name="repository">The name of the repository, this must be unique amongst repositories.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- Creates the default type of <see cref="T:log4net.Repository.ILoggerRepository"/> which is a
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> object.
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateRepository(System.String)">
- <summary>
- Creates a repository with the specified name.
- </summary>
- <param name="repository">The name of the repository, this must be unique amongst repositories.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- Creates the default type of <see cref="T:log4net.Repository.ILoggerRepository"/> which is a
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> object.
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateDomain(System.String,System.Type)">
- <summary>
- Creates a repository with the specified name and repository type.
- </summary>
- <param name="repository">The name of the repository, this must be unique to the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An Exception will be thrown if the repository already exists.
- </para>
- </remarks>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateRepository(System.String,System.Type)">
- <summary>
- Creates a repository with the specified name and repository type.
- </summary>
- <param name="repository">The name of the repository, this must be unique to the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An Exception will be thrown if the repository already exists.
- </para>
- </remarks>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateDomain(System.Reflection.Assembly,System.Type)">
- <summary>
- Creates a repository for the specified assembly and repository type.
- </summary>
- <param name="repositoryAssembly">The assembly to use to get the name of the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.LoggerManager.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.CreateRepository(System.Reflection.Assembly,System.Type)">
- <summary>
- Creates a repository for the specified assembly and repository type.
- </summary>
- <param name="repositoryAssembly">The assembly to use to get the name of the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.Core.LoggerManager.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetAllRepositories">
- <summary>
- Gets an array of all currently defined repositories.
- </summary>
- <returns>An array of all the known <see cref="T:log4net.Repository.ILoggerRepository"/> objects.</returns>
- <remarks>
- <para>
- Gets an array of all currently defined repositories.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.GetVersionInfo">
- <summary>
- Internal method to get pertinent version info.
- </summary>
- <returns>A string of version info.</returns>
- </member>
- <member name="M:log4net.Core.LoggerManager.OnDomainUnload(System.Object,System.EventArgs)">
- <summary>
- Called when the <see cref="E:System.AppDomain.DomainUnload"/> event fires
- </summary>
- <param name="sender">the <see cref="T:System.AppDomain"/> that is exiting</param>
- <param name="e">null</param>
- <remarks>
- <para>
- Called when the <see cref="E:System.AppDomain.DomainUnload"/> event fires.
- </para>
- <para>
- When the event is triggered the log4net system is <see cref="M:log4net.Core.LoggerManager.Shutdown"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggerManager.OnProcessExit(System.Object,System.EventArgs)">
- <summary>
- Called when the <see cref="E:System.AppDomain.ProcessExit"/> event fires
- </summary>
- <param name="sender">the <see cref="T:System.AppDomain"/> that is exiting</param>
- <param name="e">null</param>
- <remarks>
- <para>
- Called when the <see cref="E:System.AppDomain.ProcessExit"/> event fires.
- </para>
- <para>
- When the event is triggered the log4net system is <see cref="M:log4net.Core.LoggerManager.Shutdown"/>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggerManager.s_repositorySelector">
- <summary>
- Initialize the default repository selector
- </summary>
- </member>
- <member name="P:log4net.Core.LoggerManager.RepositorySelector">
- <summary>
- Gets or sets the repository selector used by the <see cref="T:log4net.LogManager"/>.
- </summary>
- <value>
- The repository selector used by the <see cref="T:log4net.LogManager"/>.
- </value>
- <remarks>
- <para>
- The repository selector (<see cref="T:log4net.Core.IRepositorySelector"/>) is used by
- the <see cref="T:log4net.LogManager"/> to create and select repositories
- (<see cref="T:log4net.Repository.ILoggerRepository"/>).
- </para>
- <para>
- The caller to <see cref="T:log4net.LogManager"/> supplies either a string name
- or an assembly (if not supplied the assembly is inferred using
- <see cref="M:System.Reflection.Assembly.GetCallingAssembly"/>).
- </para>
- <para>
- This context is used by the selector to lookup a specific repository.
- </para>
- <para>
- For the full .NET Framework, the default repository is <c>DefaultRepositorySelector</c>;
- for the .NET Compact Framework <c>CompactRepositorySelector</c> is the default
- repository.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggerWrapperImpl">
- <summary>
- Implementation of the <see cref="T:log4net.Core.ILoggerWrapper"/> interface.
- </summary>
- <remarks>
- <para>
- This class should be used as the base for all wrapper implementations.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.LoggerWrapperImpl.#ctor(log4net.Core.ILogger)">
- <summary>
- Constructs a new wrapper for the specified logger.
- </summary>
- <param name="logger">The logger to wrap.</param>
- <remarks>
- <para>
- Constructs a new wrapper for the specified logger.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggerWrapperImpl.m_logger">
- <summary>
- The logger that this object is wrapping
- </summary>
- </member>
- <member name="P:log4net.Core.LoggerWrapperImpl.Logger">
- <summary>
- Gets the implementation behind this wrapper object.
- </summary>
- <value>
- The <see cref="T:log4net.Core.ILogger"/> object that this object is implementing.
- </value>
- <remarks>
- <para>
- The <c>Logger</c> object may not be the same object as this object
- because of logger decorators.
- </para>
- <para>
- This gets the actual underlying objects that is used to process
- the log events.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggingEventData">
- <summary>
- Portable data structure used by <see cref="T:log4net.Core.LoggingEvent"/>
- </summary>
- <remarks>
- <para>
- Portable data structure used by <see cref="T:log4net.Core.LoggingEvent"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.LoggingEventData.LoggerName">
- <summary>
- The logger name.
- </summary>
- <remarks>
- <para>
- The logger name.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.Level">
- <summary>
- Level of logging event.
- </summary>
- <remarks>
- <para>
- Level of logging event. Level cannot be Serializable
- because it is a flyweight. Due to its special serialization it
- cannot be declared final either.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.Message">
- <summary>
- The application supplied message.
- </summary>
- <remarks>
- <para>
- The application supplied message of logging event.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.ThreadName">
- <summary>
- The name of thread
- </summary>
- <remarks>
- <para>
- The name of thread in which this logging event was generated
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.TimeStamp">
- <summary>
- The time the event was logged
- </summary>
- <remarks>
- <para>
- The TimeStamp is stored in the local time zone for this computer.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.LocationInfo">
- <summary>
- Location information for the caller.
- </summary>
- <remarks>
- <para>
- Location information for the caller.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.UserName">
- <summary>
- String representation of the user
- </summary>
- <remarks>
- <para>
- String representation of the user's windows name,
- like DOMAIN\username
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.Identity">
- <summary>
- String representation of the identity.
- </summary>
- <remarks>
- <para>
- String representation of the current thread's principal identity.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.ExceptionString">
- <summary>
- The string representation of the exception
- </summary>
- <remarks>
- <para>
- The string representation of the exception
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.Domain">
- <summary>
- String representation of the AppDomain.
- </summary>
- <remarks>
- <para>
- String representation of the AppDomain.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEventData.Properties">
- <summary>
- Additional event specific properties
- </summary>
- <remarks>
- <para>
- A logger or an appender may attach additional
- properties to specific events. These properties
- have a string key and an object value.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.FixFlags">
- <summary>
- Flags passed to the <see cref="P:log4net.Core.LoggingEvent.Fix"/> property
- </summary>
- <remarks>
- <para>
- Flags passed to the <see cref="P:log4net.Core.LoggingEvent.Fix"/> property
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.FixFlags.Mdc">
- <summary>
- Fix the MDC
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.Ndc">
- <summary>
- Fix the NDC
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.Message">
- <summary>
- Fix the rendered message
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.ThreadName">
- <summary>
- Fix the thread name
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.LocationInfo">
- <summary>
- Fix the callers location information
- </summary>
- <remarks>
- CAUTION: Very slow to generate
- </remarks>
- </member>
- <member name="F:log4net.Core.FixFlags.UserName">
- <summary>
- Fix the callers windows user name
- </summary>
- <remarks>
- CAUTION: Slow to generate
- </remarks>
- </member>
- <member name="F:log4net.Core.FixFlags.Domain">
- <summary>
- Fix the domain friendly name
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.Identity">
- <summary>
- Fix the callers principal name
- </summary>
- <remarks>
- CAUTION: May be slow to generate
- </remarks>
- </member>
- <member name="F:log4net.Core.FixFlags.Exception">
- <summary>
- Fix the exception text
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.Properties">
- <summary>
- Fix the event properties
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.None">
- <summary>
- No fields fixed
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.All">
- <summary>
- All fields fixed
- </summary>
- </member>
- <member name="F:log4net.Core.FixFlags.Partial">
- <summary>
- Partial fields fixed
- </summary>
- <remarks>
- <para>
- This set of partial fields gives good performance. The following fields are fixed:
- </para>
- <list type="bullet">
- <item><description><see cref="F:log4net.Core.FixFlags.Message"/></description></item>
- <item><description><see cref="F:log4net.Core.FixFlags.ThreadName"/></description></item>
- <item><description><see cref="F:log4net.Core.FixFlags.Exception"/></description></item>
- <item><description><see cref="F:log4net.Core.FixFlags.Domain"/></description></item>
- <item><description><see cref="F:log4net.Core.FixFlags.Properties"/></description></item>
- </list>
- </remarks>
- </member>
- <member name="T:log4net.Core.LoggingEvent">
- <summary>
- The internal representation of logging events.
- </summary>
- <remarks>
- <para>
- When an affirmative decision is made to log then a
- <see cref="T:log4net.Core.LoggingEvent"/> instance is created. This instance
- is passed around to the different log4net components.
- </para>
- <para>
- This class is of concern to those wishing to extend log4net.
- </para>
- <para>
- Some of the values in instances of <see cref="T:log4net.Core.LoggingEvent"/>
- are considered volatile, that is the values are correct at the
- time the event is delivered to appenders, but will not be consistent
- at any time afterwards. If an event is to be stored and then processed
- at a later time these volatile values must be fixed by calling
- <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/>. There is a performance penalty
- for incurred by calling <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> but it
- is essential to maintaining data consistency.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Douglas de la Torre</author>
- <author>Daniel Cazzulino</author>
- </member>
- <member name="F:log4net.Core.LoggingEvent.HostNameProperty">
- <summary>
- The key into the Properties map for the host name value.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.IdentityProperty">
- <summary>
- The key into the Properties map for the thread identity value.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.UserNameProperty">
- <summary>
- The key into the Properties map for the user name value.
- </summary>
- </member>
- <member name="M:log4net.Core.LoggingEvent.#ctor(System.Type,log4net.Repository.ILoggerRepository,System.String,log4net.Core.Level,System.Object,System.Exception)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Core.LoggingEvent"/> class
- from the supplied parameters.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="repository">The repository this event is logged in.</param>
- <param name="loggerName">The name of the logger of this event.</param>
- <param name="level">The level of this event.</param>
- <param name="message">The message of this event.</param>
- <param name="exception">The exception for this event.</param>
- <remarks>
- <para>
- Except <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/>, <see cref="P:log4net.Core.LoggingEvent.Level"/> and <see cref="P:log4net.Core.LoggingEvent.LoggerName"/>,
- all fields of <c>LoggingEvent</c> are filled when actually needed. Call
- <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> to cache all data locally
- to prevent inconsistencies.
- </para>
- <para>This method is called by the log4net framework
- to create a logging event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.#ctor(System.Type,log4net.Repository.ILoggerRepository,log4net.Core.LoggingEventData,log4net.Core.FixFlags)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Core.LoggingEvent"/> class
- using specific data.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="repository">The repository this event is logged in.</param>
- <param name="data">Data used to initialize the logging event.</param>
- <param name="fixedData">The fields in the <paranref name="data"/> struct that have already been fixed.</param>
- <remarks>
- <para>
- This constructor is provided to allow a <see cref="T:log4net.Core.LoggingEvent"/>
- to be created independently of the log4net framework. This can
- be useful if you require a custom serialization scheme.
- </para>
- <para>
- Use the <see cref="M:log4net.Core.LoggingEvent.GetLoggingEventData(log4net.Core.FixFlags)"/> method to obtain an
- instance of the <see cref="T:log4net.Core.LoggingEventData"/> class.
- </para>
- <para>
- The <paramref name="fixedData"/> parameter should be used to specify which fields in the
- <paramref name="data"/> struct have been preset. Fields not specified in the <paramref name="fixedData"/>
- will be captured from the environment if requested or fixed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.#ctor(System.Type,log4net.Repository.ILoggerRepository,log4net.Core.LoggingEventData)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Core.LoggingEvent"/> class
- using specific data.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="repository">The repository this event is logged in.</param>
- <param name="data">Data used to initialize the logging event.</param>
- <remarks>
- <para>
- This constructor is provided to allow a <see cref="T:log4net.Core.LoggingEvent"/>
- to be created independently of the log4net framework. This can
- be useful if you require a custom serialization scheme.
- </para>
- <para>
- Use the <see cref="M:log4net.Core.LoggingEvent.GetLoggingEventData(log4net.Core.FixFlags)"/> method to obtain an
- instance of the <see cref="T:log4net.Core.LoggingEventData"/> class.
- </para>
- <para>
- This constructor sets this objects <see cref="P:log4net.Core.LoggingEvent.Fix"/> flags to <see cref="F:log4net.Core.FixFlags.All"/>,
- this assumes that all the data relating to this event is passed in via the <paramref name="data"/>
- parameter and no other data should be captured from the environment.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.#ctor(log4net.Core.LoggingEventData)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Core.LoggingEvent"/> class
- using specific data.
- </summary>
- <param name="data">Data used to initialize the logging event.</param>
- <remarks>
- <para>
- This constructor is provided to allow a <see cref="T:log4net.Core.LoggingEvent"/>
- to be created independently of the log4net framework. This can
- be useful if you require a custom serialization scheme.
- </para>
- <para>
- Use the <see cref="M:log4net.Core.LoggingEvent.GetLoggingEventData(log4net.Core.FixFlags)"/> method to obtain an
- instance of the <see cref="T:log4net.Core.LoggingEventData"/> class.
- </para>
- <para>
- This constructor sets this objects <see cref="P:log4net.Core.LoggingEvent.Fix"/> flags to <see cref="F:log4net.Core.FixFlags.All"/>,
- this assumes that all the data relating to this event is passed in via the <paramref name="data"/>
- parameter and no other data should be captured from the environment.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Serialization constructor
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data.</param>
- <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.LoggingEvent"/> class
- with serialized data.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.EnsureRepository(log4net.Repository.ILoggerRepository)">
- <summary>
- Ensure that the repository is set.
- </summary>
- <param name="repository">the value for the repository</param>
- </member>
- <member name="M:log4net.Core.LoggingEvent.WriteRenderedMessage(System.IO.TextWriter)">
- <summary>
- Write the rendered message to a TextWriter
- </summary>
- <param name="writer">the writer to write the message to</param>
- <remarks>
- <para>
- Unlike the <see cref="P:log4net.Core.LoggingEvent.RenderedMessage"/> property this method
- does store the message data in the internal cache. Therefore
- if called only once this method should be faster than the
- <see cref="P:log4net.Core.LoggingEvent.RenderedMessage"/> property, however if the message is
- to be accessed multiple times then the property will be more efficient.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Serializes this object into the <see cref="T:System.Runtime.Serialization.SerializationInfo"/> provided.
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> to populate with data.</param>
- <param name="context">The destination for this serialization.</param>
- <remarks>
- <para>
- The data in this event must be fixed before it can be serialized.
- </para>
- <para>
- The <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> method must be called during the
- <see cref="M:log4net.Appender.IAppender.DoAppend(log4net.Core.LoggingEvent)"/> method call if this event
- is to be used outside that method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetLoggingEventData">
- <summary>
- Gets the portable data for this <see cref="T:log4net.Core.LoggingEvent"/>.
- </summary>
- <returns>The <see cref="T:log4net.Core.LoggingEventData"/> for this event.</returns>
- <remarks>
- <para>
- A new <see cref="T:log4net.Core.LoggingEvent"/> can be constructed using a
- <see cref="T:log4net.Core.LoggingEventData"/> instance.
- </para>
- <para>
- Does a <see cref="F:log4net.Core.FixFlags.Partial"/> fix of the data
- in the logging event before returning the event data.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetLoggingEventData(log4net.Core.FixFlags)">
- <summary>
- Gets the portable data for this <see cref="T:log4net.Core.LoggingEvent"/>.
- </summary>
- <param name="fixFlags">The set of data to ensure is fixed in the LoggingEventData</param>
- <returns>The <see cref="T:log4net.Core.LoggingEventData"/> for this event.</returns>
- <remarks>
- <para>
- A new <see cref="T:log4net.Core.LoggingEvent"/> can be constructed using a
- <see cref="T:log4net.Core.LoggingEventData"/> instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetExceptionStrRep">
- <summary>
- Returns this event's exception's rendered using the
- <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </summary>
- <returns>
- This event's exception's rendered using the <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </returns>
- <remarks>
- <para>
- <b>Obsolete. Use <see cref="M:log4net.Core.LoggingEvent.GetExceptionString"/> instead.</b>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetExceptionString">
- <summary>
- Returns this event's exception's rendered using the
- <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </summary>
- <returns>
- This event's exception's rendered using the <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </returns>
- <remarks>
- <para>
- Returns this event's exception's rendered using the
- <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.FixVolatileData">
- <summary>
- Fix instance fields that hold volatile data.
- </summary>
- <remarks>
- <para>
- Some of the values in instances of <see cref="T:log4net.Core.LoggingEvent"/>
- are considered volatile, that is the values are correct at the
- time the event is delivered to appenders, but will not be consistent
- at any time afterwards. If an event is to be stored and then processed
- at a later time these volatile values must be fixed by calling
- <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/>. There is a performance penalty
- incurred by calling <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> but it
- is essential to maintaining data consistency.
- </para>
- <para>
- Calling <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> is equivalent to
- calling <see cref="M:log4net.Core.LoggingEvent.FixVolatileData(System.Boolean)"/> passing the parameter
- <c>false</c>.
- </para>
- <para>
- See <see cref="M:log4net.Core.LoggingEvent.FixVolatileData(System.Boolean)"/> for more
- information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.FixVolatileData(System.Boolean)">
- <summary>
- Fixes instance fields that hold volatile data.
- </summary>
- <param name="fastButLoose">Set to <c>true</c> to not fix data that takes a long time to fix.</param>
- <remarks>
- <para>
- Some of the values in instances of <see cref="T:log4net.Core.LoggingEvent"/>
- are considered volatile, that is the values are correct at the
- time the event is delivered to appenders, but will not be consistent
- at any time afterwards. If an event is to be stored and then processed
- at a later time these volatile values must be fixed by calling
- <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/>. There is a performance penalty
- for incurred by calling <see cref="M:log4net.Core.LoggingEvent.FixVolatileData"/> but it
- is essential to maintaining data consistency.
- </para>
- <para>
- The <paramref name="fastButLoose"/> param controls the data that
- is fixed. Some of the data that can be fixed takes a long time to
- generate, therefore if you do not require those settings to be fixed
- they can be ignored by setting the <paramref name="fastButLoose"/> param
- to <c>true</c>. This setting will ignore the <see cref="P:log4net.Core.LoggingEvent.LocationInformation"/>
- and <see cref="P:log4net.Core.LoggingEvent.UserName"/> settings.
- </para>
- <para>
- Set <paramref name="fastButLoose"/> to <c>false</c> to ensure that all
- settings are fixed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.FixVolatileData(log4net.Core.FixFlags)">
- <summary>
- Fix the fields specified by the <see cref="T:log4net.Core.FixFlags"/> parameter
- </summary>
- <param name="flags">the fields to fix</param>
- <remarks>
- <para>
- Only fields specified in the <paramref name="flags"/> will be fixed.
- Fields will not be fixed if they have previously been fixed.
- It is not possible to 'unfix' a field.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.LookupProperty(System.String)">
- <summary>
- Lookup a composite property in this event
- </summary>
- <param name="key">the key for the property to lookup</param>
- <returns>the value for the property</returns>
- <remarks>
- <para>
- This event has composite properties that combine together properties from
- several different contexts in the following order:
- <list type="definition">
- <item>
- <term>this events properties</term>
- <description>
- This event has <see cref="P:log4net.Core.LoggingEvent.Properties"/> that can be set. These
- properties are specific to this event only.
- </description>
- </item>
- <item>
- <term>the thread properties</term>
- <description>
- The <see cref="P:log4net.ThreadContext.Properties"/> that are set on the current
- thread. These properties are shared by all events logged on this thread.
- </description>
- </item>
- <item>
- <term>the global properties</term>
- <description>
- The <see cref="P:log4net.GlobalContext.Properties"/> that are set globally. These
- properties are shared by all the threads in the AppDomain.
- </description>
- </item>
- </list>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LoggingEvent.GetProperties">
- <summary>
- Get all the composite properties in this event
- </summary>
- <returns>the <see cref="T:log4net.Util.PropertiesDictionary"/> containing all the properties</returns>
- <remarks>
- <para>
- See <see cref="M:log4net.Core.LoggingEvent.LookupProperty(System.String)"/> for details of the composite properties
- stored by the event.
- </para>
- <para>
- This method returns a single <see cref="T:log4net.Util.PropertiesDictionary"/> containing all the
- properties defined for this event.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_data">
- <summary>
- The internal logging event data.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_compositeProperties">
- <summary>
- The internal logging event data.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_eventProperties">
- <summary>
- The internal logging event data.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_callerStackBoundaryDeclaringType">
- <summary>
- The fully qualified Type of the calling
- logger class in the stack frame (i.e. the declaring type of the method).
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_message">
- <summary>
- The application supplied message of logging event.
- </summary>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_thrownException">
- <summary>
- The exception that was thrown.
- </summary>
- <remarks>
- This is not serialized. The string representation
- is serialized instead.
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_repository">
- <summary>
- The repository that generated the logging event
- </summary>
- <remarks>
- This is not serialized.
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_fixFlags">
- <summary>
- The fix state for this event
- </summary>
- <remarks>
- These flags indicate which fields have been fixed.
- Not serialized.
- </remarks>
- </member>
- <member name="F:log4net.Core.LoggingEvent.m_cacheUpdatable">
- <summary>
- Indicated that the internal cache is updateable (ie not fixed)
- </summary>
- <remarks>
- This is a seperate flag to m_fixFlags as it allows incrementel fixing and simpler
- changes in the caching strategy.
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.StartTime">
- <summary>
- Gets the time when the current process started.
- </summary>
- <value>
- This is the time when this process started.
- </value>
- <remarks>
- <para>
- The TimeStamp is stored in the local time zone for this computer.
- </para>
- <para>
- Tries to get the start time for the current process.
- Failing that it returns the time of the first call to
- this property.
- </para>
- <para>
- Note that AppDomains may be loaded and unloaded within the
- same process without the process terminating and therefore
- without the process start time being reset.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Level">
- <summary>
- Gets the <see cref="P:log4net.Core.LoggingEvent.Level"/> of the logging event.
- </summary>
- <value>
- The <see cref="P:log4net.Core.LoggingEvent.Level"/> of the logging event.
- </value>
- <remarks>
- <para>
- Gets the <see cref="P:log4net.Core.LoggingEvent.Level"/> of the logging event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.TimeStamp">
- <summary>
- Gets the time of the logging event.
- </summary>
- <value>
- The time of the logging event.
- </value>
- <remarks>
- <para>
- The TimeStamp is stored in the local time zone for this computer.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.LoggerName">
- <summary>
- Gets the name of the logger that logged the event.
- </summary>
- <value>
- The name of the logger that logged the event.
- </value>
- <remarks>
- <para>
- Gets the name of the logger that logged the event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.LocationInformation">
- <summary>
- Gets the location information for this logging event.
- </summary>
- <value>
- The location information for this logging event.
- </value>
- <remarks>
- <para>
- The collected information is cached for future use.
- </para>
- <para>
- See the <see cref="T:log4net.Core.LocationInfo"/> class for more information on
- supported frameworks and the different behavior in Debug and
- Release builds.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.MessageObject">
- <summary>
- Gets the message object used to initialize this event.
- </summary>
- <value>
- The message object used to initialize this event.
- </value>
- <remarks>
- <para>
- Gets the message object used to initialize this event.
- Note that this event may not have a valid message object.
- If the event is serialized the message object will not
- be transferred. To get the text of the message the
- <see cref="P:log4net.Core.LoggingEvent.RenderedMessage"/> property must be used
- not this property.
- </para>
- <para>
- If there is no defined message object for this event then
- null will be returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.ExceptionObject">
- <summary>
- Gets the exception object used to initialize this event.
- </summary>
- <value>
- The exception object used to initialize this event.
- </value>
- <remarks>
- <para>
- Gets the exception object used to initialize this event.
- Note that this event may not have a valid exception object.
- If the event is serialized the exception object will not
- be transferred. To get the text of the exception the
- <see cref="M:log4net.Core.LoggingEvent.GetExceptionString"/> method must be used
- not this property.
- </para>
- <para>
- If there is no defined exception object for this event then
- null will be returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Repository">
- <summary>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that this event was created in.
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that this event was created in.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.RenderedMessage">
- <summary>
- Gets the message, rendered through the <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </summary>
- <value>
- The message rendered through the <see cref="P:log4net.Repository.ILoggerRepository.RendererMap"/>.
- </value>
- <remarks>
- <para>
- The collected information is cached for future use.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.ThreadName">
- <summary>
- Gets the name of the current thread.
- </summary>
- <value>
- The name of the current thread, or the thread ID when
- the name is not available.
- </value>
- <remarks>
- <para>
- The collected information is cached for future use.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.UserName">
- <summary>
- Gets the name of the current user.
- </summary>
- <value>
- The name of the current user, or <c>NOT AVAILABLE</c> when the
- underlying runtime has no support for retrieving the name of the
- current user.
- </value>
- <remarks>
- <para>
- Calls <c>WindowsIdentity.GetCurrent().Name</c> to get the name of
- the current windows user.
- </para>
- <para>
- To improve performance, we could cache the string representation of
- the name, and reuse that as long as the identity stayed constant.
- Once the identity changed, we would need to re-assign and re-render
- the string.
- </para>
- <para>
- However, the <c>WindowsIdentity.GetCurrent()</c> call seems to
- return different objects every time, so the current implementation
- doesn't do this type of caching.
- </para>
- <para>
- Timing for these operations:
- </para>
- <list type="table">
- <listheader>
- <term>Method</term>
- <description>Results</description>
- </listheader>
- <item>
- <term><c>WindowsIdentity.GetCurrent()</c></term>
- <description>10000 loops, 00:00:00.2031250 seconds</description>
- </item>
- <item>
- <term><c>WindowsIdentity.GetCurrent().Name</c></term>
- <description>10000 loops, 00:00:08.0468750 seconds</description>
- </item>
- </list>
- <para>
- This means we could speed things up almost 40 times by caching the
- value of the <c>WindowsIdentity.GetCurrent().Name</c> property, since
- this takes (8.04-0.20) = 7.84375 seconds.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Identity">
- <summary>
- Gets the identity of the current thread principal.
- </summary>
- <value>
- The string name of the identity of the current thread principal.
- </value>
- <remarks>
- <para>
- Calls <c>System.Threading.Thread.CurrentPrincipal.Identity.Name</c> to get
- the name of the current thread principal.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Domain">
- <summary>
- Gets the AppDomain friendly name.
- </summary>
- <value>
- The AppDomain friendly name.
- </value>
- <remarks>
- <para>
- Gets the AppDomain friendly name.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Properties">
- <summary>
- Additional event specific properties.
- </summary>
- <value>
- Additional event specific properties.
- </value>
- <remarks>
- <para>
- A logger or an appender may attach additional
- properties to specific events. These properties
- have a string key and an object value.
- </para>
- <para>
- This property is for events that have been added directly to
- this event. The aggregate properties (which include these
- event properties) can be retrieved using <see cref="M:log4net.Core.LoggingEvent.LookupProperty(System.String)"/>
- and <see cref="M:log4net.Core.LoggingEvent.GetProperties"/>.
- </para>
- <para>
- Once the properties have been fixed <see cref="P:log4net.Core.LoggingEvent.Fix"/> this property
- returns the combined cached properties. This ensures that updates to
- this property are always reflected in the underlying storage. When
- returning the combined properties there may be more keys in the
- Dictionary than expected.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LoggingEvent.Fix">
- <summary>
- The fixed fields in this event
- </summary>
- <value>
- The set of fields that are fixed in this event
- </value>
- <remarks>
- <para>
- Fields will not be fixed if they have previously been fixed.
- It is not possible to 'unfix' a field.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.LogImpl">
- <summary>
- Implementation of <see cref="T:log4net.ILog"/> wrapper interface.
- </summary>
- <remarks>
- <para>
- This implementation of the <see cref="T:log4net.ILog"/> interface
- forwards to the <see cref="T:log4net.Core.ILogger"/> held by the base class.
- </para>
- <para>
- This logger has methods to allow the caller to log at the following
- levels:
- </para>
- <list type="definition">
- <item>
- <term>DEBUG</term>
- <description>
- The <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/> and <see cref="M:log4net.Core.LogImpl.DebugFormat(System.String,System.Object[])"/> methods log messages
- at the <c>DEBUG</c> level. That is the level with that name defined in the
- repositories <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>. The default value
- for this level is <see cref="F:log4net.Core.Level.Debug"/>. The <see cref="P:log4net.Core.LogImpl.IsDebugEnabled"/>
- property tests if this level is enabled for logging.
- </description>
- </item>
- <item>
- <term>INFO</term>
- <description>
- The <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/> and <see cref="M:log4net.Core.LogImpl.InfoFormat(System.String,System.Object[])"/> methods log messages
- at the <c>INFO</c> level. That is the level with that name defined in the
- repositories <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>. The default value
- for this level is <see cref="F:log4net.Core.Level.Info"/>. The <see cref="P:log4net.Core.LogImpl.IsInfoEnabled"/>
- property tests if this level is enabled for logging.
- </description>
- </item>
- <item>
- <term>WARN</term>
- <description>
- The <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/> and <see cref="M:log4net.Core.LogImpl.WarnFormat(System.String,System.Object[])"/> methods log messages
- at the <c>WARN</c> level. That is the level with that name defined in the
- repositories <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>. The default value
- for this level is <see cref="F:log4net.Core.Level.Warn"/>. The <see cref="P:log4net.Core.LogImpl.IsWarnEnabled"/>
- property tests if this level is enabled for logging.
- </description>
- </item>
- <item>
- <term>ERROR</term>
- <description>
- The <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/> and <see cref="M:log4net.Core.LogImpl.ErrorFormat(System.String,System.Object[])"/> methods log messages
- at the <c>ERROR</c> level. That is the level with that name defined in the
- repositories <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>. The default value
- for this level is <see cref="F:log4net.Core.Level.Error"/>. The <see cref="P:log4net.Core.LogImpl.IsErrorEnabled"/>
- property tests if this level is enabled for logging.
- </description>
- </item>
- <item>
- <term>FATAL</term>
- <description>
- The <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/> and <see cref="M:log4net.Core.LogImpl.FatalFormat(System.String,System.Object[])"/> methods log messages
- at the <c>FATAL</c> level. That is the level with that name defined in the
- repositories <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/>. The default value
- for this level is <see cref="F:log4net.Core.Level.Fatal"/>. The <see cref="P:log4net.Core.LogImpl.IsFatalEnabled"/>
- property tests if this level is enabled for logging.
- </description>
- </item>
- </list>
- <para>
- The values for these levels and their semantic meanings can be changed by
- configuring the <see cref="P:log4net.Repository.ILoggerRepository.LevelMap"/> for the repository.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.ILog">
- <summary>
- The ILog interface is use by application to log messages into
- the log4net framework.
- </summary>
- <remarks>
- <para>
- Use the <see cref="T:log4net.LogManager"/> to obtain logger instances
- that implement this interface. The <see cref="M:log4net.LogManager.GetLogger(System.Reflection.Assembly,System.Type)"/>
- static method is used to get logger instances.
- </para>
- <para>
- This class contains methods for logging at different levels and also
- has properties for determining if those logging levels are
- enabled in the current configuration.
- </para>
- <para>
- This interface can be implemented in different ways. This documentation
- specifies reasonable behavior that a caller can expect from the actual
- implementation, however different implementations reserve the right to
- do things differently.
- </para>
- </remarks>
- <example>Simple example of logging messages
- <code lang="C#">
- ILog log = LogManager.GetLogger("application-log");
-
- log.Info("Application Start");
- log.Debug("This is a debug message");
-
- if (log.IsDebugEnabled)
- {
- log.Debug("This is another debug message");
- }
- </code>
- </example>
- <seealso cref="T:log4net.LogManager"/>
- <seealso cref="M:log4net.LogManager.GetLogger(System.Reflection.Assembly,System.Type)"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.ILog.Debug(System.Object)">
- <overloads>Log a message object with the <see cref="F:log4net.Core.Level.Debug"/> level.</overloads>
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>DEBUG</c>
- enabled by comparing the level of this logger with the
- <see cref="F:log4net.Core.Level.Debug"/> level. If this logger is
- <c>DEBUG</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of
- the additivity flag.
- </para>
- <para><b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.Debug(System.Object,System.Exception)">
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Debug"/> level including
- the stack trace of the <see cref="T:System.Exception"/> passed
- as a parameter.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- See the <see cref="M:log4net.ILog.Debug(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.DebugFormat(System.String,System.Object[])">
- <overloads>Log a formatted string with the <see cref="F:log4net.Core.Level.Debug"/> level.</overloads>
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.DebugFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.DebugFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.DebugFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.DebugFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Debug(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.ILog.Info(System.Object)">
- <overloads>Log a message object with the <see cref="F:log4net.Core.Level.Info"/> level.</overloads>
- <summary>
- Logs a message object with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <remarks>
- <para>
- This method first checks if this logger is <c>INFO</c>
- enabled by comparing the level of this logger with the
- <see cref="F:log4net.Core.Level.Info"/> level. If this logger is
- <c>INFO</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para><b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.ILog.Info(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- <param name="message">The message object to log.</param>
- <seealso cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.Info(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>INFO</c> level including
- the stack trace of the <see cref="T:System.Exception"/> passed
- as a parameter.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- See the <see cref="M:log4net.ILog.Info(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.InfoFormat(System.String,System.Object[])">
- <overloads>Log a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.</overloads>
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.InfoFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.InfoFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.InfoFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.InfoFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsInfoEnabled"/>
- </member>
- <member name="M:log4net.ILog.Warn(System.Object)">
- <overloads>Log a message object with the <see cref="F:log4net.Core.Level.Warn"/> level.</overloads>
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <remarks>
- <para>
- This method first checks if this logger is <c>WARN</c>
- enabled by comparing the level of this logger with the
- <see cref="F:log4net.Core.Level.Warn"/> level. If this logger is
- <c>WARN</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para><b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- <param name="message">The message object to log.</param>
- <seealso cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.Warn(System.Object,System.Exception)">
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Warn"/> level including
- the stack trace of the <see cref="T:System.Exception"/> passed
- as a parameter.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- See the <see cref="M:log4net.ILog.Warn(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.WarnFormat(System.String,System.Object[])">
- <overloads>Log a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.</overloads>
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.WarnFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.WarnFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.WarnFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.WarnFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsWarnEnabled"/>
- </member>
- <member name="M:log4net.ILog.Error(System.Object)">
- <overloads>Log a message object with the <see cref="F:log4net.Core.Level.Error"/> level.</overloads>
- <summary>
- Logs a message object with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>ERROR</c>
- enabled by comparing the level of this logger with the
- <see cref="F:log4net.Core.Level.Error"/> level. If this logger is
- <c>ERROR</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para><b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.ILog.Error(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.Error(System.Object,System.Exception)">
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Error"/> level including
- the stack trace of the <see cref="T:System.Exception"/> passed
- as a parameter.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- See the <see cref="M:log4net.ILog.Error(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.ErrorFormat(System.String,System.Object[])">
- <overloads>Log a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.</overloads>
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.ErrorFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.ErrorFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.ErrorFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.ErrorFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsErrorEnabled"/>
- </member>
- <member name="M:log4net.ILog.Fatal(System.Object)">
- <overloads>Log a message object with the <see cref="F:log4net.Core.Level.Fatal"/> level.</overloads>
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <remarks>
- <para>
- This method first checks if this logger is <c>FATAL</c>
- enabled by comparing the level of this logger with the
- <see cref="F:log4net.Core.Level.Fatal"/> level. If this logger is
- <c>FATAL</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para><b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- <param name="message">The message object to log.</param>
- <seealso cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.Fatal(System.Object,System.Exception)">
- <summary>
- Log a message object with the <see cref="F:log4net.Core.Level.Fatal"/> level including
- the stack trace of the <see cref="T:System.Exception"/> passed
- as a parameter.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- See the <see cref="M:log4net.ILog.Fatal(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.FatalFormat(System.String,System.Object[])">
- <overloads>Log a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.</overloads>
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.FatalFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.FatalFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.FatalFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="M:log4net.ILog.FatalFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <c>String.Format</c> method. See
- <see cref="M:System.String.Format(System.String,System.Object[])"/> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.ILog.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object,System.Exception)"/>
- <seealso cref="P:log4net.ILog.IsFatalEnabled"/>
- </member>
- <member name="P:log4net.ILog.IsDebugEnabled">
- <summary>
- Checks if this logger is enabled for the <see cref="F:log4net.Core.Level.Debug"/> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <see cref="F:log4net.Core.Level.Debug"/> events, <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- This function is intended to lessen the computational cost of
- disabled log debug statements.
- </para>
- <para> For some ILog interface <c>log</c>, when you write:</para>
- <code lang="C#">
- log.Debug("This is entry number: " + i );
- </code>
- <para>
- You incur the cost constructing the message, string construction and concatenation in
- this case, regardless of whether the message is logged or not.
- </para>
- <para>
- If you are worried about speed (who isn't), then you should write:
- </para>
- <code lang="C#">
- if (log.IsDebugEnabled)
- {
- log.Debug("This is entry number: " + i );
- }
- </code>
- <para>
- This way you will not incur the cost of parameter
- construction if debugging is disabled for <c>log</c>. On
- the other hand, if the <c>log</c> is debug enabled, you
- will incur the cost of evaluating whether the logger is debug
- enabled twice. Once in <see cref="P:log4net.ILog.IsDebugEnabled"/> and once in
- the <see cref="M:log4net.ILog.Debug(System.Object)"/>. This is an insignificant overhead
- since evaluating a logger takes about 1% of the time it
- takes to actually log. This is the preferred style of logging.
- </para>
- <para>Alternatively if your logger is available statically then the is debug
- enabled state can be stored in a static variable like this:
- </para>
- <code lang="C#">
- private static readonly bool isDebugEnabled = log.IsDebugEnabled;
- </code>
- <para>
- Then when you come to log you can write:
- </para>
- <code lang="C#">
- if (isDebugEnabled)
- {
- log.Debug("This is entry number: " + i );
- }
- </code>
- <para>
- This way the debug enabled state is only queried once
- when the class is loaded. Using a <c>private static readonly</c>
- variable is the most efficient because it is a run time constant
- and can be heavily optimized by the JIT compiler.
- </para>
- <para>
- Of course if you use a static readonly variable to
- hold the enabled state of the logger then you cannot
- change the enabled state at runtime to vary the logging
- that is produced. You have to decide if you need absolute
- speed or runtime flexibility.
- </para>
- </remarks>
- <seealso cref="M:log4net.ILog.Debug(System.Object)"/>
- <seealso cref="M:log4net.ILog.DebugFormat(System.IFormatProvider,System.String,System.Object[])"/>
- </member>
- <member name="P:log4net.ILog.IsInfoEnabled">
- <summary>
- Checks if this logger is enabled for the <see cref="F:log4net.Core.Level.Info"/> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <see cref="F:log4net.Core.Level.Info"/> events, <c>false</c> otherwise.
- </value>
- <remarks>
- For more information see <see cref="P:log4net.ILog.IsDebugEnabled"/>.
- </remarks>
- <seealso cref="M:log4net.ILog.Info(System.Object)"/>
- <seealso cref="M:log4net.ILog.InfoFormat(System.IFormatProvider,System.String,System.Object[])"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.ILog.IsWarnEnabled">
- <summary>
- Checks if this logger is enabled for the <see cref="F:log4net.Core.Level.Warn"/> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <see cref="F:log4net.Core.Level.Warn"/> events, <c>false</c> otherwise.
- </value>
- <remarks>
- For more information see <see cref="P:log4net.ILog.IsDebugEnabled"/>.
- </remarks>
- <seealso cref="M:log4net.ILog.Warn(System.Object)"/>
- <seealso cref="M:log4net.ILog.WarnFormat(System.IFormatProvider,System.String,System.Object[])"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.ILog.IsErrorEnabled">
- <summary>
- Checks if this logger is enabled for the <see cref="F:log4net.Core.Level.Error"/> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <see cref="F:log4net.Core.Level.Error"/> events, <c>false</c> otherwise.
- </value>
- <remarks>
- For more information see <see cref="P:log4net.ILog.IsDebugEnabled"/>.
- </remarks>
- <seealso cref="M:log4net.ILog.Error(System.Object)"/>
- <seealso cref="M:log4net.ILog.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.ILog.IsFatalEnabled">
- <summary>
- Checks if this logger is enabled for the <see cref="F:log4net.Core.Level.Fatal"/> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <see cref="F:log4net.Core.Level.Fatal"/> events, <c>false</c> otherwise.
- </value>
- <remarks>
- For more information see <see cref="P:log4net.ILog.IsDebugEnabled"/>.
- </remarks>
- <seealso cref="M:log4net.ILog.Fatal(System.Object)"/>
- <seealso cref="M:log4net.ILog.FatalFormat(System.IFormatProvider,System.String,System.Object[])"/>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="M:log4net.Core.LogImpl.#ctor(log4net.Core.ILogger)">
- <summary>
- Construct a new wrapper for the specified logger.
- </summary>
- <param name="logger">The logger to wrap.</param>
- <remarks>
- <para>
- Construct a new wrapper for the specified logger.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.ReloadLevels(log4net.Repository.ILoggerRepository)">
- <summary>
- Virtual method called when the configuration of the repository changes
- </summary>
- <param name="repository">the repository holding the levels</param>
- <remarks>
- <para>
- Virtual method called when the configuration of the repository changes
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Debug(System.Object)">
- <summary>
- Logs a message object with the <c>DEBUG</c> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>DEBUG</c>
- enabled by comparing the level of this logger with the
- <c>DEBUG</c> level. If this logger is
- <c>DEBUG</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para>
- <b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.Core.LogImpl.Debug(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Debug(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>DEBUG</c> level
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Logs a message object with the <c>DEBUG</c> level including
- the stack trace of the <see cref="T:System.Exception"/> <paramref name="exception"/> passed
- as a parameter.
- </para>
- <para>
- See the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- </member>
- <member name="M:log4net.Core.LogImpl.DebugFormat(System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>DEBUG</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.DebugFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.DebugFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <c>DEBUG</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.DebugFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.DebugFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>DEBUG</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.DebugFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.DebugFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>DEBUG</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.DebugFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.DebugFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>DEBUG</c> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Debug(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Info(System.Object)">
- <summary>
- Logs a message object with the <c>INFO</c> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>INFO</c>
- enabled by comparing the level of this logger with the
- <c>INFO</c> level. If this logger is
- <c>INFO</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger
- and also higher in the hierarchy depending on the value of
- the additivity flag.
- </para>
- <para>
- <b>WARNING</b> Note that passing an <see cref="T:System.Exception"/>
- to this method will print the name of the <see cref="T:System.Exception"/>
- but no stack trace. To print a stack trace use the
- <see cref="M:log4net.Core.LogImpl.Info(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Info(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>INFO</c> level.
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Logs a message object with the <c>INFO</c> level including
- the stack trace of the <see cref="T:System.Exception"/> <paramref name="exception"/>
- passed as a parameter.
- </para>
- <para>
- See the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- </member>
- <member name="M:log4net.Core.LogImpl.InfoFormat(System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>INFO</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.InfoFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.InfoFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <c>INFO</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.InfoFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.InfoFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>INFO</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.InfoFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.InfoFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>INFO</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.InfoFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.InfoFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>INFO</c> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Info(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Warn(System.Object)">
- <summary>
- Logs a message object with the <c>WARN</c> level.
- </summary>
- <param name="message">the message object to log</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>WARN</c>
- enabled by comparing the level of this logger with the
- <c>WARN</c> level. If this logger is
- <c>WARN</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger and
- also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para>
- <b>WARNING</b> Note that passing an <see cref="T:System.Exception"/> to this
- method will print the name of the <see cref="T:System.Exception"/> but no
- stack trace. To print a stack trace use the
- <see cref="M:log4net.Core.LogImpl.Warn(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Warn(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>WARN</c> level
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Logs a message object with the <c>WARN</c> level including
- the stack trace of the <see cref="T:System.Exception"/> <paramref name="exception"/>
- passed as a parameter.
- </para>
- <para>
- See the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- </member>
- <member name="M:log4net.Core.LogImpl.WarnFormat(System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>WARN</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.WarnFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.WarnFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <c>WARN</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.WarnFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.WarnFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>WARN</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.WarnFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.WarnFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>WARN</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.WarnFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.WarnFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>WARN</c> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Warn(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Error(System.Object)">
- <summary>
- Logs a message object with the <c>ERROR</c> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>ERROR</c>
- enabled by comparing the level of this logger with the
- <c>ERROR</c> level. If this logger is
- <c>ERROR</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger and
- also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para>
- <b>WARNING</b> Note that passing an <see cref="T:System.Exception"/> to this
- method will print the name of the <see cref="T:System.Exception"/> but no
- stack trace. To print a stack trace use the
- <see cref="M:log4net.Core.LogImpl.Error(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Error(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>ERROR</c> level
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Logs a message object with the <c>ERROR</c> level including
- the stack trace of the <see cref="T:System.Exception"/> <paramref name="exception"/>
- passed as a parameter.
- </para>
- <para>
- See the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- </member>
- <member name="M:log4net.Core.LogImpl.ErrorFormat(System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>ERROR</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.ErrorFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <c>ERROR</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.ErrorFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>ERROR</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.ErrorFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>ERROR</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.ErrorFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.ErrorFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>ERROR</c> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Error(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Fatal(System.Object)">
- <summary>
- Logs a message object with the <c>FATAL</c> level.
- </summary>
- <param name="message">The message object to log.</param>
- <remarks>
- <para>
- This method first checks if this logger is <c>FATAL</c>
- enabled by comparing the level of this logger with the
- <c>FATAL</c> level. If this logger is
- <c>FATAL</c> enabled, then it converts the message object
- (passed as parameter) to a string by invoking the appropriate
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>. It then
- proceeds to call all the registered appenders in this logger and
- also higher in the hierarchy depending on the value of the
- additivity flag.
- </para>
- <para>
- <b>WARNING</b> Note that passing an <see cref="T:System.Exception"/> to this
- method will print the name of the <see cref="T:System.Exception"/> but no
- stack trace. To print a stack trace use the
- <see cref="M:log4net.Core.LogImpl.Fatal(System.Object,System.Exception)"/> form instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.Fatal(System.Object,System.Exception)">
- <summary>
- Logs a message object with the <c>FATAL</c> level
- </summary>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Logs a message object with the <c>FATAL</c> level including
- the stack trace of the <see cref="T:System.Exception"/> <paramref name="exception"/>
- passed as a parameter.
- </para>
- <para>
- See the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/> form for more detailed information.
- </para>
- </remarks>
- <seealso cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- </member>
- <member name="M:log4net.Core.LogImpl.FatalFormat(System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>FATAL</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.FatalFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.FatalFormat(System.String,System.Object)">
- <summary>
- Logs a formatted message string with the <c>FATAL</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.FatalFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.FatalFormat(System.String,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>FATAL</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.FatalFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.FatalFormat(System.String,System.Object,System.Object,System.Object)">
- <summary>
- Logs a formatted message string with the <c>FATAL</c> level.
- </summary>
- <param name="format">A String containing zero or more format items</param>
- <param name="arg0">An Object to format</param>
- <param name="arg1">An Object to format</param>
- <param name="arg2">An Object to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- The string is formatted using the <see cref="P:System.Globalization.CultureInfo.InvariantCulture"/>
- format provider. To specify a localized provider use the
- <see cref="M:log4net.Core.LogImpl.FatalFormat(System.IFormatProvider,System.String,System.Object[])"/> method.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.FatalFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Logs a formatted message string with the <c>FATAL</c> level.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information</param>
- <param name="format">A String containing zero or more format items</param>
- <param name="args">An Object array containing zero or more objects to format</param>
- <remarks>
- <para>
- The message is formatted using the <see cref="M:System.String.Format(System.IFormatProvider,System.String,System.Object[])"/> method. See
- <c>String.Format</c> for details of the syntax of the format string and the behavior
- of the formatting.
- </para>
- <para>
- This method does not take an <see cref="T:System.Exception"/> object to include in the
- log event. To pass an <see cref="T:System.Exception"/> use one of the <see cref="M:log4net.Core.LogImpl.Fatal(System.Object)"/>
- methods instead.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.LogImpl.LoggerRepositoryConfigurationChanged(System.Object,System.EventArgs)">
- <summary>
- Event handler for the <see cref="E:log4net.Repository.ILoggerRepository.ConfigurationChanged"/> event
- </summary>
- <param name="sender">the repository</param>
- <param name="e">Empty</param>
- </member>
- <member name="F:log4net.Core.LogImpl.ThisDeclaringType">
- <summary>
- The fully qualified name of this declaring type not the type of any subclass.
- </summary>
- </member>
- <member name="P:log4net.Core.LogImpl.IsDebugEnabled">
- <summary>
- Checks if this logger is enabled for the <c>DEBUG</c>
- level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <c>DEBUG</c> events,
- <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- This function is intended to lessen the computational cost of
- disabled log debug statements.
- </para>
- <para>
- For some <c>log</c> Logger object, when you write:
- </para>
- <code lang="C#">
- log.Debug("This is entry number: " + i );
- </code>
- <para>
- You incur the cost constructing the message, concatenation in
- this case, regardless of whether the message is logged or not.
- </para>
- <para>
- If you are worried about speed, then you should write:
- </para>
- <code lang="C#">
- if (log.IsDebugEnabled())
- {
- log.Debug("This is entry number: " + i );
- }
- </code>
- <para>
- This way you will not incur the cost of parameter
- construction if debugging is disabled for <c>log</c>. On
- the other hand, if the <c>log</c> is debug enabled, you
- will incur the cost of evaluating whether the logger is debug
- enabled twice. Once in <c>IsDebugEnabled</c> and once in
- the <c>Debug</c>. This is an insignificant overhead
- since evaluating a logger takes about 1% of the time it
- takes to actually log.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.LogImpl.IsInfoEnabled">
- <summary>
- Checks if this logger is enabled for the <c>INFO</c> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <c>INFO</c> events,
- <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- See <see cref="P:log4net.Core.LogImpl.IsDebugEnabled"/> for more information and examples
- of using this method.
- </para>
- </remarks>
- <seealso cref="P:log4net.Core.LogImpl.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.Core.LogImpl.IsWarnEnabled">
- <summary>
- Checks if this logger is enabled for the <c>WARN</c> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <c>WARN</c> events,
- <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- See <see cref="P:log4net.Core.LogImpl.IsDebugEnabled"/> for more information and examples
- of using this method.
- </para>
- </remarks>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.Core.LogImpl.IsErrorEnabled">
- <summary>
- Checks if this logger is enabled for the <c>ERROR</c> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <c>ERROR</c> events,
- <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- See <see cref="P:log4net.Core.LogImpl.IsDebugEnabled"/> for more information and examples of using this method.
- </para>
- </remarks>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="P:log4net.Core.LogImpl.IsFatalEnabled">
- <summary>
- Checks if this logger is enabled for the <c>FATAL</c> level.
- </summary>
- <value>
- <c>true</c> if this logger is enabled for <c>FATAL</c> events,
- <c>false</c> otherwise.
- </value>
- <remarks>
- <para>
- See <see cref="P:log4net.Core.LogImpl.IsDebugEnabled"/> for more information and examples of using this method.
- </para>
- </remarks>
- <seealso cref="P:log4net.ILog.IsDebugEnabled"/>
- </member>
- <member name="T:log4net.Core.SecurityContext">
- <summary>
- A SecurityContext used by log4net when interacting with protected resources
- </summary>
- <remarks>
- <para>
- A SecurityContext used by log4net when interacting with protected resources
- for example with operating system services. This can be used to impersonate
- a principal that has been granted privileges on the system resources.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Core.SecurityContext.Impersonate(System.Object)">
- <summary>
- Impersonate this SecurityContext
- </summary>
- <param name="state">State supplied by the caller</param>
- <returns>An <see cref="T:System.IDisposable"/> instance that will
- revoke the impersonation of this SecurityContext, or <c>null</c></returns>
- <remarks>
- <para>
- Impersonate this security context. Further calls on the current
- thread should now be made in the security context provided
- by this object. When the <see cref="T:System.IDisposable"/> result
- <see cref="M:System.IDisposable.Dispose"/> method is called the security
- context of the thread should be reverted to the state it was in
- before <see cref="M:log4net.Core.SecurityContext.Impersonate(System.Object)"/> was called.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.SecurityContextProvider">
- <summary>
- The <see cref="T:log4net.Core.SecurityContextProvider"/> providers default <see cref="T:log4net.Core.SecurityContext"/> instances.
- </summary>
- <remarks>
- <para>
- A configured component that interacts with potentially protected system
- resources uses a <see cref="T:log4net.Core.SecurityContext"/> to provide the elevated
- privileges required. If the <see cref="T:log4net.Core.SecurityContext"/> object has
- been not been explicitly provided to the component then the component
- will request one from this <see cref="T:log4net.Core.SecurityContextProvider"/>.
- </para>
- <para>
- By default the <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> is
- an instance of <see cref="T:log4net.Core.SecurityContextProvider"/> which returns only
- <see cref="T:log4net.Util.NullSecurityContext"/> objects. This is a reasonable default
- where the privileges required are not know by the system.
- </para>
- <para>
- This default behavior can be overridden by subclassing the <see cref="T:log4net.Core.SecurityContextProvider"/>
- and overriding the <see cref="M:log4net.Core.SecurityContextProvider.CreateSecurityContext(System.Object)"/> method to return
- the desired <see cref="T:log4net.Core.SecurityContext"/> objects. The default provider
- can be replaced by programmatically setting the value of the
- <see cref="P:log4net.Core.SecurityContextProvider.DefaultProvider"/> property.
- </para>
- <para>
- An alternative is to use the <c>log4net.Config.SecurityContextProviderAttribute</c>
- This attribute can be applied to an assembly in the same way as the
- <c>log4net.Config.XmlConfiguratorAttribute"</c>. The attribute takes
- the type to use as the <see cref="T:log4net.Core.SecurityContextProvider"/> as an argument.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Core.SecurityContextProvider.s_defaultProvider">
- <summary>
- The default provider
- </summary>
- </member>
- <member name="M:log4net.Core.SecurityContextProvider.#ctor">
- <summary>
- Protected default constructor to allow subclassing
- </summary>
- <remarks>
- <para>
- Protected default constructor to allow subclassing
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.SecurityContextProvider.CreateSecurityContext(System.Object)">
- <summary>
- Create a SecurityContext for a consumer
- </summary>
- <param name="consumer">The consumer requesting the SecurityContext</param>
- <returns>An impersonation context</returns>
- <remarks>
- <para>
- The default implementation is to return a <see cref="T:log4net.Util.NullSecurityContext"/>.
- </para>
- <para>
- Subclasses should override this method to provide their own
- behavior.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Core.SecurityContextProvider.DefaultProvider">
- <summary>
- Gets or sets the default SecurityContextProvider
- </summary>
- <value>
- The default SecurityContextProvider
- </value>
- <remarks>
- <para>
- The default provider is used by configured components that
- require a <see cref="T:log4net.Core.SecurityContext"/> and have not had one
- given to them.
- </para>
- <para>
- By default this is an instance of <see cref="T:log4net.Core.SecurityContextProvider"/>
- that returns <see cref="T:log4net.Util.NullSecurityContext"/> objects.
- </para>
- <para>
- The default provider can be set programmatically by setting
- the value of this property to a sub class of <see cref="T:log4net.Core.SecurityContextProvider"/>
- that has the desired behavior.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.WrapperCreationHandler">
- <summary>
- Delegate used to handle creation of new wrappers.
- </summary>
- <param name="logger">The logger to wrap in a wrapper.</param>
- <remarks>
- <para>
- Delegate used to handle creation of new wrappers. This delegate
- is called from the <see cref="M:log4net.Core.WrapperMap.CreateNewWrapperObject(log4net.Core.ILogger)"/>
- method to construct the wrapper for the specified logger.
- </para>
- <para>
- The delegate to use is supplied to the <see cref="T:log4net.Core.WrapperMap"/>
- constructor.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Core.WrapperMap">
- <summary>
- Maps between logger objects and wrapper objects.
- </summary>
- <remarks>
- <para>
- This class maintains a mapping between <see cref="T:log4net.Core.ILogger"/> objects and
- <see cref="T:log4net.Core.ILoggerWrapper"/> objects. Use the <see cref="M:log4net.Core.WrapperMap.GetWrapper(log4net.Core.ILogger)"/> method to
- lookup the <see cref="T:log4net.Core.ILoggerWrapper"/> for the specified <see cref="T:log4net.Core.ILogger"/>.
- </para>
- <para>
- New wrapper instances are created by the <see cref="M:log4net.Core.WrapperMap.CreateNewWrapperObject(log4net.Core.ILogger)"/>
- method. The default behavior is for this method to delegate construction
- of the wrapper to the <see cref="T:log4net.Core.WrapperCreationHandler"/> delegate supplied
- to the constructor. This allows specialization of the behavior without
- requiring subclassing of this type.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Core.WrapperMap.#ctor(log4net.Core.WrapperCreationHandler)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Core.WrapperMap"/>
- </summary>
- <param name="createWrapperHandler">The handler to use to create the wrapper objects.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Core.WrapperMap"/> class with
- the specified handler to create the wrapper objects.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.WrapperMap.GetWrapper(log4net.Core.ILogger)">
- <summary>
- Gets the wrapper object for the specified logger.
- </summary>
- <returns>The wrapper object for the specified logger</returns>
- <remarks>
- <para>
- If the logger is null then the corresponding wrapper is null.
- </para>
- <para>
- Looks up the wrapper it it has previously been requested and
- returns it. If the wrapper has never been requested before then
- the <see cref="M:log4net.Core.WrapperMap.CreateNewWrapperObject(log4net.Core.ILogger)"/> virtual method is
- called.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.WrapperMap.CreateNewWrapperObject(log4net.Core.ILogger)">
- <summary>
- Creates the wrapper object for the specified logger.
- </summary>
- <param name="logger">The logger to wrap in a wrapper.</param>
- <returns>The wrapper object for the logger.</returns>
- <remarks>
- <para>
- This implementation uses the <see cref="T:log4net.Core.WrapperCreationHandler"/>
- passed to the constructor to create the wrapper. This method
- can be overridden in a subclass.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.WrapperMap.RepositoryShutdown(log4net.Repository.ILoggerRepository)">
- <summary>
- Called when a monitored repository shutdown event is received.
- </summary>
- <param name="repository">The <see cref="T:log4net.Repository.ILoggerRepository"/> that is shutting down</param>
- <remarks>
- <para>
- This method is called when a <see cref="T:log4net.Repository.ILoggerRepository"/> that this
- <see cref="T:log4net.Core.WrapperMap"/> is holding loggers for has signaled its shutdown
- event <see cref="E:log4net.Repository.ILoggerRepository.ShutdownEvent"/>. The default
- behavior of this method is to release the references to the loggers
- and their wrappers generated for this repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Core.WrapperMap.ILoggerRepository_Shutdown(System.Object,System.EventArgs)">
- <summary>
- Event handler for repository shutdown event.
- </summary>
- <param name="sender">The sender of the event.</param>
- <param name="e">The event args.</param>
- </member>
- <member name="F:log4net.Core.WrapperMap.m_repositories">
- <summary>
- Map of logger repositories to hashtables of ILogger to ILoggerWrapper mappings
- </summary>
- </member>
- <member name="F:log4net.Core.WrapperMap.m_createWrapperHandler">
- <summary>
- The handler to use to create the extension wrapper objects.
- </summary>
- </member>
- <member name="F:log4net.Core.WrapperMap.m_shutdownHandler">
- <summary>
- Internal reference to the delegate used to register for repository shutdown events.
- </summary>
- </member>
- <member name="P:log4net.Core.WrapperMap.Repositories">
- <summary>
- Gets the map of logger repositories.
- </summary>
- <value>
- Map of logger repositories.
- </value>
- <remarks>
- <para>
- Gets the hashtable that is keyed on <see cref="T:log4net.Repository.ILoggerRepository"/>. The
- values are hashtables keyed on <see cref="T:log4net.Core.ILogger"/> with the
- value being the corresponding <see cref="T:log4net.Core.ILoggerWrapper"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.DateFormatter.AbsoluteTimeDateFormatter">
- <summary>
- Formats a <see cref="T:System.DateTime"/> as <c>"HH:mm:ss,fff"</c>.
- </summary>
- <remarks>
- <para>
- Formats a <see cref="T:System.DateTime"/> in the format <c>"HH:mm:ss,fff"</c> for example, <c>"15:49:37,459"</c>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.DateFormatter.IDateFormatter">
- <summary>
- Render a <see cref="T:System.DateTime"/> as a string.
- </summary>
- <remarks>
- <para>
- Interface to abstract the rendering of a <see cref="T:System.DateTime"/>
- instance into a string.
- </para>
- <para>
- The <see cref="M:log4net.DateFormatter.IDateFormatter.FormatDate(System.DateTime,System.IO.TextWriter)"/> method is used to render the
- date to a text writer.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.DateFormatter.IDateFormatter.FormatDate(System.DateTime,System.IO.TextWriter)">
- <summary>
- Formats the specified date as a string.
- </summary>
- <param name="dateToFormat">The date to format.</param>
- <param name="writer">The writer to write to.</param>
- <remarks>
- <para>
- Format the <see cref="T:System.DateTime"/> as a string and write it
- to the <see cref="T:System.IO.TextWriter"/> provided.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.AbsoluteTimeDateFormat">
- <summary>
- String constant used to specify AbsoluteTimeDateFormat in layouts. Current value is <b>ABSOLUTE</b>.
- </summary>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.DateAndTimeDateFormat">
- <summary>
- String constant used to specify DateTimeDateFormat in layouts. Current value is <b>DATE</b>.
- </summary>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.Iso8601TimeDateFormat">
- <summary>
- String constant used to specify ISO8601DateFormat in layouts. Current value is <b>ISO8601</b>.
- </summary>
- </member>
- <member name="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)">
- <summary>
- Renders the date into a string. Format is <c>"HH:mm:ss"</c>.
- </summary>
- <param name="dateToFormat">The date to render into a string.</param>
- <param name="buffer">The string builder to write to.</param>
- <remarks>
- <para>
- Subclasses should override this method to render the date
- into a string using a precision up to the second. This method
- will be called at most once per second and the result will be
- reused if it is needed again during the same second.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDate(System.DateTime,System.IO.TextWriter)">
- <summary>
- Renders the date into a string. Format is "HH:mm:ss,fff".
- </summary>
- <param name="dateToFormat">The date to render into a string.</param>
- <param name="writer">The writer to write to.</param>
- <remarks>
- <para>
- Uses the <see cref="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)"/> method to generate the
- time string up to the seconds and then appends the current
- milliseconds. The results from <see cref="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)"/> are
- cached and <see cref="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)"/> is called at most once
- per second.
- </para>
- <para>
- Sub classes should override <see cref="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)"/>
- rather than <see cref="M:log4net.DateFormatter.AbsoluteTimeDateFormatter.FormatDate(System.DateTime,System.IO.TextWriter)"/>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.s_lastTimeToTheSecond">
- <summary>
- Last stored time with precision up to the second.
- </summary>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.s_lastTimeBuf">
- <summary>
- Last stored time with precision up to the second, formatted
- as a string.
- </summary>
- </member>
- <member name="F:log4net.DateFormatter.AbsoluteTimeDateFormatter.s_lastTimeString">
- <summary>
- Last stored time with precision up to the second, formatted
- as a string.
- </summary>
- </member>
- <member name="T:log4net.DateFormatter.DateTimeDateFormatter">
- <summary>
- Formats a <see cref="T:System.DateTime"/> as <c>"dd MMM yyyy HH:mm:ss,fff"</c>
- </summary>
- <remarks>
- <para>
- Formats a <see cref="T:System.DateTime"/> in the format
- <c>"dd MMM yyyy HH:mm:ss,fff"</c> for example,
- <c>"06 Nov 1994 15:49:37,459"</c>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Angelika Schnagl</author>
- </member>
- <member name="M:log4net.DateFormatter.DateTimeDateFormatter.#ctor">
- <summary>
- Default constructor.
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.DateFormatter.DateTimeDateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)">
- <summary>
- Formats the date without the milliseconds part
- </summary>
- <param name="dateToFormat">The date to format.</param>
- <param name="buffer">The string builder to write to.</param>
- <remarks>
- <para>
- Formats a DateTime in the format <c>"dd MMM yyyy HH:mm:ss"</c>
- for example, <c>"06 Nov 1994 15:49:37"</c>.
- </para>
- <para>
- The base class will append the <c>",fff"</c> milliseconds section.
- This method will only be called at most once per second.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.DateFormatter.DateTimeDateFormatter.m_dateTimeFormatInfo">
- <summary>
- The format info for the invariant culture.
- </summary>
- </member>
- <member name="T:log4net.DateFormatter.Iso8601DateFormatter">
- <summary>
- Formats the <see cref="T:System.DateTime"/> as <c>"yyyy-MM-dd HH:mm:ss,fff"</c>.
- </summary>
- <remarks>
- <para>
- Formats the <see cref="T:System.DateTime"/> specified as a string: <c>"yyyy-MM-dd HH:mm:ss,fff"</c>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.DateFormatter.Iso8601DateFormatter.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.DateFormatter.Iso8601DateFormatter.FormatDateWithoutMillis(System.DateTime,System.Text.StringBuilder)">
- <summary>
- Formats the date without the milliseconds part
- </summary>
- <param name="dateToFormat">The date to format.</param>
- <param name="buffer">The string builder to write to.</param>
- <remarks>
- <para>
- Formats the date specified as a string: <c>"yyyy-MM-dd HH:mm:ss"</c>.
- </para>
- <para>
- The base class will append the <c>",fff"</c> milliseconds section.
- This method will only be called at most once per second.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.DateFormatter.SimpleDateFormatter">
- <summary>
- Formats the <see cref="T:System.DateTime"/> using the <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/> method.
- </summary>
- <remarks>
- <para>
- Formats the <see cref="T:System.DateTime"/> using the <see cref="T:System.DateTime"/> <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/> method.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.DateFormatter.SimpleDateFormatter.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="format">The format string.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.DateFormatter.SimpleDateFormatter"/> class
- with the specified format string.
- </para>
- <para>
- The format string must be compatible with the options
- that can be supplied to <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.DateFormatter.SimpleDateFormatter.FormatDate(System.DateTime,System.IO.TextWriter)">
- <summary>
- Formats the date using <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/>.
- </summary>
- <param name="dateToFormat">The date to convert to a string.</param>
- <param name="writer">The writer to write to.</param>
- <remarks>
- <para>
- Uses the date format string supplied to the constructor to call
- the <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/> method to format the date.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.DateFormatter.SimpleDateFormatter.m_formatString">
- <summary>
- The format string used to format the <see cref="T:System.DateTime"/>.
- </summary>
- <remarks>
- <para>
- The format string must be compatible with the options
- that can be supplied to <see cref="M:System.DateTime.ToString(System.String,System.IFormatProvider)"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.DenyAllFilter">
- <summary>
- This filter drops all <see cref="T:log4net.Core.LoggingEvent"/>.
- </summary>
- <remarks>
- <para>
- You can add this filter to the end of a filter chain to
- switch from the default "accept all unless instructed otherwise"
- filtering behavior to a "deny all unless instructed otherwise"
- behavior.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Filter.FilterSkeleton">
- <summary>
- Subclass this type to implement customized logging event filtering
- </summary>
- <remarks>
- <para>
- Users should extend this class to implement customized logging
- event filtering. Note that <see cref="T:log4net.Repository.Hierarchy.Logger"/> and
- <see cref="T:log4net.Appender.AppenderSkeleton"/>, the parent class of all standard
- appenders, have built-in filtering rules. It is suggested that you
- first use and understand the built-in rules before rushing to write
- your own custom filters.
- </para>
- <para>
- This abstract class assumes and also imposes that filters be
- organized in a linear chain. The <see cref="M:log4net.Filter.FilterSkeleton.Decide(log4net.Core.LoggingEvent)"/>
- method of each filter is called sequentially, in the order of their
- addition to the chain.
- </para>
- <para>
- The <see cref="M:log4net.Filter.FilterSkeleton.Decide(log4net.Core.LoggingEvent)"/> method must return one
- of the integer constants <see cref="F:log4net.Filter.FilterDecision.Deny"/>,
- <see cref="F:log4net.Filter.FilterDecision.Neutral"/> or <see cref="F:log4net.Filter.FilterDecision.Accept"/>.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned, then the log event is dropped
- immediately without consulting with the remaining filters.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Neutral"/> is returned, then the next filter
- in the chain is consulted. If there are no more filters in the
- chain, then the log event is logged. Thus, in the presence of no
- filters, the default behavior is to log all logging events.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned, then the log
- event is logged without consulting the remaining filters.
- </para>
- <para>
- The philosophy of log4net filters is largely inspired from the
- Linux ipchains.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Filter.IFilter">
- <summary>
- Implement this interface to provide customized logging event filtering
- </summary>
- <remarks>
- <para>
- Users should implement this interface to implement customized logging
- event filtering. Note that <see cref="T:log4net.Repository.Hierarchy.Logger"/> and
- <see cref="T:log4net.Appender.AppenderSkeleton"/>, the parent class of all standard
- appenders, have built-in filtering rules. It is suggested that you
- first use and understand the built-in rules before rushing to write
- your own custom filters.
- </para>
- <para>
- This abstract class assumes and also imposes that filters be
- organized in a linear chain. The <see cref="M:log4net.Filter.IFilter.Decide(log4net.Core.LoggingEvent)"/>
- method of each filter is called sequentially, in the order of their
- addition to the chain.
- </para>
- <para>
- The <see cref="M:log4net.Filter.IFilter.Decide(log4net.Core.LoggingEvent)"/> method must return one
- of the integer constants <see cref="F:log4net.Filter.FilterDecision.Deny"/>,
- <see cref="F:log4net.Filter.FilterDecision.Neutral"/> or <see cref="F:log4net.Filter.FilterDecision.Accept"/>.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned, then the log event is dropped
- immediately without consulting with the remaining filters.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Neutral"/> is returned, then the next filter
- in the chain is consulted. If there are no more filters in the
- chain, then the log event is logged. Thus, in the presence of no
- filters, the default behavior is to log all logging events.
- </para>
- <para>
- If the value <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned, then the log
- event is logged without consulting the remaining filters.
- </para>
- <para>
- The philosophy of log4net filters is largely inspired from the
- Linux ipchains.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Filter.IFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Decide if the logging event should be logged through an appender.
- </summary>
- <param name="loggingEvent">The LoggingEvent to decide upon</param>
- <returns>The decision of the filter</returns>
- <remarks>
- <para>
- If the decision is <see cref="F:log4net.Filter.FilterDecision.Deny"/>, then the event will be
- dropped. If the decision is <see cref="F:log4net.Filter.FilterDecision.Neutral"/>, then the next
- filter, if any, will be invoked. If the decision is <see cref="F:log4net.Filter.FilterDecision.Accept"/> then
- the event will be logged without consulting with other filters in
- the chain.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.IFilter.Next">
- <summary>
- Property to get and set the next filter
- </summary>
- <value>
- The next filter in the chain
- </value>
- <remarks>
- <para>
- Filters are typically composed into chains. This property allows the next filter in
- the chain to be accessed.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Filter.FilterSkeleton.m_next">
- <summary>
- Points to the next filter in the filter chain.
- </summary>
- <remarks>
- <para>
- See <see cref="P:log4net.Filter.FilterSkeleton.Next"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Filter.FilterSkeleton.ActivateOptions">
- <summary>
- Initialize the filter with the options set
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Filter.FilterSkeleton.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Filter.FilterSkeleton.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Filter.FilterSkeleton.ActivateOptions"/> must be called again.
- </para>
- <para>
- Typically filter's options become active immediately on set,
- however this method must still be called.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Filter.FilterSkeleton.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Decide if the <see cref="T:log4net.Core.LoggingEvent"/> should be logged through an appender.
- </summary>
- <param name="loggingEvent">The <see cref="T:log4net.Core.LoggingEvent"/> to decide upon</param>
- <returns>The decision of the filter</returns>
- <remarks>
- <para>
- If the decision is <see cref="F:log4net.Filter.FilterDecision.Deny"/>, then the event will be
- dropped. If the decision is <see cref="F:log4net.Filter.FilterDecision.Neutral"/>, then the next
- filter, if any, will be invoked. If the decision is <see cref="F:log4net.Filter.FilterDecision.Accept"/> then
- the event will be logged without consulting with other filters in
- the chain.
- </para>
- <para>
- This method is marked <c>abstract</c> and must be implemented
- in a subclass.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.FilterSkeleton.Next">
- <summary>
- Property to get and set the next filter
- </summary>
- <value>
- The next filter in the chain
- </value>
- <remarks>
- <para>
- Filters are typically composed into chains. This property allows the next filter in
- the chain to be accessed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Filter.DenyAllFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.DenyAllFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Always returns the integer constant <see cref="F:log4net.Filter.FilterDecision.Deny"/>
- </summary>
- <param name="loggingEvent">the LoggingEvent to filter</param>
- <returns>Always returns <see cref="F:log4net.Filter.FilterDecision.Deny"/></returns>
- <remarks>
- <para>
- Ignores the event being logged and just returns
- <see cref="F:log4net.Filter.FilterDecision.Deny"/>. This can be used to change the default filter
- chain behavior from <see cref="F:log4net.Filter.FilterDecision.Accept"/> to <see cref="F:log4net.Filter.FilterDecision.Deny"/>. This filter
- should only be used as the last filter in the chain
- as any further filters will be ignored!
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.FilterDecision">
- <summary>
- The return result from <see cref="M:log4net.Filter.IFilter.Decide(log4net.Core.LoggingEvent)"/>
- </summary>
- <remarks>
- <para>
- The return result from <see cref="M:log4net.Filter.IFilter.Decide(log4net.Core.LoggingEvent)"/>
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Filter.FilterDecision.Deny">
- <summary>
- The log event must be dropped immediately without
- consulting with the remaining filters, if any, in the chain.
- </summary>
- </member>
- <member name="F:log4net.Filter.FilterDecision.Neutral">
- <summary>
- This filter is neutral with respect to the log event.
- The remaining filters, if any, should be consulted for a final decision.
- </summary>
- </member>
- <member name="F:log4net.Filter.FilterDecision.Accept">
- <summary>
- The log event must be logged immediately without
- consulting with the remaining filters, if any, in the chain.
- </summary>
- </member>
- <member name="T:log4net.Filter.LevelMatchFilter">
- <summary>
- This is a very simple filter based on <see cref="T:log4net.Core.Level"/> matching.
- </summary>
- <remarks>
- <para>
- The filter admits two options <see cref="P:log4net.Filter.LevelMatchFilter.LevelToMatch"/> and
- <see cref="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch"/>. If there is an exact match between the value
- of the <see cref="P:log4net.Filter.LevelMatchFilter.LevelToMatch"/> option and the <see cref="T:log4net.Core.Level"/> of the
- <see cref="T:log4net.Core.LoggingEvent"/>, then the <see cref="M:log4net.Filter.LevelMatchFilter.Decide(log4net.Core.LoggingEvent)"/> method returns <see cref="F:log4net.Filter.FilterDecision.Accept"/> in
- case the <see cref="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch"/> option value is set
- to <c>true</c>, if it is <c>false</c> then
- <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned. If the <see cref="T:log4net.Core.Level"/> does not match then
- the result will be <see cref="F:log4net.Filter.FilterDecision.Neutral"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Filter.LevelMatchFilter.m_acceptOnMatch">
- <summary>
- flag to indicate if the filter should <see cref="F:log4net.Filter.FilterDecision.Accept"/> on a match
- </summary>
- </member>
- <member name="F:log4net.Filter.LevelMatchFilter.m_levelToMatch">
- <summary>
- the <see cref="T:log4net.Core.Level"/> to match against
- </summary>
- </member>
- <member name="M:log4net.Filter.LevelMatchFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.LevelMatchFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Tests if the <see cref="T:log4net.Core.Level"/> of the logging event matches that of the filter
- </summary>
- <param name="loggingEvent">the event to filter</param>
- <returns>see remarks</returns>
- <remarks>
- <para>
- If the <see cref="T:log4net.Core.Level"/> of the event matches the level of the
- filter then the result of the function depends on the
- value of <see cref="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch"/>. If it is true then
- the function will return <see cref="F:log4net.Filter.FilterDecision.Accept"/>, it it is false then it
- will return <see cref="F:log4net.Filter.FilterDecision.Deny"/>. If the <see cref="T:log4net.Core.Level"/> does not match then
- the result will be <see cref="F:log4net.Filter.FilterDecision.Neutral"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch">
- <summary>
- <see cref="F:log4net.Filter.FilterDecision.Accept"/> when matching <see cref="P:log4net.Filter.LevelMatchFilter.LevelToMatch"/>
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch"/> property is a flag that determines
- the behavior when a matching <see cref="T:log4net.Core.Level"/> is found. If the
- flag is set to true then the filter will <see cref="F:log4net.Filter.FilterDecision.Accept"/> the
- logging event, otherwise it will <see cref="F:log4net.Filter.FilterDecision.Deny"/> the event.
- </para>
- <para>
- The default is <c>true</c> i.e. to <see cref="F:log4net.Filter.FilterDecision.Accept"/> the event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LevelMatchFilter.LevelToMatch">
- <summary>
- The <see cref="T:log4net.Core.Level"/> that the filter will match
- </summary>
- <remarks>
- <para>
- The level that this filter will attempt to match against the
- <see cref="T:log4net.Core.LoggingEvent"/> level. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.LevelMatchFilter.AcceptOnMatch"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.LevelRangeFilter">
- <summary>
- This is a simple filter based on <see cref="T:log4net.Core.Level"/> matching.
- </summary>
- <remarks>
- <para>
- The filter admits three options <see cref="P:log4net.Filter.LevelRangeFilter.LevelMin"/> and <see cref="P:log4net.Filter.LevelRangeFilter.LevelMax"/>
- that determine the range of priorities that are matched, and
- <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/>. If there is a match between the range
- of priorities and the <see cref="T:log4net.Core.Level"/> of the <see cref="T:log4net.Core.LoggingEvent"/>, then the
- <see cref="M:log4net.Filter.LevelRangeFilter.Decide(log4net.Core.LoggingEvent)"/> method returns <see cref="F:log4net.Filter.FilterDecision.Accept"/> in case the <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/>
- option value is set to <c>true</c>, if it is <c>false</c>
- then <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned. If there is no match, <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Filter.LevelRangeFilter.m_acceptOnMatch">
- <summary>
- Flag to indicate the behavior when matching a <see cref="T:log4net.Core.Level"/>
- </summary>
- </member>
- <member name="F:log4net.Filter.LevelRangeFilter.m_levelMin">
- <summary>
- the minimum <see cref="T:log4net.Core.Level"/> value to match
- </summary>
- </member>
- <member name="F:log4net.Filter.LevelRangeFilter.m_levelMax">
- <summary>
- the maximum <see cref="T:log4net.Core.Level"/> value to match
- </summary>
- </member>
- <member name="M:log4net.Filter.LevelRangeFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.LevelRangeFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Check if the event should be logged.
- </summary>
- <param name="loggingEvent">the logging event to check</param>
- <returns>see remarks</returns>
- <remarks>
- <para>
- If the <see cref="T:log4net.Core.Level"/> of the logging event is outside the range
- matched by this filter then <see cref="F:log4net.Filter.FilterDecision.Deny"/>
- is returned. If the <see cref="T:log4net.Core.Level"/> is matched then the value of
- <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/> is checked. If it is true then
- <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned, otherwise
- <see cref="F:log4net.Filter.FilterDecision.Neutral"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch">
- <summary>
- <see cref="F:log4net.Filter.FilterDecision.Accept"/> when matching <see cref="P:log4net.Filter.LevelRangeFilter.LevelMin"/> and <see cref="P:log4net.Filter.LevelRangeFilter.LevelMax"/>
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/> property is a flag that determines
- the behavior when a matching <see cref="T:log4net.Core.Level"/> is found. If the
- flag is set to true then the filter will <see cref="F:log4net.Filter.FilterDecision.Accept"/> the
- logging event, otherwise it will <see cref="F:log4net.Filter.FilterDecision.Neutral"/> the event.
- </para>
- <para>
- The default is <c>true</c> i.e. to <see cref="F:log4net.Filter.FilterDecision.Accept"/> the event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LevelRangeFilter.LevelMin">
- <summary>
- Set the minimum matched <see cref="T:log4net.Core.Level"/>
- </summary>
- <remarks>
- <para>
- The minimum level that this filter will attempt to match against the
- <see cref="T:log4net.Core.LoggingEvent"/> level. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LevelRangeFilter.LevelMax">
- <summary>
- Sets the maximum matched <see cref="T:log4net.Core.Level"/>
- </summary>
- <remarks>
- <para>
- The maximum level that this filter will attempt to match against the
- <see cref="T:log4net.Core.LoggingEvent"/> level. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.LevelRangeFilter.AcceptOnMatch"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.LoggerMatchFilter">
- <summary>
- Simple filter to match a string in the event's logger name.
- </summary>
- <remarks>
- <para>
- The works very similar to the <see cref="T:log4net.Filter.LevelMatchFilter"/>. It admits two
- options <see cref="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch"/> and <see cref="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch"/>. If the
- <see cref="P:log4net.Core.LoggingEvent.LoggerName"/> of the <see cref="T:log4net.Core.LoggingEvent"/> starts
- with the value of the <see cref="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch"/> option, then the
- <see cref="M:log4net.Filter.LoggerMatchFilter.Decide(log4net.Core.LoggingEvent)"/> method returns <see cref="F:log4net.Filter.FilterDecision.Accept"/> in
- case the <see cref="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch"/> option value is set to <c>true</c>,
- if it is <c>false</c> then <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned.
- </para>
- </remarks>
- <author>Daniel Cazzulino</author>
- </member>
- <member name="F:log4net.Filter.LoggerMatchFilter.m_acceptOnMatch">
- <summary>
- Flag to indicate the behavior when we have a match
- </summary>
- </member>
- <member name="F:log4net.Filter.LoggerMatchFilter.m_loggerToMatch">
- <summary>
- The logger name string to substring match against the event
- </summary>
- </member>
- <member name="M:log4net.Filter.LoggerMatchFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.LoggerMatchFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Check if this filter should allow the event to be logged
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>see remarks</returns>
- <remarks>
- <para>
- The rendered message is matched against the <see cref="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch"/>.
- If the <see cref="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch"/> equals the beginning of
- the incoming <see cref="P:log4net.Core.LoggingEvent.LoggerName"/> (<see cref="M:System.String.StartsWith(System.String)"/>)
- then a match will have occurred. If no match occurs
- this function will return <see cref="F:log4net.Filter.FilterDecision.Neutral"/>
- allowing other filters to check the event. If a match occurs then
- the value of <see cref="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch"/> is checked. If it is
- true then <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned otherwise
- <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch">
- <summary>
- <see cref="F:log4net.Filter.FilterDecision.Accept"/> when matching <see cref="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch"/>
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch"/> property is a flag that determines
- the behavior when a matching <see cref="T:log4net.Core.Level"/> is found. If the
- flag is set to true then the filter will <see cref="F:log4net.Filter.FilterDecision.Accept"/> the
- logging event, otherwise it will <see cref="F:log4net.Filter.FilterDecision.Deny"/> the event.
- </para>
- <para>
- The default is <c>true</c> i.e. to <see cref="F:log4net.Filter.FilterDecision.Accept"/> the event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.LoggerMatchFilter.LoggerToMatch">
- <summary>
- The <see cref="P:log4net.Core.LoggingEvent.LoggerName"/> that the filter will match
- </summary>
- <remarks>
- <para>
- This filter will attempt to match this value against logger name in
- the following way. The match will be done against the beginning of the
- logger name (using <see cref="M:System.String.StartsWith(System.String)"/>). The match is
- case sensitive. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.LoggerMatchFilter.AcceptOnMatch"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.MdcFilter">
- <summary>
- Simple filter to match a keyed string in the <see cref="T:log4net.MDC"/>
- </summary>
- <remarks>
- <para>
- Simple filter to match a keyed string in the <see cref="T:log4net.MDC"/>
- </para>
- <para>
- As the MDC has been replaced with layered properties the
- <see cref="T:log4net.Filter.PropertyFilter"/> should be used instead.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Filter.PropertyFilter">
- <summary>
- Simple filter to match a string an event property
- </summary>
- <remarks>
- <para>
- Simple filter to match a string in the value for a
- specific event property
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Filter.StringMatchFilter">
- <summary>
- Simple filter to match a string in the rendered message
- </summary>
- <remarks>
- <para>
- Simple filter to match a string in the rendered message
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Filter.StringMatchFilter.m_acceptOnMatch">
- <summary>
- Flag to indicate the behavior when we have a match
- </summary>
- </member>
- <member name="F:log4net.Filter.StringMatchFilter.m_stringToMatch">
- <summary>
- The string to substring match against the message
- </summary>
- </member>
- <member name="F:log4net.Filter.StringMatchFilter.m_stringRegexToMatch">
- <summary>
- A string regex to match
- </summary>
- </member>
- <member name="F:log4net.Filter.StringMatchFilter.m_regexToMatch">
- <summary>
- A regex object to match (generated from m_stringRegexToMatch)
- </summary>
- </member>
- <member name="M:log4net.Filter.StringMatchFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.StringMatchFilter.ActivateOptions">
- <summary>
- Initialize and precompile the Regex if required
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Filter.StringMatchFilter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Filter.StringMatchFilter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Filter.StringMatchFilter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Filter.StringMatchFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Check if this filter should allow the event to be logged
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>see remarks</returns>
- <remarks>
- <para>
- The rendered message is matched against the <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/>.
- If the <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/> occurs as a substring within
- the message then a match will have occurred. If no match occurs
- this function will return <see cref="F:log4net.Filter.FilterDecision.Neutral"/>
- allowing other filters to check the event. If a match occurs then
- the value of <see cref="P:log4net.Filter.StringMatchFilter.AcceptOnMatch"/> is checked. If it is
- true then <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned otherwise
- <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.StringMatchFilter.AcceptOnMatch">
- <summary>
- <see cref="F:log4net.Filter.FilterDecision.Accept"/> when matching <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/> or <see cref="P:log4net.Filter.StringMatchFilter.RegexToMatch"/>
- </summary>
- <remarks>
- <para>
- The <see cref="P:log4net.Filter.StringMatchFilter.AcceptOnMatch"/> property is a flag that determines
- the behavior when a matching <see cref="T:log4net.Core.Level"/> is found. If the
- flag is set to true then the filter will <see cref="F:log4net.Filter.FilterDecision.Accept"/> the
- logging event, otherwise it will <see cref="F:log4net.Filter.FilterDecision.Neutral"/> the event.
- </para>
- <para>
- The default is <c>true</c> i.e. to <see cref="F:log4net.Filter.FilterDecision.Accept"/> the event.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.StringMatchFilter.StringToMatch">
- <summary>
- Sets the static string to match
- </summary>
- <remarks>
- <para>
- The string that will be substring matched against
- the rendered message. If the message contains this
- string then the filter will match. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.StringMatchFilter.AcceptOnMatch"/>.
- </para>
- <para>
- One of <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/> or <see cref="P:log4net.Filter.StringMatchFilter.RegexToMatch"/>
- must be specified.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.StringMatchFilter.RegexToMatch">
- <summary>
- Sets the regular expression to match
- </summary>
- <remarks>
- <para>
- The regular expression pattern that will be matched against
- the rendered message. If the message matches this
- pattern then the filter will match. If a match is found then
- the result depends on the value of <see cref="P:log4net.Filter.StringMatchFilter.AcceptOnMatch"/>.
- </para>
- <para>
- One of <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/> or <see cref="P:log4net.Filter.StringMatchFilter.RegexToMatch"/>
- must be specified.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Filter.PropertyFilter.m_key">
- <summary>
- The key to use to lookup the string from the event properties
- </summary>
- </member>
- <member name="M:log4net.Filter.PropertyFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Filter.PropertyFilter.Decide(log4net.Core.LoggingEvent)">
- <summary>
- Check if this filter should allow the event to be logged
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>see remarks</returns>
- <remarks>
- <para>
- The event property for the <see cref="P:log4net.Filter.PropertyFilter.Key"/> is matched against
- the <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/>.
- If the <see cref="P:log4net.Filter.StringMatchFilter.StringToMatch"/> occurs as a substring within
- the property value then a match will have occurred. If no match occurs
- this function will return <see cref="F:log4net.Filter.FilterDecision.Neutral"/>
- allowing other filters to check the event. If a match occurs then
- the value of <see cref="P:log4net.Filter.StringMatchFilter.AcceptOnMatch"/> is checked. If it is
- true then <see cref="F:log4net.Filter.FilterDecision.Accept"/> is returned otherwise
- <see cref="F:log4net.Filter.FilterDecision.Deny"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Filter.PropertyFilter.Key">
- <summary>
- The key to lookup in the event properties and then match against.
- </summary>
- <remarks>
- <para>
- The key name to use to lookup in the properties map of the
- <see cref="T:log4net.Core.LoggingEvent"/>. The match will be performed against
- the value of this property if it exists.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Filter.NdcFilter">
- <summary>
- Simple filter to match a string in the <see cref="T:log4net.NDC"/>
- </summary>
- <remarks>
- <para>
- Simple filter to match a string in the <see cref="T:log4net.NDC"/>
- </para>
- <para>
- As the MDC has been replaced with named stacks stored in the
- properties collections the <see cref="T:log4net.Filter.PropertyFilter"/> should
- be used instead.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Filter.NdcFilter.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Sets the <see cref="P:log4net.Filter.PropertyFilter.Key"/> to <c>"NDC"</c>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.AppDomainPatternConverter">
- <summary>
- Write the event appdomain name to the output
- </summary>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LoggingEvent.Domain"/> to the output writer.
- </para>
- </remarks>
- <author>Daniel Cazzulino</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Layout.Pattern.PatternLayoutConverter">
- <summary>
- Abstract class that provides the formatting functionality that
- derived classes need.
- </summary>
- <remarks>
- Conversion specifiers in a conversion patterns are parsed to
- individual PatternConverters. Each of which is responsible for
- converting a logging event in a converter specific manner.
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Util.PatternConverter">
- <summary>
- Abstract class that provides the formatting functionality that
- derived classes need.
- </summary>
- <remarks>
- <para>
- Conversion specifiers in a conversion patterns are parsed to
- individual PatternConverters. Each of which is responsible for
- converting a logging event in a converter specific manner.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Util.PatternConverter.c_renderBufferSize">
- <summary>
- Initial buffer size
- </summary>
- </member>
- <member name="F:log4net.Util.PatternConverter.c_renderBufferMaxCapacity">
- <summary>
- Maximum buffer size before it is recycled
- </summary>
- </member>
- <member name="M:log4net.Util.PatternConverter.#ctor">
- <summary>
- Protected constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.PatternConverter"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Evaluate this pattern converter and write the output to a writer.
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">The state object on which the pattern converter should be executed.</param>
- <remarks>
- <para>
- Derived pattern converters must override this method in order to
- convert conversion specifiers in the appropriate way.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternConverter.SetNext(log4net.Util.PatternConverter)">
- <summary>
- Set the next pattern converter in the chains
- </summary>
- <param name="patternConverter">the pattern converter that should follow this converter in the chain</param>
- <returns>the next converter</returns>
- <remarks>
- <para>
- The PatternConverter can merge with its neighbor during this method (or a sub class).
- Therefore the return value may or may not be the value of the argument passed in.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternConverter.Format(System.IO.TextWriter,System.Object)">
- <summary>
- Write the pattern converter to the writer with appropriate formatting
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">The state object on which the pattern converter should be executed.</param>
- <remarks>
- <para>
- This method calls <see cref="M:log4net.Util.PatternConverter.Convert(System.IO.TextWriter,System.Object)"/> to allow the subclass to perform
- appropriate conversion of the pattern converter. If formatting options have
- been specified via the <see cref="P:log4net.Util.PatternConverter.FormattingInfo"/> then this method will
- apply those formattings before writing the output.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternConverter.SpacePad(System.IO.TextWriter,System.Int32)">
- <summary>
- Fast space padding method.
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> to which the spaces will be appended.</param>
- <param name="length">The number of spaces to be padded.</param>
- <remarks>
- <para>
- Fast space padding method.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.PatternConverter.m_option">
- <summary>
- The option string to the converter
- </summary>
- </member>
- <member name="M:log4net.Util.PatternConverter.WriteDictionary(System.IO.TextWriter,log4net.Repository.ILoggerRepository,System.Collections.IDictionary)">
- <summary>
- Write an dictionary to a <see cref="T:System.IO.TextWriter"/>
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="repository">a <see cref="T:log4net.Repository.ILoggerRepository"/> to use for object conversion</param>
- <param name="value">the value to write to the writer</param>
- <remarks>
- <para>
- Writes the <see cref="T:System.Collections.IDictionary"/> to a writer in the form:
- </para>
- <code>
- {key1=value1, key2=value2, key3=value3}
- </code>
- <para>
- If the <see cref="T:log4net.Repository.ILoggerRepository"/> specified
- is not null then it is used to render the key and value to text, otherwise
- the object's ToString method is called.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternConverter.WriteObject(System.IO.TextWriter,log4net.Repository.ILoggerRepository,System.Object)">
- <summary>
- Write an object to a <see cref="T:System.IO.TextWriter"/>
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="repository">a <see cref="T:log4net.Repository.ILoggerRepository"/> to use for object conversion</param>
- <param name="value">the value to write to the writer</param>
- <remarks>
- <para>
- Writes the Object to a writer. If the <see cref="T:log4net.Repository.ILoggerRepository"/> specified
- is not null then it is used to render the object to text, otherwise
- the object's ToString method is called.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternConverter.Next">
- <summary>
- Get the next pattern converter in the chain
- </summary>
- <value>
- the next pattern converter in the chain
- </value>
- <remarks>
- <para>
- Get the next pattern converter in the chain
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternConverter.FormattingInfo">
- <summary>
- Gets or sets the formatting info for this converter
- </summary>
- <value>
- The formatting info for this converter
- </value>
- <remarks>
- <para>
- Gets or sets the formatting info for this converter
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternConverter.Option">
- <summary>
- Gets or sets the option value for this converter
- </summary>
- <summary>
- The option for this converter
- </summary>
- <remarks>
- <para>
- Gets or sets the option value for this converter
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.PatternLayoutConverter.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Layout.Pattern.PatternLayoutConverter"/> class.
- </summary>
- </member>
- <member name="M:log4net.Layout.Pattern.PatternLayoutConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Derived pattern converters must override this method in order to
- convert conversion specifiers in the correct way.
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">The <see cref="T:log4net.Core.LoggingEvent"/> on which the pattern converter should be executed.</param>
- </member>
- <member name="M:log4net.Layout.Pattern.PatternLayoutConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Derived pattern converters must override this method in order to
- convert conversion specifiers in the correct way.
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">The state object on which the pattern converter should be executed.</param>
- </member>
- <member name="F:log4net.Layout.Pattern.PatternLayoutConverter.m_ignoresException">
- <summary>
- Flag indicating if this converter handles exceptions
- </summary>
- <remarks>
- <c>false</c> if this converter handles exceptions
- </remarks>
- </member>
- <member name="P:log4net.Layout.Pattern.PatternLayoutConverter.IgnoresException">
- <summary>
- Flag indicating if this converter handles the logging event exception
- </summary>
- <value><c>false</c> if this converter handles the logging event exception</value>
- <remarks>
- <para>
- If this converter handles the exception object contained within
- <see cref="T:log4net.Core.LoggingEvent"/>, then this property should be set to
- <c>false</c>. Otherwise, if the layout ignores the exception
- object, then the property should be set to <c>true</c>.
- </para>
- <para>
- Set this value to override a this default setting. The default
- value is <c>true</c>, this converter does not handle the exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.AppDomainPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the event appdomain name to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LoggingEvent.Domain"/> to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.DatePatternConverter">
- <summary>
- Date pattern converter, uses a <see cref="T:log4net.DateFormatter.IDateFormatter"/> to format
- the date of a <see cref="T:log4net.Core.LoggingEvent"/>.
- </summary>
- <remarks>
- <para>
- Render the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> to the writer as a string.
- </para>
- <para>
- The value of the <see cref="P:log4net.Util.PatternConverter.Option"/> determines
- the formatting of the date. The following values are allowed:
- <list type="definition">
- <listheader>
- <term>Option value</term>
- <description>Output</description>
- </listheader>
- <item>
- <term>ISO8601</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/> formatter.
- Formats using the <c>"yyyy-MM-dd HH:mm:ss,fff"</c> pattern.
- </description>
- </item>
- <item>
- <term>DATE</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> formatter.
- Formats using the <c>"dd MMM yyyy HH:mm:ss,fff"</c> for example, <c>"06 Nov 1994 15:49:37,459"</c>.
- </description>
- </item>
- <item>
- <term>ABSOLUTE</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/> formatter.
- Formats using the <c>"HH:mm:ss,yyyy"</c> for example, <c>"15:49:37,459"</c>.
- </description>
- </item>
- <item>
- <term>other</term>
- <description>
- Any other pattern string uses the <see cref="T:log4net.DateFormatter.SimpleDateFormatter"/> formatter.
- This formatter passes the pattern string to the <see cref="T:System.DateTime"/>
- <see cref="M:System.DateTime.ToString(System.String)"/> method.
- For details on valid patterns see
- <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationdatetimeformatinfoclasstopic.asp">DateTimeFormatInfo Class</a>.
- </description>
- </item>
- </list>
- </para>
- <para>
- The <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> is in the local time zone and is rendered in that zone.
- To output the time in Universal time see <see cref="T:log4net.Layout.Pattern.UtcDatePatternConverter"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Layout.Pattern.DatePatternConverter.m_dateFormatter">
- <summary>
- The <see cref="T:log4net.DateFormatter.IDateFormatter"/> used to render the date to a string
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.DateFormatter.IDateFormatter"/> used to render the date to a string
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.DatePatternConverter.ActivateOptions">
- <summary>
- Initialize the converter pattern based on the <see cref="P:log4net.Util.PatternConverter.Option"/> property.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.Pattern.DatePatternConverter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.Pattern.DatePatternConverter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.Pattern.DatePatternConverter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.DatePatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Convert the pattern into the rendered message
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Pass the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> to the <see cref="T:log4net.DateFormatter.IDateFormatter"/>
- for it to render it to the writer.
- </para>
- <para>
- The <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> passed is in the local time zone.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.ExceptionPatternConverter">
- <summary>
- Write the exception text to the output
- </summary>
- <remarks>
- <para>
- If an exception object is stored in the logging event
- it will be rendered into the pattern output with a
- trailing newline.
- </para>
- <para>
- If there is no exception then nothing will be output
- and no trailing newline will be appended.
- It is typical to put a newline before the exception
- and to have the exception as the last data in the pattern.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.ExceptionPatternConverter.#ctor">
- <summary>
- Default constructor
- </summary>
- </member>
- <member name="M:log4net.Layout.Pattern.ExceptionPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the exception text to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- If an exception object is stored in the logging event
- it will be rendered into the pattern output with a
- trailing newline.
- </para>
- <para>
- If there is no exception then nothing will be output
- and no trailing newline will be appended.
- It is typical to put a newline before the exception
- and to have the exception as the last data in the pattern.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.FileLocationPatternConverter">
- <summary>
- Writes the caller location file name to the output
- </summary>
- <remarks>
- <para>
- Writes the value of the <see cref="P:log4net.Core.LocationInfo.FileName"/> for
- the event to the output writer.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.FileLocationPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the caller location file name to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the value of the <see cref="P:log4net.Core.LocationInfo.FileName"/> for
- the <paramref name="loggingEvent"/> to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.FullLocationPatternConverter">
- <summary>
- Write the caller location info to the output
- </summary>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LocationInfo.FullInfo"/> to the output writer.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.FullLocationPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the caller location info to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LocationInfo.FullInfo"/> to the output writer.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.IdentityPatternConverter">
- <summary>
- Writes the event identity to the output
- </summary>
- <remarks>
- <para>
- Writes the value of the <see cref="P:log4net.Core.LoggingEvent.Identity"/> to
- the output writer.
- </para>
- </remarks>
- <author>Daniel Cazzulino</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.IdentityPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Writes the event identity to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the value of the <paramref name="loggingEvent"/>
- <see cref="P:log4net.Core.LoggingEvent.Identity"/> to
- the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.LevelPatternConverter">
- <summary>
- Write the event level to the output
- </summary>
- <remarks>
- <para>
- Writes the display name of the event <see cref="P:log4net.Core.LoggingEvent.Level"/>
- to the writer.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.LevelPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the event level to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.Level.DisplayName"/> of the <paramref name="loggingEvent"/> <see cref="P:log4net.Core.LoggingEvent.Level"/>
- to the <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.LineLocationPatternConverter">
- <summary>
- Write the caller location line number to the output
- </summary>
- <remarks>
- <para>
- Writes the value of the <see cref="P:log4net.Core.LocationInfo.LineNumber"/> for
- the event to the output writer.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.LineLocationPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the caller location line number to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the value of the <see cref="P:log4net.Core.LocationInfo.LineNumber"/> for
- the <paramref name="loggingEvent"/> to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.LoggerPatternConverter">
- <summary>
- Converter for logger name
- </summary>
- <remarks>
- <para>
- Outputs the <see cref="P:log4net.Core.LoggingEvent.LoggerName"/> of the event.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="T:log4net.Layout.Pattern.NamedPatternConverter">
- <summary>
- Converter to output and truncate <c>'.'</c> separated strings
- </summary>
- <remarks>
- <para>
- This abstract class supports truncating a <c>'.'</c> separated string
- to show a specified number of elements from the right hand side.
- This is used to truncate class names that are fully qualified.
- </para>
- <para>
- Subclasses should override the <see cref="M:log4net.Layout.Pattern.NamedPatternConverter.GetFullyQualifiedName(log4net.Core.LoggingEvent)"/> method to
- return the fully qualified string.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.NamedPatternConverter.ActivateOptions">
- <summary>
- Initialize the converter
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.Pattern.NamedPatternConverter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.Pattern.NamedPatternConverter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.Pattern.NamedPatternConverter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.NamedPatternConverter.GetFullyQualifiedName(log4net.Core.LoggingEvent)">
- <summary>
- Get the fully qualified string data
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>the fully qualified name</returns>
- <remarks>
- <para>
- Overridden by subclasses to get the fully qualified name before the
- precision is applied to it.
- </para>
- <para>
- Return the fully qualified <c>'.'</c> (dot/period) separated string.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.NamedPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Convert the pattern to the rendered message
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- Render the <see cref="M:log4net.Layout.Pattern.NamedPatternConverter.GetFullyQualifiedName(log4net.Core.LoggingEvent)"/> to the precision
- specified by the <see cref="P:log4net.Util.PatternConverter.Option"/> property.
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.LoggerPatternConverter.GetFullyQualifiedName(log4net.Core.LoggingEvent)">
- <summary>
- Gets the fully qualified name of the logger
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>The fully qualified logger name</returns>
- <remarks>
- <para>
- Returns the <see cref="P:log4net.Core.LoggingEvent.LoggerName"/> of the <paramref name="loggingEvent"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.MessagePatternConverter">
- <summary>
- Writes the event message to the output
- </summary>
- <remarks>
- <para>
- Uses the <see cref="M:log4net.Core.LoggingEvent.WriteRenderedMessage(System.IO.TextWriter)"/> method
- to write out the event message.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.MessagePatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Writes the event message to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Uses the <see cref="M:log4net.Core.LoggingEvent.WriteRenderedMessage(System.IO.TextWriter)"/> method
- to write out the event message.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.MethodLocationPatternConverter">
- <summary>
- Write the method name to the output
- </summary>
- <remarks>
- <para>
- Writes the caller location <see cref="P:log4net.Core.LocationInfo.MethodName"/> to
- the output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.MethodLocationPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the method name to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the caller location <see cref="P:log4net.Core.LocationInfo.MethodName"/> to
- the output.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.NdcPatternConverter">
- <summary>
- Converter to include event NDC
- </summary>
- <remarks>
- <para>
- Outputs the value of the event property named <c>NDC</c>.
- </para>
- <para>
- The <see cref="T:log4net.Layout.Pattern.PropertyPatternConverter"/> should be used instead.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.NdcPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the event NDC to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- As the thread context stacks are now stored in named event properties
- this converter simply looks up the value of the <c>NDC</c> property.
- </para>
- <para>
- The <see cref="T:log4net.Layout.Pattern.PropertyPatternConverter"/> should be used instead.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.PropertyPatternConverter">
- <summary>
- Property pattern converter
- </summary>
- <remarks>
- <para>
- Writes out the value of a named property. The property name
- should be set in the <see cref="P:log4net.Util.PatternConverter.Option"/>
- property.
- </para>
- <para>
- If the <see cref="P:log4net.Util.PatternConverter.Option"/> is set to <c>null</c>
- then all the properties are written as key value pairs.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.PropertyPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the property value to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes out the value of a named property. The property name
- should be set in the <see cref="P:log4net.Util.PatternConverter.Option"/>
- property.
- </para>
- <para>
- If the <see cref="P:log4net.Util.PatternConverter.Option"/> is set to <c>null</c>
- then all the properties are written as key value pairs.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.RelativeTimePatternConverter">
- <summary>
- Converter to output the relative time of the event
- </summary>
- <remarks>
- <para>
- Converter to output the time of the event relative to the start of the program.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.RelativeTimePatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the relative time to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes out the relative time of the event in milliseconds.
- That is the number of milliseconds between the event <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/>
- and the <see cref="P:log4net.Core.LoggingEvent.StartTime"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Pattern.RelativeTimePatternConverter.TimeDifferenceInMillis(System.DateTime,System.DateTime)">
- <summary>
- Helper method to get the time difference between two DateTime objects
- </summary>
- <param name="start">start time (in the current local time zone)</param>
- <param name="end">end time (in the current local time zone)</param>
- <returns>the time difference in milliseconds</returns>
- </member>
- <member name="T:log4net.Layout.Pattern.ThreadPatternConverter">
- <summary>
- Converter to include event thread name
- </summary>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LoggingEvent.ThreadName"/> to the output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.ThreadPatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the ThreadName to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Writes the <see cref="P:log4net.Core.LoggingEvent.ThreadName"/> to the <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.TypeNamePatternConverter">
- <summary>
- Pattern converter for the class name
- </summary>
- <remarks>
- <para>
- Outputs the <see cref="P:log4net.Core.LocationInfo.ClassName"/> of the event.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.TypeNamePatternConverter.GetFullyQualifiedName(log4net.Core.LoggingEvent)">
- <summary>
- Gets the fully qualified name of the class
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <returns>The fully qualified type name for the caller location</returns>
- <remarks>
- <para>
- Returns the <see cref="P:log4net.Core.LocationInfo.ClassName"/> of the <paramref name="loggingEvent"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Pattern.UserNamePatternConverter">
- <summary>
- Converter to include event user name
- </summary>
- <author>Douglas de la Torre</author>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.UserNamePatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Convert the pattern to the rendered message
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- </member>
- <member name="T:log4net.Layout.Pattern.UtcDatePatternConverter">
- <summary>
- Write the TimeStamp to the output
- </summary>
- <remarks>
- <para>
- Date pattern converter, uses a <see cref="T:log4net.DateFormatter.IDateFormatter"/> to format
- the date of a <see cref="T:log4net.Core.LoggingEvent"/>.
- </para>
- <para>
- Uses a <see cref="T:log4net.DateFormatter.IDateFormatter"/> to format the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/>
- in Universal time.
- </para>
- <para>
- See the <see cref="T:log4net.Layout.Pattern.DatePatternConverter"/> for details on the date pattern syntax.
- </para>
- </remarks>
- <seealso cref="T:log4net.Layout.Pattern.DatePatternConverter"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.Pattern.UtcDatePatternConverter.Convert(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Write the TimeStamp to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Pass the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> to the <see cref="T:log4net.DateFormatter.IDateFormatter"/>
- for it to render it to the writer.
- </para>
- <para>
- The <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> passed is in the local time zone, this is converted
- to Universal time before it is rendered.
- </para>
- </remarks>
- <seealso cref="T:log4net.Layout.Pattern.DatePatternConverter"/>
- </member>
- <member name="T:log4net.Layout.ExceptionLayout">
- <summary>
- A Layout that renders only the Exception text from the logging event
- </summary>
- <remarks>
- <para>
- A Layout that renders only the Exception text from the logging event.
- </para>
- <para>
- This Layout should only be used with appenders that utilize multiple
- layouts (e.g. <see cref="T:log4net.Appender.AdoNetAppender"/>).
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Layout.LayoutSkeleton">
- <summary>
- Extend this abstract class to create your own log layout format.
- </summary>
- <remarks>
- <para>
- This is the base implementation of the <see cref="T:log4net.Layout.ILayout"/>
- interface. Most layout objects should extend this class.
- </para>
- </remarks>
- <remarks>
- <note type="inheritinfo">
- <para>
- Subclasses must implement the <see cref="M:log4net.Layout.LayoutSkeleton.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)"/>
- method.
- </para>
- <para>
- Subclasses should set the <see cref="P:log4net.Layout.LayoutSkeleton.IgnoresException"/> in their default
- constructor.
- </para>
- </note>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Layout.ILayout">
- <summary>
- Interface implemented by layout objects
- </summary>
- <remarks>
- <para>
- An <see cref="T:log4net.Layout.ILayout"/> object is used to format a <see cref="T:log4net.Core.LoggingEvent"/>
- as text. The <see cref="M:log4net.Layout.ILayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)"/> method is called by an
- appender to transform the <see cref="T:log4net.Core.LoggingEvent"/> into a string.
- </para>
- <para>
- The layout can also supply <see cref="P:log4net.Layout.ILayout.Header"/> and <see cref="P:log4net.Layout.ILayout.Footer"/>
- text that is appender before any events and after all the events respectively.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.ILayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Implement this method to create your own layout format.
- </summary>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <param name="loggingEvent">The event to format</param>
- <remarks>
- <para>
- This method is called by an appender to format
- the <paramref name="loggingEvent"/> as text and output to a writer.
- </para>
- <para>
- If the caller does not have a <see cref="T:System.IO.TextWriter"/> and prefers the
- event to be formatted as a <see cref="T:System.String"/> then the following
- code can be used to format the event into a <see cref="T:System.IO.StringWriter"/>.
- </para>
- <code lang="C#">
- StringWriter writer = new StringWriter();
- Layout.Format(writer, loggingEvent);
- string formattedEvent = writer.ToString();
- </code>
- </remarks>
- </member>
- <member name="P:log4net.Layout.ILayout.ContentType">
- <summary>
- The content type output by this layout.
- </summary>
- <value>The content type</value>
- <remarks>
- <para>
- The content type output by this layout.
- </para>
- <para>
- This is a MIME type e.g. <c>"text/plain"</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.ILayout.Header">
- <summary>
- The header for the layout format.
- </summary>
- <value>the layout header</value>
- <remarks>
- <para>
- The Header text will be appended before any logging events
- are formatted and appended.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.ILayout.Footer">
- <summary>
- The footer for the layout format.
- </summary>
- <value>the layout footer</value>
- <remarks>
- <para>
- The Footer text will be appended after all the logging events
- have been formatted and appended.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.ILayout.IgnoresException">
- <summary>
- Flag indicating if this layout handle exceptions
- </summary>
- <value><c>false</c> if this layout handles exceptions</value>
- <remarks>
- <para>
- If this layout handles the exception object contained within
- <see cref="T:log4net.Core.LoggingEvent"/>, then the layout should return
- <c>false</c>. Otherwise, if the layout ignores the exception
- object, then the layout should return <c>true</c>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.LayoutSkeleton.m_header">
- <summary>
- The header text
- </summary>
- <remarks>
- <para>
- See <see cref="P:log4net.Layout.LayoutSkeleton.Header"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.LayoutSkeleton.m_footer">
- <summary>
- The footer text
- </summary>
- <remarks>
- <para>
- See <see cref="P:log4net.Layout.LayoutSkeleton.Footer"/> for more information.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.LayoutSkeleton.m_ignoresException">
- <summary>
- Flag indicating if this layout handles exceptions
- </summary>
- <remarks>
- <para>
- <c>false</c> if this layout handles exceptions
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.LayoutSkeleton.#ctor">
- <summary>
- Empty default constructor
- </summary>
- <remarks>
- <para>
- Empty default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.LayoutSkeleton.ActivateOptions">
- <summary>
- Activate component options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.LayoutSkeleton.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.LayoutSkeleton.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.LayoutSkeleton.ActivateOptions"/> must be called again.
- </para>
- <para>
- This method must be implemented by the subclass.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.LayoutSkeleton.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Implement this method to create your own layout format.
- </summary>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <param name="loggingEvent">The event to format</param>
- <remarks>
- <para>
- This method is called by an appender to format
- the <paramref name="loggingEvent"/> as text.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.LayoutSkeleton.ContentType">
- <summary>
- The content type output by this layout.
- </summary>
- <value>The content type is <c>"text/plain"</c></value>
- <remarks>
- <para>
- The content type output by this layout.
- </para>
- <para>
- This base class uses the value <c>"text/plain"</c>.
- To change this value a subclass must override this
- property.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.LayoutSkeleton.Header">
- <summary>
- The header for the layout format.
- </summary>
- <value>the layout header</value>
- <remarks>
- <para>
- The Header text will be appended before any logging events
- are formatted and appended.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.LayoutSkeleton.Footer">
- <summary>
- The footer for the layout format.
- </summary>
- <value>the layout footer</value>
- <remarks>
- <para>
- The Footer text will be appended after all the logging events
- have been formatted and appended.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.LayoutSkeleton.IgnoresException">
- <summary>
- Flag indicating if this layout handles exceptions
- </summary>
- <value><c>false</c> if this layout handles exceptions</value>
- <remarks>
- <para>
- If this layout handles the exception object contained within
- <see cref="T:log4net.Core.LoggingEvent"/>, then the layout should return
- <c>false</c>. Otherwise, if the layout ignores the exception
- object, then the layout should return <c>true</c>.
- </para>
- <para>
- Set this value to override a this default setting. The default
- value is <c>true</c>, this layout does not handle the exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.ExceptionLayout.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Constructs a ExceptionLayout
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.ExceptionLayout.ActivateOptions">
- <summary>
- Activate component options
- </summary>
- <remarks>
- <para>
- Part of the <see cref="T:log4net.Core.IOptionHandler"/> component activation
- framework.
- </para>
- <para>
- This method does nothing as options become effective immediately.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.ExceptionLayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Gets the exception text from the logging event
- </summary>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <param name="loggingEvent">the event being logged</param>
- <remarks>
- <para>
- Write the exception string to the <see cref="T:System.IO.TextWriter"/>.
- The exception string is retrieved from <see cref="M:log4net.Core.LoggingEvent.GetExceptionString"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.IRawLayout">
- <summary>
- Interface for raw layout objects
- </summary>
- <remarks>
- <para>
- Interface used to format a <see cref="T:log4net.Core.LoggingEvent"/>
- to an object.
- </para>
- <para>
- This interface should not be confused with the
- <see cref="T:log4net.Layout.ILayout"/> interface. This interface is used in
- only certain specialized situations where a raw object is
- required rather than a formatted string. The <see cref="T:log4net.Layout.ILayout"/>
- is not generally useful than this interface.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.IRawLayout.Format(log4net.Core.LoggingEvent)">
- <summary>
- Implement this method to create your own layout format.
- </summary>
- <param name="loggingEvent">The event to format</param>
- <returns>returns the formatted event</returns>
- <remarks>
- <para>
- Implement this method to create your own layout format.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.Layout2RawLayoutAdapter">
- <summary>
- Adapts any <see cref="T:log4net.Layout.ILayout"/> to a <see cref="T:log4net.Layout.IRawLayout"/>
- </summary>
- <remarks>
- <para>
- Where an <see cref="T:log4net.Layout.IRawLayout"/> is required this adapter
- allows a <see cref="T:log4net.Layout.ILayout"/> to be specified.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Layout.Layout2RawLayoutAdapter.m_layout">
- <summary>
- The layout to adapt
- </summary>
- </member>
- <member name="M:log4net.Layout.Layout2RawLayoutAdapter.#ctor(log4net.Layout.ILayout)">
- <summary>
- Construct a new adapter
- </summary>
- <param name="layout">the layout to adapt</param>
- <remarks>
- <para>
- Create the adapter for the specified <paramref name="layout"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.Layout2RawLayoutAdapter.Format(log4net.Core.LoggingEvent)">
- <summary>
- Format the logging event as an object.
- </summary>
- <param name="loggingEvent">The event to format</param>
- <returns>returns the formatted event</returns>
- <remarks>
- <para>
- Format the logging event as an object.
- </para>
- <para>
- Uses the <see cref="T:log4net.Layout.ILayout"/> object supplied to
- the constructor to perform the formatting.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.PatternLayout">
- <summary>
- A flexible layout configurable with pattern string.
- </summary>
- <remarks>
- <para>
- The goal of this class is to <see cref="M:log4net.Layout.PatternLayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)"/> a
- <see cref="T:log4net.Core.LoggingEvent"/> as a string. The results
- depend on the <i>conversion pattern</i>.
- </para>
- <para>
- The conversion pattern is closely related to the conversion
- pattern of the printf function in C. A conversion pattern is
- composed of literal text and format control expressions called
- <i>conversion specifiers</i>.
- </para>
- <para>
- <i>You are free to insert any literal text within the conversion
- pattern.</i>
- </para>
- <para>
- Each conversion specifier starts with a percent sign (%) and is
- followed by optional <i>format modifiers</i> and a <i>conversion
- pattern name</i>. The conversion pattern name specifies the type of
- data, e.g. logger, level, date, thread name. The format
- modifiers control such things as field width, padding, left and
- right justification. The following is a simple example.
- </para>
- <para>
- Let the conversion pattern be <b>"%-5level [%thread]: %message%newline"</b> and assume
- that the log4net environment was set to use a PatternLayout. Then the
- statements
- </para>
- <code lang="C#">
- ILog log = LogManager.GetLogger(typeof(TestApp));
- log.Debug("Message 1");
- log.Warn("Message 2");
- </code>
- <para>would yield the output</para>
- <code>
- DEBUG [main]: Message 1
- WARN [main]: Message 2
- </code>
- <para>
- Note that there is no explicit separator between text and
- conversion specifiers. The pattern parser knows when it has reached
- the end of a conversion specifier when it reads a conversion
- character. In the example above the conversion specifier
- <b>%-5level</b> means the level of the logging event should be left
- justified to a width of five characters.
- </para>
- <para>
- The recognized conversion pattern names are:
- </para>
- <list type="table">
- <listheader>
- <term>Conversion Pattern Name</term>
- <description>Effect</description>
- </listheader>
- <item>
- <term>a</term>
- <description>Equivalent to <b>appdomain</b></description>
- </item>
- <item>
- <term>appdomain</term>
- <description>
- Used to output the friendly name of the AppDomain where the
- logging event was generated.
- </description>
- </item>
- <item>
- <term>c</term>
- <description>Equivalent to <b>logger</b></description>
- </item>
- <item>
- <term>C</term>
- <description>Equivalent to <b>type</b></description>
- </item>
- <item>
- <term>class</term>
- <description>Equivalent to <b>type</b></description>
- </item>
- <item>
- <term>d</term>
- <description>Equivalent to <b>date</b></description>
- </item>
- <item>
- <term>date</term>
- <description>
- <para>
- Used to output the date of the logging event in the local time zone.
- To output the date in universal time use the <c>%utcdate</c> pattern.
- The date conversion
- specifier may be followed by a <i>date format specifier</i> enclosed
- between braces. For example, <b>%date{HH:mm:ss,fff}</b> or
- <b>%date{dd MMM yyyy HH:mm:ss,fff}</b>. If no date format specifier is
- given then ISO8601 format is
- assumed (<see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>).
- </para>
- <para>
- The date format specifier admits the same syntax as the
- time pattern string of the <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- <para>
- For better results it is recommended to use the log4net date
- formatters. These can be specified using one of the strings
- "ABSOLUTE", "DATE" and "ISO8601" for specifying
- <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/>,
- <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> and respectively
- <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>. For example,
- <b>%date{ISO8601}</b> or <b>%date{ABSOLUTE}</b>.
- </para>
- <para>
- These dedicated date formatters perform significantly
- better than <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- </description>
- </item>
- <item>
- <term>exception</term>
- <description>
- <para>
- Used to output the exception passed in with the log message.
- </para>
- <para>
- If an exception object is stored in the logging event
- it will be rendered into the pattern output with a
- trailing newline.
- If there is no exception then nothing will be output
- and no trailing newline will be appended.
- It is typical to put a newline before the exception
- and to have the exception as the last data in the pattern.
- </para>
- </description>
- </item>
- <item>
- <term>F</term>
- <description>Equivalent to <b>file</b></description>
- </item>
- <item>
- <term>file</term>
- <description>
- <para>
- Used to output the file name where the logging request was
- issued.
- </para>
- <para>
- <b>WARNING</b> Generating caller location information is
- extremely slow. Its use should be avoided unless execution speed
- is not an issue.
- </para>
- <para>
- See the note below on the availability of caller location information.
- </para>
- </description>
- </item>
- <item>
- <term>identity</term>
- <description>
- <para>
- Used to output the user name for the currently active user
- (Principal.Identity.Name).
- </para>
- <para>
- <b>WARNING</b> Generating caller information is
- extremely slow. Its use should be avoided unless execution speed
- is not an issue.
- </para>
- </description>
- </item>
- <item>
- <term>l</term>
- <description>Equivalent to <b>location</b></description>
- </item>
- <item>
- <term>L</term>
- <description>Equivalent to <b>line</b></description>
- </item>
- <item>
- <term>location</term>
- <description>
- <para>
- Used to output location information of the caller which generated
- the logging event.
- </para>
- <para>
- The location information depends on the CLI implementation but
- usually consists of the fully qualified name of the calling
- method followed by the callers source the file name and line
- number between parentheses.
- </para>
- <para>
- The location information can be very useful. However, its
- generation is <b>extremely</b> slow. Its use should be avoided
- unless execution speed is not an issue.
- </para>
- <para>
- See the note below on the availability of caller location information.
- </para>
- </description>
- </item>
- <item>
- <term>level</term>
- <description>
- <para>
- Used to output the level of the logging event.
- </para>
- </description>
- </item>
- <item>
- <term>line</term>
- <description>
- <para>
- Used to output the line number from where the logging request
- was issued.
- </para>
- <para>
- <b>WARNING</b> Generating caller location information is
- extremely slow. Its use should be avoided unless execution speed
- is not an issue.
- </para>
- <para>
- See the note below on the availability of caller location information.
- </para>
- </description>
- </item>
- <item>
- <term>logger</term>
- <description>
- <para>
- Used to output the logger of the logging event. The
- logger conversion specifier can be optionally followed by
- <i>precision specifier</i>, that is a decimal constant in
- brackets.
- </para>
- <para>
- If a precision specifier is given, then only the corresponding
- number of right most components of the logger name will be
- printed. By default the logger name is printed in full.
- </para>
- <para>
- For example, for the logger name "a.b.c" the pattern
- <b>%logger{2}</b> will output "b.c".
- </para>
- </description>
- </item>
- <item>
- <term>m</term>
- <description>Equivalent to <b>message</b></description>
- </item>
- <item>
- <term>M</term>
- <description>Equivalent to <b>method</b></description>
- </item>
- <item>
- <term>message</term>
- <description>
- <para>
- Used to output the application supplied message associated with
- the logging event.
- </para>
- </description>
- </item>
- <item>
- <term>mdc</term>
- <description>
- <para>
- The MDC (old name for the ThreadContext.Properties) is now part of the
- combined event properties. This pattern is supported for compatibility
- but is equivalent to <b>property</b>.
- </para>
- </description>
- </item>
- <item>
- <term>method</term>
- <description>
- <para>
- Used to output the method name where the logging request was
- issued.
- </para>
- <para>
- <b>WARNING</b> Generating caller location information is
- extremely slow. Its use should be avoided unless execution speed
- is not an issue.
- </para>
- <para>
- See the note below on the availability of caller location information.
- </para>
- </description>
- </item>
- <item>
- <term>n</term>
- <description>Equivalent to <b>newline</b></description>
- </item>
- <item>
- <term>newline</term>
- <description>
- <para>
- Outputs the platform dependent line separator character or
- characters.
- </para>
- <para>
- This conversion pattern offers the same performance as using
- non-portable line separator strings such as "\n", or "\r\n".
- Thus, it is the preferred way of specifying a line separator.
- </para>
- </description>
- </item>
- <item>
- <term>ndc</term>
- <description>
- <para>
- Used to output the NDC (nested diagnostic context) associated
- with the thread that generated the logging event.
- </para>
- </description>
- </item>
- <item>
- <term>p</term>
- <description>Equivalent to <b>level</b></description>
- </item>
- <item>
- <term>P</term>
- <description>Equivalent to <b>property</b></description>
- </item>
- <item>
- <term>properties</term>
- <description>Equivalent to <b>property</b></description>
- </item>
- <item>
- <term>property</term>
- <description>
- <para>
- Used to output the an event specific property. The key to
- lookup must be specified within braces and directly following the
- pattern specifier, e.g. <b>%property{user}</b> would include the value
- from the property that is keyed by the string 'user'. Each property value
- that is to be included in the log must be specified separately.
- Properties are added to events by loggers or appenders. By default
- the <c>log4net:HostName</c> property is set to the name of machine on
- which the event was originally logged.
- </para>
- <para>
- If no key is specified, e.g. <b>%property</b> then all the keys and their
- values are printed in a comma separated list.
- </para>
- <para>
- The properties of an event are combined from a number of different
- contexts. These are listed below in the order in which they are searched.
- </para>
- <list type="definition">
- <item>
- <term>the event properties</term>
- <description>
- The event has <see cref="P:log4net.Core.LoggingEvent.Properties"/> that can be set. These
- properties are specific to this event only.
- </description>
- </item>
- <item>
- <term>the thread properties</term>
- <description>
- The <see cref="P:log4net.ThreadContext.Properties"/> that are set on the current
- thread. These properties are shared by all events logged on this thread.
- </description>
- </item>
- <item>
- <term>the global properties</term>
- <description>
- The <see cref="P:log4net.GlobalContext.Properties"/> that are set globally. These
- properties are shared by all the threads in the AppDomain.
- </description>
- </item>
- </list>
-
- </description>
- </item>
- <item>
- <term>r</term>
- <description>Equivalent to <b>timestamp</b></description>
- </item>
- <item>
- <term>t</term>
- <description>Equivalent to <b>thread</b></description>
- </item>
- <item>
- <term>timestamp</term>
- <description>
- <para>
- Used to output the number of milliseconds elapsed since the start
- of the application until the creation of the logging event.
- </para>
- </description>
- </item>
- <item>
- <term>thread</term>
- <description>
- <para>
- Used to output the name of the thread that generated the
- logging event. Uses the thread number if no name is available.
- </para>
- </description>
- </item>
- <item>
- <term>type</term>
- <description>
- <para>
- Used to output the fully qualified type name of the caller
- issuing the logging request. This conversion specifier
- can be optionally followed by <i>precision specifier</i>, that
- is a decimal constant in brackets.
- </para>
- <para>
- If a precision specifier is given, then only the corresponding
- number of right most components of the class name will be
- printed. By default the class name is output in fully qualified form.
- </para>
- <para>
- For example, for the class name "log4net.Layout.PatternLayout", the
- pattern <b>%type{1}</b> will output "PatternLayout".
- </para>
- <para>
- <b>WARNING</b> Generating the caller class information is
- slow. Thus, its use should be avoided unless execution speed is
- not an issue.
- </para>
- <para>
- See the note below on the availability of caller location information.
- </para>
- </description>
- </item>
- <item>
- <term>u</term>
- <description>Equivalent to <b>identity</b></description>
- </item>
- <item>
- <term>username</term>
- <description>
- <para>
- Used to output the WindowsIdentity for the currently
- active user.
- </para>
- <para>
- <b>WARNING</b> Generating caller WindowsIdentity information is
- extremely slow. Its use should be avoided unless execution speed
- is not an issue.
- </para>
- </description>
- </item>
- <item>
- <term>utcdate</term>
- <description>
- <para>
- Used to output the date of the logging event in universal time.
- The date conversion
- specifier may be followed by a <i>date format specifier</i> enclosed
- between braces. For example, <b>%utcdate{HH:mm:ss,fff}</b> or
- <b>%utcdate{dd MMM yyyy HH:mm:ss,fff}</b>. If no date format specifier is
- given then ISO8601 format is
- assumed (<see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>).
- </para>
- <para>
- The date format specifier admits the same syntax as the
- time pattern string of the <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- <para>
- For better results it is recommended to use the log4net date
- formatters. These can be specified using one of the strings
- "ABSOLUTE", "DATE" and "ISO8601" for specifying
- <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/>,
- <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> and respectively
- <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>. For example,
- <b>%utcdate{ISO8601}</b> or <b>%utcdate{ABSOLUTE}</b>.
- </para>
- <para>
- These dedicated date formatters perform significantly
- better than <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- </description>
- </item>
- <item>
- <term>w</term>
- <description>Equivalent to <b>username</b></description>
- </item>
- <item>
- <term>x</term>
- <description>Equivalent to <b>ndc</b></description>
- </item>
- <item>
- <term>X</term>
- <description>Equivalent to <b>mdc</b></description>
- </item>
- <item>
- <term>%</term>
- <description>
- <para>
- The sequence %% outputs a single percent sign.
- </para>
- </description>
- </item>
- </list>
- <para>
- The single letter patterns are deprecated in favor of the
- longer more descriptive pattern names.
- </para>
- <para>
- By default the relevant information is output as is. However,
- with the aid of format modifiers it is possible to change the
- minimum field width, the maximum field width and justification.
- </para>
- <para>
- The optional format modifier is placed between the percent sign
- and the conversion pattern name.
- </para>
- <para>
- The first optional format modifier is the <i>left justification
- flag</i> which is just the minus (-) character. Then comes the
- optional <i>minimum field width</i> modifier. This is a decimal
- constant that represents the minimum number of characters to
- output. If the data item requires fewer characters, it is padded on
- either the left or the right until the minimum width is
- reached. The default is to pad on the left (right justify) but you
- can specify right padding with the left justification flag. The
- padding character is space. If the data item is larger than the
- minimum field width, the field is expanded to accommodate the
- data. The value is never truncated.
- </para>
- <para>
- This behavior can be changed using the <i>maximum field
- width</i> modifier which is designated by a period followed by a
- decimal constant. If the data item is longer than the maximum
- field, then the extra characters are removed from the
- <i>beginning</i> of the data item and not from the end. For
- example, it the maximum field width is eight and the data item is
- ten characters long, then the first two characters of the data item
- are dropped. This behavior deviates from the printf function in C
- where truncation is done from the end.
- </para>
- <para>
- Below are various format modifier examples for the logger
- conversion specifier.
- </para>
- <div class="tablediv">
- <table class="dtTABLE" cellspacing="0">
- <tr>
- <th>Format modifier</th>
- <th>left justify</th>
- <th>minimum width</th>
- <th>maximum width</th>
- <th>comment</th>
- </tr>
- <tr>
- <td align="center">%20logger</td>
- <td align="center">false</td>
- <td align="center">20</td>
- <td align="center">none</td>
- <td>
- <para>
- Left pad with spaces if the logger name is less than 20
- characters long.
- </para>
- </td>
- </tr>
- <tr>
- <td align="center">%-20logger</td>
- <td align="center">true</td>
- <td align="center">20</td>
- <td align="center">none</td>
- <td>
- <para>
- Right pad with spaces if the logger
- name is less than 20 characters long.
- </para>
- </td>
- </tr>
- <tr>
- <td align="center">%.30logger</td>
- <td align="center">NA</td>
- <td align="center">none</td>
- <td align="center">30</td>
- <td>
- <para>
- Truncate from the beginning if the logger
- name is longer than 30 characters.
- </para>
- </td>
- </tr>
- <tr>
- <td align="center"><nobr>%20.30logger</nobr></td>
- <td align="center">false</td>
- <td align="center">20</td>
- <td align="center">30</td>
- <td>
- <para>
- Left pad with spaces if the logger name is shorter than 20
- characters. However, if logger name is longer than 30 characters,
- then truncate from the beginning.
- </para>
- </td>
- </tr>
- <tr>
- <td align="center">%-20.30logger</td>
- <td align="center">true</td>
- <td align="center">20</td>
- <td align="center">30</td>
- <td>
- <para>
- Right pad with spaces if the logger name is shorter than 20
- characters. However, if logger name is longer than 30 characters,
- then truncate from the beginning.
- </para>
- </td>
- </tr>
- </table>
- </div>
- <para>
- <b>Note about caller location information.</b><br/>
- The following patterns <c>%type %file %line %method %location %class %C %F %L %l %M</c>
- all generate caller location information.
- Location information uses the <c>System.Diagnostics.StackTrace</c> class to generate
- a call stack. The caller's information is then extracted from this stack.
- </para>
- <note type="caution">
- <para>
- The <c>System.Diagnostics.StackTrace</c> class is not supported on the
- .NET Compact Framework 1.0 therefore caller location information is not
- available on that framework.
- </para>
- </note>
- <note type="caution">
- <para>
- The <c>System.Diagnostics.StackTrace</c> class has this to say about Release builds:
- </para>
- <para>
- "StackTrace information will be most informative with Debug build configurations.
- By default, Debug builds include debug symbols, while Release builds do not. The
- debug symbols contain most of the file, method name, line number, and column
- information used in constructing StackFrame and StackTrace objects. StackTrace
- might not report as many method calls as expected, due to code transformations
- that occur during optimization."
- </para>
- <para>
- This means that in a Release build the caller information may be incomplete or may
- not exist at all! Therefore caller location information cannot be relied upon in a Release build.
- </para>
- </note>
- <para>
- Additional pattern converters may be registered with a specific <see cref="T:log4net.Layout.PatternLayout"/>
- instance using the <see cref="M:log4net.Layout.PatternLayout.AddConverter(System.String,System.Type)"/> method.
- </para>
- </remarks>
- <example>
- This is a more detailed pattern.
- <code><b>%timestamp [%thread] %level %logger %ndc - %message%newline</b></code>
- </example>
- <example>
- A similar pattern except that the relative time is
- right padded if less than 6 digits, thread name is right padded if
- less than 15 characters and truncated if longer and the logger
- name is left padded if shorter than 30 characters and truncated if
- longer.
- <code><b>%-6timestamp [%15.15thread] %-5level %30.30logger %ndc - %message%newline</b></code>
- </example>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Douglas de la Torre</author>
- <author>Daniel Cazzulino</author>
- </member>
- <member name="F:log4net.Layout.PatternLayout.DefaultConversionPattern">
- <summary>
- Default pattern string for log output.
- </summary>
- <remarks>
- <para>
- Default pattern string for log output.
- Currently set to the string <b>"%message%newline"</b>
- which just prints the application supplied message.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.PatternLayout.DetailConversionPattern">
- <summary>
- A detailed conversion pattern
- </summary>
- <remarks>
- <para>
- A conversion pattern which includes Time, Thread, Logger, and Nested Context.
- Current value is <b>%timestamp [%thread] %level %logger %ndc - %message%newline</b>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.PatternLayout.s_globalRulesRegistry">
- <summary>
- Internal map of converter identifiers to converter types.
- </summary>
- <remarks>
- <para>
- This static map is overridden by the m_converterRegistry instance map
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.PatternLayout.m_pattern">
- <summary>
- the pattern
- </summary>
- </member>
- <member name="F:log4net.Layout.PatternLayout.m_head">
- <summary>
- the head of the pattern converter chain
- </summary>
- </member>
- <member name="F:log4net.Layout.PatternLayout.m_instanceRulesRegistry">
- <summary>
- patterns defined on this PatternLayout only
- </summary>
- </member>
- <member name="M:log4net.Layout.PatternLayout.#cctor">
- <summary>
- Initialize the global registry
- </summary>
- <remarks>
- <para>
- Defines the builtin global rules.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.#ctor">
- <summary>
- Constructs a PatternLayout using the DefaultConversionPattern
- </summary>
- <remarks>
- <para>
- The default pattern just produces the application supplied message.
- </para>
- <para>
- Note to Inheritors: This constructor calls the virtual method
- <see cref="M:log4net.Layout.PatternLayout.CreatePatternParser(System.String)"/>. If you override this method be
- aware that it will be called before your is called constructor.
- </para>
- <para>
- As per the <see cref="T:log4net.Core.IOptionHandler"/> contract the <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/>
- method must be called after the properties on this object have been
- configured.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.#ctor(System.String)">
- <summary>
- Constructs a PatternLayout using the supplied conversion pattern
- </summary>
- <param name="pattern">the pattern to use</param>
- <remarks>
- <para>
- Note to Inheritors: This constructor calls the virtual method
- <see cref="M:log4net.Layout.PatternLayout.CreatePatternParser(System.String)"/>. If you override this method be
- aware that it will be called before your is called constructor.
- </para>
- <para>
- When using this constructor the <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/> method
- need not be called. This may not be the case when using a subclass.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.CreatePatternParser(System.String)">
- <summary>
- Create the pattern parser instance
- </summary>
- <param name="pattern">the pattern to parse</param>
- <returns>The <see cref="T:log4net.Util.PatternParser"/> that will format the event</returns>
- <remarks>
- <para>
- Creates the <see cref="T:log4net.Util.PatternParser"/> used to parse the conversion string. Sets the
- global and instance rules on the <see cref="T:log4net.Util.PatternParser"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.ActivateOptions">
- <summary>
- Initialize layout options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Produces a formatted string as specified by the conversion pattern.
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <remarks>
- <para>
- Parse the <see cref="T:log4net.Core.LoggingEvent"/> using the patter format
- specified in the <see cref="P:log4net.Layout.PatternLayout.ConversionPattern"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.AddConverter(log4net.Layout.PatternLayout.ConverterInfo)">
- <summary>
- Add a converter to this PatternLayout
- </summary>
- <param name="converterInfo">the converter info</param>
- <remarks>
- <para>
- This version of the method is used by the configurator.
- Programmatic users should use the alternative <see cref="M:log4net.Layout.PatternLayout.AddConverter(System.String,System.Type)"/> method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.AddConverter(System.String,System.Type)">
- <summary>
- Add a converter to this PatternLayout
- </summary>
- <param name="name">the name of the conversion pattern for this converter</param>
- <param name="type">the type of the converter</param>
- <remarks>
- <para>
- Add a named pattern converter to this instance. This
- converter will be used in the formatting of the event.
- This method must be called before <see cref="M:log4net.Layout.PatternLayout.ActivateOptions"/>.
- </para>
- <para>
- The <paramref name="type"/> specified must extend the
- <see cref="T:log4net.Util.PatternConverter"/> type.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.PatternLayout.ConversionPattern">
- <summary>
- The pattern formatting string
- </summary>
- <remarks>
- <para>
- The <b>ConversionPattern</b> option. This is the string which
- controls formatting and consists of a mix of literal content and
- conversion specifiers.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.PatternLayout.ConverterInfo">
- <summary>
- Wrapper class used to map converter names to converter types
- </summary>
- <remarks>
- <para>
- Pattern converter info class used during configuration to
- pass to the <see cref="M:log4net.Layout.PatternLayout.AddConverter(log4net.Layout.PatternLayout.ConverterInfo)"/>
- method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.PatternLayout.ConverterInfo.#ctor">
- <summary>
- default constructor
- </summary>
- </member>
- <member name="P:log4net.Layout.PatternLayout.ConverterInfo.Name">
- <summary>
- Gets or sets the name of the conversion pattern
- </summary>
- <remarks>
- <para>
- The name of the pattern in the format string
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.PatternLayout.ConverterInfo.Type">
- <summary>
- Gets or sets the type of the converter
- </summary>
- <remarks>
- <para>
- The value specified must extend the
- <see cref="T:log4net.Util.PatternConverter"/> type.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.RawLayoutConverter">
- <summary>
- Type converter for the <see cref="T:log4net.Layout.IRawLayout"/> interface
- </summary>
- <remarks>
- <para>
- Used to convert objects to the <see cref="T:log4net.Layout.IRawLayout"/> interface.
- Supports converting from the <see cref="T:log4net.Layout.ILayout"/> interface to
- the <see cref="T:log4net.Layout.IRawLayout"/> interface using the <see cref="T:log4net.Layout.Layout2RawLayoutAdapter"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Util.TypeConverters.IConvertFrom">
- <summary>
- Interface supported by type converters
- </summary>
- <remarks>
- <para>
- This interface supports conversion from arbitrary types
- to a single target type. See <see cref="T:log4net.Util.TypeConverters.TypeConverterAttribute"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.IConvertFrom.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Test if the <paramref name="sourceType"/> can be converted to the
- type supported by this converter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.IConvertFrom.ConvertFrom(System.Object)">
- <summary>
- Convert the source object to the type supported by this object
- </summary>
- <param name="source">the object to convert</param>
- <returns>the converted object</returns>
- <remarks>
- <para>
- Converts the <paramref name="source"/> to the type supported
- by this converter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.RawLayoutConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the sourceType be converted to an <see cref="T:log4net.Layout.IRawLayout"/>
- </summary>
- <param name="sourceType">the source to be to be converted</param>
- <returns><c>true</c> if the source type can be converted to <see cref="T:log4net.Layout.IRawLayout"/></returns>
- <remarks>
- <para>
- Test if the <paramref name="sourceType"/> can be converted to a
- <see cref="T:log4net.Layout.IRawLayout"/>. Only <see cref="T:log4net.Layout.ILayout"/> is supported
- as the <paramref name="sourceType"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.RawLayoutConverter.ConvertFrom(System.Object)">
- <summary>
- Convert the value to a <see cref="T:log4net.Layout.IRawLayout"/> object
- </summary>
- <param name="source">the value to convert</param>
- <returns>the <see cref="T:log4net.Layout.IRawLayout"/> object</returns>
- <remarks>
- <para>
- Convert the <paramref name="source"/> object to a
- <see cref="T:log4net.Layout.IRawLayout"/> object. If the <paramref name="source"/> object
- is a <see cref="T:log4net.Layout.ILayout"/> then the <see cref="T:log4net.Layout.Layout2RawLayoutAdapter"/>
- is used to adapt between the two interfaces, otherwise an
- exception is thrown.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.RawPropertyLayout">
- <summary>
- Extract the value of a property from the <see cref="T:log4net.Core.LoggingEvent"/>
- </summary>
- <remarks>
- <para>
- Extract the value of a property from the <see cref="T:log4net.Core.LoggingEvent"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Layout.RawPropertyLayout.#ctor">
- <summary>
- Constructs a RawPropertyLayout
- </summary>
- </member>
- <member name="M:log4net.Layout.RawPropertyLayout.Format(log4net.Core.LoggingEvent)">
- <summary>
- Lookup the property for <see cref="P:log4net.Layout.RawPropertyLayout.Key"/>
- </summary>
- <param name="loggingEvent">The event to format</param>
- <returns>returns property value</returns>
- <remarks>
- <para>
- Looks up and returns the object value of the property
- named <see cref="P:log4net.Layout.RawPropertyLayout.Key"/>. If there is no property defined
- with than name then <c>null</c> will be returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.RawPropertyLayout.Key">
- <summary>
- The name of the value to lookup in the LoggingEvent Properties collection.
- </summary>
- <value>
- Value to lookup in the LoggingEvent Properties collection
- </value>
- <remarks>
- <para>
- String name of the property to lookup in the <see cref="T:log4net.Core.LoggingEvent"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.RawTimeStampLayout">
- <summary>
- Extract the date from the <see cref="T:log4net.Core.LoggingEvent"/>
- </summary>
- <remarks>
- <para>
- Extract the date from the <see cref="T:log4net.Core.LoggingEvent"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.RawTimeStampLayout.#ctor">
- <summary>
- Constructs a RawTimeStampLayout
- </summary>
- </member>
- <member name="M:log4net.Layout.RawTimeStampLayout.Format(log4net.Core.LoggingEvent)">
- <summary>
- Gets the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> as a <see cref="T:System.DateTime"/>.
- </summary>
- <param name="loggingEvent">The event to format</param>
- <returns>returns the time stamp</returns>
- <remarks>
- <para>
- Gets the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> as a <see cref="T:System.DateTime"/>.
- </para>
- <para>
- The time stamp is in local time. To format the time stamp
- in universal time use <see cref="T:log4net.Layout.RawUtcTimeStampLayout"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.RawUtcTimeStampLayout">
- <summary>
- Extract the date from the <see cref="T:log4net.Core.LoggingEvent"/>
- </summary>
- <remarks>
- <para>
- Extract the date from the <see cref="T:log4net.Core.LoggingEvent"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.RawUtcTimeStampLayout.#ctor">
- <summary>
- Constructs a RawUtcTimeStampLayout
- </summary>
- </member>
- <member name="M:log4net.Layout.RawUtcTimeStampLayout.Format(log4net.Core.LoggingEvent)">
- <summary>
- Gets the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> as a <see cref="T:System.DateTime"/>.
- </summary>
- <param name="loggingEvent">The event to format</param>
- <returns>returns the time stamp</returns>
- <remarks>
- <para>
- Gets the <see cref="P:log4net.Core.LoggingEvent.TimeStamp"/> as a <see cref="T:System.DateTime"/>.
- </para>
- <para>
- The time stamp is in universal time. To format the time stamp
- in local time use <see cref="T:log4net.Layout.RawTimeStampLayout"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.SimpleLayout">
- <summary>
- A very simple layout
- </summary>
- <remarks>
- <para>
- SimpleLayout consists of the level of the log statement,
- followed by " - " and then the log message itself. For example,
- <code>
- DEBUG - Hello world
- </code>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.SimpleLayout.#ctor">
- <summary>
- Constructs a SimpleLayout
- </summary>
- </member>
- <member name="M:log4net.Layout.SimpleLayout.ActivateOptions">
- <summary>
- Initialize layout options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.SimpleLayout.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.SimpleLayout.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.SimpleLayout.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.SimpleLayout.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Produces a simple formatted output.
- </summary>
- <param name="loggingEvent">the event being logged</param>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <remarks>
- <para>
- Formats the event as the level of the even,
- followed by " - " and then the log message itself. The
- output is terminated by a newline.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.XmlLayout">
- <summary>
- Layout that formats the log events as XML elements.
- </summary>
- <remarks>
- <para>
- The output of the <see cref="T:log4net.Layout.XmlLayout"/> consists of a series of
- log4net:event elements. It does not output a complete well-formed XML
- file. The output is designed to be included as an <em>external entity</em>
- in a separate file to form a correct XML file.
- </para>
- <para>
- For example, if <c>abc</c> is the name of the file where
- the <see cref="T:log4net.Layout.XmlLayout"/> output goes, then a well-formed XML file would
- be:
- </para>
- <code lang="XML">
- &lt;?xml version="1.0" ?&gt;
-
- &lt;!DOCTYPE log4net:events SYSTEM "log4net-events.dtd" [&lt;!ENTITY data SYSTEM "abc"&gt;]&gt;
-
- &lt;log4net:events version="1.2" xmlns:log4net="http://logging.apache.org/log4net/schemas/log4net-events-1.2&gt;
- &amp;data;
- &lt;/log4net:events&gt;
- </code>
- <para>
- This approach enforces the independence of the <see cref="T:log4net.Layout.XmlLayout"/>
- and the appender where it is embedded.
- </para>
- <para>
- The <c>version</c> attribute helps components to correctly
- interpret output generated by <see cref="T:log4net.Layout.XmlLayout"/>. The value of
- this attribute should be "1.2" for release 1.2 and later.
- </para>
- <para>
- Alternatively the <c>Header</c> and <c>Footer</c> properties can be
- configured to output the correct XML header, open tag and close tag.
- When setting the <c>Header</c> and <c>Footer</c> properties it is essential
- that the underlying data store not be appendable otherwise the data
- will become invalid XML.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Layout.XmlLayoutBase">
- <summary>
- Layout that formats the log events as XML elements.
- </summary>
- <remarks>
- <para>
- This is an abstract class that must be subclassed by an implementation
- to conform to a specific schema.
- </para>
- <para>
- Deriving classes must implement the <see cref="M:log4net.Layout.XmlLayoutBase.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)"/> method.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Layout.XmlLayoutBase.#ctor">
- <summary>
- Protected constructor to support subclasses
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Layout.XmlLayoutBase"/> class
- with no location info.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayoutBase.#ctor(System.Boolean)">
- <summary>
- Protected constructor to support subclasses
- </summary>
- <remarks>
- <para>
- The <paramref name="locationInfo" /> parameter determines whether
- location information will be output by the layout. If
- <paramref name="locationInfo" /> is set to <c>true</c>, then the
- file name and line number of the statement at the origin of the log
- statement will be output.
- </para>
- <para>
- If you are embedding this layout within an SMTPAppender
- then make sure to set the <b>LocationInfo</b> option of that
- appender as well.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayoutBase.ActivateOptions">
- <summary>
- Initialize layout options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.XmlLayoutBase.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.XmlLayoutBase.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.XmlLayoutBase.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayoutBase.Format(System.IO.TextWriter,log4net.Core.LoggingEvent)">
- <summary>
- Produces a formatted string.
- </summary>
- <param name="loggingEvent">The event being logged.</param>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <remarks>
- <para>
- Format the <see cref="T:log4net.Core.LoggingEvent"/> and write it to the <see cref="T:System.IO.TextWriter"/>.
- </para>
- <para>
- This method creates an <see cref="T:System.Xml.XmlTextWriter"/> that writes to the
- <paramref name="writer"/>. The <see cref="T:System.Xml.XmlTextWriter"/> is passed
- to the <see cref="M:log4net.Layout.XmlLayoutBase.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)"/> method. Subclasses should override the
- <see cref="M:log4net.Layout.XmlLayoutBase.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)"/> method rather than this method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayoutBase.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)">
- <summary>
- Does the actual writing of the XML.
- </summary>
- <param name="writer">The writer to use to output the event to.</param>
- <param name="loggingEvent">The event to write.</param>
- <remarks>
- <para>
- Subclasses should override this method to format
- the <see cref="T:log4net.Core.LoggingEvent"/> as XML.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.XmlLayoutBase.m_locationInfo">
- <summary>
- Flag to indicate if location information should be included in
- the XML events.
- </summary>
- </member>
- <member name="F:log4net.Layout.XmlLayoutBase.m_protectCloseTextWriter">
- <summary>
- Writer adapter that ignores Close
- </summary>
- </member>
- <member name="F:log4net.Layout.XmlLayoutBase.m_invalidCharReplacement">
- <summary>
- The string to replace invalid chars with
- </summary>
- </member>
- <member name="P:log4net.Layout.XmlLayoutBase.LocationInfo">
- <summary>
- Gets a value indicating whether to include location information in
- the XML events.
- </summary>
- <value>
- <c>true</c> if location information should be included in the XML
- events; otherwise, <c>false</c>.
- </value>
- <remarks>
- <para>
- If <see cref="P:log4net.Layout.XmlLayoutBase.LocationInfo"/> is set to <c>true</c>, then the file
- name and line number of the statement at the origin of the log
- statement will be output.
- </para>
- <para>
- If you are embedding this layout within an <c>SMTPAppender</c>
- then make sure to set the <b>LocationInfo</b> option of that
- appender as well.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.XmlLayoutBase.InvalidCharReplacement">
- <summary>
- The string to replace characters that can not be expressed in XML with.
- <remarks>
- <para>
- Not all characters may be expressed in XML. This property contains the
- string to replace those that can not with. This defaults to a ?. Set it
- to the empty string to simply remove offending characters. For more
- details on the allowed character ranges see http://www.w3.org/TR/REC-xml/#charsets
- Character replacement will occur in the log message, the property names
- and the property values.
- </para>
- </remarks>
- </summary>
- </member>
- <member name="P:log4net.Layout.XmlLayoutBase.ContentType">
- <summary>
- Gets the content type output by this layout.
- </summary>
- <value>
- As this is the XML layout, the value is always <c>"text/xml"</c>.
- </value>
- <remarks>
- <para>
- As this is the XML layout, the value is always <c>"text/xml"</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayout.#ctor">
- <summary>
- Constructs an XmlLayout
- </summary>
- </member>
- <member name="M:log4net.Layout.XmlLayout.#ctor(System.Boolean)">
- <summary>
- Constructs an XmlLayout.
- </summary>
- <remarks>
- <para>
- The <b>LocationInfo</b> option takes a boolean value. By
- default, it is set to false which means there will be no location
- information output by this layout. If the the option is set to
- true, then the file name and line number of the statement
- at the origin of the log statement will be output.
- </para>
- <para>
- If you are embedding this layout within an SmtpAppender
- then make sure to set the <b>LocationInfo</b> option of that
- appender as well.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayout.ActivateOptions">
- <summary>
- Initialize layout options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Layout.XmlLayout.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Layout.XmlLayout.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Layout.XmlLayout.ActivateOptions"/> must be called again.
- </para>
- <para>
- Builds a cache of the element names
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayout.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)">
- <summary>
- Does the actual writing of the XML.
- </summary>
- <param name="writer">The writer to use to output the event to.</param>
- <param name="loggingEvent">The event to write.</param>
- <remarks>
- <para>
- Override the base class <see cref="M:log4net.Layout.XmlLayoutBase.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)"/> method
- to write the <see cref="T:log4net.Core.LoggingEvent"/> to the <see cref="T:System.Xml.XmlWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Layout.XmlLayout.m_prefix">
- <summary>
- The prefix to use for all generated element names
- </summary>
- </member>
- <member name="P:log4net.Layout.XmlLayout.Prefix">
- <summary>
- The prefix to use for all element names
- </summary>
- <remarks>
- <para>
- The default prefix is <b>log4net</b>. Set this property
- to change the prefix. If the prefix is set to an empty string
- then no prefix will be written.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.XmlLayout.Base64EncodeMessage">
- <summary>
- Set whether or not to base64 encode the message.
- </summary>
- <remarks>
- <para>
- By default the log message will be written as text to the xml
- output. This can cause problems when the message contains binary
- data. By setting this to true the contents of the message will be
- base64 encoded. If this is set then invalid character replacement
- (see <see cref="P:log4net.Layout.XmlLayoutBase.InvalidCharReplacement"/>) will not be performed
- on the log message.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.XmlLayout.Base64EncodeProperties">
- <summary>
- Set whether or not to base64 encode the property values.
- </summary>
- <remarks>
- <para>
- By default the properties will be written as text to the xml
- output. This can cause problems when one or more properties contain
- binary data. By setting this to true the values of the properties
- will be base64 encoded. If this is set then invalid character replacement
- (see <see cref="P:log4net.Layout.XmlLayoutBase.InvalidCharReplacement"/>) will not be performed
- on the property values.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Layout.XmlLayoutSchemaLog4j">
- <summary>
- Layout that formats the log events as XML elements compatible with the log4j schema
- </summary>
- <remarks>
- <para>
- Formats the log events according to the http://logging.apache.org/log4j schema.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Layout.XmlLayoutSchemaLog4j.s_date1970">
- <summary>
- The 1st of January 1970 in UTC
- </summary>
- </member>
- <member name="M:log4net.Layout.XmlLayoutSchemaLog4j.#ctor">
- <summary>
- Constructs an XMLLayoutSchemaLog4j
- </summary>
- </member>
- <member name="M:log4net.Layout.XmlLayoutSchemaLog4j.#ctor(System.Boolean)">
- <summary>
- Constructs an XMLLayoutSchemaLog4j.
- </summary>
- <remarks>
- <para>
- The <b>LocationInfo</b> option takes a boolean value. By
- default, it is set to false which means there will be no location
- information output by this layout. If the the option is set to
- true, then the file name and line number of the statement
- at the origin of the log statement will be output.
- </para>
- <para>
- If you are embedding this layout within an SMTPAppender
- then make sure to set the <b>LocationInfo</b> option of that
- appender as well.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Layout.XmlLayoutSchemaLog4j.FormatXml(System.Xml.XmlWriter,log4net.Core.LoggingEvent)">
- <summary>
- Actually do the writing of the xml
- </summary>
- <param name="writer">the writer to use</param>
- <param name="loggingEvent">the event to write</param>
- <remarks>
- <para>
- Generate XML that is compatible with the log4j schema.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Layout.XmlLayoutSchemaLog4j.Version">
- <summary>
- The version of the log4j schema to use.
- </summary>
- <remarks>
- <para>
- Only version 1.2 of the log4j schema is supported.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.ObjectRenderer.DefaultRenderer">
- <summary>
- The default object Renderer.
- </summary>
- <remarks>
- <para>
- The default renderer supports rendering objects and collections to strings.
- </para>
- <para>
- See the <see cref="M:log4net.ObjectRenderer.DefaultRenderer.RenderObject(log4net.ObjectRenderer.RendererMap,System.Object,System.IO.TextWriter)"/> method for details of the output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.ObjectRenderer.IObjectRenderer">
- <summary>
- Implement this interface in order to render objects as strings
- </summary>
- <remarks>
- <para>
- Certain types require special case conversion to
- string form. This conversion is done by an object renderer.
- Object renderers implement the <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>
- interface.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.ObjectRenderer.IObjectRenderer.RenderObject(log4net.ObjectRenderer.RendererMap,System.Object,System.IO.TextWriter)">
- <summary>
- Render the object <paramref name="obj"/> to a string
- </summary>
- <param name="rendererMap">The map used to lookup renderers</param>
- <param name="obj">The object to render</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- Render the object <paramref name="obj"/> to a
- string.
- </para>
- <para>
- The <paramref name="rendererMap"/> parameter is
- provided to lookup and render other objects. This is
- very useful where <paramref name="obj"/> contains
- nested objects of unknown type. The <see cref="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object,System.IO.TextWriter)"/>
- method can be used to render these objects.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.DefaultRenderer.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.DefaultRenderer.RenderObject(log4net.ObjectRenderer.RendererMap,System.Object,System.IO.TextWriter)">
- <summary>
- Render the object <paramref name="obj"/> to a string
- </summary>
- <param name="rendererMap">The map used to lookup renderers</param>
- <param name="obj">The object to render</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- Render the object <paramref name="obj"/> to a string.
- </para>
- <para>
- The <paramref name="rendererMap"/> parameter is
- provided to lookup and render other objects. This is
- very useful where <paramref name="obj"/> contains
- nested objects of unknown type. The <see cref="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object)"/>
- method can be used to render these objects.
- </para>
- <para>
- The default renderer supports rendering objects to strings as follows:
- </para>
- <list type="table">
- <listheader>
- <term>Value</term>
- <description>Rendered String</description>
- </listheader>
- <item>
- <term><c>null</c></term>
- <description>
- <para>"(null)"</para>
- </description>
- </item>
- <item>
- <term><see cref="T:System.Array"/></term>
- <description>
- <para>
- For a one dimensional array this is the
- array type name, an open brace, followed by a comma
- separated list of the elements (using the appropriate
- renderer), followed by a close brace.
- </para>
- <para>
- For example: <c>int[] {1, 2, 3}</c>.
- </para>
- <para>
- If the array is not one dimensional the
- <c>Array.ToString()</c> is returned.
- </para>
- </description>
- </item>
- <item>
- <term><see cref="T:System.Collections.IEnumerable"/>, <see cref="T:System.Collections.ICollection"/> &amp; <see cref="T:System.Collections.IEnumerator"/></term>
- <description>
- <para>
- Rendered as an open brace, followed by a comma
- separated list of the elements (using the appropriate
- renderer), followed by a close brace.
- </para>
- <para>
- For example: <c>{a, b, c}</c>.
- </para>
- <para>
- All collection classes that implement <see cref="T:System.Collections.ICollection"/> its subclasses,
- or generic equivalents all implement the <see cref="T:System.Collections.IEnumerable"/> interface.
- </para>
- </description>
- </item>
- <item>
- <term><see cref="T:System.Collections.DictionaryEntry"/></term>
- <description>
- <para>
- Rendered as the key, an equals sign ('='), and the value (using the appropriate
- renderer).
- </para>
- <para>
- For example: <c>key=value</c>.
- </para>
- </description>
- </item>
- <item>
- <term>other</term>
- <description>
- <para><c>Object.ToString()</c></para>
- </description>
- </item>
- </list>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.DefaultRenderer.RenderArray(log4net.ObjectRenderer.RendererMap,System.Array,System.IO.TextWriter)">
- <summary>
- Render the array argument into a string
- </summary>
- <param name="rendererMap">The map used to lookup renderers</param>
- <param name="array">the array to render</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- For a one dimensional array this is the
- array type name, an open brace, followed by a comma
- separated list of the elements (using the appropriate
- renderer), followed by a close brace. For example:
- <c>int[] {1, 2, 3}</c>.
- </para>
- <para>
- If the array is not one dimensional the
- <c>Array.ToString()</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.DefaultRenderer.RenderEnumerator(log4net.ObjectRenderer.RendererMap,System.Collections.IEnumerator,System.IO.TextWriter)">
- <summary>
- Render the enumerator argument into a string
- </summary>
- <param name="rendererMap">The map used to lookup renderers</param>
- <param name="enumerator">the enumerator to render</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- Rendered as an open brace, followed by a comma
- separated list of the elements (using the appropriate
- renderer), followed by a close brace. For example:
- <c>{a, b, c}</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.DefaultRenderer.RenderDictionaryEntry(log4net.ObjectRenderer.RendererMap,System.Collections.DictionaryEntry,System.IO.TextWriter)">
- <summary>
- Render the DictionaryEntry argument into a string
- </summary>
- <param name="rendererMap">The map used to lookup renderers</param>
- <param name="entry">the DictionaryEntry to render</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- Render the key, an equals sign ('='), and the value (using the appropriate
- renderer). For example: <c>key=value</c>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.ObjectRenderer.RendererMap">
- <summary>
- Map class objects to an <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/>.
- </summary>
- <remarks>
- <para>
- Maintains a mapping between types that require special
- rendering and the <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/> that
- is used to render them.
- </para>
- <para>
- The <see cref="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object)"/> method is used to render an
- <c>object</c> using the appropriate renderers defined in this map.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.#ctor">
- <summary>
- Default Constructor
- </summary>
- <remarks>
- <para>
- Default constructor.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object)">
- <summary>
- Render <paramref name="obj"/> using the appropriate renderer.
- </summary>
- <param name="obj">the object to render to a string</param>
- <returns>the object rendered as a string</returns>
- <remarks>
- <para>
- This is a convenience method used to render an object to a string.
- The alternative method <see cref="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object,System.IO.TextWriter)"/>
- should be used when streaming output to a <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.FindAndRender(System.Object,System.IO.TextWriter)">
- <summary>
- Render <paramref name="obj"/> using the appropriate renderer.
- </summary>
- <param name="obj">the object to render to a string</param>
- <param name="writer">The writer to render to</param>
- <remarks>
- <para>
- Find the appropriate renderer for the type of the
- <paramref name="obj"/> parameter. This is accomplished by calling the
- <see cref="M:log4net.ObjectRenderer.RendererMap.Get(System.Type)"/> method. Once a renderer is found, it is
- applied on the object <paramref name="obj"/> and the result is returned
- as a <see cref="T:System.String"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.Get(System.Object)">
- <summary>
- Gets the renderer for the specified object type
- </summary>
- <param name="obj">the object to lookup the renderer for</param>
- <returns>the renderer for <paramref name="obj"/></returns>
- <remarks>
- <param>
- Gets the renderer for the specified object type.
- </param>
- <param>
- Syntactic sugar method that calls <see cref="M:log4net.ObjectRenderer.RendererMap.Get(System.Type)"/>
- with the type of the object parameter.
- </param>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.Get(System.Type)">
- <summary>
- Gets the renderer for the specified type
- </summary>
- <param name="type">the type to lookup the renderer for</param>
- <returns>the renderer for the specified type</returns>
- <remarks>
- <para>
- Returns the renderer for the specified type.
- If no specific renderer has been defined the
- <see cref="P:log4net.ObjectRenderer.RendererMap.DefaultRenderer"/> will be returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.SearchTypeAndInterfaces(System.Type)">
- <summary>
- Internal function to recursively search interfaces
- </summary>
- <param name="type">the type to lookup the renderer for</param>
- <returns>the renderer for the specified type</returns>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.Clear">
- <summary>
- Clear the map of renderers
- </summary>
- <remarks>
- <para>
- Clear the custom renderers defined by using
- <see cref="M:log4net.ObjectRenderer.RendererMap.Put(System.Type,log4net.ObjectRenderer.IObjectRenderer)"/>. The <see cref="P:log4net.ObjectRenderer.RendererMap.DefaultRenderer"/>
- cannot be removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.ObjectRenderer.RendererMap.Put(System.Type,log4net.ObjectRenderer.IObjectRenderer)">
- <summary>
- Register an <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/> for <paramref name="typeToRender"/>.
- </summary>
- <param name="typeToRender">the type that will be rendered by <paramref name="renderer"/></param>
- <param name="renderer">the renderer for <paramref name="typeToRender"/></param>
- <remarks>
- <para>
- Register an object renderer for a specific source type.
- This renderer will be returned from a call to <see cref="M:log4net.ObjectRenderer.RendererMap.Get(System.Type)"/>
- specifying the same <paramref name="typeToRender"/> as an argument.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.ObjectRenderer.RendererMap.DefaultRenderer">
- <summary>
- Get the default renderer instance
- </summary>
- <value>the default renderer</value>
- <remarks>
- <para>
- Get the default renderer
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Plugin.IPlugin">
- <summary>
- Interface implemented by logger repository plugins.
- </summary>
- <remarks>
- <para>
- Plugins define additional behavior that can be associated
- with a <see cref="T:log4net.Repository.ILoggerRepository"/>.
- The <see cref="T:log4net.Plugin.PluginMap"/> held by the <see cref="P:log4net.Repository.ILoggerRepository.PluginMap"/>
- property is used to store the plugins for a repository.
- </para>
- <para>
- The <c>log4net.Config.PluginAttribute</c> can be used to
- attach plugins to repositories created using configuration
- attributes.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Plugin.IPlugin.Attach(log4net.Repository.ILoggerRepository)">
- <summary>
- Attaches the plugin to the specified <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </summary>
- <param name="repository">The <see cref="T:log4net.Repository.ILoggerRepository"/> that this plugin should be attached to.</param>
- <remarks>
- <para>
- A plugin may only be attached to a single repository.
- </para>
- <para>
- This method is called when the plugin is attached to the repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.IPlugin.Shutdown">
- <summary>
- Is called when the plugin is to shutdown.
- </summary>
- <remarks>
- <para>
- This method is called to notify the plugin that
- it should stop operating and should detach from
- the repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Plugin.IPlugin.Name">
- <summary>
- Gets the name of the plugin.
- </summary>
- <value>
- The name of the plugin.
- </value>
- <remarks>
- <para>
- Plugins are stored in the <see cref="T:log4net.Plugin.PluginMap"/>
- keyed by name. Each plugin instance attached to a
- repository must be a unique name.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Plugin.PluginCollection">
- <summary>
- A strongly-typed collection of <see cref="T:log4net.Plugin.IPlugin"/> objects.
- </summary>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.ReadOnly(log4net.Plugin.PluginCollection)">
- <summary>
- Creates a read-only wrapper for a <c>PluginCollection</c> instance.
- </summary>
- <param name="list">list to create a readonly wrapper arround</param>
- <returns>
- A <c>PluginCollection</c> wrapper that is read-only.
- </returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor">
- <summary>
- Initializes a new instance of the <c>PluginCollection</c> class
- that is empty and has the default initial capacity.
- </summary>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor(System.Int32)">
- <summary>
- Initializes a new instance of the <c>PluginCollection</c> class
- that has the specified initial capacity.
- </summary>
- <param name="capacity">
- The number of elements that the new <c>PluginCollection</c> is initially capable of storing.
- </param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor(log4net.Plugin.PluginCollection)">
- <summary>
- Initializes a new instance of the <c>PluginCollection</c> class
- that contains elements copied from the specified <c>PluginCollection</c>.
- </summary>
- <param name="c">The <c>PluginCollection</c> whose elements are copied to the new collection.</param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor(log4net.Plugin.IPlugin[])">
- <summary>
- Initializes a new instance of the <c>PluginCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Plugin.IPlugin"/> array.
- </summary>
- <param name="a">The <see cref="T:log4net.Plugin.IPlugin"/> array whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor(System.Collections.ICollection)">
- <summary>
- Initializes a new instance of the <c>PluginCollection</c> class
- that contains elements copied from the specified <see cref="T:log4net.Plugin.IPlugin"/> collection.
- </summary>
- <param name="col">The <see cref="T:log4net.Plugin.IPlugin"/> collection whose elements are copied to the new list.</param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.#ctor(log4net.Plugin.PluginCollection.Tag)">
- <summary>
- Allow subclasses to avoid our default constructors
- </summary>
- <param name="tag"></param>
- <exclude/>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.CopyTo(log4net.Plugin.IPlugin[])">
- <summary>
- Copies the entire <c>PluginCollection</c> to a one-dimensional
- <see cref="T:log4net.Plugin.IPlugin"/> array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Plugin.IPlugin"/> array to copy to.</param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.CopyTo(log4net.Plugin.IPlugin[],System.Int32)">
- <summary>
- Copies the entire <c>PluginCollection</c> to a one-dimensional
- <see cref="T:log4net.Plugin.IPlugin"/> array, starting at the specified index of the target array.
- </summary>
- <param name="array">The one-dimensional <see cref="T:log4net.Plugin.IPlugin"/> array to copy to.</param>
- <param name="start">The zero-based index in <paramref name="array"/> at which copying begins.</param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Add(log4net.Plugin.IPlugin)">
- <summary>
- Adds a <see cref="T:log4net.Plugin.IPlugin"/> to the end of the <c>PluginCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Plugin.IPlugin"/> to be added to the end of the <c>PluginCollection</c>.</param>
- <returns>The index at which the value has been added.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Clear">
- <summary>
- Removes all elements from the <c>PluginCollection</c>.
- </summary>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Clone">
- <summary>
- Creates a shallow copy of the <see cref="T:log4net.Plugin.PluginCollection"/>.
- </summary>
- <returns>A new <see cref="T:log4net.Plugin.PluginCollection"/> with a shallow copy of the collection data.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Contains(log4net.Plugin.IPlugin)">
- <summary>
- Determines whether a given <see cref="T:log4net.Plugin.IPlugin"/> is in the <c>PluginCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Plugin.IPlugin"/> to check for.</param>
- <returns><c>true</c> if <paramref name="item"/> is found in the <c>PluginCollection</c>; otherwise, <c>false</c>.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.IndexOf(log4net.Plugin.IPlugin)">
- <summary>
- Returns the zero-based index of the first occurrence of a <see cref="T:log4net.Plugin.IPlugin"/>
- in the <c>PluginCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Plugin.IPlugin"/> to locate in the <c>PluginCollection</c>.</param>
- <returns>
- The zero-based index of the first occurrence of <paramref name="item"/>
- in the entire <c>PluginCollection</c>, if found; otherwise, -1.
- </returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Insert(System.Int32,log4net.Plugin.IPlugin)">
- <summary>
- Inserts an element into the <c>PluginCollection</c> at the specified index.
- </summary>
- <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
- <param name="item">The <see cref="T:log4net.Plugin.IPlugin"/> to insert.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Plugin.PluginCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Remove(log4net.Plugin.IPlugin)">
- <summary>
- Removes the first occurrence of a specific <see cref="T:log4net.Plugin.IPlugin"/> from the <c>PluginCollection</c>.
- </summary>
- <param name="item">The <see cref="T:log4net.Plugin.IPlugin"/> to remove from the <c>PluginCollection</c>.</param>
- <exception cref="T:System.ArgumentException">
- The specified <see cref="T:log4net.Plugin.IPlugin"/> was not found in the <c>PluginCollection</c>.
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.RemoveAt(System.Int32)">
- <summary>
- Removes the element at the specified index of the <c>PluginCollection</c>.
- </summary>
- <param name="index">The zero-based index of the element to remove.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero.</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Plugin.PluginCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through the <c>PluginCollection</c>.
- </summary>
- <returns>An <see cref="T:log4net.Plugin.PluginCollection.Enumerator"/> for the entire <c>PluginCollection</c>.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.AddRange(log4net.Plugin.PluginCollection)">
- <summary>
- Adds the elements of another <c>PluginCollection</c> to the current <c>PluginCollection</c>.
- </summary>
- <param name="x">The <c>PluginCollection</c> whose elements should be added to the end of the current <c>PluginCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Plugin.PluginCollection.Count"/> of the <c>PluginCollection</c>.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.AddRange(log4net.Plugin.IPlugin[])">
- <summary>
- Adds the elements of a <see cref="T:log4net.Plugin.IPlugin"/> array to the current <c>PluginCollection</c>.
- </summary>
- <param name="x">The <see cref="T:log4net.Plugin.IPlugin"/> array whose elements should be added to the end of the <c>PluginCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Plugin.PluginCollection.Count"/> of the <c>PluginCollection</c>.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.AddRange(System.Collections.ICollection)">
- <summary>
- Adds the elements of a <see cref="T:log4net.Plugin.IPlugin"/> collection to the current <c>PluginCollection</c>.
- </summary>
- <param name="col">The <see cref="T:log4net.Plugin.IPlugin"/> collection whose elements should be added to the end of the <c>PluginCollection</c>.</param>
- <returns>The new <see cref="P:log4net.Plugin.PluginCollection.Count"/> of the <c>PluginCollection</c>.</returns>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.TrimToSize">
- <summary>
- Sets the capacity to the actual number of elements.
- </summary>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.ValidateIndex(System.Int32)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero.</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Plugin.PluginCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.ValidateIndex(System.Int32,System.Boolean)">
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero.</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Plugin.PluginCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.Count">
- <summary>
- Gets the number of elements actually contained in the <c>PluginCollection</c>.
- </summary>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.IsSynchronized">
- <summary>
- Gets a value indicating whether access to the collection is synchronized (thread-safe).
- </summary>
- <returns>true if access to the ICollection is synchronized (thread-safe); otherwise, false.</returns>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.SyncRoot">
- <summary>
- Gets an object that can be used to synchronize access to the collection.
- </summary>
- <value>
- An object that can be used to synchronize access to the collection.
- </value>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.Item(System.Int32)">
- <summary>
- Gets or sets the <see cref="T:log4net.Plugin.IPlugin"/> at the specified index.
- </summary>
- <value>
- The <see cref="T:log4net.Plugin.IPlugin"/> at the specified index.
- </value>
- <param name="index">The zero-based index of the element to get or set.</param>
- <exception cref="T:System.ArgumentOutOfRangeException">
- <para><paramref name="index"/> is less than zero.</para>
- <para>-or-</para>
- <para><paramref name="index"/> is equal to or greater than <see cref="P:log4net.Plugin.PluginCollection.Count"/>.</para>
- </exception>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.IsFixedSize">
- <summary>
- Gets a value indicating whether the collection has a fixed size.
- </summary>
- <value><c>true</c> if the collection has a fixed size; otherwise, <c>false</c>. The default is <c>false</c>.</value>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.IsReadOnly">
- <summary>
- Gets a value indicating whether the IList is read-only.
- </summary>
- <value><c>true</c> if the collection is read-only; otherwise, <c>false</c>. The default is <c>false</c>.</value>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.Capacity">
- <summary>
- Gets or sets the number of elements the <c>PluginCollection</c> can contain.
- </summary>
- <value>
- The number of elements the <c>PluginCollection</c> can contain.
- </value>
- </member>
- <member name="T:log4net.Plugin.PluginCollection.IPluginCollectionEnumerator">
- <summary>
- Supports type-safe iteration over a <see cref="T:log4net.Plugin.PluginCollection"/>.
- </summary>
- <exclude/>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.IPluginCollectionEnumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.IPluginCollectionEnumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.IPluginCollectionEnumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- </member>
- <member name="T:log4net.Plugin.PluginCollection.Tag">
- <summary>
- Type visible only to our subclasses
- Used to access protected constructor
- </summary>
- <exclude/>
- </member>
- <member name="F:log4net.Plugin.PluginCollection.Tag.Default">
- <summary>
- A value
- </summary>
- </member>
- <member name="T:log4net.Plugin.PluginCollection.Enumerator">
- <summary>
- Supports simple iteration over a <see cref="T:log4net.Plugin.PluginCollection"/>.
- </summary>
- <exclude/>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Enumerator.#ctor(log4net.Plugin.PluginCollection)">
- <summary>
- Initializes a new instance of the <c>Enumerator</c> class.
- </summary>
- <param name="tc"></param>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Enumerator.MoveNext">
- <summary>
- Advances the enumerator to the next element in the collection.
- </summary>
- <returns>
- <c>true</c> if the enumerator was successfully advanced to the next element;
- <c>false</c> if the enumerator has passed the end of the collection.
- </returns>
- <exception cref="T:System.InvalidOperationException">
- The collection was modified after the enumerator was created.
- </exception>
- </member>
- <member name="M:log4net.Plugin.PluginCollection.Enumerator.Reset">
- <summary>
- Sets the enumerator to its initial position, before the first element in the collection.
- </summary>
- </member>
- <member name="P:log4net.Plugin.PluginCollection.Enumerator.Current">
- <summary>
- Gets the current element in the collection.
- </summary>
- <value>
- The current element in the collection.
- </value>
- </member>
- <member name="T:log4net.Plugin.PluginCollection.ReadOnlyPluginCollection">
- <exclude/>
- </member>
- <member name="T:log4net.Plugin.PluginMap">
- <summary>
- Map of repository plugins.
- </summary>
- <remarks>
- <para>
- This class is a name keyed map of the plugins that are
- attached to a repository.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Plugin.PluginMap.#ctor(log4net.Repository.ILoggerRepository)">
- <summary>
- Constructor
- </summary>
- <param name="repository">The repository that the plugins should be attached to.</param>
- <remarks>
- <para>
- Initialize a new instance of the <see cref="T:log4net.Plugin.PluginMap"/> class with a
- repository that the plugins should be attached to.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.PluginMap.Add(log4net.Plugin.IPlugin)">
- <summary>
- Adds a <see cref="T:log4net.Plugin.IPlugin"/> to the map.
- </summary>
- <param name="plugin">The <see cref="T:log4net.Plugin.IPlugin"/> to add to the map.</param>
- <remarks>
- <para>
- The <see cref="T:log4net.Plugin.IPlugin"/> will be attached to the repository when added.
- </para>
- <para>
- If there already exists a plugin with the same name
- attached to the repository then the old plugin will
- be <see cref="M:log4net.Plugin.IPlugin.Shutdown"/> and replaced with
- the new plugin.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.PluginMap.Remove(log4net.Plugin.IPlugin)">
- <summary>
- Removes a <see cref="T:log4net.Plugin.IPlugin"/> from the map.
- </summary>
- <param name="plugin">The <see cref="T:log4net.Plugin.IPlugin"/> to remove from the map.</param>
- <remarks>
- <para>
- Remove a specific plugin from this map.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Plugin.PluginMap.Item(System.String)">
- <summary>
- Gets a <see cref="T:log4net.Plugin.IPlugin"/> by name.
- </summary>
- <param name="name">The name of the <see cref="T:log4net.Plugin.IPlugin"/> to lookup.</param>
- <returns>
- The <see cref="T:log4net.Plugin.IPlugin"/> from the map with the name specified, or
- <c>null</c> if no plugin is found.
- </returns>
- <remarks>
- <para>
- Lookup a plugin by name. If the plugin is not found <c>null</c>
- will be returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Plugin.PluginMap.AllPlugins">
- <summary>
- Gets all possible plugins as a list of <see cref="T:log4net.Plugin.IPlugin"/> objects.
- </summary>
- <value>All possible plugins as a list of <see cref="T:log4net.Plugin.IPlugin"/> objects.</value>
- <remarks>
- <para>
- Get a collection of all the plugins defined in this map.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Plugin.PluginSkeleton">
- <summary>
- Base implementation of <see cref="T:log4net.Plugin.IPlugin"/>
- </summary>
- <remarks>
- <para>
- Default abstract implementation of the <see cref="T:log4net.Plugin.IPlugin"/>
- interface. This base class can be used by implementors
- of the <see cref="T:log4net.Plugin.IPlugin"/> interface.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Plugin.PluginSkeleton.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="name">the name of the plugin</param>
- <remarks>
- Initializes a new Plugin with the specified name.
- </remarks>
- </member>
- <member name="M:log4net.Plugin.PluginSkeleton.Attach(log4net.Repository.ILoggerRepository)">
- <summary>
- Attaches this plugin to a <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </summary>
- <param name="repository">The <see cref="T:log4net.Repository.ILoggerRepository"/> that this plugin should be attached to.</param>
- <remarks>
- <para>
- A plugin may only be attached to a single repository.
- </para>
- <para>
- This method is called when the plugin is attached to the repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.PluginSkeleton.Shutdown">
- <summary>
- Is called when the plugin is to shutdown.
- </summary>
- <remarks>
- <para>
- This method is called to notify the plugin that
- it should stop operating and should detach from
- the repository.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Plugin.PluginSkeleton.m_name">
- <summary>
- The name of this plugin.
- </summary>
- </member>
- <member name="F:log4net.Plugin.PluginSkeleton.m_repository">
- <summary>
- The repository this plugin is attached to.
- </summary>
- </member>
- <member name="P:log4net.Plugin.PluginSkeleton.Name">
- <summary>
- Gets or sets the name of the plugin.
- </summary>
- <value>
- The name of the plugin.
- </value>
- <remarks>
- <para>
- Plugins are stored in the <see cref="T:log4net.Plugin.PluginMap"/>
- keyed by name. Each plugin instance attached to a
- repository must be a unique name.
- </para>
- <para>
- The name of the plugin must not change one the
- plugin has been attached to a repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Plugin.PluginSkeleton.LoggerRepository">
- <summary>
- The repository for this plugin
- </summary>
- <value>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that this plugin is attached to.
- </value>
- <remarks>
- <para>
- Gets or sets the <see cref="T:log4net.Repository.ILoggerRepository"/> that this plugin is
- attached to.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Plugin.RemoteLoggingServerPlugin">
- <summary>
- Plugin that listens for events from the <see cref="T:log4net.Appender.RemotingAppender"/>
- </summary>
- <remarks>
- <para>
- This plugin publishes an instance of <see cref="T:log4net.Appender.RemotingAppender.IRemoteLoggingSink"/>
- on a specified <see cref="P:log4net.Plugin.RemoteLoggingServerPlugin.SinkUri"/>. This listens for logging events delivered from
- a remote <see cref="T:log4net.Appender.RemotingAppender"/>.
- </para>
- <para>
- When an event is received it is relogged within the attached repository
- as if it had been raised locally.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Plugin.RemoteLoggingServerPlugin"/> class.
- </para>
- <para>
- The <see cref="P:log4net.Plugin.RemoteLoggingServerPlugin.SinkUri"/> property must be set.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.#ctor(System.String)">
- <summary>
- Construct with sink Uri.
- </summary>
- <param name="sinkUri">The name to publish the sink under in the remoting infrastructure.
- See <see cref="P:log4net.Plugin.RemoteLoggingServerPlugin.SinkUri"/> for more details.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Plugin.RemoteLoggingServerPlugin"/> class
- with specified name.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.Attach(log4net.Repository.ILoggerRepository)">
- <summary>
- Attaches this plugin to a <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </summary>
- <param name="repository">The <see cref="T:log4net.Repository.ILoggerRepository"/> that this plugin should be attached to.</param>
- <remarks>
- <para>
- A plugin may only be attached to a single repository.
- </para>
- <para>
- This method is called when the plugin is attached to the repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.Shutdown">
- <summary>
- Is called when the plugin is to shutdown.
- </summary>
- <remarks>
- <para>
- When the plugin is shutdown the remote logging
- sink is disconnected.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Plugin.RemoteLoggingServerPlugin.SinkUri">
- <summary>
- Gets or sets the URI of this sink.
- </summary>
- <value>
- The URI of this sink.
- </value>
- <remarks>
- <para>
- This is the name under which the object is marshaled.
- <see cref="M:System.Runtime.Remoting.RemotingServices.Marshal(System.MarshalByRefObject,System.String,System.Type)"/>
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl">
- <summary>
- Delivers <see cref="T:log4net.Core.LoggingEvent"/> objects to a remote sink.
- </summary>
- <remarks>
- <para>
- Internal class used to listen for logging events
- and deliver them to the local repository.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl.#ctor(log4net.Repository.ILoggerRepository)">
- <summary>
- Constructor
- </summary>
- <param name="repository">The repository to log to.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl"/> for the
- specified <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl.LogEvents(log4net.Core.LoggingEvent[])">
- <summary>
- Logs the events to the repository.
- </summary>
- <param name="events">The events to log.</param>
- <remarks>
- <para>
- The events passed are logged to the <see cref="T:log4net.Repository.ILoggerRepository"/>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl.InitializeLifetimeService">
- <summary>
- Obtains a lifetime service object to control the lifetime
- policy for this instance.
- </summary>
- <returns><c>null</c> to indicate that this instance should live forever.</returns>
- <remarks>
- <para>
- Obtains a lifetime service object to control the lifetime
- policy for this instance. This object should live forever
- therefore this implementation returns <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Plugin.RemoteLoggingServerPlugin.RemoteLoggingSinkImpl.m_repository">
- <summary>
- The underlying <see cref="T:log4net.Repository.ILoggerRepository"/> that events should
- be logged to.
- </summary>
- </member>
- <member name="T:log4net.Repository.Hierarchy.DefaultLoggerFactory">
- <summary>
- Default implementation of <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>
- </summary>
- <remarks>
- <para>
- This default implementation of the <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>
- interface is used to create the default subclass
- of the <see cref="T:log4net.Repository.Hierarchy.Logger"/> object.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Repository.Hierarchy.ILoggerFactory">
- <summary>
- Interface abstracts creation of <see cref="T:log4net.Repository.Hierarchy.Logger"/> instances
- </summary>
- <remarks>
- <para>
- This interface is used by the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> to
- create new <see cref="T:log4net.Repository.Hierarchy.Logger"/> objects.
- </para>
- <para>
- The <see cref="M:log4net.Repository.Hierarchy.ILoggerFactory.CreateLogger(System.String)"/> method is called
- to create a named <see cref="T:log4net.Repository.Hierarchy.Logger"/>.
- </para>
- <para>
- Implement this interface to create new subclasses of <see cref="T:log4net.Repository.Hierarchy.Logger"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.ILoggerFactory.CreateLogger(System.String)">
- <summary>
- Create a new <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance
- </summary>
- <param name="name">The name of the <see cref="T:log4net.Repository.Hierarchy.Logger"/>.</param>
- <returns>The <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance for the specified name.</returns>
- <remarks>
- <para>
- Create a new <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance with the
- specified name.
- </para>
- <para>
- Called by the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> to create
- new named <see cref="T:log4net.Repository.Hierarchy.Logger"/> instances.
- </para>
- <para>
- If the <paramref name="name"/> is <c>null</c> then the root logger
- must be returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.DefaultLoggerFactory.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.DefaultLoggerFactory"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.DefaultLoggerFactory.CreateLogger(System.String)">
- <summary>
- Create a new <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance
- </summary>
- <param name="name">The name of the <see cref="T:log4net.Repository.Hierarchy.Logger"/>.</param>
- <returns>The <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance for the specified name.</returns>
- <remarks>
- <para>
- Create a new <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance with the
- specified name.
- </para>
- <para>
- Called by the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> to create
- new named <see cref="T:log4net.Repository.Hierarchy.Logger"/> instances.
- </para>
- <para>
- If the <paramref name="name"/> is <c>null</c> then the root logger
- must be returned.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.DefaultLoggerFactory.LoggerImpl">
- <summary>
- Default internal subclass of <see cref="T:log4net.Repository.Hierarchy.Logger"/>
- </summary>
- <remarks>
- <para>
- This subclass has no additional behavior over the
- <see cref="T:log4net.Repository.Hierarchy.Logger"/> class but does allow instances
- to be created.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.Logger">
- <summary>
- Implementation of <see cref="T:log4net.Core.ILogger"/> used by <see cref="P:log4net.Repository.Hierarchy.Logger.Hierarchy"/>
- </summary>
- <remarks>
- <para>
- Internal class used to provide implementation of <see cref="T:log4net.Core.ILogger"/>
- interface. Applications should use <see cref="T:log4net.LogManager"/> to get
- logger instances.
- </para>
- <para>
- This is one of the central classes in the log4net implementation. One of the
- distinctive features of log4net are hierarchical loggers and their
- evaluation. The <see cref="P:log4net.Repository.Hierarchy.Logger.Hierarchy"/> organizes the <see cref="T:log4net.Repository.Hierarchy.Logger"/>
- instances into a rooted tree hierarchy.
- </para>
- <para>
- The <see cref="T:log4net.Repository.Hierarchy.Logger"/> class is abstract. Only concrete subclasses of
- <see cref="T:log4net.Repository.Hierarchy.Logger"/> can be created. The <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>
- is used to create instances of this type for the <see cref="P:log4net.Repository.Hierarchy.Logger.Hierarchy"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Aspi Havewala</author>
- <author>Douglas de la Torre</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.#ctor(System.String)">
- <summary>
- This constructor created a new <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance and
- sets its name.
- </summary>
- <param name="name">The name of the <see cref="T:log4net.Repository.Hierarchy.Logger"/>.</param>
- <remarks>
- <para>
- This constructor is protected and designed to be used by
- a subclass that is not abstract.
- </para>
- <para>
- Loggers are constructed by <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>
- objects. See <see cref="T:log4net.Repository.Hierarchy.DefaultLoggerFactory"/> for the default
- logger creator.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.AddAppender(log4net.Appender.IAppender)">
- <summary>
- Add <paramref name="newAppender"/> to the list of appenders of this
- Logger instance.
- </summary>
- <param name="newAppender">An appender to add to this logger</param>
- <remarks>
- <para>
- Add <paramref name="newAppender"/> to the list of appenders of this
- Logger instance.
- </para>
- <para>
- If <paramref name="newAppender"/> is already in the list of
- appenders, then it won't be added again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.GetAppender(System.String)">
- <summary>
- Look for the appender named as <c>name</c>
- </summary>
- <param name="name">The name of the appender to lookup</param>
- <returns>The appender with the name specified, or <c>null</c>.</returns>
- <remarks>
- <para>
- Returns the named appender, or null if the appender is not found.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.RemoveAllAppenders">
- <summary>
- Remove all previously added appenders from this Logger instance.
- </summary>
- <remarks>
- <para>
- Remove all previously added appenders from this Logger instance.
- </para>
- <para>
- This is useful when re-reading configuration information.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.RemoveAppender(log4net.Appender.IAppender)">
- <summary>
- Remove the appender passed as parameter form the list of appenders.
- </summary>
- <param name="appender">The appender to remove</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- Remove the appender passed as parameter form the list of appenders.
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.RemoveAppender(System.String)">
- <summary>
- Remove the appender passed as parameter form the list of appenders.
- </summary>
- <param name="name">The name of the appender to remove</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- Remove the named appender passed as parameter form the list of appenders.
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.Log(System.Type,log4net.Core.Level,System.Object,System.Exception)">
- <summary>
- This generic form is intended to be used by wrappers.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="level">The level of the message to be logged.</param>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Generate a logging event for the specified <paramref name="level"/> using
- the <paramref name="message"/> and <paramref name="exception"/>.
- </para>
- <para>
- This method must not throw any exception to the caller.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.Log(log4net.Core.LoggingEvent)">
- <summary>
- This is the most generic printing method that is intended to be used
- by wrappers.
- </summary>
- <param name="logEvent">The event being logged.</param>
- <remarks>
- <para>
- Logs the specified logging event through this logger.
- </para>
- <para>
- This method must not throw any exception to the caller.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.IsEnabledFor(log4net.Core.Level)">
- <summary>
- Checks if this logger is enabled for a given <see cref="P:log4net.Repository.Hierarchy.Logger.Level"/> passed as parameter.
- </summary>
- <param name="level">The level to check.</param>
- <returns>
- <c>true</c> if this logger is enabled for <c>level</c>, otherwise <c>false</c>.
- </returns>
- <remarks>
- <para>
- Test if this logger is going to log events of the specified <paramref name="level"/>.
- </para>
- <para>
- This method must not throw any exception to the caller.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.CallAppenders(log4net.Core.LoggingEvent)">
- <summary>
- Deliver the <see cref="T:log4net.Core.LoggingEvent"/> to the attached appenders.
- </summary>
- <param name="loggingEvent">The event to log.</param>
- <remarks>
- <para>
- Call the appenders in the hierarchy starting at
- <c>this</c>. If no appenders could be found, emit a
- warning.
- </para>
- <para>
- This method calls all the appenders inherited from the
- hierarchy circumventing any evaluation of whether to log or not
- to log the particular log request.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.CloseNestedAppenders">
- <summary>
- Closes all attached appenders implementing the <see cref="T:log4net.Core.IAppenderAttachable"/> interface.
- </summary>
- <remarks>
- <para>
- Used to ensure that the appenders are correctly shutdown.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.Log(log4net.Core.Level,System.Object,System.Exception)">
- <summary>
- This is the most generic printing method. This generic form is intended to be used by wrappers
- </summary>
- <param name="level">The level of the message to be logged.</param>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Generate a logging event for the specified <paramref name="level"/> using
- the <paramref name="message"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.ForcedLog(System.Type,log4net.Core.Level,System.Object,System.Exception)">
- <summary>
- Creates a new logging event and logs the event without further checks.
- </summary>
- <param name="callerStackBoundaryDeclaringType">The declaring type of the method that is
- the stack boundary into the logging system for this call.</param>
- <param name="level">The level of the message to be logged.</param>
- <param name="message">The message object to log.</param>
- <param name="exception">The exception to log, including its stack trace.</param>
- <remarks>
- <para>
- Generates a logging event and delivers it to the attached
- appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Logger.ForcedLog(log4net.Core.LoggingEvent)">
- <summary>
- Creates a new logging event and logs the event without further checks.
- </summary>
- <param name="logEvent">The event being logged.</param>
- <remarks>
- <para>
- Delivers the logging event to the attached appenders.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.ThisDeclaringType">
- <summary>
- The fully qualified type of the Logger class.
- </summary>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_name">
- <summary>
- The name of this logger.
- </summary>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_level">
- <summary>
- The assigned level of this logger.
- </summary>
- <remarks>
- <para>
- The <c>level</c> variable need not be
- assigned a value in which case it is inherited
- form the hierarchy.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_parent">
- <summary>
- The parent of this logger.
- </summary>
- <remarks>
- <para>
- The parent of this logger.
- All loggers have at least one ancestor which is the root logger.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_hierarchy">
- <summary>
- Loggers need to know what Hierarchy they are in.
- </summary>
- <remarks>
- <para>
- Loggers need to know what Hierarchy they are in.
- The hierarchy that this logger is a member of is stored
- here.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_appenderAttachedImpl">
- <summary>
- Helper implementation of the <see cref="T:log4net.Core.IAppenderAttachable"/> interface
- </summary>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_additive">
- <summary>
- Flag indicating if child loggers inherit their parents appenders
- </summary>
- <remarks>
- <para>
- Additivity is set to true by default, that is children inherit
- the appenders of their ancestors by default. If this variable is
- set to <c>false</c> then the appenders found in the
- ancestors of this logger are not used. However, the children
- of this logger will inherit its appenders, unless the children
- have their additivity flag set to <c>false</c> too. See
- the user manual for more details.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.Logger.m_appenderLock">
- <summary>
- Lock to protect AppenderAttachedImpl variable m_appenderAttachedImpl
- </summary>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Parent">
- <summary>
- Gets or sets the parent logger in the hierarchy.
- </summary>
- <value>
- The parent logger in the hierarchy.
- </value>
- <remarks>
- <para>
- Part of the Composite pattern that makes the hierarchy.
- The hierarchy is parent linked rather than child linked.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Additivity">
- <summary>
- Gets or sets a value indicating if child loggers inherit their parent's appenders.
- </summary>
- <value>
- <c>true</c> if child loggers inherit their parent's appenders.
- </value>
- <remarks>
- <para>
- Additivity is set to <c>true</c> by default, that is children inherit
- the appenders of their ancestors by default. If this variable is
- set to <c>false</c> then the appenders found in the
- ancestors of this logger are not used. However, the children
- of this logger will inherit its appenders, unless the children
- have their additivity flag set to <c>false</c> too. See
- the user manual for more details.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.EffectiveLevel">
- <summary>
- Gets the effective level for this logger.
- </summary>
- <returns>The nearest level in the logger hierarchy.</returns>
- <remarks>
- <para>
- Starting from this logger, searches the logger hierarchy for a
- non-null level and returns it. Otherwise, returns the level of the
- root logger.
- </para>
- <para>The Logger class is designed so that this method executes as
- quickly as possible.</para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Hierarchy">
- <summary>
- Gets or sets the <see cref="P:log4net.Repository.Hierarchy.Logger.Hierarchy"/> where this
- <c>Logger</c> instance is attached to.
- </summary>
- <value>The hierarchy that this logger belongs to.</value>
- <remarks>
- <para>
- This logger must be attached to a single <see cref="P:log4net.Repository.Hierarchy.Logger.Hierarchy"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Level">
- <summary>
- Gets or sets the assigned <see cref="P:log4net.Repository.Hierarchy.Logger.Level"/>, if any, for this Logger.
- </summary>
- <value>
- The <see cref="P:log4net.Repository.Hierarchy.Logger.Level"/> of this logger.
- </value>
- <remarks>
- <para>
- The assigned <see cref="P:log4net.Repository.Hierarchy.Logger.Level"/> can be <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Appenders">
- <summary>
- Get the appenders contained in this logger as an
- <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <returns>A collection of the appenders in this logger</returns>
- <remarks>
- <para>
- Get the appenders contained in this logger as an
- <see cref="T:System.Collections.ICollection"/>. If no appenders
- can be found, then a <see cref="T:log4net.Util.EmptyCollection"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Name">
- <summary>
- Gets the logger name.
- </summary>
- <value>
- The name of the logger.
- </value>
- <remarks>
- <para>
- The name of this logger
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Logger.Repository">
- <summary>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> where this
- <c>Logger</c> instance is attached to.
- </summary>
- <value>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> that this logger belongs to.
- </value>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> where this
- <c>Logger</c> instance is attached to.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.DefaultLoggerFactory.LoggerImpl.#ctor(System.String)">
- <summary>
- Construct a new Logger
- </summary>
- <param name="name">the name of the logger</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.DefaultLoggerFactory.LoggerImpl"/> class
- with the specified name.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.LoggerCreationEventHandler">
- <summary>
- Delegate used to handle logger creation event notifications.
- </summary>
- <param name="sender">The <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> in which the <see cref="T:log4net.Repository.Hierarchy.Logger"/> has been created.</param>
- <param name="e">The <see cref="T:log4net.Repository.Hierarchy.LoggerCreationEventArgs"/> event args that hold the <see cref="T:log4net.Repository.Hierarchy.Logger"/> instance that has been created.</param>
- <remarks>
- <para>
- Delegate used to handle logger creation event notifications.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.LoggerCreationEventArgs">
- <summary>
- Provides data for the <see cref="E:log4net.Repository.Hierarchy.Hierarchy.LoggerCreatedEvent"/> event.
- </summary>
- <remarks>
- <para>
- A <see cref="E:log4net.Repository.Hierarchy.Hierarchy.LoggerCreatedEvent"/> event is raised every time a
- <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> is created.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.LoggerCreationEventArgs.m_log">
- <summary>
- The <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> created
- </summary>
- </member>
- <member name="M:log4net.Repository.Hierarchy.LoggerCreationEventArgs.#ctor(log4net.Repository.Hierarchy.Logger)">
- <summary>
- Constructor
- </summary>
- <param name="log">The <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> that has been created.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.LoggerCreationEventArgs"/> event argument
- class,with the specified <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger">
- <summary>
- Gets the <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> that has been created.
- </summary>
- <value>
- The <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> that has been created.
- </value>
- <remarks>
- <para>
- The <see cref="P:log4net.Repository.Hierarchy.LoggerCreationEventArgs.Logger"/> that has been created.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.Hierarchy">
- <summary>
- Hierarchical organization of loggers
- </summary>
- <remarks>
- <para>
- <i>The casual user should not have to deal with this class
- directly.</i>
- </para>
- <para>
- This class is specialized in retrieving loggers by name and
- also maintaining the logger hierarchy. Implements the
- <see cref="T:log4net.Repository.ILoggerRepository"/> interface.
- </para>
- <para>
- The structure of the logger hierarchy is maintained by the
- <see cref="M:log4net.Repository.Hierarchy.Hierarchy.GetLogger(System.String)"/> method. The hierarchy is such that children
- link to their parent but parents do not have any references to their
- children. Moreover, loggers can be instantiated in any order, in
- particular descendant before ancestor.
- </para>
- <para>
- In case a descendant is created before a particular ancestor,
- then it creates a provision node for the ancestor and adds itself
- to the provision node. Other descendants of the same ancestor add
- themselves to the previously created provision node.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Repository.LoggerRepositorySkeleton">
- <summary>
- Base implementation of <see cref="T:log4net.Repository.ILoggerRepository"/>
- </summary>
- <remarks>
- <para>
- Default abstract implementation of the <see cref="T:log4net.Repository.ILoggerRepository"/> interface.
- </para>
- <para>
- Skeleton implementation of the <see cref="T:log4net.Repository.ILoggerRepository"/> interface.
- All <see cref="T:log4net.Repository.ILoggerRepository"/> types can extend this type.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Repository.ILoggerRepository">
- <summary>
- Interface implemented by logger repositories.
- </summary>
- <remarks>
- <para>
- This interface is implemented by logger repositories. e.g.
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.
- </para>
- <para>
- This interface is used by the <see cref="T:log4net.LogManager"/>
- to obtain <see cref="T:log4net.ILog"/> interfaces.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.Exists(System.String)">
- <summary>
- Check if the named logger exists in the repository. If so return
- its reference, otherwise returns <c>null</c>.
- </summary>
- <param name="name">The name of the logger to lookup</param>
- <returns>The Logger object with the name specified</returns>
- <remarks>
- <para>
- If the names logger exists it is returned, otherwise
- <c>null</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.GetCurrentLoggers">
- <summary>
- Returns all the currently defined loggers as an Array.
- </summary>
- <returns>All the defined loggers</returns>
- <remarks>
- <para>
- Returns all the currently defined loggers as an Array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.GetLogger(System.String)">
- <summary>
- Returns a named logger instance
- </summary>
- <param name="name">The name of the logger to retrieve</param>
- <returns>The logger object with the name specified</returns>
- <remarks>
- <para>
- Returns a named logger instance.
- </para>
- <para>
- If a logger of that name already exists, then it will be
- returned. Otherwise, a new logger will be instantiated and
- then linked with its existing ancestors as well as children.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.Shutdown">
- <summary>Shutdown the repository</summary>
- <remarks>
- <para>
- Shutting down a repository will <i>safely</i> close and remove
- all appenders in all loggers including the root logger.
- </para>
- <para>
- Some appenders need to be closed before the
- application exists. Otherwise, pending logging events might be
- lost.
- </para>
- <para>
- The <see cref="M:log4net.Repository.ILoggerRepository.Shutdown"/> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.ResetConfiguration">
- <summary>
- Reset the repositories configuration to a default state
- </summary>
- <remarks>
- <para>
- Reset all values contained in this instance to their
- default state.
- </para>
- <para>
- Existing loggers are not removed. They are just reset.
- </para>
- <para>
- This method should be used sparingly and with care as it will
- block all logging until it is completed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.Log(log4net.Core.LoggingEvent)">
- <summary>
- Log the <see cref="T:log4net.Core.LoggingEvent"/> through this repository.
- </summary>
- <param name="logEvent">the event to log</param>
- <remarks>
- <para>
- This method should not normally be used to log.
- The <see cref="T:log4net.ILog"/> interface should be used
- for routine logging. This interface can be obtained
- using the <see cref="M:log4net.LogManager.GetLogger(System.String)"/> method.
- </para>
- <para>
- The <c>logEvent</c> is delivered to the appropriate logger and
- that logger is then responsible for logging the event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.ILoggerRepository.GetAppenders">
- <summary>
- Returns all the Appenders that are configured as an Array.
- </summary>
- <returns>All the Appenders</returns>
- <remarks>
- <para>
- Returns all the Appenders that are configured as an Array.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.Name">
- <summary>
- The name of the repository
- </summary>
- <value>
- The name of the repository
- </value>
- <remarks>
- <para>
- The name of the repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.RendererMap">
- <summary>
- RendererMap accesses the object renderer map for this repository.
- </summary>
- <value>
- RendererMap accesses the object renderer map for this repository.
- </value>
- <remarks>
- <para>
- RendererMap accesses the object renderer map for this repository.
- </para>
- <para>
- The RendererMap holds a mapping between types and
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/> objects.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.PluginMap">
- <summary>
- The plugin map for this repository.
- </summary>
- <value>
- The plugin map for this repository.
- </value>
- <remarks>
- <para>
- The plugin map holds the <see cref="T:log4net.Plugin.IPlugin"/> instances
- that have been attached to this repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.LevelMap">
- <summary>
- Get the level map for the Repository.
- </summary>
- <remarks>
- <para>
- Get the level map for the Repository.
- </para>
- <para>
- The level map defines the mappings between
- level names and <see cref="T:log4net.Core.Level"/> objects in
- this repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.Threshold">
- <summary>
- The threshold for all events in this repository
- </summary>
- <value>
- The threshold for all events in this repository
- </value>
- <remarks>
- <para>
- The threshold for all events in this repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.Configured">
- <summary>
- Flag indicates if this repository has been configured.
- </summary>
- <value>
- Flag indicates if this repository has been configured.
- </value>
- <remarks>
- <para>
- Flag indicates if this repository has been configured.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.ILoggerRepository.ShutdownEvent">
- <summary>
- Event to notify that the repository has been shutdown.
- </summary>
- <value>
- Event to notify that the repository has been shutdown.
- </value>
- <remarks>
- <para>
- Event raised when the repository has been shutdown.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.ILoggerRepository.ConfigurationReset">
- <summary>
- Event to notify that the repository has had its configuration reset.
- </summary>
- <value>
- Event to notify that the repository has had its configuration reset.
- </value>
- <remarks>
- <para>
- Event raised when the repository's configuration has been
- reset to default.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.ILoggerRepository.ConfigurationChanged">
- <summary>
- Event to notify that the repository has had its configuration changed.
- </summary>
- <value>
- Event to notify that the repository has had its configuration changed.
- </value>
- <remarks>
- <para>
- Event raised when the repository's configuration has been changed.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.ILoggerRepository.Properties">
- <summary>
- Repository specific properties
- </summary>
- <value>
- Repository specific properties
- </value>
- <remarks>
- <para>
- These properties can be specified on a repository specific basis.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.#ctor">
- <summary>
- Default Constructor
- </summary>
- <remarks>
- <para>
- Initializes the repository with default (empty) properties.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.#ctor(log4net.Util.PropertiesDictionary)">
- <summary>
- Construct the repository using specific properties
- </summary>
- <param name="properties">the properties to set for this repository</param>
- <remarks>
- <para>
- Initializes the repository with specified properties.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.Exists(System.String)">
- <summary>
- Test if logger exists
- </summary>
- <param name="name">The name of the logger to lookup</param>
- <returns>The Logger object with the name specified</returns>
- <remarks>
- <para>
- Check if the named logger exists in the repository. If so return
- its reference, otherwise returns <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.GetCurrentLoggers">
- <summary>
- Returns all the currently defined loggers in the repository
- </summary>
- <returns>All the defined loggers</returns>
- <remarks>
- <para>
- Returns all the currently defined loggers in the repository as an Array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.GetLogger(System.String)">
- <summary>
- Return a new logger instance
- </summary>
- <param name="name">The name of the logger to retrieve</param>
- <returns>The logger object with the name specified</returns>
- <remarks>
- <para>
- Return a new logger instance.
- </para>
- <para>
- If a logger of that name already exists, then it will be
- returned. Otherwise, a new logger will be instantiated and
- then linked with its existing ancestors as well as children.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.Shutdown">
- <summary>
- Shutdown the repository
- </summary>
- <remarks>
- <para>
- Shutdown the repository. Can be overridden in a subclass.
- This base class implementation notifies the <see cref="E:log4net.Repository.LoggerRepositorySkeleton.ShutdownEvent"/>
- listeners and all attached plugins of the shutdown event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.ResetConfiguration">
- <summary>
- Reset the repositories configuration to a default state
- </summary>
- <remarks>
- <para>
- Reset all values contained in this instance to their
- default state.
- </para>
- <para>
- Existing loggers are not removed. They are just reset.
- </para>
- <para>
- This method should be used sparingly and with care as it will
- block all logging until it is completed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.Log(log4net.Core.LoggingEvent)">
- <summary>
- Log the logEvent through this repository.
- </summary>
- <param name="logEvent">the event to log</param>
- <remarks>
- <para>
- This method should not normally be used to log.
- The <see cref="T:log4net.ILog"/> interface should be used
- for routine logging. This interface can be obtained
- using the <see cref="M:log4net.LogManager.GetLogger(System.String)"/> method.
- </para>
- <para>
- The <c>logEvent</c> is delivered to the appropriate logger and
- that logger is then responsible for logging the event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.GetAppenders">
- <summary>
- Returns all the Appenders that are configured as an Array.
- </summary>
- <returns>All the Appenders</returns>
- <remarks>
- <para>
- Returns all the Appenders that are configured as an Array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.AddRenderer(System.Type,log4net.ObjectRenderer.IObjectRenderer)">
- <summary>
- Adds an object renderer for a specific class.
- </summary>
- <param name="typeToRender">The type that will be rendered by the renderer supplied.</param>
- <param name="rendererInstance">The object renderer used to render the object.</param>
- <remarks>
- <para>
- Adds an object renderer for a specific class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.OnShutdown(System.EventArgs)">
- <summary>
- Notify the registered listeners that the repository is shutting down
- </summary>
- <param name="e">Empty EventArgs</param>
- <remarks>
- <para>
- Notify any listeners that this repository is shutting down.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.OnConfigurationReset(System.EventArgs)">
- <summary>
- Notify the registered listeners that the repository has had its configuration reset
- </summary>
- <param name="e">Empty EventArgs</param>
- <remarks>
- <para>
- Notify any listeners that this repository's configuration has been reset.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.OnConfigurationChanged(System.EventArgs)">
- <summary>
- Notify the registered listeners that the repository has had its configuration changed
- </summary>
- <param name="e">Empty EventArgs</param>
- <remarks>
- <para>
- Notify any listeners that this repository's configuration has changed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.LoggerRepositorySkeleton.RaiseConfigurationChanged(System.EventArgs)">
- <summary>
- Raise a configuration changed event on this repository
- </summary>
- <param name="e">EventArgs.Empty</param>
- <remarks>
- <para>
- Applications that programmatically change the configuration of the repository should
- raise this event notification to notify listeners.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.Name">
- <summary>
- The name of the repository
- </summary>
- <value>
- The string name of the repository
- </value>
- <remarks>
- <para>
- The name of this repository. The name is
- used to store and lookup the repositories
- stored by the <see cref="T:log4net.Core.IRepositorySelector"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.Threshold">
- <summary>
- The threshold for all events in this repository
- </summary>
- <value>
- The threshold for all events in this repository
- </value>
- <remarks>
- <para>
- The threshold for all events in this repository
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.RendererMap">
- <summary>
- RendererMap accesses the object renderer map for this repository.
- </summary>
- <value>
- RendererMap accesses the object renderer map for this repository.
- </value>
- <remarks>
- <para>
- RendererMap accesses the object renderer map for this repository.
- </para>
- <para>
- The RendererMap holds a mapping between types and
- <see cref="T:log4net.ObjectRenderer.IObjectRenderer"/> objects.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.PluginMap">
- <summary>
- The plugin map for this repository.
- </summary>
- <value>
- The plugin map for this repository.
- </value>
- <remarks>
- <para>
- The plugin map holds the <see cref="T:log4net.Plugin.IPlugin"/> instances
- that have been attached to this repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.LevelMap">
- <summary>
- Get the level map for the Repository.
- </summary>
- <remarks>
- <para>
- Get the level map for the Repository.
- </para>
- <para>
- The level map defines the mappings between
- level names and <see cref="T:log4net.Core.Level"/> objects in
- this repository.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.Configured">
- <summary>
- Flag indicates if this repository has been configured.
- </summary>
- <value>
- Flag indicates if this repository has been configured.
- </value>
- <remarks>
- <para>
- Flag indicates if this repository has been configured.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.LoggerRepositorySkeleton.ShutdownEvent">
- <summary>
- Event to notify that the repository has been shutdown.
- </summary>
- <value>
- Event to notify that the repository has been shutdown.
- </value>
- <remarks>
- <para>
- Event raised when the repository has been shutdown.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.LoggerRepositorySkeleton.ConfigurationReset">
- <summary>
- Event to notify that the repository has had its configuration reset.
- </summary>
- <value>
- Event to notify that the repository has had its configuration reset.
- </value>
- <remarks>
- <para>
- Event raised when the repository's configuration has been
- reset to default.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.LoggerRepositorySkeleton.ConfigurationChanged">
- <summary>
- Event to notify that the repository has had its configuration changed.
- </summary>
- <value>
- Event to notify that the repository has had its configuration changed.
- </value>
- <remarks>
- <para>
- Event raised when the repository's configuration has been changed.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.LoggerRepositorySkeleton.Properties">
- <summary>
- Repository specific properties
- </summary>
- <value>
- Repository specific properties
- </value>
- <remarks>
- These properties can be specified on a repository specific basis
- </remarks>
- </member>
- <member name="T:log4net.Repository.IBasicRepositoryConfigurator">
- <summary>
- Basic Configurator interface for repositories
- </summary>
- <remarks>
- <para>
- Interface used by basic configurator to configure a <see cref="T:log4net.Repository.ILoggerRepository"/>
- with a default <see cref="T:log4net.Appender.IAppender"/>.
- </para>
- <para>
- A <see cref="T:log4net.Repository.ILoggerRepository"/> should implement this interface to support
- configuration by the <see cref="T:log4net.Config.BasicConfigurator"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.IBasicRepositoryConfigurator.Configure(log4net.Appender.IAppender)">
- <summary>
- Initialize the repository using the specified appender
- </summary>
- <param name="appender">the appender to use to log all logging events</param>
- <remarks>
- <para>
- Configure the repository to route all logging events to the
- specified appender.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.IXmlRepositoryConfigurator">
- <summary>
- Configure repository using XML
- </summary>
- <remarks>
- <para>
- Interface used by Xml configurator to configure a <see cref="T:log4net.Repository.ILoggerRepository"/>.
- </para>
- <para>
- A <see cref="T:log4net.Repository.ILoggerRepository"/> should implement this interface to support
- configuration by the <see cref="T:log4net.Config.XmlConfigurator"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.IXmlRepositoryConfigurator.Configure(System.Xml.XmlElement)">
- <summary>
- Initialize the repository using the specified config
- </summary>
- <param name="element">the element containing the root of the config</param>
- <remarks>
- <para>
- The schema for the XML configuration data is defined by
- the implementation.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.#ctor(log4net.Util.PropertiesDictionary)">
- <summary>
- Construct with properties
- </summary>
- <param name="properties">The properties to pass to this repository.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.#ctor(log4net.Repository.Hierarchy.ILoggerFactory)">
- <summary>
- Construct with a logger factory
- </summary>
- <param name="loggerFactory">The factory to use to create new logger instances.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> class with
- the specified <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.#ctor(log4net.Util.PropertiesDictionary,log4net.Repository.Hierarchy.ILoggerFactory)">
- <summary>
- Construct with properties and a logger factory
- </summary>
- <param name="properties">The properties to pass to this repository.</param>
- <param name="loggerFactory">The factory to use to create new logger instances.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> class with
- the specified <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.Exists(System.String)">
- <summary>
- Test if a logger exists
- </summary>
- <param name="name">The name of the logger to lookup</param>
- <returns>The Logger object with the name specified</returns>
- <remarks>
- <para>
- Check if the named logger exists in the hierarchy. If so return
- its reference, otherwise returns <c>null</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.GetCurrentLoggers">
- <summary>
- Returns all the currently defined loggers in the hierarchy as an Array
- </summary>
- <returns>All the defined loggers</returns>
- <remarks>
- <para>
- Returns all the currently defined loggers in the hierarchy as an Array.
- The root logger is <b>not</b> included in the returned
- enumeration.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.GetLogger(System.String)">
- <summary>
- Return a new logger instance named as the first parameter using
- the default factory.
- </summary>
- <remarks>
- <para>
- Return a new logger instance named as the first parameter using
- the default factory.
- </para>
- <para>
- If a logger of that name already exists, then it will be
- returned. Otherwise, a new logger will be instantiated and
- then linked with its existing ancestors as well as children.
- </para>
- </remarks>
- <param name="name">The name of the logger to retrieve</param>
- <returns>The logger object with the name specified</returns>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.Shutdown">
- <summary>
- Shutting down a hierarchy will <i>safely</i> close and remove
- all appenders in all loggers including the root logger.
- </summary>
- <remarks>
- <para>
- Shutting down a hierarchy will <i>safely</i> close and remove
- all appenders in all loggers including the root logger.
- </para>
- <para>
- Some appenders need to be closed before the
- application exists. Otherwise, pending logging events might be
- lost.
- </para>
- <para>
- The <c>Shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.ResetConfiguration">
- <summary>
- Reset all values contained in this hierarchy instance to their default.
- </summary>
- <remarks>
- <para>
- Reset all values contained in this hierarchy instance to their
- default. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set its default "off" value.
- </para>
- <para>
- Existing loggers are not removed. They are just reset.
- </para>
- <para>
- This method should be used sparingly and with care as it will
- block all logging until it is completed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.Log(log4net.Core.LoggingEvent)">
- <summary>
- Log the logEvent through this hierarchy.
- </summary>
- <param name="logEvent">the event to log</param>
- <remarks>
- <para>
- This method should not normally be used to log.
- The <see cref="T:log4net.ILog"/> interface should be used
- for routine logging. This interface can be obtained
- using the <see cref="M:log4net.LogManager.GetLogger(System.String)"/> method.
- </para>
- <para>
- The <c>logEvent</c> is delivered to the appropriate logger and
- that logger is then responsible for logging the event.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.GetAppenders">
- <summary>
- Returns all the Appenders that are currently configured
- </summary>
- <returns>An array containing all the currently configured appenders</returns>
- <remarks>
- <para>
- Returns all the <see cref="T:log4net.Appender.IAppender"/> instances that are currently configured.
- All the loggers are searched for appenders. The appenders may also be containers
- for appenders and these are also searched for additional loggers.
- </para>
- <para>
- The list returned is unordered but does not contain duplicates.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.CollectAppender(System.Collections.ArrayList,log4net.Appender.IAppender)">
- <summary>
- Collect the appenders from an <see cref="T:log4net.Core.IAppenderAttachable"/>.
- The appender may also be a container.
- </summary>
- <param name="appenderList"></param>
- <param name="appender"></param>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.CollectAppenders(System.Collections.ArrayList,log4net.Core.IAppenderAttachable)">
- <summary>
- Collect the appenders from an <see cref="T:log4net.Core.IAppenderAttachable"/> container
- </summary>
- <param name="appenderList"></param>
- <param name="container"></param>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.log4net#Repository#IBasicRepositoryConfigurator#Configure(log4net.Appender.IAppender)">
- <summary>
- Initialize the log4net system using the specified appender
- </summary>
- <param name="appender">the appender to use to log all logging events</param>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.BasicRepositoryConfigure(log4net.Appender.IAppender)">
- <summary>
- Initialize the log4net system using the specified appender
- </summary>
- <param name="appender">the appender to use to log all logging events</param>
- <remarks>
- <para>
- This method provides the same functionality as the
- <see cref="M:log4net.Repository.IBasicRepositoryConfigurator.Configure(log4net.Appender.IAppender)"/> method implemented
- on this object, but it is protected and therefore can be called by subclasses.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.log4net#Repository#IXmlRepositoryConfigurator#Configure(System.Xml.XmlElement)">
- <summary>
- Initialize the log4net system using the specified config
- </summary>
- <param name="element">the element containing the root of the config</param>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.XmlRepositoryConfigure(System.Xml.XmlElement)">
- <summary>
- Initialize the log4net system using the specified config
- </summary>
- <param name="element">the element containing the root of the config</param>
- <remarks>
- <para>
- This method provides the same functionality as the
- <see cref="M:log4net.Repository.IBasicRepositoryConfigurator.Configure(log4net.Appender.IAppender)"/> method implemented
- on this object, but it is protected and therefore can be called by subclasses.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.IsDisabled(log4net.Core.Level)">
- <summary>
- Test if this hierarchy is disabled for the specified <see cref="T:log4net.Core.Level"/>.
- </summary>
- <param name="level">The level to check against.</param>
- <returns>
- <c>true</c> if the repository is disabled for the level argument, <c>false</c> otherwise.
- </returns>
- <remarks>
- <para>
- If this hierarchy has not been configured then this method will
- always return <c>true</c>.
- </para>
- <para>
- This method will return <c>true</c> if this repository is
- disabled for <c>level</c> object passed as parameter and
- <c>false</c> otherwise.
- </para>
- <para>
- See also the <see cref="P:log4net.Repository.ILoggerRepository.Threshold"/> property.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.Clear">
- <summary>
- Clear all logger definitions from the internal hashtable
- </summary>
- <remarks>
- <para>
- This call will clear all logger definitions from the internal
- hashtable. Invoking this method will irrevocably mess up the
- logger hierarchy.
- </para>
- <para>
- You should <b>really</b> know what you are doing before
- invoking this method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.GetLogger(System.String,log4net.Repository.Hierarchy.ILoggerFactory)">
- <summary>
- Return a new logger instance named as the first parameter using
- <paramref name="factory"/>.
- </summary>
- <param name="name">The name of the logger to retrieve</param>
- <param name="factory">The factory that will make the new logger instance</param>
- <returns>The logger object with the name specified</returns>
- <remarks>
- <para>
- If a logger of that name already exists, then it will be
- returned. Otherwise, a new logger will be instantiated by the
- <paramref name="factory"/> parameter and linked with its existing
- ancestors as well as children.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.OnLoggerCreationEvent(log4net.Repository.Hierarchy.Logger)">
- <summary>
- Sends a logger creation event to all registered listeners
- </summary>
- <param name="logger">The newly created logger</param>
- <remarks>
- Raises the logger creation event.
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.UpdateParents(log4net.Repository.Hierarchy.Logger)">
- <summary>
- Updates all the parents of the specified logger
- </summary>
- <param name="log">The logger to update the parents for</param>
- <remarks>
- <para>
- This method loops through all the <i>potential</i> parents of
- <paramref name="log"/>. There 3 possible cases:
- </para>
- <list type="number">
- <item>
- <term>No entry for the potential parent of <paramref name="log"/> exists</term>
- <description>
- We create a ProvisionNode for this potential
- parent and insert <paramref name="log"/> in that provision node.
- </description>
- </item>
- <item>
- <term>The entry is of type Logger for the potential parent.</term>
- <description>
- The entry is <paramref name="log"/>'s nearest existing parent. We
- update <paramref name="log"/>'s parent field with this entry. We also break from
- he loop because updating our parent's parent is our parent's
- responsibility.
- </description>
- </item>
- <item>
- <term>The entry is of type ProvisionNode for this potential parent.</term>
- <description>
- We add <paramref name="log"/> to the list of children for this
- potential parent.
- </description>
- </item>
- </list>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.UpdateChildren(log4net.Repository.Hierarchy.ProvisionNode,log4net.Repository.Hierarchy.Logger)">
- <summary>
- Replace a <see cref="T:log4net.Repository.Hierarchy.ProvisionNode"/> with a <see cref="T:log4net.Repository.Hierarchy.Logger"/> in the hierarchy.
- </summary>
- <param name="pn"></param>
- <param name="log"></param>
- <remarks>
- <para>
- We update the links for all the children that placed themselves
- in the provision node 'pn'. The second argument 'log' is a
- reference for the newly created Logger, parent of all the
- children in 'pn'.
- </para>
- <para>
- We loop on all the children 'c' in 'pn'.
- </para>
- <para>
- If the child 'c' has been already linked to a child of
- 'log' then there is no need to update 'c'.
- </para>
- <para>
- Otherwise, we set log's parent field to c's parent and set
- c's parent field to log.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.AddLevel(log4net.Repository.Hierarchy.Hierarchy.LevelEntry)">
- <summary>
- Define or redefine a Level using the values in the <see cref="T:log4net.Repository.Hierarchy.Hierarchy.LevelEntry"/> argument
- </summary>
- <param name="levelEntry">the level values</param>
- <remarks>
- <para>
- Define or redefine a Level using the values in the <see cref="T:log4net.Repository.Hierarchy.Hierarchy.LevelEntry"/> argument
- </para>
- <para>
- Supports setting levels via the configuration file.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.AddProperty(log4net.Repository.Hierarchy.Hierarchy.PropertyEntry)">
- <summary>
- Set a Property using the values in the <see cref="T:log4net.Repository.Hierarchy.Hierarchy.LevelEntry"/> argument
- </summary>
- <param name="propertyEntry">the property value</param>
- <remarks>
- <para>
- Set a Property using the values in the <see cref="T:log4net.Repository.Hierarchy.Hierarchy.LevelEntry"/> argument.
- </para>
- <para>
- Supports setting property values via the configuration file.
- </para>
- </remarks>
- </member>
- <member name="E:log4net.Repository.Hierarchy.Hierarchy.LoggerCreatedEvent">
- <summary>
- Event used to notify that a logger has been created.
- </summary>
- <remarks>
- <para>
- Event raised when a logger is created.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.EmittedNoAppenderWarning">
- <summary>
- Has no appender warning been emitted
- </summary>
- <remarks>
- <para>
- Flag to indicate if we have already issued a warning
- about not having an appender warning.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.Root">
- <summary>
- Get the root of this hierarchy
- </summary>
- <remarks>
- <para>
- Get the root of this hierarchy.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.LoggerFactory">
- <summary>
- Gets or sets the default <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/> instance.
- </summary>
- <value>The default <see cref="T:log4net.Repository.Hierarchy.ILoggerFactory"/></value>
- <remarks>
- <para>
- The logger factory is used to create logger instances.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.Hierarchy.LevelEntry">
- <summary>
- A class to hold the value, name and display name for a level
- </summary>
- <remarks>
- <para>
- A class to hold the value, name and display name for a level
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.LevelEntry.ToString">
- <summary>
- Override <c>Object.ToString</c> to return sensible debug info
- </summary>
- <returns>string info about this object</returns>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.LevelEntry.Value">
- <summary>
- Value of the level
- </summary>
- <remarks>
- <para>
- If the value is not set (defaults to -1) the value will be looked
- up for the current level with the same name.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.LevelEntry.Name">
- <summary>
- Name of the level
- </summary>
- <value>
- The name of the level
- </value>
- <remarks>
- <para>
- The name of the level.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.LevelEntry.DisplayName">
- <summary>
- Display name for the level
- </summary>
- <value>
- The display name of the level
- </value>
- <remarks>
- <para>
- The display name of the level.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.Hierarchy.PropertyEntry">
- <summary>
- A class to hold the key and data for a property set in the config file
- </summary>
- <remarks>
- <para>
- A class to hold the key and data for a property set in the config file
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.Hierarchy.PropertyEntry.ToString">
- <summary>
- Override <c>Object.ToString</c> to return sensible debug info
- </summary>
- <returns>string info about this object</returns>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.PropertyEntry.Key">
- <summary>
- Property Key
- </summary>
- <value>
- Property Key
- </value>
- <remarks>
- <para>
- Property Key.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.Hierarchy.PropertyEntry.Value">
- <summary>
- Property Value
- </summary>
- <value>
- Property Value
- </value>
- <remarks>
- <para>
- Property Value.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.LoggerKey">
- <summary>
- Used internally to accelerate hash table searches.
- </summary>
- <remarks>
- <para>
- Internal class used to improve performance of
- string keyed hashtables.
- </para>
- <para>
- The hashcode of the string is cached for reuse.
- The string is stored as an interned value.
- When comparing two <see cref="T:log4net.Repository.Hierarchy.LoggerKey"/> objects for equality
- the reference equality of the interned strings is compared.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.LoggerKey.#ctor(System.String)">
- <summary>
- Construct key with string name
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.LoggerKey"/> class
- with the specified name.
- </para>
- <para>
- Stores the hashcode of the string and interns
- the string key to optimize comparisons.
- </para>
- <note>
- The Compact Framework 1.0 the <see cref="M:System.String.Intern(System.String)"/>
- method does not work. On the Compact Framework
- the string keys are not interned nor are they
- compared by reference.
- </note>
- </remarks>
- <param name="name">The name of the logger.</param>
- </member>
- <member name="M:log4net.Repository.Hierarchy.LoggerKey.GetHashCode">
- <summary>
- Returns a hash code for the current instance.
- </summary>
- <returns>A hash code for the current instance.</returns>
- <remarks>
- <para>
- Returns the cached hashcode.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.LoggerKey.Equals(System.Object)">
- <summary>
- Determines whether two <see cref="T:log4net.Repository.Hierarchy.LoggerKey"/> instances
- are equal.
- </summary>
- <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:log4net.Repository.Hierarchy.LoggerKey"/>.</param>
- <returns>
- <c>true</c> if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:log4net.Repository.Hierarchy.LoggerKey"/>; otherwise, <c>false</c>.
- </returns>
- <remarks>
- <para>
- Compares the references of the interned strings.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.ProvisionNode">
- <summary>
- Provision nodes are used where no logger instance has been specified
- </summary>
- <remarks>
- <para>
- <see cref="T:log4net.Repository.Hierarchy.ProvisionNode"/> instances are used in the
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> when there is no specified
- <see cref="T:log4net.Repository.Hierarchy.Logger"/> for that node.
- </para>
- <para>
- A provision node holds a list of child loggers on behalf of
- a logger that does not exist.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.ProvisionNode.#ctor(log4net.Repository.Hierarchy.Logger)">
- <summary>
- Create a new provision node with child node
- </summary>
- <param name="log">A child logger to add to this node.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.ProvisionNode"/> class
- with the specified child logger.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.RootLogger">
- <summary>
- The <see cref="T:log4net.Repository.Hierarchy.RootLogger"/> sits at the root of the logger hierarchy tree.
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.Hierarchy.RootLogger"/> is a regular <see cref="T:log4net.Repository.Hierarchy.Logger"/> except
- that it provides several guarantees.
- </para>
- <para>
- First, it cannot be assigned a <c>null</c>
- level. Second, since the root logger cannot have a parent, the
- <see cref="P:log4net.Repository.Hierarchy.RootLogger.EffectiveLevel"/> property always returns the value of the
- level field without walking the hierarchy.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.RootLogger.#ctor(log4net.Core.Level)">
- <summary>
- Construct a <see cref="T:log4net.Repository.Hierarchy.RootLogger"/>
- </summary>
- <param name="level">The level to assign to the root logger.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.RootLogger"/> class with
- the specified logging level.
- </para>
- <para>
- The root logger names itself as "root". However, the root
- logger cannot be retrieved by name.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.RootLogger.EffectiveLevel">
- <summary>
- Gets the assigned level value without walking the logger hierarchy.
- </summary>
- <value>The assigned level value without walking the logger hierarchy.</value>
- <remarks>
- <para>
- Because the root logger cannot have a parent and its level
- must not be <c>null</c> this property just returns the
- value of <see cref="P:log4net.Repository.Hierarchy.Logger.Level"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Repository.Hierarchy.RootLogger.Level">
- <summary>
- Gets or sets the assigned <see cref="P:log4net.Repository.Hierarchy.RootLogger.Level"/> for the root logger.
- </summary>
- <value>
- The <see cref="P:log4net.Repository.Hierarchy.RootLogger.Level"/> of the root logger.
- </value>
- <remarks>
- <para>
- Setting the level of the root logger to a <c>null</c> reference
- may have catastrophic results. We prevent this here.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.Hierarchy.XmlHierarchyConfigurator">
- <summary>
- Initializes the log4net environment using an XML DOM.
- </summary>
- <remarks>
- <para>
- Configures a <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> using an XML DOM.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.#ctor(log4net.Repository.Hierarchy.Hierarchy)">
- <summary>
- Construct the configurator for a hierarchy
- </summary>
- <param name="hierarchy">The hierarchy to build.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Repository.Hierarchy.XmlHierarchyConfigurator"/> class
- with the specified <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.Configure(System.Xml.XmlElement)">
- <summary>
- Configure the hierarchy by parsing a DOM tree of XML elements.
- </summary>
- <param name="element">The root element to parse.</param>
- <remarks>
- <para>
- Configure the hierarchy by parsing a DOM tree of XML elements.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.FindAppenderByReference(System.Xml.XmlElement)">
- <summary>
- Parse appenders by IDREF.
- </summary>
- <param name="appenderRef">The appender ref element.</param>
- <returns>The instance of the appender that the ref refers to.</returns>
- <remarks>
- <para>
- Parse an XML element that represents an appender and return
- the appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(System.Xml.XmlElement)">
- <summary>
- Parses an appender element.
- </summary>
- <param name="appenderElement">The appender element.</param>
- <returns>The appender instance or <c>null</c> when parsing failed.</returns>
- <remarks>
- <para>
- Parse an XML element that represents an appender and return
- the appender instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseLogger(System.Xml.XmlElement)">
- <summary>
- Parses a logger element.
- </summary>
- <param name="loggerElement">The logger element.</param>
- <remarks>
- <para>
- Parse an XML element that represents a logger.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseRoot(System.Xml.XmlElement)">
- <summary>
- Parses the root logger element.
- </summary>
- <param name="rootElement">The root element.</param>
- <remarks>
- <para>
- Parse an XML element that represents the root logger.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseChildrenOfLoggerElement(System.Xml.XmlElement,log4net.Repository.Hierarchy.Logger,System.Boolean)">
- <summary>
- Parses the children of a logger element.
- </summary>
- <param name="catElement">The category element.</param>
- <param name="log">The logger instance.</param>
- <param name="isRoot">Flag to indicate if the logger is the root logger.</param>
- <remarks>
- <para>
- Parse the child elements of a &lt;logger&gt; element.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseRenderer(System.Xml.XmlElement)">
- <summary>
- Parses an object renderer.
- </summary>
- <param name="element">The renderer element.</param>
- <remarks>
- <para>
- Parse an XML element that represents a renderer.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseLevel(System.Xml.XmlElement,log4net.Repository.Hierarchy.Logger,System.Boolean)">
- <summary>
- Parses a level element.
- </summary>
- <param name="element">The level element.</param>
- <param name="log">The logger object to set the level on.</param>
- <param name="isRoot">Flag to indicate if the logger is the root logger.</param>
- <remarks>
- <para>
- Parse an XML element that represents a level.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.SetParameter(System.Xml.XmlElement,System.Object)">
- <summary>
- Sets a parameter on an object.
- </summary>
- <param name="element">The parameter element.</param>
- <param name="target">The object to set the parameter on.</param>
- <remarks>
- The parameter name must correspond to a writable property
- on the object. The value of the parameter is a string,
- therefore this function will attempt to set a string
- property first. If unable to set a string property it
- will inspect the property and its argument type. It will
- attempt to call a static method called <c>Parse</c> on the
- type of the property. This method will take a single
- string argument and return a value that can be used to
- set the property.
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.HasAttributesOrElements(System.Xml.XmlElement)">
- <summary>
- Test if an element has no attributes or child elements
- </summary>
- <param name="element">the element to inspect</param>
- <returns><c>true</c> if the element has any attributes or child elements, <c>false</c> otherwise</returns>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.IsTypeConstructible(System.Type)">
- <summary>
- Test if a <see cref="T:System.Type"/> is constructible with <c>Activator.CreateInstance</c>.
- </summary>
- <param name="type">the type to inspect</param>
- <returns><c>true</c> if the type is creatable using a default constructor, <c>false</c> otherwise</returns>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.FindMethodInfo(System.Type,System.String)">
- <summary>
- Look for a method on the <paramref name="targetType"/> that matches the <paramref name="name"/> supplied
- </summary>
- <param name="targetType">the type that has the method</param>
- <param name="name">the name of the method</param>
- <returns>the method info found</returns>
- <remarks>
- <para>
- The method must be a public instance method on the <paramref name="targetType"/>.
- The method must be named <paramref name="name"/> or "Add" followed by <paramref name="name"/>.
- The method must take a single parameter.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ConvertStringTo(System.Type,System.String)">
- <summary>
- Converts a string value to a target type.
- </summary>
- <param name="type">The type of object to convert the string to.</param>
- <param name="value">The string value to use as the value of the object.</param>
- <returns>
- <para>
- An object of type <paramref name="type"/> with value <paramref name="value"/> or
- <c>null</c> when the conversion could not be performed.
- </para>
- </returns>
- </member>
- <member name="M:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.CreateObjectFromXml(System.Xml.XmlElement,System.Type,System.Type)">
- <summary>
- Creates an object as specified in XML.
- </summary>
- <param name="element">The XML element that contains the definition of the object.</param>
- <param name="defaultTargetType">The object type to use if not explicitly specified.</param>
- <param name="typeConstraint">The type that the returned object must be or must inherit from.</param>
- <returns>The object or <c>null</c></returns>
- <remarks>
- <para>
- Parse an XML element and create an object instance based on the configuration
- data.
- </para>
- <para>
- The type of the instance may be specified in the XML. If not
- specified then the <paramref name="defaultTargetType"/> is used
- as the type. However the type is specified it must support the
- <paramref name="typeConstraint"/> type.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.m_appenderBag">
- <summary>
- key: appenderName, value: appender.
- </summary>
- </member>
- <member name="F:log4net.Repository.Hierarchy.XmlHierarchyConfigurator.m_hierarchy">
- <summary>
- The Hierarchy being configured.
- </summary>
- </member>
- <member name="T:log4net.Repository.LoggerRepositoryShutdownEventHandler">
- <summary>
- Delegate used to handle logger repository shutdown event notifications
- </summary>
- <param name="sender">The <see cref="T:log4net.Repository.ILoggerRepository"/> that is shutting down.</param>
- <param name="e">Empty event args</param>
- <remarks>
- <para>
- Delegate used to handle logger repository shutdown event notifications.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.LoggerRepositoryConfigurationResetEventHandler">
- <summary>
- Delegate used to handle logger repository configuration reset event notifications
- </summary>
- <param name="sender">The <see cref="T:log4net.Repository.ILoggerRepository"/> that has had its configuration reset.</param>
- <param name="e">Empty event args</param>
- <remarks>
- <para>
- Delegate used to handle logger repository configuration reset event notifications.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Repository.LoggerRepositoryConfigurationChangedEventHandler">
- <summary>
- Delegate used to handle event notifications for logger repository configuration changes.
- </summary>
- <param name="sender">The <see cref="T:log4net.Repository.ILoggerRepository"/> that has had its configuration changed.</param>
- <param name="e">Empty event arguments.</param>
- <remarks>
- <para>
- Delegate used to handle event notifications for logger repository configuration changes.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.AppDomainPatternConverter">
- <summary>
- Write the name of the current AppDomain to the output
- </summary>
- <remarks>
- <para>
- Write the name of the current AppDomain to the output writer
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.AppDomainPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the name of the current AppDomain to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Writes name of the current AppDomain to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.DatePatternConverter">
- <summary>
- Write the current date to the output
- </summary>
- <remarks>
- <para>
- Date pattern converter, uses a <see cref="T:log4net.DateFormatter.IDateFormatter"/> to format
- the current date and time to the writer as a string.
- </para>
- <para>
- The value of the <see cref="P:log4net.Util.PatternConverter.Option"/> determines
- the formatting of the date. The following values are allowed:
- <list type="definition">
- <listheader>
- <term>Option value</term>
- <description>Output</description>
- </listheader>
- <item>
- <term>ISO8601</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/> formatter.
- Formats using the <c>"yyyy-MM-dd HH:mm:ss,fff"</c> pattern.
- </description>
- </item>
- <item>
- <term>DATE</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> formatter.
- Formats using the <c>"dd MMM yyyy HH:mm:ss,fff"</c> for example, <c>"06 Nov 1994 15:49:37,459"</c>.
- </description>
- </item>
- <item>
- <term>ABSOLUTE</term>
- <description>
- Uses the <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/> formatter.
- Formats using the <c>"HH:mm:ss,fff"</c> for example, <c>"15:49:37,459"</c>.
- </description>
- </item>
- <item>
- <term>other</term>
- <description>
- Any other pattern string uses the <see cref="T:log4net.DateFormatter.SimpleDateFormatter"/> formatter.
- This formatter passes the pattern string to the <see cref="T:System.DateTime"/>
- <see cref="M:System.DateTime.ToString(System.String)"/> method.
- For details on valid patterns see
- <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemglobalizationdatetimeformatinfoclasstopic.asp">DateTimeFormatInfo Class</a>.
- </description>
- </item>
- </list>
- </para>
- <para>
- The date and time is in the local time zone and is rendered in that zone.
- To output the time in Universal time see <see cref="T:log4net.Util.PatternStringConverters.UtcDatePatternConverter"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.PatternStringConverters.DatePatternConverter.m_dateFormatter">
- <summary>
- The <see cref="T:log4net.DateFormatter.IDateFormatter"/> used to render the date to a string
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.DateFormatter.IDateFormatter"/> used to render the date to a string
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.DatePatternConverter.ActivateOptions">
- <summary>
- Initialize the converter options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Util.PatternStringConverters.DatePatternConverter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Util.PatternStringConverters.DatePatternConverter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Util.PatternStringConverters.DatePatternConverter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.DatePatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the current date to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Pass the current date and time to the <see cref="T:log4net.DateFormatter.IDateFormatter"/>
- for it to render it to the writer.
- </para>
- <para>
- The date and time passed is in the local time zone.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.EnvironmentPatternConverter">
- <summary>
- Write an environment variable to the output
- </summary>
- <remarks>
- <para>
- Write an environment variable to the output writer.
- The value of the <see cref="P:log4net.Util.PatternConverter.Option"/> determines
- the name of the variable to output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.EnvironmentPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write an environment variable to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Writes the environment variable to the output <paramref name="writer"/>.
- The name of the environment variable to output must be set
- using the <see cref="P:log4net.Util.PatternConverter.Option"/>
- property.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.IdentityPatternConverter">
- <summary>
- Write the current thread identity to the output
- </summary>
- <remarks>
- <para>
- Write the current thread identity to the output writer
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.IdentityPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the current thread identity to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Writes the current thread identity to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.LiteralPatternConverter">
- <summary>
- Pattern converter for literal string instances in the pattern
- </summary>
- <remarks>
- <para>
- Writes the literal string value specified in the
- <see cref="P:log4net.Util.PatternConverter.Option"/> property to
- the output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.LiteralPatternConverter.SetNext(log4net.Util.PatternConverter)">
- <summary>
- Set the next converter in the chain
- </summary>
- <param name="pc">The next pattern converter in the chain</param>
- <returns>The next pattern converter</returns>
- <remarks>
- <para>
- Special case the building of the pattern converter chain
- for <see cref="T:log4net.Util.PatternStringConverters.LiteralPatternConverter"/> instances. Two adjacent
- literals in the pattern can be represented by a single combined
- pattern converter. This implementation detects when a
- <see cref="T:log4net.Util.PatternStringConverters.LiteralPatternConverter"/> is added to the chain
- after this converter and combines its value with this converter's
- literal value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.LiteralPatternConverter.Format(System.IO.TextWriter,System.Object)">
- <summary>
- Write the literal to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, not set</param>
- <remarks>
- <para>
- Override the formatting behavior to ignore the FormattingInfo
- because we have a literal instead.
- </para>
- <para>
- Writes the value of <see cref="P:log4net.Util.PatternConverter.Option"/>
- to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.LiteralPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Convert this pattern into the rendered message
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">null, not set</param>
- <remarks>
- <para>
- This method is not used.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.NewLinePatternConverter">
- <summary>
- Writes a newline to the output
- </summary>
- <remarks>
- <para>
- Writes the system dependent line terminator to the output.
- This behavior can be overridden by setting the <see cref="P:log4net.Util.PatternConverter.Option"/>:
- </para>
- <list type="definition">
- <listheader>
- <term>Option Value</term>
- <description>Output</description>
- </listheader>
- <item>
- <term>DOS</term>
- <description>DOS or Windows line terminator <c>"\r\n"</c></description>
- </item>
- <item>
- <term>UNIX</term>
- <description>UNIX line terminator <c>"\n"</c></description>
- </item>
- </list>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.NewLinePatternConverter.ActivateOptions">
- <summary>
- Initialize the converter
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Util.PatternStringConverters.NewLinePatternConverter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Util.PatternStringConverters.NewLinePatternConverter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Util.PatternStringConverters.NewLinePatternConverter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.ProcessIdPatternConverter">
- <summary>
- Write the current process ID to the output
- </summary>
- <remarks>
- <para>
- Write the current process ID to the output writer
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.ProcessIdPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the current process ID to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Write the current process ID to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.PropertyPatternConverter">
- <summary>
- Property pattern converter
- </summary>
- <remarks>
- <para>
- This pattern converter reads the thread and global properties.
- The thread properties take priority over global properties.
- See <see cref="P:log4net.ThreadContext.Properties"/> for details of the
- thread properties. See <see cref="P:log4net.GlobalContext.Properties"/> for
- details of the global properties.
- </para>
- <para>
- If the <see cref="P:log4net.Util.PatternConverter.Option"/> is specified then that will be used to
- lookup a single property. If no <see cref="P:log4net.Util.PatternConverter.Option"/> is specified
- then all properties will be dumped as a list of key value pairs.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.PropertyPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the property value to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Writes out the value of a named property. The property name
- should be set in the <see cref="P:log4net.Util.PatternConverter.Option"/>
- property.
- </para>
- <para>
- If the <see cref="P:log4net.Util.PatternConverter.Option"/> is set to <c>null</c>
- then all the properties are written as key value pairs.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.RandomStringPatternConverter">
- <summary>
- A Pattern converter that generates a string of random characters
- </summary>
- <remarks>
- <para>
- The converter generates a string of random characters. By default
- the string is length 4. This can be changed by setting the <see cref="P:log4net.Util.PatternConverter.Option"/>
- to the string value of the length required.
- </para>
- <para>
- The random characters in the string are limited to uppercase letters
- and numbers only.
- </para>
- <para>
- The random number generator used by this class is not cryptographically secure.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.PatternStringConverters.RandomStringPatternConverter.s_random">
- <summary>
- Shared random number generator
- </summary>
- </member>
- <member name="F:log4net.Util.PatternStringConverters.RandomStringPatternConverter.m_length">
- <summary>
- Length of random string to generate. Default length 4.
- </summary>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.RandomStringPatternConverter.ActivateOptions">
- <summary>
- Initialize the converter options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Util.PatternStringConverters.RandomStringPatternConverter.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Util.PatternStringConverters.RandomStringPatternConverter.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Util.PatternStringConverters.RandomStringPatternConverter.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.RandomStringPatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write a randoim string to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Write a randoim string to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.UserNamePatternConverter">
- <summary>
- Write the current threads username to the output
- </summary>
- <remarks>
- <para>
- Write the current threads username to the output writer
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.UserNamePatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the current threads username to the output
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Write the current threads username to the output <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternStringConverters.UtcDatePatternConverter">
- <summary>
- Write the UTC date time to the output
- </summary>
- <remarks>
- <para>
- Date pattern converter, uses a <see cref="T:log4net.DateFormatter.IDateFormatter"/> to format
- the current date and time in Universal time.
- </para>
- <para>
- See the <see cref="T:log4net.Util.PatternStringConverters.DatePatternConverter"/> for details on the date pattern syntax.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.PatternStringConverters.DatePatternConverter"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.PatternStringConverters.UtcDatePatternConverter.Convert(System.IO.TextWriter,System.Object)">
- <summary>
- Write the current date and time to the output
- </summary>
- <param name="writer"><see cref="T:System.IO.TextWriter"/> that will receive the formatted result.</param>
- <param name="state">null, state is not set</param>
- <remarks>
- <para>
- Pass the current date and time to the <see cref="T:log4net.DateFormatter.IDateFormatter"/>
- for it to render it to the writer.
- </para>
- <para>
- The date is in Universal time when it is rendered.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.PatternStringConverters.DatePatternConverter"/>
- </member>
- <member name="T:log4net.Util.TypeConverters.BooleanConverter">
- <summary>
- Type converter for Boolean.
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <c>bool</c> type.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.BooleanConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.BooleanConverter.ConvertFrom(System.Object)">
- <summary>
- Convert the source object to the type supported by this object
- </summary>
- <param name="source">the object to convert</param>
- <returns>the converted object</returns>
- <remarks>
- <para>
- Uses the <see cref="M:System.Boolean.Parse(System.String)"/> method to convert the
- <see cref="T:System.String"/> argument to a <see cref="T:System.Boolean"/>.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.BooleanConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- <summary>
- Exception base type for conversion errors.
- </summary>
- <remarks>
- <para>
- This type extends <see cref="T:System.ApplicationException"/>. It
- does not add any new functionality but does differentiate the
- type of exception being thrown.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="message">A message to include with the exception.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class
- with the specified message.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.#ctor(System.String,System.Exception)">
- <summary>
- Constructor
- </summary>
- <param name="message">A message to include with the exception.</param>
- <param name="innerException">A nested exception to include.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class
- with the specified message and inner exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Serialization constructor
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
- <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class
- with serialized data.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.Create(System.Type,System.Object)">
- <summary>
- Creates a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class.
- </summary>
- <param name="destinationType">The conversion destination type.</param>
- <param name="sourceValue">The value to convert.</param>
- <returns>An instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/>.</returns>
- <remarks>
- <para>
- Creates a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConversionNotSupportedException.Create(System.Type,System.Object,System.Exception)">
- <summary>
- Creates a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class.
- </summary>
- <param name="destinationType">The conversion destination type.</param>
- <param name="sourceValue">The value to convert.</param>
- <param name="innerException">A nested exception to include.</param>
- <returns>An instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/>.</returns>
- <remarks>
- <para>
- Creates a new instance of the <see cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException"/> class.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.TypeConverters.ConverterRegistry">
- <summary>
- Register of type converters for specific types.
- </summary>
- <remarks>
- <para>
- Maintains a registry of type converters used to convert between
- types.
- </para>
- <para>
- Use the <see cref="M:log4net.Util.TypeConverters.ConverterRegistry.AddConverter(System.Type,System.Object)"/> and
- <see cref="M:log4net.Util.TypeConverters.ConverterRegistry.AddConverter(System.Type,System.Type)"/> methods to register new converters.
- The <see cref="M:log4net.Util.TypeConverters.ConverterRegistry.GetConvertTo(System.Type,System.Type)"/> and <see cref="M:log4net.Util.TypeConverters.ConverterRegistry.GetConvertFrom(System.Type)"/> methods
- lookup appropriate converters to use.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.#ctor">
- <summary>
- Private constructor
- </summary>
- <remarks>
- Initializes a new instance of the <see cref="T:log4net.Util.TypeConverters.ConverterRegistry"/> class.
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.#cctor">
- <summary>
- Static constructor.
- </summary>
- <remarks>
- <para>
- This constructor defines the intrinsic type converters.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.AddConverter(System.Type,System.Object)">
- <summary>
- Adds a converter for a specific type.
- </summary>
- <param name="destinationType">The type being converted to.</param>
- <param name="converter">The type converter to use to convert to the destination type.</param>
- <remarks>
- <para>
- Adds a converter instance for a specific type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.AddConverter(System.Type,System.Type)">
- <summary>
- Adds a converter for a specific type.
- </summary>
- <param name="destinationType">The type being converted to.</param>
- <param name="converterType">The type of the type converter to use to convert to the destination type.</param>
- <remarks>
- <para>
- Adds a converter <see cref="T:System.Type"/> for a specific type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.GetConvertTo(System.Type,System.Type)">
- <summary>
- Gets the type converter to use to convert values to the destination type.
- </summary>
- <param name="sourceType">The type being converted from.</param>
- <param name="destinationType">The type being converted to.</param>
- <returns>
- The type converter instance to use for type conversions or <c>null</c>
- if no type converter is found.
- </returns>
- <remarks>
- <para>
- Gets the type converter to use to convert values to the destination type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.GetConvertFrom(System.Type)">
- <summary>
- Gets the type converter to use to convert values to the destination type.
- </summary>
- <param name="destinationType">The type being converted to.</param>
- <returns>
- The type converter instance to use for type conversions or <c>null</c>
- if no type converter is found.
- </returns>
- <remarks>
- <para>
- Gets the type converter to use to convert values to the destination type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.GetConverterFromAttribute(System.Type)">
- <summary>
- Lookups the type converter to use as specified by the attributes on the
- destination type.
- </summary>
- <param name="destinationType">The type being converted to.</param>
- <returns>
- The type converter instance to use for type conversions or <c>null</c>
- if no type converter is found.
- </returns>
- </member>
- <member name="M:log4net.Util.TypeConverters.ConverterRegistry.CreateConverterInstance(System.Type)">
- <summary>
- Creates the instance of the type converter.
- </summary>
- <param name="converterType">The type of the type converter.</param>
- <returns>
- The type converter instance to use for type conversions or <c>null</c>
- if no type converter is found.
- </returns>
- <remarks>
- <para>
- The type specified for the type converter must implement
- the <see cref="T:log4net.Util.TypeConverters.IConvertFrom"/> or <see cref="T:log4net.Util.TypeConverters.IConvertTo"/> interfaces
- and must have a public default (no argument) constructor.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.TypeConverters.ConverterRegistry.s_type2converter">
- <summary>
- Mapping from <see cref="T:System.Type"/> to type converter.
- </summary>
- </member>
- <member name="T:log4net.Util.TypeConverters.EncodingConverter">
- <summary>
- Supports conversion from string to <see cref="T:System.Text.Encoding"/> type.
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <see cref="T:System.Text.Encoding"/> type.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.EncodingConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.EncodingConverter.ConvertFrom(System.Object)">
- <summary>
- Overrides the ConvertFrom method of IConvertFrom.
- </summary>
- <param name="source">the object to convert to an encoding</param>
- <returns>the encoding</returns>
- <remarks>
- <para>
- Uses the <see cref="M:System.Text.Encoding.GetEncoding(System.String)"/> method to
- convert the <see cref="T:System.String"/> argument to an <see cref="T:System.Text.Encoding"/>.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.EncodingConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="T:log4net.Util.TypeConverters.IConvertTo">
- <summary>
- Interface supported by type converters
- </summary>
- <remarks>
- <para>
- This interface supports conversion from a single type to arbitrary types.
- See <see cref="T:log4net.Util.TypeConverters.TypeConverterAttribute"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.IConvertTo.CanConvertTo(System.Type)">
- <summary>
- Returns whether this converter can convert the object to the specified type
- </summary>
- <param name="targetType">A Type that represents the type you want to convert to</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Test if the type supported by this converter can be converted to the
- <paramref name="targetType"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.IConvertTo.ConvertTo(System.Object,System.Type)">
- <summary>
- Converts the given value object to the specified type, using the arguments
- </summary>
- <param name="source">the object to convert</param>
- <param name="targetType">The Type to convert the value parameter to</param>
- <returns>the converted object</returns>
- <remarks>
- <para>
- Converts the <paramref name="source"/> (which must be of the type supported
- by this converter) to the <paramref name="targetType"/> specified..
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.TypeConverters.IPAddressConverter">
- <summary>
- Supports conversion from string to <see cref="T:System.Net.IPAddress"/> type.
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <see cref="T:System.Net.IPAddress"/> type.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.IPAddressConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.IPAddressConverter.ConvertFrom(System.Object)">
- <summary>
- Overrides the ConvertFrom method of IConvertFrom.
- </summary>
- <param name="source">the object to convert to an IPAddress</param>
- <returns>the IPAddress</returns>
- <remarks>
- <para>
- Uses the <see cref="M:System.Net.IPAddress.Parse(System.String)"/> method to convert the
- <see cref="T:System.String"/> argument to an <see cref="T:System.Net.IPAddress"/>.
- If that fails then the string is resolved as a DNS hostname.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.IPAddressConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="F:log4net.Util.TypeConverters.IPAddressConverter.validIpAddressChars">
- <summary>
- Valid characters in an IPv4 or IPv6 address string. (Does not support subnets)
- </summary>
- </member>
- <member name="T:log4net.Util.TypeConverters.PatternLayoutConverter">
- <summary>
- Supports conversion from string to <see cref="T:log4net.Layout.PatternLayout"/> type.
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <see cref="T:log4net.Layout.PatternLayout"/> type.
- </para>
- <para>
- The string is used as the <see cref="P:log4net.Layout.PatternLayout.ConversionPattern"/>
- of the <see cref="T:log4net.Layout.PatternLayout"/>.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternLayoutConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternLayoutConverter.ConvertFrom(System.Object)">
- <summary>
- Overrides the ConvertFrom method of IConvertFrom.
- </summary>
- <param name="source">the object to convert to a PatternLayout</param>
- <returns>the PatternLayout</returns>
- <remarks>
- <para>
- Creates and returns a new <see cref="T:log4net.Layout.PatternLayout"/> using
- the <paramref name="source"/> <see cref="T:System.String"/> as the
- <see cref="P:log4net.Layout.PatternLayout.ConversionPattern"/>.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.PatternLayoutConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="T:log4net.Util.TypeConverters.PatternStringConverter">
- <summary>
- Convert between string and <see cref="T:log4net.Util.PatternString"/>
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <see cref="T:log4net.Util.PatternString"/> type,
- and from a <see cref="T:log4net.Util.PatternString"/> type to a string.
- </para>
- <para>
- The string is used as the <see cref="P:log4net.Util.PatternString.ConversionPattern"/>
- of the <see cref="T:log4net.Util.PatternString"/>.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternStringConverter.CanConvertTo(System.Type)">
- <summary>
- Can the target type be converted to the type supported by this object
- </summary>
- <param name="targetType">A <see cref="T:System.Type"/> that represents the type you want to convert to</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="targetType"/> is
- assignable from a <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternStringConverter.ConvertTo(System.Object,System.Type)">
- <summary>
- Converts the given value object to the specified type, using the arguments
- </summary>
- <param name="source">the object to convert</param>
- <param name="targetType">The Type to convert the value parameter to</param>
- <returns>the converted object</returns>
- <remarks>
- <para>
- Uses the <see cref="M:log4net.Util.PatternString.Format"/> method to convert the
- <see cref="T:log4net.Util.PatternString"/> argument to a <see cref="T:System.String"/>.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- <paramref name="targetType"/>. To check for this condition use the
- <see cref="M:log4net.Util.TypeConverters.PatternStringConverter.CanConvertTo(System.Type)"/> method.
- </exception>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternStringConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.PatternStringConverter.ConvertFrom(System.Object)">
- <summary>
- Overrides the ConvertFrom method of IConvertFrom.
- </summary>
- <param name="source">the object to convert to a PatternString</param>
- <returns>the PatternString</returns>
- <remarks>
- <para>
- Creates and returns a new <see cref="T:log4net.Util.PatternString"/> using
- the <paramref name="source"/> <see cref="T:System.String"/> as the
- <see cref="P:log4net.Util.PatternString.ConversionPattern"/>.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.PatternStringConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="T:log4net.Util.TypeConverters.TypeConverter">
- <summary>
- Supports conversion from string to <see cref="T:System.Type"/> type.
- </summary>
- <remarks>
- <para>
- Supports conversion from string to <see cref="T:System.Type"/> type.
- </para>
- </remarks>
- <seealso cref="T:log4net.Util.TypeConverters.ConverterRegistry"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- <seealso cref="T:log4net.Util.TypeConverters.IConvertTo"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.TypeConverters.TypeConverter.CanConvertFrom(System.Type)">
- <summary>
- Can the source type be converted to the type supported by this object
- </summary>
- <param name="sourceType">the type to convert</param>
- <returns>true if the conversion is possible</returns>
- <remarks>
- <para>
- Returns <c>true</c> if the <paramref name="sourceType"/> is
- the <see cref="T:System.String"/> type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.TypeConverter.ConvertFrom(System.Object)">
- <summary>
- Overrides the ConvertFrom method of IConvertFrom.
- </summary>
- <param name="source">the object to convert to a Type</param>
- <returns>the Type</returns>
- <remarks>
- <para>
- Uses the <see cref="M:System.Type.GetType(System.String,System.Boolean)"/> method to convert the
- <see cref="T:System.String"/> argument to a <see cref="T:System.Type"/>.
- Additional effort is made to locate partially specified types
- by searching the loaded assemblies.
- </para>
- </remarks>
- <exception cref="T:log4net.Util.TypeConverters.ConversionNotSupportedException">
- The <paramref name="source"/> object cannot be converted to the
- target type. To check for this condition use the <see cref="M:log4net.Util.TypeConverters.TypeConverter.CanConvertFrom(System.Type)"/>
- method.
- </exception>
- </member>
- <member name="T:log4net.Util.TypeConverters.TypeConverterAttribute">
- <summary>
- Attribute used to associate a type converter
- </summary>
- <remarks>
- <para>
- Class and Interface level attribute that specifies a type converter
- to use with the associated type.
- </para>
- <para>
- To associate a type converter with a target type apply a
- <c>TypeConverterAttribute</c> to the target type. Specify the
- type of the type converter on the attribute.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Util.TypeConverters.TypeConverterAttribute.m_typeName">
- <summary>
- The string type name of the type converter
- </summary>
- </member>
- <member name="M:log4net.Util.TypeConverters.TypeConverterAttribute.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.TypeConverterAttribute.#ctor(System.String)">
- <summary>
- Create a new type converter attribute for the specified type name
- </summary>
- <param name="typeName">The string type name of the type converter</param>
- <remarks>
- <para>
- The type specified must implement the <see cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- or the <see cref="T:log4net.Util.TypeConverters.IConvertTo"/> interfaces.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TypeConverters.TypeConverterAttribute.#ctor(System.Type)">
- <summary>
- Create a new type converter attribute for the specified type
- </summary>
- <param name="converterType">The type of the type converter</param>
- <remarks>
- <para>
- The type specified must implement the <see cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- or the <see cref="T:log4net.Util.TypeConverters.IConvertTo"/> interfaces.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.TypeConverters.TypeConverterAttribute.ConverterTypeName">
- <summary>
- The string type name of the type converter
- </summary>
- <value>
- The string type name of the type converter
- </value>
- <remarks>
- <para>
- The type specified must implement the <see cref="T:log4net.Util.TypeConverters.IConvertFrom"/>
- or the <see cref="T:log4net.Util.TypeConverters.IConvertTo"/> interfaces.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.AppenderAttachedImpl">
- <summary>
- A straightforward implementation of the <see cref="T:log4net.Core.IAppenderAttachable"/> interface.
- </summary>
- <remarks>
- <para>
- This is the default implementation of the <see cref="T:log4net.Core.IAppenderAttachable"/>
- interface. Implementors of the <see cref="T:log4net.Core.IAppenderAttachable"/> interface
- should aggregate an instance of this type.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.AppenderAttachedImpl"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(log4net.Core.LoggingEvent)">
- <summary>
- Append on on all attached appenders.
- </summary>
- <param name="loggingEvent">The event being logged.</param>
- <returns>The number of appenders called.</returns>
- <remarks>
- <para>
- Calls the <see cref="M:log4net.Appender.IAppender.DoAppend(log4net.Core.LoggingEvent)"/> method on all
- attached appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(log4net.Core.LoggingEvent[])">
- <summary>
- Append on on all attached appenders.
- </summary>
- <param name="loggingEvents">The array of events being logged.</param>
- <returns>The number of appenders called.</returns>
- <remarks>
- <para>
- Calls the <see cref="M:log4net.Appender.IAppender.DoAppend(log4net.Core.LoggingEvent)"/> method on all
- attached appenders.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.CallAppend(log4net.Appender.IAppender,log4net.Core.LoggingEvent[])">
- <summary>
- Calls the DoAppende method on the <see cref="T:log4net.Appender.IAppender"/> with
- the <see cref="T:log4net.Core.LoggingEvent"/> objects supplied.
- </summary>
- <param name="appender">The appender</param>
- <param name="loggingEvents">The events</param>
- <remarks>
- <para>
- If the <paramref name="appender"/> supports the <see cref="T:log4net.Appender.IBulkAppender"/>
- interface then the <paramref name="loggingEvents"/> will be passed
- through using that interface. Otherwise the <see cref="T:log4net.Core.LoggingEvent"/>
- objects in the array will be passed one at a time.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.AddAppender(log4net.Appender.IAppender)">
- <summary>
- Attaches an appender.
- </summary>
- <param name="newAppender">The appender to add.</param>
- <remarks>
- <para>
- If the appender is already in the list it won't be added again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.GetAppender(System.String)">
- <summary>
- Gets an attached appender with the specified name.
- </summary>
- <param name="name">The name of the appender to get.</param>
- <returns>
- The appender with the name specified, or <c>null</c> if no appender with the
- specified name is found.
- </returns>
- <remarks>
- <para>
- Lookup an attached appender by name.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.RemoveAllAppenders">
- <summary>
- Removes all attached appenders.
- </summary>
- <remarks>
- <para>
- Removes and closes all attached appenders
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.RemoveAppender(log4net.Appender.IAppender)">
- <summary>
- Removes the specified appender from the list of attached appenders.
- </summary>
- <param name="appender">The appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.AppenderAttachedImpl.RemoveAppender(System.String)">
- <summary>
- Removes the appender with the specified name from the list of appenders.
- </summary>
- <param name="name">The name of the appender to remove.</param>
- <returns>The appender removed from the list</returns>
- <remarks>
- <para>
- The appender removed is not closed.
- If you are discarding the appender you must call
- <see cref="M:log4net.Appender.IAppender.Close"/> on the appender removed.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.AppenderAttachedImpl.m_appenderList">
- <summary>
- List of appenders
- </summary>
- </member>
- <member name="F:log4net.Util.AppenderAttachedImpl.m_appenderArray">
- <summary>
- Array of appenders, used to cache the m_appenderList
- </summary>
- </member>
- <member name="P:log4net.Util.AppenderAttachedImpl.Appenders">
- <summary>
- Gets all attached appenders.
- </summary>
- <returns>
- A collection of attached appenders, or <c>null</c> if there
- are no attached appenders.
- </returns>
- <remarks>
- <para>
- The read only collection of all currently attached appenders.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.CompositeProperties">
- <summary>
- This class aggregates several PropertiesDictionary collections together.
- </summary>
- <remarks>
- <para>
- Provides a dictionary style lookup over an ordered list of
- <see cref="T:log4net.Util.PropertiesDictionary"/> collections.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.CompositeProperties.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.CompositeProperties"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CompositeProperties.Add(log4net.Util.ReadOnlyPropertiesDictionary)">
- <summary>
- Add a Properties Dictionary to this composite collection
- </summary>
- <param name="properties">the properties to add</param>
- <remarks>
- <para>
- Properties dictionaries added first take precedence over dictionaries added
- later.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CompositeProperties.Flatten">
- <summary>
- Flatten this composite collection into a single properties dictionary
- </summary>
- <returns>the flattened dictionary</returns>
- <remarks>
- <para>
- Reduces the collection of ordered dictionaries to a single dictionary
- containing the resultant values for the keys.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.CompositeProperties.Item(System.String)">
- <summary>
- Gets the value of a property
- </summary>
- <value>
- The value for the property with the specified key
- </value>
- <remarks>
- <para>
- Looks up the value for the <paramref name="key"/> specified.
- The <see cref="T:log4net.Util.PropertiesDictionary"/> collections are searched
- in the order in which they were added to this collection. The value
- returned is the value held by the first collection that contains
- the specified key.
- </para>
- <para>
- If none of the collections contain the specified key then
- <c>null</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ContextPropertiesBase">
- <summary>
- Base class for Context Properties implementations
- </summary>
- <remarks>
- <para>
- This class defines a basic property get set accessor
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="P:log4net.Util.ContextPropertiesBase.Item(System.String)">
- <summary>
- Gets or sets the value of a property
- </summary>
- <value>
- The value for the property with the specified key
- </value>
- <remarks>
- <para>
- Gets or sets the value of a property
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.CountingQuietTextWriter">
- <summary>
- Subclass of <see cref="T:log4net.Util.QuietTextWriter"/> that maintains a count of
- the number of bytes written.
- </summary>
- <remarks>
- <para>
- This writer counts the number of bytes written.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Util.QuietTextWriter">
- <summary>
- <see cref="T:System.IO.TextWriter"/> that does not leak exceptions
- </summary>
- <remarks>
- <para>
- <see cref="T:log4net.Util.QuietTextWriter"/> does not throw exceptions when things go wrong.
- Instead, it delegates error handling to its <see cref="T:log4net.Core.IErrorHandler"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Util.TextWriterAdapter">
- <summary>
- Adapter that extends <see cref="T:System.IO.TextWriter"/> and forwards all
- messages to an instance of <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <remarks>
- <para>
- Adapter that extends <see cref="T:System.IO.TextWriter"/> and forwards all
- messages to an instance of <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.TextWriterAdapter.m_writer">
- <summary>
- The writer to forward messages to
- </summary>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.#ctor(System.IO.TextWriter)">
- <summary>
- Create an instance of <see cref="T:log4net.Util.TextWriterAdapter"/> that forwards all
- messages to a <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <param name="writer">The <see cref="T:System.IO.TextWriter"/> to forward to</param>
- <remarks>
- <para>
- Create an instance of <see cref="T:log4net.Util.TextWriterAdapter"/> that forwards all
- messages to a <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Close">
- <summary>
- Closes the writer and releases any system resources associated with the writer
- </summary>
- <remarks>
- <para>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Dispose(System.Boolean)">
- <summary>
- Dispose this writer
- </summary>
- <param name="disposing">flag indicating if we are being disposed</param>
- <remarks>
- <para>
- Dispose this writer
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Flush">
- <summary>
- Flushes any buffered output
- </summary>
- <remarks>
- <para>
- Clears all buffers for the writer and causes any buffered data to be written
- to the underlying device
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Write(System.Char)">
- <summary>
- Writes a character to the wrapped TextWriter
- </summary>
- <param name="value">the value to write to the TextWriter</param>
- <remarks>
- <para>
- Writes a character to the wrapped TextWriter
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Write(System.Char[],System.Int32,System.Int32)">
- <summary>
- Writes a character buffer to the wrapped TextWriter
- </summary>
- <param name="buffer">the data buffer</param>
- <param name="index">the start index</param>
- <param name="count">the number of characters to write</param>
- <remarks>
- <para>
- Writes a character buffer to the wrapped TextWriter
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.TextWriterAdapter.Write(System.String)">
- <summary>
- Writes a string to the wrapped TextWriter
- </summary>
- <param name="value">the value to write to the TextWriter</param>
- <remarks>
- <para>
- Writes a string to the wrapped TextWriter
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.TextWriterAdapter.Writer">
- <summary>
- Gets or sets the underlying <see cref="T:System.IO.TextWriter"/>.
- </summary>
- <value>
- The underlying <see cref="T:System.IO.TextWriter"/>.
- </value>
- <remarks>
- <para>
- Gets or sets the underlying <see cref="T:System.IO.TextWriter"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.TextWriterAdapter.Encoding">
- <summary>
- The Encoding in which the output is written
- </summary>
- <value>
- The <see cref="P:log4net.Util.TextWriterAdapter.Encoding"/>
- </value>
- <remarks>
- <para>
- The Encoding in which the output is written
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.TextWriterAdapter.FormatProvider">
- <summary>
- Gets an object that controls formatting
- </summary>
- <value>
- The format provider
- </value>
- <remarks>
- <para>
- Gets an object that controls formatting
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.TextWriterAdapter.NewLine">
- <summary>
- Gets or sets the line terminator string used by the TextWriter
- </summary>
- <value>
- The line terminator to use
- </value>
- <remarks>
- <para>
- Gets or sets the line terminator string used by the TextWriter
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.QuietTextWriter.#ctor(System.IO.TextWriter,log4net.Core.IErrorHandler)">
- <summary>
- Constructor
- </summary>
- <param name="writer">the writer to actually write to</param>
- <param name="errorHandler">the error handler to report error to</param>
- <remarks>
- <para>
- Create a new QuietTextWriter using a writer and error handler
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.QuietTextWriter.Write(System.Char)">
- <summary>
- Writes a character to the underlying writer
- </summary>
- <param name="value">the char to write</param>
- <remarks>
- <para>
- Writes a character to the underlying writer
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.QuietTextWriter.Write(System.Char[],System.Int32,System.Int32)">
- <summary>
- Writes a buffer to the underlying writer
- </summary>
- <param name="buffer">the buffer to write</param>
- <param name="index">the start index to write from</param>
- <param name="count">the number of characters to write</param>
- <remarks>
- <para>
- Writes a buffer to the underlying writer
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.QuietTextWriter.Write(System.String)">
- <summary>
- Writes a string to the output.
- </summary>
- <param name="value">The string data to write to the output.</param>
- <remarks>
- <para>
- Writes a string to the output.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.QuietTextWriter.Close">
- <summary>
- Closes the underlying output writer.
- </summary>
- <remarks>
- <para>
- Closes the underlying output writer.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.QuietTextWriter.m_errorHandler">
- <summary>
- The error handler instance to pass all errors to
- </summary>
- </member>
- <member name="F:log4net.Util.QuietTextWriter.m_closed">
- <summary>
- Flag to indicate if this writer is closed
- </summary>
- </member>
- <member name="P:log4net.Util.QuietTextWriter.ErrorHandler">
- <summary>
- Gets or sets the error handler that all errors are passed to.
- </summary>
- <value>
- The error handler that all errors are passed to.
- </value>
- <remarks>
- <para>
- Gets or sets the error handler that all errors are passed to.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.QuietTextWriter.Closed">
- <summary>
- Gets a value indicating whether this writer is closed.
- </summary>
- <value>
- <c>true</c> if this writer is closed, otherwise <c>false</c>.
- </value>
- <remarks>
- <para>
- Gets a value indicating whether this writer is closed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CountingQuietTextWriter.#ctor(System.IO.TextWriter,log4net.Core.IErrorHandler)">
- <summary>
- Constructor
- </summary>
- <param name="writer">The <see cref="T:System.IO.TextWriter"/> to actually write to.</param>
- <param name="errorHandler">The <see cref="T:log4net.Core.IErrorHandler"/> to report errors to.</param>
- <remarks>
- <para>
- Creates a new instance of the <see cref="T:log4net.Util.CountingQuietTextWriter"/> class
- with the specified <see cref="T:System.IO.TextWriter"/> and <see cref="T:log4net.Core.IErrorHandler"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CountingQuietTextWriter.Write(System.Char)">
- <summary>
- Writes a character to the underlying writer and counts the number of bytes written.
- </summary>
- <param name="value">the char to write</param>
- <remarks>
- <para>
- Overrides implementation of <see cref="T:log4net.Util.QuietTextWriter"/>. Counts
- the number of bytes written.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CountingQuietTextWriter.Write(System.Char[],System.Int32,System.Int32)">
- <summary>
- Writes a buffer to the underlying writer and counts the number of bytes written.
- </summary>
- <param name="buffer">the buffer to write</param>
- <param name="index">the start index to write from</param>
- <param name="count">the number of characters to write</param>
- <remarks>
- <para>
- Overrides implementation of <see cref="T:log4net.Util.QuietTextWriter"/>. Counts
- the number of bytes written.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CountingQuietTextWriter.Write(System.String)">
- <summary>
- Writes a string to the output and counts the number of bytes written.
- </summary>
- <param name="str">The string data to write to the output.</param>
- <remarks>
- <para>
- Overrides implementation of <see cref="T:log4net.Util.QuietTextWriter"/>. Counts
- the number of bytes written.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.CountingQuietTextWriter.m_countBytes">
- <summary>
- Total number of bytes written.
- </summary>
- </member>
- <member name="P:log4net.Util.CountingQuietTextWriter.Count">
- <summary>
- Gets or sets the total number of bytes written.
- </summary>
- <value>
- The total number of bytes written.
- </value>
- <remarks>
- <para>
- Gets or sets the total number of bytes written.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.CyclicBuffer">
- <summary>
- A fixed size rolling buffer of logging events.
- </summary>
- <remarks>
- <para>
- An array backed fixed size leaky bucket.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.CyclicBuffer.#ctor(System.Int32)">
- <summary>
- Constructor
- </summary>
- <param name="maxSize">The maximum number of logging events in the buffer.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.CyclicBuffer"/> class with
- the specified maximum number of buffered logging events.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentOutOfRangeException">The <paramref name="maxSize"/> argument is not a positive integer.</exception>
- </member>
- <member name="M:log4net.Util.CyclicBuffer.Append(log4net.Core.LoggingEvent)">
- <summary>
- Appends a <paramref name="loggingEvent"/> to the buffer.
- </summary>
- <param name="loggingEvent">The event to append to the buffer.</param>
- <returns>The event discarded from the buffer, if the buffer is full, otherwise <c>null</c>.</returns>
- <remarks>
- <para>
- Append an event to the buffer. If the buffer still contains free space then
- <c>null</c> is returned. If the buffer is full then an event will be dropped
- to make space for the new event, the event dropped is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CyclicBuffer.PopOldest">
- <summary>
- Get and remove the oldest event in the buffer.
- </summary>
- <returns>The oldest logging event in the buffer</returns>
- <remarks>
- <para>
- Gets the oldest (first) logging event in the buffer and removes it
- from the buffer.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CyclicBuffer.PopAll">
- <summary>
- Pops all the logging events from the buffer into an array.
- </summary>
- <returns>An array of all the logging events in the buffer.</returns>
- <remarks>
- <para>
- Get all the events in the buffer and clear the buffer.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.CyclicBuffer.Clear">
- <summary>
- Clear the buffer
- </summary>
- <remarks>
- <para>
- Clear the buffer of all events. The events in the buffer are lost.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.CyclicBuffer.Item(System.Int32)">
- <summary>
- Gets the <paramref name="i"/>th oldest event currently in the buffer.
- </summary>
- <value>The <paramref name="i"/>th oldest event currently in the buffer.</value>
- <remarks>
- <para>
- If <paramref name="i"/> is outside the range 0 to the number of events
- currently in the buffer, then <c>null</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.CyclicBuffer.MaxSize">
- <summary>
- Gets the maximum size of the buffer.
- </summary>
- <value>The maximum size of the buffer.</value>
- <remarks>
- <para>
- Gets the maximum size of the buffer
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.CyclicBuffer.Length">
- <summary>
- Gets the number of logging events in the buffer.
- </summary>
- <value>The number of logging events in the buffer.</value>
- <remarks>
- <para>
- This number is guaranteed to be in the range 0 to <see cref="P:log4net.Util.CyclicBuffer.MaxSize"/>
- (inclusive).
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.EmptyCollection">
- <summary>
- An always empty <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <remarks>
- <para>
- A singleton implementation of the <see cref="T:System.Collections.ICollection"/>
- interface that always represents an empty collection.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.EmptyCollection.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.EmptyCollection"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to enforce the singleton pattern.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyCollection.CopyTo(System.Array,System.Int32)">
- <summary>
- Copies the elements of the <see cref="T:System.Collections.ICollection"/> to an
- <see cref="T:System.Array"/>, starting at a particular Array index.
- </summary>
- <param name="array">The one-dimensional <see cref="T:System.Array"/>
- that is the destination of the elements copied from
- <see cref="T:System.Collections.ICollection"/>. The Array must have zero-based
- indexing.</param>
- <param name="index">The zero-based index in array at which
- copying begins.</param>
- <remarks>
- <para>
- As the collection is empty no values are copied into the array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyCollection.GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through a collection.
- </summary>
- <returns>
- An <see cref="T:System.Collections.IEnumerator"/> that can be used to
- iterate through the collection.
- </returns>
- <remarks>
- <para>
- As the collection is empty a <see cref="T:log4net.Util.NullEnumerator"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.EmptyCollection.s_instance">
- <summary>
- The singleton instance of the empty collection.
- </summary>
- </member>
- <member name="P:log4net.Util.EmptyCollection.Instance">
- <summary>
- Gets the singleton instance of the empty collection.
- </summary>
- <returns>The singleton instance of the empty collection.</returns>
- <remarks>
- <para>
- Gets the singleton instance of the empty collection.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyCollection.IsSynchronized">
- <summary>
- Gets a value indicating if access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread-safe).
- </summary>
- <value>
- <b>true</b> if access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread-safe); otherwise, <b>false</b>.
- </value>
- <remarks>
- <para>
- For the <see cref="T:log4net.Util.EmptyCollection"/> this property is always <c>true</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyCollection.Count">
- <summary>
- Gets the number of elements contained in the <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <value>
- The number of elements contained in the <see cref="T:System.Collections.ICollection"/>.
- </value>
- <remarks>
- <para>
- As the collection is empty the <see cref="P:log4net.Util.EmptyCollection.Count"/> is always <c>0</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyCollection.SyncRoot">
- <summary>
- Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <value>
- An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.
- </value>
- <remarks>
- <para>
- As the collection is empty and thread safe and synchronized this instance is also
- the <see cref="P:log4net.Util.EmptyCollection.SyncRoot"/> object.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.EmptyDictionary">
- <summary>
- An always empty <see cref="T:System.Collections.IDictionary"/>.
- </summary>
- <remarks>
- <para>
- A singleton implementation of the <see cref="T:System.Collections.IDictionary"/>
- interface that always represents an empty collection.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.EmptyDictionary"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to enforce the singleton pattern.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.CopyTo(System.Array,System.Int32)">
- <summary>
- Copies the elements of the <see cref="T:System.Collections.ICollection"/> to an
- <see cref="T:System.Array"/>, starting at a particular Array index.
- </summary>
- <param name="array">The one-dimensional <see cref="T:System.Array"/>
- that is the destination of the elements copied from
- <see cref="T:System.Collections.ICollection"/>. The Array must have zero-based
- indexing.</param>
- <param name="index">The zero-based index in array at which
- copying begins.</param>
- <remarks>
- <para>
- As the collection is empty no values are copied into the array.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.System#Collections#IEnumerable#GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through a collection.
- </summary>
- <returns>
- An <see cref="T:System.Collections.IEnumerator"/> that can be used to
- iterate through the collection.
- </returns>
- <remarks>
- <para>
- As the collection is empty a <see cref="T:log4net.Util.NullEnumerator"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.Add(System.Object,System.Object)">
- <summary>
- Adds an element with the provided key and value to the
- <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <param name="key">The <see cref="T:System.Object"/> to use as the key of the element to add.</param>
- <param name="value">The <see cref="T:System.Object"/> to use as the value of the element to add.</param>
- <remarks>
- <para>
- As the collection is empty no new values can be added. A <see cref="T:System.InvalidOperationException"/>
- is thrown if this method is called.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">This dictionary is always empty and cannot be modified.</exception>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.Clear">
- <summary>
- Removes all elements from the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <remarks>
- <para>
- As the collection is empty no values can be removed. A <see cref="T:System.InvalidOperationException"/>
- is thrown if this method is called.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">This dictionary is always empty and cannot be modified.</exception>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.Contains(System.Object)">
- <summary>
- Determines whether the <see cref="T:log4net.Util.EmptyDictionary"/> contains an element
- with the specified key.
- </summary>
- <param name="key">The key to locate in the <see cref="T:log4net.Util.EmptyDictionary"/>.</param>
- <returns><c>false</c></returns>
- <remarks>
- <para>
- As the collection is empty the <see cref="M:log4net.Util.EmptyDictionary.Contains(System.Object)"/> method always returns <c>false</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.GetEnumerator">
- <summary>
- Returns an enumerator that can iterate through a collection.
- </summary>
- <returns>
- An <see cref="T:System.Collections.IEnumerator"/> that can be used to
- iterate through the collection.
- </returns>
- <remarks>
- <para>
- As the collection is empty a <see cref="T:log4net.Util.NullEnumerator"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.EmptyDictionary.Remove(System.Object)">
- <summary>
- Removes the element with the specified key from the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <param name="key">The key of the element to remove.</param>
- <remarks>
- <para>
- As the collection is empty no values can be removed. A <see cref="T:System.InvalidOperationException"/>
- is thrown if this method is called.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">This dictionary is always empty and cannot be modified.</exception>
- </member>
- <member name="F:log4net.Util.EmptyDictionary.s_instance">
- <summary>
- The singleton instance of the empty dictionary.
- </summary>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.Instance">
- <summary>
- Gets the singleton instance of the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <returns>The singleton instance of the <see cref="T:log4net.Util.EmptyDictionary"/>.</returns>
- <remarks>
- <para>
- Gets the singleton instance of the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.IsSynchronized">
- <summary>
- Gets a value indicating if access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread-safe).
- </summary>
- <value>
- <b>true</b> if access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread-safe); otherwise, <b>false</b>.
- </value>
- <remarks>
- <para>
- For the <see cref="T:log4net.Util.EmptyCollection"/> this property is always <b>true</b>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.Count">
- <summary>
- Gets the number of elements contained in the <see cref="T:System.Collections.ICollection"/>
- </summary>
- <value>
- The number of elements contained in the <see cref="T:System.Collections.ICollection"/>.
- </value>
- <remarks>
- <para>
- As the collection is empty the <see cref="P:log4net.Util.EmptyDictionary.Count"/> is always <c>0</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.SyncRoot">
- <summary>
- Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.
- </summary>
- <value>
- An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.
- </value>
- <remarks>
- <para>
- As the collection is empty and thread safe and synchronized this instance is also
- the <see cref="P:log4net.Util.EmptyDictionary.SyncRoot"/> object.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.IsFixedSize">
- <summary>
- Gets a value indicating whether the <see cref="T:log4net.Util.EmptyDictionary"/> has a fixed size.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- As the collection is empty <see cref="P:log4net.Util.EmptyDictionary.IsFixedSize"/> always returns <c>true</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.IsReadOnly">
- <summary>
- Gets a value indicating whether the <see cref="T:log4net.Util.EmptyDictionary"/> is read-only.
- </summary>
- <value><c>true</c></value>
- <remarks>
- <para>
- As the collection is empty <see cref="P:log4net.Util.EmptyDictionary.IsReadOnly"/> always returns <c>true</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.Keys">
- <summary>
- Gets an <see cref="T:System.Collections.ICollection"/> containing the keys of the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <value>An <see cref="T:System.Collections.ICollection"/> containing the keys of the <see cref="T:log4net.Util.EmptyDictionary"/>.</value>
- <remarks>
- <para>
- As the collection is empty a <see cref="T:log4net.Util.EmptyCollection"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.Values">
- <summary>
- Gets an <see cref="T:System.Collections.ICollection"/> containing the values of the <see cref="T:log4net.Util.EmptyDictionary"/>.
- </summary>
- <value>An <see cref="T:System.Collections.ICollection"/> containing the values of the <see cref="T:log4net.Util.EmptyDictionary"/>.</value>
- <remarks>
- <para>
- As the collection is empty a <see cref="T:log4net.Util.EmptyCollection"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.EmptyDictionary.Item(System.Object)">
- <summary>
- Gets or sets the element with the specified key.
- </summary>
- <param name="key">The key of the element to get or set.</param>
- <value><c>null</c></value>
- <remarks>
- <para>
- As the collection is empty no values can be looked up or stored.
- If the index getter is called then <c>null</c> is returned.
- A <see cref="T:System.InvalidOperationException"/> is thrown if the setter is called.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">This dictionary is always empty and cannot be modified.</exception>
- </member>
- <member name="T:log4net.Util.FormattingInfo">
- <summary>
- Contain the information obtained when parsing formatting modifiers
- in conversion modifiers.
- </summary>
- <remarks>
- <para>
- Holds the formatting information extracted from the format string by
- the <see cref="T:log4net.Util.PatternParser"/>. This is used by the <see cref="T:log4net.Util.PatternConverter"/>
- objects when rendering the output.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.FormattingInfo.#ctor">
- <summary>
- Defaut Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.FormattingInfo"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.FormattingInfo.#ctor(System.Int32,System.Int32,System.Boolean)">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.FormattingInfo"/> class
- with the specified parameters.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.FormattingInfo.Min">
- <summary>
- Gets or sets the minimum value.
- </summary>
- <value>
- The minimum value.
- </value>
- <remarks>
- <para>
- Gets or sets the minimum value.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.FormattingInfo.Max">
- <summary>
- Gets or sets the maximum value.
- </summary>
- <value>
- The maximum value.
- </value>
- <remarks>
- <para>
- Gets or sets the maximum value.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.FormattingInfo.LeftAlign">
- <summary>
- Gets or sets a flag indicating whether left align is enabled
- or not.
- </summary>
- <value>
- A flag indicating whether left align is enabled or not.
- </value>
- <remarks>
- <para>
- Gets or sets a flag indicating whether left align is enabled or not.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.GlobalContextProperties">
- <summary>
- Implementation of Properties collection for the <see cref="T:log4net.GlobalContext"/>
- </summary>
- <remarks>
- <para>
- This class implements a properties collection that is thread safe and supports both
- storing properties and capturing a read only copy of the current propertied.
- </para>
- <para>
- This class is optimized to the scenario where the properties are read frequently
- and are modified infrequently.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.GlobalContextProperties.m_readOnlyProperties">
- <summary>
- The read only copy of the properties.
- </summary>
- <remarks>
- <para>
- This variable is declared <c>volatile</c> to prevent the compiler and JIT from
- reordering reads and writes of this thread performed on different threads.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.GlobalContextProperties.m_syncRoot">
- <summary>
- Lock object used to synchronize updates within this instance
- </summary>
- </member>
- <member name="M:log4net.Util.GlobalContextProperties.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.GlobalContextProperties"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.GlobalContextProperties.Remove(System.String)">
- <summary>
- Remove a property from the global context
- </summary>
- <param name="key">the key for the entry to remove</param>
- <remarks>
- <para>
- Removing an entry from the global context properties is relatively expensive compared
- with reading a value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.GlobalContextProperties.Clear">
- <summary>
- Clear the global context properties
- </summary>
- </member>
- <member name="M:log4net.Util.GlobalContextProperties.GetReadOnlyProperties">
- <summary>
- Get a readonly immutable copy of the properties
- </summary>
- <returns>the current global context properties</returns>
- <remarks>
- <para>
- This implementation is fast because the GlobalContextProperties class
- stores a readonly copy of the properties.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.GlobalContextProperties.Item(System.String)">
- <summary>
- Gets or sets the value of a property
- </summary>
- <value>
- The value for the property with the specified key
- </value>
- <remarks>
- <para>
- Reading the value for a key is faster than setting the value.
- When the value is written a new read only copy of
- the properties is created.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.LevelMapping">
- <summary>
- Manages a mapping from levels to <see cref="T:log4net.Util.LevelMappingEntry"/>
- </summary>
- <remarks>
- <para>
- Manages an ordered mapping from <see cref="T:log4net.Core.Level"/> instances
- to <see cref="T:log4net.Util.LevelMappingEntry"/> subclasses.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.LevelMapping.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initialise a new instance of <see cref="T:log4net.Util.LevelMapping"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LevelMapping.Add(log4net.Util.LevelMappingEntry)">
- <summary>
- Add a <see cref="T:log4net.Util.LevelMappingEntry"/> to this mapping
- </summary>
- <param name="entry">the entry to add</param>
- <remarks>
- <para>
- If a <see cref="T:log4net.Util.LevelMappingEntry"/> has previously been added
- for the same <see cref="T:log4net.Core.Level"/> then that entry will be
- overwritten.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LevelMapping.Lookup(log4net.Core.Level)">
- <summary>
- Lookup the mapping for the specified level
- </summary>
- <param name="level">the level to lookup</param>
- <returns>the <see cref="T:log4net.Util.LevelMappingEntry"/> for the level or <c>null</c> if no mapping found</returns>
- <remarks>
- <para>
- Lookup the value for the specified level. Finds the nearest
- mapping value for the level that is equal to or less than the
- <paramref name="level"/> specified.
- </para>
- <para>
- If no mapping could be found then <c>null</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LevelMapping.ActivateOptions">
- <summary>
- Initialize options
- </summary>
- <remarks>
- <para>
- Caches the sorted list of <see cref="T:log4net.Util.LevelMappingEntry"/> in an array
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.LogicalThreadContextProperties">
- <summary>
- Implementation of Properties collection for the <see cref="T:log4net.LogicalThreadContext"/>
- </summary>
- <remarks>
- <para>
- Class implements a collection of properties that is specific to each thread.
- The class is not synchronized as each thread has its own <see cref="T:log4net.Util.PropertiesDictionary"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.LogicalThreadContextProperties.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.LogicalThreadContextProperties"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogicalThreadContextProperties.Remove(System.String)">
- <summary>
- Remove a property
- </summary>
- <param name="key">the key for the entry to remove</param>
- <remarks>
- <para>
- Remove the value for the specified <paramref name="key"/> from the context.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogicalThreadContextProperties.Clear">
- <summary>
- Clear all the context properties
- </summary>
- <remarks>
- <para>
- Clear all the context properties
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogicalThreadContextProperties.GetProperties(System.Boolean)">
- <summary>
- Get the PropertiesDictionary stored in the LocalDataStoreSlot for this thread.
- </summary>
- <param name="create">create the dictionary if it does not exist, otherwise return null if is does not exist</param>
- <returns>the properties for this thread</returns>
- <remarks>
- <para>
- The collection returned is only to be used on the calling thread. If the
- caller needs to share the collection between different threads then the
- caller must clone the collection before doings so.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.LogicalThreadContextProperties.Item(System.String)">
- <summary>
- Gets or sets the value of a property
- </summary>
- <value>
- The value for the property with the specified key
- </value>
- <remarks>
- <para>
- Get or set the property value for the <paramref name="key"/> specified.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.LogLog">
- <summary>
- Outputs log statements from within the log4net assembly.
- </summary>
- <remarks>
- <para>
- Log4net components cannot make log4net logging calls. However, it is
- sometimes useful for the user to learn about what log4net is
- doing.
- </para>
- <para>
- All log4net internal debug calls go to the standard output stream
- whereas internal error messages are sent to the standard error output
- stream.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.LogLog.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.LogLog"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.#cctor">
- <summary>
- Static constructor that initializes logging by reading
- settings from the application configuration file.
- </summary>
- <remarks>
- <para>
- The <c>log4net.Internal.Debug</c> application setting
- controls internal debugging. This setting should be set
- to <c>true</c> to enable debugging.
- </para>
- <para>
- The <c>log4net.Internal.Quiet</c> application setting
- suppresses all internal logging including error messages.
- This setting should be set to <c>true</c> to enable message
- suppression.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Debug(System.String)">
- <summary>
- Writes log4net internal debug messages to the
- standard output stream.
- </summary>
- <param name="message">The message to log.</param>
- <remarks>
- <para>
- All internal debug messages are prepended with
- the string "log4net: ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Debug(System.String,System.Exception)">
- <summary>
- Writes log4net internal debug messages to the
- standard output stream.
- </summary>
- <param name="message">The message to log.</param>
- <param name="exception">An exception to log.</param>
- <remarks>
- <para>
- All internal debug messages are prepended with
- the string "log4net: ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Warn(System.String)">
- <summary>
- Writes log4net internal warning messages to the
- standard error stream.
- </summary>
- <param name="message">The message to log.</param>
- <remarks>
- <para>
- All internal warning messages are prepended with
- the string "log4net:WARN ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Warn(System.String,System.Exception)">
- <summary>
- Writes log4net internal warning messages to the
- standard error stream.
- </summary>
- <param name="message">The message to log.</param>
- <param name="exception">An exception to log.</param>
- <remarks>
- <para>
- All internal warning messages are prepended with
- the string "log4net:WARN ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Error(System.String)">
- <summary>
- Writes log4net internal error messages to the
- standard error stream.
- </summary>
- <param name="message">The message to log.</param>
- <remarks>
- <para>
- All internal error messages are prepended with
- the string "log4net:ERROR ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.Error(System.String,System.Exception)">
- <summary>
- Writes log4net internal error messages to the
- standard error stream.
- </summary>
- <param name="message">The message to log.</param>
- <param name="exception">An exception to log.</param>
- <remarks>
- <para>
- All internal debug messages are prepended with
- the string "log4net:ERROR ".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.EmitOutLine(System.String)">
- <summary>
- Writes output to the standard output stream.
- </summary>
- <param name="message">The message to log.</param>
- <remarks>
- <para>
- Writes to both Console.Out and System.Diagnostics.Trace.
- Note that the System.Diagnostics.Trace is not supported
- on the Compact Framework.
- </para>
- <para>
- If the AppDomain is not configured with a config file then
- the call to System.Diagnostics.Trace may fail. This is only
- an issue if you are programmatically creating your own AppDomains.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.LogLog.EmitErrorLine(System.String)">
- <summary>
- Writes output to the standard error stream.
- </summary>
- <param name="message">The message to log.</param>
- <remarks>
- <para>
- Writes to both Console.Error and System.Diagnostics.Trace.
- Note that the System.Diagnostics.Trace is not supported
- on the Compact Framework.
- </para>
- <para>
- If the AppDomain is not configured with a config file then
- the call to System.Diagnostics.Trace may fail. This is only
- an issue if you are programmatically creating your own AppDomains.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.LogLog.s_debugEnabled">
- <summary>
- Default debug level
- </summary>
- </member>
- <member name="F:log4net.Util.LogLog.s_quietMode">
- <summary>
- In quietMode not even errors generate any output.
- </summary>
- </member>
- <member name="P:log4net.Util.LogLog.InternalDebugging">
- <summary>
- Gets or sets a value indicating whether log4net internal logging
- is enabled or disabled.
- </summary>
- <value>
- <c>true</c> if log4net internal logging is enabled, otherwise
- <c>false</c>.
- </value>
- <remarks>
- <para>
- When set to <c>true</c>, internal debug level logging will be
- displayed.
- </para>
- <para>
- This value can be set by setting the application setting
- <c>log4net.Internal.Debug</c> in the application configuration
- file.
- </para>
- <para>
- The default value is <c>false</c>, i.e. debugging is
- disabled.
- </para>
- </remarks>
- <example>
- <para>
- The following example enables internal debugging using the
- application configuration file :
- </para>
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net.Internal.Debug" value="true" />
- </appSettings>
- </configuration>
- </code>
- </example>
- </member>
- <member name="P:log4net.Util.LogLog.QuietMode">
- <summary>
- Gets or sets a value indicating whether log4net should generate no output
- from internal logging, not even for errors.
- </summary>
- <value>
- <c>true</c> if log4net should generate no output at all from internal
- logging, otherwise <c>false</c>.
- </value>
- <remarks>
- <para>
- When set to <c>true</c> will cause internal logging at all levels to be
- suppressed. This means that no warning or error reports will be logged.
- This option overrides the <see cref="P:log4net.Util.LogLog.InternalDebugging"/> setting and
- disables all debug also.
- </para>
- <para>This value can be set by setting the application setting
- <c>log4net.Internal.Quiet</c> in the application configuration file.
- </para>
- <para>
- The default value is <c>false</c>, i.e. internal logging is not
- disabled.
- </para>
- </remarks>
- <example>
- The following example disables internal logging using the
- application configuration file :
- <code lang="XML" escaped="true">
- <configuration>
- <appSettings>
- <add key="log4net.Internal.Quiet" value="true"/>
- </appSettings>
- </configuration>
- </code>
- </example>
- </member>
- <member name="P:log4net.Util.LogLog.IsDebugEnabled">
- <summary>
- Test if LogLog.Debug is enabled for output.
- </summary>
- <value>
- <c>true</c> if Debug is enabled
- </value>
- <remarks>
- <para>
- Test if LogLog.Debug is enabled for output.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.LogLog.IsWarnEnabled">
- <summary>
- Test if LogLog.Warn is enabled for output.
- </summary>
- <value>
- <c>true</c> if Warn is enabled
- </value>
- <remarks>
- <para>
- Test if LogLog.Warn is enabled for output.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.LogLog.IsErrorEnabled">
- <summary>
- Test if LogLog.Error is enabled for output.
- </summary>
- <value>
- <c>true</c> if Error is enabled
- </value>
- <remarks>
- <para>
- Test if LogLog.Error is enabled for output.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.NativeError">
- <summary>
- Represents a native error code and message.
- </summary>
- <remarks>
- <para>
- Represents a Win32 platform native error.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.NativeError.#ctor(System.Int32,System.String)">
- <summary>
- Create an instance of the <see cref="T:log4net.Util.NativeError"/> class with the specified
- error number and message.
- </summary>
- <param name="number">The number of the native error.</param>
- <param name="message">The message of the native error.</param>
- <remarks>
- <para>
- Create an instance of the <see cref="T:log4net.Util.NativeError"/> class with the specified
- error number and message.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NativeError.GetLastError">
- <summary>
- Create a new instance of the <see cref="T:log4net.Util.NativeError"/> class for the last Windows error.
- </summary>
- <returns>
- An instance of the <see cref="T:log4net.Util.NativeError"/> class for the last windows error.
- </returns>
- <remarks>
- <para>
- The message for the <see cref="M:System.Runtime.InteropServices.Marshal.GetLastWin32Error"/> error number is lookup up using the
- native Win32 <c>FormatMessage</c> function.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NativeError.GetError(System.Int32)">
- <summary>
- Create a new instance of the <see cref="T:log4net.Util.NativeError"/> class.
- </summary>
- <param name="number">the error number for the native error</param>
- <returns>
- An instance of the <see cref="T:log4net.Util.NativeError"/> class for the specified
- error number.
- </returns>
- <remarks>
- <para>
- The message for the specified error number is lookup up using the
- native Win32 <c>FormatMessage</c> function.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NativeError.GetErrorMessage(System.Int32)">
- <summary>
- Retrieves the message corresponding with a Win32 message identifier.
- </summary>
- <param name="messageId">Message identifier for the requested message.</param>
- <returns>
- The message corresponding with the specified message identifier.
- </returns>
- <remarks>
- <para>
- The message will be searched for in system message-table resource(s)
- using the native <c>FormatMessage</c> function.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NativeError.ToString">
- <summary>
- Return error information string
- </summary>
- <returns>error information string</returns>
- <remarks>
- <para>
- Return error information string
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NativeError.FormatMessage(System.Int32,System.IntPtr@,System.Int32,System.Int32,System.String@,System.Int32,System.IntPtr)">
- <summary>
- Formats a message string.
- </summary>
- <param name="dwFlags">Formatting options, and how to interpret the <paramref name="lpSource"/> parameter.</param>
- <param name="lpSource">Location of the message definition.</param>
- <param name="dwMessageId">Message identifier for the requested message.</param>
- <param name="dwLanguageId">Language identifier for the requested message.</param>
- <param name="lpBuffer">If <paramref name="dwFlags"/> includes FORMAT_MESSAGE_ALLOCATE_BUFFER, the function allocates a buffer using the <c>LocalAlloc</c> function, and places the pointer to the buffer at the address specified in <paramref name="lpBuffer"/>.</param>
- <param name="nSize">If the FORMAT_MESSAGE_ALLOCATE_BUFFER flag is not set, this parameter specifies the maximum number of TCHARs that can be stored in the output buffer. If FORMAT_MESSAGE_ALLOCATE_BUFFER is set, this parameter specifies the minimum number of TCHARs to allocate for an output buffer.</param>
- <param name="Arguments">Pointer to an array of values that are used as insert values in the formatted message.</param>
- <remarks>
- <para>
- The function requires a message definition as input. The message definition can come from a
- buffer passed into the function. It can come from a message table resource in an
- already-loaded module. Or the caller can ask the function to search the system's message
- table resource(s) for the message definition. The function finds the message definition
- in a message table resource based on a message identifier and a language identifier.
- The function copies the formatted message text to an output buffer, processing any embedded
- insert sequences if requested.
- </para>
- <para>
- To prevent the usage of unsafe code, this stub does not support inserting values in the formatted message.
- </para>
- </remarks>
- <returns>
- <para>
- If the function succeeds, the return value is the number of TCHARs stored in the output
- buffer, excluding the terminating null character.
- </para>
- <para>
- If the function fails, the return value is zero. To get extended error information,
- call <see cref="M:System.Runtime.InteropServices.Marshal.GetLastWin32Error"/>.
- </para>
- </returns>
- </member>
- <member name="P:log4net.Util.NativeError.Number">
- <summary>
- Gets the number of the native error.
- </summary>
- <value>
- The number of the native error.
- </value>
- <remarks>
- <para>
- Gets the number of the native error.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.NativeError.Message">
- <summary>
- Gets the message of the native error.
- </summary>
- <value>
- The message of the native error.
- </value>
- <remarks>
- <para>
- </para>
- Gets the message of the native error.
- </remarks>
- </member>
- <member name="T:log4net.Util.NullDictionaryEnumerator">
- <summary>
- An always empty <see cref="T:System.Collections.IDictionaryEnumerator"/>.
- </summary>
- <remarks>
- <para>
- A singleton implementation of the <see cref="T:System.Collections.IDictionaryEnumerator"/> over a collection
- that is empty and not modifiable.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.NullDictionaryEnumerator.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.NullDictionaryEnumerator"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to enforce the singleton pattern.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullDictionaryEnumerator.MoveNext">
- <summary>
- Test if the enumerator can advance, if so advance.
- </summary>
- <returns><c>false</c> as the <see cref="T:log4net.Util.NullDictionaryEnumerator"/> cannot advance.</returns>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="M:log4net.Util.NullDictionaryEnumerator.MoveNext"/>
- will always return <c>false</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullDictionaryEnumerator.Reset">
- <summary>
- Resets the enumerator back to the start.
- </summary>
- <remarks>
- <para>
- As the enumerator is over an empty collection <see cref="M:log4net.Util.NullDictionaryEnumerator.Reset"/> does nothing.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.NullDictionaryEnumerator.s_instance">
- <summary>
- The singleton instance of the <see cref="T:log4net.Util.NullDictionaryEnumerator"/>.
- </summary>
- </member>
- <member name="P:log4net.Util.NullDictionaryEnumerator.Instance">
- <summary>
- Gets the singleton instance of the <see cref="T:log4net.Util.NullDictionaryEnumerator"/>.
- </summary>
- <returns>The singleton instance of the <see cref="T:log4net.Util.NullDictionaryEnumerator"/>.</returns>
- <remarks>
- <para>
- Gets the singleton instance of the <see cref="T:log4net.Util.NullDictionaryEnumerator"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.NullDictionaryEnumerator.Current">
- <summary>
- Gets the current object from the enumerator.
- </summary>
- <remarks>
- Throws an <see cref="T:System.InvalidOperationException"/> because the
- <see cref="T:log4net.Util.NullDictionaryEnumerator"/> never has a current value.
- </remarks>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- will throw an <see cref="T:System.InvalidOperationException"/>.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">The collection is empty and <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- cannot be positioned over a valid location.</exception>
- </member>
- <member name="P:log4net.Util.NullDictionaryEnumerator.Key">
- <summary>
- Gets the current key from the enumerator.
- </summary>
- <remarks>
- Throws an exception because the <see cref="T:log4net.Util.NullDictionaryEnumerator"/>
- never has a current value.
- </remarks>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="P:log4net.Util.NullDictionaryEnumerator.Key"/>
- will throw an <see cref="T:System.InvalidOperationException"/>.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">The collection is empty and <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- cannot be positioned over a valid location.</exception>
- </member>
- <member name="P:log4net.Util.NullDictionaryEnumerator.Value">
- <summary>
- Gets the current value from the enumerator.
- </summary>
- <value>The current value from the enumerator.</value>
- <remarks>
- Throws an <see cref="T:System.InvalidOperationException"/> because the
- <see cref="T:log4net.Util.NullDictionaryEnumerator"/> never has a current value.
- </remarks>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="P:log4net.Util.NullDictionaryEnumerator.Value"/>
- will throw an <see cref="T:System.InvalidOperationException"/>.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">The collection is empty and <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- cannot be positioned over a valid location.</exception>
- </member>
- <member name="P:log4net.Util.NullDictionaryEnumerator.Entry">
- <summary>
- Gets the current entry from the enumerator.
- </summary>
- <remarks>
- Throws an <see cref="T:System.InvalidOperationException"/> because the
- <see cref="T:log4net.Util.NullDictionaryEnumerator"/> never has a current entry.
- </remarks>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="P:log4net.Util.NullDictionaryEnumerator.Entry"/>
- will throw an <see cref="T:System.InvalidOperationException"/>.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">The collection is empty and <see cref="P:log4net.Util.NullDictionaryEnumerator.Current"/>
- cannot be positioned over a valid location.</exception>
- </member>
- <member name="T:log4net.Util.NullEnumerator">
- <summary>
- An always empty <see cref="T:System.Collections.IEnumerator"/>.
- </summary>
- <remarks>
- <para>
- A singleton implementation of the <see cref="T:System.Collections.IEnumerator"/> over a collection
- that is empty and not modifiable.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.NullEnumerator.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.NullEnumerator"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to enforce the singleton pattern.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullEnumerator.MoveNext">
- <summary>
- Test if the enumerator can advance, if so advance
- </summary>
- <returns><c>false</c> as the <see cref="T:log4net.Util.NullEnumerator"/> cannot advance.</returns>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="M:log4net.Util.NullEnumerator.MoveNext"/>
- will always return <c>false</c>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullEnumerator.Reset">
- <summary>
- Resets the enumerator back to the start.
- </summary>
- <remarks>
- <para>
- As the enumerator is over an empty collection <see cref="M:log4net.Util.NullEnumerator.Reset"/> does nothing.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.NullEnumerator.s_instance">
- <summary>
- The singleton instance of the <see cref="T:log4net.Util.NullEnumerator"/>.
- </summary>
- </member>
- <member name="P:log4net.Util.NullEnumerator.Instance">
- <summary>
- Get the singleton instance of the <see cref="T:log4net.Util.NullEnumerator"/>.
- </summary>
- <returns>The singleton instance of the <see cref="T:log4net.Util.NullEnumerator"/>.</returns>
- <remarks>
- <para>
- Gets the singleton instance of the <see cref="T:log4net.Util.NullEnumerator"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.NullEnumerator.Current">
- <summary>
- Gets the current object from the enumerator.
- </summary>
- <remarks>
- Throws an <see cref="T:System.InvalidOperationException"/> because the
- <see cref="T:log4net.Util.NullDictionaryEnumerator"/> never has a current value.
- </remarks>
- <remarks>
- <para>
- As the enumerator is over an empty collection its <see cref="P:log4net.Util.NullEnumerator.Current"/>
- value cannot be moved over a valid position, therefore <see cref="P:log4net.Util.NullEnumerator.Current"/>
- will throw an <see cref="T:System.InvalidOperationException"/>.
- </para>
- </remarks>
- <exception cref="T:System.InvalidOperationException">The collection is empty and <see cref="P:log4net.Util.NullEnumerator.Current"/>
- cannot be positioned over a valid location.</exception>
- </member>
- <member name="T:log4net.Util.NullSecurityContext">
- <summary>
- A SecurityContext used when a SecurityContext is not required
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.Util.NullSecurityContext"/> is a no-op implementation of the
- <see cref="T:log4net.Core.SecurityContext"/> base class. It is used where a <see cref="T:log4net.Core.SecurityContext"/>
- is required but one has not been provided.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.NullSecurityContext.Instance">
- <summary>
- Singleton instance of <see cref="T:log4net.Util.NullSecurityContext"/>
- </summary>
- <remarks>
- <para>
- Singleton instance of <see cref="T:log4net.Util.NullSecurityContext"/>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullSecurityContext.#ctor">
- <summary>
- Private constructor
- </summary>
- <remarks>
- <para>
- Private constructor for singleton pattern.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.NullSecurityContext.Impersonate(System.Object)">
- <summary>
- Impersonate this SecurityContext
- </summary>
- <param name="state">State supplied by the caller</param>
- <returns><c>null</c></returns>
- <remarks>
- <para>
- No impersonation is done and <c>null</c> is always returned.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.OnlyOnceErrorHandler">
- <summary>
- Implements log4net's default error handling policy which consists
- of emitting a message for the first error in an appender and
- ignoring all subsequent errors.
- </summary>
- <remarks>
- <para>
- The error message is printed on the standard error output stream.
- </para>
- <para>
- This policy aims at protecting an otherwise working application
- from being flooded with error messages when logging fails.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.OnlyOnceErrorHandler.#ctor">
- <summary>
- Default Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.OnlyOnceErrorHandler"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OnlyOnceErrorHandler.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="prefix">The prefix to use for each message.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.OnlyOnceErrorHandler"/> class
- with the specified prefix.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OnlyOnceErrorHandler.Error(System.String,System.Exception,log4net.Core.ErrorCode)">
- <summary>
- Log an Error
- </summary>
- <param name="message">The error message.</param>
- <param name="e">The exception.</param>
- <param name="errorCode">The internal error code.</param>
- <remarks>
- <para>
- Prints the message and the stack trace of the exception on the standard
- error output stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OnlyOnceErrorHandler.Error(System.String,System.Exception)">
- <summary>
- Log an Error
- </summary>
- <param name="message">The error message.</param>
- <param name="e">The exception.</param>
- <remarks>
- <para>
- Prints the message and the stack trace of the exception on the standard
- error output stream.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OnlyOnceErrorHandler.Error(System.String)">
- <summary>
- Log an error
- </summary>
- <param name="message">The error message.</param>
- <remarks>
- <para>
- Print a the error message passed as parameter on the standard
- error output stream.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.OnlyOnceErrorHandler.m_firstTime">
- <summary>
- Flag to indicate if it is the first error
- </summary>
- </member>
- <member name="F:log4net.Util.OnlyOnceErrorHandler.m_prefix">
- <summary>
- String to prefix each message with
- </summary>
- </member>
- <member name="P:log4net.Util.OnlyOnceErrorHandler.IsEnabled">
- <summary>
- Is error logging enabled
- </summary>
- <remarks>
- <para>
- Is error logging enabled. Logging is only enabled for the
- first error delivered to the <see cref="T:log4net.Util.OnlyOnceErrorHandler"/>.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.OptionConverter">
- <summary>
- A convenience class to convert property values to specific types.
- </summary>
- <remarks>
- <para>
- Utility functions for converting types and parsing values.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.OptionConverter.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.OptionConverter"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.ToBoolean(System.String,System.Boolean)">
- <summary>
- Converts a string to a <see cref="T:System.Boolean"/> value.
- </summary>
- <param name="argValue">String to convert.</param>
- <param name="defaultValue">The default value.</param>
- <returns>The <see cref="T:System.Boolean"/> value of <paramref name="argValue"/>.</returns>
- <remarks>
- <para>
- If <paramref name="argValue"/> is "true", then <c>true</c> is returned.
- If <paramref name="argValue"/> is "false", then <c>false</c> is returned.
- Otherwise, <paramref name="defaultValue"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.ToFileSize(System.String,System.Int64)">
- <summary>
- Parses a file size into a number.
- </summary>
- <param name="argValue">String to parse.</param>
- <param name="defaultValue">The default value.</param>
- <returns>The <see cref="T:System.Int64"/> value of <paramref name="argValue"/>.</returns>
- <remarks>
- <para>
- Parses a file size of the form: number[KB|MB|GB] into a
- long value. It is scaled with the appropriate multiplier.
- </para>
- <para>
- <paramref name="defaultValue"/> is returned when <paramref name="argValue"/>
- cannot be converted to a <see cref="T:System.Int64"/> value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.ConvertStringTo(System.Type,System.String)">
- <summary>
- Converts a string to an object.
- </summary>
- <param name="target">The target type to convert to.</param>
- <param name="txt">The string to convert to an object.</param>
- <returns>
- The object converted from a string or <c>null</c> when the
- conversion failed.
- </returns>
- <remarks>
- <para>
- Converts a string to an object. Uses the converter registry to try
- to convert the string value into the specified target type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.CanConvertTypeTo(System.Type,System.Type)">
- <summary>
- Checks if there is an appropriate type conversion from the source type to the target type.
- </summary>
- <param name="sourceType">The type to convert from.</param>
- <param name="targetType">The type to convert to.</param>
- <returns><c>true</c> if there is a conversion from the source type to the target type.</returns>
- <remarks>
- Checks if there is an appropriate type conversion from the source type to the target type.
- <para>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.ConvertTypeTo(System.Object,System.Type)">
- <summary>
- Converts an object to the target type.
- </summary>
- <param name="sourceInstance">The object to convert to the target type.</param>
- <param name="targetType">The type to convert to.</param>
- <returns>The converted object.</returns>
- <remarks>
- <para>
- Converts an object to the target type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.InstantiateByClassName(System.String,System.Type,System.Object)">
- <summary>
- Instantiates an object given a class name.
- </summary>
- <param name="className">The fully qualified class name of the object to instantiate.</param>
- <param name="superClass">The class to which the new object should belong.</param>
- <param name="defaultValue">The object to return in case of non-fulfillment.</param>
- <returns>
- An instance of the <paramref name="className"/> or <paramref name="defaultValue"/>
- if the object could not be instantiated.
- </returns>
- <remarks>
- <para>
- Checks that the <paramref name="className"/> is a subclass of
- <paramref name="superClass"/>. If that test fails or the object could
- not be instantiated, then <paramref name="defaultValue"/> is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.SubstituteVariables(System.String,System.Collections.IDictionary)">
- <summary>
- Performs variable substitution in string <paramref name="val"/> from the
- values of keys found in <paramref name="props"/>.
- </summary>
- <param name="value">The string on which variable substitution is performed.</param>
- <param name="props">The dictionary to use to lookup variables.</param>
- <returns>The result of the substitutions.</returns>
- <remarks>
- <para>
- The variable substitution delimiters are <b>${</b> and <b>}</b>.
- </para>
- <para>
- For example, if props contains <c>key=value</c>, then the call
- </para>
- <para>
- <code lang="C#">
- string s = OptionConverter.SubstituteVariables("Value of key is ${key}.");
- </code>
- </para>
- <para>
- will set the variable <c>s</c> to "Value of key is value.".
- </para>
- <para>
- If no value could be found for the specified key, then substitution
- defaults to an empty string.
- </para>
- <para>
- For example, if system properties contains no value for the key
- "nonExistentKey", then the call
- </para>
- <para>
- <code lang="C#">
- string s = OptionConverter.SubstituteVariables("Value of nonExistentKey is [${nonExistentKey}]");
- </code>
- </para>
- <para>
- will set <s>s</s> to "Value of nonExistentKey is []".
- </para>
- <para>
- An Exception is thrown if <paramref name="value"/> contains a start
- delimiter "${" which is not balanced by a stop delimiter "}".
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.OptionConverter.ParseEnum(System.Type,System.String,System.Boolean)">
- <summary>
- Converts the string representation of the name or numeric value of one or
- more enumerated constants to an equivalent enumerated object.
- </summary>
- <param name="enumType">The type to convert to.</param>
- <param name="value">The enum string value.</param>
- <param name="ignoreCase">If <c>true</c>, ignore case; otherwise, regard case.</param>
- <returns>An object of type <paramref name="enumType" /> whose value is represented by <paramref name="value" />.</returns>
- </member>
- <member name="T:log4net.Util.PatternParser">
- <summary>
- Most of the work of the <see cref="T:log4net.Layout.PatternLayout"/> class
- is delegated to the PatternParser class.
- </summary>
- <remarks>
- <para>
- The <c>PatternParser</c> processes a pattern string and
- returns a chain of <see cref="T:log4net.Util.PatternConverter"/> objects.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.PatternParser.#ctor(System.String)">
- <summary>
- Constructor
- </summary>
- <param name="pattern">The pattern to parse.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.PatternParser"/> class
- with the specified pattern string.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternParser.Parse">
- <summary>
- Parses the pattern into a chain of pattern converters.
- </summary>
- <returns>The head of a chain of pattern converters.</returns>
- <remarks>
- <para>
- Parses the pattern into a chain of pattern converters.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternParser.BuildCache">
- <summary>
- Build the unified cache of converters from the static and instance maps
- </summary>
- <returns>the list of all the converter names</returns>
- <remarks>
- <para>
- Build the unified cache of converters from the static and instance maps
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternParser.ParseInternal(System.String,System.String[])">
- <summary>
- Internal method to parse the specified pattern to find specified matches
- </summary>
- <param name="pattern">the pattern to parse</param>
- <param name="matches">the converter names to match in the pattern</param>
- <remarks>
- <para>
- The matches param must be sorted such that longer strings come before shorter ones.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternParser.ProcessLiteral(System.String)">
- <summary>
- Process a parsed literal
- </summary>
- <param name="text">the literal text</param>
- </member>
- <member name="M:log4net.Util.PatternParser.ProcessConverter(System.String,System.String,log4net.Util.FormattingInfo)">
- <summary>
- Process a parsed converter pattern
- </summary>
- <param name="converterName">the name of the converter</param>
- <param name="option">the optional option for the converter</param>
- <param name="formattingInfo">the formatting info for the converter</param>
- </member>
- <member name="M:log4net.Util.PatternParser.AddConverter(log4net.Util.PatternConverter)">
- <summary>
- Resets the internal state of the parser and adds the specified pattern converter
- to the chain.
- </summary>
- <param name="pc">The pattern converter to add.</param>
- </member>
- <member name="F:log4net.Util.PatternParser.m_head">
- <summary>
- The first pattern converter in the chain
- </summary>
- </member>
- <member name="F:log4net.Util.PatternParser.m_tail">
- <summary>
- the last pattern converter in the chain
- </summary>
- </member>
- <member name="F:log4net.Util.PatternParser.m_pattern">
- <summary>
- The pattern
- </summary>
- </member>
- <member name="F:log4net.Util.PatternParser.m_patternConverters">
- <summary>
- Internal map of converter identifiers to converter types
- </summary>
- <remarks>
- <para>
- This map overrides the static s_globalRulesRegistry map.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternParser.PatternConverters">
- <summary>
- Get the converter registry used by this parser
- </summary>
- <value>
- The converter registry used by this parser
- </value>
- <remarks>
- <para>
- Get the converter registry used by this parser
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternParser.StringLengthComparer">
- <summary>
- Sort strings by length
- </summary>
- <remarks>
- <para>
- <see cref="T:System.Collections.IComparer"/> that orders strings by string length.
- The longest strings are placed first
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternString">
- <summary>
- This class implements a patterned string.
- </summary>
- <remarks>
- <para>
- This string has embedded patterns that are resolved and expanded
- when the string is formatted.
- </para>
- <para>
- This class functions similarly to the <see cref="T:log4net.Layout.PatternLayout"/>
- in that it accepts a pattern and renders it to a string. Unlike the
- <see cref="T:log4net.Layout.PatternLayout"/> however the <c>PatternString</c>
- does not render the properties of a specific <see cref="T:log4net.Core.LoggingEvent"/> but
- of the process in general.
- </para>
- <para>
- The recognized conversion pattern names are:
- </para>
- <list type="table">
- <listheader>
- <term>Conversion Pattern Name</term>
- <description>Effect</description>
- </listheader>
- <item>
- <term>appdomain</term>
- <description>
- <para>
- Used to output the friendly name of the current AppDomain.
- </para>
- </description>
- </item>
- <item>
- <term>date</term>
- <description>
- <para>
- Used to output the date of the logging event in the local time zone.
- To output the date in universal time use the <c>%utcdate</c> pattern.
- The date conversion
- specifier may be followed by a <i>date format specifier</i> enclosed
- between braces. For example, <b>%date{HH:mm:ss,fff}</b> or
- <b>%date{dd MMM yyyy HH:mm:ss,fff}</b>. If no date format specifier is
- given then ISO8601 format is
- assumed (<see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>).
- </para>
- <para>
- The date format specifier admits the same syntax as the
- time pattern string of the <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- <para>
- For better results it is recommended to use the log4net date
- formatters. These can be specified using one of the strings
- "ABSOLUTE", "DATE" and "ISO8601" for specifying
- <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/>,
- <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> and respectively
- <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>. For example,
- <b>%date{ISO8601}</b> or <b>%date{ABSOLUTE}</b>.
- </para>
- <para>
- These dedicated date formatters perform significantly
- better than <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- </description>
- </item>
- <item>
- <term>env</term>
- <description>
- <para>
- Used to output the a specific environment variable. The key to
- lookup must be specified within braces and directly following the
- pattern specifier, e.g. <b>%env{COMPUTERNAME}</b> would include the value
- of the <c>COMPUTERNAME</c> environment variable.
- </para>
- <para>
- The <c>env</c> pattern is not supported on the .NET Compact Framework.
- </para>
- </description>
- </item>
- <item>
- <term>identity</term>
- <description>
- <para>
- Used to output the user name for the currently active user
- (Principal.Identity.Name).
- </para>
- </description>
- </item>
- <item>
- <term>newline</term>
- <description>
- <para>
- Outputs the platform dependent line separator character or
- characters.
- </para>
- <para>
- This conversion pattern name offers the same performance as using
- non-portable line separator strings such as "\n", or "\r\n".
- Thus, it is the preferred way of specifying a line separator.
- </para>
- </description>
- </item>
- <item>
- <term>processid</term>
- <description>
- <para>
- Used to output the system process ID for the current process.
- </para>
- </description>
- </item>
- <item>
- <term>property</term>
- <description>
- <para>
- Used to output a specific context property. The key to
- lookup must be specified within braces and directly following the
- pattern specifier, e.g. <b>%property{user}</b> would include the value
- from the property that is keyed by the string 'user'. Each property value
- that is to be included in the log must be specified separately.
- Properties are stored in logging contexts. By default
- the <c>log4net:HostName</c> property is set to the name of machine on
- which the event was originally logged.
- </para>
- <para>
- If no key is specified, e.g. <b>%property</b> then all the keys and their
- values are printed in a comma separated list.
- </para>
- <para>
- The properties of an event are combined from a number of different
- contexts. These are listed below in the order in which they are searched.
- </para>
- <list type="definition">
- <item>
- <term>the thread properties</term>
- <description>
- The <see cref="P:log4net.ThreadContext.Properties"/> that are set on the current
- thread. These properties are shared by all events logged on this thread.
- </description>
- </item>
- <item>
- <term>the global properties</term>
- <description>
- The <see cref="P:log4net.GlobalContext.Properties"/> that are set globally. These
- properties are shared by all the threads in the AppDomain.
- </description>
- </item>
- </list>
- </description>
- </item>
- <item>
- <term>random</term>
- <description>
- <para>
- Used to output a random string of characters. The string is made up of
- uppercase letters and numbers. By default the string is 4 characters long.
- The length of the string can be specified within braces directly following the
- pattern specifier, e.g. <b>%random{8}</b> would output an 8 character string.
- </para>
- </description>
- </item>
- <item>
- <term>username</term>
- <description>
- <para>
- Used to output the WindowsIdentity for the currently
- active user.
- </para>
- </description>
- </item>
- <item>
- <term>utcdate</term>
- <description>
- <para>
- Used to output the date of the logging event in universal time.
- The date conversion
- specifier may be followed by a <i>date format specifier</i> enclosed
- between braces. For example, <b>%utcdate{HH:mm:ss,fff}</b> or
- <b>%utcdate{dd MMM yyyy HH:mm:ss,fff}</b>. If no date format specifier is
- given then ISO8601 format is
- assumed (<see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>).
- </para>
- <para>
- The date format specifier admits the same syntax as the
- time pattern string of the <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- <para>
- For better results it is recommended to use the log4net date
- formatters. These can be specified using one of the strings
- "ABSOLUTE", "DATE" and "ISO8601" for specifying
- <see cref="T:log4net.DateFormatter.AbsoluteTimeDateFormatter"/>,
- <see cref="T:log4net.DateFormatter.DateTimeDateFormatter"/> and respectively
- <see cref="T:log4net.DateFormatter.Iso8601DateFormatter"/>. For example,
- <b>%utcdate{ISO8601}</b> or <b>%utcdate{ABSOLUTE}</b>.
- </para>
- <para>
- These dedicated date formatters perform significantly
- better than <see cref="M:System.DateTime.ToString(System.String)"/>.
- </para>
- </description>
- </item>
- <item>
- <term>%</term>
- <description>
- <para>
- The sequence %% outputs a single percent sign.
- </para>
- </description>
- </item>
- </list>
- <para>
- Additional pattern converters may be registered with a specific <see cref="T:log4net.Util.PatternString"/>
- instance using <see cref="M:log4net.Util.PatternString.AddConverter(log4net.Util.PatternString.ConverterInfo)"/> or
- <see cref="M:log4net.Util.PatternString.AddConverter(System.String,System.Type)"/>.
- </para>
- <para>
- See the <see cref="T:log4net.Layout.PatternLayout"/> for details on the
- <i>format modifiers</i> supported by the patterns.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.PatternString.s_globalRulesRegistry">
- <summary>
- Internal map of converter identifiers to converter types.
- </summary>
- </member>
- <member name="F:log4net.Util.PatternString.m_pattern">
- <summary>
- the pattern
- </summary>
- </member>
- <member name="F:log4net.Util.PatternString.m_head">
- <summary>
- the head of the pattern converter chain
- </summary>
- </member>
- <member name="F:log4net.Util.PatternString.m_instanceRulesRegistry">
- <summary>
- patterns defined on this PatternString only
- </summary>
- </member>
- <member name="M:log4net.Util.PatternString.#cctor">
- <summary>
- Initialize the global registry
- </summary>
- </member>
- <member name="M:log4net.Util.PatternString.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Initialize a new instance of <see cref="T:log4net.Util.PatternString"/>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.#ctor(System.String)">
- <summary>
- Constructs a PatternString
- </summary>
- <param name="pattern">The pattern to use with this PatternString</param>
- <remarks>
- <para>
- Initialize a new instance of <see cref="T:log4net.Util.PatternString"/> with the pattern specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.ActivateOptions">
- <summary>
- Initialize object options
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Util.PatternString.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Util.PatternString.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Util.PatternString.ActivateOptions"/> must be called again.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.CreatePatternParser(System.String)">
- <summary>
- Create the <see cref="T:log4net.Util.PatternParser"/> used to parse the pattern
- </summary>
- <param name="pattern">the pattern to parse</param>
- <returns>The <see cref="T:log4net.Util.PatternParser"/></returns>
- <remarks>
- <para>
- Returns PatternParser used to parse the conversion string. Subclasses
- may override this to return a subclass of PatternParser which recognize
- custom conversion pattern name.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.Format(System.IO.TextWriter)">
- <summary>
- Produces a formatted string as specified by the conversion pattern.
- </summary>
- <param name="writer">The TextWriter to write the formatted event to</param>
- <remarks>
- <para>
- Format the pattern to the <paramref name="writer"/>.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.Format">
- <summary>
- Format the pattern as a string
- </summary>
- <returns>the pattern formatted as a string</returns>
- <remarks>
- <para>
- Format the pattern to a string.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.AddConverter(log4net.Util.PatternString.ConverterInfo)">
- <summary>
- Add a converter to this PatternString
- </summary>
- <param name="converterInfo">the converter info</param>
- <remarks>
- <para>
- This version of the method is used by the configurator.
- Programmatic users should use the alternative <see cref="M:log4net.Util.PatternString.AddConverter(System.String,System.Type)"/> method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.AddConverter(System.String,System.Type)">
- <summary>
- Add a converter to this PatternString
- </summary>
- <param name="name">the name of the conversion pattern for this converter</param>
- <param name="type">the type of the converter</param>
- <remarks>
- <para>
- Add a converter to this PatternString
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternString.ConversionPattern">
- <summary>
- Gets or sets the pattern formatting string
- </summary>
- <value>
- The pattern formatting string
- </value>
- <remarks>
- <para>
- The <b>ConversionPattern</b> option. This is the string which
- controls formatting and consists of a mix of literal content and
- conversion specifiers.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PatternString.ConverterInfo">
- <summary>
- Wrapper class used to map converter names to converter types
- </summary>
- <remarks>
- <para>
- Wrapper class used to map converter names to converter types
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PatternString.ConverterInfo.#ctor">
- <summary>
- default constructor
- </summary>
- </member>
- <member name="P:log4net.Util.PatternString.ConverterInfo.Name">
- <summary>
- Gets or sets the name of the conversion pattern
- </summary>
- <value>
- The name of the conversion pattern
- </value>
- <remarks>
- <para>
- Gets or sets the name of the conversion pattern
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PatternString.ConverterInfo.Type">
- <summary>
- Gets or sets the type of the converter
- </summary>
- <value>
- The type of the converter
- </value>
- <remarks>
- <para>
- Gets or sets the type of the converter
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.PropertiesDictionary">
- <summary>
- String keyed object map.
- </summary>
- <remarks>
- <para>
- While this collection is serializable only member
- objects that are serializable will
- be serialized along with this collection.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="T:log4net.Util.ReadOnlyPropertiesDictionary">
- <summary>
- String keyed object map that is read only.
- </summary>
- <remarks>
- <para>
- This collection is readonly and cannot be modified.
- </para>
- <para>
- While this collection is serializable only member
- objects that are serializable will
- be serialized along with this collection.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="F:log4net.Util.ReadOnlyPropertiesDictionary.m_hashtable">
- <summary>
- The Hashtable used to store the properties data
- </summary>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ReadOnlyPropertiesDictionary"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.#ctor(log4net.Util.ReadOnlyPropertiesDictionary)">
- <summary>
- Copy Constructor
- </summary>
- <param name="propertiesDictionary">properties to copy</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ReadOnlyPropertiesDictionary"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Deserialization constructor
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data.</param>
- <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ReadOnlyPropertiesDictionary"/> class
- with serialized data.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.GetKeys">
- <summary>
- Gets the key names.
- </summary>
- <returns>An array of all the keys.</returns>
- <remarks>
- <para>
- Gets the key names.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.Contains(System.String)">
- <summary>
- Test if the dictionary contains a specified key
- </summary>
- <param name="key">the key to look for</param>
- <returns>true if the dictionary contains the specified key</returns>
- <remarks>
- <para>
- Test if the dictionary contains a specified key
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Serializes this object into the <see cref="T:System.Runtime.Serialization.SerializationInfo"/> provided.
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> to populate with data.</param>
- <param name="context">The destination for this serialization.</param>
- <remarks>
- <para>
- Serializes this object into the <see cref="T:System.Runtime.Serialization.SerializationInfo"/> provided.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#GetEnumerator">
- <summary>
- See <see cref="M:System.Collections.IDictionary.GetEnumerator"/>
- </summary>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Remove(System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Remove(System.Object)"/>
- </summary>
- <param name="key"></param>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Contains(System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Contains(System.Object)"/>
- </summary>
- <param name="key"></param>
- <returns></returns>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.Clear">
- <summary>
- Remove all properties from the properties collection
- </summary>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Add(System.Object,System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Add(System.Object,System.Object)"/>
- </summary>
- <param name="key"></param>
- <param name="value"></param>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#ICollection#CopyTo(System.Array,System.Int32)">
- <summary>
- See <see cref="M:System.Collections.ICollection.CopyTo(System.Array,System.Int32)"/>
- </summary>
- <param name="array"></param>
- <param name="index"></param>
- </member>
- <member name="M:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IEnumerable#GetEnumerator">
- <summary>
- See <see cref="M:System.Collections.IEnumerable.GetEnumerator"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.Item(System.String)">
- <summary>
- Gets or sets the value of the property with the specified key.
- </summary>
- <value>
- The value of the property with the specified key.
- </value>
- <param name="key">The key of the property to get or set.</param>
- <remarks>
- <para>
- The property value will only be serialized if it is serializable.
- If it cannot be serialized it will be silently ignored if
- a serialization operation is performed.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.InnerHashtable">
- <summary>
- The hashtable used to store the properties
- </summary>
- <value>
- The internal collection used to store the properties
- </value>
- <remarks>
- <para>
- The hashtable used to store the properties
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#IsReadOnly">
- <summary>
- See <see cref="P:System.Collections.IDictionary.IsReadOnly"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Item(System.Object)">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Item(System.Object)"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Values">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Values"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#Keys">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Keys"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#IDictionary#IsFixedSize">
- <summary>
- See <see cref="P:System.Collections.IDictionary.IsFixedSize"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#ICollection#IsSynchronized">
- <summary>
- See <see cref="P:System.Collections.ICollection.IsSynchronized"/>
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.Count">
- <summary>
- The number of properties in this collection
- </summary>
- </member>
- <member name="P:log4net.Util.ReadOnlyPropertiesDictionary.System#Collections#ICollection#SyncRoot">
- <summary>
- See <see cref="P:System.Collections.ICollection.SyncRoot"/>
- </summary>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.PropertiesDictionary"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.#ctor(log4net.Util.ReadOnlyPropertiesDictionary)">
- <summary>
- Constructor
- </summary>
- <param name="propertiesDictionary">properties to copy</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.PropertiesDictionary"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.PropertiesDictionary"/> class
- with serialized data.
- </summary>
- <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo"/> that holds the serialized object data.</param>
- <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext"/> that contains contextual information about the source or destination.</param>
- <remarks>
- <para>
- Because this class is sealed the serialization constructor is private.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.Remove(System.String)">
- <summary>
- Remove the entry with the specified key from this dictionary
- </summary>
- <param name="key">the key for the entry to remove</param>
- <remarks>
- <para>
- Remove the entry with the specified key from this dictionary
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#GetEnumerator">
- <summary>
- See <see cref="M:System.Collections.IDictionary.GetEnumerator"/>
- </summary>
- <returns>an enumerator</returns>
- <remarks>
- <para>
- Returns a <see cref="T:System.Collections.IDictionaryEnumerator"/> over the contest of this collection.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Remove(System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Remove(System.Object)"/>
- </summary>
- <param name="key">the key to remove</param>
- <remarks>
- <para>
- Remove the entry with the specified key from this dictionary
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Contains(System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Contains(System.Object)"/>
- </summary>
- <param name="key">the key to lookup in the collection</param>
- <returns><c>true</c> if the collection contains the specified key</returns>
- <remarks>
- <para>
- Test if this collection contains a specified key.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.Clear">
- <summary>
- Remove all properties from the properties collection
- </summary>
- <remarks>
- <para>
- Remove all properties from the properties collection
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Add(System.Object,System.Object)">
- <summary>
- See <see cref="M:System.Collections.IDictionary.Add(System.Object,System.Object)"/>
- </summary>
- <param name="key">the key</param>
- <param name="value">the value to store for the key</param>
- <remarks>
- <para>
- Store a value for the specified <see cref="T:System.String"/> <paramref name="key"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentException">Thrown if the <paramref name="key"/> is not a string</exception>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#ICollection#CopyTo(System.Array,System.Int32)">
- <summary>
- See <see cref="M:System.Collections.ICollection.CopyTo(System.Array,System.Int32)"/>
- </summary>
- <param name="array"></param>
- <param name="index"></param>
- </member>
- <member name="M:log4net.Util.PropertiesDictionary.System#Collections#IEnumerable#GetEnumerator">
- <summary>
- See <see cref="M:System.Collections.IEnumerable.GetEnumerator"/>
- </summary>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.Item(System.String)">
- <summary>
- Gets or sets the value of the property with the specified key.
- </summary>
- <value>
- The value of the property with the specified key.
- </value>
- <param name="key">The key of the property to get or set.</param>
- <remarks>
- <para>
- The property value will only be serialized if it is serializable.
- If it cannot be serialized it will be silently ignored if
- a serialization operation is performed.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#IsReadOnly">
- <summary>
- See <see cref="P:System.Collections.IDictionary.IsReadOnly"/>
- </summary>
- <value>
- <c>false</c>
- </value>
- <remarks>
- <para>
- This collection is modifiable. This property always
- returns <c>false</c>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Item(System.Object)">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Item(System.Object)"/>
- </summary>
- <value>
- The value for the key specified.
- </value>
- <remarks>
- <para>
- Get or set a value for the specified <see cref="T:System.String"/> <paramref name="key"/>.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentException">Thrown if the <paramref name="key"/> is not a string</exception>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Values">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Values"/>
- </summary>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#Keys">
- <summary>
- See <see cref="P:System.Collections.IDictionary.Keys"/>
- </summary>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#IDictionary#IsFixedSize">
- <summary>
- See <see cref="P:System.Collections.IDictionary.IsFixedSize"/>
- </summary>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#ICollection#IsSynchronized">
- <summary>
- See <see cref="P:System.Collections.ICollection.IsSynchronized"/>
- </summary>
- </member>
- <member name="P:log4net.Util.PropertiesDictionary.System#Collections#ICollection#SyncRoot">
- <summary>
- See <see cref="P:System.Collections.ICollection.SyncRoot"/>
- </summary>
- </member>
- <member name="T:log4net.Util.ProtectCloseTextWriter">
- <summary>
- A <see cref="T:System.IO.TextWriter"/> that ignores the <see cref="M:log4net.Util.ProtectCloseTextWriter.Close"/> message
- </summary>
- <remarks>
- <para>
- This writer is used in special cases where it is necessary
- to protect a writer from being closed by a client.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.ProtectCloseTextWriter.#ctor(System.IO.TextWriter)">
- <summary>
- Constructor
- </summary>
- <param name="writer">the writer to actually write to</param>
- <remarks>
- <para>
- Create a new ProtectCloseTextWriter using a writer
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ProtectCloseTextWriter.Attach(System.IO.TextWriter)">
- <summary>
- Attach this instance to a different underlying <see cref="T:System.IO.TextWriter"/>
- </summary>
- <param name="writer">the writer to attach to</param>
- <remarks>
- <para>
- Attach this instance to a different underlying <see cref="T:System.IO.TextWriter"/>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ProtectCloseTextWriter.Close">
- <summary>
- Does not close the underlying output writer.
- </summary>
- <remarks>
- <para>
- Does not close the underlying output writer.
- This method does nothing.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ReaderWriterLock">
- <summary>
- Defines a lock that supports single writers and multiple readers
- </summary>
- <remarks>
- <para>
- <c>ReaderWriterLock</c> is used to synchronize access to a resource.
- At any given time, it allows either concurrent read access for
- multiple threads, or write access for a single thread. In a
- situation where a resource is changed infrequently, a
- <c>ReaderWriterLock</c> provides better throughput than a simple
- one-at-a-time lock, such as <see cref="T:System.Threading.Monitor"/>.
- </para>
- <para>
- If a platform does not support a <c>System.Threading.ReaderWriterLock</c>
- implementation then all readers and writers are serialized. Therefore
- the caller must not rely on multiple simultaneous readers.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.ReaderWriterLock.#ctor">
- <summary>
- Constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ReaderWriterLock"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReaderWriterLock.AcquireReaderLock">
- <summary>
- Acquires a reader lock
- </summary>
- <remarks>
- <para>
- <see cref="M:log4net.Util.ReaderWriterLock.AcquireReaderLock"/> blocks if a different thread has the writer
- lock, or if at least one thread is waiting for the writer lock.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReaderWriterLock.ReleaseReaderLock">
- <summary>
- Decrements the lock count
- </summary>
- <remarks>
- <para>
- <see cref="M:log4net.Util.ReaderWriterLock.ReleaseReaderLock"/> decrements the lock count. When the count
- reaches zero, the lock is released.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReaderWriterLock.AcquireWriterLock">
- <summary>
- Acquires the writer lock
- </summary>
- <remarks>
- <para>
- This method blocks if another thread has a reader lock or writer lock.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReaderWriterLock.ReleaseWriterLock">
- <summary>
- Decrements the lock count on the writer lock
- </summary>
- <remarks>
- <para>
- ReleaseWriterLock decrements the writer lock count.
- When the count reaches zero, the writer lock is released.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ReusableStringWriter">
- <summary>
- A <see cref="T:System.IO.StringWriter"/> that can be <see cref="M:log4net.Util.ReusableStringWriter.Reset(System.Int32,System.Int32)"/> and reused
- </summary>
- <remarks>
- <para>
- A <see cref="T:System.IO.StringWriter"/> that can be <see cref="M:log4net.Util.ReusableStringWriter.Reset(System.Int32,System.Int32)"/> and reused.
- This uses a single buffer for string operations.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.ReusableStringWriter.#ctor(System.IFormatProvider)">
- <summary>
- Create an instance of <see cref="T:log4net.Util.ReusableStringWriter"/>
- </summary>
- <param name="formatProvider">the format provider to use</param>
- <remarks>
- <para>
- Create an instance of <see cref="T:log4net.Util.ReusableStringWriter"/>
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReusableStringWriter.Dispose(System.Boolean)">
- <summary>
- Override Dispose to prevent closing of writer
- </summary>
- <param name="disposing">flag</param>
- <remarks>
- <para>
- Override Dispose to prevent closing of writer
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ReusableStringWriter.Reset(System.Int32,System.Int32)">
- <summary>
- Reset this string writer so that it can be reused.
- </summary>
- <param name="maxCapacity">the maximum buffer capacity before it is trimmed</param>
- <param name="defaultSize">the default size to make the buffer</param>
- <remarks>
- <para>
- Reset this string writer so that it can be reused.
- The internal buffers are cleared and reset.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.SystemInfo">
- <summary>
- Utility class for system specific information.
- </summary>
- <remarks>
- <para>
- Utility class of static methods for system specific information.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- <author>Alexey Solofnenko</author>
- </member>
- <member name="M:log4net.Util.SystemInfo.#ctor">
- <summary>
- Private constructor to prevent instances.
- </summary>
- <remarks>
- <para>
- Only static methods are exposed from this type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.#cctor">
- <summary>
- Initialize default values for private static fields.
- </summary>
- <remarks>
- <para>
- Only static methods are exposed from this type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.AssemblyLocationInfo(System.Reflection.Assembly)">
- <summary>
- Gets the assembly location path for the specified assembly.
- </summary>
- <param name="myAssembly">The assembly to get the location for.</param>
- <returns>The location of the assembly.</returns>
- <remarks>
- <para>
- This method does not guarantee to return the correct path
- to the assembly. If only tries to give an indication as to
- where the assembly was loaded from.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.AssemblyQualifiedName(System.Type)">
- <summary>
- Gets the fully qualified name of the <see cref="T:System.Type"/>, including
- the name of the assembly from which the <see cref="T:System.Type"/> was
- loaded.
- </summary>
- <param name="type">The <see cref="T:System.Type"/> to get the fully qualified name for.</param>
- <returns>The fully qualified name for the <see cref="T:System.Type"/>.</returns>
- <remarks>
- <para>
- This is equivalent to the <c>Type.AssemblyQualifiedName</c> property,
- but this method works on the .NET Compact Framework 1.0 as well as
- the full .NET runtime.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.AssemblyShortName(System.Reflection.Assembly)">
- <summary>
- Gets the short name of the <see cref="T:System.Reflection.Assembly"/>.
- </summary>
- <param name="myAssembly">The <see cref="T:System.Reflection.Assembly"/> to get the name for.</param>
- <returns>The short name of the <see cref="T:System.Reflection.Assembly"/>.</returns>
- <remarks>
- <para>
- The short name of the assembly is the <see cref="P:System.Reflection.Assembly.FullName"/>
- without the version, culture, or public key. i.e. it is just the
- assembly's file name without the extension.
- </para>
- <para>
- Use this rather than <c>Assembly.GetName().Name</c> because that
- is not available on the Compact Framework.
- </para>
- <para>
- Because of a FileIOPermission security demand we cannot do
- the obvious Assembly.GetName().Name. We are allowed to get
- the <see cref="P:System.Reflection.Assembly.FullName"/> of the assembly so we
- start from there and strip out just the assembly name.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.AssemblyFileName(System.Reflection.Assembly)">
- <summary>
- Gets the file name portion of the <see cref="T:System.Reflection.Assembly"/>, including the extension.
- </summary>
- <param name="myAssembly">The <see cref="T:System.Reflection.Assembly"/> to get the file name for.</param>
- <returns>The file name of the assembly.</returns>
- <remarks>
- <para>
- Gets the file name portion of the <see cref="T:System.Reflection.Assembly"/>, including the extension.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.GetTypeFromString(System.Type,System.String,System.Boolean,System.Boolean)">
- <summary>
- Loads the type specified in the type string.
- </summary>
- <param name="relativeType">A sibling type to use to load the type.</param>
- <param name="typeName">The name of the type to load.</param>
- <param name="throwOnError">Flag set to <c>true</c> to throw an exception if the type cannot be loaded.</param>
- <param name="ignoreCase"><c>true</c> to ignore the case of the type name; otherwise, <c>false</c></param>
- <returns>The type loaded or <c>null</c> if it could not be loaded.</returns>
- <remarks>
- <para>
- If the type name is fully qualified, i.e. if contains an assembly name in
- the type name, the type will be loaded from the system using
- <see cref="M:System.Type.GetType(System.String,System.Boolean)"/>.
- </para>
- <para>
- If the type name is not fully qualified, it will be loaded from the assembly
- containing the specified relative type. If the type is not found in the assembly
- then all the loaded assemblies will be searched for the type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.GetTypeFromString(System.String,System.Boolean,System.Boolean)">
- <summary>
- Loads the type specified in the type string.
- </summary>
- <param name="typeName">The name of the type to load.</param>
- <param name="throwOnError">Flag set to <c>true</c> to throw an exception if the type cannot be loaded.</param>
- <param name="ignoreCase"><c>true</c> to ignore the case of the type name; otherwise, <c>false</c></param>
- <returns>The type loaded or <c>null</c> if it could not be loaded.</returns>
- <remarks>
- <para>
- If the type name is fully qualified, i.e. if contains an assembly name in
- the type name, the type will be loaded from the system using
- <see cref="M:System.Type.GetType(System.String,System.Boolean)"/>.
- </para>
- <para>
- If the type name is not fully qualified it will be loaded from the
- assembly that is directly calling this method. If the type is not found
- in the assembly then all the loaded assemblies will be searched for the type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.GetTypeFromString(System.Reflection.Assembly,System.String,System.Boolean,System.Boolean)">
- <summary>
- Loads the type specified in the type string.
- </summary>
- <param name="relativeAssembly">An assembly to load the type from.</param>
- <param name="typeName">The name of the type to load.</param>
- <param name="throwOnError">Flag set to <c>true</c> to throw an exception if the type cannot be loaded.</param>
- <param name="ignoreCase"><c>true</c> to ignore the case of the type name; otherwise, <c>false</c></param>
- <returns>The type loaded or <c>null</c> if it could not be loaded.</returns>
- <remarks>
- <para>
- If the type name is fully qualified, i.e. if contains an assembly name in
- the type name, the type will be loaded from the system using
- <see cref="M:System.Type.GetType(System.String,System.Boolean)"/>.
- </para>
- <para>
- If the type name is not fully qualified it will be loaded from the specified
- assembly. If the type is not found in the assembly then all the loaded assemblies
- will be searched for the type.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.NewGuid">
- <summary>
- Generate a new guid
- </summary>
- <returns>A new Guid</returns>
- <remarks>
- <para>
- Generate a new guid
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.CreateArgumentOutOfRangeException(System.String,System.Object,System.String)">
- <summary>
- Create an <see cref="T:System.ArgumentOutOfRangeException"/>
- </summary>
- <param name="parameterName">The name of the parameter that caused the exception</param>
- <param name="actualValue">The value of the argument that causes this exception</param>
- <param name="message">The message that describes the error</param>
- <returns>the ArgumentOutOfRangeException object</returns>
- <remarks>
- <para>
- Create a new instance of the <see cref="T:System.ArgumentOutOfRangeException"/> class
- with a specified error message, the parameter name, and the value
- of the argument.
- </para>
- <para>
- The Compact Framework does not support the 3 parameter constructor for the
- <see cref="T:System.ArgumentOutOfRangeException"/> type. This method provides an
- implementation that works for all platforms.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.TryParse(System.String,System.Int32@)">
- <summary>
- Parse a string into an <see cref="T:System.Int32"/> value
- </summary>
- <param name="s">the string to parse</param>
- <param name="val">out param where the parsed value is placed</param>
- <returns><c>true</c> if the string was able to be parsed into an integer</returns>
- <remarks>
- <para>
- Attempts to parse the string into an integer. If the string cannot
- be parsed then this method returns <c>false</c>. The method does not throw an exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.TryParse(System.String,System.Int64@)">
- <summary>
- Parse a string into an <see cref="T:System.Int64"/> value
- </summary>
- <param name="s">the string to parse</param>
- <param name="val">out param where the parsed value is placed</param>
- <returns><c>true</c> if the string was able to be parsed into an integer</returns>
- <remarks>
- <para>
- Attempts to parse the string into an integer. If the string cannot
- be parsed then this method returns <c>false</c>. The method does not throw an exception.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.GetAppSetting(System.String)">
- <summary>
- Lookup an application setting
- </summary>
- <param name="key">the application settings key to lookup</param>
- <returns>the value for the key, or <c>null</c></returns>
- <remarks>
- <para>
- Configuration APIs are not supported under the Compact Framework
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.ConvertToFullPath(System.String)">
- <summary>
- Convert a path into a fully qualified local file path.
- </summary>
- <param name="path">The path to convert.</param>
- <returns>The fully qualified path.</returns>
- <remarks>
- <para>
- Converts the path specified to a fully
- qualified path. If the path is relative it is
- taken as relative from the application base
- directory.
- </para>
- <para>
- The path specified must be a local file path, a URI is not supported.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemInfo.CreateCaseInsensitiveHashtable">
- <summary>
- Creates a new case-insensitive instance of the <see cref="T:System.Collections.Hashtable"/> class with the default initial capacity.
- </summary>
- <returns>A new case-insensitive instance of the <see cref="T:System.Collections.Hashtable"/> class with the default initial capacity</returns>
- <remarks>
- <para>
- The new Hashtable instance uses the default load factor, the CaseInsensitiveHashCodeProvider, and the CaseInsensitiveComparer.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.SystemInfo.EmptyTypes">
- <summary>
- Gets an empty array of types.
- </summary>
- <remarks>
- <para>
- The <c>Type.EmptyTypes</c> field is not available on
- the .NET Compact Framework 1.0.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.SystemInfo.s_hostName">
- <summary>
- Cache the host name for the current machine
- </summary>
- </member>
- <member name="F:log4net.Util.SystemInfo.s_appFriendlyName">
- <summary>
- Cache the application friendly name
- </summary>
- </member>
- <member name="F:log4net.Util.SystemInfo.s_nullText">
- <summary>
- Text to output when a <c>null</c> is encountered.
- </summary>
- </member>
- <member name="F:log4net.Util.SystemInfo.s_notAvailableText">
- <summary>
- Text to output when an unsupported feature is requested.
- </summary>
- </member>
- <member name="F:log4net.Util.SystemInfo.s_processStartTime">
- <summary>
- Start time for the current process.
- </summary>
- </member>
- <member name="P:log4net.Util.SystemInfo.NewLine">
- <summary>
- Gets the system dependent line terminator.
- </summary>
- <value>
- The system dependent line terminator.
- </value>
- <remarks>
- <para>
- Gets the system dependent line terminator.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.ApplicationBaseDirectory">
- <summary>
- Gets the base directory for this <see cref="T:System.AppDomain"/>.
- </summary>
- <value>The base directory path for the current <see cref="T:System.AppDomain"/>.</value>
- <remarks>
- <para>
- Gets the base directory for this <see cref="T:System.AppDomain"/>.
- </para>
- <para>
- The value returned may be either a local file path or a URI.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.ConfigurationFileLocation">
- <summary>
- Gets the path to the configuration file for the current <see cref="T:System.AppDomain"/>.
- </summary>
- <value>The path to the configuration file for the current <see cref="T:System.AppDomain"/>.</value>
- <remarks>
- <para>
- The .NET Compact Framework 1.0 does not have a concept of a configuration
- file. For this runtime, we use the entry assembly location as the root for
- the configuration file name.
- </para>
- <para>
- The value returned may be either a local file path or a URI.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.EntryAssemblyLocation">
- <summary>
- Gets the path to the file that first executed in the current <see cref="T:System.AppDomain"/>.
- </summary>
- <value>The path to the entry assembly.</value>
- <remarks>
- <para>
- Gets the path to the file that first executed in the current <see cref="T:System.AppDomain"/>.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.CurrentThreadId">
- <summary>
- Gets the ID of the current thread.
- </summary>
- <value>The ID of the current thread.</value>
- <remarks>
- <para>
- On the .NET framework, the <c>AppDomain.GetCurrentThreadId</c> method
- is used to obtain the thread ID for the current thread. This is the
- operating system ID for the thread.
- </para>
- <para>
- On the .NET Compact Framework 1.0 it is not possible to get the
- operating system thread ID for the current thread. The native method
- <c>GetCurrentThreadId</c> is implemented inline in a header file
- and cannot be called.
- </para>
- <para>
- On the .NET Framework 2.0 the <c>Thread.ManagedThreadId</c> is used as this
- gives a stable id unrelated to the operating system thread ID which may
- change if the runtime is using fibers.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.HostName">
- <summary>
- Get the host name or machine name for the current machine
- </summary>
- <value>
- The hostname or machine name
- </value>
- <remarks>
- <para>
- Get the host name or machine name for the current machine
- </para>
- <para>
- The host name (<see cref="M:System.Net.Dns.GetHostName"/>) or
- the machine name (<c>Environment.MachineName</c>) for
- the current machine, or if neither of these are available
- then <c>NOT AVAILABLE</c> is returned.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.ApplicationFriendlyName">
- <summary>
- Get this application's friendly name
- </summary>
- <value>
- The friendly name of this application as a string
- </value>
- <remarks>
- <para>
- If available the name of the application is retrieved from
- the <c>AppDomain</c> using <c>AppDomain.CurrentDomain.FriendlyName</c>.
- </para>
- <para>
- Otherwise the file name of the entry assembly is used.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.ProcessStartTime">
- <summary>
- Get the start time for the current process.
- </summary>
- <remarks>
- <para>
- This is the time at which the log4net library was loaded into the
- AppDomain. Due to reports of a hang in the call to <c>System.Diagnostics.Process.StartTime</c>
- this is not the start time for the current process.
- </para>
- <para>
- The log4net library should be loaded by an application early during its
- startup, therefore this start time should be a good approximation for
- the actual start time.
- </para>
- <para>
- Note that AppDomains may be loaded and unloaded within the
- same process without the process terminating, however this start time
- will be set per AppDomain.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.NullText">
- <summary>
- Text to output when a <c>null</c> is encountered.
- </summary>
- <remarks>
- <para>
- Use this value to indicate a <c>null</c> has been encountered while
- outputting a string representation of an item.
- </para>
- <para>
- The default value is <c>(null)</c>. This value can be overridden by specifying
- a value for the <c>log4net.NullText</c> appSetting in the application's
- .config file.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.SystemInfo.NotAvailableText">
- <summary>
- Text to output when an unsupported feature is requested.
- </summary>
- <remarks>
- <para>
- Use this value when an unsupported feature is requested.
- </para>
- <para>
- The default value is <c>NOT AVAILABLE</c>. This value can be overridden by specifying
- a value for the <c>log4net.NotAvailableText</c> appSetting in the application's
- .config file.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.SystemStringFormat">
- <summary>
- Utility class that represents a format string.
- </summary>
- <remarks>
- <para>
- Utility class that represents a format string.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.#ctor(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Initialise the <see cref="T:log4net.Util.SystemStringFormat"/>
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
- <param name="format">A <see cref="T:System.String"/> containing zero or more format items.</param>
- <param name="args">An <see cref="T:System.Object"/> array containing zero or more objects to format.</param>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.ToString">
- <summary>
- Format the string and arguments
- </summary>
- <returns>the formatted string</returns>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.StringFormat(System.IFormatProvider,System.String,System.Object[])">
- <summary>
- Replaces the format item in a specified <see cref="T:System.String"/> with the text equivalent
- of the value of a corresponding <see cref="T:System.Object"/> instance in a specified array.
- A specified parameter supplies culture-specific formatting information.
- </summary>
- <param name="provider">An <see cref="T:System.IFormatProvider"/> that supplies culture-specific formatting information.</param>
- <param name="format">A <see cref="T:System.String"/> containing zero or more format items.</param>
- <param name="args">An <see cref="T:System.Object"/> array containing zero or more objects to format.</param>
- <returns>
- A copy of format in which the format items have been replaced by the <see cref="T:System.String"/>
- equivalent of the corresponding instances of <see cref="T:System.Object"/> in args.
- </returns>
- <remarks>
- <para>
- This method does not throw exceptions. If an exception thrown while formatting the result the
- exception and arguments are returned in the result string.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.StringFormatError(System.Exception,System.String,System.Object[])">
- <summary>
- Process an error during StringFormat
- </summary>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.RenderArray(System.Array,System.Text.StringBuilder)">
- <summary>
- Dump the contents of an array into a string builder
- </summary>
- </member>
- <member name="M:log4net.Util.SystemStringFormat.RenderObject(System.Object,System.Text.StringBuilder)">
- <summary>
- Dump an object to a string
- </summary>
- </member>
- <member name="T:log4net.Util.ThreadContextProperties">
- <summary>
- Implementation of Properties collection for the <see cref="T:log4net.ThreadContext"/>
- </summary>
- <remarks>
- <para>
- Class implements a collection of properties that is specific to each thread.
- The class is not synchronized as each thread has its own <see cref="T:log4net.Util.PropertiesDictionary"/>.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.ThreadContextProperties.s_threadLocalSlot">
- <summary>
- The thread local data slot to use to store a PropertiesDictionary.
- </summary>
- </member>
- <member name="M:log4net.Util.ThreadContextProperties.#ctor">
- <summary>
- Internal constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ThreadContextProperties"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextProperties.Remove(System.String)">
- <summary>
- Remove a property
- </summary>
- <param name="key">the key for the entry to remove</param>
- <remarks>
- <para>
- Remove a property
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextProperties.Clear">
- <summary>
- Clear all properties
- </summary>
- <remarks>
- <para>
- Clear all properties
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextProperties.GetProperties(System.Boolean)">
- <summary>
- Get the <c>PropertiesDictionary</c> for this thread.
- </summary>
- <param name="create">create the dictionary if it does not exist, otherwise return null if is does not exist</param>
- <returns>the properties for this thread</returns>
- <remarks>
- <para>
- The collection returned is only to be used on the calling thread. If the
- caller needs to share the collection between different threads then the
- caller must clone the collection before doing so.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextProperties.Item(System.String)">
- <summary>
- Gets or sets the value of a property
- </summary>
- <value>
- The value for the property with the specified key
- </value>
- <remarks>
- <para>
- Gets or sets the value of a property
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ThreadContextStack">
- <summary>
- Implementation of Stack for the <see cref="T:log4net.ThreadContext"/>
- </summary>
- <remarks>
- <para>
- Implementation of Stack for the <see cref="T:log4net.ThreadContext"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="F:log4net.Util.ThreadContextStack.m_stack">
- <summary>
- The stack store.
- </summary>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.#ctor">
- <summary>
- Internal constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ThreadContextStack"/> class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.Clear">
- <summary>
- Clears all the contextual information held in this stack.
- </summary>
- <remarks>
- <para>
- Clears all the contextual information held in this stack.
- Only call this if you think that this tread is being reused after
- a previous call execution which may not have completed correctly.
- You do not need to use this method if you always guarantee to call
- the <see cref="M:System.IDisposable.Dispose"/> method of the <see cref="T:System.IDisposable"/>
- returned from <see cref="M:log4net.Util.ThreadContextStack.Push(System.String)"/> even in exceptional circumstances,
- for example by using the <c>using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message"))</c>
- syntax.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.Pop">
- <summary>
- Removes the top context from this stack.
- </summary>
- <returns>The message in the context that was removed from the top of this stack.</returns>
- <remarks>
- <para>
- Remove the top context from this stack, and return
- it to the caller. If this stack is empty then an
- empty string (not <see langword="null"/>) is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.Push(System.String)">
- <summary>
- Pushes a new context message into this stack.
- </summary>
- <param name="message">The new context message.</param>
- <returns>
- An <see cref="T:System.IDisposable"/> that can be used to clean up the context stack.
- </returns>
- <remarks>
- <para>
- Pushes a new context onto this stack. An <see cref="T:System.IDisposable"/>
- is returned that can be used to clean up this stack. This
- can be easily combined with the <c>using</c> keyword to scope the
- context.
- </para>
- </remarks>
- <example>Simple example of using the <c>Push</c> method with the <c>using</c> keyword.
- <code lang="C#">
- using(log4net.ThreadContext.Stacks["NDC"].Push("Stack_Message"))
- {
- log.Warn("This should have an ThreadContext Stack message");
- }
- </code>
- </example>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.GetFullMessage">
- <summary>
- Gets the current context information for this stack.
- </summary>
- <returns>The current context information.</returns>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.ToString">
- <summary>
- Gets the current context information for this stack.
- </summary>
- <returns>Gets the current context information</returns>
- <remarks>
- <para>
- Gets the current context information for this stack.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.log4net#Core#IFixingRequired#GetFixedObject">
- <summary>
- Get a portable version of this object
- </summary>
- <returns>the portable instance of this object</returns>
- <remarks>
- <para>
- Get a cross thread portable version of this object
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextStack.Count">
- <summary>
- The number of messages in the stack
- </summary>
- <value>
- The current number of messages in the stack
- </value>
- <remarks>
- <para>
- The current number of messages in the stack. That is
- the number of times <see cref="M:log4net.Util.ThreadContextStack.Push(System.String)"/> has been called
- minus the number of times <see cref="M:log4net.Util.ThreadContextStack.Pop"/> has been called.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextStack.InternalStack">
- <summary>
- Gets and sets the internal stack used by this <see cref="T:log4net.Util.ThreadContextStack"/>
- </summary>
- <value>The internal storage stack</value>
- <remarks>
- <para>
- This property is provided only to support backward compatability
- of the <see cref="T:log4net.NDC"/>. Tytpically the internal stack should not
- be modified.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ThreadContextStack.StackFrame">
- <summary>
- Inner class used to represent a single context frame in the stack.
- </summary>
- <remarks>
- <para>
- Inner class used to represent a single context frame in the stack.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.StackFrame.#ctor(System.String,log4net.Util.ThreadContextStack.StackFrame)">
- <summary>
- Constructor
- </summary>
- <param name="message">The message for this context.</param>
- <param name="parent">The parent context in the chain.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ThreadContextStack.StackFrame"/> class
- with the specified message and parent context.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextStack.StackFrame.Message">
- <summary>
- Get the message.
- </summary>
- <value>The message.</value>
- <remarks>
- <para>
- Get the message.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextStack.StackFrame.FullMessage">
- <summary>
- Gets the full text of the context down to the root level.
- </summary>
- <value>
- The full text of the context down to the root level.
- </value>
- <remarks>
- <para>
- Gets the full text of the context down to the root level.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ThreadContextStack.AutoPopStackFrame">
- <summary>
- Struct returned from the <see cref="M:log4net.Util.ThreadContextStack.Push(System.String)"/> method.
- </summary>
- <remarks>
- <para>
- This struct implements the <see cref="T:System.IDisposable"/> and is designed to be used
- with the <see langword="using"/> pattern to remove the stack frame at the end of the scope.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.ThreadContextStack.AutoPopStackFrame.m_frameStack">
- <summary>
- The ThreadContextStack internal stack
- </summary>
- </member>
- <member name="F:log4net.Util.ThreadContextStack.AutoPopStackFrame.m_frameDepth">
- <summary>
- The depth to trim the stack to when this instance is disposed
- </summary>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.AutoPopStackFrame.#ctor(System.Collections.Stack,System.Int32)">
- <summary>
- Constructor
- </summary>
- <param name="frameStack">The internal stack used by the ThreadContextStack.</param>
- <param name="frameDepth">The depth to return the stack to when this object is disposed.</param>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ThreadContextStack.AutoPopStackFrame"/> class with
- the specified stack and return depth.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.ThreadContextStack.AutoPopStackFrame.Dispose">
- <summary>
- Returns the stack to the correct depth.
- </summary>
- <remarks>
- <para>
- Returns the stack to the correct depth.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.ThreadContextStacks">
- <summary>
- Implementation of Stacks collection for the <see cref="T:log4net.ThreadContext"/>
- </summary>
- <remarks>
- <para>
- Implementation of Stacks collection for the <see cref="T:log4net.ThreadContext"/>
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.Util.ThreadContextStacks.#ctor(log4net.Util.ContextPropertiesBase)">
- <summary>
- Internal constructor
- </summary>
- <remarks>
- <para>
- Initializes a new instance of the <see cref="T:log4net.Util.ThreadContextStacks"/> class.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.ThreadContextStacks.Item(System.String)">
- <summary>
- Gets the named thread context stack
- </summary>
- <value>
- The named stack
- </value>
- <remarks>
- <para>
- Gets the named thread context stack
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.Transform">
- <summary>
- Utility class for transforming strings.
- </summary>
- <remarks>
- <para>
- Utility class for transforming strings.
- </para>
- </remarks>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.Util.Transform.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.Util.Transform"/> class.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.Transform.WriteEscapedXmlString(System.Xml.XmlWriter,System.String,System.String)">
- <summary>
- Write a string to an <see cref="T:System.Xml.XmlWriter"/>
- </summary>
- <param name="writer">the writer to write to</param>
- <param name="textData">the string to write</param>
- <param name="invalidCharReplacement">The string to replace non XML compliant chars with</param>
- <remarks>
- <para>
- The test is escaped either using XML escape entities
- or using CDATA sections.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.Transform.MaskXmlInvalidCharacters(System.String,System.String)">
- <summary>
- Replace invalid XML characters in text string
- </summary>
- <param name="textData">the XML text input string</param>
- <param name="mask">the string to use in place of invalid characters</param>
- <returns>A string that does not contain invalid XML characters.</returns>
- <remarks>
- <para>
- Certain Unicode code points are not allowed in the XML InfoSet, for
- details see: <a href="http://www.w3.org/TR/REC-xml/#charsets">http://www.w3.org/TR/REC-xml/#charsets</a>.
- </para>
- <para>
- This method replaces any illegal characters in the input string
- with the mask string specified.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.Transform.CountSubstrings(System.String,System.String)">
- <summary>
- Count the number of times that the substring occurs in the text
- </summary>
- <param name="text">the text to search</param>
- <param name="substring">the substring to find</param>
- <returns>the number of times the substring occurs in the text</returns>
- <remarks>
- <para>
- The substring is assumed to be non repeating within itself.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.WindowsSecurityContext">
- <summary>
- Impersonate a Windows Account
- </summary>
- <remarks>
- <para>
- This <see cref="T:log4net.Core.SecurityContext"/> impersonates a Windows account.
- </para>
- <para>
- How the impersonation is done depends on the value of <see cref="M:log4net.Util.WindowsSecurityContext.Impersonate(System.Object)"/>.
- This allows the context to either impersonate a set of user credentials specified
- using username, domain name and password or to revert to the process credentials.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.#ctor">
- <summary>
- Default constructor
- </summary>
- <remarks>
- <para>
- Default constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.ActivateOptions">
- <summary>
- Initialize the SecurityContext based on the options set.
- </summary>
- <remarks>
- <para>
- This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
- activation scheme. The <see cref="M:log4net.Util.WindowsSecurityContext.ActivateOptions"/> method must
- be called on this object after the configuration properties have
- been set. Until <see cref="M:log4net.Util.WindowsSecurityContext.ActivateOptions"/> is called this
- object is in an undefined state and must not be used.
- </para>
- <para>
- If any of the configuration properties are modified then
- <see cref="M:log4net.Util.WindowsSecurityContext.ActivateOptions"/> must be called again.
- </para>
- <para>
- The security context will try to Logon the specified user account and
- capture a primary token for impersonation.
- </para>
- </remarks>
- <exception cref="T:System.ArgumentNullException">The required <see cref="P:log4net.Util.WindowsSecurityContext.UserName"/>,
- <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> or <see cref="P:log4net.Util.WindowsSecurityContext.Password"/> properties were not specified.</exception>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.Impersonate(System.Object)">
- <summary>
- Impersonate the Windows account specified by the <see cref="P:log4net.Util.WindowsSecurityContext.UserName"/> and <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> properties.
- </summary>
- <param name="state">caller provided state</param>
- <returns>
- An <see cref="T:System.IDisposable"/> instance that will revoke the impersonation of this SecurityContext
- </returns>
- <remarks>
- <para>
- Depending on the <see cref="P:log4net.Util.WindowsSecurityContext.Credentials"/> property either
- impersonate a user using credentials supplied or revert
- to the process credentials.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.LogonUser(System.String,System.String,System.String)">
- <summary>
- Create a <see cref="T:System.Security.Principal.WindowsIdentity"/> given the userName, domainName and password.
- </summary>
- <param name="userName">the user name</param>
- <param name="domainName">the domain name</param>
- <param name="password">the password</param>
- <returns>the <see cref="T:System.Security.Principal.WindowsIdentity"/> for the account specified</returns>
- <remarks>
- <para>
- Uses the Windows API call LogonUser to get a principal token for the account. This
- token is used to initialize the WindowsIdentity.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.WindowsSecurityContext.Credentials">
- <summary>
- Gets or sets the impersonation mode for this security context
- </summary>
- <value>
- The impersonation mode for this security context
- </value>
- <remarks>
- <para>
- Impersonate either a user with user credentials or
- revert this thread to the credentials of the process.
- The value is one of the <see cref="T:log4net.Util.WindowsSecurityContext.ImpersonationMode"/>
- enum.
- </para>
- <para>
- The default value is <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User"/>
- </para>
- <para>
- When the mode is set to <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User"/>
- the user's credentials are established using the
- <see cref="P:log4net.Util.WindowsSecurityContext.UserName"/>, <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> and <see cref="P:log4net.Util.WindowsSecurityContext.Password"/>
- values.
- </para>
- <para>
- When the mode is set to <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.Process"/>
- no other properties need to be set. If the calling thread is
- impersonating then it will be reverted back to the process credentials.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.WindowsSecurityContext.UserName">
- <summary>
- Gets or sets the Windows username for this security context
- </summary>
- <value>
- The Windows username for this security context
- </value>
- <remarks>
- <para>
- This property must be set if <see cref="P:log4net.Util.WindowsSecurityContext.Credentials"/>
- is set to <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User"/> (the default setting).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.WindowsSecurityContext.DomainName">
- <summary>
- Gets or sets the Windows domain name for this security context
- </summary>
- <value>
- The Windows domain name for this security context
- </value>
- <remarks>
- <para>
- The default value for <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> is the local machine name
- taken from the <see cref="P:System.Environment.MachineName"/> property.
- </para>
- <para>
- This property must be set if <see cref="P:log4net.Util.WindowsSecurityContext.Credentials"/>
- is set to <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User"/> (the default setting).
- </para>
- </remarks>
- </member>
- <member name="P:log4net.Util.WindowsSecurityContext.Password">
- <summary>
- Sets the password for the Windows account specified by the <see cref="P:log4net.Util.WindowsSecurityContext.UserName"/> and <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> properties.
- </summary>
- <value>
- The password for the Windows account specified by the <see cref="P:log4net.Util.WindowsSecurityContext.UserName"/> and <see cref="P:log4net.Util.WindowsSecurityContext.DomainName"/> properties.
- </value>
- <remarks>
- <para>
- This property must be set if <see cref="P:log4net.Util.WindowsSecurityContext.Credentials"/>
- is set to <see cref="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User"/> (the default setting).
- </para>
- </remarks>
- </member>
- <member name="T:log4net.Util.WindowsSecurityContext.ImpersonationMode">
- <summary>
- The impersonation modes for the <see cref="T:log4net.Util.WindowsSecurityContext"/>
- </summary>
- <remarks>
- <para>
- See the <see cref="P:log4net.Util.WindowsSecurityContext.Credentials"/> property for
- details.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.User">
- <summary>
- Impersonate a user using the credentials supplied
- </summary>
- </member>
- <member name="F:log4net.Util.WindowsSecurityContext.ImpersonationMode.Process">
- <summary>
- Revert this the thread to the credentials of the process
- </summary>
- </member>
- <member name="T:log4net.Util.WindowsSecurityContext.DisposableImpersonationContext">
- <summary>
- Adds <see cref="T:System.IDisposable"/> to <see cref="T:System.Security.Principal.WindowsImpersonationContext"/>
- </summary>
- <remarks>
- <para>
- Helper class to expose the <see cref="T:System.Security.Principal.WindowsImpersonationContext"/>
- through the <see cref="T:System.IDisposable"/> interface.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.DisposableImpersonationContext.#ctor(System.Security.Principal.WindowsImpersonationContext)">
- <summary>
- Constructor
- </summary>
- <param name="impersonationContext">the impersonation context being wrapped</param>
- <remarks>
- <para>
- Constructor
- </para>
- </remarks>
- </member>
- <member name="M:log4net.Util.WindowsSecurityContext.DisposableImpersonationContext.Dispose">
- <summary>
- Revert the impersonation
- </summary>
- <remarks>
- <para>
- Revert the impersonation
- </para>
- </remarks>
- </member>
- <member name="T:log4net.GlobalContext">
- <summary>
- The log4net Global Context.
- </summary>
- <remarks>
- <para>
- The <c>GlobalContext</c> provides a location for global debugging
- information to be stored.
- </para>
- <para>
- The global context has a properties map and these properties can
- be included in the output of log messages. The <see cref="T:log4net.Layout.PatternLayout"/>
- supports selecting and outputing these properties.
- </para>
- <para>
- By default the <c>log4net:HostName</c> property is set to the name of
- the current machine.
- </para>
- </remarks>
- <example>
- <code lang="C#">
- GlobalContext.Properties["hostname"] = Environment.MachineName;
- </code>
- </example>
- <threadsafety static="true" instance="true"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.GlobalContext.#ctor">
- <summary>
- Private Constructor.
- </summary>
- <remarks>
- Uses a private access modifier to prevent instantiation of this class.
- </remarks>
- </member>
- <member name="F:log4net.GlobalContext.s_properties">
- <summary>
- The global context properties instance
- </summary>
- </member>
- <member name="P:log4net.GlobalContext.Properties">
- <summary>
- The global properties map.
- </summary>
- <value>
- The global properties map.
- </value>
- <remarks>
- <para>
- The global properties map.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.LogicalThreadContext">
- <summary>
- The log4net Logical Thread Context.
- </summary>
- <remarks>
- <para>
- The <c>LogicalThreadContext</c> provides a location for <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/> specific debugging
- information to be stored.
- The <c>LogicalThreadContext</c> properties override any <see cref="T:log4net.ThreadContext"/> or <see cref="T:log4net.GlobalContext"/>
- properties with the same name.
- </para>
- <para>
- The Logical Thread Context has a properties map and a stack.
- The properties and stack can
- be included in the output of log messages. The <see cref="T:log4net.Layout.PatternLayout"/>
- supports selecting and outputting these properties.
- </para>
- <para>
- The Logical Thread Context provides a diagnostic context for the current call context.
- This is an instrument for distinguishing interleaved log
- output from different sources. Log output is typically interleaved
- when a server handles multiple clients near-simultaneously.
- </para>
- <para>
- The Logical Thread Context is managed on a per <see cref="T:System.Runtime.Remoting.Messaging.CallContext"/> basis.
- </para>
- </remarks>
- <example>Example of using the thread context properties to store a username.
- <code lang="C#">
- LogicalThreadContext.Properties["user"] = userName;
- log.Info("This log message has a LogicalThreadContext Property called 'user'");
- </code>
- </example>
- <example>Example of how to push a message into the context stack
- <code lang="C#">
- using(LogicalThreadContext.Stacks["LDC"].Push("my context message"))
- {
- log.Info("This log message has a LogicalThreadContext Stack message that includes 'my context message'");
-
- } // at the end of the using block the message is automatically popped
- </code>
- </example>
- <threadsafety static="true" instance="true"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.LogicalThreadContext.#ctor">
- <summary>
- Private Constructor.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.LogicalThreadContext.s_properties">
- <summary>
- The thread context properties instance
- </summary>
- </member>
- <member name="F:log4net.LogicalThreadContext.s_stacks">
- <summary>
- The thread context stacks instance
- </summary>
- </member>
- <member name="P:log4net.LogicalThreadContext.Properties">
- <summary>
- The thread properties map
- </summary>
- <value>
- The thread properties map
- </value>
- <remarks>
- <para>
- The <c>LogicalThreadContext</c> properties override any <see cref="T:log4net.ThreadContext"/>
- or <see cref="T:log4net.GlobalContext"/> properties with the same name.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.LogicalThreadContext.Stacks">
- <summary>
- The thread stacks
- </summary>
- <value>
- stack map
- </value>
- <remarks>
- <para>
- The logical thread stacks.
- </para>
- </remarks>
- </member>
- <member name="T:log4net.LogManager">
- <summary>
- This class is used by client applications to request logger instances.
- </summary>
- <remarks>
- <para>
- This class has static methods that are used by a client to request
- a logger instance. The <see cref="M:log4net.LogManager.GetLogger(System.String)"/> method is
- used to retrieve a logger.
- </para>
- <para>
- See the <see cref="T:log4net.ILog"/> interface for more details.
- </para>
- </remarks>
- <example>Simple example of logging messages
- <code lang="C#">
- ILog log = LogManager.GetLogger("application-log");
-
- log.Info("Application Start");
- log.Debug("This is a debug message");
-
- if (log.IsDebugEnabled)
- {
- log.Debug("This is another debug message");
- }
- </code>
- </example>
- <threadsafety static="true" instance="true"/>
- <seealso cref="T:log4net.ILog"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.LogManager.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.LogManager"/> class.
- </summary>
- <remarks>
- Uses a private access modifier to prevent instantiation of this class.
- </remarks>
- </member>
- <member name="M:log4net.LogManager.Exists(System.String)">
- <overloads>Returns the named logger if it exists.</overloads>
- <summary>
- Returns the named logger if it exists.
- </summary>
- <remarks>
- <para>
- If the named logger exists (in the default repository) then it
- returns a reference to the logger, otherwise it returns <c>null</c>.
- </para>
- </remarks>
- <param name="name">The fully qualified logger name to look for.</param>
- <returns>The logger found, or <c>null</c> if no logger could be found.</returns>
- </member>
- <member name="M:log4net.LogManager.Exists(System.String,System.String)">
- <summary>
- Returns the named logger if it exists.
- </summary>
- <remarks>
- <para>
- If the named logger exists (in the specified repository) then it
- returns a reference to the logger, otherwise it returns
- <c>null</c>.
- </para>
- </remarks>
- <param name="repository">The repository to lookup in.</param>
- <param name="name">The fully qualified logger name to look for.</param>
- <returns>
- The logger found, or <c>null</c> if the logger doesn't exist in the specified
- repository.
- </returns>
- </member>
- <member name="M:log4net.LogManager.Exists(System.Reflection.Assembly,System.String)">
- <summary>
- Returns the named logger if it exists.
- </summary>
- <remarks>
- <para>
- If the named logger exists (in the repository for the specified assembly) then it
- returns a reference to the logger, otherwise it returns
- <c>null</c>.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <param name="name">The fully qualified logger name to look for.</param>
- <returns>
- The logger, or <c>null</c> if the logger doesn't exist in the specified
- assembly's repository.
- </returns>
- </member>
- <member name="M:log4net.LogManager.GetCurrentLoggers">
- <overloads>Get the currently defined loggers.</overloads>
- <summary>
- Returns all the currently defined loggers in the default repository.
- </summary>
- <remarks>
- <para>The root logger is <b>not</b> included in the returned array.</para>
- </remarks>
- <returns>All the defined loggers.</returns>
- </member>
- <member name="M:log4net.LogManager.GetCurrentLoggers(System.String)">
- <summary>
- Returns all the currently defined loggers in the specified repository.
- </summary>
- <param name="repository">The repository to lookup in.</param>
- <remarks>
- The root logger is <b>not</b> included in the returned array.
- </remarks>
- <returns>All the defined loggers.</returns>
- </member>
- <member name="M:log4net.LogManager.GetCurrentLoggers(System.Reflection.Assembly)">
- <summary>
- Returns all the currently defined loggers in the specified assembly's repository.
- </summary>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <remarks>
- The root logger is <b>not</b> included in the returned array.
- </remarks>
- <returns>All the defined loggers.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.String)">
- <overloads>Get or create a logger.</overloads>
- <summary>
- Retrieves or creates a named logger.
- </summary>
- <remarks>
- <para>
- Retrieves a logger named as the <paramref name="name"/>
- parameter. If the named logger already exists, then the
- existing instance will be returned. Otherwise, a new instance is
- created.
- </para>
- <para>By default, loggers do not have a set level but inherit
- it from the hierarchy. This is one of the central features of
- log4net.
- </para>
- </remarks>
- <param name="name">The name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.String,System.String)">
- <summary>
- Retrieves or creates a named logger.
- </summary>
- <remarks>
- <para>
- Retrieve a logger named as the <paramref name="name"/>
- parameter. If the named logger already exists, then the
- existing instance will be returned. Otherwise, a new instance is
- created.
- </para>
- <para>
- By default, loggers do not have a set level but inherit
- it from the hierarchy. This is one of the central features of
- log4net.
- </para>
- </remarks>
- <param name="repository">The repository to lookup in.</param>
- <param name="name">The name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.Reflection.Assembly,System.String)">
- <summary>
- Retrieves or creates a named logger.
- </summary>
- <remarks>
- <para>
- Retrieve a logger named as the <paramref name="name"/>
- parameter. If the named logger already exists, then the
- existing instance will be returned. Otherwise, a new instance is
- created.
- </para>
- <para>
- By default, loggers do not have a set level but inherit
- it from the hierarchy. This is one of the central features of
- log4net.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <param name="name">The name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.Type)">
- <summary>
- Shorthand for <see cref="M:log4net.LogManager.GetLogger(System.String)"/>.
- </summary>
- <remarks>
- Get the logger for the fully qualified name of the type specified.
- </remarks>
- <param name="type">The full name of <paramref name="type"/> will be used as the name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.String,System.Type)">
- <summary>
- Shorthand for <see cref="M:log4net.LogManager.GetLogger(System.String)"/>.
- </summary>
- <remarks>
- Gets the logger for the fully qualified name of the type specified.
- </remarks>
- <param name="repository">The repository to lookup in.</param>
- <param name="type">The full name of <paramref name="type"/> will be used as the name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLogger(System.Reflection.Assembly,System.Type)">
- <summary>
- Shorthand for <see cref="M:log4net.LogManager.GetLogger(System.String)"/>.
- </summary>
- <remarks>
- Gets the logger for the fully qualified name of the type specified.
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- <param name="type">The full name of <paramref name="type"/> will be used as the name of the logger to retrieve.</param>
- <returns>The logger with the name specified.</returns>
- </member>
- <member name="M:log4net.LogManager.Shutdown">
- <summary>
- Shuts down the log4net system.
- </summary>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in all the
- default repositories.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.LogManager.ShutdownRepository">
- <overloads>Shutdown a logger repository.</overloads>
- <summary>
- Shuts down the default repository.
- </summary>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in the
- default repository.
- </para>
- <para>Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.LogManager.ShutdownRepository(System.String)">
- <summary>
- Shuts down the repository for the repository specified.
- </summary>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in the
- <paramref name="repository"/> specified.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- <param name="repository">The repository to shutdown.</param>
- </member>
- <member name="M:log4net.LogManager.ShutdownRepository(System.Reflection.Assembly)">
- <summary>
- Shuts down the repository specified.
- </summary>
- <remarks>
- <para>
- Calling this method will <b>safely</b> close and remove all
- appenders in all the loggers including root contained in the
- repository. The repository is looked up using
- the <paramref name="repositoryAssembly"/> specified.
- </para>
- <para>
- Some appenders need to be closed before the application exists.
- Otherwise, pending logging events might be lost.
- </para>
- <para>
- The <c>shutdown</c> method is careful to close nested
- appenders before closing regular appenders. This is allows
- configurations where a regular appender is attached to a logger
- and again to a nested appender.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- </member>
- <member name="M:log4net.LogManager.ResetConfiguration">
- <overloads>Reset the configuration of a repository</overloads>
- <summary>
- Resets all values contained in this repository instance to their defaults.
- </summary>
- <remarks>
- <para>
- Resets all values contained in the repository instance to their
- defaults. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set to its default "off" value.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.LogManager.ResetConfiguration(System.String)">
- <summary>
- Resets all values contained in this repository instance to their defaults.
- </summary>
- <remarks>
- <para>
- Reset all values contained in the repository instance to their
- defaults. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set to its default "off" value.
- </para>
- </remarks>
- <param name="repository">The repository to reset.</param>
- </member>
- <member name="M:log4net.LogManager.ResetConfiguration(System.Reflection.Assembly)">
- <summary>
- Resets all values contained in this repository instance to their defaults.
- </summary>
- <remarks>
- <para>
- Reset all values contained in the repository instance to their
- defaults. This removes all appenders from all loggers, sets
- the level of all non-root loggers to <c>null</c>,
- sets their additivity flag to <c>true</c> and sets the level
- of the root logger to <see cref="F:log4net.Core.Level.Debug"/>. Moreover,
- message disabling is set to its default "off" value.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository to reset.</param>
- </member>
- <member name="M:log4net.LogManager.GetLoggerRepository">
- <overloads>Get the logger repository.</overloads>
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the callers assembly (<see cref="M:System.Reflection.Assembly.GetCallingAssembly"/>).
- </para>
- </remarks>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> instance for the default repository.</returns>
- </member>
- <member name="M:log4net.LogManager.GetLoggerRepository(System.String)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repository"/> argument.
- </para>
- </remarks>
- <param name="repository">The repository to lookup in.</param>
- </member>
- <member name="M:log4net.LogManager.GetLoggerRepository(System.Reflection.Assembly)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repositoryAssembly"/> argument.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- </member>
- <member name="M:log4net.LogManager.GetRepository">
- <overloads>Get a logger repository.</overloads>
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the callers assembly (<see cref="M:System.Reflection.Assembly.GetCallingAssembly"/>).
- </para>
- </remarks>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> instance for the default repository.</returns>
- </member>
- <member name="M:log4net.LogManager.GetRepository(System.String)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repository"/> argument.
- </para>
- </remarks>
- <param name="repository">The repository to lookup in.</param>
- </member>
- <member name="M:log4net.LogManager.GetRepository(System.Reflection.Assembly)">
- <summary>
- Returns the default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.
- </summary>
- <returns>The default <see cref="T:log4net.Repository.ILoggerRepository"/> instance.</returns>
- <remarks>
- <para>
- Gets the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified
- by the <paramref name="repositoryAssembly"/> argument.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to lookup the repository.</param>
- </member>
- <member name="M:log4net.LogManager.CreateDomain(System.Type)">
- <overloads>Create a domain</overloads>
- <summary>
- Creates a repository with the specified repository type.
- </summary>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.LogManager.GetRepository"/> will return
- the same repository instance.
- </para>
- </remarks>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- </member>
- <member name="M:log4net.LogManager.CreateRepository(System.Type)">
- <overloads>Create a logger repository.</overloads>
- <summary>
- Creates a repository with the specified repository type.
- </summary>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.LogManager.GetRepository"/> will return
- the same repository instance.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.LogManager.CreateDomain(System.String)">
- <summary>
- Creates a repository with the specified name.
- </summary>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- Creates the default type of <see cref="T:log4net.Repository.ILoggerRepository"/> which is a
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> object.
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <param name="repository">The name of the repository, this must be unique amongst repositories.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.LogManager.CreateRepository(System.String)">
- <summary>
- Creates a repository with the specified name.
- </summary>
- <remarks>
- <para>
- Creates the default type of <see cref="T:log4net.Repository.ILoggerRepository"/> which is a
- <see cref="T:log4net.Repository.Hierarchy.Hierarchy"/> object.
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <param name="repository">The name of the repository, this must be unique amongst repositories.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.LogManager.CreateDomain(System.String,System.Type)">
- <summary>
- Creates a repository with the specified name and repository type.
- </summary>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <param name="repository">The name of the repository, this must be unique to the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.LogManager.CreateRepository(System.String,System.Type)">
- <summary>
- Creates a repository with the specified name and repository type.
- </summary>
- <remarks>
- <para>
- The <paramref name="repository"/> name must be unique. Repositories cannot be redefined.
- An <see cref="T:System.Exception"/> will be thrown if the repository already exists.
- </para>
- </remarks>
- <param name="repository">The name of the repository, this must be unique to the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- <exception cref="T:log4net.Core.LogException">The specified repository already exists.</exception>
- </member>
- <member name="M:log4net.LogManager.CreateDomain(System.Reflection.Assembly,System.Type)">
- <summary>
- Creates a repository for the specified assembly and repository type.
- </summary>
- <remarks>
- <para>
- <b>CreateDomain is obsolete. Use CreateRepository instead of CreateDomain.</b>
- </para>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.LogManager.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to get the name of the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- </member>
- <member name="M:log4net.LogManager.CreateRepository(System.Reflection.Assembly,System.Type)">
- <summary>
- Creates a repository for the specified assembly and repository type.
- </summary>
- <remarks>
- <para>
- The <see cref="T:log4net.Repository.ILoggerRepository"/> created will be associated with the repository
- specified such that a call to <see cref="M:log4net.LogManager.GetRepository(System.Reflection.Assembly)"/> with the
- same assembly specified will return the same repository instance.
- </para>
- </remarks>
- <param name="repositoryAssembly">The assembly to use to get the name of the repository.</param>
- <param name="repositoryType">A <see cref="T:System.Type"/> that implements <see cref="T:log4net.Repository.ILoggerRepository"/>
- and has a no arg constructor. An instance of this type will be created to act
- as the <see cref="T:log4net.Repository.ILoggerRepository"/> for the repository specified.</param>
- <returns>The <see cref="T:log4net.Repository.ILoggerRepository"/> created for the repository.</returns>
- </member>
- <member name="M:log4net.LogManager.GetAllRepositories">
- <summary>
- Gets the list of currently defined repositories.
- </summary>
- <remarks>
- <para>
- Get an array of all the <see cref="T:log4net.Repository.ILoggerRepository"/> objects that have been created.
- </para>
- </remarks>
- <returns>An array of all the known <see cref="T:log4net.Repository.ILoggerRepository"/> objects.</returns>
- </member>
- <member name="M:log4net.LogManager.WrapLogger(log4net.Core.ILogger)">
- <summary>
- Looks up the wrapper object for the logger specified.
- </summary>
- <param name="logger">The logger to get the wrapper for.</param>
- <returns>The wrapper for the logger specified.</returns>
- </member>
- <member name="M:log4net.LogManager.WrapLoggers(log4net.Core.ILogger[])">
- <summary>
- Looks up the wrapper objects for the loggers specified.
- </summary>
- <param name="loggers">The loggers to get the wrappers for.</param>
- <returns>The wrapper objects for the loggers specified.</returns>
- </member>
- <member name="M:log4net.LogManager.WrapperCreationHandler(log4net.Core.ILogger)">
- <summary>
- Create the <see cref="T:log4net.Core.ILoggerWrapper"/> objects used by
- this manager.
- </summary>
- <param name="logger">The logger to wrap.</param>
- <returns>The wrapper for the logger specified.</returns>
- </member>
- <member name="F:log4net.LogManager.s_wrapperMap">
- <summary>
- The wrapper map to use to hold the <see cref="T:log4net.Core.LogImpl"/> objects.
- </summary>
- </member>
- <member name="T:log4net.MDC">
- <summary>
- Implementation of Mapped Diagnostic Contexts.
- </summary>
- <remarks>
- <note>
- <para>
- The MDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Properties"/>.
- The current MDC implementation forwards to the <c>ThreadContext.Properties</c>.
- </para>
- </note>
- <para>
- The MDC class is similar to the <see cref="T:log4net.NDC"/> class except that it is
- based on a map instead of a stack. It provides <i>mapped
- diagnostic contexts</i>. A <i>Mapped Diagnostic Context</i>, or
- MDC in short, is an instrument for distinguishing interleaved log
- output from different sources. Log output is typically interleaved
- when a server handles multiple clients near-simultaneously.
- </para>
- <para>
- The MDC is managed on a per thread basis.
- </para>
- </remarks>
- <threadsafety static="true" instance="true"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.MDC.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.MDC"/> class.
- </summary>
- <remarks>
- Uses a private access modifier to prevent instantiation of this class.
- </remarks>
- </member>
- <member name="M:log4net.MDC.Get(System.String)">
- <summary>
- Gets the context value identified by the <paramref name="key"/> parameter.
- </summary>
- <param name="key">The key to lookup in the MDC.</param>
- <returns>The string value held for the key, or a <c>null</c> reference if no corresponding value is found.</returns>
- <remarks>
- <note>
- <para>
- The MDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Properties"/>.
- The current MDC implementation forwards to the <c>ThreadContext.Properties</c>.
- </para>
- </note>
- <para>
- If the <paramref name="key"/> parameter does not look up to a
- previously defined context then <c>null</c> will be returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.MDC.Set(System.String,System.String)">
- <summary>
- Add an entry to the MDC
- </summary>
- <param name="key">The key to store the value under.</param>
- <param name="value">The value to store.</param>
- <remarks>
- <note>
- <para>
- The MDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Properties"/>.
- The current MDC implementation forwards to the <c>ThreadContext.Properties</c>.
- </para>
- </note>
- <para>
- Puts a context value (the <paramref name="val"/> parameter) as identified
- with the <paramref name="key"/> parameter into the current thread's
- context map.
- </para>
- <para>
- If a value is already defined for the <paramref name="key"/>
- specified then the value will be replaced. If the <paramref name="val"/>
- is specified as <c>null</c> then the key value mapping will be removed.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.MDC.Remove(System.String)">
- <summary>
- Removes the key value mapping for the key specified.
- </summary>
- <param name="key">The key to remove.</param>
- <remarks>
- <note>
- <para>
- The MDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Properties"/>.
- The current MDC implementation forwards to the <c>ThreadContext.Properties</c>.
- </para>
- </note>
- <para>
- Remove the specified entry from this thread's MDC
- </para>
- </remarks>
- </member>
- <member name="M:log4net.MDC.Clear">
- <summary>
- Clear all entries in the MDC
- </summary>
- <remarks>
- <note>
- <para>
- The MDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Properties"/>.
- The current MDC implementation forwards to the <c>ThreadContext.Properties</c>.
- </para>
- </note>
- <para>
- Remove all the entries from this thread's MDC
- </para>
- </remarks>
- </member>
- <member name="T:log4net.NDC">
- <summary>
- Implementation of Nested Diagnostic Contexts.
- </summary>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- A Nested Diagnostic Context, or NDC in short, is an instrument
- to distinguish interleaved log output from different sources. Log
- output is typically interleaved when a server handles multiple
- clients near-simultaneously.
- </para>
- <para>
- Interleaved log output can still be meaningful if each log entry
- from different contexts had a distinctive stamp. This is where NDCs
- come into play.
- </para>
- <para>
- Note that NDCs are managed on a per thread basis. The NDC class
- is made up of static methods that operate on the context of the
- calling thread.
- </para>
- </remarks>
- <example>How to push a message into the context
- <code lang="C#">
- using(NDC.Push("my context message"))
- {
- ... all log calls will have 'my context message' included ...
-
- } // at the end of the using block the message is automatically removed
- </code>
- </example>
- <threadsafety static="true" instance="true"/>
- <author>Nicko Cadell</author>
- <author>Gert Driesen</author>
- </member>
- <member name="M:log4net.NDC.#ctor">
- <summary>
- Initializes a new instance of the <see cref="T:log4net.NDC"/> class.
- </summary>
- <remarks>
- Uses a private access modifier to prevent instantiation of this class.
- </remarks>
- </member>
- <member name="M:log4net.NDC.Clear">
- <summary>
- Clears all the contextual information held on the current thread.
- </summary>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- Clears the stack of NDC data held on the current thread.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.NDC.CloneStack">
- <summary>
- Creates a clone of the stack of context information.
- </summary>
- <returns>A clone of the context info for this thread.</returns>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- The results of this method can be passed to the <see cref="M:log4net.NDC.Inherit(System.Collections.Stack)"/>
- method to allow child threads to inherit the context of their
- parent thread.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.NDC.Inherit(System.Collections.Stack)">
- <summary>
- Inherits the contextual information from another thread.
- </summary>
- <param name="stack">The context stack to inherit.</param>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- This thread will use the context information from the stack
- supplied. This can be used to initialize child threads with
- the same contextual information as their parent threads. These
- contexts will <b>NOT</b> be shared. Any further contexts that
- are pushed onto the stack will not be visible to the other.
- Call <see cref="M:log4net.NDC.CloneStack"/> to obtain a stack to pass to
- this method.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.NDC.Pop">
- <summary>
- Removes the top context from the stack.
- </summary>
- <returns>
- The message in the context that was removed from the top
- of the stack.
- </returns>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- Remove the top context from the stack, and return
- it to the caller. If the stack is empty then an
- empty string (not <c>null</c>) is returned.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.NDC.Push(System.String)">
- <summary>
- Pushes a new context message.
- </summary>
- <param name="message">The new context message.</param>
- <returns>
- An <see cref="T:System.IDisposable"/> that can be used to clean up
- the context stack.
- </returns>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- Pushes a new context onto the context stack. An <see cref="T:System.IDisposable"/>
- is returned that can be used to clean up the context stack. This
- can be easily combined with the <c>using</c> keyword to scope the
- context.
- </para>
- </remarks>
- <example>Simple example of using the <c>Push</c> method with the <c>using</c> keyword.
- <code lang="C#">
- using(log4net.NDC.Push("NDC_Message"))
- {
- log.Warn("This should have an NDC message");
- }
- </code>
- </example>
- </member>
- <member name="M:log4net.NDC.Remove">
- <summary>
- Removes the context information for this thread. It is
- not required to call this method.
- </summary>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- This method is not implemented.
- </para>
- </remarks>
- </member>
- <member name="M:log4net.NDC.SetMaxDepth(System.Int32)">
- <summary>
- Forces the stack depth to be at most <paramref name="maxDepth"/>.
- </summary>
- <param name="maxDepth">The maximum depth of the stack</param>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- Forces the stack depth to be at most <paramref name="maxDepth"/>.
- This may truncate the head of the stack. This only affects the
- stack in the current thread. Also it does not prevent it from
- growing, it only sets the maximum depth at the time of the
- call. This can be used to return to a known context depth.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.NDC.Depth">
- <summary>
- Gets the current context depth.
- </summary>
- <value>The current context depth.</value>
- <remarks>
- <note>
- <para>
- The NDC is deprecated and has been replaced by the <see cref="P:log4net.ThreadContext.Stacks"/>.
- The current NDC implementation forwards to the <c>ThreadContext.Stacks["NDC"]</c>.
- </para>
- </note>
- <para>
- The number of context values pushed onto the context stack.
- </para>
- <para>
- Used to record the current depth of the context. This can then
- be restored using the <see cref="M:log4net.NDC.SetMaxDepth(System.Int32)"/> method.
- </para>
- </remarks>
- <seealso cref="M:log4net.NDC.SetMaxDepth(System.Int32)"/>
- </member>
- <member name="T:log4net.ThreadContext">
- <summary>
- The log4net Thread Context.
- </summary>
- <remarks>
- <para>
- The <c>ThreadContext</c> provides a location for thread specific debugging
- information to be stored.
- The <c>ThreadContext</c> properties override any <see cref="T:log4net.GlobalContext"/>
- properties with the same name.
- </para>
- <para>
- The thread context has a properties map and a stack.
- The properties and stack can
- be included in the output of log messages. The <see cref="T:log4net.Layout.PatternLayout"/>
- supports selecting and outputting these properties.
- </para>
- <para>
- The Thread Context provides a diagnostic context for the current thread.
- This is an instrument for distinguishing interleaved log
- output from different sources. Log output is typically interleaved
- when a server handles multiple clients near-simultaneously.
- </para>
- <para>
- The Thread Context is managed on a per thread basis.
- </para>
- </remarks>
- <example>Example of using the thread context properties to store a username.
- <code lang="C#">
- ThreadContext.Properties["user"] = userName;
- log.Info("This log message has a ThreadContext Property called 'user'");
- </code>
- </example>
- <example>Example of how to push a message into the context stack
- <code lang="C#">
- using(ThreadContext.Stacks["NDC"].Push("my context message"))
- {
- log.Info("This log message has a ThreadContext Stack message that includes 'my context message'");
-
- } // at the end of the using block the message is automatically popped
- </code>
- </example>
- <threadsafety static="true" instance="true"/>
- <author>Nicko Cadell</author>
- </member>
- <member name="M:log4net.ThreadContext.#ctor">
- <summary>
- Private Constructor.
- </summary>
- <remarks>
- <para>
- Uses a private access modifier to prevent instantiation of this class.
- </para>
- </remarks>
- </member>
- <member name="F:log4net.ThreadContext.s_properties">
- <summary>
- The thread context properties instance
- </summary>
- </member>
- <member name="F:log4net.ThreadContext.s_stacks">
- <summary>
- The thread context stacks instance
- </summary>
- </member>
- <member name="P:log4net.ThreadContext.Properties">
- <summary>
- The thread properties map
- </summary>
- <value>
- The thread properties map
- </value>
- <remarks>
- <para>
- The <c>ThreadContext</c> properties override any <see cref="T:log4net.GlobalContext"/>
- properties with the same name.
- </para>
- </remarks>
- </member>
- <member name="P:log4net.ThreadContext.Stacks">
- <summary>
- The thread stacks
- </summary>
- <value>
- stack map
- </value>
- <remarks>
- <para>
- The thread local stacks.
- </para>
- </remarks>
- </member>
- </members>
-</doc>
diff --git a/M4-RCs/qpid/dotnet/client-010/lib/nunit/nunit-licence.txt b/M4-RCs/qpid/dotnet/client-010/lib/nunit/nunit-licence.txt
deleted file mode 100644
index e6275d834b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/lib/nunit/nunit-licence.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright © 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov,
- Charlie Poole
-Copyright © 2000-2004 Philip A. Craig
-
-This software is provided 'as-is', without any express or implied warranty. In
-no event will the authors be held liable for any damages arising from the use
-of this software.
-
-Permission is granted to anyone to use this software for any purpose, including
-commercial applications, and to alter it and redistribute it freely, subject to
-the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not claim
- that you wrote the original software. If you use this software in a product, an
- acknowledgment (see the following) in the product documentation is required.
-
- Portions Copyright © 2002 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov
- or Copyright © 2000-2002 Philip A. Craig
-
-2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
-
-3. This notice may not be removed or altered from any source distribution.
diff --git a/M4-RCs/qpid/dotnet/client-010/lib/nunit/nunit.framework.dll b/M4-RCs/qpid/dotnet/client-010/lib/nunit/nunit.framework.dll
deleted file mode 100644
index 53666e74c9..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/lib/nunit/nunit.framework.dll
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/client-010/lib/plossum/C5-License.txt b/M4-RCs/qpid/dotnet/client-010/lib/plossum/C5-License.txt
deleted file mode 100644
index e1c0876081..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/lib/plossum/C5-License.txt
+++ /dev/null
@@ -1,27 +0,0 @@
------------------------------------------------------------------------------
-
-The following license applies to the C5 library (found in C5.dll and C5.pdb)
-The source code for this library together with more information can be found on
-http://www.itu.dk/research/c5/.
-
------------------------------------------------------------------------------
-
-Copyright (c) 2003-2007 Niels Kokholm and Peter Sestoft.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/M4-RCs/qpid/dotnet/client-010/lib/plossum/C5.dll b/M4-RCs/qpid/dotnet/client-010/lib/plossum/C5.dll
deleted file mode 100644
index 08362849c9..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/lib/plossum/C5.dll
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/client-010/lib/plossum/Plossum CommandLine.dll b/M4-RCs/qpid/dotnet/client-010/lib/plossum/Plossum CommandLine.dll
deleted file mode 100644
index d3aad9485d..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/lib/plossum/Plossum CommandLine.dll
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/client-010/lib/plossum/license.txt b/M4-RCs/qpid/dotnet/client-010/lib/plossum/license.txt
deleted file mode 100644
index 714c2d8821..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/lib/plossum/license.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) Peter Palotas 2007
-
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the distribution.
- * Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/M4-RCs/qpid/dotnet/client-010/log.xml b/M4-RCs/qpid/dotnet/client-010/log.xml
deleted file mode 100644
index cda84d7c7b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/log.xml
+++ /dev/null
@@ -1,46 +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.
-
--->
-<log4net>
- <appender name="Console" type="log4net.Appender.ConsoleAppender">
- <layout type="log4net.Layout.PatternLayout">
- <!-- Pattern to output the caller's file name and line number -->
- <conversionPattern value="%5level [%thread] (%file:%line) - %message%newline" />
- </layout>
- </appender>
-
- <appender name="RollingFile" type="log4net.Appender.RollingFileAppender">
- <file value="logs/mylogfile.log" />
- <appendToFile value="true" />
- <maximumFileSize value="8192KB" />
- <maxSizeRollBackups value="2" />
-
- <layout type="log4net.Layout.PatternLayout">
- <conversionPattern value="%date [%thread] %-5level %ndc - %message%newline" />
- <!--<conversionPattern value="%level %thread %logger - %message%newline" />-->
- </layout>
- </appender>
-
- <root>
- <level value="DEBUG" />
- <appender-ref ref="Console" />
- <appender-ref ref="RollingFile" />
- </root>
-</log4net>
diff --git a/M4-RCs/qpid/dotnet/client-010/perftest/PerfTest.cs b/M4-RCs/qpid/dotnet/client-010/perftest/PerfTest.cs
deleted file mode 100644
index e7b1cb8ecd..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/perftest/PerfTest.cs
+++ /dev/null
@@ -1,705 +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;
-using System.Collections.Generic;
-using System.IO;
-using System.Text;
-using System.Threading;
-using common.org.apache.qpid.transport.util;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.util;
-using Plossum.CommandLine;
-
-namespace PerfTest
-{
- [CommandLineManager(ApplicationName = "Qpid Perf Tests", Copyright = "Apache Software Foundation")]
- public class Options
- {
- [CommandLineOption(Description = "Displays this help text")] public bool Help;
-
- [CommandLineOption(Description = "Create shared queues.", MinOccurs = 0)] public Boolean Setup;
-
- [CommandLineOption(Description = "Run test, print report.", MinOccurs = 0)] public Boolean Control;
-
- [CommandLineOption(Description = "Publish messages.", MinOccurs = 0)] public Boolean Publish;
-
- [CommandLineOption(Description = "Subscribe for messages.", MinOccurs = 0)] public Boolean Subscribe;
-
- [CommandLineOption(Description = "Test mode: [shared|fanout|topic]", MinOccurs = 0)]
- public string Mode
- {
- get { return _mMode; }
- set
- {
- if (! value.Equals("shared") && ! value.Equals("fanout") && ! value.Equals("topic"))
- throw new InvalidOptionValueException(
- "The mode must not be shared|fanout|topic", false);
- _mMode = value;
- }
- }
-
- private string _mMode = "shared";
-
- [CommandLineOption(Description = "Specifies the broler name", MinOccurs = 0)]
- public string Broker
- {
- get { return _broker; }
- set
- {
- if (String.IsNullOrEmpty(value))
- throw new InvalidOptionValueException(
- "The broker name must not be empty", false);
- _broker = value;
- }
- }
-
- private string _broker = "localhost";
-
- [CommandLineOption(Description = "Specifies the port name", MinOccurs = 0)]
- public int Port
- {
- get { return _port; }
- set { _port = value; }
- }
-
- private int _port = 5672;
-
- #region Publisher
-
- [CommandLineOption(Description = "Create N publishers.", MinOccurs = 0)]
- public int Pubs
- {
- get { return _pubs; }
- set { _pubs = value; }
- }
-
- private int _pubs = 1;
-
- [CommandLineOption(Description = "Each publisher sends N messages.", MinOccurs = 0)]
- public double Count
- {
- get { return _count; }
- set { _count = value; }
- }
-
- private double _count = 5000;
-
- [CommandLineOption(Description = "Size of messages in bytes.", MinOccurs = 0)]
- public long Size
- {
- get { return _size; }
- set { _size = value; }
- }
-
- private long _size = 1024;
-
- [CommandLineOption(Description = "Publisher use confirm-mode.", MinOccurs = 0)] public Boolean Confirm = true;
-
- [CommandLineOption(Description = "Publish messages as durable.", MinOccurs = 0)] public Boolean Durable;
-
- [CommandLineOption(Description = "Make data for each message unique.", MinOccurs = 0)] public Boolean UniqueData;
-
- [CommandLineOption(Description = "Wait for confirmation of each message before sending the next one.",
- MinOccurs = 0)] public Boolean SyncPub;
-
- [CommandLineOption(Description = ">=0 delay between msg publish.", MinOccurs = 0)]
- public double IntervalPub
- {
- get { return _interval_pub; }
- set { _interval_pub = value; }
- }
-
- private double _interval_pub;
-
- #endregion
-
- #region Subscriber
-
- [CommandLineOption(Description = "Create N subscribers.", MinOccurs = 0)]
- public int Subs
- {
- get { return _subs; }
- set { _subs = value; }
- }
-
- private int _subs = 1;
-
- [CommandLineOption(Description = "N>0: Subscriber acks batches of N.\n N==0: Subscriber uses unconfirmed mode",
- MinOccurs = 0)]
- public int SubAck
- {
- get { return _suback; }
- set { _suback = value; }
- }
-
- private int _suback;
-
- [CommandLineOption(Description = ">=0 delay between msg consume", MinOccurs = 0)]
- public double IntervalSub
- {
- get { return _interval_sub; }
- set { _interval_sub = value; }
- }
-
- private double _interval_sub;
-
- #endregion
-
- [CommandLineOption(Description = "Create N queues.", MinOccurs = 0)]
- public int Queues
- {
- get { return _qt; }
- set { _qt = value; }
- }
-
- private int _qt = 1;
-
- [CommandLineOption(Description = "Desired number of iterations of the test.", MinOccurs = 0)]
- public int Iterations
- {
- get { return _iterations; }
- set { _iterations = value; }
- }
-
- private int _iterations = 1;
-
- [CommandLineOption(Description = "If non-zero, the transaction batch size.", MinOccurs = 0)]
- public int Tx
- {
- get { return _tx; }
- set { _tx = value; }
- }
-
- private int _tx;
-
- [CommandLineOption(Description = "Make queue durable (implied if durable set.", MinOccurs = 0)] public Boolean
- QueueDurable;
-
- [CommandLineOption(Description = "Queue policy: count to trigger 'flow to disk'", MinOccurs = 0)]
- public double QueueMaxCount
- {
- get { return _queueMaxCount; }
- set { _queueMaxCount = value; }
- }
-
- private double _queueMaxCount;
-
- [CommandLineOption(Description = "Queue policy: accumulated size to trigger 'flow to disk'", MinOccurs = 0)]
- public double QueueMaxSize
- {
- get { return _queueMaxSize; }
- set { _queueMaxSize = value; }
- }
-
- private double _queueMaxSize;
-
- public double SubQuota
- {
- get { return _subQuota; }
- set { _subQuota = value; }
- }
-
- private double _subQuota;
- }
-
- internal interface Startable
- {
- void Start();
- }
-
- public abstract class PerfTestClient : Startable
- {
- private readonly Client _connection;
- private readonly ClientSession _session;
- private readonly Options _options;
-
- public ClientSession Session
- {
- get { return _session; }
- }
-
- public Options Options
- {
- get { return _options; }
- }
-
- protected PerfTestClient(Options options)
- {
- _options = options;
- _connection = new Client();
- _connection.connect(options.Broker, options.Port, "test", "guest", "guest");
- _session = _connection.createSession(50000);
- }
-
- public abstract void Start();
- }
-
- public class SetupTest : PerfTestClient
- {
- public SetupTest(Options options)
- : base(options)
- {
- }
-
- private void queueInit(String name, Boolean durable, Dictionary<String, Object> arguments)
- {
- Session.queueDeclare(name, null, arguments, durable ? Option.DURABLE : Option.NONE);
- Session.queuePurge(name);
- Session.exchangeBind(name, "amq.direct", name);
- Session.sync();
- }
-
- public override void Start()
- {
- queueInit("pub_start", false, null);
- queueInit("pub_done", false, null);
- queueInit("sub_ready", false, null);
- queueInit("sub_done", false, null);
- if (Options.Mode.Equals("shared"))
- {
- Dictionary<String, Object> settings = new Dictionary<string, object>();
- if (Options.QueueMaxCount > 0)
- settings.Add("qpid.max_count", Options.QueueMaxCount);
- if (Options.QueueMaxSize > 0)
- settings.Add("qpid.max_size", Options.QueueMaxSize);
- for (int i = 0; i < Options.Queues; ++i)
- {
- string qname = "perftest" + i;
- queueInit(qname, Options.Durable || Options.QueueDurable, settings);
- }
- }
- }
- }
-
- public class SubscribeThread : PerfTestClient
- {
- private readonly string _queue;
-
- public SubscribeThread(Options options, string key, string exchange)
- : base(options)
- {
- _queue = "perftest" + (new UUID(10, 10)).ToString();
- Session.queueDeclare(_queue, null, null, Option.EXCLUSIVE, Option.AUTO_DELETE,
- Options.Durable ? Option.DURABLE : Option.NONE);
- Session.exchangeBind(_queue, exchange, key);
- }
-
- public SubscribeThread(Options options, string key)
- : base(options)
- {
- _queue = key;
- }
-
- public override void Start()
- {
- if (Options.Tx > 0)
- {
- Session.txSelect();
- Session.sync();
- }
- CircularBuffer<IMessage> buffer = new CircularBuffer<IMessage>(100);
- // Create a listener and subscribe it to the queue named "message_queue"
- IMessageListener listener = new SyncListener(buffer);
- string dest = "dest" + UUID.randomUUID().ToString();
- Session.attachMessageListener(listener, dest);
- Session.messageSubscribe(_queue, dest,
- Options.Tx > 0 || Options.SubAck > 0
- ? MessageAcceptMode.EXPLICIT
- : MessageAcceptMode.NONE,
- MessageAcquireMode.PRE_ACQUIRED, null, 0, null);
- // issue credits
- Session.messageSetFlowMode(dest, MessageFlowMode.WINDOW);
- Session.messageFlow(dest, MessageCreditUnit.BYTE, ClientSession.MESSAGE_FLOW_MAX_BYTES);
-
- // Notify controller we are ready.
- IMessage message = new Message();
- message.DeliveryProperties.setRoutingKey("sub_ready");
-
- message.appendData(Encoding.UTF8.GetBytes("ready"));
- Session.messageTransfer("amq.direct", message);
-
- if (Options.Tx > 0)
- {
- Session.txCommit();
- Session.sync();
- }
-
-
- for (int j = 0; j < Options.Iterations; ++j)
- {
-
- //need to allocate some more credit
- Session.messageFlow(dest, MessageCreditUnit.MESSAGE, (long)Options.SubQuota);
-
- RangeSet range = new RangeSet();
- IMessage msg;
- DateTime start = DateTime.Now;
- for (long i = 0; i < Options.SubQuota; ++i)
- {
- msg = buffer.Dequeue();
- if (Options.Tx > 0 && ((i + 1)%Options.Tx == 0))
- {
- Session.txCommit();
- Session.sync();
- }
- if (Options.IntervalSub > 0)
- {
- Thread.Sleep((int) Options.IntervalSub*1000);
- }
- range.add(msg.Id);
- }
- if (Options.Tx > 0 || Options.SubAck > 0)
- Session.messageAccept(range);
- range.clear();
- if (Options.Tx > 0)
- {
- Session.txSelect();
- Session.sync();
- }
- DateTime end = DateTime.Now;
-
- // Report to publisher.
- message.DeliveryProperties.setRoutingKey("sub_done");
- message.clearData();
- message.appendData(BitConverter.GetBytes(Options.SubQuota / end.Subtract(start).TotalMilliseconds ));
- Session.messageTransfer("amq.direct", message);
- if (Options.Tx > 0)
- {
- Session.txSelect();
- Session.sync();
- }
- }
- Session.close();
- }
- }
-
- public class SyncListener : IMessageListener
- {
- private readonly CircularBuffer<IMessage> _buffer;
-
- public SyncListener(CircularBuffer<IMessage> buffer)
- {
- _buffer = buffer;
- }
-
- public void messageTransfer(IMessage m)
- {
- _buffer.Enqueue(m);
- }
- }
-
-
- public class PublishThread : PerfTestClient
- {
- private readonly string _exchange;
- private readonly string _key;
-
- public PublishThread(Options options, string key, string exchange)
- : base(options)
- {
- _key = key;
- _exchange = exchange;
- }
-
-
- public override void Start()
- {
- byte[] data = new byte[Options.Size];
- // randomly populate data
- Random r = new Random(34);
- r.NextBytes(data);
- IMessage message = new Message();
- message.appendData(data);
-
- message.DeliveryProperties.setRoutingKey(_key);
-
- if (Options.Durable)
- message.DeliveryProperties.setDeliveryMode(MessageDeliveryMode.PERSISTENT);
-
- if (Options.Tx > 0)
- {
- Session.txSelect();
- Session.sync();
- }
-
- CircularBuffer<IMessage> buffer = new CircularBuffer<IMessage>(100);
- // Create a listener and subscribe it to the queue named "pub_start"
- IMessageListener listener = new SyncListener(buffer);
- string localQueue = "localQueue-" + UUID.randomUUID().ToString();
- Session.queueDeclare(localQueue, null, null, Option.AUTO_DELETE);
- Session.exchangeBind(localQueue, "amq.direct", "pub_start");
- Session.attachMessageListener(listener, localQueue);
- Session.messageSubscribe(localQueue);
- if (Options.Tx > 0)
- {
- Session.txCommit();
- Session.sync();
- }
- buffer.Dequeue();
-
- for (int j = 0; j < Options.Iterations; ++j)
- {
- DateTime start = DateTime.Now;
- for (long i = 0; i < Options.Count; ++i)
- {
- Session.messageTransfer(_exchange, message);
-
- if (Options.SyncPub)
- {
- Session.sync();
- }
- if (Options.Tx > 0 && (i + 1)%Options.Tx == 0)
- {
- Session.txSelect();
- Session.sync();
- }
- if (Options.IntervalPub > 0)
- {
- Thread.Sleep((int) Options.IntervalSub*1000);
- }
- }
- Session.sync();
- DateTime end = DateTime.Now;
-
- // Report to publisher.
- message.DeliveryProperties.setRoutingKey("pub_done");
- message.clearData();
- double time = end.Subtract(start).TotalMilliseconds;
- byte[] rate = BitConverter.GetBytes( Options.Count / time );
- message.appendData(rate);
- Session.messageTransfer("amq.direct", message);
- if (Options.Tx > 0)
- {
- Session.txSelect();
- Session.sync();
- }
- }
- Session.close();
- }
- }
-
- public class Controller : PerfTestClient
- {
- public Controller(Options options)
- : base(options)
- {
- }
-
- private void process(int size, string queue)
- {
- CircularBuffer<IMessage> buffer = new CircularBuffer<IMessage>(100);
- IMessageListener listener = new SyncListener(buffer);
- string localQueue = "queue-" + UUID.randomUUID().ToString();
- Session.queueDeclare(localQueue, null, null, Option.AUTO_DELETE);
- Session.exchangeBind(localQueue, "amq.direct", queue);
- Session.attachMessageListener(listener, localQueue);
- Session.messageSubscribe(localQueue);
- for (int i = 0; i < size; ++i)
- {
- buffer.Dequeue();
- }
- }
-
- private double processRate(int size, string queue)
- {
- CircularBuffer<IMessage> buffer = new CircularBuffer<IMessage>(100);
- IMessageListener listener = new SyncListener(buffer);
- string localQueue = "queue-" + UUID.randomUUID().ToString();
- Session.queueDeclare(localQueue, null, null, Option.AUTO_DELETE);
- Session.exchangeBind(localQueue, "amq.direct", queue);
- Session.attachMessageListener(listener, localQueue);
- Session.messageSubscribe(localQueue);
- double rate = 0;
- RangeSet range = new RangeSet();
- for (int i = 0; i < size; ++i)
- {
- IMessage m = buffer.Dequeue();
- range.add(m.Id);
- BinaryReader reader = new BinaryReader(m.Body, Encoding.UTF8);
- byte[] body = new byte[m.Body.Length - m.Body.Position];
- reader.Read(body, 0, body.Length);
- rate += BitConverter.ToDouble(body,0);
- }
- Session.messageAccept(range);
- return rate;
- }
-
- private void send(int size, string queue, string data)
- {
- IMessage message = new Message();
- message.DeliveryProperties.setRoutingKey(queue);
- message.appendData(Encoding.UTF8.GetBytes(data));
- for (int i = 0; i < size; ++i)
- {
- Session.messageTransfer("amq.direct", message);
- }
- }
-
- public override void Start()
- {
- process(Options.Subs, "sub_ready");
- for (int j = 0; j < Options.Iterations; ++j)
- {
- DateTime start = DateTime.Now;
- send(Options.Pubs, "pub_start", "start"); // Start publishers
- double pubrate = processRate(Options.Pubs, "pub_done");
- double subrate = processRate(Options.Subs, "sub_done");
- DateTime end = DateTime.Now;
-
- double transfers = (Options.Pubs*Options.Count) + (Options.Subs*Options.SubQuota);
- double time = end.Subtract(start).TotalSeconds;
- double txrate = transfers/time;
- double mbytes = (txrate*Options.Size) / (1024 * 1024) ;
-
- Console.WriteLine("Total: " + transfers + " transfers of " + Options.Size + " bytes in "
- + time + " seconds.\n" +
- "Publish transfers/sec: " + pubrate * 1000 + "\n" +
- "Subscribe transfers/sec: " + subrate * 1000 + "\n" +
- "Total transfers/sec: " + txrate + "\n" +
- "Total Mbytes/sec: " + mbytes);
- Console.WriteLine("done");
- }
-
- }
- }
-
-
- public class PerfTest
- {
- private static int Main(string[] args)
- {
- Options options = new Options();
- CommandLineParser parser = new CommandLineParser(options);
- parser.Parse();
- if (parser.HasErrors)
- {
- Console.WriteLine(parser.UsageInfo.GetErrorsAsString(78));
- return -1;
- }
- if (options.Help)
- {
- Console.WriteLine(parser.UsageInfo.GetOptionsAsString(78));
- return 0;
- }
- bool singleProcess =
- (!options.Setup && !options.Control && !options.Publish && !options.Subscribe);
- if (singleProcess)
- {
- options.Setup = options.Control = options.Publish = true;
- options.Subscribe = true;
- }
-
-
- string exchange = "amq.direct";
- switch (options.Mode)
- {
- case "shared":
- options.SubQuota = (options.Pubs*options.Count)/options.Subs;
- break;
- case "fanout":
- options.SubQuota = (options.Pubs*options.Count);
- exchange = "amq.fanout";
- break;
- case "topic":
- options.SubQuota = (options.Pubs*options.Count);
- exchange = "amq.topic";
- break;
- }
-
- if (options.Setup)
- {
- SetupTest setup = new SetupTest(options);
- setup.Start(); // Set up queues
- }
-
- Thread contT = null;
- if ( options.Control)
- {
- Controller c = new Controller(options);
- contT = new Thread(c.Start);
- contT.Start();
- }
-
- Thread[] publishers = null;
- Thread[] subscribers = null;
-
- // Start pubs/subs for each queue/topic.
- for (int i = 0; i < options.Queues; ++i)
- {
- string key = "perftest" + i; // Queue or topic name.
- if (options.Publish)
- {
- int n = singleProcess ? options.Pubs : 1;
- publishers = new Thread[n];
- for (int j = 0; j < n; ++j)
- {
- PublishThread pt = new PublishThread(options, key, exchange);
- publishers[i] = new Thread(pt.Start);
- publishers[i].Start();
- }
- }
- if ( options.Subscribe)
- {
- int n = singleProcess ? options.Subs : 1;
- subscribers = new Thread[n];
- for (int j = 0; j < n; ++j)
- {
- SubscribeThread st;
- if (options.Mode.Equals("shared"))
- st = new SubscribeThread(options, key);
- else
- st = new SubscribeThread(options, key, exchange);
- subscribers[i] = new Thread(st.Start);
- subscribers[i].Start();
- }
- }
- }
-
- if (options.Control)
- {
- contT.Join();
- }
-
-
- // Wait for started threads.
- if (options.Publish)
- {
- foreach (Thread t in publishers)
- {
- t.Join();
- }
- }
-
- if (options.Subscribe)
- {
- foreach (Thread t in subscribers)
- {
- t.Join();
- }
- }
-
-
- return 0;
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/perftest/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/perftest/Properties/AssemblyInfo.cs
deleted file mode 100644
index 7fc98fbf38..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/perftest/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +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("perftest")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("perftest")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("11b542db-0d57-4a67-8b92-24ac1d4ed4cf")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/perftest/README.txt b/M4-RCs/qpid/dotnet/client-010/perftest/README.txt
deleted file mode 100644
index fadde27693..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/perftest/README.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-There are two ways to use perftest:
-- single process:
-If none of the -Setup, -Publish, -Subscribe or -Control options are given perftest will run a single-process test.
-- multi-process:
-For a multi-process test first run:
-Perftest.exe -Setup <other options>
-and wait for it to complete. The remaining process should run concurrently:
-Run -Pubs times: Perftest.exe -Publish <other options>
-Run -Subs times: Perftest.exe -Subscribe <other options>
-Run once: Perftest.exe -Control <other options>
-Note the <other options> must be identical for all processes.
-
-Options:
- -Broker Specifies the broler name
- -Confirm Publisher use confirm-mode.
- -Control Run test, print report.
- -Count Each publisher sends N messages.
- -Durable Publish messages as durable.
- -Help Displays this help text
- -IntervalPub >=0 delay between msg publish.
- -IntervalSub >=0 delay between msg consume
- -Iterations Desired number of iterations of the test.
- -Mode Test mode: [shared|fanout|topic]
- -Port Specifies the port name
- -Publish Publish messages.
- -Pubs Create N publishers.
- -QueueDurable Make queue durable (implied if durable set.
- -QueueMaxCount Queue policy: count to trigger 'flow to disk'
- -QueueMaxSize Queue policy: accumulated size to trigger 'flow to disk'
- -Queues Create N queues.
- -Setup Create shared queues.
- -Size Size of messages in bytes.
- -SubAck N>0: Subscriber acks batches of N. N==0: Subscriber uses unconfirmed mode
- -Subs Create N subscribers.
- -Subscribe Subscribe for messages.
- -SyncPub Wait for confirmation of each message before sending the next one.
- -Tx If non-zero, the transaction batch size.
- -UniqueData Make data for each message unique. \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/perftest/default.build b/M4-RCs/qpid/dotnet/client-010/perftest/default.build
deleted file mode 100644
index 756f6c6493..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/perftest/default.build
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="perftest" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="exe"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.exe">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/qpid.client.dll" />
- <include name="${build.dir}/C5.dll" />
- <include name="${build.dir}/Plossum CommandLine.dll" />
- </references>
- </csc>
- </target>
-
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/perftest/perftest.csproj b/M4-RCs/qpid/dotnet/client-010/perftest/perftest.csproj
deleted file mode 100644
index f8fa7aa27c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/perftest/perftest.csproj
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{7F7E8DE7-FDF2-4A52-A4CE-D3756B05273C}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>perftest</RootNamespace>
- <AssemblyName>perftest</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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="C5, Version=1.0.2.0, Culture=neutral, PublicKeyToken=06a1b38866503b69, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\plossum\C5.dll</HintPath>
- </Reference>
- <Reference Include="Plossum CommandLine, Version=0.3.0.14, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\plossum\Plossum CommandLine.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="PerfTest.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/test/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/test/Properties/AssemblyInfo.cs
deleted file mode 100644
index 26a40b1f77..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/Properties/AssemblyInfo.cs
+++ /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.
- *
- */
-
-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("Qpid Test")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Qpid Test")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("3d62cb4f-4353-4eed-9669-3e1bc902081d")]
-
-// 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 Revision and Build Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/test/Test.csproj b/M4-RCs/qpid/dotnet/client-010/test/Test.csproj
deleted file mode 100644
index e2680e16bc..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/Test.csproj
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>8.0.50727</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95CB4C90-7C53-44A9-B11C-96235F158ACA}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>test</RootNamespace>
- <AssemblyName>Qpid Test</AssemblyName>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>2.0</OldToolsVersion>
- <UpgradeBackupLocation>
- </UpgradeBackupLocation>
- </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="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\log4net\log4net.dll</HintPath>
- </Reference>
- <Reference Include="nunit.framework, Version=2.2.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\lib\nunit\nunit.framework.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="interop\Admin.cs" />
- <Compile Include="interop\ApplicationHeaders.cs" />
- <Compile Include="interop\Message.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="interop\TestCase.cs" />
- <Compile Include="transport\util\ByteEncoderTest.cs" />
- <Compile Include="transport\util\CircularBufferTest.cs" />
- <Compile Include="transport\util\ResultFutureTest.cs" />
- <Compile Include="transport\util\SerialTest.cs" />
- <Compile Include="transport\util\UUIDTest.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\client\Client.csproj">
- <Project>{B911FFD7-754F-4735-A188-218D5065BE79}</Project>
- <Name>Client</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\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/M4-RCs/qpid/dotnet/client-010/test/default.build b/M4-RCs/qpid/dotnet/client-010/test/default.build
deleted file mode 100644
index f9dadb174b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/default.build
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="qpid.client.tests" default="build">
- <!--
- Properties that come from master build file
- - build.dir: root directory for build
- - build.debug: true if building debug release
- - build.defines: variables to define during build
- -->
-
- <target name="build">
- <csc target="library"
- define="${build.defines}"
- debug="${build.debug}"
- output="${build.dir}/${project::get-name()}.dll">
-
- <sources>
- <include name="**/*.cs" />
- </sources>
- <references>
- <include name="${build.dir}/log4net.dll" />
- <include name="${build.dir}/nunit.framework.dll" />
- <include name="${build.dir}/qpid.client.dll" />
- </references>
- </csc>
- </target>
-
- <target name="test" depends="build">
- <nunit2>
- <formatter type="${nant.formatter}" usefile="false" />
- <test assemblyname="${build.dir}/qpid.client.tests.dll" />
- </nunit2>
- </target>
-</project>
-
diff --git a/M4-RCs/qpid/dotnet/client-010/test/interop/Admin.cs b/M4-RCs/qpid/dotnet/client-010/test/interop/Admin.cs
deleted file mode 100644
index 93b24ea505..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/interop/Admin.cs
+++ /dev/null
@@ -1,90 +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 NUnit.Framework;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.util;
-
-namespace test.interop
-{
- public class Admin:TestCase
- {
- private static readonly Logger _log = Logger.get(typeof(Admin));
-
- [Test]
- public void createSession()
- {
- _log.debug("Running: createSession");
- ClientSession ssn = Client.createSession(0);
- ssn.close();
- // This test fails if an exception is thrown
- }
-
- [Test]
- public void queueLifecycle()
- {
- _log.debug("Running: queueLifecycle");
- ClientSession ssn = Client.createSession(0);
- ssn.queueDeclare("queue1", null, null);
- ssn.sync();
- ssn.queueDelete("queue1");
- ssn.sync();
- try
- {
- ssn.exchangeBind("queue1", "amq.direct", "queue1", null);
- ssn.sync();
- }
- catch (SessionException e)
- {
- // as expected
- }
- // This test fails if an exception is thrown
- }
-
- [Test]
- public void exchangeCheck()
- {
- _log.debug("Running: exchangeCheck");
- ClientSession ssn = Client.createSession(0);
- ExchangeQueryResult query = (ExchangeQueryResult) ssn.exchangeQuery("amq.direct").Result;
- Assert.IsFalse(query.getNotFound());
- Assert.IsTrue(query.getDurable());
- query = (ExchangeQueryResult)ssn.exchangeQuery("amq.topic").Result;
- Assert.IsFalse(query.getNotFound());
- Assert.IsTrue(query.getDurable());
- query = (ExchangeQueryResult) ssn.exchangeQuery("foo").Result;
- Assert.IsTrue(query.getNotFound());
- }
-
- [Test]
- public void exchangeBind()
- {
- _log.debug("Running: exchangeBind");
- ClientSession ssn = Client.createSession(0);
- ssn.queueDeclare("queue1", null, null);
- ssn.exchangeBind("queue1", "amq.direct", "queue1", null);
- // This test fails if an exception is thrown
- }
-
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/test/interop/ApplicationHeaders.cs b/M4-RCs/qpid/dotnet/client-010/test/interop/ApplicationHeaders.cs
deleted file mode 100644
index 9e27673a49..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/interop/ApplicationHeaders.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.
-*
-*/
-using System;
-using common.org.apache.qpid.transport.util;
-using NUnit.Framework;
-using org.apache.qpid.client;
-using org.apache.qpid.transport.util;
-
-namespace test.interop
-{
- public class ApplicationHeaders:TestCase
- {
- private static readonly Logger _log = Logger.get(typeof(ApplicationHeaders));
-
- [Test]
- public void setHeaders()
- {
- _log.debug("Running: setHeaders");
- ClientSession ssn = Client.createSession(0);
- ssn.queueDeclare("queue1");
- ssn.exchangeBind("queue1", "amq.direct", "queue1");
- ssn.sync();
- CircularBuffer<IMessage> buff = new CircularBuffer<IMessage>(10);
- SyncListener listener = new SyncListener(ssn, buff);
- ssn.attachMessageListener(listener, "queue1");
- ssn.messageSubscribe("queue1");
-
- IMessage message = new org.apache.qpid.client.Message();
- message.DeliveryProperties.setRoutingKey("queue1");
- const long someLong = 14444444;
- message.ApplicationHeaders.Add("someLong", someLong);
- const int someInt = 14;
- message.ApplicationHeaders.Add("soneInt", someInt);
- const float someFloat = 14.001F;
- message.ApplicationHeaders.Add("soneFloat", someFloat);
- const double someDouble = 14.5555555;
- message.ApplicationHeaders.Add("someDouble", someDouble);
- const byte someByte = 2;
- message.ApplicationHeaders.Add("someByte", someByte);
- const string someString = "someString";
- message.ApplicationHeaders.Add("someString", someString);
- const char someChar = 'a';
- message.ApplicationHeaders.Add("someChar", someChar);
- const Boolean someBoolean = true;
- message.ApplicationHeaders.Add("someBoolean", someBoolean);
-
- // transfer the message
- ssn.messageTransfer("amq.direct", message);
-
- // get the message and check the headers
- IMessage messageBack = buff.Dequeue();
- Assert.IsTrue(((string) messageBack.ApplicationHeaders["someString"]).Equals(someString));
- Assert.IsTrue(((char)messageBack.ApplicationHeaders["someChar"]).Equals(someChar));
- Assert.IsTrue((long)messageBack.ApplicationHeaders["someLong"] == someLong);
- Assert.IsTrue((int)messageBack.ApplicationHeaders["soneInt"] == someInt);
- Assert.IsTrue((double)messageBack.ApplicationHeaders["someDouble"] == someDouble);
- Assert.IsTrue((byte) messageBack.ApplicationHeaders["someByte"] == someByte);
- Assert.IsTrue((Boolean)messageBack.ApplicationHeaders["someBoolean"]);
- // c# has an conversion precision issue with decimal
- Assert.IsTrue((float) messageBack.ApplicationHeaders["soneFloat"] <= someFloat);
- float b = (float) messageBack.ApplicationHeaders["soneFloat"];
- Assert.IsTrue(Convert.ToInt32(b) == Convert.ToInt32(someFloat));
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/test/interop/Message.cs b/M4-RCs/qpid/dotnet/client-010/test/interop/Message.cs
deleted file mode 100644
index 3267af9c0c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/interop/Message.cs
+++ /dev/null
@@ -1,179 +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;
-using System.Text;
-using System.Threading;
-using NUnit.Framework;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.util;
-
-namespace test.interop
-{
- public class Message : TestCase
- {
- private static readonly Logger _log = Logger.get(typeof (Message));
-
- [Test]
- public void sendAndPurge()
- {
- _log.debug("Running: exchangeBind");
- ClientSession ssn = Client.createSession(0);
- ssn.queueDelete("queue1");
- QueueQueryResult result = (QueueQueryResult) ssn.queueQuery("queue1").Result;
- Assert.IsNull(result.getQueue());
- ssn.queueDeclare("queue1", null, null);
- ssn.exchangeBind("queue1", "amq.direct", "queue1", null);
- for (int i = 0; i < 10; i++)
- {
- ssn.messageTransfer("amq.direct", MessageAcceptMode.NONE, MessageAcquireMode.PRE_ACQUIRED,
- new Header(new DeliveryProperties().setRoutingKey("queue1"),
- new MessageProperties().setMessageId(UUID.randomUUID())),
- Encoding.UTF8.GetBytes("test: " + i));
- }
- ssn.sync();
- result = (QueueQueryResult) ssn.queueQuery("queue1").Result;
- Assert.IsTrue(result.getMessageCount() == 10);
- ssn.queuePurge("queue1");
- ssn.sync();
- result = (QueueQueryResult) ssn.queueQuery("queue1").Result;
- Assert.IsTrue(result.getMessageCount() == 0);
- }
-
- [Test]
- public void sendAndReceiveSmallMessages()
- {
- _log.debug("Running: sendAndReceiveSmallMessages");
- byte[] smallMessage = Encoding.UTF8.GetBytes("test");
- sendAndReceive(smallMessage, 100);
- }
-
- [Test]
- public void sendAndReceiveLargeMessages()
- {
- _log.debug("Running: sendAndReceiveSmallMessages");
- byte[] largeMessage = new byte[100 * 1024];
- Random random = new Random();
- random.NextBytes(largeMessage);
- sendAndReceive(largeMessage, 10);
- }
-
- [Test]
- public void sendAndReceiveVeryLargeMessages()
- {
- _log.debug("Running: sendAndReceiveSmallMessages");
- byte[] verylargeMessage = new byte[1000 * 1024];
- Random random = new Random();
- random.NextBytes(verylargeMessage);
- sendAndReceive(verylargeMessage, 2);
- }
-
- private void sendAndReceive(byte[] messageBody, int count)
- {
- ClientSession ssn = Client.createSession(0);
- ssn.sync();
- ssn.queueDeclare("queue1", null, null);
- ssn.queueDelete("queue1");
- QueueQueryResult result = (QueueQueryResult) ssn.queueQuery("queue1").Result;
- Assert.IsNull(result.getQueue());
- ssn.queueDeclare("queue1", null, null);
- ssn.exchangeBind("queue1", "amq.direct", "queue1", null);
- Object myLock = new Object();
- MyListener myListener = new MyListener(myLock, count);
- ssn.attachMessageListener(myListener, "myDest");
-
- ssn.messageSubscribe("queue1", "myDest", MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED, null,
- 0, null);
-
-
- // issue credits
- ssn.messageSetFlowMode("myDest", MessageFlowMode.WINDOW);
- ssn.messageFlow("myDest", MessageCreditUnit.BYTE, ClientSession.MESSAGE_FLOW_MAX_BYTES);
- ssn.messageFlow("myDest", MessageCreditUnit.MESSAGE, 10000);
- ssn.sync();
-
- for (int i = 0; i < count; i++)
- {
- ssn.messageTransfer("amq.direct", MessageAcceptMode.NONE, MessageAcquireMode.PRE_ACQUIRED,
- new Header(new DeliveryProperties().setRoutingKey("queue1"),
- new MessageProperties().setMessageId(UUID.randomUUID())),
- messageBody);
- }
- ssn.sync();
-
- lock (myLock)
- {
- if (myListener.Count != 0)
- {
- Monitor.Wait(myLock, 10000000);
- }
- }
- Assert.IsTrue(myListener.Count == 0);
- ssn.messageAccept(myListener.UnAck);
- ssn.sync();
- // the queue should be empty
- result = (QueueQueryResult)ssn.queueQuery("queue1").Result;
- Assert.IsTrue(result.getMessageCount() == 0);
- ssn.close();
- }
-
-
-
- private class MyListener : IMessageListener
- {
- private static readonly Logger _log = Logger.get(typeof (MyListener));
- private readonly Object _wl;
- private int _count;
- private RangeSet _rs = new RangeSet();
-
- public MyListener(Object wl, int count)
- {
- _wl = wl;
- _count = count;
- }
-
- public void messageTransfer(IMessage m)
- {
- byte[] body = new byte[m.Body.Length - m.Body.Position];
- _log.debug("Got a message of size: " + body.Length + " count = " + _count);
- _rs.add(m.Id);
- lock (_wl)
- {
- _count--;
- if (_count == 0)
- {
- Monitor.PulseAll(_wl);
- }
- }
- }
-
- public int Count
- {
- get { return _count; }
- }
-
- public RangeSet UnAck
- {
- get { return _rs; }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/test/interop/TestCase.cs b/M4-RCs/qpid/dotnet/client-010/test/interop/TestCase.cs
deleted file mode 100644
index 8877de50cb..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/interop/TestCase.cs
+++ /dev/null
@@ -1,117 +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;
-using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using System.Xml;
-using common.org.apache.qpid.transport.util;
-using log4net.Config;
-using NUnit.Framework;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.util;
-
-namespace test.interop
-{
- [TestFixture]
-
- public class TestCase
- {
- private readonly Dictionary<string,string> _properties = new Dictionary<string, string>();
- private Client _client;
-
- [TestFixtureSetUp]
- public void Init()
- {
- XmlConfigurator.Configure(new FileInfo("/log.xml"));
- // populate default properties
- _properties.Add("UserName", "guest");
- _properties.Add("Password", "guest");
- _properties.Add("Host", "localhost");
- _properties.Add("Port", "5672");
- _properties.Add("VirtualHost", "test");
- //Read the test config file
- XmlTextReader reader = new XmlTextReader(Environment.CurrentDirectory + "/test.config");
- while (reader.Read())
- {
- // if node type is an element
- if (reader.NodeType == XmlNodeType.Element && reader.Name.Equals("add"))
- {
- if (_properties.ContainsKey(reader.GetAttribute("key")))
- {
- _properties[reader.GetAttribute("key")] = reader.GetAttribute("value");
- }
- else
- {
- _properties.Add(reader.GetAttribute("key"), reader.GetAttribute("value"));
- }
-
- }
- }
- // create a client and connect to the broker
- _client = new Client();
- _client.connect(Properties["Host"], Convert.ToInt16(Properties["Port"]), Properties["VirtualHost"],
- Properties["UserName"], Properties["Password"]);
-
- }
-
- [TestFixtureTearDown]
- public void Cleanup()
- {
- _client.close();
- }
-
- public Client Client
- {
- get{ return _client;}
- }
-
- public Dictionary<string,string> Properties
- {
- get { return _properties; }
- }
-
-
- public class SyncListener : IMessageListener
- {
- private static readonly Logger _log = Logger.get(typeof(SyncListener));
- private readonly CircularBuffer<IMessage> _buffer;
- private readonly RangeSet _range = new RangeSet();
- private readonly ClientSession _session;
-
- public SyncListener(ClientSession session, CircularBuffer<IMessage> buffer)
- {
- _buffer = buffer;
- _session = session;
- }
-
- public void messageTransfer(IMessage m)
- {
- _range.clear();
- _range.add(m.Id);
- _session.messageAccept(_range);
- _buffer.Enqueue(m);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/test/test.config b/M4-RCs/qpid/dotnet/client-010/test/test.config
deleted file mode 100644
index e62da47bb3..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/test.config
+++ /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.
-
--->
-
-<configuration>
- <appSettings>
- <add key="UserMame" value="guest"/>
- <add key="Password" value="guest"/>
- <add key="Host" value="192.168.1.14"/>
- <add key="Port" value="5673"/>
- <add key="VirtualHost" value="test"/>
- </appSettings>
-</configuration>
diff --git a/M4-RCs/qpid/dotnet/client-010/test/transport/util/ByteEncoderTest.cs b/M4-RCs/qpid/dotnet/client-010/test/transport/util/ByteEncoderTest.cs
deleted file mode 100644
index 383970ec79..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/transport/util/ByteEncoderTest.cs
+++ /dev/null
@@ -1,106 +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;
-using NUnit.Framework;
-using org.apache.qpid.transport.util;
-
-
-namespace test.transport.util
-{
- [TestFixture]
-
- public class ByteEncoderTest
- {
- private static readonly Logger _log = Logger.get(typeof(ByteEncoderTest));
-
- [Test]
- public void GetBigEndianInt32()
- {
- _log.debug("Running: GetBigEndianInt32");
- const int anInt = -12345;
- Int32 aNewInt = ByteEncoder.GetBigEndian(anInt);
- Assert.IsTrue( anInt == ByteEncoder.GetBigEndian(aNewInt) );
- }
-
- [Test]
- public void GetBigEndianUInt16()
- {
- _log.debug("Running: GetBigEndianUInt16");
- const UInt16 anInt = 123;
- UInt16 aNewInt = ByteEncoder.GetBigEndian(anInt);
- Assert.IsTrue(anInt == ByteEncoder.GetBigEndian(aNewInt));
- }
-
- [Test]
- public void GetBigEndianUInt32()
- {
- _log.debug("Running: GetBigEndianUInt32");
- const UInt32 anInt = 12345;
- UInt32 aNewInt = ByteEncoder.GetBigEndian(anInt);
- Assert.IsTrue(anInt == ByteEncoder.GetBigEndian(aNewInt));
- }
-
- [Test]
- public void GetBigEndianlong()
- {
- _log.debug("Running: GetBigEndianlong");
- const long anInt = 123456660700770;
- long aNewInt = ByteEncoder.GetBigEndian(anInt);
- Assert.IsTrue(anInt == ByteEncoder.GetBigEndian(aNewInt));
- }
-
- [Test]
- public void GetLittleEndianInt32()
- {
- _log.debug("Running: GetBigEndianInt32");
- const int anInt = -12345;
- Int32 aNewInt = ByteEncoder.GetLittleEndian(anInt);
- Assert.IsTrue(anInt == ByteEncoder.GetLittleEndian(aNewInt));
- }
-
- [Test]
- public void GetLittleEndianUInt16()
- {
- _log.debug("Running: GetLittleEndianUInt16");
- const UInt16 anInt = 123;
- UInt16 aNewInt = ByteEncoder.GetLittleEndian(anInt);
- Assert.IsTrue(anInt == ByteEncoder.GetLittleEndian(aNewInt));
- }
-
- [Test]
- public void GetLittleEndianUInt32()
- {
- _log.debug("Running: GetLittleEndianUInt32");
- const UInt32 anInt = 12345;
- UInt32 aNewInt = ByteEncoder.GetLittleEndian(anInt);
- Assert.IsTrue(anInt == ByteEncoder.GetLittleEndian(aNewInt));
- }
-
- [Test]
- public void GetLittleEndianlong()
- {
- _log.debug("Running: GetLittleEndianlong");
- const long anInt = 123456660700770;
- long aNewInt = ByteEncoder.GetLittleEndian(anInt);
- Assert.IsTrue(anInt == ByteEncoder.GetLittleEndian(aNewInt));
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/test/transport/util/CircularBufferTest.cs b/M4-RCs/qpid/dotnet/client-010/test/transport/util/CircularBufferTest.cs
deleted file mode 100644
index 03ac7831c1..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/transport/util/CircularBufferTest.cs
+++ /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.
-*
-*/
-
-using System;
-using System.Threading;
-using common.org.apache.qpid.transport.util;
-using NUnit.Framework;
-using org.apache.qpid.transport.util;
-
-namespace test.transport.util
-{
- [TestFixture]
-
- public class CircularBufferTest
- {
- private CircularBuffer<Object> _buf;
- private static readonly Logger _log = Logger.get(typeof(CircularBufferTest));
-
- [Test]
- public void BlockingEnqueue()
- {
- _log.debug("Running: BlockingEnqueue");
- const int size = 10;
- _buf = new CircularBuffer<Object>(size);
- // add size element anc check that the size +1 add blocks
- for (int i = 1; i < size; i++ )
- {
- _buf.Enqueue(new object());
- }
- // check tha the buffer is now full
- Thread t = new Thread(Go);
- t.Start();
- Thread.Sleep(100);
- // the trhead t should block until an element is dequeued
- Assert.IsTrue(t.ThreadState == ThreadState.WaitSleepJoin);
- _buf.Dequeue();
- // t should now be stopped
- Thread.Sleep(100);
- Assert.IsTrue(t.ThreadState == ThreadState.Stopped);
- }
-
- [Test]
- public void Close()
- {
- _log.debug("Running: BlockingEnqueue");
- const int size = 10;
- _buf = new CircularBuffer<Object>(size);
- // add size element anc check that the size +1 add blocks
- for (int i = 1; i < size; i++)
- {
- _buf.Enqueue(new object());
- }
- // check tha the buffer is now full
- Thread t = new Thread(Go);
- t.Start();
- Thread.Sleep(1000);
- // the trhead t should block until the buffer is closed
- Assert.IsTrue(t.ThreadState == ThreadState.WaitSleepJoin);
- _buf.close();
- Thread.Sleep(100);
- // t should now be stopped
- Assert.IsTrue(t.ThreadState == ThreadState.Stopped);
- }
-
- void Go()
- {
- _buf.Enqueue(new object());
- }
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/test/transport/util/ResultFutureTest.cs b/M4-RCs/qpid/dotnet/client-010/test/transport/util/ResultFutureTest.cs
deleted file mode 100644
index 6b6397168f..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/transport/util/ResultFutureTest.cs
+++ /dev/null
@@ -1,103 +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;
-using System.Collections.Generic;
-using System.Threading;
-using common.org.apache.qpid.transport.util;
-using NUnit.Framework;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.codec;
-using org.apache.qpid.transport.util;
-
-
-namespace test.transport.util
-{
- [TestFixture]
- public class ResultFutureTest
- {
- private static readonly Logger _log = Logger.get(typeof (ByteEncoderTest));
- private static ResultFuture _future;
-
- [Test]
- public void getFutureTimeout()
- {
- _log.debug("Running: getFutureTimeout");
- _future = new ResultFuture();
- _future.Session = new Session(new byte[1]);
- DateTime start = DateTime.Now;
- Struct result = _future.get(1000);
- Assert.IsTrue(DateTime.Now.Subtract(start).TotalMilliseconds >= 1000);
- Assert.IsNull(result);
- }
-
- [Test]
- public void getFuture()
- {
- _log.debug("Running: getFuture");
- _future = new ResultFuture();
- _future.Session = new Session(new byte[1]);
- Thread t = new Thread(Go);
- t.Start();
- Struct result = _future.get(2000);
- Assert.IsNotNull(result);
- }
-
-
- void Go()
- {
- Thread.Sleep(500);
- _future.Result = new myStruct();
- }
- }
-
- public class myStruct:Struct
- {
- public override int getStructType()
- {
- throw new System.NotImplementedException();
- }
-
- public override int getSizeWidth()
- {
- throw new System.NotImplementedException();
- }
-
- public override int getPackWidth()
- {
- throw new System.NotImplementedException();
- }
-
- public override void read(Decoder dec)
- {
- throw new System.NotImplementedException();
- }
-
- public override void write(Encoder enc)
- {
- throw new System.NotImplementedException();
- }
-
- public override Dictionary<string, object> Fields
- {
- get { throw new System.NotImplementedException(); }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/test/transport/util/SerialTest.cs b/M4-RCs/qpid/dotnet/client-010/test/transport/util/SerialTest.cs
deleted file mode 100644
index 04a838c13b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/transport/util/SerialTest.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.
-*
-*/
-using NUnit.Framework;
-using org.apache.qpid.transport.util;
-
-namespace test.transport.util
-{
- [TestFixture]
- public class SerialTest
- {
- private static readonly Logger _log = Logger.get(typeof (SerialTest));
-
- [Test]
- ///
- /// Test the key boundaries where wraparound occurs.
- ///
- public void testBoundaries()
- {
- Assert.IsTrue(Serial.gt(1, 0));
- Assert.IsTrue(Serial.lt(0, 1));
-
- Assert.IsTrue(Serial.gt(int.MaxValue, int.MaxValue - 1));
- Assert.IsTrue(Serial.lt(int.MaxValue - 1, int.MaxValue));
- }
-
- ///
- /// Test the first Corollary of RFC 1982
- /// For any sequence number s and any integer n such that addition of n
- /// to s is well defined, (s + n) >= s. Further (s + n) == s only when
- /// n == 0, in all other defined cases, (s + n) > s.
- ///
- public void testCorollary1()
- {
- int wrapcount = 0;
-
- int s = 0;
-
- for (int i = 0; i < 67108664; i++)
- {
- for (int n = 1; n < 4096; n += 512)
- {
- Assert.IsTrue(Serial.gt(s + n, s));
- Assert.IsTrue(Serial.lt(s, s + n));
- }
-
- s += 1024;
-
- if (s == 0)
- {
- wrapcount += 1;
- }
- }
-
- Assert.IsTrue(wrapcount > 0);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/test/transport/util/UUIDTest.cs b/M4-RCs/qpid/dotnet/client-010/test/transport/util/UUIDTest.cs
deleted file mode 100644
index c073f1139a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/test/transport/util/UUIDTest.cs
+++ /dev/null
@@ -1,41 +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;
-using NUnit.Framework;
-using org.apache.qpid.transport.util;
-
-namespace test.transport.util
-{
- [TestFixture]
-
- public class UUIDTest
- {
- [Test]
- public void createUUID()
- {
- UUID uuid = UUID.randomUUID();
- String uuidStr = uuid.ToString();
- Assert.IsNotNull(uuid);
- UUID uuid2 = UUID.randomUUID();
- Assert.AreNotSame(uuid, uuid2);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/wcf/Properties/AssemblyInfo.cs
deleted file mode 100644
index 0d60714528..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/Properties/AssemblyInfo.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.
- *
- */
-
-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("Qpid WCF")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Qpid WCF")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("a39d56ec-7d81-48e1-9602-347a3ce6f638")]
-
-// 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("0.10.0.0")]
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/ConfigDemo.suo b/M4-RCs/qpid/dotnet/client-010/wcf/demo/ConfigDemo.suo
deleted file mode 100644
index baa935693b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/ConfigDemo.suo
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/Demo.suo b/M4-RCs/qpid/dotnet/client-010/wcf/demo/Demo.suo
deleted file mode 100644
index ee4cb5d21e..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/Demo.suo
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.Designer.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.Designer.cs
deleted file mode 100644
index 9ec3a08359..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.Designer.cs
+++ /dev/null
@@ -1,185 +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 WindowsFormsBooking
-{
- partial class Form1
- {
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.IContainer components = null;
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
- #region Windows Form Designer generated code
-
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.comboBox1 = new System.Windows.Forms.ComboBox();
- this.label1 = new System.Windows.Forms.Label();
- this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
- this.label2 = new System.Windows.Forms.Label();
- this.button1 = new System.Windows.Forms.Button();
- this.richTextBox1 = new System.Windows.Forms.RichTextBox();
- this.button2 = new System.Windows.Forms.Button();
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
- this.SuspendLayout();
- //
- // comboBox1
- //
- this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.comboBox1.FormattingEnabled = true;
- this.comboBox1.Items.AddRange(new object[] {
- "Hotel",
- "Taxi",
- "Train",
- "Cinema",
- "Theater",
- "Restaurant"});
- this.comboBox1.Location = new System.Drawing.Point(60, 20);
- this.comboBox1.Name = "comboBox1";
- this.comboBox1.Size = new System.Drawing.Size(76, 21);
- this.comboBox1.TabIndex = 0;
- this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
- //
- // label1
- //
- this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(23, 20);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(31, 13);
- this.label1.TabIndex = 1;
- this.label1.Text = "Type";
- //
- // numericUpDown1
- //
- this.numericUpDown1.Increment = new decimal(new int[] {
- 10,
- 0,
- 0,
- 0});
- this.numericUpDown1.Location = new System.Drawing.Point(60, 49);
- this.numericUpDown1.Maximum = new decimal(new int[] {
- 200,
- 0,
- 0,
- 0});
- this.numericUpDown1.Minimum = new decimal(new int[] {
- 30,
- 0,
- 0,
- 0});
- this.numericUpDown1.Name = "numericUpDown1";
- this.numericUpDown1.Size = new System.Drawing.Size(76, 20);
- this.numericUpDown1.TabIndex = 2;
- this.numericUpDown1.Value = new decimal(new int[] {
- 30,
- 0,
- 0,
- 0});
- this.numericUpDown1.ValueChanged += new System.EventHandler(this.numericUpDown1_ValueChanged);
- //
- // label2
- //
- this.label2.AutoSize = true;
- this.label2.Location = new System.Drawing.Point(23, 56);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(31, 13);
- this.label2.TabIndex = 3;
- this.label2.Text = "Price";
- //
- // button1
- //
- this.button1.Location = new System.Drawing.Point(142, 20);
- this.button1.Name = "button1";
- this.button1.Size = new System.Drawing.Size(40, 49);
- this.button1.TabIndex = 4;
- this.button1.Text = "Add";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new System.EventHandler(this.button1_Click);
- //
- // richTextBox1
- //
- this.richTextBox1.ForeColor = System.Drawing.SystemColors.ControlText;
- this.richTextBox1.Location = new System.Drawing.Point(27, 113);
- this.richTextBox1.Name = "richTextBox1";
- this.richTextBox1.Size = new System.Drawing.Size(155, 83);
- this.richTextBox1.TabIndex = 5;
- this.richTextBox1.Text = "";
- //
- // button2
- //
- this.button2.Location = new System.Drawing.Point(27, 81);
- this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(155, 29);
- this.button2.TabIndex = 6;
- this.button2.Text = "Receipt";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new System.EventHandler(this.button2_Click);
- //
- // Form1
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(211, 211);
- this.Controls.Add(this.button2);
- this.Controls.Add(this.richTextBox1);
- this.Controls.Add(this.button1);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.numericUpDown1);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.comboBox1);
- this.Name = "Form1";
- this.Text = "Booking Client";
- ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
- this.ResumeLayout(false);
- this.PerformLayout();
-
- }
-
- #endregion
-
- private System.Windows.Forms.ComboBox comboBox1;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.NumericUpDown numericUpDown1;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.Button button1;
- private System.Windows.Forms.RichTextBox richTextBox1;
- private System.Windows.Forms.Button button2;
- }
-}
-
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.cs
deleted file mode 100644
index 86a2f6b774..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.cs
+++ /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.
- *
- */
-
-using System;
-using System.ServiceModel;
-using System.Windows.Forms;
-using org.apache.qpid.wcf.demo;
-using org.apache.qpid.wcf.model;
-using org.apache.qpid.wcf.demo.bookingServer;
-
-namespace WindowsFormsBooking
-{
- public partial class Form1 : Form
- {
- private ChannelFactory<IBooking> _fac;
- private readonly Order _order = new Order();
- private IBooking _calc;
-
- public Form1()
- {
- InitializeComponent();
- _calc = StartClient(new QpidBinding("192.168.1.14", 5673));
- _order.Type = "Default";
- _order.Price = 0;
- }
-
- public IBooking StartClient(System.ServiceModel.Channels.Binding binding)
- {
- IBooking res = null;
- try
- {
- Console.WriteLine(" Starting Client...");
- _fac = new ChannelFactory<IBooking>(binding, "soap.amqp:///Booking");
- _fac.Open();
- res = _fac.CreateChannel();
- Console.WriteLine("[DONE]");
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- }
- return res;
- }
-
- public void StopClient(IBooking client)
- {
- Console.WriteLine(" Stopping Client...");
- ((System.ServiceModel.Channels.IChannel)client).Close();
- _fac.Close();
- Console.WriteLine("[DONE]");
- }
-
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- _order.Type = ((ComboBox) sender).SelectedItem.ToString();
- }
-
- private void numericUpDown1_ValueChanged(object sender, EventArgs e)
- {
- _order.Price = (double) ((NumericUpDown) sender).Value;
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- _calc.Add(_order);
- }
-
- private void button2_Click(object sender, EventArgs e)
- {
- Receipt r = _calc.Checkout();
- richTextBox1.Text = r.Summary + "\n" + "Total Price = " + r.Price;
- // reset
- _calc = StartClient(new QpidBinding("192.168.1.14", 5673));
- }
-
-
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.resx b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.resx
deleted file mode 100644
index 925d12594b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Form1.resx
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" use="required" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- <xsd:attribute ref="xml:space" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <metadata name="richTextBox1.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
- <value>True</value>
- </metadata>
-</root> \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Program.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Program.cs
deleted file mode 100644
index 59189bf600..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Program.cs
+++ /dev/null
@@ -1,41 +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;
-using System.Collections.Generic;
-using System.Windows.Forms;
-
-namespace WindowsFormsBooking
-{
- static class Program
- {
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form1());
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/AssemblyInfo.cs
deleted file mode 100644
index 1dbf952552..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/AssemblyInfo.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.
- *
- */
-
-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("Booking Client")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Booking Client")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("fc8b1e0e-1ca9-46fe-9aae-b1ed046716b8")]
-
-// 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("0.10.0.0")]
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Resources.Designer.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Resources.Designer.cs
deleted file mode 100644
index 42f9731a3d..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,92 +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.
- *
- */
-
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.1433
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace WindowsFormsBooking.Properties
-{
-
-
- /// <summary>
- /// A strongly-typed resource class, for looking up localized strings, etc.
- /// </summary>
- // This class was auto-generated by the StronglyTypedResourceBuilder
- // class via a tool like ResGen or Visual Studio.
- // To add or remove a member, edit your .ResX file then rerun ResGen
- // with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
- }
-
- /// <summary>
- /// Returns the cached ResourceManager instance used by this class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WindowsFormsBooking.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- /// <summary>
- /// Overrides the current thread's CurrentUICulture property for all
- /// resource lookups using this strongly typed resource class.
- /// </summary>
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Resources.resx b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Resources.resx
deleted file mode 100644
index ffecec851a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<root>
- <!--
- Microsoft ResX Schema
-
- Version 2.0
-
- The primary goals of this format is to allow a simple XML format
- that is mostly human readable. The generation and parsing of the
- various data types are done through the TypeConverter classes
- associated with the data types.
-
- Example:
-
- ... ado.net/XML headers & schema ...
- <resheader name="resmimetype">text/microsoft-resx</resheader>
- <resheader name="version">2.0</resheader>
- <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
- <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
- <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
- <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
- <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
- <value>[base64 mime encoded serialized .NET Framework object]</value>
- </data>
- <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
- <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
- <comment>This is a comment</comment>
- </data>
-
- There are any number of "resheader" rows that contain simple
- name/value pairs.
-
- Each data row contains a name, and value. The row also contains a
- type or mimetype. Type corresponds to a .NET class that support
- text/value conversion through the TypeConverter architecture.
- Classes that don't support this are serialized and stored with the
- mimetype set.
-
- The mimetype is used for serialized objects, and tells the
- ResXResourceReader how to depersist the object. This is currently not
- extensible. For a given mimetype the value must be set accordingly:
-
- Note - application/x-microsoft.net.object.binary.base64 is the format
- that the ResXResourceWriter will generate, however the reader can
- read any of the formats listed below.
-
- mimetype: application/x-microsoft.net.object.binary.base64
- value : The object must be serialized with
- : System.Serialization.Formatters.Binary.BinaryFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.soap.base64
- value : The object must be serialized with
- : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
- : and then encoded with base64 encoding.
-
- mimetype: application/x-microsoft.net.object.bytearray.base64
- value : The object must be serialized into a byte array
- : using a System.ComponentModel.TypeConverter
- : and then encoded with base64 encoding.
- -->
- <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xsd:element name="root" msdata:IsDataSet="true">
- <xsd:complexType>
- <xsd:choice maxOccurs="unbounded">
- <xsd:element name="metadata">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" />
- <xsd:attribute name="type" type="xsd:string" />
- <xsd:attribute name="mimetype" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="assembly">
- <xsd:complexType>
- <xsd:attribute name="alias" type="xsd:string" />
- <xsd:attribute name="name" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="data">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
- <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
- <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="resheader">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:schema>
- <resheader name="resmimetype">
- <value>text/microsoft-resx</value>
- </resheader>
- <resheader name="version">
- <value>2.0</value>
- </resheader>
- <resheader name="reader">
- <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
- <resheader name="writer">
- <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
- </resheader>
-</root> \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Settings.Designer.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Settings.Designer.cs
deleted file mode 100644
index 212fb91438..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,51 +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.
- *
- */
-
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.1433
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace WindowsFormsBooking.Properties
-{
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Settings.settings b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Settings.settings
deleted file mode 100644
index abf36c5d3d..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
- <Profiles>
- <Profile Name="(Default)" />
- </Profiles>
- <Settings />
-</SettingsFile>
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/wcBookingClient.csproj b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/wcBookingClient.csproj
deleted file mode 100644
index 1e096db9d1..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingClient/wcBookingClient.csproj
+++ /dev/null
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{4086B3FE-F745-4DCC-952A-682CAE01F4C9}</ProjectGuid>
- <OutputType>WinExe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>WindowsFormsBooking</RootNamespace>
- <AssemblyName>Booking 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="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.Deployment" />
- <Reference Include="System.Drawing" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Form1.cs">
- <SubType>Form</SubType>
- </Compile>
- <Compile Include="Form1.Designer.cs">
- <DependentUpon>Form1.cs</DependentUpon>
- </Compile>
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <EmbeddedResource Include="Form1.resx">
- <DependentUpon>Form1.cs</DependentUpon>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- <EmbeddedResource Include="Properties\Resources.resx">
- <Generator>ResXFileCodeGenerator</Generator>
- <LastGenOutput>Resources.Designer.cs</LastGenOutput>
- <SubType>Designer</SubType>
- </EmbeddedResource>
- <Compile Include="Properties\Resources.Designer.cs">
- <AutoGen>True</AutoGen>
- <DependentUpon>Resources.resx</DependentUpon>
- </Compile>
- <None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
- <LastGenOutput>Settings.Designer.cs</LastGenOutput>
- </None>
- <Compile Include="Properties\Settings.Designer.cs">
- <AutoGen>True</AutoGen>
- <DependentUpon>Settings.settings</DependentUpon>
- <DesignTimeSharedInput>True</DesignTimeSharedInput>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\wcf.csproj">
- <Project>{F1D80D9D-FE22-4213-A760-BFFDE7D131DD}</Project>
- <Name>wcf</Name>
- </ProjectReference>
- <ProjectReference Include="..\wcfBookingServer\wcfBookingServer.csproj">
- <Project>{B34E21C4-A742-4886-8569-1A89490E093E}</Project>
- <Name>wcfBookingServer</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/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Booking.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Booking.cs
deleted file mode 100644
index 3f0d37cbe8..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Booking.cs
+++ /dev/null
@@ -1,62 +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;
-using System.Collections.Generic;
-using System.ServiceModel;
-
-
-namespace org.apache.qpid.wcf.demo.bookingServer
-{
- [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)]
- public class Booking : IBooking
- {
- private Guid _id;
- private List<Order> _orders;
-
- public Booking()
- {
- _id = Guid.NewGuid();
- _orders = new List<Order>();
- }
-
- public void Add(Order order)
- {
- _orders.Add(order);
- }
-
- public Receipt Checkout()
- {
- var r = new Receipt();
- foreach (Order order in _orders)
- {
- r.Price += order.Price;
- r.Summary = r.Summary + " \n " + order.Type + " Price: " + order.Price;
- }
- return r;
- }
-
- public Guid Id
- {
- get { return _id; }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/IBooking.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/IBooking.cs
deleted file mode 100644
index 34b6caa1c6..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/IBooking.cs
+++ /dev/null
@@ -1,43 +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;
-using System.ServiceModel;
-
-namespace org.apache.qpid.wcf.demo.bookingServer
-{
- [ServiceContract(SessionMode=SessionMode.Required)]
- public interface IBooking
- {
- [OperationContract]
- void Add(Order order);
-
- [OperationContract]
- Receipt Checkout();
-
- Guid Id
- {
- [OperationContract]
- get;
- }
- }
-
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Order.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Order.cs
deleted file mode 100644
index 79dfdefdb3..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Order.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.
-*
-*/
-using System.Runtime.Serialization;
-
-namespace org.apache.qpid.wcf.demo.bookingServer
-{
- [DataContract]
- public sealed class Order
- {
- private double _price;
- private string _type;
-
- [DataMember]
- public double Price
- {
- get { return _price; }
- set { _price = value; }
- }
-
- [DataMember]
- public string Type
- {
- get { return _type; }
- set { _type = value; }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Program.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Program.cs
deleted file mode 100644
index cead7edb8c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Program.cs
+++ /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.
-*
-*/
-
-using System;
-using System.ServiceModel;
-using System.ServiceModel.Channels;
-using System.Threading;
-using org.apache.qpid.wcf.model;
-
-
-namespace org.apache.qpid.wcf.demo.bookingServer
-{
- internal class Program
- {
- private ServiceHost _service;
- private ChannelFactory<IBooking> fac;
-
- public void StartService(Binding binding)
- {
- try
- {
- Console.WriteLine(" Binding Service...");
- _service = new ServiceHost(typeof(Booking), new Uri("soap.amqp:///"));
- _service.AddServiceEndpoint(typeof(IBooking), binding, "Booking");
- _service.Open();
- Thread.Sleep(500);
- Console.WriteLine("[DONE]");
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- }
- }
-
- public void StopService()
- {
- Console.WriteLine(" Stopping Service...");
- _service.Close();
- Console.WriteLine("[DONE]");
- }
-
- public IBooking StartClient(Binding binding)
- {
- IBooking res = null;
- try
- {
- Console.WriteLine(" Starting Client...");
- fac = new ChannelFactory<IBooking>(binding, "soap.amqp:///Booking");
- fac.Open();
- res = fac.CreateChannel();
- Console.WriteLine("[DONE]");
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- }
- return res;
- }
-
- public void StopClient(IBooking client)
- {
- Console.WriteLine(" Stopping Client...");
- ((IChannel)client).Close();
- fac.Close();
- Console.WriteLine("[DONE]");
- }
-
- private static void Main(string[] args)
- {
- var p = new Program();
-
- Binding binding = new QpidBinding("192.168.1.14", 5673);
- p.StartService(binding);
-
- Console.ReadLine();
-
- p.StopService();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Properties/AssemblyInfo.cs
deleted file mode 100644
index adcbad66f0..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Properties/AssemblyInfo.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.
- *
- */
-
-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("Booking Server")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Booking Server")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("12ef158b-ac5f-43b3-99f6-e4a4c096d6f8")]
-
-// 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("0.10.0.0")]
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Receipt.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Receipt.cs
deleted file mode 100644
index 655c26a26e..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/Receipt.cs
+++ /dev/null
@@ -1,46 +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.Runtime.Serialization;
-
-namespace org.apache.qpid.wcf.demo.bookingServer
-{
- [DataContract]
- public sealed class Receipt
- {
- private double _price;
- private string _summary;
-
- [DataMember]
- public double Price
- {
- get { return _price; }
- set { _price = value; }
- }
-
- [DataMember]
- public string Summary
- {
- get { return _summary; }
- set { _summary = value; }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/wcfBookingServer.csproj b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/wcfBookingServer.csproj
deleted file mode 100644
index eae7b2eaa6..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfBookingServer/wcfBookingServer.csproj
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{B34E21C4-A742-4886-8569-1A89490E093E}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>wcfSession</RootNamespace>
- <AssemblyName>Booking Server</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>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.Drawing" />
- <Reference Include="System.Runtime.Serialization">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Windows.Forms" />
- <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="Booking.cs" />
- <Compile Include="Receipt.cs" />
- <Compile Include="IBooking.cs" />
- <Compile Include="Order.cs" />
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\wcf.csproj">
- <Project>{F1D80D9D-FE22-4213-A760-BFFDE7D131DD}</Project>
- <Name>wcf</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/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/App.config b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/App.config
deleted file mode 100644
index 1545d71d6f..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/App.config
+++ /dev/null
@@ -1,56 +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.
-
--->
-
-<configuration>
- <system.serviceModel>
-
- <client>
- <endpoint address="soap.amqp:///Hello"
- binding="customBinding"
- bindingConfiguration="QpidBinding"
- contract="org.apache.qpid.wcf.demo.helloClient.IHelloContract"
- name="HelloService" />
- </client>
-
-
- <bindings>
- <customBinding>
- <binding name="QpidBinding">
- <textMessageEncoding />
- <QpidTransport
- host="localhost"
- port="5672" />
- </binding>
- </customBinding>
- </bindings>
-
- <extensions>
- <bindingElementExtensions>
- <add
- name="QpidTransport"
- type="org.apache.qpid.wcf.model.QpidTransportElement, qpidWCFModel"/>
- </bindingElementExtensions>
- </extensions>
-
-
- </system.serviceModel>
-</configuration>
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/HelloClient.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/HelloClient.cs
deleted file mode 100644
index 39889ba28c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/HelloClient.cs
+++ /dev/null
@@ -1,36 +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.ServiceModel;
-
-namespace org.apache.qpid.wcf.demo.helloClient
-{
- public class HelloClient : ClientBase<IHelloContract>, IHelloContract
- {
- public HelloClient(string configurationName)
- : base(configurationName) { }
-
- public void Hello(string name)
- {
- Channel.Hello(name);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/IHelloService.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/IHelloService.cs
deleted file mode 100644
index 70667c1396..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/IHelloService.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.
-*
-*/
-
-using System.ServiceModel;
-
-namespace org.apache.qpid.wcf.demo.helloClient
-{
- [ServiceContract]
- public interface IHelloContract
- {
- [OperationContract(IsOneWay=true)]
- void Hello(string name);
- }
-
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Program.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Program.cs
deleted file mode 100644
index 0c722708ac..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Program.cs
+++ /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.
-*
-*/
-
-using System;
-
-namespace org.apache.qpid.wcf.demo.helloClient
-{
- class Program
- {
- static void Main(string[] args)
- {
- Console.Title = "Hello Service Client";
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("Hello Service Client");
- Console.ForegroundColor = ConsoleColor.Gray;
- Console.WriteLine();
- // create a client using the configuration file App.config
- var client = new HelloClient("HelloService");
- Console.WriteLine("Client Saying Hello to Qpid");
- client.Hello("Qpid");
- Console.WriteLine("Client Saying Hello to AMQP");
- client.Hello("AMQP");
- // closing the client service
- client.ChannelFactory.Close();
- Console.WriteLine();
- Console.Write("Press Enter to Exit...");
- Console.ReadLine();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Properties/AssemblyInfo.cs
deleted file mode 100644
index 3f9d11e752..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/Properties/AssemblyInfo.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.
- *
- */
-
-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("Qpid WCF Hello Client")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Qpid WCF Hello Client")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("f7628695-280a-4689-ac6f-1186177f9a25")]
-
-// 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("0.10.0.0")]
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/wcfHelloClient.csproj b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/wcfHelloClient.csproj
deleted file mode 100644
index 1f3271f32b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloClient/wcfHelloClient.csproj
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{A24E27DB-A38D-40C9-9879-8390B68C2F06}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>wcfHelloClient</RootNamespace>
- <AssemblyName>Qpid WCF Hello 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="System" />
- <Reference Include="System.configuration" />
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="HelloClient.cs" />
- <Compile Include="IHelloService.cs" />
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="App.config" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\wcf.csproj">
- <Project>{F1D80D9D-FE22-4213-A760-BFFDE7D131DD}</Project>
- <Name>wcf</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/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/App.config b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/App.config
deleted file mode 100644
index de71f890b5..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/App.config
+++ /dev/null
@@ -1,64 +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.
-
--->
-
-<configuration>
- <system.serviceModel>
-
-
- <services>
- <service name="org.apache.qpid.wcf.demo.HelloService">
- <host>
- <baseAddresses>
- <add baseAddress="soap.amqp:///" />
- </baseAddresses>
- </host>
- <endpoint
- address="Hello"
- binding="customBinding"
- bindingConfiguration="QpidBinding"
- contract="org.apache.qpid.wcf.demo.IHelloContract"/>
- </service>
- </services>
-
-
- <bindings>
- <customBinding>
- <binding name="QpidBinding">
- <textMessageEncoding />
- <QpidTransport
- host="192.168.1.14"
- port="5673" />
- </binding>
- </customBinding>
- </bindings>
-
- <extensions>
- <bindingElementExtensions>
- <add
- name="QpidTransport"
- type="org.apache.qpid.wcf.model.QpidTransportElement, qpidWCFModel"/>
- </bindingElementExtensions>
- </extensions>
-
-
- </system.serviceModel>
-</configuration>
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/HelloService.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/HelloService.cs
deleted file mode 100644
index 3a4affdc0c..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/HelloService.cs
+++ /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.
-*
-*/
-
-using System;
-
-namespace org.apache.qpid.wcf.demo.helloServer
-{
- public class HelloService : IHelloContract
- {
- public void Hello(string name)
- {
- Console.WriteLine("Hello {0}!", name);
-
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/IHelloService.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/IHelloService.cs
deleted file mode 100644
index 860eef3c4a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/IHelloService.cs
+++ /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.
-*
-*/
-using System.ServiceModel;
-
-namespace org.apache.qpid.wcf.demo.helloServer
-{
- [ServiceContract]
- public interface IHelloContract
- {
- [OperationContract(IsOneWay=true)]
- void Hello(string name);
- }
-
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/Program.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/Program.cs
deleted file mode 100644
index 7a5319fe66..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/Program.cs
+++ /dev/null
@@ -1,47 +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;
-using System.ServiceModel;
-
-namespace org.apache.qpid.wcf.demo.helloServer
-{
- class Program
- {
- static void Main(string[] args)
- {
- Console.Title = "Hello Service Server";
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("Hello Service Server");
- Console.ForegroundColor = ConsoleColor.Gray;
- Console.WriteLine();
-
- var host = new ServiceHost(typeof(HelloService));
- host.Open();
-
- Console.WriteLine("Service Ready");
- Console.WriteLine("Press Enter to Exit...");
- Console.ReadLine();
-
- host.Close();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/Properties/AssemblyInfo.cs
deleted file mode 100644
index 940c10976b..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/Properties/AssemblyInfo.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.
- *
- */
-
-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("Qpid WCF Hello Server")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Qpid WCF Hello Server")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("afa87185-f224-4948-904c-b4f3cd19dadb")]
-
-// 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("0.10.0.0")]
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/wcfHelloServer.csproj b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/wcfHelloServer.csproj
deleted file mode 100644
index fa727e00fd..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfHelloServer/wcfHelloServer.csproj
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{3EF848D7-5FAC-482C-922A-D4D45A4CCD2A}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>wcfHelloServer</RootNamespace>
- <AssemblyName>Qpid WCF Hello Server</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>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.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="HelloService.cs" />
- <Compile Include="IHelloService.cs" />
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="App.config" />
- </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/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/IUpperCase.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/IUpperCase.cs
deleted file mode 100644
index 607a165bdc..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/IUpperCase.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.
-*
-*/
-using System.ServiceModel;
-
-namespace org.apache.qpid.wcf.demo.rpc
-{
- [ServiceContract]
- public interface IUpperCase
- {
- [OperationContract]
- string ToUpperCase(string message);
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/Program.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/Program.cs
deleted file mode 100644
index 810175df4d..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/Program.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.
-*
-*/
-
-using System;
-using System.ServiceModel;
-using System.ServiceModel.Channels;
-using System.Threading;
-using org.apache.qpid.wcf.model;
-
-
-namespace org.apache.qpid.wcf.demo.rpc
-{
- internal class Program
- {
- private ServiceHost _service;
- private ChannelFactory<IUpperCase> fac;
-
- public void StartService(Binding binding)
- {
- try
- {
- Console.WriteLine(" Binding Service...");
- _service = new ServiceHost(typeof (UpperCase), new Uri("soap.amqp:///"));
- _service.AddServiceEndpoint(typeof(IUpperCase), binding, "UpperCase");
- _service.Open();
- Thread.Sleep(500);
- Console.WriteLine("[DONE]");
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- }
- }
-
- public void StopService()
- {
- Console.WriteLine(" Stopping Service...");
- _service.Close();
- Console.WriteLine("[DONE]");
- }
-
- public IUpperCase StartClient(Binding binding)
- {
- IUpperCase res = null;
- try
- {
- Console.WriteLine(" Starting Client...");
- fac = new ChannelFactory<IUpperCase>(binding, "soap.amqp:///UpperCase");
- fac.Open();
- res = fac.CreateChannel();
- Console.WriteLine("[DONE]");
- }
- catch (Exception e)
- {
- Console.WriteLine(e);
- }
- return res;
- }
-
- public void StopClient(IUpperCase client)
- {
- Console.WriteLine(" Stopping Client...");
- ((IChannel) client).Close();
- fac.Close();
- Console.WriteLine("[DONE]");
- }
-
- private static void Main(string[] args)
- {
- var p = new Program();
-
- Binding binding = new QpidBinding("192.168.1.14", 5673);
- p.StartService(binding);
-
-
- IUpperCase calc = p.StartClient(new QpidBinding("192.168.1.14", 5673));
-
- string[] messages = {"Twas brillig, and the slithy toves",
- "Did gire and gymble in the wabe. ",
- "All mimsy were the borogroves, ",
- "And the mome raths outgrabe. "};
- foreach (string m in messages)
- {
- Console.Write(m + " --UperCase--> " );
- Console.Write(calc.ToUpperCase(m));
- Console.WriteLine();
- }
-
- Console.ReadLine();
-
- p.StopClient(calc);
- p.StopService();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/Properties/AssemblyInfo.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/Properties/AssemblyInfo.cs
deleted file mode 100644
index d9e0a5f3d3..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/Properties/AssemblyInfo.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.
- *
- */
-
-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("Qpid WCF UpperCase")]
-[assembly: AssemblyDescription("Built from svn revision number: ")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Software Foundation")]
-[assembly: AssemblyProduct("Qpid WCF UpperCase")]
-[assembly: AssemblyCopyright("Apache Software Foundation")]
-[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("14ba3707-3fcc-4033-8bbc-0db65c5424f3")]
-
-// 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("0.10.0.0")]
-[assembly: AssemblyVersion("0.10.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/QpidBindingConfigurationElement.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/QpidBindingConfigurationElement.cs
deleted file mode 100644
index 470fe49734..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/QpidBindingConfigurationElement.cs
+++ /dev/null
@@ -1,205 +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;
-using System.Reflection;
-using System.ServiceModel.Channels;
-using System.ServiceModel.Configuration;
-using System.Configuration;
-
-namespace org.apache.qpid.wcf.model
-{
-
- /// <remarks>
- /// This configuration element should be imported into the client
- /// and server configuration files to provide declarative configuration
- /// of a AMQP bound service.
- /// </remarks>
- public sealed class QpidBindingConfigurationElement : StandardBindingElement
- {
- /// <summary>
- /// Creates a new instance of the QpidBindingConfigurationElement
- /// Class initialized with values from the specified configuration.
- /// </summary>
- /// <param name="configurationName"></param>
- public QpidBindingConfigurationElement(string configurationName)
- : base(configurationName)
- {
- }
-
- /// <summary>
- /// Creates a new instance of the RabbitMQBindingConfigurationElement Class.
- /// </summary>
- public QpidBindingConfigurationElement()
- : this(null)
- {
- }
-
-
- protected override void InitializeFrom(Binding binding)
- {
- base.InitializeFrom(binding);
- QpidBinding qpidbinding = binding as QpidBinding;
- if (qpidbinding != null)
- {
- Host = qpidbinding.Host;
- OneWayOnly = qpidbinding.OneWayOnly;
- TransactionFlowEnabled = qpidbinding.TransactionFlow;
- VirtualHost = qpidbinding.VirtualHost;
- PortNumber = qpidbinding.PortNumber;
- UserName = qpidbinding.UserName;
- Password = qpidbinding.Password;
- }
- }
-
- protected override void OnApplyConfiguration(Binding binding)
- {
- if (binding == null)
- throw new ArgumentNullException("binding");
-
- var qpidbinding = binding as QpidBinding;
- if (qpidbinding == null)
- {
- throw new ArgumentException(
- string.Format("Invalid type for binding. Expected {0}, Passed: {1}",
- typeof(QpidBinding).AssemblyQualifiedName,
- binding.GetType().AssemblyQualifiedName));
- }
-
- qpidbinding.Host = Host;
- qpidbinding.OneWayOnly = OneWayOnly;
- qpidbinding.TransactionFlow = TransactionFlowEnabled;
- qpidbinding.Password = Password;
- qpidbinding.UserName = UserName;
- qpidbinding.VirtualHost = VirtualHost;
- qpidbinding.PortNumber = PortNumber;
- }
-
-
- /// <summary>
- /// Specifies the host that the binding should connect to.
- /// </summary>
- [ConfigurationProperty("host", DefaultValue = "localhost")]
- public string Host
- {
- get { return ((string) base["host"]); }
- set { base["host"] = value; }
- }
-
- /// <summary>
- /// Specifies the broker port number that the binding should connect to.
- /// </summary>
- [ConfigurationProperty("port", DefaultValue = "5672")]
- public int PortNumber
- {
- get { return (Convert.ToInt16(base["port"])); }
- set { base["port"] = value; }
- }
-
-
- /// <summary>
- /// Specifies whether or not the CompositeDuplex and ReliableSession
- /// binding elements are added to the channel stack.
- /// </summary>
- [ConfigurationProperty("oneWay", DefaultValue = false)]
- public bool OneWayOnly
- {
- get { return ((bool)base["oneWay"]); }
- set { base["oneWay"] = value; }
- }
-
- /// <summary>
- /// Password to use when authenticating with the broker
- /// </summary>
- [ConfigurationProperty("password", DefaultValue = "guest")]
- public string Password
- {
- get { return ((string)base["password"]); }
- set { base["password"] = value; }
- }
-
- /// <summary>
- /// Specifies whether or not WS-AtomicTransactions are supported by the binding
- /// </summary>
- [ConfigurationProperty("transactionFlow", DefaultValue = false)]
- public bool TransactionFlowEnabled
- {
- get { return ((bool)base["transactionFlow"]); }
- set { base["transactionFlow"] = value; }
- }
-
- /// <summary>
- /// The username to use when authenticating with the broker
- /// </summary>
- [ConfigurationProperty("username", DefaultValue = "guest")]
- public string UserName
- {
- get { return ((string)base["username"]); }
- set { base["username"] = value; }
- }
-
-
-
-
- /// <summary>
- /// The virtual host to access.
- /// </summary>
- [ConfigurationProperty("virtualHost", DefaultValue = "test")]
- public string VirtualHost
- {
- get { return ((string)base["virtualHost"]); }
- set { base["virtualHost"] = value; }
- }
-
- ///<summary>The security realm to use when calling IModel.AccessRequest</summary>
- [ConfigurationProperty("realm", DefaultValue = "plain")]
- public string Realm
- {
- get { return ((string)base["realm"]); }
- set { base["realm"] = value; }
- }
-
- protected override Type BindingElementType
- {
- get { return typeof(QpidBinding); }
- }
-
- protected override ConfigurationPropertyCollection Properties
- {
- get
- {
- ConfigurationPropertyCollection configProperties = base.Properties;
- foreach (PropertyInfo prop in this.GetType().GetProperties(BindingFlags.DeclaredOnly
- | BindingFlags.Public
- | BindingFlags.Instance))
- {
- foreach (ConfigurationPropertyAttribute attr in prop.GetCustomAttributes(typeof(ConfigurationPropertyAttribute), false))
- {
- configProperties.Add(
- new ConfigurationProperty(attr.Name, prop.PropertyType, attr.DefaultValue));
- }
- }
-
- return configProperties;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/UpperCase.cs b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/UpperCase.cs
deleted file mode 100644
index f65296fa03..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/UpperCase.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.
-*
-*/
-using System.ServiceModel;
-
-namespace org.apache.qpid.wcf.demo.rpc
-{
- [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
- public sealed class UpperCase : IUpperCase
- {
- public string ToUpperCase(string message)
- {
- return message.ToUpper();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/wcfRPC.csproj b/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/wcfRPC.csproj
deleted file mode 100644
index 00efe7a6b9..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/demo/wcfRPC/wcfRPC.csproj
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{C988F456-1025-486F-9BCD-49C0F83B91DB}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>wcfRPC</RootNamespace>
- <AssemblyName>Qpid WCF UpperCase</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.configuration" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Drawing" />
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Windows.Forms" />
- <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="IUpperCase.cs" />
- <Compile Include="Program.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="UpperCase.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\wcf.csproj">
- <Project>{F1D80D9D-FE22-4213-A760-BFFDE7D131DD}</Project>
- <Name>wcf</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/M4-RCs/qpid/dotnet/client-010/wcf/model/CommunicationOperation.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/CommunicationOperation.cs
deleted file mode 100644
index d32f3b3f40..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/CommunicationOperation.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.
-*
-*/
-
-using System;
-using System.ServiceModel.Channels;
-
-namespace org.apache.qpid.wcf.model
-{
- internal delegate void CommunicationOperation(TimeSpan timeout);
- internal delegate TResult CommunicationOperation<TResult>(TimeSpan timeout);
- internal delegate TResult CommunicationOperation<TResult, TArg>(TimeSpan timeout, out TArg arg0);
- internal delegate void SendOperation(Message message, TimeSpan timeout);
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidBinding.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidBinding.cs
deleted file mode 100644
index 73b7b92845..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidBinding.cs
+++ /dev/null
@@ -1,185 +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.Configuration;
-using System.ServiceModel;
-using System.ServiceModel.Channels;
-
-namespace org.apache.qpid.wcf.model
-{
- public sealed class QpidBinding : Binding
- {
- private string _host;
- private int _port;
- private string _username;
- private string _password;
- private string _virtuaHost;
- private readonly CompositeDuplexBindingElement _compositeDuplex;
- private readonly MessageEncodingBindingElement _encoding;
- private bool _oneWayOnly;
- private readonly ReliableSessionBindingElement _session;
- private readonly TransactionFlowBindingElement _transactionFlow;
- private bool _transactionsEnabled;
- private readonly QpidTransportBindingElement _transport;
-
-
-
- public QpidBinding() : this("localhost", 5672, "guest", "guest", "test")
- {
- }
-
-
- public QpidBinding(string host, int port ) : this (host, port, "guest", "guest", "test")
- {
- }
-
- public QpidBinding(string host, int port, string username, string password, string virtualhost)
- {
- Host = host;
- PortNumber = port;
- UserName = username;
- Password = password;
- VirtualHost = virtualhost;
- _transport = new QpidTransportBindingElement();
- _transport.Host = host;
- _transport.PortNumber = port;
- _transport.Password = password;
- _transport.UserName = username;
- _transport.VirtualHost = virtualhost;
- _encoding = new TextMessageEncodingBindingElement();
- _session = new ReliableSessionBindingElement();
- _compositeDuplex = new CompositeDuplexBindingElement();
- _transactionFlow = new TransactionFlowBindingElement();
- }
-
- public override BindingElementCollection CreateBindingElements()
- {
- var elements = new BindingElementCollection();
-
- if (_transactionsEnabled)
- {
- elements.Add(_transactionFlow);
- }
- if (!OneWayOnly)
- {
- elements.Add(_session);
- elements.Add(_compositeDuplex);
- }
- elements.Add(_encoding);
- elements.Add(_transport);
-
- return elements;
- }
-
-
-
- /// <summary>
- /// Gets the scheme used by the binding, soap.amqp
- /// </summary>
- public override string Scheme
- {
- get { return "soap.amqp"; }
- }
-
- /// <summary>
- /// Specifies the broker host
- /// </summary>
- [ConfigurationProperty("host")]
- public string Host
- {
- get { return _host; }
- set { _host = value; }
- }
-
- /// <summary>
- /// Specifies the broker port
- /// </summary>
- public int PortNumber
- {
- get { return _port; }
- set { _port = value; }
- }
-
- /// <summary>
- /// Specifies the username
- /// </summary>
- public string UserName
- {
- get { return _username; }
- set { _username = value; }
- }
-
- /// <summary>
- /// Specifies the password
- /// </summary>
- public string Password
- {
- get { return _password; }
- set { _password = value; }
- }
-
- /// <summary>
- /// Specifies the virtualhost
- /// </summary>
- public string VirtualHost
- {
- get { return _virtuaHost; }
- set { _virtuaHost = value; }
- }
-
-
- /// <summary>
- /// Gets the AMQP _transport binding element
- /// </summary>
- public QpidTransportBindingElement Transport
- {
- get { return _transport; }
- }
-
- /// <summary>
- /// Gets the reliable _session parameters for this binding instance
- /// </summary>
- public ReliableSession ReliableSession
- {
- get { return new ReliableSession(_session); }
- }
-
- /// <summary>
- /// Determines whether or not the TransactionFlowBindingElement will
- /// be added to the channel stack
- /// </summary>
- public bool TransactionFlow
- {
- get { return _transactionsEnabled; }
- set { _transactionsEnabled = value; }
- }
-
- /// <summary>
- /// Specifies whether or not the CompositeDuplex and ReliableSession
- /// binding elements are added to the channel stack.
- /// </summary>
- public bool OneWayOnly
- {
- get { return _oneWayOnly; }
- set { _oneWayOnly = value; }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelBase.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelBase.cs
deleted file mode 100644
index 25789a7955..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelBase.cs
+++ /dev/null
@@ -1,167 +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;
-using System.ServiceModel;
-using System.ServiceModel.Channels;
-
-namespace org.apache.qpid.wcf.model
-{
- internal abstract class QpidChannelBase : IChannel
- {
- private readonly CommunicationOperation _closeMethod;
- private readonly BindingContext _context;
- private readonly CommunicationOperation _openMethod;
- private CommunicationState _state;
-
- private QpidChannelBase()
- {
- _state = CommunicationState.Created;
- _closeMethod = Close;
- _openMethod = Open;
- }
-
- protected QpidChannelBase(BindingContext context)
- : this()
- {
- _context = context;
- }
-
- public abstract void Close(TimeSpan timeout);
-
- public abstract void Open(TimeSpan timeout);
-
- public virtual void Abort()
- {
- Close();
- }
-
- public virtual void Close()
- {
- Close(_context.Binding.CloseTimeout);
- }
-
- public virtual T GetProperty<T>() where T : class
- {
- return default(T);
- }
-
- public virtual void Open()
- {
- Open(_context.Binding.OpenTimeout);
- }
-
- #region Async Methods
-
- public virtual IAsyncResult BeginClose(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return _closeMethod.BeginInvoke(timeout, callback, state);
- }
-
- public virtual IAsyncResult BeginClose(AsyncCallback callback, object state)
- {
- return _closeMethod.BeginInvoke(_context.Binding.CloseTimeout, callback, state);
- }
-
- public virtual IAsyncResult BeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return _openMethod.BeginInvoke(timeout, callback, state);
- }
-
- public virtual IAsyncResult BeginOpen(AsyncCallback callback, object state)
- {
- return _openMethod.BeginInvoke(_context.Binding.OpenTimeout, callback, state);
- }
-
- public virtual void EndClose(IAsyncResult result)
- {
- _closeMethod.EndInvoke(result);
- }
-
- public virtual void EndOpen(IAsyncResult result)
- {
- _openMethod.EndInvoke(result);
- }
-
- #endregion
-
- #region Event Raising Methods
-
- protected void OnOpening()
- {
- _state = CommunicationState.Opening;
- if (Opening != null)
- Opening(this, null);
- }
-
- protected void OnOpened()
- {
- _state = CommunicationState.Opened;
- if (Opened != null)
- Opened(this, null);
- }
-
- protected void OnClosing()
- {
- _state = CommunicationState.Closing;
- if (Closing != null)
- Closing(this, null);
- }
-
- protected void OnClosed()
- {
- _state = CommunicationState.Closed;
- if (Closed != null)
- Closed(this, null);
- }
-
- protected void OnFaulted()
- {
- _state = CommunicationState.Faulted;
- if (Faulted != null)
- Faulted(this, null);
- }
-
- #endregion
-
-
- public CommunicationState State
- {
- get { return _state; }
- }
-
- protected BindingContext Context
- {
- get { return _context; }
- }
-
-
- public event EventHandler Closed;
-
- public event EventHandler Closing;
-
- public event EventHandler Faulted;
-
- public event EventHandler Opened;
-
- public event EventHandler Opening;
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelFactory.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelFactory.cs
deleted file mode 100644
index fd26cbed99..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelFactory.cs
+++ /dev/null
@@ -1,74 +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;
-using System.ServiceModel;
-using System.ServiceModel.Channels;
-using org.apache.qpid.client;
-
-namespace org.apache.qpid.wcf.model
-{
- public class QpidChannelFactory : ChannelFactoryBase<IOutputChannel>
- {
- private readonly BindingContext _context;
- private readonly CommunicationOperation _openMethod;
- private readonly QpidTransportBindingElement _bindingElement;
- private ClientSession _session;
-
- public QpidChannelFactory(BindingContext context)
- {
- _context = context;
- _openMethod = Open;
- _bindingElement = context.Binding.Elements.Find<QpidTransportBindingElement>();
- }
-
- protected override IOutputChannel OnCreateChannel(EndpointAddress address, Uri via)
- {
- return new QpidOutputChannel(_context, _session, address);
- }
-
- protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return _openMethod.BeginInvoke(timeout, callback, state);
- }
-
- protected override void OnEndOpen(IAsyncResult result)
- {
- _openMethod.EndInvoke(result);
- }
-
- protected override void OnOpen(TimeSpan timeout)
- {
- _session = _bindingElement.Open(timeout.Milliseconds);
- }
-
- protected override void OnClose(TimeSpan timeout)
- {
- _bindingElement.Close();
- }
-
- protected override void OnAbort()
- {
- base.OnAbort();
- OnClose(_context.Binding.CloseTimeout);
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelListener.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelListener.cs
deleted file mode 100644
index ea795775b4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelListener.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.
-*
-*/
-
-using System;
-using System.ServiceModel;
-using System.ServiceModel.Channels;
-using org.apache.qpid.client;
-
-namespace org.apache.qpid.wcf.model
-{
- public sealed class QpidChannelListener : QpidChannelListenerBase<IInputChannel>
- {
-
- private IInputChannel _channel;
- private ClientSession _session;
-
- public QpidChannelListener(BindingContext context)
- : base(context)
- {
- _channel = null;
- _session = null;
- }
-
- protected override IInputChannel OnAcceptChannel(TimeSpan timeout)
- {
- // Since only one connection to a broker is required (even for communication
- // with multiple exchanges
- if (_channel != null)
- return null;
-
- _channel = new QpidInputChannel(Context, _session, new EndpointAddress(Uri.ToString()));
- _channel.Closed += ListenChannelClosed;
- return _channel;
- }
-
- protected override bool OnWaitForChannel(TimeSpan timeout)
- {
- return false;
- }
-
- protected override void OnOpen(TimeSpan timeout)
- {
- _session = _bindingElement.Open(timeout.Milliseconds);
- }
-
- protected override void OnClose(TimeSpan timeout)
- {
- if (_channel != null)
- {
- _channel.Close();
- _channel = null;
- }
- _bindingElement.Close();
- }
-
- private void ListenChannelClosed(object sender, EventArgs args)
- {
- Close();
- }
-}
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelListenerBase.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelListenerBase.cs
deleted file mode 100644
index f2bba9316a..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidChannelListenerBase.cs
+++ /dev/null
@@ -1,111 +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;
-using System.ServiceModel.Channels;
-using System.ServiceModel.Description;
-
-namespace org.apache.qpid.wcf.model
-{
- public abstract class QpidChannelListenerBase<TChannel> : ChannelListenerBase<TChannel> where TChannel: class, IChannel
- {
- private readonly Uri _listenUri;
- private readonly BindingContext _context;
- protected QpidTransportBindingElement _bindingElement;
- private readonly CommunicationOperation _closeMethod;
- private readonly CommunicationOperation _openMethod;
- private readonly CommunicationOperation<TChannel> _acceptChannelMethod;
- private readonly CommunicationOperation<bool> _waitForChannelMethod;
-
- protected QpidChannelListenerBase(BindingContext context)
- {
- _context = context;
- _bindingElement = context.Binding.Elements.Find<QpidTransportBindingElement>();
- _closeMethod = OnClose;
- _openMethod = OnOpen;
- _waitForChannelMethod = OnWaitForChannel;
- _acceptChannelMethod = OnAcceptChannel;
- if (context.ListenUriMode == ListenUriMode.Explicit && context.ListenUriBaseAddress != null)
- {
- _listenUri = new Uri(context.ListenUriBaseAddress, context.ListenUriRelativeAddress);
- }
- else
- {
- _listenUri = new Uri(new Uri("soap.amqp:///"), Guid.NewGuid().ToString());
- }
- }
-
- protected override void OnAbort()
- {
- OnClose(_context.Binding.CloseTimeout);
- }
-
- protected override IAsyncResult OnBeginAcceptChannel(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return _acceptChannelMethod.BeginInvoke(timeout, callback, state);
- }
-
- protected override TChannel OnEndAcceptChannel(IAsyncResult result)
- {
- return _acceptChannelMethod.EndInvoke(result);
- }
-
- protected override IAsyncResult OnBeginWaitForChannel(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return _waitForChannelMethod.BeginInvoke(timeout, callback, state);
- }
-
- protected override bool OnEndWaitForChannel(IAsyncResult result)
- {
- return _waitForChannelMethod.EndInvoke(result);
- }
-
- protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return _closeMethod.BeginInvoke(timeout, callback, state);
- }
-
- protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return _openMethod.BeginInvoke(timeout, callback, state);
- }
-
- protected override void OnEndClose(IAsyncResult result)
- {
- _closeMethod.EndInvoke(result);
- }
-
- protected override void OnEndOpen(IAsyncResult result)
- {
- _openMethod.EndInvoke(result);
- }
-
- public override Uri Uri
- {
- get { return _listenUri; }
- }
-
- protected BindingContext Context
- {
- get { return _context; }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidInputChannel.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidInputChannel.cs
deleted file mode 100644
index 3e257a7744..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidInputChannel.cs
+++ /dev/null
@@ -1,218 +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;
-using System.Collections.Generic;
-using System.IO;
-using System.ServiceModel;
-using System.ServiceModel.Channels;
-using System.Text;
-using System.Threading;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.wcf.model
-{
- internal sealed class QpidInputChannel : QpidInputChannelBase
- {
- private static readonly Logger _log = Logger.get(typeof (QpidInputChannel));
-
- private readonly QpidTransportBindingElement _bindingElement;
- private readonly MessageEncoder _encoder;
- private readonly ClientSession _session;
- private readonly string _queueName;
- private BlockingQueue _queue;
- private bool _closed = false;
-
- public QpidInputChannel(BindingContext context, ClientSession session, EndpointAddress address)
- : base(context, address)
- {
- _bindingElement = context.Binding.Elements.Find<QpidTransportBindingElement>();
- var encoderElem = context.BindingParameters.Find<MessageEncodingBindingElement>();
- if (encoderElem != null)
- {
- _encoder = encoderElem.CreateMessageEncoderFactory().Encoder;
- }
- _session = session;
- _queueName = address.Uri.ToString();
- _queue = new BlockingQueue();
- }
-
-
- public override System.ServiceModel.Channels.Message Receive(TimeSpan timeout)
- {
- _session.messageFlow("myDest", MessageCreditUnit.MESSAGE, 1);
- _session.sync();
- IMessage m = _queue.Dequeue();
- System.ServiceModel.Channels.Message result = null;
- if (m != null)
- {
- var reader = new BinaryReader(m.Body, Encoding.UTF8);
- var body = new byte[m.Body.Length - m.Body.Position];
- reader.Read(body, 0, body.Length);
- try
- {
- result = _encoder.ReadMessage(new MemoryStream(body),
- (int) _bindingElement.MaxReceivedMessageSize);
- }
- catch(Exception e)
- {
- Console.WriteLine(e.StackTrace);
- }
- result.Headers.To = LocalAddress.Uri;
-
- var ack = new RangeSet();
- // ack this message
- ack.add(m.Id);
- _session.messageAccept(ack);
- _session.sync();
- }
- else
- {
- if(! _closed )
- {
- return Receive(timeout);
- }
- }
- return result;
- }
-
- public override bool TryReceive(TimeSpan timeout, out System.ServiceModel.Channels.Message message)
- {
- message = Receive(timeout);
- return message != null;
- }
-
- public override bool WaitForMessage(TimeSpan timeout)
- {
- throw new NotImplementedException();
- }
-
- public override void Close(TimeSpan timeout)
- {
- _closed = true;
- _queue = null;
- }
-
- public override void Open(TimeSpan timeout)
- {
- if (State != CommunicationState.Created && State != CommunicationState.Closed)
- throw new InvalidOperationException(string.Format("Cannot open the channel from the {0} state.", State));
-
- OnOpening();
-
- var qr = (QueueQueryResult) _session.queueQuery(_queueName).Result;
- if (qr.getQueue() == null)
- {
- // create the queue
- _session.queueDeclare(_queueName, null, null);
- }
- // bind the queue
- _session.exchangeBind(_queueName, "amq.direct", _queueName, null);
- var myListener = new WCFListener(_queue);
- _session.attachMessageListener(myListener, "myDest");
- _session.messageSubscribe(_queueName, "myDest", MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED,
- null,
- 0, null);
- // issue credits
- _session.messageSetFlowMode("myDest", MessageFlowMode.WINDOW);
- _session.messageFlow("myDest", MessageCreditUnit.BYTE, ClientSession.MESSAGE_FLOW_MAX_BYTES);
- _session.sync();
-
- OnOpened();
- }
- }
-
- internal class WCFListener : IMessageListener
- {
- private static readonly Logger _log = Logger.get(typeof (WCFListener));
- private readonly BlockingQueue _q;
-
- public WCFListener(BlockingQueue q)
- {
- _q = q;
- }
-
- public void messageTransfer(IMessage m)
- {
- _log.debug("message received by listener");
- _q.Enqueue(m);
- }
- }
-
- internal class BlockingQueue
- {
- private int _count;
- private readonly Queue<IMessage> _queue = new Queue<IMessage>();
-
- public IMessage Dequeue(TimeSpan timeout)
- {
- lock (_queue)
- {
- DateTime start = DateTime.Now;
- long elapsed = 0;
- while (_count <= 0 && elapsed < timeout.Milliseconds)
- {
- Monitor.Wait(_queue, new TimeSpan(timeout.Milliseconds - elapsed));
- elapsed = DateTime.Now.Subtract(start).Milliseconds;
- }
- if (_count > 0)
- {
- _count--;
- return _queue.Dequeue();
- }
- return null;
- }
- }
-
- public IMessage Dequeue()
- {
- lock (_queue)
- {
- while (_count <= 0)
- {
- Monitor.Wait(_queue);
- }
- if (_count > 0)
- {
- _count--;
- return _queue.Dequeue();
- }
- return null;
- }
- }
-
- public void Enqueue(IMessage data)
- {
- if (data != null)
- {
- lock (_queue)
- {
- _queue.Enqueue(data);
- _count++;
- Monitor.Pulse(_queue);
- }
- }
- }
- }
-}
-
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidInputChannelBase.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidInputChannelBase.cs
deleted file mode 100644
index 94aa459eab..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidInputChannelBase.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.
-*
-*/
-
-using System;
-using System.ServiceModel;
-using System.ServiceModel.Channels;
-
-namespace org.apache.qpid.wcf.model
-{
- internal abstract class QpidInputChannelBase : QpidChannelBase, IInputChannel
- {
- private readonly EndpointAddress _localAddress;
- private readonly CommunicationOperation<Message> _receiveMethod;
- private readonly CommunicationOperation<bool, Message> _tryReceiveMethod;
- private readonly CommunicationOperation<bool> _waitForMessage;
-
-
- protected QpidInputChannelBase(BindingContext context, EndpointAddress localAddress)
- :base(context)
- {
- _localAddress = localAddress;
- _receiveMethod = Receive;
- _tryReceiveMethod = TryReceive;
- _waitForMessage = WaitForMessage;
- }
-
-
- #region Async Methods
- public virtual IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return _receiveMethod.BeginInvoke(timeout, callback, state);
- }
-
- public virtual IAsyncResult BeginReceive(AsyncCallback callback, object state)
- {
- return _receiveMethod.BeginInvoke(Context.Binding.ReceiveTimeout, callback, state);
- }
-
- public virtual IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state)
- {
- Message message;
- return _tryReceiveMethod.BeginInvoke(timeout, out message, callback, state);
- }
-
- public virtual IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state)
- {
- return _waitForMessage.BeginInvoke(timeout, callback, state);
- }
-
- public virtual Message EndReceive(IAsyncResult result)
- {
- return _receiveMethod.EndInvoke(result);
- }
-
- public virtual bool EndTryReceive(IAsyncResult result, out Message message)
- {
- return _tryReceiveMethod.EndInvoke(out message, result);
- }
-
- public virtual bool EndWaitForMessage(IAsyncResult result)
- {
- return _waitForMessage.EndInvoke(result);
- }
- #endregion
-
- public abstract Message Receive(TimeSpan timeout);
-
- public abstract bool TryReceive(TimeSpan timeout, out Message message);
-
- public abstract bool WaitForMessage(TimeSpan timeout);
-
- public virtual Message Receive()
- {
- return Receive(Context.Binding.ReceiveTimeout);
- }
-
-
- public EndpointAddress LocalAddress
- {
- get { return _localAddress; }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidOutputChannel.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidOutputChannel.cs
deleted file mode 100644
index cd580d4ce5..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidOutputChannel.cs
+++ /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.
-*
-*/
-
-using System;
-using System.IO;
-using System.ServiceModel;
-using System.ServiceModel.Channels;
-using org.apache.qpid.client;
-using org.apache.qpid.transport;
-using org.apache.qpid.transport.util;
-
-namespace org.apache.qpid.wcf.model
-{
- internal sealed class QpidOutputChannel : QpidOutputChannelBase
- {
- private readonly MessageEncoder _encoder;
- private readonly ClientSession _session;
- private readonly string _queueName;
-
- public QpidOutputChannel(BindingContext context, ClientSession session, EndpointAddress address)
- : base(context, address)
- {
- var encoderElement = context.Binding.Elements.Find<MessageEncodingBindingElement>();
- if (encoderElement != null)
- {
- _encoder = encoderElement.CreateMessageEncoderFactory().Encoder;
- }
- _queueName = address.Uri.ToString();
- _session = session;
- }
-
- public override void Send(System.ServiceModel.Channels.Message message, TimeSpan timeout)
- {
- if (message.State != MessageState.Closed)
- {
- byte[] body;
- using (var str = new MemoryStream())
- {
- _encoder.WriteMessage(message, str);
- body = str.ToArray();
- }
- _session.messageTransfer("amq.direct", MessageAcceptMode.NONE, MessageAcquireMode.PRE_ACQUIRED,
- new Header(new DeliveryProperties().setRoutingKey(_queueName),
- new transport.MessageProperties().setMessageId(UUID.randomUUID())),
- body);
- }
- }
-
- public override void Close(TimeSpan timeout)
- {
- if (State == CommunicationState.Closed || State == CommunicationState.Closing)
- return; // Ignore the call, we're already closing.
- OnClosing();
- OnClosed();
- }
-
- public override void Open(TimeSpan timeout)
- {
- if (State != CommunicationState.Created && State != CommunicationState.Closed)
- throw new InvalidOperationException(string.Format("Cannot open the channel from the {0} state.", State));
- OnOpening();
- var qr = (QueueQueryResult) _session.queueQuery(_queueName).Result;
- if (qr.getQueue() == null)
- {
- // create the queue
- _session.queueDeclare(_queueName, null, null);
- }
- OnOpened();
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidOutputChannelBase.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidOutputChannelBase.cs
deleted file mode 100644
index bcf6b4b6b8..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidOutputChannelBase.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.
-*
-*/
-
-using System;
-using System.ServiceModel;
-using System.ServiceModel.Channels;
-
-namespace org.apache.qpid.wcf.model
-{
- internal abstract class QpidOutputChannelBase : QpidChannelBase, IOutputChannel
- {
-
- private readonly SendOperation _sendMethod;
- private readonly EndpointAddress _address;
-
- protected QpidOutputChannelBase(BindingContext context, EndpointAddress address)
- : base(context)
- {
- _address = address;
- _sendMethod = Send;
- }
-
- #region Async Methods
-
- public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state)
- {
- return _sendMethod.BeginInvoke(message, timeout, callback, state);
- }
-
- public IAsyncResult BeginSend(Message message, AsyncCallback callback, object state)
- {
- return _sendMethod.BeginInvoke(message, Context.Binding.SendTimeout, callback, state);
- }
-
- public void EndSend(IAsyncResult result)
- {
- _sendMethod.EndInvoke(result);
- }
-
- #endregion
-
- public abstract void Send(Message message, TimeSpan timeout);
-
- public virtual void Send(Message message)
- {
- Send(message, Context.Binding.SendTimeout);
- }
-
- public EndpointAddress RemoteAddress
- {
- get { return _address; }
- }
-
- public Uri Via
- {
- get { throw new NotImplementedException(); }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidTransportBindingElement.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidTransportBindingElement.cs
deleted file mode 100644
index 1c37de45d8..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidTransportBindingElement.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.
-*
-*/
-
-using System;
-using System.Configuration;
-using System.ServiceModel.Channels;
-using org.apache.qpid.client;
-
-namespace org.apache.qpid.wcf.model
-{
- public sealed class QpidTransportBindingElement : TransportBindingElement
- {
- private Client _connection;
- private string _host;
- private int _port;
- private string _username;
- private string _password;
- private string _virtuaHost;
-
- /// <summary>
- /// Creates a new instance of the QpidTransportBindingElement Class
- /// </summary>
- public QpidTransportBindingElement()
- {
- _host = "localhost";
- _port = 5672;
- _username = "guest";
- _password = "guest";
- _virtuaHost = "test";
- }
-
- private QpidTransportBindingElement(QpidTransportBindingElement other)
- : this()
- {
- Connection = other.Connection;
- Host = other.Host;
- PortNumber = other.PortNumber;
- UserName = other.UserName;
- Password = other.Password;
- }
-
-
- public override IChannelFactory<TChannel> BuildChannelFactory<TChannel>(BindingContext context)
- {
- if (Host == null)
- throw new InvalidOperationException("No broker was specified.");
- return (IChannelFactory<TChannel>) new QpidChannelFactory(context);
- }
-
- public override IChannelListener<TChannel> BuildChannelListener<TChannel>(BindingContext context)
- {
- if (Host == null)
- throw new InvalidOperationException("No broker was specified.");
-
- return (IChannelListener<TChannel>) ((object) new QpidChannelListener(context));
- }
-
- public override bool CanBuildChannelFactory<TChannel>(BindingContext context)
- {
- return typeof (TChannel) == typeof (IOutputChannel);
- }
-
- public override bool CanBuildChannelListener<TChannel>(BindingContext context)
- {
- return typeof (TChannel) == typeof (IInputChannel);
- }
-
- public override BindingElement Clone()
- {
- return new QpidTransportBindingElement(this);
- }
-
- public override T GetProperty<T>(BindingContext context)
- {
- return context.GetInnerProperty<T>();
- }
-
- /// <summary>
- /// Gets the scheme used by the binding, this is 0.10 as default for now.
- /// </summary>
- public override string Scheme
- {
- get { return "soap.amqp"; }
- }
-
-
- /// <summary>
- /// Specifies the broker host
- /// </summary>
- [ConfigurationProperty("host")]
- public string Host
- {
- get { return _host; }
- set { _host = value; }
- }
-
- /// <summary>
- /// Specifies the broker port
- /// </summary>
- public int PortNumber
- {
- get { return _port; }
- set { _port = value; }
- }
-
- /// <summary>
- /// Specifies the username
- /// </summary>
- public string UserName
- {
- get { return _username; }
- set { _username = value; }
- }
-
- /// <summary>
- /// Specifies the password
- /// </summary>
- public string Password
- {
- get { return _password; }
- set { _password = value; }
- }
-
- /// <summary>
- /// Specifies the virtualhost
- /// </summary>
- public string VirtualHost
- {
- get { return _virtuaHost; }
- set { _virtuaHost = value; }
- }
-
- /// <summary>
- /// Specifies the connection
- /// </summary>
- public Client Connection
- {
- get { return _connection; }
- set { _connection = value; }
- }
-
-
- internal ClientSession Open(long timeout)
- {
- if (Connection == null)
- {
- Connection = new Client();
- }
- Connection.connect(Host, PortNumber, VirtualHost, UserName, Password);
- return Connection.createSession(timeout);
- }
-
- internal void Close()
- {
- if (Connection != null)
- {
- try
- {
- Connection.close();
- }
- catch (Exception e)
- {
- // todo log it
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidTransportElement.cs b/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidTransportElement.cs
deleted file mode 100644
index 8a829e5b13..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/model/QpidTransportElement.cs
+++ /dev/null
@@ -1,183 +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;
-using System.Configuration;
-using System.Reflection;
-using System.ServiceModel.Channels;
-using System.ServiceModel.Configuration;
-
-namespace org.apache.qpid.wcf.model
-{
- public sealed class QpidTransportElement : TransportElement
- {
-
- public override void ApplyConfiguration(BindingElement bindingElement)
- {
- base.ApplyConfiguration(bindingElement);
- if (bindingElement == null)
- throw new ArgumentNullException("bindingElement");
-
- var bindind = bindingElement as QpidTransportBindingElement;
- if (bindind == null)
- {
- throw new ArgumentException(
- string.Format("Invalid type for binding. Expected {0}, Passed: {1}",
- typeof(QpidTransportBindingElement).AssemblyQualifiedName,
- bindingElement.GetType().AssemblyQualifiedName));
- }
-
- bindind.Host = Host;
- bindind.Password = Password;
- bindind.UserName = UserName;
- bindind.VirtualHost = VirtualHost;
- bindind.PortNumber = PortNumber;
- }
-
- public override void CopyFrom(ServiceModelExtensionElement from)
- {
- base.CopyFrom(from);
- var element = from as QpidTransportElement;
- if (element != null)
- {
- Host = element.Host;
- PortNumber = element.PortNumber;
- Password = element.Password;
- UserName = element.UserName;
- VirtualHost = element.VirtualHost;
- }
- }
-
- protected override BindingElement CreateBindingElement()
- {
- TransportBindingElement element = CreateDefaultBindingElement();
- ApplyConfiguration(element);
- return element;
- }
-
- protected override TransportBindingElement CreateDefaultBindingElement()
- {
- return new QpidTransportBindingElement();
- }
-
- protected override void InitializeFrom(BindingElement bindingElement)
- {
- base.InitializeFrom(bindingElement);
-
- if (bindingElement == null)
- throw new ArgumentNullException("bindingElement");
-
- var binding = bindingElement as QpidTransportBindingElement;
- if (binding == null)
- {
- throw new ArgumentException(
- string.Format("Invalid type for binding. Expected {0}, Passed: {1}",
- typeof(QpidTransportBindingElement).AssemblyQualifiedName,
- bindingElement.GetType().AssemblyQualifiedName));
- }
-
- Host = binding.Host;
- PortNumber = binding.PortNumber;
- Password = binding.Password;
- UserName = binding.UserName;
- VirtualHost = binding.VirtualHost;
- }
-
- public override Type BindingElementType
- {
- get { return typeof(QpidTransportElement); }
- }
-
-
-
- /// <summary>
- /// Specifies the broker host name that the binding should connect to.
- /// </summary>
- [ConfigurationProperty("host", DefaultValue = "localhost")]
- public string Host
- {
- get { return ((string) base["host"]); }
- set { base["host"] = value; }
- }
-
- /// <summary>
- /// Specifies the broker port number that the binding should connect to.
- /// </summary>
- [ConfigurationProperty("port", DefaultValue = "5672")]
- public int PortNumber
- {
- get { return (Convert.ToInt16(base["port"])); }
- set { base["port"] = value; }
- }
-
- /// <summary>
- /// Password to use when authenticating with the broker
- /// </summary>
- [ConfigurationProperty("password", DefaultValue = "guest")]
- public string Password
- {
- get { return ((string)base["password"]); }
- set { base["password"] = value; }
- }
-
- /// <summary>
- /// The username to use when authenticating with the broker
- /// </summary>
- [ConfigurationProperty("username", DefaultValue = "guest")]
- public string UserName
- {
- get { return ((string)base["username"]); }
- set { base["username"] = value; }
- }
-
-
- /// <summary>
- /// The virtual host to access.
- /// </summary>
- [ConfigurationProperty("virtualHost", DefaultValue = "test")]
- public string VirtualHost
- {
- get { return ((string)base["virtualHost"]); }
- set { base["virtualHost"] = value; }
- }
-
-
- protected override ConfigurationPropertyCollection Properties
- {
- get
- {
- ConfigurationPropertyCollection configProperties = base.Properties;
- foreach (PropertyInfo prop in GetType().GetProperties(BindingFlags.DeclaredOnly
- | BindingFlags.Public
- | BindingFlags.Instance))
- {
- foreach (ConfigurationPropertyAttribute attr in prop.GetCustomAttributes(typeof(ConfigurationPropertyAttribute), false))
- {
- configProperties.Add(
- new ConfigurationProperty(attr.Name, prop.PropertyType, attr.DefaultValue));
- }
- }
-
- return configProperties;
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/wcf.csproj b/M4-RCs/qpid/dotnet/client-010/wcf/wcf.csproj
deleted file mode 100644
index ace42dabd9..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/wcf.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{F1D80D9D-FE22-4213-A760-BFFDE7D131DD}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>WCF</RootNamespace>
- <AssemblyName>qpidWCFModel</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="Qpid Client, Version=0.10.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\client\bin\Debug\Qpid Client.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.configuration" />
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="model\*.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/M4-RCs/qpid/dotnet/client-010/wcf/wcf.sln b/M4-RCs/qpid/dotnet/client-010/wcf/wcf.sln
deleted file mode 100644
index b978f28250..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/wcf.sln
+++ /dev/null
@@ -1,50 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wcfHelloClient", "demo\wcfHelloClient\wcfHelloClient.csproj", "{A24E27DB-A38D-40C9-9879-8390B68C2F06}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wcfHelloServer", "demo\wcfHelloServer\wcfHelloServer.csproj", "{3EF848D7-5FAC-482C-922A-D4D45A4CCD2A}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wcfRPC", "demo\wcfRPC\wcfRPC.csproj", "{C988F456-1025-486F-9BCD-49C0F83B91DB}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wcBookingClient", "demo\wcfBookingClient\wcBookingClient.csproj", "{4086B3FE-F745-4DCC-952A-682CAE01F4C9}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wcfBookingServer", "demo\wcfBookingServer\wcfBookingServer.csproj", "{B34E21C4-A742-4886-8569-1A89490E093E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "wcf", "wcf.csproj", "{F1D80D9D-FE22-4213-A760-BFFDE7D131DD}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A24E27DB-A38D-40C9-9879-8390B68C2F06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A24E27DB-A38D-40C9-9879-8390B68C2F06}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A24E27DB-A38D-40C9-9879-8390B68C2F06}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A24E27DB-A38D-40C9-9879-8390B68C2F06}.Release|Any CPU.Build.0 = Release|Any CPU
- {3EF848D7-5FAC-482C-922A-D4D45A4CCD2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3EF848D7-5FAC-482C-922A-D4D45A4CCD2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3EF848D7-5FAC-482C-922A-D4D45A4CCD2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3EF848D7-5FAC-482C-922A-D4D45A4CCD2A}.Release|Any CPU.Build.0 = Release|Any CPU
- {C988F456-1025-486F-9BCD-49C0F83B91DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C988F456-1025-486F-9BCD-49C0F83B91DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C988F456-1025-486F-9BCD-49C0F83B91DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C988F456-1025-486F-9BCD-49C0F83B91DB}.Release|Any CPU.Build.0 = Release|Any CPU
- {4086B3FE-F745-4DCC-952A-682CAE01F4C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4086B3FE-F745-4DCC-952A-682CAE01F4C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4086B3FE-F745-4DCC-952A-682CAE01F4C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4086B3FE-F745-4DCC-952A-682CAE01F4C9}.Release|Any CPU.Build.0 = Release|Any CPU
- {B34E21C4-A742-4886-8569-1A89490E093E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B34E21C4-A742-4886-8569-1A89490E093E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B34E21C4-A742-4886-8569-1A89490E093E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B34E21C4-A742-4886-8569-1A89490E093E}.Release|Any CPU.Build.0 = Release|Any CPU
- {F1D80D9D-FE22-4213-A760-BFFDE7D131DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F1D80D9D-FE22-4213-A760-BFFDE7D131DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F1D80D9D-FE22-4213-A760-BFFDE7D131DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F1D80D9D-FE22-4213-A760-BFFDE7D131DD}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/M4-RCs/qpid/dotnet/client-010/wcf/wcf.suo b/M4-RCs/qpid/dotnet/client-010/wcf/wcf.suo
deleted file mode 100644
index 60339d33e4..0000000000
--- a/M4-RCs/qpid/dotnet/client-010/wcf/wcf.suo
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/dotnet/default.build b/M4-RCs/qpid/dotnet/default.build
deleted file mode 100644
index b450c2481b..0000000000
--- a/M4-RCs/qpid/dotnet/default.build
+++ /dev/null
@@ -1,252 +0,0 @@
-<?xml version="1.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.
-
--->
-
-<project name="Qpid.NET" default="build">
-
- <!-- Determines the formatter to use to format output of test results. -->
- <property name="nant.formatter" value="Plain" />
-
- <!-- Determines whether a 'debug' or 'release' build is to be done. Defaults to 'debug' -->
- <property name="build.config" value="debug" />
-
- <!-- Sets build properties consistently accross all assemblies in the project. -->
- <property name="build.version.major" value="0"/>
- <property name="build.version.minor" value="3"/>
- <property name="build.version.build" value="0"/>
- <property name="build.version.revision" value="0"/>
- <property name="build.company" value="Apache Software Foundation"/>
- <property name="build.copyright" value="Apache Software Foundation"/>
- <property name="build.description" value="Built from svn revision number: "/>
-
- <!-- Fileset with build files for each 'core' assembly. -->
- <fileset id="src.builds">
- <include name="Qpid.Buffer/default.build" />
- <include name="Qpid.Sasl/default.build" />
- <include name="Qpid.Messaging/default.build" />
- <include name="Qpid.Codec/default.build" />
- <include name="Qpid.Common/default.build" />
- <include name="Qpid.Client/default.build" />
- </fileset>
-
- <!-- Fileset with build files for 'pure unit' test assemblies. -->
- <fileset id="tests.pure.builds">
- <include name="Qpid.Buffer.Tests/default.build" />
- <include name="Qpid.Sasl.Tests/default.build" />
- <include name="Qpid.Common.Tests/default.build" />
- <include name="Qpid.Client.Tests/default.build" />
- </fileset>
-
- <!-- Fileset with build files for 'integration' test assemblies. -->
- <fileset id="tests.integration.builds">
- <include name="Qpid.Integration.Tests/default.build" />
- </fileset>
-
- <!-- Other test or utility assemblies. -->
- <fileset id='other.builds'>
- <include name="TopicListener/default.build" />
- <include name="TopicPublisher/default.build" />
- <include name="TestClient/default.build" />
- </fileset>
-
- <!-- Prepare environment for a debug build. -->
- <target name="debug">
- <property name="build.debug" value="true" />
- <property name="build.defines" value="DEBUG;TRACE"/>
- </target>
-
- <!-- Prepare environment for a release build. -->
- <target name="release">
- <property name="build.debug" value="false" />
- <property name="build.defines" value=""/>
- </target>
-
- <!-- Prepare environment for build. -->
- <target name="init">
- <property name="base.dir" value="${project::get-base-directory()}" />
- <property name="build.dir" value="${base.dir}/bin/${framework::get-target-framework()}/${build.config}" />
- <call target="${build.config}" />
- </target>
-
- <!-- Cleans up the build output directory. -->
- <target name="clean" depends="init">
- <delete dir="${build.dir}" failonerror="false" />
- </target>
-
- <!-- Runs 'svnversion' to get the repository revision into the build property 'build.svnversion'. -->
- <target name="svnversion" description="Runs svnversion to get the current repository version into a build script property.">
- <exec program="svnversion" output="svnversion_tmp.txt">
- <arg value="-n"/>
- </exec>
-
- <loadfile file="svnversion_tmp.txt" property="build.svnversion"/>
- <delete file="svnversion_tmp.txt"/>
-
- <!-- For some competely retarted reason the '-n' parameter to svnversion doesn't really work under windows...
- Here is some code to strip the unwanted newlines. -->
- <script language="C#">
- <code><![CDATA[
- public static void ScriptMain(Project project)
- {
- project.Properties["build.svnversion"] = project.Properties["build.svnversion"].Trim("\n\r".ToCharArray());
- }
- ]]>
- </code>
- </script>
-
- </target>
-
- <!-- Performs a regex find-and-replace on assembly info files, substituting fields defined as build properties. -->
- <target name="setversion" description="Stamp the version info onto assemblyinfo.cs files" depends="svnversion">
-
- <echo>build.svnversion = ${build.svnversion}</echo>
-
- <foreach item="File" property="filename">
- <in>
- <items basedir=".">
- <include name="**\AssemblyInfo.cs"></include>
- </items>
- </in>
- <do>
- <script language="C#">
- <code><![CDATA[
- public static void ScriptMain(Project project)
- {
- // Read in the entire file to perform the substitution in.
- StreamReader reader = new StreamReader(project.Properties["filename"]);
- string contents = reader.ReadToEnd();
- reader.Close();
-
- // Substitute the version numbers.
- string replacement = string.Format("[assembly: AssemblyVersion(\"{0}.{1}.{2}.{3}\")]",
- project.Properties["build.version.major"],
- project.Properties["build.version.minor"],
- project.Properties["build.version.build"],
- project.Properties["build.version.revision"]);
- contents = Regex.Replace(contents, @"\[assembly: AssemblyVersion\("".*""\)\]", replacement);
-
- // Substitute the company name and copyright.
- replacement = string.Format("[assembly: AssemblyCompany(\"{0}\")]",
- project.Properties["build.company"]);
- contents = Regex.Replace(contents, @"\[assembly: AssemblyCompany\("".*""\)\]", replacement);
-
- replacement = string.Format("[assembly: AssemblyCopyright(\"{0}\")]",
- project.Properties["build.copyright"]);
- contents = Regex.Replace(contents, @"\[assembly: AssemblyCopyright\("".*""\)\]", replacement);
-
- // Update the description.
- //replacement = string.Format("[assembly: AssemblyDescription(\"{0} {1}\")]",
- // project.Properties["build.description"],
- // project.Properties["build.svnversion"]);
- replacement = string.Format("[assembly: AssemblyDescription(\"{0}\")]",
- project.Properties["build.description"]);
- contents = Regex.Replace(contents, @"\[assembly: AssemblyDescription\("".*""\)\]", replacement);
-
- // Write out the file with the substituted version.
- StreamWriter writer = new StreamWriter(project.Properties["filename"], false);
- writer.Write(contents);
- writer.Close();
- }
- ]]>
- </code>
- </script>
- </do>
- </foreach>
- </target>
-
- <!-- Do the build. -->
- <target name="build" depends="init, setversion">
- <echo message="Building all modules including tests."/>
-
- <!-- Make sure output folder exists. -->
- <mkdir dir="${build.dir}" />
-
- <!-- copy reference assemblies over to the output dir -->
- <copy todir="${build.dir}" file="Qpid.Common/lib/seclib-1.0.0/Org.Mentalis.Security.dll"/>
- <copy todir="${build.dir}" file="Qpid.Common/lib/log4net/log4net.dll"/>
- <copy todir="${build.dir}" file="Qpid.Client.Tests/lib/nunit/nunit.framework.dll"/>
-
- <!-- Compile assemblies. -->
- <nant target="build">
- <buildfiles refid="src.builds" />
- </nant>
-
- <!-- Compile test assemblies. -->
- <nant target="build">
- <buildfiles refid="tests.pure.builds" />
- </nant>
- <nant target="build">
- <buildfiles refid="tests.integration.builds" />
- </nant>
-
- <!-- Compile test assemblies. -->
- <nant target="build">
- <buildfiles refid="other.builds" />
- </nant>
- </target>
-
- <!-- Runs all 'pure unit' tests. -->
- <target name="test" depends="build">
- <echo message="Running all pure unit tests."/>
- <nant target="test">
- <buildfiles refid="tests.pure.builds" />
- </nant>
- </target>
-
- <!-- Runs all 'integration' tests. -->
- <target name="integrationtest" depends="build">
- <echo message="Running all integration tests."/>
- <nant target="test">
- <buildfiles refid="tests.integration.builds" />
- </nant>
- </target>
-
- <!-- Creates a release package. -->
- <target name="release-pkg">
- <echo message="Building and packaging a release."/>
-
- <call target="clean"/>
- <call target="build"/>
-
- <property name="build.date" value="${datetime::now()}"/>
- <property name="build.timestamp" value="${framework::get-target-framework()}-${datetime::get-year(build.date)}${datetime::get-month(build.date)}${datetime::get-day(build.date)}"/>
-
- <zip zipfile="${build.dir}/Qpid.NET-${build.timestamp}.zip">
- <fileset basedir="${build.dir}" prefix="Qpid.NET-${build.timestamp}">
- <include name="**/*.*"/>
- <exclude name="**/*.Tests.*"/>
- <exclude name="**/nunit.framework.dll"/>
- <exclude name="**/*.exe"/>
- </fileset>
-
- <fileset basedir="${base.dir}" prefix="Qpid.NET-${build.timestamp}">
- <include name="LICENSE.txt"/>
- <include name="NOTICE.txt"/>
- <include name="README.txt"/>
- <include name="RELEASE_NOTES.txt"/>
- <include name="DISCLAIMER"/>
- </fileset>
- </zip>
- </target>
-
-</project>
-
-
diff --git a/M4-RCs/qpid/etc/LICENSE b/M4-RCs/qpid/etc/LICENSE
deleted file mode 100644
index bc46b77047..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/etc/NOTICE b/M4-RCs/qpid/etc/NOTICE
deleted file mode 100644
index 05f39ba176..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/etc/svn-auto-props b/M4-RCs/qpid/etc/svn-auto-props
deleted file mode 100644
index 35f1d10998..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/gentools/LICENSE b/M4-RCs/qpid/gentools/LICENSE
deleted file mode 100644
index 43fa6abd19..0000000000
--- a/M4-RCs/qpid/gentools/LICENSE
+++ /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/M4-RCs/qpid/gentools/NOTICE b/M4-RCs/qpid/gentools/NOTICE
deleted file mode 100644
index 09e9ae4902..0000000000
--- a/M4-RCs/qpid/gentools/NOTICE
+++ /dev/null
@@ -1,2 +0,0 @@
-This product includes software developed by The Apache Software Foundation (http://www.apache.org/).
-
diff --git a/M4-RCs/qpid/gentools/README b/M4-RCs/qpid/gentools/README
deleted file mode 100644
index c4abecc199..0000000000
--- a/M4-RCs/qpid/gentools/README
+++ /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.
-================================================================================
-
-AMQP MULTI_VERSION CODE GENERATOR
-
-This directory contains the first part of the new multi-AMQP-version code
-generator. The Java generation is almost complete, C++ will follow.
-
-NOTE: The generator has NOT been integrated into the current build, and is
-included here to run stand-alone for the purposes of review and comment. As
-currently configured, this generator will not interact with any file or
-directory outside of this directory.
-
-To build (from this directory):
-rm org/apache/qpid/gentools/*.class
-javac org/apache/qpid/gentools/Main.java
-
-Make sure you are using Sun's JDK1.5.0; Eclipse and gcj do not work.
-
-To run (from this directory):
-java org/apache/qpid/gentools/Main -j [xml_spec_file, ...]
-
-XML test files are located in the xml-src directory. Pay attention to the
-Basic class and Basic.Consume method - these were the primary test vehicles
-for this generator. *** NOTE *** These files do not represent any current or
-future version of the AMQP specification - do not use in production!
-
-Folders:
---------
-org/apache/qpid/gentools/: Source.
-xml-src/: Test AMQP specification files.
-templ.java/: Templates for java code generation.
-out.java/: Output folder for generated Java files (will be created with use
- of -j flag on command-line).
-templ.cpp/: (Future:) Templates for C++ code generation.
-out.cpp/: Output folder for generated C++ files (will be created with use
- of -c flag on command-line).
-
-For a more detaild description of the generator, see the Qpid Wiki
-(http://cwiki.apache.org/qpid/multiple-amqp-version-support.html).
-
-Please send comments and bugs to me (kim.vdriet [at] redhat.com) or via the
-Apache Qpid list (qpid-dev [at] incubator.apache.org).
-
-Kim van der Riet
diff --git a/M4-RCs/qpid/gentools/README.txt b/M4-RCs/qpid/gentools/README.txt
deleted file mode 100644
index eb364ece53..0000000000
--- a/M4-RCs/qpid/gentools/README.txt
+++ /dev/null
@@ -1,102 +0,0 @@
---------
-Velocity
---------
-
-Welcome to Velocity. Velocity is a general purpose template engine
-written in Java. For more information about Velocity, please look at the
-HTML documentation in the docs/ directory, as well as the Velocity
-web site
-
- http://jakarta.apache.org/velocity/index.html
-
-Here is a description of what each of the top level directories
-contains. Please consult the documentation in each of the lower level
-directories for information that is specific to their contents.
-
-bin/ This is a temporary build directory.
-build/ This is where the build scripts live.
-docs/ This is where the documentation lives.
-examples/ This is where the examples live.
-src/ This is where all of the source code to Velocity lives.
-test/ This is where all of the tests live.
-xdocs/ This is the .xml files for building the .html files
- related to the website and documentation.
-
-REQUIREMENTS
-------------
-
-The Java 2 SDK is required to build Velocity.
-
-For users that wish to use Log4J as the logging
-system, version 1.1 or newer of Log4J is required.
-
-
-INCLUDED PRE-BUILT JARS
------------------------
-If you are using an offical Velocity release distribution,
-you will find two pre-built Velocity jars in the top level
-directory.
-
-PLEASE NOTE : Starting with the 1.2 release, we include two jars
- with the distribution.
-
-1) velocity-<version>.jar : The Velocity jar that does not include
-any external dependencies needed by Velocity, such as the
-jakarta-commons-collection classes, Jakarta Avalon Logkit, or
-Jakarta ORO. We do this to allow you to use whatever version of
-collections, logkit, etc that you wish w/o fear of collision.
-These jars are included in the distribution, in
-the build/lib directory, or at the respective project sites.
-
-2) velocity-dep-<version>.jar : This is a Velocity jar that includes
-all dependencies that were included with previous distribution
-jars. It is intended as a convenience to allow you to drop
-this 1.3 (or later) distribution in place of existing 1.1 or 1.2-dep
- distributions.
-
-Please see the developers guide for more information.
-
-BUILDING VELOCITY
------------------
-
-In order to get started with Velocity, you may want to build it.
-
-Building Velocity is easy. All components necessary to build Velocity are
-included, except for the Java 2 SDK and the fabulous Ant build tool
-from the Jakarta project.
-
-http://jakarta.apache.org/ant/
-
-Note that you must use Ant version 1.4 or later.
-
-To build Velocity's jar, change directory into the build/ directory and
-simply type :
-
-ant jar
-
-This will create a bin/ directory containing the Velocity .jar file. Be
-sure to update your classpath to include Velocity's .jar file, or when using a
-modern servlet container, put it in the WEB-INF/lib directory.
-
-If you wish to build a Velocity jar that contains all dependencies, we have
-provided an optional build target for our convenience :
-
-ant jar-dep
-
-This will build a complete Velocity jar with dependencies included, and it can
-be found in the /bin directory as
-
-velocity-dep-<version>.jar
-
-TRYING THE EXAMPLES
--------------------
-
-After building Velocity, you can also buld the examples that are included
-with the Velocity distribution. These examples show how to use Velocity
-in your Java applications and Servlets. There also are examples of
-how to use Anakia, a XML transformation engine and an example of a servlet-
-based forum application.
-
-For more information, please see the README.txt in the examples/ directory.
-
--The Velocity Team
diff --git a/M4-RCs/qpid/gentools/build b/M4-RCs/qpid/gentools/build
deleted file mode 100755
index a18a984dff..0000000000
--- a/M4-RCs/qpid/gentools/build
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-#
-#
-# 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.
-#
-#
-
-
-cd src
-echo "--------- Building gentools ----------"
-echo "Clearing out old build files..."
-for f in org/apache/qpid/gentools/*.class; do
- if [ -e $f ]; then
- rm $f
- fi
-done
-echo "Compiling..."
-javac -source=1.5 -target=1.5 org/apache/qpid/gentools/*.java
-echo "Done. Try it out..."
-java org.apache.qpid.gentools.Main
-echo "--------- Building gentools completed ----------"
-cd ..
diff --git a/M4-RCs/qpid/gentools/build.xml b/M4-RCs/qpid/gentools/build.xml
deleted file mode 100644
index 5d0976f56d..0000000000
--- a/M4-RCs/qpid/gentools/build.xml
+++ /dev/null
@@ -1,43 +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.
- -
- -->
-<project name="gentools" default="compile">
- <property name="src" location="src" />
-
- <property name="java.source" value="1.5"/>
- <property name="java.target" value="1.5"/>
-
- <target name="compile">
- <javac srcdir="${src}" source="${java.source}" target="${java.target}" fork="true" debug="on">
- <classpath>
- <fileset dir="${src}/../lib">
- <include name="**/*.jar"/>
- </fileset>
- </classpath>
- </javac>
- </target>
-
- <target name="clean">
- <delete>
- <fileset dir="${src}/org/apache/qpid/gentools" includes="*.class" />
- </delete>
- </target>
-
-</project>
diff --git a/M4-RCs/qpid/gentools/lib/LICENSE b/M4-RCs/qpid/gentools/lib/LICENSE
deleted file mode 100644
index e69de29bb2..0000000000
--- a/M4-RCs/qpid/gentools/lib/LICENSE
+++ /dev/null
diff --git a/M4-RCs/qpid/gentools/lib/NOTICE b/M4-RCs/qpid/gentools/lib/NOTICE
deleted file mode 100644
index e69de29bb2..0000000000
--- a/M4-RCs/qpid/gentools/lib/NOTICE
+++ /dev/null
diff --git a/M4-RCs/qpid/gentools/lib/README.txt b/M4-RCs/qpid/gentools/lib/README.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/M4-RCs/qpid/gentools/lib/README.txt
+++ /dev/null
diff --git a/M4-RCs/qpid/gentools/lib/velocity-1.4.jar b/M4-RCs/qpid/gentools/lib/velocity-1.4.jar
deleted file mode 100644
index 04ec9d2f85..0000000000
--- a/M4-RCs/qpid/gentools/lib/velocity-1.4.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/gentools/lib/velocity-dep-1.4.jar b/M4-RCs/qpid/gentools/lib/velocity-dep-1.4.jar
deleted file mode 100644
index 375712b0e8..0000000000
--- a/M4-RCs/qpid/gentools/lib/velocity-dep-1.4.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpClass.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpClass.java
deleted file mode 100644
index 26195da2e3..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpClass.java
+++ /dev/null
@@ -1,197 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.PrintStream;
-import java.util.Collection;
-
-public class AmqpClass implements Printable, NodeAware
-{
-
- private final AmqpVersionSet _versionSet = new AmqpVersionSet();
- private final AmqpFieldMap _fieldMap = new AmqpFieldMap();
- private final AmqpMethodMap _methodMap = new AmqpMethodMap();
- private final AmqpOrdinalVersionMap _indexMap = new AmqpOrdinalVersionMap();
-
-
- private final String _name;
- private final Generator _generator;
-
- public AmqpClass(String name, Generator generator)
- {
- _name = name;
- _generator = generator;
- }
-
- public boolean addFromNode(Node classNode, int ordinal, AmqpVersion version)
- throws AmqpParseException, AmqpTypeMappingException
- {
- getVersionSet().add(version);
- int index = Utils.getNamedIntegerAttribute(classNode, "index");
- AmqpVersionSet indexVersionSet = getIndexMap().get(index);
- if (indexVersionSet != null)
- {
- indexVersionSet.add(version);
- }
- else
- {
- indexVersionSet = new AmqpVersionSet();
- indexVersionSet.add(version);
- getIndexMap().put(index, indexVersionSet);
- }
- NodeList nList = classNode.getChildNodes();
- int fieldCntr = getFieldMap().size();
- for (int i = 0; i < nList.getLength(); i++)
- {
- Node child = nList.item(i);
- if (child.getNodeName().compareTo(Utils.ELEMENT_FIELD) == 0)
- {
- String fieldName = getGenerator().prepareDomainName(Utils.getNamedAttribute(child,
- Utils.ATTRIBUTE_NAME));
- AmqpField thisField = getFieldMap().get(fieldName);
- if (thisField == null)
- {
- thisField = new AmqpField(fieldName, getGenerator());
- getFieldMap().add(fieldName, thisField);
- }
- if (!thisField.addFromNode(child, fieldCntr++, version))
- {
- String className = getGenerator().prepareClassName(Utils.getNamedAttribute(classNode,
- Utils.ATTRIBUTE_NAME));
- System.out.println("INFO: Generation supression tag found for field " +
- className + "." + fieldName + " - removing.");
- thisField.removeVersion(version);
- getFieldMap().remove(fieldName);
- }
- }
- else if (child.getNodeName().compareTo(Utils.ELEMENT_METHOD) == 0)
- {
- String methodName = getGenerator().prepareMethodName(Utils.getNamedAttribute(child,
- Utils.ATTRIBUTE_NAME));
- AmqpMethod thisMethod = getMethodMap().get(methodName);
- if (thisMethod == null)
- {
- thisMethod = new AmqpMethod(methodName, getGenerator());
- getMethodMap().put(methodName, thisMethod);
- }
- if (!thisMethod.addFromNode(child, 0, version))
- {
- String className = getGenerator().prepareClassName(Utils.getNamedAttribute(classNode,
- Utils.ATTRIBUTE_NAME));
- System.out.println("INFO: Generation supression tag found for method " +
- className + "." + methodName + " - removing.");
- thisMethod.removeVersion(version);
- getMethodMap().remove(methodName);
- }
- }
- else if (child.getNodeName().compareTo(Utils.ELEMENT_CODEGEN) == 0)
- {
- String value = Utils.getNamedAttribute(child, Utils.ATTRIBUTE_VALUE);
- if (value.compareTo("no-gen") == 0)
- {
- return false;
- }
- }
- }
- return true;
- }
-
- public void removeVersion(AmqpVersion version)
- {
- getIndexMap().removeVersion(version);
- getFieldMap().removeVersion(version);
- getMethodMap().removeVersion(version);
- getVersionSet().remove(version);
- }
-
- public void print(PrintStream out, int marginSize, int tabSize)
- {
- String margin = Utils.createSpaces(marginSize);
- String tab = Utils.createSpaces(tabSize);
- out.println(margin + "[C] " + getName() + ": " + getVersionSet());
-
- for (Integer thisIndex : getIndexMap().keySet())
- {
- AmqpVersionSet indexVersionSet = getIndexMap().get(thisIndex);
- out.println(margin + tab + "[I] " + thisIndex + indexVersionSet);
- }
-
- for (String thisFieldName : getFieldMap().keySet())
- {
- AmqpField thisField = getFieldMap().get(thisFieldName);
- thisField.print(out, marginSize + tabSize, tabSize);
- }
-
- for (String thisMethodName : getMethodMap().keySet())
- {
- AmqpMethod thisMethod = getMethodMap().get(thisMethodName);
- thisMethod.print(out, marginSize + tabSize, tabSize);
- }
- }
-
- public AmqpVersionSet getVersionSet()
- {
- return _versionSet;
- }
-
- public Generator getGenerator()
- {
- return _generator;
- }
-
-
- public AmqpFieldMap getFieldMap()
- {
- return _fieldMap;
- }
-
-
- public AmqpMethodMap getMethodMap()
- {
- return _methodMap;
- }
-
- public Collection<AmqpMethod> getMethods()
- {
- return getMethodMap().values();
- }
-
-
- public String getName()
- {
- return _name;
- }
-
-
- public AmqpOrdinalVersionMap getIndexMap()
- {
- return _indexMap;
- }
-
- public SingleVersionClass asSingleVersionClass(AmqpVersion version)
- {
- return new SingleVersionClass(this,version, _generator);
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java
deleted file mode 100644
index a27a50d07e..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpClassMap extends TreeMap<String, AmqpClass>
-{
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpConstant.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpConstant.java
deleted file mode 100644
index df5bc6c362..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpConstant.java
+++ /dev/null
@@ -1,191 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.io.PrintStream;
-import java.util.TreeMap;
-
-/**
- * @author kpvdr
- * Class to represent the &lt;constant&gt; declaration within the AMQP specification.
- * Currently, only integer values exist within the specification, however looking forward
- * to other possible types in the future, string and double types are also supported.
- * <p/>
- * The &lt;constant&gt; declaration in the specification contains only two attributes:
- * name and value.
- * <p/>
- * The value of the constant is mapped against the version(s) for which the name is defined.
- * This allows for a change in the value rather than the name only from one version to the next.
- */
-@SuppressWarnings("serial")
-public class AmqpConstant extends TreeMap<String, AmqpVersionSet>
- implements Printable, VersionConsistencyCheck, Comparable<AmqpConstant>
-{
- /**
- * Constant name as defined by the name attribute of the &lt;constant&gt; declaration.
- */
- private final String _name;
-
- /**
- * Set of versions for which this constant name is defined.
- */
- private final AmqpVersionSet _versionSet;
-
- /**
- * Constructor
- *
- * @param name Constant name as defined by the name attribute of the &lt;constant&gt; declaration.
- * @param value Constant value as defined by the value attribute of the &lt;constant&gt; declaration.
- * @param version AMQP version for which this constant is defined
- */
- public AmqpConstant(String name, String value, AmqpVersion version)
- {
- _name = name;
- _versionSet = new AmqpVersionSet(version);
- AmqpVersionSet valueVersionSet = new AmqpVersionSet(version);
- put(value, valueVersionSet);
- }
-
-
- /**
- * Get the name of this constant.
- *
- * @return Name of this constant, being the name attribute of the &lt;constant&gt; declaration
- * represented by this class.
- */
- public String getName()
- {
- return _name;
- }
-
- /**
- * Get the value of this constant as a String.
- *
- * @param version AMQP version for which this value is required.
- * @return Value of this constant, being the value attribute of the &lt;constant&gt; declaration
- * represented by this class.
- * @throws AmqpTypeMappingException when a value is requested for a version for which it is not
- * defined in the AMQP specifications.
- */
- public String getStringValue(AmqpVersion version)
- throws AmqpTypeMappingException
- {
- for (String thisValue : keySet())
- {
- AmqpVersionSet versionSet = get(thisValue);
- if (versionSet.contains(version))
- {
- return thisValue;
- }
- }
- throw new AmqpTypeMappingException("Unable to find value for constant \"" + getName() +
- "\" for version " + version.toString() + ".");
- }
-
- /**
- * Get the value of this constant as an integer.
- *
- * @param version AMQP version for which this value is required.
- * @return Value of this constant, being the value attribute of the &lt;constant&gt; declaration
- * represented by this class.
- * @throws AmqpTypeMappingException when a value is requested for a version for which it is not
- * defined in the AMQP specifications.
- */
- public int getIntegerValue(AmqpVersion version)
- throws AmqpTypeMappingException
- {
- return Integer.parseInt(getStringValue(version));
- }
-
- /**
- * Get the value of this constant as a double.
- *
- * @param version AMQP version for which this value is required.
- * @return Value of this constant, being the value attribute of the &lt;constant&gt; declaration
- * represented by this class.
- * @throws AmqpTypeMappingException when a value is requested for a version for which it is not
- * defined in the AMQP specifications.
- */
- public double getDoubleValue(AmqpVersion version)
- throws AmqpTypeMappingException
- {
- return Double.parseDouble(getStringValue(version));
- }
-
- /**
- * Get the version set for this constant. It contains the all the versions for which this
- * constant name exists.
- *
- * @return Set of versions for which this constant exists.
- */
- public AmqpVersionSet getVersionSet()
- {
- return _versionSet;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
-
- public int compareTo(AmqpConstant other)
- {
- int res = getName().compareTo(other.getName());
- if (res != 0)
- {
- return res;
- }
- return getVersionSet().compareTo(other.getVersionSet());
- }
-
- /* (non-Javadoc)
- * @see org.apache.qpid.gentools.VersionConsistencyCheck#isVersionConsistent(org.apache.qpid.gentools.AmqpVersionSet)
- */
- public boolean isVersionConsistent(AmqpVersionSet globalVersionSet)
- {
- if (size() != 1)
- {
- return false;
- }
- return get(firstKey()).equals(globalVersionSet);
- }
-
- /* (non-Javadoc)
- * @see org.apache.qpid.gentools.Printable#print(java.io.PrintStream, int, int)
- */
- public void print(PrintStream out, int marginSize, int tabSize)
- {
- String margin = Utils.createSpaces(marginSize);
- String tab = Utils.createSpaces(tabSize);
- if (size() == 1)
- {
- out.println(margin + tab + "[C] " + getName() + " = \"" + firstKey() + "\" " + getVersionSet());
- }
- else
- {
- out.println(margin + tab + "[C] " + getName() + ": " + getVersionSet());
- for (String thisValue : keySet())
- {
- out.println(margin + tab + tab + "= \"" + thisValue + "\" " + get(thisValue));
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java
deleted file mode 100644
index ab8b8be61e..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java
+++ /dev/null
@@ -1,152 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.PrintStream;
-import java.util.Iterator;
-import java.util.TreeSet;
-
-/**
- * @author kpvdr
- * This class implements a set collection for {@link AmqpConstant AmqpConstant} objects, being the collection
- * of constants accumulated from various AMQP specification files processed. Each name occurs once only in the set.
- * The {@link AmqpConstant AmqpConstant} objects (derived from {@link java.util.TreeMap TreeMap}) keep track of
- * the value and version(s) assigned to this name.
- */
-@SuppressWarnings("serial")
-public class AmqpConstantSet implements Printable, NodeAware //, Comparable<AmqpConstantSet>
-{
- private final LanguageConverter _converter;
- private final TreeSet<AmqpConstant> _constants = new TreeSet<AmqpConstant>();
- private final AmqpVersionSet _versionSet = new AmqpVersionSet();
-
- public AmqpConstantSet(LanguageConverter converter)
- {
- _converter = converter;
-
- }
-
- /* (non-Javadoc)
- * @see org.apache.qpid.gentools.NodeAware#addFromNode(org.w3c.dom.Node, int, org.apache.qpid.gentools.AmqpVersion)
- */
- public boolean addFromNode(Node node, int ordinal, AmqpVersion version)
- throws AmqpParseException, AmqpTypeMappingException
- {
- _versionSet.add(version);
- NodeList nodeList = node.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++)
- {
- Node childNode = nodeList.item(i);
- if (childNode.getNodeName().compareTo(Utils.ELEMENT_CONSTANT) == 0)
- {
- String name = getConverter().prepareConstantName(Utils.getNamedAttribute(childNode, Utils.ATTRIBUTE_NAME));
- String value = Utils.getNamedAttribute(childNode, Utils.ATTRIBUTE_VALUE);
- // Find this name in the existing set of objects
- boolean foundName = false;
- Iterator<AmqpConstant> cItr = _constants.iterator();
- while (cItr.hasNext() && !foundName)
- {
- AmqpConstant thisConstant = cItr.next();
- if (name.compareTo(thisConstant.getName()) == 0)
- {
- foundName = true;
- thisConstant.getVersionSet().add(version);
- // Now, find the value in the map
- boolean foundValue = false;
- for (String thisValue : thisConstant.keySet())
- {
- if (value.compareTo(thisValue) == 0)
- {
- foundValue = true;
- // Add this version to existing version set.
- AmqpVersionSet versionSet = thisConstant.get(thisValue);
- versionSet.add(version);
- }
- }
- // Check that the value was found - if not, add it
- if (!foundValue)
- {
- thisConstant.put(value, new AmqpVersionSet(version));
- }
- }
- }
- // Check that the name was found - if not, add it
- if (!foundName)
- {
- _constants.add(new AmqpConstant(name, value, version));
- }
- }
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.apache.qpid.gentools.Printable#print(java.io.PrintStream, int, int)
- */
- public void print(PrintStream out, int marginSize, int tabSize)
- {
- out.println(Utils.createSpaces(marginSize) + "Constants: ");
- for (AmqpConstant thisAmqpConstant : _constants)
- {
- thisAmqpConstant.print(out, marginSize, tabSize);
- }
- }
-
- /* (non-Javadoc)
- * @see java.lang.Comparable#compareTo(java.lang.Object)
- */
-// public int compareTo(AmqpConstantSet other)
-// {
-// int res = size() - other.size();
-// if (res != 0)
-// return res;
-// Iterator<AmqpConstant> cItr = iterator();
-// Iterator<AmqpConstant> oItr = other.iterator();
-// while (cItr.hasNext() && oItr.hasNext())
-// {
-// AmqpConstant constant = cItr.next();
-// AmqpConstant oConstant = oItr.next();
-// res = constant.compareTo(oConstant);
-// if (res != 0)
-// return res;
-// }
-// return 0;
-// }
-
- public Iterable<? extends AmqpConstant> getContstants()
- {
- return _constants;
- }
-
- public AmqpVersionSet getVersionSet()
- {
- return _versionSet;
- }
-
- public LanguageConverter getConverter()
- {
- return _converter;
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomain.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomain.java
deleted file mode 100644
index ba8552a6a6..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomain.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.io.PrintStream;
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpDomain extends TreeMap<String, AmqpVersionSet> implements Printable
-{
- private final String _domainName;
-
- public AmqpDomain(String domainName)
- {
- _domainName = domainName;
- }
-
- public void addDomain(String domainType, AmqpVersion version) throws AmqpParseException
- {
- AmqpVersionSet versionSet = get(domainType);
- if (versionSet == null) // First time, create new entry
- {
- versionSet = new AmqpVersionSet();
- put(domainType, versionSet);
- }
- versionSet.add(version);
- }
-
- public String getDomainType(AmqpVersion version)
- throws AmqpTypeMappingException
- {
- for (String thisDomainType : keySet())
- {
- AmqpVersionSet versionSet = get(thisDomainType);
- if (versionSet.contains(version))
- {
- return thisDomainType;
- }
- }
- throw new AmqpTypeMappingException("Unable to find version " + version + ".");
- }
-
- public boolean hasVersion(String type, AmqpVersion v)
- {
- AmqpVersionSet vs = get(type);
- if (vs == null)
- {
- return false;
- }
- return vs.contains(v);
- }
-
- public void print(PrintStream out, int marginSize, int tabSize)
- {
- String margin = Utils.createSpaces(marginSize);
- String tab = Utils.createSpaces(tabSize);
- out.println(margin + getDomainName() + ":");
-
- for (String thisDomainType : keySet())
- {
- AmqpVersionSet vs = get(thisDomainType);
- out.println(margin + tab + thisDomainType + " : " + vs.toString());
- }
- }
-
- public String getDomainName()
- {
- return _domainName;
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java
deleted file mode 100644
index 0cd9d214bd..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java
+++ /dev/null
@@ -1,128 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.PrintStream;
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpDomainMap extends TreeMap<String, AmqpDomain> implements Printable, NodeAware
-{
- private final LanguageConverter _converter;
-
- public AmqpDomainMap(LanguageConverter converter)
- {
- _converter = converter;
-
- }
-
- public boolean addFromNode(Node n, int o, AmqpVersion v)
- throws AmqpParseException, AmqpTypeMappingException
- {
- NodeList nl = n.getChildNodes();
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node c = nl.item(i);
- // All versions 0.9 and greater use <domain> for all domains
- if (c.getNodeName().compareTo(Utils.ELEMENT_DOMAIN) == 0)
- {
- String domainName = getConverter().prepareDomainName(Utils.getNamedAttribute(c, Utils.ATTRIBUTE_NAME));
- String type = Utils.getNamedAttribute(c, Utils.ATTRIBUTE_TYPE);
- AmqpDomain thisDomain = get(domainName);
- if (thisDomain == null)
- {
- thisDomain = new AmqpDomain(domainName);
- put(domainName, thisDomain);
- }
- thisDomain.addDomain(type, v);
- }
- // Version(s) 0.8 and earlier use <domain> for all complex domains and use
- // attribute <field type=""...> for simple types. Add these simple types to
- // domain list - but beware of duplicates!
- else if (c.getNodeName().compareTo(Utils.ELEMENT_FIELD) == 0)
- {
- try
- {
- String type = getConverter().prepareDomainName(Utils.getNamedAttribute(c, Utils.ATTRIBUTE_TYPE));
- AmqpDomain thisDomain = get(type);
- if (thisDomain == null)
- {
- thisDomain = new AmqpDomain(type);
- put(type, thisDomain);
- }
- if (!thisDomain.hasVersion(type, v))
- {
- thisDomain.addDomain(type, v);
- }
- }
- catch (AmqpParseException e)
- {
- } // Ignore fields without type attribute
- }
- else if (c.getNodeName().compareTo(Utils.ELEMENT_CLASS) == 0 ||
- c.getNodeName().compareTo(Utils.ELEMENT_METHOD) == 0)
- {
- addFromNode(c, 0, v);
- }
- }
- return true;
- }
-
- public String getDomainType(String domainName, AmqpVersion version)
- {
- AmqpDomain domainType = get(domainName);
- // For AMQP 8.0, primitive types were not described as domains, so
- // return itself as the type.
- if (domainType == null)
- {
- return domainName;
- }
- try
- {
- return domainType.getDomainType(version);
- }
- catch (AmqpTypeMappingException e)
- {
- throw new AmqpTypeMappingException("Unable to find domain type for domain \"" + domainName +
- "\" version " + version + ".");
- }
- }
-
-
- public void print(PrintStream out, int marginSize, int tabSize)
- {
- out.println(Utils.createSpaces(marginSize) + "Domain Map:");
- for (String thisDomainName : keySet())
- {
- AmqpDomain domain = get(thisDomainName);
- domain.print(out, marginSize + tabSize, tabSize);
- }
- }
-
- public LanguageConverter getConverter()
- {
- return _converter;
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java
deleted file mode 100644
index e39550b96f..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java
+++ /dev/null
@@ -1,62 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.ArrayList;
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpDomainVersionMap extends TreeMap<String, AmqpVersionSet> implements VersionConsistencyCheck
-{
- public boolean isVersionConsistent(AmqpVersionSet globalVersionSet)
- {
- if (size() != 1)
- {
- return false;
- }
- return get(firstKey()).equals(globalVersionSet);
- }
-
- public boolean removeVersion(AmqpVersion version)
- {
- Boolean res = false;
- ArrayList<String> removeList = new ArrayList<String>();
- for (String domainName : keySet())
- {
- AmqpVersionSet versionSet = get(domainName);
- if (versionSet.contains(version))
- {
- versionSet.remove(version);
- if (versionSet.isEmpty())
- {
- removeList.add(domainName);
- }
- res = true;
- }
- }
- // Get rid of domains no longer in use
- for (String domainName : removeList)
- {
- remove(domainName);
- }
- return res;
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpField.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpField.java
deleted file mode 100644
index 7c721cf913..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpField.java
+++ /dev/null
@@ -1,269 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-public class AmqpField implements Printable, NodeAware, VersionConsistencyCheck
-{
-
- private final AmqpVersionSet _versionSet = new AmqpVersionSet();
- private final AmqpDomainVersionMap _domainMap = new AmqpDomainVersionMap();
- private final AmqpOrdinalVersionMap _ordinalMap = new AmqpOrdinalVersionMap();
-
- private final String _name;
- private final Generator _generator;
-
- private final Map<AmqpVersion, String> _versionToDomainMap = new HashMap<AmqpVersion, String>();
- private final Map<AmqpVersion, Integer> _versionToOrdinalMap = new HashMap<AmqpVersion, Integer>();
-
-
- public AmqpField(String name, Generator generator)
- {
- _name = name;
- _generator = generator;
-
- }
-
- public boolean addFromNode(Node fieldNode, int ordinal, AmqpVersion version)
- throws AmqpParseException, AmqpTypeMappingException
- {
- _versionSet.add(version);
- String domainType;
- // Early versions of the spec (8.0) used the "type" attribute instead of "domain" for some fields.
- try
- {
- domainType = _generator.prepareDomainName(Utils.getNamedAttribute(fieldNode, Utils.ATTRIBUTE_DOMAIN));
- }
- catch (AmqpParseException e)
- {
- domainType = _generator.prepareDomainName(Utils.getNamedAttribute(fieldNode, Utils.ATTRIBUTE_TYPE));
- }
- AmqpVersionSet thisVersionList = _domainMap.get(domainType);
- if (thisVersionList == null) // First time, create new entry
- {
- thisVersionList = new AmqpVersionSet();
- _domainMap.put(domainType, thisVersionList);
- }
-
- _versionToDomainMap.put(version, domainType);
- _versionToOrdinalMap.put(version, ordinal);
-
- thisVersionList.add(version);
- thisVersionList = _ordinalMap.get(ordinal);
- if (thisVersionList == null) // First time, create new entry
- {
- thisVersionList = new AmqpVersionSet();
- _ordinalMap.put(ordinal, thisVersionList);
- }
- thisVersionList.add(version);
- NodeList nList = fieldNode.getChildNodes();
- for (int i = 0; i < nList.getLength(); i++)
- {
- Node child = nList.item(i);
- if (child.getNodeName().compareTo(Utils.ELEMENT_CODEGEN) == 0)
- {
- String value = Utils.getNamedAttribute(child, Utils.ATTRIBUTE_VALUE);
- if (value.compareTo("no-gen") == 0)
- {
- return false;
- }
- }
- }
- return true;
- }
-
- public void removeVersion(AmqpVersion version)
- {
- _domainMap.removeVersion(version);
- _ordinalMap.removeVersion(version);
- _versionSet.remove(version);
- }
-
- public boolean isCodeTypeConsistent(LanguageConverter converter)
- throws AmqpTypeMappingException
- {
- if (_domainMap.size() == 1)
- {
- return true; // By definition
- }
- ArrayList<String> codeTypeList = new ArrayList<String>();
- for (String thisDomainName : _domainMap.keySet())
- {
- AmqpVersionSet versionSet = _domainMap.get(thisDomainName);
- String codeType = converter.getGeneratedType(thisDomainName, versionSet.first());
- if (!codeTypeList.contains(codeType))
- {
- codeTypeList.add(codeType);
- }
- }
- return codeTypeList.size() == 1;
- }
-
- public boolean isConsistent(Generator generator)
- throws AmqpTypeMappingException
- {
- if (!isCodeTypeConsistent(generator))
- {
- return false;
- }
- if (_ordinalMap.size() != 1)
- {
- return false;
- }
- // Since the various doamin names map to the same code type, add the version occurrences
- // across all domains to see we have all possible versions covered
- int vCntr = 0;
- for (String thisDomainName : _domainMap.keySet())
- {
- vCntr += _domainMap.get(thisDomainName).size();
- }
- return vCntr == generator.getVersionSet().size();
- }
-
- public boolean isTypeAndNameConsistent(Generator generator)
- throws AmqpTypeMappingException
- {
- if (!isCodeTypeConsistent(generator))
- {
- return false;
- }
- // Since the various doamin names map to the same code type, add the version occurrences
- // across all domains to see we have all possible versions covered
- int vCntr = 0;
- for (String thisDomainName : _domainMap.keySet())
- {
- vCntr += _domainMap.get(thisDomainName).size();
- }
- return vCntr == getVersionSet().size();
- }
-
-
- public void print(PrintStream out, int marginSize, int tabSize)
- {
- String margin = Utils.createSpaces(marginSize);
- out.println(margin + "[F] " + _name + ": " + _versionSet);
-
- for (Integer thisOrdinal : _ordinalMap.keySet())
- {
- AmqpVersionSet versionList = _ordinalMap.get(thisOrdinal);
- out.println(margin + " [O] " + thisOrdinal + " : " + versionList.toString());
- }
-
- for (String thisDomainName : _domainMap.keySet())
- {
- AmqpVersionSet versionList = _domainMap.get(thisDomainName);
- out.println(margin + " [D] " + thisDomainName + " : " + versionList.toString());
- }
- }
-
- public boolean isVersionConsistent(AmqpVersionSet globalVersionSet)
- {
- if (!_versionSet.equals(globalVersionSet))
- {
- return false;
- }
- if (!_domainMap.isVersionConsistent(globalVersionSet))
- {
- return false;
- }
- if (!_ordinalMap.isVersionConsistent(globalVersionSet))
- {
- return false;
- }
- return true;
- }
-
-
- public boolean isVersionInterfaceConsistent(AmqpVersionSet globalVersionSet)
- {
- if (!_versionSet.equals(globalVersionSet))
- {
- return false;
- }
- if (!_domainMap.isVersionConsistent(globalVersionSet))
- {
- return false;
- }
- if (!_ordinalMap.isVersionConsistent(globalVersionSet))
- {
- return false;
- }
- return true;
- }
-
- public String getDomain(AmqpVersion version)
- {
- return _versionToDomainMap.get(version);
- }
-
- public String getConsistentNativeType()
- {
- return _generator.getNativeType(_generator.getDomainType(getDomain(_versionSet.first()),_versionSet.first()));
- }
-
- public int getOrdinal(AmqpVersion version)
- {
- return _versionToOrdinalMap.get(version);
- }
-
- public AmqpVersionSet getVersionSet()
- {
- return _versionSet;
- }
-
- public AmqpDomainVersionMap getDomainMap()
- {
- return _domainMap;
- }
-
- public AmqpOrdinalVersionMap getOrdinalMap()
- {
- return _ordinalMap;
- }
-
- public String getName()
- {
- return _name;
- }
-
- public LanguageConverter getGenerator()
- {
- return _generator;
- }
-
- public Map<AmqpVersion, String> getVersionToDomainMap()
- {
- return _versionToDomainMap;
- }
-
- public Map<AmqpVersion, Integer> getVersionToOrdinalMap()
- {
- return _versionToOrdinalMap;
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java
deleted file mode 100644
index 0bb5e03a61..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java
+++ /dev/null
@@ -1,452 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpFieldMap implements VersionConsistencyCheck
-{
-
- private final TreeMap<String, AmqpField> _map = new TreeMap<String, AmqpField>();
-
- private final AmqpVersionSet _versionSet = new AmqpVersionSet();
-
- public void removeVersion(AmqpVersion version)
- {
- String[] fieldNameArray = new String[size()];
- _map.keySet().toArray(fieldNameArray);
- Iterator<Entry<String, AmqpField>> iter = _map.entrySet().iterator();
-
- while (iter.hasNext())
- {
- Entry<String, AmqpField> entry = iter.next();
- entry.getValue().removeVersion(version);
- iter.remove();
- }
- }
-
- public int size()
- {
- return _map.size();
-
- }
-
- public AmqpFieldMap getFieldMapForOrdinal(int ordinal)
- {
- AmqpFieldMap newMap = new AmqpFieldMap();
- for (AmqpField field : _map.values())
- {
-
- TreeMap<Integer, AmqpVersionSet> ordinalMap = field.getOrdinalMap();
- AmqpVersionSet ordinalVersions = ordinalMap.get(ordinal);
- if (ordinalVersions != null)
- {
- newMap.add(field.getName(), field);
- }
- }
- return newMap;
- }
-
- public void add(String name, AmqpField field)
- {
- _versionSet.addAll(field.getVersionSet());
- _map.put(name, field);
- }
-
- public AmqpOrdinalFieldMap getMapForVersion(AmqpVersion version, boolean codeTypeFlag,
- LanguageConverter converter)
- {
- // TODO: REVIEW THIS! There may be a bug here that affects C++ generation (only with >1 version)...
- // If version == null (a common scenario) then the version map is built up on the
- // basis of first found item, and ignores other version variations.
- // This should probably be disallowed by throwing an NPE, as AmqpOrdinalFieldMap cannot
- // represent these possibilities.
- // *OR*
- // Change the structure of AmqpOrdianlFieldMap to allow for the various combinations that
- // will result from version variation - but that is what AmqpFieldMap is... :-$
- AmqpOrdinalFieldMap ordinalFieldMap = new AmqpOrdinalFieldMap();
- for (AmqpField field : _map.values())
- {
-
- if (version == null || field.getVersionSet().contains(version))
- {
- // 1. Search for domain name in field domain map with version that matches
- String domain = "";
- boolean dFound = false;
- for (String thisDomainName : field.getDomainMap().keySet())
- {
- domain = thisDomainName;
- AmqpVersionSet versionSet = field.getDomainMap().get(domain);
- if (version == null || versionSet.contains(version))
- {
- if (codeTypeFlag)
- {
- domain = converter.getGeneratedType(domain, version);
- }
- dFound = true;
- }
- }
-
- // 2. Search for ordinal in field ordianl map with version that matches
- int ordinal = -1;
- boolean oFound = false;
- for (Integer thisOrdinal : field.getOrdinalMap().keySet())
- {
- ordinal = thisOrdinal;
- AmqpVersionSet versionSet = field.getOrdinalMap().get(ordinal);
- if (version == null || versionSet.contains(version))
- {
- oFound = true;
- }
- }
-
- if (dFound && oFound)
- {
- String[] fieldDomainPair = {field.getName(), domain};
- ordinalFieldMap.put(ordinal, fieldDomainPair);
- }
- }
- }
- return ordinalFieldMap;
- }
-
- public boolean isDomainConsistent(Generator generator, AmqpVersionSet versionSet)
- throws AmqpTypeMappingException
- {
- if (size() != 1) // Only one field for this ordinal
- {
- return false;
- }
- return _map.get(_map.firstKey()).isConsistent(generator);
- }
-
- public int getNumFields(AmqpVersion version)
- {
- int fCntr = 0;
- for (AmqpField field : _map.values())
- {
-
- if (field.getVersionSet().contains(version))
- {
- fCntr++;
- }
- }
- return fCntr;
- }
-
- public String parseFieldMap(CommandGenerateMethod commonGenerateMethod, MangledGenerateMethod mangledGenerateMethod,
- int indentSize, int tabSize, LanguageConverter converter)
- {
- String indent = Utils.createSpaces(indentSize);
- String cr = Utils.LINE_SEPARATOR;
- StringBuffer sb = new StringBuffer();
-
- if (commonGenerateMethod == null)
- {
- // Generate warnings in code if required methods are null.
- sb.append(indent + "/*********************************************************" + cr);
- sb.append(indent + " * WARNING: Generated code could be missing." + cr);
- sb.append(indent + " * In call to parseFieldMap(), generation method was null." + cr);
- sb.append(indent + " * Check for NoSuchMethodException on startup." + cr);
- sb.append(indent + " *********************************************************/" + cr);
- }
-
- Iterator<Entry<String, AmqpField>> itr = _map.entrySet().iterator();
- while (itr.hasNext())
- {
- Entry<String, AmqpField> entry = itr.next();
- String fieldName = entry.getKey();
- AmqpField field = entry.getValue();
- if (field.isCodeTypeConsistent(converter))
- {
- // All versions identical - Common declaration
- String domainName = field.getDomainMap().firstKey();
- AmqpVersionSet versionSet = field.getDomainMap().get(domainName);
- String codeType = converter.getGeneratedType(domainName, versionSet.first());
- if (commonGenerateMethod != null)
- {
- sb.append(commonGenerateMethod.generate(codeType, field, versionSet,
- indentSize, tabSize, itr.hasNext()));
- }
- }
- else if (mangledGenerateMethod != null) // Version-mangled
- {
- sb.append(mangledGenerateMethod.generate(field, indentSize, tabSize,
- itr.hasNext()));
- }
- }
- return sb.toString();
- }
-
- public String parseFieldMapOrdinally(GenerateMethod generateMethod, BitFieldGenerateMethod bitGenerateMethod,
- int indentSize, int tabSize, Generator codeGenerator)
- {
- String indent = Utils.createSpaces(indentSize);
- String cr = Utils.LINE_SEPARATOR;
- StringBuffer sb = new StringBuffer();
-
- // Generate warnings in code if required methods are null.
- if (generateMethod == null || bitGenerateMethod == null)
- {
- sb.append(indent + "/***********************************************" + cr);
- sb.append(indent + " * WARNING: In call to parseFieldMapOrdinally():" + cr);
- if (generateMethod == null)
- {
- sb.append(indent + " * => generateMethod is null." + cr);
- }
- if (bitGenerateMethod == null)
- {
- sb.append(indent + " * => bitGenerateMethod is null." + cr);
- }
- sb.append(indent + " * Generated code could be missing." + cr);
- sb.append(indent + " * Check for NoSuchMethodException on startup." + cr);
- sb.append(indent + " ***********************************************/" + cr);
- }
-
- /* We must process elements in ordinal order because adjacent booleans (bits)
- * must be combined into a single byte (in groups of up to 8). Start with shared
- * declarations until an ordinal divergence is found. (For most methods where
- * there is no difference between versions, this will simplify the generated
- * code. */
-
- ArrayList<String> bitFieldList = new ArrayList<String>();
- boolean ordinalDivergenceFlag = false;
- int ordinal = 0;
- while (ordinal < size() && !ordinalDivergenceFlag)
- {
- /* Since the getFieldMapOrdinal() function may map more than one Field to
- * an ordinal, the number of ordinals may be less than the total number of
- * fields in the fieldMap. Check for empty fieldmaps... */
- AmqpFieldMap ordinalFieldMap = getFieldMapForOrdinal(ordinal);
- if (ordinalFieldMap.size() > 0)
- {
- if (ordinalFieldMap.isDomainConsistent(codeGenerator, getVersionSet()))
- {
- String fieldName = ordinalFieldMap.getFirstFieldName();
- String domain = ordinalFieldMap._map.get(fieldName).getDomainMap().firstKey();
-
- String domainType = codeGenerator.getDomainType(domain,
- codeGenerator.getVersionSet().first());
-
- if (domainType.compareTo("bit") == 0)
- {
- bitFieldList.add(fieldName);
- }
- else if (bitFieldList.size() > 0)
- {
- // End of bit types - handle deferred bit type generation
- if (bitGenerateMethod != null)
- {
- sb.append(bitGenerateMethod.generate(bitFieldList, ordinal,
- indentSize, tabSize));
- }
- bitFieldList.clear();
- }
- if (!ordinalDivergenceFlag)
- {
- // Defer generation of bit types until all adjacent bits have been
- // accounted for.
- if (bitFieldList.size() == 0 && generateMethod != null)
- {
- sb.append(generateMethod.generate(domainType, fieldName, ordinal,
- indentSize, tabSize));
- }
- }
- ordinal++;
- }
- else
- {
- ordinalDivergenceFlag = true;
- }
- }
- }
-
- // Check if there is still more to do under a version-specific breakout
- if (ordinalDivergenceFlag && ordinal < size())
- {
- // 1. Cycle through all versions in order, create outer if(version) structure
- AmqpVersion[] versionArray = new AmqpVersion[getVersionSet().size()];
- getVersionSet().toArray(versionArray);
- for (int v = 0; v < versionArray.length; v++)
- {
- sb.append(indent);
- if (v > 0)
- {
- sb.append("else ");
- }
- sb.append("if (major == " + versionArray[v].getMajor() + " && minor == " +
- versionArray[v].getMinor() + ")" + cr);
- sb.append(indent + "{" + cr);
-
- // 2. Cycle though each ordinal from where we left off in the loop above.
- ArrayList<String> bitFieldList2 = new ArrayList<String>(bitFieldList);
- for (int o = ordinal; o < size(); o++)
- {
- AmqpFieldMap ordinalFieldMap = getFieldMapForOrdinal(o);
- if (ordinalFieldMap.size() > 0)
- {
- // 3. Cycle through each of the fields that have this ordinal.
- Iterator<Map.Entry<String, AmqpField>> i = ordinalFieldMap._map.entrySet().iterator();
- while (i.hasNext())
- {
-
- Map.Entry<String, AmqpField> entry = i.next();
- AmqpField field = entry.getValue();
- String fieldName = entry.getKey();
-
- // 4. Some fields may have more than one ordinal - match by both
- // ordinal and version.
- Iterator<Integer> j = field.getOrdinalMap().keySet().iterator();
- while (j.hasNext())
- {
- int thisOrdinal = j.next();
- AmqpVersionSet v1 = field.getOrdinalMap().get(thisOrdinal);
- if (thisOrdinal == o && v1.contains(versionArray[v]))
- {
- // 5. Now get the domain for this version
- int domainCntr = 0;
- Iterator<String> k = field.getDomainMap().keySet().iterator();
- while (k.hasNext())
- {
- // Mangle domain-divergent field names
- String mangledFieldName = fieldName;
- if (field.getDomainMap().size() > 1)
- {
- mangledFieldName += "_" + (domainCntr++);
- }
- String domainName = k.next();
- AmqpVersionSet v2 = field.getDomainMap().get(domainName);
- if (v2.contains(versionArray[v]))
- {
- // 6. (Finally!!) write the declaration
- String domainType = codeGenerator.getDomainType(domainName,
- versionArray[v]);
- if (domainType.compareTo("bit") == 0)
- {
- bitFieldList2.add(mangledFieldName);
- }
- else if (bitFieldList2.size() > 0)
- {
- // End of bit types - handle deferred bit type generation
- if (bitGenerateMethod != null)
- {
- sb.append(bitGenerateMethod.generate(
- bitFieldList2, o, indentSize + tabSize,
- tabSize));
- }
- bitFieldList2.clear();
- }
- // Defer generation of bit types until all adjacent bits have
- // been accounted for.
- if (bitFieldList2.size() == 0 && generateMethod != null)
- {
- sb.append(generateMethod.generate(domainType,
- mangledFieldName, o, indentSize + tabSize, tabSize));
- }
- }
- }
- }
- }
- }
- }
- }
- // Check for remaining deferred bits
- if (bitFieldList2.size() > 0 && bitGenerateMethod != null)
- {
- sb.append(bitGenerateMethod.generate(bitFieldList2, size(),
- indentSize + tabSize, tabSize));
- }
- sb.append(indent + "}" + cr);
- }
- }
- // Check for remaining deferred bits
- else if (bitFieldList.size() > 0 && bitGenerateMethod != null)
- {
- sb.append(bitGenerateMethod.generate(bitFieldList, size(),
- indentSize, tabSize));
- }
- return sb.toString();
- }
-
- private String getFirstFieldName()
- {
- return _map.firstKey();
- }
-
- public boolean isVersionConsistent(AmqpVersionSet globalVersionSet)
- {
- for (String thisFieldName : _map.keySet())
- {
- AmqpField field = _map.get(thisFieldName);
- if (!field.isVersionConsistent(globalVersionSet))
- {
- return false;
- }
- }
- return true;
- }
-
- public boolean isVersionInterfaceConsistent(AmqpVersionSet globalVersionSet)
- {
- for (String thisFieldName : _map.keySet())
- {
- AmqpField field = _map.get(thisFieldName);
- if (!field.isVersionInterfaceConsistent(globalVersionSet))
- {
- return false;
- }
- }
- return true;
- }
-
-
- public AmqpVersionSet getVersionSet()
- {
- return _versionSet;
- }
-
- public Collection<AmqpField> values()
- {
- return _map.values();
- }
-
- public AmqpField get(String fieldName)
- {
- return _map.get(fieldName);
- }
-
- public void remove(String fieldName)
- {
- _map.remove(fieldName);
- }
-
- public Set<String> keySet()
- {
- return _map.keySet();
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java
deleted file mode 100644
index 5993a1b715..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.ArrayList;
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpFlagMap extends TreeMap<Boolean, AmqpVersionSet> implements VersionConsistencyCheck
-{
- public boolean isSet()
- {
- return containsKey(true);
- }
-
- public String toString()
- {
- AmqpVersionSet versionSet = get(true);
- if (versionSet != null)
- {
- return versionSet.toString();
- }
- return "";
- }
-
- public boolean isVersionConsistent(AmqpVersionSet globalVersionSet)
- {
- if (size() != 1)
- {
- return false;
- }
- return get(firstKey()).equals(globalVersionSet);
- }
-
- public boolean removeVersion(AmqpVersion version)
- {
- Boolean res = false;
- ArrayList<Boolean> removeList = new ArrayList<Boolean>();
- for (Boolean flag : keySet())
- {
- AmqpVersionSet versionSet = get(flag);
- if (versionSet.contains(version))
- {
- versionSet.remove(version);
- if (versionSet.isEmpty())
- {
- removeList.add(flag);
- }
- res = true;
- }
- }
- // Get rid of flags no longer in use
- for (Boolean flag : removeList)
- {
- remove(flag);
- }
- return res;
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethod.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethod.java
deleted file mode 100644
index 4ec39b209e..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethod.java
+++ /dev/null
@@ -1,351 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.PrintStream;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Collection;
-import java.util.concurrent.atomic.AtomicInteger;
-
-public class AmqpMethod implements Printable, NodeAware, VersionConsistencyCheck
-{
- private final AmqpVersionSet _versionSet = new AmqpVersionSet();
- private final AmqpFieldMap _fieldMap = new AmqpFieldMap();
-
- private final AmqpOrdinalVersionMap _indexMap = new AmqpOrdinalVersionMap();
- private final AmqpFlagMap _clientMethodFlagMap = new AmqpFlagMap(); // Method called on client (<chassis name="server"> in XML)
- private final AmqpFlagMap _serverMethodFlagMap = new AmqpFlagMap(); // Method called on server (<chassis name="client"> in XML)
-
- private final Map<AmqpVersion, AmqpFieldMap> _versionToFieldsMap = new HashMap<AmqpVersion, AmqpFieldMap>();
-
- private final Map<AmqpVersion, AtomicInteger> _versionToFieldCount = new HashMap<AmqpVersion, AtomicInteger>();
-
- private final String _name;
- private final Generator _generator;
-
-
- public AmqpMethod(String name, Generator generator)
- {
- _name = name;
- _generator = generator;
- }
-
- public boolean addFromNode(Node methodNode, int ordinal, AmqpVersion version)
- throws AmqpParseException, AmqpTypeMappingException
- {
- _versionSet.add(version);
- boolean serverChassisFlag = false;
- boolean clientChassisFlag = false;
- int index = Utils.getNamedIntegerAttribute(methodNode, "index");
- AmqpVersionSet indexVersionSet = _indexMap.get(index);
- if (indexVersionSet != null)
- {
- indexVersionSet.add(version);
- }
- else
- {
- indexVersionSet = new AmqpVersionSet();
- indexVersionSet.add(version);
- _indexMap.put(index, indexVersionSet);
- }
- NodeList nList = methodNode.getChildNodes();
- AtomicInteger fieldCntr = _versionToFieldCount.get(version);
- if(fieldCntr == null)
- {
- fieldCntr = new AtomicInteger(0);
- _versionToFieldCount.put(version, fieldCntr);
- }
- for (int i = 0; i < nList.getLength(); i++)
- {
- Node child = nList.item(i);
- if (child.getNodeName().compareTo(Utils.ELEMENT_FIELD) == 0)
- {
- String fieldName = _generator.prepareDomainName(Utils.getNamedAttribute(child,
- Utils.ATTRIBUTE_NAME));
- AmqpField thisField = _fieldMap.get(fieldName);
- AmqpFieldMap versionSpecificFieldMap = _versionToFieldsMap.get(version);
- if (versionSpecificFieldMap == null)
- {
- versionSpecificFieldMap = new AmqpFieldMap();
- _versionToFieldsMap.put(version, versionSpecificFieldMap);
- }
-
-
- if (thisField == null)
- {
- thisField = new AmqpField(fieldName, _generator);
- _fieldMap.add(fieldName, thisField);
- }
-
- AmqpField versionSpecificField = new AmqpField(fieldName, _generator);
- versionSpecificFieldMap.add(fieldName, versionSpecificField);
-
- versionSpecificField.addFromNode(child, fieldCntr.intValue(), version);
-
- if (!thisField.addFromNode(child, fieldCntr.getAndIncrement(), version))
- {
- String className = _generator.prepareClassName(Utils.getNamedAttribute(methodNode.getParentNode(),
- Utils.ATTRIBUTE_NAME));
- String methodName = _generator.prepareMethodName(Utils.getNamedAttribute(methodNode,
- Utils.ATTRIBUTE_NAME));
- System.out.println("INFO: Generation supression tag found for field " +
- className + "." + methodName + "." + fieldName + " - removing.");
- thisField.removeVersion(version);
- _fieldMap.remove(fieldName);
- }
- }
- else if (child.getNodeName().compareTo(Utils.ELEMENT_CHASSIS) == 0)
- {
- String chassisName = Utils.getNamedAttribute(child, Utils.ATTRIBUTE_NAME);
- if (chassisName.compareTo("server") == 0)
- {
- serverChassisFlag = true;
- }
- else if (chassisName.compareTo("client") == 0)
- {
- clientChassisFlag = true;
- }
- }
- else if (child.getNodeName().compareTo(Utils.ELEMENT_CODEGEN) == 0)
- {
- String value = Utils.getNamedAttribute(child, Utils.ATTRIBUTE_VALUE);
- if (value.compareTo("no-gen") == 0)
- {
- return false;
- }
- }
- }
- processChassisFlags(serverChassisFlag, clientChassisFlag, version);
- return true;
- }
-
- public void removeVersion(AmqpVersion version)
- {
- _clientMethodFlagMap.removeVersion(version);
- _serverMethodFlagMap.removeVersion(version);
- _indexMap.removeVersion(version);
- _fieldMap.removeVersion(version);
- _versionSet.remove(version);
- }
-
- public void print(PrintStream out, int marginSize, int tabSize)
- {
- String margin = Utils.createSpaces(marginSize);
- String tab = Utils.createSpaces(tabSize);
- out.println(margin + "[M] " + _name + " {" + (_serverMethodFlagMap.isSet() ? "S " +
- _serverMethodFlagMap + (
- _clientMethodFlagMap.isSet() ? ", " : "") : "") +
- (_clientMethodFlagMap.isSet()
- ? "C " + _clientMethodFlagMap : "") + "}" + ": " +
- _versionSet);
-
- for (Integer thisIndex : _indexMap.keySet())
- {
- AmqpVersionSet indexVersionSet = _indexMap.get(thisIndex);
- out.println(margin + tab + "[I] " + thisIndex + indexVersionSet);
- }
-
- for (String thisFieldName : _fieldMap.keySet())
- {
- AmqpField thisField = _fieldMap.get(thisFieldName);
- thisField.print(out, marginSize + tabSize, tabSize);
- }
- }
-
- protected void processChassisFlags(boolean serverFlag, boolean clientFlag, AmqpVersion version)
- {
- AmqpVersionSet versionSet = _serverMethodFlagMap.get(serverFlag);
- if (versionSet != null)
- {
- versionSet.add(version);
- }
- else
- {
- versionSet = new AmqpVersionSet();
- versionSet.add(version);
- _serverMethodFlagMap.put(serverFlag, versionSet);
- }
-
- versionSet = _clientMethodFlagMap.get(clientFlag);
- if (versionSet != null)
- {
- versionSet.add(version);
- }
- else
- {
- versionSet = new AmqpVersionSet();
- versionSet.add(version);
- _clientMethodFlagMap.put(clientFlag, versionSet);
- }
- }
-
- public AmqpOverloadedParameterMap getOverloadedParameterLists(AmqpVersionSet globalVersionSet,
- Generator generator)
- throws AmqpTypeMappingException
- {
- AmqpOverloadedParameterMap parameterVersionMap = new AmqpOverloadedParameterMap();
- for (AmqpVersion thisVersion : globalVersionSet)
- {
- AmqpOrdinalFieldMap ordinalFieldMap = _fieldMap.getMapForVersion(thisVersion, true, generator);
- AmqpVersionSet methodVersionSet = parameterVersionMap.get(ordinalFieldMap);
- if (methodVersionSet == null)
- {
- methodVersionSet = new AmqpVersionSet();
- methodVersionSet.add(thisVersion);
- parameterVersionMap.put(ordinalFieldMap, methodVersionSet);
- }
- else
- {
- methodVersionSet.add(thisVersion);
- }
- }
- return parameterVersionMap;
- }
-
- public boolean isVersionInterfaceConsistent()
- {
- return isVersionInterfaceConsistent(_generator.getVersionSet());
- }
-
- public boolean isVersionInterfaceConsistent(AmqpVersionSet globalVersionSet)
- {
- if (!_versionSet.equals(globalVersionSet))
- {
- return false;
- }
- if (!_clientMethodFlagMap.isVersionConsistent(globalVersionSet))
- {
- return false;
- }
- if (!_serverMethodFlagMap.isVersionConsistent(globalVersionSet))
- {
- return false;
- }
- if (!_fieldMap.isVersionInterfaceConsistent(globalVersionSet))
- {
- return false;
- }
- return true;
- }
-
- public boolean isVersionConsistent()
- {
- return isVersionConsistent(_generator.getVersionSet());
- }
-
-
- public boolean isVersionConsistent(AmqpVersionSet globalVersionSet)
- {
- return isVersionInterfaceConsistent(globalVersionSet)
- && _indexMap.isVersionConsistent(globalVersionSet)
- && _fieldMap.isVersionConsistent(globalVersionSet);
- }
-
- public AmqpVersionSet getVersionSet()
- {
- return _versionSet;
- }
-
- public AmqpFieldMap getFieldMap()
- {
- return _fieldMap;
- }
-
- public AmqpOrdinalVersionMap getIndexMap()
- {
- return _indexMap;
- }
-
- public AmqpFlagMap getClientMethodFlagMap()
- {
- return _clientMethodFlagMap;
- }
-
- public AmqpFlagMap getServerMethodFlagMap()
- {
- return _serverMethodFlagMap;
- }
-
- public Map<AmqpVersion, AmqpFieldMap> getVersionToFieldsMap()
- {
- return _versionToFieldsMap;
- }
-
- public String getName()
- {
- return _name;
- }
-
- public LanguageConverter getGenerator()
- {
- return _generator;
- }
-
- public SingleVersionMethod asSingleVersionMethod(AmqpVersion version)
- {
- return new SingleVersionMethod(this, version, _generator);
- }
-
- public Collection<AmqpField> getFields()
- {
- return _fieldMap.values();
- }
-
- public boolean isCommon(AmqpField field)
- {
- return field.getVersionSet().equals(getVersionSet()) && field.isTypeAndNameConsistent(_generator);
- }
-
- public boolean isConsistentServerMethod()
- {
- AmqpVersionSet serverVersions = _serverMethodFlagMap.get(true);
- return (serverVersions != null) && serverVersions.containsAll(_generator.getVersionSet());
- }
-
-
- public boolean isConsistentClientMethod()
- {
- AmqpVersionSet clientVersions = _clientMethodFlagMap.get(true);
- return (clientVersions != null) && clientVersions.containsAll(_generator.getVersionSet());
- }
-
- public boolean isServerMethod(AmqpVersion version)
- {
- AmqpVersionSet serverVersions = _serverMethodFlagMap.get(true);
- return (serverVersions != null) && serverVersions.contains(version);
- }
-
-
- public boolean isClientMethod(AmqpVersion version)
- {
- AmqpVersionSet clientVersions = _clientMethodFlagMap.get(true);
- return (clientVersions != null) && clientVersions.contains(version);
- }
-
- public boolean inAllVersions()
- {
- return _versionSet.containsAll(_generator.getVersionSet());
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java
deleted file mode 100644
index d98dab4a39..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java
+++ /dev/null
@@ -1,36 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpMethodMap extends TreeMap<String, AmqpMethod>
-{
- public void removeVersion(AmqpVersion version)
- {
- for (String methodName : keySet())
- {
- get(methodName).removeVersion(version);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpModel.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpModel.java
deleted file mode 100644
index 45f0adb18d..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpModel.java
+++ /dev/null
@@ -1,132 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.PrintStream;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Collection;
-
-public class AmqpModel implements Printable, NodeAware
-{
- private final Generator _generator;
- private final AmqpClassMap classMap = new AmqpClassMap();
- private final AmqpVersionSet _versionSet = new AmqpVersionSet();
-
- private final Map<AmqpVersion, AmqpClassMap> _versionToClassMapMap = new HashMap<AmqpVersion, AmqpClassMap>();
-
- public AmqpModel(Generator generator)
- {
- _generator = generator;
- }
-
- public AmqpClassMap getAmqpClassMap(AmqpVersion version)
- {
- return _versionToClassMapMap.get(version);
- }
-
-
- public AmqpVersionSet getVersionSet()
- {
- return _versionSet;
- }
-
- public boolean addFromNode(Node n, int o, AmqpVersion version)
- throws AmqpParseException, AmqpTypeMappingException
- {
- _versionSet.add(version);
- NodeList nList = n.getChildNodes();
-
- AmqpClassMap versionSpecificClassMap = _versionToClassMapMap.get(version);
-
- if (versionSpecificClassMap == null)
- {
- versionSpecificClassMap = new AmqpClassMap();
- _versionToClassMapMap.put(version, versionSpecificClassMap);
- }
-
- int eCntr = 0;
- for (int i = 0; i < nList.getLength(); i++)
- {
- Node c = nList.item(i);
- if (c.getNodeName().compareTo(Utils.ELEMENT_CLASS) == 0)
- {
- String className = _generator.prepareClassName(Utils.getNamedAttribute(c, Utils.ATTRIBUTE_NAME));
- AmqpClass thisClass = classMap.get(className);
- if (thisClass == null)
- {
- thisClass = new AmqpClass(className, _generator);
- classMap.put(className, thisClass);
- }
-
- AmqpClass versionSpecificClass = new AmqpClass(className, _generator);
- versionSpecificClassMap.put(className, versionSpecificClass);
-
- versionSpecificClass.addFromNode(c, eCntr, version);
-
- if (!thisClass.addFromNode(c, eCntr++, version))
- {
- System.out.println("INFO: Generation supression tag found for class " + className + " - removing.");
- thisClass.removeVersion(version);
- classMap.remove(className);
- }
- }
- }
- return true;
- }
-
- public void print(PrintStream out, int marginSize, int tabSize)
- {
- out.println(Utils.createSpaces(marginSize) +
- "[C]=class; [M]=method; [F]=field; [D]=domain; [I]=index; [O]=ordinal" + Utils.LINE_SEPARATOR);
- out.println(Utils.createSpaces(marginSize) + "Model:");
-
- for (String thisClassName : classMap.keySet())
- {
- AmqpClass thisClass = classMap.get(thisClassName);
- thisClass.print(out, marginSize + tabSize, tabSize);
- }
- }
-
- public LanguageConverter getGenerator()
- {
- return _generator;
- }
-
- public AmqpClassMap getClassMap()
- {
- return classMap;
- }
-
-
- public Collection<AmqpClass> getClasses()
- {
- return classMap.values();
- }
-
- public SingleVersionModel asSingleVersionModel()
- {
- return new SingleVersionModel(this, getVersionSet().first(), _generator);
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOrdinalFieldMap.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOrdinalFieldMap.java
deleted file mode 100644
index 0633eff1e1..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOrdinalFieldMap.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.Iterator;
-import java.util.Set;
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpOrdinalFieldMap extends TreeMap<Integer, String[]> implements Comparable
-{
-
-
- public int compareTo(Object obj)
- {
- AmqpOrdinalFieldMap o = (AmqpOrdinalFieldMap) obj;
- Set<Integer> thisKeySet = keySet();
- Set<Integer> oKeySet = o.keySet();
- if (!thisKeySet.equals(oKeySet)) // Not equal, but why?
- {
- // Size difference
- int sizeDiff = thisKeySet.size() - oKeySet.size(); // -ve if this < other
- if (sizeDiff != 0)
- {
- return sizeDiff;
- }
- // Conetent difference
- Iterator<Integer> itr = thisKeySet.iterator();
- Iterator<Integer> oItr = oKeySet.iterator();
- while (itr.hasNext() && oItr.hasNext())
- {
- int diff = itr.next() - oItr.next(); // -ve if this < other
- if (diff != 0)
- {
- return diff;
- }
- }
- // We should never get here...
- System.err.println("AmqpOrdinalFieldMap.compareTo(): " +
- "WARNING - unable to find cause of keySet difference.");
- }
- // Keys are equal, now check the String[]s
- Iterator<Integer> itr = thisKeySet.iterator();
- Iterator<Integer> oItr = oKeySet.iterator();
- while (itr.hasNext() && oItr.hasNext())
- {
- String[] thisPair = get(itr.next());
- String[] oPair = o.get(oItr.next());
- // Size difference
- int sizeDiff = thisPair.length - oPair.length; // -ve if this < other
- if (sizeDiff != 0)
- {
- return sizeDiff;
- }
- // Conetent difference
- for (int i = 0; i < thisPair.length; i++)
- {
- int diff = thisPair[i].compareTo(oPair[i]);
- if (diff != 0)
- {
- return diff;
- }
- }
- }
- return 0;
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
- for (Integer thisOrdinal : keySet())
- {
- String[] pair = get(thisOrdinal);
- sb.append("[" + thisOrdinal + "] " + pair[0] + " : " + pair[1] + Utils.LINE_SEPARATOR);
- }
- return sb.toString();
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java
deleted file mode 100644
index fede88631a..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.ArrayList;
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpOrdinalVersionMap extends TreeMap<Integer, AmqpVersionSet> implements VersionConsistencyCheck
-{
- public boolean isVersionConsistent(AmqpVersionSet globalVersionSet)
- {
- if (size() != 1)
- {
- return false;
- }
- return get(firstKey()).equals(globalVersionSet);
- }
-
- public int getOrdinal(AmqpVersion version)
- throws AmqpTypeMappingException
- {
- for (Integer thisOrdinal : keySet())
- {
- AmqpVersionSet versionSet = get(thisOrdinal);
- if (versionSet.contains(version))
- {
- return thisOrdinal;
- }
- }
- throw new AmqpTypeMappingException("Unable to locate version " + version + " in ordianl version map.");
- }
-
- public boolean removeVersion(AmqpVersion version)
- {
- Boolean res = false;
- ArrayList<Integer> removeList = new ArrayList<Integer>();
- for (Integer ordinal : keySet())
- {
- AmqpVersionSet versionSet = get(ordinal);
- if (versionSet.contains(version))
- {
- versionSet.remove(version);
- if (versionSet.isEmpty())
- {
- removeList.add(ordinal);
- }
- res = true;
- }
- }
- // Get rid of ordinals no longer in use
- for (Integer ordinal : removeList)
- {
- remove(ordinal);
- }
- return res;
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOverloadedParameterMap.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOverloadedParameterMap.java
deleted file mode 100644
index 10978d0e4a..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpOverloadedParameterMap.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpOverloadedParameterMap extends TreeMap<AmqpOrdinalFieldMap, AmqpVersionSet>
-{
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpParseException.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpParseException.java
deleted file mode 100644
index 3f3d4611fc..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpParseException.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-@SuppressWarnings("serial")
-public class AmqpParseException extends RuntimeException
-{
- public AmqpParseException(String msg)
- {
- super(msg);
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpTemplateException.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpTemplateException.java
deleted file mode 100644
index 1ac09ea453..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpTemplateException.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-@SuppressWarnings("serial")
-public class AmqpTemplateException extends RuntimeException
-{
- public AmqpTemplateException(String msg)
- {
- super(msg);
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpTypeMappingException.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpTypeMappingException.java
deleted file mode 100644
index 127a8835b0..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpTypeMappingException.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-@SuppressWarnings("serial")
-public class AmqpTypeMappingException extends RuntimeException
-{
- public AmqpTypeMappingException(String msg)
- {
- super(msg);
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpVersion.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpVersion.java
deleted file mode 100644
index dbeef1b895..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpVersion.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-public class AmqpVersion implements Comparable<AmqpVersion>
-{
- private final int _major;
- private final int _minor;
-
- public AmqpVersion(int major, int minor)
- {
- _major = major;
- _minor = minor;
- }
-
- public AmqpVersion(AmqpVersion version)
- {
- _major = version.getMajor();
- _minor = version.getMinor();
- }
-
- public int getMajor()
- {
- return _major;
- }
-
- public int getMinor()
- {
- return _minor;
- }
-
- public int compareTo(AmqpVersion v)
- {
- if (_major != v.getMajor())
- {
- return _major - v.getMajor();
- }
- if (_minor != v.getMinor())
- {
- return _minor - v.getMinor();
- }
- return 0;
- }
-
- public String namespace()
- {
- return "ver_" + _major + "_" + _minor;
- }
-
- public String toString()
- {
- return _major + "-" + _minor;
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java
deleted file mode 100644
index 6419e23a1e..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.io.PrintStream;
-import java.util.Iterator;
-import java.util.TreeSet;
-
-@SuppressWarnings("serial")
-public class AmqpVersionSet extends TreeSet<AmqpVersion> implements Printable, Comparable<AmqpVersionSet>
-{
- public AmqpVersionSet()
- {
- super();
- }
-
- public AmqpVersionSet(AmqpVersion version)
- {
- super();
- add(version);
- }
-
- public AmqpVersion find(AmqpVersion version)
- {
- for (AmqpVersion v : this)
- {
- if (v.compareTo(version) == 0)
- {
- return v;
- }
- }
- return null;
- }
-
- public void print(PrintStream out, int marginSize, int tabSize)
- {
- out.print(Utils.createSpaces(marginSize) + "Version Set: " + toString() + Utils.LINE_SEPARATOR);
- }
-
- public int compareTo(AmqpVersionSet other)
- {
- int res = size() - other.size();
- if (res != 0)
- {
- return res;
- }
- Iterator<AmqpVersion> vItr = iterator();
- Iterator<AmqpVersion> oItr = other.iterator();
- while (vItr.hasNext() && oItr.hasNext())
- {
- AmqpVersion version = vItr.next();
- AmqpVersion oVersion = oItr.next();
- res = version.compareTo(oVersion);
- if (res != 0)
- {
- return res;
- }
- }
- return 0;
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/BitFieldGenerateMethod.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/BitFieldGenerateMethod.java
deleted file mode 100644
index d85510ee98..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/BitFieldGenerateMethod.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-
-import java.util.List;
-
-public interface BitFieldGenerateMethod
-{
- String generate(List<String> bitFieldList, int ordinal, int indentSize, int tabSize);
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/CommandGenerateMethod.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/CommandGenerateMethod.java
deleted file mode 100644
index 641f50c3f8..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/CommandGenerateMethod.java
+++ /dev/null
@@ -1,26 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-public interface CommandGenerateMethod
-{
- String generate(String codeType, AmqpField field, AmqpVersionSet versionSet, int indentSize, int tabSize, boolean notLast);
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/ConsolidatedField.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/ConsolidatedField.java
deleted file mode 100644
index 9ab7eb178b..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/ConsolidatedField.java
+++ /dev/null
@@ -1,120 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * Created by IntelliJ IDEA.
- * User: U146758
- * Date: 06-Mar-2007
- * Time: 09:22:21
- * To change this template use File | Settings | File Templates.
- */
-public class ConsolidatedField
-{
- private final String _name;
- private final String _type;
- private final List<String> _underlyingFields = new ArrayList<String>();
- private final Generator _generator;
- private boolean _isConsolidated;
-
- public ConsolidatedField(Generator generator, String name, String type)
- {
- this(generator,name,type,name,false);
- }
-
- public ConsolidatedField(Generator generator, String name, String type, String firstField)
- {
- this(generator,name,type,firstField,true);
- }
-
- public ConsolidatedField(Generator generator, String name, String type, String firstField, boolean consolidated)
- {
-
- _generator = generator;
- _name = name;
- _type = type;
- _isConsolidated = consolidated;
- _underlyingFields.add(firstField);
-
- }
-
-
- public void setConsolidated(boolean consolidated)
- {
- _isConsolidated = consolidated;
- }
-
- public String getName()
- {
- return _name;
- }
-
- public String getType()
- {
- return _type;
- }
-
- public String getNativeType()
- {
- return _generator.getNativeType(_type);
- }
-
- public String getEncodingType()
- {
- return _generator.getEncodingType(_type);
- }
-
- public void add(String name)
- {
- _underlyingFields.add(name);
- }
-
- public Collection<String> getUnderlyingFields()
- {
- return Collections.unmodifiableCollection(_underlyingFields);
- }
-
- public int getPosition(String fieldName)
- {
- return _underlyingFields.indexOf(fieldName);
- }
-
- public boolean isConsolidated()
- {
- return _isConsolidated;
- }
-
- public boolean isFixedSize()
- {
- return _generator.isFixedSizeType( getType() );
- }
-
- public int getSize()
- {
- return _generator.getTypeSize( getType() );
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/CppGenerator.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/CppGenerator.java
deleted file mode 100644
index 4f58cba34e..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/CppGenerator.java
+++ /dev/null
@@ -1,1716 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.TreeMap;
-
-public class CppGenerator extends Generator
-{
- protected static final String versionNamespaceStartToken = "${version_namespace_start}";
- protected static final String versionNamespaceEndToken = "${version_namespace_end}";
-
- // TODO: Move this to parent class
- protected static final int FIELD_NAME = 0;
- protected static final int FIELD_CODE_TYPE = 1;
-
- /**
- * A complete list of C++ reserved words. The names of varous XML elements within the AMQP
- * specification file are used for C++ identifier names in the generated code. Each proposed
- * name is checked against this list and is modified (by adding an '_' to the end of the
- * name - see function parseForReservedWords()) if found to be present.
- */
- protected static final String[] cppReservedWords = {"and", "and_eq", "asm", "auto", "bitand",
- "bitor", "bool", "break", "case", "catch", "char", "class", "compl", "const", "const_cast",
- "continue", "default", "delete", "do", "DomainInfo", "double", "dynamic_cast", "else",
- "enum", "explicit", "extern", "false", "float", "for", "friend", "goto", "if", "inline",
- "int", "long", "mutable", "namespace", "new", "not", "not_eq", "operator", "or", "or_eq",
- "private", "protected", "public", "register", "reinterpret_cast", "return", "short",
- "signed", "sizeof", "static", "static_cast", "struct", "switch", "template", "this",
- "throw", "true", "try", "typedef", "typeid", "typename", "union", "unsigned", "using",
- "virtual", "void", "volatile", "wchar_t", "while", "xor", "xor_eq"};
-
- /**
- * Although not reserved words, the following list of variable names that may cause compile
- * problems within a C++ environment because they clash with common #includes. The names of
- * varous XML elements within the AMQP specification file are used for C++ identifier names
- * in the generated code. Each proposed name is checked against this list and is modified
- * (by adding an '_' to the end of the name - see function parseForReservedWords()) if found
- * to be present. This list is best added to on an as-needed basis.
- */
- protected static final String[] cppCommonDefines = {"string"};
-
- // TODO: Move this to the Generator superclass?
- protected boolean quietFlag; // Supress warning messages to the console
-
- private class DomainInfo
- {
- public String type;
- public String size;
- public String encodeExpression;
- public String decodeExpression;
-
- public DomainInfo(String domain, String size, String encodeExpression,
- String decodeExpression)
- {
- this.type = domain;
- this.size = size;
- this.encodeExpression = encodeExpression;
- this.decodeExpression = decodeExpression;
- }
- }
-
- private static TreeMap<String, DomainInfo> typeMap = new TreeMap<String, DomainInfo>();
-
- public CppGenerator()
- {
- super();
- quietFlag = true;
- // Load C++ type and size maps.
- // Adjust or add to these lists as new types are added/defined.
- // The char '#' will be replaced by the field variable name (any type).
- // The char '~' will be replaced by the compacted bit array size (type bit only).
- typeMap.put("bit", new DomainInfo(
- "bool", // type
- "~", // size
- "", // encodeExpression
- "")); // decodeExpression
- typeMap.put("content", new DomainInfo(
- "Content", // type
- "#.size()", // size
- "buffer.putContent(#)", // encodeExpression
- "buffer.getContent(#)")); // decodeExpression
- typeMap.put("long", new DomainInfo(
- "u_int32_t", // type
- "4", // size
- "buffer.putLong(#)", // encodeExpression
- "# = buffer.getLong()")); // decodeExpression
- typeMap.put("longlong", new DomainInfo(
- "u_int64_t", // type
- "8", // size
- "buffer.putLongLong(#)", // encodeExpression
- "# = buffer.getLongLong()")); // decodeExpression
- typeMap.put("longstr", new DomainInfo(
- "string", // type
- "4 + #.length()", // size
- "buffer.putLongString(#)", // encodeExpression
- "buffer.getLongString(#)")); // decodeExpression
- typeMap.put("octet", new DomainInfo(
- "u_int8_t", // type
- "1", // size
- "buffer.putOctet(#)", // encodeExpression
- "# = buffer.getOctet()")); // decodeExpression
- typeMap.put("short", new DomainInfo(
- "u_int16_t", // type
- "2", // size
- "buffer.putShort(#)", // encodeExpression
- "# = buffer.getShort()")); // decodeExpression
- typeMap.put("shortstr", new DomainInfo(
- "string", // type
- "1 + #.length()", // size
- "buffer.putShortString(#)", // encodeExpression
- "buffer.getShortString(#)")); // decodeExpression
- typeMap.put("table", new DomainInfo(
- "FieldTable", // type
- "#.size()", // size
- "buffer.putFieldTable(#)", // encodeExpression
- "buffer.getFieldTable(#)")); // decodeExpression
- typeMap.put("timestamp", new DomainInfo(
- "u_int64_t", // type
- "8", // size
- "buffer.putLongLong(#)", // encodeExpression
- "buffer.getLongLong(#)")); // decodeExpression
- }
-
-
- public boolean isQuietFlag()
- {
- return quietFlag;
- }
-
- public void setQuietFlag(boolean quietFlag)
- {
- this.quietFlag = quietFlag;
- }
-
- // === Start of methods for Interface LanguageConverter ===
-
- public String prepareClassName(String className)
- {
- return camelCaseName(className, true);
- }
-
- public String prepareMethodName(String methodName)
- {
- return camelCaseName(methodName, false);
- }
-
- public String prepareDomainName(String domainName)
- {
- return camelCaseName(domainName, false);
- }
-
-
- public String getGeneratedType(String domainName, AmqpVersion version)
- throws AmqpTypeMappingException
- {
- String domainType = getDomainType(domainName, version);
- if (domainType == null)
- {
- throw new AmqpTypeMappingException("Domain type \"" + domainName +
- "\" not found in C++ typemap.");
- }
- DomainInfo info = typeMap.get(domainType);
- if (info == null)
- {
- throw new AmqpTypeMappingException("Unknown domain: \"" + domainType + "\"");
- }
- return info.type;
- }
-
- // === Abstract methods from class Generator - C++-specific implementation ===
-
- @Override
- protected String prepareFilename(String filenameTemplate, AmqpClass thisClass, AmqpMethod method,
- AmqpField field, AmqpVersion version)
- {
- StringBuffer sb = new StringBuffer(filenameTemplate);
- if (thisClass != null)
- {
- replaceToken(sb, "${CLASS}", thisClass.getName());
- }
- if (method != null)
- {
- replaceToken(sb, "${METHOD}", method.getName());
- }
- if (field != null)
- {
- replaceToken(sb, "${FIELD}", field.getName());
- }
- return sb.toString();
- }
-
- @Override
- protected void processModelTemplate(NamedTemplate template)
- {
- processTemplate(template, null, null, null, null);
- }
-
- @Override
- protected void processClassTemplate(NamedTemplate template, AmqpClass thisClass)
- {
- processTemplate(template, thisClass, null, null, null);
- }
-
- @Override
- protected void processMethodTemplate(NamedTemplate template, AmqpClass thisClass,
- AmqpMethod method)
- {
- StringBuffer sb = new StringBuffer(template.getTemplate());
- String filename = prepareFilename(getTemplateFileName(sb), thisClass, method, null, null);
- boolean templateProcessedFlag = false;
-
- // If method is not version consistent, create a namespace for each version
- // i.e. copy the bit between the versionNamespaceStartToken and versionNamespaceEndToken
- // once for each namespace.
- if (method != null)
- {
- if (!method.isVersionConsistent(getVersionSet()))
- {
- int namespaceStartIndex = sb.indexOf(versionNamespaceStartToken);
- int namespaceEndIndex = sb.indexOf(versionNamespaceEndToken) +
- versionNamespaceEndToken.length();
- if (namespaceStartIndex >= 0 && namespaceEndIndex >= 0 &&
- namespaceStartIndex <= namespaceEndIndex)
- {
- String namespaceSpan = sb.substring(namespaceStartIndex, namespaceEndIndex) + CR;
- sb.delete(namespaceStartIndex, namespaceEndIndex);
- for (AmqpVersion v : method.getVersionSet())
- {
- StringBuffer nssb = new StringBuffer(namespaceSpan);
- processTemplate(nssb, thisClass, method, null, template.getName(), v);
- sb.insert(namespaceStartIndex, nssb);
- }
- // Process all tokens *not* within the namespace span prior to inserting namespaces
- processTemplate(sb, thisClass, method, null, template.getName(), null);
- }
- templateProcessedFlag = true;
- }
- }
- // Remove any remaining namespace tags
- int nsTokenIndex = sb.indexOf(versionNamespaceStartToken);
- while (nsTokenIndex > 0)
- {
- sb.delete(nsTokenIndex, nsTokenIndex + versionNamespaceStartToken.length());
- nsTokenIndex = sb.indexOf(versionNamespaceStartToken);
- }
- nsTokenIndex = sb.indexOf(versionNamespaceEndToken);
- while (nsTokenIndex > 0)
- {
- sb.delete(nsTokenIndex, nsTokenIndex + versionNamespaceEndToken.length());
- nsTokenIndex = sb.indexOf(versionNamespaceEndToken);
- }
-
- if (!templateProcessedFlag)
- {
- processTemplate(sb, thisClass, method, null, template.getName(), null);
- }
- writeTargetFile(sb, new File(getOutputDirectory() + Utils.FILE_SEPARATOR + filename));
- generatedFileCounter++;
- }
-
- @Override
- protected void processTemplate(NamedTemplate template, AmqpClass thisClass, AmqpMethod method,
- AmqpField field, AmqpVersion version)
- {
- StringBuffer sb = new StringBuffer(template.getTemplate());
- String filename = prepareFilename(getTemplateFileName(sb), thisClass, method, field, version);
- processTemplate(sb, thisClass, method, field, template.getName(), null);
- writeTargetFile(sb, new File(getOutputDirectory() + Utils.FILE_SEPARATOR + filename));
- generatedFileCounter++;
- }
-
- protected void processTemplate(StringBuffer sb, AmqpClass thisClass, AmqpMethod method,
- AmqpField field, String templateFileName, AmqpVersion version)
- {
- try
- {
- processAllLists(sb, thisClass, method, version);
- }
- catch (AmqpTemplateException e)
- {
- System.out.println("ERROR: " + templateFileName + ": " + e.getMessage());
- }
- try
- {
- processAllTokens(sb, thisClass, method, field, version);
- }
- catch (AmqpTemplateException e)
- {
- System.out.println("ERROR: " + templateFileName + ": " + e.getMessage());
- }
- }
-
- @Override
- protected String processToken(String token, AmqpClass thisClass, AmqpMethod method, AmqpField field,
- AmqpVersion version)
- {
- if (token.compareTo("${GENERATOR}") == 0)
- {
- return GENERATOR_INFO;
- }
- if (token.compareTo("${CLASS}") == 0 && thisClass != null)
- {
- return thisClass.getName();
- }
- if (token.compareTo("${CLASS_ID_INIT}") == 0 && thisClass != null)
- {
- if (version == null)
- {
- return String.valueOf(thisClass.getIndexMap().firstKey());
- }
- return getIndex(thisClass.getIndexMap(), version);
- }
- if (token.compareTo("${METHOD}") == 0 && method != null)
- {
- return method.getName();
- }
- if (token.compareTo("${METHOD_ID_INIT}") == 0 && method != null)
- {
- if (version == null)
- {
- return String.valueOf(method.getIndexMap().firstKey());
- }
- return getIndex(method.getIndexMap(), version);
- }
- if (token.compareTo("${FIELD}") == 0 && field != null)
- {
- return field.getName();
- }
- if (token.compareTo(versionNamespaceStartToken) == 0 && version != null)
- {
- return "namespace " + version.namespace() + CR + "{";
- }
- if (token.compareTo(versionNamespaceEndToken) == 0 && version != null)
- {
- return "} // namespace " + version.namespace();
- }
- if (token.compareTo("${mb_constructor_with_initializers}") == 0)
- {
- return generateConstructor(thisClass, method, version, 4, 4);
- }
- if (token.compareTo("${mb_server_operation_invoke}") == 0)
- {
- return generateServerOperationsInvoke(thisClass, method, version, 4, 4);
- }
- if (token.compareTo("${mb_buffer_param}") == 0)
- {
- return method.getFieldMap().size() > 0 ? " buffer" : "";
- }
- if (token.compareTo("${hv_latest_major}") == 0)
- {
- return String.valueOf(getVersionSet().last().getMajor());
- }
- if (token.compareTo("${hv_latest_minor}") == 0)
- {
- return String.valueOf(getVersionSet().last().getMinor());
- }
-
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
-
- @Override
- protected void processClassList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpModel model, AmqpVersion version)
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokxStart = tline.indexOf('$');
- String token = tline.substring(tokxStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- // ClientOperations.h
- if (token.compareTo("${coh_method_handler_get_method}") == 0)
- {
- codeSnippet = generateOpsMethodHandlerGetMethods(model, false, 4);
- }
- else if (token.compareTo("${coh_inner_class}") == 0)
- {
- codeSnippet = generateOpsInnerClasses(model, false, 4, 4);
- }
-
- // ServerOperations.h
- else if (token.compareTo("${soh_method_handler_get_method}") == 0)
- {
- codeSnippet = generateOpsMethodHandlerGetMethods(model, true, 4);
- }
- else if (token.compareTo("${soh_inner_class}") == 0)
- {
- codeSnippet = generateOpsInnerClasses(model, true, 4, 4);
- }
-
- // ClientProxy.h/cpp
- else if (token.compareTo("${cph_inner_class_instance}") == 0)
- {
- codeSnippet = generateProxyInnerClassInstances(model, false, 4);
- }
- else if (token.compareTo("${cph_inner_class_get_method}") == 0)
- {
- codeSnippet = generateProxyInnerClassGetMethodDecls(model, false, 4);
- }
- else if (token.compareTo("${cph_inner_class_defn}") == 0)
- {
- codeSnippet = generateProxyInnerClassDefinitions(model, false, 4, 4);
- }
- else if (token.compareTo("${cpc_constructor_initializer}") == 0)
- {
- codeSnippet = generateProxyConstructorInitializers(model, false, 4);
- }
- else if (token.compareTo("${cpc_inner_class_get_method}") == 0)
- {
- codeSnippet = generateProxyInnerClassGetMethodImpls(model, false, 0, 4);
- }
- else if (token.compareTo("${cpc_inner_class_impl}") == 0)
- {
- codeSnippet = generateProxyInnerClassImpl(model, false, 0, 4);
- }
- else if (token.compareTo("${cph_handler_pointer_defn}") == 0)
- {
- codeSnippet = generateHandlerPointerDefinitions(model, false, 4);
- }
- else if (token.compareTo("${cph_handler_pointer_get_method}") == 0)
- {
- codeSnippet = generateHandlerPointerGetMethods(model, false, 4);
- }
-
- // SerrverProxy.h/cpp
- else if (token.compareTo("${sph_inner_class_instance}") == 0)
- {
- codeSnippet = generateProxyInnerClassInstances(model, true, 4);
- }
- else if (token.compareTo("${sph_inner_class_get_method}") == 0)
- {
- codeSnippet = generateProxyInnerClassGetMethodDecls(model, true, 4);
- }
- else if (token.compareTo("${sph_inner_class_defn}") == 0)
- {
- codeSnippet = generateProxyInnerClassDefinitions(model, true, 4, 4);
- }
- else if (token.compareTo("${spc_constructor_initializer}") == 0)
- {
- codeSnippet = generateProxyConstructorInitializers(model, true, 4);
- }
- else if (token.compareTo("${spc_inner_class_get_method}") == 0)
- {
- codeSnippet = generateProxyInnerClassGetMethodImpls(model, true, 0, 4);
- }
- else if (token.compareTo("${spc_inner_class_impl}") == 0)
- {
- codeSnippet = generateProxyInnerClassImpl(model, true, 0, 4);
- }
- else if (token.compareTo("${sph_handler_pointer_defn}") == 0)
- {
- codeSnippet = generateHandlerPointerDefinitions(model, true, 4);
- }
- else if (token.compareTo("${sph_handler_pointer_get_method}") == 0)
- {
- codeSnippet = generateHandlerPointerGetMethods(model, true, 4);
- }
-
- // amqp_methods.h/cpp
- else if (token.compareTo("${mh_method_body_class_indlude}") == 0)
- {
- codeSnippet = generateMethodBodyIncludeList(model, 0);
- }
- else if (token.compareTo("${mh_method_body_class_instance}") == 0)
- {
- codeSnippet = generateMethodBodyInstances(model, 0);
- }
- else if (token.compareTo("${mc_create_method_body_map_entry}") == 0)
- {
- codeSnippet = generateMethodBodyMapEntry(model, 4);
- }
-
- else // Oops!
- {
- throw new AmqpTemplateException("Template token \"" + token + "\" unknown.");
- }
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- @Override
- protected void processMethodList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpClass thisClass)
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokxStart = tline.indexOf('$');
- String token = tline.substring(tokxStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- if (token.compareTo("${cpc_method_body_include}") == 0)
- {
- codeSnippet = generateMethodBodyIncludes(thisClass, 0);
- }
- else if (token.compareTo("${spc_method_body_include}") == 0)
- {
- codeSnippet = generateMethodBodyIncludes(thisClass, 0);
- }
- else if (token.compareTo("${mc_method_body_include}") == 0)
- {
- codeSnippet = generateMethodBodyIncludes(thisClass, 0);
- }
-
- else // Oops!
- {
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- @Override
- protected void processFieldList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpFieldMap fieldMap, AmqpVersion version)
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokxStart = tline.indexOf('$');
- String token = tline.substring(tokxStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- if (token.compareTo("${mb_field_declaration}") == 0)
- {
- codeSnippet = generateFieldDeclarations(fieldMap, version, 4);
- }
- else if (token.compareTo("${mb_field_get_method}") == 0)
- {
- codeSnippet = generateFieldGetMethods(fieldMap, version, 4);
- }
- else if (token.compareTo("${mb_field_print}") == 0)
- {
- codeSnippet = generatePrintMethodContents(fieldMap, version, 8);
- }
- else if (token.compareTo("${mb_body_size}") == 0)
- {
- codeSnippet = generateBodySizeMethodContents(fieldMap, version, 8);
- }
- else if (token.compareTo("${mb_encode}") == 0)
- {
- codeSnippet = generateEncodeMethodContents(fieldMap, version, 8);
- }
- else if (token.compareTo("${mb_decode}") == 0)
- {
- codeSnippet = generateDecodeMethodContents(fieldMap, version, 8);
- }
-
- else // Oops!
- {
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- @Override
- protected void processConstantList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpConstantSet constantSet)
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokxStart = tline.indexOf('$');
- String token = tline.substring(tokxStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- if (token.compareTo("${ch_get_value_method}") == 0)
- {
- codeSnippet = generateConstantGetMethods(constantSet, 4, 4);
- }
-
- else // Oops!
- {
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- // === Protected and private helper functions unique to C++ implementation ===
-
- // Methods for generation of code snippets for AMQP_Constants.h file
-
- protected String generateConstantGetMethods(AmqpConstantSet constantSet,
- int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- for (AmqpConstant thisConstant : constantSet.getContstants())
- {
- if (thisConstant.isVersionConsistent(getVersionSet()))
- {
- // return a constant
- String value = thisConstant.firstKey();
- sb.append(indent + "static const char* " + thisConstant.getName() + "() { return \"" +
- thisConstant.firstKey() + "\"; }" + CR);
- if (Utils.containsOnlyDigits(value))
- {
- sb.append(indent + "static int " + thisConstant.getName() + "AsInt() { return " +
- thisConstant.firstKey() + "; }" + CR);
- }
- if (Utils.containsOnlyDigitsAndDecimal(value))
- {
- sb.append(indent + "static double " + thisConstant.getName() + "AsDouble() { return (double)" +
- thisConstant.firstKey() + "; }" + CR);
- }
- sb.append(CR);
- }
- else
- {
- // Return version-specific constant
- sb.append(generateVersionDependentGet(thisConstant, "const char*", "", "\"", "\"", indentSize, tabSize));
- sb.append(generateVersionDependentGet(thisConstant, "int", "AsInt", "", "", indentSize, tabSize));
- sb.append(generateVersionDependentGet(thisConstant, "double", "AsDouble", "(double)", "", indentSize, tabSize));
- sb.append(CR);
- }
- }
- return sb.toString();
- }
-
- protected String generateVersionDependentGet(AmqpConstant constant, String methodReturnType,
- String methodNameSuffix, String returnPrefix, String returnPostfix, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + methodReturnType + " " + constant.getName() + methodNameSuffix +
- "() const" + CR);
- sb.append(indent + "{" + CR);
- boolean first = true;
- for (String thisValue : constant.keySet())
- {
- AmqpVersionSet versionSet = constant.get(thisValue);
- sb.append(indent + tab + (first ? "" : "else ") + "if (" + generateVersionCheck(versionSet) +
- ")" + CR);
- sb.append(indent + tab + "{" + CR);
- if (methodReturnType.compareTo("int") == 0 && !Utils.containsOnlyDigits(thisValue))
- {
- sb.append(generateConstantDeclarationException(constant.getName(), methodReturnType,
- indentSize + (2 * tabSize), tabSize));
- }
- else if (methodReturnType.compareTo("double") == 0 && !Utils.containsOnlyDigitsAndDecimal(thisValue))
- {
- sb.append(generateConstantDeclarationException(constant.getName(), methodReturnType,
- indentSize + (2 * tabSize), tabSize));
- }
- else
- {
- sb.append(indent + tab + tab + "return " + returnPrefix + thisValue + returnPostfix + ";" + CR);
- }
- sb.append(indent + tab + "}" + CR);
- first = false;
- }
- sb.append(indent + tab + "else" + CR);
- sb.append(indent + tab + "{" + CR);
- sb.append(indent + tab + tab + "std::stringstream ss;" + CR);
- sb.append(indent + tab + tab + "ss << \"Constant \\\"" + constant.getName() +
- "\\\" is undefined for AMQP version \" <<" + CR);
- sb.append(indent + tab + tab + tab + "version.toString() << \".\";" + CR);
- sb.append(indent + tab + tab + "throw ProtocolVersionException(ss.str());" + CR);
- sb.append(indent + tab + "}" + CR);
- sb.append(indent + "}" + CR);
- return sb.toString();
- }
-
- protected String generateConstantDeclarationException(String name, String methodReturnType,
- int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + "std::stringstream ss;" + CR);
- sb.append(indent + "ss << \"Constant \\\"" + name + "\\\" cannot be converted to type " +
- methodReturnType + " for AMQP version \" <<" + CR);
- sb.append(indent + tab + "version.toString() << \".\";" + CR);
- sb.append(indent + "throw ProtocolVersionException(ss.str());" + CR);
- return sb.toString();
- }
-
- // Methods used for generation of code snippets for Server/ClientOperations class generation
-
- protected String generateOpsMethodHandlerGetMethods(AmqpModel model, boolean serverFlag, int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- for (String thisClassName : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(thisClassName);
- // Only generate for this class if there is at least one method of the
- // required chassis (server/client flag).
- boolean chassisFoundFlag = false;
- for (String thisMethodName : thisClass.getMethodMap().keySet())
- {
- AmqpMethod method = thisClass.getMethodMap().get(thisMethodName);
- boolean clientChassisFlag = method.getClientMethodFlagMap().isSet();
- boolean serverChassisFlag = method.getServerMethodFlagMap().isSet();
- if ((serverFlag && serverChassisFlag) || (!serverFlag && clientChassisFlag))
- {
- chassisFoundFlag = true;
- }
- }
- if (chassisFoundFlag)
- {
- sb.append(indent + "virtual AMQP_" + (serverFlag ? "Server" : "Client") + "Operations::" +
- thisClass.getName() + "Handler* get" + thisClass.getName() + "Handler() = 0;" + CR);
- }
- }
- return sb.toString();
- }
-
- protected String generateOpsInnerClasses(AmqpModel model, boolean serverFlag, int indentSize, int tabSize)
- {
-
- String proxyClassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Proxy";
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- boolean first = true;
- for (String thisClassName : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(thisClassName);
- String handlerClassName = thisClass.getName() + "Handler";
- if (!first)
- {
- sb.append(CR);
- }
- sb.append(indent + "// ==================== class " + handlerClassName +
- " ====================" + CR);
- sb.append(indent + "class " + handlerClassName);
- if (thisClass.getVersionSet().size() != getVersionSet().size())
- {
- sb.append(" // AMQP Version(s) " + thisClass.getVersionSet() + CR);
- }
- else
- {
- sb.append(CR);
- }
- sb.append(indent + "{" + CR);
- sb.append(indent + "private:" + CR);
- sb.append(indent + tab + proxyClassName + "* parent;" + CR);
- sb.append(CR);
- sb.append(indent + tab + "// Constructors and destructors" + CR);
- sb.append(CR);
- sb.append(indent + "protected:" + CR);
- sb.append(indent + tab + handlerClassName + "() {}" + CR);
- sb.append(indent + "public:" + CR);
- sb.append(indent + tab + handlerClassName +
- "(" + proxyClassName + "* _parent) {parent = _parent;}" + CR);
- sb.append(indent + tab + "virtual ~" + handlerClassName + "() {}" + CR);
- sb.append(CR);
- sb.append(indent + tab + "// Protocol methods" + CR);
- sb.append(CR);
- sb.append(generateInnerClassMethods(thisClass, serverFlag, true, indentSize + tabSize, tabSize));
- sb.append(indent + "}; // class " + handlerClassName + CR);
- first = false;
- }
- return sb.toString();
- }
-
- protected String generateInnerClassMethods(AmqpClass thisClass, boolean serverFlag,
- boolean abstractMethodFlag, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- String outerClassName = "AMQP_" + (serverFlag ? "Server" : "Client") + (abstractMethodFlag ? "Operations"
- : "Proxy");
- boolean first = true;
- for (String thisMethodName : thisClass.getMethodMap().keySet())
- {
- AmqpMethod method = thisClass.getMethodMap().get(thisMethodName);
- boolean clientChassisFlag = method.getClientMethodFlagMap().isSet();
- boolean serverChassisFlag = method.getServerMethodFlagMap().isSet();
- if ((serverFlag && serverChassisFlag) || (!serverFlag && clientChassisFlag))
- {
- String methodName = parseForReservedWords(method.getName(), outerClassName + "." + thisClass.getName());
- AmqpOverloadedParameterMap overloadededParameterMap =
- method.getOverloadedParameterLists(thisClass.getVersionSet(), this);
- for (AmqpOrdinalFieldMap thisFieldMap : overloadededParameterMap.keySet())
- {
- AmqpVersionSet versionSet = overloadededParameterMap.get(thisFieldMap);
- if (!first)
- {
- sb.append(CR);
- }
- sb.append(indent + "virtual void " + methodName + "( u_int16_t channel");
- sb.append(generateMethodParameterList(thisFieldMap, indentSize + (5 * tabSize), true, true, true));
- sb.append(" )");
- if (abstractMethodFlag)
- {
- sb.append(" = 0");
- }
- sb.append(";");
- if (versionSet.size() != getVersionSet().size())
- {
- sb.append(" // AMQP Version(s) " + versionSet);
- }
- sb.append(CR);
- first = false;
- }
- }
- }
- return sb.toString();
- }
-
- // Methods used for generation of code snippets for Server/ClientProxy class generation
-
- protected String generateHandlerPointerDefinitions(AmqpModel model, boolean serverFlag,
- int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- String outerClassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Operations";
- for (String thisClassName : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(thisClassName);
- sb.append(indent + outerClassName + "::" + thisClass.getName() + "Handler* " +
- thisClass.getName() + "HandlerPtr;" + CR);
- }
- return sb.toString();
- }
-
- protected String generateHandlerPointerGetMethods(AmqpModel model, boolean serverFlag,
- int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- String outerClassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Operations";
- for (String thisClassName : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(thisClassName);
- sb.append(indent + "virtual inline " + outerClassName + "::" + thisClass.getName() + "Handler* get" +
- thisClass.getName() + "Handler() { return &" + Utils.firstLower(thisClass.getName()) + ";}" + CR);
- }
- return sb.toString();
- }
-
- protected String generateProxyInnerClassInstances(AmqpModel model, boolean serverFlag,
- int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- String outerClassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Proxy";
- for (String thisClassName : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(thisClassName);
- String instanceName = parseForReservedWords(Utils.firstLower(thisClass.getName()), outerClassName);
- String className = parseForReservedWords(thisClass.getName(), null);
- sb.append(indent + className + " " + instanceName + ";");
- if (thisClass.getVersionSet().size() != getVersionSet().size())
- {
- sb.append(" // AMQP Version(s) " + thisClass.getVersionSet() + CR);
- }
- else
- {
- sb.append(CR);
- }
- }
- return sb.toString();
- }
-
- protected String generateProxyInnerClassGetMethodDecls(AmqpModel model, boolean serverFlag,
- int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- String outerClassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Proxy";
- for (String thisClassName : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(thisClassName);
- String className = parseForReservedWords(thisClass.getName(), outerClassName);
- sb.append(indent + className + "& get" + className + "();");
- if (thisClass.getVersionSet().size() != getVersionSet().size())
- {
- sb.append(" // AMQP Version(s) " + thisClass.getVersionSet() + CR);
- }
- else
- {
- sb.append(CR);
- }
- }
- return sb.toString();
- }
-
- protected String generateProxyInnerClassDefinitions(AmqpModel model, boolean serverFlag,
- int indentSize, int tabSize)
- {
- String proxyClassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Proxy";
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- boolean first = true;
- for (String thisClassName : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(thisClassName);
- String className = thisClass.getName();
- String superclassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Operations::" +
- thisClass.getName() + "Handler";
- if (!first)
- {
- sb.append(CR);
- }
- sb.append(indent + "// ==================== class " + className +
- " ====================" + CR);
- sb.append(indent + "class " + className + " : virtual public " + superclassName);
- if (thisClass.getVersionSet().size() != getVersionSet().size())
- {
- sb.append(" // AMQP Version(s) " + thisClass.getVersionSet() + CR);
- }
- else
- {
- sb.append(CR);
- }
- sb.append(indent + "{" + CR);
- sb.append(indent + "private:" + CR);
- sb.append(indent + tab + "OutputHandler* out;" + CR);
- sb.append(indent + tab + proxyClassName + "* parent;" + CR);
- sb.append(CR);
- sb.append(indent + "public:" + CR);
- sb.append(indent + tab + "// Constructors and destructors" + CR);
- sb.append(CR);
- sb.append(indent + tab + className + "(OutputHandler* out, " + proxyClassName + "* _parent) : " + CR);
- sb.append(indent + tab + tab + "out(out) {parent = _parent;}" + CR);
- sb.append(indent + tab + "virtual ~" + className + "() {}" + CR);
- sb.append(CR);
- sb.append(indent + tab + "// Protocol methods" + CR);
- sb.append(CR);
- sb.append(generateInnerClassMethods(thisClass, serverFlag, false, indentSize + tabSize, tabSize));
- sb.append(indent + "}; // class " + className + CR);
- first = false;
- }
- return sb.toString();
- }
-
- protected String generateProxyConstructorInitializers(AmqpModel model, boolean serverFlag,
- int indentSize)
- {
- String outerClassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Proxy";
- String superclassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Operations";
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer(indent + superclassName + "(major, minor)," + CR);
- sb.append(indent + "version(major, minor)," + CR);
- sb.append(indent + "out(out)");
- Iterator<String> cItr = model.getClassMap().keySet().iterator();
- while (cItr.hasNext())
- {
- AmqpClass thisClass = model.getClassMap().get(cItr.next());
- String instanceName = parseForReservedWords(Utils.firstLower(thisClass.getName()), outerClassName);
- sb.append("," + CR);
- sb.append(indent + instanceName + "(out, this)");
- if (!cItr.hasNext())
- {
- sb.append(CR);
- }
- }
- return sb.toString();
- }
-
- protected String generateProxyInnerClassGetMethodImpls(AmqpModel model, boolean serverFlag,
- int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- String outerClassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Proxy";
- Iterator<String> cItr = model.getClassMap().keySet().iterator();
- while (cItr.hasNext())
- {
- AmqpClass thisClass = model.getClassMap().get(cItr.next());
- String className = thisClass.getName();
- String instanceName = parseForReservedWords(Utils.firstLower(thisClass.getName()), outerClassName);
- sb.append(indent + outerClassName + "::" + className + "& " +
- outerClassName + "::get" + className + "()" + CR);
- sb.append(indent + "{" + CR);
- if (thisClass.getVersionSet().size() != getVersionSet().size())
- {
- sb.append(indent + tab + "if (!" + generateVersionCheck(thisClass.getVersionSet()) + ")" + CR);
- sb.append(indent + tab + tab + "throw new ProtocolVersionException();" + CR);
- }
- sb.append(indent + tab + "return " + instanceName + ";" + CR);
- sb.append(indent + "}" + CR);
- if (cItr.hasNext())
- {
- sb.append(CR);
- }
- }
- return sb.toString();
- }
-
- protected String generateProxyInnerClassImpl(AmqpModel model, boolean serverFlag,
- int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- boolean firstClassFlag = true;
- for (String thisClassName : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(thisClassName);
- String className = thisClass.getName();
- if (!firstClassFlag)
- {
- sb.append(CR);
- }
- sb.append(indent + "// ==================== class " + className +
- " ====================" + CR);
- sb.append(generateInnerClassMethodImpls(thisClass, serverFlag, indentSize, tabSize));
- firstClassFlag = false;
- }
- return sb.toString();
- }
-
- protected String generateInnerClassMethodImpls(AmqpClass thisClass, boolean serverFlag,
- int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- String outerclassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Proxy";
- boolean first = true;
- for (String thisMethodName : thisClass.getMethodMap().keySet())
- {
- AmqpMethod method = thisClass.getMethodMap().get(thisMethodName);
- String methodBodyClassName = thisClass.getName() + Utils.firstUpper(method.getName()) + "Body";
- boolean clientChassisFlag = method.getClientMethodFlagMap().isSet();
- boolean serverChassisFlag = method.getServerMethodFlagMap().isSet();
- boolean versionConsistentFlag = method.isVersionConsistent(getVersionSet());
- if ((serverFlag && serverChassisFlag) || (!serverFlag && clientChassisFlag))
- {
- String methodName = parseForReservedWords(method.getName(), outerclassName + "." + thisClass.getName());
- AmqpOverloadedParameterMap overloadededParameterMap =
- method.getOverloadedParameterLists(thisClass.getVersionSet(), this);
- for (AmqpOrdinalFieldMap thisFieldMap : overloadededParameterMap.keySet())
- {
- AmqpVersionSet versionSet = overloadededParameterMap.get(thisFieldMap);
- if (!first)
- {
- sb.append(CR);
- }
- sb.append(indent + "void " + outerclassName + "::" + thisClass.getName() + "::" +
- methodName + "( u_int16_t channel");
- sb.append(generateMethodParameterList(thisFieldMap, indentSize + (5 * tabSize), true, true, true));
- sb.append(" )");
- if (versionSet.size() != getVersionSet().size())
- {
- sb.append(" // AMQP Version(s) " + versionSet);
- }
- sb.append(CR);
- sb.append(indent + "{" + CR);
- sb.append(generateMethodBodyCallContext(thisFieldMap, outerclassName, methodBodyClassName,
- versionConsistentFlag, versionSet, indentSize + tabSize, tabSize));
- sb.append(indent + "}" + CR);
- sb.append(CR);
- first = false;
- }
- }
- }
- return sb.toString();
- }
-
- protected String generateMethodBodyCallContext(AmqpOrdinalFieldMap fieldMap, String outerclassName,
- String methodBodyClassName, boolean versionConsistentFlag, AmqpVersionSet versionSet,
- int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- if (versionConsistentFlag)
- {
- sb.append(generateMethodBodyCall(fieldMap, methodBodyClassName, null, indentSize, tabSize));
- }
- else
- {
- boolean firstOverloadedMethodFlag = true;
- for (AmqpVersion thisVersion : versionSet)
- {
- sb.append(indent);
- if (!firstOverloadedMethodFlag)
- {
- sb.append("else ");
- }
- sb.append("if (" + generateVersionCheck(thisVersion) + ")" + CR);
- sb.append(indent + "{" + CR);
- sb.append(generateMethodBodyCall(fieldMap, methodBodyClassName, thisVersion,
- indentSize + tabSize, tabSize));
- sb.append(indent + "}" + CR);
- firstOverloadedMethodFlag = false;
- }
- sb.append(indent + "else" + CR);
- sb.append(indent + "{" + CR);
- sb.append(indent + tab + "std::stringstream ss;" + CR);
- sb.append(indent + tab + "ss << \"Call to " + outerclassName + "::" + methodBodyClassName +
- "(u_int16_t" + generateMethodParameterList(fieldMap, 0, true, true, false) + ")\"" + CR);
- sb.append(indent + tab + tab + "<< \" is invalid for AMQP version \" << version.toString() << \".\";" + CR);
- sb.append(indent + tab + "throw new ProtocolVersionException(ss.str());" + CR);
- sb.append(indent + "}" + CR);
- }
- return sb.toString();
- }
-
- protected String generateMethodBodyCall(AmqpOrdinalFieldMap fieldMap, String methodBodyClassName,
- AmqpVersion version, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- String namespace = version != null ? version.namespace() + "::" : "";
- StringBuffer sb = new StringBuffer(indent + "out->send( new AMQFrame(parent->getProtocolVersion(), channel," + CR);
- sb.append(indent + tab + "new " + namespace + methodBodyClassName + "( parent->getProtocolVersion()");
- sb.append(generateMethodParameterList(fieldMap, indentSize + (5 * tabSize), true, false, true));
- sb.append(" )));" + CR);
- return sb.toString();
- }
-
- protected String generateMethodBodyIncludes(AmqpClass thisClass, int indentSize)
- {
- StringBuffer sb = new StringBuffer();
- if (thisClass != null)
- {
- sb.append(generateClassMethodBodyInclude(thisClass, indentSize));
- }
- else
- {
- for (String thisClassName : getModel().getClassMap().keySet())
- {
- thisClass = getModel().getClassMap().get(thisClassName);
- sb.append(generateClassMethodBodyInclude(thisClass, indentSize));
- }
- }
- return sb.toString();
- }
-
- protected String generateClassMethodBodyInclude(AmqpClass thisClass, int indentSize)
- {
- StringBuffer sb = new StringBuffer();
- String indent = Utils.createSpaces(indentSize);
- for (String thisMethodName : thisClass.getMethodMap().keySet())
- {
- AmqpMethod method = thisClass.getMethodMap().get(thisMethodName);
- sb.append(indent + "#include <" + thisClass.getName() +
- Utils.firstUpper(method.getName()) + "Body.h>" + CR);
- }
- return sb.toString();
- }
-
- // Methods used for generation of code snippets for MethodBody class generation
-
- protected String getIndex(AmqpOrdinalVersionMap indexMap, AmqpVersion version)
- {
- for (Integer thisIndex : indexMap.keySet())
- {
- AmqpVersionSet versionSet = indexMap.get(thisIndex);
- if (versionSet.contains(version))
- {
- return String.valueOf(thisIndex);
- }
- }
- throw new AmqpTemplateException("Unable to find index for version " + version);
- }
-
- protected String generateFieldDeclarations(AmqpFieldMap fieldMap, AmqpVersion version, int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- if (version == null)
- {
- version = getVersionSet().first();
- }
- AmqpOrdinalFieldMap ordinalFieldMap = fieldMap.getMapForVersion(version, true, this);
- for (Integer thisOrdinal : ordinalFieldMap.keySet())
- {
- String[] fieldDomainPair = ordinalFieldMap.get(thisOrdinal);
- sb.append(indent + fieldDomainPair[FIELD_CODE_TYPE] + " " + fieldDomainPair[FIELD_NAME] + ";" + CR);
- }
- return sb.toString();
- }
-
- protected String generateFieldGetMethods(AmqpFieldMap fieldMap, AmqpVersion version, int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- if (version == null)
- {
- version = getVersionSet().first();
- }
- AmqpOrdinalFieldMap ordinalFieldMap = fieldMap.getMapForVersion(version, true, this);
- for (Integer thisOrdinal : ordinalFieldMap.keySet())
- {
- String[] fieldDomainPair = ordinalFieldMap.get(thisOrdinal);
- sb.append(indent + "inline " + setRef(fieldDomainPair[FIELD_CODE_TYPE]) + " get" +
- Utils.firstUpper(fieldDomainPair[FIELD_NAME]) + "() { return " +
- fieldDomainPair[FIELD_NAME] + "; }" + CR);
- }
- return sb.toString();
- }
-
- protected String generatePrintMethodContents(AmqpFieldMap fieldMap, AmqpVersion version, int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- if (version == null)
- {
- version = getVersionSet().first();
- }
- AmqpOrdinalFieldMap ordinalFieldMap = fieldMap.getMapForVersion(version, true, this);
- boolean firstFlag = true;
- for (Integer thisOrdinal : ordinalFieldMap.keySet())
- {
- String[] fieldDomainPair = ordinalFieldMap.get(thisOrdinal);
- String cast = fieldDomainPair[FIELD_CODE_TYPE].compareTo("u_int8_t") == 0 ? "(int)" : "";
- sb.append(indent + "out << \"");
- if (!firstFlag)
- {
- sb.append("; ");
- }
- sb.append(fieldDomainPair[FIELD_NAME] + "=\" << " + cast + fieldDomainPair[FIELD_NAME] + ";" + CR);
- firstFlag = false;
- }
- return sb.toString();
- }
-
- protected String generateBodySizeMethodContents(AmqpFieldMap fieldMap, AmqpVersion version,
- int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- ArrayList<String> bitFieldList = new ArrayList<String>();
- AmqpOrdinalFieldMap ordinalFieldMap = fieldMap.getMapForVersion(version, false, this);
- Iterator<Integer> oItr = ordinalFieldMap.keySet().iterator();
- int ordinal = 0;
- while (oItr.hasNext())
- {
- ordinal = oItr.next();
- String[] fieldDomainPair = ordinalFieldMap.get(ordinal);
- AmqpVersion thisVersion = version == null ? getVersionSet().first() : version;
- String domainType = getDomainType(fieldDomainPair[FIELD_CODE_TYPE], thisVersion);
-
- // Defer bit types by adding them to an array. When the first subsequent non-bit
- // type is encountered, then handle the bits. This allows consecutive bits to be
- // placed into the same byte(s) - 8 bits to the byte.
- if (domainType.compareTo("bit") == 0)
- {
- bitFieldList.add(fieldDomainPair[FIELD_NAME]);
- }
- else
- {
- if (bitFieldList.size() > 0) // Handle accumulated bit types (if any)
- {
- sb.append(generateBitArrayBodySizeMethodContents(bitFieldList, ordinal, indentSize));
- }
- sb.append(indent + "size += " +
- typeMap.get(domainType).size.replaceAll("#", fieldDomainPair[FIELD_NAME]) +
- "; /* " + fieldDomainPair[FIELD_NAME] + ": " +
- domainType + " */" + CR);
- }
- }
- if (bitFieldList.size() > 0) // Handle any remaining accumulated bit types
- {
- sb.append(generateBitArrayBodySizeMethodContents(bitFieldList, ordinal, indentSize));
- }
- return sb.toString();
- }
-
- protected String generateBitArrayBodySizeMethodContents(ArrayList<String> bitFieldList,
- int ordinal, int indentSize)
- {
- int numBytes = ((bitFieldList.size() - 1) / 8) + 1;
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- String comment = bitFieldList.size() == 1 ?
- bitFieldList.get(0) + ": bit" :
- "Combinded bits: " + bitFieldList;
- sb.append(indent + "size += " +
- typeMap.get("bit").size.replaceAll("~", String.valueOf(numBytes)) +
- "; /* " + comment + " */" + CR);
- bitFieldList.clear();
- return sb.toString();
- }
-
- protected String generateEncodeMethodContents(AmqpFieldMap fieldMap, AmqpVersion version,
- int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- ArrayList<String> bitFieldList = new ArrayList<String>();
- AmqpOrdinalFieldMap ordinalFieldMap = fieldMap.getMapForVersion(version, false, this);
- Iterator<Integer> oItr = ordinalFieldMap.keySet().iterator();
- int ordinal = 0;
- while (oItr.hasNext())
- {
- ordinal = oItr.next();
- String[] fieldDomainPair = ordinalFieldMap.get(ordinal);
- AmqpVersion thisVersion = version == null ? getVersionSet().first() : version;
- String domainType = getDomainType(fieldDomainPair[FIELD_CODE_TYPE], thisVersion);
-
- // Defer bit types by adding them to an array. When the first subsequent non-bit
- // type is encountered, then handle the bits. This allows consecutive bits to be
- // placed into the same byte(s) - 8 bits to the byte.
- if (domainType.compareTo("bit") == 0)
- {
- bitFieldList.add(fieldDomainPair[FIELD_NAME]);
- }
- else
- {
- if (bitFieldList.size() > 0) // Handle accumulated bit types (if any)
- {
- sb.append(generateBitEncodeMethodContents(bitFieldList, ordinal, indentSize));
- }
- sb.append(indent +
- typeMap.get(domainType).encodeExpression.replaceAll("#", fieldDomainPair[FIELD_NAME]) +
- "; /* " + fieldDomainPair[FIELD_NAME] + ": " + domainType + " */" + CR);
- }
- }
- if (bitFieldList.size() > 0) // Handle any remaining accumulated bit types
- {
- sb.append(generateBitEncodeMethodContents(bitFieldList, ordinal, indentSize));
- }
-
- return sb.toString();
- }
-
- protected String generateBitEncodeMethodContents(ArrayList<String> bitFieldList, int ordinal,
- int indentSize)
- {
- int numBytes = ((bitFieldList.size() - 1) / 8) + 1;
- String indent = Utils.createSpaces(indentSize);
- String bitArrayName = "flags_" + ordinal;
- StringBuffer sb = new StringBuffer(indent + "u_int8_t " + bitArrayName +
- "[" + numBytes + "] = {0};" +
- (numBytes != 1 ? " /* All array elements will be initialized to 0 */" : "") +
- CR);
- for (int i = 0; i < bitFieldList.size(); i++)
- {
- int bitIndex = i % 8;
- int byteIndex = i / 8;
- sb.append(indent + bitArrayName + "[" + byteIndex + "] |= " + bitFieldList.get(i) +
- " << " + bitIndex + "; /* " + bitFieldList.get(i) + ": bit */" + CR);
- }
- for (int i = 0; i < numBytes; i++)
- {
- sb.append(indent + "buffer.putOctet(" + bitArrayName + "[" + i + "]);" + CR);
- }
- bitFieldList.clear();
- return sb.toString();
- }
-
- protected String generateDecodeMethodContents(AmqpFieldMap fieldMap, AmqpVersion version,
- int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- ArrayList<String> bitFieldList = new ArrayList<String>();
- AmqpOrdinalFieldMap ordinalFieldMap = fieldMap.getMapForVersion(version, false, this);
- Iterator<Integer> oItr = ordinalFieldMap.keySet().iterator();
- int ordinal = 0;
- while (oItr.hasNext())
- {
- ordinal = oItr.next();
- String[] fieldDomainPair = ordinalFieldMap.get(ordinal);
- AmqpVersion thisVersion = version == null ? getVersionSet().first() : version;
- String domainType = getDomainType(fieldDomainPair[FIELD_CODE_TYPE], thisVersion);
-
- // Defer bit types by adding them to an array. When the first subsequent non-bit
- // type is encountered, then handle the bits. This allows consecutive bits to be
- // placed into the same byte(s) - 8 bits to the byte.
- if (domainType.compareTo("bit") == 0)
- {
- bitFieldList.add(fieldDomainPair[FIELD_NAME]);
- }
- else
- {
- if (bitFieldList.size() > 0) // Handle accumulated bit types (if any)
- {
- sb.append(generateBitDecodeMethodContents(bitFieldList, ordinal, indentSize));
- }
- sb.append(indent +
- typeMap.get(domainType).decodeExpression.replaceAll("#", fieldDomainPair[FIELD_NAME]) +
- "; /* " + fieldDomainPair[FIELD_NAME] + ": " + domainType + " */" + CR);
- }
- }
- if (bitFieldList.size() > 0) // Handle any remaining accumulated bit types
- {
- sb.append(generateBitDecodeMethodContents(bitFieldList, ordinal, indentSize));
- }
-
- return sb.toString();
- }
-
- protected String generateBitDecodeMethodContents(ArrayList<String> bitFieldList, int ordinal,
- int indentSize)
- {
- int numBytes = ((bitFieldList.size() - 1) / 8) + 1;
- String indent = Utils.createSpaces(indentSize);
- String bitArrayName = "flags_" + ordinal;
- StringBuffer sb = new StringBuffer(indent + "u_int8_t " + bitArrayName +
- "[" + numBytes + "];" + CR);
- for (int i = 0; i < numBytes; i++)
- {
- sb.append(indent + bitArrayName + "[" + i + "] = buffer.getOctet();" + CR);
- }
- for (int i = 0; i < bitFieldList.size(); i++)
- {
- int bitIndex = i % 8;
- int byteIndex = i / 8;
- sb.append(indent + bitFieldList.get(i) + " = (1 << " + bitIndex + ") & " +
- bitArrayName + "[" + byteIndex + "]; /* " + bitFieldList.get(i) +
- ": bit */" + CR);
- }
- bitFieldList.clear();
- return sb.toString();
- }
-
- protected String generateFieldList(AmqpFieldMap fieldMap, AmqpVersion version, boolean defineFlag,
- boolean initializerFlag, int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- AmqpOrdinalFieldMap ordinalFieldMap = fieldMap.getMapForVersion(version, true, this);
- Iterator<Integer> oItr = ordinalFieldMap.keySet().iterator();
- while (oItr.hasNext())
- {
- int ordinal = oItr.next();
- String[] fieldDomainPair = ordinalFieldMap.get(ordinal);
- sb.append(indent + (defineFlag ? setRef(fieldDomainPair[FIELD_CODE_TYPE]) + " " : "") +
- fieldDomainPair[FIELD_NAME] + (initializerFlag ? "(" + fieldDomainPair[FIELD_NAME] + ")" : "") +
- (oItr.hasNext() ? "," : "") + CR);
- }
- return sb.toString();
- }
-
- protected String generateMethodParameterList(AmqpOrdinalFieldMap fieldMap, int indentSize,
- boolean leadingCommaFlag, boolean fieldTypeFlag, boolean fieldNameFlag)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- boolean first = true;
- Iterator<Integer> pItr = fieldMap.keySet().iterator();
- while (pItr.hasNext())
- {
- String[] field = fieldMap.get(pItr.next());
- if (first && leadingCommaFlag)
- {
- sb.append("," + (fieldNameFlag ? CR : " "));
- }
- if (!first || leadingCommaFlag)
- {
- sb.append(indent);
- }
- sb.append(
- (fieldTypeFlag ? setRef(field[FIELD_CODE_TYPE]) : "") +
- (fieldNameFlag ? " " + field[FIELD_NAME] : "") +
- (pItr.hasNext() ? "," + (fieldNameFlag ? CR : " ") : ""));
- first = false;
- }
- return sb.toString();
- }
-
- protected String generateConstructor(AmqpClass thisClass, AmqpMethod method,
- AmqpVersion version, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- if (method.getFieldMap().size() > 0)
- {
- sb.append(indent + thisClass.getName() + Utils.firstUpper(method.getName()) + "Body(ProtocolVersion& version," + CR);
- sb.append(generateFieldList(method.getFieldMap(), version, true, false, 8));
- sb.append(indent + tab + ") :" + CR);
- sb.append(indent + tab + "AMQMethodBody(version)," + CR);
- sb.append(generateFieldList(method.getFieldMap(), version, false, true, 8));
- sb.append(indent + "{ }" + CR);
- }
- return sb.toString();
- }
-
- protected String generateServerOperationsInvoke(AmqpClass thisClass, AmqpMethod method,
- AmqpVersion version, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
-
- if (method.getServerMethodFlagMap().size() > 0) // At least one AMQP version defines this method as a server method
- {
- Iterator<Boolean> bItr = method.getServerMethodFlagMap().keySet().iterator();
- while (bItr.hasNext())
- {
- if (bItr.next()) // This is a server operation
- {
- boolean fieldMapNotEmptyFlag = method.getFieldMap().size() > 0;
- sb.append(indent + "inline void invoke(AMQP_ServerOperations& target, u_int16_t channel)" + CR);
- sb.append(indent + "{" + CR);
- sb.append(indent + tab + "target.get" + thisClass.getName() + "Handler()->" +
- parseForReservedWords(Utils.firstLower(method.getName()),
- thisClass.getName() + Utils.firstUpper(method.getName()) + "Body.invoke()") + "(channel");
- if (fieldMapNotEmptyFlag)
- {
- sb.append("," + CR);
- sb.append(generateFieldList(method.getFieldMap(), version, false, false, indentSize + 4 * tabSize));
- sb.append(indent + tab + tab + tab + tab);
- }
- sb.append(");" + CR);
- sb.append(indent + "}" + CR);
- }
- }
- }
- return sb.toString();
- }
-
- // Methods for generation of code snippets for amqp_methods.h/cpp files
-
- protected String generateMethodBodyIncludeList(AmqpModel model, int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- for (String thisClassName : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(thisClassName);
- for (String thisMethodName : thisClass.getMethodMap().keySet())
- {
- AmqpMethod method = thisClass.getMethodMap().get(thisMethodName);
- sb.append(indent + "#include \"" + thisClass.getName() + Utils.firstUpper(method.getName()) + "Body.h\"" + CR);
- }
- }
-
- return sb.toString();
- }
-
- protected String generateMethodBodyInstances(AmqpModel model, int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- for (String thisClassName : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(thisClassName);
- for (String thisMethodName : thisClass.getMethodMap().keySet())
- {
- AmqpMethod method = thisClass.getMethodMap().get(thisMethodName);
- sb.append(indent + "const " + thisClass.getName() + Utils.firstUpper(method.getName()) + "Body " +
- Utils.firstLower(thisClass.getName()) + "_" + method.getName() + ";" + CR);
- }
- }
-
- return sb.toString();
- }
-
- protected String generateMethodBodyMapEntry(AmqpModel model, int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- for (AmqpVersion version : getVersionSet())
- {
- for (String thisClassName : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(thisClassName);
- for (String thisMethodName : thisClass.getMethodMap().keySet())
- {
- AmqpMethod method = thisClass.getMethodMap().get(thisMethodName);
- String namespace = method.isVersionConsistent(getVersionSet()) ? "" : version.namespace() + "::";
- try
- {
- int classOrdinal = thisClass.getIndexMap().getOrdinal(version);
- int methodOrdinal = method.getIndexMap().getOrdinal(version);
- String methodModyClassName = namespace + thisClass.getName() + Utils.firstUpper(method.getName()) + "Body";
- sb.append(indent + "insert(std::make_pair(createMapKey(" + classOrdinal + ", " +
- methodOrdinal + ", " + version.getMajor() + ", " + version.getMinor() +
- "), &createMethodBodyFn<" + methodModyClassName + ">));" + CR);
- }
- catch (AmqpTypeMappingException e)
- {
- } // ignore
- }
- }
- }
-
- return sb.toString();
- }
-
- // Helper functions
-
- private String generateVersionCheck(AmqpVersion version)
- {
- return "version.equals(" + version.getMajor() + ", " + version.getMinor() + ")";
- }
-
- private String generateVersionCheck(AmqpVersionSet versionSet)
- {
- StringBuffer sb = new StringBuffer();
- for (AmqpVersion v : versionSet)
- {
- if (!v.equals(versionSet.first()))
- {
- sb.append(" || ");
- }
- if (versionSet.size() > 1)
- {
- sb.append("(");
- }
- sb.append("version.equals(" + v.getMajor() + ", " + v.getMinor() + ")");
- if (versionSet.size() > 1)
- {
- sb.append(")");
- }
- }
- return sb.toString();
- }
-
- private String parseForReservedWords(String name, String context)
- {
- for (String cppReservedWord : cppReservedWords)
- {
- if (name.compareTo(cppReservedWord) == 0)
- {
- if (!quietFlag)
- {
- System.out.println("WARNING: " + (context == null ? "" : context + ": ") +
- "Found XML method \"" + name + "\", which is a C++ reserved word. " +
- "Changing generated name to \"" + name + "_\".");
- }
- return name + "_";
- }
- }
-
- for (String cppCommonDefine : cppCommonDefines)
- {
- if (name.compareTo(cppCommonDefine) == 0)
- {
- if (!quietFlag)
- {
- System.out.println("WARNING: " + (context == null ? "" : context + ": ") +
- "Found XML method \"" + name + "\", which may clash with commonly used defines within C++. " +
- "Changing generated name to \"" + name + "_\".");
- }
- return name + "_";
- }
- }
-
- return name;
- }
-
- private String setRef(String codeType)
- {
- if (codeType.compareTo("string") == 0 ||
- codeType.compareTo("FieldTable") == 0)
- {
- return "const " + codeType + "&";
- }
- return codeType;
- }
-
- private String camelCaseName(String name, boolean upperFirstFlag)
- {
- StringBuffer ccn = new StringBuffer();
- String[] toks = name.split("[-_.\\ ]");
- for (int i = 0; i < toks.length; i++)
- {
- StringBuffer b = new StringBuffer(toks[i]);
- if (upperFirstFlag || i > 0)
- {
- b.setCharAt(0, Character.toUpperCase(toks[i].charAt(0)));
- }
- ccn.append(b);
- }
- return ccn.toString();
- }
-
- public static Factory<CppGenerator> _factoryInstance = new Factory<CppGenerator>()
- {
-
- public CppGenerator newInstance()
- {
- return new CppGenerator();
- }
- };
-
- public static Factory<CppGenerator> getFactory()
- {
- return _factoryInstance;
- }
-
- void processModelTemplate(NamedTemplate template, AmqpVersion version)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
- public String getNativeType(String type)
- {
- throw new UnsupportedOperationException();
- }
-
- public String getEncodingType(String type)
- {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/DotnetGenerator.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/DotnetGenerator.java
deleted file mode 100644
index 9fc81dd428..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/DotnetGenerator.java
+++ /dev/null
@@ -1,382 +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.
- *
- */
-
-package org.apache.qpid.gentools;
-
-import java.io.File;
-import java.util.TreeMap;
-
-public class DotnetGenerator extends Generator
-{
- private class DomainInfo
- {
- public String type;
- public String size;
- public String encodeExpression;
- public String decodeExpression;
-
- public DomainInfo(String domain, String size, String encodeExpression, String decodeExpression)
- {
- this.type = domain;
- this.size = size;
- this.encodeExpression = encodeExpression;
- this.decodeExpression = decodeExpression;
- }
- }
-
- private static TreeMap<String, DomainInfo> typeMap = new TreeMap<String, DomainInfo>();
-
- public String getNativeType(String type)
- {
- throw new UnsupportedOperationException();
- }
-
- public String getEncodingType(String type)
- {
- throw new UnsupportedOperationException();
- }
-
- public DotnetGenerator()
- {
- super();
- // Load .NET type and size maps.
- // Adjust or add to these lists as new types are added/defined.
- // The char '#' will be replaced by the field variable name (any type).
- // The char '~' will be replaced by the compacted bit array size (type bit only).
- // TODO: I have left a copy of the Java typeMap here - replace with appropriate .NET values.
- typeMap.put("bit", new DomainInfo(
- "boolean", // .NET code type
- "~", // size
- "EncodingUtils.writeBooleans(buffer, #)", // encode expression
- "# = EncodingUtils.readBooleans(buffer)")); // decode expression
- typeMap.put("content", new DomainInfo(
- "Content", // .NET code type
- "EncodingUtils.encodedContentLength(#)", // size
- "EncodingUtils.writeContentBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readContent(buffer)")); // decode expression
- typeMap.put("long", new DomainInfo(
- "long", // .NET code type
- "4", // size
- "EncodingUtils.writeUnsignedInteger(buffer, #)", // encode expression
- "# = buffer.getUnsignedInt()")); // decode expression
- typeMap.put("longlong", new DomainInfo(
- "long", // .NET code type
- "8", // size
- "buffer.putLong(#)", // encode expression
- "# = buffer.getLong()")); // decode expression
- typeMap.put("longstr", new DomainInfo(
- "byte[]", // .NET code type
- "EncodingUtils.encodedLongstrLength(#)", // size
- "EncodingUtils.writeLongStringBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readLongstr(buffer)")); // decode expression
- typeMap.put("octet", new DomainInfo(
- "short", // .NET code type
- "1", // size
- "EncodingUtils.writeUnsignedByte(buffer, #)", // encode expression
- "# = buffer.getUnsigned()")); // decode expression
- typeMap.put("short", new DomainInfo(
- "int", // .NET code type
- "2", // size
- "EncodingUtils.writeUnsignedShort(buffer, #)", // encode expression
- "# = buffer.getUnsignedShort()")); // decode expression
- typeMap.put("shortstr", new DomainInfo(
- "AMQShortString", // .NET code type
- "EncodingUtils.encodedShortStringLength(#)", // size
- "EncodingUtils.writeShortStringBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readAMQShortString(buffer)")); // decode expression
- typeMap.put("table", new DomainInfo(
- "FieldTable", // .NET code type
- "EncodingUtils.encodedFieldTableLength(#)", // size
- "EncodingUtils.writeFieldTableBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readFieldTable(buffer)")); // decode expression
- typeMap.put("timestamp", new DomainInfo(
- "long", // .NET code type
- "8", // size
- "EncodingUtils.writeTimestamp(buffer, #)", // encode expression
- "# = EncodingUtils.readTimestamp(buffer)")); // decode expression
- }
-
- void processModelTemplate(NamedTemplate template, AmqpVersion version)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- void processClassTemplate(NamedTemplate template, AmqpClass amqpClass, AmqpVersion version)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- void processMethodTemplate(NamedTemplate template, AmqpClass amqpClass, AmqpMethod amqpMethod, AmqpVersion version)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- void processFieldTemplate(NamedTemplate template, AmqpClass amqpClass, AmqpMethod amqpMethod, AmqpField amqpField, AmqpVersion version)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- @Override
- protected String prepareFilename(String filenameTemplate,
- AmqpClass thisClass, AmqpMethod method, AmqpField field, AmqpVersion version)
- {
- StringBuffer sb = new StringBuffer(filenameTemplate);
- if (thisClass != null)
- {
- replaceToken(sb, "${CLASS}", thisClass.getName());
- }
- if (method != null)
- {
- replaceToken(sb, "${METHOD}", method.getName());
- }
- if (field != null)
- {
- replaceToken(sb, "${FIELD}", field.getName());
- }
- return sb.toString();
- }
-
- @Override
- protected void processClassList(StringBuffer sb, int listMarkerStartIndex,
- int listMarkerEndIndex, AmqpModel model, AmqpVersion version)
- throws AmqpTemplateException, AmqpTypeMappingException
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokStart = tline.indexOf('$');
- String token = tline.substring(tokStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- // TODO: Add in tokens and calls to their corresponding generator methods here...
- if (token.compareTo("${??????????}") == 0)
- {
- codeSnippet = token; // This is a stub to get the compile working - remove when gen method is present.
-// codeSnippet = generateRegistry(model, 8, 4);
- }
-
- else // Oops!
- {
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- @Override
- protected void processConstantList(StringBuffer sb,
- int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpConstantSet constantSet) throws AmqpTemplateException,
- AmqpTypeMappingException
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokStart = tline.indexOf('$');
- String token = tline.substring(tokStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- // TODO: Add in tokens and calls to their corresponding generator methods here...
- if (token.compareTo("${??????????}") == 0)
- {
- codeSnippet = token; // This is a stub to get the compile working - remove when gen method is present.
-// codeSnippet = generateConstantGetMethods(constantSet, 4, 4);
- }
-
- else // Oops!
- {
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- @Override
- protected void processFieldList(StringBuffer sb, int listMarkerStartIndex,
- int listMarkerEndIndex, AmqpFieldMap fieldMap, AmqpVersion version)
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokStart = tline.indexOf('$');
- String token = tline.substring(tokStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- // TODO: Add in tokens and calls to their corresponding generator methods here...
- if (token.compareTo("${??????????}") == 0)
- {
- codeSnippet = token; // This is a stub to get the compile working - remove when gen method is present.
-// codeSnippet = fieldMap.parseFieldMap(declarationGenerateMethod,
-// mangledDeclarationGenerateMethod, 4, 4, this);
- }
-
- else // Oops!
- {
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- @Override
- protected void processMethodList(StringBuffer sb, int listMarkerStartIndex,
- int listMarkerEndIndex, AmqpClass thisClass)
- throws AmqpTemplateException, AmqpTypeMappingException
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokStart = tline.indexOf('$');
- String token = tline.substring(tokStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- // TODO: Add in tokens and calls to their corresponding generator methods here...
- if (token.compareTo("${??????????}") == 0)
- {
- codeSnippet = token; // This is a stub to get the compile working - remove when gen method is present.
- }
-
- else // Oops!
- {
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- @Override
- protected void processModelTemplate(NamedTemplate template)
- {
- // I've put in the Java model here - this can be changed if a different pattern is required.
- processTemplate(template, null, null, null, null);
- }
-
- @Override
- protected void processClassTemplate(NamedTemplate template, AmqpClass thisClass)
- {
- // I've put in the Java model here - this can be changed if a different pattern is required.
- processTemplate(template, thisClass, null, null, null);
- }
-
- @Override
- protected void processMethodTemplate(NamedTemplate template, AmqpClass thisClass,
- AmqpMethod method)
- {
- // I've put in the Java model here - this can be changed if a different pattern is required.
- processTemplate(template, thisClass, method, null, null);
- }
-
- @Override
- protected void processTemplate(NamedTemplate template, AmqpClass thisClass,
- AmqpMethod method, AmqpField field, AmqpVersion version)
- {
- // I've put in the Java model here - this can be changed if a different pattern is required.
- StringBuffer sb = new StringBuffer(template.getTemplate());
- String filename = prepareFilename(getTemplateFileName(sb), thisClass, method, field, version);
- try
- {
- processAllLists(sb, thisClass, method, null);
- }
- catch (AmqpTemplateException e)
- {
- System.out.println("WARNING: " + template.getName() + ": " + e.getMessage());
- }
- try
- {
- processAllTokens(sb, thisClass, method, field, null);
- }
- catch (AmqpTemplateException e)
- {
- System.out.println("WARNING: " + template.getName() + ": " + e.getMessage());
- }
- writeTargetFile(sb, new File(getOutputDirectory() + Utils.FILE_SEPARATOR + filename));
- generatedFileCounter++;
- }
-
- @Override
- protected String processToken(String token, AmqpClass thisClass,
- AmqpMethod method, AmqpField field, AmqpVersion version)
- throws AmqpTemplateException, AmqpTypeMappingException
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getGeneratedType(String domainName, AmqpVersion version)
- throws AmqpTypeMappingException
- {
- String domainType = getDomainType(domainName, version);
- if (domainType == null)
- {
- throw new AmqpTypeMappingException("Domain type \"" + domainName +
- "\" not found in Java typemap.");
- }
- DomainInfo info = typeMap.get(domainType);
- if (info == null)
- {
- throw new AmqpTypeMappingException("Unknown domain: \"" + domainType + "\"");
- }
- return info.type;
- }
-
- public String prepareClassName(String className)
- {
- return camelCaseName(className, true);
- }
-
- public String prepareDomainName(String domainName)
- {
- return camelCaseName(domainName, false);
- }
-
- public String prepareMethodName(String methodName)
- {
- return camelCaseName(methodName, false);
- }
-
- private String camelCaseName(String name, boolean upperFirstFlag)
- {
- StringBuffer ccn = new StringBuffer();
- String[] toks = name.split("[-_.\\ ]");
- for (int i = 0; i < toks.length; i++)
- {
- StringBuffer b = new StringBuffer(toks[i]);
- if (upperFirstFlag || i > 0)
- {
- b.setCharAt(0, Character.toUpperCase(toks[i].charAt(0)));
- }
- ccn.append(b);
- }
- return ccn.toString();
- }
-
-
- public static Factory<DotnetGenerator> _factoryInstance = new Factory<DotnetGenerator>()
- {
-
- public DotnetGenerator newInstance()
- {
- return new DotnetGenerator();
- }
- };
-
- public static Factory<DotnetGenerator> getFactory()
- {
- return _factoryInstance;
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/GenerateMethod.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/GenerateMethod.java
deleted file mode 100644
index 8b0bb99b41..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/GenerateMethod.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-
-public interface GenerateMethod
-{
- String generate(String domainType, String fieldName, int ordinal, int indentSize, int tabSize);
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Generator.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Generator.java
deleted file mode 100644
index 5d6e7be527..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Generator.java
+++ /dev/null
@@ -1,857 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.Velocity;
-import org.w3c.dom.Node;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.LineNumberReader;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EnumMap;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
-
-public abstract class Generator implements LanguageConverter
-{
- protected static String CR = Utils.LINE_SEPARATOR;
-
-
- private static final Map<String, Integer> FIXED_SIZE_TYPES = new HashMap<String, Integer>();
-
- static
- {
- FIXED_SIZE_TYPES.put("bit", 1);
- FIXED_SIZE_TYPES.put("bitfield", 1);
- FIXED_SIZE_TYPES.put("long", 4);
- FIXED_SIZE_TYPES.put("longlong", 8);
- FIXED_SIZE_TYPES.put("octet", 1);
- FIXED_SIZE_TYPES.put("short", 2);
- FIXED_SIZE_TYPES.put("timestamp", 8);
-
- }
-
- private String _templateDirectory;
- private String _outputDirectory;
-
- public AmqpDomainMap getDomainMap()
- {
- return _domainMap;
- }
-
- public AmqpConstantSet getConstantSet()
- {
- return _constantSet;
- }
-
- public AmqpModel getModel()
- {
- return _model;
- }
-
- abstract public String getNativeType(String type);
-
- abstract public String getEncodingType(String type);
-
-
-
- protected static enum EnumConstOutputTypes
- {
- OUTPUT_STRING,
- OUTPUT_INTEGER,
- OUTPUT_DOUBLE;
- }
-
- ;
-
- public static enum TemplateType
- {
- model("model"),
- clazz("class"),
- method("method"),
- field("field");
-
- private final String _name;
-
- private TemplateType(String name)
- {
- _name = name;
- }
-
- public String getName()
- {
- return _name;
- }
- }
-
- ;
-
-
- public static interface Factory<X extends Generator>
- {
- public X newInstance();
- }
-
-
- protected static final class NamedTemplate
- {
- private final String _name;
- private final String _template;
- private final File _file;
-
-
- public NamedTemplate(String relativePath, File templateFile)
- {
- _file = templateFile;
- _name = relativePath + Utils.FILE_SEPARATOR + templateFile.getName();
-
- _template = loadTemplate(templateFile);
- }
-
-
- public String getName()
- {
- return _name;
- }
-
- public String getTemplate()
- {
- return _template;
- }
-
-
- public File getFile()
- {
- return _file;
- }
-
- }
-
-
- private static final String VELOCITY_TEMPLATE_SUFFIX = ".vm";
- private static final String STANDARD_TEMPLATE_SUFFIX = ".tmpl";
- private static FilenameFilter _tmplFileFilter = new FilenameFilter()
- {
-
- public boolean accept(File dir, String name)
- {
- return name.endsWith(STANDARD_TEMPLATE_SUFFIX) || name.endsWith(VELOCITY_TEMPLATE_SUFFIX);
- }
- };
-
-
- // This string is reproduced in every generated file as a comment
- // TODO: Tie the version info into the build system.
- protected static final String GENERATOR_INFO = "Qpid Gentools v.0.1";
-
-
- private final Map<TemplateType, Collection<NamedTemplate>> _templates =
- new EnumMap<TemplateType, Collection<NamedTemplate>>(TemplateType.class);
-
- private final Map<TemplateType, Collection<NamedTemplate>> _versionSpecificTemplates =
- new EnumMap<TemplateType, Collection<NamedTemplate>>(TemplateType.class);
-
-
- private final AmqpVersionSet _versionSet;
-
- private final AmqpDomainMap _domainMap;
- private final Map<AmqpVersion, AmqpDomainMap> _versionToDomainMapMap = new HashMap<AmqpVersion, AmqpDomainMap>();
-
- private final AmqpConstantSet _constantSet;
- private final Map<AmqpVersion, AmqpConstantSet> _versionToConstantSetMap = new HashMap<AmqpVersion, AmqpConstantSet>();
-
-
- public AmqpVersionSet getVersionSet()
- {
- return _versionSet;
- }
-
- private final AmqpModel _model;
- private final Map<AmqpVersion, AmqpModel> _versionToModelMap = new HashMap<AmqpVersion, AmqpModel>();
-
- protected int generatedFileCounter;
-
- public Generator()
- {
- _versionSet = new AmqpVersionSet();
- _model = new AmqpModel(this);
- _constantSet = new AmqpConstantSet(this);
- _domainMap = new AmqpDomainMap(this);
-
- generatedFileCounter = 0;
- }
-
-// public final AmqpVersionSet getVersionSet()
-// {
-// return _versionSet;
-// }
-
-
- public void addVersion(AmqpVersion version)
- {
- _versionSet.add(version);
- if (!_versionToModelMap.containsKey(version))
- {
- _versionToModelMap.put(version, new AmqpModel(this));
- }
- if (!_versionToDomainMapMap.containsKey(version))
- {
- _versionToDomainMapMap.put(version, new AmqpDomainMap(this));
- }
- if (!_versionToConstantSetMap.containsKey(version))
- {
- _versionToConstantSetMap.put(version, new AmqpConstantSet(this));
- }
- }
-
- public int getNumberGeneratedFiles()
- {
- return generatedFileCounter;
- }
-
-// public AmqpDomainMap getDomainMap()
-// {
-// return _domainMap;
-// }
-//
-// public AmqpConstantSet getConstantSet()
-// {
-// return _constantSet;
-// }
-//
-//
-// public AmqpModel getModel()
-// {
-// return _model;
-// }
-
- public void initializeTemplates() throws IOException
- {
-
- for (TemplateType type : EnumSet.allOf(TemplateType.class))
- {
- ArrayList<NamedTemplate> typeTemplates = new ArrayList<NamedTemplate>();
- _templates.put(type, typeTemplates);
- ArrayList<NamedTemplate> versionSpecificTypeTemplates = new ArrayList<NamedTemplate>();
- _versionSpecificTemplates.put(type, versionSpecificTypeTemplates);
-
- File templateDirectory = new File(getTemplateDirectory() + Utils.FILE_SEPARATOR + type.getName());
- File versionTemplateDirectory = new File(getTemplateDirectory() + Utils.FILE_SEPARATOR + type.getName() + Utils.FILE_SEPARATOR + "version");
-
- System.out.println("Looking for template files in directory: " + templateDirectory.getAbsoluteFile());
-
- File[] templateFiles = templateDirectory.listFiles(_tmplFileFilter);
-
- File[] versionTemplateFiles = new File[0];
-
- System.out.println("Looking for version specific template files in directory: " + versionTemplateDirectory.getAbsoluteFile());
-
- if (versionTemplateDirectory.exists())
- {
- versionTemplateFiles = versionTemplateDirectory.listFiles(_tmplFileFilter);
- }
-
- if(templateFiles != null)
- {
- for (File templateFile : templateFiles)
- {
- System.out.println(type.getName() + " template file(s):");
- System.out.println(" " + templateFile.getCanonicalPath());
- typeTemplates.add(new NamedTemplate(type.getName(), templateFile));
- }
- }
-
- if(versionTemplateFiles != null)
- {
- for (File versionTemplateFile : versionTemplateFiles)
- {
- System.out.println(type.getName() + " template file(s):");
- System.out.println(" " + versionTemplateFile.getCanonicalPath());
- versionSpecificTypeTemplates.add(new NamedTemplate(type.getName() + Utils.FILE_SEPARATOR + "version", versionTemplateFile));
- }
- }
-
- }
- }
-
- public String getTemplateDirectory()
- {
- return _templateDirectory;
- }
-
-
- public void setTemplateDirectory(String templateDirectory)
- {
- _templateDirectory = templateDirectory;
- }
-
-
- public void setOutputDirectory(String outputDirectory)
- {
- _outputDirectory = outputDirectory;
- }
-
- public void generate()
- {
- prepareTargetDirectory(new File(_outputDirectory), true);
- System.out.println("Generation directory: " + _outputDirectory);
-
-
- processModelTemplates(_templates);
-
- for (AmqpClass amqpClass : _model.getClassMap().values())
- {
- processClassTemplates(_templates, amqpClass);
-
- for (AmqpMethod amqpMethod : amqpClass.getMethodMap().values())
- {
- processMethodTemplates(_templates, amqpClass, amqpMethod);
-
- for (AmqpField amqpField : amqpMethod.getFieldMap().values())
- {
- processFieldTemplates(_templates, amqpClass, amqpMethod, amqpField, null);
- }
- }
- }
-
-
- for (AmqpVersion version : _versionSet)
- {
- AmqpModel model = _versionToModelMap.get(version);
- processModelTemplates(_versionSpecificTemplates, version);
-
- for (AmqpClass amqpClass : model.getClassMap().values())
- {
- processClassTemplates(_versionSpecificTemplates, amqpClass, version);
-
- for (AmqpMethod amqpMethod : amqpClass.getMethodMap().values())
- {
- processMethodTemplates(_versionSpecificTemplates, amqpClass, amqpMethod, version);
-
- for (AmqpField amqpField : amqpMethod.getFieldMap().values())
- {
- processFieldTemplates(_versionSpecificTemplates, amqpClass, amqpMethod, amqpField, version);
- }
- }
- }
-
- }
- }
-
- private void processMethodTemplates(Map<TemplateType, Collection<NamedTemplate>> templates, AmqpClass amqpClass, AmqpMethod amqpMethod, AmqpVersion version)
- {
- for (NamedTemplate template : templates.get(TemplateType.method))
- {
- if(isVelocityTemplate(template))
- {
- processVelocityTemplate(template,version,amqpClass,amqpMethod,null);
- }
- else
- {
- processMethodTemplate(template, amqpClass, amqpMethod);
- }
- }
-
- }
-
- private void processClassTemplates(Map<TemplateType, Collection<NamedTemplate>> templates, AmqpClass amqpClass, AmqpVersion version)
- {
- for (NamedTemplate template : templates.get(TemplateType.clazz))
- {
- if(isVelocityTemplate(template))
- {
- processVelocityTemplate(template,version,amqpClass,null,null);
- }
- else
- {
- processClassTemplate(template, amqpClass);
- }
- }
-
- }
-
-
- private void processModelTemplates(Map<TemplateType, Collection<NamedTemplate>> templates, AmqpVersion version)
- {
- for (NamedTemplate template : templates.get(TemplateType.model))
- {
- if (isVelocityTemplate(template))
- {
- processModelVelocityTemplate(template, version);
- }
- else
- {
- processModelTemplate(template, version);
- }
- }
- }
-
- abstract void processModelTemplate(NamedTemplate template, AmqpVersion version);
-
-
- protected void processModelTemplates(Map<TemplateType, Collection<NamedTemplate>> templates)
- {
- for (NamedTemplate template : templates.get(TemplateType.model))
- {
- if (isVelocityTemplate(template))
- {
- processModelVelocityTemplate(template, null);
- }
- else
- {
- processModelTemplate(template);
- }
- }
- }
-
- private boolean isVelocityTemplate(NamedTemplate template)
- {
- return template.getName().endsWith(VELOCITY_TEMPLATE_SUFFIX);
- }
-
- private void processModelVelocityTemplate(NamedTemplate template, AmqpVersion version)
- {
- processVelocityTemplate(template,version,null,null,null);
- }
-
- private void processVelocityTemplate(NamedTemplate template, AmqpVersion version,
- AmqpClass amqpClass, AmqpMethod amqpMethod, AmqpField amqpField)
- {
-
- VelocityContext context = new VelocityContext();
-
- AmqpModel model = _model;
- if(version != null)
- {
- model = _versionToModelMap.get(version);
- }
- context.put("model", model);
- context.put("generator", GENERATOR_INFO);
-
- if (version != null)
- {
- context.put("version", version);
- }
- if(amqpClass != null)
- {
- context.put("amqpClass", amqpClass);
- }
-
- if(amqpClass != null)
- {
- context.put("amqpMethod", amqpMethod);
- }
-
-
- StringWriter sw = new StringWriter();
-
-
- try
- {
- Template velocityTemplate = Velocity.getTemplate(template.getName());
- velocityTemplate.merge(context, sw);
- String filename = String.valueOf(context.get("filename"));
-
- File outputFile = new File(getOutputDirectory() + Utils.FILE_SEPARATOR + filename);
- outputFile.getParentFile().mkdirs();
- FileWriter outputFileWriter = new FileWriter(outputFile);
-
- outputFileWriter.append(sw.toString());
- outputFileWriter.close();
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
-
- }
-
-
- protected void processClassTemplates(Map<TemplateType, Collection<NamedTemplate>> templates, AmqpClass amqpClass)
- {
- for (NamedTemplate template : templates.get(TemplateType.clazz))
- {
- if(isVelocityTemplate(template))
- {
- processVelocityTemplate(template,null,amqpClass,null,null);
- }
- else
- {
- processClassTemplate(template, amqpClass);
- }
- }
- }
-
- protected void processMethodTemplates(Map<TemplateType, Collection<NamedTemplate>> templates, AmqpClass amqpClass, AmqpMethod amqpMethod)
- {
- for (NamedTemplate template : templates.get(TemplateType.method))
- {
- if(isVelocityTemplate(template))
- {
- processVelocityTemplate(template,null,amqpClass,amqpMethod,null);
- }
- else
- {
- processMethodTemplate(template, amqpClass, amqpMethod);
- }
- }
- }
-
-
- protected void processFieldTemplates(Map<TemplateType, Collection<NamedTemplate>> templates, AmqpClass amqpClass, AmqpMethod amqpMethod, AmqpField amqpField, AmqpVersion amqpVersion)
- {
- for (NamedTemplate template : templates.get(TemplateType.field))
- {
- if(isVelocityTemplate(template))
- {
- processVelocityTemplate(template,amqpVersion,amqpClass,amqpMethod,amqpField);
- }
- else
- {
- processTemplate(template, amqpClass, amqpMethod, amqpField, amqpVersion);
- }
- }
- }
-
-
- protected void processVersionList(StringBuffer sb, int tokStart, int tokEnd)
- {
- int lend = sb.indexOf(Utils.LINE_SEPARATOR, tokStart) + 1; // Include cr at end of line
- String tline = sb.substring(tokEnd, lend); // Line excluding line marker, including cr
- sb.delete(tokStart, lend);
-
- for (AmqpVersion v : _versionSet)
- {
- // Insert copy of target line
- StringBuffer isb = new StringBuffer(tline);
- if (isb.indexOf("${protocol-version-list-entry}") >= 0)
- {
- String versionListEntry = " { ${major}, ${minor} }" +
- (v.equals(_versionSet.last()) ? "" : ",");
- replaceToken(isb, "${protocol-version-list-entry}", String.valueOf(versionListEntry));
- }
- if (isb.indexOf("${major}") >= 0)
- {
- replaceToken(isb, "${major}", String.valueOf(v.getMajor()));
- }
- if (isb.indexOf("${minor}") >= 0)
- {
- replaceToken(isb, "${minor}", String.valueOf(v.getMinor()));
- }
- sb.insert(tokStart, isb.toString());
- tokStart += isb.length();
- }
- }
-
- // Helper functions common to all generators
-
- protected static void prepareTargetDirectory(File dir, boolean createFlag)
- {
- if (dir.exists())
- {
- if (!dir.isDirectory())
- {
- throw new TargetDirectoryException("\"" + dir.getAbsolutePath() +
- "\" exists, but is not a directory.");
- }
- }
- else if (createFlag) // Create dir
- {
- if (!dir.mkdirs())
- {
- throw new TargetDirectoryException("Unable to create directory \"" +
- dir.getAbsolutePath() + "\".");
- }
- }
- else
- {
- throw new TargetDirectoryException("Directory \"" + dir.getAbsolutePath() +
- "\" not found.");
- }
-
- }
-
- protected void processAllLists(StringBuffer sb, AmqpClass thisClass, AmqpMethod method, AmqpVersion version)
- {
- AmqpModel model = (version == null) ? _model : _versionToModelMap.get(version);
-
-
- int lstart = sb.indexOf("%{");
- while (lstart != -1)
- {
- int lend = sb.indexOf("}", lstart + 2);
- if (lend > 0)
- {
- String listToken = sb.substring(lstart + 2, lend);
- if (listToken.compareTo("VLIST") == 0)
- {
- processVersionList(sb, lstart, lend + 1);
- }
- else if (listToken.compareTo("CLIST") == 0)
- {
- processClassList(sb, lstart, lend + 1, model, version);
- }
- else if (listToken.compareTo("MLIST") == 0)
- {
- processMethodList(sb, lstart, lend + 1, thisClass);
- }
- else if (listToken.compareTo("FLIST") == 0)
- {
- // Pass the FieldMap from either a class or a method.
- // If this is called from a class-level template, we assume that the
- // class field list is required. In this case, method will be null.
- processFieldList(sb, lstart, lend + 1,
- (method == null ? thisClass.getFieldMap() : method.getFieldMap()),
- version);
- }
- else if (listToken.compareTo("TLIST") == 0)
- {
- processConstantList(sb, lstart, lend + 1, _constantSet);
- }
- else
- {
- throw new AmqpTemplateException("Unknown list token \"%{" + listToken +
- "}\" found in template at index " + lstart + ".");
- }
- }
- lstart = sb.indexOf("%{", lstart + 1);
- }
- }
-
- protected void processAllTokens(StringBuffer sb, AmqpClass thisClass, AmqpMethod method, AmqpField field,
- AmqpVersion version)
- {
- int lstart = sb.indexOf("${");
- while (lstart != -1)
- {
- int lend = sb.indexOf("}", lstart + 2);
- if (lend > 0)
- {
- String token = sb.substring(lstart, lend + 1);
- replaceToken(sb, lstart, token, processToken(token, thisClass, method, field, version));
- }
- lstart = sb.indexOf("${", lstart);
- }
- }
-
- protected static void writeTargetFile(StringBuffer sb, File f)
- {
- try
- {
- f.getParentFile().mkdirs();
- FileWriter fw = new FileWriter(f);
- fw.write(sb.toString().toCharArray());
- fw.flush();
- fw.close();
- }
- catch (IOException e)
- {
- throw new AmqpTemplateException(e.getMessage());
- }
- }
-
-
- protected static String getTemplateFileName(StringBuffer sb)
- {
- if (sb.charAt(0) != '&')
- {
- throw new AmqpTemplateException("No filename marker &{filename} found at start of template.");
- }
- int cr = sb.indexOf(Utils.LINE_SEPARATOR);
- if (cr < 0)
- {
- throw new AmqpTemplateException("Bad template structure - unable to find first line.");
- }
- String fileName = sb.substring(2, cr - 1);
- sb.delete(0, cr + 1);
- return fileName;
- }
-
- protected static void replaceToken(StringBuffer sb, String token, String replacement)
- {
- replaceToken(sb, 0, token, replacement);
- }
-
- protected static void replaceToken(StringBuffer sb, int index, String token, String replacement)
- {
- if (replacement != null)
- {
- int start = sb.indexOf(token, index);
- if (start != -1)
- {
- int len = token.length();
- // Find first letter in token and determine if it is capitalized
- char firstTokenLetter = getFirstLetter(token);
- if (firstTokenLetter != 0 && Character.isUpperCase(firstTokenLetter))
- {
- sb.replace(start, start + len, Utils.firstUpper(replacement));
- }
- else
- {
- sb.replace(start, start + len, replacement);
- }
- }
- }
- }
-
- private static char getFirstLetter(String str)
- {
- int len = str.length();
- int index = 0;
- char tokChar = str.charAt(index);
- while (!Character.isLetter(tokChar) && index < len - 1)
- {
- tokChar = str.charAt(++index);
- }
- if (Character.isLetter(tokChar))
- {
- return tokChar;
- }
- return 0;
- }
-
- private static String loadTemplate(File f)
- {
- try
- {
- StringBuffer sb = new StringBuffer();
- FileReader fr = new FileReader(f);
- LineNumberReader lnr = new LineNumberReader(fr);
- String line = lnr.readLine();
- while (line != null)
- {
-
- sb.append(line);
- sb.append(Utils.LINE_SEPARATOR);
-
- line = lnr.readLine();
- }
- lnr.close();
- fr.close();
- return sb.toString();
- }
- catch (FileNotFoundException e)
- {
- throw new AmqpTemplateException("File not found: " + e.getMessage());
- }
- catch (IOException e)
- {
- throw new AmqpTemplateException("IOException: " + e.getMessage());
- }
- }
-
- public String getDomainType(String domainName, AmqpVersion version)
- {
- if (version == null)
- {
- version = _versionSet.first();
- }
- return getDomainMap().getDomainType(domainName, version);
- }
-
-
- public void addFromNode(Node amqpNode, AmqpVersion version)
- {
- // 1c. Extract domains
- getConstantSet().addFromNode(amqpNode, 0, version);
- _versionToConstantSetMap.get(version).addFromNode(amqpNode, 0, version);
-
- // 1d. Extract domains
- getDomainMap().addFromNode(amqpNode, 0, version);
- _versionToDomainMapMap.get(version).addFromNode(amqpNode, 0, version);
-
- // 1e. Extract class/method/field heirarchy
- getModel().addFromNode(amqpNode, 0, version);
- _versionToModelMap.get(version).addFromNode(amqpNode, 0, version);
- }
-
-
- public String getOutputDirectory()
- {
- return _outputDirectory;
- }
-
- public String prepareConstantName(String constantName)
- {
- return prepareDomainName(constantName);
- }
-
-
- public boolean isFixedSizeType(String type)
- {
- return FIXED_SIZE_TYPES.containsKey(type);
- }
-
-
- public int getTypeSize(String type)
- {
- return FIXED_SIZE_TYPES.get(type);
- }
-
-
-
- // Model-level template processing
- abstract protected void processModelTemplate(NamedTemplate template);
-
- // Class-level template processing
- abstract protected void processClassTemplate(NamedTemplate template, AmqpClass thisClass);
-
- // Method-level template processing
- abstract protected void processMethodTemplate(NamedTemplate template, AmqpClass thisClass,
- AmqpMethod method);
-
- // Field-level template processing
- abstract protected void processTemplate(NamedTemplate template, AmqpClass thisClass,
- AmqpMethod method, AmqpField field, AmqpVersion version);
-
- abstract protected String prepareFilename(String filenameTemplate, AmqpClass thisClass, AmqpMethod method,
- AmqpField field, AmqpVersion version);
-
- abstract protected String processToken(String token, AmqpClass thisClass, AmqpMethod method,
- AmqpField field, AmqpVersion version);
-
- abstract protected void processClassList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpModel model, AmqpVersion version);
-
- abstract protected void processMethodList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpClass thisClass);
-
-
- abstract protected void processFieldList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpFieldMap fieldMap, AmqpVersion version);
-
- abstract protected void processConstantList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpConstantSet constantSet);
-
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/JavaGenerator.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
deleted file mode 100644
index 7730fca1bd..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
+++ /dev/null
@@ -1,1826 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-import java.util.TreeMap;
-
-public class JavaGenerator extends Generator
-{
- // TODO: Move this to parent class
- protected static final int FIELD_NAME = 0;
- protected static final int FIELD_CODE_TYPE = 1;
-
- private class DomainInfo
- {
- final public String type;
- final public String size;
- final public String encodingType;
- final public String encodeExpression;
- final public String decodeExpression;
-
- public DomainInfo(String domain, String size, String encodingType, String encodeExpression, String decodeExpression)
- {
- this.type = domain;
- this.size = size;
- this.encodeExpression = encodeExpression;
- this.decodeExpression = decodeExpression;
- this.encodingType = encodingType;
- }
- }
-
- private static TreeMap<String, DomainInfo> typeMap = new TreeMap<String, DomainInfo>();
-
- // Methods used for generation of code snippets called from the field map parsers
-
- // Common methods
- private final CommandGenerateMethod declarationGenerateMethod = new CommandGenerateMethod()
- {
- public String generate(String codeType, AmqpField field, AmqpVersionSet versionSet, int indentSize, int tabSize, boolean notLast)
- {
- return generateFieldDeclaration(codeType, field, versionSet, indentSize, tabSize, notLast);
- }
- };
-
- private MangledGenerateMethod mangledDeclarationGenerateMethod = new MangledGenerateMethod()
- {
- public String generate(AmqpField field, int indentSize, int tabSize, boolean notLast)
- {
- return generateMangledFieldDeclaration(field, indentSize, tabSize, notLast);
- }
- };
-
- // Methods for MessageBody classes
- private CommandGenerateMethod mbGetGenerateMethod = new CommandGenerateMethod()
- {
- public String generate(String codeType, AmqpField field, AmqpVersionSet versionSet, int indentSize, int tabSize, boolean notLast)
- {
- return generateMbGetMethod(codeType, field, versionSet, indentSize, tabSize, notLast); //To change body of implemented methods use File | Settings | File Templates.
- }
- };
-
- private MangledGenerateMethod mbMangledGetGenerateMethod = new MangledGenerateMethod()
- {
- public String generate(AmqpField field, int indentSize, int tabSize, boolean notLast)
- {
- return generateMbMangledGetMethod(field, indentSize, tabSize, notLast);
- }
- };
- private CommandGenerateMethod mbParamListGenerateMethod = new CommandGenerateMethod()
- {
- public String generate(String codeType, AmqpField field, AmqpVersionSet versionSet, int indentSize, int tabSize, boolean notLast)
- {
- return generateMbParamList(codeType, field, versionSet, indentSize, tabSize, notLast);
- }
- };
- private CommandGenerateMethod mbPassedParamListGenerateMethod = new CommandGenerateMethod()
- {
- public String generate(String codeType, AmqpField field, AmqpVersionSet versionSet, int indentSize, int tabSize, boolean notLast)
- {
- return generateMbPassedParamList(codeType, field, versionSet, indentSize, tabSize, notLast);
- }
- };
- private MangledGenerateMethod mbMangledParamListGenerateMethod = new MangledGenerateMethod()
- {
- public String generate(AmqpField field, int indentSize, int tabSize, boolean notLast)
- {
- return generateMbMangledParamList(field, indentSize, tabSize, notLast);
- }
- };
- private MangledGenerateMethod mbMangledPassedParamListGenerateMethod = new MangledGenerateMethod()
- {
- public String generate(AmqpField field, int indentSize, int tabSize, boolean notLast)
- {
- return generateMbMangledPassedParamList(field, indentSize, tabSize, notLast);
- }
- };
- private CommandGenerateMethod mbBodyInitGenerateMethod = new CommandGenerateMethod()
- {
- public String generate(String codeType, AmqpField field, AmqpVersionSet versionSet, int indentSize, int tabSize, boolean notLast)
- {
- return generateMbBodyInit(codeType, field, versionSet, indentSize, tabSize, notLast);
- }
- };
- private MangledGenerateMethod mbMangledBodyInitGenerateMethod = new MangledGenerateMethod()
- {
- public String generate(AmqpField field, int indentSize, int tabSize, boolean notLast)
- {
- return generateMbMangledBodyInit(field, indentSize, tabSize, notLast);
- }
- };
- private GenerateMethod mbSizeGenerateMethod = new GenerateMethod()
- {
- public String generate(String domainType, String fieldName, int ordinal, int indentSize, int tabSize)
- {
- return generateMbFieldSize(domainType, fieldName, ordinal, indentSize, tabSize);
- }
- };
- private BitFieldGenerateMethod mbBitSizeGenerateMethod = new BitFieldGenerateMethod()
- {
- public String generate(List<String> bitFieldList, int ordinal, int indentSize, int tabSize)
- {
- return generateMbBitArrayFieldSize(bitFieldList, ordinal, indentSize, tabSize);
- }
- };
- private GenerateMethod mbEncodeGenerateMethod = new GenerateMethod()
- {
- public String generate(String domainType, String fieldName, int ordinal, int indentSize, int tabSize)
- {
- return generateMbFieldEncode(domainType, fieldName, ordinal, indentSize, tabSize);
- }
- };
- private BitFieldGenerateMethod mbBitEncodeGenerateMethod = new BitFieldGenerateMethod()
- {
- public String generate(List<String> bitFieldList, int ordinal, int indentSize, int tabSize)
- {
- return generateMbBitFieldEncode(bitFieldList, ordinal, indentSize, tabSize);
- }
- };
- private GenerateMethod mbDecodeGenerateMethod = new GenerateMethod()
- {
- public String generate(String domainType, String fieldName, int ordinal, int indentSize, int tabSize)
- {
- return generateMbFieldDecode(domainType, fieldName, ordinal, indentSize, tabSize);
- }
- };
- private BitFieldGenerateMethod mbBitDecodeGenerateMethod = new BitFieldGenerateMethod()
- {
- public String generate(List<String> bitFieldList, int ordinal, int indentSize, int tabSize)
- {
- return generateMbBitFieldDecode(bitFieldList, ordinal, indentSize, tabSize);
- }
- };
- private GenerateMethod mbToStringGenerateMethod = new GenerateMethod()
- {
- public String generate(String domainType, String fieldName, int ordinal, int indentSize, int tabSize)
- {
- return generateMbFieldToString(domainType, fieldName, ordinal, indentSize, tabSize);
- }
- };
- private BitFieldGenerateMethod mbBitToStringGenerateMethod = new BitFieldGenerateMethod()
- {
- public String generate(List<String> bitFieldList, int ordinal, int indentSize, int tabSize)
- {
- return generateMbBitFieldToString(bitFieldList, ordinal, indentSize, tabSize);
- }
- };
-
- // Methods for PropertyContentHeader classes
- private CommandGenerateMethod pchClearGenerateMethod = new CommandGenerateMethod()
- {
- public String generate(String codeType, AmqpField field, AmqpVersionSet versionSet, int indentSize, int tabSize, boolean notLast)
- {
- return generatePchClearMethod(codeType, field, versionSet, indentSize, tabSize, notLast);
- }
- };
- private MangledGenerateMethod pchMangledClearGenerateMethod = new MangledGenerateMethod()
- {
- public String generate(AmqpField field, int indentSize, int tabSize, boolean notLast)
- {
- return generatePchMangledClearMethod(field, indentSize, tabSize, notLast);
- }
- };
- private CommandGenerateMethod pchGetGenerateMethod = new CommandGenerateMethod()
- {
- public String generate(String codeType, AmqpField field, AmqpVersionSet versionSet, int indentSize, int tabSize, boolean notLast)
- {
- return generatePchGetMethod(codeType, field, versionSet, indentSize, tabSize, notLast);
- }
- };
- private MangledGenerateMethod pchMangledGetGenerateMethod = new MangledGenerateMethod()
- {
- public String generate(AmqpField field, int indentSize, int tabSize, boolean notLast)
- {
- return generatePchMangledGetMethod(field, indentSize, tabSize, notLast);
- }
- };
- private CommandGenerateMethod pchSetGenerateMethod = new CommandGenerateMethod()
- {
- public String generate(String codeType, AmqpField field, AmqpVersionSet versionSet, int indentSize, int tabSize, boolean notLast)
- {
- return generatePchSetMethod(codeType, field, versionSet, indentSize, tabSize, notLast);
- }
- };
- private MangledGenerateMethod pchMangledSetGenerateMethod = new MangledGenerateMethod()
- {
- public String generate(AmqpField field, int indentSize, int tabSize, boolean notLast)
- {
- return generatePchMangledSetMethod(field, indentSize, tabSize, notLast);
- }
- };
- private GenerateMethod pchSizeGenerateMethod = new GenerateMethod()
- {
- public String generate(String domainType, String fieldName, int ordinal, int indentSize, int tabSize)
- {
- return generatePchFieldSize(domainType, fieldName, ordinal, indentSize, tabSize);
- }
- };
- private BitFieldGenerateMethod pchBitSizeGenerateMethod = new BitFieldGenerateMethod()
- {
- public String generate(List<String> bitFieldList, int ordinal, int indentSize, int tabSize)
- {
- return generatePchBitArrayFieldSize(bitFieldList, ordinal, indentSize, tabSize);
- }
- };
- private GenerateMethod pchEncodeGenerateMethod = new GenerateMethod()
- {
- public String generate(String domainType, String fieldName, int ordinal, int indentSize, int tabSize)
- {
- return generatePchFieldEncode(domainType, fieldName, ordinal, indentSize, tabSize);
- }
- };
- private BitFieldGenerateMethod pchBitEncodeGenerateMethod = new BitFieldGenerateMethod()
- {
- public String generate(List<String> bitFieldList, int ordinal, int indentSize, int tabSize)
- {
- return generatePchBitFieldEncode(bitFieldList, ordinal, indentSize, tabSize);
- }
- };
- private GenerateMethod pchDecodeGenerateMethod = new GenerateMethod()
- {
- public String generate(String domainType, String fieldName, int ordinal, int indentSize, int tabSize)
- {
- return generatePchFieldDecode(domainType, fieldName, ordinal, indentSize, tabSize);
- }
- };
- private BitFieldGenerateMethod pchBitDecodeGenerateMethod = new BitFieldGenerateMethod()
- {
- public String generate(List<String> bitFieldList, int ordinal, int indentSize, int tabSize)
- {
- return generatePchBitFieldDecode(bitFieldList, ordinal, indentSize, tabSize);
- }
- };
- private GenerateMethod pchGetPropertyFlagsGenerateMethod = new GenerateMethod()
- {
- public String generate(String domainType, String fieldName, int ordinal, int indentSize, int tabSize)
- {
- return generatePchGetPropertyFlags(domainType, fieldName, ordinal, indentSize, tabSize);
- }
- };
- private BitFieldGenerateMethod pchBitGetPropertyFlagsGenerateMethod = new BitFieldGenerateMethod()
- {
- public String generate(List<String> bitFieldList, int ordinal, int indentSize, int tabSize)
- {
- return generatePchBitGetPropertyFlags(bitFieldList, ordinal, indentSize, tabSize);
- }
- };
- private GenerateMethod pchSetPropertyFlagsGenerateMethod = new GenerateMethod()
- {
- public String generate(String domainType, String fieldName, int ordinal, int indentSize, int tabSize)
- {
- return generatePchSetPropertyFlags(domainType, fieldName, ordinal, indentSize, tabSize);
- }
- };
- private BitFieldGenerateMethod pchBitSetPropertyFlagsGenerateMethod = new BitFieldGenerateMethod()
- {
- public String generate(List<String> bitFieldList, int ordinal, int indentSize, int tabSize)
- {
- return generatePchBitSetPropertyFlags(bitFieldList, ordinal, indentSize, tabSize);
- }
- };
-
-
- public String getNativeType(String type)
- {
- return typeMap.get(type).type;
- }
-
- public String getEncodingType(String type)
- {
- return typeMap.get(type).encodingType;
- }
-
-
- public JavaGenerator()
- {
- super();
- // Load Java type and size maps.
- // Adjust or add to these lists as new types are added/defined.
- // The char '#' will be replaced by the field variable name (any type).
- // The char '~' will be replaced by the compacted bit array size (type bit only).
- typeMap.put("bit", new DomainInfo(
- "boolean", // Java code type
- "~", // size
- "Boolean", // Java code type
- "EncodingUtils.writeBooleans(buffer, #)", // encode expression
- "# = EncodingUtils.readBooleans(buffer)")); // decode expression
- typeMap.put("bitfield", new DomainInfo(
- "byte", // Java code type
- "~", // size
- "Bitfield",
- "EncodingUtils.writeBooleans(buffer, #)", // encode expression
- "# = EncodingUtils.readBooleans(buffer)")); // decode expression
-
- typeMap.put("content", new DomainInfo(
- "Content", // Java code type
- "EncodingUtils.encodedContentLength(#)", // size
- "Content", // Java code type
- "EncodingUtils.writeContentBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readContent(buffer)")); // decode expression
- typeMap.put("long", new DomainInfo(
- "long", // Java code type
- "4", // size
- "UnsignedInteger", // Java code type
- "EncodingUtils.writeUnsignedInteger(buffer, #)", // encode expression
- "# = buffer.getUnsignedInt()")); // decode expression
- typeMap.put("longlong", new DomainInfo(
- "long", // Java code type
- "8", // size
- "Long",
- "buffer.putLong(#)", // encode expression
- "# = buffer.getLong()")); // decode expression
- typeMap.put("longstr", new DomainInfo(
- "byte[]", // Java code type
- "EncodingUtils.encodedLongstrLength(#)", // size
- "Bytes",
- "EncodingUtils.writeLongStringBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readLongstr(buffer)")); // decode expression
- typeMap.put("octet", new DomainInfo(
- "short", // Java code type
- "1", // size
- "UnsignedByte",
- "EncodingUtils.writeUnsignedByte(buffer, #)", // encode expression
- "# = buffer.getUnsigned()")); // decode expression
- typeMap.put("short", new DomainInfo(
- "int", // Java code type
- "2", // size
- "UnsignedShort",
- "EncodingUtils.writeUnsignedShort(buffer, #)", // encode expression
- "# = buffer.getUnsignedShort()")); // decode expression
- typeMap.put("shortstr", new DomainInfo(
- "AMQShortString", // Java code type
- "EncodingUtils.encodedShortStringLength(#)", // size
- "AMQShortString", // Java code type
- "EncodingUtils.writeShortStringBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readAMQShortString(buffer)")); // decode expression
- typeMap.put("table", new DomainInfo(
- "FieldTable", // Java code type
- "EncodingUtils.encodedFieldTableLength(#)", // size
- "FieldTable", // Java code type
- "EncodingUtils.writeFieldTableBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readFieldTable(buffer)")); // decode expression
- typeMap.put("timestamp", new DomainInfo(
- "long", // Java code type
- "8", // size
- "Timestamp",
- "EncodingUtils.writeTimestamp(buffer, #)", // encode expression
- "# = EncodingUtils.readTimestamp(buffer)")); // decode expression
- }
-
- // === Start of methods for Interface LanguageConverter ===
-
- public String prepareClassName(String className)
- {
- return camelCaseName(className, true);
- }
-
- public String prepareMethodName(String methodName)
- {
- return camelCaseName(methodName, false);
- }
-
- public String prepareDomainName(String domainName)
- {
- return camelCaseName(domainName, false);
- }
-
-
- public String getGeneratedType(String domainName, AmqpVersion version)
- {
- String domainType = getDomainType(domainName, version);
- if (domainType == null)
- {
- throw new AmqpTypeMappingException("Domain type \"" + domainName +
- "\" not found in Java typemap.");
- }
- DomainInfo info = typeMap.get(domainType);
- if (info == null)
- {
- throw new AmqpTypeMappingException("Unknown domain: \"" + domainType + "\"");
- }
- return info.type;
- }
-
- // === Abstract methods from class Generator - Java-specific implementations ===
-
- @Override
- protected String prepareFilename(String filenameTemplate, AmqpClass thisClass, AmqpMethod method,
- AmqpField field, AmqpVersion version)
- {
- StringBuffer sb = new StringBuffer(filenameTemplate);
- if (thisClass != null)
- {
- replaceToken(sb, "${CLASS}", thisClass.getName());
- }
- if (method != null)
- {
- replaceToken(sb, "${METHOD}", method.getName());
- }
- if (field != null)
- {
- replaceToken(sb, "${FIELD}", field.getName());
- }
- if (version != null)
- {
- replaceToken(sb, "${MAJOR}", String.valueOf(version.getMajor()));
- replaceToken(sb, "${MINOR}", String.valueOf(version.getMinor()));
- }
- return sb.toString();
- }
-
- @Override
- protected void processModelTemplate(NamedTemplate template)
- {
- processTemplate(template, null, null, null, null);
- }
-
- @Override
- protected void processClassTemplate(NamedTemplate template, AmqpClass thisClass)
- {
- processTemplate(template, thisClass, null, null,
- thisClass.getVersionSet().size() == 1 ? thisClass.getVersionSet().first() : null);
- }
-
- @Override
- protected void processMethodTemplate(NamedTemplate template, AmqpClass thisClass,
- AmqpMethod method)
- {
- processTemplate(template, thisClass, method, null,
- thisClass.getVersionSet().size() == 1 ? thisClass.getVersionSet().first() : null);
- }
-
- protected void processFieldTemplate(NamedTemplate template, AmqpClass thisClass,
- AmqpMethod method, AmqpField field)
- {
- processTemplate(template, thisClass, method, field,
- thisClass.getVersionSet().size() == 1 ? thisClass.getVersionSet().first() : null);
- }
-
- @Override
- protected void processTemplate(NamedTemplate template, AmqpClass thisClass,
- AmqpMethod method, AmqpField field, AmqpVersion version)
- {
- StringBuffer sb = new StringBuffer(template.getTemplate());
- String filename = prepareFilename(getTemplateFileName(sb), thisClass, method, field, version);
- processTemplate(sb, thisClass, method, field, template.getName(), version);
- writeTargetFile(sb, new File(getOutputDirectory() + Utils.FILE_SEPARATOR + filename));
- generatedFileCounter++;
- }
-
- protected void processTemplate(StringBuffer sb, AmqpClass thisClass, AmqpMethod method,
- AmqpField field, String templateFileName, AmqpVersion version)
- {
- try
- {
- processAllLists(sb, thisClass, method, version);
- }
- catch (AmqpTemplateException e)
- {
- System.out.println("WARNING: " + templateFileName + ": " + e.getMessage());
- }
- try
- {
- processAllTokens(sb, thisClass, method, field, version);
- }
- catch (AmqpTemplateException e)
- {
- System.out.println("WARNING: " + templateFileName + ": " + e.getMessage());
- }
- }
-
- @Override
- protected String processToken(String token, AmqpClass thisClass, AmqpMethod method, AmqpField field,
- AmqpVersion version)
- {
- if (token.compareTo("${GENERATOR}") == 0)
- {
- return GENERATOR_INFO;
- }
- if (token.compareTo("${CLASS}") == 0 && thisClass != null)
- {
- return thisClass.getName();
- }
- if (token.compareTo("${CLASS_ID_INIT}") == 0 && thisClass != null)
- {
- return generateIndexInitializer("registerClassId", thisClass.getIndexMap(), 8);
- }
- if (token.compareTo("${METHOD}") == 0 && method != null)
- {
- return method.getName();
- }
- if (token.compareTo("${METHOD_ID_INIT}") == 0 && method != null)
- {
- return generateIndexInitializer("registerMethodId", method.getIndexMap(), 8);
- }
- if (token.compareTo("${FIELD}") == 0 && field != null)
- {
- return field.getName();
- }
-
- // This token is used only with class or method-level templates
- if (token.compareTo("${pch_property_flags_declare}") == 0)
- {
- return generatePchPropertyFlagsDeclare();
- }
- else if (token.compareTo("${pch_property_flags_initializer}") == 0)
- {
- int mapSize = method == null ? thisClass.getFieldMap().size() : method.getFieldMap().size();
- return generatePchPropertyFlagsInitializer(mapSize);
- }
- else if (token.compareTo("${pch_compact_property_flags_initializer}") == 0)
- {
- return generatePchCompactPropertyFlagsInitializer(thisClass, 8, 4);
- }
- else if (token.compareTo("${pch_compact_property_flags_check}") == 0)
- {
- return generatePchCompactPropertyFlagsCheck(thisClass, 8, 4);
- }
-
- // Oops!
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
-
- @Override
- protected void processClassList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpModel model, AmqpVersion version)
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokStart = tline.indexOf('$');
- String token = tline.substring(tokStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- if (token.compareTo("${reg_map_put_method}") == 0)
- {
- codeSnippet = generateRegistry(model, 8, 4);
- }
-
- else // Oops!
- {
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
-
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- @Override
- protected void processMethodList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpClass thisClass)
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokStart = tline.indexOf('$');
- String token = tline.substring(tokStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- //TODO - we don't have any cases of this (yet).
- if (token.compareTo("${???}") == 0)
- {
- codeSnippet = token;
- }
- else // Oops!
- {
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
-
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- @Override
- protected void processFieldList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpFieldMap fieldMap, AmqpVersion version)
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokStart = tline.indexOf('$');
- String token = tline.substring(tokStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- // Field declarations - common to MethodBody and PropertyContentHeader classes
- if (token.compareTo("${field_declaration}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMap(declarationGenerateMethod,
- mangledDeclarationGenerateMethod, 4, 4, this);
- }
-
- // MethodBody classes
- else if (token.compareTo("${mb_field_get_method}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMap(mbGetGenerateMethod,
- mbMangledGetGenerateMethod, 4, 4, this);
- }
- else if (token.compareTo("${mb_field_parameter_list}") == 0)
- {
- // <cringe> The code generated by this is ugly... It puts a comma on a line by itself!
- // TODO: Find a more elegant solution here sometime...
- codeSnippet = fieldMap.size() > 0 ? Utils.createSpaces(42) + "," + CR : "";
- // </cringe>
- codeSnippet += fieldMap.parseFieldMap(mbParamListGenerateMethod,
- mbMangledParamListGenerateMethod, 42, 4, this);
- }
-
- else if (token.compareTo("${mb_field_passed_parameter_list}") == 0)
- {
- // <cringe> The code generated by this is ugly... It puts a comma on a line by itself!
- // TODO: Find a more elegant solution here sometime...
- codeSnippet = fieldMap.size() > 0 ? Utils.createSpaces(42) + "," + CR : "";
- // </cringe>
- codeSnippet += fieldMap.parseFieldMap(mbPassedParamListGenerateMethod,
- mbMangledPassedParamListGenerateMethod, 42, 4, this);
- }
- else if (token.compareTo("${mb_field_body_initialize}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMap(mbBodyInitGenerateMethod,
- mbMangledBodyInitGenerateMethod, 8, 4, this);
- }
- else if (token.compareTo("${mb_field_size}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMapOrdinally(mbSizeGenerateMethod,
- mbBitSizeGenerateMethod, 8, 4, this);
- }
- else if (token.compareTo("${mb_field_encode}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMapOrdinally(mbEncodeGenerateMethod,
- mbBitEncodeGenerateMethod, 8, 4, this);
- }
- else if (token.compareTo("${mb_field_decode}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMapOrdinally(mbDecodeGenerateMethod,
- mbBitDecodeGenerateMethod, 8, 4, this);
- }
- else if (token.compareTo("${mb_field_to_string}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMapOrdinally(mbToStringGenerateMethod,
- mbBitToStringGenerateMethod, 8, 4, this);
- }
-
- // PropertyContentHeader classes
- else if (token.compareTo("${pch_field_list_size}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMapOrdinally(pchSizeGenerateMethod,
- pchBitSizeGenerateMethod, 12, 4, this);
- }
- else if (token.compareTo("${pch_field_list_payload}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMapOrdinally(pchEncodeGenerateMethod,
- pchBitEncodeGenerateMethod, 12, 4, this);
- }
- else if (token.compareTo("${pch_field_list_decode}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMapOrdinally(pchDecodeGenerateMethod,
- pchBitDecodeGenerateMethod, 12, 4, this);
- }
- else if (token.compareTo("${pch_get_compact_property_flags}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMapOrdinally(pchGetPropertyFlagsGenerateMethod,
- pchBitGetPropertyFlagsGenerateMethod, 8, 4, this);
- }
- else if (token.compareTo("${pch_set_compact_property_flags}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMapOrdinally(pchSetPropertyFlagsGenerateMethod,
- pchBitSetPropertyFlagsGenerateMethod, 8, 4, this);
- }
- else if (token.compareTo("${pch_field_clear_methods}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMap(pchClearGenerateMethod,
- pchMangledClearGenerateMethod, 4, 4, this);
- }
- else if (token.compareTo("${pch_field_get_methods}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMap(pchGetGenerateMethod,
- pchMangledGetGenerateMethod, 4, 4, this);
- }
- else if (token.compareTo("${pch_field_set_methods}") == 0)
- {
- codeSnippet = fieldMap.parseFieldMap(pchSetGenerateMethod,
- pchMangledSetGenerateMethod, 4, 4, this);
- }
-
- else // Oops!
- {
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- @Override
- protected void processConstantList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpConstantSet constantSet)
- {
- String codeSnippet;
- int lend = sb.indexOf(CR, listMarkerStartIndex) + 1; // Include cr at end of line
- String tline = sb.substring(listMarkerEndIndex, lend); // Line excluding line marker, including cr
- int tokStart = tline.indexOf('$');
- String token = tline.substring(tokStart).trim();
- sb.delete(listMarkerStartIndex, lend);
-
- if (token.compareTo("${const_get_method}") == 0)
- {
- codeSnippet = generateConstantGetMethods(constantSet, 4, 4);
- }
-
- else // Oops!
- {
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
-
- sb.insert(listMarkerStartIndex, codeSnippet);
- }
-
- // === Protected and private helper functions unique to Java implementation ===
-
- // Methods used for generation of code snippets called from the field map parsers
-
- // Common methods
-
- protected String generateFieldDeclaration(String codeType, AmqpField field,
- AmqpVersionSet versionSet, int indentSize, int tabSize, boolean nextFlag)
- {
- return Utils.createSpaces(indentSize) + "public " + codeType + " " + field.getName() +
- "; // AMQP version(s): " + versionSet + CR;
- }
-
- protected String generateMangledFieldDeclaration(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- {
- StringBuffer sb = new StringBuffer();
- Iterator<String> dItr = field.getDomainMap().keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.getDomainMap().get(domainName);
- String codeType = getGeneratedType(domainName, versionSet.first());
- sb.append(Utils.createSpaces(indentSize) + "public " + codeType + " " +
- field.getName() + "_" + (domainCntr++) + "; // AMQP Version(s): " + versionSet +
- CR);
- }
- return sb.toString();
- }
-
- protected String generateIndexInitializer(String mapName, AmqpOrdinalVersionMap indexMap, int indentSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- Iterator<Integer> iItr = indexMap.keySet().iterator();
- while (iItr.hasNext())
- {
- int index = iItr.next();
- AmqpVersionSet versionSet = indexMap.get(index);
- Iterator<AmqpVersion> vItr = versionSet.iterator();
- while (vItr.hasNext())
- {
- AmqpVersion version = vItr.next();
- sb.append(indent + mapName + "( (byte) " + version.getMajor() + ", (byte) " + version.getMinor() + ", " + index + ");" + CR);
- }
- }
- return sb.toString();
- }
-
- protected String generateRegistry(AmqpModel model, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
-
- for (String className : model.getClassMap().keySet())
- {
- AmqpClass thisClass = model.getClassMap().get(className);
- for (String methodName : thisClass.getMethodMap().keySet())
- {
- AmqpMethod method = thisClass.getMethodMap().get(methodName);
- for (AmqpVersion version : model.getVersionSet())
- {
- // Find class and method index for this version (if it exists)
- try
- {
- int classIndex = findIndex(thisClass.getIndexMap(), version);
- int methodIndex = findIndex(method.getIndexMap(), version);
- sb.append(indent + "registerMethod(" + CR);
- sb.append(indent + tab + "(short)" + classIndex +
- ", (short)" + methodIndex + ", (byte)" + version.getMajor() +
- ", (byte)" + version.getMinor() + ", " + CR);
- sb.append(indent + tab + Utils.firstUpper(thisClass.getName()) +
- Utils.firstUpper(method.getName()) + "Body.getFactory());" + CR);
- }
- catch (Exception e)
- {
- } // Ignore
- }
- }
- }
- return sb.toString();
- }
-
- protected int findIndex(TreeMap<Integer, AmqpVersionSet> map, AmqpVersion version)
- {
- Iterator<Integer> iItr = map.keySet().iterator();
- while (iItr.hasNext())
- {
- int index = iItr.next();
- AmqpVersionSet versionSet = map.get(index);
- if (versionSet.contains(version))
- {
- return index;
- }
- }
- throw new IllegalArgumentException("Index not found");
- }
-
- // Methods for AmqpConstants class
-
-
- public String prepareConstantName(String constantName)
- {
- return upperCaseName(constantName);
- }
-
-
- protected String generateConstantGetMethods(AmqpConstantSet constantSet,
- int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- for (AmqpConstant constant : constantSet.getContstants())
- {
-
- if (constant.isVersionConsistent(constantSet.getVersionSet()))
- {
- // return a constant
- String value = constant.firstKey();
- if (Utils.containsOnlyDigits(value))
- {
- sb.append(indent + "public static final int " + constant.getName() + " = " +
- constant.firstKey() + ";" + CR);
- }
- else if (Utils.containsOnlyDigitsAndDecimal(value))
- {
- sb.append(indent + "public static double " + constant.getName() + " = " +
- constant.firstKey() + "; " + CR);
- }
- else
- {
- sb.append(indent + "public static String " + constant.getName() + " = " +
- constant.firstKey() + "\"; " + CR);
-
- }
- sb.append(CR);
- }
- else
- {
- // Return version-specific constant
- sb.append(generateVersionDependentGet(constant, "String", "", "\"", "\"", indentSize, tabSize));
- sb.append(generateVersionDependentGet(constant, "int", "AsInt", "", "", indentSize, tabSize));
- sb.append(generateVersionDependentGet(constant, "double", "AsDouble", "(double)", "", indentSize, tabSize));
- sb.append(CR);
- }
- }
- return sb.toString();
- }
-
- protected String generateVersionDependentGet(AmqpConstant constant,
- String methodReturnType, String methodNameSuffix, String returnPrefix, String returnPostfix,
- int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + "public static " + methodReturnType + " " + constant.getName() +
- methodNameSuffix + "(byte major, byte minor) throws AMQProtocolVersionException" + CR);
- sb.append(indent + "{" + CR);
- boolean first = true;
- Iterator<String> sItr = constant.keySet().iterator();
- while (sItr.hasNext())
- {
- String value = sItr.next();
- AmqpVersionSet versionSet = constant.get(value);
- sb.append(indent + tab + (first ? "" : "else ") + "if (" + generateVersionCheck(versionSet) +
- ")" + CR);
- sb.append(indent + tab + "{" + CR);
- if (methodReturnType.compareTo("int") == 0 && !Utils.containsOnlyDigits(value))
- {
- sb.append(generateConstantDeclarationException(constant.getName(), methodReturnType,
- indentSize + (2 * tabSize), tabSize));
- }
- else if (methodReturnType.compareTo("double") == 0 && !Utils.containsOnlyDigitsAndDecimal(value))
- {
- sb.append(generateConstantDeclarationException(constant.getName(), methodReturnType,
- indentSize + (2 * tabSize), tabSize));
- }
- else
- {
- sb.append(indent + tab + tab + "return " + returnPrefix + value + returnPostfix + ";" + CR);
- }
- sb.append(indent + tab + "}" + CR);
- first = false;
- }
- sb.append(indent + tab + "else" + CR);
- sb.append(indent + tab + "{" + CR);
- sb.append(indent + tab + tab + "throw new AMQProtocolVersionException(\"Constant \\\"" +
- constant.getName() + "\\\" \" +" + CR);
- sb.append(indent + tab + tab + tab +
- "\"is undefined for AMQP version \" + major + \"-\" + minor + \".\");" + CR);
- sb.append(indent + tab + "}" + CR);
- sb.append(indent + "}" + CR);
- return sb.toString();
- }
-
- protected String generateConstantDeclarationException(String name, String methodReturnType,
- int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + "throw new AMQProtocolVersionException(\"Constant \\\"" +
- name + "\\\" \" +" + CR);
- sb.append(indent + tab + "\"cannot be converted to type " + methodReturnType +
- " for AMQP version \" + major + \"-\" + minor + \".\");" + CR);
- return sb.toString();
- }
-
- // Methods for MessageBody classes
- protected String generateMbGetMethod(String codeType, AmqpField field,
- AmqpVersionSet versionSet, int indentSize, int tabSize, boolean nextFlag)
- {
- return Utils.createSpaces(indentSize) + "public " + codeType + " get" +
- Utils.firstUpper(field.getName()) + "() { return " + field.getName() + "; }" +
- CR;
- }
-
- protected String generateMbMangledGetMethod(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer(CR);
- sb.append(indent + "public <T> T get" + Utils.firstUpper(field.getName()) +
- "(Class<T> classObj) throws AMQProtocolVersionException" + CR);
- sb.append(indent + "{" + CR);
- Iterator<String> dItr = field.getDomainMap().keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.getDomainMap().get(domainName);
- String codeType = getGeneratedType(domainName, versionSet.first());
- sb.append(indent + tab + "if (classObj.equals(" + codeType +
- ".class)) // AMQP Version(s): " + versionSet + CR);
- sb.append(indent + tab + tab + "return (T)(Object)" + field.getName() + "_" +
- (domainCntr++) + ";" + CR);
- }
- sb.append(indent + tab +
- "throw new AMQProtocolVersionException(\"None of the AMQP versions defines \" +" +
- CR + " \"field \\\"" + field.getName() +
- "\\\" as domain \\\"\" + classObj.getName() + \"\\\".\");" + CR);
- sb.append(indent + "}" + CR);
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generateMbParamList(String codeType, AmqpField field,
- AmqpVersionSet versionSet, int indentSize, int tabSize, boolean nextFlag)
- {
- return Utils.createSpaces(indentSize) + codeType + " " + field.getName() +
- (nextFlag ? "," : "") + " // AMQP version(s): " + versionSet + CR;
- }
-
-
- protected String generateMbPassedParamList(String codeType, AmqpField field,
- AmqpVersionSet versionSet, int indentSize, int tabSize, boolean nextFlag)
- {
- return Utils.createSpaces(indentSize) + field.getName() +
- (nextFlag ? "," : "") + " // AMQP version(s): " + versionSet + CR;
- }
-
-
- protected String generateMbMangledParamList(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- {
- StringBuffer sb = new StringBuffer();
- Iterator<String> dItr = field.getDomainMap().keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.getDomainMap().get(domainName);
- String codeType = getGeneratedType(domainName, versionSet.first());
- sb.append(Utils.createSpaces(indentSize) + codeType + " " + field.getName() + "_" +
- (domainCntr++) + (nextFlag ? "," : "") + " // AMQP version(s): " +
- versionSet + CR);
- }
- return sb.toString();
- }
-
- protected String generateMbMangledPassedParamList(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- {
- StringBuffer sb = new StringBuffer();
- Iterator<String> dItr = field.getDomainMap().keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.getDomainMap().get(domainName);
- sb.append(Utils.createSpaces(indentSize) + field.getName() + "_" +
- (domainCntr++) + (nextFlag ? "," : "") + " // AMQP version(s): " +
- versionSet + CR);
- }
- return sb.toString();
- }
-
-
- protected String generateMbBodyInit(String codeType, AmqpField field,
- AmqpVersionSet versionSet, int indentSize, int tabSize, boolean nextFlag)
- {
- return Utils.createSpaces(indentSize) + "this." + field.getName() + " = " + field.getName() +
- ";" + CR;
- }
-
- protected String generateMbMangledBodyInit(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- {
- StringBuffer sb = new StringBuffer();
- Iterator<String> dItr = field.getDomainMap().keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- dItr.next();
- sb.append(Utils.createSpaces(indentSize) + "this." + field.getName() + "_" + domainCntr +
- " = " + field.getName() + "_" + (domainCntr++) + ";" + CR);
- }
- return sb.toString();
- }
-
- protected String generateMbFieldSize(String domainType, String fieldName,
- int ordinal, int indentSize, int tabSize)
- {
- StringBuffer sb = new StringBuffer();
- sb.append(Utils.createSpaces(indentSize) + "size += " +
- typeMap.get(domainType).size.replaceAll("#", fieldName) +
- "; // " + fieldName + ": " + domainType + CR);
- return sb.toString();
- }
-
- protected String generateMbBitArrayFieldSize(List<String> bitFieldList,
- int ordinal, int indentSize, int tabSize)
- {
- StringBuffer sb = new StringBuffer();
- int numBytes = ((bitFieldList.size() - 1) / 8) + 1;
- String comment = bitFieldList.size() == 1 ?
- bitFieldList.get(0) + ": bit" :
- "Combinded bits: " + bitFieldList;
- sb.append(Utils.createSpaces(indentSize) + "size += " +
- typeMap.get("bit").size.replaceAll("~", String.valueOf(numBytes)) +
- "; // " + comment + CR);
- return sb.toString();
- }
-
- protected String generateMbFieldEncode(String domain, String fieldName,
- int ordinal, int indentSize, int tabSize)
- {
- StringBuffer sb = new StringBuffer();
- sb.append(Utils.createSpaces(indentSize) +
- typeMap.get(domain).encodeExpression.replaceAll("#", fieldName) +
- "; // " + fieldName + ": " + domain + CR);
- return sb.toString();
- }
-
- protected String generateMbBitFieldEncode(List<String> bitFieldList,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
-
- StringBuilder sb = new StringBuilder();
- int i = 0;
- while (i < bitFieldList.size())
- {
-
- StringBuilder line = new StringBuilder();
-
- for (int j = 0; i < bitFieldList.size() && j < 8; i++, j++)
- {
- if (j != 0)
- {
- line.append(", ");
- }
- line.append(bitFieldList.get(i));
- }
-
- sb.append(indent +
- typeMap.get("bit").encodeExpression.replaceAll("#", line.toString()) + ";" + CR);
- }
- return sb.toString();
- }
-
- protected String generateMbFieldDecode(String domain, String fieldName,
- int ordinal, int indentSize, int tabSize)
- {
- StringBuffer sb = new StringBuffer();
- sb.append(Utils.createSpaces(indentSize) +
- typeMap.get(domain).decodeExpression.replaceAll("#", fieldName) +
- "; // " + fieldName + ": " + domain + CR);
- return sb.toString();
- }
-
- protected String generateMbBitFieldDecode(List<String> bitFieldList,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
-
- StringBuilder sb = new StringBuilder(indent);
- sb.append("byte packedValue;");
- sb.append(CR);
-
- // RG HERE!
-
- int i = 0;
- while (i < bitFieldList.size())
- {
- sb.append(indent + "packedValue = EncodingUtils.readByte(buffer);" + CR);
-
- for (int j = 0; i < bitFieldList.size() && j < 8; i++, j++)
- {
- sb.append(indent + bitFieldList.get(i) + " = ( packedValue & (byte) (1 << " + j + ") ) != 0;" + CR);
- }
- }
- return sb.toString();
- }
-
- protected String generateMbFieldToString(String domain, String fieldName,
- int ordinal, int indentSize, int tabSize)
- {
- StringBuffer sb = new StringBuffer();
- sb.append(Utils.createSpaces(indentSize) +
- "buf.append(\" " + fieldName + ": \" + " + fieldName + ");" + CR);
- return sb.toString();
- }
-
- protected String generateMbBitFieldToString(List<String> bitFieldList,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < bitFieldList.size(); i++)
- {
- String bitFieldName = bitFieldList.get(i);
- sb.append(indent + "buf.append(\" " + bitFieldName + ": \" + " + bitFieldName +
- ");" + CR);
- }
- return sb.toString();
- }
-
- // Methods for PropertyContentHeader classes
-
- protected String generatePchClearMethod(String codeType, AmqpField field,
- AmqpVersionSet versionSet, int indentSize, int tabSize, boolean nextFlag)
- {
- // This is one case where the ordinal info is the only significant factor,
- // the domain info plays no part. Defer to the mangled version; the code would be
- // identical anyway...
- return generatePchMangledClearMethod(field, indentSize, tabSize, nextFlag);
- }
-
- protected String generatePchMangledClearMethod(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + "public void clear" + Utils.firstUpper(field.getName()) +
- "()" + CR);
- sb.append(indent + "{" + CR);
-
- // If there is more than one ordinal for this field or the ordinal does not
- // apply to all known versions, then we need to generate version checks so
- // we know which fieldProperty to clear.
- if (field.getOrdinalMap().size() == 1 &&
- field.getOrdinalMap().get(field.getOrdinalMap().firstKey()).size() == field.getVersionSet().size())
- {
- int ordinal = field.getOrdinalMap().firstKey();
- sb.append(indent + tab + "clearEncodedForm();" + CR);
- sb.append(indent + tab + "propertyFlags[" + ordinal + "] = false;" + CR);
- }
- else
- {
- Iterator<Integer> oItr = field.getOrdinalMap().keySet().iterator();
- while (oItr.hasNext())
- {
- int ordinal = oItr.next();
- AmqpVersionSet versionSet = field.getOrdinalMap().get(ordinal);
- sb.append(indent + tab);
- if (ordinal != field.getOrdinalMap().firstKey())
- {
- sb.append("else ");
- }
- sb.append("if (");
- sb.append(generateVersionCheck(versionSet));
- sb.append(")" + CR);
- sb.append(indent + tab + "{" + CR);
- sb.append(indent + tab + tab + "clearEncodedForm();" + CR);
- sb.append(indent + tab + tab + "propertyFlags[" + ordinal + "] = false;" + CR);
- sb.append(indent + tab + "}" + CR);
- }
- }
- sb.append(indent + "}" + CR);
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchGetMethod(String codeType, AmqpField field,
- AmqpVersionSet versionSet, int indentSize, int tabSize, boolean nextFlag)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer(indent + "public " + codeType + " get" +
- Utils.firstUpper(field.getName()) + "()" + CR);
- sb.append(indent + "{" + CR);
- sb.append(indent + tab + "decodeIfNecessary();" + CR);
- sb.append(indent + tab + "return " + field.getName() + ";" + CR);
- sb.append(indent + "}" + CR);
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchMangledGetMethod(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer(indent + "public <T> T get" +
- Utils.firstUpper(field.getName()) +
- "(Class<T> classObj) throws AMQProtocolVersionException" + CR);
- sb.append(indent + "{" + CR);
- Iterator<String> dItr = field.getDomainMap().keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.getDomainMap().get(domainName);
- String codeType = getGeneratedType(domainName, versionSet.first());
- sb.append(indent + tab + "if (classObj.equals(" + codeType +
- ".class)) // AMQP Version(s): " + versionSet + CR);
- sb.append(indent + tab + "{" + CR);
- sb.append(indent + tab + tab + "decodeIfNecessary();" + CR);
- sb.append(indent + tab + tab + "return (T)(Object)" + field.getName() + "_" +
- (domainCntr++) + ";" + CR);
- sb.append(indent + tab + "}" + CR);
- }
- sb.append(indent + tab +
- "throw new AMQProtocolVersionException(\"None of the AMQP versions defines \" +" +
- CR + " \"field \\\"" + field.getName() +
- "\\\" as domain \\\"\" + classObj.getName() + \"\\\".\");" + CR);
- sb.append(indent + "}" + CR);
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchSetMethod(String codeType, AmqpField field,
- AmqpVersionSet versionSet, int indentSize, int tabSize, boolean nextFlag)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + "public void set" + Utils.firstUpper(field.getName()) +
- "(" + codeType + " " + field.getName() + ")" + CR);
- sb.append(indent + "{" + CR);
-
- // If there is more than one ordinal for this field or the ordinal does not
- // apply to all known versions, then we need to generate version checks so
- // we know which fieldProperty to clear.
- if (field.getOrdinalMap().size() == 1 &&
- field.getOrdinalMap().get(field.getOrdinalMap().firstKey()).size() == field.getVersionSet().size())
- {
- int ordinal = field.getOrdinalMap().firstKey();
- sb.append(indent + tab + "clearEncodedForm();" + CR);
- sb.append(indent + tab + "propertyFlags[" + ordinal + "] = true;" + CR);
- sb.append(indent + tab + "this." + field.getName() + " = " + field.getName() + ";" + CR);
- }
- else
- {
- Iterator<Integer> oItr = field.getOrdinalMap().keySet().iterator();
- while (oItr.hasNext())
- {
- int ordinal = oItr.next();
- AmqpVersionSet oVersionSet = field.getOrdinalMap().get(ordinal);
- sb.append(indent + tab);
- if (ordinal != field.getOrdinalMap().firstKey())
- {
- sb.append("else ");
- }
- sb.append("if (");
- sb.append(generateVersionCheck(oVersionSet));
- sb.append(")" + CR);
- sb.append(indent + tab + "{" + CR);
- sb.append(indent + tab + tab + "clearEncodedForm();" + CR);
- sb.append(indent + tab + tab + "propertyFlags[" + ordinal + "] = true;" + CR);
- sb.append(indent + tab + tab + "this." + field.getName() + " = " + field.getName() + ";" + CR);
- sb.append(indent + tab + "}" + CR);
- }
- }
- sb.append(indent + "}" + CR);
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchMangledSetMethod(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
-
- Iterator<String> dItr = field.getDomainMap().keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.getDomainMap().get(domainName);
- String codeType = getGeneratedType(domainName, versionSet.first());
-
- // Find ordinal with matching version
- AmqpVersionSet commonVersionSet = new AmqpVersionSet();
- Iterator<Integer> oItr = field.getOrdinalMap().keySet().iterator();
- while (oItr.hasNext())
- {
- int ordinal = oItr.next();
- AmqpVersionSet oVersionSet = field.getOrdinalMap().get(ordinal);
- Iterator<AmqpVersion> vItr = oVersionSet.iterator();
- boolean first = true;
- while (vItr.hasNext())
- {
- AmqpVersion thisVersion = vItr.next();
- if (versionSet.contains(thisVersion))
- {
- commonVersionSet.add(thisVersion);
- }
- }
- if (!commonVersionSet.isEmpty())
- {
- sb.append(indent + "public void set" + Utils.firstUpper(field.getName()) +
- "(" + codeType + " " + field.getName() + ")" + CR);
- sb.append(indent + "{" + CR);
- sb.append(indent + tab);
- if (!first)
- {
- sb.append("else ");
- }
- sb.append("if (");
- sb.append(generateVersionCheck(commonVersionSet));
- sb.append(")" + CR);
- sb.append(indent + tab + "{" + CR);
- sb.append(indent + tab + tab + "clearEncodedForm();" + CR);
- sb.append(indent + tab + tab + "propertyFlags[" + ordinal + "] = true;" + CR);
- sb.append(indent + tab + tab + "this." + field.getName() + "_" + (domainCntr++) +
- " = " + field.getName() + ";" + CR);
- sb.append(indent + tab + "}" + CR);
- sb.append(indent + "}" + CR);
- sb.append(CR);
- first = false;
- }
- }
- }
- return sb.toString();
- }
-
- protected String generatePchFieldSize(String domainType, String fieldName,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer(indent + "if (propertyFlags[" + ordinal + "]) // " +
- fieldName + ": " + domainType + CR);
- sb.append(indent + Utils.createSpaces(tabSize) + "size += " +
- typeMap.get(domainType).size.replaceAll("#", fieldName) + ";" + CR);
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchBitArrayFieldSize(List<String> bitFieldList,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- String comment = bitFieldList.size() == 1 ?
- bitFieldList.get(0) + ": bit" :
- "Combinded bits: " + bitFieldList;
- StringBuffer sb = new StringBuffer();
-
- if (bitFieldList.size() == 1) // single bit
- {
- sb.append(indent + "if (propertyFlags[" + (ordinal - 1) + "]) // " + comment + CR);
- sb.append(indent + tab + "size += " +
- typeMap.get("bit").size.replaceAll("~", "1") + ";" + CR);
- }
- else // multiple bits - up to 8 are combined into one byte
- {
- String bitCntrName = "bitCntr_" + ordinal;
- int startOrdinal = ordinal - bitFieldList.size();
- sb.append(indent + "// " + comment + CR);
- sb.append(indent + "int " + bitCntrName + " = 0;" + CR);
- sb.append(indent + "for (int i=" + startOrdinal + "; i<" + ordinal + "; i++)" + CR);
- sb.append(indent + "{" + CR);
- sb.append(indent + tab + "if (propertyFlags[i])" + CR);
- sb.append(indent + tab + tab + bitCntrName + "++;" + CR);
- sb.append(indent + "}" + CR);
- sb.append(indent + "size += " +
- typeMap.get("bit").size.replaceAll("~", bitCntrName +
- " > 0 ? ((" + bitCntrName + " - 1) / 8) + 1 : 0") + ";" + CR);
- }
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchFieldEncode(String domainType, String fieldName,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + "if (propertyFlags[" + ordinal + "]) // " + fieldName + ": " +
- domainType + CR);
- sb.append(indent + Utils.createSpaces(tabSize) +
- typeMap.get(domainType).encodeExpression.replaceAll("#", fieldName) + ";" + CR);
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchBitFieldEncode(List<String> bitFieldList,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- String comment = bitFieldList.size() == 1 ?
- bitFieldList.get(0) + ": bit" :
- "Combinded bits: " + bitFieldList;
- StringBuffer sb = new StringBuffer();
-
- if (bitFieldList.size() == 1) // single bit
- {
- sb.append(indent + "if (propertyFlags[" + (ordinal - 1) + "]) // " +
- bitFieldList.get(0) + ": bit" + CR);
- sb.append(indent + tab + typeMap.get("bit").encodeExpression.replaceAll("#",
- "new boolean[] {" + bitFieldList.get(0) + "}") + ";" + CR);
- }
- else // multiple bits - up to 8 are combined into one byte
- {
- int startOrdinal = ordinal - bitFieldList.size();
- String bitCntrName = "bitCntr" + startOrdinal;
- sb.append(indent + "// " + comment + CR);
- sb.append(indent + "int " + bitCntrName + " = 0;" + CR);
- sb.append(indent + "for (int i=" + startOrdinal + "; i<=" + (ordinal - 1) + "; i++)" + CR);
- sb.append(indent + "{" + CR);
- sb.append(indent + tab + "if (propertyFlags[i])" + CR);
- sb.append(indent + tab + tab + bitCntrName + "++;" + CR);
- sb.append(indent + "}" + CR);
- sb.append(indent + "if (" + bitCntrName + " > 0) // Are any of the property bits set?" + CR);
- sb.append(indent + "{" + CR);
- sb.append(indent + tab + "boolean[] fullBitArray = new boolean[] { ");
- for (int i = 0; i < bitFieldList.size(); i++)
- {
- if (i != 0)
- {
- sb.append(", ");
- }
- sb.append(bitFieldList.get(i));
- }
- sb.append(" };" + CR);
- sb.append(indent + tab + "boolean[] flaggedBitArray = new boolean[" + bitCntrName +
- "];" + CR);
- sb.append(indent + tab + bitCntrName + " = 0;" + CR);
- sb.append(indent + tab + "for (int i=" + startOrdinal + "; i<=" + (ordinal - 1) +
- "; i++)" + CR);
- sb.append(indent + tab + "{" + CR);
- sb.append(indent + tab + tab + "if (propertyFlags[i])" + CR);
- sb.append(indent + tab + tab + tab + "flaggedBitArray[" + bitCntrName +
- "++] = fullBitArray[i];" + CR);
- sb.append(indent + tab + "}" + CR);
- sb.append(indent + tab + typeMap.get("bit").encodeExpression.replaceAll("#",
- "flaggedBitArray") + ";" + CR);
- sb.append(indent + "}" + CR);
- }
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchFieldDecode(String domainType, String fieldName,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + "if (propertyFlags[" + ordinal + "]) // " + fieldName + ": " +
- domainType + CR);
- sb.append(indent + Utils.createSpaces(tabSize) +
- typeMap.get(domainType).decodeExpression.replaceAll("#", fieldName) + ";" + CR);
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchBitFieldDecode(List<String> bitFieldList,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- String comment = bitFieldList.size() == 1 ?
- bitFieldList.get(0) + ": bit" :
- "Combinded bits: " + bitFieldList;
- StringBuffer sb = new StringBuffer();
-
- if (bitFieldList.size() == 1) // single bit
- {
- sb.append(indent + "if (propertyFlags[" + (ordinal - 1) + "]) // " +
- bitFieldList.get(0) + ": bit" + CR);
- sb.append(indent + "{" + CR);
- sb.append(indent + tab + typeMap.get("bit").decodeExpression.replaceAll("#",
- "boolean[] flaggedBitArray") + ";" + CR);
- sb.append(indent + tab + bitFieldList.get(0) + " = flaggedBitArray[0];" + CR);
- sb.append(indent + "}" + CR);
- }
- else // multiple bits - up to 8 are combined into one byte
- {
- int startOrdinal = ordinal - bitFieldList.size();
- String bitCntr = "bitCntr" + startOrdinal;
- sb.append(indent + "// " + comment + CR);
- sb.append(indent + "int " + bitCntr + " = 0;" + CR);
- sb.append(indent + "for (int i=" + startOrdinal + "; i<=" + (ordinal - 1) + "; i++)" + CR);
- sb.append(indent + "{" + CR);
- sb.append(indent + tab + "if (propertyFlags[i])" + CR);
- sb.append(indent + tab + tab + bitCntr + "++;" + CR);
- sb.append(indent + "}" + CR);
- sb.append(indent + "if (" + bitCntr + " > 0) // Are any of the property bits set?" + CR);
- sb.append(indent + "{" + CR);
- sb.append(indent + tab + typeMap.get("bit").decodeExpression.replaceAll("#",
- "boolean[] flaggedBitArray") + ";" + CR);
- sb.append(indent + tab + bitCntr + " = 0;" + CR);
- for (int i = 0; i < bitFieldList.size(); i++)
- {
- sb.append(indent + tab + "if (propertyFlags[" + (startOrdinal + i) + "])" + CR);
- sb.append(indent + tab + tab + bitFieldList.get(i) + " = flaggedBitArray[" +
- bitCntr + "++];" + CR);
- }
- sb.append(indent + "}" + CR);
- }
-
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchGetPropertyFlags(String domainType, String fieldName,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- int word = ordinal / 15;
- int bit = 15 - (ordinal % 15);
- sb.append(indent + "if (propertyFlags[" + ordinal + "]) // " + fieldName + ": " +
- domainType + CR);
- sb.append(indent + tab + "compactPropertyFlags[" + word + "] |= (1 << " +
- bit + ");" + CR);
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchBitGetPropertyFlags(List<String> bitFieldList,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- int startOrdinal = ordinal - bitFieldList.size();
-
- for (int i = 0; i < bitFieldList.size(); i++)
- {
- int thisOrdinal = startOrdinal + i;
- int word = thisOrdinal / 15;
- int bit = 15 - (thisOrdinal % 15);
- sb.append(indent + "if (propertyFlags[" + thisOrdinal + "])" + CR);
- sb.append(indent + tab + "compactPropertyFlags[" + word +
- "] |= (1 << " + bit + ");" + CR);
- }
-
- sb.append(CR);
- return sb.toString();
- }
-
- protected String generatePchSetPropertyFlags(String domainType, String fieldName,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- int word = ordinal / 15;
- int bit = 15 - (ordinal % 15);
- sb.append(indent + "propertyFlags[" + ordinal + "] = (compactPropertyFlags[" +
- word + "] & (1 << " + bit + ")) > 0;" + CR);
- return sb.toString();
- }
-
- protected String generatePchBitSetPropertyFlags(List<String> bitFieldList,
- int ordinal, int indentSize, int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- int startOrdinal = ordinal - bitFieldList.size();
-
- for (int i = 0; i < bitFieldList.size(); i++)
- {
- int thisOrdinal = startOrdinal + i;
- int word = thisOrdinal / 15;
- int bit = 15 - (thisOrdinal % 15);
- sb.append(indent + "propertyFlags[" + thisOrdinal + "] = (compactPropertyFlags[" +
- word + "] & (1 << " + bit + ")) > 0;" + CR);
- }
- return sb.toString();
- }
-
- private String generatePchPropertyFlagsDeclare()
- {
- return "private boolean[] propertyFlags;";
- }
-
- private String generatePchPropertyFlagsInitializer(int totNumFields)
- {
- return "propertyFlags = new boolean[" + totNumFields + "];";
- }
-
- private String generatePchCompactPropertyFlagsInitializer(AmqpClass thisClass, int indentSize,
- int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- Iterator<AmqpVersion> vItr = thisClass.getVersionSet().iterator();
- while (vItr.hasNext())
- {
- AmqpVersion version = vItr.next();
- int numBytes = ((thisClass.getFieldMap().getNumFields(version) - 1) / 15) + 1;
-
- sb.append(indent);
- if (!version.equals(thisClass.getVersionSet().first()))
- {
- sb.append("else ");
- }
- sb.append("if ( major == " + version.getMajor() + " && minor == " +
- version.getMinor() + " )" + CR);
- sb.append(indent + tab + "compactPropertyFlags = new int[] { ");
- for (int i = 0; i < numBytes; i++)
- {
- if (i != 0)
- {
- sb.append(", ");
- }
- sb.append(i < numBytes - 1 ? "1" : "0"); // Set the "continue" flag where required
- }
- sb.append(" };" + CR);
- }
- return sb.toString();
- }
-
- private String generatePchCompactPropertyFlagsCheck(AmqpClass thisClass, int indentSize,
- int tabSize)
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- Iterator<AmqpVersion> vItr = thisClass.getVersionSet().iterator();
- while (vItr.hasNext())
- {
- AmqpVersion version = vItr.next();
- int numFields = thisClass.getFieldMap().getNumFields(version);
- int numBytes = ((numFields - 1) / 15) + 1;
-
- sb.append(indent);
- if (!version.equals(thisClass.getVersionSet().first()))
- {
- sb.append("else ");
- }
- sb.append("if ( major == " + version.getMajor() + " && minor == " +
- version.getMinor() + " && compactPropertyFlags.length != " + numBytes + " )" + CR);
- sb.append(indent + tab +
- "throw new AMQProtocolVersionException(\"Property flag array size mismatch:\" +" + CR);
- sb.append(indent + tab + tab + "\"(Size found: \" + compactPropertyFlags.length +" + CR);
- sb.append(indent + tab + tab + "\") Version " + version + " has " + numFields +
- " fields which requires an int array of size " + numBytes + ".\");" + CR);
- }
- return sb.toString();
- }
-
- private String generateVersionCheck(AmqpVersionSet v)
- {
- StringBuffer sb = new StringBuffer();
- AmqpVersion[] versionArray = new AmqpVersion[v.size()];
- v.toArray(versionArray);
- for (int i = 0; i < versionArray.length; i++)
- {
- if (i != 0)
- {
- sb.append(" || ");
- }
- if (versionArray.length > 1)
- {
- sb.append("(");
- }
- sb.append("major == (byte)" + versionArray[i].getMajor() + " && minor == (byte)" +
- versionArray[i].getMinor());
- if (versionArray.length > 1)
- {
- sb.append(")");
- }
- }
- return sb.toString();
- }
-
- private String camelCaseName(String name, boolean upperFirstFlag)
- {
- StringBuffer ccn = new StringBuffer();
- String[] toks = name.split("[-_.\\ ]");
- for (int i = 0; i < toks.length; i++)
- {
- StringBuffer b = new StringBuffer(toks[i]);
- if (upperFirstFlag || i > 0)
- {
- b.setCharAt(0, Character.toUpperCase(toks[i].charAt(0)));
- }
- ccn.append(b);
- }
- return ccn.toString();
- }
-
-
- private String upperCaseName(String name)
- {
- StringBuffer ccn = new StringBuffer();
- String[] toks = name.split("[-_.\\ ]");
- for (int i = 0; i < toks.length; i++)
- {
- if (i != 0)
- {
- ccn.append('_');
- }
- ccn.append(toks[i].toUpperCase());
-
-
- }
- return ccn.toString();
- }
-
-
- public static Factory<JavaGenerator> _factoryInstance = new Factory<JavaGenerator>()
- {
-
- public JavaGenerator newInstance()
- {
- return new JavaGenerator();
- }
- };
-
- public static Factory<JavaGenerator> getFactory()
- {
- return _factoryInstance;
- }
-
-
- void processModelTemplate(NamedTemplate template, AmqpVersion version)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- void processClassTemplate(NamedTemplate template, AmqpClass amqpClass, AmqpVersion version)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- void processMethodTemplate(NamedTemplate template, AmqpClass amqpClass, AmqpMethod amqpMethod, AmqpVersion version)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- void processFieldTemplate(NamedTemplate template, AmqpClass amqpClass, AmqpMethod amqpMethod, AmqpField amqpField, AmqpVersion version)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/LanguageConverter.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/LanguageConverter.java
deleted file mode 100644
index 5e692d86e7..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/LanguageConverter.java
+++ /dev/null
@@ -1,42 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-public interface LanguageConverter
-{
-
-// public AmqpDomainMap getDomainMap();
-// public AmqpConstantSet getConstantSet();
-// public AmqpModel getModel();
-
- //
- public String prepareClassName(String className);
-
- public String prepareMethodName(String methodName);
-
- public String prepareDomainName(String domainName);
-
- public String getDomainType(String domainName, AmqpVersion version);
-
- public String getGeneratedType(String domainName, AmqpVersion version);
-
- public String prepareConstantName(String constantName);
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Main.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Main.java
deleted file mode 100644
index c0584f7ca7..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Main.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import org.apache.velocity.app.Velocity;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Properties;
-
-public class Main
-{
- private static final String DEFAULT_OUTPUT_DIR = ".." + Utils.FILE_SEPARATOR + "gen";
- private static final String DEFAULT_TEMPLATE_DIR_BASE = ".." + Utils.FILE_SEPARATOR;
-
- private enum GeneratedLanguage
- {
- CPP(".cpp", CppGenerator.getFactory()),
- DOTNET(".net", DotnetGenerator.getFactory()),
- JAVA(".java", JavaGenerator.getFactory());
-
- private final String _suffix;
- private final Generator.Factory _factory;
-
-
- private final String _defaultTemplateDirectory;
-
- GeneratedLanguage(String suffix, Generator.Factory factory)
- {
- _suffix = suffix;
- _factory = factory;
- _defaultTemplateDirectory = DEFAULT_TEMPLATE_DIR_BASE + "templ" + _suffix;
- }
-
- public String getSuffix()
- {
- return _suffix;
- }
-
- public Generator newGenerator()
- {
- return _factory.newInstance();
- }
-
- public String getDefaultTemplateDirectory()
- {
- return _defaultTemplateDirectory;
- }
- }
-
- private Generator generator;
-
- private String outDir;
- private String tmplDir;
- private GeneratedLanguage _generatorLang;
- private ArrayList<String> xmlFiles;
-
- public Main()
- {
- xmlFiles = new ArrayList<String>();
- }
-
- public void run(String[] args)
- throws Exception,
- SAXException,
- AmqpParseException,
- AmqpTypeMappingException,
- AmqpTemplateException,
- TargetDirectoryException,
- IllegalAccessException,
- InvocationTargetException, ParserConfigurationException
- {
-
- // 0. Initialize
- outDir = DEFAULT_OUTPUT_DIR;
- tmplDir = null;
- _generatorLang = GeneratedLanguage.CPP; // Default generation language
- xmlFiles.clear();
- processArgs(args);
-
- if (tmplDir == null)
- {
- tmplDir = _generatorLang.getDefaultTemplateDirectory();
- }
-
-
- generator = _generatorLang.newGenerator();
- generator.setTemplateDirectory(tmplDir);
- generator.setOutputDirectory(outDir);
-
- // 1. Suck in all the XML spec files provided on the command line
- analyzeXML();
-
- Properties p = new Properties();
- p.setProperty("file.resource.loader.path", tmplDir);
-
- Velocity.init(p);
-
- // 2. Load up all templates
- generator.initializeTemplates();
-
- // 3. Generate output
- generator.generate();
-
- System.out.println("Files generated: " + generator.getNumberGeneratedFiles());
- System.out.println("Done.");
- }
-
- private void processArgs(String[] args)
- {
- // Crude but simple...
- for (int i = 0; i < args.length; i++)
- {
- String arg = args[i];
- if (arg.charAt(0) == '-')
- {
- switch (arg.charAt(1))
- {
- case'c':
- case'C':
- _generatorLang = GeneratedLanguage.CPP;
- break;
- case'j':
- case'J':
- _generatorLang = GeneratedLanguage.JAVA;
- break;
- case'n':
- case'N':
- _generatorLang = GeneratedLanguage.DOTNET;
- break;
- case'o':
- case'O':
- if (++i < args.length)
- {
- outDir = args[i];
- }
- break;
- case't':
- case'T':
- if (++i < args.length)
- {
- tmplDir = args[i];
- }
- break;
- }
- }
- else
- {
- xmlFiles.add(args[i]);
- }
- }
- }
-
- private void analyzeXML()
- throws IOException, SAXException, AmqpParseException, AmqpTypeMappingException, ParserConfigurationException
- {
- DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
-
- System.out.println("XML files: " + xmlFiles);
- for (String filename : xmlFiles)
- {
- File f = new File(filename);
- if (f.exists())
- {
- // 1a. Initialize dom
- System.out.print(" \"" + filename + "\":");
- Document doc = docBuilder.parse(new File(filename));
- Node amqpNode = Utils.findChild(doc, Utils.ELEMENT_AMQP);
-
- // 1b. Extract version (major and minor) from the XML file
- int major = Utils.getNamedIntegerAttribute(amqpNode, Utils.ATTRIBUTE_MAJOR);
- int minor = Utils.getNamedIntegerAttribute(amqpNode, Utils.ATTRIBUTE_MINOR);
- AmqpVersion version = new AmqpVersion(major, minor);
- System.out.println(" Found version " + version.toString() + ".");
- generator.addVersion(version);
- generator.addFromNode(amqpNode, version);
-
-
- }
- else
- {
- System.err.println("ERROR: AMQP XML file \"" + filename + "\" not found.");
- }
- }
-// *** DEBUG INFO *** Uncomment bits from this block to see lots of stuff....
-// System.out.println();
-// System.out.println("*** Debug output ***");
-// System.out.println();
-// versionSet.print(System.out, 0, 2); // List of loaded versions
-// System.out.println();
-// constants.print(System.out, 0, 2); // List of constants
-// System.out.println();
-// domainMap.print(System.out, 0, 2); // List of domains
-// System.out.println();
-// model.print(System.out, 0, 2); // Internal version map model
-// System.out.println();
-// System.out.println("*** End debug output ***");
-// System.out.println();
- }
-
- public static void main(String[] args)
- {
- int exitCode = 1;
- // TODO: This is a simple and klunky way of hangling command-line args, and could be improved upon.
- if (args.length < 2)
- {
- usage();
- }
- else
- {
- try
- {
- new Main().run(args);
- exitCode = 0;
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- catch (ParserConfigurationException e)
- {
- e.printStackTrace();
- }
- catch (SAXException e)
- {
- e.printStackTrace();
- }
- catch (AmqpParseException e)
- {
- e.printStackTrace();
- }
- catch (AmqpTypeMappingException e)
- {
- e.printStackTrace();
- }
- catch (AmqpTemplateException e)
- {
- e.printStackTrace();
- }
- catch (TargetDirectoryException e)
- {
- e.printStackTrace();
- }
- catch (IllegalAccessException e)
- {
- e.printStackTrace();
- }
- catch (InvocationTargetException e)
- {
- e.printStackTrace();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
- System.exit(exitCode);
- }
-
- public static void usage()
- {
- System.out.println("AMQP XML generator v.0.0");
- System.out.println("Usage: Main -c|-j [-o outDir] [-t tmplDir] XMLfile [XMLfile ...]");
- System.out.println(" where -c: Generate C++.");
- System.out.println(" -j: Generate Java.");
- System.out.println(" -n: Generate .NET.");
- System.out.println(" -o outDir: Use outDir as the output dir (default=\"" + DEFAULT_OUTPUT_DIR + "\").");
- System.out.println(" -t tmplDir: Find templates in tmplDir.");
- System.out.println(" Defaults: \"" + GeneratedLanguage.CPP.getDefaultTemplateDirectory() + "\" for C++;");
- System.out.println(" \"" + GeneratedLanguage.JAVA.getDefaultTemplateDirectory() + "\" for java.;");
- System.out.println(" \"" + GeneratedLanguage.DOTNET.getDefaultTemplateDirectory() + "\" for .NET.");
- System.out.println(" XMLfile is a space-separated list of AMQP XML files to be parsed.");
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/MangledGenerateMethod.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/MangledGenerateMethod.java
deleted file mode 100644
index ffeefed900..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/MangledGenerateMethod.java
+++ /dev/null
@@ -1,26 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-public interface MangledGenerateMethod
-{
- String generate(AmqpField field, int indentSize, int tabSize, boolean notLast);
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/NodeAware.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/NodeAware.java
deleted file mode 100644
index f832da75ad..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/NodeAware.java
+++ /dev/null
@@ -1,47 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import org.w3c.dom.Node;
-
-/**
- * @author kpvdr
- * Interface allowing the addition of elements from a node in the
- * DOM of the AMQP specification. It is used by each of the model
- * elements in a recursive fashion to build the model.
- */
-public interface NodeAware
-{
- /**
- * Add a model element from the current DOM node. All model elements must implement
- * this interface. If the node contains children that are also a part of the model,
- * then this method is called on new instances of those model elements.
- *
- * @param n Node from which the current model element is to be added.
- * @param o Ordinal value of the current model elemet.
- * @param v Verion of the DOM from which the node comes.
- * @throws AmqpParseException
- * @throws AmqpTypeMappingException
- * @returns true if a node was added, false if not
- */
- public boolean addFromNode(Node n, int o, AmqpVersion v)
- throws AmqpParseException, AmqpTypeMappingException;
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Printable.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Printable.java
deleted file mode 100644
index aa13df7b68..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Printable.java
+++ /dev/null
@@ -1,28 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.io.PrintStream;
-
-public interface Printable
-{
- public void print(PrintStream out, int marginSize, int tabSize);
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionClass.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionClass.java
deleted file mode 100644
index 8e1af1c551..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionClass.java
+++ /dev/null
@@ -1,103 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.Map;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Map.Entry;
-
-
-public class SingleVersionClass
-{
- private final int _classId;
-
-
- private final AmqpClass _amqpClass;
- private final AmqpVersion _amqpVersion;
- private final Generator _generator;
- private final List<SingleVersionMethod> _methodList = new ArrayList<SingleVersionMethod>();
-
- public SingleVersionClass(AmqpClass amqpClass, AmqpVersion amqpVersion, Generator generator)
- {
- _amqpClass = amqpClass;
- _amqpVersion = amqpVersion;
- _generator = generator;
-
- AmqpOrdinalVersionMap indexMap = amqpClass.getIndexMap();
- int classId = 0;
- for(Entry<Integer, AmqpVersionSet> entry : indexMap.entrySet())
- {
- if(entry.getValue().contains(_amqpVersion))
- {
- classId = entry.getKey();
- break;
- }
- }
- _classId = classId;
-
-
- Collection<AmqpMethod> methods = _amqpClass.getMethodMap().values();
-
- for(AmqpMethod amqpMethod : methods)
- {
- _methodList.add(new SingleVersionMethod(amqpMethod, _amqpVersion, _generator));
-
- }
-
- Collections.sort(_methodList, new Comparator<SingleVersionMethod>(){
- public int compare(SingleVersionMethod method1, SingleVersionMethod method2)
- {
- return method1.getMethodId() - method2.getMethodId();
- }
- });
-
-
- }
-
- public int getClassId()
- {
- return _classId;
- }
-
- public String getName()
- {
- return _amqpClass.getName();
- }
-
-
-
-
-
- public List<SingleVersionMethod> getMethodList()
- {
- return _methodList;
- }
-
-
- public int getMaximumMethodId()
- {
- return _methodList.get(_methodList.size()-1).getMethodId();
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionField.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionField.java
deleted file mode 100644
index b795663d15..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionField.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-
-public class SingleVersionField
-{
- private final AmqpField _field;
- private final AmqpVersion _amqpVersion;
- private final Generator _generator;
-
- public SingleVersionField(AmqpField field, AmqpVersion amqpVersion, Generator generator)
- {
- _field = field;
- _amqpVersion = amqpVersion;
- _generator = generator;
- }
-
- public String getName()
- {
- return _field.getName();
- }
-
- public String getDomain()
- {
- return _field.getDomain(_amqpVersion);
- }
-
-
- public String getDomainType()
- {
- return _generator.getDomainType(_field.getDomain(_amqpVersion),_amqpVersion);
- }
-
- public String getNativeType()
- {
- return _generator.getNativeType(getDomainType());
- }
-
- public String getEncodingType()
- {
- return _generator.getEncodingType(getDomainType());
- }
-
-
- public int getPosition()
- {
- return _field.getOrdinal(_amqpVersion);
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionMethod.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionMethod.java
deleted file mode 100644
index 59a6d9e28a..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionMethod.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.Map.Entry;
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-
-public class SingleVersionMethod
-{
- private final AmqpMethod _amqpMethod;
- private final AmqpVersion _amqpVersion;
- private final int _methodId;
- private final List<SingleVersionField> _fieldList = new ArrayList<SingleVersionField>();
- private final Generator _generator;
- private final List<ConsolidatedField> _consolidatedFields = new ArrayList<ConsolidatedField>();
- private final Map<String, ConsolidatedField> _fieldNameToConsolidatedFieldMap = new HashMap<String, ConsolidatedField>();
-
-
- public SingleVersionMethod(AmqpMethod amqpMethod, AmqpVersion amqpVersion, Generator generator)
- {
- _amqpMethod = amqpMethod;
- _amqpVersion = amqpVersion;
- _generator = generator;
-
- AmqpOrdinalVersionMap indexMap = amqpMethod.getIndexMap();
- int methodId = 0;
- for(Entry<Integer, AmqpVersionSet> entry : indexMap.entrySet())
- {
- if(entry.getValue().contains(_amqpVersion))
- {
- methodId = entry.getKey();
- break;
- }
- }
- _methodId = methodId;
-
- Collection<AmqpField> fields = _amqpMethod.getFieldMap().values();
-
- for(AmqpField field : fields)
- {
- _fieldList.add(new SingleVersionField(field, _amqpVersion, _generator));
-
- }
-
- Collections.sort(_fieldList, new Comparator<SingleVersionField>(){
- public int compare(SingleVersionField field1, SingleVersionField field2)
- {
- return field1.getPosition() - field2.getPosition();
- }
- });
-
-
-
- ConsolidatedField lastField = null;
- int bitfieldNum = 0;
- for(SingleVersionField field : _fieldList)
- {
- String domainType = field.getDomainType();
- if(!domainType.equals("bit"))
- {
- lastField = new ConsolidatedField(_generator,
- field.getName(),
- field.getDomainType());
- _consolidatedFields.add(lastField);
- }
- else if(lastField == null || !lastField.getType().equals("bitfield"))
- {
- lastField = new ConsolidatedField(_generator,
- domainType.equals("bit") ? "bitfield"+bitfieldNum++ : field.getName(),
- domainType.equals("bit") ? "bitfield" : field.getDomainType(),
- field.getName());
- _consolidatedFields.add(lastField);
- }
- else
- {
- lastField.add(field.getName());
- }
- _fieldNameToConsolidatedFieldMap.put(field.getName(), lastField);
-
- }
- }
-
- public int getMethodId()
- {
- return _methodId;
- }
-
- public String getName()
- {
- return _amqpMethod.getName();
- }
-
- public Collection<SingleVersionField> getFieldList()
- {
- return Collections.unmodifiableCollection(_fieldList);
- }
-
- public List<ConsolidatedField> getConsolidatedFields()
- {
- return _consolidatedFields;
- }
-
- public String getConsolidatedFieldName(String fieldName)
- {
- return _fieldNameToConsolidatedFieldMap.get(fieldName).getName();
- }
-
- public boolean isConsolidated(String fieldName)
- {
- return _fieldNameToConsolidatedFieldMap.get(fieldName).isConsolidated();
- }
-
- public int getPositionInBitField(String fieldName)
- {
- return _fieldNameToConsolidatedFieldMap.get(fieldName).getPosition(fieldName);
- }
-
-
- public boolean isServerMethod()
- {
- return _amqpMethod.isServerMethod(_amqpVersion);
- }
-
-
- public boolean isClientMethod()
- {
- return _amqpMethod.isClientMethod(_amqpVersion);
- }
-
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionModel.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionModel.java
deleted file mode 100644
index 22b416e45a..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/SingleVersionModel.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-
-
-public class SingleVersionModel
-{
- private final AmqpModel _amqpModel;
- private final AmqpVersion _amqpVersion;
- private final Generator _generator;
- private final List<SingleVersionClass> _classList = new ArrayList<SingleVersionClass>();
-
- public SingleVersionModel(AmqpModel amqpModel, AmqpVersion amqpVersion, Generator generator)
- {
- _amqpModel = amqpModel;
- _amqpVersion = amqpVersion;
- _generator = generator;
-
-
- Collection<AmqpClass> originalClasses = _amqpModel.getClassMap().values();
-
- for(AmqpClass amqpClass : originalClasses)
- {
- _classList.add(new SingleVersionClass(amqpClass, _amqpVersion, _generator));
-
- }
-
- Collections.sort(_classList, new Comparator<SingleVersionClass>(){
- public int compare(SingleVersionClass amqpClass1, SingleVersionClass amqpClass2)
- {
- return amqpClass1.getClassId() - amqpClass2.getClassId();
- }
- });
-
-
- }
-
- public Collection<SingleVersionClass> getClassList()
- {
- return Collections.unmodifiableCollection(_classList);
- }
-
- public int getMaximumClassId()
- {
- return _classList.get(_classList.size()-1).getClassId();
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/TargetDirectoryException.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/TargetDirectoryException.java
deleted file mode 100644
index 39ce666288..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/TargetDirectoryException.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-@SuppressWarnings("serial")
-public class TargetDirectoryException extends RuntimeException
-{
- public TargetDirectoryException(String msg)
- {
- super(msg);
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Utils.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Utils.java
deleted file mode 100644
index 1cedaeea12..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/Utils.java
+++ /dev/null
@@ -1,159 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class Utils
-{
- public final static String FILE_SEPARATOR = System.getProperty("file.separator");
- public final static String LINE_SEPARATOR = System.getProperty("line.separator");
-
- public final static String ATTRIBUTE_NAME = "name";
- public final static String ATTRIBUTE_MAJOR = "major";
- public final static String ATTRIBUTE_MINOR = "minor";
- public final static String ATTRIBUTE_INDEX = "index";
- public final static String ATTRIBUTE_LABEL = "label";
- public final static String ATTRIBUTE_SYNCHRONOUS = "synchronous";
- public final static String ATTRIBUTE_CONTENT = "content";
- public final static String ATTRIBUTE_HANDLER = "handler";
- public final static String ATTRIBUTE_DOMAIN = "domain";
- public final static String ATTRIBUTE_VALUE = "value";
- public final static String ATTRIBUTE_TYPE = "type"; // For compatibility with AMQP 8.0
-
- public final static String ELEMENT_AMQP = "amqp";
- public final static String ELEMENT_CHASSIS = "chassis";
- public final static String ELEMENT_CLASS = "class";
- public final static String ELEMENT_CODEGEN = "codegen";
- public final static String ELEMENT_CONSTANT = "constant";
- public final static String ELEMENT_DOMAIN = "domain";
- public final static String ELEMENT_METHOD = "method";
- public final static String ELEMENT_FIELD = "field";
- public final static String ELEMENT_VERSION = "version";
-
- // Attribute functions
-
- public static String getNamedAttribute(Node n, String attrName) throws AmqpParseException
- {
- NamedNodeMap nnm = n.getAttributes();
- if (nnm == null)
- {
- throw new AmqpParseException("Node \"" + n.getNodeName() + "\" has no attributes.");
- }
- Attr a = (Attr) nnm.getNamedItem(attrName);
- if (a == null)
- {
- throw new AmqpParseException("Node \"" + n.getNodeName() + "\" has no attribute \"" + attrName + "\".");
- }
- return a.getNodeValue();
- }
-
- public static int getNamedIntegerAttribute(Node n, String attrName) throws AmqpParseException
- {
- return Integer.parseInt(getNamedAttribute(n, attrName));
- }
-
- // Element functions
-
- public static Node findChild(Node n, String eltName) throws AmqpParseException
- {
- NodeList nl = n.getChildNodes();
- for (int i = 0; i < nl.getLength(); i++)
- {
- Node cn = nl.item(i);
- if (cn.getNodeName().compareTo(eltName) == 0)
- {
- return cn;
- }
- }
- throw new AmqpParseException("Node \"" + n.getNodeName() +
- "\" does not contain child element \"" + eltName + "\".");
- }
-
- // String functions
-
- public static String firstUpper(String str)
- {
- if (!Character.isLetter(str.charAt(0)) || !Character.isLowerCase(str.charAt(0)))
- {
- return str;
- }
- StringBuffer sb = new StringBuffer(str);
- sb.setCharAt(0, Character.toUpperCase(str.charAt(0)));
- return sb.toString();
- }
-
- public static String firstLower(String str)
- {
- if (!Character.isUpperCase(str.charAt(0)))
- {
- return str;
- }
- StringBuffer sb = new StringBuffer(str);
- sb.setCharAt(0, Character.toLowerCase(str.charAt(0)));
- return sb.toString();
- }
-
- public static String createSpaces(int cnt)
- {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < cnt; i++)
- {
- sb.append(' ');
- }
- return sb.toString();
- }
-
- public static boolean containsOnlyDigits(String str)
- {
- boolean foundNonDigit = false;
- for (int i = 0; i < str.length() && !foundNonDigit; i++)
- {
- if (!Character.isDigit(str.charAt(i)))
- {
- foundNonDigit = true;
- }
- }
- return !foundNonDigit;
- }
-
- public static boolean containsOnlyDigitsAndDecimal(String str)
- {
- boolean foundNonDigit = false;
- int decimalCntr = 0;
- for (int i = 0; i < str.length() && !foundNonDigit && decimalCntr < 2; i++)
- {
- char ch = str.charAt(i);
- if (!(Character.isDigit(ch) || ch == '.'))
- {
- foundNonDigit = true;
- }
- else if (ch == '.')
- {
- decimalCntr++;
- }
- }
- return !foundNonDigit && decimalCntr < 2;
- }
-}
diff --git a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/VersionConsistencyCheck.java b/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/VersionConsistencyCheck.java
deleted file mode 100644
index a9cdd56e88..0000000000
--- a/M4-RCs/qpid/gentools/src/org/apache/qpid/gentools/VersionConsistencyCheck.java
+++ /dev/null
@@ -1,26 +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.
- *
- */
-package org.apache.qpid.gentools;
-
-public interface VersionConsistencyCheck
-{
- public boolean isVersionConsistent(AmqpVersionSet globalVersionSet);
-}
diff --git a/M4-RCs/qpid/gentools/templ.cpp/method/MethodBodyClass.h.tmpl b/M4-RCs/qpid/gentools/templ.cpp/method/MethodBodyClass.h.tmpl
deleted file mode 100644
index 5819a9cf9c..0000000000
--- a/M4-RCs/qpid/gentools/templ.cpp/method/MethodBodyClass.h.tmpl
+++ /dev/null
@@ -1,112 +0,0 @@
-&{${CLASS}${METHOD}Body.h}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-#ifndef qpid_framing_${CLASS}${METHOD}Body__
-#define qpid_framing_${CLASS}${METHOD}Body__
-
-#include <string>
-#include <sstream>
-
-#include <amqp_types.h>
-#include <AMQMethodBody.h>
-#include <Buffer.h>
-#include <FieldTable.h>
-
-namespace qpid
-{
-namespace framing
-{
-${version_namespace_start}
-
-class ${CLASS}${METHOD}Body : public AMQMethodBody
-{
- // Method field declarations
-
-%{FLIST} ${mb_field_declaration}
-
-
-public:
- typedef boost::shared_ptr<${CLASS}${METHOD}Body> shared_ptr;
-
- // Constructors and destructors
-
-${mb_constructor_with_initializers}
-
- inline ${CLASS}${METHOD}Body(u_int8_t major, u_int8_t minor): AMQMethodBody(major, minor) {}
- inline ${CLASS}${METHOD}Body(ProtocolVersion& version): AMQMethodBody(version) {}
- virtual ~${CLASS}${METHOD}Body() {}
-
- // Attribute get methods
-
-%{FLIST} ${mb_field_get_method}
-
- // Helper methods
-
- inline void print(std::ostream& out) const
- {
- out << "${CLASS}${METHOD}: ";
-%{FLIST} ${mb_field_print}
- }
-
- inline u_int16_t amqpClassId() const
- {
- return ${CLASS_ID_INIT};
- }
-
- inline u_int16_t amqpMethodId() const
- {
- return ${METHOD_ID_INIT};
- }
-
- inline u_int32_t bodySize() const
- {
- u_int32_t size = 0;
-%{FLIST} ${mb_body_size}
- return size;
- }
-
- inline void encodeContent(Buffer&${mb_buffer_param}) const
- {
-%{FLIST} ${mb_encode}
- }
-
- inline void decodeContent(Buffer&${mb_buffer_param})
- {
-%{FLIST} ${mb_decode}
- }
-
-${mb_server_operation_invoke}
-
-}; // class ${CLASS}${METHOD}Body
-
-${version_namespace_end}
-} // namespace framing
-} // namespace qpid
-
-#endif
-
diff --git a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientOperations.h.tmpl b/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientOperations.h.tmpl
deleted file mode 100644
index a9fb0e0f69..0000000000
--- a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientOperations.h.tmpl
+++ /dev/null
@@ -1,82 +0,0 @@
-&{AMQP_ClientOperations.h}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-#ifndef qpid_framing_AMQP_ClientOperations__
-#define qpid_framing_AMQP_ClientOperations__
-
-#include <sstream>
-
-#include <FieldTable.h>
-#include <ProtocolVersion.h>
-#include <ProtocolVersionException.h>
-
-namespace qpid {
-namespace framing {
-
-class AMQP_ClientProxy;
-
-class AMQP_ClientOperations
-{
-protected:
- ProtocolVersion version;
- AMQP_ClientOperations() {}
-
-public:
- AMQP_ClientOperations(u_int8_t major, u_int8_t minor) : version(major, minor) {}
- AMQP_ClientOperations(ProtocolVersion& version) : version(version) {}
- virtual ~AMQP_ClientOperations() {}
-
- inline u_int8_t getMajor() const { return version.getMajor(); }
- inline u_int8_t getMinor() const { return version.getMinor(); }
- inline const ProtocolVersion& getVersion() const { return version; }
- inline bool isVersion(u_int8_t _major, u_int8_t _minor) const
- {
- return version.equals(_major, _minor);
- }
- inline bool isVersion(ProtocolVersion& _version) const
- {
- return version.equals(_version);
- }
-
- // Include framing constant declarations
- #include <AMQP_Constants.h>
-
- // Inner classes
-
-%{CLIST} ${coh_inner_class}
-
- // Method handler get methods
-
-%{CLIST} ${coh_method_handler_get_method}
-
-}; /* class AMQP_ClientOperations */
-
-} /* namespace framing */
-} /* namespace qpid */
-
-#endif
diff --git a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientProxy.cpp.tmpl b/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientProxy.cpp.tmpl
deleted file mode 100644
index 8cca6e5cec..0000000000
--- a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientProxy.cpp.tmpl
+++ /dev/null
@@ -1,52 +0,0 @@
-&{AMQP_ClientProxy.cpp}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-#include <sstream>
-
-#include <AMQP_ClientProxy.h>
-#include <AMQFrame.h>
-%{MLIST} ${cpc_method_body_include}
-
-namespace qpid {
-namespace framing {
-
-AMQP_ClientProxy::AMQP_ClientProxy(OutputHandler* out, u_int8_t major, u_int8_t minor) :
-%{CLIST} ${cpc_constructor_initializer}
-
-{}
-
- // Inner class instance get methods
-
-%{CLIST} ${cpc_inner_class_get_method}
-
- // Inner class implementation
-
-%{CLIST} ${cpc_inner_class_impl}
-
-} /* namespace framing */
-} /* namespace qpid */
diff --git a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientProxy.h.tmpl b/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientProxy.h.tmpl
deleted file mode 100644
index 0653ed7186..0000000000
--- a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ClientProxy.h.tmpl
+++ /dev/null
@@ -1,75 +0,0 @@
-&{AMQP_ClientProxy.h}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-#ifndef qpid_framing_AMQP_ClientProxy__
-#define qpid_framing_AMQP_ClientProxy__
-
-#include <AMQP_ClientOperations.h>
-#include <FieldTable.h>
-#include <OutputHandler.h>
-
-namespace qpid {
-namespace framing {
-
-class AMQP_ClientProxy : public AMQP_ClientOperations
-{
-private:
-
- ProtocolVersion version;
- OutputHandler* out;
-%{CLIST} ${cph_handler_pointer_defn}
-
-public:
- AMQP_ClientProxy(OutputHandler* out, u_int8_t major, u_int8_t minor);
- ProtocolVersion& getProtocolVersion() {return version;}
- virtual ~AMQP_ClientProxy() {}
-
- // Get methods for handlers
-
-%{CLIST} ${cph_handler_pointer_get_method}
-
- // Inner class definitions
-
-%{CLIST} ${cph_inner_class_defn}
-
-private:
- // Inner class instances
-
-%{CLIST} ${cph_inner_class_instance}
-
-public:
- // Inner class instance get methods
-
-%{CLIST} ${cph_inner_class_get_method}
-
-}; /* class AMQP_ClientProxy */
-
-} /* namespace framing */
-} /* namespace qpid */
-
-#endif
diff --git a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_Constants.h.tmpl b/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_Constants.h.tmpl
deleted file mode 100644
index 4631bc8de6..0000000000
--- a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_Constants.h.tmpl
+++ /dev/null
@@ -1,34 +0,0 @@
-&{AMQP_Constants.h}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
- // NOTE: This file is intended to be included within the class structure of both
- // the client and server operations classes. These need to have <sstream> included.
-
- // Constant getValue methods
-
-%{TLIST} ${ch_get_value_method}
- \ No newline at end of file
diff --git a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_HighestVersion.h.tmpl b/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_HighestVersion.h.tmpl
deleted file mode 100644
index 9753b454ba..0000000000
--- a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_HighestVersion.h.tmpl
+++ /dev/null
@@ -1,42 +0,0 @@
-&{AMQP_HighestVersion.h}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-#ifndef qpid_framing_highestProtocolVersion__
-#define qpid_framing_highestProtocolVersion__
-
-#include <ProtocolVersion.h>
-
-
-namespace qpid {
-namespace framing {
-
-static ProtocolVersion highestProtocolVersion(${hv_latest_major}, ${hv_latest_minor});
-
-} /* namespace framing */
-} /* namespace qpid */
-
-#endif
diff --git a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_MethodVersionMap.cpp.tmpl b/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_MethodVersionMap.cpp.tmpl
deleted file mode 100644
index dc2a890c88..0000000000
--- a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_MethodVersionMap.cpp.tmpl
+++ /dev/null
@@ -1,62 +0,0 @@
-&{AMQP_MethodVersionMap.cpp}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-#include <sstream>
-
-#include <AMQP_MethodVersionMap.h>
-
-namespace qpid
-{
-namespace framing
-{
-
-AMQP_MethodVersionMap::AMQP_MethodVersionMap()
-{
-%{CLIST} ${mc_create_method_body_map_entry}
-}
-
-AMQMethodBody* AMQP_MethodVersionMap::createMethodBody(u_int16_t classId, u_int16_t methodId, u_int8_t major, u_int8_t minor)
-{
- iterator itr = find(createMapKey(classId, methodId, major, minor));
- if (itr == end())
- {
- std::stringstream ss;
- ss << "Unable to find MethodBody class for classId = " << classId << ", methodId = " <<
- methodId << ", AMQ protocol version = " << major << "-" << minor << ".";
- throw ProtocolVersionException(ss.str());
- }
- return (itr->second)(major, minor);
-}
-
-u_int64_t AMQP_MethodVersionMap::createMapKey(u_int16_t classId, u_int16_t methodId, u_int8_t major, u_int8_t minor)
-{
- return ((u_int64_t)classId<<48) + ((u_int64_t)methodId<<32) + ((u_int64_t)major<<16) + minor;
-}
-
-} /* namespace framing */
-} /* namespace qpid */
diff --git a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_MethodVersionMap.h.tmpl b/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_MethodVersionMap.h.tmpl
deleted file mode 100644
index c197871d4b..0000000000
--- a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_MethodVersionMap.h.tmpl
+++ /dev/null
@@ -1,57 +0,0 @@
-&{AMQP_MethodVersionMap.h}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-#ifndef qpid_framing_AMQP_MethodVersionMap__
-#define qpid_framing_AMQP_MethodVersionMap__
-
-#include <map>
-#include <AMQMethodBody.h>
-
-%{MLIST} ${mc_method_body_include}
-
-namespace qpid
-{
-namespace framing
-{
-
-template <class T> AMQMethodBody* createMethodBodyFn(u_int8_t major, u_int8_t minor) { return new T(major, minor); }
-typedef AMQMethodBody* (*fnPtr)(u_int8_t, u_int8_t);
-
-class AMQP_MethodVersionMap: public std::map<u_int64_t, fnPtr>
-{
-protected:
- u_int64_t createMapKey(u_int16_t classId, u_int16_t methodId, u_int8_t major, u_int8_t minor);
-public:
- AMQP_MethodVersionMap();
- AMQMethodBody* createMethodBody(u_int16_t classId, u_int16_t methodId, u_int8_t major, u_int8_t minor);
-};
-
-} /* namespace framing */
-} /* namespace qpid */
-
-#endif
diff --git a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerOperations.h.tmpl b/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerOperations.h.tmpl
deleted file mode 100644
index e87723667b..0000000000
--- a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerOperations.h.tmpl
+++ /dev/null
@@ -1,83 +0,0 @@
-&{AMQP_ServerOperations.h}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-#ifndef qpid_framing_AMQP_ServerOperations__
-#define qpid_framing_AMQP_ServerOperations__
-
-#include <sstream>
-
-#include <FieldTable.h>
-#include <ProtocolVersion.h>
-#include <ProtocolVersionException.h>
-
-namespace qpid {
-namespace framing {
-
-class AMQP_ServerProxy;
-class AMQP_ClientProxy;
-
-class AMQP_ServerOperations
-{
-protected:
- ProtocolVersion version;
- AMQP_ServerOperations() {}
-
-public:
- AMQP_ServerOperations(u_int8_t major, u_int8_t minor) : version(major, minor) {}
- AMQP_ServerOperations(ProtocolVersion& version) : version(version) {}
- virtual ~AMQP_ServerOperations() {}
-
- inline u_int8_t getMajor() const { return version.getMajor(); }
- inline u_int8_t getMinor() const { return version.getMinor(); }
- inline const ProtocolVersion& getVersion() const { return version; }
- inline bool isVersion(u_int8_t _major, u_int8_t _minor) const
- {
- return version.equals(_major, _minor);
- }
- inline bool isVersion(ProtocolVersion& _version) const
- {
- return version.equals(_version);
- }
-
- // Include framing constant declarations
- #include <AMQP_Constants.h>
-
- // Inner classes
-
-%{CLIST} ${soh_inner_class}
-
- // Method handler get methods
-
-%{CLIST} ${soh_method_handler_get_method}
-
-}; /* class AMQP_ServerOperations */
-
-} /* namespace framing */
-} /* namespace qpid */
-
-#endif
diff --git a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerProxy.cpp.tmpl b/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerProxy.cpp.tmpl
deleted file mode 100644
index cce369f98b..0000000000
--- a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerProxy.cpp.tmpl
+++ /dev/null
@@ -1,51 +0,0 @@
-&{AMQP_ServerProxy.cpp}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-#include <sstream>
-
-#include <AMQP_ServerProxy.h>
-#include <AMQFrame.h>
-%{MLIST} ${spc_method_body_include}
-
-namespace qpid {
-namespace framing {
-
-AMQP_ServerProxy::AMQP_ServerProxy(OutputHandler* out, u_int8_t major, u_int8_t minor) :
-%{CLIST} ${spc_constructor_initializer}
-{}
-
- // Inner class instance get methods
-
-%{CLIST} ${spc_inner_class_get_method}
-
- // Inner class implementation
-
-%{CLIST} ${spc_inner_class_impl}
-
-} /* namespace framing */
-} /* namespace qpid */
diff --git a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerProxy.h.tmpl b/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerProxy.h.tmpl
deleted file mode 100644
index fab29f2c60..0000000000
--- a/M4-RCs/qpid/gentools/templ.cpp/model/AMQP_ServerProxy.h.tmpl
+++ /dev/null
@@ -1,74 +0,0 @@
-&{AMQP_ServerProxy.h}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-#ifndef qpid_framing_AMQP_ServerProxy__
-#define qpid_framing_AMQP_ServerProxy__
-
-#include <AMQP_ServerOperations.h>
-#include <FieldTable.h>
-#include <OutputHandler.h>
-
-namespace qpid {
-namespace framing {
-
-class AMQP_ServerProxy : public AMQP_ServerOperations
-{
-private:
- ProtocolVersion version;
- OutputHandler* out;
-%{CLIST} ${sph_handler_pointer_defn}
-
-public:
- AMQP_ServerProxy(OutputHandler* out, u_int8_t major, u_int8_t minor);
- ProtocolVersion& getProtocolVersion() {return version;}
- virtual ~AMQP_ServerProxy() {}
-
- // Get methods for handlers
-
-%{CLIST} ${sph_handler_pointer_get_method}
-
- // Inner class definitions
-
-%{CLIST} ${sph_inner_class_defn}
-
-private:
- // Inner class instances
-
-%{CLIST} ${sph_inner_class_instance}
-
-public:
- // Inner class instance get methods
-
-%{CLIST} ${sph_inner_class_get_method}
-
-}; /* class AMQP_ServerProxy */
-
-} /* namespace framing */
-} /* namespace qpid */
-
-#endif
diff --git a/M4-RCs/qpid/gentools/templ.java/PropertyContentHeaderClass.tmpl b/M4-RCs/qpid/gentools/templ.java/PropertyContentHeaderClass.tmpl
deleted file mode 100644
index ab6406b1fe..0000000000
--- a/M4-RCs/qpid/gentools/templ.java/PropertyContentHeaderClass.tmpl
+++ /dev/null
@@ -1,208 +0,0 @@
-&{${CLASS}ContentHeaderProperties.java}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-package org.apache.qpid.framing;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.mina.common.ByteBuffer;
-
-public class ${CLASS}ContentHeaderProperties implements ContentHeaderProperties
-{
- private static final Logger logger = LoggerFactory.getLogger(BasicContentHeaderProperties.class);
-
- /**
- * We store the encoded form when we decode the content header so that if we need to
- * write it out without modifying it we can do so without incurring the expense of
- * reencoding it.
- */
- private byte[] encodedBuffer;
-
- /**
- * Flag indicating whether the entire content header has been decoded yet.
- */
- private boolean decodedFlag = true;
-
- /**
- * We have some optimisations for partial decoding for maximum performance. The
- * headers are used in the broker for routing in some cases so we can decode that
- * separately.
- */
- private boolean decodedHeadersFlag = true;
-
- /**
- * We have some optimisations for partial decoding for maximum performance. The
- * content type is used by all clients to determine the message type.
- */
- private boolean decodedContentTypeFlag = true;
-
- /**
- * AMQP major and minor version of this instance.
- */
- private byte major;
- private byte minor;
-
- /**
- * Property flags.
- */
- ${pch_property_flags_declare}
-
- // Header fields from specification
-%{FLIST} ${field_declaration}
-
- /**
- * Constructor
- */
- public ${CLASS}ContentHeaderProperties(byte major, byte minor)
- {
- this.major = major;
- this.minor = minor;
-
- // Although one flag is initialized per property, the flags are used
- // in ordinal order of the AMQP version represented by this instance,
- // thus the number of flags actually used may be less than the total
- // number defined.
- ${pch_property_flags_initializer}
- }
-
- public int getPropertyListSize()
- {
- if (encodedBuffer != null)
- {
- return encodedBuffer.length;
- }
- else
- {
- int size = 0;
-%{FLIST} ${pch_field_list_size}
- return size;
- }
- }
-
- private void clearEncodedForm()
- {
- if (!decodedFlag && encodedBuffer != null)
- {
- //decode();
- }
- encodedBuffer = null;
- }
-
- public void setPropertyFlags(int[] compactPropertyFlags)
- throws AMQProtocolVersionException
- {
- clearEncodedForm();
-${pch_compact_property_flags_check}
-%{FLIST} ${pch_set_compact_property_flags}
- }
-
- public int[] getPropertyFlags()
- {
- int[] compactPropertyFlags = new int[] { 0 };
-${pch_compact_property_flags_initializer}
-%{FLIST} ${pch_get_compact_property_flags}
- return compactPropertyFlags;
- }
-
- public void writePropertyListPayload(ByteBuffer buffer)
- {
- if (encodedBuffer != null)
- {
- buffer.put(encodedBuffer);
- }
- else
- {
-%{FLIST} ${pch_field_list_payload}
- }
- }
-
- public void populatePropertiesFromBuffer(ByteBuffer buffer, int[] propertyFlags, int size)
- throws AMQFrameDecodingException, AMQProtocolVersionException
- {
- setPropertyFlags(propertyFlags);
-
- if (logger.isDebugEnabled())
- {
- logger.debug("Property flags: " + propertyFlags);
- }
- decode(buffer);
- /*encodedBuffer = new byte[size];
- buffer.get(encodedBuffer, 0, size);
- decodedFlag = false;
- decodedHeadersFlag = false;
- decodedContentTypeFlag = false;*/
- }
-
- private void decode(ByteBuffer buffer)
- {
- //ByteBuffer buffer = ByteBuffer.wrap(encodedBuffer);
- int pos = buffer.position();
- try
- {
-%{FLIST} ${pch_field_list_decode}
- // This line does nothing, but prevents a compiler error (Exception not thrown)
- // if this block is empty.
- if (false) throw new AMQFrameDecodingException("");
- }
- catch (AMQFrameDecodingException e)
- {
- throw new RuntimeException("Error in content header data: " + e);
- }
-
- final int endPos = buffer.position();
- buffer.position(pos);
- final int len = endPos - pos;
- encodedBuffer = new byte[len];
- final int limit = buffer.limit();
- buffer.limit(endPos);
- buffer.get(encodedBuffer, 0, len);
- buffer.limit(limit);
- buffer.position(endPos);
- decodedFlag = true;
- }
-
- private void decodeIfNecessary()
- {
- if (!decodedFlag)
- {
- //decode();
- }
- }
-
- // Field clear methods
-
-%{FLIST} ${pch_field_clear_methods}
-
- // Field get methods
-
-%{FLIST} ${pch_field_get_methods}
-
- // Field set methods
-
-%{FLIST} ${pch_field_set_methods}
-}
diff --git a/M4-RCs/qpid/gentools/templ.java/method/version/MethodBodyClass.vm b/M4-RCs/qpid/gentools/templ.java/method/version/MethodBodyClass.vm
deleted file mode 100644
index bb62438a65..0000000000
--- a/M4-RCs/qpid/gentools/templ.java/method/version/MethodBodyClass.vm
+++ /dev/null
@@ -1,190 +0,0 @@
-#macro( UpperCamel $name )
-#set( $name = "${name.substring(0,1).toUpperCase()}${name.substring(1)}" )
-#end
-#macro( toUpperCamel $name )${name.substring(0,1).toUpperCase()}${name.substring(1)}#end
-
-
-
-#set( $amqp_ClassName = $amqpClass.Name)
-#UpperCamel( $amqp_ClassName )
-#set( $amqp_MethodName = $amqpMethod.Name )
-#UpperCamel( $amqp_MethodName )
-#set( $javaClassName = "${amqp_ClassName}${amqp_MethodName}BodyImpl" )
-#set( $interfaceName = "${amqp_ClassName}${amqp_MethodName}Body" )
-#set( $amqpPackageName = "amqp_$version.getMajor()_$version.getMinor()" )
-
-#set( $filename = "${amqpPackageName}/${javaClassName}.java")
-/*
- *
- * 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 file is auto-generated by ${generator} - do not modify.
- * Supported AMQP version:
- * $version.getMajor()-$version.getMinor()
- */
-
-#set( $clazz = $amqpClass.asSingleVersionClass( $version ) )
-#set( $method = $amqpMethod.asSingleVersionMethod( $version ) )
-
-package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
-
-import java.util.HashMap;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.framing.*;
-
-public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version.getMinor() implements $interfaceName
-{
- private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
- {
- public AMQMethodBody newInstance(ByteBuffer in, long size) throws AMQFrameDecodingException
- {
- return new ${javaClassName}(in);
- }
-
-
- };
-
-
- public static AMQMethodBodyInstanceFactory getFactory()
- {
- return FACTORY_INSTANCE;
- }
-
- public static int CLASS_ID = $clazz.ClassId;
-
- public static int METHOD_ID = $method.MethodId;
-
-
-
- // Fields declared in specification
-#foreach( $field in $method.ConsolidatedFields )
- private final $field.NativeType _$field.getName(); // $field.UnderlyingFields
-#end
-
-
- // Constructor
-
- public ${javaClassName}(ByteBuffer buffer) throws AMQFrameDecodingException
- {
-#foreach( $field in $method.ConsolidatedFields )
- _$field.Name = read$field.getEncodingType()( buffer );
-#end
- }
-
- public ${javaClassName}(
-#foreach( $field in $method.FieldList )
-#if( $velocityCount == $method.getFieldList().size() )
- $field.NativeType $field.Name
-#else
- $field.NativeType $field.Name,
-#end
-#end)
- {
-#set( $consolidatedFieldName = "" )
-#foreach( $field in $method.FieldList )
-#if( $method.isConsolidated( $field.Name ) )
-#if( !$method.getConsolidatedFieldName( $field.Name ).equals( $consolidatedFieldName ) )
-#if( !$consolidatedFieldName.equals("") )
- _$consolidatedFieldName = $consolidatedFieldName; // 1
-#end
-#set( $consolidatedFieldName = $method.getConsolidatedFieldName( $field.Name ) )
- byte $consolidatedFieldName = (byte)0;
-#end
- if( $field.Name )
- {
- $consolidatedFieldName = (byte) (((int) $consolidatedFieldName) | (1 << $method.getPositionInBitField( $field.Name )));
- }
-#if( $velocityCount == $method.getFieldList().size())
- _$consolidatedFieldName = $consolidatedFieldName;
-#else
-
-#end
-#else
-#if( !$consolidatedFieldName.equals("") )
- _$consolidatedFieldName = $consolidatedFieldName;
-#end
-#set( $consolidatedFieldName = "" )
- _$field.Name = $field.Name;
-#end
-#end
- }
-
- public int getClazz()
- {
- return CLASS_ID;
- }
-
- public int getMethod()
- {
- return METHOD_ID;
- }
-
-
-#foreach( $field in $method.FieldList )
- public final $field.NativeType get#toUpperCamel( ${field.Name} )()
- {
-#if( $method.isConsolidated( $field.Name ) )
- return (((int)(_$method.getConsolidatedFieldName( $field.Name ))) & ( 1 << $method.getPositionInBitField( $field.Name ))) != 0;
-#else
- return _$field.Name;
-#end
- }
-#end
-
- protected int getBodySize()
- {
- int size = 0;
-#foreach( $field in $method.ConsolidatedFields )
-#if( $field.isFixedSize() )
- size += $field.Size;
-#else
- size += getSizeOf( _$field.Name );
-#end
-#end
- return size;
- }
-
- public void writeMethodPayload(ByteBuffer buffer)
- {
-#foreach( $field in $method.ConsolidatedFields )
-
- write$field.getEncodingType()( buffer, _$field.Name );
-#end
- }
-
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer("[$javaClassName: ");
-#foreach( $field in $method.FieldList )
- buf.append( "$field.Name=" );
- buf.append( get#toUpperCamel( $field.Name )() );
-#if( $velocityCount != $method.FieldList.size() )
- buf.append( ", " );
-#end
-#end
- buf.append("]");
- return buf.toString();
- }
-
-
-}
diff --git a/M4-RCs/qpid/gentools/templ.java/model/ProtocolVersionListClass.vm b/M4-RCs/qpid/gentools/templ.java/model/ProtocolVersionListClass.vm
deleted file mode 100644
index 18d90fab29..0000000000
--- a/M4-RCs/qpid/gentools/templ.java/model/ProtocolVersionListClass.vm
+++ /dev/null
@@ -1,148 +0,0 @@
-#set( $filename = "ProtocolVersion.java" )
-/*
-*
-* 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 file is auto-generated by $generator - do not modify.
-* Supported AMQP versions:
-#foreach( $version in $model.getVersionSet() )
-* $version.getMajor()-$version.getMinor()
-#end
-*/
-
-package org.apache.qpid.framing;
-
-import java.util.SortedSet;
-import java.util.Collections;
-import java.util.TreeSet;
-
-
-public class ProtocolVersion implements Comparable
-{
- private final byte _majorVersion;
- private final byte _minorVersion;
-
-
- public ProtocolVersion(byte majorVersion, byte minorVersion)
- {
- _majorVersion = majorVersion;
- _minorVersion = minorVersion;
- }
-
- public byte getMajorVersion()
- {
- return _majorVersion;
- }
-
- public byte getMinorVersion()
- {
- return _minorVersion;
- }
-
-
- public int compareTo(Object o)
- {
- ProtocolVersion pv = (ProtocolVersion) o;
-
- /*
- * 0-8 has it's major and minor numbers the wrong way round (it's actually 8-0)...
- * so we need to deal with that case specially
- */
-
- if((_majorVersion == (byte) 8) && (_minorVersion == (byte) 0))
- {
- ProtocolVersion fixedThis = new ProtocolVersion(_minorVersion, _majorVersion);
- return fixedThis.compareTo(pv);
- }
-
- if((pv.getMajorVersion() == (byte) 8) && (pv.getMinorVersion() == (byte) 0))
- {
- ProtocolVersion fixedOther = new ProtocolVersion(pv.getMinorVersion(), pv.getMajorVersion());
- return this.compareTo(fixedOther);
- }
-
- if(_majorVersion > pv.getMajorVersion())
- {
- return 1;
- }
- else if(_majorVersion < pv.getMajorVersion())
- {
- return -1;
- }
- else if(_minorVersion > pv.getMinorVersion())
- {
- return 1;
- }
- else if(getMinorVersion() < pv.getMinorVersion())
- {
- return -1;
- }
- else
- {
- return 0;
- }
-
- }
-
- public boolean equals(Object o)
- {
- return o != null && (o == this || (compareTo(o) == 0));
- }
-
- public int hashCode()
- {
- return (0xFF & (int)_minorVersion) | ((0xFF & (int)_majorVersion) << 8);
- }
-
-
- public boolean isSupported()
- {
- return _supportedVersions.contains(this);
- }
-
- public static ProtocolVersion getLatestSupportedVersion()
- {
- return _supportedVersions.last();
- }
-
- private static final SortedSet<ProtocolVersion> _supportedVersions;
-
- static
- {
- SortedSet<ProtocolVersion> versions = new TreeSet<ProtocolVersion>();
-
-#foreach( $version in $model.getVersionSet() )
- versions.add(new ProtocolVersion((byte)$version.getMajor(),(byte)$version.getMinor()));
-#end
- _supportedVersions = Collections.unmodifiableSortedSet(versions);
- }
-
-
- public static SortedSet<ProtocolVersion> getSupportedProtocolVersions()
- {
- return _supportedVersions;
- }
-
-
-
-
-
-}
diff --git a/M4-RCs/qpid/gentools/templ.java/model/version/AmqpConstantsClass.vm b/M4-RCs/qpid/gentools/templ.java/model/version/AmqpConstantsClass.vm
deleted file mode 100644
index 8d459f2977..0000000000
--- a/M4-RCs/qpid/gentools/templ.java/model/version/AmqpConstantsClass.vm
+++ /dev/null
@@ -1,37 +0,0 @@
-&{AmqpConstants.java}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-package org.apache.qpid.framing;
-
-class AmqpConstants
-{
- // Constant getValue methods
-
-%{TLIST} ${const_get_method}
-
-}
diff --git a/M4-RCs/qpid/gentools/templ.java/model/version/MethodRegistryClass.vm b/M4-RCs/qpid/gentools/templ.java/model/version/MethodRegistryClass.vm
deleted file mode 100644
index 82287e7f8f..0000000000
--- a/M4-RCs/qpid/gentools/templ.java/model/version/MethodRegistryClass.vm
+++ /dev/null
@@ -1,145 +0,0 @@
-#set( $filename = "amqp_$version.getMajor()_$version.getMinor()/MethodRegistry_${version.getMajor()}_${version.getMinor()}.java")
-/*
- *
- * 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 file is auto-generated by $generator - do not modify.
- * Supported AMQP version:
- * $version.getMajor()-$version.getMinor()
- */
-
-package org.apache.qpid.framing.amqp_${version.getMajor()}_${version.getMinor()};
-
-import org.apache.qpid.framing.AMQMethodBodyInstanceFactory;
-import org.apache.qpid.framing.AMQFrameDecodingException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.framing.ProtocolVersion;
-
-
-import org.apache.log4j.Logger;
-import org.apache.mina.common.ByteBuffer;
-
-public class MethodRegistry_$version.getMajor()_$version.getMinor() extends MethodRegistry
-{
-
- private static final Logger _log = Logger.getLogger(MethodRegistry.class);
-
-#set( $specificModel = $model.asSingleVersionModel() )
-
-
-
- private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[$specificModel.getMaximumClassId()+1][];
-
- public MethodRegistry_$version.getMajor()_$version.getMinor()()
- {
- this(new ProtocolVersion((byte)$version.getMajor(),(byte)$version.getMinor()));
- }
-
- public MethodRegistry_$version.getMajor()_$version.getMinor()(ProtocolVersion pv)
- {
- super(pv);
-#foreach( $amqpClass in $specificModel.getClassList() )
-#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
-#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
-#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
-
-
-
- // Register method body instance factories for the $amqpClassNameUpperCamel class.
-
- _factories[$amqpClass.getClassId()] = new AMQMethodBodyInstanceFactory[$amqpClass.getMaximumMethodId()+1];
-
-#foreach( $amqpMethod in $amqpClass.getMethodList() )
-#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
-#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
-#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
- _factories[$amqpClass.getClassId()][$amqpMethod.getMethodId()] = ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}BodyImpl.getFactory();
-#end
-
-#end
-
-
- }
-
-
- public AMQMethodBody convertToBody(ByteBuffer in, long size)
- throws AMQFrameDecodingException
- {
- int classId = in.getUnsignedShort();
- int methodId = in.getUnsignedShort();
-
- AMQMethodBodyInstanceFactory bodyFactory;
- try
- {
- bodyFactory = _factories[classId][methodId];
- }
- catch(NullPointerException e)
- {
- throw new AMQFrameDecodingException(_log,
- "Class " + classId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
- + " (while trying to decode class " + classId + " method " + methodId + ".");
- }
- catch(IndexOutOfBoundsException e)
- {
- if(classId >= _factories.length)
- {
- throw new AMQFrameDecodingException(_log,
- "Class " + classId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
- + " (while trying to decode class " + classId + " method " + methodId + ".");
-
- }
- else
- {
- throw new AMQFrameDecodingException(_log,
- "Method " + methodId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
- + " (while trying to decode class " + classId + " method " + methodId + ".");
-
- }
- }
-
-
- if (bodyFactory == null)
- {
- throw new AMQFrameDecodingException(_log,
- "Method " + methodId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
- + " (while trying to decode class " + classId + " method " + methodId + ".");
- }
-
-
- return bodyFactory.newInstance(in, size);
-
-
- }
-
-
- public int getMaxClassId()
- {
- return $specificModel.getMaximumClassId();
- }
-
- public int getMaxMethodId(int classId)
- {
- return _factories[classId].length - 1;
- }
-
-
-}
diff --git a/M4-RCs/qpid/gentools/xml-src/amqp-0.10.test.xml b/M4-RCs/qpid/gentools/xml-src/amqp-0.10.test.xml
deleted file mode 100644
index 5d3d80648b..0000000000
--- a/M4-RCs/qpid/gentools/xml-src/amqp-0.10.test.xml
+++ /dev/null
@@ -1,4241 +0,0 @@
-<?xml version = "1.0"?>
-
-<!--
- EDITORS: (PH) Pieter Hintjens <ph@imatix.com>
- (KvdR) Kim van der Riet <kim.vdriet@redhat.com>
-
- These editors have been assigned by the AMQP working group.
- Please do not edit/commit this file without consulting with
- one of the above editors.
- ========================================================
-
- TODOs
- - see TODO comments in the text
--->
-
-<!--
- Copyright Notice
- ================
- (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc.,
- iMatix Corporation, IONA\ufffd Technologies, Red Hat, Inc.,
- TWIST Process Innovations, and 29West Inc. 2006. All rights reserved.
-
- License
- =======
- JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
- Corporation, IONA\ufffd Technologies, Red Hat, Inc., TWIST Process Innovations, and
- 29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide,
- perpetual, royalty-free, nontransferable, nonexclusive license to
- (i) copy, display, and implement the Advanced Messaging Queue Protocol
- ("AMQP") Specification and (ii) the Licensed Claims that are held by
- the Authors, all for the purpose of implementing the Advanced Messaging
- Queue Protocol Specification. Your license and any rights under this
- Agreement will terminate immediately without notice from
- any Author if you bring any claim, suit, demand, or action related to
- the Advanced Messaging Queue Protocol Specification against any Author.
- Upon termination, you shall destroy all copies of the Advanced Messaging
- Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or
- patent application, throughout the world, excluding design patents and
- design registrations, owned or controlled, or that can be sublicensed
- without fee and in compliance with the requirements of this
- Agreement, by an Author or its affiliates now or at any
- future time and which would necessarily be infringed by implementation
- of the Advanced Messaging Queue Protocol Specification. A claim is
- necessarily infringed hereunder only when it is not possible to avoid
- infringing it because there is no plausible non-infringing alternative
- for implementing the required portions of the Advanced Messaging Queue
- Protocol Specification. Notwithstanding the foregoing, Licensed Claims
- shall not include any claims other than as set forth above even if
- contained in the same patent as Licensed Claims; or that read solely
- on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging
- Queue Protocol Specification, or that, if licensed, would require a
- payment of royalties by the licensor to unaffiliated third parties.
- Moreover, Licensed Claims shall not include (i) any enabling technologies
- that may be necessary to make or use any Licensed Product but are not
- themselves expressly set forth in the Advanced Messaging Queue Protocol
- Specification (e.g., semiconductor manufacturing technology, compiler
- technology, object oriented technology, networking technology, operating
- system technology, and the like); or (ii) the implementation of other
- published standards developed elsewhere and merely referred to in the
- body of the Advanced Messaging Queue Protocol Specification, or
- (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced
- Messaging Queue Protocol Specification. For purposes of this definition,
- the Advanced Messaging Queue Protocol Specification shall be deemed to
- include both architectural and interconnection requirements essential
- for interoperability and may also include supporting source code artifacts
- where such architectural, interconnection requirements and source code
- artifacts are expressly identified as being required or documentation to
- achieve compliance with the Advanced Messaging Queue Protocol Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions
- of products (hardware, software or combinations thereof) that implement
- and are compliant with all relevant portions of the Advanced Messaging
- Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any
- use you may make of the Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS,"
- AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
- IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE
- CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE
- SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY
- PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
- USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE
- PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner,
- including advertising or publicity pertaining to the Advanced Messaging
- Queue Protocol Specification or its contents without specific, written
- prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you
- shall destroy all copies of the Advanced Messaging Queue Protocol
- Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the
- Octagon Symbol are trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA
- Technologies PLC and/or its subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered
- trademarks of Red Hat, Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of
- Sun Microsystems, Inc. in the United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service
- marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
--->
-
-<!--
- <!DOCTYPE amqp SYSTEM "amqp.dtd">
--->
-
-<!-- XML Notes
-
- We use entities to indicate repetition; attributes to indicate properties.
-
- We use the 'name' attribute as an identifier, usually within the context
- of the surrounding entities.
-
- We use spaces to seperate words in names, so that we can print names in
- their natural form depending on the context - underlines for source code,
- hyphens for written text, etc.
-
- We do not enforce any particular validation mechanism but we support all
- mechanisms. The protocol definition conforms to a formal grammar that is
- published seperately in several technologies.
-
- -->
-
-<amqp major = "0" minor = "10" port = "5672" comment = "AMQ Protocol">
- <!--
- ======================================================
- == CONSTANTS
- ======================================================
- -->
- <!-- Frame types -->
- <constant name = "frame-method" value = "1" />
- <constant name = "frame-header" value = "2" />
- <constant name = "frame-body" value = "3" />
- <constant name = "frame-oob-method" value = "4" />
- <constant name = "frame-oob-header" value = "5" />
- <constant name = "frame-oob-body" value = "6" />
- <constant name = "frame-trace" value = "7" />
- <constant name = "frame-heartbeat" value = "8" />
-
- <!-- Protocol constants -->
- <constant name = "frame-min-size" value = "4096" />
- <constant name = "frame-end" value = "206" />
-
- <!-- Reply codes -->
- <constant name = "reply-success" value = "200">
- <doc>
- Indicates that the method completed successfully. This reply code is
- reserved for future use - the current protocol design does not use positive
- confirmation and reply codes are sent only in case of an error.
- </doc>
- </constant>
-
- <constant name = "not-delivered" value = "310" class = "soft-error">
- <doc>
- The client asked for a specific message that is no longer available.
- The message was delivered to another client, or was purged from the queue
- for some other reason.
- </doc>
- </constant>
-
- <constant name = "content-too-large" value = "311" class = "soft-error">
- <doc>
- The client attempted to transfer content larger than the server could accept
- at the present time. The client may retry at a later time.
- </doc>
- </constant>
-
- <constant name = "connection-forced" value = "320" class = "hard-error">
- <doc>
- An operator intervened to close the connection for some reason. The client
- may retry at some later date.
- </doc>
- </constant>
-
- <constant name = "invalid-path" value = "402" class = "hard-error">
- <doc>
- The client tried to work with an unknown virtual host.
- </doc>
- </constant>
-
- <constant name = "access-refused" value = "403" class = "soft-error">
- <doc>
- The client attempted to work with a server entity to which it has no
- access due to security settings.
- </doc>
- </constant>
-
- <constant name = "not-found" value = "404" class = "soft-error">
- <doc>The client attempted to work with a server entity that does not exist.</doc>
- </constant>
-
- <constant name = "resource-locked" value = "405" class = "soft-error">
- <doc>
- The client attempted to work with a server entity to which it has no
- access because another client is working with it.
- </doc>
- </constant>
-
- <constant name = "precondition-failed" value = "406" class = "soft-error">
- <doc>
- The client requested a method that was not allowed because some precondition
- failed.
- </doc>
- </constant>
-
- <constant name = "frame-error" value = "501" class = "hard-error">
- <doc>
- The client sent a malformed frame that the server could not decode. This
- strongly implies a programming error in the client.
- </doc>
- </constant>
-
- <constant name = "syntax-error" value = "502" class = "hard-error">
- <doc>
- The client sent a frame that contained illegal values for one or more
- fields. This strongly implies a programming error in the client.
- </doc>
- </constant>
-
- <constant name = "command-invalid" value = "503" class = "hard-error">
- <doc>
- The client sent an invalid sequence of frames, attempting to perform an
- operation that was considered invalid by the server. This usually implies
- a programming error in the client.
- </doc>
- </constant>
-
- <constant name = "channel-error" value = "504" class = "hard-error">
- <doc>
- The client attempted to work with a channel that had not been correctly
- opened. This most likely indicates a fault in the client layer.
- </doc>
- </constant>
-
- <constant name = "resource-error" value = "506" class = "hard-error">
- <doc>
- The server could not complete the method because it lacked sufficient
- resources. This may be due to the client creating too many of some type
- of entity.
- </doc>
- </constant>
-
- <constant name = "not-allowed" value = "530" class = "hard-error">
- <doc>
- The client tried to work with some entity in a manner that is prohibited
- by the server, due to security settings or by some other criteria.
- </doc>
- </constant>
-
- <constant name = "not-implemented" value = "540" class = "hard-error">
- <doc>
- The client tried to use functionality that is not implemented in the
- server.
- </doc>
- </constant>
-
- <constant name = "internal-error" value = "545" class = "hard-error">
- <doc>
- The server could not complete the method because of an internal error.
- The server may require intervention by an operator in order to resume
- normal operations.
- </doc>
- </constant>
-
- <constant name = "test-double" value = "3.141592654"/>
- <constant name = "test-str1" value = "hello, world!"/>
- <constant name = "test-str2" value = "1.2.3.4"/>
-
- <!--
- ======================================================
- == DOMAIN TYPES
- ======================================================
- -->
-
- <domain name = "access-ticket" type = "short" label = "access ticket granted by server">
- <doc>
- An access ticket granted by the server for a certain set of access rights
- within a specific realm. Access tickets are valid within the channel where
- they were created, and expire when the channel closes.
- </doc>
- <assert check = "ne" value = "0" />
- </domain>
-
- <domain name = "class-id" type = "short" />
-
- <domain name = "consumer-tag" type = "shortstr" label = "consumer tag">
- <doc>
- Identifier for the consumer, valid within the current connection.
- </doc>
- </domain>
-
- <domain name = "delivery-tag" type = "longlong" label = "server-assigned delivery tag">
- <doc>
- The server-assigned and channel-specific delivery tag
- </doc>
- <rule name = "channel-local">
- <doc>
- The delivery tag is valid only within the channel from which the message was
- received. I.e. a client MUST NOT receive a message on one channel and then
- acknowledge it on another.
- </doc>
- </rule>
- <rule name = "non-zero">
- <doc>
- The server MUST NOT use a zero value for delivery tags. Zero is reserved
- for client use, meaning "all messages so far received".
- </doc>
- </rule>
- </domain>
-
- <domain name = "exchange-name" type = "shortstr" label = "exchange name">
- <doc>
- The exchange name is a client-selected string that identifies the exchange for publish
- methods. Exchange names may consist of any mixture of digits, letters, and underscores.
- Exchange names are scoped by the virtual host.
- </doc>
- <assert check = "length" value = "127" />
- </domain>
-
- <domain name = "known-hosts" type = "shortstr" label = "list of known hosts">
- <doc>
- Specifies the list of equivalent or alternative hosts that the server knows about,
- which will normally include the current server itself. Clients can cache this
- information and use it when reconnecting to a server after a failure. This field
- may be empty.
- </doc>
- </domain>
-
- <domain name = "method-id" type = "long" />
-
- <domain name = "no-ack" type = "bit" label = "no acknowledgement needed">
- <doc>
- If this field is set the server does not expect acknowledgments for
- messages. That is, when a message is delivered to the client the server
- automatically and silently acknowledges it on behalf of the client. This
- functionality increases performance but at the cost of reliability.
- Messages can get lost if a client dies before it can deliver them to the
- application.
- </doc>
- </domain>
-
- <domain name = "no-local" type = "bit" label = "do not deliver own messages">
- <doc>
- If the no-local field is set the server will not send messages to the client that
- published them.
- </doc>
- </domain>
-
- <domain name = "path" type = "shortstr">
- <doc>
- Must start with a slash "/" and continue with path names separated by slashes. A path
- name consists of any combination of at least one of [A-Za-z0-9] plus zero or more of
- [.-_+!=:].
- </doc>
-
- <assert check = "notnull" />
- <assert check = "syntax" rule = "path" />
- <assert check = "length" value = "127" />
- </domain>
-
- <domain name = "peer-properties" type = "table">
- <doc>
- This string provides a set of peer properties, used for identification, debugging, and
- general information.
- </doc>
- </domain>
-
- <domain name = "queue-name" type = "shortstr" label = "queue name">
- <doc>
- The queue name identifies the queue within the vhost. Queue names may consist of any
- mixture of digits, letters, and underscores.
- </doc>
- <assert check = "length" value = "127" />
- </domain>
-
- <domain name = "redelivered" type = "bit" label = "message is being redelivered">
- <doc>
- This indicates that the message has been previously delivered to this or
- another client.
- </doc>
- <rule name = "implementation">
- <doc>
- The server SHOULD try to signal redelivered messages when it can. When
- redelivering a message that was not successfully acknowledged, the server
- SHOULD deliver it to the original client if possible.
- </doc>
- <doc type = "scenario">
- Create a shared queue and publish a message to the queue. Consume the
- message using explicit acknowledgements, but do not acknowledge the
- message. Close the connection, reconnect, and consume from the queue
- again. The message should arrive with the redelivered flag set.
- </doc>
- </rule>
- <rule name = "hinting">
- <doc>
- The client MUST NOT rely on the redelivered field but should take it as a
- hint that the message may already have been processed. A fully robust
- client must be able to track duplicate received messages on non-transacted,
- and locally-transacted channels.
- </doc>
- </rule>
- </domain>
-
- <domain name = "reply-code" type = "short" label = "reply code from server">
- <doc>
- The reply code. The AMQ reply codes are defined as constants at the start
- of this formal specification.
- </doc>
- <assert check = "notnull" />
- </domain>
-
- <domain name = "reply-text" type = "shortstr" label = "localised reply text">
- <doc>
- The localised reply text. This text can be logged as an aid to resolving
- issues.
- </doc>
- <assert check = "notnull" />
- </domain>
-
- <!-- Elementary domains -->
- <domain name = "bit" type = "bit" label = "single bit" />
- <domain name = "octet" type = "octet" label = "single octet" />
- <domain name = "short" type = "short" label = "16-bit integer" />
- <domain name = "long" type = "long" label = "32-bit integer" />
- <domain name = "longlong" type = "longlong" label = "64-bit integer" />
- <domain name = "shortstr" type = "shortstr" label = "short string" />
- <domain name = "longstr" type = "longstr" label = "long string" />
- <domain name = "timestamp" type = "timestamp" label = "64-bit timestamp" />
- <domain name = "table" type = "table" label = "field table" />
-
- <!-- == CONNECTION ======================================================= -->
-
- <!-- TODO 0.81 - the 'handler' attribute of methods needs to be reviewed, and if
- no current implementations use it, removed. /PH 2006/07/20
- -->
-
- <class name = "connection" handler = "connection" index = "10" label = "work with socket connections">
- <doc>
- The connection class provides methods for a client to establish a network connection to
- a server, and for both peers to operate the connection thereafter.
- </doc>
-
- <doc type = "grammar">
- connection = open-connection *use-connection close-connection
- open-connection = C:protocol-header
- S:START C:START-OK
- *challenge
- S:TUNE C:TUNE-OK
- C:OPEN S:OPEN-OK | S:REDIRECT
- challenge = S:SECURE C:SECURE-OK
- use-connection = *channel
- close-connection = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "start" synchronous = "1" index = "10" label = "start connection negotiation">
- <doc>
- This method starts the connection negotiation process by telling the client the
- protocol version that the server proposes, along with a list of security mechanisms
- which the client can use for authentication.
- </doc>
-
- <rule name = "protocol-name">
- <doc>
- If the server cannot support the protocol specified in the protocol header,
- it MUST close the socket connection without sending any response method.
- </doc>
- <doc type = "scenario">
- The client sends a protocol header containing an invalid protocol name.
- The server must respond by closing the connection.
- </doc>
- </rule>
- <rule name = "server-support">
- <doc>
- The server MUST provide a protocol version that is lower than or equal to
- that requested by the client in the protocol header.
- </doc>
- <doc type = "scenario">
- The client requests a protocol version that is higher than any valid
- implementation, e.g. 9.0. The server must respond with a current
- protocol version, e.g. 1.0.
- </doc>
- </rule>
- <rule name = "client-support">
- <doc>
- If the client cannot handle the protocol version suggested by the server
- it MUST close the socket connection.
- </doc>
- <doc type = "scenario">
- The server sends a protocol version that is lower than any valid
- implementation, e.g. 0.1. The client must respond by closing the
- connection.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
- <response name = "start-ok" />
-
- <field name = "version-major" domain = "octet" label = "protocol major version">
- <doc>
- The version of the protocol, expressed in protocol units of 0.1 public
- versions and properly printed as two digits with a leading zero. I.e. a
- protocol version of "09" represents a public version "0.9". The decimal
- shift allows the correct expression of pre-1.0 protocol releases.
- </doc>
- <doc type = "todo">
- This field should be renamed to "protocol version".
- </doc>
- </field>
-
- <field name = "version-minor" domain = "octet" label = "protocol major version">
- <doc>
- The protocol revision, expressed as an integer from 0 to 9. The use of more
- than ten revisions is discouraged. The public version string is constructed
- from the protocol version and revision as follows: we print the protocol
- version with one decimal position, and we append the protocol revision. A
- version=10 and revision=2 are printed as "1.02".
- </doc>
- <doc type = "todo">
- This field should be renamed to "protocol revision".
- </doc>
- </field>
-
- <field name = "server-properties" domain = "peer-properties" label = "server properties">
- <rule name = "required-fields">
- <doc>
- The properties SHOULD contain at least these fields: "host", specifying the
- server host name or address, "product", giving the name of the server product,
- "version", giving the name of the server version, "platform", giving the name
- of the operating system, "copyright", if appropriate, and "information", giving
- other general information.
- </doc>
- <doc type = "scenario">
- Client connects to server and inspects the server properties. It checks for
- the presence of the required fields.
- </doc>
- </rule>
- </field>
-
- <field name = "mechanisms" domain = "longstr" label = "available security mechanisms">
- <doc>
- A list of the security mechanisms that the server supports, delimited by spaces.
- Currently ASL supports these mechanisms: PLAIN.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "locales" domain = "longstr" label = "available message locales">
- <doc>
- A list of the message locales that the server supports, delimited by spaces. The
- locale defines the language in which the server will send reply texts.
- </doc>
- <rule name = "required-support">
- <doc>
- The server MUST support at least the en_US locale.
- </doc>
- <doc type = "scenario">
- Client connects to server and inspects the locales field. It checks for
- the presence of the required locale(s).
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
- </method>
-
- <method name = "start-ok" synchronous = "1" index = "11"
- label = "select security mechanism and locale">
- <doc>
- This method selects a SASL security mechanism. ASL uses SASL (RFC2222) to
- negotiate authentication and encryption.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "client-properties" domain = "peer-properties" label = "client properties">
- <rule name = "required-fields">
- <!-- This rule is not testable from the client side -->
- <doc>
- The properties SHOULD contain at least these fields: "product", giving the name
- of the client product, "version", giving the name of the client version, "platform",
- giving the name of the operating system, "copyright", if appropriate, and
- "information", giving other general information.
- </doc>
- </rule>
- </field>
-
- <field name = "mechanism" domain = "shortstr" label = "selected security mechanism">
- <doc>
- A single security mechanisms selected by the client, which must be one of those
- specified by the server.
- </doc>
- <rule name = "security">
- <doc>
- The client SHOULD authenticate using the highest-level security profile it
- can handle from the list provided by the server.
- </doc>
- </rule>
- <rule name = "validity">
- <doc>
- If the mechanism field does not contain one of the security mechanisms
- proposed by the server in the Start method, the server MUST close the
- connection without sending any further data.
- </doc>
- <doc type = "scenario">
- Client connects to server and sends an invalid security mechanism. The
- server must respond by closing the connection (a socket close, with no
- connection close negotiation).
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
-
- <field name = "response" domain = "longstr" label = "security response data">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this
- data are defined by the SASL security mechanism.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "locale" domain = "shortstr" label = "selected message locale">
- <doc>
- A single message local selected by the client, which must be one of those
- specified by the server.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "secure" synchronous = "1" index = "20" label = "security mechanism challenge">
- <doc>
- The SASL protocol works by exchanging challenges and responses until both peers have
- received sufficient information to authenticate each other. This method challenges
- the client to provide more information.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
- <response name = "secure-ok" />
-
- <field name = "challenge" domain = "longstr" label = "security challenge data">
- <doc>
- Challenge information, a block of opaque binary data passed to the security
- mechanism.
- </doc>
- </field>
- </method>
-
- <method name = "secure-ok" synchronous = "1" index = "21" label = "security mechanism response">
- <doc>
- This method attempts to authenticate, passing a block of SASL data for the security
- mechanism at the server side.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "response" domain = "longstr" label = "security response data">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this
- data are defined by the SASL security mechanism.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "tune" synchronous = "1" index = "30"
- label = "propose connection tuning parameters">
- <doc>
- This method proposes a set of connection configuration values to the client. The
- client can accept and/or adjust these.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <response name = "tune-ok" />
-
- <field name = "channel-max" domain = "short" label = "proposed maximum channels">
- <doc>
- The maximum total number of channels that the server allows per connection. Zero
- means that the server does not impose a fixed limit, but the number of allowed
- channels may be limited by available server resources.
- </doc>
- </field>
-
- <field name = "frame-max" domain = "long" label = "proposed maximum frame size">
- <doc>
- The largest frame size that the server proposes for the connection. The client
- can negotiate a lower value. Zero means that the server does not impose any
- specific limit but may reject very large frames if it cannot allocate resources
- for them.
- </doc>
- <rule name = "minimum">
- <doc>
- Until the frame-max has been negotiated, both peers MUST accept frames of up
- to frame-min-size octets large, and the minimum negotiated value for frame-max
- is also frame-min-size.
- </doc>
- <doc type = "scenario">
- Client connects to server and sends a large properties field, creating a frame
- of frame-min-size octets. The server must accept this frame.
- </doc>
- </rule>
- </field>
-
- <field name = "heartbeat" domain = "short" label = "desired heartbeat delay">
- <!-- TODO 0.82 - the heartbeat negotiation mechanism was changed during
- implementation because the model documented here does not actually
- work properly. The best model we found is that the server proposes
- a heartbeat value to the client; the client can reply with zero, meaning
- 'do not use heartbeats (as documented here), or can propose its own
- heartbeat value, which the server should then accept. This is different
- from the model here which is disconnected - e.g. each side requests a
- heartbeat independently. Basically a connection is heartbeated in
- both ways, or not at all, depending on whether both peers support
- heartbeating or not, and the heartbeat value should itself be chosen
- by the client so that remote links can get a higher value. Also, the
- actual heartbeat mechanism needs documentation, and is as follows: so
- long as there is activity on a connection - in or out - both peers
- assume the connection is active. When there is no activity, each peer
- must send heartbeat frames. When no heartbeat frame is received after
- N cycles (where N is at least 2), the connection can be considered to
- have died. /PH 2006/07/19
- -->
- <doc>
- The delay, in seconds, of the connection heartbeat that the server wants.
- Zero means the server does not want a heartbeat.
- </doc>
- </field>
- </method>
-
- <method name = "tune-ok" synchronous = "1" index = "31"
- label = "negotiate connection tuning parameters">
- <doc>
- This method sends the client's connection tuning parameters to the server.
- Certain fields are negotiated, others provide capability information.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "channel-max" domain = "short" label = "negotiated maximum channels">
- <doc>
- The maximum total number of channels that the client will use per connection.
- </doc>
- <rule name = "upper-limit">
- <doc>
- If the client specifies a channel max that is higher than the value provided
- by the server, the server MUST close the connection without attempting a
- negotiated close. The server may report the error in some fashion to assist
- implementors.
- </doc>
- </rule>
- <assert check = "notnull" />
- <assert check = "le" method = "tune" field = "channel-max" />
- </field>
-
- <field name = "frame-max" domain = "long" label = "negotiated maximum frame size">
- <doc>
- The largest frame size that the client and server will use for the connection.
- Zero means that the client does not impose any specific limit but may reject
- very large frames if it cannot allocate resources for them. Note that the
- frame-max limit applies principally to content frames, where large contents can
- be broken into frames of arbitrary size.
- </doc>
- <rule name = "minimum">
- <doc>
- Until the frame-max has been negotiated, both peers MUST accept frames of up
- to frame-min-size octets large, and the minimum negotiated value for frame-max
- is also frame-min-size.
- </doc>
- </rule>
- <rule name = "upper-limit">
- <doc>
- If the client specifies a frame max that is higher than the value provided
- by the server, the server MUST close the connection without attempting a
- negotiated close. The server may report the error in some fashion to assist
- implementors.
- </doc>
- </rule>
- </field>
-
- <field name = "heartbeat" domain = "short" label = "desired heartbeat delay">
- <doc>
- The delay, in seconds, of the connection heartbeat that the client wants. Zero
- means the client does not want a heartbeat.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "open" synchronous = "1" index = "40" label = "open connection to virtual host">
- <doc>
- This method opens a connection to a virtual host, which is a collection of
- resources, and acts to separate multiple application domains within a server.
- The server may apply arbitrary limits per virtual host, such as the number
- of each type of entity that may be used, per connection and/or in total.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "open-ok" />
- <response name = "redirect" />
-
- <field name = "virtual-host" domain = "path" label = "virtual host name">
- <!-- TODO 0.82 - the entire vhost model needs review. This concept was
- prompted by the HTTP vhost concept but does not fit very well into
- AMQP. Currently we use the vhost as a "cluster identifier" which is
- inaccurate usage. /PH 2006/07/19
- -->
- <assert check = "regexp" value = "^[a-zA-Z0-9/-_]+$" />
- <doc>
- The name of the virtual host to work with.
- </doc>
- <rule name = "separation">
- <doc>
- If the server supports multiple virtual hosts, it MUST enforce a full
- separation of exchanges, queues, and all associated entities per virtual
- host. An application, connected to a specific virtual host, MUST NOT be able
- to access resources of another virtual host.
- </doc>
- </rule>
- <rule name = "security">
- <doc>
- The server SHOULD verify that the client has permission to access the
- specified virtual host.
- </doc>
- </rule>
- </field>
-
- <field name = "capabilities" domain = "shortstr" label = "required capabilities">
- <doc>
- The client can specify zero or more capability names, delimited by spaces.
- The server can use this string to how to process the client's connection
- request.
- </doc>
- </field>
-
- <field name = "insist" domain = "bit" label = "insist on connecting to server">
- <doc>
- In a configuration with multiple collaborating servers, the server may respond
- to a Connection.Open method with a Connection.Redirect. The insist option tells
- the server that the client is insisting on a connection to the specified server.
- </doc>
- <rule name = "behaviour">
- <doc>
- When the client uses the insist option, the server MUST NOT respond with a
- Connection.Redirect method. If it cannot accept the client's connection
- request it should respond by closing the connection with a suitable reply
- code.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "open-ok" synchronous = "1" index = "41" label = "signal that connection is ready">
- <doc>
- This method signals to the client that the connection is ready for use.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "known-hosts" domain = "known-hosts" />
- </method>
-
- <method name = "redirect" synchronous = "1" index = "42" label = "redirects client to other server">
- <doc>
- This method redirects the client to another server, based on the requested virtual
- host and/or capabilities.
- </doc>
- <rule name = "usage">
- <doc>
- When getting the Connection.Redirect method, the client SHOULD reconnect to
- the host specified, and if that host is not present, to any of the hosts
- specified in the known-hosts list.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <field name = "host" domain = "shortstr" label = "server to connect to">
- <doc>
- Specifies the server to connect to. This is an IP address or a DNS name,
- optionally followed by a colon and a port number. If no port number is
- specified, the client should use the default port number for the protocol.
- </doc>
- <assert check = "notnull" />
- </field>
- <field name = "known-hosts" domain = "known-hosts" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "close" synchronous = "1" index = "50" label = "request a connection close">
- <doc>
- This method indicates that the sender wants to close the connection. This may be
- due to internal conditions (e.g. a forced shut-down) or due to an error handling
- a specific method, i.e. an exception. When a close is due to an exception, the
- sender provides the class and method id of the method which caused the exception.
- </doc>
- <!-- TODO: the connection close mechanism needs to be reviewed from the ODF
- documentation and better expressed as rules here. /PH 2006/07/20
- -->
- <rule name = "stability">
- <doc>
- After sending this method any received method except the Close-OK method MUST
- be discarded.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- <response name = "close-ok" />
-
- <field name = "reply-code" domain = "reply-code" />
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "class-id" domain = "class-id" label = "failing method class">
- <doc>
- When the close is provoked by a method exception, this is the class of the
- method.
- </doc>
- </field>
-
- <field name = "method-id" domain = "method-id" label = "failing method ID">
- <doc>
- When the close is provoked by a method exception, this is the ID of the method.
- </doc>
- </field>
- </method>
-
- <method name = "close-ok" synchronous = "1" index = "51" label = "confirm a connection close">
- <doc>
- This method confirms a Connection.Close method and tells the recipient that it is
- safe to release resources for the connection and close the socket.
- </doc>
- <rule name = "reporting">
- <doc>
- A peer that detects a socket closure without having received a Close-Ok
- handshake method SHOULD log the error.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- </method>
- </class>
-
- <!-- == CHANNEL ========================================================== -->
-
- <class name = "channel" handler = "channel" index = "20" label = "work with channels">
- <doc>
- The channel class provides methods for a client to establish a channel to a
- server and for both peers to operate the channel thereafter.
- </doc>
-
- <doc type = "grammar">
- channel = open-channel *use-channel close-channel
- open-channel = C:OPEN S:OPEN-OK
- use-channel = C:FLOW S:FLOW-OK
- / S:FLOW C:FLOW-OK
- / S:ALERT
- / functional-class
- close-channel = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "open" synchronous = "1" index = "10" label = "open a channel for use">
- <doc>
- This method opens a channel to the server.
- </doc>
- <rule name = "state" on-failure = "channel-error">
- <doc>
- The client MUST NOT use this method on an alread-opened channel.
- </doc>
- <doc type = "scenario">
- Client opens a channel and then reopens the same channel.
- </doc>
- </rule>
- <chassis name = "server" implement = "MUST" />
- <response name = "open-ok" />
- <field name = "out of band" domain = "shortstr" label = "out-of-band settings">
- <doc>
- Configures out-of-band transfers on this channel. The syntax and meaning of this
- field will be formally defined at a later date.
- </doc>
- <assert check = "null" />
- </field>
- </method>
-
- <method name = "open-ok" synchronous = "1" index = "11" label = "signal that the channel is ready">
- <doc>
- This method signals to the client that the channel is ready for use.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "flow" synchronous = "1" index = "20" label = "enable/disable flow from peer">
- <doc>
- This method asks the peer to pause or restart the flow of content data. This is a
- simple flow-control mechanism that a peer can use to avoid oveflowing its queues or
- otherwise finding itself receiving more messages than it can process. Note that this
- method is not intended for window control. The peer that receives a disable flow
- method should finish sending the current content frame, if any, then pause.
- </doc>
-
- <rule name = "initial-state">
- <doc>
- When a new channel is opened, it is active (flow is active). Some applications
- assume that channels are inactive until started. To emulate this behaviour a
- client MAY open the channel, then pause it.
- </doc>
- </rule>
-
- <rule name = "bidirectional">
- <doc>
- When sending content frames, a peer SHOULD monitor the channel for incoming
- methods and respond to a Channel.Flow as rapidly as possible.
- </doc>
- </rule>
-
- <rule name = "throttling">
- <doc>
- A peer MAY use the Channel.Flow method to throttle incoming content data for
- internal reasons, for example, when exchanging data over a slower connection.
- </doc>
- </rule>
-
- <rule name = "expected-behaviour">
- <doc>
- The peer that requests a Channel.Flow method MAY disconnect and/or ban a peer
- that does not respect the request. This is to prevent badly-behaved clients
- from overwhelming a broker.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <response name = "flow-ok" />
-
- <field name = "active" domain = "bit" label = "start/stop content frames">
- <doc>
- If 1, the peer starts sending content frames. If 0, the peer stops sending
- content frames.
- </doc>
- </field>
- </method>
-
- <method name = "flow-ok" index = "21" label = "confirm a flow method">
- <doc>
- Confirms to the peer that a flow command was received and processed.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- <field name = "active" domain = "bit" label = "current flow setting">
- <doc>
- Confirms the setting of the processed flow method: 1 means the peer will start
- sending or continue to send content frames; 0 means it will not.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- TODO 0.82 - remove this method entirely
- /PH 2006/07/20
- -->
- <method name = "alert" index = "30" label = "send a non-fatal warning message">
- <doc>
- This method allows the server to send a non-fatal warning to the client. This is
- used for methods that are normally asynchronous and thus do not have confirmations,
- and for which the server may detect errors that need to be reported. Fatal errors
- are handled as channel or connection exceptions; non-fatal errors are sent through
- this method.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "reply-code" domain = "reply-code" />
- <field name = "reply-text" domain = "reply-text" />
- <field name = "details" domain = "table" label = "detailed information for warning">
- <doc>
- A set of fields that provide more information about the problem. The meaning of
- these fields are defined on a per-reply-code basis (TO BE DEFINED).
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "close" synchronous = "1" index = "40" label = "request a channel close">
- <doc>
- This method indicates that the sender wants to close the channel. This may be due to
- internal conditions (e.g. a forced shut-down) or due to an error handling a specific
- method, i.e. an exception. When a close is due to an exception, the sender provides
- the class and method id of the method which caused the exception.
- </doc>
-
- <!-- TODO: the channel close behaviour needs to be reviewed from the ODF
- documentation and better expressed as rules here. /PH 2006/07/20
- -->
- <rule name = "stability">
- <doc>
- After sending this method any received method except the Close-OK method MUST
- be discarded.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- <response name = "close-ok" />
-
- <field name = "reply-code" domain = "reply-code" />
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "class-id" domain = "class-id" label = "failing method class">
- <doc>
- When the close is provoked by a method exception, this is the class of the
- method.
- </doc>
- </field>
-
- <field name = "method-id" domain = "method-id" label = "failing method ID">
- <doc>
- When the close is provoked by a method exception, this is the ID of the method.
- </doc>
- </field>
- </method>
-
- <method name = "close-ok" synchronous = "1" index = "41" label = "confirm a channel close">
- <doc>
- This method confirms a Channel.Close method and tells the recipient that it is safe
- to release resources for the channel and close the socket.
- </doc>
- <rule name = "reporting">
- <doc>
- A peer that detects a socket closure without having received a Channel.Close-Ok
- handshake method SHOULD log the error.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- </method>
- </class>
-
- <!-- == ACCESS =========================================================== -->
-
- <!-- TODO 0.82 - this class must be implemented by two teams before we can
- consider it matured.
- -->
-
- <class name = "access" handler = "connection" index = "30" label = "work with access tickets">
- <doc>
- The protocol control access to server resources using access tickets. A
- client must explicitly request access tickets before doing work. An access
- ticket grants a client the right to use a specific set of resources -
- called a "realm" - in specific ways.
- </doc>
-
- <doc type = "grammar">
- access = C:REQUEST S:REQUEST-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "request" synchronous = "1" index = "10" label = "request an access ticket">
- <doc>
- This method requests an access ticket for an access realm. The server
- responds by granting the access ticket. If the client does not have
- access rights to the requested realm this causes a connection exception.
- Access tickets are a per-channel resource.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "request-ok" />
-
- <field name = "realm" domain = "shortstr" label = "name of requested realm">
- <doc>
- Specifies the name of the realm to which the client is requesting access.
- The realm is a configured server-side object that collects a set of
- resources (exchanges, queues, etc.). If the channel has already requested
- an access ticket onto this realm, the previous ticket is destroyed and a
- new ticket is created with the requested access rights, if allowed.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST specify a realm that is known to the server. The server
- makes an identical response for undefined realms as it does for realms
- that are defined but inaccessible to this client.
- </doc>
- <doc type = "scenario">
- Client specifies an undefined realm.
- </doc>
- </rule>
- </field>
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive access to the realm, meaning that this will be the only
- channel that uses the realm's resources.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MAY NOT request exclusive access to a realm that has active
- access tickets, unless the same channel already had the only access
- ticket onto that realm.
- </doc>
- <doc type = "scenario">
- Client opens two channels and requests exclusive access to the same realm.
- </doc>
- </rule>
- </field>
- <field name = "passive" domain = "bit" label = "request passive access">
- <doc>
- Request message passive access to the specified access realm. Passive
- access lets a client get information about resources in the realm but
- not to make any changes to them.
- </doc>
- </field>
- <field name = "active" domain = "bit" label = "request active access">
- <doc>
- Request message active access to the specified access realm. Active access lets
- a client get create and delete resources in the realm.
- </doc>
- </field>
- <field name = "write" domain = "bit" label = "request write access">
- <doc>
- Request write access to the specified access realm. Write access lets a client
- publish messages to all exchanges in the realm.
- </doc>
- </field>
- <field name = "read" domain = "bit" label = "request read access">
- <doc>
- Request read access to the specified access realm. Read access lets a client
- consume messages from queues in the realm.
- </doc>
- </field>
- </method>
-
- <method name = "request-ok" synchronous = "1" index = "11" label = "grant access to server resources">
- <doc>
- This method provides the client with an access ticket. The access ticket is valid
- within the current channel and for the lifespan of the channel.
- </doc>
- <rule name = "per-channel" on-failure = "not-allowed">
- <doc>
- The client MUST NOT use access tickets except within the same channel as
- originally granted.
- </doc>
- <doc type = "scenario">
- Client opens two channels, requests a ticket on one channel, and then
- tries to use that ticket in a seconc channel.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <field name = "ticket" domain = "access-ticket" />
- </method>
- </class>
-
- <!-- == EXCHANGE ========================================================= -->
-
- <class name = "exchange" handler = "channel" index = "40" label = "work with exchanges">
- <doc>
- Exchanges match and distribute messages across queues. Exchanges can be configured in
- the server or created at runtime.
- </doc>
-
- <doc type = "grammar">
- exchange = C:DECLARE S:DECLARE-OK
- / C:DELETE S:DELETE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <rule name = "required-types">
- <doc>
- The server MUST implement these standard exchange types: fanout, direct.
- </doc>
- <doc type = "scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
- <rule name = "recommended-types">
- <doc>
- The server SHOULD implement these standard exchange types: topic, headers.
- </doc>
- <doc type = "scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
- <rule name = "required-instances">
- <doc>
- The server MUST, in each virtual host, pre-declare an exchange instance
- for each standard exchange type that it implements, where the name of the
- exchange instance is "amq." followed by the exchange type name.
- </doc>
- <doc type = "scenario">
- Client creates a temporary queue and attempts to bind to each required
- exchange instance (amq.fanout, amq.direct, and amq.topic, amq.headers if
- those types are defined).
- </doc>
- </rule>
- <rule name = "default-exchange">
- <doc>
- The server MUST predeclare a direct exchange to act as the default exchange
- for content Publish methods and for default queue bindings.
- </doc>
- <doc type = "scenario">
- Client checks that the default exchange is active by specifying a queue
- binding with no exchange name, and publishing a message with a suitable
- routing key but without specifying the exchange name, then ensuring that
- the message arrives in the queue correctly.
- </doc>
- </rule>
- <rule name = "default-access">
- <doc>
- The server MUST NOT allow clients to access the default exchange except
- by specifying an empty exchange name in the Queue.Bind and content Publish
- methods.
- </doc>
- </rule>
- <rule name = "extensions">
- <doc>
- The server MAY implement other exchange types as wanted.
- </doc>
- </rule>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "declare" synchronous = "1" index = "10" label = "declare exchange, create if needed">
- <doc>
- This method creates an exchange if it does not already exist, and if the exchange
- exists, verifies that it is of the correct and expected class.
- </doc>
- <rule name = "minimum">
- <doc>
- The server SHOULD support a minimum of 16 exchanges per virtual host and
- ideally, impose no limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- The client creates as many exchanges as it can until the server reports
- an error; the number of exchanges successfuly created must be at least
- sixteen.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "declare-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- When a client defines a new exchange, this belongs to the access realm of the
- ticket used. All further work done with that exchange must be done with an
- access ticket for the same realm.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access to
- the realm in which the exchange exists or will be created, or "passive"
- access if the if-exists flag is set.
- </doc>
- <doc type = "scenario">
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <rule name = "reserved" on-failure = "access-refused">
- <doc>
- Exchange names starting with "amq." are reserved for predeclared and
- standardised exchanges. The client MUST NOT attempt to create an exchange
- starting with "amq.".
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <assert check = "regexp" value = "^[a-zA-Z0-9-_.:]+$" />
- </field>
-
- <field name = "type" domain = "shortstr" label = "exchange type">
- <doc>
- Each exchange belongs to one of a set of exchange types implemented by the
- server. The exchange types define the functionality of the exchange - i.e. how
- messages are routed through it. It is not valid or meaningful to attempt to
- change the type of an existing exchange.
- </doc>
- <rule name = "typed" on-failure = "not-allowed">
- <doc>
- Exchanges cannot be redeclared with different types. The client MUST not
- attempt to redeclare an existing exchange with a different type than used
- in the original Exchange.Declare method.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <rule name = "support" on-failure = "command-invalid">
- <doc>
- The client MUST NOT attempt to create an exchange with a type that the
- server does not support.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <assert check = "regexp" value = "^[a-zA-Z0-9-_.:]+$" />
- </field>
-
- <field name = "passive" domain = "bit" label = "do not create exchange">
- <doc>
- If set, the server will not create the exchange. The client can use this to
- check whether an exchange exists without modifying the server state.
- </doc>
- <rule name = "not-found">
- <doc>
- If set, and the exchange does not already exist, the server MUST raise a
- channel exception with reply code 404 (not found).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "durable" domain = "bit" label = "request a durable exchange">
- <doc>
- If set when creating a new exchange, the exchange will be marked as durable.
- Durable exchanges remain active when a server restarts. Non-durable exchanges
- (transient exchanges) are purged if/when a server restarts.
- </doc>
- <rule name = "support">
- <doc>
- The server MUST support both durable and transient exchanges.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <rule name = "sticky">
- <doc>
- The server MUST ignore the durable field if the exchange already exists.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <!-- TODO 0.82 - clarify how this works; there is no way to cancel a binding
- except by deleting a queue.
- -->
- <field name = "auto-delete" domain = "bit" label = "auto-delete when unused">
- <doc>
- If set, the exchange is deleted when all queues have finished using it.
- </doc>
- <rule name = "sticky">
- <doc>
- The server MUST ignore the auto-delete field if the exchange already
- exists.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "internal" domain = "bit" label = "create internal exchange">
- <doc>
- If set, the exchange may not be used directly by publishers, but only when bound
- to other exchanges. Internal exchanges are used to construct wiring that is not
- visible to applications.
- </doc>
- </field>
-
- <field name = "arguments" domain = "table" label = "arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these
- arguments depends on the server implementation. This field is ignored if passive
- is 1.
- </doc>
- </field>
- </method>
-
- <method name = "declare-ok" synchronous = "1" index = "11" label = "confirm exchange declaration">
- <doc>
- This method confirms a Declare method and confirms the name of the exchange,
- essential for automatically-named exchanges.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "delete" synchronous = "1" index = "20" label = "delete an exchange">
- <doc>
- This method deletes an exchange. When an exchange is deleted all queue bindings on
- the exchange are cancelled.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "delete-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access
- rights to the exchange's access realm.
- </doc>
- <doc type = "scenario">
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <rule name = "exists" on-failure = "not-found">
- <doc>
- The client MUST NOT attempt to delete an exchange that does not exist.
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
-
- <!-- TODO 0.82 - discuss whether this option is useful or not. I don't have
- any real use case for it. /PH 2006-07-23.
- -->
- <field name = "if-unused" domain = "bit" label = "delete only if unused">
- <doc>
- If set, the server will only delete the exchange if it has no queue bindings. If
- the exchange has queue bindings the server does not delete it but raises a
- channel exception instead.
- </doc>
- </field>
- </method>
-
- <method name = "delete-ok" synchronous = "1" index = "21"
- label = "confirm deletion of an exchange">
- <doc>This method confirms the deletion of an exchange.</doc>
- <chassis name = "client" implement = "MUST" />
- </method>
- </class>
-
- <!-- == QUEUE ============================================================ -->
-
- <class name = "queue" handler = "channel" index = "50" label = "work with queues">
- <doc>
- Queues store and forward messages. Queues can be configured in the server or created at
- runtime. Queues must be attached to at least one exchange in order to receive messages
- from publishers.
- </doc>
-
- <doc type = "grammar">
- queue = C:DECLARE S:DECLARE-OK
- / C:BIND S:BIND-OK
- / C:PURGE S:PURGE-OK
- / C:DELETE S:DELETE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <rule name = "any-content">
- <doc>
- A server MUST allow any content class to be sent to any queue, in any mix, and
- queue and deliver these content classes independently. Note that all methods
- that fetch content off queues are specific to a given content class.
- </doc>
- <doc type = "scenario">
- Client creates an exchange of each standard type and several queues that
- it binds to each exchange. It must then sucessfully send each of the standard
- content types to each of the available queues.
- </doc>
- </rule>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "declare" synchronous = "1" index = "10" label = "declare queue, create if needed">
- <doc>
- This method creates or checks a queue. When creating a new queue the client can
- specify various properties that control the durability of the queue and its
- contents, and the level of sharing for the queue.
- </doc>
-
- <rule name = "default-binding">
- <doc>
- The server MUST create a default binding for a newly-created queue to the
- default exchange, which is an exchange of type 'direct'.
- </doc>
- <doc type = "scenario">
- Client creates a new queue, and then without explicitly binding it to an
- exchange, attempts to send a message through the default exchange binding,
- i.e. publish a message to the empty exchange, with the queue name as routing
- key.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_35" -->
- <rule name = "minimum-queues">
- <doc>
- The server SHOULD support a minimum of 256 queues per virtual host and ideally,
- impose no limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- Client attempts to create as many queues as it can until the server reports
- an error. The resulting count must at least be 256.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "declare-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- When a client defines a new queue, this belongs to the access realm of the
- ticket used. All further work done with that queue must be done with an access
- ticket for the same realm.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access to
- the realm in which the queue exists or will be created.
- </doc>
- <doc type = "scenario">
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <rule name = "default-name">
- <doc>
- The queue name MAY be empty, in which case the server MUST create a new
- queue with a unique generated name and return this to the client in the
- Declare-Ok method.
- </doc>
- <doc type = "scenario">
- Client attempts to create several queues with an empty name. The client then
- verifies that the server-assigned names are unique and different.
- </doc>
- </rule>
- <rule name = "reserved-prefix" on-failure = "not-allowed">
- <doc>
- Queue names starting with "amq." are reserved for predeclared and
- standardised server queues. A client MAY NOT attempt to declare a queue with a
- name that starts with "amq." and the passive option set to zero.
- </doc>
- <doc type = "scenario">
- A client attempts to create a queue with a name starting with "amq." and with
- the passive option set to zero.
- </doc>
- </rule>
- <assert check = "regexp" value = "^[a-zA-Z0-9-_.:]*$" />
- </field>
-
- <field name = "passive" domain = "bit" label = "do not create queue">
- <doc>
- If set, the server will not create the queue. This field allows the client
- to assert the presence of a queue without modifying the server state.
- </doc>
- <rule name = "passive" on-failure = "not-found">
- <doc>
- The client MAY ask the server to assert that a queue exists without
- creating the queue if not. If the queue does not exist, the server
- treats this as a failure.
- </doc>
- <doc type = "scenario">
- Client declares an existing queue with the passive option and expects
- the server to respond with a declare-ok. Client then attempts to declare
- a non-existent queue with the passive option, and the server must close
- the channel with the correct reply-code.
- </doc>
- </rule>
- </field>
-
- <field name = "durable" domain = "bit" label = "request a durable queue">
- <doc>
- If set when creating a new queue, the queue will be marked as durable. Durable
- queues remain active when a server restarts. Non-durable queues (transient
- queues) are purged if/when a server restarts. Note that durable queues do not
- necessarily hold persistent messages, although it does not make sense to send
- persistent messages to a transient queue.
- </doc>
- <!-- Rule test name: was "amq_queue_03" -->
- <rule name = "persistence">
- <doc>The server MUST recreate the durable queue after a restart.</doc>
-
- <!-- TODO: use 'client does something' rather than 'a client does something'. -->
- <doc type = "scenario">
- A client creates a durable queue. The server is then restarted. The client
- then attempts to send a message to the queue. The message should be successfully
- delivered.
- </doc>
- </rule>
- <!-- Rule test name: was "amq_queue_36" -->
- <rule name = "types">
- <doc>The server MUST support both durable and transient queues.</doc>
- <doc type = "scenario">
- A client creates two named queues, one durable and one transient.
- </doc>
- </rule>
- <!-- Rule test name: was "amq_queue_37" -->
- <rule name = "pre-existence">
- <doc>The server MUST ignore the durable field if the queue already exists.</doc>
- <doc type = "scenario">
- A client creates two named queues, one durable and one transient. The client
- then attempts to declare the two queues using the same names again, but reversing
- the value of the durable flag in each case. Verify that the queues still exist
- with the original durable flag values.
- <!-- TODO: but how? -->
- </doc>
- </rule>
- </field>
-
- <field name = "exclusive" domain = "bit" label = "request an exclusive queue">
- <doc>
- Exclusive queues may only be consumed from by the current connection. Setting
- the 'exclusive' flag always implies 'auto-delete'.
- </doc>
-
- <!-- Rule test name: was "amq_queue_38" -->
- <rule name = "types">
- <doc>
- The server MUST support both exclusive (private) and non-exclusive (shared)
- queues.
- </doc>
- <doc type = "scenario">
- A client creates two named queues, one exclusive and one non-exclusive.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_04" -->
- <rule name = "02" on-failure = "channel-error">
- <doc>
- The client MAY NOT attempt to declare any existing and exclusive queue
- on multiple connections.
- </doc>
- <doc type = "scenario">
- A client declares an exclusive named queue. A second client on a different
- connection attempts to declare a queue of the same name.
- </doc>
- </rule>
- </field>
-
- <field name = "auto-delete" domain = "bit" label = "auto-delete queue when unused">
- <doc>
- If set, the queue is deleted when all consumers have finished using it. Last
- consumer can be cancelled either explicitly or because its channel is closed. If
- there was no consumer ever on the queue, it won't be deleted.
- </doc>
-
- <!-- Rule test name: was "amq_queue_31" -->
- <rule name = "pre-existence">
- <doc>
- The server MUST ignore the auto-delete field if the queue already exists.
- </doc>
- <doc type = "scenario">
- A client creates two named queues, one as auto-delete and one explicit-delete.
- The client then attempts to declare the two queues using the same names again,
- but reversing the value of the auto-delete field in each case. Verify that the
- queues still exist with the original auto-delete flag values.
- <!-- TODO: but how? -->
- </doc>
- </rule>
- </field>
-
- <field name = "arguments" domain = "table" label = "arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these
- arguments depends on the server implementation. This field is ignored if passive
- is 1.
- </doc>
- </field>
- </method>
-
- <method name = "declare-ok" synchronous = "1" index = "11" label = "confirms a queue definition">
- <doc>
- This method confirms a Declare method and confirms the name of the queue, essential
- for automatically-named queues.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Reports the name of the queue. If the server generated a queue name, this field
- contains that name.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "message-count" domain = "long" label = "number of messages in queue">
- <doc>
- Reports the number of messages in the queue, which will be zero for
- newly-created queues.
- </doc>
- </field>
-
- <field name = "consumer-count" domain = "long" label = "number of consumers">
- <doc>
- Reports the number of active consumers for the queue. Note that consumers can
- suspend activity (Channel.Flow) in which case they do not appear in this count.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "bind" synchronous = "1" index = "20" label = "bind queue to an exchange">
- <doc>
- This method binds a queue to an exchange. Until a queue is bound it will not receive
- any messages. In a classic messaging model, store-and-forward queues are bound to a
- dest exchange and subscription queues are bound to a dest_wild exchange.
- </doc>
-
- <!-- Rule test name: was "amq_queue_25" -->
- <rule name = "duplicates">
- <doc>
- A server MUST allow ignore duplicate bindings - that is, two or more bind
- methods for a specific queue, with identical arguments - without treating these
- as an error.
- </doc>
- <doc type = "scenario">
- A client binds a named queue to an exchange. The client then repeats the bind
- (with identical arguments).
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_39" -->
- <rule name = "failure" on-failure = "??????">
- <!--
- TODO: Find correct code. The on-failure code returned should depend on why the bind
- failed. Assuming that failures owing to bad parameters are covered in the rules relating
- to those parameters, the only remaining reason for a failure would be the lack of
- server resorces or some internal error - such as too many queues open. Would these
- cases qualify as "resource error" 506 or "internal error" 541?
- -->
- <doc>If a bind fails, the server MUST raise a connection exception.</doc>
- <doc type = "scenario">
- TODO
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_12" -->
- <rule name = "transient-exchange" on-failure = "not-allowed">
- <doc>
- The server MUST NOT allow a durable queue to bind to a transient exchange.
- </doc>
- <doc type = "scenario">
- A client creates a transient exchange. The client then declares a named durable
- queue and then attempts to bind the transient exchange to the durable queue.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_13" -->
- <rule name = "durable-exchange">
- <doc>
- Bindings for durable queues are automatically durable and the server SHOULD
- restore such bindings after a server restart.
- </doc>
- <doc type = "scenario">
- A server creates a named durable queue and binds it to a durable exchange. The
- server is restarted. The client then attempts to use the queue/exchange combination.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_17" -->
- <rule name = "internal-exchange">
- <doc>
- If the client attempts to bind to an exchange that was declared as internal, the server
- MUST raise a connection exception with reply code 530 (not allowed).
- </doc>
- <doc type = "scenario">
- A client attempts to bind a named queue to an internal exchange.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_40" -->
- <rule name = "binding-count">
- <doc>
- The server SHOULD support at least 4 bindings per queue, and ideally, impose no
- limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- A client creates a named queue and attempts to bind it to 4 different non-internal
- exchanges.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "bind-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- The client provides a valid access ticket giving "active" access rights to the
- queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to bind. If the queue name is empty, refers to
- the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "empty-queue" on-failure = "not-allowed">
- <doc>
- A client MUST NOT be allowed to bind a non-existent and unnamed queue (i.e.
- empty queue name) to an exchange.
- </doc>
- <doc type = "scenario">
- A client attempts to bind with an unnamed (empty) queue name to an exchange.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_26" -->
- <rule name = "queue-existence" on-failure = "not-found">
- <doc>
- A client MUST NOT be allowed to bind a non-existent queue (i.e. not previously
- declared) to an exchange.
- </doc>
- <doc type = "scenario">
- A client attempts to bind an undeclared queue name to an exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name" label = "name of the exchange to bind to">
- <!-- Rule test name: was "amq_queue_14" -->
- <rule name = "exchange-existence" on-failure = "not-found">
- <doc>
- A client MUST NOT be allowed to bind a queue to a non-existent exchange.
- </doc>
- <doc type = "scenario">
- A client attempts to bind an named queue to a undeclared exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "message routing key">
- <doc>
- Specifies the routing key for the binding. The routing key is used for routing
- messages depending on the exchange configuration. Not all exchanges use a
- routing key - refer to the specific exchange documentation. If the queue name
- is empty, the server uses the last queue declared on the channel. If the
- routing key is also empty, the server uses this queue name for the routing
- key as well. If the queue name is provided but the routing key is empty, the
- server does the binding with that empty routing key. The meaning of empty
- routing keys depends on the exchange implementation.
- </doc>
- </field>
-
- <field name = "arguments" domain = "table" label = "arguments for binding">
- <doc>
- A set of arguments for the binding. The syntax and semantics of these arguments
- depends on the exchange class.
- </doc>
- </field>
- </method>
-
- <method name = "bind-ok" synchronous = "1" index = "21" label = "confirm bind successful">
- <doc>This method confirms that the bind was successful.</doc>
-
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "purge" synchronous = "1" index = "30" label = "purge a queue">
- <doc>
- This method removes all messages from a queue. It does not cancel consumers. Purged
- messages are deleted without any formal "undo" mechanism.
- </doc>
-
- <!-- Rule test name: was "amq_queue_15" -->
- <rule name = "01">
- <doc>A call to purge MUST result in an empty queue.</doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_41" -->
- <rule name = "02">
- <doc>
- On transacted channels the server MUST not purge messages that have already been
- sent to a client but not yet acknowledged.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <!-- Rule test name: was "amq_queue_42" -->
- <rule name = "03">
- <doc>
- The server MAY implement a purge queue or log that allows system administrators
- to recover accidentally-purged messages. The server SHOULD NOT keep purged
- messages in the same storage spaces as the live messages since the volumes of
- purged messages may get very large.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "purge-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>The access ticket must be for the access realm that holds the queue.</doc>
-
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the queue's access realm. Note that purging a queue is equivalent to reading
- all messages and discarding them.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to purge. If the queue name is empty, refers to
- the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
-
- <!-- TODO Rule split? -->
-
- <!-- Rule test name: was "amq_queue_16" -->
- <rule name = "02">
- <doc>
- The queue MUST exist. Attempting to purge a non-existing queue MUST cause a
- channel exception.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "purge-ok" synchronous = "1" index = "31" label = "confirms a queue purge">
- <doc>This method confirms the purge of a queue.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "message-count" domain = "long" label = "number of messages purged">
- <doc>Reports the number of messages purged.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "delete" synchronous = "1" index = "40" label = "delete a queue">
- <doc>
- This method deletes a queue. When a queue is deleted any pending messages are sent
- to a dead-letter queue if this is defined in the server configuration, and all
- consumers on the queue are cancelled.
- </doc>
-
- <!-- TODO: Rule split? -->
-
- <!-- Rule test name: was "amq_queue_43" -->
- <rule name = "01">
- <doc>
- The server SHOULD use a dead-letter queue to hold messages that were pending on
- a deleted queue, and MAY provide facilities for a system administrator to move
- these messages back to an active queue.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "delete-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- The client provides a valid access ticket giving "active" access rights to the
- queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to delete. If the queue name is empty, refers to
- the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_21" -->
- <rule name = "02">
- <doc>
- The queue must exist. If the client attempts to delete a non-existing queue
- the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
- </field>
-
- <field name = "if-unused" domain = "bit" label = "delete only if unused">
- <doc>
- If set, the server will only delete the queue if it has no consumers. If the
- queue has consumers the server does does not delete it but raises a channel
- exception instead.
- </doc>
-
- <!-- Rule test name: was "amq_queue_29" and "amq_queue_30" -->
- <rule name = "01">
- <doc>The server MUST respect the if-unused flag when deleting a queue.</doc>
- </rule>
- </field>
-
- <field name = "if-empty" domain = "bit" label = "delete only if empty">
- <doc>
- If set, the server will only delete the queue if it has no messages.
- </doc>
- <rule name = "01">
- <doc>
- If the queue is not empty the server MUST raise a channel exception with
- reply code 406 (precondition failed).
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "delete-ok" synchronous = "1" index = "41" label = "confirm deletion of a queue">
- <doc>This method confirms the deletion of a queue.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "message-count" domain = "long" label = "number of messages purged">
- <doc>Reports the number of messages purged.</doc>
- </field>
- </method>
- </class>
-
- <!-- == BASIC ============================================================ -->
-
- <class name = "basic" handler = "channel" index = "60" label = "work with basic content">
- <doc>
- The Basic class provides methods that support an industry-standard messaging model.
- </doc>
-
- <doc type = "grammar">
- basic = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN content
- / S:DELIVER content
- / C:GET ( S:GET-OK content / S:GET-EMPTY )
- / C:ACK
- / C:REJECT
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MAY" />
-
- <!-- Rule test name: was "amq_basic_08" -->
- <rule name = "01">
- <doc>
- The server SHOULD respect the persistent property of basic messages and
- SHOULD make a best-effort to hold persistent basic messages on a reliable
- storage mechanism.
- </doc>
- <doc type = "scenario">
- Send a persistent message to queue, stop server, restart server and then
- verify whether message is still present. Assumes that queues are durable.
- Persistence without durable queues makes no sense.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_09" -->
- <rule name = "02">
- <doc>
- The server MUST NOT discard a persistent basic message in case of a queue
- overflow.
- </doc>
- <doc type = "scenario">
- Create a queue overflow situation with persistent messages and verify that
- messages do not get lost (presumably the server will write them to disk).
- </doc>
- </rule>
-
- <rule name = "03">
- <doc>
- The server MAY use the Channel.Flow method to slow or stop a basic message
- publisher when necessary.
- </doc>
- <doc type = "scenario">
- Create a queue overflow situation with non-persistent messages and verify
- whether the server responds with Channel.Flow or not. Repeat with persistent
- messages.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_10" -->
- <rule name = "04">
- <doc>
- The server MAY overflow non-persistent basic messages to persistent
- storage.
- </doc>
- <!-- Test scenario: untestable -->
- </rule>
-
- <rule name = "05">
- <doc>
- The server MAY discard or dead-letter non-persistent basic messages on a
- priority basis if the queue size exceeds some configured limit.
- </doc>
- <!-- Test scenario: untestable -->
- </rule>
-
- <!-- Rule test name: was "amq_basic_11" -->
- <rule name = "06">
- <doc>
- The server MUST implement at least 2 priority levels for basic messages,
- where priorities 0-4 and 5-9 are treated as two distinct levels.
- </doc>
- <doc type = "scenario">
- Send a number of priority 0 messages to a queue. Send one priority 9
- message. Consume messages from the queue and verify that the first message
- received was priority 9.
- </doc>
- </rule>
-
- <rule name = "07">
- <doc>
- The server MAY implement up to 10 priority levels.
- </doc>
- <doc type = "scenario">
- Send a number of messages with mixed priorities to a queue, so that all
- priority values from 0 to 9 are exercised. A good scenario would be ten
- messages in low-to-high priority. Consume from queue and verify how many
- priority levels emerge.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_12" -->
- <rule name = "08">
- <doc>
- The server MUST deliver messages of the same priority in order irrespective of
- their individual persistence.
- </doc>
- <doc type = "scenario">
- Send a set of messages with the same priority but different persistence
- settings to a queue. Consume and verify that messages arrive in same order
- as originally published.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_13" -->
- <rule name = "09">
- <doc>
- The server MUST support automatic acknowledgements on Basic content, i.e.
- consumers with the no-ack field set to FALSE.
- </doc>
- <doc type = "scenario">
- Create a queue and a consumer using automatic acknowledgements. Publish
- a set of messages to the queue. Consume the messages and verify that all
- messages are received.
- </doc>
- </rule>
-
- <rule name = "10">
- <doc>
- The server MUST support explicit acknowledgements on Basic content, i.e.
- consumers with the no-ack field set to TRUE.
- </doc>
- <doc type = "scenario">
- Create a queue and a consumer using explicit acknowledgements. Publish a
- set of messages to the queue. Consume the messages but acknowledge only
- half of them. Disconnect and reconnect, and consume from the queue.
- Verify that the remaining messages are received.
- </doc>
- </rule>
-
- <!-- These are the properties for a Basic content -->
-
- <field name = "content-type" domain = "shortstr" label = "MIME content type" />
- <field name = "content-encoding" domain = "shortstr" label = "MIME content encoding" />
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "delivery-mode" domain = "octet" label = "non-persistent (1) or persistent (2)" />
- <field name = "priority" domain = "short" label = "message priority, 0 to 9" />
- <field name = "correlation-id" domain = "shortstr" label = "application correlation identifier" />
- <field name = "reply-to" domain = "shortstr" label = "destination to reply to" />
- <field name = "expiration" domain = "shortstr" label = "message expiration specification" />
- <field name = "timestamp" domain = "timestamp" label = "message timestamp" />
- <field name = "message-id" domain = "shortstr" label = "application message identifier" />
- <field name = "type" domain = "shortstr" label = "message type name" />
- <field name = "user-id" domain = "shortstr" label = "creating user id" />
- <field name = "app-id" domain = "shortstr" label = "creating application id" />
- <!-- This field is deprecated pending review -->
- <field name = "cluster-id" domain = "shortstr" label = "intra-cluster routing identifier" />
-
- <!-- Type diversity test -->
- <field name = "property-bit" domain = "bit" label = "Extra property for testing only" />
- <field name = "property-octet" domain = "octet" label = "Extra property for testing only" />
- <field name = "property-short" domain = "short" label = "Extra property for testing only" />
- <field name = "property-long" domain = "long" label = "Extra property for testing only" />
- <field name = "property-longlong" domain = "longlong" label = "Extra property for testing only" />
- <field name = "property-shortstr" domain = "shortstr" label = "Extra property for testing only" />
- <field name = "property-longstr" domain = "longstr" label = "Extra property for testing only" />
- <field name = "property-timestamp" domain = "timestamp" label = "Extra property for testing only" />
- <field name = "property-table" domain = "table" label = "Extra property for testing only" />
- <field name = "property-access-ticket" domain = "access-ticket" label = "Extra property for testing only" />
- <field name = "property-class-id" domain = "class-id" label = "Extra property for testing only" />
- <field name = "property-consumer-tag" domain = "consumer-tag" label = "Extra property for testing only" />
- <field name = "property-delivery-tag" domain = "delivery-tag" label = "Extra property for testing only" />
- <field name = "property-exchange-name" domain = "exchange-name" label = "Extra property for testing only" />
- <field name = "property-known-hosts" domain = "known-hosts" label = "Extra property for testing only" />
- <field name = "property-method-id" domain = "method-id" label = "Extra property for testing only" />
- <field name = "property-no-ack" domain = "no-ack" label = "Extra property for testing only" />
- <field name = "property-no-local" domain = "no-local" label = "Extra property for testing only" />
- <field name = "property-path" domain = "path" label = "Extra property for testing only" />
- <field name = "property-peer-properties" domain = "peer-properties" label = "Extra property for testing only" />
- <field name = "property-queue-name" domain = "queue-name" label = "Extra property for testing only" />
- <field name = "property-redelivered" domain = "redelivered" label = "Extra property for testing only" />
- <field name = "property-reply-code" domain = "reply-code" label = "Extra property for testing only" />
- <field name = "property-reply-text" domain = "reply-text" label = "Extra property for testing only" />
-
- <!-- Bit field test -->
- <field name = "property-long-A" domain = "long" label = "Extra property for testing only" />
- <field name = "property-bit-B" domain = "bit" label = "Extra property for testing only" />
- <field name = "property-bit-C" domain = "bit" label = "Extra property for testing only" />
- <field name = "property-bit-D" domain = "bit" label = "Extra property for testing only" />
- <field name = "property-bit-E" domain = "bit" label = "Extra property for testing only" />
- <field name = "property-bit-F" domain = "bit" label = "Extra property for testing only" />
- <field name = "property-shortstr-G" domain = "shortstr" label = "Extra property for testing only" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "qos" synchronous = "1" index = "10" label = "specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the
- current channel or for all channels on the connection. The particular properties and
- semantics of a qos method always depend on the content class semantics. Though the
- qos method could in principle apply to both peers, it is currently meaningful only
- for the server.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch-size" domain = "long" label = "prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client
- finishes processing a message, the following message is already held locally,
- rather than needing to be sent down the channel. Prefetching gives a performance
- improvement. This field specifies the prefetch window size in octets. The server
- will send a message in advance if it is equal to or smaller in size than the
- available prefetch size (and also falls into other prefetch limits). May be set
- to zero, meaning "no specific limit", although other prefetch limits may still
- apply. The prefetch-size is ignored if the no-ack option is set.
- </doc>
- <!-- Rule test name: was "amq_basic_17" -->
- <rule name = "01">
- <doc>
- The server MUST ignore this setting when the client is not processing any
- messages - i.e. the prefetch size does not limit the transfer of single
- messages to a client, only the sending in advance of more messages while
- the client still has one or more unacknowledged messages.
- </doc>
- <doc type = "scenario">
- Define a QoS prefetch-size limit and send a single message that exceeds
- that limit. Verify that the message arrives correctly.
- </doc>
- </rule>
- </field>
-
- <field name = "prefetch-count" domain = "short" label = "prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This field may be used
- in combination with the prefetch-size field; a message will only be sent in
- advance if both prefetch windows (and those at the channel and connection level)
- allow it. The prefetch-count is ignored if the no-ack option is set.
- </doc>
- <!-- Rule test name: was "amq_basic_18" -->
- <rule name = "01">
- <doc>
- The server may send less data in advance than allowed by the client's
- specified prefetch windows but it MUST NOT send more.
- </doc>
- <doc type = "scenario">
- Define a QoS prefetch-size limit and a prefetch-count limit greater than
- one. Send multiple messages that exceed the prefetch size. Verify that
- no more than one message arrives at once.
- </doc>
- </rule>
- </field>
-
- <field name = "global" domain = "bit" label = "apply to entire connection">
- <doc>
- By default the QoS settings apply to the current channel only. If this field is
- set, they are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <method name = "qos-ok" synchronous = "1" index = "11" label = "confirm the requested qos">
- <doc>
- This method tells the client that the requested QoS levels could be handled by the
- server. The requested QoS applies to all active consumers until a new QoS is
- defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "consume" synchronous = "1" index = "20" label = "start a queue consumer">
- <doc>
- This method asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the channel they were
- created on, or until the client cancels them.
- </doc>
-
- <!-- Rule test name: was "amq_basic_01" -->
- <rule name = "01">
- <doc>
- The server SHOULD support at least 16 consumers per queue, and ideally, impose
- no limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- Create a queue and create consumers on that queue until the server closes the
- connection. Verify that the number of consumers created was at least sixteen
- and report the total number.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer with an invalid (non-zero) access ticket.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
- <rule name = "01" on-failure = "not-allowed">
- <doc>
- If the queue name is empty the client MUST have previously declared a
- queue using this channel.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer with an empty queue name and no previously
- declared queue on the channel.
- </doc>
- </rule>
- </field>
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a
- connection, so two clients can use the same consumer tags. If this field is
- empty the server will generate a unique tag.
- </doc>
- <rule name = "01" on-failure = "not-allowed">
- <doc>
- The client MUST NOT specify a tag that refers to an existing consumer.
- </doc>
- <doc type = "scenario">
- Attempt to create two consumers with the same non-empty tag.
- </doc>
- </rule>
- <rule name = "02" on-failure = "not-allowed">
- <doc>
- The consumer tag is valid only within the channel from which the
- consumer was created. I.e. a client MUST NOT create a consumer in one
- channel and then use it in another.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer in one channel, then use in another channel,
- in which consumers have also been created (to test that the server uses
- unique consumer tags).
- </doc>
- </rule>
- </field>
-
- <field name = "no-local" domain = "no-local" />
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise
- a channel or connection exception.
- </doc>
- </field>
-
- <field name = "bit-test-1" domain = "bit" />
- <field name = "bit-test-2" domain = "bit" />
- <field name = "bit-test-3" domain = "bit" />
- <field name = "bit-test-4" domain = "bit" />
- <field name = "bit-test-5" domain = "bit" />
- <field name = "bit-test-6" domain = "bit" />
- <field name = "bit-test-7" domain = "bit" />
- <field name = "bit-test-8" domain = "bit" />
- <field name = "bit-test-9" domain = "bit" />
-
- <field name = "no-ack" domain = "short" />
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the
- queue.
- </doc>
- <!-- Rule test name: was "amq_basic_02" -->
- <rule name = "01" on-failure = "access-refused">
- <doc>
- The client MAY NOT gain exclusive access to a queue that already has
- active consumers.
- </doc>
- <doc type = "scenario">
- Open two connections to a server, and in one connection create a shared
- (non-exclusive) queue and then consume from the queue. In the second
- connection attempt to consume from the same queue using the exclusive
- option.
- </doc>
- </rule>
- </field>
-
- <field name = "priority" domain = "short" label = "consume priority"/>
- </method>
-
- <method name = "consume-ok" synchronous = "1" index = "21" label = "confirm a new consumer">
- <doc>
- The server provides the client with a consumer tag, which is used by the client
- for methods called on the consumer at a later stage.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Holds the consumer tag specified by the client or provided by the server.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "cancel" synchronous = "1" index = "30" label = "end a queue consumer">
- <doc>
- This method cancels a consumer. This does not affect already delivered
- messages, but it does mean the server will not send any more messages for
- that consumer. The client may receive an abitrary number of messages in
- between sending the cancel method and receiving the cancel-ok reply.
- </doc>
-
- <rule name = "01">
- <doc>
- If the queue does not exist the server MUST ignore the cancel method, so
- long as the consumer tag is valid for that channel.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <method name = "cancel-ok" synchronous = "1" index = "31" label = "confirm a cancelled consumer">
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "publish" content = "1" index = "40" label = "publish a message">
- <doc>
- This method publishes a message to a specific exchange. The message will be routed
- to queues as defined by the exchange configuration and distributed to any active
- consumers when the transaction, if any, is committed.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "write" access rights
- to the access realm for the exchange.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be
- empty, meaning the default exchange. If the exchange name is specified, and that
- exchange does not exist, the server will raise a channel exception.
- </doc>
-
- <!-- Rule test name: was "amq_basic_06" -->
- <rule name = "01">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_14" -->
- <rule name = "02">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST raise
- a channel exception with a reply code 403 (access refused).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_15" -->
- <rule name = "03">
- <doc>
- The exchange MAY refuse basic content in which case it MUST raise a channel
- exception with reply code 540 (not implemented).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing
- messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" domain = "bit" label = "indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue. If this flag is set, the server will return an unroutable message with a
- Return method. If this flag is zero, the server silently drops the message.
- </doc>
- <!-- Rule test name: was "amq_basic_07" -->
- <rule name = "01">
- <doc>
- The server SHOULD implement the mandatory flag.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "immediate" domain = "bit" label = "request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue consumer immediately. If this flag is set, the server will return an
- undeliverable message with a Return method. If this flag is zero, the server
- will queue the message, but with no guarantee that it will ever be consumed.
- </doc>
- <!-- Rule test name: was "amq_basic_16" -->
- <rule name = "01">
- <doc>
- The server SHOULD implement the immediate flag.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "return" content = "1" index = "50" label = "return a failed message">
- <doc>
- This method returns an undeliverable message that was published with the "immediate"
- flag set, or an unroutable message published with the "mandatory" flag set. The
- reply code and text provide information about the reason that the message was
- undeliverable.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply-code" domain = "reply-code" />
-
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "deliver" content = "1" index = "60"
- label = "notify the client of a consumer message">
- <doc>
- This method delivers a message to the client, via a consumer. In the asynchronous
- message delivery model, the client starts a consumer using the Consume method, then
- the server responds with Deliver methods as and when messages arrive for that
- consumer.
- </doc>
-
- <!-- Rule test name: was "amq_basic_19" -->
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server SHOULD track the number of times a message has been delivered to
- clients and when a message is redelivered a certain number of times - e.g. 5
- times - without being acknowledged, the server SHOULD consider the message to be
- unprocessable (possibly causing client applications to abort), and move the
- message to a dead letter queue.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "get" synchronous = "1" index = "70" label = "direct access to a queue">
- <doc>
- This method provides a direct access to the messages in a queue using a synchronous
- dialogue that is designed for specific types of application where synchronous
- functionality is more important than performance.
- </doc>
-
- <response name = "get-ok" />
- <response name = "get-empty" />
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "no-ack" domain = "no-ack" />
- </method>
-
- <method name = "get-ok" synchronous = "1" content = "1" index = "71"
- label = "provide client with a message">
- <doc>
- This method delivers a message to the client following a get method. A message
- delivered by 'get-ok' must be acknowledged unless the no-ack option was set in the
- get method.
- </doc>
-
- <chassis name = "client" implement = "MAY" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- If empty, the message was published to the default exchange.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
-
- <field name = "message-count" domain = "long" label = "number of messages pending">
- <doc>
- This field reports the number of messages pending on the queue, excluding the
- message being delivered. Note that this figure is indicative, not reliable, and
- can change arbitrarily as messages are added to the queue and removed by other
- clients.
- </doc>
- </field>
- </method>
-
- <method name = "get-empty" synchronous = "1" index = "72"
- label = "indicate no messages available">
- <doc>
- This method tells the client that the queue has no messages available for the
- client.
- </doc>
-
- <chassis name = "client" implement = "MAY" />
-
- <!-- This field is deprecated pending review -->
- <field name = "cluster-id" domain = "shortstr" label = "Cluster id">
- <doc>
- For use by cluster applications, should not be used by client applications.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "ack" index = "80" label = "acknowledge one or more messages">
- <doc>
- This method acknowledges one or more messages delivered via the Deliver or Get-Ok
- methods. The client can ask to confirm a single message or a set of messages up to
- and including a specific message.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "multiple" domain = "bit" label = "acknowledge multiple messages">
- <doc>
- If set to 1, the delivery tag is treated as "up to and including", so that the
- client can acknowledge multiple messages with a single method. If set to zero,
- the delivery tag refers to a single message. If the multiple field is 1, and the
- delivery tag is zero, tells the server to acknowledge all outstanding mesages.
- </doc>
-
- <!-- Rule test name: was "amq_basic_20" -->
- <rule name = "01">
- <doc>
- The server MUST validate that a non-zero delivery-tag refers to an delivered
- message, and raise a channel exception if this is not the case.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "reject" index = "90" label = "reject an incoming message">
- <doc>
- This method allows a client to reject a message. It can be used to interrupt and
- cancel large incoming messages, or return untreatable messages to their original
- queue.
- </doc>
-
- <!-- Rule test name: was "amq_basic_21" -->
- <rule name = "01">
- <doc>
- The server SHOULD be capable of accepting and process the Reject method while
- sending message content with a Deliver or Get-Ok method. I.e. the server should
- read and process incoming methods while sending output frames. To cancel a
- partially-send content, the server sends a content body frame of size 1 (i.e.
- with no data except the frame-end octet).
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_22" -->
- <rule name = "02">
- <doc>
- The server SHOULD interpret this method as meaning that the client is unable to
- process the message at this time.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <rule name = "03">
- <!-- TODO: Rule split? -->
- <doc>
- A client MUST NOT use this method as a means of selecting messages to process. A
- rejected message MAY be discarded or dead-lettered, not necessarily passed to
- another client.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "requeue" domain = "bit" label = "requeue the message">
- <doc>
- If this field is zero, the message will be discarded. If this bit is 1, the
- server will attempt to requeue the message.
- </doc>
-
- <!-- Rule test name: was "amq_basic_23" -->
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MUST NOT deliver the message to the same client within the
- context of the current channel. The recommended strategy is to attempt to
- deliver the message to an alternative consumer, and if that is not possible,
- to move the message to a dead-letter queue. The server MAY use more
- sophisticated tracking to hold the message on the queue and redeliver it to
- the same client at a later stage.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "recover" index = "100" label = "redeliver unacknowledged messages">
- <doc>
- This method asks the broker to redeliver all unacknowledged messages on a specified
- channel. Zero or more messages may be redelivered. This method is only allowed on
- non-transacted channels.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST set the redelivered flag on all messages that are resent.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- The server MUST raise a channel exception if this is called on a transacted
- channel.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "requeue" domain = "bit" label = "requeue the message">
- <doc>
- If this field is zero, the message will be redelivered to the original
- recipient. If this bit is 1, the server will attempt to requeue the message,
- potentially then delivering it to an alternative subscriber.
- </doc>
- </field>
- </method>
- </class>
-
- <!-- == FILE ============================================================= -->
-
- <class name = "file" handler = "channel" index = "70" label = "work with file content">
- <doc>
- The file class provides methods that support reliable file transfer. File
- messages have a specific set of properties that are required for interoperability
- with file transfer applications. File messages and acknowledgements are subject to
- channel transactions. Note that the file class does not provide message browsing
- methods; these are not compatible with the staging model. Applications that need
- browsable file transfer should use Basic content and the Basic class.
- </doc>
-
- <doc type = "grammar">
- file = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:OPEN S:OPEN-OK C:STAGE content
- / S:OPEN C:OPEN-OK S:STAGE content
- / C:PUBLISH
- / S:DELIVER
- / S:RETURN
- / C:ACK
- / C:REJECT
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <rule name = "01">
- <doc>
- The server MUST make a best-effort to hold file messages on a reliable storage
- mechanism.
- </doc>
- </rule>
-
- <!-- TODO Rule implement attr inverse? -->
-
- <!-- TODO: Rule split? -->
-
- <rule name = "02">
- <doc>
- The server MUST NOT discard a file message in case of a queue overflow. The server
- MUST use the Channel.Flow method to slow or stop a file message publisher when
- necessary.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "03">
- <doc>
- The server MUST implement at least 2 priority levels for file messages, where
- priorities 0-4 and 5-9 are treated as two distinct levels. The server MAY implement
- up to 10 priority levels.
- </doc>
- </rule>
-
- <rule name = "04">
- <doc>
- The server MUST support both automatic and explicit acknowledgements on file
- content.
- </doc>
- </rule>
-
- <!-- These are the properties for a File content -->
-
- <field name = "content-type" domain = "shortstr" label = "MIME content type" />
- <field name = "content-encoding" domain = "shortstr" label = "MIME content encoding" />
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "priority" domain = "octet" label = "message priority, 0 to 9" />
- <field name = "reply-to" domain = "shortstr" label = "destination to reply to" />
- <field name = "message-id" domain = "shortstr" label = "application message identifier" />
- <field name = "filename" domain = "shortstr" label = "message filename" />
- <field name = "timestamp" domain = "timestamp" label = "message timestamp" />
- <!-- This field is deprecated pending review -->
- <field name = "cluster-id" domain = "shortstr" label = "intra-cluster routing identifier" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "qos" synchronous = "1" index = "10" label = "specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the
- current channel or for all channels on the connection. The particular properties and
- semantics of a qos method always depend on the content class semantics. Though the
- qos method could in principle apply to both peers, it is currently meaningful only
- for the server.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "qos-ok" />
-
- <field name = "prefetch-size" domain = "long" label = "prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client
- finishes processing a message, the following message is already held locally,
- rather than needing to be sent down the channel. Prefetching gives a performance
- improvement. This field specifies the prefetch window size in octets. May be set
- to zero, meaning "no specific limit". Note that other prefetch limits may still
- apply. The prefetch-size is ignored if the no-ack option is set.
- </doc>
- </field>
-
- <field name = "prefetch-count" domain = "short" label = "prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This is compatible with
- some file API implementations. This field may be used in combination with the
- prefetch-size field; a message will only be sent in advance if both prefetch
- windows (and those at the channel and connection level) allow it. The
- prefetch-count is ignored if the no-ack option is set.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MAY send less data in advance than allowed by the client's
- specified prefetch windows but it MUST NOT send more.
- </doc>
- </rule>
- </field>
-
- <field name = "global" domain = "bit" label = "apply to entire connection">
- <doc>
- By default the QoS settings apply to the current channel only. If this field is
- set, they are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <method name = "qos-ok" synchronous = "1" index = "11" label = "confirm the requested qos">
- <doc>
- This method tells the client that the requested QoS levels could be handled by the
- server. The requested QoS applies to all active consumers until a new QoS is
- defined.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "consume" synchronous = "1" index = "20" label = "start a queue consumer">
- <doc>
- This method asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the channel they were
- created on, or until the client cancels them.
- </doc>
-
- <rule name = "01">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was
- declared as private, and ideally, impose no limit except as defined by available
- resources.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a
- connection, so two clients can use the same consumer tags. If this field is
- empty the server will generate a unique tag.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to
- create two consumers with the same non-empty tag the server MUST raise a
- connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "no-local" domain = "no-local" />
-
- <field name = "no-ack" domain = "no-ack" />
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the
- queue.
- </doc>
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, -
- because there are other consumers active - it MUST raise a channel exception
- with return code 405 (resource locked).
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "consume-ok" synchronous = "1" index = "21" label = "confirm a new consumer">
- <doc>
- This method provides the client with a consumer tag which it MUST use in methods
- that work with the consumer.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>Holds the consumer tag specified by the client or provided by the server.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "cancel" synchronous = "1" index = "30" label = "end a queue consumer">
- <doc>
- This method cancels a consumer. This does not affect already delivered messages, but
- it does mean the server will not send any more messages for that consumer.
- </doc>
-
- <response name = "cancel-ok" />
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <method name = "cancel-ok" synchronous = "1" index = "31" label = "confirm a cancelled consumer">
- <doc>This method confirms that the cancellation was completed.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "open" synchronous = "1" index = "40" label = "request to start staging">
- <doc>
- This method requests permission to start staging a message. Staging means sending
- the message into a temporary area at the recipient end and then delivering the
- message by referring to this temporary area. Staging is how the protocol handles
- partial file transfers - if a message is partially staged and the connection breaks,
- the next time the sender starts to stage it, it can restart from where it left off.
- </doc>
-
- <response name = "open-ok" />
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "identifier" domain = "shortstr" label = "staging identifier">
- <doc>
- This is the staging identifier. This is an arbitrary string chosen by the
- sender. For staging to work correctly the sender must use the same staging
- identifier when staging the same message a second time after recovery from a
- failure. A good choice for the staging identifier would be the SHA1 hash of the
- message properties data (including the original filename, revised time, etc.).
- </doc>
- </field>
-
- <field name = "content-size" domain = "longlong" label = "message content size">
- <doc>
- The size of the content in octets. The recipient may use this information to
- allocate or check available space in advance, to avoid "disk full" errors during
- staging of very large messages.
- </doc>
-
- <rule name = "01">
- <doc>
- The sender MUST accurately fill the content-size field. Zero-length content
- is permitted.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "open-ok" synchronous = "1" index = "41" label = "confirm staging ready">
- <doc>
- This method confirms that the recipient is ready to accept staged data. If the
- message was already partially-staged at a previous time the recipient will report
- the number of octets already staged.
- </doc>
-
- <response name = "stage" />
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "staged-size" domain = "longlong" label = "already staged amount">
- <doc>
- The amount of previously-staged content in octets. For a new message this will
- be zero.
- </doc>
-
- <rule name = "01">
- <doc>
- The sender MUST start sending data from this octet offset in the message,
- counting from zero.
- </doc>
- </rule>
-
- <rule name = "02">
- <!-- TODO: Rule split? -->
- <doc>
- The recipient MAY decide how long to hold partially-staged content and MAY
- implement staging by always discarding partially-staged content. However if
- it uses the file content type it MUST support the staging methods.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "stage" content = "1" index = "50" label = "stage message content">
- <doc>
- This method stages the message, sending the message content to the recipient from
- the octet offset specified in the Open-Ok method.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "publish" index = "60" label = "publish a message">
- <doc>
- This method publishes a staged file message to a specific exchange. The file message
- will be routed to queues as defined by the exchange configuration and distributed to
- any active consumers when the transaction, if any, is committed.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "write" access rights
- to the access realm for the exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be
- empty, meaning the default exchange. If the exchange name is specified, and that
- exchange does not exist, the server will raise a channel exception.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST
- respond with a reply code 403 (access refused) and raise a channel
- exception.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "03">
- <doc>
- The exchange MAY refuse file content in which case it MUST respond with a
- reply code 540 (not implemented) and raise a channel exception.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing
- messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" domain = "bit" label = "indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue. If this flag is set, the server will return an unroutable message with a
- Return method. If this flag is zero, the server silently drops the message.
- </doc>
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the mandatory flag.</doc>
- </rule>
- </field>
-
- <field name = "immediate" domain = "bit" label = "request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue consumer immediately. If this flag is set, the server will return an
- undeliverable message with a Return method. If this flag is zero, the server
- will queue the message, but with no guarantee that it will ever be consumed.
- </doc>
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the immediate flag.</doc>
- </rule>
- </field>
-
- <field name = "identifier" domain = "shortstr" label = "staging identifier">
- <doc>
- This is the staging identifier of the message to publish. The message must have
- been staged. Note that a client can send the Publish method asynchronously
- without waiting for staging to finish.
- </doc>
- </field>
- </method>
-
- <method name = "return" content = "1" index = "70" label = "return a failed message">
- <doc>
- This method returns an undeliverable message that was published with the "immediate"
- flag set, or an unroutable message published with the "mandatory" flag set. The
- reply code and text provide information about the reason that the message was
- undeliverable.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply-code" domain = "reply-code" />
-
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "deliver" index = "80" label = "notify the client of a consumer message">
- <doc>
- This method delivers a staged file message to the client, via a consumer. In the
- asynchronous message delivery model, the client starts a consumer using the Consume
- method, then the server responds with Deliver methods as and when messages arrive
- for that consumer.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server SHOULD track the number of times a message has been delivered to
- clients and when a message is redelivered a certain number of times - e.g. 5
- times - without being acknowledged, the server SHOULD consider the message to be
- unprocessable (possibly causing client applications to abort), and move the
- message to a dead letter queue.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
-
- <field name = "identifier" domain = "shortstr" label = "staging identifier">
- <doc>
- This is the staging identifier of the message to deliver. The message must have
- been staged. Note that a server can send the Deliver method asynchronously
- without waiting for staging to finish.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "ack" index = "90" label = "acknowledge one or more messages">
- <doc>
- This method acknowledges one or more messages delivered via the Deliver method. The
- client can ask to confirm a single message or a set of messages up to and including
- a specific message.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "multiple" domain = "bit" label = "acknowledge multiple messages">
- <doc>
- If set to 1, the delivery tag is treated as "up to and including", so that the
- client can acknowledge multiple messages with a single method. If set to zero,
- the delivery tag refers to a single message. If the multiple field is 1, and the
- delivery tag is zero, tells the server to acknowledge all outstanding mesages.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST validate that a non-zero delivery-tag refers to an delivered
- message, and raise a channel exception if this is not the case.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "reject" index = "100" label = "reject an incoming message">
- <doc>
- This method allows a client to reject a message. It can be used to return
- untreatable messages to their original queue. Note that file content is staged
- before delivery, so the client will not use this method to interrupt delivery of a
- large message.
- </doc>
-
- <rule name = "01">
- <doc>
- The server SHOULD interpret this method as meaning that the client is unable to
- process the message at this time.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "02">
- <doc>
- A client MUST NOT use this method as a means of selecting messages to process. A
- rejected message MAY be discarded or dead-lettered, not necessarily passed to
- another client.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "requeue" domain = "bit" label = "requeue the message">
- <doc>
- If this field is zero, the message will be discarded. If this bit is 1, the
- server will attempt to requeue the message.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MUST NOT deliver the message to the same client within the
- context of the current channel. The recommended strategy is to attempt to
- deliver the message to an alternative consumer, and if that is not possible,
- to move the message to a dead-letter queue. The server MAY use more
- sophisticated tracking to hold the message on the queue and redeliver it to
- the same client at a later stage.
- </doc>
- </rule>
- </field>
- </method>
- </class>
-
- <!-- == STREAM =========================================================== -->
-
- <class name = "stream" handler = "channel" index = "80" label = "work with streaming content">
- <doc>
- The stream class provides methods that support multimedia streaming. The stream class
- uses the following semantics: one message is one packet of data; delivery is
- unacknowleged and unreliable; the consumer can specify quality of service parameters
- that the server can try to adhere to; lower-priority messages may be discarded in favour
- of high priority messages.
- </doc>
-
- <doc type = "grammar">
- stream = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN
- / S:DELIVER content
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <rule name = "01">
- <doc>
- The server SHOULD discard stream messages on a priority basis if the queue size
- exceeds some configured limit.
- </doc>
- </rule>
-
- <rule name = "02">
- <!-- TODO: Rule split? -->
- <doc>
- The server MUST implement at least 2 priority levels for stream messages, where
- priorities 0-4 and 5-9 are treated as two distinct levels. The server MAY implement
- up to 10 priority levels.
- </doc>
- </rule>
-
- <rule name = "03">
- <doc>
- The server MUST implement automatic acknowledgements on stream content. That is, as
- soon as a message is delivered to a client via a Deliver method, the server must
- remove it from the queue.
- </doc>
- </rule>
-
- <!-- These are the properties for a Stream content -->
-
- <field name = "content-type" domain = "shortstr" label = "MIME content type" />
- <field name = "content-encoding" domain = "shortstr" label = "MIME content encoding" />
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "priority" domain = "octet" label = "message priority, 0 to 9" />
- <field name = "timestamp" domain = "timestamp" label = "message timestamp" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "qos" synchronous = "1" index = "10" label = "specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the
- current channel or for all channels on the connection. The particular properties and
- semantics of a qos method always depend on the content class semantics. Though the
- qos method could in principle apply to both peers, it is currently meaningful only
- for the server.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "qos-ok" />
-
- <field name = "prefetch-size" domain = "long" label = "prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client
- finishes processing a message, the following message is already held locally,
- rather than needing to be sent down the channel. Prefetching gives a performance
- improvement. This field specifies the prefetch window size in octets. May be set
- to zero, meaning "no specific limit". Note that other prefetch limits may still
- apply.
- </doc>
- </field>
-
- <field name = "prefetch-count" domain = "short" label = "prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This field may be used
- in combination with the prefetch-size field; a message will only be sent in
- advance if both prefetch windows (and those at the channel and connection level)
- allow it.
- </doc>
- </field>
-
- <field name = "consume-rate" domain = "long" label = "transfer rate in octets/second">
- <doc>
- Specifies a desired transfer rate in octets per second. This is usually
- determined by the application that uses the streaming data. A value of zero
- means "no limit", i.e. as rapidly as possible.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MAY ignore the prefetch values and consume rates, depending on
- the type of stream and the ability of the server to queue and/or reply it.
- The server MAY drop low-priority messages in favour of high-priority
- messages.
- </doc>
- </rule>
- </field>
-
- <field name = "global" domain = "bit" label = "apply to entire connection">
- <doc>
- By default the QoS settings apply to the current channel only. If this field is
- set, they are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <method name = "qos-ok" synchronous = "1" index = "11" label = "confirm the requested qos">
- <doc>
- This method tells the client that the requested QoS levels could be handled by the
- server. The requested QoS applies to all active consumers until a new QoS is
- defined.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "consume" synchronous = "1" index = "20" label = "start a queue consumer">
- <doc>
- This method asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the channel they were
- created on, or until the client cancels them.
- </doc>
-
- <rule name = "01">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was
- declared as private, and ideally, impose no limit except as defined by available
- resources.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- Streaming applications SHOULD use different channels to select different
- streaming resolutions. AMQP makes no provision for filtering and/or transforming
- streams except on the basis of priority-based selective delivery of individual
- messages.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a
- connection, so two clients can use the same consumer tags. If this field is
- empty the server will generate a unique tag.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to
- create two consumers with the same non-empty tag the server MUST raise a
- connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "no-local" domain = "no-local" />
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the
- queue.
- </doc>
-
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, -
- because there are other consumers active - it MUST raise a channel exception
- with return code 405 (resource locked).
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "consume-ok" synchronous = "1" index = "21" label = "confirm a new consumer">
- <doc>
- This method provides the client with a consumer tag which it may use in methods that
- work with the consumer.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>Holds the consumer tag specified by the client or provided by the server.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "cancel" synchronous = "1" index = "30" label = "end a queue consumer">
- <doc>
- This method cancels a consumer. Since message delivery is asynchronous the client
- may continue to receive messages for a short while after canceling a consumer. It
- may process or discard these as appropriate.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "cancel-ok" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <method name = "cancel-ok" synchronous = "1" index = "31" label = "confirm a cancelled consumer">
- <doc>This method confirms that the cancellation was completed.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "publish" content = "1" index = "40" label = "publish a message">
- <doc>
- This method publishes a message to a specific exchange. The message will be routed
- to queues as defined by the exchange configuration and distributed to any active
- consumers as appropriate.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "write" access rights
- to the access realm for the exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be
- empty, meaning the default exchange. If the exchange name is specified, and that
- exchange does not exist, the server will raise a channel exception.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST
- respond with a reply code 403 (access refused) and raise a channel
- exception.
- </doc>
- </rule>
-
- <rule name = "03">
- <doc>
- The exchange MAY refuse stream content in which case it MUST respond with a
- reply code 540 (not implemented) and raise a channel exception.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing
- messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" domain = "bit" label = "indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue. If this flag is set, the server will return an unroutable message with a
- Return method. If this flag is zero, the server silently drops the message.
- </doc>
-
- <!-- Rule test name: was "amq_stream_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the mandatory flag.</doc>
- </rule>
- </field>
-
- <field name = "immediate" domain = "bit" label = "request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue consumer immediately. If this flag is set, the server will return an
- undeliverable message with a Return method. If this flag is zero, the server
- will queue the message, but with no guarantee that it will ever be consumed.
- </doc>
-
- <!-- Rule test name: was "amq_stream_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the immediate flag.</doc>
- </rule>
- </field>
- </method>
-
- <method name = "return" content = "1" index = "50" label = "return a failed message">
- <doc>
- This method returns an undeliverable message that was published with the "immediate"
- flag set, or an unroutable message published with the "mandatory" flag set. The
- reply code and text provide information about the reason that the message was
- undeliverable.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply-code" domain = "reply-code" />
-
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "deliver" content = "1" index = "60"
- label = "notify the client of a consumer message">
- <doc>
- This method delivers a message to the client, via a consumer. In the asynchronous
- message delivery model, the client starts a consumer using the Consume method, then
- the server responds with Deliver methods as and when messages arrive for that
- consumer.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue that the message came from. Note that a single
- channel can start many consumers on different queues.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
- </class>
-
- <!-- == TX =============================================================== -->
-
- <class name = "tx" handler = "channel" index = "90" label = "work with standard transactions">
- <doc>
- Standard transactions provide so-called "1.5 phase commit". We can ensure that work is
- never lost, but there is a chance of confirmations being lost, so that messages may be
- resent. Applications that use standard transactions must be able to detect and ignore
- duplicate messages.
- </doc>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "01">
- <doc>
- An client using standard transactions SHOULD be able to track all messages received
- within a reasonable period, and thus detect and reject duplicates of the same
- message. It SHOULD NOT pass these to the application layer.
- </doc>
- </rule>
-
- <doc type = "grammar">
- tx = C:SELECT S:SELECT-OK
- / C:COMMIT S:COMMIT-OK
- / C:ROLLBACK S:ROLLBACK-OK
- </doc>
-
- <chassis name = "server" implement = "SHOULD" />
- <chassis name = "client" implement = "MAY" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "select" synchronous = "1" index = "10" label = "select standard transaction mode">
- <doc>
- This method sets the channel to use standard transactions. The client must use this
- method at least once on a channel before using the Commit or Rollback methods.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "select-ok" />
- </method>
-
- <method name = "select-ok" synchronous = "1" index = "11" label = "confirm transaction mode">
- <doc>
- This method confirms to the client that the channel was successfully set to use
- standard transactions.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "commit" synchronous = "1" index = "20" label = "commit the current transaction">
- <doc>
- This method commits all messages published and acknowledged in the current
- transaction. A new transaction starts immediately after a commit.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "commit-ok" />
- </method>
-
- <method name = "commit-ok" synchronous = "1" index = "21" label = "confirm a successful commit">
- <doc>
- This method confirms to the client that the commit succeeded. Note that if a commit
- fails, the server raises a channel exception.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "rollback" synchronous = "1" index = "30"
- label = "abandon the current transaction">
- <doc>
- This method abandons all messages published and acknowledged in the current
- transaction. A new transaction starts immediately after a rollback.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "rollback-ok" />
- </method>
-
- <method name = "rollback-ok" synchronous = "1" index = "31" label = "confirm successful rollback">
- <doc>
- This method confirms to the client that the rollback succeeded. Note that if an
- rollback fails, the server raises a channel exception.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
- </class>
-
- <!-- == DTX ============================================================== -->
-
- <class name = "dtx" handler = "channel" index = "100" label = "work with distributed transactions">
- <doc>
- Distributed transactions provide so-called "2-phase commit". The AMQP distributed
- transaction model supports the X-Open XA architecture and other distributed transaction
- implementations. The Dtx class assumes that the server has a private communications
- channel (not AMQP) to a distributed transaction coordinator.
- </doc>
-
- <doc type = "grammar">
- dtx = C:SELECT S:SELECT-OK
- C:START S:START-OK
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "select" synchronous = "1" index = "10" label = "select standard transaction mode">
- <doc>
- This method sets the channel to use distributed transactions. The client must use
- this method at least once on a channel before using the Start method.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "select-ok" />
- </method>
-
- <method name = "select-ok" synchronous = "1" index = "11" label = "confirm transaction mode">
- <doc>
- This method confirms to the client that the channel was successfully set to use
- distributed transactions.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "start" synchronous = "1" index = "20"
- label = "start a new distributed transaction">
- <doc>
- This method starts a new distributed transaction. This must be the first method on a
- new channel that uses the distributed transaction mode, before any methods that
- publish or consume messages.
- </doc>
- <chassis name = "server" implement = "MAY" />
- <response name = "start-ok" />
- <field name = "dtx-identifier" domain = "shortstr" label = "transaction identifier">
- <doc>
- The distributed transaction key. This identifies the transaction so that the
- AMQP server can coordinate with the distributed transaction coordinator.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <method name = "start-ok" synchronous = "1" index = "21"
- label = "confirm the start of a new distributed transaction">
- <doc>
- This method confirms to the client that the transaction started. Note that if a
- start fails, the server raises a channel exception.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
- </class>
-
- <!-- == TUNNEL =========================================================== -->
-
- <class name = "tunnel" handler = "tunnel" index = "110" label = "methods for protocol tunneling">
- <doc>
- The tunnel methods are used to send blocks of binary data - which can be serialised AMQP
- methods or other protocol frames - between AMQP peers.
- </doc>
-
- <doc type = "grammar">
- tunnel = C:REQUEST
- / S:REQUEST
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "proxy-name" domain = "shortstr" label = "identity of tunnelling proxy" />
- <field name = "data-name" domain = "shortstr" label = "name or type of message being tunnelled" />
- <field name = "durable" domain = "octet" label = "message durability indicator" />
- <field name = "broadcast" domain = "octet" label = "message broadcast mode" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "request" content = "1" index = "10" label = "sends a tunnelled method">
- <doc>
- This method tunnels a block of binary data, which can be an encoded
- AMQP method or other data. The binary data is sent as the content for
- the Tunnel.Request method.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <field name = "meta-data" domain = "table" label = "meta data for the tunnelled block">
- <doc>
- This field table holds arbitrary meta-data that the sender needs to
- pass to the recipient.
- </doc>
- </field>
- </method>
- </class>
-</amqp>
diff --git a/M4-RCs/qpid/gentools/xml-src/amqp-0.8.test.xml b/M4-RCs/qpid/gentools/xml-src/amqp-0.8.test.xml
deleted file mode 100644
index b0adf31828..0000000000
--- a/M4-RCs/qpid/gentools/xml-src/amqp-0.8.test.xml
+++ /dev/null
@@ -1,3959 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright Notice
- ================
- (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc.,
- iMatix Corporation, IONA\ufffd Technologies, Red Hat, Inc.,
- TWIST Process Innovations, and 29West Inc. 2006. All rights reserved.
-
- License
- =======
- JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
- Corporation, IONA\ufffd Technologies, Red Hat, Inc., TWIST Process Innovations, and
- 29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide,
- perpetual, royalty-free, nontransferable, nonexclusive license to
- (i) copy, display, and implement the Advanced Messaging Queue Protocol
- ("AMQP") Specification and (ii) the Licensed Claims that are held by
- the Authors, all for the purpose of implementing the Advanced Messaging
- Queue Protocol Specification. Your license and any rights under this
- Agreement will terminate immediately without notice from
- any Author if you bring any claim, suit, demand, or action related to
- the Advanced Messaging Queue Protocol Specification against any Author.
- Upon termination, you shall destroy all copies of the Advanced Messaging
- Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or
- patent application, throughout the world, excluding design patents and
- design registrations, owned or controlled, or that can be sublicensed
- without fee and in compliance with the requirements of this
- Agreement, by an Author or its affiliates now or at any
- future time and which would necessarily be infringed by implementation
- of the Advanced Messaging Queue Protocol Specification. A claim is
- necessarily infringed hereunder only when it is not possible to avoid
- infringing it because there is no plausible non-infringing alternative
- for implementing the required portions of the Advanced Messaging Queue
- Protocol Specification. Notwithstanding the foregoing, Licensed Claims
- shall not include any claims other than as set forth above even if
- contained in the same patent as Licensed Claims; or that read solely
- on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging
- Queue Protocol Specification, or that, if licensed, would require a
- payment of royalties by the licensor to unaffiliated third parties.
- Moreover, Licensed Claims shall not include (i) any enabling technologies
- that may be necessary to make or use any Licensed Product but are not
- themselves expressly set forth in the Advanced Messaging Queue Protocol
- Specification (e.g., semiconductor manufacturing technology, compiler
- technology, object oriented technology, networking technology, operating
- system technology, and the like); or (ii) the implementation of other
- published standards developed elsewhere and merely referred to in the
- body of the Advanced Messaging Queue Protocol Specification, or
- (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced
- Messaging Queue Protocol Specification. For purposes of this definition,
- the Advanced Messaging Queue Protocol Specification shall be deemed to
- include both architectural and interconnection requirements essential
- for interoperability and may also include supporting source code artifacts
- where such architectural, interconnection requirements and source code
- artifacts are expressly identified as being required or documentation to
- achieve compliance with the Advanced Messaging Queue Protocol Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions
- of products (hardware, software or combinations thereof) that implement
- and are compliant with all relevant portions of the Advanced Messaging
- Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any
- use you may make of the Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS,"
- AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
- IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE
- CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE
- SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY
- PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
- USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE
- PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner,
- including advertising or publicity pertaining to the Advanced Messaging
- Queue Protocol Specification or its contents without specific, written
- prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you
- shall destroy all copies of the Advanced Messaging Queue Protocol
- Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the
- Octagon Symbol are trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA
- Technologies PLC and/or its subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered
- trademarks of Red Hat, Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of
- Sun Microsystems, Inc. in the United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service
- marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
-
--->
-
-<!--
-========================================================
-EDITORS: (PH) Pieter Hintjens <ph@imatix.com>
- (KvdR) Kim van der Riet <kim.vdriet@redhat.com>
-
-NOTE: These editors have been assigned by the AMQP working group. Please do not
-edit/commit this file without consulting with one of the above editors.
-========================================================
-
-Revision history:
- 2006-06-07 (PH) - version number changed to 0.8 to conform to public
- release documentation.
-
- 2006-05-15 (PH) - fixed comments on queue name in basic.get to clarify
- use of current queue in this method.
-
- 2006-05-15 (PH) - fixed comments on routing key in queue.bind to clarify
- how routing key is filled when empty (to allow asynch queue.declare).
-
- 2006-05-11 (PH) - reset version to 0.70 so that putatitive standards
- group can release 2-3 major new versions before hitting 1.0 (again).
-
- 2006-05-11 (PH) - TODO in documentation: cycle field in frame header
- has been removed.
-
- 2006-05-11 (PH) - added nowait option to exchange.declare, delete,
- queue.declare, delete, bind, purge, basic.consume, cancel,
- file.consume, cancel, stream.consume and cancel methods.
-
- 2006-05-11 (PH) - removed notnull rule and added explanations on queue
- name in queue.bind, purge, delete, basic.consume, cancel, file.consume,
- cancel, stream.consume and cancel methods.
-
- 2006-05-11 (PH) - added basic.qos, file.qos, and stream.qos methods that
- regroup all prefetch options from the consume methods. Also removed the
- prefetch option from channel.open.
-
- 2006-05-11 (PH) - renumbered method indexes to show request-response
- nature of methods; requests are 10, 20, 30 while responses are 11, 21,
- etc.
-
- 2006-05-11 (PH) - removed OpenAMQ extension methods from this definition
- since these are maintained seperately.
-
- 2006-05-26 (RG) - added Basic.Recover method to allow replay of
- unacknowledged messages on a channel.
-
- 2006-07-03 (PH) - cosmetic clean-up of Basic.Recover comments.
--->
-
-<amqp major="8" minor="0" port="5672" comment="AMQ protocol 0.80">
- AMQ Protocol 0.80
-
-<!--
-======================================================
-== CONSTANTS
-======================================================
--->
- <constant name="frame method" value="1"/>
- <constant name="frame header" value="2"/>
- <constant name="frame body" value="3"/>
- <constant name="frame oob method" value="4"/>
- <constant name="frame oob header" value="5"/>
- <constant name="frame oob body" value="6"/>
- <constant name="frame trace" value="7"/>
- <constant name="frame heartbeat" value="8"/>
- <constant name="frame min size" value="4096"/>
- <constant name="frame end" value="206"/>
- <constant name="reply success" value="200">
- Indicates that the method completed successfully. This reply code is
- reserved for future use - the current protocol design does not use
- positive confirmation and reply codes are sent only in case of an
- error.
-</constant>
- <constant name="not delivered" value="310" class="soft error">
- The client asked for a specific message that is no longer available.
- The message was delivered to another client, or was purged from the
- queue for some other reason.
-</constant>
- <constant name="content too large" value="311" class="soft error">
- The client attempted to transfer content larger than the server
- could accept at the present time. The client may retry at a later
- time.
-</constant>
- <constant name="connection forced" value="320" class="hard error">
- An operator intervened to close the connection for some reason.
- The client may retry at some later date.
-</constant>
- <constant name="invalid path" value="402" class="hard error">
- The client tried to work with an unknown virtual host or cluster.
-</constant>
- <constant name="access refused" value="403" class="soft error">
- The client attempted to work with a server entity to which it has
- no due to security settings.
-</constant>
- <constant name="not found" value="404" class="soft error">
- The client attempted to work with a server entity that does not exist.
-</constant>
- <constant name="resource locked" value="405" class="soft error">
- The client attempted to work with a server entity to which it has
- no access because another client is working with it.
-</constant>
- <constant name="frame error" value="501" class="hard error">
- The client sent a malformed frame that the server could not decode.
- This strongly implies a programming error in the client.
-</constant>
- <constant name="syntax error" value="502" class="hard error">
- The client sent a frame that contained illegal values for one or more
- fields. This strongly implies a programming error in the client.
-</constant>
- <constant name="command invalid" value="503" class="hard error">
- The client sent an invalid sequence of frames, attempting to perform
- an operation that was considered invalid by the server. This usually
- implies a programming error in the client.
-</constant>
- <constant name="channel error" value="504" class="hard error">
- The client attempted to work with a channel that had not been
- correctly opened. This most likely indicates a fault in the client
- layer.
-</constant>
- <constant name="resource error" value="506" class="hard error">
- The server could not complete the method because it lacked sufficient
- resources. This may be due to the client creating too many of some
- type of entity.
-</constant>
- <constant name="not allowed" value="530" class="hard error">
- The client tried to work with some entity in a manner that is
- prohibited by the server, due to security settings or by some other
- criteria.
-</constant>
- <constant name="not implemented" value="540" class="hard error">
- The client tried to use functionality that is not implemented in the
- server.
-</constant>
- <constant name="internal error" value="541" class="hard error">
- The server could not complete the method because of an internal error.
- The server may require intervention by an operator in order to resume
- normal operations.
-</constant>
- <!--
-======================================================
-== DOMAIN TYPES
-======================================================
--->
- <domain name="access ticket" type="short">
- access ticket granted by server
- <doc>
- An access ticket granted by the server for a certain set of access
- rights within a specific realm. Access tickets are valid within the
- channel where they were created, and expire when the channel closes.
- </doc>
- <assert check="ne" value="0"/>
- </domain>
- <domain name="class id" type="short"/>
- <domain name="consumer tag" type="shortstr">
- consumer tag
- <doc>
- Identifier for the consumer, valid within the current connection.
- </doc>
- <rule implement="MUST">
- The consumer tag is valid only within the channel from which the
- consumer was created. I.e. a client MUST NOT create a consumer in
- one channel and then use it in another.
- </rule>
- </domain>
- <domain name="delivery tag" type="longlong">
- server-assigned delivery tag
- <doc>
- The server-assigned and channel-specific delivery tag
- </doc>
- <rule implement="MUST">
- The delivery tag is valid only within the channel from which the
- message was received. I.e. a client MUST NOT receive a message on
- one channel and then acknowledge it on another.
- </rule>
- <rule implement="MUST">
- The server MUST NOT use a zero value for delivery tags. Zero is
- reserved for client use, meaning "all messages so far received".
- </rule>
- </domain>
- <domain name="exchange name" type="shortstr">
- exchange name
- <doc>
- The exchange name is a client-selected string that identifies
- the exchange for publish methods. Exchange names may consist
- of any mixture of digits, letters, and underscores. Exchange
- names are scoped by the virtual host.
- </doc>
- <assert check="length" value="127"/>
- </domain>
- <domain name="known hosts" type="shortstr">
-list of known hosts
-<doc>
-Specifies the list of equivalent or alternative hosts that the server
-knows about, which will normally include the current server itself.
-Clients can cache this information and use it when reconnecting to a
-server after a failure.
-</doc>
- <rule implement="MAY">
-The server MAY leave this field empty if it knows of no other
-hosts than itself.
-</rule>
- </domain>
- <domain name="method id" type="short"/>
- <domain name="no ack" type="bit">
- no acknowledgement needed
- <doc>
- If this field is set the server does not expect acknowledgments
- for messages. That is, when a message is delivered to the client
- the server automatically and silently acknowledges it on behalf
- of the client. This functionality increases performance but at
- the cost of reliability. Messages can get lost if a client dies
- before it can deliver them to the application.
- </doc>
- </domain>
- <domain name="no local" type="bit">
- do not deliver own messages
- <doc>
- If the no-local field is set the server will not send messages to
- the client that published them.
- </doc>
- </domain>
- <domain name="path" type="shortstr">
- <doc>
- Must start with a slash "/" and continue with path names
- separated by slashes. A path name consists of any combination
- of at least one of [A-Za-z0-9] plus zero or more of [.-_+!=:].
-</doc>
- <assert check="notnull"/>
- <assert check="syntax" rule="path"/>
- <assert check="length" value="127"/>
- </domain>
- <domain name="peer properties" type="table">
- <doc>
-This string provides a set of peer properties, used for
-identification, debugging, and general information.
-</doc>
- <rule implement="SHOULD">
-The properties SHOULD contain these fields:
-"product", giving the name of the peer product, "version", giving
-the name of the peer version, "platform", giving the name of the
-operating system, "copyright", if appropriate, and "information",
-giving other general information.
-</rule>
- </domain>
- <domain name="queue name" type="shortstr">
- queue name
- <doc>
- The queue name identifies the queue within the vhost. Queue
- names may consist of any mixture of digits, letters, and
- underscores.
- </doc>
- <assert check="length" value="127"/>
- </domain>
- <domain name="redelivered" type="bit">
- message is being redelivered
- <doc>
- This indicates that the message has been previously delivered to
- this or another client.
- </doc>
- <rule implement="SHOULD">
- The server SHOULD try to signal redelivered messages when it can.
- When redelivering a message that was not successfully acknowledged,
- the server SHOULD deliver it to the original client if possible.
- </rule>
- <rule implement="MUST">
- The client MUST NOT rely on the redelivered field but MUST take it
- as a hint that the message may already have been processed. A
- fully robust client must be able to track duplicate received messages
- on non-transacted, and locally-transacted channels.
- </rule>
- </domain>
- <domain name="reply code" type="short">
-reply code from server
-<doc>
- The reply code. The AMQ reply codes are defined in AMQ RFC 011.
-</doc>
- <assert check="notnull"/>
- </domain>
- <domain name="reply text" type="shortstr">
-localised reply text
-<doc>
- The localised reply text. This text can be logged as an aid to
- resolving issues.
-</doc>
- <assert check="notnull"/>
- </domain>
- <class name="connection" handler="connection" index="10">
- <!--
-======================================================
-== CONNECTION
-======================================================
--->
- work with socket connections
-<doc>
- The connection class provides methods for a client to establish a
- network connection to a server, and for both peers to operate the
- connection thereafter.
-</doc>
- <doc name="grammar">
- connection = open-connection *use-connection close-connection
- open-connection = C:protocol-header
- S:START C:START-OK
- *challenge
- S:TUNE C:TUNE-OK
- C:OPEN S:OPEN-OK | S:REDIRECT
- challenge = S:SECURE C:SECURE-OK
- use-connection = *channel
- close-connection = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="start" synchronous="1" index="10">
- start connection negotiation
- <doc>
- This method starts the connection negotiation process by telling
- the client the protocol version that the server proposes, along
- with a list of security mechanisms which the client can use for
- authentication.
- </doc>
- <rule implement="MUST">
- If the client cannot handle the protocol version suggested by the
- server it MUST close the socket connection.
- </rule>
- <rule implement="MUST">
- The server MUST provide a protocol version that is lower than or
- equal to that requested by the client in the protocol header. If
- the server cannot support the specified protocol it MUST NOT send
- this method, but MUST close the socket connection.
- </rule>
- <chassis name="client" implement="MUST"/>
- <response name="start-ok"/>
- <field name="version major" type="octet">
- protocol major version
- <doc>
- The protocol major version that the server agrees to use, which
- cannot be higher than the client's major version.
- </doc>
- </field>
- <field name="version minor" type="octet">
- protocol major version
- <doc>
- The protocol minor version that the server agrees to use, which
- cannot be higher than the client's minor version.
- </doc>
- </field>
- <field name="server properties" domain="peer properties">
- server properties
- </field>
- <field name="mechanisms" type="longstr">
- available security mechanisms
- <doc>
- A list of the security mechanisms that the server supports, delimited
- by spaces. Currently ASL supports these mechanisms: PLAIN.
- </doc>
- <see name="security mechanisms"/>
- <assert check="notnull"/>
- </field>
- <field name="locales" type="longstr">
- available message locales
- <doc>
- A list of the message locales that the server supports, delimited
- by spaces. The locale defines the language in which the server
- will send reply texts.
- </doc>
- <rule implement="MUST">
- All servers MUST support at least the en_US locale.
- </rule>
- <assert check="notnull"/>
- </field>
- </method>
- <method name="start-ok" synchronous="1" index="11">
- select security mechanism and locale
- <doc>
- This method selects a SASL security mechanism. ASL uses SASL
- (RFC2222) to negotiate authentication and encryption.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="client properties" domain="peer properties">
- client properties
- </field>
- <field name="mechanism" type="shortstr">
- selected security mechanism
- <doc>
- A single security mechanisms selected by the client, which must be
- one of those specified by the server.
- </doc>
- <rule implement="SHOULD">
- The client SHOULD authenticate using the highest-level security
- profile it can handle from the list provided by the server.
- </rule>
- <rule implement="MUST">
- The mechanism field MUST contain one of the security mechanisms
- proposed by the server in the Start method. If it doesn't, the
- server MUST close the socket.
- </rule>
- <assert check="notnull"/>
- </field>
- <field name="response" type="longstr">
- security response data
- <doc>
- A block of opaque data passed to the security mechanism. The contents
- of this data are defined by the SASL security mechanism. For the
- PLAIN security mechanism this is defined as a field table holding
- two fields, LOGIN and PASSWORD.
- </doc>
- <assert check="notnull"/>
- </field>
- <field name="locale" type="shortstr">
- selected message locale
- <doc>
- A single message local selected by the client, which must be one
- of those specified by the server.
- </doc>
- <assert check="notnull"/>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="secure" synchronous="1" index="20">
- security mechanism challenge
- <doc>
- The SASL protocol works by exchanging challenges and responses until
- both peers have received sufficient information to authenticate each
- other. This method challenges the client to provide more information.
- </doc>
- <chassis name="client" implement="MUST"/>
- <response name="secure-ok"/>
- <field name="challenge" type="longstr">
- security challenge data
- <doc>
- Challenge information, a block of opaque binary data passed to
- the security mechanism.
- </doc>
- <see name="security mechanisms"/>
- </field>
- </method>
- <method name="secure-ok" synchronous="1" index="21">
- security mechanism response
- <doc>
- This method attempts to authenticate, passing a block of SASL data
- for the security mechanism at the server side.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="response" type="longstr">
- security response data
- <doc>
- A block of opaque data passed to the security mechanism. The contents
- of this data are defined by the SASL security mechanism.
- </doc>
- <assert check="notnull"/>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="tune" synchronous="1" index="30">
- propose connection tuning parameters
- <doc>
- This method proposes a set of connection configuration values
- to the client. The client can accept and/or adjust these.
- </doc>
- <chassis name="client" implement="MUST"/>
- <response name="tune-ok"/>
- <field name="channel max" type="short">
- proposed maximum channels
- <doc>
- The maximum total number of channels that the server allows
- per connection. Zero means that the server does not impose a
- fixed limit, but the number of allowed channels may be limited
- by available server resources.
- </doc>
- </field>
- <field name="frame max" type="long">
- proposed maximum frame size
- <doc>
- The largest frame size that the server proposes for the
- connection. The client can negotiate a lower value. Zero means
- that the server does not impose any specific limit but may reject
- very large frames if it cannot allocate resources for them.
- </doc>
- <rule implement="MUST">
- Until the frame-max has been negotiated, both peers MUST accept
- frames of up to 4096 octets large. The minimum non-zero value for
- the frame-max field is 4096.
- </rule>
- </field>
- <field name="heartbeat" type="short">
- desired heartbeat delay
- <doc>
- The delay, in seconds, of the connection heartbeat that the server
- wants. Zero means the server does not want a heartbeat.
- </doc>
- </field>
- </method>
- <method name="tune-ok" synchronous="1" index="31">
- negotiate connection tuning parameters
- <doc>
- This method sends the client's connection tuning parameters to the
- server. Certain fields are negotiated, others provide capability
- information.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="channel max" type="short">
- negotiated maximum channels
- <doc>
- The maximum total number of channels that the client will use
- per connection. May not be higher than the value specified by
- the server.
- </doc>
- <rule implement="MAY">
- The server MAY ignore the channel-max value or MAY use it for
- tuning its resource allocation.
- </rule>
- <assert check="notnull"/>
- <assert check="le" method="tune" field="channel max"/>
- </field>
- <field name="frame max" type="long">
- negotiated maximum frame size
- <doc>
- The largest frame size that the client and server will use for
- the connection. Zero means that the client does not impose any
- specific limit but may reject very large frames if it cannot
- allocate resources for them. Note that the frame-max limit
- applies principally to content frames, where large contents
- can be broken into frames of arbitrary size.
- </doc>
- <rule implement="MUST">
- Until the frame-max has been negotiated, both peers must accept
- frames of up to 4096 octets large. The minimum non-zero value for
- the frame-max field is 4096.
- </rule>
- </field>
- <field name="heartbeat" type="short">
- desired heartbeat delay
- <doc>
- The delay, in seconds, of the connection heartbeat that the client
- wants. Zero means the client does not want a heartbeat.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="open" synchronous="1" index="40">
- open connection to virtual host
- <doc>
- This method opens a connection to a virtual host, which is a
- collection of resources, and acts to separate multiple application
- domains within a server.
- </doc>
- <rule implement="MUST">
- The client MUST open the context before doing any work on the
- connection.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="open-ok"/>
- <response name="redirect"/>
- <field name="virtual host" domain="path">
- virtual host name
- <assert check="regexp" value="^[a-zA-Z0-9/-_]+$"/>
- <doc>
- The name of the virtual host to work with.
- </doc>
- <rule implement="MUST">
- If the server supports multiple virtual hosts, it MUST enforce a
- full separation of exchanges, queues, and all associated entities
- per virtual host. An application, connected to a specific virtual
- host, MUST NOT be able to access resources of another virtual host.
- </rule>
- <rule implement="SHOULD">
- The server SHOULD verify that the client has permission to access
- the specified virtual host.
- </rule>
- <rule implement="MAY">
- The server MAY configure arbitrary limits per virtual host, such
- as the number of each type of entity that may be used, per
- connection and/or in total.
- </rule>
- </field>
- <field name="capabilities" type="shortstr">
- required capabilities
- <doc>
- The client may specify a number of capability names, delimited by
- spaces. The server can use this string to how to process the
- client's connection request.
- </doc>
- </field>
- <field name="insist" type="bit">
- insist on connecting to server
- <doc>
- In a configuration with multiple load-sharing servers, the server
- may respond to a Connection.Open method with a Connection.Redirect.
- The insist option tells the server that the client is insisting on
- a connection to the specified server.
- </doc>
- <rule implement="SHOULD">
- When the client uses the insist option, the server SHOULD accept
- the client connection unless it is technically unable to do so.
- </rule>
- </field>
- </method>
- <method name="open-ok" synchronous="1" index="41">
- signal that the connection is ready
- <doc>
- This method signals to the client that the connection is ready for
- use.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="known hosts" domain="known hosts"/>
- </method>
- <method name="redirect" synchronous="1" index="50">
- asks the client to use a different server
- <doc>
- This method redirects the client to another server, based on the
- requested virtual host and/or capabilities.
- </doc>
- <rule implement="SHOULD">
- When getting the Connection.Redirect method, the client SHOULD
- reconnect to the host specified, and if that host is not present,
- to any of the hosts specified in the known-hosts list.
- </rule>
- <chassis name="client" implement="MAY"/>
- <field name="host" type="shortstr">
- server to connect to
- <doc>
- Specifies the server to connect to. This is an IP address or a
- DNS name, optionally followed by a colon and a port number. If
- no port number is specified, the client should use the default
- port number for the protocol.
- </doc>
- <assert check="notnull"/>
- </field>
- <field name="known hosts" domain="known hosts"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="close" synchronous="1" index="60">
- request a connection close
- <doc>
- This method indicates that the sender wants to close the connection.
- This may be due to internal conditions (e.g. a forced shut-down) or
- due to an error handling a specific method, i.e. an exception. When
- a close is due to an exception, the sender provides the class and
- method id of the method which caused the exception.
- </doc>
- <rule implement="MUST">
- After sending this method any received method except the Close-OK
- method MUST be discarded.
- </rule>
- <rule implement="MAY">
- The peer sending this method MAY use a counter or timeout to
- detect failure of the other peer to respond correctly with
- the Close-OK method.
- </rule>
- <rule implement="MUST">
- When a server receives the Close method from a client it MUST
- delete all server-side resources associated with the client's
- context. A client CANNOT reconnect to a context after sending
- or receiving a Close method.
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="close-ok"/>
- <field name="reply code" domain="reply code"/>
- <field name="reply text" domain="reply text"/>
- <field name="class id" domain="class id">
- failing method class
- <doc>
- When the close is provoked by a method exception, this is the
- class of the method.
- </doc>
- </field>
- <field name="method id" domain="class id">
- failing method ID
- <doc>
- When the close is provoked by a method exception, this is the
- ID of the method.
- </doc>
- </field>
- </method>
- <method name="close-ok" synchronous="1" index="61">
- confirm a connection close
- <doc>
- This method confirms a Connection.Close method and tells the
- recipient that it is safe to release resources for the connection
- and close the socket.
- </doc>
- <rule implement="SHOULD">
- A peer that detects a socket closure without having received a
- Close-Ok handshake method SHOULD log the error.
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- </method>
- </class>
- <class name="channel" handler="channel" index="20">
- <!--
-======================================================
-== CHANNEL
-======================================================
--->
- work with channels
-<doc>
- The channel class provides methods for a client to establish a virtual
- connection - a channel - to a server and for both peers to operate the
- virtual connection thereafter.
-</doc>
- <doc name="grammar">
- channel = open-channel *use-channel close-channel
- open-channel = C:OPEN S:OPEN-OK
- use-channel = C:FLOW S:FLOW-OK
- / S:FLOW C:FLOW-OK
- / S:ALERT
- / functional-class
- close-channel = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="open" synchronous="1" index="10">
- open a channel for use
- <doc>
- This method opens a virtual connection (a channel).
- </doc>
- <rule implement="MUST">
- This method MUST NOT be called when the channel is already open.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="open-ok"/>
- <field name="out of band" type="shortstr">
- out-of-band settings
- <doc>
- Configures out-of-band transfers on this channel. The syntax and
- meaning of this field will be formally defined at a later date.
- </doc>
- <assert check="null"/>
- </field>
- </method>
- <method name="open-ok" synchronous="1" index="11">
- signal that the channel is ready
- <doc>
- This method signals to the client that the channel is ready for use.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="flow" synchronous="1" index="20">
- enable/disable flow from peer
- <doc>
- This method asks the peer to pause or restart the flow of content
- data. This is a simple flow-control mechanism that a peer can use
- to avoid oveflowing its queues or otherwise finding itself receiving
- more messages than it can process. Note that this method is not
- intended for window control. The peer that receives a request to
- stop sending content should finish sending the current content, if
- any, and then wait until it receives a Flow restart method.
- </doc>
- <rule implement="MAY">
- When a new channel is opened, it is active. Some applications
- assume that channels are inactive until started. To emulate this
- behaviour a client MAY open the channel, then pause it.
- </rule>
- <rule implement="SHOULD">
- When sending content data in multiple frames, a peer SHOULD monitor
- the channel for incoming methods and respond to a Channel.Flow as
- rapidly as possible.
- </rule>
- <rule implement="MAY">
- A peer MAY use the Channel.Flow method to throttle incoming content
- data for internal reasons, for example, when exchangeing data over a
- slower connection.
- </rule>
- <rule implement="MAY">
- The peer that requests a Channel.Flow method MAY disconnect and/or
- ban a peer that does not respect the request.
- </rule>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <response name="flow-ok"/>
- <field name="active" type="bit">
- start/stop content frames
- <doc>
- If 1, the peer starts sending content frames. If 0, the peer
- stops sending content frames.
- </doc>
- </field>
- </method>
- <method name="flow-ok" index="21">
- confirm a flow method
- <doc>
- Confirms to the peer that a flow command was received and processed.
- </doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <field name="active" type="bit">
- current flow setting
- <doc>
- Confirms the setting of the processed flow method: 1 means the
- peer will start sending or continue to send content frames; 0
- means it will not.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="alert" index="30">
- send a non-fatal warning message
- <doc>
- This method allows the server to send a non-fatal warning to the
- client. This is used for methods that are normally asynchronous
- and thus do not have confirmations, and for which the server may
- detect errors that need to be reported. Fatal errors are handled
- as channel or connection exceptions; non-fatal errors are sent
- through this method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="reply code" domain="reply code"/>
- <field name="reply text" domain="reply text"/>
- <field name="details" type="table">
- detailed information for warning
- <doc>
- A set of fields that provide more information about the
- problem. The meaning of these fields are defined on a
- per-reply-code basis (TO BE DEFINED).
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="close" synchronous="1" index="40">
- request a channel close
- <doc>
- This method indicates that the sender wants to close the channel.
- This may be due to internal conditions (e.g. a forced shut-down) or
- due to an error handling a specific method, i.e. an exception. When
- a close is due to an exception, the sender provides the class and
- method id of the method which caused the exception.
- </doc>
- <rule implement="MUST">
- After sending this method any received method except
- Channel.Close-OK MUST be discarded.
- </rule>
- <rule implement="MAY">
- The peer sending this method MAY use a counter or timeout to detect
- failure of the other peer to respond correctly with Channel.Close-OK..
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="close-ok"/>
- <field name="reply code" domain="reply code"/>
- <field name="reply text" domain="reply text"/>
- <field name="class id" domain="class id">
- failing method class
- <doc>
- When the close is provoked by a method exception, this is the
- class of the method.
- </doc>
- </field>
- <field name="method id" domain="method id">
- failing method ID
- <doc>
- When the close is provoked by a method exception, this is the
- ID of the method.
- </doc>
- </field>
- </method>
- <method name="close-ok" synchronous="1" index="41">
- confirm a channel close
- <doc>
- This method confirms a Channel.Close method and tells the recipient
- that it is safe to release resources for the channel and close the
- socket.
- </doc>
- <rule implement="SHOULD">
- A peer that detects a socket closure without having received a
- Channel.Close-Ok handshake method SHOULD log the error.
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- </method>
- </class>
- <class name="access" handler="connection" index="30">
- <!--
-======================================================
-== ACCESS CONTROL
-======================================================
--->
- work with access tickets
-<doc>
- The protocol control access to server resources using access tickets.
- A client must explicitly request access tickets before doing work.
- An access ticket grants a client the right to use a specific set of
- resources - called a "realm" - in specific ways.
-</doc>
- <doc name="grammar">
- access = C:REQUEST S:REQUEST-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="request" synchronous="1" index="10">
- request an access ticket
- <doc>
- This method requests an access ticket for an access realm.
- The server responds by granting the access ticket. If the
- client does not have access rights to the requested realm
- this causes a connection exception. Access tickets are a
- per-channel resource.
- </doc>
- <rule implement="MUST">
- The realm name MUST start with either "/data" (for application
- resources) or "/admin" (for server administration resources).
- If the realm starts with any other path, the server MUST raise
- a connection exception with reply code 403 (access refused).
- </rule>
- <rule implement="MUST">
- The server MUST implement the /data realm and MAY implement the
- /admin realm. The mapping of resources to realms is not
- defined in the protocol - this is a server-side configuration
- issue.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="request-ok"/>
- <field name="realm" domain="path">
- name of requested realm
- <rule implement="MUST">
- If the specified realm is not known to the server, the server
- must raise a channel exception with reply code 402 (invalid
- path).
- </rule>
- </field>
- <field name="exclusive" type="bit">
- request exclusive access
- <doc>
- Request exclusive access to the realm. If the server cannot grant
- this - because there are other active tickets for the realm - it
- raises a channel exception.
- </doc>
- </field>
- <field name="passive" type="bit">
- request passive access
- <doc>
- Request message passive access to the specified access realm.
- Passive access lets a client get information about resources in
- the realm but not to make any changes to them.
- </doc>
- </field>
- <field name="active" type="bit">
- request active access
- <doc>
- Request message active access to the specified access realm.
- Acvtive access lets a client get create and delete resources in
- the realm.
- </doc>
- </field>
- <field name="write" type="bit">
- request write access
- <doc>
- Request write access to the specified access realm. Write access
- lets a client publish messages to all exchanges in the realm.
- </doc>
- </field>
- <field name="read" type="bit">
- request read access
- <doc>
- Request read access to the specified access realm. Read access
- lets a client consume messages from queues in the realm.
- </doc>
- </field>
- </method>
- <method name="request-ok" synchronous="1" index="11">
- grant access to server resources
- <doc>
- This method provides the client with an access ticket. The access
- ticket is valid within the current channel and for the lifespan of
- the channel.
- </doc>
- <rule implement="MUST">
- The client MUST NOT use access tickets except within the same
- channel as originally granted.
- </rule>
- <rule implement="MUST">
- The server MUST isolate access tickets per channel and treat an
- attempt by a client to mix these as a connection exception.
- </rule>
- <chassis name="client" implement="MUST"/>
- <field name="ticket" domain="access ticket"/>
- </method>
- </class>
- <class name="exchange" handler="channel" index="40">
- <!--
-======================================================
-== EXCHANGES (or "routers", if you prefer)
-== (Or matchers, plugins, extensions, agents,... Routing is just one of
-== the many fun things an exchange can do.)
-======================================================
--->
- work with exchanges
-<doc>
- Exchanges match and distribute messages across queues. Exchanges can be
- configured in the server or created at runtime.
-</doc>
- <doc name="grammar">
- exchange = C:DECLARE S:DECLARE-OK
- / C:DELETE S:DELETE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <rule implement="MUST">
- <test>amq_exchange_19</test>
- The server MUST implement the direct and fanout exchange types, and
- predeclare the corresponding exchanges named amq.direct and amq.fanout
- in each virtual host. The server MUST also predeclare a direct
- exchange to act as the default exchange for content Publish methods
- and for default queue bindings.
-</rule>
- <rule implement="SHOULD">
- <test>amq_exchange_20</test>
- The server SHOULD implement the topic exchange type, and predeclare
- the corresponding exchange named amq.topic in each virtual host.
-</rule>
- <rule implement="MAY">
- <test>amq_exchange_21</test>
- The server MAY implement the system exchange type, and predeclare the
- corresponding exchanges named amq.system in each virtual host. If the
- client attempts to bind a queue to the system exchange, the server
- MUST raise a connection exception with reply code 507 (not allowed).
-</rule>
- <rule implement="MUST">
- <test>amq_exchange_22</test>
- The default exchange MUST be defined as internal, and be inaccessible
- to the client except by specifying an empty exchange name in a content
- Publish method. That is, the server MUST NOT let clients make explicit
- bindings to this exchange.
-</rule>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="declare" synchronous="1" index="10">
- declare exchange, create if needed
- <doc>
- This method creates an exchange if it does not already exist, and if the
- exchange exists, verifies that it is of the correct and expected class.
- </doc>
- <rule implement="SHOULD">
- <test>amq_exchange_23</test>
- The server SHOULD support a minimum of 16 exchanges per virtual host
- and ideally, impose no limit except as defined by available resources.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="declare-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- When a client defines a new exchange, this belongs to the access realm
- of the ticket used. All further work done with that exchange must be
- done with an access ticket for the same realm.
- </doc>
- <rule implement="MUST">
- The client MUST provide a valid access ticket giving "active" access
- to the realm in which the exchange exists or will be created, or
- "passive" access if the if-exists flag is set.
- </rule>
- </field>
- <field name="exchange" domain="exchange name">
- <rule implement="MUST">
- <test>amq_exchange_15</test>
- Exchange names starting with "amq." are reserved for predeclared
- and standardised exchanges. If the client attempts to create an
- exchange starting with "amq.", the server MUST raise a channel
- exception with reply code 403 (access refused).
- </rule>
- <assert check="regexp" value="^[a-zA-Z0-9-_.:]+$"/>
- </field>
- <field name="type" type="shortstr">
- exchange type
- <doc>
- Each exchange belongs to one of a set of exchange types implemented
- by the server. The exchange types define the functionality of the
- exchange - i.e. how messages are routed through it. It is not valid
- or meaningful to attempt to change the type of an existing exchange.
- </doc>
- <rule implement="MUST">
- <test>amq_exchange_16</test>
- If the exchange already exists with a different type, the server
- MUST raise a connection exception with a reply code 507 (not allowed).
- </rule>
- <rule implement="MUST">
- <test>amq_exchange_18</test>
- If the server does not support the requested exchange type it MUST
- raise a connection exception with a reply code 503 (command invalid).
- </rule>
- <assert check="regexp" value="^[a-zA-Z0-9-_.:]+$"/>
- </field>
- <field name="passive" type="bit">
- do not create exchange
- <doc>
- If set, the server will not create the exchange. The client can use
- this to check whether an exchange exists without modifying the server
- state.
- </doc>
- <rule implement="MUST">
- <test>amq_exchange_05</test>
- If set, and the exchange does not already exist, the server MUST
- raise a channel exception with reply code 404 (not found).
- </rule>
- </field>
- <field name="durable" type="bit">
- request a durable exchange
- <doc>
- If set when creating a new exchange, the exchange will be marked as
- durable. Durable exchanges remain active when a server restarts.
- Non-durable exchanges (transient exchanges) are purged if/when a
- server restarts.
- </doc>
- <rule implement="MUST">
- <test>amq_exchange_24</test>
- The server MUST support both durable and transient exchanges.
- </rule>
- <rule implement="MUST">
- The server MUST ignore the durable field if the exchange already
- exists.
- </rule>
- </field>
- <field name="auto delete" type="bit">
- auto-delete when unused
- <doc>
- If set, the exchange is deleted when all queues have finished
- using it.
- </doc>
- <rule implement="SHOULD">
- <test>amq_exchange_02</test>
- The server SHOULD allow for a reasonable delay between the point
- when it determines that an exchange is not being used (or no longer
- used), and the point when it deletes the exchange. At the least it
- must allow a client to create an exchange and then bind a queue to
- it, with a small but non-zero delay between these two actions.
- </rule>
- <rule implement="MUST">
- <test>amq_exchange_25</test>
- The server MUST ignore the auto-delete field if the exchange already
- exists.
- </rule>
- </field>
- <field name="internal" type="bit">
- create internal exchange
- <doc>
- If set, the exchange may not be used directly by publishers, but
- only when bound to other exchanges. Internal exchanges are used to
- construct wiring that is not visible to applications.
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- <field name="arguments" type="table">
- arguments for declaration
- <doc>
- A set of arguments for the declaration. The syntax and semantics
- of these arguments depends on the server implementation. This
- field is ignored if passive is 1.
- </doc>
- </field>
- </method>
- <method name="declare-ok" synchronous="1" index="11">
- confirms an exchange declaration
- <doc>
- This method confirms a Declare method and confirms the name of the
- exchange, essential for automatically-named exchanges.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="delete" synchronous="1" index="20">
- delete an exchange
- <doc>
- This method deletes an exchange. When an exchange is deleted all queue
- bindings on the exchange are cancelled.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="delete-ok"/>
- <field name="ticket" domain="access ticket">
- <rule implement="MUST">
- The client MUST provide a valid access ticket giving "active"
- access rights to the exchange's access realm.
- </rule>
- </field>
- <field name="exchange" domain="exchange name">
- <rule implement="MUST">
- <test>amq_exchange_11</test>
- The exchange MUST exist. Attempting to delete a non-existing exchange
- causes a channel exception.
- </rule>
- <assert check="notnull"/>
- </field>
- <field name="if unused" type="bit">
- delete only if unused
- <doc>
- If set, the server will only delete the exchange if it has no queue
- bindings. If the exchange has queue bindings the server does not
- delete it but raises a channel exception instead.
- </doc>
- <rule implement="SHOULD">
- <test>amq_exchange_12</test>
- If set, the server SHOULD delete the exchange but only if it has
- no queue bindings.
- </rule>
- <rule implement="SHOULD">
- <test>amq_exchange_13</test>
- If set, the server SHOULD raise a channel exception if the exchange is in
- use.
- </rule>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- </method>
- <method name="delete-ok" synchronous="1" index="21">
- confirm deletion of an exchange
- <doc>
- This method confirms the deletion of an exchange.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- </class>
- <class name="queue" handler="channel" index="50">
- <!--
-======================================================
-== QUEUES
-======================================================
--->
- work with queues
-
-<doc>
- Queues store and forward messages. Queues can be configured in the server
- or created at runtime. Queues must be attached to at least one exchange
- in order to receive messages from publishers.
-</doc>
- <doc name="grammar">
- queue = C:DECLARE S:DECLARE-OK
- / C:BIND S:BIND-OK
- / C:PURGE S:PURGE-OK
- / C:DELETE S:DELETE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <rule implement="MUST">
- <test>amq_queue_33</test>
- A server MUST allow any content class to be sent to any queue, in any
- mix, and queue and delivery these content classes independently. Note
- that all methods that fetch content off queues are specific to a given
- content class.
-</rule>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="declare" synchronous="1" index="10">
- declare queue, create if needed
- <doc>
- This method creates or checks a queue. When creating a new queue
- the client can specify various properties that control the durability
- of the queue and its contents, and the level of sharing for the queue.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_34</test>
- The server MUST create a default binding for a newly-created queue
- to the default exchange, which is an exchange of type 'direct'.
- </rule>
- <rule implement="SHOULD">
- <test>amq_queue_35</test>
- The server SHOULD support a minimum of 256 queues per virtual host
- and ideally, impose no limit except as defined by available resources.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="declare-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- When a client defines a new queue, this belongs to the access realm
- of the ticket used. All further work done with that queue must be
- done with an access ticket for the same realm.
- </doc>
- <doc>
- The client provides a valid access ticket giving "active" access
- to the realm in which the queue exists or will be created, or
- "passive" access if the if-exists flag is set.
- </doc>
- </field>
- <field name="queue" domain="queue name">
- <rule implement="MAY">
- <test>amq_queue_10</test>
- The queue name MAY be empty, in which case the server MUST create
- a new queue with a unique generated name and return this to the
- client in the Declare-Ok method.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_32</test>
- Queue names starting with "amq." are reserved for predeclared and
- standardised server queues. If the queue name starts with "amq."
- and the passive option is zero, the server MUST raise a connection
- exception with reply code 403 (access refused).
- </rule>
- <assert check="regexp" value="^[a-zA-Z0-9-_.:]*$"/>
- </field>
- <field name="passive" type="bit">
- do not create queue
- <doc>
- If set, the server will not create the queue. The client can use
- this to check whether a queue exists without modifying the server
- state.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_05</test>
- If set, and the queue does not already exist, the server MUST
- respond with a reply code 404 (not found) and raise a channel
- exception.
- </rule>
- </field>
- <field name="durable" type="bit">
- request a durable queue
- <doc>
- If set when creating a new queue, the queue will be marked as
- durable. Durable queues remain active when a server restarts.
- Non-durable queues (transient queues) are purged if/when a
- server restarts. Note that durable queues do not necessarily
- hold persistent messages, although it does not make sense to
- send persistent messages to a transient queue.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_03</test>
- The server MUST recreate the durable queue after a restart.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_36</test>
- The server MUST support both durable and transient queues.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_37</test>
- The server MUST ignore the durable field if the queue already
- exists.
- </rule>
- </field>
- <field name="exclusive" type="bit">
- request an exclusive queue
- <doc>
- Exclusive queues may only be consumed from by the current connection.
- Setting the 'exclusive' flag always implies 'auto-delete'.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_38</test>
- The server MUST support both exclusive (private) and non-exclusive
- (shared) queues.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_04</test>
- The server MUST raise a channel exception if 'exclusive' is specified
- and the queue already exists and is owned by a different connection.
- </rule>
- </field>
- <field name="auto delete" type="bit">
- auto-delete queue when unused
- <doc>
- If set, the queue is deleted when all consumers have finished
- using it. Last consumer can be cancelled either explicitly or because
- its channel is closed. If there was no consumer ever on the queue, it
- won't be deleted.
- </doc>
- <rule implement="SHOULD">
- <test>amq_queue_02</test>
- The server SHOULD allow for a reasonable delay between the point
- when it determines that a queue is not being used (or no longer
- used), and the point when it deletes the queue. At the least it
- must allow a client to create a queue and then create a consumer
- to read from it, with a small but non-zero delay between these
- two actions. The server should equally allow for clients that may
- be disconnected prematurely, and wish to re-consume from the same
- queue without losing messages. We would recommend a configurable
- timeout, with a suitable default value being one minute.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_31</test>
- The server MUST ignore the auto-delete field if the queue already
- exists.
- </rule>
- </field>
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- <field name="arguments" type="table">
- arguments for declaration
- <doc>
- A set of arguments for the declaration. The syntax and semantics
- of these arguments depends on the server implementation. This
- field is ignored if passive is 1.
- </doc>
- </field>
- </method>
- <method name="declare-ok" synchronous="1" index="11">
- confirms a queue definition
- <doc>
- This method confirms a Declare method and confirms the name of the
- queue, essential for automatically-named queues.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="queue" domain="queue name">
- <doc>
- Reports the name of the queue. If the server generated a queue
- name, this field contains that name.
- </doc>
- <assert check="notnull"/>
- </field>
- <field name="message count" type="long">
- number of messages in queue
- <doc>
- Reports the number of messages in the queue, which will be zero
- for newly-created queues.
- </doc>
- </field>
- <field name="consumer count" type="long">
- number of consumers
- <doc>
- Reports the number of active consumers for the queue. Note that
- consumers can suspend activity (Channel.Flow) in which case they
- do not appear in this count.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="bind" synchronous="1" index="20">
- bind queue to an exchange
- <doc>
- This method binds a queue to an exchange. Until a queue is
- bound it will not receive any messages. In a classic messaging
- model, store-and-forward queues are bound to a dest exchange
- and subscription queues are bound to a dest_wild exchange.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_25</test>
- A server MUST allow ignore duplicate bindings - that is, two or
- more bind methods for a specific queue, with identical arguments
- - without treating these as an error.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_39</test>
- If a bind fails, the server MUST raise a connection exception.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_12</test>
- The server MUST NOT allow a durable queue to bind to a transient
- exchange. If the client attempts this the server MUST raise a
- channel exception.
- </rule>
- <rule implement="SHOULD">
- <test>amq_queue_13</test>
- Bindings for durable queues are automatically durable and the
- server SHOULD restore such bindings after a server restart.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_17</test>
- If the client attempts to an exchange that was declared as internal,
- the server MUST raise a connection exception with reply code 530
- (not allowed).
- </rule>
- <rule implement="SHOULD">
- <test>amq_queue_40</test>
- The server SHOULD support at least 4 bindings per queue, and
- ideally, impose no limit except as defined by available resources.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="bind-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- The client provides a valid access ticket giving "active"
- access rights to the queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to bind. If the queue name is
- empty, refers to the current queue for the channel, which is
- the last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue
- name in this method is empty, the server MUST raise a connection
- exception with reply code 530 (not allowed).
- </doc>
- <doc name = "rule" test = "amq_queue_26">
- If the queue does not exist the server MUST raise a channel exception
- with reply code 404 (not found).
- </doc>
- </field>
-
- <field name="exchange" domain="exchange name">
- The name of the exchange to bind to.
- <rule implement="MUST">
- <test>amq_queue_14</test>
- If the exchange does not exist the server MUST raise a channel
- exception with reply code 404 (not found).
- </rule>
- </field>
- <field name="routing key" type="shortstr">
- message routing key
- <doc>
- Specifies the routing key for the binding. The routing key is
- used for routing messages depending on the exchange configuration.
- Not all exchanges use a routing key - refer to the specific
- exchange documentation. If the routing key is empty and the queue
- name is empty, the routing key will be the current queue for the
- channel, which is the last declared queue.
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- <field name="arguments" type="table">
- arguments for binding
- <doc>
- A set of arguments for the binding. The syntax and semantics of
- these arguments depends on the exchange class.
- </doc>
- </field>
- </method>
- <method name="bind-ok" synchronous="1" index="21">
- confirm bind successful
- <doc>
- This method confirms that the bind was successful.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="purge" synchronous="1" index="30">
- purge a queue
- <doc>
- This method removes all messages from a queue. It does not cancel
- consumers. Purged messages are deleted without any formal "undo"
- mechanism.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_15</test>
- A call to purge MUST result in an empty queue.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_41</test>
- On transacted channels the server MUST not purge messages that have
- already been sent to a client but not yet acknowledged.
- </rule>
- <rule implement="MAY">
- <test>amq_queue_42</test>
- The server MAY implement a purge queue or log that allows system
- administrators to recover accidentally-purged messages. The server
- SHOULD NOT keep purged messages in the same storage spaces as the
- live messages since the volumes of purged messages may get very
- large.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="purge-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- The access ticket must be for the access realm that holds the
- queue.
- </doc>
- <rule implement="MUST">
- The client MUST provide a valid access ticket giving "read" access
- rights to the queue's access realm. Note that purging a queue is
- equivalent to reading all messages and discarding them.
- </rule>
- </field>
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to purge. If the queue name is
- empty, refers to the current queue for the channel, which is
- the last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue
- name in this method is empty, the server MUST raise a connection
- exception with reply code 530 (not allowed).
- </doc>
- <doc name = "rule" test = "amq_queue_16">
- The queue must exist. Attempting to purge a non-existing queue
- causes a channel exception.
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
- </method>
- <method name="purge-ok" synchronous="1" index="31">
- confirms a queue purge
- <doc>
- This method confirms the purge of a queue.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="message count" type="long">
- number of messages purged
- <doc>
- Reports the number of messages purged.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="delete" synchronous="1" index="40">
- delete a queue
- <doc>
- This method deletes a queue. When a queue is deleted any pending
- messages are sent to a dead-letter queue if this is defined in the
- server configuration, and all consumers on the queue are cancelled.
- </doc>
- <rule implement="SHOULD">
- <test>amq_queue_43</test>
- The server SHOULD use a dead-letter queue to hold messages that
- were pending on a deleted queue, and MAY provide facilities for
- a system administrator to move these messages back to an active
- queue.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="delete-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- The client provides a valid access ticket giving "active"
- access rights to the queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to delete. If the queue name is
- empty, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue
- name in this method is empty, the server MUST raise a connection
- exception with reply code 530 (not allowed).
- </doc>
- <doc name = "rule" test = "amq_queue_21">
- The queue must exist. Attempting to delete a non-existing queue
- causes a channel exception.
- </doc>
- </field>
-
- <field name="if unused" type="bit">
- delete only if unused
- <doc>
- If set, the server will only delete the queue if it has no
- consumers. If the queue has consumers the server does does not
- delete it but raises a channel exception instead.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_29</test>
- <test>amq_queue_30</test>
- The server MUST respect the if-unused flag when deleting a queue.
- </rule>
- </field>
- <field name="if empty" type="bit">
- delete only if empty
- <test>amq_queue_27</test>
- <doc>
- If set, the server will only delete the queue if it has no
- messages. If the queue is not empty the server raises a channel
- exception.
- </doc>
- </field>
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name="delete-ok" synchronous="1" index="41">
- confirm deletion of a queue
- <doc>
- This method confirms the deletion of a queue.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="message count" type="long">
- number of messages purged
- <doc>
- Reports the number of messages purged.
- </doc>
- </field>
- </method>
- </class>
- <class name="basic" handler="channel" index="60">
- <!--
-======================================================
-== BASIC MIDDLEWARE
-======================================================
--->
- work with basic content
-<doc>
- The Basic class provides methods that support an industry-standard
- messaging model.
-</doc>
-
-<doc name = "grammar">
- basic = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN content
- / S:DELIVER content
- / C:GET ( S:GET-OK content / S:GET-EMPTY )
- / C:ACK
- / C:REJECT
-</doc>
-
-<chassis name = "server" implement = "MUST" />
-<chassis name = "client" implement = "MAY" />
-
-<doc name = "rule" test = "amq_basic_08">
- The server SHOULD respect the persistent property of basic messages
- and SHOULD make a best-effort to hold persistent basic messages on a
- reliable storage mechanism.
-</doc>
-<doc name = "rule" test = "amq_basic_09">
- The server MUST NOT discard a persistent basic message in case of a
- queue overflow. The server MAY use the Channel.Flow method to slow
- or stop a basic message publisher when necessary.
-</doc>
-<doc name = "rule" test = "amq_basic_10">
- The server MAY overflow non-persistent basic messages to persistent
- storage and MAY discard or dead-letter non-persistent basic messages
- on a priority basis if the queue size exceeds some configured limit.
-</doc>
-<doc name = "rule" test = "amq_basic_11">
- The server MUST implement at least 2 priority levels for basic
- messages, where priorities 0-4 and 5-9 are treated as two distinct
- levels. The server MAY implement up to 10 priority levels.
-</doc>
-<doc name = "rule" test = "amq_basic_12">
- The server MUST deliver messages of the same priority in order
- irrespective of their individual persistence.
-</doc>
-<doc name = "rule" test = "amq_basic_13">
- The server MUST support both automatic and explicit acknowledgements
- on Basic content.
-</doc>
-
-<!-- These are the properties for a Basic content -->
-
-<field name = "content type" type = "shortstr">
- MIME content type
-</field>
-<field name = "content encoding" type = "shortstr">
- MIME content encoding
-</field>
-<field name = "headers" type = "table">
- Message header field table
-</field>
-<field name = "delivery mode" type = "octet">
- Non-persistent (1) or persistent (2)
-</field>
-<field name = "priority" type = "octet">
- The message priority, 0 to 9
-</field>
-<field name = "correlation id" type = "shortstr">
- The application correlation identifier
-</field>
-<field name = "reply to" type = "shortstr">
- The destination to reply to
-</field>
-<field name = "expiration" type = "shortstr">
- Message expiration specification
-</field>
-<field name = "message id" type = "shortstr">
- The application message identifier
-</field>
-<field name = "timestamp" type = "timestamp">
- The message timestamp
-</field>
-<field name = "type" type = "shortstr">
- The message type name
-</field>
-<field name = "user id" type = "shortstr">
- The creating user id
-</field>
-<field name = "app id" type = "shortstr">
- The creating application id
-</field>
-<field name = "cluster id" type = "shortstr">
- Intra-cluster routing identifier
-</field>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "qos" synchronous = "1" index = "10">
- specify quality of service
- <doc>
- This method requests a specific quality of service. The QoS can
- be specified for the current channel or for all channels on the
- connection. The particular properties and semantics of a qos method
- always depend on the content class semantics. Though the qos method
- could in principle apply to both peers, it is currently meaningful
- only for the server.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch size" type = "long">
- prefetch window in octets
- <doc>
- The client can request that messages be sent in advance so that
- when the client finishes processing a message, the following
- message is already held locally, rather than needing to be sent
- down the channel. Prefetching gives a performance improvement.
- This field specifies the prefetch window size in octets. The
- server will send a message in advance if it is equal to or
- smaller in size than the available prefetch size (and also falls
- into other prefetch limits). May be set to zero, meaning "no
- specific limit", although other prefetch limits may still apply.
- The prefetch-size is ignored if the no-ack option is set.
- </doc>
- <doc name = "rule" test = "amq_basic_17">
- The server MUST ignore this setting when the client is not
- processing any messages - i.e. the prefetch size does not limit
- the transfer of single messages to a client, only the sending in
- advance of more messages while the client still has one or more
- unacknowledged messages.
- </doc>
- </field>
-
- <field name = "prefetch count" type = "short">
- prefetch window in messages
- <doc>
- Specifies a prefetch window in terms of whole messages. This
- field may be used in combination with the prefetch-size field;
- a message will only be sent in advance if both prefetch windows
- (and those at the channel and connection level) allow it.
- The prefetch-count is ignored if the no-ack option is set.
- </doc>
- <doc name = "rule" test = "amq_basic_18">
- The server MAY send less data in advance than allowed by the
- client's specified prefetch windows but it MUST NOT send more.
- </doc>
- </field>
-
- <field name = "global" type = "bit">
- apply to entire connection
- <doc>
- By default the QoS settings apply to the current channel only. If
- this field is set, they are applied to the entire connection.
- </doc>
- </field>
-</method>
-
-<method name = "qos-ok" synchronous = "1" index = "11">
- confirm the requested qos
- <doc>
- This method tells the client that the requested QoS levels could
- be handled by the server. The requested QoS applies to all active
- consumers until a new QoS is defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "consume" synchronous = "1" index = "20">
- start a queue consumer
- <doc>
- This method asks the server to start a "consumer", which is a
- transient request for messages from a specific queue. Consumers
- last as long as the channel they were created on, or until the
- client cancels them.
- </doc>
- <doc name = "rule" test = "amq_basic_01">
- The server SHOULD support at least 16 consumers per queue, unless
- the queue was declared as private, and ideally, impose no limit
- except as defined by available resources.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read" access
- rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is
- local to a connection, so two clients can use the same consumer
- tags. If this field is empty the server will generate a unique
- tag.
- </doc>
- <doc name = "rule" test = "todo">
- The tag MUST NOT refer to an existing consumer. If the client
- attempts to create two consumers with the same non-empty tag
- the server MUST raise a connection exception with reply code
- 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no local" domain = "no local" />
-
- <field name = "no ack" domain = "no ack" />
-
- <field name = "exclusive" type = "bit">
- request exclusive access
- <doc>
- Request exclusive consumer access, meaning only this consumer can
- access the queue.
- </doc>
- <doc name = "rule" test = "amq_basic_02">
- If the server cannot grant exclusive access to the queue when asked,
- - because there are other consumers active - it MUST raise a channel
- exception with return code 403 (access refused).
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "consume-ok" synchronous = "1" index = "21">
- confirm a new consumer
- <doc>
- The server provides the client with a consumer tag, which is used
- by the client for methods called on the consumer at a later stage.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Holds the consumer tag specified by the client or provided by
- the server.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "cancel" synchronous = "1" index = "30">
- end a queue consumer
- <doc test = "amq_basic_04">
- This method cancels a consumer. This does not affect already
- delivered messages, but it does mean the server will not send any
- more messages for that consumer. The client may receive an
- abitrary number of messages in between sending the cancel method
- and receiving the cancel-ok reply.
- </doc>
- <doc name = "rule" test = "todo">
- If the queue no longer exists when the client sends a cancel command,
- or the consumer has been cancelled for other reasons, this command
- has no effect.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "cancel-ok" synchronous = "1" index = "31">
- confirm a cancelled consumer
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "publish" content = "1" index = "40">
- publish a message
- <doc>
- This method publishes a message to a specific exchange. The message
- will be routed to queues as defined by the exchange configuration
- and distributed to any active consumers when the transaction, if any,
- is committed.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "write"
- access rights to the access realm for the exchange.
- </doc>
- </field>
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange
- name can be empty, meaning the default exchange. If the exchange
- name is specified, and that exchange does not exist, the server
- will raise a channel exception.
- </doc>
- <doc name = "rule" test = "amq_basic_06">
- The server MUST accept a blank exchange name to mean the default
- exchange.
- </doc>
- <doc name = "rule" test = "amq_basic_14">
- If the exchange was declared as an internal exchange, the server
- MUST raise a channel exception with a reply code 403 (access
- refused).
- </doc>
- <doc name = "rule" test = "amq_basic_15">
- The exchange MAY refuse basic content in which case it MUST raise
- a channel exception with reply code 540 (not implemented).
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key for the message. The routing key is
- used for routing messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" type = "bit">
- indicate mandatory routing
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue. If this flag is set, the server will return an
- unroutable message with a Return method. If this flag is zero, the
- server silently drops the message.
- </doc>
- <doc name = "rule" test = "amq_basic_07">
- The server SHOULD implement the mandatory flag.
- </doc>
- </field>
-
- <field name = "immediate" type = "bit">
- request immediate delivery
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue consumer immediately. If this flag is set, the
- server will return an undeliverable message with a Return method.
- If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
- <doc name = "rule" test = "amq_basic_16">
- The server SHOULD implement the immediate flag.
- </doc>
- </field>
-</method>
-
-<method name = "return" content = "1" index = "50">
- return a failed message
- <doc>
- This method returns an undeliverable message that was published
- with the "immediate" flag set, or an unroutable message published
- with the "mandatory" flag set. The reply code and text provide
- information about the reason that the message was undeliverable.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply code" domain = "reply code" />
- <field name = "reply text" domain = "reply text" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "deliver" content = "1" index = "60">
- notify the client of a consumer message
- <doc>
- This method delivers a message to the client, via a consumer. In
- the asynchronous message delivery model, the client starts a
- consumer using the Consume method, then the server responds with
- Deliver methods as and when messages arrive for that consumer.
- </doc>
- <doc name = "rule" test = "amq_basic_19">
- The server SHOULD track the number of times a message has been
- delivered to clients and when a message is redelivered a certain
- number of times - e.g. 5 times - without being acknowledged, the
- server SHOULD consider the message to be unprocessable (possibly
- causing client applications to abort), and move the message to a
- dead letter queue.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "get" synchronous = "1" index = "70">
- direct access to a queue
- <doc>
- This method provides a direct access to the messages in a queue
- using a synchronous dialogue that is designed for specific types of
- application where synchronous functionality is more important than
- performance.
- </doc>
- <response name = "get-ok" />
- <response name = "get-empty" />
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read"
- access rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no ack" domain = "no ack" />
-</method>
-
-<method name = "get-ok" synchronous = "1" content = "1" index = "71">
- provide client with a message
- <doc>
- This method delivers a message to the client following a get
- method. A message delivered by 'get-ok' must be acknowledged
- unless the no-ack option was set in the get method.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was originally
- published to. If empty, the message was published to the default
- exchange.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-
- <field name = "message count" type = "long" >
- number of messages pending
- <doc>
- This field reports the number of messages pending on the queue,
- excluding the message being delivered. Note that this figure is
- indicative, not reliable, and can change arbitrarily as messages
- are added to the queue and removed by other clients.
- </doc>
- </field>
-</method>
-
-
-<method name = "get-empty" synchronous = "1" index = "72">
- indicate no messages available
- <doc>
- This method tells the client that the queue has no messages
- available for the client.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "cluster id" type = "shortstr">
- Cluster id
- <doc>
- For use by cluster applications, should not be used by
- client applications.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "ack" index = "80">
- acknowledge one or more messages
- <doc>
- This method acknowledges one or more messages delivered via the
- Deliver or Get-Ok methods. The client can ask to confirm a
- single message or a set of messages up to and including a specific
- message.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "multiple" type = "bit">
- acknowledge multiple messages
- <doc>
- If set to 1, the delivery tag is treated as "up to and including",
- so that the client can acknowledge multiple messages with a single
- method. If set to zero, the delivery tag refers to a single
- message. If the multiple field is 1, and the delivery tag is zero,
- tells the server to acknowledge all outstanding mesages.
- </doc>
- <doc name = "rule" test = "amq_basic_20">
- The server MUST validate that a non-zero delivery-tag refers to an
- delivered message, and raise a channel exception if this is not the
- case.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "reject" index = "90">
- reject an incoming message
- <doc>
- This method allows a client to reject a message. It can be used to
- interrupt and cancel large incoming messages, or return untreatable
- messages to their original queue.
- </doc>
- <doc name = "rule" test = "amq_basic_21">
- The server SHOULD be capable of accepting and process the Reject
- method while sending message content with a Deliver or Get-Ok
- method. I.e. the server should read and process incoming methods
- while sending output frames. To cancel a partially-send content,
- the server sends a content body frame of size 1 (i.e. with no data
- except the frame-end octet).
- </doc>
- <doc name = "rule" test = "amq_basic_22">
- The server SHOULD interpret this method as meaning that the client
- is unable to process the message at this time.
- </doc>
- <doc name = "rule">
- A client MUST NOT use this method as a means of selecting messages
- to process. A rejected message MAY be discarded or dead-lettered,
- not necessarily passed to another client.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "requeue" type = "bit">
- requeue the message
- <doc>
- If this field is zero, the message will be discarded. If this bit
- is 1, the server will attempt to requeue the message.
- </doc>
- <doc name = "rule" test = "amq_basic_23">
- The server MUST NOT deliver the message to the same client within
- the context of the current channel. The recommended strategy is
- to attempt to deliver the message to an alternative consumer, and
- if that is not possible, to move the message to a dead-letter
- queue. The server MAY use more sophisticated tracking to hold
- the message on the queue and redeliver it to the same client at
- a later stage.
- </doc>
- </field>
-</method>
-
-<method name = "recover" index = "100">
- redeliver unacknowledged messages
- <doc>
- This method asks the broker to redeliver all unacknowledged messages on a
- specified channel. Zero or more messages may be redelivered. This method
- is only allowed on non-transacted channels.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "requeue" type = "bit">
- requeue the message
- <doc>
- If this field is zero, the message will be redelivered to the original
- recipient. If this bit is 1, the server will attempt to requeue the
- message, potentially then delivering it to an alternative subscriber.
- </doc>
- </field>
- <doc name="rule">
- The server MUST set the redelivered flag on all messages that are resent.
- </doc>
- <doc name="rule">
- The server MUST raise a channel exception if this is called on a
- transacted channel.
- </doc>
-</method>
-
-</class>
-
-
- <class name="file" handler="channel" index="70">
- <!--
-======================================================
-== FILE TRANSFER
-======================================================
--->
- work with file content
-<doc>
- The file class provides methods that support reliable file transfer.
- File messages have a specific set of properties that are required for
- interoperability with file transfer applications. File messages and
- acknowledgements are subject to channel transactions. Note that the
- file class does not provide message browsing methods; these are not
- compatible with the staging model. Applications that need browsable
- file transfer should use Basic content and the Basic class.
-</doc>
-
-<doc name = "grammar">
- file = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:OPEN S:OPEN-OK C:STAGE content
- / S:OPEN C:OPEN-OK S:STAGE content
- / C:PUBLISH
- / S:DELIVER
- / S:RETURN
- / C:ACK
- / C:REJECT
-</doc>
-
-<chassis name = "server" implement = "MAY" />
-<chassis name = "client" implement = "MAY" />
-
-<doc name = "rule">
- The server MUST make a best-effort to hold file messages on a
- reliable storage mechanism.
-</doc>
-<doc name = "rule">
- The server MUST NOT discard a file message in case of a queue
- overflow. The server MUST use the Channel.Flow method to slow or stop
- a file message publisher when necessary.
-</doc>
-<doc name = "rule">
- The server MUST implement at least 2 priority levels for file
- messages, where priorities 0-4 and 5-9 are treated as two distinct
- levels. The server MAY implement up to 10 priority levels.
-</doc>
-<doc name = "rule">
- The server MUST support both automatic and explicit acknowledgements
- on file content.
-</doc>
-
-<!-- These are the properties for a File content -->
-
-<field name = "content type" type = "shortstr">
- MIME content type
-</field>
-<field name = "content encoding" type = "shortstr">
- MIME content encoding
-</field>
-<field name = "headers" type = "table">
- Message header field table
-</field>
-<field name = "priority" type = "octet">
- The message priority, 0 to 9
-</field>
-<field name = "reply to" type = "shortstr">
- The destination to reply to
-</field>
-<field name = "message id" type = "shortstr">
- The application message identifier
-</field>
-<field name = "filename" type = "shortstr">
- The message filename
-</field>
-<field name = "timestamp" type = "timestamp">
- The message timestamp
-</field>
-<field name = "cluster id" type = "shortstr">
- Intra-cluster routing identifier
-</field>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "qos" synchronous = "1" index = "10">
- specify quality of service
- <doc>
- This method requests a specific quality of service. The QoS can
- be specified for the current channel or for all channels on the
- connection. The particular properties and semantics of a qos method
- always depend on the content class semantics. Though the qos method
- could in principle apply to both peers, it is currently meaningful
- only for the server.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch size" type = "long">
- prefetch window in octets
- <doc>
- The client can request that messages be sent in advance so that
- when the client finishes processing a message, the following
- message is already held locally, rather than needing to be sent
- down the channel. Prefetching gives a performance improvement.
- This field specifies the prefetch window size in octets. May be
- set to zero, meaning "no specific limit". Note that other
- prefetch limits may still apply. The prefetch-size is ignored
- if the no-ack option is set.
- </doc>
- </field>
-
- <field name = "prefetch count" type = "short">
- prefetch window in messages
- <doc>
- Specifies a prefetch window in terms of whole messages. This
- is compatible with some file API implementations. This field
- may be used in combination with the prefetch-size field; a
- message will only be sent in advance if both prefetch windows
- (and those at the channel and connection level) allow it.
- The prefetch-count is ignored if the no-ack option is set.
- </doc>
- <doc name = "rule">
- The server MAY send less data in advance than allowed by the
- client's specified prefetch windows but it MUST NOT send more.
- </doc>
- </field>
-
- <field name = "global" type = "bit">
- apply to entire connection
- <doc>
- By default the QoS settings apply to the current channel only. If
- this field is set, they are applied to the entire connection.
- </doc>
- </field>
-</method>
-
-<method name = "qos-ok" synchronous = "1" index = "11">
- confirm the requested qos
- <doc>
- This method tells the client that the requested QoS levels could
- be handled by the server. The requested QoS applies to all active
- consumers until a new QoS is defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "consume" synchronous = "1" index = "20">
- start a queue consumer
- <doc>
- This method asks the server to start a "consumer", which is a
- transient request for messages from a specific queue. Consumers
- last as long as the channel they were created on, or until the
- client cancels them.
- </doc>
- <doc name = "rule">
- The server SHOULD support at least 16 consumers per queue, unless
- the queue was declared as private, and ideally, impose no limit
- except as defined by available resources.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read" access
- rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is
- local to a connection, so two clients can use the same consumer
- tags. If this field is empty the server will generate a unique
- tag.
- </doc>
- <doc name = "rule" test = "todo">
- The tag MUST NOT refer to an existing consumer. If the client
- attempts to create two consumers with the same non-empty tag
- the server MUST raise a connection exception with reply code
- 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no local" domain = "no local" />
-
- <field name = "no ack" domain = "no ack" />
-
- <field name = "exclusive" type = "bit">
- request exclusive access
- <doc>
- Request exclusive consumer access, meaning only this consumer can
- access the queue.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- If the server cannot grant exclusive access to the queue when asked,
- - because there are other consumers active - it MUST raise a channel
- exception with return code 405 (resource locked).
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "consume-ok" synchronous = "1" index = "21">
- confirm a new consumer
- <doc>
- This method provides the client with a consumer tag which it MUST
- use in methods that work with the consumer.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Holds the consumer tag specified by the client or provided by
- the server.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "cancel" synchronous = "1" index = "30">
- end a queue consumer
- <doc>
- This method cancels a consumer. This does not affect already
- delivered messages, but it does mean the server will not send any
- more messages for that consumer.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "cancel-ok" synchronous = "1" index = "31">
- confirm a cancelled consumer
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "open" synchronous = "1" index = "40">
- request to start staging
- <doc>
- This method requests permission to start staging a message. Staging
- means sending the message into a temporary area at the recipient end
- and then delivering the message by referring to this temporary area.
- Staging is how the protocol handles partial file transfers - if a
- message is partially staged and the connection breaks, the next time
- the sender starts to stage it, it can restart from where it left off.
- </doc>
- <response name = "open-ok" />
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "identifier" type = "shortstr">
- staging identifier
- <doc>
- This is the staging identifier. This is an arbitrary string chosen
- by the sender. For staging to work correctly the sender must use
- the same staging identifier when staging the same message a second
- time after recovery from a failure. A good choice for the staging
- identifier would be the SHA1 hash of the message properties data
- (including the original filename, revised time, etc.).
- </doc>
- </field>
-
- <field name = "content size" type = "longlong">
- message content size
- <doc>
- The size of the content in octets. The recipient may use this
- information to allocate or check available space in advance, to
- avoid "disk full" errors during staging of very large messages.
- </doc>
- <doc name = "rule">
- The sender MUST accurately fill the content-size field.
- Zero-length content is permitted.
- </doc>
- </field>
-</method>
-
-<method name = "open-ok" synchronous = "1" index = "41">
- confirm staging ready
- <doc>
- This method confirms that the recipient is ready to accept staged
- data. If the message was already partially-staged at a previous
- time the recipient will report the number of octets already staged.
- </doc>
- <response name = "stage" />
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "staged size" type = "longlong">
- already staged amount
- <doc>
- The amount of previously-staged content in octets. For a new
- message this will be zero.
- </doc>
- <doc name = "rule">
- The sender MUST start sending data from this octet offset in the
- message, counting from zero.
- </doc>
- <doc name = "rule">
- The recipient MAY decide how long to hold partially-staged content
- and MAY implement staging by always discarding partially-staged
- content. However if it uses the file content type it MUST support
- the staging methods.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "stage" content = "1" index = "50">
- stage message content
- <doc>
- This method stages the message, sending the message content to the
- recipient from the octet offset specified in the Open-Ok method.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "publish" index = "60">
- publish a message
- <doc>
- This method publishes a staged file message to a specific exchange.
- The file message will be routed to queues as defined by the exchange
- configuration and distributed to any active consumers when the
- transaction, if any, is committed.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "write"
- access rights to the access realm for the exchange.
- </doc>
- </field>
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange
- name can be empty, meaning the default exchange. If the exchange
- name is specified, and that exchange does not exist, the server
- will raise a channel exception.
- </doc>
- <doc name = "rule">
- The server MUST accept a blank exchange name to mean the default
- exchange.
- </doc>
- <doc name = "rule">
- If the exchange was declared as an internal exchange, the server
- MUST respond with a reply code 403 (access refused) and raise a
- channel exception.
- </doc>
- <doc name = "rule">
- The exchange MAY refuse file content in which case it MUST respond
- with a reply code 540 (not implemented) and raise a channel
- exception.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key for the message. The routing key is
- used for routing messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" type = "bit">
- indicate mandatory routing
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue. If this flag is set, the server will return an
- unroutable message with a Return method. If this flag is zero, the
- server silently drops the message.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- The server SHOULD implement the mandatory flag.
- </doc>
- </field>
-
- <field name = "immediate" type = "bit">
- request immediate delivery
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue consumer immediately. If this flag is set, the
- server will return an undeliverable message with a Return method.
- If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- The server SHOULD implement the immediate flag.
- </doc>
- </field>
-
- <field name = "identifier" type = "shortstr">
- staging identifier
- <doc>
- This is the staging identifier of the message to publish. The
- message must have been staged. Note that a client can send the
- Publish method asynchronously without waiting for staging to
- finish.
- </doc>
- </field>
-</method>
-
-<method name = "return" content = "1" index = "70">
- return a failed message
- <doc>
- This method returns an undeliverable message that was published
- with the "immediate" flag set, or an unroutable message published
- with the "mandatory" flag set. The reply code and text provide
- information about the reason that the message was undeliverable.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply code" domain = "reply code" />
- <field name = "reply text" domain = "reply text" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "deliver" index = "80">
- notify the client of a consumer message
- <doc>
- This method delivers a staged file message to the client, via a
- consumer. In the asynchronous message delivery model, the client
- starts a consumer using the Consume method, then the server
- responds with Deliver methods as and when messages arrive for
- that consumer.
- </doc>
- <doc name = "rule">
- The server SHOULD track the number of times a message has been
- delivered to clients and when a message is redelivered a certain
- number of times - e.g. 5 times - without being acknowledged, the
- server SHOULD consider the message to be unprocessable (possibly
- causing client applications to abort), and move the message to a
- dead letter queue.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was originally
- published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-
- <field name = "identifier" type = "shortstr">
- staging identifier
- <doc>
- This is the staging identifier of the message to deliver. The
- message must have been staged. Note that a server can send the
- Deliver method asynchronously without waiting for staging to
- finish.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "ack" index = "90">
- acknowledge one or more messages
- <doc>
- This method acknowledges one or more messages delivered via the
- Deliver method. The client can ask to confirm a single message or
- a set of messages up to and including a specific message.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "multiple" type = "bit">
- acknowledge multiple messages
- <doc>
- If set to 1, the delivery tag is treated as "up to and including",
- so that the client can acknowledge multiple messages with a single
- method. If set to zero, the delivery tag refers to a single
- message. If the multiple field is 1, and the delivery tag is zero,
- tells the server to acknowledge all outstanding mesages.
- </doc>
- <doc name = "rule">
- The server MUST validate that a non-zero delivery-tag refers to an
- delivered message, and raise a channel exception if this is not the
- case.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "reject" index = "100">
- reject an incoming message
- <doc>
- This method allows a client to reject a message. It can be used to
- return untreatable messages to their original queue. Note that file
- content is staged before delivery, so the client will not use this
- method to interrupt delivery of a large message.
- </doc>
- <doc name = "rule">
- The server SHOULD interpret this method as meaning that the client
- is unable to process the message at this time.
- </doc>
- <doc name = "rule">
- A client MUST NOT use this method as a means of selecting messages
- to process. A rejected message MAY be discarded or dead-lettered,
- not necessarily passed to another client.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "requeue" type = "bit">
- requeue the message
- <doc>
- If this field is zero, the message will be discarded. If this bit
- is 1, the server will attempt to requeue the message.
- </doc>
- <doc name = "rule">
- The server MUST NOT deliver the message to the same client within
- the context of the current channel. The recommended strategy is
- to attempt to deliver the message to an alternative consumer, and
- if that is not possible, to move the message to a dead-letter
- queue. The server MAY use more sophisticated tracking to hold
- the message on the queue and redeliver it to the same client at
- a later stage.
- </doc>
- </field>
-</method>
-
-</class>
-
- <class name="stream" handler="channel" index="80">
- <!--
-======================================================
-== STREAMING
-======================================================
--->
- work with streaming content
-
-<doc>
- The stream class provides methods that support multimedia streaming.
- The stream class uses the following semantics: one message is one
- packet of data; delivery is unacknowleged and unreliable; the consumer
- can specify quality of service parameters that the server can try to
- adhere to; lower-priority messages may be discarded in favour of high
- priority messages.
-</doc>
-
-<doc name = "grammar">
- stream = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN
- / S:DELIVER content
-</doc>
-
-<chassis name = "server" implement = "MAY" />
-<chassis name = "client" implement = "MAY" />
-
-<doc name = "rule">
- The server SHOULD discard stream messages on a priority basis if
- the queue size exceeds some configured limit.
-</doc>
-<doc name = "rule">
- The server MUST implement at least 2 priority levels for stream
- messages, where priorities 0-4 and 5-9 are treated as two distinct
- levels. The server MAY implement up to 10 priority levels.
-</doc>
-<doc name = "rule">
- The server MUST implement automatic acknowledgements on stream
- content. That is, as soon as a message is delivered to a client
- via a Deliver method, the server must remove it from the queue.
-</doc>
-
-
-<!-- These are the properties for a Stream content -->
-
-<field name = "content type" type = "shortstr">
- MIME content type
-</field>
-<field name = "content encoding" type = "shortstr">
- MIME content encoding
-</field>
-<field name = "headers" type = "table">
- Message header field table
-</field>
-<field name = "priority" type = "octet">
- The message priority, 0 to 9
-</field>
-<field name = "timestamp" type = "timestamp">
- The message timestamp
-</field>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "qos" synchronous = "1" index = "10">
- specify quality of service
- <doc>
- This method requests a specific quality of service. The QoS can
- be specified for the current channel or for all channels on the
- connection. The particular properties and semantics of a qos method
- always depend on the content class semantics. Though the qos method
- could in principle apply to both peers, it is currently meaningful
- only for the server.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch size" type = "long">
- prefetch window in octets
- <doc>
- The client can request that messages be sent in advance so that
- when the client finishes processing a message, the following
- message is already held locally, rather than needing to be sent
- down the channel. Prefetching gives a performance improvement.
- This field specifies the prefetch window size in octets. May be
- set to zero, meaning "no specific limit". Note that other
- prefetch limits may still apply.
- </doc>
- </field>
-
- <field name = "prefetch count" type = "short">
- prefetch window in messages
- <doc>
- Specifies a prefetch window in terms of whole messages. This
- field may be used in combination with the prefetch-size field;
- a message will only be sent in advance if both prefetch windows
- (and those at the channel and connection level) allow it.
- </doc>
- </field>
-
- <field name = "consume rate" type = "long">
- transfer rate in octets/second
- <doc>
- Specifies a desired transfer rate in octets per second. This is
- usually determined by the application that uses the streaming
- data. A value of zero means "no limit", i.e. as rapidly as
- possible.
- </doc>
- <doc name = "rule">
- The server MAY ignore the prefetch values and consume rates,
- depending on the type of stream and the ability of the server
- to queue and/or reply it. The server MAY drop low-priority
- messages in favour of high-priority messages.
- </doc>
- </field>
-
- <field name = "global" type = "bit">
- apply to entire connection
- <doc>
- By default the QoS settings apply to the current channel only. If
- this field is set, they are applied to the entire connection.
- </doc>
- </field>
-</method>
-
-<method name = "qos-ok" synchronous = "1" index = "11">
- confirm the requested qos
- <doc>
- This method tells the client that the requested QoS levels could
- be handled by the server. The requested QoS applies to all active
- consumers until a new QoS is defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "consume" synchronous = "1" index = "20">
- start a queue consumer
- <doc>
- This method asks the server to start a "consumer", which is a
- transient request for messages from a specific queue. Consumers
- last as long as the channel they were created on, or until the
- client cancels them.
- </doc>
- <doc name = "rule">
- The server SHOULD support at least 16 consumers per queue, unless
- the queue was declared as private, and ideally, impose no limit
- except as defined by available resources.
- </doc>
- <doc name = "rule">
- Streaming applications SHOULD use different channels to select
- different streaming resolutions. AMQP makes no provision for
- filtering and/or transforming streams except on the basis of
- priority-based selective delivery of individual messages.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read" access
- rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is
- local to a connection, so two clients can use the same consumer
- tags. If this field is empty the server will generate a unique
- tag.
- </doc>
- <doc name = "rule" test = "todo">
- The tag MUST NOT refer to an existing consumer. If the client
- attempts to create two consumers with the same non-empty tag
- the server MUST raise a connection exception with reply code
- 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no local" domain = "no local" />
-
- <field name = "exclusive" type = "bit">
- request exclusive access
- <doc>
- Request exclusive consumer access, meaning only this consumer can
- access the queue.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- If the server cannot grant exclusive access to the queue when asked,
- - because there are other consumers active - it MUST raise a channel
- exception with return code 405 (resource locked).
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-
-<method name = "consume-ok" synchronous = "1" index = "21">
- confirm a new consumer
- <doc>
- This method provides the client with a consumer tag which it may
- use in methods that work with the consumer.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Holds the consumer tag specified by the client or provided by
- the server.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "cancel" synchronous = "1" index = "30">
- end a queue consumer
- <doc>
- This method cancels a consumer. Since message delivery is
- asynchronous the client may continue to receive messages for
- a short while after canceling a consumer. It may process or
- discard these as appropriate.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "cancel-ok" synchronous = "1" index = "31">
- confirm a cancelled consumer
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "publish" content = "1" index = "40">
- publish a message
- <doc>
- This method publishes a message to a specific exchange. The message
- will be routed to queues as defined by the exchange configuration
- and distributed to any active consumers as appropriate.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "write"
- access rights to the access realm for the exchange.
- </doc>
- </field>
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange
- name can be empty, meaning the default exchange. If the exchange
- name is specified, and that exchange does not exist, the server
- will raise a channel exception.
- </doc>
- <doc name = "rule">
- The server MUST accept a blank exchange name to mean the default
- exchange.
- </doc>
- <doc name = "rule">
- If the exchange was declared as an internal exchange, the server
- MUST respond with a reply code 403 (access refused) and raise a
- channel exception.
- </doc>
- <doc name = "rule">
- The exchange MAY refuse stream content in which case it MUST
- respond with a reply code 540 (not implemented) and raise a
- channel exception.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key for the message. The routing key is
- used for routing messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" type = "bit">
- indicate mandatory routing
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue. If this flag is set, the server will return an
- unroutable message with a Return method. If this flag is zero, the
- server silently drops the message.
- </doc>
- <doc name = "rule" test = "amq_stream_00">
- The server SHOULD implement the mandatory flag.
- </doc>
- </field>
-
- <field name = "immediate" type = "bit">
- request immediate delivery
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue consumer immediately. If this flag is set, the
- server will return an undeliverable message with a Return method.
- If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
- <doc name = "rule" test = "amq_stream_00">
- The server SHOULD implement the immediate flag.
- </doc>
- </field>
-</method>
-
-<method name = "return" content = "1" index = "50">
- return a failed message
- <doc>
- This method returns an undeliverable message that was published
- with the "immediate" flag set, or an unroutable message published
- with the "mandatory" flag set. The reply code and text provide
- information about the reason that the message was undeliverable.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply code" domain = "reply code" />
- <field name = "reply text" domain = "reply text" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "deliver" content = "1" index = "60">
- notify the client of a consumer message
- <doc>
- This method delivers a message to the client, via a consumer. In
- the asynchronous message delivery model, the client starts a
- consumer using the Consume method, then the server responds with
- Deliver methods as and when messages arrive for that consumer.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was originally
- published to.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue that the message came from. Note
- that a single channel can start many consumers on different
- queues.
- </doc>
- <assert check = "notnull" />
- </field>
-</method>
- </class>
-
- <class name="tx" handler="channel" index="90">
- <!--
-======================================================
-== TRANSACTIONS
-======================================================
--->
- work with standard transactions
-
-<doc>
- Standard transactions provide so-called "1.5 phase commit". We can
- ensure that work is never lost, but there is a chance of confirmations
- being lost, so that messages may be resent. Applications that use
- standard transactions must be able to detect and ignore duplicate
- messages.
-</doc>
- <rule implement="SHOULD">
- An client using standard transactions SHOULD be able to track all
- messages received within a reasonable period, and thus detect and
- reject duplicates of the same message. It SHOULD NOT pass these to
- the application layer.
-</rule>
- <doc name="grammar">
- tx = C:SELECT S:SELECT-OK
- / C:COMMIT S:COMMIT-OK
- / C:ROLLBACK S:ROLLBACK-OK
-</doc>
- <chassis name="server" implement="SHOULD"/>
- <chassis name="client" implement="MAY"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="select" synchronous="1" index="10">
-select standard transaction mode
- <doc>
- This method sets the channel to use standard transactions. The
- client must use this method at least once on a channel before
- using the Commit or Rollback methods.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="select-ok"/>
- </method>
- <method name="select-ok" synchronous="1" index="11">
-confirm transaction mode
- <doc>
- This method confirms to the client that the channel was successfully
- set to use standard transactions.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="commit" synchronous="1" index="20">
-commit the current transaction
- <doc>
- This method commits all messages published and acknowledged in
- the current transaction. A new transaction starts immediately
- after a commit.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="commit-ok"/>
- </method>
- <method name="commit-ok" synchronous="1" index="21">
-confirm a successful commit
- <doc>
- This method confirms to the client that the commit succeeded.
- Note that if a commit fails, the server raises a channel exception.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="rollback" synchronous="1" index="30">
-abandon the current transaction
- <doc>
- This method abandons all messages published and acknowledged in
- the current transaction. A new transaction starts immediately
- after a rollback.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="rollback-ok"/>
- </method>
- <method name="rollback-ok" synchronous="1" index="31">
-confirm a successful rollback
- <doc>
- This method confirms to the client that the rollback succeeded.
- Note that if an rollback fails, the server raises a channel exception.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- </class>
- <class name="dtx" handler="channel" index="100">
- <!--
-======================================================
-== DISTRIBUTED TRANSACTIONS
-======================================================
--->
- work with distributed transactions
-
-<doc>
- Distributed transactions provide so-called "2-phase commit". The
- AMQP distributed transaction model supports the X-Open XA
- architecture and other distributed transaction implementations.
- The Dtx class assumes that the server has a private communications
- channel (not AMQP) to a distributed transaction coordinator.
-</doc>
- <doc name="grammar">
- dtx = C:SELECT S:SELECT-OK
- C:START S:START-OK
-</doc>
- <chassis name="server" implement="MAY"/>
- <chassis name="client" implement="MAY"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="select" synchronous="1" index="10">
-select standard transaction mode
- <doc>
- This method sets the channel to use distributed transactions. The
- client must use this method at least once on a channel before
- using the Start method.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="select-ok"/>
- </method>
- <method name="select-ok" synchronous="1" index="11">
-confirm transaction mode
- <doc>
- This method confirms to the client that the channel was successfully
- set to use distributed transactions.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="start" synchronous="1" index="20">
- start a new distributed transaction
- <doc>
- This method starts a new distributed transaction. This must be
- the first method on a new channel that uses the distributed
- transaction mode, before any methods that publish or consume
- messages.
- </doc>
- <chassis name="server" implement="MAY"/>
- <response name="start-ok"/>
- <field name="dtx identifier" type="shortstr">
- transaction identifier
- <doc>
- The distributed transaction key. This identifies the transaction
- so that the AMQP server can coordinate with the distributed
- transaction coordinator.
- </doc>
- <assert check="notnull"/>
- </field>
- </method>
- <method name="start-ok" synchronous="1" index="21">
- confirm the start of a new distributed transaction
- <doc>
- This method confirms to the client that the transaction started.
- Note that if a start fails, the server raises a channel exception.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- </class>
- <class name="tunnel" handler="tunnel" index="110">
- <!--
-======================================================
-== TUNNEL
-======================================================
--->
- methods for protocol tunneling.
-
-<doc>
- The tunnel methods are used to send blocks of binary data - which
- can be serialised AMQP methods or other protocol frames - between
- AMQP peers.
-</doc>
- <doc name="grammar">
- tunnel = C:REQUEST
- / S:REQUEST
-</doc>
- <chassis name="server" implement="MAY"/>
- <chassis name="client" implement="MAY"/>
- <field name="headers" type="table">
- Message header field table
-</field>
- <field name="proxy name" type="shortstr">
- The identity of the tunnelling proxy
-</field>
- <field name="data name" type="shortstr">
- The name or type of the message being tunnelled
-</field>
- <field name="durable" type="octet">
- The message durability indicator
-</field>
- <field name="broadcast" type="octet">
- The message broadcast mode
-</field>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="request" content="1" index="10">
- sends a tunnelled method
- <doc>
- This method tunnels a block of binary data, which can be an
- encoded AMQP method or other data. The binary data is sent
- as the content for the Tunnel.Request method.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="meta data" type="table">
- meta data for the tunnelled block
- <doc>
- This field table holds arbitrary meta-data that the sender needs
- to pass to the recipient.
- </doc>
- </field>
- </method>
- </class>
- <class name="test" handler="channel" index="120">
- <!--
-======================================================
-== TEST - CHECK FUNCTIONAL CAPABILITIES OF AN IMPLEMENTATION
-======================================================
--->
- test functional primitives of the implementation
-
-<doc>
- The test class provides methods for a peer to test the basic
- operational correctness of another peer. The test methods are
- intended to ensure that all peers respect at least the basic
- elements of the protocol, such as frame and content organisation
- and field types. We assume that a specially-designed peer, a
- "monitor client" would perform such tests.
-</doc>
- <doc name="grammar">
- test = C:INTEGER S:INTEGER-OK
- / S:INTEGER C:INTEGER-OK
- / C:STRING S:STRING-OK
- / S:STRING C:STRING-OK
- / C:TABLE S:TABLE-OK
- / S:TABLE C:TABLE-OK
- / C:CONTENT S:CONTENT-OK
- / S:CONTENT C:CONTENT-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="SHOULD"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="integer" synchronous="1" index="10">
- test integer handling
- <doc>
- This method tests the peer's capability to correctly marshal integer
- data.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="integer-ok"/>
- <field name="integer 1" type="octet">
- octet test value
- <doc>
- An octet integer test value.
- </doc>
- </field>
- <field name="integer 2" type="short">
- short test value
- <doc>
- A short integer test value.
- </doc>
- </field>
- <field name="integer 3" type="long">
- long test value
- <doc>
- A long integer test value.
- </doc>
- </field>
- <field name="integer 4" type="longlong">
- long-long test value
- <doc>
- A long long integer test value.
- </doc>
- </field>
- <field name="operation" type="octet">
- operation to test
- <doc>
- The client must execute this operation on the provided integer
- test fields and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return sum of test values</value>
- <value name="min">return lowest of test values</value>
- <value name="max">return highest of test values</value>
- </assert>
- </field>
- </method>
- <method name="integer-ok" synchronous="1" index="11">
- report integer test result
- <doc>
- This method reports the result of an Integer method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="result" type="longlong">
- result value
- <doc>
- The result of the tested operation.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="string" synchronous="1" index="20">
- test string handling
- <doc>
- This method tests the peer's capability to correctly marshal string
- data.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="string-ok"/>
- <field name="string 1" type="shortstr">
- short string test value
- <doc>
- An short string test value.
- </doc>
- </field>
- <field name="string 2" type="longstr">
- long string test value
- <doc>
- A long string test value.
- </doc>
- </field>
- <field name="operation" type="octet">
- operation to test
- <doc>
- The client must execute this operation on the provided string
- test fields and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return concatentation of test strings</value>
- <value name="min">return shortest of test strings</value>
- <value name="max">return longest of test strings</value>
- </assert>
- </field>
- </method>
- <method name="string-ok" synchronous="1" index="21">
- report string test result
- <doc>
- This method reports the result of a String method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="result" type="longstr">
- result value
- <doc>
- The result of the tested operation.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="table" synchronous="1" index="30">
- test field table handling
- <doc>
- This method tests the peer's capability to correctly marshal field
- table data.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="table-ok"/>
- <field name="table" type="table">
- field table of test values
- <doc>
- A field table of test values.
- </doc>
- </field>
- <field name="integer op" type="octet">
- operation to test on integers
- <doc>
- The client must execute this operation on the provided field
- table integer values and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return sum of numeric field values</value>
- <value name="min">return min of numeric field values</value>
- <value name="max">return max of numeric field values</value>
- </assert>
- </field>
- <field name="string op" type="octet">
- operation to test on strings
- <doc>
- The client must execute this operation on the provided field
- table string values and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return concatenation of string field values</value>
- <value name="min">return shortest of string field values</value>
- <value name="max">return longest of string field values</value>
- </assert>
- </field>
- </method>
- <method name="table-ok" synchronous="1" index="31">
- report table test result
- <doc>
- This method reports the result of a Table method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="integer result" type="longlong">
- integer result value
- <doc>
- The result of the tested integer operation.
- </doc>
- </field>
- <field name="string result" type="longstr">
- string result value
- <doc>
- The result of the tested string operation.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="content" synchronous="1" content="1" index="40">
- test content handling
- <doc>
- This method tests the peer's capability to correctly marshal content.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="content-ok"/>
- </method>
- <method name="content-ok" synchronous="1" content="1" index="41">
- report content test result
- <doc>
- This method reports the result of a Content method. It contains the
- content checksum and echoes the original content as provided.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="content checksum" type="long">
- content hash
- <doc>
- The 32-bit checksum of the content, calculated by adding the
- content into a 32-bit accumulator.
- </doc>
- </field>
- </method>
- </class>
-</amqp>
diff --git a/M4-RCs/qpid/gentools/xml-src/amqp-0.9.test.xml b/M4-RCs/qpid/gentools/xml-src/amqp-0.9.test.xml
deleted file mode 100644
index e12e9c787a..0000000000
--- a/M4-RCs/qpid/gentools/xml-src/amqp-0.9.test.xml
+++ /dev/null
@@ -1,4282 +0,0 @@
-<?xml version = "1.0"?>
-
-<!--
- EDITORS: (PH) Pieter Hintjens <ph@imatix.com>
- (KvdR) Kim van der Riet <kim.vdriet@redhat.com>
-
- These editors have been assigned by the AMQP working group.
- Please do not edit/commit this file without consulting with
- one of the above editors.
- ========================================================
-
- TODOs
- - see TODO comments in the text
--->
-
-<!--
- Copyright Notice
- ================
- (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc.,
- iMatix Corporation, IONA\ufffd Technologies, Red Hat, Inc.,
- TWIST Process Innovations, and 29West Inc. 2006. All rights reserved.
-
- License
- =======
- JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
- Corporation, IONA\ufffd Technologies, Red Hat, Inc., TWIST Process Innovations, and
- 29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide,
- perpetual, royalty-free, nontransferable, nonexclusive license to
- (i) copy, display, and implement the Advanced Messaging Queue Protocol
- ("AMQP") Specification and (ii) the Licensed Claims that are held by
- the Authors, all for the purpose of implementing the Advanced Messaging
- Queue Protocol Specification. Your license and any rights under this
- Agreement will terminate immediately without notice from
- any Author if you bring any claim, suit, demand, or action related to
- the Advanced Messaging Queue Protocol Specification against any Author.
- Upon termination, you shall destroy all copies of the Advanced Messaging
- Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or
- patent application, throughout the world, excluding design patents and
- design registrations, owned or controlled, or that can be sublicensed
- without fee and in compliance with the requirements of this
- Agreement, by an Author or its affiliates now or at any
- future time and which would necessarily be infringed by implementation
- of the Advanced Messaging Queue Protocol Specification. A claim is
- necessarily infringed hereunder only when it is not possible to avoid
- infringing it because there is no plausible non-infringing alternative
- for implementing the required portions of the Advanced Messaging Queue
- Protocol Specification. Notwithstanding the foregoing, Licensed Claims
- shall not include any claims other than as set forth above even if
- contained in the same patent as Licensed Claims; or that read solely
- on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging
- Queue Protocol Specification, or that, if licensed, would require a
- payment of royalties by the licensor to unaffiliated third parties.
- Moreover, Licensed Claims shall not include (i) any enabling technologies
- that may be necessary to make or use any Licensed Product but are not
- themselves expressly set forth in the Advanced Messaging Queue Protocol
- Specification (e.g., semiconductor manufacturing technology, compiler
- technology, object oriented technology, networking technology, operating
- system technology, and the like); or (ii) the implementation of other
- published standards developed elsewhere and merely referred to in the
- body of the Advanced Messaging Queue Protocol Specification, or
- (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced
- Messaging Queue Protocol Specification. For purposes of this definition,
- the Advanced Messaging Queue Protocol Specification shall be deemed to
- include both architectural and interconnection requirements essential
- for interoperability and may also include supporting source code artifacts
- where such architectural, interconnection requirements and source code
- artifacts are expressly identified as being required or documentation to
- achieve compliance with the Advanced Messaging Queue Protocol Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions
- of products (hardware, software or combinations thereof) that implement
- and are compliant with all relevant portions of the Advanced Messaging
- Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any
- use you may make of the Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS,"
- AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
- IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE
- CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE
- SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY
- PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
- USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE
- PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner,
- including advertising or publicity pertaining to the Advanced Messaging
- Queue Protocol Specification or its contents without specific, written
- prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you
- shall destroy all copies of the Advanced Messaging Queue Protocol
- Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the
- Octagon Symbol are trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA
- Technologies PLC and/or its subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered
- trademarks of Red Hat, Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of
- Sun Microsystems, Inc. in the United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service
- marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
--->
-
-<!--
- <!DOCTYPE amqp SYSTEM "amqp.dtd">
--->
-
-<!-- XML Notes
-
- We use entities to indicate repetition; attributes to indicate properties.
-
- We use the 'name' attribute as an identifier, usually within the context
- of the surrounding entities.
-
- We use spaces to seperate words in names, so that we can print names in
- their natural form depending on the context - underlines for source code,
- hyphens for written text, etc.
-
- We do not enforce any particular validation mechanism but we support all
- mechanisms. The protocol definition conforms to a formal grammar that is
- published seperately in several technologies.
-
- -->
-
-<amqp major = "0" minor = "9" port = "5672" comment = "AMQ Protocol">
- <!--
- ======================================================
- == CONSTANTS
- ======================================================
- -->
- <!-- Frame types -->
- <constant name = "frame-method" value = "1" />
- <constant name = "frame-header" value = "2" />
- <constant name = "frame-body" value = "3" />
- <constant name = "frame-oob-method" value = "4" />
- <constant name = "frame-oob-header" value = "5" />
- <constant name = "frame-oob-body" value = "6" />
- <constant name = "frame-trace" value = "7" />
- <constant name = "frame-heartbeat" value = "8" />
-
- <!-- Protocol constants -->
- <constant name = "frame-min-size" value = "4096" />
- <constant name = "frame-end" value = "206" />
-
- <!-- Reply codes -->
- <constant name = "reply-success" value = "200">
- <doc>
- Indicates that the method completed successfully. This reply code is
- reserved for future use - the current protocol design does not use positive
- confirmation and reply codes are sent only in case of an error.
- </doc>
- </constant>
-
- <constant name = "not-delivered" value = "310" class = "soft-error">
- <doc>
- The client asked for a specific message that is no longer available.
- The message was delivered to another client, or was purged from the queue
- for some other reason.
- </doc>
- </constant>
-
- <constant name = "content-too-large" value = "311" class = "soft-error">
- <doc>
- The client attempted to transfer content larger than the server could accept
- at the present time. The client may retry at a later time.
- </doc>
- </constant>
-
- <constant name = "connection-forced" value = "320" class = "hard-error">
- <doc>
- An operator intervened to close the connection for some reason. The client
- may retry at some later date.
- </doc>
- </constant>
-
- <constant name = "invalid-path" value = "402" class = "hard-error">
- <doc>
- The client tried to work with an unknown virtual host.
- </doc>
- </constant>
-
- <constant name = "access-refused" value = "403" class = "soft-error">
- <doc>
- The client attempted to work with a server entity to which it has no
- access due to security settings.
- </doc>
- </constant>
-
- <constant name = "not-found" value = "404" class = "soft-error">
- <doc>The client attempted to work with a server entity that does not exist.</doc>
- </constant>
-
- <constant name = "resource-locked" value = "405" class = "soft-error">
- <doc>
- The client attempted to work with a server entity to which it has no
- access because another client is working with it.
- </doc>
- </constant>
-
- <constant name = "precondition-failed" value = "406" class = "soft-error">
- <doc>
- The client requested a method that was not allowed because some precondition
- failed.
- </doc>
- </constant>
-
- <constant name = "frame-error" value = "501" class = "hard-error">
- <doc>
- The client sent a malformed frame that the server could not decode. This
- strongly implies a programming error in the client.
- </doc>
- </constant>
-
- <constant name = "syntax-error" value = "502" class = "hard-error">
- <doc>
- The client sent a frame that contained illegal values for one or more
- fields. This strongly implies a programming error in the client.
- </doc>
- </constant>
-
- <constant name = "command-invalid" value = "503" class = "hard-error">
- <doc>
- The client sent an invalid sequence of frames, attempting to perform an
- operation that was considered invalid by the server. This usually implies
- a programming error in the client.
- </doc>
- </constant>
-
- <constant name = "channel-error" value = "504" class = "hard-error">
- <doc>
- The client attempted to work with a channel that had not been correctly
- opened. This most likely indicates a fault in the client layer.
- </doc>
- </constant>
-
- <constant name = "resource-error" value = "506" class = "hard-error">
- <doc>
- The server could not complete the method because it lacked sufficient
- resources. This may be due to the client creating too many of some type
- of entity.
- </doc>
- </constant>
-
- <constant name = "not-allowed" value = "530" class = "hard-error">
- <doc>
- The client tried to work with some entity in a manner that is prohibited
- by the server, due to security settings or by some other criteria.
- </doc>
- </constant>
-
- <constant name = "not-implemented" value = "540" class = "hard-error">
- <doc>
- The client tried to use functionality that is not implemented in the
- server.
- </doc>
- </constant>
-
- <constant name = "internal-error" value = "541" class = "hard-error">
- <doc>
- The server could not complete the method because of an internal error.
- The server may require intervention by an operator in order to resume
- normal operations.
- </doc>
- </constant>
-
- <constant name = "test-str2" value = "1.2.3.3"/>
-
- <!--
- ======================================================
- == DOMAIN TYPES
- ======================================================
- -->
-
- <domain name = "access-ticket" type = "short" label = "access ticket granted by server">
- <doc>
- An access ticket granted by the server for a certain set of access rights
- within a specific realm. Access tickets are valid within the channel where
- they were created, and expire when the channel closes.
- </doc>
- <assert check = "ne" value = "0" />
- </domain>
-
- <domain name = "class-id" type = "short" />
-
- <domain name = "consumer-tag" type = "shortstr" label = "consumer tag">
- <doc>
- Identifier for the consumer, valid within the current connection.
- </doc>
- </domain>
-
- <domain name = "delivery-tag" type = "longlong" label = "server-assigned delivery tag">
- <doc>
- The server-assigned and channel-specific delivery tag
- </doc>
- <rule name = "channel-local">
- <doc>
- The delivery tag is valid only within the channel from which the message was
- received. I.e. a client MUST NOT receive a message on one channel and then
- acknowledge it on another.
- </doc>
- </rule>
- <rule name = "non-zero">
- <doc>
- The server MUST NOT use a zero value for delivery tags. Zero is reserved
- for client use, meaning "all messages so far received".
- </doc>
- </rule>
- </domain>
-
- <domain name = "exchange-name" type = "shortstr" label = "exchange name">
- <doc>
- The exchange name is a client-selected string that identifies the exchange for publish
- methods. Exchange names may consist of any mixture of digits, letters, and underscores.
- Exchange names are scoped by the virtual host.
- </doc>
- <assert check = "length" value = "127" />
- </domain>
-
- <domain name = "known-hosts" type = "shortstr" label = "list of known hosts">
- <doc>
- Specifies the list of equivalent or alternative hosts that the server knows about,
- which will normally include the current server itself. Clients can cache this
- information and use it when reconnecting to a server after a failure. This field
- may be empty.
- </doc>
- </domain>
-
- <domain name = "method-id" type = "short" />
-
- <domain name = "no-ack" type = "bit" label = "no acknowledgement needed">
- <doc>
- If this field is set the server does not expect acknowledgments for
- messages. That is, when a message is delivered to the client the server
- automatically and silently acknowledges it on behalf of the client. This
- functionality increases performance but at the cost of reliability.
- Messages can get lost if a client dies before it can deliver them to the
- application.
- </doc>
- </domain>
-
- <domain name = "no-local" type = "bit" label = "do not deliver own messages">
- <doc>
- If the no-local field is set the server will not send messages to the client that
- published them.
- </doc>
- </domain>
-
- <domain name = "path" type = "shortstr">
- <doc>
- Must start with a slash "/" and continue with path names separated by slashes. A path
- name consists of any combination of at least one of [A-Za-z0-9] plus zero or more of
- [.-_+!=:].
- </doc>
-
- <assert check = "notnull" />
- <assert check = "syntax" rule = "path" />
- <assert check = "length" value = "127" />
- </domain>
-
- <domain name = "peer-properties" type = "table">
- <doc>
- This string provides a set of peer properties, used for identification, debugging, and
- general information.
- </doc>
- </domain>
-
- <domain name = "queue-name" type = "shortstr" label = "queue name">
- <doc>
- The queue name identifies the queue within the vhost. Queue names may consist of any
- mixture of digits, letters, and underscores.
- </doc>
- <assert check = "length" value = "127" />
- </domain>
-
- <domain name = "redelivered" type = "bit" label = "message is being redelivered">
- <doc>
- This indicates that the message has been previously delivered to this or
- another client.
- </doc>
- <rule name = "implementation">
- <doc>
- The server SHOULD try to signal redelivered messages when it can. When
- redelivering a message that was not successfully acknowledged, the server
- SHOULD deliver it to the original client if possible.
- </doc>
- <doc type = "scenario">
- Create a shared queue and publish a message to the queue. Consume the
- message using explicit acknowledgements, but do not acknowledge the
- message. Close the connection, reconnect, and consume from the queue
- again. The message should arrive with the redelivered flag set.
- </doc>
- </rule>
- <rule name = "hinting">
- <doc>
- The client MUST NOT rely on the redelivered field but should take it as a
- hint that the message may already have been processed. A fully robust
- client must be able to track duplicate received messages on non-transacted,
- and locally-transacted channels.
- </doc>
- </rule>
- </domain>
-
- <domain name = "reply-code" type = "short" label = "reply code from server">
- <doc>
- The reply code. The AMQ reply codes are defined as constants at the start
- of this formal specification.
- </doc>
- <assert check = "notnull" />
- </domain>
-
- <domain name = "reply-text" type = "shortstr" label = "localised reply text">
- <doc>
- The localised reply text. This text can be logged as an aid to resolving
- issues.
- </doc>
- <assert check = "notnull" />
- </domain>
-
- <!-- Elementary domains -->
- <domain name = "bit" type = "bit" label = "single bit" />
- <domain name = "octet" type = "octet" label = "single octet" />
- <domain name = "short" type = "short" label = "16-bit integer" />
- <domain name = "long" type = "long" label = "32-bit integer" />
- <domain name = "longlong" type = "longlong" label = "64-bit integer" />
- <domain name = "shortstr" type = "shortstr" label = "short string" />
- <domain name = "longstr" type = "longstr" label = "long string" />
- <domain name = "timestamp" type = "timestamp" label = "64-bit timestamp" />
- <domain name = "table" type = "table" label = "field table" />
-
- <!-- == CONNECTION ======================================================= -->
-
- <!-- TODO 0.81 - the 'handler' attribute of methods needs to be reviewed, and if
- no current implementations use it, removed. /PH 2006/07/20
- -->
-
- <class name = "connection" handler = "connection" index = "10" label = "work with socket connections">
- <doc>
- The connection class provides methods for a client to establish a network connection to
- a server, and for both peers to operate the connection thereafter.
- </doc>
-
- <doc type = "grammar">
- connection = open-connection *use-connection close-connection
- open-connection = C:protocol-header
- S:START C:START-OK
- *challenge
- S:TUNE C:TUNE-OK
- C:OPEN S:OPEN-OK | S:REDIRECT
- challenge = S:SECURE C:SECURE-OK
- use-connection = *channel
- close-connection = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "start" synchronous = "1" index = "10" label = "start connection negotiation">
- <doc>
- This method starts the connection negotiation process by telling the client the
- protocol version that the server proposes, along with a list of security mechanisms
- which the client can use for authentication.
- </doc>
-
- <rule name = "protocol-name">
- <doc>
- If the server cannot support the protocol specified in the protocol header,
- it MUST close the socket connection without sending any response method.
- </doc>
- <doc type = "scenario">
- The client sends a protocol header containing an invalid protocol name.
- The server must respond by closing the connection.
- </doc>
- </rule>
- <rule name = "server-support">
- <doc>
- The server MUST provide a protocol version that is lower than or equal to
- that requested by the client in the protocol header.
- </doc>
- <doc type = "scenario">
- The client requests a protocol version that is higher than any valid
- implementation, e.g. 9.0. The server must respond with a current
- protocol version, e.g. 1.0.
- </doc>
- </rule>
- <rule name = "client-support">
- <doc>
- If the client cannot handle the protocol version suggested by the server
- it MUST close the socket connection.
- </doc>
- <doc type = "scenario">
- The server sends a protocol version that is lower than any valid
- implementation, e.g. 0.1. The client must respond by closing the
- connection.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
- <response name = "start-ok" />
-
- <field name = "version-major" domain = "octet" label = "protocol major version">
- <doc>
- The version of the protocol, expressed in protocol units of 0.1 public
- versions and properly printed as two digits with a leading zero. I.e. a
- protocol version of "09" represents a public version "0.9". The decimal
- shift allows the correct expression of pre-1.0 protocol releases.
- </doc>
- <doc type = "todo">
- This field should be renamed to "protocol version".
- </doc>
- </field>
-
- <field name = "version-minor" domain = "octet" label = "protocol major version">
- <doc>
- The protocol revision, expressed as an integer from 0 to 9. The use of more
- than ten revisions is discouraged. The public version string is constructed
- from the protocol version and revision as follows: we print the protocol
- version with one decimal position, and we append the protocol revision. A
- version=10 and revision=2 are printed as "1.02".
- </doc>
- <doc type = "todo">
- This field should be renamed to "protocol revision".
- </doc>
- </field>
-
- <field name = "server-properties" domain = "peer-properties" label = "server properties">
- <rule name = "required-fields">
- <doc>
- The properties SHOULD contain at least these fields: "host", specifying the
- server host name or address, "product", giving the name of the server product,
- "version", giving the name of the server version, "platform", giving the name
- of the operating system, "copyright", if appropriate, and "information", giving
- other general information.
- </doc>
- <doc type = "scenario">
- Client connects to server and inspects the server properties. It checks for
- the presence of the required fields.
- </doc>
- </rule>
- </field>
-
- <field name = "mechanisms" domain = "longstr" label = "available security mechanisms">
- <doc>
- A list of the security mechanisms that the server supports, delimited by spaces.
- Currently ASL supports these mechanisms: PLAIN.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "locales" domain = "longstr" label = "available message locales">
- <doc>
- A list of the message locales that the server supports, delimited by spaces. The
- locale defines the language in which the server will send reply texts.
- </doc>
- <rule name = "required-support">
- <doc>
- The server MUST support at least the en_US locale.
- </doc>
- <doc type = "scenario">
- Client connects to server and inspects the locales field. It checks for
- the presence of the required locale(s).
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
- </method>
-
- <method name = "start-ok" synchronous = "1" index = "11"
- label = "select security mechanism and locale">
- <doc>
- This method selects a SASL security mechanism. ASL uses SASL (RFC2222) to
- negotiate authentication and encryption.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "client-properties" domain = "peer-properties" label = "client properties">
- <rule name = "required-fields">
- <!-- This rule is not testable from the client side -->
- <doc>
- The properties SHOULD contain at least these fields: "product", giving the name
- of the client product, "version", giving the name of the client version, "platform",
- giving the name of the operating system, "copyright", if appropriate, and
- "information", giving other general information.
- </doc>
- </rule>
- </field>
-
- <field name = "mechanism" domain = "shortstr" label = "selected security mechanism">
- <doc>
- A single security mechanisms selected by the client, which must be one of those
- specified by the server.
- </doc>
- <rule name = "security">
- <doc>
- The client SHOULD authenticate using the highest-level security profile it
- can handle from the list provided by the server.
- </doc>
- </rule>
- <rule name = "validity">
- <doc>
- If the mechanism field does not contain one of the security mechanisms
- proposed by the server in the Start method, the server MUST close the
- connection without sending any further data.
- </doc>
- <doc type = "scenario">
- Client connects to server and sends an invalid security mechanism. The
- server must respond by closing the connection (a socket close, with no
- connection close negotiation).
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
-
- <field name = "response" domain = "longstr" label = "security response data">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this
- data are defined by the SASL security mechanism.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "locale" domain = "shortstr" label = "selected message locale">
- <doc>
- A single message local selected by the client, which must be one of those
- specified by the server.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "secure" synchronous = "1" index = "20" label = "security mechanism challenge">
- <doc>
- The SASL protocol works by exchanging challenges and responses until both peers have
- received sufficient information to authenticate each other. This method challenges
- the client to provide more information.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
- <response name = "secure-ok" />
-
- <field name = "challenge" domain = "longstr" label = "security challenge data">
- <doc>
- Challenge information, a block of opaque binary data passed to the security
- mechanism.
- </doc>
- </field>
- </method>
-
- <method name = "secure-ok" synchronous = "1" index = "21" label = "security mechanism response">
- <doc>
- This method attempts to authenticate, passing a block of SASL data for the security
- mechanism at the server side.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "response" domain = "longstr" label = "security response data">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this
- data are defined by the SASL security mechanism.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "tune" synchronous = "1" index = "30"
- label = "propose connection tuning parameters">
- <doc>
- This method proposes a set of connection configuration values to the client. The
- client can accept and/or adjust these.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <response name = "tune-ok" />
-
- <field name = "channel-max" domain = "short" label = "proposed maximum channels">
- <doc>
- The maximum total number of channels that the server allows per connection. Zero
- means that the server does not impose a fixed limit, but the number of allowed
- channels may be limited by available server resources.
- </doc>
- </field>
-
- <field name = "frame-max" domain = "long" label = "proposed maximum frame size">
- <doc>
- The largest frame size that the server proposes for the connection. The client
- can negotiate a lower value. Zero means that the server does not impose any
- specific limit but may reject very large frames if it cannot allocate resources
- for them.
- </doc>
- <rule name = "minimum">
- <doc>
- Until the frame-max has been negotiated, both peers MUST accept frames of up
- to frame-min-size octets large, and the minimum negotiated value for frame-max
- is also frame-min-size.
- </doc>
- <doc type = "scenario">
- Client connects to server and sends a large properties field, creating a frame
- of frame-min-size octets. The server must accept this frame.
- </doc>
- </rule>
- </field>
-
- <field name = "heartbeat" domain = "short" label = "desired heartbeat delay">
- <!-- TODO 0.82 - the heartbeat negotiation mechanism was changed during
- implementation because the model documented here does not actually
- work properly. The best model we found is that the server proposes
- a heartbeat value to the client; the client can reply with zero, meaning
- 'do not use heartbeats (as documented here), or can propose its own
- heartbeat value, which the server should then accept. This is different
- from the model here which is disconnected - e.g. each side requests a
- heartbeat independently. Basically a connection is heartbeated in
- both ways, or not at all, depending on whether both peers support
- heartbeating or not, and the heartbeat value should itself be chosen
- by the client so that remote links can get a higher value. Also, the
- actual heartbeat mechanism needs documentation, and is as follows: so
- long as there is activity on a connection - in or out - both peers
- assume the connection is active. When there is no activity, each peer
- must send heartbeat frames. When no heartbeat frame is received after
- N cycles (where N is at least 2), the connection can be considered to
- have died. /PH 2006/07/19
- -->
- <doc>
- The delay, in seconds, of the connection heartbeat that the server wants.
- Zero means the server does not want a heartbeat.
- </doc>
- </field>
- </method>
-
- <method name = "tune-ok" synchronous = "1" index = "31"
- label = "negotiate connection tuning parameters">
- <doc>
- This method sends the client's connection tuning parameters to the server.
- Certain fields are negotiated, others provide capability information.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "channel-max" domain = "short" label = "negotiated maximum channels">
- <doc>
- The maximum total number of channels that the client will use per connection.
- </doc>
- <rule name = "upper-limit">
- <doc>
- If the client specifies a channel max that is higher than the value provided
- by the server, the server MUST close the connection without attempting a
- negotiated close. The server may report the error in some fashion to assist
- implementors.
- </doc>
- </rule>
- <assert check = "notnull" />
- <assert check = "le" method = "tune" field = "channel-max" />
- </field>
-
- <field name = "frame-max" domain = "long" label = "negotiated maximum frame size">
- <doc>
- The largest frame size that the client and server will use for the connection.
- Zero means that the client does not impose any specific limit but may reject
- very large frames if it cannot allocate resources for them. Note that the
- frame-max limit applies principally to content frames, where large contents can
- be broken into frames of arbitrary size.
- </doc>
- <rule name = "minimum">
- <doc>
- Until the frame-max has been negotiated, both peers MUST accept frames of up
- to frame-min-size octets large, and the minimum negotiated value for frame-max
- is also frame-min-size.
- </doc>
- </rule>
- <rule name = "upper-limit">
- <doc>
- If the client specifies a frame max that is higher than the value provided
- by the server, the server MUST close the connection without attempting a
- negotiated close. The server may report the error in some fashion to assist
- implementors.
- </doc>
- </rule>
- </field>
-
- <field name = "heartbeat" domain = "short" label = "desired heartbeat delay">
- <doc>
- The delay, in seconds, of the connection heartbeat that the client wants. Zero
- means the client does not want a heartbeat.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "open" synchronous = "1" index = "40" label = "open connection to virtual host">
- <doc>
- This method opens a connection to a virtual host, which is a collection of
- resources, and acts to separate multiple application domains within a server.
- The server may apply arbitrary limits per virtual host, such as the number
- of each type of entity that may be used, per connection and/or in total.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "open-ok" />
- <response name = "redirect" />
-
- <field name = "virtual-host" domain = "path" label = "virtual host name">
- <!-- TODO 0.82 - the entire vhost model needs review. This concept was
- prompted by the HTTP vhost concept but does not fit very well into
- AMQP. Currently we use the vhost as a "cluster identifier" which is
- inaccurate usage. /PH 2006/07/19
- -->
- <assert check = "regexp" value = "^[a-zA-Z0-9/-_]+$" />
- <doc>
- The name of the virtual host to work with.
- </doc>
- <rule name = "separation">
- <doc>
- If the server supports multiple virtual hosts, it MUST enforce a full
- separation of exchanges, queues, and all associated entities per virtual
- host. An application, connected to a specific virtual host, MUST NOT be able
- to access resources of another virtual host.
- </doc>
- </rule>
- <rule name = "security">
- <doc>
- The server SHOULD verify that the client has permission to access the
- specified virtual host.
- </doc>
- </rule>
- </field>
-
- <field name = "capabilities" domain = "shortstr" label = "required capabilities">
- <doc>
- The client can specify zero or more capability names, delimited by spaces.
- The server can use this string to how to process the client's connection
- request.
- </doc>
- </field>
-
- <field name = "insist" domain = "bit" label = "insist on connecting to server">
- <doc>
- In a configuration with multiple collaborating servers, the server may respond
- to a Connection.Open method with a Connection.Redirect. The insist option tells
- the server that the client is insisting on a connection to the specified server.
- </doc>
- <rule name = "behaviour">
- <doc>
- When the client uses the insist option, the server MUST NOT respond with a
- Connection.Redirect method. If it cannot accept the client's connection
- request it should respond by closing the connection with a suitable reply
- code.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "open-ok" synchronous = "1" index = "41" label = "signal that connection is ready">
- <doc>
- This method signals to the client that the connection is ready for use.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "known-hosts" domain = "known-hosts" />
- </method>
-
- <method name = "redirect" synchronous = "1" index = "42" label = "redirects client to other server">
- <doc>
- This method redirects the client to another server, based on the requested virtual
- host and/or capabilities.
- </doc>
- <rule name = "usage">
- <doc>
- When getting the Connection.Redirect method, the client SHOULD reconnect to
- the host specified, and if that host is not present, to any of the hosts
- specified in the known-hosts list.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <field name = "host" domain = "shortstr" label = "server to connect to">
- <doc>
- Specifies the server to connect to. This is an IP address or a DNS name,
- optionally followed by a colon and a port number. If no port number is
- specified, the client should use the default port number for the protocol.
- </doc>
- <assert check = "notnull" />
- </field>
- <field name = "known-hosts" domain = "known-hosts" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "close" synchronous = "1" index = "50" label = "request a connection close">
- <doc>
- This method indicates that the sender wants to close the connection. This may be
- due to internal conditions (e.g. a forced shut-down) or due to an error handling
- a specific method, i.e. an exception. When a close is due to an exception, the
- sender provides the class and method id of the method which caused the exception.
- </doc>
- <!-- TODO: the connection close mechanism needs to be reviewed from the ODF
- documentation and better expressed as rules here. /PH 2006/07/20
- -->
- <rule name = "stability">
- <doc>
- After sending this method any received method except the Close-OK method MUST
- be discarded.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- <response name = "close-ok" />
-
- <field name = "reply-code" domain = "reply-code" />
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "class-id" domain = "class-id" label = "failing method class">
- <doc>
- When the close is provoked by a method exception, this is the class of the
- method.
- </doc>
- </field>
-
- <field name = "method-id" domain = "method-id" label = "failing method ID">
- <doc>
- When the close is provoked by a method exception, this is the ID of the method.
- </doc>
- </field>
- </method>
-
- <method name = "close-ok" synchronous = "1" index = "51" label = "confirm a connection close">
- <doc>
- This method confirms a Connection.Close method and tells the recipient that it is
- safe to release resources for the connection and close the socket.
- </doc>
- <rule name = "reporting">
- <doc>
- A peer that detects a socket closure without having received a Close-Ok
- handshake method SHOULD log the error.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- </method>
- </class>
-
- <!-- == CHANNEL ========================================================== -->
-
- <class name = "channel" handler = "channel" index = "20" label = "work with channels">
- <doc>
- The channel class provides methods for a client to establish a channel to a
- server and for both peers to operate the channel thereafter.
- </doc>
-
- <doc type = "grammar">
- channel = open-channel *use-channel close-channel
- open-channel = C:OPEN S:OPEN-OK
- use-channel = C:FLOW S:FLOW-OK
- / S:FLOW C:FLOW-OK
- / S:ALERT
- / functional-class
- close-channel = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "open" synchronous = "1" index = "10" label = "open a channel for use">
- <doc>
- This method opens a channel to the server.
- </doc>
- <rule name = "state" on-failure = "channel-error">
- <doc>
- The client MUST NOT use this method on an alread-opened channel.
- </doc>
- <doc type = "scenario">
- Client opens a channel and then reopens the same channel.
- </doc>
- </rule>
- <chassis name = "server" implement = "MUST" />
- <response name = "open-ok" />
- <field name = "out of band" domain = "shortstr" label = "out-of-band settings">
- <doc>
- Configures out-of-band transfers on this channel. The syntax and meaning of this
- field will be formally defined at a later date.
- </doc>
- <assert check = "null" />
- </field>
- </method>
-
- <method name = "open-ok" synchronous = "1" index = "11" label = "signal that the channel is ready">
- <doc>
- This method signals to the client that the channel is ready for use.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "flow" synchronous = "1" index = "20" label = "enable/disable flow from peer">
- <doc>
- This method asks the peer to pause or restart the flow of content data. This is a
- simple flow-control mechanism that a peer can use to avoid oveflowing its queues or
- otherwise finding itself receiving more messages than it can process. Note that this
- method is not intended for window control. The peer that receives a disable flow
- method should finish sending the current content frame, if any, then pause.
- </doc>
-
- <rule name = "initial-state">
- <doc>
- When a new channel is opened, it is active (flow is active). Some applications
- assume that channels are inactive until started. To emulate this behaviour a
- client MAY open the channel, then pause it.
- </doc>
- </rule>
-
- <rule name = "bidirectional">
- <doc>
- When sending content frames, a peer SHOULD monitor the channel for incoming
- methods and respond to a Channel.Flow as rapidly as possible.
- </doc>
- </rule>
-
- <rule name = "throttling">
- <doc>
- A peer MAY use the Channel.Flow method to throttle incoming content data for
- internal reasons, for example, when exchanging data over a slower connection.
- </doc>
- </rule>
-
- <rule name = "expected-behaviour">
- <doc>
- The peer that requests a Channel.Flow method MAY disconnect and/or ban a peer
- that does not respect the request. This is to prevent badly-behaved clients
- from overwhelming a broker.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <response name = "flow-ok" />
-
- <field name = "active" domain = "bit" label = "start/stop content frames">
- <doc>
- If 1, the peer starts sending content frames. If 0, the peer stops sending
- content frames.
- </doc>
- </field>
- </method>
-
- <method name = "flow-ok" index = "21" label = "confirm a flow method">
- <doc>
- Confirms to the peer that a flow command was received and processed.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- <field name = "active" domain = "bit" label = "current flow setting">
- <doc>
- Confirms the setting of the processed flow method: 1 means the peer will start
- sending or continue to send content frames; 0 means it will not.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- TODO 0.82 - remove this method entirely
- /PH 2006/07/20
- -->
- <method name = "alert" index = "30" label = "send a non-fatal warning message">
- <doc>
- This method allows the server to send a non-fatal warning to the client. This is
- used for methods that are normally asynchronous and thus do not have confirmations,
- and for which the server may detect errors that need to be reported. Fatal errors
- are handled as channel or connection exceptions; non-fatal errors are sent through
- this method.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "reply-code" domain = "reply-code" />
- <field name = "reply-text" domain = "reply-text" />
- <field name = "details" domain = "table" label = "detailed information for warning">
- <doc>
- A set of fields that provide more information about the problem. The meaning of
- these fields are defined on a per-reply-code basis (TO BE DEFINED).
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "close" synchronous = "1" index = "40" label = "request a channel close">
- <doc>
- This method indicates that the sender wants to close the channel. This may be due to
- internal conditions (e.g. a forced shut-down) or due to an error handling a specific
- method, i.e. an exception. When a close is due to an exception, the sender provides
- the class and method id of the method which caused the exception.
- </doc>
-
- <!-- TODO: the channel close behaviour needs to be reviewed from the ODF
- documentation and better expressed as rules here. /PH 2006/07/20
- -->
- <rule name = "stability">
- <doc>
- After sending this method any received method except the Close-OK method MUST
- be discarded.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- <response name = "close-ok" />
-
- <field name = "reply-code" domain = "reply-code" />
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "class-id" domain = "class-id" label = "failing method class">
- <doc>
- When the close is provoked by a method exception, this is the class of the
- method.
- </doc>
- </field>
-
- <field name = "method-id" domain = "method-id" label = "failing method ID">
- <doc>
- When the close is provoked by a method exception, this is the ID of the method.
- </doc>
- </field>
- </method>
-
- <method name = "close-ok" synchronous = "1" index = "41" label = "confirm a channel close">
- <doc>
- This method confirms a Channel.Close method and tells the recipient that it is safe
- to release resources for the channel and close the socket.
- </doc>
- <rule name = "reporting">
- <doc>
- A peer that detects a socket closure without having received a Channel.Close-Ok
- handshake method SHOULD log the error.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- </method>
- </class>
-
- <!-- == ACCESS =========================================================== -->
-
- <!-- TODO 0.82 - this class must be implemented by two teams before we can
- consider it matured.
- -->
-
- <class name = "access" handler = "connection" index = "30" label = "work with access tickets">
- <doc>
- The protocol control access to server resources using access tickets. A
- client must explicitly request access tickets before doing work. An access
- ticket grants a client the right to use a specific set of resources -
- called a "realm" - in specific ways.
- </doc>
-
- <doc type = "grammar">
- access = C:REQUEST S:REQUEST-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "request" synchronous = "1" index = "10" label = "request an access ticket">
- <doc>
- This method requests an access ticket for an access realm. The server
- responds by granting the access ticket. If the client does not have
- access rights to the requested realm this causes a connection exception.
- Access tickets are a per-channel resource.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "request-ok" />
-
- <field name = "realm" domain = "shortstr" label = "name of requested realm">
- <doc>
- Specifies the name of the realm to which the client is requesting access.
- The realm is a configured server-side object that collects a set of
- resources (exchanges, queues, etc.). If the channel has already requested
- an access ticket onto this realm, the previous ticket is destroyed and a
- new ticket is created with the requested access rights, if allowed.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST specify a realm that is known to the server. The server
- makes an identical response for undefined realms as it does for realms
- that are defined but inaccessible to this client.
- </doc>
- <doc type = "scenario">
- Client specifies an undefined realm.
- </doc>
- </rule>
- </field>
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive access to the realm, meaning that this will be the only
- channel that uses the realm's resources.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MAY NOT request exclusive access to a realm that has active
- access tickets, unless the same channel already had the only access
- ticket onto that realm.
- </doc>
- <doc type = "scenario">
- Client opens two channels and requests exclusive access to the same realm.
- </doc>
- </rule>
- </field>
- <field name = "passive" domain = "bit" label = "request passive access">
- <doc>
- Request message passive access to the specified access realm. Passive
- access lets a client get information about resources in the realm but
- not to make any changes to them.
- </doc>
- </field>
- <field name = "active" domain = "bit" label = "request active access">
- <doc>
- Request message active access to the specified access realm. Active access lets
- a client get create and delete resources in the realm.
- </doc>
- </field>
- <field name = "write" domain = "bit" label = "request write access">
- <doc>
- Request write access to the specified access realm. Write access lets a client
- publish messages to all exchanges in the realm.
- </doc>
- </field>
- <field name = "read" domain = "bit" label = "request read access">
- <doc>
- Request read access to the specified access realm. Read access lets a client
- consume messages from queues in the realm.
- </doc>
- </field>
- </method>
-
- <method name = "request-ok" synchronous = "1" index = "11" label = "grant access to server resources">
- <doc>
- This method provides the client with an access ticket. The access ticket is valid
- within the current channel and for the lifespan of the channel.
- </doc>
- <rule name = "per-channel" on-failure = "not-allowed">
- <doc>
- The client MUST NOT use access tickets except within the same channel as
- originally granted.
- </doc>
- <doc type = "scenario">
- Client opens two channels, requests a ticket on one channel, and then
- tries to use that ticket in a seconc channel.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <field name = "ticket" domain = "access-ticket" />
- </method>
- </class>
-
- <!-- == EXCHANGE ========================================================= -->
-
- <class name = "exchange" handler = "channel" index = "40" label = "work with exchanges">
- <doc>
- Exchanges match and distribute messages across queues. Exchanges can be configured in
- the server or created at runtime.
- </doc>
-
- <doc type = "grammar">
- exchange = C:DECLARE S:DECLARE-OK
- / C:DELETE S:DELETE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <rule name = "required-types">
- <doc>
- The server MUST implement these standard exchange types: fanout, direct.
- </doc>
- <doc type = "scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
- <rule name = "recommended-types">
- <doc>
- The server SHOULD implement these standard exchange types: topic, headers.
- </doc>
- <doc type = "scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
- <rule name = "required-instances">
- <doc>
- The server MUST, in each virtual host, pre-declare an exchange instance
- for each standard exchange type that it implements, where the name of the
- exchange instance is "amq." followed by the exchange type name.
- </doc>
- <doc type = "scenario">
- Client creates a temporary queue and attempts to bind to each required
- exchange instance (amq.fanout, amq.direct, and amq.topic, amq.headers if
- those types are defined).
- </doc>
- </rule>
- <rule name = "default-exchange">
- <doc>
- The server MUST predeclare a direct exchange to act as the default exchange
- for content Publish methods and for default queue bindings.
- </doc>
- <doc type = "scenario">
- Client checks that the default exchange is active by specifying a queue
- binding with no exchange name, and publishing a message with a suitable
- routing key but without specifying the exchange name, then ensuring that
- the message arrives in the queue correctly.
- </doc>
- </rule>
- <rule name = "default-access">
- <doc>
- The server MUST NOT allow clients to access the default exchange except
- by specifying an empty exchange name in the Queue.Bind and content Publish
- methods.
- </doc>
- </rule>
- <rule name = "extensions">
- <doc>
- The server MAY implement other exchange types as wanted.
- </doc>
- </rule>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "declare" synchronous = "1" index = "10" label = "declare exchange, create if needed">
- <doc>
- This method creates an exchange if it does not already exist, and if the exchange
- exists, verifies that it is of the correct and expected class.
- </doc>
- <rule name = "minimum">
- <doc>
- The server SHOULD support a minimum of 16 exchanges per virtual host and
- ideally, impose no limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- The client creates as many exchanges as it can until the server reports
- an error; the number of exchanges successfuly created must be at least
- sixteen.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "declare-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- When a client defines a new exchange, this belongs to the access realm of the
- ticket used. All further work done with that exchange must be done with an
- access ticket for the same realm.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access to
- the realm in which the exchange exists or will be created, or "passive"
- access if the if-exists flag is set.
- </doc>
- <doc type = "scenario">
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <rule name = "reserved" on-failure = "access-refused">
- <doc>
- Exchange names starting with "amq." are reserved for predeclared and
- standardised exchanges. The client MUST NOT attempt to create an exchange
- starting with "amq.".
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <assert check = "regexp" value = "^[a-zA-Z0-9-_.:]+$" />
- </field>
-
- <field name = "type" domain = "shortstr" label = "exchange type">
- <doc>
- Each exchange belongs to one of a set of exchange types implemented by the
- server. The exchange types define the functionality of the exchange - i.e. how
- messages are routed through it. It is not valid or meaningful to attempt to
- change the type of an existing exchange.
- </doc>
- <rule name = "typed" on-failure = "not-allowed">
- <doc>
- Exchanges cannot be redeclared with different types. The client MUST not
- attempt to redeclare an existing exchange with a different type than used
- in the original Exchange.Declare method.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <rule name = "support" on-failure = "command-invalid">
- <doc>
- The client MUST NOT attempt to create an exchange with a type that the
- server does not support.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <assert check = "regexp" value = "^[a-zA-Z0-9-_.:]+$" />
- </field>
-
- <field name = "passive" domain = "bit" label = "do not create exchange">
- <doc>
- If set, the server will not create the exchange. The client can use this to
- check whether an exchange exists without modifying the server state.
- </doc>
- <rule name = "not-found">
- <doc>
- If set, and the exchange does not already exist, the server MUST raise a
- channel exception with reply code 404 (not found).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "durable" domain = "bit" label = "request a durable exchange">
- <doc>
- If set when creating a new exchange, the exchange will be marked as durable.
- Durable exchanges remain active when a server restarts. Non-durable exchanges
- (transient exchanges) are purged if/when a server restarts.
- </doc>
- <rule name = "support">
- <doc>
- The server MUST support both durable and transient exchanges.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <rule name = "sticky">
- <doc>
- The server MUST ignore the durable field if the exchange already exists.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <!-- TODO 0.82 - clarify how this works; there is no way to cancel a binding
- except by deleting a queue.
- -->
- <field name = "auto-delete" domain = "bit" label = "auto-delete when unused">
- <doc>
- If set, the exchange is deleted when all queues have finished using it.
- </doc>
- <rule name = "sticky">
- <doc>
- The server MUST ignore the auto-delete field if the exchange already
- exists.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "internal" domain = "bit" label = "create internal exchange">
- <doc>
- If set, the exchange may not be used directly by publishers, but only when bound
- to other exchanges. Internal exchanges are used to construct wiring that is not
- visible to applications.
- </doc>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
-
- <field name = "arguments" domain = "table" label = "arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these
- arguments depends on the server implementation. This field is ignored if passive
- is 1.
- </doc>
- </field>
- </method>
-
- <method name = "declare-ok" synchronous = "1" index = "11" label = "confirm exchange declaration">
- <doc>
- This method confirms a Declare method and confirms the name of the exchange,
- essential for automatically-named exchanges.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "delete" synchronous = "1" index = "20" label = "delete an exchange">
- <doc>
- This method deletes an exchange. When an exchange is deleted all queue bindings on
- the exchange are cancelled.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "delete-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access
- rights to the exchange's access realm.
- </doc>
- <doc type = "scenario">
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <rule name = "exists" on-failure = "not-found">
- <doc>
- The client MUST NOT attempt to delete an exchange that does not exist.
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
-
- <!-- TODO 0.82 - discuss whether this option is useful or not. I don't have
- any real use case for it. /PH 2006-07-23.
- -->
- <field name = "if-unused" domain = "bit" label = "delete only if unused">
- <doc>
- If set, the server will only delete the exchange if it has no queue bindings. If
- the exchange has queue bindings the server does not delete it but raises a
- channel exception instead.
- </doc>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "delete-ok" synchronous = "1" index = "21"
- label = "confirm deletion of an exchange">
- <doc>This method confirms the deletion of an exchange.</doc>
- <chassis name = "client" implement = "MUST" />
- </method>
- </class>
-
- <!-- == QUEUE ============================================================ -->
-
- <class name = "queue" handler = "channel" index = "50" label = "work with queues">
- <doc>
- Queues store and forward messages. Queues can be configured in the server or created at
- runtime. Queues must be attached to at least one exchange in order to receive messages
- from publishers.
- </doc>
-
- <doc type = "grammar">
- queue = C:DECLARE S:DECLARE-OK
- / C:BIND S:BIND-OK
- / C:PURGE S:PURGE-OK
- / C:DELETE S:DELETE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <rule name = "any-content">
- <doc>
- A server MUST allow any content class to be sent to any queue, in any mix, and
- queue and deliver these content classes independently. Note that all methods
- that fetch content off queues are specific to a given content class.
- </doc>
- <doc type = "scenario">
- Client creates an exchange of each standard type and several queues that
- it binds to each exchange. It must then sucessfully send each of the standard
- content types to each of the available queues.
- </doc>
- </rule>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "declare" synchronous = "1" index = "10" label = "declare queue, create if needed">
- <doc>
- This method creates or checks a queue. When creating a new queue the client can
- specify various properties that control the durability of the queue and its
- contents, and the level of sharing for the queue.
- </doc>
-
- <rule name = "default-binding">
- <doc>
- The server MUST create a default binding for a newly-created queue to the
- default exchange, which is an exchange of type 'direct'.
- </doc>
- <doc type = "scenario">
- Client creates a new queue, and then without explicitly binding it to an
- exchange, attempts to send a message through the default exchange binding,
- i.e. publish a message to the empty exchange, with the queue name as routing
- key.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_35" -->
- <rule name = "minimum-queues">
- <doc>
- The server SHOULD support a minimum of 256 queues per virtual host and ideally,
- impose no limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- Client attempts to create as many queues as it can until the server reports
- an error. The resulting count must at least be 256.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "declare-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- When a client defines a new queue, this belongs to the access realm of the
- ticket used. All further work done with that queue must be done with an access
- ticket for the same realm.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access to
- the realm in which the queue exists or will be created.
- </doc>
- <doc type = "scenario">
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <rule name = "default-name">
- <doc>
- The queue name MAY be empty, in which case the server MUST create a new
- queue with a unique generated name and return this to the client in the
- Declare-Ok method.
- </doc>
- <doc type = "scenario">
- Client attempts to create several queues with an empty name. The client then
- verifies that the server-assigned names are unique and different.
- </doc>
- </rule>
- <rule name = "reserved-prefix" on-failure = "not-allowed">
- <doc>
- Queue names starting with "amq." are reserved for predeclared and
- standardised server queues. A client MAY NOT attempt to declare a queue with a
- name that starts with "amq." and the passive option set to zero.
- </doc>
- <doc type = "scenario">
- A client attempts to create a queue with a name starting with "amq." and with
- the passive option set to zero.
- </doc>
- </rule>
- <assert check = "regexp" value = "^[a-zA-Z0-9-_.:]*$" />
- </field>
-
- <field name = "passive" domain = "bit" label = "do not create queue">
- <doc>
- If set, the server will not create the queue. This field allows the client
- to assert the presence of a queue without modifying the server state.
- </doc>
- <rule name = "passive" on-failure = "not-found">
- <doc>
- The client MAY ask the server to assert that a queue exists without
- creating the queue if not. If the queue does not exist, the server
- treats this as a failure.
- </doc>
- <doc type = "scenario">
- Client declares an existing queue with the passive option and expects
- the server to respond with a declare-ok. Client then attempts to declare
- a non-existent queue with the passive option, and the server must close
- the channel with the correct reply-code.
- </doc>
- </rule>
- </field>
-
- <field name = "durable" domain = "bit" label = "request a durable queue">
- <doc>
- If set when creating a new queue, the queue will be marked as durable. Durable
- queues remain active when a server restarts. Non-durable queues (transient
- queues) are purged if/when a server restarts. Note that durable queues do not
- necessarily hold persistent messages, although it does not make sense to send
- persistent messages to a transient queue.
- </doc>
- <!-- Rule test name: was "amq_queue_03" -->
- <rule name = "persistence">
- <doc>The server MUST recreate the durable queue after a restart.</doc>
-
- <!-- TODO: use 'client does something' rather than 'a client does something'. -->
- <doc type = "scenario">
- A client creates a durable queue. The server is then restarted. The client
- then attempts to send a message to the queue. The message should be successfully
- delivered.
- </doc>
- </rule>
- <!-- Rule test name: was "amq_queue_36" -->
- <rule name = "types">
- <doc>The server MUST support both durable and transient queues.</doc>
- <doc type = "scenario">
- A client creates two named queues, one durable and one transient.
- </doc>
- </rule>
- <!-- Rule test name: was "amq_queue_37" -->
- <rule name = "pre-existence">
- <doc>The server MUST ignore the durable field if the queue already exists.</doc>
- <doc type = "scenario">
- A client creates two named queues, one durable and one transient. The client
- then attempts to declare the two queues using the same names again, but reversing
- the value of the durable flag in each case. Verify that the queues still exist
- with the original durable flag values.
- <!-- TODO: but how? -->
- </doc>
- </rule>
- </field>
-
- <field name = "exclusive" domain = "bit" label = "request an exclusive queue">
- <doc>
- Exclusive queues may only be consumed from by the current connection. Setting
- the 'exclusive' flag always implies 'auto-delete'.
- </doc>
-
- <!-- Rule test name: was "amq_queue_38" -->
- <rule name = "types">
- <doc>
- The server MUST support both exclusive (private) and non-exclusive (shared)
- queues.
- </doc>
- <doc type = "scenario">
- A client creates two named queues, one exclusive and one non-exclusive.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_04" -->
- <rule name = "02" on-failure = "channel-error">
- <doc>
- The client MAY NOT attempt to declare any existing and exclusive queue
- on multiple connections.
- </doc>
- <doc type = "scenario">
- A client declares an exclusive named queue. A second client on a different
- connection attempts to declare a queue of the same name.
- </doc>
- </rule>
- </field>
-
- <field name = "auto-delete" domain = "bit" label = "auto-delete queue when unused">
- <doc>
- If set, the queue is deleted when all consumers have finished using it. Last
- consumer can be cancelled either explicitly or because its channel is closed. If
- there was no consumer ever on the queue, it won't be deleted.
- </doc>
-
- <!-- Rule test name: was "amq_queue_31" -->
- <rule name = "pre-existence">
- <doc>
- The server MUST ignore the auto-delete field if the queue already exists.
- </doc>
- <doc type = "scenario">
- A client creates two named queues, one as auto-delete and one explicit-delete.
- The client then attempts to declare the two queues using the same names again,
- but reversing the value of the auto-delete field in each case. Verify that the
- queues still exist with the original auto-delete flag values.
- <!-- TODO: but how? -->
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
-
- <field name = "arguments" domain = "table" label = "arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these
- arguments depends on the server implementation. This field is ignored if passive
- is 1.
- </doc>
- </field>
- </method>
-
- <method name = "declare-ok" synchronous = "1" index = "11" label = "confirms a queue definition">
- <doc>
- This method confirms a Declare method and confirms the name of the queue, essential
- for automatically-named queues.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Reports the name of the queue. If the server generated a queue name, this field
- contains that name.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "message-count" domain = "long" label = "number of messages in queue">
- <doc>
- Reports the number of messages in the queue, which will be zero for
- newly-created queues.
- </doc>
- </field>
-
- <field name = "consumer-count" domain = "long" label = "number of consumers">
- <doc>
- Reports the number of active consumers for the queue. Note that consumers can
- suspend activity (Channel.Flow) in which case they do not appear in this count.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "bind" synchronous = "1" index = "20" label = "bind queue to an exchange">
- <doc>
- This method binds a queue to an exchange. Until a queue is bound it will not receive
- any messages. In a classic messaging model, store-and-forward queues are bound to a
- dest exchange and subscription queues are bound to a dest_wild exchange.
- </doc>
-
- <!-- Rule test name: was "amq_queue_25" -->
- <rule name = "duplicates">
- <doc>
- A server MUST allow ignore duplicate bindings - that is, two or more bind
- methods for a specific queue, with identical arguments - without treating these
- as an error.
- </doc>
- <doc type = "scenario">
- A client binds a named queue to an exchange. The client then repeats the bind
- (with identical arguments).
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_39" -->
- <rule name = "failure" on-failure = "??????">
- <!--
- TODO: Find correct code. The on-failure code returned should depend on why the bind
- failed. Assuming that failures owing to bad parameters are covered in the rules relating
- to those parameters, the only remaining reason for a failure would be the lack of
- server resorces or some internal error - such as too many queues open. Would these
- cases qualify as "resource error" 506 or "internal error" 541?
- -->
- <doc>If a bind fails, the server MUST raise a connection exception.</doc>
- <doc type = "scenario">
- TODO
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_12" -->
- <rule name = "transient-exchange" on-failure = "not-allowed">
- <doc>
- The server MUST NOT allow a durable queue to bind to a transient exchange.
- </doc>
- <doc type = "scenario">
- A client creates a transient exchange. The client then declares a named durable
- queue and then attempts to bind the transient exchange to the durable queue.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_13" -->
- <rule name = "durable-exchange">
- <doc>
- Bindings for durable queues are automatically durable and the server SHOULD
- restore such bindings after a server restart.
- </doc>
- <doc type = "scenario">
- A server creates a named durable queue and binds it to a durable exchange. The
- server is restarted. The client then attempts to use the queue/exchange combination.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_17" -->
- <rule name = "internal-exchange">
- <doc>
- If the client attempts to bind to an exchange that was declared as internal, the server
- MUST raise a connection exception with reply code 530 (not allowed).
- </doc>
- <doc type = "scenario">
- A client attempts to bind a named queue to an internal exchange.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_40" -->
- <rule name = "binding-count">
- <doc>
- The server SHOULD support at least 4 bindings per queue, and ideally, impose no
- limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- A client creates a named queue and attempts to bind it to 4 different non-internal
- exchanges.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "bind-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- The client provides a valid access ticket giving "active" access rights to the
- queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to bind. If the queue name is empty, refers to
- the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "empty-queue" on-failure = "not-allowed">
- <doc>
- A client MUST NOT be allowed to bind a non-existent and unnamed queue (i.e.
- empty queue name) to an exchange.
- </doc>
- <doc type = "scenario">
- A client attempts to bind with an unnamed (empty) queue name to an exchange.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_26" -->
- <rule name = "queue-existence" on-failure = "not-found">
- <doc>
- A client MUST NOT be allowed to bind a non-existent queue (i.e. not previously
- declared) to an exchange.
- </doc>
- <doc type = "scenario">
- A client attempts to bind an undeclared queue name to an exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name" label = "name of the exchange to bind to">
- <!-- Rule test name: was "amq_queue_14" -->
- <rule name = "exchange-existence" on-failure = "not-found">
- <doc>
- A client MUST NOT be allowed to bind a queue to a non-existent exchange.
- </doc>
- <doc type = "scenario">
- A client attempts to bind an named queue to a undeclared exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "message routing key">
- <doc>
- Specifies the routing key for the binding. The routing key is used for routing
- messages depending on the exchange configuration. Not all exchanges use a
- routing key - refer to the specific exchange documentation. If the queue name
- is empty, the server uses the last queue declared on the channel. If the
- routing key is also empty, the server uses this queue name for the routing
- key as well. If the queue name is provided but the routing key is empty, the
- server does the binding with that empty routing key. The meaning of empty
- routing keys depends on the exchange implementation.
- </doc>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
-
- <field name = "arguments" domain = "table" label = "arguments for binding">
- <doc>
- A set of arguments for the binding. The syntax and semantics of these arguments
- depends on the exchange class.
- </doc>
- </field>
- </method>
-
- <method name = "bind-ok" synchronous = "1" index = "21" label = "confirm bind successful">
- <doc>This method confirms that the bind was successful.</doc>
-
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "purge" synchronous = "1" index = "30" label = "purge a queue">
- <doc>
- This method removes all messages from a queue. It does not cancel consumers. Purged
- messages are deleted without any formal "undo" mechanism.
- </doc>
-
- <!-- Rule test name: was "amq_queue_15" -->
- <rule name = "01">
- <doc>A call to purge MUST result in an empty queue.</doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_41" -->
- <rule name = "02">
- <doc>
- On transacted channels the server MUST not purge messages that have already been
- sent to a client but not yet acknowledged.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <!-- Rule test name: was "amq_queue_42" -->
- <rule name = "03">
- <doc>
- The server MAY implement a purge queue or log that allows system administrators
- to recover accidentally-purged messages. The server SHOULD NOT keep purged
- messages in the same storage spaces as the live messages since the volumes of
- purged messages may get very large.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "purge-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>The access ticket must be for the access realm that holds the queue.</doc>
-
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the queue's access realm. Note that purging a queue is equivalent to reading
- all messages and discarding them.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to purge. If the queue name is empty, refers to
- the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
-
- <!-- TODO Rule split? -->
-
- <!-- Rule test name: was "amq_queue_16" -->
- <rule name = "02">
- <doc>
- The queue MUST exist. Attempting to purge a non-existing queue MUST cause a
- channel exception.
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "purge-ok" synchronous = "1" index = "31" label = "confirms a queue purge">
- <doc>This method confirms the purge of a queue.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "message-count" domain = "long" label = "number of messages purged">
- <doc>Reports the number of messages purged.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "delete" synchronous = "1" index = "40" label = "delete a queue">
- <doc>
- This method deletes a queue. When a queue is deleted any pending messages are sent
- to a dead-letter queue if this is defined in the server configuration, and all
- consumers on the queue are cancelled.
- </doc>
-
- <!-- TODO: Rule split? -->
-
- <!-- Rule test name: was "amq_queue_43" -->
- <rule name = "01">
- <doc>
- The server SHOULD use a dead-letter queue to hold messages that were pending on
- a deleted queue, and MAY provide facilities for a system administrator to move
- these messages back to an active queue.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "delete-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- The client provides a valid access ticket giving "active" access rights to the
- queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to delete. If the queue name is empty, refers to
- the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_21" -->
- <rule name = "02">
- <doc>
- The queue must exist. If the client attempts to delete a non-existing queue
- the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
- </field>
-
- <field name = "if-unused" domain = "bit" label = "delete only if unused">
- <doc>
- If set, the server will only delete the queue if it has no consumers. If the
- queue has consumers the server does does not delete it but raises a channel
- exception instead.
- </doc>
-
- <!-- Rule test name: was "amq_queue_29" and "amq_queue_30" -->
- <rule name = "01">
- <doc>The server MUST respect the if-unused flag when deleting a queue.</doc>
- </rule>
- </field>
-
- <field name = "if-empty" domain = "bit" label = "delete only if empty">
- <doc>
- If set, the server will only delete the queue if it has no messages.
- </doc>
- <rule name = "01">
- <doc>
- If the queue is not empty the server MUST raise a channel exception with
- reply code 406 (precondition failed).
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "delete-ok" synchronous = "1" index = "41" label = "confirm deletion of a queue">
- <doc>This method confirms the deletion of a queue.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "message-count" domain = "long" label = "number of messages purged">
- <doc>Reports the number of messages purged.</doc>
- </field>
- </method>
- </class>
-
- <!-- == BASIC ============================================================ -->
-
- <class name = "basic" handler = "channel" index = "60" label = "work with basic content">
- <doc>
- The Basic class provides methods that support an industry-standard messaging model.
- </doc>
-
- <doc type = "grammar">
- basic = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN content
- / S:DELIVER content
- / C:GET ( S:GET-OK content / S:GET-EMPTY )
- / C:ACK
- / C:REJECT
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MAY" />
-
- <!-- Rule test name: was "amq_basic_08" -->
- <rule name = "01">
- <doc>
- The server SHOULD respect the persistent property of basic messages and
- SHOULD make a best-effort to hold persistent basic messages on a reliable
- storage mechanism.
- </doc>
- <doc type = "scenario">
- Send a persistent message to queue, stop server, restart server and then
- verify whether message is still present. Assumes that queues are durable.
- Persistence without durable queues makes no sense.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_09" -->
- <rule name = "02">
- <doc>
- The server MUST NOT discard a persistent basic message in case of a queue
- overflow.
- </doc>
- <doc type = "scenario">
- Create a queue overflow situation with persistent messages and verify that
- messages do not get lost (presumably the server will write them to disk).
- </doc>
- </rule>
-
- <rule name = "03">
- <doc>
- The server MAY use the Channel.Flow method to slow or stop a basic message
- publisher when necessary.
- </doc>
- <doc type = "scenario">
- Create a queue overflow situation with non-persistent messages and verify
- whether the server responds with Channel.Flow or not. Repeat with persistent
- messages.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_10" -->
- <rule name = "04">
- <doc>
- The server MAY overflow non-persistent basic messages to persistent
- storage.
- </doc>
- <!-- Test scenario: untestable -->
- </rule>
-
- <rule name = "05">
- <doc>
- The server MAY discard or dead-letter non-persistent basic messages on a
- priority basis if the queue size exceeds some configured limit.
- </doc>
- <!-- Test scenario: untestable -->
- </rule>
-
- <!-- Rule test name: was "amq_basic_11" -->
- <rule name = "06">
- <doc>
- The server MUST implement at least 2 priority levels for basic messages,
- where priorities 0-4 and 5-9 are treated as two distinct levels.
- </doc>
- <doc type = "scenario">
- Send a number of priority 0 messages to a queue. Send one priority 9
- message. Consume messages from the queue and verify that the first message
- received was priority 9.
- </doc>
- </rule>
-
- <rule name = "07">
- <doc>
- The server MAY implement up to 10 priority levels.
- </doc>
- <doc type = "scenario">
- Send a number of messages with mixed priorities to a queue, so that all
- priority values from 0 to 9 are exercised. A good scenario would be ten
- messages in low-to-high priority. Consume from queue and verify how many
- priority levels emerge.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_12" -->
- <rule name = "08">
- <doc>
- The server MUST deliver messages of the same priority in order irrespective of
- their individual persistence.
- </doc>
- <doc type = "scenario">
- Send a set of messages with the same priority but different persistence
- settings to a queue. Consume and verify that messages arrive in same order
- as originally published.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_13" -->
- <rule name = "09">
- <doc>
- The server MUST support automatic acknowledgements on Basic content, i.e.
- consumers with the no-ack field set to FALSE.
- </doc>
- <doc type = "scenario">
- Create a queue and a consumer using automatic acknowledgements. Publish
- a set of messages to the queue. Consume the messages and verify that all
- messages are received.
- </doc>
- </rule>
-
- <rule name = "10">
- <doc>
- The server MUST support explicit acknowledgements on Basic content, i.e.
- consumers with the no-ack field set to TRUE.
- </doc>
- <doc type = "scenario">
- Create a queue and a consumer using explicit acknowledgements. Publish a
- set of messages to the queue. Consume the messages but acknowledge only
- half of them. Disconnect and reconnect, and consume from the queue.
- Verify that the remaining messages are received.
- </doc>
- </rule>
-
- <!-- These are the properties for a Basic content -->
-
- <field name = "content-type" domain = "shortstr" label = "MIME content type" />
- <field name = "content-encoding" domain = "shortstr" label = "MIME content encoding" />
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "delivery-mode" domain = "octet" label = "non-persistent (1) or persistent (2)" />
- <field name = "priority" domain = "octet" label = "message priority, 0 to 9" />
- <field name = "correlation-id" domain = "shortstr" label = "application correlation identifier" />
- <field name = "reply-to" domain = "shortstr" label = "destination to reply to" />
- <field name = "expiration" domain = "shortstr" label = "message expiration specification" />
- <field name = "message-id" domain = "shortstr" label = "application message identifier" />
- <field name = "timestamp" domain = "timestamp" label = "message timestamp" />
- <field name = "type" domain = "shortstr" label = "message type name" />
- <field name = "user-id" domain = "shortstr" label = "creating user id" />
- <field name = "app-id" domain = "shortstr" label = "creating application id" />
- <!-- This field is deprecated pending review -->
- <field name = "cluster-id" domain = "shortstr" label = "intra-cluster routing identifier" />
-
- <field name = "property-one" domain = "shortstr" label = "Extra property for testing only" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "qos" synchronous = "1" index = "10" label = "specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the
- current channel or for all channels on the connection. The particular properties and
- semantics of a qos method always depend on the content class semantics. Though the
- qos method could in principle apply to both peers, it is currently meaningful only
- for the server.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch-size" domain = "long" label = "prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client
- finishes processing a message, the following message is already held locally,
- rather than needing to be sent down the channel. Prefetching gives a performance
- improvement. This field specifies the prefetch window size in octets. The server
- will send a message in advance if it is equal to or smaller in size than the
- available prefetch size (and also falls into other prefetch limits). May be set
- to zero, meaning "no specific limit", although other prefetch limits may still
- apply. The prefetch-size is ignored if the no-ack option is set.
- </doc>
- <!-- Rule test name: was "amq_basic_17" -->
- <rule name = "01">
- <doc>
- The server MUST ignore this setting when the client is not processing any
- messages - i.e. the prefetch size does not limit the transfer of single
- messages to a client, only the sending in advance of more messages while
- the client still has one or more unacknowledged messages.
- </doc>
- <doc type = "scenario">
- Define a QoS prefetch-size limit and send a single message that exceeds
- that limit. Verify that the message arrives correctly.
- </doc>
- </rule>
- </field>
-
- <field name = "prefetch-count" domain = "short" label = "prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This field may be used
- in combination with the prefetch-size field; a message will only be sent in
- advance if both prefetch windows (and those at the channel and connection level)
- allow it. The prefetch-count is ignored if the no-ack option is set.
- </doc>
- <!-- Rule test name: was "amq_basic_18" -->
- <rule name = "01">
- <doc>
- The server may send less data in advance than allowed by the client's
- specified prefetch windows but it MUST NOT send more.
- </doc>
- <doc type = "scenario">
- Define a QoS prefetch-size limit and a prefetch-count limit greater than
- one. Send multiple messages that exceed the prefetch size. Verify that
- no more than one message arrives at once.
- </doc>
- </rule>
- </field>
-
- <field name = "global" domain = "bit" label = "apply to entire connection">
- <doc>
- By default the QoS settings apply to the current channel only. If this field is
- set, they are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <method name = "qos-ok" synchronous = "1" index = "11" label = "confirm the requested qos">
- <doc>
- This method tells the client that the requested QoS levels could be handled by the
- server. The requested QoS applies to all active consumers until a new QoS is
- defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "consume" synchronous = "1" index = "30" label = "start a queue consumer">
- <doc>
- This method asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the channel they were
- created on, or until the client cancels them.
- </doc>
-
- <!-- Rule test name: was "amq_basic_01" -->
- <rule name = "01">
- <doc>
- The server SHOULD support at least 16 consumers per queue, and ideally, impose
- no limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- Create a queue and create consumers on that queue until the server closes the
- connection. Verify that the number of consumers created was at least sixteen
- and report the total number.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer with an invalid (non-zero) access ticket.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
- <rule name = "01" on-failure = "not-allowed">
- <doc>
- If the queue name is empty the client MUST have previously declared a
- queue using this channel.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer with an empty queue name and no previously
- declared queue on the channel.
- </doc>
- </rule>
- </field>
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a
- connection, so two clients can use the same consumer tags. If this field is
- empty the server will generate a unique tag.
- </doc>
- <rule name = "01" on-failure = "not-allowed">
- <doc>
- The client MUST NOT specify a tag that refers to an existing consumer.
- </doc>
- <doc type = "scenario">
- Attempt to create two consumers with the same non-empty tag.
- </doc>
- </rule>
- <rule name = "02" on-failure = "not-allowed">
- <doc>
- The consumer tag is valid only within the channel from which the
- consumer was created. I.e. a client MUST NOT create a consumer in one
- channel and then use it in another.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer in one channel, then use in another channel,
- in which consumers have also been created (to test that the server uses
- unique consumer tags).
- </doc>
- </rule>
- </field>
-
- <field name = "no-local" domain = "no-local" />
-
- <field name = "no-ack" domain = "no-ack" />
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the
- queue.
- </doc>
- <!-- Rule test name: was "amq_basic_02" -->
- <rule name = "01" on-failure = "access-refused">
- <doc>
- The client MAY NOT gain exclusive access to a queue that already has
- active consumers.
- </doc>
- <doc type = "scenario">
- Open two connections to a server, and in one connection create a shared
- (non-exclusive) queue and then consume from the queue. In the second
- connection attempt to consume from the same queue using the exclusive
- option.
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise
- a channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "consume-ok" synchronous = "1" index = "31" label = "confirm a new consumer">
- <doc>
- The server provides the client with a consumer tag, which is used by the client
- for methods called on the consumer at a later stage.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Holds the consumer tag specified by the client or provided by the server.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "cancel" synchronous = "1" index = "20" label = "end a queue consumer">
- <doc>
- This method cancels a consumer. This does not affect already delivered
- messages, but it does mean the server will not send any more messages for
- that consumer. The client may receive an abitrary number of messages in
- between sending the cancel method and receiving the cancel-ok reply.
- </doc>
-
- <rule name = "01">
- <doc>
- If the queue does not exist the server MUST ignore the cancel method, so
- long as the consumer tag is valid for that channel.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "cancel-ok" synchronous = "1" index = "21" label = "confirm a cancelled consumer">
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "publish" content = "1" index = "40" label = "publish a message">
- <doc>
- This method publishes a message to a specific exchange. The message will be routed
- to queues as defined by the exchange configuration and distributed to any active
- consumers when the transaction, if any, is committed.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "write" access rights
- to the access realm for the exchange.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be
- empty, meaning the default exchange. If the exchange name is specified, and that
- exchange does not exist, the server will raise a channel exception.
- </doc>
-
- <!-- Rule test name: was "amq_basic_06" -->
- <rule name = "01">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_14" -->
- <rule name = "02">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST raise
- a channel exception with a reply code 403 (access refused).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_15" -->
- <rule name = "03">
- <doc>
- The exchange MAY refuse basic content in which case it MUST raise a channel
- exception with reply code 540 (not implemented).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing
- messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" domain = "bit" label = "indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue. If this flag is set, the server will return an unroutable message with a
- Return method. If this flag is zero, the server silently drops the message.
- </doc>
- <!-- Rule test name: was "amq_basic_07" -->
- <rule name = "01">
- <doc>
- The server SHOULD implement the mandatory flag.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "immediate" domain = "bit" label = "request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue consumer immediately. If this flag is set, the server will return an
- undeliverable message with a Return method. If this flag is zero, the server
- will queue the message, but with no guarantee that it will ever be consumed.
- </doc>
- <!-- Rule test name: was "amq_basic_16" -->
- <rule name = "01">
- <doc>
- The server SHOULD implement the immediate flag.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "return" content = "1" index = "50" label = "return a failed message">
- <doc>
- This method returns an undeliverable message that was published with the "immediate"
- flag set, or an unroutable message published with the "mandatory" flag set. The
- reply code and text provide information about the reason that the message was
- undeliverable.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply-code" domain = "reply-code" />
-
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "deliver" content = "1" index = "60"
- label = "notify the client of a consumer message">
- <doc>
- This method delivers a message to the client, via a consumer. In the asynchronous
- message delivery model, the client starts a consumer using the Consume method, then
- the server responds with Deliver methods as and when messages arrive for that
- consumer.
- </doc>
-
- <!-- Rule test name: was "amq_basic_19" -->
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server SHOULD track the number of times a message has been delivered to
- clients and when a message is redelivered a certain number of times - e.g. 5
- times - without being acknowledged, the server SHOULD consider the message to be
- unprocessable (possibly causing client applications to abort), and move the
- message to a dead letter queue.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "get" synchronous = "1" index = "70" label = "direct access to a queue">
- <doc>
- This method provides a direct access to the messages in a queue using a synchronous
- dialogue that is designed for specific types of application where synchronous
- functionality is more important than performance.
- </doc>
-
- <response name = "get-ok" />
- <response name = "get-empty" />
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "no-ack" domain = "no-ack" />
- </method>
-
- <method name = "get-ok" synchronous = "1" content = "1" index = "71"
- label = "provide client with a message">
- <doc>
- This method delivers a message to the client following a get method. A message
- delivered by 'get-ok' must be acknowledged unless the no-ack option was set in the
- get method.
- </doc>
-
- <chassis name = "client" implement = "MAY" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- If empty, the message was published to the default exchange.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
-
- <field name = "message-count" domain = "long" label = "number of messages pending">
- <doc>
- This field reports the number of messages pending on the queue, excluding the
- message being delivered. Note that this figure is indicative, not reliable, and
- can change arbitrarily as messages are added to the queue and removed by other
- clients.
- </doc>
- </field>
- </method>
-
- <method name = "get-empty" synchronous = "1" index = "72"
- label = "indicate no messages available">
- <doc>
- This method tells the client that the queue has no messages available for the
- client.
- </doc>
-
- <chassis name = "client" implement = "MAY" />
-
- <!-- This field is deprecated pending review -->
- <field name = "cluster-id" domain = "shortstr" label = "Cluster id">
- <doc>
- For use by cluster applications, should not be used by client applications.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "ack" index = "80" label = "acknowledge one or more messages">
- <doc>
- This method acknowledges one or more messages delivered via the Deliver or Get-Ok
- methods. The client can ask to confirm a single message or a set of messages up to
- and including a specific message.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "multiple" domain = "bit" label = "acknowledge multiple messages">
- <doc>
- If set to 1, the delivery tag is treated as "up to and including", so that the
- client can acknowledge multiple messages with a single method. If set to zero,
- the delivery tag refers to a single message. If the multiple field is 1, and the
- delivery tag is zero, tells the server to acknowledge all outstanding mesages.
- </doc>
-
- <!-- Rule test name: was "amq_basic_20" -->
- <rule name = "01">
- <doc>
- The server MUST validate that a non-zero delivery-tag refers to an delivered
- message, and raise a channel exception if this is not the case.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "reject" index = "90" label = "reject an incoming message">
- <doc>
- This method allows a client to reject a message. It can be used to interrupt and
- cancel large incoming messages, or return untreatable messages to their original
- queue.
- </doc>
-
- <!-- Rule test name: was "amq_basic_21" -->
- <rule name = "01">
- <doc>
- The server SHOULD be capable of accepting and process the Reject method while
- sending message content with a Deliver or Get-Ok method. I.e. the server should
- read and process incoming methods while sending output frames. To cancel a
- partially-send content, the server sends a content body frame of size 1 (i.e.
- with no data except the frame-end octet).
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_22" -->
- <rule name = "02">
- <doc>
- The server SHOULD interpret this method as meaning that the client is unable to
- process the message at this time.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <rule name = "03">
- <!-- TODO: Rule split? -->
- <doc>
- A client MUST NOT use this method as a means of selecting messages to process. A
- rejected message MAY be discarded or dead-lettered, not necessarily passed to
- another client.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "requeue" domain = "bit" label = "requeue the message">
- <doc>
- If this field is zero, the message will be discarded. If this bit is 1, the
- server will attempt to requeue the message.
- </doc>
-
- <!-- Rule test name: was "amq_basic_23" -->
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MUST NOT deliver the message to the same client within the
- context of the current channel. The recommended strategy is to attempt to
- deliver the message to an alternative consumer, and if that is not possible,
- to move the message to a dead-letter queue. The server MAY use more
- sophisticated tracking to hold the message on the queue and redeliver it to
- the same client at a later stage.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "recover" index = "100" label = "redeliver unacknowledged messages">
- <doc>
- This method asks the broker to redeliver all unacknowledged messages on a specified
- channel. Zero or more messages may be redelivered. This method is only allowed on
- non-transacted channels.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST set the redelivered flag on all messages that are resent.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- The server MUST raise a channel exception if this is called on a transacted
- channel.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "requeue" domain = "bit" label = "requeue the message">
- <doc>
- If this field is zero, the message will be redelivered to the original
- recipient. If this bit is 1, the server will attempt to requeue the message,
- potentially then delivering it to an alternative subscriber.
- </doc>
- </field>
- </method>
- </class>
-
- <!-- == FILE ============================================================= -->
-
- <class name = "file" handler = "channel" index = "70" label = "work with file content">
- <doc>
- The file class provides methods that support reliable file transfer. File
- messages have a specific set of properties that are required for interoperability
- with file transfer applications. File messages and acknowledgements are subject to
- channel transactions. Note that the file class does not provide message browsing
- methods; these are not compatible with the staging model. Applications that need
- browsable file transfer should use Basic content and the Basic class.
- </doc>
-
- <doc type = "grammar">
- file = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:OPEN S:OPEN-OK C:STAGE content
- / S:OPEN C:OPEN-OK S:STAGE content
- / C:PUBLISH
- / S:DELIVER
- / S:RETURN
- / C:ACK
- / C:REJECT
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <rule name = "01">
- <doc>
- The server MUST make a best-effort to hold file messages on a reliable storage
- mechanism.
- </doc>
- </rule>
-
- <!-- TODO Rule implement attr inverse? -->
-
- <!-- TODO: Rule split? -->
-
- <rule name = "02">
- <doc>
- The server MUST NOT discard a file message in case of a queue overflow. The server
- MUST use the Channel.Flow method to slow or stop a file message publisher when
- necessary.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "03">
- <doc>
- The server MUST implement at least 2 priority levels for file messages, where
- priorities 0-4 and 5-9 are treated as two distinct levels. The server MAY implement
- up to 10 priority levels.
- </doc>
- </rule>
-
- <rule name = "04">
- <doc>
- The server MUST support both automatic and explicit acknowledgements on file
- content.
- </doc>
- </rule>
-
- <!-- These are the properties for a File content -->
-
- <field name = "content-type" domain = "shortstr" label = "MIME content type" />
- <field name = "content-encoding" domain = "shortstr" label = "MIME content encoding" />
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "priority" domain = "octet" label = "message priority, 0 to 9" />
- <field name = "reply-to" domain = "shortstr" label = "destination to reply to" />
- <field name = "message-id" domain = "shortstr" label = "application message identifier" />
- <field name = "filename" domain = "shortstr" label = "message filename" />
- <field name = "timestamp" domain = "timestamp" label = "message timestamp" />
- <!-- This field is deprecated pending review -->
- <field name = "cluster-id" domain = "shortstr" label = "intra-cluster routing identifier" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "qos" synchronous = "1" index = "10" label = "specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the
- current channel or for all channels on the connection. The particular properties and
- semantics of a qos method always depend on the content class semantics. Though the
- qos method could in principle apply to both peers, it is currently meaningful only
- for the server.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "qos-ok" />
-
- <field name = "prefetch-size" domain = "long" label = "prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client
- finishes processing a message, the following message is already held locally,
- rather than needing to be sent down the channel. Prefetching gives a performance
- improvement. This field specifies the prefetch window size in octets. May be set
- to zero, meaning "no specific limit". Note that other prefetch limits may still
- apply. The prefetch-size is ignored if the no-ack option is set.
- </doc>
- </field>
-
- <field name = "prefetch-count" domain = "short" label = "prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This is compatible with
- some file API implementations. This field may be used in combination with the
- prefetch-size field; a message will only be sent in advance if both prefetch
- windows (and those at the channel and connection level) allow it. The
- prefetch-count is ignored if the no-ack option is set.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MAY send less data in advance than allowed by the client's
- specified prefetch windows but it MUST NOT send more.
- </doc>
- </rule>
- </field>
-
- <field name = "global" domain = "bit" label = "apply to entire connection">
- <doc>
- By default the QoS settings apply to the current channel only. If this field is
- set, they are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <method name = "qos-ok" synchronous = "1" index = "11" label = "confirm the requested qos">
- <doc>
- This method tells the client that the requested QoS levels could be handled by the
- server. The requested QoS applies to all active consumers until a new QoS is
- defined.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "consume" synchronous = "1" index = "20" label = "start a queue consumer">
- <doc>
- This method asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the channel they were
- created on, or until the client cancels them.
- </doc>
-
- <rule name = "01">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was
- declared as private, and ideally, impose no limit except as defined by available
- resources.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a
- connection, so two clients can use the same consumer tags. If this field is
- empty the server will generate a unique tag.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to
- create two consumers with the same non-empty tag the server MUST raise a
- connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "no-local" domain = "no-local" />
-
- <field name = "no-ack" domain = "no-ack" />
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the
- queue.
- </doc>
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, -
- because there are other consumers active - it MUST raise a channel exception
- with return code 405 (resource locked).
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "consume-ok" synchronous = "1" index = "21" label = "confirm a new consumer">
- <doc>
- This method provides the client with a consumer tag which it MUST use in methods
- that work with the consumer.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>Holds the consumer tag specified by the client or provided by the server.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "cancel" synchronous = "1" index = "30" label = "end a queue consumer">
- <doc>
- This method cancels a consumer. This does not affect already delivered messages, but
- it does mean the server will not send any more messages for that consumer.
- </doc>
-
- <response name = "cancel-ok" />
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "cancel-ok" synchronous = "1" index = "31" label = "confirm a cancelled consumer">
- <doc>This method confirms that the cancellation was completed.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "open" synchronous = "1" index = "40" label = "request to start staging">
- <doc>
- This method requests permission to start staging a message. Staging means sending
- the message into a temporary area at the recipient end and then delivering the
- message by referring to this temporary area. Staging is how the protocol handles
- partial file transfers - if a message is partially staged and the connection breaks,
- the next time the sender starts to stage it, it can restart from where it left off.
- </doc>
-
- <response name = "open-ok" />
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "identifier" domain = "shortstr" label = "staging identifier">
- <doc>
- This is the staging identifier. This is an arbitrary string chosen by the
- sender. For staging to work correctly the sender must use the same staging
- identifier when staging the same message a second time after recovery from a
- failure. A good choice for the staging identifier would be the SHA1 hash of the
- message properties data (including the original filename, revised time, etc.).
- </doc>
- </field>
-
- <field name = "content-size" domain = "longlong" label = "message content size">
- <doc>
- The size of the content in octets. The recipient may use this information to
- allocate or check available space in advance, to avoid "disk full" errors during
- staging of very large messages.
- </doc>
-
- <rule name = "01">
- <doc>
- The sender MUST accurately fill the content-size field. Zero-length content
- is permitted.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "open-ok" synchronous = "1" index = "41" label = "confirm staging ready">
- <doc>
- This method confirms that the recipient is ready to accept staged data. If the
- message was already partially-staged at a previous time the recipient will report
- the number of octets already staged.
- </doc>
-
- <response name = "stage" />
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "staged-size" domain = "longlong" label = "already staged amount">
- <doc>
- The amount of previously-staged content in octets. For a new message this will
- be zero.
- </doc>
-
- <rule name = "01">
- <doc>
- The sender MUST start sending data from this octet offset in the message,
- counting from zero.
- </doc>
- </rule>
-
- <rule name = "02">
- <!-- TODO: Rule split? -->
- <doc>
- The recipient MAY decide how long to hold partially-staged content and MAY
- implement staging by always discarding partially-staged content. However if
- it uses the file content type it MUST support the staging methods.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "stage" content = "1" index = "50" label = "stage message content">
- <doc>
- This method stages the message, sending the message content to the recipient from
- the octet offset specified in the Open-Ok method.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "publish" index = "60" label = "publish a message">
- <doc>
- This method publishes a staged file message to a specific exchange. The file message
- will be routed to queues as defined by the exchange configuration and distributed to
- any active consumers when the transaction, if any, is committed.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "write" access rights
- to the access realm for the exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be
- empty, meaning the default exchange. If the exchange name is specified, and that
- exchange does not exist, the server will raise a channel exception.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST
- respond with a reply code 403 (access refused) and raise a channel
- exception.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "03">
- <doc>
- The exchange MAY refuse file content in which case it MUST respond with a
- reply code 540 (not implemented) and raise a channel exception.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing
- messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" domain = "bit" label = "indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue. If this flag is set, the server will return an unroutable message with a
- Return method. If this flag is zero, the server silently drops the message.
- </doc>
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the mandatory flag.</doc>
- </rule>
- </field>
-
- <field name = "immediate" domain = "bit" label = "request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue consumer immediately. If this flag is set, the server will return an
- undeliverable message with a Return method. If this flag is zero, the server
- will queue the message, but with no guarantee that it will ever be consumed.
- </doc>
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the immediate flag.</doc>
- </rule>
- </field>
-
- <field name = "identifier" domain = "shortstr" label = "staging identifier">
- <doc>
- This is the staging identifier of the message to publish. The message must have
- been staged. Note that a client can send the Publish method asynchronously
- without waiting for staging to finish.
- </doc>
- </field>
- </method>
-
- <method name = "return" content = "1" index = "70" label = "return a failed message">
- <doc>
- This method returns an undeliverable message that was published with the "immediate"
- flag set, or an unroutable message published with the "mandatory" flag set. The
- reply code and text provide information about the reason that the message was
- undeliverable.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply-code" domain = "reply-code" />
-
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "deliver" index = "80" label = "notify the client of a consumer message">
- <doc>
- This method delivers a staged file message to the client, via a consumer. In the
- asynchronous message delivery model, the client starts a consumer using the Consume
- method, then the server responds with Deliver methods as and when messages arrive
- for that consumer.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server SHOULD track the number of times a message has been delivered to
- clients and when a message is redelivered a certain number of times - e.g. 5
- times - without being acknowledged, the server SHOULD consider the message to be
- unprocessable (possibly causing client applications to abort), and move the
- message to a dead letter queue.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
-
- <field name = "identifier" domain = "shortstr" label = "staging identifier">
- <doc>
- This is the staging identifier of the message to deliver. The message must have
- been staged. Note that a server can send the Deliver method asynchronously
- without waiting for staging to finish.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "ack" index = "90" label = "acknowledge one or more messages">
- <doc>
- This method acknowledges one or more messages delivered via the Deliver method. The
- client can ask to confirm a single message or a set of messages up to and including
- a specific message.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "multiple" domain = "bit" label = "acknowledge multiple messages">
- <doc>
- If set to 1, the delivery tag is treated as "up to and including", so that the
- client can acknowledge multiple messages with a single method. If set to zero,
- the delivery tag refers to a single message. If the multiple field is 1, and the
- delivery tag is zero, tells the server to acknowledge all outstanding mesages.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST validate that a non-zero delivery-tag refers to an delivered
- message, and raise a channel exception if this is not the case.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "reject" index = "100" label = "reject an incoming message">
- <doc>
- This method allows a client to reject a message. It can be used to return
- untreatable messages to their original queue. Note that file content is staged
- before delivery, so the client will not use this method to interrupt delivery of a
- large message.
- </doc>
-
- <rule name = "01">
- <doc>
- The server SHOULD interpret this method as meaning that the client is unable to
- process the message at this time.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "02">
- <doc>
- A client MUST NOT use this method as a means of selecting messages to process. A
- rejected message MAY be discarded or dead-lettered, not necessarily passed to
- another client.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "requeue" domain = "bit" label = "requeue the message">
- <doc>
- If this field is zero, the message will be discarded. If this bit is 1, the
- server will attempt to requeue the message.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MUST NOT deliver the message to the same client within the
- context of the current channel. The recommended strategy is to attempt to
- deliver the message to an alternative consumer, and if that is not possible,
- to move the message to a dead-letter queue. The server MAY use more
- sophisticated tracking to hold the message on the queue and redeliver it to
- the same client at a later stage.
- </doc>
- </rule>
- </field>
- </method>
- </class>
-
- <!-- == STREAM =========================================================== -->
-
- <class name = "stream" handler = "channel" index = "80" label = "work with streaming content">
- <doc>
- The stream class provides methods that support multimedia streaming. The stream class
- uses the following semantics: one message is one packet of data; delivery is
- unacknowleged and unreliable; the consumer can specify quality of service parameters
- that the server can try to adhere to; lower-priority messages may be discarded in favour
- of high priority messages.
- </doc>
-
- <doc type = "grammar">
- stream = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN
- / S:DELIVER content
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <rule name = "01">
- <doc>
- The server SHOULD discard stream messages on a priority basis if the queue size
- exceeds some configured limit.
- </doc>
- </rule>
-
- <rule name = "02">
- <!-- TODO: Rule split? -->
- <doc>
- The server MUST implement at least 2 priority levels for stream messages, where
- priorities 0-4 and 5-9 are treated as two distinct levels. The server MAY implement
- up to 10 priority levels.
- </doc>
- </rule>
-
- <rule name = "03">
- <doc>
- The server MUST implement automatic acknowledgements on stream content. That is, as
- soon as a message is delivered to a client via a Deliver method, the server must
- remove it from the queue.
- </doc>
- </rule>
-
- <!-- These are the properties for a Stream content -->
-
- <field name = "content-type" domain = "shortstr" label = "MIME content type" />
- <field name = "content-encoding" domain = "shortstr" label = "MIME content encoding" />
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "priority" domain = "octet" label = "message priority, 0 to 9" />
- <field name = "timestamp" domain = "timestamp" label = "message timestamp" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "qos" synchronous = "1" index = "10" label = "specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the
- current channel or for all channels on the connection. The particular properties and
- semantics of a qos method always depend on the content class semantics. Though the
- qos method could in principle apply to both peers, it is currently meaningful only
- for the server.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "qos-ok" />
-
- <field name = "prefetch-size" domain = "long" label = "prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client
- finishes processing a message, the following message is already held locally,
- rather than needing to be sent down the channel. Prefetching gives a performance
- improvement. This field specifies the prefetch window size in octets. May be set
- to zero, meaning "no specific limit". Note that other prefetch limits may still
- apply.
- </doc>
- </field>
-
- <field name = "prefetch-count" domain = "short" label = "prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This field may be used
- in combination with the prefetch-size field; a message will only be sent in
- advance if both prefetch windows (and those at the channel and connection level)
- allow it.
- </doc>
- </field>
-
- <field name = "consume-rate" domain = "long" label = "transfer rate in octets/second">
- <doc>
- Specifies a desired transfer rate in octets per second. This is usually
- determined by the application that uses the streaming data. A value of zero
- means "no limit", i.e. as rapidly as possible.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MAY ignore the prefetch values and consume rates, depending on
- the type of stream and the ability of the server to queue and/or reply it.
- The server MAY drop low-priority messages in favour of high-priority
- messages.
- </doc>
- </rule>
- </field>
-
- <field name = "global" domain = "bit" label = "apply to entire connection">
- <doc>
- By default the QoS settings apply to the current channel only. If this field is
- set, they are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <method name = "qos-ok" synchronous = "1" index = "11" label = "confirm the requested qos">
- <doc>
- This method tells the client that the requested QoS levels could be handled by the
- server. The requested QoS applies to all active consumers until a new QoS is
- defined.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "consume" synchronous = "1" index = "20" label = "start a queue consumer">
- <doc>
- This method asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the channel they were
- created on, or until the client cancels them.
- </doc>
-
- <rule name = "01">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was
- declared as private, and ideally, impose no limit except as defined by available
- resources.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- Streaming applications SHOULD use different channels to select different
- streaming resolutions. AMQP makes no provision for filtering and/or transforming
- streams except on the basis of priority-based selective delivery of individual
- messages.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a
- connection, so two clients can use the same consumer tags. If this field is
- empty the server will generate a unique tag.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to
- create two consumers with the same non-empty tag the server MUST raise a
- connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "no-local" domain = "no-local" />
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the
- queue.
- </doc>
-
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, -
- because there are other consumers active - it MUST raise a channel exception
- with return code 405 (resource locked).
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "consume-ok" synchronous = "1" index = "21" label = "confirm a new consumer">
- <doc>
- This method provides the client with a consumer tag which it may use in methods that
- work with the consumer.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>Holds the consumer tag specified by the client or provided by the server.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "cancel" synchronous = "1" index = "30" label = "end a queue consumer">
- <doc>
- This method cancels a consumer. Since message delivery is asynchronous the client
- may continue to receive messages for a short while after canceling a consumer. It
- may process or discard these as appropriate.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "cancel-ok" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "cancel-ok" synchronous = "1" index = "31" label = "confirm a cancelled consumer">
- <doc>This method confirms that the cancellation was completed.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "publish" content = "1" index = "40" label = "publish a message">
- <doc>
- This method publishes a message to a specific exchange. The message will be routed
- to queues as defined by the exchange configuration and distributed to any active
- consumers as appropriate.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "write" access rights
- to the access realm for the exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be
- empty, meaning the default exchange. If the exchange name is specified, and that
- exchange does not exist, the server will raise a channel exception.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST
- respond with a reply code 403 (access refused) and raise a channel
- exception.
- </doc>
- </rule>
-
- <rule name = "03">
- <doc>
- The exchange MAY refuse stream content in which case it MUST respond with a
- reply code 540 (not implemented) and raise a channel exception.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing
- messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" domain = "bit" label = "indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue. If this flag is set, the server will return an unroutable message with a
- Return method. If this flag is zero, the server silently drops the message.
- </doc>
-
- <!-- Rule test name: was "amq_stream_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the mandatory flag.</doc>
- </rule>
- </field>
-
- <field name = "immediate" domain = "bit" label = "request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue consumer immediately. If this flag is set, the server will return an
- undeliverable message with a Return method. If this flag is zero, the server
- will queue the message, but with no guarantee that it will ever be consumed.
- </doc>
-
- <!-- Rule test name: was "amq_stream_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the immediate flag.</doc>
- </rule>
- </field>
- </method>
-
- <method name = "return" content = "1" index = "50" label = "return a failed message">
- <doc>
- This method returns an undeliverable message that was published with the "immediate"
- flag set, or an unroutable message published with the "mandatory" flag set. The
- reply code and text provide information about the reason that the message was
- undeliverable.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply-code" domain = "reply-code" />
-
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "deliver" content = "1" index = "60"
- label = "notify the client of a consumer message">
- <doc>
- This method delivers a message to the client, via a consumer. In the asynchronous
- message delivery model, the client starts a consumer using the Consume method, then
- the server responds with Deliver methods as and when messages arrive for that
- consumer.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue that the message came from. Note that a single
- channel can start many consumers on different queues.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
- </class>
-
- <!-- == TX =============================================================== -->
-
- <class name = "tx" handler = "channel" index = "90" label = "work with standard transactions">
- <doc>
- Standard transactions provide so-called "1.5 phase commit". We can ensure that work is
- never lost, but there is a chance of confirmations being lost, so that messages may be
- resent. Applications that use standard transactions must be able to detect and ignore
- duplicate messages.
- </doc>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "01">
- <doc>
- An client using standard transactions SHOULD be able to track all messages received
- within a reasonable period, and thus detect and reject duplicates of the same
- message. It SHOULD NOT pass these to the application layer.
- </doc>
- </rule>
-
- <doc type = "grammar">
- tx = C:SELECT S:SELECT-OK
- / C:COMMIT S:COMMIT-OK
- / C:ROLLBACK S:ROLLBACK-OK
- </doc>
-
- <chassis name = "server" implement = "SHOULD" />
- <chassis name = "client" implement = "MAY" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "select" synchronous = "1" index = "10" label = "select standard transaction mode">
- <doc>
- This method sets the channel to use standard transactions. The client must use this
- method at least once on a channel before using the Commit or Rollback methods.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "select-ok" />
- </method>
-
- <method name = "select-ok" synchronous = "1" index = "11" label = "confirm transaction mode">
- <doc>
- This method confirms to the client that the channel was successfully set to use
- standard transactions.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "commit" synchronous = "1" index = "20" label = "commit the current transaction">
- <doc>
- This method commits all messages published and acknowledged in the current
- transaction. A new transaction starts immediately after a commit.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "commit-ok" />
- </method>
-
- <method name = "commit-ok" synchronous = "1" index = "21" label = "confirm a successful commit">
- <doc>
- This method confirms to the client that the commit succeeded. Note that if a commit
- fails, the server raises a channel exception.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "rollback" synchronous = "1" index = "30"
- label = "abandon the current transaction">
- <doc>
- This method abandons all messages published and acknowledged in the current
- transaction. A new transaction starts immediately after a rollback.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "rollback-ok" />
- </method>
-
- <method name = "rollback-ok" synchronous = "1" index = "31" label = "confirm successful rollback">
- <doc>
- This method confirms to the client that the rollback succeeded. Note that if an
- rollback fails, the server raises a channel exception.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
- </class>
-
- <!-- == DTX ============================================================== -->
-
- <class name = "dtx" handler = "channel" index = "100" label = "work with distributed transactions">
- <doc>
- Distributed transactions provide so-called "2-phase commit". The AMQP distributed
- transaction model supports the X-Open XA architecture and other distributed transaction
- implementations. The Dtx class assumes that the server has a private communications
- channel (not AMQP) to a distributed transaction coordinator.
- </doc>
-
- <doc type = "grammar">
- dtx = C:SELECT S:SELECT-OK
- C:START S:START-OK
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "select" synchronous = "1" index = "10" label = "select standard transaction mode">
- <doc>
- This method sets the channel to use distributed transactions. The client must use
- this method at least once on a channel before using the Start method.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "select-ok" />
- </method>
-
- <method name = "select-ok" synchronous = "1" index = "11" label = "confirm transaction mode">
- <doc>
- This method confirms to the client that the channel was successfully set to use
- distributed transactions.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "start" synchronous = "1" index = "20"
- label = "start a new distributed transaction">
- <doc>
- This method starts a new distributed transaction. This must be the first method on a
- new channel that uses the distributed transaction mode, before any methods that
- publish or consume messages.
- </doc>
- <chassis name = "server" implement = "MAY" />
- <response name = "start-ok" />
- <field name = "dtx-identifier" domain = "shortstr" label = "transaction identifier">
- <doc>
- The distributed transaction key. This identifies the transaction so that the
- AMQP server can coordinate with the distributed transaction coordinator.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <method name = "start-ok" synchronous = "1" index = "21"
- label = "confirm the start of a new distributed transaction">
- <doc>
- This method confirms to the client that the transaction started. Note that if a
- start fails, the server raises a channel exception.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
- </class>
-
- <!-- == TUNNEL =========================================================== -->
-
- <class name = "tunnel" handler = "tunnel" index = "110" label = "methods for protocol tunneling">
- <doc>
- The tunnel methods are used to send blocks of binary data - which can be serialised AMQP
- methods or other protocol frames - between AMQP peers.
- </doc>
-
- <doc type = "grammar">
- tunnel = C:REQUEST
- / S:REQUEST
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "proxy-name" domain = "shortstr" label = "identity of tunnelling proxy" />
- <field name = "data-name" domain = "shortstr" label = "name or type of message being tunnelled" />
- <field name = "durable" domain = "octet" label = "message durability indicator" />
- <field name = "broadcast" domain = "octet" label = "message broadcast mode" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "request" content = "1" index = "10" label = "sends a tunnelled method">
- <doc>
- This method tunnels a block of binary data, which can be an encoded
- AMQP method or other data. The binary data is sent as the content for
- the Tunnel.Request method.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <field name = "meta-data" domain = "table" label = "meta data for the tunnelled block">
- <doc>
- This field table holds arbitrary meta-data that the sender needs to
- pass to the recipient.
- </doc>
- </field>
- </method>
- </class>
-</amqp>
diff --git a/M4-RCs/qpid/gentools/xml-src/cluster-0.9.test.xml b/M4-RCs/qpid/gentools/xml-src/cluster-0.9.test.xml
deleted file mode 100644
index 142e6c9380..0000000000
--- a/M4-RCs/qpid/gentools/xml-src/cluster-0.9.test.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.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 major="0" minor="9" port="5672" comment="AMQ protocol 0.80">
-
-<class name = "cluster" index = "101">
-
-<doc>
- An extension that allows brokers to communicate in order to
- provide a clustered service to clients.
-</doc>
-
-<method name = "join" index="10">
- <field name = "broker" type = "shortstr" />
-</method>
-
-<method name = "membership" index="20">
- <field name = "members" type = "longstr" />
-</method>
-
-<method name = "synch" index="30">
-</method>
-
-<method name = "leave" index="40">
- <field name = "broker" type = "shortstr" />
-</method>
-
-<method name = "suspect" index="50">
- <field name = "broker" type = "shortstr" />
-</method>
-
-<method name = "ping" index="60">
- <field name = "broker" type = "shortstr" />
- <field name = "load" type = "long" />
- <field name = "response required" type = "bit" />
-</method>
-
-</class>
-
-</amqp>
diff --git a/M4-RCs/qpid/java/010ExcludeList b/M4-RCs/qpid/java/010ExcludeList
deleted file mode 100644
index 7512329220..0000000000
--- a/M4-RCs/qpid/java/010ExcludeList
+++ /dev/null
@@ -1,57 +0,0 @@
-org.apache.qpid.test.unit.client.channelclose.ChannelCloseTest#*
-org.apache.qpid.client.ResetMessageListenerTest#*
-// those tests should be run with prefetch off
-org.apache.qpid.client.MessageListenerMultiConsumerTest#testRecieveC2Only
-org.apache.qpid.client.MessageListenerMultiConsumerTest#testRecieveBoth
-org.apache.qpid.test.unit.xa.TopicTest#testMigrateDurableSubscriber
-org.apache.qpid.test.unit.ack.AcknowledgeTest#*
-// those tests need durable subscribe states to be persisted
-org.apache.qpid.test.unit.topic.DurableSubscriptionTest#testDurSubRestoredAfterNonPersistentMessageSent
-// those tests require broker recovery
-org.apache.qpid.test.unit.ct.DurableSubscriberTest#*
-org.apache.qpid.test.unit.xa.TopicTest#testDurSubCrash
-org.apache.qpid.test.unit.xa.TopicTest#testMultiMessagesDurSubCrash
-org.apache.qpid.test.unit.xa.TopicTest#testRecover
-org.apache.qpid.test.unit.xa.QueueTest#testRecover
-org.apache.qpid.test.unit.xa.QueueTest#testSendAndRecover
-//These tests are for the java broker
-org.apache.qpid.server.security.acl.SimpleACLTest#*
-org.apache.qpid.server.plugins.PluginTest#*
-// This test is not finished
-org.apache.qpid.test.testcases.TTLTest#*
-org.apache.qpid.test.client.failover.FailoverTest#test4MinuteFailover
-// Those tests are testing 0.8 specific semantics
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteNoTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxPubSub
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedTxPubSub
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteNoTxPubSub
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteTxPubSub
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteNoTxP2P
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteTxP2P
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteNoTxPubSub
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteTxPubSub
-org.apache.qpid.test.client.FlowControlTest#*
-org.apache.qpid.test.unit.client.connection.ConnectionTest#testDefaultExchanges
-org.apache.qpid.test.unit.client.connection.ConnectionTest#testUnresolvedVirtualHostFailure
-// the 0.10 c++ broker does not implement forget
-org.apache.qpid.test.unit.xa.FaultTest#testForget
-// the 0-10 c++ broker does not implement priority / this test depends on a Java broker extension for queue creation
-org.apache.qpid.server.queue.PriorityTest
-//this test checks explicitly for 0-8 flow control semantics
-org.apache.qpid.test.client.FlowControlTest
-// 0-10 c++ broker doesn't implement virtual hosts, or those wackhy exchanges
-org.apache.qpid.test.unit.client.connection.ConnectionTest#testUnresolvedVirtualHostFailure
-org.apache.qpid.test.unit.client.connection.ConnectionTest#testDefaultExchanges
-// 0-10 c++ broker in cpp.testprofile is started with no auth so won't pass this test
-org.apache.qpid.test.unit.client.connection.ConnectionTest#testPasswordFailureConnection
-// c++ broker doesn't do selectors, so this will fail
-org.apache.qpid.test.unit.topic.TopicSessionTest#testNonMatchingMessagesDoNotFillQueue
-// QPID-1225 : Temporary remove this test until the problem has been addressed
-org.apache.qpid.server.security.acl.SimpleACLTest#testClientPublishInvalidQueueSuccess
-// InVM Broker tests
-org.apache.qpid.test.client.timeouts.SyncWaitDelayTest#*
-// QPID-1262, QPID-1119 : This test fails occasionally due to potential protocol issue.
-org.apache.qpid.test.client.timeouts.SyncWaitTimeoutDelayTest#*
diff --git a/M4-RCs/qpid/java/010ExcludeList-noPrefetch b/M4-RCs/qpid/java/010ExcludeList-noPrefetch
deleted file mode 100644
index dca931b55b..0000000000
--- a/M4-RCs/qpid/java/010ExcludeList-noPrefetch
+++ /dev/null
@@ -1,61 +0,0 @@
-org.apache.qpid.test.unit.client.channelclose.ChannelCloseTest#*
-org.apache.qpid.client.ResetMessageListenerTest#*
-org.apache.qpid.test.unit.transacted.TransactedTest#testRollback
-// those tests need durable subscribe states to be persisted
-org.apache.qpid.test.unit.topic.DurableSubscriptionTest#testDurSubRestoredAfterNonPersistentMessageSent
-org.apache.qpid.test.unit.ct.DurableSubscriberTest#testDurSubRestoresMessageSelector
-// This test cannot be run with no-prefetch
-org.apache.qpid.test.unit.xa.TopicTest#testMultiMessagesDurSubCrash
-//These tests are for the java broker
-org.apache.qpid.server.security.acl.SimpleACLTest#*
-org.apache.qpid.server.plugins.PluginTest#*
-// This test is not finished
-org.apache.qpid.test.testcases.TTLTest#*
-// Those tests require failover support
-org.apache.qpid.test.client.QueueBrowserAutoAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserAutoAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserClientAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserClientAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserDupsOkTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserDupsOkTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserNoAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserNoAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserPreAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserPreAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserTransactedTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserTransactedTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.testcases.FailoverTest#*
-org.apache.qpid.test.client.failover.FailoverTest#*
-// Those tests are testing 0.8 specific semantics
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteNoTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxPubSub
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedTxPubSub
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteNoTxPubSub
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteTxPubSub
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteNoTxP2P
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteTxP2P
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteNoTxPubSub
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteTxPubSub
-org.apache.qpid.test.client.FlowControlTest#*
-org.apache.qpid.test.unit.client.connection.ConnectionTest#testDefaultExchanges
-org.apache.qpid.test.unit.client.connection.ConnectionTest#testUnresolvedVirtualHostFailure
-// the 0.10 c++ broker does not implement forget
-org.apache.qpid.test.unit.xa.FaultTest#testForget
-// the 0-10 c++ broker does not implement priority / this test depends on a Java broker extension for queue creation
-org.apache.qpid.server.queue.PriorityTest
-//this test checks explicitly for 0-8 flow control semantics
-org.apache.qpid.test.client.FlowControlTest
-// The default cpp.testprofile does not start the cpp broker with authentication so this test will fail.
-org.apache.qpid.test.unit.client.connection.ConnectionTest#testPasswordFailureConnection
-// c++ broker doesn't do selectors, so this will fail
-org.apache.qpid.test.unit.topic.TopicSessionTest#testNonMatchingMessagesDoNotFillQueue
-// QPID-1225 : Temporary remove this test until the problem has been addressed
-org.apache.qpid.server.security.acl.SimpleACLTest#testClientPublishInvalidQueueSuccess
-
-// InVM Broker tests
-org.apache.qpid.test.client.timeouts.SyncWaitDelayTest#*
-// QPID-1262, QPID-1119 : This test fails occasionally due to potential protocol issue.
-org.apache.qpid.test.client.timeouts.SyncWaitTimeoutDelayTest#*
diff --git a/M4-RCs/qpid/java/010ExcludeList-store b/M4-RCs/qpid/java/010ExcludeList-store
deleted file mode 100644
index d4bc8b7b71..0000000000
--- a/M4-RCs/qpid/java/010ExcludeList-store
+++ /dev/null
@@ -1,64 +0,0 @@
-org.apache.qpid.test.unit.client.channelclose.ChannelCloseTest#*
-org.apache.qpid.client.ResetMessageListenerTest#*
-// those tests should be run with prefetch off
-org.apache.qpid.client.MessageListenerMultiConsumerTest#testRecieveC2Only
-org.apache.qpid.client.MessageListenerMultiConsumerTest#testRecieveBoth
-org.apache.qpid.test.unit.xa.TopicTest#testMultiMessagesDurSubCrash
-org.apache.qpid.test.unit.xa.TopicTest#testMigrateDurableSubscriber
-org.apache.qpid.test.unit.ack.AcknowledgeTest#*
-// those tests need durable subscribe states to be persisted
-org.apache.qpid.test.unit.topic.DurableSubscriptionTest#testDurSubRestoredAfterNonPersistentMessageSent
-org.apache.qpid.test.unit.ct.DurableSubscriberTest#testDurSubRestoresMessageSelector
-//These tests are for the java broker
-org.apache.qpid.server.security.acl.SimpleACLTest#*
-org.apache.qpid.server.plugins.PluginTest#*
-// This test is not finished
-org.apache.qpid.test.testcases.TTLTest#*
-// Those tests require failover support
-org.apache.qpid.test.client.QueueBrowserAutoAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserAutoAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserClientAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserClientAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserDupsOkTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserDupsOkTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserNoAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserNoAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserPreAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserPreAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserTransactedTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserTransactedTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.testcases.FailoverTest#*
-org.apache.qpid.test.client.failover.FailoverTest#*
-// Those tests are testing 0.8 specific semantics
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteNoTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteTxP2P
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxPubSub
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsConsumerDisconnectedTxPubSub
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteNoTxPubSub
-org.apache.qpid.test.testcases.ImmediateMessageTest#test_QPID_517_ImmediateFailsNoRouteTxPubSub
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteNoTxP2P
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteTxP2P
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteNoTxPubSub
-org.apache.qpid.test.testcases.MandatoryMessageTest#test_QPID_508_MandatoryFailsNoRouteTxPubSub
-org.apache.qpid.test.client.FlowControlTest#*
-org.apache.qpid.test.unit.client.connection.ConnectionTest#testDefaultExchanges
-org.apache.qpid.test.unit.client.connection.ConnectionTest#testUnresolvedVirtualHostFailure
-// the 0.10 c++ broker does not implement forget
-org.apache.qpid.test.unit.xa.FaultTest#testForget
-// the 0-10 c++ broker does not implement priority / this test depends on a Java broker extension for queue creation
-org.apache.qpid.server.queue.PriorityTest
-//this test checks explicitly for 0-8 flow control semantics
-org.apache.qpid.test.client.FlowControlTest
-// The default cpp.testprofile does not start the cpp broker with authentication so this test will fail.
-org.apache.qpid.test.unit.client.connection.ConnectionTest#testPasswordFailureConnection
-// c++ broker doesn't do selectors, so this will fail
-org.apache.qpid.test.unit.topic.TopicSessionTest#testNonMatchingMessagesDoNotFillQueue
-// QPID-1225 : Temporary remove this test until the problem has been addressed
-org.apache.qpid.server.security.acl.SimpleACLTest#testClientPublishInvalidQueueSuccess
-
-// InVM Broker tests
-org.apache.qpid.test.client.timeouts.SyncWaitDelayTest#*
-// QPID-1262, QPID-1119 : This test fails occasionally due to potential protocol issue.
-org.apache.qpid.test.client.timeouts.SyncWaitTimeoutDelayTest#*
diff --git a/M4-RCs/qpid/java/08ExcludeList b/M4-RCs/qpid/java/08ExcludeList
deleted file mode 100644
index 88eb754950..0000000000
--- a/M4-RCs/qpid/java/08ExcludeList
+++ /dev/null
@@ -1,8 +0,0 @@
-org.apache.qpid.test.unit.ct.DurableSubscriberTests#*
-// Those tests are not finished
-org.apache.qpid.test.testcases.TTLTest#*
-org.apache.qpid.test.testcases.FailoverTest#*
-// This is a long running test so should exclude from normal runs
-org.apache.qpid.test.client.failover.FailoverTest#test4MinuteFailover
-// Those tests are written against the 0.10 path
-org.apache.qpid.test.unit.message.UTF8Test#*
diff --git a/M4-RCs/qpid/java/08ExcludeList-nonvm b/M4-RCs/qpid/java/08ExcludeList-nonvm
deleted file mode 100644
index eb6c60b225..0000000000
--- a/M4-RCs/qpid/java/08ExcludeList-nonvm
+++ /dev/null
@@ -1,29 +0,0 @@
-org.apache.qpid.test.unit.ct.DurableSubscriberTests#*
-// Those tests are not finished
-org.apache.qpid.test.testcases.TTLTest#*
-org.apache.qpid.test.testcases.FailoverTest#*
-// This is a long running test so should exclude from normal runs
-org.apache.qpid.test.client.failover.FailoverTest#test4MinuteFailover
-// Those tests require failover support
-org.apache.qpid.test.client.QueueBrowserAutoAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserAutoAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserClientAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserClientAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserDupsOkTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserDupsOkTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserNoAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserNoAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserPreAckTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserPreAckTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.client.QueueBrowserTransactedTest#testFailoverAsQueueBrowserCreated
-org.apache.qpid.test.client.QueueBrowserTransactedTest#testFailoverWithQueueBrowser
-org.apache.qpid.test.testcases.FailoverTest#*
-org.apache.qpid.test.client.failover.FailoverTest#*
-
-// InVM Broker tests awaiting resolution of QPID-1103
-org.apache.qpid.test.client.timeouts.SyncWaitDelayTest#*
-org.apache.qpid.test.client.timeouts.SyncWaitTimeoutDelayTest#*
-org.apache.qpid.server.security.acl.SimpleACLTest#*
-
-// Those tests are written against the 0.10 path
-org.apache.qpid.test.unit.message.UTF8Test#*
diff --git a/M4-RCs/qpid/java/ExcludeList b/M4-RCs/qpid/java/ExcludeList
deleted file mode 100644
index 509f74bbbd..0000000000
--- a/M4-RCs/qpid/java/ExcludeList
+++ /dev/null
@@ -1,8 +0,0 @@
-org.apache.qpid.client.MultipleJCAProviderRegistrationTest#test
-// QPID-1451 : testBrowsingWithSelector test is not correct.
-org.apache.qpid.test.client.QueueBrowserAutoAckTest#testBrowsingWithSelector
-org.apache.qpid.test.client.QueueBrowserClientAckTest#testBrowsingWithSelector
-org.apache.qpid.test.client.QueueBrowserDupsOkTest#testBrowsingWithSelector
-org.apache.qpid.test.client.QueueBrowserNoAckTest#testBrowsingWithSelector
-org.apache.qpid.test.client.QueueBrowserPreAckTest#testBrowsingWithSelector
-org.apache.qpid.test.client.QueueBrowserTransactedTest#testBrowsingWithSelector
diff --git a/M4-RCs/qpid/java/KEYS b/M4-RCs/qpid/java/KEYS
deleted file mode 100644
index e69de29bb2..0000000000
--- a/M4-RCs/qpid/java/KEYS
+++ /dev/null
diff --git a/M4-RCs/qpid/java/XAExcludeList b/M4-RCs/qpid/java/XAExcludeList
deleted file mode 100644
index 1bb26c5f27..0000000000
--- a/M4-RCs/qpid/java/XAExcludeList
+++ /dev/null
@@ -1,3 +0,0 @@
-org.apache.qpid.test.unit.xa.QueueTest#*
-org.apache.qpid.test.unit.xa.TopicTest#*
-org.apache.qpid.test.unit.xa.FaultTest#*
diff --git a/M4-RCs/qpid/java/broker-plugins/MANIFEST.MF b/M4-RCs/qpid/java/broker-plugins/MANIFEST.MF
deleted file mode 100644
index e682614ed4..0000000000
--- a/M4-RCs/qpid/java/broker-plugins/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Bundle-ManifestVersion: 2
-Bundle-Name: Qpid Plugins
-Bundle-Description: A simple plugin for qpid.
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-DocURL: http://www.apache.org/
-Bundle-SymbolicName: org.apache.qpid.extras.example-plugin
-Bundle-Activator: org.apache.qpid.extras.Activator
-Private-Package: org.apache.qpid.extras,org.apache.qpid.extras.exchang
- es.diagnostic,org.apache.qpid.extras.exchanges.example
-Import-Package: javax.management,javax.management.openmbean,org.apache
- .qpid,org.apache.qpid.framing,org.apache.qpid.junit.extensions.util,o
- rg.apache.qpid.protocol,org.apache.qpid.server.exchange,org.apache.qp
- id.server.management,org.apache.qpid.server.queue,org.apache.qpid.ser
- ver.virtualhost,org.osgi.framework;version=1.3
diff --git a/M4-RCs/qpid/java/broker-plugins/build.xml b/M4-RCs/qpid/java/broker-plugins/build.xml
deleted file mode 100644
index 9787eeebc3..0000000000
--- a/M4-RCs/qpid/java/broker-plugins/build.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<!--
- -
- - Licensed to the Apache Software Foundation (ASF) under one
-nn - or more contributor license agreements. See the NOTICE file
- -n 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 name="AMQ Broker-Plugins" default="build">
-
- <property name="module.depends" value="client broker common junit-toolkit"/>
- <property name="module.manifest" value="MANIFEST.MF"/>
- <property name="module.plugin" value="true"/>
-
- <import file="../module.xml"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/Activator.java b/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/Activator.java
deleted file mode 100644
index ca6c05a435..0000000000
--- a/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/Activator.java
+++ /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.
- *
- */
-package org.apache.qpid.extras;
-
-import org.apache.qpid.extras.exchanges.diagnostic.DiagnosticExchangeType;
-import org.apache.qpid.extras.exchanges.example.TestExchangeType;
-import org.apache.qpid.server.exchange.ExchangeType;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- *
- * @author aidan
- *
- * Dummy class, used by PluginTest
- */
-
-public class Activator implements BundleActivator
-{
-
- public void start(BundleContext ctx) throws Exception
- {
- ctx.registerService(ExchangeType.class.getName(), new TestExchangeType(), null);
- ctx.registerService(ExchangeType.class.getName(), new DiagnosticExchangeType(), null);
- }
-
- public void stop(BundleContext ctx) throws Exception
- {
- }
-}
diff --git a/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/diagnostic/DiagnosticExchange.java b/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/diagnostic/DiagnosticExchange.java
deleted file mode 100644
index 027d220538..0000000000
--- a/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/diagnostic/DiagnosticExchange.java
+++ /dev/null
@@ -1,219 +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.
- *
- */
-package org.apache.qpid.extras.exchanges.diagnostic;
-
-import java.util.List;
-import java.util.Map;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import javax.management.JMException;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.TabularData;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.exchange.AbstractExchange;
-import org.apache.qpid.server.management.MBeanConstructor;
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.queue.IncomingMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-
-import org.apache.qpid.junit.extensions.util.SizeOf;
-
-/**
- *
- * This is a special diagnostic exchange type which doesn't actually do anything
- * with messages. When it receives a message, it writes information about the
- * current memory usage to the "memory" property of the message and places it on the
- * diagnosticqueue for retrieval
- *
- * @author Aidan Skinner
- *
- */
-
-public class DiagnosticExchange extends AbstractExchange
-{
-
- public static final AMQShortString DIAGNOSTIC_EXCHANGE_CLASS = new AMQShortString("x-diagnostic");
- public static final AMQShortString DIAGNOSTIC_EXCHANGE_NAME = new AMQShortString("diagnostic");
-
- /**
- * the logger.
- */
- //private static final Logger _logger = Logger.getLogger(DiagnosticExchange.class);
-
- /**
- * MBean class implementing the management interfaces.
- */
- @MBeanDescription("Management Bean for Diagnostic Exchange")
- private final class DiagnosticExchangeMBean extends ExchangeMBean
- {
-
- /**
- * Usual constructor.
- *
- * @throws JMException
- */
- @MBeanConstructor("Creates an MBean for AMQ Diagnostic exchange")
- public DiagnosticExchangeMBean() throws JMException
- {
- super();
- _exchangeType = "diagnostic";
- init();
- }
-
- /**
- * Returns nothing, there can be no tabular data for this...
- *
- * @throws OpenDataException
- * @returns null
- * @todo ... or can there? Could this actually return all the
- * information in one easy to read table?
- */
- public TabularData bindings() throws OpenDataException
- {
- return null;
- }
-
- /**
- * This exchange type doesn't support queues, so this method does
- * nothing.
- *
- * @param queueName
- * the queue you'll fail to create
- * @param binding
- * the binding you'll fail to create
- * @throws JMException
- * an exception that will never be thrown
- */
- public void createNewBinding(String queueName, String binding) throws JMException
- {
- // No Op
- }
-
- } // End of MBean class
-
- /**
- * Creates a new MBean instance
- *
- * @return the newly created MBean
- * @throws AMQException
- * if something goes wrong
- */
- protected ExchangeMBean createMBean() throws AMQException
- {
- try
- {
- return new DiagnosticExchange.DiagnosticExchangeMBean();
- }
- catch (JMException ex)
- {
- // _logger.error("Exception occured in creating the direct exchange mbean", ex);
- throw new AMQException(null, "Exception occured in creating the direct exchange mbean", ex);
- }
- }
-
- public AMQShortString getType()
- {
- return DIAGNOSTIC_EXCHANGE_CLASS;
- }
-
- /**
- * Does nothing.
- *
- * @param routingKey
- * pointless
- * @param queue
- * pointless
- * @param args
- * pointless
- * @throws AMQException
- * never
- */
- public void registerQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- // No op
- }
-
- /**
- * Does nothing.
- *
- * @param routingKey
- * pointless
- * @param queue
- * pointless
- * @param args
- * pointless
- * @throws AMQException
- * never
- */
- public void deregisterQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- // No op
- }
-
- public boolean isBound(AMQShortString routingKey, AMQQueue queue)
- {
- return false;
- }
-
- public boolean isBound(AMQShortString routingKey)
- {
- return false;
- }
-
- public boolean isBound(AMQQueue queue)
- {
- return false;
- }
-
- public boolean hasBindings()
- {
- return false;
- }
-
- public void route(IncomingMessage payload) throws AMQException
- {
-
- Long value = new Long(SizeOf.getUsedMemory());
- AMQShortString key = new AMQShortString("memory");
-
- FieldTable headers = ((BasicContentHeaderProperties)payload.getContentHeaderBody().properties).getHeaders();
- headers.put(key, value);
- ((BasicContentHeaderProperties)payload.getContentHeaderBody().properties).setHeaders(headers);
- AMQQueue q = getQueueRegistry().getQueue(new AMQShortString("diagnosticqueue"));
-
- ArrayList<AMQQueue> queues = new ArrayList<AMQQueue>();
- queues.add(q);
- payload.enqueue(queues);
-
- }
-
-
- public boolean isBound(AMQShortString routingKey, FieldTable arguments,
- AMQQueue queue) {
- // TODO Auto-generated method stub
- return false;
- }
-}
diff --git a/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/diagnostic/DiagnosticExchangeType.java b/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/diagnostic/DiagnosticExchangeType.java
deleted file mode 100644
index d96b4dc99e..0000000000
--- a/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/diagnostic/DiagnosticExchangeType.java
+++ /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.
- *
- */
-
-package org.apache.qpid.extras.exchanges.diagnostic;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.exchange.ExchangeType;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-/**
- * Exchange type class for getting hold of the exchange.
- */
-public final class DiagnosticExchangeType implements ExchangeType<DiagnosticExchange>
-{
-
- public AMQShortString getName()
- {
- return DiagnosticExchange.DIAGNOSTIC_EXCHANGE_CLASS;
- }
-
- public Class<DiagnosticExchange> getExchangeClass()
- {
- return DiagnosticExchange.class;
- }
-
- public DiagnosticExchange newInstance(VirtualHost host, AMQShortString name, boolean durable, int ticket, boolean autoDelete)
- throws AMQException
- {
- DiagnosticExchange exch = new DiagnosticExchange();
- exch.initialise(host, name, durable, ticket, autoDelete);
- return exch;
- }
-
- public AMQShortString getDefaultExchangeName()
- {
- return DiagnosticExchange.DIAGNOSTIC_EXCHANGE_NAME;
- }
-}
diff --git a/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/example/TestExchange.java b/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/example/TestExchange.java
deleted file mode 100644
index e43bd2ddc0..0000000000
--- a/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/example/TestExchange.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.apache.qpid.extras.exchanges.example;
-/*
- *
- * 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 java.util.List;
-import java.util.Map;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.queue.IncomingMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class TestExchange implements Exchange
-{
-
- public void close() throws AMQException
- {
- }
-
- public void deregisterQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- }
-
- public Map<AMQShortString, List<AMQQueue>> getBindings()
- {
- return null;
- }
-
- public AMQShortString getName()
- {
- return null;
- }
-
- public AMQShortString getType()
- {
- return null;
- }
-
- public boolean hasBindings()
- {
- return false;
- }
-
- public void initialise(VirtualHost host, AMQShortString name, boolean durable, boolean autoDelete)
- throws AMQException
- {
- }
-
- public boolean isAutoDelete()
- {
- return false;
- }
-
- public boolean isBound(AMQShortString routingKey, FieldTable arguments, AMQQueue queue)
- {
- return false;
- }
-
- public boolean isBound(AMQShortString routingKey, AMQQueue queue)
- {
- return false;
- }
-
- public boolean isBound(AMQShortString routingKey)
- {
- return false;
- }
-
- public boolean isBound(AMQQueue queue)
- {
- return false;
- }
-
- public boolean isDurable()
- {
- return false;
- }
-
- public void registerQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- }
-
- public void route(IncomingMessage message) throws AMQException
- {
- }
-
- public int getTicket()
- {
- return 0;
- }
-
- public void initialise(VirtualHost arg0, AMQShortString arg1, boolean arg2, int arg3, boolean arg4)
- throws AMQException
- {
- }
-}
diff --git a/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/example/TestExchangeType.java b/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/example/TestExchangeType.java
deleted file mode 100644
index 22833693ca..0000000000
--- a/M4-RCs/qpid/java/broker-plugins/src/main/java/org/apache/qpid/extras/exchanges/example/TestExchangeType.java
+++ /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.
- *
- */
-
-package org.apache.qpid.extras.exchanges.example;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.exchange.ExchangeType;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class TestExchangeType implements ExchangeType
-{
-
- public Class getExchangeClass()
- {
- return TestExchange.class;
- }
-
- public AMQShortString getName()
- {
- return null;
- }
-
- public Exchange newInstance(VirtualHost host, AMQShortString name, boolean durable,
- int token, boolean autoDelete)
- throws AMQException
- {
- TestExchange ex = new TestExchange();
- ex.initialise(host, name, durable, token, autoDelete);
- return ex;
- }
-
- public AMQShortString getDefaultExchangeName()
- {
- return new AMQShortString("test.exchange");
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/bin/msTool.sh b/M4-RCs/qpid/java/broker/bin/msTool.sh
deleted file mode 100755
index e190a0a46a..0000000000
--- a/M4-RCs/qpid/java/broker/bin/msTool.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-die() {
- if [[ $1 = -usage ]]; then
- shift
- usage=true
- else
- usage=false
- fi
- echo "$@"
- $usage && echo
- $usage && usage
- exit 1
-}
-
-cygwin=false
-if [[ "$(uname -a | fgrep Cygwin)" != "" ]]; then
- cygwin=true
-fi
-
-if [ -z "$QPID_TOOLS" ]; then
- if [ -z "$QPID_HOME" ]; then
- die "QPID_TOOLS must be set"
- else
- QPID_TOOLS=$QPID_HOME
- fi
-fi
-
-if $cygwin; then
- QPID_TOOLS=$(cygpath -w $QPID_TOOLS)
-fi
-
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_TOOLS/lib/qpid-all.jar
-
-# Set other variables used by the qpid-run script before calling
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_OPTS=-Dlog4j.configuration=file:$QPID_TOOLS/etc/mstool-log4j.xml \
- QPID_CLASSPATH=$QPID_LIBS
-
-. qpid-run org.apache.qpid.tools.messagestore.MessageStoreTool "$@"
diff --git a/M4-RCs/qpid/java/broker/bin/qpid-passwd b/M4-RCs/qpid/java/broker/bin/qpid-passwd
deleted file mode 100755
index 63b30b5e71..0000000000
--- a/M4-RCs/qpid/java/broker/bin/qpid-passwd
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-if [ -z "$QPID_HOME" ]; then
- export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
- export PATH=${PATH}:${QPID_HOME}/bin
-fi
-
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
-
-# Set other variables used by the qpid-run script before calling
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM=-Xmx1024m \
- QPID_CLASSPATH=$QPID_LIBS
-
-. qpid-run org.apache.qpid.tools.security.Passwd "$@"
diff --git a/M4-RCs/qpid/java/broker/bin/qpid-server b/M4-RCs/qpid/java/broker/bin/qpid-server
deleted file mode 100755
index 3570056348..0000000000
--- a/M4-RCs/qpid/java/broker/bin/qpid-server
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-if [ -z "$QPID_HOME" ]; then
- export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
- export PATH=${PATH}:${QPID_HOME}/bin
-fi
-
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/bdbstore-launch.jar
-
-# Set other variables used by the qpid-run script before calling
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM=-Xmx1024m \
- JAVA_GC="-XX:+UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError" \
- QPID_CLASSPATH=$QPID_LIBS \
- QPID_RUN_LOG=2
-
-. qpid-run org.apache.qpid.server.Main "$@"
diff --git a/M4-RCs/qpid/java/broker/bin/qpid-server-bdb.bat b/M4-RCs/qpid/java/broker/bin/qpid-server-bdb.bat
deleted file mode 100755
index 8964e577df..0000000000
--- a/M4-RCs/qpid/java/broker/bin/qpid-server-bdb.bat
+++ /dev/null
@@ -1,22 +0,0 @@
-@REM
-@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.
-@REM
-
-set BDBSTORE_HOME=c:\qpid\trunk\java\bdbstore
-set QPID_MODULE_JARS=%BDBSTORE_HOME%\target\qpid-bdbstore-1.0-incubating-M2-SNAPSHOT.jar;%BDBSTORE_HOME%\lib\bdb\je-3.1.0.jar
-.\qpid-server.bat \ No newline at end of file
diff --git a/M4-RCs/qpid/java/broker/bin/qpid-server.bat b/M4-RCs/qpid/java/broker/bin/qpid-server.bat
deleted file mode 100755
index 2687baa111..0000000000
--- a/M4-RCs/qpid/java/broker/bin/qpid-server.bat
+++ /dev/null
@@ -1,203 +0,0 @@
-@REM
-@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.
-@REM
-
-@echo off
-REM Script to run the Qpid Java Broker
-
-rem Guess QPID_HOME if not defined
-set CURRENT_DIR=%cd%
-if not "%QPID_HOME%" == "" goto gotHome
-set QPID_HOME=%CURRENT_DIR%
-echo %QPID_HOME%
-if exist "%QPID_HOME%\bin\qpid-server.bat" goto okHome
-cd ..
-set QPID_HOME=%cd%
-cd %CURRENT_DIR%
-:gotHome
-if exist "%QPID_HOME%\bin\qpid-server.bat" goto okHome
-echo The QPID_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-:okHome
-
-REM set QPID_WORK if not set
-if not "%QPID_WORK%" == "" goto okQpidWork
-if "%HOME%" == "" goto noHome
-set QPID_WOKR=%HOME%
-goto okQpidWork
-
-:noHome
-set QPID_WORK=c:\Temp
-if not exist %QPID_WORK% md %QPID_WORK%
-:okQpidWork
-
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto end
-:gotJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program.
-goto end
-:okJavaHome
-
-REM set loggin level if not set
-if "%AMQJ_LOGGING_LEVEL%" == "" set AMQJ_LOGGING_LEVEL=info
-
-REM Set the default system properties that we'll use now that they have
-REM all been initialised
-set SYSTEM_PROPS=-Damqj.logging.level=%AMQJ_LOGGING_LEVEL% -DQPID_HOME=%QPID_HOME% -DQPID_WORK=%QPID_WORK%
-
-if "%EXTERNAL_CLASSPATH%" == "" set EXTERNAL_CLASSPATH=%CLASSPATH%
-
-REM Use QPID_CLASSPATH if set
-if "%QPID_CLASSPATH%" == "" goto noQpidClasspath
-set CLASSPATH=%QPID_CLASSPATH%
-echo Using CLASSPATH: %CLASSPATH%
-goto afterQpidClasspath
-
-:noQpidClasspath
-echo Warning: Qpid classpath not set. CLASSPATH set to %QPID_HOME%\lib\qpid-all.jar
-set CLASSPATH=%QPID_HOME%\lib\qpid-all.jar
-:afterQpidClasspath
-
-REM start parsing -run arguments
-set QPID_ARGS=
-if "%1" == "" goto endRunArgs
-:runLoop
-set var=%1
-if "%var:~0,5%" == "-run:" goto runFound
-set QPID_ARGS=%QPID_ARGS% %1
-:beforeRunShift
-shift
-if not "%1"=="" goto runLoop
-goto endRunArgs
-
-:runFound
-if "%var%" == "-run:debug" goto runDebug
-if "%var%" == "-run:jpda" goto runJdpa
-if "%var:~0,24%" == "-run:external-classpath-" goto runExternalClasspath
-if "%var%" == "-run:print-classpath" goto runPrintCP
-if "%var%" == "-run:help" goto runHelp
-echo "unrecognized -run option '%var%'. For using external classpaths use -run:external-classpath-option"
-goto end
-
-:runDebug
-REM USAGE: print the classpath and command before running it
-set debug=true
-goto beforeRunShift
-
-:runJdpa
-REM USAGE: adds debugging options to the java command, use
-REM USAGE: JDPA_TRANSPORT and JPDA_ADDRESS to customize the debugging
-REM USAGE: behavior and use JPDA_OPTS to override it entirely
-if "%JPDA_OPTS%" == "" goto beforeRunShift
-if "%JPDA_TRANSPORT%" == "" set JPDA_TRANSPORT=-dt_socket
-if "%JPDA_ADDRESS%" == "" set JPDA_ADDRESS=8000
-set JPDA_OPTS="-Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n"
-set QPID_OPTS="%QPID_OPTS% %JPDA_OPTS%"
-goto beforeRunShift
-
-:runExternalClasspath
-echo Using external classpath %var%
-REM USAGE: Format is -run:external-classpath-first/last/ignore/only as equals special in DOS
-REM USAGE: controls how the CLASSPATH environment variable is used by
-REM USAGE: this script, value can be one of ignore (the default), first,
-REM USAGE: last, and only
-if "%var%" == "-run:external-classpath-ignore" goto beforeRunShift
-if "%var%" == "-run:external-classpath-first" goto extCPFirst
-if "%var%" == "-run:external-classpath-last" goto extCPLast
-if "%var%" == "-run:external-classpath-only" goto extCPOnly
-echo Invalid value provided for external classpath.
-goto end
-
-:extCPFirst
-set CLASSPATH=%EXTERNAL_CLASSPATH%;%CLASSPATH%
-goto beforeRunShift
-
-:extCPLast
-set CLASSPATH=%CLASSPATH%;%EXTERNAL_CLASSPATH%
-goto beforeRunShift
-
-:extCPonly
-set CLASSPATH=%EXTERNAL_CLASSPATH%
-goto beforeRunShift
-
-:runPrintCP
-REM USAGE: print the classpath
-echo %CLASSPATH%
-goto beforeRunShift
-
-:runHelp
-REM USAGE: print this message
-echo -------------------------------------------------------------------------------------------
-echo -run:option where option can be the following.
-echo debug : Prints classpath and command before running it
-echo jpda : Adds remote debugging info using JPDA_OPTS. Use JPDA_TRANSPORT and JPDA_ADDRESS to
-echo customize, JPDA_OPTS to override
-echo external-classpath : Valid values are: ignore, first, last and only.
-echo print-classpath : Prints classpath before running command
-echo help : Prints this message
-echo --------------------------------------------------------------------------------------------
-goto end
-
-REM end parsing -run arguments
-:endRunArgs
-
-set JAVA_VM=-server
-set JAVA_MEM=-Xmx1024m
-set JAVA_GC=-XX:+UseConcMarkSweepGC
-rem removing the following vm arg from JAVA_GC as it is supported on ly in Java 1.6
-rem -XX:+HeapDumpOnOutOfMemoryError"
-
-REM Use QPID_JAVA_GC if set
-if "%QPID_JAVA_GC%" == "" goto noQpidJavaGC
-set JAVA_GC=%QPID_JAVA_GC%
-echo Using QPID_JAVA_GC setting: %QPID_JAVA_GC%
-goto afteQpidJavaGC
-
-:noQPidJavaGC
-echo Info: QPID_JAVA_GC not set. Defaulting to JAVA_GC %JAVA_GC%
-:afterQpidJavaGC
-
-REM Use QPID_JAVA_MEM if set
-if "%QPID_JAVA_MEM%" == "" goto noQpidJavaMem
-set JAVA_MEM=%QPID_JAVA_MEM%
-echo Using QPID_JAVA_MEM setting: %QPID_JAVA_MEM%
-goto afterQpidJavaMem
-
-:noQpidJavaMem
-echo Info: QPID_JAVA_MEM not set. Defaulting to JAVA_MEM %JAVA_MEM%
-:after QpidJavaMem
-
-
-rem QPID_OPTS intended to hold any -D props for use
-rem user must enclose any value for QPID_OPTS in double quotes
-:runCommand
-set MODULE_JARS=%QPID_MODULE_JARS%
-set COMMAND="%JAVA_HOME%\bin\java" %JAVA_VM% %JAVA_MEM% %JAVA_GC% %QPID_OPTS% %SYSTEM_PROPS% -cp "%CLASSPATH%;%MODULE_JARS%" org.apache.qpid.server.Main %QPID_ARGS%
-
-if "%debug%" == "true" echo %CLASSPATH%;%LAUNCH_JAR%;%MODULE_JARS%
-if "%debug%" == "true" echo %COMMAND%
-%COMMAND%
-
-:end
diff --git a/M4-RCs/qpid/java/broker/bin/qpid.start b/M4-RCs/qpid/java/broker/bin/qpid.start
deleted file mode 100755
index 78c34e70b4..0000000000
--- a/M4-RCs/qpid/java/broker/bin/qpid.start
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-exec qpid-server -run:debug "$@" \ No newline at end of file
diff --git a/M4-RCs/qpid/java/broker/bin/qpid.stop b/M4-RCs/qpid/java/broker/bin/qpid.stop
deleted file mode 100755
index 316f8dff46..0000000000
--- a/M4-RCs/qpid/java/broker/bin/qpid.stop
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-# qpid.stop Script
-#
-# Script checks for a given pid running DEFAULT_SEARCH and attempts to quit it
-#
-
-MAX_ATTEMPTS=2
-SLEEP_DELAY=1
-DEFAULT_SEARCH="PNAME=QPBRKR"
-
-if [ -z "$QPID_STOP_SEARCH" ]; then
- SEARCH=$DEFAULT_SEARCH;
-else
- SEARCH=$QPID_STOP_SEARCH;
-fi
-
-#
-# Forcably Quit the specified PID($1)
-#
-forceQuit()
-{
-kill -9 $1
-}
-
-#
-# Gracefully ask the PID($1) to quit
-#
-quit()
-{
-kill $1
-}
-
-#
-# grep for the session ID ($1) and return 0 for successful quit and 1 for process alive
-#
-lookup_pid()
-{
-result=`ps -e | grep $1 | wc -l`
-}
-
-#
-# grep ps for all instances of $SEARCH for the current user and collect PIDs
-#
-lookup_all_pids()
-{
-pids=`pgrep -f -U $USER $SEARCH`
-result_all=`echo -n $pids | wc -w`
-}
-
-#
-# check that the PID passed in is for a Qpid broker owned by this user and alive
-#
-validate_pid()
-{
-result=`pgrep -fl $SEARCH | grep $1 | wc -l`
-}
-
-#
-# Show the PS output for given set of pids
-#
-showPids()
-{
-ps -o user,pid,args -p $pids
-}
-
-#
-# Sleep and then check then lookup the PID($1) to ensure it has quit
-#
-check()
-{
-echo "Waiting $SLEEP_DELAY second for $1 to exit"
-sleep $SLEEP_DELAY
-lookup_pid $1
-}
-
-#
-# Verify the PID($1) is available
-#
-verifyPid()
-{
-validate_pid $1
-if [[ $[$result] == 1 ]] ; then
- brokerspid=$1
-else
- echo "Unable to locate Qpid Broker Process with PID $1. Check PID and try again."
- exit -1
-fi
-}
-
-#
-# Stops all Qpid brokers for current user
-#
-qpid_stopall_brokers()
-{
-for pid in $pids ; do
- lookup_pid $pid;
- brokerspid=$pid;
- stop_broker $pid;
-done
-}
-
-#
-# Stops Qpid broker with brokerspid id
-#
-stop_broker()
-{
-# Attempt to quit the process MAX_ATTEMPTS Times
-attempt=0
-while [[ $[$result] > 0 && $[$attempt] < $[$MAX_ATTEMPTS] ]] ; do
- quit $brokerspid
- check $brokerspid
- attempt=$[$attempt + 1]
-done
-
-# Check that it has quit
-if [[ $[$result] == 0 ]] ; then
- echo "Process quit"
-else
-
- attempt=0
- # Now attempt to force quit the process
- while [[ $[$result] > 0 && $[$attempt] < $[$MAX_ATTEMPTS] ]] ; do
- forceQuit $brokerspid
- check $brokerspid
- attempt=$[$attempt + 1]
- done
-
- # Output final status
- if [[ $[$result] > 0 && $[$attempt] == $[$MAX_ATTEMPTS] ]] ; then
- echo "Stopped trying to kill process: $brokerspid"
- echo "Attempted to stop $attempt times"
- else
- echo "Done "
- fi
-fi
-
-}
-
-#
-# Main Run
-#
-
-# Check if we are killing all qpid pids or just one.
-# Now uses local function qpid_stopall_brokers
-if [[ $# == 0 ]] ; then
- lookup_all_pids
- if [[ $[$result_all] > 0 ]] ; then
- echo "Killing All Qpid Brokers for user: '$USER'"
- qpid_stopall_brokers
- else
- echo "No Qpid Brokers found running for user: " $USER
- fi
- exit $result
-else
- verifyPid $1
- stop_broker
- exit $result
-fi
-
diff --git a/M4-RCs/qpid/java/broker/bin/qpid.stopall b/M4-RCs/qpid/java/broker/bin/qpid.stopall
deleted file mode 100755
index b0ad506629..0000000000
--- a/M4-RCs/qpid/java/broker/bin/qpid.stopall
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-# qpid.stopall script
-#
-# Script attempts to stop all PROGRAMs running under the current user
-# Utilises qpid.stop to perform the actual stopping
-#
-
-qpid.stop $*
diff --git a/M4-RCs/qpid/java/broker/build.xml b/M4-RCs/qpid/java/broker/build.xml
deleted file mode 100644
index 26dcde2918..0000000000
--- a/M4-RCs/qpid/java/broker/build.xml
+++ /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.
- -
- -->
-<project name="AMQ Broker" default="build">
-
- <property name="module.depends" value="common"/>
- <property name="module.main" value="org.apache.qpid.server.Main"/>
-
- <import file="../module.xml"/>
-
- <property name="output.dir" value="${module.precompiled}/org/apache/qpid/server/filter/jms/selector"/>
-
-
- <target name="precompile">
- <mkdir dir="${output.dir}"/>
- <javacc target="src/main/grammar/SelectorParser.jj"
- outputdirectory="${output.dir}"
- javacchome="${project.root}/lib"/>
- </target>
-
- <target name="copy-etc-release" if="module.etc.exists" description="copy etc directory if it exists to build tree">
- <copy todir="${module.release}/etc" failonerror="false" flatten="true">
- <fileset dir="${module.etc}" excludes="*.conf,*.jpp"/>
- </copy>
- </target>
-
- <target name="copy-bin-release" description="copy dependencies into module release">
- <copy todir="${module.release}/bin" failonerror="true">
- <fileset dir="${module.bin}"/>
- </copy>
- <copy todir="${module.release}/bin" failonerror="true" flatten="true">
- <fileset dir="${basedir}/../common/bin"/>
- </copy>
- <chmod dir="${module.release}/bin" perm="ugo+rx" includes="**/*"/>
-
- </target>
-
- <target name="release-bin" depends="release-bin-tasks"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/broker/etc/access b/M4-RCs/qpid/java/broker/etc/access
deleted file mode 100644
index 58b7443fa9..0000000000
--- a/M4-RCs/qpid/java/broker/etc/access
+++ /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.
-
-guest:localhost(rw),test(rw) \ No newline at end of file
diff --git a/M4-RCs/qpid/java/broker/etc/acl.config.xml b/M4-RCs/qpid/java/broker/etc/acl.config.xml
deleted file mode 100644
index 614ecf0a88..0000000000
--- a/M4-RCs/qpid/java/broker/etc/acl.config.xml
+++ /dev/null
@@ -1,231 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- -
- - 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.
- -
- -->
-<broker>
- <prefix>${QPID_HOME}</prefix>
- <work>${QPID_WORK}</work>
- <conf>${prefix}/etc</conf>
- <connector>
- <!-- Uncomment out this block and edit the keystorePath and keystorePassword
- to enable SSL support
- <ssl>
- <enabled>true</enabled>
- <sslOnly>true</sslOnly>
- <keystorePath>/path/to/keystore.ks</keystorePath>
- <keystorePassword>keystorepass</keystorePassword>
- </ssl>-->
- <qpidnio>false</qpidnio>
- <!-- I've had the 0.0 and 0.1 Reader threads continually throwing IOException when client closes-->
- <protectio>false</protectio>
- <transport>nio</transport>
- <port>5672</port>
- <sslport>8672</sslport>
- <socketReceiveBuffer>32768</socketReceiveBuffer>
- <socketSendBuffer>32768</socketSendBuffer>
- </connector>
- <management>
- <enabled>false</enabled>
- <jmxport>8999</jmxport>
- <security-enabled>false</security-enabled>
- </management>
- <advanced>
- <filterchain enableExecutorPool="true"/>
- <enablePooledAllocator>false</enablePooledAllocator>
- <enableDirectBuffers>false</enableDirectBuffers>
- <framesize>65535</framesize>
- <compressBufferOnQueue>false</compressBufferOnQueue>
- <enableJMSXUserID>false</enableJMSXUserID>
- </advanced>
-
- <security>
- <principal-databases>
- <!-- Example use of Base64 encoded MD5 hashes for authentication via CRAM-MD5-Hashed -->
- <principal-database>
- <name>passwordfile</name>
- <class>org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase</class>
- <attributes>
- <attribute>
- <name>passwordFile</name>
- <value>${conf}/passwd</value>
- </attribute>
- </attributes>
- </principal-database>
- </principal-databases>
-
- <access>
- <class>org.apache.qpid.server.security.access.plugins.DenyAll</class>
- </access>
-
- <jmx>
- <access>${conf}/jmxremote.access</access>
- <principal-database>passwordfile</principal-database>
- </jmx>
- </security>
-
- <virtualhosts>
- <directory>${conf}/virtualhosts</directory>
-
- <virtualhost>
- <name>test</name>
- <test>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
-
- <queues>
- <exchange>amq.direct</exchange>
- <!-- 4Mb -->
- <maximumQueueDepth>4235264</maximumQueueDepth>
- <!-- 2Mb -->
- <maximumMessageSize>2117632</maximumMessageSize>
- <!-- 10 mins -->
- <maximumMessageAge>600000</maximumMessageAge>
- </queues>
-
-
- <security>
- <access>
- <class>org.apache.qpid.server.security.access.plugins.SimpleXML</class>
- </access>
-
- <access_control_list>
- <!-- This section grants pubish rights to an exchange + routing key pair -->
- <publish>
- <exchanges>
- <exchange>
- <name>amq.direct</name>
- <routing_keys>
-
- <!-- Allow clients to publish requests -->
- <routing_key>
- <value>example.RequestQueue</value>
- <users>
- <user>client</user>
- </users>
- </routing_key>
-
- <!-- Allow the processor to respond to a client on their Temporary Topic -->
- <routing_key>
- <value>tmp_*</value>
- <users>
- <user>server</user>
- </users>
- </routing_key>
- <routing_key>
- <value>TempQueue*</value>
- <users>
- <user>server</user>
- </users>
- </routing_key>
- </routing_keys>
-
- </exchange>
- </exchanges>
- </publish>
-
- <!-- This section grants users the ability to consume from the broker -->
- <consume>
- <queues>
-
- <!-- Allow the clients to consume from their temporary queues-->
- <queue>
- <temporary/>
- <users>
- <user>client</user>
- </users>
- </queue>
-
-
- <!-- Only allow the server to consume from the Request Queue-->
- <queue>
- <name>example.RequestQueue</name>
- <users>
- <user>server</user>
- </users>
- </queue>
-
-
- </queues>
- </consume>
-
- <!-- This section grants clients the ability to create queues and exchanges -->
- <create>
- <queues>
- <!-- Allow clients to create temporary queues-->
- <queue>
- <temporary/>
- <exchanges>
- <exchange>
- <name>amq.direct</name>
- <users>
- <user>client</user>
- </users>
- </exchange>
- </exchanges>
- </queue>
- <!-- Allow the server to create the Request Queue-->
- <queue>
- <name>example.RequestQueue</name>
- <users>
- <user>server</user>
- </users>
- </queue>
-
- </queues>
- </create>
-
-
- </access_control_list>
-
- </security>
- </test>
- </virtualhost>
-
-
- <virtualhost>
- <name>development</name>
- <development>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
- </development>
- </virtualhost>
-
- <virtualhost>
- <name>localhost</name>
- <localhost>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
- </localhost>
- </virtualhost>
-
- </virtualhosts>
-
- <heartbeat>
- <delay>0</delay>
- <timeoutFactor>2.0</timeoutFactor>
- </heartbeat>
-
- <virtualhosts>${conf}/virtualhosts.xml</virtualhosts>
-</broker>
-
-
diff --git a/M4-RCs/qpid/java/broker/etc/config.xml b/M4-RCs/qpid/java/broker/etc/config.xml
deleted file mode 100644
index 6a8c011e77..0000000000
--- a/M4-RCs/qpid/java/broker/etc/config.xml
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- -
- - 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.
- -
- -->
-<broker>
- <prefix>${QPID_HOME}</prefix>
- <work>${QPID_WORK}</work>
- <conf>${prefix}/etc</conf>
- <connector>
- <!-- Uncomment out this block and edit the keystorePath and keystorePassword
- to enable SSL support
- <ssl>
- <enabled>true</enabled>
- <sslOnly>true</sslOnly>
- <keystorePath>/path/to/keystore.ks</keystorePath>
- <keystorePassword>keystorepass</keystorePassword>
- </ssl>-->
- <qpidnio>false</qpidnio>
- <protectio>
- <enabled>false</enabled>
- </protectio>
- <transport>nio</transport>
- <port>5672</port>
- <sslport>8672</sslport>
- <socketReceiveBuffer>32768</socketReceiveBuffer>
- <socketSendBuffer>32768</socketSendBuffer>
- </connector>
- <management>
- <enabled>false</enabled>
- <jmxport>8999</jmxport>
- <security-enabled>false</security-enabled>
- </management>
- <advanced>
- <filterchain enableExecutorPool="true"/>
- <enablePooledAllocator>false</enablePooledAllocator>
- <enableDirectBuffers>false</enableDirectBuffers>
- <framesize>65535</framesize>
- <compressBufferOnQueue>false</compressBufferOnQueue>
- <enableJMSXUserID>false</enableJMSXUserID>
- </advanced>
-
- <security>
- <principal-databases>
- <!-- Example use of Base64 encoded MD5 hashes for authentication via CRAM-MD5-Hashed -->
- <principal-database>
- <name>passwordfile</name>
- <class>org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase</class>
- <attributes>
- <attribute>
- <name>passwordFile</name>
- <value>${conf}/passwd</value>
- </attribute>
- </attributes>
- </principal-database>
- </principal-databases>
-
- <access>
- <class>org.apache.qpid.server.security.access.plugins.AllowAll</class>
- </access>
-
- <msg-auth>false</msg-auth>
-
- <jmx>
- <access>${conf}/jmxremote.access</access>
- <principal-database>passwordfile</principal-database>
- </jmx>
- </security>
-
- <virtualhosts>
- <directory>${conf}/virtualhosts</directory>
-
- <virtualhost>
- <name>localhost</name>
- <localhost>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
-
- <housekeeping>
- <expiredMessageCheckPeriod>20000</expiredMessageCheckPeriod>
- </housekeeping>
-
- </localhost>
- </virtualhost>
-
- <virtualhost>
- <name>development</name>
- <development>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
- </development>
- </virtualhost>
-
- <virtualhost>
- <name>test</name>
- <test>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
- </test>
- </virtualhost>
-
- </virtualhosts>
- <heartbeat>
- <delay>0</delay>
- <timeoutFactor>2.0</timeoutFactor>
- </heartbeat>
- <queue>
- <auto_register>true</auto_register>
- </queue>
-
- <virtualhosts>${conf}/virtualhosts.xml</virtualhosts>
-</broker>
-
-
diff --git a/M4-RCs/qpid/java/broker/etc/debug.log4j.xml b/M4-RCs/qpid/java/broker/etc/debug.log4j.xml
deleted file mode 100644
index 71f9502b75..0000000000
--- a/M4-RCs/qpid/java/broker/etc/debug.log4j.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<?xml version="1.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.
- -
- -->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
- <appender name="ArchivingFileAppender" class="org.apache.log4j.QpidCompositeRollingAppender">
- <!-- Ensure that logs allways have the dateFormat set-->
- <param name="StaticLogFileName" value="false"/>
- <param name="File" value="${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log"/>
- <param name="Append" value="false"/>
- <!-- Change the direction so newer files have bigger numbers -->
- <!-- So log.1 is written then log.2 etc This prevents a lot of file renames at log rollover -->
- <param name="CountDirection" value="1"/>
- <!-- Use default 10MB -->
- <!--param name="MaxFileSize" value="100000"/-->
- <param name="DatePattern" value="'.'yyyy-MM-dd-HH-mm"/>
- <!-- Unlimited number of backups -->
- <param name="MaxSizeRollBackups" value="-1"/>
- <!-- Compress(gzip) the backup files-->
- <param name="CompressBackupFiles" value="true"/>
- <!-- Compress the backup files using a second thread -->
- <param name="CompressAsync" value="true"/>
- <!-- Start at zero numbered files-->
- <param name="ZeroBased" value="true"/>
- <!-- Backup Location -->
- <param name="backupFilesToPath" value="${QPID_WORK}/backup/log"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
- </layout>
- </appender>
-
- <appender name="FileAppender" class="org.apache.log4j.FileAppender">
- <param name="File" value="${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log"/>
- <param name="Append" value="false"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
- </layout>
- </appender>
-
- <appender name="AlertFile" class="org.apache.log4j.FileAppender">
- <param name="File" value="${QPID_WORK}/log/alert.log"/>
- <param name="Append" value="false"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
- </layout>
- </appender>
-
- <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
- </layout>
- </appender>
-
- <category name="Qpid.Broker">
- <priority value="debug"/>
- <appender-ref ref="AlertFile"/>
- <!--appender-ref ref="STDOUT"/-->
- </category>
-
-
- <category name="org.apache.qpid.server.queue.AMQQueueMBean">
- <priority value="info"/>
- <appender-ref ref="AlertFile"/>
- </category>
-
-
- <!-- Provide warnings to standard output -->
- <!--category name="org.apache.qpid">
- <priority value="warn"/>
- <appender-ref ref="STDOUT"/>
- </category-->
-
-
- <!-- Additional level settings for debugging -->
- <!-- Each class in the Broker is a category that can have its logging level adjusted. -->
- <!-- This will provide more details if available about that classes processing. -->
- <!--category name="org.apache.qpid.server.txn">
- <priority value="debug"/>
- </category>-->
-
- <!--<category name="org.apache.qpid.server.store">
- <priority value="debug"/>
- </category-->
-
- <!-- Log all info events to file -->
- <root>
- <priority value="debug"/>
- <appender-ref ref="STDOUT"/>
- <!--appender-ref ref="FileAppender"/-->
- </root>
-
-</log4j:configuration>
diff --git a/M4-RCs/qpid/java/broker/etc/jmxremote.access b/M4-RCs/qpid/java/broker/etc/jmxremote.access
deleted file mode 100644
index 1a51a6991b..0000000000
--- a/M4-RCs/qpid/java/broker/etc/jmxremote.access
+++ /dev/null
@@ -1,23 +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.
-
-#Generated by JMX Console : Last edited by user:admin
-#Tue Jun 12 16:46:39 BST 2007
-admin=admin
-guest=readonly
-user=readwrite
diff --git a/M4-RCs/qpid/java/broker/etc/log4j.xml b/M4-RCs/qpid/java/broker/etc/log4j.xml
deleted file mode 100644
index eff5d17588..0000000000
--- a/M4-RCs/qpid/java/broker/etc/log4j.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.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.
- -
- -->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
- <appender name="ArchivingFileAppender" class="org.apache.log4j.QpidCompositeRollingAppender">
- <!-- Ensure that logs allways have the dateFormat set-->
- <param name="StaticLogFileName" value="false"/>
- <param name="File" value="${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log"/>
- <param name="Append" value="false"/>
- <!-- Change the direction so newer files have bigger numbers -->
- <!-- So log.1 is written then log.2 etc This prevents a lot of file renames at log rollover -->
- <param name="CountDirection" value="1"/>
- <!-- Use default 10MB -->
- <!--param name="MaxFileSize" value="100000"/-->
- <param name="DatePattern" value="'.'yyyy-MM-dd-HH-mm"/>
- <!-- Unlimited number of backups -->
- <param name="MaxSizeRollBackups" value="-1"/>
- <!-- Compress(gzip) the backup files-->
- <param name="CompressBackupFiles" value="true"/>
- <!-- Compress the backup files using a second thread -->
- <param name="CompressAsync" value="true"/>
- <!-- Start at zero numbered files-->
- <param name="ZeroBased" value="true"/>
- <!-- Backup Location -->
- <param name="backupFilesToPath" value="${QPID_WORK}/backup/log"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
- </layout>
- </appender>
-
- <appender name="FileAppender" class="org.apache.log4j.FileAppender">
- <param name="File" value="${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log"/>
- <param name="Append" value="false"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
- </layout>
- </appender>
-
- <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
- </layout>
- </appender>
-
- <!-- Qpid.Broker log is a special log category used to only useful broker startup details -->
- <category name="Qpid.Broker">
- <priority value="debug"/>
- <appender-ref ref="STDOUT"/>
- </category>
-
- <category name="org.apache.qpid.server.queue.AMQQueueMBean">
- <priority value="info"/>
- </category>
-
- <!-- Provide warnings to standard output -->
- <category name="org.apache.qpid">
- <priority value="warn"/>
- </category>
-
-
- <!-- Examples of additional logging settings -->
- <!-- Used to generate extra debug. See debug.log4j.xml -->
-
- <!--<category name="org.apache.qpid.server.store">
- <priority value="debug"/>
- </category-->
-
-
- <!-- Log all info events to file -->
- <root>
- <priority value="info"/>
- <appender-ref ref="FileAppender"/>
- <!--appender-ref ref="ArchivingFileAppender"/-->
- </root>
-
-</log4j:configuration>
diff --git a/M4-RCs/qpid/java/broker/etc/md5passwd b/M4-RCs/qpid/java/broker/etc/md5passwd
deleted file mode 100644
index 6a149919de..0000000000
--- a/M4-RCs/qpid/java/broker/etc/md5passwd
+++ /dev/null
@@ -1,21 +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.
-#
-guest:CE4DQ6BIb/BVMN9scFyLtA==
-admin:ISMvKXpXpadDiUoOSoAfww==
-user:aBzonUodYLhwSa8s9A10sA==
diff --git a/M4-RCs/qpid/java/broker/etc/mstool-log4j.xml b/M4-RCs/qpid/java/broker/etc/mstool-log4j.xml
deleted file mode 100644
index 8c46010e2d..0000000000
--- a/M4-RCs/qpid/java/broker/etc/mstool-log4j.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.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.
- -
- -->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-
- <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
-
- <layout class="org.apache.log4j.PatternLayout">
- <!--param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/-->
- <param name="ConversionPattern" value="%d %-5p [%t] (%F:%L) - %m%n"/>
- </layout>
- </appender>
-
- <category name="org.apache.qpid.tools">
- <priority value="info"/>
- </category>
-
- <category name="org.apache.qpid">
- <priority value="error"/>
- </category>
-
- <category name="org.apache.qpid.server.security">
- <priority value="error"/>
- </category>
-
- <category name="org.apache.qpid.server.management">
- <priority value="error"/>
- </category>
-
-
- <root>
- <priority value="info"/>
- <appender-ref ref="STDOUT"/>
- </root>
-</log4j:configuration>
diff --git a/M4-RCs/qpid/java/broker/etc/passwd b/M4-RCs/qpid/java/broker/etc/passwd
deleted file mode 100644
index 7aca438551..0000000000
--- a/M4-RCs/qpid/java/broker/etc/passwd
+++ /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.
-#
-guest:guest
-client:guest
-server:guest
-
diff --git a/M4-RCs/qpid/java/broker/etc/passwdVhost b/M4-RCs/qpid/java/broker/etc/passwdVhost
deleted file mode 100644
index 48ce8299b6..0000000000
--- a/M4-RCs/qpid/java/broker/etc/passwdVhost
+++ /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.
-#
-guest:guest:localhost,test
diff --git a/M4-RCs/qpid/java/broker/etc/persistent_config.xml b/M4-RCs/qpid/java/broker/etc/persistent_config.xml
deleted file mode 100644
index b7965a8af6..0000000000
--- a/M4-RCs/qpid/java/broker/etc/persistent_config.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- -
- - 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 is an example config using the BDBMessageStore available from
- the Red Hat Messaging project at etp.108.redhat.com and distributed under GPL.
- -->
-
-<broker>
- <prefix>${QPID_HOME}</prefix>
- <work>${QPID_WORK}</work>
- <conf>${prefix}/etc</conf>
- <connector>
- <transport>nio</transport>
- <port>5672</port>
- <sslport>8672</sslport>
- <socketReceiveBuffer>32768</socketReceiveBuffer>
- <socketSendBuffer>32768</socketSendBuffer>
- </connector>
- <management>
- <enabled>false</enabled>
- <jmxport>8999</jmxport>
- </management>
- <advanced>
- <filterchain enableExecutorPool="true"/>
- <enablePooledAllocator>false</enablePooledAllocator>
- <enableDirectBuffers>false</enableDirectBuffers>
- <framesize>65535</framesize>
- <compressBufferOnQueue>false</compressBufferOnQueue>
- </advanced>
-
- <security>
- <principal-databases>
- <principal-database>
- <name>passwordfile</name>
- <class>org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase</class>
- <attributes>
- <attribute>
- <name>passwordFile</name>
- <value>${conf}/passwd</value>
- </attribute>
- </attributes>
- </principal-database>
- </principal-databases>
-
- <access>
- <class>org.apache.qpid.server.security.access.plugins.AllowAll</class>
- </access>
- <jmx>
- <access>${conf}/jmxremote.access</access>
- <principal-database>passwordfile</principal-database>
- </jmx>
- </security>
-
- <virtualhosts>
- <virtualhost>
- <name>localhost</name>
- <localhost>
- <store>
- <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdbstore/localhost-store</environment-path>
- </store>
- </localhost>
- </virtualhost>
-
- <virtualhost>
- <name>development</name>
- <development>
- <store>
- <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdbstore/development-store</environment-path>
- </store>
- </development>
- </virtualhost>
-
- <virtualhost>
- <name>test</name>
- <test>
- <store>
- <class>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</class>
- <environment-path>${work}/bdbstore/test-store</environment-path>
- </store>
- </test>
- </virtualhost>
-
- </virtualhosts>
- <heartbeat>
- <delay>0</delay>
- <timeoutFactor>2.0</timeoutFactor>
- </heartbeat>
- <queue>
- <auto_register>true</auto_register>
- </queue>
-
- <virtualhosts>${conf}/virtualhosts.xml</virtualhosts>
-</broker>
-
-
diff --git a/M4-RCs/qpid/java/broker/etc/qpid-server.conf b/M4-RCs/qpid/java/broker/etc/qpid-server.conf
deleted file mode 100644
index 8a16849b04..0000000000
--- a/M4-RCs/qpid/java/broker/etc/qpid-server.conf
+++ /dev/null
@@ -1,25 +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.
-#
-
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar:$QPID_HOME/lib/bdbstore-launch.jar
-
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM=-Xmx1024m \
- CLASSPATH=$QPID_LIBS
diff --git a/M4-RCs/qpid/java/broker/etc/qpid-server.conf.jpp b/M4-RCs/qpid/java/broker/etc/qpid-server.conf.jpp
deleted file mode 100644
index 3ed2431ef3..0000000000
--- a/M4-RCs/qpid/java/broker/etc/qpid-server.conf.jpp
+++ /dev/null
@@ -1,49 +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.
-#
-
-QPID_LIBS=$(build-classpath backport-util-concurrent \
- commons-beanutils \
- commons-beanutils-core \
- commons-cli \
- commons-codec \
- commons-collections \
- commons-configuration \
- commons-digester \
- commons-lang \
- commons-logging \
- commons-logging-api \
- dom4j \
- geronimo-jms-1.1-api \
- isorelax \
- jaxen \
- log4j \
- mina/core \
- mina/filter-ssl \
- mina/java5 \
- msv-msv \
- qpid-broker \
- qpid-client \
- qpid-common \
- relaxngDatatype \
- slf4j)
-
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM=-Xmx1024m \
- CLASSPATH=$QPID_LIBS
diff --git a/M4-RCs/qpid/java/broker/etc/qpid.passwd b/M4-RCs/qpid/java/broker/etc/qpid.passwd
deleted file mode 100644
index dbfb9d1923..0000000000
--- a/M4-RCs/qpid/java/broker/etc/qpid.passwd
+++ /dev/null
@@ -1,23 +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.
-#
-guest:CE4DQ6BIb/BVMN9scFyLtA==
-admin:ISMvKXpXpadDiUoOSoAfww==
-user:CE4DQ6BIb/BVMN9scFyLtA==
-server:CE4DQ6BIb/BVMN9scFyLtA==
-client:CE4DQ6BIb/BVMN9scFyLtA==
diff --git a/M4-RCs/qpid/java/broker/etc/transient_config.xml b/M4-RCs/qpid/java/broker/etc/transient_config.xml
deleted file mode 100644
index 1dd693f60f..0000000000
--- a/M4-RCs/qpid/java/broker/etc/transient_config.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- -
- - 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 is an example config file that uses the MemoryMessageStore.
- As a result it is aimed at brokers sending transient messages.
-
- -->
-<broker>
- <prefix>${QPID_HOME}</prefix>
- <work>${QPID_WORK}</work>
- <conf>${prefix}/etc</conf>
- <connector>
- <transport>nio</transport>
- <port>5672</port>
- <sslport>8672</sslport>
- <socketReceiveBuffer>32768</socketReceiveBuffer>
- <socketSendBuffer>32768</socketSendBuffer>
- </connector>
- <management>
- <enabled>false</enabled>
- <jmxport>8999</jmxport>
- </management>
- <advanced>
- <filterchain enableExecutorPool="true"/>
- <enablePooledAllocator>false</enablePooledAllocator>
- <enableDirectBuffers>false</enableDirectBuffers>
- <framesize>65535</framesize>
- <compressBufferOnQueue>false</compressBufferOnQueue>
- </advanced>
-
- <security>
- <principal-databases>
- <principal-database>
- <name>passwordfile</name>
- <class>org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase</class>
- <attributes>
- <attribute>
- <name>passwordFile</name>
- <value>${conf}/passwd</value>
- </attribute>
- </attributes>
- </principal-database>
- </principal-databases>
-
- <access>
- <class>org.apache.qpid.server.security.access.plugins.AllowAll</class>
- </access>
- <jmx>
- <access>${conf}/jmxremote.access</access>
- <principal-database>passwordfile</principal-database>
- </jmx>
- </security>
-
- <virtualhosts>
- <virtualhost>
- <name>localhost</name>
- <localhost>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
- </localhost>
- </virtualhost>
-
- <virtualhost>
- <name>development</name>
- <development>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
- </development>
- </virtualhost>
-
- <virtualhost>
- <name>test</name>
- <test>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
- </test>
- </virtualhost>
-
- </virtualhosts>
- <heartbeat>
- <delay>0</delay>
- <timeoutFactor>2.0</timeoutFactor>
- </heartbeat>
- <queue>
- <auto_register>true</auto_register>
- </queue>
-
- <virtualhosts>${conf}/virtualhosts.xml</virtualhosts>
-</broker>
-
-
diff --git a/M4-RCs/qpid/java/broker/etc/virtualhosts.xml b/M4-RCs/qpid/java/broker/etc/virtualhosts.xml
deleted file mode 100644
index f62ec3f5d7..0000000000
--- a/M4-RCs/qpid/java/broker/etc/virtualhosts.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- -
- - 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.
- -
- -->
-<virtualhosts>
- <default>test</default>
- <virtualhost>
- <name>localhost</name>
- <localhost>
- <exchanges>
- <exchange>
- <type>direct</type>
- <name>test.direct</name>
- <durable>true</durable>
- </exchange>
- <exchange>
- <type>topic</type>
- <name>test.topic</name>
- </exchange>
- </exchanges>
- <queues>
- <exchange>amq.direct</exchange>
- <maximumQueueDepth>4235264</maximumQueueDepth> <!-- 4Mb -->
- <maximumMessageSize>2117632</maximumMessageSize> <!-- 2Mb -->
- <maximumMessageAge>600000</maximumMessageAge> <!-- 10 mins -->
-
- <queue>
- <name>queue</name>
- </queue>
- <queue>
- <name>ping</name>
- </queue>
- <queue>
- <name>test-queue</name>
- <test-queue>
- <exchange>test.direct</exchange>
- <durable>true</durable>
- </test-queue>
- </queue>
- <queue>
- <name>test-ping</name>
- <test-ping>
- <exchange>test.direct</exchange>
- </test-ping>
- </queue>
-
- </queues>
- </localhost>
- </virtualhost>
-
-
- <virtualhost>
- <name>development</name>
- <development>
- <queues>
- <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
- <maximumMessageCount>5000</maximumMessageCount>
- <queue>
- <name>queue</name>
- <queue>
- <exchange>amq.direct</exchange>
- <maximumQueueDepth>4235264</maximumQueueDepth> <!-- 4Mb -->
- <maximumMessageSize>2117632</maximumMessageSize> <!-- 2Mb -->
- <maximumMessageAge>600000</maximumMessageAge> <!-- 10 mins -->
- </queue>
- </queue>
- <queue>
- <name>ping</name>
- <ping>
- <exchange>amq.direct</exchange>
- <maximumQueueDepth>4235264</maximumQueueDepth> <!-- 4Mb -->
- <maximumMessageSize>2117632</maximumMessageSize> <!-- 2Mb -->
- <maximumMessageAge>600000</maximumMessageAge> <!-- 10 mins -->
- </ping>
- </queue>
- </queues>
- </development>
- </virtualhost>
- <virtualhost>
- <name>test</name>
- <test>
- <queues>
- <minimumAlertRepeatGap>30000</minimumAlertRepeatGap>
- <maximumMessageCount>5000</maximumMessageCount>
- <queue>
- <name>queue</name>
- <queue>
- <exchange>amq.direct</exchange>
- <maximumQueueDepth>4235264</maximumQueueDepth> <!-- 4Mb -->
- <maximumMessageSize>2117632</maximumMessageSize> <!-- 2Mb -->
- <maximumMessageAge>600000</maximumMessageAge> <!-- 10 mins -->
- </queue>
- </queue>
- <queue>
- <name>ping</name>
- <ping>
- <exchange>amq.direct</exchange>
- <maximumQueueDepth>4235264</maximumQueueDepth> <!-- 4Mb -->
- <maximumMessageSize>2117632</maximumMessageSize> <!-- 2Mb -->
- <maximumMessageAge>600000</maximumMessageAge> <!-- 10 mins -->
- </ping>
- </queue>
- </queues>
- </test>
- </virtualhost>
-</virtualhosts>
diff --git a/M4-RCs/qpid/java/broker/python-test.xml b/M4-RCs/qpid/java/broker/python-test.xml
deleted file mode 100755
index 5c263e3169..0000000000
--- a/M4-RCs/qpid/java/broker/python-test.xml
+++ /dev/null
@@ -1,56 +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.
--->
-
-<!-- ====================================================================== -->
-<!-- Ant build file (http://ant.apache.org/) for Ant 1.6.2 or above. -->
-<!-- ====================================================================== -->
-
-<project basedir="." default="default">
-
- <target name="default" >
- <echo message="Used via maven to run python tests."/>
- </target>
-
- <dirname property="broker.dir" file="${ant.file.python-test}"/>
-
- <property name="pythondir" value="${broker.dir}/../../python"/>
-
- <target name="run-tests" unless="skip-python-tests">
-
- <echo message="Starting Broker with command"/>
-
- <java classname="org.apache.qpid.server.RunBrokerWithCommand"
- fork="true"
- dir="${pythondir}"
- failonerror="true"
- >
- <arg value="${command}"/>
- <arg value="-p"/>
- <arg value="2110"/>
- <arg value="-m"/>
- <arg value="2111"/>
-
- <classpath refid="maven.test.classpath"/>
- <sysproperty key="QPID_HOME" value="${broker.dir}"/>
- <sysproperty key="QPID_WORK" value="${broker.dir}${file.separator}target"/>
- </java>
-
- </target>
-</project>
diff --git a/M4-RCs/qpid/java/broker/src/main/grammar/SelectorParser.jj b/M4-RCs/qpid/java/broker/src/main/grammar/SelectorParser.jj
deleted file mode 100644
index c9e01cd01f..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/grammar/SelectorParser.jj
+++ /dev/null
@@ -1,621 +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.
- *
- */
-
- //
- // Original File from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
- //
-
-// ----------------------------------------------------------------------------
-// OPTIONS
-// ----------------------------------------------------------------------------
-options {
- STATIC = false;
- UNICODE_INPUT = true;
-
- // some performance optimizations
- OPTIMIZE_TOKEN_MANAGER = true;
- ERROR_REPORTING = false;
-}
-
-// ----------------------------------------------------------------------------
-// PARSER
-// ----------------------------------------------------------------------------
-
-PARSER_BEGIN(SelectorParser)
-/*
- *
- * 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.
- *
- */
-
-package org.apache.qpid.server.filter.jms.selector;
-
-import java.io.StringReader;
-import java.util.ArrayList;
-
-import org.apache.qpid.AMQInvalidArgumentException;
-import org.apache.qpid.server.filter.ArithmeticExpression;
-import org.apache.qpid.server.filter.BooleanExpression;
-import org.apache.qpid.server.filter.ComparisonExpression;
-import org.apache.qpid.server.filter.ConstantExpression;
-import org.apache.qpid.server.filter.Expression;
-import org.apache.qpid.server.filter.LogicExpression;
-import org.apache.qpid.server.filter.PropertyExpression;
-import org.apache.qpid.server.filter.UnaryExpression;
-
-/**
- * JMS Selector Parser generated by JavaCC
- *
- * Do not edit this .java file directly - it is autogenerated from SelectorParser.jj
- */
-public class SelectorParser {
-
- public SelectorParser() {
- this(new StringReader(""));
- }
-
- public BooleanExpression parse(String sql) throws AMQInvalidArgumentException {
- this.ReInit(new StringReader(sql));
-
- try {
- return this.JmsSelector();
- }
- catch (Throwable e) {
- throw (AMQInvalidArgumentException)new AMQInvalidArgumentException(sql,e);
- }
-
- }
-
- private BooleanExpression asBooleanExpression(Expression value) throws ParseException {
- if (value instanceof BooleanExpression) {
- return (BooleanExpression) value;
- }
- if (value instanceof PropertyExpression) {
- return UnaryExpression.createBooleanCast( value );
- }
- throw new ParseException("Expression will not result in a boolean value: " + value);
- }
-
-
-}
-
-PARSER_END(SelectorParser)
-
-// ----------------------------------------------------------------------------
-// Tokens
-// ----------------------------------------------------------------------------
-
-/* White Space */
-SPECIAL_TOKEN :
-{
- " " | "\t" | "\n" | "\r" | "\f"
-}
-
-/* Comments */
-SKIP:
-{
- <LINE_COMMENT: "--" (~["\n","\r"])* ("\n"|"\r"|"\r\n") >
-}
-
-SKIP:
-{
- <BLOCK_COMMENT: "/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/">
-}
-
-/* Reserved Words */
-TOKEN [IGNORE_CASE] :
-{
- < NOT : "NOT">
- | < AND : "AND">
- | < OR : "OR">
- | < BETWEEN : "BETWEEN">
- | < LIKE : "LIKE">
- | < ESCAPE : "ESCAPE">
- | < IN : "IN">
- | < IS : "IS">
- | < TRUE : "TRUE" >
- | < FALSE : "FALSE" >
- | < NULL : "NULL" >
- | < XPATH : "XPATH" >
- | < XQUERY : "XQUERY" >
-}
-
-/* Literals */
-TOKEN [IGNORE_CASE] :
-{
-
- < DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* (["l","L"])? >
- | < HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
- | < OCTAL_LITERAL: "0" (["0"-"7"])* >
- | < FLOATING_POINT_LITERAL:
- (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? // matches: 5.5 or 5. or 5.5E10 or 5.E10
- | "." (["0"-"9"])+ (<EXPONENT>)? // matches: .5 or .5E10
- | (["0"-"9"])+ <EXPONENT> // matches: 5E10
- >
- | < #EXPONENT: "E" (["+","-"])? (["0"-"9"])+ >
- | < STRING_LITERAL: "'" ( ("''") | ~["'"] )* "'" >
-}
-
-TOKEN [IGNORE_CASE] :
-{
- < ID : ["a"-"z", "_", "$"] (["a"-"z","0"-"9","_", "$"])* >
- | < QUOTED_ID : "\"" ( ("\"\"") | ~["\""] )* "\"" >
-}
-
-// ----------------------------------------------------------------------------
-// Grammer
-// ----------------------------------------------------------------------------
-BooleanExpression JmsSelector() :
-{
- Expression left=null;
-}
-{
- (
- left = orExpression()
- )
- {
- return asBooleanExpression(left);
- }
-
-}
-
-Expression orExpression() :
-{
- Expression left;
- Expression right;
-}
-{
- (
- left = andExpression()
- (
- <OR> right = andExpression()
- {
- left = LogicExpression.createOR(asBooleanExpression(left), asBooleanExpression(right));
- }
- )*
- )
- {
- return left;
- }
-
-}
-
-
-Expression andExpression() :
-{
- Expression left;
- Expression right;
-}
-{
- (
- left = equalityExpression()
- (
- <AND> right = equalityExpression()
- {
- left = LogicExpression.createAND(asBooleanExpression(left), asBooleanExpression(right));
- }
- )*
- )
- {
- return left;
- }
-}
-
-Expression equalityExpression() :
-{
- Expression left;
- Expression right;
-}
-{
- (
- left = comparisonExpression()
- (
-
- "=" right = comparisonExpression()
- {
- left = ComparisonExpression.createEqual(left, right);
- }
- |
- "<>" right = comparisonExpression()
- {
- left = ComparisonExpression.createNotEqual(left, right);
- }
- |
- LOOKAHEAD(2)
- <IS> <NULL>
- {
- left = ComparisonExpression.createIsNull(left);
- }
- |
- <IS> <NOT> <NULL>
- {
- left = ComparisonExpression.createIsNotNull(left);
- }
- )*
- )
- {
- return left;
- }
-}
-
-Expression comparisonExpression() :
-{
- Expression left;
- Expression right;
- Expression low;
- Expression high;
- String t, u;
- boolean not;
- ArrayList list;
-}
-{
- (
- left = addExpression()
- (
-
- ">" right = addExpression()
- {
- left = ComparisonExpression.createGreaterThan(left, right);
- }
- |
- ">=" right = addExpression()
- {
- left = ComparisonExpression.createGreaterThanEqual(left, right);
- }
- |
- "<" right = addExpression()
- {
- left = ComparisonExpression.createLessThan(left, right);
- }
- |
- "<=" right = addExpression()
- {
- left = ComparisonExpression.createLessThanEqual(left, right);
- }
- |
- {
- u=null;
- }
- <LIKE> t = stringLitteral()
- [ <ESCAPE> u = stringLitteral() ]
- {
- left = ComparisonExpression.createLike(left, t, u);
- }
- |
- LOOKAHEAD(2)
- {
- u=null;
- }
- <NOT> <LIKE> t = stringLitteral() [ <ESCAPE> u = stringLitteral() ]
- {
- left = ComparisonExpression.createNotLike(left, t, u);
- }
- |
- <BETWEEN> low = addExpression() <AND> high = addExpression()
- {
- left = ComparisonExpression.createBetween(left, low, high);
- }
- |
- LOOKAHEAD(2)
- <NOT> <BETWEEN> low = addExpression() <AND> high = addExpression()
- {
- left = ComparisonExpression.createNotBetween(left, low, high);
- }
- |
- <IN>
- "("
- t = stringLitteral()
- {
- list = new ArrayList();
- list.add( t );
- }
- (
- ","
- t = stringLitteral()
- {
- list.add( t );
- }
-
- )*
- ")"
- {
- left = ComparisonExpression.createInFilter(left, list);
- }
- |
- LOOKAHEAD(2)
- <NOT> <IN>
- "("
- t = stringLitteral()
- {
- list = new ArrayList();
- list.add( t );
- }
- (
- ","
- t = stringLitteral()
- {
- list.add( t );
- }
-
- )*
- ")"
- {
- left = ComparisonExpression.createNotInFilter(left, list);
- }
-
- )*
- )
- {
- return left;
- }
-}
-
-Expression addExpression() :
-{
- Expression left;
- Expression right;
-}
-{
- left = multExpr()
- (
- LOOKAHEAD( ("+"|"-") multExpr())
- (
- "+" right = multExpr()
- {
- left = ArithmeticExpression.createPlus(left, right);
- }
- |
- "-" right = multExpr()
- {
- left = ArithmeticExpression.createMinus(left, right);
- }
- )
-
- )*
- {
- return left;
- }
-}
-
-Expression multExpr() :
-{
- Expression left;
- Expression right;
-}
-{
- left = unaryExpr()
- (
- "*" right = unaryExpr()
- {
- left = ArithmeticExpression.createMultiply(left, right);
- }
- |
- "/" right = unaryExpr()
- {
- left = ArithmeticExpression.createDivide(left, right);
- }
- |
- "%" right = unaryExpr()
- {
- left = ArithmeticExpression.createMod(left, right);
- }
-
- )*
- {
- return left;
- }
-}
-
-
-Expression unaryExpr() :
-{
- String s=null;
- Expression left=null;
-}
-{
- (
- LOOKAHEAD( "+" unaryExpr() )
- "+" left=unaryExpr()
- |
- "-" left=unaryExpr()
- {
- left = UnaryExpression.createNegate(left);
- }
- |
- <NOT> left=unaryExpr()
- {
- left = UnaryExpression.createNOT( asBooleanExpression(left) );
- }
- |
- <XPATH> s=stringLitteral()
- {
- left = UnaryExpression.createXPath( s );
- }
- |
- <XQUERY> s=stringLitteral()
- {
- left = UnaryExpression.createXQuery( s );
- }
- |
- left = primaryExpr()
- )
- {
- return left;
- }
-
-}
-
-Expression primaryExpr() :
-{
- Expression left=null;
-}
-{
- (
- left = literal()
- |
- left = variable()
- |
- "(" left = orExpression() ")"
- )
- {
- return left;
- }
-}
-
-
-
-ConstantExpression literal() :
-{
- Token t;
- String s;
- ConstantExpression left=null;
-}
-{
- (
- (
- s = stringLitteral()
- {
- left = new ConstantExpression(s);
- }
- )
- |
- (
- t = <DECIMAL_LITERAL>
- {
- left = ConstantExpression.createFromDecimal(t.image);
- }
- )
- |
- (
- t = <HEX_LITERAL>
- {
- left = ConstantExpression.createFromHex(t.image);
- }
- )
- |
- (
- t = <OCTAL_LITERAL>
- {
- left = ConstantExpression.createFromOctal(t.image);
- }
- )
- |
- (
- t = <FLOATING_POINT_LITERAL>
- {
- left = ConstantExpression.createFloat(t.image);
- }
- )
- |
- (
- <TRUE>
- {
- left = ConstantExpression.TRUE;
- }
- )
- |
- (
- <FALSE>
- {
- left = ConstantExpression.FALSE;
- }
- )
- |
- (
- <NULL>
- {
- left = ConstantExpression.NULL;
- }
- )
- )
- {
- return left;
- }
-}
-
-String stringLitteral() :
-{
- Token t;
- StringBuffer rc = new StringBuffer();
- boolean first=true;
-}
-{
- t = <STRING_LITERAL>
- {
- // Decode the sting value.
- String image = t.image;
- for( int i=1; i < image.length()-1; i++ ) {
- char c = image.charAt(i);
- if( c == '\'' )
- i++;
- rc.append(c);
- }
- return rc.toString();
- }
-}
-
-PropertyExpression variable() :
-{
- Token t;
- StringBuffer rc = new StringBuffer();
- PropertyExpression left=null;
-}
-{
- (
- t = <ID>
- {
- left = new PropertyExpression(t.image);
- }
- |
- t = <QUOTED_ID>
- {
- // Decode the sting value.
- String image = t.image;
- for( int i=1; i < image.length()-1; i++ ) {
- char c = image.charAt(i);
- if( c == '"' )
- i++;
- rc.append(c);
- }
- return new PropertyExpression(rc.toString());
- }
-
-
- )
- {
- return left;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/log4j.properties b/M4-RCs/qpid/java/broker/src/main/java/log4j.properties
deleted file mode 100644
index 6788c65463..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/log4j.properties
+++ /dev/null
@@ -1,24 +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.
-#
-log4j.rootCategory=${amqj.logging.level}, console
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=all
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java
deleted file mode 100644
index 7e0c4defe1..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java
+++ /dev/null
@@ -1,1007 +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.
- *
- */
-package org.apache.log4j;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.Writer;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.zip.GZIPOutputStream;
-
-import org.apache.log4j.helpers.CountingQuietWriter;
-import org.apache.log4j.helpers.LogLog;
-import org.apache.log4j.helpers.OptionConverter;
-import org.apache.log4j.spi.LoggingEvent;
-
-/**
- * <p>CompositeRollingAppender combines RollingFileAppender and DailyRollingFileAppender<br> It can function as either
- * or do both at the same time (making size based rolling files like RollingFileAppender until a data/time boundary is
- * crossed at which time it rolls all of those files as per the DailyRollingFileAppender) based on the setting for
- * <code>rollingStyle</code>.<br> <br> To use CompositeRollingAppender to roll log files as they reach a certain size
- * (like RollingFileAppender), set rollingStyle=1 (@see config.size)<br> To use CompositeRollingAppender to roll log
- * files at certain time intervals (daily for example), set rollingStyle=2 and a datePattern (@see config.time)<br> To
- * have CompositeRollingAppender roll log files at a certain size AND rename those according to time intervals, set
- * rollingStyle=3 (@see config.composite)<br>
- *
- * <p>A of few additional optional features have been added:<br> -- Attach date pattern for current log file (@see
- * staticLogFileName)<br> -- Backup number increments for newer files (@see countDirection)<br> -- Infinite number of
- * backups by file size (@see maxSizeRollBackups)<br> <br> <p>A few notes and warnings: For large or infinite number of
- * backups countDirection > 0 is highly recommended, with staticLogFileName = false if time based rolling is also used
- * -- this will reduce the number of file renamings to few or none. Changing staticLogFileName or countDirection
- * without clearing the directory could have nasty side effects. If Date/Time based rolling is enabled,
- * CompositeRollingAppender will attempt to roll existing files in the directory without a date/time tag based on the
- * last modified date of the base log files last modification.<br> <br> <p>A maximum number of backups based on
- * date/time boundries would be nice but is not yet implemented.<br>
- *
- * @author Kevin Steppe
- * @author Heinz Richter
- * @author Eirik Lygre
- * @author Ceki G&uuml;lc&uuml;
- * @author Martin Ritchie
- */
-public class QpidCompositeRollingAppender extends FileAppender
-{
- // The code assumes that the following 'time' constants are in a increasing
- // sequence.
- static final int TOP_OF_TROUBLE = -1;
- static final int TOP_OF_MINUTE = 0;
- static final int TOP_OF_HOUR = 1;
- static final int HALF_DAY = 2;
- static final int TOP_OF_DAY = 3;
- static final int TOP_OF_WEEK = 4;
- static final int TOP_OF_MONTH = 5;
-
- /** Style of rolling to use */
- static final int BY_SIZE = 1;
- static final int BY_DATE = 2;
- static final int BY_COMPOSITE = 3;
-
- // Not currently used
- static final String S_BY_SIZE = "Size";
- static final String S_BY_DATE = "Date";
- static final String S_BY_COMPOSITE = "Composite";
-
- /** The date pattern. By default, the pattern is set to "'.'yyyy-MM-dd" meaning daily rollover. */
- private String datePattern = "'.'yyyy-MM-dd";
-
- /**
- * The actual formatted filename that is currently being written to or will be the file transferred to on roll over
- * (based on staticLogFileName).
- */
- private String scheduledFilename = null;
-
- /** The timestamp when we shall next recompute the filename. */
- private long nextCheck = System.currentTimeMillis() - 1;
-
- /** Holds date of last roll over */
- Date now = new Date();
-
- SimpleDateFormat sdf;
-
- /** Helper class to determine next rollover time */
- RollingCalendar rc = new RollingCalendar();
-
- /** Current period for roll overs */
- int checkPeriod = TOP_OF_TROUBLE;
-
- /** The default maximum file size is 10MB. */
- protected long maxFileSize = 10 * 1024 * 1024;
-
- /** There is zero backup files by default. */
- protected int maxSizeRollBackups = 0;
- /** How many sized based backups have been made so far */
- protected int curSizeRollBackups = 0;
-
- /** not yet implemented */
- protected int maxTimeRollBackups = -1;
- protected int curTimeRollBackups = 0;
-
- /**
- * By default newer files have lower numbers. (countDirection < 0) ie. log.1 is most recent, log.5 is the 5th
- * backup, etc... countDirection > 0 does the opposite ie. log.1 is the first backup made, log.5 is the 5th backup
- * made, etc. For infinite backups use countDirection > 0 to reduce rollOver costs.
- */
- protected int countDirection = -1;
-
- /** Style of rolling to Use. BY_SIZE (1), BY_DATE(2), BY COMPOSITE(3) */
- protected int rollingStyle = BY_COMPOSITE;
- protected boolean rollDate = true;
- protected boolean rollSize = true;
-
- /**
- * By default file.log is always the current file. Optionally file.log.yyyy-mm-dd for current formated datePattern
- * can by the currently logging file (or file.log.curSizeRollBackup or even file.log.yyyy-mm-dd.curSizeRollBackup)
- * This will make time based roll overs with a large number of backups much faster -- it won't have to rename all
- * the backups!
- */
- protected boolean staticLogFileName = true;
-
- /** FileName provided in configuration. Used for rolling properly */
- protected String baseFileName;
-
- /** Do we want to .gz our backup files. */
- protected boolean compress = false;
-
- /** Do we want to use a second thread when compressing our backup files. */
- protected boolean compressAsync = false;
-
- /** Do we want to start numbering files at zero. */
- protected boolean zeroBased = false;
-
- /** Path provided in configuration. Used for moving backup files to */
- protected String backupFilesToPath = null;
- private final ConcurrentLinkedQueue<CompressJob> _compress = new ConcurrentLinkedQueue<CompressJob>();
- private AtomicBoolean _compressing = new AtomicBoolean(false);
-
- /** The default constructor does nothing. */
- public QpidCompositeRollingAppender()
- { }
-
- /**
- * Instantiate a <code>CompositeRollingAppender</code> and open the file designated by <code>filename</code>. The
- * opened filename will become the ouput destination for this appender.
- */
- public QpidCompositeRollingAppender(Layout layout, String filename, String datePattern) throws IOException
- {
- this(layout, filename, datePattern, true);
- }
-
- /**
- * Instantiate a CompositeRollingAppender and open the file designated by <code>filename</code>. The opened filename
- * will become the ouput destination for this appender.
- *
- * <p>If the <code>append</code> parameter is true, the file will be appended to. Otherwise, the file desginated by
- * <code>filename</code> will be truncated before being opened.
- */
- public QpidCompositeRollingAppender(Layout layout, String filename, boolean append) throws IOException
- {
- super(layout, filename, append);
- }
-
- /**
- * Instantiate a CompositeRollingAppender and open the file designated by <code>filename</code>. The opened filename
- * will become the ouput destination for this appender.
- */
- public QpidCompositeRollingAppender(Layout layout, String filename, String datePattern, boolean append)
- throws IOException
- {
- super(layout, filename, append);
- this.datePattern = datePattern;
- activateOptions();
- }
-
- /**
- * Instantiate a CompositeRollingAppender and open the file designated by <code>filename</code>. The opened filename
- * will become the output destination for this appender.
- *
- * <p>The file will be appended to. DatePattern is default.
- */
- public QpidCompositeRollingAppender(Layout layout, String filename) throws IOException
- {
- super(layout, filename);
- }
-
- /**
- * The <b>DatePattern</b> takes a string in the same format as expected by {@link java.text.SimpleDateFormat}. This
- * options determines the rollover schedule.
- */
- public void setDatePattern(String pattern)
- {
- datePattern = pattern;
- }
-
- /** Returns the value of the <b>DatePattern</b> option. */
- public String getDatePattern()
- {
- return datePattern;
- }
-
- /** Returns the value of the <b>maxSizeRollBackups</b> option. */
- public int getMaxSizeRollBackups()
- {
- return maxSizeRollBackups;
- }
-
- /**
- * Get the maximum size that the output file is allowed to reach before being rolled over to backup files.
- *
- * @since 1.1
- */
- public long getMaximumFileSize()
- {
- return maxFileSize;
- }
-
- /**
- * <p>Set the maximum number of backup files to keep around based on file size.
- *
- * <p>The <b>MaxSizeRollBackups</b> option determines how many backup files are kept before the oldest is erased.
- * This option takes an integer value. If set to zero, then there will be no backup files and the log file will be
- * truncated when it reaches <code>MaxFileSize</code>. If a negative number is supplied then no deletions will be
- * made. Note that this could result in very slow performance as a large number of files are rolled over unless
- * {@link #setCountDirection} up is used.
- *
- * <p>The maximum applys to -each- time based group of files and -not- the total. Using a daily roll the maximum
- * total files would be (#days run) * (maxSizeRollBackups)
- */
- public void setMaxSizeRollBackups(int maxBackups)
- {
- maxSizeRollBackups = maxBackups;
- }
-
- /**
- * Set the maximum size that the output file is allowed to reach before being rolled over to backup files.
- *
- * <p>This method is equivalent to {@link #setMaxFileSize} except that it is required for differentiating the setter
- * taking a <code>long</code> argument from the setter taking a <code>String</code> argument by the JavaBeans {@link
- * java.beans.Introspector Introspector}.
- *
- * @see #setMaxFileSize(String)
- */
- public void setMaxFileSize(long maxFileSize)
- {
- this.maxFileSize = maxFileSize;
- }
-
- /**
- * Set the maximum size that the output file is allowed to reach before being rolled over to backup files.
- *
- * <p>This method is equivalent to {@link #setMaxFileSize} except that it is required for differentiating the setter
- * taking a <code>long</code> argument from the setter taking a <code>String</code> argument by the JavaBeans {@link
- * java.beans.Introspector Introspector}.
- *
- * @see #setMaxFileSize(String)
- */
- public void setMaximumFileSize(long maxFileSize)
- {
- this.maxFileSize = maxFileSize;
- }
-
- /**
- * Set the maximum size that the output file is allowed to reach before being rolled over to backup files.
- *
- * <p>In configuration files, the <b>MaxFileSize</b> option takes an long integer in the range 0 - 2^63. You can
- * specify the value with the suffixes "KB", "MB" or "GB" so that the integer is interpreted being expressed
- * respectively in kilobytes, megabytes or gigabytes. For example, the value "10KB" will be interpreted as 10240.
- */
- public void setMaxFileSize(String value)
- {
- maxFileSize = OptionConverter.toFileSize(value, maxFileSize + 1);
- }
-
- protected void setQWForFiles(Writer writer)
- {
- qw = new CountingQuietWriter(writer, errorHandler);
- }
-
- // Taken verbatum from DailyRollingFileAppender
- int computeCheckPeriod()
- {
- RollingCalendar c = new RollingCalendar();
- // set sate to 1970-01-01 00:00:00 GMT
- Date epoch = new Date(0);
- if (datePattern != null)
- {
- for (int i = TOP_OF_MINUTE; i <= TOP_OF_MONTH; i++)
- {
- String r0 = sdf.format(epoch);
- c.setType(i);
- Date next = new Date(c.getNextCheckMillis(epoch));
- String r1 = sdf.format(next);
- // LogLog.debug("Type = "+i+", r0 = "+r0+", r1 = "+r1);
- if ((r0 != null) && (r1 != null) && !r0.equals(r1))
- {
- return i;
- }
- }
- }
-
- return TOP_OF_TROUBLE; // Deliberately head for trouble...
- }
-
- // Now for the new stuff
- /**
- * Handles append time behavior for CompositeRollingAppender. This checks if a roll over either by date (checked
- * first) or time (checked second) is need and then appends to the file last.
- */
- protected void subAppend(LoggingEvent event)
- {
-
- if (rollDate)
- {
- long n = System.currentTimeMillis();
- if (n >= nextCheck)
- {
- now.setTime(n);
- nextCheck = rc.getNextCheckMillis(now);
-
- rollOverTime();
- }
- }
-
- if (rollSize)
- {
- if ((fileName != null) && (((CountingQuietWriter) qw).getCount() >= maxFileSize))
- {
- rollOverSize();
- }
- }
-
- super.subAppend(event);
- }
-
- public void setFile(String file)
- {
- baseFileName = file.trim();
- fileName = file.trim();
- }
-
- /**
- * Creates and opens the file for logging. If <code>staticLogFileName</code> is false then the fully qualified name
- * is determined and used.
- */
- public synchronized void setFile(String fileName, boolean append) throws IOException
- {
- if (!staticLogFileName)
- {
- scheduledFilename = fileName = fileName.trim() + sdf.format(now);
- if (countDirection > 0)
- {
- scheduledFilename = fileName = fileName + '.' + (++curSizeRollBackups);
- }
- }
-
- super.setFile(fileName, append, bufferedIO, bufferSize);
-
- if (append)
- {
- File f = new File(fileName);
- ((CountingQuietWriter) qw).setCount(f.length());
- }
- }
-
- public int getCountDirection()
- {
- return countDirection;
- }
-
- public void setCountDirection(int direction)
- {
- countDirection = direction;
- }
-
- public int getRollingStyle()
- {
- return rollingStyle;
- }
-
- public void setRollingStyle(int style)
- {
- rollingStyle = style;
- switch (rollingStyle)
- {
-
- case BY_SIZE:
- rollDate = false;
- rollSize = true;
- break;
-
- case BY_DATE:
- rollDate = true;
- rollSize = false;
- break;
-
- case BY_COMPOSITE:
- rollDate = true;
- rollSize = true;
- break;
-
- default:
- errorHandler.error("Invalid rolling Style, use 1 (by size only), 2 (by date only) or 3 (both)");
- }
- }
-
- /*
- public void setRollingStyle(String style) {
- if (style == S_BY_SIZE) {
- rollingStyle = BY_SIZE;
- }
- else if (style == S_BY_DATE) {
- rollingStyle = BY_DATE;
- }
- else if (style == S_BY_COMPOSITE) {
- rollingStyle = BY_COMPOSITE;
- }
- }
- */
- public boolean getStaticLogFileName()
- {
- return staticLogFileName;
- }
-
- public void setStaticLogFileName(boolean s)
- {
- staticLogFileName = s;
- }
-
- public void setStaticLogFileName(String value)
- {
- setStaticLogFileName(OptionConverter.toBoolean(value, true));
- }
-
- public boolean getCompressBackupFiles()
- {
- return compress;
- }
-
- public void setCompressBackupFiles(boolean c)
- {
- compress = c;
- }
-
- public boolean getCompressAsync()
- {
- return compressAsync;
- }
-
- public void setCompressAsync(boolean c)
- {
- compressAsync = c;
- if (compressAsync)
- {
- executor = Executors.newFixedThreadPool(1);
-
- compressor = new Compressor();
- }
- }
-
- public boolean getZeroBased()
- {
- return zeroBased;
- }
-
- public void setZeroBased(boolean z)
- {
- zeroBased = z;
- }
-
- public String getBackupFilesToPath()
- {
- return backupFilesToPath;
- }
-
- public void setbackupFilesToPath(String path)
- {
- File td = new File(path);
- if (!td.exists())
- {
- td.mkdirs();
- }
-
- backupFilesToPath = path;
- }
-
- /**
- * Initializes based on exisiting conditions at time of <code> activateOptions</code>. The following is done:<br>
- * <br> A) determine curSizeRollBackups<br> B) determine curTimeRollBackups (not implemented)<br> C) initiates a
- * roll over if needed for crossing a date boundary since the last run.
- */
- protected void existingInit()
- {
-
- if (zeroBased)
- {
- curSizeRollBackups = -1;
- }
-
- curTimeRollBackups = 0;
-
- // part A starts here
- String filter;
- if (staticLogFileName || !rollDate)
- {
- filter = baseFileName + ".*";
- }
- else
- {
- filter = scheduledFilename + ".*";
- }
-
- File f = new File(baseFileName);
- f = f.getParentFile();
- if (f == null)
- {
- f = new File(".");
- }
-
- LogLog.debug("Searching for existing files in: " + f);
- String[] files = f.list();
-
- if (files != null)
- {
- for (int i = 0; i < files.length; i++)
- {
- if (!files[i].startsWith(baseFileName))
- {
- continue;
- }
-
- int index = files[i].lastIndexOf(".");
-
- if (staticLogFileName)
- {
- int endLength = files[i].length() - index;
- if ((baseFileName.length() + endLength) != files[i].length())
- {
- // file is probably scheduledFilename + .x so I don't care
- continue;
- }
- }
-
- try
- {
- int backup = Integer.parseInt(files[i].substring(index + 1, files[i].length()));
- LogLog.debug("From file: " + files[i] + " -> " + backup);
- if (backup > curSizeRollBackups)
- {
- curSizeRollBackups = backup;
- }
- }
- catch (Exception e)
- {
- // this happens when file.log -> file.log.yyyy-mm-dd which is normal
- // when staticLogFileName == false
- LogLog.debug("Encountered a backup file not ending in .x " + files[i]);
- }
- }
- }
-
- LogLog.debug("curSizeRollBackups starts at: " + curSizeRollBackups);
- // part A ends here
-
- // part B not yet implemented
-
- // part C
- if (staticLogFileName && rollDate)
- {
- File old = new File(baseFileName);
- if (old.exists())
- {
- Date last = new Date(old.lastModified());
- if (!(sdf.format(last).equals(sdf.format(now))))
- {
- scheduledFilename = baseFileName + sdf.format(last);
- LogLog.debug("Initial roll over to: " + scheduledFilename);
- rollOverTime();
- }
- }
- }
-
- LogLog.debug("curSizeRollBackups after rollOver at: " + curSizeRollBackups);
- // part C ends here
-
- }
-
- /**
- * Sets initial conditions including date/time roll over information, first check, scheduledFilename, and calls
- * <code>existingInit</code> to initialize the current # of backups.
- */
- public void activateOptions()
- {
-
- // REMOVE removed rollDate from boolean to enable Alex's change
- if (datePattern != null)
- {
- now.setTime(System.currentTimeMillis());
- sdf = new SimpleDateFormat(datePattern);
- int type = computeCheckPeriod();
- // printPeriodicity(type);
- rc.setType(type);
- // next line added as this removes the name check in rollOver
- nextCheck = rc.getNextCheckMillis(now);
- }
- else
- {
- if (rollDate)
- {
- LogLog.error("Either DatePattern or rollingStyle options are not set for [" + name + "].");
- }
- }
-
- existingInit();
-
- if (rollDate && (fileName != null) && (scheduledFilename == null))
- {
- scheduledFilename = fileName + sdf.format(now);
- }
-
- try
- {
- this.setFile(fileName, true);
- }
- catch (IOException e)
- {
- errorHandler.error("Cannot set file name:" + fileName);
- }
-
- super.activateOptions();
- }
-
- /**
- * Rollover the file(s) to date/time tagged file(s). Opens the new file (through setFile) and resets
- * curSizeRollBackups.
- */
- protected void rollOverTime()
- {
-
- curTimeRollBackups++;
-
- this.closeFile(); // keep windows happy.
-
- // delete the old stuff here
-
- if (staticLogFileName)
- {
- /* Compute filename, but only if datePattern is specified */
- if (datePattern == null)
- {
- errorHandler.error("Missing DatePattern option in rollOver().");
-
- return;
- }
-
- // is the new file name equivalent to the 'current' one
- // something has gone wrong if we hit this -- we should only
- // roll over if the new file will be different from the old
- String dateFormat = sdf.format(now);
- if (scheduledFilename.equals(fileName + dateFormat))
- {
- errorHandler.error("Compare " + scheduledFilename + " : " + fileName + dateFormat);
-
- return;
- }
-
- // close current file, and rename it to datedFilename
- this.closeFile();
-
- // we may have to roll over a large number of backups here
- String from, to;
- for (int i = 1; i <= curSizeRollBackups; i++)
- {
- from = fileName + '.' + i;
- to = scheduledFilename + '.' + i;
- rollFile(from, to, false);
- }
-
- rollFile(fileName, scheduledFilename, compress);
- }
- else
- {
- if (compress)
- {
- compress(fileName);
- }
- }
-
- try
- {
- // This will also close the file. This is OK since multiple
- // close operations are safe.
- curSizeRollBackups = 0; // We're cleared out the old date and are ready for the new
-
- // new scheduled name
- scheduledFilename = fileName + sdf.format(now);
- this.setFile(baseFileName, false);
- }
- catch (IOException e)
- {
- errorHandler.error("setFile(" + fileName + ", false) call failed.");
- }
-
- }
-
- /**
- * Renames file <code>from</code> to file <code>to</code>. It also checks for existence of target file and deletes
- * if it does.
- */
- protected void rollFile(String from, String to, boolean compress)
- {
- if (from.equals(to))
- {
- if (compress)
- {
- LogLog.debug("Attempting to compress file with same output name.");
- }
-
- return;
- }
-
- File target = new File(to);
- if (target.exists())
- {
- LogLog.debug("deleting existing target file: " + target);
- target.delete();
- }
-
- File file = new File(from);
- if (compress)
- {
- compress(file, target);
- }
- else
- {
- if (!file.getPath().equals(target.getPath()))
- {
- file.renameTo(target);
- }
- }
-
- LogLog.debug(from + " -> " + to);
- }
-
- protected void compress(String file)
- {
- File f = new File(file);
- compress(f, f);
- }
-
- private void compress(File from, File target)
- {
- if (compressAsync)
- {
- synchronized (_compress)
- {
- _compress.offer(new CompressJob(from, target));
- }
-
- startCompression();
- }
- else
- {
- doCompress(from, target);
- }
- }
-
- private void startCompression()
- {
- if (_compressing.compareAndSet(false, true))
- {
- executor.execute(compressor);
- }
- }
-
- /** Delete's the specified file if it exists */
- protected static void deleteFile(String fileName)
- {
- File file = new File(fileName);
- if (file.exists())
- {
- file.delete();
- }
- }
-
- /**
- * Implements roll overs base on file size.
- *
- * <p>If the maximum number of size based backups is reached (<code>curSizeRollBackups == maxSizeRollBackups</code)
- * then the oldest file is deleted -- it's index determined by the sign of countDirection.<br> If
- * <code>countDirection</code> < 0, then files {<code>File.1</code>, ..., <code>File.curSizeRollBackups -1</code>}
- * are renamed to {<code>File.2</code>, ..., <code>File.curSizeRollBackups</code>}. Moreover, <code>File</code> is
- * renamed <code>File.1</code> and closed.<br>
- *
- * A new file is created to receive further log output.
- *
- * <p>If <code>maxSizeRollBackups</code> is equal to zero, then the <code>File</code> is truncated with no backup
- * files created.
- *
- * <p>If <code>maxSizeRollBackups</code> < 0, then <code>File</code> is renamed if needed and no files are deleted.
- */
-
- // synchronization not necessary since doAppend is alreasy synched
- protected void rollOverSize()
- {
- File file;
-
- this.closeFile(); // keep windows happy.
-
- LogLog.debug("rolling over count=" + ((CountingQuietWriter) qw).getCount());
- LogLog.debug("maxSizeRollBackups = " + maxSizeRollBackups);
- LogLog.debug("curSizeRollBackups = " + curSizeRollBackups);
- LogLog.debug("countDirection = " + countDirection);
-
- // If maxBackups <= 0, then there is no file renaming to be done.
- if (maxSizeRollBackups != 0)
- {
-
- if (countDirection < 0)
- {
- // Delete the oldest file, to keep Windows happy.
- if (curSizeRollBackups == maxSizeRollBackups)
- {
- deleteFile(fileName + '.' + maxSizeRollBackups);
- curSizeRollBackups--;
- }
-
- // Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
- for (int i = curSizeRollBackups; i >= 1; i--)
- {
- rollFile((fileName + "." + i), (fileName + '.' + (i + 1)), false);
- }
-
- curSizeRollBackups++;
- // Rename fileName to fileName.1
- rollFile(fileName, fileName + ".1", compress);
-
- } // REMOVE This code branching for Alexander Cerna's request
- else if (countDirection == 0)
- {
- // rollFile based on date pattern
- curSizeRollBackups++;
- now.setTime(System.currentTimeMillis());
- scheduledFilename = fileName + sdf.format(now);
- rollFile(fileName, scheduledFilename, compress);
- }
- else
- { // countDirection > 0
- if ((curSizeRollBackups >= maxSizeRollBackups) && (maxSizeRollBackups > 0))
- {
- // delete the first and keep counting up.
- int oldestFileIndex = curSizeRollBackups - maxSizeRollBackups + 1;
- deleteFile(fileName + '.' + oldestFileIndex);
- }
-
- if (staticLogFileName)
- {
- curSizeRollBackups++;
- rollFile(fileName, fileName + '.' + curSizeRollBackups, compress);
- }
- else
- {
- if (compress)
- {
- compress(fileName);
- }
- }
- }
- }
-
- try
- {
- // This will also close the file. This is OK since multiple
- // close operations are safe.
- this.setFile(baseFileName, false);
- }
- catch (IOException e)
- {
- LogLog.error("setFile(" + fileName + ", false) call failed.", e);
- }
- }
-
- protected synchronized void doCompress(File from, File to)
- {
- String toFile;
- if (backupFilesToPath == null)
- {
- toFile = to.getPath() + ".gz";
- }
- else
- {
- toFile = backupFilesToPath + System.getProperty("file.separator") + to.getName() + ".gz";
- }
-
- File target = new File(toFile);
- if (target.exists())
- {
- LogLog.debug("deleting existing target file: " + target);
- target.delete();
- }
-
- try
- {
- // Create the GZIP output stream
- GZIPOutputStream out = new GZIPOutputStream(new FileOutputStream(target));
-
- // Open the input file
- FileInputStream in = new FileInputStream(from);
-
- // Transfer bytes from the input file to the GZIP output stream
- byte[] buf = new byte[1024];
- int len;
- while ((len = in.read(buf)) > 0)
- {
- out.write(buf, 0, len);
- }
-
- in.close();
-
- // Complete the GZIP file
- out.finish();
- out.close();
- // Remove old file.
- from.delete();
- }
- catch (IOException e)
- {
- if (target.exists())
- {
- target.delete();
- }
-
- rollFile(from.getPath(), to.getPath(), false);
- }
- }
-
- private class CompressJob
- {
- File _from, _to;
-
- CompressJob(File from, File to)
- {
- _from = from;
- _to = to;
- }
-
- File getFrom()
- {
- return _from;
- }
-
- File getTo()
- {
- return _to;
- }
- }
-
- Compressor compressor = null;
-
- Executor executor;
-
- private class Compressor implements Runnable
- {
- public void run()
- {
- boolean running = true;
- while (running)
- {
- CompressJob job = _compress.poll();
-
- doCompress(job.getFrom(), job.getTo());
-
- synchronized (_compress)
- {
- if (_compress.isEmpty())
- {
- running = false;
- _compressing.set(false);
- }
- }
- }
-
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/configuration/Configuration.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/configuration/Configuration.java
deleted file mode 100644
index 40ff590a0a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/configuration/Configuration.java
+++ /dev/null
@@ -1,188 +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.
- *
- */
-package org.apache.qpid.configuration;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.PosixParser;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-
-public class Configuration
-{
- public static final String QPID_HOME = "QPID_HOME";
-
- final String QPIDHOME = System.getProperty(QPID_HOME);
-
- private static Logger _devlog = LoggerFactory.getLogger(Configuration.class);
-
- public static final String DEFAULT_LOG_CONFIG_FILENAME = "log4j.xml";
- public static final String DEFAULT_CONFIG_FILE = "etc/config.xml";
-
- protected final Options _options = new Options();
- protected CommandLine _commandLine;
- protected File _configFile;
-
-
- public Configuration()
- {
-
- }
-
- public void processCommandline(String[] args) throws InitException
- {
- try
- {
- _commandLine = new PosixParser().parse(_options, args);
- }
- catch (ParseException e)
- {
- throw new InitException("Unable to parse commmandline", e);
- }
-
- final File defaultConfigFile = new File(QPIDHOME, DEFAULT_CONFIG_FILE);
- setConfig(new File(_commandLine.getOptionValue("c", defaultConfigFile.getPath())));
- }
-
- public void setConfig(File file)
- {
- _configFile = file;
- }
-
- /**
- * @param option The option to set.
- */
- public void setOption(Option option)
- {
- _options.addOption(option);
- }
-
- /**
- * getOptionValue from the configuration
- * @param option variable argument, first string is option to get, second if present is the default value.
- * @return the String for the given option or null if not present (if default value not specified)
- */
- public String getOptionValue(String... option)
- {
- if (option.length == 1)
- {
- return _commandLine.getOptionValue(option[0]);
- }
- else if (option.length == 2)
- {
- return _commandLine.getOptionValue(option[0], option[1]);
- }
- return null;
- }
-
- public void loadConfig(File file) throws InitException
- {
- setConfig(file);
- loadConfig();
- }
-
- private void loadConfig() throws InitException
- {
- if (!_configFile.exists())
- {
- String error = "File " + _configFile + " could not be found. Check the file exists and is readable.";
-
- if (QPIDHOME == null)
- {
- error = error + "\nNote: " + QPID_HOME + " is not set.";
- }
-
- throw new InitException(error, null);
- }
- else
- {
- _devlog.debug("Using configuration file " + _configFile.getAbsolutePath());
- }
-
-// String logConfig = _commandLine.getOptionValue("l");
-// String logWatchConfig = _commandLine.getOptionValue("w", "0");
-// if (logConfig != null)
-// {
-// File logConfigFile = new File(logConfig);
-// configureLogging(logConfigFile, logWatchConfig);
-// }
-// else
-// {
-// File configFileDirectory = _configFile.getParentFile();
-// File logConfigFile = new File(configFileDirectory, DEFAULT_LOG_CONFIG_FILENAME);
-// configureLogging(logConfigFile, logWatchConfig);
-// }
- }
-
-
-// private void configureLogging(File logConfigFile, String logWatchConfig)
-// {
-// int logWatchTime = 0;
-// try
-// {
-// logWatchTime = Integer.parseInt(logWatchConfig);
-// }
-// catch (NumberFormatException e)
-// {
-// _devlog.error("Log watch configuration value of " + logWatchConfig + " is invalid. Must be "
-// + "a non-negative integer. Using default of zero (no watching configured");
-// }
-//
-// if (logConfigFile.exists() && logConfigFile.canRead())
-// {
-// _devlog.info("Configuring logger using configuration file " + logConfigFile.getAbsolutePath());
-// if (logWatchTime > 0)
-// {
-// _devlog.info("log file " + logConfigFile.getAbsolutePath() + " will be checked for changes every "
-// + logWatchTime + " seconds");
-// // log4j expects the watch interval in milliseconds
-// DOMConfigurator.configureAndWatch(logConfigFile.getAbsolutePath(), logWatchTime * 1000);
-// }
-// else
-// {
-// DOMConfigurator.configure(logConfigFile.getAbsolutePath());
-// }
-// }
-// else
-// {
-// System.err.println("Logging configuration error: unable to read file " + logConfigFile.getAbsolutePath());
-// System.err.println("Using basic log4j configuration");
-// BasicConfigurator.configure();
-// }
-// }
-
- public File getConfigFile()
- {
- return _configFile;
- }
-
-
- public class InitException extends Exception
- {
- InitException(String msg, Throwable cause)
- {
- super(msg, cause);
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
deleted file mode 100644
index fc6057afd2..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
+++ /dev/null
@@ -1,239 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.server;
-
-import javax.management.JMException;
-import javax.management.MBeanException;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-import org.apache.commons.configuration.Configuration;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.configuration.Configurator;
-import org.apache.qpid.server.configuration.VirtualHostConfiguration;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.exchange.ExchangeFactory;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.management.AMQManagedObject;
-import org.apache.qpid.server.management.MBeanConstructor;
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.management.ManagedBroker;
-import org.apache.qpid.server.management.ManagedObject;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-/**
- * This MBean implements the broker management interface and exposes the
- * Broker level management features like creating and deleting exchanges and queue.
- */
-@MBeanDescription("This MBean exposes the broker level management features")
-public class AMQBrokerManagerMBean extends AMQManagedObject implements ManagedBroker
-{
- private final QueueRegistry _queueRegistry;
- private final ExchangeRegistry _exchangeRegistry;
- private final ExchangeFactory _exchangeFactory;
- private final MessageStore _messageStore;
-
- private final VirtualHost.VirtualHostMBean _virtualHostMBean;
-
- @MBeanConstructor("Creates the Broker Manager MBean")
- public AMQBrokerManagerMBean(VirtualHost.VirtualHostMBean virtualHostMBean) throws JMException
- {
- super(ManagedBroker.class, ManagedBroker.TYPE);
-
- _virtualHostMBean = virtualHostMBean;
- VirtualHost virtualHost = virtualHostMBean.getVirtualHost();
-
- _queueRegistry = virtualHost.getQueueRegistry();
- _exchangeRegistry = virtualHost.getExchangeRegistry();
- _messageStore = virtualHost.getMessageStore();
- _exchangeFactory = virtualHost.getExchangeFactory();
- }
-
- public String getObjectInstanceName()
- {
- return _virtualHostMBean.getVirtualHost().getName();
- }
-
- /**
- * Creates new exchange and registers it with the registry.
- *
- * @param exchangeName
- * @param type
- * @param durable
- * @throws JMException
- */
- public void createNewExchange(String exchangeName, String type, boolean durable) throws JMException
- {
- try
- {
- synchronized (_exchangeRegistry)
- {
- Exchange exchange = _exchangeRegistry.getExchange(new AMQShortString(exchangeName));
- if (exchange == null)
- {
- exchange = _exchangeFactory.createExchange(new AMQShortString(exchangeName), new AMQShortString(type),
- durable, false, 0);
- _exchangeRegistry.registerExchange(exchange);
- }
- else
- {
- throw new JMException("The exchange \"" + exchangeName + "\" already exists.");
- }
- }
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex, "Error in creating exchange " + exchangeName);
- }
- }
-
- /**
- * Unregisters the exchange from registry.
- *
- * @param exchangeName
- * @throws JMException
- */
- public void unregisterExchange(String exchangeName) throws JMException
- {
- // TODO
- // Check if the exchange is in use.
- // boolean inUse = false;
- // Check if there are queue-bindings with the exchange and unregister
- // when there are no bindings.
- try
- {
- _exchangeRegistry.unregisterExchange(new AMQShortString(exchangeName), false);
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex, "Error in unregistering exchange " + exchangeName);
- }
- }
-
- /**
- * Creates a new queue and registers it with the registry and puts it
- * in persistance storage if durable queue.
- *
- * @param queueName
- * @param durable
- * @param owner
- * @throws JMException
- */
- public void createNewQueue(String queueName, String owner, boolean durable) throws JMException
- {
- AMQQueue queue = _queueRegistry.getQueue(new AMQShortString(queueName));
- if (queue != null)
- {
- throw new JMException("The queue \"" + queueName + "\" already exists.");
- }
-
- try
- {
- AMQShortString ownerShortString = null;
- if (owner != null)
- {
- ownerShortString = new AMQShortString(owner);
- }
-
- queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString(queueName), durable, ownerShortString, false, getVirtualHost(),
- null);
- if (queue.isDurable() && !queue.isAutoDelete())
- {
- _messageStore.createQueue(queue);
- }
-
- _queueRegistry.registerQueue(queue);
- }
- catch (AMQException ex)
- {
- JMException jme = new JMException(ex.getMessage());
- jme.initCause(ex);
- throw new MBeanException(jme, "Error in creating queue " + queueName);
- }
- }
-
- private VirtualHost getVirtualHost()
- {
- return _virtualHostMBean.getVirtualHost();
- }
-
- /**
- * Deletes the queue from queue registry and persistant storage.
- *
- * @param queueName
- * @throws JMException
- */
- public void deleteQueue(String queueName) throws JMException
- {
- AMQQueue queue = _queueRegistry.getQueue(new AMQShortString(queueName));
- if (queue == null)
- {
- throw new JMException("The Queue " + queueName + " is not a registerd queue.");
- }
-
- try
- {
- queue.delete();
- _messageStore.removeQueue(queue);
-
- }
- catch (AMQException ex)
- {
- JMException jme = new JMException(ex.getMessage());
- jme.initCause(ex);
- throw new MBeanException(jme, "Error in deleting queue " + queueName);
- }
- }
-
- public ManagedObject getParentObject()
- {
- return _virtualHostMBean;
- }
-
- // This will have a single instance for a virtual host, so not having the name property in the ObjectName
- public ObjectName getObjectName() throws MalformedObjectNameException
- {
- return getObjectNameForSingleInstanceMBean();
- }
-} // End of MBean class
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
deleted file mode 100644
index 26ac562fb2..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
+++ /dev/null
@@ -1,913 +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.
- *
- */
-package org.apache.qpid.server;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.ack.UnacknowledgedMessageMap;
-import org.apache.qpid.server.ack.UnacknowledgedMessageMapImpl;
-import org.apache.qpid.server.configuration.Configurator;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.exchange.NoRouteException;
-import org.apache.qpid.server.flow.FlowCreditManager;
-import org.apache.qpid.server.flow.Pre0_10CreditManager;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.IncomingMessage;
-import org.apache.qpid.server.queue.MessageHandleFactory;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.queue.UnauthorizedAccessException;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.subscription.SubscriptionFactoryImpl;
-import org.apache.qpid.server.subscription.ClientDeliveryMethod;
-import org.apache.qpid.server.subscription.RecordDeliveryMethod;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.txn.LocalTransactionalContext;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.server.txn.TransactionalContext;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-public class AMQChannel
-{
- public static final int DEFAULT_PREFETCH = 5000;
-
- private static final Logger _log = Logger.getLogger(AMQChannel.class);
-
- private final int _channelId;
-
-
- private final Pre0_10CreditManager _creditManager = new Pre0_10CreditManager(0l,0l);
-
- /**
- * The delivery tag is unique per channel. This is pre-incremented before putting into the deliver frame so that
- * value of this represents the <b>last</b> tag sent out
- */
- private long _deliveryTag = 0;
-
- /** A channel has a default queue (the last declared) that is used when no queue name is explictily set */
- private AMQQueue _defaultQueue;
-
- /** This tag is unique per subscription to a queue. The server returns this in response to a basic.consume request. */
- private int _consumerTag;
-
- /**
- * The current message - which may be partial in the sense that not all frames have been received yet - which has
- * been received by this channel. As the frames are received the message gets updated and once all frames have been
- * received the message can then be routed.
- */
- private IncomingMessage _currentMessage;
-
- /** Maps from consumer tag to subscription instance. Allows us to unsubscribe from a queue. */
- protected final Map<AMQShortString, Subscription> _tag2SubscriptionMap = new HashMap<AMQShortString, Subscription>();
-
- private final MessageStore _messageStore;
-
- private UnacknowledgedMessageMap _unacknowledgedMessageMap = new UnacknowledgedMessageMapImpl(DEFAULT_PREFETCH);
-
- private final AtomicBoolean _suspended = new AtomicBoolean(false);
-
- private TransactionalContext _txnContext;
-
- /**
- * A context used by the message store enabling it to track context for a given channel even across thread
- * boundaries
- */
- private final StoreContext _storeContext;
-
- private final List<RequiredDeliveryException> _returnMessages = new LinkedList<RequiredDeliveryException>();
-
- private MessageHandleFactory _messageHandleFactory = new MessageHandleFactory();
-
- // Why do we need this reference ? - ritchiem
- private final AMQProtocolSession _session;
- private boolean _closing;
-
- public AMQChannel(AMQProtocolSession session, int channelId, MessageStore messageStore)
- throws AMQException
- {
- //Set values from configuration
- Configurator.configure(this);
-
- _session = session;
- _channelId = channelId;
- _storeContext = new StoreContext("Session: " + session.getClientIdentifier() + "; channel: " + channelId);
-
-
- _messageStore = messageStore;
-
- // by default the session is non-transactional
- _txnContext = new NonTransactionalContext(_messageStore, _storeContext, this, _returnMessages);
- }
-
- /** Sets this channel to be part of a local transaction */
- public void setLocalTransactional()
- {
- _txnContext = new LocalTransactionalContext(this);
- }
-
- public boolean isTransactional()
- {
- // this does not look great but there should only be one "non-transactional"
- // transactional context, while there could be several transactional ones in
- // theory
- return !(_txnContext instanceof NonTransactionalContext);
- }
-
- public int getChannelId()
- {
- return _channelId;
- }
-
- public void setPublishFrame(MessagePublishInfo info, final Exchange e) throws AMQException
- {
-
- _currentMessage = new IncomingMessage(_messageStore.getNewMessageId(), info, _txnContext, _session);
- _currentMessage.setMessageStore(_messageStore);
- _currentMessage.setExchange(e);
- }
-
- public void publishContentHeader(ContentHeaderBody contentHeaderBody)
- throws AMQException
- {
- if (_currentMessage == null)
- {
- throw new AMQException("Received content header without previously receiving a BasicPublish frame");
- }
- else
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Content header received on channel " + _channelId);
- }
-
- _currentMessage.setContentHeaderBody(contentHeaderBody);
-
- _currentMessage.setExpiration();
-
- routeCurrentMessage();
-
- _currentMessage.routingComplete(_messageStore, _messageHandleFactory);
-
- deliverCurrentMessageIfComplete();
-
- }
- }
-
- private void deliverCurrentMessageIfComplete()
- throws AMQException
- {
- // check and deliver if header says body length is zero
- if (_currentMessage.allContentReceived())
- {
- try
- {
- _currentMessage.deliverToQueues();
- }
- catch (NoRouteException e)
- {
- _returnMessages.add(e);
- }
- catch(UnauthorizedAccessException ex)
- {
- _returnMessages.add(ex);
- }
- finally
- {
- // callback to allow the context to do any post message processing
- // primary use is to allow message return processing in the non-tx case
- _txnContext.messageProcessed(_session);
- _currentMessage = null;
- }
- }
-
- }
-
- public void publishContentBody(ContentBody contentBody) throws AMQException
- {
- if (_currentMessage == null)
- {
- throw new AMQException("Received content body without previously receiving a JmsPublishBody");
- }
-
- if (_log.isDebugEnabled())
- {
- _log.debug(debugIdentity() + "Content body received on channel " + _channelId);
- }
-
- try
- {
-
- // returns true iff the message was delivered (i.e. if all data was
- // received
- _currentMessage.addContentBodyFrame(
- _session.getMethodRegistry().getProtocolVersionMethodConverter().convertToContentChunk(
- contentBody));
-
- deliverCurrentMessageIfComplete();
- }
- catch (AMQException e)
- {
- // we want to make sure we don't keep a reference to the message in the
- // event of an error
- _currentMessage = null;
- throw e;
- }
- }
-
- protected void routeCurrentMessage() throws AMQException
- {
- try
- {
- _currentMessage.route();
- }
- catch (NoRouteException e)
- {
- //_currentMessage.incrementReference();
- _returnMessages.add(e);
- }
- }
-
- public long getNextDeliveryTag()
- {
- return ++_deliveryTag;
- }
-
- public int getNextConsumerTag()
- {
- return ++_consumerTag;
- }
-
- /**
- * Subscribe to a queue. We register all subscriptions in the channel so that if the channel is closed we can clean
- * up all subscriptions, even if the client does not explicitly unsubscribe from all queues.
- *
- * @param tag the tag chosen by the client (if null, server will generate one)
- * @param queue the queue to subscribe to
- * @param acks Are acks enabled for this subscriber
- * @param filters Filters to apply to this subscriber
- *
- * @param noLocal Flag stopping own messages being receivied.
- * @param exclusive Flag requesting exclusive access to the queue
- * @return the consumer tag. This is returned to the subscriber and used in subsequent unsubscribe requests
- *
- * @throws ConsumerTagNotUniqueException if the tag is not unique
- * @throws AMQException if something goes wrong
- */
- public AMQShortString subscribeToQueue(AMQShortString tag, AMQQueue queue, boolean acks,
- FieldTable filters, boolean noLocal, boolean exclusive) throws AMQException, ConsumerTagNotUniqueException
- {
- if (tag == null)
- {
- tag = new AMQShortString("sgen_" + getNextConsumerTag());
- }
-
- if (_tag2SubscriptionMap.containsKey(tag))
- {
- throw new ConsumerTagNotUniqueException();
- }
-
- Subscription subscription =
- SubscriptionFactoryImpl.INSTANCE.createSubscription(_channelId, _session, tag, acks, filters, noLocal, _creditManager);
-
-
- // So to keep things straight we put before the call and catch all exceptions from the register and tidy up.
- // We add before we register as the Async Delivery process may AutoClose the subscriber
- // so calling _cT2QM.remove before we have done put which was after the register succeeded.
- // So to keep things straight we put before the call and catch all exceptions from the register and tidy up.
-
- _tag2SubscriptionMap.put(tag, subscription);
-
- try
- {
- queue.registerSubscription(subscription, exclusive);
- }
- catch (AMQException e)
- {
- _tag2SubscriptionMap.remove(tag);
- throw e;
- }
- return tag;
- }
-
- /**
- * Unsubscribe a consumer from a queue.
- * @param consumerTag
- * @return true if the consumerTag had a mapped queue that could be unregistered.
- * @throws AMQException
- */
- public boolean unsubscribeConsumer(AMQShortString consumerTag) throws AMQException
- {
-
- Subscription sub = _tag2SubscriptionMap.remove(consumerTag);
- if (sub != null)
- {
- try
- {
- sub.getSendLock();
- sub.getQueue().unregisterSubscription(sub);
- }
- finally
- {
- sub.releaseSendLock();
- }
- return true;
- }
- else
- {
- _log.warn("Attempt to unsubscribe consumer with tag '"+consumerTag+"' which is not registered.");
- }
- return false;
- }
-
- /**
- * Called from the protocol session to close this channel and clean up. T
- *
- * @throws AMQException if there is an error during closure
- */
- public void close() throws AMQException
- {
- _txnContext.rollback();
- unsubscribeAllConsumers();
- try
- {
- requeue();
- }
- catch (AMQException e)
- {
- _log.error("Caught AMQException whilst attempting to reque:" + e);
- }
-
- setClosing(true);
- }
-
- private void setClosing(boolean closing)
- {
- _closing = closing;
- }
-
- private void unsubscribeAllConsumers() throws AMQException
- {
- if (_log.isInfoEnabled())
- {
- if (!_tag2SubscriptionMap.isEmpty())
- {
- _log.info("Unsubscribing all consumers on channel " + toString());
- }
- else
- {
- _log.info("No consumers to unsubscribe on channel " + toString());
- }
- }
-
- for (Map.Entry<AMQShortString, Subscription> me : _tag2SubscriptionMap.entrySet())
- {
- if (_log.isInfoEnabled())
- {
- _log.info("Unsubscribing consumer '" + me.getKey() + "' on channel " + toString());
- }
-
- Subscription sub = me.getValue();
-
- try
- {
- sub.getSendLock();
- sub.getQueue().unregisterSubscription(sub);
- }
- finally
- {
- sub.releaseSendLock();
- }
-
- }
-
- _tag2SubscriptionMap.clear();
- }
-
- /**
- * Add a message to the channel-based list of unacknowledged messages
- *
- * @param entry the record of the message on the queue that was delivered
- * @param deliveryTag the delivery tag used when delivering the message (see protocol spec for description of the
- * delivery tag)
- * @param subscription The consumer that is to acknowledge this message.
- */
- public void addUnacknowledgedMessage(QueueEntry entry, long deliveryTag, Subscription subscription)
- {
- if (_log.isDebugEnabled())
- {
- if (entry.getQueue() == null)
- {
- _log.debug("Adding unacked message with a null queue:" + entry.debugIdentity());
- }
- else
- {
- if (_log.isDebugEnabled())
- {
- _log.debug(debugIdentity() + " Adding unacked message(" + entry.getMessage().toString() + " DT:" + deliveryTag
- + ") with a queue(" + entry.getQueue() + ") for " + subscription);
- }
- }
- }
-
- _unacknowledgedMessageMap.add(deliveryTag, entry);
-
- }
-
- private final String id = "(" + System.identityHashCode(this) + ")";
-
- public String debugIdentity()
- {
- return _channelId + id;
- }
-
- /**
- * Called to attempt re-delivery all outstanding unacknowledged messages on the channel. May result in delivery to
- * this same channel or to other subscribers.
- *
- * @throws org.apache.qpid.AMQException if the requeue fails
- */
- public void requeue() throws AMQException
- {
- // we must create a new map since all the messages will get a new delivery tag when they are redelivered
- Collection<QueueEntry> messagesToBeDelivered = _unacknowledgedMessageMap.cancelAllMessages();
-
- // Deliver these messages out of the transaction as their delivery was never
- // part of the transaction only the receive.
- TransactionalContext deliveryContext = null;
-
- if (!messagesToBeDelivered.isEmpty())
- {
- if (_log.isInfoEnabled())
- {
- _log.info("Requeuing " + messagesToBeDelivered.size() + " unacked messages. for " + toString());
- }
-
- if (!(_txnContext instanceof NonTransactionalContext))
- {
-
- deliveryContext =
- new NonTransactionalContext(_messageStore, _storeContext, this, _returnMessages);
- }
- else
- {
- deliveryContext = _txnContext;
- }
- }
-
- for (QueueEntry unacked : messagesToBeDelivered)
- {
- if (!unacked.isQueueDeleted())
- {
- // Mark message redelivered
- unacked.getMessage().setRedelivered(true);
-
- // Ensure message is released for redelivery
- unacked.release();
-
- // Deliver Message
- deliveryContext.requeue(unacked);
-
- }
- else
- {
- unacked.discard(_storeContext);
- }
- }
-
- }
-
- /**
- * Requeue a single message
- *
- * @param deliveryTag The message to requeue
- *
- * @throws AMQException If something goes wrong.
- */
- public void requeue(long deliveryTag) throws AMQException
- {
- QueueEntry unacked = _unacknowledgedMessageMap.remove(deliveryTag);
-
- if (unacked != null)
- {
- // Mark message redelivered
- unacked.getMessage().setRedelivered(true);
-
- // Ensure message is released for redelivery
- if (!unacked.isQueueDeleted())
- {
- unacked.release();
- }
-
-
- // Deliver these messages out of the transaction as their delivery was never
- // part of the transaction only the receive.
- TransactionalContext deliveryContext;
- if (!(_txnContext instanceof NonTransactionalContext))
- {
-
- deliveryContext =
- new NonTransactionalContext(_messageStore, _storeContext, this, _returnMessages);
-
- }
- else
- {
- deliveryContext = _txnContext;
- }
-
- if (!unacked.isQueueDeleted())
- {
- // Redeliver the messages to the front of the queue
- deliveryContext.requeue(unacked);
- // Deliver increments the message count but we have already deliverted this once so don't increment it again
- // this was because deliver did an increment changed this.
- }
- else
- {
- _log.warn(System.identityHashCode(this) + " Requested requeue of message(" + unacked.getMessage().debugIdentity()
- + "):" + deliveryTag + " but no queue defined and no DeadLetter queue so DROPPING message.");
-
- unacked.discard(_storeContext);
- }
- }
- else
- {
- _log.warn("Requested requeue of message:" + deliveryTag + " but no such delivery tag exists."
- + _unacknowledgedMessageMap.size());
-
- }
-
- }
-
- /**
- * Called to resend all outstanding unacknowledged messages to this same channel.
- *
- * @param requeue Are the messages to be requeued or dropped.
- *
- * @throws AMQException When something goes wrong.
- */
- public void resend(final boolean requeue) throws AMQException
- {
-
-
- final Map<Long, QueueEntry> msgToRequeue = new LinkedHashMap<Long, QueueEntry>();
- final Map<Long, QueueEntry> msgToResend = new LinkedHashMap<Long, QueueEntry>();
-
- if (_log.isDebugEnabled())
- {
- _log.debug("unacked map Size:" + _unacknowledgedMessageMap.size());
- }
-
- // Process the Unacked-Map.
- // Marking messages who still have a consumer for to be resent
- // and those that don't to be requeued.
- _unacknowledgedMessageMap.visit(new ExtractResendAndRequeue(_unacknowledgedMessageMap, msgToRequeue,
- msgToResend, requeue, _storeContext));
-
-
- // Process Messages to Resend
- if (_log.isDebugEnabled())
- {
- if (!msgToResend.isEmpty())
- {
- _log.debug("Preparing (" + msgToResend.size() + ") message to resend.");
- }
- else
- {
- _log.debug("No message to resend.");
- }
- }
-
- for (Map.Entry<Long, QueueEntry> entry : msgToResend.entrySet())
- {
- QueueEntry message = entry.getValue();
- long deliveryTag = entry.getKey();
-
-
-
- AMQMessage msg = message.getMessage();
- AMQQueue queue = message.getQueue();
-
- // Our Java Client will always suspend the channel when resending!
- // If the client has requested the messages be resent then it is
- // their responsibility to ensure that thay are capable of receiving them
- // i.e. The channel hasn't been server side suspended.
- // if (isSuspended())
- // {
- // _log.info("Channel is suspended so requeuing");
- // //move this message to requeue
- // msgToRequeue.add(message);
- // }
- // else
- // {
- // release to allow it to be delivered
-
- // Without any details from the client about what has been processed we have to mark
- // all messages in the unacked map as redelivered.
- msg.setRedelivered(true);
-
- Subscription sub = message.getDeliveredSubscription();
-
- if (sub != null)
- {
-
- if(!queue.resend(message, sub))
- {
- msgToRequeue.put(deliveryTag, message);
- }
- }
- else
- {
-
- if (_log.isInfoEnabled())
- {
- _log.info("DeliveredSubscription not recorded so just requeueing(" + message.toString()
- + ")to prevent loss");
- }
- // move this message to requeue
- msgToRequeue.put(deliveryTag, message);
- }
- } // for all messages
- // } else !isSuspend
-
- if (_log.isInfoEnabled())
- {
- if (!msgToRequeue.isEmpty())
- {
- _log.info("Preparing (" + msgToRequeue.size() + ") message to requeue to.");
- }
- }
-
- // Deliver these messages out of the transaction as their delivery was never
- // part of the transaction only the receive.
- TransactionalContext deliveryContext;
- if (!(_txnContext instanceof NonTransactionalContext))
- {
-
- deliveryContext =
- new NonTransactionalContext(_messageStore, _storeContext, this, _returnMessages);
- }
- else
- {
- deliveryContext = _txnContext;
- }
-
- // Process Messages to Requeue at the front of the queue
- for (Map.Entry<Long, QueueEntry> entry : msgToRequeue.entrySet())
- {
- QueueEntry message = entry.getValue();
- long deliveryTag = entry.getKey();
-
- message.release();
- message.setRedelivered(true);
-
- deliveryContext.requeue(message);
-
- _unacknowledgedMessageMap.remove(deliveryTag);
- }
- }
-
- /**
- * Callback indicating that a queue has been deleted. We must update the structure of unacknowledged messages to
- * remove the queue reference and also decrement any message reference counts, without actually removing the item
- * since we may get an ack for a delivery tag that was generated from the deleted queue.
- *
- * @param queue the queue that has been deleted
- *
- */
- /* public void queueDeleted(final AMQQueue queue)
- {
- try
- {
- _unacknowledgedMessageMap.visit(new UnacknowledgedMessageMap.Visitor()
- {
- public boolean callback(UnacknowledgedMessage message)
- {
- if (message.getQueue() == queue)
- {
- try
- {
- message.discard(_storeContext);
- message.setQueueDeleted(true);
-
- }
- catch (AMQException e)
- {
- _log.error(
- "Error decrementing ref count on message " + message.getMessage().getMessageId() + ": " + e, e);
- throw new RuntimeException(e);
- }
- }
-
- return false;
- }
-
- public void visitComplete()
- {
- }
- });
- }
- catch (AMQException e)
- {
- _log.error("Unexpected Error while handling deletion of queue", e);
- throw new RuntimeException(e);
- }
-
- }
-*/
- /**
- * Acknowledge one or more messages.
- *
- * @param deliveryTag the last delivery tag
- * @param multiple if true will acknowledge all messages up to an including the delivery tag. if false only
- * acknowledges the single message specified by the delivery tag
- *
- * @throws AMQException if the delivery tag is unknown (e.g. not outstanding) on this channel
- */
- public void acknowledgeMessage(long deliveryTag, boolean multiple) throws AMQException
- {
- _unacknowledgedMessageMap.acknowledgeMessage(deliveryTag, multiple, _txnContext);
- }
-
- /**
- * Used only for testing purposes.
- *
- * @return the map of unacknowledged messages
- */
- public UnacknowledgedMessageMap getUnacknowledgedMessageMap()
- {
- return _unacknowledgedMessageMap;
- }
-
-
- public void setSuspended(boolean suspended)
- {
-
-
- boolean wasSuspended = _suspended.getAndSet(suspended);
- if (wasSuspended != suspended)
- {
- if (wasSuspended)
- {
- // may need to deliver queued messages
- for (Subscription s : _tag2SubscriptionMap.values())
- {
- s.getQueue().deliverAsync(s);
- }
- }
- }
- }
-
- public boolean isSuspended()
- {
- return _suspended.get();
- }
-
- public void commit() throws AMQException
- {
- if (!isTransactional())
- {
- throw new AMQException("Fatal error: commit called on non-transactional channel");
- }
-
- _txnContext.commit();
- }
-
- public void rollback() throws AMQException
- {
- _txnContext.rollback();
- }
-
- public String toString()
- {
- return "["+_session.toString()+":"+_channelId+"]";
- }
-
- public void setDefaultQueue(AMQQueue queue)
- {
- _defaultQueue = queue;
- }
-
- public AMQQueue getDefaultQueue()
- {
- return _defaultQueue;
- }
-
- public StoreContext getStoreContext()
- {
- return _storeContext;
- }
-
- public void processReturns() throws AMQException
- {
- if (!_returnMessages.isEmpty())
- {
- for (RequiredDeliveryException bouncedMessage : _returnMessages)
- {
- AMQMessage message = bouncedMessage.getAMQMessage();
- _session.getProtocolOutputConverter().writeReturn(message, _channelId, bouncedMessage.getReplyCode().getCode(),
- new AMQShortString(bouncedMessage.getMessage()));
-
- message.decrementReference(_storeContext);
- }
-
- _returnMessages.clear();
- }
- }
-
-
- public TransactionalContext getTransactionalContext()
- {
- return _txnContext;
- }
-
- public boolean isClosing()
- {
- return _closing;
- }
-
- public AMQProtocolSession getProtocolSession()
- {
- return _session;
- }
-
- public FlowCreditManager getCreditManager()
- {
- return _creditManager;
- }
-
- public void setCredit(final long prefetchSize, final int prefetchCount)
- {
- _creditManager.setCreditLimits(prefetchSize, prefetchCount);
- }
-
- public List<RequiredDeliveryException> getReturnMessages()
- {
- return _returnMessages;
- }
-
- public MessageStore getMessageStore()
- {
- return _messageStore;
- }
-
- private final ClientDeliveryMethod _clientDeliveryMethod = new ClientDeliveryMethod()
- {
-
- public void deliverToClient(final Subscription sub, final QueueEntry entry, final long deliveryTag)
- throws AMQException
- {
- getProtocolSession().getProtocolOutputConverter().writeDeliver(entry.getMessage(), getChannelId(), deliveryTag, sub.getConsumerTag());
- }
- };
-
- public ClientDeliveryMethod getClientDeliveryMethod()
- {
- return _clientDeliveryMethod;
- }
-
- private final RecordDeliveryMethod _recordDeliveryMethod = new RecordDeliveryMethod()
- {
-
- public void recordMessageDelivery(final Subscription sub, final QueueEntry entry, final long deliveryTag)
- {
- addUnacknowledgedMessage(entry, deliveryTag, sub);
- }
- };
-
- public RecordDeliveryMethod getRecordDeliveryMethod()
- {
- return _recordDeliveryMethod;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ConsumerTagNotUniqueException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ConsumerTagNotUniqueException.java
deleted file mode 100644
index 9a98af5689..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ConsumerTagNotUniqueException.java
+++ /dev/null
@@ -1,25 +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.
- *
- */
-package org.apache.qpid.server;
-
-public class ConsumerTagNotUniqueException extends Exception
-{
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ExtractResendAndRequeue.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ExtractResendAndRequeue.java
deleted file mode 100644
index 29494c4118..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ExtractResendAndRequeue.java
+++ /dev/null
@@ -1,108 +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.
- *
- */
-package org.apache.qpid.server;
-
-import org.apache.qpid.server.ack.UnacknowledgedMessageMap;
-import org.apache.qpid.server.ack.UnacknowledgedMessageMapImpl;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.AMQException;
-import org.apache.log4j.Logger;
-
-import java.util.Map;
-
-public class ExtractResendAndRequeue implements UnacknowledgedMessageMap.Visitor
-{
- private static final Logger _log = Logger.getLogger(ExtractResendAndRequeue.class);
-
- private Map<Long, QueueEntry> _msgToRequeue;
- private Map<Long, QueueEntry> _msgToResend;
- private boolean _requeueIfUnabletoResend;
- private StoreContext _storeContext;
- private UnacknowledgedMessageMap _unacknowledgedMessageMap;
-
- public ExtractResendAndRequeue(UnacknowledgedMessageMap unacknowledgedMessageMap,
- Map<Long, QueueEntry> msgToRequeue,
- Map<Long, QueueEntry> msgToResend,
- boolean requeueIfUnabletoResend,
- StoreContext storeContext)
- {
- _unacknowledgedMessageMap = unacknowledgedMessageMap;
- _msgToRequeue = msgToRequeue;
- _msgToResend = msgToResend;
- _requeueIfUnabletoResend = requeueIfUnabletoResend;
- _storeContext = storeContext;
- }
-
- public boolean callback(final long deliveryTag, QueueEntry message) throws AMQException
- {
-
- AMQMessage msg = message.getMessage();
- msg.setRedelivered(true);
- final Subscription subscription = message.getDeliveredSubscription();
- if (subscription != null)
- {
- // Consumer exists
- if (!subscription.isClosed())
- {
- _msgToResend.put(deliveryTag, message);
- }
- else // consumer has gone
- {
- _msgToRequeue.put(deliveryTag, message);
- }
- }
- else
- {
- // Message has no consumer tag, so was "delivered" to a GET
- // or consumer no longer registered
- // cannot resend, so re-queue.
- if (!message.isQueueDeleted())
- {
- if (_requeueIfUnabletoResend)
- {
- _msgToRequeue.put(deliveryTag, message);
- }
- else
- {
- message.discard(_storeContext);
- _log.info("No DeadLetter Queue and requeue not requested so dropping message:" + message);
- }
- }
- else
- {
- message.discard(_storeContext);
- _log.warn("Message.queue is null and no DeadLetter Queue so dropping message:" + message);
- }
- }
-
- // false means continue processing
- return false;
- }
-
- public void visitComplete()
- {
- _unacknowledgedMessageMap.clear();
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java
deleted file mode 100644
index f3b54034e7..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/Main.java
+++ /dev/null
@@ -1,554 +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.
- *
- */
-package org.apache.qpid.server;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.PosixParser;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.log4j.BasicConfigurator;
-import org.apache.log4j.Logger;
-import org.apache.log4j.xml.DOMConfigurator;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoAcceptor;
-import org.apache.mina.common.FixedSizeByteBufferAllocator;
-import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
-import org.apache.mina.transport.socket.nio.SocketSessionConfig;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.common.QpidProperties;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.pool.ReadWriteThreadModel;
-import org.apache.qpid.server.configuration.VirtualHostConfiguration;
-import org.apache.qpid.server.management.JMXManagedObjectRegistry;
-import org.apache.qpid.server.protocol.AMQPFastProtocolHandler;
-import org.apache.qpid.server.protocol.AMQPProtocolProvider;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
-import org.apache.qpid.server.transport.ConnectorConfiguration;
-import org.apache.qpid.url.URLSyntaxException;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.BindException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * Main entry point for AMQPD.
- *
- */
-@SuppressWarnings({"AccessStaticViaInstance"})
-public class Main
-{
- private static final Logger _logger = Logger.getLogger(Main.class);
- public static final Logger _brokerLogger = Logger.getLogger("Qpid.Broker");
-
- private static final String DEFAULT_CONFIG_FILE = "etc/config.xml";
-
- private static final String DEFAULT_LOG_CONFIG_FILENAME = "log4j.xml";
- public static final String QPID_HOME = "QPID_HOME";
- private static final int IPV4_ADDRESS_LENGTH = 4;
-
- private static final char IPV4_LITERAL_SEPARATOR = '.';
-
- protected static class InitException extends Exception
- {
- InitException(String msg, Throwable cause)
- {
- super(msg, cause);
- }
- }
-
- protected final Options options = new Options();
- protected CommandLine commandLine;
-
- protected Main(String[] args)
- {
- setOptions(options);
- if (parseCommandline(args))
- {
- execute();
- }
- }
-
- protected boolean parseCommandline(String[] args)
- {
- try
- {
- commandLine = new PosixParser().parse(options, args);
-
- return true;
- }
- catch (ParseException e)
- {
- System.err.println("Error: " + e.getMessage());
- HelpFormatter formatter = new HelpFormatter();
- formatter.printHelp("Qpid", options, true);
-
- return false;
- }
- }
-
- protected void setOptions(Options options)
- {
- Option help = new Option("h", "help", false, "print this message");
- Option version = new Option("v", "version", false, "print the version information and exit");
- Option configFile =
- OptionBuilder.withArgName("file").hasArg().withDescription("use given configuration file").withLongOpt("config")
- .create("c");
- Option port =
- OptionBuilder.withArgName("port").hasArg()
- .withDescription("listen on the specified port. Overrides any value in the config file")
- .withLongOpt("port").create("p");
- Option mport =
- OptionBuilder.withArgName("mport").hasArg()
- .withDescription("listen on the specified management port. Overrides any value in the config file")
- .withLongOpt("mport").create("m");
-
-
- Option bind =
- OptionBuilder.withArgName("bind").hasArg()
- .withDescription("bind to the specified address. Overrides any value in the config file")
- .withLongOpt("bind").create("b");
- Option logconfig =
- OptionBuilder.withArgName("logconfig").hasArg()
- .withDescription("use the specified log4j xml configuration file. By "
- + "default looks for a file named " + DEFAULT_LOG_CONFIG_FILENAME
- + " in the same directory as the configuration file").withLongOpt("logconfig").create("l");
- Option logwatchconfig =
- OptionBuilder.withArgName("logwatch").hasArg()
- .withDescription("monitor the log file configuration file for changes. Units are seconds. "
- + "Zero means do not check for changes.").withLongOpt("logwatch").create("w");
-
- options.addOption(help);
- options.addOption(version);
- options.addOption(configFile);
- options.addOption(logconfig);
- options.addOption(logwatchconfig);
- options.addOption(port);
- options.addOption(mport);
- options.addOption(bind);
- }
-
- protected void execute()
- {
- // note this understands either --help or -h. If an option only has a long name you can use that but if
- // an option has a short name and a long name you must use the short name here.
- if (commandLine.hasOption("h"))
- {
- HelpFormatter formatter = new HelpFormatter();
- formatter.printHelp("Qpid", options, true);
- }
- else if (commandLine.hasOption("v"))
- {
- String ver = QpidProperties.getVersionString();
-
- StringBuilder protocol = new StringBuilder("AMQP version(s) [major.minor]: ");
-
- boolean first = true;
- for (ProtocolVersion pv : ProtocolVersion.getSupportedProtocolVersions())
- {
- if (first)
- {
- first = false;
- }
- else
- {
- protocol.append(", ");
- }
-
- protocol.append(pv.getMajorVersion()).append('-').append(pv.getMinorVersion());
-
- }
-
- System.out.println(ver + " (" + protocol + ")");
- }
- else
- {
- try
- {
- startup();
- }
- catch (InitException e)
- {
- System.out.println(e.getMessage());
- _brokerLogger.error("Initialisation Error : " + e.getMessage());
- shutdown(1);
- }
- catch (ConfigurationException e)
- {
- System.out.println("Error configuring message broker: " + e);
- _brokerLogger.error("Error configuring message broker: " + e);
- e.printStackTrace();
- shutdown(1);
- }
- catch (Throwable e)
- {
- System.out.println("Error initialising message broker: " + e);
- _brokerLogger.error("Error initialising message broker: " + e);
- e.printStackTrace();
- shutdown(1);
- }
- }
- }
-
- protected void shutdown(int status)
- {
- ApplicationRegistry.removeAll();
- System.exit(status);
- }
-
- protected void startup() throws InitException, ConfigurationException, Exception
- {
- final String QpidHome = System.getProperty(QPID_HOME);
- final File defaultConfigFile = new File(QpidHome, DEFAULT_CONFIG_FILE);
- final File configFile = new File(commandLine.getOptionValue("c", defaultConfigFile.getPath()));
- if (!configFile.exists())
- {
- String error = "File " + configFile + " could not be found. Check the file exists and is readable.";
-
- if (QpidHome == null)
- {
- error = error + "\nNote: " + QPID_HOME + " is not set.";
- }
-
- throw new InitException(error, null);
- }
- else
- {
- System.out.println("Using configuration file " + configFile.getAbsolutePath());
- }
-
- String logConfig = commandLine.getOptionValue("l");
- String logWatchConfig = commandLine.getOptionValue("w", "0");
- if (logConfig != null)
- {
- File logConfigFile = new File(logConfig);
- configureLogging(logConfigFile, logWatchConfig);
- }
- else
- {
- File configFileDirectory = configFile.getParentFile();
- File logConfigFile = new File(configFileDirectory, DEFAULT_LOG_CONFIG_FILENAME);
- configureLogging(logConfigFile, logWatchConfig);
- }
-
- ConfigurationFileApplicationRegistry config = new ConfigurationFileApplicationRegistry(configFile);
-
-
- updateManagementPort(config.getConfiguration(), commandLine.getOptionValue("m"));
-
-
-
- ApplicationRegistry.initialise(config);
-
-
- //fixme .. use QpidProperties.getVersionString when we have fixed the classpath issues
- // that are causing the broker build to pick up the wrong properties file and hence say
- // Starting Qpid Client
- _brokerLogger.info("Starting Qpid Broker " + QpidProperties.getReleaseVersion()
- + " build: " + QpidProperties.getBuildVersion());
-
- ConnectorConfiguration connectorConfig =
- ApplicationRegistry.getInstance().getConfiguredObject(ConnectorConfiguration.class);
-
- ByteBuffer.setUseDirectBuffers(connectorConfig.enableDirectBuffers);
-
- // the MINA default is currently to use the pooled allocator although this may change in future
- // once more testing of the performance of the simple allocator has been done
- if (!connectorConfig.enablePooledAllocator)
- {
- ByteBuffer.setAllocator(new FixedSizeByteBufferAllocator());
- }
-
-
- if(connectorConfig.useBiasedWrites)
- {
- System.setProperty("org.apache.qpid.use_write_biased_pool","true");
- }
-
- int port = connectorConfig.port;
-
- String portStr = commandLine.getOptionValue("p");
- if (portStr != null)
- {
- try
- {
- port = Integer.parseInt(portStr);
- }
- catch (NumberFormatException e)
- {
- throw new InitException("Invalid port: " + portStr, e);
- }
- }
-
- String VIRTUAL_HOSTS = "virtualhosts";
-
- Object virtualHosts = ApplicationRegistry.getInstance().getConfiguration().getProperty(VIRTUAL_HOSTS);
-
- if (virtualHosts != null)
- {
- if (virtualHosts instanceof Collection)
- {
- int totalVHosts = ((Collection) virtualHosts).size();
- for (int vhost = 0; vhost < totalVHosts; vhost++)
- {
- setupVirtualHosts(configFile.getParent(), (String) ((List) virtualHosts).get(vhost));
- }
- }
- else
- {
- setupVirtualHosts(configFile.getParent(), (String) virtualHosts);
- }
- }
-
- bind(port, connectorConfig);
-
- }
-
- /**
- * Update the configuration data with the management port.
- * @param configuration
- * @param managementPort The string from the command line
- */
- private void updateManagementPort(Configuration configuration, String managementPort)
- {
- if (managementPort != null)
- {
- int mport;
- int defaultMPort = configuration.getInt(JMXManagedObjectRegistry.MANAGEMENT_PORT_CONFIG_PATH);
- try
- {
- mport = Integer.parseInt(managementPort);
- configuration.setProperty(JMXManagedObjectRegistry.MANAGEMENT_PORT_CONFIG_PATH, mport);
- }
- catch (NumberFormatException e)
- {
- _logger.warn("Invalid management port: " + managementPort + " will use default:" + defaultMPort, e);
- }
- }
- }
-
- protected void setupVirtualHosts(String configFileParent, String configFilePath)
- throws ConfigurationException, AMQException, URLSyntaxException
- {
- String configVar = "${conf}";
-
- if (configFilePath.startsWith(configVar))
- {
- configFilePath = configFileParent + configFilePath.substring(configVar.length());
- }
-
- if (configFilePath.indexOf(".xml") != -1)
- {
- VirtualHostConfiguration vHostConfig = new VirtualHostConfiguration(configFilePath);
- vHostConfig.performBindings();
- }
- else
- {
- // the virtualhosts value is a path. Search it for XML files.
-
- File virtualHostDir = new File(configFilePath);
-
- String[] fileNames = virtualHostDir.list();
-
- for (int each = 0; each < fileNames.length; each++)
- {
- if (fileNames[each].endsWith(".xml"))
- {
- VirtualHostConfiguration vHostConfig =
- new VirtualHostConfiguration(configFilePath + "/" + fileNames[each]);
- vHostConfig.performBindings();
- }
- }
- }
- }
-
- protected void bind(int port, ConnectorConfiguration connectorConfig) throws BindException
- {
- String bindAddr = commandLine.getOptionValue("b");
- if (bindAddr == null)
- {
- bindAddr = connectorConfig.bindAddress;
- }
-
- try
- {
- // IoAcceptor acceptor = new SocketAcceptor(connectorConfig.processors);
- IoAcceptor acceptor = connectorConfig.createAcceptor();
- SocketAcceptorConfig sconfig = (SocketAcceptorConfig) acceptor.getDefaultConfig();
- SocketSessionConfig sc = (SocketSessionConfig) sconfig.getSessionConfig();
-
- sc.setReceiveBufferSize(connectorConfig.socketReceiveBufferSize);
- sc.setSendBufferSize(connectorConfig.socketWriteBuferSize);
- sc.setTcpNoDelay(connectorConfig.tcpNoDelay);
-
- // if we do not use the executor pool threading model we get the default leader follower
- // implementation provided by MINA
- if (connectorConfig.enableExecutorPool)
- {
- sconfig.setThreadModel(ReadWriteThreadModel.getInstance());
- }
-
- if (!connectorConfig.enableSSL || !connectorConfig.sslOnly)
- {
- AMQPFastProtocolHandler handler = new AMQPProtocolProvider().getHandler();
- InetSocketAddress bindAddress;
- if (bindAddr.equals("wildcard"))
- {
- bindAddress = new InetSocketAddress(port);
- }
- else
- {
- bindAddress = new InetSocketAddress(InetAddress.getByAddress(parseIP(bindAddr)), port);
- }
-
- bind(acceptor, bindAddress, handler, sconfig);
-
- //fixme qpid.AMQP should be using qpidproperties to get value
- _brokerLogger.info("Qpid.AMQP listening on non-SSL address " + bindAddress);
- }
-
- if (connectorConfig.enableSSL)
- {
- AMQPFastProtocolHandler handler = new AMQPProtocolProvider().getHandler();
- try
- {
-
- bind(acceptor, new InetSocketAddress(connectorConfig.sslPort), handler, sconfig);
-
- //fixme qpid.AMQP should be using qpidproperties to get value
- _brokerLogger.info("Qpid.AMQP listening on SSL port " + connectorConfig.sslPort);
-
- }
- catch (IOException e)
- {
- _brokerLogger.error("Unable to listen on SSL port: " + e, e);
- }
- }
-
- //fixme qpid.AMQP should be using qpidproperties to get value
- _brokerLogger.info("Qpid Broker Ready :" + QpidProperties.getReleaseVersion()
- + " build: " + QpidProperties.getBuildVersion());
- }
- catch (Exception e)
- {
- _logger.error("Unable to bind service to registry: " + e, e);
- //fixme this need tidying up
- throw new BindException(e.getMessage());
- }
- }
-
- /**
- * Ensure that any bound Acceptors are recorded in the registry so they can be closed later.
- *
- * @param acceptor
- * @param bindAddress
- * @param handler
- * @param sconfig
- *
- * @throws IOException from the acceptor.bind command
- */
- private void bind(IoAcceptor acceptor, InetSocketAddress bindAddress, AMQPFastProtocolHandler handler, SocketAcceptorConfig sconfig) throws IOException
- {
- acceptor.bind(bindAddress, handler, sconfig);
-
- ApplicationRegistry.getInstance().addAcceptor(bindAddress, acceptor);
- }
-
- public static void main(String[] args)
- {
-
- new Main(args);
- }
-
- private byte[] parseIP(String address) throws Exception
- {
- char[] literalBuffer = address.toCharArray();
- int byteCount = 0;
- int currByte = 0;
- byte[] ip = new byte[IPV4_ADDRESS_LENGTH];
- for (int i = 0; i < literalBuffer.length; i++)
- {
- char currChar = literalBuffer[i];
- if ((currChar >= '0') && (currChar <= '9'))
- {
- currByte = (currByte * 10) + (Character.digit(currChar, 10) & 0xFF);
- }
-
- if (currChar == IPV4_LITERAL_SEPARATOR || (i + 1 == literalBuffer.length))
- {
- ip[byteCount++] = (byte) currByte;
- currByte = 0;
- }
- }
-
- if (byteCount != 4)
- {
- throw new Exception("Invalid IP address: " + address);
- }
- return ip;
- }
-
- private void configureLogging(File logConfigFile, String logWatchConfig)
- {
- int logWatchTime = 0;
- try
- {
- logWatchTime = Integer.parseInt(logWatchConfig);
- }
- catch (NumberFormatException e)
- {
- System.err.println("Log watch configuration value of " + logWatchConfig + " is invalid. Must be "
- + "a non-negative integer. Using default of zero (no watching configured");
- }
-
- if (logConfigFile.exists() && logConfigFile.canRead())
- {
- System.out.println("Configuring logger using configuration file " + logConfigFile.getAbsolutePath());
- if (logWatchTime > 0)
- {
- System.out.println("log file " + logConfigFile.getAbsolutePath() + " will be checked for changes every "
- + logWatchTime + " seconds");
- // log4j expects the watch interval in milliseconds
- DOMConfigurator.configureAndWatch(logConfigFile.getAbsolutePath(), logWatchTime * 1000);
- }
- else
- {
- DOMConfigurator.configure(logConfigFile.getAbsolutePath());
- }
- }
- else
- {
- System.err.println("Logging configuration error: unable to read file " + logConfigFile.getAbsolutePath());
- System.err.println("Using basic log4j configuration");
- BasicConfigurator.configure();
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ManagedChannel.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ManagedChannel.java
deleted file mode 100644
index e76f9c3f6c..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ManagedChannel.java
+++ /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.
- *
- */
-
-package org.apache.qpid.server;
-
-import java.io.IOException;
-
-import javax.management.JMException;
-
-/**
- * The managed interface exposed to allow management of channels.
- * @author Bhupendra Bhardwaj
- * @version 0.1
- */
-public interface ManagedChannel
-{
- static final String TYPE = "Channel";
-
- /**
- * Tells whether the channel is transactional.
- * @return true if the channel is transactional.
- * @throws IOException
- */
- boolean isTransactional() throws IOException;
-
- /**
- * Tells the number of unacknowledged messages in this channel.
- * @return number of unacknowledged messages.
- * @throws IOException
- */
- int getUnacknowledgedMessageCount() throws IOException;
-
-
- //********** Operations *****************//
-
- /**
- * Commits the transactions if the channel is transactional.
- * @throws IOException
- * @throws JMException
- */
- void commitTransactions() throws IOException, JMException;
-
- /**
- * Rollsback the transactions if the channel is transactional.
- * @throws IOException
- * @throws JMException
- */
- void rollbackTransactions() throws IOException, JMException;
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java
deleted file mode 100644
index 3f1947d65a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java
+++ /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.
- *
- */
-package org.apache.qpid.server;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.queue.AMQMessage;
-
-/**
- * Signals that a required delivery could not be made. This could be bacuse of the immediate flag being set and the
- * queue having no consumers, or the mandatory flag being set and the exchange having no valid bindings.
- *
- * <p/>The failed message is associated with this error condition, by taking a reference to it. This enables the
- * correct compensating action to be taken against the message, for example, bouncing it back to the sender.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent failure to deliver a message that must be delivered.
- * <tr><td> Associate the failed message with the error condition. <td> {@link AMQMessage}
- * </table>
- */
-public abstract class RequiredDeliveryException extends AMQException
-{
- private AMQMessage _amqMessage;
-
- public RequiredDeliveryException(String message, AMQMessage payload)
- {
- super(message);
-
- setMessage(payload);
- }
-
-
- public RequiredDeliveryException(String message)
- {
- super(message);
- }
-
- public void setMessage(final AMQMessage payload)
- {
-
- // Increment the reference as this message is in the routing phase
- // and so will have the ref decremented as routing fails.
- // we need to keep this message around so we can return it in the
- // handler. So increment here.
- _amqMessage = payload.takeReference();
-
- }
-
- public AMQMessage getAMQMessage()
- {
- return _amqMessage;
- }
-
- public AMQConstant getErrorCode()
- {
- return getReplyCode();
- }
-
- public abstract AMQConstant getReplyCode();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.java
deleted file mode 100644
index db3a05eb52..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.java
+++ /dev/null
@@ -1,148 +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.
- *
- */
-package org.apache.qpid.server.ack;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.ArrayList;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.txn.TxnOp;
-import org.apache.qpid.server.queue.QueueEntry;
-
-/**
- * A TxnOp implementation for handling accumulated acks
- */
-public class TxAck implements TxnOp
-{
- private final UnacknowledgedMessageMap _map;
- private final Map<Long, QueueEntry> _unacked = new HashMap<Long,QueueEntry>();
- private List<Long> _individual;
- private long _deliveryTag;
- private boolean _multiple;
-
- public TxAck(UnacknowledgedMessageMap map)
- {
- _map = map;
- }
-
- public void update(long deliveryTag, boolean multiple)
- {
- _unacked.clear();
- if (!multiple)
- {
- if(_individual == null)
- {
- _individual = new ArrayList<Long>();
- }
- //have acked a single message that is not part of
- //the previously acked region so record
- //individually
- _individual.add(deliveryTag);//_multiple && !multiple
- }
- else if (deliveryTag > _deliveryTag)
- {
- //have simply moved the last acked message on a
- //bit
- _deliveryTag = deliveryTag;
- _multiple = true;
- }
- }
-
- public void consolidate()
- {
- if(_unacked.isEmpty())
- {
- //lookup all the unacked messages that have been acked in this transaction
- if (_multiple)
- {
- //get all the unacked messages for the accumulated
- //multiple acks
- _map.collect(_deliveryTag, true, _unacked);
- }
- if(_individual != null)
- {
- //get any unacked messages for individual acks outside the
- //range covered by multiple acks
- for (long tag : _individual)
- {
- if(_deliveryTag < tag)
- {
- _map.collect(tag, false, _unacked);
- }
- }
- }
- }
- }
-
- public boolean checkPersistent() throws AMQException
- {
- consolidate();
- //if any of the messages in unacked are persistent the txn
- //buffer must be marked as persistent:
- for (QueueEntry msg : _unacked.values())
- {
- if (msg.getMessage().isPersistent())
- {
- return true;
- }
- }
- return false;
- }
-
- public void prepare(StoreContext storeContext) throws AMQException
- {
- //make persistent changes, i.e. dequeue and decrementReference
- for (QueueEntry msg : _unacked.values())
- {
- //Message has been ack so discard it. This will dequeue and decrement the reference.
- msg.discard(storeContext);
-
- }
- }
-
- public void undoPrepare()
- {
- //decrementReference is annoyingly untransactional (due to
- //in memory counter) so if we failed in prepare for full
- //txn, this op will have to compensate by fixing the count
- //in memory (persistent changes will be rolled back by store)
- for (QueueEntry msg : _unacked.values())
- {
- msg.getMessage().takeReference();
- }
- }
-
- public void commit(StoreContext storeContext)
- {
- //remove the unacked messages from the channels map
- _map.remove(_unacked);
- }
-
- public void rollback(StoreContext storeContext)
- {
- }
-}
-
-
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMap.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMap.java
deleted file mode 100644
index c80a96f967..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMap.java
+++ /dev/null
@@ -1,81 +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.
- *
- */
-package org.apache.qpid.server.ack;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-import java.util.Map;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.txn.TransactionalContext;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.store.StoreContext;
-
-public interface UnacknowledgedMessageMap
-{
- public interface Visitor
- {
- /**
- * @param deliveryTag
- *@param message the message being iterated over @return true to stop iteration, false to continue
- * @throws AMQException
- */
- boolean callback(final long deliveryTag, QueueEntry message) throws AMQException;
-
- void visitComplete();
- }
-
- void visit(Visitor visitor) throws AMQException;
-
- void add(long deliveryTag, QueueEntry message);
-
- void collect(long deliveryTag, boolean multiple, Map<Long, QueueEntry> msgs);
-
- boolean contains(long deliveryTag) throws AMQException;
-
- void remove(Map<Long,QueueEntry> msgs);
-
- QueueEntry remove(long deliveryTag);
-
- public void drainTo(long deliveryTag, StoreContext storeContext) throws AMQException;
-
- Collection<QueueEntry> cancelAllMessages();
-
- void acknowledgeMessage(long deliveryTag, boolean multiple, TransactionalContext txnContext) throws AMQException;
-
- int size();
-
- void clear();
-
- QueueEntry get(long deliveryTag);
-
- /**
- * Get the set of delivery tags that are outstanding.
- *
- * @return a set of delivery tags
- */
- Set<Long> getDeliveryTags();
-
- public long getUnacknowledgeBytes();
-}
-
-
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java
deleted file mode 100644
index c567387662..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java
+++ /dev/null
@@ -1,232 +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.
- *
- */
-package org.apache.qpid.server.ack;
-
-import org.apache.qpid.server.store.StoreContext;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.txn.TransactionalContext;
-
-public class UnacknowledgedMessageMapImpl implements UnacknowledgedMessageMap
-{
- private final Object _lock = new Object();
-
- private long _unackedSize;
-
- private Map<Long, QueueEntry> _map;
-
- private long _lastDeliveryTag;
-
- private final int _prefetchLimit;
-
- public UnacknowledgedMessageMapImpl(int prefetchLimit)
- {
- _prefetchLimit = prefetchLimit;
- _map = new LinkedHashMap<Long, QueueEntry>(prefetchLimit);
- }
-
- public void collect(long deliveryTag, boolean multiple, Map<Long, QueueEntry> msgs)
- {
- if (multiple)
- {
- collect(deliveryTag, msgs);
- }
- else
- {
- msgs.put(deliveryTag, get(deliveryTag));
- }
-
- }
-
- public boolean contains(long deliveryTag) throws AMQException
- {
- synchronized (_lock)
- {
- return _map.containsKey(deliveryTag);
- }
- }
-
- public void remove(Map<Long,QueueEntry> msgs)
- {
- synchronized (_lock)
- {
- for (Long deliveryTag : msgs.keySet())
- {
- remove(deliveryTag);
- }
- }
- }
-
- public QueueEntry remove(long deliveryTag)
- {
- synchronized (_lock)
- {
-
- QueueEntry message = _map.remove(deliveryTag);
- if(message != null)
- {
- _unackedSize -= message.getMessage().getSize();
-
- }
-
- return message;
- }
- }
-
- public void visit(Visitor visitor) throws AMQException
- {
- synchronized (_lock)
- {
- Set<Map.Entry<Long, QueueEntry>> currentEntries = _map.entrySet();
- for (Map.Entry<Long, QueueEntry> entry : currentEntries)
- {
- visitor.callback(entry.getKey().longValue(), entry.getValue());
- }
- visitor.visitComplete();
- }
- }
-
- public void add(long deliveryTag, QueueEntry message)
- {
- synchronized (_lock)
- {
- _map.put(deliveryTag, message);
- _unackedSize += message.getMessage().getSize();
- _lastDeliveryTag = deliveryTag;
- }
- }
-
- public Collection<QueueEntry> cancelAllMessages()
- {
- synchronized (_lock)
- {
- Collection<QueueEntry> currentEntries = _map.values();
- _map = new LinkedHashMap<Long, QueueEntry>(_prefetchLimit);
- _unackedSize = 0l;
- return currentEntries;
- }
- }
-
- public void acknowledgeMessage(long deliveryTag, boolean multiple, TransactionalContext txnContext)
- throws AMQException
- {
- synchronized (_lock)
- {
- txnContext.acknowledgeMessage(deliveryTag, _lastDeliveryTag, multiple, this);
- }
- }
-
- public int size()
- {
- synchronized (_lock)
- {
- return _map.size();
- }
- }
-
- public void clear()
- {
- synchronized (_lock)
- {
- _map.clear();
- _unackedSize = 0l;
- }
- }
-
- public void drainTo(long deliveryTag, StoreContext storeContext) throws AMQException
-
- {
- synchronized (_lock)
- {
- Iterator<Map.Entry<Long, QueueEntry>> it = _map.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry<Long, QueueEntry> unacked = it.next();
-
- if (unacked.getKey() > deliveryTag)
- {
- //This should not occur now.
- throw new AMQException("UnacknowledgedMessageMap is out of order:" + unacked.getKey() +
- " When deliveryTag is:" + deliveryTag + "ES:" + _map.entrySet().toString());
- }
-
- //Message has been ack so discard it. This will dequeue and decrement the reference.
- unacked.getValue().discard(storeContext);
-
- it.remove();
-
- _unackedSize -= unacked.getValue().getMessage().getSize();
-
-
- if (unacked.getKey() == deliveryTag)
- {
- break;
- }
- }
- }
- }
-
- public QueueEntry get(long key)
- {
- synchronized (_lock)
- {
- return _map.get(key);
- }
- }
-
- public Set<Long> getDeliveryTags()
- {
- synchronized (_lock)
- {
- return _map.keySet();
- }
- }
-
- private void collect(long key, Map<Long, QueueEntry> msgs)
- {
- synchronized (_lock)
- {
- for (Map.Entry<Long, QueueEntry> entry : _map.entrySet())
- {
- msgs.put(entry.getKey(),entry.getValue());
- if (entry.getKey() == key)
- {
- break;
- }
- }
- }
- }
-
- public long getUnacknowledgeBytes()
- {
- return _unackedSize;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/Configurator.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/Configurator.java
deleted file mode 100644
index 31c1b61a21..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/Configurator.java
+++ /dev/null
@@ -1,118 +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.
- *
- */
-package org.apache.qpid.server.configuration;
-
-import java.lang.reflect.Field;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.log4j.Logger;
-import org.apache.qpid.configuration.Configured;
-import org.apache.qpid.configuration.PropertyException;
-import org.apache.qpid.configuration.PropertyUtils;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-
-/**
- * This class contains utilities for populating classes automatically from values pulled from configuration
- * files.
- */
-public class Configurator
-{
- private static final Logger _logger = Logger.getLogger(Configurator.class);
-
-
- /**
- * Configure a given instance using the supplied configuration. Note that superclasses are <b>not</b>
- * currently configured but this could easily be added if required.
- * @param instance the instance to configure
- * @param config the configuration to use to configure the object
- */
- public static void configure(Object instance, Configuration config)
- {
-
- for (Field f : instance.getClass().getDeclaredFields())
- {
- Configured annotation = f.getAnnotation(Configured.class);
- if (annotation != null)
- {
- setValueInField(f, instance, config, annotation);
- }
- }
- }
-
-
-
- /**
- * Configure a given instance using the application configuration. Note that superclasses are <b>not</b>
- * currently configured but this could easily be added if required.
- * @param instance the instance to configure
- */
- public static void configure(Object instance)
- {
- configure(instance, ApplicationRegistry.getInstance().getConfiguration());
- }
-
- private static void setValueInField(Field f, Object instance, Configuration config, Configured annotation)
- {
- Class fieldClass = f.getType();
- String configPath = annotation.path();
- try
- {
- if (fieldClass == String.class)
- {
- String val = config.getString(configPath, annotation.defaultValue());
- val = PropertyUtils.replaceProperties(val);
- f.set(instance, val);
- }
- else if (fieldClass == int.class)
- {
- int val = config.getInt(configPath, Integer.parseInt(annotation.defaultValue()));
- f.setInt(instance, val);
- }
- else if (fieldClass == long.class)
- {
- long val = config.getLong(configPath, Long.parseLong(annotation.defaultValue()));
- f.setLong(instance, val);
- }
- else if (fieldClass == double.class)
- {
- double val = config.getDouble(configPath, Double.parseDouble(annotation.defaultValue()));
- f.setDouble(instance, val);
- }
- else if (fieldClass == boolean.class)
- {
- boolean val = config.getBoolean(configPath, Boolean.parseBoolean(annotation.defaultValue()));
- f.setBoolean(instance, val);
- }
- else
- {
- _logger.error("Unsupported field type " + fieldClass + " for " + f + " IGNORING configured value");
- }
- }
- catch (PropertyException e)
- {
- _logger.error("Unable to expand property: " + e + " INGORING field " + f, e);
- }
- catch (IllegalAccessException e)
- {
- _logger.error("Unable to access field " + f + " IGNORING configured value");
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
deleted file mode 100644
index 705e84752b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
+++ /dev/null
@@ -1,286 +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.
- *
- */
-package org.apache.qpid.server.configuration;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.commons.configuration.CompositeConfiguration;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.XMLConfiguration;
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.exchange.ExchangeFactory;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class VirtualHostConfiguration
-{
- private static final Logger _logger = Logger.getLogger(VirtualHostConfiguration.class);
-
- private static XMLConfiguration _config;
-
- private static final String VIRTUALHOST_PROPERTY_BASE = "virtualhost.";
-
-
- public VirtualHostConfiguration(String configFile) throws ConfigurationException
- {
- _logger.info("Loading Config file:" + configFile);
-
- _config = new XMLConfiguration(configFile);
-
- }
-
-
-
- private void configureVirtualHost(String virtualHostName, Configuration configuration) throws ConfigurationException, AMQException
- {
- _logger.debug("Loding configuration for virtaulhost: "+virtualHostName);
-
-
- VirtualHost virtualHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost(virtualHostName);
-
-
-
- if(virtualHost == null)
- {
- throw new ConfigurationException("Unknown virtual host: " + virtualHostName);
- }
-
- List exchangeNames = configuration.getList("exchanges.exchange.name");
-
- for(Object exchangeNameObj : exchangeNames)
- {
- String exchangeName = String.valueOf(exchangeNameObj);
- configureExchange(virtualHost, exchangeName, configuration);
- }
-
-
- List queueNames = configuration.getList("queues.queue.name");
-
- for(Object queueNameObj : queueNames)
- {
- String queueName = String.valueOf(queueNameObj);
- configureQueue(virtualHost, queueName, configuration);
- }
-
- }
-
- private void configureExchange(VirtualHost virtualHost, String exchangeNameString, Configuration configuration) throws AMQException
- {
-
- CompositeConfiguration exchangeConfiguration = new CompositeConfiguration();
-
- exchangeConfiguration.addConfiguration(configuration.subset("exchanges.exchange."+ exchangeNameString));
- exchangeConfiguration.addConfiguration(configuration.subset("exchanges"));
-
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
- MessageStore messageStore = virtualHost.getMessageStore();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
- ExchangeFactory exchangeFactory = virtualHost.getExchangeFactory();
-
- AMQShortString exchangeName = new AMQShortString(exchangeNameString);
-
-
- Exchange exchange;
-
-
-
- synchronized (exchangeRegistry)
- {
- exchange = exchangeRegistry.getExchange(exchangeName);
- if(exchange == null)
- {
-
- AMQShortString type = new AMQShortString(exchangeConfiguration.getString("type","direct"));
- boolean durable = exchangeConfiguration.getBoolean("durable",false);
- boolean autodelete = exchangeConfiguration.getBoolean("autodelete",false);
-
- Exchange newExchange = exchangeFactory.createExchange(exchangeName,type,durable,autodelete,0);
- exchangeRegistry.registerExchange(newExchange);
- }
-
- }
- }
-
- public static CompositeConfiguration getDefaultQueueConfiguration(VirtualHost host)
- {
- CompositeConfiguration queueConfiguration = null;
- if (_config == null)
- return null;
-
- Configuration vHostConfiguration = _config.subset(VIRTUALHOST_PROPERTY_BASE + host.getName());
-
- if (vHostConfiguration == null)
- return null;
-
- Configuration defaultQueueConfiguration = vHostConfiguration.subset("queues");
- if (defaultQueueConfiguration != null)
- {
- queueConfiguration = new CompositeConfiguration();
- queueConfiguration.addConfiguration(defaultQueueConfiguration);
- }
-
- return queueConfiguration;
- }
-
- private void configureQueue(VirtualHost virtualHost, String queueNameString, Configuration configuration) throws AMQException, ConfigurationException
- {
- CompositeConfiguration queueConfiguration = new CompositeConfiguration();
-
- queueConfiguration.addConfiguration(configuration.subset("queues.queue."+ queueNameString));
- queueConfiguration.addConfiguration(configuration.subset("queues"));
-
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
- MessageStore messageStore = virtualHost.getMessageStore();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
-
-
- AMQShortString queueName = new AMQShortString(queueNameString);
-
- AMQQueue queue;
-
- synchronized (queueRegistry)
- {
- queue = queueRegistry.getQueue(queueName);
-
- if (queue == null)
- {
- _logger.info("Creating queue '" + queueName + "' on virtual host " + virtualHost.getName());
-
- boolean durable = queueConfiguration.getBoolean("durable" ,false);
- boolean autodelete = queueConfiguration.getBoolean("autodelete", false);
- String owner = queueConfiguration.getString("owner", null);
- FieldTable arguments = null;
- boolean priority = queueConfiguration.getBoolean("priority", false);
- int priorities = queueConfiguration.getInt("priorities", -1);
- if(priority || priorities > 0)
- {
- if(arguments == null)
- {
- arguments = new FieldTable();
- }
- if (priorities < 0)
- {
- priorities = 10;
- }
- arguments.put(new AMQShortString("x-qpid-priorities"), priorities);
- }
-
-
- queue = AMQQueueFactory.createAMQQueueImpl(queueName,
- durable,
- owner == null ? null : new AMQShortString(owner) /* These queues will have no owner */,
- autodelete /* Therefore autodelete makes no sence */,
- virtualHost,
- arguments,
- queueConfiguration);
-
- if (queue.isDurable())
- {
- messageStore.createQueue(queue);
- }
-
- queueRegistry.registerQueue(queue);
- }
- else
- {
- _logger.info("Queue '" + queueNameString + "' already exists on virtual host "+virtualHost.getName()+", not creating.");
- }
-
- String exchangeName = queueConfiguration.getString("exchange", null);
-
- Exchange exchange = exchangeRegistry.getExchange(exchangeName == null ? null : new AMQShortString(exchangeName));
-
- if(exchange == null)
- {
- exchange = virtualHost.getExchangeRegistry().getDefaultExchange();
- }
-
- if (exchange == null)
- {
- throw new ConfigurationException("Attempt to bind queue to unknown exchange:" + exchangeName);
- }
-
- synchronized (exchange)
- {
- List routingKeys = queueConfiguration.getList("routingKey");
- if(routingKeys == null || routingKeys.isEmpty())
- {
- routingKeys = Collections.singletonList(queue.getName());
- }
-
- for(Object routingKeyNameObj : routingKeys)
- {
- AMQShortString routingKey = new AMQShortString(String.valueOf(routingKeyNameObj));
-
-
- queue.bind(exchange, routingKey, null);
-
-
- _logger.info("Queue '" + queue.getName() + "' bound to exchange:" + exchangeName + " RK:'" + routingKey + "'");
- }
-
- if(exchange != virtualHost.getExchangeRegistry().getDefaultExchange())
- {
- queue.bind(virtualHost.getExchangeRegistry().getDefaultExchange(), queue.getName(), null);
- }
- }
-
- }
- }
-
-
- public void performBindings() throws AMQException, ConfigurationException
- {
- List virtualHostNames = _config.getList(VIRTUALHOST_PROPERTY_BASE + "name");
- String defaultVirtualHostName = _config.getString("default");
- if(defaultVirtualHostName != null)
- {
- ApplicationRegistry.getInstance().getVirtualHostRegistry().setDefaultVirtualHostName(defaultVirtualHostName);
- }
- _logger.info("Configuring " + virtualHostNames == null ? 0 : virtualHostNames.size() + " virtual hosts: " + virtualHostNames);
-
- for(Object nameObject : virtualHostNames)
- {
- String name = String.valueOf(nameObject);
- configureVirtualHost(name, _config.subset(VIRTUALHOST_PROPERTY_BASE + name));
- }
-
- if (virtualHostNames == null || virtualHostNames.isEmpty())
- {
- throw new ConfigurationException(
- "Virtualhost Configuration document does not contain a valid virtualhost.");
- }
- }
-
-
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java
deleted file mode 100644
index d287595e2d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/ConnectionRegistry.java
+++ /dev/null
@@ -1,73 +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.
- *
- */
-package org.apache.qpid.server.connection;
-
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.protocol.AMQMinaProtocolSession;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.qpid.protocol.AMQConstant;
-
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.List;
-
-public class ConnectionRegistry implements IConnectionRegistry
-{
- private List<AMQProtocolSession> _registry = new CopyOnWriteArrayList<AMQProtocolSession>();
-
- private VirtualHost _virtualHost;
-
- public ConnectionRegistry(VirtualHost virtualHost)
- {
- _virtualHost = virtualHost;
- }
-
- public void initialise()
- {
-
- }
-
- /** Close all of the currently open connections. */
- public void close() throws AMQException
- {
- while (!_registry.isEmpty())
- {
- AMQProtocolSession connection = _registry.get(0);
-
- connection.closeConnection(0, new AMQConnectionException(AMQConstant.INTERNAL_ERROR, "Broker is shutting down",
- 0, 0,
- connection.getProtocolOutputConverter().getProtocolMajorVersion(),
- connection.getProtocolOutputConverter().getProtocolMinorVersion(),
- (Throwable) null), true);
- }
- }
-
- public void registerConnection(AMQProtocolSession connnection)
- {
- _registry.add(connnection);
- }
-
- public void deregisterConnection(AMQProtocolSession connnection)
- {
- _registry.remove(connnection);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java
deleted file mode 100644
index d64fde1c20..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/connection/IConnectionRegistry.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.server.connection;
-
-import org.apache.qpid.server.protocol.AMQMinaProtocolSession;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.AMQException;
-
-public interface IConnectionRegistry
-{
-
- public void initialise();
-
- public void close() throws AMQException;
-
- public void registerConnection(AMQProtocolSession connnection);
-
- public void deregisterConnection(AMQProtocolSession connnection);
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
deleted file mode 100644
index 8d24626b73..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
+++ /dev/null
@@ -1,215 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.NotCompliantMBeanException;
-import javax.management.ObjectName;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.TabularType;
-import javax.management.openmbean.TabularDataSupport;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.SimpleType;
-import javax.management.openmbean.ArrayType;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.management.AMQManagedObject;
-import org.apache.qpid.server.management.Managable;
-import org.apache.qpid.server.management.ManagedObject;
-import org.apache.qpid.server.management.ManagedObjectRegistry;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.util.List;
-import java.util.Map;
-
-public abstract class AbstractExchange implements Exchange, Managable
-{
- private AMQShortString _name;
-
-
-
- protected boolean _durable;
- protected String _exchangeType;
- protected int _ticket;
-
- private VirtualHost _virtualHost;
-
- protected ExchangeMBean _exchangeMbean;
-
- /**
- * Whether the exchange is automatically deleted once all queues have detached from it
- */
- protected boolean _autoDelete;
-
- /**
- * Abstract MBean class. This has some of the methods implemented from
- * management intrerface for exchanges. Any implementaion of an
- * Exchange MBean should extend this class.
- */
- protected abstract class ExchangeMBean extends AMQManagedObject implements ManagedExchange
- {
- // open mbean data types for representing exchange bindings
- protected String[] _bindingItemNames;
- protected String[] _bindingItemIndexNames;
- protected OpenType[] _bindingItemTypes;
- protected CompositeType _bindingDataType;
- protected TabularType _bindinglistDataType;
- protected TabularDataSupport _bindingList;
-
- public ExchangeMBean() throws NotCompliantMBeanException
- {
- super(ManagedExchange.class, ManagedExchange.TYPE);
- }
-
- protected void init() throws OpenDataException
- {
- _bindingItemNames = new String[]{"Binding Key", "Queue Names"};
- _bindingItemIndexNames = new String[]{_bindingItemNames[0]};
-
- _bindingItemTypes = new OpenType[2];
- _bindingItemTypes[0] = SimpleType.STRING;
- _bindingItemTypes[1] = new ArrayType(1, SimpleType.STRING);
- _bindingDataType = new CompositeType("Exchange Binding", "Binding key and Queue names",
- _bindingItemNames, _bindingItemNames, _bindingItemTypes);
- _bindinglistDataType = new TabularType("Exchange Bindings", "Exchange Bindings for " + getName(),
- _bindingDataType, _bindingItemIndexNames);
- }
-
- public ManagedObject getParentObject()
- {
- return _virtualHost.getManagedObject();
- }
-
- public String getObjectInstanceName()
- {
- return _name.toString();
- }
-
- public String getName()
- {
- return _name.toString();
- }
-
- public String getExchangeType()
- {
- return _exchangeType;
- }
-
- public Integer getTicketNo()
- {
- return _ticket;
- }
-
- public boolean isDurable()
- {
- return _durable;
- }
-
- public boolean isAutoDelete()
- {
- return _autoDelete;
- }
-
- // Added exchangetype in the object name lets maangement apps to do any customization required
- public ObjectName getObjectName() throws MalformedObjectNameException
- {
- String objNameString = super.getObjectName().toString();
- objNameString = objNameString + ",ExchangeType=" + _exchangeType;
- return new ObjectName(objNameString);
- }
-
- protected ManagedObjectRegistry getManagedObjectRegistry()
- {
- return ApplicationRegistry.getInstance().getManagedObjectRegistry();
- }
- } // End of MBean class
-
- public AMQShortString getName()
- {
- return _name;
- }
-
- /**
- * Concrete exchanges must implement this method in order to create the managed representation. This is
- * called during initialisation (template method pattern).
- * @return the MBean
- */
- protected abstract ExchangeMBean createMBean() throws AMQException;
-
- public void initialise(VirtualHost host, AMQShortString name, boolean durable, int ticket, boolean autoDelete) throws AMQException
- {
- _virtualHost = host;
- _name = name;
- _durable = durable;
- _autoDelete = autoDelete;
- _ticket = ticket;
- _exchangeMbean = createMBean();
- _exchangeMbean.register();
- }
-
- public boolean isDurable()
- {
- return _durable;
- }
-
- public boolean isAutoDelete()
- {
- return _autoDelete;
- }
-
- public int getTicket()
- {
- return _ticket;
- }
-
- public void close() throws AMQException
- {
- if (_exchangeMbean != null)
- {
- _exchangeMbean.unregister();
- }
- }
-
- public String toString()
- {
- return getClass().getName() + "[" + getName() +"]";
- }
-
- public ManagedObject getManagedObject()
- {
- return _exchangeMbean;
- }
-
- public VirtualHost getVirtualHost()
- {
- return _virtualHost;
- }
-
- public QueueRegistry getQueueRegistry()
- {
- return getVirtualHost().getQueueRegistry();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java
deleted file mode 100644
index 9d4c090971..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.apache.commons.configuration.Configuration;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQUnknownExchangeType;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class DefaultExchangeFactory implements ExchangeFactory
-{
- private static final Logger _logger = Logger.getLogger(DefaultExchangeFactory.class);
-
- private Map<AMQShortString, ExchangeType<? extends Exchange>> _exchangeClassMap = new HashMap<AMQShortString, ExchangeType<? extends Exchange>>();
- private final VirtualHost _host;
-
- public DefaultExchangeFactory(VirtualHost host)
- {
- _host = host;
- registerExchangeType(DirectExchange.TYPE);
- registerExchangeType(TopicExchange.TYPE);
- registerExchangeType(HeadersExchange.TYPE);
- registerExchangeType(FanoutExchange.TYPE);
- }
-
- public void registerExchangeType(ExchangeType<? extends Exchange> type)
- {
- _exchangeClassMap.put(type.getName(), type);
- }
-
- public Collection<ExchangeType<? extends Exchange>> getRegisteredTypes()
- {
- return _exchangeClassMap.values();
- }
-
- public Exchange createExchange(AMQShortString exchange, AMQShortString type, boolean durable, boolean autoDelete,
- int ticket)
- throws AMQException
- {
- ExchangeType<? extends Exchange> exchType = _exchangeClassMap.get(type);
- if (exchType == null)
- {
-
- throw new AMQUnknownExchangeType("Unknown exchange type: " + type,null);
- }
- Exchange e = exchType.newInstance(_host, exchange, durable, ticket, autoDelete);
- return e;
- }
-
- public void initialise(Configuration hostConfig)
- {
-
- if (hostConfig == null)
- {
- return;
- }
-
- for(Object className : hostConfig.getList("custom-exchanges.class-name"))
- {
- try
- {
- ExchangeType<?> exchangeType = ApplicationRegistry.getInstance().getPluginManager().getExchanges().get(String.valueOf(className));
- if (exchangeType == null)
- {
- _logger.error("No such custom exchange class found: \""+String.valueOf(className)+"\"");
- return;
- }
- Class<? extends ExchangeType> exchangeTypeClass = exchangeType.getClass();
- ExchangeType type = exchangeTypeClass.newInstance();
- registerExchangeType(type);
- }
- catch (ClassCastException classCastEx)
- {
- _logger.error("No custom exchange class: \""+String.valueOf(className)+"\" cannot be registered as it does not extend class \""+ExchangeType.class+"\"");
- }
- catch (IllegalAccessException e)
- {
- _logger.error("Cannot create custom exchange class: \""+String.valueOf(className)+"\"",e);
- }
- catch (InstantiationException e)
- {
- _logger.error("Cannot create custom exchange class: \""+String.valueOf(className)+"\"",e);
- }
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java
deleted file mode 100644
index 0ab8208d88..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java
+++ /dev/null
@@ -1,139 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.protocol.ExchangeInitialiser;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.IncomingMessage;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.util.Collection;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class DefaultExchangeRegistry implements ExchangeRegistry
-{
- private static final Logger _log = Logger.getLogger(DefaultExchangeRegistry.class);
-
- /**
- * Maps from exchange name to exchange instance
- */
- private ConcurrentMap<AMQShortString, Exchange> _exchangeMap = new ConcurrentHashMap<AMQShortString, Exchange>();
-
- private Exchange _defaultExchange;
- private VirtualHost _host;
-
- public DefaultExchangeRegistry(VirtualHost host)
- {
- //create 'standard' exchanges:
- _host = host;
-
- }
-
- public void initialise() throws AMQException
- {
- new ExchangeInitialiser().initialise(_host.getExchangeFactory(), this);
- }
-
- public MessageStore getMessageStore()
- {
- return _host.getMessageStore();
- }
-
- public void registerExchange(Exchange exchange) throws AMQException
- {
- _exchangeMap.put(exchange.getName(), exchange);
- if (exchange.isDurable())
- {
- getMessageStore().createExchange(exchange);
- }
- }
-
- public void setDefaultExchange(Exchange exchange)
- {
- _defaultExchange = exchange;
- }
-
- public Exchange getDefaultExchange()
- {
- return _defaultExchange;
- }
-
- public Collection<AMQShortString> getExchangeNames()
- {
- return _exchangeMap.keySet();
- }
-
- public void unregisterExchange(AMQShortString name, boolean inUse) throws AMQException
- {
- // TODO: check inUse argument
- Exchange e = _exchangeMap.remove(name);
- if (e != null)
- {
- if (e.isDurable())
- {
- getMessageStore().removeExchange(e);
- }
- e.close();
- }
- else
- {
- throw new AMQException("Unknown exchange " + name);
- }
- }
-
- public Exchange getExchange(AMQShortString name)
- {
- if ((name == null) || name.length() == 0)
- {
- return getDefaultExchange();
- }
- else
- {
- return _exchangeMap.get(name);
- }
-
- }
-
- /**
- * Routes content through exchanges, delivering it to 1 or more queues.
- * @param payload
- * @throws AMQException if something goes wrong delivering data
- */
- public void routeContent(IncomingMessage payload) throws AMQException
- {
- final AMQShortString exchange = payload.getExchange();
- final Exchange exch = getExchange(exchange);
- // there is a small window of opportunity for the exchange to be deleted in between
- // the BasicPublish being received (where the exchange is validated) and the final
- // content body being received (which triggers this method)
- // TODO: check where the exchange is validated
- if (exch == null)
- {
- throw new AMQException("Exchange '" + exchange + "' does not exist");
- }
- exch.route(payload);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java
deleted file mode 100644
index e39c005750..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/DirectExchange.java
+++ /dev/null
@@ -1,253 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.management.JMException;
-import javax.management.MBeanException;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularDataSupport;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.management.MBeanConstructor;
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.queue.IncomingMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class DirectExchange extends AbstractExchange
-{
- private static final Logger _logger = Logger.getLogger(DirectExchange.class);
-
- /**
- * Maps from queue name to queue instances
- */
- private final Index _index = new Index();
-
- public static final ExchangeType<DirectExchange> TYPE = new ExchangeType<DirectExchange>()
- {
-
- public AMQShortString getName()
- {
- return ExchangeDefaults.DIRECT_EXCHANGE_CLASS;
- }
-
- public Class<DirectExchange> getExchangeClass()
- {
- return DirectExchange.class;
- }
-
- public DirectExchange newInstance(VirtualHost host,
- AMQShortString name,
- boolean durable,
- int ticket,
- boolean autoDelete) throws AMQException
- {
- DirectExchange exch = new DirectExchange();
- exch.initialise(host,name,durable,ticket,autoDelete);
- return exch;
- }
-
- public AMQShortString getDefaultExchangeName()
- {
- return ExchangeDefaults.DIRECT_EXCHANGE_NAME;
- }
- };
-
- /**
- * MBean class implementing the management interfaces.
- */
- @MBeanDescription("Management Bean for Direct Exchange")
- private final class DirectExchangeMBean extends ExchangeMBean
- {
- @MBeanConstructor("Creates an MBean for AMQ direct exchange")
- public DirectExchangeMBean() throws JMException
- {
- super();
- _exchangeType = "direct";
- init();
- }
-
- public TabularData bindings() throws OpenDataException
- {
- Map<AMQShortString, List<AMQQueue>> bindings = _index.getBindingsMap();
- _bindingList = new TabularDataSupport(_bindinglistDataType);
-
- for (Map.Entry<AMQShortString, List<AMQQueue>> entry : bindings.entrySet())
- {
- AMQShortString key = entry.getKey();
- List<String> queueList = new ArrayList<String>();
-
- List<AMQQueue> queues = entry.getValue();
- for (AMQQueue q : queues)
- {
- queueList.add(q.getName().toString());
- }
-
- Object[] bindingItemValues = {key.toString(), queueList.toArray(new String[0])};
- CompositeData bindingData = new CompositeDataSupport(_bindingDataType, _bindingItemNames, bindingItemValues);
- _bindingList.put(bindingData);
- }
-
- return _bindingList;
- }
-
- public void createNewBinding(String queueName, String binding) throws JMException
- {
- AMQQueue queue = getQueueRegistry().getQueue(new AMQShortString(queueName));
- if (queue == null)
- {
- throw new JMException("Queue \"" + queueName + "\" is not registered with the exchange.");
- }
-
- try
- {
- queue.bind(DirectExchange.this, new AMQShortString(binding), null);
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex);
- }
- }
-
- }// End of MBean class
-
-
- protected ExchangeMBean createMBean() throws AMQException
- {
- try
- {
- return new DirectExchangeMBean();
- }
- catch (JMException ex)
- {
- _logger.error("Exception occured in creating the direct exchange mbean", ex);
- throw new AMQException("Exception occured in creating the direct exchange mbean", ex);
- }
- }
-
- public AMQShortString getType()
- {
- return ExchangeDefaults.DIRECT_EXCHANGE_CLASS;
- }
-
- public void registerQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- assert queue != null;
- assert routingKey != null;
- if (!_index.add(routingKey, queue))
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Queue (" + queue.getName() + ")" + queue + " is already registered with routing key " + routingKey);
- }
- }
- else
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Binding queue(" + queue.getName() + ") " + queue + " with routing key " + routingKey
- + (args == null ? "" : " and arguments " + args.toString())
- + " to exchange " + this);
- }
- }
- }
-
- public void deregisterQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- assert queue != null;
- assert routingKey != null;
-
- if (!_index.remove(routingKey, queue))
- {
- throw new AMQException(AMQConstant.NOT_FOUND, "Queue " + queue + " was not registered with exchange " + this.getName() +
- " with routing key " + routingKey + ". No queue was registered with that _routing key");
- }
- }
-
- public void route(IncomingMessage payload) throws AMQException
- {
-
- final AMQShortString routingKey = payload.getRoutingKey() == null ? AMQShortString.EMPTY_STRING : payload.getRoutingKey();
-
- final ArrayList<AMQQueue> queues = (routingKey == null) ? null : _index.get(routingKey);
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Publishing message to queue " + queues);
- }
-
- payload.enqueue(queues);
-
-
- }
-
- public boolean isBound(AMQShortString routingKey, FieldTable arguments, AMQQueue queue)
- {
- return isBound(routingKey,queue);
- }
-
- public boolean isBound(AMQShortString routingKey, AMQQueue queue)
- {
- final List<AMQQueue> queues = _index.get(routingKey);
- return queues != null && queues.contains(queue);
- }
-
- public boolean isBound(AMQShortString routingKey)
- {
- final List<AMQQueue> queues = _index.get(routingKey);
- return queues != null && !queues.isEmpty();
- }
-
- public boolean isBound(AMQQueue queue)
- {
- Map<AMQShortString, List<AMQQueue>> bindings = _index.getBindingsMap();
- for (List<AMQQueue> queues : bindings.values())
- {
- if (queues.contains(queue))
- {
- return true;
- }
- }
- return false;
- }
-
- public boolean hasBindings()
- {
- return !_index.getBindingsMap().isEmpty();
- }
-
- public Map<AMQShortString, List<AMQQueue>> getBindings()
- {
- return _index.getBindingsMap();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java
deleted file mode 100644
index 06209c5458..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java
+++ /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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-
-import org.apache.qpid.server.queue.IncomingMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.util.List;
-import java.util.Map;
-
-public interface Exchange
-{
- AMQShortString getName();
-
- AMQShortString getType();
-
- void initialise(VirtualHost host, AMQShortString name, boolean durable, int ticket, boolean autoDelete) throws AMQException;
-
- boolean isDurable();
-
- /**
- * @return true if the exchange will be deleted after all queues have been detached
- */
- boolean isAutoDelete();
-
- int getTicket();
-
- void close() throws AMQException;
-
- void registerQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException;
-
- void deregisterQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException;
-
- void route(IncomingMessage message) throws AMQException;
-
-
- /**
- * Determines whether a message would be isBound to a particular queue using a specific routing key and arguments
- * @param routingKey
- * @param arguments
- * @param queue
- * @return
- * @throws AMQException
- */
- boolean isBound(AMQShortString routingKey, FieldTable arguments, AMQQueue queue);
-
- /**
- * Determines whether a message would be isBound to a particular queue using a specific routing key
- * @param routingKey
- * @param queue
- * @return
- * @throws AMQException
- */
- boolean isBound(AMQShortString routingKey, AMQQueue queue);
-
- /**
- * Determines whether a message is routing to any queue using a specific _routing key
- * @param routingKey
- * @return
- * @throws AMQException
- */
- boolean isBound(AMQShortString routingKey);
-
- boolean isBound(AMQQueue queue);
-
- /**
- * Returns true if this exchange has at least one binding associated with it.
- * @return
- * @throws AMQException
- */
- boolean hasBindings();
-
-
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java
deleted file mode 100644
index 0bcfec7181..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import java.util.Collection;
-
-import org.apache.commons.configuration.Configuration;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-
-
-public interface ExchangeFactory
-{
- Exchange createExchange(AMQShortString exchange, AMQShortString type, boolean durable, boolean autoDelete,
- int ticket)
- throws AMQException;
-
- void initialise(Configuration hostConfig);
-
- Collection<ExchangeType<? extends Exchange>> getRegisteredTypes();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java
deleted file mode 100644
index c77f114428..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java
+++ /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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.qpid.AMQException;
-
-/**
- * ExchangeInUseRegistry indicates that an exchange cannot be unregistered because it is currently being used.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents failure to unregister exchange that is in use.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- *
- * @todo This exception is not used. However, it is part of the ExchangeRegistry interface, and looks like code is
- * going to need to be added to throw/deal with this. Alternatively ExchangeResitries may be able to handle the
- * issue internally.
- */
-public class ExchangeInUseException extends AMQException
-{
- public ExchangeInUseException(String exchangeName)
- {
- super("Exchange " + exchangeName + " is currently in use");
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java
deleted file mode 100644
index fe3b19e74e..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-
-import java.util.Collection;
-
-
-public interface ExchangeRegistry extends MessageRouter
-{
- void registerExchange(Exchange exchange) throws AMQException;
-
- /**
- * Unregister an exchange
- * @param name name of the exchange to delete
- * @param inUse if true, do NOT delete the exchange if it is in use (has queues bound to it)
- * @throws ExchangeInUseException when the exchange cannot be deleted because it is in use
- * @throws AMQException
- */
- void unregisterExchange(AMQShortString name, boolean inUse) throws ExchangeInUseException, AMQException;
-
- Exchange getExchange(AMQShortString name);
-
- void setDefaultExchange(Exchange exchange);
-
- Exchange getDefaultExchange();
-
- Collection<AMQShortString> getExchangeNames();
-
- void initialise() throws AMQException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeType.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeType.java
deleted file mode 100644
index 0b55caa2f1..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeType.java
+++ /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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-
-public interface ExchangeType<T extends Exchange>
-{
- public AMQShortString getName();
- public Class<T> getExchangeClass();
- public T newInstance(VirtualHost host, AMQShortString name,
- boolean durable, int ticket, boolean autoDelete) throws AMQException;
- public AMQShortString getDefaultExchangeName();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java
deleted file mode 100644
index e9fd4d548b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java
+++ /dev/null
@@ -1,224 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.management.MBeanConstructor;
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.queue.IncomingMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import javax.management.JMException;
-import javax.management.MBeanException;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularDataSupport;
-import java.util.List;
-import java.util.Map;
-import java.util.ArrayList;
-import java.util.concurrent.CopyOnWriteArraySet;
-
-public class FanoutExchange extends AbstractExchange
-{
- private static final Logger _logger = Logger.getLogger(FanoutExchange.class);
-
- /**
- * Maps from queue name to queue instances
- */
- private final CopyOnWriteArraySet<AMQQueue> _queues = new CopyOnWriteArraySet<AMQQueue>();
-
- /**
- * MBean class implementing the management interfaces.
- */
- @MBeanDescription("Management Bean for Fanout Exchange")
- private final class FanoutExchangeMBean extends ExchangeMBean
- {
- @MBeanConstructor("Creates an MBean for AMQ fanout exchange")
- public FanoutExchangeMBean() throws JMException
- {
- super();
- _exchangeType = "fanout";
- init();
- }
-
- public TabularData bindings() throws OpenDataException
- {
-
- _bindingList = new TabularDataSupport(_bindinglistDataType);
-
- for (AMQQueue queue : _queues)
- {
- String queueName = queue.getName().toString();
-
- Object[] bindingItemValues = {queueName, new String[]{queueName}};
- CompositeData bindingData = new CompositeDataSupport(_bindingDataType, _bindingItemNames, bindingItemValues);
- _bindingList.put(bindingData);
- }
-
- return _bindingList;
- }
-
- public void createNewBinding(String queueName, String binding) throws JMException
- {
- AMQQueue queue = getQueueRegistry().getQueue(new AMQShortString(queueName));
- if (queue == null)
- {
- throw new JMException("Queue \"" + queueName + "\" is not registered with the exchange.");
- }
-
- try
- {
- queue.bind(FanoutExchange.this, new AMQShortString(binding), null);
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex);
- }
- }
-
- } // End of MBean class
-
- protected ExchangeMBean createMBean() throws AMQException
- {
- try
- {
- return new FanoutExchange.FanoutExchangeMBean();
- }
- catch (JMException ex)
- {
- _logger.error("Exception occured in creating the direct exchange mbean", ex);
- throw new AMQException("Exception occured in creating the direct exchange mbean", ex);
- }
- }
-
- public static final ExchangeType<FanoutExchange> TYPE = new ExchangeType<FanoutExchange>()
- {
-
- public AMQShortString getName()
- {
- return ExchangeDefaults.FANOUT_EXCHANGE_CLASS;
- }
-
- public Class<FanoutExchange> getExchangeClass()
- {
- return FanoutExchange.class;
- }
-
- public FanoutExchange newInstance(VirtualHost host,
- AMQShortString name,
- boolean durable,
- int ticket,
- boolean autoDelete) throws AMQException
- {
- FanoutExchange exch = new FanoutExchange();
- exch.initialise(host, name, durable, ticket, autoDelete);
- return exch;
- }
-
- public AMQShortString getDefaultExchangeName()
- {
- return ExchangeDefaults.FANOUT_EXCHANGE_NAME;
- }
- };
-
- public Map<AMQShortString, List<AMQQueue>> getBindings()
- {
- return null;
- }
-
- public AMQShortString getType()
- {
- return ExchangeDefaults.FANOUT_EXCHANGE_CLASS;
- }
-
- public void registerQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- assert queue != null;
-
- if (_queues.contains(queue))
- {
- _logger.debug("Queue " + queue + " is already registered");
- }
- else
- {
- _queues.add(queue);
- _logger.debug("Binding queue " + queue + " with routing key " + routingKey + " to exchange " + this);
- }
- }
-
- public void deregisterQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- assert queue != null;
-
- if (!_queues.remove(queue))
- {
- throw new AMQException(AMQConstant.NOT_FOUND, "Queue " + queue + " was not registered with exchange " + this.getName() + ". ");
- }
- }
-
- public void route(IncomingMessage payload) throws AMQException
- {
-
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Publishing message to queue " + _queues);
- }
-
- payload.enqueue(new ArrayList(_queues));
-
- }
-
- public boolean isBound(AMQShortString routingKey, FieldTable arguments, AMQQueue queue)
- {
- return isBound(routingKey, queue);
- }
-
- public boolean isBound(AMQShortString routingKey, AMQQueue queue)
- {
- return _queues.contains(queue);
- }
-
- public boolean isBound(AMQShortString routingKey)
- {
-
- return (_queues != null) && !_queues.isEmpty();
- }
-
- public boolean isBound(AMQQueue queue)
- {
-
- return _queues.contains(queue);
- }
-
- public boolean hasBindings()
- {
- return !_queues.isEmpty();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java
deleted file mode 100644
index 2b7df4361a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java
+++ /dev/null
@@ -1,219 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.framing.AMQTypedValue;
-import org.apache.qpid.framing.FieldTable;
-
-/**
- * Defines binding and matching based on a set of headers.
- */
-class HeadersBinding
-{
- private static final Logger _logger = Logger.getLogger(HeadersBinding.class);
-
- private final FieldTable _mappings;
- private final Set<String> required = new HashSet<String>();
- private final Map<String,Object> matches = new HashMap<String,Object>();
- private boolean matchAny;
-
- private final class MatchesOrProcessor implements FieldTable.FieldTableElementProcessor
- {
- private Boolean _result = Boolean.FALSE;
-
- public boolean processElement(String propertyName, AMQTypedValue value)
- {
- if((value != null) && (value.getValue() != null) && value.getValue().equals(matches.get(propertyName)))
- {
- _result = Boolean.TRUE;
- return false;
- }
- return true;
- }
-
- public Object getResult()
- {
- return _result;
- }
- }
-
- private final class RequiredOrProcessor implements FieldTable.FieldTableElementProcessor
- {
- Boolean _result = Boolean.FALSE;
-
- public boolean processElement(String propertyName, AMQTypedValue value)
- {
- if(required.contains(propertyName))
- {
- _result = Boolean.TRUE;
- return false;
- }
- return true;
- }
-
- public Object getResult()
- {
- return _result;
- }
- }
-
-
-
- /**
- * Creates a binding for a set of mappings. Those mappings whose value is
- * null or the empty string are assumed only to be required headers, with
- * no constraint on the value. Those with a non-null value are assumed to
- * define a required match of value.
- * @param mappings the defined mappings this binding should use
- */
-
- HeadersBinding(FieldTable mappings)
- {
- _mappings = mappings;
- initMappings();
- }
-
- private void initMappings()
- {
-
- _mappings.processOverElements(new FieldTable.FieldTableElementProcessor()
- {
-
- public boolean processElement(String propertyName, AMQTypedValue value)
- {
- if (isSpecial(propertyName))
- {
- processSpecial(propertyName, value.getValue());
- }
- else if (value.getValue() == null || value.getValue().equals(""))
- {
- required.add(propertyName);
- }
- else
- {
- matches.put(propertyName,value.getValue());
- }
-
- return true;
- }
-
- public Object getResult()
- {
- return null;
- }
- });
- }
-
- protected FieldTable getMappings()
- {
- return _mappings;
- }
-
- /**
- * Checks whether the supplied headers match the requirements of this binding
- * @param headers the headers to check
- * @return true if the headers define any required keys and match any required
- * values
- */
- public boolean matches(FieldTable headers)
- {
- if(headers == null)
- {
- return required.isEmpty() && matches.isEmpty();
- }
- else
- {
- return matchAny ? or(headers) : and(headers);
- }
- }
-
- private boolean and(FieldTable headers)
- {
- if(headers.keys().containsAll(required))
- {
- for(Map.Entry<String, Object> e : matches.entrySet())
- {
- if(!e.getValue().equals(headers.getObject(e.getKey())))
- {
- return false;
- }
- }
- return true;
- }
- else
- {
- return false;
- }
- }
-
-
- private boolean or(final FieldTable headers)
- {
- if(required.isEmpty() || !(Boolean) headers.processOverElements(new RequiredOrProcessor()))
- {
- return ((!matches.isEmpty()) && (Boolean) headers.processOverElements(new MatchesOrProcessor()))
- || (required.isEmpty() && matches.isEmpty());
- }
- else
- {
- return true;
- }
- }
-
- private void processSpecial(String key, Object value)
- {
- if("X-match".equalsIgnoreCase(key))
- {
- matchAny = isAny(value);
- }
- else
- {
- _logger.warn("Ignoring special header: " + key);
- }
- }
-
- private boolean isAny(Object value)
- {
- if(value instanceof String)
- {
- if("any".equalsIgnoreCase((String) value)) return true;
- if("all".equalsIgnoreCase((String) value)) return false;
- }
- _logger.warn("Ignoring unrecognised match type: " + value);
- return false;//default to all
- }
-
- static boolean isSpecial(Object key)
- {
- return key instanceof String && isSpecial((String) key);
- }
-
- static boolean isSpecial(String key)
- {
- return key.startsWith("X-") || key.startsWith("x-");
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java
deleted file mode 100644
index 1ee1f35de6..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java
+++ /dev/null
@@ -1,350 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.AMQTypedValue;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.management.MBeanConstructor;
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.queue.IncomingMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import javax.management.JMException;
-import javax.management.openmbean.ArrayType;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.SimpleType;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularDataSupport;
-import javax.management.openmbean.TabularType;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Collection;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-/**
- * An exchange that binds queues based on a set of required headers and header values
- * and routes messages to these queues by matching the headers of the message against
- * those with which the queues were bound.
- * <p/>
- * <pre>
- * The Headers Exchange
- *
- * Routes messages according to the value/presence of fields in the message header table.
- * (Basic and JMS content has a content header field called "headers" that is a table of
- * message header fields).
- *
- * class = "headers"
- * routing key is not used
- *
- * Has the following binding arguments:
- *
- * the X-match field - if "all", does an AND match (used for GRM), if "any", does an OR match.
- * other fields prefixed with "X-" are ignored (and generate a console warning message).
- * a field with no value or empty value indicates a match on presence only.
- * a field with a value indicates match on field presence and specific value.
- *
- * Standard instances:
- *
- * amq.match - pub/sub on field content/value
- * </pre>
- */
-public class HeadersExchange extends AbstractExchange
-{
- private static final Logger _logger = Logger.getLogger(HeadersExchange.class);
-
-
-
- public static final ExchangeType<HeadersExchange> TYPE = new ExchangeType<HeadersExchange>()
- {
-
- public AMQShortString getName()
- {
- return ExchangeDefaults.HEADERS_EXCHANGE_CLASS;
- }
-
- public Class<HeadersExchange> getExchangeClass()
- {
- return HeadersExchange.class;
- }
-
- public HeadersExchange newInstance(VirtualHost host, AMQShortString name, boolean durable, int ticket,
- boolean autoDelete) throws AMQException
- {
- HeadersExchange exch = new HeadersExchange();
- exch.initialise(host, name, durable, ticket, autoDelete);
- return exch;
- }
-
- public AMQShortString getDefaultExchangeName()
- {
-
- return ExchangeDefaults.HEADERS_EXCHANGE_NAME;
- }
- };
-
-
- private final List<Registration> _bindings = new CopyOnWriteArrayList<Registration>();
-
- /**
- * HeadersExchangeMBean class implements the management interface for the
- * Header Exchanges.
- */
- @MBeanDescription("Management Bean for Headers Exchange")
- private final class HeadersExchangeMBean extends ExchangeMBean
- {
- @MBeanConstructor("Creates an MBean for AMQ Headers exchange")
- public HeadersExchangeMBean() throws JMException
- {
- super();
- _exchangeType = "headers";
- init();
- }
-
- /**
- * initialises the OpenType objects.
- */
- protected void init() throws OpenDataException
- {
- _bindingItemNames = new String[]{"Binding No", "Queue Name", "Queue Bindings"};
- _bindingItemIndexNames = new String[]{_bindingItemNames[0]};
-
- _bindingItemTypes = new OpenType[3];
- _bindingItemTypes[0] = SimpleType.INTEGER;
- _bindingItemTypes[1] = SimpleType.STRING;
- _bindingItemTypes[2] = new ArrayType(1, SimpleType.STRING);
- _bindingDataType = new CompositeType("Exchange Binding", "Queue name and header bindings",
- _bindingItemNames, _bindingItemNames, _bindingItemTypes);
- _bindinglistDataType = new TabularType("Exchange Bindings", "List of exchange bindings for " + getName(),
- _bindingDataType, _bindingItemIndexNames);
- }
-
- public TabularData bindings() throws OpenDataException
- {
- _bindingList = new TabularDataSupport(_bindinglistDataType);
- int count = 1;
- for (Iterator<Registration> itr = _bindings.iterator(); itr.hasNext();)
- {
- Registration registration = itr.next();
- String queueName = registration.queue.getName().toString();
-
- HeadersBinding headers = registration.binding;
- FieldTable headerMappings = headers.getMappings();
- final List<String> mappingList = new ArrayList<String>();
-
- headerMappings.processOverElements(new FieldTable.FieldTableElementProcessor()
- {
-
- public boolean processElement(String propertyName, AMQTypedValue value)
- {
- mappingList.add(propertyName + "=" + value.getValue());
- return true;
- }
-
- public Object getResult()
- {
- return mappingList;
- }
- });
-
-
- Object[] bindingItemValues = {count++, queueName, mappingList.toArray(new String[0])};
- CompositeData bindingData = new CompositeDataSupport(_bindingDataType, _bindingItemNames, bindingItemValues);
- _bindingList.put(bindingData);
- }
-
- return _bindingList;
- }
-
- /**
- * Creates bindings. Binding pattern is as follows-
- * <attributename>=<value>,<attributename>=<value>,...
- * @param queueName
- * @param binding
- * @throws javax.management.JMException
- */
- public void createNewBinding(String queueName, String binding) throws JMException
- {
- AMQQueue queue = getQueueRegistry().getQueue(new AMQShortString(queueName));
-
- if (queue == null)
- {
- throw new JMException("Queue \"" + queueName + "\" is not registered with the exchange.");
- }
-
- String[] bindings = binding.split(",");
- FieldTable bindingMap = new FieldTable();
- for (int i = 0; i < bindings.length; i++)
- {
- String[] keyAndValue = bindings[i].split("=");
- if (keyAndValue == null || keyAndValue.length < 2)
- {
- throw new JMException("Format for headers binding should be \"<attribute1>=<value1>,<attribute2>=<value2>\" ");
- }
- bindingMap.setString(keyAndValue[0], keyAndValue[1]);
- }
-
- _bindings.add(new Registration(new HeadersBinding(bindingMap), queue));
- }
-
- } // End of MBean class
-
- public AMQShortString getType()
- {
- return ExchangeDefaults.HEADERS_EXCHANGE_CLASS;
- }
-
- public void registerQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- _logger.debug("Exchange " + getName() + ": Binding " + queue.getName() + " with " + args);
- _bindings.add(new Registration(new HeadersBinding(args), queue));
- }
-
- public void deregisterQueue(AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- _logger.debug("Exchange " + getName() + ": Unbinding " + queue.getName());
- if(!_bindings.remove(new Registration(new HeadersBinding(args), queue)))
- {
- throw new AMQException(AMQConstant.NOT_FOUND, "Queue " + queue + " was not registered with exchange " + this.getName()
- + " with headers args " + args);
- }
- }
-
- public void route(IncomingMessage payload) throws AMQException
- {
- FieldTable headers = getHeaders(payload.getContentHeaderBody());
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Exchange " + getName() + ": routing message with headers " + headers);
- }
- boolean routed = false;
- ArrayList<AMQQueue> queues = new ArrayList<AMQQueue>();
- for (Registration e : _bindings)
- {
-
- if (e.binding.matches(headers))
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Exchange " + getName() + ": delivering message with headers " +
- headers + " to " + e.queue.getName());
- }
- queues.add(e.queue);
-
- routed = true;
- }
- }
- payload.enqueue(queues);
- }
-
- public boolean isBound(AMQShortString routingKey, FieldTable arguments, AMQQueue queue)
- {
- //fixme isBound here should take the arguements in to consideration.
- return isBound(routingKey, queue);
- }
-
- public boolean isBound(AMQShortString routingKey, AMQQueue queue)
- {
- return isBound(queue);
- }
-
- public boolean isBound(AMQShortString routingKey)
- {
- return hasBindings();
- }
-
- public boolean isBound(AMQQueue queue)
- {
- for (Registration r : _bindings)
- {
- if (r.queue.equals(queue))
- {
- return true;
- }
- }
- return false;
- }
-
- public boolean hasBindings()
- {
- return !_bindings.isEmpty();
- }
-
- protected FieldTable getHeaders(ContentHeaderBody contentHeaderFrame)
- {
- //what if the content type is not 'basic'? 'file' and 'stream' content classes also define headers,
- //but these are not yet implemented.
- return ((BasicContentHeaderProperties) contentHeaderFrame.properties).getHeaders();
- }
-
- protected ExchangeMBean createMBean() throws AMQException
- {
- try
- {
- return new HeadersExchangeMBean();
- }
- catch (JMException ex)
- {
- _logger.error("Exception occured in creating the HeadersExchangeMBean", ex);
- throw new AMQException("Exception occured in creating the HeadersExchangeMBean", ex);
- }
- }
-
- public Map<AMQShortString, List<AMQQueue>> getBindings()
- {
- return null;
- }
-
- private static class Registration
- {
- private final HeadersBinding binding;
- private final AMQQueue queue;
-
- Registration(HeadersBinding binding, AMQQueue queue)
- {
- this.binding = binding;
- this.queue = queue;
- }
-
- public int hashCode()
- {
- return queue.hashCode();
- }
-
- public boolean equals(Object o)
- {
- return o instanceof Registration && ((Registration) o).queue.equals(queue);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java
deleted file mode 100644
index ec83161029..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java
+++ /dev/null
@@ -1,99 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.ArrayList;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.queue.AMQQueue;
-
-/**
- * An index of queues against routing key. Allows multiple queues to be stored
- * against the same key. Used in the DirectExchange.
- */
-class Index
-{
- private ConcurrentMap<AMQShortString, ArrayList<AMQQueue>> _index
- = new ConcurrentHashMap<AMQShortString, ArrayList<AMQQueue>>();
-
- synchronized boolean add(AMQShortString key, AMQQueue queue)
- {
- ArrayList<AMQQueue> queues = _index.get(key);
- if(queues == null)
- {
- queues = new ArrayList<AMQQueue>();
- }
- else
- {
- queues = new ArrayList<AMQQueue>(queues);
- }
- //next call is atomic, so there is no race to create the list
- _index.put(key, queues);
-
- if(queues.contains(queue))
- {
- return false;
- }
- else
- {
- return queues.add(queue);
- }
- }
-
- synchronized boolean remove(AMQShortString key, AMQQueue queue)
- {
- ArrayList<AMQQueue> queues = _index.get(key);
- if (queues != null)
- {
- queues = new ArrayList<AMQQueue>(queues);
- boolean removed = queues.remove(queue);
- if(removed)
- {
- if (queues.size() == 0)
- {
- _index.remove(key);
- }
- else
- {
- _index.put(key, queues);
- }
- }
- return removed;
- }
- return false;
- }
-
- ArrayList<AMQQueue> get(AMQShortString key)
- {
- return _index.get(key);
- }
-
- Map<AMQShortString, List<AMQQueue>> getBindingsMap()
- {
- return new HashMap<AMQShortString, List<AMQQueue>>(_index);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java
deleted file mode 100644
index 5d6d68b3c8..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java
+++ /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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import java.io.IOException;
-
-import javax.management.JMException;
-import javax.management.MBeanOperationInfo;
-import javax.management.openmbean.TabularData;
-
-import org.apache.qpid.server.management.MBeanAttribute;
-import org.apache.qpid.server.management.MBeanOperation;
-import org.apache.qpid.server.management.MBeanOperationParameter;
-import org.apache.qpid.server.queue.ManagedQueue;
-
-/**
- * The management interface exposed to allow management of an Exchange.
- * @author Robert J. Greig
- * @author Bhupendra Bhardwaj
- * @version 0.1
- */
-public interface ManagedExchange
-{
- static final String TYPE = "Exchange";
-
- /**
- * Returns the name of the managed exchange.
- * @return the name of the exchange.
- * @throws IOException
- */
- @MBeanAttribute(name="Name", description=TYPE + " Name")
- String getName() throws IOException;
-
- @MBeanAttribute(name="ExchangeType", description="Exchange Type")
- String getExchangeType() throws IOException;
-
- @MBeanAttribute(name="TicketNo", description="Exchange Ticket No")
- Integer getTicketNo() throws IOException;
-
- /**
- * Tells if the exchange is durable or not.
- * @return true if the exchange is durable.
- * @throws IOException
- */
- @MBeanAttribute(name="Durable", description="true if Exchange is durable")
- boolean isDurable() throws IOException;
-
- /**
- * Tells if the exchange is set for autodelete or not.
- * @return true if the exchange is set as autodelete.
- * @throws IOException
- */
- @MBeanAttribute(name="AutoDelete", description="true if Exchange is AutoDelete")
- boolean isAutoDelete() throws IOException;
-
- // Operations
-
- /**
- * Returns all the bindings this exchange has with the queues.
- * @return the bindings with the exchange.
- * @throws IOException
- * @throws JMException
- */
- @MBeanOperation(name="bindings", description="view the queue bindings for this exchange")
- TabularData bindings() throws IOException, JMException;
-
- /**
- * Creates new binding with the given queue and binding.
- * @param queueName
- * @param binding
- * @throws JMException
- */
- @MBeanOperation(name="createNewBinding",
- description="create a new binding with this exchange",
- impact= MBeanOperationInfo.ACTION)
- void createNewBinding(@MBeanOperationParameter(name= ManagedQueue.TYPE, description="Queue name") String queueName,
- @MBeanOperationParameter(name="Binding", description="New binding")String binding)
- throws JMException;
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/MessageRouter.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/MessageRouter.java
deleted file mode 100644
index db9beb6da7..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/MessageRouter.java
+++ /dev/null
@@ -1,41 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.IncomingMessage;
-
-/**
- * Separated out from the ExchangeRegistry interface to allow components
- * that use only this part to have a dependency with a reduced footprint.
- *
- */
-public interface MessageRouter
-{
- /**
- * Routes content through exchanges, delivering it to 1 or more queues.
- * @param message the message to be routed
- *
- * @throws org.apache.qpid.AMQException if something goes wrong delivering data
- */
- void routeContent(IncomingMessage message) throws AMQException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java
deleted file mode 100644
index d18ad7ab14..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java
+++ /dev/null
@@ -1,49 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.IncomingMessage;
-
-/**
- * NoRouteException is a {@link RequiredDeliveryException} that represents the failure case where a manadatory message
- * cannot be delivered because there is no route for the message. The AMQP status code, 312, is always used to report
- * this condition.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent failure to deliver a message that must be delivered.
- * </table>
- */
-public class NoRouteException extends RequiredDeliveryException
-{
- public NoRouteException(String msg, AMQMessage amqMessage)
- {
- super(msg, amqMessage);
- }
-
- public AMQConstant getReplyCode()
- {
- return AMQConstant.NO_ROUTE;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java
deleted file mode 100644
index bc303a219d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/TopicExchange.java
+++ /dev/null
@@ -1,670 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.common.AMQPFilterTypes;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.AMQShortStringTokenizer;
-import org.apache.qpid.server.management.MBeanConstructor;
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.queue.IncomingMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.exchange.topic.TopicParser;
-import org.apache.qpid.server.exchange.topic.TopicMatcherResult;
-import org.apache.qpid.server.filter.MessageFilter;
-import org.apache.qpid.server.filter.JMSSelectorFilter;
-
-import javax.management.JMException;
-import javax.management.MBeanException;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularDataSupport;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.lang.ref.WeakReference;
-
-public class TopicExchange extends AbstractExchange
-{
-
- public static final ExchangeType<TopicExchange> TYPE = new ExchangeType<TopicExchange>()
- {
-
- public AMQShortString getName()
- {
- return ExchangeDefaults.TOPIC_EXCHANGE_CLASS;
- }
-
- public Class<TopicExchange> getExchangeClass()
- {
- return TopicExchange.class;
- }
-
- public TopicExchange newInstance(VirtualHost host,
- AMQShortString name,
- boolean durable,
- int ticket,
- boolean autoDelete) throws AMQException
- {
- TopicExchange exch = new TopicExchange();
- exch.initialise(host, name, durable, ticket, autoDelete);
- return exch;
- }
-
- public AMQShortString getDefaultExchangeName()
- {
- return ExchangeDefaults.TOPIC_EXCHANGE_NAME;
- }
- };
-
-
- private static final Logger _logger = Logger.getLogger(TopicExchange.class);
-
-/*
- private final ConcurrentHashMap<AMQShortString, List<AMQQueue>> _bindingKey2queues =
- new ConcurrentHashMap<AMQShortString, List<AMQQueue>>();
- private final ConcurrentHashMap<AMQShortString, List<AMQQueue>> _simpleBindingKey2queues =
- new ConcurrentHashMap<AMQShortString, List<AMQQueue>>();
- private final ConcurrentHashMap<AMQShortString, List<AMQQueue>> _wildCardBindingKey2queues =
- new ConcurrentHashMap<AMQShortString, List<AMQQueue>>();
-*/
- // private ConcurrentHashMap<AMQShortString, AMQQueue> _routingKey2queue = new ConcurrentHashMap<AMQShortString, AMQQueue>();
- private static final byte TOPIC_SEPARATOR = (byte)'.';
- private static final AMQShortString TOPIC_SEPARATOR_AS_SHORTSTRING = new AMQShortString(".");
- private static final AMQShortString AMQP_STAR_TOKEN = new AMQShortString("*");
- private static final AMQShortString AMQP_HASH_TOKEN = new AMQShortString("#");
-
- private static final byte HASH_BYTE = (byte)'#';
- private static final byte STAR_BYTE = (byte)'*';
-
- private final TopicParser _parser = new TopicParser();
-
- private final Map<AMQShortString, TopicExchangeResult> _topicExchangeResults =
- new ConcurrentHashMap<AMQShortString, TopicExchangeResult>();
-
- private final Map<Binding, FieldTable> _bindings = new HashMap<Binding, FieldTable>();
-
- private final Map<String, WeakReference<JMSSelectorFilter<RuntimeException>>> _selectorCache = new WeakHashMap<String, WeakReference<JMSSelectorFilter<RuntimeException>>>();
-
- public static class Binding
- {
- private final AMQShortString _bindingKey;
- private final AMQQueue _queue;
- private final FieldTable _args;
-
- public Binding(AMQShortString bindingKey, AMQQueue queue, FieldTable args)
- {
- _bindingKey = bindingKey;
- _queue = queue;
- _args = args;
- }
-
- public AMQShortString getBindingKey()
- {
- return _bindingKey;
- }
-
- public AMQQueue getQueue()
- {
- return _queue;
- }
-
- public int hashCode()
- {
- return (_bindingKey == null ? 1 : _bindingKey.hashCode())*31 +_queue.hashCode();
- }
-
- public boolean equals(Object o)
- {
- if(this == o)
- {
- return true;
- }
- if(o instanceof Binding)
- {
- Binding other = (Binding) o;
- return (_queue == other._queue)
- && ((_bindingKey == null) ? other._bindingKey == null : _bindingKey.equals(other._bindingKey));
- }
- return false;
- }
- }
-
-
-
- private final class TopicExchangeResult implements TopicMatcherResult
- {
- private final Map<AMQQueue, Integer> _unfilteredQueues = new ConcurrentHashMap<AMQQueue, Integer>();
- private final ConcurrentHashMap<AMQQueue, Map<MessageFilter<RuntimeException>,Integer>> _filteredQueues = new ConcurrentHashMap<AMQQueue, Map<MessageFilter<RuntimeException>, Integer>>();
-
- public void addUnfilteredQueue(AMQQueue queue)
- {
- Integer instances = _unfilteredQueues.get(queue);
- if(instances == null)
- {
- _unfilteredQueues.put(queue, 1);
- }
- else
- {
- _unfilteredQueues.put(queue, instances + 1);
- }
- }
-
- public void removeUnfilteredQueue(AMQQueue queue)
- {
- Integer instances = _unfilteredQueues.get(queue);
- if(instances == 1)
- {
- _unfilteredQueues.remove(queue);
- }
- else
- {
- _unfilteredQueues.put(queue,instances - 1);
- }
-
- }
-
-
- public void addFilteredQueue(AMQQueue queue, MessageFilter<RuntimeException> filter)
- {
- Map<MessageFilter<RuntimeException>,Integer> filters = _filteredQueues.get(queue);
- if(filters == null)
- {
- filters = new ConcurrentHashMap<MessageFilter<RuntimeException>,Integer>();
- _filteredQueues.put(queue, filters);
- }
- Integer instances = filters.get(filter);
- if(instances == null)
- {
- filters.put(filter,1);
- }
- else
- {
- filters.put(filter, instances + 1);
- }
-
- }
-
- public void removeFilteredQueue(AMQQueue queue, MessageFilter<RuntimeException> filter)
- {
- Map<MessageFilter<RuntimeException>,Integer> filters = _filteredQueues.get(queue);
- if(filters != null)
- {
- Integer instances = filters.get(filter);
- if(instances != null)
- {
- if(instances == 1)
- {
- filters.remove(filter);
- if(filters.isEmpty())
- {
- _filteredQueues.remove(queue);
- }
- }
- else
- {
- filters.put(filter, instances - 1);
- }
- }
-
- }
-
- }
-
- public void replaceQueueFilter(AMQQueue queue,
- MessageFilter<RuntimeException> oldFilter,
- MessageFilter<RuntimeException> newFilter)
- {
- Map<MessageFilter<RuntimeException>,Integer> filters = _filteredQueues.get(queue);
- Map<MessageFilter<RuntimeException>,Integer> newFilters = new ConcurrentHashMap<MessageFilter<RuntimeException>,Integer>(filters);
- Integer oldFilterInstances = filters.get(oldFilter);
- if(oldFilterInstances == 1)
- {
- newFilters.remove(oldFilter);
- }
- else
- {
- newFilters.put(oldFilter, oldFilterInstances-1);
- }
- Integer newFilterInstances = filters.get(newFilter);
- if(newFilterInstances == null)
- {
- newFilters.put(newFilter, 1);
- }
- else
- {
- newFilters.put(newFilter, newFilterInstances+1);
- }
- _filteredQueues.put(queue,newFilters);
- }
-
- public Collection<AMQQueue> processMessage(IncomingMessage msg, Collection<AMQQueue> queues)
- {
- if(queues == null)
- {
- if(_filteredQueues.isEmpty())
- {
- return new ArrayList<AMQQueue>(_unfilteredQueues.keySet());
- }
- else
- {
- queues = new HashSet<AMQQueue>();
- }
- }
- else if(!(queues instanceof Set))
- {
- queues = new HashSet<AMQQueue>(queues);
- }
-
- queues.addAll(_unfilteredQueues.keySet());
- if(!_filteredQueues.isEmpty())
- {
- for(Map.Entry<AMQQueue, Map<MessageFilter<RuntimeException>, Integer>> entry : _filteredQueues.entrySet())
- {
- if(!queues.contains(entry.getKey()))
- {
- for(MessageFilter<RuntimeException> filter : entry.getValue().keySet())
- {
- if(filter.matches(msg))
- {
- queues.add(entry.getKey());
- }
- }
- }
- }
- }
- return queues;
- }
-
- }
-
-
- /** TopicExchangeMBean class implements the management interface for the Topic exchanges. */
- @MBeanDescription("Management Bean for Topic Exchange")
- private final class TopicExchangeMBean extends ExchangeMBean
- {
- @MBeanConstructor("Creates an MBean for AMQ topic exchange")
- public TopicExchangeMBean() throws JMException
- {
- super();
- _exchangeType = "topic";
- init();
- }
-
- /** returns exchange bindings in tabular form */
- public TabularData bindings() throws OpenDataException
- {
- _bindingList = new TabularDataSupport(_bindinglistDataType);
- Map<String, List<String>> bindingData = new HashMap<String, List<String>>();
- for (Binding binding : _bindings.keySet())
- {
- String key = binding.getBindingKey().toString();
- List<String> queueNames = bindingData.get(key);
- if(queueNames == null)
- {
- queueNames = new ArrayList<String>();
- bindingData.put(key, queueNames);
- }
- queueNames.add(binding.getQueue().getName().toString());
-
- }
- for(Map.Entry<String, List<String>> entry : bindingData.entrySet())
- {
- Object[] bindingItemValues = {entry.getKey(), entry.getValue().toArray(new String[entry.getValue().size()]) };
- CompositeData bindingCompositeData = new CompositeDataSupport(_bindingDataType, _bindingItemNames, bindingItemValues);
- _bindingList.put(bindingCompositeData);
- }
-
- return _bindingList;
- }
-
- public void createNewBinding(String queueName, String binding) throws JMException
- {
- AMQQueue queue = getQueueRegistry().getQueue(new AMQShortString(queueName));
- if (queue == null)
- {
- throw new JMException("Queue \"" + queueName + "\" is not registered with the exchange.");
- }
-
- try
- {
- queue.bind(TopicExchange.this, new AMQShortString(binding), null);
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex);
- }
- }
-
- } // End of MBean class
-
- public AMQShortString getType()
- {
- return ExchangeDefaults.TOPIC_EXCHANGE_CLASS;
- }
-
- public synchronized void registerQueue(AMQShortString rKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- assert queue != null;
- assert rKey != null;
-
- _logger.debug("Registering queue " + queue.getName() + " with routing key " + rKey);
-
-
- AMQShortString routingKey;
-
- if(rKey.contains(HASH_BYTE) || rKey.contains(STAR_BYTE))
- {
- routingKey = normalize(rKey);
- }
- else
- {
- routingKey = rKey;
- }
-
- Binding binding = new Binding(rKey, queue, args);
-
- if(_bindings.containsKey(binding))
- {
- FieldTable oldArgs = _bindings.get(binding);
- TopicExchangeResult result = _topicExchangeResults.get(routingKey);
-
- if(argumentsContainSelector(args))
- {
- if(argumentsContainSelector(oldArgs))
- {
- result.replaceQueueFilter(queue,createSelectorFilter(oldArgs), createSelectorFilter(args));
- }
- else
- {
- result.addFilteredQueue(queue,createSelectorFilter(args));
- result.removeUnfilteredQueue(queue);
- }
- }
- else
- {
- if(argumentsContainSelector(oldArgs))
- {
- result.addUnfilteredQueue(queue);
- result.removeFilteredQueue(queue, createSelectorFilter(oldArgs));
- }
- else
- {
- // TODO - fix control flow
- return;
- }
- }
-
- }
- else
- {
-
- TopicExchangeResult result = _topicExchangeResults.get(routingKey);
- if(result == null)
- {
- result = new TopicExchangeResult();
- if(argumentsContainSelector(args))
- {
- result.addFilteredQueue(queue, createSelectorFilter(args));
- }
- else
- {
- result.addUnfilteredQueue(queue);
- }
- _parser.addBinding(routingKey, result);
- _topicExchangeResults.put(routingKey,result);
- }
- else
- {
- if(argumentsContainSelector(args))
- {
- result.addFilteredQueue(queue, createSelectorFilter(args));
- }
- else
- {
- result.addUnfilteredQueue(queue);
- }
- }
- _bindings.put(binding, args);
- }
-
-
- }
-
- private JMSSelectorFilter<RuntimeException> createSelectorFilter(final FieldTable args)
- throws AMQException
- {
-
- final String selectorString = args.getString(AMQPFilterTypes.JMS_SELECTOR.getValue());
- WeakReference<JMSSelectorFilter<RuntimeException>> selectorRef = _selectorCache.get(selectorString);
- JMSSelectorFilter selector = null;
-
- if(selectorRef == null || (selector = selectorRef.get())==null)
- {
- selector = new JMSSelectorFilter<RuntimeException>(selectorString);
- _selectorCache.put(selectorString, new WeakReference<JMSSelectorFilter<RuntimeException>>(selector));
- }
- return selector;
- }
-
- private static boolean argumentsContainSelector(final FieldTable args)
- {
- return args != null && args.containsKey(AMQPFilterTypes.JMS_SELECTOR.getValue()) && args.getString(AMQPFilterTypes.JMS_SELECTOR.getValue()).trim().length() != 0;
- }
-
- private AMQShortString normalize(AMQShortString routingKey)
- {
- if(routingKey == null)
- {
- routingKey = AMQShortString.EMPTY_STRING;
- }
-
- AMQShortStringTokenizer routingTokens = routingKey.tokenize(TOPIC_SEPARATOR);
-
- List<AMQShortString> subscriptionList = new ArrayList<AMQShortString>();
-
- while (routingTokens.hasMoreTokens())
- {
- subscriptionList.add(routingTokens.nextToken());
- }
-
- int size = subscriptionList.size();
-
- for (int index = 0; index < size; index++)
- {
- // if there are more levels
- if ((index + 1) < size)
- {
- if (subscriptionList.get(index).equals(AMQP_HASH_TOKEN))
- {
- if (subscriptionList.get(index + 1).equals(AMQP_HASH_TOKEN))
- {
- // we don't need #.# delete this one
- subscriptionList.remove(index);
- size--;
- // redo this normalisation
- index--;
- }
-
- if (subscriptionList.get(index + 1).equals(AMQP_STAR_TOKEN))
- {
- // we don't want #.* swap to *.#
- // remove it and put it in at index + 1
- subscriptionList.add(index + 1, subscriptionList.remove(index));
- }
- }
- } // if we have more levels
- }
-
-
-
- AMQShortString normalizedString = AMQShortString.join(subscriptionList, TOPIC_SEPARATOR_AS_SHORTSTRING);
-
- return normalizedString;
- }
-
- public void route(IncomingMessage payload) throws AMQException
- {
-
- final AMQShortString routingKey = payload.getRoutingKey();
-
- // The copy here is unfortunate, but not too bad relevant to the amount of
- // things created and copied in getMatchedQueues
- ArrayList<AMQQueue> queues = new ArrayList<AMQQueue>();
- queues.addAll(getMatchedQueues(payload, routingKey));
-
- if(queues == null || queues.isEmpty())
- {
- _logger.info("Message routing key: " + payload.getRoutingKey() + " No routes.");
- }
-
- payload.enqueue(queues);
-
- }
-
- public boolean isBound(AMQShortString routingKey, FieldTable arguments, AMQQueue queue)
- {
- Binding binding = new Binding(routingKey, queue, arguments);
- if (arguments == null)
- {
- return _bindings.containsKey(binding);
- }
- else
- {
- FieldTable o = _bindings.get(binding);
- if (o != null)
- {
- return o.equals(arguments);
- }
- else
- {
- return false;
- }
-
- }
- }
-
- public boolean isBound(AMQShortString routingKey, AMQQueue queue)
- {
- return isBound(routingKey, null, queue);
- }
-
- public boolean isBound(AMQShortString routingKey)
- {
- for(Binding b : _bindings.keySet())
- {
- if(b.getBindingKey().equals(routingKey))
- {
- return true;
- }
- }
-
- return false;
- }
-
- public boolean isBound(AMQQueue queue)
- {
- for(Binding b : _bindings.keySet())
- {
- if(b.getQueue().equals(queue))
- {
- return true;
- }
- }
-
- return false;
- }
-
- public boolean hasBindings()
- {
- return !_bindings.isEmpty();
- }
-
- public synchronized void deregisterQueue(AMQShortString rKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- assert queue != null;
- assert rKey != null;
-
- Binding binding = new Binding(rKey, queue, args);
-
-
- if (!_bindings.containsKey(binding))
- {
- throw new AMQException(AMQConstant.NOT_FOUND, "Queue " + queue.getName() + " was not registered with exchange " + this.getName()
- + " with routing key " + rKey + ".");
- }
-
- FieldTable bindingArgs = _bindings.remove(binding);
- AMQShortString bindingKey = normalize(rKey);
- TopicExchangeResult result = _topicExchangeResults.get(bindingKey);
- if(argumentsContainSelector(bindingArgs))
- {
- result.removeFilteredQueue(queue, createSelectorFilter(bindingArgs));
- }
- else
- {
- result.removeUnfilteredQueue(queue);
- }
-
- }
-
- protected ExchangeMBean createMBean() throws AMQException
- {
- try
- {
- return new TopicExchangeMBean();
- }
- catch (JMException ex)
- {
- _logger.error("Exception occured in creating the topic exchenge mbean", ex);
- throw new AMQException("Exception occured in creating the topic exchenge mbean", ex);
- }
- }
-
- private Collection<AMQQueue> getMatchedQueues(IncomingMessage message, AMQShortString routingKey)
- {
-
- Collection<TopicMatcherResult> results = _parser.parse(routingKey);
- if(results.isEmpty())
- {
- return Collections.EMPTY_SET;
- }
- else
- {
- Collection<AMQQueue> queues = results.size() == 1 ? null : new HashSet<AMQQueue>();
- for(TopicMatcherResult result : results)
- {
-
- queues = ((TopicExchangeResult)result).processMessage(message, queues);
- }
- return queues;
- }
-
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderKey.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderKey.java
deleted file mode 100644
index 8fdb91cbef..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderKey.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.apache.qpid.server.exchange.headers;
-
-import org.apache.qpid.framing.AMQShortString;
-
-/*
-*
-* 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.
-*
-*/
-public class HeaderKey
-{
- public static final HeaderKey UNKNOWN = new HeaderKey(new AMQShortString("<< UNKNOWN >>"));
- private AMQShortString _key;
-
- public HeaderKey(final AMQShortString key)
- {
- _key = key;
- }
-
- public String toString()
- {
- return _key.toString();
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderKeyDictionary.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderKeyDictionary.java
deleted file mode 100644
index 7be99a88c9..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderKeyDictionary.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.apache.qpid.server.exchange.headers;
-
-import org.apache.qpid.framing.AMQShortString;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/*
-*
-* 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.
-*
-*/
-public class HeaderKeyDictionary
-{
-
- private final Map<AMQShortString, HeaderKey> _dictionary = new HashMap<AMQShortString, HeaderKey>();
-
-
- public HeaderKey get(final AMQShortString key)
- {
- HeaderKey headerKey = _dictionary.get(key);
- return headerKey == null ? HeaderKey.UNKNOWN : headerKey;
- }
-
- public HeaderKey getOrCreate(final AMQShortString key)
- {
- HeaderKey headerKey = _dictionary.get(key);
- if(headerKey == null)
- {
- headerKey = new HeaderKey(key);
- _dictionary.put(key, headerKey);
- }
- return headerKey;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderMatcherResult.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderMatcherResult.java
deleted file mode 100644
index 518064bb29..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeaderMatcherResult.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.qpid.server.exchange.headers;
-
-/*
-*
-* 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.
-*
-*/
-public class HeaderMatcherResult
-{
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeadersMatcherDFAState.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeadersMatcherDFAState.java
deleted file mode 100644
index 9da93d483a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeadersMatcherDFAState.java
+++ /dev/null
@@ -1,339 +0,0 @@
-package org.apache.qpid.server.exchange.headers;
-
-import org.apache.qpid.framing.AMQTypedValue;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.exchange.topic.TopicMatcherDFAState;
-import org.apache.qpid.server.exchange.topic.TopicWord;
-import org.apache.qpid.server.exchange.topic.TopicMatcherResult;
-
-import java.util.*;
-
-/*
-*
-* 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.
-*
-*/
-public class HeadersMatcherDFAState
-{
-
-
- private final Collection<HeaderMatcherResult> _results;
- private final Map<HeaderKey, Map<AMQTypedValue,HeadersMatcherDFAState>> _nextStateMap;
- private final HeaderKeyDictionary _dictionary;
-
- public HeadersMatcherDFAState(Map<HeaderKey, Map<AMQTypedValue,HeadersMatcherDFAState>> nextStateMap,
- Collection<HeaderMatcherResult> results,
- HeaderKeyDictionary dictionary)
- {
- _nextStateMap = nextStateMap;
- _results = results;
- _dictionary = dictionary;
- }
-
-
- public Collection<HeaderMatcherResult> match(final FieldTable table)
- {
- return match(table.iterator());
- }
-
-
-
- public Collection<HeaderMatcherResult> match(Iterator<Map.Entry<AMQShortString,AMQTypedValue>> fieldTableIterator)
- {
-
- if(_nextStateMap.isEmpty())
- {
- return _results;
- }
-
- while(fieldTableIterator.hasNext())
- {
-
- Map.Entry<AMQShortString, AMQTypedValue> fieldTableEntry = fieldTableIterator.next();
- HeaderKey key = _dictionary.get(fieldTableEntry.getKey());
- if(key != HeaderKey.UNKNOWN)
- {
- Map<AMQTypedValue, HeadersMatcherDFAState> valueToStateMap = _nextStateMap.get(key);
-
- if(valueToStateMap != null)
- {
- HeadersMatcherDFAState nextState = valueToStateMap.get(fieldTableEntry.getValue());
-
- if(nextState == null)
- {
- nextState = valueToStateMap.get(null);
- }
- if(nextState != null && nextState != this)
- {
- return nextState.match(fieldTableIterator);
- }
- }
-
- }
- }
-
- return _results;
-
- }
-
-
- HeadersMatcherDFAState mergeStateMachines(HeadersMatcherDFAState otherStateMachine)
- {
-
- assert(otherStateMachine._dictionary == _dictionary);
-
- Map<Set<HeadersMatcherDFAState>, HeadersMatcherDFAState> newStateMap= new HashMap<Set<HeadersMatcherDFAState>, HeadersMatcherDFAState>();
-
- Collection<HeaderMatcherResult> results;
-
- if(_results.isEmpty())
- {
- results = otherStateMachine._results;
- }
- else if(otherStateMachine._results.isEmpty())
- {
- results = _results;
- }
- else
- {
- results = new HashSet<HeaderMatcherResult>(_results);
- results.addAll(otherStateMachine._results);
- }
-
-
- final Map<HeaderKey, Map<AMQTypedValue, HeadersMatcherDFAState>> newNextStateMap = new HashMap<HeaderKey, Map<AMQTypedValue, HeadersMatcherDFAState>>();
-
- HeadersMatcherDFAState newState = new HeadersMatcherDFAState(newNextStateMap, results, _dictionary);
-
-
- Set<HeadersMatcherDFAState> oldStates = new HashSet<HeadersMatcherDFAState>();
- oldStates.add(this);
- oldStates.add(otherStateMachine);
-
- newStateMap.put(oldStates, newState);
-
- mergeStateMachines(oldStates, newNextStateMap, newStateMap);
-
- return newState;
-
-
- }
-
- private void mergeStateMachines(final Set<HeadersMatcherDFAState> oldStates,
- final Map<HeaderKey, Map<AMQTypedValue, HeadersMatcherDFAState>> newNextStateMap,
- final Map<Set<HeadersMatcherDFAState>, HeadersMatcherDFAState> newStateMap)
- {
- Map<HeaderKey, Map<AMQTypedValue, Set<HeadersMatcherDFAState>>> nfaMap = new HashMap<HeaderKey, Map<AMQTypedValue, Set<HeadersMatcherDFAState>>>();
-
- Set<HeaderKey> distinctKeys = new HashSet<HeaderKey>();
-
- for(HeadersMatcherDFAState state : oldStates)
- {
- Map<HeaderKey, Map<AMQTypedValue, HeadersMatcherDFAState>> map = state._nextStateMap;
-
- for(Map.Entry<HeaderKey, Map<AMQTypedValue, HeadersMatcherDFAState>> entry : map.entrySet())
- {
- Map<AMQTypedValue, Set<HeadersMatcherDFAState>> valueToStatesMap = nfaMap.get(entry.getKey());
-
- if(valueToStatesMap == null)
- {
- valueToStatesMap = new HashMap<AMQTypedValue, Set<HeadersMatcherDFAState>>();
- nfaMap.put(entry.getKey(), valueToStatesMap);
- }
-
- for(Map.Entry<AMQTypedValue, HeadersMatcherDFAState> valueToStateEntry : entry.getValue().entrySet())
- {
- Set<HeadersMatcherDFAState> states = valueToStatesMap.get(valueToStateEntry.getKey());
- if(states == null)
- {
- states = new HashSet<HeadersMatcherDFAState>();
- valueToStatesMap.put(valueToStateEntry.getKey(),states);
- }
- states.add(valueToStateEntry.getValue());
- }
-
- distinctKeys.add(entry.getKey());
- }
- }
-
- Map<HeaderKey, Set<HeadersMatcherDFAState>> anyValueStates = new HashMap<HeaderKey, Set<HeadersMatcherDFAState>>();
-
- for(HeaderKey distinctKey : distinctKeys)
- {
- Map<AMQTypedValue, Set<HeadersMatcherDFAState>> valueToStateMap = nfaMap.get(distinctKey);
- if(valueToStateMap != null)
- {
- Set<HeadersMatcherDFAState> statesForKeyDefault = valueToStateMap.get(null);
- if(statesForKeyDefault != null)
- {
- anyValueStates.put(distinctKey, statesForKeyDefault);
- }
- }
- }
-
- // add the defaults for "null" to all other specified values of a given header key
-
- for( Map.Entry<HeaderKey,Map<AMQTypedValue,Set<HeadersMatcherDFAState>>> entry : nfaMap.entrySet())
- {
- Map<AMQTypedValue, Set<HeadersMatcherDFAState>> valueToStatesMap = entry.getValue();
- for(Map.Entry<AMQTypedValue, Set<HeadersMatcherDFAState>> valueToStates : valueToStatesMap.entrySet())
- {
- if(valueToStates.getKey() != null)
- {
-
-
- Set<HeadersMatcherDFAState> defaults = anyValueStates.get(entry.getKey());
- if(defaults != null)
- {
- valueToStates.getValue().addAll(defaults);
- }
- }
- }
- }
-
- // if a given header key is not mentioned in the map of a machine; then that machine would stay at the same state
- // for that key.
- for(HeaderKey distinctKey : distinctKeys)
- {
- Map<AMQTypedValue, Set<HeadersMatcherDFAState>> valueToStatesMap = nfaMap.get(distinctKey);
- for(HeadersMatcherDFAState oldState : oldStates)
- {
- if(!oldState._nextStateMap.containsKey(distinctKey))
- {
- for(Set<HeadersMatcherDFAState> endStates : valueToStatesMap.values())
- {
- endStates.add(oldState);
- }
- }
- }
- }
-
-
-
-
- for(Map.Entry<HeaderKey,Map<AMQTypedValue,Set<HeadersMatcherDFAState>>> transitionClass : nfaMap.entrySet())
- {
- Map<AMQTypedValue, HeadersMatcherDFAState> valueToDFAState = newNextStateMap.get(transitionClass.getKey());
- if(valueToDFAState == null)
- {
- valueToDFAState = new HashMap<AMQTypedValue, HeadersMatcherDFAState>();
- newNextStateMap.put(transitionClass.getKey(), valueToDFAState);
- }
-
- for(Map.Entry<AMQTypedValue,Set<HeadersMatcherDFAState>> transition : transitionClass.getValue().entrySet())
- {
- Set<HeadersMatcherDFAState> destinations = transition.getValue();
-
-
- HeadersMatcherDFAState nextState = newStateMap.get(destinations);
-
- if(nextState == null)
- {
-
- if(destinations.size() == 1)
- {
- nextState = destinations.iterator().next();
- newStateMap.put(destinations, nextState);
- }
- else
- {
- Collection<HeaderMatcherResult> results;
-
- Set<Collection<HeaderMatcherResult>> resultSets = new HashSet<Collection<HeaderMatcherResult>>();
- for(HeadersMatcherDFAState destination : destinations)
- {
- resultSets.add(destination._results);
- }
- resultSets.remove(Collections.EMPTY_SET);
- if(resultSets.size() == 0)
- {
- results = Collections.EMPTY_SET;
- }
- else if(resultSets.size() == 1)
- {
- results = resultSets.iterator().next();
- }
- else
- {
- results = new HashSet<HeaderMatcherResult>();
- for(Collection<HeaderMatcherResult> oldResult : resultSets)
- {
- results.addAll(oldResult);
- }
- }
-
- final Map<HeaderKey, Map<AMQTypedValue, HeadersMatcherDFAState>> nextStateMap = new HashMap<HeaderKey, Map<AMQTypedValue, HeadersMatcherDFAState>>();
-
- nextState = new HeadersMatcherDFAState(nextStateMap, results, _dictionary);
- newStateMap.put(destinations, nextState);
-
- mergeStateMachines(
- destinations,
- nextStateMap,
- newStateMap);
-
-
- }
-
-
- }
- valueToDFAState.put(transition.getKey(),nextState);
- }
- }
-
-
-
- final ArrayList<HeaderKey> removeKeyList = new ArrayList<HeaderKey>();
-
- for(Map.Entry<HeaderKey,Map<AMQTypedValue,HeadersMatcherDFAState>> entry : _nextStateMap.entrySet())
- {
- final ArrayList<AMQTypedValue> removeValueList = new ArrayList<AMQTypedValue>();
-
- for(Map.Entry<AMQTypedValue,HeadersMatcherDFAState> valueToDFAState : entry.getValue().entrySet())
- {
- if(valueToDFAState.getValue() == this)
- {
- HeadersMatcherDFAState defaultState = entry.getValue().get(null);
- if(defaultState == null || defaultState == this)
- {
- removeValueList.add(valueToDFAState.getKey());
- }
- }
- }
-
- for(AMQTypedValue removeValue : removeValueList)
- {
- entry.getValue().remove(removeValue);
- }
-
- if(entry.getValue().isEmpty())
- {
- removeKeyList.add(entry.getKey());
- }
-
- }
-
- for(HeaderKey removeKey : removeKeyList)
- {
- _nextStateMap.remove(removeKey);
- }
-
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeadersParser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeadersParser.java
deleted file mode 100644
index 85e74122c3..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/headers/HeadersParser.java
+++ /dev/null
@@ -1,439 +0,0 @@
-package org.apache.qpid.server.exchange.headers;
-
-import org.apache.qpid.framing.*;
-
-import java.util.*;
-
-/*
-*
-* 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.
-*
-*/
-public class HeadersParser
-{
-
- private final HeaderKeyDictionary _dictionary = new HeaderKeyDictionary();
- private static final AMQShortString MATCHING_TYPE_KEY = new AMQShortString("x-match");
- private static final String ANY_MATCHING = "any";
- private static final AMQShortString RESERVED_KEY_PREFIX = new AMQShortString("x-");
-
-
- HeadersMatcherDFAState createStateMachine(FieldTable bindingArguments, HeaderMatcherResult result)
- {
- String matchingType = bindingArguments.getString(MATCHING_TYPE_KEY);
- boolean matchAny = matchingType.equalsIgnoreCase(ANY_MATCHING);
- if(matchAny)
- {
- return createStateMachineForAnyMatch(bindingArguments, result);
- }
- else
- {
- return createStateMachineForAllMatch(bindingArguments, result);
- }
-
-
- }
-
-
- private HeadersMatcherDFAState createStateMachineForAnyMatch(final FieldTable bindingArguments,
- final HeaderMatcherResult result)
- {
-
- // DFAs for "any" matches have only two states, "not-matched" and "matched"... they start in the former
- // and upon meeting any of the criteria they move to the latter
-
- //noinspection unchecked
- final HeadersMatcherDFAState successState =
- new HeadersMatcherDFAState(Collections.EMPTY_MAP,Collections.singleton(result),_dictionary);
-
- Map<HeaderKey, Map<AMQTypedValue, HeadersMatcherDFAState>> nextStateMap =
- new HashMap<HeaderKey, Map<AMQTypedValue, HeadersMatcherDFAState>>();
-
- Set<AMQShortString> seenKeys = new HashSet<AMQShortString>();
-
- Iterator<Map.Entry<AMQShortString, AMQTypedValue>> tableIterator = bindingArguments.iterator();
-
- while(tableIterator.hasNext())
- {
- final Map.Entry<AMQShortString, AMQTypedValue> entry = tableIterator.next();
- final AMQShortString key = entry.getKey();
- final AMQTypedValue value = entry.getValue();
-
-
- if(seenKeys.add(key) && !key.startsWith(RESERVED_KEY_PREFIX))
- {
- final AMQType type = value.getType();
-
- final HeaderKey headerKey = _dictionary.getOrCreate(key);
- final Map<AMQTypedValue, HeadersMatcherDFAState> valueMap;
-
- if(type == AMQType.VOID ||
- ((type == AMQType.ASCII_STRING || type == AMQType.WIDE_STRING) && ((CharSequence)value.getValue()).length() == 0))
- {
- valueMap = Collections.singletonMap(null,successState);
-
- }
- else
- {
- valueMap = Collections.singletonMap(value,successState);
- }
- nextStateMap.put(headerKey,valueMap);
-
- }
-
- }
-
- if(seenKeys.size() == 0)
- {
- return successState;
- }
- else
- {
- return new HeadersMatcherDFAState(nextStateMap,Collections.EMPTY_SET,_dictionary);
- }
-
-
- }
-
-
- private HeadersMatcherDFAState createStateMachineForAllMatch(final FieldTable bindingArguments,
- final HeaderMatcherResult result)
- {
- // DFAs for "all" matches have a "success" state, a "fail" state, and states for every subset of
- // matches which are possible, starting with the empty subset. For example if we have a binding
- // { x-match="all"
- // a=1
- // b=1
- // c=1
- // d=1 }
- // Then we would have the following states
- // (1) Seen none of a, b, c, or d
- // (2) Seen a=1 ; none of b,c, or d
- // (3) Seen b=1 ; none of a,c, or d
- // (4) Seen c=1 ; none of a,b, or d
- // (5) Seen d=1 ; none of a,b, or c
- // (6) Seen a=1,b=1 ; none of c,d
- // (7) Seen a=1,c=1 ; none of b,d
- // (8) Seen a=1,d=1 ; none of b,c
- // (9) Seen b=1,c=1 ; none of a,d
- //(10) Seen b=1,d=1 ; none of c,d
- //(11) Seen c=1,d=1 ; none of a,b
- //(12) Seen a=1,b=1,c=1 ; not d
- //(13) Seen a=1,b=1,d=1 ; not c
- //(14) Seen a=1,c=1,d=1 ; not b
- //(15) Seen b=1,c=1,d=1 ; not a
- //(16) success
- //(17) fail
- //
- // All states but (16) can transition to (17); additionally:
- // (1) can transition to (2),(3),(4),(5)
- // (2) can transition to (6),(7),(8)
- // (3) can transition to (6),(9),(10)
- // (4) can transition to (7),(9),(11)
- // (5) can transition to (8),(10),(11)
- // (6) can transition to (12),(13)
- // (7) can transition to (12),(14)
- // (8) can transition to (13),(14)
- // (9) can transition to (12),(15)
- //(10) can transition to (13),(15)
- //(11) can transition to (14),(15)
- //(12)-(15) can transition to (16)
-
- Set<AMQShortString> seenKeys = new HashSet<AMQShortString>();
- List<KeyValuePair> requiredTerms = new ArrayList<KeyValuePair>(bindingArguments.size());
-
- Iterator<Map.Entry<AMQShortString, AMQTypedValue>> tableIterator = bindingArguments.iterator();
-
-
-
- while(tableIterator.hasNext())
- {
- final Map.Entry<AMQShortString, AMQTypedValue> entry = tableIterator.next();
- final AMQShortString key = entry.getKey();
- final AMQTypedValue value = entry.getValue();
-
-
- if(seenKeys.add(key) && !key.startsWith(RESERVED_KEY_PREFIX))
- {
- final AMQType type = value.getType();
-
- if(type == AMQType.VOID ||
- ((type == AMQType.ASCII_STRING || type == AMQType.WIDE_STRING) && ((CharSequence)value.getValue()).length() == 0))
- {
- requiredTerms.add(new KeyValuePair(_dictionary.getOrCreate(key),null));
- }
- else
- {
- requiredTerms.add(new KeyValuePair(_dictionary.getOrCreate(key),value));
- }
- }
-
- }
-
- final HeadersMatcherDFAState successState =
- new HeadersMatcherDFAState(Collections.EMPTY_MAP,Collections.singleton(result),_dictionary);
-
- final HeadersMatcherDFAState failState =
- new HeadersMatcherDFAState(Collections.EMPTY_MAP,Collections.EMPTY_SET,_dictionary);
-
- Map<Set<KeyValuePair>, HeadersMatcherDFAState> notSeenTermsToStateMap =
- new HashMap<Set<KeyValuePair>, HeadersMatcherDFAState>();
-
- notSeenTermsToStateMap.put(Collections.EMPTY_SET, successState);
-
-
- final int numberOfTerms = requiredTerms.size();
-
- for(int numMissingTerms = 1; numMissingTerms <= numberOfTerms; numMissingTerms++)
- {
- int[] pos = new int[numMissingTerms];
- for(int i = 0; i < numMissingTerms; i++)
- {
- pos[i] = i;
- }
-
- final int maxTermValue = (numberOfTerms - (numMissingTerms - 1));
-
- while(pos[0] < maxTermValue)
- {
-
- Set<KeyValuePair> stateSet = new HashSet<KeyValuePair>();
- for(int posIndex = 0; posIndex < pos.length; posIndex++)
- {
- stateSet.add(requiredTerms.get(pos[posIndex]));
- }
-
- final Map<HeaderKey, Map<AMQTypedValue,HeadersMatcherDFAState>> nextStateMap =
- new HashMap<HeaderKey, Map<AMQTypedValue,HeadersMatcherDFAState>>();
-
-
- for(int posIndex = 0; posIndex < pos.length; posIndex++)
- {
- KeyValuePair nextTerm = requiredTerms.get(pos[posIndex]);
- HashSet<KeyValuePair> nextStateSet =
- new HashSet<KeyValuePair>(stateSet);
- nextStateSet.remove(nextTerm);
-
- Map<AMQTypedValue, HeadersMatcherDFAState> valueToStateMap =
- new HashMap<AMQTypedValue, HeadersMatcherDFAState>();
- nextStateMap.put(nextTerm._key, valueToStateMap);
-
- valueToStateMap.put( nextTerm._value,notSeenTermsToStateMap.get(nextStateSet));
- if(nextTerm._value != null)
- {
- valueToStateMap.put(null, failState);
- }
-
-
- }
-
-
- HeadersMatcherDFAState newState = new HeadersMatcherDFAState(nextStateMap, Collections.EMPTY_SET, _dictionary);
-
- notSeenTermsToStateMap.put(stateSet, newState);
-
- int i = numMissingTerms;
- while(i-- != 0)
- {
- if(++pos[i] <= numberOfTerms -(numMissingTerms-i))
- {
- int k = pos[i];
- for(int j = i+1; j < numMissingTerms; j++)
- {
- pos[j] = ++k;
- }
- break;
- }
- }
- }
-
-
-
-
- }
-
-
- return notSeenTermsToStateMap.get(new HashSet<KeyValuePair>(requiredTerms));
-
-
-
- }
-
- public static void main(String[] args) throws AMQFrameDecodingException
- {
-
- FieldTable bindingTable = new FieldTable();
-
- bindingTable.setString(new AMQShortString("x-match"),"all");
- bindingTable.setInteger("a",1);
- bindingTable.setVoid(new AMQShortString("b"));
- bindingTable.setString("c","");
- bindingTable.setInteger("d",4);
- bindingTable.setInteger("e",1);
-
-
-
- FieldTable bindingTable2 = new FieldTable();
- bindingTable2.setString(new AMQShortString("x-match"),"all");
- bindingTable2.setInteger("a",1);
- bindingTable2.setVoid(new AMQShortString("b"));
- bindingTable2.setString("c","");
- bindingTable2.setInteger("d",4);
- bindingTable2.setInteger("e",1);
- bindingTable2.setInteger("f",1);
-
-
- FieldTable table = new FieldTable();
- table.setInteger("a",1);
- table.setInteger("b",2);
- table.setString("c","");
- table.setInteger("d",4);
- table.setInteger("e",1);
- table.setInteger("f",1);
- table.setInteger("h",1);
- table.setInteger("i",1);
- table.setInteger("j",1);
- table.setInteger("k",1);
- table.setInteger("l",1);
-
- org.apache.mina.common.ByteBuffer buffer = org.apache.mina.common.ByteBuffer.allocate( (int) table.getEncodedSize());
- EncodingUtils.writeFieldTableBytes(buffer, table);
- buffer.flip();
-
- FieldTable table2 = EncodingUtils.readFieldTable(buffer);
-
-
-
- FieldTable bindingTable3 = new FieldTable();
- bindingTable3.setString(new AMQShortString("x-match"),"any");
- bindingTable3.setInteger("a",1);
- bindingTable3.setInteger("b",3);
-
-
- FieldTable bindingTable4 = new FieldTable();
- bindingTable4.setString(new AMQShortString("x-match"),"any");
- bindingTable4.setVoid(new AMQShortString("a"));
-
-
- FieldTable bindingTable5 = new FieldTable();
- bindingTable5.setString(new AMQShortString("x-match"),"all");
- bindingTable5.setString(new AMQShortString("h"),"hello");
-
- for(int i = 0; i < 100; i++)
- {
- printMatches(new FieldTable[] {bindingTable5} , table2);
- }
-
-
-
- }
-
-
-
- private static void printMatches(final FieldTable[] bindingKeys, final FieldTable routingKey)
- {
- HeadersMatcherDFAState sm = null;
- Map<HeaderMatcherResult, String> resultMap = new HashMap<HeaderMatcherResult, String>();
-
- HeadersParser parser = new HeadersParser();
-
- for(int i = 0; i < bindingKeys.length; i++)
- {
- HeaderMatcherResult r = new HeaderMatcherResult();
- resultMap.put(r, bindingKeys[i].toString());
-
-
- if(i==0)
- {
- sm = parser.createStateMachine(bindingKeys[i], r);
- }
- else
- {
- sm = sm.mergeStateMachines(parser.createStateMachine(bindingKeys[i], r));
- }
- }
-
- Collection<HeaderMatcherResult> results = null;
- long beforeTime = System.currentTimeMillis();
- for(int i = 0; i < 1000000; i++)
- {
- routingKey.size();
-
- assert sm != null;
- results = sm.match(routingKey);
-
- }
- long elapsed = System.currentTimeMillis() - beforeTime;
- System.out.println("1000000 Iterations took: " + elapsed);
- Collection<String> resultStrings = new ArrayList<String>();
-
- assert results != null;
- for(HeaderMatcherResult result : results)
- {
- resultStrings.add(resultMap.get(result));
- }
-
- final ArrayList<String> nonMatches = new ArrayList<String>();
- for(FieldTable key : bindingKeys)
- {
- nonMatches.add(key.toString());
- }
- nonMatches.removeAll(resultStrings);
- System.out.println("\""+routingKey+"\" matched with " + resultStrings + " DID NOT MATCH with " + nonMatches);
-
-
- }
-
-
- public final static class KeyValuePair
- {
- public final HeaderKey _key;
- public final AMQTypedValue _value;
- private final int _hashCode;
-
- public KeyValuePair(final HeaderKey key, final AMQTypedValue value)
- {
- _key = key;
- _value = value;
- int hash = (1 + 31 * _key.hashCode());
- if(_value != null)
- {
- hash+=_value.hashCode();
- }
- _hashCode = hash;
- }
-
- public int hashCode()
- {
- return _hashCode;
- }
-
- public boolean equals(Object o)
- {
- KeyValuePair other = (KeyValuePair)o;
- return (_key == other._key) && (_value == null ? other._value == null : _value.equals(other._value));
- }
-
-
- public String toString()
- {
- return "{" + _key + " -> " + _value + "}";
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherDFAState.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherDFAState.java
deleted file mode 100644
index 36076cf75b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherDFAState.java
+++ /dev/null
@@ -1,295 +0,0 @@
-package org.apache.qpid.server.exchange.topic;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.AMQShortStringTokenizer;
-
-import java.util.*;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/*
-*
-* 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.
-*
-*/
-public class TopicMatcherDFAState
-{
- private static final AtomicInteger stateId = new AtomicInteger();
-
- private final int _id = stateId.incrementAndGet();
-
- private final Collection<TopicMatcherResult> _results;
- private final Map<TopicWord, TopicMatcherDFAState> _nextStateMap;
- private static final byte TOPIC_DELIMITTER = (byte)'.';
-
-
- public TopicMatcherDFAState(Map<TopicWord, TopicMatcherDFAState> nextStateMap,
- Collection<TopicMatcherResult> results )
- {
- _nextStateMap = nextStateMap;
- _results = results;
- }
-
-
- public TopicMatcherDFAState nextState(TopicWord word)
- {
- final TopicMatcherDFAState nextState = _nextStateMap.get(word);
- return nextState == null ? _nextStateMap.get(TopicWord.ANY_WORD) : nextState;
- }
-
- public Collection<TopicMatcherResult> terminate()
- {
- return _results;
- }
-
-
- public Collection<TopicMatcherResult> parse(TopicWordDictionary dictionary, AMQShortString routingKey)
- {
- return parse(dictionary, routingKey.tokenize(TOPIC_DELIMITTER));
- }
-
- private Collection<TopicMatcherResult> parse(final TopicWordDictionary dictionary,
- final AMQShortStringTokenizer tokens)
- {
- if(!tokens.hasMoreTokens())
- {
- return _results;
- }
- TopicWord word = dictionary.getWord(tokens.nextToken());
- TopicMatcherDFAState nextState = _nextStateMap.get(word);
- if(nextState == null && word != TopicWord.ANY_WORD)
- {
- nextState = _nextStateMap.get(TopicWord.ANY_WORD);
- }
- if(nextState == null)
- {
- return Collections.EMPTY_SET;
- }
- // Shortcut if we are at a looping terminal state
- if((nextState == this) && (_nextStateMap.size() == 1) && _nextStateMap.containsKey(TopicWord.ANY_WORD))
- {
- return _results;
- }
-
- return nextState.parse(dictionary, tokens);
-
- }
-
-
- public TopicMatcherDFAState mergeStateMachines(TopicMatcherDFAState otherStateMachine)
- {
- Map<Set<TopicMatcherDFAState>, TopicMatcherDFAState> newStateMap= new HashMap<Set<TopicMatcherDFAState>, TopicMatcherDFAState>();
-
- Collection<TopicMatcherResult> results;
-
- if(_results.isEmpty())
- {
- results = otherStateMachine._results;
- }
- else if(otherStateMachine._results.isEmpty())
- {
- results = _results;
- }
- else
- {
- results = new HashSet<TopicMatcherResult>(_results);
- results.addAll(otherStateMachine._results);
- }
-
-
- final Map<TopicWord, TopicMatcherDFAState> newNextStateMap = new HashMap<TopicWord, TopicMatcherDFAState>();
-
- TopicMatcherDFAState newState = new TopicMatcherDFAState(newNextStateMap, results);
-
-
- Set<TopicMatcherDFAState> oldStates = new HashSet<TopicMatcherDFAState>();
- oldStates.add(this);
- oldStates.add(otherStateMachine);
-
- newStateMap.put(oldStates, newState);
-
- mergeStateMachines(oldStates, newNextStateMap, newStateMap);
-
- return newState;
-
- }
-
- private static void mergeStateMachines(
- final Set<TopicMatcherDFAState> oldStates,
- final Map<TopicWord, TopicMatcherDFAState> newNextStateMap,
- final Map<Set<TopicMatcherDFAState>, TopicMatcherDFAState> newStateMap)
- {
- Map<TopicWord, Set<TopicMatcherDFAState>> nfaMap = new HashMap<TopicWord, Set<TopicMatcherDFAState>>();
-
- for(TopicMatcherDFAState state : oldStates)
- {
- Map<TopicWord, TopicMatcherDFAState> map = state._nextStateMap;
- for(Map.Entry<TopicWord, TopicMatcherDFAState> entry : map.entrySet())
- {
- Set<TopicMatcherDFAState> states = nfaMap.get(entry.getKey());
- if(states == null)
- {
- states = new HashSet<TopicMatcherDFAState>();
- nfaMap.put(entry.getKey(), states);
- }
- states.add(entry.getValue());
- }
- }
-
- Set<TopicMatcherDFAState> anyWordStates = nfaMap.get(TopicWord.ANY_WORD);
-
- for(Map.Entry<TopicWord, Set<TopicMatcherDFAState>> transition : nfaMap.entrySet())
- {
- Set<TopicMatcherDFAState> destinations = transition.getValue();
-
- if(anyWordStates != null)
- {
- destinations.addAll(anyWordStates);
- }
-
- TopicMatcherDFAState nextState = newStateMap.get(destinations);
- if(nextState == null)
- {
-
- if(destinations.size() == 1)
- {
- nextState = destinations.iterator().next();
- newStateMap.put(destinations, nextState);
- }
- else
- {
- Collection<TopicMatcherResult> results;
-
- Set<Collection<TopicMatcherResult>> resultSets = new HashSet<Collection<TopicMatcherResult>>();
- for(TopicMatcherDFAState destination : destinations)
- {
- resultSets.add(destination._results);
- }
- resultSets.remove(Collections.EMPTY_SET);
- if(resultSets.size() == 0)
- {
- results = Collections.EMPTY_SET;
- }
- else if(resultSets.size() == 1)
- {
- results = resultSets.iterator().next();
- }
- else
- {
- results = new HashSet<TopicMatcherResult>();
- for(Collection<TopicMatcherResult> oldResult : resultSets)
- {
- results.addAll(oldResult);
- }
- }
-
- final Map<TopicWord, TopicMatcherDFAState> nextStateMap = new HashMap<TopicWord, TopicMatcherDFAState>();
-
- nextState = new TopicMatcherDFAState(nextStateMap, results);
- newStateMap.put(destinations, nextState);
-
- mergeStateMachines(
- destinations,
- nextStateMap,
- newStateMap);
-
-
- }
-
-
- }
- newNextStateMap.put(transition.getKey(),nextState);
- }
-
- // Remove redundant transitions where defined tokenWord has same action as ANY_WORD
- TopicMatcherDFAState anyWordState = newNextStateMap.get(TopicWord.ANY_WORD);
- if(anyWordState != null)
- {
- List<TopicWord> removeList = new ArrayList<TopicWord>();
- for(Map.Entry<TopicWord,TopicMatcherDFAState> entry : newNextStateMap.entrySet())
- {
- if(entry.getValue() == anyWordState && entry.getKey() != TopicWord.ANY_WORD)
- {
- removeList.add(entry.getKey());
- }
- }
- for(TopicWord removeKey : removeList)
- {
- newNextStateMap.remove(removeKey);
- }
- }
-
-
-
- }
-
-
- public String toString()
- {
- StringBuilder transitions = new StringBuilder();
- for(Map.Entry<TopicWord, TopicMatcherDFAState> entry : _nextStateMap.entrySet())
- {
- transitions.append("[ ");
- transitions.append(entry.getKey());
- transitions.append("\t ->\t ");
- transitions.append(entry.getValue()._id);
- transitions.append(" ]\n");
- }
-
-
- return "[ State " + _id + " ]\n" + transitions + "\n";
-
- }
-
- public String reachableStates()
- {
- StringBuilder result = new StringBuilder("Start state: " + _id + "\n");
-
- SortedSet<TopicMatcherDFAState> reachableStates =
- new TreeSet<TopicMatcherDFAState>(new Comparator<TopicMatcherDFAState>()
- {
- public int compare(final TopicMatcherDFAState o1, final TopicMatcherDFAState o2)
- {
- return o1._id - o2._id;
- }
- });
- reachableStates.add(this);
-
- int count;
-
- do
- {
- count = reachableStates.size();
- Collection<TopicMatcherDFAState> originalStates = new ArrayList<TopicMatcherDFAState>(reachableStates);
- for(TopicMatcherDFAState state : originalStates)
- {
- reachableStates.addAll(state._nextStateMap.values());
- }
- }
- while(reachableStates.size() != count);
-
-
-
- for(TopicMatcherDFAState state : reachableStates)
- {
- result.append(state.toString());
- }
-
- return result.toString();
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherResult.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherResult.java
deleted file mode 100644
index 71d30adfac..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicMatcherResult.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.qpid.server.exchange.topic;
-
-/*
-*
-* 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.
-*
-*/
-public interface TopicMatcherResult
-{
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicParser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicParser.java
deleted file mode 100644
index 3e9facf412..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicParser.java
+++ /dev/null
@@ -1,613 +0,0 @@
-package org.apache.qpid.server.exchange.topic;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.AMQShortStringTokenizer;
-
-import java.util.*;
-import java.util.concurrent.atomic.AtomicReference;
-import java.io.IOException;
-
-/*
-*
-* 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.
-*
-*/
-public class TopicParser
-{
- private static final byte TOPIC_DELIMITER = (byte)'.';
-
- private final TopicWordDictionary _dictionary = new TopicWordDictionary();
- private final AtomicReference<TopicMatcherDFAState> _stateMachine = new AtomicReference<TopicMatcherDFAState>();
-
- private static class Position
- {
- private final TopicWord _word;
- private final boolean _selfTransition;
- private final int _position;
- private final boolean _endState;
- private boolean _followedByAnyLoop;
-
-
- public Position(final int position, final TopicWord word, final boolean selfTransition, final boolean endState)
- {
- _position = position;
- _word = word;
- _selfTransition = selfTransition;
- _endState = endState;
- }
-
-
- }
-
- private static final Position ERROR_POSITION = new Position(Integer.MAX_VALUE,null, true, false);
-
- private static class SimpleState
- {
- Set<Position> _positions;
- Map<TopicWord, SimpleState> _nextState;
- }
-
-
- public void addBinding(AMQShortString bindingKey, TopicMatcherResult result)
- {
-
- TopicMatcherDFAState startingStateMachine;
- TopicMatcherDFAState newStateMachine;
-
- do
- {
- startingStateMachine = _stateMachine.get();
- if(startingStateMachine == null)
- {
- newStateMachine = createStateMachine(bindingKey, result);
- }
- else
- {
- newStateMachine = startingStateMachine.mergeStateMachines(createStateMachine(bindingKey, result));
- }
-
- }
- while(!_stateMachine.compareAndSet(startingStateMachine,newStateMachine));
-
- }
-
- public Collection<TopicMatcherResult> parse(AMQShortString routingKey)
- {
- TopicMatcherDFAState stateMachine = _stateMachine.get();
- if(stateMachine == null)
- {
- return Collections.EMPTY_SET;
- }
- else
- {
- return stateMachine.parse(_dictionary,routingKey);
- }
- }
-
-
- TopicMatcherDFAState createStateMachine(AMQShortString bindingKey, TopicMatcherResult result)
- {
- List<TopicWord> wordList = createTopicWordList(bindingKey);
- int wildCards = 0;
- for(TopicWord word : wordList)
- {
- if(word == TopicWord.WILDCARD_WORD)
- {
- wildCards++;
- }
- }
- if(wildCards == 0)
- {
- TopicMatcherDFAState[] states = new TopicMatcherDFAState[wordList.size()+1];
- states[states.length-1] = new TopicMatcherDFAState(Collections.EMPTY_MAP, Collections.singleton(result));
- for(int i = states.length-2; i >= 0; i--)
- {
- states[i] = new TopicMatcherDFAState(Collections.singletonMap(wordList.get(i),states[i+1]),Collections.EMPTY_SET);
-
- }
- return states[0];
- }
- else if(wildCards == wordList.size())
- {
- Map<TopicWord,TopicMatcherDFAState> stateMap = new HashMap<TopicWord,TopicMatcherDFAState>();
- TopicMatcherDFAState state = new TopicMatcherDFAState(stateMap, Collections.singleton(result));
- stateMap.put(TopicWord.ANY_WORD, state);
- return state;
- }
-
-
- int positionCount = wordList.size() - wildCards;
-
- Position[] positions = new Position[positionCount+1];
-
- int lastWord;
-
- if(wordList.get(wordList.size()-1)== TopicWord.WILDCARD_WORD)
- {
- lastWord = wordList.size()-1;
- positions[positionCount] = new Position(positionCount, TopicWord.ANY_WORD, true, true);
- }
- else
- {
- lastWord = wordList.size();
- positions[positionCount] = new Position(positionCount, TopicWord.ANY_WORD, false, true);
- }
-
-
- int pos = 0;
- int wordPos = 0;
-
-
- while(wordPos < lastWord)
- {
- TopicWord word = wordList.get(wordPos++);
-
- if(word == TopicWord.WILDCARD_WORD)
- {
- int nextWordPos = wordPos++;
- word = wordList.get(nextWordPos);
-
- positions[pos] = new Position(pos++,word,true,false);
- }
- else
- {
- positions[pos] = new Position(pos++,word,false,false);
- }
-
- }
-
-
- for(int p = 0; p<positionCount; p++)
- {
- boolean followedByWildcards = true;
-
- int n = p;
- while(followedByWildcards && n<(positionCount+1))
- {
-
- if(positions[n]._selfTransition)
- {
- break;
- }
- else if(positions[n]._word!=TopicWord.ANY_WORD)
- {
- followedByWildcards = false;
- }
- n++;
- }
-
-
- positions[p]._followedByAnyLoop = followedByWildcards && (n!= positionCount+1);
- }
-
-
- // from each position you transition to a set of other positions.
- // we approach this by examining steps of increasing length - so we
- // look how far we can go from the start position in 1 word, 2 words, etc...
-
- Map<Set<Position>,SimpleState> stateMap = new HashMap<Set<Position>,SimpleState>();
-
-
- SimpleState state = new SimpleState();
- state._positions = Collections.singleton( positions[0] );
- stateMap.put(state._positions, state);
-
- calculateNextStates(state, stateMap, positions);
-
- SimpleState[] simpleStates = stateMap.values().toArray(new SimpleState[stateMap.size()]);
- HashMap<TopicWord, TopicMatcherDFAState>[] dfaStateMaps = new HashMap[simpleStates.length];
- Map<SimpleState, TopicMatcherDFAState> simple2DFAMap = new HashMap<SimpleState, TopicMatcherDFAState>();
-
- for(int i = 0; i < simpleStates.length; i++)
- {
-
- Collection<TopicMatcherResult> results;
- boolean endState = false;
-
- for(Position p : simpleStates[i]._positions)
- {
- if(p._endState)
- {
- endState = true;
- break;
- }
- }
-
- if(endState)
- {
- results = Collections.singleton(result);
- }
- else
- {
- results = Collections.EMPTY_SET;
- }
-
- dfaStateMaps[i] = new HashMap<TopicWord, TopicMatcherDFAState>();
- simple2DFAMap.put(simpleStates[i], new TopicMatcherDFAState(dfaStateMaps[i],results));
-
- }
- for(int i = 0; i < simpleStates.length; i++)
- {
- SimpleState simpleState = simpleStates[i];
-
- Map<TopicWord, SimpleState> nextSimpleStateMap = simpleState._nextState;
- for(Map.Entry<TopicWord, SimpleState> stateMapEntry : nextSimpleStateMap.entrySet())
- {
- dfaStateMaps[i].put(stateMapEntry.getKey(), simple2DFAMap.get(stateMapEntry.getValue()));
- }
-
- }
-
- return simple2DFAMap.get(state);
-
- }
-
-
-
- private void calculateNextStates(final SimpleState state,
- final Map<Set<Position>, SimpleState> stateMap,
- final Position[] positions)
- {
- Map<TopicWord, Set<Position>> transitions = new HashMap<TopicWord,Set<Position>>();
-
- for(Position pos : state._positions)
- {
- if(pos._selfTransition)
- {
- Set<Position> dest = transitions.get(TopicWord.ANY_WORD);
- if(dest == null)
- {
- dest = new HashSet<Position>();
- transitions.put(TopicWord.ANY_WORD,dest);
- }
- dest.add(pos);
- }
-
- final int nextPos = pos._position + 1;
- Position nextPosition = nextPos == positions.length ? ERROR_POSITION : positions[nextPos];
-
- Set<Position> dest = transitions.get(pos._word);
- if(dest == null)
- {
- dest = new HashSet<Position>();
- transitions.put(pos._word,dest);
- }
- dest.add(nextPosition);
-
- }
-
- Set<Position> anyWordTransitions = transitions.get(TopicWord.ANY_WORD);
- if(anyWordTransitions != null)
- {
- for(Set<Position> dest : transitions.values())
- {
- dest.addAll(anyWordTransitions);
- }
- }
-
- state._nextState = new HashMap<TopicWord, SimpleState>();
-
- for(Map.Entry<TopicWord,Set<Position>> dest : transitions.entrySet())
- {
-
- if(dest.getValue().size()>1)
- {
- dest.getValue().remove(ERROR_POSITION);
- }
- Position loopingTerminal = null;
- for(Position destPos : dest.getValue())
- {
- if(destPos._selfTransition && destPos._endState)
- {
- loopingTerminal = destPos;
- break;
- }
- }
-
- if(loopingTerminal!=null)
- {
- dest.setValue(Collections.singleton(loopingTerminal));
- }
- else
- {
- Position anyLoop = null;
- for(Position destPos : dest.getValue())
- {
- if(destPos._followedByAnyLoop)
- {
- if(anyLoop == null || anyLoop._position<destPos._position)
- {
- anyLoop = destPos;
- }
- }
- }
- if(anyLoop != null)
- {
- Collection<Position> removals = new ArrayList<Position>();
- for(Position destPos : dest.getValue())
- {
- if(destPos._position < anyLoop._position)
- {
- removals.add(destPos);
- }
- }
- dest.getValue().removeAll(removals);
- }
- }
-
- SimpleState stateForEntry = stateMap.get(dest.getValue());
- if(stateForEntry == null)
- {
- stateForEntry = new SimpleState();
- stateForEntry._positions = dest.getValue();
- stateMap.put(dest.getValue(),stateForEntry);
- calculateNextStates(stateForEntry,
- stateMap,
- positions);
- }
- state._nextState.put(dest.getKey(),stateForEntry);
-
-
-
- }
-
- // remove redundant transitions
- SimpleState anyWordState = state._nextState.get(TopicWord.ANY_WORD);
- if(anyWordState != null)
- {
- List<TopicWord> removeList = new ArrayList<TopicWord>();
- for(Map.Entry<TopicWord,SimpleState> entry : state._nextState.entrySet())
- {
- if(entry.getValue() == anyWordState && entry.getKey() != TopicWord.ANY_WORD)
- {
- removeList.add(entry.getKey());
- }
- }
- for(TopicWord removeKey : removeList)
- {
- state._nextState.remove(removeKey);
- }
- }
-
-
- }
-
- private List<TopicWord> createTopicWordList(final AMQShortString bindingKey)
- {
- AMQShortStringTokenizer tokens = bindingKey.tokenize(TOPIC_DELIMITER);
- TopicWord previousWord = null;
-
- List<TopicWord> wordList = new ArrayList<TopicWord>();
-
- while(tokens.hasMoreTokens())
- {
- TopicWord nextWord = _dictionary.getOrCreateWord(tokens.nextToken());
- if(previousWord == TopicWord.WILDCARD_WORD)
- {
-
- if(nextWord == TopicWord.WILDCARD_WORD)
- {
- // consecutive wildcards can be merged
- // i.e. subsequent wildcards can be discarded
- continue;
- }
- else if(nextWord == TopicWord.ANY_WORD)
- {
- // wildcard and anyword can be reordered to always put anyword first
- wordList.set(wordList.size()-1,TopicWord.ANY_WORD);
- nextWord = TopicWord.WILDCARD_WORD;
- }
- }
- wordList.add(nextWord);
- previousWord = nextWord;
-
- }
- return wordList;
- }
-
-
- public static void main(String[] args)
- {
-
- printMatches("#.b.*.*.*.*.*.h.#.j.*.*.*.*.*.*.q.#.r.*.*.*.*.*.*.*.*","a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z");
- printMatches(new String[]{
- "#.a.#",
- "#.b.#",
- "#.c.#",
- "#.d.#",
- "#.e.#",
- "#.f.#",
- "#.g.#",
- "#.h.#",
- "#.i.#",
- "#.j.#",
- "#.k.#",
- "#.l.#",
- "#.m.#",
- "#.n.#",
- "#.o.#",
- "#.p.#",
- "#.q.#"
-
- }, "a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z");
-/*
- printMatches(new String[]{
- "#.a.#",
- "#.b.#",
- "#.c.#",
- "#.d.#",
- "#.e.#",
- "#.f.#",
- "#.g.#",
- "#.h.#",
- "#.i.#",
- "#.j.#",
- "#.k.#",
- "#.l.#",
- "#.m.#",
- "#.n.#",
- "#.o.#",
- "#.p.#",
- "#.q.#",
- "#.r.#",
- "#.s.#",
- "#.t.#",
- "#.u.#",
- "#.v.#",
- "#.w.#",
- "#.x.#",
- "#.y.#",
- "#.z.#"
-
-
- },"a.b");
-
- printMatches("#.b.*.*.*.*.*.h.#.j.*.*.*.*.*.p.#.r.*.*.*.*.*","a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z");
- printMatches("#.b.*.*.*.*.*.h.#.j.*.*.*.*.*.p.#.r.*.*.*.*.*.*.*.*","a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z");
- printMatches("a.#.b.#","a.b.b.b.b.b.b.b.c");
-
-*/
-
- printMatches("","");
- printMatches("a","a");
- printMatches("a","");
- printMatches("","a");
- printMatches("a.b","a.b");
- printMatches("a","a.b");
- printMatches("a.b","a");
- printMatches("*","a");
- printMatches("*.b","a.b");
- printMatches("*.*","a.b");
- printMatches("a.*","a.b");
- printMatches("a.*.#","a.b");
- printMatches("a.#.b","a.b");
-
- printMatches("#.b","a");
- printMatches("#.b","a.b");
- printMatches("#.a.b","a.b");
-
-
- printMatches("#","");
- printMatches("#","a");
- printMatches("#","a.b");
- printMatches("#.#","a.b");
- printMatches("#.*","a.b");
-
- printMatches("#.a.b","a.b");
- printMatches("a.b.#","a.b");
- printMatches("a.#","a.b");
- printMatches("#.*.#","a.b");
- printMatches("#.*.b.#","a.b");
- printMatches("#.a.*.#","a.b");
- printMatches("#.a.#.b.#","a.b");
- printMatches("#.*.#.*.#","a.b");
- printMatches("*.#.*.#","a.b");
- printMatches("#.*.#.*","a.b");
-
-
- printMatches(new String[]{"a.#.b.#","a.*.#.b.#"},"a.b.b.b.b.b.b.b.c");
-
-
- printMatches(new String[]{"a.b", "a.c"},"a.b");
- printMatches(new String[]{"a.#", "a.c", "#.b"},"a.b");
- printMatches(new String[]{"a.#", "a.c", "#.b", "#", "*.*"},"a.b");
-
- printMatches(new String[]{"a.b.c.d.e.#", "a.b.c.d.#", "a.b.c.d.*", "a.b.c.#", "#.e", "a.*.c.d.e","#.c.*.#.*.*"},"a.b.c.d.e");
- printMatches(new String[]{"a.b.c.d.e.#", "a.b.c.d.#", "a.b.c.d.*", "a.b.c.#", "#.e", "a.*.c.d.e","#.c.*.#.*.*"},"a.b.c.d.f.g");
-
-
-
-
- }
-
- private static void printMatches(final String[] bindingKeys, final String routingKey)
- {
- TopicMatcherDFAState sm = null;
- Map<TopicMatcherResult, String> resultMap = new HashMap<TopicMatcherResult, String>();
-
- TopicParser parser = new TopicParser();
-
- long start = System.currentTimeMillis();
- for(int i = 0; i < bindingKeys.length; i++)
- {
- System.out.println((System.currentTimeMillis() - start) + ":\t" + bindingKeys[i]);
- TopicMatcherResult r = new TopicMatcherResult(){};
- resultMap.put(r, bindingKeys[i]);
- AMQShortString bindingKeyShortString = new AMQShortString(bindingKeys[i]);
-
- System.err.println("=====================================================");
- System.err.println("Adding binding key: " + bindingKeyShortString);
- System.err.println("-----------------------------------------------------");
-
-
- if(i==0)
- {
- sm = parser.createStateMachine(bindingKeyShortString, r);
- }
- else
- {
- sm = sm.mergeStateMachines(parser.createStateMachine(bindingKeyShortString, r));
- }
- System.err.println(sm.reachableStates());
- System.err.println("=====================================================");
- try
- {
- System.in.read();
- }
- catch (IOException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
- AMQShortString routingKeyShortString = new AMQShortString(routingKey);
-
- Collection<TopicMatcherResult> results = sm.parse(parser._dictionary, routingKeyShortString);
- Collection<String> resultStrings = new ArrayList<String>();
-
- for(TopicMatcherResult result : results)
- {
- resultStrings.add(resultMap.get(result));
- }
-
- final ArrayList<String> nonMatches = new ArrayList<String>(Arrays.asList(bindingKeys));
- nonMatches.removeAll(resultStrings);
- System.out.println("\""+routingKeyShortString+"\" matched with " + resultStrings + " DID NOT MATCH with " + nonMatches);
-
-
- }
-
- private static void printMatches(String bindingKey, String routingKey)
- {
- printMatches(new String[] { bindingKey }, routingKey);
- }
-
-
- private static boolean matches(String bindingKey, String routingKey)
- {
- AMQShortString bindingKeyShortString = new AMQShortString(bindingKey);
- AMQShortString routingKeyShortString = new AMQShortString(routingKey);
- TopicParser parser = new TopicParser();
-
- final TopicMatcherResult result = new TopicMatcherResult(){};
-
- TopicMatcherDFAState sm = parser.createStateMachine(bindingKeyShortString, result);
- return !sm.parse(parser._dictionary,routingKeyShortString).isEmpty();
-
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWord.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWord.java
deleted file mode 100644
index f14d70f8a1..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWord.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.apache.qpid.server.exchange.topic;
-
-import org.apache.qpid.framing.AMQShortString;
-
-import java.util.Map;
-import java.util.HashMap;
-import java.util.concurrent.ConcurrentHashMap;
-
-/*
-*
-* 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.
-*
-*/
-public final class TopicWord
-{
- public static final TopicWord ANY_WORD = new TopicWord("*");
- public static final TopicWord WILDCARD_WORD = new TopicWord("#");
- private String _word;
-
- public TopicWord()
- {
-
- }
-
- public TopicWord(String s)
- {
- _word = s;
- }
-
- public TopicWord(final AMQShortString name)
- {
- _word = name.toString();
- }
-
- public String toString()
- {
- return _word;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWordDictionary.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWordDictionary.java
deleted file mode 100644
index 65a0cd3107..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/exchange/topic/TopicWordDictionary.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.apache.qpid.server.exchange.topic;
-
-import org.apache.qpid.framing.AMQShortString;
-
-import java.util.concurrent.ConcurrentHashMap;
-
-/*
-*
-* 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.
-*
-*/
-public class TopicWordDictionary
-{
- private final ConcurrentHashMap<AMQShortString,TopicWord> _dictionary =
- new ConcurrentHashMap<AMQShortString,TopicWord>();
-
-
-
- public TopicWordDictionary()
- {
- _dictionary.put(new AMQShortString("*"), TopicWord.ANY_WORD);
- _dictionary.put(new AMQShortString("#"), TopicWord.WILDCARD_WORD);
- }
-
-
-
-
- public TopicWord getOrCreateWord(AMQShortString name)
- {
- TopicWord word = _dictionary.putIfAbsent(name, new TopicWord(name));
- if(word == null)
- {
- word = _dictionary.get(name);
- }
- return word;
- }
-
-
- public TopicWord getWord(AMQShortString name)
- {
- TopicWord word = _dictionary.get(name);
- if(word == null)
- {
- word = TopicWord.ANY_WORD;
- }
- return word;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java
deleted file mode 100644
index a964bce306..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java
+++ /dev/null
@@ -1,275 +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.
- */
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.Filterable;
-
-/**
- * An expression which performs an operation on two expression values
- */
-public abstract class ArithmeticExpression<E extends Exception> extends BinaryExpression<E>
-{
-
- protected static final int INTEGER = 1;
- protected static final int LONG = 2;
- protected static final int DOUBLE = 3;
-
- /**
- * @param left
- * @param right
- */
- public ArithmeticExpression(Expression left, Expression right)
- {
- super(left, right);
- }
-
- public static Expression createPlus(Expression left, Expression right)
- {
- return new ArithmeticExpression(left, right)
- {
- protected Object evaluate(Object lvalue, Object rvalue)
- {
- if (lvalue instanceof String)
- {
- String text = (String) lvalue;
- String answer = text + rvalue;
-
- return answer;
- }
- else if (lvalue instanceof Number)
- {
- return plus((Number) lvalue, asNumber(rvalue));
- }
-
- throw new RuntimeException("Cannot call plus operation on: " + lvalue + " and: " + rvalue);
- }
-
- public String getExpressionSymbol()
- {
- return "+";
- }
- };
- }
-
- public static Expression createMinus(Expression left, Expression right)
- {
- return new ArithmeticExpression(left, right)
- {
- protected Object evaluate(Object lvalue, Object rvalue)
- {
- if (lvalue instanceof Number)
- {
- return minus((Number) lvalue, asNumber(rvalue));
- }
-
- throw new RuntimeException("Cannot call minus operation on: " + lvalue + " and: " + rvalue);
- }
-
- public String getExpressionSymbol()
- {
- return "-";
- }
- };
- }
-
- public static Expression createMultiply(Expression left, Expression right)
- {
- return new ArithmeticExpression(left, right)
- {
-
- protected Object evaluate(Object lvalue, Object rvalue)
- {
- if (lvalue instanceof Number)
- {
- return multiply((Number) lvalue, asNumber(rvalue));
- }
-
- throw new RuntimeException("Cannot call multiply operation on: " + lvalue + " and: " + rvalue);
- }
-
- public String getExpressionSymbol()
- {
- return "*";
- }
- };
- }
-
- public static Expression createDivide(Expression left, Expression right)
- {
- return new ArithmeticExpression(left, right)
- {
-
- protected Object evaluate(Object lvalue, Object rvalue)
- {
- if (lvalue instanceof Number)
- {
- return divide((Number) lvalue, asNumber(rvalue));
- }
-
- throw new RuntimeException("Cannot call divide operation on: " + lvalue + " and: " + rvalue);
- }
-
- public String getExpressionSymbol()
- {
- return "/";
- }
- };
- }
-
- public static Expression createMod(Expression left, Expression right)
- {
- return new ArithmeticExpression(left, right)
- {
-
- protected Object evaluate(Object lvalue, Object rvalue)
- {
- if (lvalue instanceof Number)
- {
- return mod((Number) lvalue, asNumber(rvalue));
- }
-
- throw new RuntimeException("Cannot call mod operation on: " + lvalue + " and: " + rvalue);
- }
-
- public String getExpressionSymbol()
- {
- return "%";
- }
- };
- }
-
- protected Number plus(Number left, Number right)
- {
- switch (numberType(left, right))
- {
-
- case INTEGER:
- return new Integer(left.intValue() + right.intValue());
-
- case LONG:
- return new Long(left.longValue() + right.longValue());
-
- default:
- return new Double(left.doubleValue() + right.doubleValue());
- }
- }
-
- protected Number minus(Number left, Number right)
- {
- switch (numberType(left, right))
- {
-
- case INTEGER:
- return new Integer(left.intValue() - right.intValue());
-
- case LONG:
- return new Long(left.longValue() - right.longValue());
-
- default:
- return new Double(left.doubleValue() - right.doubleValue());
- }
- }
-
- protected Number multiply(Number left, Number right)
- {
- switch (numberType(left, right))
- {
-
- case INTEGER:
- return new Integer(left.intValue() * right.intValue());
-
- case LONG:
- return new Long(left.longValue() * right.longValue());
-
- default:
- return new Double(left.doubleValue() * right.doubleValue());
- }
- }
-
- protected Number divide(Number left, Number right)
- {
- return new Double(left.doubleValue() / right.doubleValue());
- }
-
- protected Number mod(Number left, Number right)
- {
- return new Double(left.doubleValue() % right.doubleValue());
- }
-
- private int numberType(Number left, Number right)
- {
- if (isDouble(left) || isDouble(right))
- {
- return DOUBLE;
- }
- else if ((left instanceof Long) || (right instanceof Long))
- {
- return LONG;
- }
- else
- {
- return INTEGER;
- }
- }
-
- private boolean isDouble(Number n)
- {
- return (n instanceof Float) || (n instanceof Double);
- }
-
- protected Number asNumber(Object value)
- {
- if (value instanceof Number)
- {
- return (Number) value;
- }
- else
- {
- throw new RuntimeException("Cannot convert value: " + value + " into a number");
- }
- }
-
- public Object evaluate(Filterable<E> message) throws E
- {
- Object lvalue = left.evaluate(message);
- if (lvalue == null)
- {
- return null;
- }
-
- Object rvalue = right.evaluate(message);
- if (rvalue == null)
- {
- return null;
- }
-
- return evaluate(lvalue, rvalue);
- }
-
- /**
- * @param lvalue
- * @param rvalue
- * @return
- */
- protected abstract Object evaluate(Object lvalue, Object rvalue);
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java
deleted file mode 100644
index 7308de80d6..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java
+++ /dev/null
@@ -1,106 +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.
- */
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-/**
- * An expression which performs an operation on two expression values.
- */
-public abstract class BinaryExpression<E extends Exception> implements Expression<E>
-{
- protected Expression<E> left;
- protected Expression<E> right;
-
- public BinaryExpression(Expression<E> left, Expression<E> right)
- {
- this.left = left;
- this.right = right;
- }
-
- public Expression<E> getLeft()
- {
- return left;
- }
-
- public Expression<E> getRight()
- {
- return right;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "(" + left.toString() + " " + getExpressionSymbol() + " " + right.toString() + ")";
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object o)
- {
-
- if ((o == null) || !this.getClass().equals(o.getClass()))
- {
- return false;
- }
-
- return toString().equals(o.toString());
-
- }
-
- /**
- * Returns the symbol that represents this binary expression. For example, addition is
- * represented by "+"
- *
- * @return
- */
- public abstract String getExpressionSymbol();
-
- /**
- * @param expression
- */
- public void setRight(Expression<E> expression)
- {
- right = expression;
- }
-
- /**
- * @param expression
- */
- public void setLeft(Expression<E> expression)
- {
- left = expression;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java
deleted file mode 100644
index 9beb9798d0..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java
+++ /dev/null
@@ -1,41 +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.
- */
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.Filterable;
-
-/**
- * A BooleanExpression is an expression that always
- * produces a Boolean result.
- */
-public interface BooleanExpression<E extends Exception> extends Expression<E>
-{
-
- /**
- * @param message
- * @return true if the expression evaluates to Boolean.TRUE.
- * @throws E
- */
- public boolean matches(Filterable<E> message) throws E;
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java
deleted file mode 100644
index 921005c462..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java
+++ /dev/null
@@ -1,601 +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.
- *
- */
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.Filterable;
-
-/**
- * A filter performing a comparison of two objects
- */
-public abstract class ComparisonExpression<E extends Exception> extends BinaryExpression<E> implements BooleanExpression<E>
-{
-
- public static<E extends Exception> BooleanExpression<E> createBetween(Expression<E> value, Expression left, Expression<E> right)
- {
- return LogicExpression.createAND(createGreaterThanEqual(value, left), createLessThanEqual(value, right));
- }
-
- public static<E extends Exception> BooleanExpression<E> createNotBetween(Expression<E> value, Expression<E> left, Expression<E> right)
- {
- return LogicExpression.createOR(createLessThan(value, left), createGreaterThan(value, right));
- }
-
- private static final HashSet REGEXP_CONTROL_CHARS = new HashSet();
-
- static
- {
- REGEXP_CONTROL_CHARS.add(new Character('.'));
- REGEXP_CONTROL_CHARS.add(new Character('\\'));
- REGEXP_CONTROL_CHARS.add(new Character('['));
- REGEXP_CONTROL_CHARS.add(new Character(']'));
- REGEXP_CONTROL_CHARS.add(new Character('^'));
- REGEXP_CONTROL_CHARS.add(new Character('$'));
- REGEXP_CONTROL_CHARS.add(new Character('?'));
- REGEXP_CONTROL_CHARS.add(new Character('*'));
- REGEXP_CONTROL_CHARS.add(new Character('+'));
- REGEXP_CONTROL_CHARS.add(new Character('{'));
- REGEXP_CONTROL_CHARS.add(new Character('}'));
- REGEXP_CONTROL_CHARS.add(new Character('|'));
- REGEXP_CONTROL_CHARS.add(new Character('('));
- REGEXP_CONTROL_CHARS.add(new Character(')'));
- REGEXP_CONTROL_CHARS.add(new Character(':'));
- REGEXP_CONTROL_CHARS.add(new Character('&'));
- REGEXP_CONTROL_CHARS.add(new Character('<'));
- REGEXP_CONTROL_CHARS.add(new Character('>'));
- REGEXP_CONTROL_CHARS.add(new Character('='));
- REGEXP_CONTROL_CHARS.add(new Character('!'));
- }
-
- static class LikeExpression<E extends Exception> extends UnaryExpression<E> implements BooleanExpression<E>
- {
-
- Pattern likePattern;
-
- /**
- * @param right
- */
- public LikeExpression(Expression<E> right, String like, int escape)
- {
- super(right);
-
- StringBuffer regexp = new StringBuffer(like.length() * 2);
- regexp.append("\\A"); // The beginning of the input
- for (int i = 0; i < like.length(); i++)
- {
- char c = like.charAt(i);
- if (escape == (0xFFFF & c))
- {
- i++;
- if (i >= like.length())
- {
- // nothing left to escape...
- break;
- }
-
- char t = like.charAt(i);
- regexp.append("\\x");
- regexp.append(Integer.toHexString(0xFFFF & t));
- }
- else if (c == '%')
- {
- regexp.append(".*?"); // Do a non-greedy match
- }
- else if (c == '_')
- {
- regexp.append("."); // match one
- }
- else if (REGEXP_CONTROL_CHARS.contains(new Character(c)))
- {
- regexp.append("\\x");
- regexp.append(Integer.toHexString(0xFFFF & c));
- }
- else
- {
- regexp.append(c);
- }
- }
-
- regexp.append("\\z"); // The end of the input
-
- likePattern = Pattern.compile(regexp.toString(), Pattern.DOTALL);
- }
-
- /**
- * org.apache.activemq.filter.UnaryExpression#getExpressionSymbol()
- */
- public String getExpressionSymbol()
- {
- return "LIKE";
- }
-
- /**
- * org.apache.activemq.filter.Expression#evaluate(MessageEvaluationContext)
- */
- public Object evaluate(Filterable<E> message) throws E
- {
-
- Object rv = this.getRight().evaluate(message);
-
- if (rv == null)
- {
- return null;
- }
-
- if (!(rv instanceof String))
- {
- return
- Boolean.FALSE;
- // throw new RuntimeException("LIKE can only operate on String identifiers. LIKE attemped on: '" + rv.getClass());
- }
-
- return likePattern.matcher((String) rv).matches() ? Boolean.TRUE : Boolean.FALSE;
- }
-
- public boolean matches(Filterable<E> message) throws E
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
- }
-
- public static BooleanExpression createLike(Expression left, String right, String escape)
- {
- if ((escape != null) && (escape.length() != 1))
- {
- throw new RuntimeException(
- "The ESCAPE string litteral is invalid. It can only be one character. Litteral used: " + escape);
- }
-
- int c = -1;
- if (escape != null)
- {
- c = 0xFFFF & escape.charAt(0);
- }
-
- return new LikeExpression(left, right, c);
- }
-
- public static BooleanExpression createNotLike(Expression left, String right, String escape)
- {
- return UnaryExpression.createNOT(createLike(left, right, escape));
- }
-
- public static BooleanExpression createInFilter(Expression left, List elements)
- {
-
- if (!(left instanceof PropertyExpression))
- {
- throw new RuntimeException("Expected a property for In expression, got: " + left);
- }
-
- return UnaryExpression.createInExpression((PropertyExpression) left, elements, false);
-
- }
-
- public static BooleanExpression createNotInFilter(Expression left, List elements)
- {
-
- if (!(left instanceof PropertyExpression))
- {
- throw new RuntimeException("Expected a property for In expression, got: " + left);
- }
-
- return UnaryExpression.createInExpression((PropertyExpression) left, elements, true);
-
- }
-
- public static BooleanExpression createIsNull(Expression left)
- {
- return doCreateEqual(left, ConstantExpression.NULL);
- }
-
- public static BooleanExpression createIsNotNull(Expression left)
- {
- return UnaryExpression.createNOT(doCreateEqual(left, ConstantExpression.NULL));
- }
-
- public static BooleanExpression createNotEqual(Expression left, Expression right)
- {
- return UnaryExpression.createNOT(createEqual(left, right));
- }
-
- public static BooleanExpression createEqual(Expression left, Expression right)
- {
- checkEqualOperand(left);
- checkEqualOperand(right);
- checkEqualOperandCompatability(left, right);
-
- return doCreateEqual(left, right);
- }
-
- private static<E extends Exception> BooleanExpression<E> doCreateEqual(Expression<E> left, Expression<E> right)
- {
- return new EqualExpression(left, right);
- }
-
- public static BooleanExpression createGreaterThan(final Expression left, final Expression right)
- {
- checkLessThanOperand(left);
- checkLessThanOperand(right);
-
- return new ComparisonExpression(left, right)
- {
- protected boolean asBoolean(int answer)
- {
- return answer > 0;
- }
-
- public String getExpressionSymbol()
- {
- return ">";
- }
- };
- }
-
- public static BooleanExpression createGreaterThanEqual(final Expression left, final Expression right)
- {
- checkLessThanOperand(left);
- checkLessThanOperand(right);
-
- return new ComparisonExpression(left, right)
- {
- protected boolean asBoolean(int answer)
- {
- return answer >= 0;
- }
-
- public String getExpressionSymbol()
- {
- return ">=";
- }
- };
- }
-
- public static BooleanExpression createLessThan(final Expression left, final Expression right)
- {
- checkLessThanOperand(left);
- checkLessThanOperand(right);
-
- return new ComparisonExpression(left, right)
- {
-
- protected boolean asBoolean(int answer)
- {
- return answer < 0;
- }
-
- public String getExpressionSymbol()
- {
- return "<";
- }
-
- };
- }
-
- public static BooleanExpression createLessThanEqual(final Expression left, final Expression right)
- {
- checkLessThanOperand(left);
- checkLessThanOperand(right);
-
- return new ComparisonExpression(left, right)
- {
-
- protected boolean asBoolean(int answer)
- {
- return answer <= 0;
- }
-
- public String getExpressionSymbol()
- {
- return "<=";
- }
- };
- }
-
- /**
- * Only Numeric expressions can be used in >, >=, < or <= expressions.s
- *
- * @param expr
- */
- public static void checkLessThanOperand(Expression expr)
- {
- if (expr instanceof ConstantExpression)
- {
- Object value = ((ConstantExpression) expr).getValue();
- if (value instanceof Number)
- {
- return;
- }
-
- // Else it's boolean or a String..
- throw new RuntimeException("Value '" + expr + "' cannot be compared.");
- }
-
- if (expr instanceof BooleanExpression)
- {
- throw new RuntimeException("Value '" + expr + "' cannot be compared.");
- }
- }
-
- /**
- * Validates that the expression can be used in == or <> expression.
- * Cannot not be NULL TRUE or FALSE litterals.
- *
- * @param expr
- */
- public static void checkEqualOperand(Expression expr)
- {
- if (expr instanceof ConstantExpression)
- {
- Object value = ((ConstantExpression) expr).getValue();
- if (value == null)
- {
- throw new RuntimeException("'" + expr + "' cannot be compared.");
- }
- }
- }
-
- /**
- *
- * @param left
- * @param right
- */
- private static void checkEqualOperandCompatability(Expression left, Expression right)
- {
- if ((left instanceof ConstantExpression) && (right instanceof ConstantExpression))
- {
- if ((left instanceof BooleanExpression) && !(right instanceof BooleanExpression))
- {
- throw new RuntimeException("'" + left + "' cannot be compared with '" + right + "'");
- }
- }
- }
-
- /**
- * @param left
- * @param right
- */
- public ComparisonExpression(Expression left, Expression right)
- {
- super(left, right);
- }
-
- public Object evaluate(Filterable<E> message) throws E
- {
- Comparable lv = (Comparable) left.evaluate(message);
- if (lv == null)
- {
- return null;
- }
-
- Comparable rv = (Comparable) right.evaluate(message);
- if (rv == null)
- {
- return null;
- }
-
- return compare(lv, rv);
- }
-
- protected Boolean compare(Comparable lv, Comparable rv)
- {
- Class lc = lv.getClass();
- Class rc = rv.getClass();
- // If the the objects are not of the same type,
- // try to convert up to allow the comparison.
- if (lc != rc)
- {
- if (lc == Byte.class)
- {
- if (rc == Short.class)
- {
- lv = new Short(((Number) lv).shortValue());
- }
- else if (rc == Integer.class)
- {
- lv = new Integer(((Number) lv).intValue());
- }
- else if (rc == Long.class)
- {
- lv = new Long(((Number) lv).longValue());
- }
- else if (rc == Float.class)
- {
- lv = new Float(((Number) lv).floatValue());
- }
- else if (rc == Double.class)
- {
- lv = new Double(((Number) lv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else if (lc == Short.class)
- {
- if (rc == Integer.class)
- {
- lv = new Integer(((Number) lv).intValue());
- }
- else if (rc == Long.class)
- {
- lv = new Long(((Number) lv).longValue());
- }
- else if (rc == Float.class)
- {
- lv = new Float(((Number) lv).floatValue());
- }
- else if (rc == Double.class)
- {
- lv = new Double(((Number) lv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else if (lc == Integer.class)
- {
- if (rc == Long.class)
- {
- lv = new Long(((Number) lv).longValue());
- }
- else if (rc == Float.class)
- {
- lv = new Float(((Number) lv).floatValue());
- }
- else if (rc == Double.class)
- {
- lv = new Double(((Number) lv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else if (lc == Long.class)
- {
- if (rc == Integer.class)
- {
- rv = new Long(((Number) rv).longValue());
- }
- else if (rc == Float.class)
- {
- lv = new Float(((Number) lv).floatValue());
- }
- else if (rc == Double.class)
- {
- lv = new Double(((Number) lv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else if (lc == Float.class)
- {
- if (rc == Integer.class)
- {
- rv = new Float(((Number) rv).floatValue());
- }
- else if (rc == Long.class)
- {
- rv = new Float(((Number) rv).floatValue());
- }
- else if (rc == Double.class)
- {
- lv = new Double(((Number) lv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else if (lc == Double.class)
- {
- if (rc == Integer.class)
- {
- rv = new Double(((Number) rv).doubleValue());
- }
- else if (rc == Long.class)
- {
- rv = new Double(((Number) rv).doubleValue());
- }
- else if (rc == Float.class)
- {
- rv = new Float(((Number) rv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else
- {
- return Boolean.FALSE;
- }
- }
-
- return asBoolean(lv.compareTo(rv)) ? Boolean.TRUE : Boolean.FALSE;
- }
-
- protected abstract boolean asBoolean(int answer);
-
- public boolean matches(Filterable<E> message) throws E
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
-
- private static class EqualExpression<E extends Exception> extends ComparisonExpression<E>
- {
- public EqualExpression(final Expression<E> left, final Expression<E> right)
- {
- super(left, right);
- }
-
- public Object evaluate(Filterable<E> message) throws E
- {
- Object lv = left.evaluate(message);
- Object rv = right.evaluate(message);
-
- // Iff one of the values is null
- if ((lv == null) ^ (rv == null))
- {
- return Boolean.FALSE;
- }
-
- if ((lv == rv) || lv.equals(rv))
- {
- return Boolean.TRUE;
- }
-
- if ((lv instanceof Comparable) && (rv instanceof Comparable))
- {
- return compare((Comparable) lv, (Comparable) rv);
- }
-
- return Boolean.FALSE;
- }
-
- protected boolean asBoolean(int answer)
- {
- return answer == 0;
- }
-
- public String getExpressionSymbol()
- {
- return "=";
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ConstantExpression.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ConstantExpression.java
deleted file mode 100644
index 3ed2286f2e..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/ConstantExpression.java
+++ /dev/null
@@ -1,211 +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.
- *
- */
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-import java.math.BigDecimal;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.Filterable;
-
-/**
- * Represents a constant expression
- */
-public class ConstantExpression<E extends Exception> implements Expression<E>
-{
-
- static class BooleanConstantExpression<E extends Exception> extends ConstantExpression<E> implements BooleanExpression<E>
- {
- public BooleanConstantExpression(Object value)
- {
- super(value);
- }
-
- public boolean matches(Filterable<E> message) throws E
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
- }
-
- public static final BooleanConstantExpression NULL = new BooleanConstantExpression(null);
- public static final BooleanConstantExpression TRUE = new BooleanConstantExpression(Boolean.TRUE);
- public static final BooleanConstantExpression FALSE = new BooleanConstantExpression(Boolean.FALSE);
-
- private Object value;
-
- public static ConstantExpression createFromDecimal(String text)
- {
-
- // Strip off the 'l' or 'L' if needed.
- if (text.endsWith("l") || text.endsWith("L"))
- {
- text = text.substring(0, text.length() - 1);
- }
-
- Number value;
- try
- {
- value = new Long(text);
- }
- catch (NumberFormatException e)
- {
- // The number may be too big to fit in a long.
- value = new BigDecimal(text);
- }
-
- long l = value.longValue();
- if ((Integer.MIN_VALUE <= l) && (l <= Integer.MAX_VALUE))
- {
- value = new Integer(value.intValue());
- }
-
- return new ConstantExpression(value);
- }
-
- public static ConstantExpression createFromHex(String text)
- {
- Number value = new Long(Long.parseLong(text.substring(2), 16));
- long l = value.longValue();
- if ((Integer.MIN_VALUE <= l) && (l <= Integer.MAX_VALUE))
- {
- value = new Integer(value.intValue());
- }
-
- return new ConstantExpression(value);
- }
-
- public static ConstantExpression createFromOctal(String text)
- {
- Number value = new Long(Long.parseLong(text, 8));
- long l = value.longValue();
- if ((Integer.MIN_VALUE <= l) && (l <= Integer.MAX_VALUE))
- {
- value = new Integer(value.intValue());
- }
-
- return new ConstantExpression(value);
- }
-
- public static ConstantExpression createFloat(String text)
- {
- Number value = new Double(text);
-
- return new ConstantExpression(value);
- }
-
- public ConstantExpression(Object value)
- {
- this.value = value;
- }
-
- public Object evaluate(Filterable<E> message) throws E
- {
- return value;
- }
-
- public Object getValue()
- {
- return value;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- if (value == null)
- {
- return "NULL";
- }
-
- if (value instanceof Boolean)
- {
- return ((Boolean) value).booleanValue() ? "TRUE" : "FALSE";
- }
-
- if (value instanceof String)
- {
- return encodeString((String) value);
- }
-
- return value.toString();
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object o)
- {
-
- if ((o == null) || !this.getClass().equals(o.getClass()))
- {
- return false;
- }
-
- return toString().equals(o.toString());
-
- }
-
- /**
- * Encodes the value of string so that it looks like it would look like
- * when it was provided in a selector.
- *
- * @param s
- * @return
- */
- public static String encodeString(String s)
- {
- StringBuffer b = new StringBuffer();
- b.append('\'');
- for (int i = 0; i < s.length(); i++)
- {
- char c = s.charAt(i);
- if (c == '\'')
- {
- b.append(c);
- }
-
- b.append(c);
- }
-
- b.append('\'');
-
- return b.toString();
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java
deleted file mode 100644
index f2ebe41d26..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java
+++ /dev/null
@@ -1,38 +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.
- */
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.Filterable;
-
-/**
- * Represents an expression
- */
-public interface Expression<E extends Exception>
-{
-
- /**
- * @return the value of this expression
- */
- public Object evaluate(Filterable<E> message) throws E;
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManager.java
deleted file mode 100644
index dd3c126ee5..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManager.java
+++ /dev/null
@@ -1,39 +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.
- *
- *
- */
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.Filterable;
-import org.apache.qpid.AMQException;
-
-public interface FilterManager<E extends Exception>
-{
- void add(MessageFilter<E> filter);
-
- void remove(MessageFilter<E> filter);
-
- boolean allAllow(Filterable<E> msg);
-
- boolean hasFilters();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java
deleted file mode 100644
index a7f49d0566..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.filter;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.common.AMQPFilterTypes;
-import org.apache.qpid.framing.FieldTable;
-
-
-public class FilterManagerFactory
-{
- //private final static Logger _logger = LoggerFactory.getLogger(FilterManagerFactory.class);
- private final static org.apache.log4j.Logger _logger = org.apache.log4j.Logger.getLogger(FilterManagerFactory.class);
-
- //fixme move to a common class so it can be refered to from client code.
-
- public static FilterManager createManager(FieldTable filters) throws AMQException
- {
- FilterManager manager = null;
-
- if (filters != null)
- {
-
-
-
- if(filters.containsKey(AMQPFilterTypes.JMS_SELECTOR.getValue()))
- {
- String selector = filters.getString(AMQPFilterTypes.JMS_SELECTOR.getValue());
-
- if (selector != null && !selector.equals(""))
- {
- manager = new SimpleFilterManager();
- manager.add(new JMSSelectorFilter(selector));
- }
-
- }
-
-
- }
- else
- {
- _logger.debug("No Filters found.");
- }
-
-
- return manager;
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java
deleted file mode 100644
index 96c9353872..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.filter;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.filter.jms.selector.SelectorParser;
-import org.apache.qpid.server.queue.Filterable;
-
-
-public class JMSSelectorFilter<E extends Exception> implements MessageFilter<E>
-{
- private final static Logger _logger = org.apache.log4j.Logger.getLogger(JMSSelectorFilter.class);
-
- private String _selector;
- private BooleanExpression<E> _matcher;
-
- public JMSSelectorFilter(String selector) throws AMQException
- {
- _selector = selector;
- _matcher = new SelectorParser().parse(selector);
- }
-
- public boolean matches(Filterable<E> message) throws E
- {
- boolean match = _matcher.matches(message);
- if(_logger.isDebugEnabled())
- {
- _logger.debug(message + " match(" + match + ") selector(" + System.identityHashCode(_selector) + "):" + _selector);
- }
- return match;
- }
-
- public String getSelector()
- {
- return _selector;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java
deleted file mode 100644
index 094363ed9a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java
+++ /dev/null
@@ -1,122 +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.
- */
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.Filterable;
-
-/**
- * A filter performing a comparison of two objects
- */
-public abstract class LogicExpression<E extends Exception> extends BinaryExpression<E> implements BooleanExpression<E>
-{
-
- public static<E extends Exception> BooleanExpression createOR(BooleanExpression<E> lvalue, BooleanExpression<E> rvalue)
- {
- return new OrExpression(lvalue, rvalue);
- }
-
- public static<E extends Exception> BooleanExpression createAND(BooleanExpression<E> lvalue, BooleanExpression<E> rvalue)
- {
- return new AndExpression(lvalue, rvalue);
- }
-
- /**
- * @param left
- * @param right
- */
- public LogicExpression(BooleanExpression left, BooleanExpression right)
- {
- super(left, right);
- }
-
- public abstract Object evaluate(Filterable<E> message) throws E;
-
- public boolean matches(Filterable<E> message) throws E
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
-
- private static class OrExpression<E extends Exception> extends LogicExpression<E>
- {
- public OrExpression(final BooleanExpression<E> lvalue, final BooleanExpression<E> rvalue)
- {
- super(lvalue, rvalue);
- }
-
- public Object evaluate(Filterable<E> message) throws E
- {
-
- Boolean lv = (Boolean) left.evaluate(message);
- // Can we do an OR shortcut??
- if ((lv != null) && lv.booleanValue())
- {
- return Boolean.TRUE;
- }
-
- Boolean rv = (Boolean) right.evaluate(message);
-
- return (rv == null) ? null : rv;
- }
-
- public String getExpressionSymbol()
- {
- return "OR";
- }
- }
-
- private static class AndExpression<E extends Exception> extends LogicExpression<E>
- {
- public AndExpression(final BooleanExpression<E> lvalue, final BooleanExpression<E> rvalue)
- {
- super(lvalue, rvalue);
- }
-
- public Object evaluate(Filterable<E> message) throws E
- {
-
- Boolean lv = (Boolean) left.evaluate(message);
-
- // Can we do an AND shortcut??
- if (lv == null)
- {
- return null;
- }
-
- if (!lv.booleanValue())
- {
- return Boolean.FALSE;
- }
-
- Boolean rv = (Boolean) right.evaluate(message);
-
- return (rv == null) ? null : rv;
- }
-
- public String getExpressionSymbol()
- {
- return "AND";
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/MessageFilter.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/MessageFilter.java
deleted file mode 100644
index 58fc55f8e6..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/MessageFilter.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.filter;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.Filterable;
-
-public interface MessageFilter<E extends Exception>
-{
- boolean matches(Filterable<E> message) throws E;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java
deleted file mode 100644
index f1b3b2511d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java
+++ /dev/null
@@ -1,42 +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.
- *
- *
- */
-package org.apache.qpid.server.filter;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.Filterable;
-
-public class NoConsumerFilter implements MessageFilter
-{
- private final static Logger _logger = org.apache.log4j.Logger.getLogger(NoConsumerFilter.class);
-
-
- public NoConsumerFilter() throws AMQException
- {
- _logger.info("Created NoConsumerFilter");
- }
-
- public boolean matches(Filterable message)
- {
- return true;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java
deleted file mode 100644
index b30c70dac3..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java
+++ /dev/null
@@ -1,268 +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.
- *
- */
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-import java.util.HashMap;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.CommonContentHeaderProperties;
-import org.apache.qpid.server.queue.Filterable;
-
-/**
- * Represents a property expression
- */
-public class PropertyExpression<E extends Exception> implements Expression<E>
-{
- // Constants - defined the same as JMS
- private static final int NON_PERSISTENT = 1;
- private static final int PERSISTENT = 2;
- private static final int DEFAULT_PRIORITY = 4;
-
- private static final Logger _logger = org.apache.log4j.Logger.getLogger(PropertyExpression.class);
-
- private static final HashMap<String, Expression<? extends Exception>> JMS_PROPERTY_EXPRESSIONS = new HashMap<String, Expression<? extends Exception>>();
-
- {
- JMS_PROPERTY_EXPRESSIONS.put("JMSDestination", new Expression<E>()
- {
- public Object evaluate(Filterable<E> message)
- {
- //TODO
- return null;
- }
- });
- JMS_PROPERTY_EXPRESSIONS.put("JMSReplyTo", new ReplyToExpression());
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSType", new TypeExpression());
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSDeliveryMode", new DeliveryModeExpression());
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSPriority", new PriorityExpression());
-
- JMS_PROPERTY_EXPRESSIONS.put("AMQMessageID", new MessageIDExpression());
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSTimestamp", new TimestampExpression());
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSCorrelationID", new CorrelationIdExpression());
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSExpiration", new ExpirationExpression());
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSRedelivered", new Expression<E>()
- {
- public Object evaluate(Filterable message) throws E
- {
- return message.isRedelivered();
- }
- });
- }
-
- private final String name;
- private final Expression<E> jmsPropertyExpression;
-
- public boolean outerTest()
- {
- return false;
- }
-
- public PropertyExpression(String name)
- {
- this.name = name;
-
-
-
- jmsPropertyExpression = (Expression<E>) JMS_PROPERTY_EXPRESSIONS.get(name);
- }
-
- public Object evaluate(Filterable<E> message) throws E
- {
-
- if (jmsPropertyExpression != null)
- {
- return jmsPropertyExpression.evaluate(message);
- }
- else
- {
-
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties) message.getContentHeaderBody().properties;
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Looking up property:" + name);
- _logger.debug("Properties are:" + _properties.getHeaders().keySet());
- }
-
- return _properties.getHeaders().getObject(name);
- }
- }
-
- public String getName()
- {
- return name;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return name;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- public int hashCode()
- {
- return name.hashCode();
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object o)
- {
-
- if ((o == null) || !this.getClass().equals(o.getClass()))
- {
- return false;
- }
-
- return name.equals(((PropertyExpression) o).name);
-
- }
-
- private static class ReplyToExpression<E extends Exception> implements Expression<E>
- {
- public Object evaluate(Filterable<E> message) throws E
- {
-
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
- AMQShortString replyTo = _properties.getReplyTo();
-
- return (replyTo == null) ? null : replyTo.toString();
-
- }
-
- }
-
- private static class TypeExpression<E extends Exception> implements Expression<E>
- {
- public Object evaluate(Filterable<E> message) throws E
- {
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
- AMQShortString type = _properties.getType();
-
- return (type == null) ? null : type.toString();
-
- }
- }
-
- private static class DeliveryModeExpression<E extends Exception> implements Expression<E>
- {
- public Object evaluate(Filterable<E> message) throws E
- {
- int mode = message.isPersistent() ? PERSISTENT : NON_PERSISTENT;
- if (_logger.isDebugEnabled())
- {
- _logger.debug("JMSDeliveryMode is :" + mode);
- }
-
- return mode;
- }
- }
-
- private static class PriorityExpression<E extends Exception> implements Expression<E>
- {
- public Object evaluate(Filterable<E> message) throws E
- {
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
-
- return (int) _properties.getPriority();
- }
- }
-
- private static class MessageIDExpression<E extends Exception> implements Expression<E>
- {
- public Object evaluate(Filterable<E> message) throws E
- {
-
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
- AMQShortString messageId = _properties.getMessageId();
-
- return (messageId == null) ? null : messageId;
-
- }
- }
-
- private static class TimestampExpression<E extends Exception> implements Expression<E>
- {
- public Object evaluate(Filterable<E> message) throws E
- {
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
-
- return _properties.getTimestamp();
- }
- }
-
- private static class CorrelationIdExpression<E extends Exception> implements Expression<E>
- {
- public Object evaluate(Filterable<E> message) throws E
- {
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
- AMQShortString correlationId = _properties.getCorrelationId();
-
- return (correlationId == null) ? null : correlationId.toString();
- }
- }
-
- private static class ExpirationExpression<E extends Exception> implements Expression<E>
- {
- public Object evaluate(Filterable<E> message) throws E
- {
-
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
-
- return _properties.getExpiration();
-
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java
deleted file mode 100644
index cb738e1489..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.filter;
-
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.Filterable;
-
-public class SimpleFilterManager implements FilterManager<AMQException>
-{
- private final Logger _logger = Logger.getLogger(SimpleFilterManager.class);
-
- private final ConcurrentLinkedQueue<MessageFilter<AMQException>> _filters;
-
- public SimpleFilterManager()
- {
- _logger.debug("Creating SimpleFilterManager");
- _filters = new ConcurrentLinkedQueue<MessageFilter<AMQException>>();
- }
-
- public void add(MessageFilter<AMQException> filter)
- {
- _filters.add(filter);
- }
-
- public void remove(MessageFilter<AMQException> filter)
- {
- _filters.remove(filter);
- }
-
- public boolean allAllow(Filterable<AMQException> msg)
- {
- for (MessageFilter<AMQException> filter : _filters)
- {
- try
- {
- if (!filter.matches(msg))
- {
- return false;
- }
- }
- catch (AMQException e)
- {
- //fixme
- e.printStackTrace();
- return false;
- }
- }
- return true;
- }
-
- public boolean hasFilters()
- {
- return !_filters.isEmpty();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java
deleted file mode 100644
index 799a38af5a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java
+++ /dev/null
@@ -1,369 +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.
- *
- */
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-import java.math.BigDecimal;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.Filterable;
-
-/**
- * An expression which performs an operation on two expression values
- */
-public abstract class UnaryExpression<E extends Exception> implements Expression<E>
-{
-
- private static final BigDecimal BD_LONG_MIN_VALUE = BigDecimal.valueOf(Long.MIN_VALUE);
- protected Expression<E> right;
-
- public static<E extends Exception> Expression<E> createNegate(Expression<E> left)
- {
- return new NegativeExpression(left);
- }
-
- public static<E extends Exception> BooleanExpression createInExpression(PropertyExpression<E> right, List elements, final boolean not)
- {
-
- // Use a HashSet if there are many elements.
- Collection t;
- if (elements.size() == 0)
- {
- t = null;
- }
- else if (elements.size() < 5)
- {
- t = elements;
- }
- else
- {
- t = new HashSet(elements);
- }
-
- final Collection inList = t;
-
- return new InExpression(right, inList, not);
- }
-
- abstract static class BooleanUnaryExpression<E extends Exception> extends UnaryExpression<E> implements BooleanExpression<E>
- {
- public BooleanUnaryExpression(Expression<E> left)
- {
- super(left);
- }
-
- public boolean matches(Filterable<E> message) throws E
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
- }
- ;
-
- public static<E extends Exception> BooleanExpression<E> createNOT(BooleanExpression<E> left)
- {
- return new NotExpression(left);
- }
-
- public static BooleanExpression createXPath(final String xpath)
- {
- return new XPathExpression(xpath);
- }
-
- public static BooleanExpression createXQuery(final String xpath)
- {
- return new XQueryExpression(xpath);
- }
-
- public static<E extends Exception> BooleanExpression createBooleanCast(Expression<E> left)
- {
- return new BooleanCastExpression(left);
- }
-
- private static Number negate(Number left)
- {
- Class clazz = left.getClass();
- if (clazz == Integer.class)
- {
- return new Integer(-left.intValue());
- }
- else if (clazz == Long.class)
- {
- return new Long(-left.longValue());
- }
- else if (clazz == Float.class)
- {
- return new Float(-left.floatValue());
- }
- else if (clazz == Double.class)
- {
- return new Double(-left.doubleValue());
- }
- else if (clazz == BigDecimal.class)
- {
- // We ussually get a big deciamal when we have Long.MIN_VALUE constant in the
- // Selector. Long.MIN_VALUE is too big to store in a Long as a positive so we store it
- // as a Big decimal. But it gets Negated right away.. to here we try to covert it back
- // to a Long.
- BigDecimal bd = (BigDecimal) left;
- bd = bd.negate();
-
- if (BD_LONG_MIN_VALUE.compareTo(bd) == 0)
- {
- return new Long(Long.MIN_VALUE);
- }
-
- return bd;
- }
- else
- {
- throw new RuntimeException("Don't know how to negate: " + left);
- }
- }
-
- public UnaryExpression(Expression left)
- {
- this.right = left;
- }
-
- public Expression<E> getRight()
- {
- return right;
- }
-
- public void setRight(Expression expression)
- {
- right = expression;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "(" + getExpressionSymbol() + " " + right.toString() + ")";
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see java.lang.Object#hashCode()
- */
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object o)
- {
-
- if ((o == null) || !this.getClass().equals(o.getClass()))
- {
- return false;
- }
-
- return toString().equals(o.toString());
-
- }
-
- /**
- * Returns the symbol that represents this binary expression. For example, addition is
- * represented by "+"
- *
- * @return
- */
- public abstract String getExpressionSymbol();
-
- private static class NegativeExpression<E extends Exception> extends UnaryExpression<E>
- {
- public NegativeExpression(final Expression<E> left)
- {
- super(left);
- }
-
- public Object evaluate(Filterable<E> message) throws E
- {
- Object rvalue = right.evaluate(message);
- if (rvalue == null)
- {
- return null;
- }
-
- if (rvalue instanceof Number)
- {
- return negate((Number) rvalue);
- }
-
- return null;
- }
-
- public String getExpressionSymbol()
- {
- return "-";
- }
- }
-
- private static class InExpression<E extends Exception> extends BooleanUnaryExpression<E>
- {
- private final Collection _inList;
- private final boolean _not;
-
- public InExpression(final PropertyExpression<E> right, final Collection inList, final boolean not)
- {
- super(right);
- _inList = inList;
- _not = not;
- }
-
- public Object evaluate(Filterable<E> message) throws E
- {
-
- Object rvalue = right.evaluate(message);
- if (rvalue == null)
- {
- return null;
- }
-
- if (rvalue.getClass() != String.class)
- {
- return null;
- }
-
- if (((_inList != null) && _inList.contains(rvalue)) ^ _not)
- {
- return Boolean.TRUE;
- }
- else
- {
- return Boolean.FALSE;
- }
-
- }
-
- public String toString()
- {
- StringBuffer answer = new StringBuffer();
- answer.append(right);
- answer.append(" ");
- answer.append(getExpressionSymbol());
- answer.append(" ( ");
-
- int count = 0;
- for (Iterator i = _inList.iterator(); i.hasNext();)
- {
- Object o = (Object) i.next();
- if (count != 0)
- {
- answer.append(", ");
- }
-
- answer.append(o);
- count++;
- }
-
- answer.append(" )");
-
- return answer.toString();
- }
-
- public String getExpressionSymbol()
- {
- if (_not)
- {
- return "NOT IN";
- }
- else
- {
- return "IN";
- }
- }
- }
-
- private static class NotExpression<E extends Exception> extends BooleanUnaryExpression<E>
- {
- public NotExpression(final BooleanExpression<E> left)
- {
- super(left);
- }
-
- public Object evaluate(Filterable<E> message) throws E
- {
- Boolean lvalue = (Boolean) right.evaluate(message);
- if (lvalue == null)
- {
- return null;
- }
-
- return lvalue.booleanValue() ? Boolean.FALSE : Boolean.TRUE;
- }
-
- public String getExpressionSymbol()
- {
- return "NOT";
- }
- }
-
- private static class BooleanCastExpression<E extends Exception> extends BooleanUnaryExpression<E>
- {
- public BooleanCastExpression(final Expression<E> left)
- {
- super(left);
- }
-
- public Object evaluate(Filterable<E> message) throws E
- {
- Object rvalue = right.evaluate(message);
- if (rvalue == null)
- {
- return null;
- }
-
- if (!rvalue.getClass().equals(Boolean.class))
- {
- return Boolean.FALSE;
- }
-
- return ((Boolean) rvalue).booleanValue() ? Boolean.TRUE : Boolean.FALSE;
- }
-
- public String toString()
- {
- return right.toString();
- }
-
- public String getExpressionSymbol()
- {
- return "";
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XPathExpression.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XPathExpression.java
deleted file mode 100644
index 1311178fb1..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XPathExpression.java
+++ /dev/null
@@ -1,127 +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.
- */
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.Filterable;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * Used to evaluate an XPath Expression in a JMS selector.
- */
-public final class XPathExpression implements BooleanExpression {
-
- private static final Logger log = Logger.getLogger(XPathExpression.class);
- private static final String EVALUATOR_SYSTEM_PROPERTY = "org.apache.qpid.server.filter.XPathEvaluatorClassName";
- private static final String DEFAULT_EVALUATOR_CLASS_NAME=XalanXPathEvaluator.class.getName();
-
- private static final Constructor EVALUATOR_CONSTRUCTOR;
-
- static {
- String cn = System.getProperty(EVALUATOR_SYSTEM_PROPERTY, DEFAULT_EVALUATOR_CLASS_NAME);
- Constructor m = null;
- try {
- try {
- m = getXPathEvaluatorConstructor(cn);
- } catch (Throwable e) {
- log.warn("Invalid "+XPathEvaluator.class.getName()+" implementation: "+cn+", reason: "+e,e);
- cn = DEFAULT_EVALUATOR_CLASS_NAME;
- try {
- m = getXPathEvaluatorConstructor(cn);
- } catch (Throwable e2) {
- log.error("Default XPath evaluator could not be loaded",e);
- }
- }
- } finally {
- EVALUATOR_CONSTRUCTOR = m;
- }
- }
-
- private static Constructor getXPathEvaluatorConstructor(String cn) throws ClassNotFoundException, SecurityException, NoSuchMethodException {
- Class c = XPathExpression.class.getClassLoader().loadClass(cn);
- if( !XPathEvaluator.class.isAssignableFrom(c) ) {
- throw new ClassCastException(""+c+" is not an instance of "+XPathEvaluator.class);
- }
- return c.getConstructor(new Class[]{String.class});
- }
-
- private final String xpath;
- private final XPathEvaluator evaluator;
-
- static public interface XPathEvaluator {
- public boolean evaluate(Filterable message) throws AMQException;
- }
-
- XPathExpression(String xpath) {
- this.xpath = xpath;
- this.evaluator = createEvaluator(xpath);
- }
-
- private XPathEvaluator createEvaluator(String xpath2) {
- try {
- return (XPathEvaluator)EVALUATOR_CONSTRUCTOR.newInstance(new Object[]{xpath});
- } catch (InvocationTargetException e) {
- Throwable cause = e.getCause();
- if( cause instanceof RuntimeException ) {
- throw (RuntimeException)cause;
- }
- throw new RuntimeException("Invalid XPath Expression: "+xpath+" reason: "+e.getMessage(), e);
- } catch (Throwable e) {
- throw new RuntimeException("Invalid XPath Expression: "+xpath+" reason: "+e.getMessage(), e);
- }
- }
-
- public Object evaluate(Filterable message) throws AMQException {
-// try {
-//FIXME this is flow to disk work
-// if( message.isDropped() )
-// return null;
- return evaluator.evaluate(message) ? Boolean.TRUE : Boolean.FALSE;
-// } catch (IOException e) {
-//
-// JMSException exception = new JMSException(e.getMessage());
-// exception.initCause(e);
-// throw exception;
-//
-// }
-
- }
-
- public String toString() {
- return "XPATH "+ConstantExpression.encodeString(xpath);
- }
-
- /**
- * @param message
- * @return true if the expression evaluates to Boolean.TRUE.
- * @throws AMQException
- */
- public boolean matches(Filterable message) throws AMQException
- {
- Object object = evaluate(message);
- return object!=null && object==Boolean.TRUE;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XQueryExpression.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XQueryExpression.java
deleted file mode 100644
index c13f81cd08..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XQueryExpression.java
+++ /dev/null
@@ -1,58 +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.
- */
-package org.apache.qpid.server.filter;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.Filterable;
-
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-/**
- * Used to evaluate an XQuery Expression in a JMS selector.
- */
-public final class XQueryExpression implements BooleanExpression {
- private final String xpath;
-
- XQueryExpression(String xpath) {
- super();
- this.xpath = xpath;
- }
-
- public Object evaluate(Filterable message) throws AMQException {
- return Boolean.FALSE;
- }
-
- public String toString() {
- return "XQUERY "+ConstantExpression.encodeString(xpath);
- }
-
- /**
- * @param message
- * @return true if the expression evaluates to Boolean.TRUE.
- * @throws AMQException
- */
- public boolean matches(Filterable message) throws AMQException
- {
- Object object = evaluate(message);
- return object!=null && object==Boolean.TRUE;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XalanXPathEvaluator.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XalanXPathEvaluator.java
deleted file mode 100644
index cc67776682..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/filter/XalanXPathEvaluator.java
+++ /dev/null
@@ -1,103 +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.
- */
-
-package org.apache.qpid.server.filter;
-//
-// Based on like named file from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
-//
-
-import java.io.ByteArrayInputStream;
-import java.io.StringReader;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.Filterable;
-import org.apache.xpath.CachedXPathAPI;
-import org.w3c.dom.Document;
-import org.w3c.dom.traversal.NodeIterator;
-import org.xml.sax.InputSource;
-
-public class XalanXPathEvaluator implements XPathExpression.XPathEvaluator {
-
- private final String xpath;
-
- public XalanXPathEvaluator(String xpath) {
- this.xpath = xpath;
- }
-
- public boolean evaluate(Filterable m) throws AMQException
- {
- // TODO - we would have to check the content type and then evaluate the content
- // here... is this really a feature we wish to implement? - RobG
- /*
-
- if( m instanceof TextMessage ) {
- String text = ((TextMessage)m).getText();
- return evaluate(text);
- } else if ( m instanceof BytesMessage ) {
- BytesMessage bm = (BytesMessage) m;
- byte data[] = new byte[(int) bm.getBodyLength()];
- bm.readBytes(data);
- return evaluate(data);
- }
- */
- return false;
-
- }
-
- private boolean evaluate(byte[] data) {
- try {
-
- InputSource inputSource = new InputSource(new ByteArrayInputStream(data));
-
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- DocumentBuilder dbuilder = factory.newDocumentBuilder();
- Document doc = dbuilder.parse(inputSource);
-
- CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
- NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc,xpath);
- return iterator.nextNode()!=null;
-
- } catch (Throwable e) {
- return false;
- }
- }
-
- private boolean evaluate(String text) {
- try {
- InputSource inputSource = new InputSource(new StringReader(text));
-
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- DocumentBuilder dbuilder = factory.newDocumentBuilder();
- Document doc = dbuilder.parse(inputSource);
-
- // We should associated the cachedXPathAPI object with the message being evaluated
- // since that should speedup subsequent xpath expressions.
- CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
- NodeIterator iterator = cachedXPathAPI.selectNodeIterator(doc,xpath);
- return iterator.nextNode()!=null;
- } catch (Throwable e) {
- return false;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/AbstractFlowCreditManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/AbstractFlowCreditManager.java
deleted file mode 100644
index 895db7b15b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/AbstractFlowCreditManager.java
+++ /dev/null
@@ -1,62 +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.
-*
-*/
-package org.apache.qpid.server.flow;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.Set;
-import java.util.HashSet;
-
-public abstract class AbstractFlowCreditManager implements FlowCreditManager
-{
- protected final AtomicBoolean _suspended = new AtomicBoolean(false);
- private final Set<FlowCreditManagerListener> _listeners = new HashSet<FlowCreditManagerListener>();
-
- public final void addStateListener(FlowCreditManagerListener listener)
- {
- _listeners.add(listener);
- }
-
- public final boolean removeListener(FlowCreditManagerListener listener)
- {
- return _listeners.remove(listener);
- }
-
- private void notifyListeners(final boolean suspended)
- {
- for(FlowCreditManagerListener listener : _listeners)
- {
- listener.creditStateChanged(!suspended);
- }
- }
-
- protected final void setSuspended(final boolean suspended)
- {
- if(_suspended.compareAndSet(!suspended, suspended))
- {
- notifyListeners(suspended);
- }
- }
-
- protected final void notifyIncreaseBytesCredit()
- {
- notifyListeners(false);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java
deleted file mode 100644
index 96a1071135..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/BytesOnlyCreditManager.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.apache.qpid.server.flow;
-
-import org.apache.qpid.server.queue.AMQMessage;
-
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.Set;
-import java.util.HashSet;
-
-/*
-*
-* 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.
-*
-*/
-public class BytesOnlyCreditManager extends AbstractFlowCreditManager
-{
- private final AtomicLong _bytesCredit;
-
- public BytesOnlyCreditManager(long initialCredit)
- {
- _bytesCredit = new AtomicLong(initialCredit);
- }
-
- public void addCredit(long messageCredit, long bytesCredit)
- {
- _bytesCredit.addAndGet(bytesCredit);
- setSuspended(false);
- }
-
- public void removeAllCredit()
- {
- _bytesCredit.set(0L);
- }
-
- public boolean hasCredit()
- {
- return _bytesCredit.get() > 0L;
- }
-
- public boolean useCreditForMessage(AMQMessage msg)
- {
- final long msgSize = msg.getSize();
- if(hasCredit())
- {
- if(_bytesCredit.addAndGet(-msgSize) >= 0)
- {
- return true;
- }
- else
- {
- _bytesCredit.addAndGet(msgSize);
- setSuspended(true);
- return false;
- }
- }
- else
- {
- return false;
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java
deleted file mode 100644
index a249a6e63a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/FlowCreditManager.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.apache.qpid.server.flow;
-
-import org.apache.qpid.server.queue.AMQMessage;
-
-/*
-*
-* 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.
-*
-*/
-public interface FlowCreditManager
-{
-
- public static interface FlowCreditManagerListener
- {
- void creditStateChanged(boolean hasCredit);
- }
-
- void addStateListener(FlowCreditManagerListener listener);
-
- boolean removeListener(FlowCreditManagerListener listener);
-
- public void addCredit(long messageCredit, long bytesCredit);
-
- public void removeAllCredit();
-
- public boolean hasCredit();
-
- public boolean useCreditForMessage(AMQMessage msg);
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java
deleted file mode 100644
index d63431c3eb..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/LimitlessCreditManager.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.apache.qpid.server.flow;
-
-import org.apache.qpid.server.queue.AMQMessage;
-
-/*
-*
-* 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.
-*
-*/
-public class LimitlessCreditManager extends AbstractFlowCreditManager implements FlowCreditManager
-{
- public void addCredit(long messageCredit, long bytesCredit)
- {
- }
-
- public void removeAllCredit()
- {
- }
-
- public boolean hasCredit()
- {
- return true;
- }
-
- public boolean useCreditForMessage(AMQMessage msg)
- {
- return true;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java
deleted file mode 100644
index 9c377481de..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageAndBytesCreditManager.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.apache.qpid.server.flow;
-
-import org.apache.qpid.server.queue.AMQMessage;
-
-import java.util.concurrent.atomic.AtomicLong;
-
-/*
-*
-* 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.
-*
-*/
-public class MessageAndBytesCreditManager extends AbstractFlowCreditManager implements FlowCreditManager
-{
- private long _messageCredit;
- private long _bytesCredit;
-
- MessageAndBytesCreditManager(final long messageCredit, final long bytesCredit)
- {
- _messageCredit = messageCredit;
- _bytesCredit = bytesCredit;
- }
-
- public synchronized void addCredit(long messageCredit, long bytesCredit)
- {
- _messageCredit += messageCredit;
- _bytesCredit += bytesCredit;
- setSuspended(hasCredit());
- }
-
- public synchronized void removeAllCredit()
- {
- _messageCredit = 0L;
- _bytesCredit = 0L;
- setSuspended(true);
- }
-
- public synchronized boolean hasCredit()
- {
- return (_messageCredit > 0L) && ( _bytesCredit > 0L );
- }
-
- public synchronized boolean useCreditForMessage(AMQMessage msg)
- {
- if(_messageCredit == 0L)
- {
- setSuspended(true);
- return false;
- }
- else
- {
- final long msgSize = msg.getSize();
- if(msgSize > _bytesCredit)
- {
- setSuspended(true);
- return false;
- }
- _messageCredit--;
- _bytesCredit -= msgSize;
- setSuspended(false);
- return true;
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java
deleted file mode 100644
index c1b3a09006..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/MessageOnlyCreditManager.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.apache.qpid.server.flow;
-
-import org.apache.qpid.server.queue.AMQMessage;
-
-import java.util.concurrent.atomic.AtomicLong;
-
-/*
-*
-* 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.
-*
-*/
-public class MessageOnlyCreditManager extends AbstractFlowCreditManager implements FlowCreditManager
-{
- private final AtomicLong _messageCredit;
-
- public MessageOnlyCreditManager(final long initialCredit)
- {
- _messageCredit = new AtomicLong(initialCredit);
- }
-
- public void addCredit(long messageCredit, long bytesCredit)
- {
- setSuspended(false);
- _messageCredit.addAndGet(messageCredit);
- }
-
- public void removeAllCredit()
- {
- setSuspended(true);
- _messageCredit.set(0L);
- }
-
- public boolean hasCredit()
- {
- return _messageCredit.get() > 0L;
- }
-
- public boolean useCreditForMessage(AMQMessage msg)
- {
- if(hasCredit())
- {
- if(_messageCredit.addAndGet(-1L) >= 0)
- {
- setSuspended(false);
- return true;
- }
- else
- {
- _messageCredit.addAndGet(1L);
- setSuspended(true);
- return false;
- }
- }
- else
- {
- setSuspended(true);
- return false;
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java
deleted file mode 100644
index be0300f2c1..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/flow/Pre0_10CreditManager.java
+++ /dev/null
@@ -1,185 +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.
-*
-*/
-package org.apache.qpid.server.flow;
-
-import org.apache.qpid.server.queue.AMQMessage;
-
-public class Pre0_10CreditManager extends AbstractFlowCreditManager implements FlowCreditManager
-{
-
- private volatile long _bytesCreditLimit;
- private volatile long _messageCreditLimit;
-
- private volatile long _bytesCredit;
- private volatile long _messageCredit;
-
- public Pre0_10CreditManager(long bytesCreditLimit, long messageCreditLimit)
- {
- _bytesCreditLimit = bytesCreditLimit;
- _messageCreditLimit = messageCreditLimit;
- _bytesCredit = bytesCreditLimit;
- _messageCredit = messageCreditLimit;
- }
-
-
- public synchronized void setCreditLimits(final long bytesCreditLimit, final long messageCreditLimit)
- {
- long bytesCreditChange = bytesCreditLimit - _bytesCreditLimit;
- long messageCreditChange = messageCreditLimit - _messageCreditLimit;
-
-
-
- if(bytesCreditChange != 0L)
- {
- if(bytesCreditLimit == 0L)
- {
- _bytesCredit = 0;
- }
- else
- {
- _bytesCredit += bytesCreditChange;
- }
- }
-
-
- if(messageCreditChange != 0L)
- {
- if(messageCreditLimit == 0L)
- {
- _messageCredit = 0;
- }
- else
- {
- _messageCredit += messageCreditChange;
- }
- }
-
-
- _bytesCreditLimit = bytesCreditLimit;
- _messageCreditLimit = messageCreditLimit;
-
- setSuspended(!hasCredit());
-
- }
-
-
- public synchronized void addCredit(final long messageCredit, final long bytesCredit)
- {
- final long messageCreditLimit = _messageCreditLimit;
- boolean notifyIncrease = true;
- if(messageCreditLimit != 0L)
- {
- notifyIncrease = (_messageCredit != 0);
- long newCredit = _messageCredit + messageCredit;
- _messageCredit = newCredit > messageCreditLimit ? messageCreditLimit : newCredit;
- }
-
-
- final long bytesCreditLimit = _bytesCreditLimit;
- if(bytesCreditLimit != 0L)
- {
- long newCredit = _bytesCredit + bytesCredit;
- _bytesCredit = newCredit > bytesCreditLimit ? bytesCreditLimit : newCredit;
- if(notifyIncrease && bytesCredit>0)
- {
- notifyIncreaseBytesCredit();
- }
- }
-
-
-
- setSuspended(!hasCredit());
-
- }
-
- public synchronized void removeAllCredit()
- {
- _bytesCredit = 0L;
- _messageCredit = 0L;
- setSuspended(!hasCredit());
- }
-
- public synchronized boolean hasCredit()
- {
- return (_bytesCreditLimit == 0L || _bytesCredit > 0)
- && (_messageCreditLimit == 0L || _messageCredit > 0);
- }
-
- public synchronized boolean useCreditForMessage(final AMQMessage msg)
- {
- if(_messageCreditLimit != 0L)
- {
- if(_messageCredit != 0L)
- {
- if(_bytesCreditLimit == 0L)
- {
- _messageCredit--;
-
- return true;
- }
- else
- {
- if((_bytesCredit >= msg.getSize()) || (_bytesCredit == _bytesCreditLimit))
- {
- _messageCredit--;
- _bytesCredit -= msg.getSize();
-
- return true;
- }
- else
- {
- //setSuspended(true);
- return false;
- }
- }
- }
- else
- {
- setSuspended(true);
- return false;
- }
- }
- else
- {
- if(_bytesCreditLimit == 0L)
- {
-
- return true;
- }
- else
- {
- if((_bytesCredit >= msg.getSize()) || (_bytesCredit == _bytesCreditLimit))
- {
- _bytesCredit -= msg.getSize();
-
- return true;
- }
- else
- {
- //setSuspended(true);
- return false;
- }
- }
-
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/AccessRequestHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/AccessRequestHandler.java
deleted file mode 100644
index e64eaeae76..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/AccessRequestHandler.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.apache.qpid.server.handler;
-/*
- *
- * 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 org.apache.qpid.framing.*;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.AMQException;
-
-/**
- * @author Apache Software Foundation
- *
- *
- */
-public class AccessRequestHandler implements StateAwareMethodListener<AccessRequestBody>
-{
- private static final AccessRequestHandler _instance = new AccessRequestHandler();
-
-
- public static AccessRequestHandler getInstance()
- {
- return _instance;
- }
-
- private AccessRequestHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, AccessRequestBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
-
- // We don't implement access control class, but to keep clients happy that expect it
- // always use the "0" ticket.
- AccessRequestOkBody response = methodRegistry.createAccessRequestOkBody(0);
-
- session.writeFrame(response.generateFrame(channelId));
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicAckMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicAckMethodHandler.java
deleted file mode 100644
index f90e7c3dff..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicAckMethodHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicAckBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class BasicAckMethodHandler implements StateAwareMethodListener<BasicAckBody>
-{
- private static final Logger _log = Logger.getLogger(BasicAckMethodHandler.class);
-
- private static final BasicAckMethodHandler _instance = new BasicAckMethodHandler();
-
- public static BasicAckMethodHandler getInstance()
- {
- return _instance;
- }
-
- private BasicAckMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, BasicAckBody body, int channelId) throws AMQException
- {
- AMQProtocolSession protocolSession = stateManager.getProtocolSession();
-
-
- if (_log.isDebugEnabled())
- {
- _log.debug("Ack(Tag:" + body.getDeliveryTag() + ":Mult:" + body.getMultiple() + ") received on channel " + channelId);
- }
-
- final AMQChannel channel = protocolSession.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- // this method throws an AMQException if the delivery tag is not known
- channel.acknowledgeMessage(body.getDeliveryTag(), body.getMultiple());
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicCancelMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicCancelMethodHandler.java
deleted file mode 100644
index 29054f55c1..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicCancelMethodHandler.java
+++ /dev/null
@@ -1,74 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicCancelBody;
-import org.apache.qpid.framing.BasicCancelOkBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.log4j.Logger;
-
-public class BasicCancelMethodHandler implements StateAwareMethodListener<BasicCancelBody>
-{
- private static final Logger _log = Logger.getLogger(BasicCancelMethodHandler.class);
-
- private static final BasicCancelMethodHandler _instance = new BasicCancelMethodHandler();
-
- public static BasicCancelMethodHandler getInstance()
- {
- return _instance;
- }
-
- private BasicCancelMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, BasicCancelBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- final AMQChannel channel = session.getChannel(channelId);
-
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- if (_log.isDebugEnabled())
- {
- _log.debug("BasicCancel: for:" + body.getConsumerTag() +
- " nowait:" + body.getNowait());
- }
-
- channel.unsubscribeConsumer(body.getConsumerTag());
- if (!body.getNowait())
- {
- MethodRegistry methodRegistry = session.getMethodRegistry();
- BasicCancelOkBody cancelOkBody = methodRegistry.createBasicCancelOkBody(body.getConsumerTag());
- session.writeFrame(cancelOkBody.generateFrame(channelId));
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java
deleted file mode 100644
index 5342a7f518..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java
+++ /dev/null
@@ -1,168 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.ConsumerTagNotUniqueException;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class BasicConsumeMethodHandler implements StateAwareMethodListener<BasicConsumeBody>
-{
- private static final Logger _logger = Logger.getLogger(BasicConsumeMethodHandler.class);
-
- private static final BasicConsumeMethodHandler _instance = new BasicConsumeMethodHandler();
-
- public static BasicConsumeMethodHandler getInstance()
- {
- return _instance;
- }
-
- private BasicConsumeMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, BasicConsumeBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
-
-
-
- AMQChannel channel = session.getChannel(channelId);
-
- VirtualHost vHost = session.getVirtualHost();
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
- else
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("BasicConsume: from '" + body.getQueue() +
- "' for:" + body.getConsumerTag() +
- " nowait:" + body.getNowait() +
- " args:" + body.getArguments());
- }
-
- AMQQueue queue = body.getQueue() == null ? channel.getDefaultQueue() : vHost.getQueueRegistry().getQueue(body.getQueue().intern());
-
- if (queue == null)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("No queue for '" + body.getQueue() + "'");
- }
- if (body.getQueue() != null)
- {
- String msg = "No such queue, '" + body.getQueue() + "'";
- throw body.getChannelException(AMQConstant.NOT_FOUND, msg);
- }
- else
- {
- String msg = "No queue name provided, no default queue defined.";
- throw body.getConnectionException(AMQConstant.NOT_ALLOWED, msg);
- }
- }
- else
- {
-
- final AMQShortString consumerTagName;
-
- //Perform ACLs
- vHost.getAccessManager().authorise(session, Permission.CONSUME, body, queue);
-
- if (body.getConsumerTag() != null)
- {
- consumerTagName = body.getConsumerTag().intern();
- }
- else
- {
- consumerTagName = null;
- }
-
- try
- {
- AMQShortString consumerTag = channel.subscribeToQueue(consumerTagName, queue, !body.getNoAck(),
- body.getArguments(), body.getNoLocal(), body.getExclusive());
- if (!body.getNowait())
- {
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createBasicConsumeOkBody(consumerTag);
- session.writeFrame(responseBody.generateFrame(channelId));
-
- }
-
-
- }
- catch (org.apache.qpid.AMQInvalidArgumentException ise)
- {
- _logger.debug("Closing connection due to invalid selector");
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createChannelCloseBody(AMQConstant.INVALID_ARGUMENT.getCode(),
- new AMQShortString(ise.getMessage()),
- body.getClazz(),
- body.getMethod());
- session.writeFrame(responseBody.generateFrame(channelId));
-
-
- }
- catch (ConsumerTagNotUniqueException e)
- {
- AMQShortString msg = new AMQShortString("Non-unique consumer tag, '" + body.getConsumerTag() + "'");
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createConnectionCloseBody(AMQConstant.NOT_ALLOWED.getCode(), // replyCode
- msg, // replytext
- body.getClazz(),
- body.getMethod());
- session.writeFrame(responseBody.generateFrame(0));
- }
- catch (AMQQueue.ExistingExclusiveSubscription e)
- {
- throw body.getChannelException(AMQConstant.ACCESS_REFUSED,
- "Cannot subscribe to queue "
- + queue.getName()
- + " as it already has an existing exclusive consumer");
- }
- catch (AMQQueue.ExistingSubscriptionPreventsExclusive e)
- {
- throw body.getChannelException(AMQConstant.ACCESS_REFUSED,
- "Cannot subscribe to queue "
- + queue.getName()
- + " exclusively as it already has a consumer");
- }
-
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java
deleted file mode 100644
index be1135dd91..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java
+++ /dev/null
@@ -1,187 +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.
- *
- *
- */
-
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicGetBody;
-import org.apache.qpid.framing.BasicGetEmptyBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.flow.FlowCreditManager;
-import org.apache.qpid.server.flow.MessageOnlyCreditManager;
-import org.apache.qpid.server.subscription.SubscriptionImpl;
-import org.apache.qpid.server.subscription.ClientDeliveryMethod;
-import org.apache.qpid.server.subscription.RecordDeliveryMethod;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.subscription.SubscriptionFactoryImpl;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.queue.SimpleAMQQueue;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class BasicGetMethodHandler implements StateAwareMethodListener<BasicGetBody>
-{
- private static final Logger _log = Logger.getLogger(BasicGetMethodHandler.class);
-
- private static final BasicGetMethodHandler _instance = new BasicGetMethodHandler();
-
- public static BasicGetMethodHandler getInstance()
- {
- return _instance;
- }
-
- private BasicGetMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, BasicGetBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
-
- VirtualHost vHost = session.getVirtualHost();
-
- AMQChannel channel = session.getChannel(channelId);
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
- else
- {
- AMQQueue queue = body.getQueue() == null ? channel.getDefaultQueue() : vHost.getQueueRegistry().getQueue(body.getQueue());
- if (queue == null)
- {
- _log.info("No queue for '" + body.getQueue() + "'");
- if(body.getQueue()!=null)
- {
- throw body.getConnectionException(AMQConstant.NOT_FOUND,
- "No such queue, '" + body.getQueue()+ "'");
- }
- else
- {
- throw body.getConnectionException(AMQConstant.NOT_ALLOWED,
- "No queue name provided, no default queue defined.");
- }
- }
- else
- {
-
- //Perform ACLs
- vHost.getAccessManager().authorise(session, Permission.CONSUME, body, queue);
-
- if (!performGet(queue,session, channel, !body.getNoAck()))
- {
- MethodRegistry methodRegistry = session.getMethodRegistry();
- // TODO - set clusterId
- BasicGetEmptyBody responseBody = methodRegistry.createBasicGetEmptyBody(null);
-
-
- session.writeFrame(responseBody.generateFrame(channelId));
- }
- }
- }
- }
-
- public static boolean performGet(final AMQQueue queue,
- final AMQProtocolSession session,
- final AMQChannel channel,
- final boolean acks)
- throws AMQException
- {
-
- final FlowCreditManager singleMessageCredit = new MessageOnlyCreditManager(1L);
-
- final ClientDeliveryMethod getDeliveryMethod = new ClientDeliveryMethod()
- {
-
- int _msg;
-
- public void deliverToClient(final Subscription sub, final QueueEntry entry, final long deliveryTag)
- throws AMQException
- {
- singleMessageCredit.useCreditForMessage(entry.getMessage());
- session.getProtocolOutputConverter().writeGetOk(entry.getMessage(), channel.getChannelId(),
- deliveryTag, queue.getMessageCount());
-
- }
- };
- final RecordDeliveryMethod getRecordMethod = new RecordDeliveryMethod()
- {
-
- public void recordMessageDelivery(final Subscription sub, final QueueEntry entry, final long deliveryTag)
- {
- channel.addUnacknowledgedMessage(entry, deliveryTag, null);
- }
- };
-
- Subscription sub;
- if(acks)
- {
- sub = SubscriptionFactoryImpl.INSTANCE.createSubscription(channel, session, null, acks, null, false, singleMessageCredit, getDeliveryMethod, getRecordMethod);
- }
- else
- {
- sub = new GetNoAckSubscription(channel,
- session,
- null,
- null,
- false,
- singleMessageCredit,
- getDeliveryMethod,
- getRecordMethod);
- }
-
- queue.registerSubscription(sub,false);
- queue.flushSubscription(sub);
- queue.unregisterSubscription(sub);
- return(!singleMessageCredit.hasCredit());
-
-
- }
-
- public static final class GetNoAckSubscription extends SubscriptionImpl.NoAckSubscription
- {
- public GetNoAckSubscription(AMQChannel channel, AMQProtocolSession protocolSession,
- AMQShortString consumerTag, FieldTable filters,
- boolean noLocal, FlowCreditManager creditManager,
- ClientDeliveryMethod deliveryMethod,
- RecordDeliveryMethod recordMethod)
- throws AMQException
- {
- super(channel, protocolSession, consumerTag, filters, noLocal, creditManager, deliveryMethod, recordMethod);
- }
-
- public boolean wouldSuspend(QueueEntry msg)
- {
- return !getCreditManager().useCreditForMessage(msg.getMessage());
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java
deleted file mode 100644
index e8e42454de..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class BasicPublishMethodHandler implements StateAwareMethodListener<BasicPublishBody>
-{
- private static final Logger _logger = Logger.getLogger(BasicPublishMethodHandler.class);
-
- private static final BasicPublishMethodHandler _instance = new BasicPublishMethodHandler();
-
-
- public static BasicPublishMethodHandler getInstance()
- {
- return _instance;
- }
-
- private BasicPublishMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, BasicPublishBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Publish received on channel " + channelId);
- }
-
- AMQShortString exchange = body.getExchange();
- // TODO: check the delivery tag field details - is it unique across the broker or per subscriber?
- if (exchange == null)
- {
- exchange = ExchangeDefaults.DEFAULT_EXCHANGE_NAME;
-
- }
-
- VirtualHost vHost = session.getVirtualHost();
- Exchange e = vHost.getExchangeRegistry().getExchange(exchange);
- // if the exchange does not exist we raise a channel exception
- if (e == null)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Unknown exchange name");
- }
- else
- {
- // The partially populated BasicDeliver frame plus the received route body
- // is stored in the channel. Once the final body frame has been received
- // it is routed to the exchange.
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- //Access Control
- vHost.getAccessManager().authorise(session, Permission.PUBLISH, body, e);
-
- MessagePublishInfo info = session.getMethodRegistry().getProtocolVersionMethodConverter().convertToInfo(body);
- info.setExchange(exchange);
- channel.setPublishFrame(info, e);
- }
- }
-
-}
-
-
-
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicQosHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicQosHandler.java
deleted file mode 100644
index dd3281c65f..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicQosHandler.java
+++ /dev/null
@@ -1,58 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicQosBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.AMQChannel;
-
-public class BasicQosHandler implements StateAwareMethodListener<BasicQosBody>
-{
- private static final BasicQosHandler _instance = new BasicQosHandler();
-
- public static BasicQosHandler getInstance()
- {
- return _instance;
- }
-
- public void methodReceived(AMQStateManager stateManager, BasicQosBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- AMQChannel channel = session.getChannel(channelId);
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- channel.setCredit(body.getPrefetchSize(), body.getPrefetchCount());
-
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createBasicQosOkBody();
- session.writeFrame(responseBody.generateFrame(channelId));
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverMethodHandler.java
deleted file mode 100644
index c7842cd643..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverMethodHandler.java
+++ /dev/null
@@ -1,73 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicRecoverBody;
-import org.apache.qpid.framing.BasicRecoverOkBody;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.amqp_8_0.MethodRegistry_8_0;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class BasicRecoverMethodHandler implements StateAwareMethodListener<BasicRecoverBody>
-{
- private static final Logger _logger = Logger.getLogger(BasicRecoverMethodHandler.class);
-
- private static final BasicRecoverMethodHandler _instance = new BasicRecoverMethodHandler();
-
- public static BasicRecoverMethodHandler getInstance()
- {
- return _instance;
- }
-
- public void methodReceived(AMQStateManager stateManager, BasicRecoverBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- _logger.debug("Recover received on protocol session " + session + " and channel " + channelId);
- AMQChannel channel = session.getChannel(channelId);
-
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- channel.resend(body.getRequeue());
-
- // Qpid 0-8 hacks a synchronous -ok onto recover.
- // In Qpid 0-9 we create a separate sync-recover, sync-recover-ok pair to be "more" compliant
- if(session.getProtocolVersion().equals(ProtocolVersion.v8_0))
- {
- MethodRegistry_8_0 methodRegistry = (MethodRegistry_8_0) session.getMethodRegistry();
- AMQMethodBody recoverOk = methodRegistry.createBasicRecoverOkBody();
- session.writeFrame(recoverOk.generateFrame(channelId));
-
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverSyncMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverSyncMethodHandler.java
deleted file mode 100644
index 2c264c3d45..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverSyncMethodHandler.java
+++ /dev/null
@@ -1,75 +0,0 @@
-package org.apache.qpid.server.handler;
-/*
- *
- * 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 org.apache.log4j.Logger;
-
-import org.apache.qpid.framing.BasicRecoverBody;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.BasicRecoverSyncBody;
-import org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9;
-import org.apache.qpid.framing.amqp_8_0.MethodRegistry_8_0;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.AMQException;
-
-public class BasicRecoverSyncMethodHandler implements StateAwareMethodListener<BasicRecoverSyncBody>
-{
- private static final Logger _logger = Logger.getLogger(BasicRecoverSyncMethodHandler.class);
-
- private static final BasicRecoverSyncMethodHandler _instance = new BasicRecoverSyncMethodHandler();
-
- public static BasicRecoverSyncMethodHandler getInstance()
- {
- return _instance;
- }
-
- public void methodReceived(AMQStateManager stateManager, BasicRecoverSyncBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- _logger.debug("Recover received on protocol session " + session + " and channel " + channelId);
- AMQChannel channel = session.getChannel(channelId);
-
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- channel.resend(body.getRequeue());
-
- // Qpid 0-8 hacks a synchronous -ok onto recover.
- // In Qpid 0-9 we create a separate sync-recover, sync-recover-ok pair to be "more" compliant
- if(session.getProtocolVersion().equals(ProtocolVersion.v0_9))
- {
- MethodRegistry_0_9 methodRegistry = (MethodRegistry_0_9) session.getMethodRegistry();
- AMQMethodBody recoverOk = methodRegistry.createBasicRecoverSyncOkBody();
- session.writeFrame(recoverOk.generateFrame(channelId));
-
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java
deleted file mode 100644
index f3cab10ed7..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicRejectBody;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.log4j.Logger;
-
-public class BasicRejectMethodHandler implements StateAwareMethodListener<BasicRejectBody>
-{
- private static final Logger _logger = Logger.getLogger(BasicRejectMethodHandler.class);
-
- private static BasicRejectMethodHandler _instance = new BasicRejectMethodHandler();
-
- public static BasicRejectMethodHandler getInstance()
- {
- return _instance;
- }
-
- private BasicRejectMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, BasicRejectBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Rejecting:" + body.getDeliveryTag() +
- ": Requeue:" + body.getRequeue() +
- //": Resend:" + evt.getMethod().resend +
- " on channel:" + channel.debugIdentity());
- }
-
- long deliveryTag = body.getDeliveryTag();
-
- QueueEntry message = channel.getUnacknowledgedMessageMap().get(deliveryTag);
-
- if (message == null)
- {
- _logger.warn("Dropping reject request as message is null for tag:" + deliveryTag);
-// throw evt.getMethod().getChannelException(AMQConstant.NOT_FOUND, "Delivery Tag(" + deliveryTag + ")not known");
- }
- else
- {
- if (message.isQueueDeleted())
- {
- _logger.warn("Message's Queue as already been purged, unable to Reject. " +
- "Dropping message should use Dead Letter Queue");
- message = channel.getUnacknowledgedMessageMap().remove(deliveryTag);
- if(message != null)
- {
- message.discard(channel.getStoreContext());
- }
- //sendtoDeadLetterQueue(msg)
- return;
- }
-
- if (!message.getMessage().isReferenced())
- {
- _logger.warn("Message as already been purged, unable to Reject.");
- return;
- }
-
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Rejecting: DT:" + deliveryTag + "-" + message.getMessage().debugIdentity() +
- ": Requeue:" + body.getRequeue() +
- //": Resend:" + evt.getMethod().resend +
- " on channel:" + channel.debugIdentity());
- }
-
- // If we haven't requested message to be resent to this consumer then reject it from ever getting it.
- //if (!evt.getMethod().resend)
- {
- message.reject();
- }
-
- if (body.getRequeue())
- {
- channel.requeue(deliveryTag);
- }
- else
- {
- _logger.warn("Dropping message as requeue not required and there is no dead letter queue");
- message = channel.getUnacknowledgedMessageMap().remove(deliveryTag);
- //sendtoDeadLetterQueue(AMQMessage message)
-// message.queue = channel.getDefaultDeadLetterQueue();
-// channel.requeue(deliveryTag);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseHandler.java
deleted file mode 100644
index 9133cce6b7..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.ChannelCloseBody;
-import org.apache.qpid.framing.ChannelCloseOkBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.AMQChannel;
-
-public class ChannelCloseHandler implements StateAwareMethodListener<ChannelCloseBody>
-{
- private static final Logger _logger = Logger.getLogger(ChannelCloseHandler.class);
-
- private static ChannelCloseHandler _instance = new ChannelCloseHandler();
-
- public static ChannelCloseHandler getInstance()
- {
- return _instance;
- }
-
- private ChannelCloseHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, ChannelCloseBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("Received channel close for id " + channelId + " citing class " + body.getClassId() +
- " and method " + body.getMethodId());
- }
-
-
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getConnectionException(AMQConstant.CHANNEL_ERROR, "Trying to close unknown channel");
- }
-
- session.closeChannel(channelId);
- // Client requested closure so we don't wait for ok we send it
- stateManager.getProtocolSession().closeChannelOk(channelId);
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- ChannelCloseOkBody responseBody = methodRegistry.createChannelCloseOkBody();
- session.writeFrame(responseBody.generateFrame(channelId));
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseOkHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseOkHandler.java
deleted file mode 100644
index a857490e7e..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseOkHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ChannelCloseOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class ChannelCloseOkHandler implements StateAwareMethodListener<ChannelCloseOkBody>
-{
- private static final Logger _logger = Logger.getLogger(ChannelCloseOkHandler.class);
-
- private static ChannelCloseOkHandler _instance = new ChannelCloseOkHandler();
-
- public static ChannelCloseOkHandler getInstance()
- {
- return _instance;
- }
-
- private ChannelCloseOkHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, ChannelCloseOkBody body, int channelId) throws AMQException
- {
-
- _logger.info("Received channel-close-ok for channel-id " + channelId);
-
- // Let the Protocol Session know the channel is now closed.
- stateManager.getProtocolSession().closeChannelOk(channelId);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelFlowHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelFlowHandler.java
deleted file mode 100644
index 696ca8a63b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelFlowHandler.java
+++ /dev/null
@@ -1,66 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class ChannelFlowHandler implements StateAwareMethodListener<ChannelFlowBody>
-{
- private static final Logger _logger = Logger.getLogger(ChannelFlowHandler.class);
-
- private static ChannelFlowHandler _instance = new ChannelFlowHandler();
-
- public static ChannelFlowHandler getInstance()
- {
- return _instance;
- }
-
- private ChannelFlowHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, ChannelFlowBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
-
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- channel.setSuspended(!body.getActive());
- _logger.debug("Channel.Flow for channel " + channelId + ", active=" + body.getActive());
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createChannelFlowOkBody(body.getActive());
- session.writeFrame(responseBody.generateFrame(channelId));
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelOpenHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelOpenHandler.java
deleted file mode 100644
index 054674aed4..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelOpenHandler.java
+++ /dev/null
@@ -1,103 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import java.util.UUID;
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9;
-import org.apache.qpid.framing.amqp_8_0.MethodRegistry_8_0;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class ChannelOpenHandler implements StateAwareMethodListener<ChannelOpenBody>
-{
- private static ChannelOpenHandler _instance = new ChannelOpenHandler();
-
- public static ChannelOpenHandler getInstance()
- {
- return _instance;
- }
-
- private ChannelOpenHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, ChannelOpenBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
-
- final AMQChannel channel = new AMQChannel(session,channelId, virtualHost.getMessageStore()
- );
- session.addChannel(channel);
-
- ChannelOpenOkBody response;
-
- ProtocolVersion pv = session.getProtocolVersion();
-
- if(pv.equals(ProtocolVersion.v8_0))
- {
- MethodRegistry_8_0 methodRegistry = (MethodRegistry_8_0) MethodRegistry.getMethodRegistry(ProtocolVersion.v8_0);
- response = methodRegistry.createChannelOpenOkBody();
-
- }
- else if(pv.equals(ProtocolVersion.v0_9))
- {
- MethodRegistry_0_9 methodRegistry = (MethodRegistry_0_9) MethodRegistry.getMethodRegistry(ProtocolVersion.v0_9);
- UUID uuid = UUID.randomUUID();
- ByteArrayOutputStream output = new ByteArrayOutputStream();
- DataOutputStream dataOut = new DataOutputStream(output);
- try
- {
- dataOut.writeLong(uuid.getMostSignificantBits());
- dataOut.writeLong(uuid.getLeastSignificantBits());
- dataOut.flush();
- dataOut.close();
- }
- catch (IOException e)
- {
- // This *really* shouldn't happen as we're not doing any I/O
- throw new RuntimeException("I/O exception when writing to byte array", e);
- }
-
- // should really associate this channelId to the session
- byte[] channelName = output.toByteArray();
-
- response = methodRegistry.createChannelOpenOkBody(channelName);
- }
- else
- {
- throw new AMQException(AMQConstant.INTERNAL_ERROR, "Got channel open for protocol version not catered for: " + pv, null);
- }
-
-
- session.writeFrame(response.generateFrame(channelId));
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseMethodHandler.java
deleted file mode 100644
index dade5d5f54..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseMethodHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.ConnectionCloseBody;
-import org.apache.qpid.framing.ConnectionCloseOkBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class ConnectionCloseMethodHandler implements StateAwareMethodListener<ConnectionCloseBody>
-{
- private static final Logger _logger = Logger.getLogger(ConnectionCloseMethodHandler.class);
-
- private static ConnectionCloseMethodHandler _instance = new ConnectionCloseMethodHandler();
-
- public static ConnectionCloseMethodHandler getInstance()
- {
- return _instance;
- }
-
- private ConnectionCloseMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, ConnectionCloseBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("ConnectionClose received with reply code/reply text " + body.getReplyCode() + "/" +
- body.getReplyText() + " for " + session);
- }
- try
- {
- session.closeSession();
- }
- catch (Exception e)
- {
- _logger.error("Error closing protocol session: " + e, e);
- }
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- ConnectionCloseOkBody responseBody = methodRegistry.createConnectionCloseOkBody();
- session.writeFrame(responseBody.generateFrame(channelId));
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseOkMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseOkMethodHandler.java
deleted file mode 100644
index bc6e5ab403..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseOkMethodHandler.java
+++ /dev/null
@@ -1,63 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ConnectionCloseOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQState;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class ConnectionCloseOkMethodHandler implements StateAwareMethodListener<ConnectionCloseOkBody>
-{
- private static final Logger _logger = Logger.getLogger(ConnectionCloseOkMethodHandler.class);
-
- private static ConnectionCloseOkMethodHandler _instance = new ConnectionCloseOkMethodHandler();
-
- public static ConnectionCloseOkMethodHandler getInstance()
- {
- return _instance;
- }
-
- private ConnectionCloseOkMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, ConnectionCloseOkBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- //todo should this not do more than just log the method?
- _logger.info("Received Connection-close-ok");
-
- try
- {
- stateManager.changeState(AMQState.CONNECTION_CLOSED);
- session.closeSession();
- }
- catch (Exception e)
- {
- _logger.error("Error closing protocol session: " + e, e);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java
deleted file mode 100644
index f99e650979..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java
+++ /dev/null
@@ -1,99 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.server.state.AMQState;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.log4j.Logger;
-
-public class ConnectionOpenMethodHandler implements StateAwareMethodListener<ConnectionOpenBody>
-{
- private static final Logger _logger = Logger.getLogger(ConnectionOpenMethodHandler.class);
-
- private static ConnectionOpenMethodHandler _instance = new ConnectionOpenMethodHandler();
-
- public static ConnectionOpenMethodHandler getInstance()
- {
- return _instance;
- }
-
- private ConnectionOpenMethodHandler()
- {
- }
-
- private static AMQShortString generateClientID()
- {
- return new AMQShortString(Long.toString(System.currentTimeMillis()));
- }
-
- public void methodReceived(AMQStateManager stateManager, ConnectionOpenBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
-
- //ignore leading '/'
- String virtualHostName;
- if ((body.getVirtualHost() != null) && body.getVirtualHost().charAt(0) == '/')
- {
- virtualHostName = new StringBuilder(body.getVirtualHost().subSequence(1, body.getVirtualHost().length())).toString();
- }
- else
- {
- virtualHostName = body.getVirtualHost() == null ? null : String.valueOf(body.getVirtualHost());
- }
-
- VirtualHost virtualHost = stateManager.getVirtualHostRegistry().getVirtualHost(virtualHostName);
-
- if (virtualHost == null)
- {
- throw body.getConnectionException(AMQConstant.NOT_FOUND, "Unknown virtual host: '" + virtualHostName + "'");
- }
- else
- {
- session.setVirtualHost(virtualHost);
-
- //Perform ACL
- virtualHost.getAccessManager().authorise(session, Permission.ACCESS ,body, virtualHost);
-
- // See Spec (0.8.2). Section 3.1.2 Virtual Hosts
- if (session.getContextKey() == null)
- {
- session.setContextKey(generateClientID());
- }
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createConnectionOpenOkBody(body.getVirtualHost());
-
- stateManager.changeState(AMQState.CONNECTION_OPEN);
-
- session.writeFrame(responseBody.generateFrame(channelId));
-
-
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionSecureOkMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionSecureOkMethodHandler.java
deleted file mode 100644
index 621003be90..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionSecureOkMethodHandler.java
+++ /dev/null
@@ -1,124 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.protocol.HeartbeatConfig;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.AuthenticationResult;
-import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
-import org.apache.qpid.server.state.AMQState;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class ConnectionSecureOkMethodHandler implements StateAwareMethodListener<ConnectionSecureOkBody>
-{
- private static final Logger _logger = Logger.getLogger(ConnectionSecureOkMethodHandler.class);
-
- private static ConnectionSecureOkMethodHandler _instance = new ConnectionSecureOkMethodHandler();
-
- public static ConnectionSecureOkMethodHandler getInstance()
- {
- return _instance;
- }
-
- private ConnectionSecureOkMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, ConnectionSecureOkBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- AuthenticationManager authMgr = ApplicationRegistry.getInstance().getAuthenticationManager();
-
- SaslServer ss = session.getSaslServer();
- if (ss == null)
- {
- throw new AMQException("No SASL context set up in session");
- }
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AuthenticationResult authResult = authMgr.authenticate(ss, body.getResponse());
- switch (authResult.status)
- {
- case ERROR:
- Exception cause = authResult.getCause();
-
- _logger.info("Authentication failed:" + (cause == null ? "" : cause.getMessage()));
-
- // This should be abstracted
- stateManager.changeState(AMQState.CONNECTION_CLOSING);
-
- ConnectionCloseBody connectionCloseBody =
- methodRegistry.createConnectionCloseBody(AMQConstant.NOT_ALLOWED.getCode(),
- AMQConstant.NOT_ALLOWED.getName(),
- body.getClazz(),
- body.getMethod());
-
- session.writeFrame(connectionCloseBody.generateFrame(0));
- disposeSaslServer(session);
- break;
- case SUCCESS:
- _logger.info("Connected as: " + ss.getAuthorizationID());
- stateManager.changeState(AMQState.CONNECTION_NOT_TUNED);
-
- ConnectionTuneBody tuneBody =
- methodRegistry.createConnectionTuneBody(0xFFFF,
- ConnectionStartOkMethodHandler.getConfiguredFrameSize(),
- HeartbeatConfig.getInstance().getDelay());
- session.writeFrame(tuneBody.generateFrame(0));
- session.setAuthorizedID(new UsernamePrincipal(ss.getAuthorizationID()));
- disposeSaslServer(session);
- break;
- case CONTINUE:
- stateManager.changeState(AMQState.CONNECTION_NOT_AUTH);
-
- ConnectionSecureBody secureBody = methodRegistry.createConnectionSecureBody(authResult.challenge);
- session.writeFrame(secureBody.generateFrame(0));
- }
- }
-
- private void disposeSaslServer(AMQProtocolSession ps)
- {
- SaslServer ss = ps.getSaslServer();
- if (ss != null)
- {
- ps.setSaslServer(null);
- try
- {
- ss.dispose();
- }
- catch (SaslException e)
- {
- _logger.error("Error disposing of Sasl server: " + e);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java
deleted file mode 100644
index f53e56601b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java
+++ /dev/null
@@ -1,164 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.protocol.HeartbeatConfig;
-import org.apache.qpid.server.protocol.AMQMinaProtocolSession;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.AuthenticationResult;
-import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
-import org.apache.qpid.server.state.AMQState;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-
-public class ConnectionStartOkMethodHandler implements StateAwareMethodListener<ConnectionStartOkBody>
-{
- private static final Logger _logger = Logger.getLogger(ConnectionStartOkMethodHandler.class);
-
- private static ConnectionStartOkMethodHandler _instance = new ConnectionStartOkMethodHandler();
-
- private static final int DEFAULT_FRAME_SIZE = 65536;
-
- public static ConnectionStartOkMethodHandler getInstance()
- {
- return _instance;
- }
-
- private ConnectionStartOkMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, ConnectionStartOkBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- _logger.info("SASL Mechanism selected: " + body.getMechanism());
- _logger.info("Locale selected: " + body.getLocale());
-
- AuthenticationManager authMgr = ApplicationRegistry.getInstance().getAuthenticationManager();//session.getVirtualHost().getAuthenticationManager();
-
- SaslServer ss = null;
- try
- {
- ss = authMgr.createSaslServer(String.valueOf(body.getMechanism()), session.getLocalFQDN());
-
- if (ss == null)
- {
- throw body.getConnectionException(AMQConstant.RESOURCE_ERROR, "Unable to create SASL Server:" + body.getMechanism()
- );
- }
-
- session.setSaslServer(ss);
-
- AuthenticationResult authResult = authMgr.authenticate(ss, body.getResponse());
-
- //save clientProperties
- if (session.getClientProperties() == null)
- {
- session.setClientProperties(body.getClientProperties());
- }
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
-
- switch (authResult.status)
- {
- case ERROR:
- Exception cause = authResult.getCause();
-
- _logger.info("Authentication failed:" + (cause == null ? "" : cause.getMessage()));
-
- stateManager.changeState(AMQState.CONNECTION_CLOSING);
-
- ConnectionCloseBody closeBody =
- methodRegistry.createConnectionCloseBody(AMQConstant.NOT_ALLOWED.getCode(), // replyCode
- AMQConstant.NOT_ALLOWED.getName(),
- body.getClazz(),
- body.getMethod());
-
- session.writeFrame(closeBody.generateFrame(0));
- disposeSaslServer(session);
- break;
-
- case SUCCESS:
- _logger.info("Connected as: " + ss.getAuthorizationID());
- session.setAuthorizedID(new UsernamePrincipal(ss.getAuthorizationID()));
-
- stateManager.changeState(AMQState.CONNECTION_NOT_TUNED);
-
- ConnectionTuneBody tuneBody = methodRegistry.createConnectionTuneBody(0xFFFF,
- getConfiguredFrameSize(),
- HeartbeatConfig.getInstance().getDelay());
- session.writeFrame(tuneBody.generateFrame(0));
- break;
- case CONTINUE:
- stateManager.changeState(AMQState.CONNECTION_NOT_AUTH);
-
- ConnectionSecureBody secureBody = methodRegistry.createConnectionSecureBody(authResult.challenge);
- session.writeFrame(secureBody.generateFrame(0));
- }
- }
- catch (SaslException e)
- {
- disposeSaslServer(session);
- throw new AMQException("SASL error: " + e, e);
- }
- }
-
- private void disposeSaslServer(AMQProtocolSession ps)
- {
- SaslServer ss = ps.getSaslServer();
- if (ss != null)
- {
- ps.setSaslServer(null);
- try
- {
- ss.dispose();
- }
- catch (SaslException e)
- {
- _logger.error("Error disposing of Sasl server: " + e);
- }
- }
- }
-
- static int getConfiguredFrameSize()
- {
- final Configuration config = ApplicationRegistry.getInstance().getConfiguration();
- final int framesize = config.getInt("advanced.framesize", DEFAULT_FRAME_SIZE);
- _logger.info("Framesize set to " + framesize);
- return framesize;
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionTuneOkMethodHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionTuneOkMethodHandler.java
deleted file mode 100644
index 0fe8c5dc92..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionTuneOkMethodHandler.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ConnectionTuneOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQState;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class ConnectionTuneOkMethodHandler implements StateAwareMethodListener<ConnectionTuneOkBody>
-{
- private static final Logger _logger = Logger.getLogger(ConnectionTuneOkMethodHandler.class);
-
- private static ConnectionTuneOkMethodHandler _instance = new ConnectionTuneOkMethodHandler();
-
- public static ConnectionTuneOkMethodHandler getInstance()
- {
- return _instance;
- }
-
- public void methodReceived(AMQStateManager stateManager, ConnectionTuneOkBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug(body);
- }
- stateManager.changeState(AMQState.CONNECTION_NOT_OPENED);
- session.initHeartbeats(body.getHeartbeat());
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java
deleted file mode 100644
index ccd42204d9..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java
+++ /dev/null
@@ -1,178 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-/**
- * @author Apache Software Foundation
- *
- *
- */
-public class ExchangeBoundHandler implements StateAwareMethodListener<ExchangeBoundBody>
-{
- private static final ExchangeBoundHandler _instance = new ExchangeBoundHandler();
-
- public static final int OK = 0;
-
- public static final int EXCHANGE_NOT_FOUND = 1;
-
- public static final int QUEUE_NOT_FOUND = 2;
-
- public static final int NO_BINDINGS = 3;
-
- public static final int QUEUE_NOT_BOUND = 4;
-
- public static final int NO_QUEUE_BOUND_WITH_RK = 5;
-
- public static final int SPECIFIC_QUEUE_NOT_BOUND_WITH_RK = 6;
-
- public static ExchangeBoundHandler getInstance()
- {
- return _instance;
- }
-
- private ExchangeBoundHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, ExchangeBoundBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- VirtualHost virtualHost = session.getVirtualHost();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
- MethodRegistry methodRegistry = session.getMethodRegistry();
-
-
-
-
- AMQShortString exchangeName = body.getExchange();
- AMQShortString queueName = body.getQueue();
- AMQShortString routingKey = body.getRoutingKey();
- if (exchangeName == null)
- {
- throw new AMQException("Exchange exchange must not be null");
- }
- Exchange exchange = virtualHost.getExchangeRegistry().getExchange(exchangeName);
- ExchangeBoundOkBody response;
- if (exchange == null)
- {
-
-
- response = methodRegistry.createExchangeBoundOkBody(EXCHANGE_NOT_FOUND,
- new AMQShortString("Exchange " + exchangeName + " not found"));
- }
- else if (routingKey == null)
- {
- if (queueName == null)
- {
- if (exchange.hasBindings())
- {
- response = methodRegistry.createExchangeBoundOkBody(OK, null);
- }
- else
- {
-
- response = methodRegistry.createExchangeBoundOkBody(NO_BINDINGS, // replyCode
- null); // replyText
- }
- }
- else
- {
-
- AMQQueue queue = queueRegistry.getQueue(queueName);
- if (queue == null)
- {
-
- response = methodRegistry.createExchangeBoundOkBody(QUEUE_NOT_FOUND, // replyCode
- new AMQShortString("Queue " + queueName + " not found")); // replyText
- }
- else
- {
- if (exchange.isBound(queue))
- {
-
- response = methodRegistry.createExchangeBoundOkBody(OK, // replyCode
- null); // replyText
- }
- else
- {
-
- response = methodRegistry.createExchangeBoundOkBody(QUEUE_NOT_BOUND, // replyCode
- new AMQShortString("Queue " + queueName + " not bound to exchange " + exchangeName)); // replyText
- }
- }
- }
- }
- else if (queueName != null)
- {
- AMQQueue queue = queueRegistry.getQueue(queueName);
- if (queue == null)
- {
-
- response = methodRegistry.createExchangeBoundOkBody(QUEUE_NOT_FOUND, // replyCode
- new AMQShortString("Queue " + queueName + " not found")); // replyText
- }
- else
- {
- if (exchange.isBound(body.getRoutingKey(), queue))
- {
-
- response = methodRegistry.createExchangeBoundOkBody(OK, // replyCode
- null); // replyText
- }
- else
- {
-
- response = methodRegistry.createExchangeBoundOkBody(SPECIFIC_QUEUE_NOT_BOUND_WITH_RK, // replyCode
- new AMQShortString("Queue " + queueName + " not bound with routing key " +
- body.getRoutingKey() + " to exchange " + exchangeName)); // replyText
- }
- }
- }
- else
- {
- if (exchange.isBound(body.getRoutingKey()))
- {
-
- response = methodRegistry.createExchangeBoundOkBody(OK, // replyCode
- null); // replyText
- }
- else
- {
-
- response = methodRegistry.createExchangeBoundOkBody(NO_QUEUE_BOUND_WITH_RK, // replyCode
- new AMQShortString("No queue bound with routing key " + body.getRoutingKey() +
- " to exchange " + exchangeName)); // replyText
- }
- }
- session.writeFrame(response.generateFrame(channelId));
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeclareHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeclareHandler.java
deleted file mode 100644
index 39b048aecb..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeclareHandler.java
+++ /dev/null
@@ -1,116 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQUnknownExchangeType;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.exchange.ExchangeFactory;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class ExchangeDeclareHandler implements StateAwareMethodListener<ExchangeDeclareBody>
-{
- private static final Logger _logger = Logger.getLogger(ExchangeDeclareHandler.class);
-
- private static final ExchangeDeclareHandler _instance = new ExchangeDeclareHandler();
-
- public static ExchangeDeclareHandler getInstance()
- {
- return _instance;
- }
-
-
-
- private ExchangeDeclareHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, ExchangeDeclareBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
- ExchangeFactory exchangeFactory = virtualHost.getExchangeFactory();
-
- if (!body.getPassive())
- {
- //Perform ACL if request is not passive
- virtualHost.getAccessManager().authorise(session, Permission.CREATE, body);
- }
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Request to declare exchange of type " + body.getType() + " with name " + body.getExchange());
- }
- synchronized(exchangeRegistry)
- {
- Exchange exchange = exchangeRegistry.getExchange(body.getExchange());
-
-
-
- if (exchange == null)
- {
- if(body.getPassive() && ((body.getType() == null) || body.getType().length() ==0))
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Unknown exchange: " + body.getExchange());
- }
- else
- {
- try
- {
-
- exchange = exchangeFactory.createExchange(body.getExchange() == null ? null : body.getExchange().intern(),
- body.getType() == null ? null : body.getType().intern(),
- body.getDurable(),
- body.getPassive(), body.getTicket());
- exchangeRegistry.registerExchange(exchange);
- }
- catch(AMQUnknownExchangeType e)
- {
- throw body.getConnectionException(AMQConstant.COMMAND_INVALID, "Unknown exchange: " + body.getExchange(),e);
- }
- }
- }
- else if (!exchange.getType().equals(body.getType()))
- {
-
- throw new AMQConnectionException(AMQConstant.NOT_ALLOWED, "Attempt to redeclare exchange: " + body.getExchange() + " of type " + exchange.getType() + " to " + body.getType() +".",body.getClazz(), body.getMethod(),body.getMajor(),body.getMinor(),null);
- }
-
- }
- if(!body.getNowait())
- {
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createExchangeDeclareOkBody();
- session.writeFrame(responseBody.generateFrame(channelId));
-
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeleteHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeleteHandler.java
deleted file mode 100644
index 888ffcb2e5..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeleteHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ExchangeDeleteBody;
-import org.apache.qpid.framing.ExchangeDeleteOkBody;
-import org.apache.qpid.server.exchange.ExchangeInUseException;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class ExchangeDeleteHandler implements StateAwareMethodListener<ExchangeDeleteBody>
-{
- private static final ExchangeDeleteHandler _instance = new ExchangeDeleteHandler();
-
- public static ExchangeDeleteHandler getInstance()
- {
- return _instance;
- }
-
- private ExchangeDeleteHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, ExchangeDeleteBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
-
- //Perform ACLs
- virtualHost.getAccessManager().authorise(session, Permission.DELETE,body,
- exchangeRegistry.getExchange(body.getExchange()));
-
- try
- {
- exchangeRegistry.unregisterExchange(body.getExchange(), body.getIfUnused());
-
- ExchangeDeleteOkBody responseBody = session.getMethodRegistry().createExchangeDeleteOkBody();
-
- session.writeFrame(responseBody.generateFrame(channelId));
- }
- catch (ExchangeInUseException e)
- {
- // TODO: sort out consistent channel close mechanism that does all clean up etc.
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/OnCurrentThreadExecutor.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/OnCurrentThreadExecutor.java
deleted file mode 100644
index ac516b6133..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/OnCurrentThreadExecutor.java
+++ /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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import java.util.concurrent.Executor;
-
-/**
- * An executor that executes the task on the current thread.
- */
-public class OnCurrentThreadExecutor implements Executor
-{
- public void execute(Runnable command)
- {
- command.run();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java
deleted file mode 100644
index 46182e8c00..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java
+++ /dev/null
@@ -1,139 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQInvalidRoutingKeyException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class QueueBindHandler implements StateAwareMethodListener<QueueBindBody>
-{
- private static final Logger _log = Logger.getLogger(QueueBindHandler.class);
-
- private static final QueueBindHandler _instance = new QueueBindHandler();
-
- public static QueueBindHandler getInstance()
- {
- return _instance;
- }
-
- private QueueBindHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, QueueBindBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
-
-
- final AMQQueue queue;
- final AMQShortString routingKey;
-
- if (body.getQueue() == null)
- {
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- queue = channel.getDefaultQueue();
-
- if (queue == null)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "No default queue defined on channel and queue was null");
- }
-
- if (body.getRoutingKey() == null)
- {
- routingKey = queue.getName();
- }
- else
- {
- routingKey = body.getRoutingKey().intern();
- }
- }
- else
- {
- queue = queueRegistry.getQueue(body.getQueue());
- routingKey = body.getRoutingKey() == null ? AMQShortString.EMPTY_STRING : body.getRoutingKey().intern();
- }
-
- if (queue == null)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Queue " + body.getQueue() + " does not exist.");
- }
- final Exchange exch = exchangeRegistry.getExchange(body.getExchange());
- if (exch == null)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Exchange " + body.getExchange() + " does not exist.");
- }
-
-
- try
- {
-
- //Perform ACLs
- virtualHost.getAccessManager().authorise(session, Permission.BIND, body, exch, queue, routingKey);
-
- if (!exch.isBound(routingKey, body.getArguments(), queue))
- {
- queue.bind(exch, routingKey, body.getArguments());
- }
- }
- catch (AMQInvalidRoutingKeyException rke)
- {
- throw body.getChannelException(AMQConstant.INVALID_ROUTING_KEY, routingKey.toString());
- }
- catch (AMQException e)
- {
- throw body.getChannelException(AMQConstant.CHANNEL_ERROR, e.toString());
- }
-
- if (_log.isInfoEnabled())
- {
- _log.info("Binding queue " + queue + " to exchange " + exch + " with routing key " + routingKey);
- }
- if (!body.getNowait())
- {
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createQueueBindOkBody();
- session.writeFrame(responseBody.generateFrame(channelId));
-
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java
deleted file mode 100644
index 3047643021..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java
+++ /dev/null
@@ -1,209 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.configuration.Configured;
-
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.configuration.Configurator;
-import org.apache.qpid.server.configuration.VirtualHostConfiguration;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.commons.configuration.Configuration;
-
-public class QueueDeclareHandler implements StateAwareMethodListener<QueueDeclareBody>
-{
- private static final Logger _logger = Logger.getLogger(QueueDeclareHandler.class);
-
- private static final QueueDeclareHandler _instance = new QueueDeclareHandler();
-
- public static QueueDeclareHandler getInstance()
- {
- return _instance;
- }
-
- @Configured(path = "queue.auto_register", defaultValue = "true")
- public boolean autoRegister;
-
- private final AtomicInteger _counter = new AtomicInteger();
-
-
- protected QueueDeclareHandler()
- {
- Configurator.configure(this);
- }
-
- public void methodReceived(AMQStateManager stateManager, QueueDeclareBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
- MessageStore store = virtualHost.getMessageStore();
-
-
- if (!body.getPassive())
- {
- //Perform ACL if request is not passive
- virtualHost.getAccessManager().authorise(session, Permission.CREATE, body);
- }
-
-
- final AMQShortString queueName;
-
- // if we aren't given a queue name, we create one which we return to the client
-
- if ((body.getQueue() == null) || (body.getQueue().length() == 0))
- {
- queueName = createName();
- }
- else
- {
- queueName = body.getQueue().intern();
- }
-
- AMQQueue queue;
- //TODO: do we need to check that the queue already exists with exactly the same "configuration"?
-
- synchronized (queueRegistry)
- {
-
-
-
- if (((queue = queueRegistry.getQueue(queueName)) == null))
- {
-
- if (body.getPassive())
- {
- String msg = "Queue: " + queueName + " not found on VirtualHost(" + virtualHost + ").";
- throw body.getChannelException(AMQConstant.NOT_FOUND, msg);
- }
- else
- {
- queue = createQueue(queueName, body, virtualHost, session);
- if (queue.isDurable() && !queue.isAutoDelete())
- {
- store.createQueue(queue, body.getArguments());
- }
- queueRegistry.registerQueue(queue);
- if (autoRegister)
- {
- Exchange defaultExchange = exchangeRegistry.getDefaultExchange();
-
- queue.bind(defaultExchange, queueName, null);
- _logger.info("Queue " + queueName + " bound to default exchange(" + defaultExchange.getName() + ")");
- }
- }
- }
- else if (queue.getOwner() != null && !session.getContextKey().equals(queue.getOwner()))
- {
- throw body.getChannelException(AMQConstant.ALREADY_EXISTS, "Cannot declare queue('" + queueName + "'),"
- + " as exclusive queue with same name "
- + "declared on another client ID('"
- + queue.getOwner() + "')");
- }
-
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- //set this as the default queue on the channel:
- channel.setDefaultQueue(queue);
- }
-
- if (!body.getNowait())
- {
- MethodRegistry methodRegistry = session.getMethodRegistry();
- QueueDeclareOkBody responseBody =
- methodRegistry.createQueueDeclareOkBody(queueName,
- queue.getMessageCount(),
- queue.getConsumerCount());
- session.writeFrame(responseBody.generateFrame(channelId));
-
- _logger.info("Queue " + queueName + " declared successfully");
- }
- }
-
- protected AMQShortString createName()
- {
- return new AMQShortString("tmp_" + UUID.randomUUID());
- }
-
- protected AMQQueue createQueue(final AMQShortString queueName,
- QueueDeclareBody body,
- VirtualHost virtualHost,
- final AMQProtocolSession session)
- throws AMQException
- {
- final QueueRegistry registry = virtualHost.getQueueRegistry();
- AMQShortString owner = body.getExclusive() ? session.getContextKey() : null;
-
- final AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(queueName, body.getDurable(), owner, body.getAutoDelete(), virtualHost,
- body.getArguments());
-
-
- if (body.getExclusive() && !body.getDurable())
- {
- final AMQProtocolSession.Task deleteQueueTask =
- new AMQProtocolSession.Task()
- {
- public void doTask(AMQProtocolSession session) throws AMQException
- {
- if (registry.getQueue(queueName) == queue)
- {
- queue.delete();
- }
- }
- };
-
- session.addSessionCloseTask(deleteQueueTask);
-
- queue.addQueueDeleteTask(new AMQQueue.Task()
- {
- public void doTask(AMQQueue queue)
- {
- session.removeSessionCloseTask(deleteQueueTask);
- }
- });
- }// if exclusive and not durable
-
- return queue;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java
deleted file mode 100644
index dfc36f5b93..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java
+++ /dev/null
@@ -1,124 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.QueueDeleteBody;
-import org.apache.qpid.framing.QueueDeleteOkBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.security.access.Permission;
-
-public class QueueDeleteHandler implements StateAwareMethodListener<QueueDeleteBody>
-{
- private static final QueueDeleteHandler _instance = new QueueDeleteHandler();
-
- public static QueueDeleteHandler getInstance()
- {
- return _instance;
- }
-
- private final boolean _failIfNotFound;
-
- public QueueDeleteHandler()
- {
- this(true);
- }
-
- public QueueDeleteHandler(boolean failIfNotFound)
- {
- _failIfNotFound = failIfNotFound;
-
- }
-
- public void methodReceived(AMQStateManager stateManager, QueueDeleteBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
- MessageStore store = virtualHost.getMessageStore();
-
- AMQQueue queue;
- if (body.getQueue() == null)
- {
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- //get the default queue on the channel:
- queue = channel.getDefaultQueue();
- }
- else
- {
- queue = queueRegistry.getQueue(body.getQueue());
- }
-
- if (queue == null)
- {
- if (_failIfNotFound)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Queue " + body.getQueue() + " does not exist.");
- }
- }
- else
- {
- if (body.getIfEmpty() && !queue.isEmpty())
- {
- throw body.getChannelException(AMQConstant.IN_USE, "Queue: " + body.getQueue() + " is not empty.");
- }
- else if (body.getIfUnused() && !queue.isUnused())
- {
- // TODO - Error code
- throw body.getChannelException(AMQConstant.IN_USE, "Queue: " + body.getQueue() + " is still used.");
-
- }
- else
- {
-
- //Perform ACLs
- virtualHost.getAccessManager().authorise(session, Permission.DELETE, body, queue);
-
- int purged = queue.delete();
-
-
- if (queue.isDurable())
- {
- store.removeQueue(queue);
- }
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- QueueDeleteOkBody responseBody = methodRegistry.createQueueDeleteOkBody(purged);
- session.writeFrame(responseBody.generateFrame(channelId));
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueuePurgeHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueuePurgeHandler.java
deleted file mode 100644
index 7377862875..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueuePurgeHandler.java
+++ /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.
- *
- *
- */
-
-package org.apache.qpid.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.QueuePurgeBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.security.access.Permission;
-
-public class QueuePurgeHandler implements StateAwareMethodListener<QueuePurgeBody>
-{
- private static final QueuePurgeHandler _instance = new QueuePurgeHandler();
-
- public static QueuePurgeHandler getInstance()
- {
- return _instance;
- }
-
- private final boolean _failIfNotFound;
-
- public QueuePurgeHandler()
- {
- this(true);
- }
-
- public QueuePurgeHandler(boolean failIfNotFound)
- {
- _failIfNotFound = failIfNotFound;
- }
-
- public void methodReceived(AMQStateManager stateManager, QueuePurgeBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
-
- AMQChannel channel = session.getChannel(channelId);
-
-
- AMQQueue queue;
- if(body.getQueue() == null)
- {
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- //get the default queue on the channel:
- queue = channel.getDefaultQueue();
-
- if(queue == null)
- {
- if(_failIfNotFound)
- {
- throw body.getConnectionException(AMQConstant.NOT_ALLOWED,"No queue specified.");
- }
- }
- }
- else
- {
- queue = queueRegistry.getQueue(body.getQueue());
- }
-
- if(queue == null)
- {
- if(_failIfNotFound)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Queue " + body.getQueue() + " does not exist.");
- }
- }
- else
- {
-
- //Perform ACLs
- virtualHost.getAccessManager().authorise(session, Permission.PURGE, body, queue);
-
- long purged = queue.clearQueue(channel.getStoreContext());
-
-
- if(!body.getNowait())
- {
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createQueuePurgeOkBody(purged);
- session.writeFrame(responseBody.generateFrame(channelId));
-
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueUnbindHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueUnbindHandler.java
deleted file mode 100644
index 6331a0365d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/QueueUnbindHandler.java
+++ /dev/null
@@ -1,134 +0,0 @@
-package org.apache.qpid.server.handler;
-/*
- *
- * 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 org.apache.log4j.Logger;
-
-import org.apache.qpid.framing.*;
-import org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQInvalidRoutingKeyException;
-import org.apache.qpid.protocol.AMQConstant;
-
-public class QueueUnbindHandler implements StateAwareMethodListener<QueueUnbindBody>
-{
- private static final Logger _log = Logger.getLogger(QueueUnbindHandler.class);
-
- private static final QueueUnbindHandler _instance = new QueueUnbindHandler();
-
- public static QueueUnbindHandler getInstance()
- {
- return _instance;
- }
-
- private QueueUnbindHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, QueueUnbindBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
-
-
- final AMQQueue queue;
- final AMQShortString routingKey;
-
- if (body.getQueue() == null)
- {
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- queue = channel.getDefaultQueue();
-
- if (queue == null)
- {
- throw body.getConnectionException(AMQConstant.NOT_FOUND, "No default queue defined on channel and queue was null");
- }
-
- routingKey = body.getRoutingKey() == null ? null : body.getRoutingKey().intern();
-
- }
- else
- {
- queue = queueRegistry.getQueue(body.getQueue());
- routingKey = body.getRoutingKey() == null ? null : body.getRoutingKey().intern();
- }
-
- if (queue == null)
- {
- throw body.getConnectionException(AMQConstant.NOT_FOUND, "Queue " + body.getQueue() + " does not exist.");
- }
- final Exchange exch = exchangeRegistry.getExchange(body.getExchange());
- if (exch == null)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Exchange " + body.getExchange() + " does not exist.");
- }
-
- //Perform ACLs
- virtualHost.getAccessManager().authorise(session, Permission.UNBIND, body, queue);
-
- try
- {
- queue.unBind(exch, routingKey, body.getArguments());
- }
- catch (AMQInvalidRoutingKeyException rke)
- {
- throw body.getChannelException(AMQConstant.INVALID_ROUTING_KEY, routingKey.toString());
- }
- catch (AMQException e)
- {
- if(e.getErrorCode() == AMQConstant.NOT_FOUND)
- {
- throw body.getConnectionException(AMQConstant.NOT_FOUND,e.getMessage(),e);
- }
- throw body.getChannelException(AMQConstant.CHANNEL_ERROR, e.toString());
- }
-
- if (_log.isInfoEnabled())
- {
- _log.info("Binding queue " + queue + " to exchange " + exch + " with routing key " + routingKey);
- }
-
- MethodRegistry_0_9 methodRegistry = (MethodRegistry_0_9) session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createQueueUnbindOkBody();
- session.writeFrame(responseBody.generateFrame(channelId));
-
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl.java
deleted file mode 100644
index 9475b83c8f..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl.java
+++ /dev/null
@@ -1,566 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import java.util.Map;
-import java.util.HashMap;
-
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.AMQException;
-
-public class ServerMethodDispatcherImpl implements MethodDispatcher
-{
- private final AMQStateManager _stateManager;
-
- private static interface DispatcherFactory
- {
- public MethodDispatcher createMethodDispatcher(AMQStateManager stateManager);
- }
-
- private static final Map<ProtocolVersion, DispatcherFactory> _dispatcherFactories =
- new HashMap<ProtocolVersion, DispatcherFactory>();
-
-
- static
- {
- _dispatcherFactories.put(ProtocolVersion.v8_0,
- new DispatcherFactory()
- {
- public MethodDispatcher createMethodDispatcher(AMQStateManager stateManager)
- {
- return new ServerMethodDispatcherImpl_8_0(stateManager);
- }
- });
-
- _dispatcherFactories.put(ProtocolVersion.v0_9,
- new DispatcherFactory()
- {
- public MethodDispatcher createMethodDispatcher(AMQStateManager stateManager)
- {
- return new ServerMethodDispatcherImpl_0_9(stateManager);
- }
- });
-
- }
-
-
- private static final AccessRequestHandler _accessRequestHandler = AccessRequestHandler.getInstance();
- private static final ChannelCloseHandler _channelCloseHandler = ChannelCloseHandler.getInstance();
- private static final ChannelOpenHandler _channelOpenHandler = ChannelOpenHandler.getInstance();
- private static final ChannelCloseOkHandler _channelCloseOkHandler = ChannelCloseOkHandler.getInstance();
- private static final ConnectionCloseMethodHandler _connectionCloseMethodHandler = ConnectionCloseMethodHandler.getInstance();
- private static final ConnectionCloseOkMethodHandler _connectionCloseOkMethodHandler = ConnectionCloseOkMethodHandler.getInstance();
- private static final ConnectionOpenMethodHandler _connectionOpenMethodHandler = ConnectionOpenMethodHandler.getInstance();
- private static final ConnectionTuneOkMethodHandler _connectionTuneOkMethodHandler = ConnectionTuneOkMethodHandler.getInstance();
- private static final ConnectionSecureOkMethodHandler _connectionSecureOkMethodHandler = ConnectionSecureOkMethodHandler.getInstance();
- private static final ConnectionStartOkMethodHandler _connectionStartOkMethodHandler = ConnectionStartOkMethodHandler.getInstance();
- private static final ExchangeDeclareHandler _exchangeDeclareHandler = ExchangeDeclareHandler.getInstance();
- private static final ExchangeDeleteHandler _exchangeDeleteHandler = ExchangeDeleteHandler.getInstance();
- private static final ExchangeBoundHandler _exchangeBoundHandler = ExchangeBoundHandler.getInstance();
- private static final BasicAckMethodHandler _basicAckMethodHandler = BasicAckMethodHandler.getInstance();
- private static final BasicRecoverMethodHandler _basicRecoverMethodHandler = BasicRecoverMethodHandler.getInstance();
- private static final BasicConsumeMethodHandler _basicConsumeMethodHandler = BasicConsumeMethodHandler.getInstance();
- private static final BasicGetMethodHandler _basicGetMethodHandler = BasicGetMethodHandler.getInstance();
- private static final BasicCancelMethodHandler _basicCancelMethodHandler = BasicCancelMethodHandler.getInstance();
- private static final BasicPublishMethodHandler _basicPublishMethodHandler = BasicPublishMethodHandler.getInstance();
- private static final BasicQosHandler _basicQosHandler = BasicQosHandler.getInstance();
- private static final QueueBindHandler _queueBindHandler = QueueBindHandler.getInstance();
- private static final QueueDeclareHandler _queueDeclareHandler = QueueDeclareHandler.getInstance();
- private static final QueueDeleteHandler _queueDeleteHandler = QueueDeleteHandler.getInstance();
- private static final QueuePurgeHandler _queuePurgeHandler = QueuePurgeHandler.getInstance();
- private static final ChannelFlowHandler _channelFlowHandler = ChannelFlowHandler.getInstance();
- private static final TxSelectHandler _txSelectHandler = TxSelectHandler.getInstance();
- private static final TxCommitHandler _txCommitHandler = TxCommitHandler.getInstance();
- private static final TxRollbackHandler _txRollbackHandler = TxRollbackHandler.getInstance();
- private static final BasicRejectMethodHandler _basicRejectMethodHandler = BasicRejectMethodHandler.getInstance();
-
-
-
- public static MethodDispatcher createMethodDispatcher(AMQStateManager stateManager, ProtocolVersion protocolVersion)
- {
- return _dispatcherFactories.get(protocolVersion).createMethodDispatcher(stateManager);
- }
-
-
- public ServerMethodDispatcherImpl(AMQStateManager stateManager)
- {
- _stateManager = stateManager;
- }
-
-
- protected AMQStateManager getStateManager()
- {
- return _stateManager;
- }
-
-
-
- public boolean dispatchAccessRequest(AccessRequestBody body, int channelId) throws AMQException
- {
- _accessRequestHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchBasicAck(BasicAckBody body, int channelId) throws AMQException
- {
- _basicAckMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchBasicCancel(BasicCancelBody body, int channelId) throws AMQException
- {
- _basicCancelMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchBasicConsume(BasicConsumeBody body, int channelId) throws AMQException
- {
- _basicConsumeMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchBasicGet(BasicGetBody body, int channelId) throws AMQException
- {
- _basicGetMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchBasicPublish(BasicPublishBody body, int channelId) throws AMQException
- {
- _basicPublishMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchBasicQos(BasicQosBody body, int channelId) throws AMQException
- {
- _basicQosHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchBasicRecover(BasicRecoverBody body, int channelId) throws AMQException
- {
- _basicRecoverMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchBasicReject(BasicRejectBody body, int channelId) throws AMQException
- {
- _basicRejectMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchChannelOpen(ChannelOpenBody body, int channelId) throws AMQException
- {
- _channelOpenHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
-
- public boolean dispatchAccessRequestOk(AccessRequestOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchBasicCancelOk(BasicCancelOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchBasicConsumeOk(BasicConsumeOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchBasicDeliver(BasicDeliverBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchBasicGetEmpty(BasicGetEmptyBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchBasicGetOk(BasicGetOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchBasicQosOk(BasicQosOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchBasicReturn(BasicReturnBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchChannelClose(ChannelCloseBody body, int channelId) throws AMQException
- {
- _channelCloseHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
-
- public boolean dispatchChannelCloseOk(ChannelCloseOkBody body, int channelId) throws AMQException
- {
- _channelCloseOkHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
-
- public boolean dispatchChannelFlow(ChannelFlowBody body, int channelId) throws AMQException
- {
- _channelFlowHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchChannelFlowOk(ChannelFlowOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchChannelOpenOk(ChannelOpenOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
-
- public boolean dispatchConnectionOpen(ConnectionOpenBody body, int channelId) throws AMQException
- {
- _connectionOpenMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
-
- public boolean dispatchConnectionClose(ConnectionCloseBody body, int channelId) throws AMQException
- {
- _connectionCloseMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
-
- public boolean dispatchConnectionCloseOk(ConnectionCloseOkBody body, int channelId) throws AMQException
- {
- _connectionCloseOkMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchConnectionOpenOk(ConnectionOpenOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchConnectionRedirect(ConnectionRedirectBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchConnectionSecure(ConnectionSecureBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchConnectionStart(ConnectionStartBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchConnectionTune(ConnectionTuneBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchDtxSelectOk(DtxSelectOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchDtxStartOk(DtxStartOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchExchangeBoundOk(ExchangeBoundOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchExchangeDeclareOk(ExchangeDeclareOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchExchangeDeleteOk(ExchangeDeleteOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchFileCancelOk(FileCancelOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchFileConsumeOk(FileConsumeOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchFileDeliver(FileDeliverBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchFileOpen(FileOpenBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchFileOpenOk(FileOpenOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchFileQosOk(FileQosOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchFileReturn(FileReturnBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchFileStage(FileStageBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchQueueBindOk(QueueBindOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchQueueDeclareOk(QueueDeclareOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchQueueDeleteOk(QueueDeleteOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchQueuePurgeOk(QueuePurgeOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchStreamCancelOk(StreamCancelOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchStreamConsumeOk(StreamConsumeOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchStreamDeliver(StreamDeliverBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchStreamQosOk(StreamQosOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchStreamReturn(StreamReturnBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchTxCommitOk(TxCommitOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchTxRollbackOk(TxRollbackOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchTxSelectOk(TxSelectOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
-
- public boolean dispatchConnectionSecureOk(ConnectionSecureOkBody body, int channelId) throws AMQException
- {
- _connectionSecureOkMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchConnectionStartOk(ConnectionStartOkBody body, int channelId) throws AMQException
- {
- _connectionStartOkMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchConnectionTuneOk(ConnectionTuneOkBody body, int channelId) throws AMQException
- {
- _connectionTuneOkMethodHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchDtxSelect(DtxSelectBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchDtxStart(DtxStartBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchExchangeBound(ExchangeBoundBody body, int channelId) throws AMQException
- {
- _exchangeBoundHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchExchangeDeclare(ExchangeDeclareBody body, int channelId) throws AMQException
- {
- _exchangeDeclareHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchExchangeDelete(ExchangeDeleteBody body, int channelId) throws AMQException
- {
- _exchangeDeleteHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchFileAck(FileAckBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchFileCancel(FileCancelBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchFileConsume(FileConsumeBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchFilePublish(FilePublishBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchFileQos(FileQosBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchFileReject(FileRejectBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchQueueBind(QueueBindBody body, int channelId) throws AMQException
- {
- _queueBindHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchQueueDeclare(QueueDeclareBody body, int channelId) throws AMQException
- {
- _queueDeclareHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchQueueDelete(QueueDeleteBody body, int channelId) throws AMQException
- {
- _queueDeleteHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchQueuePurge(QueuePurgeBody body, int channelId) throws AMQException
- {
- _queuePurgeHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchStreamCancel(StreamCancelBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchStreamConsume(StreamConsumeBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchStreamPublish(StreamPublishBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchStreamQos(StreamQosBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTunnelRequest(TunnelRequestBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTxCommit(TxCommitBody body, int channelId) throws AMQException
- {
- _txCommitHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchTxRollback(TxRollbackBody body, int channelId) throws AMQException
- {
- _txRollbackHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
- public boolean dispatchTxSelect(TxSelectBody body, int channelId) throws AMQException
- {
- _txSelectHandler.methodReceived(_stateManager, body, channelId);
- return true;
- }
-
-
-
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl_0_9.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl_0_9.java
deleted file mode 100644
index 8b1dca77ba..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl_0_9.java
+++ /dev/null
@@ -1,164 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-
-import org.apache.qpid.framing.amqp_0_9.MethodDispatcher_0_9;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.AMQException;
-
-
-
-public class ServerMethodDispatcherImpl_0_9
- extends ServerMethodDispatcherImpl
- implements MethodDispatcher_0_9
-
-{
-
- private static final BasicRecoverSyncMethodHandler _basicRecoverSyncMethodHandler =
- BasicRecoverSyncMethodHandler.getInstance();
- private static final QueueUnbindHandler _queueUnbindHandler =
- QueueUnbindHandler.getInstance();
-
-
- public ServerMethodDispatcherImpl_0_9(AMQStateManager stateManager)
- {
- super(stateManager);
- }
-
- public boolean dispatchBasicRecoverSync(BasicRecoverSyncBody body, int channelId) throws AMQException
- {
- _basicRecoverSyncMethodHandler.methodReceived(getStateManager(), body, channelId);
- return true;
- }
-
- public boolean dispatchBasicRecoverSyncOk(BasicRecoverSyncOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchChannelOk(ChannelOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchChannelPing(ChannelPingBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchChannelPong(ChannelPongBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchChannelResume(ChannelResumeBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageAppend(MessageAppendBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageCancel(MessageCancelBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageCheckpoint(MessageCheckpointBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageClose(MessageCloseBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageConsume(MessageConsumeBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageEmpty(MessageEmptyBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageGet(MessageGetBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageOffset(MessageOffsetBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageOk(MessageOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageOpen(MessageOpenBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageQos(MessageQosBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageRecover(MessageRecoverBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageReject(MessageRejectBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageResume(MessageResumeBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageTransfer(MessageTransferBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchQueueUnbindOk(QueueUnbindOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchQueueUnbind(QueueUnbindBody body, int channelId) throws AMQException
- {
- _queueUnbindHandler.methodReceived(getStateManager(),body,channelId);
- return true;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl_8_0.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl_8_0.java
deleted file mode 100644
index d599ca3d4e..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl_8_0.java
+++ /dev/null
@@ -1,86 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.qpid.framing.amqp_8_0.MethodDispatcher_8_0;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.AMQException;
-
-public class ServerMethodDispatcherImpl_8_0
- extends ServerMethodDispatcherImpl
- implements MethodDispatcher_8_0
-{
- public ServerMethodDispatcherImpl_8_0(AMQStateManager stateManager)
- {
- super(stateManager);
- }
-
- public boolean dispatchBasicRecoverOk(BasicRecoverOkBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchChannelAlert(ChannelAlertBody body, int channelId) throws AMQException
- {
- throw new UnexpectedMethodException(body);
- }
-
- public boolean dispatchTestContent(TestContentBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestContentOk(TestContentOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestInteger(TestIntegerBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestIntegerOk(TestIntegerOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestString(TestStringBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestStringOk(TestStringOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestTable(TestTableBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestTableOk(TestTableOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxCommitHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxCommitHandler.java
deleted file mode 100644
index 9b23d88838..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxCommitHandler.java
+++ /dev/null
@@ -1,78 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.TxCommitBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class TxCommitHandler implements StateAwareMethodListener<TxCommitBody>
-{
- private static final Logger _log = Logger.getLogger(TxCommitHandler.class);
-
- private static TxCommitHandler _instance = new TxCommitHandler();
-
- public static TxCommitHandler getInstance()
- {
- return _instance;
- }
-
- private TxCommitHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, TxCommitBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- try
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Commit received on channel " + channelId);
- }
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- channel.commit();
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createTxCommitOkBody();
- session.writeFrame(responseBody.generateFrame(channelId));
-
- channel.processReturns();
- }
- catch (AMQException e)
- {
- throw body.getChannelException(e.getErrorCode(), "Failed to commit: " + e.getMessage());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxRollbackHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxRollbackHandler.java
deleted file mode 100644
index 5f402f3fda..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxRollbackHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.TxRollbackBody;
-import org.apache.qpid.framing.TxRollbackOkBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class TxRollbackHandler implements StateAwareMethodListener<TxRollbackBody>
-{
- private static TxRollbackHandler _instance = new TxRollbackHandler();
-
- public static TxRollbackHandler getInstance()
- {
- return _instance;
- }
-
- private TxRollbackHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, TxRollbackBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- try
- {
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- channel.rollback();
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- AMQMethodBody responseBody = methodRegistry.createTxRollbackOkBody();
- session.writeFrame(responseBody.generateFrame(channelId));
-
-
- //Now resend all the unacknowledged messages back to the original subscribers.
- //(Must be done after the TxnRollback-ok response).
- // Why, are we not allowed to send messages back to client before the ok method?
- channel.resend(false);
- }
- catch (AMQException e)
- {
- throw body.getChannelException(e.getErrorCode(), "Failed to rollback: " + e.getMessage());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxSelectHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxSelectHandler.java
deleted file mode 100644
index 308f5b73cf..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/TxSelectHandler.java
+++ /dev/null
@@ -1,63 +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.
- *
- */
-package org.apache.qpid.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.TxSelectBody;
-import org.apache.qpid.framing.TxSelectOkBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.AMQChannel;
-
-public class TxSelectHandler implements StateAwareMethodListener<TxSelectBody>
-{
- private static TxSelectHandler _instance = new TxSelectHandler();
-
- public static TxSelectHandler getInstance()
- {
- return _instance;
- }
-
- private TxSelectHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, TxSelectBody body, int channelId) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(channelId);
- }
-
- channel.setLocalTransactional();
-
- MethodRegistry methodRegistry = session.getMethodRegistry();
- TxSelectOkBody responseBody = methodRegistry.createTxSelectOkBody();
- session.writeFrame(responseBody.generateFrame(channelId));
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/UnexpectedMethodException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/UnexpectedMethodException.java
deleted file mode 100644
index fb18519fe1..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/handler/UnexpectedMethodException.java
+++ /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.
- *
- */
-package org.apache.qpid.server.handler;
-
-
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.AMQException;
-
-public class UnexpectedMethodException extends AMQException
-{
- public UnexpectedMethodException(AMQMethodBody body)
- {
- super("Unexpected method recevied: " + body.getClass().getName());
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/jms/JmsConsumer.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/jms/JmsConsumer.java
deleted file mode 100644
index c08fae4e4e..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/jms/JmsConsumer.java
+++ /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.
- *
- */
-package org.apache.qpid.server.jms;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-
-public class JmsConsumer
-{
- private int _prefetchValue;
-
- private PrefetchUnits _prefetchUnits;
-
- private boolean _noLocal;
-
- private boolean _autoAck;
-
- private boolean _exclusive;
-
- private AMQProtocolSession _protocolSession;
-
- public enum PrefetchUnits
- {
- OCTETS,
- MESSAGES
- }
-
- public int getPrefetchValue()
- {
- return _prefetchValue;
- }
-
- public void setPrefetchValue(int prefetchValue)
- {
- _prefetchValue = prefetchValue;
- }
-
- public PrefetchUnits getPrefetchUnits()
- {
- return _prefetchUnits;
- }
-
- public void setPrefetchUnits(PrefetchUnits prefetchUnits)
- {
- _prefetchUnits = prefetchUnits;
- }
-
- public boolean isNoLocal()
- {
- return _noLocal;
- }
-
- public void setNoLocal(boolean noLocal)
- {
- _noLocal = noLocal;
- }
-
- public boolean isAutoAck()
- {
- return _autoAck;
- }
-
- public void setAutoAck(boolean autoAck)
- {
- _autoAck = autoAck;
- }
-
- public boolean isExclusive()
- {
- return _exclusive;
- }
-
- public void setExclusive(boolean exclusive)
- {
- _exclusive = exclusive;
- }
-
- public AMQProtocolSession getProtocolSession()
- {
- return _protocolSession;
- }
-
- public void setProtocolSession(AMQProtocolSession protocolSession)
- {
- _protocolSession = protocolSession;
- }
-
- public void deliverMessage() throws AMQException
- {
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQManagedObject.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQManagedObject.java
deleted file mode 100644
index a2c2bd62a2..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/AMQManagedObject.java
+++ /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.
- *
- */
-package org.apache.qpid.server.management;
-
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanNotificationInfo;
-import javax.management.NotCompliantMBeanException;
-import javax.management.NotificationBroadcaster;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-
-/**
- * This class provides additinal feature of Notification Broadcaster to the
- * DefaultManagedObject.
- * @author Bhupendra Bhardwaj
- * @version 0.1
- */
-public abstract class AMQManagedObject extends DefaultManagedObject
- implements NotificationBroadcaster
-{
- /**
- * broadcaster support class
- */
- protected NotificationBroadcasterSupport _broadcaster = new NotificationBroadcasterSupport();
-
- /**
- * sequence number for notifications
- */
- protected long _notificationSequenceNumber = 0;
-
- protected MBeanInfo _mbeanInfo;
-
- protected AMQManagedObject(Class<?> managementInterface, String typeName)
- throws NotCompliantMBeanException
- {
- super(managementInterface, typeName);
- buildMBeanInfo();
- }
-
- @Override
- public MBeanInfo getMBeanInfo()
- {
- return _mbeanInfo;
- }
-
- private void buildMBeanInfo() throws NotCompliantMBeanException
- {
- _mbeanInfo = new MBeanInfo(this.getClass().getName(),
- MBeanIntrospector.getMBeanDescription(this.getClass()),
- MBeanIntrospector.getMBeanAttributesInfo(getManagementInterface()),
- MBeanIntrospector.getMBeanConstructorsInfo(this.getClass()),
- MBeanIntrospector.getMBeanOperationsInfo(getManagementInterface()),
- this.getNotificationInfo());
- }
-
-
-
- // notification broadcaster implementation
-
- public void addNotificationListener(NotificationListener listener,
- NotificationFilter filter,
- Object handback)
- {
- _broadcaster.addNotificationListener(listener, filter, handback);
- }
-
- public void removeNotificationListener(NotificationListener listener)
- throws ListenerNotFoundException
- {
- _broadcaster.removeNotificationListener(listener);
- }
-
- public MBeanNotificationInfo[] getNotificationInfo()
- {
- return null;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java
deleted file mode 100644
index 84526dbc11..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java
+++ /dev/null
@@ -1,191 +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.
- *
- */
-package org.apache.qpid.server.management;
-
-import javax.management.JMException;
-import javax.management.MalformedObjectNameException;
-import javax.management.NotCompliantMBeanException;
-import javax.management.ObjectName;
-import javax.management.StandardMBean;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-
-/**
- * Provides implementation of the boilerplate ManagedObject interface. Most managed objects should find it useful
- * to extend this class rather than implementing ManagedObject from scratch.
- *
- */
-public abstract class DefaultManagedObject extends StandardMBean implements ManagedObject
-{
- private Class<?> _managementInterface;
-
- private String _typeName;
-
- protected DefaultManagedObject(Class<?> managementInterface, String typeName)
- throws NotCompliantMBeanException
- {
- super(managementInterface);
- _managementInterface = managementInterface;
- _typeName = typeName;
- }
-
- public String getType()
- {
- return _typeName;
- }
-
- public Class<?> getManagementInterface()
- {
- return _managementInterface;
- }
-
- public ManagedObject getParentObject()
- {
- return null;
- }
-
- public void register() throws AMQException
- {
- try
- {
- getManagedObjectRegistry().registerObject(this);
- }
- catch (JMException e)
- {
- throw new AMQException("Error registering managed object " + this + ": " + e, e);
- }
- }
-
- protected ManagedObjectRegistry getManagedObjectRegistry()
- {
- return ApplicationRegistry.getInstance().getManagedObjectRegistry();
- }
-
- public void unregister() throws AMQException
- {
- try
- {
- getManagedObjectRegistry().unregisterObject(this);
- }
- catch (JMException e)
- {
- throw new AMQException("Error unregistering managed object: " + this + ": " + e, e);
- }
- }
-
- public String toString()
- {
- return getObjectInstanceName() + "[" + getType() + "]";
- }
-
-
- /**
- * Created the ObjectName as per the JMX Specs
- * @return ObjectName
- * @throws MalformedObjectNameException
- */
- public ObjectName getObjectName() throws MalformedObjectNameException
- {
- String name = getObjectInstanceName();
- StringBuffer objectName = new StringBuffer(ManagedObject.DOMAIN);
-
- objectName.append(":type=");
- objectName.append(getHierarchicalType(this));
-
- objectName.append(",");
- objectName.append(getHierarchicalName(this));
- objectName.append("name=").append(name);
-
- return new ObjectName(objectName.toString());
- }
-
- protected ObjectName getObjectNameForSingleInstanceMBean() throws MalformedObjectNameException
- {
- StringBuffer objectName = new StringBuffer(ManagedObject.DOMAIN);
-
- objectName.append(":type=");
- objectName.append(getHierarchicalType(this));
-
- String hierarchyName = getHierarchicalName(this);
- if (hierarchyName != null)
- {
- objectName.append(",");
- objectName.append(hierarchyName.substring(0, hierarchyName.lastIndexOf(",")));
- }
-
- return new ObjectName(objectName.toString());
- }
-
- protected String getHierarchicalType(ManagedObject obj)
- {
- if (obj.getParentObject() != null)
- {
- String parentType = getHierarchicalType(obj.getParentObject()).toString();
- return parentType + "." + obj.getType();
- }
- else
- return obj.getType();
- }
-
- protected String getHierarchicalName(ManagedObject obj)
- {
- if (obj.getParentObject() != null)
- {
- String parentName = obj.getParentObject().getType() + "=" +
- obj.getParentObject().getObjectInstanceName() + ","+
- getHierarchicalName(obj.getParentObject());
-
- return parentName;
- }
- else
- return "";
- }
-
- protected static StringBuffer jmxEncode(StringBuffer jmxName, int attrPos)
- {
- for (int i = attrPos; i < jmxName.length(); i++)
- {
- if (jmxName.charAt(i) == ',')
- {
- jmxName.setCharAt(i, ';');
- }
- else if (jmxName.charAt(i) == ':')
- {
- jmxName.setCharAt(i, '-');
- }
- else if (jmxName.charAt(i) == '?' ||
- jmxName.charAt(i) == '*' ||
- jmxName.charAt(i) == '\\')
- {
- jmxName.insert(i, '\\');
- i++;
- }
- else if (jmxName.charAt(i) == '\n')
- {
- jmxName.insert(i, '\\');
- i++;
- jmxName.setCharAt(i, 'n');
- }
- }
- return jmxName;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
deleted file mode 100644
index 659f806d58..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
+++ /dev/null
@@ -1,224 +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.
- *
- */
-package org.apache.qpid.server.management;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.security.auth.database.Base64MD5PasswordFilePrincipalDatabase;
-import org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-import org.apache.qpid.server.security.auth.sasl.crammd5.CRAMMD5HashedInitialiser;
-import org.apache.qpid.server.security.auth.sasl.plain.PlainInitialiser;
-
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.remote.JMXConnectorServer;
-import javax.management.remote.JMXConnectorServerFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.MBeanServerForwarder;
-import java.io.IOException;
-import java.lang.management.ManagementFactory;
-import java.rmi.RemoteException;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.registry.Registry;
-import java.rmi.server.UnicastRemoteObject;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * This class starts up an MBeanserver. If out of the box agent is being used then there are no security features
- * implemented. To use the security features like user authentication, turn off the jmx options in the "QPID_OPTS" env
- * variable and use JMXMP connector server. If JMXMP connector is not available, then the standard JMXConnector will be
- * used, which again doesn't have user authentication.
- */
-public class JMXManagedObjectRegistry implements ManagedObjectRegistry
-{
- private static final Logger _log = Logger.getLogger(JMXManagedObjectRegistry.class);
-
- private final MBeanServer _mbeanServer;
- private Registry _rmiRegistry;
- private JMXServiceURL _jmxURL;
-
- public static final String MANAGEMENT_PORT_CONFIG_PATH = "management.jmxport";
- public static final int MANAGEMENT_PORT_DEFAULT = 8999;
-
- public JMXManagedObjectRegistry() throws AMQException
- {
- _log.info("Initialising managed object registry using platform MBean server");
- IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
-
- // Retrieve the config parameters
- boolean platformServer = appRegistry.getConfiguration().getBoolean("management.platform-mbeanserver", true);
-
- _mbeanServer =
- platformServer ? ManagementFactory.getPlatformMBeanServer()
- : MBeanServerFactory.createMBeanServer(ManagedObject.DOMAIN);
- }
-
-
- public void start() throws IOException
- {
- // Check if the "QPID_OPTS" is set to use Out of the Box JMXAgent
- if (areOutOfTheBoxJMXOptionsSet())
- {
- _log.info("JMX: Using the out of the box JMX Agent");
- return;
- }
-
- IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
-
- boolean security = appRegistry.getConfiguration().getBoolean("management.security-enabled", false);
- int port = appRegistry.getConfiguration().getInt(MANAGEMENT_PORT_CONFIG_PATH, MANAGEMENT_PORT_DEFAULT);
-
- if (security)
- {
- // For SASL using JMXMP
- _jmxURL = new JMXServiceURL("jmxmp", null, port);
-
- Map env = new HashMap();
- Map<String, PrincipalDatabase> map = appRegistry.getDatabaseManager().getDatabases();
- PrincipalDatabase db = null;
-
- for (Map.Entry<String, PrincipalDatabase> entry : map.entrySet())
- {
- if (entry.getValue() instanceof Base64MD5PasswordFilePrincipalDatabase)
- {
- db = entry.getValue();
- break;
- }
- else if (entry.getValue() instanceof PlainPasswordFilePrincipalDatabase)
- {
- db = entry.getValue();
- }
- }
-
- if (db instanceof Base64MD5PasswordFilePrincipalDatabase)
- {
- env.put("jmx.remote.profiles", "SASL/CRAM-MD5");
- CRAMMD5HashedInitialiser initialiser = new CRAMMD5HashedInitialiser();
- initialiser.initialise(db);
- env.put("jmx.remote.sasl.callback.handler", initialiser.getCallbackHandler());
- }
- else if (db instanceof PlainPasswordFilePrincipalDatabase)
- {
- PlainInitialiser initialiser = new PlainInitialiser();
- initialiser.initialise(db);
- env.put("jmx.remote.sasl.callback.handler", initialiser.getCallbackHandler());
- env.put("jmx.remote.profiles", "SASL/PLAIN");
- }
-
- //workaround NPE generated from env map classloader issue when using Eclipse 3.4 to launch
- env.put("jmx.remote.profile.provider.class.loader", this.getClass().getClassLoader());
-
- // Enable the SSL security and server authentication
- /*
- SslRMIClientSocketFactory csf = new SslRMIClientSocketFactory();
- SslRMIServerSocketFactory ssf = new SslRMIServerSocketFactory();
- env.put(RMIConnectorServer.RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE, csf);
- env.put(RMIConnectorServer.RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE, ssf);
- */
-
- JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer(_jmxURL, env, _mbeanServer);
- MBeanServerForwarder mbsf = MBeanInvocationHandlerImpl.newProxyInstance();
- cs.setMBeanServerForwarder(mbsf);
- cs.start();
- _log.warn("JMX: Started JMXConnector server on port '" + port + "' with SASL");
-
- }
- else
- {
- startJMXConnectorServer(port);
- _log.warn("JMX: Started JMXConnector server on port '" + port + "' with security disabled");
- }
- }
-
- /**
- * Starts up an RMIRegistry at configured port and attaches a JMXConnectorServer to it.
- *
- * @param port
- *
- * @throws IOException
- */
- private void startJMXConnectorServer(int port) throws IOException
- {
- startRMIRegistry(port);
- _jmxURL = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" + port + "/jmxrmi");
- JMXConnectorServer cs = JMXConnectorServerFactory.newJMXConnectorServer(_jmxURL, null, _mbeanServer);
- cs.start();
- }
-
- public void registerObject(ManagedObject managedObject) throws JMException
- {
- _mbeanServer.registerMBean(managedObject, managedObject.getObjectName());
- }
-
- public void unregisterObject(ManagedObject managedObject) throws JMException
- {
- _mbeanServer.unregisterMBean(managedObject.getObjectName());
- }
-
- /**
- * Checks is the "QPID_OPTS" env variable is set to use the out of the box JMXAgent.
- *
- * @return
- */
- private boolean areOutOfTheBoxJMXOptionsSet()
- {
- if (System.getProperty("com.sun.management.jmxremote") != null)
- {
- return true;
- }
-
- if (System.getProperty("com.sun.management.jmxremote.port") != null)
- {
- return true;
- }
-
- return false;
- }
-
- /**
- * Starts the rmi registry at given port
- *
- * @param port
- *
- * @throws RemoteException
- */
- private void startRMIRegistry(int port) throws RemoteException
- {
- System.setProperty("java.rmi.server.randomIDs", "true");
- _rmiRegistry = LocateRegistry.createRegistry(port);
- }
-
- // stops the RMIRegistry, if it was running and bound to a port
- public void close() throws RemoteException
- {
- if (_rmiRegistry != null)
- {
- // Stopping the RMI registry
- UnicastRemoteObject.unexportObject(_rmiRegistry, true);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java
deleted file mode 100644
index 7d42297699..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java
+++ /dev/null
@@ -1,41 +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.
- *
- *
- */
-
-package org.apache.qpid.server.management;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotation for MBean attributes. This should be used with getter or setter
- * methods of attributes.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-@Inherited
-public @interface MBeanAttribute
-{
- String name();
- String description();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java
deleted file mode 100644
index 9138e03085..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java
+++ /dev/null
@@ -1,39 +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.
- *
- *
- */
-
-package org.apache.qpid.server.management;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotation for MBean constructors.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.CONSTRUCTOR)
-@Inherited
-public @interface MBeanConstructor
-{
- String value();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java
deleted file mode 100644
index 448fed3280..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java
+++ /dev/null
@@ -1,38 +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.
- *
- *
- */
-
-package org.apache.qpid.server.management;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotation for MBean class.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-@Inherited
-public @interface MBeanDescription {
- String value();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanIntrospector.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanIntrospector.java
deleted file mode 100644
index 0c2ec2aebd..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanIntrospector.java
+++ /dev/null
@@ -1,388 +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.
- *
- */
-package org.apache.qpid.server.management;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanConstructorInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanParameterInfo;
-import javax.management.NotCompliantMBeanException;
-
-/**
- * This class is a utility class to introspect the MBean class and the management
- * interface class for various purposes.
- * @author Bhupendra Bhardwaj
- * @version 0.1
- */
-class MBeanIntrospector {
-
- private static final String _defaultAttributeDescription = "Management attribute";
- private static final String _defaultOerationDescription = "Management operation";
- private static final String _defaultConstructorDescription = "MBean constructor";
- private static final String _defaultMbeanDescription = "Management interface of the MBean";
-
- /**
- * Introspects the management interface class for MBean attributes.
- * @param interfaceClass
- * @return MBeanAttributeInfo[]
- * @throws NotCompliantMBeanException
- */
- static MBeanAttributeInfo[] getMBeanAttributesInfo(Class interfaceClass)
- throws NotCompliantMBeanException
- {
- List<MBeanAttributeInfo> attributesList = new ArrayList<MBeanAttributeInfo>();
-
- /**
- * Using reflection, all methods of the managemetn interface will be analysed,
- * and MBeanInfo will be created.
- */
- for (Method method : interfaceClass.getMethods())
- {
- String name = method.getName();
- Class<?> resultType = method.getReturnType();
- MBeanAttributeInfo attributeInfo = null;
-
- if (isAttributeGetterMethod(method))
- {
- String desc = getAttributeDescription(method);
- attributeInfo = new MBeanAttributeInfo(name.substring(3),
- resultType.getName(),
- desc,
- true,
- false,
- false);
- int index = getIndexIfAlreadyExists(attributeInfo, attributesList);
- if (index == -1)
- {
- attributesList.add(attributeInfo);
- }
- else
- {
- attributeInfo = new MBeanAttributeInfo(name.substring(3),
- resultType.getName(),
- desc,
- true,
- true,
- false);
- attributesList.set(index, attributeInfo);
- }
- }
- else if (isAttributeSetterMethod(method))
- {
- String desc = getAttributeDescription(method);
- attributeInfo = new MBeanAttributeInfo(name.substring(3),
- method.getParameterTypes()[0].getName(),
- desc,
- false,
- true,
- false);
- int index = getIndexIfAlreadyExists(attributeInfo, attributesList);
- if (index == -1)
- {
- attributesList.add(attributeInfo);
- }
- else
- {
- attributeInfo = new MBeanAttributeInfo(name.substring(3),
- method.getParameterTypes()[0].getName(),
- desc,
- true,
- true,
- false);
- attributesList.set(index, attributeInfo);
- }
- }
- else if (isAttributeBoolean(method))
- {
- attributeInfo = new MBeanAttributeInfo(name.substring(2),
- resultType.getName(),
- getAttributeDescription(method),
- true,
- false,
- true);
- attributesList.add(attributeInfo);
- }
- }
-
- return attributesList.toArray(new MBeanAttributeInfo[0]);
- }
-
- /**
- * Introspects the management interface class for management operations.
- * @param interfaceClass
- * @return MBeanOperationInfo[]
- */
- static MBeanOperationInfo[] getMBeanOperationsInfo(Class interfaceClass)
- {
- List<MBeanOperationInfo> operationsList = new ArrayList<MBeanOperationInfo>();
-
- for (Method method : interfaceClass.getMethods())
- {
- if (!isAttributeGetterMethod(method) &&
- !isAttributeSetterMethod(method) &&
- !isAttributeBoolean(method))
- {
- operationsList.add(getOperationInfo(method));
- }
- }
-
- return operationsList.toArray(new MBeanOperationInfo[0]);
- }
-
- /**
- * Checks if the method is an attribute getter method.
- * @param method
- * @return true if the method is an attribute getter method.
- */
- private static boolean isAttributeGetterMethod(Method method)
- {
- if (!(method.getName().equals("get")) &&
- method.getName().startsWith("get") &&
- method.getParameterTypes().length == 0 &&
- !method.getReturnType().equals(void.class))
- {
- return true;
- }
-
- return false;
- }
-
- /**
- * Checks if the method is an attribute setter method.
- * @param method
- * @return true if the method is an attribute setter method.
- */
- private static boolean isAttributeSetterMethod(Method method)
- {
- if (!(method.getName().equals("set")) &&
- method.getName().startsWith("set") &&
- method.getParameterTypes().length == 1 &&
- method.getReturnType().equals(void.class))
- {
- return true;
- }
-
- return false;
- }
-
- /**
- * Checks if the attribute is a boolean and the method is a isX kind og method.
- * @param method
- * @return true if the method is an attribute isX type of method
- */
- private static boolean isAttributeBoolean(Method method)
- {
- if (!(method.getName().equals("is")) &&
- method.getName().startsWith("is") &&
- method.getParameterTypes().length == 0 &&
- method.getReturnType().equals(boolean.class))
- {
- return true;
- }
-
- return false;
- }
-
- /**
- * Helper method to retrieve the attribute index from the list of attributes.
- * @param attribute
- * @param list
- * @return attribute index no. -1 if attribtue doesn't exist
- * @throws NotCompliantMBeanException
- */
- private static int getIndexIfAlreadyExists(MBeanAttributeInfo attribute,
- List<MBeanAttributeInfo> list)
- throws NotCompliantMBeanException
- {
- String exceptionMsg = "Conflicting attribute methods for attribute " + attribute.getName();
-
- for (MBeanAttributeInfo memberAttribute : list)
- {
- if (attribute.getName().equals(memberAttribute.getName()))
- {
- if (!attribute.getType().equals(memberAttribute.getType()))
- {
- throw new NotCompliantMBeanException(exceptionMsg);
- }
- if (attribute.isReadable() && memberAttribute.isReadable())
- {
- if (attribute.isIs() != memberAttribute.isIs())
- {
- throw new NotCompliantMBeanException(exceptionMsg);
- }
- }
-
- return list.indexOf(memberAttribute);
- }
- }
-
- return -1;
- }
-
- /**
- * Retrieves the attribute description from annotation
- * @param attributeMethod
- * @return attribute description
- */
- private static String getAttributeDescription(Method attributeMethod)
- {
- MBeanAttribute anno = attributeMethod.getAnnotation(MBeanAttribute.class);
- if (anno != null)
- {
- return anno.description();
- }
- return _defaultAttributeDescription;
- }
-
- /**
- * Introspects the method to retrieve the operation information.
- * @param operation
- * @return MBeanOperationInfo
- */
- private static MBeanOperationInfo getOperationInfo(Method operation)
- {
- MBeanOperationInfo operationInfo = null;
- Class<?> returnType = operation.getReturnType();
-
- MBeanParameterInfo[] paramsInfo = getParametersInfo(operation.getParameterAnnotations(),
- operation.getParameterTypes());
-
- String operationDesc = _defaultOerationDescription;
- int impact = MBeanOperationInfo.UNKNOWN;
-
- if (operation.getAnnotation(MBeanOperation.class) != null)
- {
- operationDesc = operation.getAnnotation(MBeanOperation.class).description();
- impact = operation.getAnnotation(MBeanOperation.class).impact();
- }
- operationInfo = new MBeanOperationInfo(operation.getName(),
- operationDesc,
- paramsInfo,
- returnType.getName(),
- impact);
-
- return operationInfo;
- }
-
- /**
- * Constructs the parameter info.
- * @param paramsAnno
- * @param paramTypes
- * @return MBeanParameterInfo[]
- */
- private static MBeanParameterInfo[] getParametersInfo(Annotation[][] paramsAnno,
- Class<?>[] paramTypes)
- {
- int noOfParams = paramsAnno.length;
-
- MBeanParameterInfo[] paramsInfo = new MBeanParameterInfo[noOfParams];
-
- for (int i = 0; i < noOfParams; i++)
- {
- MBeanParameterInfo paramInfo = null;
- String type = paramTypes[i].getName();
- for (Annotation anno : paramsAnno[i])
- {
- String name,desc;
- if (MBeanOperationParameter.class.isInstance(anno))
- {
- name = MBeanOperationParameter.class.cast(anno).name();
- desc = MBeanOperationParameter.class.cast(anno).description();
- paramInfo = new MBeanParameterInfo(name, type, desc);
- }
- }
-
-
- if (paramInfo == null)
- {
- paramInfo = new MBeanParameterInfo("p " + (i + 1), type, "parameter " + (i + 1));
- }
- if (paramInfo != null)
- paramsInfo[i] = paramInfo;
- }
-
- return paramsInfo;
- }
-
- /**
- * Introspects the MBean class for constructors
- * @param implClass
- * @return MBeanConstructorInfo[]
- */
- static MBeanConstructorInfo[] getMBeanConstructorsInfo(Class implClass)
- {
- List<MBeanConstructorInfo> constructors = new ArrayList<MBeanConstructorInfo>();
-
- for (Constructor cons : implClass.getConstructors())
- {
- MBeanConstructorInfo constructorInfo = getMBeanConstructorInfo(cons);
- //MBeanConstructorInfo constructorInfo = new MBeanConstructorInfo("desc", cons);
- if (constructorInfo != null)
- constructors.add(constructorInfo);
- }
-
- return constructors.toArray(new MBeanConstructorInfo[0]);
- }
-
- /**
- * Retrieves the constructor info from given constructor.
- * @param cons
- * @return MBeanConstructorInfo
- */
- private static MBeanConstructorInfo getMBeanConstructorInfo(Constructor cons)
- {
- String desc = null;
- Annotation anno = cons.getAnnotation(MBeanConstructor.class);
- if (anno != null && MBeanConstructor.class.isInstance(anno))
- {
- desc = MBeanConstructor.class.cast(anno).value();
- }
-
- //MBeanParameterInfo[] paramsInfo = getParametersInfo(cons.getParameterAnnotations(),
- // cons.getParameterTypes());
-
- return new MBeanConstructorInfo(cons.getName(),
- desc != null ? _defaultConstructorDescription : desc ,
- null);
- }
-
- /**
- * Retrieves the description from the annotations of given class
- * @param annotatedClass
- * @return class description
- */
- static String getMBeanDescription(Class annotatedClass)
- {
- Annotation anno = annotatedClass.getAnnotation(MBeanDescription.class);
- if (anno != null && MBeanDescription.class.isInstance(anno))
- {
- return MBeanDescription.class.cast(anno).value();
- }
- return _defaultMbeanDescription;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java
deleted file mode 100644
index a0ecc2bd85..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java
+++ /dev/null
@@ -1,239 +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.
- *
- */
-package org.apache.qpid.server.management;
-
-import org.apache.qpid.server.security.access.management.UserManagement;
-import org.apache.log4j.Logger;
-
-import javax.management.remote.MBeanServerForwarder;
-import javax.management.remote.JMXPrincipal;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.MBeanInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.JMException;
-import javax.security.auth.Subject;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Proxy;
-import java.lang.reflect.Method;
-import java.security.AccessController;
-import java.security.Principal;
-import java.security.AccessControlContext;
-import java.util.Set;
-import java.util.Properties;
-
-/**
- * This class can be used by the JMXConnectorServer as an InvocationHandler for the mbean operations. This implements
- * the logic for allowing the users to invoke MBean operations and implements the restrictions for readOnly, readWrite
- * and admin users.
- */
-public class MBeanInvocationHandlerImpl implements InvocationHandler
-{
- private static final Logger _logger = Logger.getLogger(MBeanInvocationHandlerImpl.class);
-
- public final static String ADMIN = "admin";
- public final static String READWRITE = "readwrite";
- public final static String READONLY = "readonly";
- private final static String DELEGATE = "JMImplementation:type=MBeanServerDelegate";
- private MBeanServer mbs;
- private static Properties _userRoles = new Properties();
-
- public static MBeanServerForwarder newProxyInstance()
- {
- final InvocationHandler handler = new MBeanInvocationHandlerImpl();
- final Class[] interfaces = new Class[]{MBeanServerForwarder.class};
-
- Object proxy = Proxy.newProxyInstance(MBeanServerForwarder.class.getClassLoader(), interfaces, handler);
- return MBeanServerForwarder.class.cast(proxy);
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- final String methodName = method.getName();
-
- if (methodName.equals("getMBeanServer"))
- {
- return mbs;
- }
-
- if (methodName.equals("setMBeanServer"))
- {
- if (args[0] == null)
- {
- throw new IllegalArgumentException("Null MBeanServer");
- }
- if (mbs != null)
- {
- throw new IllegalArgumentException("MBeanServer object already initialized");
- }
- mbs = (MBeanServer) args[0];
- return null;
- }
-
- // Retrieve Subject from current AccessControlContext
- AccessControlContext acc = AccessController.getContext();
- Subject subject = Subject.getSubject(acc);
-
- // Allow operations performed locally on behalf of the connector server itself
- if (subject == null)
- {
- return method.invoke(mbs, args);
- }
-
- if (args == null || DELEGATE.equals(args[0]))
- {
- return method.invoke(mbs, args);
- }
-
- // Restrict access to "createMBean" and "unregisterMBean" to any user
- if (methodName.equals("createMBean") || methodName.equals("unregisterMBean"))
- {
- _logger.debug("User trying to create or unregister an MBean");
- throw new SecurityException("Access denied");
- }
-
- // Retrieve JMXPrincipal from Subject
- Set<JMXPrincipal> principals = subject.getPrincipals(JMXPrincipal.class);
- if (principals == null || principals.isEmpty())
- {
- throw new SecurityException("Access denied");
- }
-
- Principal principal = principals.iterator().next();
- String identity = principal.getName();
-
- if (isAdminMethod(args))
- {
- if (isAdmin(identity))
- {
- return method.invoke(mbs, args);
- }
- else
- {
- throw new SecurityException("Access denied");
- }
- }
-
- // Following users can perform any operation other than "createMBean" and "unregisterMBean"
- if (isAllowedToModify(identity))
- {
- return method.invoke(mbs, args);
- }
-
- // These users can only call "getAttribute" on the MBeanServerDelegate MBean
- // Here we can add other fine grained permissions like specific method for a particular mbean
- if (isReadOnlyUser(identity) && isReadOnlyMethod(method, args))
- {
- return method.invoke(mbs, args);
- }
-
- throw new SecurityException("Access denied");
- }
-
- private boolean isAdminMethod(Object[] args)
- {
- if (args[0] instanceof ObjectName)
- {
- ObjectName object = (ObjectName) args[0];
- return UserManagement.TYPE.equals(object.getKeyProperty("type"));
- }
-
- return false;
- }
-
- // Initialises the user roles
- public static void setAccessRights(Properties accessRights)
- {
- _userRoles = accessRights;
- }
-
- private boolean isAdmin(String userName)
- {
- if (ADMIN.equals(_userRoles.getProperty(userName)))
- {
- return true;
- }
- return false;
- }
-
- private boolean isAllowedToModify(String userName)
- {
- if (ADMIN.equals(_userRoles.getProperty(userName))
- || READWRITE.equals(_userRoles.getProperty(userName)))
- {
- return true;
- }
- return false;
- }
-
- private boolean isReadOnlyUser(String userName)
- {
- if (READONLY.equals(_userRoles.getProperty(userName)))
- {
- return true;
- }
- return false;
- }
-
- private boolean isReadOnlyMethod(Method method, Object[] args)
- {
- String methodName = method.getName();
- if (methodName.startsWith("query") || methodName.startsWith("get"))
- {
- return true;
- }
- else if (methodName.startsWith("set"))
- {
- return false;
- }
-
- if ((args[0] instanceof ObjectName) && (methodName.equals("invoke")))
- {
- String mbeanMethod = (args.length > 1) ? (String) args[1] : null;
- if (mbeanMethod == null)
- {
- return false;
- }
-
- try
- {
- MBeanInfo mbeanInfo = mbs.getMBeanInfo((ObjectName) args[0]);
- if (mbeanInfo != null)
- {
- MBeanOperationInfo[] opInfos = mbeanInfo.getOperations();
- for (MBeanOperationInfo opInfo : opInfos)
- {
- if (opInfo.getName().equals(mbeanMethod) && (opInfo.getImpact() == MBeanOperationInfo.INFO))
- {
- return true;
- }
- }
- }
- }
- catch (JMException ex)
- {
- ex.printStackTrace();
- }
- }
-
- return false;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java
deleted file mode 100644
index a2dca3e51d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java
+++ /dev/null
@@ -1,43 +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.
- *
- *
- */
-
-package org.apache.qpid.server.management;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.management.MBeanOperationInfo;
-
-/**
- * Annotation for MBean operations.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-@Inherited
-public @interface MBeanOperation
-{
- String name();
- String description();
- int impact() default MBeanOperationInfo.INFO;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java
deleted file mode 100644
index aba5ec70d8..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java
+++ /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.
- *
- *
- */
-
-package org.apache.qpid.server.management;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotation for MBean operation parameters.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.PARAMETER)
-public @interface MBeanOperationParameter {
- String name();
- String description();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/Managable.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/Managable.java
deleted file mode 100644
index 166a2a376d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/Managable.java
+++ /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.
- *
- */
-package org.apache.qpid.server.management;
-
-/**
- * Any object that can return a related MBean should implement this interface.
- *
- * This enables other classes to get the managed object, which in turn is useful when
- * constructing relationships between managed objects without having to maintain
- * separate data structures containing MBeans.
- *
- */
-public interface Managable
-{
- ManagedObject getManagedObject();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
deleted file mode 100644
index 45e2e91ed7..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
+++ /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.
- *
- */
-
-package org.apache.qpid.server.management;
-
-import java.io.IOException;
-
-import javax.management.JMException;
-import javax.management.MBeanOperationInfo;
-
-import org.apache.qpid.server.exchange.ManagedExchange;
-import org.apache.qpid.server.queue.ManagedQueue;
-
-/**
- * The ManagedBroker is the management interface to expose management
- * features of the Broker.
- *
- * @author Bhupendra Bhardwaj
- * @version 0.1
- */
-public interface ManagedBroker
-{
- static final String TYPE = "VirtualHostManager";
-
- /**
- * Creates a new Exchange.
- * @param name
- * @param type
- * @param durable
- * @param passive
- * @throws IOException
- * @throws JMException
- */
- @MBeanOperation(name="createNewExchange", description="Creates a new Exchange", impact= MBeanOperationInfo.ACTION)
- void createNewExchange(@MBeanOperationParameter(name="name", description="Name of the new exchange")String name,
- @MBeanOperationParameter(name="ExchangeType", description="Type of the exchange")String type,
- @MBeanOperationParameter(name="durable", description="true if the Exchang should be durable")boolean durable)
- throws IOException, JMException;
-
- /**
- * unregisters all the channels, queuebindings etc and unregisters
- * this exchange from managed objects.
- * @param exchange
- * @throws IOException
- * @throws JMException
- */
- @MBeanOperation(name="unregisterExchange",
- description="Unregisters all the related channels and queuebindings of this exchange",
- impact= MBeanOperationInfo.ACTION)
- void unregisterExchange(@MBeanOperationParameter(name= ManagedExchange.TYPE, description="Exchange Name")String exchange)
- throws IOException, JMException;
-
- /**
- * Create a new Queue on the Broker server
- * @param queueName
- * @param durable
- * @param owner
- * @param autoDelete
- * @throws IOException
- * @throws JMException
- */
- @MBeanOperation(name="createNewQueue", description="Create a new Queue on the Broker server", impact= MBeanOperationInfo.ACTION)
- void createNewQueue(@MBeanOperationParameter(name="queue name", description="Name of the new queue")String queueName,
- @MBeanOperationParameter(name="owner", description="Owner name")String owner,
- @MBeanOperationParameter(name="durable", description="true if the queue should be durable")boolean durable)
- throws IOException, JMException;
-
- /**
- * Unregisters the Queue bindings, removes the subscriptions and unregisters
- * from the managed objects.
- * @param queueName
- * @throws IOException
- * @throws JMException
- */
- @MBeanOperation(name="deleteQueue",
- description="Unregisters the Queue bindings, removes the subscriptions and deletes the queue",
- impact= MBeanOperationInfo.ACTION)
- void deleteQueue(@MBeanOperationParameter(name= ManagedQueue.TYPE, description="Queue Name")String queueName)
- throws IOException, JMException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObject.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObject.java
deleted file mode 100644
index 42ea8921a4..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObject.java
+++ /dev/null
@@ -1,58 +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.
- *
- */
-package org.apache.qpid.server.management;
-
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-import org.apache.qpid.AMQException;
-
-/**
- * This should be implemented by all Managable objects.
- */
-public interface ManagedObject
-{
- static final String DOMAIN = "org.apache.qpid";
-
- /**
- * @return the name that uniquely identifies this object instance. It must be
- * unique only among objects of this type at this level in the hierarchy so
- * the uniqueness should not be too difficult to ensure.
- */
- String getObjectInstanceName();
-
- String getType();
-
- Class<?> getManagementInterface();
-
- ManagedObject getParentObject();
-
- void register() throws AMQException;
-
- void unregister() throws AMQException;
-
- /**
- * Returns the ObjectName required for the mbeanserver registration.
- * @return ObjectName
- * @throws MalformedObjectNameException
- */
- ObjectName getObjectName() throws MalformedObjectNameException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObjectRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObjectRegistry.java
deleted file mode 100644
index d8d87ef881..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObjectRegistry.java
+++ /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.
- *
- */
-package org.apache.qpid.server.management;
-
-import javax.management.JMException;
-import java.rmi.RemoteException;
-import java.io.IOException;
-
-/**
- * Handles the registration (and unregistration and so on) of managed objects.
- *
- * Managed objects are responsible for exposting attributes, operations and notifications. They will expose
- * these outside the JVM therefore it is important not to use implementation objects directly as managed objects.
- * Instead, creating inner classes and exposing those is an effective way of exposing internal state in a
- * controlled way.
- *
- * Although we do not explictly use them while targetting Java 5, the enhanced MXBean approach in Java 6 will
- * be the obvious choice for managed objects.
- *
- */
-public interface ManagedObjectRegistry
-{
- void start() throws IOException;
-
- void registerObject(ManagedObject managedObject) throws JMException;
-
- void unregisterObject(ManagedObject managedObject) throws JMException;
-
- void close() throws RemoteException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagementConfiguration.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagementConfiguration.java
deleted file mode 100644
index 042f626e8b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/ManagementConfiguration.java
+++ /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.
- *
- */
-package org.apache.qpid.server.management;
-
-import org.apache.qpid.configuration.Configured;
-
-public class ManagementConfiguration
-{
- @Configured(path = "management.enabled",
- defaultValue = "true")
- public boolean enabled;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/NoopManagedObjectRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/NoopManagedObjectRegistry.java
deleted file mode 100644
index b4fbed6948..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/management/NoopManagedObjectRegistry.java
+++ /dev/null
@@ -1,60 +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.
- *
- */
-package org.apache.qpid.server.management;
-
-import javax.management.JMException;
-
-import org.apache.log4j.Logger;
-
-import java.rmi.RemoteException;
-
-/**
- * This managed object registry does not actually register MBeans. This can be used in tests when management is
- * not required or when management has been disabled.
- *
- */
-public class NoopManagedObjectRegistry implements ManagedObjectRegistry
-{
- private static final Logger _log = Logger.getLogger(NoopManagedObjectRegistry.class);
-
- public NoopManagedObjectRegistry()
- {
- _log.info("Management is disabled");
- }
-
- public void start()
- {
- //no-op
- }
-
- public void registerObject(ManagedObject managedObject) throws JMException
- {
- }
-
- public void unregisterObject(ManagedObject managedObject) throws JMException
- {
- }
-
- public void close() throws RemoteException
- {
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverter.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverter.java
deleted file mode 100644
index e01c5aabbf..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverter.java
+++ /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.
- *
- */
-
-/*
- * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
- * Supported AMQP versions:
- * 8-0
- */
-package org.apache.qpid.server.output;
-
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.AMQException;
-
-public interface ProtocolOutputConverter
-{
- void confirmConsumerAutoClose(int channelId, AMQShortString consumerTag);
-
- interface Factory
- {
- ProtocolOutputConverter newInstance(AMQProtocolSession session);
- }
-
- void writeDeliver(AMQMessage message, int channelId, long deliveryTag, AMQShortString consumerTag)
- throws AMQException;
-
- void writeGetOk(AMQMessage message, int channelId, long deliveryTag, int queueSize) throws AMQException;
-
- byte getProtocolMinorVersion();
-
- byte getProtocolMajorVersion();
-
- void writeReturn(AMQMessage message, int channelId, int replyCode, AMQShortString replyText)
- throws AMQException;
-
- void writeFrame(AMQDataBlock block);
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverterRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverterRegistry.java
deleted file mode 100644
index 36e7e88fd6..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverterRegistry.java
+++ /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.
- *
- */
-
-/*
- * This file is auto-generated by Qpid Gentools v.0.1 - do not modify.
- * Supported AMQP versions:
- * 8-0
- */
-package org.apache.qpid.server.output;
-
-import org.apache.qpid.server.output.ProtocolOutputConverter.Factory;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.framing.ProtocolVersion;
-
-import java.util.Map;
-import java.util.HashMap;
-
-public class ProtocolOutputConverterRegistry
-{
-
- private static final Map<ProtocolVersion, Factory> _registry =
- new HashMap<ProtocolVersion, Factory>();
-
-
- static
- {
- register(ProtocolVersion.v8_0, org.apache.qpid.server.output.amqp0_8.ProtocolOutputConverterImpl.getInstanceFactory());
- register(ProtocolVersion.v0_9, org.apache.qpid.server.output.amqp0_9.ProtocolOutputConverterImpl.getInstanceFactory());
-
- }
-
- private static void register(ProtocolVersion version, Factory converter)
- {
-
- _registry.put(version,converter);
- }
-
-
- public static ProtocolOutputConverter getConverter(AMQProtocolSession session)
- {
- return _registry.get(session.getProtocolVersion()).newInstance(session);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java
deleted file mode 100644
index 2b55d294b5..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java
+++ /dev/null
@@ -1,284 +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 file is auto-generated by Qpid Gentools v.0.1 - do not modify.
- * Supported AMQP versions:
- * 8-0
- */
-package org.apache.qpid.server.output.amqp0_8;
-
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.AMQMessageHandle;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.output.ProtocolOutputConverter;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.AMQException;
-
-import org.apache.mina.common.ByteBuffer;
-
-import java.util.Iterator;
-
-public class ProtocolOutputConverterImpl implements ProtocolOutputConverter
-{
-
-
- public static Factory getInstanceFactory()
- {
- return new Factory()
- {
-
- public ProtocolOutputConverter newInstance(AMQProtocolSession session)
- {
- return new ProtocolOutputConverterImpl(session);
- }
- };
- }
-
- private final AMQProtocolSession _protocolSession;
-
- private ProtocolOutputConverterImpl(AMQProtocolSession session)
- {
- _protocolSession = session;
- }
-
-
- public AMQProtocolSession getProtocolSession()
- {
- return _protocolSession;
- }
-
- public void writeDeliver(AMQMessage message, int channelId, long deliveryTag, AMQShortString consumerTag)
- throws AMQException
- {
- AMQDataBlock deliver = createEncodedDeliverFrame(message, channelId, deliveryTag, consumerTag);
- AMQDataBlock contentHeader = ContentHeaderBody.createAMQFrame(channelId,
- message.getContentHeaderBody());
-
- final AMQMessageHandle messageHandle = message.getMessageHandle();
- final StoreContext storeContext = message.getStoreContext();
-
-
- final int bodyCount = messageHandle.getBodyCount(storeContext);
-
- if(bodyCount == 0)
- {
- SmallCompositeAMQDataBlock compositeBlock = new SmallCompositeAMQDataBlock(deliver,
- contentHeader);
-
- writeFrame(compositeBlock);
- }
- else
- {
-
-
- //
- // Optimise the case where we have a single content body. In that case we create a composite block
- // so that we can writeDeliver out the deliver, header and body with a single network writeDeliver.
- //
- ContentChunk cb = messageHandle.getContentChunk(storeContext, 0);
-
- AMQDataBlock firstContentBody = new AMQFrame(channelId, getProtocolSession().getMethodRegistry().getProtocolVersionMethodConverter().convertToBody(cb));
- AMQDataBlock[] blocks = new AMQDataBlock[]{deliver, contentHeader, firstContentBody};
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(blocks);
- writeFrame(compositeBlock);
-
- //
- // Now start writing out the other content bodies
- //
- for(int i = 1; i < bodyCount; i++)
- {
- cb = messageHandle.getContentChunk(storeContext, i);
- writeFrame(new AMQFrame(channelId, getProtocolSession().getMethodRegistry().getProtocolVersionMethodConverter().convertToBody(cb)));
- }
-
-
- }
-
-
- }
-
-
- public void writeGetOk(AMQMessage message, int channelId, long deliveryTag, int queueSize) throws AMQException
- {
-
- final AMQMessageHandle messageHandle = message.getMessageHandle();
- final StoreContext storeContext = message.getStoreContext();
-
- AMQDataBlock deliver = createEncodedGetOkFrame(message, channelId, deliveryTag, queueSize);
-
-
- AMQDataBlock contentHeader = ContentHeaderBody.createAMQFrame(channelId,
- message.getContentHeaderBody());
-
- final int bodyCount = messageHandle.getBodyCount(storeContext);
- if(bodyCount == 0)
- {
- SmallCompositeAMQDataBlock compositeBlock = new SmallCompositeAMQDataBlock(deliver,
- contentHeader);
- writeFrame(compositeBlock);
- }
- else
- {
-
-
- //
- // Optimise the case where we have a single content body. In that case we create a composite block
- // so that we can writeDeliver out the deliver, header and body with a single network writeDeliver.
- //
- ContentChunk cb = messageHandle.getContentChunk(storeContext, 0);
-
- AMQDataBlock firstContentBody = new AMQFrame(channelId, getProtocolSession().getMethodRegistry().getProtocolVersionMethodConverter().convertToBody(cb));
- AMQDataBlock[] blocks = new AMQDataBlock[]{deliver, contentHeader, firstContentBody};
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(blocks);
- writeFrame(compositeBlock);
-
- //
- // Now start writing out the other content bodies
- //
- for(int i = 1; i < bodyCount; i++)
- {
- cb = messageHandle.getContentChunk(storeContext, i);
- writeFrame(new AMQFrame(channelId, getProtocolSession().getMethodRegistry().getProtocolVersionMethodConverter().convertToBody(cb)));
- }
-
-
- }
-
-
- }
-
-
- private AMQDataBlock createEncodedDeliverFrame(AMQMessage message, int channelId, long deliveryTag, AMQShortString consumerTag)
- throws AMQException
- {
- final MessagePublishInfo pb = message.getMessagePublishInfo();
- final AMQMessageHandle messageHandle = message.getMessageHandle();
-
- MethodRegistry methodRegistry = MethodRegistry.getMethodRegistry(ProtocolVersion.v8_0);
- BasicDeliverBody deliverBody =
- methodRegistry.createBasicDeliverBody(consumerTag,
- deliveryTag,
- messageHandle.isRedelivered(),
- pb.getExchange(),
- pb.getRoutingKey());
- AMQFrame deliverFrame = deliverBody.generateFrame(channelId);
-
-
- return deliverFrame;
- }
-
- private AMQDataBlock createEncodedGetOkFrame(AMQMessage message, int channelId, long deliveryTag, int queueSize)
- throws AMQException
- {
- final MessagePublishInfo pb = message.getMessagePublishInfo();
- final AMQMessageHandle messageHandle = message.getMessageHandle();
-
- MethodRegistry methodRegistry = MethodRegistry.getMethodRegistry(ProtocolVersion.v8_0);
- BasicGetOkBody getOkBody =
- methodRegistry.createBasicGetOkBody(deliveryTag,
- messageHandle.isRedelivered(),
- pb.getExchange(),
- pb.getRoutingKey(),
- queueSize);
- AMQFrame getOkFrame = getOkBody.generateFrame(channelId);
-
- return getOkFrame;
- }
-
- public byte getProtocolMinorVersion()
- {
- return getProtocolSession().getProtocolMinorVersion();
- }
-
- public byte getProtocolMajorVersion()
- {
- return getProtocolSession().getProtocolMajorVersion();
- }
-
- private AMQDataBlock createEncodedReturnFrame(AMQMessage message, int channelId, int replyCode, AMQShortString replyText) throws AMQException
- {
- MethodRegistry methodRegistry = MethodRegistry.getMethodRegistry(ProtocolVersion.v8_0);
- BasicReturnBody basicReturnBody =
- methodRegistry.createBasicReturnBody(replyCode,
- replyText,
- message.getMessagePublishInfo().getExchange(),
- message.getMessagePublishInfo().getRoutingKey());
- AMQFrame returnFrame = basicReturnBody.generateFrame(channelId);
-
- return returnFrame;
- }
-
- public void writeReturn(AMQMessage message, int channelId, int replyCode, AMQShortString replyText)
- throws AMQException
- {
- AMQDataBlock returnFrame = createEncodedReturnFrame(message, channelId, replyCode, replyText);
-
- AMQDataBlock contentHeader = ContentHeaderBody.createAMQFrame(channelId,
- message.getContentHeaderBody());
-
- Iterator<AMQDataBlock> bodyFrameIterator = message.getBodyFrameIterator(getProtocolSession(), channelId);
- //
- // Optimise the case where we have a single content body. In that case we create a composite block
- // so that we can writeDeliver out the deliver, header and body with a single network writeDeliver.
- //
- if (bodyFrameIterator.hasNext())
- {
- AMQDataBlock firstContentBody = bodyFrameIterator.next();
- AMQDataBlock[] blocks = new AMQDataBlock[]{returnFrame, contentHeader, firstContentBody};
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(blocks);
- writeFrame(compositeBlock);
- }
- else
- {
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(new AMQDataBlock[]{returnFrame, contentHeader});
-
- writeFrame(compositeBlock);
- }
-
- //
- // Now start writing out the other content bodies
- // TODO: MINA needs to be fixed so the the pending writes buffer is not unbounded
- //
- while (bodyFrameIterator.hasNext())
- {
- writeFrame(bodyFrameIterator.next());
- }
- }
-
-
- public void writeFrame(AMQDataBlock block)
- {
- getProtocolSession().writeFrame(block);
- }
-
-
- public void confirmConsumerAutoClose(int channelId, AMQShortString consumerTag)
- {
- MethodRegistry methodRegistry = MethodRegistry.getMethodRegistry(ProtocolVersion.v8_0);
- BasicCancelOkBody basicCancelOkBody = methodRegistry.createBasicCancelOkBody(consumerTag);
- writeFrame(basicCancelOkBody.generateFrame(channelId));
-
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_9/ProtocolOutputConverterImpl.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_9/ProtocolOutputConverterImpl.java
deleted file mode 100644
index 65184fe744..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_9/ProtocolOutputConverterImpl.java
+++ /dev/null
@@ -1,391 +0,0 @@
-package org.apache.qpid.server.output.amqp0_9;
-/*
- *
- * 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 org.apache.mina.common.ByteBuffer;
-
-import java.util.Iterator;
-
-import org.apache.qpid.server.output.ProtocolOutputConverter;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.AMQMessageHandle;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-
-public class ProtocolOutputConverterImpl implements ProtocolOutputConverter
-{
- private static final MethodRegistry METHOD_REGISTRY = MethodRegistry.getMethodRegistry(ProtocolVersion.v0_9);
- private static final ProtocolVersionMethodConverter PROTOCOL_METHOD_CONVERTER = METHOD_REGISTRY.getProtocolVersionMethodConverter();
-
-
- public static Factory getInstanceFactory()
- {
- return new Factory()
- {
-
- public ProtocolOutputConverter newInstance(AMQProtocolSession session)
- {
- return new ProtocolOutputConverterImpl(session);
- }
- };
- }
-
- private final AMQProtocolSession _protocolSession;
-
- private ProtocolOutputConverterImpl(AMQProtocolSession session)
- {
- _protocolSession = session;
- }
-
-
- public AMQProtocolSession getProtocolSession()
- {
- return _protocolSession;
- }
-
- public void writeDeliver(AMQMessage message, int channelId, long deliveryTag, AMQShortString consumerTag)
- throws AMQException
- {
- AMQBody deliverBody = createEncodedDeliverFrame(message, channelId, deliveryTag, consumerTag);
- final ContentHeaderBody contentHeaderBody = message.getContentHeaderBody();
-
-
- final AMQMessageHandle messageHandle = message.getMessageHandle();
- final StoreContext storeContext = message.getStoreContext();
-
-
- final int bodyCount = messageHandle.getBodyCount(storeContext);
-
- if(bodyCount == 0)
- {
- SmallCompositeAMQBodyBlock compositeBlock = new SmallCompositeAMQBodyBlock(channelId, deliverBody,
- contentHeaderBody);
-
- writeFrame(compositeBlock);
- }
- else
- {
-
-
- //
- // Optimise the case where we have a single content body. In that case we create a composite block
- // so that we can writeDeliver out the deliver, header and body with a single network writeDeliver.
- //
- ContentChunk cb = messageHandle.getContentChunk(storeContext, 0);
-
- AMQBody firstContentBody = PROTOCOL_METHOD_CONVERTER.convertToBody(cb);
-
- CompositeAMQBodyBlock compositeBlock = new CompositeAMQBodyBlock(channelId, deliverBody, contentHeaderBody, firstContentBody);
- writeFrame(compositeBlock);
-
- //
- // Now start writing out the other content bodies
- //
- for(int i = 1; i < bodyCount; i++)
- {
- cb = messageHandle.getContentChunk(storeContext, i);
- writeFrame(new AMQFrame(channelId, PROTOCOL_METHOD_CONVERTER.convertToBody(cb)));
- }
-
-
- }
-
- }
-
- private AMQDataBlock createContentHeaderBlock(final int channelId, final ContentHeaderBody contentHeaderBody)
- {
-
- AMQDataBlock contentHeader = ContentHeaderBody.createAMQFrame(channelId,
- contentHeaderBody);
- return contentHeader;
- }
-
-
- public void writeGetOk(AMQMessage message, int channelId, long deliveryTag, int queueSize) throws AMQException
- {
-
- final AMQMessageHandle messageHandle = message.getMessageHandle();
- final StoreContext storeContext = message.getStoreContext();
-
- AMQFrame deliver = createEncodedGetOkFrame(message, channelId, deliveryTag, queueSize);
-
-
- AMQDataBlock contentHeader = createContentHeaderBlock(channelId, message.getContentHeaderBody());
-
- final int bodyCount = messageHandle.getBodyCount(storeContext);
- if(bodyCount == 0)
- {
- SmallCompositeAMQDataBlock compositeBlock = new SmallCompositeAMQDataBlock(deliver,
- contentHeader);
- writeFrame(compositeBlock);
- }
- else
- {
-
-
- //
- // Optimise the case where we have a single content body. In that case we create a composite block
- // so that we can writeDeliver out the deliver, header and body with a single network writeDeliver.
- //
- ContentChunk cb = messageHandle.getContentChunk(storeContext, 0);
-
- AMQDataBlock firstContentBody = new AMQFrame(channelId, PROTOCOL_METHOD_CONVERTER.convertToBody(cb));
- AMQDataBlock[] blocks = new AMQDataBlock[]{deliver, contentHeader, firstContentBody};
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(blocks);
- writeFrame(compositeBlock);
-
- //
- // Now start writing out the other content bodies
- //
- for(int i = 1; i < bodyCount; i++)
- {
- cb = messageHandle.getContentChunk(storeContext, i);
- writeFrame(new AMQFrame(channelId, PROTOCOL_METHOD_CONVERTER.convertToBody(cb)));
- }
-
-
- }
-
-
- }
-
-
- private AMQBody createEncodedDeliverFrame(AMQMessage message, final int channelId, final long deliveryTag, final AMQShortString consumerTag)
- throws AMQException
- {
- final MessagePublishInfo pb = message.getMessagePublishInfo();
- final AMQMessageHandle messageHandle = message.getMessageHandle();
-
-
- final boolean isRedelivered = messageHandle.isRedelivered();
- final AMQShortString exchangeName = pb.getExchange();
- final AMQShortString routingKey = pb.getRoutingKey();
-
- final AMQBody returnBlock = new AMQBody()
- {
-
- public AMQBody _underlyingBody;
-
- public AMQBody createAMQBody()
- {
- return METHOD_REGISTRY.createBasicDeliverBody(consumerTag,
- deliveryTag,
- isRedelivered,
- exchangeName,
- routingKey);
-
-
-
-
-
- }
-
- public byte getFrameType()
- {
- return AMQMethodBody.TYPE;
- }
-
- public int getSize()
- {
- if(_underlyingBody == null)
- {
- _underlyingBody = createAMQBody();
- }
- return _underlyingBody.getSize();
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- if(_underlyingBody == null)
- {
- _underlyingBody = createAMQBody();
- }
- _underlyingBody.writePayload(buffer);
- }
-
- public void handle(final int channelId, final AMQVersionAwareProtocolSession amqMinaProtocolSession)
- throws AMQException
- {
- throw new AMQException("This block should never be dispatched!");
- }
- };
- return returnBlock;
- }
-
- private AMQFrame createEncodedGetOkFrame(AMQMessage message, int channelId, long deliveryTag, int queueSize)
- throws AMQException
- {
- final MessagePublishInfo pb = message.getMessagePublishInfo();
- final AMQMessageHandle messageHandle = message.getMessageHandle();
-
-
- BasicGetOkBody getOkBody =
- METHOD_REGISTRY.createBasicGetOkBody(deliveryTag,
- messageHandle.isRedelivered(),
- pb.getExchange(),
- pb.getRoutingKey(),
- queueSize);
- AMQFrame getOkFrame = getOkBody.generateFrame(channelId);
-
- return getOkFrame;
- }
-
- public byte getProtocolMinorVersion()
- {
- return getProtocolSession().getProtocolMinorVersion();
- }
-
- public byte getProtocolMajorVersion()
- {
- return getProtocolSession().getProtocolMajorVersion();
- }
-
- private AMQDataBlock createEncodedReturnFrame(AMQMessage message, int channelId, int replyCode, AMQShortString replyText) throws AMQException
- {
-
- BasicReturnBody basicReturnBody =
- METHOD_REGISTRY.createBasicReturnBody(replyCode,
- replyText,
- message.getMessagePublishInfo().getExchange(),
- message.getMessagePublishInfo().getRoutingKey());
- AMQFrame returnFrame = basicReturnBody.generateFrame(channelId);
-
- return returnFrame;
- }
-
- public void writeReturn(AMQMessage message, int channelId, int replyCode, AMQShortString replyText)
- throws AMQException
- {
- AMQDataBlock returnFrame = createEncodedReturnFrame(message, channelId, replyCode, replyText);
-
- AMQDataBlock contentHeader = createContentHeaderBlock(channelId, message.getContentHeaderBody());
-
- Iterator<AMQDataBlock> bodyFrameIterator = message.getBodyFrameIterator(getProtocolSession(), channelId);
- //
- // Optimise the case where we have a single content body. In that case we create a composite block
- // so that we can writeDeliver out the deliver, header and body with a single network writeDeliver.
- //
- if (bodyFrameIterator.hasNext())
- {
- AMQDataBlock firstContentBody = bodyFrameIterator.next();
- AMQDataBlock[] blocks = new AMQDataBlock[]{returnFrame, contentHeader, firstContentBody};
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(blocks);
- writeFrame(compositeBlock);
- }
- else
- {
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(new AMQDataBlock[]{returnFrame, contentHeader});
-
- writeFrame(compositeBlock);
- }
-
- //
- // Now start writing out the other content bodies
- // TODO: MINA needs to be fixed so the the pending writes buffer is not unbounded
- //
- while (bodyFrameIterator.hasNext())
- {
- writeFrame(bodyFrameIterator.next());
- }
- }
-
-
- public void writeFrame(AMQDataBlock block)
- {
- getProtocolSession().writeFrame(block);
- }
-
-
- public void confirmConsumerAutoClose(int channelId, AMQShortString consumerTag)
- {
-
- BasicCancelOkBody basicCancelOkBody = METHOD_REGISTRY.createBasicCancelOkBody(consumerTag);
- writeFrame(basicCancelOkBody.generateFrame(channelId));
-
- }
-
-
- public static final class CompositeAMQBodyBlock extends AMQDataBlock
- {
- public static final int OVERHEAD = 3 * AMQFrame.getFrameOverhead();
-
- private final AMQBody _methodBody;
- private final AMQBody _headerBody;
- private final AMQBody _contentBody;
- private final int _channel;
-
-
- public CompositeAMQBodyBlock(int channel, AMQBody methodBody, AMQBody headerBody, AMQBody contentBody)
- {
- _channel = channel;
- _methodBody = methodBody;
- _headerBody = headerBody;
- _contentBody = contentBody;
-
- }
-
- public long getSize()
- {
- return OVERHEAD + _methodBody.getSize() + _headerBody.getSize() + _contentBody.getSize();
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- AMQFrame.writeFrames(buffer, _channel, _methodBody, _headerBody, _contentBody);
- }
- }
-
- public static final class SmallCompositeAMQBodyBlock extends AMQDataBlock
- {
- public static final int OVERHEAD = 2 * AMQFrame.getFrameOverhead();
-
- private final AMQBody _methodBody;
- private final AMQBody _headerBody;
- private final int _channel;
-
-
- public SmallCompositeAMQBodyBlock(int channel, AMQBody methodBody, AMQBody headerBody)
- {
- _channel = channel;
- _methodBody = methodBody;
- _headerBody = headerBody;
-
- }
-
- public long getSize()
- {
- return OVERHEAD + _methodBody.getSize() + _headerBody.getSize() ;
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- AMQFrame.writeFrames(buffer, _channel, _methodBody, _headerBody);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Activator.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Activator.java
deleted file mode 100644
index b0ebf197f9..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/Activator.java
+++ /dev/null
@@ -1,44 +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.
- */
-
-package org.apache.qpid.server.plugins;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator
-{
-
- BundleContext _context = null;
-
- public void start(BundleContext ctx) throws Exception
- {
- _context = ctx;
- }
-
- public void stop(BundleContext ctx) throws Exception
- {
- start(null);
- }
-
- public BundleContext getContext()
- {
- return _context;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java
deleted file mode 100644
index 9191ecf6ed..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/plugins/PluginManager.java
+++ /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.
- */
-
-package org.apache.qpid.server.plugins;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.felix.framework.Felix;
-import org.apache.felix.framework.cache.BundleCache;
-import org.apache.felix.framework.util.FelixConstants;
-import org.apache.felix.framework.util.StringMap;
-import org.apache.qpid.server.exchange.ExchangeType;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleException;
-import org.osgi.util.tracker.ServiceTracker;
-
-/**
- *
- * @author aidan
- *
- * Provides access to pluggable elements, such as exchanges
- */
-
-public class PluginManager
-{
-
- private Felix _felix = null;
- private ServiceTracker _exchangeTracker = null;
- private Activator _activator = null;
- private boolean _empty;
-
- public PluginManager(String plugindir) throws Exception
- {
- StringMap configMap = new StringMap(false);
-
- // Tell felix it's being embedded
- configMap.put(FelixConstants.EMBEDDED_EXECUTION_PROP, "true");
- // Add the bundle provided service interface package and the core OSGi
- // packages to be exported from the class path via the system bundle.
- configMap.put(FelixConstants.FRAMEWORK_SYSTEMPACKAGES, "org.osgi.framework; version=1.3.0,"
- + "org.osgi.service.packageadmin; version=1.2.0," +
- "org.osgi.service.startlevel; version=1.0.0," +
- "org.osgi.service.url; version=1.0.0," +
- "org.apache.qpid.framing; version=0.2.1," +
- "org.apache.qpid.server.exchange; version=0.2.1," +
- "org.apache.qpid.server.management; version=0.2.1,"+
- "org.apache.qpid.protocol; version=0.2.1,"+
- "org.apache.qpid.server.virtualhost; version=0.2.1," +
- "org.apache.qpid; version=0.2.1," +
- "org.apache.qpid.server.queue; version=0.2.1," +
- "javax.management.openmbean; version=1.0.0,"+
- "javax.management; version=1.0.0,"+
- "org.apache.qpid.junit.extensions.util; version=0.6.1,"
- );
-
- if (plugindir == null)
- {
- _empty = true;
- return;
- }
-
- // Set the list of bundles to load
- File dir = new File(plugindir);
- if (!dir.exists())
- {
- _empty = true;
- return;
- }
- StringBuffer pluginJars = new StringBuffer();
-
- if (dir.isDirectory())
- {
- for (String child : dir.list())
- {
- if (child.endsWith("jar"))
- {
- pluginJars.append(String.format(" file:%s%s%s", plugindir,File.separator,child));
- }
- }
- }
- if (pluginJars.length() == 0)
- {
- _empty = true;
- return;
- }
-
- configMap.put(FelixConstants.AUTO_START_PROP + ".1", pluginJars.toString());
- configMap.put(BundleCache.CACHE_PROFILE_DIR_PROP, plugindir);
-
- List<BundleActivator> activators = new ArrayList<BundleActivator>();
- _activator = new Activator();
- activators.add(_activator);
-
- _felix = new Felix(configMap, activators);
- try
- {
- _felix.start();
- _exchangeTracker = new ServiceTracker(_activator.getContext(), ExchangeType.class.getName(), null);
- _exchangeTracker.open();
- }
- catch (BundleException e)
- {
- throw new Exception("Could not create bundle");
- }
- }
-
- public Map<String, ExchangeType<?>> getExchanges()
- {
- if (_empty)
- {
- return null;
- }
- Map<String, ExchangeType<?>>exchanges = new HashMap<String, ExchangeType<?>>();
- for (Object service : _exchangeTracker.getServices())
- {
- if (service instanceof ExchangeType<?>)
- {
- exchanges.put(service.getClass().getName(), (ExchangeType<?>) service);
- }
- }
-
- return exchanges;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
deleted file mode 100644
index 4b69842c49..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
+++ /dev/null
@@ -1,859 +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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import org.apache.log4j.Logger;
-
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.CloseFuture;
-import org.apache.mina.transport.vmpipe.VmPipeAddress;
-
-import org.apache.qpid.AMQChannelException;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.codec.AMQDecoder;
-import org.apache.qpid.common.ClientProperties;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.pool.ReadWriteThreadModel;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.protocol.AMQMethodListener;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.handler.ServerMethodDispatcherImpl;
-import org.apache.qpid.server.management.Managable;
-import org.apache.qpid.server.management.ManagedObject;
-import org.apache.qpid.server.output.ProtocolOutputConverter;
-import org.apache.qpid.server.output.ProtocolOutputConverterRegistry;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.state.AMQState;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.qpid.transport.Sender;
-
-import javax.management.JMException;
-import javax.security.sasl.SaslServer;
-
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.security.Principal;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.CopyOnWriteArraySet;
-
-public class AMQMinaProtocolSession implements AMQProtocolSession, Managable
-{
- private static final Logger _logger = Logger.getLogger(AMQProtocolSession.class);
-
- private static final String CLIENT_PROPERTIES_INSTANCE = ClientProperties.instance.toString();
-
- // to save boxing the channelId and looking up in a map... cache in an array the low numbered
- // channels. This value must be of the form 2^x - 1.
- private static final int CHANNEL_CACHE_SIZE = 0xff;
-
- private final IoSession _minaProtocolSession;
-
- private AMQShortString _contextKey;
-
- private AMQShortString _clientVersion = null;
-
- private VirtualHost _virtualHost;
-
- private final Map<Integer, AMQChannel> _channelMap = new HashMap<Integer, AMQChannel>();
-
- private final AMQChannel[] _cachedChannels = new AMQChannel[CHANNEL_CACHE_SIZE + 1];
-
- private final CopyOnWriteArraySet<AMQMethodListener> _frameListeners = new CopyOnWriteArraySet<AMQMethodListener>();
-
- private final AMQStateManager _stateManager;
-
- private AMQCodecFactory _codecFactory;
-
- private AMQProtocolSessionMBean _managedObject;
-
- private SaslServer _saslServer;
-
- private Object _lastReceived;
-
- private Object _lastSent;
-
- protected boolean _closed;
- // maximum number of channels this session should have
- private long _maxNoOfChannels = 1000;
-
- /* AMQP Version for this session */
- private ProtocolVersion _protocolVersion = ProtocolVersion.getLatestSupportedVersion();
-
- private FieldTable _clientProperties;
- private final List<Task> _taskList = new CopyOnWriteArrayList<Task>();
-
- private List<Integer> _closingChannelsList = new CopyOnWriteArrayList<Integer>();
- private ProtocolOutputConverter _protocolOutputConverter;
- private Principal _authorizedID;
- private MethodDispatcher _dispatcher;
- private ProtocolSessionIdentifier _sessionIdentifier;
-
- private static final long LAST_WRITE_FUTURE_JOIN_TIMEOUT = 60000L;
- private org.apache.mina.common.WriteFuture _lastWriteFuture;
-
- public ManagedObject getManagedObject()
- {
- return _managedObject;
- }
-
- public AMQMinaProtocolSession(IoSession session, VirtualHostRegistry virtualHostRegistry, AMQCodecFactory codecFactory)
- throws AMQException
- {
- _stateManager = new AMQStateManager(virtualHostRegistry, this);
- _minaProtocolSession = session;
- session.setAttachment(this);
-
- _codecFactory = codecFactory;
-
- try
- {
- IoServiceConfig config = session.getServiceConfig();
- ReadWriteThreadModel threadModel = (ReadWriteThreadModel) config.getThreadModel();
- threadModel.getAsynchronousReadFilter().createNewJobForSession(session);
- threadModel.getAsynchronousWriteFilter().createNewJobForSession(session);
- }
- catch (RuntimeException e)
- {
- e.printStackTrace();
- throw e;
-
- }
- }
-
- public AMQMinaProtocolSession(IoSession session, VirtualHostRegistry virtualHostRegistry, AMQCodecFactory codecFactory,
- AMQStateManager stateManager) throws AMQException
- {
- _stateManager = stateManager;
- _minaProtocolSession = session;
- session.setAttachment(this);
-
- _codecFactory = codecFactory;
-
- }
-
- private AMQProtocolSessionMBean createMBean() throws AMQException
- {
- try
- {
- return new AMQProtocolSessionMBean(this);
- }
- catch (JMException ex)
- {
- _logger.error("AMQProtocolSession MBean creation has failed ", ex);
- throw new AMQException("AMQProtocolSession MBean creation has failed ", ex);
- }
- }
-
- public IoSession getIOSession()
- {
- return _minaProtocolSession;
- }
-
- public static AMQProtocolSession getAMQProtocolSession(IoSession minaProtocolSession)
- {
- return (AMQProtocolSession) minaProtocolSession.getAttachment();
- }
-
- public void dataBlockReceived(AMQDataBlock message) throws Exception
- {
- _lastReceived = message;
- if (message instanceof ProtocolInitiation)
- {
- protocolInitiationReceived((ProtocolInitiation) message);
-
- }
- else if (message instanceof AMQFrame)
- {
- AMQFrame frame = (AMQFrame) message;
- frameReceived(frame);
-
- }
- else
- {
- throw new UnknnownMessageTypeException(message);
- }
- }
-
- private void frameReceived(AMQFrame frame) throws AMQException
- {
- int channelId = frame.getChannel();
- AMQBody body = frame.getBodyFrame();
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Frame Received: " + frame);
- }
-
- // Check that this channel is not closing
- if (channelAwaitingClosure(channelId))
- {
- if ((frame.getBodyFrame() instanceof ChannelCloseOkBody))
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Channel[" + channelId + "] awaiting closure - processing close-ok");
- }
- }
- else
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Channel[" + channelId + "] awaiting closure. Should close socket as client did not close-ok :" + frame);
- }
-
- closeProtocolSession();
- return;
- }
- }
-
- try
- {
- body.handle(channelId, this);
- }
- catch (AMQException e)
- {
- closeChannel(channelId);
- throw e;
- }
-
- }
-
- private void protocolInitiationReceived(ProtocolInitiation pi)
- {
- // this ensures the codec never checks for a PI message again
- ((AMQDecoder) _codecFactory.getDecoder()).setExpectProtocolInitiation(false);
- try
- {
- ProtocolVersion pv = pi.checkVersion(); // Fails if not correct
-
- // This sets the protocol version (and hence framing classes) for this session.
- setProtocolVersion(pv);
-
- String mechanisms = ApplicationRegistry.getInstance().getAuthenticationManager().getMechanisms();
-
- String locales = "en_US";
-
- AMQMethodBody responseBody = getMethodRegistry().createConnectionStartBody((short) getProtocolMajorVersion(),
- (short) getProtocolMinorVersion(),
- null,
- mechanisms.getBytes(),
- locales.getBytes());
- _minaProtocolSession.write(responseBody.generateFrame(0));
-
- }
- catch (AMQException e)
- {
- _logger.info("Received unsupported protocol initiation for protocol version: " + getProtocolVersion());
-
- _minaProtocolSession.write(new ProtocolInitiation(ProtocolVersion.getLatestSupportedVersion()));
-
- // TODO: Close connection (but how to wait until message is sent?)
- // ritchiem 2006-12-04 will this not do?
- // WriteFuture future = _minaProtocolSession.write(new ProtocolInitiation(pv[i][PROTOCOLgetProtocolMajorVersion()], pv[i][PROTOCOLgetProtocolMinorVersion()]));
- // future.join();
- // close connection
-
- }
- }
-
- public void methodFrameReceived(int channelId, AMQMethodBody methodBody)
- {
-
- final AMQMethodEvent<AMQMethodBody> evt = new AMQMethodEvent<AMQMethodBody>(channelId, methodBody);
-
- try
- {
- try
- {
-
- boolean wasAnyoneInterested = _stateManager.methodReceived(evt);
-
- if (!_frameListeners.isEmpty())
- {
- for (AMQMethodListener listener : _frameListeners)
- {
- wasAnyoneInterested = listener.methodReceived(evt) || wasAnyoneInterested;
- }
- }
-
- if (!wasAnyoneInterested)
- {
- throw new AMQNoMethodHandlerException(evt);
- }
- }
- catch (AMQChannelException e)
- {
- if (getChannel(channelId) != null)
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Closing channel due to: " + e.getMessage());
- }
-
- writeFrame(e.getCloseFrame(channelId));
- closeChannel(channelId);
- }
- else
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("ChannelException occured on non-existent channel:" + e.getMessage());
- }
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("Closing connection due to: " + e.getMessage());
- }
-
- AMQConnectionException ce =
- evt.getMethod().getConnectionException(AMQConstant.CHANNEL_ERROR,
- AMQConstant.CHANNEL_ERROR.getName().toString());
-
- closeConnection(channelId, ce, false);
- }
- }
- catch (AMQConnectionException e)
- {
- closeConnection(channelId, e, false);
- }
- }
- catch (Exception e)
- {
-
- for (AMQMethodListener listener : _frameListeners)
- {
- listener.error(e);
- }
-
- _logger.error("Unexpected exception while processing frame. Closing connection.", e);
-
- closeProtocolSession();
- }
- }
-
- public void contentHeaderReceived(int channelId, ContentHeaderBody body) throws AMQException
- {
-
- AMQChannel channel = getAndAssertChannel(channelId);
-
- channel.publishContentHeader(body);
-
- }
-
- public void contentBodyReceived(int channelId, ContentBody body) throws AMQException
- {
- AMQChannel channel = getAndAssertChannel(channelId);
-
- channel.publishContentBody(body);
- }
-
- public void heartbeatBodyReceived(int channelId, HeartbeatBody body)
- {
- // NO - OP
- }
-
- /**
- * Convenience method that writes a frame to the protocol session. Equivalent to calling
- * getProtocolSession().write().
- *
- * @param frame the frame to write
- */
- public void writeFrame(AMQDataBlock frame)
- {
- _lastSent = frame;
-
- _lastWriteFuture = _minaProtocolSession.write(frame);
- }
-
- public AMQShortString getContextKey()
- {
- return _contextKey;
- }
-
- public void setContextKey(AMQShortString contextKey)
- {
- _contextKey = contextKey;
- }
-
- public List<AMQChannel> getChannels()
- {
- return new ArrayList<AMQChannel>(_channelMap.values());
- }
-
- public AMQChannel getAndAssertChannel(int channelId) throws AMQException
- {
- AMQChannel channel = getChannel(channelId);
- if (channel == null)
- {
- throw new AMQException(AMQConstant.NOT_FOUND, "Channel not found with id:" + channelId);
- }
-
- return channel;
- }
-
- public AMQChannel getChannel(int channelId) throws AMQException
- {
- final AMQChannel channel =
- ((channelId & CHANNEL_CACHE_SIZE) == channelId) ? _cachedChannels[channelId] : _channelMap.get(channelId);
- if ((channel == null) || channel.isClosing())
- {
- return null;
- }
- else
- {
- return channel;
- }
- }
-
- public boolean channelAwaitingClosure(int channelId)
- {
- return !_closingChannelsList.isEmpty() && _closingChannelsList.contains(channelId);
- }
-
- public void addChannel(AMQChannel channel) throws AMQException
- {
- if (_closed)
- {
- throw new AMQException("Session is closed");
- }
-
- final int channelId = channel.getChannelId();
-
- if (_closingChannelsList.contains(channelId))
- {
- throw new AMQException("Session is marked awaiting channel close");
- }
-
- if (_channelMap.size() == _maxNoOfChannels)
- {
- String errorMessage =
- toString() + ": maximum number of channels has been reached (" + _maxNoOfChannels
- + "); can't create channel";
- _logger.error(errorMessage);
- throw new AMQException(AMQConstant.NOT_ALLOWED, errorMessage);
- }
- else
- {
- _channelMap.put(channel.getChannelId(), channel);
- }
-
- if (((channelId & CHANNEL_CACHE_SIZE) == channelId))
- {
- _cachedChannels[channelId] = channel;
- }
-
- checkForNotification();
- }
-
- private void checkForNotification()
- {
- int channelsCount = _channelMap.size();
- if (channelsCount >= _maxNoOfChannels)
- {
- _managedObject.notifyClients("Channel count (" + channelsCount + ") has reached the threshold value");
- }
- }
-
- public Long getMaximumNumberOfChannels()
- {
- return _maxNoOfChannels;
- }
-
- public void setMaximumNumberOfChannels(Long value)
- {
- _maxNoOfChannels = value;
- }
-
- public void commitTransactions(AMQChannel channel) throws AMQException
- {
- if ((channel != null) && channel.isTransactional())
- {
- channel.commit();
- }
- }
-
- public void rollbackTransactions(AMQChannel channel) throws AMQException
- {
- if ((channel != null) && channel.isTransactional())
- {
- channel.rollback();
- }
- }
-
- /**
- * Close a specific channel. This will remove any resources used by the channel, including: <ul><li>any queue
- * subscriptions (this may in turn remove queues if they are auto delete</li> </ul>
- *
- * @param channelId id of the channel to close
- *
- * @throws AMQException if an error occurs closing the channel
- * @throws IllegalArgumentException if the channel id is not valid
- */
- public void closeChannel(int channelId) throws AMQException
- {
- final AMQChannel channel = getChannel(channelId);
- if (channel == null)
- {
- throw new IllegalArgumentException("Unknown channel id");
- }
- else
- {
- try
- {
- channel.close();
- markChannelAwaitingCloseOk(channelId);
- }
- finally
- {
- removeChannel(channelId);
- }
- }
- }
-
- public void closeChannelOk(int channelId)
- {
- // todo QPID-847 - This is called from two lcoations ChannelCloseHandler and ChannelCloseOkHandler.
- // When it is the CC_OK_Handler then it makes sence to remove the channel else we will leak memory.
- // We do it from the Close Handler as we are sending the OK back to the client.
- // While this is AMQP spec compliant. The Java client in the event of an IllegalArgumentException
- // will send a close-ok.. Where we should call removeChannel.
- // However, due to the poor exception handling on the client. The client-user will be notified of the
- // InvalidArgument and if they then decide to close the session/connection then the there will be time
- // for that to occur i.e. a new close method be sent before the exeption handling can mark the session closed.
- //removeChannel(channelId);
- _closingChannelsList.remove(new Integer(channelId));
- }
-
- private void markChannelAwaitingCloseOk(int channelId)
- {
- _closingChannelsList.add(channelId);
- }
-
- /**
- * In our current implementation this is used by the clustering code.
- *
- * @param channelId The channel to remove
- */
- public void removeChannel(int channelId)
- {
- _channelMap.remove(channelId);
- if ((channelId & CHANNEL_CACHE_SIZE) == channelId)
- {
- _cachedChannels[channelId] = null;
- }
- }
-
- /**
- * Initialise heartbeats on the session.
- *
- * @param delay delay in seconds (not ms)
- */
- public void initHeartbeats(int delay)
- {
- if (delay > 0)
- {
- _minaProtocolSession.setIdleTime(IdleStatus.WRITER_IDLE, delay);
- _minaProtocolSession.setIdleTime(IdleStatus.READER_IDLE, HeartbeatConfig.getInstance().getTimeout(delay));
- }
- }
-
- /**
- * Closes all channels that were opened by this protocol session. This frees up all resources used by the channel.
- *
- * @throws AMQException if an error occurs while closing any channel
- */
- private void closeAllChannels() throws AMQException
- {
- for (AMQChannel channel : _channelMap.values())
- {
- channel.close();
- }
-
- _channelMap.clear();
- for (int i = 0; i <= CHANNEL_CACHE_SIZE; i++)
- {
- _cachedChannels[i] = null;
- }
- }
-
- /** This must be called when the session is _closed in order to free up any resources managed by the session. */
- public void closeSession() throws AMQException
- {
- if (!_closed)
- {
- _closed = true;
-
- if (_virtualHost != null)
- {
- _virtualHost.getConnectionRegistry().deregisterConnection(this);
- }
-
- closeAllChannels();
- if (_managedObject != null)
- {
- _managedObject.unregister();
- }
-
- for (Task task : _taskList)
- {
- task.doTask(this);
- }
- }
- }
-
- public void closeConnection(int channelId, AMQConnectionException e, boolean closeProtocolSession) throws AMQException
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Closing connection due to: " + e.getMessage());
- }
-
- markChannelAwaitingCloseOk(channelId);
- closeSession();
- _stateManager.changeState(AMQState.CONNECTION_CLOSING);
- writeFrame(e.getCloseFrame(channelId));
-
- if (closeProtocolSession)
- {
- closeProtocolSession();
- }
- }
-
- public void closeProtocolSession()
- {
- closeProtocolSession(true);
- }
-
- public void closeProtocolSession(boolean waitLast)
- {
- if (waitLast && (_lastWriteFuture != null))
- {
- _logger.debug("Waiting for last write to join.");
- _lastWriteFuture.join(LAST_WRITE_FUTURE_JOIN_TIMEOUT);
- }
-
- _logger.debug("REALLY Closing protocol session:" + _minaProtocolSession);
- final CloseFuture future = _minaProtocolSession.close();
- future.join(LAST_WRITE_FUTURE_JOIN_TIMEOUT);
-
- try
- {
- _stateManager.changeState(AMQState.CONNECTION_CLOSED);
- }
- catch (AMQException e)
- {
- _logger.info(e.getMessage());
- }
- }
-
- public String toString()
- {
- return _minaProtocolSession.getRemoteAddress() + "(" + (getAuthorizedID() == null ? "?" : getAuthorizedID().getName() + ")");
- }
-
- public String dump()
- {
- return this + " last_sent=" + _lastSent + " last_received=" + _lastReceived;
- }
-
- /** @return an object that can be used to identity */
- public Object getKey()
- {
- return _minaProtocolSession.getRemoteAddress();
- }
-
- /**
- * Get the fully qualified domain name of the local address to which this session is bound. Since some servers may
- * be bound to multiple addresses this could vary depending on the acceptor this session was created from.
- *
- * @return a String FQDN
- */
- public String getLocalFQDN()
- {
- SocketAddress address = _minaProtocolSession.getLocalAddress();
- // we use the vmpipe address in some tests hence the need for this rather ugly test. The host
- // information is used by SASL primary.
- if (address instanceof InetSocketAddress)
- {
- return ((InetSocketAddress) address).getHostName();
- }
- else if (address instanceof VmPipeAddress)
- {
- return "vmpipe:" + ((VmPipeAddress) address).getPort();
- }
- else
- {
- throw new IllegalArgumentException("Unsupported socket address class: " + address);
- }
- }
-
- public SaslServer getSaslServer()
- {
- return _saslServer;
- }
-
- public void setSaslServer(SaslServer saslServer)
- {
- _saslServer = saslServer;
- }
-
- public FieldTable getClientProperties()
- {
- return _clientProperties;
- }
-
- public void setClientProperties(FieldTable clientProperties)
- {
- _clientProperties = clientProperties;
- if (_clientProperties != null)
- {
- if (_clientProperties.getString(CLIENT_PROPERTIES_INSTANCE) != null)
- {
- setContextKey(new AMQShortString(_clientProperties.getString(CLIENT_PROPERTIES_INSTANCE)));
- }
-
- if (_clientProperties.getString(ClientProperties.version.toString()) != null)
- {
- _clientVersion = new AMQShortString(_clientProperties.getString(ClientProperties.version.toString()));
- }
- }
- _sessionIdentifier = new ProtocolSessionIdentifier(this);
- }
-
- private void setProtocolVersion(ProtocolVersion pv)
- {
- _protocolVersion = pv;
-
- _protocolOutputConverter = ProtocolOutputConverterRegistry.getConverter(this);
- _dispatcher = ServerMethodDispatcherImpl.createMethodDispatcher(_stateManager, _protocolVersion);
- }
-
- public byte getProtocolMajorVersion()
- {
- return _protocolVersion.getMajorVersion();
- }
-
- public ProtocolVersion getProtocolVersion()
- {
- return _protocolVersion;
- }
-
- public byte getProtocolMinorVersion()
- {
- return _protocolVersion.getMinorVersion();
- }
-
- public boolean isProtocolVersion(byte major, byte minor)
- {
- return (getProtocolMajorVersion() == major) && (getProtocolMinorVersion() == minor);
- }
-
- public MethodRegistry getRegistry()
- {
- return getMethodRegistry();
- }
-
- public Object getClientIdentifier()
- {
- return (_minaProtocolSession != null) ? _minaProtocolSession.getRemoteAddress() : null;
- }
-
- public VirtualHost getVirtualHost()
- {
- return _virtualHost;
- }
-
- public void setVirtualHost(VirtualHost virtualHost) throws AMQException
- {
- _virtualHost = virtualHost;
-
- _virtualHost.getConnectionRegistry().registerConnection(this);
-
- _managedObject = createMBean();
- _managedObject.register();
- }
-
- public void addSessionCloseTask(Task task)
- {
- _taskList.add(task);
- }
-
- public void removeSessionCloseTask(Task task)
- {
- _taskList.remove(task);
- }
-
- public ProtocolOutputConverter getProtocolOutputConverter()
- {
- return _protocolOutputConverter;
- }
-
- public void setAuthorizedID(Principal authorizedID)
- {
- _authorizedID = authorizedID;
- }
-
- public Principal getAuthorizedID()
- {
- return _authorizedID;
- }
-
- public MethodRegistry getMethodRegistry()
- {
- return MethodRegistry.getMethodRegistry(getProtocolVersion());
- }
-
- public MethodDispatcher getMethodDispatcher()
- {
- return _dispatcher;
- }
-
- public ProtocolSessionIdentifier getSessionIdentifier()
- {
- return _sessionIdentifier;
- }
-
- public String getClientVersion()
- {
- return (_clientVersion == null) ? null : _clientVersion.toString();
- }
-
- public void setSender(Sender<java.nio.ByteBuffer> sender)
- {
- // No-op, interface munging between this and AMQProtocolSession
- }
-
- public void init()
- {
- // No-op, interface munging between this and AMQProtocolSession
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java
deleted file mode 100644
index a7599a3e0d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-/**
- * AMQNoMethodHandlerException represents the case where no method handler exists to handle an AQMP method.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents failure to handle an AMQP method.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- *
- * @todo Missing method handler. Unlikely to ever happen, and if it does its a coding error. Consider replacing with a
- * Runtime.
- */
-public class AMQNoMethodHandlerException extends AMQException
-{
- public AMQNoMethodHandlerException(AMQMethodEvent<AMQMethodBody> evt)
- {
- super("AMQMethodEvent " + evt + " was not processed by any listener on Broker.");
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java
deleted file mode 100644
index d8dbf97e49..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import org.apache.log4j.Logger;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.filter.ReadThrottleFilterBuilder;
-import org.apache.mina.filter.SSLFilter;
-import org.apache.mina.filter.WriteBufferLimitFilterBuilder;
-import org.apache.mina.filter.codec.QpidProtocolCodecFilter;
-import org.apache.mina.filter.executor.ExecutorFilter;
-import org.apache.mina.util.SessionUtil;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.transport.ConnectorConfiguration;
-import org.apache.qpid.ssl.SSLContextFactory;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-
-/**
- * The protocol handler handles "protocol events" for all connections. The state
- * associated with an individual connection is accessed through the protocol session.
- *
- * We delegate all frame (message) processing to the AMQProtocolSession which wraps
- * the state for the connection.
- */
-public class AMQPFastProtocolHandler extends IoHandlerAdapter
-{
- private static final Logger _logger = Logger.getLogger(AMQPFastProtocolHandler.class);
-
- private final IApplicationRegistry _applicationRegistry;
-
- private static String DEFAULT_BUFFER_READ_LIMIT_SIZE = "262144";
- private static String DEFAULT_BUFFER_WRITE_LIMIT_SIZE = "262144";
-
- private final int BUFFER_READ_LIMIT_SIZE;
- private final int BUFFER_WRITE_LIMIT_SIZE;
-
- public AMQPFastProtocolHandler(Integer applicationRegistryInstance)
- {
- this(ApplicationRegistry.getInstance(applicationRegistryInstance));
- }
-
- public AMQPFastProtocolHandler(IApplicationRegistry applicationRegistry)
- {
- _applicationRegistry = applicationRegistry;
-
- // Read the configuration from the application registry
- BUFFER_READ_LIMIT_SIZE = Integer.parseInt(_applicationRegistry.getConfiguration().getString("broker.connector.protectio.readBufferLimitSize", DEFAULT_BUFFER_READ_LIMIT_SIZE));
- BUFFER_WRITE_LIMIT_SIZE = Integer.parseInt(_applicationRegistry.getConfiguration().getString("broker.connector.protectio.writeBufferLimitSize", DEFAULT_BUFFER_WRITE_LIMIT_SIZE));
-
- _logger.debug("AMQPFastProtocolHandler created");
- }
-
- protected AMQPFastProtocolHandler(AMQPFastProtocolHandler handler)
- {
- this(handler._applicationRegistry);
- }
-
- public void sessionCreated(IoSession protocolSession) throws Exception
- {
- SessionUtil.initialize(protocolSession);
- final AMQCodecFactory codecFactory = new AMQCodecFactory(true);
-
- createSession(protocolSession, _applicationRegistry, codecFactory);
- _logger.info("Protocol session created for:" + protocolSession.getRemoteAddress());
-
- final QpidProtocolCodecFilter pcf = new QpidProtocolCodecFilter(codecFactory);
-
- ConnectorConfiguration connectorConfig = ApplicationRegistry.getInstance().
- getConfiguredObject(ConnectorConfiguration.class);
- if (connectorConfig.enableExecutorPool)
- {
- if (connectorConfig.enableSSL && isSSLClient(connectorConfig, protocolSession))
- {
- String keystorePath = connectorConfig.keystorePath;
- String keystorePassword = connectorConfig.keystorePassword;
- String certType = connectorConfig.certType;
- SSLContextFactory sslContextFactory = new SSLContextFactory(keystorePath, keystorePassword, certType);
- protocolSession.getFilterChain().addAfter("AsynchronousReadFilter", "sslFilter",
- new SSLFilter(sslContextFactory.buildServerContext()));
- }
- protocolSession.getFilterChain().addBefore("AsynchronousWriteFilter", "protocolFilter", pcf);
- }
- else
- {
- protocolSession.getFilterChain().addLast("protocolFilter", pcf);
- if (connectorConfig.enableSSL && isSSLClient(connectorConfig, protocolSession))
- {
- String keystorePath = connectorConfig.keystorePath;
- String keystorePassword = connectorConfig.keystorePassword;
- String certType = connectorConfig.certType;
- SSLContextFactory sslContextFactory = new SSLContextFactory(keystorePath, keystorePassword, certType);
- protocolSession.getFilterChain().addBefore("protocolFilter", "sslFilter",
- new SSLFilter(sslContextFactory.buildServerContext()));
- }
-
- }
-
- if (ApplicationRegistry.getInstance().getConfiguration().getBoolean("broker.connector.protectio.enabled", false))
- {
- try
- {
-// //Add IO Protection Filters
- IoFilterChain chain = protocolSession.getFilterChain();
-
-
- protocolSession.getFilterChain().addLast("tempExecutorFilterForFilterBuilder", new ExecutorFilter());
-
- ReadThrottleFilterBuilder readfilter = new ReadThrottleFilterBuilder();
- readfilter.setMaximumConnectionBufferSize(BUFFER_READ_LIMIT_SIZE);
- readfilter.attach(chain);
-
- WriteBufferLimitFilterBuilder writefilter = new WriteBufferLimitFilterBuilder();
- writefilter.setMaximumConnectionBufferSize(BUFFER_WRITE_LIMIT_SIZE);
- writefilter.attach(chain);
-
- protocolSession.getFilterChain().remove("tempExecutorFilterForFilterBuilder");
- _logger.info("Using IO Read/Write Filter Protection");
- }
- catch (Exception e)
- {
- _logger.error("Unable to attach IO Read/Write Filter Protection :" + e.getMessage());
- }
- }
- }
-
- /** Separated into its own, protected, method to allow easier reuse */
- protected void createSession(IoSession session, IApplicationRegistry applicationRegistry, AMQCodecFactory codec) throws AMQException
- {
- new AMQMinaProtocolSession(session, applicationRegistry.getVirtualHostRegistry(), codec);
- }
-
- public void sessionOpened(IoSession protocolSession) throws Exception
- {
- _logger.info("Session opened for:" + protocolSession.getRemoteAddress());
- }
-
- public void sessionClosed(IoSession protocolSession) throws Exception
- {
- _logger.info("Protocol Session closed for:" + protocolSession.getRemoteAddress());
- final AMQProtocolSession amqProtocolSession = AMQMinaProtocolSession.getAMQProtocolSession(protocolSession);
- //fixme -- this can be null
- if (amqProtocolSession != null)
- {
- try
- {
- amqProtocolSession.closeSession();
- }
- catch (AMQException e)
- {
- _logger.error("Caught AMQException whilst closingSession:" + e);
- }
- }
- }
-
- public void sessionIdle(IoSession session, IdleStatus status) throws Exception
- {
- _logger.debug("Protocol Session [" + this + "] idle: " + status + " :for:" + session.getRemoteAddress());
- if (IdleStatus.WRITER_IDLE.equals(status))
- {
- //write heartbeat frame:
- session.write(HeartbeatBody.FRAME);
- }
- else if (IdleStatus.READER_IDLE.equals(status))
- {
- //failover:
- throw new IOException("Timed out while waiting for heartbeat from peer.");
- }
-
- }
-
- public void exceptionCaught(IoSession protocolSession, Throwable throwable) throws Exception
- {
- AMQProtocolSession session = AMQMinaProtocolSession.getAMQProtocolSession(protocolSession);
- if (throwable instanceof AMQProtocolHeaderException)
- {
-
- protocolSession.write(new ProtocolInitiation(ProtocolVersion.getLatestSupportedVersion()));
-
- protocolSession.close();
-
- _logger.error("Error in protocol initiation " + session + ":" + protocolSession.getRemoteAddress() + " :" + throwable.getMessage(), throwable);
- }
- else if (throwable instanceof IOException)
- {
- _logger.error("IOException caught in" + session + ", session closed implictly: " + throwable);
- }
- else
- {
- _logger.error("Exception caught in" + session + ", closing session explictly: " + throwable, throwable);
-
-
- MethodRegistry methodRegistry = MethodRegistry.getMethodRegistry(session.getProtocolVersion());
- ConnectionCloseBody closeBody = methodRegistry.createConnectionCloseBody(200,new AMQShortString(throwable.getMessage()),0,0);
-
- protocolSession.write(closeBody.generateFrame(0));
-
- protocolSession.close();
- }
- }
-
- /**
- * Invoked when a message is received on a particular protocol session. Note that a
- * protocol session is directly tied to a particular physical connection.
- *
- * @param protocolSession the protocol session that received the message
- * @param message the message itself (i.e. a decoded frame)
- *
- * @throws Exception if the message cannot be processed
- */
- public void messageReceived(IoSession protocolSession, Object message) throws Exception
- {
- final AMQProtocolSession amqProtocolSession = AMQMinaProtocolSession.getAMQProtocolSession(protocolSession);
-
- if (message instanceof AMQDataBlock)
- {
- amqProtocolSession.dataBlockReceived((AMQDataBlock) message);
-
- }
- else if (message instanceof ByteBuffer)
- {
- throw new IllegalStateException("Handed undecoded ByteBuffer buf = " + message);
- }
- else
- {
- throw new IllegalStateException("Handed unhandled message. message.class = " + message.getClass() + " message = " + message);
- }
- }
-
- /**
- * Called after a message has been sent out on a particular protocol session
- *
- * @param protocolSession the protocol session (i.e. connection) on which this
- * message was sent
- * @param object the message (frame) that was encoded and sent
- *
- * @throws Exception if we want to indicate an error
- */
- public void messageSent(IoSession protocolSession, Object object) throws Exception
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Message sent: " + object);
- }
- }
-
- protected boolean isSSLClient(ConnectorConfiguration connectionConfig,
- IoSession protocolSession)
- {
- InetSocketAddress addr = (InetSocketAddress) protocolSession.getLocalAddress();
- return addr.getPort() == connectionConfig.sslPort;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPProtocolProvider.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPProtocolProvider.java
deleted file mode 100644
index 07c153bfe8..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPProtocolProvider.java
+++ /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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-
-/**
- * The protocol provide's role is to encapsulate the initialisation of the protocol handler.
- *
- * The protocol handler (see AMQPFastProtocolHandler class) handles protocol events
- * such as connection closing or a frame being received. It can either do this directly
- * or pass off to the protocol session in the cases where state information is required to
- * deal with the event.
- *
- */
-public class AMQPProtocolProvider
-{
- /**
- * Handler for protocol events
- */
- private AMQPFastProtocolHandler _handler;
-
- public AMQPProtocolProvider()
- {
- IApplicationRegistry registry = ApplicationRegistry.getInstance();
- _handler = new AMQPFastProtocolHandler(registry);
- }
-
- public AMQPFastProtocolHandler getHandler()
- {
- return _handler;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java
deleted file mode 100644
index 1bac601225..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java
+++ /dev/null
@@ -1,207 +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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import javax.security.sasl.SaslServer;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.common.ClientProperties;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.output.ProtocolOutputConverter;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.security.Principal;
-
-
-public interface AMQProtocolSession extends AMQVersionAwareProtocolSession
-{
-
- public static final class ProtocolSessionIdentifier
- {
- private final Object _sessionIdentifier;
- private final Object _sessionInstance;
-
- ProtocolSessionIdentifier(AMQProtocolSession session)
- {
- _sessionIdentifier = session.getClientIdentifier();
- _sessionInstance = session.getClientProperties() == null ? null : session.getClientProperties().getObject(ClientProperties.instance.toAMQShortString());
- }
-
- public Object getSessionIdentifier()
- {
- return _sessionIdentifier;
- }
-
- public Object getSessionInstance()
- {
- return _sessionInstance;
- }
- }
-
- public static interface Task
- {
- public void doTask(AMQProtocolSession session) throws AMQException;
- }
-
- /**
- * Called when a protocol data block is received
- *
- * @param message the data block that has been received
- *
- * @throws Exception if processing the datablock fails
- */
- void dataBlockReceived(AMQDataBlock message) throws Exception;
-
- /**
- * Get the context key associated with this session. Context key is described in the AMQ protocol specification (RFC
- * 6).
- *
- * @return the context key
- */
- AMQShortString getContextKey();
-
- /**
- * Set the context key associated with this session. Context key is described in the AMQ protocol specification (RFC
- * 6).
- *
- * @param contextKey the context key
- */
- void setContextKey(AMQShortString contextKey);
-
- /**
- * Get the channel for this session associated with the specified id. A channel id is unique per connection (i.e.
- * per session).
- *
- * @param channelId the channel id which must be valid
- *
- * @return null if no channel exists, the channel otherwise
- */
- AMQChannel getChannel(int channelId) throws AMQException;
-
- /**
- * Associate a channel with this session.
- *
- * @param channel the channel to associate with this session. It is an error to associate the same channel with more
- * than one session but this is not validated.
- */
- void addChannel(AMQChannel channel) throws AMQException;
-
- /**
- * Close a specific channel. This will remove any resources used by the channel, including: <ul><li>any queue
- * subscriptions (this may in turn remove queues if they are auto delete</li> </ul>
- *
- * @param channelId id of the channel to close
- *
- * @throws org.apache.qpid.AMQException if an error occurs closing the channel
- * @throws IllegalArgumentException if the channel id is not valid
- */
- void closeChannel(int channelId) throws AMQException;
-
- /**
- * Markes the specific channel as closed. This will release the lock for that channel id so a new channel can be
- * created on that id.
- *
- * @param channelId id of the channel to close
- */
- void closeChannelOk(int channelId);
-
- /**
- * Check to see if this chanel is closing
- *
- * @param channelId id to check
- * @return boolean with state of channel awaiting closure
- */
- boolean channelAwaitingClosure(int channelId);
-
- /**
- * Remove a channel from the session but do not close it.
- *
- * @param channelId
- */
- void removeChannel(int channelId);
-
- /**
- * Initialise heartbeats on the session.
- *
- * @param delay delay in seconds (not ms)
- */
- void initHeartbeats(int delay);
-
- /** This must be called when the session is _closed in order to free up any resources managed by the session. */
- void closeSession() throws AMQException;
-
- /** This must be called to close the session in order to free up any resources managed by the session. */
- void closeConnection(int channelId, AMQConnectionException e, boolean closeProtocolSession) throws AMQException;
-
-
- /** @return a key that uniquely identifies this session */
- Object getKey();
-
- /**
- * Get the fully qualified domain name of the local address to which this session is bound. Since some servers may
- * be bound to multiple addresses this could vary depending on the acceptor this session was created from.
- *
- * @return a String FQDN
- */
- String getLocalFQDN();
-
- /** @return the sasl server that can perform authentication for this session. */
- SaslServer getSaslServer();
-
- /**
- * Set the sasl server that is to perform authentication for this session.
- *
- * @param saslServer
- */
- void setSaslServer(SaslServer saslServer);
-
-
- FieldTable getClientProperties();
-
- void setClientProperties(FieldTable clientProperties);
-
- Object getClientIdentifier();
-
- VirtualHost getVirtualHost();
-
- void setVirtualHost(VirtualHost virtualHost) throws AMQException;
-
- void addSessionCloseTask(Task task);
-
- void removeSessionCloseTask(Task task);
-
- public ProtocolOutputConverter getProtocolOutputConverter();
-
- void setAuthorizedID(Principal authorizedID);
-
- /** @return a Principal that was used to authorized this session */
- Principal getAuthorizedID();
-
- public MethodRegistry getMethodRegistry();
-
- public MethodDispatcher getMethodDispatcher();
-
- public ProtocolSessionIdentifier getSessionIdentifier();
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
deleted file mode 100644
index bd072985c4..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
+++ /dev/null
@@ -1,306 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import java.security.Principal;
-import java.util.Date;
-import java.util.List;
-
-import javax.management.JMException;
-import javax.management.MBeanException;
-import javax.management.MBeanNotificationInfo;
-import javax.management.NotCompliantMBeanException;
-import javax.management.Notification;
-import javax.management.monitor.MonitorNotification;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.SimpleType;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularDataSupport;
-import javax.management.openmbean.TabularType;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ConnectionCloseBody;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.management.AMQManagedObject;
-import org.apache.qpid.server.management.MBeanConstructor;
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.management.ManagedObject;
-
-/**
- * This MBean class implements the management interface. In order to make more attributes, operations and notifications
- * available over JMX simply augment the ManagedConnection interface and add the appropriate implementation here.
- */
-@MBeanDescription("Management Bean for an AMQ Broker Connection")
-public class AMQProtocolSessionMBean extends AMQManagedObject implements ManagedConnection
-{
- private AMQMinaProtocolSession _session = null;
- private String _name = null;
-
- // openmbean data types for representing the channel attributes
- private static final String[] _channelAtttibuteNames =
- { "Channel Id", "Transactional", "Default Queue", "Unacknowledged Message Count" };
- private static final String[] _indexNames = { _channelAtttibuteNames[0] };
- private static final OpenType[] _channelAttributeTypes =
- { SimpleType.INTEGER, SimpleType.BOOLEAN, SimpleType.STRING, SimpleType.INTEGER };
- private static CompositeType _channelType = null; // represents the data type for channel data
- private static TabularType _channelsType = null; // Data type for list of channels type
- private static final AMQShortString BROKER_MANAGEMENT_CONSOLE_HAS_CLOSED_THE_CONNECTION =
- new AMQShortString("Broker Management Console has closed the connection.");
-
- @MBeanConstructor("Creates an MBean exposing an AMQ Broker Connection")
- public AMQProtocolSessionMBean(AMQMinaProtocolSession session) throws NotCompliantMBeanException, OpenDataException
- {
- super(ManagedConnection.class, ManagedConnection.TYPE);
- _session = session;
- String remote = getRemoteAddress();
- remote = "anonymous".equals(remote) ? (remote + hashCode()) : remote;
- _name = jmxEncode(new StringBuffer(remote), 0).toString();
- init();
- }
-
- static
- {
- try
- {
- init();
- }
- catch (JMException ex)
- {
- // This is not expected to ever occur.
- throw new RuntimeException("Got JMException in static initializer.", ex);
- }
- }
-
- /**
- * initialises the openmbean data types
- */
- private static void init() throws OpenDataException
- {
- _channelType =
- new CompositeType("Channel", "Channel Details", _channelAtttibuteNames, _channelAtttibuteNames,
- _channelAttributeTypes);
- _channelsType = new TabularType("Channels", "Channels", _channelType, _indexNames);
- }
-
- public String getClientId()
- {
- return (_session.getContextKey() == null) ? null : _session.getContextKey().toString();
- }
-
- public String getAuthorizedId()
- {
- return (_session.getAuthorizedID() != null ) ? _session.getAuthorizedID().getName() : null;
- }
-
- public String getVersion()
- {
- return (_session.getClientVersion() == null) ? null : _session.getClientVersion().toString();
- }
-
- public Date getLastIoTime()
- {
- return new Date(_session.getIOSession().getLastIoTime());
- }
-
- public String getRemoteAddress()
- {
- return _session.getIOSession().getRemoteAddress().toString();
- }
-
- public ManagedObject getParentObject()
- {
- return _session.getVirtualHost().getManagedObject();
- }
-
- public Long getWrittenBytes()
- {
- return _session.getIOSession().getWrittenBytes();
- }
-
- public Long getReadBytes()
- {
- return _session.getIOSession().getReadBytes();
- }
-
- public Long getMaximumNumberOfChannels()
- {
- return _session.getMaximumNumberOfChannels();
- }
-
- public void setMaximumNumberOfChannels(Long value)
- {
- _session.setMaximumNumberOfChannels(value);
- }
-
- public String getObjectInstanceName()
- {
- return _name;
- }
-
- /**
- * commits transactions for a transactional channel
- *
- * @param channelId
- * @throws JMException if channel with given id doesn't exist or if commit fails
- */
- public void commitTransactions(int channelId) throws JMException
- {
- try
- {
- AMQChannel channel = _session.getChannel(channelId);
- if (channel == null)
- {
- throw new JMException("The channel (channel Id = " + channelId + ") does not exist");
- }
-
- _session.commitTransactions(channel);
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex, ex.toString());
- }
- }
-
- /**
- * rollsback the transactions for a transactional channel
- *
- * @param channelId
- * @throws JMException if channel with given id doesn't exist or if rollback fails
- */
- public void rollbackTransactions(int channelId) throws JMException
- {
- try
- {
- AMQChannel channel = _session.getChannel(channelId);
- if (channel == null)
- {
- throw new JMException("The channel (channel Id = " + channelId + ") does not exist");
- }
-
- _session.rollbackTransactions(channel);
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex, ex.toString());
- }
- }
-
- /**
- * Creates the list of channels in tabular form from the _channelMap.
- *
- * @return list of channels in tabular form.
- * @throws OpenDataException
- */
- public TabularData channels() throws OpenDataException
- {
- TabularDataSupport channelsList = new TabularDataSupport(_channelsType);
- List<AMQChannel> list = _session.getChannels();
-
- for (AMQChannel channel : list)
- {
- Object[] itemValues =
- {
- channel.getChannelId(), channel.isTransactional(),
- (channel.getDefaultQueue() != null) ? channel.getDefaultQueue().getName().asString() : null,
- channel.getUnacknowledgedMessageMap().size()
- };
-
- CompositeData channelData = new CompositeDataSupport(_channelType, _channelAtttibuteNames, itemValues);
- channelsList.put(channelData);
- }
-
- return channelsList;
- }
-
- /**
- * closes the connection. The administrator can use this management operation to close connection to free up
- * resources.
- * @throws JMException
- */
- public void closeConnection() throws JMException
- {
-
- MethodRegistry methodRegistry = _session.getMethodRegistry();
- ConnectionCloseBody responseBody =
- methodRegistry.createConnectionCloseBody(AMQConstant.REPLY_SUCCESS.getCode(),
- // replyCode
- BROKER_MANAGEMENT_CONSOLE_HAS_CLOSED_THE_CONNECTION,
- // replyText,
- 0,
- 0);
-
- _session.writeFrame(responseBody.generateFrame(0));
-
- try
- {
- _session.closeSession();
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex, ex.toString());
- }
- }
-
- @Override
- public MBeanNotificationInfo[] getNotificationInfo()
- {
- String[] notificationTypes = new String[] { MonitorNotification.THRESHOLD_VALUE_EXCEEDED };
- String name = MonitorNotification.class.getName();
- String description = "Channel count has reached threshold value";
- MBeanNotificationInfo info1 = new MBeanNotificationInfo(notificationTypes, name, description);
-
- return new MBeanNotificationInfo[] { info1 };
- }
-
- public void notifyClients(String notificationMsg)
- {
- Notification n =
- new Notification(MonitorNotification.THRESHOLD_VALUE_EXCEEDED, this, ++_notificationSequenceNumber,
- System.currentTimeMillis(), notificationMsg);
- _broadcaster.sendNotification(n);
- }
-
-} // End of MBean class
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java
deleted file mode 100644
index 2abcecb6de..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.exchange.ExchangeFactory;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.exchange.ExchangeType;
-
-public class ExchangeInitialiser
-{
- public void initialise(ExchangeFactory factory, ExchangeRegistry registry) throws AMQException{
- for (ExchangeType<? extends Exchange> type : factory.getRegisteredTypes())
- {
- define (registry, factory, type.getDefaultExchangeName(), type.getName());
- }
-
- define(registry, factory, ExchangeDefaults.DEFAULT_EXCHANGE_NAME, ExchangeDefaults.DIRECT_EXCHANGE_CLASS);
- registry.setDefaultExchange(registry.getExchange(ExchangeDefaults.DEFAULT_EXCHANGE_NAME));
- }
-
- private void define(ExchangeRegistry r, ExchangeFactory f,
- AMQShortString name, AMQShortString type) throws AMQException
- {
- if(r.getExchange(name)== null)
- {
- r.registerExchange(f.createExchange(name, type, true, false, 0));
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/HeartbeatConfig.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/HeartbeatConfig.java
deleted file mode 100644
index 310deaaf55..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/HeartbeatConfig.java
+++ /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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import org.apache.qpid.configuration.Configured;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-
-public class HeartbeatConfig
-{
- @Configured(path = "heartbeat.delay", defaultValue = "5")
- public int delay = 5;//in secs
- @Configured(path = "heartbeat.timeoutFactor", defaultValue = "2.0")
- public double timeoutFactor = 2;
-
- public double getTimeoutFactor()
- {
- return timeoutFactor;
- }
-
- public void setTimeoutFactor(double timeoutFactor)
- {
- this.timeoutFactor = timeoutFactor;
- }
-
- public int getDelay()
- {
- return delay;
- }
-
- public void setDelay(int delay)
- {
- this.delay = delay;
- }
-
- int getTimeout(int writeDelay)
- {
- return (int) (timeoutFactor * writeDelay);
- }
-
- public static HeartbeatConfig getInstance()
- {
- return ApplicationRegistry.getInstance().getConfiguredObject(HeartbeatConfig.class);
- }
-
- public String toString()
- {
- return "HeartBeatConfig{delay = " + delay + " timeoutFactor = " + timeoutFactor + "}";
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java
deleted file mode 100644
index e6e713ac6d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java
+++ /dev/null
@@ -1,135 +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.
- *
- */
-
-package org.apache.qpid.server.protocol;
-
-import java.io.IOException;
-import java.util.Date;
-import java.security.Principal;
-
-import javax.management.JMException;
-import javax.management.MBeanOperationInfo;
-import javax.management.openmbean.TabularData;
-
-import org.apache.qpid.server.management.MBeanAttribute;
-import org.apache.qpid.server.management.MBeanOperation;
-import org.apache.qpid.server.management.MBeanOperationParameter;
-
-/**
- * The management interface exposed to allow management of Connections.
- * @author Bhupendra Bhardwaj
- * @version 0.1
- */
-public interface ManagedConnection
-{
- static final String TYPE = "Connection";
-
- @MBeanAttribute(name = "ClientId", description = "Client Id")
- String getClientId();
-
- @MBeanAttribute(name = "AuthorizedId", description = "User Name")
- String getAuthorizedId();
-
- @MBeanAttribute(name = "Version", description = "Client Version")
- String getVersion();
-
- /**
- * Tells the remote address of this connection.
- * @return remote address
- */
- @MBeanAttribute(name="RemoteAddress", description=TYPE + " Address")
- String getRemoteAddress();
-
- /**
- * Tells the last time, the IO operation was done.
- * @return last IO time.
- */
- @MBeanAttribute(name="LastIOTime", description="The last time, the IO operation was done")
- Date getLastIoTime();
-
- /**
- * Tells the total number of bytes written till now.
- * @return number of bytes written.
- *
- @MBeanAttribute(name="WrittenBytes", description="The total number of bytes written till now")
- Long getWrittenBytes();
- */
- /**
- * Tells the total number of bytes read till now.
- * @return number of bytes read.
- *
- @MBeanAttribute(name="ReadBytes", description="The total number of bytes read till now")
- Long getReadBytes();
- */
-
- /**
- * Threshold high value for no of channels. This is useful in setting notifications or
- * taking required action is there are more channels being created.
- * @return threshold limit for no of channels
- */
- Long getMaximumNumberOfChannels();
-
- /**
- * Sets the threshold high value for number of channels for a connection
- * @param value
- */
- @MBeanAttribute(name="MaximumNumberOfChannels", description="The threshold high value for number of channels for this connection")
- void setMaximumNumberOfChannels(Long value);
-
- //********** Operations *****************//
-
- /**
- * channel details of all the channels opened for this connection.
- * @return general channel details
- * @throws IOException
- * @throws JMException
- */
- @MBeanOperation(name="channels", description="Channel details for this connection")
- TabularData channels() throws IOException, JMException;
-
- /**
- * Commits the transactions if the channel is transactional.
- * @param channelId
- * @throws JMException
- */
- @MBeanOperation(name="commitTransaction",
- description="Commits the transactions for given channel Id, if the channel is transactional",
- impact= MBeanOperationInfo.ACTION)
- void commitTransactions(@MBeanOperationParameter(name="channel Id", description="channel Id")int channelId) throws JMException;
-
- /**
- * Rollsback the transactions if the channel is transactional.
- * @param channelId
- * @throws JMException
- */
- @MBeanOperation(name="rollbackTransactions",
- description="Rollsback the transactions for given channel Id, if the channel is transactional",
- impact= MBeanOperationInfo.ACTION)
- void rollbackTransactions(@MBeanOperationParameter(name="channel Id", description="channel Id")int channelId) throws JMException;
-
- /**
- * Closes all the related channels and unregisters this connection from managed objects.
- */
- @MBeanOperation(name="closeConnection",
- description="Closes this connection and all related channels",
- impact= MBeanOperationInfo.ACTION)
- void closeConnection() throws Exception;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java
deleted file mode 100644
index 6e72aa062f..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQDataBlock;
-
-/**
- * UnknnownMessageTypeException represents a failure when Mina passes an unexpected frame type.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents failure to cast a frame to its expected type.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- *
- * @todo Seems like this exception was created to handle an unsafe type cast that will never happen in practice. Would
- * be better just to leave that as a ClassCastException. However, check the framing layer catches this error
- * first.
- */
-public class UnknnownMessageTypeException extends AMQException
-{
- public UnknnownMessageTypeException(AMQDataBlock message)
- {
- super("Unknown message type: " + message.getClass().getName() + ": " + message);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
deleted file mode 100644
index a485649410..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
+++ /dev/null
@@ -1,482 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQBody;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.txn.TransactionalContext;
-
-
-import java.util.Iterator;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * A deliverable message.
- */
-public class AMQMessage implements Filterable<AMQException>
-{
- /** Used for debugging purposes. */
- private static final Logger _log = Logger.getLogger(AMQMessage.class);
-
- private final AtomicInteger _referenceCount = new AtomicInteger(1);
-
- private final AMQMessageHandle _messageHandle;
-
- /** Holds the transactional context in which this message is being processed. */
- private StoreContext _storeContext;
-
- /** Flag to indicate that this message requires 'immediate' delivery. */
-
- private static final byte IMMEDIATE = 0x01;
-
- /**
- * Flag to indicate whether this message has been delivered to a consumer. Used in implementing return functionality
- * for messages published with the 'immediate' flag.
- */
-
- private static final byte DELIVERED_TO_CONSUMER = 0x02;
-
- private byte _flags = 0;
-
- private long _expiration;
-
- private final long _size;
-
- private AMQProtocolSession.ProtocolSessionIdentifier _sessionIdentifier;
- private static final byte IMMEDIATE_AND_DELIVERED = (byte) (IMMEDIATE | DELIVERED_TO_CONSUMER);
-
-
-
- /**
- * Used to iterate through all the body frames associated with this message. Will not keep all the data in memory
- * therefore is memory-efficient.
- */
- private class BodyFrameIterator implements Iterator<AMQDataBlock>
- {
- private int _channel;
-
- private int _index = -1;
- private AMQProtocolSession _protocolSession;
-
- private BodyFrameIterator(AMQProtocolSession protocolSession, int channel)
- {
- _channel = channel;
- _protocolSession = protocolSession;
- }
-
- public boolean hasNext()
- {
- try
- {
- return _index < (_messageHandle.getBodyCount(getStoreContext()) - 1);
- }
- catch (AMQException e)
- {
- _log.error("Unable to get body count: " + e, e);
-
- return false;
- }
- }
-
- public AMQDataBlock next()
- {
- try
- {
-
- AMQBody cb =
- getProtocolVersionMethodConverter().convertToBody(_messageHandle.getContentChunk(getStoreContext(),
- ++_index));
-
- return new AMQFrame(_channel, cb);
- }
- catch (AMQException e)
- {
- // have no choice but to throw a runtime exception
- throw new RuntimeException("Error getting content body: " + e, e);
- }
-
- }
-
- private ProtocolVersionMethodConverter getProtocolVersionMethodConverter()
- {
- return _protocolSession.getMethodRegistry().getProtocolVersionMethodConverter();
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- }
-
- public void clearStoreContext()
- {
- _storeContext = new StoreContext();
- }
-
- public StoreContext getStoreContext()
- {
- return _storeContext;
- }
-
- private class BodyContentIterator implements Iterator<ContentChunk>
- {
-
- private int _index = -1;
-
- public boolean hasNext()
- {
- try
- {
- return _index < (_messageHandle.getBodyCount(getStoreContext()) - 1);
- }
- catch (AMQException e)
- {
- _log.error("Error getting body count: " + e, e);
-
- return false;
- }
- }
-
- public ContentChunk next()
- {
- try
- {
- return _messageHandle.getContentChunk(getStoreContext(), ++_index);
- }
- catch (AMQException e)
- {
- throw new RuntimeException("Error getting content body: " + e, e);
- }
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- }
-
-
-
- /**
- * Used when recovering, i.e. when the message store is creating references to messages. In that case, the normal
- * enqueue/routingComplete is not done since the recovery process is responsible for routing the messages to
- * queues.
- *
- * @param messageId
- * @param store
- * @param factory
- *
- * @throws AMQException
- */
- public AMQMessage(Long messageId, MessageStore store, MessageHandleFactory factory, TransactionalContext txnConext)
- throws AMQException
- {
- _messageHandle = factory.createMessageHandle(messageId, store, true);
- _storeContext = txnConext.getStoreContext();
- _size = _messageHandle.getBodySize(txnConext.getStoreContext());
- }
-
- /**
- * Used when recovering, i.e. when the message store is creating references to messages. In that case, the normal
- * enqueue/routingComplete is not done since the recovery process is responsible for routing the messages to
- * queues.
- *
- * @param messageHandle
- *
- * @throws AMQException
- */
- public AMQMessage(
- AMQMessageHandle messageHandle,
- StoreContext storeConext,
- MessagePublishInfo info)
- throws AMQException
- {
- _messageHandle = messageHandle;
- _storeContext = storeConext;
-
- if(info.isImmediate())
- {
- _flags |= IMMEDIATE;
- }
- _size = messageHandle.getBodySize(storeConext);
-
- }
-
-
- protected AMQMessage(AMQMessage msg) throws AMQException
- {
- _messageHandle = msg._messageHandle;
- _storeContext = msg._storeContext;
- _flags = msg._flags;
- _size = msg._size;
-
- }
-
-
- public String debugIdentity()
- {
- return "(HC:" + System.identityHashCode(this) + " ID:" + getMessageId() + " Ref:" + _referenceCount.get() + ")";
- }
-
- public void setExpiration(final long expiration)
- {
-
- _expiration = expiration;
-
- }
-
- public boolean isReferenced()
- {
- return _referenceCount.get() > 0;
- }
-
- public Iterator<AMQDataBlock> getBodyFrameIterator(AMQProtocolSession protocolSession, int channel)
- {
- return new BodyFrameIterator(protocolSession, channel);
- }
-
- public Iterator<ContentChunk> getContentBodyIterator()
- {
- return new BodyContentIterator();
- }
-
- public ContentHeaderBody getContentHeaderBody() throws AMQException
- {
- return _messageHandle.getContentHeaderBody(getStoreContext());
- }
-
-
-
- public Long getMessageId()
- {
- return _messageHandle.getMessageId();
- }
-
- /**
- * Creates a long-lived reference to this message, and increments the count of such references, as an atomic
- * operation.
- */
- public AMQMessage takeReference()
- {
- incrementReference(); // _referenceCount.incrementAndGet();
-
- return this;
- }
-
- public boolean incrementReference()
- {
- return incrementReference(1);
- }
-
- /* Threadsafe. Increment the reference count on the message. */
- public boolean incrementReference(int count)
- {
- if(_referenceCount.addAndGet(count) <= 1)
- {
- _referenceCount.addAndGet(-count);
- return false;
- }
- else
- {
- return true;
- }
-
- }
-
- /**
- * Threadsafe. This will decrement the reference count and when it reaches zero will remove the message from the
- * message store.
- *
- * @param storeContext
- *
- * @throws MessageCleanupException when an attempt was made to remove the message from the message store and that
- * failed
- */
- public void decrementReference(StoreContext storeContext) throws MessageCleanupException
- {
-
- int count = _referenceCount.decrementAndGet();
-
- // note that the operation of decrementing the reference count and then removing the message does not
- // have to be atomic since the ref count starts at 1 and the exchange itself decrements that after
- // the message has been passed to all queues. i.e. we are
- // not relying on the all the increments having taken place before the delivery manager decrements.
- if (count == 0)
- {
- // set the reference count way below 0 so that we can detect that the message has been deleted
- // this is to guard against the message being spontaneously recreated (from the mgmt console)
- // by copying from other queues at the same time as it is being removed.
- _referenceCount.set(Integer.MIN_VALUE/2);
-
- try
- {
- // must check if the handle is null since there may be cases where we decide to throw away a message
- // and the handle has not yet been constructed
- if (_messageHandle != null)
- {
- _messageHandle.removeMessage(storeContext);
- }
- }
- catch (AMQException e)
- {
- // to maintain consistency, we revert the count
- incrementReference();
- throw new MessageCleanupException(getMessageId(), e);
- }
- }
- else
- {
- if (count < 0)
- {
- throw new MessageCleanupException("Reference count for message id " + debugIdentity()
- + " has gone below 0.");
- }
- }
- }
-
-
- /**
- * Called selectors to determin if the message has already been sent
- *
- * @return _deliveredToConsumer
- */
- public boolean getDeliveredToConsumer()
- {
- return (_flags & DELIVERED_TO_CONSUMER) != 0;
- }
-
- public boolean isPersistent() throws AMQException
- {
- return _messageHandle.isPersistent();
- }
-
- /**
- * Called to enforce the 'immediate' flag.
- *
- * @returns true if the message is marked for immediate delivery but has not been marked as delivered
- * to a consumer
- */
- public boolean immediateAndNotDelivered()
- {
-
- return (_flags & IMMEDIATE_AND_DELIVERED) == IMMEDIATE;
-
- }
-
- public MessagePublishInfo getMessagePublishInfo() throws AMQException
- {
- return _messageHandle.getMessagePublishInfo(getStoreContext());
- }
-
- public boolean isRedelivered()
- {
- return _messageHandle.isRedelivered();
- }
-
- public void setRedelivered(boolean redelivered)
- {
- _messageHandle.setRedelivered(redelivered);
- }
-
- public long getArrivalTime()
- {
- return _messageHandle.getArrivalTime();
- }
-
- /**
- * Checks to see if the message has expired. If it has the message is dequeued.
- *
- * @param queue The queue to check the expiration against. (Currently not used)
- *
- * @return true if the message has expire
- *
- * @throws AMQException
- */
- public boolean expired(AMQQueue queue) throws AMQException
- {
-
- if (_expiration != 0L)
- {
- long now = System.currentTimeMillis();
-
- return (now > _expiration);
- }
-
- return false;
- }
-
- /**
- * Called when this message is delivered to a consumer. (used to implement the 'immediate' flag functionality).
- * And for selector efficiency.
- */
- public void setDeliveredToConsumer()
- {
- _flags |= DELIVERED_TO_CONSUMER;
- }
-
-
-
- public AMQMessageHandle getMessageHandle()
- {
- return _messageHandle;
- }
-
- public long getSize()
- {
- return _size;
-
- }
-
- public Object getPublisherClientInstance()
- {
- return _sessionIdentifier.getSessionInstance();
- }
-
- public Object getPublisherIdentifier()
- {
- return _sessionIdentifier.getSessionIdentifier();
- }
-
- public void setClientIdentifier(final AMQProtocolSession.ProtocolSessionIdentifier sessionIdentifier)
- {
- _sessionIdentifier = sessionIdentifier;
- }
-
-
- public String toString()
- {
- // return "Message[" + debugIdentity() + "]: " + _messageId + "; ref count: " + _referenceCount + "; taken : " +
- // _taken + " by :" + _takenBySubcription;
-
- return "Message[" + debugIdentity() + "]: " + getMessageId() + "; ref count: " + _referenceCount;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessageHandle.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessageHandle.java
deleted file mode 100644
index 0ddd4e4d92..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessageHandle.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-
-/**
- * A pluggable way of getting message data. Implementations can provide intelligent caching for example or
- * even no caching at all to minimise the broker memory footprint.
- */
-public interface AMQMessageHandle
-{
- ContentHeaderBody getContentHeaderBody(StoreContext context) throws AMQException;
-
- /**
- *
- * @return the messageId for the message associated with this handle
- */
- Long getMessageId();
-
-
- /**
- * @return the number of body frames associated with this message
- */
- int getBodyCount(StoreContext context) throws AMQException;
-
- /**
- * @return the size of the body
- */
- long getBodySize(StoreContext context) throws AMQException;
-
- /**
- * Get a particular content body
- * @param index the index of the body to retrieve, must be between 0 and getBodyCount() - 1
- * @return a content body
- * @throws IllegalArgumentException if the index is invalid
- */
- ContentChunk getContentChunk(StoreContext context, int index) throws IllegalArgumentException, AMQException;
-
- void addContentBodyFrame(StoreContext storeContext, ContentChunk contentBody, boolean isLastContentBody) throws AMQException;
-
- MessagePublishInfo getMessagePublishInfo(StoreContext context) throws AMQException;
-
- boolean isRedelivered();
-
- void setRedelivered(boolean redelivered);
-
- boolean isPersistent();
-
- void setPublishAndContentHeaderBody(StoreContext storeContext, MessagePublishInfo messagePublishInfo,
- ContentHeaderBody contentHeaderBody)
- throws AMQException;
-
- void removeMessage(StoreContext storeContext) throws AMQException;
-
- long getArrivalTime();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java
deleted file mode 100644
index 34a70c6969..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQPriorityQueue.java
+++ /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.
-*
-*/
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.subscription.SubscriptionList;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.AMQException;
-
-public class AMQPriorityQueue extends SimpleAMQQueue
-{
- protected AMQPriorityQueue(final AMQShortString name,
- final boolean durable,
- final AMQShortString owner,
- final boolean autoDelete,
- final VirtualHost virtualHost,
- int priorities)
- throws AMQException
- {
- super(name, durable, owner, autoDelete, virtualHost, new PriorityQueueList.Factory(priorities));
- }
-
- public int getPriorities()
- {
- return ((PriorityQueueList) _entries).getPriorities();
- }
-
- @Override
- protected void checkSubscriptionsNotAheadOfDelivery(final QueueEntry entry)
- {
- // check that all subscriptions are not in advance of the entry
- SubscriptionList.SubscriptionNodeIterator subIter = _subscriptionList.iterator();
- while(subIter.advance() && !entry.isAcquired())
- {
- final Subscription subscription = subIter.getNode().getSubscription();
- QueueEntry subnode = subscription.getLastSeenEntry();
- while(subnode != null && entry.compareTo(subnode) < 0 && !entry.isAcquired())
- {
- if(subscription.setLastSeenEntry(subnode,entry))
- {
- break;
- }
- else
- {
- subnode = subscription.getLastSeenEntry();
- }
- }
-
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
deleted file mode 100644
index 03ccbe7ce4..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
+++ /dev/null
@@ -1,216 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.commons.configuration.CompositeConfiguration;
-import org.apache.commons.configuration.Configuration;
-import org.apache.qpid.server.management.Managable;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.AMQException;
-
-import java.util.List;
-import java.util.Set;
-
-public interface AMQQueue extends Managable, Comparable<AMQQueue>
-{
-
- AMQShortString getName();
-
- boolean isDurable();
-
- boolean isAutoDelete();
-
- AMQShortString getOwner();
-
- VirtualHost getVirtualHost();
-
-
- void bind(Exchange exchange, AMQShortString routingKey, FieldTable arguments) throws AMQException;
-
- void unBind(Exchange exchange, AMQShortString routingKey, FieldTable arguments) throws AMQException;
-
- List<ExchangeBinding> getExchangeBindings();
-
-
- void registerSubscription(final Subscription subscription, final boolean exclusive) throws AMQException;
-
- void unregisterSubscription(final Subscription subscription) throws AMQException;
-
-
- int getConsumerCount();
-
- int getActiveConsumerCount();
-
- boolean isUnused();
-
- boolean isEmpty();
-
- int getMessageCount();
-
- int getUndeliveredMessageCount();
-
-
- long getQueueDepth();
-
- long getReceivedMessageCount();
-
- long getOldestMessageArrivalTime();
-
- boolean isDeleted();
-
-
- int delete() throws AMQException;
-
-
- QueueEntry enqueue(StoreContext storeContext, AMQMessage message) throws AMQException;
-
- void requeue(StoreContext storeContext, QueueEntry entry) throws AMQException;
-
- void dequeue(StoreContext storeContext, QueueEntry entry) throws FailedDequeueException;
-
-
-
- boolean resend(final QueueEntry entry, final Subscription subscription) throws AMQException;
-
-
-
- void addQueueDeleteTask(final Task task);
-
-
- List<QueueEntry> getMessagesOnTheQueue();
-
- List<QueueEntry> getMessagesOnTheQueue(long fromMessageId, long toMessageId);
-
- List<Long> getMessagesOnTheQueue(int num);
-
- List<Long> getMessagesOnTheQueue(int num, int offest);
-
- QueueEntry getMessageOnTheQueue(long messageId);
-
-
- void moveMessagesToAnotherQueue(long fromMessageId, long toMessageId, String queueName,
- StoreContext storeContext);
-
- void copyMessagesToAnotherQueue(long fromMessageId, long toMessageId, String queueName, StoreContext storeContext);
-
- void removeMessagesFromQueue(long fromMessageId, long toMessageId, StoreContext storeContext);
-
-
-
- long getMaximumMessageSize();
-
- void setMaximumMessageSize(long value);
-
-
- long getMaximumMessageCount();
-
- void setMaximumMessageCount(long value);
-
-
- long getMaximumQueueDepth();
-
- void setMaximumQueueDepth(long value);
-
-
- long getMaximumMessageAge();
-
- void setMaximumMessageAge(final long maximumMessageAge);
-
-
- long getMinimumAlertRepeatGap();
-
-
- void deleteMessageFromTop(StoreContext storeContext) throws AMQException;
-
- long clearQueue(StoreContext storeContext) throws AMQException;
-
-
-
- void removeExpiredIfNoSubscribers() throws AMQException;
-
- Set<NotificationCheck> getNotificationChecks();
-
- void flushSubscription(final Subscription sub) throws AMQException;
-
- void deliverAsync(final Subscription sub);
-
- void deliverAsync();
-
- void stop();
-
-
- /**
- * ExistingExclusiveSubscription signals a failure to create a subscription, because an exclusive subscription
- * already exists.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent failure to create a subscription, because an exclusive subscription already exists.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- *
- * @todo Move to top level, used outside this class.
- */
- static final class ExistingExclusiveSubscription extends AMQException
- {
-
- public ExistingExclusiveSubscription()
- {
- super("");
- }
- }
-
- /**
- * ExistingSubscriptionPreventsExclusive signals a failure to create an exclusize subscription, as a subscription
- * already exists.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent failure to create an exclusize subscription, as a subscription already exists.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- *
- * @todo Move to top level, used outside this class.
- */
- static final class ExistingSubscriptionPreventsExclusive extends AMQException
- {
- public ExistingSubscriptionPreventsExclusive()
- {
- super("");
- }
- }
-
- static interface Task
- {
- public void doTask(AMQQueue queue) throws AMQException;
- }
-
- void configure(Configuration virtualHostDefaultQueueConfiguration);
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java
deleted file mode 100644
index be8c19d18f..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java
+++ /dev/null
@@ -1,78 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.configuration.VirtualHostConfiguration;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.AMQException;
-
-
-public class AMQQueueFactory
-{
- public static final AMQShortString X_QPID_PRIORITIES = new AMQShortString("x-qpid-priorities");
-
- public static AMQQueue createAMQQueueImpl(AMQShortString name,
- boolean durable,
- AMQShortString owner,
- boolean autoDelete,
- VirtualHost virtualHost, final FieldTable arguments)
-
- throws AMQException
- {
-
- return createAMQQueueImpl(name, durable, owner, autoDelete,
- virtualHost, arguments,
- VirtualHostConfiguration.getDefaultQueueConfiguration(virtualHost));
- }
-
- public static AMQQueue createAMQQueueImpl(AMQShortString name,
- boolean durable,
- AMQShortString owner,
- boolean autoDelete,
- VirtualHost virtualHost, final FieldTable arguments,
- Configuration queueConfiguration)
- throws AMQException
- {
-
- final int priorities = arguments == null ? 1 : arguments.containsKey(X_QPID_PRIORITIES) ? arguments.getInteger(X_QPID_PRIORITIES) : 1;
-
- AMQQueue q = null;
- if(priorities > 1)
- {
- q = new AMQPriorityQueue(name, durable, owner, autoDelete, virtualHost, priorities);
- }
- else
- {
- q = new SimpleAMQQueue(name, durable, owner, autoDelete, virtualHost);
- }
- if (q != null && queueConfiguration != null)
- {
- q.configure(queueConfiguration);
- }
-
- //Register the new queue
- virtualHost.getQueueRegistry().registerQueue(q);
- return q;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
deleted file mode 100644
index 2ed6be77c6..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
+++ /dev/null
@@ -1,479 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.log4j.Logger;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.CommonContentHeaderProperties;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.server.management.AMQManagedObject;
-import org.apache.qpid.server.management.MBeanConstructor;
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.management.ManagedObject;
-import org.apache.qpid.server.store.StoreContext;
-
-import javax.management.JMException;
-import javax.management.MBeanException;
-import javax.management.MBeanNotificationInfo;
-import javax.management.Notification;
-import javax.management.OperationsException;
-import javax.management.monitor.MonitorNotification;
-import javax.management.openmbean.ArrayType;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.SimpleType;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularDataSupport;
-import javax.management.openmbean.TabularType;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * AMQQueueMBean is the management bean for an {@link AMQQueue}.
- *
- * <p/><tablse id="crc"><caption>CRC Caption</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * </table>
- */
-@MBeanDescription("Management Interface for AMQQueue")
-public class AMQQueueMBean extends AMQManagedObject implements ManagedQueue, QueueNotificationListener
-{
- /** Used for debugging purposes. */
- private static final Logger _logger = Logger.getLogger(AMQQueueMBean.class);
-
- private static final SimpleDateFormat _dateFormat = new SimpleDateFormat("MM-dd-yy HH:mm:ss.SSS z");
-
- /**
- * Since the MBean is not associated with a real channel we can safely create our own store context
- * for use in the few methods that require one.
- */
- private StoreContext _storeContext = new StoreContext();
-
- private AMQQueue _queue = null;
- private String _queueName = null;
- // OpenMBean data types for viewMessages method
- private static final String[] _msgAttributeNames = { "AMQ MessageId", "Header", "Size(bytes)", "Redelivered" };
- private static String[] _msgAttributeIndex = { _msgAttributeNames[0] };
- private static OpenType[] _msgAttributeTypes = new OpenType[4]; // AMQ message attribute types.
- private static CompositeType _messageDataType = null; // Composite type for representing AMQ Message data.
- private static TabularType _messagelistDataType = null; // Datatype for representing AMQ messages list.
-
- // OpenMBean data types for viewMessageContent method
- private static CompositeType _msgContentType = null;
- private static final String[] _msgContentAttributes = { "AMQ MessageId", "MimeType", "Encoding", "Content" };
- private static OpenType[] _msgContentAttributeTypes = new OpenType[4];
-
- private final long[] _lastNotificationTimes = new long[NotificationCheck.values().length];
- private Notification _lastNotification = null;
-
-
-
-
- @MBeanConstructor("Creates an MBean exposing an AMQQueue")
- public AMQQueueMBean(AMQQueue queue) throws JMException
- {
- super(ManagedQueue.class, ManagedQueue.TYPE);
- _queue = queue;
- _queueName = jmxEncode(new StringBuffer(queue.getName()), 0).toString();
- }
-
- public ManagedObject getParentObject()
- {
- return _queue.getVirtualHost().getManagedObject();
- }
-
- static
- {
- try
- {
- init();
- }
- catch (JMException ex)
- {
- // This is not expected to ever occur.
- throw new RuntimeException("Got JMException in static initializer.", ex);
- }
- }
-
- /**
- * initialises the openmbean data types
- */
- private static void init() throws OpenDataException
- {
- _msgContentAttributeTypes[0] = SimpleType.LONG; // For message id
- _msgContentAttributeTypes[1] = SimpleType.STRING; // For MimeType
- _msgContentAttributeTypes[2] = SimpleType.STRING; // For Encoding
- _msgContentAttributeTypes[3] = new ArrayType(1, SimpleType.BYTE); // For message content
- _msgContentType =
- new CompositeType("Message Content", "AMQ Message Content", _msgContentAttributes, _msgContentAttributes,
- _msgContentAttributeTypes);
-
- _msgAttributeTypes[0] = SimpleType.LONG; // For message id
- _msgAttributeTypes[1] = new ArrayType(1, SimpleType.STRING); // For header attributes
- _msgAttributeTypes[2] = SimpleType.LONG; // For size
- _msgAttributeTypes[3] = SimpleType.BOOLEAN; // For redelivered
-
- _messageDataType =
- new CompositeType("Message", "AMQ Message", _msgAttributeNames, _msgAttributeNames, _msgAttributeTypes);
- _messagelistDataType = new TabularType("Messages", "List of messages", _messageDataType, _msgAttributeIndex);
- }
-
- public String getObjectInstanceName()
- {
- return _queueName;
- }
-
- public String getName()
- {
- return _queueName;
- }
-
- public boolean isDurable()
- {
- return _queue.isDurable();
- }
-
- public String getOwner()
- {
- return String.valueOf(_queue.getOwner());
- }
-
- public boolean isAutoDelete()
- {
- return _queue.isAutoDelete();
- }
-
- public Integer getMessageCount()
- {
- return _queue.getMessageCount();
- }
-
- public Long getMaximumMessageSize()
- {
- return _queue.getMaximumMessageSize();
- }
-
- public Long getMaximumMessageAge()
- {
- return _queue.getMaximumMessageAge();
- }
-
- public void setMaximumMessageAge(Long maximumMessageAge)
- {
- _queue.setMaximumMessageAge(maximumMessageAge);
- }
-
- public void setMaximumMessageSize(Long value)
- {
- _queue.setMaximumMessageSize(value);
- }
-
- public Integer getConsumerCount()
- {
- return _queue.getConsumerCount();
- }
-
- public Integer getActiveConsumerCount()
- {
- return _queue.getActiveConsumerCount();
- }
-
- public Long getReceivedMessageCount()
- {
- return _queue.getReceivedMessageCount();
- }
-
- public Long getMaximumMessageCount()
- {
- return _queue.getMaximumMessageCount();
- }
-
- public void setMaximumMessageCount(Long value)
- {
- _queue.setMaximumMessageCount(value);
- }
-
- public Long getMaximumQueueDepth()
- {
- long queueDepthInBytes = _queue.getMaximumQueueDepth();
-
- return queueDepthInBytes >> 10;
- }
-
- public void setMaximumQueueDepth(Long value)
- {
- _queue.setMaximumQueueDepth(value);
- }
-
- /**
- * returns the size of messages(KB) in the queue.
- */
- public Long getQueueDepth() throws JMException
- {
- long queueBytesSize = _queue.getQueueDepth();
-
- return queueBytesSize >> 10;
- }
-
- /**
- * Checks if there is any notification to be send to the listeners
- */
- public void checkForNotification(AMQMessage msg) throws AMQException, JMException
- {
-
- final Set<NotificationCheck> notificationChecks = _queue.getNotificationChecks();
-
- if(!notificationChecks.isEmpty())
- {
- final long currentTime = System.currentTimeMillis();
- final long thresholdTime = currentTime - _queue.getMinimumAlertRepeatGap();
-
- for (NotificationCheck check : notificationChecks)
- {
- if (check.isMessageSpecific() || (_lastNotificationTimes[check.ordinal()] < thresholdTime))
- {
- if (check.notifyIfNecessary(msg, _queue, this))
- {
- _lastNotificationTimes[check.ordinal()] = currentTime;
- }
- }
- }
- }
-
- }
-
- /**
- * Sends the notification to the listeners
- */
- public void notifyClients(NotificationCheck notification, AMQQueue queue, String notificationMsg)
- {
- // important : add log to the log file - monitoring tools may be looking for this
- _logger.info(notification.name() + " On Queue " + queue.getName() + " - " + notificationMsg);
- notificationMsg = notification.name() + " " + notificationMsg;
-
- _lastNotification =
- new Notification(MonitorNotification.THRESHOLD_VALUE_EXCEEDED, this, ++_notificationSequenceNumber,
- System.currentTimeMillis(), notificationMsg);
-
- _broadcaster.sendNotification(_lastNotification);
- }
-
- public Notification getLastNotification()
- {
- return _lastNotification;
- }
-
- /**
- * @see AMQQueue#deleteMessageFromTop
- */
- public void deleteMessageFromTop() throws JMException
- {
- try
- {
- _queue.deleteMessageFromTop(_storeContext);
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex, ex.toString());
- }
- }
-
- /**
- * @see AMQQueue#clearQueue
- */
- public void clearQueue() throws JMException
- {
- try
- {
- _queue.clearQueue(_storeContext);
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex, ex.toString());
- }
- }
-
- /**
- * returns message content as byte array and related attributes for the given message id.
- */
- public CompositeData viewMessageContent(long msgId) throws JMException
- {
- QueueEntry entry = _queue.getMessageOnTheQueue(msgId);
-
- if (entry == null)
- {
- throw new OperationsException("AMQMessage with message id = " + msgId + " is not in the " + _queueName);
- }
-
- AMQMessage msg = entry.getMessage();
- // get message content
- Iterator<ContentChunk> cBodies = msg.getContentBodyIterator();
- List<Byte> msgContent = new ArrayList<Byte>();
- while (cBodies.hasNext())
- {
- ContentChunk body = cBodies.next();
- if (body.getSize() != 0)
- {
- if (body.getSize() != 0)
- {
- ByteBuffer slice = body.getData().slice();
- for (int j = 0; j < slice.limit(); j++)
- {
- msgContent.add(slice.get());
- }
- }
- }
- }
-
- try
- {
- // Create header attributes list
- CommonContentHeaderProperties headerProperties =
- (CommonContentHeaderProperties) msg.getContentHeaderBody().properties;
- String mimeType = null, encoding = null;
- if (headerProperties != null)
- {
- AMQShortString mimeTypeShortSting = headerProperties.getContentType();
- mimeType = (mimeTypeShortSting == null) ? null : mimeTypeShortSting.toString();
- encoding = (headerProperties.getEncoding() == null) ? "" : headerProperties.getEncoding().toString();
- }
-
- Object[] itemValues = { msgId, mimeType, encoding, msgContent.toArray(new Byte[0]) };
-
- return new CompositeDataSupport(_msgContentType, _msgContentAttributes, itemValues);
- }
- catch (AMQException e)
- {
- JMException jme = new JMException("Error creating header attributes list: " + e);
- jme.initCause(e);
- throw jme;
- }
- }
-
- /**
- * Returns the header contents of the messages stored in this queue in tabular form.
- */
- public TabularData viewMessages(int beginIndex, int endIndex) throws JMException
- {
- if ((beginIndex > endIndex) || (beginIndex < 1))
- {
- throw new OperationsException("From Index = " + beginIndex + ", To Index = " + endIndex
- + "\n\"From Index\" should be greater than 0 and less than \"To Index\"");
- }
-
- List<QueueEntry> list = _queue.getMessagesOnTheQueue();
- TabularDataSupport _messageList = new TabularDataSupport(_messagelistDataType);
-
- try
- {
- // Create the tabular list of message header contents
- for (int i = beginIndex; (i <= endIndex) && (i <= list.size()); i++)
- {
- AMQMessage msg = list.get(i - 1).getMessage();
- ContentHeaderBody headerBody = msg.getContentHeaderBody();
- // Create header attributes list
- String[] headerAttributes = getMessageHeaderProperties(headerBody);
- Object[] itemValues = { msg.getMessageId(), headerAttributes, headerBody.bodySize, msg.isRedelivered() };
- CompositeData messageData = new CompositeDataSupport(_messageDataType, _msgAttributeNames, itemValues);
- _messageList.put(messageData);
- }
- }
- catch (AMQException e)
- {
- JMException jme = new JMException("Error creating message contents: " + e);
- jme.initCause(e);
- throw jme;
- }
-
- return _messageList;
- }
-
- private String[] getMessageHeaderProperties(ContentHeaderBody headerBody)
- {
- List<String> list = new ArrayList<String>();
- BasicContentHeaderProperties headerProperties = (BasicContentHeaderProperties) headerBody.properties;
- list.add("reply-to = " + headerProperties.getReplyToAsString());
- list.add("propertyFlags = " + headerProperties.getPropertyFlags());
- list.add("ApplicationID = " + headerProperties.getAppIdAsString());
- list.add("ClusterID = " + headerProperties.getClusterIdAsString());
- list.add("UserId = " + headerProperties.getUserIdAsString());
- list.add("JMSMessageID = " + headerProperties.getMessageIdAsString());
- list.add("JMSCorrelationID = " + headerProperties.getCorrelationIdAsString());
-
- int delMode = headerProperties.getDeliveryMode();
- list.add("JMSDeliveryMode = " + ((delMode == 1) ? "Persistent" : "Non_Persistent"));
-
- list.add("JMSPriority = " + headerProperties.getPriority());
- list.add("JMSType = " + headerProperties.getType());
-
- long longDate = headerProperties.getExpiration();
- String strDate = (longDate != 0) ? _dateFormat.format(new Date(longDate)) : null;
- list.add("JMSExpiration = " + strDate);
-
- longDate = headerProperties.getTimestamp();
- strDate = (longDate != 0) ? _dateFormat.format(new Date(longDate)) : null;
- list.add("JMSTimestamp = " + strDate);
-
- return list.toArray(new String[list.size()]);
- }
-
- /**
- * @see ManagedQueue#moveMessages
- * @param fromMessageId
- * @param toMessageId
- * @param toQueueName
- * @throws JMException
- */
- public void moveMessages(long fromMessageId, long toMessageId, String toQueueName) throws JMException
- {
- if ((fromMessageId > toMessageId) || (fromMessageId < 1))
- {
- throw new OperationsException("\"From MessageId\" should be greater then 0 and less then \"To MessageId\"");
- }
-
- _queue.moveMessagesToAnotherQueue(fromMessageId, toMessageId, toQueueName, _storeContext);
- }
-
- /**
- * returns Notifications sent by this MBean.
- */
- @Override
- public MBeanNotificationInfo[] getNotificationInfo()
- {
- String[] notificationTypes = new String[] { MonitorNotification.THRESHOLD_VALUE_EXCEEDED };
- String name = MonitorNotification.class.getName();
- String description = "Either Message count or Queue depth or Message size has reached threshold high value";
- MBeanNotificationInfo info1 = new MBeanNotificationInfo(notificationTypes, name, description);
-
- return new MBeanNotificationInfo[] { info1 };
- }
-
-} // End of AMQQueueMBean class
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AsyncDeliveryConfig.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AsyncDeliveryConfig.java
deleted file mode 100644
index 290fedcf7b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/AsyncDeliveryConfig.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
-
-import org.apache.qpid.configuration.Configured;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-
-public class AsyncDeliveryConfig
-{
- private Executor _executor;
-
- @Configured(path = "delivery.poolsize", defaultValue = "0")
- public int poolSize;
-
- public Executor getExecutor()
- {
- if (_executor == null)
- {
- if (poolSize > 0)
- {
- _executor = Executors.newFixedThreadPool(poolSize);
- }
- else
- {
- _executor = Executors.newCachedThreadPool();
- }
- }
- return _executor;
- }
-
- public static Executor getAsyncDeliveryExecutor()
- {
- return ApplicationRegistry.getInstance().getConfiguredObject(AsyncDeliveryConfig.class).getExecutor();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java
deleted file mode 100644
index cbe9246f09..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.util.Collection;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-public class DefaultQueueRegistry implements QueueRegistry
-{
- private ConcurrentMap<AMQShortString, AMQQueue> _queueMap = new ConcurrentHashMap<AMQShortString, AMQQueue>();
-
- private final VirtualHost _virtualHost;
-
- public DefaultQueueRegistry(VirtualHost virtualHost)
- {
- _virtualHost = virtualHost;
- }
-
- public VirtualHost getVirtualHost()
- {
- return _virtualHost;
- }
-
- public void registerQueue(AMQQueue queue) throws AMQException
- {
- _queueMap.put(queue.getName(), queue);
- }
-
- public void unregisterQueue(AMQShortString name) throws AMQException
- {
- _queueMap.remove(name);
- }
-
- public AMQQueue getQueue(AMQShortString name)
- {
- return _queueMap.get(name);
- }
-
- public Collection<AMQShortString> getQueueNames()
- {
- return _queueMap.keySet();
- }
-
- public Collection<AMQQueue> getQueues()
- {
- return _queueMap.values();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java
deleted file mode 100644
index a2fcab9e73..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBinding.java
+++ /dev/null
@@ -1,84 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.AMQException;
-
-public class ExchangeBinding
-{
- private final Exchange _exchange;
- private final AMQShortString _routingKey;
- private final FieldTable _arguments;
-
- private static final FieldTable EMPTY_ARGUMENTS = new FieldTable();
-
- ExchangeBinding(AMQShortString routingKey, Exchange exchange)
- {
- this(routingKey, exchange, EMPTY_ARGUMENTS);
- }
-
- ExchangeBinding(AMQShortString routingKey, Exchange exchange, FieldTable arguments)
- {
- _routingKey = routingKey == null ? AMQShortString.EMPTY_STRING : routingKey;
- _exchange = exchange;
- _arguments = arguments == null ? EMPTY_ARGUMENTS : arguments;
- }
-
- void unbind(AMQQueue queue) throws AMQException
- {
- _exchange.deregisterQueue(_routingKey, queue, _arguments);
- }
-
- public Exchange getExchange()
- {
- return _exchange;
- }
-
- public AMQShortString getRoutingKey()
- {
- return _routingKey;
- }
-
- public FieldTable getArguments()
- {
- return _arguments;
- }
-
- public int hashCode()
- {
- return (_exchange == null ? 0 : _exchange.hashCode())
- + (_routingKey == null ? 0 : _routingKey.hashCode());
- }
-
- public boolean equals(Object o)
- {
- if (!(o instanceof ExchangeBinding))
- {
- return false;
- }
- ExchangeBinding eb = (ExchangeBinding) o;
- return _exchange.equals(eb._exchange)
- && _routingKey.equals(eb._routingKey);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java
deleted file mode 100644
index fb839c1783..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java
+++ /dev/null
@@ -1,82 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.exchange.Exchange;
-
-/**
- * When a queue is deleted, it should be deregistered from any
- * exchange it has been bound to. This class assists in this task,
- * by keeping track of all bindings for a given queue.
- */
-class ExchangeBindings
-{
- private final List<ExchangeBinding> _bindings = new CopyOnWriteArrayList<ExchangeBinding>();
- private final AMQQueue _queue;
-
- ExchangeBindings(AMQQueue queue)
- {
- _queue = queue;
- }
-
- /**
- * Adds the specified binding to those being tracked.
- * @param routingKey the routing key with which the queue whose bindings
- * are being tracked by the instance has been bound to the exchange
- * @param exchange the exchange bound to
- */
- void addBinding(AMQShortString routingKey, FieldTable arguments, Exchange exchange)
- {
- _bindings.add(new ExchangeBinding(routingKey, exchange, arguments));
- }
-
-
- public boolean remove(AMQShortString routingKey, FieldTable arguments, Exchange exchange)
- {
- return _bindings.remove(new ExchangeBinding(routingKey, exchange, arguments));
- }
-
-
- /**
- * Deregisters this queue from any exchange it has been bound to
- */
- void deregister() throws AMQException
- {
- //remove duplicates at this point
- HashSet<ExchangeBinding> copy = new HashSet<ExchangeBinding>(_bindings);
- for (ExchangeBinding b : copy)
- {
- b.unbind(_queue);
- }
- }
-
- List<ExchangeBinding> getExchangeBindings()
- {
- return _bindings;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java
deleted file mode 100644
index 6466e81dd2..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java
+++ /dev/null
@@ -1,50 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-
-/**
- * Signals that the dequeue of a message from a queue failed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Indicates the a message could not be dequeued from a queue.
- * <tr><td>
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- *
- * @todo Happens as a consequence of a message store failure, or reference counting error. Both of which migh become
- * runtime exceptions, as unrecoverable conditions? In which case this one might be dropped too.
- */
-public class FailedDequeueException extends AMQException
-{
- public FailedDequeueException(String queue)
- {
- super("Failed to dequeue message from " + queue);
- }
-
- public FailedDequeueException(String queue, AMQException e)
- {
- super("Failed to dequeue message from " + queue, e);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/Filterable.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/Filterable.java
deleted file mode 100644
index d38932bb61..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/Filterable.java
+++ /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.
-*
-*/
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.AMQException;
-
-public interface Filterable<E extends Exception>
-{
- ContentHeaderBody getContentHeaderBody() throws E;
-
- boolean isPersistent() throws E;
-
- boolean isRedelivered();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/InMemoryMessageHandle.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/InMemoryMessageHandle.java
deleted file mode 100644
index 35ad5be4e0..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/InMemoryMessageHandle.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Collections;
-import java.util.ArrayList;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.server.store.StoreContext;
-
-/**
- */
-public class InMemoryMessageHandle implements AMQMessageHandle
-{
-
- private ContentHeaderBody _contentHeaderBody;
-
- private MessagePublishInfo _messagePublishInfo;
-
- private List<ContentChunk> _contentBodies;
-
- private boolean _redelivered;
-
- private long _arrivalTime;
-
- private final Long _messageId;
-
- public InMemoryMessageHandle(final Long messageId)
- {
- _messageId = messageId;
- }
-
- public ContentHeaderBody getContentHeaderBody(StoreContext context) throws AMQException
- {
- return _contentHeaderBody;
- }
-
- public Long getMessageId()
- {
- return _messageId;
- }
-
- public int getBodyCount(StoreContext context)
- {
- return _contentBodies.size();
- }
-
- public long getBodySize(StoreContext context) throws AMQException
- {
- return getContentHeaderBody(context).bodySize;
- }
-
- public ContentChunk getContentChunk(StoreContext context, int index) throws AMQException, IllegalArgumentException
- {
- if (index > _contentBodies.size() - 1)
- {
- throw new IllegalArgumentException("Index " + index + " out of valid range 0 to " +
- (_contentBodies.size() - 1));
- }
- return _contentBodies.get(index);
- }
-
- public void addContentBodyFrame(StoreContext storeContext, ContentChunk contentBody, boolean isLastContentBody)
- throws AMQException
- {
- if(_contentBodies == null)
- {
- if(isLastContentBody)
- {
- _contentBodies = Collections.singletonList(contentBody);
- }
- else
- {
- _contentBodies = new ArrayList<ContentChunk>();
- _contentBodies.add(contentBody);
- }
- }
- else
- {
- _contentBodies.add(contentBody);
- }
- }
-
- public MessagePublishInfo getMessagePublishInfo(StoreContext context) throws AMQException
- {
- return _messagePublishInfo;
- }
-
- public boolean isRedelivered()
- {
- return _redelivered;
- }
-
-
- public void setRedelivered(boolean redelivered)
- {
- _redelivered = redelivered;
- }
-
- public boolean isPersistent()
- {
- return false;
- }
-
- /**
- * This is called when all the content has been received.
- * @param messagePublishInfo
- * @param contentHeaderBody
- * @throws AMQException
- */
- public void setPublishAndContentHeaderBody(StoreContext storeContext, MessagePublishInfo messagePublishInfo,
- ContentHeaderBody contentHeaderBody)
- throws AMQException
- {
- _messagePublishInfo = messagePublishInfo;
- _contentHeaderBody = contentHeaderBody;
- if(contentHeaderBody.bodySize == 0)
- {
- _contentBodies = Collections.EMPTY_LIST;
- }
- _arrivalTime = System.currentTimeMillis();
- }
-
- public void removeMessage(StoreContext storeContext) throws AMQException
- {
- // NO OP
- }
-
- public long getArrivalTime()
- {
- return _arrivalTime;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java
deleted file mode 100644
index b994040131..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/IncomingMessage.java
+++ /dev/null
@@ -1,319 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.server.txn.TransactionalContext;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.exchange.NoRouteException;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.AMQException;
-import org.apache.log4j.Logger;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-public class IncomingMessage implements Filterable<RuntimeException>
-{
-
- /** Used for debugging purposes. */
- private static final Logger _logger = Logger.getLogger(IncomingMessage.class);
-
- private static final boolean SYNCHED_CLOCKS =
- ApplicationRegistry.getInstance().getConfiguration().getBoolean("advanced.synced-clocks", false);
-
- private final MessagePublishInfo _messagePublishInfo;
- private ContentHeaderBody _contentHeaderBody;
- private AMQMessageHandle _messageHandle;
- private final Long _messageId;
- private final TransactionalContext _txnContext;
-
- private static final boolean MSG_AUTH =
- ApplicationRegistry.getInstance().getConfiguration().getBoolean("security.msg-auth", false);
-
-
- /**
- * Keeps a track of how many bytes we have received in body frames
- */
- private long _bodyLengthReceived = 0;
-
- /**
- * This is stored during routing, to know the queues to which this message should immediately be
- * delivered. It is <b>cleared after delivery has been attempted</b>. Any persistent record of destinations is done
- * by the message handle.
- */
- private ArrayList<AMQQueue> _destinationQueues;
-
- private AMQProtocolSession _publisher;
- private MessageStore _messageStore;
- private long _expiration;
-
- private Exchange _exchange;
-
-
- public IncomingMessage(final Long messageId,
- final MessagePublishInfo info,
- final TransactionalContext txnContext,
- final AMQProtocolSession publisher)
- {
- _messageId = messageId;
- _messagePublishInfo = info;
- _txnContext = txnContext;
- _publisher = publisher;
-
- }
-
- public void setContentHeaderBody(final ContentHeaderBody contentHeaderBody) throws AMQException
- {
- _contentHeaderBody = contentHeaderBody;
- }
-
- public void setExpiration()
- {
- long expiration =
- ((BasicContentHeaderProperties) _contentHeaderBody.properties).getExpiration();
- long timestamp =
- ((BasicContentHeaderProperties) _contentHeaderBody.properties).getTimestamp();
-
- if (SYNCHED_CLOCKS)
- {
- _expiration = expiration;
- }
- else
- {
- // Update TTL to be in broker time.
- if (expiration != 0L)
- {
- if (timestamp != 0L)
- {
- // todo perhaps use arrival time
- long diff = (System.currentTimeMillis() - timestamp);
-
- if ((diff > 1000L) || (diff < 1000L))
- {
- _expiration = expiration + diff;
- }
- }
- }
- }
-
- }
-
- public void routingComplete(final MessageStore store,
- final MessageHandleFactory factory) throws AMQException
- {
-
- final boolean persistent = isPersistent();
- _messageHandle = factory.createMessageHandle(_messageId, store, persistent);
- if (persistent)
- {
- _txnContext.beginTranIfNecessary();
- // enqueuing the messages ensure that if required the destinations are recorded to a
- // persistent store
-
- if(_destinationQueues != null)
- {
- for (int i = 0; i < _destinationQueues.size(); i++)
- {
- store.enqueueMessage(_txnContext.getStoreContext(),
- _destinationQueues.get(i), _messageId);
- }
- }
- }
- }
-
- public AMQMessage deliverToQueues()
- throws AMQException
- {
-
- // we get a reference to the destination queues now so that we can clear the
- // transient message data as quickly as possible
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Delivering message " + _messageId + " to " + _destinationQueues);
- }
-
- AMQMessage message = null;
-
- try
- {
- // first we allow the handle to know that the message has been fully received. This is useful if it is
- // maintaining any calculated values based on content chunks
- _messageHandle.setPublishAndContentHeaderBody(_txnContext.getStoreContext(),
- _messagePublishInfo, getContentHeaderBody());
-
-
-
- message = new AMQMessage(_messageHandle,_txnContext.getStoreContext(), _messagePublishInfo);
-
- message.setExpiration(_expiration);
- message.setClientIdentifier(_publisher.getSessionIdentifier());
-
- // we then allow the transactional context to do something with the message content
- // now that it has all been received, before we attempt delivery
- _txnContext.messageFullyReceived(isPersistent());
-
- AMQShortString userID = getContentHeaderBody().properties instanceof BasicContentHeaderProperties ?
- ((BasicContentHeaderProperties) getContentHeaderBody().properties).getUserId() : null;
-
- if (MSG_AUTH && !_publisher.getAuthorizedID().getName().equals(userID == null? "" : userID.toString()))
- {
- throw new UnauthorizedAccessException("Acccess Refused",message);
- }
-
- if ((_destinationQueues == null) || _destinationQueues.size() == 0)
- {
-
- if (isMandatory() || isImmediate())
- {
- throw new NoRouteException("No Route for message", message);
-
- }
- else
- {
- _logger.warn("MESSAGE DISCARDED: No routes for message - " + message);
- }
- }
- else
- {
- int offset;
- final int queueCount = _destinationQueues.size();
- message.incrementReference(queueCount);
- if(queueCount == 1)
- {
- offset = 0;
- }
- else
- {
- offset = ((int)(message.getMessageId().longValue())) % queueCount;
- if(offset < 0)
- {
- offset = -offset;
- }
- }
- for (int i = offset; i < queueCount; i++)
- {
- // normal deliver so add this message at the end.
- _txnContext.deliver(_destinationQueues.get(i), message);
- }
- for (int i = 0; i < offset; i++)
- {
- // normal deliver so add this message at the end.
- _txnContext.deliver(_destinationQueues.get(i), message);
- }
- }
-
- message.clearStoreContext();
- return message;
- }
- finally
- {
- // Remove refence for routing process . Reference count should now == delivered queue count
- if(message != null) message.decrementReference(_txnContext.getStoreContext());
- }
-
- }
-
- public void addContentBodyFrame(final ContentChunk contentChunk)
- throws AMQException
- {
-
- _bodyLengthReceived += contentChunk.getSize();
-
- _messageHandle.addContentBodyFrame(_txnContext.getStoreContext(), contentChunk, allContentReceived());
-
- }
-
- public boolean allContentReceived()
- {
- return (_bodyLengthReceived == getContentHeaderBody().bodySize);
- }
-
- public AMQShortString getExchange() throws AMQException
- {
- return _messagePublishInfo.getExchange();
- }
-
- public AMQShortString getRoutingKey() throws AMQException
- {
- return _messagePublishInfo.getRoutingKey();
- }
-
- public boolean isMandatory() throws AMQException
- {
- return _messagePublishInfo.isMandatory();
- }
-
-
- public boolean isImmediate() throws AMQException
- {
- return _messagePublishInfo.isImmediate();
- }
-
- public ContentHeaderBody getContentHeaderBody()
- {
- return _contentHeaderBody;
- }
-
-
- public boolean isPersistent()
- {
- //todo remove literal values to a constant file such as AMQConstants in common
- return getContentHeaderBody().properties instanceof BasicContentHeaderProperties &&
- ((BasicContentHeaderProperties) getContentHeaderBody().properties).getDeliveryMode() == 2;
- }
-
- public boolean isRedelivered()
- {
- return false;
- }
-
- public void setMessageStore(final MessageStore messageStore)
- {
- _messageStore = messageStore;
- }
-
- public Long getMessageId()
- {
- return _messageId;
- }
-
- public void setExchange(final Exchange e)
- {
- _exchange = e;
- }
-
- public void route() throws AMQException
- {
- _exchange.route(this);
- }
-
- public void enqueue(final ArrayList<AMQQueue> queues)
- {
- _destinationQueues = queues;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
deleted file mode 100644
index 2bc94995e9..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
+++ /dev/null
@@ -1,245 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import java.io.IOException;
-
-import javax.management.JMException;
-import javax.management.MBeanOperationInfo;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.TabularData;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.management.MBeanAttribute;
-import org.apache.qpid.server.management.MBeanOperation;
-import org.apache.qpid.server.management.MBeanOperationParameter;
-
-/**
- * The management interface exposed to allow management of a queue.
- * @author Robert J. Greig
- * @author Bhupendra Bhardwaj
- * @version 0.1
- */
-public interface ManagedQueue
-{
- static final String TYPE = "Queue";
-
- /**
- * Returns the Name of the ManagedQueue.
- * @return the name of the managedQueue.
- * @throws IOException
- */
- @MBeanAttribute(name="Name", description = TYPE + " Name")
- String getName() throws IOException;
-
- /**
- * Total number of messages on the queue, which are yet to be delivered to the consumer(s).
- * @return number of undelivered message in the Queue.
- * @throws IOException
- */
- @MBeanAttribute(name="MessageCount", description = "Total number of undelivered messages on the queue")
- Integer getMessageCount() throws IOException;
-
- /**
- * Tells the total number of messages receieved by the queue since startup.
- * @return total number of messages received.
- * @throws IOException
- */
- @MBeanAttribute(name="ReceivedMessageCount", description="The total number of messages receieved by the queue since startup")
- Long getReceivedMessageCount() throws IOException;
-
- /**
- * Size of messages in the queue
- * @return
- * @throws IOException
- */
- @MBeanAttribute(name="QueueDepth", description="Size of messages(KB) in the queue")
- Long getQueueDepth() throws IOException, JMException;
-
- /**
- * Returns the total number of active subscribers to the queue.
- * @return the number of active subscribers
- * @throws IOException
- */
- @MBeanAttribute(name="ActiveConsumerCount", description="The total number of active subscribers to the queue")
- Integer getActiveConsumerCount() throws IOException;
-
- /**
- * Returns the total number of subscribers to the queue.
- * @return the number of subscribers.
- * @throws IOException
- */
- @MBeanAttribute(name="ConsumerCount", description="The total number of subscribers to the queue")
- Integer getConsumerCount() throws IOException;
-
- /**
- * Tells the Owner of the ManagedQueue.
- * @return the owner's name.
- * @throws IOException
- */
- @MBeanAttribute(name="Owner", description = "Owner")
- String getOwner() throws IOException;
-
- /**
- * Tells whether this ManagedQueue is durable or not.
- * @return true if this ManagedQueue is a durable queue.
- * @throws IOException
- */
- @MBeanAttribute(name="Durable", description = "true if the AMQQueue is durable")
- boolean isDurable() throws IOException;
-
- /**
- * Tells if the ManagedQueue is set to AutoDelete.
- * @return true if the ManagedQueue is set to AutoDelete.
- * @throws IOException
- */
- @MBeanAttribute(name="AutoDelete", description = "true if the AMQQueue is AutoDelete")
- boolean isAutoDelete() throws IOException;
-
- /**
- * Returns the maximum age of a message (expiration time)
- * @return the maximum age
- * @throws IOException
- */
- Long getMaximumMessageAge() throws IOException;
-
- /**
- * Sets the maximum age of a message
- * @param age maximum age of message.
- * @throws IOException
- */
- @MBeanAttribute(name="MaximumMessageAge", description="Threshold high value for message age on the broker")
- void setMaximumMessageAge(Long age) throws IOException;
-
- /**
- * Returns the maximum size of a message (in kbytes) allowed to be accepted by the
- * ManagedQueue. This is useful in setting notifications or taking
- * appropriate action, if the size of the message received is more than
- * the allowed size.
- * @return the maximum size of a message allowed to be aceepted by the
- * ManagedQueue.
- * @throws IOException
- */
- Long getMaximumMessageSize() throws IOException;
-
- /**
- * Sets the maximum size of the message (in kbytes) that is allowed to be
- * accepted by the Queue.
- * @param size maximum size of message.
- * @throws IOException
- */
- @MBeanAttribute(name="MaximumMessageSize", description="Threshold high value(KB) for a message size")
- void setMaximumMessageSize(Long size) throws IOException;
-
- /**
- * Tells the maximum number of messages that can be stored in the queue.
- * This is useful in setting the notifications or taking required
- * action is the number of message increase this limit.
- * @return maximum muber of message allowed to be stored in the queue.
- * @throws IOException
- */
- Long getMaximumMessageCount() throws IOException;
-
- /**
- * Sets the maximum number of messages allowed to be stored in the queue.
- * @param value the maximum number of messages allowed to be stored in the queue.
- * @throws IOException
- */
- @MBeanAttribute(name="MaximumMessageCount", description="Threshold high value for number of undelivered messages in the queue")
- void setMaximumMessageCount(Long value) throws IOException;
-
- /**
- * This is useful for setting notifications or taking required action if the size of messages
- * stored in the queue increases over this limit.
- * @return threshold high value for Queue Depth
- * @throws IOException
- */
- Long getMaximumQueueDepth() throws IOException;
-
- /**
- * Sets the maximum size of all the messages together, that can be stored
- * in the queue.
- * @param value
- * @throws IOException
- */
- @MBeanAttribute(name="MaximumQueueDepth", description="The threshold high value(KB) for Queue Depth")
- void setMaximumQueueDepth(Long value) throws IOException;
-
-
-
- //********** Operations *****************//
-
-
- /**
- * Returns a subset of all the messages stored in the queue. The messages
- * are returned based on the given index numbers.
- * @param fromIndex
- * @param toIndex
- * @return
- * @throws IOException
- * @throws JMException
- */
- @MBeanOperation(name="viewMessages",
- description="Message headers for messages in this queue within given index range. eg. from index 1 - 100")
- TabularData viewMessages(@MBeanOperationParameter(name="from index", description="from index")int fromIndex,
- @MBeanOperationParameter(name="to index", description="to index")int toIndex)
- throws IOException, JMException, AMQException;
-
- @MBeanOperation(name="viewMessageContent", description="The message content for given Message Id")
- CompositeData viewMessageContent(@MBeanOperationParameter(name="Message Id", description="Message Id")long messageId)
- throws IOException, JMException;
-
- /**
- * Deletes the first message from top.
- * @throws IOException
- * @throws JMException
- */
- @MBeanOperation(name="deleteMessageFromTop", description="Deletes the first message from top",
- impact= MBeanOperationInfo.ACTION)
- void deleteMessageFromTop() throws IOException, JMException;
-
- /**
- * Clears the queue by deleting all the undelivered messages from the queue.
- * @throws IOException
- * @throws JMException
- */
- @MBeanOperation(name="clearQueue",
- description="Clears the queue by deleting all the undelivered messages from the queue",
- impact= MBeanOperationInfo.ACTION)
- void clearQueue() throws IOException, JMException;
-
- /**
- * Moves the messages in given range of message Ids to given Queue. QPID-170
- * @param fromMessageId first in the range of message ids
- * @param toMessageId last in the range of message ids
- * @param toQueue where the messages are to be moved
- * @throws IOException
- * @throws JMException
- * @throws AMQException
- */
- @MBeanOperation(name="moveMessages",
- description="You can move messages to another queue from this queue ",
- impact= MBeanOperationInfo.ACTION)
- void moveMessages(@MBeanOperationParameter(name="from MessageId", description="from MessageId")long fromMessageId,
- @MBeanOperationParameter(name="to MessageId", description="to MessageId")long toMessageId,
- @MBeanOperationParameter(name= ManagedQueue.TYPE, description="to Queue Name")String toQueue)
- throws IOException, JMException, AMQException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java
deleted file mode 100644
index 090096d3c3..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-
-/**
- * MessageCleanupException represents the failure to perform reference counting on messages correctly. This should not
- * happen, but there may be programming errors giving race conditions that cause the reference counting to go wrong.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Signals that the reference count of a message has gone below zero.
- * <tr><td> Indicates that a message store has lost a message which is still referenced.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- *
- * @todo The race conditions leading to this error should be cleaned up, and a runtime exception used instead. If the
- * message store loses messages, then something is seriously wrong and it would be sensible to terminate the
- * broker. This may be disguising out of memory errors.
- */
-public class MessageCleanupException extends AMQException
-{
- public MessageCleanupException(long messageId, AMQException e)
- {
- super("Failed to cleanup message with id " + messageId, e);
- }
-
- public MessageCleanupException(String message)
- {
- super(message);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageHandleFactory.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageHandleFactory.java
deleted file mode 100644
index 0b214ca336..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageHandleFactory.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.server.store.MessageStore;
-
-/**
- * Constructs a message handle based on the publish body, the content header and the queue to which the message
- * has been routed.
- *
- * @author Robert Greig (robert.j.greig@jpmorgan.com)
- */
-public class MessageHandleFactory
-{
-
- public AMQMessageHandle createMessageHandle(Long messageId, MessageStore store, boolean persistent)
- {
- // just hardcoded for now
- if (persistent)
- {
- return new WeakReferenceMessageHandle(messageId, store);
- }
- else
- {
- return new InMemoryMessageHandle(messageId);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageMetaData.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageMetaData.java
deleted file mode 100644
index 6118a4c11f..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/MessageMetaData.java
+++ /dev/null
@@ -1,92 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-
-/**
- * Encapsulates a publish body and a content header. In the context of the message store these are treated as a
- * single unit.
- */
-public class MessageMetaData
-{
- private MessagePublishInfo _messagePublishInfo;
-
- private ContentHeaderBody _contentHeaderBody;
-
- private int _contentChunkCount;
-
- private long _arrivalTime;
-
- public MessageMetaData(MessagePublishInfo publishBody, ContentHeaderBody contentHeaderBody, int contentChunkCount)
- {
- this(publishBody,contentHeaderBody, contentChunkCount, System.currentTimeMillis());
- }
-
- public MessageMetaData(MessagePublishInfo publishBody, ContentHeaderBody contentHeaderBody, int contentChunkCount, long arrivalTime)
- {
- _contentHeaderBody = contentHeaderBody;
- _messagePublishInfo = publishBody;
- _contentChunkCount = contentChunkCount;
- _arrivalTime = arrivalTime;
- }
-
- public int getContentChunkCount()
- {
- return _contentChunkCount;
- }
-
- public void setContentChunkCount(int contentChunkCount)
- {
- _contentChunkCount = contentChunkCount;
- }
-
- public ContentHeaderBody getContentHeaderBody()
- {
- return _contentHeaderBody;
- }
-
- public void setContentHeaderBody(ContentHeaderBody contentHeaderBody)
- {
- _contentHeaderBody = contentHeaderBody;
- }
-
- public MessagePublishInfo getMessagePublishInfo()
- {
- return _messagePublishInfo;
- }
-
- public void setMessagePublishInfo(MessagePublishInfo messagePublishInfo)
- {
- _messagePublishInfo = messagePublishInfo;
- }
-
- public long getArrivalTime()
- {
- return _arrivalTime;
- }
-
- public void setArrivalTime(long arrivalTime)
- {
- _arrivalTime = arrivalTime;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java
deleted file mode 100644
index d6fd1eec89..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java
+++ /dev/null
@@ -1,47 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.RequiredDeliveryException;
-
-/**
- * NoConsumersException is a {@link RequiredDeliveryException} that represents the failure case where an immediate
- * message cannot be delivered because there are presently no consumers for the message. The AMQP status code, 313, is
- * always used to report this condition.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent failure to deliver a message that must be delivered.
- * </table>
- */
-public class NoConsumersException extends RequiredDeliveryException
-{
- public NoConsumersException(AMQMessage message)
- {
- super("Immediate delivery is not possible.", message);
- }
-
- public AMQConstant getReplyCode()
- {
- return AMQConstant.NO_CONSUMERS;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java
deleted file mode 100644
index 6f9efd3200..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-
-public enum NotificationCheck
-{
-
- MESSAGE_COUNT_ALERT
- {
- boolean notifyIfNecessary(AMQMessage msg, AMQQueue queue, QueueNotificationListener listener)
- {
- int msgCount;
- final long maximumMessageCount = queue.getMaximumMessageCount();
- if (maximumMessageCount!= 0 && (msgCount = queue.getMessageCount()) >= maximumMessageCount)
- {
- listener.notifyClients(this, queue, msgCount + ": Maximum count on queue threshold ("+ maximumMessageCount +") breached.");
- return true;
- }
- return false;
- }
- },
- MESSAGE_SIZE_ALERT(true)
- {
- boolean notifyIfNecessary(AMQMessage msg, AMQQueue queue, QueueNotificationListener listener)
- {
- final long maximumMessageSize = queue.getMaximumMessageSize();
- if(maximumMessageSize != 0)
- {
- // Check for threshold message size
- long messageSize;
- try
- {
- messageSize = (msg == null) ? 0 : msg.getContentHeaderBody().bodySize;
- }
- catch (AMQException e)
- {
- messageSize = 0;
- }
-
-
- if (messageSize >= maximumMessageSize)
- {
- listener.notifyClients(this, queue, messageSize + "b : Maximum message size threshold ("+ maximumMessageSize +") breached. [Message ID=" + msg.getMessageId() + "]");
- return true;
- }
- }
- return false;
- }
-
- },
- QUEUE_DEPTH_ALERT
- {
- boolean notifyIfNecessary(AMQMessage msg, AMQQueue queue, QueueNotificationListener listener)
- {
- // Check for threshold queue depth in bytes
- final long maximumQueueDepth = queue.getMaximumQueueDepth();
-
- if(maximumQueueDepth != 0)
- {
- final long queueDepth = queue.getQueueDepth();
-
- if (queueDepth >= maximumQueueDepth)
- {
- listener.notifyClients(this, queue, (queueDepth>>10) + "Kb : Maximum queue depth threshold ("+(maximumQueueDepth>>10)+"Kb) breached.");
- return true;
- }
- }
- return false;
- }
-
- },
- MESSAGE_AGE_ALERT
- {
- boolean notifyIfNecessary(AMQMessage msg, AMQQueue queue, QueueNotificationListener listener)
- {
-
- final long maxMessageAge = queue.getMaximumMessageAge();
- if(maxMessageAge != 0)
- {
- final long currentTime = System.currentTimeMillis();
- final long thresholdTime = currentTime - maxMessageAge;
- final long firstArrivalTime = queue.getOldestMessageArrivalTime();
-
- if(firstArrivalTime < thresholdTime)
- {
- long oldestAge = currentTime - firstArrivalTime;
- listener.notifyClients(this, queue, (oldestAge/1000) + "s : Maximum age on queue threshold ("+(maxMessageAge /1000)+"s) breached.");
-
- return true;
- }
- }
- return false;
-
- }
-
- }
- ;
-
- private final boolean _messageSpecific;
-
- NotificationCheck()
- {
- this(false);
- }
-
- NotificationCheck(boolean messageSpecific)
- {
- _messageSpecific = messageSpecific;
- }
-
- public boolean isMessageSpecific()
- {
- return _messageSpecific;
- }
-
- abstract boolean notifyIfNecessary(AMQMessage msg, AMQQueue queue, QueueNotificationListener listener);
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/PriorityQueueList.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/PriorityQueueList.java
deleted file mode 100644
index fd46a8a5ff..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/PriorityQueueList.java
+++ /dev/null
@@ -1,169 +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.
-*
-*/
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.CommonContentHeaderProperties;
-import org.apache.qpid.AMQException;
-
-public class PriorityQueueList implements QueueEntryList
-{
- private final AMQQueue _queue;
- private final QueueEntryList[] _priorityLists;
- private final int _priorities;
- private final int _priorityOffset;
-
- public PriorityQueueList(AMQQueue queue, int priorities)
- {
- _queue = queue;
- _priorityLists = new QueueEntryList[priorities];
- _priorities = priorities;
- _priorityOffset = 5-((priorities + 1)/2);
- for(int i = 0; i < priorities; i++)
- {
- _priorityLists[i] = new SimpleQueueEntryList(queue);
- }
- }
-
- public int getPriorities()
- {
- return _priorities;
- }
-
- public AMQQueue getQueue()
- {
- return _queue;
- }
-
- public QueueEntry add(AMQMessage message)
- {
- try
- {
- int index = ((CommonContentHeaderProperties)((message.getContentHeaderBody().properties))).getPriority() - _priorityOffset;
- if(index >= _priorities)
- {
- index = _priorities-1;
- }
- else if(index < 0)
- {
- index = 0;
- }
- return _priorityLists[index].add(message);
- }
- catch (AMQException e)
- {
- // TODO - fix AMQ Exception
- throw new RuntimeException(e);
- }
-
- }
-
- public QueueEntry next(QueueEntry node)
- {
- QueueEntryImpl nodeImpl = (QueueEntryImpl)node;
- QueueEntry next = nodeImpl.getNext();
-
- if(next == null)
- {
- QueueEntryList nodeEntryList = nodeImpl.getQueueEntryList();
- int index;
- for(index = _priorityLists.length-1; _priorityLists[index] != nodeEntryList; index--);
-
- while(next == null && index != 0)
- {
- index--;
- next = ((QueueEntryImpl)_priorityLists[index].getHead()).getNext();
- }
-
- }
- return next;
- }
-
- private final class PriorityQueueEntryListIterator implements QueueEntryIterator
- {
- private final QueueEntryIterator[] _iterators = new QueueEntryIterator[ _priorityLists.length ];
- private QueueEntry _lastNode;
-
- PriorityQueueEntryListIterator()
- {
- for(int i = 0; i < _priorityLists.length; i++)
- {
- _iterators[i] = _priorityLists[i].iterator();
- }
- _lastNode = _iterators[_iterators.length - 1].getNode();
- }
-
-
- public boolean atTail()
- {
- for(int i = 0; i < _iterators.length; i++)
- {
- if(!_iterators[i].atTail())
- {
- return false;
- }
- }
- return true;
- }
-
- public QueueEntry getNode()
- {
- return _lastNode;
- }
-
- public boolean advance()
- {
- for(int i = _iterators.length-1; i >= 0; i--)
- {
- if(_iterators[i].advance())
- {
- _lastNode = _iterators[i].getNode();
- return true;
- }
- }
- return false;
- }
- }
-
- public QueueEntryIterator iterator()
- {
- return new PriorityQueueEntryListIterator();
- }
-
- public QueueEntry getHead()
- {
- return _priorityLists[_priorities-1].getHead();
- }
-
- static class Factory implements QueueEntryListFactory
- {
- private final int _priorities;
-
- Factory(int priorities)
- {
- _priorities = priorities;
- }
-
- public QueueEntryList createQueueEntryList(AMQQueue queue)
- {
- return new PriorityQueueList(queue, _priorities);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java
deleted file mode 100644
index 2657c459a9..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntry.java
+++ /dev/null
@@ -1,184 +0,0 @@
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.subscription.Subscription;
-
-/*
-*
-* 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.
-*
-*/
-public interface QueueEntry extends Comparable<QueueEntry>
-{
-
-
-
- public static enum State
- {
- AVAILABLE,
- ACQUIRED,
- EXPIRED,
- DEQUEUED,
- DELETED
- }
-
- public static interface StateChangeListener
- {
- public void stateChanged(QueueEntry entry, State oldSate, State newState);
- }
-
- public abstract class EntryState
- {
- private EntryState()
- {
- }
-
- public abstract State getState();
- }
-
-
- public final class AvailableState extends EntryState
- {
-
- public State getState()
- {
- return State.AVAILABLE;
- }
- }
-
-
- public final class DequeuedState extends EntryState
- {
-
- public State getState()
- {
- return State.DEQUEUED;
- }
- }
-
-
- public final class DeletedState extends EntryState
- {
-
- public State getState()
- {
- return State.DELETED;
- }
- }
-
- public final class ExpiredState extends EntryState
- {
-
- public State getState()
- {
- return State.EXPIRED;
- }
- }
-
-
- public final class NonSubscriptionAcquiredState extends EntryState
- {
- public State getState()
- {
- return State.ACQUIRED;
- }
- }
-
- public final class SubscriptionAcquiredState extends EntryState
- {
- private final Subscription _subscription;
-
- public SubscriptionAcquiredState(Subscription subscription)
- {
- _subscription = subscription;
- }
-
-
- public State getState()
- {
- return State.ACQUIRED;
- }
-
- public Subscription getSubscription()
- {
- return _subscription;
- }
- }
-
-
- final static EntryState AVAILABLE_STATE = new AvailableState();
- final static EntryState DELETED_STATE = new DeletedState();
- final static EntryState DEQUEUED_STATE = new DequeuedState();
- final static EntryState EXPIRED_STATE = new ExpiredState();
- final static EntryState NON_SUBSCRIPTION_ACQUIRED_STATE = new NonSubscriptionAcquiredState();
-
-
-
-
- AMQQueue getQueue();
-
- AMQMessage getMessage();
-
- long getSize();
-
- boolean getDeliveredToConsumer();
-
- boolean expired() throws AMQException;
-
- boolean isAcquired();
-
- boolean acquire();
- boolean acquire(Subscription sub);
-
- boolean delete();
- boolean isDeleted();
-
- boolean acquiredBySubscription();
-
- void setDeliveredToSubscription();
-
- void release();
-
- String debugIdentity();
-
- boolean immediateAndNotDelivered();
-
- void setRedelivered(boolean b);
-
- Subscription getDeliveredSubscription();
-
- void reject();
-
- void reject(Subscription subscription);
-
- boolean isRejectedBy(Subscription subscription);
-
- void requeue(StoreContext storeContext) throws AMQException;
-
- void dequeue(final StoreContext storeContext) throws FailedDequeueException;
-
- void dispose(final StoreContext storeContext) throws MessageCleanupException;
-
- void discard(StoreContext storeContext) throws FailedDequeueException, MessageCleanupException;
-
- boolean isQueueDeleted();
-
- void addStateChangeListener(StateChangeListener listener);
- boolean removeStateChangeListener(StateChangeListener listener);
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
deleted file mode 100644
index dbad5438dc..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryImpl.java
+++ /dev/null
@@ -1,388 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.log4j.Logger;
-
-import java.util.Set;
-import java.util.HashSet;
-import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
-import java.util.concurrent.atomic.AtomicLongFieldUpdater;
-import java.util.concurrent.CopyOnWriteArraySet;
-
-
-public class QueueEntryImpl implements QueueEntry
-{
-
- /**
- * Used for debugging purposes.
- */
- private static final Logger _log = Logger.getLogger(QueueEntryImpl.class);
-
- private final SimpleQueueEntryList _queueEntryList;
-
- private AMQMessage _message;
-
-
- private Set<Subscription> _rejectedBy = null;
-
- private volatile EntryState _state = AVAILABLE_STATE;
-
- private static final
- AtomicReferenceFieldUpdater<QueueEntryImpl, EntryState>
- _stateUpdater =
- AtomicReferenceFieldUpdater.newUpdater
- (QueueEntryImpl.class, EntryState.class, "_state");
-
-
- private volatile Set<StateChangeListener> _stateChangeListeners;
-
- private static final
- AtomicReferenceFieldUpdater<QueueEntryImpl, Set>
- _listenersUpdater =
- AtomicReferenceFieldUpdater.newUpdater
- (QueueEntryImpl.class, Set.class, "_stateChangeListeners");
-
-
- private static final
- AtomicLongFieldUpdater<QueueEntryImpl>
- _entryIdUpdater =
- AtomicLongFieldUpdater.newUpdater
- (QueueEntryImpl.class, "_entryId");
-
-
- private volatile long _entryId;
-
- volatile QueueEntryImpl _next;
-
-
- QueueEntryImpl(SimpleQueueEntryList queueEntryList)
- {
- this(queueEntryList,null,Long.MIN_VALUE);
- _state = DELETED_STATE;
- }
-
-
- public QueueEntryImpl(SimpleQueueEntryList queueEntryList, AMQMessage message, final long entryId)
- {
- _queueEntryList = queueEntryList;
- _message = message;
-
- _entryIdUpdater.set(this, entryId);
- }
-
- public QueueEntryImpl(SimpleQueueEntryList queueEntryList, AMQMessage message)
- {
- _queueEntryList = queueEntryList;
- _message = message;
- }
-
- protected void setEntryId(long entryId)
- {
- _entryIdUpdater.set(this, entryId);
- }
-
- protected long getEntryId()
- {
- return _entryId;
- }
-
- public AMQQueue getQueue()
- {
- return _queueEntryList.getQueue();
- }
-
- public AMQMessage getMessage()
- {
- return _message;
- }
-
- public long getSize()
- {
- return getMessage().getSize();
- }
-
- public boolean getDeliveredToConsumer()
- {
- return getMessage().getDeliveredToConsumer();
- }
-
- public boolean expired() throws AMQException
- {
- return getMessage().expired(getQueue());
- }
-
- public boolean isAcquired()
- {
- return _state.getState() == State.ACQUIRED;
- }
-
- public boolean acquire()
- {
- return acquire(NON_SUBSCRIPTION_ACQUIRED_STATE);
- }
-
- private boolean acquire(final EntryState state)
- {
- boolean acquired = _stateUpdater.compareAndSet(this,AVAILABLE_STATE, state);
- if(acquired && _stateChangeListeners != null)
- {
- notifyStateChange(State.AVAILABLE, State.ACQUIRED);
- }
-
- return acquired;
- }
-
- public boolean acquire(Subscription sub)
- {
- return acquire(sub.getOwningState());
- }
-
- public boolean acquiredBySubscription()
- {
-
- return (_state instanceof SubscriptionAcquiredState);
- }
-
- public void setDeliveredToSubscription()
- {
- getMessage().setDeliveredToConsumer();
- }
-
- public void release()
- {
- _stateUpdater.set(this,AVAILABLE_STATE);
- }
-
- public String debugIdentity()
- {
- return getMessage().debugIdentity();
- }
-
-
- public boolean immediateAndNotDelivered()
- {
- return _message.immediateAndNotDelivered();
- }
-
- public void setRedelivered(boolean b)
- {
- getMessage().setRedelivered(b);
- }
-
- public Subscription getDeliveredSubscription()
- {
- EntryState state = _state;
- if (state instanceof SubscriptionAcquiredState)
- {
- return ((SubscriptionAcquiredState) state).getSubscription();
- }
- else
- {
- return null;
- }
-
- }
-
- public void reject()
- {
- reject(getDeliveredSubscription());
- }
-
- public void reject(Subscription subscription)
- {
- if (subscription != null)
- {
- if (_rejectedBy == null)
- {
- _rejectedBy = new HashSet<Subscription>();
- }
-
- _rejectedBy.add(subscription);
- }
- else
- {
- _log.warn("Requesting rejection by null subscriber:" + debugIdentity());
- }
- }
-
- public boolean isRejectedBy(Subscription subscription)
- {
-
- if (_rejectedBy != null) // We have subscriptions that rejected this message
- {
- return _rejectedBy.contains(subscription);
- }
- else // This messasge hasn't been rejected yet.
- {
- return false;
- }
- }
-
-
- public void requeue(final StoreContext storeContext) throws AMQException
- {
- getQueue().requeue(storeContext, this);
- if(_stateChangeListeners != null)
- {
- notifyStateChange(QueueEntry.State.ACQUIRED, QueueEntry.State.AVAILABLE);
- }
- }
-
- public void dequeue(final StoreContext storeContext) throws FailedDequeueException
- {
- EntryState state = _state;
-
- if((state.getState() == State.ACQUIRED) &&_stateUpdater.compareAndSet(this, state, DEQUEUED_STATE))
- {
- if (state instanceof SubscriptionAcquiredState)
- {
- Subscription s = ((SubscriptionAcquiredState) state).getSubscription();
- s.restoreCredit(this);
- }
-
- getQueue().dequeue(storeContext, this);
- if(_stateChangeListeners != null)
- {
- notifyStateChange(state.getState() , QueueEntry.State.DEQUEUED);
- }
-
- }
-
- }
-
- private void notifyStateChange(final State oldState, final State newState)
- {
- for(StateChangeListener l : _stateChangeListeners)
- {
- l.stateChanged(this, oldState, newState);
- }
- }
-
- public void dispose(final StoreContext storeContext) throws MessageCleanupException
- {
- if(delete())
- {
- getMessage().decrementReference(storeContext);
- }
- }
-
- public void discard(StoreContext storeContext) throws FailedDequeueException, MessageCleanupException
- {
- //if the queue is null then the message is waiting to be acked, but has been removed.
- if (getQueue() != null)
- {
- dequeue(storeContext);
- }
-
- dispose(storeContext);
- }
-
- public boolean isQueueDeleted()
- {
- return getQueue().isDeleted();
- }
-
- public void addStateChangeListener(StateChangeListener listener)
- {
- Set<StateChangeListener> listeners = _stateChangeListeners;
- if(listeners == null)
- {
- _listenersUpdater.compareAndSet(this, null, new CopyOnWriteArraySet<StateChangeListener>());
- listeners = _stateChangeListeners;
- }
-
- listeners.add(listener);
- }
-
- public boolean removeStateChangeListener(StateChangeListener listener)
- {
- Set<StateChangeListener> listeners = _stateChangeListeners;
- if(listeners != null)
- {
- return listeners.remove(listener);
- }
-
- return false;
- }
-
-
- public int compareTo(final QueueEntry o)
- {
- QueueEntryImpl other = (QueueEntryImpl)o;
- return getEntryId() > other.getEntryId() ? 1 : getEntryId() < other.getEntryId() ? -1 : 0;
- }
-
- public QueueEntryImpl getNext()
- {
-
- QueueEntryImpl next = nextNode();
- while(next != null && next.isDeleted())
- {
-
- final QueueEntryImpl newNext = next.nextNode();
- if(newNext != null)
- {
- SimpleQueueEntryList._nextUpdater.compareAndSet(this,next, newNext);
- next = nextNode();
- }
- else
- {
- next = null;
- }
-
- }
- return next;
- }
-
- QueueEntryImpl nextNode()
- {
- return _next;
- }
-
- public boolean isDeleted()
- {
- return _state == DELETED_STATE;
- }
-
- public boolean delete()
- {
- EntryState state = _state;
-
- if(state != DELETED_STATE && _stateUpdater.compareAndSet(this,state,DELETED_STATE))
- {
- _queueEntryList.advanceHead();
- return true;
- }
- else
- {
- return false;
- }
- }
-
- public QueueEntryList getQueueEntryList()
- {
- return _queueEntryList;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryIterator.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryIterator.java
deleted file mode 100644
index c5c115a2d1..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryIterator.java
+++ /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.
-*
-*/
-package org.apache.qpid.server.queue;
-
-public interface QueueEntryIterator
-{
- boolean atTail();
-
- QueueEntry getNode();
-
- boolean advance();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryList.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryList.java
deleted file mode 100644
index 313e076f61..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryList.java
+++ /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.
-*
-*/
-package org.apache.qpid.server.queue;
-
-public interface QueueEntryList
-{
- AMQQueue getQueue();
-
- QueueEntry add(AMQMessage message);
-
- QueueEntry next(QueueEntry node);
-
- QueueEntryIterator iterator();
-
- QueueEntry getHead();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryListFactory.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryListFactory.java
deleted file mode 100644
index 4dbce45f67..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueEntryListFactory.java
+++ /dev/null
@@ -1,26 +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.
-*
-*/
-package org.apache.qpid.server.queue;
-
-interface QueueEntryListFactory
-{
- public QueueEntryList createQueueEntryList(AMQQueue queue);
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueNotificationListener.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueNotificationListener.java
deleted file mode 100644
index 959ca03c80..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueNotificationListener.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-
-public interface QueueNotificationListener
-{
- void notifyClients(NotificationCheck notification, AMQQueue queue, String notificationMsg);
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java
deleted file mode 100644
index 1210f0e97c..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java
+++ /dev/null
@@ -1,43 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.util.Collection;
-
-public interface QueueRegistry
-{
- VirtualHost getVirtualHost();
-
- void registerQueue(AMQQueue queue) throws AMQException;
-
- void unregisterQueue(AMQShortString name) throws AMQException;
-
- AMQQueue getQueue(AMQShortString name);
-
- Collection<AMQShortString> getQueueNames();
-
- Collection<AMQQueue> getQueues();
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
deleted file mode 100644
index 7e7e8b2114..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
+++ /dev/null
@@ -1,1604 +0,0 @@
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.configuration.Configurator;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.subscription.SubscriptionList;
-import org.apache.qpid.server.output.ProtocolOutputConverter;
-import org.apache.qpid.server.management.ManagedObject;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.pool.ReadWriteRunnable;
-import org.apache.qpid.pool.ReferenceCountingExecutorService;
-import org.apache.qpid.configuration.Configured;
-import org.apache.commons.configuration.Configuration;
-import org.apache.log4j.Logger;
-
-import javax.management.JMException;
-import java.util.List;
-import java.util.Set;
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.Executor;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicReference;
-
-/*
-*
-* 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.
-*
-*/
-public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener
-{
- private static final Logger _logger = Logger.getLogger(SimpleAMQQueue.class);
-
- private final AMQShortString _name;
-
- /** null means shared */
- private final AMQShortString _owner;
-
- private final boolean _durable;
-
- /** If true, this queue is deleted when the last subscriber is removed */
- private final boolean _autoDelete;
-
- private final VirtualHost _virtualHost;
-
- /** Used to track bindings to exchanges so that on deletion they can easily be cancelled. */
- private final ExchangeBindings _bindings = new ExchangeBindings(this);
-
- private final AtomicBoolean _deleted = new AtomicBoolean(false);
-
- private final List<Task> _deleteTaskList = new CopyOnWriteArrayList<Task>();
-
- private final AtomicInteger _atomicQueueCount = new AtomicInteger(0);
-
- private final AtomicLong _atomicQueueSize = new AtomicLong(0L);
-
- private final AtomicInteger _activeSubscriberCount = new AtomicInteger();
-
- protected final SubscriptionList _subscriptionList = new SubscriptionList(this);
- private final AtomicReference<SubscriptionList.SubscriptionNode> _lastSubscriptionNode = new AtomicReference<SubscriptionList.SubscriptionNode>(_subscriptionList.getHead());
-
- private volatile Subscription _exclusiveSubscriber;
-
- protected final QueueEntryList _entries;
-
- private final AMQQueueMBean _managedObject;
- private final Executor _asyncDelivery;
- private final AtomicLong _totalMessagesReceived = new AtomicLong();
-
- /** max allowed size(KB) of a single message */
- @Configured(path = "maximumMessageSize", defaultValue = "0")
- public long _maximumMessageSize;
-
- /** max allowed number of messages on a queue. */
- @Configured(path = "maximumMessageCount", defaultValue = "0")
- public long _maximumMessageCount;
-
- /** max queue depth for the queue */
- @Configured(path = "maximumQueueDepth", defaultValue = "0")
- public long _maximumQueueDepth;
-
- /** maximum message age before alerts occur */
- @Configured(path = "maximumMessageAge", defaultValue = "0")
- public long _maximumMessageAge;
-
- /** the minimum interval between sending out consequetive alerts of the same type */
- @Configured(path = "minimumAlertRepeatGap", defaultValue = "0")
- public long _minimumAlertRepeatGap;
-
- private static final int MAX_ASYNC_DELIVERIES = 10;
-
- private final Set<NotificationCheck> _notificationChecks = EnumSet.noneOf(NotificationCheck.class);
-
- private final AtomicLong _stateChangeCount = new AtomicLong(Long.MIN_VALUE);
- private AtomicReference _asynchronousRunner = new AtomicReference(null);
- private AtomicInteger _deliveredMessages = new AtomicInteger();
- private AtomicBoolean _stopped = new AtomicBoolean(false);
-
- protected SimpleAMQQueue(AMQShortString name, boolean durable, AMQShortString owner, boolean autoDelete, VirtualHost virtualHost)
- throws AMQException
- {
- this(name, durable, owner, autoDelete, virtualHost, new SimpleQueueEntryList.Factory());
- }
-
- protected SimpleAMQQueue(AMQShortString name,
- boolean durable,
- AMQShortString owner,
- boolean autoDelete,
- VirtualHost virtualHost,
- QueueEntryListFactory entryListFactory)
- throws AMQException
- {
-
- if (name == null)
- {
- throw new IllegalArgumentException("Queue name must not be null");
- }
-
- if (virtualHost == null)
- {
- throw new IllegalArgumentException("Virtual Host must not be null");
- }
-
- _name = name;
- _durable = durable;
- _owner = owner;
- _autoDelete = autoDelete;
- _virtualHost = virtualHost;
- _entries = entryListFactory.createQueueEntryList(this);
-
- _asyncDelivery = ReferenceCountingExecutorService.getInstance().acquireExecutorService();
-
- try
- {
- _managedObject = new AMQQueueMBean(this);
- _managedObject.register();
- }
- catch (JMException e)
- {
- throw new AMQException("AMQQueue MBean creation has failed ", e);
- }
-
- resetNotifications();
-
- }
-
- private void resetNotifications()
- {
- // This ensure that the notification checks for the configured alerts are created.
- setMaximumMessageAge(_maximumMessageAge);
- setMaximumMessageCount(_maximumMessageCount);
- setMaximumMessageSize(_maximumMessageSize);
- setMaximumQueueDepth(_maximumQueueDepth);
- }
-
- // ------ Getters and Setters
-
- public AMQShortString getName()
- {
- return _name;
- }
-
- public boolean isDurable()
- {
- return _durable;
- }
-
- public boolean isAutoDelete()
- {
- return _autoDelete;
- }
-
- public AMQShortString getOwner()
- {
- return _owner;
- }
-
- public VirtualHost getVirtualHost()
- {
- return _virtualHost;
- }
-
- // ------ bind and unbind
-
- public void bind(Exchange exchange, AMQShortString routingKey, FieldTable arguments) throws AMQException
- {
- exchange.registerQueue(routingKey, this, arguments);
- if (isDurable() && exchange.isDurable())
- {
- _virtualHost.getMessageStore().bindQueue(exchange, routingKey, this, arguments);
- }
-
- _bindings.addBinding(routingKey, arguments, exchange);
- }
-
- public void unBind(Exchange exchange, AMQShortString routingKey, FieldTable arguments) throws AMQException
- {
- exchange.deregisterQueue(routingKey, this, arguments);
- if (isDurable() && exchange.isDurable())
- {
- _virtualHost.getMessageStore().unbindQueue(exchange, routingKey, this, arguments);
- }
-
- boolean removed = _bindings.remove(routingKey, arguments, exchange);
- if (!removed)
- {
- _logger.error("Mismatch between queue bindings and exchange record of bindings");
- }
- }
-
- public List<ExchangeBinding> getExchangeBindings()
- {
- return new ArrayList<ExchangeBinding>(_bindings.getExchangeBindings());
- }
-
- // ------ Manage Subscriptions
-
- public synchronized void registerSubscription(final Subscription subscription, final boolean exclusive) throws AMQException
- {
-
- if (isExclusiveSubscriber())
- {
- throw new ExistingExclusiveSubscription();
- }
-
- if (exclusive)
- {
- if (getConsumerCount() != 0)
- {
- throw new ExistingSubscriptionPreventsExclusive();
- }
- else
- {
- _exclusiveSubscriber = subscription;
-
- }
- }
-
- _activeSubscriberCount.incrementAndGet();
- subscription.setStateListener(this);
- subscription.setLastSeenEntry(null, _entries.getHead());
-
- if (!isDeleted())
- {
- subscription.setQueue(this);
- _subscriptionList.add(subscription);
- if (isDeleted())
- {
- subscription.queueDeleted(this);
- }
- }
- else
- {
- // TODO
- }
-
- deliverAsync(subscription);
-
- }
-
- public synchronized void unregisterSubscription(final Subscription subscription) throws AMQException
- {
- if (subscription == null)
- {
- throw new NullPointerException("subscription argument is null");
- }
-
- boolean removed = _subscriptionList.remove(subscription);
-
- if (removed)
- {
- subscription.close();
- // No longer can the queue have an exclusive consumer
- setExclusiveSubscriber(null);
-
- QueueEntry lastSeen;
-
- while ((lastSeen = subscription.getLastSeenEntry()) != null)
- {
- subscription.setLastSeenEntry(lastSeen, null);
- }
-
- // auto-delete queues must be deleted if there are no remaining subscribers
-
- if (_autoDelete && getConsumerCount() == 0)
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Auto-deleteing queue:" + this);
- }
-
- delete();
-
- // we need to manually fire the event to the removed subscription (which was the last one left for this
- // queue. This is because the delete method uses the subscription set which has just been cleared
- subscription.queueDeleted(this);
- }
- }
-
- }
-
- // ------ Enqueue / Dequeue
-
- public QueueEntry enqueue(StoreContext storeContext, AMQMessage message) throws AMQException
- {
-
- incrementQueueCount();
- incrementQueueSize(message);
-
- _totalMessagesReceived.incrementAndGet();
-
- QueueEntry entry;
- Subscription exclusiveSub = _exclusiveSubscriber;
-
- if (exclusiveSub != null)
- {
- exclusiveSub.getSendLock();
-
- try
- {
- entry = _entries.add(message);
-
- deliverToSubscription(exclusiveSub, entry);
-
- // where there is more than one producer there's a reasonable chance that even though there is
- // no "queueing" we do not deliver because we get an interleving of _entries.add and
- // deliverToSubscription between threads. Therefore have one more try.
- if (!(entry.isAcquired() || entry.isDeleted()))
- {
- deliverToSubscription(exclusiveSub, entry);
- }
- }
- finally
- {
- exclusiveSub.releaseSendLock();
- }
- }
- else
- {
- entry = _entries.add(message);
- /*
-
- iterate over subscriptions and if any is at the end of the queue and can deliver this message, then deliver the message
-
- */
- SubscriptionList.SubscriptionNode node = _lastSubscriptionNode.get();
- SubscriptionList.SubscriptionNode nextNode = node.getNext();
- if (nextNode == null)
- {
- nextNode = _subscriptionList.getHead().getNext();
- }
- while (nextNode != null)
- {
- if (_lastSubscriptionNode.compareAndSet(node, nextNode))
- {
- break;
- }
- else
- {
- node = _lastSubscriptionNode.get();
- nextNode = node.getNext();
- if (nextNode == null)
- {
- nextNode = _subscriptionList.getHead().getNext();
- }
- }
- }
-
- // always do one extra loop after we believe we've finished
- // this catches the case where we *just* miss an update
- int loops = 2;
-
- while (!(entry.isAcquired() || entry.isDeleted()) && loops != 0)
- {
- if (nextNode == null)
- {
- loops--;
- nextNode = _subscriptionList.getHead();
- }
- else
- {
- // if subscription at end, and active, offer
- Subscription sub = nextNode.getSubscription();
- deliverToSubscription(sub, entry);
- }
- nextNode = nextNode.getNext();
-
- }
- }
-
- if (entry.immediateAndNotDelivered())
- {
- dequeue(storeContext, entry);
- entry.dispose(storeContext);
- }
- else if (!(entry.isAcquired() || entry.isDeleted()))
- {
- checkSubscriptionsNotAheadOfDelivery(entry);
-
- deliverAsync();
- }
-
- try
- {
- _managedObject.checkForNotification(entry.getMessage());
- }
- catch (JMException e)
- {
- throw new AMQException("Unable to get notification from manage queue: " + e, e);
- }
-
- return entry;
-
- }
-
- private void deliverToSubscription(final Subscription sub, final QueueEntry entry)
- throws AMQException
- {
-
- sub.getSendLock();
- try
- {
- if (subscriptionReadyAndHasInterest(sub, entry)
- && !sub.isSuspended())
- {
- if (!sub.wouldSuspend(entry))
- {
- if (!sub.isBrowser() && !entry.acquire(sub))
- {
- // restore credit here that would have been taken away by wouldSuspend since we didn't manage
- // to acquire the entry for this subscription
- sub.restoreCredit(entry);
- }
- else
- {
-
- deliverMessage(sub, entry);
-
- }
- }
- }
- }
- finally
- {
- sub.releaseSendLock();
- }
- }
-
- protected void checkSubscriptionsNotAheadOfDelivery(final QueueEntry entry)
- {
- // This method is only required for queues which mess with ordering
- // Simple Queues don't :-)
- }
-
- private void incrementQueueSize(final AMQMessage message)
- {
- getAtomicQueueSize().addAndGet(message.getSize());
- }
-
- private void incrementQueueCount()
- {
- getAtomicQueueCount().incrementAndGet();
- }
-
- private void deliverMessage(final Subscription sub, final QueueEntry entry)
- throws AMQException
- {
- _deliveredMessages.incrementAndGet();
- sub.send(entry);
-
- }
-
- private boolean subscriptionReadyAndHasInterest(final Subscription sub, final QueueEntry entry)
- {
-
- // We need to move this subscription on, past entries which are already acquired, or deleted or ones it has no
- // interest in.
- QueueEntry node = sub.getLastSeenEntry();
- while (node != null && (node.isAcquired() || node.isDeleted() || !sub.hasInterest(node)))
- {
-
- QueueEntry newNode = _entries.next(node);
- if (newNode != null)
- {
- sub.setLastSeenEntry(node, newNode);
- node = sub.getLastSeenEntry();
- }
- else
- {
- node = null;
- break;
- }
-
- }
-
- if (node == entry)
- {
- // If the first entry that subscription can process is the one we are trying to deliver to it, then we are
- // good
- return true;
- }
- else
- {
- // Otherwise we should try to update the subscription's last seen entry to the entry we got to, providing
- // no-one else has updated it to something furhter on in the list
- //TODO - check
- //updateLastSeenEntry(sub, entry);
- return false;
- }
-
- }
-
- private void updateLastSeenEntry(final Subscription sub, final QueueEntry entry)
- {
- QueueEntry node = sub.getLastSeenEntry();
-
- if (node != null && entry.compareTo(node) < 0 && sub.hasInterest(entry))
- {
- do
- {
- if (sub.setLastSeenEntry(node, entry))
- {
- return;
- }
- else
- {
- node = sub.getLastSeenEntry();
- }
- }
- while (node != null && entry.compareTo(node) < 0);
- }
-
- }
-
- public void requeue(StoreContext storeContext, QueueEntry entry) throws AMQException
- {
-
- SubscriptionList.SubscriptionNodeIterator subscriberIter = _subscriptionList.iterator();
- // iterate over all the subscribers, and if they are in advance of this queue entry then move them backwards
- while (subscriberIter.advance())
- {
- Subscription sub = subscriberIter.getNode().getSubscription();
-
- // we don't make browsers send the same stuff twice
- if (!sub.isBrowser())
- {
- updateLastSeenEntry(sub, entry);
- }
- }
-
- deliverAsync();
-
- }
-
- public void dequeue(StoreContext storeContext, QueueEntry entry) throws FailedDequeueException
- {
- decrementQueueCount();
- decrementQueueSize(entry);
- if (entry.acquiredBySubscription())
- {
- _deliveredMessages.decrementAndGet();
- }
-
- try
- {
- AMQMessage msg = entry.getMessage();
- if (msg.isPersistent())
- {
- _virtualHost.getMessageStore().dequeueMessage(storeContext, this, msg.getMessageId());
- }
- //entry.dispose(storeContext);
-
- }
- catch (MessageCleanupException e)
- {
- // Message was dequeued, but could not then be deleted
- // though it is no longer referenced. This should be very
- // rare and can be detected and cleaned up on recovery or
- // done through some form of manual intervention.
- _logger.error(e, e);
- }
- catch (AMQException e)
- {
- throw new FailedDequeueException(_name.toString(), e);
- }
-
- }
-
- private void decrementQueueSize(final QueueEntry entry)
- {
- getAtomicQueueSize().addAndGet(-entry.getMessage().getSize());
- }
-
- void decrementQueueCount()
- {
- getAtomicQueueCount().decrementAndGet();
- }
-
- public boolean resend(final QueueEntry entry, final Subscription subscription) throws AMQException
- {
- /* TODO : This is wrong as the subscription may be suspended, we should instead change the state of the message
- entry to resend and move back the subscription pointer. */
-
- subscription.getSendLock();
- try
- {
- if (!subscription.isClosed())
- {
- deliverMessage(subscription, entry);
- return true;
- }
- else
- {
- return false;
- }
- }
- finally
- {
- subscription.releaseSendLock();
- }
- }
-
- public int getConsumerCount()
- {
- return _subscriptionList.size();
- }
-
- public int getActiveConsumerCount()
- {
- return _activeSubscriberCount.get();
- }
-
- public boolean isUnused()
- {
- return getConsumerCount() == 0;
- }
-
- public boolean isEmpty()
- {
- return getMessageCount() == 0;
- }
-
- public int getMessageCount()
- {
- return getAtomicQueueCount().get();
- }
-
- public long getQueueDepth()
- {
- return getAtomicQueueSize().get();
- }
-
- public int getUndeliveredMessageCount()
- {
- int count = getMessageCount() - _deliveredMessages.get();
- if (count < 0)
- {
- return 0;
- }
- else
- {
- return count;
- }
- }
-
- public long getReceivedMessageCount()
- {
- return _totalMessagesReceived.get();
- }
-
- public long getOldestMessageArrivalTime()
- {
- QueueEntry entry = getOldestQueueEntry();
- return entry == null ? Long.MAX_VALUE : entry.getMessage().getArrivalTime();
- }
-
- protected QueueEntry getOldestQueueEntry()
- {
- return _entries.next(_entries.getHead());
- }
-
- public boolean isDeleted()
- {
- return _deleted.get();
- }
-
- public List<QueueEntry> getMessagesOnTheQueue()
- {
- ArrayList<QueueEntry> entryList = new ArrayList<QueueEntry>();
- QueueEntryIterator queueListIterator = _entries.iterator();
- while (queueListIterator.advance())
- {
- QueueEntry node = queueListIterator.getNode();
- if (node != null && !node.isDeleted())
- {
- entryList.add(node);
- }
- }
- return entryList;
-
- }
-
- public void stateChange(Subscription sub, Subscription.State oldState, Subscription.State newState)
- {
- if (oldState == Subscription.State.ACTIVE && newState != Subscription.State.ACTIVE)
- {
- _activeSubscriberCount.decrementAndGet();
-
- }
- else if (newState == Subscription.State.ACTIVE)
- {
- if (oldState != Subscription.State.ACTIVE)
- {
- _activeSubscriberCount.incrementAndGet();
-
- }
- deliverAsync(sub);
- }
- }
-
- public int compareTo(final AMQQueue o)
- {
- return _name.compareTo(o.getName());
- }
-
- public AtomicInteger getAtomicQueueCount()
- {
- return _atomicQueueCount;
- }
-
- public AtomicLong getAtomicQueueSize()
- {
- return _atomicQueueSize;
- }
-
- private boolean isExclusiveSubscriber()
- {
- return _exclusiveSubscriber != null;
- }
-
- private void setExclusiveSubscriber(Subscription exclusiveSubscriber)
- {
- _exclusiveSubscriber = exclusiveSubscriber;
- }
-
- public static interface QueueEntryFilter
- {
- public boolean accept(QueueEntry entry);
-
- public boolean filterComplete();
- }
-
- public List<QueueEntry> getMessagesOnTheQueue(final long fromMessageId, final long toMessageId)
- {
- return getMessagesOnTheQueue(new QueueEntryFilter()
- {
-
- public boolean accept(QueueEntry entry)
- {
- final long messageId = entry.getMessage().getMessageId();
- return messageId >= fromMessageId && messageId <= toMessageId;
- }
-
- public boolean filterComplete()
- {
- return false;
- }
- });
- }
-
- public QueueEntry getMessageOnTheQueue(final long messageId)
- {
- List<QueueEntry> entries = getMessagesOnTheQueue(new QueueEntryFilter()
- {
- private boolean _complete;
-
- public boolean accept(QueueEntry entry)
- {
- _complete = entry.getMessage().getMessageId() == messageId;
- return _complete;
- }
-
- public boolean filterComplete()
- {
- return _complete;
- }
- });
- return entries.isEmpty() ? null : entries.get(0);
- }
-
- public List<QueueEntry> getMessagesOnTheQueue(QueueEntryFilter filter)
- {
- ArrayList<QueueEntry> entryList = new ArrayList<QueueEntry>();
- QueueEntryIterator queueListIterator = _entries.iterator();
- while (queueListIterator.advance() && !filter.filterComplete())
- {
- QueueEntry node = queueListIterator.getNode();
- if (!node.isDeleted() && filter.accept(node))
- {
- entryList.add(node);
- }
- }
- return entryList;
-
- }
-
- public void moveMessagesToAnotherQueue(final long fromMessageId,
- final long toMessageId,
- String queueName,
- StoreContext storeContext)
- {
-
- AMQQueue toQueue = getVirtualHost().getQueueRegistry().getQueue(new AMQShortString(queueName));
- MessageStore store = getVirtualHost().getMessageStore();
-
- List<QueueEntry> entries = getMessagesOnTheQueue(new QueueEntryFilter()
- {
-
- public boolean accept(QueueEntry entry)
- {
- final long messageId = entry.getMessage().getMessageId();
- return (messageId >= fromMessageId)
- && (messageId <= toMessageId)
- && entry.acquire();
- }
-
- public boolean filterComplete()
- {
- return false;
- }
- });
-
- try
- {
- store.beginTran(storeContext);
-
- // Move the messages in on the message store.
- for (QueueEntry entry : entries)
- {
- AMQMessage message = entry.getMessage();
-
- if (message.isPersistent() && toQueue.isDurable())
- {
- store.enqueueMessage(storeContext, toQueue, message.getMessageId());
- }
- // dequeue does not decrement the refence count
- entry.dequeue(storeContext);
- }
-
- // Commit and flush the move transcations.
- try
- {
- store.commitTran(storeContext);
- }
- catch (AMQException e)
- {
- throw new RuntimeException("Failed to commit transaction whilst moving messages on message store.", e);
- }
- }
- catch (AMQException e)
- {
- try
- {
- store.abortTran(storeContext);
- }
- catch (AMQException rollbackEx)
- {
- _logger.error("Failed to rollback transaction when error occured moving messages", rollbackEx);
- }
- throw new RuntimeException(e);
- }
-
- try
- {
- for (QueueEntry entry : entries)
- {
- toQueue.enqueue(storeContext, entry.getMessage());
-
- }
- }
- catch (MessageCleanupException e)
- {
- throw new RuntimeException(e);
- }
- catch (AMQException e)
- {
- throw new RuntimeException(e);
- }
-
- }
-
- public void copyMessagesToAnotherQueue(final long fromMessageId,
- final long toMessageId,
- String queueName,
- final StoreContext storeContext)
- {
- AMQQueue toQueue = getVirtualHost().getQueueRegistry().getQueue(new AMQShortString(queueName));
- MessageStore store = getVirtualHost().getMessageStore();
-
- List<QueueEntry> entries = getMessagesOnTheQueue(new QueueEntryFilter()
- {
-
- public boolean accept(QueueEntry entry)
- {
- final long messageId = entry.getMessage().getMessageId();
- if ((messageId >= fromMessageId)
- && (messageId <= toMessageId))
- {
- if (!entry.isDeleted())
- {
- return entry.getMessage().incrementReference();
- }
- }
-
- return false;
- }
-
- public boolean filterComplete()
- {
- return false;
- }
- });
-
- try
- {
- store.beginTran(storeContext);
-
- // Move the messages in on the message store.
- for (QueueEntry entry : entries)
- {
- AMQMessage message = entry.getMessage();
-
- if (message.isReferenced() && message.isPersistent() && toQueue.isDurable())
- {
- store.enqueueMessage(storeContext, toQueue, message.getMessageId());
- }
- }
-
- // Commit and flush the move transcations.
- try
- {
- store.commitTran(storeContext);
- }
- catch (AMQException e)
- {
- throw new RuntimeException("Failed to commit transaction whilst moving messages on message store.", e);
- }
- }
- catch (AMQException e)
- {
- try
- {
- store.abortTran(storeContext);
- }
- catch (AMQException rollbackEx)
- {
- _logger.error("Failed to rollback transaction when error occured moving messages", rollbackEx);
- }
- throw new RuntimeException(e);
- }
-
- try
- {
- for (QueueEntry entry : entries)
- {
- if (entry.getMessage().isReferenced())
- {
- toQueue.enqueue(storeContext, entry.getMessage());
- }
- }
- }
- catch (MessageCleanupException e)
- {
- throw new RuntimeException(e);
- }
- catch (AMQException e)
- {
- throw new RuntimeException(e);
- }
-
- }
-
- public void removeMessagesFromQueue(long fromMessageId, long toMessageId, StoreContext storeContext)
- {
-
- try
- {
- QueueEntryIterator queueListIterator = _entries.iterator();
-
- while (queueListIterator.advance())
- {
- QueueEntry node = queueListIterator.getNode();
-
- final long messageId = node.getMessage().getMessageId();
-
- if ((messageId >= fromMessageId)
- && (messageId <= toMessageId)
- && !node.isDeleted()
- && node.acquire())
- {
- node.discard(storeContext);
- }
-
- }
- }
- catch (AMQException e)
- {
- throw new RuntimeException(e);
- }
-
- }
-
- // ------ Management functions
-
- public void deleteMessageFromTop(StoreContext storeContext) throws AMQException
- {
- QueueEntryIterator queueListIterator = _entries.iterator();
- boolean noDeletes = true;
-
- while (noDeletes && queueListIterator.advance())
- {
- QueueEntry node = queueListIterator.getNode();
- if (!node.isDeleted() && node.acquire())
- {
- node.discard(storeContext);
- noDeletes = false;
- }
-
- }
- }
-
- public long clearQueue(StoreContext storeContext) throws AMQException
- {
-
- QueueEntryIterator queueListIterator = _entries.iterator();
- long count = 0;
-
- while (queueListIterator.advance())
- {
- QueueEntry node = queueListIterator.getNode();
- if (!node.isDeleted() && node.acquire())
- {
- node.discard(storeContext);
- count++;
- }
-
- }
- return count;
-
- }
-
- public void addQueueDeleteTask(final Task task)
- {
- _deleteTaskList.add(task);
- }
-
- public int delete() throws AMQException
- {
- if (!_deleted.getAndSet(true))
- {
-
- SubscriptionList.SubscriptionNodeIterator subscriptionIter = _subscriptionList.iterator();
-
- while (subscriptionIter.advance())
- {
- Subscription s = subscriptionIter.getNode().getSubscription();
- if (s != null)
- {
- s.queueDeleted(this);
- }
- }
-
- _bindings.deregister();
- _virtualHost.getQueueRegistry().unregisterQueue(_name);
-
- _managedObject.unregister();
- for (Task task : _deleteTaskList)
- {
- task.doTask(this);
- }
-
- _deleteTaskList.clear();
- stop();
- }
- return getMessageCount();
-
- }
-
- public void stop()
- {
- if (!_stopped.getAndSet(true))
- {
- ReferenceCountingExecutorService.getInstance().releaseExecutorService();
- }
- }
-
- public void deliverAsync()
- {
- _stateChangeCount.incrementAndGet();
-
- Runner runner = new Runner();
-
- if (_asynchronousRunner.compareAndSet(null, runner))
- {
- _asyncDelivery.execute(runner);
- }
- }
-
- public void deliverAsync(Subscription sub)
- {
- _asyncDelivery.execute(new SubFlushRunner(sub));
- }
-
- private class Runner implements ReadWriteRunnable
- {
- public void run()
- {
- try
- {
- processQueue(this);
- }
- catch (AMQException e)
- {
- _logger.error(e);
- }
-
- }
-
- public boolean isRead()
- {
- return false;
- }
-
- public boolean isWrite()
- {
- return true;
- }
- }
-
- private class SubFlushRunner implements ReadWriteRunnable
- {
- private final Subscription _sub;
-
- public SubFlushRunner(Subscription sub)
- {
- _sub = sub;
- }
-
- public void run()
- {
- boolean complete = false;
- try
- {
- complete = flushSubscription(_sub, new Long(MAX_ASYNC_DELIVERIES));
-
- }
- catch (AMQException e)
- {
- _logger.error(e);
- }
- if (!complete && !_sub.isSuspended())
- {
- _asyncDelivery.execute(this);
- }
-
- }
-
- public boolean isRead()
- {
- return false;
- }
-
- public boolean isWrite()
- {
- return true;
- }
- }
-
- public void flushSubscription(Subscription sub) throws AMQException
- {
- flushSubscription(sub, Long.MAX_VALUE);
- }
-
- public boolean flushSubscription(Subscription sub, Long iterations) throws AMQException
- {
- boolean atTail = false;
-
- while (!sub.isSuspended() && !atTail && iterations != 0)
- {
- try
- {
- sub.getSendLock();
- atTail = attemptDelivery(sub);
- if (atTail && sub.isAutoClose())
- {
- unregisterSubscription(sub);
-
- ProtocolOutputConverter converter = sub.getChannel().getProtocolSession().getProtocolOutputConverter();
- converter.confirmConsumerAutoClose(sub.getChannel().getChannelId(), sub.getConsumerTag());
- }
- else if (!atTail)
- {
- iterations--;
- }
- }
- finally
- {
- sub.releaseSendLock();
- }
- }
-
- // if there's (potentially) more than one subscription the others will potentially not have been advanced to the
- // next entry they are interested in yet. This would lead to holding on to references to expired messages, etc
- // which would give us memory "leak".
-
- if (!isExclusiveSubscriber())
- {
- advanceAllSubscriptions();
- }
- return atTail;
- }
-
- private boolean attemptDelivery(Subscription sub) throws AMQException
- {
- boolean atTail = false;
- boolean advanced = false;
- boolean subActive = sub.isActive();
- if (subActive)
- {
- QueueEntry node = moveSubscriptionToNextNode(sub);
- if (!(node.isAcquired() || node.isDeleted()))
- {
- if (!sub.isSuspended())
- {
- if (sub.hasInterest(node))
- {
- if (!sub.wouldSuspend(node))
- {
- if (!sub.isBrowser() && !node.acquire(sub))
- {
- sub.restoreCredit(node);
- }
- else
- {
- deliverMessage(sub, node);
-
- if (sub.isBrowser())
- {
- QueueEntry newNode = _entries.next(node);
-
- if (newNode != null)
- {
- advanced = true;
- sub.setLastSeenEntry(node, newNode);
- node = sub.getLastSeenEntry();
- }
- }
- }
-
- }
- else // Not enough Credit for message and wouldSuspend
- {
- //QPID-1187 - Treat the subscription as suspended for this message
- // and wait for the message to be removed to continue delivery.
- subActive = false;
- node.addStateChangeListener(new QueueEntryListener(sub, node));
- }
- }
- else
- {
- // this subscription is not interested in this node so we can skip over it
- QueueEntry newNode = _entries.next(node);
- if (newNode != null)
- {
- sub.setLastSeenEntry(node, newNode);
- }
- }
- }
-
- }
- atTail = (_entries.next(node) == null) && !advanced;
- }
- return atTail || !subActive;
- }
-
- protected void advanceAllSubscriptions() throws AMQException
- {
- SubscriptionList.SubscriptionNodeIterator subscriberIter = _subscriptionList.iterator();
- while (subscriberIter.advance())
- {
- SubscriptionList.SubscriptionNode subNode = subscriberIter.getNode();
- Subscription sub = subNode.getSubscription();
- moveSubscriptionToNextNode(sub);
- }
- }
-
- private QueueEntry moveSubscriptionToNextNode(final Subscription sub)
- throws AMQException
- {
- QueueEntry node = sub.getLastSeenEntry();
-
- while (node != null && (node.isAcquired() || node.isDeleted() || node.expired()))
- {
- if (!node.isAcquired() && !node.isDeleted() && node.expired())
- {
- if (node.acquire())
- {
- final StoreContext reapingStoreContext = new StoreContext();
- node.discard(reapingStoreContext);
- }
- }
- QueueEntry newNode = _entries.next(node);
- if (newNode != null)
- {
- sub.setLastSeenEntry(node, newNode);
- node = sub.getLastSeenEntry();
- }
- else
- {
- break;
- }
-
- }
- return node;
- }
-
- private void processQueue(Runnable runner) throws AMQException
- {
- long stateChangeCount;
- long previousStateChangeCount = Long.MIN_VALUE;
- boolean deliveryIncomplete = true;
-
- int extraLoops = 1;
- Long iterations = new Long(MAX_ASYNC_DELIVERIES);
-
- _asynchronousRunner.compareAndSet(runner, null);
-
- while (iterations != 0 && ((previousStateChangeCount != (stateChangeCount = _stateChangeCount.get())) || deliveryIncomplete) && _asynchronousRunner.compareAndSet(null, runner))
- {
- // we want to have one extra loop after every subscription has reached the point where it cannot move
- // further, just in case the advance of one subscription in the last loop allows a different subscription to
- // move forward in the next iteration
-
- if (previousStateChangeCount != stateChangeCount)
- {
- extraLoops = 1;
- }
-
- previousStateChangeCount = stateChangeCount;
- deliveryIncomplete = _subscriptionList.size() != 0;
- boolean done = true;
-
- SubscriptionList.SubscriptionNodeIterator subscriptionIter = _subscriptionList.iterator();
- //iterate over the subscribers and try to advance their pointer
- while (subscriptionIter.advance())
- {
- boolean closeConsumer = false;
- Subscription sub = subscriptionIter.getNode().getSubscription();
- sub.getSendLock();
- try
- {
- if (sub != null)
- {
-
- QueueEntry node = moveSubscriptionToNextNode(sub);
- if (node != null)
- {
- done = attemptDelivery(sub);
- }
- }
- if (done)
- {
- if (extraLoops == 0)
- {
- deliveryIncomplete = false;
- if (sub.isAutoClose())
- {
- unregisterSubscription(sub);
-
- ProtocolOutputConverter converter = sub.getChannel().getProtocolSession().getProtocolOutputConverter();
- converter.confirmConsumerAutoClose(sub.getChannel().getChannelId(), sub.getConsumerTag());
- }
- }
- else
- {
- extraLoops--;
- }
- }
- else
- {
- iterations--;
- extraLoops = 1;
- }
- }
- finally
- {
- sub.releaseSendLock();
- }
- }
- _asynchronousRunner.set(null);
- }
-
- // If deliveries == 0 then the limitting factor was the time-slicing rather than available messages or credit
- // therefore we should schedule this runner again (unless someone beats us to it :-) ).
- if (iterations == 0 && _asynchronousRunner.compareAndSet(null, runner))
- {
- _asyncDelivery.execute(runner);
- }
- }
-
- public void removeExpiredIfNoSubscribers() throws AMQException
- {
-
- final StoreContext storeContext = new StoreContext();
-
- QueueEntryIterator queueListIterator = _entries.iterator();
-
- while (queueListIterator.advance())
- {
- QueueEntry node = queueListIterator.getNode();
- if (!node.isDeleted() && node.expired() && node.acquire())
- {
-
- node.discard(storeContext);
- }
-
- }
-
- }
-
- public long getMinimumAlertRepeatGap()
- {
- return _minimumAlertRepeatGap;
- }
-
- public void setMinimumAlertRepeatGap(long minimumAlertRepeatGap)
- {
- _minimumAlertRepeatGap = minimumAlertRepeatGap;
- }
-
- public long getMaximumMessageAge()
- {
- return _maximumMessageAge;
- }
-
- public void setMaximumMessageAge(long maximumMessageAge)
- {
- _maximumMessageAge = maximumMessageAge;
- if (maximumMessageAge == 0L)
- {
- _notificationChecks.remove(NotificationCheck.MESSAGE_AGE_ALERT);
- }
- else
- {
- _notificationChecks.add(NotificationCheck.MESSAGE_AGE_ALERT);
- }
- }
-
- public long getMaximumMessageCount()
- {
- return _maximumMessageCount;
- }
-
- public void setMaximumMessageCount(final long maximumMessageCount)
- {
- _maximumMessageCount = maximumMessageCount;
- if (maximumMessageCount == 0L)
- {
- _notificationChecks.remove(NotificationCheck.MESSAGE_COUNT_ALERT);
- }
- else
- {
- _notificationChecks.add(NotificationCheck.MESSAGE_COUNT_ALERT);
- }
-
- }
-
- public long getMaximumQueueDepth()
- {
- return _maximumQueueDepth;
- }
-
- // Sets the queue depth, the max queue size
- public void setMaximumQueueDepth(final long maximumQueueDepth)
- {
- _maximumQueueDepth = maximumQueueDepth;
- if (maximumQueueDepth == 0L)
- {
- _notificationChecks.remove(NotificationCheck.QUEUE_DEPTH_ALERT);
- }
- else
- {
- _notificationChecks.add(NotificationCheck.QUEUE_DEPTH_ALERT);
- }
-
- }
-
- public long getMaximumMessageSize()
- {
- return _maximumMessageSize;
- }
-
- public void setMaximumMessageSize(final long maximumMessageSize)
- {
- _maximumMessageSize = maximumMessageSize;
- if (maximumMessageSize == 0L)
- {
- _notificationChecks.remove(NotificationCheck.MESSAGE_SIZE_ALERT);
- }
- else
- {
- _notificationChecks.add(NotificationCheck.MESSAGE_SIZE_ALERT);
- }
- }
-
- public Set<NotificationCheck> getNotificationChecks()
- {
- return _notificationChecks;
- }
-
- public ManagedObject getManagedObject()
- {
- return _managedObject;
- }
-
- private final class QueueEntryListener implements QueueEntry.StateChangeListener
- {
- private final QueueEntry _entry;
- private final Subscription _sub;
-
- public QueueEntryListener(final Subscription sub, final QueueEntry entry)
- {
- _entry = entry;
- _sub = sub;
- }
-
- public boolean equals(Object o)
- {
- return _entry == ((QueueEntryListener) o)._entry && _sub == ((QueueEntryListener) o)._sub;
- }
-
- public int hashCode()
- {
- return System.identityHashCode(_entry) ^ System.identityHashCode(_sub);
- }
-
- public void stateChanged(QueueEntry entry, QueueEntry.State oldSate, QueueEntry.State newState)
- {
- entry.removeStateChangeListener(this);
- deliverAsync(_sub);
- }
- }
-
- public List<Long> getMessagesOnTheQueue(int num)
- {
- return getMessagesOnTheQueue(num, 0);
- }
-
- public List<Long> getMessagesOnTheQueue(int num, int offset)
- {
- ArrayList<Long> ids = new ArrayList<Long>(num);
- QueueEntryIterator it = _entries.iterator();
- for (int i = 0; i < offset; i++)
- {
- it.advance();
- }
-
- for (int i = 0; i < num && !it.atTail(); i++)
- {
- it.advance();
- ids.add(it.getNode().getMessage().getMessageId());
- }
- return ids;
- }
-
- public void configure(Configuration queueConfiguration)
- {
- Configurator.configure(this, queueConfiguration);
- resetNotifications();
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryList.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryList.java
deleted file mode 100644
index a46c5ae2e8..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleQueueEntryList.java
+++ /dev/null
@@ -1,178 +0,0 @@
-package org.apache.qpid.server.queue;
-
-import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
-
-/*
-*
-* 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.
-*
-*/
-public class SimpleQueueEntryList implements QueueEntryList
-{
- private final QueueEntryImpl _head;
-
- private volatile QueueEntryImpl _tail;
-
- static final AtomicReferenceFieldUpdater<SimpleQueueEntryList, QueueEntryImpl>
- _tailUpdater =
- AtomicReferenceFieldUpdater.newUpdater
- (SimpleQueueEntryList.class, QueueEntryImpl.class, "_tail");
-
-
- private final AMQQueue _queue;
-
- static final AtomicReferenceFieldUpdater<QueueEntryImpl, QueueEntryImpl>
- _nextUpdater =
- AtomicReferenceFieldUpdater.newUpdater
- (QueueEntryImpl.class, QueueEntryImpl.class, "_next");
-
-
-
-
-
- public SimpleQueueEntryList(AMQQueue queue)
- {
- _queue = queue;
- _head = new QueueEntryImpl(this);
- _tail = _head;
- }
-
- void advanceHead()
- {
- QueueEntryImpl head = _head.nextNode();
- while(head._next != null && head.isDeleted())
- {
-
- final QueueEntryImpl newhead = head.nextNode();
- if(newhead != null)
- {
- _nextUpdater.compareAndSet(_head,head, newhead);
- }
- head = _head.nextNode();
- }
- }
-
-
- public AMQQueue getQueue()
- {
- return _queue;
- }
-
-
- public QueueEntry add(AMQMessage message)
- {
- QueueEntryImpl node = new QueueEntryImpl(this, message);
- for (;;)
- {
- QueueEntryImpl tail = _tail;
- QueueEntryImpl next = tail.nextNode();
- if (tail == _tail)
- {
- if (next == null)
- {
- node.setEntryId(tail.getEntryId()+1);
- if (_nextUpdater.compareAndSet(tail, null, node))
- {
- _tailUpdater.compareAndSet(this, tail, node);
-
- return node;
- }
- }
- else
- {
- _tailUpdater.compareAndSet(this,tail, next);
- }
- }
- }
- }
-
- public QueueEntry next(QueueEntry node)
- {
- return ((QueueEntryImpl)node).getNext();
- }
-
-
- public class QueueEntryIteratorImpl implements QueueEntryIterator
- {
-
- private QueueEntryImpl _lastNode;
-
- QueueEntryIteratorImpl(QueueEntryImpl startNode)
- {
- _lastNode = startNode;
- }
-
-
- public boolean atTail()
- {
- return _lastNode.nextNode() == null;
- }
-
- public QueueEntry getNode()
- {
-
- return _lastNode;
-
- }
-
- public boolean advance()
- {
-
- if(!atTail())
- {
- QueueEntryImpl nextNode = _lastNode.nextNode();
- while(nextNode.isDeleted() && nextNode.nextNode() != null)
- {
- nextNode = nextNode.nextNode();
- }
- _lastNode = nextNode;
- return true;
-
- }
- else
- {
- return false;
- }
-
- }
-
- }
-
-
- public QueueEntryIterator iterator()
- {
- return new QueueEntryIteratorImpl(_head);
- }
-
-
- public QueueEntry getHead()
- {
- return _head;
- }
-
- static class Factory implements QueueEntryListFactory
- {
-
- public QueueEntryList createQueueEntryList(AMQQueue queue)
- {
- return new SimpleQueueEntryList(queue);
- }
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java
deleted file mode 100644
index 9b91c71a1d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java
+++ /dev/null
@@ -1,127 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collections;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.ContentHeaderBody;
-
-/**
- * Contains data that is only used in AMQMessage transiently, e.g. while the content
- * body fragments are arriving.
- *
- * Having this data stored in a separate class means that the AMQMessage class avoids
- * the small overhead of numerous guaranteed-null references.
- *
- * @author Apache Software Foundation
- */
-public class TransientMessageData
-{
- /**
- * Stored temporarily until the header has been received at which point it is used when
- * constructing the handle
- */
- private MessagePublishInfo _messagePublishInfo;
-
- /**
- * Also stored temporarily.
- */
- private ContentHeaderBody _contentHeaderBody;
-
- /**
- * Keeps a track of how many bytes we have received in body frames
- */
- private long _bodyLengthReceived = 0;
-
- /**
- * This is stored during routing, to know the queues to which this message should immediately be
- * delivered. It is <b>cleared after delivery has been attempted</b>. Any persistent record of destinations is done
- * by the message handle.
- */
- private List<AMQQueue> _destinationQueues;
-
- public MessagePublishInfo getMessagePublishInfo()
- {
- return _messagePublishInfo;
- }
-
- public void setMessagePublishInfo(MessagePublishInfo messagePublishInfo)
- {
- _messagePublishInfo = messagePublishInfo;
- }
-
- public List<AMQQueue> getDestinationQueues()
- {
- return _destinationQueues == null ? (List<AMQQueue>) Collections.EMPTY_LIST : _destinationQueues;
- }
-
- public void setDestinationQueues(List<AMQQueue> destinationQueues)
- {
- _destinationQueues = destinationQueues;
- }
-
- public ContentHeaderBody getContentHeaderBody()
- {
- return _contentHeaderBody;
- }
-
- public void setContentHeaderBody(ContentHeaderBody contentHeaderBody)
- {
- _contentHeaderBody = contentHeaderBody;
- }
-
- public long getBodyLengthReceived()
- {
- return _bodyLengthReceived;
- }
-
- public void addBodyLength(int value)
- {
- _bodyLengthReceived += value;
- }
-
- public boolean isAllContentReceived() throws AMQException
- {
- return _bodyLengthReceived == _contentHeaderBody.bodySize;
- }
-
- public void addDestinationQueue(AMQQueue queue)
- {
- if(_destinationQueues == null)
- {
- _destinationQueues = new ArrayList<AMQQueue>();
- }
- _destinationQueues.add(queue);
- }
-
- public boolean isPersistent()
- {
- //todo remove literal values to a constant file such as AMQConstants in common
- return _contentHeaderBody.properties instanceof BasicContentHeaderProperties &&
- ((BasicContentHeaderProperties) _contentHeaderBody.properties).getDeliveryMode() == 2;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/UnauthorizedAccessException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/UnauthorizedAccessException.java
deleted file mode 100644
index 295cb266b9..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/UnauthorizedAccessException.java
+++ /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.
- *
- */
-
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.RequiredDeliveryException;
-
-/**
- * UnauthorizedAccessException is a {@link RequiredDeliveryException} that represents the failure case where a message
- * is published with a user id different from the one used when creating the connection .
- * The AMQP status code, 403, is always used to report this condition.
- *
- */
-
-public class UnauthorizedAccessException extends RequiredDeliveryException
-{
- public UnauthorizedAccessException(String msg, AMQMessage amqMessage)
- {
- super(msg, amqMessage);
- }
-
- public AMQConstant getReplyCode()
- {
- return AMQConstant.ACCESS_REFUSED;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java
deleted file mode 100644
index 3ed8b0e55c..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java
+++ /dev/null
@@ -1,219 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import java.lang.ref.WeakReference;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.StoreContext;
-
-/**
- * @author Robert Greig (robert.j.greig@jpmorgan.com)
- */
-public class WeakReferenceMessageHandle implements AMQMessageHandle
-{
- private WeakReference<ContentHeaderBody> _contentHeaderBody;
-
- private WeakReference<MessagePublishInfo> _messagePublishInfo;
-
- private List<WeakReference<ContentChunk>> _contentBodies;
-
- private boolean _redelivered;
-
- private final MessageStore _messageStore;
-
- private final Long _messageId;
- private long _arrivalTime;
-
- public WeakReferenceMessageHandle(final Long messageId, MessageStore messageStore)
- {
- _messageId = messageId;
- _messageStore = messageStore;
- }
-
- public ContentHeaderBody getContentHeaderBody(StoreContext context) throws AMQException
- {
- ContentHeaderBody chb = (_contentHeaderBody != null ? _contentHeaderBody.get() : null);
- if (chb == null)
- {
- MessageMetaData mmd = loadMessageMetaData(context);
- chb = mmd.getContentHeaderBody();
- }
- return chb;
- }
-
- public Long getMessageId()
- {
- return _messageId;
- }
-
- private MessageMetaData loadMessageMetaData(StoreContext context)
- throws AMQException
- {
- MessageMetaData mmd = _messageStore.getMessageMetaData(context, _messageId);
- populateFromMessageMetaData(mmd);
- return mmd;
- }
-
- private void populateFromMessageMetaData(MessageMetaData mmd)
- {
- _arrivalTime = mmd.getArrivalTime();
- _contentHeaderBody = new WeakReference<ContentHeaderBody>(mmd.getContentHeaderBody());
- _messagePublishInfo = new WeakReference<MessagePublishInfo>(mmd.getMessagePublishInfo());
- }
-
- public int getBodyCount(StoreContext context) throws AMQException
- {
- if (_contentBodies == null)
- {
- MessageMetaData mmd = _messageStore.getMessageMetaData(context, _messageId);
- int chunkCount = mmd.getContentChunkCount();
- _contentBodies = new ArrayList<WeakReference<ContentChunk>>(chunkCount);
- for (int i = 0; i < chunkCount; i++)
- {
- _contentBodies.add(new WeakReference<ContentChunk>(null));
- }
- }
- return _contentBodies.size();
- }
-
- public long getBodySize(StoreContext context) throws AMQException
- {
- return getContentHeaderBody(context).bodySize;
- }
-
- public ContentChunk getContentChunk(StoreContext context, int index) throws AMQException, IllegalArgumentException
- {
- if (index > _contentBodies.size() - 1)
- {
- throw new IllegalArgumentException("Index " + index + " out of valid range 0 to " +
- (_contentBodies.size() - 1));
- }
- WeakReference<ContentChunk> wr = _contentBodies.get(index);
- ContentChunk cb = wr.get();
- if (cb == null)
- {
- cb = _messageStore.getContentBodyChunk(context, _messageId, index);
- _contentBodies.set(index, new WeakReference<ContentChunk>(cb));
- }
- return cb;
- }
-
- /**
- * Content bodies are set <i>before</i> the publish and header frames
- *
- * @param storeContext
- * @param contentChunk
- * @param isLastContentBody
- * @throws AMQException
- */
- public void addContentBodyFrame(StoreContext storeContext, ContentChunk contentChunk, boolean isLastContentBody) throws AMQException
- {
- if (_contentBodies == null && isLastContentBody)
- {
- _contentBodies = new ArrayList<WeakReference<ContentChunk>>(1);
- }
- else
- {
- if (_contentBodies == null)
- {
- _contentBodies = new LinkedList<WeakReference<ContentChunk>>();
- }
- }
- _contentBodies.add(new WeakReference<ContentChunk>(contentChunk));
- _messageStore.storeContentBodyChunk(storeContext, _messageId, _contentBodies.size() - 1,
- contentChunk, isLastContentBody);
- }
-
- public MessagePublishInfo getMessagePublishInfo(StoreContext context) throws AMQException
- {
- MessagePublishInfo bpb = (_messagePublishInfo != null ? _messagePublishInfo.get() : null);
- if (bpb == null)
- {
- MessageMetaData mmd = loadMessageMetaData(context);
-
- bpb = mmd.getMessagePublishInfo();
- }
- return bpb;
- }
-
- public boolean isRedelivered()
- {
- return _redelivered;
- }
-
- public void setRedelivered(boolean redelivered)
- {
- _redelivered = redelivered;
- }
-
- public boolean isPersistent()
- {
- return true;
- }
-
- /**
- * This is called when all the content has been received.
- *
- * @param publishBody
- * @param contentHeaderBody
- * @throws AMQException
- */
- public void setPublishAndContentHeaderBody(StoreContext storeContext, MessagePublishInfo publishBody,
- ContentHeaderBody contentHeaderBody)
- throws AMQException
- {
- // if there are no content bodies the list will be null so we must
- // create en empty list here
- if (contentHeaderBody.bodySize == 0)
- {
- _contentBodies = new LinkedList<WeakReference<ContentChunk>>();
- }
-
- final long arrivalTime = System.currentTimeMillis();
-
-
- MessageMetaData mmd = new MessageMetaData(publishBody, contentHeaderBody, _contentBodies.size(), arrivalTime);
-
- _messageStore.storeMessageMetaData(storeContext, _messageId, mmd);
-
-
- populateFromMessageMetaData(mmd);
- }
-
- public void removeMessage(StoreContext storeContext) throws AMQException
- {
- _messageStore.removeMessage(storeContext, _messageId);
- }
-
- public long getArrivalTime()
- {
- return _arrivalTime;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
deleted file mode 100644
index c9c3acf61b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
+++ /dev/null
@@ -1,313 +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.
- *
- */
-package org.apache.qpid.server.registry;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.configuration.Configurator;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.qpid.server.management.ManagedObjectRegistry;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabaseManager;
-import org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipalDatabaseManager;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.ACLManager;
-import org.apache.qpid.server.plugins.PluginManager;
-import org.apache.mina.common.IoAcceptor;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.net.InetSocketAddress;
-
-/**
- * An abstract application registry that provides access to configuration information and handles the
- * construction and caching of configurable objects.
- * <p/>
- * Subclasses should handle the construction of the "registered objects" such as the exchange registry.
- */
-public abstract class ApplicationRegistry implements IApplicationRegistry
-{
- protected static final Logger _logger = Logger.getLogger(ApplicationRegistry.class);
-
- private static Map<Integer, IApplicationRegistry> _instanceMap = new HashMap<Integer, IApplicationRegistry>();
-
- private final Map<Class<?>, Object> _configuredObjects = new HashMap<Class<?>, Object>();
-
- protected final Configuration _configuration;
-
- public static final int DEFAULT_INSTANCE = 1;
- public static final String DEFAULT_APPLICATION_REGISTRY = "org.apache.qpid.server.util.NullApplicationRegistry";
- public static String _APPLICATION_REGISTRY = DEFAULT_APPLICATION_REGISTRY;
-
- protected final Map<InetSocketAddress, IoAcceptor> _acceptors = new HashMap<InetSocketAddress, IoAcceptor>();
-
- protected ManagedObjectRegistry _managedObjectRegistry;
-
- protected AuthenticationManager _authenticationManager;
-
- protected VirtualHostRegistry _virtualHostRegistry;
-
- protected ACLPlugin _accessManager;
-
- protected PrincipalDatabaseManager _databaseManager;
-
- protected PluginManager _pluginManager;
-
- static
- {
- Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownService()));
- }
-
- private static class ShutdownService implements Runnable
- {
- public void run()
- {
- removeAll();
- }
- }
-
- public static void initialise(IApplicationRegistry instance) throws Exception
- {
- initialise(instance, DEFAULT_INSTANCE);
- }
-
- public static void initialise(IApplicationRegistry instance, int instanceID) throws Exception
- {
- if (instance != null)
- {
- _logger.info("Initialising Application Registry:" + instanceID);
- _instanceMap.put(instanceID, instance);
-
- try
- {
- instance.initialise();
- }
- catch (Exception e)
- {
- _instanceMap.remove(instanceID);
- throw e;
- }
- }
- else
- {
- remove(instanceID);
- }
- }
-
- /**
- * Method to cleanly shutdown specified registry running in this JVM
- *
- * @param instanceID the instance to shutdown
- */
-
- public static void remove(int instanceID)
- {
- try
- {
- IApplicationRegistry instance = _instanceMap.get(instanceID);
- if (instance != null)
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Shuting down ApplicationRegistry(" + instanceID + "):" + instance);
- }
- instance.close();
- }
- }
- catch (Exception e)
- {
- _logger.error("Error shutting down Application Registry(" + instanceID + "): " + e, e);
- }
- finally
- {
- _instanceMap.remove(instanceID);
- }
- }
-
- /** Method to cleanly shutdown all registries currently running in this JVM */
- public static void removeAll()
- {
- Object[] keys = _instanceMap.keySet().toArray();
- for (Object k : keys)
- {
- remove((Integer) k);
- }
- }
-
- protected ApplicationRegistry(Configuration configuration)
- {
- _configuration = configuration;
- }
-
- public static IApplicationRegistry getInstance()
- {
- return getInstance(DEFAULT_INSTANCE);
- }
-
- public static IApplicationRegistry getInstance(int instanceID)
- {
- synchronized (IApplicationRegistry.class)
- {
- IApplicationRegistry instance = _instanceMap.get(instanceID);
-
- if (instance == null)
- {
- try
- {
- _logger.info("Creating DEFAULT_APPLICATION_REGISTRY: " + _APPLICATION_REGISTRY + " : Instance:" + instanceID);
- IApplicationRegistry registry = (IApplicationRegistry) Class.forName(_APPLICATION_REGISTRY).getConstructor((Class[]) null).newInstance((Object[]) null);
- ApplicationRegistry.initialise(registry, instanceID);
- _logger.info("Initialised Application Registry:" + instanceID);
- return registry;
- }
- catch (Exception e)
- {
- _logger.error("Error configuring application: " + e, e);
- //throw new AMQBrokerCreationException(instanceID, "Unable to create Application Registry instance " + instanceID);
- throw new RuntimeException("Unable to create Application Registry", e);
- }
- }
- else
- {
- return instance;
- }
- }
- }
-
- public void close() throws Exception
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Shutting down ApplicationRegistry:"+this);
- }
-
- //Stop incomming connections
- unbind();
-
- //Shutdown virtualhosts
- for (VirtualHost virtualHost : getVirtualHostRegistry().getVirtualHosts())
- {
- virtualHost.close();
- }
-
- // Replace above with this
-// _virtualHostRegistry.close();
-
-// _accessManager.close();
-
-// _databaseManager.close();
-
- _authenticationManager.close();
-
-// _databaseManager.close();
-
- // close the rmi registry(if any) started for management
- if (_managedObjectRegistry != null)
- {
- _managedObjectRegistry.close();
- }
-
-// _pluginManager.close();
- }
-
- private void unbind()
- {
- synchronized (_acceptors)
- {
- for (InetSocketAddress bindAddress : _acceptors.keySet())
- {
- IoAcceptor acceptor = _acceptors.get(bindAddress);
- acceptor.unbind(bindAddress);
- }
- }
- }
-
- public Configuration getConfiguration()
- {
- return _configuration;
- }
-
- public void addAcceptor(InetSocketAddress bindAddress, IoAcceptor acceptor)
- {
- synchronized (_acceptors)
- {
- _acceptors.put(bindAddress, acceptor);
- }
- }
-
- public <T> T getConfiguredObject(Class<T> instanceType)
- {
- T instance = (T) _configuredObjects.get(instanceType);
- if (instance == null)
- {
- try
- {
- instance = instanceType.newInstance();
- }
- catch (Exception e)
- {
- _logger.error("Unable to instantiate configuration class " + instanceType + " - ensure it has a public default constructor");
- throw new IllegalArgumentException("Unable to instantiate configuration class " + instanceType + " - ensure it has a public default constructor", e);
- }
- Configurator.configure(instance);
- _configuredObjects.put(instanceType, instance);
- }
- return instance;
- }
-
- public static void setDefaultApplicationRegistry(String clazz)
- {
- _APPLICATION_REGISTRY = clazz;
- }
-
- public VirtualHostRegistry getVirtualHostRegistry()
- {
- return _virtualHostRegistry;
- }
-
- public ACLPlugin getAccessManager()
- {
- return _accessManager;
- }
-
- public ManagedObjectRegistry getManagedObjectRegistry()
- {
- return _managedObjectRegistry;
- }
-
- public PrincipalDatabaseManager getDatabaseManager()
- {
- return _databaseManager;
- }
-
- public AuthenticationManager getAuthenticationManager()
- {
- return _authenticationManager;
- }
-
- public PluginManager getPluginManager()
- {
- return _pluginManager;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java
deleted file mode 100644
index a555b72dcf..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java
+++ /dev/null
@@ -1,140 +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.
- *
- */
-package org.apache.qpid.server.registry;
-
-import java.io.File;
-import java.util.Collection;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.commons.configuration.CompositeConfiguration;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.SystemConfiguration;
-import org.apache.commons.configuration.XMLConfiguration;
-import org.apache.qpid.server.management.JMXManagedObjectRegistry;
-import org.apache.qpid.server.management.ManagedObjectRegistry;
-import org.apache.qpid.server.management.ManagementConfiguration;
-import org.apache.qpid.server.management.NoopManagedObjectRegistry;
-import org.apache.qpid.server.plugins.PluginManager;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipalDatabaseManager;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabaseManager;
-import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.ACLManager;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.qpid.AMQException;
-
-public class ConfigurationFileApplicationRegistry extends ApplicationRegistry
-{
-
- public ConfigurationFileApplicationRegistry(File configurationURL) throws ConfigurationException
- {
- super(config(configurationURL));
- }
-
- // Our configuration class needs to make the interpolate method
- // public so it can be called below from the config method.
- private static class MyConfiguration extends CompositeConfiguration
- {
- public String interpolate(String obj)
- {
- return super.interpolate(obj);
- }
- }
-
- private static final Configuration config(File url) throws ConfigurationException
- {
- // We have to override the interpolate methods so that
- // interpolation takes place accross the entirety of the
- // composite configuration. Without doing this each
- // configuration object only interpolates variables defined
- // inside itself.
- final MyConfiguration conf = new MyConfiguration();
- conf.addConfiguration(new SystemConfiguration()
- {
- protected String interpolate(String o)
- {
- return conf.interpolate(o);
- }
- });
- conf.addConfiguration(new XMLConfiguration(url)
- {
- protected String interpolate(String o)
- {
- return conf.interpolate(o);
- }
- });
- return conf;
- }
-
- public void initialise() throws Exception
- {
- initialiseManagedObjectRegistry();
-
- _virtualHostRegistry = new VirtualHostRegistry();
-
- _accessManager = ACLManager.loadACLManager("default", _configuration);
-
- _databaseManager = new ConfigurationFilePrincipalDatabaseManager(_configuration);
-
- _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);
-
- _databaseManager.initialiseManagement(_configuration);
-
- _managedObjectRegistry.start();
-
- _pluginManager = new PluginManager(_configuration.getString("plugin-directory"));
-
- initialiseVirtualHosts();
-
- }
-
- private void initialiseVirtualHosts() throws Exception
- {
- for (String name : getVirtualHostNames())
- {
-
- _virtualHostRegistry.registerVirtualHost(new VirtualHost(name, getConfiguration().subset("virtualhosts.virtualhost." + name)));
- }
- }
-
- private void initialiseManagedObjectRegistry() throws AMQException
- {
- ManagementConfiguration config = getConfiguredObject(ManagementConfiguration.class);
- if (config.enabled)
- {
- _managedObjectRegistry = new JMXManagedObjectRegistry();
- }
- else
- {
- _managedObjectRegistry = new NoopManagedObjectRegistry();
- }
- }
-
- public Collection<String> getVirtualHostNames()
- {
- return getConfiguration().getList("virtualhosts.virtualhost.name");
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
deleted file mode 100644
index 597ef042f9..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
+++ /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.
- *
- */
-package org.apache.qpid.server.registry;
-
-import java.util.Collection;
-import java.net.InetSocketAddress;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.qpid.server.management.ManagedObjectRegistry;
-import org.apache.qpid.server.plugins.PluginManager;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabaseManager;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.mina.common.IoAcceptor;
-
-public interface IApplicationRegistry
-{
- /**
- * Initialise the application registry. All initialisation must be done in this method so that any components
- * that need access to the application registry itself for initialisation are able to use it. Attempting to
- * initialise in the constructor will lead to failures since the registry reference will not have been set.
- */
- void initialise() throws Exception;
-
- /**
- * Shutdown this Registry
- * @throws Exception - //fixme needs to be made more specific
- */
- void close() throws Exception;
-
- /**
- * This gets access to a "configured object". A configured object has fields populated from a the configuration
- * object (Commons Configuration) automatically, where it has the appropriate attributes defined on fields.
- * Application registry implementations can choose the refresh strategy or caching approach.
- * @param instanceType the type of object you want initialised. This must be unique - i.e. you can only
- * have a single object of this type in the system.
- * @return the configured object
- */
- <T> T getConfiguredObject(Class<T> instanceType);
-
- /**
- * Get the low level configuration. For use cases where the configured object approach is not required
- * you can get the complete configuration information.
- * @return a Commons Configuration instance
- */
- Configuration getConfiguration();
-
- ManagedObjectRegistry getManagedObjectRegistry();
-
- PrincipalDatabaseManager getDatabaseManager();
-
- AuthenticationManager getAuthenticationManager();
-
- Collection<String> getVirtualHostNames();
-
- VirtualHostRegistry getVirtualHostRegistry();
-
- ACLPlugin getAccessManager();
-
- PluginManager getPluginManager();
-
- /**
- * Register any acceptors for this registry
- * @param bindAddress The address that the acceptor has been bound with
- * @param acceptor The acceptor in use
- */
- void addAcceptor(InetSocketAddress bindAddress, IoAcceptor acceptor);
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLManager.java
deleted file mode 100644
index 539f32a732..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLManager.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.security.access;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.security.access.plugins.DenyAll;
-import org.apache.qpid.configuration.PropertyUtils;
-import org.apache.log4j.Logger;
-
-import java.util.List;
-import java.lang.reflect.Method;
-
-public class ACLManager
-{
- private static final Logger _logger = Logger.getLogger(ACLManager.class);
-
- public static ACLPlugin loadACLManager(String name, Configuration hostConfig) throws ConfigurationException
- {
- ACLPlugin aclPlugin = ApplicationRegistry.getInstance().getAccessManager();
-
- if (hostConfig == null)
- {
- _logger.warn("No Configuration specified. Using default ACLPlugin '" + aclPlugin.getPluginName()
- + "' for VirtualHost:'" + name + "'");
- return aclPlugin;
- }
-
- String accessClass = hostConfig.getString("security.access.class");
- if (accessClass == null)
- {
-
- _logger.warn("No ACL Plugin specified. Using default ACL Plugin '" + aclPlugin.getPluginName() +
- "' for VirtualHost:'" + name + "'");
- return aclPlugin;
- }
-
- Object o;
- try
- {
- o = Class.forName(accessClass).newInstance();
- }
- catch (Exception e)
- {
- throw new ConfigurationException("Error initialising ACL: " + e, e);
- }
-
- if (!(o instanceof ACLPlugin))
- {
- throw new ConfigurationException("ACL Plugins must implement the ACLPlugin interface");
- }
-
- initialiseAccessControl((ACLPlugin) o, hostConfig);
-
- aclPlugin = getManager((ACLPlugin) o);
- if (_logger.isInfoEnabled())
- {
- _logger.info("Initialised ACL Plugin '" + aclPlugin.getPluginName()
- + "' for virtualhost '" + name + "' successfully");
- }
-
- return aclPlugin;
- }
-
-
- private static void initialiseAccessControl(ACLPlugin accessManager, Configuration config)
- throws ConfigurationException
- {
- //First provide the ACLPlugin with the host configuration
-
- accessManager.setConfiguaration(config);
-
- //Provide additional attribute customisation.
- String baseName = "security.access.attributes.attribute.";
- List<String> argumentNames = config.getList(baseName + "name");
- List<String> argumentValues = config.getList(baseName + "value");
- for (int i = 0; i < argumentNames.size(); i++)
- {
- String argName = argumentNames.get(i);
- if (argName == null || argName.length() == 0)
- {
- throw new ConfigurationException("Access Control argument names must have length >= 1 character");
- }
- if (Character.isLowerCase(argName.charAt(0)))
- {
- argName = Character.toUpperCase(argName.charAt(0)) + argName.substring(1);
- }
- String methodName = "set" + argName;
- Method method = null;
- try
- {
- method = accessManager.getClass().getMethod(methodName, String.class);
- }
- catch (NoSuchMethodException e)
- {
- //do nothing as method will be null
- }
-
- if (method == null)
- {
- throw new ConfigurationException("No method " + methodName + " found in class " + accessManager.getClass() +
- " hence unable to configure access control. The method must be public and " +
- "have a single String argument with a void return type");
- }
- try
- {
- method.invoke(accessManager, PropertyUtils.replaceProperties(argumentValues.get(i)));
- }
- catch (Exception e)
- {
- ConfigurationException ce = new ConfigurationException(e.getMessage(), e.getCause());
- ce.initCause(e);
- throw ce;
- }
- }
- }
-
-
- private static ACLPlugin getManager(ACLPlugin manager)
- {
- if (manager == null)
- {
- if (ApplicationRegistry.getInstance().getAccessManager() == null)
- {
- return new DenyAll();
- }
- else
- {
- return ApplicationRegistry.getInstance().getAccessManager();
- }
- }
- else
- {
- return manager;
- }
- }
-
- public static Logger getLogger()
- {
- return _logger;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLPlugin.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLPlugin.java
deleted file mode 100644
index 7855f147b4..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLPlugin.java
+++ /dev/null
@@ -1,58 +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.
- *
- *
- */
-package org.apache.qpid.server.security.access;
-
-import org.apache.qpid.framing.AMQMethodBody;
-
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.commons.configuration.Configuration;
-
-
-public interface ACLPlugin
-{
- /**
- * Pseudo-Code:
- * Identify requested RighConnectiont
- * Lookup users ability for that right.
- * if rightsExists
- * Validate right on object
- * Return result
- * e.g
- * User, CONSUME , Queue
- * User, CONSUME , Exchange + RoutingKey
- * User, PUBLISH , Exchange + RoutingKey
- * User, CREATE , Exchange || Queue
- * User, BIND , Exchange + RoutingKey + Queue
- *
- * @param session - The session requesting access
- * @param permission - The permission requested
- * @param parameters - The above objects that are used to authorise the request.
- * @return The AccessResult decision
- */
- //todo potential refactor this ConnectionException Out of here
- AccessResult authorise(AMQProtocolSession session, Permission permission, AMQMethodBody body, Object... parameters) throws AMQConnectionException;
-
- String getPluginName();
-
- void setConfiguaration(Configuration config);
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessResult.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessResult.java
deleted file mode 100644
index 86f155d862..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessResult.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.security.access;
-
-public class AccessResult
-{
- public enum AccessStatus
- {
- GRANTED, REFUSED
- }
-
- private String _authorizer;
- private AccessStatus _status;
-
- public AccessResult(ACLPlugin authorizer, AccessStatus status)
- {
- _status = status;
- _authorizer = authorizer.getPluginName();
- }
-
- public void setAuthorizer(ACLPlugin authorizer)
- {
- _authorizer += authorizer.getPluginName();
- }
-
- public String getAuthorizer()
- {
- return _authorizer;
- }
-
- public void setStatus(AccessStatus status)
- {
- _status = status;
- }
-
- public AccessStatus getStatus()
- {
- return _status;
- }
-
- public void addAuthorizer(ACLPlugin accessManager)
- {
- _authorizer = accessManager.getPluginName() + "->" + _authorizer;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessRights.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessRights.java
deleted file mode 100644
index 1b79a5a0e0..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessRights.java
+++ /dev/null
@@ -1,63 +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.
- *
- *
- */
-package org.apache.qpid.server.security.access;
-
-public class AccessRights
-{
- public enum Rights
- {
- ANY,
- READ,
- WRITE,
- READWRITE
- }
-
- Rights _right;
-
- public AccessRights(Rights right)
- {
- _right = right;
- }
-
- public boolean allows(Rights rights)
- {
- switch (_right)
- {
- case ANY:
- return (rights.equals(Rights.WRITE)
- || rights.equals(Rights.READ)
- || rights.equals(Rights.READWRITE)
- || rights.equals(Rights.ANY));
- case READ:
- return rights.equals(Rights.READ) || rights.equals(Rights.ANY);
- case WRITE:
- return rights.equals(Rights.WRITE) || rights.equals(Rights.ANY);
- case READWRITE:
- return true;
- }
- return false;
- }
-
- public Rights getRights()
- {
- return _right;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Accessable.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Accessable.java
deleted file mode 100644
index f51cf24caa..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Accessable.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.security.access;
-
-public interface Accessable
-{
- void setAccessableName(String name);
- String getAccessableName();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Permission.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Permission.java
deleted file mode 100644
index 00757a4f8c..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/Permission.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.security.access;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.queue.AMQQueue;
-
-public enum Permission
-{
- CONSUME,
- PUBLISH,
- CREATE,
- ACCESS,
- BIND,
- UNBIND,
- DELETE,
- PURGE
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/PrincipalPermissions.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/PrincipalPermissions.java
deleted file mode 100755
index 23073e0613..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/PrincipalPermissions.java
+++ /dev/null
@@ -1,579 +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.
- *
- */
-package org.apache.qpid.server.security.access;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.QueueBindBody;
-import org.apache.qpid.framing.QueueDeclareBody;
-import org.apache.qpid.framing.ExchangeDeclareBody;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.exchange.Exchange;
-
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-
-public class PrincipalPermissions
-{
-
- private static final Object CONSUME_QUEUES_KEY = new Object();
- private static final Object CONSUME_TEMPORARY_KEY = new Object();
- private static final Object CONSUME_OWN_QUEUES_ONLY_KEY = new Object();
-
- private static final Object CREATE_QUEUES_KEY = new Object();
- private static final Object CREATE_EXCHANGES_KEY = new Object();
-
- private static final Object CREATE_QUEUE_TEMPORARY_KEY = new Object();
- private static final Object CREATE_QUEUE_QUEUES_KEY = new Object();
- private static final Object CREATE_QUEUE_EXCHANGES_KEY = new Object();
-
- private static final Object CREATE_QUEUE_EXCHANGES_TEMPORARY_KEY = new Object();
- private static final Object CREATE_QUEUE_EXCHANGES_ROUTINGKEYS_KEY = new Object();
-
- private static final int PUBLISH_EXCHANGES_KEY = 0;
-
- private Map _permissions;
-
- private String _user;
-
-
- public PrincipalPermissions(String user)
- {
- _user = user;
- _permissions = new ConcurrentHashMap();
- }
-
- public void grant(Permission permission, Object... parameters)
- {
- switch (permission)
- {
- case ACCESS:
- break; // This is a no-op as the existence of this PrincipalPermission object is scoped per VHost for ACCESS
- case BIND:
- break; // All the details are currently included in the create setup.
- case CONSUME: // Parameters : AMQShortString queueName, Boolean Temporary, Boolean ownQueueOnly
- Map consumeRights = (Map) _permissions.get(permission);
-
- if (consumeRights == null)
- {
- consumeRights = new ConcurrentHashMap();
- _permissions.put(permission, consumeRights);
- }
-
- //if we have parametsre
- if (parameters.length > 0)
- {
- AMQShortString queueName = (AMQShortString) parameters[0];
- Boolean temporary = (Boolean) parameters[1];
- Boolean ownQueueOnly = (Boolean) parameters[2];
-
- if (temporary)
- {
- consumeRights.put(CONSUME_TEMPORARY_KEY, true);
- }
- else
- {
- consumeRights.put(CONSUME_TEMPORARY_KEY, false);
- }
-
- if (ownQueueOnly)
- {
- consumeRights.put(CONSUME_OWN_QUEUES_ONLY_KEY, true);
- }
- else
- {
- consumeRights.put(CONSUME_OWN_QUEUES_ONLY_KEY, false);
- }
-
-
- LinkedList queues = (LinkedList) consumeRights.get(CONSUME_QUEUES_KEY);
- if (queues == null)
- {
- queues = new LinkedList();
- consumeRights.put(CONSUME_QUEUES_KEY, queues);
- }
-
- if (queueName != null)
- {
- queues.add(queueName);
- }
- }
-
-
- break;
- case CREATE: // Parameters : Boolean temporary, AMQShortString queueName
- // , AMQShortString exchangeName , AMQShortString routingKey
- // || AMQShortString exchangeName , AMQShortString Class
-
- Map createRights = (Map) _permissions.get(permission);
-
- if (createRights == null)
- {
- createRights = new ConcurrentHashMap();
- _permissions.put(permission, createRights);
-
- }
-
- //The existence of the empty map mean permission to all.
- if (parameters.length == 0)
- {
- return;
- }
-
-
- if (parameters[0] instanceof Boolean) //Create Queue :
- // Boolean temporary, [AMQShortString queueName, AMQShortString exchangeName , AMQShortString routingKey]
- {
- Boolean temporary = (Boolean) parameters[0];
-
- AMQShortString queueName = parameters.length > 1 ? (AMQShortString) parameters[1] : null;
- AMQShortString exchangeName = parameters.length > 2 ? (AMQShortString) parameters[2] : null;
- //Set the routingkey to the specified value or the queueName if present
- AMQShortString routingKey = parameters.length > 3 ? (AMQShortString) parameters[3] : queueName;
-
- // Get the queues map
- Map create_queues = (Map) createRights.get(CREATE_QUEUES_KEY);
-
- if (create_queues == null)
- {
- create_queues = new ConcurrentHashMap();
- createRights.put(CREATE_QUEUES_KEY, create_queues);
- }
-
- //Allow all temp queues to be created
- create_queues.put(CREATE_QUEUE_TEMPORARY_KEY, temporary);
-
- //Create empty list of queues
- Map create_queues_queues = (Map) create_queues.get(CREATE_QUEUE_QUEUES_KEY);
-
- if (create_queues_queues == null)
- {
- create_queues_queues = new ConcurrentHashMap();
- create_queues.put(CREATE_QUEUE_QUEUES_KEY, create_queues_queues);
- }
-
- // We are granting CREATE rights to all temporary queues only
- if (parameters.length == 1)
- {
- return;
- }
-
- // if we have a queueName then we need to store any associated exchange / rk bindings
- if (queueName != null)
- {
- Map queue = (Map) create_queues_queues.get(queueName);
- if (queue == null)
- {
- queue = new ConcurrentHashMap();
- create_queues_queues.put(queueName, queue);
- }
-
- if (exchangeName != null)
- {
- queue.put(exchangeName, routingKey);
- }
-
- //If no exchange is specified then the presence of the queueName in the map says any exchange is ok
- }
-
- // Store the exchange that we are being granted rights to. This will be used as part of binding
-
- //Lookup the list of exchanges
- Map create_queues_exchanges = (Map) create_queues.get(CREATE_QUEUE_EXCHANGES_KEY);
-
- if (create_queues_exchanges == null)
- {
- create_queues_exchanges = new ConcurrentHashMap();
- create_queues.put(CREATE_QUEUE_EXCHANGES_KEY, create_queues_exchanges);
- }
-
- //if we have an exchange
- if (exchangeName != null)
- {
- //Retrieve the list of permitted exchanges.
- Map exchanges = (Map) create_queues_exchanges.get(exchangeName);
-
- if (exchanges == null)
- {
- exchanges = new ConcurrentHashMap();
- create_queues_exchanges.put(exchangeName, exchanges);
- }
-
- //Store the temporary setting CREATE_QUEUE_EXCHANGES_ROUTINGKEYS_KEY
- exchanges.put(CREATE_QUEUE_EXCHANGES_TEMPORARY_KEY, temporary);
-
- //Store the binding details of queue/rk for this exchange.
- if (queueName != null)
- {
- //Retrieve the list of permitted routingKeys.
- Map rKeys = (Map) exchanges.get(exchangeName);
-
- if (rKeys == null)
- {
- rKeys = new ConcurrentHashMap();
- exchanges.put(CREATE_QUEUE_EXCHANGES_ROUTINGKEYS_KEY, rKeys);
- }
-
- rKeys.put(queueName, routingKey);
- }
- }
- }
- else // Create Exchange : AMQShortString exchangeName , AMQShortString Class
- {
- Map create_exchanges = (Map) createRights.get(CREATE_EXCHANGES_KEY);
-
- if (create_exchanges == null)
- {
- create_exchanges = new ConcurrentHashMap();
- createRights.put(CREATE_EXCHANGES_KEY, create_exchanges);
- }
-
- //Should perhaps error if parameters[0] is null;
- AMQShortString exchangeName = parameters.length > 0 ? (AMQShortString) parameters[0] : null;
- AMQShortString className = parameters.length > 1 ? (AMQShortString) parameters[1] : null;
-
- //Store the exchangeName / class mapping if the mapping is null
- createRights.put(exchangeName, className);
- }
- break;
- case DELETE:
- break;
-
- case PUBLISH: // Parameters : Exchange exchange, AMQShortString routingKey
- Map publishRights = (Map) _permissions.get(permission);
-
- if (publishRights == null)
- {
- publishRights = new ConcurrentHashMap();
- _permissions.put(permission, publishRights);
- }
-
- if (parameters == null || parameters.length == 0)
- {
- //If we have no parameters then allow publish to all destinations
- // this is signified by having a null value for publish_exchanges
- }
- else
- {
- Map publish_exchanges = (Map) publishRights.get(PUBLISH_EXCHANGES_KEY);
-
- if (publish_exchanges == null)
- {
- publish_exchanges = new ConcurrentHashMap();
- publishRights.put(PUBLISH_EXCHANGES_KEY, publish_exchanges);
- }
-
-
- HashSet routingKeys = (HashSet) publish_exchanges.get(parameters[0]);
-
- // Check to see if we have a routing key
- if (parameters.length == 2)
- {
- if (routingKeys == null)
- {
- routingKeys = new HashSet<AMQShortString>();
- }
- //Add routing key to permitted publish destinations
- routingKeys.add(parameters[1]);
- }
-
- // Add the updated routingkey list or null if all values allowed
- publish_exchanges.put(parameters[0], routingKeys);
- }
- break;
- case PURGE:
- break;
- case UNBIND:
- break;
- }
-
- }
-
- public boolean authorise(Permission permission, Object... parameters)
- {
-
- switch (permission)
- {
- case ACCESS:
- return true; // This is here for completeness but the SimpleXML ACLManager never calls it.
- // The existence of this user specific PP can be validated in the map SimpleXML maintains.
- case BIND: // Parameters : QueueBindMethod , Exchange , AMQQueue, AMQShortString routingKey
-
- Exchange exchange = (Exchange) parameters[1];
-
- AMQQueue bind_queueName = (AMQQueue) parameters[2];
- AMQShortString routingKey = (AMQShortString) parameters[3];
-
- //Get all Create Rights for this user
- Map bindCreateRights = (Map) _permissions.get(Permission.CREATE);
-
- //Look up the Queue Creation Rights
- Map bind_create_queues = (Map) bindCreateRights.get(CREATE_QUEUES_KEY);
-
- //Lookup the list of queues
- Map bind_create_queues_queues = (Map) bindCreateRights.get(CREATE_QUEUE_QUEUES_KEY);
-
- // Check and see if we have a queue white list to check
- if (bind_create_queues_queues != null)
- {
- //There a white list for queues
- Map exchangeDetails = (Map) bind_create_queues_queues.get(bind_queueName);
-
- if (exchangeDetails == null) //Then all queue can be bound to all exchanges.
- {
- return true;
- }
-
- // Check to see if we have a white list of routingkeys to check
- Map rkeys = (Map) exchangeDetails.get(exchange.getName());
-
- // if keys is null then any rkey is allowed on this exchange
- if (rkeys == null)
- {
- // There is no routingkey white list
- return true;
- }
- else
- {
- // We have routingKeys so a match must be found to allowed binding
- Iterator keys = rkeys.keySet().iterator();
-
- boolean matched = false;
- while (keys.hasNext() && !matched)
- {
- AMQShortString rkey = (AMQShortString) keys.next();
- if (rkey.endsWith("*"))
- {
- matched = routingKey.startsWith(rkey.subSequence(0, rkey.length() - 1).toString());
- }
- else
- {
- matched = routingKey.equals(rkey);
- }
- }
-
-
- return matched;
- }
-
-
- }
- else
- {
- //There a is no white list for queues
-
- // So can allow all queues to be bound
- // but we should first check and see if we have a temp queue and validate that we are allowed
- // to bind temp queues.
-
- //Check to see if we have a temporary queue
- if (bind_queueName.isAutoDelete())
- {
- // Check and see if we have an exchange white list.
- Map bind_exchanges = (Map) bind_create_queues.get(CREATE_QUEUE_EXCHANGES_KEY);
-
- // If the exchange exists then we must check to see if temporary queues are allowed here
- if (bind_exchanges != null)
- {
- // Check to see if the requested exchange is allowed.
- Map exchangeDetails = (Map) bind_exchanges.get(exchange.getName());
-
- return (Boolean) exchangeDetails.get(CREATE_QUEUE_EXCHANGES_TEMPORARY_KEY);
- }
-
- //no white list so all allowed, drop through to return true below.
- }
-
- // not a temporary queue and no white list so all allowed.
- return true;
- }
-
- case CREATE:// Paramters : QueueDeclareBody || ExchangeDeclareBody
-
- Map createRights = (Map) _permissions.get(permission);
-
- // If there are no create rights then deny request
- if (createRights == null)
- {
- return false;
- }
-
- if (parameters.length == 1)
- {
- if (parameters[0] instanceof QueueDeclareBody)
- {
- QueueDeclareBody body = (QueueDeclareBody) parameters[0];
-
- //Look up the Queue Creation Rights
- Map create_queues = (Map) createRights.get(CREATE_QUEUES_KEY);
-
- //Lookup the list of queues allowed to be created
- Map create_queues_queues = (Map) create_queues.get(CREATE_QUEUE_QUEUES_KEY);
-
-
- AMQShortString queueName = body.getQueue();
-
-
- if (body.getAutoDelete())// we have a temporary queue
- {
- return (Boolean) create_queues.get(CREATE_QUEUE_TEMPORARY_KEY);
- }
- else
- {
- // If there is a white list then check
- return create_queues_queues == null || create_queues_queues.containsKey(queueName);
- }
-
- }
- else if (parameters[0] instanceof ExchangeDeclareBody)
- {
- ExchangeDeclareBody body = (ExchangeDeclareBody) parameters[0];
-
- AMQShortString exchangeName = body.getExchange();
-
- Map create_exchanges = (Map) createRights.get(CREATE_EXCHANGES_KEY);
-
- // If the exchange list is doesn't exist then all is allowed else check the valid exchanges
- return create_exchanges == null || create_exchanges.containsKey(exchangeName);
- }
- }
- break;
- case CONSUME: // Parameters : AMQQueue
-
- if (parameters.length == 1 && parameters[0] instanceof AMQQueue)
- {
- AMQQueue queue = ((AMQQueue) parameters[0]);
- Map queuePermissions = (Map) _permissions.get(permission);
-
- List queues = (List) queuePermissions.get(CONSUME_QUEUES_KEY);
-
- Boolean temporayQueues = (Boolean) queuePermissions.get(CONSUME_TEMPORARY_KEY);
- Boolean ownQueuesOnly = (Boolean) queuePermissions.get(CONSUME_OWN_QUEUES_ONLY_KEY);
-
- // If user is allowed to publish to temporary queues and this is a temp queue then allow it.
- if (temporayQueues)
- {
- if (queue.isAutoDelete())
- // This will allow consumption from any temporary queue including ones not owned by this user.
- // Of course the exclusivity will not be broken.
- {
- // if not limited to ownQueuesOnly then ok else check queue Owner.
- return !ownQueuesOnly || queue.getOwner().equals(_user);
- }
- else
- {
- return false;
- }
- }
-
- // if queues are white listed then ensure it is ok
- if (queues != null)
- {
- // if no queues are listed then ALL are ok othereise it must be specified.
- if (ownQueuesOnly)
- {
- if (queue.getOwner().equals(_user))
- {
- return queues.size() == 0 || queues.contains(queue.getName());
- }
- else
- {
- return false;
- }
- }
-
- // If we are
- return queues.size() == 0 || queues.contains(queue.getName());
- }
- }
-
- // Can't authenticate without the right parameters
- return false;
- case DELETE:
- break;
-
- case PUBLISH: // Parameters : Exchange exchange, AMQShortString routingKey
- Map publishRights = (Map) _permissions.get(permission);
-
- if (publishRights == null)
- {
- return false;
- }
-
- Map exchanges = (Map) publishRights.get(PUBLISH_EXCHANGES_KEY);
-
- // Having no exchanges listed gives full publish rights to all exchanges
- if (exchanges == null)
- {
- return true;
- }
- // Otherwise exchange must be listed in the white list
-
- // If the map doesn't have the exchange then it isn't allowed
- if (!exchanges.containsKey(parameters[0]))
- {
- return false;
- }
- else
- {
-
- // Get valid routing keys
- HashSet routingKeys = (HashSet) exchanges.get(parameters[0]);
-
- // Having no routingKeys in the map then all are allowed.
- if (routingKeys == null)
- {
- return true;
- }
- else
- {
- // We have routingKeys so a match must be found to allowed binding
- Iterator keys = routingKeys.iterator();
-
-
- AMQShortString publishRKey = (AMQShortString)parameters[1];
-
- boolean matched = false;
- while (keys.hasNext() && !matched)
- {
- AMQShortString rkey = (AMQShortString) keys.next();
-
- if (rkey.endsWith("*"))
- {
- matched = publishRKey.startsWith(rkey.subSequence(0, rkey.length() - 1));
- }
- else
- {
- matched = publishRKey.equals(rkey);
- }
- }
- return matched;
- }
- }
- case PURGE:
- break;
- case UNBIND:
- break;
-
- }
-
- return false;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/VirtualHostAccess.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/VirtualHostAccess.java
deleted file mode 100644
index 13151a66b8..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/VirtualHostAccess.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.security.access;
-
-public class VirtualHostAccess
-{
- private String _vhost;
- private AccessRights _rights;
-
- public VirtualHostAccess(String vhostaccess)
- {
- //format <vhost>(<rights>)
- int hostend = vhostaccess.indexOf('(');
-
- if (hostend == -1)
- {
- throw new IllegalArgumentException("VirtualHostAccess format string contains no access _rights");
- }
-
- _vhost = vhostaccess.substring(0, hostend);
-
- String rights = vhostaccess.substring(hostend);
-
- if (rights.indexOf('r') != -1)
- {
- if (rights.indexOf('w') != -1)
- {
- _rights = new AccessRights(AccessRights.Rights.READWRITE);
- }
- else
- {
- _rights = new AccessRights(AccessRights.Rights.READ);
- }
- }
- else if (rights.indexOf('w') != -1)
- {
- _rights = new AccessRights(AccessRights.Rights.WRITE);
- }
- }
-
- public AccessRights getAccessRights()
- {
- return _rights;
- }
-
- public String getVirtualHost()
- {
- return _vhost;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBean.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBean.java
deleted file mode 100644
index 32ec3a3bbc..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBean.java
+++ /dev/null
@@ -1,473 +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.
- *
- *
- */
-package org.apache.qpid.server.security.access.management;
-
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.management.AMQManagedObject;
-import org.apache.qpid.server.management.MBeanOperation;
-import org.apache.qpid.server.management.MBeanInvocationHandlerImpl;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
-import org.apache.qpid.server.security.access.management.UserManagement;
-import org.apache.log4j.Logger;
-import org.apache.commons.configuration.ConfigurationException;
-
-import javax.management.JMException;
-import javax.management.remote.JMXPrincipal;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.TabularDataSupport;
-import javax.management.openmbean.TabularType;
-import javax.management.openmbean.SimpleType;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.OpenDataException;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.security.auth.login.AccountNotFoundException;
-import javax.security.auth.Subject;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.FileOutputStream;
-import java.util.Properties;
-import java.util.List;
-import java.util.Enumeration;
-import java.util.Set;
-import java.util.concurrent.locks.ReentrantLock;
-import java.security.Principal;
-import java.security.AccessControlContext;
-import java.security.AccessController;
-
-/** MBean class for AMQUserManagementMBean. It implements all the management features exposed for managing users. */
-@MBeanDescription("User Management Interface")
-public class AMQUserManagementMBean extends AMQManagedObject implements UserManagement
-{
-
- private static final Logger _logger = Logger.getLogger(AMQUserManagementMBean.class);
-
- private PrincipalDatabase _principalDatabase;
- private String _accessFileName;
- private Properties _accessRights;
- // private File _accessFile;
- private ReentrantLock _accessRightsUpdate = new ReentrantLock();
-
- // Setup for the TabularType
- static TabularType _userlistDataType; // Datatype for representing User Lists
-
- static CompositeType _userDataType; // Composite type for representing User
- static String[] _userItemNames = {"Username", "read", "write", "admin"};
-
- static
- {
- String[] userItemDesc = {"Broker Login username", "Management Console Read Permission",
- "Management Console Write Permission", "Management Console Admin Permission"};
-
- OpenType[] userItemTypes = new OpenType[4]; // User item types.
- userItemTypes[0] = SimpleType.STRING; // For Username
- userItemTypes[1] = SimpleType.BOOLEAN; // For Rights - Read
- userItemTypes[2] = SimpleType.BOOLEAN; // For Rights - Write
- userItemTypes[3] = SimpleType.BOOLEAN; // For Rights - Admin
- String[] userDataIndex = {_userItemNames[0]};
-
- try
- {
- _userDataType =
- new CompositeType("User", "User Data", _userItemNames, userItemDesc, userItemTypes);
-
- _userlistDataType = new TabularType("Users", "List of users", _userDataType, userDataIndex);
- }
- catch (OpenDataException e)
- {
- _logger.error("Tabular data setup for viewing users incorrect.");
- _userlistDataType = null;
- }
- }
-
-
- public AMQUserManagementMBean() throws JMException
- {
- super(UserManagement.class, UserManagement.TYPE);
- }
-
- public String getObjectInstanceName()
- {
- return UserManagement.TYPE;
- }
-
- public boolean setPassword(String username, char[] password)
- {
- try
- {
- //delegate password changes to the Principal Database
- return _principalDatabase.updatePassword(new UsernamePrincipal(username), password);
- }
- catch (AccountNotFoundException e)
- {
- _logger.warn("Attempt to set password of non-existant user'" + username + "'");
- return false;
- }
- }
-
- public boolean setRights(String username, boolean read, boolean write, boolean admin)
- {
-
- if (_accessRights.get(username) == null)
- {
- // If the user doesn't exist in the user rights file check that they at least have an account.
- if (_principalDatabase.getUser(username) == null)
- {
- return false;
- }
- }
-
- try
- {
-
- _accessRightsUpdate.lock();
-
- // Update the access rights
- if (admin)
- {
- _accessRights.put(username, MBeanInvocationHandlerImpl.ADMIN);
- }
- else
- {
- if (read | write)
- {
- if (read)
- {
- _accessRights.put(username, MBeanInvocationHandlerImpl.READONLY);
- }
- if (write)
- {
- _accessRights.put(username, MBeanInvocationHandlerImpl.READWRITE);
- }
- }
- else
- {
- _accessRights.remove(username);
- }
- }
-
- saveAccessFile();
- }
- finally
- {
- if (_accessRightsUpdate.isHeldByCurrentThread())
- {
- _accessRightsUpdate.unlock();
- }
- }
-
- return true;
- }
-
- public boolean createUser(String username, char[] password, boolean read, boolean write, boolean admin)
- {
- if (_principalDatabase.createPrincipal(new UsernamePrincipal(username), password))
- {
- _accessRights.put(username, "");
-
- return setRights(username, read, write, admin);
- }
-
- return false;
- }
-
- public boolean deleteUser(String username)
- {
-
- try
- {
- if (_principalDatabase.deletePrincipal(new UsernamePrincipal(username)))
- {
- try
- {
- _accessRightsUpdate.lock();
-
- _accessRights.remove(username);
- saveAccessFile();
- }
- finally
- {
- if (_accessRightsUpdate.isHeldByCurrentThread())
- {
- _accessRightsUpdate.unlock();
- }
- }
- return true;
- }
- }
- catch (AccountNotFoundException e)
- {
- _logger.warn("Attempt to delete user (" + username + ") that doesn't exist");
- }
-
- return false;
- }
-
- public boolean reloadData()
- {
- try
- {
- try
- {
- loadAccessFile();
- }
- catch (ConfigurationException e)
- {
- _logger.info("Reload failed due to:" + e);
- return false;
- }
-
- // Reload successful
- return true;
- }
- catch (IOException e)
- {
- _logger.info("Reload failed due to:" + e);
- // Reload unsuccessful
- return false;
- }
- }
-
-
- @MBeanOperation(name = "viewUsers", description = "All users with access rights to the system.")
- public TabularData viewUsers()
- {
- // Table of users
- // Username(string), Access rights Read,Write,Admin(bool,bool,bool)
-
- if (_userlistDataType == null)
- {
- _logger.warn("TabluarData not setup correctly");
- return null;
- }
-
- List<Principal> users = _principalDatabase.getUsers();
-
- TabularDataSupport userList = new TabularDataSupport(_userlistDataType);
-
- try
- {
- // Create the tabular list of message header contents
- for (Principal user : users)
- {
- // Create header attributes list
-
- String rights = (String) _accessRights.get(user.getName());
-
- Boolean read = false;
- Boolean write = false;
- Boolean admin = false;
-
- if (rights != null)
- {
- read = rights.equals(MBeanInvocationHandlerImpl.READONLY)
- || rights.equals(MBeanInvocationHandlerImpl.READWRITE);
- write = rights.equals(MBeanInvocationHandlerImpl.READWRITE);
- admin = rights.equals(MBeanInvocationHandlerImpl.ADMIN);
- }
-
- Object[] itemData = {user.getName(), read, write, admin};
- CompositeData messageData = new CompositeDataSupport(_userDataType, _userItemNames, itemData);
- userList.put(messageData);
- }
- }
- catch (OpenDataException e)
- {
- _logger.warn("Unable to create user list due to :" + e);
- return null;
- }
-
- return userList;
- }
-
- /*** Broker Methods **/
-
- /**
- * setPrincipalDatabase
- *
- * @param database set The Database to use for user lookup
- */
- public void setPrincipalDatabase(PrincipalDatabase database)
- {
- _principalDatabase = database;
- }
-
- /**
- * setAccessFile
- *
- * @param accessFile the file to use for updating.
- *
- * @throws java.io.IOException If the file cannot be accessed
- * @throws org.apache.commons.configuration.ConfigurationException
- * if checks on the file fail.
- */
- public void setAccessFile(String accessFile) throws IOException, ConfigurationException
- {
- _accessFileName = accessFile;
-
- if (_accessFileName != null)
- {
- loadAccessFile();
- }
- else
- {
- _logger.warn("Access rights file specified is null. Access rights not changed.");
- }
- }
-
- private void loadAccessFile() throws IOException, ConfigurationException
- {
- try
- {
- _accessRightsUpdate.lock();
-
- Properties accessRights = new Properties();
-
- File accessFile = new File(_accessFileName);
-
- if (!accessFile.exists())
- {
- throw new ConfigurationException("'" + _accessFileName + "' does not exist");
- }
-
- if (!accessFile.canRead())
- {
- throw new ConfigurationException("Cannot read '" + _accessFileName + "'.");
- }
-
- if (!accessFile.canWrite())
- {
- _logger.warn("Unable to write to access file '" + _accessFileName + "' changes will not be preserved.");
- }
-
- accessRights.load(new FileInputStream(accessFile));
- checkAccessRights(accessRights);
- setAccessRights(accessRights);
- }
- finally
- {
- if (_accessRightsUpdate.isHeldByCurrentThread())
- {
- _accessRightsUpdate.unlock();
- }
- }
- }
-
- private void checkAccessRights(Properties accessRights)
- {
- Enumeration values = accessRights.propertyNames();
-
- while (values.hasMoreElements())
- {
- String user = (String) values.nextElement();
-
- if (_principalDatabase.getUser(user) == null)
- {
- _logger.warn("Access rights contains user '" + user + "' but there is no authentication data for that user");
- }
- }
- }
-
- private void saveAccessFile()
- {
- try
- {
- _accessRightsUpdate.lock();
- try
- {
- // remove old temporary file
- File tmp = new File(_accessFileName + ".tmp");
- if (tmp.exists())
- {
- tmp.delete();
- }
-
- //remove old backup
- File old = new File(_accessFileName + ".old");
- if (old.exists())
- {
- old.delete();
- }
-
- // Rename current file
- File rights = new File(_accessFileName);
- rights.renameTo(old);
-
- FileOutputStream output = new FileOutputStream(tmp);
- _accessRights.store(output, "Generated by AMQUserManagementMBean Console : Last edited by user:" + getCurrentJMXUser());
- output.close();
-
- // Rename new file to main file
- tmp.renameTo(rights);
-
- // delete tmp
- tmp.delete();
- }
- catch (IOException e)
- {
- _logger.warn("Problem occured saving '" + _accessFileName + "' changes may not be preserved. :" + e);
- }
- }
- finally
- {
- if (_accessRightsUpdate.isHeldByCurrentThread())
- {
- _accessRightsUpdate.unlock();
- }
- }
- }
-
- private String getCurrentJMXUser()
- {
- AccessControlContext acc = AccessController.getContext();
-
- Subject subject = Subject.getSubject(acc);
- if (subject == null)
- {
- return "Unknown user, authentication Subject was null";
- }
-
- // Retrieve JMXPrincipal from Subject
- Set<JMXPrincipal> principals = subject.getPrincipals(JMXPrincipal.class);
- if (principals == null || principals.isEmpty())
- {
- return "Unknown user principals were null";
- }
-
- Principal principal = principals.iterator().next();
- return principal.getName();
- }
-
- /**
- * user=read user=write user=readwrite user=admin
- *
- * @param accessRights The properties list of access rights to process
- */
- private void setAccessRights(Properties accessRights)
- {
- _logger.debug("Setting Access Rights:" + accessRights);
- _accessRights = accessRights;
- MBeanInvocationHandlerImpl.setAccessRights(_accessRights);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/UserManagement.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/UserManagement.java
deleted file mode 100644
index 658d7ebbd3..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/management/UserManagement.java
+++ /dev/null
@@ -1,118 +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.
- *
- *
- */
-package org.apache.qpid.server.security.access.management;
-
-import org.apache.qpid.server.management.MBeanOperation;
-import org.apache.qpid.server.management.MBeanOperationParameter;
-import org.apache.qpid.server.management.MBeanAttribute;
-import org.apache.qpid.AMQException;
-
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.CompositeData;
-import javax.management.JMException;
-import javax.management.MBeanOperationInfo;
-import java.io.IOException;
-
-public interface UserManagement
-{
- String TYPE = "UserManagement";
-
- //********** Operations *****************//
- /**
- * set password for user
- *
- * @param username The username to create
- * @param password The password for the user
- *
- * @return The result of the operation
- */
- @MBeanOperation(name = "setPassword", description = "Set password for user.",
- impact = MBeanOperationInfo.ACTION)
- boolean setPassword(@MBeanOperationParameter(name = "username", description = "Username")String username,
- @MBeanOperationParameter(name = "password", description = "Password")char[] password);
-
- /**
- * set rights for users with given details
- *
- * @param username The username to create
- * @param read The set of permission to give the new user
- * @param write The set of permission to give the new user
- * @param admin The set of permission to give the new user
- *
- * @return The result of the operation
- */
- @MBeanOperation(name = "setRights", description = "Set access rights for user.",
- impact = MBeanOperationInfo.ACTION)
- boolean setRights(@MBeanOperationParameter(name = "username", description = "Username")String username,
- @MBeanOperationParameter(name = "read", description = "Administration read")boolean read,
- @MBeanOperationParameter(name = "readAndWrite", description = "Administration write")boolean write,
- @MBeanOperationParameter(name = "admin", description = "Administration rights")boolean admin);
-
- /**
- * Create users with given details
- *
- * @param username The username to create
- * @param password The password for the user
- * @param read The set of permission to give the new user
- * @param write The set of permission to give the new user
- * @param admin The set of permission to give the new user
- *
- * @return The result of the operation
- */
- @MBeanOperation(name = "createUser", description = "Create new user from system.",
- impact = MBeanOperationInfo.ACTION)
- boolean createUser(@MBeanOperationParameter(name = "username", description = "Username")String username,
- @MBeanOperationParameter(name = "password", description = "Password")char[] password,
- @MBeanOperationParameter(name = "read", description = "Administration read")boolean read,
- @MBeanOperationParameter(name = "readAndWrite", description = "Administration write")boolean write,
- @MBeanOperationParameter(name = "admin", description = "Administration rights")boolean admin);
-
- /**
- * View users returns all the users that are currently available to the system.
- *
- * @param username The user to delete
- *
- * @return The result of the operation
- */
- @MBeanOperation(name = "deleteUser", description = "Delete user from system.",
- impact = MBeanOperationInfo.ACTION)
- boolean deleteUser(@MBeanOperationParameter(name = "username", description = "Username")String username);
-
-
- /**
- * Reload the date from disk
- *
- * @return The result of the operation
- */
- @MBeanOperation(name = "reloadData", description = "Reload the authentication file from disk.",
- impact = MBeanOperationInfo.ACTION)
- boolean reloadData();
-
- /**
- * View users returns all the users that are currently available to the system.
- *
- * @return a table of users data (Username, read, write, admin)
- */
- @MBeanOperation(name = "viewUsers", description = "All users with access rights to the system.",
- impact = MBeanOperationInfo.INFO)
- TabularData viewUsers();
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/AllowAll.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/AllowAll.java
deleted file mode 100644
index 9b784069dd..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/AllowAll.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.security.access.plugins;
-
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.ACLManager;
-import org.apache.qpid.server.security.access.AccessResult;
-import org.apache.qpid.server.security.access.Accessable;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.commons.configuration.Configuration;
-
-public class AllowAll implements ACLPlugin
-{
- public AccessResult authorise(AMQProtocolSession session, Permission permission, AMQMethodBody body, Object... parameters)
- {
- if (ACLManager.getLogger().isDebugEnabled())
- {
- ACLManager.getLogger().debug("Allowing user:" + session.getAuthorizedID() + " for :" + permission.toString()
- + " on " + body.getClass().getSimpleName()
- + (parameters == null || parameters.length == 0 ? "" : "-" + accessablesToString(parameters)));
- }
-
- return new AccessResult(this, AccessResult.AccessStatus.GRANTED);
- }
-
- public static String accessablesToString(Object[] accessObject)
- {
- StringBuilder sb = new StringBuilder();
-
- for (Object access : accessObject)
- {
- sb.append(access.getClass().getSimpleName() + ":" + access.toString() + ", ");
- }
-
- return sb.delete(sb.length() - 2, sb.length()).toString();
- }
-
- public String getPluginName()
- {
- return "AllowAll";
- }
-
- public void setConfiguaration(Configuration config)
- {
- //no-op
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/DenyAll.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/DenyAll.java
deleted file mode 100644
index 80c125e737..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/DenyAll.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.security.access.plugins;
-
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.security.access.ACLManager;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.AccessResult;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.commons.configuration.Configuration;
-
-public class DenyAll implements ACLPlugin
-{
- public AccessResult authorise(AMQProtocolSession session, Permission permission, AMQMethodBody body, Object... parameters) throws AMQConnectionException
- {
-
- if (ACLManager.getLogger().isInfoEnabled())
- {
- }
- ACLManager.getLogger().info("Denying user:" + session.getAuthorizedID() + " for :" + permission.toString()
- + " on " + body.getClass().getSimpleName()
- + (parameters == null || parameters.length == 0 ? "" : "-" + AllowAll.accessablesToString(parameters)));
-
- throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, "DenyAll Plugin");
- }
-
- public String getPluginName()
- {
- return "DenyAll";
- }
-
- public void setConfiguaration(Configuration config)
- {
- //no-op
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/SimpleXML.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/SimpleXML.java
deleted file mode 100644
index 251f4e6330..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/plugins/SimpleXML.java
+++ /dev/null
@@ -1,342 +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.
- *
- *
- */
-
-package org.apache.qpid.server.security.access.plugins;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicConsumeBody;
-import org.apache.qpid.framing.BasicPublishBody;
-
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.security.access.ACLManager;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.AccessResult;
-import org.apache.qpid.server.security.access.Permission;
-import org.apache.qpid.server.security.access.PrincipalPermissions;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * This uses the default
- */
-public class SimpleXML implements ACLPlugin
-{
- private Map<String, PrincipalPermissions> _users;
- private final AccessResult GRANTED = new AccessResult(this, AccessResult.AccessStatus.GRANTED);
-
- public SimpleXML()
- {
- _users = new ConcurrentHashMap<String, PrincipalPermissions>();
- }
-
- public void setConfiguaration(Configuration config)
- {
- processConfig(config);
- }
-
- private void processConfig(Configuration config)
- {
- processPublish(config);
-
- processConsume(config);
-
- processCreate(config);
- }
-
- /**
- * Publish format takes
- * Exchange + Routing Key Pairs
- *
- * @param config XML Configuration
- */
- private void processPublish(Configuration config)
- {
- Configuration publishConfig = config.subset("security.access_control_list.publish");
-
- //Process users that have full publish permission
- String[] users = publishConfig.getStringArray("users.user");
-
- for (String user : users)
- {
- grant(Permission.PUBLISH, user);
- }
-
- // Process exchange limited users
- int exchangeCount = 0;
- Configuration exchangeConfig = publishConfig.subset("exchanges.exchange(" + exchangeCount + ")");
-
- while (!exchangeConfig.isEmpty())
- {
- //Get Exchange Name
- AMQShortString exchangeName = new AMQShortString(exchangeConfig.getString("name"));
-
- //Get Routing Keys
- int keyCount = 0;
- Configuration routingkeyConfig = exchangeConfig.subset("routing_keys.routing_key(" + keyCount + ")");
-
- while (!routingkeyConfig.isEmpty())
- {
- //Get RoutingKey Value
- AMQShortString routingKeyValue = new AMQShortString(routingkeyConfig.getString("value"));
-
- //Apply Exchange + RoutingKey permissions to Users
- users = routingkeyConfig.getStringArray("users.user");
- for (String user : users)
- {
- grant(Permission.PUBLISH, user, exchangeName, routingKeyValue);
- }
-
- //Apply permissions to Groups
-
- // Check for more configs
- keyCount++;
- routingkeyConfig = exchangeConfig.subset("routing_keys.routing_key(" + keyCount + ")");
- }
-
- //Apply Exchange wide permissions to Users
- users = exchangeConfig.getStringArray("exchange(" + exchangeCount + ").users.user");
-
- for (String user : users)
- {
- grant(Permission.PUBLISH, user, exchangeName);
- }
-
- //Apply permissions to Groups
- exchangeCount++;
- exchangeConfig = publishConfig.subset("exchanges.exchange(" + exchangeCount + ")");
- }
- }
-
- private void grant(Permission permission, String user, Object... parameters)
- {
- PrincipalPermissions permissions = _users.get(user);
-
- if (permissions == null)
- {
- permissions = new PrincipalPermissions(user);
- }
-
- _users.put(user, permissions);
- permissions.grant(permission, parameters);
- }
-
- private void processConsume(Configuration config)
- {
- Configuration consumeConfig = config.subset("security.access_control_list.consume");
-
- // Process queue limited users
- int queueCount = 0;
- Configuration queueConfig = consumeConfig.subset("queues.queue(" + queueCount + ")");
-
- while (!queueConfig.isEmpty())
- {
- //Get queue Name
- AMQShortString queueName = new AMQShortString(queueConfig.getString("name"));
- // if there is no name then there may be a temporary element
- boolean temporary = queueConfig.containsKey("temporary");
- boolean ownQueues = queueConfig.containsKey("own_queues");
-
- //Process permissions for this queue
- String[] users = queueConfig.getStringArray("users.user");
- for (String user : users)
- {
- grant(Permission.CONSUME, user, queueName, temporary, ownQueues);
- }
-
- //See if we have another config
- queueCount++;
- queueConfig = consumeConfig.subset("queues.queue(" + queueCount + ")");
- }
-
- // Process users that have full consume permission
- String[] users = consumeConfig.getStringArray("users.user");
-
- for (String user : users)
- {
- grant(Permission.CONSUME, user);
- }
- }
-
- private void processCreate(Configuration config)
- {
- Configuration createConfig = config.subset("security.access_control_list.create");
-
- // Process create permissions for queue creation
- int queueCount = 0;
- Configuration queueConfig = createConfig.subset("queues.queue(" + queueCount + ")");
-
- while (!queueConfig.isEmpty())
- {
- //Get queue Name
- AMQShortString queueName = new AMQShortString(queueConfig.getString("name"));
-
- // if there is no name then there may be a temporary element
- boolean temporary = queueConfig.containsKey("temporary");
-
- int exchangeCount = 0;
- Configuration exchangeConfig = queueConfig.subset("exchanges.exchange(" + exchangeCount + ")");
-
- while (!exchangeConfig.isEmpty())
- {
-
- AMQShortString exchange = new AMQShortString(exchangeConfig.getString("name"));
- AMQShortString routingKey = new AMQShortString(exchangeConfig.getString("routing_key"));
-
- //Process permissions for this queue
- String[] users = exchangeConfig.getStringArray("users.user");
- for (String user : users)
- {
- grant(Permission.CREATE, user, temporary,
- (queueName.equals("") ? null : queueName),
- (exchange.equals("") ? null : exchange),
- (routingKey.equals("") ? null : routingKey));
- }
-
- //See if we have another config
- exchangeCount++;
- exchangeConfig = queueConfig.subset("exchanges.exchange(" + exchangeCount + ")");
- }
-
- // Process users that are not bound to an exchange
- String[] users = queueConfig.getStringArray("users.user");
-
- for (String user : users)
- {
- grant(Permission.CREATE, user, temporary, queueName);
- }
-
- //See if we have another config
- queueCount++;
- queueConfig = createConfig.subset("queues.queue(" + queueCount + ")");
- }
-
- // Process create permissions for exchange creation
- int exchangeCount = 0;
- Configuration exchangeConfig = createConfig.subset("exchanges.exchange(" + exchangeCount + ")");
-
- while (!exchangeConfig.isEmpty())
- {
- AMQShortString exchange = new AMQShortString(exchangeConfig.getString("name"));
- AMQShortString clazz = new AMQShortString(exchangeConfig.getString("class"));
-
- //Process permissions for this queue
- String[] users = exchangeConfig.getStringArray("users.user");
- for (String user : users)
- {
- grant(Permission.CREATE, user, exchange, clazz);
- }
-
- //See if we have another config
- exchangeCount++;
- exchangeConfig = queueConfig.subset("exchanges.exchange(" + exchangeCount + ")");
- }
-
- // Process users that have full create permission
- String[] users = createConfig.getStringArray("users.user");
-
- for (String user : users)
- {
- grant(Permission.CREATE, user);
- }
-
-
- }
-
- public String getPluginName()
- {
- return "Simple";
- }
-
- public AccessResult authorise(AMQProtocolSession session, Permission permission, AMQMethodBody body, Object... parameters) throws AMQConnectionException
- {
- String error = "";
-
- if (ACLManager.getLogger().isInfoEnabled())
- {
- ACLManager.getLogger().info("Simple Authorisation processing user:" + session.getAuthorizedID() + " for :" + permission.toString()
- + " on " + body.getClass().getSimpleName()
- + (parameters == null || parameters.length == 0 ? "" : "-" + AllowAll.accessablesToString(parameters)));
- }
-
- String username = session.getAuthorizedID().getName();
-
- //Get the Users Permissions
- PrincipalPermissions permissions = _users.get(username);
-
- if (permissions != null)
- {
- switch (permission)
- {
- case ACCESS:
- return GRANTED;
- case BIND: // Body QueueDeclareBody - Parameters : Exchange, Queue, QueueName
- // Body QueueBindBody - Paramters : Exchange, Queue, QueueName
- if (parameters.length == 3)
- {
- // Parameters : Exchange, Queue, RoutingKey
- if (permissions.authorise(Permission.BIND, body, parameters[0], parameters[1], parameters[2]))
- {
- return GRANTED;
- }
- }
- break;
- case CONSUME: // Parameters : none
- if (parameters.length == 1 && permissions.authorise(Permission.CONSUME, parameters[0]))
- {
- return GRANTED;
- }
- break;
- case CREATE: // Body : QueueDeclareBody | ExchangeDeclareBody - Parameters : none
- if (permissions.authorise(Permission.CREATE, body))
- {
- return GRANTED;
- }
- break;
- case PUBLISH: // Body : BasicPublishBody Parameters : exchange
- if (parameters.length == 1 && parameters[0] instanceof Exchange)
- {
- if (permissions.authorise(Permission.PUBLISH, ((Exchange) parameters[0]).getName(),
- ((BasicPublishBody) body).getRoutingKey()))
- {
- return GRANTED;
- }
- }
- break;
- case PURGE:
- break;
- case DELETE:
- break;
- case UNBIND:
- break;
- }
- }
-
- //todo potential refactor this ConnectionException Out of here
- throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, error);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java
deleted file mode 100644
index 3f846b9dd0..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java
+++ /dev/null
@@ -1,63 +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.
- *
- */
-package org.apache.qpid.server.security.auth;
-
-import javax.security.sasl.SaslException;
-
-public class AuthenticationResult
-{
- public enum AuthenticationStatus
- {
- SUCCESS, CONTINUE, ERROR
- }
-
- public AuthenticationStatus status;
- public byte[] challenge;
-
- private Exception cause;
-
- public AuthenticationResult(AuthenticationStatus status)
- {
- this(null, status, null);
- }
-
- public AuthenticationResult(byte[] challenge, AuthenticationStatus status)
- {
- this(challenge, status, null);
- }
-
- public AuthenticationResult(AuthenticationStatus error, Exception cause)
- {
- this(null, error, cause);
- }
-
- public AuthenticationResult(byte[] challenge, AuthenticationStatus status, Exception cause)
- {
- this.status = status;
- this.challenge = challenge;
- this.cause = cause;
- }
-
- public Exception getCause()
- {
- return cause;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java
deleted file mode 100644
index cca9deb6da..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java
+++ /dev/null
@@ -1,499 +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.
- *
- *
- */
-package org.apache.qpid.server.security.auth.database;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.security.access.management.AMQUserManagementMBean;
-import org.apache.qpid.server.security.auth.sasl.AuthenticationProviderInitialiser;
-import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
-import org.apache.qpid.server.security.auth.sasl.crammd5.CRAMMD5HashedInitialiser;
-
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.login.AccountNotFoundException;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.security.Principal;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.locks.ReentrantLock;
-import java.util.regex.Pattern;
-
-/**
- * Represents a user database where the account information is stored in a simple flat file.
- *
- * The file is expected to be in the form: username:password username1:password1 ... usernamen:passwordn
- *
- * where a carriage return separates each username/password pair. Passwords are assumed to be in plain text.
- */
-public class Base64MD5PasswordFilePrincipalDatabase implements PrincipalDatabase
-{
- private static final Logger _logger = Logger.getLogger(Base64MD5PasswordFilePrincipalDatabase.class);
-
- private File _passwordFile;
-
- private Pattern _regexp = Pattern.compile(":");
-
- private Map<String, AuthenticationProviderInitialiser> _saslServers;
-
- AMQUserManagementMBean _mbean;
- public static final String DEFAULT_ENCODING = "utf-8";
- private Map<String, HashedUser> _users = new HashMap<String, HashedUser>();
- private ReentrantLock _userUpdate = new ReentrantLock();
-
- public Base64MD5PasswordFilePrincipalDatabase()
- {
- _saslServers = new HashMap<String, AuthenticationProviderInitialiser>();
-
- /**
- * Create Authenticators for MD5 Password file.
- */
-
- // Accept Plain incomming and hash it for comparison to the file.
- CRAMMD5HashedInitialiser cram = new CRAMMD5HashedInitialiser();
- cram.initialise(this);
- _saslServers.put(cram.getMechanismName(), cram);
-
- //fixme The PDs should setup a PD Mangement MBean
-// try
-// {
-// _mbean = new AMQUserManagementMBean();
-// _mbean.setPrincipalDatabase(this);
-// }
-// catch (JMException e)
-// {
-// _logger.warn("User management disabled as unable to create MBean:" + e);
-// }
- }
-
- public void setPasswordFile(String passwordFile) throws IOException
- {
- File f = new File(passwordFile);
- _logger.info("PasswordFilePrincipalDatabase using file " + f.getAbsolutePath());
- _passwordFile = f;
- if (!f.exists())
- {
- throw new FileNotFoundException("Cannot find password file " + f);
- }
- if (!f.canRead())
- {
- throw new FileNotFoundException("Cannot read password file " + f +
- ". Check permissions.");
- }
-
- loadPasswordFile();
- }
-
- /**
- * SASL Callback Mechanism - sets the Password in the PasswordCallback based on the value in the PasswordFile
- * If you want to change the password for a user, use updatePassword instead.
- *
- * @param principal The Principal to set the password for
- * @param callback The PasswordCallback to call setPassword on
- *
- * @throws AccountNotFoundException If the Principal cannont be found in this Database
- */
- public void setPassword(Principal principal, PasswordCallback callback) throws AccountNotFoundException
- {
- if (_passwordFile == null)
- {
- throw new AccountNotFoundException("Unable to locate principal since no password file was specified during initialisation");
- }
- if (principal == null)
- {
- throw new IllegalArgumentException("principal must not be null");
- }
-
- char[] pwd = lookupPassword(principal.getName());
-
- if (pwd != null)
- {
- callback.setPassword(pwd);
- }
- else
- {
- throw new AccountNotFoundException("No account found for principal " + principal);
- }
- }
-
- /**
- * Used to verify that the presented Password is correct. Currently only used by Management Console
- *
- * @param principal The principal to authenticate
- * @param password The password to check
- *
- * @return true if password is correct
- *
- * @throws AccountNotFoundException if the principal cannot be found
- */
- public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException
- {
- char[] pwd = lookupPassword(principal);
-
- return compareCharArray(pwd, password);
- }
-
- private boolean compareCharArray(char[] a, char[] b)
- {
- boolean equal = false;
- if (a.length == b.length)
- {
- equal = true;
- int index = 0;
- while (equal && index < a.length)
- {
- equal = a[index] == b[index];
- index++;
- }
- }
- return equal;
- }
-
- /**
- * Changes the password for the specified user
- *
- * @param principal to change the password for
- * @param password plaintext password to set the password too
- */
- public boolean updatePassword(Principal principal, char[] password) throws AccountNotFoundException
- {
- HashedUser user = _users.get(principal.getName());
-
- if (user == null)
- {
- throw new AccountNotFoundException(principal.getName());
- }
-
- try
- {
- try
- {
- _userUpdate.lock();
- char[] orig = user.getPassword();
- user.setPassword(password);
-
- try
- {
- savePasswordFile();
- }
- catch (IOException e)
- {
- _logger.error("Unable to save password file, password change for user'"
- + principal + "' will revert at restart");
- //revert the password change
- user.setPassword(orig);
- return false;
- }
- return true;
- }
- finally
- {
- if (_userUpdate.isHeldByCurrentThread())
- {
- _userUpdate.unlock();
- }
- }
- }
- catch (Exception e)
- {
- return false;
- }
- }
-
- public boolean createPrincipal(Principal principal, char[] password)
- {
- if (_users.get(principal.getName()) != null)
- {
- return false;
- }
-
- HashedUser user = new HashedUser(principal.getName(), password);
-
- try
- {
- _userUpdate.lock();
- _users.put(user.getName(), user);
-
- try
- {
- savePasswordFile();
- return true;
- }
- catch (IOException e)
- {
- //remove the use on failure.
- _users.remove(user.getName());
- return false;
- }
- }
- finally
- {
- if (_userUpdate.isHeldByCurrentThread())
- {
- _userUpdate.unlock();
- }
- }
- }
-
- public boolean deletePrincipal(Principal principal) throws AccountNotFoundException
- {
- HashedUser user = _users.get(principal.getName());
-
- if (user == null)
- {
- throw new AccountNotFoundException(principal.getName());
- }
-
- try
- {
- _userUpdate.lock();
- user.delete();
-
- try
- {
- savePasswordFile();
- }
- catch (IOException e)
- {
- _logger.warn("Unable to remove user '" + user.getName() + "' from password file.");
- return false;
- }
-
- _users.remove(user.getName());
- }
- finally
- {
- if (_userUpdate.isHeldByCurrentThread())
- {
- _userUpdate.unlock();
- }
- }
-
- return true;
- }
-
- public Map<String, AuthenticationProviderInitialiser> getMechanisms()
- {
- return _saslServers;
- }
-
- public List<Principal> getUsers()
- {
- return new LinkedList<Principal>(_users.values());
- }
-
- public Principal getUser(String username)
- {
- if (_users.containsKey(username))
- {
- return new UsernamePrincipal(username);
- }
- return null;
- }
-
- /**
- * Looks up the password for a specified user in the password file. Note this code is <b>not</b> secure since it
- * creates strings of passwords. It should be modified to create only char arrays which get nulled out.
- *
- * @param name The principal name to lookup
- *
- * @return a char[] for use in SASL.
- */
- private char[] lookupPassword(String name)
- {
- HashedUser user = _users.get(name);
- if (user == null)
- {
- return null;
- }
- else
- {
- return user.getPassword();
- }
- }
-
- private void loadPasswordFile() throws IOException
- {
- try
- {
- _userUpdate.lock();
- _users.clear();
-
- BufferedReader reader = null;
- try
- {
- reader = new BufferedReader(new FileReader(_passwordFile));
- String line;
-
- while ((line = reader.readLine()) != null)
- {
- String[] result = _regexp.split(line);
- if (result == null || result.length < 2 || result[0].startsWith("#"))
- {
- continue;
- }
-
- HashedUser user = new HashedUser(result);
- _logger.info("Created user:" + user);
- _users.put(user.getName(), user);
- }
- }
- finally
- {
- if (reader != null)
- {
- reader.close();
- }
- }
- }
- finally
- {
- if (_userUpdate.isHeldByCurrentThread())
- {
- _userUpdate.unlock();
- }
- }
- }
-
- private void savePasswordFile() throws IOException
- {
- try
- {
- _userUpdate.lock();
-
- BufferedReader reader = null;
- PrintStream writer = null;
- File tmp = new File(_passwordFile.getAbsolutePath() + ".tmp");
- if (tmp.exists())
- {
- tmp.delete();
- }
-
- try
- {
- writer = new PrintStream(tmp);
- reader = new BufferedReader(new FileReader(_passwordFile));
- String line;
-
- while ((line = reader.readLine()) != null)
- {
- String[] result = _regexp.split(line);
- if (result == null || result.length < 2 || result[0].startsWith("#"))
- {
- writer.write(line.getBytes(DEFAULT_ENCODING));
- writer.println();
- continue;
- }
-
- HashedUser user = _users.get(result[0]);
-
- if (user == null)
- {
- writer.write(line.getBytes(DEFAULT_ENCODING));
- writer.println();
- }
- else if (!user.isDeleted())
- {
- if (!user.isModified())
- {
- writer.write(line.getBytes(DEFAULT_ENCODING));
- writer.println();
- }
- else
- {
- try
- {
- byte[] encodedPassword = user.getEncodedPassword();
-
- writer.write((user.getName() + ":").getBytes(DEFAULT_ENCODING));
- writer.write(encodedPassword);
- writer.println();
-
- user.saved();
- }
- catch (Exception e)
- {
- _logger.warn("Unable to encode new password reverting to old password.");
- writer.write(line.getBytes(DEFAULT_ENCODING));
- writer.println();
- }
- }
- }
- }
-
- for (HashedUser user : _users.values())
- {
- if (user.isModified())
- {
- byte[] encodedPassword;
- try
- {
- encodedPassword = user.getEncodedPassword();
- writer.write((user.getName() + ":").getBytes(DEFAULT_ENCODING));
- writer.write(encodedPassword);
- writer.println();
- user.saved();
- }
- catch (Exception e)
- {
- _logger.warn("Unable to get Encoded password for user'" + user.getName() + "' password not saved");
- }
- }
- }
- }
- finally
- {
- if (reader != null)
- {
- reader.close();
- }
-
- if (writer != null)
- {
- writer.close();
- }
-
- // Swap temp file to main password file.
- File old = new File(_passwordFile.getAbsoluteFile() + ".old");
- if (old.exists())
- {
- old.delete();
- }
- _passwordFile.renameTo(old);
- tmp.renameTo(_passwordFile);
- tmp.delete();
- }
- }
- finally
- {
- if (_userUpdate.isHeldByCurrentThread())
- {
- _userUpdate.unlock();
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java
deleted file mode 100644
index 15c62a62e4..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java
+++ /dev/null
@@ -1,235 +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.
- *
- */
-package org.apache.qpid.server.security.auth.database;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.configuration.PropertyUtils;
-import org.apache.qpid.configuration.PropertyException;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabaseManager;
-import org.apache.qpid.server.security.access.management.AMQUserManagementMBean;
-import org.apache.qpid.AMQException;
-
-import javax.management.JMException;
-
-public class ConfigurationFilePrincipalDatabaseManager implements PrincipalDatabaseManager
-{
- private static final Logger _logger = Logger.getLogger(ConfigurationFilePrincipalDatabaseManager.class);
-
- private static final String _base = "security.principal-databases.principal-database";
-
- Map<String, PrincipalDatabase> _databases;
-
- public ConfigurationFilePrincipalDatabaseManager(Configuration configuration) throws Exception
- {
- _logger.info("Initialising PrincipleDatabase authentication manager");
- _databases = initialisePrincipalDatabases(configuration);
- }
-
- private Map<String, PrincipalDatabase> initialisePrincipalDatabases(Configuration configuration) throws Exception
- {
- List<String> databaseNames = configuration.getList(_base + ".name");
- List<String> databaseClasses = configuration.getList(_base + ".class");
- Map<String, PrincipalDatabase> databases = new HashMap<String, PrincipalDatabase>();
-
- if (databaseNames.size() == 0)
- {
- _logger.warn("No Principal databases specified. Broker running with NO AUTHENTICATION");
- }
-
- for (int i = 0; i < databaseNames.size(); i++)
- {
- Object o;
- try
- {
- o = Class.forName(databaseClasses.get(i)).newInstance();
- }
- catch (Exception e)
- {
- throw new Exception("Error initialising principal database: " + e, e);
- }
-
- if (!(o instanceof PrincipalDatabase))
- {
- throw new Exception("Principal databases must implement the PrincipalDatabase interface");
- }
-
- initialisePrincipalDatabase((PrincipalDatabase) o, configuration, i);
-
- String name = databaseNames.get(i);
- if ((name == null) || (name.length() == 0))
- {
- throw new Exception("Principal database names must have length greater than or equal to one character");
- }
-
- PrincipalDatabase pd = databases.get(name);
- if (pd != null)
- {
- throw new Exception("Duplicate principal database name not provided");
- }
-
- _logger.info("Initialised principal database '" + name + "' successfully");
- databases.put(name, (PrincipalDatabase) o);
- }
-
- return databases;
- }
-
- private void initialisePrincipalDatabase(PrincipalDatabase principalDatabase, Configuration config, int index)
- throws FileNotFoundException, ConfigurationException
- {
- String baseName = _base + "(" + index + ").attributes.attribute.";
- List<String> argumentNames = config.getList(baseName + "name");
- List<String> argumentValues = config.getList(baseName + "value");
- for (int i = 0; i < argumentNames.size(); i++)
- {
- String argName = argumentNames.get(i);
- if ((argName == null) || (argName.length() == 0))
- {
- throw new ConfigurationException("Argument names must have length >= 1 character");
- }
-
- if (Character.isLowerCase(argName.charAt(0)))
- {
- argName = Character.toUpperCase(argName.charAt(0)) + argName.substring(1);
- }
-
- String methodName = "set" + argName;
- Method method = null;
- try
- {
- method = principalDatabase.getClass().getMethod(methodName, String.class);
- }
- catch (Exception e)
- {
- // do nothing.. as on error method will be null
- }
-
- if (method == null)
- {
- throw new ConfigurationException("No method " + methodName + " found in class "
- + principalDatabase.getClass()
- + " hence unable to configure principal database. The method must be public and "
- + "have a single String argument with a void return type");
- }
-
- try
- {
- method.invoke(principalDatabase, PropertyUtils.replaceProperties(argumentValues.get(i)));
- }
- catch (Exception ite)
- {
- if (ite instanceof ConfigurationException)
- {
- throw(ConfigurationException) ite;
- }
- else
- {
- throw new ConfigurationException(ite.getMessage(), ite);
- }
- }
- }
- }
-
- public Map<String, PrincipalDatabase> getDatabases()
- {
- return _databases;
- }
-
- public void initialiseManagement(Configuration config) throws ConfigurationException
- {
- try
- {
- AMQUserManagementMBean _mbean = new AMQUserManagementMBean();
-
- String baseSecurity = "security.jmx";
- List<String> principalDBs = config.getList(baseSecurity + ".principal-database");
-
- if (principalDBs.size() == 0)
- {
- throw new ConfigurationException("No principal-database specified for jmx security(" + baseSecurity + ".principal-database)");
- }
-
- String databaseName = principalDBs.get(0);
-
- PrincipalDatabase database = getDatabases().get(databaseName);
-
- if (database == null)
- {
- throw new ConfigurationException("Principal-database '" + databaseName + "' not found");
- }
-
- _mbean.setPrincipalDatabase(database);
-
- List<String> jmxaccesslist = config.getList(baseSecurity + ".access");
-
- if (jmxaccesslist.size() == 0)
- {
- throw new ConfigurationException("No access control files specified for jmx security(" + baseSecurity + ".access)");
- }
-
- String jmxaccesssFile = null;
-
- try
- {
- jmxaccesssFile = PropertyUtils.replaceProperties(jmxaccesslist.get(0));
- }
- catch (PropertyException e)
- {
- throw new ConfigurationException("Unable to parse access control filename '" + jmxaccesssFile + "'");
- }
-
- try
- {
- _mbean.setAccessFile(jmxaccesssFile);
- }
- catch (IOException e)
- {
- _logger.warn("Unable to load access file:" + jmxaccesssFile);
- }
-
- try
- {
- _mbean.register();
- }
- catch (AMQException e)
- {
- _logger.warn("Unable to register user management MBean");
- }
- }
- catch (JMException e)
- {
- _logger.warn("User management disabled as unable to create MBean:" + e);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/HashedUser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/HashedUser.java
deleted file mode 100644
index 4d92e3fb4c..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/HashedUser.java
+++ /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.
- *
- */
-package org.apache.qpid.server.security.auth.database;
-
-import org.apache.commons.codec.EncoderException;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.log4j.Logger;
-
-import java.io.UnsupportedEncodingException;
-import java.security.NoSuchAlgorithmException;
-import java.security.Principal;
-
-public class HashedUser implements Principal
-{
- private static final Logger _logger = Logger.getLogger(HashedUser.class);
-
- String _name;
- char[] _password;
- byte[] _encodedPassword = null;
- private boolean _modified = false;
- private boolean _deleted = false;
-
- HashedUser(String[] data) throws UnsupportedEncodingException
- {
- if (data.length != 2)
- {
- throw new IllegalArgumentException("User Data should be length 2, username, password");
- }
-
- _name = data[0];
-
- byte[] encoded_password = data[1].getBytes(Base64MD5PasswordFilePrincipalDatabase.DEFAULT_ENCODING);
-
- Base64 b64 = new Base64();
- byte[] decoded = b64.decode(encoded_password);
-
- _encodedPassword = encoded_password;
-
- _password = new char[decoded.length];
-
- int index = 0;
- for (byte c : decoded)
- {
- _password[index++] = (char) c;
- }
- }
-
- public HashedUser(String name, char[] password)
- {
- _name = name;
- setPassword(password);
- }
-
- public String getName()
- {
- return _name;
- }
-
- public String toString()
- {
- return _name;
- }
-
- char[] getPassword()
- {
- return _password;
- }
-
- void setPassword(char[] password)
- {
- _password = password;
- _modified = true;
- _encodedPassword = null;
- }
-
- byte[] getEncodedPassword() throws EncoderException, UnsupportedEncodingException, NoSuchAlgorithmException
- {
- if (_encodedPassword == null)
- {
- encodePassword();
- }
- return _encodedPassword;
- }
-
- private void encodePassword() throws EncoderException, UnsupportedEncodingException, NoSuchAlgorithmException
- {
- byte[] byteArray = new byte[_password.length];
- int index = 0;
- for (char c : _password)
- {
- byteArray[index++] = (byte) c;
- }
- _encodedPassword = (new Base64()).encode(byteArray);
- }
-
- public boolean isModified()
- {
- return _modified;
- }
-
- public boolean isDeleted()
- {
- return _deleted;
- }
-
- public void delete()
- {
- _deleted = true;
- }
-
- public void saved()
- {
- _modified = false;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java
deleted file mode 100644
index 352d41a0ba..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java
+++ /dev/null
@@ -1,240 +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.
- *
- *
- */
-package org.apache.qpid.server.security.auth.database;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.security.auth.sasl.AuthenticationProviderInitialiser;
-import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
-import org.apache.qpid.server.security.auth.sasl.amqplain.AmqPlainInitialiser;
-import org.apache.qpid.server.security.auth.sasl.crammd5.CRAMMD5Initialiser;
-import org.apache.qpid.server.security.auth.sasl.plain.PlainInitialiser;
-
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.login.AccountNotFoundException;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.security.Principal;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-/**
- * Represents a user database where the account information is stored in a simple flat file.
- *
- * The file is expected to be in the form: username:password username1:password1 ... usernamen:passwordn
- *
- * where a carriage return separates each username/password pair. Passwords are assumed to be in plain text.
- */
-public class PlainPasswordFilePrincipalDatabase implements PrincipalDatabase
-{
- private static final Logger _logger = Logger.getLogger(PlainPasswordFilePrincipalDatabase.class);
-
- protected File _passwordFile;
-
- protected Pattern _regexp = Pattern.compile(":");
-
- protected Map<String, AuthenticationProviderInitialiser> _saslServers;
-
- public PlainPasswordFilePrincipalDatabase()
- {
- _saslServers = new HashMap<String, AuthenticationProviderInitialiser>();
-
- /**
- * Create Authenticators for Plain Password file.
- */
-
- // Accept AMQPlain incomming and compare it to the file.
- AmqPlainInitialiser amqplain = new AmqPlainInitialiser();
- amqplain.initialise(this);
-
- // Accept Plain incomming and compare it to the file.
- PlainInitialiser plain = new PlainInitialiser();
- plain.initialise(this);
-
- // Accept MD5 incomming and Hash file value for comparison
- CRAMMD5Initialiser cram = new CRAMMD5Initialiser();
- cram.initialise(this);
-
- _saslServers.put(amqplain.getMechanismName(), amqplain);
- _saslServers.put(plain.getMechanismName(), plain);
- _saslServers.put(cram.getMechanismName(), cram);
- }
-
- public void setPasswordFile(String passwordFile) throws FileNotFoundException
- {
- File f = new File(passwordFile);
- _logger.info("PlainPasswordFile using file " + f.getAbsolutePath());
- _passwordFile = f;
- if (!f.exists())
- {
- throw new FileNotFoundException("Cannot find password file " + f);
- }
- if (!f.canRead())
- {
- throw new FileNotFoundException("Cannot read password file " + f +
- ". Check permissions.");
- }
- }
-
- public void setPassword(Principal principal, PasswordCallback callback) throws IOException,
- AccountNotFoundException
- {
- if (_passwordFile == null)
- {
- throw new AccountNotFoundException("Unable to locate principal since no password file was specified during initialisation");
- }
- if (principal == null)
- {
- throw new IllegalArgumentException("principal must not be null");
- }
- char[] pwd = lookupPassword(principal.getName());
- if (pwd != null)
- {
- callback.setPassword(pwd);
- }
- else
- {
- throw new AccountNotFoundException("No account found for principal " + principal);
- }
- }
-
- public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException
- {
- try
- {
- char[] pwd = lookupPassword(principal);
-
- return compareCharArray(pwd, password);
- }
- catch (IOException e)
- {
- return false;
- }
- }
-
- public boolean updatePassword(Principal principal, char[] password) throws AccountNotFoundException
- {
- return false; // updates denied
- }
-
- public boolean createPrincipal(Principal principal, char[] password)
- {
- return false; // updates denied
- }
-
- public boolean deletePrincipal(Principal principal) throws AccountNotFoundException
- {
- return false; // updates denied
- }
-
- public Map<String, AuthenticationProviderInitialiser> getMechanisms()
- {
- return _saslServers;
- }
-
- public List<Principal> getUsers()
- {
- return new LinkedList<Principal>(); //todo
- }
-
- public Principal getUser(String username)
- {
- try
- {
- if (lookupPassword(username) != null)
- {
- return new UsernamePrincipal(username);
- }
- }
- catch (IOException e)
- {
- //fall through to null return
- }
- return null;
- }
-
- private boolean compareCharArray(char[] a, char[] b)
- {
- boolean equal = false;
- if (a.length == b.length)
- {
- equal = true;
- int index = 0;
- while (equal && index < a.length)
- {
- equal = a[index] == b[index];
- index++;
- }
- }
- return equal;
- }
-
-
- /**
- * Looks up the password for a specified user in the password file. Note this code is <b>not</b> secure since it
- * creates strings of passwords. It should be modified to create only char arrays which get nulled out.
- *
- * @param name the name of the principal to lookup
- *
- * @return char[] of the password
- *
- * @throws java.io.IOException whilst accessing the file
- */
- private char[] lookupPassword(String name) throws IOException
- {
- BufferedReader reader = null;
- try
- {
- reader = new BufferedReader(new FileReader(_passwordFile));
- String line;
-
- while ((line = reader.readLine()) != null)
- {
- if (!line.startsWith("#"))
- {
- String[] result = _regexp.split(line);
- if (result == null || result.length < 2)
- {
- continue;
- }
-
- if (name.equals(result[0]))
- {
- return result[1].toCharArray();
- }
- }
- }
- return null;
- }
- finally
- {
- if (reader != null)
- {
- reader.close();
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java
deleted file mode 100644
index a82f9ed40b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java
+++ /dev/null
@@ -1,100 +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.
- *
- */
-package org.apache.qpid.server.security.auth.database;
-
-import org.apache.qpid.server.security.auth.sasl.AuthenticationProviderInitialiser;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.Map;
-import java.util.List;
-
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.login.AccountNotFoundException;
-
-/** Represents a "user database" which is really a way of storing principals (i.e. usernames) and passwords. */
-public interface PrincipalDatabase
-{
- /**
- * Set the password for a given principal in the specified callback. This is used for certain SASL providers. The
- * user database implementation should look up the password in any way it chooses and set it in the callback by
- * calling its setPassword method.
- *
- * @param principal the principal
- * @param callback the password callback that wants to receive the password
- *
- * @throws AccountNotFoundException if the account for specified principal could not be found
- * @throws IOException if there was an error looking up the principal
- */
- void setPassword(Principal principal, PasswordCallback callback)
- throws IOException, AccountNotFoundException;
-
- /**
- * Used to verify that the presented Password is correct. Currently only used by Management Console
- * @param principal The principal to authenticate
- * @param password The password to check
- * @return true if password is correct
- * @throws AccountNotFoundException if the principal cannot be found
- */
- boolean verifyPassword(String principal, char[] password)
- throws AccountNotFoundException;
-
- /**
- * Update(Change) the password for the given principal
- * @param principal Who's password is to be changed
- * @param password The new password to use
- * @return True if change was successful
- * @throws AccountNotFoundException If the given principal doesn't exist in the Database
- */
- boolean updatePassword(Principal principal, char[] password)
- throws AccountNotFoundException;
-
- /**
- * Create a new principal in the database
- * @param principal The principal to create
- * @param password The password to set for the principal
- * @return True on a successful creation
- */
- boolean createPrincipal(Principal principal, char[] password);
-
- /**
- * Delete a principal
- * @param principal The principal to delete
- * @return True on a successful creation
- * @throws AccountNotFoundException If the given principal doesn't exist in the Database
- */
- boolean deletePrincipal(Principal principal)
- throws AccountNotFoundException;
-
- /**
- * Get the principal from the database with the given username
- * @param username of the principal to lookup
- * @return The Principal object for the given username or null if not found.
- */
- Principal getUser(String username);
-
-
- public Map<String, AuthenticationProviderInitialiser> getMechanisms();
-
-
- List<Principal> getUsers();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java
deleted file mode 100644
index 2c553ae76a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.security.auth.database;
-
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-
-import java.util.Map;
-
-public interface PrincipalDatabaseManager
-{
- public Map<String, PrincipalDatabase> getDatabases();
-
- public void initialiseManagement(Configuration config) throws ConfigurationException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.java
deleted file mode 100644
index c8a4add0f1..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.java
+++ /dev/null
@@ -1,164 +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.
- *
- *
- */
-package org.apache.qpid.server.security.auth.database;
-
-import org.apache.qpid.server.security.auth.sasl.AuthenticationProviderInitialiser;
-import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
-import org.apache.qpid.server.security.auth.sasl.crammd5.CRAMMD5Initialiser;
-import org.apache.qpid.server.security.auth.sasl.plain.PlainInitialiser;
-
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.login.AccountNotFoundException;
-import java.util.Properties;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.List;
-import java.util.LinkedList;
-import java.security.Principal;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
-public class PropertiesPrincipalDatabase implements PrincipalDatabase
-{
- private Properties _users;
-
- private Map<String, AuthenticationProviderInitialiser> _saslServers;
-
- public PropertiesPrincipalDatabase(Properties users)
- {
- _users = users;
-
- _saslServers = new HashMap<String, AuthenticationProviderInitialiser>();
-
- /**
- * Create Authenticators for Properties Principal Database.
- */
-
- // Accept MD5 incomming and use plain comparison with the file
- PlainInitialiser cram = new PlainInitialiser();
- cram.initialise(this);
- // Accept Plain incomming and hash it for comparison to the file.
- CRAMMD5Initialiser plain = new CRAMMD5Initialiser();
- plain.initialise(this, CRAMMD5Initialiser.HashDirection.INCOMMING);
-
- _saslServers.put(plain.getMechanismName(), cram);
- _saslServers.put(cram.getMechanismName(), plain);
- }
-
- public void setPassword(Principal principal, PasswordCallback callback) throws IOException, AccountNotFoundException
- {
- if (principal == null)
- {
- throw new IllegalArgumentException("principal must not be null");
- }
-
-
-
- final String pwd = _users.getProperty(principal.getName());
-
- if (pwd != null)
- {
- callback.setPassword(pwd.toCharArray());
- }
- else
- {
- throw new AccountNotFoundException("No account found for principal " + principal);
- }
- }
-
- public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException
- {
- //fixme this is not correct as toCharArray is not safe based on the type of string.
- char[] pwd = _users.getProperty(principal).toCharArray();
-
- return compareCharArray(pwd, password);
- }
-
- public boolean updatePassword(Principal principal, char[] password) throws AccountNotFoundException
- {
- return false; // updates denied
- }
-
- public boolean createPrincipal(Principal principal, char[] password)
- {
- return false; // updates denied
- }
-
- public boolean deletePrincipal(Principal principal) throws AccountNotFoundException
- {
- return false; // updates denied
- }
-
- private boolean compareCharArray(char[] a, char[] b)
- {
- boolean equal = false;
- if (a.length == b.length)
- {
- equal = true;
- int index = 0;
- while (equal && index < a.length)
- {
- equal = a[index] == b[index];
- index++;
- }
- }
- return equal;
- }
-
- private char[] convertPassword(String password) throws UnsupportedEncodingException
- {
- byte[] passwdBytes = password.getBytes("utf-8");
-
- char[] passwd = new char[passwdBytes.length];
-
- int index = 0;
-
- for (byte b : passwdBytes)
- {
- passwd[index++] = (char) b;
- }
-
- return passwd;
- }
-
-
- public Map<String, AuthenticationProviderInitialiser> getMechanisms()
- {
- return _saslServers;
- }
-
- public List<Principal> getUsers()
- {
- return new LinkedList<Principal>(); //todo
- }
-
- public Principal getUser(String username)
- {
- if (_users.getProperty(username) != null)
- {
- return new UsernamePrincipal(username);
- }
- else
- {
- return null;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java
deleted file mode 100644
index 6b86a46bd2..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.security.auth.database;
-
-import org.apache.commons.configuration.Configuration;
-
-import java.util.Map;
-import java.util.Properties;
-import java.util.HashMap;
-
-public class PropertiesPrincipalDatabaseManager implements PrincipalDatabaseManager
-{
-
- Map<String, PrincipalDatabase> _databases = new HashMap<String, PrincipalDatabase>();
-
- public PropertiesPrincipalDatabaseManager(String name, Properties users)
- {
- _databases.put(name, new PropertiesPrincipalDatabase(users));
- }
-
- public Map<String, PrincipalDatabase> getDatabases()
- {
- return _databases;
- }
-
- public void initialiseManagement(Configuration config)
- {
- //todo
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java
deleted file mode 100644
index d1803124a7..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.server.security.auth.manager;
-
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.security.auth.AuthenticationResult;
-
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-
-public interface AuthenticationManager
-{
- String getMechanisms();
-
- SaslServer createSaslServer(String mechanism, String localFQDN) throws SaslException;
-
- AuthenticationResult authenticate(SaslServer server, byte[] response);
-
- void close();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
deleted file mode 100644
index 2cbbdc85ff..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
+++ /dev/null
@@ -1,246 +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.
- *
- *
- */
-package org.apache.qpid.server.security.auth.manager;
-
-import org.apache.log4j.Logger;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-import org.apache.qpid.server.security.auth.sasl.JCAProvider;
-import org.apache.qpid.server.security.auth.sasl.AuthenticationProviderInitialiser;
-import org.apache.qpid.server.security.auth.AuthenticationResult;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.sasl.SaslServerFactory;
-import javax.security.sasl.SaslServer;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.Sasl;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.TreeMap;
-import java.security.Security;
-
-public class PrincipalDatabaseAuthenticationManager implements AuthenticationManager
-{
- private static final Logger _logger = Logger.getLogger(PrincipalDatabaseAuthenticationManager.class);
-
- /** The list of mechanisms, in the order in which they are configured (i.e. preferred order) */
- private String _mechanisms;
-
- /** Maps from the mechanism to the callback handler to use for handling those requests */
- private Map<String, CallbackHandler> _callbackHandlerMap = new HashMap<String, CallbackHandler>();
-
- /**
- * Maps from the mechanism to the properties used to initialise the server. See the method Sasl.createSaslServer for
- * details of the use of these properties. This map is populated during initialisation of each provider.
- */
- private Map<String, Map<String, ?>> _serverCreationProperties = new HashMap<String, Map<String, ?>>();
-
- private AuthenticationManager _default = null;
- /** The name for the required SASL Server mechanisms */
- public static final String PROVIDER_NAME= "AMQSASLProvider-Server";
-
- public PrincipalDatabaseAuthenticationManager(String name, Configuration hostConfig) throws Exception
- {
- _logger.info("Initialising " + (name == null ? "Default" : "'" + name + "'")
- + " PrincipleDatabase authentication manager.");
-
- // Fixme This should be done per Vhost but allowing global hack isn't right but ...
- // required as authentication is done before Vhost selection
-
- Map<String, Class<? extends SaslServerFactory>> providerMap = new TreeMap<String, Class<? extends SaslServerFactory>>();
-
-
- if (name == null || hostConfig == null)
- {
- initialiseAuthenticationMechanisms(providerMap, ApplicationRegistry.getInstance().getDatabaseManager().getDatabases());
- }
- else
- {
- String databaseName = hostConfig.getString("security.authentication.name");
-
- if (databaseName == null)
- {
-
- _default = ApplicationRegistry.getInstance().getAuthenticationManager();
- return;
- }
- else
- {
- PrincipalDatabase database = ApplicationRegistry.getInstance().getDatabaseManager().getDatabases().get(databaseName);
-
- if (database == null)
- {
- throw new ConfigurationException("Requested database:" + databaseName + " was not found");
- }
-
- initialiseAuthenticationMechanisms(providerMap, database);
- }
- }
-
- if (providerMap.size() > 0)
- {
- // Ensure we are used before the defaults
- if (Security.insertProviderAt(new JCAProvider(PROVIDER_NAME, providerMap), 1) == -1)
- {
- _logger.error("Unable to load custom SASL providers. Qpid custom SASL authenticators unavailable.");
- }
- else
- {
- _logger.info("Additional SASL providers successfully registered.");
- }
-
- }
- else
- {
- _logger.warn("No additional SASL providers registered.");
- }
-
- }
-
-
- private void initialiseAuthenticationMechanisms(Map<String, Class<? extends SaslServerFactory>> providerMap, Map<String, PrincipalDatabase> databases) throws Exception
- {
-// Configuration config = ApplicationRegistry.getInstance().getConfiguration();
-// List<String> mechanisms = config.getList("security.sasl.mechanisms.mechanism.initialiser.class");
-//
-// // Maps from the mechanism to the properties used to initialise the server. See the method
-// // Sasl.createSaslServer for details of the use of these properties. This map is populated during initialisation
-// // of each provider.
-
-
- if (databases.size() > 1)
- {
- _logger.warn("More than one principle database provided currently authentication mechanism will override each other.");
- }
-
- for (Map.Entry<String, PrincipalDatabase> entry : databases.entrySet())
- {
-
- // fixme As the database now provide the mechanisms they support, they will ...
- // overwrite each other in the map. There should only be one database per vhost.
- // But currently we must have authentication before vhost definition.
- initialiseAuthenticationMechanisms(providerMap, entry.getValue());
- }
-
- }
-
- private void initialiseAuthenticationMechanisms(Map<String, Class<? extends SaslServerFactory>> providerMap, PrincipalDatabase database) throws Exception
- {
- if (database == null || database.getMechanisms().size() == 0)
- {
- _logger.warn("No Database or no mechanisms to initialise authentication");
- return;
- }
-
- for (Map.Entry<String, AuthenticationProviderInitialiser> mechanism : database.getMechanisms().entrySet())
- {
- initialiseAuthenticationMechanism(mechanism.getKey(), mechanism.getValue(), providerMap);
- }
- }
-
- private void initialiseAuthenticationMechanism(String mechanism, AuthenticationProviderInitialiser initialiser,
- Map<String, Class<? extends SaslServerFactory>> providerMap)
- throws Exception
- {
- if (_mechanisms == null)
- {
- _mechanisms = mechanism;
- }
- else
- {
- // simple append should be fine since the number of mechanisms is small and this is a one time initialisation
- _mechanisms = _mechanisms + " " + mechanism;
- }
- _callbackHandlerMap.put(mechanism, initialiser.getCallbackHandler());
- _serverCreationProperties.put(mechanism, initialiser.getProperties());
- Class<? extends SaslServerFactory> factory = initialiser.getServerFactoryClassForJCARegistration();
- if (factory != null)
- {
- providerMap.put(mechanism, factory);
- }
- _logger.info("Initialised " + mechanism + " SASL provider successfully");
- }
-
- public String getMechanisms()
- {
- if (_default != null)
- {
- // Use the default AuthenticationManager if present
- return _default.getMechanisms();
- }
- else
- {
- return _mechanisms;
- }
- }
-
- public SaslServer createSaslServer(String mechanism, String localFQDN) throws SaslException
- {
- if (_default != null)
- {
- // Use the default AuthenticationManager if present
- return _default.createSaslServer(mechanism, localFQDN);
- }
- else
- {
- return Sasl.createSaslServer(mechanism, "AMQP", localFQDN, _serverCreationProperties.get(mechanism),
- _callbackHandlerMap.get(mechanism));
- }
-
- }
-
- public AuthenticationResult authenticate(SaslServer server, byte[] response)
- {
- // Use the default AuthenticationManager if present
- if (_default != null)
- {
- return _default.authenticate(server, response);
- }
-
-
- try
- {
- // Process response from the client
- byte[] challenge = server.evaluateResponse(response != null ? response : new byte[0]);
-
- if (server.isComplete())
- {
- return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.SUCCESS);
- }
- else
- {
- return new AuthenticationResult(challenge, AuthenticationResult.AuthenticationStatus.CONTINUE);
- }
- }
- catch (SaslException e)
- {
- return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, e);
- }
- }
-
- public void close()
- {
- Security.removeProvider(PROVIDER_NAME);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java
deleted file mode 100644
index 89e545d6f5..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java
+++ /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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl;
-
-import java.util.Map;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.sasl.SaslServerFactory;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-
-public interface AuthenticationProviderInitialiser
-{
- /**
- * @return the mechanism's name. This will be used in the list of mechanism's advertised to the
- * client.
- */
- String getMechanismName();
-
- /**
- * Initialise the authentication provider.
- * @param baseConfigPath the path in the config file that points to any config options for this provider. Each
- * provider can have its own set of configuration options
- * @param configuration the Apache Commons Configuration instance used to configure this provider
- * @param principalDatabases the set of principal databases that are available
- * @throws Exception needs refined Exception is too broad.
- */
- void initialise(String baseConfigPath, Configuration configuration,
- Map<String, PrincipalDatabase> principalDatabases) throws Exception;
-
- /**
- * Initialise the authentication provider.
- * @param db The principal database to initialise with
- */
- void initialise(PrincipalDatabase db);
-
-
- /**
- * @return the callback handler that should be used to process authentication requests for this mechanism. This will
- * be called after initialise and will be stored by the authentication manager. The callback handler <b>must</b> be
- * fully threadsafe.
- */
- CallbackHandler getCallbackHandler();
-
- /**
- * Get the properties that must be passed in to the Sasl.createSaslServer method.
- * @return the properties, which may be null
- */
- Map<String, ?> getProperties();
-
- /**
- * Get the class that is the server factory. This is used for the JCA registration.
- * @return null if no JCA registration is required, otherwise return the class
- * that will be used in JCA registration
- */
- Class<? extends SaslServerFactory> getServerFactoryClassForJCARegistration();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/JCAProvider.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/JCAProvider.java
deleted file mode 100644
index d6a09d8217..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/JCAProvider.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl;
-
-import java.security.Provider;
-import java.security.Security;
-import java.util.Map;
-
-import javax.security.sasl.SaslServerFactory;
-
-public final class JCAProvider extends Provider
-{
- public JCAProvider(String name, Map<String, Class<? extends SaslServerFactory>> providerMap)
- {
- super(name, 1.0, "A JCA provider that registers all " +
- "AMQ SASL providers that want to be registered");
- register(providerMap);
- }
-
- private void register(Map<String, Class<? extends SaslServerFactory>> providerMap)
- {
- for (Map.Entry<String, Class<? extends SaslServerFactory>> me :
- providerMap.entrySet())
- {
- put("SaslServerFactory." + me.getKey(), me.getValue().getName());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java
deleted file mode 100644
index dd0bd096c3..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java
+++ /dev/null
@@ -1,123 +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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl;
-
-import java.io.IOException;
-import java.security.Principal;
-import java.util.Map;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.auth.login.AccountNotFoundException;
-import javax.security.sasl.AuthorizeCallback;
-
-import org.apache.commons.configuration.Configuration;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-import org.apache.qpid.server.security.auth.sasl.AuthenticationProviderInitialiser;
-import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
-
-public abstract class UsernamePasswordInitialiser implements AuthenticationProviderInitialiser
-{
- protected static final Logger _logger = Logger.getLogger(UsernamePasswordInitialiser.class);
-
- private ServerCallbackHandler _callbackHandler;
-
- private class ServerCallbackHandler implements CallbackHandler
- {
- private final PrincipalDatabase _principalDatabase;
-
- protected ServerCallbackHandler(PrincipalDatabase database)
- {
- _principalDatabase = database;
- }
-
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- Principal username = null;
- for (Callback callback : callbacks)
- {
- if (callback instanceof NameCallback)
- {
- username = new UsernamePrincipal(((NameCallback) callback).getDefaultName());
- }
- else if (callback instanceof PasswordCallback)
- {
- try
- {
- _principalDatabase.setPassword(username, (PasswordCallback) callback);
- }
- catch (AccountNotFoundException e)
- {
- // very annoyingly the callback handler does not throw anything more appropriate than
- // IOException
- IOException ioe = new IOException("Error looking up user " + e);
- ioe.initCause(e);
- throw ioe;
- }
- }
- else if (callback instanceof AuthorizeCallback)
- {
- ((AuthorizeCallback) callback).setAuthorized(true);
- }
- else
- {
- throw new UnsupportedCallbackException(callback);
- }
- }
- }
- }
-
- public void initialise(String baseConfigPath, Configuration configuration,
- Map<String, PrincipalDatabase> principalDatabases) throws Exception
- {
- String principalDatabaseName = configuration.getString(baseConfigPath + ".principal-database");
- PrincipalDatabase db = principalDatabases.get(principalDatabaseName);
-
- initialise(db);
- }
-
- public void initialise(PrincipalDatabase db)
- {
- if (db == null)
- {
- throw new NullPointerException("Cannot initialise with a null Principal database.");
- }
-
- _callbackHandler = new ServerCallbackHandler(db);
- }
-
- public CallbackHandler getCallbackHandler()
- {
- return _callbackHandler;
- }
-
- public Map<String, ?> getProperties()
- {
- // there are no properties required for the CRAM-MD5 implementation
- return null;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePrincipal.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePrincipal.java
deleted file mode 100644
index d7c8383690..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePrincipal.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl;
-
-import java.security.Principal;
-
-/** A principal that is just a wrapper for a simple username. */
-public class UsernamePrincipal implements Principal
-{
- private String _name;
-
- public UsernamePrincipal(String name)
- {
- _name = name;
- }
-
- public String getName()
- {
- return _name;
- }
-
- public String toString()
- {
- return _name;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java
deleted file mode 100644
index 7acc6322d1..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl.amqplain;
-
-import javax.security.sasl.SaslServerFactory;
-
-import org.apache.qpid.server.security.auth.sasl.UsernamePasswordInitialiser;
-
-public class AmqPlainInitialiser extends UsernamePasswordInitialiser
-{
- public String getMechanismName()
- {
- return "AMQPLAIN";
- }
-
- public Class<? extends SaslServerFactory> getServerFactoryClassForJCARegistration()
- {
- return AmqPlainSaslServerFactory.class;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java
deleted file mode 100644
index 9f56b8521a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java
+++ /dev/null
@@ -1,132 +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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl.amqplain;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.sasl.AuthorizeCallback;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.framing.AMQFrameDecodingException;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.FieldTableFactory;
-
-public class AmqPlainSaslServer implements SaslServer
-{
- public static final String MECHANISM = "AMQPLAIN";
-
- private CallbackHandler _cbh;
-
- private String _authorizationId;
-
- private boolean _complete = false;
-
- public AmqPlainSaslServer(CallbackHandler cbh)
- {
- _cbh = cbh;
- }
-
- public String getMechanismName()
- {
- return MECHANISM;
- }
-
- public byte[] evaluateResponse(byte[] response) throws SaslException
- {
- try
- {
- final FieldTable ft = FieldTableFactory.newFieldTable(ByteBuffer.wrap(response), response.length);
- String username = (String) ft.getString("LOGIN");
- // we do not care about the prompt but it throws if null
- NameCallback nameCb = new NameCallback("prompt", username);
- // we do not care about the prompt but it throws if null
- PasswordCallback passwordCb = new PasswordCallback("prompt", false);
- // TODO: should not get pwd as a String but as a char array...
- String pwd = (String) ft.getString("PASSWORD");
- AuthorizeCallback authzCb = new AuthorizeCallback(username, username);
- Callback[] callbacks = new Callback[]{nameCb, passwordCb, authzCb};
- _cbh.handle(callbacks);
- String storedPwd = new String(passwordCb.getPassword());
- if (storedPwd.equals(pwd))
- {
- _complete = true;
- }
- if (authzCb.isAuthorized() && _complete)
- {
- _authorizationId = authzCb.getAuthenticationID();
- return null;
- }
- else
- {
- throw new SaslException("Authentication failed");
- }
- }
- catch (AMQFrameDecodingException e)
- {
- throw new SaslException("Unable to decode response: " + e, e);
- }
- catch (IOException e)
- {
- throw new SaslException("Error processing data: " + e, e);
- }
- catch (UnsupportedCallbackException e)
- {
- throw new SaslException("Unable to obtain data from callback handler: " + e, e);
- }
- }
-
- public boolean isComplete()
- {
- return _complete;
- }
-
- public String getAuthorizationID()
- {
- return _authorizationId;
- }
-
- public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
- {
- throw new SaslException("Unsupported operation");
- }
-
- public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
- {
- throw new SaslException("Unsupported operation");
- }
-
- public Object getNegotiatedProperty(String propName)
- {
- return null;
- }
-
- public void dispose() throws SaslException
- {
- _cbh = null;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java
deleted file mode 100644
index 67d20136bf..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java
+++ /dev/null
@@ -1,60 +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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl.amqplain;
-
-import java.util.Map;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-import javax.security.sasl.SaslServerFactory;
-
-public class AmqPlainSaslServerFactory implements SaslServerFactory
-{
- public SaslServer createSaslServer(String mechanism, String protocol, String serverName, Map props,
- CallbackHandler cbh) throws SaslException
- {
- if (AmqPlainSaslServer.MECHANISM.equals(mechanism))
- {
- return new AmqPlainSaslServer(cbh);
- }
- else
- {
- return null;
- }
- }
-
- public String[] getMechanismNames(Map props)
- {
- if (props.containsKey(Sasl.POLICY_NOPLAINTEXT) ||
- props.containsKey(Sasl.POLICY_NODICTIONARY) ||
- props.containsKey(Sasl.POLICY_NOACTIVE))
- {
- // returned array must be non null according to interface documentation
- return new String[0];
- }
- else
- {
- return new String[]{AmqPlainSaslServer.MECHANISM};
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java
deleted file mode 100644
index 97f9a4e91a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java
+++ /dev/null
@@ -1,50 +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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl.crammd5;
-
-import org.apache.qpid.server.security.auth.sasl.UsernamePasswordInitialiser;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-
-import javax.security.sasl.SaslServerFactory;
-import java.util.Map;
-
-public class CRAMMD5HashedInitialiser extends UsernamePasswordInitialiser
-{
- public String getMechanismName()
- {
- return CRAMMD5HashedSaslServer.MECHANISM;
- }
-
- public Class<? extends SaslServerFactory> getServerFactoryClassForJCARegistration()
- {
- return CRAMMD5HashedServerFactory.class;
- }
-
- public void initialise(PrincipalDatabase passwordFile)
- {
- super.initialise(passwordFile);
- }
-
- public Map<String, ?> getProperties()
- {
- return null;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java
deleted file mode 100644
index f6cab084ea..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java
+++ /dev/null
@@ -1,105 +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.
- *
- *
- */
-package org.apache.qpid.server.security.auth.sasl.crammd5;
-
-import javax.security.sasl.SaslServer;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslServerFactory;
-import javax.security.auth.callback.CallbackHandler;
-import java.util.Enumeration;
-import java.util.Map;
-
-public class CRAMMD5HashedSaslServer implements SaslServer
-{
- public static final String MECHANISM = "CRAM-MD5-HASHED";
-
- private SaslServer _realServer;
-
- public CRAMMD5HashedSaslServer(String mechanism, String protocol, String serverName, Map<String, ?> props,
- CallbackHandler cbh) throws SaslException
- {
- Enumeration factories = Sasl.getSaslServerFactories();
-
- while (factories.hasMoreElements())
- {
- SaslServerFactory factory = (SaslServerFactory) factories.nextElement();
-
- if (factory instanceof CRAMMD5HashedServerFactory)
- {
- continue;
- }
-
- String[] mechs = factory.getMechanismNames(props);
-
- for (String mech : mechs)
- {
- if (mech.equals("CRAM-MD5"))
- {
- _realServer = factory.createSaslServer("CRAM-MD5", protocol, serverName, props, cbh);
- return;
- }
- }
- }
-
- throw new RuntimeException("No default SaslServer found for mechanism:" + "CRAM-MD5");
- }
-
- public String getMechanismName()
- {
- return MECHANISM;
- }
-
- public byte[] evaluateResponse(byte[] response) throws SaslException
- {
- return _realServer.evaluateResponse(response);
- }
-
- public boolean isComplete()
- {
- return _realServer.isComplete();
- }
-
- public String getAuthorizationID()
- {
- return _realServer.getAuthorizationID();
- }
-
- public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
- {
- return _realServer.unwrap(incoming, offset, len);
- }
-
- public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
- {
- return _realServer.wrap(outgoing, offset, len);
- }
-
- public Object getNegotiatedProperty(String propName)
- {
- return _realServer.getNegotiatedProperty(propName);
- }
-
- public void dispose() throws SaslException
- {
- _realServer.dispose();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java
deleted file mode 100644
index 5298b5cc63..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl.crammd5;
-
-import java.util.Map;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-import javax.security.sasl.SaslServerFactory;
-
-public class CRAMMD5HashedServerFactory implements SaslServerFactory
-{
- public SaslServer createSaslServer(String mechanism, String protocol, String serverName, Map<String, ?> props,
- CallbackHandler cbh) throws SaslException
- {
- if (mechanism.equals(CRAMMD5HashedSaslServer.MECHANISM))
- {
- return new CRAMMD5HashedSaslServer(mechanism, protocol, serverName, props, cbh);
- }
- else
- {
- return null;
- }
- }
-
- public String[] getMechanismNames(Map props)
- {
- if (props != null)
- {
- if (props.containsKey(Sasl.POLICY_NOPLAINTEXT) ||
- props.containsKey(Sasl.POLICY_NODICTIONARY) ||
- props.containsKey(Sasl.POLICY_NOACTIVE))
- {
- // returned array must be non null according to interface documentation
- return new String[0];
- }
- }
-
- return new String[]{CRAMMD5HashedSaslServer.MECHANISM};
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java
deleted file mode 100644
index 264832888d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java
+++ /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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl.crammd5;
-
-import org.apache.qpid.server.security.auth.sasl.UsernamePasswordInitialiser;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-
-import javax.security.sasl.SaslServerFactory;
-
-public class CRAMMD5Initialiser extends UsernamePasswordInitialiser
-{
- private HashDirection _hashDirection;
-
- public enum HashDirection
- {
- INCOMMING, PASSWORD_FILE
- }
-
-
- public String getMechanismName()
- {
- return "CRAM-MD5";
- }
-
- public Class<? extends SaslServerFactory> getServerFactoryClassForJCARegistration()
- {
- // since the CRAM-MD5 provider is registered as part of the JDK, we do not
- // return the factory class here since we do not need to register it ourselves.
- if (_hashDirection == HashDirection.PASSWORD_FILE)
- {
- return null;
- }
- else
- {
- //fixme we need a server that will correctly has the incomming plain text for comparison to file.
- _logger.warn("we need a server that will correctly convert the incomming plain text for comparison to file.");
- return null;
- }
- }
-
- public void initialise(PrincipalDatabase passwordFile)
- {
- initialise(passwordFile, HashDirection.PASSWORD_FILE);
- }
-
- public void initialise(PrincipalDatabase passwordFile, HashDirection direction)
- {
- super.initialise(passwordFile);
-
- _hashDirection = direction;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java
deleted file mode 100644
index 1d16cd8755..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl.plain;
-
-import javax.security.sasl.SaslServerFactory;
-
-import org.apache.qpid.server.security.auth.sasl.UsernamePasswordInitialiser;
-
-public class PlainInitialiser extends UsernamePasswordInitialiser
-{
- public String getMechanismName()
- {
- return "PLAIN";
- }
-
- public Class<? extends SaslServerFactory> getServerFactoryClassForJCARegistration()
- {
- return PlainSaslServerFactory.class;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java
deleted file mode 100644
index 45fb9a4e42..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java
+++ /dev/null
@@ -1,151 +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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl.plain;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-import javax.security.sasl.AuthorizeCallback;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-
-public class PlainSaslServer implements SaslServer
-{
- public static final String MECHANISM = "PLAIN";
-
- private CallbackHandler _cbh;
-
- private String _authorizationId;
-
- private boolean _complete = false;
-
- public PlainSaslServer(CallbackHandler cbh)
- {
- _cbh = cbh;
- }
-
- public String getMechanismName()
- {
- return MECHANISM;
- }
-
- public byte[] evaluateResponse(byte[] response) throws SaslException
- {
- try
- {
- int authzidNullPosition = findNullPosition(response, 0);
- if (authzidNullPosition < 0)
- {
- throw new SaslException("Invalid PLAIN encoding, authzid null terminator not found");
- }
- int authcidNullPosition = findNullPosition(response, authzidNullPosition + 1);
- if (authcidNullPosition < 0)
- {
- throw new SaslException("Invalid PLAIN encoding, authcid null terminator not found");
- }
-
- // we do not currently support authcid in any meaningful way
- // String authcid = new String(response, 0, authzidNullPosition, "utf8");
- String authzid = new String(response, authzidNullPosition + 1, authcidNullPosition - 1, "utf8");
-
- // we do not care about the prompt but it throws if null
- NameCallback nameCb = new NameCallback("prompt", authzid);
- PasswordCallback passwordCb = new PasswordCallback("prompt", false);
- // TODO: should not get pwd as a String but as a char array...
- int passwordLen = response.length - authcidNullPosition - 1;
- String pwd = new String(response, authcidNullPosition + 1, passwordLen, "utf8");
- AuthorizeCallback authzCb = new AuthorizeCallback(authzid, authzid);
- Callback[] callbacks = new Callback[]{nameCb, passwordCb, authzCb};
- _cbh.handle(callbacks);
- String storedPwd = new String(passwordCb.getPassword());
- if (storedPwd.equals(pwd))
- {
- _complete = true;
- }
- if (authzCb.isAuthorized() && _complete)
- {
- _authorizationId = authzCb.getAuthenticationID();
- return null;
- }
- else
- {
- throw new SaslException("Authentication failed");
- }
- }
- catch (IOException e)
- {
- throw new SaslException("Error processing data: " + e, e);
- }
- catch (UnsupportedCallbackException e)
- {
- throw new SaslException("Unable to obtain data from callback handler: " + e, e);
- }
- }
-
- private int findNullPosition(byte[] response, int startPosition)
- {
- int position = startPosition;
- while (position < response.length)
- {
- if (response[position] == (byte) 0)
- {
- return position;
- }
- position++;
- }
- return -1;
- }
-
- public boolean isComplete()
- {
- return _complete;
- }
-
- public String getAuthorizationID()
- {
- return _authorizationId;
- }
-
- public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
- {
- throw new SaslException("Unsupported operation");
- }
-
- public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
- {
- throw new SaslException("Unsupported operation");
- }
-
- public Object getNegotiatedProperty(String propName)
- {
- return null;
- }
-
- public void dispose() throws SaslException
- {
- _cbh = null;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java
deleted file mode 100644
index f0dd9eeb6d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java
+++ /dev/null
@@ -1,60 +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.
- *
- */
-package org.apache.qpid.server.security.auth.sasl.plain;
-
-import java.util.Map;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-import javax.security.sasl.SaslServerFactory;
-
-public class PlainSaslServerFactory implements SaslServerFactory
-{
- public SaslServer createSaslServer(String mechanism, String protocol, String serverName, Map props,
- CallbackHandler cbh) throws SaslException
- {
- if (PlainSaslServer.MECHANISM.equals(mechanism))
- {
- return new PlainSaslServer(cbh);
- }
- else
- {
- return null;
- }
- }
-
- public String[] getMechanismNames(Map props)
- {
- if (props.containsKey(Sasl.POLICY_NOPLAINTEXT) ||
- props.containsKey(Sasl.POLICY_NODICTIONARY) ||
- props.containsKey(Sasl.POLICY_NOACTIVE))
- {
- // returned array must be non null according to interface documentation
- return new String[0];
- }
- else
- {
- return new String[]{PlainSaslServer.MECHANISM};
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQState.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQState.java
deleted file mode 100644
index f427cc7206..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQState.java
+++ /dev/null
@@ -1,36 +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.
- *
- */
-package org.apache.qpid.server.state;
-
-/**
- * States used in the AMQ protocol. Used by the finite state machine to determine
- * valid responses.
- */
-public enum AMQState
-{
- CONNECTION_NOT_STARTED,
- CONNECTION_NOT_AUTH,
- CONNECTION_NOT_TUNED,
- CONNECTION_NOT_OPENED,
- CONNECTION_OPEN,
- CONNECTION_CLOSING,
- CONNECTION_CLOSED
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java
deleted file mode 100644
index c5b3099f58..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java
+++ /dev/null
@@ -1,263 +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.
- *
- */
-package org.apache.qpid.server.state;
-
-import java.util.EnumMap;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArraySet;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.protocol.AMQMethodListener;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.handler.BasicAckMethodHandler;
-import org.apache.qpid.server.handler.BasicCancelMethodHandler;
-import org.apache.qpid.server.handler.BasicConsumeMethodHandler;
-import org.apache.qpid.server.handler.BasicGetMethodHandler;
-import org.apache.qpid.server.handler.BasicPublishMethodHandler;
-import org.apache.qpid.server.handler.BasicQosHandler;
-import org.apache.qpid.server.handler.BasicRecoverMethodHandler;
-import org.apache.qpid.server.handler.BasicRejectMethodHandler;
-import org.apache.qpid.server.handler.ChannelCloseHandler;
-import org.apache.qpid.server.handler.ChannelCloseOkHandler;
-import org.apache.qpid.server.handler.ChannelFlowHandler;
-import org.apache.qpid.server.handler.ChannelOpenHandler;
-import org.apache.qpid.server.handler.ConnectionCloseMethodHandler;
-import org.apache.qpid.server.handler.ConnectionCloseOkMethodHandler;
-import org.apache.qpid.server.handler.ConnectionOpenMethodHandler;
-import org.apache.qpid.server.handler.ConnectionSecureOkMethodHandler;
-import org.apache.qpid.server.handler.ConnectionStartOkMethodHandler;
-import org.apache.qpid.server.handler.ConnectionTuneOkMethodHandler;
-import org.apache.qpid.server.handler.ExchangeBoundHandler;
-import org.apache.qpid.server.handler.ExchangeDeclareHandler;
-import org.apache.qpid.server.handler.ExchangeDeleteHandler;
-import org.apache.qpid.server.handler.QueueBindHandler;
-import org.apache.qpid.server.handler.QueueDeclareHandler;
-import org.apache.qpid.server.handler.QueueDeleteHandler;
-import org.apache.qpid.server.handler.QueuePurgeHandler;
-import org.apache.qpid.server.handler.TxCommitHandler;
-import org.apache.qpid.server.handler.TxRollbackHandler;
-import org.apache.qpid.server.handler.TxSelectHandler;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-/**
- * The state manager is responsible for managing the state of the protocol session. <p/> For each AMQProtocolHandler
- * there is a separate state manager.
- */
-public class AMQStateManager implements AMQMethodListener
-{
- private static final Logger _logger = Logger.getLogger(AMQStateManager.class);
-
- private final VirtualHostRegistry _virtualHostRegistry;
- private final AMQProtocolSession _protocolSession;
- /** The current state */
- private AMQState _currentState;
-
- /**
- * Maps from an AMQState instance to a Map from Class to StateTransitionHandler. The class must be a subclass of
- * AMQFrame.
- */
-/* private final EnumMap<AMQState, Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>> _state2HandlersMap =
- new EnumMap<AMQState, Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>>(
- AMQState.class);
- */
-
-
- private CopyOnWriteArraySet<StateListener> _stateListeners = new CopyOnWriteArraySet<StateListener>();
-
- public AMQStateManager(VirtualHostRegistry virtualHostRegistry, AMQProtocolSession protocolSession)
- {
-
- _virtualHostRegistry = virtualHostRegistry;
- _protocolSession = protocolSession;
- _currentState = AMQState.CONNECTION_NOT_STARTED;
-
- }
-
- /*
- protected void registerListeners()
- {
- Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>> frame2handlerMap;
-
- frame2handlerMap = new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>();
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_STARTED, frame2handlerMap);
-
- frame2handlerMap = new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>();
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_AUTH, frame2handlerMap);
-
- frame2handlerMap = new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>();
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_TUNED, frame2handlerMap);
-
- frame2handlerMap = new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>();
- frame2handlerMap.put(ConnectionOpenBody.class, ConnectionOpenMethodHandler.getInstance());
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_OPENED, frame2handlerMap);
-
- //
- // ConnectionOpen handlers
- //
- frame2handlerMap = new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>();
- ChannelOpenHandler.getInstance();
- ChannelCloseHandler.getInstance();
- ChannelCloseOkHandler.getInstance();
- ConnectionCloseMethodHandler.getInstance();
- ConnectionCloseOkMethodHandler.getInstance();
- ConnectionTuneOkMethodHandler.getInstance();
- ConnectionSecureOkMethodHandler.getInstance();
- ConnectionStartOkMethodHandler.getInstance();
- ExchangeDeclareHandler.getInstance();
- ExchangeDeleteHandler.getInstance();
- ExchangeBoundHandler.getInstance();
- BasicAckMethodHandler.getInstance();
- BasicRecoverMethodHandler.getInstance();
- BasicConsumeMethodHandler.getInstance();
- BasicGetMethodHandler.getInstance();
- BasicCancelMethodHandler.getInstance();
- BasicPublishMethodHandler.getInstance();
- BasicQosHandler.getInstance();
- QueueBindHandler.getInstance();
- QueueDeclareHandler.getInstance();
- QueueDeleteHandler.getInstance();
- QueuePurgeHandler.getInstance();
- ChannelFlowHandler.getInstance();
- TxSelectHandler.getInstance();
- TxCommitHandler.getInstance();
- TxRollbackHandler.getInstance();
- BasicRejectMethodHandler.getInstance();
-
- _state2HandlersMap.put(AMQState.CONNECTION_OPEN, frame2handlerMap);
-
- frame2handlerMap = new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>();
-
- _state2HandlersMap.put(AMQState.CONNECTION_CLOSING, frame2handlerMap);
-
- } */
-
- public AMQState getCurrentState()
- {
- return _currentState;
- }
-
- public void changeState(AMQState newState) throws AMQException
- {
- _logger.debug("State changing to " + newState + " from old state " + _currentState);
- final AMQState oldState = _currentState;
- _currentState = newState;
-
- for (StateListener l : _stateListeners)
- {
- l.stateChanged(oldState, newState);
- }
- }
-
- public void error(Exception e)
- {
- _logger.error("State manager received error notification[Current State:" + _currentState + "]: " + e, e);
- for (StateListener l : _stateListeners)
- {
- l.error(e);
- }
- }
-
- public <B extends AMQMethodBody> boolean methodReceived(AMQMethodEvent<B> evt) throws AMQException
- {
- MethodDispatcher dispatcher = _protocolSession.getMethodDispatcher();
-
- final int channelId = evt.getChannelId();
- B body = evt.getMethod();
-
- if(channelId != 0 && _protocolSession.getChannel(channelId)== null)
- {
-
- if(! ((body instanceof ChannelOpenBody)
- || (body instanceof ChannelCloseOkBody)
- || (body instanceof ChannelCloseBody)))
- {
- throw body.getConnectionException(AMQConstant.CHANNEL_ERROR, "channel is closed");
- }
-
- }
-
- return body.execute(dispatcher, channelId);
-
- }
-
- private <B extends AMQMethodBody> void checkChannel(AMQMethodEvent<B> evt, AMQProtocolSession protocolSession)
- throws AMQException
- {
- if ((evt.getChannelId() != 0) && !(evt.getMethod() instanceof ChannelOpenBody)
- && (protocolSession.getChannel(evt.getChannelId()) == null)
- && !protocolSession.channelAwaitingClosure(evt.getChannelId()))
- {
- throw evt.getMethod().getChannelNotFoundException(evt.getChannelId());
- }
- }
-
-/*
- protected <B extends AMQMethodBody> StateAwareMethodListener<B> findStateTransitionHandler(AMQState currentState,
- B frame)
- // throws IllegalStateTransitionException
- {
- final Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>> classToHandlerMap =
- _state2HandlersMap.get(currentState);
-
- final StateAwareMethodListener<B> handler =
- (classToHandlerMap == null) ? null : (StateAwareMethodListener<B>) classToHandlerMap.get(frame.getClass());
-
- if (handler == null)
- {
- _logger.debug("No state transition handler defined for receiving frame " + frame);
-
- return null;
- }
- else
- {
- return handler;
- }
- }
-*/
-
- public void addStateListener(StateListener listener)
- {
- _logger.debug("Adding state listener");
- _stateListeners.add(listener);
- }
-
- public void removeStateListener(StateListener listener)
- {
- _stateListeners.remove(listener);
- }
-
- public VirtualHostRegistry getVirtualHostRegistry()
- {
- return _virtualHostRegistry;
- }
-
- public AMQProtocolSession getProtocolSession()
- {
- return _protocolSession;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java
deleted file mode 100644
index cec67a8a6d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java
+++ /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.
- *
- */
-package org.apache.qpid.server.state;
-
-import org.apache.qpid.AMQException;
-
-/**
- * @todo Not an AMQP exception as no status code.
- *
- * @todo Not used! Delete.
- */
-public class IllegalStateTransitionException extends AMQException
-{
- private AMQState _originalState;
-
- private Class _frame;
-
- public IllegalStateTransitionException(AMQState originalState, Class frame)
- {
- super("No valid state transition defined for receiving frame " + frame + " from state " + originalState);
- _originalState = originalState;
- _frame = frame;
- }
-
- public AMQState getOriginalState()
- {
- return _originalState;
- }
-
- public Class getFrameClass()
- {
- return _frame;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/StateAwareMethodListener.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/StateAwareMethodListener.java
deleted file mode 100644
index 3c11bb8a9c..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/StateAwareMethodListener.java
+++ /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.
- *
- */
-package org.apache.qpid.server.state;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-/**
- * A frame listener that is informed of the protocol state when invoked and has
- * the opportunity to update state.
- *
- */
-public interface StateAwareMethodListener<B extends AMQMethodBody>
-{
- void methodReceived(AMQStateManager stateManager, B evt, int channelId) throws AMQException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/StateListener.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/StateListener.java
deleted file mode 100644
index 00fc09867b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/state/StateListener.java
+++ /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.
- *
- */
-package org.apache.qpid.server.state;
-
-import org.apache.qpid.AMQException;
-
-public interface StateListener
-{
- void stateChanged(AMQState oldState, AMQState newState) throws AMQException;
-
- void error(Throwable t);
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java
deleted file mode 100644
index 743a736884..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java
+++ /dev/null
@@ -1,1463 +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.
-*
-*/
-package org.apache.qpid.server.store;
-
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.queue.MessageMetaData;
-import org.apache.qpid.server.queue.QueueRegistry;
-
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.MessageHandleFactory;
-import org.apache.qpid.server.txn.TransactionalContext;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.commons.configuration.Configuration;
-import org.apache.log4j.Logger;
-import org.apache.mina.common.ByteBuffer;
-
-import java.io.File;
-import java.io.ByteArrayInputStream;
-import java.sql.DriverManager;
-import java.sql.Driver;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.Blob;
-import java.sql.Types;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.TreeMap;
-
-
-public class DerbyMessageStore implements MessageStore
-{
-
- private static final Logger _logger = Logger.getLogger(DerbyMessageStore.class);
-
- private static final String ENVIRONMENT_PATH_PROPERTY = "environment-path";
-
-
- private static final String SQL_DRIVER_NAME = "org.apache.derby.jdbc.EmbeddedDriver";
-
- private static final String DB_VERSION_TABLE_NAME = "QPID_DB_VERSION";
-
- private static final String EXCHANGE_TABLE_NAME = "QPID_EXCHANGE";
- private static final String QUEUE_TABLE_NAME = "QPID_QUEUE";
- private static final String BINDINGS_TABLE_NAME = "QPID_BINDINGS";
- private static final String QUEUE_ENTRY_TABLE_NAME = "QPID_QUEUE_ENTRY";
- private static final String MESSAGE_META_DATA_TABLE_NAME = "QPID_MESSAGE_META_DATA";
- private static final String MESSAGE_CONTENT_TABLE_NAME = "QPID_MESSAGE_CONTENT";
-
- private static final int DB_VERSION = 1;
-
-
-
- private VirtualHost _virtualHost;
- private static Class<Driver> DRIVER_CLASS;
-
- private final AtomicLong _messageId = new AtomicLong(1);
- private AtomicBoolean _closed = new AtomicBoolean(false);
-
- private String _connectionURL;
-
-
-
- private static final String CREATE_DB_VERSION_TABLE = "CREATE TABLE "+DB_VERSION_TABLE_NAME+" ( version int not null )";
- private static final String INSERT_INTO_DB_VERSION = "INSERT INTO "+DB_VERSION_TABLE_NAME+" ( version ) VALUES ( ? )";
- private static final String CREATE_EXCHANGE_TABLE = "CREATE TABLE "+EXCHANGE_TABLE_NAME+" ( name varchar(255) not null, type varchar(255) not null, autodelete SMALLINT not null, PRIMARY KEY ( name ) )";
- private static final String CREATE_QUEUE_TABLE = "CREATE TABLE "+QUEUE_TABLE_NAME+" ( name varchar(255) not null, owner varchar(255), PRIMARY KEY ( name ) )";
- private static final String CREATE_BINDINGS_TABLE = "CREATE TABLE "+BINDINGS_TABLE_NAME+" ( exchange_name varchar(255) not null, queue_name varchar(255) not null, binding_key varchar(255) not null, arguments blob , PRIMARY KEY ( exchange_name, queue_name, binding_key ) )";
- private static final String CREATE_QUEUE_ENTRY_TABLE = "CREATE TABLE "+QUEUE_ENTRY_TABLE_NAME+" ( queue_name varchar(255) not null, message_id bigint not null, PRIMARY KEY (queue_name, message_id) )";
- private static final String CREATE_MESSAGE_META_DATA_TABLE = "CREATE TABLE "+MESSAGE_META_DATA_TABLE_NAME+" ( message_id bigint not null, exchange_name varchar(255) not null, routing_key varchar(255), flag_mandatory smallint not null, flag_immediate smallint not null, content_header blob, chunk_count int not null, PRIMARY KEY ( message_id ) )";
- private static final String CREATE_MESSAGE_CONTENT_TABLE = "CREATE TABLE "+MESSAGE_CONTENT_TABLE_NAME+" ( message_id bigint not null, chunk_id int not null, content_chunk blob , PRIMARY KEY (message_id, chunk_id) )";
- private static final String SELECT_FROM_QUEUE = "SELECT name, owner FROM " + QUEUE_TABLE_NAME;
- private static final String SELECT_FROM_EXCHANGE = "SELECT name, type, autodelete FROM " + EXCHANGE_TABLE_NAME;
- private static final String SELECT_FROM_BINDINGS =
- "SELECT queue_name, binding_key, arguments FROM " + BINDINGS_TABLE_NAME + " WHERE exchange_name = ?";
- private static final String DELETE_FROM_MESSAGE_META_DATA = "DELETE FROM " + MESSAGE_META_DATA_TABLE_NAME + " WHERE message_id = ?";
- private static final String DELETE_FROM_MESSAGE_CONTENT = "DELETE FROM " + MESSAGE_CONTENT_TABLE_NAME + " WHERE message_id = ?";
- private static final String INSERT_INTO_EXCHANGE = "INSERT INTO " + EXCHANGE_TABLE_NAME + " ( name, type, autodelete ) VALUES ( ?, ?, ? )";
- private static final String DELETE_FROM_EXCHANGE = "DELETE FROM " + EXCHANGE_TABLE_NAME + " WHERE name = ?";
- private static final String INSERT_INTO_BINDINGS = "INSERT INTO " + BINDINGS_TABLE_NAME + " ( exchange_name, queue_name, binding_key, arguments ) values ( ?, ?, ?, ? )";
- private static final String DELETE_FROM_BINDINGS = "DELETE FROM " + BINDINGS_TABLE_NAME + " WHERE exchange_name = ? AND queue_name = ? AND binding_key = ?";
- private static final String INSERT_INTO_QUEUE = "INSERT INTO " + QUEUE_TABLE_NAME + " (name, owner) VALUES (?, ?)";
- private static final String DELETE_FROM_QUEUE = "DELETE FROM " + QUEUE_TABLE_NAME + " WHERE name = ?";
- private static final String INSERT_INTO_QUEUE_ENTRY = "INSERT INTO " + QUEUE_ENTRY_TABLE_NAME + " (queue_name, message_id) values (?,?)";
- private static final String DELETE_FROM_QUEUE_ENTRY = "DELETE FROM " + QUEUE_ENTRY_TABLE_NAME + " WHERE queue_name = ? AND message_id =?";
- private static final String INSERT_INTO_MESSAGE_CONTENT = "INSERT INTO " + MESSAGE_CONTENT_TABLE_NAME + "( message_id, chunk_id, content_chunk ) values (?, ?, ?)";
- private static final String INSERT_INTO_MESSAGE_META_DATA = "INSERT INTO " + MESSAGE_META_DATA_TABLE_NAME + "( message_id , exchange_name , routing_key , flag_mandatory , flag_immediate , content_header , chunk_count ) values (?, ?, ?, ?, ?, ?, ?)";
- private static final String SELECT_FROM_MESSAGE_META_DATA =
- "SELECT exchange_name , routing_key , flag_mandatory , flag_immediate , content_header , chunk_count FROM " + MESSAGE_META_DATA_TABLE_NAME + " WHERE message_id = ?";
- private static final String SELECT_FROM_MESSAGE_CONTENT =
- "SELECT content_chunk FROM " + MESSAGE_CONTENT_TABLE_NAME + " WHERE message_id = ? and chunk_id = ?";
- private static final String SELECT_FROM_QUEUE_ENTRY = "SELECT queue_name, message_id FROM " + QUEUE_ENTRY_TABLE_NAME;
- private static final String TABLE_EXISTANCE_QUERY = "SELECT 1 FROM SYS.SYSTABLES WHERE TABLENAME = ?";
-
-
- private enum State
- {
- INITIAL,
- CONFIGURING,
- RECOVERING,
- STARTED,
- CLOSING,
- CLOSED
- }
-
- private State _state = State.INITIAL;
-
-
- public void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception
- {
- stateTransition(State.INITIAL, State.CONFIGURING);
-
- initialiseDriver();
-
- _virtualHost = virtualHost;
-
- _logger.info("Configuring Derby message store for virtual host " + virtualHost.getName());
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
-
- final String databasePath = config.getString(base + "." + ENVIRONMENT_PATH_PROPERTY, "derbyDB");
-
- File environmentPath = new File(databasePath);
- if (!environmentPath.exists())
- {
- if (!environmentPath.mkdirs())
- {
- throw new IllegalArgumentException("Environment path " + environmentPath + " could not be read or created. "
- + "Ensure the path is correct and that the permissions are correct.");
- }
- }
-
- createOrOpenDatabase(databasePath);
-
- // this recovers durable queues and persistent messages
-
- recover();
-
- stateTransition(State.RECOVERING, State.STARTED);
-
- }
-
- private static synchronized void initialiseDriver() throws ClassNotFoundException
- {
- if(DRIVER_CLASS == null)
- {
- DRIVER_CLASS = (Class<Driver>) Class.forName(SQL_DRIVER_NAME);
- }
- }
-
- private void createOrOpenDatabase(final String environmentPath) throws SQLException
- {
- _connectionURL = "jdbc:derby:" + environmentPath + "/" + _virtualHost.getName() + ";create=true";
-
- Connection conn = newConnection();
-
- createVersionTable(conn);
- createExchangeTable(conn);
- createQueueTable(conn);
- createBindingsTable(conn);
- createQueueEntryTable(conn);
- createMessageMetaDataTable(conn);
- createMessageContentTable(conn);
-
- conn.close();
- }
-
-
-
- private void createVersionTable(final Connection conn) throws SQLException
- {
- if(!tableExists(DB_VERSION_TABLE_NAME, conn))
- {
- Statement stmt = conn.createStatement();
-
- stmt.execute(CREATE_DB_VERSION_TABLE);
- stmt.close();
-
- PreparedStatement pstmt = conn.prepareStatement(INSERT_INTO_DB_VERSION);
- pstmt.setInt(1, DB_VERSION);
- pstmt.execute();
- pstmt.close();
- }
-
- }
-
-
- private void createExchangeTable(final Connection conn) throws SQLException
- {
- if(!tableExists(EXCHANGE_TABLE_NAME, conn))
- {
- Statement stmt = conn.createStatement();
-
- stmt.execute(CREATE_EXCHANGE_TABLE);
- stmt.close();
- }
- }
-
- private void createQueueTable(final Connection conn) throws SQLException
- {
- if(!tableExists(QUEUE_TABLE_NAME, conn))
- {
- Statement stmt = conn.createStatement();
- stmt.execute(CREATE_QUEUE_TABLE);
- stmt.close();
- }
- }
-
- private void createBindingsTable(final Connection conn) throws SQLException
- {
- if(!tableExists(BINDINGS_TABLE_NAME, conn))
- {
- Statement stmt = conn.createStatement();
- stmt.execute(CREATE_BINDINGS_TABLE);
-
- stmt.close();
- }
-
- }
-
- private void createQueueEntryTable(final Connection conn) throws SQLException
- {
- if(!tableExists(QUEUE_ENTRY_TABLE_NAME, conn))
- {
- Statement stmt = conn.createStatement();
- stmt.execute(CREATE_QUEUE_ENTRY_TABLE);
-
- stmt.close();
- }
-
- }
-
- private void createMessageMetaDataTable(final Connection conn) throws SQLException
- {
- if(!tableExists(MESSAGE_META_DATA_TABLE_NAME, conn))
- {
- Statement stmt = conn.createStatement();
- stmt.execute(CREATE_MESSAGE_META_DATA_TABLE);
-
- stmt.close();
- }
-
- }
-
-
- private void createMessageContentTable(final Connection conn) throws SQLException
- {
- if(!tableExists(MESSAGE_CONTENT_TABLE_NAME, conn))
- {
- Statement stmt = conn.createStatement();
- stmt.execute(CREATE_MESSAGE_CONTENT_TABLE);
-
- stmt.close();
- }
-
- }
-
-
-
- private boolean tableExists(final String tableName, final Connection conn) throws SQLException
- {
- PreparedStatement stmt = conn.prepareStatement(TABLE_EXISTANCE_QUERY);
- stmt.setString(1, tableName);
- ResultSet rs = stmt.executeQuery();
- boolean exists = rs.next();
- rs.close();
- stmt.close();
- return exists;
- }
-
- public void recover() throws AMQException
- {
- stateTransition(State.CONFIGURING, State.RECOVERING);
-
- _logger.info("Recovering persistent state...");
- StoreContext context = new StoreContext();
-
- try
- {
- Map<AMQShortString, AMQQueue> queues = loadQueues();
-
- recoverExchanges();
-
- try
- {
-
- beginTran(context);
-
- deliverMessages(context, queues);
- _logger.info("Persistent state recovered successfully");
- commitTran(context);
-
- }
- finally
- {
- if(inTran(context))
- {
- abortTran(context);
- }
- }
- }
- catch (SQLException e)
- {
-
- throw new AMQException("Error recovering persistent state: " + e, e);
- }
-
- }
-
- private Map<AMQShortString, AMQQueue> loadQueues() throws SQLException, AMQException
- {
- Connection conn = newConnection();
-
-
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery(SELECT_FROM_QUEUE);
- Map<AMQShortString, AMQQueue> queueMap = new HashMap<AMQShortString, AMQQueue>();
- while(rs.next())
- {
- String queueName = rs.getString(1);
- String owner = rs.getString(2);
- AMQShortString queueNameShortString = new AMQShortString(queueName);
- AMQQueue q = AMQQueueFactory.createAMQQueueImpl(queueNameShortString, true, owner == null ? null : new AMQShortString(owner), false, _virtualHost,
- null);
- _virtualHost.getQueueRegistry().registerQueue(q);
- queueMap.put(queueNameShortString,q);
-
- }
- return queueMap;
- }
-
- private void recoverExchanges() throws AMQException, SQLException
- {
- for (Exchange exchange : loadExchanges())
- {
- recoverExchange(exchange);
- }
- }
-
-
- private List<Exchange> loadExchanges() throws AMQException, SQLException
- {
-
- List<Exchange> exchanges = new ArrayList<Exchange>();
- Connection conn = null;
- try
- {
- conn = newConnection();
-
-
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery(SELECT_FROM_EXCHANGE);
-
- Exchange exchange;
- while(rs.next())
- {
- String exchangeName = rs.getString(1);
- String type = rs.getString(2);
- boolean autoDelete = rs.getShort(3) != 0;
-
- exchange = _virtualHost.getExchangeFactory().createExchange(new AMQShortString(exchangeName), new AMQShortString(type), true, autoDelete, 0);
- _virtualHost.getExchangeRegistry().registerExchange(exchange);
- exchanges.add(exchange);
-
- }
- return exchanges;
-
- }
- finally
- {
- if(conn != null)
- {
- conn.close();
- }
- }
-
- }
-
- private void recoverExchange(Exchange exchange) throws AMQException, SQLException
- {
- _logger.info("Recovering durable exchange " + exchange.getName() + " of type " + exchange.getType() + "...");
-
- QueueRegistry queueRegistry = _virtualHost.getQueueRegistry();
-
- Connection conn = null;
- try
- {
- conn = newConnection();
-
- PreparedStatement stmt = conn.prepareStatement(SELECT_FROM_BINDINGS);
- stmt.setString(1, exchange.getName().toString());
-
- ResultSet rs = stmt.executeQuery();
-
-
- while(rs.next())
- {
- String queueName = rs.getString(1);
- String bindingKey = rs.getString(2);
- Blob arguments = rs.getBlob(3);
-
-
- AMQQueue queue = queueRegistry.getQueue(new AMQShortString(queueName));
- if (queue == null)
- {
- _logger.error("Unkown queue: " + queueName + " cannot be bound to exchange: "
- + exchange.getName());
- }
- else
- {
- _logger.info("Restoring binding: (Exchange: " + exchange.getName() + ", Queue: " + queueName
- + ", Routing Key: " + bindingKey + ", Arguments: " + arguments
- + ")");
-
- FieldTable argumentsFT = null;
- if(arguments != null)
- {
- byte[] argumentBytes = arguments.getBytes(0, (int) arguments.length());
- ByteBuffer buf = ByteBuffer.wrap(argumentBytes);
- argumentsFT = new FieldTable(buf,arguments.length());
- }
-
- queue.bind(exchange, bindingKey == null ? null : new AMQShortString(bindingKey), argumentsFT);
-
- }
- }
- }
- finally
- {
- if(conn != null)
- {
- conn.close();
- }
- }
- }
-
- public void close() throws Exception
- {
- _closed.getAndSet(true);
- }
-
- public void removeMessage(StoreContext storeContext, Long messageId) throws AMQException
- {
-
- boolean localTx = getOrCreateTransaction(storeContext);
-
- Connection conn = getConnection(storeContext);
- ConnectionWrapper wrapper = (ConnectionWrapper) storeContext.getPayload();
-
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Message Id: " + messageId + " Removing");
- }
-
- // first we need to look up the header to get the chunk count
- MessageMetaData mmd = getMessageMetaData(storeContext, messageId);
- try
- {
- PreparedStatement stmt = conn.prepareStatement(DELETE_FROM_MESSAGE_META_DATA);
- stmt.setLong(1,messageId);
- wrapper.setRequiresCommit();
- int results = stmt.executeUpdate();
-
- if (results == 0)
- {
- if (localTx)
- {
- abortTran(storeContext);
- }
-
- throw new AMQException("Message metadata not found for message id " + messageId);
- }
- stmt.close();
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Deleted metadata for message " + messageId);
- }
-
- stmt = conn.prepareStatement(DELETE_FROM_MESSAGE_CONTENT);
- stmt.setLong(1,messageId);
- results = stmt.executeUpdate();
-
- if(results != mmd.getContentChunkCount())
- {
- if (localTx)
- {
- abortTran(storeContext);
- }
- throw new AMQException("Unexpected number of content chunks when deleting message. Expected " + mmd.getContentChunkCount() + " but found " + results);
-
- }
-
- if (localTx)
- {
- commitTran(storeContext);
- }
- }
- catch (SQLException e)
- {
- if ((conn != null) && localTx)
- {
- abortTran(storeContext);
- }
-
- throw new AMQException("Error writing AMQMessage with id " + messageId + " to database: " + e, e);
- }
-
- }
-
- public void createExchange(Exchange exchange) throws AMQException
- {
- if (_state != State.RECOVERING)
- {
- try
- {
- Connection conn = null;
-
- try
- {
- conn = newConnection();
-
- PreparedStatement stmt = conn.prepareStatement(INSERT_INTO_EXCHANGE);
- stmt.setString(1, exchange.getName().toString());
- stmt.setString(2, exchange.getType().toString());
- stmt.setShort(3, exchange.isAutoDelete() ? (short) 1 : (short) 0);
- stmt.execute();
- stmt.close();
- conn.commit();
-
- }
- finally
- {
- if(conn != null)
- {
- conn.close();
- }
- }
- }
- catch (SQLException e)
- {
- throw new AMQException("Error writing Exchange with name " + exchange.getName() + " to database: " + e, e);
- }
- }
-
- }
-
- public void removeExchange(Exchange exchange) throws AMQException
- {
- Connection conn = null;
-
- try
- {
- conn = newConnection();
- PreparedStatement stmt = conn.prepareStatement(DELETE_FROM_EXCHANGE);
- stmt.setString(1, exchange.getName().toString());
- int results = stmt.executeUpdate();
- if(results == 0)
- {
- throw new AMQException("Exchange " + exchange.getName() + " not found");
- }
- else
- {
- conn.commit();
- stmt.close();
- }
- }
- catch (SQLException e)
- {
- throw new AMQException("Error writing deleting with name " + exchange.getName() + " from database: " + e, e);
- }
- finally
- {
- if(conn != null)
- {
- try
- {
- conn.close();
- }
- catch (SQLException e)
- {
- _logger.error(e);
- }
- }
-
- }
- }
-
- public void bindQueue(Exchange exchange, AMQShortString routingKey, AMQQueue queue, FieldTable args)
- throws AMQException
- {
- if (_state != State.RECOVERING)
- {
- Connection conn = null;
-
-
- try
- {
- conn = newConnection();
- PreparedStatement stmt = conn.prepareStatement(INSERT_INTO_BINDINGS);
- stmt.setString(1, exchange.getName().toString() );
- stmt.setString(2, queue.getName().toString());
- stmt.setString(3, routingKey == null ? null : routingKey.toString());
- if(args != null)
- {
- /* This would be the Java 6 way of setting a Blob
- Blob blobArgs = conn.createBlob();
- blobArgs.setBytes(0, args.getDataAsBytes());
- stmt.setBlob(4, blobArgs);
- */
- byte[] bytes = args.getDataAsBytes();
- ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
- stmt.setBinaryStream(4, bis, bytes.length);
- }
- else
- {
- stmt.setNull(4, Types.BLOB);
- }
-
- stmt.executeUpdate();
- conn.commit();
- stmt.close();
- }
- catch (SQLException e)
- {
- throw new AMQException("Error writing binding for AMQQueue with name " + queue.getName() + " to exchange "
- + exchange.getName() + " to database: " + e, e);
- }
- finally
- {
- if(conn != null)
- {
- try
- {
- conn.close();
- }
- catch (SQLException e)
- {
- _logger.error(e);
- }
- }
-
- }
-
- }
-
-
- }
-
- public void unbindQueue(Exchange exchange, AMQShortString routingKey, AMQQueue queue, FieldTable args)
- throws AMQException
- {
- Connection conn = null;
-
-
- try
- {
- conn = newConnection();
- // exchange_name varchar(255) not null, queue_name varchar(255) not null, binding_key varchar(255), arguments blob
- PreparedStatement stmt = conn.prepareStatement(DELETE_FROM_BINDINGS);
- stmt.setString(1, exchange.getName().toString() );
- stmt.setString(2, queue.getName().toString());
- stmt.setString(3, routingKey == null ? null : routingKey.toString());
-
-
- if(stmt.executeUpdate() != 1)
- {
- throw new AMQException("Queue binding for queue with name " + queue.getName() + " to exchange "
- + exchange.getName() + " not found");
- }
- conn.commit();
- stmt.close();
- }
- catch (SQLException e)
- {
- throw new AMQException("Error removing binding for AMQQueue with name " + queue.getName() + " to exchange "
- + exchange.getName() + " in database: " + e, e);
- }
- finally
- {
- if(conn != null)
- {
- try
- {
- conn.close();
- }
- catch (SQLException e)
- {
- _logger.error(e);
- }
- }
-
- }
-
-
- }
-
- public void createQueue(AMQQueue queue) throws AMQException
- {
- createQueue(queue, null);
- }
-
- public void createQueue(AMQQueue queue, FieldTable arguments) throws AMQException
- {
- _logger.debug("public void createQueue(AMQQueue queue = " + queue + "): called");
-
- if (_state != State.RECOVERING)
- {
- try
- {
- Connection conn = newConnection();
-
- PreparedStatement stmt =
- conn.prepareStatement(INSERT_INTO_QUEUE);
-
- stmt.setString(1, queue.getName().toString());
- stmt.setString(2, queue.getOwner() == null ? null : queue.getOwner().toString());
-
- stmt.execute();
-
- stmt.close();
-
- conn.commit();
-
- conn.close();
- }
- catch (SQLException e)
- {
- throw new AMQException("Error writing AMQQueue with name " + queue.getName() + " to database: " + e, e);
- }
- }
- }
-
- private Connection newConnection() throws SQLException
- {
- final Connection connection = DriverManager.getConnection(_connectionURL);
- return connection;
- }
-
- public void removeQueue(final AMQQueue queue) throws AMQException
- {
- AMQShortString name = queue.getName();
- _logger.debug("public void removeQueue(AMQShortString name = " + name + "): called");
- Connection conn = null;
-
-
- try
- {
- conn = newConnection();
- PreparedStatement stmt = conn.prepareStatement(DELETE_FROM_QUEUE);
- stmt.setString(1, name.toString());
- int results = stmt.executeUpdate();
-
-
- if (results == 0)
- {
- throw new AMQException("Queue " + name + " not found");
- }
-
- conn.commit();
- stmt.close();
- }
- catch (SQLException e)
- {
- throw new AMQException("Error writing deleting with name " + name + " from database: " + e, e);
- }
- finally
- {
- if(conn != null)
- {
- try
- {
- conn.close();
- }
- catch (SQLException e)
- {
- _logger.error(e);
- }
- }
-
- }
-
-
- }
-
- public void enqueueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException
- {
- AMQShortString name = queue.getName();
-
- boolean localTx = getOrCreateTransaction(context);
- Connection conn = getConnection(context);
- ConnectionWrapper connWrapper = (ConnectionWrapper) context.getPayload();
-
- try
- {
- PreparedStatement stmt = conn.prepareStatement(INSERT_INTO_QUEUE_ENTRY);
- stmt.setString(1,name.toString());
- stmt.setLong(2,messageId);
- stmt.executeUpdate();
- connWrapper.requiresCommit();
-
- if(localTx)
- {
- commitTran(context);
- }
-
-
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Enqueuing message " + messageId + " on queue " + name + "[Connection" + conn + "]");
- }
- }
- catch (SQLException e)
- {
- if(localTx)
- {
- abortTran(context);
- }
- _logger.error("Failed to enqueue: " + e, e);
- throw new AMQException("Error writing enqueued message with id " + messageId + " for queue " + name
- + " to database", e);
- }
-
- }
-
- public void dequeueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException
- {
- AMQShortString name = queue.getName();
-
- boolean localTx = getOrCreateTransaction(context);
- Connection conn = getConnection(context);
- ConnectionWrapper connWrapper = (ConnectionWrapper) context.getPayload();
-
- try
- {
- PreparedStatement stmt = conn.prepareStatement(DELETE_FROM_QUEUE_ENTRY);
- stmt.setString(1,name.toString());
- stmt.setLong(2,messageId);
- int results = stmt.executeUpdate();
-
- connWrapper.requiresCommit();
-
- if(results != 1)
- {
- throw new AMQException("Unable to find message with id " + messageId + " on queue " + name);
- }
-
- if(localTx)
- {
- commitTran(context);
- }
-
-
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Dequeuing message " + messageId + " on queue " + name + "[Connection" + conn + "]");
- }
- }
- catch (SQLException e)
- {
- if(localTx)
- {
- abortTran(context);
- }
- _logger.error("Failed to dequeue: " + e, e);
- throw new AMQException("Error deleting enqueued message with id " + messageId + " for queue " + name
- + " from database", e);
- }
-
- }
-
- private static final class ConnectionWrapper
- {
- private final Connection _connection;
- private boolean _requiresCommit;
-
- public ConnectionWrapper(Connection conn)
- {
- _connection = conn;
- }
-
- public void setRequiresCommit()
- {
- _requiresCommit = true;
- }
-
- public boolean requiresCommit()
- {
- return _requiresCommit;
- }
-
- public Connection getConnection()
- {
- return _connection;
- }
- }
-
- public void beginTran(StoreContext context) throws AMQException
- {
- if (context.getPayload() != null)
- {
- throw new AMQException("Fatal internal error: transactional context is not empty at beginTran: "
- + context.getPayload());
- }
- else
- {
- try
- {
- Connection conn = newConnection();
-
-
- context.setPayload(new ConnectionWrapper(conn));
- }
- catch (SQLException e)
- {
- throw new AMQException("Error starting transaction: " + e, e);
- }
- }
- }
-
- public void commitTran(StoreContext context) throws AMQException
- {
- ConnectionWrapper connWrapper = (ConnectionWrapper) context.getPayload();
-
- if (connWrapper == null)
- {
- throw new AMQException("Fatal internal error: transactional context is empty at commitTran");
- }
-
- try
- {
- Connection conn = connWrapper.getConnection();
- if(connWrapper.requiresCommit())
- {
- conn.commit();
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("commit tran completed");
- }
-
- }
- conn.close();
- }
- catch (SQLException e)
- {
- throw new AMQException("Error commit tx: " + e, e);
- }
- finally
- {
- context.setPayload(null);
- }
- }
-
- public void abortTran(StoreContext context) throws AMQException
- {
- ConnectionWrapper connWrapper = (ConnectionWrapper) context.getPayload();
-
- if (connWrapper == null)
- {
- throw new AMQException("Fatal internal error: transactional context is empty at abortTran");
- }
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("abort tran called: " + connWrapper.getConnection());
- }
-
- try
- {
- Connection conn = connWrapper.getConnection();
- if(connWrapper.requiresCommit())
- {
- conn.rollback();
- }
-
- conn.close();
- }
- catch (SQLException e)
- {
- throw new AMQException("Error aborting transaction: " + e, e);
- }
- finally
- {
- context.setPayload(null);
- }
- }
-
- public boolean inTran(StoreContext context)
- {
- return context.getPayload() != null;
- }
-
- public Long getNewMessageId()
- {
- return _messageId.getAndIncrement();
- }
-
- public void storeContentBodyChunk(StoreContext context,
- Long messageId,
- int index,
- ContentChunk contentBody,
- boolean lastContentBody) throws AMQException
- {
- boolean localTx = getOrCreateTransaction(context);
- Connection conn = getConnection(context);
- ConnectionWrapper connWrapper = (ConnectionWrapper) context.getPayload();
-
- try
- {
- PreparedStatement stmt = conn.prepareStatement(INSERT_INTO_MESSAGE_CONTENT);
- stmt.setLong(1,messageId);
- stmt.setInt(2, index);
- byte[] chunkData = new byte[contentBody.getSize()];
- contentBody.getData().duplicate().get(chunkData);
- /* this would be the Java 6 way of doing things
- Blob dataAsBlob = conn.createBlob();
- dataAsBlob.setBytes(1L, chunkData);
- stmt.setBlob(3, dataAsBlob);
- */
- ByteArrayInputStream bis = new ByteArrayInputStream(chunkData);
- stmt.setBinaryStream(3, bis, chunkData.length);
- stmt.executeUpdate();
- connWrapper.requiresCommit();
-
- if(localTx)
- {
- commitTran(context);
- }
- }
- catch (SQLException e)
- {
- if(localTx)
- {
- abortTran(context);
- }
-
- throw new AMQException("Error writing AMQMessage with id " + messageId + " to database: " + e, e);
- }
-
- }
-
- public void storeMessageMetaData(StoreContext context, Long messageId, MessageMetaData mmd)
- throws AMQException
- {
-
- boolean localTx = getOrCreateTransaction(context);
- Connection conn = getConnection(context);
- ConnectionWrapper connWrapper = (ConnectionWrapper) context.getPayload();
-
- try
- {
-
- PreparedStatement stmt = conn.prepareStatement(INSERT_INTO_MESSAGE_META_DATA);
- stmt.setLong(1,messageId);
- stmt.setString(2, mmd.getMessagePublishInfo().getExchange().toString());
- stmt.setString(3, mmd.getMessagePublishInfo().getRoutingKey().toString());
- stmt.setShort(4, mmd.getMessagePublishInfo().isMandatory() ? (short) 1 : (short) 0);
- stmt.setShort(5, mmd.getMessagePublishInfo().isImmediate() ? (short) 1 : (short) 0);
-
- ContentHeaderBody headerBody = mmd.getContentHeaderBody();
- final int bodySize = headerBody.getSize();
- byte[] underlying = new byte[bodySize];
- ByteBuffer buf = ByteBuffer.wrap(underlying);
- headerBody.writePayload(buf);
-/*
- Blob dataAsBlob = conn.createBlob();
- dataAsBlob.setBytes(1L, underlying);
- stmt.setBlob(6, dataAsBlob);
-*/
- ByteArrayInputStream bis = new ByteArrayInputStream(underlying);
- stmt.setBinaryStream(6,bis,underlying.length);
-
- stmt.setInt(7, mmd.getContentChunkCount());
-
- stmt.executeUpdate();
- connWrapper.requiresCommit();
-
- if(localTx)
- {
- commitTran(context);
- }
- }
- catch (SQLException e)
- {
- if(localTx)
- {
- abortTran(context);
- }
-
- throw new AMQException("Error writing AMQMessage with id " + messageId + " to database: " + e, e);
- }
-
-
- }
-
- public MessageMetaData getMessageMetaData(StoreContext context, Long messageId) throws AMQException
- {
- boolean localTx = getOrCreateTransaction(context);
- Connection conn = getConnection(context);
-
-
- try
- {
-
- PreparedStatement stmt = conn.prepareStatement(SELECT_FROM_MESSAGE_META_DATA);
- stmt.setLong(1,messageId);
- ResultSet rs = stmt.executeQuery();
-
- if(rs.next())
- {
- final AMQShortString exchange = new AMQShortString(rs.getString(1));
- final AMQShortString routingKey = rs.getString(2) == null ? null : new AMQShortString(rs.getString(2));
- final boolean mandatory = (rs.getShort(3) != (short)0);
- final boolean immediate = (rs.getShort(4) != (short)0);
- MessagePublishInfo info = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return exchange;
- }
-
- public void setExchange(AMQShortString exchange)
- {
-
- }
-
- public boolean isImmediate()
- {
- return immediate;
- }
-
- public boolean isMandatory()
- {
- return mandatory;
- }
-
- public AMQShortString getRoutingKey()
- {
- return routingKey;
- }
- } ;
-
- Blob dataAsBlob = rs.getBlob(5);
-
- byte[] dataAsBytes = dataAsBlob.getBytes(1,(int) dataAsBlob.length());
- ByteBuffer buf = ByteBuffer.wrap(dataAsBytes);
-
- ContentHeaderBody chb = ContentHeaderBody.createFromBuffer(buf, dataAsBytes.length);
-
- if(localTx)
- {
- commitTran(context);
- }
-
- return new MessageMetaData(info, chb, rs.getInt(6));
-
- }
- else
- {
- if(localTx)
- {
- abortTran(context);
- }
- throw new AMQException("Metadata not found for message with id " + messageId);
- }
- }
- catch (SQLException e)
- {
- if(localTx)
- {
- abortTran(context);
- }
-
- throw new AMQException("Error reading AMQMessage with id " + messageId + " from database: " + e, e);
- }
-
-
- }
-
- public ContentChunk getContentBodyChunk(StoreContext context, Long messageId, int index) throws AMQException
- {
- boolean localTx = getOrCreateTransaction(context);
- Connection conn = getConnection(context);
-
-
- try
- {
-
- PreparedStatement stmt = conn.prepareStatement(SELECT_FROM_MESSAGE_CONTENT);
- stmt.setLong(1,messageId);
- stmt.setInt(2, index);
- ResultSet rs = stmt.executeQuery();
-
- if(rs.next())
- {
- Blob dataAsBlob = rs.getBlob(1);
-
- final int size = (int) dataAsBlob.length();
- byte[] dataAsBytes = dataAsBlob.getBytes(1, size);
- final ByteBuffer buf = ByteBuffer.wrap(dataAsBytes);
-
- ContentChunk cb = new ContentChunk()
- {
-
- public int getSize()
- {
- return size;
- }
-
- public ByteBuffer getData()
- {
- return buf;
- }
-
- public void reduceToFit()
- {
-
- }
- };
-
- if(localTx)
- {
- commitTran(context);
- }
-
- return cb;
-
- }
- else
- {
- if(localTx)
- {
- abortTran(context);
- }
- throw new AMQException("Message not found for message with id " + messageId);
- }
- }
- catch (SQLException e)
- {
- if(localTx)
- {
- abortTran(context);
- }
-
- throw new AMQException("Error reading AMQMessage with id " + messageId + " from database: " + e, e);
- }
-
-
-
- }
-
- public boolean isPersistent()
- {
- return true;
- }
-
- private void checkNotClosed() throws MessageStoreClosedException
- {
- if (_closed.get())
- {
- throw new MessageStoreClosedException();
- }
- }
-
-
- private static final class ProcessAction
- {
- private final AMQQueue _queue;
- private final StoreContext _context;
- private final AMQMessage _message;
-
- public ProcessAction(AMQQueue queue, StoreContext context, AMQMessage message)
- {
- _queue = queue;
- _context = context;
- _message = message;
- }
-
- public void process() throws AMQException
- {
- _queue.enqueue(_context, _message);
-
- }
-
- }
-
-
- private void deliverMessages(final StoreContext context, Map<AMQShortString, AMQQueue> queues)
- throws SQLException, AMQException
- {
- Map<Long, AMQMessage> msgMap = new HashMap<Long,AMQMessage>();
- List<ProcessAction> actions = new ArrayList<ProcessAction>();
-
- Map<AMQShortString, Integer> queueRecoveries = new TreeMap<AMQShortString, Integer>();
-
- final boolean inLocaltran = inTran(context);
- Connection conn = null;
- try
- {
-
- if(inLocaltran)
- {
- conn = getConnection(context);
- }
- else
- {
- conn = newConnection();
- }
-
-
- MessageHandleFactory messageHandleFactory = new MessageHandleFactory();
- long maxId = 1;
-
- TransactionalContext txnContext = new NonTransactionalContext(this, new StoreContext(), null, null);
-
- Statement stmt = conn.createStatement();
- ResultSet rs = stmt.executeQuery(SELECT_FROM_QUEUE_ENTRY);
-
-
- while (rs.next())
- {
-
-
-
- AMQShortString queueName = new AMQShortString(rs.getString(1));
-
-
- AMQQueue queue = queues.get(queueName);
- if (queue == null)
- {
- queue = AMQQueueFactory.createAMQQueueImpl(queueName, false, null, false, _virtualHost, null);
-
- _virtualHost.getQueueRegistry().registerQueue(queue);
- queues.put(queueName, queue);
- }
-
- long messageId = rs.getLong(2);
- maxId = Math.max(maxId, messageId);
- AMQMessage message = msgMap.get(messageId);
-
- if(message != null)
- {
- message.incrementReference();
- }
- else
- {
- message = new AMQMessage(messageId, this, messageHandleFactory, txnContext);
- msgMap.put(messageId,message);
- }
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("On recovery, delivering " + message.getMessageId() + " to " + queue.getName());
- }
-
- if (_logger.isInfoEnabled())
- {
- Integer count = queueRecoveries.get(queueName);
- if (count == null)
- {
- count = 0;
- }
-
- queueRecoveries.put(queueName, ++count);
-
- }
-
- actions.add(new ProcessAction(queue, context, message));
-
- }
-
- for(ProcessAction action : actions)
- {
- action.process();
- }
-
- _messageId.set(maxId + 1);
- }
- catch (SQLException e)
- {
- _logger.error("Error: " + e, e);
- throw e;
- }
- finally
- {
- if (inLocaltran && conn != null)
- {
- conn.close();
- }
- }
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("Recovered message counts: " + queueRecoveries);
- }
- }
-
- private Connection getConnection(final StoreContext context)
- {
- return ((ConnectionWrapper)context.getPayload()).getConnection();
- }
-
- private boolean getOrCreateTransaction(StoreContext context) throws AMQException
- {
-
- ConnectionWrapper tx = (ConnectionWrapper) context.getPayload();
- if (tx == null)
- {
- beginTran(context);
- return true;
- }
-
- return false;
- }
-
- private synchronized void stateTransition(State requiredState, State newState) throws AMQException
- {
- if (_state != requiredState)
- {
- throw new AMQException("Cannot transition to the state: " + newState + "; need to be in state: " + requiredState
- + "; currently in state: " + _state);
- }
-
- _state = newState;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java
deleted file mode 100644
index 587c85fc12..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java
+++ /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.
- *
- */
-package org.apache.qpid.server.store;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.server.queue.MessageMetaData;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
-
-/** A simple message store that stores the messages in a threadsafe structure in memory. */
-public class MemoryMessageStore implements MessageStore
-{
- private static final Logger _log = Logger.getLogger(MemoryMessageStore.class);
-
- private static final int DEFAULT_HASHTABLE_CAPACITY = 50000;
-
- private static final String HASHTABLE_CAPACITY_CONFIG = "hashtable-capacity";
-
- protected ConcurrentMap<Long, MessageMetaData> _metaDataMap;
-
- protected ConcurrentMap<Long, List<ContentChunk>> _contentBodyMap;
-
- private final AtomicLong _messageId = new AtomicLong(1);
- private AtomicBoolean _closed = new AtomicBoolean(false);
-
- public void configure()
- {
- _log.info("Using capacity " + DEFAULT_HASHTABLE_CAPACITY + " for hash tables");
- _metaDataMap = new ConcurrentHashMap<Long, MessageMetaData>(DEFAULT_HASHTABLE_CAPACITY);
- _contentBodyMap = new ConcurrentHashMap<Long, List<ContentChunk>>(DEFAULT_HASHTABLE_CAPACITY);
- }
-
- public void configure(String base, Configuration config)
- {
- int hashtableCapacity = config.getInt(base + "." + HASHTABLE_CAPACITY_CONFIG, DEFAULT_HASHTABLE_CAPACITY);
- _log.info("Using capacity " + hashtableCapacity + " for hash tables");
- _metaDataMap = new ConcurrentHashMap<Long, MessageMetaData>(hashtableCapacity);
- _contentBodyMap = new ConcurrentHashMap<Long, List<ContentChunk>>(hashtableCapacity);
- }
-
- public void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception
- {
- configure(base, config);
- }
-
- public void close() throws Exception
- {
- _closed.getAndSet(true);
- if (_metaDataMap != null)
- {
- _metaDataMap.clear();
- _metaDataMap = null;
- }
- if (_contentBodyMap != null)
- {
- _contentBodyMap.clear();
- _contentBodyMap = null;
- }
- }
-
- public void removeMessage(StoreContext context, Long messageId) throws AMQException
- {
- checkNotClosed();
- if (_log.isDebugEnabled())
- {
- _log.debug("Removing message with id " + messageId);
- }
- _metaDataMap.remove(messageId);
- _contentBodyMap.remove(messageId);
- }
-
- public void createExchange(Exchange exchange) throws AMQException
- {
-
- }
-
- public void removeExchange(Exchange exchange) throws AMQException
- {
-
- }
-
- public void bindQueue(Exchange exchange, AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
-
- }
-
- public void unbindQueue(Exchange exchange, AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
-
- }
-
-
- public void createQueue(AMQQueue queue) throws AMQException
- {
- // Not requred to do anything
- }
-
- public void createQueue(AMQQueue queue, FieldTable arguments) throws AMQException
- {
- // Not required to do anything
- }
-
- public void removeQueue(final AMQQueue queue) throws AMQException
- {
- // Not required to do anything
- }
-
- public void enqueueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException
- {
- // Not required to do anything
- }
-
- public void dequeueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException
- {
- // Not required to do anything
- }
-
- public void beginTran(StoreContext context) throws AMQException
- {
- // Not required to do anything
- }
-
- public void commitTran(StoreContext context) throws AMQException
- {
- // Not required to do anything
- }
-
- public void abortTran(StoreContext context) throws AMQException
- {
- // Not required to do anything
- }
-
- public boolean inTran(StoreContext context)
- {
- return false;
- }
-
- public List<AMQQueue> createQueues() throws AMQException
- {
- return null;
- }
-
- public Long getNewMessageId()
- {
- return _messageId.getAndIncrement();
- }
-
- public void storeContentBodyChunk(StoreContext context, Long messageId, int index, ContentChunk contentBody, boolean lastContentBody)
- throws AMQException
- {
- checkNotClosed();
- List<ContentChunk> bodyList = _contentBodyMap.get(messageId);
-
- if (bodyList == null && lastContentBody)
- {
- _contentBodyMap.put(messageId, Collections.singletonList(contentBody));
- }
- else
- {
- if (bodyList == null)
- {
- bodyList = new ArrayList<ContentChunk>();
- _contentBodyMap.put(messageId, bodyList);
- }
-
- bodyList.add(index, contentBody);
- }
- }
-
- public void storeMessageMetaData(StoreContext context, Long messageId, MessageMetaData messageMetaData)
- throws AMQException
- {
- checkNotClosed();
- _metaDataMap.put(messageId, messageMetaData);
- }
-
- public MessageMetaData getMessageMetaData(StoreContext context, Long messageId) throws AMQException
- {
- checkNotClosed();
- return _metaDataMap.get(messageId);
- }
-
- public ContentChunk getContentBodyChunk(StoreContext context, Long messageId, int index) throws AMQException
- {
- checkNotClosed();
- List<ContentChunk> bodyList = _contentBodyMap.get(messageId);
- return bodyList.get(index);
- }
-
- public boolean isPersistent()
- {
- return false;
- }
-
- private void checkNotClosed() throws MessageStoreClosedException
- {
- if (_closed.get())
- {
- throw new MessageStoreClosedException();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java
deleted file mode 100644
index f2910acb77..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java
+++ /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.
- *
- */
-package org.apache.qpid.server.store;
-
-import org.apache.commons.configuration.Configuration;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.queue.MessageMetaData;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-/**
- * MessageStore defines the interface to a storage area, which can be used to preserve the state of messages, queues
- * and exchanges in a transactional manner.
- *
- * <p/>All message store, remove, enqueue and dequeue operations are carried out against a {@link StoreContext} which
- * encapsulates the transactional context they are performed in. Many such operations can be carried out in a single
- * transaction.
- *
- * <p/>The storage and removal of queues and exchanges, are not carried out in a transactional context.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Accept transaction boundary demarcations: Begin, Commit, Abort.
- * <tr><td> Store and remove queues.
- * <tr><td> Store and remove exchanges.
- * <tr><td> Store and remove messages.
- * <tr><td> Bind and unbind queues to exchanges.
- * <tr><td> Enqueue and dequeue messages to queues.
- * <tr><td> Generate message identifiers.
- * </table>
- */
-public interface MessageStore
-{
- /**
- * Called after instantiation in order to configure the message store. A particular implementation can define
- * whatever parameters it wants.
- *
- * @param virtualHost The virtual host using by this store
- * @param base The base element identifier from which all configuration items are relative. For example, if
- * the base element is "store", the all elements used by concrete classes will be "store.foo" etc.
- * @param config The apache commons configuration object.
- *
- * @throws Exception If any error occurs that means the store is unable to configure itself.
- */
- void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception;
-
- /**
- * Called to close and cleanup any resources used by the message store.
- *
- * @throws Exception If the close fails.
- */
- void close() throws Exception;
-
- /**
- * Removes the specified message from the store in the given transactional store context.
- *
- * @param storeContext The transactional context to remove the message in.
- * @param messageId Identifies the message to remove.
- *
- * @throws AMQException If the operation fails for any reason.
- */
- void removeMessage(StoreContext storeContext, Long messageId) throws AMQException;
-
- /**
- * Makes the specified exchange persistent.
- *
- * @param exchange The exchange to persist.
- *
- * @throws AMQException If the operation fails for any reason.
- */
- void createExchange(Exchange exchange) throws AMQException;
-
- /**
- * Removes the specified persistent exchange.
- *
- * @param exchange The exchange to remove.
- *
- * @throws AMQException If the operation fails for any reason.
- */
- void removeExchange(Exchange exchange) throws AMQException;
-
- /**
- * Binds the specified queue to an exchange with a routing key.
- *
- * @param exchange The exchange to bind to.
- * @param routingKey The routing key to bind by.
- * @param queue The queue to bind.
- * @param args Additional parameters.
- *
- * @throws AMQException If the operation fails for any reason.
- */
- void bindQueue(Exchange exchange, AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException;
-
- /**
- * Unbinds the specified from an exchange under a particular routing key.
- *
- * @param exchange The exchange to unbind from.
- * @param routingKey The routing key to unbind.
- * @param queue The queue to unbind.
- * @param args Additonal parameters.
- *
- * @throws AMQException If the operation fails for any reason.
- */
- void unbindQueue(Exchange exchange, AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException;
-
- /**
- * Makes the specified queue persistent.
- *
- * @param queue The queue to store.
- *
- * @throws AMQException If the operation fails for any reason.
- */
- void createQueue(AMQQueue queue) throws AMQException;
-
- /**
- * Makes the specified queue persistent.
- *
- * @param queue The queue to store.
- *
- * @param arguments The additional arguments to the binding
- * @throws AMQException If the operation fails for any reason.
- */
- void createQueue(AMQQueue queue, FieldTable arguments) throws AMQException;
-
- /**
- * Removes the specified queue from the persistent store.
- *
- * @param queue The queue to remove.
- * @throws AMQException If the operation fails for any reason.
- */
- void removeQueue(final AMQQueue queue) throws AMQException;
-
- /**
- * Places a message onto a specified queue, in a given transactional context.
- *
- * @param context The transactional context for the operation.
- * @param queue The queue to place the message on.
- * @param messageId The message to enqueue.
- * @throws AMQException If the operation fails for any reason.
- */
- void enqueueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException;
-
- /**
- * Extracts a message from a specified queue, in a given transactional context.
- *
- * @param context The transactional context for the operation.
- * @param queue The queue to place the message on.
- * @param messageId The message to dequeue.
- * @throws AMQException If the operation fails for any reason, or if the specified message does not exist.
- */
- void dequeueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException;
-
- /**
- * Begins a transactional context.
- *
- * @param context The transactional context to begin.
- *
- * @throws AMQException If the operation fails for any reason.
- */
- void beginTran(StoreContext context) throws AMQException;
-
- /**
- * Commits all operations performed within a given transactional context.
- *
- * @param context The transactional context to commit all operations for.
- *
- * @throws AMQException If the operation fails for any reason.
- */
- void commitTran(StoreContext context) throws AMQException;
-
- /**
- * Abandons all operations performed within a given transactional context.
- *
- * @param context The transactional context to abandon.
- *
- * @throws AMQException If the operation fails for any reason.
- */
- void abortTran(StoreContext context) throws AMQException;
-
- /**
- * Tests a transactional context to see if it has been begun but not yet committed or aborted.
- *
- * @param context The transactional context to test.
- *
- * @return <tt>true</tt> if the transactional context is live, <tt>false</tt> otherwise.
- */
- boolean inTran(StoreContext context);
-
- /**
- * Return a valid, currently unused message id.
- *
- * @return A fresh message id.
- */
- Long getNewMessageId();
-
- /**
- * Stores a chunk of message data.
- *
- * @param context The transactional context for the operation.
- * @param messageId The message to store the data for.
- * @param index The index of the data chunk.
- * @param contentBody The content of the data chunk.
- * @param lastContentBody Flag to indicate that this is the last such chunk for the message.
- *
- * @throws AMQException If the operation fails for any reason, or if the specified message does not exist.
- */
- void storeContentBodyChunk(StoreContext context, Long messageId, int index, ContentChunk contentBody,
- boolean lastContentBody) throws AMQException;
-
- /**
- * Stores message meta-data.
- *
- * @param context The transactional context for the operation.
- * @param messageId The message to store the data for.
- * @param messageMetaData The message meta data to store.
- *
- * @throws AMQException If the operation fails for any reason, or if the specified message does not exist.
- */
- void storeMessageMetaData(StoreContext context, Long messageId, MessageMetaData messageMetaData) throws AMQException;
-
- /**
- * Retrieves message meta-data.
- *
- * @param context The transactional context for the operation.
- * @param messageId The message to get the meta-data for.
- *
- * @return The message meta data.
- *
- * @throws AMQException If the operation fails for any reason, or if the specified message does not exist.
- */
- MessageMetaData getMessageMetaData(StoreContext context, Long messageId) throws AMQException;
-
- /**
- * Retrieves a chunk of message data.
- *
- * @param context The transactional context for the operation.
- * @param messageId The message to get the data chunk for.
- * @param index The offset index of the data chunk within the message.
- *
- * @return A chunk of message data.
- *
- * @throws AMQException If the operation fails for any reason, or if the specified message does not exist.
- */
- ContentChunk getContentBodyChunk(StoreContext context, Long messageId, int index) throws AMQException;
-
- /**
- * Is this store capable of persisting the data
- *
- * @return true if this store is capable of persisting data
- */
- boolean isPersistent();
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreClosedException.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreClosedException.java
deleted file mode 100644
index 3d1538c7eb..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStoreClosedException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.apache.qpid.server.store;
-
-import org.apache.qpid.AMQException;/*
- *
- * 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.
- *
- */
-
-/**
- * NOTE: this class currently extends AMQException but
- * we should be using AMQExceptions internally in the code base for Protocol errors hence
- * the message store interface should throw a different super class which this should be
- * moved to reflect
- */
-public class MessageStoreClosedException extends AMQException
-{
- public MessageStoreClosedException()
- {
- super("Message store closed");
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoreContext.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoreContext.java
deleted file mode 100644
index fdb56a1a55..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/store/StoreContext.java
+++ /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.
- *
- */
-package org.apache.qpid.server.store;
-
-import org.apache.log4j.Logger;
-
-/**
- * A context that the store can use to associate with a transactional context. For example, it could store
- * some kind of txn id.
- *
- * @author Apache Software Foundation
- */
-public class StoreContext
-{
- private static final Logger _logger = Logger.getLogger(StoreContext.class);
-
- private String _name;
- private Object _payload;
-
- public StoreContext()
- {
- _name = "StoreContext";
- }
-
- public StoreContext(String name)
- {
- _name = name;
- }
-
- public Object getPayload()
- {
- return _payload;
- }
-
- public void setPayload(Object payload)
- {
- if(_logger.isDebugEnabled())
- {
- _logger.debug("public void setPayload(Object payload = " + payload + "): called");
- }
- _payload = payload;
- }
-
- /**
- * Prints out the transactional context as a string, mainly for debugging purposes.
- *
- * @return The transactional context as a string.
- */
- public String toString()
- {
- return "<_name = " + _name + ", _payload = " + _payload + ">";
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/ClientDeliveryMethod.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/ClientDeliveryMethod.java
deleted file mode 100644
index fbc8b3af7d..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/ClientDeliveryMethod.java
+++ /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.
-*
-*/
-package org.apache.qpid.server.subscription;
-
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.AMQException;
-
-public interface ClientDeliveryMethod
-{
- void deliverToClient(final Subscription sub, final QueueEntry entry, final long deliveryTag) throws AMQException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/RecordDeliveryMethod.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/RecordDeliveryMethod.java
deleted file mode 100644
index e2ed4104de..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/RecordDeliveryMethod.java
+++ /dev/null
@@ -1,28 +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.
-*
-*/
-package org.apache.qpid.server.subscription;
-
-import org.apache.qpid.server.queue.QueueEntry;
-
-public interface RecordDeliveryMethod
-{
- void recordMessageDelivery(final Subscription sub, final QueueEntry entry, final long deliveryTag);
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java
deleted file mode 100644
index 9419572399..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/Subscription.java
+++ /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.
- *
- */
-package org.apache.qpid.server.subscription;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.QueueEntry;
-
-public interface Subscription
-{
-
-
- public static enum State
- {
- ACTIVE,
- SUSPENDED,
- CLOSED
- }
-
- public static interface StateListener
- {
- public void stateChange(Subscription sub, State oldState, State newState);
- }
-
- AMQQueue getQueue();
-
- QueueEntry.SubscriptionAcquiredState getOwningState();
-
- void setQueue(AMQQueue queue);
-
- AMQChannel getChannel();
-
- AMQShortString getConsumerTag();
-
- boolean isSuspended();
-
- boolean hasInterest(QueueEntry msg);
-
- boolean isAutoClose();
-
- boolean isClosed();
-
- boolean isBrowser();
-
- void close();
-
- boolean filtersMessages();
-
- void send(QueueEntry msg) throws AMQException;
-
- void queueDeleted(AMQQueue queue);
-
-
- boolean wouldSuspend(QueueEntry msg);
-
- void getSendLock();
- void releaseSendLock();
-
- void resend(final QueueEntry entry) throws AMQException;
-
- void restoreCredit(final QueueEntry queueEntry);
-
- void setStateListener(final StateListener listener);
-
- public State getState();
-
- QueueEntry getLastSeenEntry();
-
- boolean setLastSeenEntry(QueueEntry expected, QueueEntry newValue);
-
-
- boolean isActive();
-
-
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionFactory.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionFactory.java
deleted file mode 100644
index ce0362d73f..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionFactory.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-package org.apache.qpid.server.subscription;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.flow.FlowCreditManager;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.AMQChannel;
-
-/**
- * Allows the customisation of the creation of a subscription. This is typically done within an AMQQueue. This factory
- * primarily assists testing although in future more sophisticated subscribers may need a different subscription
- * implementation.
- *
- * @see org.apache.qpid.server.queue.AMQQueue
- */
-public interface SubscriptionFactory
-{
- Subscription createSubscription(int channel,
- AMQProtocolSession protocolSession,
- AMQShortString consumerTag,
- boolean acks,
- FieldTable filters,
- boolean noLocal, FlowCreditManager creditManager) throws AMQException;
-
-
- Subscription createSubscription(AMQChannel channel,
- AMQProtocolSession protocolSession,
- AMQShortString consumerTag,
- boolean acks,
- FieldTable filters,
- boolean noLocal,
- FlowCreditManager creditManager,
- ClientDeliveryMethod clientMethod,
- RecordDeliveryMethod recordMethod
- )
- throws AMQException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionFactoryImpl.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionFactoryImpl.java
deleted file mode 100644
index 5badbad642..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionFactoryImpl.java
+++ /dev/null
@@ -1,103 +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.
- *
- */
-package org.apache.qpid.server.subscription;
-
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.flow.FlowCreditManager;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.subscription.SubscriptionFactory;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.common.AMQPFilterTypes;
-
-public class SubscriptionFactoryImpl implements SubscriptionFactory
-{
-
- /* private SubscriptionFactoryImpl()
- {
-
- }*/
-
- public Subscription createSubscription(int channelId, AMQProtocolSession protocolSession,
- AMQShortString consumerTag, boolean acks, FieldTable filters,
- boolean noLocal, FlowCreditManager creditManager) throws AMQException
- {
- AMQChannel channel = protocolSession.getChannel(channelId);
- if (channel == null)
- {
- throw new AMQException(AMQConstant.NOT_FOUND, "channel :" + channelId + " not found in protocol session");
- }
- ClientDeliveryMethod clientMethod = channel.getClientDeliveryMethod();
- RecordDeliveryMethod recordMethod = channel.getRecordDeliveryMethod();
-
-
- return createSubscription(channel, protocolSession, consumerTag, acks, filters,
- noLocal,
- creditManager,
- clientMethod,
- recordMethod
- );
- }
-
- public Subscription createSubscription(final AMQChannel channel,
- final AMQProtocolSession protocolSession,
- final AMQShortString consumerTag,
- final boolean acks,
- final FieldTable filters,
- final boolean noLocal,
- final FlowCreditManager creditManager,
- final ClientDeliveryMethod clientMethod,
- final RecordDeliveryMethod recordMethod
- )
- throws AMQException
- {
- boolean isBrowser;
-
- if (filters != null)
- {
- Boolean isBrowserObj = (Boolean) filters.get(AMQPFilterTypes.NO_CONSUME.getValue());
- isBrowser = (isBrowserObj != null) && isBrowserObj.booleanValue();
- }
- else
- {
- isBrowser = false;
- }
-
- if(isBrowser)
- {
- return new SubscriptionImpl.BrowserSubscription(channel, protocolSession, consumerTag, filters, noLocal, creditManager, clientMethod, recordMethod);
- }
- else if(acks)
- {
- return new SubscriptionImpl.AckSubscription(channel, protocolSession, consumerTag, filters, noLocal, creditManager, clientMethod, recordMethod);
- }
- else
- {
- return new SubscriptionImpl.NoAckSubscription(channel, protocolSession, consumerTag, filters, noLocal, creditManager, clientMethod, recordMethod);
- }
- }
-
-
- public static final SubscriptionFactoryImpl INSTANCE = new SubscriptionFactoryImpl();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java
deleted file mode 100644
index a616c2ea35..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionImpl.java
+++ /dev/null
@@ -1,617 +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.
- *
- */
-package org.apache.qpid.server.subscription;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.common.AMQPFilterTypes;
-import org.apache.qpid.common.ClientProperties;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.flow.FlowCreditManager;
-import org.apache.qpid.server.filter.FilterManager;
-import org.apache.qpid.server.filter.FilterManagerFactory;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.store.StoreContext;
-
-/**
- * Encapsulation of a supscription to a queue. <p/> Ties together the protocol session of a subscriber, the consumer tag
- * that was given out by the broker and the channel id. <p/>
- */
-public abstract class SubscriptionImpl implements Subscription, FlowCreditManager.FlowCreditManagerListener
-{
-
- private StateListener _stateListener = new StateListener()
- {
-
- public void stateChange(Subscription sub, State oldState, State newState)
- {
-
- }
- };
-
-
- private final AtomicReference<State> _state = new AtomicReference<State>(State.ACTIVE);
- private final AtomicReference<QueueEntry> _queueContext = new AtomicReference<QueueEntry>(null);
- private final ClientDeliveryMethod _deliveryMethod;
- private final RecordDeliveryMethod _recordMethod;
-
- private QueueEntry.SubscriptionAcquiredState _owningState = new QueueEntry.SubscriptionAcquiredState(this);
- private final Lock _stateChangeLock;
-
- static final class BrowserSubscription extends SubscriptionImpl
- {
- public BrowserSubscription(AMQChannel channel, AMQProtocolSession protocolSession,
- AMQShortString consumerTag, FieldTable filters,
- boolean noLocal, FlowCreditManager creditManager,
- ClientDeliveryMethod deliveryMethod,
- RecordDeliveryMethod recordMethod)
- throws AMQException
- {
- super(channel, protocolSession, consumerTag, filters, noLocal, creditManager, deliveryMethod, recordMethod);
- }
-
-
- public boolean isBrowser()
- {
- return true;
- }
-
- /**
- * This method can be called by each of the publisher threads. As a result all changes to the channel object must be
- * thread safe.
- *
- * @param msg The message to send
- * @throws AMQException
- */
- @Override
- public void send(QueueEntry msg) throws AMQException
- {
- // We don't decrement the reference here as we don't want to consume the message
- // but we do want to send it to the client.
-
- synchronized (getChannel())
- {
- long deliveryTag = getChannel().getNextDeliveryTag();
- sendToClient(msg, deliveryTag);
- }
-
- }
-
- @Override
- public boolean wouldSuspend(QueueEntry msg)
- {
- return false;
- }
-
- }
-
- public static class NoAckSubscription extends SubscriptionImpl
- {
- public NoAckSubscription(AMQChannel channel, AMQProtocolSession protocolSession,
- AMQShortString consumerTag, FieldTable filters,
- boolean noLocal, FlowCreditManager creditManager,
- ClientDeliveryMethod deliveryMethod,
- RecordDeliveryMethod recordMethod)
- throws AMQException
- {
- super(channel, protocolSession, consumerTag, filters, noLocal, creditManager, deliveryMethod, recordMethod);
- }
-
-
- public boolean isBrowser()
- {
- return false;
- }
-
- /**
- * This method can be called by each of the publisher threads. As a result all changes to the channel object must be
- * thread safe.
- *
- * @param entry The message to send
- * @throws AMQException
- */
- @Override
- public void send(QueueEntry entry) throws AMQException
- {
-
- StoreContext storeContext = getChannel().getStoreContext();
- try
- { // if we do not need to wait for client acknowledgements
- // we can decrement the reference count immediately.
-
- // By doing this _before_ the send we ensure that it
- // doesn't get sent if it can't be dequeued, preventing
- // duplicate delivery on recovery.
-
- // The send may of course still fail, in which case, as
- // the message is unacked, it will be lost.
- entry.dequeue(storeContext);
-
-
- synchronized (getChannel())
- {
- long deliveryTag = getChannel().getNextDeliveryTag();
-
- sendToClient(entry, deliveryTag);
-
- }
- entry.dispose(storeContext);
- }
- finally
- {
- //Only set delivered if it actually was writen successfully..
- // using a try->finally would set it even if an error occured.
- // Is this what we want?
-
- entry.setDeliveredToSubscription();
- }
- }
-
- @Override
- public boolean wouldSuspend(QueueEntry msg)
- {
- return false;
- }
-
- }
-
- static final class AckSubscription extends SubscriptionImpl
- {
- public AckSubscription(AMQChannel channel, AMQProtocolSession protocolSession,
- AMQShortString consumerTag, FieldTable filters,
- boolean noLocal, FlowCreditManager creditManager,
- ClientDeliveryMethod deliveryMethod,
- RecordDeliveryMethod recordMethod)
- throws AMQException
- {
- super(channel, protocolSession, consumerTag, filters, noLocal, creditManager, deliveryMethod, recordMethod);
- }
-
-
- public boolean isBrowser()
- {
- return false;
- }
-
-
- /**
- * This method can be called by each of the publisher threads. As a result all changes to the channel object must be
- * thread safe.
- *
- * @param entry The message to send
- * @throws AMQException
- */
- @Override
- public void send(QueueEntry entry) throws AMQException
- {
-
- try
- { // if we do not need to wait for client acknowledgements
- // we can decrement the reference count immediately.
-
- // By doing this _before_ the send we ensure that it
- // doesn't get sent if it can't be dequeued, preventing
- // duplicate delivery on recovery.
-
- // The send may of course still fail, in which case, as
- // the message is unacked, it will be lost.
-
- synchronized (getChannel())
- {
- long deliveryTag = getChannel().getNextDeliveryTag();
-
-
- recordMessageDelivery(entry, deliveryTag);
- sendToClient(entry, deliveryTag);
-
-
- }
- }
- finally
- {
- //Only set delivered if it actually was writen successfully..
- // using a try->finally would set it even if an error occured.
- // Is this what we want?
-
- entry.setDeliveredToSubscription();
- }
- }
-
-
- }
-
-
- private static final Logger _logger = Logger.getLogger(SubscriptionImpl.class);
-
- private final AMQChannel _channel;
-
- private final AMQShortString _consumerTag;
-
-
- private final boolean _noLocal;
-
- private final FlowCreditManager _creditManager;
-
- private FilterManager _filters;
-
- private final Boolean _autoClose;
-
-
- private static final String CLIENT_PROPERTIES_INSTANCE = ClientProperties.instance.toString();
-
- private AMQQueue _queue;
- private final AtomicBoolean _deleted = new AtomicBoolean(false);
-
-
-
-
- public SubscriptionImpl(AMQChannel channel , AMQProtocolSession protocolSession,
- AMQShortString consumerTag, FieldTable arguments,
- boolean noLocal, FlowCreditManager creditManager,
- ClientDeliveryMethod deliveryMethod,
- RecordDeliveryMethod recordMethod)
- throws AMQException
- {
-
- _channel = channel;
- _consumerTag = consumerTag;
-
- _creditManager = creditManager;
- creditManager.addStateListener(this);
-
- _noLocal = noLocal;
-
-
- _filters = FilterManagerFactory.createManager(arguments);
-
- _deliveryMethod = deliveryMethod;
- _recordMethod = recordMethod;
-
-
- _stateChangeLock = new ReentrantLock();
-
-
- if (arguments != null)
- {
- Object autoClose = arguments.get(AMQPFilterTypes.AUTO_CLOSE.getValue());
- if (autoClose != null)
- {
- _autoClose = (Boolean) autoClose;
- }
- else
- {
- _autoClose = false;
- }
- }
- else
- {
- _autoClose = false;
- }
-
-
- }
-
-
-
- public synchronized void setQueue(AMQQueue queue)
- {
- if(getQueue() != null)
- {
- throw new IllegalStateException("Attempt to set queue for subscription " + this + " to " + queue + "when already set to " + getQueue());
- }
- _queue = queue;
- }
-
- public String toString()
- {
- String subscriber = "[channel=" + _channel +
- ", consumerTag=" + _consumerTag +
- ", session=" + getProtocolSession().getKey() ;
-
- return subscriber + "]";
- }
-
- /**
- * This method can be called by each of the publisher threads. As a result all changes to the channel object must be
- * thread safe.
- *
- * @param msg The message to send
- * @throws AMQException
- */
- abstract public void send(QueueEntry msg) throws AMQException;
-
-
- public boolean isSuspended()
- {
- return !isActive() || _channel.isSuspended() || _deleted.get();
- }
-
- /**
- * Callback indicating that a queue has been deleted.
- *
- * @param queue The queue to delete
- */
- public void queueDeleted(AMQQueue queue)
- {
- _deleted.set(true);
-// _channel.queueDeleted(queue);
- }
-
- public boolean filtersMessages()
- {
- return _filters != null || _noLocal;
- }
-
- public boolean hasInterest(QueueEntry entry)
- {
- //check that the message hasn't been rejected
- if (entry.isRejectedBy(this))
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Subscription:" + debugIdentity() + " rejected message:" + entry.debugIdentity());
- }
-// return false;
- }
-
-
-
- //todo - client id should be recoreded and this test removed but handled below
- if (_noLocal)
- {
- final Object publisherId = entry.getMessage().getPublisherClientInstance();
-
- // We don't want local messages so check to see if message is one we sent
- Object localInstance;
-
- if (publisherId != null && (getProtocolSession().getClientProperties() != null) &&
- (localInstance = getProtocolSession().getClientProperties().getObject(CLIENT_PROPERTIES_INSTANCE)) != null)
- {
- if(publisherId.equals(localInstance))
- {
- return false;
- }
- }
- else
- {
-
- localInstance = getProtocolSession().getClientIdentifier();
- //todo - client id should be recoreded and this test removed but handled here
-
-
- if (localInstance != null && localInstance.equals(entry.getMessage().getPublisherIdentifier()))
- {
- return false;
- }
- }
-
-
- }
-
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("(" + debugIdentity() + ") checking filters for message (" + entry.debugIdentity());
- }
- return checkFilters(entry);
-
- }
-
- private String id = String.valueOf(System.identityHashCode(this));
-
- private String debugIdentity()
- {
- return id;
- }
-
- private boolean checkFilters(QueueEntry msg)
- {
- return (_filters == null) || _filters.allAllow(msg.getMessage());
- }
-
- public boolean isAutoClose()
- {
- return _autoClose;
- }
-
- public FlowCreditManager getCreditManager()
- {
- return _creditManager;
- }
-
-
- public void close()
- {
- boolean closed = false;
- State state = getState();
-
- _stateChangeLock.lock();
- try
- {
- while(!closed && state != State.CLOSED)
- {
- closed = _state.compareAndSet(state, State.CLOSED);
- if(!closed)
- {
- state = getState();
- }
- else
- {
- _stateListener.stateChange(this,state, State.CLOSED);
- }
- }
- _creditManager.removeListener(this);
- }
- finally
- {
- _stateChangeLock.unlock();
- }
-
-
- if (closed)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Called close() on a closed subscription");
- }
-
- return;
- }
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("Closing subscription (" + debugIdentity() + "):" + this);
- }
- }
-
- public boolean isClosed()
- {
- return getState() == State.CLOSED;
- }
-
-
- public boolean wouldSuspend(QueueEntry msg)
- {
- return !_creditManager.useCreditForMessage(msg.getMessage());//_channel.wouldSuspend(msg.getMessage());
- }
-
- public void getSendLock()
- {
- _stateChangeLock.lock();
- }
-
- public void releaseSendLock()
- {
- _stateChangeLock.unlock();
- }
-
- public void resend(final QueueEntry entry) throws AMQException
- {
- _queue.resend(entry, this);
- }
-
- public AMQChannel getChannel()
- {
- return _channel;
- }
-
- public AMQShortString getConsumerTag()
- {
- return _consumerTag;
- }
-
- public AMQProtocolSession getProtocolSession()
- {
- return _channel.getProtocolSession();
- }
-
- public AMQQueue getQueue()
- {
- return _queue;
- }
-
- public void restoreCredit(final QueueEntry queueEntry)
- {
- _creditManager.addCredit(1, queueEntry.getSize());
- }
-
-
- public void creditStateChanged(boolean hasCredit)
- {
-
- if(hasCredit)
- {
- if(_state.compareAndSet(State.SUSPENDED, State.ACTIVE))
- {
- _stateListener.stateChange(this, State.SUSPENDED, State.ACTIVE);
- }
- else
- {
- // this is a hack to get round the issue of increasing bytes credit
- _stateListener.stateChange(this, State.ACTIVE, State.ACTIVE);
- }
- }
- else
- {
- if(_state.compareAndSet(State.ACTIVE, State.SUSPENDED))
- {
- _stateListener.stateChange(this, State.ACTIVE, State.SUSPENDED);
- }
- }
- }
-
- public State getState()
- {
- return _state.get();
- }
-
-
- public void setStateListener(final StateListener listener)
- {
- _stateListener = listener;
- }
-
-
- public QueueEntry getLastSeenEntry()
- {
- return _queueContext.get();
- }
-
- public boolean setLastSeenEntry(QueueEntry expected, QueueEntry newvalue)
- {
- return _queueContext.compareAndSet(expected,newvalue);
- }
-
-
- protected void sendToClient(final QueueEntry entry, final long deliveryTag)
- throws AMQException
- {
- _deliveryMethod.deliverToClient(this,entry,deliveryTag);
- }
-
-
- protected void recordMessageDelivery(final QueueEntry entry, final long deliveryTag)
- {
- _recordMethod.recordMessageDelivery(this,entry,deliveryTag);
- }
-
-
- public boolean isActive()
- {
- return getState() == State.ACTIVE;
- }
-
- public QueueEntry.SubscriptionAcquiredState getOwningState()
- {
- return _owningState;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionList.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionList.java
deleted file mode 100644
index 3fbb6bfa4a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/subscription/SubscriptionList.java
+++ /dev/null
@@ -1,247 +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.
-*
-*/
-package org.apache.qpid.server.subscription;
-
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.subscription.Subscription;
-
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.nio.ByteBuffer;
-
-public class SubscriptionList
-{
-
- private final SubscriptionNode _head = new SubscriptionNode();
-
- private AtomicReference<SubscriptionNode> _tail = new AtomicReference<SubscriptionNode>(_head);
- private final AMQQueue _queue;
- private AtomicInteger _size = new AtomicInteger();
-
-
- public final class SubscriptionNode
- {
- private final AtomicBoolean _deleted = new AtomicBoolean();
- private final AtomicReference<SubscriptionNode> _next = new AtomicReference<SubscriptionNode>();
- private final Subscription _sub;
-
-
- public SubscriptionNode()
- {
-
- _sub = null;
- _deleted.set(true);
- }
-
- public SubscriptionNode(final Subscription sub)
- {
- _sub = sub;
- }
-
-
- public SubscriptionNode getNext()
- {
-
- SubscriptionNode next = nextNode();
- while(next != null && next.isDeleted())
- {
-
- final SubscriptionNode newNext = next.nextNode();
- if(newNext != null)
- {
- _next.compareAndSet(next, newNext);
- next = nextNode();
- }
- else
- {
- next = null;
- }
-
- }
- return next;
- }
-
- private SubscriptionNode nextNode()
- {
- return _next.get();
- }
-
- public boolean isDeleted()
- {
- return _deleted.get();
- }
-
-
- public boolean delete()
- {
- if(_deleted.compareAndSet(false,true))
- {
- _size.decrementAndGet();
- advanceHead();
- return true;
- }
- else
- {
- return false;
- }
- }
-
-
- public Subscription getSubscription()
- {
- return _sub;
- }
- }
-
-
- public SubscriptionList(AMQQueue queue)
- {
- _queue = queue;
- }
-
- private void advanceHead()
- {
- SubscriptionNode head = _head.nextNode();
- while(head._next.get() != null && head.isDeleted())
- {
-
- final SubscriptionNode newhead = head.nextNode();
- if(newhead != null)
- {
- _head._next.compareAndSet(head, newhead);
- }
- head = _head.nextNode();
- }
- }
-
-
- public SubscriptionNode add(Subscription sub)
- {
- SubscriptionNode node = new SubscriptionNode(sub);
- for (;;)
- {
- SubscriptionNode tail = _tail.get();
- SubscriptionNode next = tail.nextNode();
- if (tail == _tail.get())
- {
- if (next == null)
- {
- if (tail._next.compareAndSet(null, node))
- {
- _tail.compareAndSet(tail, node);
- _size.incrementAndGet();
- return node;
- }
- }
- else
- {
- _tail.compareAndSet(tail, next);
- }
- }
- }
-
- }
-
- public boolean remove(Subscription sub)
- {
- SubscriptionNode node = _head.getNext();
- while(node != null)
- {
- if(sub.equals(node._sub) && node.delete())
- {
- return true;
- }
- node = node.getNext();
- }
- return false;
- }
-
-
- public class SubscriptionNodeIterator
- {
-
- private SubscriptionNode _lastNode;
-
- SubscriptionNodeIterator(SubscriptionNode startNode)
- {
- _lastNode = startNode;
- }
-
-
- public boolean atTail()
- {
- return _lastNode.nextNode() == null;
- }
-
- public SubscriptionNode getNode()
- {
-
- return _lastNode;
-
- }
-
- public boolean advance()
- {
-
- if(!atTail())
- {
- SubscriptionNode nextNode = _lastNode.nextNode();
- while(nextNode.isDeleted() && nextNode.nextNode() != null)
- {
- nextNode = nextNode.nextNode();
- }
- _lastNode = nextNode;
- return true;
-
- }
- else
- {
- return false;
- }
-
- }
-
- }
-
-
- public SubscriptionNodeIterator iterator()
- {
- return new SubscriptionNodeIterator(_head);
- }
-
-
- public SubscriptionNode getHead()
- {
- return _head;
- }
-
- public int size()
- {
- return _size.get();
- }
-
-
-
-}
-
-
-
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ConnectorConfiguration.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ConnectorConfiguration.java
deleted file mode 100644
index b67bb98e28..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ConnectorConfiguration.java
+++ /dev/null
@@ -1,118 +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.
- *
- */
-package org.apache.qpid.server.transport;
-
-import org.apache.mina.common.IoAcceptor;
-import org.apache.mina.util.NewThreadExecutor;
-import org.apache.qpid.configuration.Configured;
-import org.apache.log4j.Logger;
-
-public class ConnectorConfiguration
-{
- private static final Logger _logger = Logger.getLogger(ConnectorConfiguration.class);
-
- public static final String DEFAULT_PORT = "5672";
-
- public static final String SSL_PORT = "8672";
-
- @Configured(path = "connector.processors",
- defaultValue = "4")
- public int processors;
-
- @Configured(path = "connector.port",
- defaultValue = DEFAULT_PORT)
- public int port;
-
- @Configured(path = "connector.bind",
- defaultValue = "wildcard")
- public String bindAddress;
-
- @Configured(path = "connector.socketReceiveBuffer",
- defaultValue = "32767")
- public int socketReceiveBufferSize;
-
- @Configured(path = "connector.socketWriteBuffer",
- defaultValue = "32767")
- public int socketWriteBuferSize;
-
- @Configured(path = "connector.tcpNoDelay",
- defaultValue = "true")
- public boolean tcpNoDelay;
-
- @Configured(path = "advanced.filterchain[@enableExecutorPool]",
- defaultValue = "false")
- public boolean enableExecutorPool;
-
- @Configured(path = "advanced.enablePooledAllocator",
- defaultValue = "false")
- public boolean enablePooledAllocator;
-
- @Configured(path = "advanced.enableDirectBuffers",
- defaultValue = "false")
- public boolean enableDirectBuffers;
-
- @Configured(path = "connector.ssl.enabled",
- defaultValue = "false")
- public boolean enableSSL;
-
- @Configured(path = "connector.ssl.sslOnly",
- defaultValue = "true")
- public boolean sslOnly;
-
- @Configured(path = "connector.ssl.port",
- defaultValue = SSL_PORT)
- public int sslPort;
-
- @Configured(path = "connector.ssl.keystorePath",
- defaultValue = "none")
- public String keystorePath;
-
- @Configured(path = "connector.ssl.keystorePassword",
- defaultValue = "none")
- public String keystorePassword;
-
- @Configured(path = "connector.ssl.certType",
- defaultValue = "SunX509")
- public String certType;
-
- @Configured(path = "connector.qpidnio",
- defaultValue = "false")
- public boolean _multiThreadNIO;
-
- @Configured(path = "advanced.useWriteBiasedPool",
- defaultValue = "false")
- public boolean useBiasedWrites;
-
-
- public IoAcceptor createAcceptor()
- {
- if (_multiThreadNIO)
- {
- _logger.warn("Using Qpid Multithreaded IO Processing");
- return new org.apache.mina.transport.socket.nio.MultiThreadSocketAcceptor(processors, new NewThreadExecutor());
- }
- else
- {
- _logger.warn("Using Mina IO Processing");
- return new org.apache.mina.transport.socket.nio.SocketAcceptor(processors, new NewThreadExecutor());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java
deleted file mode 100644
index bdd27f2d1c..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java
+++ /dev/null
@@ -1,705 +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.
- *
- */
-package org.apache.qpid.server.transport;
-
-import java.util.ArrayList;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoFilterAdapter;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.util.BlockingQueue;
-import org.apache.mina.util.ByteBufferUtil;
-import org.apache.mina.util.IdentityHashSet;
-import org.apache.mina.util.Queue;
-import org.apache.mina.util.Stack;
-
-/**
- * A Thread-pooling filter. This filter forwards {@link IoHandler} events
- * to its thread pool.
- * <p/>
- * This is an implementation of
- * <a href="http://deuce.doc.wustl.edu/doc/pspdfs/lf.pdf">Leader/Followers
- * thread pool</a> by Douglas C. Schmidt et al.
- */
-public class ThreadPoolFilter extends IoFilterAdapter
-{
- /**
- * Default maximum size of thread pool (2G).
- */
- public static final int DEFAULT_MAXIMUM_POOL_SIZE = Integer.MAX_VALUE;
-
- /**
- * Default keep-alive time of thread pool (1 min).
- */
- public static final int DEFAULT_KEEP_ALIVE_TIME = 60 * 1000;
-
- /**
- * A queue which contains {@link Integer}s which represents reusable
- * thread IDs. {@link Worker} first checks this queue and then
- * uses {@link #threadId} when no reusable thread ID is available.
- */
- private static final Queue threadIdReuseQueue = new Queue();
- private static int threadId = 0;
-
- private static int acquireThreadId()
- {
- synchronized (threadIdReuseQueue)
- {
- Integer id = (Integer) threadIdReuseQueue.pop();
- if (id == null)
- {
- return ++ threadId;
- }
- else
- {
- return id.intValue();
- }
- }
- }
-
- private static void releaseThreadId(int id)
- {
- synchronized (threadIdReuseQueue)
- {
- threadIdReuseQueue.push(new Integer(id));
- }
- }
-
- private final String threadNamePrefix;
- private final Map buffers = new IdentityHashMap();
- private final BlockingQueue unfetchedSessionBuffers = new BlockingQueue();
- private final Set allSessionBuffers = new IdentityHashSet();
-
- private Worker leader;
- private final Stack followers = new Stack();
- private final Set allWorkers = new IdentityHashSet();
-
- private int maximumPoolSize = DEFAULT_MAXIMUM_POOL_SIZE;
- private int keepAliveTime = DEFAULT_KEEP_ALIVE_TIME;
-
- private boolean shuttingDown;
-
- private int poolSize;
- private final Object poolSizeLock = new Object();
-
- /**
- * Creates a new instance of this filter with default thread pool settings.
- */
- public ThreadPoolFilter()
- {
- this("IoThreadPool");
- }
-
- /**
- * Creates a new instance of this filter with the specified thread name prefix
- * and other default settings.
- *
- * @param threadNamePrefix the prefix of the thread names this pool will create.
- */
- public ThreadPoolFilter(String threadNamePrefix)
- {
- if (threadNamePrefix == null)
- {
- throw new NullPointerException("threadNamePrefix");
- }
- threadNamePrefix = threadNamePrefix.trim();
- if (threadNamePrefix.length() == 0)
- {
- throw new IllegalArgumentException("threadNamePrefix is empty.");
- }
- this.threadNamePrefix = threadNamePrefix;
- }
-
- public String getThreadNamePrefix()
- {
- return threadNamePrefix;
- }
-
- public int getPoolSize()
- {
- synchronized (poolSizeLock)
- {
- return poolSize;
- }
- }
-
- public int getMaximumPoolSize()
- {
- return maximumPoolSize;
- }
-
- public int getKeepAliveTime()
- {
- return keepAliveTime;
- }
-
- public void setMaximumPoolSize(int maximumPoolSize)
- {
- if (maximumPoolSize <= 0)
- {
- throw new IllegalArgumentException();
- }
- this.maximumPoolSize = maximumPoolSize;
- }
-
- public void setKeepAliveTime(int keepAliveTime)
- {
- this.keepAliveTime = keepAliveTime;
- }
-
- public void init()
- {
- shuttingDown = false;
- leader = new Worker();
- leader.start();
- leader.lead();
- }
-
- public void destroy()
- {
- shuttingDown = true;
- int expectedPoolSize = 0;
- while (getPoolSize() != expectedPoolSize)
- {
- List allWorkers;
- synchronized (poolSizeLock)
- {
- allWorkers = new ArrayList(this.allWorkers);
- }
-
- // You may not interrupt the current thread.
- if (allWorkers.remove(Thread.currentThread()))
- {
- expectedPoolSize = 1;
- }
-
- for (Iterator i = allWorkers.iterator(); i.hasNext();)
- {
- Worker worker = (Worker) i.next();
- while (worker.isAlive())
- {
- worker.interrupt();
- try
- {
- // This timeout will help us from
- // infinite lock-up and interrupt workers again.
- worker.join(100);
- }
- catch (InterruptedException e)
- {
- }
- }
- }
- }
-
- this.allSessionBuffers.clear();
- this.unfetchedSessionBuffers.clear();
- this.buffers.clear();
- this.followers.clear();
- this.leader = null;
- }
-
- private void increasePoolSize(Worker worker)
- {
- synchronized (poolSizeLock)
- {
- poolSize++;
- allWorkers.add(worker);
- }
- }
-
- private void decreasePoolSize(Worker worker)
- {
- synchronized (poolSizeLock)
- {
- poolSize--;
- allWorkers.remove(worker);
- }
- }
-
- private void fireEvent(NextFilter nextFilter, IoSession session,
- EventType type, Object data)
- {
- final BlockingQueue unfetchedSessionBuffers = this.unfetchedSessionBuffers;
- final Set allSessionBuffers = this.allSessionBuffers;
- final Event event = new Event(type, nextFilter, data);
-
- synchronized (unfetchedSessionBuffers)
- {
- final SessionBuffer buf = getSessionBuffer(session);
- final Queue eventQueue = buf.eventQueue;
-
- synchronized (buf)
- {
- eventQueue.push(event);
- }
-
- if (!allSessionBuffers.contains(buf))
- {
- allSessionBuffers.add(buf);
- unfetchedSessionBuffers.push(buf);
- }
- }
- }
-
- /**
- * Implement this method to fetch (or pop) a {@link SessionBuffer} from
- * the given <tt>unfetchedSessionBuffers</tt>. The default implementation
- * simply pops the buffer from it. You could prioritize the fetch order.
- *
- * @return A non-null {@link SessionBuffer}
- */
- protected SessionBuffer fetchSessionBuffer(Queue unfetchedSessionBuffers)
- {
- return (SessionBuffer) unfetchedSessionBuffers.pop();
- }
-
- private SessionBuffer getSessionBuffer(IoSession session)
- {
- final Map buffers = this.buffers;
- SessionBuffer buf = (SessionBuffer) buffers.get(session);
- if (buf == null)
- {
- synchronized (buffers)
- {
- buf = (SessionBuffer) buffers.get(session);
- if (buf == null)
- {
- buf = new SessionBuffer(session);
- buffers.put(session, buf);
- }
- }
- }
- return buf;
- }
-
- private void removeSessionBuffer(SessionBuffer buf)
- {
- final Map buffers = this.buffers;
- final IoSession session = buf.session;
- synchronized (buffers)
- {
- buffers.remove(session);
- }
- }
-
- protected static class SessionBuffer
- {
- private final IoSession session;
-
- private final Queue eventQueue = new Queue();
-
- private SessionBuffer(IoSession session)
- {
- this.session = session;
- }
-
- public IoSession getSession()
- {
- return session;
- }
-
- public Queue getEventQueue()
- {
- return eventQueue;
- }
- }
-
- private class Worker extends Thread
- {
- private final int id;
- private final Object promotionLock = new Object();
- private boolean dead;
-
- private Worker()
- {
- int id = acquireThreadId();
- this.id = id;
- this.setName(threadNamePrefix + '-' + id);
- increasePoolSize(this);
- }
-
- public boolean lead()
- {
- final Object promotionLock = this.promotionLock;
- synchronized (promotionLock)
- {
- if (dead)
- {
- return false;
- }
-
- leader = this;
- promotionLock.notify();
- }
-
- return true;
- }
-
- public void run()
- {
- for (; ;)
- {
- if (!waitForPromotion())
- {
- break;
- }
-
- SessionBuffer buf = fetchBuffer();
- giveUpLead();
- if (buf == null)
- {
- break;
- }
-
- processEvents(buf);
- follow();
- releaseBuffer(buf);
- }
-
- decreasePoolSize(this);
- releaseThreadId(id);
- }
-
- private SessionBuffer fetchBuffer()
- {
- BlockingQueue unfetchedSessionBuffers = ThreadPoolFilter.this.unfetchedSessionBuffers;
- synchronized (unfetchedSessionBuffers)
- {
- while (!shuttingDown)
- {
- try
- {
- unfetchedSessionBuffers.waitForNewItem();
- }
- catch (InterruptedException e)
- {
- continue;
- }
-
- return ThreadPoolFilter.this.fetchSessionBuffer(unfetchedSessionBuffers);
- }
- }
-
- return null;
- }
-
- private void processEvents(SessionBuffer buf)
- {
- final IoSession session = buf.session;
- final Queue eventQueue = buf.eventQueue;
- for (; ;)
- {
- Event event;
- synchronized (buf)
- {
- event = (Event) eventQueue.pop();
- if (event == null)
- {
- break;
- }
- }
- processEvent(event.getNextFilter(), session,
- event.getType(), event.getData());
- }
- }
-
- private void follow()
- {
- final Object promotionLock = this.promotionLock;
- final Stack followers = ThreadPoolFilter.this.followers;
- synchronized (promotionLock)
- {
- if (this != leader)
- {
- synchronized (followers)
- {
- followers.push(this);
- }
- }
- }
- }
-
- private void releaseBuffer(SessionBuffer buf)
- {
- final BlockingQueue unfetchedSessionBuffers = ThreadPoolFilter.this.unfetchedSessionBuffers;
- final Set allSessionBuffers = ThreadPoolFilter.this.allSessionBuffers;
- final Queue eventQueue = buf.eventQueue;
-
- synchronized (unfetchedSessionBuffers)
- {
- if (eventQueue.isEmpty())
- {
- allSessionBuffers.remove(buf);
- removeSessionBuffer(buf);
- }
- else
- {
- unfetchedSessionBuffers.push(buf);
- }
- }
- }
-
- private boolean waitForPromotion()
- {
- final Object promotionLock = this.promotionLock;
-
- long startTime = System.currentTimeMillis();
- long currentTime = System.currentTimeMillis();
-
- synchronized (promotionLock)
- {
- while (this != leader && !shuttingDown)
- {
- // Calculate remaining keep-alive time
- int keepAliveTime = getKeepAliveTime();
- if (keepAliveTime > 0)
- {
- keepAliveTime -= (currentTime - startTime);
- }
- else
- {
- keepAliveTime = Integer.MAX_VALUE;
- }
-
- // Break the loop if there's no remaining keep-alive time.
- if (keepAliveTime <= 0)
- {
- break;
- }
-
- // Wait for promotion
- try
- {
- promotionLock.wait(keepAliveTime);
- }
- catch (InterruptedException e)
- {
- }
-
- // Update currentTime for the next iteration
- currentTime = System.currentTimeMillis();
- }
-
- boolean timeToLead = this == leader && !shuttingDown;
-
- if (!timeToLead)
- {
- // time to die
- synchronized (followers)
- {
- followers.remove(this);
- }
-
- // Mark as dead explicitly when we've got promotionLock.
- dead = true;
- }
-
- return timeToLead;
- }
- }
-
- private void giveUpLead()
- {
- final Stack followers = ThreadPoolFilter.this.followers;
- Worker worker;
- do
- {
- synchronized (followers)
- {
- worker = (Worker) followers.pop();
- }
-
- if (worker == null)
- {
- // Increase the number of threads if we
- // are not shutting down and we can increase the number.
- if (!shuttingDown
- && getPoolSize() < getMaximumPoolSize())
- {
- worker = new Worker();
- worker.lead();
- worker.start();
- }
-
- // This loop should end because:
- // 1) lead() is called already,
- // 2) or it is shutting down and there's no more threads left.
- break;
- }
- }
- while (!worker.lead());
- }
- }
-
- protected static class EventType
- {
- public static final EventType OPENED = new EventType("OPENED");
-
- public static final EventType CLOSED = new EventType("CLOSED");
-
- public static final EventType READ = new EventType("READ");
-
- public static final EventType WRITTEN = new EventType("WRITTEN");
-
- public static final EventType RECEIVED = new EventType("RECEIVED");
-
- public static final EventType SENT = new EventType("SENT");
-
- public static final EventType IDLE = new EventType("IDLE");
-
- public static final EventType EXCEPTION = new EventType("EXCEPTION");
-
- private final String value;
-
- private EventType(String value)
- {
- this.value = value;
- }
-
- public String toString()
- {
- return value;
- }
- }
-
- protected static class Event
- {
- private final EventType type;
- private final NextFilter nextFilter;
- private final Object data;
-
- public Event(EventType type, NextFilter nextFilter, Object data)
- {
- this.type = type;
- this.nextFilter = nextFilter;
- this.data = data;
- }
-
- public Object getData()
- {
- return data;
- }
-
-
- public NextFilter getNextFilter()
- {
- return nextFilter;
- }
-
-
- public EventType getType()
- {
- return type;
- }
- }
-
- public void sessionCreated(NextFilter nextFilter, IoSession session)
- {
- nextFilter.sessionCreated(session);
- }
-
- public void sessionOpened(NextFilter nextFilter,
- IoSession session)
- {
- fireEvent(nextFilter, session, EventType.OPENED, null);
- }
-
- public void sessionClosed(NextFilter nextFilter,
- IoSession session)
- {
- fireEvent(nextFilter, session, EventType.CLOSED, null);
- }
-
- public void sessionIdle(NextFilter nextFilter,
- IoSession session, IdleStatus status)
- {
- fireEvent(nextFilter, session, EventType.IDLE, status);
- }
-
- public void exceptionCaught(NextFilter nextFilter,
- IoSession session, Throwable cause)
- {
- fireEvent(nextFilter, session, EventType.EXCEPTION, cause);
- }
-
- public void messageReceived(NextFilter nextFilter,
- IoSession session, Object message)
- {
- ByteBufferUtil.acquireIfPossible(message);
- fireEvent(nextFilter, session, EventType.RECEIVED, message);
- }
-
- public void messageSent(NextFilter nextFilter,
- IoSession session, Object message)
- {
- ByteBufferUtil.acquireIfPossible(message);
- fireEvent(nextFilter, session, EventType.SENT, message);
- }
-
- protected void processEvent(NextFilter nextFilter,
- IoSession session, EventType type,
- Object data)
- {
- if (type == EventType.RECEIVED)
- {
- nextFilter.messageReceived(session, data);
- ByteBufferUtil.releaseIfPossible(data);
- }
- else if (type == EventType.SENT)
- {
- nextFilter.messageSent(session, data);
- ByteBufferUtil.releaseIfPossible(data);
- }
- else if (type == EventType.EXCEPTION)
- {
- nextFilter.exceptionCaught(session, (Throwable) data);
- }
- else if (type == EventType.IDLE)
- {
- nextFilter.sessionIdle(session, (IdleStatus) data);
- }
- else if (type == EventType.OPENED)
- {
- nextFilter.sessionOpened(session);
- }
- else if (type == EventType.CLOSED)
- {
- nextFilter.sessionClosed(session);
- }
- }
-
- public void filterWrite(NextFilter nextFilter, IoSession session, WriteRequest writeRequest)
- {
- nextFilter.filterWrite(session, writeRequest);
- }
-
- public void filterClose(NextFilter nextFilter, IoSession session) throws Exception
- {
- nextFilter.filterClose(session);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/LocalTransactionalContext.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/LocalTransactionalContext.java
deleted file mode 100644
index 3c71282c57..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/LocalTransactionalContext.java
+++ /dev/null
@@ -1,293 +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.
- *
- */
-package org.apache.qpid.server.txn;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.ack.TxAck;
-import org.apache.qpid.server.ack.UnacknowledgedMessageMap;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.*;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.StoreContext;
-
-import java.util.List;
-import java.util.ArrayList;
-
-/** A transactional context that only supports local transactions. */
-public class LocalTransactionalContext implements TransactionalContext
-{
- private static final Logger _log = Logger.getLogger(LocalTransactionalContext.class);
-
- private final TxnBuffer _txnBuffer = new TxnBuffer();
-
- private final List<DeliveryAction> _postCommitDeliveryList = new ArrayList<DeliveryAction>();
-
- /**
- * We keep hold of the ack operation so that we can consolidate acks, i.e. multiple acks within a txn are
- * consolidated into a single operation
- */
- private TxAck _ackOp;
-
- private boolean _inTran = false;
-
- /** Are there messages to deliver. NOT Has the message been delivered */
- private boolean _messageDelivered = false;
- private final AMQChannel _channel;
-
-
- private abstract class DeliveryAction
- {
-
- abstract public void process() throws AMQException;
-
- }
-
- private class RequeueAction extends DeliveryAction
- {
- public QueueEntry entry;
-
- public RequeueAction(QueueEntry entry)
- {
- this.entry = entry;
- }
-
- public void process() throws AMQException
- {
- entry.requeue(getStoreContext());
- }
- }
-
- private class PublishAction extends DeliveryAction
- {
- private final AMQQueue _queue;
- private final AMQMessage _message;
-
- public PublishAction(final AMQQueue queue, final AMQMessage message)
- {
- _queue = queue;
- _message = message;
- }
-
- public void process() throws AMQException
- {
-
- _message.incrementReference();
- try
- {
- QueueEntry entry = _queue.enqueue(getStoreContext(),_message);
-
- if(entry.immediateAndNotDelivered())
- {
- getReturnMessages().add(new NoConsumersException(_message));
- }
- }
- finally
- {
- _message.decrementReference(getStoreContext());
- }
- }
- }
-
- public LocalTransactionalContext(final AMQChannel channel)
- {
- _channel = channel;
- }
-
- public StoreContext getStoreContext()
- {
- return _channel.getStoreContext();
- }
-
- public List<RequiredDeliveryException> getReturnMessages()
- {
- return _channel.getReturnMessages();
- }
-
- public MessageStore getMessageStore()
- {
- return _channel.getMessageStore();
- }
-
-
- public void rollback() throws AMQException
- {
- _txnBuffer.rollback(getStoreContext());
- // Hack to deal with uncommitted non-transactional writes
- if (getMessageStore().inTran(getStoreContext()))
- {
- getMessageStore().abortTran(getStoreContext());
- _inTran = false;
- }
-
- _postCommitDeliveryList.clear();
- }
-
- public void deliver(final AMQQueue queue, AMQMessage message) throws AMQException
- {
- // A publication will result in the enlisting of several
- // TxnOps. The first is an op that will store the message.
- // Following that (and ordering is important), an op will
- // be added for every queue onto which the message is
- // enqueued.
- _postCommitDeliveryList.add(new PublishAction(queue, message));
- _messageDelivered = true;
-
- }
-
- public void requeue(QueueEntry entry) throws AMQException
- {
- _postCommitDeliveryList.add(new RequeueAction(entry));
- _messageDelivered = true;
-
- }
-
-
- private void checkAck(long deliveryTag, UnacknowledgedMessageMap unacknowledgedMessageMap) throws AMQException
- {
- if (!unacknowledgedMessageMap.contains(deliveryTag))
- {
- throw new AMQException("Ack with delivery tag " + deliveryTag + " not known for channel");
- }
- }
-
- public void acknowledgeMessage(long deliveryTag, long lastDeliveryTag, boolean multiple,
- UnacknowledgedMessageMap unacknowledgedMessageMap) throws AMQException
- {
- // check that the tag exists to give early failure
- if (!multiple || (deliveryTag > 0))
- {
- checkAck(deliveryTag, unacknowledgedMessageMap);
- }
- // we use a single txn op for all acks and update this op
- // as new acks come in. If this is the first ack in the txn
- // we will need to create and enlist the op.
- if (_ackOp == null)
- {
- _ackOp = new TxAck(unacknowledgedMessageMap);
- _txnBuffer.enlist(_ackOp);
- }
- // update the op to include this ack request
- if (multiple && (deliveryTag == 0))
- {
- // if have signalled to ack all, that refers only
- // to all at this time
- _ackOp.update(lastDeliveryTag, multiple);
- }
- else
- {
- _ackOp.update(deliveryTag, multiple);
- }
- if(!_inTran && _ackOp.checkPersistent())
- {
- beginTranIfNecessary();
- }
- }
-
- public void messageFullyReceived(boolean persistent) throws AMQException
- {
- // Not required in this transactional context
- }
-
- public void messageProcessed(AMQProtocolSession protocolSession) throws AMQException
- {
- // Not required in this transactional context
- }
-
- public void beginTranIfNecessary() throws AMQException
- {
- if (!_inTran)
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Starting transaction on message store: " + this);
- }
-
- getMessageStore().beginTran(getStoreContext());
- _inTran = true;
- }
- }
-
- public void commit() throws AMQException
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Committing transactional context: " + this);
- }
-
- if (_ackOp != null)
- {
-
- _messageDelivered = true;
- _ackOp.consolidate();
- // already enlisted, after commit will reset regardless of outcome
- _ackOp = null;
- }
-
- if (_messageDelivered && _inTran)
- {
- _txnBuffer.enlist(new StoreMessageOperation(getMessageStore()));
- }
- // fixme fail commit here ... QPID-440
- try
- {
- _txnBuffer.commit(getStoreContext());
- }
- finally
- {
- _messageDelivered = false;
- _inTran = getMessageStore().inTran(getStoreContext());
- }
-
- try
- {
- postCommitDelivery();
- }
- catch (AMQException e)
- {
- // OK so what do we do now...?
- _log.error("Failed to deliver messages following txn commit: " + e, e);
- }
- }
-
- private void postCommitDelivery() throws AMQException
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Performing post commit delivery");
- }
-
- try
- {
- for (DeliveryAction dd : _postCommitDeliveryList)
- {
- dd.process();
- }
- }
- finally
- {
- _postCommitDeliveryList.clear();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/NonTransactionalContext.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/NonTransactionalContext.java
deleted file mode 100644
index 28af36e3db..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/NonTransactionalContext.java
+++ /dev/null
@@ -1,213 +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.
- *
- */
-package org.apache.qpid.server.txn;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.ack.UnacknowledgedMessageMap;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.*;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.StoreContext;
-
-/** @author Apache Software Foundation */
-public class NonTransactionalContext implements TransactionalContext
-{
- private static final Logger _log = Logger.getLogger(NonTransactionalContext.class);
-
- /** Channel is useful for logging */
- private final AMQChannel _channel;
-
- /** Where to put undeliverable messages */
- private final List<RequiredDeliveryException> _returnMessages;
-
-
-
- private final MessageStore _messageStore;
-
- private final StoreContext _storeContext;
-
- /** Whether we are in a transaction */
- private boolean _inTran;
-
- public NonTransactionalContext(MessageStore messageStore, StoreContext storeContext, AMQChannel channel,
- List<RequiredDeliveryException> returnMessages)
- {
- _channel = channel;
- _storeContext = storeContext;
- _returnMessages = returnMessages;
- _messageStore = messageStore;
-
- }
-
-
- public StoreContext getStoreContext()
- {
- return _storeContext;
- }
-
- public void beginTranIfNecessary() throws AMQException
- {
- if (!_inTran)
- {
- _messageStore.beginTran(_storeContext);
- _inTran = true;
- }
- }
-
- public void commit() throws AMQException
- {
- // Does not apply to this context
- }
-
- public void rollback() throws AMQException
- {
- // Does not apply to this context
- }
-
- public void deliver(final AMQQueue queue, AMQMessage message) throws AMQException
- {
- QueueEntry entry = queue.enqueue(_storeContext, message);
-
- //following check implements the functionality
- //required by the 'immediate' flag:
- if(entry.immediateAndNotDelivered())
- {
- _returnMessages.add(new NoConsumersException(entry.getMessage()));
- }
-
- }
-
- public void requeue(QueueEntry entry) throws AMQException
- {
- entry.requeue(_storeContext);
- }
-
- public void acknowledgeMessage(final long deliveryTag, long lastDeliveryTag,
- boolean multiple, final UnacknowledgedMessageMap unacknowledgedMessageMap)
- throws AMQException
- {
-
- final boolean debug = _log.isDebugEnabled();
- ;
- if (multiple)
- {
- if (deliveryTag == 0)
- {
-
- //Spec 2.1.6.11 ... If the multiple field is 1, and the delivery tag is zero,
- // tells the server to acknowledge all outstanding mesages.
- _log.info("Multiple ack on delivery tag 0. ACKing all messages. Current count:" +
- unacknowledgedMessageMap.size());
- unacknowledgedMessageMap.visit(new UnacknowledgedMessageMap.Visitor()
- {
- public boolean callback(final long deliveryTag, QueueEntry message) throws AMQException
- {
- if (debug)
- {
- _log.debug("Discarding message: " + message.getMessage().getMessageId());
- }
- if(message.getMessage().isPersistent())
- {
- beginTranIfNecessary();
- }
- //Message has been ack so discard it. This will dequeue and decrement the reference.
- message.discard(_storeContext);
-
- return false;
- }
-
- public void visitComplete()
- {
- unacknowledgedMessageMap.clear();
- }
- });
- }
- else
- {
- if (!unacknowledgedMessageMap.contains(deliveryTag))
- {
- throw new AMQException("Multiple ack on delivery tag " + deliveryTag + " not known for channel");
- }
-
- unacknowledgedMessageMap.drainTo(deliveryTag, _storeContext);
- }
- }
- else
- {
- QueueEntry msg;
- msg = unacknowledgedMessageMap.get(deliveryTag);
-
- if (msg == null)
- {
- _log.info("Single ack on delivery tag " + deliveryTag + " not known for channel:" +
- _channel.getChannelId());
- throw new AMQException("Single ack on delivery tag " + deliveryTag + " not known for channel:" +
- _channel.getChannelId());
- }
-
- if (debug)
- {
- _log.debug("Discarding message: " + msg.getMessage().getMessageId());
- }
- if(msg.getMessage().isPersistent())
- {
- beginTranIfNecessary();
- }
-
- //Message has been ack so discard it. This will dequeue and decrement the reference.
- msg.discard(_storeContext);
-
- unacknowledgedMessageMap.remove(deliveryTag);
-
-
- if (debug)
- {
- _log.debug("Received non-multiple ack for messaging with delivery tag " + deliveryTag + " msg id " +
- msg.getMessage().getMessageId());
- }
- }
- if(_inTran)
- {
- _messageStore.commitTran(_storeContext);
- _inTran = false;
- }
- }
-
- public void messageFullyReceived(boolean persistent) throws AMQException
- {
- if (persistent)
- {
- _messageStore.commitTran(_storeContext);
- _inTran = false;
- }
- }
-
- public void messageProcessed(AMQProtocolSession protocolSession) throws AMQException
- {
- _channel.processReturns();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/StoreMessageOperation.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/StoreMessageOperation.java
deleted file mode 100644
index 0e4d6c2030..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/StoreMessageOperation.java
+++ /dev/null
@@ -1,58 +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.
- *
- */
-package org.apache.qpid.server.txn;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.StoreContext;
-
-/**
- * A transactional operation to store messages in an underlying persistent store. When this operation
- * commits it will do everything to ensure that all messages are safely committed to persistent
- * storage.
- */
-public class StoreMessageOperation implements TxnOp
-{
- private final MessageStore _messsageStore;
-
- public StoreMessageOperation(MessageStore messageStore)
- {
- _messsageStore = messageStore;
- }
-
- public void prepare(StoreContext context) throws AMQException
- {
- }
-
- public void undoPrepare()
- {
- }
-
- public void commit(StoreContext context) throws AMQException
- {
- _messsageStore.commitTran(context);
- }
-
- public void rollback(StoreContext context) throws AMQException
- {
- _messsageStore.abortTran(context);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TransactionalContext.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TransactionalContext.java
deleted file mode 100644
index 647ba66fb4..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TransactionalContext.java
+++ /dev/null
@@ -1,179 +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.
- *
- */
-package org.apache.qpid.server.txn;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.ack.UnacknowledgedMessageMap;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.store.StoreContext;
-
-/**
- * TransactionalContext provides a context in which transactional operations on {@link AMQMessage}s are performed.
- * Different levels of transactional support for the delivery of messages may be provided by different implementations
- * of this interface.
- *
- * <p/>The fundamental transactional operations that can be performed on a message queue are 'enqueue' and 'dequeue'.
- * In this interface, these have been recast as the {@link #messageFullyReceived} and {@link #acknowledgeMessage}
- * operations. This interface essentially provides a way to make enqueueing and dequeuing transactional.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Explicitly accept a transaction start notification.
- * <tr><td> Commit all pending operations in a transaction.
- * <tr><td> Rollback all pending operations in a transaction.
- * <tr><td> Deliver a message to a queue as part of a transaction.
- * <tr><td> Redeliver a message to a queue as part of a transaction.
- * <tr><td> Mark a message as acknowledged as part of a transaction.
- * <tr><td> Accept notification that a message has been completely received as part of a transaction.
- * <tr><td> Accept notification that a message has been fully processed as part of a transaction.
- * <tr><td> Associate a message store context with this transaction context.
- * </table>
- *
- * @todo The 'fullyReceived' and 'messageProcessed' events sit uncomfortably in the responsibilities of a transactional
- * context. They are non-transactional operations, used to trigger other side-effects. Consider moving them
- * somewhere else, a seperate interface for example.
- *
- * @todo This transactional context could be written as a wrapper extension to a Queue implementation, that provides
- * transactional management of the enqueue and dequeue operations, with added commit/rollback methods. Any
- * queue implementation could be made transactional by wrapping it as a transactional queue. This would mean
- * that the enqueue/dequeue operations do not need to be recast as deliver/acknowledge operations, which may be
- * conceptually neater.
- *
- * For example:
- * <pre>
- * public interface Transactional
- * {
- * public void commit();
- * public void rollback();
- * }
- *
- * public interface TransactionalQueue<E> extends Transactional, SizeableQueue<E>
- * {}
- *
- * public class Queues
- * {
- * ...
- * // For transactional messaging, take a transactional view onto the queue.
- * public static <E> TransactionalQueue<E> getTransactionalQueue(SizeableQueue<E> queue) { ... }
- *
- * // For non-transactional messaging, take a non-transactional view onto the queue.
- * public static <E> TransactionalQueue<E> getNonTransactionalQueue(SizeableQueue<E> queue) { ... }
- * }
- * </pre>
- */
-public interface TransactionalContext
-{
- /**
- * Explicitly begins the transaction, if it has not already been started. {@link #commit} or {@link #rollback}
- * should automatically begin the next transaction in the chain.
- *
- * @throws AMQException If the transaction cannot be started for any reason.
- */
- void beginTranIfNecessary() throws AMQException;
-
- /**
- * Makes all pending operations on the transaction permanent and visible.
- *
- * @throws AMQException If the transaction cannot be committed for any reason.
- */
- void commit() throws AMQException;
-
- /**
- * Erases all pending operations on the transaction.
- *
- * @throws AMQException If the transaction cannot be committed for any reason.
- */
- void rollback() throws AMQException;
-
- /**
- * Delivers the specified message to the specified queue.
- *
- * <p/>This is an 'enqueue' operation.
- *
- * @param queue
- * @param message The message to deliver
- * @throws AMQException If the message cannot be delivered for any reason.
- */
- void deliver(final AMQQueue queue, AMQMessage message) throws AMQException;
-
- /**
- * Requeues the specified message entry (message queue pair)
- *
- *
- * @param queueEntry The message,queue pair
- *
- * @throws AMQException If the message cannot be delivered for any reason.
- */
- void requeue(QueueEntry queueEntry) throws AMQException;
-
-
- /**
- * Acknowledges a message or many messages as delivered. All messages up to a specified one, may be acknowledged by
- * setting the 'multiple' flag. It is also possible for the acknowledged message id to be zero, when the 'multiple'
- * flag is set, in which case an acknowledgement up to the latest delivered message should be done.
- *
- * <p/>This is a 'dequeue' operation.
- *
- * @param deliveryTag The id of the message to acknowledge, or zero, if using multiple acknowledgement
- * up to the latest message.
- * @param lastDeliveryTag The latest message delivered.
- * @param multiple <tt>true</tt> if all message ids up the acknowledged one or latest delivered, are
- * to be acknowledged, <tt>false</tt> otherwise.
- * @param unacknowledgedMessageMap The unacknowledged messages in the transaction, to remove the acknowledged message
- * from.
- *
- * @throws AMQException If the message cannot be acknowledged for any reason.
- */
- void acknowledgeMessage(long deliveryTag, long lastDeliveryTag, boolean multiple,
- UnacknowledgedMessageMap unacknowledgedMessageMap) throws AMQException;
-
- /**
- * Notifies the transactional context that a message has been fully received. The actual message that was received
- * is not specified. This event may be used to trigger a process related to the receipt of the message, for example,
- * flushing its data to disk.
- *
- * @param persistent <tt>true</tt> if the received message is persistent, <tt>false</tt> otherwise.
- *
- * @throws AMQException If the fully received event cannot be processed for any reason.
- */
- void messageFullyReceived(boolean persistent) throws AMQException;
-
- /**
- * Notifies the transactional context that a message has been delivered, succesfully or otherwise. The actual
- * message that was delivered is not specified. This event may be used to trigger a process related to the
- * outcome of the delivery of the message, for example, cleaning up failed deliveries.
- *
- * @param protocolSession The protocol session of the deliverable message.
- *
- * @throws AMQException If the message processed event cannot be handled for any reason.
- */
- void messageProcessed(AMQProtocolSession protocolSession) throws AMQException;
-
- /**
- * Gets the message store context associated with this transactional context.
- *
- * @return The message store context associated with this transactional context.
- */
- StoreContext getStoreContext();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TxnBuffer.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TxnBuffer.java
deleted file mode 100644
index 46a68b6a23..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TxnBuffer.java
+++ /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.
- *
- */
-package org.apache.qpid.server.txn;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.store.StoreContext;
-
-/** Holds a list of TxnOp instance representing transactional operations. */
-public class TxnBuffer
-{
- private final List<TxnOp> _ops = new ArrayList<TxnOp>();
- private static final Logger _log = Logger.getLogger(TxnBuffer.class);
-
- public TxnBuffer()
- {
- }
-
- public void commit(StoreContext context) throws AMQException
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Committing " + _ops.size() + " ops to commit.:" + _ops);
- }
-
- if (prepare(context))
- {
- for (TxnOp op : _ops)
- {
- op.commit(context);
- }
- }
- _ops.clear();
- }
-
- private boolean prepare(StoreContext context) throws AMQException
- {
- for (int i = 0; i < _ops.size(); i++)
- {
- TxnOp op = _ops.get(i);
- try
- {
- op.prepare(context);
- }
- catch (AMQException e)
- {
- undoPrepare(i);
- throw e;
- }
- catch (RuntimeException e)
- {
- undoPrepare(i);
- throw e;
- }
- }
- return true;
- }
-
- private void undoPrepare(int lastPrepared)
- {
- //compensate previously prepared ops
- for (int j = 0; j < lastPrepared; j++)
- {
- _ops.get(j).undoPrepare();
- }
- }
-
-
-
- public void rollback(StoreContext context) throws AMQException
- {
- for (TxnOp op : _ops)
- {
- op.rollback(context);
- }
- _ops.clear();
- }
-
- public void enlist(TxnOp op)
- {
- _ops.add(op);
- }
-
- public void cancel(TxnOp op)
- {
- _ops.remove(op);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TxnOp.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TxnOp.java
deleted file mode 100644
index 919c078cf0..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/txn/TxnOp.java
+++ /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.
- *
- */
-package org.apache.qpid.server.txn;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.store.StoreContext;
-
-/**
- * This provides the abstraction of an individual operation within a
- * transaction. It is used by the TxnBuffer class.
- */
-public interface TxnOp
-{
- /**
- * Do the part of the operation that updates persistent state
- */
- public void prepare(StoreContext context) throws AMQException;
- /**
- * Complete the operation started by prepare. Can now update in
- * memory state or make netork transfers.
- */
- public void commit(StoreContext context) throws AMQException;
- /**
- * This is not the same as rollback. Unfortunately the use of an
- * in memory reference count as a locking mechanism and a test for
- * whether a message should be deleted means that as things are,
- * handling an acknowledgement unavoidably alters both memory and
- * persistent state on prepare. This is needed to 'compensate' or
- * undo the in-memory change if the peristent update of later ops
- * fails.
- */
- public void undoPrepare();
- /**
- * Rolls back the operation.
- */
- public void rollback(StoreContext context) throws AMQException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/CircularBuffer.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/CircularBuffer.java
deleted file mode 100644
index e730e2f3c3..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/CircularBuffer.java
+++ /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.
- *
- */
-package org.apache.qpid.server.util;
-
-import java.util.Iterator;
-
-import org.apache.log4j.Logger;
-
-public class CircularBuffer implements Iterable
-{
-
- private static final Logger _logger = Logger.getLogger(CircularBuffer.class);
-
- private final Object[] _log;
- private int _size;
- private int _index;
-
- public CircularBuffer(int size)
- {
- _log = new Object[size];
- }
-
- public void add(Object o)
- {
- _log[_index++] = o;
- _size = Math.min(_size+1, _log.length);
- if(_index >= _log.length)
- {
- _index = 0;
- }
- }
-
- public Object get(int i)
- {
- if(i >= _log.length)
- {
- throw new ArrayIndexOutOfBoundsException(i);
- }
- return _log[index(i)];
- }
-
- public int size() {
- return _size;
- }
-
- public Iterator iterator()
- {
- return new Iterator()
- {
- private int i = 0;
-
- public boolean hasNext()
- {
- return i < _size;
- }
-
- public Object next()
- {
- return get(i++);
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- };
- }
-
- public String toString()
- {
- StringBuilder s = new StringBuilder();
- boolean first = true;
- for(Object o : this)
- {
- if(!first)
- {
- s.append(", ");
- }
- else
- {
- first = false;
- }
- s.append(o);
- }
- return s.toString();
- }
-
- public void dump()
- {
- for(Object o : this)
- {
- _logger.info(o);
- }
- }
-
- int index(int i)
- {
- return _size == _log.length ? (_index + i) % _log.length : i;
- }
-
- public static void main(String[] artgv)
- {
- String[] items = new String[]{
- "A","B","C","D","E","F","G","H","I","J","K"
- };
- CircularBuffer buffer = new CircularBuffer(5);
- for(String s : items)
- {
- buffer.add(s);
- _logger.info(buffer);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/ConcurrentLinkedQueueNoSize.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/ConcurrentLinkedQueueNoSize.java
deleted file mode 100644
index cf5e71a6e2..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/ConcurrentLinkedQueueNoSize.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.server.util;
-
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-public class ConcurrentLinkedQueueNoSize<E> extends ConcurrentLinkedQueue<E>
-{
- public int size()
- {
- if (isEmpty())
- {
- return 0;
- }
- else
- {
- return 1;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/LoggingProxy.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/LoggingProxy.java
deleted file mode 100644
index eda97e0ed2..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/LoggingProxy.java
+++ /dev/null
@@ -1,105 +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.
- *
- */
-package org.apache.qpid.server.util;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Arrays;
-
-/**
- * Dynamic proxy that records invocations in a fixed size circular buffer,
- * dumping details on hitting an exception.
- * <p>
- * Useful in debugging.
- * <p>
- */
-public class LoggingProxy implements InvocationHandler
-{
- private final Object _target;
- private final CircularBuffer _log;
-
- public LoggingProxy(Object target, int size)
- {
- _target = target;
- _log = new CircularBuffer(size);
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- try
- {
- entered(method, args);
- Object result = method.invoke(_target, args);
- returned(method, result);
- return result;
- }
- catch(InvocationTargetException e)
- {
- dump();
- throw e.getTargetException();
- }
- }
-
- void dump()
- {
- _log.dump();
- }
-
- CircularBuffer getBuffer()
- {
- return _log;
- }
-
- private synchronized void entered(Method method, Object[] args)
- {
- if (args == null)
- {
- _log.add(Thread.currentThread() + ": " + method.getName() + "() entered");
- }
- else
- {
- _log.add(Thread.currentThread() + ": " + method.getName() + "(" + Arrays.toString(args) + ") entered");
- }
- }
-
- private synchronized void returned(Method method, Object result)
- {
- if (method.getReturnType() == Void.TYPE)
- {
- _log.add(Thread.currentThread() + ": " + method.getName() + "() returned");
- }
- else
- {
- _log.add(Thread.currentThread() + ": " + method.getName() + "() returned " + result);
- }
- }
-
- public Object getProxy(Class... c)
- {
- return Proxy.newProxyInstance(_target.getClass().getClassLoader(), c, this);
- }
-
- public int getBufferSize() {
- return _log.size();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java
deleted file mode 100644
index ee5f9d5e88..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java
+++ /dev/null
@@ -1,84 +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.
- *
- */
-package org.apache.qpid.server.util;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Properties;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.MapConfiguration;
-import org.apache.qpid.server.management.ManagedObjectRegistry;
-import org.apache.qpid.server.management.NoopManagedObjectRegistry;
-import org.apache.qpid.server.plugins.PluginManager;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabaseManager;
-import org.apache.qpid.server.security.auth.database.PropertiesPrincipalDatabaseManager;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.plugins.AllowAll;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-public class NullApplicationRegistry extends ApplicationRegistry
-{
- public NullApplicationRegistry()
- {
- super(new MapConfiguration(new HashMap()));
- }
-
- public void initialise() throws Exception
- {
- _logger.info("Initialising NullApplicationRegistry");
-
- _configuration.addProperty("store.class", "org.apache.qpid.server.store.MemoryMessageStore");
-
- Properties users = new Properties();
-
- users.put("guest", "guest");
-
- _databaseManager = new PropertiesPrincipalDatabaseManager("default", users);
-
- _accessManager = new AllowAll();
-
- _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);
-
- _managedObjectRegistry = new NoopManagedObjectRegistry();
- _virtualHostRegistry = new VirtualHostRegistry();
- VirtualHost dummyHost = new VirtualHost("test", getConfiguration());
- _virtualHostRegistry.registerVirtualHost(dummyHost);
- _virtualHostRegistry.setDefaultVirtualHostName("test");
- _pluginManager = new PluginManager("");
- _configuration.addProperty("heartbeat.delay", 10 * 60); // 10 minutes
-
- }
-
- public Collection<String> getVirtualHostNames()
- {
- String[] hosts = {"test"};
- return Arrays.asList(hosts);
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java
deleted file mode 100644
index 85d804457e..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.server.virtualhost;
-
-import java.io.IOException;
-
-import org.apache.qpid.server.management.MBeanAttribute;
-
-/**
- * The management interface exposed to allow management of an Exchange.
- * @version 0.1
- */
-public interface ManagedVirtualHost
-{
- static final String TYPE = "VirtualHost";
-
- /**
- * Returns the name of the managed virtualHost.
- * @return the name of the exchange.
- * @throws java.io.IOException
- */
- @MBeanAttribute(name="Name", description= TYPE + " Name")
- String getName() throws IOException;
-
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
deleted file mode 100644
index 9229863c35..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
+++ /dev/null
@@ -1,339 +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.
- *
- */
-package org.apache.qpid.server.virtualhost;
-
-import javax.management.NotCompliantMBeanException;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.AMQBrokerManagerMBean;
-import org.apache.qpid.server.connection.ConnectionRegistry;
-import org.apache.qpid.server.connection.IConnectionRegistry;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.ACLManager;
-import org.apache.qpid.server.security.access.Accessable;
-import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.configuration.Configurator;
-import org.apache.qpid.server.exchange.DefaultExchangeFactory;
-import org.apache.qpid.server.exchange.DefaultExchangeRegistry;
-import org.apache.qpid.server.exchange.ExchangeFactory;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.management.AMQManagedObject;
-import org.apache.qpid.server.management.ManagedObject;
-import org.apache.qpid.server.queue.DefaultQueueRegistry;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.AMQException;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-public class VirtualHost implements Accessable
-{
- private static final Logger _logger = Logger.getLogger(VirtualHost.class);
-
-
- private final String _name;
-
- private ConnectionRegistry _connectionRegistry;
-
- private QueueRegistry _queueRegistry;
-
- private ExchangeRegistry _exchangeRegistry;
-
- private ExchangeFactory _exchangeFactory;
-
- private MessageStore _messageStore;
-
- protected VirtualHostMBean _virtualHostMBean;
-
- private AMQBrokerManagerMBean _brokerMBean;
-
- private AuthenticationManager _authenticationManager;
-
- private ACLPlugin _accessManager;
-
- private final Timer _houseKeepingTimer;
-
- private static final long DEFAULT_HOUSEKEEPING_PERIOD = 30000L;
-
-
- public void setAccessableName(String name)
- {
- _logger.warn("Setting Accessable Name for VirualHost is not allowed. ("
- + name + ") ignored remains :" + getAccessableName());
- }
-
- public String getAccessableName()
- {
- return _name;
- }
-
- public IConnectionRegistry getConnectionRegistry()
- {
- return _connectionRegistry;
- }
-
- /**
- * Abstract MBean class. This has some of the methods implemented from management intrerface for exchanges. Any
- * implementaion of an Exchange MBean should extend this class.
- */
- public class VirtualHostMBean extends AMQManagedObject implements ManagedVirtualHost
- {
- public VirtualHostMBean() throws NotCompliantMBeanException
- {
- super(ManagedVirtualHost.class, "VirtualHost");
- }
-
- public String getObjectInstanceName()
- {
- return _name.toString();
- }
-
- public String getName()
- {
- return _name.toString();
- }
-
- public VirtualHost getVirtualHost()
- {
- return VirtualHost.this;
- }
-
-
- } // End of MBean class
-
- /**
- * Used for testing only
- * @param name
- * @param store
- * @throws Exception
- */
- public VirtualHost(String name, MessageStore store) throws Exception
- {
- this(name, new PropertiesConfiguration(), store);
- }
-
- /**
- * Normal Constructor
- * @param name
- * @param hostConfig
- * @throws Exception
- */
- public VirtualHost(String name, Configuration hostConfig) throws Exception
- {
- this(name, hostConfig, null);
- }
-
- public VirtualHost(String name, Configuration hostConfig, MessageStore store) throws Exception
- {
- if (name == null || name.length() == 0)
- {
- throw new IllegalArgumentException("Illegal name (" + name + ") for virtualhost.");
- }
-
- _name = name;
-
- _virtualHostMBean = new VirtualHostMBean();
-
- _connectionRegistry = new ConnectionRegistry(this);
-
- _houseKeepingTimer = new Timer("Queue-housekeeping-"+name, true);
- _queueRegistry = new DefaultQueueRegistry(this);
- _exchangeFactory = new DefaultExchangeFactory(this);
- _exchangeFactory.initialise(hostConfig);
- _exchangeRegistry = new DefaultExchangeRegistry(this);
-
- if (store != null)
- {
- _messageStore = store;
- }
- else
- {
- if (hostConfig == null)
- {
- throw new IllegalAccessException("HostConfig and MessageStore cannot be null");
- }
- initialiseMessageStore(hostConfig);
- }
-
- _exchangeRegistry.initialise();
-
- _authenticationManager = new PrincipalDatabaseAuthenticationManager(name, hostConfig);
-
- _accessManager = ACLManager.loadACLManager(name, hostConfig);
-
- _brokerMBean = new AMQBrokerManagerMBean(_virtualHostMBean);
- _brokerMBean.register();
- initialiseHouseKeeping(hostConfig);
- }
-
- private void initialiseHouseKeeping(final Configuration hostConfig)
- {
-
- long period = hostConfig.getLong("housekeeping.expiredMessageCheckPeriod", DEFAULT_HOUSEKEEPING_PERIOD);
-
- /* add a timer task to iterate over queues, cleaning expired messages from queues with no consumers */
- if(period != 0L)
- {
- class RemoveExpiredMessagesTask extends TimerTask
- {
- public void run()
- {
- for(AMQQueue q : _queueRegistry.getQueues())
- {
-
- try
- {
- q.removeExpiredIfNoSubscribers();
- }
- catch (AMQException e)
- {
- _logger.error("Exception in housekeeping for queue: " + q.getName().toString(),e);
- throw new RuntimeException(e);
- }
- }
- }
- }
-
- _houseKeepingTimer.scheduleAtFixedRate(new RemoveExpiredMessagesTask(),
- period/2,
- period);
- }
- }
-
- private void initialiseMessageStore(Configuration config) throws Exception
- {
- String messageStoreClass = config.getString("store.class");
-
- Class clazz = Class.forName(messageStoreClass);
- Object o = clazz.newInstance();
-
- if (!(o instanceof MessageStore))
- {
- throw new ClassCastException("Message store class must implement " + MessageStore.class + ". Class " + clazz +
- " does not.");
- }
- _messageStore = (MessageStore) o;
- _messageStore.configure(this, "store", config);
- }
-
-
- public <T> T getConfiguredObject(Class<T> instanceType, Configuration config)
- {
- T instance;
- try
- {
- instance = instanceType.newInstance();
- }
- catch (Exception e)
- {
- _logger.error("Unable to instantiate configuration class " + instanceType + " - ensure it has a public default constructor");
- throw new IllegalArgumentException("Unable to instantiate configuration class " + instanceType + " - ensure it has a public default constructor", e);
- }
- Configurator.configure(instance);
-
- return instance;
- }
-
-
- public String getName()
- {
- return _name;
- }
-
- public QueueRegistry getQueueRegistry()
- {
- return _queueRegistry;
- }
-
- public ExchangeRegistry getExchangeRegistry()
- {
- return _exchangeRegistry;
- }
-
- public ExchangeFactory getExchangeFactory()
- {
- return _exchangeFactory;
- }
-
- public ApplicationRegistry getApplicationRegistry()
- {
- throw new UnsupportedOperationException();
- }
-
- public MessageStore getMessageStore()
- {
- return _messageStore;
- }
-
- public AuthenticationManager getAuthenticationManager()
- {
- return _authenticationManager;
- }
-
- public ACLPlugin getAccessManager()
- {
- return _accessManager;
- }
-
- public void close() throws Exception
- {
-
- //Stop Connections
- _connectionRegistry.close();
-
- //Stop the Queues processing
- if (_queueRegistry != null)
- {
- for (AMQQueue queue : _queueRegistry.getQueues())
- {
- queue.stop();
- }
- }
-
- //Stop Housekeeping
- if (_houseKeepingTimer != null)
- {
- _houseKeepingTimer.cancel();
- }
-
- //Close MessageStore
- if (_messageStore != null)
- {
- _messageStore.close();
- }
- }
-
- public ManagedObject getBrokerMBean()
- {
- return _brokerMBean;
- }
-
- public ManagedObject getManagedObject()
- {
- return _virtualHostMBean;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java
deleted file mode 100644
index 27917fac8a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java
+++ /dev/null
@@ -1,70 +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.
- *
- */
-package org.apache.qpid.server.virtualhost;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-
-public class VirtualHostRegistry
-{
- private final Map<String, VirtualHost> _registry = new ConcurrentHashMap<String,VirtualHost>();
-
-
- private String _defaultVirtualHostName;
-
- public synchronized void registerVirtualHost(VirtualHost host) throws Exception
- {
- if(_registry.containsKey(host.getName()))
- {
- throw new Exception("Virtual Host with name " + host.getName() + " already registered.");
- }
- _registry.put(host.getName(),host);
- }
-
- public VirtualHost getVirtualHost(String name)
- {
- if(name == null || name.trim().length() == 0 )
- {
- name = getDefaultVirtualHostName();
- }
-
- return _registry.get(name);
- }
-
- private String getDefaultVirtualHostName()
- {
- return _defaultVirtualHostName;
- }
-
- public void setDefaultVirtualHostName(String defaultVirtualHostName)
- {
- _defaultVirtualHostName = defaultVirtualHostName;
- }
-
-
- public Collection<VirtualHost> getVirtualHosts()
- {
- return new ArrayList<VirtualHost>(_registry.values());
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java
deleted file mode 100644
index faa7b85d58..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java
+++ /dev/null
@@ -1,652 +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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore;
-
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.OptionBuilder;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.qpid.configuration.Configuration;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
-import org.apache.qpid.server.store.MemoryMessageStore;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.tools.messagestore.commands.Clear;
-import org.apache.qpid.tools.messagestore.commands.Command;
-import org.apache.qpid.tools.messagestore.commands.Copy;
-import org.apache.qpid.tools.messagestore.commands.Dump;
-import org.apache.qpid.tools.messagestore.commands.Help;
-import org.apache.qpid.tools.messagestore.commands.List;
-import org.apache.qpid.tools.messagestore.commands.Load;
-import org.apache.qpid.tools.messagestore.commands.Quit;
-import org.apache.qpid.tools.messagestore.commands.Select;
-import org.apache.qpid.tools.messagestore.commands.Show;
-import org.apache.qpid.tools.messagestore.commands.Move;
-import org.apache.qpid.tools.messagestore.commands.Purge;
-import org.apache.qpid.tools.utils.CommandParser;
-import org.apache.qpid.tools.utils.Console;
-import org.apache.qpid.tools.utils.SimpleCommandParser;
-import org.apache.qpid.tools.utils.SimpleConsole;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-/**
- * MessageStoreTool.
- */
-public class MessageStoreTool
-{
- /** Text outputted at the start of each console.*/
- private static final String BOILER_PLATE = "MessageStoreTool - for examining Persistent Qpid Broker MessageStore instances";
-
- /** I/O Wrapper. */
- protected Console _console;
-
- /** Batch mode flag. */
- protected boolean _batchMode;
-
- /** Internal State object. */
- private State _state = new State();
-
- private HashMap<String, Command> _commands = new HashMap<String, Command>();
-
- /** SLF4J Logger. */
- private static Logger _devlog = LoggerFactory.getLogger(MessageStoreTool.class);
-
- /** Loaded configuration file. */
- private Configuration _config;
-
- /** Control used for main run loop. */
- private boolean _running = true;
- private boolean _initialised = false;
-
- //---------------------------------------------------------------------------------------------------/
-
- public static void main(String[] args) throws Configuration.InitException
- {
-
- MessageStoreTool tool = new MessageStoreTool(args);
-
- tool.start();
- }
-
-
- public MessageStoreTool(String[] args) throws Configuration.InitException
- {
- this(args, System.in, System.out);
- }
-
- public MessageStoreTool(String[] args, InputStream in, OutputStream out) throws Configuration.InitException
- {
- BufferedReader consoleReader = new BufferedReader(new InputStreamReader(in));
- BufferedWriter consoleWriter = new BufferedWriter(new OutputStreamWriter(out));
-
- Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownHook(this)));
- _batchMode = false;
-
- _console = new SimpleConsole(consoleWriter, consoleReader);
-
- _config = new Configuration();
-
- setOptions();
- _config.processCommandline(args);
- }
-
-
- private void setOptions()
- {
- Option help = new Option("h", "help", false, "print this message");
- Option version = new Option("v", "version", false, "print the version information and exit");
- Option configFile =
- OptionBuilder.withArgName("file").hasArg()
- .withDescription("use given configuration file By "
- + "default looks for a file named "
- + Configuration.DEFAULT_CONFIG_FILE + " in " + Configuration.QPID_HOME)
- .withLongOpt("config")
- .create("c");
-
- _config.setOption(help);
- _config.setOption(version);
- _config.setOption(configFile);
- }
-
- public State getState()
- {
- return _state;
- }
-
- public Map<String, Command> getCommands()
- {
- return _commands;
- }
-
- public void setConfigurationFile(String configfile) throws Configuration.InitException
- {
- _config.loadConfig(new File(configfile));
- setup();
- }
-
- public Console getConsole()
- {
- return _console;
- }
-
- public void setConsole(Console console)
- {
- _console = console;
- }
-
- /**
- * Simple ShutdownHook to cleanly shutdown the databases
- */
- class ShutdownHook implements Runnable
- {
- MessageStoreTool _tool;
-
- ShutdownHook(MessageStoreTool messageStoreTool)
- {
- _tool = messageStoreTool;
- }
-
- public void run()
- {
- _tool.quit();
- }
- }
-
- public void quit()
- {
- _running = false;
-
- if (_initialised)
- {
- ApplicationRegistry.remove(1);
- }
-
- _console.println("...exiting");
-
- _console.close();
- }
-
- public void setBatchMode(boolean batchmode)
- {
- _batchMode = batchmode;
- }
-
- /**
- * Main loop
- */
- protected void start()
- {
- setup();
-
- if (!_initialised)
- {
- System.exit(1);
- }
-
- _console.println("");
-
- _console.println(BOILER_PLATE);
-
- runCLI();
- }
-
- private void setup()
- {
- loadDefaultVirtualHosts();
-
- loadCommands();
-
- _state.clearAll();
- }
-
- private void loadCommands()
- {
- _commands.clear();
- //todo Dynamically load the classes that exis in com.redhat.etp.qpid.commands
- _commands.put("close", new Clear(this));
- _commands.put("copy", new Copy(this));
- _commands.put("dump", new Dump(this));
- _commands.put("help", new Help(this));
- _commands.put("list", new List(this));
- _commands.put("load", new Load(this));
- _commands.put("move", new Move(this));
- _commands.put("purge", new Purge(this));
- _commands.put("quit", new Quit(this));
- _commands.put("select", new Select(this));
- _commands.put("show", new Show(this));
- }
-
- private void loadDefaultVirtualHosts()
- {
- final File configFile = _config.getConfigFile();
-
- loadVirtualHosts(configFile);
- }
-
- private void loadVirtualHosts(File configFile)
- {
-
- if (!configFile.exists())
- {
- _devlog.error("Config file not found:" + configFile.getAbsolutePath());
- return;
- }
- else
- {
- _devlog.debug("using config file :" + configFile.getAbsolutePath());
- }
-
- try
- {
- ConfigurationFileApplicationRegistry registry = new ConfigurationFileApplicationRegistry(configFile);
-
- ApplicationRegistry.remove(1);
-
- ApplicationRegistry.initialise(registry);
-
- checkMessageStores();
- _initialised = true;
- }
- catch (ConfigurationException e)
- {
- _console.println("Unable to load configuration due to configuration error: " + e.getMessage());
- e.printStackTrace();
- }
- catch (Exception e)
- {
- _console.println("Unable to load configuration due to: " + e.getMessage());
- e.printStackTrace();
- }
-
-
- }
-
- private void checkMessageStores()
- {
- Collection<VirtualHost> vhosts = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHosts();
-
- boolean warning = false;
- for (VirtualHost vhost : vhosts)
- {
- if (vhost.getMessageStore() instanceof MemoryMessageStore)
- {
- _console.println("WARNING: Virtualhost '" + vhost.getName() + "' is using a MemoryMessageStore. "
- + "Changes will not persist.");
- warning = true;
- }
- }
-
- if (warning)
- {
- _console.println("");
- _console.println("Please ensure you are using the correct config file currently using '"
- + _config.getConfigFile().getAbsolutePath() + "'");
- _console.println("New config file can be specifed by 'load <config file>' or -c on the commandline.");
- _console.println("");
- }
- }
-
- private void runCLI()
- {
- while (_running)
- {
- if (!_batchMode)
- {
- printPrompt();
- }
-
- String[] args = _console.readCommand();
-
- while (args != null)
- {
- exec(args);
-
- if (_running)
- {
- if (!_batchMode)
- {
- printPrompt();
- }
-
- args = _console.readCommand();
- }
- }
- }
- }
-
- private void printPrompt()
- {
- _console.print(prompt());
- }
-
-
- /**
- * Execute a script (batch mode).
- *
- * @param script The file script
- */
- protected void runScripts(String script)
- {
- //Store Current State
- boolean oldBatch = _batchMode;
- CommandParser oldParser = _console.getCommandParser();
- setBatchMode(true);
-
- try
- {
- _devlog.debug("Running script '" + script + "'");
-
- _console.setCommandParser(new SimpleCommandParser(new BufferedReader(new FileReader(script))));
-
- start();
- }
- catch (java.io.FileNotFoundException e)
- {
- _devlog.error("Script not found: '" + script + "' due to:" + e.getMessage());
- }
-
- //Restore previous state
- _console.setCommandParser(oldParser);
- setBatchMode(oldBatch);
- }
-
- public String prompt()
- {
- String state = _state.toString();
- if (state != null && state.length() != 0)
- {
- return state + ":bdb$ ";
- }
- else
- {
- return "bdb$ ";
- }
- }
-
- /**
- * Execute the command.
- *
- * @param args [command, arg0, arg1...].
- */
- protected void exec(String[] args)
- {
- // Comment lines start with a #
- if (args.length == 0 || args[0].startsWith("#"))
- {
- return;
- }
-
- final String command = args[0];
-
- Command cmd = _commands.get(command);
-
- if (cmd == null)
- {
- _console.println("Command not understood: " + command);
- }
- else
- {
- cmd.execute(args);
- }
- }
-
-
- /**
- * Displays usage info.
- */
- protected static void help()
- {
- System.out.println(BOILER_PLATE);
- System.out.println("Usage: java " + MessageStoreTool.class + " [Options]");
- System.out.println(" [-c <broker config file>] : Defaults to \"$QPID_HOME/etc/config.xml\"");
- }
-
-
- /**
- * This class is used to store the current state of the tool.
- *
- * This is then interrogated by the various commands to augment their behaviour.
- *
- *
- */
- public class State
- {
- private VirtualHost _vhost = null;
- private AMQQueue _queue = null;
- private Exchange _exchange = null;
- private java.util.List<Long> _msgids = null;
-
- public State()
- {
- }
-
- public void setQueue(AMQQueue queue)
- {
- _queue = queue;
- }
-
- public AMQQueue getQueue()
- {
- return _queue;
- }
-
- public void setVhost(VirtualHost vhost)
- {
- _vhost = vhost;
- }
-
- public VirtualHost getVhost()
- {
- return _vhost;
- }
-
- public Exchange getExchange()
- {
- return _exchange;
- }
-
- public void setExchange(Exchange exchange)
- {
- _exchange = exchange;
- }
-
- public String toString()
- {
- StringBuilder status = new StringBuilder();
-
- if (_vhost != null)
- {
- status.append(_vhost.getName());
-
- if (_exchange != null)
- {
- status.append("[");
- status.append(_exchange.getName());
- status.append("]");
-
- if (_queue != null)
- {
- status.append("->'");
- status.append(_queue.getName());
- status.append("'");
-
- if (_msgids != null)
- {
- status.append(printMessages());
- }
- }
- }
- }
-
- return status.toString();
- }
-
-
- public String printMessages()
- {
- StringBuilder sb = new StringBuilder();
-
- Long previous = null;
-
- Long start = null;
- for (Long id : _msgids)
- {
- if (previous != null)
- {
- if (id == previous + 1)
- {
- if (start == null)
- {
- start = previous;
- }
- }
- else
- {
- if (start != null)
- {
- sb.append(",");
- sb.append(start);
- sb.append("-");
- sb.append(id);
- start = null;
- }
- else
- {
- sb.append(",");
- sb.append(previous);
- }
- }
- }
-
- previous = id;
- }
-
- if (start != null)
- {
- sb.append(",");
- sb.append(start);
- sb.append("-");
- sb.append(_msgids.get(_msgids.size() - 1));
- }
- else
- {
- sb.append(",");
- sb.append(previous);
- }
-
- // surround list in ()
- sb.replace(0, 1, "(");
- sb.append(")");
- return sb.toString();
- }
-
- public void clearAll()
- {
- _vhost = null;
- clearExchange();
- }
-
- public void clearExchange()
- {
- _exchange = null;
- clearQueue();
- }
-
- public void clearQueue()
- {
- _queue = null;
- clearMessages();
- }
-
- public void clearMessages()
- {
- _msgids = null;
- }
-
- /**
- * A common location to provide parsing of the message id string
- * utilised by a number of the commands.
- * The String is comma separated list of ids that can be individual ids
- * or a range (4-10)
- *
- * @param msgString string of msg ids to parse 1,2,4-10
- */
- public void setMessages(String msgString)
- {
- StringTokenizer tok = new StringTokenizer(msgString, ",");
-
- if (tok.hasMoreTokens())
- {
- _msgids = new LinkedList<Long>();
- }
-
- while (tok.hasMoreTokens())
- {
- String next = tok.nextToken();
- if (next.contains("-"))
- {
- Long start = Long.parseLong(next.substring(0, next.indexOf("-")));
- Long end = Long.parseLong(next.substring(next.indexOf("-") + 1));
-
- if (end >= start)
- {
- for (long l = start; l <= end; l++)
- {
- _msgids.add(l);
- }
- }
- }
- else
- {
- _msgids.add(Long.parseLong(next));
- }
- }
-
- }
-
- public void setMessages(java.util.List<Long> msgids)
- {
- _msgids = msgids;
- }
-
- public java.util.List<Long> getMessages()
- {
- return _msgids;
- }
- }//Class State
-
-}//Class MessageStoreTool
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/AbstractCommand.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/AbstractCommand.java
deleted file mode 100644
index 5444197cb4..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/AbstractCommand.java
+++ /dev/null
@@ -1,66 +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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-import org.apache.qpid.tools.utils.Console;
-
-public abstract class AbstractCommand implements Command
-{
- protected Console _console;
- protected MessageStoreTool _tool;
-
- public AbstractCommand(MessageStoreTool tool)
- {
- _console = tool.getConsole();
- _tool = tool;
- }
-
- public void setOutput(Console out)
- {
- _console = out;
- }
-
- protected void commandError(String message, String[] args)
- {
- _console.print(getCommand() + " : " + message);
-
- if (args != null)
- {
- for (int i = 1; i < args.length; i++)
- {
- _console.print(args[i]);
- }
- }
- _console.println("");
- _console.println(help());
- }
-
-
- public abstract String help();
-
- public abstract String usage();
-
- public abstract String getCommand();
-
-
- public abstract void execute(String... args);
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Clear.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Clear.java
deleted file mode 100644
index b0006b3fe6..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Clear.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-
-public class Clear extends AbstractCommand
-{
- public Clear(MessageStoreTool tool)
- {
- super(tool);
- }
-
- public String help()
- {
- return "Clears any selection.";
- }
-
- public String usage()
- {
- return "clear [ all | virtualhost | exchange | queue | msgs ]";
- }
-
- public String getCommand()
- {
- return "clear";
- }
-
- public void execute(String... args)
- {
- assert args.length > 0;
- assert args[0].equals(getCommand());
-
- if (args.length < 1)
- {
- doClose("all");
- }
- else
- {
- doClose(args[1]);
- }
- }
-
- private void doClose(String type)
- {
- if (type.equals("virtualhost")
- || type.equals("all"))
- {
- _tool.getState().clearAll();
- }
-
- if (type.equals("exchange"))
- {
- _tool.getState().clearExchange();
- }
-
- if (type.equals("queue"))
- {
- _tool.getState().clearQueue();
- }
-
- if (type.equals("msgs"))
- {
- _tool.getState().clearMessages();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Command.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Command.java
deleted file mode 100644
index bfa775a34a..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Command.java
+++ /dev/null
@@ -1,36 +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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.tools.utils.Console;
-
-public interface Command
-{
- public void setOutput(Console out);
-
- public String help();
-
- public abstract String usage();
-
- String getCommand();
-
- public void execute(String... args);
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Copy.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Copy.java
deleted file mode 100644
index 0869d9a497..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Copy.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-import org.apache.qpid.server.queue.AMQQueue;
-
-public class Copy extends Move
-{
- public Copy(MessageStoreTool tool)
- {
- super(tool);
- }
-
- public String help()
- {
- return "Copy messages between queues.";/*\n" +
- "The currently selected message set will be copied to the specifed queue.\n" +
- "Alternatively the values can be provided on the command line."; */
- }
-
- public String usage()
- {
- return "copy to=<queue> [from=<queue>] [msgids=<msgids eg, 1,2,4-10>]";
- }
-
- public String getCommand()
- {
- return "copy";
- }
-
- protected void doCommand(AMQQueue fromQueue, long start, long end, AMQQueue toQueue)
- {
- fromQueue.copyMessagesToAnotherQueue(start, end, toQueue.getName().toString(), _storeContext);
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Dump.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Dump.java
deleted file mode 100644
index 731f6140f9..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Dump.java
+++ /dev/null
@@ -1,302 +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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.commons.codec.binary.Hex;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.QueueEntryImpl;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-import org.apache.qpid.tools.utils.Console;
-
-import java.io.UnsupportedEncodingException;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-public class Dump extends Show
-{
- private static final int LINE_SIZE = 8;
- private static final String DEFAULT_ENCODING = "utf-8";
- private static final boolean SPACE_BYTES = true;
- private static final String BYTE_SPACER = " ";
- private static final String NON_PRINTING_ASCII_CHAR = "?";
-
- protected boolean _content = true;
-
- public Dump(MessageStoreTool tool)
- {
- super(tool);
- }
-
- public String help()
- {
- return "Dump selected message content. Default: show=content";
- }
-
- public String usage()
- {
- return getCommand() + " [show=[all],[msgheaders],[_amqHeaders],[routing],[content]] [id=<msgid e.g. 1,2,4-10>]";
- }
-
- public String getCommand()
- {
- return "dump";
- }
-
- public void execute(String... args)
- {
- assert args.length > 0;
- assert args[0].equals(getCommand());
-
-
- if (args.length >= 2)
- {
- for (String arg : args)
- {
- if (arg.startsWith("show="))
- {
- _content = arg.contains("content") || arg.contains("all");
- }
- }
-
- parseArgs(args);
- }
-
- performShow();
- }
-
-
- protected List<List> createMessageData(java.util.List<Long> msgids, List<QueueEntry> messages, boolean showHeaders, boolean showRouting,
- boolean showMessageHeaders)
- {
-
- List<List> display = new LinkedList<List>();
-
- List<String> hex = new LinkedList<String>();
- List<String> ascii = new LinkedList<String>();
- display.add(hex);
- display.add(ascii);
-
- for (QueueEntry entry : messages)
- {
- AMQMessage msg = entry.getMessage();
- if (!includeMsg(msg, msgids))
- {
- continue;
- }
-
- //Add divider between messages
- hex.add(Console.ROW_DIVIDER);
- ascii.add(Console.ROW_DIVIDER);
-
- // Show general message information
- hex.add(Show.Columns.ID.name());
- ascii.add(msg.getMessageId().toString());
-
- hex.add(Console.ROW_DIVIDER);
- ascii.add(Console.ROW_DIVIDER);
-
- if (showRouting)
- {
- addShowInformation(hex, ascii, msg, "Routing Details", true, false, false);
- }
- if (showHeaders)
- {
- addShowInformation(hex, ascii, msg, "Headers", false, true, false);
- }
- if (showMessageHeaders)
- {
- addShowInformation(hex, ascii, msg, null, false, false, true);
- }
-
- // Add Content Body seciont
- hex.add("Content Body");
- ascii.add("");
- hex.add(Console.ROW_DIVIDER);
- ascii.add(Console.ROW_DIVIDER);
-
- Iterator bodies = msg.getContentBodyIterator();
- if (bodies.hasNext())
- {
-
- hex.add("Hex");
- hex.add(Console.ROW_DIVIDER);
-
-
- ascii.add("ASCII");
- ascii.add(Console.ROW_DIVIDER);
-
- while (bodies.hasNext())
- {
- ContentChunk chunk = (ContentChunk) bodies.next();
-
- //Duplicate so we don't destroy original data :)
- ByteBuffer hexBuffer = chunk.getData().duplicate();
-
- ByteBuffer charBuffer = hexBuffer.duplicate();
-
- Hex hexencoder = new Hex();
-
- while (hexBuffer.hasRemaining())
- {
- byte[] line = new byte[LINE_SIZE];
-
- int bufsize = hexBuffer.remaining();
- if (bufsize < LINE_SIZE)
- {
- hexBuffer.get(line, 0, bufsize);
- }
- else
- {
- bufsize = line.length;
- hexBuffer.get(line);
- }
-
- byte[] encoded = hexencoder.encode(line);
-
- try
- {
- String encStr = new String(encoded, 0, bufsize * 2, DEFAULT_ENCODING);
- String hexLine = "";
-
- int strKength = encStr.length();
- for (int c = 0; c < strKength; c++)
- {
- hexLine += encStr.charAt(c);
-
- if (c % 2 == 1 && SPACE_BYTES)
- {
- hexLine += BYTE_SPACER;
- }
- }
-
- hex.add(hexLine);
- }
- catch (UnsupportedEncodingException e)
- {
- _console.println(e.getMessage());
- return null;
- }
- }
-
- while (charBuffer.hasRemaining())
- {
- String asciiLine = "";
-
- for (int pos = 0; pos < LINE_SIZE; pos++)
- {
- if (charBuffer.hasRemaining())
- {
- byte ch = charBuffer.get();
-
- if (isPrintable(ch))
- {
- asciiLine += (char) ch;
- }
- else
- {
- asciiLine += NON_PRINTING_ASCII_CHAR;
- }
-
- if (SPACE_BYTES)
- {
- asciiLine += BYTE_SPACER;
- }
- }
- else
- {
- break;
- }
- }
-
- ascii.add(asciiLine);
- }
- }
- }
- else
- {
- List<String> result = new LinkedList<String>();
-
- display.add(result);
- result.add("No ContentBodies");
- }
- }
-
- // if hex is empty then we have no data to display
- if (hex.size() == 0)
- {
- return null;
- }
-
- return display;
- }
-
- private void addShowInformation(List<String> column1, List<String> column2, AMQMessage msg,
- String title, boolean routing, boolean headers, boolean messageHeaders)
- {
- List<QueueEntry> single = new LinkedList<QueueEntry>();
- single.add(new QueueEntryImpl(null,msg, Long.MIN_VALUE));
-
- List<List> routingData = super.createMessageData(null, single, headers, routing, messageHeaders);
-
- //Reformat data
- if (title != null)
- {
- column1.add(title);
- column2.add("");
- column1.add(Console.ROW_DIVIDER);
- column2.add(Console.ROW_DIVIDER);
- }
-
- // look at all columns in the routing Data
- for (List item : routingData)
- {
- // the item should be:
- // Title
- // *divider
- // value
- // otherwise we can't reason about the correct value
- if (item.size() == 3)
- {
- //Filter out the columns we are not interested in.
-
- String columnName = item.get(0).toString();
-
- if (!(columnName.equals(Show.Columns.ID.name())
- || columnName.equals(Show.Columns.Size.name())))
- {
- column1.add(columnName);
- column2.add(item.get(2).toString());
- }
- }
- }
- column1.add(Console.ROW_DIVIDER);
- column2.add(Console.ROW_DIVIDER);
- }
-
- private boolean isPrintable(byte c)
- {
- return c > 31 && c < 127;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Help.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Help.java
deleted file mode 100644
index 0f9546541b..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Help.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-import org.apache.qpid.tools.utils.Console;
-
-import java.util.LinkedList;
-import java.util.Map;
-
-public class Help extends AbstractCommand
-{
- public Help(MessageStoreTool tool)
- {
- super(tool);
- }
-
- public String help()
- {
- return "Provides detailed help on commands.";
- }
-
- public String getCommand()
- {
- return "help";
- }
-
- public String usage()
- {
- return "help [<command>]";
- }
-
- public void execute(String... args)
- {
- assert args.length > 0;
- assert args[0].equals(getCommand());
-
- if (args.length > 1)
- {
- Command command = _tool.getCommands().get(args[1]);
- if (command != null)
- {
- _console.println(command.help());
- _console.println("Usage:" + command.usage());
- }
- else
- {
- commandError("Command not found: ", args);
- }
- }
- else
- {
- java.util.List<java.util.List> data = new LinkedList<java.util.List>();
-
- java.util.List<String> commandName = new LinkedList<String>();
- java.util.List<String> commandDescription = new LinkedList<String>();
-
- data.add(commandName);
- data.add(commandDescription);
-
- //Set up Headers
- commandName.add("Command");
- commandDescription.add("Description");
-
- commandName.add(Console.ROW_DIVIDER);
- commandDescription.add(Console.ROW_DIVIDER);
-
- //Add current Commands with descriptions
- Map<String, Command> commands = _tool.getCommands();
-
- for (Command command : commands.values())
- {
- commandName.add(command.getCommand());
- commandDescription.add(command.help());
- }
-
- _console.printMap("Available Commands", data);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/List.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/List.java
deleted file mode 100644
index df8b59ec19..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/List.java
+++ /dev/null
@@ -1,314 +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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-import org.apache.qpid.tools.utils.Console;
-
-import java.util.Collection;
-import java.util.LinkedList;
-
-public class List extends AbstractCommand
-{
-
- public List(MessageStoreTool tool)
- {
- super(tool);
- }
-
- public void setOutput(Console out)
- {
- _console = out;
- }
-
- public String help()
- {
- return "list available items.";
- }
-
- public String usage()
- {
- return "list queues [<exchange>] | exchanges | bindings [<exchange>] | all";
- }
-
- public String getCommand()
- {
- return "list";
- }
-
- public void execute(String... args)
- {
- assert args.length > 0;
- assert args[0].equals(getCommand());
-
- if (args.length > 1)
- {
- if ((args[1].equals("exchanges"))
- || (args[1].equals("queues"))
- || (args[1].equals("bindings"))
- || (args[1].equals("all")))
- {
- if (args.length == 2)
- {
- doList(args[1]);
- }
- else if (args.length == 3)
- {
- doList(args[1], args[2]);
- }
- }
- else
- {
- commandError("Unknown options. ", args);
- }
- }
- else if (args.length < 2)
- {
- doList("all");
- }
- else
- {
- doList(args[1]);
- }
- }
-
- private void doList(String... listItem)
- {
- if (_tool.getState().getVhost() == null)
- {
- _console.println("No Virtualhost open. Open a Virtualhost first.");
- listVirtualHosts();
- return;
- }
-
- VirtualHost vhost = _tool.getState().getVhost();
-
- java.util.List<String> data = null;
-
- if (listItem[0].equals("queues"))
- {
- if (listItem.length > 1)
- {
- data = listQueues(vhost, new AMQShortString(listItem[1]));
- }
- else
- {
- Exchange exchange = _tool.getState().getExchange();
- data = listQueues(vhost, exchange);
- }
- }
-
- if (listItem[0].equals("exchanges"))
- {
- data = listExchanges(vhost);
- }
-
- if (listItem[0].equals("bindings"))
- {
-
- if (listItem.length > 1)
- {
- data = listBindings(vhost, new AMQShortString(listItem[1]));
- }
- else
- {
- Exchange exchange = _tool.getState().getExchange();
-
- data = listBindings(vhost, exchange);
- }
- }
-
- if (data != null)
- {
- if (data.size() == 1)
- {
- _console.println("No '" + listItem[0] + "' to display,");
- }
- else
- {
- _console.displayList(true, data.toArray(new String[0]));
- }
- }
-
-
- if (listItem[0].equals("all"))
- {
-
- boolean displayed = false;
- Exchange exchange = _tool.getState().getExchange();
-
- //Do the display here for each one so that they are pretty printed
- data = listQueues(vhost, exchange);
- if (data != null)
- {
- displayed = true;
- _console.displayList(true, data.toArray(new String[0]));
- }
-
- if (exchange == null)
- {
- data = listExchanges(vhost);
- if (data != null)
- {
- displayed = true;
- _console.displayList(true, data.toArray(new String[0]));
- }
- }
-
- data = listBindings(vhost, exchange);
- if (data != null)
- {
- displayed = true;
- _console.displayList(true, data.toArray(new String[0]));
- }
-
- if (!displayed)
- {
- _console.println("Nothing to list");
- }
- }
- }
-
- private void listVirtualHosts()
- {
- Collection<VirtualHost> vhosts = ApplicationRegistry.getInstance()
- .getVirtualHostRegistry().getVirtualHosts();
-
- String[] data = new String[vhosts.size() + 1];
-
- data[0] = "Available VirtualHosts";
-
- int index = 1;
- for (VirtualHost vhost : vhosts)
- {
- data[index] = vhost.getName();
- index++;
- }
-
- _console.displayList(true, data);
- }
-
- private java.util.List<String> listBindings(VirtualHost vhost, AMQShortString exchangeName)
- {
- return listBindings(vhost, vhost.getExchangeRegistry().getExchange(exchangeName));
- }
-
- private java.util.List<String> listBindings(VirtualHost vhost, Exchange exchange)
- {
- Collection<AMQShortString> queues = vhost.getQueueRegistry().getQueueNames();
-
- if (queues == null || queues.size() == 0)
- {
- return null;
- }
-
- java.util.List<String> data = new LinkedList<String>();
-
- data.add("Current Bindings");
-
- for (AMQShortString queue : queues)
- {
- if (exchange != null)
- {
- if (exchange.isBound(queue))
- {
- data.add(queue.toString());
- }
- }
- else
- {
- data.add(queue.toString());
- }
- }
-
- return data;
- }
-
- private java.util.List<String> listExchanges(VirtualHost vhost)
- {
- Collection<AMQShortString> queues = vhost.getExchangeRegistry().getExchangeNames();
-
- if (queues == null || queues.size() == 0)
- {
- return null;
- }
-
- java.util.List<String> data = new LinkedList<String>();
-
- data.add("Available Exchanges");
-
- for (AMQShortString queue : queues)
- {
- data.add(queue.toString());
- }
-
- return data;
- }
-
- private java.util.List<String> listQueues(VirtualHost vhost, AMQShortString exchangeName)
- {
- return listQueues(vhost, vhost.getExchangeRegistry().getExchange(exchangeName));
- }
-
- private java.util.List<String> listQueues(VirtualHost vhost, Exchange exchange)
- {
- Collection<AMQQueue> queues = vhost.getQueueRegistry().getQueues();
-
- if (queues == null || queues.size() == 0)
- {
- return null;
- }
-
- java.util.List<String> data = new LinkedList<String>();
-
- data.add("Available Queues");
-
- for (AMQQueue queue : queues)
- {
- if (exchange != null)
- {
- if (exchange.isBound(queue))
- {
- data.add(queue.getName().toString());
- }
- }
- else
- {
- data.add(queue.getName().toString());
- }
- }
-
- if (exchange != null)
- {
- if (queues.size() == 1)
- {
- return null;
- }
- }
-
- return data;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Load.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Load.java
deleted file mode 100644
index 244a311c30..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Load.java
+++ /dev/null
@@ -1,94 +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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.configuration.Configuration;
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-
-public class Load extends AbstractCommand
-{
- public Load(MessageStoreTool tool)
- {
- super(tool);
- }
-
- public String help()
- {
- return "Loads specified broker configuration file.";
- }
-
- public String usage()
- {
- return "load <configuration file>";
- }
-
- public String getCommand()
- {
- return "load";
- }
-
- public void execute(String... args)
- {
- assert args.length > 0;
- assert args[0].equals(getCommand());
-
- if (args.length > 2)
- {
- _console.print("load " + args[1] + ": additional options not understood:");
- for (int i = 2; i < args.length; i++)
- {
- _console.print(args[i] + " ");
- }
- _console.println("");
- }
- else if (args.length < 2)
- {
- _console.println("Enter Configuration file.");
- String input = _console.readln();
- if (input != null)
- {
- doLoad(input);
- }
- else
- {
- _console.println("Did not recognise config file.");
- }
- }
- else
- {
- doLoad(args[1]);
- }
- }
-
- private void doLoad(String configfile)
- {
- _console.println("Loading Configuration:" + configfile);
-
- try
- {
- _tool.setConfigurationFile(configfile);
- }
- catch (Configuration.InitException e)
- {
- _console.println("Unable to open config file due to: '" + e.getMessage() + "'");
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Move.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Move.java
deleted file mode 100644
index a8dd58ca83..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Move.java
+++ /dev/null
@@ -1,206 +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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.queue.QueueEntryImpl;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-
-import java.util.LinkedList;
-import java.util.List;
-
-public class Move extends AbstractCommand
-{
-
- /**
- * Since the Coopy command is not associated with a real channel we can safely create our own store context
- * for use in the few methods that require one.
- */
- protected StoreContext _storeContext = new StoreContext();
-
- public Move(MessageStoreTool tool)
- {
- super(tool);
- }
-
- public String help()
- {
- return "Move messages between queues.";/*\n" +
- "The currently selected message set will be moved to the specifed queue.\n" +
- "Alternatively the values can be provided on the command line.";*/
- }
-
- public String usage()
- {
- return "move to=<queue> [from=<queue>] [msgids=<msgids eg, 1,2,4-10>]";
- }
-
- public String getCommand()
- {
- return "move";
- }
-
- public void execute(String... args)
- {
- AMQQueue toQueue = null;
- AMQQueue fromQueue = _tool.getState().getQueue();
- java.util.List<Long> msgids = _tool.getState().getMessages();
-
- if (args.length >= 2)
- {
- for (String arg : args)
- {
- if (arg.startsWith("to="))
- {
- String queueName = arg.substring(arg.indexOf("=") + 1);
- toQueue = _tool.getState().getVhost().getQueueRegistry().getQueue(new AMQShortString(queueName));
- }
-
- if (arg.startsWith("from="))
- {
- String queueName = arg.substring(arg.indexOf("=") + 1);
- fromQueue = _tool.getState().getVhost().getQueueRegistry().getQueue(new AMQShortString(queueName));
- }
-
- if (arg.startsWith("msgids="))
- {
- String msgidStr = arg.substring(arg.indexOf("=") + 1);
-
- // Record the current message selection
- java.util.List<Long> currentIDs = _tool.getState().getMessages();
-
- // Use the ToolState class to perform the messasge parsing
- _tool.getState().setMessages(msgidStr);
- msgids = _tool.getState().getMessages();
-
- // Reset the original selection of messages
- _tool.getState().setMessages(currentIDs);
- }
- }
- }
-
- if (!checkRequirements(fromQueue, toQueue, msgids))
- {
- return;
- }
-
- processIDs(fromQueue, toQueue, msgids);
- }
-
- private void processIDs(AMQQueue fromQueue, AMQQueue toQueue, java.util.List<Long> msgids)
- {
- Long previous = null;
- Long start = null;
-
- if (msgids == null)
- {
- msgids = allMessageIDs(fromQueue);
- }
-
- if (msgids == null || msgids.size() == 0)
- {
- _console.println("No Messages to move.");
- return;
- }
-
- for (long id : msgids)
- {
- if (previous != null)
- {
- if (id == previous + 1)
- {
- if (start == null)
- {
- start = previous;
- }
- }
- else
- {
- if (start != null)
- {
- //move a range of ids
- doCommand(fromQueue, start, id, toQueue);
- start = null;
- }
- else
- {
- //move a single id
- doCommand(fromQueue, id, id, toQueue);
- }
- }
- }
-
- previous = id;
- }
-
- if (start != null)
- {
- //move a range of ids
- doCommand(fromQueue, start, previous, toQueue);
- }
- }
-
- private List<Long> allMessageIDs(AMQQueue fromQueue)
- {
- List<Long> ids = new LinkedList<Long>();
-
- if (fromQueue != null)
- {
- List<QueueEntry> messages = fromQueue.getMessagesOnTheQueue();
- if (messages != null)
- {
- for (QueueEntry msg : messages)
- {
- ids.add(msg.getMessage().getMessageId());
- }
- }
- }
-
- return ids;
- }
-
- protected boolean checkRequirements(AMQQueue fromQueue, AMQQueue toQueue, List<Long> msgids)
- {
- if (toQueue == null)
- {
- _console.println("Destination queue not specifed.");
- _console.println(usage());
- return false;
- }
-
- if (fromQueue == null)
- {
- _console.println("Source queue not specifed.");
- _console.println(usage());
- return false;
- }
-
- return true;
- }
-
- protected void doCommand(AMQQueue fromQueue, long start, long id, AMQQueue toQueue)
- {
- fromQueue.moveMessagesToAnotherQueue(start, id, toQueue.getName().toString(), _storeContext);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Purge.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Purge.java
deleted file mode 100644
index 5e99997863..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Purge.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-import org.apache.qpid.server.queue.AMQQueue;
-
-public class Purge extends Move
-{
- public Purge(MessageStoreTool tool)
- {
- super(tool);
- }
-
- public String help()
- {
- return "Purge messages from a queue.\n" +
- "The currently selected message set will be purged from the specifed queue.\n" +
- "Alternatively the values can be provided on the command line.";
- }
-
- public String usage()
- {
- return "purge from=<queue> [msgids=<msgids eg, 1,2,4-10>]";
- }
-
- public String getCommand()
- {
- return "purge";
- }
-
-
- protected boolean checkRequirements(AMQQueue fromQueue, AMQQueue toQueue, java.util.List<Long> msgids)
- {
- if (fromQueue == null)
- {
- _console.println("Source queue not specifed.");
- _console.println(usage());
- return false;
- }
-
- return true;
- }
-
- protected void doCommand(AMQQueue fromQueue, long start, long end, AMQQueue toQueue)
- {
- fromQueue.removeMessagesFromQueue(start, end, _storeContext);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Quit.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Quit.java
deleted file mode 100644
index a81bc07c38..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Quit.java
+++ /dev/null
@@ -1,54 +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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-
-public class Quit extends AbstractCommand
-{
- public Quit(MessageStoreTool tool)
- {
- super(tool);
- }
-
- public String help()
- {
- return "Quit the tool.";
- }
-
- public String usage()
- {
- return "quit";
- }
-
- public String getCommand()
- {
- return "quit";
- }
-
- public void execute(String... args)
- {
- assert args.length > 0;
- assert args[0].equals("quit");
-
- _tool.quit();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Select.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Select.java
deleted file mode 100644
index ff59568374..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Select.java
+++ /dev/null
@@ -1,233 +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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-
-import java.util.LinkedList;
-import java.util.StringTokenizer;
-
-public class Select extends AbstractCommand
-{
-
- public Select(MessageStoreTool tool)
- {
- super(tool);
- }
-
- public String help()
- {
- return "Perform a selection.";
- }
-
- public String usage()
- {
- return "select virtualhost <name> |exchange <name> |queue <name> | msg id=<msgids eg. 1,2,4-10>";
- }
-
- public String getCommand()
- {
- return "select";
- }
-
- public void execute(String... args)
- {
- assert args.length > 2;
- assert args[0].equals("select");
-
- if (args.length < 3)
- {
- if (args[1].equals("show"))
- {
- doSelect(args[1], null);
- }
- else
- {
- _console.print("select : unknown command:");
- _console.println(help());
- }
- }
- else
- {
- if (args[1].equals("virtualhost")
- || args[1].equals("vhost")
- || args[1].equals("exchange")
- || args[1].equals("queue")
- || args[1].equals("msg")
- )
- {
- doSelect(args[1], args[2]);
- }
- else
- {
- _console.println(help());
- }
- }
- }
-
- private void doSelect(String type, String item)
- {
- if (type.equals("virtualhost"))
- {
-
- VirtualHost vhost = ApplicationRegistry.getInstance()
- .getVirtualHostRegistry().getVirtualHost(item);
-
- if (vhost == null)
- {
- _console.println("Virtualhost '" + item + "' not found.");
- }
- else
- {
- _tool.getState().setVhost(vhost);
- }
- }
-
- if (type.equals("exchange"))
- {
-
- VirtualHost vhost = _tool.getState().getVhost();
-
- if (vhost == null)
- {
- _console.println("No Virtualhost open. Open a Virtualhost first.");
- return;
- }
-
-
- Exchange exchange = vhost.getExchangeRegistry().getExchange(new AMQShortString(item));
-
- if (exchange == null)
- {
- _console.println("Exchange '" + item + "' not found.");
- }
- else
- {
- _tool.getState().setExchange(exchange);
- }
-
- if (_tool.getState().getQueue() != null)
- {
- if (!exchange.isBound(_tool.getState().getQueue()))
- {
- _tool.getState().setQueue(null);
- }
- }
- }
-
- if (type.equals("queue"))
- {
- VirtualHost vhost = _tool.getState().getVhost();
-
- if (vhost == null)
- {
- _console.println("No Virtualhost open. Open a Virtualhost first.");
- return;
- }
-
- AMQQueue queue = vhost.getQueueRegistry().getQueue(new AMQShortString(item));
-
- if (queue == null)
- {
- _console.println("Queue '" + item + "' not found.");
- }
- else
- {
- _tool.getState().setQueue(queue);
-
- if (_tool.getState().getExchange() == null)
- {
- for (AMQShortString exchangeName : vhost.getExchangeRegistry().getExchangeNames())
- {
- Exchange exchange = vhost.getExchangeRegistry().getExchange(exchangeName);
- if (exchange.isBound(queue))
- {
- _tool.getState().setExchange(exchange);
- break;
- }
- }
- }
-
- //remove the message selection
- _tool.getState().setMessages((java.util.List<Long>) null);
- }
- }
-
- if (type.equals("msg"))
- {
- if (item.startsWith("id="))
- {
- StringTokenizer tok = new StringTokenizer(item.substring(item.indexOf("=") + 1), ",");
-
- java.util.List<Long> msgids = null;
-
- if (tok.hasMoreTokens())
- {
- msgids = new LinkedList<Long>();
- }
-
- while (tok.hasMoreTokens())
- {
- String next = tok.nextToken();
- if (next.contains("-"))
- {
- Long start = Long.parseLong(next.substring(0, next.indexOf("-")));
- Long end = Long.parseLong(next.substring(next.indexOf("-") + 1));
-
- if (end >= start)
- {
- for (long l = start; l <= end; l++)
- {
- msgids.add(l);
- }
- }
- }
- else
- {
- msgids.add(Long.parseLong(next));
- }
- }
-
- _tool.getState().setMessages(msgids);
- }
-
- }
-
- if (type.equals("show"))
- {
- _console.println(_tool.getState().toString());
- if (_tool.getState().getMessages() != null)
- {
- _console.print("Msgs:");
- for (Long l : _tool.getState().getMessages())
- {
- _console.print(" " + l);
- }
- _console.println("");
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Show.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Show.java
deleted file mode 100644
index 2fa017fc64..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Show.java
+++ /dev/null
@@ -1,515 +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.
- *
- *
- */
-package org.apache.qpid.tools.messagestore.commands;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.QueueEntryImpl;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-import org.apache.qpid.tools.utils.Console;
-
-import java.util.LinkedList;
-import java.util.List;
-
-public class Show extends AbstractCommand
-{
- protected boolean _amqHeaders = false;
- protected boolean _routing = false;
- protected boolean _msgHeaders = false;
-
- public Show(MessageStoreTool tool)
- {
- super(tool);
- }
-
- public String help()
- {
- return "Shows the messages headers.";
- }
-
- public String usage()
- {
- return getCommand() + " [show=[all],[msgheaders],[amqheaders],[routing]] [id=<msgid e.g. 1,2,4-10>]";
- }
-
- public String getCommand()
- {
- return "show";
- }
-
- public void execute(String... args)
- {
- assert args.length > 0;
- assert args[0].equals(getCommand());
-
- if (args.length < 2)
- {
- parseArgs("all");
- }
- else
- {
- parseArgs(args);
- }
-
- performShow();
- }
-
- protected void parseArgs(String... args)
- {
- List<Long> msgids = null;
-
- if (args.length >= 2)
- {
- for (String arg : args)
- {
- if (arg.startsWith("show="))
- {
- _msgHeaders = arg.contains("msgheaders") || arg.contains("all");
- _amqHeaders = arg.contains("amqheaders") || arg.contains("all");
- _routing = arg.contains("routing") || arg.contains("all");
- }
-
- if (arg.startsWith("id="))
- {
- _tool.getState().setMessages(msgids);
- }
- }//for args
- }// if args > 2
- }
-
- protected void performShow()
- {
- if (_tool.getState().getVhost() == null)
- {
- _console.println("No Virtualhost selected. 'DuSelect' a Virtualhost first.");
- return;
- }
-
- AMQQueue _queue = _tool.getState().getQueue();
-
- List<Long> msgids = _tool.getState().getMessages();
-
- if (_queue != null)
- {
- List<QueueEntry> messages = _queue.getMessagesOnTheQueue();
- if (messages == null || messages.size() == 0)
- {
- _console.println("No messages on queue");
- return;
- }
-
- List<List> data = createMessageData(msgids, messages, _amqHeaders, _routing, _msgHeaders);
- if (data != null)
- {
- _console.printMap(null, data);
- }
- else
- {
- String message = "No data to display.";
- if (msgids != null)
- {
- message += " Is message selection correct? " + _tool.getState().printMessages();
- }
- _console.println(message);
- }
-
- }
- else
- {
- _console.println("No Queue specified to show.");
- }
- }
-
- /**
- * Create the list data for display from the messages.
- *
- * @param msgids The list of message ids to display
- * @param messages A list of messages to format and display.
- * @param showHeaders should the header info be shown
- * @param showRouting show the routing info be shown
- * @param showMessageHeaders show the msg headers be shown
- * @return the formated data lists for printing
- */
- protected List<List> createMessageData(List<Long> msgids, List<QueueEntry> messages, boolean showHeaders, boolean showRouting,
- boolean showMessageHeaders)
- {
-
- // Currenly exposed message properties
-// //Printing the content Body
-// msg.getContentBodyIterator();
-// //Print the Headers
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getAppId();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getAppIdAsString();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getClusterId();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getContentType();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getCorrelationId();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getDeliveryMode();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getEncoding();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getExpiration();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getHeaders();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getMessageId();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getPriority();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getPropertyFlags();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getReplyTo();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getTimestamp();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getType();
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getUserId();
-//
-// //Print out all the property names
-// ((BasicContentHeaderProperties)msg.getContentHeaderBody().properties).getHeaders().getPropertyNames();
-//
-// msg.getMessageId();
-// msg.getSize();
-// msg.getArrivalTime();
-
-// msg.getDeliveredSubscription();
-// msg.getDeliveredToConsumer();
-// msg.getMessageHandle();
-// msg.getMessageId();
-// msg.getMessagePublishInfo();
-// msg.getPublisher();
-
-// msg.getStoreContext();
-// msg.isAllContentReceived();
-// msg.isPersistent();
-// msg.isRedelivered();
-// msg.isRejectedBy();
-// msg.isTaken();
-
- //Header setup
-
- List<List> data = new LinkedList<List>();
-
- List<String> id = new LinkedList<String>();
- data.add(id);
- id.add(Columns.ID.name());
- id.add(Console.ROW_DIVIDER);
-
- List<String> exchange = new LinkedList<String>();
- List<String> routingkey = new LinkedList<String>();
- List<String> immediate = new LinkedList<String>();
- List<String> mandatory = new LinkedList<String>();
- if (showRouting)
- {
- data.add(exchange);
- exchange.add(Columns.Exchange.name());
- exchange.add(Console.ROW_DIVIDER);
-
- data.add(routingkey);
- routingkey.add(Columns.RoutingKey.name());
- routingkey.add(Console.ROW_DIVIDER);
-
- data.add(immediate);
- immediate.add(Columns.isImmediate.name());
- immediate.add(Console.ROW_DIVIDER);
-
- data.add(mandatory);
- mandatory.add(Columns.isMandatory.name());
- mandatory.add(Console.ROW_DIVIDER);
- }
-
- List<String> size = new LinkedList<String>();
- List<String> appid = new LinkedList<String>();
- List<String> clusterid = new LinkedList<String>();
- List<String> contenttype = new LinkedList<String>();
- List<String> correlationid = new LinkedList<String>();
- List<String> deliverymode = new LinkedList<String>();
- List<String> encoding = new LinkedList<String>();
- List<String> arrival = new LinkedList<String>();
- List<String> expiration = new LinkedList<String>();
- List<String> priority = new LinkedList<String>();
- List<String> propertyflag = new LinkedList<String>();
- List<String> replyto = new LinkedList<String>();
- List<String> timestamp = new LinkedList<String>();
- List<String> type = new LinkedList<String>();
- List<String> userid = new LinkedList<String>();
- List<String> ispersitent = new LinkedList<String>();
- List<String> isredelivered = new LinkedList<String>();
- List<String> isdelivered = new LinkedList<String>();
-
- data.add(size);
- size.add(Columns.Size.name());
- size.add(Console.ROW_DIVIDER);
-
- if (showHeaders)
- {
- data.add(ispersitent);
- ispersitent.add(Columns.isPersistent.name());
- ispersitent.add(Console.ROW_DIVIDER);
-
- data.add(isredelivered);
- isredelivered.add(Columns.isRedelivered.name());
- isredelivered.add(Console.ROW_DIVIDER);
-
- data.add(isdelivered);
- isdelivered.add(Columns.isDelivered.name());
- isdelivered.add(Console.ROW_DIVIDER);
-
- data.add(appid);
- appid.add(Columns.App_ID.name());
- appid.add(Console.ROW_DIVIDER);
-
- data.add(clusterid);
- clusterid.add(Columns.Cluster_ID.name());
- clusterid.add(Console.ROW_DIVIDER);
-
- data.add(contenttype);
- contenttype.add(Columns.Content_Type.name());
- contenttype.add(Console.ROW_DIVIDER);
-
- data.add(correlationid);
- correlationid.add(Columns.Correlation_ID.name());
- correlationid.add(Console.ROW_DIVIDER);
-
- data.add(deliverymode);
- deliverymode.add(Columns.Delivery_Mode.name());
- deliverymode.add(Console.ROW_DIVIDER);
-
- data.add(encoding);
- encoding.add(Columns.Encoding.name());
- encoding.add(Console.ROW_DIVIDER);
-
- data.add(arrival);
- expiration.add(Columns.Arrival.name());
- expiration.add(Console.ROW_DIVIDER);
-
- data.add(expiration);
- expiration.add(Columns.Expiration.name());
- expiration.add(Console.ROW_DIVIDER);
-
- data.add(priority);
- priority.add(Columns.Priority.name());
- priority.add(Console.ROW_DIVIDER);
-
- data.add(propertyflag);
- propertyflag.add(Columns.Property_Flag.name());
- propertyflag.add(Console.ROW_DIVIDER);
-
- data.add(replyto);
- replyto.add(Columns.ReplyTo.name());
- replyto.add(Console.ROW_DIVIDER);
-
- data.add(timestamp);
- timestamp.add(Columns.Timestamp.name());
- timestamp.add(Console.ROW_DIVIDER);
-
- data.add(type);
- type.add(Columns.Type.name());
- type.add(Console.ROW_DIVIDER);
-
- data.add(userid);
- userid.add(Columns.UserID.name());
- userid.add(Console.ROW_DIVIDER);
- }
-
- List<String> msgHeaders = new LinkedList<String>();
- if (showMessageHeaders)
- {
- data.add(msgHeaders);
- msgHeaders.add(Columns.MsgHeaders.name());
- msgHeaders.add(Console.ROW_DIVIDER);
- }
-
- //Add create the table of data
- for (QueueEntry entry : messages)
- {
- AMQMessage msg = entry.getMessage();
- if (!includeMsg(msg, msgids))
- {
- continue;
- }
-
- id.add(msg.getMessageId().toString());
-
- size.add("" + msg.getSize());
-
- arrival.add("" + msg.getArrivalTime());
-
- try
- {
- ispersitent.add(msg.isPersistent() ? "true" : "false");
- }
- catch (AMQException e)
- {
- ispersitent.add("n/a");
- }
-
- isredelivered.add(msg.isRedelivered() ? "true" : "false");
-
- isdelivered.add(msg.getDeliveredToConsumer() ? "true" : "false");
-
-// msg.getMessageHandle();
-
- BasicContentHeaderProperties headers = null;
-
- try
- {
- headers = ((BasicContentHeaderProperties) msg.getContentHeaderBody().properties);
- }
- catch (AMQException e)
- {
- //ignore
-// commandError("Unable to read properties for message: " + e.getMessage(), null);
- }
-
- if (headers != null)
- {
- String appidS = headers.getAppIdAsString();
- appid.add(appidS == null ? "null" : appidS);
-
- String clusterS = headers.getClusterIdAsString();
- clusterid.add(clusterS == null ? "null" : clusterS);
-
- String contentS = headers.getContentTypeAsString();
- contenttype.add(contentS == null ? "null" : contentS);
-
- String correlationS = headers.getCorrelationIdAsString();
- correlationid.add(correlationS == null ? "null" : correlationS);
-
- deliverymode.add("" + headers.getDeliveryMode());
-
- AMQShortString encodeSS = headers.getEncoding();
- encoding.add(encodeSS == null ? "null" : encodeSS.toString());
-
- expiration.add("" + headers.getExpiration());
-
- FieldTable headerFT = headers.getHeaders();
- msgHeaders.add(headerFT == null ? "none" : "" + headerFT.toString());
-
- priority.add("" + headers.getPriority());
- propertyflag.add("" + headers.getPropertyFlags());
-
- AMQShortString replytoSS = headers.getReplyTo();
- replyto.add(replytoSS == null ? "null" : replytoSS.toString());
-
- timestamp.add("" + headers.getTimestamp());
-
- AMQShortString typeSS = headers.getType();
- type.add(typeSS == null ? "null" : typeSS.toString());
-
- AMQShortString useridSS = headers.getUserId();
- userid.add(useridSS == null ? "null" : useridSS.toString());
-
- MessagePublishInfo info = null;
- try
- {
- info = msg.getMessagePublishInfo();
- }
- catch (AMQException e)
- {
- //ignore
- }
-
- if (info != null)
- {
- AMQShortString exchangeSS = info.getExchange();
- exchange.add(exchangeSS == null ? "null" : exchangeSS.toString());
-
- AMQShortString routingkeySS = info.getRoutingKey();
- routingkey.add(routingkeySS == null ? "null" : routingkeySS.toString());
-
- immediate.add(info.isImmediate() ? "true" : "false");
- mandatory.add(info.isMandatory() ? "true" : "false");
- }
-
-// msg.getPublisher(); -- only used in clustering
-// msg.getStoreContext();
-// msg.isAllContentReceived();
-
- }// if headers!=null
-
-// need to access internal map and do lookups.
-// msg.isTaken();
-// msg.getDeliveredSubscription();
-// msg.isRejectedBy();
-
- }
-
- // if id only had the header and the divider in it then we have no data to display
- if (id.size() == 2)
- {
- return null;
- }
- return data;
- }
-
- protected boolean includeMsg(AMQMessage msg, List<Long> msgids)
- {
- if (msgids == null)
- {
- return true;
- }
-
- Long msgid = msg.getMessageId();
-
- boolean found = false;
-
- if (msgids != null)
- {
- //check msgid is in msgids
- for (Long l : msgids)
- {
- if (l.equals(msgid))
- {
- found = true;
- break;
- }
- }
- }
- return found;
- }
-
- public enum Columns
- {
- ID,
- Size,
- Exchange,
- RoutingKey,
- isImmediate,
- isMandatory,
- isPersistent,
- isRedelivered,
- isDelivered,
- App_ID,
- Cluster_ID,
- Content_Type,
- Correlation_ID,
- Delivery_Mode,
- Encoding,
- Arrival,
- Expiration,
- Priority,
- Property_Flag,
- ReplyTo,
- Timestamp,
- Type,
- UserID,
- MsgHeaders
- }
-}
-
-
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/security/Passwd.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/security/Passwd.java
deleted file mode 100644
index c27c52eb8e..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/security/Passwd.java
+++ /dev/null
@@ -1,81 +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.
- *
- *
- */
-package org.apache.qpid.tools.security;
-
-import org.apache.commons.codec.binary.Base64;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.DigestException;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintStream;
-
-public class Passwd
-{
- public static void main(String args[]) throws NoSuchAlgorithmException, DigestException, IOException
- {
- if (args.length != 2)
- {
- System.out.println("Passwd <username> <password>");
- System.exit(0);
- }
-
- byte[] data = args[1].getBytes("utf-8");
-
- MessageDigest md = MessageDigest.getInstance("MD5");
-
- for (byte b : data)
- {
- md.update(b);
- }
-
- byte[] digest = md.digest();
-
- Base64 b64 = new Base64();
-
- byte[] encoded = b64.encode(digest);
-
- output(args[0], encoded);
- }
-
- private static void output(String user, byte[] encoded) throws IOException
- {
-
-// File passwdFile = new File("qpid.passwd");
-
- PrintStream ps = new PrintStream(System.out);
-
- user += ":";
- ps.write(user.getBytes("utf-8"));
-
- for (byte b : encoded)
- {
- ps.write(b);
- }
-
- ps.println();
-
- ps.flush();
- ps.close();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/CommandParser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/CommandParser.java
deleted file mode 100644
index 986fea32cc..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/CommandParser.java
+++ /dev/null
@@ -1,51 +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.
- *
- *
- */
-package org.apache.qpid.tools.utils;
-
-public interface CommandParser
-{
- /**
- * If there is more than one command received on the last parse request.
- *
- * Subsequent calls to parse will utilise this input rather than reading new data from the input source
- * @return boolean
- */
- boolean more();
-
- /**
- * True if the currently parsed command has been requested as a background operation
- *
- * @return boolean
- */
- boolean isBackground();
-
- /**
- * Parses user commands, and groups tokens in the
- * String[] format that all Java main's love.
- *
- * If more than one command is provided in one input line then the more() method will return true.
- * A subsequent call to parse() will continue to parse that input line before reading new input.
- *
- * @return <code>input</code> split in args[] format; null if eof.
- * @throws java.io.IOException if there is a problem reading from the input stream
- */
- String[] parse() throws java.io.IOException;
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/Console.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/Console.java
deleted file mode 100644
index cf457d1ea5..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/Console.java
+++ /dev/null
@@ -1,90 +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.
- *
- *
- */
-package org.apache.qpid.tools.utils;
-
-import java.util.List;
-
-public interface Console
-{
- public enum CellFormat
- {
- CENTRED, LEFT, RIGHT
- }
-
- public static String ROW_DIVIDER = "*divider";
-
- public void print(String... message);
-
- public void println(String... message);
-
- public String readln();
-
- /**
- * Reads and parses the command line.
- *
- *
- * @return The next command or null
- */
- public String[] readCommand();
-
- public CommandParser getCommandParser();
-
- public void setCommandParser(CommandParser parser);
-
- /**
- *
- * Prints the list of String nicely.
- *
- * +-------------+
- * | Heading |
- * +-------------+
- * | Item 1 |
- * | Item 2 |
- * | Item 3 |
- * +-------------+
- *
- * @param hasTitle should list[0] be used as a heading
- * @param list The list of Strings to display
- */
- public void displayList(boolean hasTitle, String... list);
-
- /**
- *
- * Prints the list of String nicely.
- *
- * +----------------------------+
- * | Heading |
- * +----------------------------+
- * | title | title | ..
- * +----------------------------+
- * | Item 2 | value 2 | ..
- * +----------------------------+ (*divider)
- * | Item 3 | value 2 | ..
- * +----------------------------+
- *
- * @param title The title to display if any
- * @param entries the entries to display in a map.
- */
- void printMap(String title, List<List> entries);
-
-
- public void close();
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleCommandParser.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleCommandParser.java
deleted file mode 100644
index 09444ccdd7..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleCommandParser.java
+++ /dev/null
@@ -1,121 +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.
- *
- *
- */
-package org.apache.qpid.tools.utils;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.util.StringTokenizer;
-
-public class SimpleCommandParser implements CommandParser
-{
- private static final String COMMAND_SEPERATOR = ";";
-
- /** Input source of commands */
- protected BufferedReader _reader;
-
- /** The next list of commands from the command line */
- private StringBuilder _nextCommand = null;
-
- public SimpleCommandParser(BufferedReader reader)
- {
- _reader = reader;
- }
-
- public boolean more()
- {
- return _nextCommand != null;
- }
-
- public boolean isBackground()
- {
- return false;
- }
-
- public String[] parse() throws IOException
- {
- String[] commands = null;
-
- String input = null;
-
- if (_nextCommand == null)
- {
- input = _reader.readLine();
- }
- else
- {
- input = _nextCommand.toString();
- _nextCommand = null;
- }
-
- if (input == null)
- {
- return null;
- }
-
- StringTokenizer tok = new StringTokenizer(input, " ");
-
- int tokenCount = tok.countTokens();
- int index = 0;
-
- if (tokenCount > 0)
- {
- commands = new String[tokenCount];
- boolean commandComplete = false;
-
- while (tok.hasMoreTokens())
- {
- String next = tok.nextToken();
-
- if (next.equals(COMMAND_SEPERATOR))
- {
- commandComplete = true;
- _nextCommand = new StringBuilder();
- continue;
- }
-
- if (commandComplete)
- {
- _nextCommand.append(next);
- _nextCommand.append(" ");
- }
- else
- {
- commands[index] = next;
- index++;
- }
- }
-
- }
-
- //Reduce the String[] if not all the tokens were used in this command.
- // i.e. there is more than one command on the line.
- if (index != tokenCount)
- {
- String[] shortCommands = new String[index];
- System.arraycopy(commands, 0, shortCommands, 0, index);
- return shortCommands;
- }
- else
- {
- return commands;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleConsole.java b/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleConsole.java
deleted file mode 100644
index ec080a4611..0000000000
--- a/M4-RCs/qpid/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleConsole.java
+++ /dev/null
@@ -1,363 +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.
- *
- *
- */
-package org.apache.qpid.tools.utils;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.util.LinkedList;
-import java.util.List;
-
-public class SimpleConsole implements Console
-{
- /** SLF4J Logger. */
- private static Logger _devlog = LoggerFactory.getLogger(SimpleConsole.class);
-
- /** Console Writer. */
- protected static BufferedWriter _consoleWriter;
-
- /** Console Reader. */
- protected static BufferedReader _consoleReader;
-
- /** Parser for command-line input. */
- protected CommandParser _parser;
-
- public SimpleConsole(BufferedWriter writer, BufferedReader reader)
- {
- _consoleWriter = writer;
- _consoleReader = reader;
- _parser = new SimpleCommandParser(_consoleReader);
- }
-
- public void print(String... message)
- {
- try
- {
- for (String s : message)
- {
- _consoleWriter.write(s);
- }
- _consoleWriter.flush();
- }
- catch (IOException e)
- {
- _devlog.error(e.getMessage() + ": Occured whilst trying to write:" + message);
- }
-
- }
-
- public void println(String... message)
- {
- print(message);
- print(System.getProperty("line.separator"));
- }
-
-
- public String readln()
- {
- try
- {
- return _consoleReader.readLine();
- }
- catch (IOException e)
- {
- _devlog.debug("Unable to read input due to:" + e.getMessage());
- return null;
- }
- }
-
- public String[] readCommand()
- {
- try
- {
- return _parser.parse();
- }
- catch (IOException e)
- {
- _devlog.error("Error reading command:" + e.getMessage());
- return new String[0];
- }
- }
-
- public CommandParser getCommandParser()
- {
- return _parser;
- }
-
- public void setCommandParser(CommandParser parser)
- {
- _parser = parser;
- }
-
- public void displayList(boolean hasTitle, String... list)
- {
- java.util.List<java.util.List> data = new LinkedList<List>();
-
- java.util.List<String> values = new LinkedList<String>();
-
- data.add(values);
-
- for (String value : list)
- {
- values.add(value);
- }
-
- if (hasTitle)
- {
- values.add(1, "*divider");
- }
-
- printMap(null, data);
- }
-
- /**
- *
- * Prints the list of String nicely.
- *
- * +----------------------------+
- * | Heading |
- * +----------------------------+
- * | title | title | ..
- * +----------------------------+
- * | Item 2 | value 2 | ..
- * | Item 3 | value 2 | ..
- * +----------------------------+
- *
- * @param title The title to display if any
- * @param entries the entries to display in a map.
- */
- public void printMap(String title, java.util.List<java.util.List> entries)
- {
- try
- {
- int columns = entries.size();
-
- int[] columnWidth = new int[columns];
-
- // calculate row count
- int rowMax = 0;
-
- //the longest item
- int itemMax = 0;
-
- for (int i = 0; i < columns; i++)
- {
- int columnIRowMax = entries.get(i).size();
-
- if (columnIRowMax > rowMax)
- {
- rowMax = columnIRowMax;
- }
- for (Object values : entries.get(i))
- {
- if (values.toString().equals(Console.ROW_DIVIDER))
- {
- continue;
- }
-
- int itemLength = values.toString().length();
-
- //note for single width
- if (itemLength > itemMax)
- {
- itemMax = itemLength;
- }
-
- //note for mulit width
- if (itemLength > columnWidth[i])
- {
- columnWidth[i] = itemLength;
- }
-
- }
- }
-
- int tableWidth = 0;
-
-
- for (int i = 0; i < columns; i++)
- {
- // plus 2 for the space padding
- columnWidth[i] += 2;
- }
- for (int size : columnWidth)
- {
- tableWidth += size;
- }
- tableWidth += (columns - 1);
-
- if (title != null)
- {
- if (title.length() > tableWidth)
- {
- tableWidth = title.length();
- }
-
- printCellRow("+", "-", tableWidth);
-
- printCell(CellFormat.CENTRED, "|", tableWidth, " " + title + " ", 0);
- _consoleWriter.newLine();
-
- }
-
- //put top line | or bottom of title
- printCellRow("+", "-", tableWidth);
-
- //print the table data
- int row = 0;
-
- for (; row < rowMax; row++)
- {
- for (int i = 0; i < columns; i++)
- {
- java.util.List columnData = entries.get(i);
-
- String value;
- // does this column have a value for this row
- if (columnData.size() > row)
- {
- value = " " + columnData.get(row).toString() + " ";
- }
- else
- {
- value = " ";
- }
-
- if (i == 0 && value.equals(" " + Console.ROW_DIVIDER + " "))
- {
- printCellRow("+", "-", tableWidth);
- //move on to the next row
- break;
- }
- else
- {
- printCell(CellFormat.LEFT, "|", columnWidth[i], value, i);
- }
-
- // if it is the last row then do a new line.
- if (i == columns - 1)
- {
- _consoleWriter.newLine();
- }
- }
- }
-
- printCellRow("+", "-", tableWidth);
-
- }
- catch (IOException e)
- {
- _devlog.error(e.getMessage() + ": Occured whilst trying to write.");
- }
- }
-
- public void close()
- {
-
- try
- {
- _consoleReader.close();
- }
- catch (IOException e)
- {
- _devlog.error(e.getMessage() + ": Occured whilst trying to close reader.");
- }
-
- try
- {
-
- _consoleWriter.close();
- }
- catch (IOException e)
- {
- _devlog.error(e.getMessage() + ": Occured whilst trying to close writer.");
- }
-
- }
-
- private void printCell(CellFormat format, String edge, int cellWidth, String cell, int column) throws IOException
- {
- int pad = cellWidth - cell.length();
-
- if (column == 0)
- {
- _consoleWriter.write(edge);
- }
-
- switch (format)
- {
- case CENTRED:
- printPad(" ", pad / 2);
- break;
- case RIGHT:
- printPad(" ", pad);
- break;
- }
-
- _consoleWriter.write(cell);
-
-
- switch (format)
- {
- case CENTRED:
- // if pad isn't even put the extra one on the right
- if (pad % 2 == 0)
- {
- printPad(" ", pad / 2);
- }
- else
- {
- printPad(" ", (pad / 2) + 1);
- }
- break;
- case LEFT:
- printPad(" ", pad);
- break;
- }
-
-
- _consoleWriter.write(edge);
-
- }
-
- private void printCellRow(String edge, String mid, int cellWidth) throws IOException
- {
- _consoleWriter.write(edge);
-
- printPad(mid, cellWidth);
-
- _consoleWriter.write(edge);
- _consoleWriter.newLine();
- }
-
- private void printPad(String padChar, int count) throws IOException
- {
- for (int i = 0; i < count; i++)
- {
- _consoleWriter.write(padChar);
- }
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/ExtractResendAndRequeueTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/ExtractResendAndRequeueTest.java
deleted file mode 100644
index 5fbf9484f7..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/ExtractResendAndRequeueTest.java
+++ /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.
- *
- */
-package org.apache.qpid.server;
-
-import junit.framework.TestCase;
-import org.apache.qpid.server.ack.UnacknowledgedMessageMapImpl;
-import org.apache.qpid.server.queue.MockQueueEntry;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.queue.SimpleQueueEntryList;
-import org.apache.qpid.server.queue.MockAMQMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.MockAMQQueue;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.QueueEntryIterator;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.subscription.MockSubscription;
-import org.apache.qpid.AMQException;
-
-import java.util.Map;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.Iterator;
-
-/**
- * QPID-1385 : Race condition between added to unacked map and resending due to a rollback.
- *
- * In AMQChannel _unackedMap.clear() was done after the visit. This meant that the clear was not in the same
- * synchronized block as as the preparation to resend.
- *
- * This clearing/prep for resend was done as a result of the rollback call. HOWEVER, the delivery thread was still
- * in the process of sending messages to the client. It is therefore possible that a message could block on the
- * _unackedMap lock waiting for the visit to compelete so that it can add the new message to the unackedMap....
- * which is then cleared by the resend/rollback thread.
- *
- * This problem was encountered by the testSend2ThenRollback test.
- *
- * To try and increase the chance of the race condition occuring this test will send multiple messages so that the
- * delivery thread will be in progress while the rollback method is called. Hopefully this will cause the
- * deliveryTag to be lost
- */
-public class ExtractResendAndRequeueTest extends TestCase
-{
-
- UnacknowledgedMessageMapImpl _unacknowledgedMessageMap;
- private static final int INITIAL_MSG_COUNT = 10;
- private AMQQueue _queue = new MockAMQQueue();
- private LinkedList<QueueEntry> _referenceList = new LinkedList<QueueEntry>();
-
- @Override
- public void setUp() throws AMQException
- {
- _unacknowledgedMessageMap = new UnacknowledgedMessageMapImpl(100);
-
- long id = 0;
- SimpleQueueEntryList list = new SimpleQueueEntryList(_queue);
-
- // Add initial messages to QueueEntryList
- for (int count = 0; count < INITIAL_MSG_COUNT; count++)
- {
- AMQMessage msg = new MockAMQMessage(id);
-
- list.add(msg);
-
- //Increment ID;
- id++;
- }
-
- // Iterate through the QueueEntryList and add entries to unacknowledgeMessageMap and referecenList
- QueueEntryIterator queueEntries = list.iterator();
- while(queueEntries.advance())
- {
- QueueEntry entry = queueEntries.getNode();
- _unacknowledgedMessageMap.add(entry.getMessage().getMessageId(), entry);
-
- // Store the entry for future inspection
- _referenceList.add(entry);
- }
-
- assertEquals("Map does not contain correct setup data", INITIAL_MSG_COUNT, _unacknowledgedMessageMap.size());
- }
-
- /**
- * Helper method to create a new subscription and aquire the given messages.
- *
- * @param messageList The messages to aquire
- *
- * @return Subscription that performed the aquire
- */
- private Subscription createSubscriptionAndAquireMessages(LinkedList<QueueEntry> messageList)
- {
- Subscription subscription = new MockSubscription();
-
- // Aquire messages in subscription
- for (QueueEntry entry : messageList)
- {
- entry.acquire(subscription);
- }
-
- return subscription;
- }
-
- /**
- * This is the normal consumer rollback method.
- *
- * An active consumer that has aquired messages expects those messasges to be reset when rollback is requested.
- *
- * This test validates that the msgToResend map includes all the messages and none are left behind.
- *
- * @throws AMQException the visit interface throws this
- */
- public void testResend() throws AMQException
- {
- //We don't need the subscription object here.
- createSubscriptionAndAquireMessages(_referenceList);
-
- final Map<Long, QueueEntry> msgToRequeue = new LinkedHashMap<Long, QueueEntry>();
- final Map<Long, QueueEntry> msgToResend = new LinkedHashMap<Long, QueueEntry>();
-
- // requeueIfUnabletoResend doesn't matter here.
- _unacknowledgedMessageMap.visit(new ExtractResendAndRequeue(_unacknowledgedMessageMap, msgToRequeue,
- msgToResend, true, new StoreContext()));
-
- assertEquals("Message count for resend not correct.", INITIAL_MSG_COUNT, msgToResend.size());
- assertEquals("Message count for requeue not correct.", 0, msgToRequeue.size());
- assertEquals("Map was not emptied", 0, _unacknowledgedMessageMap.size());
- }
-
- /**
- * This is the normal consumer close method.
- *
- * When a consumer that has aquired messages expects closes the messages that it has aquired should be removed from
- * the unacknowledgeMap and placed in msgToRequeue
- *
- * This test validates that the msgToRequeue map includes all the messages and none are left behind.
- *
- * @throws AMQException the visit interface throws this
- */
- public void testRequeueDueToSubscriptionClosure() throws AMQException
- {
- Subscription subscription = createSubscriptionAndAquireMessages(_referenceList);
-
- // Close subscription
- subscription.close();
-
- final Map<Long, QueueEntry> msgToRequeue = new LinkedHashMap<Long, QueueEntry>();
- final Map<Long, QueueEntry> msgToResend = new LinkedHashMap<Long, QueueEntry>();
-
- // requeueIfUnabletoResend doesn't matter here.
- _unacknowledgedMessageMap.visit(new ExtractResendAndRequeue(_unacknowledgedMessageMap, msgToRequeue,
- msgToResend, true, new StoreContext()));
-
- assertEquals("Message count for resend not correct.", 0, msgToResend.size());
- assertEquals("Message count for requeue not correct.", INITIAL_MSG_COUNT, msgToRequeue.size());
- assertEquals("Map was not emptied", 0, _unacknowledgedMessageMap.size());
- }
-
- /**
- * If the subscription is null, due to message being retrieved via a GET, And we request that messages are requeued
- * requeueIfUnabletoResend(set to true) then all messages should be sent to the msgToRequeue map.
- *
- * @throws AMQException the visit interface throws this
- */
-
- public void testRequeueDueToMessageHavingNoConsumerTag() throws AMQException
- {
- final Map<Long, QueueEntry> msgToRequeue = new LinkedHashMap<Long, QueueEntry>();
- final Map<Long, QueueEntry> msgToResend = new LinkedHashMap<Long, QueueEntry>();
-
- // requeueIfUnabletoResend = true so all messages should go to msgToRequeue
- _unacknowledgedMessageMap.visit(new ExtractResendAndRequeue(_unacknowledgedMessageMap, msgToRequeue,
- msgToResend, true, new StoreContext()));
-
- assertEquals("Message count for resend not correct.", 0, msgToResend.size());
- assertEquals("Message count for requeue not correct.", INITIAL_MSG_COUNT, msgToRequeue.size());
- assertEquals("Map was not emptied", 0, _unacknowledgedMessageMap.size());
- }
-
- /**
- * If the subscription is null, due to message being retrieved via a GET, And we request that we don't
- * requeueIfUnabletoResend(set to false) then all messages should be dropped as we do not have a dead letter queue.
- *
- * @throws AMQException the visit interface throws this
- */
-
- public void testDrop() throws AMQException
- {
- final Map<Long, QueueEntry> msgToRequeue = new LinkedHashMap<Long, QueueEntry>();
- final Map<Long, QueueEntry> msgToResend = new LinkedHashMap<Long, QueueEntry>();
-
- // requeueIfUnabletoResend = false so all messages should be dropped all maps should be empty
- _unacknowledgedMessageMap.visit(new ExtractResendAndRequeue(_unacknowledgedMessageMap, msgToRequeue,
- msgToResend, false, new StoreContext()));
-
- assertEquals("Message count for resend not correct.", 0, msgToResend.size());
- assertEquals("Message count for requeue not correct.", 0, msgToRequeue.size());
- assertEquals("Map was not emptied", 0, _unacknowledgedMessageMap.size());
-
-
- for (QueueEntry entry : _referenceList)
- {
- assertTrue("Message was not discarded", entry.isDeleted());
- }
-
- }
-
- /**
- * If the subscription is null, due to message being retrieved via a GET, AND the queue upon which the message was
- * delivered has been deleted then it is not possible to requeue. Currently we simply discar the message but in the
- * future we may wish to dead letter the message.
- *
- * Validate that at the end of the visit all Maps are empty and all messages are marked as deleted
- *
- * @throws AMQException the visit interface throws this
- */
- public void testDiscard() throws AMQException
- {
- final Map<Long, QueueEntry> msgToRequeue = new LinkedHashMap<Long, QueueEntry>();
- final Map<Long, QueueEntry> msgToResend = new LinkedHashMap<Long, QueueEntry>();
-
- _queue.delete();
-
- // requeueIfUnabletoResend : value doesn't matter here as queue has been deleted
- _unacknowledgedMessageMap.visit(new ExtractResendAndRequeue(_unacknowledgedMessageMap, msgToRequeue,
- msgToResend, false, new StoreContext()));
-
- assertEquals("Message count for resend not correct.", 0, msgToResend.size());
- assertEquals("Message count for requeue not correct.", 0, msgToRequeue.size());
- assertEquals("Map was not emptied", 0, _unacknowledgedMessageMap.size());
-
- for (QueueEntry entry : _referenceList)
- {
- assertTrue("Message was not discarded", entry.isDeleted());
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/RunBrokerWithCommand.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/RunBrokerWithCommand.java
deleted file mode 100644
index 59543874b4..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/RunBrokerWithCommand.java
+++ /dev/null
@@ -1,132 +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.
- *
- *
- */
-package org.apache.qpid.server;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.Level;
-
-import java.io.InputStream;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.IOException;
-
-public class RunBrokerWithCommand
-{
- public static void main(String[] args)
- {
- //Start the broker
- try
- {
- String[] fudge = args.clone();
-
- // Override the first value which is the command we are going to run later.
- fudge[0] = "-v";
- new Main(fudge).startup();
- }
- catch (Exception e)
- {
- System.err.println("Unable to start broker due to: " + e.getMessage());
-
- e.printStackTrace();
- exit(1);
- }
-
- Logger.getRootLogger().setLevel(Level.ERROR);
-
- //run command
- try
- {
- Process task = Runtime.getRuntime().exec(args[0]);
- System.err.println("Started Proccess: " + args[0]);
-
- InputStream inputStream = task.getInputStream();
-
- InputStream errorStream = task.getErrorStream();
-
- Thread out = new Thread(new Outputter("[OUT]", new BufferedReader(new InputStreamReader(inputStream))));
- Thread err = new Thread(new Outputter("[ERR]", new BufferedReader(new InputStreamReader(errorStream))));
-
- out.start();
- err.start();
-
- out.join();
- err.join();
-
- System.err.println("Waiting for process to exit: " + args[0]);
- task.waitFor();
- System.err.println("Done Proccess: " + args[0]);
-
- }
- catch (IOException e)
- {
- System.err.println("Proccess had problems: " + e.getMessage());
- e.printStackTrace(System.err);
- exit(1);
- }
- catch (InterruptedException e)
- {
- System.err.println("Proccess had problems: " + e.getMessage());
- e.printStackTrace(System.err);
-
- exit(1);
- }
-
-
- exit(0);
- }
-
- private static void exit(int i)
- {
- Logger.getRootLogger().setLevel(Level.INFO);
- System.exit(i);
- }
-
- static class Outputter implements Runnable
- {
-
- BufferedReader reader;
- String prefix;
-
- Outputter(String s, BufferedReader r)
- {
- prefix = s;
- reader = r;
- }
-
- public void run()
- {
- String line;
- try
- {
- while ((line = reader.readLine()) != null)
- {
- System.out.println(prefix + line);
- }
- }
- catch (IOException e)
- {
- System.out.println("Error occured reading; " + e.getMessage());
- }
- }
-
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/SelectorParserTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/SelectorParserTest.java
deleted file mode 100644
index a0304a7b01..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/SelectorParserTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.apache.qpid.server;
-
-import junit.framework.TestCase;
-import org.apache.qpid.server.filter.JMSSelectorFilter;
-import org.apache.qpid.AMQException;/*
- *
- * 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.
- *
- */
-
-public class SelectorParserTest extends TestCase
-{
- public void testSelectorWithHyphen()
- {
- testPass("Cost = 2 AND \"property-with-hyphen\" = 'wibble'");
- }
-
- public void testLike()
- {
- testFail("Cost LIKE 2");
- testPass("Cost LIKE 'Hello'");
- }
-
- public void testStringQuoted()
- {
- testPass("string = 'Test'");
- }
-
- public void testProperty()
- {
- testPass("prop1 = prop2");
- }
-
- public void testPropertyNames()
- {
- testPass("$min= TRUE AND _max= FALSE AND Prop_2 = true AND prop$3 = false");
- }
-
- public void testProtected()
- {
- testFail("NULL = 0 ");
- testFail("TRUE = 0 ");
- testFail("FALSE = 0 ");
- testFail("NOT = 0 ");
- testFail("AND = 0 ");
- testFail("OR = 0 ");
- testFail("BETWEEN = 0 ");
- testFail("LIKE = 0 ");
- testFail("IN = 0 ");
- testFail("IS = 0 ");
- testFail("ESCAPE = 0 ");
- }
-
-
- public void testBoolean()
- {
- testPass("min= TRUE AND max= FALSE ");
- testPass("min= true AND max= false");
- }
-
- public void testDouble()
- {
- testPass("positive=31E2 AND negative=-31.4E3");
- testPass("min=" + Double.MIN_VALUE + " AND max=" + Double.MAX_VALUE);
- }
-
- public void testLong()
- {
- testPass("minLong=" + Long.MIN_VALUE + "L AND maxLong=" + Long.MAX_VALUE + "L");
- }
-
- public void testInt()
- {
- testPass("minInt=" + Integer.MIN_VALUE + " AND maxInt=" + Integer.MAX_VALUE);
- }
-
- public void testSigned()
- {
- testPass("negative=-42 AND positive=+42");
- }
-
- public void testOctal()
- {
- testPass("octal=042");
- }
-
-
- private void testPass(String selector)
- {
- try
- {
- new JMSSelectorFilter(selector);
- }
- catch (AMQException e)
- {
- fail("Selector '" + selector + "' was not parsed :" + e.getMessage());
- }
- }
-
- private void testFail(String selector)
- {
- try
- {
- new JMSSelectorFilter(selector);
- fail("Selector '" + selector + "' was parsed ");
- }
- catch (AMQException e)
- {
- //normal path
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/AcknowledgeTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/AcknowledgeTest.java
deleted file mode 100644
index 9ef4af2932..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/AcknowledgeTest.java
+++ /dev/null
@@ -1,120 +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.
- *
- */
-package org.apache.qpid.server.ack;
-
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.protocol.InternalTestProtocolSession;
-import org.apache.qpid.server.util.InternalBrokerBaseCase;
-
-import java.util.List;
-
-public class AcknowledgeTest extends InternalBrokerBaseCase
-{
-
- public void testTransactionalSingleAck() throws AMQException
- {
- _channel.setLocalTransactional();
- runMessageAck(1, 1, 1, false, 0);
- }
-
- public void testTransactionalMultiAck() throws AMQException
- {
- _channel.setLocalTransactional();
- runMessageAck(10, 1, 5, true, 5);
- }
-
- public void testTransactionalAckAll() throws AMQException
- {
- _channel.setLocalTransactional();
- runMessageAck(10, 1, 0, true, 0);
- }
-
- public void testNonTransactionalSingleAck() throws AMQException
- {
- runMessageAck(1, 1, 1, false, 0);
- }
-
- public void testNonTransactionalMultiAck() throws AMQException
- {
- runMessageAck(10, 1, 5, true, 5);
- }
-
- public void testNonTransactionalAckAll() throws AMQException
- {
- runMessageAck(10, 1, 0, true, 0);
- }
-
- protected void runMessageAck(int sendMessageCount, long firstDeliveryTag, long acknowledgeDeliveryTag, boolean acknowldegeMultiple, int remainingUnackedMessages) throws AMQException
- {
- //Check store is empty
- checkStoreContents(0);
-
- //Send required messsages to the queue
- publishMessages(_session, _channel, sendMessageCount);
-
- if (_channel.isTransactional())
- {
- _channel.commit();
- }
-
- //Ensure they are stored
- checkStoreContents(sendMessageCount);
-
- //Check that there are no unacked messages
- assertEquals("Channel should have no unacked msgs ", 0, _channel.getUnacknowledgedMessageMap().size());
-
- //Subscribe to the queue
- AMQShortString subscriber = subscribe(_session, _channel, _queue);
-
- _queue.deliverAsync();
-
- //Wait for the messages to be delivered
- _session.awaitDelivery(sendMessageCount);
-
- //Check that they are all waiting to be acknoledged
- assertEquals("Channel should have unacked msgs", sendMessageCount, _channel.getUnacknowledgedMessageMap().size());
-
- List<InternalTestProtocolSession.DeliveryPair> messages = _session.getDelivers(_channel.getChannelId(), subscriber, sendMessageCount);
-
- //Double check we received the right number of messages
- assertEquals(sendMessageCount, messages.size());
-
- //Check that the first message has the expected deliveryTag
- assertEquals("First message does not have expected deliveryTag", firstDeliveryTag, messages.get(0).getDeliveryTag());
-
- //Send required Acknowledgement
- _channel.acknowledgeMessage(acknowledgeDeliveryTag, acknowldegeMultiple);
-
- if (_channel.isTransactional())
- {
- _channel.commit();
- }
-
- // Check Remaining Acknowledgements
- assertEquals("Channel unacked msgs count incorrect", remainingUnackedMessages, _channel.getUnacknowledgedMessageMap().size());
-
- //Check store contents are also correct.
- checkStoreContents(remainingUnackedMessages);
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java
deleted file mode 100644
index 3b83190e42..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java
+++ /dev/null
@@ -1,50 +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.
- *
- */
-package org.apache.qpid.server.configuration;
-
-import org.apache.qpid.configuration.PropertyException;
-import org.apache.qpid.configuration.PropertyUtils;
-
-import junit.framework.TestCase;
-
-// TODO: This belongs in the "common" module.
-public class TestPropertyUtils extends TestCase
-{
- public void testSimpleExpansion() throws PropertyException
- {
- System.setProperty("banana", "fruity");
- String expandedProperty = PropertyUtils.replaceProperties("${banana}");
- assertEquals(expandedProperty, "fruity");
- }
-
- public void testDualExpansion() throws PropertyException
- {
- System.setProperty("banana", "fruity");
- System.setProperty("concrete", "horrible");
- String expandedProperty = PropertyUtils.replaceProperties("${banana}xyz${concrete}");
- assertEquals(expandedProperty, "fruityxyzhorrible");
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TestPropertyUtils.class);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
deleted file mode 100644
index 8f743d8856..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
+++ /dev/null
@@ -1,108 +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.
- *
- */
-package org.apache.qpid.server.configuration;
-
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.XMLConfiguration;
-import org.apache.commons.configuration.HierarchicalConfiguration.Node;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.queue.AMQPriorityQueue;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import junit.framework.TestCase;
-
-public class VirtualHostConfigurationTest extends TestCase
-{
-
- private File configFile;
- private VirtualHostConfiguration vhostConfig;
- private XMLConfiguration configXml;
-
- @Override
- protected void setUp() throws Exception
- {
- // Create temporary configuration file
- configFile = File.createTempFile(this.getName()+"config", ".xml");
- configFile.deleteOnExit();
-
- // Fill config file with stuff
- configXml = new XMLConfiguration();
- configXml.setRootElementName("virtualhosts");
- configXml.addProperty("virtualhost(-1).name", "test");
- }
-
- public void testQueuePriority() throws ConfigurationException, AMQException
- {
- // Set up queue with 5 priorities
- configXml.addProperty("virtualhost.test.queues(-1).queue(-1).name(-1)",
- "atest");
- configXml.addProperty("virtualhost.test.queues.queue.atest(-1).exchange",
- "amq.direct");
- configXml.addProperty("virtualhost.test.queues.queue.atest.priorities",
- "5");
-
- // Set up queue with JMS style priorities
- configXml.addProperty("virtualhost.test.queues(-1).queue(-1).name(-1)",
- "ptest");
- configXml.addProperty("virtualhost.test.queues.queue.ptest(-1).exchange",
- "amq.direct");
- configXml.addProperty("virtualhost.test.queues.queue.ptest.priority",
- "true");
-
- // Set up queue with no priorities
- configXml.addProperty("virtualhost.test.queues(-1).queue(-1).name(-1)",
- "ntest");
- configXml.addProperty("virtualhost.test.queues.queue.ntest(-1).exchange",
- "amq.direct");
- configXml.addProperty("virtualhost.test.queues.queue.ntest.priority",
- "false");
- configXml.save(configFile);
-
- // Setup virtual host configuration
- vhostConfig = new VirtualHostConfiguration(configFile.getAbsolutePath());
-
- // Do bindings and get resulting vhost
- vhostConfig.performBindings();
- VirtualHost vhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
-
- // Check that atest was a priority queue with 5 priorities
- AMQQueue atest = vhost.getQueueRegistry().getQueue(new AMQShortString("atest"));
- assertTrue(atest instanceof AMQPriorityQueue);
- assertEquals(5, ((AMQPriorityQueue) atest).getPriorities());
-
- // Check that ptest was a priority queue with 10 priorities
- AMQQueue ptest = vhost.getQueueRegistry().getQueue(new AMQShortString("ptest"));
- assertTrue(ptest instanceof AMQPriorityQueue);
- assertEquals(10, ((AMQPriorityQueue) ptest).getPriorities());
-
- // Check that ntest wasn't a priority queue
- AMQQueue ntest = vhost.getQueueRegistry().getQueue(new AMQShortString("ntest"));
- assertFalse(ntest instanceof AMQPriorityQueue);
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java
deleted file mode 100644
index aa25e207a9..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java
+++ /dev/null
@@ -1,595 +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.
- *
- *
- */
-package org.apache.qpid.server.exchange;
-
-import junit.framework.TestCase;
-import junit.framework.Assert;
-import org.apache.qpid.server.queue.*;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.server.txn.TransactionalContext;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.MemoryMessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.protocol.InternalTestProtocolSession;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-
-import java.util.LinkedList;
-
-public class DestWildExchangeTest extends TestCase
-{
-
- TopicExchange _exchange;
-
- VirtualHost _vhost;
- MessageStore _store;
- StoreContext _context;
-
- InternalTestProtocolSession _protocolSession;
-
-
- public void setUp() throws AMQException
- {
- _exchange = new TopicExchange();
- _vhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHosts().iterator().next();
- _store = new MemoryMessageStore();
- _context = new StoreContext();
- _protocolSession = new InternalTestProtocolSession();
- }
-
- public void tearDown()
- {
- ApplicationRegistry.remove(1);
- }
-
-
- public void testNoRoute() throws AMQException
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("a*#b"), false, null, false, _vhost, null);
- _exchange.registerQueue(new AMQShortString("a.*.#.b"), queue, null);
-
-
- MessagePublishInfo info = new PublishInfo(new AMQShortString("a.b"));
-
- IncomingMessage message = new IncomingMessage(0L, info, null, _protocolSession);
-
- _exchange.route(message);
-
- Assert.assertEquals(0, queue.getMessageCount());
- }
-
- public void testDirectMatch() throws AMQException
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("ab"), false, null, false, _vhost, null);
- _exchange.registerQueue(new AMQShortString("a.b"), queue, null);
-
-
- IncomingMessage message = createMessage("a.b");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a.c");
-
- try
- {
- routeMessage(message);
- fail("Message has no route and should fail to be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
- }
-
-
- public void testStarMatch() throws AMQException
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("a*"), false, null, false, _vhost, null);
- _exchange.registerQueue(new AMQShortString("a.*"), queue, null);
-
-
- IncomingMessage message = createMessage("a.b");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a.c");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a");
-
- try
- {
- routeMessage(message);
- fail("Message has no route and should fail to be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
- }
-
- public void testHashMatch() throws AMQException
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("a#"), false, null, false, _vhost, null);
- _exchange.registerQueue(new AMQShortString("a.#"), queue, null);
-
-
- IncomingMessage message = createMessage("a.b.c");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a.b");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a.c");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- message = createMessage("a");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("b");
-
- try
- {
- routeMessage(message);
- fail("Message has no route and should fail to be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
- }
-
-
- public void testMidHash() throws AMQException
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("a"), false, null, false, _vhost, null);
- _exchange.registerQueue(new AMQShortString("a.*.#.b"), queue, null);
-
-
- IncomingMessage message = createMessage("a.c.d.b");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- message = createMessage("a.c.b");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- public void testMatchafterHash() throws AMQException
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("a#"), false, null, false, _vhost, null);
- _exchange.registerQueue(new AMQShortString("a.*.#.b.c"), queue, null);
-
-
- IncomingMessage message = createMessage("a.c.b.b");
-
- try
- {
- routeMessage(message);
- fail("Message has route and should not be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a.a.b.c");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- message = createMessage("a.b.c.b");
-
- try
- {
- routeMessage(message);
- fail("Message has route and should not be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
-
- message = createMessage("a.b.c.b.c");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
-
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
-
- public void testHashAfterHash() throws AMQException
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("a#"), false, null, false, _vhost, null);
- _exchange.registerQueue(new AMQShortString("a.*.#.b.c.#.d"), queue, null);
-
-
- IncomingMessage message = createMessage("a.c.b.b.c");
-
- try
- {
- routeMessage(message);
- fail("Message has route and should not be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a.a.b.c.d");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- public void testHashHash() throws AMQException
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("a#"), false, null, false, _vhost, null);
- _exchange.registerQueue(new AMQShortString("a.#.*.#.d"), queue, null);
-
-
- IncomingMessage message = createMessage("a.c.b.b.c");
-
- try
- {
- routeMessage(message);
- fail("Message has route and should not be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
-
- message = createMessage("a.a.b.c.d");
-
- try
- {
- routeMessage(message);
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", (Object) message.getMessageId(), queue.getMessagesOnTheQueue().get(0).getMessage().getMessageId());
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- public void testSubMatchFails() throws AMQException
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("a"), false, null, false, _vhost, null);
- _exchange.registerQueue(new AMQShortString("a.b.c.d"), queue, null);
-
-
- IncomingMessage message = createMessage("a.b.c");
-
- try
- {
- routeMessage(message);
- fail("Message has route and should not be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- private void routeMessage(final IncomingMessage message)
- throws AMQException
- {
- _exchange.route(message);
- message.routingComplete(_store, new MessageHandleFactory());
- message.deliverToQueues();
- }
-
- public void testMoreRouting() throws AMQException
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("a"), false, null, false, _vhost, null);
- _exchange.registerQueue(new AMQShortString("a.b"), queue, null);
-
-
- IncomingMessage message = createMessage("a.b.c");
-
- try
- {
- routeMessage(message);
- fail("Message has route and should not be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- public void testMoreQueue() throws AMQException
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("a"), false, null, false, _vhost, null);
- _exchange.registerQueue(new AMQShortString("a.b"), queue, null);
-
-
- IncomingMessage message = createMessage("a");
-
- try
- {
- routeMessage(message);
- fail("Message has route and should not be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- private IncomingMessage createMessage(String s) throws AMQException
- {
- MessagePublishInfo info = new PublishInfo(new AMQShortString(s));
-
- TransactionalContext trancontext = new NonTransactionalContext(_store, _context, null,
- new LinkedList<RequiredDeliveryException>()
- );
-
- IncomingMessage message = new IncomingMessage(0L, info, trancontext,_protocolSession);
- message.setContentHeaderBody( new ContentHeaderBody());
-
-
- return message;
- }
-
-
- class PublishInfo implements MessagePublishInfo
- {
- AMQShortString _routingkey;
-
- PublishInfo(AMQShortString routingkey)
- {
- _routingkey = routingkey;
- }
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public void setExchange(AMQShortString exchange)
- {
-
- }
-
- public boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return true;
- }
-
- public AMQShortString getRoutingKey()
- {
- return _routingkey;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java
deleted file mode 100644
index 8ce7b4c0e1..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java
+++ /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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import junit.framework.TestCase;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.management.ManagedObject;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-
-import javax.management.openmbean.TabularData;
-import java.util.ArrayList;
-
-/**
- * Unit test class for testing different Exchange MBean operations
- */
-public class ExchangeMBeanTest extends TestCase
-{
- private AMQQueue _queue;
- private QueueRegistry _queueRegistry;
- private VirtualHost _virtualHost;
-
- /**
- * Test for direct exchange mbean
- * @throws Exception
- */
-
- public void testDirectExchangeMBean() throws Exception
- {
- DirectExchange exchange = new DirectExchange();
- exchange.initialise(_virtualHost, ExchangeDefaults.DIRECT_EXCHANGE_NAME, false, 0, true);
- ManagedObject managedObj = exchange.getManagedObject();
- ManagedExchange mbean = (ManagedExchange)managedObj;
-
- mbean.createNewBinding(_queue.getName().toString(), "binding1");
- mbean.createNewBinding(_queue.getName().toString(), "binding2");
-
- TabularData data = mbean.bindings();
- ArrayList<Object> list = new ArrayList<Object>(data.values());
- assertTrue(list.size() == 2);
-
- // test general exchange properties
- assertEquals(mbean.getName(), "amq.direct");
- assertEquals(mbean.getExchangeType(), "direct");
- assertTrue(mbean.getTicketNo() == 0);
- assertTrue(!mbean.isDurable());
- assertTrue(mbean.isAutoDelete());
- }
-
- /**
- * Test for "topic" exchange mbean
- * @throws Exception
- */
-
- public void testTopicExchangeMBean() throws Exception
- {
- TopicExchange exchange = new TopicExchange();
- exchange.initialise(_virtualHost,ExchangeDefaults.TOPIC_EXCHANGE_NAME, false, 0, true);
- ManagedObject managedObj = exchange.getManagedObject();
- ManagedExchange mbean = (ManagedExchange)managedObj;
-
- mbean.createNewBinding(_queue.getName().toString(), "binding1");
- mbean.createNewBinding(_queue.getName().toString(), "binding2");
-
- TabularData data = mbean.bindings();
- ArrayList<Object> list = new ArrayList<Object>(data.values());
- assertTrue(list.size() == 2);
-
- // test general exchange properties
- assertEquals(mbean.getName(), "amq.topic");
- assertEquals(mbean.getExchangeType(), "topic");
- assertTrue(mbean.getTicketNo() == 0);
- assertTrue(!mbean.isDurable());
- assertTrue(mbean.isAutoDelete());
- }
-
- /**
- * Test for "Headers" exchange mbean
- * @throws Exception
- */
-
- public void testHeadersExchangeMBean() throws Exception
- {
- HeadersExchange exchange = new HeadersExchange();
- exchange.initialise(_virtualHost,ExchangeDefaults.HEADERS_EXCHANGE_NAME, false, 0, true);
- ManagedObject managedObj = exchange.getManagedObject();
- ManagedExchange mbean = (ManagedExchange)managedObj;
-
- mbean.createNewBinding(_queue.getName().toString(), "key1=binding1,key2=binding2");
- mbean.createNewBinding(_queue.getName().toString(), "key3=binding3");
-
- TabularData data = mbean.bindings();
- ArrayList<Object> list = new ArrayList<Object>(data.values());
- assertTrue(list.size() == 2);
-
- // test general exchange properties
- assertEquals(mbean.getName(), "amq.match");
- assertEquals(mbean.getExchangeType(), "headers");
- assertTrue(mbean.getTicketNo() == 0);
- assertTrue(!mbean.isDurable());
- assertTrue(mbean.isAutoDelete());
- }
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance(1);
- _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
- _queueRegistry = _virtualHost.getQueueRegistry();
- _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueue"), false, new AMQShortString("ExchangeMBeanTest"), false, _virtualHost,
- null);
- _queueRegistry.registerQueue(_queue);
- }
-
- protected void tearDown()
- {
- ApplicationRegistry.remove(1);
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
deleted file mode 100644
index 86ba96bf5d..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
+++ /dev/null
@@ -1,199 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import java.util.Map;
-import java.util.HashMap;
-
-import junit.framework.TestCase;
-import org.apache.qpid.framing.FieldTable;
-
-/**
- */
-public class HeadersBindingTest extends TestCase
-{
- private FieldTable bindHeaders = new FieldTable();
- private FieldTable matchHeaders = new FieldTable();
-
- public void testDefault_1()
- {
- bindHeaders.setString("A", "Value of A");
-
- matchHeaders.setString("A", "Value of A");
-
- assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testDefault_2()
- {
- bindHeaders.setString("A", "Value of A");
-
- matchHeaders.setString("A", "Value of A");
- matchHeaders.setString("B", "Value of B");
-
- assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testDefault_3()
- {
- bindHeaders.setString("A", "Value of A");
-
- matchHeaders.setString("A", "Altered value of A");
-
- assertFalse(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testAll_1()
- {
- bindHeaders.setString("X-match", "all");
- bindHeaders.setString("A", "Value of A");
-
- matchHeaders.setString("A", "Value of A");
-
- assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testAll_2()
- {
- bindHeaders.setString("X-match", "all");
- bindHeaders.setString("A", "Value of A");
- bindHeaders.setString("B", "Value of B");
-
- matchHeaders.setString("A", "Value of A");
-
- assertFalse(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testAll_3()
- {
- bindHeaders.setString("X-match", "all");
- bindHeaders.setString("A", "Value of A");
- bindHeaders.setString("B", "Value of B");
-
- matchHeaders.setString("A", "Value of A");
- matchHeaders.setString("B", "Value of B");
-
- assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testAll_4()
- {
- bindHeaders.setString("X-match", "all");
- bindHeaders.setString("A", "Value of A");
- bindHeaders.setString("B", "Value of B");
-
- matchHeaders.setString("A", "Value of A");
- matchHeaders.setString("B", "Value of B");
- matchHeaders.setString("C", "Value of C");
-
- assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testAll_5()
- {
- bindHeaders.setString("X-match", "all");
- bindHeaders.setString("A", "Value of A");
- bindHeaders.setString("B", "Value of B");
-
- matchHeaders.setString("A", "Value of A");
- matchHeaders.setString("B", "Altered value of B");
- matchHeaders.setString("C", "Value of C");
-
- assertFalse(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testAny_1()
- {
- bindHeaders.setString("X-match", "any");
- bindHeaders.setString("A", "Value of A");
-
- matchHeaders.setString("A", "Value of A");
-
- assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testAny_2()
- {
- bindHeaders.setString("X-match", "any");
- bindHeaders.setString("A", "Value of A");
- bindHeaders.setString("B", "Value of B");
-
- matchHeaders.setString("A", "Value of A");
-
- assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testAny_3()
- {
- bindHeaders.setString("X-match", "any");
- bindHeaders.setString("A", "Value of A");
- bindHeaders.setString("B", "Value of B");
-
- matchHeaders.setString("A", "Value of A");
- matchHeaders.setString("B", "Value of B");
-
- assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testAny_4()
- {
- bindHeaders.setString("X-match", "any");
- bindHeaders.setString("A", "Value of A");
- bindHeaders.setString("B", "Value of B");
-
- matchHeaders.setString("A", "Value of A");
- matchHeaders.setString("B", "Value of B");
- matchHeaders.setString("C", "Value of C");
-
- assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testAny_5()
- {
- bindHeaders.setString("X-match", "any");
- bindHeaders.setString("A", "Value of A");
- bindHeaders.setString("B", "Value of B");
-
- matchHeaders.setString("A", "Value of A");
- matchHeaders.setString("B", "Altered value of B");
- matchHeaders.setString("C", "Value of C");
-
- assertTrue(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public void testAny_6()
- {
- bindHeaders.setString("X-match", "any");
- bindHeaders.setString("A", "Value of A");
- bindHeaders.setString("B", "Value of B");
-
- matchHeaders.setString("A", "Altered value of A");
- matchHeaders.setString("B", "Altered value of B");
- matchHeaders.setString("C", "Value of C");
-
- assertFalse(new HeadersBinding(bindHeaders).matches(matchHeaders));
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(HeadersBindingTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/InternalTestProtocolSession.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/InternalTestProtocolSession.java
deleted file mode 100644
index da35ddc594..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/InternalTestProtocolSession.java
+++ /dev/null
@@ -1,180 +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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.output.ProtocolOutputConverter;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.AMQChannel;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicInteger;
-
-public class InternalTestProtocolSession extends AMQMinaProtocolSession implements ProtocolOutputConverter
-{
- // ChannelID(LIST) -> LinkedList<Pair>
- final Map<Integer, Map<AMQShortString, LinkedList<DeliveryPair>>> _channelDelivers;
- private AtomicInteger _deliveryCount = new AtomicInteger(0);
-
- public InternalTestProtocolSession() throws AMQException
- {
- super(new TestIoSession(),
- ApplicationRegistry.getInstance().getVirtualHostRegistry(),
- new AMQCodecFactory(true));
-
- _channelDelivers = new HashMap<Integer, Map<AMQShortString, LinkedList<DeliveryPair>>>();
-
- }
-
- public ProtocolOutputConverter getProtocolOutputConverter()
- {
- return this;
- }
-
- public byte getProtocolMajorVersion()
- {
- return (byte) 8;
- }
-
- public byte getProtocolMinorVersion()
- {
- return (byte) 0;
- }
-
- // ***
-
- public List<DeliveryPair> getDelivers(int channelId, AMQShortString consumerTag, int count)
- {
- synchronized (_channelDelivers)
- {
- List<DeliveryPair> all =_channelDelivers.get(channelId).get(consumerTag);
-
- if (all == null)
- {
- return new ArrayList<DeliveryPair>(0);
- }
-
- List<DeliveryPair> msgs = all.subList(0, count);
-
- List<DeliveryPair> response = new ArrayList<DeliveryPair>(msgs);
-
- //Remove the msgs from the receivedList.
- msgs.clear();
-
- return response;
- }
- }
-
- // *** ProtocolOutputConverter Implementation
- public void writeReturn(AMQMessage message, int channelId, int replyCode, AMQShortString replyText) throws AMQException
- {
- }
-
- public void confirmConsumerAutoClose(int channelId, AMQShortString consumerTag)
- {
- }
-
- public void writeDeliver(AMQMessage message, int channelId, long deliveryTag, AMQShortString consumerTag) throws AMQException
- {
- _deliveryCount.incrementAndGet();
-
- synchronized (_channelDelivers)
- {
- Map<AMQShortString, LinkedList<DeliveryPair>> consumers = _channelDelivers.get(channelId);
-
- if (consumers == null)
- {
- consumers = new HashMap<AMQShortString, LinkedList<DeliveryPair>>();
- _channelDelivers.put(channelId, consumers);
- }
-
- LinkedList<DeliveryPair> consumerDelivers = consumers.get(consumerTag);
-
- if (consumerDelivers == null)
- {
- consumerDelivers = new LinkedList<DeliveryPair>();
- consumers.put(consumerTag, consumerDelivers);
- }
-
- consumerDelivers.add(new DeliveryPair(deliveryTag, message));
- }
- }
-
- public void writeGetOk(AMQMessage message, int channelId, long deliveryTag, int queueSize) throws AMQException
- {
- }
-
- public void awaitDelivery(int msgs)
- {
- while (msgs > _deliveryCount.get())
- {
- try
- {
- Thread.sleep(100);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- }
- }
-
- public class DeliveryPair
- {
- private long _deliveryTag;
- private AMQMessage _message;
-
- public DeliveryPair(long deliveryTag, AMQMessage message)
- {
- _deliveryTag = deliveryTag;
- _message = message;
- }
-
- public AMQMessage getMessage()
- {
- return _message;
- }
-
- public long getDeliveryTag()
- {
- return _deliveryTag;
- }
- }
-
- public boolean isClosed()
- {
- return _closed;
- }
-
- public void closeProtocolSession(boolean waitLast)
- {
- // Override as we don't have a real IOSession to close.
- // The alternative is to fully implement the TestIOSession to return a CloseFuture from close();
- // Then the AMQMinaProtocolSession can join on the returning future without a NPE.
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java
deleted file mode 100644
index ff4d3ed9fb..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java
+++ /dev/null
@@ -1,295 +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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import org.apache.mina.common.*;
-import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
-import org.apache.qpid.pool.ReadWriteThreadModel;
-
-import java.net.SocketAddress;
-import java.net.InetSocketAddress;
-import java.util.Set;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Test implementation of IoSession, which is required for some tests. Methods not being used are not implemented,
- * so if this class is being used and some methods are to be used, then please update those.
- */
-public class TestIoSession implements IoSession
-{
- private final ConcurrentMap attributes = new ConcurrentHashMap();
-
- public TestIoSession()
- {
- }
-
- public IoService getService()
- {
- return null;
- }
-
- public IoServiceConfig getServiceConfig()
- {
- return new TestIoConfig();
- }
-
- public IoHandler getHandler()
- {
- return null;
- }
-
- public IoSessionConfig getConfig()
- {
- return null;
- }
-
- public IoFilterChain getFilterChain()
- {
- return null;
- }
-
- public WriteFuture write(Object message)
- {
- return null;
- }
-
- public CloseFuture close()
- {
- return null;
- }
-
- public Object getAttachment()
- {
- return getAttribute("");
- }
-
- public Object setAttachment(Object attachment)
- {
- return setAttribute("",attachment);
- }
-
- public Object getAttribute(String key)
- {
- return attributes.get(key);
- }
-
- public Object setAttribute(String key, Object value)
- {
- return attributes.put(key,value);
- }
-
- public Object setAttribute(String key)
- {
- return attributes.put(key, Boolean.TRUE);
- }
-
- public Object removeAttribute(String key)
- {
- return attributes.remove(key);
- }
-
- public boolean containsAttribute(String key)
- {
- return attributes.containsKey(key);
- }
-
- public Set getAttributeKeys()
- {
- return attributes.keySet();
- }
-
- public TransportType getTransportType()
- {
- return null;
- }
-
- public boolean isConnected()
- {
- return false;
- }
-
- public boolean isClosing()
- {
- return false;
- }
-
- public CloseFuture getCloseFuture()
- {
- return null;
- }
-
- public SocketAddress getRemoteAddress()
- {
- return new InetSocketAddress("127.0.0.1", 1234);
- }
-
- public SocketAddress getLocalAddress()
- {
- return null;
- }
-
- public SocketAddress getServiceAddress()
- {
- return null;
- }
-
- public int getIdleTime(IdleStatus status)
- {
- return 0;
- }
-
- public long getIdleTimeInMillis(IdleStatus status)
- {
- return 0;
- }
-
- public void setIdleTime(IdleStatus status, int idleTime)
- {
-
- }
-
- public int getWriteTimeout()
- {
- return 0;
- }
-
- public long getWriteTimeoutInMillis()
- {
- return 0;
- }
-
- public void setWriteTimeout(int writeTimeout)
- {
-
- }
-
- public TrafficMask getTrafficMask()
- {
- return null;
- }
-
- public void setTrafficMask(TrafficMask trafficMask)
- {
-
- }
-
- public void suspendRead()
- {
-
- }
-
- public void suspendWrite()
- {
-
- }
-
- public void resumeRead()
- {
-
- }
-
- public void resumeWrite()
- {
-
- }
-
- public long getReadBytes()
- {
- return 0;
- }
-
- public long getWrittenBytes()
- {
- return 0;
- }
-
- public long getReadMessages()
- {
- return 0;
- }
-
- public long getWrittenMessages()
- {
- return 0;
- }
-
- public long getWrittenWriteRequests()
- {
- return 0;
- }
-
- public int getScheduledWriteRequests()
- {
- return 0;
- }
-
- public int getScheduledWriteBytes()
- {
- return 0;
- }
-
- public long getCreationTime()
- {
- return 0;
- }
-
- public long getLastIoTime()
- {
- return 0;
- }
-
- public long getLastReadTime()
- {
- return 0;
- }
-
- public long getLastWriteTime()
- {
- return 0;
- }
-
- public boolean isIdle(IdleStatus status)
- {
- return false;
- }
-
- public int getIdleCount(IdleStatus status)
- {
- return 0;
- }
-
- public long getLastIdleTime(IdleStatus status)
- {
- return 0;
- }
-
- /**
- * Test implementation of IoServiceConfig
- */
- private class TestIoConfig extends SocketAcceptorConfig
- {
- public ThreadModel getThreadModel()
- {
- return ReadWriteThreadModel.getInstance();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQPriorityQueueTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQPriorityQueueTest.java
deleted file mode 100644
index aff7af6952..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQPriorityQueueTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package org.apache.qpid.server.queue;
-/*
- *
- * 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 java.util.ArrayList;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.FieldTable;
-import junit.framework.AssertionFailedError;
-
-public class AMQPriorityQueueTest extends SimpleAMQQueueTest
-{
-
- @Override
- protected void setUp() throws Exception
- {
- _arguments = new FieldTable();
- _arguments.put(AMQQueueFactory.X_QPID_PRIORITIES, 3);
- super.setUp();
- }
-
- public void testPriorityOrdering() throws AMQException, InterruptedException
- {
-
- // Enqueue messages in order
- _queue.enqueue(null, createMessage(1L, (byte) 10));
- _queue.enqueue(null, createMessage(2L, (byte) 4));
- _queue.enqueue(null, createMessage(3L, (byte) 0));
-
- // Enqueue messages in reverse order
- _queue.enqueue(null, createMessage(4L, (byte) 0));
- _queue.enqueue(null, createMessage(5L, (byte) 4));
- _queue.enqueue(null, createMessage(6L, (byte) 10));
-
- // Enqueue messages out of order
- _queue.enqueue(null, createMessage(7L, (byte) 4));
- _queue.enqueue(null, createMessage(8L, (byte) 10));
- _queue.enqueue(null, createMessage(9L, (byte) 0));
-
- // Register subscriber
- _queue.registerSubscription(_subscription, false);
- Thread.sleep(150);
-
- ArrayList<QueueEntry> msgs = _subscription.getMessages();
- try
- {
- assertEquals(new Long(1L), msgs.get(0).getMessage().getMessageId());
- assertEquals(new Long(6L), msgs.get(1).getMessage().getMessageId());
- assertEquals(new Long(8L), msgs.get(2).getMessage().getMessageId());
-
- assertEquals(new Long(2L), msgs.get(3).getMessage().getMessageId());
- assertEquals(new Long(5L), msgs.get(4).getMessage().getMessageId());
- assertEquals(new Long(7L), msgs.get(5).getMessage().getMessageId());
-
- assertEquals(new Long(3L), msgs.get(6).getMessage().getMessageId());
- assertEquals(new Long(4L), msgs.get(7).getMessage().getMessageId());
- assertEquals(new Long(9L), msgs.get(8).getMessage().getMessageId());
- }
- catch (AssertionFailedError afe)
- {
- // Show message order on failure.
- int index = 1;
- for (QueueEntry qe : msgs)
- {
- System.err.println(index + ":" + qe.getMessage().getMessageId());
- index++;
- }
-
- throw afe;
- }
-
- }
-
- protected AMQMessage createMessage(Long id, byte i) throws AMQException
- {
- AMQMessage msg = super.createMessage(id);
- BasicContentHeaderProperties props = new BasicContentHeaderProperties();
- props.setPriority(i);
- msg.getContentHeaderBody().properties = props;
- return msg;
- }
-
- protected AMQMessage createMessage(Long id) throws AMQException
- {
- return createMessage(id, (byte) 0);
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java
deleted file mode 100644
index 0ada9cefee..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java
+++ /dev/null
@@ -1,377 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.MemoryMessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.txn.TransactionalContext;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.subscription.SubscriptionFactoryImpl;
-import org.apache.qpid.server.protocol.AMQMinaProtocolSession;
-import org.apache.qpid.server.protocol.InternalTestProtocolSession;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.commons.configuration.CompositeConfiguration;
-import org.apache.mina.common.ByteBuffer;
-
-import javax.management.Notification;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.Collections;
-import java.util.Set;
-
-/** This class tests all the alerts an AMQQueue can throw based on threshold values of different parameters */
-public class AMQQueueAlertTest extends TestCase
-{
- private final static long MAX_MESSAGE_COUNT = 50;
- private final static long MAX_MESSAGE_AGE = 250; // 0.25 sec
- private final static long MAX_MESSAGE_SIZE = 2000; // 2 KB
- private final static long MAX_QUEUE_DEPTH = 10000; // 10 KB
- private AMQQueue _queue;
- private AMQQueueMBean _queueMBean;
- private VirtualHost _virtualHost;
- private AMQMinaProtocolSession _protocolSession;
- private MessageStore _messageStore = new MemoryMessageStore();
- private StoreContext _storeContext = new StoreContext();
- private TransactionalContext _transactionalContext = new NonTransactionalContext(_messageStore, _storeContext,
- null,
- new LinkedList<RequiredDeliveryException>()
- );
- private static final SubscriptionFactoryImpl SUBSCRIPTION_FACTORY = SubscriptionFactoryImpl.INSTANCE;
-
- /**
- * Tests if the alert gets thrown when message count increases the threshold limit
- *
- * @throws Exception
- */
- public void testMessageCountAlert() throws Exception
- {
- _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueue1"), false, new AMQShortString("AMQueueAlertTest"),
- false, _virtualHost,
- null);
- _queueMBean = (AMQQueueMBean) _queue.getManagedObject();
-
- _queueMBean.setMaximumMessageCount(MAX_MESSAGE_COUNT);
-
- sendMessages(MAX_MESSAGE_COUNT, 256l);
- assertTrue(_queueMBean.getMessageCount() == MAX_MESSAGE_COUNT);
-
- Notification lastNotification = _queueMBean.getLastNotification();
- assertNotNull(lastNotification);
-
- String notificationMsg = lastNotification.getMessage();
- assertTrue(notificationMsg.startsWith(NotificationCheck.MESSAGE_COUNT_ALERT.name()));
- }
-
- /**
- * Tests if the Message Size alert gets thrown when message of higher than threshold limit is sent
- *
- * @throws Exception
- */
- public void testMessageSizeAlert() throws Exception
- {
- _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueue2"), false, new AMQShortString("AMQueueAlertTest"),
- false, _virtualHost,
- null);
- _queueMBean = (AMQQueueMBean) _queue.getManagedObject();
- _queueMBean.setMaximumMessageCount(MAX_MESSAGE_COUNT);
- _queueMBean.setMaximumMessageSize(MAX_MESSAGE_SIZE);
-
- sendMessages(1, MAX_MESSAGE_SIZE * 2);
- assertTrue(_queueMBean.getMessageCount() == 1);
-
- Notification lastNotification = _queueMBean.getLastNotification();
- assertNotNull(lastNotification);
-
- String notificationMsg = lastNotification.getMessage();
- assertTrue(notificationMsg.startsWith(NotificationCheck.MESSAGE_SIZE_ALERT.name()));
- }
-
- /**
- * Tests if Queue Depth alert is thrown when queue depth reaches the threshold value
- *
- * Based on FT-402 subbmitted by client
- *
- * @throws Exception
- */
- public void testQueueDepthAlertNoSubscriber() throws Exception
- {
- _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueue3"), false, new AMQShortString("AMQueueAlertTest"),
- false, _virtualHost,
- null);
- _queueMBean = (AMQQueueMBean) _queue.getManagedObject();
- _queueMBean.setMaximumMessageCount(MAX_MESSAGE_COUNT);
- _queueMBean.setMaximumQueueDepth(MAX_QUEUE_DEPTH);
-
- while (_queue.getQueueDepth() < MAX_QUEUE_DEPTH)
- {
- sendMessages(1, MAX_MESSAGE_SIZE);
- }
-
- Notification lastNotification = _queueMBean.getLastNotification();
- assertNotNull(lastNotification);
-
- String notificationMsg = lastNotification.getMessage();
- assertTrue(notificationMsg.startsWith(NotificationCheck.QUEUE_DEPTH_ALERT.name()));
- }
-
- /**
- * Tests if MESSAGE AGE alert is thrown, when a message is in the queue for time higher than threshold value of
- * message age
- *
- * Alternative test to FT-401 provided by client
- *
- * @throws Exception
- */
- public void testMessageAgeAlert() throws Exception
- {
- _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueue4"), false, new AMQShortString("AMQueueAlertTest"),
- false, _virtualHost,
- null);
- _queueMBean = (AMQQueueMBean) _queue.getManagedObject();
- _queueMBean.setMaximumMessageCount(MAX_MESSAGE_COUNT);
- _queueMBean.setMaximumMessageAge(MAX_MESSAGE_AGE);
-
- sendMessages(1, MAX_MESSAGE_SIZE);
-
- // Ensure message sits on queue long enough to age.
- Thread.sleep(MAX_MESSAGE_AGE * 2);
-
- sendMessages(1, MAX_MESSAGE_SIZE);
- assertTrue(_queueMBean.getMessageCount() == 2);
-
- Notification lastNotification = _queueMBean.getLastNotification();
- assertNotNull(lastNotification);
-
- String notificationMsg = lastNotification.getMessage();
- assertTrue(notificationMsg.startsWith(NotificationCheck.MESSAGE_AGE_ALERT.name()));
- }
-
- /*
- This test sends some messages to the queue with subscribers needing message to be acknowledged.
- The messages will not be acknowledged and will be required twice. Why we are checking this is because
- the bug reported said that the queueDepth keeps increasing when messages are requeued.
- // TODO - queue depth now includes unacknowledged messages so does not go down when messages are delivered
-
- The QueueDepth should decrease when messages are delivered from the queue (QPID-408)
- */
- public void testQueueDepthAlertWithSubscribers() throws Exception
- {
- _protocolSession = new InternalTestProtocolSession();
- AMQChannel channel = new AMQChannel(_protocolSession, 2, _messageStore);
- _protocolSession.addChannel(channel);
-
- // Create queue
- _queue = getNewQueue();
- Subscription subscription =
- SUBSCRIPTION_FACTORY.createSubscription(channel.getChannelId(), _protocolSession, new AMQShortString("consumer_tag"), true, null, false, channel.getCreditManager());
-
- _queue.registerSubscription(
- subscription, false);
-
- _queueMBean = (AMQQueueMBean) _queue.getManagedObject();
- _queueMBean.setMaximumMessageCount(9999l); // Set a high value, because this is not being tested
- _queueMBean.setMaximumQueueDepth(MAX_QUEUE_DEPTH);
-
- // Send messages(no of message to be little more than what can cause a Queue_Depth alert)
- int messageCount = Math.round(MAX_QUEUE_DEPTH / MAX_MESSAGE_SIZE) + 10;
- long totalSize = (messageCount * MAX_MESSAGE_SIZE) >> 10;
- sendMessages(messageCount, MAX_MESSAGE_SIZE);
-
- // Check queueDepth. There should be no messages on the queue and as the subscriber is listening
- // so there should be no Queue_Deoth alert raised
- assertEquals(new Long(totalSize), new Long(_queueMBean.getQueueDepth()));
- Notification lastNotification = _queueMBean.getLastNotification();
-// assertNull(lastNotification);
-
- // Kill the subscriber and check for the queue depth values.
- // Messages are unacknowledged, so those should get requeued. All messages should be on the Queue
- _queue.unregisterSubscription(subscription);
- channel.requeue();
-
- assertEquals(new Long(totalSize), new Long(_queueMBean.getQueueDepth()));
-
- lastNotification = _queueMBean.getLastNotification();
- assertNotNull(lastNotification);
- String notificationMsg = lastNotification.getMessage();
- assertTrue(notificationMsg.startsWith(NotificationCheck.QUEUE_DEPTH_ALERT.name()));
-
- // Connect a consumer again and check QueueDepth values. The queue should get emptied.
- // Messages will get delivered but still are unacknowledged.
- Subscription subscription2 =
- SUBSCRIPTION_FACTORY.createSubscription(channel.getChannelId(), _protocolSession, new AMQShortString("consumer_tag"), true, null, false, channel.getCreditManager());
-
- _queue.registerSubscription(
- subscription2, false);
-
- while (_queue.getUndeliveredMessageCount()!= 0)
- {
- Thread.sleep(100);
- }
-// assertEquals(new Long(0), new Long(_queueMBean.getQueueDepth()));
-
- // Kill the subscriber again. Now those messages should get requeued again. Check if the queue depth
- // value is correct.
- _queue.unregisterSubscription(subscription2);
- channel.requeue();
-
- assertEquals(new Long(totalSize), new Long(_queueMBean.getQueueDepth()));
- _protocolSession.closeSession();
-
- // Check the clear queue
- _queueMBean.clearQueue();
- assertEquals(new Long(0), new Long(_queueMBean.getQueueDepth()));
- }
-
- public void testAlertConfiguration() throws AMQException
- {
- // Setup configuration
- CompositeConfiguration config = new CompositeConfiguration();
- config.setProperty("maximumMessageSize", new Long(23));
- config.setProperty("maximumMessageCount", new Long(24));
- config.setProperty("maximumQueueDepth", new Long(25));
- config.setProperty("maximumMessageAge", new Long(26));
-
- // Create queue and set config
- _queue = getNewQueue();
- _queue.configure(config);
-
- // Check alerts and notifications
- Set<NotificationCheck> checks = _queue.getNotificationChecks();
- assertNotNull("No checks found", checks);
- assertFalse("Checks should not be empty", checks.isEmpty());
- assertEquals("Wrong number of checks", 4, checks.size());
- }
-
- protected IncomingMessage message(final boolean immediate, long size) throws AMQException
- {
- MessagePublishInfo publish = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public void setExchange(AMQShortString exchange)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isImmediate()
- {
- return immediate;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return null;
- }
- };
-
- ContentHeaderBody contentHeaderBody = new ContentHeaderBody();
- contentHeaderBody.bodySize = size; // in bytes
- IncomingMessage message = new IncomingMessage(_messageStore.getNewMessageId(), publish, _transactionalContext, _protocolSession);
- message.setContentHeaderBody(contentHeaderBody);
-
- return message;
- }
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance(1);
- _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
- _protocolSession = new InternalTestProtocolSession();
-
- }
-
- protected void tearDown()
- {
- ApplicationRegistry.remove(1);
- }
-
-
- private void sendMessages(long messageCount, final long size) throws AMQException
- {
- IncomingMessage[] messages = new IncomingMessage[(int) messageCount];
- for (int i = 0; i < messages.length; i++)
- {
- messages[i] = message(false, size);
- ArrayList<AMQQueue> qs = new ArrayList<AMQQueue>();
- qs.add(_queue);
- messages[i].enqueue(qs);
- messages[i].routingComplete(_messageStore, new MessageHandleFactory());
-
- }
-
- for (int i = 0; i < messageCount; i++)
- {
- messages[i].addContentBodyFrame(new ContentChunk(){
-
- ByteBuffer _data = ByteBuffer.allocate((int)size);
-
- public int getSize()
- {
- return (int) size;
- }
-
- public ByteBuffer getData()
- {
- return _data;
- }
-
- public void reduceToFit()
- {
-
- }
- });
- messages[i].deliverToQueues();
- }
- }
-
- private AMQQueue getNewQueue() throws AMQException
- {
- return AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueue" + Math.random()),
- false,
- new AMQShortString("AMQueueAlertTest"),
- false,
- _virtualHost, null);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
deleted file mode 100644
index 520e49c56a..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import junit.framework.TestCase;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.AMQException;
-
-public class AMQQueueFactoryTest extends TestCase
-{
- QueueRegistry _queueRegistry;
- VirtualHost _virtualHost;
-
- public void setUp()
- {
- ApplicationRegistry registry = (ApplicationRegistry) ApplicationRegistry.getInstance();
-
- _virtualHost = registry.getVirtualHostRegistry().getVirtualHost("test");
-
- _queueRegistry = _virtualHost.getQueueRegistry();
-
- assertEquals("Queues registered on an empty virtualhost", 0, _queueRegistry.getQueues().size());
- }
-
- public void tearDown()
- {
- assertEquals("Queue was not registered in virtualhost", 1, _queueRegistry.getQueues().size());
- ApplicationRegistry.remove(1);
- }
-
-
- public void testPriorityQueueRegistration()
- {
- FieldTable fieldTable = new FieldTable();
- fieldTable.put(new AMQShortString(AMQQueueFactory.X_QPID_PRIORITIES), 5);
-
- try
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testPriorityQueue"), false, new AMQShortString("owner"), false,
- _virtualHost, fieldTable);
-
- assertEquals("Queue not a priorty queue", AMQPriorityQueue.class, queue.getClass());
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
- }
-
-
- public void testSimpleQueueRegistration()
- {
- try
- {
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueue"), false, new AMQShortString("owner"), false,
- _virtualHost, null);
- assertEquals("Queue not a simple queue", SimpleAMQQueue.class, queue.getClass());
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
deleted file mode 100644
index eab8ad3e2e..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
+++ /dev/null
@@ -1,349 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.subscription.SubscriptionFactory;
-import org.apache.qpid.server.subscription.SubscriptionFactoryImpl;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.protocol.InternalTestProtocolSession;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.txn.TransactionalContext;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.store.MemoryMessageStore;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
-import org.apache.mina.common.ByteBuffer;
-
-import javax.management.JMException;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.Collections;
-
-/**
- * Test class to test AMQQueueMBean attribtues and operations
- */
-public class AMQQueueMBeanTest extends TestCase
-{
- private static long MESSAGE_SIZE = 1000;
- private AMQQueue _queue;
- private AMQQueueMBean _queueMBean;
- private MessageStore _messageStore;
- private StoreContext _storeContext = new StoreContext();
- private TransactionalContext _transactionalContext;
- private VirtualHost _virtualHost;
- private AMQProtocolSession _protocolSession;
- private static final SubscriptionFactoryImpl SUBSCRIPTION_FACTORY = SubscriptionFactoryImpl.INSTANCE;
-
- public void testMessageCountTransient() throws Exception
- {
- int messageCount = 10;
- sendMessages(messageCount, false);
- assertTrue(_queueMBean.getMessageCount() == messageCount);
- assertTrue(_queueMBean.getReceivedMessageCount() == messageCount);
- long queueDepth = (messageCount * MESSAGE_SIZE) >> 10;
- assertTrue(_queueMBean.getQueueDepth() == queueDepth);
-
- _queueMBean.deleteMessageFromTop();
- assertTrue(_queueMBean.getMessageCount() == (messageCount - 1));
- assertTrue(_queueMBean.getReceivedMessageCount() == messageCount);
-
- _queueMBean.clearQueue();
- assertEquals(0,(int)_queueMBean.getMessageCount());
- assertTrue(_queueMBean.getReceivedMessageCount() == messageCount);
-
- //Ensure that the data has been removed from the Store
- verifyBrokerState();
- }
-
- public void testMessageCountPersistent() throws Exception
- {
- int messageCount = 10;
- sendMessages(messageCount, true);
- assertEquals("", messageCount, _queueMBean.getMessageCount().intValue());
- assertTrue(_queueMBean.getReceivedMessageCount() == messageCount);
- long queueDepth = (messageCount * MESSAGE_SIZE) >> 10;
- assertTrue(_queueMBean.getQueueDepth() == queueDepth);
-
- _queueMBean.deleteMessageFromTop();
- assertTrue(_queueMBean.getMessageCount() == (messageCount - 1));
- assertTrue(_queueMBean.getReceivedMessageCount() == messageCount);
-
- _queueMBean.clearQueue();
- assertTrue(_queueMBean.getMessageCount() == 0);
- assertTrue(_queueMBean.getReceivedMessageCount() == messageCount);
-
- //Ensure that the data has been removed from the Store
- verifyBrokerState();
- }
-
- // todo: collect to a general testing class -duplicated from Systest/MessageReturntest
- private void verifyBrokerState()
- {
-
- TestableMemoryMessageStore store = new TestableMemoryMessageStore((MemoryMessageStore) _virtualHost.getMessageStore());
-
- // Unlike MessageReturnTest there is no need for a delay as there this thread does the clean up.
- assertNotNull("ContentBodyMap should not be null", store.getContentBodyMap());
- assertEquals("Expected the store to have no content:" + store.getContentBodyMap(), 0, store.getContentBodyMap().size());
- assertNotNull("MessageMetaDataMap should not be null", store.getMessageMetaDataMap());
- assertEquals("Expected the store to have no metadata:" + store.getMessageMetaDataMap(), 0, store.getMessageMetaDataMap().size());
- }
-
- public void testConsumerCount() throws AMQException
- {
-
- assertTrue(_queue.getActiveConsumerCount() == 0);
- assertTrue(_queueMBean.getActiveConsumerCount() == 0);
-
-
- InternalTestProtocolSession protocolSession = new InternalTestProtocolSession();
- AMQChannel channel = new AMQChannel(protocolSession, 1, _messageStore);
- protocolSession.addChannel(channel);
-
- Subscription subscription =
- SUBSCRIPTION_FACTORY.createSubscription(channel.getChannelId(), protocolSession, new AMQShortString("test"), false, null, false, channel.getCreditManager());
-
- _queue.registerSubscription(subscription, false);
- assertEquals(1,(int)_queueMBean.getActiveConsumerCount());
-
-
- SubscriptionFactory subscriptionFactory = SUBSCRIPTION_FACTORY;
- Subscription s1 = subscriptionFactory.createSubscription(channel.getChannelId(),
- protocolSession,
- new AMQShortString("S1"),
- false,
- null,
- true,
- channel.getCreditManager());
-
- Subscription s2 = subscriptionFactory.createSubscription(channel.getChannelId(),
- protocolSession,
- new AMQShortString("S2"),
- false,
- null,
- true,
- channel.getCreditManager());
- _queue.registerSubscription(s1,false);
- _queue.registerSubscription(s2,false);
- assertTrue(_queueMBean.getActiveConsumerCount() == 3);
- assertTrue(_queueMBean.getConsumerCount() == 3);
-
- s1.close();
- assertEquals(2, (int) _queueMBean.getActiveConsumerCount());
- assertTrue(_queueMBean.getConsumerCount() == 3);
- }
-
- public void testGeneralProperties()
- {
- long maxQueueDepth = 1000; // in bytes
- _queueMBean.setMaximumMessageCount(50000l);
- _queueMBean.setMaximumMessageSize(2000l);
- _queueMBean.setMaximumQueueDepth(maxQueueDepth);
-
- assertTrue(_queueMBean.getMaximumMessageCount() == 50000);
- assertTrue(_queueMBean.getMaximumMessageSize() == 2000);
- assertTrue(_queueMBean.getMaximumQueueDepth() == (maxQueueDepth >> 10));
-
- assertTrue(_queueMBean.getName().equals("testQueue"));
- assertTrue(_queueMBean.getOwner().equals("AMQueueMBeanTest"));
- assertFalse(_queueMBean.isAutoDelete());
- assertFalse(_queueMBean.isDurable());
- }
-
- public void testExceptions() throws Exception
- {
- try
- {
- _queueMBean.viewMessages(0, 3);
- fail();
- }
- catch (JMException ex)
- {
-
- }
-
- try
- {
- _queueMBean.viewMessages(2, 1);
- fail();
- }
- catch (JMException ex)
- {
-
- }
-
- try
- {
- _queueMBean.viewMessages(-1, 1);
- fail();
- }
- catch (JMException ex)
- {
-
- }
-
- IncomingMessage msg = message(false, false);
- long id = msg.getMessageId();
- _queue.clearQueue(_storeContext);
- ArrayList<AMQQueue> qs = new ArrayList<AMQQueue>();
- qs.add(_queue);
- msg.enqueue(qs);
- msg.routingComplete(_messageStore, new MessageHandleFactory());
-
- msg.addContentBodyFrame(new ContentChunk()
- {
- ByteBuffer _data = ByteBuffer.allocate((int)MESSAGE_SIZE);
-
- public int getSize()
- {
- return (int) MESSAGE_SIZE;
- }
-
- public ByteBuffer getData()
- {
- return _data;
- }
-
- public void reduceToFit()
- {
-
- }
- });
- msg.deliverToQueues();
-// _queue.process(_storeContext, new QueueEntry(_queue, msg), false);
- _queueMBean.viewMessageContent(id);
- try
- {
- _queueMBean.viewMessageContent(id + 1);
- fail();
- }
- catch (JMException ex)
- {
-
- }
- }
-
- private IncomingMessage message(final boolean immediate, boolean persistent) throws AMQException
- {
- MessagePublishInfo publish = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public void setExchange(AMQShortString exchange)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isImmediate()
- {
- return immediate;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return null;
- }
- };
-
- ContentHeaderBody contentHeaderBody = new ContentHeaderBody();
- contentHeaderBody.bodySize = MESSAGE_SIZE; // in bytes
- contentHeaderBody.properties = new BasicContentHeaderProperties();
- ((BasicContentHeaderProperties) contentHeaderBody.properties).setDeliveryMode((byte) (persistent ? 2 : 1));
- IncomingMessage msg = new IncomingMessage(_messageStore.getNewMessageId(), publish, _transactionalContext, _protocolSession);
- msg.setContentHeaderBody(contentHeaderBody);
- return msg;
-
- }
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance(1);
- _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
- _messageStore = _virtualHost.getMessageStore();
-
- _transactionalContext = new NonTransactionalContext(_messageStore, _storeContext,
- null,
- new LinkedList<RequiredDeliveryException>()
- );
-
- _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueue"), false, new AMQShortString("AMQueueMBeanTest"), false, _virtualHost,
- null);
- _queueMBean = new AMQQueueMBean(_queue);
-
- _protocolSession = new InternalTestProtocolSession();
- }
-
- public void tearDown()
- {
- ApplicationRegistry.remove(1);
- }
-
- private void sendMessages(int messageCount, boolean persistent) throws AMQException
- {
- for (int i = 0; i < messageCount; i++)
- {
- IncomingMessage currentMessage = message(false, persistent);
- ArrayList<AMQQueue> qs = new ArrayList<AMQQueue>();
- qs.add(_queue);
- currentMessage.enqueue(qs);
-
- // route header
- currentMessage.routingComplete(_messageStore, new MessageHandleFactory());
-
- // Add the body so we have somthing to test later
- currentMessage.addContentBodyFrame(
- _protocolSession.getMethodRegistry()
- .getProtocolVersionMethodConverter()
- .convertToContentChunk(
- new ContentBody(ByteBuffer.allocate((int) MESSAGE_SIZE),
- MESSAGE_SIZE)));
- currentMessage.deliverToQueues();
-
-
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQMessage.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQMessage.java
deleted file mode 100644
index 355ba6a362..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQMessage.java
+++ /dev/null
@@ -1,49 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-
-public class MockAMQMessage extends AMQMessage
-{
- public MockAMQMessage(long messageId)
- throws AMQException
- {
- super(new MockAMQMessageHandle(messageId) ,
- (StoreContext)null,
- (MessagePublishInfo)new MockMessagePublishInfo());
- }
-
- protected MockAMQMessage(AMQMessage msg)
- throws AMQException
- {
- super(msg);
- }
-
-
- @Override
- public long getSize()
- {
- return 0l;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQMessageHandle.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQMessageHandle.java
deleted file mode 100644
index bdb0707c27..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQMessageHandle.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.server.store.StoreContext;
-
-public class MockAMQMessageHandle extends InMemoryMessageHandle
-{
- public MockAMQMessageHandle(final Long messageId)
- {
- super(messageId);
- }
-
- @Override
- public long getBodySize(StoreContext store)
- {
- return 0l;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java
deleted file mode 100644
index cecb430574..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java
+++ /dev/null
@@ -1,313 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.management.ManagedObject;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.AMQException;
-import org.apache.commons.configuration.Configuration;
-
-import java.util.List;
-import java.util.Set;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.LinkedList;
-
-public class MockAMQQueue implements AMQQueue
-{
- private boolean _deleted = false;
-
- public AMQShortString getName()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isDurable()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isAutoDelete()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public AMQShortString getOwner()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public VirtualHost getVirtualHost()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void bind(Exchange exchange, AMQShortString routingKey, FieldTable arguments) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void unBind(Exchange exchange, AMQShortString routingKey, FieldTable arguments) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public List<ExchangeBinding> getExchangeBindings()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void registerSubscription(Subscription subscription, boolean exclusive) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void unregisterSubscription(Subscription subscription) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getConsumerCount()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getActiveConsumerCount()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isUnused()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isEmpty()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getMessageCount()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getUndeliveredMessageCount()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getQueueDepth()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getReceivedMessageCount()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getOldestMessageArrivalTime()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isDeleted()
- {
- return _deleted;
- }
-
- public int delete() throws AMQException
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public QueueEntry enqueue(StoreContext storeContext, AMQMessage message) throws AMQException
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void requeue(StoreContext storeContext, QueueEntry entry) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void dequeue(StoreContext storeContext, QueueEntry entry) throws FailedDequeueException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean resend(QueueEntry entry, Subscription subscription) throws AMQException
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void addQueueDeleteTask(Task task)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public List<QueueEntry> getMessagesOnTheQueue()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public List<QueueEntry> getMessagesOnTheQueue(long fromMessageId, long toMessageId)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public List<Long> getMessagesOnTheQueue(int num)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public List<Long> getMessagesOnTheQueue(int num, int offest)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public QueueEntry getMessageOnTheQueue(long messageId)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void moveMessagesToAnotherQueue(long fromMessageId, long toMessageId, String queueName, StoreContext storeContext)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void copyMessagesToAnotherQueue(long fromMessageId, long toMessageId, String queueName, StoreContext storeContext)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void removeMessagesFromQueue(long fromMessageId, long toMessageId, StoreContext storeContext)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getMaximumMessageSize()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setMaximumMessageSize(long value)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getMaximumMessageCount()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setMaximumMessageCount(long value)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getMaximumQueueDepth()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setMaximumQueueDepth(long value)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getMaximumMessageAge()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setMaximumMessageAge(long maximumMessageAge)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getMinimumAlertRepeatGap()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void deleteMessageFromTop(StoreContext storeContext) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long clearQueue(StoreContext storeContext) throws AMQException
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void removeExpiredIfNoSubscribers() throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public Set<NotificationCheck> getNotificationChecks()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void flushSubscription(Subscription sub) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void deliverAsync(Subscription sub)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void deliverAsync()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void stop()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void configure(Configuration virtualHostDefaultQueueConfiguration)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public ManagedObject getManagedObject()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int compareTo(AMQQueue o)
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockMessagePublishInfo.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockMessagePublishInfo.java
deleted file mode 100644
index 5a5ffaa14d..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockMessagePublishInfo.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.framing.AMQShortString;
-
-public class MockMessagePublishInfo implements MessagePublishInfo
-{
- public AMQShortString getExchange()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setExchange(AMQShortString exchange)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isImmediate()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isMandatory()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public AMQShortString getRoutingKey()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java
deleted file mode 100644
index 37f91e7464..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockQueueEntry.java
+++ /dev/null
@@ -1,197 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.subscription.Subscription;
-
-public class MockQueueEntry implements QueueEntry
-{
-
- private AMQMessage _message;
-
- public boolean acquire()
- {
- return false;
- }
-
- public boolean acquire(Subscription sub)
- {
- return false;
- }
-
- public boolean acquiredBySubscription()
- {
- return false;
- }
-
- public void addStateChangeListener(StateChangeListener listener)
- {
-
- }
-
- public String debugIdentity()
- {
- return null;
- }
-
- public boolean delete()
- {
- return false;
- }
-
- public void dequeue(StoreContext storeContext) throws FailedDequeueException
- {
-
- }
-
- public void discard(StoreContext storeContext) throws FailedDequeueException, MessageCleanupException
- {
-
- }
-
- public void dispose(StoreContext storeContext) throws MessageCleanupException
- {
-
- }
-
- public boolean expired() throws AMQException
- {
- return false;
- }
-
- public Subscription getDeliveredSubscription()
- {
- return null;
- }
-
- public boolean getDeliveredToConsumer()
- {
- return false;
- }
-
- public AMQMessage getMessage()
- {
- return _message;
- }
-
- public AMQQueue getQueue()
- {
- return null;
- }
-
- public long getSize()
- {
- return 0;
- }
-
- public boolean immediateAndNotDelivered()
- {
- return false;
- }
-
- public boolean isAcquired()
- {
- return false;
- }
-
- public boolean isDeleted()
- {
- return false;
- }
-
-
- public boolean isQueueDeleted()
- {
-
- return false;
- }
-
-
- public boolean isRejectedBy(Subscription subscription)
- {
-
- return false;
- }
-
-
- public void reject()
- {
-
-
- }
-
-
- public void reject(Subscription subscription)
- {
-
-
- }
-
-
- public void release()
- {
-
-
- }
-
-
- public boolean removeStateChangeListener(StateChangeListener listener)
- {
-
- return false;
- }
-
-
- public void requeue(StoreContext storeContext) throws AMQException
- {
-
-
- }
-
-
- public void setDeliveredToSubscription()
- {
-
-
- }
-
-
- public void setRedelivered(boolean b)
- {
-
-
- }
-
-
- public int compareTo(QueueEntry o)
- {
-
- return 0;
- }
-
- public void setMessage(AMQMessage msg)
- {
- _message = msg;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java
deleted file mode 100644
index 7a60ed9795..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java
+++ /dev/null
@@ -1,432 +0,0 @@
-package org.apache.qpid.server.queue;
-/*
- *
- * 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 java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.ContentHeaderProperties;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.exchange.DirectExchange;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
-import org.apache.qpid.server.subscription.MockSubscription;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.subscription.SubscriptionImpl;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class SimpleAMQQueueTest extends TestCase
-{
-
- protected SimpleAMQQueue _queue;
- protected VirtualHost _virtualHost;
- protected TestableMemoryMessageStore _store = new TestableMemoryMessageStore();
- protected AMQShortString _qname = new AMQShortString("qname");
- protected AMQShortString _owner = new AMQShortString("owner");
- protected AMQShortString _routingKey = new AMQShortString("routing key");
- protected DirectExchange _exchange = new DirectExchange();
- protected MockSubscription _subscription = new MockSubscription();
- protected FieldTable _arguments = null;
-
- MessagePublishInfo info = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public void setExchange(AMQShortString exchange)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return null;
- }
- };
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- //Create Application Registry for test
- ApplicationRegistry applicationRegistry = (ApplicationRegistry)ApplicationRegistry.getInstance(1);
-
- _virtualHost = new VirtualHost("vhost", _store);
- applicationRegistry.getVirtualHostRegistry().registerVirtualHost(_virtualHost);
-
- _queue = (SimpleAMQQueue) AMQQueueFactory.createAMQQueueImpl(_qname, false, _owner, false, _virtualHost, _arguments);
- }
-
- @Override
- protected void tearDown()
- {
- _queue.stop();
- ApplicationRegistry.remove(1);
- }
-
- public void testCreateQueue() throws AMQException
- {
- _queue.stop();
- try {
- _queue = (SimpleAMQQueue) AMQQueueFactory.createAMQQueueImpl(null, false, _owner, false, _virtualHost, _arguments );
- assertNull("Queue was created", _queue);
- }
- catch (IllegalArgumentException e)
- {
- assertTrue("Exception was not about missing name",
- e.getMessage().contains("name"));
- }
-
- try {
- _queue = new SimpleAMQQueue(_qname, false, _owner, false, null);
- assertNull("Queue was created", _queue);
- }
- catch (IllegalArgumentException e)
- {
- assertTrue("Exception was not about missing vhost",
- e.getMessage().contains("Host"));
- }
-
- _queue = (SimpleAMQQueue) AMQQueueFactory.createAMQQueueImpl(_qname, false, _owner, false,
- _virtualHost, _arguments);
- assertNotNull("Queue was not created", _queue);
- }
-
- public void testGetVirtualHost()
- {
- assertEquals("Virtual host was wrong", _virtualHost, _queue.getVirtualHost());
- }
-
- public void testBinding()
- {
- try
- {
- _queue.bind(_exchange, _routingKey, null);
- assertTrue("Routing key was not bound",
- _exchange.getBindings().containsKey(_routingKey));
- assertEquals("Queue was not bound to key",
- _exchange.getBindings().get(_routingKey).get(0),
- _queue);
- assertEquals("Exchange binding count", 1,
- _queue.getExchangeBindings().size());
- assertEquals("Wrong exchange bound", _routingKey,
- _queue.getExchangeBindings().get(0).getRoutingKey());
- assertEquals("Wrong exchange bound", _exchange,
- _queue.getExchangeBindings().get(0).getExchange());
-
- _queue.unBind(_exchange, _routingKey, null);
- assertFalse("Routing key was still bound",
- _exchange.getBindings().containsKey(_routingKey));
- assertNull("Routing key was not empty",
- _exchange.getBindings().get(_routingKey));
- }
- catch (AMQException e)
- {
- assertNull("Unexpected exception", e);
- }
- }
-
- public void testSubscription() throws AMQException
- {
- // Check adding a subscription adds it to the queue
- _queue.registerSubscription(_subscription, false);
- assertEquals("Subscription did not get queue", _queue,
- _subscription.getQueue());
- assertEquals("Queue does not have consumer", 1,
- _queue.getConsumerCount());
- assertEquals("Queue does not have active consumer", 1,
- _queue.getActiveConsumerCount());
-
- // Check sending a message ends up with the subscriber
- AMQMessage messageA = createMessage(new Long(24));
- _queue.enqueue(null, messageA);
- assertEquals(messageA, _subscription.getLastSeenEntry().getMessage());
-
- // Check removing the subscription removes it's information from the queue
- _queue.unregisterSubscription(_subscription);
- assertTrue("Subscription still had queue", _subscription.isClosed());
- assertFalse("Queue still has consumer", 1 == _queue.getConsumerCount());
- assertFalse("Queue still has active consumer",
- 1 == _queue.getActiveConsumerCount());
-
- AMQMessage messageB = createMessage(new Long (25));
- _queue.enqueue(null, messageB);
- QueueEntry entry = _subscription.getLastSeenEntry();
- assertNull(entry);
- }
-
- public void testQueueNoSubscriber() throws AMQException, InterruptedException
- {
- AMQMessage messageA = createMessage(new Long(24));
- _queue.enqueue(null, messageA);
- _queue.registerSubscription(_subscription, false);
- Thread.sleep(150);
- assertEquals(messageA, _subscription.getLastSeenEntry().getMessage());
- }
-
- public void testExclusiveConsumer() throws AMQException
- {
- // Check adding an exclusive subscription adds it to the queue
- _queue.registerSubscription(_subscription, true);
- assertEquals("Subscription did not get queue", _queue,
- _subscription.getQueue());
- assertEquals("Queue does not have consumer", 1,
- _queue.getConsumerCount());
- assertEquals("Queue does not have active consumer", 1,
- _queue.getActiveConsumerCount());
-
- // Check sending a message ends up with the subscriber
- AMQMessage messageA = createMessage(new Long(24));
- _queue.enqueue(null, messageA);
- assertEquals(messageA, _subscription.getLastSeenEntry().getMessage());
-
- // Check we cannot add a second subscriber to the queue
- Subscription subB = new MockSubscription();
- Exception ex = null;
- try
- {
- _queue.registerSubscription(subB, false);
- }
- catch (AMQException e)
- {
- ex = e;
- }
- assertNotNull(ex);
- assertTrue(ex instanceof AMQException);
-
- // Check we cannot add an exclusive subscriber to a queue with an
- // existing subscription
- _queue.unregisterSubscription(_subscription);
- _queue.registerSubscription(_subscription, false);
- try
- {
- _queue.registerSubscription(subB, true);
- }
- catch (AMQException e)
- {
- ex = e;
- }
- assertNotNull(ex);
- }
-
- public void testAutoDeleteQueue() throws Exception
- {
- _queue.stop();
- _queue = new SimpleAMQQueue(_qname, false, _owner, true, _virtualHost);
- _queue.registerSubscription(_subscription, false);
- AMQMessage message = createMessage(new Long(25));
- _queue.enqueue(null, message);
- _queue.unregisterSubscription(_subscription);
- assertTrue("Queue was not deleted when subscription was removed",
- _queue.isDeleted());
- }
-
- public void testResend() throws Exception
- {
- _queue.registerSubscription(_subscription, false);
- Long id = new Long(26);
- AMQMessage message = createMessage(id);
- _queue.enqueue(null, message);
- QueueEntry entry = _subscription.getLastSeenEntry();
- entry.setRedelivered(true);
- _queue.resend(entry, _subscription);
-
- }
-
- public void testGetFirstMessageId() throws Exception
- {
- // Create message
- Long messageId = new Long(23);
- AMQMessage message = createMessage(messageId);
-
- // Put message on queue
- _queue.enqueue(null, message);
- // Get message id
- Long testmsgid = _queue.getMessagesOnTheQueue(1).get(0);
-
- // Check message id
- assertEquals("Message ID was wrong", messageId, testmsgid);
- }
-
- public void testGetFirstFiveMessageIds() throws Exception
- {
- for (int i = 0 ; i < 5; i++)
- {
- // Create message
- Long messageId = new Long(i);
- AMQMessage message = createMessage(messageId);
- // Put message on queue
- _queue.enqueue(null, message);
- }
- // Get message ids
- List<Long> msgids = _queue.getMessagesOnTheQueue(5);
-
- // Check message id
- for (int i = 0; i < 5; i++)
- {
- Long messageId = new Long(i);
- assertEquals("Message ID was wrong", messageId, msgids.get(i));
- }
- }
-
- public void testGetLastFiveMessageIds() throws Exception
- {
- for (int i = 0 ; i < 10; i++)
- {
- // Create message
- Long messageId = new Long(i);
- AMQMessage message = createMessage(messageId);
- // Put message on queue
- _queue.enqueue(null, message);
- }
- // Get message ids
- List<Long> msgids = _queue.getMessagesOnTheQueue(5, 5);
-
- // Check message id
- for (int i = 0; i < 5; i++)
- {
- Long messageId = new Long(i+5);
- assertEquals("Message ID was wrong", messageId, msgids.get(i));
- }
- }
-
- public void testEnqueueDequeueOfPersistentMessageToNonDurableQueue() throws AMQException
- {
- // Create IncomingMessage and nondurable queue
- NonTransactionalContext txnContext = new NonTransactionalContext(_store, null, null, null);
- IncomingMessage msg = new IncomingMessage(1L, info, txnContext, null);
- ContentHeaderBody contentHeaderBody = new ContentHeaderBody();
- contentHeaderBody.properties = new BasicContentHeaderProperties();
- ((BasicContentHeaderProperties) contentHeaderBody.properties).setDeliveryMode((byte) 2);
- msg.setContentHeaderBody(contentHeaderBody);
- ArrayList<AMQQueue> qs = new ArrayList<AMQQueue>();
-
- // Send persistent message
- qs.add(_queue);
- msg.enqueue(qs);
- msg.routingComplete(_store, new MessageHandleFactory());
- _store.storeMessageMetaData(null, new Long(1L), new MessageMetaData(info, contentHeaderBody, 1));
-
- // Check that it is enqueued
- AMQQueue data = _store.getMessages().get(1L);
- assertNotNull(data);
-
- // Dequeue message
- MockQueueEntry entry = new MockQueueEntry();
- AMQMessage amqmsg = new AMQMessage(1L, _store, new MessageHandleFactory(), txnContext);
-
- entry.setMessage(amqmsg);
- _queue.dequeue(null, entry);
-
- // Check that it is dequeued
- data = _store.getMessages().get(1L);
- assertNull(data);
- }
-
-
- // FIXME: move this to somewhere useful
- private static AMQMessageHandle createMessageHandle(final long messageId, final MessagePublishInfo publishBody)
- {
- final AMQMessageHandle amqMessageHandle = (new MessageHandleFactory()).createMessageHandle(messageId,
- null,
- false);
- try
- {
- amqMessageHandle.setPublishAndContentHeaderBody(new StoreContext(),
- publishBody,
- new ContentHeaderBody()
- {
- public int getSize()
- {
- return 1;
- }
- });
- }
- catch (AMQException e)
- {
- // won't happen
- }
-
-
- return amqMessageHandle;
- }
-
- public class TestMessage extends AMQMessage
- {
- private final long _tag;
- private int _count;
-
- TestMessage(long tag, long messageId, MessagePublishInfo publishBody, StoreContext storeContext)
- throws AMQException
- {
- super(createMessageHandle(messageId, publishBody), storeContext, publishBody);
- _tag = tag;
- }
-
-
- public boolean incrementReference()
- {
- _count++;
- return true;
- }
-
- public void decrementReference(StoreContext context)
- {
- _count--;
- }
-
- void assertCountEquals(int expected)
- {
- assertEquals("Wrong count for message with tag " + _tag, expected, _count);
- }
- }
-
- protected AMQMessage createMessage(Long id) throws AMQException
- {
- AMQMessage messageA = new TestMessage(id, id, info, new StoreContext());
- return messageA;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java
deleted file mode 100644
index f76c652793..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueThreadPoolTest.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import junit.framework.TestCase;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.pool.ReferenceCountingExecutorService;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.AMQException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SimpleAMQQueueThreadPoolTest extends TestCase
-{
-
- public void test() throws AMQException
- {
- VirtualHost test = ApplicationRegistry.getInstance(1).getVirtualHostRegistry().getVirtualHost("test");
-
- try
- {
- SimpleAMQQueue queue = (SimpleAMQQueue) AMQQueueFactory.createAMQQueueImpl(new AMQShortString("test"), false,
- new AMQShortString("owner"),
- false, test, null);
-
- assertTrue("Creation did not start Pool.", !ReferenceCountingExecutorService.getInstance().getPool().isShutdown());
-
- queue.stop();
-
- assertEquals("References still exist", 0, ReferenceCountingExecutorService.getInstance().getReferenceCount());
-
- assertTrue("Stop did not clean up.", ReferenceCountingExecutorService.getInstance().getPool().isShutdown());
- }
- finally
- {
- ApplicationRegistry.remove(1);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java
deleted file mode 100644
index 03fcfc31e9..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java
+++ /dev/null
@@ -1,120 +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.
- *
- */
-package org.apache.qpid.server.registry;
-
-import junit.framework.TestCase;
-import org.apache.qpid.server.util.TestApplicationRegistry;
-
-import java.security.Security;
-import java.security.Provider;
-import java.util.List;
-import java.util.LinkedList;
-
-/**
- * QPID-1390 : Test to validate that the AuthenticationManger succesfully unregisters any new SASL providers when
- * The ApplicationRegistry is closed.
- *
- * This should be expanded as QPID-1399 is implemented.
- */
-public class ApplicationRegistryShutdownTest extends TestCase
-{
-
- ApplicationRegistry _registry;
-
- public void setUp()
- {
- _registry = new TestApplicationRegistry();
- }
-
- /**
- * QPID-1399 : Ensure that the Authentiction manager unregisters any SASL providers created during
- * ApplicationRegistry initialisation.
- *
- */
- public void testAuthenticationMangerCleansUp()
- {
- // Get default providers
- Provider[] defaultProviders = Security.getProviders();
-
- // Register new providers
- try
- {
- _registry.initialise();
- }
- catch (Exception e)
- {
- fail(e.getMessage());
- }
-
- // Get the providers after initialisation
- Provider[] providersAfterInitialisation = Security.getProviders();
-
- // Find the additions
- List additions = new LinkedList();
- for (Provider afterInit : providersAfterInitialisation)
- {
- boolean found = false;
- for (Provider defaultProvider : defaultProviders)
- {
- if (defaultProvider == afterInit)
- {
- found=true;
- break;
- }
- }
-
- // Record added registies
- if (!found)
- {
- additions.add(afterInit);
- }
- }
-
- // Not using isEmpty as that is not in Java 5
- assertTrue("No new SASL mechanisms added by initialisation.", additions.size() != 0 );
-
- //Close the registry which will perform the close the AuthenticationManager
- try
- {
- _registry.close();
- }
- catch (Exception e)
- {
- fail(e.getMessage());
- }
-
- //Validate that the SASL plugins have been removed.
- Provider[] providersAfterClose = Security.getProviders();
-
- assertTrue("No providers unregistered", providersAfterInitialisation.length > providersAfterClose.length);
-
- //Ensure that the additions are not still present after close().
- for (Provider afterClose : providersAfterClose)
- {
- assertFalse("Added provider not unregistered", additions.contains(afterClose));
- }
- }
-
-
-
-
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBeanTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBeanTest.java
deleted file mode 100644
index f3c07d9eb2..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/management/AMQUserManagementMBeanTest.java
+++ /dev/null
@@ -1,152 +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.
- *
- */
-
-package org.apache.qpid.server.security.access.management;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import org.apache.qpid.server.security.auth.database.Base64MD5PasswordFilePrincipalDatabase;
-
-import junit.framework.TestCase;
-
-public class AMQUserManagementMBeanTest extends TestCase
-{
- private Base64MD5PasswordFilePrincipalDatabase _database;
- private AMQUserManagementMBean _amqumMBean;
-
- private static final String _QPID_HOME = System.getProperty("QPID_HOME");
-
- private static final String USERNAME = "testuser";
- private static final String PASSWORD = "password";
- private static final String JMXRIGHTS = "admin";
- private static final String TEMP_PASSWORD_FILE_NAME = "tempPasswordFile.tmp";
- private static final String TEMP_JMXACCESS_FILE_NAME = "tempJMXAccessFile.tmp";
-
- @Override
- protected void setUp() throws Exception
- {
- assertNotNull("QPID_HOME not set", _QPID_HOME);
-
- _database = new Base64MD5PasswordFilePrincipalDatabase();
- _amqumMBean = new AMQUserManagementMBean();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- File testFile = new File(_QPID_HOME + File.separator + TEMP_JMXACCESS_FILE_NAME + ".tmp");
- if (testFile.exists())
- {
- testFile.delete();
- }
-
- testFile = new File(_QPID_HOME + File.separator + TEMP_JMXACCESS_FILE_NAME + ".old");
- if (testFile.exists())
- {
- testFile.delete();
- }
-
- testFile = new File(_QPID_HOME + File.separator + TEMP_PASSWORD_FILE_NAME + ".tmp");
- if (testFile.exists())
- {
- testFile.delete();
- }
-
- testFile = new File(_QPID_HOME + File.separator + TEMP_PASSWORD_FILE_NAME + ".old");
- if (testFile.exists())
- {
- testFile.delete();
- }
- }
-
- public void testDeleteUser()
- {
- loadTestPasswordFile();
- loadTestAccessFile();
-
- boolean deleted = false;
-
- try
- {
- deleted = _amqumMBean.deleteUser(USERNAME);
- }
- catch(Exception e){
- fail("Unable to delete user: " + e.getMessage());
- }
-
- assertTrue(deleted);
- }
-
-
- // ============================ Utility methods =========================
-
- private void loadTestPasswordFile()
- {
- try
- {
- File tempPasswordFile = new File(_QPID_HOME + File.separator + TEMP_PASSWORD_FILE_NAME);
- if (tempPasswordFile.exists())
- {
- tempPasswordFile.delete();
- }
- tempPasswordFile.deleteOnExit();
-
- BufferedWriter passwordWriter = new BufferedWriter(new FileWriter(tempPasswordFile));
- passwordWriter.write(USERNAME + ":" + PASSWORD);
- passwordWriter.newLine();
- passwordWriter.flush();
-
- _database.setPasswordFile(tempPasswordFile.toString());
- _amqumMBean.setPrincipalDatabase(_database);
- }
- catch (IOException e)
- {
- fail("Unable to create test password file: " + e.getMessage());
- }
- }
-
- private void loadTestAccessFile()
- {
- try
- {
- File tempAccessFile = new File(_QPID_HOME + File.separator + TEMP_JMXACCESS_FILE_NAME);
- if (tempAccessFile.exists())
- {
- tempAccessFile.delete();
- }
- tempAccessFile.deleteOnExit();
-
- BufferedWriter accessWriter = new BufferedWriter(new FileWriter(tempAccessFile));
- accessWriter.write(USERNAME + "=" + JMXRIGHTS);
- accessWriter.newLine();
- accessWriter.flush();
-
- _amqumMBean.setAccessFile(tempAccessFile.toString());
- }
- catch (Exception e)
- {
- fail("Unable to create test access file: " + e.getMessage());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabaseTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabaseTest.java
deleted file mode 100644
index b5034d9f5d..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabaseTest.java
+++ /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.
- *
- */
-package org.apache.qpid.server.security.auth.database;
-
-import junit.framework.TestCase;
-
-import javax.security.auth.login.AccountNotFoundException;
-
-import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.security.Principal;
-import java.util.List;
-import java.util.regex.Pattern;
-
-public class Base64MD5PasswordFilePrincipalDatabaseTest extends TestCase
-{
-
- private static final String TEST_COMMENT = "# Test Comment";
- private String USERNAME = "testUser";
- private String _username = this.getClass().getName()+"username";
- private char[] _password = "password".toCharArray();
- private Principal _principal = new UsernamePrincipal(_username);
- private Base64MD5PasswordFilePrincipalDatabase _database;
- private File _pwdFile;
-
- public void setUp() throws Exception
- {
- _database = new Base64MD5PasswordFilePrincipalDatabase();
- _pwdFile = File.createTempFile(this.getClass().getName(), "pwd");
- _pwdFile.deleteOnExit();
- _database.setPasswordFile(_pwdFile.getAbsolutePath());
- }
-
- private File createPasswordFile(int commentLines, int users)
- {
- try
- {
- File testFile = File.createTempFile("Base64MD5PDPDTest","tmp");
- testFile.deleteOnExit();
-
- BufferedWriter writer = new BufferedWriter(new FileWriter(testFile));
-
- for (int i = 0; i < commentLines; i++)
- {
- writer.write(TEST_COMMENT);
- writer.newLine();
- }
-
- for (int i = 0; i < users; i++)
- {
- writer.write(USERNAME + i + ":Password");
- writer.newLine();
- }
-
- writer.flush();
- writer.close();
-
- return testFile;
-
- }
- catch (IOException e)
- {
- fail("Unable to create test password file." + e.getMessage());
- }
-
- return null;
- }
-
- private void loadPasswordFile(File file)
- {
- try
- {
- _database.setPasswordFile(file.toString());
- }
- catch (IOException e)
- {
- fail("Password File was not created." + e.getMessage());
- }
- }
-
- /** **** Test Methods ************** */
-
- public void testCreatePrincipal()
- {
- File testFile = createPasswordFile(1, 0);
-
- loadPasswordFile(testFile);
-
- final String CREATED_PASSWORD = "createdPassword";
- final String CREATED_USERNAME = "createdUser";
-
- Principal principal = new Principal()
- {
- public String getName()
- {
- return CREATED_USERNAME;
- }
- };
-
- assertTrue("New user not created.", _database.createPrincipal(principal, CREATED_PASSWORD.toCharArray()));
-
- loadPasswordFile(testFile);
-
- assertNotNull("Created User was not saved", _database.getUser(CREATED_USERNAME));
-
- assertFalse("Duplicate user created.", _database.createPrincipal(principal, CREATED_PASSWORD.toCharArray()));
-
- testFile.delete();
- }
-
- public void testDeletePrincipal()
- {
- File testFile = createPasswordFile(1, 1);
-
- loadPasswordFile(testFile);
-
- Principal user = _database.getUser(USERNAME + "0");
- assertNotNull("Generated user not present.", user);
-
- try
- {
- _database.deletePrincipal(user);
- }
- catch (AccountNotFoundException e)
- {
- fail("User should be present" + e.getMessage());
- }
-
- try
- {
- _database.deletePrincipal(user);
- fail("User should not be present");
- }
- catch (AccountNotFoundException e)
- {
- //pass
- }
-
- loadPasswordFile(testFile);
-
- try
- {
- _database.deletePrincipal(user);
- fail("User should not be present");
- }
- catch (AccountNotFoundException e)
- {
- //pass
- }
-
- assertNull("Deleted user still present.", _database.getUser(USERNAME + "0"));
-
- testFile.delete();
- }
-
- public void testGetUsers()
- {
- int USER_COUNT = 10;
- File testFile = createPasswordFile(1, USER_COUNT);
-
- loadPasswordFile(testFile);
-
- Principal user = _database.getUser("MISSING_USERNAME");
- assertNull("Missing user present.", user);
-
- List<Principal> users = _database.getUsers();
-
- assertNotNull("Users list is null.", users);
-
- assertEquals(USER_COUNT, users.size());
-
- boolean[] verify = new boolean[USER_COUNT];
- for (int i = 0; i < USER_COUNT; i++)
- {
- Principal principal = users.get(i);
-
- assertNotNull("Generated user not present.", principal);
-
- String name = principal.getName();
-
- int id = Integer.parseInt(name.substring(USERNAME.length()));
-
- assertFalse("Duplicated username retrieve", verify[id]);
- verify[id] = true;
- }
-
- for (int i = 0; i < USER_COUNT; i++)
- {
- assertTrue("User " + i + " missing", verify[i]);
- }
-
- testFile.delete();
- }
-
- public void testUpdatePasswordIsSavedToFile()
- {
-
- File testFile = createPasswordFile(1, 1);
-
- loadPasswordFile(testFile);
-
- Principal testUser = _database.getUser(USERNAME + "0");
-
- assertNotNull(testUser);
-
- String NEW_PASSWORD = "NewPassword";
- String NEW_PASSWORD_HASH = "TmV3UGFzc3dvcmQ=";
- try
- {
- _database.updatePassword(testUser, NEW_PASSWORD.toCharArray());
- }
- catch (AccountNotFoundException e)
- {
- fail(e.toString());
- }
-
- try
- {
- BufferedReader reader = new BufferedReader(new FileReader(testFile));
-
- assertTrue("File has no content", reader.ready());
-
- assertEquals("Comment line has been corrupted.", TEST_COMMENT, reader.readLine());
-
- assertTrue("File is missing user data.", reader.ready());
-
- String userLine = reader.readLine();
-
- String[] result = Pattern.compile(":").split(userLine);
-
- assertEquals("User line not complete '" + userLine + "'", 2, result.length);
-
- assertEquals("Username not correct,", USERNAME + "0", result[0]);
- assertEquals("New Password not correct,", NEW_PASSWORD_HASH, result[1]);
-
- assertFalse("File has more content", reader.ready());
-
- }
- catch (IOException e)
- {
- fail("Unable to valdate file contents due to:" + e.getMessage());
- }
- testFile.delete();
- }
-
- public void testSetPasswordWithMissingFile()
- {
- try
- {
- _database.setPasswordFile("DoesntExist");
- }
- catch (FileNotFoundException fnfe)
- {
- assertTrue(fnfe.getMessage(), fnfe.getMessage().startsWith("Cannot find password file"));
- }
- catch (IOException e)
- {
- fail("Password File was not created." + e.getMessage());
- }
-
- }
-
- public void testSetPasswordWithReadOnlyFile()
- {
-
- File testFile = createPasswordFile(0, 0);
-
- testFile.setReadOnly();
-
- try
- {
- _database.setPasswordFile(testFile.toString());
- }
- catch (FileNotFoundException fnfe)
- {
- assertTrue(fnfe.getMessage().startsWith("Cannot read password file "));
- }
- catch (IOException e)
- {
- fail("Password File was not created." + e.getMessage());
- }
-
- testFile.delete();
- }
-
- public void testCreateUserPrincipal() throws IOException
- {
- _database.createPrincipal(_principal, _password);
- Principal newPrincipal = _database.getUser(_username);
- assertNotNull(newPrincipal);
- assertEquals(_principal.getName(), newPrincipal.getName());
- }
-
- public void testVerifyPassword() throws IOException, AccountNotFoundException
- {
- testCreateUserPrincipal();
- //assertFalse(_pwdDB.verifyPassword(_username, null));
- assertFalse(_database.verifyPassword(_username, new char[]{}));
- assertFalse(_database.verifyPassword(_username, "massword".toCharArray()));
- assertTrue(_database.verifyPassword(_username, _password));
- }
-
- public void testUpdatePassword() throws IOException, AccountNotFoundException
- {
- testCreateUserPrincipal();
- char[] newPwd = "newpassword".toCharArray();
- _database.updatePassword(_principal, newPwd);
- assertFalse(_database.verifyPassword(_username, _password));
- assertTrue(_database.verifyPassword(_username, newPwd));
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/HashedUserTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/HashedUserTest.java
deleted file mode 100644
index a7d951cb5b..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/database/HashedUserTest.java
+++ /dev/null
@@ -1,95 +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.
- *
- */
-package org.apache.qpid.server.security.auth.database;
-
-import junit.framework.TestCase;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
-import java.io.UnsupportedEncodingException;
-
-/*
- Note User is mainly tested by Base64MD5PFPDTest this is just to catch the extra methods
- */
-public class HashedUserTest extends TestCase
-{
-
- String USERNAME = "username";
- String PASSWORD = "password";
- String HASHED_PASSWORD = "cGFzc3dvcmQ=";
-
- public void testToLongArrayConstructor()
- {
- try
- {
- HashedUser user = new HashedUser(new String[]{USERNAME, PASSWORD, USERNAME});
- fail("Error expected");
- }
- catch (IllegalArgumentException e)
- {
- assertEquals("User Data should be length 2, username, password", e.getMessage());
- }
- catch (UnsupportedEncodingException e)
- {
- fail(e.getMessage());
- }
- }
-
- public void testArrayConstructor()
- {
- try
- {
- HashedUser user = new HashedUser(new String[]{USERNAME, HASHED_PASSWORD});
- assertEquals("Username incorrect", USERNAME, user.getName());
- int index = 0;
-
- char[] hash = HASHED_PASSWORD.toCharArray();
-
- try
- {
- for (byte c : user.getEncodedPassword())
- {
- assertEquals("Password incorrect", hash[index], (char) c);
- index++;
- }
- }
- catch (Exception e)
- {
- fail(e.getMessage());
- }
-
- hash = PASSWORD.toCharArray();
-
- index=0;
- for (char c : user.getPassword())
- {
- assertEquals("Password incorrect", hash[index], c);
- index++;
- }
-
- }
- catch (UnsupportedEncodingException e)
- {
- fail(e.getMessage());
- }
- }
-}
-
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslServerTestCase.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslServerTestCase.java
deleted file mode 100644
index f80413d4f8..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/SaslServerTestCase.java
+++ /dev/null
@@ -1,66 +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.
- *
- */
-
-package org.apache.qpid.server.security.auth.sasl;
-
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-
-import junit.framework.TestCase;
-
-public abstract class SaslServerTestCase extends TestCase
-{
- protected SaslServer server;
- protected String username = "u";
- protected String password = "p";
- protected String notpassword = "a";
- protected PrincipalDatabase db = new TestPrincipalDatabase();
-
- protected byte[] correctresponse;
- protected byte[] wrongresponse;
-
- public void testSucessfulAuth() throws SaslException
- {
- byte[] resp = this.server.evaluateResponse(correctresponse);
- assertNull(resp);
- }
-
- public void testFailAuth()
- {
- boolean exceptionCaught = false;
- try
- {
- byte[] resp = this.server.evaluateResponse(wrongresponse);
- }
- catch (SaslException e)
- {
- assertEquals("Authentication failed", e.getCause().getMessage());
- exceptionCaught = true;
- }
- if (!exceptionCaught)
- {
- fail("Should have thrown SaslException");
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/TestPrincipalDatabase.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/TestPrincipalDatabase.java
deleted file mode 100644
index a87c727a9a..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/TestPrincipalDatabase.java
+++ /dev/null
@@ -1,86 +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.
- *
- */
-
-package org.apache.qpid.server.security.auth.sasl;
-
-import java.io.IOException;
-import java.security.Principal;
-import java.util.List;
-import java.util.Map;
-
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.login.AccountNotFoundException;
-
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-import org.apache.qpid.server.security.auth.sasl.AuthenticationProviderInitialiser;
-
-public class TestPrincipalDatabase implements PrincipalDatabase
-{
-
- public boolean createPrincipal(Principal principal, char[] password)
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean deletePrincipal(Principal principal) throws AccountNotFoundException
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public Map<String, AuthenticationProviderInitialiser> getMechanisms()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public Principal getUser(String username)
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<Principal> getUsers()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public void setPassword(Principal principal, PasswordCallback callback) throws IOException,
- AccountNotFoundException
- {
- callback.setPassword("p".toCharArray());
- }
-
- public boolean updatePassword(Principal principal, char[] password) throws AccountNotFoundException
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException
- {
- // TODO Auto-generated method stub
- return false;
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/amqplain/AMQPlainSaslServerTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/amqplain/AMQPlainSaslServerTest.java
deleted file mode 100644
index 6245064bf7..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/amqplain/AMQPlainSaslServerTest.java
+++ /dev/null
@@ -1,43 +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.
- *
- */
-
-package org.apache.qpid.server.security.auth.sasl.amqplain;
-
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.FieldTableFactory;
-import org.apache.qpid.server.security.auth.sasl.SaslServerTestCase;
-import org.apache.qpid.server.security.auth.sasl.UsernamePasswordInitialiser;
-
-public class AMQPlainSaslServerTest extends SaslServerTestCase
-{
- protected void setUp() throws Exception
- {
- UsernamePasswordInitialiser handler = new AmqPlainInitialiser();
- handler.initialise(db);
- this.server = new AmqPlainSaslServer(handler.getCallbackHandler());
- FieldTable table = FieldTableFactory.newFieldTable();
- table.setString("LOGIN", username);
- table.setString("PASSWORD", password);
- correctresponse = table.getDataAsBytes();
- table.setString("PASSWORD", notpassword);
- wrongresponse = table.getDataAsBytes();
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerTest.java
deleted file mode 100644
index 5dd51250dc..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerTest.java
+++ /dev/null
@@ -1,39 +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.
- *
- */
-
-package org.apache.qpid.server.security.auth.sasl.plain;
-
-import org.apache.qpid.server.security.auth.sasl.SaslServerTestCase;
-import org.apache.qpid.server.security.auth.sasl.UsernamePasswordInitialiser;
-
-public class PlainSaslServerTest extends SaslServerTestCase
-{
-
- protected void setUp() throws Exception
- {
- UsernamePasswordInitialiser handler = new PlainInitialiser();
- handler.initialise(db);
- this.server = new PlainSaslServer(handler.getCallbackHandler());
- correctresponse = new byte[]{0x0, (byte) username.charAt(0), 0x0, (byte) password.charAt(0)};
- wrongresponse = new byte[]{0x0,(byte) username.charAt(0), 0x0, (byte) notpassword.charAt(0)};
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreShutdownTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreShutdownTest.java
deleted file mode 100644
index a695a67eea..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreShutdownTest.java
+++ /dev/null
@@ -1,81 +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.
- *
- */
-package org.apache.qpid.server.store;
-
-import org.apache.qpid.server.util.InternalBrokerBaseCase;
-import org.apache.qpid.server.protocol.InternalTestProtocolSession;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-
-import java.util.List;
-
-public class MessageStoreShutdownTest extends InternalBrokerBaseCase
-{
-
- public void test()
- {
- subscribe(_session, _channel, _queue);
-
- try
- {
- publishMessages(_session, _channel, 1);
- }
- catch (AMQException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- fail(e.getMessage());
- }
-
- try
- {
- _registry.close();
- }
- catch (Exception e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- fail(e.getMessage());
- }
-
- assertTrue("Session should now be closed", _session.isClosed());
-
-
- //Test attempting to modify the broker state after session has been closed.
-
- //The Message should have been removed from the unacked list.
-
- //Ack Messages
- List<InternalTestProtocolSession.DeliveryPair> list = _session.getDelivers(_channel.getChannelId(), new AMQShortString("sgen_1"), 1);
-
- InternalTestProtocolSession.DeliveryPair pair = list.get(0);
-
- try
- {
- // The message should now be requeued and so unable to ack it.
- _channel.acknowledgeMessage(pair.getDeliveryTag(), false);
- }
- catch (AMQException e)
- {
- assertEquals("Incorrect exception thrown", "Single ack on delivery tag 1 not known for channel:1", e.getMessage());
- }
-
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java
deleted file mode 100644
index dec4de4cc6..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java
+++ /dev/null
@@ -1,644 +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.
- *
- */
-package org.apache.qpid.server.store;
-
-import junit.framework.TestCase;
-import org.apache.qpid.server.exchange.DirectExchange;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.exchange.ExchangeType;
-import org.apache.qpid.server.exchange.TopicExchange;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.queue.IncomingMessage;
-import org.apache.qpid.server.queue.MessageHandleFactory;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQPriorityQueue;
-import org.apache.qpid.server.queue.SimpleAMQQueue;
-import org.apache.qpid.server.queue.ExchangeBinding;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.server.protocol.InternalTestProtocolSession;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.amqp_8_0.BasicConsumeBodyImpl;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.common.AMQPFilterTypes;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.util.List;
-
-/**
- * This tests the MessageStores by using the available interfaces.
- *
- * This test validates that Exchanges, Queues, Bindings and Messages are persisted correctly.
- */
-public class MessageStoreTest extends TestCase
-{
-
- private static final int DEFAULT_PRIORTY_LEVEL = 5;
- private static final Logger _logger = LoggerFactory.getLogger(MessageStoreTest.class);
-
- public void testMemoryMessageStore()
- {
-
- PropertiesConfiguration config = new PropertiesConfiguration();
-
- config.addProperty("store.class", "org.apache.qpid.server.store.MemoryMessageStore");
-
- runTestWithStore(config);
- }
-
- public void DISABLE_testDerbyMessageStore()
- {
- PropertiesConfiguration config = new PropertiesConfiguration();
-
- config.addProperty("store.environment-path", "derbyDB_MST");
- config.addProperty("store.class", "org.apache.qpid.server.store.DerbyMessageStore");
-
- runTestWithStore(config);
- }
-
- private void reload(Configuration configuration)
- {
- if (_virtualHost != null)
- {
- try
- {
- _virtualHost.close();
- }
- catch (Exception e)
- {
- fail(e.getMessage());
- }
- }
-
- try
- {
- _virtualHost = new VirtualHost(virtualHostName, configuration, null);
- ApplicationRegistry.getInstance().getVirtualHostRegistry().registerVirtualHost(_virtualHost);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
-
- VirtualHost _virtualHost = null;
- String virtualHostName = "MessageStoreTest";
-
- AMQShortString nonDurableExchangeName = new AMQShortString("MST-NonDurableDirectExchange");
- AMQShortString directExchangeName = new AMQShortString("MST-DirectExchange");
- AMQShortString topicExchangeName = new AMQShortString("MST-TopicExchange");
- AMQShortString queueOwner = new AMQShortString("MST");
-
- AMQShortString durablePriorityTopicQueueName = new AMQShortString("MST-PriorityTopicQueue-Durable");
- AMQShortString durableTopicQueueName = new AMQShortString("MST-TopicQueue-Durable");
- AMQShortString priorityTopicQueueName = new AMQShortString("MST-PriorityTopicQueue");
- AMQShortString topicQueueName = new AMQShortString("MST-TopicQueue");
-
- AMQShortString durablePriorityQueueName = new AMQShortString("MST-PriorityQueue-Durable");
- AMQShortString durableQueueName = new AMQShortString("MST-Queue-Durable");
- AMQShortString priorityQueueName = new AMQShortString("MST-PriorityQueue");
- AMQShortString queueName = new AMQShortString("MST-Queue");
-
- AMQShortString directRouting = new AMQShortString("MST-direct");
- AMQShortString topicRouting = new AMQShortString("MST-topic");
-
- protected void setUp()
- {
- ApplicationRegistry.getInstance(1);
- }
-
- protected void tearDown()
- {
- ApplicationRegistry.remove(1);
- }
-
- protected void runTestWithStore(Configuration configuration)
- {
- //Ensure Environment Path is empty
- cleanup(configuration);
-
- //Load the Virtualhost with the required MessageStore
- reload(configuration);
-
- MessageStore messageStore = _virtualHost.getMessageStore();
-
- createAllQueues();
- createAllTopicQueues();
-
- //Register Non-Durable DirectExchange
- Exchange nonDurableExchange = createExchange(DirectExchange.TYPE, nonDurableExchangeName, false);
- bindAllQueuesToExchange(nonDurableExchange, directRouting);
-
- //Register DirectExchange
- Exchange directExchange = createExchange(DirectExchange.TYPE, directExchangeName, true);
- bindAllQueuesToExchange(directExchange, directRouting);
-
- //Register TopicExchange
- Exchange topicExchange = createExchange(TopicExchange.TYPE, topicExchangeName, true);
- bindAllTopicQueuesToExchange(topicExchange, topicRouting);
-
- //Send Message To NonDurable direct Exchange = persistent
- sendMessageOnExchange(nonDurableExchange, directRouting, true);
- // and non-persistent
- sendMessageOnExchange(nonDurableExchange, directRouting, false);
-
- //Send Message To direct Exchange = persistent
- sendMessageOnExchange(directExchange, directRouting, true);
- // and non-persistent
- sendMessageOnExchange(directExchange, directRouting, false);
-
- //Send Message To topic Exchange = persistent
- sendMessageOnExchange(topicExchange, topicRouting, true);
- // and non-persistent
- sendMessageOnExchange(topicExchange, topicRouting, false);
-
- //Ensure all the Queues have four messages (one transient, one persistent) x 2 exchange routings
- validateMessageOnQueues(4, true);
- //Ensure all the topics have two messages (one transient, one persistent)
- validateMessageOnTopics(2, true);
-
- assertEquals("Not all queues correctly registered", 8, _virtualHost.getQueueRegistry().getQueues().size());
-
- if (!messageStore.isPersistent())
- {
- _logger.warn("Unable to test Persistent capabilities of messages store(" + messageStore.getClass() + ") as it is not capable of peristence.");
- return;
- }
-
- //Reload the Virtualhost to test persistence
- _logger.info("Reloading Virtualhost");
-
- VirtualHost original = _virtualHost;
-
- reload(configuration);
-
- assertTrue("Virtualhost has not been reloaded", original != _virtualHost);
-
- validateExchanges();
-
- //Validate Durable Queues still have the persistentn message
- validateMessageOnQueues(2, false);
- //Validate Durable Queues still have the persistentn message
- validateMessageOnTopics(1, false);
-
- //Validate Properties of Binding
- validateBindingProperties();
-
- //Validate Properties of Queues
- validateQueueProperties();
-
- //Validate Non-Durable Queues are gone.
- assertNull("Non-Durable queue still registered:" + priorityQueueName, _virtualHost.getQueueRegistry().getQueue(priorityQueueName));
- assertNull("Non-Durable queue still registered:" + queueName, _virtualHost.getQueueRegistry().getQueue(queueName));
- assertNull("Non-Durable queue still registered:" + priorityTopicQueueName, _virtualHost.getQueueRegistry().getQueue(priorityTopicQueueName));
- assertNull("Non-Durable queue still registered:" + topicQueueName, _virtualHost.getQueueRegistry().getQueue(topicQueueName));
-
- assertEquals("Not all queues correctly registered", 4, _virtualHost.getQueueRegistry().getQueues().size());
- }
-
- private void validateExchanges()
- {
- ExchangeRegistry registry = _virtualHost.getExchangeRegistry();
-
- assertTrue(directExchangeName + " exchange NOT reloaded after failover",
- registry.getExchangeNames().contains(directExchangeName));
- assertTrue(topicExchangeName + " exchange NOT reloaded after failover",
- registry.getExchangeNames().contains(topicExchangeName));
- assertTrue(nonDurableExchangeName + " exchange reloaded after failover",
- !registry.getExchangeNames().contains(nonDurableExchangeName));
-
- // There are 5 required exchanges + our 2 durable queues
- assertEquals("Incorrect number of exchanges available", 5 + 2, registry.getExchangeNames().size());
- }
-
- /** Validates that the Durable queues */
- private void validateBindingProperties()
- {
- QueueRegistry queueRegistry = _virtualHost.getQueueRegistry();
-
- validateBindingProperties(queueRegistry.getQueue(durablePriorityQueueName).getExchangeBindings(), false);
- validateBindingProperties(queueRegistry.getQueue(durablePriorityTopicQueueName).getExchangeBindings(), true);
- validateBindingProperties(queueRegistry.getQueue(durableQueueName).getExchangeBindings(), false);
- validateBindingProperties(queueRegistry.getQueue(durableTopicQueueName).getExchangeBindings(), true);
- }
-
- /**
- * Validate that each queue is bound once.
- *
- * @param bindings the set of bindings to validate
- * @param useSelectors if set validate that the binding has a JMS_SELECTOR argument
- */
- private void validateBindingProperties(List<ExchangeBinding> bindings, boolean useSelectors)
- {
- assertEquals("Each queue should only be bound once.", 1, bindings.size());
-
- ExchangeBinding binding = bindings.get(0);
-
- if (useSelectors)
- {
- assertTrue("Binding does not contain a Selector argument.",
- binding.getArguments().containsKey(AMQPFilterTypes.JMS_SELECTOR.getValue()));
- }
- }
-
- private void validateQueueProperties()
- {
- QueueRegistry queueRegistry = _virtualHost.getQueueRegistry();
-
- validateQueueProperties(queueRegistry.getQueue(durablePriorityQueueName), true);
- validateQueueProperties(queueRegistry.getQueue(durablePriorityTopicQueueName), true);
- validateQueueProperties(queueRegistry.getQueue(durableQueueName), false);
- validateQueueProperties(queueRegistry.getQueue(durableTopicQueueName), false);
-
- }
-
- private void validateQueueProperties(AMQQueue queue, boolean usePriority)
- {
- if (usePriority)
- {
- assertEquals("Queue is no longer a Priority Queue", AMQPriorityQueue.class, queue.getClass());
- assertEquals("Priority Queue does not have set priorities", DEFAULT_PRIORTY_LEVEL, ((AMQPriorityQueue) queue).getPriorities());
- }
- else
- {
- assertEquals("Queue is no longer a Priority Queue", SimpleAMQQueue.class, queue.getClass());
- }
- }
-
- /**
- * Delete the Store Environment path
- *
- * @param configuration The configuration that contains the store environment path.
- */
- private void cleanup(Configuration configuration)
- {
-
- String environment = configuration.getString("store.environment-path");
-
- if (environment != null)
- {
- File environmentPath = new File(environment);
-
- if (environmentPath.exists())
- {
- deleteDirectory(environmentPath);
- }
- }
- }
-
- private void deleteDirectory(File path)
- {
- if (path.isDirectory())
- {
- for (File file : path.listFiles())
- {
- deleteDirectory(file);
- }
- }
- else
- {
- path.delete();
- }
- }
-
- private void sendMessageOnExchange(Exchange directExchange, AMQShortString routingKey, boolean deliveryMode)
- {
- //Set MessagePersustebce
- BasicContentHeaderProperties properties = new BasicContentHeaderProperties();
- properties.setDeliveryMode(deliveryMode ? Integer.valueOf(2).byteValue() : Integer.valueOf(1).byteValue());
- FieldTable headers = properties.getHeaders();
- headers.setString("Test", "MST");
- properties.setHeaders(headers);
-
- MessagePublishInfo messageInfo = new TestMessagePublishInfo(directExchange, false, false, routingKey);
-
- IncomingMessage currentMessage = null;
-
- try
- {
- currentMessage = new IncomingMessage(_virtualHost.getMessageStore().getNewMessageId(),
- messageInfo,
- new NonTransactionalContext(_virtualHost.getMessageStore(),
- new StoreContext(), null, null),
- new InternalTestProtocolSession());
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
-
- currentMessage.setMessageStore(_virtualHost.getMessageStore());
- currentMessage.setExchange(directExchange);
-
- ContentHeaderBody headerBody = new ContentHeaderBody();
- headerBody.classId = BasicConsumeBodyImpl.CLASS_ID;
- headerBody.bodySize = 0;
-
- headerBody.properties = properties;
-
- try
- {
- currentMessage.setContentHeaderBody(headerBody);
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
-
- currentMessage.setExpiration();
-
- try
- {
- currentMessage.route();
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
-
- try
- {
- currentMessage.routingComplete(_virtualHost.getMessageStore(), new MessageHandleFactory());
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
-
- // check and deliver if header says body length is zero
- if (currentMessage.allContentReceived())
- {
- try
- {
- currentMessage.deliverToQueues();
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
- }
- }
-
- private void createAllQueues()
- {
- //Register Durable Priority Queue
- createQueue(durablePriorityQueueName, true, true);
-
- //Register Durable Simple Queue
- createQueue(durableQueueName, false, true);
-
- //Register NON-Durable Priority Queue
- createQueue(priorityQueueName, true, false);
-
- //Register NON-Durable Simple Queue
- createQueue(queueName, false, false);
- }
-
- private void createAllTopicQueues()
- {
- //Register Durable Priority Queue
- createQueue(durablePriorityTopicQueueName, true, true);
-
- //Register Durable Simple Queue
- createQueue(durableTopicQueueName, false, true);
-
- //Register NON-Durable Priority Queue
- createQueue(priorityTopicQueueName, true, false);
-
- //Register NON-Durable Simple Queue
- createQueue(topicQueueName, false, false);
- }
-
- private Exchange createExchange(ExchangeType type, AMQShortString name, boolean durable)
- {
- Exchange exchange = null;
-
- try
- {
- exchange = type.newInstance(_virtualHost, name, durable, 0, false);
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
-
- try
- {
- _virtualHost.getExchangeRegistry().registerExchange(exchange);
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
- return exchange;
- }
-
- private void createQueue(AMQShortString queueName, boolean usePriority, boolean durable)
- {
-
- FieldTable queueArguments = null;
-
- if (usePriority)
- {
- queueArguments = new FieldTable();
- queueArguments.put(AMQQueueFactory.X_QPID_PRIORITIES, DEFAULT_PRIORTY_LEVEL);
- }
-
- AMQQueue queue = null;
-
- //Ideally we would be able to use the QueueDeclareHandler here.
- try
- {
- queue = AMQQueueFactory.createAMQQueueImpl(queueName, durable, queueOwner, false, _virtualHost,
- queueArguments);
-
- validateQueueProperties(queue, usePriority);
-
- if (queue.isDurable() && !queue.isAutoDelete())
- {
- _virtualHost.getMessageStore().createQueue(queue, queueArguments);
- }
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
-
- try
- {
- _virtualHost.getQueueRegistry().registerQueue(queue);
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
-
- }
-
- private void bindAllQueuesToExchange(Exchange exchange, AMQShortString routingKey)
- {
- FieldTable queueArguments = new FieldTable();
- queueArguments.put(AMQQueueFactory.X_QPID_PRIORITIES, DEFAULT_PRIORTY_LEVEL);
-
- QueueRegistry queueRegistry = _virtualHost.getQueueRegistry();
-
- bindQueueToExchange(exchange, routingKey, queueRegistry.getQueue(durablePriorityQueueName), false, queueArguments);
- bindQueueToExchange(exchange, routingKey, queueRegistry.getQueue(durableQueueName), false, null);
- bindQueueToExchange(exchange, routingKey, queueRegistry.getQueue(priorityQueueName), false, queueArguments);
- bindQueueToExchange(exchange, routingKey, queueRegistry.getQueue(queueName), false, null);
- }
-
- private void bindAllTopicQueuesToExchange(Exchange exchange, AMQShortString routingKey)
- {
- FieldTable queueArguments = new FieldTable();
- queueArguments.put(AMQQueueFactory.X_QPID_PRIORITIES, DEFAULT_PRIORTY_LEVEL);
-
- QueueRegistry queueRegistry = _virtualHost.getQueueRegistry();
-
- bindQueueToExchange(exchange, routingKey, queueRegistry.getQueue(durablePriorityTopicQueueName), true, queueArguments);
- bindQueueToExchange(exchange, routingKey, queueRegistry.getQueue(durableTopicQueueName), true, null);
- bindQueueToExchange(exchange, routingKey, queueRegistry.getQueue(priorityTopicQueueName), true, queueArguments);
- bindQueueToExchange(exchange, routingKey, queueRegistry.getQueue(topicQueueName), true, null);
- }
-
-
- protected void bindQueueToExchange(Exchange exchange, AMQShortString routingKey, AMQQueue queue, boolean useSelector, FieldTable queueArguments)
- {
- try
- {
- exchange.registerQueue(queueName, queue, queueArguments);
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
-
- FieldTable bindArguments = null;
-
- if (useSelector)
- {
- bindArguments = new FieldTable();
- bindArguments.put(AMQPFilterTypes.JMS_SELECTOR.getValue(), "Test = 'MST'");
- }
-
- try
- {
- queue.bind(exchange, routingKey, bindArguments);
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
- }
-
- private void validateMessage(long messageCount, boolean allQueues)
- {
- validateMessageOnTopics(messageCount, allQueues);
- validateMessageOnQueues(messageCount, allQueues);
- }
-
- private void validateMessageOnTopics(long messageCount, boolean allQueues)
- {
- validateMessageOnQueue(durablePriorityTopicQueueName, messageCount);
- validateMessageOnQueue(durableTopicQueueName, messageCount);
-
- if (allQueues)
- {
- validateMessageOnQueue(priorityTopicQueueName, messageCount);
- validateMessageOnQueue(topicQueueName, messageCount);
- }
- }
-
- private void validateMessageOnQueues(long messageCount, boolean allQueues)
- {
- validateMessageOnQueue(durablePriorityQueueName, messageCount);
- validateMessageOnQueue(durableQueueName, messageCount);
-
- if (allQueues)
- {
- validateMessageOnQueue(priorityQueueName, messageCount);
- validateMessageOnQueue(queueName, messageCount);
- }
- }
-
- private void validateMessageOnQueue(AMQShortString queueName, long messageCount)
- {
- AMQQueue queue = _virtualHost.getQueueRegistry().getQueue(queueName);
-
- assertNotNull("Queue(" + queueName + ") not correctly registered:", queue);
-
- assertEquals("Incorrect Message count on queue:" + queueName, messageCount, queue.getMessageCount());
- }
-
- private class TestMessagePublishInfo implements MessagePublishInfo
- {
-
- Exchange _exchange;
- boolean _immediate;
- boolean _mandatory;
- AMQShortString _routingKey;
-
- TestMessagePublishInfo(Exchange exchange, boolean immediate, boolean mandatory, AMQShortString routingKey)
- {
- _exchange = exchange;
- _immediate = immediate;
- _mandatory = mandatory;
- _routingKey = routingKey;
- }
-
- public AMQShortString getExchange()
- {
- return _exchange.getName();
- }
-
- public void setExchange(AMQShortString exchange)
- {
- //no-op
- }
-
- public boolean isImmediate()
- {
- return _immediate;
- }
-
- public boolean isMandatory()
- {
- return _mandatory;
- }
-
- public AMQShortString getRoutingKey()
- {
- return _routingKey;
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java
deleted file mode 100644
index 9146fe88ae..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java
+++ /dev/null
@@ -1,92 +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.
- *
- */
-package org.apache.qpid.server.store;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.MessageMetaData;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * Adds some extra methods to the memory message store for testing purposes.
- */
-public class TestableMemoryMessageStore extends MemoryMessageStore
-{
-
- MemoryMessageStore _mms = null;
- private HashMap<Long, AMQQueue> _messages = new HashMap<Long, AMQQueue>();
-
- public TestableMemoryMessageStore(MemoryMessageStore mms)
- {
- _mms = mms;
- }
-
- public TestableMemoryMessageStore()
- {
- _metaDataMap = new ConcurrentHashMap<Long, MessageMetaData>();
- _contentBodyMap = new ConcurrentHashMap<Long, List<ContentChunk>>();
- }
-
- public ConcurrentMap<Long, MessageMetaData> getMessageMetaDataMap()
- {
- if (_mms != null)
- {
- return _mms._metaDataMap;
- }
- else
- {
- return _metaDataMap;
- }
- }
-
- public ConcurrentMap<Long, List<ContentChunk>> getContentBodyMap()
- {
- if (_mms != null)
- {
- return _mms._contentBodyMap;
- }
- else
- {
- return _contentBodyMap;
- }
- }
-
- public void enqueueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException
- {
- getMessages().put(messageId, queue);
- }
-
- public void dequeueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException
- {
- getMessages().remove(messageId);
- }
-
- public HashMap<Long, AMQQueue> getMessages()
- {
- return _messages;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java
deleted file mode 100644
index 33fd669d5c..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/MockSubscription.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package org.apache.qpid.server.subscription;
-
-/*
-*
-* 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 java.util.ArrayList;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.queue.QueueEntry.SubscriptionAcquiredState;
-
-public class MockSubscription implements Subscription
-{
-
- private boolean _closed = false;
- private AMQShortString tag = new AMQShortString("mocktag");
- private AMQQueue queue = null;
- private StateListener _listener = null;
- private QueueEntry lastSeen = null;
- private State _state = State.ACTIVE;
- private ArrayList<QueueEntry> messages = new ArrayList<QueueEntry>();
- private final Lock _stateChangeLock = new ReentrantLock();
-
- public void close()
- {
- _closed = true;
- if (_listener != null)
- {
- _listener.stateChange(this, _state, State.CLOSED);
- }
- _state = State.CLOSED;
- }
-
- public boolean filtersMessages()
- {
- return false;
- }
-
- public AMQChannel getChannel()
- {
- return null;
- }
-
- public AMQShortString getConsumerTag()
- {
- return tag ;
- }
-
- public QueueEntry getLastSeenEntry()
- {
- return lastSeen;
- }
-
- public SubscriptionAcquiredState getOwningState()
- {
- return new QueueEntry.SubscriptionAcquiredState(this);
- }
-
- public AMQQueue getQueue()
- {
- return queue;
- }
-
- public void getSendLock()
- {
- _stateChangeLock.lock();
- }
-
- public boolean hasInterest(QueueEntry msg)
- {
- return true;
- }
-
- public boolean isActive()
- {
- return true;
- }
-
- public boolean isAutoClose()
- {
- return false;
- }
-
- public boolean isBrowser()
- {
- return false;
- }
-
- public boolean isClosed()
- {
- return _closed;
- }
-
- public boolean isSuspended()
- {
- return false;
- }
-
- public void queueDeleted(AMQQueue queue)
- {
- }
-
- public void releaseSendLock()
- {
- _stateChangeLock.unlock();
- }
-
- public void resend(QueueEntry entry) throws AMQException
- {
- }
-
- public void restoreCredit(QueueEntry queueEntry)
- {
- }
-
- public void send(QueueEntry msg) throws AMQException
- {
- lastSeen = msg;
- messages.add(msg);
- }
-
- public boolean setLastSeenEntry(QueueEntry expected, QueueEntry newValue)
- {
- boolean result = false;
- if (expected != null)
- {
- result = (expected.equals(lastSeen));
- }
- lastSeen = newValue;
- return result;
- }
-
- public void setQueue(AMQQueue queue)
- {
- this.queue = queue;
- }
-
- public void setStateListener(StateListener listener)
- {
- this._listener = listener;
- }
-
- public State getState()
- {
- return _state;
- }
-
- public boolean wouldSuspend(QueueEntry msg)
- {
- return false;
- }
-
- public ArrayList<QueueEntry> getMessages()
- {
- return messages;
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/QueueBrowserUsesNoAckTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/QueueBrowserUsesNoAckTest.java
deleted file mode 100644
index d0db4ebd38..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/subscription/QueueBrowserUsesNoAckTest.java
+++ /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.
- *
- */
-package org.apache.qpid.server.subscription;
-
-import org.apache.qpid.server.util.InternalBrokerBaseCase;
-import org.apache.qpid.server.protocol.InternalTestProtocolSession;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.AMQException;
-
-import java.util.List;
-
-public class QueueBrowserUsesNoAckTest extends InternalBrokerBaseCase
-{
-
- public void testQueueBrowserUsesNoAck() throws AMQException
- {
- int sendMessageCount = 2;
- int prefetch = 1;
-
- //Check store is empty
- checkStoreContents(0);
-
- //Send required messsages to the queue
- publishMessages(_session, _channel, sendMessageCount);
-
- //Ensure they are stored
- checkStoreContents(sendMessageCount);
-
- //Check that there are no unacked messages
- assertEquals("Channel should have no unacked msgs ", 0,
- _channel.getUnacknowledgedMessageMap().size());
-
- //Set the prefetch on the session to be less than the sent messages
- _channel.setCredit(0, prefetch);
-
- //browse the queue
- AMQShortString browser = browse(_channel, _queue);
-
- _queue.deliverAsync();
-
- //Wait for messages to fill the prefetch
- _session.awaitDelivery(prefetch);
-
- //Get those messages
- List<InternalTestProtocolSession.DeliveryPair> messages =
- _session.getDelivers(_channel.getChannelId(), browser,
- prefetch);
-
- //Ensure we recevied the prefetched messages
- assertEquals(prefetch, messages.size());
-
- //Check the process didn't suspend the subscription as this would
- // indicate we are using the prefetch credit. i.e. using acks not No-Ack
- assertTrue("The subscription has been suspended",
- !_channel.getSubscription(browser).getState()
- .equals(Subscription.State.SUSPENDED));
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java
deleted file mode 100644
index 509ea817fd..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java
+++ /dev/null
@@ -1,209 +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.
- *
- */
-package org.apache.qpid.server.util;
-
-import junit.framework.TestCase;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.protocol.InternalTestProtocolSession;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.ConsumerTagNotUniqueException;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.util.MockChannel;
-import org.apache.qpid.common.AMQPFilterTypes;
-import org.apache.qpid.exchange.ExchangeDefaults;
-
-public class InternalBrokerBaseCase extends TestCase
-{
- protected IApplicationRegistry _registry;
- protected MessageStore _messageStore;
- protected MockChannel _channel;
- protected InternalTestProtocolSession _session;
- protected VirtualHost _virtualHost;
- protected StoreContext _storeContext = new StoreContext();
- protected AMQQueue _queue;
- protected AMQShortString QUEUE_NAME;
-
- public void setUp() throws Exception
- {
- super.setUp();
- _registry = new TestApplicationRegistry();
- ApplicationRegistry.initialise(_registry);
- _virtualHost = _registry.getVirtualHostRegistry().getVirtualHost("test");
-
- _messageStore = _virtualHost.getMessageStore();
-
- QUEUE_NAME = new AMQShortString("test");
- _queue = AMQQueueFactory.createAMQQueueImpl(QUEUE_NAME, false, new AMQShortString("testowner"),
- false, _virtualHost, null);
-
- _virtualHost.getQueueRegistry().registerQueue(_queue);
-
- Exchange defaultExchange = _virtualHost.getExchangeRegistry().getDefaultExchange();
-
- _queue.bind(defaultExchange, QUEUE_NAME, null);
-
- _session = new InternalTestProtocolSession();
-
- _session.setVirtualHost(_virtualHost);
-
- _channel = new MockChannel(_session, 1, _messageStore);
-
- _session.addChannel(_channel);
- }
-
- public void tearDown() throws Exception
- {
- ApplicationRegistry.remove(1);
- super.tearDown();
- }
-
- protected void checkStoreContents(int messageCount)
- {
- assertEquals("Message header count incorrect in the MetaDataMap", messageCount, ((TestableMemoryMessageStore) _messageStore).getMessageMetaDataMap().size());
-
- //The above publish message is sufficiently small not to fit in the header so no Body is required.
- //assertEquals("Message body count incorrect in the ContentBodyMap", messageCount, ((TestableMemoryMessageStore) _messageStore).getContentBodyMap().size());
- }
-
- protected AMQShortString subscribe(InternalTestProtocolSession session, AMQChannel channel, AMQQueue queue)
- {
- try
- {
- return channel.subscribeToQueue(null, queue, true, null, false, true);
- }
- catch (AMQException e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- catch (ConsumerTagNotUniqueException e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- //Keep the compiler happy
- return null;
- }
-
- protected AMQShortString browse(AMQChannel channel, AMQQueue queue)
- {
- try
- {
- FieldTable filters = new FieldTable();
- filters.put(AMQPFilterTypes.NO_CONSUME.getValue(), true);
-
- return channel.subscribeToQueue(null, queue, true, filters, false, true);
- }
- catch (AMQException e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- catch (ConsumerTagNotUniqueException e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- //Keep the compiler happy
- return null;
- }
-
- public void publishMessages(InternalTestProtocolSession session, AMQChannel channel, int messages) throws AMQException
- {
- MessagePublishInfo info = new MessagePublishInfo()
- {
- public AMQShortString getExchange()
- {
- return ExchangeDefaults.DEFAULT_EXCHANGE_NAME;
- }
-
- public void setExchange(AMQShortString exchange)
- {
-
- }
-
- public boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return QUEUE_NAME;
- }
- };
-
- for (int count = 0; count < messages; count++)
- {
- channel.setPublishFrame(info, _virtualHost.getExchangeRegistry().getExchange(info.getExchange()));
-
- //Set the body size
- ContentHeaderBody _headerBody = new ContentHeaderBody();
- _headerBody.bodySize = 0;
-
- //Set Minimum properties
- BasicContentHeaderProperties properties = new BasicContentHeaderProperties();
-
- properties.setExpiration(0L);
- properties.setTimestamp(System.currentTimeMillis());
-
- //Make Message Persistent
- properties.setDeliveryMode((byte) 2);
-
- _headerBody.properties = properties;
-
- channel.publishContentHeader(_headerBody);
- }
-
- }
-
- public void acknowledge(AMQChannel channel, long deliveryTag)
- {
- try
- {
- channel.acknowledgeMessage(deliveryTag, false);
- }
- catch (AMQException e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java
deleted file mode 100644
index c7db51016e..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java
+++ /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.
- *
- */
-package org.apache.qpid.server.util;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-public class LoggingProxyTest extends TestCase
-{
- static interface IFoo {
- void foo();
- void foo(int i, Collection c);
- String bar();
- String bar(String s, List l);
- }
-
- static class Foo implements IFoo {
- public void foo()
- {
- }
-
- public void foo(int i, Collection c)
- {
- }
-
- public String bar()
- {
- return null;
- }
-
- public String bar(String s, List l)
- {
- return "ha";
- }
- }
-
- public void testSimple() {
- LoggingProxy proxy = new LoggingProxy(new Foo(), 20);
- IFoo foo = (IFoo)proxy.getProxy(IFoo.class);
- foo.foo();
- assertEquals(2, proxy.getBufferSize());
- assertTrue(proxy.getBuffer().get(0).toString().matches(".*: foo\\(\\) entered$"));
- assertTrue(proxy.getBuffer().get(1).toString().matches(".*: foo\\(\\) returned$"));
-
- foo.foo(3, Arrays.asList(0, 1, 2));
- assertEquals(4, proxy.getBufferSize());
- assertTrue(proxy.getBuffer().get(2).toString().matches(".*: foo\\(\\[3, \\[0, 1, 2\\]\\]\\) entered$"));
- assertTrue(proxy.getBuffer().get(3).toString().matches(".*: foo\\(\\) returned$"));
-
- foo.bar();
- assertEquals(6, proxy.getBufferSize());
- assertTrue(proxy.getBuffer().get(4).toString().matches(".*: bar\\(\\) entered$"));
- assertTrue(proxy.getBuffer().get(5).toString().matches(".*: bar\\(\\) returned null$"));
-
- foo.bar("hello", Arrays.asList(1, 2, 3));
- assertEquals(8, proxy.getBufferSize());
- assertTrue(proxy.getBuffer().get(6).toString().matches(".*: bar\\(\\[hello, \\[1, 2, 3\\]\\]\\) entered$"));
- assertTrue(proxy.getBuffer().get(7).toString().matches(".*: bar\\(\\) returned ha$"));
-
- proxy.dump();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(LoggingProxyTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java
deleted file mode 100644
index 15449dc613..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java
+++ /dev/null
@@ -1,123 +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.
- *
- */
-package org.apache.qpid.server.util;
-
-import org.apache.commons.configuration.MapConfiguration;
-import org.apache.qpid.server.exchange.ExchangeFactory;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.management.NoopManagedObjectRegistry;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.plugins.AllowAll;
-import org.apache.qpid.server.security.auth.database.PropertiesPrincipalDatabaseManager;
-import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Properties;
-import java.util.Arrays;
-
-public class TestApplicationRegistry extends ApplicationRegistry
-{
- private QueueRegistry _queueRegistry;
-
- private ExchangeRegistry _exchangeRegistry;
-
- private ExchangeFactory _exchangeFactory;
-
- private MessageStore _messageStore;
-
- private VirtualHost _vHost;
-
-
- public TestApplicationRegistry()
- {
- super(new MapConfiguration(new HashMap()));
- }
-
- public void initialise() throws Exception
- {
- Properties users = new Properties();
-
- users.put("guest", "guest");
-
- _databaseManager = new PropertiesPrincipalDatabaseManager("default", users);
-
- _accessManager = new AllowAll();
-
- _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);
-
- _managedObjectRegistry = new NoopManagedObjectRegistry();
-
- _messageStore = new TestableMemoryMessageStore();
-
- _virtualHostRegistry = new VirtualHostRegistry();
-
- _vHost = new VirtualHost("test", _messageStore);
-
- _virtualHostRegistry.registerVirtualHost(_vHost);
-
- _queueRegistry = _vHost.getQueueRegistry();
- _exchangeFactory = _vHost.getExchangeFactory();
- _exchangeRegistry = _vHost.getExchangeRegistry();
-
- _configuration.addProperty("heartbeat.delay", 10 * 60); // 10 minutes
- }
-
- public QueueRegistry getQueueRegistry()
- {
- return _queueRegistry;
- }
-
- public ExchangeRegistry getExchangeRegistry()
- {
- return _exchangeRegistry;
- }
-
- public ExchangeFactory getExchangeFactory()
- {
- return _exchangeFactory;
- }
-
- public Collection<String> getVirtualHostNames()
- {
- String[] hosts = {"test"};
- return Arrays.asList(hosts);
- }
-
- public void setAccessManager(ACLPlugin newManager)
- {
- _accessManager = newManager;
- }
-
- public MessageStore getMessageStore()
- {
- return _messageStore;
- }
-
-}
-
-
diff --git a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/util/MockChannel.java b/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/util/MockChannel.java
deleted file mode 100644
index 447d09429d..0000000000
--- a/M4-RCs/qpid/java/broker/src/test/java/org/apache/qpid/util/MockChannel.java
+++ /dev/null
@@ -1,43 +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.
- *
- */
-package org.apache.qpid.util;
-
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-
-public class MockChannel extends AMQChannel
-{
- public MockChannel(AMQProtocolSession session, int channelId, MessageStore messageStore)
- throws AMQException
- {
- super(session, channelId, messageStore);
- }
-
- public Subscription getSubscription(AMQShortString subscription)
- {
- return _tag2SubscriptionMap.get(subscription);
- }
-
-}
diff --git a/M4-RCs/qpid/java/build.deps b/M4-RCs/qpid/java/build.deps
deleted file mode 100644
index f9c4004aec..0000000000
--- a/M4-RCs/qpid/java/build.deps
+++ /dev/null
@@ -1,104 +0,0 @@
-backport-util-concurrent=lib/backport-util-concurrent-2.2.jar
-
-commons-cli=lib/commons-cli-1.0.jar
-commons-codec=lib/commons-codec-1.3.jar
-commons-collections=lib/commons-collections-3.2.jar
-commons-configuration=lib/commons-configuration-1.2.jar
-commons-lang=lib/commons-lang-2.2.jar
-commons-logging=lib/commons-logging-1.0.4.jar
-commons-pool=lib/commons-pool-1.4.jar
-
-geronimo-jms=lib/geronimo-jms_1.1_spec-1.0.jar
-
-junit=lib/junit-3.8.1.jar
-junit4=lib/junit-4.4.jar
-
-jline=lib/jline-0.9.94.jar
-
-log4j=lib/log4j-1.2.12.jar
-
-mina-core=lib/mina-core-1.0.1.jar
-mina-filter-ssl=lib/mina-filter-ssl-1.0.1.jar
-
-slf4j-api=lib/slf4j-api-1.4.0.jar
-slf4j-log4j=lib/slf4j-log4j12-1.4.0.jar
-
-xalan=lib/xalan-2.7.0.jar
-
-osgi-core=lib/org.osgi.core-1.0.0.jar
-felix-framework=lib/org.apache.felix.framework-1.0.0.jar
-
-geronimo-servlet=lib/geronimo-servlet_2.5_spec-1.2.jar
-felix.libs=${osgi-core} ${felix-framework}
-
-common.libs=${slf4j-api} ${backport-util-concurrent} ${mina-core} \
- ${mina-filter-ssl} ${commons-codec} ${commons-lang} ${commons-collections} \
- ${commons-configuration}
-client.libs=${common.libs} ${geronimo-jms}
-tools.libs=${client.libs}
-broker.libs=${common.libs} ${commons-cli} ${commons-logging} ${log4j} \
- ${slf4j-log4j} ${xalan} ${felix.libs} ${build.lib}/${project.name}-common-${project.version}.jar
-
-broker-plugins.libs=${common.libs} ${felix.libs}
-management-client.libs=${client.libs} ${commons-pool} ${log4j} ${slf4j-log4j} ${geronimo-servlet}
-
-junit-toolkit.libs=${log4j} ${junit} ${slf4j-api}
-test.libs=${slf4j-log4j} ${junit-toolkit.libs}
-systests.libs=${client.libs} ${test.libs} ${broker.libs}
-perftests.libs=${systests.libs}
-integrationtests.libs=${systests.libs}
-
-client-example.libs=${client.libs}
-testkit.libs=${client.libs}
-
-ibm-icu=lib/com.ibm.icu_3.4.4.jar
-ecl-core-jface=lib/org.eclipse.jface_3.2.0.jar
-ecl-core-commands=lib/org.eclipse.core.commands_3.2.0.jar
-ecl-core-contenttype=lib/org.eclipse.core.contenttype_3.2.0.jar
-ecl-core-expressions=lib/org.eclipse.core.expressions_3.2.0.jar
-ecl-core-jobs=lib/org.eclipse.core.jobs_3.2.0.jar
-ecl-core-runtime=lib/org.eclipse.core.runtime_3.2.0.jar
-ecl-core-runtime-compat-auth=lib/org.eclipse.core.runtime.compatibility.auth_3.2.0.jar
-ecl-core-runtime-compat-registry=lib/org.eclipse.core.runtime.compatibility.registry_3.2.0.jar
-ecl-equinox-common=lib/org.eclipse.equinox.common_3.2.0.jar
-ecl-equinox-prefs=lib/org.eclipse.equinox.preferences_3.2.0.jar
-ecl-equinox-registry=lib/org.eclipse.equinox.registry_3.2.0.jar
-ecl-help=lib/org.eclipse.help_3.2.0.jar
-ecl-osgi=lib/org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
-ecl-swt=lib/org.eclipse.swt_3.4.1.v3449c.jar
-ecl-swt-win32-win32-x86=lib/org.eclipse.swt.win32.win32.x86_3.2.0.jar
-ecl-unix-shared=lib/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
-ecl-swt-linux-gtk-x86=lib/org.eclipse.swt.gtk.linux.x86_3.4.1.v3449c.jar \
- lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/*
-ecl-swt-macosx=lib/org.eclipse.swt.carbon.macosx_3.4.1.v3449c.jar \
- lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/*
-
-ecl-ui=lib/org.eclipse.ui_3.2.0.jar
-ecl-ui-forms=lib/org.eclipse.ui.forms_3.2.0.jar
-ecl-ui-workbench=lib/org.eclipse.ui.workbench_3.2.1.jar
-
-management-eclipse-plugin.core-libs=${ibm-icu} ${ecl-core-jface} \
- ${ecl-core-commands} ${ecl-core-contenttype} ${ecl-core-expressions} \
- ${ecl-core-jobs} ${ecl-core-runtime} ${ecl-core-runtime-compat-auth} \
- ${ecl-core-runtime-compat-registry} ${ecl-equinox-common} \
- ${ecl-equinox-prefs} ${ecl-equinox-registry} ${ecl-help} ${ecl-osgi} \
- ${ecl-swt} ${ecl-ui} ${ecl-ui-forms} ${ecl-ui-workbench}
-
-management-eclipse-plugin-win32-win32-x86.libs=${management-eclipse-plugin.core-libs} ${ecl-swt-win32-win32-x86}
-management-eclipse-plugin-linux-gtk-x86.libs=${management-eclipse-plugin.core-libs} ${ecl-unix-shared} ${ecl-swt-linux-gtk-x86}
-management-eclipse-plugin-macosx.libs=${management-eclipse-plugin.core-libs} ${ecl-unix-shared} ${ecl-swt-macosx}
-
-management-eclipse-plugin.libs=${management-eclipse-plugin.core-libs} ${ecl-swt-win32-win32-x86} ${ecl-swt-linux-gtk-x86} ${ecl-swt-macosx}
-
-management-tools-qpid-cli.libs=${common.libs} ${jline}
-
-common.test.libs=${test.libs}
-broker.test.libs=${test.libs}
-client.test.libs=${broker.libs} ${test.libs}
-client-example.test.libs=${test.libs}
-tools.test.libs=${client.test.libs}
-testkit.test.libs=${test.libs}
-management-client.test.libs=${client.test.libs}
-management-eclipse-plugin.test.libs=${systests.libs}
-broker-plugins.test.libs=${test.libs}
-management-tools-qpid-cli.test.libs=${junit4} ${slf4j-log4j} ${log4j} ${client.libs}
diff --git a/M4-RCs/qpid/java/build.xml b/M4-RCs/qpid/java/build.xml
deleted file mode 100644
index cea9b34b0e..0000000000
--- a/M4-RCs/qpid/java/build.xml
+++ /dev/null
@@ -1,223 +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.
- -
- -->
-<project name="AMQ Java" default="build">
-
- <import file="common.xml"/>
-
- <property name="modules.core" value="junit-toolkit common broker client tools"/>
- <property name="modules.examples" value="client/example"/>
- <property name="modules.tests" value="systests perftests integrationtests testkit"/>
- <property name="modules.management" value="management/client management/eclipse-plugin"/>
- <property name="modules.plugin" value="broker-plugins"/>
- <property name="modules.management.tools" value="management/tools/qpid-cli"/>
- <property name="modules" value="${modules.core}
- ${modules.plugin} ${modules.examples} ${modules.tests}
- ${modules.management} ${modules.management.tools}"/>
-
- <property name="qpid.jar" location="${build.lib}/qpid-all.jar"/>
- <basename property="qpid.jar.name" file="${qpid.jar}"/>
-
- <property name="resources" value="${project.root}/resources"/>
-
- <map property="release.excludes" value="${modules}">
- <globmapper from="*" to="*/\*\*"/>
- </map>
-
- <property name="release.zip" location="${release}/${project.namever}-java.zip"/>
- <property name="release.tar" location="${release}/${project.namever}-java.tar"/>
- <property name="release.tgz" location="${release}/${project.namever}-java.tar.gz"/>
- <property name="release.bz2" location="${release}/${project.namever}-java.tar.bz2"/>
-
- <macrodef name="iterate">
- <attribute name="target"/>
- <attribute name="modules" default="${modules}"/>
- <element name="elements" implicit="true" optional="true"/>
- <sequential>
- <subant target="@{target}" antfile="build.xml">
- <filelist dir="." files="@{modules}"/>
- <elements/>
- </subant>
- </sequential>
- </macrodef>
-
- <target name="compile" description="compile sources">
- <iterate target="compile"/>
- </target>
-
- <target name="compile-tests" description="compile unit tests">
- <iterate target="compile-tests"/>
- </target>
-
- <target name="test" description="execute tests">
-
- <delete file="${build.failed}"/>
-
- <iterate target="test">
- <property name="test.failures.ignore" value="true"/>
- </iterate>
-
- <condition property="failed">
- <available file="${build.failed}"/>
- </condition>
-
- <fail if="failed" message="TEST SUITE FAILED"/>
-
- </target>
-
- <target name="jar" description="create module jars">
- <iterate target="jar"/>
- </target>
-
- <target name="jar-tests" description="create unit test jars">
- <iterate target="jar-tests"/>
- </target>
-
- <target name="libs" description="copy dependencies into build tree">
- <iterate target="libs"/>
- </target>
-
- <target name="doc" description="generate api-doc">
- <iterate target="doc"/>
- </target>
-
- <target name="bundle" description="create OSGi bundles">
- <iterate target="bundle"/>
- </target>
-
- <target name="release-bin" description="build a binary release artifact" depends="build">
- <iterate target="release-bin"/>
- </target>
-
-
- <target name="check-manifest">
- <uptodate property="manifest.done" targetfile="${qpid.jar}">
- <srcfiles dir="${build.lib}" includes="**/*.jar" excludes="**/${qpid.jar.name}"/>
- </uptodate>
- </target>
-
- <target name="manifest" depends="check-manifest" unless="manifest.done">
- <path id="class.path">
- <fileset dir="${build.lib}" >
- <include name="*.jar"/>
- <exclude name="${qpid.jar.name}"/>
- </fileset>
- </path>
- <pathconvert property="qpid.jar.classpath" pathsep=" " dirsep="/">
- <path refid="class.path"/>
- <globmapper from="${build.lib}${file.separator}*" to="*"/>
- </pathconvert>
-
- <jar destfile="${qpid.jar}">
- <manifest>
- <attribute name="Class-Path" value="${qpid.jar.classpath}"/>
- </manifest>
- <metainf dir="${project.root}/resources/"/>
- </jar>
-
- <touch file="${qpid.jar}"/>
- </target>
-
- <target name="build" description="build the project">
- <iterate target="build"/>
- <antcall target="manifest"/>
- </target>
-
- <target name="prepare">
- <mkdir dir="${release}"/>
- </target>
-
- <target name="zip" depends="build,prepare" description="build release archive">
- <zip destfile="${release.zip}">
- <zipfileset dir="${build}" prefix="${project.namever}" filemode="755">
- <include name="bin/*"/>
- <exclude name="bin/*.txt"/>
- </zipfileset>
-
- <zipfileset dir="${build}" prefix="${project.namever}" filemode="644">
- <include name="bin/*.txt"/>
- </zipfileset>
-
- <zipfileset dir="${build}" prefix="${project.namever}" excludes="${release.excludes}" filemode="644" dirmode="755">
- <exclude name="bin/**"/>
- <exclude name="**/*.class"/>
- <exclude name="broker/**"/>
- <exclude name="common/**"/>
- <exclude name="client/**"/>
- <exclude name="perftests/**"/>
- <exclude name="systests/**"/>
- </zipfileset>
-
- <zipfileset dir="${resources}" prefix="${project.namever}" filemode="644"/>
- </zip>
- </target>
-
- <target name="tar" depends="zip" description="build release archive">
- <tar destfile="${release.tar}" longfile="gnu" >
- <zipfileset src="${release.zip}"/>
- </tar>
- </target>
-
- <target name="gzip" depends="tar" description="build release archive">
- <gzip src="${release.tar}" destfile="${release.tgz}"/>
- </target>
-
- <target name="bzip2" depends="tar" description="build release archive">
- <bzip2 src="${release.tar}" destfile="${release.bz2}"/>
- </target>
-
- <target name="release" depends="zip,gzip" description="build all release archives except .bz2"/>
-
- <target name="release-all" depends="zip,gzip,bzip2" description="build all release archives"/>
-
-
- <target name="clean" description="remove build and release artifacts">
- <iterate target="clean"/>
- <delete dir="${build}"/>
- <delete dir="${release}"/>
- <delete dir="${tasks.classes}"/>
- </target>
-
- <target name="coverage-report" description="generate coverage report">
- <cobertura-merge datafile="${build.coveragereport}/cobertura.ser">
- <!-- merge all module coverage reports -->
- <fileset dir="${build}">
- <include name="**/*.ser"/>
- </fileset>
- </cobertura-merge>
- <cobertura-report format="html"
- destdir="${build.coveragereport}"
- datafile="${build.coveragereport}/cobertura.ser"
- >
- <fileset dir="${project.root}/common/src/main/java" includes="**/*.java" />
- <fileset dir="${project.root}/broker/src/main/java" includes="**/*.java" />
- <fileset dir="${project.root}/client/src/main/java" includes="**/*.java" />
- </cobertura-report>
- </target>
-
- <target name="instrument" description="instrument for artifacts">
- <iterate target="instrument"/>
- </target>
-
- <target name="cover-test" description="run tests and generate coverage information" depends="build">
- <iterate target="cover-test" modules="broker client common"/>
- </target>
-
-</project>
diff --git a/M4-RCs/qpid/java/clean-dir b/M4-RCs/qpid/java/clean-dir
deleted file mode 100755
index 4d6141b4ab..0000000000
--- a/M4-RCs/qpid/java/clean-dir
+++ /dev/null
@@ -1,25 +0,0 @@
-
-#!/bin/bash
-#
-#
-# 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.
-#
-#
-
-
-rm -rf $@; mkdir $@
diff --git a/M4-RCs/qpid/java/client-java14/README.txt b/M4-RCs/qpid/java/client-java14/README.txt
deleted file mode 100644
index 66621c7eb2..0000000000
--- a/M4-RCs/qpid/java/client-java14/README.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-An implementation of SASL is provided here, for the PLAIN and CRAM-MD5 mechanisms as well as maven assembly
-instructions for producing a backported Java client for Java 1.4. In order to use the custom SASL implementation
-on JRE 1.4 the following steps must be taken:
-
- * Install the SASL JSR-28 API jar.
- * Install the qpid-client-java14 jar or set it up as a dynamically registered SASL provider.
- * Set up java.security to add the SASL provider to the list of security providers if hte SASL implemenation jar was installed as an extension.
-
-Installing the SASL JSR-28 API jar.
-
- Download, http://www.worldspot.com/jsr28/v1.1/download/sasl.jar, and copy it to the JAVA_HOME\lib\ext directory.
-
-Install or set up the qpid-client-java14 jar.
-
- Copy the output jar for this project, qpid-client-java14-1.0-incubating-M2-SNAPSHOT.jar, to JAVA_HOME\lib\ext.
-
- OR
-
- Create a properties file and register the SASL implementations in the jar so that Qpids dynamic SASL registry can find them. In a properties file
- add the lines:
-
- PLAIN=org.apache.qpid.sasl.ClientFactoryImpl
- CRAM-MD5=org.apache.qpid.sasl.ClientFactoryImpl
-
- Place this somewhere on the classpath and put the qpid-client-java14-1.0-incubating-M2-SNAPSHOT.jar on the classpath too. When starting your application
- pass in the system property amq.dynamicsaslregistrar.properties and set it to point to the location of the properties file.
-
-Set up the SASL provider.
-
- You only need to do this if the custom SASL jar, qpid-client-java14-1.0-incubating-M2-SNAPSHOT.jar, was copied to JAVA_HOME\lib\ext.
- Add the following line to JAVA_HOME\lib\security\java.security file (where n is the providers preference order):
-
- security.provider.n=org.apache.qpid.sasl.Provider \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client-java14/etc/sasl.properties b/M4-RCs/qpid/java/client-java14/etc/sasl.properties
deleted file mode 100644
index 04519e2a30..0000000000
--- a/M4-RCs/qpid/java/client-java14/etc/sasl.properties
+++ /dev/null
@@ -1,20 +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.
-#
-PLAIN=org.apache.qpid.sasl.ClientFactoryImpl
-CRAM-MD5=org.apache.qpid.sasl.ClientFactoryImpl
diff --git a/M4-RCs/qpid/java/client-java14/src/main/assembly/client-java14-bin.xml b/M4-RCs/qpid/java/client-java14/src/main/assembly/client-java14-bin.xml
deleted file mode 100644
index 91e1f23975..0000000000
--- a/M4-RCs/qpid/java/client-java14/src/main/assembly/client-java14-bin.xml
+++ /dev/null
@@ -1,74 +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.
--->
-<!-- Assembly instructions for a client that runs on Java 1.4 -->
-<assembly>
- <id>java-client-java14-bin</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
- <fileSets>
- <fileSet>
- <!-- Apache license files -->
- <directory>../resources</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- <includes>
- <include>DISCLAIMER</include>
- <include>LICENSE.txt</include>
- <include>NOTICE.txt</include>
- <include>README.txt</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>../release-docs</directory>
- <outputDirectory>qpid-${qpid.version}/docs</outputDirectory>
- <includes>
- <include>RELEASE_NOTES.txt</include>
- </includes>
- </fileSet>
-
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <unpack>false</unpack>
-
- <excludes>
- <!-- Exclude the Java 5 built client and common. The java 1.4 retrotranslated versions are used instead. -->
- <exclude>org.apache.qpid:qpid-client:jar</exclude>
- <exclude>org.apache.qpid:qpid-common:jar</exclude>
-
- <!-- Exclude the retrotranslated integration tests from the distriubtion. -->
- <exclude>org.apache.qpid:qpid-integrationtests:jar:java14</exclude>
-
- <!-- Mina SSL support only available in Java 5. No SSL on 1.4. -->
- <exclude>org.apache.mina:mina-java5</exclude>
- <exclude>org.apache.mina:mina-filter-ssl</exclude>
-
- </excludes>
- </dependencySet>
- </dependencySets>
-</assembly>
-
-
diff --git a/M4-RCs/qpid/java/client-java14/src/main/assembly/jar-with-dependencies.xml b/M4-RCs/qpid/java/client-java14/src/main/assembly/jar-with-dependencies.xml
deleted file mode 100644
index 091fd46427..0000000000
--- a/M4-RCs/qpid/java/client-java14/src/main/assembly/jar-with-dependencies.xml
+++ /dev/null
@@ -1,104 +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 is an assembly descriptor that produces a jar file that contains all the
- test dependencies, fully expanded into a single jar, required to run the tests
- of a maven project.
--->
-<!--
-<assembly>
- <id>all-test-deps</id>
- <includeBaseDirectory>false</includeBaseDirectory>
-
- <formats>
- <format>jar</format>
- </formats>
-
- <dependencySets>
- <!## Include all test dependencies. ##>
- <dependencySet>
- <outputDirectory></outputDirectory>
- <outputFileNameMapping></outputFileNameMapping>
- <unpack>true</unpack>
- <!##<scope>runtime</scope>##>
-
- <!##
- <includes>
- <include>org.apache.qpid:qpid-client:jar:java14</include>
- <include>org.apache.qpid:qpid-common:jar:java14</include>
- </includes>
- ##>
-
- <excludes>
- <!## Exclude the Java 5 built client and common. The java 1.4 retrotranslated versions are used instead. ##>
- <exclude>org.apache.qpid:qpid-client:jar</exclude>
- <exclude>org.apache.qpid:qpid-common:jar</exclude>
-
- <!## Mina SSL support only available in Java 5. No SSL on 1.4. ##>
- <exclude>org.apache.mina:mina-java5</exclude>
- <exclude>org.apache.mina:mina-filter-ssl</exclude>
- </excludes>
-
- </dependencySet>
-
- </dependencySets>
-
- <fileSets>
- <!## Include all project classes. ##>
- <fileSet>
- <directory>target/classes</directory>
- <outputDirectory></outputDirectory>
- </fileSet>
-
- <!## Include all project test classes. ##>
- <fileSet>
- <directory>target/test-classes</directory>
- <outputDirectory></outputDirectory>
- </fileSet>
- </fileSets>
-</assembly>
--->
-
-<assembly>
- <id>all-test-deps</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>jar</format>
- </formats>
-
- <fileSets>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory></outputDirectory>
- <unpack>true</unpack>
-
- <excludes>
- <!-- Exclude the Java 5 built client and common. The java 1.4 retrotranslated versions are used instead. -->
- <exclude>org.apache.qpid:qpid-client:jar</exclude>
- <exclude>org.apache.qpid:qpid-common:jar</exclude>
-
- <!-- Mina SSL support only available in Java 5. No SSL on 1.4. -->
- <exclude>org.apache.mina:mina-java5</exclude>
- <exclude>org.apache.mina:mina-filter-ssl</exclude>
-
- </excludes>
- </dependencySet>
- </dependencySets>
-</assembly> \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/ClientFactoryImpl.java b/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/ClientFactoryImpl.java
deleted file mode 100644
index ed8e4ad80f..0000000000
--- a/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/ClientFactoryImpl.java
+++ /dev/null
@@ -1,343 +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.
- *
- */
-package org.apache.qpid.sasl;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.security.auth.callback.*;
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslClientFactory;
-import javax.security.sasl.SaslException;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.util.PrettyPrintingUtils;
-
-/**
- * Implements a factory for generating Sasl client implementations.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide a list of supported encryption mechansims that meet a defined set of Sasl properties.
- * <tr><td> Provide the best matching supported Sasl mechanism to a preference ordered list of mechanisms and Sasl
- * properties.
- * <tr><td> Perform username and password request call backs. <td> CallBackHandler
- * </table>
- */
-public class ClientFactoryImpl implements SaslClientFactory
-{
- //private static final Logger log = Logger.getLogger(ClientFactoryImpl.class);
-
- /** Holds the names of the supported encryption mechanisms. */
- private static final String[] SUPPORTED_MECHANISMS = { "CRAM-MD5", "PLAIN" };
-
- /** Defines index of the CRAM-MD5 mechanism within the supported mechanisms. */
- private static final int CRAM_MD5 = 0;
-
- /** Defines index of the PLAIN mechanism within the supported mechanisms. */
- private static final int PLAIN = 1;
-
- /** Bit mapping of the no plain text policy. */
- private static final int NOPLAINTEXT = 0x0001;
-
- /** Bit mapping of the no susceptible active attacks policy. */
- private static final int NOACTIVE = 0x0002;
-
- /** Bit mapping of the no susceptible to dictionary attacks policy. */
- private static final int NODICTIONARY = 0x0004;
-
- /** Bit mapping of the must use forward secrecy between sessions policy. */
- private static final int FORWARD_SECRECY = 0x0008;
-
- /** Bit mapping of the no anonymous logins policy. */
- private static final int NOANONYMOUS = 0x0010;
-
- /** Bit mapping of the must pass credentials policy. */
- private static final int PASS_CREDENTIALS = 0x0020;
-
- /** Defines a mapping from supported mechanisms to supported policy flags. */
- private static final int[] SUPPPORTED_MECHANISMS_POLICIES =
- {
- NOPLAINTEXT | NOANONYMOUS, // CRAM-MD5
- NOANONYMOUS // PLAIN
- };
-
- /**
- * Creates a SaslClient using the parameters supplied.
- *
- * @param mechanisms The non-null list of mechanism names to try. Each is the IANA-registered name of a SASL
- * mechanism. (e.g. "GSSAPI", "CRAM-MD5").
- * @param authorizationId The possibly null protocol-dependent identification to be used for authorization.
- * If null or empty, the server derives an authorization ID from the client's authentication
- * credentials. When the SASL authentication completes successfully, the specified entity is
- * granted access.
- * @param protocol The non-null string name of the protocol for which the authentication is being performed
- * (e.g., "ldap").
- * @param serverName The non-null fully qualified host name of the server to authenticate to.
- * @param props The possibly null set of properties used to select the SASL mechanism and to configure the
- * authentication exchange of the selected mechanism. See the <tt>Sasl</tt> class for a list
- * of standard properties. Other, possibly mechanism-specific, properties can be included.
- * Properties not relevant to the selected mechanism are ignored.
- * @param cbh The possibly null callback handler to used by the SASL mechanisms to get further
- * information from the application/library to complete the authentication. For example, a
- * SASL mechanism might require the authentication ID, password and realm from the caller.
- * The authentication ID is requested by using a <tt>NameCallback</tt>.
- * The password is requested by using a <tt>PasswordCallback</tt>.
- * The realm is requested by using a <tt>RealmChoiceCallback</tt> if there is a list
- * of realms to choose from, and by using a <tt>RealmCallback</tt> if
- * the realm must be entered.
- *
- * @return A possibly null <tt>SaslClient</tt> created using the parameters supplied. If null, this factory cannot
- * produce a <tt>SaslClient</tt> using the parameters supplied.
- *
- * @throws javax.security.sasl.SaslException If cannot create a <tt>SaslClient</tt> because of an error.
- */
- public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName,
- Map props, CallbackHandler cbh) throws SaslException
- {
- /*log.debug("public SaslClient createSaslClient(String[] mechanisms = " + PrettyPrintingUtils.printArray(mechanisms)
- + ", String authorizationId = " + authorizationId + ", String protocol = " + protocol
- + ", String serverName = " + serverName + ", Map props = " + props + ", CallbackHandler cbh): called");*/
-
- // Get a list of all supported mechanisms that matched the required properties.
- String[] matchingMechanisms = getMechanismNames(props);
- //log.debug("matchingMechanisms = " + PrettyPrintingUtils.printArray(matchingMechanisms));
-
- // Scan down the list of mechanisms until the first one that matches one of the matching supported mechanisms
- // is found.
- String chosenMechanism = null;
-
- for (int i = 0; i < mechanisms.length; i++)
- {
- String mechanism = mechanisms[i];
-
- for (int j = 0; j < matchingMechanisms.length; j++)
- {
- String matchingMechanism = matchingMechanisms[j];
-
- if (mechanism.equals(matchingMechanism))
- {
- chosenMechanism = mechanism;
-
- break;
- }
- }
-
- // Stop scanning if a match has been found.
- if (chosenMechanism != null)
- {
- break;
- }
- }
-
- // Check that a matching mechanism was found or return null otherwise.
- if (chosenMechanism == null)
- {
- //log.debug("No matching mechanism could be found.");
-
- return null;
- }
-
- // Instantiate an appropriate client type for the chosen mechanism.
- if (chosenMechanism.equals(SUPPORTED_MECHANISMS[CRAM_MD5]))
- {
- Object[] uinfo = getUserInfo("CRAM-MD5", authorizationId, cbh);
-
- //log.debug("Using CRAM-MD5 mechanism.");
-
- return new CramMD5Client((String) uinfo[0], (byte[]) uinfo[1]);
- }
- else
- {
- Object[] uinfo = getUserInfo("PLAIN", authorizationId, cbh);
-
- //log.debug("Using PLAIN mechanism.");
-
- return new PlainClient(authorizationId, (String) uinfo[0], (byte[]) uinfo[1]);
- }
- }
-
- /**
- * Returns an array of names of mechanisms that match the specified
- * mechanism selection policies.
- *
- * @param props The possibly null set of properties used to specify the
- * security policy of the SASL mechanisms. For example, if <tt>props</tt>
- * contains the <tt>Sasl.POLICY_NOPLAINTEXT</tt> property with the value
- * <tt>"true"</tt>, then the factory must not return any SASL mechanisms
- * that are susceptible to simple plain passive attacks.
- * See the <tt>Sasl</tt> class for a complete list of policy properties.
- * Non-policy related properties, if present in <tt>props</tt>, are ignored.
- *
- * @return A non-null array containing a IANA-registered SASL mechanism names.
- */
- public String[] getMechanismNames(Map props)
- {
- //log.debug("public String[] getMechanismNames(Map props = " + props + "): called");
-
- // Used to build up the valid mechanisms in.
- List validMechanisms = new ArrayList();
-
- // Transform the Sasl properties into a set of bit mapped flags indicating the required properties of the
- // encryption mechanism employed.
- int requiredFlags = bitMapSaslProperties(props);
- //log.debug("requiredFlags = " + requiredFlags);
-
- // Scan down the list of supported mechanisms filtering in only those that satisfy all of the desired
- // encryption properties.
- for (int i = 0; i < SUPPORTED_MECHANISMS.length; i++)
- {
- int mechanismFlags = SUPPPORTED_MECHANISMS_POLICIES[i];
- //log.debug("mechanismFlags = " + mechanismFlags);
-
- // Check if the current mechanism contains all of the required flags.
- if ((requiredFlags & ~mechanismFlags) == 0)
- {
- //log.debug("Mechanism " + SUPPORTED_MECHANISMS[i] + " meets the required properties.");
- validMechanisms.add(SUPPORTED_MECHANISMS[i]);
- }
- }
-
- String[] result = (String[]) validMechanisms.toArray(new String[validMechanisms.size()]);
-
- //log.debug("result = " + PrettyPrintingUtils.printArray(result));
-
- return result;
- }
-
- /**
- * Transforms a set of Sasl properties, defined using the property names in javax.security.sasl.Sasl, into
- * a bit mapped set of property flags encoded using the bit mapping constants defined in this class.
- *
- * @param properties The Sasl properties to bit map.
- *
- * @return A set of bit mapped properties encoded in an integer.
- */
- private int bitMapSaslProperties(Map properties)
- {
- //log.debug("private int bitMapSaslProperties(Map properties = " + properties + "): called");
-
- int result = 0;
-
- // No flags set if no properties are set.
- if (properties == null)
- {
- return result;
- }
-
- if ("true".equalsIgnoreCase((String) properties.get(Sasl.POLICY_NOPLAINTEXT)))
- {
- result |= NOPLAINTEXT;
- }
-
- if ("true".equalsIgnoreCase((String) properties.get(Sasl.POLICY_NOACTIVE)))
- {
- result |= NOACTIVE;
- }
-
- if ("true".equalsIgnoreCase((String) properties.get(Sasl.POLICY_NODICTIONARY)))
- {
- result |= NODICTIONARY;
- }
-
- if ("true".equalsIgnoreCase((String) properties.get(Sasl.POLICY_NOANONYMOUS)))
- {
- result |= NOANONYMOUS;
- }
-
- if ("true".equalsIgnoreCase((String) properties.get(Sasl.POLICY_FORWARD_SECRECY)))
- {
- result |= FORWARD_SECRECY;
- }
-
- if ("true".equalsIgnoreCase((String) properties.get(Sasl.POLICY_PASS_CREDENTIALS)))
- {
- result |= PASS_CREDENTIALS;
- }
-
- return result;
- }
-
- /**
- * Uses the specified call back handler to query for the users log in name and password.
- *
- * @param prefix A prefix to prepend onto the username and password queries.
- * @param authorizationId The default autorhization name.
- * @param cbh The call back handler.
- *
- * @return The username and password from the callback.
- *
- * @throws SaslException If the callback fails for any reason.
- */
- private Object[] getUserInfo(String prefix, String authorizationId, CallbackHandler cbh) throws SaslException
- {
- // Check that the callback handler is defined.
- if (cbh == null)
- {
- throw new SaslException("Callback handler to get username/password required.");
- }
-
- try
- {
- String userPrompt = prefix + " authentication id: ";
- String passwdPrompt = prefix + " password: ";
-
- NameCallback ncb =
- (authorizationId == null) ? new NameCallback(userPrompt) : new NameCallback(userPrompt, authorizationId);
- PasswordCallback pcb = new PasswordCallback(passwdPrompt, false);
-
- // Ask the call back handler to get the users name and password.
- cbh.handle(new Callback[] { ncb, pcb });
-
- char[] pw = pcb.getPassword();
-
- byte[] bytepw;
- String authId;
-
- if (pw != null)
- {
- bytepw = new String(pw).getBytes("UTF8");
- pcb.clearPassword();
- }
- else
- {
- bytepw = null;
- }
-
- authId = ncb.getName();
-
- return new Object[] { authId, bytepw };
- }
- catch (IOException e)
- {
- throw new SaslException("Cannot get password.", e);
- }
- catch (UnsupportedCallbackException e)
- {
- throw new SaslException("Cannot get userid/password.", e);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java b/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java
deleted file mode 100644
index 4f890ffed5..0000000000
--- a/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java
+++ /dev/null
@@ -1,347 +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.
- *
- */
-package org.apache.qpid.sasl;
-
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslException;
-
-/**
- * Implements the CRAM-MD5 SASL mechanism.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Concatenate the user id and password hashed by a challenge string as the challenge response.
- * <tr><td> Ensure password is wiped once a challenge has been processed.
- * </table>
- */
-public class CramMD5Client implements SaslClient
-{
- /** Defines the HMAC block size. */
- private static final int MD5_BLOCKSIZE = 64;
-
- /** Flag used to indicate that the authentication has completed. */
- private boolean completed = false;
-
- private String authenticationId;
- private byte[] password;
-
- /**
- * Creates a PLAIN SASL client for an authorization id, authentication id and password.
- *
- * @param authenticationId The authentication id.
- * @param password The password.
- *
- * @throws SaslException If the authentication id or password is null.
- */
- CramMD5Client(String authenticationId, byte[] password) throws SaslException
- {
- // Check that a username and password are specified.
- if ((authenticationId == null) || (password == null))
- {
- throw new SaslException("CRAM: authentication id and password must be specified");
- }
-
- // Keep the log in credentials.
- this.authenticationId = authenticationId;
- this.password = password;
- }
-
- /**
- * Returns the IANA-registered mechanism name of this SASL client. (e.g. "CRAM-MD5", "GSSAPI").
- *
- * @return A non-null string representing the IANA-registered mechanism name.
- */
- public String getMechanismName()
- {
- return "CRAM-MD5";
- }
-
- /**
- * Determines whether this mechanism has an optional initial response. If true, caller should call
- * <tt>evaluateChallenge()</tt> with an empty array to get the initial response.
- *
- * <p/>CRAM-MD5 has no intial response.
- *
- * @return true if this mechanism has an initial response.
- */
- public boolean hasInitialResponse()
- {
- return false;
- }
-
- /**
- * Evaluates the challenge data and generates a response. If a challenge is received from the server during the
- * authentication process, this method is called to prepare an appropriate next response to submit to the server.
- *
- * <p/>The initial response for the SASL command, for the CRAM-MD5 mechanism is the concatenation of authentication
- * ID and password HMAC-MD5 hashed by the server challenge.
- *
- * @param challenge The non-null challenge sent from the server. The challenge array may have zero length.
- *
- * @return The possibly null reponse to send to the server. It is null if the challenge accompanied a "SUCCESS"
- * status and the challenge only contains data for the client to update its state and no response
- * needs to be sent to the server. The response is a zero-length byte array if the client is to send a
- * response with no data.
- *
- * @throws javax.security.sasl.SaslException If an error occurred while processing the challenge or generating a
- * response.
- */
- public byte[] evaluateChallenge(byte[] challenge) throws SaslException
- {
- // Check that the authentication has not already been performed.
- if (completed)
- {
- throw new IllegalStateException("CRAM-MD5 authentication already completed.");
- }
-
- // Check if the password is null, this will be the case if a previous attempt to authenticated failed.
- if (password == null)
- {
- throw new IllegalStateException("CRAM-MD5 authentication previously aborted due to error.");
- }
-
- // Generate a keyed-MD5 digest from the user's password keyed by the challenge bytes.
- try
- {
- String digest = hmac_md5(password, challenge);
- String result = authenticationId + " " + digest;
-
- completed = true;
-
- return result.getBytes("UTF8");
- }
- catch (java.security.NoSuchAlgorithmException e)
- {
- throw new SaslException("MD5 algorithm not available on platform", e);
- }
- catch (java.io.UnsupportedEncodingException e)
- {
- throw new SaslException("UTF8 not available on platform", e);
- }
- finally
- {
- clearPassword();
- }
- }
-
- /**
- * Determines whether the authentication exchange has completed. This method may be called at any time, but
- * typically, it will not be called until the caller has received indication from the server (in a protocol-specific
- * manner) that the exchange has completed.
- *
- * @return true if the authentication exchange has completed; false otherwise.
- */
- public boolean isComplete()
- {
- return completed;
- }
-
- /**
- * Unwraps a byte array received from the server. This method can be called only after the authentication exchange
- * has completed (i.e., when <tt>isComplete()</tt> returns true) and only if the authentication exchange has
- * negotiated integrity and/or privacy as the quality of protection; otherwise, an <tt>IllegalStateException</tt> is
- * thrown.
- *
- * <p/><tt>incoming</tt> is the contents of the SASL buffer as defined in RFC 2222 without the leading four octet
- * field that represents the length. <tt>offset</tt> and <tt>len</tt> specify the portion of <tt>incoming</tt>
- * to use.
- *
- * @param incoming A non-null byte array containing the encoded bytes from the server.
- * @param offset The starting position at <tt>incoming</tt> of the bytes to use.
- * @param len The number of bytes from <tt>incoming</tt> to use.
- *
- * @return A non-null byte array containing the decoded bytes.
- *
- * @throws javax.security.sasl.SaslException If <tt>incoming</tt> cannot be successfully unwrapped.
- * @throws IllegalStateException If the authentication exchange has not completed, or if the negotiated quality of
- * protection has neither integrity nor privacy.
- */
- public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
- {
- throw new SaslException("CRAM-MD5 does not support quality of protection.");
- }
-
- /**
- * Wraps a byte array to be sent to the server. This method can be called only after the authentication exchange has
- * completed (i.e., when <tt>isComplete()</tt> returns true) and only if the authentication exchange has negotiated
- * integrity and/or privacy as the quality of protection; otherwise, an <tt>IllegalStateException</tt> is thrown.
- *
- * <p/>The result of this method will make up the contents of the SASL buffer as defined in RFC 2222 without the
- * leading four octet field that represents the length. <tt>offset</tt> and <tt>len</tt> specify the portion of
- * <tt>outgoing</tt> to use.
- *
- * @param outgoing A non-null byte array containing the bytes to encode.
- * @param offset The starting position at <tt>outgoing</tt> of the bytes to use.
- * @param len The number of bytes from <tt>outgoing</tt> to use.
- *
- * @return A non-null byte array containing the encoded bytes.
- *
- * @throws javax.security.sasl.SaslException If <tt>outgoing</tt> cannot be successfully wrapped.
- * @throws IllegalStateException If the authentication exchange has not completed, or if the negotiated quality of
- * protection has neither integrity nor privacy.
- */
- public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
- {
- throw new SaslException("CRAM-MD5 does not support quality of protection.");
- }
-
- /**
- * Retrieves the negotiated property. This method can be called only after the authentication exchange has
- * completed (i.e., when <tt>isComplete()</tt> returns true); otherwise, an <tt>IllegalStateException</tt> is thrown.
- *
- * @param propName The non-null property name.
- *
- * @return The value of the negotiated property. If null, the property was not negotiated or is not applicable to
- * this mechanism.
- *
- * @throws IllegalStateException If this authentication exchange has not completed.
- */
- public Object getNegotiatedProperty(String propName)
- {
- if (completed)
- {
- if (propName.equals(Sasl.QOP))
- {
- return "auth";
- }
- else
- {
- return null;
- }
- }
- else
- {
- throw new IllegalStateException("CRAM-MD5 authentication not completed");
- }
- }
-
- /**
- * Disposes of any system resources or security-sensitive information the SaslClient might be using. Invoking this
- * method invalidates the SaslClient instance. This method is idempotent.
- *
- * @throws javax.security.sasl.SaslException If a problem was encountered while disposing the resources.
- */
- public void dispose() throws SaslException
- { }
-
- /*
- * Hashes its input arguments according to HMAC-MD5 (RFC 2104) and returns the resulting digest in its ASCII
- * representation.
- *
- * <p/> The HMAC-MD5 function is described as follows:
- * <p/><pre>
- * MD5(key XOR opad, MD5(key XOR ipad, text))
- * </pre>
- *
- * <p/>Where key is an n byte key, ipad is the byte 0x36 repeated 64 times, opad is the byte 0x5c repeated 64 times
- * and text is the data to be protected.
- *
- * @param key The key to hash by.
- * @param text The plain text to hash.
- *
- * @return The hashed text.
- *
- * @throws NoSuchAlgorithmException If the Java platform does not supply an MD5 implementation.
- */
- private static final String hmac_md5(byte[] key, byte[] text) throws NoSuchAlgorithmException
- {
- MessageDigest md5 = MessageDigest.getInstance("MD5");
-
- /* digest the key if longer than 64 bytes */
- if (key.length > 64)
- {
- key = md5.digest(key);
- }
-
- byte[] ipad = new byte[MD5_BLOCKSIZE]; /* inner padding */
- byte[] opad = new byte[MD5_BLOCKSIZE]; /* outer padding */
- byte[] digest;
- int i;
-
- /* store key in pads */
- for (i = 0; i < MD5_BLOCKSIZE; i++)
- {
- for (; i < key.length; i++)
- {
- ipad[i] = key[i];
- opad[i] = key[i];
- }
-
- ipad[i] = 0x00;
- opad[i] = 0x00;
- }
-
- /* XOR key with pads */
- for (i = 0; i < MD5_BLOCKSIZE; i++)
- {
- ipad[i] ^= 0x36;
- opad[i] ^= 0x5c;
- }
-
- /* inner MD5 */
- md5.update(ipad);
- md5.update(text);
- digest = md5.digest();
-
- /* outer MD5 */
- md5.update(opad);
- md5.update(digest);
- digest = md5.digest();
-
- // Get character representation of digest
- StringBuffer digestString = new StringBuffer();
-
- for (i = 0; i < digest.length; i++)
- {
- if ((digest[i] & 0x000000ff) < 0x10)
- {
- digestString.append("0" + Integer.toHexString(digest[i] & 0x000000ff));
- }
- else
- {
- digestString.append(Integer.toHexString(digest[i] & 0x000000ff));
- }
- }
-
- return (digestString.toString());
- }
-
- /**
- * Overwrites the password with zeros.
- */
- private void clearPassword()
- {
- if (password != null)
- {
- // Zero out password.
- for (int i = 0; i < password.length; i++)
- {
- password[i] = (byte) 0;
- }
-
- password = null;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java b/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java
deleted file mode 100644
index f5a9f150bb..0000000000
--- a/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java
+++ /dev/null
@@ -1,275 +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.
- *
- */
-package org.apache.qpid.sasl;
-
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslException;
-
-/**
- * Implements the PLAIN SASL mechanism.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Concatenate the user id and password in plain text as the challenge respose.
- * <tr><td> Ensure password is wiped once a challenge has been processed.
- * </table>
- */
-public class PlainClient implements SaslClient
-{
- /** Flag used to indicate that the authentication has completed. */
- private boolean completed = false;
-
- private String authorizationId;
- private String authenticationId;
- private byte[] password;
-
- private static byte SEPERATOR = 0; // US-ASCII <NUL>
-
- /**
- * Creates a PLAIN SASL client for an authorization id, authentication id and password.
- *
- * @param authorizationId The authorization id. May be null.
- * @param authenticationId The authentication id.
- * @param password The password.
- *
- * @throws SaslException If the authentication id or password is null.
- */
- PlainClient(String authorizationId, String authenticationId, byte[] password) throws SaslException
- {
- // Check that a username and password are specified.
- if ((authenticationId == null) || (password == null))
- {
- throw new SaslException("PLAIN: authentication ID and password must be specified");
- }
-
- // Keep the log in credentials.
- this.authorizationId = authorizationId;
- this.authenticationId = authenticationId;
- this.password = password;
- }
-
- /**
- * Returns the IANA-registered mechanism name of this SASL client. (e.g. "CRAM-MD5", "GSSAPI").
- *
- * @return A non-null string representing the IANA-registered mechanism name.
- */
- public String getMechanismName()
- {
- return "PLAIN";
- }
-
- /**
- * Determines whether this mechanism has an optional initial response. If true, caller should call
- * <tt>evaluateChallenge()</tt> with an empty array to get the initial response.
- *
- * @return true if this mechanism has an initial response.
- */
- public boolean hasInitialResponse()
- {
- return true;
- }
-
- /**
- * Evaluates the challenge data and generates a response. If a challenge is received from the server during the
- * authentication process, this method is called to prepare an appropriate next response to submit to the server.
- *
- * <p/>The initial response for the SASL command, for the PLAIN mechanism is the concatenation of authorization ID,
- * authentication ID and password, with each component separated by the US-ASCII <NUL> byte.
- *
- * @param challenge The non-null challenge sent from the server. The challenge array may have zero length.
- *
- * @return The possibly null reponse to send to the server. It is null if the challenge accompanied a "SUCCESS"
- * status and the challenge only contains data for the client to update its state and no response
- * needs to be sent to the server. The response is a zero-length byte array if the client is to send a
- * response with no data.
- *
- * @throws javax.security.sasl.SaslException If an error occurred while processing the challenge or generating a
- * response.
- */
- public byte[] evaluateChallenge(byte[] challenge) throws SaslException
- {
- // Check that the authentication has not already been performed.
- if (completed)
- {
- throw new IllegalStateException("PLAIN authentication already completed");
- }
-
- try
- {
- // Get the authorization and authentication ids in bytes.
- byte[] authorizationBytes = (authorizationId != null) ? authorizationId.getBytes("UTF8") : null;
- byte[] authenticationBytes = authenticationId.getBytes("UTF8");
-
- // Create an array big enough to hold the results.
- byte[] result =
- new byte[password.length + authenticationBytes.length + 2
- + ((authorizationBytes == null) ? 0 : authorizationBytes.length)];
-
- // Copy the authorization id, authentication id and password into the results.
- int pos = 0;
- if (authorizationBytes != null)
- {
- System.arraycopy(authorizationBytes, 0, result, 0, authorizationBytes.length);
- pos = authorizationBytes.length;
- }
-
- result[pos++] = SEPERATOR;
- System.arraycopy(authenticationBytes, 0, result, pos, authenticationBytes.length);
-
- pos += authenticationBytes.length;
- result[pos++] = SEPERATOR;
-
- System.arraycopy(password, 0, result, pos, password.length);
-
- completed = true;
-
- return result;
- }
- catch (java.io.UnsupportedEncodingException e)
- {
- throw new SaslException("Cannot get UTF-8 encoding of ids", e);
- }
- finally
- {
- clearPassword();
- }
- }
-
- /**
- * Determines whether the authentication exchange has completed. This method may be called at any time, but
- * typically, it will not be called until the caller has received indication from the server (in a protocol-specific
- * manner) that the exchange has completed.
- *
- * @return true if the authentication exchange has completed; false otherwise.
- */
- public boolean isComplete()
- {
- return completed;
- }
-
- /**
- * Unwraps a byte array received from the server. This method can be called only after the authentication exchange has
- * completed (i.e., when <tt>isComplete()</tt> returns true) and only if the authentication exchange has negotiated
- * integrity and/or privacy as the quality of protection; otherwise, an <tt>IllegalStateException</tt> is thrown.
- *
- * <p/><tt>incoming</tt> is the contents of the SASL buffer as defined in RFC 2222 without the leading four octet
- * field that represents the length. <tt>offset</tt> and <tt>len</tt> specify the portion of <tt>incoming</tt>
- * to use.
- *
- * @param incoming A non-null byte array containing the encoded bytes
- * from the server.
- * @param offset The starting position at <tt>incoming</tt> of the bytes to use.
- * @param len The number of bytes from <tt>incoming</tt> to use.
- *
- * @return A non-null byte array containing the decoded bytes.
- *
- * @throws javax.security.sasl.SaslException If <tt>incoming</tt> cannot be successfully unwrapped.
- * @throws IllegalStateException If the authentication exchange has not completed, or if the negotiated quality of
- * protection has neither integrity nor privacy.
- */
- public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
- {
- throw new SaslException("PLAIN does not support quality of protection.");
- }
-
- /**
- * Wraps a byte array to be sent to the server. This method can be called only after the authentication exchange has
- * completed (i.e., when <tt>isComplete()</tt> returns true) and only if the authentication exchange has negotiated
- * integrity and/or privacy as the quality of protection; otherwise, an <tt>IllegalStateException</tt> is thrown.
- *
- * <p/>The result of this method will make up the contents of the SASL buffer as defined in RFC 2222 without the
- * leading four octet field that represents the length. <tt>offset</tt> and <tt>len</tt> specify the portion of
- * <tt>outgoing</tt> to use.
- *
- * @param outgoing A non-null byte array containing the bytes to encode.
- * @param offset The starting position at <tt>outgoing</tt> of the bytes to use.
- * @param len The number of bytes from <tt>outgoing</tt> to use.
- *
- * @return A non-null byte array containing the encoded bytes.
- *
- * @throws javax.security.sasl.SaslException If <tt>outgoing</tt> cannot be successfully wrapped.
- * @throws IllegalStateException If the authentication exchange has not completed, or if the negotiated quality of
- * protection has neither integrity nor privacy.
- */
- public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
- {
- throw new SaslException("PLAIN does not support quality of protection.");
- }
-
- /**
- * Retrieves the negotiated property. This method can be called only after the authentication exchange has
- * completed (i.e., when <tt>isComplete()</tt> returns true); otherwise, an <tt>IllegalStateException</tt> is thrown.
- *
- * @param propName The non-null property name.
- *
- * @return The value of the negotiated property. If null, the property was not negotiated or is not applicable to
- * this mechanism.
- *
- * @throws IllegalStateException If this authentication exchange has not completed.
- */
- public Object getNegotiatedProperty(String propName)
- {
- if (completed)
- {
- if (propName.equals(Sasl.QOP))
- {
- return "auth";
- }
- else
- {
- return null;
- }
- }
- else
- {
- throw new IllegalStateException("PLAIN authentication not completed");
- }
- }
-
- /**
- * Disposes of any system resources or security-sensitive information the SaslClient might be using. Invoking this
- * method invalidates the SaslClient instance. This method is idempotent.
- *
- * @throws javax.security.sasl.SaslException If a problem was encountered while disposing the resources.
- */
- public void dispose() throws SaslException
- {
- clearPassword();
- }
-
- /**
- * Overwrites the password with zeros.
- */
- private void clearPassword()
- {
- if (password != null)
- {
- // Zero out password.
- for (int i = 0; i < password.length; i++)
- {
- password[i] = (byte) 0;
- }
-
- password = null;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/Provider.java b/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/Provider.java
deleted file mode 100644
index ef075a0cad..0000000000
--- a/M4-RCs/qpid/java/client-java14/src/main/java/org/apache/qpid/sasl/Provider.java
+++ /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.
- *
- */
-package org.apache.qpid.sasl;
-
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-
-import org.apache.log4j.Logger;
-
-/**
- * A SASL provider for Java 1.4. Declares the capabilities of this implementation, which supports PLAIN and CRAM-MD5
- * client implementations only.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Declare PLAIN SASL support.
- * <tr><td> Declare CRAM-MD5 SASL support.
- * </table>
- */
-public class Provider extends java.security.Provider
-{
- //Logger log = Logger.getLogger(Provider.class);
-
- private static final String info = "Qpid SASL provider" + "(implements client mechanisms for: PLAIN, CRAM-MD5)";
-
- public Provider()
- {
- super("QpidSASL", 1.4, info);
-
- //log.debug("public Provider(): called");
-
- AccessController.doPrivileged(new PrivilegedAction()
- {
- public Object run()
- {
- put("SaslClientFactory.PLAIN", "org.apache.qpid.sasl.ClientFactoryImpl");
- put("SaslClientFactory.CRAM-MD5", "org.apache.qpid.sasl.ClientFactoryImpl");
-
- return null;
- }
- });
- }
-}
diff --git a/M4-RCs/qpid/java/client-java14/src/test/java/org/apache/qpid/test/integration/client/ConnectionTest.java b/M4-RCs/qpid/java/client-java14/src/test/java/org/apache/qpid/test/integration/client/ConnectionTest.java
deleted file mode 100644
index 77cc79bc49..0000000000
--- a/M4-RCs/qpid/java/client-java14/src/test/java/org/apache/qpid/test/integration/client/ConnectionTest.java
+++ /dev/null
@@ -1,66 +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.
- *
- */
-package org.apache.qpid.test.integration.client;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
-
-import org.apache.qpid.client.AMQConnection;
-
-/**
- * Implements a trivial broker connection test, to a broker on the default port on localhost, to check that SASL
- * authentication works.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Check that a connection to a broker can be established.
- * </table>
- */
-public class ConnectionTest extends TestCase
-{
- private String BROKER_URL = "tcp://localhost:5672";
-
- public ConnectionTest(String name)
- {
- super(name);
- }
-
- /** Check that a connection to a broker can be established. */
- public void testConnection() throws Exception
- {
- // Open a connection to the broker and close it again.
- AMQConnection conn = new AMQConnection(BROKER_URL, "guest", "guest", "clientid", "test");
- conn.close();
- }
-
- protected void setUp()
- {
- NDC.push(getName());
- }
-
- protected void tearDown()
- {
- NDC.pop();
- }
-}
diff --git a/M4-RCs/qpid/java/client/build.xml b/M4-RCs/qpid/java/client/build.xml
deleted file mode 100644
index e826df9c74..0000000000
--- a/M4-RCs/qpid/java/client/build.xml
+++ /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.
- -
- -->
-<project name="AMQ Client" default="build">
-
- <property name="module.depends" value="common"/>
-
- <import file="../module.xml"/>
-
- <property name="output.dir" value="${module.precompiled}/org/apache/qpid/filter/selector"/>
-
- <target name="precompile">
- <mkdir dir="${output.dir}"/>
- <javacc target="src/main/grammar/SelectorParser.jj"
- outputdirectory="${output.dir}"
- javacchome="${project.root}/lib"/>
- </target>
-
-
- <uptodate property="doc-release.done" targetfile="${module.release}/api/index.html">
- <srcfiles dir="${module.src}" includes="**/*.java"/>
- </uptodate>
-
- <target name="doc-release" depends="build" unless="doc-release.done">
- <javadoc destdir="${module.release}/api" sourcepathref="module.src.path"
- classpathref="module.class.path" packagenames="org.apache.qpid.jms"/>
- </target>
-
- <target name="release-bin" depends="release-bin-tasks"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/client/example/bin/README.txt b/M4-RCs/qpid/java/client/example/bin/README.txt
deleted file mode 100644
index 9a1ce91d41..0000000000
--- a/M4-RCs/qpid/java/client/example/bin/README.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-= Qpid Java Examples =
-
-For more information read ../README.txt.
-
-== The Verify All Script ==
-
-The verify_all script will run Java examples against itself and against the C++
-and Python examples. The success of the script is determined by comparing its
-output against what is expected.
-
-This script uses the verify script found in qpid/cpp/examples.
diff --git a/M4-RCs/qpid/java/client/example/bin/set_classpath.bat b/M4-RCs/qpid/java/client/example/bin/set_classpath.bat
deleted file mode 100644
index d528967024..0000000000
--- a/M4-RCs/qpid/java/client/example/bin/set_classpath.bat
+++ /dev/null
@@ -1,50 +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.
-
-@REM Helper script to set classpath for running Qpid example classes
-@REM NB: You must add the Qpid client and common jars to your CLASSPATH
-@REM before running this script
-
-@echo off
-
-if "%QPID_HOME%" == "" GOTO ERROR_QPID_HOME
-
-set QPIDLIB=%QPID_HOME%\lib
-
-if "%CLASSPATH%" == "" GOTO ERROR_CLASSPATH
-
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\backport-util-concurrent-2.2.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\geronimo-jms_1.1_spec-1.0.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-collections-3.1.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-configuration-1.2.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-cli-1.0.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-lang-2.1.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-logging-api-1.0.4.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\commons-logging-1.0.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\log4j-1.2.12.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\mina-core-1.0.0.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\mina-filter-ssl-1.0.0.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\mina-java5-1.0.0.jar
-set CLASSPATH=%CLASSPATH%;%QPIDLIB%\slf4j-simple-1.0.jar
-
-GOTO END
-
-:ERROR_CLASSPATH
-Echo Please set set your CLASSPATH variable to include the Qpid client and common jars. Exiting ....
-:ERROR_QPID_HOME
-Echo Please set QPID_HOME variable. Exiting ....
-:END
diff --git a/M4-RCs/qpid/java/client/example/bin/set_classpath.sh b/M4-RCs/qpid/java/client/example/bin/set_classpath.sh
deleted file mode 100755
index 89e9bc8242..0000000000
--- a/M4-RCs/qpid/java/client/example/bin/set_classpath.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/bin/sh -xv
-#
-# 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.
-#
-
-# Helper script to set classpath for running Qpid example classes
-# NB: You must add the Qpid client and common jars to your CLASSPATH
-# before running this script
-
-
-cygwin=false
-if [[ "$(uname -a | fgrep Cygwin)" != "" ]]; then
- cygwin=true
-fi
-
-#Should have set the QPID_HOME var after install to the working dir e.g. home/qpid/qpid-1.0-incubating-M2-SNAPSHOT
-if [ "$QPID_HOME" = "" ] ; then
- echo "ERROR: Please set QPID_HOME variable. Exiting ...."
- exit 1
-else
- QPIDLIB=$QPID_HOME/lib
-fi
-
-if $cygwin; then
- QPIDLIB=$(cygpath -w $QPIDLIB)
-fi
-
-if [ "$CLASSPATH" = "" ] ; then
- echo "ERROR: Please set set your CLASSPATH variable to include the Qpid client and common jars. Exiting ...."
- exit 2
-fi
-
-#Converts paths for cygwin if req
-#Some nasty concatenation to get round cygpath line limits
-if $cygwin; then
- SEP=";"
- CLASSPATH=`cygpath -w $CLASSPATH`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/backport-util-concurrent-2.2.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/geronimo-jms_1.1_spec-1.0.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-collections-3.1.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-configuration-1.2.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-cli-1.0.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-lang-2.1.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-logging-api-1.0.4.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/commons-logging-1.0.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/log4j-1.2.12.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/mina-core-1.0.0.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/mina-filter-ssl-1.0.0.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/mina-java5-1.0.0.jar`
- CLASSPATH=$CLASSPATH$SEP`cygpath -w $QPIDLIB/slf4j-simple-1.0.jar`
- export CLASSPATH
-else
- CLASSPATH=$CLASSPATH:$QPIDLIB/backport-util-concurrent-2.2.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/geronimo-jms_1.1_spec-1.0.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/commons-collections-3.1.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/commons-configuration-1.2.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/commons-cli-1.0.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/commons-lang-2.1.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/commons-logging-api-1.0.4.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/commons-logging-1.0.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/log4j-1.2.12.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/mina-core-1.0.0.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/mina-filter-ssl-1.0.0.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/mina-java5-1.0.0.jar
- CLASSPATH=$CLASSPATH:$QPIDLIB/slf4j-simple-1.0.jar
- export CLASSPATH
-fi
-
diff --git a/M4-RCs/qpid/java/client/example/bin/verify_all b/M4-RCs/qpid/java/client/example/bin/verify_all
deleted file mode 100644
index 0212e7d819..0000000000
--- a/M4-RCs/qpid/java/client/example/bin/verify_all
+++ /dev/null
@@ -1,59 +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.
-#
-
-export QPID_SRC_HOME=$(cd "$(dirname $0)/../../../.."; pwd)
-export CPP=$QPID_SRC_HOME/cpp/examples/examples
-export PYTHON=$QPID_SRC_HOME/python/examples
-export JAVA=$QPID_SRC_HOME/java/client/example/src/main/java/org/apache/qpid/example/jmsexample
-
-export AMQP_SPEC=$QPID_SRC_HOME/specs/amqp.0-10.xml
-export PYTHONPATH=$QPID_SRC_HOME/python/
-
-trap cleanup EXIT
-
-run_broker(){
- $QPID_SRC_HOME/cpp/src/qpidd -d --no-data-dir --auth no
-}
-
-stop_broker(){
- $QPID_SRC_HOME/cpp/src/qpidd -q
-}
-
-cleanup(){
- if [ -e /tmp/qpidd.5672.pid ]; then
- stop_broker
- fi
- find $CPP -name '*.out' | xargs rm -f
- find $PYTHON -name '*.out' | xargs rm -f
- find $JAVA -name '*.out' | xargs rm -f
-}
-
-QPID_LIBS=`find $QPID_SRC_HOME/java/build/lib -name '*.jar' | tr '\n' ":"`
-export CLASSPATH=$QPID_LIBS:$CLASSPATH
-
-verify=$QPID_SRC_HOME/cpp/examples/verify
-
-for script in $(find $JAVA -name 'verify*' -not -path '*.svn' -not -name '*.*')
-do
- run_broker
- $verify $script
- stop_broker
-done
-
diff --git a/M4-RCs/qpid/java/client/example/build.xml b/M4-RCs/qpid/java/client/example/build.xml
deleted file mode 100644
index 8bcd59d829..0000000000
--- a/M4-RCs/qpid/java/client/example/build.xml
+++ /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.
- -
- -->
-<project name="AMQ Client" default="build">
-
- <property name="module.depends" value="common client"/>
-
- <import file="../../module.xml"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/client/example/source-jar.xml b/M4-RCs/qpid/java/client/example/source-jar.xml
deleted file mode 100644
index 60451448b8..0000000000
--- a/M4-RCs/qpid/java/client/example/source-jar.xml
+++ /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.
--->
-<!-- This is an assembly descriptor that produces a jar file that contains all the
- dependencies, fully expanded into a single jar, required to run the tests of
- a maven project.
- -->
-<assembly>
- <id>source</id>
- <formats>
- <format>jar</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>src/main/java</directory>
- <outputDirectory></outputDirectory>
- </fileSet>
- </fileSets>
-</assembly>
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/README.txt b/M4-RCs/qpid/java/client/example/src/main/java/README.txt
deleted file mode 100644
index c8fe6a76ad..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/README.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-In order to use the runSample script, you are required to set two environment
-variables, QPID_HOME and QPID_SAMPLE. If not the default values will be used.
-
-QPID_HOME
----------
-This is the distribution directory. You would have set the QPID_HOME when you
-started the Qpid Java broker.
-
-default: /usr/share/java/
-
-QPID_SAMPLE
------------
-This is the parent directory of the directory in which you find the runSample.sh
-(Ex:- $QPID_SRC_HOME/java/client/example/src/main)
-
-default: /usr/share/doc/rhm-0.2
-
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/log4j.xml b/M4-RCs/qpid/java/client/example/src/main/java/log4j.xml
deleted file mode 100644
index 0b38b14c02..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/log4j.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.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.
- -
- -->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
- <appender name="FileAppender" class="org.apache.log4j.FileAppender">
- <param name="File" value="qpid_messaging.log"/>
- <param name="Append" value="false"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %-5p %c{2} - %m%n"/>
- </layout>
- </appender>
-
- <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
- </layout>
- </appender>
-
- <logger name="org.apache">
- <!-- Print only messages of level warn or above in the package org.apache -->
- <level value="warn"/>
- </logger>
-
- <root>
- <priority value="info"/>
- <appender-ref ref="STDOUT"/>
- <!-- <appender-ref ref="FileAppender"/> -->
- </root>
-</log4j:configuration> \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/DeclareQueue.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/DeclareQueue.java
deleted file mode 100755
index 38073cb7f2..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/DeclareQueue.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.apache.qpid.example.amqpexample.direct;
-/*
- *
- * 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 org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.Session;
-
-/**
- * This creates a queue a queue and binds it to the
- * amq.direct exchange
- *
- */
-public class DeclareQueue
-{
-
- public static void main(String[] args)
- {
- // Create connection
- Connection con = new Connection();
- con.connect("localhost", 5672, "test", "guest", "guest",false);
-
- // Create session
- Session session = con.createSession(0);
-
- // declare and bind queue
- session.queueDeclare("message_queue", null, null);
- session.exchangeBind("message_queue", "amq.direct", "routing_key", null);
-
- // confirm completion
- session.sync();
-
- //cleanup
- session.close();
- con.close();
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/DirectProducer.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/DirectProducer.java
deleted file mode 100755
index 2234eb22da..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/DirectProducer.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.apache.qpid.example.amqpexample.direct;
-/*
- *
- * 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 java.nio.ByteBuffer;
-
-import org.apache.qpid.api.Message;
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.DeliveryProperties;
-import org.apache.qpid.transport.Header;
-import org.apache.qpid.transport.MessageAcceptMode;
-import org.apache.qpid.transport.MessageAcquireMode;
-import org.apache.qpid.transport.Session;
-
-public class DirectProducer
-{
-
- public static void main(String[] args)
- {
- // Create connection
- Connection con = new Connection();
- con.connect("localhost", 5672, "test", "guest", "guest",false);
-
- // Create session
- Session session = con.createSession(0);
- DeliveryProperties deliveryProps = new DeliveryProperties();
- deliveryProps.setRoutingKey("routing_key");
-
- for (int i=0; i<10; i++)
- {
- session.messageTransfer("amq.direct", MessageAcceptMode.EXPLICIT,MessageAcquireMode.PRE_ACQUIRED,
- new Header(deliveryProps),
- "Message " + i);
- }
-
- session.messageTransfer("amq.direct", MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED,
- new Header(deliveryProps),
- "That's all, folks!");
-
- // confirm completion
- session.sync();
-
- //cleanup
- session.close();
- con.close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/Listener.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/Listener.java
deleted file mode 100755
index 93bb097268..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/direct/Listener.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package org.apache.qpid.example.amqpexample.direct;
-/*
- *
- * 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 java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.MessageAcceptMode;
-import org.apache.qpid.transport.MessageAcquireMode;
-import org.apache.qpid.transport.MessageCreditUnit;
-import org.apache.qpid.transport.MessageTransfer;
-import org.apache.qpid.transport.Session;
-import org.apache.qpid.transport.SessionException;
-import org.apache.qpid.transport.SessionListener;
-
-/**
- * This listens to messages on a queue and terminates
- * when it sees the final message
- *
- */
-public class Listener implements SessionListener
-{
-
- public void opened(Session ssn) {}
-
- public void message(Session ssn, MessageTransfer xfr)
- {
- System.out.println("Message: " + xfr);
- }
-
- public void exception(Session ssn, SessionException exc)
- {
- exc.printStackTrace();
- }
-
- public void closed(Session ssn) {}
-
- /**
- * This sends 10 messages to the
- * amq.direct exchange using the
- * routing key as "routing_key"
- *
- */
- public static void main(String[] args) throws InterruptedException
- {
- // Create connection
- Connection con = new Connection();
- con.connect("localhost", 5672, "test", "guest", "guest",false);
-
- // Create session
- Session session = con.createSession(0);
-
- // Create an instance of the listener
- Listener listener = new Listener();
- session.setSessionListener(listener);
-
- // create a subscription
- session.messageSubscribe("message_queue",
- "listener_destination",
- MessageAcceptMode.NONE,
- MessageAcquireMode.PRE_ACQUIRED,
- null, 0, null);
-
-
- // issue credits
- // XXX
- session.messageFlow("listener_destination", MessageCreditUnit.BYTE, Session.UNLIMITED_CREDIT);
- session.messageFlow("listener_destination", MessageCreditUnit.MESSAGE, 11);
-
- // confirm completion
- session.sync();
-
- // wait to receive all the messages
- System.out.println("Waiting 100 seconds for messages from listener_destination");
- Thread.sleep(100*1000);
- System.out.println("Shutting down listener for listener_destination");
- session.messageCancel("listener_destination");
-
- //cleanup
- session.close();
- con.close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/DeclareQueue.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/DeclareQueue.java
deleted file mode 100755
index 9c3ec2fb3b..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/DeclareQueue.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.apache.qpid.example.amqpexample.fanout;
-/*
- *
- * 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 org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.Session;
-
-/**
- * This creates a queue a queue and binds it to the
- * amq.direct exchange
- *
- */
-public class DeclareQueue
-{
-
- public static void main(String[] args)
- {
- // Create connection
- Connection con = new Connection();
- con.connect("localhost", 5672, "test", "guest", "guest",false);
-
- // Create session
- Session session = con.createSession(0);
-
- // declare and bind queue
- session.queueDeclare("message_queue", null, null);
- session.exchangeBind("message_queue", "amq.fanout",null, null);
-
- // confirm completion
- session.sync();
-
- //cleanup
- session.close();
- con.close();
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/FannoutProducer.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/FannoutProducer.java
deleted file mode 100755
index 39d34713c6..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/FannoutProducer.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.apache.qpid.example.amqpexample.fanout;
-/*
- *
- * 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 org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.DeliveryProperties;
-import org.apache.qpid.transport.Header;
-import org.apache.qpid.transport.MessageAcceptMode;
-import org.apache.qpid.transport.MessageAcquireMode;
-import org.apache.qpid.transport.Session;
-
-public class FannoutProducer
-{
- /**
- * This sends 10 messages to the
- * amq.fannout exchange
- */
- public static void main(String[] args)
- {
- // Create connection
- Connection con = new Connection();
- con.connect("localhost", 5672, "test", "guest", "guest",false);
-
- // Create session
- Session session = con.createSession(0);
- DeliveryProperties deliveryProps = new DeliveryProperties();
- deliveryProps.setRoutingKey("routing_key");
-
- for (int i=0; i<10; i++)
- {
- session.messageTransfer("amq.fanout", MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED,
- new Header(deliveryProps), "Message " + i);
- }
-
- session.messageTransfer("amq.fanout", MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED,
- new Header(deliveryProps),
- "That's all, folks!");
-
- // confirm completion
- session.sync();
-
- //cleanup
- session.close();
- con.close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/Listener.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/Listener.java
deleted file mode 100755
index 4c72ce75a5..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/fanout/Listener.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package org.apache.qpid.example.amqpexample.fanout;
-/*
- *
- * 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 java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.MessageAcceptMode;
-import org.apache.qpid.transport.MessageAcquireMode;
-import org.apache.qpid.transport.MessageCreditUnit;
-import org.apache.qpid.transport.MessageTransfer;
-import org.apache.qpid.transport.Session;
-import org.apache.qpid.transport.SessionException;
-import org.apache.qpid.transport.SessionListener;
-
-/**
- * This listens to messages on a queue and terminates
- * when it sees the final message
- *
- */
-public class Listener implements SessionListener
-{
-
- public void opened(Session ssn) {}
-
- public void message(Session ssn, MessageTransfer xfr)
- {
- System.out.println("Message: " + xfr);
- }
-
- public void exception(Session ssn, SessionException exc)
- {
- exc.printStackTrace();
- }
-
- public void closed(Session ssn) {}
-
- /**
- * This sends 10 messages to the
- * amq.direct exchange using the
- * routing key as "routing_key"
- *
- */
- public static void main(String[] args) throws InterruptedException
- {
- // Create connection
- Connection con = new Connection();
- con.connect("localhost", 5672, "test", "guest", "guest",false);
-
- // Create session
- Session session = con.createSession(0);
-
- // Create an instance of the listener
- Listener listener = new Listener();
- session.setSessionListener(listener);
-
- // create a subscription
- session.messageSubscribe("message_queue",
- "listener_destination",
- MessageAcceptMode.NONE,
- MessageAcquireMode.PRE_ACQUIRED,
- null, 0, null);
-
-
- // issue credits
- // XXX
- session.messageFlow("listener_destination", MessageCreditUnit.BYTE, Session.UNLIMITED_CREDIT);
- session.messageFlow("listener_destination", MessageCreditUnit.MESSAGE, 11);
-
- // confirm completion
- session.sync();
-
- // check to see if we have received all the messages
- System.out.println("Waiting 100 seconds for messages from listener_destination");
- Thread.sleep(100*1000);
- System.out.println("Shutting down listener for listener_destination");
- session.messageCancel("listener_destination");
-
- //cleanup
- session.close();
- con.close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/pubsub/TopicListener.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/pubsub/TopicListener.java
deleted file mode 100755
index 5e6d3c6f69..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/pubsub/TopicListener.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.apache.qpid.example.amqpexample.pubsub;
-/*
- *
- * 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 java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.DeliveryProperties;
-import org.apache.qpid.transport.MessageAcceptMode;
-import org.apache.qpid.transport.MessageAcquireMode;
-import org.apache.qpid.transport.MessageCreditUnit;
-import org.apache.qpid.transport.MessageTransfer;
-import org.apache.qpid.transport.Option;
-import org.apache.qpid.transport.Session;
-import org.apache.qpid.transport.SessionException;
-import org.apache.qpid.transport.SessionListener;
-
-
-public class TopicListener implements SessionListener
-{
-
- public void opened(Session ssn) {}
-
- public void message(Session ssn, MessageTransfer xfr)
- {
- DeliveryProperties dp = xfr.getHeader().get(DeliveryProperties.class);
- System.out.println("Message: " + xfr + " with routing_key " + dp.getRoutingKey());
- }
-
- public void exception(Session ssn, SessionException exc)
- {
- exc.printStackTrace();
- }
-
- public void closed(Session ssn) {}
-
- public void prepareQueue(Session session,String queueName,String bindingKey)
- {
- session.queueDeclare(queueName, null, null, Option.EXCLUSIVE, Option.AUTO_DELETE);
- session.exchangeBind(queueName, "amq.topic", bindingKey, null);
- session.exchangeBind(queueName, "amq.topic", "control", null);
-
- session.messageSubscribe(queueName, queueName,
- MessageAcceptMode.NONE,
- MessageAcquireMode.PRE_ACQUIRED,
- null, 0, null);
- // issue credits
- // XXX: need to be able to set to null
- session.messageFlow(queueName, MessageCreditUnit.BYTE, Session.UNLIMITED_CREDIT);
- session.messageFlow(queueName, MessageCreditUnit.MESSAGE, 24);
- }
-
- public void cancelSubscription(Session session,String dest)
- {
- session.messageCancel(dest);
- }
-
- public static void main(String[] args) throws InterruptedException
- {
- // Create connection
- Connection con = new Connection();
- con.connect("localhost", 5672, "test", "guest", "guest",false);
-
- // Create session
- Session session = con.createSession(0);
-
- // Create an instance of the listener
- TopicListener listener = new TopicListener();
- session.setSessionListener(listener);
-
- listener.prepareQueue(session,"usa", "usa.#");
- listener.prepareQueue(session,"europe", "europe.#");
- listener.prepareQueue(session,"news", "#.news");
- listener.prepareQueue(session,"weather", "#.weather");
-
- // confirm completion
- session.sync();
-
- System.out.println("Waiting 100 seconds for messages");
- Thread.sleep(100*1000);
-
- System.out.println("Shutting down listeners");
- listener.cancelSubscription(session,"usa");
- listener.cancelSubscription(session,"europe");
- listener.cancelSubscription(session,"news");
- listener.cancelSubscription(session,"weather");
-
- //cleanup
- session.close();
- con.close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/pubsub/TopicPublisher.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/pubsub/TopicPublisher.java
deleted file mode 100755
index facf08eeca..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/amqpexample/pubsub/TopicPublisher.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.apache.qpid.example.amqpexample.pubsub;
-/*
- *
- * 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 org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.DeliveryProperties;
-import org.apache.qpid.transport.Header;
-import org.apache.qpid.transport.MessageAcceptMode;
-import org.apache.qpid.transport.MessageAcquireMode;
-import org.apache.qpid.transport.Session;
-
-public class TopicPublisher
-{
-
- public void publishMessages(Session session, String routing_key)
- {
- // Set the routing key once, we'll use the same routing key for all
- // messages.
-
- DeliveryProperties deliveryProps = new DeliveryProperties();
- deliveryProps.setRoutingKey(routing_key);
-
- for (int i=0; i<5; i++) {
- session.messageTransfer("amq.topic", MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED,
- new Header(deliveryProps), "Message " + i);
- }
-
- }
-
- public void noMoreMessages(Session session)
- {
- session.messageTransfer("amq.topic", MessageAcceptMode.EXPLICIT, MessageAcquireMode.PRE_ACQUIRED,
- new Header(new DeliveryProperties().setRoutingKey("control")),
- "That's all, folks!");
- }
-
- public static void main(String[] args)
- {
- // Create connection
- Connection con = new Connection();
- con.connect("localhost", 5672, "test", "guest", "guest",false);
-
- // Create session
- Session session = con.createSession(0);
-
- // Create an instance of the listener
- TopicPublisher publisher = new TopicPublisher();
-
- publisher.publishMessages(session, "usa.news");
- publisher.publishMessages(session, "usa.weather");
- publisher.publishMessages(session, "europe.news");
- publisher.publishMessages(session, "europe.weather");
-
- // confirm completion
- session.sync();
-
- //cleanup
- session.close();
- con.close();
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Consumer.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Consumer.java
deleted file mode 100644
index f84b16f485..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Consumer.java
+++ /dev/null
@@ -1,152 +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.
- *
- */
-package org.apache.qpid.example.jmsexample.direct;
-
-import java.util.Properties;
-
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-/**
- * The example creates a MessageConsumer on the specified
- * Queue which is used to synchronously consume messages.
- */
-public class Consumer
-{
- /**
- * Used in log output.
- */
- private static final String CLASS = "Consumer";
-
-
- /**
- * Run the message consumer example.
- * @param args Command line arguments.
- */
- public static void main(String[] args)
- {
- Consumer syncConsumer = new Consumer();
- syncConsumer.runTest();
- }
-
- /**
- * Start the example.
- */
- private void runTest()
- {
- try
- {
- // Load JNDI properties
- Properties properties = new Properties();
- properties.load(this.getClass().getResourceAsStream("direct.properties"));
-
- //Create the initial context
- Context ctx = new InitialContext(properties);
-
- // look up destination
- Destination destination = (Destination)ctx.lookup("directQueue");
-
- // Lookup the connection factory
- ConnectionFactory conFac = (ConnectionFactory)ctx.lookup("qpidConnectionfactory");
- // create the connection
- Connection connection = conFac.createConnection();
-
- // As this application is using a MessageConsumer we need to set an ExceptionListener on the connection
- // so that errors raised within the JMS client library can be reported to the application
- System.out.println(
- CLASS + ": Setting an ExceptionListener on the connection as sample uses a MessageConsumer");
-
- connection.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException jmse)
- {
- // The connection may have broken invoke reconnect code if available.
- // The connection may have broken invoke reconnect code if available.
- System.err.println(CLASS + ": The sample received an exception through the ExceptionListener");
- System.exit(0);
- }
- });
-
- // Create a session on the connection
- // This session is a default choice of non-transacted and uses the auto acknowledge feature of a session.
- System.out.println(CLASS + ": Creating a non-transacted, auto-acknowledged session");
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Create a MessageConsumer
- System.out.println(CLASS + ": Creating a MessageConsumer");
- MessageConsumer messageConsumer = session.createConsumer(destination);
-
- // Now the messageConsumer is set up we can start the connection
- System.out.println(CLASS + ": Starting connection so MessageConsumer can receive messages");
- connection.start();
-
- // Cycle round until all the messages are consumed.
- Message message;
- boolean end = false;
- while (!end)
- {
- message = messageConsumer.receive();
- String text;
- if (message instanceof TextMessage)
- {
- text = ((TextMessage) message).getText();
- }
- else
- {
- byte[] body = new byte[(int) ((BytesMessage) message).getBodyLength()];
- ((BytesMessage) message).readBytes(body);
- text = new String(body);
- }
- if (text.equals("That's all, folks!"))
- {
- System.out.println(CLASS + ": Received final message " + text);
- end = true;
- }
- else
- {
- System.out.println(CLASS + ": Received message: " + text);
- }
- }
-
- // Close the connection to the server
- System.out.println(CLASS + ": Closing connection");
- connection.close();
-
- // Close the JNDI reference
- System.out.println(CLASS + ": Closing JNDI context");
- ctx.close();
- }
- catch (Exception exp)
- {
- System.err.println(CLASS + ": Caught an Exception: " + exp);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Listener.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Listener.java
deleted file mode 100644
index d2e1180c9b..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Listener.java
+++ /dev/null
@@ -1,208 +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.
- *
- */
-package org.apache.qpid.example.jmsexample.direct;
-
-import java.util.Properties;
-
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-/**
- * The example creates a MessageConsumer on the specified
- * Queue and uses a MessageListener with this MessageConsumer
- * in order to enable asynchronous delivery.
- */
-public class Listener implements MessageListener
-{
- /* Used in log output. */
- private static final String CLASS = "Listener";
-
- /**
- * An object to synchronize on.
- */
- private final static Object _lock = new Object();
-
- /**
- * A boolean to indicate a clean finish.
- */
- private static boolean _finished = false;
-
- /**
- * A boolean to indicate an unsuccesful finish.
- */
- private static boolean _failed = false;
-
-
- /**
- * Run the message consumer example.
- * @param args Command line arguments.
- */
- public static void main(String[] args)
- {
- Listener listener = new Listener();
- listener.runTest();
- }
-
- /**
- * Start the example.
- */
- private void runTest()
- {
- try
- {
- // Load JNDI properties
- Properties properties = new Properties();
- properties.load(this.getClass().getResourceAsStream("direct.properties"));
-
- //Create the initial context
- Context ctx = new InitialContext(properties);
-
- // look up destination
- Destination destination = (Destination)ctx.lookup("directQueue");
-
- // Lookup the connection factory
- ConnectionFactory conFac = (ConnectionFactory)ctx.lookup("qpidConnectionfactory");
- // create the connection
- Connection connection = conFac.createConnection();
-
- // As this application is using a MessageConsumer we need to set an ExceptionListener on the connection
- // so that errors raised within the JMS client library can be reported to the application
- System.out.println(
- CLASS + ": Setting an ExceptionListener on the connection as sample uses a MessageConsumer");
-
- connection.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException jmse)
- {
- // The connection may have broken invoke reconnect code if available.
- System.err.println(CLASS + ": The sample received an exception through the ExceptionListener");
- System.exit(0);
- }
- });
-
- // Create a session on the connection
- // This session is a default choice of non-transacted and uses
- // the auto acknowledge feature of a session.
- System.out.println(CLASS + ": Creating a non-transacted, auto-acknowledged session");
-
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Create a MessageConsumer
- System.out.println(CLASS + ": Creating a MessageConsumer");
-
- MessageConsumer messageConsumer = session.createConsumer(destination);
-
- // Set a message listener on the messageConsumer
- messageConsumer.setMessageListener(this);
-
- // Now the messageConsumer is set up we can start the connection
- System.out.println(CLASS + ": Starting connection so MessageConsumer can receive messages");
- connection.start();
-
- // Wait for the messageConsumer to have received all the messages it needs
- synchronized (_lock)
- {
- while (!_finished && !_failed)
- {
- _lock.wait();
- }
- }
-
- // If the MessageListener abruptly failed (probably due to receiving a non-text message)
- if (_failed)
- {
- System.out.println(CLASS + ": This sample failed as it received unexpected messages");
- }
-
- // Close the connection to the server
- System.out.println(CLASS + ": Closing connection");
- connection.close();
-
- // Close the JNDI reference
- System.out.println(CLASS + ": Closing JNDI context");
- ctx.close();
- }
- catch (Exception exp)
- {
- System.err.println(CLASS + ": Caught an Exception: " + exp);
- }
- }
-
- /**
- * This method is required by the <CODE>MessageListener</CODE> interface. It
- * will be invoked when messages are available.
- * After receiving the finish message (That's all, folks!) it releases a lock so that the
- * main program may continue.
- *
- * @param message The message.
- */
- public void onMessage(Message message)
- {
- try
- {
- String text;
- if (message instanceof TextMessage)
- {
- text = ((TextMessage) message).getText();
- }
- else
- {
- byte[] body = new byte[(int) ((BytesMessage) message).getBodyLength()];
- ((BytesMessage) message).readBytes(body);
- text = new String(body);
- }
- if (text.equals("That's all, folks!"))
- {
- System.out.println(CLASS + ": Received final message " + text);
- synchronized (_lock)
- {
- _finished = true;
- _lock.notifyAll();
- }
- }
- else
- {
- System.out.println(CLASS + ": Received message: " + text);
- }
- }
- catch (JMSException exp)
- {
- System.out.println(CLASS + ": Caught an exception handling a received message");
- exp.printStackTrace();
- synchronized (_lock)
- {
- _failed = true;
- _lock.notifyAll();
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Producer.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Producer.java
deleted file mode 100644
index 259756764c..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/Producer.java
+++ /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.
- *
- */
-package org.apache.qpid.example.jmsexample.direct;
-
-import java.util.Properties;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-/**
- * Message producer example, sends message to a queue.
- */
-public class Producer
-{
- /* Used in log output. */
- private static final String CLASS = "Producer";
-
- private int numMessages = 10;
- private short deliveryMode = DeliveryMode.NON_PERSISTENT;
-
- /**
- * Create a Producer client.
- */
- public Producer ()
- {
- }
-
- /**
- * Run the message producer example.
- * @param args Command line arguments.
- */
- public static void main(String[] args)
- {
- Producer producer = new Producer();
- producer.runTest();
- }
-
- private void runTest()
- {
- try
- {
-
- // Load JNDI properties
- Properties properties = new Properties();
- properties.load(this.getClass().getResourceAsStream("direct.properties"));
-
- //Create the initial context
- Context ctx = new InitialContext(properties);
-
- // look up destination
- Destination destination = (Destination)ctx.lookup("directQueue");
-
- // Lookup the connection factory
- ConnectionFactory conFac = (ConnectionFactory)ctx.lookup("qpidConnectionfactory");
- // create the connection
- Connection connection = conFac.createConnection();
-
- connection.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException e)
- {
- e.printStackTrace();
- }
- });
-
- // Create a session on the connection
- // This session is a default choice of non-transacted and uses the auto acknowledge feature of a session.
- System.out.println(CLASS + ": Creating a non-transacted, auto-acknowledged session");
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // lookup the queue
- //Queue destination = session.createQueue(_queueName);
-
- // Create a Message producer
- System.out.println(CLASS + ": Creating a Message Producer");
- MessageProducer messageProducer = session.createProducer(destination);
-
- // Create a Message
- TextMessage message;
- System.out.println(CLASS + ": Creating a TestMessage to send to the destination");
-
- // Loop to publish the requested number of messages.
- for (int i = 1; i < numMessages + 1; i++)
- {
- // NOTE: We have NOT HAD TO START THE CONNECTION TO BEGIN SENDING messages,
- // this is different to the consumer end as a CONSUMERS CONNECTIONS MUST BE STARTED BEFORE RECEIVING.
- message = session.createTextMessage("Message " + i);
- System.out.println(CLASS + ": Sending message: " + i);
- messageProducer.send(message, deliveryMode, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
- }
-
- // And send a final message to indicate termination.
- message = session.createTextMessage("That's all, folks!");
- messageProducer.send(message, deliveryMode, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
-
- // Close the connection to the broker
- System.out.println(CLASS + ": Closing connection");
- connection.close();
-
- // Close the JNDI reference
- System.out.println(CLASS + ": Closing JNDI context");
- ctx.close();
- }
- catch (Exception exp)
- {
- System.err.println(CLASS + ": Caught an Exception: " + exp);
- exp.printStackTrace();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/direct.properties b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/direct.properties
deleted file mode 100644
index a2f5843e7a..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/direct.properties
+++ /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.
-#
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-
-# register some connection factories
-# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.qpidConnectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
-
-# Register an AMQP destination in JNDI
-# destination.[jniName] = [BindingURL]
-destination.directQueue = direct://amq.direct//message_queue?routingkey='routing_key' \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify
deleted file mode 100644
index 66b4b3c54e..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify
+++ /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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-# The JMS producer doesn't create qeueues so utilising the c++ declare_queues
-cpp=$CPP/direct
-
-direct_consumer_java()
-{
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.direct.Consumer
-}
-
-direct_producer_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.direct.Producer
-}
-
-clients $cpp/declare_queues direct_producer_java direct_consumer_java
-outputs $cpp/declare_queues.out ./direct_producer_java.out ./direct_consumer_java.out
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify.in
deleted file mode 100644
index c87e5716c8..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify.in
+++ /dev/null
@@ -1,35 +0,0 @@
-==== declare_queues.out
-==== direct_producer_java.out
-Producer: Creating a non-transacted, auto-acknowledged session
-Producer: Creating a Message Producer
-Producer: Creating a TestMessage to send to the destination
-Producer: Sending message: 1
-Producer: Sending message: 2
-Producer: Sending message: 3
-Producer: Sending message: 4
-Producer: Sending message: 5
-Producer: Sending message: 6
-Producer: Sending message: 7
-Producer: Sending message: 8
-Producer: Sending message: 9
-Producer: Sending message: 10
-Producer: Closing connection
-Producer: Closing JNDI context
-==== direct_consumer_java.out
-Consumer: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Consumer: Creating a non-transacted, auto-acknowledged session
-Consumer: Creating a MessageConsumer
-Consumer: Starting connection so MessageConsumer can receive messages
-Consumer: Received message: Message 1
-Consumer: Received message: Message 2
-Consumer: Received message: Message 3
-Consumer: Received message: Message 4
-Consumer: Received message: Message 5
-Consumer: Received message: Message 6
-Consumer: Received message: Message 7
-Consumer: Received message: Message 8
-Consumer: Received message: Message 9
-Consumer: Received message: Message 10
-Consumer: Received final message That's all, folks!
-Consumer: Closing connection
-Consumer: Closing JNDI context
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_cpp_java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_cpp_java
deleted file mode 100644
index d581c4c1aa..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_cpp_java
+++ /dev/null
@@ -1,10 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/direct
-
-direct_consumer_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.direct.Consumer
-}
-
-clients $cpp/declare_queues $cpp/direct_producer direct_consumer_java
-outputs $cpp/declare_queues.out $cpp/direct_producer.out ./direct_consumer_java.out
-
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_cpp_java.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_cpp_java.in
deleted file mode 100644
index b50692da1f..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_cpp_java.in
+++ /dev/null
@@ -1,20 +0,0 @@
-==== declare_queues.out
-==== direct_producer.out
-==== direct_consumer_java.out
-Consumer: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Consumer: Creating a non-transacted, auto-acknowledged session
-Consumer: Creating a MessageConsumer
-Consumer: Starting connection so MessageConsumer can receive messages
-Consumer: Received message: Message 0
-Consumer: Received message: Message 1
-Consumer: Received message: Message 2
-Consumer: Received message: Message 3
-Consumer: Received message: Message 4
-Consumer: Received message: Message 5
-Consumer: Received message: Message 6
-Consumer: Received message: Message 7
-Consumer: Received message: Message 8
-Consumer: Received message: Message 9
-Consumer: Received final message That's all, folks!
-Consumer: Closing connection
-Consumer: Closing JNDI context
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_cpp b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_cpp
deleted file mode 100644
index 573cac6986..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/direct
-
-direct_producer_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.direct.Producer
-}
-
-clients $cpp/declare_queues direct_producer_java $cpp/listener
-outputs $cpp/declare_queues.out ./direct_producer_java.out $cpp/listener.out
-
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_cpp.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_cpp.in
deleted file mode 100644
index 946c19953f..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_cpp.in
+++ /dev/null
@@ -1,30 +0,0 @@
-==== declare_queues.out
-==== direct_producer_java.out
-Producer: Creating a non-transacted, auto-acknowledged session
-Producer: Creating a Message Producer
-Producer: Creating a TestMessage to send to the destination
-Producer: Sending message: 1
-Producer: Sending message: 2
-Producer: Sending message: 3
-Producer: Sending message: 4
-Producer: Sending message: 5
-Producer: Sending message: 6
-Producer: Sending message: 7
-Producer: Sending message: 8
-Producer: Sending message: 9
-Producer: Sending message: 10
-Producer: Closing connection
-Producer: Closing JNDI context
-==== listener.out
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: Message 10
-Message: That's all, folks!
-Shutting down listener for message_queue
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_python b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_python
deleted file mode 100644
index 61c033e969..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_python
+++ /dev/null
@@ -1,9 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/direct
-
-direct_producer_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.direct.Producer
-}
-
-clients $py/declare_queues.py direct_producer_java $py/direct_consumer.py
-outputs $py/declare_queues.py.out ./direct_producer_java.out $py/direct_consumer.py.out
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_python.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_python.in
deleted file mode 100644
index e012405352..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_java_python.in
+++ /dev/null
@@ -1,29 +0,0 @@
-==== declare_queues.py.out
-==== direct_producer_java.out
-Producer: Creating a non-transacted, auto-acknowledged session
-Producer: Creating a Message Producer
-Producer: Creating a TestMessage to send to the destination
-Producer: Sending message: 1
-Producer: Sending message: 2
-Producer: Sending message: 3
-Producer: Sending message: 4
-Producer: Sending message: 5
-Producer: Sending message: 6
-Producer: Sending message: 7
-Producer: Sending message: 8
-Producer: Sending message: 9
-Producer: Sending message: 10
-Producer: Closing connection
-Producer: Closing JNDI context
-==== direct_consumer.py.out
-Message 1
-Message 2
-Message 3
-Message 4
-Message 5
-Message 6
-Message 7
-Message 8
-Message 9
-Message 10
-That's all, folks!
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_python_java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_python_java
deleted file mode 100644
index 4182331f3f..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_python_java
+++ /dev/null
@@ -1,10 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/direct
-
-direct_consumer_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.direct.Consumer
-}
-
-clients $py/declare_queues.py $py/direct_producer.py direct_consumer_java
-outputs $py/declare_queues.py.out $py/direct_producer.py.out ./direct_consumer_java.out
-
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_python_java.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_python_java.in
deleted file mode 100644
index 6a9c9fdd10..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/direct/verify_python_java.in
+++ /dev/null
@@ -1,20 +0,0 @@
-==== declare_queues.py.out
-==== direct_producer.py.out
-==== direct_consumer_java.out
-Consumer: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Consumer: Creating a non-transacted, auto-acknowledged session
-Consumer: Creating a MessageConsumer
-Consumer: Starting connection so MessageConsumer can receive messages
-Consumer: Received message: message 0
-Consumer: Received message: message 1
-Consumer: Received message: message 2
-Consumer: Received message: message 3
-Consumer: Received message: message 4
-Consumer: Received message: message 5
-Consumer: Received message: message 6
-Consumer: Received message: message 7
-Consumer: Received message: message 8
-Consumer: Received message: message 9
-Consumer: Received final message That's all, folks!
-Consumer: Closing connection
-Consumer: Closing JNDI context
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Consumer.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Consumer.java
deleted file mode 100755
index daa1b10b6b..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Consumer.java
+++ /dev/null
@@ -1,165 +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.
- *
- */
-package org.apache.qpid.example.jmsexample.fanout;
-
-import java.util.Properties;
-
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-/**
- * The example creates a MessageConsumer on the specified
- * Queue which is used to synchronously consume messages.
- */
-public class Consumer
-{
- /**
- * Used in log output.
- */
- private static final String CLASS = "Consumer";
-
- /**
- * Create a Consumer client.
- *
- */
- public Consumer()
- {
- }
-
- /**
- * Run the message consumer example.
- *
- * @param args Command line arguments.
- */
- public static void main(String[] args) throws Exception
- {
- if (args.length == 0)
- {
- throw new Exception("You need to specify the JNDI name for the queue");
- }
- Consumer syncConsumer = new Consumer();
- syncConsumer.runTest(args[0]);
- }
-
- /**
- * Start the example.
- */
- private void runTest(String queueName)
- {
- try
- {
- // Load JNDI properties
- Properties properties = new Properties();
- properties.load(this.getClass().getResourceAsStream("fanout.properties"));
-
- //Create the initial context
- Context ctx = new InitialContext(properties);
-
- // look up destination
- Destination destination = (Destination)ctx.lookup(queueName);
-
- // Lookup the connection factory
- ConnectionFactory conFac = (ConnectionFactory)ctx.lookup("qpidConnectionfactory");
- // create the connection
- Connection connection = conFac.createConnection();
-
- // As this application is using a MessageConsumer we need to set an ExceptionListener on the connection
- // so that errors raised within the JMS client library can be reported to the application
- System.out.println(
- CLASS + ": Setting an ExceptionListener on the connection as sample uses a MessageConsumer");
-
- connection.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException jmse)
- {
- // The connection may have broken invoke reconnect code if available.
- // The connection may have broken invoke reconnect code if available.
- System.err.println(CLASS + ": The sample received an exception through the ExceptionListener");
- System.exit(0);
- }
- });
-
- // Create a session on the connection
- // This session is a default choice of non-transacted and uses the auto acknowledge feature of a session.
- System.out.println(CLASS + ": Creating a non-transacted, auto-acknowledged session");
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Create a MessageConsumer
- System.out.println(CLASS + ": Creating a MessageConsumer");
- MessageConsumer messageConsumer = session.createConsumer(destination);
-
- // Now the messageConsumer is set up we can start the connection
- System.out.println(CLASS + ": Starting connection so MessageConsumer can receive messages");
- connection.start();
-
- // Cycle round until all the messages are consumed.
- Message message;
- boolean end = false;
- while (!end)
- {
- message = messageConsumer.receive();
- String text;
- if (message instanceof TextMessage)
- {
- text = ((TextMessage) message).getText();
- }
- else
- {
- byte[] body = new byte[(int) ((BytesMessage) message).getBodyLength()];
- ((BytesMessage) message).readBytes(body);
- text = new String(body);
- }
- if (text.equals("That's all, folks!"))
- {
- System.out.println(CLASS + ": Received final message " + text);
- end = true;
- }
- else
- {
- System.out.println(CLASS + ": Received message: " + text);
- }
- }
-
- // Close the connection to the server
- System.out.println(CLASS + ": Closing connection");
- connection.close();
-
- // Close the JNDI reference
- System.out.println(CLASS + ": Closing JNDI context");
- ctx.close();
- }
- catch (Exception exp)
- {
- exp.printStackTrace();
- System.err.println(CLASS + ": Caught an Exception: " + exp);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Listener.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Listener.java
deleted file mode 100755
index fb750693b2..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Listener.java
+++ /dev/null
@@ -1,201 +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.
- *
- */
-package org.apache.qpid.example.jmsexample.fanout;
-
-import java.util.Properties;
-
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-/**
- * The example creates a MessageConsumer on the specified
- * Queue and uses a MessageListener with this MessageConsumer
- * in order to enable asynchronous delivery.
- */
-public class Listener implements MessageListener
-{
- /* Used in log output. */
- private static final String CLASS = "Listener";
-
- /**
- * An object to synchronize on.
- */
- private final Object _lock = new Object();
-
- /**
- * A boolean to indicate a clean finish.
- */
- private boolean _finished = false;
-
- /**
- * A boolean to indicate an unsuccesful finish.
- */
- private boolean _failed = false;
-
-
-
- /**
- * Run the message consumer example.
- *
- * @param args Command line arguments.
- */
- public static void main(String[] args) throws Exception
- {
- if (args.length == 0)
- {
- throw new Exception("You need to specify the JNDI name for the queue");
- }
- Listener listener = new Listener();
- listener.runTest(args[0]);
- }
-
- /**
- * Start the example.
- */
- private void runTest(String queueName)
- {
- try
- {
- Properties properties = new Properties();
- properties.load(this.getClass().getResourceAsStream("fanout.properties"));
-
- //Create the initial context
- Context ctx = new InitialContext(properties);
-
- Destination destination = (Destination)ctx.lookup(queueName);
-
- // Declare the connection
- ConnectionFactory conFac = (ConnectionFactory)ctx.lookup("qpidConnectionfactory");
- Connection connection = conFac.createConnection();
-
- // As this application is using a MessageConsumer we need to set an ExceptionListener on the connection
- // so that errors raised within the JMS client library can be reported to the application
- System.out.println(
- CLASS + ": Setting an ExceptionListener on the connection as sample uses a MessageConsumer");
-
- connection.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException jmse)
- {
- // The connection may have broken invoke reconnect code if available.
- System.err.println(CLASS + ": The sample received an exception through the ExceptionListener");
- System.exit(0);
- }
- });
-
- // Create a session on the connection
- // This session is a default choice of non-transacted and uses
- // the auto acknowledge feature of a session.
- System.out.println(CLASS + ": Creating a non-transacted, auto-acknowledged session");
-
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Create a MessageConsumer
- System.out.println(CLASS + ": Creating a MessageConsumer");
-
- MessageConsumer messageConsumer = session.createConsumer(destination);
-
- // Set a message listener on the messageConsumer
- messageConsumer.setMessageListener(this);
-
- // Now the messageConsumer is set up we can start the connection
- System.out.println(CLASS + ": Starting connection so MessageConsumer can receive messages");
- connection.start();
-
- // Wait for the messageConsumer to have received all the messages it needs
- synchronized (_lock)
- {
- while (!_finished && !_failed)
- {
- _lock.wait();
- }
- }
-
- // If the MessageListener abruptly failed (probably due to receiving a non-text message)
- if (_failed)
- {
- System.out.println(CLASS + ": This sample failed as it received unexpected messages");
- }
-
- // Close the connection to the server
- System.out.println(CLASS + ": Closing connection");
- connection.close();
-
- // Close the JNDI reference
- System.out.println(CLASS + ": Closing JNDI context");
- ctx.close();
- }
- catch (Exception exp)
- {
- System.err.println(CLASS + ": Caught an Exception: " + exp);
- }
- }
-
- /**
- * This method is required by the <CODE>MessageListener</CODE> interface. It
- * will be invoked when messages are available.
- * After receiving the finish message (That's all, folks!) it releases a lock so that the
- * main program may continue.
- *
- * @param message The message.
- */
- public void onMessage(Message message)
- {
- try
- {
- String text;
- if (message instanceof TextMessage)
- {
- text = ((TextMessage) message).getText();
- }
- else
- {
- byte[] body = new byte[(int) ((BytesMessage) message).getBodyLength()];
- ((BytesMessage) message).readBytes(body);
- text = new String(body);
- }
- if (text.equals("That's all, folks!"))
- {
- System.out.println(CLASS + ": Received final message " + text);
- synchronized (_lock)
- {
- _finished = true;
- _lock.notifyAll();
- }
- }
- else
- {
- System.out.println(CLASS + ": Received message: " + text);
- }
- }
- catch (JMSException exp)
- {
- System.out.println(CLASS + ": Caught an exception handling a received message");
- exp.printStackTrace();
- synchronized (_lock)
- {
- _failed = true;
- _lock.notifyAll();
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Producer.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Producer.java
deleted file mode 100755
index 2e360f37bb..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/Producer.java
+++ /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.
- *
- */
-package org.apache.qpid.example.jmsexample.fanout;
-
-import java.util.Properties;
-
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-/**
- * Message producer example, sends message to a queue.
- */
-public class Producer
-{
- /* Used in log output. */
- private static final String CLASS = "Producer";
-
- /* The queue name */
- private int numMessages = 10;
- private short deliveryMode = DeliveryMode.NON_PERSISTENT;
-
-
- /**
- * Run the message producer example.
- * @param args Command line arguments.
- */
- public static void main(String[] args)
- {
- Producer producer = new Producer();
- producer.runTest();
- }
-
- private void runTest()
- {
- try
- {
-
- Properties properties = new Properties();
- properties.load(this.getClass().getResourceAsStream("fanout.properties"));
-
- //Create the initial context
- Context ctx = new InitialContext(properties);
-
- Destination destination = (Destination)ctx.lookup("fanoutQueue");
-
- // Declare the connection
- ConnectionFactory conFac = (ConnectionFactory)ctx.lookup("qpidConnectionfactory");
- Connection connection = conFac.createConnection();
-
- // Create a session on the connection
- // This session is a default choice of non-transacted and uses the auto acknowledge feature of a session.
- System.out.println(CLASS + ": Creating a non-transacted, auto-acknowledged session");
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // lookup the queue
- //Queue destination = session.createQueue(_queueName);
-
- // Create a Message producer
- System.out.println(CLASS + ": Creating a Message Producer");
- MessageProducer messageProducer = session.createProducer(destination);
-
- // Create a Message
- TextMessage message;
- System.out.println(CLASS + ": Creating a TestMessage to send to the destination");
-
- // Loop to publish the requested number of messages.
- for (int i = 1; i < numMessages + 1; i++)
- {
- // NOTE: We have NOT HAD TO START THE CONNECTION TO BEGIN SENDING messages,
- // this is different to the consumer end as a CONSUMERS CONNECTIONS MUST BE STARTED BEFORE RECEIVING.
- message = session.createTextMessage("Message " + i);
- System.out.println(CLASS + ": Sending message: " + i);
- messageProducer.send(message, deliveryMode, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
- }
-
- // And send a final message to indicate termination.
- message = session.createTextMessage("That's all, folks!");
- messageProducer.send(message, deliveryMode, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
-
- // Close the connection to the broker
- System.out.println(CLASS + ": Closing connection");
- connection.close();
-
- // Close the JNDI reference
- System.out.println(CLASS + ": Closing JNDI context");
- ctx.close();
- }
- catch (Exception exp)
- {
- System.err.println(CLASS + ": Caught an Exception: " + exp);
- exp.printStackTrace();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/fanout.properties b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/fanout.properties
deleted file mode 100644
index 901994541d..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/fanout.properties
+++ /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.
-#
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-
-
-# register some connection factories
-# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.qpidConnectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
-
-# Register an AMQP destination in JNDI
-# destination.[jniName] = [BindingURL]
-destination.fanoutQueue1 = fanout://amq.fanout//message_queue1
-destination.fanoutQueue2 = fanout://amq.fanout//message_queue2
-destination.fanoutQueue3 = fanout://amq.fanout//message_queue3
-
-# for producer
-destination.fanoutQueue = fanout://amq.fanout//message_queue \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify
deleted file mode 100644
index 6617e37e85..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify
+++ /dev/null
@@ -1,36 +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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-# The JMS producer doesn't create qeueues so utilising the c++ declare_queues
-cpp=$CPP/fanout
-
-fanout_listener_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.fanout.Listener $1
-}
-
-fanout_producer_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.fanout.Producer
-}
-
-background "can receive messages" fanout_listener_java fanoutQueue1
-background "can receive messages" fanout_listener_java fanoutQueue2
-background "can receive messages" fanout_listener_java fanoutQueue3
-clients fanout_producer_java
-outputs ./fanout_producer_java.out "./fanout_listener_java.out | remove_uuid" "./fanout_listener_javaX.out | remove_uuid" "./fanout_listener_javaXX.out | remove_uuid"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify.in
deleted file mode 100644
index c36a515c2a..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify.in
+++ /dev/null
@@ -1,70 +0,0 @@
-==== fanout_producer_java.out
-Producer: Creating a non-transacted, auto-acknowledged session
-Producer: Creating a Message Producer
-Producer: Creating a TestMessage to send to the destination
-Producer: Sending message: 1
-Producer: Sending message: 2
-Producer: Sending message: 3
-Producer: Sending message: 4
-Producer: Sending message: 5
-Producer: Sending message: 6
-Producer: Sending message: 7
-Producer: Sending message: 8
-Producer: Sending message: 9
-Producer: Sending message: 10
-Producer: Closing connection
-Producer: Closing JNDI context
-==== fanout_listener_java.out | remove_uuid
-Listener: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Creating a MessageConsumer
-Listener: Starting connection so MessageConsumer can receive messages
-Listener: Received message: Message 1
-Listener: Received message: Message 2
-Listener: Received message: Message 3
-Listener: Received message: Message 4
-Listener: Received message: Message 5
-Listener: Received message: Message 6
-Listener: Received message: Message 7
-Listener: Received message: Message 8
-Listener: Received message: Message 9
-Listener: Received message: Message 10
-Listener: Received final message That's all, folks!
-Listener: Closing connection
-Listener: Closing JNDI context
-==== fanout_listener_javaX.out | remove_uuid
-Listener: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Creating a MessageConsumer
-Listener: Starting connection so MessageConsumer can receive messages
-Listener: Received message: Message 1
-Listener: Received message: Message 2
-Listener: Received message: Message 3
-Listener: Received message: Message 4
-Listener: Received message: Message 5
-Listener: Received message: Message 6
-Listener: Received message: Message 7
-Listener: Received message: Message 8
-Listener: Received message: Message 9
-Listener: Received message: Message 10
-Listener: Received final message That's all, folks!
-Listener: Closing connection
-Listener: Closing JNDI context
-==== fanout_listener_javaXX.out | remove_uuid
-Listener: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Creating a MessageConsumer
-Listener: Starting connection so MessageConsumer can receive messages
-Listener: Received message: Message 1
-Listener: Received message: Message 2
-Listener: Received message: Message 3
-Listener: Received message: Message 4
-Listener: Received message: Message 5
-Listener: Received message: Message 6
-Listener: Received message: Message 7
-Listener: Received message: Message 8
-Listener: Received message: Message 9
-Listener: Received message: Message 10
-Listener: Received final message That's all, folks!
-Listener: Closing connection
-Listener: Closing JNDI context
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_cpp_java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_cpp_java
deleted file mode 100644
index de057ea3b1..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_cpp_java
+++ /dev/null
@@ -1,13 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-# The JMS producer doesn't create qeueues so utilising the c++ declare_queues
-cpp=$CPP/fanout
-
-fanout_listener_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.fanout.Listener $1
-}
-
-background "can receive messages" fanout_listener_java fanoutQueue1
-background "can receive messages" fanout_listener_java fanoutQueue2
-background "can receive messages" fanout_listener_java fanoutQueue3
-clients $cpp/fanout_producer
-outputs $cpp/fanout_producer.out "./fanout_listener_java.out | remove_uuid" "./fanout_listener_javaX.out | remove_uuid" "./fanout_listener_javaXX.out | remove_uuid"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_cpp_java.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_cpp_java.in
deleted file mode 100644
index 905fe3d0bc..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_cpp_java.in
+++ /dev/null
@@ -1,55 +0,0 @@
-==== fanout_producer.out
-==== fanout_listener_java.out | remove_uuid
-Listener: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Creating a MessageConsumer
-Listener: Starting connection so MessageConsumer can receive messages
-Listener: Received message: Message 0
-Listener: Received message: Message 1
-Listener: Received message: Message 2
-Listener: Received message: Message 3
-Listener: Received message: Message 4
-Listener: Received message: Message 5
-Listener: Received message: Message 6
-Listener: Received message: Message 7
-Listener: Received message: Message 8
-Listener: Received message: Message 9
-Listener: Received final message That's all, folks!
-Listener: Closing connection
-Listener: Closing JNDI context
-==== fanout_listener_javaX.out | remove_uuid
-Listener: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Creating a MessageConsumer
-Listener: Starting connection so MessageConsumer can receive messages
-Listener: Received message: Message 0
-Listener: Received message: Message 1
-Listener: Received message: Message 2
-Listener: Received message: Message 3
-Listener: Received message: Message 4
-Listener: Received message: Message 5
-Listener: Received message: Message 6
-Listener: Received message: Message 7
-Listener: Received message: Message 8
-Listener: Received message: Message 9
-Listener: Received final message That's all, folks!
-Listener: Closing connection
-Listener: Closing JNDI context
-==== fanout_listener_javaXX.out | remove_uuid
-Listener: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Creating a MessageConsumer
-Listener: Starting connection so MessageConsumer can receive messages
-Listener: Received message: Message 0
-Listener: Received message: Message 1
-Listener: Received message: Message 2
-Listener: Received message: Message 3
-Listener: Received message: Message 4
-Listener: Received message: Message 5
-Listener: Received message: Message 6
-Listener: Received message: Message 7
-Listener: Received message: Message 8
-Listener: Received message: Message 9
-Listener: Received final message That's all, folks!
-Listener: Closing connection
-Listener: Closing JNDI context
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_cpp b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_cpp
deleted file mode 100644
index dab6114572..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_cpp
+++ /dev/null
@@ -1,13 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-# The JMS producer doesn't create qeueues so utilising the c++ declare_queues
-cpp=$CPP/fanout
-
-fanout_producer_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.fanout.Producer
-}
-
-background "Listening" $cpp/listener
-background "Listening" $cpp/listener
-background "Listening" $cpp/listener
-clients fanout_producer_java
-outputs ./fanout_producer_java.out "$cpp/listener.out | remove_uuid" "$cpp/listenerX.out | remove_uuid" "$cpp/listenerXX.out | remove_uuid"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_cpp.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_cpp.in
deleted file mode 100644
index 03e75e39c6..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_cpp.in
+++ /dev/null
@@ -1,58 +0,0 @@
-==== fanout_producer_java.out
-Producer: Creating a non-transacted, auto-acknowledged session
-Producer: Creating a Message Producer
-Producer: Creating a TestMessage to send to the destination
-Producer: Sending message: 1
-Producer: Sending message: 2
-Producer: Sending message: 3
-Producer: Sending message: 4
-Producer: Sending message: 5
-Producer: Sending message: 6
-Producer: Sending message: 7
-Producer: Sending message: 8
-Producer: Sending message: 9
-Producer: Sending message: 10
-Producer: Closing connection
-Producer: Closing JNDI context
-==== listener.out | remove_uuid
-Listening
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: Message 10
-Message: That's all, folks!
-Shutting down listener for
-==== listenerX.out | remove_uuid
-Listening
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: Message 10
-Message: That's all, folks!
-Shutting down listener for
-==== listenerXX.out | remove_uuid
-Listening
-Message: Message 1
-Message: Message 2
-Message: Message 3
-Message: Message 4
-Message: Message 5
-Message: Message 6
-Message: Message 7
-Message: Message 8
-Message: Message 9
-Message: Message 10
-Message: That's all, folks!
-Shutting down listener for
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_python b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_python
deleted file mode 100644
index 1641d88354..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_python
+++ /dev/null
@@ -1,13 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-# The JMS producer doesn't create qeueues so utilising the c++ declare_queues
-py=$PYTHON_EXAMPLES/fanout
-
-fanout_producer_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.fanout.Producer
-}
-
-background "Subscribed" $py/fanout_consumer.py
-background "Subscribed" $py/fanout_consumer.py
-background "Subscribed" $py/fanout_consumer.py
-clients fanout_producer_java
-outputs ./fanout_producer_java.out "$py/fanout_consumer.py.out | remove_uuid" "$py/fanout_consumer.pyX.out | remove_uuid" "$py/fanout_consumer.pyXX.out | remove_uuid"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_python.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_python.in
deleted file mode 100644
index 0089e55c16..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_java_python.in
+++ /dev/null
@@ -1,55 +0,0 @@
-==== fanout_producer_java.out
-Producer: Creating a non-transacted, auto-acknowledged session
-Producer: Creating a Message Producer
-Producer: Creating a TestMessage to send to the destination
-Producer: Sending message: 1
-Producer: Sending message: 2
-Producer: Sending message: 3
-Producer: Sending message: 4
-Producer: Sending message: 5
-Producer: Sending message: 6
-Producer: Sending message: 7
-Producer: Sending message: 8
-Producer: Sending message: 9
-Producer: Sending message: 10
-Producer: Closing connection
-Producer: Closing JNDI context
-==== fanout_consumer.py.out | remove_uuid
-Subscribed to queue
-Message 1
-Message 2
-Message 3
-Message 4
-Message 5
-Message 6
-Message 7
-Message 8
-Message 9
-Message 10
-That's all, folks!
-==== fanout_consumer.pyX.out | remove_uuid
-Subscribed to queue
-Message 1
-Message 2
-Message 3
-Message 4
-Message 5
-Message 6
-Message 7
-Message 8
-Message 9
-Message 10
-That's all, folks!
-==== fanout_consumer.pyXX.out | remove_uuid
-Subscribed to queue
-Message 1
-Message 2
-Message 3
-Message 4
-Message 5
-Message 6
-Message 7
-Message 8
-Message 9
-Message 10
-That's all, folks!
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_python_java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_python_java
deleted file mode 100644
index 0f05663985..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_python_java
+++ /dev/null
@@ -1,13 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-# The JMS producer doesn't create qeueues so utilising the c++ declare_queues
-py=$PYTHON_EXAMPLES/fanout
-
-fanout_listener_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.fanout.Listener $1
-}
-
-background "can receive messages" fanout_listener_java fanoutQueue1
-background "can receive messages" fanout_listener_java fanoutQueue2
-background "can receive messages" fanout_listener_java fanoutQueue3
-clients $py/fanout_producer.py
-outputs $py/fanout_producer.py.out "./fanout_listener_java.out | remove_uuid" "./fanout_listener_javaX.out | remove_uuid" "./fanout_listener_javaXX.out | remove_uuid"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_python_java.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_python_java.in
deleted file mode 100644
index 1d8e1c2790..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/fanout/verify_python_java.in
+++ /dev/null
@@ -1,55 +0,0 @@
-==== fanout_producer.py.out
-==== fanout_listener_java.out | remove_uuid
-Listener: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Creating a MessageConsumer
-Listener: Starting connection so MessageConsumer can receive messages
-Listener: Received message: message 0
-Listener: Received message: message 1
-Listener: Received message: message 2
-Listener: Received message: message 3
-Listener: Received message: message 4
-Listener: Received message: message 5
-Listener: Received message: message 6
-Listener: Received message: message 7
-Listener: Received message: message 8
-Listener: Received message: message 9
-Listener: Received final message That's all, folks!
-Listener: Closing connection
-Listener: Closing JNDI context
-==== fanout_listener_javaX.out | remove_uuid
-Listener: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Creating a MessageConsumer
-Listener: Starting connection so MessageConsumer can receive messages
-Listener: Received message: message 0
-Listener: Received message: message 1
-Listener: Received message: message 2
-Listener: Received message: message 3
-Listener: Received message: message 4
-Listener: Received message: message 5
-Listener: Received message: message 6
-Listener: Received message: message 7
-Listener: Received message: message 8
-Listener: Received message: message 9
-Listener: Received final message That's all, folks!
-Listener: Closing connection
-Listener: Closing JNDI context
-==== fanout_listener_javaXX.out | remove_uuid
-Listener: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Creating a MessageConsumer
-Listener: Starting connection so MessageConsumer can receive messages
-Listener: Received message: message 0
-Listener: Received message: message 1
-Listener: Received message: message 2
-Listener: Received message: message 3
-Listener: Received message: message 4
-Listener: Received message: message 5
-Listener: Received message: message 6
-Listener: Received message: message 7
-Listener: Received message: message 8
-Listener: Received message: message 9
-Listener: Received final message That's all, folks!
-Listener: Closing connection
-Listener: Closing JNDI context
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/Listener.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/Listener.java
deleted file mode 100644
index 1a3d40041d..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/Listener.java
+++ /dev/null
@@ -1,214 +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.
- */
-package org.apache.qpid.example.jmsexample.pubsub;
-
-import java.util.Properties;
-
-import javax.jms.BytesMessage;
-import javax.jms.ConnectionFactory;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicConnection;
-import javax.jms.TopicSession;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-/**
- * The example creates a TopicSubscriber on the specified
- * Topic and uses a MessageListener with this TopicSubscriber
- * in order to enable asynchronous delivery.
- */
-public class Listener
-{
- /* Used in log output. */
- private static final String CLASS="Listener";
-
- /* An object to synchronize on. */
- private final static Object _lock=new Object();
-
- /* A boolean to indicate a clean finish. */
- private static int _finished=0;
-
- /* A boolean to indicate an unsuccesful finish. */
- private static boolean _failed=false;
-
- /**
- * Run the message consumer example.
- *
- * @param args Command line arguments.
- */
- public static void main(String[] args)
- {
- Listener listener=new Listener();
- listener.runTest();
- }
-
- private void createListener(Context ctx,TopicSession session,String topicName) throws Exception{
- // lookup the topic usa
- Topic topic=(Topic) ctx.lookup(topicName);
- // Create a Message Subscriber
- System.out.println(CLASS + ": Creating a Message Subscriber for topic " + topicName);
- javax.jms.TopicSubscriber messageSubscriber=session.createSubscriber(topic);
-
- // Set a message listener on the messageConsumer
- messageSubscriber.setMessageListener(new MyMessageListener(topicName));
-
- }
-
- /**
- * Start the example.
- */
- private void runTest()
- {
- try
- {
- Properties properties=new Properties();
- properties.load(this.getClass().getResourceAsStream("pubsub.properties"));
-
- //Create the initial context
- Context ctx=new InitialContext(properties);
-
- // Declare the connection
- ConnectionFactory conFac=(ConnectionFactory) ctx.lookup("qpidConnectionfactory");
- TopicConnection connection=(TopicConnection) conFac.createConnection();
-
- // As this application is using a TopicSubscriber we need to set an ExceptionListener on the connection
- // so that errors raised within the JMS client library can be reported to the application
- System.out.println(
- CLASS + ": Setting an ExceptionListener on the connection as sample uses a TopicSubscriber");
-
- connection.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException jmse)
- {
- // The connection may have broken invoke reconnect code if available.
- System.err.println(CLASS + ": The sample received an exception through the ExceptionListener");
- System.exit(0);
- }
- });
-
- // Create a session on the connection
- // This session is a default choice of non-transacted and uses
- // the auto acknowledge feature of a session.
- System.out.println(CLASS + ": Creating a non-transacted, auto-acknowledged session");
- TopicSession session=connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-
- createListener(ctx,session,"usa");
- createListener(ctx,session,"europe");
- createListener(ctx,session,"news");
- createListener(ctx,session,"weather");
-
- // Now the messageConsumer is set up we can start the connection
- System.out.println(CLASS + ": Starting connection so TopicSubscriber can receive messages");
- connection.start();
-
- // Wait for the messageConsumer to have received all the messages it needs
- synchronized (_lock)
- {
- while (_finished < 4 && !_failed)
- {
- _lock.wait();
- }
- }
-
- // If the MessageListener abruptly failed (probably due to receiving a non-text message)
- if (_failed)
- {
- System.out.println(CLASS + ": This sample failed as it received unexpected messages");
- }
-
- // Close the connection to the server
- System.out.println(CLASS + ": Closing connection");
- connection.close();
-
- // Close the JNDI reference
- System.out.println(CLASS + ": Closing JNDI context");
- ctx.close();
- }
- catch (Exception exp)
- {
- exp.printStackTrace();
- System.err.println(CLASS + ": Caught an Exception: " + exp);
- }
- }
-
- private class MyMessageListener implements MessageListener
- {
- /* The topic this subscriber is subscribing to */
- private String _topicName;
-
- public MyMessageListener(String topicName)
- {
- _topicName=topicName;
- }
-
- /**
- * This method is required by the <CODE>MessageListener</CODE> interface. It
- * will be invoked when messages are available.
- * After receiving the final message it releases a lock so that the
- * main program may continue.
- *
- * @param message The message.
- */
- public void onMessage(Message message)
- {
- try
- {
- String text;
- if (message instanceof TextMessage)
- {
- text=((TextMessage) message).getText();
- }
- else
- {
- byte[] body=new byte[(int) ((BytesMessage) message).getBodyLength()];
- ((BytesMessage) message).readBytes(body);
- text=new String(body);
- }
- if (text.equals("That's all, folks!"))
- {
- System.out.println(CLASS + ": Shutting down listener for " + _topicName);
- synchronized (_lock)
- {
- _finished++;
- _lock.notifyAll();
- }
- }
- else
- {
- System.out.println(CLASS + ": Received message for topic: " + _topicName + ": " + text);
- }
- }
- catch (JMSException exp)
- {
- System.out.println(CLASS + ": Caught an exception handling a received message");
- exp.printStackTrace();
- synchronized (_lock)
- {
- _failed=true;
- _lock.notifyAll();
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/Publisher.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/Publisher.java
deleted file mode 100644
index 360b2c6aed..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/Publisher.java
+++ /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.
- *
- */
-package org.apache.qpid.example.jmsexample.pubsub;
-
-
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Properties;
-
-/**
- * Publish messages to topics
- */
-public class Publisher
-{
- /* Used in log output. */
- private static final String CLASS="Publisher";
-
- /**
- * Run the message producer example.
- * @param args Command line arguments.
- */
- public static void main(String[] args)
- {
- Publisher publisher = new Publisher();
- publisher.runTest();
- }
-
- private void runTest()
- {
- try
- {
- Properties properties=new Properties();
- properties.load(this.getClass().getResourceAsStream("pubsub.properties"));
-
- //Create the initial context
- Context ctx=new InitialContext(properties);
-
- // Declare the connection
- ConnectionFactory conFac=(ConnectionFactory) ctx.lookup("qpidConnectionfactory");
- TopicConnection connection= (TopicConnection) conFac.createConnection();
-
- // Create a session on the connection
- // This session is a default choice of non-transacted and uses the auto acknowledge feature of a session.
- System.out.println(CLASS + ": Creating a non-transacted, auto-acknowledged session");
- TopicSession session=connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Create a Message
- TextMessage message;
- System.out.println(CLASS + ": Creating a TestMessage to send to the topics");
- message=session.createTextMessage();
-
- // lookup the topics usa.weather
- Topic topic = (Topic)ctx.lookup("usa.weather");
- // Create a Message Publisher
- System.out.println(CLASS + ": Creating a Message Publisher for topic usa.weather");
- TopicPublisher messagePublisher=session.createPublisher(topic);
- publishMessages(message, messagePublisher);
-
- // lookup the topics usa.news
- topic = (Topic)ctx.lookup("usa.news");
- // Create a Message Publisher
- System.out.println(CLASS + ": Creating a Message Publisher for topic usa.news");
- messagePublisher=session.createPublisher(topic);
- publishMessages(message, messagePublisher);
-
- // lookup the topics europe.weather
- topic = (Topic)ctx.lookup("europe.weather");
- // Create a Message Publisher
- System.out.println(CLASS + ": Creating a Message Publisher for topic europe.weather");
- messagePublisher=session.createPublisher(topic);
- publishMessages(message, messagePublisher);
-
- // lookup the topics europe.news
- topic = (Topic)ctx.lookup("europe.news");
- // Create a Message Publisher
- System.out.println(CLASS + ": Creating a Message Publisher for topic europe.news");
- messagePublisher = session.createPublisher(topic);
- publishMessages(message, messagePublisher);
-
- // send the final message
- message=session.createTextMessage("That's all, folks!");
- topic = (Topic)ctx.lookup("control");
- // Create a Message Publisher
- messagePublisher = session.createPublisher(topic);
- messagePublisher
- .send(message, DeliveryMode.PERSISTENT, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
-
-
- // Close the connection to the broker
- System.out.println(CLASS + ": Closing connection");
- connection.close();
-
- // Close the JNDI reference
- System.out.println(CLASS + ": Closing JNDI context");
- ctx.close();
- }
- catch (Exception exp)
- {
- System.err.println(CLASS + ": Caught an Exception: " + exp);
- }
- }
-
- private void publishMessages(TextMessage message, TopicPublisher messagePublisher) throws JMSException
- {
- // Loop to publish 5 messages.
- for (int i=1; i <= 6; i++)
- {
- message.setText("message " + i);
- System.out.println(CLASS + ": Sending " + message.getText());
- messagePublisher
- .send(message, DeliveryMode.PERSISTENT, Message.DEFAULT_PRIORITY, Message.DEFAULT_TIME_TO_LIVE);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/pubsub.properties b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/pubsub.properties
deleted file mode 100644
index 91c3de721b..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/pubsub.properties
+++ /dev/null
@@ -1,36 +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.
-#
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-
-
-# register some connection factories
-# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.qpidConnectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-topic.usa.weather = usa.weather,control
-topic.usa.news = usa.news,control
-topic.europe.weather = europe.weather,control
-topic.europe.news = europe.news,control
-topic.weather = #.weather,control
-topic.news = #.news,control
-topic.europe = europe.#,control
-topic.usa = usa.#,control
-topic.control = control \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify
deleted file mode 100644
index 588a086752..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify
+++ /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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/pub-sub
-
-topic_listener_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.pubsub.Listener
-}
-
-topic_publisher_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.pubsub.Publisher
-}
-
-background "can receive messages" topic_listener_java
-clients topic_publisher_java
-outputs ./topic_publisher_java.out "topic_listener_java.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify.in
deleted file mode 100644
index 6e3074e611..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify.in
+++ /dev/null
@@ -1,95 +0,0 @@
-==== topic_publisher_java.out
-Publisher: Creating a non-transacted, auto-acknowledged session
-Publisher: Creating a TestMessage to send to the topics
-Publisher: Creating a Message Publisher for topic usa.weather
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic usa.news
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic europe.weather
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic europe.news
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Closing connection
-Publisher: Closing JNDI context
-==== topic_listener_java.out | remove_uuid | sort
-Listener: Closing connection
-Listener: Closing JNDI context
-Listener: Creating a Message Subscriber for topic europe
-Listener: Creating a Message Subscriber for topic news
-Listener: Creating a Message Subscriber for topic usa
-Listener: Creating a Message Subscriber for topic weather
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Received message for topic: europe: message 1
-Listener: Received message for topic: europe: message 1
-Listener: Received message for topic: europe: message 2
-Listener: Received message for topic: europe: message 2
-Listener: Received message for topic: europe: message 3
-Listener: Received message for topic: europe: message 3
-Listener: Received message for topic: europe: message 4
-Listener: Received message for topic: europe: message 4
-Listener: Received message for topic: europe: message 5
-Listener: Received message for topic: europe: message 5
-Listener: Received message for topic: europe: message 6
-Listener: Received message for topic: europe: message 6
-Listener: Received message for topic: news: message 1
-Listener: Received message for topic: news: message 1
-Listener: Received message for topic: news: message 2
-Listener: Received message for topic: news: message 2
-Listener: Received message for topic: news: message 3
-Listener: Received message for topic: news: message 3
-Listener: Received message for topic: news: message 4
-Listener: Received message for topic: news: message 4
-Listener: Received message for topic: news: message 5
-Listener: Received message for topic: news: message 5
-Listener: Received message for topic: news: message 6
-Listener: Received message for topic: news: message 6
-Listener: Received message for topic: usa: message 1
-Listener: Received message for topic: usa: message 1
-Listener: Received message for topic: usa: message 2
-Listener: Received message for topic: usa: message 2
-Listener: Received message for topic: usa: message 3
-Listener: Received message for topic: usa: message 3
-Listener: Received message for topic: usa: message 4
-Listener: Received message for topic: usa: message 4
-Listener: Received message for topic: usa: message 5
-Listener: Received message for topic: usa: message 5
-Listener: Received message for topic: usa: message 6
-Listener: Received message for topic: usa: message 6
-Listener: Received message for topic: weather: message 1
-Listener: Received message for topic: weather: message 1
-Listener: Received message for topic: weather: message 2
-Listener: Received message for topic: weather: message 2
-Listener: Received message for topic: weather: message 3
-Listener: Received message for topic: weather: message 3
-Listener: Received message for topic: weather: message 4
-Listener: Received message for topic: weather: message 4
-Listener: Received message for topic: weather: message 5
-Listener: Received message for topic: weather: message 5
-Listener: Received message for topic: weather: message 6
-Listener: Received message for topic: weather: message 6
-Listener: Setting an ExceptionListener on the connection as sample uses a TopicSubscriber
-Listener: Shutting down listener for europe
-Listener: Shutting down listener for news
-Listener: Shutting down listener for usa
-Listener: Shutting down listener for weather
-Listener: Starting connection so TopicSubscriber can receive messages
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_cpp_java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_cpp_java
deleted file mode 100644
index 9276b3e21b..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_cpp_java
+++ /dev/null
@@ -1,10 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/pub-sub
-
-topic_listener_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.pubsub.Listener
-}
-
-background "can receive messages" topic_listener_java
-clients $cpp/topic_publisher
-outputs $cpp/topic_publisher.out "topic_listener_java.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_cpp_java.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_cpp_java.in
deleted file mode 100644
index 62cc76baec..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_cpp_java.in
+++ /dev/null
@@ -1,55 +0,0 @@
-==== topic_publisher.out
-==== topic_listener_java.out | remove_uuid | sort
-Listener: Closing connection
-Listener: Closing JNDI context
-Listener: Creating a Message Subscriber for topic europe
-Listener: Creating a Message Subscriber for topic news
-Listener: Creating a Message Subscriber for topic usa
-Listener: Creating a Message Subscriber for topic weather
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Received message for topic: europe: Message 0
-Listener: Received message for topic: europe: Message 0
-Listener: Received message for topic: europe: Message 1
-Listener: Received message for topic: europe: Message 1
-Listener: Received message for topic: europe: Message 2
-Listener: Received message for topic: europe: Message 2
-Listener: Received message for topic: europe: Message 3
-Listener: Received message for topic: europe: Message 3
-Listener: Received message for topic: europe: Message 4
-Listener: Received message for topic: europe: Message 4
-Listener: Received message for topic: news: Message 0
-Listener: Received message for topic: news: Message 0
-Listener: Received message for topic: news: Message 1
-Listener: Received message for topic: news: Message 1
-Listener: Received message for topic: news: Message 2
-Listener: Received message for topic: news: Message 2
-Listener: Received message for topic: news: Message 3
-Listener: Received message for topic: news: Message 3
-Listener: Received message for topic: news: Message 4
-Listener: Received message for topic: news: Message 4
-Listener: Received message for topic: usa: Message 0
-Listener: Received message for topic: usa: Message 0
-Listener: Received message for topic: usa: Message 1
-Listener: Received message for topic: usa: Message 1
-Listener: Received message for topic: usa: Message 2
-Listener: Received message for topic: usa: Message 2
-Listener: Received message for topic: usa: Message 3
-Listener: Received message for topic: usa: Message 3
-Listener: Received message for topic: usa: Message 4
-Listener: Received message for topic: usa: Message 4
-Listener: Received message for topic: weather: Message 0
-Listener: Received message for topic: weather: Message 0
-Listener: Received message for topic: weather: Message 1
-Listener: Received message for topic: weather: Message 1
-Listener: Received message for topic: weather: Message 2
-Listener: Received message for topic: weather: Message 2
-Listener: Received message for topic: weather: Message 3
-Listener: Received message for topic: weather: Message 3
-Listener: Received message for topic: weather: Message 4
-Listener: Received message for topic: weather: Message 4
-Listener: Setting an ExceptionListener on the connection as sample uses a TopicSubscriber
-Listener: Shutting down listener for europe
-Listener: Shutting down listener for news
-Listener: Shutting down listener for usa
-Listener: Shutting down listener for weather
-Listener: Starting connection so TopicSubscriber can receive messages
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_cpp b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_cpp
deleted file mode 100644
index af22b3b82c..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/pub-sub
-
-topic_publisher_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.pubsub.Publisher
-}
-
-background "Listening" $cpp/topic_listener
-clients topic_publisher_java
-outputs ./topic_publisher_java.out "$cpp/topic_listener.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_cpp.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_cpp.in
deleted file mode 100644
index 8c5c26eaca..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_cpp.in
+++ /dev/null
@@ -1,99 +0,0 @@
-==== topic_publisher_java.out
-Publisher: Creating a non-transacted, auto-acknowledged session
-Publisher: Creating a TestMessage to send to the topics
-Publisher: Creating a Message Publisher for topic usa.weather
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic usa.news
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic europe.weather
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic europe.news
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Closing connection
-Publisher: Closing JNDI context
-==== topic_listener.out | remove_uuid | sort
-Declaring queue: europe
-Declaring queue: news
-Declaring queue: usa
-Declaring queue: weather
-Listening for messages ...
-Message: message 1 from europe
-Message: message 1 from europe
-Message: message 1 from news
-Message: message 1 from news
-Message: message 1 from usa
-Message: message 1 from usa
-Message: message 1 from weather
-Message: message 1 from weather
-Message: message 2 from europe
-Message: message 2 from europe
-Message: message 2 from news
-Message: message 2 from news
-Message: message 2 from usa
-Message: message 2 from usa
-Message: message 2 from weather
-Message: message 2 from weather
-Message: message 3 from europe
-Message: message 3 from europe
-Message: message 3 from news
-Message: message 3 from news
-Message: message 3 from usa
-Message: message 3 from usa
-Message: message 3 from weather
-Message: message 3 from weather
-Message: message 4 from europe
-Message: message 4 from europe
-Message: message 4 from news
-Message: message 4 from news
-Message: message 4 from usa
-Message: message 4 from usa
-Message: message 4 from weather
-Message: message 4 from weather
-Message: message 5 from europe
-Message: message 5 from europe
-Message: message 5 from news
-Message: message 5 from news
-Message: message 5 from usa
-Message: message 5 from usa
-Message: message 5 from weather
-Message: message 5 from weather
-Message: message 6 from europe
-Message: message 6 from europe
-Message: message 6 from news
-Message: message 6 from news
-Message: message 6 from usa
-Message: message 6 from usa
-Message: message 6 from weather
-Message: message 6 from weather
-Message: That's all, folks! from europe
-Message: That's all, folks! from news
-Message: That's all, folks! from usa
-Message: That's all, folks! from weather
-Shutting down listener for europe
-Shutting down listener for news
-Shutting down listener for usa
-Shutting down listener for weather
-Subscribing to queue europe
-Subscribing to queue news
-Subscribing to queue usa
-Subscribing to queue weather
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_python b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_python
deleted file mode 100644
index 3758e0f014..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_python
+++ /dev/null
@@ -1,10 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/pubsub
-
-topic_publisher_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.pubsub.Publisher
-}
-
-background "Queues created" $py/topic_subscriber.py
-clients topic_publisher_java
-outputs ./topic_publisher_java.out "$py/topic_subscriber.py.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_python.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_python.in
deleted file mode 100644
index 92184201d0..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_java_python.in
+++ /dev/null
@@ -1,95 +0,0 @@
-==== topic_publisher_java.out
-Publisher: Creating a non-transacted, auto-acknowledged session
-Publisher: Creating a TestMessage to send to the topics
-Publisher: Creating a Message Publisher for topic usa.weather
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic usa.news
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic europe.weather
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Creating a Message Publisher for topic europe.news
-Publisher: Sending message 1
-Publisher: Sending message 2
-Publisher: Sending message 3
-Publisher: Sending message 4
-Publisher: Sending message 5
-Publisher: Sending message 6
-Publisher: Closing connection
-Publisher: Closing JNDI context
-==== topic_subscriber.py.out | remove_uuid | sort
-message 1
-message 1
-message 1
-message 1
-message 1
-message 1
-message 1
-message 1
-message 2
-message 2
-message 2
-message 2
-message 2
-message 2
-message 2
-message 2
-message 3
-message 3
-message 3
-message 3
-message 3
-message 3
-message 3
-message 3
-message 4
-message 4
-message 4
-message 4
-message 4
-message 4
-message 4
-message 4
-message 5
-message 5
-message 5
-message 5
-message 5
-message 5
-message 5
-message 5
-message 6
-message 6
-message 6
-message 6
-message 6
-message 6
-message 6
-message 6
-Messages on 'europe' queue:
-Messages on 'news' queue:
-Messages on 'usa' queue:
-Messages on 'weather' queue:
-Queues created - please start the topic producer
-Subscribing local queue 'local_europe' to europe-'
-Subscribing local queue 'local_news' to news-'
-Subscribing local queue 'local_usa' to usa-'
-Subscribing local queue 'local_weather' to weather-'
-That's all, folks!
-That's all, folks!
-That's all, folks!
-That's all, folks!
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_python_java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_python_java
deleted file mode 100644
index c2b516f376..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_python_java
+++ /dev/null
@@ -1,10 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/pubsub
-
-topic_listener_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.pubsub.Listener
-}
-
-background "can receive messages" topic_listener_java
-clients $py/topic_publisher.py
-outputs $py/topic_publisher.py.out "topic_listener_java.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_python_java.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_python_java.in
deleted file mode 100644
index 68b96cba2b..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/pubsub/verify_python_java.in
+++ /dev/null
@@ -1,55 +0,0 @@
-==== topic_publisher.py.out
-==== topic_listener_java.out | remove_uuid | sort
-Listener: Closing connection
-Listener: Closing JNDI context
-Listener: Creating a Message Subscriber for topic europe
-Listener: Creating a Message Subscriber for topic news
-Listener: Creating a Message Subscriber for topic usa
-Listener: Creating a Message Subscriber for topic weather
-Listener: Creating a non-transacted, auto-acknowledged session
-Listener: Received message for topic: europe: europe.news 0
-Listener: Received message for topic: europe: europe.news 1
-Listener: Received message for topic: europe: europe.news 2
-Listener: Received message for topic: europe: europe.news 3
-Listener: Received message for topic: europe: europe.news 4
-Listener: Received message for topic: europe: europe.weather 0
-Listener: Received message for topic: europe: europe.weather 1
-Listener: Received message for topic: europe: europe.weather 2
-Listener: Received message for topic: europe: europe.weather 3
-Listener: Received message for topic: europe: europe.weather 4
-Listener: Received message for topic: news: europe.news 0
-Listener: Received message for topic: news: europe.news 1
-Listener: Received message for topic: news: europe.news 2
-Listener: Received message for topic: news: europe.news 3
-Listener: Received message for topic: news: europe.news 4
-Listener: Received message for topic: news: usa.news 0
-Listener: Received message for topic: news: usa.news 1
-Listener: Received message for topic: news: usa.news 2
-Listener: Received message for topic: news: usa.news 3
-Listener: Received message for topic: news: usa.news 4
-Listener: Received message for topic: usa: usa.news 0
-Listener: Received message for topic: usa: usa.news 1
-Listener: Received message for topic: usa: usa.news 2
-Listener: Received message for topic: usa: usa.news 3
-Listener: Received message for topic: usa: usa.news 4
-Listener: Received message for topic: usa: usa.weather 0
-Listener: Received message for topic: usa: usa.weather 1
-Listener: Received message for topic: usa: usa.weather 2
-Listener: Received message for topic: usa: usa.weather 3
-Listener: Received message for topic: usa: usa.weather 4
-Listener: Received message for topic: weather: europe.weather 0
-Listener: Received message for topic: weather: europe.weather 1
-Listener: Received message for topic: weather: europe.weather 2
-Listener: Received message for topic: weather: europe.weather 3
-Listener: Received message for topic: weather: europe.weather 4
-Listener: Received message for topic: weather: usa.weather 0
-Listener: Received message for topic: weather: usa.weather 1
-Listener: Received message for topic: weather: usa.weather 2
-Listener: Received message for topic: weather: usa.weather 3
-Listener: Received message for topic: weather: usa.weather 4
-Listener: Setting an ExceptionListener on the connection as sample uses a TopicSubscriber
-Listener: Shutting down listener for europe
-Listener: Shutting down listener for news
-Listener: Shutting down listener for usa
-Listener: Shutting down listener for weather
-Listener: Starting connection so TopicSubscriber can receive messages
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/Client.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/Client.java
deleted file mode 100644
index 0589a3801b..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/Client.java
+++ /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.
- *
- */
-package org.apache.qpid.example.jmsexample.requestResponse;
-
-
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Properties;
-
-/**
- * This example illustrates the use of the JMS utility class <code>QueueRequestor</code>
- * which provides a synchronous RPC-like abstraction using temporary destinations
- * to deliver responses back to the client.
- */
-public class Client
-{
- /* Used in log output. */
- private static final String CLASS="Client";
-
-
- /**
- * Run the message requestor example.
- *
- * @param args Command line arguments.
- */
- public static void main(String[] args)
- {
- Client requestor=new Client();
- requestor.runTest();
- }
-
- /**
- * Start the example.
- */
- private void runTest()
- {
- try
- {
- // Load JNDI properties
- Properties properties=new Properties();
- properties.load(this.getClass().getResourceAsStream("requestResponse.properties"));
-
- //Create the initial context
- Context ctx=new InitialContext(properties);
-
- // Lookup the connection factory
- ConnectionFactory conFac = (ConnectionFactory) ctx.lookup("qpidConnectionfactory");
-
- // create the connection
- QueueConnection connection = (QueueConnection) conFac.createConnection();
-
- // As this application is using a MessageConsumer we need to set an ExceptionListener on the connection
- // so that errors raised within the JMS client library can be reported to the application
- System.out.println(
- CLASS + ": Setting an ExceptionListener on the connection as sample uses a MessageConsumer");
-
- connection.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException jmse)
- {
- // The connection may have broken invoke reconnect code if available.
- // The connection may have broken invoke reconnect code if available.
- System.err.println(CLASS + ": The sample received an exception through the ExceptionListener");
- System.exit(0);
- }
- });
-
- // Create a session on the connection.
- System.out.println(CLASS + ": Creating a non-transacted, auto-acknowledged session");
- QueueSession session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Lookup the destination
- Queue destination = (Queue) ctx.lookup("requestQueue");
-
- // Create a QueueRequestor
- System.out.println(CLASS + ": Creating a QueueRequestor");
-
- QueueRequestor requestor = new QueueRequestor(session, destination);
-
- // Now start the connection
- System.out.println(CLASS + ": Starting connection");
- connection.start();
-
- // Create a message to send as a request for service
- TextMessage request;
-
- // Send some messages to the server's request queue
- String[] messages = {"Twas brillig, and the slithy toves",
- "Did gire and gymble in the wabe.",
- "All mimsy were the borogroves,",
- "And the mome raths outgrabe."};
-
- // Get the number of times that this sample should request service
- for (String message : messages)
- {
- request = session.createTextMessage(message);
- sendReceive(request, requestor);
- }
-
- // Close the connection to the server
- System.out.println(CLASS + ": Closing connection");
- connection.close();
-
- // Close the JNDI reference
- System.out.println(CLASS + ": Closing JNDI context");
- ctx.close();
- }
- catch (Exception exp)
- {
- System.err.println(CLASS + ": Caught an Exception: " + exp);
- }
- }
-
- private void sendReceive(TextMessage request, QueueRequestor requestor) throws JMSException
- {
- Message response;
- response=requestor.request(request);
- System.out.println(CLASS + ": \tRequest Content= " + request.getText());
- // Print out the details of the response received
- String text;
- if (response instanceof TextMessage)
- {
- text=((TextMessage) response).getText();
- }
- else
- {
- byte[] body=new byte[(int) ((BytesMessage) response).getBodyLength()];
- ((BytesMessage) response).readBytes(body);
- text=new String(body);
- }
- System.out.println(CLASS + ": \tResponse Content= " + text);
- }
-}
-
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/Server.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/Server.java
deleted file mode 100644
index 2ac349a879..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/Server.java
+++ /dev/null
@@ -1,163 +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.
- *
- */
-package org.apache.qpid.example.jmsexample.requestResponse;
-
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Properties;
-
-/**
- * The example creates a MessageConsumer on the specified
- * Destination which is used to synchronously consume messages. If a
- * received message has a ReplyTo header then a new response message is sent
- * to that specified destination.
- */
-public class Server
-{
- /* Used in log output. */
- private static final String CLASS="Server";
-
-
- /**
- * Run the message mirror example.
- *
- * @param args Command line arguments.
- */
- public static void main(String[] args)
- {
- Server server=new Server();
- server.runTest();
- }
-
- /**
- * Start the example.
- */
- private void runTest()
- {
- try
- {
- // Load JNDI properties
- Properties properties=new Properties();
- properties.load(this.getClass().getResourceAsStream("requestResponse.properties"));
-
- //Create the initial context
- Context ctx=new InitialContext(properties);
-
- // Lookup the connection factory
- ConnectionFactory conFac=(ConnectionFactory) ctx.lookup("qpidConnectionfactory");
-
- // create the connection
- Connection connection=conFac.createConnection();
-
- // As this application is using a MessageConsumer we need to set an ExceptionListener on the connection
- // so that errors raised within the JMS client library can be reported to the application
- System.out.println(
- CLASS + ": Setting an ExceptionListener on the connection as sample uses a MessageConsumer");
-
- connection.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException jmse)
- {
- // The connection may have broken invoke reconnect code if available.
- // The connection may have broken invoke reconnect code if available.
- System.err.println(CLASS + ": The sample received an exception through the ExceptionListener");
- System.exit(0);
- }
- });
-
- // Create a session on the connection
- // This session is a default choice of non-transacted and uses
- // the auto acknowledge feature of a session.
- System.out.println(CLASS + ": Creating a non-transacted, auto-acknowledged session");
-
- Session session=connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Lookup the destination
- Queue destination = (Queue) ctx.lookup("requestQueue");
-
-
- // Create a MessageConsumer
- System.out.println(CLASS + ": Creating a MessageConsumer");
- MessageConsumer messageConsumer=session.createConsumer(destination);
-
- /**
- * Create a MessageProducer
- */
- System.out.println(CLASS + ": Creating a MessageProducer");
- MessageProducer messageProducer;
-
- // Now the messageConsumer is set up we can start the connection
- System.out.println(CLASS + ": Starting connection so MessageConsumer can receive messages");
- connection.start();
-
- // Cycle round until all the messages are consumed.
- Message requestMessage;
- TextMessage responseMessage;
- boolean end=false;
- while (!end)
- {
- System.out.println(CLASS + ": Receiving the message");
-
- requestMessage=messageConsumer.receive();
-
- String text;
- if (requestMessage instanceof TextMessage)
- {
- text=((TextMessage) requestMessage).getText();
- }
- else
- {
- byte[] body=new byte[(int) ((BytesMessage) requestMessage).getBodyLength()];
- ((BytesMessage) requestMessage).readBytes(body);
- text=new String(body);
- }
-
- // Now bounce the message if a ReplyTo header was set.
- if (requestMessage.getJMSReplyTo() != null)
- {
- System.out.println(CLASS + ": Activating response queue listener");
- responseMessage=session.createTextMessage();
-
- responseMessage.setText(text.toUpperCase());
- System.out.println(CLASS + ": \tResponse = " + responseMessage.getText());
-
- messageProducer=session.createProducer(requestMessage.getJMSReplyTo());
- messageProducer.send(responseMessage);
- }
- System.out.println();
- }
-
- // Close the connection to the server
- System.out.println(CLASS + ": Closing connection");
- connection.close();
-
- // Close the JNDI reference
- System.out.println(CLASS + ": Closing JNDI context");
- ctx.close();
- }
- catch (Exception exp)
- {
- exp.printStackTrace();
- System.err.println(CLASS + ": Caught an Exception: " + exp);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/requestResponse.properties b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/requestResponse.properties
deleted file mode 100644
index c467a4f123..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/requestResponse.properties
+++ /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.
-#
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-
-# register some connection factories
-# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.qpidConnectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.requestQueue = request
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify
deleted file mode 100644
index 79f22aa88a..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify
+++ /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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/pub-sub
-
-client_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.requestResponse.Client
-}
-
-server_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.requestResponse.Server
-}
-
-background "can receive messages" server_java
-clients client_java
-kill %%
-outputs "client_java.out | remove_uuid" "server_java.out | remove_uuid"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify.in
deleted file mode 100644
index f2c244dea6..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify.in
+++ /dev/null
@@ -1,38 +0,0 @@
-==== client_java.out | remove_uuid
-Client: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Client: Creating a non-transacted, auto-acknowledged session
-Client: Creating a QueueRequestor
-Client: Starting connection
-Client: Request Content= Twas brillig, and the slithy toves
-Client: Response Content= TWAS BRILLIG, AND THE SLITHY TOVES
-Client: Request Content= Did gire and gymble in the wabe.
-Client: Response Content= DID GIRE AND GYMBLE IN THE WABE.
-Client: Request Content= All mimsy were the borogroves,
-Client: Response Content= ALL MIMSY WERE THE BOROGROVES,
-Client: Request Content= And the mome raths outgrabe.
-Client: Response Content= AND THE MOME RATHS OUTGRABE.
-Client: Closing connection
-Client: Closing JNDI context
-==== server_java.out | remove_uuid
-Server: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Server: Creating a non-transacted, auto-acknowledged session
-Server: Creating a MessageConsumer
-Server: Creating a MessageProducer
-Server: Starting connection so MessageConsumer can receive messages
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = TWAS BRILLIG, AND THE SLITHY TOVES
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = DID GIRE AND GYMBLE IN THE WABE.
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = ALL MIMSY WERE THE BOROGROVES,
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = AND THE MOME RATHS OUTGRABE.
-
-Server: Receiving the message
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_cpp_java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_cpp_java
deleted file mode 100644
index 6ef1b3b7e3..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_cpp_java
+++ /dev/null
@@ -1,12 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/request-response
-
-client_java()
-{
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.requestResponse.Client
-}
-
-background "Waiting" $cpp/server
-clients client_java
-kill %%
-outputs "client_java.out | remove_uuid" "$cpp/server.out | remove_uuid"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_cpp_java.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_cpp_java.in
deleted file mode 100644
index 4b7e7e0741..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_cpp_java.in
+++ /dev/null
@@ -1,22 +0,0 @@
-==== client_java.out | remove_uuid
-Client: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Client: Creating a non-transacted, auto-acknowledged session
-Client: Creating a QueueRequestor
-Client: Starting connection
-Client: Request Content= Twas brillig, and the slithy toves
-Client: Response Content= TWAS BRILLIG, AND THE SLITHY TOVES
-Client: Request Content= Did gire and gymble in the wabe.
-Client: Response Content= DID GIRE AND GYMBLE IN THE WABE.
-Client: Request Content= All mimsy were the borogroves,
-Client: Response Content= ALL MIMSY WERE THE BOROGROVES,
-Client: Request Content= And the mome raths outgrabe.
-Client: Response Content= AND THE MOME RATHS OUTGRABE.
-Client: Closing connection
-Client: Closing JNDI context
-==== server.out | remove_uuid
-Activating request queue listener for: request
-Waiting for requests
-Request: Twas brillig, and the slithy toves (TempQueue)
-Request: Did gire and gymble in the wabe. (TempQueue)
-Request: All mimsy were the borogroves, (TempQueue)
-Request: And the mome raths outgrabe. (TempQueue)
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_cpp b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_cpp
deleted file mode 100644
index a1c5aa325d..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-cpp=$CPP/request-response
-
-server_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.requestResponse.Server
-}
-
-background "can receive messages" server_java
-clients $cpp/client
-#ps -ao pid,cmd | awk '/qpid-client-<version>.jar/{ print $1 }' | xargs -r kill
-kill %%
-outputs "$cpp/client.out | remove_uuid" "server_java.out | remove_uuid"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_cpp.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_cpp.in
deleted file mode 100644
index 9cccf39393..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_cpp.in
+++ /dev/null
@@ -1,35 +0,0 @@
-==== client.out | remove_uuid
-Activating response queue listener for: client
-Request: Twas brillig, and the slithy toves
-Request: Did gire and gymble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
-Waiting for all responses to arrive ...
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GIRE AND GYMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-Shutting down listener for client
-==== server_java.out | remove_uuid
-Server: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Server: Creating a non-transacted, auto-acknowledged session
-Server: Creating a MessageConsumer
-Server: Creating a MessageProducer
-Server: Starting connection so MessageConsumer can receive messages
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = TWAS BRILLIG, AND THE SLITHY TOVES
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = DID GIRE AND GYMBLE IN THE WABE.
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = ALL MIMSY WERE THE BOROGROVES,
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = AND THE MOME RATHS OUTGRABE.
-
-Server: Receiving the message
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_python b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_python
deleted file mode 100644
index 0760952527..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_python
+++ /dev/null
@@ -1,11 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/request-response
-
-server_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.requestResponse.Server
-}
-
-background "can receive messages" server_java
-clients $py/client.py
-kill %%
-outputs "$py/client.py.out | remove_uuid" "server_java.out | remove_uuid"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_python.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_python.in
deleted file mode 100644
index bffe9d2842..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_java_python.in
+++ /dev/null
@@ -1,34 +0,0 @@
-==== client.py.out | remove_uuid
-Request: Twas brillig, and the slithy toves
-Request: Did gyre and gimble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
-Messages on queue: reply_to:
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GYRE AND GIMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-No more messages!
-==== server_java.out | remove_uuid
-Server: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Server: Creating a non-transacted, auto-acknowledged session
-Server: Creating a MessageConsumer
-Server: Creating a MessageProducer
-Server: Starting connection so MessageConsumer can receive messages
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = TWAS BRILLIG, AND THE SLITHY TOVES
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = DID GYRE AND GIMBLE IN THE WABE.
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = ALL MIMSY WERE THE BOROGROVES,
-
-Server: Receiving the message
-Server: Activating response queue listener
-Server: Response = AND THE MOME RATHS OUTGRABE.
-
-Server: Receiving the message
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_python_java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_python_java
deleted file mode 100644
index 6ea526e914..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_python_java
+++ /dev/null
@@ -1,11 +0,0 @@
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-py=$PYTHON_EXAMPLES/request-response
-
-client_java(){
-java -Dlog4j.configuration=file://"$JAVA"/log4j.xml -cp "$CLASSPATH" org.apache.qpid.example.jmsexample.requestResponse.Client
-}
-
-background "Request server running" $py/server.py
-clients client_java
-kill %%
-outputs "client_java.out | remove_uuid" "$py/server.py.out | remove_uuid"
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_python_java.in b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_python_java.in
deleted file mode 100644
index 6e53ca3281..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/requestResponse/verify_python_java.in
+++ /dev/null
@@ -1,18 +0,0 @@
-==== client_java.out | remove_uuid
-Client: Setting an ExceptionListener on the connection as sample uses a MessageConsumer
-Client: Creating a non-transacted, auto-acknowledged session
-Client: Creating a QueueRequestor
-Client: Starting connection
-Client: Request Content= Twas brillig, and the slithy toves
-Client: Response Content= TWAS BRILLIG, AND THE SLITHY TOVES
-Client: Request Content= Did gire and gymble in the wabe.
-Client: Response Content= DID GIRE AND GYMBLE IN THE WABE.
-Client: Request Content= All mimsy were the borogroves,
-Client: Response Content= ALL MIMSY WERE THE BOROGROVES,
-Client: Request Content= And the mome raths outgrabe.
-Client: Response Content= AND THE MOME RATHS OUTGRABE.
-Client: Closing connection
-Client: Closing JNDI context
-==== server.py.out | remove_uuid
-Request server running - run your client now.
-(Times out after 100 seconds ...)
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/transacted/QueueToTopic.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/transacted/QueueToTopic.java
deleted file mode 100644
index f3bf9f8686..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/transacted/QueueToTopic.java
+++ /dev/null
@@ -1,259 +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.
- *
- */
-package org.apache.qpid.example.jmsexample.transacted;
-
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.util.Properties;
-
-/**
- * Transactional message example sends a number of messages to a Queue
- * and then uses a transacted session to move them from the Queue to a Topic.
- * <p/>
- * <p>The program completes the following steps:
- * <ul>
- * <li>Publish the specified number of messages to the queue.</li>
- * <li>Within a transacted session consume all messages from the queue
- * and publish them to the topic.</li>
- * <li>By default commit the transacted session, unless the "<code>-rollback true</code>"
- * option is specified in which case roll it back.</li>
- * <li>Check for outstanding messages on the queue.</li>
- * <li>Check for outstanding messages on the topic.</li>
- * </ul>
- * <p/>
- */
-public class QueueToTopic
-{
- /* Used in log output. */
- private static final String CLASS="QueueToTopic";
-
-
- /* Specify if the transaction is committed */
- private boolean _commit;
-
- /**
- * Create a QueueToTopic client.
- *
- * @param commit Specifies if the transaction should be committed.
- */
- public QueueToTopic(boolean commit)
- {
- _commit=commit;
- }
-
- /**
- * Run the message mover example.
- *
- * @param args Command line arguments.
- */
- public static void main(String[] args)
- {
- boolean commit=true;
- if (args.length > 1)
- {
- if (args[0].equalsIgnoreCase("-rollback"))
- {
- commit=!Boolean.getBoolean(args[1]);
- }
- }
- QueueToTopic mover=new QueueToTopic(commit);
- mover.runTest();
- }
-
- private void runTest()
- {
- try
- {
- // Load JNDI properties
- Properties properties=new Properties();
- properties.load(this.getClass().getResourceAsStream("transacted.properties"));
-
- //Create the initial context
- Context ctx=new InitialContext(properties);
-
- // Lookup the connection factory
- ConnectionFactory conFac=(ConnectionFactory) ctx.lookup("qpidConnectionfactory");
- // create the connection
- Connection connection=conFac.createConnection();
-
- // As this application is using a MessageConsumer we need to set an ExceptionListener on the connection
- // so that errors raised within the JMS client library can be reported to the application
- System.out.println(
- CLASS + ": Setting an ExceptionListener on the connection as sample uses a MessageConsumer");
-
- connection.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException jmse)
- {
- // The connection may have broken invoke reconnect code if available.
- System.err.println(CLASS + ": The sample received an exception through the ExceptionListener");
- System.exit(0);
- }
- });
-
- // Start the connection
- connection.start();
-
- /**
- * Create nonTransactedSession. This non-transacted auto-ack session is used to create the MessageProducer
- * that is used to populate the queue and the MessageConsumer that is used to consume the messages
- * from the topic.
- */
- System.out.println(CLASS + ": Creating a non-transacted, auto-acknowledged session");
- Session nonTransactedSession=connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Lookup the queue
- Queue queue=(Queue) ctx.lookup("transactedQueue");
-
- // Lookup the topic
- Topic topic=(Topic) ctx.lookup("transactedTopic");
-
- // Make sure that the queue is empty
- System.out.print(CLASS + ": Purging messages from queue...");
- MessageConsumer queueMessageConsumer=nonTransactedSession.createConsumer(queue);
- Message purgedMessage;
- int numberPurged=-1;
- do
- {
- purgedMessage=queueMessageConsumer.receiveNoWait();
- numberPurged++;
- }
- while (purgedMessage != null);
- System.out.println(numberPurged + " message(s) purged.");
-
- // Create the MessageProducer for the queue
- System.out.println(CLASS + ": Creating a MessageProducer for the queue");
- MessageProducer messageProducer=nonTransactedSession.createProducer(queue);
-
- // Now create the MessageConsumer for the topic
- System.out.println(CLASS + ": Creating a MessageConsumer for the topic");
- MessageConsumer topicMessageConsumer=nonTransactedSession.createConsumer(topic);
-
- // Create a textMessage. We're using a TextMessage for this example.
- System.out.println(CLASS + ": Creating a TestMessage to send to the destination");
- TextMessage textMessage=nonTransactedSession.createTextMessage("Sample text message");
-
- // Loop to publish the requested number of messages to the queue.
- for (int i=1; i <= 5; i++)
- {
- messageProducer
- .send(textMessage, DeliveryMode.PERSISTENT, Message.DEFAULT_PRIORITY,
- Message.DEFAULT_TIME_TO_LIVE);
-
- // Print out details of textMessage just sent
- System.out.println(CLASS + ": Message sent: " + i + " " + textMessage.getJMSMessageID());
- }
-
- // Create a new transacted Session to move the messages from the queue to the topic
- Session transactedSession=connection.createSession(true, Session.SESSION_TRANSACTED);
-
- // Create a new message consumer from the queue
- MessageConsumer transactedConsumer=transactedSession.createConsumer(queue);
-
- // Create a new message producer for the topic
- MessageProducer transactedProducer=transactedSession.createProducer(topic);
-
- // Loop to consume the messages from the queue and publish them to the topic
- Message receivedMessage;
- for (int i=1; i <= 5; i++)
- {
- // Receive a message
- receivedMessage=transactedConsumer.receive();
- System.out.println(CLASS + ": Moving message: " + i + " " + receivedMessage.getJMSMessageID());
- // Publish it to the topic
- transactedProducer.send(receivedMessage);
- }
-
- // Either commit or rollback the transacted session based on the command line args.
- if (_commit)
- {
- System.out.println(CLASS + ": Committing transacted session.");
- transactedSession.commit();
- }
- else
- {
- System.out.println(CLASS + ": Rolling back transacted session.");
- transactedSession.rollback();
- }
-
- // Now consume any outstanding messages on the queue
- System.out.print(CLASS + ": Mopping up messages from queue");
- if (_commit)
- {
- System.out.print(" (expecting none)...");
- }
- else
- {
- System.out.print(" (expecting " + 5 + ")...");
- }
-
- Message moppedMessage;
- int numberMopped=0;
- do
- {
- moppedMessage=queueMessageConsumer.receiveNoWait();
- if (moppedMessage != null)
- {
- numberMopped++;
- }
- }
- while (moppedMessage != null);
- System.out.println(numberMopped + " message(s) mopped.");
-
- // Now consume any outstanding messages for the topic subscriber
- System.out.print(CLASS + ": Mopping up messages from topic");
-
- if (_commit)
- {
- System.out.print(" (expecting " + 5 + ")...");
- }
- else
- {
- System.out.print(" (expecting none)...");
- }
-
- numberMopped=0;
- do
- {
- moppedMessage=topicMessageConsumer.receiveNoWait();
- if (moppedMessage != null)
- {
- numberMopped++;
- }
- }
- while (moppedMessage != null);
- System.out.println(numberMopped + " message(s) mopped.");
-
- // Close the QueueConnection to the server
- System.out.println(CLASS + ": Closing connection");
- connection.close();
-
- // Close the JNDI reference
- System.out.println(CLASS + ": Closing JNDI context");
- ctx.close();
- }
- catch (Exception exp)
- {
- System.err.println(CLASS + ": Caught an Exception: " + exp);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/transacted/transacted.properties b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/transacted/transacted.properties
deleted file mode 100644
index d93d19eea0..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/jmsexample/transacted/transacted.properties
+++ /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.
-#
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-
-# register some connection factories
-# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.qpidConnectionfactory = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.transactedQueue = transactedQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-topic.transactedTopic = transactedTopic \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageDispatcher.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageDispatcher.java
deleted file mode 100644
index 1849f733e9..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageDispatcher.java
+++ /dev/null
@@ -1,163 +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.
- *
- */
-package org.apache.qpid.example.publisher;
-
-import java.io.File;
-
-import javax.jms.JMSException;
-
-
-import org.apache.qpid.example.shared.FileUtils;
-import org.apache.qpid.example.shared.Statics;
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
-/**
- * Class that sends message files to the Publisher to distribute
- * using files as input
- * Must set properties for host in properties file or uses in vm broker
- */
-public class FileMessageDispatcher
-{
-
- protected static final Logger _logger = LoggerFactory.getLogger(FileMessageDispatcher.class);
-
- protected static Publisher _publisher = null;
-
- /**
- * To use this main method you need to specify a path or file to use for input
- * This class then uses file contents from the dir/file specified to generate
- * messages to publish
- * Intended to be a very simple way to get going with publishing using the broker
- * @param args - must specify one value, the path to file(s) for publisher
- */
- public static void main(String[] args)
- {
-
- // Check command line args ok - must provide a path or file for us to dispatch
- if (args.length == 0)
- {
- System.out.println("Usage: FileMessageDispatcher <filesToDispatch>" + "");
- }
- else
- {
- try
- {
- // publish message(s) from file(s) to configured queue
- publish(args[0]);
-
- // Move payload file(s) to archive location as no error
- FileUtils.moveFileToNewDir(args[0], System.getProperties().getProperty(Statics.ARCHIVE_PATH));
- }
- catch (Exception e)
- {
- // log error and exit
- _logger.error("Error trying to dispatch message: " + e);
- System.exit(1);
- }
- finally
- {
- // clean up before exiting
- if (getPublisher() != null)
- {
- getPublisher().cleanup();
- }
- }
- }
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Finished dispatching message");
- }
-
- System.exit(0);
- }
-
- /**
- * Publish the content of a file or files from a directory as messages
- * @param path - from main args
- * @throws JMSException
- * @throws MessageFactoryException - if cannot create message from file content
- */
- public static void publish(String path) throws JMSException, MessageFactoryException
- {
- File tempFile = new File(path);
- if (tempFile.isDirectory())
- {
- // while more files in dir publish them
- File[] files = tempFile.listFiles();
-
- if ((files == null) || (files.length == 0))
- {
- _logger.info("FileMessageDispatcher - No files to publish in input directory: " + tempFile);
- }
- else
- {
- for (File file : files)
- {
- // Create message factory passing in payload path
- FileMessageFactory factory = new FileMessageFactory(getPublisher().getSession(), file.toString());
-
- // Send the message generated from the payload using the _publisher
- getPublisher().sendMessage(factory.createEventMessage());
-
- }
- }
- }
- else
- {
- // handle a single file
- // Create message factory passing in payload path
- FileMessageFactory factory = new FileMessageFactory(getPublisher().getSession(), tempFile.toString());
-
- // Send the message generated from the payload using the _publisher
- getPublisher().sendMessage(factory.createEventMessage());
- }
- }
-
- /**
- * Cleanup before exit
- */
- public static void cleanup()
- {
- if (getPublisher() != null)
- {
- getPublisher().cleanup();
- }
- }
-
- /**
- * @return A Publisher instance
- */
- private static Publisher getPublisher()
- {
- if (_publisher != null)
- {
- return _publisher;
- }
-
- // Create a _publisher
- _publisher = new Publisher();
-
- return _publisher;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageFactory.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageFactory.java
deleted file mode 100644
index 1240284a56..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageFactory.java
+++ /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.
- */
-
-package org.apache.qpid.example.publisher;
-
-import org.apache.qpid.example.shared.FileUtils;
-import org.apache.qpid.example.shared.Statics;
-
-import java.io.*;
-import javax.jms.*;
-
-public class FileMessageFactory
-{
- protected final Session _session;
- protected final String _payload;
- protected final String _filename;
-
- /**
- * Contructs and instance using a filename from which content will be used to create message
- * @param session
- * @param filename
- * @throws MessageFactoryException
- */
- public FileMessageFactory(Session session, String filename) throws MessageFactoryException
- {
- try
- {
- _filename = filename;
- _payload = FileUtils.getFileContent(filename);
- _session = session;
- }
- catch (IOException e)
- {
- MessageFactoryException mfe = new MessageFactoryException(e.toString(), e);
- throw mfe;
- }
- }
-
- /**
- * Creates a text message and sets filename property on it
- * The filename property is purely intended to provide visibility
- * of file content passing trhough the broker using example classes
- * @return Message - a TextMessage with content from file
- * @throws JMSException
- */
- public Message createEventMessage() throws JMSException
- {
- TextMessage msg = _session.createTextMessage();
- msg.setText(_payload);
- msg.setStringProperty(Statics.FILENAME_PROPERTY, new File(_filename).getName());
-
- return msg;
- }
-
- /**
- * Creates message from a string for use by the monitor
- * @param session
- * @param textMsg - message content
- * @return Message - TextMessage with content from String
- * @throws JMSException
- */
- public static Message createSimpleEventMessage(Session session, String textMsg) throws JMSException
- {
- TextMessage msg = session.createTextMessage();
- msg.setText(textMsg);
-
- return msg;
- }
-
- public Message createShutdownMessage() throws JMSException
- {
- return _session.createTextMessage("SHUTDOWN");
- }
-
- public Message createReportRequestMessage() throws JMSException
- {
- return _session.createTextMessage("REPORT");
- }
-
- public Message createReportResponseMessage(String msg) throws JMSException
- {
- return _session.createTextMessage(msg);
- }
-
- public boolean isShutdown(Message m)
- {
- return checkText(m, "SHUTDOWN");
- }
-
- public boolean isReport(Message m)
- {
- return checkText(m, "REPORT");
- }
-
- public Object getReport(Message m)
- {
- try
- {
- return ((TextMessage) m).getText();
- }
- catch (JMSException e)
- {
- e.printStackTrace(System.out);
-
- return e.toString();
- }
- }
-
- private static boolean checkText(Message m, String s)
- {
- try
- {
- return (m instanceof TextMessage) && ((TextMessage) m).getText().equals(s);
- }
- catch (JMSException e)
- {
- e.printStackTrace(System.out);
-
- return false;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java
deleted file mode 100644
index d709da6432..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java
+++ /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.
- *
- */
-package org.apache.qpid.example.publisher;
-
-public class MessageFactoryException extends Exception
-{
- public MessageFactoryException(String msg, Throwable t)
- {
- super(msg, t);
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorMessageDispatcher.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorMessageDispatcher.java
deleted file mode 100644
index 3d16e01af4..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorMessageDispatcher.java
+++ /dev/null
@@ -1,141 +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.
- */
-package org.apache.qpid.example.publisher;
-
-
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-
-/**
- * Class that sends heartbeat messages to allow monitoring of message consumption Sends regular (currently 20 seconds
- * apart) heartbeat message
- */
-public class MonitorMessageDispatcher
-{
-
- private static final Logger _logger = LoggerFactory.getLogger(MonitorMessageDispatcher.class);
-
- protected static MonitorPublisher _monitorPublisher = null;
-
- protected static final String DEFAULT_MONITOR_PUB_NAME = "MonitorPublisher";
-
- /**
- * Easy entry point for running a message dispatcher for monitoring consumption
- * Sends 1000 messages with no delay
- *
- * @param args
- */
- public static void main(String[] args)
- {
- //Switch on logging appropriately for your app
- try
- {
- int i =0;
- while (i < 1000)
- {
- try
- {
- //endlessly publish messages to monitor queue
- publish();
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Dispatched monitor message");
- }
-
- //sleep for twenty seconds and then publish again - change if appropriate
- //Thread.sleep(1000);
- i++ ;
- }
- catch (UndeliveredMessageException a)
- {
- //trigger application specific failure handling here
- _logger.error("Problem delivering monitor message");
- break;
- }
- }
- }
- catch (Exception e)
- {
- _logger.error("Error trying to dispatch AMS monitor message: " + e);
- System.exit(1);
- }
- finally
- {
- if (getMonitorPublisher() != null)
- {
- getMonitorPublisher().cleanup();
- }
- }
-
- System.exit(1);
- }
-
- /**
- * Publish heartbeat message
- *
- * @throws JMSException
- * @throws UndeliveredMessageException
- */
- public static void publish() throws JMSException, UndeliveredMessageException
- {
- //Send the message generated from the payload using the _publisher
-// getMonitorPublisher().sendImmediateMessage
-// (FileMessageFactory.createSimpleEventMessage(getMonitorPublisher().getSession(),"monitor:" +System.currentTimeMillis()));
-
- getMonitorPublisher().sendMessage
- (getMonitorPublisher()._session,
- FileMessageFactory.createSimpleEventMessage(getMonitorPublisher().getSession(), "monitor:" + System.currentTimeMillis()),
- DeliveryMode.PERSISTENT, false, true);
-
- }
-
- /** Cleanup publishers */
- public static void cleanup()
- {
- if (getMonitorPublisher() != null)
- {
- getMonitorPublisher().cleanup();
- }
-
- if (getMonitorPublisher() != null)
- {
- getMonitorPublisher().cleanup();
- }
- }
-
- //Returns a _publisher for the monitor queue
- private static MonitorPublisher getMonitorPublisher()
- {
- if (_monitorPublisher != null)
- {
- return _monitorPublisher;
- }
-
- //Create a _publisher using failover details and constant for monitor queue
- _monitorPublisher = new MonitorPublisher();
-
- _monitorPublisher.setName(MonitorMessageDispatcher.DEFAULT_MONITOR_PUB_NAME);
- return _monitorPublisher;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorPublisher.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorPublisher.java
deleted file mode 100644
index 750f57d9dc..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorPublisher.java
+++ /dev/null
@@ -1,105 +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.
- */
-package org.apache.qpid.example.publisher;
-
-import org.apache.qpid.client.BasicMessageProducer;
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Session;
-
-/**
- * Subclass of Publisher which uses QPID functionality to send a heartbeat message Note immediate flag not available via
- * JMS MessageProducer
- */
-public class MonitorPublisher extends Publisher
-{
-
- private static final Logger _log = LoggerFactory.getLogger(Publisher.class);
-
- BasicMessageProducer _producer;
-
- public MonitorPublisher()
- {
- super();
- }
-
- /*
- * Publishes a message using given details
- */
- public boolean sendMessage(Session session, Message message, int deliveryMode,
- boolean immediate, boolean commit) throws UndeliveredMessageException
- {
- try
- {
- _producer = (BasicMessageProducer) session.createProducer(_destination);
-
- _producer.send(message, deliveryMode, immediate);
-
- if (commit)
- {
- //commit the message send and close the transaction
- _session.commit();
- }
-
- }
- catch (JMSException e)
- {
- //Have to assume our commit failed but do not rollback here as channel closed
- _log.error("JMSException", e);
- e.printStackTrace();
- throw new UndeliveredMessageException("Cannot deliver immediate message", e);
- }
-
- _log.info(_name + " finished sending message: " + message);
- return true;
- }
-
- /*
- * Publishes a non-persistent message using transacted session
- */
- public boolean sendImmediateMessage(Message message) throws UndeliveredMessageException
- {
- try
- {
- _producer = (BasicMessageProducer) _session.createProducer(_destination);
-
- //Send message via our producer which is not persistent and is immediate
- //NB: not available via jms interface MessageProducer
- _producer.send(message, DeliveryMode.NON_PERSISTENT, true);
-
- //commit the message send and close the transaction
- _session.commit();
-
- }
- catch (JMSException e)
- {
- //Have to assume our commit failed but do not rollback here as channel closed
- _log.error("JMSException", e);
- e.printStackTrace();
- throw new UndeliveredMessageException("Cannot deliver immediate message", e);
- }
-
- _log.info(_name + " finished sending message: " + message);
- return true;
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java
deleted file mode 100644
index 87fc543dbe..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java
+++ /dev/null
@@ -1,181 +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.
- */
-package org.apache.qpid.example.publisher;
-
-import org.apache.qpid.client.AMQConnectionFactory;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.DeliveryMode;
-import javax.jms.Queue;
-import javax.jms.MessageProducer;
-import javax.jms.Connection;
-import javax.jms.Session;
-
-import javax.naming.InitialContext;
-
-import org.apache.qpid.example.shared.InitialContextHelper;
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
-public class Publisher
-{
- private static final Logger _log = LoggerFactory.getLogger(Publisher.class);
-
- protected InitialContextHelper _contextHelper;
-
- protected Connection _connection;
-
- protected Session _session;
-
- protected MessageProducer _producer;
-
- protected String _destinationDir;
-
- protected String _name = "Publisher";
-
- protected Queue _destination;
-
- protected static final String _defaultDestinationDir = "/tmp";
-
- /**
- * Creates a Publisher instance using properties from example.properties
- * See InitialContextHelper for details of how context etc created
- */
- public Publisher()
- {
- try
- {
- //get an initial context from default properties
- _contextHelper = new InitialContextHelper(null);
- InitialContext ctx = _contextHelper.getInitialContext();
-
- //then create a connection using the AMQConnectionFactory
- AMQConnectionFactory cf = (AMQConnectionFactory) ctx.lookup("local");
- _connection = cf.createConnection();
-
- //create a transactional session
- _session = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
-
- //lookup the example queue and use it
- //Queue is non-exclusive and not deleted when last consumer detaches
- _destination = (Queue) ctx.lookup("MyQueue");
-
- //create a message producer
- _producer = _session.createProducer(_destination);
-
- //set destination dir for files that have been processed
- _destinationDir = _defaultDestinationDir;
-
- _connection.start();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- _log.error("Exception", e);
- }
- }
-
- /**
- * Publishes a non-persistent message using transacted session
- * Note that persistent is the default mode for send - so need to specify for transient
- */
- public boolean sendMessage(Message message)
- {
- try
- {
- //Send message via our producer which is not persistent
- _producer.send(message, DeliveryMode.NON_PERSISTENT, _producer.getPriority(), _producer.getTimeToLive());
-
- //commit the message send and close the transaction
- _session.commit();
-
- }
- catch (JMSException e)
- {
- //Have to assume our commit failed and rollback here
- try
- {
- _session.rollback();
- _log.error("JMSException", e);
- e.printStackTrace();
- return false;
- }
- catch (JMSException j)
- {
- _log.error("Unable to rollback publish transaction ",e);
- return false;
- }
- }
-
- _log.info(_name + " finished sending message: " + message);
- return true;
- }
-
- /**
- * Cleanup resources before exit
- */
- public void cleanup()
- {
- try
- {
- if (_connection != null)
- {
- _connection.stop();
- _connection.close();
- }
- _connection = null;
- _producer = null;
- }
- catch(Exception e)
- {
- _log.error("Error trying to cleanup publisher " + e);
- System.exit(1);
- }
- }
-
- /**
- * Exposes session
- * @return Session
- */
- public Session getSession()
- {
- return _session;
- }
-
- public String getDestinationDir()
- {
- return _destinationDir;
- }
-
- public void setDestinationDir(String destinationDir)
- {
- _destinationDir = destinationDir;
- }
-
- public String getName()
- {
- return _name;
- }
-
- public void setName(String _name) {
- this._name = _name;
- }
-}
-
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java
deleted file mode 100644
index 245008b68a..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java
+++ /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.
- *
- */
-package org.apache.qpid.example.publisher;
-
-/**
- * Exception thrown by monitor when cannot send a message marked for immediate delivery
- */
-public class UndeliveredMessageException extends Exception
-{
- public UndeliveredMessageException(String msg, Throwable t)
- {
- super(msg, t);
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Client.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Client.java
deleted file mode 100644
index e32ee0ba73..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Client.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.example.pubsub;
-
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Session;
-import javax.naming.NamingException;
-
-/**
- * An abstract base class that wraps up the creation of a JMS client utilising JNDI
- */
-public abstract class Client
-{
- protected ConnectionSetup _setup;
-
- protected Connection _connection;
- protected Destination _destination;
- protected Session _session;
-
- public Client(String destination)
- {
- if (destination == null)
- {
- destination = ConnectionSetup.TOPIC_JNDI_NAME;
- }
-
- try
- {
- _setup = new ConnectionSetup();
- }
- catch (NamingException e)
- {
- //ignore
- }
-
- if (_setup != null)
- {
- try
- {
- _connection = _setup.getConnectionFactory().createConnection();
- _destination = _setup.getDestination(destination);
- }
- catch (JMSException e)
- {
- System.err.println(e.getMessage());
- }
- }
- }
-
- public abstract void start();
-
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/ConnectionSetup.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/ConnectionSetup.java
deleted file mode 100644
index c4edd9034f..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/ConnectionSetup.java
+++ /dev/null
@@ -1,123 +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.
- *
- *
- */
-package org.apache.qpid.example.pubsub;
-
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.Properties;
-
-/**
- * This ConnectionSetup is a wrapper around JNDI it creates a number of entries.
- *
- * It is equivalent to a PropertyFile of value:
- *
- * connectionfactory.local=amqp://guest:guest@clientid/test?brokerlist='localhost'
- * connectionfactory.vm=amqp://guest:guest@clientid/test?brokerlist='vm://:1'
- *
- * queue.queue=example.MyQueue
- * topic.topic=example.hierarical.topic
- *
- */
-public class ConnectionSetup
-{
- final static String INITIAL_CONTEXT_FACTORY = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
-
- final static String CONNECTION_JNDI_NAME = "local";
- final static String CONNECTION_NAME = "amqp://guest:guest@clientid/test?brokerlist='localhost'";
-
- public static final String QUEUE_JNDI_NAME = "queue";
- final static String QUEUE_NAME = "example.MyQueue";
-
- public static final String TOPIC_JNDI_NAME = "topic";
- final static String TOPIC_NAME = "example.hierarical.topic";
-
- private Context _ctx;
-
- public ConnectionSetup() throws NamingException
- {
-
- // Set the properties ...
- Properties properties = new Properties();
- properties.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);
- properties.put("connectionfactory." + CONNECTION_JNDI_NAME, CONNECTION_NAME);
- properties.put("connectionfactory." + "vm", "amqp://guest:guest@clientid/test?brokerlist='vm://:1'");
-
- properties.put("queue." + QUEUE_JNDI_NAME, QUEUE_NAME);
- properties.put("topic." + TOPIC_JNDI_NAME, TOPIC_NAME);
- // Create the initial context
- _ctx = new InitialContext(properties);
-
- }
-
- public ConnectionSetup(Properties properties) throws NamingException
- {
- _ctx = new InitialContext(properties);
- }
-
- public ConnectionFactory getConnectionFactory()
- {
-
- // Perform the lookups
- try
- {
- return (ConnectionFactory) _ctx.lookup(CONNECTION_JNDI_NAME);
- }
- catch (NamingException e)
- {
- //ignore
- }
- return null;
- }
-
- public Destination getDestination(String jndiName)
- {
- // Perform the lookups
- try
- {
- return (Destination) _ctx.lookup(jndiName);
- }
- catch (ClassCastException cce)
- {
- //ignore
- }
- catch (NamingException ne)
- {
- //ignore
- }
- return null;
- }
-
-
- public void close()
- {
- try
- {
- _ctx.close();
- }
- catch (NamingException e)
- {
- //ignore
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Publisher.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Publisher.java
deleted file mode 100644
index dd936e429f..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Publisher.java
+++ /dev/null
@@ -1,81 +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.
- *
- *
- */
-package org.apache.qpid.example.pubsub;
-
-import javax.jms.JMSException;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-/**
- * A simple Publisher example.
- *
- * The class can take two arguments.
- * java Publisher <destination> <msgCount>
- * Where:
- * destination is either 'topic' or 'queue' (Default: topic)
- * msgCount is the number of messages to send (Default : 100)
- *
- */
-public class Publisher extends Client
-{
- int _msgCount;
-
- public Publisher(String destination, int msgCount)
- {
- super(destination);
- _msgCount = msgCount;
- }
-
- public void start()
- {
- try
- {
- _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- MessageProducer _producer = _session.createProducer(_destination);
-
- for (int msgCount = 0; msgCount < _msgCount; msgCount++)
- {
- _producer.send(_session.createTextMessage("msg:" + msgCount));
- System.out.println("Sent:" + msgCount);
- }
-
- System.out.println("Done.");
- _connection.close();
- }
- catch (JMSException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
-
-
- public static void main(String[] args)
- {
-
- String destination = args.length > 2 ? args[1] : null;
-
- int msgCount = args.length > 2 ? Integer.parseInt(args[2]) : 100;
-
- new Publisher(destination, msgCount).start();
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Subscriber.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Subscriber.java
deleted file mode 100644
index f2d736701f..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Subscriber.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.example.pubsub;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import java.util.concurrent.CountDownLatch;
-
-
-/**
- * Simple client that listens for the specified number of msgs on the given Destinaton
- *
- * The class can take two arguments.
- * java Subscriber <destination> <msgCount>
- * Where:
- * destination is either 'topic' or 'queue' (Default: topic)
- * msgCount is the number of messages to send (Default : 100)
- */
-public class Subscriber extends Client implements MessageListener
-{
-
- CountDownLatch _count;
-
- public Subscriber(String destination, int msgCount)
- {
- super(destination);
- _count = new CountDownLatch(msgCount);
- }
-
-
- public void start()
- {
- try
- {
- _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _session.createDurableSubscriber((Topic) _setup.getDestination(ConnectionSetup.TOPIC_JNDI_NAME),
- "exampleClient").setMessageListener(this);
- _connection.start();
- _count.await();
-
- System.out.println("Done");
-
- _connection.close();
- }
- catch (JMSException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- catch (InterruptedException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
-
- public static void main(String[] args)
- {
- String destination = args.length > 2 ? args[1] : null;
- int msgCount = args.length > 2 ? Integer.parseInt(args[2]) : 100;
-
- new Subscriber(destination, msgCount).start();
- }
-
- public void onMessage(Message message)
- {
- try
- {
- _count.countDown();
- System.out.println("Received msg:" + ((TextMessage) message).getText());
- }
- catch (JMSException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java
deleted file mode 100644
index 1a3d596a24..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java
+++ /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.
- *
- */
-package org.apache.qpid.example.shared;
-
-public class ConnectionException extends Exception
-{
- public ConnectionException(String msg, Throwable t)
- {
- super(msg, t);
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.java
deleted file mode 100644
index 2987a9559b..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.java
+++ /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.
- *
- */
-package org.apache.qpid.example.shared;
-
-public class ContextException extends Exception
-{
- public ContextException(String msg, Throwable t)
- {
- super(msg, t);
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/FileUtils.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/FileUtils.java
deleted file mode 100644
index 54446cb6a7..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/FileUtils.java
+++ /dev/null
@@ -1,168 +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.
- */
-package org.apache.qpid.example.shared;
-
-import java.io.*;
-
-/**
- * Class that provides file related utility methods for utility use
- */
-public class FileUtils {
-
-
- //Reads file content into String
- public static String getFileContent(String filePath) throws IOException
- {
-
- BufferedReader reader = null;
- String tempData = "";
- String eol = "\n\r";
-
- try
- {
- String line;
- reader = new BufferedReader(new FileReader(filePath));
- while ((line = reader.readLine()) != null)
- {
- if (!tempData.equals(""))
- {
- tempData = tempData + eol + line;
- }
- else
- {
- tempData = line;
- }
- }
- }
- finally
- {
- if (reader != null)
- {
- reader.close();
- }
- }
- return tempData;
- }
-
- /*
- * Reads xml from a file and returns it as an array of chars
- */
- public static char[] getFileAsCharArray(String filePath) throws IOException
- {
- BufferedReader reader = null;
- char[] tempChars = null;
- String tempData = "";
-
- try
- {
- String line;
- reader = new BufferedReader(new FileReader(filePath));
- while ((line = reader.readLine()) != null)
- {
- tempData = tempData + line;
- }
- tempChars = tempData.toCharArray();
- }
- finally
- {
- if (reader != null)
- {
- reader.close();
- }
- }
- return tempChars;
- }
-
- /*
- * Write String content to filename provided
- */
- public static void writeStringToFile(String content, String path) throws IOException
- {
-
- BufferedWriter writer = new BufferedWriter(new FileWriter(new File(path)));
- writer.write(content);
- writer.flush();
- writer.close();
- }
-
- /*
- * Allows moving of files to a new dir and preserves the last bit of the name only
- */
- public static void moveFileToNewDir(String path, String newDir) throws IOException
- {
- //get file name from current path
- //while more files in dir publish them
- File pathFile = new File(path);
- if (pathFile.isDirectory())
- {
- File[] files = pathFile.listFiles();
- for (File file : files)
- {
- moveFileToNewDir(file,newDir);
- }
- }
- }
-
- /*
- * Allows moving of a file to a new dir and preserves the last bit of the name only
- */
- public static void moveFileToNewDir(File fileToMove, String newDir) throws IOException
- {
- moveFile(fileToMove,getArchiveFileName(fileToMove,newDir));
- }
-
- /*
- * Moves file from a given path to a new path with String params
- */
- public static void moveFile(String fromPath, String dest) throws IOException
- {
- moveFile(new File(fromPath),new File(dest));
- }
-
- /*
- * Moves file from a given path to a new path with mixed params
- */
- public static void moveFile(File fileToMove, String dest) throws IOException
- {
- moveFile(fileToMove,new File(dest));
- }
-
- /*
- * Moves file from a given path to a new path with File params
- */
- public static void moveFile(File fileToMove, File dest) throws IOException
- {
- fileToMove.renameTo(dest);
- }
-
- /*
- * Deletes a given file
- */
- public static void deleteFile(String filePath) throws IOException
- {
- new File(filePath).delete();
- }
-
- private static String getArchiveFileName(File fileToMove, String archiveDir)
- {
- //get file name from current path
- String fileName = fileToMove.getName();
- return archiveDir + File.separator + fileName;
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.java
deleted file mode 100644
index 1328816602..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.java
+++ /dev/null
@@ -1,81 +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.
- *
- */
-package org.apache.qpid.example.shared;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
-/**
- * Class that provides helper methods for JNDI
- */
-public class InitialContextHelper
-{
-
- public static final String _defaultPropertiesName = "example.properties";
- protected static Properties _fileProperties;
- protected static InitialContext _initialContext;
- protected static final Logger _log = LoggerFactory.getLogger(InitialContextHelper.class);
-
- public InitialContextHelper(String propertiesName) throws ContextException
- {
- try
- {
- if ((propertiesName == null) || (propertiesName.length() == 0))
- {
- propertiesName = _defaultPropertiesName;
- }
-
- _fileProperties = new Properties();
- ClassLoader cl = this.getClass().getClassLoader();
-
- // NB: Need to change path to reflect package if moving classes around !
- InputStream is = cl.getResourceAsStream("org/apache/qpid/example/shared/" + propertiesName);
- _fileProperties.load(is);
- _initialContext = new InitialContext(_fileProperties);
- }
- catch (IOException e)
- {
- throw new ContextException(e.toString(), e);
- }
- catch (NamingException n)
- {
- throw new ContextException(n.toString(), n);
- }
- }
-
- public Properties getFileProperties()
- {
- return _fileProperties;
- }
-
- public InitialContext getInitialContext()
- {
- return _initialContext;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/Statics.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/Statics.java
deleted file mode 100644
index c056f8a7da..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/Statics.java
+++ /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.
- */
-package org.apache.qpid.example.shared;
-
-/**
- * Constants used by AMS Publisher/Subscriber classes
- */
-public class Statics {
-
- public static final String TOPIC_NAME = "EXAMPLE_TOPIC";
-
- public static final String QUEUE_NAME = "EXAMPLE_QUEUE";
-
- public static final String MONITOR_QUEUE_SUFFIX = "_MONITOR";
-
- public static final String HOST_PROPERTY = "host";
-
- public static final String PORT_PROPERTY = "port";
-
- public static final String USER_PROPERTY = "user";
-
- public static final String PWD_PROPERTY = "pwd";
-
- public static final String TOPIC_PROPERTY = "topic";
-
- public static final String QUEUE_PROPERTY = "queue";
-
- public static final String VIRTUAL_PATH_PROPERTY = "virtualpath";
-
- public static final String ARCHIVE_PATH = "archivepath";
-
- public static final String CLIENT_PROPERTY = "client";
-
- public static final String FILENAME_PROPERTY = "filename";
-
- public static final String DEFAULT_USER = "guest";
-
- public static final String DEFAULT_PWD = "guest";
-
-
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/example.properties b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/example.properties
deleted file mode 100644
index a60e3964ad..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/shared/example.properties
+++ /dev/null
@@ -1,39 +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.
-
-
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-
-# use the following property to configure the default connector
-#java.naming.provider.url - ignored.
-
-# register some connection factories
-# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.local = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.MyQueue = example.MyQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-topic.ibmStocks = stocks.nyse.ibm
-
-# Register an AMQP destination in JNDI
-# NOTE: Qpid currently only supports direct,topics and headers
-# destination.[jniName] = [BindingURL]
-destination.direct = direct://amq.direct//directQueue
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/simple/reqresp/Client.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/simple/reqresp/Client.java
deleted file mode 100644
index 8a0ff88448..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/simple/reqresp/Client.java
+++ /dev/null
@@ -1,263 +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.
- *
- */
-
-package org.apache.qpid.example.simple.reqresp;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.Properties;
-import java.util.concurrent.CountDownLatch;
-
-public class Client implements MessageListener
-{
- final String BROKER = "localhost";
-
- final String INITIAL_CONTEXT_FACTORY = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
-
- final String CONNECTION_JNDI_NAME = "local";
- final String CONNECTION_NAME = "amqp://guest:guest@clientid/test?brokerlist='" + BROKER + "'";
-
- final String QUEUE_JNDI_NAME = "queue";
- final String QUEUE_NAME = "example.RequestQueue";
-
-
- private InitialContext _ctx;
-
- private CountDownLatch _shutdownHook = new CountDownLatch(1);
-
- public Client()
- {
- setupJNDI();
-
- Connection connection;
- Session session;
- Destination responseQueue;
-
- //Setup the connection. Create producer to sent message and consumer to receive the repsonse.
- MessageProducer _producer;
- try
- {
- connection = ((ConnectionFactory) lookupJNDI(CONNECTION_JNDI_NAME)).createConnection();
-
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Destination requestQueue = (Queue) lookupJNDI(QUEUE_JNDI_NAME);
-
- closeJNDI();
-
- //Setup a message _producer to send message to the queue the server is consuming from
- _producer = session.createProducer(requestQueue);
-
- //Create a temporary queue that this client will listen for responses on then create a consumer
- //that consumes message from this temporary queue.
- responseQueue = session.createTemporaryQueue();
-
- MessageConsumer responseConsumer = session.createConsumer(responseQueue);
-
- //Set a listener to asynchronously deal with responses.
- responseConsumer.setMessageListener(this);
-
- // Now the connection is setup up start it.
- connection.start();
- }
- catch (JMSException e)
- {
- System.err.println("Unable to setup connection, client and producer on broker");
- return;
- }
-
- // Setup the message to send
- TextMessage txtMessage;
- try
- {
- //Now create the actual message you want to send
- txtMessage = session.createTextMessage("Request Process");
-
- //Set the reply to field to the temp queue you created above, this is the queue the server will respond to
- txtMessage.setJMSReplyTo(responseQueue);
-
- //Set a correlation ID so when you get a response you know which sent message the response is for
- //If there is never more than one outstanding message to the server then the
- //same correlation ID can be used for all the messages...if there is more than one outstanding
- //message to the server you would presumably want to associate the correlation ID with this message
-
- txtMessage.setJMSCorrelationID(txtMessage.getJMSMessageID());
- }
- catch (JMSException e)
- {
- System.err.println("Unable to create message");
- return;
-
- }
-
- try
- {
- _producer.send(txtMessage);
- }
- catch (JMSException e)
- {
- //Handle the exception appropriately
- }
-
- try
- {
- System.out.println("Sent Request Message ID :" + txtMessage.getJMSMessageID());
- }
- catch (JMSException e)
- {
- //Handle exception more appropriately.
- }
-
- //Wait for the return message to arrive
- try
- {
- _shutdownHook.await();
- }
- catch (InterruptedException e)
- {
- // Ignore this as we are quitting anyway.
- }
-
- //Close the connection
- try
- {
- connection.close();
- }
- catch (JMSException e)
- {
- System.err.println("A problem occured while shutting down the connection : " + e);
- }
- }
-
-
- /**
- * Implementation of the Message Listener interface.
- * This is where message will be asynchronously delivered.
- *
- * @param message
- */
- public void onMessage(Message message)
- {
- String messageText;
- try
- {
- if (message instanceof TextMessage)
- {
- TextMessage textMessage = (TextMessage) message;
- messageText = textMessage.getText();
- System.out.println("messageText = " + messageText);
- System.out.println("Correlation ID " + message.getJMSCorrelationID());
-
- _shutdownHook.countDown();
- }
- else
- {
- System.err.println("Unexpected message delivered");
- }
- }
- catch (JMSException e)
- {
- //Handle the exception appropriately
- }
- }
-
- /**
- * Lookup the specified name in the JNDI Context.
- *
- * @param name The string name of the object to lookup
- *
- * @return The object or null if nothing exists for specified name
- */
- private Object lookupJNDI(String name)
- {
- try
- {
- return _ctx.lookup(name);
- }
- catch (NamingException e)
- {
- System.err.println("Error looking up '" + name + "' in JNDI Context:" + e);
- }
-
- return null;
- }
-
- /**
- * Setup the JNDI context.
- *
- * In this case we are simply using a Properties object to store the pairing information.
- *
- * Further details can be found on the wiki site here:
- *
- * @see : http://cwiki.apache.org/qpid/how-to-use-jndi.html
- */
- private void setupJNDI()
- {
- // Set the properties ...
- Properties properties = new Properties();
- properties.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);
- properties.put("connectionfactory." + CONNECTION_JNDI_NAME, CONNECTION_NAME);
- properties.put("queue." + QUEUE_JNDI_NAME, QUEUE_NAME);
-
- // Create the initial context
- Context ctx = null;
- try
- {
- _ctx = new InitialContext(properties);
- }
- catch (NamingException e)
- {
- System.err.println("Error Setting up JNDI Context:" + e);
- }
- }
-
- /** Close the JNDI Context to keep everything happy. */
- private void closeJNDI()
- {
- try
- {
- _ctx.close();
- }
- catch (NamingException e)
- {
- System.err.println("Unable to close JNDI Context : " + e);
- }
- }
-
-
- public static void main(String[] args)
- {
- new Client();
- }
-}
-
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/simple/reqresp/Server.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/simple/reqresp/Server.java
deleted file mode 100644
index 9c284eee97..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/simple/reqresp/Server.java
+++ /dev/null
@@ -1,236 +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.
- *
- */
-
-package org.apache.qpid.example.simple.reqresp;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.Properties;
-import java.util.concurrent.CountDownLatch;
-import java.io.BufferedReader;
-import java.io.BufferedInputStream;
-import java.io.Reader;
-import java.io.InputStreamReader;
-import java.io.IOException;
-
-public class Server implements MessageListener
-{
- final String BROKER = "localhost";
-
- final String INITIAL_CONTEXT_FACTORY = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
-
- final String CONNECTION_JNDI_NAME = "local";
- final String CONNECTION_NAME = "amqp://guest:guest@clientid/test?brokerlist='" + BROKER + "'";
-
- final String QUEUE_JNDI_NAME = "queue";
- final String QUEUE_NAME = "example.RequestQueue";
-
-
- private InitialContext _ctx;
- private Session _session;
- private MessageProducer _replyProducer;
- private CountDownLatch _shutdownHook = new CountDownLatch(1);
-
- public Server()
- {
- setupJNDI();
-
- Connection connection;
- try
- {
- connection = ((ConnectionFactory) lookupJNDI(CONNECTION_JNDI_NAME)).createConnection();
-
- _session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Destination requestQueue = (Queue) lookupJNDI(QUEUE_JNDI_NAME);
-
- closeJNDI();
-
- //Setup a message producer to respond to messages from clients, we will get the destination
- //to send to from the JMSReplyTo header field from a Message so we MUST set the destination here to null.
- this._replyProducer = _session.createProducer(null);
-
- //Set up a consumer to consume messages off of the request queue
- MessageConsumer consumer = _session.createConsumer(requestQueue);
- consumer.setMessageListener(this);
-
- //Now start the connection
- connection.start();
- }
- catch (JMSException e)
- {
- //Handle the exception appropriately
- System.err.println("JMSException occured setting up server :" + e);
- return;
- }
-
- System.out.println("Server process started and waiting for messages.");
-
- //Wait to process an single message then quit.
- while (_shutdownHook.getCount() != 0)
- {
- try
- {
- _shutdownHook.await();
- }
- catch (InterruptedException e)
- {
- // Ignore this as we are quitting anyway.
- }
- }
-
- //Close the connection
- try
- {
- connection.close();
- }
- catch (JMSException e)
- {
- System.err.println("A problem occured while shutting down the connection : " + e);
- }
- }
-
- public void onMessage(Message message)
- {
- try
- {
- TextMessage response = this._session.createTextMessage();
-
- //Check we have the right message type.
- if (message instanceof TextMessage)
- {
- TextMessage txtMsg = (TextMessage) message;
- String messageText = txtMsg.getText();
-
- //Perform the request
- System.out.println("Received request:" + messageText + " for message :" + message.getJMSMessageID());
-
- //Set the response back to the client
- response.setText("Response to Request:" + messageText);
- }
-
- //Set the correlation ID from the received message to be the correlation id of the response message
- //this lets the client identify which message this is a response to if it has more than
- //one outstanding message to the server
- response.setJMSCorrelationID(message.getJMSMessageID());
-
- try
- {
- System.out.println("Received message press enter to send response....");
- new BufferedReader(new InputStreamReader(System.in)).readLine();
- }
- catch (IOException e)
- {
- //Error attemptying to pause
- }
-
- //Send the response to the Destination specified by the JMSReplyTo field of the received message.
- _replyProducer.send(message.getJMSReplyTo(), response);
- }
- catch (JMSException e)
- {
- //Handle the exception appropriately
- }
-
- _shutdownHook.countDown();
- }
-
- /**
- * Lookup the specified name in the JNDI Context.
- *
- * @param name The string name of the object to lookup
- *
- * @return The object or null if nothing exists for specified name
- */
- private Object lookupJNDI(String name)
- {
- try
- {
- return _ctx.lookup(name);
- }
- catch (NamingException e)
- {
- System.err.println("Error looking up '" + name + "' in JNDI Context:" + e);
- }
-
- return null;
- }
-
- /**
- * Setup the JNDI context.
- *
- * In this case we are simply using a Properties object to store the pairing information.
- *
- * Further details can be found on the wiki site here:
- *
- * @see : http://cwiki.apache.org/qpid/how-to-use-jndi.html
- */
- private void setupJNDI()
- {
- // Set the properties ...
- Properties properties = new Properties();
- properties.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);
- properties.put("connectionfactory." + CONNECTION_JNDI_NAME, CONNECTION_NAME);
- properties.put("queue." + QUEUE_JNDI_NAME, QUEUE_NAME);
-
- // Create the initial context
- Context ctx = null;
- try
- {
- _ctx = new InitialContext(properties);
- }
- catch (NamingException e)
- {
- System.err.println("Error Setting up JNDI Context:" + e);
- }
- }
-
- /** Close the JNDI Context to keep everything happy. */
- private void closeJNDI()
- {
- try
- {
- _ctx.close();
- }
- catch (NamingException e)
- {
- System.err.println("Unable to close JNDI Context : " + e);
- }
- }
-
-
- public static void main(String[] args)
- {
- new Server();
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java
deleted file mode 100644
index d43b823a13..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java
+++ /dev/null
@@ -1,139 +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.
- */
-package org.apache.qpid.example.subscriber;
-
-import org.apache.qpid.example.shared.Statics;
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
-import javax.jms.*;
-/**
- * Subclass of Subscriber which consumes a heartbeat message
- */
-
-public class MonitoredSubscriber extends Subscriber
-{
- protected String _monitorDestinationName;
-
- private static final Logger _logger = LoggerFactory.getLogger(MonitoredSubscriber.class);
-
- private static MessageConsumer _monitorConsumer;
-
- public MonitoredSubscriber()
- {
- super();
- //lookup queue name and append suffix
- _monitorDestinationName = _destination.toString() + Statics.MONITOR_QUEUE_SUFFIX;
- }
-
- /**
- * MessageListener implementation for this subscriber
- */
- public static class MonitorMessageListener implements MessageListener
- {
- private String _name;
-
- public MonitorMessageListener(String name)
- {
- _name = name;
-
- }
-
- /**
- * Listens for heartbeat messages and acknowledges them
- * @param message
- */
- public void onMessage(javax.jms.Message message)
- {
- _logger.info(_name + " monitor got message '" + message + "'");
-
- try
- {
- _logger.debug("Monitor acknowledging recieved message");
-
- //Now acknowledge the message to clear it from our queue
- message.acknowledge();
- }
- catch(JMSException j)
- {
- _logger.error("Monitor caught JMSException trying to acknowledge message receipt");
- j.printStackTrace();
- }
- catch(Exception e)
- {
- _logger.error("Monitor caught unexpected exception trying to handle message");
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Subscribes to Queue and attaches additional monitor listener
- */
- public void subscribeAndMonitor()
- {
- try
- {
- _connection = _connectionFactory.createConnection();
-
- //create a transactional session
- Session session = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
-
- //Queue is non-exclusive and not deleted when last consumer detaches
- Destination destination = session.createQueue(_monitorDestinationName);
-
- //Create a consumer with a destination of our queue which will use defaults for prefetch etc
- _monitorConsumer = session.createConsumer(destination);
-
- //give the monitor message listener a name of it's own
- _monitorConsumer.setMessageListener(new MonitoredSubscriber.MonitorMessageListener
- ("MonitorListener " + System.currentTimeMillis()));
-
- MonitoredSubscriber._logger.info("Starting monitored subscription ...");
-
- MonitoredSubscriber._connection.start();
-
- //and now start ordinary consumption too
- subscribe();
- }
- catch (Throwable t)
- {
- _logger.error("Fatal error: " + t);
- t.printStackTrace();
- }
- }
-
- /**
- * Stop consuming
- */
- public void stopMonitor()
- {
- try
- {
- _monitorConsumer.close();
- _monitorConsumer = null;
- stop();
- }
- catch(JMSException j)
- {
- _logger.error("JMSException trying to Subscriber.stop: " + j.getStackTrace());
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriptionWrapper.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriptionWrapper.java
deleted file mode 100644
index 5e78107182..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriptionWrapper.java
+++ /dev/null
@@ -1,47 +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.
- */
-package org.apache.qpid.example.subscriber;
-
-
-/**
- * Allows you to simply start a monitored subscriber
- */
-public class MonitoredSubscriptionWrapper {
-
- private static MonitoredSubscriber _subscriber;
-
- /**
- * Create a monitored subscriber and start it
- * @param args - no params required
- */
- public static void main(String args[])
- {
- _subscriber = new MonitoredSubscriber();
-
- _subscriber.subscribe();
- }
-
- /**
- * Stop subscribing now ...
- */
- public static void stop()
- {
- _subscriber.stop();
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java
deleted file mode 100644
index f75558299c..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java
+++ /dev/null
@@ -1,182 +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.
- */
-package org.apache.qpid.example.subscriber;
-
-import org.apache.qpid.client.AMQConnectionFactory;
-
-import javax.jms.*;
-import javax.jms.Connection;
-import javax.jms.MessageConsumer;
-import javax.jms.Session;
-import javax.naming.InitialContext;
-
-import org.apache.qpid.example.shared.InitialContextHelper;
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
-/**
- * Subscriber which consumes messages from a queue
- */
-
-public class Subscriber
-{
- private static final Logger _log = LoggerFactory.getLogger(Subscriber.class);
-
- protected static Connection _connection;
-
- protected static MessageConsumer _consumer;
-
- protected static InitialContextHelper _contextHelper;
-
- protected static AMQConnectionFactory _connectionFactory;
-
- protected Destination _destination;
-
- public Subscriber()
- {
- try
- {
- //get an initial context from default properties
- _contextHelper = new InitialContextHelper(null);
- InitialContext ctx = _contextHelper.getInitialContext();
-
- //then create a connection using the AMQConnectionFactory
- _connectionFactory = (AMQConnectionFactory) ctx.lookup("local");
-
- //lookup queue from context
- _destination = (Destination) ctx.lookup("MyQueue");
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- _log.error("Exception", e);
- }
- }
-
- /**
- * Listener class that handles messages
- */
- public static class ExampleMessageListener implements MessageListener
- {
- private String _name;
-
- public ExampleMessageListener(String name)
- {
- _name = name;
- }
-
- /**
- * Listens for message callbacks, handles and then acknowledges them
- * @param message - the message received
- */
- public void onMessage(javax.jms.Message message)
- {
- _log.info(_name + " got message '" + message + "'");
-
- try
- {
- //NB: Handle your message appropriately for your application here
- //do some stuff
-
- _log.debug("Acknowledging recieved message");
-
- //Now acknowledge the message to clear it from our queue
- message.acknowledge();
- }
- catch(JMSException j)
- {
- _log.error("JMSException trying to acknowledge message receipt");
- j.printStackTrace();
- }
- catch(Exception e)
- {
- _log.error("Unexpected exception trying to handle message");
- e.printStackTrace();
- }
- }
- }
-
- /**
- * Subscribes to example Queue and attaches listener
- */
- public void subscribe()
- {
- _log.info("Starting subscription ...");
-
- try
- {
- _connection = _connectionFactory.createConnection();
-
- //Non transactional session using client acknowledgement
- Session session = _connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- //Create a consumer with a destination of our queue which will use defaults for prefetch etc
- _consumer = session.createConsumer(_destination);
-
- //give the message listener a name of it's own
- _consumer.setMessageListener(new ExampleMessageListener("MessageListener " + System.currentTimeMillis()));
-
- _connection.start();
- }
- catch (Throwable t)
- {
- _log.error("Fatal error: " + t);
- t.printStackTrace();
- }
-
- _log.info("Waiting for messages ...");
-
- //wait for messages and sleep to survive failover
- try
- {
- while(true)
- {
- Thread.sleep(Long.MAX_VALUE);
- }
- }
- catch (Exception e)
- {
- _log.warn("Exception while Subscriber sleeping",e);
- }
- }
-
- /**
- * Stop consuming and close connection
- */
- public void stop()
- {
- try
- {
- _consumer.close();
- _consumer = null;
- _connection.stop();
- _connection.close();
- }
- catch(JMSException j)
- {
- _log.error("JMSException trying to Subscriber.stop: " + j.getStackTrace());
- }
- }
-
-}
-
-
-
-
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/SubscriptionWrapper.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/SubscriptionWrapper.java
deleted file mode 100644
index f8fbf63037..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/subscriber/SubscriptionWrapper.java
+++ /dev/null
@@ -1,46 +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.
- */
-package org.apache.qpid.example.subscriber;
-
-/**
- * Allows you to simply start a subscriber
- */
-public class SubscriptionWrapper {
-
- private static Subscriber _subscriber;
-
- /**
- * Create a subscriber and start it
- * @param args
- */
- public static void main(String args[])
- {
- _subscriber = new Subscriber();
-
- _subscriber.subscribe();
- }
-
- /**
- * Stop subscribing now ...
- */
- public static void stop()
- {
- _subscriber.stop();
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/transport/ExistingSocketConnectorDemo.java b/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/transport/ExistingSocketConnectorDemo.java
deleted file mode 100644
index d7eb138523..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/org/apache/qpid/example/transport/ExistingSocketConnectorDemo.java
+++ /dev/null
@@ -1,171 +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.
- *
- */
-
-package org.apache.qpid.example.transport;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.jms.ConnectionListener;
-import org.apache.qpid.url.URLSyntaxException;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.nio.channels.SocketChannel;
-import java.util.UUID;
-
-/**
- * This is a simple application that demonstrates how you can use the Qpid AMQP interfaces to use existing sockets as
- * the transport for the Client API.
- *
- * The Demo here runs twice:
- * 1. Just to show a simple publish and receive.
- * 2. To demonstrate how to use existing sockets and utilise the underlying client failover mechnaism.
- */
-public class ExistingSocketConnectorDemo implements ConnectionListener
-{
- private static boolean DEMO_FAILOVER = false;
-
- public static void main(String[] args) throws IOException, URLSyntaxException, AMQException, JMSException
- {
- System.out.println("Testing socket connection to localhost:5672.");
-
- new ExistingSocketConnectorDemo();
-
- System.out.println("Testing socket connection failover between localhost:5672 and localhost:5673.");
-
- DEMO_FAILOVER = true;
-
- new ExistingSocketConnectorDemo();
- }
-
- Connection _connection;
- MessageProducer _producer;
- Session _session;
-
- String Socket1_ID = UUID.randomUUID().toString();
- String Socket2_ID = UUID.randomUUID().toString();
-
-
-
- /** Here we can see the broker we are connecting to is set to be 'socket:///' signifying we will provide the socket. */
- public final String CONNECTION = "amqp://guest:guest@id/test?brokerlist='socket://" + Socket1_ID + ";socket://" + Socket2_ID + "'";
-
-
- public ExistingSocketConnectorDemo() throws IOException, URLSyntaxException, AMQException, JMSException
- {
-
- Socket socket = SocketChannel.open().socket();
- socket.connect(new InetSocketAddress("localhost", 5672));
-
- TransportConnection.registerOpenSocket(Socket1_ID, socket);
-
-
- _connection = new AMQConnection(CONNECTION);
-
- _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- MessageConsumer consumer = _session.createConsumer(_session.createQueue("Queue"));
-
- _producer = _session.createProducer(_session.createQueue("Queue"));
-
- _connection.start();
-
- if (!DEMO_FAILOVER)
- {
- _producer.send(_session.createTextMessage("Simple Test"));
- }
- else
- {
- // Using the Qpid interfaces we can set a listener that allows us to demonstrate failover
- ((AMQConnection) _connection).setConnectionListener(this);
-
- System.out.println("Testing failover: Please ensure second broker running on localhost:5673 and shutdown broker on 5672.");
- }
-
- //We do a blocking receive here so that we can demonstrate failover.
- Message message = consumer.receive();
-
- System.out.println("Recevied :" + message);
-
- _connection.close();
- }
-
- // ConnectionListener Interface
-
- public void bytesSent(long count)
- {
- //not used in this example
- }
- public void bytesReceived(long count)
- {
- //not used in this example
- }
-
- public boolean preFailover(boolean redirect)
- {
- /**
- * This method is called before the underlying client library starts to reconnect. This gives us the opportunity
- * to set a new socket for the failover to occur on.
- */
- try
- {
- Socket socket = SocketChannel.open().socket();
-
- socket.connect(new InetSocketAddress("localhost", 5673));
-
- // This is the new method to pass in an open socket for the connection to use.
- TransportConnection.registerOpenSocket(Socket2_ID, socket);
- }
- catch (IOException e)
- {
- e.printStackTrace();
- return false;
- }
- return true;
- }
-
- public boolean preResubscribe()
- {
- //not used in this example - but must return true to allow the resubscription of existing clients.
- return true;
- }
-
- public void failoverComplete()
- {
- // Now that failover has completed we can send a message that the receiving thread will pick up
- try
- {
- _producer.send(_session.createTextMessage("Simple Failover Test"));
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/example/src/main/java/runSample.sh b/M4-RCs/qpid/java/client/example/src/main/java/runSample.sh
deleted file mode 100755
index e330fb0c36..0000000000
--- a/M4-RCs/qpid/java/client/example/src/main/java/runSample.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/bash
-
-#
-# 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.
-#
-
-
-# Work out the CLASSPATH divider
-UNAME=`uname -s`
-case $UNAME in
- CYGWIN*)
- DIVIDER=";"
- ;;
- *)
- DIVIDER=":"
-;;
-esac
-
-if test "'x$QPID_HOME'" != "'x'"
-then
- QPID_HOME=$QPID_HOME
-else
- QPID_HOME="/usr/share/java/"
-fi
-echo "Using QPID_HOME: $QPID_HOME"
-
-if test "'x$QPID_SAMPLE'" != "'x'"
-then
- QPID_SAMPLE=$QPID_SAMPLE
-else
- QPID_SAMPLE="/usr/share/doc/rhm-0.2"
-fi
-echo "Using QPID_SAMPLE: $QPID_SAMPLE"
-
-
-# set the CLASSPATH
-CLASSPATH=`find "$QPID_HOME" -name '*.jar' | tr '\n' "$DIVIDER"`
-
-
-# compile the samples
-javac -cp "$CLASSPATH" -sourcepath "$QPID_SAMPLE" -d . `find $QPID_SAMPLE -name '*.java'`
-
-# Add output classes to CLASSPATH
-CLASSPATH="$CLASSPATH$DIVIDER$."
-
-# Set VM parameters
-QPID_PARAM="$QPID_PARAM -Dlog4j.configuration=file://$PWD/log4j.xml"
-
-
-# Check if the user supplied a sample classname
-if test "'x$1'" = "'x'"
-then
- echo "No sample classname specified"
- exit;
-else
- java -cp $CLASSPATH $QPID_PARAM $*
-fi
diff --git a/M4-RCs/qpid/java/client/src/main/grammar/SelectorParser.jj b/M4-RCs/qpid/java/client/src/main/grammar/SelectorParser.jj
deleted file mode 100644
index b45cf1a487..0000000000
--- a/M4-RCs/qpid/java/client/src/main/grammar/SelectorParser.jj
+++ /dev/null
@@ -1,609 +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.
- *
- */
-
- //
- // Original File from r450141 of the Apache ActiveMQ project <http://www.activemq.org/site/home.html>
- //
-
-// ----------------------------------------------------------------------------
-// OPTIONS
-// ----------------------------------------------------------------------------
-options {
- STATIC = false;
- UNICODE_INPUT = true;
-
- // some performance optimizations
- OPTIMIZE_TOKEN_MANAGER = true;
- ERROR_REPORTING = false;
-}
-
-// ----------------------------------------------------------------------------
-// PARSER
-// ----------------------------------------------------------------------------
-
-PARSER_BEGIN(SelectorParser)
-/*
- *
- * 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.
- *
- */
-
-package org.apache.qpid.filter.selector;
-
-import java.io.StringReader;
-import java.util.ArrayList;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.filter.ArithmeticExpression;
-import org.apache.qpid.filter.BooleanExpression;
-import org.apache.qpid.filter.ComparisonExpression;
-import org.apache.qpid.filter.ConstantExpression;
-import org.apache.qpid.filter.Expression;
-import org.apache.qpid.filter.LogicExpression;
-import org.apache.qpid.filter.PropertyExpression;
-import org.apache.qpid.filter.UnaryExpression;
-
-/**
- * JMS Selector Parser generated by JavaCC
- *
- * Do not edit this .java file directly - it is autogenerated from SelectorParser.jj
- */
-public class SelectorParser {
-
- public SelectorParser() {
- this(new StringReader(""));
- }
-
- public BooleanExpression parse(String sql) throws QpidException {
- this.ReInit(new StringReader(sql));
-
- try {
- return this.JmsSelector();
- }
- catch (Throwable e) {
- throw new QpidException(sql,null,e);
- }
-
- }
-
- private BooleanExpression asBooleanExpression(Expression value) throws ParseException {
- if (value instanceof BooleanExpression) {
- return (BooleanExpression) value;
- }
- if (value instanceof PropertyExpression) {
- return UnaryExpression.createBooleanCast( value );
- }
- throw new ParseException("Expression will not result in a boolean value: " + value);
- }
-
-
-}
-
-PARSER_END(SelectorParser)
-
-// ----------------------------------------------------------------------------
-// Tokens
-// ----------------------------------------------------------------------------
-
-/* White Space */
-SPECIAL_TOKEN :
-{
- " " | "\t" | "\n" | "\r" | "\f"
-}
-
-/* Comments */
-SKIP:
-{
- <LINE_COMMENT: "--" (~["\n","\r"])* ("\n"|"\r"|"\r\n") >
-}
-
-SKIP:
-{
- <BLOCK_COMMENT: "/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/">
-}
-
-/* Reserved Words */
-TOKEN [IGNORE_CASE] :
-{
- < NOT : "NOT">
- | < AND : "AND">
- | < OR : "OR">
- | < BETWEEN : "BETWEEN">
- | < LIKE : "LIKE">
- | < ESCAPE : "ESCAPE">
- | < IN : "IN">
- | < IS : "IS">
- | < TRUE : "TRUE" >
- | < FALSE : "FALSE" >
- | < NULL : "NULL" >
-}
-
-/* Literals */
-TOKEN [IGNORE_CASE] :
-{
-
- < DECIMAL_LITERAL: ["1"-"9"] (["0"-"9"])* (["l","L"])? >
- | < HEX_LITERAL: "0" ["x","X"] (["0"-"9","a"-"f","A"-"F"])+ >
- | < OCTAL_LITERAL: "0" (["0"-"7"])* >
- | < FLOATING_POINT_LITERAL:
- (["0"-"9"])+ "." (["0"-"9"])* (<EXPONENT>)? // matches: 5.5 or 5. or 5.5E10 or 5.E10
- | "." (["0"-"9"])+ (<EXPONENT>)? // matches: .5 or .5E10
- | (["0"-"9"])+ <EXPONENT> // matches: 5E10
- >
- | < #EXPONENT: "E" (["+","-"])? (["0"-"9"])+ >
- | < STRING_LITERAL: "'" ( ("''") | ~["'"] )* "'" >
-}
-
-TOKEN [IGNORE_CASE] :
-{
- < ID : ["a"-"z", "_", "$"] (["a"-"z","0"-"9","_", "$"])* >
- | < QUOTED_ID : "\"" ( ("\"\"") | ~["\""] )* "\"" >
-
-}
-
-// ----------------------------------------------------------------------------
-// Grammer
-// ----------------------------------------------------------------------------
-BooleanExpression JmsSelector() :
-{
- Expression left=null;
-}
-{
- (
- left = orExpression()
- )
- {
- return asBooleanExpression(left);
- }
-
-}
-
-Expression orExpression() :
-{
- Expression left;
- Expression right;
-}
-{
- (
- left = andExpression()
- (
- <OR> right = andExpression()
- {
- left = LogicExpression.createOR(asBooleanExpression(left), asBooleanExpression(right));
- }
- )*
- )
- {
- return left;
- }
-
-}
-
-
-Expression andExpression() :
-{
- Expression left;
- Expression right;
-}
-{
- (
- left = equalityExpression()
- (
- <AND> right = equalityExpression()
- {
- left = LogicExpression.createAND(asBooleanExpression(left), asBooleanExpression(right));
- }
- )*
- )
- {
- return left;
- }
-}
-
-Expression equalityExpression() :
-{
- Expression left;
- Expression right;
-}
-{
- (
- left = comparisonExpression()
- (
-
- "=" right = comparisonExpression()
- {
- left = ComparisonExpression.createEqual(left, right);
- }
- |
- "<>" right = comparisonExpression()
- {
- left = ComparisonExpression.createNotEqual(left, right);
- }
- |
- LOOKAHEAD(2)
- <IS> <NULL>
- {
- left = ComparisonExpression.createIsNull(left);
- }
- |
- <IS> <NOT> <NULL>
- {
- left = ComparisonExpression.createIsNotNull(left);
- }
- )*
- )
- {
- return left;
- }
-}
-
-Expression comparisonExpression() :
-{
- Expression left;
- Expression right;
- Expression low;
- Expression high;
- String t, u;
- boolean not;
- ArrayList list;
-}
-{
- (
- left = addExpression()
- (
-
- ">" right = addExpression()
- {
- left = ComparisonExpression.createGreaterThan(left, right);
- }
- |
- ">=" right = addExpression()
- {
- left = ComparisonExpression.createGreaterThanEqual(left, right);
- }
- |
- "<" right = addExpression()
- {
- left = ComparisonExpression.createLessThan(left, right);
- }
- |
- "<=" right = addExpression()
- {
- left = ComparisonExpression.createLessThanEqual(left, right);
- }
- |
- {
- u=null;
- }
- <LIKE> t = stringLitteral()
- [ <ESCAPE> u = stringLitteral() ]
- {
- left = ComparisonExpression.createLike(left, t, u);
- }
- |
- LOOKAHEAD(2)
- {
- u=null;
- }
- <NOT> <LIKE> t = stringLitteral() [ <ESCAPE> u = stringLitteral() ]
- {
- left = ComparisonExpression.createNotLike(left, t, u);
- }
- |
- <BETWEEN> low = addExpression() <AND> high = addExpression()
- {
- left = ComparisonExpression.createBetween(left, low, high);
- }
- |
- LOOKAHEAD(2)
- <NOT> <BETWEEN> low = addExpression() <AND> high = addExpression()
- {
- left = ComparisonExpression.createNotBetween(left, low, high);
- }
- |
- <IN>
- "("
- t = stringLitteral()
- {
- list = new ArrayList();
- list.add( t );
- }
- (
- ","
- t = stringLitteral()
- {
- list.add( t );
- }
-
- )*
- ")"
- {
- left = ComparisonExpression.createInFilter(left, list);
- }
- |
- LOOKAHEAD(2)
- <NOT> <IN>
- "("
- t = stringLitteral()
- {
- list = new ArrayList();
- list.add( t );
- }
- (
- ","
- t = stringLitteral()
- {
- list.add( t );
- }
-
- )*
- ")"
- {
- left = ComparisonExpression.createNotInFilter(left, list);
- }
-
- )*
- )
- {
- return left;
- }
-}
-
-Expression addExpression() :
-{
- Expression left;
- Expression right;
-}
-{
- left = multExpr()
- (
- LOOKAHEAD( ("+"|"-") multExpr())
- (
- "+" right = multExpr()
- {
- left = ArithmeticExpression.createPlus(left, right);
- }
- |
- "-" right = multExpr()
- {
- left = ArithmeticExpression.createMinus(left, right);
- }
- )
-
- )*
- {
- return left;
- }
-}
-
-Expression multExpr() :
-{
- Expression left;
- Expression right;
-}
-{
- left = unaryExpr()
- (
- "*" right = unaryExpr()
- {
- left = ArithmeticExpression.createMultiply(left, right);
- }
- |
- "/" right = unaryExpr()
- {
- left = ArithmeticExpression.createDivide(left, right);
- }
- |
- "%" right = unaryExpr()
- {
- left = ArithmeticExpression.createMod(left, right);
- }
-
- )*
- {
- return left;
- }
-}
-
-
-Expression unaryExpr() :
-{
- String s=null;
- Expression left=null;
-}
-{
- (
- LOOKAHEAD( "+" unaryExpr() )
- "+" left=unaryExpr()
- |
- "-" left=unaryExpr()
- {
- left = UnaryExpression.createNegate(left);
- }
- |
- <NOT> left=unaryExpr()
- {
- left = UnaryExpression.createNOT( asBooleanExpression(left) );
- }
- |
- left = primaryExpr()
- )
- {
- return left;
- }
-
-}
-
-Expression primaryExpr() :
-{
- Expression left=null;
-}
-{
- (
- left = literal()
- |
- left = variable()
- |
- "(" left = orExpression() ")"
- )
- {
- return left;
- }
-}
-
-
-
-ConstantExpression literal() :
-{
- Token t;
- String s;
- ConstantExpression left=null;
-}
-{
- (
- (
- s = stringLitteral()
- {
- left = new ConstantExpression(s);
- }
- )
- |
- (
- t = <DECIMAL_LITERAL>
- {
- left = ConstantExpression.createFromDecimal(t.image);
- }
- )
- |
- (
- t = <HEX_LITERAL>
- {
- left = ConstantExpression.createFromHex(t.image);
- }
- )
- |
- (
- t = <OCTAL_LITERAL>
- {
- left = ConstantExpression.createFromOctal(t.image);
- }
- )
- |
- (
- t = <FLOATING_POINT_LITERAL>
- {
- left = ConstantExpression.createFloat(t.image);
- }
- )
- |
- (
- <TRUE>
- {
- left = ConstantExpression.TRUE;
- }
- )
- |
- (
- <FALSE>
- {
- left = ConstantExpression.FALSE;
- }
- )
- |
- (
- <NULL>
- {
- left = ConstantExpression.NULL;
- }
- )
- )
- {
- return left;
- }
-}
-
-String stringLitteral() :
-{
- Token t;
- StringBuffer rc = new StringBuffer();
- boolean first=true;
-}
-{
- t = <STRING_LITERAL>
- {
- // Decode the sting value.
- String image = t.image;
- for( int i=1; i < image.length()-1; i++ ) {
- char c = image.charAt(i);
- if( c == '\'' )
- i++;
- rc.append(c);
- }
- return rc.toString();
- }
-}
-
-PropertyExpression variable() :
-{
- Token t;
- StringBuffer rc = new StringBuffer();
- PropertyExpression left=null;
-}
-{
- (
- t = <ID>
- {
- left = new PropertyExpression(t.image);
- }
- |
- t = <QUOTED_ID>
- {
- // Decode the sting value.
- String image = t.image;
- for( int i=1; i < image.length()-1; i++ ) {
- char c = image.charAt(i);
- if( c == '"' )
- i++;
- rc.append(c);
- }
- return new PropertyExpression(rc.toString());
- }
-
- )
- {
- return left;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/client.bnd b/M4-RCs/qpid/java/client/src/main/java/client.bnd
deleted file mode 100755
index dbda0aad3b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/client.bnd
+++ /dev/null
@@ -1,6 +0,0 @@
-ver: M4
-
-Bundle-SymbolicName: qpid_client
-Bundle-Version: ${ver}
-Export-Package: *;version=${ver}
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/M4-RCs/qpid/java/client/src/main/java/client.log4j b/M4-RCs/qpid/java/client/src/main/java/client.log4j
deleted file mode 100644
index 19cc946118..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/client.log4j
+++ /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.
-#
-log4j.rootLogger=${root.logging.level}
-
-
-#log4j.logger.org.apache.qpid=${amqj.logging.level}, console
-#log4j.additivity.org.apache.qpid=false
-
-log4j.logger.org.apache.qpid=ERROR, console
-log4j.additivity.org.apache.qpid=false
-
-#log4j.logger.org.apache.qpid.client.message.AbstractBytesTypedMessage=DEBUG, console
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=all
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/mina/transport/socket/nio/ExistingSocketConnector.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/mina/transport/socket/nio/ExistingSocketConnector.java
deleted file mode 100644
index 98716c0c3c..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/mina/transport/socket/nio/ExistingSocketConnector.java
+++ /dev/null
@@ -1,478 +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.
- *
- */
-package org.apache.mina.transport.socket.nio;
-
-import edu.emory.mathcs.backport.java.util.concurrent.Executor;
-import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.ExceptionMonitor;
-import org.apache.mina.common.IoConnector;
-import org.apache.mina.common.IoConnectorConfig;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.support.BaseIoConnector;
-import org.apache.mina.common.support.DefaultConnectFuture;
-import org.apache.mina.util.NamePreservingRunnable;
-import org.apache.mina.util.NewThreadExecutor;
-import org.apache.mina.util.Queue;
-
-import java.io.IOException;
-import java.net.ConnectException;
-import java.net.Socket;
-import java.net.SocketAddress;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.SocketChannel;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * {@link IoConnector} for socket transport (TCP/IP).
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- * @version $Rev: 627427 $, $Date: 2008-02-13 14:39:10 +0000 (Wed, 13 Feb 2008) $
- */
-public class ExistingSocketConnector extends BaseIoConnector
-{
- /** @noinspection StaticNonFinalField */
- private static volatile int nextId = 0;
-
- private final Object lock = new Object();
- private final int id = nextId++;
- private final String threadName = "SocketConnector-" + id;
- private SocketConnectorConfig defaultConfig = new SocketConnectorConfig();
- private final Queue connectQueue = new Queue();
- private final SocketIoProcessor[] ioProcessors;
- private final int processorCount;
- private final Executor executor;
-
- /** @noinspection FieldAccessedSynchronizedAndUnsynchronized */
- private Selector selector;
- private Worker worker;
- private int processorDistributor = 0;
- private int workerTimeout = 60; // 1 min.
- private Socket _openSocket = null;
-
- /** Create a connector with a single processing thread using a NewThreadExecutor */
- public ExistingSocketConnector()
- {
- this(1, new NewThreadExecutor());
- }
-
- /**
- * Create a connector with the desired number of processing threads
- *
- * @param processorCount Number of processing threads
- * @param executor Executor to use for launching threads
- */
- public ExistingSocketConnector(int processorCount, Executor executor)
- {
- if (processorCount < 1)
- {
- throw new IllegalArgumentException("Must have at least one processor");
- }
-
- this.executor = executor;
- this.processorCount = processorCount;
- ioProcessors = new SocketIoProcessor[processorCount];
-
- for (int i = 0; i < processorCount; i++)
- {
- ioProcessors[i] = new SocketIoProcessor("SocketConnectorIoProcessor-" + id + "." + i, executor);
- }
- }
-
- /**
- * How many seconds to keep the connection thread alive between connection requests
- *
- * @return Number of seconds to keep connection thread alive
- */
- public int getWorkerTimeout()
- {
- return workerTimeout;
- }
-
- /**
- * Set how many seconds the connection worker thread should remain alive once idle before terminating itself.
- *
- * @param workerTimeout Number of seconds to keep thread alive. Must be >=0
- */
- public void setWorkerTimeout(int workerTimeout)
- {
- if (workerTimeout < 0)
- {
- throw new IllegalArgumentException("Must be >= 0");
- }
- this.workerTimeout = workerTimeout;
- }
-
- public ConnectFuture connect(SocketAddress address, IoHandler handler, IoServiceConfig config)
- {
- return connect(address, null, handler, config);
- }
-
- public ConnectFuture connect(SocketAddress address, SocketAddress localAddress,
- IoHandler handler, IoServiceConfig config)
- {
- /** Changes here from the Mina OpenSocketConnector.
- * Ignoreing all address as they are not needed */
-
- if (handler == null)
- {
- throw new NullPointerException("handler");
- }
-
-
- if (config == null)
- {
- config = getDefaultConfig();
- }
-
- if (_openSocket == null)
- {
- throw new IllegalArgumentException("Specifed Socket not active");
- }
-
- boolean success = false;
-
- try
- {
- DefaultConnectFuture future = new DefaultConnectFuture();
- newSession(_openSocket, handler, config, future);
- success = true;
- return future;
- }
- catch (IOException e)
- {
- return DefaultConnectFuture.newFailedFuture(e);
- }
- finally
- {
- if (!success && _openSocket != null)
- {
- try
- {
- _openSocket.close();
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
- }
- }
- }
- }
-
- public IoServiceConfig getDefaultConfig()
- {
- return defaultConfig;
- }
-
- /**
- * Sets the config this connector will use by default.
- *
- * @param defaultConfig the default config.
- *
- * @throws NullPointerException if the specified value is <code>null</code>.
- */
- public void setDefaultConfig(SocketConnectorConfig defaultConfig)
- {
- if (defaultConfig == null)
- {
- throw new NullPointerException("defaultConfig");
- }
- this.defaultConfig = defaultConfig;
- }
-
- private synchronized void startupWorker() throws IOException
- {
- if (worker == null)
- {
- selector = Selector.open();
- worker = new Worker();
- executor.execute(new NamePreservingRunnable(worker));
- }
- }
-
- private void registerNew()
- {
- if (connectQueue.isEmpty())
- {
- return;
- }
-
- for (; ;)
- {
- ConnectionRequest req;
- synchronized (connectQueue)
- {
- req = (ConnectionRequest) connectQueue.pop();
- }
-
- if (req == null)
- {
- break;
- }
-
- SocketChannel ch = req.channel;
- try
- {
- ch.register(selector, SelectionKey.OP_CONNECT, req);
- }
- catch (IOException e)
- {
- req.setException(e);
- }
- }
- }
-
- private void processSessions(Set keys)
- {
- Iterator it = keys.iterator();
-
- while (it.hasNext())
- {
- SelectionKey key = (SelectionKey) it.next();
-
- if (!key.isConnectable())
- {
- continue;
- }
-
- SocketChannel ch = (SocketChannel) key.channel();
- ConnectionRequest entry = (ConnectionRequest) key.attachment();
-
- boolean success = false;
- try
- {
- ch.finishConnect();
- newSession(ch, entry.handler, entry.config, entry);
- success = true;
- }
- catch (Throwable e)
- {
- entry.setException(e);
- }
- finally
- {
- key.cancel();
- if (!success)
- {
- try
- {
- ch.close();
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
- }
- }
- }
- }
-
- keys.clear();
- }
-
- private void processTimedOutSessions(Set keys)
- {
- long currentTime = System.currentTimeMillis();
- Iterator it = keys.iterator();
-
- while (it.hasNext())
- {
- SelectionKey key = (SelectionKey) it.next();
-
- if (!key.isValid())
- {
- continue;
- }
-
- ConnectionRequest entry = (ConnectionRequest) key.attachment();
-
- if (currentTime >= entry.deadline)
- {
- entry.setException(new ConnectException());
- try
- {
- key.channel().close();
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
- }
- finally
- {
- key.cancel();
- }
- }
- }
- }
-
- private void newSession(Socket socket, IoHandler handler, IoServiceConfig config, ConnectFuture connectFuture)
- throws IOException
- {
- SocketSessionImpl session = new SocketSessionImpl(this,
- nextProcessor(),
- getListeners(),
- config,
- socket.getChannel(),
- handler,
- socket.getRemoteSocketAddress());
-
- newSession(session, config, connectFuture);
- }
-
- private void newSession(SocketChannel ch, IoHandler handler, IoServiceConfig config, ConnectFuture connectFuture)
- throws IOException
-
- {
- SocketSessionImpl session = new SocketSessionImpl(this,
- nextProcessor(),
- getListeners(),
- config,
- ch,
- handler,
- ch.socket().getRemoteSocketAddress());
-
- newSession(session, config, connectFuture);
- }
-
- private void newSession(SocketSessionImpl session, IoServiceConfig config, ConnectFuture connectFuture)
- throws IOException
- {
- try
- {
- getFilterChainBuilder().buildFilterChain(session.getFilterChain());
- config.getFilterChainBuilder().buildFilterChain(session.getFilterChain());
- config.getThreadModel().buildFilterChain(session.getFilterChain());
- }
- catch (Throwable e)
- {
- throw (IOException) new IOException("Failed to create a session.").initCause(e);
- }
- session.getIoProcessor().addNew(session);
- connectFuture.setSession(session);
- }
-
- private SocketIoProcessor nextProcessor()
- {
- return ioProcessors[processorDistributor++ % processorCount];
- }
-
- public void setOpenSocket(Socket openSocket)
- {
- _openSocket = openSocket;
- }
-
- private class Worker implements Runnable
- {
- private long lastActive = System.currentTimeMillis();
-
- public void run()
- {
- Thread.currentThread().setName(ExistingSocketConnector.this.threadName);
-
- for (; ;)
- {
- try
- {
- int nKeys = selector.select(1000);
-
- registerNew();
-
- if (nKeys > 0)
- {
- processSessions(selector.selectedKeys());
- }
-
- processTimedOutSessions(selector.keys());
-
- if (selector.keys().isEmpty())
- {
- if (System.currentTimeMillis() - lastActive > workerTimeout * 1000L)
- {
- synchronized (lock)
- {
- if (selector.keys().isEmpty() &&
- connectQueue.isEmpty())
- {
- worker = null;
- try
- {
- selector.close();
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
- }
- finally
- {
- selector = null;
- }
- break;
- }
- }
- }
- }
- else
- {
- lastActive = System.currentTimeMillis();
- }
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
-
- try
- {
- Thread.sleep(1000);
- }
- catch (InterruptedException e1)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e1);
- }
- }
- }
- }
- }
-
- private class ConnectionRequest extends DefaultConnectFuture
- {
- private final SocketChannel channel;
- private final long deadline;
- private final IoHandler handler;
- private final IoServiceConfig config;
-
- private ConnectionRequest(SocketChannel channel, IoHandler handler, IoServiceConfig config)
- {
- this.channel = channel;
- long timeout;
- if (config instanceof IoConnectorConfig)
- {
- timeout = ((IoConnectorConfig) config).getConnectTimeoutMillis();
- }
- else
- {
- timeout = ((IoConnectorConfig) getDefaultConfig()).getConnectTimeoutMillis();
- }
- this.deadline = System.currentTimeMillis() + timeout;
- this.handler = handler;
- this.config = config;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java
deleted file mode 100644
index 05ac3dca9e..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java
+++ /dev/null
@@ -1,47 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQAuthenticationException represents all failures to authenticate access to a broker.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent failure to authenticate the client.
- * </table>
- *
- * @todo Will this alwyas have the same status code, NOT_ALLOWED 530? Might set this up to always use that code.
- */
-public class AMQAuthenticationException extends AMQException
-{
- public AMQAuthenticationException(AMQConstant error, String msg, Throwable cause)
- {
- super(error, msg, cause);
- }
- public boolean isHardError()
- {
- return true;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
deleted file mode 100644
index 414638dea4..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
+++ /dev/null
@@ -1,390 +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.
- *
- */
-package org.apache.qpid.client;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.url.URLHelper;
-import org.apache.qpid.url.URLSyntaxException;
-
-public class AMQBrokerDetails implements BrokerDetails
-{
- private String _host;
- private int _port;
- private String _transport;
-
- private Map<String, String> _options = new HashMap<String, String>();
-
- private SSLConfiguration _sslConfiguration;
-
- public AMQBrokerDetails(){}
-
- public AMQBrokerDetails(String url) throws URLSyntaxException
- {
-
- // URL should be of format tcp://host:port?option='value',option='value'
- try
- {
- URI connection = new URI(url);
-
- String transport = connection.getScheme();
-
- // Handles some defaults to minimise changes to existing broker URLS e.g. localhost
- if (transport != null)
- {
- //todo this list of valid transports should be enumerated somewhere
- if ((!(transport.equalsIgnoreCase(BrokerDetails.VM) ||
- transport.equalsIgnoreCase(BrokerDetails.TCP) ||
- transport.equalsIgnoreCase(BrokerDetails.SOCKET))))
- {
- if (transport.equalsIgnoreCase("localhost"))
- {
- connection = new URI(DEFAULT_TRANSPORT + "://" + url);
- transport = connection.getScheme();
- }
- else
- {
- if (url.charAt(transport.length()) == ':' && url.charAt(transport.length() + 1) != '/')
- {
- //Then most likely we have a host:port value
- connection = new URI(DEFAULT_TRANSPORT + "://" + url);
- transport = connection.getScheme();
- }
- else
- {
- throw URLHelper.parseError(0, transport.length(), "Unknown transport", url);
- }
- }
- }
- else if (url.indexOf("//") == -1)
- {
- throw new URLSyntaxException(url, "Missing '//' after the transport In broker URL",transport.length()+1,1);
- }
- }
- else
- {
- //Default the transport
- connection = new URI(DEFAULT_TRANSPORT + "://" + url);
- transport = connection.getScheme();
- }
-
- if (transport == null)
- {
- throw URLHelper.parseError(-1, "Unknown transport:'" + transport + "'" +
- " In broker URL:'" + url + "' Format: " + URL_FORMAT_EXAMPLE, "");
- }
-
- setTransport(transport);
-
- String host = connection.getHost();
-
- // Fix for Java 1.5
- if (host == null)
- {
- host = "";
- }
-
- setHost(host);
-
- int port = connection.getPort();
-
- if (port == -1)
- {
- // Fix for when there is port data but it is not automatically parseable by getPort().
- String auth = connection.getAuthority();
-
- if (auth != null && auth.contains(":"))
- {
- int start = auth.indexOf(":") + 1;
- int end = start;
- boolean looking = true;
- boolean found = false;
- // Throw an URL exception if the port number is not specified
- if (start == auth.length())
- {
- throw URLHelper.parseError(connection.toString().indexOf(auth) + end - 1,
- connection.toString().indexOf(auth) + end, "Port number must be specified",
- connection.toString());
- }
- //Walk the authority looking for a port value.
- while (looking)
- {
- try
- {
- end++;
- Integer.parseInt(auth.substring(start, end));
-
- if (end >= auth.length())
- {
- looking = false;
- found = true;
- }
- }
- catch (NumberFormatException nfe)
- {
- looking = false;
- }
-
- }
- if (found)
- {
- setPort(Integer.parseInt(auth.substring(start, end)));
- }
- else
- {
- throw URLHelper.parseError(connection.toString().indexOf(connection.getAuthority()) + end - 1,
- "Illegal character in port number", connection.toString());
- }
-
- }
- else
- {
- setPort(DEFAULT_PORT);
- }
- }
- else
- {
- if (!_transport.equalsIgnoreCase(SOCKET))
- {
- setPort(port);
- }
- }
-
- String queryString = connection.getQuery();
-
- URLHelper.parseOptions(_options, queryString);
-
- //Fragment is #string (not used)
- }
- catch (URISyntaxException uris)
- {
- if (uris instanceof URLSyntaxException)
- {
- throw(URLSyntaxException) uris;
- }
-
- throw URLHelper.parseError(uris.getIndex(), uris.getReason(), uris.getInput());
- }
- }
-
- public AMQBrokerDetails(String host, int port, SSLConfiguration sslConfiguration)
- {
- _host = host;
- _port = port;
- _sslConfiguration = sslConfiguration;
- }
-
- public String getHost()
- {
- return _host;
- }
-
- public void setHost(String _host)
- {
- this._host = _host;
- }
-
- public int getPort()
- {
- return _port;
- }
-
- public void setPort(int _port)
- {
- this._port = _port;
- }
-
- public String getTransport()
- {
- return _transport;
- }
-
- public void setTransport(String _transport)
- {
- this._transport = _transport;
- }
-
-
- public String getProperty(String key)
- {
- return _options.get(key);
- }
-
- public void setProperty(String key, String value)
- {
- _options.put(key, value);
- }
-
- public long getTimeout()
- {
- if (_options.containsKey(OPTIONS_CONNECT_TIMEOUT))
- {
- try
- {
- return Long.parseLong(_options.get(OPTIONS_CONNECT_TIMEOUT));
- }
- catch (NumberFormatException nfe)
- {
- //Do nothing as we will use the default below.
- }
- }
-
- return BrokerDetails.DEFAULT_CONNECT_TIMEOUT;
- }
-
- public boolean useSSL()
- {
- if (_options.containsKey(ConnectionURL.OPTIONS_SSL))
- {
- return Boolean.parseBoolean(_options.get(ConnectionURL.OPTIONS_SSL));
- }
-
- return false;
- }
-
- public void setTimeout(long timeout)
- {
- setProperty(OPTIONS_CONNECT_TIMEOUT, Long.toString(timeout));
- }
-
- public SSLConfiguration getSSLConfiguration()
- {
- return _sslConfiguration;
- }
-
- public void setSSLConfiguration(SSLConfiguration sslConfig)
- {
- _sslConfiguration = sslConfig;
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
-
- sb.append(_transport);
- sb.append("://");
-
- if (!(_transport.equalsIgnoreCase(VM)))
- {
- sb.append(_host);
- }
-
- if (!(_transport.equalsIgnoreCase(SOCKET)))
- {
- sb.append(':');
- sb.append(_port);
- }
-
- sb.append(printOptionsURL());
-
- return sb.toString();
- }
-
- public boolean equals(Object o)
- {
- if (!(o instanceof BrokerDetails))
- {
- return false;
- }
-
- BrokerDetails bd = (BrokerDetails) o;
-
- return _host.equalsIgnoreCase(bd.getHost()) &&
- (_port == bd.getPort()) &&
- _transport.equalsIgnoreCase(bd.getTransport()) &&
- compareSSLConfigurations(bd.getSSLConfiguration());
- //todo do we need to compare all the options as well?
- }
-
- private String printOptionsURL()
- {
- StringBuffer optionsURL = new StringBuffer();
-
- optionsURL.append('?');
-
- if (!(_options.isEmpty()))
- {
-
- for (String key : _options.keySet())
- {
- optionsURL.append(key);
-
- optionsURL.append("='");
-
- optionsURL.append(_options.get(key));
-
- optionsURL.append("'");
-
- optionsURL.append(URLHelper.DEFAULT_OPTION_SEPERATOR);
- }
- }
-
- //removeKey the extra DEFAULT_OPTION_SEPERATOR or the '?' if there are no options
- optionsURL.deleteCharAt(optionsURL.length() - 1);
-
- return optionsURL.toString();
- }
-
- // Do we need to do a more in-depth comparison?
- private boolean compareSSLConfigurations(SSLConfiguration other)
- {
- boolean retval = false;
- if (_sslConfiguration == null &&
- other == null)
- {
- retval = true;
- }
- else if (_sslConfiguration != null &&
- other != null)
- {
- retval = true;
- }
-
- return retval;
- }
-
- public static String checkTransport(String broker)
- {
- if ((!broker.contains("://")))
- {
- return "tcp://" + broker;
- }
- else
- {
- return broker;
- }
- }
-
- public Map<String, String> getProperties()
- {
- return _options;
- }
-
- public void setProperties(Map<String, String> props)
- {
- _options = props;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
deleted file mode 100644
index 4e8fdc2370..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
+++ /dev/null
@@ -1,1454 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.AMQConnectionFailureException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQProtocolException;
-import org.apache.qpid.AMQUnresolvedAddressException;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.failover.FailoverProtectedOperation;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.configuration.ClientProperties;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.jms.Connection;
-import org.apache.qpid.jms.ConnectionListener;
-import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.jms.FailoverPolicy;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.url.URLSyntaxException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.ConnectionConsumer;
-import javax.jms.ConnectionMetaData;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueSession;
-import javax.jms.ServerSessionPool;
-import javax.jms.Topic;
-import javax.jms.TopicConnection;
-import javax.jms.TopicSession;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import javax.naming.StringRefAddr;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.ConnectException;
-import java.net.UnknownHostException;
-import java.nio.channels.UnresolvedAddressException;
-import java.text.MessageFormat;
-import java.util.*;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-public class AMQConnection extends Closeable implements Connection, QueueConnection, TopicConnection, Referenceable
-{
- public static final class ChannelToSessionMap
- {
- private final AMQSession[] _fastAccessSessions = new AMQSession[16];
- private final LinkedHashMap<Integer, AMQSession> _slowAccessSessions = new LinkedHashMap<Integer, AMQSession>();
- private int _size = 0;
- private static final int FAST_CHANNEL_ACCESS_MASK = 0xFFFFFFF0;
-
- public AMQSession get(int channelId)
- {
- if ((channelId & FAST_CHANNEL_ACCESS_MASK) == 0)
- {
- return _fastAccessSessions[channelId];
- }
- else
- {
- return _slowAccessSessions.get(channelId);
- }
- }
-
- public AMQSession put(int channelId, AMQSession session)
- {
- AMQSession oldVal;
- if ((channelId & FAST_CHANNEL_ACCESS_MASK) == 0)
- {
- oldVal = _fastAccessSessions[channelId];
- _fastAccessSessions[channelId] = session;
- }
- else
- {
- oldVal = _slowAccessSessions.put(channelId, session);
- }
- if ((oldVal != null) && (session == null))
- {
- _size--;
- }
- else if ((oldVal == null) && (session != null))
- {
- _size++;
- }
-
- return session;
-
- }
-
- public AMQSession remove(int channelId)
- {
- AMQSession session;
- if ((channelId & FAST_CHANNEL_ACCESS_MASK) == 0)
- {
- session = _fastAccessSessions[channelId];
- _fastAccessSessions[channelId] = null;
- }
- else
- {
- session = _slowAccessSessions.remove(channelId);
- }
-
- if (session != null)
- {
- _size--;
- }
- return session;
-
- }
-
- public Collection<AMQSession> values()
- {
- ArrayList<AMQSession> values = new ArrayList<AMQSession>(size());
-
- for (int i = 0; i < 16; i++)
- {
- if (_fastAccessSessions[i] != null)
- {
- values.add(_fastAccessSessions[i]);
- }
- }
- values.addAll(_slowAccessSessions.values());
-
- return values;
- }
-
- public int size()
- {
- return _size;
- }
-
- public void clear()
- {
- _size = 0;
- _slowAccessSessions.clear();
- for (int i = 0; i < 16; i++)
- {
- _fastAccessSessions[i] = null;
- }
- }
- }
-
- private static final Logger _logger = LoggerFactory.getLogger(AMQConnection.class);
-
- protected AtomicInteger _idFactory = new AtomicInteger(0);
-
- /**
- * This is the "root" mutex that must be held when doing anything that could be impacted by failover. This must be
- * held by any child objects of this connection such as the session, producers and consumers.
- */
- private final Object _failoverMutex = new Object();
-
- private final Object _sessionCreationLock = new Object();
-
- /**
- * A channel is roughly analogous to a session. The server can negotiate the maximum number of channels per session
- * and we must prevent the client from opening too many. Zero means unlimited.
- */
- protected long _maximumChannelCount;
-
- /** The maximum size of frame supported by the server */
- private long _maximumFrameSize;
-
- /**
- * The protocol handler dispatches protocol events for this connection. For example, when the connection is dropped
- * the handler deals with this. It also deals with the initial dispatch of any protocol frames to their appropriate
- * handler.
- */
- protected AMQProtocolHandler _protocolHandler;
-
- /** Maps from session id (Integer) to AMQSession instance */
- private final ChannelToSessionMap _sessions = new ChannelToSessionMap();
-
- private String _clientName;
-
- /** The user name to use for authentication */
- private String _username;
-
- /** The password to use for authentication */
- private String _password;
-
- /** The virtual path to connect to on the AMQ server */
- private String _virtualHost;
-
- protected ExceptionListener _exceptionListener;
-
- private ConnectionListener _connectionListener;
-
- private ConnectionURL _connectionURL;
-
- /**
- * Whether this connection is started, i.e. whether messages are flowing to consumers. It has no meaning for message
- * publication.
- */
- protected volatile boolean _started;
-
- /** Policy dictating how to failover */
- protected FailoverPolicy _failoverPolicy;
-
- /*
- * _Connected should be refactored with a suitable wait object.
- */
- protected boolean _connected;
-
- /*
- * The connection meta data
- */
- private QpidConnectionMetaData _connectionMetaData;
-
- /** Configuration info for SSL */
- private SSLConfiguration _sslConfiguration;
-
- private AMQShortString _defaultTopicExchangeName = ExchangeDefaults.TOPIC_EXCHANGE_NAME;
- private AMQShortString _defaultQueueExchangeName = ExchangeDefaults.DIRECT_EXCHANGE_NAME;
- private AMQShortString _temporaryTopicExchangeName = ExchangeDefaults.TOPIC_EXCHANGE_NAME;
- private AMQShortString _temporaryQueueExchangeName = ExchangeDefaults.DIRECT_EXCHANGE_NAME;
-
- /** Thread Pool for executing connection level processes. Such as returning bounced messages. */
- private final ExecutorService _taskPool = Executors.newCachedThreadPool();
- private static final long DEFAULT_TIMEOUT = 1000 * 30;
- private ProtocolVersion _protocolVersion = ProtocolVersion.v0_9; // FIXME TGM, shouldn't need this
-
- protected AMQConnectionDelegate _delegate;
-
- // this connection maximum number of prefetched messages
- protected int _maxPrefetch;
-
- //Indicates whether persistent messages are synchronized
- private boolean _syncPersistence;
-
- /**
- * @param broker brokerdetails
- * @param username username
- * @param password password
- * @param clientName clientid
- * @param virtualHost virtualhost
- *
- * @throws AMQException
- * @throws URLSyntaxException
- */
- public AMQConnection(String broker, String username, String password, String clientName, String virtualHost)
- throws AMQException, URLSyntaxException
- {
- this(new AMQConnectionURL(
- ConnectionURL.AMQ_PROTOCOL + "://" + username + ":" + password + "@"
- + ((clientName == null) ? "" : clientName) + "/" + virtualHost + "?brokerlist='"
- + AMQBrokerDetails.checkTransport(broker) + "'"), null);
- }
-
- /**
- * @param broker brokerdetails
- * @param username username
- * @param password password
- * @param clientName clientid
- * @param virtualHost virtualhost
- *
- * @throws AMQException
- * @throws URLSyntaxException
- */
- public AMQConnection(String broker, String username, String password, String clientName, String virtualHost,
- SSLConfiguration sslConfig) throws AMQException, URLSyntaxException
- {
- this(new AMQConnectionURL(
- ConnectionURL.AMQ_PROTOCOL + "://" + username + ":" + password + "@"
- + ((clientName == null) ? "" : clientName) + "/" + virtualHost + "?brokerlist='"
- + AMQBrokerDetails.checkTransport(broker) + "'"), sslConfig);
- }
-
- public AMQConnection(String host, int port, String username, String password, String clientName, String virtualHost)
- throws AMQException, URLSyntaxException
- {
- this(host, port, false, username, password, clientName, virtualHost, null);
- }
-
- public AMQConnection(String host, int port, String username, String password, String clientName, String virtualHost,
- SSLConfiguration sslConfig) throws AMQException, URLSyntaxException
- {
- this(host, port, false, username, password, clientName, virtualHost, sslConfig);
- }
-
- public AMQConnection(String host, int port, boolean useSSL, String username, String password, String clientName,
- String virtualHost, SSLConfiguration sslConfig) throws AMQException, URLSyntaxException
- {
- this(new AMQConnectionURL(
- useSSL
- ? (ConnectionURL.AMQ_PROTOCOL + "://" + username + ":" + password + "@"
- + ((clientName == null) ? "" : clientName) + virtualHost + "?brokerlist='tcp://" + host + ":" + port
- + "'" + "," + ConnectionURL.OPTIONS_SSL + "='true'")
- : (ConnectionURL.AMQ_PROTOCOL + "://" + username + ":" + password + "@"
- + ((clientName == null) ? "" : clientName) + virtualHost + "?brokerlist='tcp://" + host + ":" + port
- + "'" + "," + ConnectionURL.OPTIONS_SSL + "='false'")), sslConfig);
- }
-
- public AMQConnection(String connection) throws AMQException, URLSyntaxException
- {
- this(new AMQConnectionURL(connection), null);
- }
-
- public AMQConnection(String connection, SSLConfiguration sslConfig) throws AMQException, URLSyntaxException
- {
- this(new AMQConnectionURL(connection), sslConfig);
- }
-
- /**
- * @todo Some horrible stuff going on here with setting exceptions to be non-null to detect if an exception
- * was thrown during the connection! Intention not clear. Use a flag anyway, not exceptions... Will fix soon.
- */
- public AMQConnection(ConnectionURL connectionURL, SSLConfiguration sslConfig) throws AMQException
- {
- // set this connection maxPrefetch
- if (connectionURL.getOption(ConnectionURL.AMQ_MAXPREFETCH) != null)
- {
- _maxPrefetch = Integer.parseInt(connectionURL.getOption(ConnectionURL.AMQ_MAXPREFETCH));
- }
- else
- {
- // use the defaul value set for all connections
- _maxPrefetch = Integer.parseInt(System.getProperties().getProperty(ClientProperties.MAX_PREFETCH_PROP_NAME,
- ClientProperties.MAX_PREFETCH_DEFAULT));
- }
-
- if (connectionURL.getOption(ConnectionURL.AMQ_SYNC_PERSISTENCE) != null)
- {
- _syncPersistence = Boolean.parseBoolean(connectionURL.getOption(ConnectionURL.AMQ_SYNC_PERSISTENCE));
- }
- else
- {
- // use the defaul value set for all connections
- _syncPersistence = Boolean.getBoolean(ClientProperties.SYNC_PERSISTENT_PROP_NAME);
- }
-
- _failoverPolicy = new FailoverPolicy(connectionURL);
- BrokerDetails brokerDetails = _failoverPolicy.getNextBrokerDetails();
- if (brokerDetails.getTransport().equals(BrokerDetails.VM))
- {
- _delegate = new AMQConnectionDelegate_8_0(this);
- }
- else
- {
- _delegate = new AMQConnectionDelegate_0_10(this);
- }
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("Connection:" + connectionURL);
- }
-
- _sslConfiguration = sslConfig;
- if (connectionURL == null)
- {
- throw new IllegalArgumentException("Connection must be specified");
- }
-
- _connectionURL = connectionURL;
-
- _clientName = connectionURL.getClientName();
- _username = connectionURL.getUsername();
- _password = connectionURL.getPassword();
-
- setVirtualHost(connectionURL.getVirtualHost());
-
- if (connectionURL.getDefaultQueueExchangeName() != null)
- {
- _defaultQueueExchangeName = connectionURL.getDefaultQueueExchangeName();
- }
-
- if (connectionURL.getDefaultTopicExchangeName() != null)
- {
- _defaultTopicExchangeName = connectionURL.getDefaultTopicExchangeName();
- }
-
- if (connectionURL.getTemporaryQueueExchangeName() != null)
- {
- _temporaryQueueExchangeName = connectionURL.getTemporaryQueueExchangeName();
- }
-
- if (connectionURL.getTemporaryTopicExchangeName() != null)
- {
- _temporaryTopicExchangeName = connectionURL.getTemporaryTopicExchangeName();
- }
-
- _protocolHandler = new AMQProtocolHandler(this);
-
- // We are not currently connected
- _connected = false;
-
- boolean retryAllowed = true;
- Exception connectionException = null;
- while (!_connected && retryAllowed)
- {
- ProtocolVersion pe = null;
- try
- {
- pe = makeBrokerConnection(brokerDetails);
- }
- catch (Exception e)
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Unable to connect to broker at " +
- _failoverPolicy.getCurrentBrokerDetails(),
- e);
- }
- connectionException = e;
- }
-
- if (pe != null)
- {
- // reset the delegate to the version returned by the
- // broker
- initDelegate(pe);
- }
- else if (!_connected)
- {
- retryAllowed = _failoverPolicy.failoverAllowed();
- brokerDetails = _failoverPolicy.getNextBrokerDetails();
- }
- }
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Are we connected:" + _connected);
- }
-
- if (!_connected)
- {
- String message = null;
-
- if (connectionException != null)
- {
- if (connectionException.getCause() != null)
- {
- message = connectionException.getCause().getMessage();
- connectionException.getCause().printStackTrace();
- }
- else
- {
- message = connectionException.getMessage();
- }
- }
-
- if ((message == null) || message.equals(""))
- {
- if (message == null)
- {
- message = "Unable to Connect";
- }
- else // can only be "" if getMessage() returned it therfore lastException != null
- {
- message = "Unable to Connect:" + connectionException.getClass();
- }
- }
-
- for (Throwable th = connectionException; th != null; th = th.getCause())
- {
- if (th instanceof UnresolvedAddressException ||
- th instanceof UnknownHostException)
- {
- throw new AMQUnresolvedAddressException
- (message,
- _failoverPolicy.getCurrentBrokerDetails().toString(),
- connectionException);
- }
- }
-
- throw new AMQConnectionFailureException(message, connectionException);
- }
-
- _connectionMetaData = new QpidConnectionMetaData(this);
- }
-
- protected boolean checkException(Throwable thrown)
- {
- Throwable cause = thrown.getCause();
-
- if (cause == null)
- {
- cause = thrown;
- }
-
- return ((cause instanceof ConnectException) || (cause instanceof UnresolvedAddressException));
- }
-
- private void initDelegate(ProtocolVersion pe) throws AMQProtocolException
- {
- try
- {
- Class c = Class.forName(String.format
- ("org.apache.qpid.client.AMQConnectionDelegate_%s_%s",
- pe.getMajorVersion(), pe.getMinorVersion()));
- Class partypes[] = new Class[1];
- partypes[0] = AMQConnection.class;
- _delegate = (AMQConnectionDelegate) c.getConstructor(partypes).newInstance(this);
- }
- catch (ClassNotFoundException e)
- {
- throw new AMQProtocolException
- (AMQConstant.UNSUPPORTED_CLIENT_PROTOCOL_ERROR,
- String.format("Protocol: %s.%s is rquired by the broker but is not " +
- "currently supported by this client library implementation",
- pe.getMajorVersion(), pe.getMinorVersion()),
- e);
- }
- catch (NoSuchMethodException e)
- {
- throw new RuntimeException("unable to locate constructor for delegate", e);
- }
- catch (InstantiationException e)
- {
- throw new RuntimeException("error instantiating delegate", e);
- }
- catch (IllegalAccessException e)
- {
- throw new RuntimeException("error accessing delegate", e);
- }
- catch (InvocationTargetException e)
- {
- throw new RuntimeException("error invoking delegate", e);
- }
- }
-
- protected AMQConnection(String username, String password, String clientName, String virtualHost)
- {
- _clientName = clientName;
- _username = username;
- _password = password;
- setVirtualHost(virtualHost);
- }
-
- private void setVirtualHost(String virtualHost)
- {
- if (virtualHost != null && virtualHost.startsWith("/"))
- {
- virtualHost = virtualHost.substring(1);
- }
-
- _virtualHost = virtualHost;
- }
-
- public boolean attemptReconnection(String host, int port)
- {
- BrokerDetails bd = new AMQBrokerDetails(host, port, _sslConfiguration);
-
- _failoverPolicy.setBroker(bd);
-
- try
- {
- makeBrokerConnection(bd);
-
- return true;
- }
- catch (Exception e)
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Unable to connect to broker at " + bd);
- }
-
- attemptReconnection();
- }
-
- return false;
- }
-
- public boolean attemptReconnection()
- {
- while (_failoverPolicy.failoverAllowed())
- {
- try
- {
- makeBrokerConnection(_failoverPolicy.getNextBrokerDetails());
-
- return true;
- }
- catch (Exception e)
- {
- if (!(e instanceof AMQException))
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Unable to connect to broker at " + _failoverPolicy.getCurrentBrokerDetails(), e);
- }
- }
- else
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info(e.getMessage() + ":Unable to connect to broker at "
- + _failoverPolicy.getCurrentBrokerDetails());
- }
- }
- }
- }
-
- // connection unsuccessful
- return false;
- }
-
- public ProtocolVersion makeBrokerConnection(BrokerDetails brokerDetail) throws IOException, AMQException
- {
- return _delegate.makeBrokerConnection(brokerDetail);
- }
-
- public <T, E extends Exception> T executeRetrySupport(FailoverProtectedOperation<T,E> operation) throws E
- {
- return _delegate.executeRetrySupport(operation);
- }
-
- /**
- * Get the details of the currently active broker
- *
- * @return null if no broker is active (i.e. no successful connection has been made, or the BrokerDetail instance
- * otherwise
- */
- public BrokerDetails getActiveBrokerDetails()
- {
- return _failoverPolicy.getCurrentBrokerDetails();
- }
-
- public boolean failoverAllowed()
- {
- if (!_connected)
- {
- return false;
- }
- else
- {
- return _failoverPolicy.failoverAllowed();
- }
- }
-
- public org.apache.qpid.jms.Session createSession(final boolean transacted, final int acknowledgeMode) throws JMSException
- {
- return createSession(transacted, acknowledgeMode, _maxPrefetch);
- }
-
- public org.apache.qpid.jms.Session createSession(final boolean transacted, final int acknowledgeMode, final int prefetch)
- throws JMSException
- {
- return createSession(transacted, acknowledgeMode, prefetch, prefetch);
- }
-
- public org.apache.qpid.jms.Session createSession(final boolean transacted, final int acknowledgeMode,
- final int prefetchHigh, final int prefetchLow) throws JMSException
- {
- synchronized (_sessionCreationLock)
- {
- checkNotClosed();
- return _delegate.createSession(transacted, acknowledgeMode, prefetchHigh, prefetchLow);
- }
- }
-
- private void createChannelOverWire(int channelId, int prefetchHigh, int prefetchLow, boolean transacted)
- throws AMQException, FailoverException
- {
-
- ChannelOpenBody channelOpenBody = getProtocolHandler().getMethodRegistry().createChannelOpenBody(null);
-
- // TODO: Be aware of possible changes to parameter order as versions change.
-
- _protocolHandler.syncWrite(channelOpenBody.generateFrame(channelId), ChannelOpenOkBody.class);
-
- BasicQosBody basicQosBody = getProtocolHandler().getMethodRegistry().createBasicQosBody(0, prefetchHigh, false);
-
- // todo send low water mark when protocol allows.
- // todo Be aware of possible changes to parameter order as versions change.
- _protocolHandler.syncWrite(basicQosBody.generateFrame(channelId), BasicQosOkBody.class);
-
- if (transacted)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Issuing TxSelect for " + channelId);
- }
-
- TxSelectBody body = getProtocolHandler().getMethodRegistry().createTxSelectBody();
-
- // TODO: Be aware of possible changes to parameter order as versions change.
- _protocolHandler.syncWrite(body.generateFrame(channelId), TxSelectOkBody.class);
- }
- }
-
- private void reopenChannel(int channelId, int prefetchHigh, int prefetchLow, boolean transacted)
- throws AMQException, FailoverException
- {
- try
- {
- createChannelOverWire(channelId, prefetchHigh, prefetchLow, transacted);
- }
- catch (AMQException e)
- {
- deregisterSession(channelId);
- throw new AMQException(null, "Error reopening channel " + channelId + " after failover: " + e, e);
- }
- }
-
- public void setFailoverPolicy(FailoverPolicy policy)
- {
- _failoverPolicy = policy;
- }
-
- public FailoverPolicy getFailoverPolicy()
- {
- return _failoverPolicy;
- }
-
- /**
- * Returns an AMQQueueSessionAdaptor which wraps an AMQSession and throws IllegalStateExceptions where specified in
- * the JMS spec
- *
- * @param transacted
- * @param acknowledgeMode
- *
- * @return QueueSession
- *
- * @throws JMSException
- */
- public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws JMSException
- {
- return new AMQQueueSessionAdaptor(createSession(transacted, acknowledgeMode));
- }
-
- /**
- * Returns an AMQTopicSessionAdapter which wraps an AMQSession and throws IllegalStateExceptions where specified in
- * the JMS spec
- *
- * @param transacted
- * @param acknowledgeMode
- *
- * @return TopicSession
- *
- * @throws JMSException
- */
- public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws JMSException
- {
- return new AMQTopicSessionAdaptor(createSession(transacted, acknowledgeMode));
- }
-
- public boolean channelLimitReached()
- {
- return (_maximumChannelCount != 0) && (_sessions.size() == _maximumChannelCount);
- }
-
- public String getClientID() throws JMSException
- {
- checkNotClosed();
-
- return _clientName;
- }
-
- public void setClientID(String clientID) throws JMSException
- {
- checkNotClosed();
- // in AMQP it is not possible to change the client ID. If one is not specified
- // upon connection construction, an id is generated automatically. Therefore
- // we can always throw an exception.
- if (!Boolean.getBoolean(ClientProperties.IGNORE_SET_CLIENTID_PROP_NAME))
- {
- throw new IllegalStateException("Client name cannot be changed after being set");
- }
- else
- {
- _logger.info("Operation setClientID is ignored using ID: " + getClientID());
- }
- }
-
- public ConnectionMetaData getMetaData() throws JMSException
- {
- checkNotClosed();
-
- return _connectionMetaData;
-
- }
-
- public ExceptionListener getExceptionListener() throws JMSException
- {
- checkNotClosed();
-
- return _exceptionListener;
- }
-
- public void setExceptionListener(ExceptionListener listener) throws JMSException
- {
- checkNotClosed();
- _exceptionListener = listener;
- }
-
- /**
- * Start the connection, i.e. start flowing messages. Note that this method must be called only from a single thread
- * and is not thread safe (which is legal according to the JMS specification).
- *
- * @throws JMSException
- */
- public void start() throws JMSException
- {
- checkNotClosed();
- if (!_started)
- {
- _started = true;
- final Iterator it = _sessions.values().iterator();
- while (it.hasNext())
- {
- final AMQSession s = (AMQSession) (it.next());
- try
- {
- s.start();
- }
- catch (AMQException e)
- {
- throw new JMSAMQException(e);
- }
- }
-
- }
- }
-
- public void stop() throws JMSException
- {
- checkNotClosed();
- if (_started)
- {
- for (Iterator i = _sessions.values().iterator(); i.hasNext();)
- {
- try
- {
- ((AMQSession) i.next()).stop();
- }
- catch (AMQException e)
- {
- throw new JMSAMQException(e);
- }
- }
-
- _started = false;
- }
- }
-
- public void close() throws JMSException
- {
- close(DEFAULT_TIMEOUT);
- }
-
- public void close(long timeout) throws JMSException
- {
- close(new ArrayList<AMQSession>(_sessions.values()), timeout);
- }
-
- public void close(List<AMQSession> sessions, long timeout) throws JMSException
- {
- if (!_closed.getAndSet(true))
- {
- doClose(sessions, timeout);
- }
- }
-
- private void doClose(List<AMQSession> sessions, long timeout) throws JMSException
- {
- synchronized (_sessionCreationLock)
- {
- if (!sessions.isEmpty())
- {
- AMQSession session = sessions.remove(0);
- synchronized (session.getMessageDeliveryLock())
- {
- doClose(sessions, timeout);
- }
- }
- else
- {
- synchronized (getFailoverMutex())
- {
- try
- {
- long startCloseTime = System.currentTimeMillis();
-
- closeAllSessions(null, timeout, startCloseTime);
-
- //This MUST occur after we have successfully closed all Channels/Sessions
- _taskPool.shutdown();
-
- if (!_taskPool.isTerminated())
- {
- try
- {
- // adjust timeout
- long taskPoolTimeout = adjustTimeout(timeout, startCloseTime);
-
- _taskPool.awaitTermination(taskPoolTimeout, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- _logger.info("Interrupted while shutting down connection thread pool.");
- }
- }
-
- // adjust timeout
- timeout = adjustTimeout(timeout, startCloseTime);
- _delegate.closeConnection(timeout);
-
- //If the taskpool hasn't shutdown by now then give it shutdownNow.
- // This will interupt any running tasks.
- if (!_taskPool.isTerminated())
- {
- List<Runnable> tasks = _taskPool.shutdownNow();
- for (Runnable r : tasks)
- {
- _logger.warn("Connection close forced taskpool to prevent execution:" + r);
- }
- }
- }
- catch (AMQException e)
- {
- _logger.error("error:", e);
- JMSException jmse = new JMSException("Error closing connection: " + e);
- jmse.setLinkedException(e);
- throw jmse;
- }
- }
- }
- }
- }
-
- private long adjustTimeout(long timeout, long startTime)
- {
- long now = System.currentTimeMillis();
- timeout -= now - startTime;
- if (timeout < 0)
- {
- timeout = 0;
- }
-
- return timeout;
- }
-
- /**
- * Marks all sessions and their children as closed without sending any protocol messages. Useful when you need to
- * mark objects "visible" in userland as closed after failover or other significant event that impacts the
- * connection. <p/> The caller must hold the failover mutex before calling this method.
- */
- private void markAllSessionsClosed()
- {
- final LinkedList sessionCopy = new LinkedList(_sessions.values());
- final Iterator it = sessionCopy.iterator();
- while (it.hasNext())
- {
- final AMQSession session = (AMQSession) it.next();
-
- session.markClosed();
- }
-
- _sessions.clear();
- }
-
- /**
- * Close all the sessions, either due to normal connection closure or due to an error occurring.
- *
- * @param cause if not null, the error that is causing this shutdown <p/> The caller must hold the failover mutex
- * before calling this method.
- */
- private void closeAllSessions(Throwable cause, long timeout, long starttime) throws JMSException
- {
- final LinkedList sessionCopy = new LinkedList(_sessions.values());
- final Iterator it = sessionCopy.iterator();
- JMSException sessionException = null;
- while (it.hasNext())
- {
- final AMQSession session = (AMQSession) it.next();
- if (cause != null)
- {
- session.closed(cause);
- }
- else
- {
- try
- {
- if (starttime != -1)
- {
- timeout = adjustTimeout(timeout, starttime);
- }
-
- session.close(timeout);
- }
- catch (JMSException e)
- {
- _logger.error("Error closing session: " + e);
- sessionException = e;
- }
- }
- }
-
- _sessions.clear();
- if (sessionException != null)
- {
- throw sessionException;
- }
- }
-
- public ConnectionConsumer createConnectionConsumer(Destination destination, String messageSelector,
- ServerSessionPool sessionPool, int maxMessages) throws JMSException
- {
- checkNotClosed();
-
- return null;
- }
-
- public ConnectionConsumer createConnectionConsumer(Queue queue, String messageSelector, ServerSessionPool sessionPool,
- int maxMessages) throws JMSException
- {
- checkNotClosed();
-
- return null;
- }
-
- public ConnectionConsumer createConnectionConsumer(Topic topic, String messageSelector, ServerSessionPool sessionPool,
- int maxMessages) throws JMSException
- {
- checkNotClosed();
-
- return null;
- }
-
- public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String subscriptionName, String messageSelector,
- ServerSessionPool sessionPool, int maxMessages) throws JMSException
- {
- // TODO Auto-generated method stub
- checkNotClosed();
-
- return null;
- }
-
- public long getMaximumChannelCount() throws JMSException
- {
- checkNotClosed();
-
- return _maximumChannelCount;
- }
-
- public void setConnectionListener(ConnectionListener listener)
- {
- _connectionListener = listener;
- }
-
- public ConnectionListener getConnectionListener()
- {
- return _connectionListener;
- }
-
- public void setMaximumChannelCount(long maximumChannelCount)
- {
- _maximumChannelCount = maximumChannelCount;
- }
-
- public void setMaximumFrameSize(long frameMax)
- {
- _maximumFrameSize = frameMax;
- }
-
- public long getMaximumFrameSize()
- {
- return _maximumFrameSize;
- }
-
- public ChannelToSessionMap getSessions()
- {
- return _sessions;
- }
-
- public String getUsername()
- {
- return _username;
- }
-
- public String getPassword()
- {
- return _password;
- }
-
- public String getVirtualHost()
- {
- return _virtualHost;
- }
-
- public AMQProtocolHandler getProtocolHandler()
- {
- return _protocolHandler;
- }
-
- public boolean started()
- {
- return _started;
- }
-
- public void bytesSent(long writtenBytes)
- {
- if (_connectionListener != null)
- {
- _connectionListener.bytesSent(writtenBytes);
- }
- }
-
- public void bytesReceived(long receivedBytes)
- {
- if (_connectionListener != null)
- {
- _connectionListener.bytesReceived(receivedBytes);
- }
- }
-
- /**
- * Fire the preFailover event to the registered connection listener (if any)
- *
- * @param redirect true if this is the result of a redirect request rather than a connection error
- *
- * @return true if no listener or listener does not veto change
- */
- public boolean firePreFailover(boolean redirect)
- {
- boolean proceed = true;
- if (_connectionListener != null)
- {
- proceed = _connectionListener.preFailover(redirect);
- }
-
- return proceed;
- }
-
- /**
- * Fire the preResubscribe event to the registered connection listener (if any). If the listener vetoes
- * resubscription then all the sessions are closed.
- *
- * @return true if no listener or listener does not veto resubscription.
- *
- * @throws JMSException
- */
- public boolean firePreResubscribe() throws JMSException
- {
- if (_connectionListener != null)
- {
- boolean resubscribe = _connectionListener.preResubscribe();
- if (!resubscribe)
- {
- markAllSessionsClosed();
- }
-
- return resubscribe;
- }
- else
- {
- return true;
- }
- }
-
- /** Fires a failover complete event to the registered connection listener (if any). */
- public void fireFailoverComplete()
- {
- if (_connectionListener != null)
- {
- _connectionListener.failoverComplete();
- }
- }
-
- /**
- * In order to protect the consistency of the connection and its child sessions, consumers and producers, the
- * "failover mutex" must be held when doing any operations that could be corrupted during failover.
- *
- * @return a mutex. Guaranteed never to change for the lifetime of this connection even if failover occurs.
- */
- public final Object getFailoverMutex()
- {
- return _failoverMutex;
- }
-
- public void resubscribeSessions() throws JMSException, AMQException, FailoverException
- {
- _delegate.resubscribeSessions();
- }
-
- /**
- * If failover is taking place this will block until it has completed. If failover is not taking place it will
- * return immediately.
- *
- * @throws InterruptedException
- */
- public void blockUntilNotFailingOver() throws InterruptedException
- {
- _protocolHandler.blockUntilNotFailingOver();
- }
-
- /**
- * Invoked by the AMQProtocolSession when a protocol session exception has occurred. This method sends the exception
- * to a JMS exception listener, if configured, and propagates the exception to sessions, which in turn will
- * propagate to consumers. This allows synchronous consumers to have exceptions thrown to them.
- *
- * @param cause the exception
- */
- public void exceptionReceived(Throwable cause)
- {
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("exceptionReceived done by:" + Thread.currentThread().getName(), cause);
- }
-
- final JMSException je;
- if (cause instanceof JMSException)
- {
- je = (JMSException) cause;
- }
- else
- {
- AMQConstant code = null;
-
- if (cause instanceof AMQException)
- {
- code = ((AMQException) cause).getErrorCode();
- }
-
- if (code != null)
- {
- je =
- new JMSException(Integer.toString(code.getCode()), "Exception thrown against " + toString() + ": "
- + cause);
- }
- else
- {
- //Should never get here as all AMQEs are required to have an ErrorCode!
- je = new JMSException("Exception thrown against " + toString() + ": " + cause);
- }
-
- if (cause instanceof Exception)
- {
- je.setLinkedException((Exception) cause);
- }
- }
-
- boolean closer = false;
-
- // in the case of an IOException, MINA has closed the protocol session so we set _closed to true
- // so that any generic client code that tries to close the connection will not mess up this error
- // handling sequence
- if (cause instanceof IOException)
- {
- closer = !_closed.getAndSet(true);
-
- _protocolHandler.getProtocolSession().notifyError(je);
- }
-
- if (_exceptionListener != null)
- {
- _exceptionListener.onException(je);
- }
- else
- {
- _logger.error("Throwable Received but no listener set: " + cause.getMessage());
- }
-
- if (hardError(cause))
- {
- try
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Closing AMQConnection due to :" + cause.getMessage());
- }
-
- closer = (!_closed.getAndSet(true)) || closer;
- if (closer)
- {
- closeAllSessions(cause, -1, -1); // FIXME: when doing this end up with RejectedExecutionException from executor.
- }
- }
- catch (JMSException e)
- {
- _logger.error("Error closing all sessions: " + e, e);
- }
-
- }
- else
- {
- _logger.info("Not a hard-error connection not closing: " + cause.getMessage());
- }
- }
-
- private boolean hardError(Throwable cause)
- {
- if (cause instanceof AMQException)
- {
- return ((AMQException) cause).isHardError();
- }
-
- return true;
- }
-
- void registerSession(int channelId, AMQSession session)
- {
- _sessions.put(channelId, session);
- }
-
- void deregisterSession(int channelId)
- {
- _sessions.remove(channelId);
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer("AMQConnection:\n");
- if (_failoverPolicy.getCurrentBrokerDetails() == null)
- {
- buf.append("No active broker connection");
- }
- else
- {
- BrokerDetails bd = _failoverPolicy.getCurrentBrokerDetails();
- buf.append("Host: ").append(String.valueOf(bd.getHost()));
- buf.append("\nPort: ").append(String.valueOf(bd.getPort()));
- }
-
- buf.append("\nVirtual Host: ").append(String.valueOf(_virtualHost));
- buf.append("\nClient ID: ").append(String.valueOf(_clientName));
- buf.append("\nActive session count: ").append((_sessions == null) ? 0 : _sessions.size());
-
- return buf.toString();
- }
-
- public String toURL()
- {
- return _connectionURL.toString();
- }
-
- public Reference getReference() throws NamingException
- {
- return new Reference(AMQConnection.class.getName(), new StringRefAddr(AMQConnection.class.getName(), toURL()),
- AMQConnectionFactory.class.getName(), null); // factory location
- }
-
- public SSLConfiguration getSSLConfiguration()
- {
- return _sslConfiguration;
- }
-
- public AMQShortString getDefaultTopicExchangeName()
- {
- return _defaultTopicExchangeName;
- }
-
- public void setDefaultTopicExchangeName(AMQShortString defaultTopicExchangeName)
- {
- _defaultTopicExchangeName = defaultTopicExchangeName;
- }
-
- public AMQShortString getDefaultQueueExchangeName()
- {
- return _defaultQueueExchangeName;
- }
-
- public void setDefaultQueueExchangeName(AMQShortString defaultQueueExchangeName)
- {
- _defaultQueueExchangeName = defaultQueueExchangeName;
- }
-
- public AMQShortString getTemporaryTopicExchangeName()
- {
- return _temporaryTopicExchangeName;
- }
-
- public AMQShortString getTemporaryQueueExchangeName()
- {
- return _temporaryQueueExchangeName; // To change body of created methods use File | Settings | File Templates.
- }
-
- public void setTemporaryTopicExchangeName(AMQShortString temporaryTopicExchangeName)
- {
- _temporaryTopicExchangeName = temporaryTopicExchangeName;
- }
-
- public void setTemporaryQueueExchangeName(AMQShortString temporaryQueueExchangeName)
- {
- _temporaryQueueExchangeName = temporaryQueueExchangeName;
- }
-
- public void performConnectionTask(Runnable task)
- {
- _taskPool.execute(task);
- }
-
- public AMQSession getSession(int channelId)
- {
- return _sessions.get(channelId);
- }
-
- public ProtocolVersion getProtocolVersion()
- {
- return _protocolVersion;
- }
-
- public void setProtocolVersion(ProtocolVersion protocolVersion)
- {
- _protocolVersion = protocolVersion;
- _protocolHandler.getProtocolSession().setProtocolVersion(protocolVersion);
- }
-
- public boolean isFailingOver()
- {
- return (_protocolHandler.getFailoverLatch() != null);
- }
-
- /**
- * Get the maximum number of messages that this connection can pre-fetch.
- *
- * @return The maximum number of messages that this connection can pre-fetch.
- */
- public long getMaxPrefetch()
- {
- return _maxPrefetch;
- }
-
- /**
- * Indicates whether persistent messages are synchronized
- *
- * @return true if persistent messages are synchronized false otherwise
- */
- public boolean getSyncPersistence()
- {
- return _syncPersistence;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate.java
deleted file mode 100644
index b64147fe8f..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate.java
+++ /dev/null
@@ -1,50 +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.
- *
- */
-package org.apache.qpid.client;
-
-import java.io.IOException;
-
-import javax.jms.JMSException;
-import javax.jms.XASession;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.failover.FailoverProtectedOperation;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.jms.Session;
-
-public interface AMQConnectionDelegate
-{
- ProtocolVersion makeBrokerConnection(BrokerDetails brokerDetail) throws IOException, AMQException;
-
- Session createSession(final boolean transacted, final int acknowledgeMode,
- final int prefetchHigh, final int prefetchLow) throws JMSException;
-
- XASession createXASession(int prefetchHigh, int prefetchLow) throws JMSException;
-
- void resubscribeSessions() throws JMSException, AMQException, FailoverException;
-
- void closeConnection(long timeout) throws JMSException, AMQException;
-
- <T, E extends Exception> T executeRetrySupport(FailoverProtectedOperation<T,E> operation) throws E;
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java
deleted file mode 100644
index 30ea4dcf8d..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java
+++ /dev/null
@@ -1,269 +0,0 @@
-package org.apache.qpid.client;
-/*
- *
- * 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 java.io.IOException;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.XASession;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQProtocolException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.failover.FailoverProtectedOperation;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.ErrorCode;
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.ConnectionClose;
-import org.apache.qpid.transport.ConnectionException;
-import org.apache.qpid.transport.ConnectionListener;
-import org.apache.qpid.transport.ProtocolVersionException;
-import org.apache.qpid.transport.TransportException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AMQConnectionDelegate_0_10 implements AMQConnectionDelegate, ConnectionListener
-{
- /**
- * This class logger.
- */
- private static final Logger _logger = LoggerFactory.getLogger(AMQConnectionDelegate_0_10.class);
-
- /**
- * The AMQ Connection.
- */
- private AMQConnection _conn;
-
- /**
- * The QpidConeection instance that is mapped with thie JMS connection.
- */
- org.apache.qpid.transport.Connection _qpidConnection;
- private ConnectionException exception = null;
-
- //--- constructor
- public AMQConnectionDelegate_0_10(AMQConnection conn)
- {
- _conn = conn;
- _qpidConnection = new Connection();
- _qpidConnection.setConnectionListener(this);
- }
-
- /**
- * create a Session and start it if required.
- */
- public Session createSession(boolean transacted, int acknowledgeMode, int prefetchHigh, int prefetchLow)
- throws JMSException
- {
- _conn.checkNotClosed();
- int channelId = _conn._idFactory.incrementAndGet();
- AMQSession session;
- try
- {
- session = new AMQSession_0_10(_qpidConnection, _conn, channelId, transacted, acknowledgeMode, prefetchHigh,
- prefetchLow);
- _conn.registerSession(channelId, session);
- if (_conn._started)
- {
- session.start();
- }
- }
- catch (Exception e)
- {
- _logger.error("exception creating session:", e);
- throw new JMSAMQException("cannot create session", e);
- }
- return session;
- }
-
- /**
- * create an XA Session and start it if required.
- */
- public XASession createXASession(int prefetchHigh, int prefetchLow) throws JMSException
- {
- _conn.checkNotClosed();
- int channelId = _conn._idFactory.incrementAndGet();
- XASessionImpl session;
- try
- {
- session = new XASessionImpl(_qpidConnection, _conn, channelId, prefetchHigh, prefetchLow);
- _conn.registerSession(channelId, session);
- if (_conn._started)
- {
- session.start();
- }
- }
- catch (Exception e)
- {
- throw new JMSAMQException("cannot create session", e);
- }
- return session;
- }
-
-
- /**
- * Make a connection with the broker
- *
- * @param brokerDetail The detail of the broker to connect to.
- * @throws IOException
- * @throws AMQException
- */
- public ProtocolVersion makeBrokerConnection(BrokerDetails brokerDetail) throws IOException, AMQException
- {
- try
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("connecting to host: " + brokerDetail.getHost() +
- " port: " + brokerDetail.getPort() +
- " vhost: " + _conn.getVirtualHost() +
- " username: " + _conn.getUsername() +
- " password: " + _conn.getPassword());
- }
- _qpidConnection.connect(brokerDetail.getHost(), brokerDetail.getPort(), _conn.getVirtualHost(),
- _conn.getUsername(), _conn.getPassword(), brokerDetail.useSSL());
- _conn._connected = true;
- }
- catch(ProtocolVersionException pe)
- {
- return new ProtocolVersion(pe.getMajor(), pe.getMinor());
- }
- catch (ConnectionException e)
- {
- throw new AMQException(AMQConstant.CHANNEL_ERROR, "cannot connect to broker", e);
- }
-
- return null;
- }
-
- /**
- * Not supported at this level.
- */
- public void resubscribeSessions() throws JMSException, AMQException, FailoverException
- {
- List<AMQSession> sessions = new ArrayList<AMQSession>(_conn.getSessions().values());
- _logger.info(String.format("Resubscribing sessions = %s sessions.size=%s", sessions, sessions.size()));
- for (AMQSession s : sessions)
- {
- ((AMQSession_0_10) s)._qpidConnection = _qpidConnection;
- s.resubscribe();
- }
- }
-
-
- public void closeConnection(long timeout) throws JMSException, AMQException
- {
- try
- {
- _qpidConnection.close();
- }
- catch (TransportException e)
- {
- throw new AMQException(e.getMessage(), e);
- }
- }
-
- public void opened(Connection conn) {}
-
- public void exception(Connection conn, ConnectionException exc)
- {
- if (exception != null)
- {
- _logger.error("previous exception", exception);
- }
-
- exception = exc;
- }
-
- public void closed(Connection conn)
- {
- ConnectionException exc = exception;
- exception = null;
-
- if (exc == null)
- {
- return;
- }
-
- ConnectionClose close = exc.getClose();
- if (close == null)
- {
- try
- {
- if (_conn.firePreFailover(false) && _conn.attemptReconnection())
- {
- _qpidConnection.resume();
-
- if (_conn.firePreResubscribe())
- {
- _conn.resubscribeSessions();
- }
-
- _conn.fireFailoverComplete();
- return;
- }
- }
- catch (Exception e)
- {
- _logger.error("error during failover", e);
- }
- }
-
- ExceptionListener listener = _conn._exceptionListener;
- if (listener == null)
- {
- _logger.error("connection exception: " + conn, exc);
- }
- else
- {
- String code = null;
- if (close != null)
- {
- code = close.getReplyCode().toString();
- }
-
- JMSException ex = new JMSException(exc.getMessage(), code);
- ex.initCause(exc);
- listener.onException(ex);
- }
- }
-
- public <T, E extends Exception> T executeRetrySupport(FailoverProtectedOperation<T,E> operation) throws E
- {
- try
- {
- return operation.execute();
- }
- catch (FailoverException e)
- {
- throw new RuntimeException(e);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_9.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_9.java
deleted file mode 100755
index d95e2e3dff..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_9.java
+++ /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.
- *
- */
-package org.apache.qpid.client;
-
-
-public class AMQConnectionDelegate_0_9 extends AMQConnectionDelegate_8_0
-{
-
- public AMQConnectionDelegate_0_9(AMQConnection conn)
- {
- super(conn);
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_8_0.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_8_0.java
deleted file mode 100644
index 035e3830ca..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_8_0.java
+++ /dev/null
@@ -1,287 +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.
- *
- */
-package org.apache.qpid.client;
-
-import java.io.IOException;
-import java.net.ConnectException;
-import java.nio.channels.UnresolvedAddressException;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.jms.JMSException;
-import javax.jms.XASession;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.failover.FailoverProtectedOperation;
-import org.apache.qpid.client.failover.FailoverRetrySupport;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.client.state.StateWaiter;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.framing.BasicQosBody;
-import org.apache.qpid.framing.BasicQosOkBody;
-import org.apache.qpid.framing.ChannelOpenBody;
-import org.apache.qpid.framing.ChannelOpenOkBody;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.framing.TxSelectBody;
-import org.apache.qpid.framing.TxSelectOkBody;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.jms.ChannelLimitReachedException;
-import org.apache.qpid.transport.network.io.IoTransport;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AMQConnectionDelegate_8_0 implements AMQConnectionDelegate
-{
- private static final Logger _logger = LoggerFactory.getLogger(AMQConnectionDelegate_8_0.class);
- private AMQConnection _conn;
-
-
- public void closeConnection(long timeout) throws JMSException, AMQException
- {
- _conn.getProtocolHandler().closeConnection(timeout);
-
- }
-
- public AMQConnectionDelegate_8_0(AMQConnection conn)
- {
- _conn = conn;
- }
-
- protected boolean checkException(Throwable thrown)
- {
- Throwable cause = thrown.getCause();
-
- if (cause == null)
- {
- cause = thrown;
- }
-
- return ((cause instanceof ConnectException) || (cause instanceof UnresolvedAddressException));
- }
-
- public ProtocolVersion makeBrokerConnection(BrokerDetails brokerDetail) throws AMQException, IOException
- {
- final Set<AMQState> openOrClosedStates =
- EnumSet.of(AMQState.CONNECTION_OPEN, AMQState.CONNECTION_CLOSED);
-
-
- StateWaiter waiter = _conn._protocolHandler.createWaiter(openOrClosedStates);
-
- // TODO: use system property thingy for this
- if (System.getProperty("UseTransportIo", "false").equals("false"))
- {
- TransportConnection.getInstance(brokerDetail).connect(_conn._protocolHandler, brokerDetail);
- }
- else
- {
- _conn.getProtocolHandler().createIoTransportSession(brokerDetail);
- }
-
- // this blocks until the connection has been set up or when an error
- // has prevented the connection being set up
-
- AMQState state = waiter.await();
-
- if(state == AMQState.CONNECTION_OPEN)
- {
- _conn._failoverPolicy.attainedConnection();
- _conn._connected = true;
- }
-
- return null;
- }
-
- public org.apache.qpid.jms.Session createSession(final boolean transacted, final int acknowledgeMode, final int prefetch)
- throws JMSException
- {
- return createSession(transacted, acknowledgeMode, prefetch, prefetch);
- }
-
- public XASession createXASession(int prefetchHigh, int prefetchLow) throws JMSException
- {
- throw new UnsupportedOperationException("0_8 version does not provide XA support");
- }
-
- public org.apache.qpid.jms.Session createSession(final boolean transacted, final int acknowledgeMode,
- final int prefetchHigh, final int prefetchLow) throws JMSException
- {
- _conn.checkNotClosed();
-
- if (_conn.channelLimitReached())
- {
- throw new ChannelLimitReachedException(_conn._maximumChannelCount);
- }
-
- return new FailoverRetrySupport<org.apache.qpid.jms.Session, JMSException>(
- new FailoverProtectedOperation<org.apache.qpid.jms.Session, JMSException>()
- {
- public org.apache.qpid.jms.Session execute() throws JMSException, FailoverException
- {
- int channelId = _conn._idFactory.incrementAndGet();
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Write channel open frame for channel id " + channelId);
- }
-
- // We must create the session and register it before actually sending the frame to the server to
- // open it, so that there is no window where we could receive data on the channel and not be set
- // up to handle it appropriately.
- AMQSession session =
- new AMQSession_0_8(_conn, channelId, transacted, acknowledgeMode, prefetchHigh,
- prefetchLow);
- // _protocolHandler.addSessionByChannel(channelId, session);
- _conn.registerSession(channelId, session);
-
- boolean success = false;
- try
- {
- createChannelOverWire(channelId, prefetchHigh, prefetchLow, transacted);
- success = true;
- }
- catch (AMQException e)
- {
- JMSException jmse = new JMSException("Error creating session: " + e);
- jmse.setLinkedException(e);
- throw jmse;
- }
- finally
- {
- if (!success)
- {
- _conn.deregisterSession(channelId);
- }
- }
-
- if (_conn._started)
- {
- try
- {
- session.start();
- }
- catch (AMQException e)
- {
- throw new JMSAMQException(e);
- }
- }
-
- return session;
- }
- }, _conn).execute();
- }
-
- private void createChannelOverWire(int channelId, int prefetchHigh, int prefetchLow, boolean transacted)
- throws AMQException, FailoverException
- {
- ChannelOpenBody channelOpenBody = _conn.getProtocolHandler().getMethodRegistry().createChannelOpenBody(null);
- // TODO: Be aware of possible changes to parameter order as versions change.
- _conn._protocolHandler.syncWrite(channelOpenBody.generateFrame(channelId), ChannelOpenOkBody.class);
-
- // todo send low water mark when protocol allows.
- // todo Be aware of possible changes to parameter order as versions change.
- BasicQosBody basicQosBody = _conn.getProtocolHandler().getMethodRegistry().createBasicQosBody(0,prefetchHigh,false);
- _conn._protocolHandler.syncWrite(basicQosBody.generateFrame(channelId),BasicQosOkBody.class);
-
- if (transacted)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Issuing TxSelect for " + channelId);
- }
- TxSelectBody body = _conn.getProtocolHandler().getMethodRegistry().createTxSelectBody();
-
- // TODO: Be aware of possible changes to parameter order as versions change.
- _conn._protocolHandler.syncWrite(body.generateFrame(channelId), TxSelectOkBody.class);
- }
- }
-
- /**
- * For all sessions, and for all consumers in those sessions, resubscribe. This is called during failover handling.
- * The caller must hold the failover mutex before calling this method.
- */
- public void resubscribeSessions() throws JMSException, AMQException, FailoverException
- {
- ArrayList sessions = new ArrayList(_conn.getSessions().values());
- _logger.info(MessageFormat.format("Resubscribing sessions = {0} sessions.size={1}", sessions, sessions.size())); // FIXME: removeKey?
- for (Iterator it = sessions.iterator(); it.hasNext();)
- {
- AMQSession s = (AMQSession) it.next();
- // _protocolHandler.addSessionByChannel(s.getChannelId(), s);
- reopenChannel(s.getChannelId(), s.getDefaultPrefetchHigh(), s.getDefaultPrefetchLow(), s.getTransacted());
- s.resubscribe();
- }
- }
-
- private void reopenChannel(int channelId, int prefetchHigh, int prefetchLow, boolean transacted)
- throws AMQException, FailoverException
- {
- try
- {
- createChannelOverWire(channelId, prefetchHigh, prefetchLow, transacted);
- }
- catch (AMQException e)
- {
- _conn.deregisterSession(channelId);
- throw new AMQException(null, "Error reopening channel " + channelId + " after failover: " + e, e);
- }
- }
-
- public <T, E extends Exception> T executeRetrySupport(FailoverProtectedOperation<T,E> operation) throws E
- {
- while (true)
- {
- try
- {
- _conn.blockUntilNotFailingOver();
- }
- catch (InterruptedException e)
- {
- _logger.debug("Interrupted: " + e, e);
-
- return null;
- }
-
- synchronized (_conn.getFailoverMutex())
- {
- try
- {
- return operation.execute();
- }
- catch (FailoverException e)
- {
- _logger.debug("Failover exception caught during operation: " + e, e);
- }
- catch (IllegalStateException e)
- {
- if (!(e.getMessage().startsWith("Fail-over interupted no-op failover support")))
- {
- throw e;
- }
- }
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java
deleted file mode 100644
index 01a915f2cc..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java
+++ /dev/null
@@ -1,552 +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.
- *
- */
-package org.apache.qpid.client;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Hashtable;
-import java.util.UUID;
-
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.Name;
-import javax.naming.NamingException;
-import javax.naming.RefAddr;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import javax.naming.StringRefAddr;
-import javax.naming.spi.ObjectFactory;
-
-import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.qpid.url.URLSyntaxException;
-
-
-public class AMQConnectionFactory implements ConnectionFactory, QueueConnectionFactory, TopicConnectionFactory,
- ObjectFactory, Referenceable, XATopicConnectionFactory,
- XAQueueConnectionFactory, XAConnectionFactory
-{
- private String _host;
- private int _port;
- private String _defaultUsername;
- private String _defaultPassword;
- private String _virtualPath;
-
- private ConnectionURL _connectionDetails;
- private SSLConfiguration _sslConfig;
-
- public AMQConnectionFactory()
- {
- }
-
- /**
- * This is the Only constructor used!
- * It is used form the context and from the JNDI objects.
- */
- public AMQConnectionFactory(String url) throws URLSyntaxException
- {
- _connectionDetails = new AMQConnectionURL(url);
- }
-
- /**
- * This constructor is never used!
- */
- public AMQConnectionFactory(ConnectionURL url)
- {
- _connectionDetails = url;
- }
-
- /**
- * This constructor is never used!
- */
- public AMQConnectionFactory(String broker, String username, String password, String clientName, String virtualHost)
- throws URLSyntaxException
- {
- this(new AMQConnectionURL(
- ConnectionURL.AMQ_PROTOCOL + "://" + username + ":" + password + "@" + clientName + "/" + virtualHost + "?brokerlist='" + broker + "'"));
- }
-
- /**
- * This constructor is never used!
- */
- public AMQConnectionFactory(String host, int port, String virtualPath)
- {
- this(host, port, "guest", "guest", virtualPath);
- }
-
- /**
- * This constructor is never used!
- */
- public AMQConnectionFactory(String host, int port, String defaultUsername, String defaultPassword,
- String virtualPath)
- {
- _host = host;
- _port = port;
- _defaultUsername = defaultUsername;
- _defaultPassword = defaultPassword;
- _virtualPath = virtualPath;
-
-//todo when setting Host/Port has been resolved then we can use this otherwise those methods won't work with the following line.
-// _connectionDetails = new AMQConnectionURL(
-// ConnectionURL.AMQ_PROTOCOL + "://" +
-// _defaultUsername + ":" + _defaultPassword + "@" +
-// virtualPath + "?brokerlist='tcp://" + host + ":" + port + "'");
- }
-
- /**
- * @return The _defaultPassword.
- */
- public final String getDefaultPassword(String password)
- {
- if (_connectionDetails != null)
- {
- return _connectionDetails.getPassword();
- }
- else
- {
- return _defaultPassword;
- }
- }
-
- /**
- * @param password The _defaultPassword to set.
- */
- public final void setDefaultPassword(String password)
- {
- if (_connectionDetails != null)
- {
- _connectionDetails.setPassword(password);
- }
- _defaultPassword = password;
- }
-
- /**
- * Getter for SSLConfiguration
- *
- * @return SSLConfiguration if set, otherwise null
- */
- public final SSLConfiguration getSSLConfiguration()
- {
- return _sslConfig;
- }
-
- /**
- * Setter for SSLConfiguration
- *
- * @param sslConfig config to store
- */
- public final void setSSLConfiguration(SSLConfiguration sslConfig)
- {
- _sslConfig = sslConfig;
- }
-
- /**
- * @return The _defaultPassword.
- */
- public final String getDefaultUsername(String password)
- {
- if (_connectionDetails != null)
- {
- return _connectionDetails.getUsername();
- }
- else
- {
- return _defaultUsername;
- }
- }
-
- /**
- * @param username The _defaultUsername to set.
- */
- public final void setDefaultUsername(String username)
- {
- if (_connectionDetails != null)
- {
- _connectionDetails.setUsername(username);
- }
- _defaultUsername = username;
- }
-
- /**
- * @return The _host .
- */
- public final String getHost()
- {
- //todo this doesn't make sense in a multi broker URL as we have no current as that is done by AMQConnection
- return _host;
- }
-
- /**
- * @param host The _host to set.
- */
- public final void setHost(String host)
- {
- //todo if _connectionDetails is set then run _connectionDetails.addBrokerDetails()
- // Should perhaps have this method changed to setBroker(host,port)
- _host = host;
- }
-
- /**
- * @return _port The _port to set.
- */
- public final int getPort()
- {
- //todo see getHost
- return _port;
- }
-
- /**
- * @param port The port to set.
- */
- public final void setPort(int port)
- {
- //todo see setHost
- _port = port;
- }
-
- /**
- * @return he _virtualPath.
- */
- public final String getVirtualPath()
- {
- if (_connectionDetails != null)
- {
- return _connectionDetails.getVirtualHost();
- }
- else
- {
- return _virtualPath;
- }
- }
-
- /**
- * @param path The _virtualPath to set.
- */
- public final void setVirtualPath(String path)
- {
- if (_connectionDetails != null)
- {
- _connectionDetails.setVirtualHost(path);
- }
-
- _virtualPath = path;
- }
-
- public static String getUniqueClientID()
- {
- try
- {
- InetAddress addr = InetAddress.getLocalHost();
- return addr.getHostName() + System.currentTimeMillis();
- }
- catch (UnknownHostException e)
- {
- return "UnknownHost" + UUID.randomUUID();
- }
- }
-
- public Connection createConnection() throws JMSException
- {
- try
- {
- if (_connectionDetails != null)
- {
- if (_connectionDetails.getClientName() == null || _connectionDetails.getClientName().equals(""))
- {
- _connectionDetails.setClientName(getUniqueClientID());
- }
- return new AMQConnection(_connectionDetails, _sslConfig);
- }
- else
- {
- return new AMQConnection(_host, _port, _defaultUsername, _defaultPassword, getUniqueClientID(),
- _virtualPath);
- }
- }
- catch (Exception e)
- {
- JMSException jmse = new JMSException("Error creating connection: " + e.getMessage());
- jmse.setLinkedException(e);
- throw jmse;
- }
-
-
- }
-
- public Connection createConnection(String userName, String password) throws JMSException
- {
- return createConnection(userName, password, null);
- }
-
- public Connection createConnection(String userName, String password, String id) throws JMSException
- {
- try
- {
- if (_connectionDetails != null)
- {
- _connectionDetails.setUsername(userName);
- _connectionDetails.setPassword(password);
-
- if (id != null && !id.equals(""))
- {
- _connectionDetails.setClientName(id);
- }
- else if (_connectionDetails.getClientName() == null || _connectionDetails.getClientName().equals(""))
- {
- _connectionDetails.setClientName(getUniqueClientID());
- }
- return new AMQConnection(_connectionDetails, _sslConfig);
- }
- else
- {
- return new AMQConnection(_host, _port, userName, password, (id != null ? id : getUniqueClientID()), _virtualPath);
- }
- }
- catch (Exception e)
- {
- JMSException jmse = new JMSException("Error creating connection: " + e.getMessage());
- jmse.setLinkedException(e);
- throw jmse;
- }
- }
-
- public QueueConnection createQueueConnection() throws JMSException
- {
- return (QueueConnection) createConnection();
- }
-
- public QueueConnection createQueueConnection(String username, String password) throws JMSException
- {
- return (QueueConnection) createConnection(username, password);
- }
-
- public TopicConnection createTopicConnection() throws JMSException
- {
- return (TopicConnection) createConnection();
- }
-
- public TopicConnection createTopicConnection(String username, String password) throws JMSException
- {
- return (TopicConnection) createConnection(username, password);
- }
-
-
- public ConnectionURL getConnectionURL()
- {
- return _connectionDetails;
- }
-
- /**
- * JNDI interface to create objects from References.
- *
- * @param obj The Reference from JNDI
- * @param name
- * @param ctx
- * @param env
- *
- * @return AMQConnection,AMQTopic,AMQQueue, or AMQConnectionFactory.
- *
- * @throws Exception
- */
- public Object getObjectInstance(Object obj, Name name, Context ctx, Hashtable env) throws Exception
- {
- if (obj instanceof Reference)
- {
- Reference ref = (Reference) obj;
-
- if (ref.getClassName().equals(AMQConnection.class.getName()))
- {
- RefAddr addr = ref.get(AMQConnection.class.getName());
-
- if (addr != null)
- {
- return new AMQConnection((String) addr.getContent());
- }
- }
-
- if (ref.getClassName().equals(AMQQueue.class.getName()))
- {
- RefAddr addr = ref.get(AMQQueue.class.getName());
-
- if (addr != null)
- {
- return new AMQQueue(new AMQBindingURL((String) addr.getContent()));
- }
- }
-
- if (ref.getClassName().equals(AMQTopic.class.getName()))
- {
- RefAddr addr = ref.get(AMQTopic.class.getName());
-
- if (addr != null)
- {
- return new AMQTopic(new AMQBindingURL((String) addr.getContent()));
- }
- }
-
- if (ref.getClassName().equals(AMQConnectionFactory.class.getName()))
- {
- RefAddr addr = ref.get(AMQConnectionFactory.class.getName());
-
- if (addr != null)
- {
- return new AMQConnectionFactory((String) addr.getContent());
- }
- }
-
- }
- return null;
- }
-
-
- public Reference getReference() throws NamingException
- {
- return new Reference(
- AMQConnectionFactory.class.getName(),
- new StringRefAddr(AMQConnectionFactory.class.getName(), _connectionDetails.getURL()),
- AMQConnectionFactory.class.getName(), null); // factory location
- }
-
- // ---------------------------------------------------------------------------------------------------
- // the following methods are provided for XA compatibility
- // Those methods are only supported by 0_10 and above
- // ---------------------------------------------------------------------------------------------------
-
- /**
- * Creates a XAConnection with the default user identity.
- * <p> The XAConnection is created in stopped mode. No messages
- * will be delivered until the <code>Connection.start</code> method
- * is explicitly called.
- *
- * @return A newly created XAConnection
- * @throws JMSException If creating the XAConnection fails due to some internal error.
- * @throws JMSSecurityException If client authentication fails due to an invalid user name or password.
- */
- public XAConnection createXAConnection() throws JMSException
- {
- try
- {
- return new XAConnectionImpl(_connectionDetails, _sslConfig);
- }
- catch (Exception e)
- {
- JMSException jmse = new JMSException("Error creating connection: " + e.getMessage());
- jmse.setLinkedException(e);
- throw jmse;
- }
- }
-
- /**
- * Creates a XAConnection with the specified user identity.
- * <p> The XAConnection is created in stopped mode. No messages
- * will be delivered until the <code>Connection.start</code> method
- * is explicitly called.
- *
- * @param username the caller's user name
- * @param password the caller's password
- * @return A newly created XAConnection.
- * @throws JMSException If creating the XAConnection fails due to some internal error.
- * @throws JMSSecurityException If client authentication fails due to an invalid user name or password.
- */
- public XAConnection createXAConnection(String username, String password) throws JMSException
- {
- if (_connectionDetails != null)
- {
- _connectionDetails.setUsername(username);
- _connectionDetails.setPassword(password);
-
- if (_connectionDetails.getClientName() == null || _connectionDetails.getClientName().equals(""))
- {
- _connectionDetails.setClientName(getUniqueClientID());
- }
- }
- else
- {
- throw new JMSException("A URL must be specified to access XA connections");
- }
- return createXAConnection();
- }
-
-
- /**
- * Creates a XATopicConnection with the default user identity.
- * <p> The XATopicConnection is created in stopped mode. No messages
- * will be delivered until the <code>Connection.start</code> method
- * is explicitly called.
- *
- * @return A newly created XATopicConnection
- * @throws JMSException If creating the XATopicConnection fails due to some internal error.
- * @throws JMSSecurityException If client authentication fails due to an invalid user name or password.
- */
- public XATopicConnection createXATopicConnection() throws JMSException
- {
- return (XATopicConnection) createXAConnection();
- }
-
- /**
- * Creates a XATopicConnection with the specified user identity.
- * <p> The XATopicConnection is created in stopped mode. No messages
- * will be delivered until the <code>Connection.start</code> method
- * is explicitly called.
- *
- * @param username the caller's user name
- * @param password the caller's password
- * @return A newly created XATopicConnection.
- * @throws JMSException If creating the XATopicConnection fails due to some internal error.
- * @throws JMSSecurityException If client authentication fails due to an invalid user name or password.
- */
- public XATopicConnection createXATopicConnection(String username, String password) throws JMSException
- {
- return (XATopicConnection) createXAConnection(username, password);
- }
-
- /**
- * Creates a XAQueueConnection with the default user identity.
- * <p> The XAQueueConnection is created in stopped mode. No messages
- * will be delivered until the <code>Connection.start</code> method
- * is explicitly called.
- *
- * @return A newly created XAQueueConnection
- * @throws JMSException If creating the XAQueueConnection fails due to some internal error.
- * @throws JMSSecurityException If client authentication fails due to an invalid user name or password.
- */
- public XAQueueConnection createXAQueueConnection() throws JMSException
- {
- return (XAQueueConnection) createXAConnection();
- }
-
- /**
- * Creates a XAQueueConnection with the specified user identity.
- * <p> The XAQueueConnection is created in stopped mode. No messages
- * will be delivered until the <code>Connection.start</code> method
- * is explicitly called.
- *
- * @param username the caller's user name
- * @param password the caller's password
- * @return A newly created XAQueueConnection.
- * @throws JMSException If creating the XAQueueConnection fails due to some internal error.
- * @throws JMSSecurityException If client authentication fails due to an invalid user name or password.
- */
- public XAQueueConnection createXAQueueConnection(String username, String password) throws JMSException
- {
- return (XAQueueConnection) createXAConnection(username, password);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionURL.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionURL.java
deleted file mode 100644
index 60e4a5960a..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionURL.java
+++ /dev/null
@@ -1,294 +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.
- *
- */
-package org.apache.qpid.client;
-
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.qpid.client.url.URLParser;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.url.URLHelper;
-import org.apache.qpid.url.URLSyntaxException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AMQConnectionURL implements ConnectionURL
-{
- private static final Logger _logger = LoggerFactory.getLogger(AMQConnectionURL.class);
-
- private String _url;
- private String _failoverMethod;
- private Map<String, String> _failoverOptions;
- private Map<String, String> _options;
- private List<BrokerDetails> _brokers;
- private String _clientName;
- private String _username;
- private String _password;
- private String _virtualHost;
- private AMQShortString _defaultQueueExchangeName;
- private AMQShortString _defaultTopicExchangeName;
- private AMQShortString _temporaryTopicExchangeName;
- private AMQShortString _temporaryQueueExchangeName;
-
- public AMQConnectionURL(String fullURL) throws URLSyntaxException
- {
- if (fullURL == null) throw new IllegalArgumentException("URL cannot be null");
- _url = fullURL;
- _options = new HashMap<String, String>();
- _brokers = new LinkedList<BrokerDetails>();
- _failoverOptions = new HashMap<String, String>();
- new URLParser(this);
- }
-
- public String getURL()
- {
- return _url;
- }
-
- public Map<String,String> getOptions()
- {
- return _options;
- }
-
- public String getFailoverMethod()
- {
- return _failoverMethod;
- }
-
- public void setFailoverMethod(String failoverMethod)
- {
- _failoverMethod = failoverMethod;
- }
-
- public Map<String,String> getFailoverOptions()
- {
- return _failoverOptions;
- }
-
- public String getFailoverOption(String key)
- {
- return _failoverOptions.get(key);
- }
-
- public void setFailoverOption(String key, String value)
- {
- _failoverOptions.put(key, value);
- }
-
- public int getBrokerCount()
- {
- return _brokers.size();
- }
-
- public BrokerDetails getBrokerDetails(int index)
- {
- if (index < _brokers.size())
- {
- return _brokers.get(index);
- }
- else
- {
- return null;
- }
- }
-
- public void addBrokerDetails(BrokerDetails broker)
- {
- if (!(_brokers.contains(broker)))
- {
- _brokers.add(broker);
- }
- }
-
- public void setBrokerDetails(List<BrokerDetails> brokers)
- {
- _brokers = brokers;
- }
-
- public List<BrokerDetails> getAllBrokerDetails()
- {
- return _brokers;
- }
-
- public String getClientName()
- {
- return _clientName;
- }
-
- public void setClientName(String clientName)
- {
- _clientName = clientName;
- }
-
- public String getUsername()
- {
- return _username;
- }
-
- public void setUsername(String username)
- {
- _username = username;
- }
-
- public String getPassword()
- {
- return _password;
- }
-
- public void setPassword(String password)
- {
- _password = password;
- }
-
- public String getVirtualHost()
- {
- return _virtualHost;
- }
-
- public void setVirtualHost(String virtuaHost)
- {
- _virtualHost = virtuaHost;
- }
-
- public String getOption(String key)
- {
- return _options.get(key);
- }
-
- public void setOption(String key, String value)
- {
- _options.put(key, value);
- }
-
- public AMQShortString getDefaultQueueExchangeName()
- {
- return _defaultQueueExchangeName;
- }
-
- public void setDefaultQueueExchangeName(AMQShortString defaultQueueExchangeName)
- {
- _defaultQueueExchangeName = defaultQueueExchangeName;
- }
-
- public AMQShortString getDefaultTopicExchangeName()
- {
- return _defaultTopicExchangeName;
- }
-
- public void setDefaultTopicExchangeName(AMQShortString defaultTopicExchangeName)
- {
- _defaultTopicExchangeName = defaultTopicExchangeName;
- }
-
- public AMQShortString getTemporaryQueueExchangeName()
- {
- return _temporaryQueueExchangeName;
- }
-
- public void setTemporaryQueueExchangeName(AMQShortString temporaryQueueExchangeName)
- {
- _temporaryQueueExchangeName = temporaryQueueExchangeName;
- }
-
- public AMQShortString getTemporaryTopicExchangeName()
- {
- return _temporaryTopicExchangeName;
- }
-
- public void setTemporaryTopicExchangeName(AMQShortString temporaryTopicExchangeName)
- {
- _temporaryTopicExchangeName = temporaryTopicExchangeName;
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
-
- sb.append(AMQ_PROTOCOL);
- sb.append("://");
-
- if (_username != null)
- {
- sb.append(_username);
-
- if (_password != null)
- {
- sb.append(':');
- sb.append("********");
- }
-
- sb.append('@');
- }
-
- sb.append(_clientName);
-
- sb.append(_virtualHost);
-
- sb.append(optionsToString());
-
- return sb.toString();
- }
-
- private String optionsToString()
- {
- StringBuffer sb = new StringBuffer();
-
- sb.append("?" + OPTIONS_BROKERLIST + "='");
-
- for (BrokerDetails service : _brokers)
- {
- sb.append(service.toString());
- sb.append(';');
- }
-
- sb.deleteCharAt(sb.length() - 1);
- sb.append("'");
-
- if (_failoverMethod != null)
- {
- sb.append(URLHelper.DEFAULT_OPTION_SEPERATOR);
- sb.append(OPTIONS_FAILOVER + "='");
- sb.append(_failoverMethod);
- sb.append(URLHelper.printOptions(_failoverOptions));
- sb.append("'");
- }
-
- return sb.toString();
- }
-
- public static void main(String[] args) throws URLSyntaxException
- {
- String url2 =
- "amqp://ritchiem:bob@temp/testHost?brokerlist='tcp://localhost:5672;tcp://fancyserver:3000/',failover='roundrobin'";
- // "amqp://user:pass@clientid/virtualhost?brokerlist='tcp://host:1?option1=\'value\',option2=\'value\';vm://:3?option1=\'value\'',failover='method?option1=\'value\',option2='value''";
-
- ConnectionURL connectionurl2 = new AMQConnectionURL(url2);
-
- System.out.println(url2);
- System.out.println(connectionurl2);
-
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java
deleted file mode 100644
index 750599b350..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java
+++ /dev/null
@@ -1,507 +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.
- *
- */
-package org.apache.qpid.client;
-
-import java.net.URISyntaxException;
-
-import javax.jms.Destination;
-import javax.naming.NamingException;
-import javax.naming.Reference;
-import javax.naming.Referenceable;
-import javax.naming.StringRefAddr;
-
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.qpid.url.BindingURL;
-import org.apache.qpid.url.URLHelper;
-
-
-public abstract class AMQDestination implements Destination, Referenceable
-{
- protected final AMQShortString _exchangeName;
-
- protected final AMQShortString _exchangeClass;
-
- protected final boolean _isDurable;
-
- protected final boolean _isExclusive;
-
- protected final boolean _isAutoDelete;
-
- private AMQShortString _queueName;
-
- private AMQShortString _routingKey;
-
- private AMQShortString[] _bindingKeys;
-
- private String _url;
- private AMQShortString _urlAsShortString;
-
- private boolean _checkedForQueueBinding;
-
- private boolean _exchangeExistsChecked;
-
- private byte[] _byteEncoding;
- private static final int IS_DURABLE_MASK = 0x1;
- private static final int IS_EXCLUSIVE_MASK = 0x2;
- private static final int IS_AUTODELETE_MASK = 0x4;
-
- public static final int QUEUE_TYPE = 1;
- public static final int TOPIC_TYPE = 2;
- public static final int UNKNOWN_TYPE = 3;
-
- protected AMQDestination(String url) throws URISyntaxException
- {
- this(new AMQBindingURL(url));
- }
-
- protected AMQDestination(BindingURL binding)
- {
- _exchangeName = binding.getExchangeName();
- _exchangeClass = binding.getExchangeClass();
-
- _isExclusive = Boolean.parseBoolean(binding.getOption(BindingURL.OPTION_EXCLUSIVE));
- _isAutoDelete = Boolean.parseBoolean(binding.getOption(BindingURL.OPTION_AUTODELETE));
- _isDurable = Boolean.parseBoolean(binding.getOption(BindingURL.OPTION_DURABLE));
- _queueName = binding.getQueueName() == null ? null : binding.getQueueName();
- _routingKey = binding.getRoutingKey() == null ? null : binding.getRoutingKey();
- _bindingKeys = binding.getBindingKeys() == null || binding.getBindingKeys().length == 0 ? new AMQShortString[0] : binding.getBindingKeys();
- }
-
- protected AMQDestination(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString routingKey, AMQShortString queueName)
- {
- this(exchangeName, exchangeClass, routingKey, false, false, queueName, null);
- }
-
- protected AMQDestination(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString routingKey, AMQShortString queueName, AMQShortString[] bindingKeys)
- {
- this(exchangeName, exchangeClass, routingKey, false, false, queueName,bindingKeys);
- }
-
- protected AMQDestination(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString destinationName)
- {
- this(exchangeName, exchangeClass, destinationName, false, false, null,null);
- }
-
- protected AMQDestination(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString routingKey, boolean isExclusive,
- boolean isAutoDelete, AMQShortString queueName)
- {
- this(exchangeName, exchangeClass, routingKey, isExclusive, isAutoDelete, queueName, false,null);
- }
-
- protected AMQDestination(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString routingKey, boolean isExclusive,
- boolean isAutoDelete, AMQShortString queueName,AMQShortString[] bindingKeys)
- {
- this(exchangeName, exchangeClass, routingKey, isExclusive, isAutoDelete, queueName, false,bindingKeys);
- }
-
- protected AMQDestination(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString routingKey, boolean isExclusive,
- boolean isAutoDelete, AMQShortString queueName, boolean isDurable){
- this (exchangeName, exchangeClass, routingKey, isExclusive,isAutoDelete,queueName,isDurable,null);
- }
-
- protected AMQDestination(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString routingKey, boolean isExclusive,
- boolean isAutoDelete, AMQShortString queueName, boolean isDurable,AMQShortString[] bindingKeys)
- {
- // If used with a fannout exchange, the routing key can be null
- if ( !ExchangeDefaults.FANOUT_EXCHANGE_CLASS.equals(exchangeClass) && routingKey == null)
- {
- throw new IllegalArgumentException("routingKey exchange must not be null");
- }
- if (exchangeName == null)
- {
- throw new IllegalArgumentException("Exchange name must not be null");
- }
- if (exchangeClass == null)
- {
- throw new IllegalArgumentException("Exchange class must not be null");
- }
- _exchangeName = exchangeName;
- _exchangeClass = exchangeClass;
- _routingKey = routingKey;
- _isExclusive = isExclusive;
- _isAutoDelete = isAutoDelete;
- _queueName = queueName;
- _isDurable = isDurable;
- _bindingKeys = bindingKeys == null || bindingKeys.length == 0 ? new AMQShortString[0] : bindingKeys;
- }
-
- public AMQShortString getEncodedName()
- {
- if(_urlAsShortString == null)
- {
- toURL();
- }
- return _urlAsShortString;
- }
-
- public boolean isDurable()
- {
- return _isDurable;
- }
-
- public AMQShortString getExchangeName()
- {
- return _exchangeName;
- }
-
- public AMQShortString getExchangeClass()
- {
- return _exchangeClass;
- }
-
- public boolean isTopic()
- {
- return ExchangeDefaults.TOPIC_EXCHANGE_CLASS.equals(_exchangeClass);
- }
-
- public boolean isQueue()
- {
- return ExchangeDefaults.DIRECT_EXCHANGE_CLASS.equals(_exchangeClass);
- }
-
- public String getQueueName()
- {
- return _queueName == null ? null : _queueName.toString();
- }
-
- public AMQShortString getAMQQueueName()
- {
- return _queueName;
- }
-
- public void setQueueName(AMQShortString queueName)
- {
-
- _queueName = queueName;
- // calculated URL now out of date
- _url = null;
- _urlAsShortString = null;
- _byteEncoding = null;
- }
-
- public AMQShortString getRoutingKey()
- {
- return _routingKey;
- }
-
- public AMQShortString[] getBindingKeys()
- {
- if (_bindingKeys != null && _bindingKeys.length > 0)
- {
- return _bindingKeys;
- }
- else
- {
- // catering to the common use case where the
- //routingKey is the same as the bindingKey.
- return new AMQShortString[]{_routingKey};
- }
- }
-
- public boolean isExclusive()
- {
- return _isExclusive;
- }
-
- public boolean isAutoDelete()
- {
- return _isAutoDelete;
- }
-
- public abstract boolean isNameRequired();
-
- public String toString()
- {
- return toURL();
-
- }
-
- public boolean isCheckedForQueueBinding()
- {
- return _checkedForQueueBinding;
- }
-
- public void setCheckedForQueueBinding(boolean checkedForQueueBinding)
- {
- _checkedForQueueBinding = checkedForQueueBinding;
- }
-
-
- public boolean isExchangeExistsChecked()
- {
- return _exchangeExistsChecked;
- }
-
- public void setExchangeExistsChecked(final boolean exchangeExistsChecked)
- {
- _exchangeExistsChecked = exchangeExistsChecked;
- }
-
- public String toURL()
- {
- String url = _url;
- if(url == null)
- {
-
-
- StringBuffer sb = new StringBuffer();
-
- sb.append(_exchangeClass);
- sb.append("://");
- sb.append(_exchangeName);
-
- sb.append("/"+_routingKey+"/");
-
- if (_queueName != null)
- {
- sb.append(_queueName);
- }
-
- sb.append('?');
-
- if (_routingKey != null)
- {
- sb.append(BindingURL.OPTION_ROUTING_KEY);
- sb.append("='");
- sb.append(_routingKey).append("'");
- sb.append(URLHelper.DEFAULT_OPTION_SEPERATOR);
- }
-
- // We can't allow both routingKey and bindingKey
- if (_routingKey == null && _bindingKeys != null && _bindingKeys.length>0)
- {
-
- for (AMQShortString bindingKey:_bindingKeys)
- {
- sb.append(BindingURL.OPTION_BINDING_KEY);
- sb.append("='");
- sb.append(bindingKey);
- sb.append("'");
- sb.append(URLHelper.DEFAULT_OPTION_SEPERATOR);
-
- }
- }
-
- if (_isDurable)
- {
- sb.append(BindingURL.OPTION_DURABLE);
- sb.append("='true'");
- sb.append(URLHelper.DEFAULT_OPTION_SEPERATOR);
- }
-
- if (_isExclusive)
- {
- sb.append(BindingURL.OPTION_EXCLUSIVE);
- sb.append("='true'");
- sb.append(URLHelper.DEFAULT_OPTION_SEPERATOR);
- }
-
- if (_isAutoDelete)
- {
- sb.append(BindingURL.OPTION_AUTODELETE);
- sb.append("='true'");
- sb.append(URLHelper.DEFAULT_OPTION_SEPERATOR);
- }
-
- //removeKey the last char '?' if there is no options , ',' if there are.
- sb.deleteCharAt(sb.length() - 1);
- url = sb.toString();
- _url = url;
- _urlAsShortString = new AMQShortString(url);
- }
- return url;
- }
-
- public byte[] toByteEncoding()
- {
- byte[] encoding = _byteEncoding;
- if(encoding == null)
- {
- int size = _exchangeClass.length() + 1 +
- _exchangeName.length() + 1 +
- 0 + // in place of the destination name
- (_queueName == null ? 0 : _queueName.length()) + 1 +
- 1;
- encoding = new byte[size];
- int pos = 0;
-
- pos = _exchangeClass.writeToByteArray(encoding, pos);
- pos = _exchangeName.writeToByteArray(encoding, pos);
-
- encoding[pos++] = (byte)0;
-
- if(_queueName == null)
- {
- encoding[pos++] = (byte)0;
- }
- else
- {
- pos = _queueName.writeToByteArray(encoding,pos);
- }
- byte options = 0;
- if(_isDurable)
- {
- options |= IS_DURABLE_MASK;
- }
- if(_isExclusive)
- {
- options |= IS_EXCLUSIVE_MASK;
- }
- if(_isAutoDelete)
- {
- options |= IS_AUTODELETE_MASK;
- }
- encoding[pos] = options;
-
-
- _byteEncoding = encoding;
-
- }
- return encoding;
- }
-
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
- if (o == null || getClass() != o.getClass())
- {
- return false;
- }
-
- final AMQDestination that = (AMQDestination) o;
-
- if (!_exchangeClass.equals(that._exchangeClass))
- {
- return false;
- }
- if (!_exchangeName.equals(that._exchangeName))
- {
- return false;
- }
- if ((_queueName == null && that._queueName != null) ||
- (_queueName != null && !_queueName.equals(that._queueName)))
- {
- return false;
- }
-
- return true;
- }
-
- public int hashCode()
- {
- int result;
- result = _exchangeName.hashCode();
- result = 29 * result + _exchangeClass.hashCode();
- //result = 29 * result + _destinationName.hashCode();
- if (_queueName != null)
- {
- result = 29 * result + _queueName.hashCode();
- }
-
- return result;
- }
-
- public Reference getReference() throws NamingException
- {
- return new Reference(
- this.getClass().getName(),
- new StringRefAddr(this.getClass().getName(), toURL()),
- AMQConnectionFactory.class.getName(),
- null); // factory location
- }
-
-
- public static Destination createDestination(byte[] byteEncodedDestination)
- {
- AMQShortString exchangeClass;
- AMQShortString exchangeName;
- AMQShortString routingKey;
- AMQShortString queueName;
- boolean isDurable;
- boolean isExclusive;
- boolean isAutoDelete;
-
- int pos = 0;
- exchangeClass = AMQShortString.readFromByteArray(byteEncodedDestination, pos);
- pos+= exchangeClass.length() + 1;
- exchangeName = AMQShortString.readFromByteArray(byteEncodedDestination, pos);
- pos+= exchangeName.length() + 1;
- routingKey = AMQShortString.readFromByteArray(byteEncodedDestination, pos);
- pos+= (routingKey == null ? 0 : routingKey.length()) + 1;
- queueName = AMQShortString.readFromByteArray(byteEncodedDestination, pos);
- pos+= (queueName == null ? 0 : queueName.length()) + 1;
- int options = byteEncodedDestination[pos];
- isDurable = (options & IS_DURABLE_MASK) != 0;
- isExclusive = (options & IS_EXCLUSIVE_MASK) != 0;
- isAutoDelete = (options & IS_AUTODELETE_MASK) != 0;
-
- if (exchangeClass.equals(ExchangeDefaults.DIRECT_EXCHANGE_CLASS))
- {
- return new AMQQueue(exchangeName,routingKey,queueName,isExclusive,isAutoDelete,isDurable);
- }
- else if (exchangeClass.equals(ExchangeDefaults.TOPIC_EXCHANGE_CLASS))
- {
- return new AMQTopic(exchangeName,routingKey,isAutoDelete,queueName,isDurable);
- }
- else if (exchangeClass.equals(ExchangeDefaults.HEADERS_EXCHANGE_CLASS))
- {
- return new AMQHeadersExchange(routingKey);
- }
- else
- {
- throw new IllegalArgumentException("Unknown Exchange Class:" + exchangeClass);
- }
-
-
-
- }
-
- public static Destination createDestination(BindingURL binding)
- {
- AMQShortString type = binding.getExchangeClass();
-
- if (type.equals(ExchangeDefaults.DIRECT_EXCHANGE_CLASS))
- {
- return new AMQQueue(binding);
- }
- else if (type.equals(ExchangeDefaults.TOPIC_EXCHANGE_CLASS))
- {
- return new AMQTopic(binding);
- }
- else if (type.equals(ExchangeDefaults.HEADERS_EXCHANGE_CLASS))
- {
- return new AMQHeadersExchange(binding);
- }
- else if (type.equals(ExchangeDefaults.FANOUT_EXCHANGE_CLASS))
- {
- return new AMQQueue(binding);
- }
- else
- {
- throw new IllegalArgumentException("Unknown Exchange Class:" + type + " in binding:" + binding);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java
deleted file mode 100644
index b9e9a33cd6..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.url.BindingURL;
-
-/**
- * A destination backed by a headers exchange
- */
-public class AMQHeadersExchange extends AMQDestination
-{
- public AMQHeadersExchange(BindingURL binding)
- {
- this(binding.getExchangeName());
- }
-
- public AMQHeadersExchange(String name)
- {
- this(new AMQShortString(name));
- }
-
- public AMQHeadersExchange(AMQShortString queueName)
- {
- super(queueName, ExchangeDefaults.HEADERS_EXCHANGE_CLASS, queueName, true, true, null);
- }
-
- public boolean isNameRequired()
- {
- //Not sure what the best approach is here, probably to treat this like a topic
- //and allow server to generate names. As it is AMQ specific it doesn't need to
- //fit the JMS API expectations so this is not as yet critical.
- return getAMQQueueName() == null;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java
deleted file mode 100644
index 08867b5de7..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.AMQUndeliveredException;
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQNoConsumersException indicates failure to pass an immediate message to a consumer.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents failure to pass an immediate message to a consumer.
- * <tr><td>
- */
-public class AMQNoConsumersException extends AMQUndeliveredException
-{
- public AMQNoConsumersException(String msg, Object bounced, Throwable cause)
- {
- super(AMQConstant.NO_CONSUMERS, msg, bounced, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java
deleted file mode 100644
index 42ed9c3df7..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.AMQUndeliveredException;
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQNoRouteException indicates that a mandatory message could not be routed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents failure to route a mandatory message.
- * <tr><td>
- */
-public class AMQNoRouteException extends AMQUndeliveredException
-{
- public AMQNoRouteException(String msg, Object bounced, Throwable cause)
- {
- super(AMQConstant.NO_ROUTE, msg, bounced, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java
deleted file mode 100644
index 78b01add14..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java
+++ /dev/null
@@ -1,165 +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.
- *
- */
-package org.apache.qpid.client;
-
-import javax.jms.Queue;
-
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.url.BindingURL;
-
-public class AMQQueue extends AMQDestination implements Queue
-{
-
- /**
- * Create a reference to a non temporary queue using a BindingURL object.
- * Note this does not actually imply the queue exists.
- * @param binding a BindingURL object
- */
- public AMQQueue(BindingURL binding)
- {
- super(binding);
- }
-
- /**
- * Create a reference to a non temporary queue. Note this does not actually imply the queue exists.
- * @param name the name of the queue
- */
- public AMQQueue(AMQShortString exchangeName, String name)
- {
- this(exchangeName, new AMQShortString(name));
- }
-
-
- /**
- * Create a reference to a non temporary queue. Note this does not actually imply the queue exists.
- * @param name the name of the queue
- */
- public AMQQueue(AMQShortString exchangeName, AMQShortString name)
- {
- this(exchangeName, name, false);
- }
-
- public AMQQueue(AMQShortString exchangeName, AMQShortString routingKey, AMQShortString queueName)
- {
- super(exchangeName, ExchangeDefaults.DIRECT_EXCHANGE_CLASS, routingKey, false,
- false, queueName, false);
- }
-
- public AMQQueue(AMQShortString exchangeName, AMQShortString routingKey, AMQShortString queueName,AMQShortString[] bindingKeys)
- {
- super(exchangeName, ExchangeDefaults.DIRECT_EXCHANGE_CLASS, routingKey, false,
- false, queueName, false,bindingKeys);
- }
-
- /**
- * Create a reference to a non temporary queue. Note this does not actually imply the queue exists.
- * @param name the name of the queue
- */
- public AMQQueue(String exchangeName, String name)
- {
- this(new AMQShortString(exchangeName), new AMQShortString(name), false);
- }
-
-
- public AMQQueue(AMQConnection connection, String name)
- {
- this(connection.getDefaultQueueExchangeName(),name);
- }
-
- public AMQQueue(AMQConnection connection, String name, boolean temporary)
- {
- this(connection.getDefaultQueueExchangeName(), new AMQShortString(name),temporary);
- }
-
-
- /**
- * Create a queue with a specified name.
- *
- * @param name the destination name (used in the routing key)
- * @param temporary if true the broker will generate a queue name, also if true then the queue is autodeleted
- * and exclusive
- */
- public AMQQueue(String exchangeName, String name, boolean temporary)
- {
- this(new AMQShortString(exchangeName), new AMQShortString(name),temporary);
- }
-
-
- /**
- * Create a queue with a specified name.
- *
- * @param name the destination name (used in the routing key)
- * @param temporary if true the broker will generate a queue name, also if true then the queue is autodeleted
- * and exclusive
- */
- public AMQQueue(AMQShortString exchangeName, AMQShortString name, boolean temporary)
- {
- // queue name is set to null indicating that the broker assigns a name in the case of temporary queues
- // temporary queues are typically used as response queues
- this(exchangeName, name, temporary?null:name, temporary, temporary, !temporary);
-
- }
-
- /**
- * Create a reference to a queue. Note this does not actually imply the queue exists.
- * @param exchangeName the exchange name we want to send the message to
- * @param routingKey the routing key
- * @param queueName the queue name
- * @param exclusive true if the queue should only permit a single consumer
- * @param autoDelete true if the queue should be deleted automatically when the last consumers detaches
- */
- public AMQQueue(AMQShortString exchangeName, AMQShortString routingKey, AMQShortString queueName, boolean exclusive, boolean autoDelete)
- {
- this(exchangeName, routingKey, queueName, exclusive, autoDelete, false);
- }
-
- public AMQQueue(AMQShortString exchangeName, AMQShortString routingKey, AMQShortString queueName, boolean exclusive, boolean autoDelete, boolean durable)
- {
- this(exchangeName,routingKey,queueName,exclusive,autoDelete,durable,null);
- }
-
- public AMQQueue(AMQShortString exchangeName, AMQShortString routingKey, AMQShortString queueName, boolean exclusive, boolean autoDelete, boolean durable,AMQShortString[] bindingKeys)
- {
- super(exchangeName, ExchangeDefaults.DIRECT_EXCHANGE_CLASS, routingKey, exclusive,
- autoDelete, queueName, durable, bindingKeys);
- }
-
- public AMQShortString getRoutingKey()
- {
- //return getAMQQueueName();
- if (getAMQQueueName() != null && getAMQQueueName().equals(super.getRoutingKey()))
- {
- return getAMQQueueName();
- }
- else
- {
- return super.getRoutingKey();
- }
- }
-
- public boolean isNameRequired()
- {
- //If the name is null, we require one to be generated by the client so that it will#
- //remain valid if we failover (see BLZ-24)
- return getQueueName() == null;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java
deleted file mode 100644
index 08fd49286b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java
+++ /dev/null
@@ -1,137 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.AMQException;
-
-import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-public class AMQQueueBrowser implements QueueBrowser
-{
- private static final Logger _logger = LoggerFactory.getLogger(AMQQueueBrowser.class);
-
- private AtomicBoolean _isClosed = new AtomicBoolean();
- private final AMQSession _session;
- private final AMQQueue _queue;
- private final ArrayList<BasicMessageConsumer> _consumers = new ArrayList<BasicMessageConsumer>();
- private final String _messageSelector;
-
- AMQQueueBrowser(AMQSession session, AMQQueue queue, String messageSelector) throws JMSException
- {
- _session = session;
- _queue = queue;
- _messageSelector = ((messageSelector == null) || (messageSelector.trim().length() == 0)) ? null : messageSelector;
- // Create Consumer to verify message selector.
- BasicMessageConsumer consumer =
- (BasicMessageConsumer) _session.createBrowserConsumer(_queue, _messageSelector, false);
- // Close this consumer as we are not looking to consume only to establish that, at least for now,
- // the QB can be created
- consumer.close();
- }
-
- public Queue getQueue() throws JMSException
- {
- checkState();
-
- return _queue;
- }
-
- private void checkState() throws JMSException
- {
- if (_isClosed.get())
- {
- throw new IllegalStateException("Queue Browser");
- }
-
- if (_session.isClosed())
- {
- throw new IllegalStateException("Session is closed");
- }
-
- }
-
- public String getMessageSelector() throws JMSException
- {
-
- checkState();
-
- return _messageSelector;
- }
-
- public Enumeration getEnumeration() throws JMSException
- {
- checkState();
- final BasicMessageConsumer consumer =
- (BasicMessageConsumer) _session.createBrowserConsumer(_queue, _messageSelector, false);
-
- _consumers.add(consumer);
-
- return new Enumeration()
- {
-
- Message _nextMessage = consumer == null ? null : consumer.receive(1000);
-
- public boolean hasMoreElements()
- {
- _logger.info("QB:hasMoreElements:" + (_nextMessage != null));
- return (_nextMessage != null);
- }
-
- public Object nextElement()
- {
- Message msg = _nextMessage;
- try
- {
- _logger.info("QB:nextElement about to receive");
- _nextMessage = consumer.receive(1000);
- _logger.info("QB:nextElement received:" + _nextMessage);
- }
- catch (JMSException e)
- {
- _logger.warn("Exception caught while queue browsing", e);
- _nextMessage = null;
- }
- return msg;
- }
- };
- }
-
- public void close() throws JMSException
- {
- for (BasicMessageConsumer consumer : _consumers)
- {
- consumer.close();
- }
-
- _consumers.clear();
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java
deleted file mode 100644
index a8c83d8868..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java
+++ /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.
- *
- */
-package org.apache.qpid.client;
-
-import java.io.Serializable;
-
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicSubscriber;
-
-/**
- * Need this adaptor class to conform to JMS spec and throw IllegalStateException
- * from createDurableSubscriber, unsubscribe, createTopic & createTemporaryTopic
- */
-public class AMQQueueSessionAdaptor implements QueueSession, AMQSessionAdapter
-{
- //holds a session for delegation
- protected final AMQSession _session;
-
- /**
- * Construct an adaptor with a session to wrap
- * @param session
- */
- public AMQQueueSessionAdaptor(Session session)
- {
- _session = (AMQSession) session;
- }
-
- public TemporaryQueue createTemporaryQueue() throws JMSException {
- return _session.createTemporaryQueue();
- }
-
- public Queue createQueue(String string) throws JMSException {
- return _session.createQueue(string);
- }
-
- public QueueReceiver createReceiver(Queue queue) throws JMSException {
- return _session.createReceiver(queue);
- }
-
- public QueueReceiver createReceiver(Queue queue, String string) throws JMSException {
- return _session.createReceiver(queue, string);
- }
-
- public QueueSender createSender(Queue queue) throws JMSException {
- return _session.createSender(queue);
- }
-
- public QueueBrowser createBrowser(Queue queue) throws JMSException {
- return _session.createBrowser(queue);
- }
-
- public QueueBrowser createBrowser(Queue queue, String string) throws JMSException {
- return _session.createBrowser(queue, string);
- }
-
- public BytesMessage createBytesMessage() throws JMSException {
- return _session.createBytesMessage();
- }
-
- public MapMessage createMapMessage() throws JMSException {
- return _session.createMapMessage();
- }
-
- public Message createMessage() throws JMSException {
- return _session.createMessage();
- }
-
- public ObjectMessage createObjectMessage() throws JMSException {
- return _session.createObjectMessage();
- }
-
- public ObjectMessage createObjectMessage(Serializable serializable) throws JMSException {
- return _session.createObjectMessage(serializable);
- }
-
- public StreamMessage createStreamMessage() throws JMSException {
- return _session.createStreamMessage();
- }
-
- public TextMessage createTextMessage() throws JMSException {
- return _session.createTextMessage();
- }
-
- public TextMessage createTextMessage(String string) throws JMSException {
- return _session.createTextMessage(string);
- }
-
- public boolean getTransacted() throws JMSException {
- return _session.getTransacted();
- }
-
- public int getAcknowledgeMode() throws JMSException {
- return _session.getAcknowledgeMode();
- }
-
- public void commit() throws JMSException {
- _session.commit();
- }
-
- public void rollback() throws JMSException {
- _session.rollback();
- }
-
- public void close() throws JMSException {
- _session.close();
- }
-
- public void recover() throws JMSException {
- _session.recover();
- }
-
- public MessageListener getMessageListener() throws JMSException {
- return _session.getMessageListener();
- }
-
- public void setMessageListener(MessageListener messageListener) throws JMSException {
- _session.setMessageListener(messageListener);
- }
-
- public void run() {
- _session.run();
- }
-
- public MessageProducer createProducer(Destination destination) throws JMSException {
- return _session.createProducer(destination);
- }
-
- public MessageConsumer createConsumer(Destination destination) throws JMSException {
- return _session.createConsumer(destination);
- }
-
- public MessageConsumer createConsumer(Destination destination, String string) throws JMSException {
- return _session.createConsumer(destination,string);
- }
-
- public MessageConsumer createConsumer(Destination destination, String string, boolean b) throws JMSException {
- return _session.createConsumer(destination,string,b);
- }
-
- //The following methods cannot be called from a QueueSession as per JMS spec
-
- public Topic createTopic(String string) throws JMSException {
- throw new IllegalStateException("Cannot call createTopic from QueueSession");
- }
-
- public TopicSubscriber createDurableSubscriber(Topic topic, String string) throws JMSException {
- throw new IllegalStateException("Cannot call createDurableSubscriber from QueueSession");
- }
-
- public TopicSubscriber createDurableSubscriber(Topic topic, String string, String string1, boolean b) throws JMSException {
- throw new IllegalStateException("Cannot call createDurableSubscriber from QueueSession");
- }
-
- public TemporaryTopic createTemporaryTopic() throws JMSException {
- throw new IllegalStateException("Cannot call createTemporaryTopic from QueueSession");
- }
-
- public void unsubscribe(String string) throws JMSException {
- throw new IllegalStateException("Cannot call unsubscribe from QueueSession");
- }
-
- public AMQSession getSession()
- {
- return _session;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
deleted file mode 100644
index b5d12d9520..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
+++ /dev/null
@@ -1,2908 +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.
- *
- */
-package org.apache.qpid.client;
-
-import java.io.Serializable;
-import java.net.URISyntaxException;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.InvalidSelectorException;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.StreamMessage;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-import javax.jms.TopicSubscriber;
-
-import org.apache.qpid.AMQDisconnectedException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQInvalidArgumentException;
-import org.apache.qpid.AMQInvalidRoutingKeyException;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.failover.FailoverNoopSupport;
-import org.apache.qpid.client.failover.FailoverProtectedOperation;
-import org.apache.qpid.client.failover.FailoverRetrySupport;
-import org.apache.qpid.client.message.*;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.util.FlowControllingBlockingQueue;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.FieldTableFactory;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.url.AMQBindingURL;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </table>
- *
- * @todo Different FailoverSupport implementation are needed on the same method call, in different situations. For
- * example, when failing-over and reestablishing the bindings, the bind cannot be interrupted by a second
- * fail-over, if it fails with an exception, the fail-over process should also fail. When binding outside of
- * the fail-over process, the retry handler could be used to automatically retry the operation once the connection
- * has been reestablished. All fail-over protected operations should be placed in private methods, with
- * FailoverSupport passed in by the caller to provide the correct support for the calling context. Sometimes the
- * fail-over process sets a nowait flag and uses an async method call instead.
- * @todo Two new objects created on every failover supported method call. Consider more efficient ways of doing this,
- * after looking at worse bottlenecks first.
- */
-public abstract class AMQSession<C extends BasicMessageConsumer, P extends BasicMessageProducer> extends Closeable implements Session, QueueSession, TopicSession
-{
-
-
- public static final class IdToConsumerMap<C extends BasicMessageConsumer>
- {
- private final BasicMessageConsumer[] _fastAccessConsumers = new BasicMessageConsumer[16];
- private final ConcurrentHashMap<Integer, C> _slowAccessConsumers = new ConcurrentHashMap<Integer, C>();
-
- public C get(int id)
- {
- if ((id & 0xFFFFFFF0) == 0)
- {
- return (C) _fastAccessConsumers[id];
- }
- else
- {
- return _slowAccessConsumers.get(id);
- }
- }
-
- public C put(int id, C consumer)
- {
- C oldVal;
- if ((id & 0xFFFFFFF0) == 0)
- {
- oldVal = (C) _fastAccessConsumers[id];
- _fastAccessConsumers[id] = consumer;
- }
- else
- {
- oldVal = _slowAccessConsumers.put(id, consumer);
- }
-
- return consumer;
-
- }
-
- public C remove(int id)
- {
- C consumer;
- if ((id & 0xFFFFFFF0) == 0)
- {
- consumer = (C) _fastAccessConsumers[id];
- _fastAccessConsumers[id] = null;
- }
- else
- {
- consumer = _slowAccessConsumers.remove(id);
- }
-
- return consumer;
-
- }
-
- public Collection<C> values()
- {
- ArrayList<C> values = new ArrayList<C>();
-
- for (int i = 0; i < 16; i++)
- {
- if (_fastAccessConsumers[i] != null)
- {
- values.add((C) _fastAccessConsumers[i]);
- }
- }
- values.addAll(_slowAccessConsumers.values());
-
- return values;
- }
-
- public void clear()
- {
- _slowAccessConsumers.clear();
- for (int i = 0; i < 16; i++)
- {
- _fastAccessConsumers[i] = null;
- }
- }
- }
-
- /** Used for debugging. */
- private static final Logger _logger = LoggerFactory.getLogger(AMQSession.class);
-
- /**
- * The default value for immediate flag used by producers created by this session is false. That is, a consumer does
- * not need to be attached to a queue.
- */
- protected static final boolean DEFAULT_IMMEDIATE = false;
-
- /**
- * The default value for mandatory flag used by producers created by this session is true. That is, server will not
- * silently drop messages where no queue is connected to the exchange for the message.
- */
- protected static final boolean DEFAULT_MANDATORY = true;
-
- /** System property to enable strict AMQP compliance. */
- public static final String STRICT_AMQP = "STRICT_AMQP";
-
- /** Strict AMQP default setting. */
- public static final String STRICT_AMQP_DEFAULT = "false";
-
- /** System property to enable failure if strict AMQP compliance is violated. */
- public static final String STRICT_AMQP_FATAL = "STRICT_AMQP_FATAL";
-
- /** Strickt AMQP failure default. */
- public static final String STRICT_AMQP_FATAL_DEFAULT = "true";
-
- /** System property to enable immediate message prefetching. */
- public static final String IMMEDIATE_PREFETCH = "IMMEDIATE_PREFETCH";
-
- /** Immediate message prefetch default. */
- public static final String IMMEDIATE_PREFETCH_DEFAULT = "false";
-
- /** The connection to which this session belongs. */
- protected AMQConnection _connection;
-
- /** Used to indicate whether or not this is a transactional session. */
- protected boolean _transacted;
-
- /** Holds the sessions acknowledgement mode. */
- protected final int _acknowledgeMode;
-
- /** Holds this session unique identifier, used to distinguish it from other sessions. */
- protected int _channelId;
-
- private int _ticket;
-
- /** Holds the high mark for prefetched message, at which the session is suspended. */
- private int _defaultPrefetchHighMark;
-
- /** Holds the low mark for prefetched messages, below which the session is resumed. */
- private int _defaultPrefetchLowMark;
-
- /** Holds the message listener, if any, which is attached to this session. */
- private MessageListener _messageListener = null;
-
- /** Used to indicate that this session has been started at least once. */
- private AtomicBoolean _startedAtLeastOnce = new AtomicBoolean(false);
-
- /**
- * Used to reference durable subscribers so that requests for unsubscribe can be handled correctly. Note this only
- * keeps a record of subscriptions which have been created in the current instance. It does not remember
- * subscriptions between executions of the client.
- */
- protected final ConcurrentHashMap<String, TopicSubscriberAdaptor> _subscriptions =
- new ConcurrentHashMap<String, TopicSubscriberAdaptor>();
-
- /**
- * Holds a mapping from message consumers to their identifying names, so that their subscriptions may be looked
- * up in the {@link #_subscriptions} map.
- */
- protected final ConcurrentHashMap<C, String> _reverseSubscriptionMap =
- new ConcurrentHashMap<C, String>();
-
- /**
- * Used to hold incoming messages.
- *
- * @todo Weaken the type once {@link FlowControllingBlockingQueue} implements Queue.
- */
- protected final FlowControllingBlockingQueue _queue;
-
- /** Holds the highest received delivery tag. */
- private final AtomicLong _highestDeliveryTag = new AtomicLong(-1);
- private final AtomicLong _rollbackMark = new AtomicLong(-1);
-
- /** All the not yet acknowledged message tags */
- protected ConcurrentLinkedQueue<Long> _unacknowledgedMessageTags = new ConcurrentLinkedQueue<Long>();
-
- /** All the delivered message tags */
- protected ConcurrentLinkedQueue<Long> _deliveredMessageTags = new ConcurrentLinkedQueue<Long>();
-
- /** Holds the dispatcher thread for this session. */
- protected Dispatcher _dispatcher;
-
- /** Holds the message factory factory for this session. */
- protected MessageFactoryRegistry _messageFactoryRegistry;
-
- /** Holds all of the producers created by this session, keyed by their unique identifiers. */
- private Map<Long, MessageProducer> _producers = new ConcurrentHashMap<Long, MessageProducer>();
-
- /**
- * Used as a source of unique identifiers so that the consumers can be tagged to match them to BasicConsume
- * methods.
- */
- private int _nextTag = 1;
-
- /**
- * Maps from identifying tags to message consumers, in order to pass dispatch incoming messages to the right
- * consumer.
- */
- protected final IdToConsumerMap<C> _consumers = new IdToConsumerMap<C>();
-
- //Map<AMQShortString, BasicMessageConsumer> _consumers =
- //new ConcurrentHashMap<AMQShortString, BasicMessageConsumer>();
-
- /**
- * Contains a list of consumers which have been removed but which might still have
- * messages to acknowledge, eg in client ack or transacted modes
- */
- private CopyOnWriteArrayList<C> _removedConsumers = new CopyOnWriteArrayList<C>();
-
- /** Provides a count of consumers on destinations, in order to be able to know if a destination has consumers. */
- private ConcurrentHashMap<Destination, AtomicInteger> _destinationConsumerCount =
- new ConcurrentHashMap<Destination, AtomicInteger>();
-
- /**
- * Used as a source of unique identifiers for producers within the session.
- *
- * <p/> Access to this id does not require to be synchronized since according to the JMS specification only one
- * thread of control is allowed to create producers for any given session instance.
- */
- private long _nextProducerId;
-
- /**
- * Set when recover is called. This is to handle the case where recover() is called by application code during
- * onMessage() processing to enure that an auto ack is not sent.
- */
- private boolean _inRecovery;
-
- /** Used to indicates that the connection to which this session belongs, has been stopped. */
- private boolean _connectionStopped;
-
- /** Used to indicate that this session has a message listener attached to it. */
- private boolean _hasMessageListeners;
-
- /** Used to indicate that this session has been suspended. */
- private boolean _suspended;
-
- /**
- * Used to protect the suspension of this session, so that critical code can be executed during suspension,
- * without the session being resumed by other threads.
- */
- private final Object _suspensionLock = new Object();
-
- /**
- * Used to ensure that onlt the first call to start the dispatcher can unsuspend the channel.
- *
- * @todo This is accessed only within a synchronized method, so does not need to be atomic.
- */
- protected final AtomicBoolean _firstDispatcher = new AtomicBoolean(true);
-
- /** Used to indicate that the session should start pre-fetching messages as soon as it is started. */
- protected final boolean _immediatePrefetch;
-
- /** Indicates that warnings should be generated on violations of the strict AMQP. */
- protected final boolean _strictAMQP;
-
- /** Indicates that runtime exceptions should be generated on vilations of the strict AMQP. */
- protected final boolean _strictAMQPFATAL;
- private final Object _messageDeliveryLock = new Object();
-
- /** Session state : used to detect if commit is a) required b) allowed , i.e. does the tx span failover. */
- private boolean _dirty;
- /** Has failover occured on this session with outstanding actions to commit? */
- private boolean _failedOverDirty;
-
- private static final class FlowControlIndicator
- {
- private volatile boolean _flowControl = true;
-
- public synchronized void setFlowControl(boolean flowControl)
- {
- _flowControl = flowControl;
- notify();
- }
-
- public boolean getFlowControl()
- {
- return _flowControl;
- }
- }
-
- /** Flow control */
- private FlowControlIndicator _flowControl = new FlowControlIndicator();
-
- /**
- * Creates a new session on a connection.
- *
- * @param con The connection on which to create the session.
- * @param channelId The unique identifier for the session.
- * @param transacted Indicates whether or not the session is transactional.
- * @param acknowledgeMode The acknoledgement mode for the session.
- * @param messageFactoryRegistry The message factory factory for the session.
- * @param defaultPrefetchHighMark The maximum number of messages to prefetched before suspending the session.
- * @param defaultPrefetchLowMark The number of prefetched messages at which to resume the session.
- */
- protected AMQSession(AMQConnection con, int channelId, boolean transacted, int acknowledgeMode,
- MessageFactoryRegistry messageFactoryRegistry, int defaultPrefetchHighMark, int defaultPrefetchLowMark)
- {
-
- _strictAMQP = Boolean.parseBoolean(System.getProperties().getProperty(STRICT_AMQP, STRICT_AMQP_DEFAULT));
- _strictAMQPFATAL =
- Boolean.parseBoolean(System.getProperties().getProperty(STRICT_AMQP_FATAL, STRICT_AMQP_FATAL_DEFAULT));
- _immediatePrefetch =
- _strictAMQP
- || Boolean.parseBoolean(System.getProperties().getProperty(IMMEDIATE_PREFETCH, IMMEDIATE_PREFETCH_DEFAULT));
-
- _connection = con;
- _transacted = transacted;
- if (transacted)
- {
- _acknowledgeMode = javax.jms.Session.SESSION_TRANSACTED;
- }
- else
- {
- _acknowledgeMode = acknowledgeMode;
- }
-
- _channelId = channelId;
- _messageFactoryRegistry = messageFactoryRegistry;
- _defaultPrefetchHighMark = defaultPrefetchHighMark;
- _defaultPrefetchLowMark = defaultPrefetchLowMark;
-
- if (_acknowledgeMode == NO_ACKNOWLEDGE)
- {
- _queue =
- new FlowControllingBlockingQueue(_defaultPrefetchHighMark, _defaultPrefetchLowMark,
- new FlowControllingBlockingQueue.ThresholdListener()
- {
- private final AtomicBoolean _suspendState = new AtomicBoolean();
-
- public void aboveThreshold(int currentValue)
- {
- _logger.debug(
- "Above threshold(" + _defaultPrefetchHighMark
- + ") so suspending channel. Current value is " + currentValue);
- _suspendState.set(true);
- new Thread(new SuspenderRunner(_suspendState)).start();
-
- }
-
- public void underThreshold(int currentValue)
- {
- _logger.debug(
- "Below threshold(" + _defaultPrefetchLowMark
- + ") so unsuspending channel. Current value is " + currentValue);
- _suspendState.set(false);
- new Thread(new SuspenderRunner(_suspendState)).start();
-
- }
- });
- }
- else
- {
- _queue = new FlowControllingBlockingQueue(_defaultPrefetchHighMark, null);
- }
- }
-
- /**
- * Creates a new session on a connection with the default message factory factory.
- *
- * @param con The connection on which to create the session.
- * @param channelId The unique identifier for the session.
- * @param transacted Indicates whether or not the session is transactional.
- * @param acknowledgeMode The acknoledgement mode for the session.
- * @param defaultPrefetchHigh The maximum number of messages to prefetched before suspending the session.
- * @param defaultPrefetchLow The number of prefetched messages at which to resume the session.
- */
- AMQSession(AMQConnection con, int channelId, boolean transacted, int acknowledgeMode, int defaultPrefetchHigh,
- int defaultPrefetchLow)
- {
- this(con, channelId, transacted, acknowledgeMode, MessageFactoryRegistry.newDefaultRegistry(), defaultPrefetchHigh,
- defaultPrefetchLow);
- }
-
- // ===== JMS Session methods.
-
- /**
- * Closes the session with no timeout.
- *
- * @throws JMSException If the JMS provider fails to close the session due to some internal error.
- */
- public void close() throws JMSException
- {
- close(-1);
- }
-
- public void checkNotClosed() throws JMSException
- {
- try
- {
- super.checkNotClosed();
- }
- catch (IllegalStateException ise)
- {
- // if the Connection has closed then we should throw any exception that has occured that we were not waiting for
- AMQStateManager manager = _connection.getProtocolHandler().getStateManager();
-
- if (manager.getCurrentState().equals(AMQState.CONNECTION_CLOSED) && manager.getLastException() != null)
- {
- ise.setLinkedException(manager.getLastException());
- }
-
- throw ise;
- }
- }
-
- public BytesMessage createBytesMessage() throws JMSException
- {
- checkNotClosed();
- return new JMSBytesMessage(getMessageDelegateFactory());
- }
-
- /**
- * Acknowledges all unacknowledged messages on the session, for all message consumers on the session.
- *
- * @throws IllegalStateException If the session is closed.
- */
- public void acknowledge() throws IllegalStateException
- {
- if (isClosed())
- {
- throw new IllegalStateException("Session is already closed");
- }
- else if (hasFailedOver())
- {
- throw new IllegalStateException("has failed over");
- }
-
- while (true)
- {
- Long tag = _unacknowledgedMessageTags.poll();
- if (tag == null)
- {
- break;
- }
- acknowledgeMessage(tag, false);
- }
- }
-
- /**
- * Acknowledge one or many messages.
- *
- * @param deliveryTag The tag of the last message to be acknowledged.
- * @param multiple <tt>true</tt> to acknowledge all messages up to and including the one specified by the
- * delivery tag, <tt>false</tt> to just acknowledge that message.
- *
- * @todo Be aware of possible changes to parameter order as versions change.
- */
- public abstract void acknowledgeMessage(long deliveryTag, boolean multiple);
-
- public MethodRegistry getMethodRegistry()
- {
- MethodRegistry methodRegistry = getProtocolHandler().getMethodRegistry();
- return methodRegistry;
- }
-
- /**
- * Binds the named queue, with the specified routing key, to the named exchange.
- *
- * <p/>Note that this operation automatically retries in the event of fail-over.
- *
- * @param queueName The name of the queue to bind.
- * @param routingKey The routing key to bind the queue with.
- * @param arguments Additional arguments.
- * @param exchangeName The exchange to bind the queue on.
- *
- * @throws AMQException If the queue cannot be bound for any reason.
- * @todo Be aware of possible changes to parameter order as versions change.
- * @todo Document the additional arguments that may be passed in the field table. Are these for headers exchanges?
- */
- public void bindQueue(final AMQShortString queueName, final AMQShortString routingKey, final FieldTable arguments,
- final AMQShortString exchangeName, final AMQDestination destination) throws AMQException
- {
- /*new FailoverRetrySupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()*/
- new FailoverNoopSupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()
- {
- public Object execute() throws AMQException, FailoverException
- {
- sendQueueBind(queueName, routingKey, arguments, exchangeName, destination);
- return null;
- }
- }, _connection).execute();
- }
-
- public void addBindingKey(C consumer, AMQDestination amqd, String routingKey) throws AMQException
- {
- if (consumer.getQueuename() != null)
- {
- bindQueue(consumer.getQueuename(), new AMQShortString(routingKey), new FieldTable(), amqd.getExchangeName(), amqd);
- }
- }
-
- public abstract void sendQueueBind(final AMQShortString queueName, final AMQShortString routingKey, final FieldTable arguments,
- final AMQShortString exchangeName, AMQDestination destination) throws AMQException, FailoverException;
-
- /**
- * Closes the session.
- *
- * <p/>Note that this operation succeeds automatically if a fail-over interupts the sycnronous request to close
- * the channel. This is because the channel is marked as closed before the request to close it is made, so the
- * fail-over should not re-open it.
- *
- * @param timeout The timeout in milliseconds to wait for the session close acknoledgement from the broker.
- *
- * @throws JMSException If the JMS provider fails to close the session due to some internal error.
- * @todo Be aware of possible changes to parameter order as versions change.
- * @todo Not certain about the logic of ignoring the failover exception, because the channel won't be
- * re-opened. May need to examine this more carefully.
- * @todo Note that taking the failover mutex doesn't prevent this operation being interrupted by a failover,
- * because the failover process sends the failover event before acquiring the mutex itself.
- */
- public void close(long timeout) throws JMSException
- {
- if (_logger.isInfoEnabled())
- {
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- _logger.info("Closing session: " + this); // + ":"
- // + Arrays.asList(stackTrace).subList(3, stackTrace.length - 1));
- }
-
- // Ensure we only try and close an open session.
- if (!_closed.getAndSet(true))
- {
- synchronized (getFailoverMutex())
- {
- // We must close down all producers and consumers in an orderly fashion. This is the only method
- // that can be called from a different thread of control from the one controlling the session.
- synchronized (_messageDeliveryLock)
- {
- // we pass null since this is not an error case
- closeProducersAndConsumers(null);
-
- try
- {
- sendClose(timeout);
- }
- catch (AMQException e)
- {
- JMSException jmse = new JMSException("Error closing session: " + e);
- jmse.setLinkedException(e);
- throw jmse;
- }
- // This is ignored because the channel is already marked as closed so the fail-over process will
- // not re-open it.
- catch (FailoverException e)
- {
- _logger.debug(
- "Got FailoverException during channel close, ignored as channel already marked as closed.");
- }
- finally
- {
- _connection.deregisterSession(_channelId);
- }
- }
- }
- }
- }
-
- public abstract void sendClose(long timeout) throws AMQException, FailoverException;
-
- /**
- * Called when the server initiates the closure of the session unilaterally.
- *
- * @param e the exception that caused this session to be closed. Null causes the
- */
- public void closed(Throwable e) throws JMSException
- {
- // This method needs to be improved. Throwables only arrive here from the mina : exceptionRecived
- // calls through connection.closeAllSessions which is also called by the public connection.close()
- // with a null cause
- // When we are closing the Session due to a protocol session error we simply create a new AMQException
- // with the correct error code and text this is cleary WRONG as the instanceof check below will fail.
- // We need to determin here if the connection should be
-
- if (e instanceof AMQDisconnectedException)
- {
- if (_dispatcher != null)
- {
- // Failover failed and ain't coming back. Knife the dispatcher.
- _dispatcher.interrupt();
- }
- }
-
- if (!_closed.getAndSet(true))
- {
- synchronized (getFailoverMutex())
- {
- synchronized (_messageDeliveryLock)
- {
- // An AMQException has an error code and message already and will be passed in when closure occurs as a
- // result of a channel close request
- AMQException amqe;
- if (e instanceof AMQException)
- {
- amqe = (AMQException) e;
- }
- else
- {
- amqe = new AMQException("Closing session forcibly", e);
- }
-
- _connection.deregisterSession(_channelId);
- closeProducersAndConsumers(amqe);
- }
- }
- }
- }
-
- /**
- * Commits all messages done in this transaction and releases any locks currently held.
- *
- * <p/>If the commit fails, because the commit itself is interrupted by a fail-over between requesting that the
- * commit be done, and receiving an acknowledgement that it has been done, then a JMSException will be thrown.
- * The client will be unable to determine whether or not the commit actually happened on the broker in this case.
- *
- * @throws JMSException If the JMS provider fails to commit the transaction due to some internal error. This does
- * not mean that the commit is known to have failed, merely that it is not known whether it
- * failed or not.
- * @todo Be aware of possible changes to parameter order as versions change.
- */
- public void commit() throws JMSException
- {
- checkTransacted();
-
- try
- {
-
- // TGM FIXME: what about failover?
- // Acknowledge all delivered messages
- while (true)
- {
- Long tag = _deliveredMessageTags.poll();
- if (tag == null)
- {
- break;
- }
-
- acknowledgeMessage(tag, false);
- }
- // Commits outstanding messages and acknowledgments
- sendCommit();
- markClean();
- }
- catch (AMQException e)
- {
- throw new JMSAMQException("Failed to commit: " + e.getMessage(), e);
- }
- catch (FailoverException e)
- {
- throw new JMSAMQException("Fail-over interrupted commit. Status of the commit is uncertain.", e);
- }
- }
-
- public abstract void sendCommit() throws AMQException, FailoverException;
-
-
- public void confirmConsumerCancelled(int consumerTag)
- {
-
- // Remove the consumer from the map
- C consumer = _consumers.get(consumerTag);
- if (consumer != null)
- {
- if (!consumer.isNoConsume()) // Normal Consumer
- {
- // Clean the Maps up first
- // Flush any pending messages for this consumerTag
- if (_dispatcher != null)
- {
- _logger.info("Dispatcher is not null");
- }
- else
- {
- _logger.info("Dispatcher is null so created stopped dispatcher");
- startDispatcherIfNecessary(true);
- }
-
- _dispatcher.rejectPending(consumer);
- }
- else // Queue Browser
- {
- // Just close the consumer
- // fixme the CancelOK is being processed before the arriving messages..
- // The dispatcher is still to process them so the server sent in order but the client
- // has yet to receive before the close comes in.
-
- // consumer.markClosed();
-
- if (consumer.isAutoClose())
- {
- // There is a small window where the message is between the two queues in the dispatcher.
- if (consumer.isClosed())
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Closing consumer:" + consumer.debugIdentity());
- }
-
- deregisterConsumer(consumer);
- }
- else
- {
- _queue.add(new CloseConsumerMessage(consumer));
- }
- }
- }
- }
- }
-
- public QueueBrowser createBrowser(Queue queue) throws JMSException
- {
- if (isStrictAMQP())
- {
- throw new UnsupportedOperationException();
- }
-
- return createBrowser(queue, null);
- }
-
- public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException
- {
- if (isStrictAMQP())
- {
- throw new UnsupportedOperationException();
- }
-
- checkNotClosed();
- checkValidQueue(queue);
-
- return new AMQQueueBrowser(this, (AMQQueue) queue, messageSelector);
- }
-
- public MessageConsumer createBrowserConsumer(Destination destination, String messageSelector, boolean noLocal)
- throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, _defaultPrefetchHighMark, _defaultPrefetchLowMark, noLocal, false,
- messageSelector, null, true, true);
- }
-
- public MessageConsumer createConsumer(Destination destination) throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, _defaultPrefetchHighMark, _defaultPrefetchLowMark, false, (destination instanceof Topic), null, null,
- false, false);
- }
-
- public C createExclusiveConsumer(Destination destination) throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, _defaultPrefetchHighMark, _defaultPrefetchLowMark, false, true, null, null,
- false, false);
- }
-
- public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, _defaultPrefetchHighMark, _defaultPrefetchLowMark, false, (destination instanceof Topic),
- messageSelector, null, false, false);
- }
-
- public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal)
- throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, _defaultPrefetchHighMark, _defaultPrefetchLowMark, noLocal, (destination instanceof Topic),
- messageSelector, null, false, false);
- }
-
- public MessageConsumer createExclusiveConsumer(Destination destination, String messageSelector, boolean noLocal)
- throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, _defaultPrefetchHighMark, _defaultPrefetchLowMark, noLocal, true,
- messageSelector, null, false, false);
- }
-
- public MessageConsumer createConsumer(Destination destination, int prefetch, boolean noLocal, boolean exclusive,
- String selector) throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, prefetch, prefetch / 2, noLocal, exclusive, selector, null, false, false);
- }
-
- public MessageConsumer createConsumer(Destination destination, int prefetchHigh, int prefetchLow, boolean noLocal,
- boolean exclusive, String selector) throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, prefetchHigh, prefetchLow, noLocal, exclusive, selector, null, false, false);
- }
-
- public MessageConsumer createConsumer(Destination destination, int prefetch, boolean noLocal, boolean exclusive,
- String selector, FieldTable rawSelector) throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, prefetch, prefetch / 2, noLocal, exclusive, selector, rawSelector, false, false);
- }
-
- public MessageConsumer createConsumer(Destination destination, int prefetchHigh, int prefetchLow, boolean noLocal,
- boolean exclusive, String selector, FieldTable rawSelector) throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, prefetchHigh, prefetchLow, noLocal, exclusive, selector, rawSelector, false,
- false);
- }
-
- public abstract TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException;
-
- public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal)
- throws JMSException
- {
- checkNotClosed();
- checkValidTopic(topic);
- if (_subscriptions.containsKey(name))
- {
- _subscriptions.get(name).close();
- }
- AMQTopic dest = AMQTopic.createDurableTopic((AMQTopic) topic, name, _connection);
- C consumer = (C) createConsumer(dest, messageSelector, noLocal);
- TopicSubscriberAdaptor<C> subscriber = new TopicSubscriberAdaptor(dest, consumer);
- _subscriptions.put(name, subscriber);
- _reverseSubscriptionMap.put(subscriber.getMessageConsumer(), name);
-
- return subscriber;
- }
-
- public MapMessage createMapMessage() throws JMSException
- {
- checkNotClosed();
- return new JMSMapMessage(getMessageDelegateFactory());
- }
-
- public javax.jms.Message createMessage() throws JMSException
- {
- return createBytesMessage();
- }
-
- public ObjectMessage createObjectMessage() throws JMSException
- {
- checkNotClosed();
- return (ObjectMessage) new JMSObjectMessage(getMessageDelegateFactory());
- }
-
- public ObjectMessage createObjectMessage(Serializable object) throws JMSException
- {
- ObjectMessage msg = createObjectMessage();
- msg.setObject(object);
-
- return msg;
- }
-
- public P createProducer(Destination destination) throws JMSException
- {
- return createProducerImpl(destination, DEFAULT_MANDATORY, DEFAULT_IMMEDIATE);
- }
-
- public P createProducer(Destination destination, boolean immediate) throws JMSException
- {
- return createProducerImpl(destination, DEFAULT_MANDATORY, immediate);
- }
-
- public P createProducer(Destination destination, boolean mandatory, boolean immediate)
- throws JMSException
- {
- return createProducerImpl(destination, mandatory, immediate);
- }
-
- public P createProducer(Destination destination, boolean mandatory, boolean immediate,
- boolean waitUntilSent) throws JMSException
- {
- return createProducerImpl(destination, mandatory, immediate, waitUntilSent);
- }
-
- public TopicPublisher createPublisher(Topic topic) throws JMSException
- {
- checkNotClosed();
-
- return new TopicPublisherAdapter((P) createProducer(topic, false, false), topic);
- }
-
- public Queue createQueue(String queueName) throws JMSException
- {
- checkNotClosed();
- if (queueName.indexOf('/') == -1)
- {
- return new AMQQueue(getDefaultQueueExchangeName(), new AMQShortString(queueName));
- }
- else
- {
- try
- {
- return new AMQQueue(new AMQBindingURL(queueName));
- }
- catch (URISyntaxException urlse)
- {
- JMSException jmse = new JMSException(urlse.getReason());
- jmse.setLinkedException(urlse);
-
- throw jmse;
- }
- }
- }
-
- /**
- * Declares the named queue.
- *
- * <p/>Note that this operation automatically retries in the event of fail-over.
- *
- * @param name The name of the queue to declare.
- * @param autoDelete
- * @param durable Flag to indicate that the queue is durable.
- * @param exclusive Flag to indicate that the queue is exclusive to this client.
- *
- * @throws AMQException If the queue cannot be declared for any reason.
- * @todo Be aware of possible changes to parameter order as versions change.
- */
- public void createQueue(final AMQShortString name, final boolean autoDelete, final boolean durable,
- final boolean exclusive) throws AMQException
- {
- createQueue(name, autoDelete, durable, exclusive, null);
- }
-
- /**
- * Declares the named queue.
- *
- * <p/>Note that this operation automatically retries in the event of fail-over.
- *
- * @param name The name of the queue to declare.
- * @param autoDelete
- * @param durable Flag to indicate that the queue is durable.
- * @param exclusive Flag to indicate that the queue is exclusive to this client.
- * @param arguments Arguments used to set special properties of the queue
- *
- * @throws AMQException If the queue cannot be declared for any reason.
- * @todo Be aware of possible changes to parameter order as versions change.
- */
- public void createQueue(final AMQShortString name, final boolean autoDelete, final boolean durable,
- final boolean exclusive, final Map<String, Object> arguments) throws AMQException
- {
- new FailoverRetrySupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()
- {
- public Object execute() throws AMQException, FailoverException
- {
- sendCreateQueue(name, autoDelete, durable, exclusive, arguments);
- return null;
- }
- }, _connection).execute();
- }
-
- public abstract void sendCreateQueue(AMQShortString name, final boolean autoDelete, final boolean durable,
- final boolean exclusive, final Map<String, Object> arguments) throws AMQException, FailoverException;
-
- /**
- * Creates a QueueReceiver
- *
- * @param destination
- *
- * @return QueueReceiver - a wrapper around our MessageConsumer
- *
- * @throws JMSException
- */
- public QueueReceiver createQueueReceiver(Destination destination) throws JMSException
- {
- checkValidDestination(destination);
- AMQQueue dest = (AMQQueue) destination;
- C consumer = (C) createConsumer(destination);
-
- return new QueueReceiverAdaptor(dest, consumer);
- }
-
- /**
- * Creates a QueueReceiver using a message selector
- *
- * @param destination
- * @param messageSelector
- *
- * @return QueueReceiver - a wrapper around our MessageConsumer
- *
- * @throws JMSException
- */
- public QueueReceiver createQueueReceiver(Destination destination, String messageSelector) throws JMSException
- {
- checkValidDestination(destination);
- AMQQueue dest = (AMQQueue) destination;
- C consumer = (C) createConsumer(destination, messageSelector);
-
- return new QueueReceiverAdaptor(dest, consumer);
- }
-
- /**
- * Creates a QueueReceiver wrapping a MessageConsumer
- *
- * @param queue
- *
- * @return QueueReceiver
- *
- * @throws JMSException
- */
- public QueueReceiver createReceiver(Queue queue) throws JMSException
- {
- checkNotClosed();
- AMQQueue dest = (AMQQueue) queue;
- C consumer = (C) createConsumer(dest);
-
- return new QueueReceiverAdaptor(dest, consumer);
- }
-
- /**
- * Creates a QueueReceiver wrapping a MessageConsumer using a message selector
- *
- * @param queue
- * @param messageSelector
- *
- * @return QueueReceiver
- *
- * @throws JMSException
- */
- public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException
- {
- checkNotClosed();
- AMQQueue dest = (AMQQueue) queue;
- C consumer = (C) createConsumer(dest, messageSelector);
-
- return new QueueReceiverAdaptor(dest, consumer);
- }
-
- public QueueSender createSender(Queue queue) throws JMSException
- {
- checkNotClosed();
-
- // return (QueueSender) createProducer(queue);
- return new QueueSenderAdapter(createProducer(queue), queue);
- }
-
- public StreamMessage createStreamMessage() throws JMSException
- {
- // This method needs to be improved. Throwables only arrive here from the mina : exceptionRecived
- // calls through connection.closeAllSessions which is also called by the public connection.close()
- // with a null cause
- // When we are closing the Session due to a protocol session error we simply create a new AMQException
- // with the correct error code and text this is cleary WRONG as the instanceof check below will fail.
- // We need to determin here if the connection should be
-
- synchronized (getFailoverMutex())
- {
- checkNotClosed();
-
- return new JMSStreamMessage(getMessageDelegateFactory());
- }
- }
-
- /**
- * Creates a non-durable subscriber
- *
- * @param topic
- *
- * @return TopicSubscriber - a wrapper round our MessageConsumer
- *
- * @throws JMSException
- */
- public TopicSubscriber createSubscriber(Topic topic) throws JMSException
- {
- checkNotClosed();
- AMQTopic dest = checkValidTopic(topic);
-
- // AMQTopic dest = new AMQTopic(topic.getTopicName());
- return new TopicSubscriberAdaptor(dest, (C) createExclusiveConsumer(dest));
- }
-
- /**
- * Creates a non-durable subscriber with a message selector
- *
- * @param topic
- * @param messageSelector
- * @param noLocal
- *
- * @return TopicSubscriber - a wrapper round our MessageConsumer
- *
- * @throws JMSException
- */
- public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException
- {
- checkNotClosed();
- AMQTopic dest = checkValidTopic(topic);
-
- // AMQTopic dest = new AMQTopic(topic.getTopicName());
- return new TopicSubscriberAdaptor(dest, (C) createExclusiveConsumer(dest, messageSelector, noLocal));
- }
-
- public TemporaryQueue createTemporaryQueue() throws JMSException
- {
- checkNotClosed();
- try
- {
- AMQTemporaryQueue result = new AMQTemporaryQueue(this);
-
- // this is done so that we can produce to a temporary queue before we create a consumer
- result.setQueueName(result.getRoutingKey());
- createQueue(result.getAMQQueueName(), result.isAutoDelete(),
- result.isDurable(), result.isExclusive());
- bindQueue(result.getAMQQueueName(), result.getRoutingKey(),
- new FieldTable(), result.getExchangeName(), result);
- return result;
- }
- catch (Exception e)
- {
- JMSException ex = new JMSException("Cannot create temporary queue");
- ex.setLinkedException(e);
- e.printStackTrace();
- throw ex;
- }
- }
-
- public TemporaryTopic createTemporaryTopic() throws JMSException
- {
- checkNotClosed();
-
- return new AMQTemporaryTopic(this);
- }
-
- public TextMessage createTextMessage() throws JMSException
- {
- synchronized (getFailoverMutex())
- {
- checkNotClosed();
-
- return new JMSTextMessage(getMessageDelegateFactory());
- }
- }
-
- protected Object getFailoverMutex()
- {
- return _connection.getFailoverMutex();
- }
-
- public TextMessage createTextMessage(String text) throws JMSException
- {
-
- TextMessage msg = createTextMessage();
- msg.setText(text);
-
- return msg;
- }
-
- public Topic createTopic(String topicName) throws JMSException
- {
- checkNotClosed();
-
- if (topicName.indexOf('/') == -1)
- {
- return new AMQTopic(getDefaultTopicExchangeName(), new AMQShortString(topicName));
- }
- else
- {
- try
- {
- return new AMQTopic(new AMQBindingURL(topicName));
- }
- catch (URISyntaxException urlse)
- {
- JMSException jmse = new JMSException(urlse.getReason());
- jmse.setLinkedException(urlse);
-
- throw jmse;
- }
- }
- }
-
- public void declareExchange(AMQShortString name, AMQShortString type, boolean nowait) throws AMQException
- {
- declareExchange(name, type, getProtocolHandler(), nowait);
- }
-
- public int getAcknowledgeMode() throws JMSException
- {
- checkNotClosed();
-
- return _acknowledgeMode;
- }
-
- public AMQConnection getAMQConnection()
- {
- return _connection;
- }
-
- public int getChannelId()
- {
- return _channelId;
- }
-
- public int getDefaultPrefetch()
- {
- return _defaultPrefetchHighMark;
- }
-
- public int getDefaultPrefetchHigh()
- {
- return _defaultPrefetchHighMark;
- }
-
- public int getDefaultPrefetchLow()
- {
- return _defaultPrefetchLowMark;
- }
-
- public AMQShortString getDefaultQueueExchangeName()
- {
- return _connection.getDefaultQueueExchangeName();
- }
-
- public AMQShortString getDefaultTopicExchangeName()
- {
- return _connection.getDefaultTopicExchangeName();
- }
-
- public MessageListener getMessageListener() throws JMSException
- {
- // checkNotClosed();
- return _messageListener;
- }
-
- public AMQShortString getTemporaryQueueExchangeName()
- {
- return _connection.getTemporaryQueueExchangeName();
- }
-
- public AMQShortString getTemporaryTopicExchangeName()
- {
- return _connection.getTemporaryTopicExchangeName();
- }
-
- public int getTicket()
- {
- return _ticket;
- }
-
- public boolean getTransacted() throws JMSException
- {
- checkNotClosed();
-
- return _transacted;
- }
-
- public boolean hasConsumer(Destination destination)
- {
- AtomicInteger counter = _destinationConsumerCount.get(destination);
-
- return (counter != null) && (counter.get() != 0);
- }
-
- public boolean isStrictAMQP()
- {
- return _strictAMQP;
- }
-
- public boolean isSuspended()
- {
- return _suspended;
- }
-
- protected void addUnacknowledgedMessage(long id)
- {
- _unacknowledgedMessageTags.add(id);
- }
-
- protected void addDeliveredMessage(long id)
- {
- _deliveredMessageTags.add(id);
- }
-
- /**
- * Invoked by the MINA IO thread (indirectly) when a message is received from the transport. Puts the message onto
- * the queue read by the dispatcher.
- *
- * @param message the message that has been received
- */
- public void messageReceived(UnprocessedMessage message)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Message[" + message.toString() + "] received in session");
- }
- _highestDeliveryTag.set(message.getDeliveryTag());
- _queue.add(message);
- }
-
- public void declareAndBind(AMQDestination amqd)
- throws
- AMQException
- {
- AMQProtocolHandler protocolHandler = getProtocolHandler();
- declareExchange(amqd, protocolHandler, false);
- AMQShortString queueName = declareQueue(amqd, protocolHandler, false);
- bindQueue(queueName, amqd.getRoutingKey(), new FieldTable(), amqd.getExchangeName(), amqd);
- }
-
- /**
- * Stops message delivery in this session, and restarts message delivery with the oldest unacknowledged message.
- *
- * <p/>All consumers deliver messages in a serial order. Acknowledging a received message automatically acknowledges
- * all messages that have been delivered to the client.
- *
- * <p/>Restarting a session causes it to take the following actions:
- *
- * <ul>
- * <li>Stop message delivery.</li>
- * <li>Mark all messages that might have been delivered but not acknowledged as "redelivered".
- * <li>Restart the delivery sequence including all unacknowledged messages that had been previously delivered.
- * Redelivered messages do not have to be delivered in exactly their original delivery order.</li>
- * </ul>
- *
- * <p/>If the recover operation is interrupted by a fail-over, between asking that the broker begin recovery and
- * receiving acknolwedgement that it hasm then a JMSException will be thrown. In this case it will not be possible
- * for the client to determine whether the broker is going to recover the session or not.
- *
- * @throws JMSException If the JMS provider fails to stop and restart message delivery due to some internal error.
- * Not that this does not necessarily mean that the recovery has failed, but simply that it is
- * not possible to tell if it has or not.
- * @todo Be aware of possible changes to parameter order as versions change.
- */
- public void recover() throws JMSException
- {
- // Ensure that the session is open.
- checkNotClosed();
-
- // Ensure that the session is not transacted.
- checkNotTransacted();
-
- // this is set only here, and the before the consumer's onMessage is called it is set to false
- _inRecovery = true;
- try
- {
-
- boolean isSuspended = isSuspended();
-
- if (!isSuspended)
- {
- suspendChannel(true);
- }
-
- if (_dispatcher != null)
- {
- _dispatcher.rollback();
- }
-
- sendRecover();
-
- if (!isSuspended)
- {
- suspendChannel(false);
- }
- }
- catch (AMQException e)
- {
- throw new JMSAMQException("Recover failed: " + e.getMessage(), e);
- }
- catch (FailoverException e)
- {
- throw new JMSAMQException("Recovery was interrupted by fail-over. Recovery status is not known.", e);
- }
- }
-
- protected abstract void sendRecover() throws AMQException, FailoverException;
-
- public void rejectMessage(UnprocessedMessage message, boolean requeue)
- {
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Rejecting Unacked message:" + message.getDeliveryTag());
- }
-
- rejectMessage(message.getDeliveryTag(), requeue);
- }
-
- public void rejectMessage(AbstractJMSMessage message, boolean requeue)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Rejecting Abstract message:" + message.getDeliveryTag());
- }
-
- rejectMessage(message.getDeliveryTag(), requeue);
-
- }
-
- public abstract void rejectMessage(long deliveryTag, boolean requeue);
-
- /**
- * Commits all messages done in this transaction and releases any locks currently held.
- *
- * <p/>If the rollback fails, because the rollback itself is interrupted by a fail-over between requesting that the
- * rollback be done, and receiving an acknowledgement that it has been done, then a JMSException will be thrown.
- * The client will be unable to determine whether or not the rollback actually happened on the broker in this case.
- *
- * @throws JMSException If the JMS provider fails to rollback the transaction due to some internal error. This does
- * not mean that the rollback is known to have failed, merely that it is not known whether it
- * failed or not.
- * @todo Be aware of possible changes to parameter order as versions change.
- */
- public void rollback() throws JMSException
- {
- synchronized (_suspensionLock)
- {
- checkTransacted();
-
- try
- {
- boolean isSuspended = isSuspended();
-
- if (!isSuspended)
- {
- suspendChannel(true);
- }
-
- releaseForRollback();
-
- sendRollback();
-
- markClean();
-
- if (!isSuspended)
- {
- suspendChannel(false);
- }
- }
- catch (AMQException e)
- {
- throw new JMSAMQException("Failed to rollback: " + e, e);
- }
- catch (FailoverException e)
- {
- throw new JMSAMQException("Fail-over interrupted rollback. Status of the rollback is uncertain.", e);
- }
- }
- }
-
- public abstract void releaseForRollback();
-
- public abstract void sendRollback() throws AMQException, FailoverException;
-
- public void run()
- {
- throw new java.lang.UnsupportedOperationException();
- }
-
- public void setMessageListener(MessageListener listener) throws JMSException
- {
- // checkNotClosed();
- //
- // if (_dispatcher != null && !_dispatcher.connectionStopped())
- // {
- // throw new javax.njms.IllegalStateException("Attempt to set listener while session is started.");
- // }
- //
- // // We are stopped
- // for (Iterator<BasicMessageConsumer> i = _consumers.values().iterator(); i.hasNext();)
- // {
- // BasicMessageConsumer consumer = i.next();
- //
- // if (consumer.isReceiving())
- // {
- // throw new javax.njms.IllegalStateException("Another thread is already receiving synchronously.");
- // }
- // }
- //
- // _messageListener = listener;
- //
- // for (Iterator<BasicMessageConsumer> i = _consumers.values().iterator(); i.hasNext();)
- // {
- // i.next().setMessageListener(_messageListener);
- // }
-
- }
-
- /*public void setTicket(int ticket)
- {
- _ticket = ticket;
- }*/
-
- public void unsubscribe(String name) throws JMSException
- {
- checkNotClosed();
- TopicSubscriberAdaptor subscriber = _subscriptions.get(name);
- if (subscriber != null)
- {
- // send a queue.delete for the subscription
- deleteQueue(AMQTopic.getDurableTopicQueueName(name, _connection));
- _subscriptions.remove(name);
- _reverseSubscriptionMap.remove(subscriber);
- }
- else
- {
- if (_strictAMQP)
- {
- if (_strictAMQPFATAL)
- {
- throw new UnsupportedOperationException("JMS Durable not currently supported by AMQP.");
- }
- else
- {
- _logger.warn("Unable to determine if subscription already exists for '" + name + "' for unsubscribe."
- + " Requesting queue deletion regardless.");
- }
-
- deleteQueue(AMQTopic.getDurableTopicQueueName(name, _connection));
- }
- else // Queue Browser
- {
-
- if (isQueueBound(getDefaultTopicExchangeName(), AMQTopic.getDurableTopicQueueName(name, _connection)))
- {
- deleteQueue(AMQTopic.getDurableTopicQueueName(name, _connection));
- }
- else
- {
- throw new InvalidDestinationException("Unknown subscription exchange:" + name);
- }
- }
- }
- }
-
- protected C createConsumerImpl(final Destination destination, final int prefetchHigh,
- final int prefetchLow, final boolean noLocal, final boolean exclusive, String selector, final FieldTable rawSelector,
- final boolean noConsume, final boolean autoClose) throws JMSException
- {
- checkTemporaryDestination(destination);
-
- final String messageSelector;
-
- if (_strictAMQP && !((selector == null) || selector.equals("")))
- {
- if (_strictAMQPFATAL)
- {
- throw new UnsupportedOperationException("Selectors not currently supported by AMQP.");
- }
- else
- {
- messageSelector = null;
- }
- }
- else
- {
- messageSelector = selector;
- }
-
- return new FailoverRetrySupport<C, JMSException>(
- new FailoverProtectedOperation<C, JMSException>()
- {
- public C execute() throws JMSException, FailoverException
- {
- checkNotClosed();
-
- AMQDestination amqd = (AMQDestination) destination;
-
- final AMQProtocolHandler protocolHandler = getProtocolHandler();
- // TODO: Define selectors in AMQP
- // TODO: construct the rawSelector from the selector string if rawSelector == null
- final FieldTable ft = FieldTableFactory.newFieldTable();
- // if (rawSelector != null)
- // ft.put("headers", rawSelector.getDataAsBytes());
- // rawSelector is used by HeadersExchange and is not a JMS Selector
- if (rawSelector != null)
- {
- ft.addAll(rawSelector);
- }
-
- if (messageSelector != null)
- {
- ft.put(new AMQShortString("x-filter-jms-selector"), messageSelector);
- }
-
- C consumer = createMessageConsumer(amqd, prefetchHigh, prefetchLow,
- noLocal, exclusive, messageSelector, ft, noConsume, autoClose);
-
- if (_messageListener != null)
- {
- consumer.setMessageListener(_messageListener);
- }
-
- try
- {
- registerConsumer(consumer, false);
- }
- catch (AMQInvalidArgumentException ise)
- {
- JMSException ex = new InvalidSelectorException(ise.getMessage());
- ex.setLinkedException(ise);
- throw ex;
- }
- catch (AMQInvalidRoutingKeyException e)
- {
- JMSException ide =
- new InvalidDestinationException("Invalid routing key:" + amqd.getRoutingKey().toString());
- ide.setLinkedException(e);
- throw ide;
- }
- catch (AMQException e)
- {
- JMSException ex = new JMSException("Error registering consumer: " + e);
-
- ex.setLinkedException(e);
- throw ex;
- }
-
- synchronized (destination)
- {
- _destinationConsumerCount.putIfAbsent(destination, new AtomicInteger());
- _destinationConsumerCount.get(destination).incrementAndGet();
- }
-
- return consumer;
- }
- }, _connection).execute();
- }
-
- public abstract C createMessageConsumer(final AMQDestination destination, final int prefetchHigh,
- final int prefetchLow, final boolean noLocal, final boolean exclusive, String selector, final FieldTable arguments,
- final boolean noConsume, final boolean autoClose) throws JMSException;
-
- /**
- * Called by the MessageConsumer when closing, to deregister the consumer from the map from consumerTag to consumer
- * instance.
- *
- * @param consumer the consum
- */
- void deregisterConsumer(C consumer)
- {
- if (_consumers.remove(consumer.getConsumerTag()) != null)
- {
- String subscriptionName = _reverseSubscriptionMap.remove(consumer);
- if (subscriptionName != null)
- {
- _subscriptions.remove(subscriptionName);
- }
-
- Destination dest = consumer.getDestination();
- synchronized (dest)
- {
- if (_destinationConsumerCount.get(dest).decrementAndGet() == 0)
- {
- _destinationConsumerCount.remove(dest);
- }
- }
-
- // Consumers that are closed in a transaction must be stored
- // so that messages they have received can be acknowledged on commit
- if (_transacted)
- {
- _removedConsumers.add(consumer);
- }
- }
- }
-
- void deregisterProducer(long producerId)
- {
- _producers.remove(new Long(producerId));
- }
-
- boolean isInRecovery()
- {
- return _inRecovery;
- }
-
- boolean isQueueBound(AMQShortString exchangeName, AMQShortString queueName) throws JMSException
- {
- return isQueueBound(exchangeName, queueName, null);
- }
-
- /**
- * Tests whether or not the specified queue is bound to the specified exchange under a particular routing key.
- *
- * <p/>Note that this operation automatically retries in the event of fail-over.
- *
- * @param exchangeName The exchange name to test for binding against.
- * @param queueName The queue name to check if bound.
- * @param routingKey The routing key to check if the queue is bound under.
- *
- * @return <tt>true</tt> if the queue is bound to the exchange and routing key, <tt>false</tt> if not.
- *
- * @throws JMSException If the query fails for any reason.
- * @todo Be aware of possible changes to parameter order as versions change.
- */
- public abstract boolean isQueueBound(final AMQShortString exchangeName, final AMQShortString queueName, final AMQShortString routingKey)
- throws JMSException;
-
- public abstract boolean isQueueBound(final AMQDestination destination) throws JMSException;
-
- /**
- * Called to mark the session as being closed. Useful when the session needs to be made invalid, e.g. after failover
- * when the client has veoted resubscription. <p/> The caller of this method must already hold the failover mutex.
- */
- void markClosed()
- {
- _closed.set(true);
- _connection.deregisterSession(_channelId);
- markClosedProducersAndConsumers();
-
- }
-
- /**
- * Resubscribes all producers and consumers. This is called when performing failover.
- *
- * @throws AMQException
- */
- void resubscribe() throws AMQException
- {
- if (_dirty)
- {
- _failedOverDirty = true;
- }
-
- _rollbackMark.set(-1);
- resubscribeProducers();
- resubscribeConsumers();
- }
-
- void setHasMessageListeners()
- {
- _hasMessageListeners = true;
- }
-
- void setInRecovery(boolean inRecovery)
- {
- _inRecovery = inRecovery;
- }
-
- /**
- * Starts the session, which ensures that it is not suspended and that its event dispatcher is running.
- *
- * @throws AMQException If the session cannot be started for any reason.
- * @todo This should be controlled by _stopped as it pairs with the stop method fixme or check the
- * FlowControlledBlockingQueue _queue to see if we have flow controlled. will result in sending Flow messages
- * for each subsequent call to flow.. only need to do this if we have called stop.
- */
- void start() throws AMQException
- {
- // Check if the session has perviously been started and suspended, in which case it must be unsuspended.
- if (_startedAtLeastOnce.getAndSet(true))
- {
- suspendChannel(false);
- }
-
- // If the event dispatcher is not running then start it too.
- if (hasMessageListeners())
- {
- startDispatcherIfNecessary();
- }
- }
-
- void startDispatcherIfNecessary()
- {
- //If we are the dispatcher then we don't need to check we are started
- if (Thread.currentThread() == _dispatcher)
- {
- return;
- }
-
- // If IMMEDIATE_PREFETCH is not set then we need to start fetching
- // This is final per session so will be multi-thread safe.
- if (!_immediatePrefetch)
- {
- // We do this now if this is the first call on a started connection
- if (isSuspended() && _startedAtLeastOnce.get() && _firstDispatcher.getAndSet(false))
- {
- try
- {
- suspendChannel(false);
- }
- catch (AMQException e)
- {
- _logger.info("Unsuspending channel threw an exception:" + e);
- }
- }
- }
-
- startDispatcherIfNecessary(false);
- }
-
- synchronized void startDispatcherIfNecessary(boolean initiallyStopped)
- {
- if (_dispatcher == null)
- {
- _dispatcher = new Dispatcher();
- _dispatcher.setDaemon(true);
- _dispatcher.setConnectionStopped(initiallyStopped);
- _dispatcher.start();
- }
- else
- {
- _dispatcher.setConnectionStopped(initiallyStopped);
- }
- }
-
- void stop() throws AMQException
- {
- // Stop the server delivering messages to this session.
- suspendChannel(true);
-
- if (_dispatcher != null)
- {
- _dispatcher.setConnectionStopped(true);
- }
- }
-
- /*
- * Binds the named queue, with the specified routing key, to the named exchange.
- *
- * <p/>Note that this operation automatically retries in the event of fail-over.
- *
- * @param queueName The name of the queue to bind.
- * @param routingKey The routing key to bind the queue with.
- * @param arguments Additional arguments.
- * @param exchangeName The exchange to bind the queue on.
- *
- * @throws AMQException If the queue cannot be bound for any reason.
- */
- /*private void bindQueue(AMQDestination amqd, AMQShortString queueName, AMQProtocolHandler protocolHandler, FieldTable ft)
- throws AMQException, FailoverException
- {
- AMQFrame queueBind =
- QueueBindBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(), ft, // arguments
- amqd.getExchangeName(), // exchange
- false, // nowait
- queueName, // queue
- amqd.getRoutingKey(), // routingKey
- getTicket()); // ticket
-
- protocolHandler.syncWrite(queueBind, QueueBindOkBody.class);
- }*/
-
- private void checkNotTransacted() throws JMSException
- {
- if (getTransacted())
- {
- throw new IllegalStateException("Session is transacted");
- }
- }
-
- private void checkTemporaryDestination(Destination destination) throws JMSException
- {
- if ((destination instanceof TemporaryDestination))
- {
- _logger.debug("destination is temporary");
- final TemporaryDestination tempDest = (TemporaryDestination) destination;
- if (tempDest.getSession() != this)
- {
- _logger.debug("destination is on different session");
- throw new JMSException("Cannot consume from a temporary destination created onanother session");
- }
-
- if (tempDest.isDeleted())
- {
- _logger.debug("destination is deleted");
- throw new JMSException("Cannot consume from a deleted destination");
- }
- }
- }
-
- protected void checkTransacted() throws JMSException
- {
- if (!getTransacted())
- {
- throw new IllegalStateException("Session is not transacted");
- }
- }
-
- private void checkValidDestination(Destination destination) throws InvalidDestinationException
- {
- if (destination == null)
- {
- throw new javax.jms.InvalidDestinationException("Invalid Queue");
- }
- }
-
- private void checkValidQueue(Queue queue) throws InvalidDestinationException
- {
- if (queue == null)
- {
- throw new javax.jms.InvalidDestinationException("Invalid Queue");
- }
- }
-
- /*
- * I could have combined the last 3 methods, but this way it improves readability
- */
- protected AMQTopic checkValidTopic(Topic topic) throws JMSException
- {
- if (topic == null)
- {
- throw new javax.jms.InvalidDestinationException("Invalid Topic");
- }
-
- if ((topic instanceof TemporaryDestination) && (((TemporaryDestination) topic).getSession() != this))
- {
- throw new javax.jms.InvalidDestinationException(
- "Cannot create a subscription on a temporary topic created in another session");
- }
-
- if (!(topic instanceof AMQTopic))
- {
- throw new javax.jms.InvalidDestinationException(
- "Cannot create a subscription on topic created for another JMS Provider, class of topic provided is: "
- + topic.getClass().getName());
- }
-
- return (AMQTopic) topic;
- }
-
- /**
- * Called to close message consumers cleanly. This may or may <b>not</b> be as a result of an error.
- *
- * @param error not null if this is a result of an error occurring at the connection level
- */
- private void closeConsumers(Throwable error) throws JMSException
- {
- // we need to clone the list of consumers since the close() method updates the _consumers collection
- // which would result in a concurrent modification exception
- final ArrayList<C> clonedConsumers = new ArrayList<C>(_consumers.values());
-
- final Iterator<C> it = clonedConsumers.iterator();
- while (it.hasNext())
- {
- final C con = it.next();
- if (error != null)
- {
- con.notifyError(error);
- }
- else
- {
- con.close(false);
- }
- }
- // at this point the _consumers map will be empty
- if (_dispatcher != null)
- {
- _dispatcher.close();
- _dispatcher = null;
- }
- }
-
- /**
- * Called to close message producers cleanly. This may or may <b>not</b> be as a result of an error. There is
- * currently no way of propagating errors to message producers (this is a JMS limitation).
- */
- private void closeProducers() throws JMSException
- {
- // we need to clone the list of producers since the close() method updates the _producers collection
- // which would result in a concurrent modification exception
- final ArrayList clonedProducers = new ArrayList(_producers.values());
-
- final Iterator it = clonedProducers.iterator();
- while (it.hasNext())
- {
- final P prod = (P) it.next();
- prod.close();
- }
- // at this point the _producers map is empty
- }
-
- /**
- * Close all producers or consumers. This is called either in the error case or when closing the session normally.
- *
- * @param amqe the exception, may be null to indicate no error has occurred
- */
- private void closeProducersAndConsumers(AMQException amqe) throws JMSException
- {
- JMSException jmse = null;
- try
- {
- closeProducers();
- }
- catch (JMSException e)
- {
- _logger.error("Error closing session: " + e, e);
- jmse = e;
- }
-
- try
- {
- closeConsumers(amqe);
- }
- catch (JMSException e)
- {
- _logger.error("Error closing session: " + e, e);
- if (jmse == null)
- {
- jmse = e;
- }
- }
-
- if (jmse != null)
- {
- throw jmse;
- }
- }
-
- /**
- * Register to consume from the queue.
- *
- * @param queueName
- */
- private void consumeFromQueue(C consumer, AMQShortString queueName,
- AMQProtocolHandler protocolHandler, boolean nowait, String messageSelector) throws AMQException, FailoverException
- {
- int tagId = _nextTag++;
-
- consumer.setConsumerTag(tagId);
- // we must register the consumer in the map before we actually start listening
- _consumers.put(tagId, consumer);
-
- try
- {
- sendConsume(consumer, queueName, protocolHandler, nowait, messageSelector, tagId);
- }
- catch (AMQException e)
- {
- // clean-up the map in the event of an error
- _consumers.remove(tagId);
- throw e;
- }
- }
-
- public abstract void sendConsume(C consumer, AMQShortString queueName,
- AMQProtocolHandler protocolHandler, boolean nowait, String messageSelector, int tag) throws AMQException, FailoverException;
-
- private P createProducerImpl(Destination destination, boolean mandatory, boolean immediate)
- throws JMSException
- {
- return createProducerImpl(destination, mandatory, immediate, false);
- }
-
- private P createProducerImpl(final Destination destination, final boolean mandatory,
- final boolean immediate, final boolean waitUntilSent) throws JMSException
- {
- return new FailoverRetrySupport<P, JMSException>(
- new FailoverProtectedOperation<P, JMSException>()
- {
- public P execute() throws JMSException, FailoverException
- {
- checkNotClosed();
- long producerId = getNextProducerId();
- P producer = createMessageProducer(destination, mandatory,
- immediate, waitUntilSent, producerId);
- registerProducer(producerId, producer);
-
- return producer;
- }
- }, _connection).execute();
- }
-
- public abstract P createMessageProducer(final Destination destination, final boolean mandatory,
- final boolean immediate, final boolean waitUntilSent, long producerId);
-
- private void declareExchange(AMQDestination amqd, AMQProtocolHandler protocolHandler, boolean nowait) throws AMQException
- {
- declareExchange(amqd.getExchangeName(), amqd.getExchangeClass(), protocolHandler, nowait);
- }
-
- /**
- * Returns the number of messages currently queued for the given destination.
- *
- * <p/>Note that this operation automatically retries in the event of fail-over.
- *
- * @param amqd The destination to be checked
- *
- * @return the number of queued messages.
- *
- * @throws AMQException If the queue cannot be declared for any reason.
- */
- public long getQueueDepth(final AMQDestination amqd)
- throws AMQException
- {
- return new FailoverNoopSupport<Long, AMQException>(
- new FailoverProtectedOperation<Long, AMQException>()
- {
- public Long execute() throws AMQException, FailoverException
- {
- return requestQueueDepth(amqd);
- }
- }, _connection).execute();
-
- }
-
- protected abstract Long requestQueueDepth(AMQDestination amqd) throws AMQException, FailoverException;
-
- /**
- * Declares the named exchange and type of exchange.
- *
- * <p/>Note that this operation automatically retries in the event of fail-over.
- *
- * @param name The name of the exchange to declare.
- * @param type The type of the exchange to declare.
- * @param protocolHandler The protocol handler to process the communication through.
- * @param nowait
- *
- * @throws AMQException If the exchange cannot be declared for any reason.
- * @todo Be aware of possible changes to parameter order as versions change.
- */
- private void declareExchange(final AMQShortString name, final AMQShortString type,
- final AMQProtocolHandler protocolHandler, final boolean nowait) throws AMQException
- {
- new FailoverNoopSupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()
- {
- public Object execute() throws AMQException, FailoverException
- {
- sendExchangeDeclare(name, type, protocolHandler, nowait);
- return null;
- }
- }, _connection).execute();
- }
-
- public abstract void sendExchangeDeclare(final AMQShortString name, final AMQShortString type, final AMQProtocolHandler protocolHandler,
- final boolean nowait) throws AMQException, FailoverException;
-
- /**
- * Declares a queue for a JMS destination.
- *
- * <p/>Note that for queues but not topics the name is generated in the client rather than the server. This allows
- * the name to be reused on failover if required. In general, the destination indicates whether it wants a name
- * generated or not.
- *
- * <p/>Note that this operation automatically retries in the event of fail-over.
- *
- * @param amqd The destination to declare as a queue.
- * @param protocolHandler The protocol handler to communicate through.
- *
- * @return The name of the decalred queue. This is useful where the broker is generating a queue name on behalf of
- * the client.
- *
- * @throws AMQException If the queue cannot be declared for any reason.
- * @todo Verify the destiation is valid or throw an exception.
- * @todo Be aware of possible changes to parameter order as versions change.
- */
- protected AMQShortString declareQueue(final AMQDestination amqd, final AMQProtocolHandler protocolHandler,
- final boolean noLocal)
- throws AMQException
- {
- /*return new FailoverRetrySupport<AMQShortString, AMQException>(*/
- return new FailoverNoopSupport<AMQShortString, AMQException>(
- new FailoverProtectedOperation<AMQShortString, AMQException>()
- {
- public AMQShortString execute() throws AMQException, FailoverException
- {
- // Generate the queue name if the destination indicates that a client generated name is to be used.
- if (amqd.isNameRequired())
- {
- amqd.setQueueName(protocolHandler.generateQueueName());
- }
-
- sendQueueDeclare(amqd, protocolHandler);
-
- return amqd.getAMQQueueName();
- }
- }, _connection).execute();
- }
-
- public abstract void sendQueueDeclare(final AMQDestination amqd, final AMQProtocolHandler protocolHandler) throws AMQException, FailoverException;
-
- /**
- * Undeclares the specified queue.
- *
- * <p/>Note that this operation automatically retries in the event of fail-over.
- *
- * @param queueName The name of the queue to delete.
- *
- * @throws JMSException If the queue could not be deleted for any reason.
- * @todo Be aware of possible changes to parameter order as versions change.
- */
- protected void deleteQueue(final AMQShortString queueName) throws JMSException
- {
- try
- {
- new FailoverRetrySupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()
- {
- public Object execute() throws AMQException, FailoverException
- {
- sendQueueDelete(queueName);
- return null;
- }
- }, _connection).execute();
- }
- catch (AMQException e)
- {
- throw new JMSAMQException("The queue deletion failed: " + e.getMessage(), e);
- }
- }
-
- public abstract void sendQueueDelete(final AMQShortString queueName) throws AMQException, FailoverException;
-
- private long getNextProducerId()
- {
- return ++_nextProducerId;
- }
-
- protected AMQProtocolHandler getProtocolHandler()
- {
- return _connection.getProtocolHandler();
- }
-
- public byte getProtocolMajorVersion()
- {
- return getProtocolHandler().getProtocolMajorVersion();
- }
-
- public byte getProtocolMinorVersion()
- {
- return getProtocolHandler().getProtocolMinorVersion();
- }
-
- protected boolean hasMessageListeners()
- {
- return _hasMessageListeners;
- }
-
- private void markClosedConsumers() throws JMSException
- {
- if (_dispatcher != null)
- {
- _dispatcher.close();
- _dispatcher = null;
- }
- // we need to clone the list of consumers since the close() method updates the _consumers collection
- // which would result in a concurrent modification exception
- final ArrayList<C> clonedConsumers = new ArrayList<C>(_consumers.values());
-
- final Iterator<C> it = clonedConsumers.iterator();
- while (it.hasNext())
- {
- final C con = it.next();
- con.markClosed();
- }
- // at this point the _consumers map will be empty
- }
-
- private void markClosedProducersAndConsumers()
- {
- try
- {
- // no need for a markClosed* method in this case since there is no protocol traffic closing a producer
- closeProducers();
- }
- catch (JMSException e)
- {
- _logger.error("Error closing session: " + e, e);
- }
-
- try
- {
- markClosedConsumers();
- }
- catch (JMSException e)
- {
- _logger.error("Error closing session: " + e, e);
- }
- }
-
- /**
- * Callers must hold the failover mutex before calling this method.
- *
- * @param consumer
- *
- * @throws AMQException
- */
- private void registerConsumer(C consumer, boolean nowait) throws AMQException // , FailoverException
- {
- AMQDestination amqd = consumer.getDestination();
-
- AMQProtocolHandler protocolHandler = getProtocolHandler();
-
- declareExchange(amqd, protocolHandler, false);
-
- AMQShortString queueName = declareQueue(amqd, protocolHandler, consumer.isNoLocal());
-
- // store the consumer queue name
- consumer.setQueuename(queueName);
-
- bindQueue(queueName, amqd.getRoutingKey(), consumer.getArguments(), amqd.getExchangeName(), amqd);
-
- // If IMMEDIATE_PREFETCH is not required then suspsend the channel to delay prefetch
- if (!_immediatePrefetch)
- {
- // The dispatcher will be null if we have just created this session
- // so suspend the channel before we register our consumer so that we don't
- // start prefetching until a receive/mListener is set.
- if (_dispatcher == null)
- {
- if (!isSuspended())
- {
- try
- {
- suspendChannel(true);
- _logger.info(
- "Prefetching delayed existing messages will not flow until requested via receive*() or setML().");
- }
- catch (AMQException e)
- {
- _logger.info("Suspending channel threw an exception:" + e);
- }
- }
- }
- }
- else
- {
- _logger.info("Immediately prefetching existing messages to new consumer.");
- }
-
- try
- {
- consumeFromQueue(consumer, queueName, protocolHandler, nowait, consumer.getMessageSelector());
- }
- catch (JMSException e) // thrown by getMessageSelector
- {
- throw new AMQException(null, e.getMessage(), e);
- }
- catch (FailoverException e)
- {
- throw new AMQException(null, "Fail-over exception interrupted basic consume.", e);
- }
- }
-
- private void registerProducer(long producerId, MessageProducer producer)
- {
- _producers.put(new Long(producerId), producer);
- }
-
- private void rejectAllMessages(boolean requeue)
- {
- rejectMessagesForConsumerTag(0, requeue, true);
- }
-
- /**
- * @param consumerTag The consumerTag to prune from queue or all if null
- * @param requeue Should the removed messages be requeued (or discarded. Possibly to DLQ)
- * @param rejectAllConsumers
- */
-
- private void rejectMessagesForConsumerTag(int consumerTag, boolean requeue, boolean rejectAllConsumers)
- {
- Iterator messages = _queue.iterator();
- if (_logger.isInfoEnabled())
- {
- _logger.info("Rejecting messages from _queue for Consumer tag(" + consumerTag + ") (PDispatchQ) requeue:"
- + requeue);
-
- if (messages.hasNext())
- {
- _logger.info("Checking all messages in _queue for Consumer tag(" + consumerTag + ")");
- }
- else
- {
- _logger.info("No messages in _queue to reject");
- }
- }
- while (messages.hasNext())
- {
- UnprocessedMessage message = (UnprocessedMessage) messages.next();
-
- if (rejectAllConsumers || (message.getConsumerTag() == consumerTag))
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Removing message(" + System.identityHashCode(message) + ") from _queue DT:"
- + message.getDeliveryTag());
- }
-
- messages.remove();
-
- rejectMessage(message, requeue);
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Rejected the message(" + message.toString() + ") for consumer :" + consumerTag);
- }
- }
- }
- }
-
- private void resubscribeConsumers() throws AMQException
- {
- ArrayList<C> consumers = new ArrayList<C>(_consumers.values());
- _consumers.clear();
-
- for (C consumer : consumers)
- {
- consumer.failedOver();
- registerConsumer(consumer, true);
- }
- }
-
- private void resubscribeProducers() throws AMQException
- {
- ArrayList producers = new ArrayList(_producers.values());
- _logger.info(MessageFormat.format("Resubscribing producers = {0} producers.size={1}", producers, producers.size())); // FIXME: removeKey
- for (Iterator it = producers.iterator(); it.hasNext();)
- {
- P producer = (P) it.next();
- producer.resubscribe();
- }
- }
-
- /**
- * Suspends or unsuspends this session.
- *
- * @param suspend <tt>true</tt> indicates that the session should be suspended, <tt>false<tt> indicates that it
- * should be unsuspended.
- *
- * @throws AMQException If the session cannot be suspended for any reason.
- * @todo Be aware of possible changes to parameter order as versions change.
- */
- protected void suspendChannel(boolean suspend) throws AMQException // , FailoverException
- {
- synchronized (_suspensionLock)
- {
- try
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Setting channel flow : " + (suspend ? "suspended" : "unsuspended"));
- }
-
- _suspended = suspend;
- sendSuspendChannel(suspend);
- }
- catch (FailoverException e)
- {
- throw new AMQException(null, "Fail-over interrupted suspend/unsuspend channel.", e);
- }
- }
- }
-
- public abstract void sendSuspendChannel(boolean suspend) throws AMQException, FailoverException;
-
- Object getMessageDeliveryLock()
- {
- return _messageDeliveryLock;
- }
-
- /**
- * Indicates whether this session consumers pre-fetche messages
- *
- * @return true if this session consumers pre-fetche messages false otherwise
- */
- public boolean prefetch()
- {
- return getAMQConnection().getMaxPrefetch() > 0;
- }
-
- /** Signifies that the session has pending sends to commit. */
- public void markDirty()
- {
- _dirty = true;
- }
-
- /** Signifies that the session has no pending sends to commit. */
- public void markClean()
- {
- _dirty = false;
- _failedOverDirty = false;
- }
-
- /**
- * Check to see if failover has occured since the last call to markClean(commit or rollback).
- *
- * @return boolean true if failover has occured.
- */
- public boolean hasFailedOver()
- {
- return _failedOverDirty;
- }
-
- /**
- * Check to see if any message have been sent in this transaction and have not been commited.
- *
- * @return boolean true if a message has been sent but not commited
- */
- public boolean isDirty()
- {
- return _dirty;
- }
-
- public void setTicket(int ticket)
- {
- _ticket = ticket;
- }
-
- public void setFlowControl(final boolean active)
- {
- _flowControl.setFlowControl(active);
- }
-
- public void checkFlowControl() throws InterruptedException
- {
- synchronized (_flowControl)
- {
- while (!_flowControl.getFlowControl())
- {
- _flowControl.wait();
- }
- }
-
- }
-
- /** Used for debugging in the dispatcher. */
- private static final Logger _dispatcherLogger = LoggerFactory.getLogger("org.apache.qpid.client.AMQSession.Dispatcher");
-
- /** Responsible for decoding a message fragment and passing it to the appropriate message consumer. */
- class Dispatcher extends Thread
- {
-
- /** Track the 'stopped' state of the dispatcher, a session starts in the stopped state. */
- private final AtomicBoolean _closed = new AtomicBoolean(false);
-
- private final Object _lock = new Object();
- private String dispatcherID = "" + System.identityHashCode(this);
-
-
-
- public Dispatcher()
- {
- super("Dispatcher-Channel-" + _channelId);
- if (_dispatcherLogger.isInfoEnabled())
- {
- _dispatcherLogger.info(getName() + " created");
- }
- }
-
- public void close()
- {
- _closed.set(true);
- interrupt();
-
- // fixme awaitTermination
-
- }
-
- public void rejectPending(C consumer)
- {
- synchronized (_lock)
- {
- boolean stopped = _dispatcher.connectionStopped();
-
- if (!stopped)
- {
- _dispatcher.setConnectionStopped(true);
- }
-
- // Reject messages on pre-receive queue
- consumer.rollbackPendingMessages();
-
- // Reject messages on pre-dispatch queue
- rejectMessagesForConsumerTag(consumer.getConsumerTag(), true, false);
- //Let the dispatcher deal with this when it gets to them.
-
- // closeConsumer
- consumer.markClosed();
-
- _dispatcher.setConnectionStopped(stopped);
-
- }
- }
-
- public void rollback()
- {
-
- synchronized (_lock)
- {
- boolean isStopped = connectionStopped();
-
- if (!isStopped)
- {
- setConnectionStopped(true);
- }
-
- _rollbackMark.set(_highestDeliveryTag.get());
-
- _dispatcherLogger.debug("Session Pre Dispatch Queue cleared");
-
- for (C consumer : _consumers.values())
- {
- if (!consumer.isNoConsume())
- {
- consumer.rollback();
- }
- else
- {
- // should perhaps clear the _SQ here.
- // consumer._synchronousQueue.clear();
- consumer.clearReceiveQueue();
- }
-
- }
-
- for (int i = 0; i < _removedConsumers.size(); i++)
- {
- // Sends acknowledgement to server
- _removedConsumers.get(i).rollback();
- _removedConsumers.remove(i);
- }
-
- setConnectionStopped(isStopped);
- }
-
- }
-
- public void run()
- {
- if (_dispatcherLogger.isInfoEnabled())
- {
- _dispatcherLogger.info(getName() + " started");
- }
-
- UnprocessedMessage message;
-
- // Allow disptacher to start stopped
- synchronized (_lock)
- {
- while (!_closed.get() && connectionStopped())
- {
- try
- {
- _lock.wait();
- }
- catch (InterruptedException e)
- {
- // ignore
- }
- }
- }
-
- try
- {
- while (!_closed.get() && ((message = (UnprocessedMessage) _queue.take()) != null))
- {
- long deliveryTag = message.getDeliveryTag();
-
- synchronized (_lock)
- {
-
- while (connectionStopped())
- {
- _lock.wait();
- }
-
- if (!(message instanceof CloseConsumerMessage)
- && tagLE(deliveryTag, _rollbackMark.get()))
- {
- rejectMessage(message, true);
- }
- else
- {
- synchronized (_messageDeliveryLock)
- {
- dispatchMessage(message);
- }
- }
- }
-
- long current = _rollbackMark.get();
- if (updateRollbackMark(current, deliveryTag))
- {
- _rollbackMark.compareAndSet(current, deliveryTag);
- }
- }
- }
- catch (InterruptedException e)
- {
- // ignore
- }
-
- if (_dispatcherLogger.isInfoEnabled())
- {
- _dispatcherLogger.info(getName() + " thread terminating for channel " + _channelId);
- }
- }
-
- // only call while holding lock
- final boolean connectionStopped()
- {
- return _connectionStopped;
- }
-
- boolean setConnectionStopped(boolean connectionStopped)
- {
- boolean currently;
- synchronized (_lock)
- {
- currently = _connectionStopped;
- _connectionStopped = connectionStopped;
- _lock.notify();
-
- if (_dispatcherLogger.isDebugEnabled())
- {
- _dispatcherLogger.debug("Set Dispatcher Connection " + (connectionStopped ? "Stopped" : "Started")
- + ": Currently " + (currently ? "Stopped" : "Started"));
- }
- }
-
- return currently;
- }
-
- private void dispatchMessage(UnprocessedMessage message)
- {
- //This if block is not needed anymore as bounce messages are handled separately
- //if (message.getDeliverBody() != null)
- //{
- final C consumer =
- _consumers.get(message.getConsumerTag());
-
- if ((consumer == null) || consumer.isClosed())
- {
- if (_dispatcherLogger.isInfoEnabled())
- {
- if (consumer == null)
- {
- _dispatcherLogger.info("Dispatcher(" + dispatcherID + ")Received a message(" + System.identityHashCode(message) + ")" + "["
- + message.getDeliveryTag() + "] from queue "
- + message.getConsumerTag() + " )without a handler - rejecting(requeue)...");
- }
- else
- {
- if (consumer.isNoConsume())
- {
- _dispatcherLogger.info("Received a message(" + System.identityHashCode(message) + ")" + "["
- + message.getDeliveryTag() + "] from queue " + " consumer("
- + message.getConsumerTag() + ") is closed and a browser so dropping...");
- //DROP MESSAGE
- return;
-
- }
- else
- {
- _dispatcherLogger.info("Received a message(" + System.identityHashCode(message) + ")" + "["
- + message.getDeliveryTag() + "] from queue " + " consumer("
- + message.getConsumerTag() + ") is closed rejecting(requeue)...");
- }
- }
- }
- // Don't reject if we're already closing
- if (!_closed.get())
- {
- rejectMessage(message, true);
- }
- }
- else
- {
- consumer.notifyMessage(message);
- }
-
- }
- }
-
- protected abstract boolean tagLE(long tag1, long tag2);
-
- protected abstract boolean updateRollbackMark(long current, long deliveryTag);
-
- public abstract AMQMessageDelegateFactory getMessageDelegateFactory();
-
- /*public void requestAccess(AMQShortString realm, boolean exclusive, boolean passive, boolean active, boolean write,
- boolean read) throws AMQException
- {
- getProtocolHandler().writeCommandFrameAndWaitForReply(AccessRequestBody.createAMQFrame(getChannelId(),
- getProtocolMajorVersion(), getProtocolMinorVersion(), active, exclusive, passive, read, realm, write),
- new BlockingMethodFrameListener(_channelId)
- {
-
- public boolean processMethod(int channelId, AMQMethodBody frame) // throws AMQException
- {
- if (frame instanceof AccessRequestOkBody)
- {
- setTicket(((AccessRequestOkBody) frame).getTicket());
-
- return true;
- }
- else
- {
- return false;
- }
- }
- });
- }*/
-
- private class SuspenderRunner implements Runnable
- {
- private AtomicBoolean _suspend;
-
- public SuspenderRunner(AtomicBoolean suspend)
- {
- _suspend = suspend;
- }
-
- public void run()
- {
- try
- {
- synchronized (_suspensionLock)
- {
- suspendChannel(_suspend.get());
- }
- }
- catch (AMQException e)
- {
- _logger.warn("Unable to suspend channel");
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSessionAdapter.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSessionAdapter.java
deleted file mode 100644
index 7e257e0c20..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSessionAdapter.java
+++ /dev/null
@@ -1,26 +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.
- *
- */
-package org.apache.qpid.client;
-
-public interface AMQSessionAdapter
-{
- public AMQSession getSession();
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSessionDirtyException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSessionDirtyException.java
deleted file mode 100644
index a1b240ed54..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSessionDirtyException.java
+++ /dev/null
@@ -1,42 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQSessionDirtyException represents all failures to send data on a transacted session that is
- * no longer in a state that the client expects. i.e. failover has occured so previously sent messages
- * will not be part of the transaction.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent attempt to perform additional sends on a dirty session.
- * </table>
- */
-public class AMQSessionDirtyException extends AMQException
-{
- public AMQSessionDirtyException(String msg)
- {
- super(AMQConstant.RESOURCE_ERROR, msg, null);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
deleted file mode 100644
index ab983aa842..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
+++ /dev/null
@@ -1,850 +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.
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.failover.FailoverNoopSupport;
-import org.apache.qpid.client.failover.FailoverProtectedOperation;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.message.MessageFactoryRegistry;
-import org.apache.qpid.client.message.FiledTableSupport;
-import org.apache.qpid.client.message.AMQMessageDelegateFactory;
-import org.apache.qpid.client.message.UnprocessedMessage_0_10;
-import org.apache.qpid.util.Serial;
-import org.apache.qpid.transport.ExecutionException;
-import org.apache.qpid.transport.MessageAcceptMode;
-import org.apache.qpid.transport.MessageAcquireMode;
-import org.apache.qpid.transport.MessageCreditUnit;
-import org.apache.qpid.transport.MessageFlowMode;
-import org.apache.qpid.transport.MessageTransfer;
-import org.apache.qpid.transport.RangeSet;
-import org.apache.qpid.transport.Option;
-import org.apache.qpid.transport.ExchangeBoundResult;
-import org.apache.qpid.transport.Future;
-import org.apache.qpid.transport.Range;
-import org.apache.qpid.transport.Session;
-import org.apache.qpid.transport.SessionException;
-import org.apache.qpid.transport.SessionListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.apache.qpid.transport.Option.*;
-
-import javax.jms.*;
-import javax.jms.IllegalStateException;
-
-import java.util.HashMap;
-import java.util.UUID;
-import java.util.Map;
-
-/**
- * This is a 0.10 Session
- */
-public class AMQSession_0_10 extends AMQSession<BasicMessageConsumer_0_10, BasicMessageProducer_0_10>
- implements SessionListener
-{
-
- /**
- * This class logger
- */
- private static final Logger _logger = LoggerFactory.getLogger(AMQSession_0_10.class);
-
-
- /**
- * The underlying QpidSession
- */
- private Session _qpidSession;
-
- /**
- * The latest qpid Exception that has been reaised.
- */
- private Object _currentExceptionLock = new Object();
- private SessionException _currentException;
-
- // a ref on the qpid connection
- protected org.apache.qpid.transport.Connection _qpidConnection;
-
- private RangeSet unacked = new RangeSet();
- private int unackedCount = 0;
-
- /**
- * USed to store the range of in tx messages
- */
- private RangeSet _txRangeSet = new RangeSet();
- private int _txSize = 0;
- //--- constructors
-
- /**
- * Creates a new session on a connection.
- *
- * @param con The connection on which to create the session.
- * @param channelId The unique identifier for the session.
- * @param transacted Indicates whether or not the session is transactional.
- * @param acknowledgeMode The acknoledgement mode for the session.
- * @param messageFactoryRegistry The message factory factory for the session.
- * @param defaultPrefetchHighMark The maximum number of messages to prefetched before suspending the session.
- * @param defaultPrefetchLowMark The number of prefetched messages at which to resume the session.
- * @param qpidConnection The qpid connection
- */
- AMQSession_0_10(org.apache.qpid.transport.Connection qpidConnection, AMQConnection con, int channelId,
- boolean transacted, int acknowledgeMode, MessageFactoryRegistry messageFactoryRegistry,
- int defaultPrefetchHighMark, int defaultPrefetchLowMark)
- {
-
- super(con, channelId, transacted, acknowledgeMode, messageFactoryRegistry, defaultPrefetchHighMark,
- defaultPrefetchLowMark);
- _qpidConnection = qpidConnection;
- _qpidSession = _qpidConnection.createSession(1);
- _qpidSession.setSessionListener(this);
- if (_transacted)
- {
- _qpidSession.txSelect();
- }
- }
-
- /**
- * Creates a new session on a connection with the default 0-10 message factory.
- *
- * @param con The connection on which to create the session.
- * @param channelId The unique identifier for the session.
- * @param transacted Indicates whether or not the session is transactional.
- * @param acknowledgeMode The acknoledgement mode for the session.
- * @param defaultPrefetchHigh The maximum number of messages to prefetched before suspending the session.
- * @param defaultPrefetchLow The number of prefetched messages at which to resume the session.
- * @param qpidConnection The connection
- */
- AMQSession_0_10(org.apache.qpid.transport.Connection qpidConnection, AMQConnection con, int channelId,
- boolean transacted, int acknowledgeMode, int defaultPrefetchHigh, int defaultPrefetchLow)
- {
-
- this(qpidConnection, con, channelId, transacted, acknowledgeMode, MessageFactoryRegistry.newDefaultRegistry(),
- defaultPrefetchHigh, defaultPrefetchLow);
- }
-
- private void addUnacked(int id)
- {
- unacked.add(id);
- unackedCount++;
- }
-
- private void clearUnacked()
- {
- unacked.clear();
- unackedCount = 0;
- }
-
- //------- overwritten methods of class AMQSession
-
- /**
- * Acknowledge one or many messages.
- *
- * @param deliveryTag The tag of the last message to be acknowledged.
- * @param multiple <tt>true</tt> to acknowledge all messages up to and including the one specified by the
- * delivery tag, <tt>false</tt> to just acknowledge that message.
- */
-
- public void acknowledgeMessage(long deliveryTag, boolean multiple)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Sending ack for delivery tag " + deliveryTag + " on session " + _channelId);
- }
- // acknowledge this message
- if (multiple)
- {
- for (Long messageTag : _unacknowledgedMessageTags)
- {
- if( messageTag <= deliveryTag )
- {
- addUnacked(messageTag.intValue());
- _unacknowledgedMessageTags.remove(messageTag);
- }
- }
- //empty the list of unack messages
-
- }
- else
- {
- addUnacked((int) deliveryTag);
- _unacknowledgedMessageTags.remove(deliveryTag);
- }
-
- long prefetch = getAMQConnection().getMaxPrefetch();
-
- if (unackedCount >= prefetch/2)
- {
- flushAcknowledgments();
- }
- }
-
- void flushAcknowledgments()
- {
- if (unackedCount > 0)
- {
- messageAcknowledge
- (unacked, _acknowledgeMode != org.apache.qpid.jms.Session.NO_ACKNOWLEDGE);
- clearUnacked();
- }
- }
-
- void messageAcknowledge(RangeSet ranges, boolean accept)
- {
- Session ssn = getQpidSession();
- for (Range range : ranges)
- {
- ssn.processed(range);
- }
- ssn.flushProcessed(accept ? BATCH : NONE);
- if (accept)
- {
- ssn.messageAccept(ranges);
- }
- }
-
- /**
- * Bind a queue with an exchange.
- *
- * @param queueName Specifies the name of the queue to bind. If the queue name is empty,
- * refers to the current
- * queue for the session, which is the last declared queue.
- * @param exchangeName The exchange name.
- * @param routingKey Specifies the routing key for the binding.
- * @param arguments 0_8 specific
- */
- public void sendQueueBind(final AMQShortString queueName, final AMQShortString routingKey,
- final FieldTable arguments, final AMQShortString exchangeName, final AMQDestination destination)
- throws AMQException, FailoverException
- {
- Map args = FiledTableSupport.convertToMap(arguments);
- // this is there only becasue the broker may expect a value for x-match
- if( ! args.containsKey("x-match") )
- {
- args.put("x-match", "any");
- }
-
- for (AMQShortString rk: destination.getBindingKeys())
- {
- _logger.debug("Binding queue : " + queueName.toString() + " exchange: " + exchangeName.toString() + " using binding key " + rk.asString());
- getQpidSession().exchangeBind(queueName.toString(), exchangeName.toString(), rk.toString(), args);
- }
- // We need to sync so that we get notify of an error.
- getQpidSession().sync();
- getCurrentException();
- }
-
-
- /**
- * Close this session.
- *
- * @param timeout no used / 0_8 specific
- * @throws AMQException
- * @throws FailoverException
- */
- public void sendClose(long timeout) throws AMQException, FailoverException
- {
- flushAcknowledgments();
- getQpidSession().sync();
- getQpidSession().close();
- getCurrentException();
- }
-
-
- /**
- * Commit the receipt and the delivery of all messages exchanged by this session resources.
- */
- public void sendCommit() throws AMQException, FailoverException
- {
- getQpidSession().setAutoSync(true);
- try
- {
- getQpidSession().txCommit();
- }
- finally
- {
- getQpidSession().setAutoSync(false);
- }
- // We need to sync so that we get notify of an error.
- getCurrentException();
- }
-
- /**
- * Create a queue with a given name.
- *
- * @param name The queue name
- * @param autoDelete If this field is set and the exclusive field is also set,
- * then the queue is deleted when the connection closes.
- * @param durable If set when creating a new queue,
- * the queue will be marked as durable.
- * @param exclusive Exclusive queues can only be used from one connection at a time.
- * @param arguments Exclusive queues can only be used from one connection at a time.
- * @throws AMQException
- * @throws FailoverException
- */
- public void sendCreateQueue(AMQShortString name, final boolean autoDelete, final boolean durable,
- final boolean exclusive, Map<String, Object> arguments) throws AMQException, FailoverException
- {
- getQpidSession().queueDeclare(name.toString(), null, arguments, durable ? Option.DURABLE : Option.NONE,
- autoDelete ? Option.AUTO_DELETE : Option.NONE,
- exclusive ? Option.EXCLUSIVE : Option.NONE);
- // We need to sync so that we get notify of an error.
- getQpidSession().sync();
- getCurrentException();
- }
-
- /**
- * This method asks the broker to redeliver all unacknowledged messages
- *
- * @throws AMQException
- * @throws FailoverException
- */
- public void sendRecover() throws AMQException, FailoverException
- {
- // release all unack messages
- RangeSet ranges = new RangeSet();
- while (true)
- {
- Long tag = _unacknowledgedMessageTags.poll();
- if (tag == null)
- {
- break;
- }
- ranges.add((int) (long) tag);
- }
- getQpidSession().messageRelease(ranges, Option.SET_REDELIVERED);
- // We need to sync so that we get notify of an error.
- getQpidSession().sync();
- getCurrentException();
- }
-
- public void releaseForRollback()
- {
- if (_dispatcher != null)
- {
- _dispatcher.rollback();
- }
- getQpidSession().messageRelease(_txRangeSet, Option.SET_REDELIVERED);
- _txRangeSet.clear();
- _txSize = 0;
- }
-
- /**
- * Release (0_8 notion of Reject) an acquired message
- *
- * @param deliveryTag the message ID
- * @param requeue always true
- */
- public void rejectMessage(long deliveryTag, boolean requeue)
- {
- // The value of requeue is always true
- RangeSet ranges = new RangeSet();
- ranges.add((int) deliveryTag);
- getQpidSession().messageRelease(ranges, Option.SET_REDELIVERED);
- //I don't think we need to sync
- }
-
- /**
- * Create an 0_10 message consumer
- */
- public BasicMessageConsumer_0_10 createMessageConsumer(final AMQDestination destination, final int prefetchHigh,
- final int prefetchLow, final boolean noLocal,
- final boolean exclusive, String messageSelector,
- final FieldTable ft, final boolean noConsume,
- final boolean autoClose) throws JMSException
- {
-
- final AMQProtocolHandler protocolHandler = getProtocolHandler();
- return new BasicMessageConsumer_0_10(_channelId, _connection, destination, messageSelector, noLocal,
- _messageFactoryRegistry, this, protocolHandler, ft, prefetchHigh,
- prefetchLow, exclusive, _acknowledgeMode, noConsume, autoClose);
- }
-
- /**
- * Bind a queue with an exchange.
- */
-
- public boolean isQueueBound(final AMQShortString exchangeName, final AMQShortString queueName, final AMQShortString routingKey)
- throws JMSException
- {
- return isQueueBound(exchangeName,queueName,routingKey,null);
- }
-
- public boolean isQueueBound(final AMQDestination destination) throws JMSException
- {
- return isQueueBound(destination.getExchangeName(),destination.getAMQQueueName(),destination.getRoutingKey(),destination.getBindingKeys());
- }
-
- public boolean isQueueBound(final AMQShortString exchangeName, final AMQShortString queueName, final AMQShortString routingKey,AMQShortString[] bindingKeys)
- throws JMSException
- {
- String rk = "";
- boolean res;
- if (bindingKeys != null && bindingKeys.length>0)
- {
- rk = bindingKeys[0].toString();
- }
- else if (routingKey != null)
- {
- rk = routingKey.toString();
- }
-
- ExchangeBoundResult bindingQueryResult =
- getQpidSession().exchangeBound(exchangeName.toString(),queueName.toString(), rk, null).get();
-
- if (rk == null)
- {
- res = !(bindingQueryResult.getExchangeNotFound() || bindingQueryResult.getQueueNotFound());
- }
- else
- {
- res = !(bindingQueryResult.getKeyNotMatched() || bindingQueryResult.getQueueNotFound() || bindingQueryResult
- .getQueueNotMatched());
- }
- return res;
- }
-
- /**
- * This method is invoked when a consumer is creted
- * Registers the consumer with the broker
- */
- public void sendConsume(BasicMessageConsumer_0_10 consumer, AMQShortString queueName, AMQProtocolHandler protocolHandler,
- boolean nowait, String messageSelector, int tag)
- throws AMQException, FailoverException
- {
- boolean preAcquire;
- try
- {
- preAcquire = ( ! consumer.isNoConsume() &&
- (consumer.getMessageSelector() == null || consumer.getMessageSelector().equals("")) )
- || !(consumer.getDestination() instanceof AMQQueue);
- getQpidSession().messageSubscribe
- (queueName.toString(), String.valueOf(tag),
- getAcknowledgeMode() == NO_ACKNOWLEDGE ? MessageAcceptMode.NONE : MessageAcceptMode.EXPLICIT,
- preAcquire ? MessageAcquireMode.PRE_ACQUIRED : MessageAcquireMode.NOT_ACQUIRED, null, 0, null,
- consumer.isExclusive() ? Option.EXCLUSIVE : Option.NONE);
- }
- catch (JMSException e)
- {
- throw new AMQException(AMQConstant.INTERNAL_ERROR, "problem when registering consumer", e);
- }
-
- String consumerTag = ((BasicMessageConsumer_0_10)consumer).getConsumerTagString();
-
- if (! prefetch())
- {
- getQpidSession().messageSetFlowMode(consumerTag, MessageFlowMode.CREDIT);
- }
- else
- {
- getQpidSession().messageSetFlowMode(consumerTag, MessageFlowMode.WINDOW);
- }
- getQpidSession().messageFlow(consumerTag, MessageCreditUnit.BYTE, 0xFFFFFFFF);
- // We need to sync so that we get notify of an error.
- // only if not immediat prefetch
- if(prefetch() && (consumer.isStrated() || _immediatePrefetch))
- {
- // set the flow
- getQpidSession().messageFlow(consumerTag,
- MessageCreditUnit.MESSAGE,
- getAMQConnection().getMaxPrefetch());
- }
- getQpidSession().sync();
- getCurrentException();
- }
-
- /**
- * Create an 0_10 message producer
- */
- public BasicMessageProducer_0_10 createMessageProducer(final Destination destination, final boolean mandatory,
- final boolean immediate, final boolean waitUntilSent,
- long producerId)
- {
- return new BasicMessageProducer_0_10(_connection, (AMQDestination) destination, _transacted, _channelId, this,
- getProtocolHandler(), producerId, immediate, mandatory, waitUntilSent);
-
- }
-
- /**
- * creates an exchange if it does not already exist
- */
- public void sendExchangeDeclare(final AMQShortString name, final AMQShortString type,
- final AMQProtocolHandler protocolHandler, final boolean nowait)
- throws AMQException, FailoverException
- {
- getQpidSession().exchangeDeclare(name.toString(), type.toString(), null, null);
- // autoDelete --> false
- // durable --> false
- // passive -- false
- // We need to sync so that we get notify of an error.
- getQpidSession().sync();
- getCurrentException();
- }
-
- /**
- * Declare a queue with the given queueName
- */
- public void sendQueueDeclare(final AMQDestination amqd, final AMQProtocolHandler protocolHandler)
- throws AMQException, FailoverException
- {
- // do nothing this is only used by 0_8
- }
-
- /**
- * Declare a queue with the given queueName
- */
- public AMQShortString send0_10QueueDeclare(final AMQDestination amqd, final AMQProtocolHandler protocolHandler,
- final boolean noLocal)
- throws AMQException, FailoverException
- {
- AMQShortString res;
- if (amqd.getAMQQueueName() == null)
- {
- // generate a name for this queue
- res = new AMQShortString("TempQueue" + UUID.randomUUID());
- }
- else
- {
- res = amqd.getAMQQueueName();
- }
- Map<String,Object> arguments = null;
- if (noLocal)
- {
- arguments = new HashMap<String,Object>();
- arguments.put("no-local", true);
- }
- getQpidSession().queueDeclare(res.toString(), null, arguments,
- amqd.isAutoDelete() ? Option.AUTO_DELETE : Option.NONE,
- amqd.isDurable() ? Option.DURABLE : Option.NONE,
- !amqd.isDurable() && amqd.isExclusive() ? Option.EXCLUSIVE : Option.NONE);
- // passive --> false
- // We need to sync so that we get notify of an error.
- getQpidSession().sync();
- getCurrentException();
- return res;
- }
-
- /**
- * deletes a queue
- */
- public void sendQueueDelete(final AMQShortString queueName) throws AMQException, FailoverException
- {
- getQpidSession().queueDelete(queueName.toString());
- // ifEmpty --> false
- // ifUnused --> false
- // We need to sync so that we get notify of an error.
- getQpidSession().sync();
- getCurrentException();
- }
-
- /**
- * Activate/deactivate the message flow for all the consumers of this session.
- */
- public void sendSuspendChannel(boolean suspend) throws AMQException, FailoverException
- {
- if (suspend)
- {
- for (BasicMessageConsumer consumer : _consumers.values())
- {
- getQpidSession().messageStop(String.valueOf(consumer.getConsumerTag()));
- }
- }
- else
- {
- for (BasicMessageConsumer_0_10 consumer : _consumers.values())
- {
- String consumerTag = String.valueOf(consumer.getConsumerTag());
- //only set if msg list is null
- try
- {
- if (! prefetch())
- {
- if (consumer.getMessageListener() != null)
- {
- getQpidSession().messageFlow(consumerTag,
- MessageCreditUnit.MESSAGE, 1);
- }
- }
- else
- {
- getQpidSession()
- .messageFlow(consumerTag, MessageCreditUnit.MESSAGE,
- getAMQConnection().getMaxPrefetch());
- }
- getQpidSession()
- .messageFlow(consumerTag, MessageCreditUnit.BYTE, 0xFFFFFFFF);
- }
- catch (Exception e)
- {
- throw new AMQException(AMQConstant.INTERNAL_ERROR, "Error while trying to get the listener", e);
- }
- }
- }
- // We need to sync so that we get notify of an error.
- getQpidSession().sync();
- getCurrentException();
- }
-
-
- public void sendRollback() throws AMQException, FailoverException
- {
- getQpidSession().txRollback();
- // We need to sync so that we get notify of an error.
- getQpidSession().sync();
- getCurrentException();
- }
-
- //------ Private methods
- /**
- * Access to the underlying Qpid Session
- *
- * @return The associated Qpid Session.
- */
- protected Session getQpidSession()
- {
- return _qpidSession;
- }
-
-
- /**
- * Get the latest thrown exception.
- *
- * @throws org.apache.qpid.AMQException get the latest thrown error.
- */
- public void getCurrentException() throws AMQException
- {
- synchronized (_currentExceptionLock)
- {
- if (_currentException != null)
- {
- SessionException se = _currentException;
- _currentException = null;
- ExecutionException ee = se.getException();
- int code;
- if (ee == null)
- {
- code = 0;
- }
- else
- {
- code = ee.getErrorCode().getValue();
- }
- throw new AMQException
- (AMQConstant.getConstant(code), se.getMessage(), se);
- }
- }
- }
-
- public void opened(Session ssn) {}
-
- public void message(Session ssn, MessageTransfer xfr)
- {
- messageReceived(new UnprocessedMessage_0_10(xfr));
- }
-
- public void exception(Session ssn, SessionException exc)
- {
- synchronized (_currentExceptionLock)
- {
- _currentException = exc;
- }
- }
-
- public void closed(Session ssn) {}
-
- protected AMQShortString declareQueue(final AMQDestination amqd, final AMQProtocolHandler protocolHandler,
- final boolean noLocal)
- throws AMQException
- {
- /*return new FailoverRetrySupport<AMQShortString, AMQException>(*/
- return new FailoverNoopSupport<AMQShortString, AMQException>(
- new FailoverProtectedOperation<AMQShortString, AMQException>()
- {
- public AMQShortString execute() throws AMQException, FailoverException
- {
- // Generate the queue name if the destination indicates that a client generated name is to be used.
- if (amqd.isNameRequired())
- {
- String binddingKey = "";
- for(AMQShortString key : amqd.getBindingKeys())
- {
- binddingKey = binddingKey + "_" + key.toString();
- }
- amqd.setQueueName(new AMQShortString( binddingKey + "@"
- + amqd.getExchangeName().toString() + "_" + UUID.randomUUID()));
- }
- return send0_10QueueDeclare(amqd, protocolHandler, noLocal);
- }
- }, _connection).execute();
- }
-
-
- void start() throws AMQException
- {
- super.start();
- for(BasicMessageConsumer c: _consumers.values())
- {
- c.start();
- }
- }
-
-
- void stop() throws AMQException
- {
- super.stop();
- for(BasicMessageConsumer c: _consumers.values())
- {
- c.stop();
- }
- }
-
-
-
-
- public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
- {
-
- checkNotClosed();
- AMQTopic origTopic=checkValidTopic(topic);
- AMQTopic dest=AMQTopic.createDurable010Topic(origTopic, name, _connection);
-
- TopicSubscriberAdaptor<BasicMessageConsumer_0_10> subscriber=_subscriptions.get(name);
- if (subscriber != null)
- {
- if (subscriber.getTopic().equals(topic))
- {
- throw new IllegalStateException("Already subscribed to topic " + topic + " with subscription exchange "
- + name);
- }
- else
- {
- unsubscribe(name);
- }
- }
- else
- {
- AMQShortString topicName;
- if (topic instanceof AMQTopic)
- {
- topicName=((AMQTopic) topic).getBindingKeys()[0];
- }
- else
- {
- topicName=new AMQShortString(topic.getTopicName());
- }
-
- if (_strictAMQP)
- {
- if (_strictAMQPFATAL)
- {
- throw new UnsupportedOperationException("JMS Durable not currently supported by AMQP.");
- }
- else
- {
- _logger.warn("Unable to determine if subscription already exists for '" + topicName + "' "
- + "for creation durableSubscriber. Requesting queue deletion regardless.");
- }
-
- deleteQueue(dest.getAMQQueueName());
- }
- else
- {
- // if the queue is bound to the exchange but NOT for this topic, then the JMS spec
- // says we must trash the subscription.
- if (isQueueBound(dest.getExchangeName(), dest.getAMQQueueName())
- && !isQueueBound(dest.getExchangeName(), dest.getAMQQueueName(), topicName))
- {
- deleteQueue(dest.getAMQQueueName());
- }
- }
- }
-
- subscriber=new TopicSubscriberAdaptor(dest, createExclusiveConsumer(dest));
-
- _subscriptions.put(name, subscriber);
- _reverseSubscriptionMap.put(subscriber.getMessageConsumer(), name);
-
- return subscriber;
- }
-
- protected Long requestQueueDepth(AMQDestination amqd)
- {
- return getQpidSession().queueQuery(amqd.getQueueName()).get().getMessageCount();
- }
-
-
- /**
- * Store non committed messages for this session
- * With 0.10 messages are consumed with window mode, we must send a completion
- * before the window size is reached so credits don't dry up.
- * @param id
- */
- @Override protected void addDeliveredMessage(long id)
- {
- _txRangeSet.add((int) id);
- _txSize++;
- // this is a heuristic, we may want to have that configurable
- if (_connection.getMaxPrefetch() == 1 ||
- _connection.getMaxPrefetch() != 0 && _txSize % (_connection.getMaxPrefetch() / 2) == 0)
- {
- // send completed so consumer credits don't dry up
- messageAcknowledge(_txRangeSet, false);
- }
- }
-
- @Override public void commit() throws JMSException
- {
- checkTransacted();
- try
- {
- if( _txSize > 0 )
- {
- messageAcknowledge(_txRangeSet, true);
- _txRangeSet.clear();
- _txSize = 0;
- }
- sendCommit();
- }
- catch (AMQException e)
- {
- throw new JMSAMQException("Failed to commit: " + e.getMessage(), e);
- }
- catch (FailoverException e)
- {
- throw new JMSAMQException("Fail-over interrupted commit. Status of the commit is uncertain.", e);
- }
- }
-
- protected final boolean tagLE(long tag1, long tag2)
- {
- return Serial.le((int) tag1, (int) tag2);
- }
-
- protected final boolean updateRollbackMark(long currentMark, long deliveryTag)
- {
- return Serial.lt((int) currentMark, (int) deliveryTag);
- }
-
- public AMQMessageDelegateFactory getMessageDelegateFactory()
- {
- return AMQMessageDelegateFactory.FACTORY_0_10;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java
deleted file mode 100644
index e5fc36c389..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_8.java
+++ /dev/null
@@ -1,565 +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.
- *
- */
-package org.apache.qpid.client;
-
-
-import javax.jms.*;
-import javax.jms.IllegalStateException;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQUndeliveredException;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.failover.FailoverProtectedOperation;
-import org.apache.qpid.client.failover.FailoverRetrySupport;
-import org.apache.qpid.client.message.*;
-import org.apache.qpid.client.message.AMQMessageDelegateFactory;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.state.listener.SpecificMethodFrameListener;
-import org.apache.qpid.common.AMQPFilterTypes;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.framing.amqp_0_9.MethodRegistry_0_9;
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Map;
-
-public final class AMQSession_0_8 extends AMQSession<BasicMessageConsumer_0_8, BasicMessageProducer_0_8>
-{
-
- /** Used for debugging. */
- private static final Logger _logger = LoggerFactory.getLogger(AMQSession.class);
-
- /**
- * Creates a new session on a connection.
- *
- * @param con The connection on which to create the session.
- * @param channelId The unique identifier for the session.
- * @param transacted Indicates whether or not the session is transactional.
- * @param acknowledgeMode The acknoledgement mode for the session.
- * @param messageFactoryRegistry The message factory factory for the session.
- * @param defaultPrefetchHighMark The maximum number of messages to prefetched before suspending the session.
- * @param defaultPrefetchLowMark The number of prefetched messages at which to resume the session.
- */
- AMQSession_0_8(AMQConnection con, int channelId, boolean transacted, int acknowledgeMode,
- MessageFactoryRegistry messageFactoryRegistry, int defaultPrefetchHighMark, int defaultPrefetchLowMark)
- {
-
- super(con,channelId,transacted,acknowledgeMode,messageFactoryRegistry,defaultPrefetchHighMark,defaultPrefetchLowMark);
- }
-
- /**
- * Creates a new session on a connection with the default message factory factory.
- *
- * @param con The connection on which to create the session.
- * @param channelId The unique identifier for the session.
- * @param transacted Indicates whether or not the session is transactional.
- * @param acknowledgeMode The acknoledgement mode for the session.
- * @param defaultPrefetchHigh The maximum number of messages to prefetched before suspending the session.
- * @param defaultPrefetchLow The number of prefetched messages at which to resume the session.
- */
- AMQSession_0_8(AMQConnection con, int channelId, boolean transacted, int acknowledgeMode, int defaultPrefetchHigh,
- int defaultPrefetchLow)
- {
- this(con, channelId, transacted, acknowledgeMode, MessageFactoryRegistry.newDefaultRegistry(), defaultPrefetchHigh,
- defaultPrefetchLow);
- }
-
- private ProtocolVersion getProtocolVersion()
- {
- return getProtocolHandler().getProtocolVersion();
- }
-
- public void acknowledgeMessage(long deliveryTag, boolean multiple)
- {
- BasicAckBody body = getMethodRegistry().createBasicAckBody(deliveryTag, multiple);
-
- final AMQFrame ackFrame = body.generateFrame(_channelId);
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Sending ack for delivery tag " + deliveryTag + " on channel " + _channelId);
- }
-
- getProtocolHandler().writeFrame(ackFrame);
- _unacknowledgedMessageTags.remove(deliveryTag);
- }
-
- public void sendQueueBind(final AMQShortString queueName, final AMQShortString routingKey, final FieldTable arguments,
- final AMQShortString exchangeName, final AMQDestination dest) throws AMQException, FailoverException
- {
- getProtocolHandler().syncWrite(getProtocolHandler().getMethodRegistry().createQueueBindBody
- (getTicket(),queueName,exchangeName,routingKey,false,arguments).
- generateFrame(_channelId), QueueBindOkBody.class);
- }
-
- public void sendClose(long timeout) throws AMQException, FailoverException
- {
- getProtocolHandler().closeSession(this);
- getProtocolHandler().syncWrite(getProtocolHandler().getMethodRegistry().createChannelCloseBody(AMQConstant.REPLY_SUCCESS.getCode(),
- new AMQShortString("JMS client closing channel"), 0, 0).generateFrame(_channelId),
- ChannelCloseOkBody.class, timeout);
- // When control resumes at this point, a reply will have been received that
- // indicates the broker has closed the channel successfully.
- }
-
- public void sendCommit() throws AMQException, FailoverException
- {
- final AMQProtocolHandler handler = getProtocolHandler();
-
- handler.syncWrite(getProtocolHandler().getMethodRegistry().createTxCommitBody().generateFrame(_channelId), TxCommitOkBody.class);
- }
-
- public void sendCreateQueue(AMQShortString name, final boolean autoDelete, final boolean durable, final boolean exclusive, final Map<String, Object> arguments) throws AMQException,
- FailoverException
- {
- FieldTable table = null;
- if(arguments != null && !arguments.isEmpty())
- {
- table = new FieldTable();
- for(Map.Entry<String, Object> entry : arguments.entrySet())
- {
- table.setObject(entry.getKey(), entry.getValue());
- }
- }
- QueueDeclareBody body = getMethodRegistry().createQueueDeclareBody(getTicket(),name,false,durable,exclusive,autoDelete,false,table);
- AMQFrame queueDeclare = body.generateFrame(_channelId);
- getProtocolHandler().syncWrite(queueDeclare, QueueDeclareOkBody.class);
- }
-
- public void sendRecover() throws AMQException, FailoverException
- {
- _unacknowledgedMessageTags.clear();
-
- if (isStrictAMQP())
- {
- // We can't use the BasicRecoverBody-OK method as it isn't part of the spec.
-
- BasicRecoverBody body = getMethodRegistry().createBasicRecoverBody(false);
- _connection.getProtocolHandler().writeFrame(body.generateFrame(_channelId));
- _logger.warn("Session Recover cannot be guaranteed with STRICT_AMQP. Messages may arrive out of order.");
- }
- else
- {
- // in Qpid the 0-8 spec was hacked to have a recover-ok method... this is bad
- // in 0-9 we used the cleaner addition of a new sync recover method with its own ok
- if(getProtocolHandler().getProtocolVersion().equals(ProtocolVersion.v8_0))
- {
- BasicRecoverBody body = getMethodRegistry().createBasicRecoverBody(false);
- _connection.getProtocolHandler().syncWrite(body.generateFrame(_channelId), BasicRecoverOkBody.class);
- }
- else if(getProtocolVersion().equals(ProtocolVersion.v0_9))
- {
- BasicRecoverSyncBody body = ((MethodRegistry_0_9)getMethodRegistry()).createBasicRecoverSyncBody(false);
- _connection.getProtocolHandler().syncWrite(body.generateFrame(_channelId), BasicRecoverSyncOkBody.class);
- }
- else
- {
- throw new RuntimeException("Unsupported version of the AMQP Protocol: " + getProtocolVersion());
- }
- }
- }
-
- public void releaseForRollback()
- {
- while (true)
- {
- Long tag = _deliveredMessageTags.poll();
- if (tag == null)
- {
- break;
- }
-
- rejectMessage(tag, true);
- }
-
- if (_dispatcher != null)
- {
- _dispatcher.rollback();
- }
- }
-
- public void rejectMessage(long deliveryTag, boolean requeue)
- {
- if ((_acknowledgeMode == CLIENT_ACKNOWLEDGE) || (_acknowledgeMode == SESSION_TRANSACTED))
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Rejecting delivery tag:" + deliveryTag + ":SessionHC:" + this.hashCode());
- }
-
- BasicRejectBody body = getMethodRegistry().createBasicRejectBody(deliveryTag, requeue);
- AMQFrame frame = body.generateFrame(_channelId);
-
- _connection.getProtocolHandler().writeFrame(frame);
- }
- }
-
- public boolean isQueueBound(final AMQDestination destination) throws JMSException
- {
- return isQueueBound(destination.getExchangeName(),destination.getAMQQueueName(),destination.getAMQQueueName());
- }
-
-
- public boolean isQueueBound(final AMQShortString exchangeName, final AMQShortString queueName, final AMQShortString routingKey)
- throws JMSException
- {
- try
- {
- AMQMethodEvent response = new FailoverRetrySupport<AMQMethodEvent, AMQException>(
- new FailoverProtectedOperation<AMQMethodEvent, AMQException>()
- {
- public AMQMethodEvent execute() throws AMQException, FailoverException
- {
- AMQFrame boundFrame = getProtocolHandler().getMethodRegistry().createExchangeBoundBody
- (exchangeName, routingKey, queueName).generateFrame(_channelId);
-
- return getProtocolHandler().syncWrite(boundFrame, ExchangeBoundOkBody.class);
-
- }
- }, _connection).execute();
-
- // Extract and return the response code from the query.
- ExchangeBoundOkBody responseBody = (ExchangeBoundOkBody) response.getMethod();
-
- return (responseBody.getReplyCode() == 0);
- }
- catch (AMQException e)
- {
- throw new JMSAMQException("Queue bound query failed: " + e.getMessage(), e);
- }
- }
-
- @Override public void sendConsume(BasicMessageConsumer_0_8 consumer,
- AMQShortString queueName,
- AMQProtocolHandler protocolHandler,
- boolean nowait,
- String messageSelector,
- int tag) throws AMQException, FailoverException
- {
- FieldTable arguments = FieldTableFactory.newFieldTable();
- if ((messageSelector != null) && !messageSelector.equals(""))
- {
- arguments.put(AMQPFilterTypes.JMS_SELECTOR.getValue(), messageSelector);
- }
-
- if (consumer.isAutoClose())
- {
- arguments.put(AMQPFilterTypes.AUTO_CLOSE.getValue(), Boolean.TRUE);
- }
-
- if (consumer.isNoConsume())
- {
- arguments.put(AMQPFilterTypes.NO_CONSUME.getValue(), Boolean.TRUE);
- }
-
- BasicConsumeBody body = getMethodRegistry().createBasicConsumeBody(getTicket(),
- queueName,
- new AMQShortString(String.valueOf(tag)),
- consumer.isNoLocal(),
- consumer.getAcknowledgeMode() == Session.NO_ACKNOWLEDGE,
- consumer.isExclusive(),
- nowait,
- arguments);
-
-
- AMQFrame jmsConsume = body.generateFrame(_channelId);
-
- if (nowait)
- {
- protocolHandler.writeFrame(jmsConsume);
- }
- else
- {
- protocolHandler.syncWrite(jmsConsume, BasicConsumeOkBody.class);
- }
- }
-
- public void sendExchangeDeclare(final AMQShortString name, final AMQShortString type, final AMQProtocolHandler protocolHandler,
- final boolean nowait) throws AMQException, FailoverException
- {
- ExchangeDeclareBody body = getMethodRegistry().createExchangeDeclareBody(getTicket(),name,type,false,false,false,false,nowait,null);
- AMQFrame exchangeDeclare = body.generateFrame(_channelId);
-
- protocolHandler.syncWrite(exchangeDeclare, ExchangeDeclareOkBody.class);
- }
-
- public void sendQueueDeclare(final AMQDestination amqd, final AMQProtocolHandler protocolHandler) throws AMQException, FailoverException
- {
- QueueDeclareBody body = getMethodRegistry().createQueueDeclareBody(getTicket(),amqd.getAMQQueueName(),false,amqd.isDurable(),amqd.isExclusive(),amqd.isAutoDelete(),false,null);
-
- AMQFrame queueDeclare = body.generateFrame(_channelId);
-
- protocolHandler.syncWrite(queueDeclare, QueueDeclareOkBody.class);
- }
-
- public void sendQueueDelete(final AMQShortString queueName) throws AMQException, FailoverException
- {
- QueueDeleteBody body = getMethodRegistry().createQueueDeleteBody(getTicket(),
- queueName,
- false,
- false,
- true);
- AMQFrame queueDeleteFrame = body.generateFrame(_channelId);
-
- getProtocolHandler().syncWrite(queueDeleteFrame, QueueDeleteOkBody.class);
- }
-
- public void sendSuspendChannel(boolean suspend) throws AMQException, FailoverException
- {
- ChannelFlowBody body = getMethodRegistry().createChannelFlowBody(!suspend);
- AMQFrame channelFlowFrame = body.generateFrame(_channelId);
- _connection.getProtocolHandler().syncWrite(channelFlowFrame, ChannelFlowOkBody.class);
- }
-
- public BasicMessageConsumer_0_8 createMessageConsumer(final AMQDestination destination, final int prefetchHigh,
- final int prefetchLow, final boolean noLocal, final boolean exclusive, String messageSelector, final FieldTable arguments,
- final boolean noConsume, final boolean autoClose) throws JMSException
- {
-
- final AMQProtocolHandler protocolHandler = getProtocolHandler();
- return new BasicMessageConsumer_0_8(_channelId, _connection, destination, messageSelector, noLocal,
- _messageFactoryRegistry,this, protocolHandler, arguments, prefetchHigh, prefetchLow,
- exclusive, _acknowledgeMode, noConsume, autoClose);
- }
-
-
- public BasicMessageProducer_0_8 createMessageProducer(final Destination destination, final boolean mandatory,
- final boolean immediate, final boolean waitUntilSent, long producerId)
- {
-
- return new BasicMessageProducer_0_8(_connection, (AMQDestination) destination, _transacted, _channelId,
- this, getProtocolHandler(), producerId, immediate, mandatory, waitUntilSent);
- }
-
-
- @Override public void messageReceived(UnprocessedMessage message)
- {
-
- if (message instanceof ReturnMessage)
- {
- // Return of the bounced message.
- returnBouncedMessage((ReturnMessage) message);
- }
- else
- {
- super.messageReceived(message);
- }
- }
-
- private void returnBouncedMessage(final ReturnMessage msg)
- {
- _connection.performConnectionTask(new Runnable()
- {
- public void run()
- {
- try
- {
- // Bounced message is processed here, away from the mina thread
- AbstractJMSMessage bouncedMessage =
- _messageFactoryRegistry.createMessage(0, false, msg.getExchange(),
- msg.getRoutingKey(), msg.getContentHeader(), msg.getBodies());
- AMQConstant errorCode = AMQConstant.getConstant(msg.getReplyCode());
- AMQShortString reason = msg.getReplyText();
- _logger.debug("Message returned with error code " + errorCode + " (" + reason + ")");
-
- // @TODO should this be moved to an exception handler of sorts. Somewhere errors are converted to correct execeptions.
- if (errorCode == AMQConstant.NO_CONSUMERS)
- {
- _connection.exceptionReceived(new AMQNoConsumersException("Error: " + reason, bouncedMessage, null));
- }
- else if (errorCode == AMQConstant.NO_ROUTE)
- {
- _connection.exceptionReceived(new AMQNoRouteException("Error: " + reason, bouncedMessage, null));
- }
- else
- {
- _connection.exceptionReceived(
- new AMQUndeliveredException(errorCode, "Error: " + reason, bouncedMessage, null));
- }
-
- }
- catch (Exception e)
- {
- _logger.error(
- "Caught exception trying to raise undelivered message exception (dump follows) - ignoring...",
- e);
- }
- }
- });
- }
-
-
-
-
- public void sendRollback() throws AMQException, FailoverException
- {
- TxRollbackBody body = getMethodRegistry().createTxRollbackBody();
- AMQFrame frame = body.generateFrame(getChannelId());
- getProtocolHandler().syncWrite(frame, TxRollbackOkBody.class);
- }
-
- public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
- {
-
- checkNotClosed();
- AMQTopic origTopic = checkValidTopic(topic);
- AMQTopic dest = AMQTopic.createDurableTopic(origTopic, name, _connection);
- TopicSubscriberAdaptor<BasicMessageConsumer_0_8> subscriber = _subscriptions.get(name);
- if (subscriber != null)
- {
- if (subscriber.getTopic().equals(topic))
- {
- throw new IllegalStateException("Already subscribed to topic " + topic + " with subscription exchange "
- + name);
- }
- else
- {
- unsubscribe(name);
- }
- }
- else
- {
- AMQShortString topicName;
- if (topic instanceof AMQTopic)
- {
- topicName = ((AMQTopic) topic).getRoutingKey();
- }
- else
- {
- topicName = new AMQShortString(topic.getTopicName());
- }
-
- if (_strictAMQP)
- {
- if (_strictAMQPFATAL)
- {
- throw new UnsupportedOperationException("JMS Durable not currently supported by AMQP.");
- }
- else
- {
- _logger.warn("Unable to determine if subscription already exists for '" + topicName + "' "
- + "for creation durableSubscriber. Requesting queue deletion regardless.");
- }
-
- deleteQueue(dest.getAMQQueueName());
- }
- else
- {
- // if the queue is bound to the exchange but NOT for this topic, then the JMS spec
- // says we must trash the subscription.
- if (isQueueBound(dest.getExchangeName(), dest.getAMQQueueName())
- && !isQueueBound(dest.getExchangeName(), dest.getAMQQueueName(), topicName))
- {
- deleteQueue(dest.getAMQQueueName());
- }
- }
- }
-
- subscriber = new TopicSubscriberAdaptor(dest, (BasicMessageConsumer) createConsumer(dest));
-
- _subscriptions.put(name, subscriber);
- _reverseSubscriptionMap.put(subscriber.getMessageConsumer(), name);
-
- return subscriber;
- }
-
-
-
-
- public void setPrefetchLimits(final int messagePrefetch, final long sizePrefetch) throws AMQException
- {
- new FailoverRetrySupport<Object, AMQException>(
- new FailoverProtectedOperation<Object, AMQException>()
- {
- public Object execute() throws AMQException, FailoverException
- {
-
- BasicQosBody basicQosBody = getProtocolHandler().getMethodRegistry().createBasicQosBody(sizePrefetch, messagePrefetch, false);
-
- // todo send low water mark when protocol allows.
- // todo Be aware of possible changes to parameter order as versions change.
- getProtocolHandler().syncWrite(basicQosBody.generateFrame(getChannelId()), BasicQosOkBody.class);
-
- return null;
- }
- }, _connection).execute();
- }
-
- class QueueDeclareOkHandler extends SpecificMethodFrameListener
- {
-
- private long _messageCount;
- private long _consumerCount;
-
- public QueueDeclareOkHandler()
- {
- super(getChannelId(), QueueDeclareOkBody.class);
- }
-
- public boolean processMethod(int channelId, AMQMethodBody frame) //throws AMQException
- {
- boolean matches = super.processMethod(channelId, frame);
- if (matches)
- {
- QueueDeclareOkBody declareOk = (QueueDeclareOkBody) frame;
- _messageCount = declareOk.getMessageCount();
- _consumerCount = declareOk.getConsumerCount();
- }
- return matches;
- }
-
- }
-
- protected Long requestQueueDepth(AMQDestination amqd) throws AMQException, FailoverException
- {
- AMQFrame queueDeclare =
- getMethodRegistry().createQueueDeclareBody(getTicket(),
- amqd.getAMQQueueName(),
- true,
- amqd.isDurable(),
- amqd.isExclusive(),
- amqd.isAutoDelete(),
- false,
- null).generateFrame(_channelId);
- QueueDeclareOkHandler okHandler = new QueueDeclareOkHandler();
- getProtocolHandler().writeCommandFrameAndWaitForReply(queueDeclare, okHandler);
- return okHandler._messageCount;
- }
-
- protected final boolean tagLE(long tag1, long tag2)
- {
- return tag1 <= tag2;
- }
-
- protected final boolean updateRollbackMark(long currentMark, long deliveryTag)
- {
- return false;
- }
-
- public AMQMessageDelegateFactory getMessageDelegateFactory()
- {
- return AMQMessageDelegateFactory.FACTORY_0_8;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java
deleted file mode 100644
index f54cb782c8..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java
+++ /dev/null
@@ -1,69 +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.
- *
- */
-package org.apache.qpid.client;
-
-import javax.jms.JMSException;
-import javax.jms.TemporaryQueue;
-
-import org.apache.qpid.framing.AMQShortString;
-
-import java.util.Random;
-import java.util.UUID;
-
-/** AMQ implementation of a TemporaryQueue. */
-final class AMQTemporaryQueue extends AMQQueue implements TemporaryQueue, TemporaryDestination
-{
-
-
- private final AMQSession _session;
- private boolean _deleted;
-
- /** Create a new instance of an AMQTemporaryQueue */
- public AMQTemporaryQueue(AMQSession session)
- {
- super(session.getTemporaryQueueExchangeName(), new AMQShortString("TempQueue" + UUID.randomUUID()), true);
- _session = session;
- }
-
- /** @see javax.jms.TemporaryQueue#delete() */
- public synchronized void delete() throws JMSException
- {
- if (_session.hasConsumer(this))
- {
- throw new JMSException("Temporary Queue has consumers so cannot be deleted");
- }
- _deleted = true;
-
- // Currently TemporaryQueue is set to be auto-delete which means that the queue will be deleted
- // by the server when there are no more subscriptions to that queue. This is probably not
- // quite right for JMSCompliance.
- }
-
- public AMQSession getSession()
- {
- return _session;
- }
-
- public boolean isDeleted()
- {
- return _deleted;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryTopic.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryTopic.java
deleted file mode 100644
index 7b5781530b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryTopic.java
+++ /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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.framing.AMQShortString;
-
-import javax.jms.JMSException;
-import javax.jms.TemporaryTopic;
-import java.util.UUID;
-
-/**
- * AMQ implementation of TemporaryTopic.
- */
-class AMQTemporaryTopic extends AMQTopic implements TemporaryTopic, TemporaryDestination
-{
-
- private final AMQSession _session;
- private boolean _deleted;
- /**
- * Create new temporary topic.
- */
- public AMQTemporaryTopic(AMQSession session)
- {
- super(session.getTemporaryTopicExchangeName(),new AMQShortString("tmp_" + UUID.randomUUID()));
- _session = session;
- }
-
- /**
- * @see javax.jms.TemporaryTopic#delete()
- */
- public void delete() throws JMSException
- {
- if(_session.hasConsumer(this))
- {
- throw new JMSException("Temporary Topic has consumers so cannot be deleted");
- }
-
- _deleted = true;
- // Currently TemporaryQueue is set to be auto-delete which means that the queue will be deleted
- // by the server when there are no more subscriptions to that queue. This is probably not
- // quite right for JMSCompliance.
- }
-
- public AMQSession getSession()
- {
- return _session;
- }
-
- public boolean isDeleted()
- {
- return _deleted;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java
deleted file mode 100644
index 40041afdc6..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java
+++ /dev/null
@@ -1,151 +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.
- *
- */
-package org.apache.qpid.client;
-
-import javax.jms.JMSException;
-import javax.jms.Topic;
-
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.url.BindingURL;
-
-public class AMQTopic extends AMQDestination implements Topic
-{
- /**
- * Constructor for use in creating a topic using a BindingURL.
- *
- * @param binding The binding url object.
- */
- public AMQTopic(BindingURL binding)
- {
- super(binding);
- }
-
-// public AMQTopic(String exchangeName, String routingKey)
-// {
-// this(new AMQShortString(exchangeName), new AMQShortString(routingKey));
-// }
-
- public AMQTopic(AMQShortString exchange, AMQShortString routingKey, AMQShortString queueName)
- {
- super(exchange, ExchangeDefaults.TOPIC_EXCHANGE_CLASS, routingKey, true, true, queueName, false);
- }
-
- public AMQTopic(AMQShortString exchange, AMQShortString routingKey, AMQShortString queueName,AMQShortString[] bindingKeys)
- {
- super(exchange, ExchangeDefaults.TOPIC_EXCHANGE_CLASS, routingKey, true, true, queueName, false,bindingKeys);
- }
-
- public AMQTopic(AMQConnection conn, String routingKey)
- {
- this(conn.getDefaultTopicExchangeName(), new AMQShortString(routingKey));
- }
-
-
- public AMQTopic(AMQShortString exchangeName, String routingKey)
- {
- this(exchangeName, new AMQShortString(routingKey));
- }
-
- public AMQTopic(AMQShortString exchangeName, AMQShortString routingKey)
- {
- this(exchangeName, routingKey, null);
- }
-
- public AMQTopic(AMQShortString exchangeName, AMQShortString name, boolean isAutoDelete, AMQShortString queueName, boolean isDurable)
- {
- super(exchangeName, ExchangeDefaults.TOPIC_EXCHANGE_CLASS, name, true, isAutoDelete,
- queueName, isDurable);
- }
-
- protected AMQTopic(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString routingKey, boolean isExclusive,
- boolean isAutoDelete, AMQShortString queueName, boolean isDurable)
- {
- super(exchangeName, exchangeClass, routingKey, isExclusive, isAutoDelete, queueName, isDurable );
- }
-
- protected AMQTopic(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString routingKey, boolean isExclusive,
- boolean isAutoDelete, AMQShortString queueName, boolean isDurable,AMQShortString[] bindingKeys)
- {
- super(exchangeName, exchangeClass, routingKey, isExclusive, isAutoDelete, queueName, isDurable,bindingKeys);
- }
-
- public static AMQTopic createDurableTopic(AMQTopic topic, String subscriptionName, AMQConnection connection)
- throws JMSException
- {
- return new AMQTopic(topic.getExchangeName(), topic.getRoutingKey(), false,
- getDurableTopicQueueName(subscriptionName, connection),
- true);
- }
-
- public static AMQTopic createDurable010Topic(AMQTopic topic, String subscriptionName, AMQConnection connection)
- throws JMSException
- {
- return new AMQTopic(topic.getExchangeName(), ExchangeDefaults.TOPIC_EXCHANGE_CLASS, topic.getRoutingKey(), true, false,
- getDurableTopicQueueName(subscriptionName, connection), true);
- }
-
- public static AMQShortString getDurableTopicQueueName(String subscriptionName, AMQConnection connection) throws JMSException
- {
- return new AMQShortString(connection.getClientID() + ":" + subscriptionName);
- }
-
- public String getTopicName() throws JMSException
- {
- return super.getRoutingKey().toString();
- }
-
- public AMQShortString getRoutingKey()
- {
- return super.getRoutingKey();
- }
-
- public boolean isNameRequired()
- {
- return !isDurable();
- }
-
- /**
- * Override since the queue is always private and we must ensure it remains null. If not,
- * reuse of the topic when registering consumers will make all consumers listen on the same (private) queue rather
- * than getting their own (private) queue.
- * <p/>
- * This is relatively nasty but it is difficult to come up with a more elegant solution, given
- * the requirement in the case on AMQQueue and possibly other AMQDestination subclasses to
- * use the underlying queue name even where it is server generated.
- */
- public void setQueueName(String queueName)
- {
- }
-
- public boolean equals(Object o)
- {
- return (o instanceof AMQTopic)
- && ((AMQTopic)o).getExchangeName().equals(getExchangeName())
- && ((AMQTopic)o).getRoutingKey().equals(getRoutingKey());
-
- }
-
- public int hashCode()
- {
- return getExchangeName().hashCode() + getRoutingKey().hashCode();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java
deleted file mode 100644
index f44f8414fa..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java
+++ /dev/null
@@ -1,226 +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.
- *
- */
-package org.apache.qpid.client;
-
-import java.io.Serializable;
-
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-import javax.jms.TopicSubscriber;
-
-public class AMQTopicSessionAdaptor implements TopicSession, AMQSessionAdapter
-{
- protected final AMQSession _session;
-
- public AMQTopicSessionAdaptor(Session session)
- {
- _session = (AMQSession) session;
- }
-
- public Topic createTopic(String string) throws JMSException
- {
- return _session.createTopic(string);
- }
-
- public TopicSubscriber createSubscriber(Topic topic) throws JMSException
- {
- return _session.createSubscriber(topic);
- }
-
- public TopicSubscriber createSubscriber(Topic topic, String string, boolean b) throws JMSException
- {
- return _session.createSubscriber(topic, string, b);
- }
-
- public TopicSubscriber createDurableSubscriber(Topic topic, String string) throws JMSException
- {
- return _session.createDurableSubscriber(topic, string);
- }
-
- public TopicSubscriber createDurableSubscriber(Topic topic, String string, String string1, boolean b) throws JMSException
- {
- return _session.createDurableSubscriber(topic, string, string1, b);
- }
-
- public TopicPublisher createPublisher(Topic topic) throws JMSException
- {
- return _session.createPublisher(topic);
- }
-
- public TemporaryTopic createTemporaryTopic() throws JMSException
- {
- return _session.createTemporaryTopic();
- }
-
- public void unsubscribe(String string) throws JMSException
- {
- _session.unsubscribe(string);
- }
-
- public BytesMessage createBytesMessage() throws JMSException
- {
- return _session.createBytesMessage();
- }
-
- public MapMessage createMapMessage() throws JMSException
- {
- return _session.createMapMessage();
- }
-
- public Message createMessage() throws JMSException
- {
- return _session.createMessage();
- }
-
- public ObjectMessage createObjectMessage() throws JMSException
- {
- return _session.createObjectMessage();
- }
-
- public ObjectMessage createObjectMessage(Serializable serializable) throws JMSException
- {
- return _session.createObjectMessage();
- }
-
- public StreamMessage createStreamMessage() throws JMSException
- {
- return _session.createStreamMessage();
- }
-
- public TextMessage createTextMessage() throws JMSException
- {
- return _session.createTextMessage();
- }
-
- public TextMessage createTextMessage(String string) throws JMSException
- {
- return _session.createTextMessage(string);
- }
-
- public boolean getTransacted() throws JMSException
- {
- return _session.getTransacted();
- }
-
- public int getAcknowledgeMode() throws JMSException
- {
- return _session.getAcknowledgeMode();
- }
-
- public void commit() throws JMSException
- {
- _session.commit();
- }
-
- public void rollback() throws JMSException
- {
- _session.rollback();
- }
-
- public void close() throws JMSException
- {
- _session.close();
- }
-
- public void recover() throws JMSException
- {
- _session.recover();
- }
-
- public MessageListener getMessageListener() throws JMSException
- {
- return _session.getMessageListener();
- }
-
- public void setMessageListener(MessageListener messageListener) throws JMSException
- {
- _session.setMessageListener(messageListener);
- }
-
- public void run()
- {
- _session.run();
- }
-
- public MessageProducer createProducer(Destination destination) throws JMSException
- {
- return _session.createProducer(destination);
- }
-
- public MessageConsumer createConsumer(Destination destination) throws JMSException
- {
- return _session.createConsumer(destination);
- }
-
- public MessageConsumer createConsumer(Destination destination, String string) throws JMSException
- {
- return _session.createConsumer(destination, string);
- }
-
- public MessageConsumer createConsumer(Destination destination, String string, boolean b) throws JMSException
- {
- return _session.createConsumer(destination, string, b);
- }
-
- //The following methods cannot be called from a TopicSession as per JMS spec
- public Queue createQueue(String string) throws JMSException
- {
- throw new IllegalStateException("Cannot call createQueue from TopicSession");
- }
-
- public QueueBrowser createBrowser(Queue queue) throws JMSException
- {
- throw new IllegalStateException("Cannot call createBrowser from TopicSession");
- }
-
- public QueueBrowser createBrowser(Queue queue, String string) throws JMSException
- {
- throw new IllegalStateException("Cannot call createBrowser from TopicSession");
- }
-
- public TemporaryQueue createTemporaryQueue() throws JMSException
- {
- throw new IllegalStateException("Cannot call createTemporaryQueue from TopicSession");
- }
-
- public AMQSession getSession()
- {
- return _session;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQUndefinedDestination.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQUndefinedDestination.java
deleted file mode 100644
index fa2afb3ee4..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/AMQUndefinedDestination.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.framing.AMQShortString;
-
-public class AMQUndefinedDestination extends AMQDestination
-{
-
- private static final AMQShortString UNKNOWN_EXCHANGE_CLASS = new AMQShortString("unknown");
-
-
- public AMQUndefinedDestination(AMQShortString exchange, AMQShortString routingKey, AMQShortString queueName)
- {
- super(exchange, UNKNOWN_EXCHANGE_CLASS, routingKey, queueName);
- }
-
- public boolean isNameRequired()
- {
- return getAMQQueueName() == null;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
deleted file mode 100644
index 76422c6297..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
+++ /dev/null
@@ -1,1079 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.message.*;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.jms.MessageConsumer;
-import org.apache.qpid.jms.Session;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.SortedSet;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.TreeSet;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
-
-public abstract class BasicMessageConsumer<U> extends Closeable implements MessageConsumer
-{
- private static final Logger _logger = LoggerFactory.getLogger(BasicMessageConsumer.class);
-
- /** The connection being used by this consumer */
- protected final AMQConnection _connection;
-
- protected final String _messageSelector;
-
- private final boolean _noLocal;
-
- private final AMQDestination _destination;
-
- /**
- * When true indicates that a blocking receive call is in progress
- */
- private final AtomicBoolean _receiving = new AtomicBoolean(false);
- /**
- * Holds an atomic reference to the listener installed.
- */
- private final AtomicReference<MessageListener> _messageListener = new AtomicReference<MessageListener>();
-
- /** The consumer tag allows us to close the consumer by sending a jmsCancel method to the broker */
- protected int _consumerTag;
-
- /** We need to know the channel id when constructing frames */
- protected final int _channelId;
-
- /**
- * Used in the blocking receive methods to receive a message from the Session thread. <p/> Or to notify of errors
- * <p/> Argument true indicates we want strict FIFO semantics
- */
- protected final BlockingQueue _synchronousQueue;
-
- protected final MessageFactoryRegistry _messageFactory;
-
- protected final AMQSession _session;
-
- protected final AMQProtocolHandler _protocolHandler;
-
- /**
- * We need to store the "raw" field table so that we can resubscribe in the event of failover being required
- */
- private final FieldTable _arguments;
-
- /**
- * We store the high water prefetch field in order to be able to reuse it when resubscribing in the event of
- * failover
- */
- private final int _prefetchHigh;
-
- /**
- * We store the low water prefetch field in order to be able to reuse it when resubscribing in the event of
- * failover
- */
- private final int _prefetchLow;
-
- /**
- * We store the exclusive field in order to be able to reuse it when resubscribing in the event of failover
- */
- private final boolean _exclusive;
-
- /**
- * The acknowledge mode in force for this consumer. Note that the AMQP protocol allows different ack modes per
- * consumer whereas JMS defines this at the session level, hence why we associate it with the consumer in our
- * implementation.
- */
- protected final int _acknowledgeMode;
-
- /**
- * Number of messages unacknowledged in DUPS_OK_ACKNOWLEDGE mode
- */
- private int _outstanding;
-
- /**
- * Switch to enable sending of acknowledgements when using DUPS_OK_ACKNOWLEDGE mode. Enabled when _outstannding
- * number of msgs >= _prefetchHigh and disabled at < _prefetchLow
- */
- private boolean _dups_ok_acknowledge_send;
-
- /**
- * List of tags delievered, The last of which which should be acknowledged on commit in transaction mode.
- */
- private ConcurrentLinkedQueue<Long> _receivedDeliveryTags = new ConcurrentLinkedQueue<Long>();
-
- /** The last tag that was "multiple" acknowledged on this session (if transacted) */
- private long _lastAcked;
-
- /** set of tags which have previously been acked; but not part of the multiple ack (transacted mode only) */
- private final SortedSet<Long> _previouslyAcked = new TreeSet<Long>();
-
- private final Object _commitLock = new Object();
-
- /**
- * The thread that was used to call receive(). This is important for being able to interrupt that thread if a
- * receive() is in progress.
- */
- private Thread _receivingThread;
-
-
- /**
- * Used to store this consumer queue name
- * Usefull when more than binding key should be used
- */
- private AMQShortString _queuename;
-
- /**
- * autoClose denotes that the consumer will automatically cancel itself when there are no more messages to receive
- * on the queue. This is used for queue browsing.
- */
- private final boolean _autoClose;
-
- private final boolean _noConsume;
- private List<StackTraceElement> _closedStack = null;
-
-
-
- protected BasicMessageConsumer(int channelId, AMQConnection connection, AMQDestination destination,
- String messageSelector, boolean noLocal, MessageFactoryRegistry messageFactory,
- AMQSession session, AMQProtocolHandler protocolHandler,
- FieldTable arguments, int prefetchHigh, int prefetchLow,
- boolean exclusive, int acknowledgeMode, boolean noConsume, boolean autoClose)
- {
- _channelId = channelId;
- _connection = connection;
- _messageSelector = messageSelector;
- _noLocal = noLocal;
- _destination = destination;
- _messageFactory = messageFactory;
- _session = session;
- _protocolHandler = protocolHandler;
- _arguments = arguments;
- _prefetchHigh = prefetchHigh;
- _prefetchLow = prefetchLow;
- _exclusive = exclusive;
-
- _synchronousQueue = new LinkedBlockingQueue();
- _autoClose = autoClose;
- _noConsume = noConsume;
-
- // Force queue browsers not to use acknowledge modes.
- if (_noConsume)
- {
- _acknowledgeMode = Session.NO_ACKNOWLEDGE;
- }
- else
- {
- _acknowledgeMode = acknowledgeMode;
- }
- }
-
- public AMQDestination getDestination()
- {
- return _destination;
- }
-
- public String getMessageSelector() throws JMSException
- {
- checkPreConditions();
-
- return _messageSelector;
- }
-
- public MessageListener getMessageListener() throws JMSException
- {
- checkPreConditions();
-
- return _messageListener.get();
- }
-
- public int getAcknowledgeMode()
- {
- return _acknowledgeMode;
- }
-
- protected boolean isMessageListenerSet()
- {
- return _messageListener.get() != null;
- }
-
- public void setMessageListener(final MessageListener messageListener) throws JMSException
- {
- checkPreConditions();
-
- // if the current listener is non-null and the session is not stopped, then
- // it is an error to call this method.
-
- // i.e. it is only valid to call this method if
- //
- // (a) the connection is stopped, in which case the dispatcher is not running
- // OR
- // (b) the listener is null AND we are not receiving synchronously at present
- //
-
- if (!_session.getAMQConnection().started())
- {
- _messageListener.set(messageListener);
- _session.setHasMessageListeners();
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug(
- "Session stopped : Message listener(" + messageListener + ") set for destination " + _destination);
- }
- }
- else
- {
- if (_receiving.get())
- {
- throw new javax.jms.IllegalStateException("Another thread is already receiving synchronously.");
- }
-
- if (!_messageListener.compareAndSet(null, messageListener))
- {
- throw new javax.jms.IllegalStateException("Attempt to alter listener while session is started.");
- }
-
- _logger.debug("Message listener set for destination " + _destination);
-
- if (messageListener != null)
- {
- //todo: handle case where connection has already been started, and the dispatcher has alreaded started
- // putting values on the _synchronousQueue
-
- synchronized (_session)
- {
- _messageListener.set(messageListener);
- _session.setHasMessageListeners();
- _session.startDispatcherIfNecessary();
-
- // If we already have messages on the queue, deliver them to the listener
- Object o = _synchronousQueue.poll();
- while (o != null)
- {
- notifyMessage((AbstractJMSMessage) o);
- o = _synchronousQueue.poll();
- }
- }
- }
- }
- }
-
- protected void preApplicationProcessing(AbstractJMSMessage jmsMsg) throws JMSException
- {
- if (_session.getAcknowledgeMode() == Session.CLIENT_ACKNOWLEDGE)
- {
- _session.addUnacknowledgedMessage(jmsMsg.getDeliveryTag());
- }
-
- _session.setInRecovery(false);
- preDeliver(jmsMsg);
- }
-
- /**
- * @param immediate if true then return immediately if the connection is failing over
- *
- * @return boolean if the acquisition was successful
- *
- * @throws JMSException if a listener has already been set or another thread is receiving
- * @throws InterruptedException if interrupted
- */
- private boolean acquireReceiving(boolean immediate) throws JMSException, InterruptedException
- {
- if (_connection.isFailingOver())
- {
- if (immediate)
- {
- return false;
- }
- else
- {
- _connection.blockUntilNotFailingOver();
- }
- }
-
- if (!_receiving.compareAndSet(false, true))
- {
- throw new javax.jms.IllegalStateException("Another thread is already receiving.");
- }
-
- if (isMessageListenerSet())
- {
- throw new javax.jms.IllegalStateException("A listener has already been set.");
- }
-
- _receivingThread = Thread.currentThread();
- return true;
- }
-
- private void releaseReceiving()
- {
- _receiving.set(false);
- _receivingThread = null;
- }
-
- public FieldTable getArguments()
- {
- return _arguments;
- }
-
- public int getPrefetch()
- {
- return _prefetchHigh;
- }
-
- public int getPrefetchHigh()
- {
- return _prefetchHigh;
- }
-
- public int getPrefetchLow()
- {
- return _prefetchLow;
- }
-
- public boolean isNoLocal()
- {
- return _noLocal;
- }
-
- public boolean isExclusive()
- {
- return _exclusive;
- }
-
- public boolean isReceiving()
- {
- return _receiving.get();
- }
-
- public Message receive() throws JMSException
- {
- return receive(0);
- }
-
- public Message receive(long l) throws JMSException
- {
-
- checkPreConditions();
-
- try
- {
- acquireReceiving(false);
- }
- catch (InterruptedException e)
- {
- _logger.warn("Interrupted acquire: " + e);
- if (isClosed())
- {
- return null;
- }
- }
-
- _session.startDispatcherIfNecessary();
-
- try
- {
- Object o = getMessageFromQueue(l);
- final AbstractJMSMessage m = returnMessageOrThrow(o);
- if (m != null)
- {
- preApplicationProcessing(m);
- postDeliver(m);
- }
- return m;
- }
- catch (InterruptedException e)
- {
- _logger.warn("Interrupted: " + e);
-
- return null;
- }
- finally
- {
- releaseReceiving();
- }
- }
-
- public Object getMessageFromQueue(long l) throws InterruptedException
- {
- Object o;
- if (l > 0)
- {
- o = _synchronousQueue.poll(l, TimeUnit.MILLISECONDS);
- }
- else if (l < 0)
- {
- o = _synchronousQueue.poll();
- }
- else
- {
- o = _synchronousQueue.take();
- }
- return o;
- }
-
- public Message receiveNoWait() throws JMSException
- {
- checkPreConditions();
-
- try
- {
- if (!acquireReceiving(true))
- {
- //If we couldn't acquire the receiving thread then return null.
- // This will occur if failing over.
- return null;
- }
- }
- catch (InterruptedException e)
- {
- /*
- * This seems slightly shoddy but should never actually be executed
- * since we told acquireReceiving to return immediately and it shouldn't
- * block on anything.
- */
-
- return null;
- }
-
- _session.startDispatcherIfNecessary();
-
- try
- {
- Object o = getMessageFromQueue(-1);
- final AbstractJMSMessage m = returnMessageOrThrow(o);
- if (m != null)
- {
- preApplicationProcessing(m);
- postDeliver(m);
- }
-
- return m;
- }
- catch (InterruptedException e)
- {
- _logger.warn("Interrupted: " + e);
-
- return null;
- }
- finally
- {
- releaseReceiving();
- }
- }
-
- /**
- * We can get back either a Message or an exception from the queue. This method examines the argument and deals with
- * it by throwing it (if an exception) or returning it (in any other case).
- *
- * @param o the object to return or throw
- * @return a message only if o is a Message
- * @throws JMSException if the argument is a throwable. If it is a JMSException it is rethrown as is, but if not a
- * JMSException is created with the linked exception set appropriately
- */
- private AbstractJMSMessage returnMessageOrThrow(Object o) throws JMSException
- {
- // errors are passed via the queue too since there is no way of interrupting the poll() via the API.
- if (o instanceof Throwable)
- {
- JMSException e = new JMSException("Message consumer forcibly closed due to error: " + o);
- if (o instanceof Exception)
- {
- e.setLinkedException((Exception) o);
- }
-
- throw e;
- }
- else if (o instanceof CloseConsumerMessage)
- {
- _closed.set(true);
- deregisterConsumer();
- return null;
- }
- else
- {
- return (AbstractJMSMessage) o;
- }
- }
-
- public void close() throws JMSException
- {
- close(true);
- }
-
- public void close(boolean sendClose) throws JMSException
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Closing consumer:" + debugIdentity());
- }
-
- if (!_closed.getAndSet(true))
- {
- if (_logger.isDebugEnabled())
- {
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- if (_closedStack != null)
- {
- _logger.debug(_consumerTag + " previously:" + _closedStack.toString());
- }
- else
- {
- _closedStack = Arrays.asList(stackTrace).subList(3, stackTrace.length - 1);
- }
- }
-
- if (sendClose)
- {
- // The Synchronized block only needs to protect network traffic.
- synchronized (_connection.getFailoverMutex())
- {
- try
- {
- sendCancel();
- }
- catch (AMQException e)
- {
- throw new JMSAMQException("Error closing consumer: " + e, e);
- }
- catch (FailoverException e)
- {
- throw new JMSAMQException("FailoverException interrupted basic cancel.", e);
- }
- }
- }
- else
- {
- // FIXME: wow this is ugly
- // //fixme this probably is not right
- // if (!isNoConsume())
- { // done in BasicCancelOK Handler but not sending one so just deregister.
- deregisterConsumer();
- }
- }
-
- // This will occur if session.close is called closing all consumers we may be blocked waiting for a receive
- // so we need to let it know it is time to close.
- if ((_messageListener != null) && _receiving.get())
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Interrupting thread: " + _receivingThread);
- }
-
- _receivingThread.interrupt();
- }
- }
- }
-
- abstract void sendCancel() throws AMQException, FailoverException;
-
- /**
- * Called when you need to invalidate a consumer. Used for example when failover has occurred and the client has
- * vetoed automatic resubscription. The caller must hold the failover mutex.
- */
- void markClosed()
- {
- // synchronized (_closed)
- {
- _closed.set(true);
-
- if (_logger.isDebugEnabled())
- {
- if (_closedStack != null)
- {
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- _logger.debug(_consumerTag + " markClosed():"
- + Arrays.asList(stackTrace).subList(3, stackTrace.length - 1));
- _logger.debug(_consumerTag + " previously:" + _closedStack.toString());
- }
- else
- {
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- _closedStack = Arrays.asList(stackTrace).subList(3, stackTrace.length - 1);
- }
- }
- }
-
- deregisterConsumer();
- }
-
- /**
- * @param closeMessage
- * this message signals that we should close the browser
- */
- public void notifyCloseMessage(CloseConsumerMessage closeMessage)
- {
- if (isMessageListenerSet())
- {
- // Currently only possible to get this msg type with a browser.
- // If we get the message here then we should probably just close
- // this consumer.
- // Though an AutoClose consumer with message listener is quite odd..
- // Just log out the fact so we know where we are
- _logger.warn("Using an AutoCloseconsumer with message listener is not supported.");
- }
- else
- {
- try
- {
- _synchronousQueue.put(closeMessage);
- }
- catch (InterruptedException e)
- {
- _logger.info(" SynchronousQueue.put interupted. Usually result of connection closing,"
- + "but we shouldn't have close yet");
- }
- }
- }
-
-
- /**
- * Called from the AMQSession when a message has arrived for this consumer. This methods handles both the case of a
- * message listener or a synchronous receive() caller.
- *
- * @param messageFrame the raw unprocessed mesage
- */
- void notifyMessage(U messageFrame)
- {
- if (messageFrame instanceof CloseConsumerMessage)
- {
- notifyCloseMessage((CloseConsumerMessage) messageFrame);
- return;
- }
-
-
-
- try
- {
- AbstractJMSMessage jmsMessage = createJMSMessageFromUnprocessedMessage(_session.getMessageDelegateFactory(), messageFrame);
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Message is of type: " + jmsMessage.getClass().getName());
- }
- // synchronized (_closed)
-
- {
- // if (!_closed.get())
- {
-
- //preDeliver(jmsMessage);
-
- notifyMessage(jmsMessage);
- }
- // else
- // {
- // _logger.error("MESSAGE REJECTING!");
- // _session.rejectMessage(jmsMessage, true);
- // //_logger.error("MESSAGE JUST DROPPED!");
- // }
- }
- }
- catch (Exception e)
- {
- if (e instanceof InterruptedException)
- {
- _logger.info("SynchronousQueue.put interupted. Usually result of connection closing");
- }
- else
- {
- _logger.error("Caught exception (dump follows) - ignoring...", e);
- }
- }
- }
-
- public abstract AbstractJMSMessage createJMSMessageFromUnprocessedMessage(AMQMessageDelegateFactory delegateFactory, U messageFrame)
- throws Exception;
-
- /** @param jmsMessage this message has already been processed so can't redo preDeliver */
- public void notifyMessage(AbstractJMSMessage jmsMessage)
- {
- try
- {
- if (isMessageListenerSet())
- {
- preApplicationProcessing(jmsMessage);
- getMessageListener().onMessage(jmsMessage);
- postDeliver(jmsMessage);
- }
- else
- {
- // we should not be allowed to add a message is the
- // consumer is closed
- _synchronousQueue.put(jmsMessage);
- }
- }
- catch (Exception e)
- {
- if (e instanceof InterruptedException)
- {
- _logger.info("reNotification : SynchronousQueue.put interupted. Usually result of connection closing");
- }
- else
- {
- _logger.error("reNotification : Caught exception (dump follows) - ignoring...", e);
- }
- }
- }
-
- void preDeliver(AbstractJMSMessage msg)
- {
- switch (_acknowledgeMode)
- {
-
- case Session.PRE_ACKNOWLEDGE:
- _session.acknowledgeMessage(msg.getDeliveryTag(), false);
- break;
-
- case Session.CLIENT_ACKNOWLEDGE:
- // we set the session so that when the user calls acknowledge() it can call the method on session
- // to send out the appropriate frame
- msg.setAMQSession(_session);
- break;
- case Session.SESSION_TRANSACTED:
- if (isNoConsume())
- {
- _session.acknowledgeMessage(msg.getDeliveryTag(), false);
- }
- else
- {
- _session.addDeliveredMessage(msg.getDeliveryTag());
- }
-
- break;
- }
- }
-
- void postDeliver(AbstractJMSMessage msg) throws JMSException
- {
- msg.setJMSDestination(_destination);
- switch (_acknowledgeMode)
- {
-
- case Session.CLIENT_ACKNOWLEDGE:
- if (isNoConsume())
- {
- _session.acknowledgeMessage(msg.getDeliveryTag(), false);
- }
- _session.markDirty();
- break;
-
- case Session.DUPS_OK_ACKNOWLEDGE:
- case Session.AUTO_ACKNOWLEDGE:
- // we do not auto ack a message if the application code called recover()
- if (!_session.isInRecovery())
- {
- _session.acknowledgeMessage(msg.getDeliveryTag(), false);
- }
-
- break;
- }
- }
-
-
- /**
- * Acknowledge up to last message delivered (if any). Used when commiting.
- *
- * @return the lastDeliveryTag to acknowledge
- */
- Long getLastDelivered()
- {
- if (!_receivedDeliveryTags.isEmpty())
- {
- Long lastDeliveryTag = _receivedDeliveryTags.poll();
-
- while (!_receivedDeliveryTags.isEmpty())
- {
- lastDeliveryTag = _receivedDeliveryTags.poll();
- }
-
- assert _receivedDeliveryTags.isEmpty();
-
- return lastDeliveryTag;
- }
-
- return null;
- }
-
- /**
- * Acknowledge up to last message delivered (if any). Used when commiting.
- */
- void acknowledgeDelivered()
- {
- synchronized(_commitLock)
- {
- ArrayList<Long> tagsToAck = new ArrayList<Long>();
-
- while (!_receivedDeliveryTags.isEmpty())
- {
- tagsToAck.add(_receivedDeliveryTags.poll());
- }
-
- Collections.sort(tagsToAck);
-
- long prevAcked = _lastAcked;
- long oldAckPoint = -1;
-
- while(oldAckPoint != prevAcked)
- {
- oldAckPoint = prevAcked;
-
- Iterator<Long> tagsToAckIterator = tagsToAck.iterator();
-
- while(tagsToAckIterator.hasNext() && tagsToAckIterator.next() == prevAcked+1)
- {
- tagsToAckIterator.remove();
- prevAcked++;
- }
-
- Iterator<Long> previousAckIterator = _previouslyAcked.iterator();
- while(previousAckIterator.hasNext() && previousAckIterator.next() == prevAcked+1)
- {
- previousAckIterator.remove();
- prevAcked++;
- }
-
- }
- if(prevAcked != _lastAcked)
- {
- _session.acknowledgeMessage(prevAcked, true);
- _lastAcked = prevAcked;
- }
-
- Iterator<Long> tagsToAckIterator = tagsToAck.iterator();
-
- while(tagsToAckIterator.hasNext())
- {
- Long tag = tagsToAckIterator.next();
- _session.acknowledgeMessage(tag, false);
- _previouslyAcked.add(tag);
- }
- }
- }
-
-
- void notifyError(Throwable cause)
- {
- // synchronized (_closed)
- {
- _closed.set(true);
- if (_logger.isDebugEnabled())
- {
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- if (_closedStack != null)
- {
- _logger.debug(_consumerTag + " notifyError():"
- + Arrays.asList(stackTrace).subList(3, stackTrace.length - 1));
- _logger.debug(_consumerTag + " previously" + _closedStack.toString());
- }
- else
- {
- _closedStack = Arrays.asList(stackTrace).subList(3, stackTrace.length - 1);
- }
- }
- }
- // QPID-293 can "request redelivery of this error through dispatcher"
-
- // we have no way of propagating the exception to a message listener - a JMS limitation - so we
- // deal with the case where we have a synchronous receive() waiting for a message to arrive
- if (!isMessageListenerSet())
- {
- // offer only succeeds if there is a thread waiting for an item from the queue
- if (_synchronousQueue.offer(cause))
- {
- _logger.debug("Passed exception to synchronous queue for propagation to receive()");
- }
- }
-
- deregisterConsumer();
- }
-
- /**
- * Perform cleanup to deregister this consumer. This occurs when closing the consumer in both the clean case and in
- * the case of an error occurring.
- */
- private void deregisterConsumer()
- {
- _session.deregisterConsumer(this);
- }
-
- public int getConsumerTag()
- {
- return _consumerTag;
- }
-
- public void setConsumerTag(int consumerTag)
- {
- _consumerTag = consumerTag;
- }
-
- public AMQSession getSession()
- {
- return _session;
- }
-
- private void checkPreConditions() throws JMSException
- {
-
- this.checkNotClosed();
-
- if ((_session == null) || _session.isClosed())
- {
- throw new javax.jms.IllegalStateException("Invalid Session");
- }
- }
-
- public boolean isAutoClose()
- {
- return _autoClose;
- }
-
- public boolean isNoConsume()
- {
- return _noConsume;
- }
-
- public void rollback()
- {
- rollbackPendingMessages();
- }
-
- public void rollbackPendingMessages()
- {
- if (_synchronousQueue.size() > 0)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Rejecting the messages(" + _synchronousQueue
- .size() + ") in _syncQueue (PRQ)" + "for consumer with tag:" + _consumerTag);
- }
-
- Iterator iterator = _synchronousQueue.iterator();
-
- int initialSize = _synchronousQueue.size();
-
- boolean removed = false;
- while (iterator.hasNext())
- {
-
- Object o = iterator.next();
- if (o instanceof AbstractJMSMessage)
- {
- _session.rejectMessage(((AbstractJMSMessage) o), true);
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Rejected message:" + ((AbstractJMSMessage) o).getDeliveryTag());
- }
-
- iterator.remove();
- removed = true;
-
- }
- else
- {
- _logger.error("Queue contained a :" + o.getClass()
- + " unable to reject as it is not an AbstractJMSMessage. Will be cleared");
- iterator.remove();
- removed = true;
- }
- }
-
- if (removed && (initialSize == _synchronousQueue.size()))
- {
- _logger.error("Queue had content removed but didn't change in size." + initialSize);
- }
-
-
- if (_synchronousQueue.size() != 0)
- {
- _logger.warn("Queue was not empty after rejecting all messages Remaining:" + _synchronousQueue.size());
- rollback();
- }
-
- clearReceiveQueue();
- }
- }
-
- public String debugIdentity()
- {
- return String.valueOf(_consumerTag) + "[" + System.identityHashCode(this) + "]";
- }
-
- public void clearReceiveQueue()
- {
- _synchronousQueue.clear();
- }
-
- public void start()
- {
- // do nothing as this is a 0_10 feature
- }
-
-
- public void stop()
- {
- // do nothing as this is a 0_10 feature
- }
-
- public boolean isStrated()
- {
- // do nothing as this is a 0_10 feature
- return false;
- }
-
- public AMQShortString getQueuename()
- {
- return _queuename;
- }
-
- public void setQueuename(AMQShortString queuename)
- {
- this._queuename = queuename;
- }
-
- public void addBindingKey(AMQDestination amqd, String routingKey) throws AMQException
- {
- _session.addBindingKey(this,amqd,routingKey);
- }
-
- /** to be called when a failover has occured */
- public void failedOver()
- {
- clearReceiveQueue();
- // TGM FIXME: think this should just be removed
- // clearUnackedMessages();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
deleted file mode 100644
index 7d535643c0..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_10.java
+++ /dev/null
@@ -1,409 +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.
- */
-package org.apache.qpid.client;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.client.message.*;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.transport.*;
-import org.apache.qpid.QpidException;
-import org.apache.qpid.filter.MessageFilter;
-import org.apache.qpid.filter.JMSSelectorFilter;
-
-import javax.jms.InvalidSelectorException;
-import javax.jms.JMSException;
-import javax.jms.MessageListener;
-import java.util.Iterator;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * This is a 0.10 message consumer.
- */
-public class BasicMessageConsumer_0_10 extends BasicMessageConsumer<UnprocessedMessage_0_10>
-{
-
- /**
- * This class logger
- */
- protected final Logger _logger = LoggerFactory.getLogger(getClass());
-
- /**
- * The message selector filter associated with this consumer message selector
- */
- private MessageFilter _filter = null;
-
- /**
- * The underlying QpidSession
- */
- private AMQSession_0_10 _0_10session;
-
- /**
- * Indicates whether this consumer receives pre-acquired messages
- */
- private boolean _preAcquire = true;
-
- /**
- * Indicate whether this consumer is started.
- */
- private boolean _isStarted = false;
-
- /**
- * Specify whether this consumer is performing a sync receive
- */
- private final AtomicBoolean _syncReceive = new AtomicBoolean(false);
- private String _consumerTagString;
-
- //--- constructor
- protected BasicMessageConsumer_0_10(int channelId, AMQConnection connection, AMQDestination destination,
- String messageSelector, boolean noLocal, MessageFactoryRegistry messageFactory,
- AMQSession session, AMQProtocolHandler protocolHandler,
- FieldTable arguments, int prefetchHigh, int prefetchLow,
- boolean exclusive, int acknowledgeMode, boolean noConsume, boolean autoClose)
- throws JMSException
- {
- super(channelId, connection, destination, messageSelector, noLocal, messageFactory, session, protocolHandler,
- arguments, prefetchHigh, prefetchLow, exclusive, acknowledgeMode, noConsume, autoClose);
- _0_10session = (AMQSession_0_10) session;
- if (messageSelector != null && !messageSelector.equals(""))
- {
- try
- {
- _filter = new JMSSelectorFilter(messageSelector);
- }
- catch (QpidException e)
- {
- throw new InvalidSelectorException("cannot create consumer because of selector issue");
- }
- if (destination instanceof AMQQueue)
- {
- _preAcquire = false;
- }
- }
- _isStarted = connection.started();
- }
-
-
- @Override public void setConsumerTag(int consumerTag)
- {
- super.setConsumerTag(consumerTag);
- _consumerTagString = String.valueOf(consumerTag);
- }
-
- public String getConsumerTagString()
- {
- return _consumerTagString;
- }
-
- /**
- *
- * This is invoked by the session thread when emptying the session message queue.
- * We first check if the message is valid (match the selector) and then deliver it to the
- * message listener or to the sync consumer queue.
- *
- * @param jmsMessage this message has already been processed so can't redo preDeliver
- */
- @Override public void notifyMessage(AbstractJMSMessage jmsMessage)
- {
- boolean messageOk = false;
- try
- {
- messageOk = checkPreConditions(jmsMessage);
- }
- catch (AMQException e)
- {
- _logger.error("Receivecd an Exception when receiving message",e);
- try
- {
-
- getSession().getAMQConnection().getExceptionListener()
- .onException(new JMSAMQException("Error when receiving message", e));
- }
- catch (Exception e1)
- {
- // we should silently log thie exception as it only hanppens when the connection is closed
- _logger.error("Exception when receiving message", e1);
- }
- }
- if (messageOk)
- {
- if (isMessageListenerSet() && ! getSession().prefetch())
- {
- _0_10session.getQpidSession().messageFlow(getConsumerTagString(),
- MessageCreditUnit.MESSAGE, 1);
- }
- _logger.debug("messageOk, trying to notify");
- super.notifyMessage(jmsMessage);
- }
- }
-
- //----- overwritten methods
-
- /**
- * This method is invoked when this consumer is stopped.
- * It tells the broker to stop delivering messages to this consumer.
- */
- @Override void sendCancel() throws AMQException
- {
- ((AMQSession_0_10) getSession()).getQpidSession().messageCancel(getConsumerTagString());
- ((AMQSession_0_10) getSession()).getQpidSession().sync();
- // confirm cancel
- getSession().confirmConsumerCancelled(getConsumerTag());
- ((AMQSession_0_10) getSession()).getCurrentException();
- }
-
- @Override void notifyMessage(UnprocessedMessage_0_10 messageFrame)
- {
-
- super.notifyMessage(messageFrame);
- }
-
- @Override protected void preApplicationProcessing(AbstractJMSMessage jmsMsg) throws JMSException
- {
- super.preApplicationProcessing(jmsMsg);
- if (!_session.getTransacted() && _session.getAcknowledgeMode() != org.apache.qpid.jms.Session.CLIENT_ACKNOWLEDGE)
- {
- _session.addUnacknowledgedMessage(jmsMsg.getDeliveryTag());
- }
- }
-
- @Override public AbstractJMSMessage createJMSMessageFromUnprocessedMessage(
- AMQMessageDelegateFactory delegateFactory, UnprocessedMessage_0_10 msg) throws Exception
- {
- AMQMessageDelegate_0_10.updateExchangeTypeMapping(msg.getMessageTransfer().getHeader(), ((AMQSession_0_10)getSession()).getQpidSession());
- return _messageFactory.createMessage(msg.getMessageTransfer());
- }
-
- // private methods
- /**
- * Check whether a message can be delivered to this consumer.
- *
- * @param message The message to be checked.
- * @return true if the message matches the selector and can be acquired, false otherwise.
- * @throws AMQException If the message preConditions cannot be checked due to some internal error.
- */
- private boolean checkPreConditions(AbstractJMSMessage message) throws AMQException
- {
- boolean messageOk = true;
- // TODO Use a tag for fiding out if message filtering is done here or by the broker.
- try
- {
- if (_messageSelector != null && !_messageSelector.equals(""))
- {
- messageOk = _filter.matches(message);
- }
- }
- catch (Exception e)
- {
- throw new AMQException(AMQConstant.INTERNAL_ERROR, "Error when evaluating message selector", e);
- }
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("messageOk " + messageOk);
- _logger.debug("_preAcquire " + _preAcquire);
- }
- if (!messageOk)
- {
- if (_preAcquire)
- {
- // this is the case for topics
- // We need to ack this message
- if (_logger.isDebugEnabled())
- {
- _logger.debug("filterMessage - trying to ack message");
- }
- acknowledgeMessage(message);
- }
- else
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Message not OK, releasing");
- }
- releaseMessage(message);
- }
- // if we are syncrhonously waiting for a message
- // and messages are not prefetched we then need to request another one
- if(! getSession().prefetch())
- {
- _0_10session.getQpidSession().messageFlow(getConsumerTagString(),
- MessageCreditUnit.MESSAGE, 1);
- }
- }
- // now we need to acquire this message if needed
- // this is the case of queue with a message selector set
- if (!_preAcquire && messageOk && !isNoConsume())
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("filterMessage - trying to acquire message");
- }
- messageOk = acquireMessage(message);
- _logger.debug("filterMessage - *************************************");
- _logger.debug("filterMessage - message acquire status : " + messageOk);
- _logger.debug("filterMessage - *************************************");
- }
- return messageOk;
- }
-
-
- /**
- * Acknowledge a message
- *
- * @param message The message to be acknowledged
- * @throws AMQException If the message cannot be acquired due to some internal error.
- */
- private void acknowledgeMessage(AbstractJMSMessage message) throws AMQException
- {
- if (!_preAcquire)
- {
- RangeSet ranges = new RangeSet();
- ranges.add((int) message.getDeliveryTag());
- _0_10session.messageAcknowledge
- (ranges,
- _acknowledgeMode != org.apache.qpid.jms.Session.NO_ACKNOWLEDGE);
- _0_10session.getCurrentException();
- }
- }
-
- /**
- * Release a message
- *
- * @param message The message to be released
- * @throws AMQException If the message cannot be released due to some internal error.
- */
- private void releaseMessage(AbstractJMSMessage message) throws AMQException
- {
- if (_preAcquire)
- {
- RangeSet ranges = new RangeSet();
- ranges.add((int) message.getDeliveryTag());
- _0_10session.getQpidSession().messageRelease(ranges);
- _0_10session.getCurrentException();
- }
- }
-
- /**
- * Acquire a message
- *
- * @param message The message to be acquired
- * @return true if the message has been acquired, false otherwise.
- * @throws AMQException If the message cannot be acquired due to some internal error.
- */
- private boolean acquireMessage(AbstractJMSMessage message) throws AMQException
- {
- boolean result = false;
- if (!_preAcquire)
- {
- RangeSet ranges = new RangeSet();
- ranges.add((int) message.getDeliveryTag());
-
- Acquired acq = _0_10session.getQpidSession().messageAcquire(ranges).get();
-
- RangeSet acquired = acq.getTransfers();
- if (acquired != null && acquired.size() > 0)
- {
- result = true;
- }
- }
- return result;
- }
-
-
- public void setMessageListener(final MessageListener messageListener) throws JMSException
- {
- super.setMessageListener(messageListener);
- if (messageListener != null && ! getSession().prefetch())
- {
- _0_10session.getQpidSession().messageFlow(getConsumerTagString(),
- MessageCreditUnit.MESSAGE, 1);
- }
- if (messageListener != null && !_synchronousQueue.isEmpty())
- {
- Iterator messages=_synchronousQueue.iterator();
- while (messages.hasNext())
- {
- AbstractJMSMessage message=(AbstractJMSMessage) messages.next();
- messages.remove();
- _session.rejectMessage(message, true);
- }
- }
- }
-
- public boolean isStrated()
- {
- return _isStarted;
- }
-
- public void start()
- {
- _isStarted = true;
- if (_syncReceive.get())
- {
- _0_10session.getQpidSession().messageFlow(getConsumerTagString(),
- MessageCreditUnit.MESSAGE, 1);
- }
- }
-
- public void stop()
- {
- _isStarted = false;
- }
-
- /**
- * When messages are not prefetched we need to request a message from the
- * broker.
- * Note that if the timeout is too short a message may be queued in _synchronousQueue until
- * this consumer closes or request it.
- * @param l
- * @return
- * @throws InterruptedException
- */
- public Object getMessageFromQueue(long l) throws InterruptedException
- {
- if (isStrated() && ! getSession().prefetch() && _synchronousQueue.isEmpty())
- {
- _0_10session.getQpidSession().messageFlow(getConsumerTagString(),
- MessageCreditUnit.MESSAGE, 1);
- }
- if (! getSession().prefetch())
- {
- _syncReceive.set(true);
- }
- Object o = super.getMessageFromQueue(l);
- if (! getSession().prefetch())
- {
- _syncReceive.set(false);
- }
- return o;
- }
-
- void postDeliver(AbstractJMSMessage msg) throws JMSException
- {
- super.postDeliver(msg);
- if (_acknowledgeMode == org.apache.qpid.jms.Session.NO_ACKNOWLEDGE && !_session.isInRecovery())
- {
- _session.acknowledgeMessage(msg.getDeliveryTag(), false);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_8.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_8.java
deleted file mode 100644
index 494a8fb43d..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer_0_8.java
+++ /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.
- *
- */
-package org.apache.qpid.client;
-
-import javax.jms.InvalidSelectorException;
-import javax.jms.JMSException;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.QpidException;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.message.*;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.filter.JMSSelectorFilter;
-import org.apache.qpid.framing.*;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BasicMessageConsumer_0_8 extends BasicMessageConsumer<UnprocessedMessage_0_8>
-{
- protected final Logger _logger = LoggerFactory.getLogger(getClass());
-
- protected BasicMessageConsumer_0_8(int channelId, AMQConnection connection, AMQDestination destination,
- String messageSelector, boolean noLocal, MessageFactoryRegistry messageFactory, AMQSession session,
- AMQProtocolHandler protocolHandler, FieldTable arguments, int prefetchHigh, int prefetchLow,
- boolean exclusive, int acknowledgeMode, boolean noConsume, boolean autoClose) throws JMSException
- {
- super(channelId, connection, destination,messageSelector,noLocal,messageFactory,session,
- protocolHandler, arguments, prefetchHigh, prefetchLow, exclusive,
- acknowledgeMode, noConsume, autoClose);
- try
- {
-
- if (messageSelector != null && messageSelector.length() > 0)
- {
- JMSSelectorFilter _filter = new JMSSelectorFilter(messageSelector);
- }
- }
- catch (QpidException e)
- {
- throw new InvalidSelectorException("cannot create consumer because of selector issue");
- }
- }
-
- void sendCancel() throws AMQException, FailoverException
- {
- BasicCancelBody body = getSession().getMethodRegistry().createBasicCancelBody(new AMQShortString(String.valueOf(_consumerTag)), false);
-
- final AMQFrame cancelFrame = body.generateFrame(_channelId);
-
- _protocolHandler.syncWrite(cancelFrame, BasicCancelOkBody.class);
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("CancelOk'd for consumer:" + debugIdentity());
- }
- }
-
- public AbstractJMSMessage createJMSMessageFromUnprocessedMessage(AMQMessageDelegateFactory delegateFactory, UnprocessedMessage_0_8 messageFrame)throws Exception
- {
-
- return _messageFactory.createMessage(messageFrame.getDeliveryTag(),
- messageFrame.isRedelivered(), messageFrame.getExchange(),
- messageFrame.getRoutingKey(), messageFrame.getContentHeader(), messageFrame.getBodies());
-
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java
deleted file mode 100644
index 954a3bc28f..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java
+++ /dev/null
@@ -1,561 +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.
- *
- */
-package org.apache.qpid.client;
-
-import java.io.UnsupportedEncodingException;
-import java.util.UUID;
-
-import javax.jms.BytesMessage;
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-import org.apache.qpid.client.message.MessageConverter;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.util.UUIDGen;
-import org.apache.qpid.util.UUIDs;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class BasicMessageProducer extends Closeable implements org.apache.qpid.jms.MessageProducer
-{
- protected final Logger _logger = LoggerFactory.getLogger(getClass());
-
- private AMQConnection _connection;
-
- /**
- * If true, messages will not get a timestamp.
- */
- protected boolean _disableTimestamps;
-
- /**
- * Priority of messages created by this producer.
- */
- private int _messagePriority;
-
- /**
- * Time to live of messages. Specified in milliseconds but AMQ has 1 second resolution.
- */
- private long _timeToLive;
-
- /**
- * Delivery mode used for this producer.
- */
- private int _deliveryMode = DeliveryMode.PERSISTENT;
-
- /**
- * The Destination used for this consumer, if specified upon creation.
- */
- protected AMQDestination _destination;
-
- /**
- * Default encoding used for messages produced by this producer.
- */
- private String _encoding;
-
- /**
- * Default encoding used for message produced by this producer.
- */
- private String _mimeType;
-
- protected AMQProtocolHandler _protocolHandler;
-
- /**
- * True if this producer was created from a transacted session
- */
- private boolean _transacted;
-
- protected int _channelId;
-
- /**
- * This is an id generated by the session and is used to tie individual producers to the session. This means we
- * can deregister a producer with the session when the producer is clsoed. We need to be able to tie producers
- * to the session so that when an error is propagated to the session it can close the producer (meaning that
- * a client that happens to hold onto a producer reference will get an error if he tries to use it subsequently).
- */
- private long _producerId;
-
- /**
- * The session used to create this producer
- */
- protected AMQSession _session;
-
- private final boolean _immediate;
-
- private final boolean _mandatory;
-
- private final boolean _waitUntilSent;
-
- private boolean _disableMessageId;
-
- private UUIDGen _messageIdGenerator = UUIDs.newGenerator();
-
- protected String _userID; // ref user id used in the connection.
-
- private static final ContentBody[] NO_CONTENT_BODIES = new ContentBody[0];
-
- protected BasicMessageProducer(AMQConnection connection, AMQDestination destination, boolean transacted, int channelId,
- AMQSession session, AMQProtocolHandler protocolHandler, long producerId, boolean immediate, boolean mandatory,
- boolean waitUntilSent)
- {
- _connection = connection;
- _destination = destination;
- _transacted = transacted;
- _protocolHandler = protocolHandler;
- _channelId = channelId;
- _session = session;
- _producerId = producerId;
- if (destination != null && !(destination instanceof AMQUndefinedDestination))
- {
- declareDestination(destination);
- }
-
- _immediate = immediate;
- _mandatory = mandatory;
- _waitUntilSent = waitUntilSent;
- _userID = connection.getUsername();
- }
-
- void resubscribe() throws AMQException
- {
- if (_destination != null && !(_destination instanceof AMQUndefinedDestination))
- {
- declareDestination(_destination);
- }
- }
-
- abstract void declareDestination(AMQDestination destination);
-
- public void setDisableMessageID(boolean b) throws JMSException
- {
- checkPreConditions();
- checkNotClosed();
- _disableMessageId = b;
- }
-
- public boolean getDisableMessageID() throws JMSException
- {
- checkNotClosed();
-
- return _disableMessageId;
- }
-
- public void setDisableMessageTimestamp(boolean b) throws JMSException
- {
- checkPreConditions();
- _disableTimestamps = b;
- }
-
- public boolean getDisableMessageTimestamp() throws JMSException
- {
- checkNotClosed();
-
- return _disableTimestamps;
- }
-
- public void setDeliveryMode(int i) throws JMSException
- {
- checkPreConditions();
- if ((i != DeliveryMode.NON_PERSISTENT) && (i != DeliveryMode.PERSISTENT))
- {
- throw new JMSException("DeliveryMode must be either NON_PERSISTENT or PERSISTENT. Value of " + i
- + " is illegal");
- }
-
- _deliveryMode = i;
- }
-
- public int getDeliveryMode() throws JMSException
- {
- checkNotClosed();
-
- return _deliveryMode;
- }
-
- public void setPriority(int i) throws JMSException
- {
- checkPreConditions();
- if ((i < 0) || (i > 9))
- {
- throw new IllegalArgumentException("Priority of " + i + " is illegal. Value must be in range 0 to 9");
- }
-
- _messagePriority = i;
- }
-
- public int getPriority() throws JMSException
- {
- checkNotClosed();
-
- return _messagePriority;
- }
-
- public void setTimeToLive(long l) throws JMSException
- {
- checkPreConditions();
- if (l < 0)
- {
- throw new IllegalArgumentException("Time to live must be non-negative - supplied value was " + l);
- }
-
- _timeToLive = l;
- }
-
- public long getTimeToLive() throws JMSException
- {
- checkNotClosed();
-
- return _timeToLive;
- }
-
- public Destination getDestination() throws JMSException
- {
- checkNotClosed();
-
- return _destination;
- }
-
- public void close() throws JMSException
- {
- _closed.set(true);
- _session.deregisterProducer(_producerId);
- }
-
- public void send(Message message) throws JMSException
- {
- checkPreConditions();
- checkInitialDestination();
-
- synchronized (_connection.getFailoverMutex())
- {
- sendImpl(_destination, message, _deliveryMode, _messagePriority, _timeToLive, _mandatory, _immediate);
- }
- }
-
- public void send(Message message, int deliveryMode) throws JMSException
- {
- checkPreConditions();
- checkInitialDestination();
-
- synchronized (_connection.getFailoverMutex())
- {
- sendImpl(_destination, message, deliveryMode, _messagePriority, _timeToLive, _mandatory, _immediate);
- }
- }
-
- public void send(Message message, int deliveryMode, boolean immediate) throws JMSException
- {
- checkPreConditions();
- checkInitialDestination();
- synchronized (_connection.getFailoverMutex())
- {
- sendImpl(_destination, message, deliveryMode, _messagePriority, _timeToLive, _mandatory, immediate);
- }
- }
-
- public void send(Message message, int deliveryMode, int priority, long timeToLive) throws JMSException
- {
- checkPreConditions();
- checkInitialDestination();
- synchronized (_connection.getFailoverMutex())
- {
- sendImpl(_destination, message, deliveryMode, priority, timeToLive, _mandatory, _immediate);
- }
- }
-
- public void send(Destination destination, Message message) throws JMSException
- {
- checkPreConditions();
- checkDestination(destination);
- synchronized (_connection.getFailoverMutex())
- {
- validateDestination(destination);
- sendImpl((AMQDestination) destination, message, _deliveryMode, _messagePriority, _timeToLive, _mandatory,
- _immediate);
- }
- }
-
- public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive)
- throws JMSException
- {
- checkPreConditions();
- checkDestination(destination);
- synchronized (_connection.getFailoverMutex())
- {
- validateDestination(destination);
- sendImpl((AMQDestination) destination, message, deliveryMode, priority, timeToLive, _mandatory, _immediate);
- }
- }
-
- public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive,
- boolean mandatory) throws JMSException
- {
- checkPreConditions();
- checkDestination(destination);
- synchronized (_connection.getFailoverMutex())
- {
- validateDestination(destination);
- sendImpl((AMQDestination) destination, message, deliveryMode, priority, timeToLive, mandatory, _immediate);
- }
- }
-
- public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive,
- boolean mandatory, boolean immediate) throws JMSException
- {
- checkPreConditions();
- checkDestination(destination);
- synchronized (_connection.getFailoverMutex())
- {
- validateDestination(destination);
- sendImpl((AMQDestination) destination, message, deliveryMode, priority, timeToLive, mandatory, immediate);
- }
- }
-
- public void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive,
- boolean mandatory, boolean immediate, boolean waitUntilSent) throws JMSException
- {
- checkPreConditions();
- checkDestination(destination);
- synchronized (_connection.getFailoverMutex())
- {
- validateDestination(destination);
- sendImpl((AMQDestination) destination, message, deliveryMode, priority, timeToLive, mandatory, immediate,
- waitUntilSent);
- }
- }
-
- private AbstractJMSMessage convertToNativeMessage(Message message) throws JMSException
- {
- if (message instanceof AbstractJMSMessage)
- {
- return (AbstractJMSMessage) message;
- }
- else
- {
- AbstractJMSMessage newMessage;
-
- if (message instanceof BytesMessage)
- {
- newMessage = new MessageConverter(_session, (BytesMessage) message).getConvertedMessage();
- }
- else if (message instanceof MapMessage)
- {
- newMessage = new MessageConverter(_session, (MapMessage) message).getConvertedMessage();
- }
- else if (message instanceof ObjectMessage)
- {
- newMessage = new MessageConverter(_session, (ObjectMessage) message).getConvertedMessage();
- }
- else if (message instanceof TextMessage)
- {
- newMessage = new MessageConverter(_session, (TextMessage) message).getConvertedMessage();
- }
- else if (message instanceof StreamMessage)
- {
- newMessage = new MessageConverter(_session, (StreamMessage) message).getConvertedMessage();
- }
- else
- {
- newMessage = new MessageConverter(_session, message).getConvertedMessage();
- }
-
- if (newMessage != null)
- {
- return newMessage;
- }
- else
- {
- throw new JMSException("Unable to send message, due to class conversion error: "
- + message.getClass().getName());
- }
- }
- }
-
- private void validateDestination(Destination destination) throws JMSException
- {
- if (!(destination instanceof AMQDestination))
- {
- throw new JMSException("Unsupported destination class: "
- + ((destination != null) ? destination.getClass() : null));
- }
-
- AMQDestination amqDestination = (AMQDestination) destination;
- if(!amqDestination.isExchangeExistsChecked())
- {
- declareDestination(amqDestination);
- amqDestination.setExchangeExistsChecked(true);
- }
- }
-
- protected void sendImpl(AMQDestination destination, Message message, int deliveryMode, int priority, long timeToLive,
- boolean mandatory, boolean immediate) throws JMSException
- {
- sendImpl(destination, message, deliveryMode, priority, timeToLive, mandatory, immediate, _waitUntilSent);
- }
-
- /**
- * The caller of this method must hold the failover mutex.
- *
- * @param destination
- * @param origMessage
- * @param deliveryMode
- * @param priority
- * @param timeToLive
- * @param mandatory
- * @param immediate
- *
- * @throws JMSException
- */
- protected void sendImpl(AMQDestination destination, Message origMessage, int deliveryMode, int priority, long timeToLive,
- boolean mandatory, boolean immediate, boolean wait) throws JMSException
- {
- checkTemporaryDestination(destination);
- origMessage.setJMSDestination(destination);
-
- AbstractJMSMessage message = convertToNativeMessage(origMessage);
-
- if (_transacted)
- {
- if (_session.hasFailedOver() && _session.isDirty())
- {
- throw new JMSAMQException("Failover has occurred and session is dirty so unable to send.",
- new AMQSessionDirtyException("Failover has occurred and session is dirty " +
- "so unable to send."));
- }
- }
-
- UUID messageId = null;
- if (_disableMessageId)
- {
- message.setJMSMessageID((UUID)null);
- }
- else
- {
- messageId = _messageIdGenerator.generate();
- message.setJMSMessageID(messageId);
- }
-
- sendMessage(destination, origMessage, message, messageId, deliveryMode, priority, timeToLive, mandatory, immediate, wait);
-
- if (message != origMessage)
- {
- _logger.debug("Updating original message");
- origMessage.setJMSPriority(message.getJMSPriority());
- origMessage.setJMSTimestamp(message.getJMSTimestamp());
- _logger.debug("Setting JMSExpiration:" + message.getJMSExpiration());
- origMessage.setJMSExpiration(message.getJMSExpiration());
- origMessage.setJMSMessageID(message.getJMSMessageID());
- }
-
- if (_transacted)
- {
- _session.markDirty();
- }
- }
-
- abstract void sendMessage(AMQDestination destination, Message origMessage, AbstractJMSMessage message,
- UUID messageId, int deliveryMode, int priority, long timeToLive, boolean mandatory,
- boolean immediate, boolean wait) throws JMSException;
-
- private void checkTemporaryDestination(AMQDestination destination) throws JMSException
- {
- if (destination instanceof TemporaryDestination)
- {
- _logger.debug("destination is temporary destination");
- TemporaryDestination tempDest = (TemporaryDestination) destination;
- if (tempDest.getSession().isClosed())
- {
- _logger.debug("session is closed");
- throw new JMSException("Session for temporary destination has been closed");
- }
-
- if (tempDest.isDeleted())
- {
- _logger.debug("destination is deleted");
- throw new JMSException("Cannot send to a deleted temporary destination");
- }
- }
- }
-
- public void setMimeType(String mimeType) throws JMSException
- {
- checkNotClosed();
- _mimeType = mimeType;
- }
-
- public void setEncoding(String encoding) throws JMSException, UnsupportedEncodingException
- {
- checkNotClosed();
- _encoding = encoding;
- }
-
- private void checkPreConditions() throws javax.jms.IllegalStateException, JMSException
- {
- checkNotClosed();
-
- if ((_session == null) || _session.isClosed())
- {
- throw new javax.jms.IllegalStateException("Invalid Session");
- }
- }
-
- private void checkInitialDestination()
- {
- if (_destination == null)
- {
- throw new UnsupportedOperationException("Destination is null");
- }
- }
-
- private void checkDestination(Destination suppliedDestination) throws InvalidDestinationException
- {
- if ((_destination != null) && (suppliedDestination != null))
- {
- throw new UnsupportedOperationException(
- "This message producer was created with a Destination, therefore you cannot use an unidentified Destination");
- }
-
- if (suppliedDestination == null)
- {
- throw new InvalidDestinationException("Supplied Destination was invalid");
- }
-
- }
-
- public AMQSession getSession()
- {
- return _session;
- }
-
- public boolean isBound(AMQDestination destination) throws JMSException
- {
- return _session.isQueueBound(destination.getExchangeName(), null, destination.getRoutingKey());
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
deleted file mode 100644
index 4e5077f0cd..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
+++ /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.
- */
-package org.apache.qpid.client;
-
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-import java.nio.ByteBuffer;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.DeliveryMode;
-
-import org.apache.qpid.client.message.AbstractJMSMessage;
-import org.apache.qpid.client.message.FiledTableSupport;
-import org.apache.qpid.client.message.AMQMessageDelegate_0_10;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.qpid.util.Strings;
-import org.apache.qpid.njms.ExceptionHelper;
-import org.apache.qpid.transport.*;
-import static org.apache.qpid.transport.Option.*;
-
-/**
- * This is a 0_10 message producer.
- */
-public class BasicMessageProducer_0_10 extends BasicMessageProducer
-{
- private byte[] userIDBytes;
-
- BasicMessageProducer_0_10(AMQConnection connection, AMQDestination destination, boolean transacted, int channelId,
- AMQSession session, AMQProtocolHandler protocolHandler, long producerId,
- boolean immediate, boolean mandatory, boolean waitUntilSent)
- {
- super(connection, destination, transacted, channelId, session, protocolHandler, producerId, immediate,
- mandatory, waitUntilSent);
-
- userIDBytes = Strings.toUTF8(_userID);
- }
-
- void declareDestination(AMQDestination destination)
- {
- ((AMQSession_0_10) getSession()).getQpidSession().exchangeDeclare(destination.getExchangeName().toString(),
- destination.getExchangeClass().toString(),
- null, null);
- }
-
- //--- Overwritten methods
-
- /**
- * Sends a message to a given destination
- */
- void sendMessage(AMQDestination destination, Message origMessage, AbstractJMSMessage message,
- UUID messageId, int deliveryMode, int priority, long timeToLive, boolean mandatory,
- boolean immediate, boolean wait) throws JMSException
- {
- message.prepareForSending();
-
- AMQMessageDelegate_0_10 delegate = (AMQMessageDelegate_0_10) message.getDelegate();
-
- DeliveryProperties deliveryProp = delegate.getDeliveryProperties();
- MessageProperties messageProps = delegate.getMessageProperties();
-
- // On the receiving side, this will be read in to the JMSXUserID as well.
- messageProps.setUserId(userIDBytes);
-
- if (messageId != null)
- {
- messageProps.setMessageId(messageId);
- }
- else if (messageProps.hasMessageId())
- {
- messageProps.clearMessageId();
- }
-
- if (!_disableTimestamps)
- {
- final long currentTime = System.currentTimeMillis();
- deliveryProp.setTimestamp(currentTime);
- if (timeToLive > 0)
- {
- deliveryProp.setExpiration(currentTime + timeToLive);
- message.setJMSExpiration(currentTime + timeToLive);
- }
- else
- {
- deliveryProp.setExpiration(0);
- message.setJMSExpiration(0);
- }
- message.setJMSTimestamp(currentTime);
- }
-
- if (!deliveryProp.hasDeliveryMode() || deliveryProp.getDeliveryMode().getValue() != deliveryMode)
- {
- MessageDeliveryMode mode;
- switch (deliveryMode)
- {
- case DeliveryMode.PERSISTENT:
- mode = MessageDeliveryMode.PERSISTENT;
- break;
- case DeliveryMode.NON_PERSISTENT:
- mode = MessageDeliveryMode.NON_PERSISTENT;
- break;
- default:
- throw new IllegalArgumentException("illegal delivery mode: " + deliveryMode);
- }
- deliveryProp.setDeliveryMode(mode);
- message.setJMSDeliveryMode(deliveryMode);
- }
- if (!deliveryProp.hasPriority() || deliveryProp.getPriority().getValue() != priority)
- {
- deliveryProp.setPriority(MessageDeliveryPriority.get((short) priority));
- message.setJMSPriority(priority);
- }
- String exchangeName = destination.getExchangeName().toString();
- if ( deliveryProp.getExchange() == null || ! deliveryProp.getExchange().equals(exchangeName))
- {
- deliveryProp.setExchange(exchangeName);
- }
- String routingKey = destination.getRoutingKey().toString();
- if (deliveryProp.getRoutingKey() == null || ! deliveryProp.getRoutingKey().equals(routingKey))
- {
- deliveryProp.setRoutingKey(routingKey);
- }
-
- messageProps.setContentLength(message.getContentLength());
-
- // send the message
- try
- {
- org.apache.qpid.transport.Session ssn = (org.apache.qpid.transport.Session)
- ((AMQSession_0_10) getSession()).getQpidSession();
-
- // if true, we need to sync the delivery of this message
- boolean sync = (deliveryMode == DeliveryMode.PERSISTENT &&
- getSession().getAMQConnection().getSyncPersistence());
-
- org.apache.mina.common.ByteBuffer data = message.getData();
- ByteBuffer buffer = data == null ? ByteBuffer.allocate(0) : data.buf().slice();
-
- ssn.messageTransfer(destination.getExchangeName().toString(), MessageAcceptMode.NONE,
- MessageAcquireMode.PRE_ACQUIRED,
- new Header(deliveryProp, messageProps),
- buffer, sync ? SYNC : NONE);
- if (sync)
- {
- ssn.sync();
- }
-
-
- }
- catch (RuntimeException rte)
- {
- JMSException ex = new JMSException("Exception when sending message");
- rte.printStackTrace();
- ex.setLinkedException(rte);
- throw ex;
- }
- }
-
-
- public boolean isBound(AMQDestination destination) throws JMSException
- {
- return _session.isQueueBound(destination);
- }
-}
-
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_8.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_8.java
deleted file mode 100644
index 048065eac9..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_8.java
+++ /dev/null
@@ -1,207 +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.
- *
- */
-package org.apache.qpid.client;
-
-import java.util.UUID;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-import org.apache.qpid.client.message.AMQMessageDelegate;
-import org.apache.qpid.client.message.AMQMessageDelegate_0_8;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.BasicConsumeBody;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.CompositeAMQDataBlock;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.ExchangeDeclareBody;
-
-public class BasicMessageProducer_0_8 extends BasicMessageProducer
-{
-
- BasicMessageProducer_0_8(AMQConnection connection, AMQDestination destination, boolean transacted, int channelId,
- AMQSession session, AMQProtocolHandler protocolHandler, long producerId, boolean immediate, boolean mandatory,
- boolean waitUntilSent)
- {
- super(connection, destination,transacted,channelId,session, protocolHandler, producerId, immediate, mandatory,waitUntilSent);
- }
-
- void declareDestination(AMQDestination destination)
- {
-
- ExchangeDeclareBody body = getSession().getMethodRegistry().createExchangeDeclareBody(_session.getTicket(),
- destination.getExchangeName(),
- destination.getExchangeClass(),
- false,
- false,
- false,
- false,
- true,
- null);
- // Declare the exchange
- // Note that the durable and internal arguments are ignored since passive is set to false
-
- AMQFrame declare = body.generateFrame(_channelId);
-
- _protocolHandler.writeFrame(declare);
- }
-
- void sendMessage(AMQDestination destination, Message origMessage, AbstractJMSMessage message,
- UUID messageId, int deliveryMode,int priority, long timeToLive, boolean mandatory,
- boolean immediate, boolean wait) throws JMSException
- {
- BasicPublishBody body = getSession().getMethodRegistry().createBasicPublishBody(_session.getTicket(),
- destination.getExchangeName(),
- destination.getRoutingKey(),
- mandatory,
- immediate);
-
- AMQFrame publishFrame = body.generateFrame(_channelId);
-
- message.prepareForSending();
- ByteBuffer payload = message.getData();
- AMQMessageDelegate_0_8 delegate = (AMQMessageDelegate_0_8) message.getDelegate();
- BasicContentHeaderProperties contentHeaderProperties = delegate.getContentHeaderProperties();
-
- contentHeaderProperties.setUserId(_userID);
-
- if (!_disableTimestamps)
- {
- final long currentTime = System.currentTimeMillis();
- contentHeaderProperties.setTimestamp(currentTime);
-
- if (timeToLive > 0)
- {
- contentHeaderProperties.setExpiration(currentTime + timeToLive);
- }
- else
- {
- contentHeaderProperties.setExpiration(0);
- }
- }
-
- contentHeaderProperties.setDeliveryMode((byte) deliveryMode);
- contentHeaderProperties.setPriority((byte) priority);
-
- final int size = (payload != null) ? payload.limit() : 0;
- final int contentBodyFrameCount = calculateContentBodyFrameCount(payload);
- final AMQFrame[] frames = new AMQFrame[2 + contentBodyFrameCount];
-
- if (payload != null)
- {
- createContentBodies(payload, frames, 2, _channelId);
- }
-
- if ((contentBodyFrameCount != 0) && _logger.isDebugEnabled())
- {
- _logger.debug("Sending content body frames to " + destination);
- }
-
-
- // TODO: This is a hacky way of getting the AMQP class-id for the Basic class
- int classIfForBasic = getSession().getMethodRegistry().createBasicQosOkBody().getClazz();
-
- AMQFrame contentHeaderFrame =
- ContentHeaderBody.createAMQFrame(_channelId,
- classIfForBasic, 0, contentHeaderProperties, size);
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Sending content header frame to " + destination);
- }
-
- frames[0] = publishFrame;
- frames[1] = contentHeaderFrame;
- CompositeAMQDataBlock compositeFrame = new CompositeAMQDataBlock(frames);
-
- try
- {
- _session.checkFlowControl();
- }
- catch (InterruptedException e)
- {
- JMSException jmsEx = new JMSException("Interrupted while waiting for flow control to be removed");
- jmsEx.setLinkedException(e);
- throw jmsEx;
- }
-
- _protocolHandler.writeFrame(compositeFrame, wait);
- }
-
- /**
- * Create content bodies. This will split a large message into numerous bodies depending on the negotiated
- * maximum frame size.
- *
- * @param payload
- * @param frames
- * @param offset
- * @param channelId @return the array of content bodies
- */
- private void createContentBodies(ByteBuffer payload, AMQFrame[] frames, int offset, int channelId)
- {
-
- if (frames.length == (offset + 1))
- {
- frames[offset] = ContentBody.createAMQFrame(channelId, new ContentBody(payload));
- }
- else
- {
-
- final long framePayloadMax = _session.getAMQConnection().getMaximumFrameSize() - 1;
- long remaining = payload.remaining();
- for (int i = offset; i < frames.length; i++)
- {
- payload.position((int) framePayloadMax * (i - offset));
- int length = (remaining >= framePayloadMax) ? (int) framePayloadMax : (int) remaining;
- payload.limit(payload.position() + length);
- frames[i] = ContentBody.createAMQFrame(channelId, new ContentBody(payload.slice()));
-
- remaining -= length;
- }
- }
-
- }
-
- private int calculateContentBodyFrameCount(ByteBuffer payload)
- {
- // we substract one from the total frame maximum size to account for the end of frame marker in a body frame
- // (0xCE byte).
- int frameCount;
- if ((payload == null) || (payload.remaining() == 0))
- {
- frameCount = 0;
- }
- else
- {
- int dataLength = payload.remaining();
- final long framePayloadMax = _session.getAMQConnection().getMaximumFrameSize() - 1;
- int lastFrame = ((dataLength % framePayloadMax) > 0) ? 1 : 0;
- frameCount = (int) (dataLength / framePayloadMax) + lastFrame;
- }
-
- return frameCount;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/Closeable.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/Closeable.java
deleted file mode 100644
index 7e119343a1..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/Closeable.java
+++ /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.
- *
- */
-package org.apache.qpid.client;
-
-import javax.jms.IllegalStateException;
-import javax.jms.JMSException;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * Captures the 'closed' state of an object, that is initially open, can be tested to see if it is closed, and provides
- * a 'close' method to close it.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Mark an object as closed.
- * <tr><td> Check if an object is closed.
- * <tr><td> Raise a JMS exception if an object is closed.
- * </table>
- *
- * @todo Might be better to make this an interface. This whole class doesn't really encapsulate a terribly neat
- * piece of re-usable functionality. A simple interface defining a close method would suffice.
- *
- * @todo The convenience method {@link #checkNotClosed} is not that helpfull, what if the caller wants to do something
- * other than throw an exception? It doesn't really represent a very usefull re-usable piece of code. Consider
- * inlining it and dropping the method.
- */
-public abstract class Closeable
-{
- /**
- * We use an atomic boolean so that we do not have to synchronized access to this flag. Synchronizing access to this
- * flag would mean have a synchronized block in every method.
- */
- protected final AtomicBoolean _closed = new AtomicBoolean(false);
-
- /**
- * Checks if this is closed, and raises a JMSException if it is.
- *
- * @throws JMSException If this is closed.
- */
- protected void checkNotClosed() throws JMSException
- {
- if (isClosed())
- {
- throw new IllegalStateException("Object " + toString() + " has been closed");
- }
- }
-
- /**
- * Checks if this is closed.
- *
- * @return <tt>true</tt> if this is closed, <tt>false</tt> otherwise.
- */
- public boolean isClosed()
- {
- return _closed.get();
- }
-
- /**
- * Closes this object.
- *
- * @throws JMSException If this cannot be closed for any reason.
- */
- public abstract void close() throws JMSException;
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/ConnectionTuneParameters.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/ConnectionTuneParameters.java
deleted file mode 100644
index b1ec7216bc..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/ConnectionTuneParameters.java
+++ /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.
- *
- */
-package org.apache.qpid.client;
-
-public class ConnectionTuneParameters
-{
- private long _frameMax;
-
- private int _channelMax;
-
- private int _heartbeat;
-
- private long _txnLimit;
-
- public long getFrameMax()
- {
- return _frameMax;
- }
-
- public void setFrameMax(long frameMax)
- {
- _frameMax = frameMax;
- }
-
- public int getChannelMax()
- {
- return _channelMax;
- }
-
- public void setChannelMax(int channelMax)
- {
- _channelMax = channelMax;
- }
-
- public int getHeartbeat()
- {
- return _heartbeat;
- }
-
- public void setHeartbeat(int hearbeat)
- {
- _heartbeat = hearbeat;
- }
-
- public long getTxnLimit()
- {
- return _txnLimit;
- }
-
- public void setTxnLimit(long txnLimit)
- {
- _txnLimit = txnLimit;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java
deleted file mode 100644
index 7cc548915c..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java
+++ /dev/null
@@ -1,66 +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.
- *
- */
-package org.apache.qpid.client;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-
-import org.apache.qpid.framing.AMQShortString;
-
-public enum CustomJMSXProperty
-{
- JMS_AMQP_NULL,
- JMS_QPID_DESTTYPE,
- JMSXGroupID,
- JMSXGroupSeq,
- JMSXUserID;
-
-
- private final AMQShortString _nameAsShortString;
-
- CustomJMSXProperty()
- {
- _nameAsShortString = new AMQShortString(toString());
- }
-
- public AMQShortString getShortStringName()
- {
- return _nameAsShortString;
- }
-
- private static Enumeration _names;
-
- public static synchronized Enumeration asEnumeration()
- {
- if(_names == null)
- {
- CustomJMSXProperty[] properties = values();
- ArrayList<String> nameList = new ArrayList<String>(properties.length);
- for(CustomJMSXProperty property : properties)
- {
- nameList.add(property.toString());
- }
- _names = Collections.enumeration(nameList);
- }
- return _names;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/DispatcherCallback.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/DispatcherCallback.java
deleted file mode 100644
index 81a55006ed..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/DispatcherCallback.java
+++ /dev/null
@@ -1,36 +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.
- *
- *
- */
-package org.apache.qpid.client;
-
-import java.util.Queue;
-
-public abstract class DispatcherCallback
-{
- BasicMessageConsumer _consumer;
-
- public DispatcherCallback(BasicMessageConsumer mc)
- {
- _consumer = mc;
- }
-
- abstract public void whilePaused(Queue<MessageConsumerPair> reprocessQueue);
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/JMSAMQException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/JMSAMQException.java
deleted file mode 100644
index 0927ca3625..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/JMSAMQException.java
+++ /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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.AMQException;
-
-import javax.jms.JMSException;
-
-/**
- * JMSException does not accept wrapped exceptions in its constructor. Presumably this is because it is a relatively old
- * Java exception class, before this was added as a default to Throwable. This exception class accepts wrapped exceptions
- * as well as error messages, through its constructor, but is a JMSException.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Accept wrapped exceptions as a JMSException.
- * </table>
- */
-public class JMSAMQException extends JMSException
-{
- /**
- * Creates a JMSException, wrapping another exception class.
- *
- * @param message The error message.
- * @param cause The underlying exception that caused this one. May be null if none is to be set.
- */
- public JMSAMQException(String message, Exception cause)
- {
- super(message);
-
- if (cause != null)
- {
- setLinkedException(cause);
- }
- }
-
- /**
- * @param s The underlying exception.
- *
- * @deprecated Use the other constructor and write a helpfull message. This one will be deleted.
- */
- public JMSAMQException(AMQException s)
- {
- super(s.getMessage(), String.valueOf(s.getErrorCode()));
- setLinkedException(s);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/JmsNotImplementedException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/JmsNotImplementedException.java
deleted file mode 100644
index 903514c35f..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/JmsNotImplementedException.java
+++ /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.
- *
- */
-package org.apache.qpid.client;
-
-import javax.jms.JMSException;
-
-public class JmsNotImplementedException extends JMSException
-{
- public JmsNotImplementedException()
- {
- super("Not implemented");
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/MessageConsumerPair.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/MessageConsumerPair.java
deleted file mode 100644
index 585d6db3fd..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/MessageConsumerPair.java
+++ /dev/null
@@ -1,43 +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.
- *
- *
- */
-package org.apache.qpid.client;
-
-public class MessageConsumerPair
-{
- BasicMessageConsumer _consumer;
- Object _item;
-
- public MessageConsumerPair(BasicMessageConsumer consumer, Object item)
- {
- _consumer = consumer;
- _item = item;
- }
-
- public BasicMessageConsumer getConsumer()
- {
- return _consumer;
- }
-
- public Object getItem()
- {
- return _item;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java
deleted file mode 100644
index 3bb5707417..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java
+++ /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.
- *
- */
-package org.apache.qpid.client;
-
-import java.util.Enumeration;
-
-import javax.jms.ConnectionMetaData;
-import javax.jms.JMSException;
-
-import org.apache.qpid.common.QpidProperties;
-
-public class QpidConnectionMetaData implements ConnectionMetaData
-{
-
-
- QpidConnectionMetaData(AMQConnection conn)
- {
- }
-
- public int getJMSMajorVersion() throws JMSException
- {
- return 1;
- }
-
- public int getJMSMinorVersion() throws JMSException
- {
- return 1;
- }
-
- public String getJMSProviderName() throws JMSException
- {
- return "Apache " + QpidProperties.getProductName();
- }
-
- public String getJMSVersion() throws JMSException
- {
- return "1.1";
- }
-
- public Enumeration getJMSXPropertyNames() throws JMSException
- {
- return CustomJMSXProperty.asEnumeration();
- }
-
- public int getProviderMajorVersion() throws JMSException
- {
- return 0;
- }
-
- public int getProviderMinorVersion() throws JMSException
- {
- return 8;
- }
-
- public String getProviderVersion() throws JMSException
- {
- return QpidProperties.getProductName() + " (Client: [" + getClientVersion() + "] ; Broker [" + getBrokerVersion() + "] ; Protocol: [ "
- + getProtocolVersion() + "] )";
- }
-
- private String getProtocolVersion()
- {
- // TODO - Implement based on connection negotiated protocol
- return "0.8";
- }
-
- public String getBrokerVersion()
- {
- // TODO - get broker version
- return "<unkown>";
- }
-
- public String getClientVersion()
- {
- return QpidProperties.getBuildVersion();
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QueueReceiverAdaptor.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QueueReceiverAdaptor.java
deleted file mode 100644
index 7059588367..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QueueReceiverAdaptor.java
+++ /dev/null
@@ -1,115 +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.
- *
- */
-package org.apache.qpid.client;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.Queue;
-import javax.jms.QueueReceiver;
-
-/**
- * Class that wraps a MessageConsumer for backwards JMS compatibility
- * Returned by methods in AMQSession etc
- */
-public class QueueReceiverAdaptor implements QueueReceiver {
-
- protected MessageConsumer _consumer;
- protected Queue _queue;
-
- protected QueueReceiverAdaptor(Queue queue, MessageConsumer consumer)
- {
- _consumer = consumer;
- _queue = queue;
- }
-
- public String getMessageSelector() throws JMSException
- {
- checkPreConditions();
- return _consumer.getMessageSelector();
- }
-
- public MessageListener getMessageListener() throws JMSException
- {
- checkPreConditions();
- return _consumer.getMessageListener();
- }
-
- public void setMessageListener(MessageListener messageListener) throws JMSException
- {
- checkPreConditions();
- _consumer.setMessageListener(messageListener);
- }
-
- public Message receive() throws JMSException
- {
- checkPreConditions();
- return _consumer.receive();
- }
-
- public Message receive(long l) throws JMSException
- {
- checkPreConditions();
- return _consumer.receive(l);
- }
-
- public Message receiveNoWait() throws JMSException
- {
- checkPreConditions();
- return _consumer.receiveNoWait();
- }
-
- public void close() throws JMSException
- {
- _consumer.close();
- }
-
- /**
- * Return the queue associated with this receiver
- * @return
- * @throws JMSException
- */
- public Queue getQueue() throws JMSException
- {
- checkPreConditions();
- return _queue;
- }
-
- private void checkPreConditions() throws javax.jms.IllegalStateException {
- BasicMessageConsumer msgConsumer = (BasicMessageConsumer)_consumer;
-
- if (msgConsumer.isClosed() ){
- throw new javax.jms.IllegalStateException("Consumer is closed");
- }
-
- if(_queue == null){
- throw new UnsupportedOperationException("Queue is null");
- }
-
- AMQSession session = msgConsumer.getSession();
-
- if(session == null || session.isClosed()){
- throw new javax.jms.IllegalStateException("Invalid Session");
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.java
deleted file mode 100644
index 27783bcacf..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.java
+++ /dev/null
@@ -1,228 +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.
- *
- *
- */
-
-package org.apache.qpid.client;
-
-import javax.jms.Destination;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Queue;
-import javax.jms.QueueSender;
-
-public class QueueSenderAdapter implements QueueSender
-{
-
- private BasicMessageProducer _delegate;
- private Queue _queue;
- private boolean closed = false;
-
- public QueueSenderAdapter(BasicMessageProducer msgProducer, Queue queue)
- {
- _delegate = msgProducer;
- _queue = queue;
- }
-
- public Queue getQueue() throws JMSException
- {
- checkPreConditions();
-
- return _queue;
- }
-
- public void send(Message msg) throws JMSException
- {
- checkPreConditions();
- _delegate.send(msg);
- }
-
- public void send(Queue queue, Message msg) throws JMSException
- {
- checkPreConditions(queue);
- _delegate.send(queue, msg);
- }
-
- public void publish(Message msg, int deliveryMode, int priority, long timeToLive) throws JMSException
- {
- checkPreConditions();
- _delegate.send(msg, deliveryMode, priority, timeToLive);
- }
-
- public void send(Queue queue, Message msg, int deliveryMode, int priority, long timeToLive) throws JMSException
- {
- checkPreConditions(queue);
- _delegate.send(queue, msg, deliveryMode, priority, timeToLive);
- }
-
- public void close() throws JMSException
- {
- _delegate.close();
- closed = true;
- }
-
- public int getDeliveryMode() throws JMSException
- {
- checkPreConditions();
-
- return _delegate.getDeliveryMode();
- }
-
- public Destination getDestination() throws JMSException
- {
- checkPreConditions();
-
- return _delegate.getDestination();
- }
-
- public boolean getDisableMessageID() throws JMSException
- {
- checkPreConditions();
-
- return _delegate.getDisableMessageID();
- }
-
- public boolean getDisableMessageTimestamp() throws JMSException
- {
- checkPreConditions();
-
- return _delegate.getDisableMessageTimestamp();
- }
-
- public int getPriority() throws JMSException
- {
- checkPreConditions();
-
- return _delegate.getPriority();
- }
-
- public long getTimeToLive() throws JMSException
- {
- checkPreConditions();
-
- return _delegate.getTimeToLive();
- }
-
- public void send(Destination dest, Message msg) throws JMSException
- {
- checkPreConditions((Queue) dest);
- _delegate.send(dest, msg);
- }
-
- public void send(Message msg, int deliveryMode, int priority, long timeToLive) throws JMSException
- {
- checkPreConditions();
- _delegate.send(msg, deliveryMode, priority, timeToLive);
- }
-
- public void send(Destination dest, Message msg, int deliveryMode, int priority, long timeToLive) throws JMSException
- {
- checkPreConditions((Queue) dest);
- _delegate.send(dest, msg, deliveryMode, priority, timeToLive);
- }
-
- public void setDeliveryMode(int deliveryMode) throws JMSException
- {
- checkPreConditions();
- _delegate.setDeliveryMode(deliveryMode);
- }
-
- public void setDisableMessageID(boolean disableMessageID) throws JMSException
- {
- checkPreConditions();
- _delegate.setDisableMessageID(disableMessageID);
- }
-
- public void setDisableMessageTimestamp(boolean disableMessageTimestamp) throws JMSException
- {
- checkPreConditions();
- _delegate.setDisableMessageTimestamp(disableMessageTimestamp);
- }
-
- public void setPriority(int priority) throws JMSException
- {
- checkPreConditions();
- _delegate.setPriority(priority);
- }
-
- public void setTimeToLive(long timeToLive) throws JMSException
- {
- checkPreConditions();
- _delegate.setTimeToLive(timeToLive);
- }
-
- private void checkPreConditions() throws JMSException
- {
- checkPreConditions(_queue);
- }
-
- private void checkPreConditions(Queue queue) throws JMSException
- {
- if (closed)
- {
- throw new javax.jms.IllegalStateException("Publisher is closed");
- }
-
- AMQSession session = ((BasicMessageProducer) _delegate).getSession();
-
- if ((session == null) || session.isClosed())
- {
- throw new javax.jms.IllegalStateException("Invalid Session");
- }
-
- if (queue == null)
- {
- throw new UnsupportedOperationException("Queue is null.");
- }
-
- if (!(queue instanceof AMQDestination))
- {
- throw new InvalidDestinationException("Queue: " + queue + " is not a valid Qpid queue");
- }
-
- AMQDestination destination = (AMQDestination) queue;
- if (!destination.isCheckedForQueueBinding() && checkQueueBeforePublish())
- {
-
- if (_delegate.getSession().isStrictAMQP())
- {
- _delegate._logger.warn("AMQP does not support destination validation before publish, ");
- destination.setCheckedForQueueBinding(true);
- }
- else
- {
- if (_delegate.isBound(destination))
- {
- destination.setCheckedForQueueBinding(true);
- }
- else
- {
- throw new InvalidDestinationException("Queue: " + queue
- + " is not a valid destination (no bindings on server");
- }
- }
- }
- }
-
- private boolean checkQueueBeforePublish()
- {
- return "true".equalsIgnoreCase(System.getProperty("org.apache.qpid.client.verifyQueueBindingBeforePublish", "true"));
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/SSLConfiguration.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/SSLConfiguration.java
deleted file mode 100644
index 2280cc9870..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/SSLConfiguration.java
+++ /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.
- *
- */
-
-package org.apache.qpid.client;
-
-public class SSLConfiguration {
-
- private String _keystorePath;
-
- private String _keystorePassword;
-
- private String _certType = "SunX509";
-
- public void setKeystorePath(String path)
- {
- _keystorePath = path;
- }
-
- public String getKeystorePath()
- {
- return _keystorePath;
- }
-
- public void setKeystorePassword(String password)
- {
- _keystorePassword = password;
- }
-
- public String getKeystorePassword()
- {
- return _keystorePassword;
- }
-
- public void setCertType(String type)
- {
- _certType = type;
- }
-
- public String getCertType()
- {
- return _certType;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TemporaryDestination.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TemporaryDestination.java
deleted file mode 100644
index 7f8e80c73a..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TemporaryDestination.java
+++ /dev/null
@@ -1,38 +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.
- *
- *
- */
-
-package org.apache.qpid.client;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-
-/**
- * Provides support for covenience interface implemented by both AMQTemporaryTopic and AMQTemporaryQueue
- * so that operations related to their "temporary-ness" can be abstracted out.
- */
-interface TemporaryDestination extends Destination
-{
-
- public void delete() throws JMSException;
- public AMQSession getSession();
- public boolean isDeleted();
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java
deleted file mode 100644
index 81b9940ed5..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java
+++ /dev/null
@@ -1,205 +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.
- *
- *
- */
-
-package org.apache.qpid.client;
-
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-
-public class TopicPublisherAdapter implements TopicPublisher
-{
-
- private BasicMessageProducer _delegate;
- private Topic _topic;
-
- public TopicPublisherAdapter(BasicMessageProducer msgProducer, Topic topic)
- {
- _delegate = msgProducer;
- _topic = topic;
- }
-
- public Topic getTopic() throws JMSException
- {
- checkPreConditions();
- return _topic;
- }
-
- public void publish(Message msg) throws JMSException
- {
- checkPreConditions();
- checkTopic(_topic);
- _delegate.send(msg);
- }
-
- public void publish(Topic topic, Message msg) throws JMSException
- {
- checkPreConditions();
- checkTopic(topic);
- _delegate.send(topic, msg);
- }
-
- public void publish(Message msg, int deliveryMode, int priority, long timeToLive)
- throws JMSException
- {
- checkPreConditions();
- checkTopic(_topic);
- _delegate.send(msg, deliveryMode, priority, timeToLive);
- }
-
- public int getDeliveryMode() throws JMSException {
- checkPreConditions();
- return _delegate.getDeliveryMode();
- }
-
- public void publish(Topic topic, Message msg, int deliveryMode, int priority, long timeToLive)
- throws JMSException
- {
- checkPreConditions();
- checkTopic(topic);
- _delegate.send(topic, msg, deliveryMode, priority, timeToLive);
- }
-
- public void close() throws JMSException
- {
- _delegate.close();
- }
-
- public boolean getDisableMessageID() throws JMSException {
- checkPreConditions();
- return _delegate.getDisableMessageID();
- }
-
- public boolean getDisableMessageTimestamp() throws JMSException {
- checkPreConditions();
- return _delegate.getDisableMessageTimestamp();
- }
-
- public Destination getDestination() throws JMSException
- {
- checkPreConditions();
- return _delegate.getDestination();
- }
-
- public int getPriority() throws JMSException {
- checkPreConditions();
- return _delegate.getPriority();
- }
-
- public long getTimeToLive() throws JMSException {
- checkPreConditions();
- return _delegate.getTimeToLive();
- }
-
- public void send(Message msg) throws JMSException
- {
- checkPreConditions();
- checkTopic(_topic);
- _delegate.send(msg);
- }
-
- public void send(Destination dest, Message msg) throws JMSException
- {
- checkPreConditions();
- checkTopic(_topic);
- _delegate.send(dest, msg);
- }
-
- public void send(Message msg, int deliveryMode, int priority, long timeToLive)
- throws JMSException
- {
- checkPreConditions();
- checkTopic(_topic);
- _delegate.send(msg, deliveryMode, priority, timeToLive);
- }
-
- public void send(Destination dest, Message msg, int deliveryMode, int priority, long timeToLive) throws JMSException
- {
- checkPreConditions();
- checkTopic(dest);
- _delegate.send(dest, msg, deliveryMode, priority, timeToLive);
- }
-
- public void setDeliveryMode(int deliveryMode) throws JMSException
- {
- checkPreConditions();
- _delegate.setDeliveryMode(deliveryMode);
- }
-
- public void setDisableMessageID(boolean disableMessageID) throws JMSException
- {
- checkPreConditions();
- _delegate.setDisableMessageID(disableMessageID);
- }
-
- public void setDisableMessageTimestamp(boolean disableMessageTimestamp) throws JMSException
- {
- checkPreConditions();
- _delegate.setDisableMessageTimestamp(disableMessageTimestamp);
- }
-
- public void setPriority(int priority) throws JMSException
- {
- checkPreConditions();
- _delegate.setPriority(priority);
- }
-
- public void setTimeToLive(long timeToLive) throws JMSException
- {
- checkPreConditions();
- _delegate.setTimeToLive(timeToLive);
- }
-
- private void checkPreConditions() throws IllegalStateException
- {
- if (_delegate.isClosed())
- {
- throw new javax.jms.IllegalStateException("Publisher is _closed");
- }
-
- AMQSession session = _delegate.getSession();
- if (session == null || session.isClosed())
- {
- throw new javax.jms.IllegalStateException("Invalid Session");
- }
- }
-
- private void checkTopic(Destination topic) throws InvalidDestinationException
- {
- if (topic == null)
- {
- throw new UnsupportedOperationException("Topic is null");
- }
- if (!(topic instanceof Topic))
- {
- throw new InvalidDestinationException("Destination " + topic + " is not a topic");
- }
- if(!(topic instanceof AMQDestination))
- {
- throw new InvalidDestinationException("Destination " + topic + " is not a Qpid topic");
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TopicSubscriberAdaptor.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TopicSubscriberAdaptor.java
deleted file mode 100644
index 9bdef22f96..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/TopicSubscriberAdaptor.java
+++ /dev/null
@@ -1,132 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.AMQException;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.Topic;
-import javax.jms.TopicSubscriber;
-
-/**
- * Wraps a MessageConsumer to fulfill the extended TopicSubscriber contract
- *
- */
-class TopicSubscriberAdaptor<C extends BasicMessageConsumer> implements TopicSubscriber
-{
- private final Topic _topic;
- private final C _consumer;
- private final boolean _noLocal;
-
- TopicSubscriberAdaptor(Topic topic, C consumer, boolean noLocal)
- {
- _topic = topic;
- _consumer = consumer;
- _noLocal = noLocal;
- }
-
- TopicSubscriberAdaptor(Topic topic, C consumer)
- {
- this(topic, consumer, consumer.isNoLocal());
- }
-
- public Topic getTopic() throws JMSException
- {
- checkPreConditions();
- return _topic;
- }
-
- public boolean getNoLocal() throws JMSException
- {
- checkPreConditions();
- return _noLocal;
- }
-
- public String getMessageSelector() throws JMSException
- {
- checkPreConditions();
- return _consumer.getMessageSelector();
- }
-
- public MessageListener getMessageListener() throws JMSException
- {
- checkPreConditions();
- return _consumer.getMessageListener();
- }
-
- public void setMessageListener(MessageListener messageListener) throws JMSException
- {
- checkPreConditions();
- _consumer.setMessageListener(messageListener);
- }
-
- public Message receive() throws JMSException
- {
- checkPreConditions();
- return _consumer.receive();
- }
-
- public Message receive(long l) throws JMSException
- {
- return _consumer.receive(l);
- }
-
- public Message receiveNoWait() throws JMSException
- {
- checkPreConditions();
- return _consumer.receiveNoWait();
- }
-
- public void close() throws JMSException
- {
- _consumer.close();
- }
-
- private void checkPreConditions() throws javax.jms.IllegalStateException{
- C msgConsumer = _consumer;
-
- if (msgConsumer.isClosed() ){
- throw new javax.jms.IllegalStateException("Consumer is closed");
- }
-
- if(_topic == null){
- throw new UnsupportedOperationException("Topic is null");
- }
-
- AMQSession session = msgConsumer.getSession();
-
- if(session == null || session.isClosed()){
- throw new javax.jms.IllegalStateException("Invalid Session");
- }
- }
-
- C getMessageConsumer()
- {
- return _consumer;
- }
-
- public void addBindingKey(Topic topic, String bindingKey) throws AMQException
- {
- _consumer.addBindingKey((AMQDestination) topic, bindingKey);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XAConnectionImpl.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XAConnectionImpl.java
deleted file mode 100644
index 20fa68605a..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XAConnectionImpl.java
+++ /dev/null
@@ -1,78 +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.
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.AMQException;
-
-import javax.jms.*;
-
-/**
- * This class implements the javax.njms.XAConnection interface
- */
-public class XAConnectionImpl extends AMQConnection implements XAConnection, XAQueueConnection, XATopicConnection
-{
- //-- constructor
- /**
- * Create a XAConnection from a connectionURL
- */
- public XAConnectionImpl(ConnectionURL connectionURL, SSLConfiguration sslConfig) throws AMQException
- {
- super(connectionURL, sslConfig);
- }
-
- //-- interface XAConnection
- /**
- * Creates an XASession.
- *
- * @return A newly created XASession.
- * @throws JMSException If the XAConnectiono fails to create an XASession due to
- * some internal error.
- */
- public synchronized XASession createXASession() throws JMSException
- {
- checkNotClosed();
- return _delegate.createXASession(_maxPrefetch, _maxPrefetch / 2);
- }
-
- //-- Interface XAQueueConnection
- /**
- * Creates an XAQueueSession.
- *
- * @return A newly created XASession.
- * @throws JMSException If the XAQueueConnectionImpl fails to create an XASession due to
- * some internal error.
- */
- public XAQueueSession createXAQueueSession() throws JMSException
- {
- return (XAQueueSession) createXASession();
- }
-
- //-- Interface XATopicConnection
- /**
- * Creates an XAQueueSession.
- *
- * @return A newly created XASession.
- * @throws JMSException If the XAQueueConnectionImpl fails to create an XASession due to
- * some internal error.
- */
- public XATopicSession createXATopicSession() throws JMSException
- {
- return (XATopicSession) createXASession();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java
deleted file mode 100644
index 35adda9348..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java
+++ /dev/null
@@ -1,529 +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.
- */
-package org.apache.qpid.client;
-
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.dtx.XidImpl;
-import org.apache.qpid.transport.*;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This is an implementation of javax.njms.XAResource.
- */
-public class XAResourceImpl implements XAResource
-{
- /**
- * this XAResourceImpl's logger
- */
- private static final Logger _logger = LoggerFactory.getLogger(XAResourceImpl.class);
-
- /**
- * Reference to the associated XASession
- */
- private XASessionImpl _xaSession = null;
-
- /**
- * The XID of this resource
- */
- private Xid _xid;
-
- //--- constructor
-
- /**
- * Create an XAResource associated with a XASession
- *
- * @param xaSession The session XAresource
- */
- protected XAResourceImpl(XASessionImpl xaSession)
- {
- _xaSession = xaSession;
- }
-
- //--- The XAResource
- /**
- * Commits the global transaction specified by xid.
- *
- * @param xid A global transaction identifier
- * @param b If true, use a one-phase commit protocol to commit the work done on behalf of xid.
- * @throws XAException An error has occurred. An error has occurred. Possible XAExceptions are XA_HEURHAZ,
- * XA_HEURCOM, XA_HEURRB, XA_HEURMIX, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL, or XAER_PROTO.
- */
- public void commit(Xid xid, boolean b) throws XAException
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("commit tx branch with xid: ", xid);
- }
- Future<XaResult> future =
- _xaSession.getQpidSession().dtxCommit(convertXid(xid), b ? Option.ONE_PHASE : Option.NONE);
-
- // now wait on the future for the result
- XaResult result = null;
- try
- {
- result = future.get();
- }
- catch (SessionException e)
- {
- // we need to restore the qpid session that has been closed
- _xaSession.createSession();
- convertExecutionErrorToXAErr(e.getException().getErrorCode());
- }
- checkStatus(result.getStatus());
- }
-
- /**
- * Ends the work performed on behalf of a transaction branch.
- * The resource manager disassociates the XA resource from the transaction branch specified
- * and lets the transaction complete.
- * <ul>
- * <li> If TMSUSPEND is specified in the flags, the transaction branch is temporarily suspended in an incomplete state.
- * The transaction context is in a suspended state and must be resumed via the start method with TMRESUME specified.
- * <li> If TMFAIL is specified, the portion of work has failed. The resource manager may mark the transaction as rollback-only
- * <li> If TMSUCCESS is specified, the portion of work has completed successfully.
- * /ul>
- *
- * @param xid A global transaction identifier that is the same as the identifier used previously in the start method
- * @param flag One of TMSUCCESS, TMFAIL, or TMSUSPEND.
- * @throws XAException An error has occurred. An error has occurred. Possible XAException values are XAER_RMERR,
- * XAER_RMFAILED, XAER_NOTA, XAER_INVAL, XAER_PROTO, or XA_RB*.
- */
- public void end(Xid xid, int flag) throws XAException
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("end tx branch with xid: ", xid);
- }
- switch (flag)
- {
- case(XAResource.TMSUCCESS):
- break;
- case(XAResource.TMFAIL):
- break;
- case(XAResource.TMSUSPEND):
- break;
- default:
- throw new XAException(XAException.XAER_INVAL);
- }
- _xaSession.flushAcknowledgments();
- Future<XaResult> future = _xaSession.getQpidSession()
- .dtxEnd(convertXid(xid),
- flag == XAResource.TMFAIL ? Option.FAIL : Option.NONE,
- flag == XAResource.TMSUSPEND ? Option.SUSPEND : Option.NONE);
- // now wait on the future for the result
- XaResult result = null;
- try
- {
- result = future.get();
- }
- catch (SessionException e)
- {
- // we need to restore the qpid session that has been closed
- _xaSession.createSession();
- convertExecutionErrorToXAErr(e.getException().getErrorCode());
- }
- checkStatus(result.getStatus());
- }
-
-
- /**
- * Tells the resource manager to forget about a heuristically completed transaction branch.
- *
- * @param xid String(xid.getGlobalTransactionId() A global transaction identifier
- * @throws XAException An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL,
- * XAER_NOTA, XAER_INVAL, or XAER_PROTO.
- */
- public void forget(Xid xid) throws XAException
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("forget tx branch with xid: ", xid);
- }
- _xaSession.getQpidSession().dtxForget(convertXid(xid));
- try
- {
- _xaSession.getQpidSession().sync();
- }
- catch (SessionException e)
- {
- // we need to restore the qpid session that has been closed
- _xaSession.createSession();
- convertExecutionErrorToXAErr(e.getException().getErrorCode());
- }
- }
-
-
- /**
- * Obtains the current transaction timeout value set for this XAResource instance.
- * If XAResource.setTransactionTimeout was not used prior to invoking this method,
- * the return value is the default timeout i.e. 0;
- * otherwise, the value used in the previous setTransactionTimeout call is returned.
- *
- * @return The transaction timeout value in seconds.
- * @throws XAException An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL.
- */
- public int getTransactionTimeout() throws XAException
- {
- int result = 0;
- if (_xid != null)
- {
- Future<GetTimeoutResult> future =
- _xaSession.getQpidSession().dtxGetTimeout(convertXid(_xid));
- try
- {
- result = (int) future.get().getTimeout();
- }
- catch (SessionException e)
- {
- // we need to restore the qpid session that has been closed
- _xaSession.createSession();
- convertExecutionErrorToXAErr(e.getException().getErrorCode());
- }
- }
- return result;
- }
-
- /**
- * This method is called to determine if the resource manager instance represented
- * by the target object is the same as the resouce manager instance represented by
- * the parameter xaResource.
- *
- * @param xaResource An XAResource object whose resource manager instance is to
- * be compared with the resource manager instance of the target object
- * @return <code>true</code> if it's the same RM instance; otherwise <code>false</code>.
- * @throws XAException An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL.
- */
- public boolean isSameRM(XAResource xaResource) throws XAException
- {
- // TODO : get the server identity of xaResource and compare it with our own one
- return false;
- }
-
- /**
- * Prepare for a transaction commit of the transaction specified in <code>Xid</code>.
- *
- * @param xid A global transaction identifier.
- * @return A value indicating the resource manager's vote on the outcome of the transaction.
- * The possible values are: XA_RDONLY or XA_OK.
- * @throws XAException An error has occurred. Possible exception values are: XAER_RMERR or XAER_NOTA
- */
- public int prepare(Xid xid) throws XAException
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("prepare ", xid);
- }
- Future<XaResult> future = _xaSession.getQpidSession().dtxPrepare(convertXid(xid));
- XaResult result = null;
- try
- {
- result = future.get();
- }
- catch (SessionException e)
- {
- // we need to restore the qpid session that has been closed
- _xaSession.createSession();
- convertExecutionErrorToXAErr(e.getException().getErrorCode());
- }
- DtxXaStatus status = result.getStatus();
- int outcome = XAResource.XA_OK;
- switch (status)
- {
- case XA_OK:
- break;
- case XA_RDONLY:
- outcome = XAResource.XA_RDONLY;
- break;
- default:
- checkStatus(status);
- }
- return outcome;
- }
-
- /**
- * Obtains a list of prepared transaction branches.
- * <p/>
- * The transaction manager calls this method during recovery to obtain the list of transaction branches
- * that are currently in prepared or heuristically completed states.
- *
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS.
- * TMNOFLAGS must be used when no other flags are set in the parameter.
- * @return zero or more XIDs of the transaction branches that are currently in a prepared or heuristically
- * completed state.
- * @throws XAException An error has occurred. Possible value is XAER_INVAL.
- */
- public Xid[] recover(int flag) throws XAException
- {
- // the flag is ignored
- Future<RecoverResult> future = _xaSession.getQpidSession().dtxRecover();
- RecoverResult res = null;
- try
- {
- res = future.get();
- }
- catch (SessionException e)
- {
- // we need to restore the qpid session that has been closed
- _xaSession.createSession();
- convertExecutionErrorToXAErr( e.getException().getErrorCode());
- }
- Xid[] result = new Xid[res.getInDoubt().size()];
- int i = 0;
- for (Object obj : res.getInDoubt())
- {
- org.apache.qpid.transport.Xid xid = (org.apache.qpid.transport.Xid) obj;
- result[i] = new XidImpl(xid.getBranchId(), (int) xid.getFormat(), xid.getGlobalId());
- i++;
- }
- return result;
- }
-
- /**
- * Informs the resource manager to roll back work done on behalf of a transaction branch
- *
- * @param xid A global transaction identifier.
- * @throws XAException An error has occurred.
- */
- public void rollback(Xid xid) throws XAException
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("rollback tx branch with xid: ", xid);
- }
-
- Future<XaResult> future = _xaSession.getQpidSession().dtxRollback(convertXid(xid));
- // now wait on the future for the result
- XaResult result = null;
- try
- {
- result = future.get();
- }
- catch (SessionException e)
- {
- // we need to restore the qpid session that has been closed
- _xaSession.createSession();
- convertExecutionErrorToXAErr( e.getException().getErrorCode());
- }
- checkStatus(result.getStatus());
- }
-
- /**
- * Sets the current transaction timeout value for this XAResource instance.
- * Once set, this timeout value is effective until setTransactionTimeout is
- * invoked again with a different value.
- * To reset the timeout value to the default value used by the resource manager, set the value to zero.
- *
- * @param timeout The transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
- * @throws XAException An error has occurred. Possible exception values are XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.
- */
- public boolean setTransactionTimeout(int timeout) throws XAException
- {
- boolean result = false;
- if (_xid != null)
- {
- try
- {
- _xaSession.getQpidSession()
- .dtxSetTimeout(XidImpl.convert(_xid), timeout);
- }
- catch (QpidException e)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Cannot convert Xid into String format ", e);
- }
- throw new XAException(XAException.XAER_PROTO);
- }
- result = true;
- }
- return result;
- }
-
- /**
- * Starts work on behalf of a transaction branch specified in xid.
- * <ul>
- * <li> If TMJOIN is specified, an exception is thrown as it is not supported
- * <li> If TMRESUME is specified, the start applies to resuming a suspended transaction specified in the parameter xid.
- * <li> If neither TMJOIN nor TMRESUME is specified and the transaction specified by xid has previously been seen by the
- * resource manager, the resource manager throws the XAException exception with XAER_DUPID error code.
- * </ul>
- *
- * @param xid A global transaction identifier to be associated with the resource
- * @param flag One of TMNOFLAGS, TMJOIN, or TMRESUME
- * @throws XAException An error has occurred. Possible exceptions
- * are XA_RB*, XAER_RMERR, XAER_RMFAIL, XAER_DUPID, XAER_OUTSIDE, XAER_NOTA, XAER_INVAL, or XAER_PROTO.
- */
- public void start(Xid xid, int flag) throws XAException
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("start tx branch with xid: ", xid);
- }
- switch (flag)
- {
- case(XAResource.TMNOFLAGS):
- break;
- case(XAResource.TMJOIN):
- break;
- case(XAResource.TMRESUME):
- break;
- default:
- throw new XAException(XAException.XAER_INVAL);
- }
- Future<XaResult> future = _xaSession.getQpidSession()
- .dtxStart(convertXid(xid),
- flag == XAResource.TMJOIN ? Option.JOIN : Option.NONE,
- flag == XAResource.TMRESUME ? Option.RESUME : Option.NONE);
- // now wait on the future for the result
- XaResult result = null;
- try
- {
- result = future.get();
- }
- catch (SessionException e)
- {
- // we need to restore the qpid session that has been closed
- _xaSession.createSession();
- convertExecutionErrorToXAErr(e.getException().getErrorCode());
- // TODO: The amqp spec does not allow to make the difference
- // between an already known XID and a wrong arguments (join and resume are set)
- // TODO: make sure amqp addresses that
- }
- checkStatus(result.getStatus());
- _xid = xid;
- }
-
- //------------------------------------------------------------------------
- // Private methods
- //------------------------------------------------------------------------
-
- /**
- * Check xa method outcome and, when required, convert the status into the corresponding xa exception
- * @param status method status code
- * @throws XAException corresponding XA Exception when required
- */
- private void checkStatus(DtxXaStatus status) throws XAException
- {
- switch (status)
- {
- case XA_OK:
- // Do nothing this ok
- break;
- case XA_RBROLLBACK:
- // The tx has been rolled back for an unspecified reason.
- throw new XAException(XAException.XA_RBROLLBACK);
- case XA_RBTIMEOUT:
- // The transaction branch took too long.
- throw new XAException(XAException.XA_RBTIMEOUT);
- case XA_HEURHAZ:
- // The transaction branch may have been heuristically completed.
- throw new XAException(XAException.XA_HEURHAZ);
- case XA_HEURCOM:
- // The transaction branch has been heuristically committed.
- throw new XAException(XAException.XA_HEURCOM);
- case XA_HEURRB:
- // The transaction branch has been heuristically rolled back.
- throw new XAException(XAException.XA_HEURRB);
- case XA_HEURMIX:
- // The transaction branch has been heuristically committed and rolled back.
- throw new XAException(XAException.XA_HEURMIX);
- case XA_RDONLY:
- // The transaction branch was read-only and has been committed.
- throw new XAException(XAException.XA_RDONLY);
- default:
- // this should not happen
- if (_logger.isDebugEnabled())
- {
- _logger.debug("got unexpected status value: ", status);
- }
- //A resource manager error has occured in the transaction branch.
- throw new XAException(XAException.XAER_RMERR);
- }
- }
-
- /**
- * Convert execution error to xa exception.
- * @param error the execution error code
- * @throws XAException
- */
- private void convertExecutionErrorToXAErr(ExecutionErrorCode error) throws XAException
- {
- switch (error)
- {
- case NOT_ALLOWED:
- // The XID already exists.
- throw new XAException(XAException.XAER_DUPID);
- case NOT_FOUND:
- // The XID is not valid.
- throw new XAException(XAException.XAER_NOTA);
- case ILLEGAL_STATE:
- // Routine was invoked in an inproper context.
- throw new XAException(XAException.XAER_PROTO);
- case NOT_IMPLEMENTED:
- // the command is not implemented
- throw new XAException(XAException.XAER_RMERR);
- case COMMAND_INVALID:
- // Invalid call
- throw new XAException(XAException.XAER_INVAL);
- default:
- // this should not happen
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Got unexpected error: " + error);
- }
- //A resource manager error has occured in the transaction branch.
- throw new XAException(XAException.XAER_RMERR);
- }
- }
-
- /**
- * convert a generic xid into qpid format
- * @param xid xid to be converted
- * @return the qpid formated xid
- * @throws XAException when xid is null or when it cannot be converted.
- */
- private org.apache.qpid.transport.Xid convertXid(Xid xid) throws XAException
- {
- if (xid == null)
- {
- // Invalid arguments were given.
- throw new XAException(XAException.XAER_INVAL);
- }
- try
- {
- return XidImpl.convert(xid);
- }
- catch (QpidException e)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Cannot convert Xid into String format ", e);
- }
- //A resource manager error has occured in the transaction branch.
- throw new XAException(XAException.XAER_RMERR);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java
deleted file mode 100644
index 354b67cd35..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java
+++ /dev/null
@@ -1,159 +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.
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.client.message.MessageFactoryRegistry;
-
-import javax.jms.*;
-import javax.transaction.xa.XAResource;
-
-/**
- * This is an implementation of the javax.njms.XASEssion interface.
- */
-public class XASessionImpl extends AMQSession_0_10 implements XASession, XATopicSession, XAQueueSession
-{
- /**
- * XAResource associated with this XASession
- */
- private final XAResourceImpl _xaResource;
-
- /**
- * This XASession Qpid DtxSession
- */
- private org.apache.qpid.transport.Session _qpidDtxSession;
-
- /**
- * The standard session
- */
- private Session _jmsSession;
-
-
- //-- Constructors
- /**
- * Create a JMS XASession
- */
- public XASessionImpl(org.apache.qpid.transport.Connection qpidConnection, AMQConnection con, int channelId,
- int defaultPrefetchHigh, int defaultPrefetchLow)
- {
- super(qpidConnection, con, channelId, false, // this is not a transacted session
- Session.AUTO_ACKNOWLEDGE, // the ack mode is transacted
- MessageFactoryRegistry.newDefaultRegistry(), defaultPrefetchHigh, defaultPrefetchLow);
- createSession();
- _xaResource = new XAResourceImpl(this);
- }
-
- //-- public methods
-
- /**
- * Create a qpid session.
- */
- public void createSession()
- {
- _qpidDtxSession = _qpidConnection.createSession(0);
- _qpidDtxSession.setSessionListener(this);
- _qpidDtxSession.dtxSelect();
- }
-
-
- //--- javax.njms.XASEssion API
-
- /**
- * Gets the session associated with this XASession.
- *
- * @return The session object.
- * @throws JMSException if an internal error occurs.
- */
- public Session getSession() throws JMSException
- {
- if (_jmsSession == null)
- {
- _jmsSession = getAMQConnection().createSession(true, getAcknowledgeMode());
- }
- return _jmsSession;
- }
-
- /**
- * Returns an XA resource.
- *
- * @return An XA resource.
- */
- public XAResource getXAResource()
- {
- return _xaResource;
- }
-
- //-- overwritten mehtods
- /**
- * Throws a {@link TransactionInProgressException}, since it should
- * not be called for an XASession object.
- *
- * @throws TransactionInProgressException always.
- */
- public void commit() throws JMSException
- {
- throw new TransactionInProgressException(
- "XASession: A direct invocation of the commit operation is probibited!");
- }
-
- /**
- * Throws a {@link TransactionInProgressException}, since it should
- * not be called for an XASession object.
- *
- * @throws TransactionInProgressException always.
- */
- public void rollback() throws JMSException
- {
- throw new TransactionInProgressException(
- "XASession: A direct invocation of the rollback operation is probibited!");
- }
-
- /**
- * Access to the underlying Qpid Session
- *
- * @return The associated Qpid Session.
- */
- protected org.apache.qpid.transport.Session getQpidSession()
- {
- return _qpidDtxSession;
- }
-
- //--- interface XAQueueSession
- /**
- * Gets the topic session associated with this <CODE>XATopicSession</CODE>.
- *
- * @return the topic session object
- * @throws JMSException If an internal error occurs.
- */
- public QueueSession getQueueSession() throws JMSException
- {
- return (QueueSession) getSession();
- }
-
- //--- interface XATopicSession
-
- /**
- * Gets the topic session associated with this <CODE>XATopicSession</CODE>.
- *
- * @return the topic session object
- * @throws JMSException If an internal error occurs.
- */
- public TopicSession getTopicSession() throws JMSException
- {
- return (TopicSession) getSession();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java
deleted file mode 100644
index 49ac89d9b3..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/configuration/ClientProperties.java
+++ /dev/null
@@ -1,78 +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.
- */
-
-package org.apache.qpid.client.configuration;
-
-/**
- * This class centralized the Qpid client properties.
- */
-public class ClientProperties
-{
-
- /**
- * Currently with Qpid it is not possible to change the client ID.
- * If one is not specified upon connection construction, an id is generated automatically.
- * Therefore an exception is always thrown unless this property is set to true.
- * type: boolean
- */
- public static final String IGNORE_SET_CLIENTID_PROP_NAME = "ignore_setclientID";
-
- /**
- * This property is currently used within the 0.10 code path only
- * The maximum number of pre-fetched messages per destination
- * This property is used for all the connection unless it is overwritten by the connectionURL
- * type: long
- */
- public static final String MAX_PREFETCH_PROP_NAME = "max_prefetch";
- public static final String MAX_PREFETCH_DEFAULT = "5000";
-
- /**
- * When true a sync command is sent after every persistent messages.
- * type: boolean
- */
- public static final String SYNC_PERSISTENT_PROP_NAME = "sync_persistence";
-
- /**
- * ==========================================================
- * Those properties are used when the io size should be bounded
- * ==========================================================
- */
-
- /**
- * When set to true the io layer throttle down producers and consumers
- * when written or read messages are accumulating and exceeding a certain size.
- * This is especially useful when a the producer rate is greater than the network
- * speed.
- * type: boolean
- */
- public static final String PROTECTIO_PROP_NAME = "protectio";
-
- //=== The following properties are only used when the previous one is true.
- /**
- * Max size of read messages that can be stored within the MINA layer
- * type: int
- */
- public static final String READ_BUFFER_LIMIT_PROP_NAME = "qpid.read.buffer.limit";
- public static final String READ_BUFFER_LIMIT_DEFAULT = "262144";
- /**
- * Max size of written messages that can be stored within the MINA layer
- * type: int
- */
- public static final String WRITE_BUFFER_LIMIT_PROP_NAME = "qpid.read.buffer.limit";
- public static final String WRITE_BUFFER_LIMIT_DEFAULT = "262144";
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java
deleted file mode 100644
index 037b0dc2d1..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java
+++ /dev/null
@@ -1,49 +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.
- *
- */
-package org.apache.qpid.client.failover;
-
-/**
- * FailoverException is used to indicate that a synchronous request has failed to receive the reply that it is waiting
- * for because the fail-over process has been started whilst it was waiting for its reply. Synchronous methods generally
- * raise this exception to indicate that they must be re-tried once the fail-over process has completed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Used to indicate failure of a synchronous request due to fail-over.
- * </table>
- *
- * @todo This exception is created and passed as an argument to a method, rather than thrown. The exception is being
- * used to represent an event, passed out to other threads. Use of exceptions as arguments rather than as
- * exceptions is extremly confusing. Ideally use a condition or set a flag and check it instead.
- * This exceptions-as-events pattern seems to be in a similar style to Mina code, which is not pretty, but
- * potentially acceptable for that reason. We have the option of extending the mina model to add more events
- * to it, that is, anything that is interested in handling failover as an event occurs below the main
- * amq event handler, which knows the specific interface of the qpid handlers, which can pass this down as
- * an explicit event, without it being an exception. Add failover method to BlockingMethodFrameListener,
- * have it set a flag or interrupt the waiting thread, which then creates and raises this exception.
- */
-public class FailoverException extends Exception
-{
- public FailoverException(String message)
- {
- super(message);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
deleted file mode 100644
index 927f660932..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
+++ /dev/null
@@ -1,256 +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.
- *
- */
-package org.apache.qpid.client.failover;
-
-import org.apache.mina.common.IoSession;
-
-import org.apache.qpid.AMQDisconnectedException;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.state.AMQStateManager;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.concurrent.CountDownLatch;
-
-/**
- * FailoverHandler is a continuation that performs the failover procedure on a protocol session. As described in the
- * class level comment for {@link AMQProtocolHandler}, a protocol connection can span many physical transport
- * connections, failing over to a new connection if the transport connection fails. The procedure to establish a new
- * connection is expressed as a continuation, in order that it may be run in a seperate thread to the i/o thread that
- * detected the failure and is used to handle the communication to establish a new connection.
- *
- * </p>The reason this needs to be a separate thread is because this work cannot be done inside the i/o processor
- * thread. The significant task is the connection setup which involves a protocol exchange until a particular state
- * is achieved. This procedure waits until the state is achieved which would prevent the i/o thread doing the work
- * it needs to do to achieve the new state.
- *
- * <p/>The failover procedure does the following:
- *
- * <ol>
- * <li>Sets the failing over condition to true.</li>
- * <li>Creates a {@link FailoverException} and gets the protocol connection handler to propagate this event to all
- * interested parties.</li>
- * <li>Takes the failover mutex on the protocol connection handler.</li>
- * <li>Abandons the fail over if any of the interested parties vetoes it. The mutex is released and the condition
- * reset.</li>
- * <li>Creates a new {@link AMQStateManager} and re-established the connection through it.</li>
- * <li>Informs the AMQConnection if the connection cannot be re-established.</li>
- * <li>Recreates all sessions from the old connection to the new.</li>
- * <li>Resets the failing over condition and releases the mutex.</li>
- * </ol>
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Update fail-over state <td> {@link AMQProtocolHandler}
- * </table>
- *
- * @todo The failover latch and mutex are used like a lock and condition. If the retrotranlator supports lock/condition
- * then could change over to using them. 1.4 support still needed.
- *
- * @todo If the condition is set to null on a vetoes fail-over and there are already other threads waiting on the
- * condition, they will never be released. It might be an idea to reset the condition in a finally block.
- *
- * @todo Creates a {@link AMQDisconnectedException} and passes it to the AMQConnection. No need to use an
- * exception-as-argument here, could just as easily call a specific method for this purpose on AMQConnection.
- *
- * @todo Creates a {@link FailoverException} and propagates it to the MethodHandlers. No need to use an
- * exception-as-argument here, could just as easily call a specific method for this purpose on
- * {@link org.apache.qpid.protocol.AMQMethodListener}.
- */
-public class FailoverHandler implements Runnable
-{
- /** Used for debugging. */
- private static final Logger _logger = LoggerFactory.getLogger(FailoverHandler.class);
-
- /** Holds the MINA session for the connection that has failed, not the connection that is being failed onto. */
- private final IoSession _session;
-
- /** Holds the protocol handler for the failed connection, upon which the new connection is to be set up. */
- private AMQProtocolHandler _amqProtocolHandler;
-
- /** Used to hold the host to fail over to. This is optional and if not set a reconnect to the previous host is tried. */
- private String _host;
-
- /** Used to hold the port to fail over to. */
- private int _port;
-
- /**
- * Creates a failover handler on a protocol session, for a particular MINA session (network connection).
- *
- * @param amqProtocolHandler The protocol handler that spans the failover.
- * @param session The MINA session, for the failing connection.
- */
- public FailoverHandler(AMQProtocolHandler amqProtocolHandler, IoSession session)
- {
- _amqProtocolHandler = amqProtocolHandler;
- _session = session;
- }
-
- /**
- * Performs the failover procedure. See the class level comment, {@link FailoverHandler}, for a description of the
- * failover procedure.
- */
- public void run()
- {
- if (Thread.currentThread().isDaemon())
- {
- throw new IllegalStateException("FailoverHandler must run on a non-daemon thread.");
- }
-
- // Create a latch, upon which tasks that must not run in parallel with a failover can wait for completion of
- // the fail over.
- _amqProtocolHandler.setFailoverLatch(new CountDownLatch(1));
-
- // We wake up listeners. If they can handle failover, they will extend the
- // FailoverRetrySupport class and will in turn block on the latch until failover
- // has completed before retrying the operation.
- _amqProtocolHandler.notifyFailoverStarting();
-
- // Since failover impacts several structures we protect them all with a single mutex. These structures
- // are also in child objects of the connection. This allows us to manipulate them without affecting
- // client code which runs in a separate thread.
- synchronized (_amqProtocolHandler.getConnection().getFailoverMutex())
- {
- //Clear the exception now that we have the failover mutex there can be no one else waiting for a frame so
- // we can clear the exception.
- _amqProtocolHandler.failoverInProgress();
-
- // We switch in a new state manager temporarily so that the interaction to get to the "connection open"
- // state works, without us having to terminate any existing "state waiters". We could theoretically
- // have a state waiter waiting until the connection is closed for some reason. Or in future we may have
- // a slightly more complex state model therefore I felt it was worthwhile doing this.
- AMQStateManager existingStateManager = _amqProtocolHandler.getStateManager();
-
- _amqProtocolHandler.setStateManager(new AMQStateManager());
-
-
- if (!_amqProtocolHandler.getConnection().firePreFailover(_host != null))
- {
- _logger.info("Failover process veto-ed by client");
-
- //Restore Existing State Manager
- _amqProtocolHandler.setStateManager(existingStateManager);
-
- //todo: ritchiem these exceptions are useless... Would be better to attempt to propogate exception that
- // prompted the failover event.
- if (_host != null)
- {
- _amqProtocolHandler.getConnection().exceptionReceived(new AMQDisconnectedException("Redirect was vetoed by client", null));
- }
- else
- {
- _amqProtocolHandler.getConnection().exceptionReceived(new AMQDisconnectedException("Failover was vetoed by client", null));
- }
-
- _amqProtocolHandler.getFailoverLatch().countDown();
- _amqProtocolHandler.setFailoverLatch(null);
-
- return;
- }
-
- _logger.info("Starting failover process");
-
- boolean failoverSucceeded;
- // when host is non null we have a specified failover host otherwise we all the client to cycle through
- // all specified hosts
-
- // if _host has value then we are performing a redirect.
- if (_host != null)
- {
- failoverSucceeded = _amqProtocolHandler.getConnection().attemptReconnection(_host, _port);
- }
- else
- {
- failoverSucceeded = _amqProtocolHandler.getConnection().attemptReconnection();
- }
-
- if (!failoverSucceeded)
- {
- //Restore Existing State Manager
- _amqProtocolHandler.setStateManager(existingStateManager);
-
- _amqProtocolHandler.getConnection().exceptionReceived(
- new AMQDisconnectedException("Server closed connection and no failover " +
- "was successful", null));
- }
- else
- {
- // Set the new Protocol Session in the StateManager.
- existingStateManager.setProtocolSession(_amqProtocolHandler.getProtocolSession());
-
- //Restore Existing State Manager
- _amqProtocolHandler.setStateManager(existingStateManager);
- try
- {
- if (_amqProtocolHandler.getConnection().firePreResubscribe())
- {
- _logger.info("Resubscribing on new connection");
- _amqProtocolHandler.getConnection().resubscribeSessions();
- }
- else
- {
- _logger.info("Client vetoed automatic resubscription");
- }
-
- _amqProtocolHandler.getConnection().fireFailoverComplete();
- _amqProtocolHandler.setFailoverState(FailoverState.NOT_STARTED);
- _logger.info("Connection failover completed successfully");
- }
- catch (Exception e)
- {
- _logger.info("Failover process failed - exception being propagated by protocol handler");
- _amqProtocolHandler.setFailoverState(FailoverState.FAILED);
- /*try
- {*/
- _amqProtocolHandler.exceptionCaught(_session, e);
- /*}
- catch (Exception ex)
- {
- _logger.error("Error notifying protocol session of error: " + ex, ex);
- }*/
- }
- }
- }
-
- _amqProtocolHandler.getFailoverLatch().countDown();
- }
-
- /**
- * Sets the host name to fail over to. This is optional and if not set a reconnect to the previous host is tried.
- *
- * @param host The host name to fail over to.
- */
- public void setHost(String host)
- {
- _host = host;
- }
-
- /**
- * Sets the port to fail over to.
- *
- * @param port The port to fail over to.
- */
- public void setPort(int port)
- {
- _port = port;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverNoopSupport.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverNoopSupport.java
deleted file mode 100644
index 51cc94965a..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverNoopSupport.java
+++ /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.
- *
- *
- */
-
-package org.apache.qpid.client.failover;
-
-import org.apache.qpid.client.AMQConnection;
-
-/**
- * FailoverNoopSupport is a {@link FailoverSupport} implementation that does not really provide any failover support
- * at all. It wraps a {@link FailoverProtectedOperation} but should that operation throw {@link FailoverException} this
- * support class simply re-raises that exception as an IllegalStateException. This support wrapper should only be
- * used where the caller can be certain that the failover protected operation cannot acutally throw a failover exception,
- * for example, because the caller already holds a lock preventing that condition from arising.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Perform a fail-over protected operation raising providing no handling of fail-over conditions.
- * </table>
- */
-public class FailoverNoopSupport<T, E extends Exception> implements FailoverSupport<T, E>
-{
- /** The protected operation that is to be retried in the event of fail-over. */
- FailoverProtectedOperation<T, E> operation;
-
- /** The connection on which the fail-over protected operation is to be performed. */
- AMQConnection connection;
-
- /**
- * Creates an automatic retrying fail-over handler for the specified operation.
- *
- * @param operation The fail-over protected operation to wrap in this handler.
- */
- public FailoverNoopSupport(FailoverProtectedOperation<T, E> operation, AMQConnection con)
- {
- this.operation = operation;
- this.connection = con;
- }
-
- /**
- * Delegates to another continuation which is to be provided with fail-over handling.
- *
- * @return The return value from the delegated to continuation.
- * @throws E Any exception that the delegated to continuation may raise.
- */
- public T execute() throws E
- {
- try
- {
- return operation.execute();
- }
- catch (FailoverException e)
- {
- throw new IllegalStateException("Fail-over interupted no-op failover support. "
- + "No-op support should only be used where the caller is certain fail-over cannot occur.", e);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java
deleted file mode 100644
index e9c5f24791..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java
+++ /dev/null
@@ -1,49 +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.
- *
- *
- */
-
-package org.apache.qpid.client.failover;
-
-/**
- * FailoverProtectedOperation is a continuation for an operation that may throw a {@link FailoverException} because
- * it has been interrupted by the fail-over process. The {@link FailoverRetrySupport} class defines support wrappers
- * for failover protected operations, in order to provide different handling schemes when failovers occurr.
- *
- * <p/>The type of checked exception that the operation may perform has been generified, in order that fail over
- * protected operations can be defined that raise arbitrary exceptions. The actuall exception types used should not
- * be sub-classes of FailoverException, or else catching FailoverException in the {@link FailoverRetrySupport} classes
- * will mask the exception.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Perform an operation that may be interrupted by fail-over.
- * </table>
- */
-public interface FailoverProtectedOperation<T, E extends Exception>
-{
- /**
- * Performs the continuations work.
- *
- * @return Provdes scope for the continuation to return an arbitrary value.
- *
- * @throws FailoverException If the operation is interrupted by a fail-over notification.
- */
- public abstract T execute() throws E, FailoverException;
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java
deleted file mode 100644
index e9e52cc97c..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java
+++ /dev/null
@@ -1,104 +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.
- *
- */
-package org.apache.qpid.client.failover;
-
-import org.apache.qpid.client.AMQConnection;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * FailoverRetrySupport is a continuation that wraps another continuation, delaying its execution until it is notified
- * that a blocking condition has been met, and executing the continuation within a mutex. If the continuation fails, due
- * to the original condition being broken, whilst the continuation is waiting for a reponse to a synchronous request,
- * FailoverRetrySupport automatcally rechecks the condition and re-acquires the mutex and re-runs the continution. This
- * automatic retrying is continued until the continuation succeeds, or throws an exception (different to
- * FailoverException, which is used to signal the failure of the original condition).
- *
- * <p/>The blocking condition used is that the connection is not currently failing over, and the mutex used is the
- * connection failover mutex, which guards against the fail-over process being run during fail-over vulnerable methods.
- * These are used like a lock and condition variable.
- *
- * <p/>The wrapped operation may throw a FailoverException, this is an exception that can be raised by a
- * {@link org.apache.qpid.client.protocol.BlockingMethodFrameListener}, in response to it being notified that a
- * fail-over wants to start whilst it was waiting. Methods that are vulnerable to fail-over are those that are
- * synchronous, where a failure will prevent them from getting the reply they are waiting for and asynchronous
- * methods that should not be attempted when a fail-over is in progress.
- *
- * <p/>Wrapping a synchronous method in a FailoverRetrySupport will have the effect that the operation will not be
- * started during fail-over, but be delayed until any current fail-over has completed. Should a fail-over process want
- * to start whilst waiting for the synchrnous reply, the FailoverRetrySupport will detect this and rety the operation
- * until it succeeds. Synchronous methods are usually coordinated with a
- * {@link org.apache.qpid.client.protocol.BlockingMethodFrameListener} which is notified when a fail-over process wants
- * to start and throws a FailoverException in response to this.
- *
- * <p/>Wrapping an asynchronous method in a FailoverRetrySupport will have the effect that the operation will not be
- * started during fail-over, but be delayed until any current fail-over has completed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide a continuation synchronized on a fail-over lock and condition.
- * <tr><td> Automatically retry the continuation accross fail-overs until it succeeds, or raises an exception.
- * </table>
- *
- * @todo Another continuation. Could use an interface Continuation (as described in other todos, for example, see
- * {@link org.apache.qpid.pool.Job}). Then have a wrapping continuation (this), which blocks on an arbitrary
- * Condition or Latch (specified in constructor call), that this blocks on before calling the wrapped Continuation.
- * Must work on Java 1.4, so check retrotranslator works on Lock/Condition or latch first. Argument and return type
- * to match wrapped condition as type parameters. Rename to AsyncConditionalContinuation or something like that.
- *
- * @todo InterruptedException not handled well.
- */
-public class FailoverRetrySupport<T, E extends Exception> implements FailoverSupport<T, E>
-{
- /** Used for debugging. */
- private static final Logger _log = LoggerFactory.getLogger(FailoverRetrySupport.class);
-
- /** The protected operation that is to be retried in the event of fail-over. */
- FailoverProtectedOperation<T, E> operation;
-
- /** The connection on which the fail-over protected operation is to be performed. */
- AMQConnection connection;
-
- /**
- * Creates an automatic retrying fail-over handler for the specified operation.
- *
- * @param operation The fail-over protected operation to wrap in this handler.
- */
- public FailoverRetrySupport(FailoverProtectedOperation<T, E> operation, AMQConnection con)
- {
- this.operation = operation;
- this.connection = con;
- }
-
- /**
- * Delays a continuation until the "not failing over" condition is met on the specified connection. Repeats
- * until the operation throws AMQException or succeeds without being interrupted by fail-over.
- *
- * @return The result of executing the continuation.
- *
- * @throws E Any underlying exception is allowed to fall through.
- */
- public T execute() throws E
- {
- return connection.executeRetrySupport(operation);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java
deleted file mode 100644
index 807a5f7d13..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java
+++ /dev/null
@@ -1,64 +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.
- *
- */
-package org.apache.qpid.client.failover;
-
-/**
- * Defines the possible states of the failover process; not started, in progress, failed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent a one of the states of the fail-over process.
- * </table>
- */
-public final class FailoverState
-{
- /** The string description on this state. */
- private final String _state;
-
- /** Failover has not yet been attempted on this connection. */
- public static final FailoverState NOT_STARTED = new FailoverState("NOT STARTED");
-
- /** Failover has been requested on this connection but has not completed. */
- public static final FailoverState IN_PROGRESS = new FailoverState("IN PROGRESS");
-
- /** Failover has been attempted and failed. */
- public static final FailoverState FAILED = new FailoverState("FAILED");
-
- /**
- * Creates a type safe enumeration of a fail-over state.
- *
- * @param state The fail-over state description string.
- */
- private FailoverState(String state)
- {
- _state = state;
- }
-
- /**
- * Prints this state, mainly for debugging purposes.
- *
- * @return The string description of this state.
- */
- public String toString()
- {
- return "FailoverState: " + _state;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java
deleted file mode 100644
index ef2e7e1d65..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java
+++ /dev/null
@@ -1,47 +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.
- *
- *
- */
-
-package org.apache.qpid.client.failover;
-
-/**
- * FailoverSupport defines an interface for different types of fail-over handlers, that provide different types of
- * behaviour for handling fail-overs during operations that can be interrupted by the fail-over process. For example,
- * the support could automatically retry once the fail-over process completes, could prevent an operation from being
- * started whilst fail-over is running, or could quietly abandon the operation or raise an exception, and so on.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Perform a fail-over protected operation with handling for fail-over conditions.
- * </table>
- *
- * @todo Continuation, extend some sort of re-usable Continuation interface, which might look very like this one.
- */
-public interface FailoverSupport<T, E extends Exception>
-{
- /**
- * Delegates to another continuation which is to be provided with fail-over handling.
- *
- * @return The return value from the delegated to continuation.
- *
- * @throws E Any exception that the delegated to continuation may raise.
- */
- public T execute() throws E;
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/AccessRequestOkMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/AccessRequestOkMethodHandler.java
deleted file mode 100644
index af47673a43..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/AccessRequestOkMethodHandler.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.apache.qpid.client.handler;
-/*
- *
- * 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 org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.qpid.framing.*;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.AMQException;
-
-public class AccessRequestOkMethodHandler implements StateAwareMethodListener<AccessRequestOkBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(AccessRequestOkMethodHandler.class);
-
- private static AccessRequestOkMethodHandler _handler = new AccessRequestOkMethodHandler();
-
- public static AccessRequestOkMethodHandler getInstance()
- {
- return _handler;
- }
-
- public void methodReceived(AMQProtocolSession session, AccessRequestOkBody method, int channelId)
- throws AMQException
- {
- _logger.debug("AccessRequestOk method received");
- session.setTicket(method.getTicket(), channelId);
-
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicCancelOkMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicCancelOkMethodHandler.java
deleted file mode 100644
index 5cb9412d51..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicCancelOkMethodHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.BasicCancelOkBody;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BasicCancelOkMethodHandler implements StateAwareMethodListener<BasicCancelOkBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(BasicCancelOkMethodHandler.class);
-
- private static final BasicCancelOkMethodHandler _instance = new BasicCancelOkMethodHandler();
-
- public static BasicCancelOkMethodHandler getInstance()
- {
- return _instance;
- }
-
- private BasicCancelOkMethodHandler()
- { }
-
- public void methodReceived(AMQProtocolSession session, BasicCancelOkBody body, int channelId)
- throws AMQException
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("New BasicCancelOk method received for consumer:" + body.getConsumerTag());
- }
-
- session.confirmConsumerCancelled(channelId, body.getConsumerTag());
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicDeliverMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicDeliverMethodHandler.java
deleted file mode 100644
index 6237234c4d..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicDeliverMethodHandler.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.message.UnprocessedMessage_0_8;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.BasicDeliverBody;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BasicDeliverMethodHandler implements StateAwareMethodListener<BasicDeliverBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(BasicDeliverMethodHandler.class);
-
- private static final BasicDeliverMethodHandler _instance = new BasicDeliverMethodHandler();
-
- public static BasicDeliverMethodHandler getInstance()
- {
- return _instance;
- }
-
- public void methodReceived(AMQProtocolSession session, BasicDeliverBody body, int channelId)
- throws AMQException
- {
- final UnprocessedMessage_0_8 msg = new UnprocessedMessage_0_8(
- body.getDeliveryTag(),
- body.getConsumerTag().toIntValue(),
- body.getExchange(),
- body.getRoutingKey(),
- body.getRedelivered());
- _logger.debug("New JmsDeliver method received:" + session);
- session.unprocessedMessageReceived(channelId, msg);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicReturnMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicReturnMethodHandler.java
deleted file mode 100644
index 3bbc9209c5..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/BasicReturnMethodHandler.java
+++ /dev/null
@@ -1,58 +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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.message.ReturnMessage;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.BasicReturnBody;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BasicReturnMethodHandler implements StateAwareMethodListener<BasicReturnBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(BasicReturnMethodHandler.class);
-
- private static final BasicReturnMethodHandler _instance = new BasicReturnMethodHandler();
-
- public static BasicReturnMethodHandler getInstance()
- {
- return _instance;
- }
-
-
- public void methodReceived(AMQProtocolSession session, BasicReturnBody body, int channelId)
- throws AMQException
- {
- _logger.debug("New JmsBounce method received");
- final ReturnMessage msg = new ReturnMessage(
- body.getExchange(),
- body.getRoutingKey(),
- body.getReplyText(),
- body.getReplyCode()
- );
-
- session.unprocessedMessageReceived(channelId, msg);
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java
deleted file mode 100644
index 2b6745ebe4..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQChannelClosedException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQInvalidRoutingKeyException;
-import org.apache.qpid.client.AMQNoConsumersException;
-import org.apache.qpid.client.AMQNoRouteException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ChannelCloseBody;
-import org.apache.qpid.framing.ChannelCloseOkBody;
-import org.apache.qpid.protocol.AMQConstant;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ChannelCloseMethodHandler implements StateAwareMethodListener<ChannelCloseBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(ChannelCloseMethodHandler.class);
-
- private static ChannelCloseMethodHandler _handler = new ChannelCloseMethodHandler();
-
- public static ChannelCloseMethodHandler getInstance()
- {
- return _handler;
- }
-
- public void methodReceived(AMQProtocolSession session, ChannelCloseBody method, int channelId)
- throws AMQException
- {
- _logger.debug("ChannelClose method received");
-
- AMQConstant errorCode = AMQConstant.getConstant(method.getReplyCode());
- AMQShortString reason = method.getReplyText();
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Channel close reply code: " + errorCode + ", reason: " + reason);
- }
-
-
-
- ChannelCloseOkBody body = session.getMethodRegistry().createChannelCloseOkBody();
- AMQFrame frame = body.generateFrame(channelId);
- session.writeFrame(frame);
-
- if (errorCode != AMQConstant.REPLY_SUCCESS)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Channel close received with errorCode " + errorCode + ", and reason " + reason);
- }
-
- if (errorCode == AMQConstant.NO_CONSUMERS)
- {
- throw new AMQNoConsumersException("Error: " + reason, null, null);
- }
- else if (errorCode == AMQConstant.NO_ROUTE)
- {
- throw new AMQNoRouteException("Error: " + reason, null, null);
- }
- else if (errorCode == AMQConstant.INVALID_ARGUMENT)
- {
- _logger.debug("Broker responded with Invalid Argument.");
-
- throw new org.apache.qpid.AMQInvalidArgumentException(String.valueOf(reason), null);
- }
- else if (errorCode == AMQConstant.INVALID_ROUTING_KEY)
- {
- _logger.debug("Broker responded with Invalid Routing Key.");
-
- throw new AMQInvalidRoutingKeyException(String.valueOf(reason), null);
- }
- else
- {
- throw new AMQChannelClosedException(errorCode, "Error: " + reason, null);
- }
-
- }
- // fixme why is this only done when the close is expected...
- // should the above forced closes not also cause a close?
- // ----------
- // Closing the session only when it is expected allows the errors to be processed
- // Calling this here will prevent failover. So we should do this for all exceptions
- // that should never cause failover. Such as authentication errors.
-
- session.channelClosed(channelId, errorCode, String.valueOf(reason));
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseOkMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseOkMethodHandler.java
deleted file mode 100644
index 9a9a0b4e63..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseOkMethodHandler.java
+++ /dev/null
@@ -1,49 +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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ChannelCloseOkBody;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ChannelCloseOkMethodHandler implements StateAwareMethodListener<ChannelCloseOkBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(ChannelCloseOkMethodHandler.class);
-
- private static final ChannelCloseOkMethodHandler _instance = new ChannelCloseOkMethodHandler();
-
- public static ChannelCloseOkMethodHandler getInstance()
- {
- return _instance;
- }
-
- public void methodReceived(AMQProtocolSession session, ChannelCloseOkBody method, int channelId)
- throws AMQException
- {
- _logger.info("Received channel-close-ok for channel-id " + channelId);
-
- // todo this should do the local closure
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowMethodHandler.java
deleted file mode 100644
index 2153b9cc8c..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowMethodHandler.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.framing.ChannelFlowBody;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.AMQException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/*
-*
-* 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.
-*
-*/
-
-public class ChannelFlowMethodHandler implements StateAwareMethodListener<ChannelFlowBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(ChannelFlowMethodHandler.class);
- private static final ChannelFlowMethodHandler _instance = new ChannelFlowMethodHandler();
-
- public static ChannelFlowMethodHandler getInstance()
- {
- return _instance;
- }
-
- private ChannelFlowMethodHandler()
- { }
-
- public void methodReceived(AMQProtocolSession session, ChannelFlowBody body, int channelId)
- throws AMQException
- {
- session.setFlowControl(channelId, body.getActive());
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowOkMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowOkMethodHandler.java
deleted file mode 100644
index 6f66a972d5..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowOkMethodHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.ChannelFlowOkBody;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ChannelFlowOkMethodHandler implements StateAwareMethodListener<ChannelFlowOkBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(ChannelFlowOkMethodHandler.class);
- private static final ChannelFlowOkMethodHandler _instance = new ChannelFlowOkMethodHandler();
-
- public static ChannelFlowOkMethodHandler getInstance()
- {
- return _instance;
- }
-
- private ChannelFlowOkMethodHandler()
- { }
-
- public void methodReceived(AMQProtocolSession session, ChannelFlowOkBody body, int channelId)
- throws AMQException
- {
-
- _logger.debug("Received Channel.Flow-Ok message, active = " + body.getActive());
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl.java
deleted file mode 100644
index 9c791730ca..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl.java
+++ /dev/null
@@ -1,529 +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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import java.util.Map;
-import java.util.HashMap;
-
-import org.apache.qpid.framing.*;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.AMQMethodNotImplementedException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ClientMethodDispatcherImpl implements MethodDispatcher
-{
-
- private static final BasicCancelOkMethodHandler _basicCancelOkMethodHandler = BasicCancelOkMethodHandler.getInstance();
- private static final BasicDeliverMethodHandler _basicDeliverMethodHandler = BasicDeliverMethodHandler.getInstance();
- private static final BasicReturnMethodHandler _basicReturnMethodHandler = BasicReturnMethodHandler.getInstance();
- private static final ChannelCloseMethodHandler _channelCloseMethodHandler = ChannelCloseMethodHandler.getInstance();
- private static final ChannelFlowOkMethodHandler _channelFlowOkMethodHandler = ChannelFlowOkMethodHandler.getInstance();
- private static final ConnectionCloseMethodHandler _connectionCloseMethodHandler = ConnectionCloseMethodHandler.getInstance();
- private static final ConnectionOpenOkMethodHandler _connectionOpenOkMethodHandler = ConnectionOpenOkMethodHandler.getInstance();
- private static final ConnectionRedirectMethodHandler _connectionRedirectMethodHandler = ConnectionRedirectMethodHandler.getInstance();
- private static final ConnectionSecureMethodHandler _connectionSecureMethodHandler = ConnectionSecureMethodHandler.getInstance();
- private static final ConnectionStartMethodHandler _connectionStartMethodHandler = ConnectionStartMethodHandler.getInstance();
- private static final ConnectionTuneMethodHandler _connectionTuneMethodHandler = ConnectionTuneMethodHandler.getInstance();
- private static final ExchangeBoundOkMethodHandler _exchangeBoundOkMethodHandler = ExchangeBoundOkMethodHandler.getInstance();
- private static final QueueDeleteOkMethodHandler _queueDeleteOkMethodHandler = QueueDeleteOkMethodHandler.getInstance();
-
- private static final Logger _logger = LoggerFactory.getLogger(ClientMethodDispatcherImpl.class);
-
- private static interface DispatcherFactory
- {
- public ClientMethodDispatcherImpl createMethodDispatcher(AMQProtocolSession session);
- }
-
- private static final Map<ProtocolVersion, DispatcherFactory> _dispatcherFactories =
- new HashMap<ProtocolVersion, DispatcherFactory>();
-
- static
- {
- _dispatcherFactories.put(ProtocolVersion.v8_0,
- new DispatcherFactory()
- {
- public ClientMethodDispatcherImpl createMethodDispatcher(AMQProtocolSession session)
- {
- return new ClientMethodDispatcherImpl_8_0(session);
- }
- });
-
- _dispatcherFactories.put(ProtocolVersion.v0_9,
- new DispatcherFactory()
- {
- public ClientMethodDispatcherImpl createMethodDispatcher(AMQProtocolSession session)
- {
- return new ClientMethodDispatcherImpl_0_9(session);
- }
- });
-
- }
-
- public static ClientMethodDispatcherImpl newMethodDispatcher(ProtocolVersion version, AMQProtocolSession session)
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("New Method Dispatcher:" + session);
- }
-
- DispatcherFactory factory = _dispatcherFactories.get(version);
- return factory.createMethodDispatcher(session);
- }
-
- AMQProtocolSession _session;
-
- public ClientMethodDispatcherImpl(AMQProtocolSession session)
- {
- _session = session;
- }
-
- public AMQStateManager getStateManager()
- {
- return _session.getStateManager();
- }
-
- public boolean dispatchAccessRequestOk(AccessRequestOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchBasicCancelOk(BasicCancelOkBody body, int channelId) throws AMQException
- {
- _basicCancelOkMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchBasicConsumeOk(BasicConsumeOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchBasicDeliver(BasicDeliverBody body, int channelId) throws AMQException
- {
- _basicDeliverMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchBasicGetEmpty(BasicGetEmptyBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchBasicGetOk(BasicGetOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchBasicQosOk(BasicQosOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchBasicReturn(BasicReturnBody body, int channelId) throws AMQException
- {
- _basicReturnMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchChannelClose(ChannelCloseBody body, int channelId) throws AMQException
- {
- _channelCloseMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchChannelCloseOk(ChannelCloseOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchChannelFlow(ChannelFlowBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchChannelFlowOk(ChannelFlowOkBody body, int channelId) throws AMQException
- {
- _channelFlowOkMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchChannelOpenOk(ChannelOpenOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchConnectionClose(ConnectionCloseBody body, int channelId) throws AMQException
- {
- _connectionCloseMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchConnectionCloseOk(ConnectionCloseOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchConnectionOpenOk(ConnectionOpenOkBody body, int channelId) throws AMQException
- {
- _connectionOpenOkMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchConnectionRedirect(ConnectionRedirectBody body, int channelId) throws AMQException
- {
- _connectionRedirectMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchConnectionSecure(ConnectionSecureBody body, int channelId) throws AMQException
- {
- _connectionSecureMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchConnectionStart(ConnectionStartBody body, int channelId) throws AMQException
- {
- _connectionStartMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchConnectionTune(ConnectionTuneBody body, int channelId) throws AMQException
- {
- _connectionTuneMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchQueueDeleteOk(QueueDeleteOkBody body, int channelId) throws AMQException
- {
- _queueDeleteOkMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchQueuePurgeOk(QueuePurgeOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchStreamCancelOk(StreamCancelOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchStreamConsumeOk(StreamConsumeOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchAccessRequest(AccessRequestBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchBasicAck(BasicAckBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchBasicCancel(BasicCancelBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchBasicConsume(BasicConsumeBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchBasicGet(BasicGetBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchBasicPublish(BasicPublishBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchBasicQos(BasicQosBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchBasicRecover(BasicRecoverBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchBasicReject(BasicRejectBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchChannelOpen(ChannelOpenBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchConnectionOpen(ConnectionOpenBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchConnectionSecureOk(ConnectionSecureOkBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchConnectionStartOk(ConnectionStartOkBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchConnectionTuneOk(ConnectionTuneOkBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchDtxSelect(DtxSelectBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchDtxStart(DtxStartBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchExchangeBound(ExchangeBoundBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchExchangeDeclare(ExchangeDeclareBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchExchangeDelete(ExchangeDeleteBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileAck(FileAckBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileCancel(FileCancelBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileConsume(FileConsumeBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFilePublish(FilePublishBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileQos(FileQosBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileReject(FileRejectBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchQueueBind(QueueBindBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchQueueDeclare(QueueDeclareBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchQueueDelete(QueueDeleteBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchQueuePurge(QueuePurgeBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchStreamCancel(StreamCancelBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchStreamConsume(StreamConsumeBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchStreamPublish(StreamPublishBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchStreamQos(StreamQosBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchTunnelRequest(TunnelRequestBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchTxCommit(TxCommitBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchTxRollback(TxRollbackBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchTxSelect(TxSelectBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchDtxSelectOk(DtxSelectOkBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchDtxStartOk(DtxStartOkBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchExchangeBoundOk(ExchangeBoundOkBody body, int channelId) throws AMQException
- {
- _exchangeBoundOkMethodHandler.methodReceived(_session, body, channelId);
- return true;
- }
-
- public boolean dispatchExchangeDeclareOk(ExchangeDeclareOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchExchangeDeleteOk(ExchangeDeleteOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchFileCancelOk(FileCancelOkBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileConsumeOk(FileConsumeOkBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileDeliver(FileDeliverBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileOpen(FileOpenBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileOpenOk(FileOpenOkBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileQosOk(FileQosOkBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileReturn(FileReturnBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchFileStage(FileStageBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchQueueBindOk(QueueBindOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchQueueDeclareOk(QueueDeclareOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchStreamDeliver(StreamDeliverBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchStreamQosOk(StreamQosOkBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchStreamReturn(StreamReturnBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchTxCommitOk(TxCommitOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTxRollbackOk(TxRollbackOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTxSelectOk(TxSelectOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_0_9.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_0_9.java
deleted file mode 100644
index d3e9fba8ed..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_0_9.java
+++ /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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.framing.*;
-import org.apache.qpid.framing.amqp_0_9.MethodDispatcher_0_9;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.AMQMethodNotImplementedException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-
-public class ClientMethodDispatcherImpl_0_9 extends ClientMethodDispatcherImpl implements MethodDispatcher_0_9
-{
- public ClientMethodDispatcherImpl_0_9(AMQProtocolSession session)
- {
- super(session);
- }
-
- public boolean dispatchBasicRecoverSyncOk(BasicRecoverSyncOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchBasicRecoverSync(BasicRecoverSyncBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchChannelOk(ChannelOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchChannelPing(ChannelPingBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchChannelPong(ChannelPongBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchChannelResume(ChannelResumeBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchMessageAppend(MessageAppendBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageCancel(MessageCancelBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchMessageCheckpoint(MessageCheckpointBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageClose(MessageCloseBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageConsume(MessageConsumeBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchMessageEmpty(MessageEmptyBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageGet(MessageGetBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchMessageOffset(MessageOffsetBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageOk(MessageOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageOpen(MessageOpenBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageQos(MessageQosBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchMessageRecover(MessageRecoverBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchMessageReject(MessageRejectBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageResume(MessageResumeBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchMessageTransfer(MessageTransferBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchQueueUnbind(QueueUnbindBody body, int channelId) throws AMQException
- {
- throw new AMQMethodNotImplementedException(body);
- }
-
- public boolean dispatchQueueUnbindOk(QueueUnbindOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_8_0.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_8_0.java
deleted file mode 100644
index 19f758817d..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_8_0.java
+++ /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.
- *
- */
- package org.apache.qpid.client.handler;
-
-import org.apache.qpid.framing.*;
-import org.apache.qpid.framing.amqp_8_0.MethodDispatcher_8_0;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-
-public class ClientMethodDispatcherImpl_8_0 extends ClientMethodDispatcherImpl implements MethodDispatcher_8_0
-{
- public ClientMethodDispatcherImpl_8_0(AMQProtocolSession session)
- {
- super(session);
- }
-
- public boolean dispatchBasicRecoverOk(BasicRecoverOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchChannelAlert(ChannelAlertBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestContent(TestContentBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestContentOk(TestContentOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestInteger(TestIntegerBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestIntegerOk(TestIntegerOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestString(TestStringBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestStringOk(TestStringOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestTable(TestTableBody body, int channelId) throws AMQException
- {
- return false;
- }
-
- public boolean dispatchTestTableOk(TestTableOkBody body, int channelId) throws AMQException
- {
- return false;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionCloseMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionCloseMethodHandler.java
deleted file mode 100644
index bc82d6bc62..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionCloseMethodHandler.java
+++ /dev/null
@@ -1,106 +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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQConnectionClosedException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQAuthenticationException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ConnectionCloseBody;
-import org.apache.qpid.framing.ConnectionCloseOkBody;
-import org.apache.qpid.protocol.AMQConstant;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ConnectionCloseMethodHandler implements StateAwareMethodListener<ConnectionCloseBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(ConnectionCloseMethodHandler.class);
-
- private static ConnectionCloseMethodHandler _handler = new ConnectionCloseMethodHandler();
-
- public static ConnectionCloseMethodHandler getInstance()
- {
- return _handler;
- }
-
- private ConnectionCloseMethodHandler()
- {
- }
-
- public void methodReceived(AMQProtocolSession session, ConnectionCloseBody method, int channelId)
- throws AMQException
- {
- _logger.info("ConnectionClose frame received");
-
- // does it matter
- // stateManager.changeState(AMQState.CONNECTION_CLOSING);
-
- AMQConstant errorCode = AMQConstant.getConstant(method.getReplyCode());
- AMQShortString reason = method.getReplyText();
-
- AMQException error = null;
-
- try
- {
-
- ConnectionCloseOkBody closeOkBody = session.getMethodRegistry().createConnectionCloseOkBody();
- // TODO: check whether channel id of zero is appropriate
- // Be aware of possible changes to parameter order as versions change.
- session.writeFrame(closeOkBody.generateFrame(0));
-
- if (errorCode != AMQConstant.REPLY_SUCCESS)
- {
- if (errorCode == AMQConstant.NOT_ALLOWED || (errorCode == AMQConstant.ACCESS_REFUSED))
- {
- _logger.info("Error :" + errorCode + ":" + Thread.currentThread().getName());
-
- error = new AMQAuthenticationException(errorCode, reason == null ? null : reason.toString(), null);
- }
- else
- {
- _logger.info("Connection close received with error code " + errorCode);
-
- error = new AMQConnectionClosedException(errorCode, "Error: " + reason, null);
- }
- }
- }
- finally
- {
-
- if (error != null)
- {
- session.notifyError(error);
- }
-
- // Close the protocol Session, including any open TCP connections
- session.closeProtocolSession();
-
- // Closing the session should not introduce a race condition as this thread will continue to propgate any
- // exception in to the exceptionCaught method of the SessionHandler.
- // Any sessionClosed event should occur after this.
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java
deleted file mode 100644
index e639a33450..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java
+++ /dev/null
@@ -1,49 +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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ConnectionOpenOkBody;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-
-public class ConnectionOpenOkMethodHandler implements StateAwareMethodListener<ConnectionOpenOkBody>
-{
- private static final ConnectionOpenOkMethodHandler _instance = new ConnectionOpenOkMethodHandler();
-
- public static ConnectionOpenOkMethodHandler getInstance()
- {
- return _instance;
- }
-
- private ConnectionOpenOkMethodHandler()
- {
- }
-
- public void methodReceived(AMQProtocolSession session, ConnectionOpenOkBody body, int channelId)
- throws AMQException
- {
- session.getStateManager().changeState(AMQState.CONNECTION_OPEN);
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionRedirectMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionRedirectMethodHandler.java
deleted file mode 100644
index 472c471fd6..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionRedirectMethodHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.ConnectionRedirectBody;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ConnectionRedirectMethodHandler implements StateAwareMethodListener<ConnectionRedirectBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(ConnectionRedirectMethodHandler.class);
-
- private static final int DEFAULT_REDIRECT_PORT = 5672;
-
- private static ConnectionRedirectMethodHandler _handler = new ConnectionRedirectMethodHandler();
-
- public static ConnectionRedirectMethodHandler getInstance()
- {
- return _handler;
- }
-
- private ConnectionRedirectMethodHandler()
- { }
-
- public void methodReceived(AMQProtocolSession session, ConnectionRedirectBody method, int channelId)
- throws AMQException
- {
- _logger.info("ConnectionRedirect frame received");
-
- String host = method.getHost().toString();
- // the host is in the form hostname:port with the port being optional
- int portIndex = host.indexOf(':');
-
- int port;
- if (portIndex == -1)
- {
- port = DEFAULT_REDIRECT_PORT;
- }
- else
- {
- port = Integer.parseInt(host.substring(portIndex + 1));
- host = host.substring(0, portIndex);
-
- }
-
- session.failover(host, port);
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionSecureMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionSecureMethodHandler.java
deleted file mode 100644
index 9a9bee757b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionSecureMethodHandler.java
+++ /dev/null
@@ -1,70 +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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslException;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.ConnectionSecureBody;
-import org.apache.qpid.framing.ConnectionSecureOkBody;
-
-public class ConnectionSecureMethodHandler implements StateAwareMethodListener<ConnectionSecureBody>
-{
- private static final ConnectionSecureMethodHandler _instance = new ConnectionSecureMethodHandler();
-
- public static ConnectionSecureMethodHandler getInstance()
- {
- return _instance;
- }
-
- public void methodReceived(AMQProtocolSession session, ConnectionSecureBody body, int channelId)
- throws AMQException
- {
- SaslClient client = session.getSaslClient();
- if (client == null)
- {
- throw new AMQException(null, "No SASL client set up - cannot proceed with authentication", null);
- }
-
-
-
- try
- {
- // Evaluate server challenge
- byte[] response = client.evaluateChallenge(body.getChallenge());
-
- ConnectionSecureOkBody secureOkBody = session.getMethodRegistry().createConnectionSecureOkBody(response);
-
- session.writeFrame(secureOkBody.generateFrame(channelId));
- }
- catch (SaslException e)
- {
- throw new AMQException(null, "Error processing SASL challenge: " + e, e);
- }
-
-
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
deleted file mode 100644
index 8857f1115a..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
+++ /dev/null
@@ -1,232 +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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.security.AMQCallbackHandler;
-import org.apache.qpid.client.security.CallbackHandlerRegistry;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.common.ClientProperties;
-import org.apache.qpid.common.QpidProperties;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ConnectionStartBody;
-import org.apache.qpid.framing.ConnectionStartOkBody;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.FieldTableFactory;
-import org.apache.qpid.framing.ProtocolVersion;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslException;
-
-import java.io.UnsupportedEncodingException;
-import java.util.HashSet;
-import java.util.StringTokenizer;
-
-public class ConnectionStartMethodHandler implements StateAwareMethodListener<ConnectionStartBody>
-{
- private static final Logger _log = LoggerFactory.getLogger(ConnectionStartMethodHandler.class);
-
- private static final ConnectionStartMethodHandler _instance = new ConnectionStartMethodHandler();
-
- public static ConnectionStartMethodHandler getInstance()
- {
- return _instance;
- }
-
- private ConnectionStartMethodHandler()
- { }
-
- public void methodReceived(AMQProtocolSession session, ConnectionStartBody body, int channelId)
- throws AMQException
- {
- _log.debug("public void methodReceived(AMQStateManager stateManager, AMQProtocolSession protocolSession, "
- + "AMQMethodEvent evt): called");
-
- ProtocolVersion pv = new ProtocolVersion((byte) body.getVersionMajor(), (byte) body.getVersionMinor());
-
- // For the purposes of interop, we can make the client accept the broker's version string.
- // If it does, it then internally records the version as being the latest one that it understands.
- // It needs to do this since frame lookup is done by version.
- if (Boolean.getBoolean("qpid.accept.broker.version") && !pv.isSupported())
- {
-
- pv = ProtocolVersion.getLatestSupportedVersion();
- }
-
- if (pv.isSupported())
- {
- session.setProtocolVersion(pv);
-
- try
- {
- // Used to hold the SASL mechanism to authenticate with.
- String mechanism;
-
- if (body.getMechanisms()== null)
- {
- throw new AMQException(null, "mechanism not specified in ConnectionStart method frame", null);
- }
- else
- {
- mechanism = chooseMechanism(body.getMechanisms());
- _log.debug("mechanism = " + mechanism);
- }
-
- if (mechanism == null)
- {
- throw new AMQException(null, "No supported security mechanism found, passed: " + new String(body.getMechanisms()), null);
- }
-
- byte[] saslResponse;
- try
- {
- SaslClient sc =
- Sasl.createSaslClient(new String[] { mechanism }, null, "AMQP", "localhost", null,
- createCallbackHandler(mechanism, session));
- if (sc == null)
- {
- throw new AMQException(null, "Client SASL configuration error: no SaslClient could be created for mechanism " + mechanism
- + ". Please ensure all factories are registered. See DynamicSaslRegistrar for "
- + " details of how to register non-standard SASL client providers.", null);
- }
-
- session.setSaslClient(sc);
- saslResponse = (sc.hasInitialResponse() ? sc.evaluateChallenge(new byte[0]) : null);
- }
- catch (SaslException e)
- {
- session.setSaslClient(null);
- throw new AMQException(null, "Unable to create SASL client: " + e, e);
- }
-
- if (body.getLocales() == null)
- {
- throw new AMQException(null, "Locales is not defined in Connection Start method", null);
- }
-
- final String locales = new String(body.getLocales(), "utf8");
- final StringTokenizer tokenizer = new StringTokenizer(locales, " ");
- String selectedLocale = null;
- if (tokenizer.hasMoreTokens())
- {
- selectedLocale = tokenizer.nextToken();
- }
- else
- {
- throw new AMQException(null, "No locales sent from server, passed: " + locales, null);
- }
-
- session.getStateManager().changeState(AMQState.CONNECTION_NOT_TUNED);
- FieldTable clientProperties = FieldTableFactory.newFieldTable();
-
- clientProperties.setString(new AMQShortString(ClientProperties.instance.toString()),
- session.getClientID());
- clientProperties.setString(new AMQShortString(ClientProperties.product.toString()),
- QpidProperties.getProductName());
- clientProperties.setString(new AMQShortString(ClientProperties.version.toString()),
- QpidProperties.getReleaseVersion());
- clientProperties.setString(new AMQShortString(ClientProperties.platform.toString()), getFullSystemInfo());
-
-
- ConnectionStartOkBody connectionStartOkBody = session.getMethodRegistry().createConnectionStartOkBody(clientProperties,new AMQShortString(mechanism),saslResponse,new AMQShortString(locales));
- // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
- // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
- // Be aware of possible changes to parameter order as versions change.
- session.writeFrame(connectionStartOkBody.generateFrame(channelId));
-
- }
- catch (UnsupportedEncodingException e)
- {
- throw new AMQException(null, "Unable to decode data: " + e, e);
- }
- }
- else
- {
- _log.error("Broker requested Protocol [" + body.getVersionMajor() + "-" + body.getVersionMinor()
- + "] which is not supported by this version of the client library");
-
- session.closeProtocolSession();
- }
- }
-
- private String getFullSystemInfo()
- {
- StringBuffer fullSystemInfo = new StringBuffer();
- fullSystemInfo.append(System.getProperty("java.runtime.name"));
- fullSystemInfo.append(", " + System.getProperty("java.runtime.version"));
- fullSystemInfo.append(", " + System.getProperty("java.vendor"));
- fullSystemInfo.append(", " + System.getProperty("os.arch"));
- fullSystemInfo.append(", " + System.getProperty("os.name"));
- fullSystemInfo.append(", " + System.getProperty("os.version"));
- fullSystemInfo.append(", " + System.getProperty("sun.os.patch.level"));
-
- return fullSystemInfo.toString();
- }
-
- private String chooseMechanism(byte[] availableMechanisms) throws UnsupportedEncodingException
- {
- final String mechanisms = new String(availableMechanisms, "utf8");
- StringTokenizer tokenizer = new StringTokenizer(mechanisms, " ");
- HashSet mechanismSet = new HashSet();
- while (tokenizer.hasMoreTokens())
- {
- mechanismSet.add(tokenizer.nextToken());
- }
-
- String preferredMechanisms = CallbackHandlerRegistry.getInstance().getMechanisms();
- StringTokenizer prefTokenizer = new StringTokenizer(preferredMechanisms, " ");
- while (prefTokenizer.hasMoreTokens())
- {
- String mech = prefTokenizer.nextToken();
- if (mechanismSet.contains(mech))
- {
- return mech;
- }
- }
-
- return null;
- }
-
- private AMQCallbackHandler createCallbackHandler(String mechanism, AMQProtocolSession protocolSession)
- throws AMQException
- {
- Class mechanismClass = CallbackHandlerRegistry.getInstance().getCallbackHandlerClass(mechanism);
- try
- {
- Object instance = mechanismClass.newInstance();
- AMQCallbackHandler cbh = (AMQCallbackHandler) instance;
- cbh.initialise(protocolSession);
-
- return cbh;
- }
- catch (Exception e)
- {
- throw new AMQException(null, "Unable to create callback handler: " + e, e);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java
deleted file mode 100644
index e4e58c317d..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.ConnectionTuneParameters;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.*;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ConnectionTuneMethodHandler implements StateAwareMethodListener<ConnectionTuneBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(ConnectionTuneMethodHandler.class);
-
- private static final ConnectionTuneMethodHandler _instance = new ConnectionTuneMethodHandler();
-
- public static ConnectionTuneMethodHandler getInstance()
- {
- return _instance;
- }
-
- protected ConnectionTuneMethodHandler()
- { }
-
- public void methodReceived(AMQProtocolSession session, ConnectionTuneBody frame, int channelId)
- throws AMQException
- {
- _logger.debug("ConnectionTune frame received");
- final MethodRegistry methodRegistry = session.getMethodRegistry();
-
-
- ConnectionTuneParameters params = session.getConnectionTuneParameters();
- if (params == null)
- {
- params = new ConnectionTuneParameters();
- }
-
- params.setFrameMax(frame.getFrameMax());
- params.setChannelMax(frame.getChannelMax());
- params.setHeartbeat(Integer.getInteger("amqj.heartbeat.delay", frame.getHeartbeat()));
- session.setConnectionTuneParameters(params);
-
- session.getStateManager().changeState(AMQState.CONNECTION_NOT_OPENED);
-
- ConnectionTuneOkBody tuneOkBody = methodRegistry.createConnectionTuneOkBody(params.getChannelMax(),
- params.getFrameMax(),
- params.getHeartbeat());
- // Be aware of possible changes to parameter order as versions change.
- session.writeFrame(tuneOkBody.generateFrame(channelId));
-
- String host = session.getAMQConnection().getVirtualHost();
- AMQShortString virtualHost = new AMQShortString("/" + host);
-
- ConnectionOpenBody openBody = methodRegistry.createConnectionOpenBody(virtualHost,null,true);
-
- // Be aware of possible changes to parameter order as versions change.
- session.writeFrame(openBody.generateFrame(channelId));
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ExchangeBoundOkMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ExchangeBoundOkMethodHandler.java
deleted file mode 100644
index 690d782b40..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ExchangeBoundOkMethodHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.ExchangeBoundOkBody;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author Apache Software Foundation
- */
-public class ExchangeBoundOkMethodHandler implements StateAwareMethodListener<ExchangeBoundOkBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(ExchangeBoundOkMethodHandler.class);
- private static final ExchangeBoundOkMethodHandler _instance = new ExchangeBoundOkMethodHandler();
-
- public static ExchangeBoundOkMethodHandler getInstance()
- {
- return _instance;
- }
-
- private ExchangeBoundOkMethodHandler()
- { }
-
- public void methodReceived(AMQProtocolSession session, ExchangeBoundOkBody body, int channelId)
- throws AMQException
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Received Exchange.Bound-Ok message, response code: " + body.getReplyCode() + " text: "
- + body.getReplyText());
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/QueueDeleteOkMethodHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/QueueDeleteOkMethodHandler.java
deleted file mode 100644
index 01d82c9b55..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/handler/QueueDeleteOkMethodHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.QueueDeleteOkBody;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author Apache Software Foundation
- */
-public class QueueDeleteOkMethodHandler implements StateAwareMethodListener<QueueDeleteOkBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(QueueDeleteOkMethodHandler.class);
- private static final QueueDeleteOkMethodHandler _instance = new QueueDeleteOkMethodHandler();
-
- public static QueueDeleteOkMethodHandler getInstance()
- {
- return _instance;
- }
-
- private QueueDeleteOkMethodHandler()
- { }
-
- public void methodReceived(AMQProtocolSession session, QueueDeleteOkBody body, int channelId)
- throws AMQException
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Received Queue.Delete-Ok message, message count: " + body.getMessageCount());
- }
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate.java
deleted file mode 100644
index 7f43e4b4b2..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate.java
+++ /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.
- *
- */
-
-package org.apache.qpid.client.message;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import java.util.Enumeration;
-import java.util.UUID;
-
-public interface AMQMessageDelegate
-{
- void acknowledgeThis() throws JMSException;
-
- String getJMSMessageID() throws JMSException;
-
- void setJMSMessageID(String string) throws JMSException;
-
- long getJMSTimestamp() throws JMSException;
-
- void setJMSTimestamp(long l) throws JMSException;
-
- byte[] getJMSCorrelationIDAsBytes() throws JMSException;
-
- void setJMSCorrelationIDAsBytes(byte[] bytes) throws JMSException;
-
- void setJMSCorrelationID(String string) throws JMSException;
-
- String getJMSCorrelationID() throws JMSException;
-
- Destination getJMSReplyTo() throws JMSException;
-
- void setJMSReplyTo(Destination destination) throws JMSException;
-
- Destination getJMSDestination() throws JMSException;
-
- int getJMSDeliveryMode() throws JMSException;
-
- void setJMSDeliveryMode(int i) throws JMSException;
-
- String getJMSType() throws JMSException;
-
- void setJMSType(String string) throws JMSException;
-
- long getJMSExpiration() throws JMSException;
-
- void setJMSExpiration(long l) throws JMSException;
-
- int getJMSPriority() throws JMSException;
-
- void setJMSPriority(int i) throws JMSException;
-
- void clearProperties() throws JMSException;
-
- boolean propertyExists(String string) throws JMSException;
-
- boolean getBooleanProperty(String string) throws JMSException;
-
- byte getByteProperty(String string) throws JMSException;
-
- short getShortProperty(String string) throws JMSException;
-
- int getIntProperty(String string) throws JMSException;
-
- long getLongProperty(String string) throws JMSException;
-
- float getFloatProperty(String string) throws JMSException;
-
- double getDoubleProperty(String string) throws JMSException;
-
- String getStringProperty(String string) throws JMSException;
-
- Object getObjectProperty(String string) throws JMSException;
-
- Enumeration getPropertyNames() throws JMSException;
-
- void setBooleanProperty(String string, boolean b) throws JMSException;
-
- void setByteProperty(String string, byte b) throws JMSException;
-
- void setShortProperty(String string, short i) throws JMSException;
-
- void setIntProperty(String string, int i) throws JMSException;
-
- void setLongProperty(String string, long l) throws JMSException;
-
- void setFloatProperty(String string, float v) throws JMSException;
-
- void setDoubleProperty(String string, double v) throws JMSException;
-
- void setStringProperty(String string, String string1) throws JMSException;
-
- void setObjectProperty(String string, Object object) throws JMSException;
-
- void acknowledge() throws JMSException;
-
- public void setJMSDestination(Destination destination);
-
- public void setContentType(String contentType);
- public String getContentType();
-
- public void setEncoding(String encoding);
- public String getEncoding();
-
-
- String getReplyToString();
-
- void removeProperty(final String propertyName) throws JMSException;
-
- void setAMQSession(final AMQSession s);
-
- AMQSession getAMQSession();
-
- long getDeliveryTag();
-
- void setJMSMessageID(final UUID messageId) throws JMSException;
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegateFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegateFactory.java
deleted file mode 100644
index 8c3f2fd08f..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegateFactory.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-
-package org.apache.qpid.client.message;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.AMQException;
-
-public interface AMQMessageDelegateFactory<D extends AMQMessageDelegate>
-{
- public static AMQMessageDelegateFactory DEFAULT_FACTORY = null;
-
- public static AMQMessageDelegateFactory<AMQMessageDelegate_0_8> FACTORY_0_8 =
- new AMQMessageDelegateFactory<AMQMessageDelegate_0_8>()
- {
- public AMQMessageDelegate_0_8 createDelegate()
- {
- return new AMQMessageDelegate_0_8();
- }
- };
-
- public static AMQMessageDelegateFactory<AMQMessageDelegate_0_10> FACTORY_0_10 =
- new AMQMessageDelegateFactory<AMQMessageDelegate_0_10>()
- {
- public AMQMessageDelegate_0_10 createDelegate()
- {
- return new AMQMessageDelegate_0_10();
- }
- };
-
-
- public D createDelegate();
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
deleted file mode 100644
index d064c27754..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
+++ /dev/null
@@ -1,972 +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.
- *
- */
-
-package org.apache.qpid.client.message;
-
-import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.qpid.client.*;
-import org.apache.qpid.framing.ContentHeaderProperties;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQPInvalidClassException;
-import org.apache.qpid.jms.Message;
-import org.apache.qpid.url.BindingURL;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.transport.*;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.MessageNotWriteableException;
-import javax.jms.MessageFormatException;
-import javax.jms.DeliveryMode;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
-import java.net.URISyntaxException;
-import java.nio.charset.Charset;
-import org.apache.qpid.exchange.ExchangeDefaults;
-
-public class AMQMessageDelegate_0_10 implements AMQMessageDelegate
-{
- private static final Map<ReplyTo, Destination> _destinationCache = Collections.synchronizedMap(new ReferenceMap());
-
- public static final String JMS_TYPE = "x-jms-type";
-
-
- private boolean _readableProperties = false;
-
- private Destination _destination;
-
-
- private MessageProperties _messageProps;
- private DeliveryProperties _deliveryProps;
- /** If the acknowledge mode is CLIENT_ACKNOWLEDGE the session is required */
- private AMQSession _session;
- private final long _deliveryTag;
-
- private static Map<AMQShortString,Integer> _exchangeTypeMap = new ConcurrentHashMap<AMQShortString, Integer>();
- private static Map<String,Integer> _exchangeTypeStringMap = new ConcurrentHashMap<String, Integer>();
- private static Map<String, Integer> _exchangeTypeToDestinationType = new ConcurrentHashMap<String, Integer>();;
-
- static
- {
- _exchangeTypeMap.put(ExchangeDefaults.DIRECT_EXCHANGE_NAME, AMQDestination.QUEUE_TYPE);
- _exchangeTypeMap.put(AMQShortString.EMPTY_STRING, AMQDestination.QUEUE_TYPE);
- _exchangeTypeMap.put(ExchangeDefaults.TOPIC_EXCHANGE_NAME, AMQDestination.TOPIC_TYPE);
- _exchangeTypeMap.put(ExchangeDefaults.FANOUT_EXCHANGE_NAME, AMQDestination.TOPIC_TYPE);
-
- _exchangeTypeStringMap.put(ExchangeDefaults.DIRECT_EXCHANGE_NAME.toString(), AMQDestination.QUEUE_TYPE);
- _exchangeTypeStringMap.put("", AMQDestination.QUEUE_TYPE);
- _exchangeTypeStringMap.put(ExchangeDefaults.TOPIC_EXCHANGE_NAME.toString(), AMQDestination.TOPIC_TYPE);
- _exchangeTypeStringMap.put(ExchangeDefaults.FANOUT_EXCHANGE_NAME.toString(), AMQDestination.TOPIC_TYPE);
-
-
- _exchangeTypeToDestinationType.put(ExchangeDefaults.DIRECT_EXCHANGE_CLASS.toString(), AMQDestination.QUEUE_TYPE);
- _exchangeTypeToDestinationType.put(ExchangeDefaults.TOPIC_EXCHANGE_NAME.toString(), AMQDestination.TOPIC_TYPE);
- _exchangeTypeToDestinationType.put(ExchangeDefaults.FANOUT_EXCHANGE_NAME.toString(), AMQDestination.TOPIC_TYPE);
- }
-
- protected AMQMessageDelegate_0_10()
- {
- this(new MessageProperties(), new DeliveryProperties(), -1);
- _readableProperties = false;
- }
-
- protected AMQMessageDelegate_0_10(long deliveryTag, MessageProperties messageProps, DeliveryProperties deliveryProps, AMQShortString exchange,
- AMQShortString routingKey) throws AMQException
- {
- this(messageProps, deliveryProps, deliveryTag);
-
-
- AMQDestination dest;
-
- dest = generateDestination(exchange, routingKey);
- setJMSDestination(dest);
- }
-
- private AMQDestination generateDestination(AMQShortString exchange, AMQShortString routingKey)
- {
- AMQDestination dest;
- switch(getExchangeType(exchange))
- {
- case AMQDestination.QUEUE_TYPE:
- dest = new AMQQueue(exchange, routingKey, routingKey);
- break;
- case AMQDestination.TOPIC_TYPE:
- dest = new AMQTopic(exchange, routingKey, null);
- break;
- default:
- dest = new AMQUndefinedDestination(exchange, routingKey, null);
-
- }
-
- return dest;
- }
-
- private int getExchangeType(AMQShortString exchange)
- {
- Integer type = _exchangeTypeMap.get(exchange == null ? AMQShortString.EMPTY_STRING : exchange);
-
- if(type == null)
- {
- return AMQDestination.UNKNOWN_TYPE;
- }
-
-
- return type;
- }
-
-
- public static void updateExchangeTypeMapping(Header header, org.apache.qpid.transport.Session session)
- {
- DeliveryProperties deliveryProps = header.get(DeliveryProperties.class);
- if(deliveryProps != null)
- {
- String exchange = deliveryProps.getExchange();
-
- if(exchange != null && !_exchangeTypeStringMap.containsKey(exchange))
- {
-
- AMQShortString exchangeShortString = new AMQShortString(exchange);
- Future<ExchangeQueryResult> future =
- session.exchangeQuery(exchange.toString());
- ExchangeQueryResult res = future.get();
-
- Integer type = _exchangeTypeToDestinationType.get(res.getType());
- if(type == null)
- {
- type = AMQDestination.UNKNOWN_TYPE;
- }
- _exchangeTypeStringMap.put(exchange, type);
- _exchangeTypeMap.put(exchangeShortString, type);
-
- }
- }
- }
-
- protected AMQMessageDelegate_0_10(MessageProperties messageProps, DeliveryProperties deliveryProps, long deliveryTag)
- {
- _messageProps = messageProps;
- _deliveryProps = deliveryProps;
- _deliveryTag = deliveryTag;
- _readableProperties = (_messageProps != null);
-
- }
-
-
- public String getJMSMessageID() throws JMSException
- {
- UUID id = _messageProps.getMessageId();
- return id == null ? null : "ID:" + id;
- }
-
- public void setJMSMessageID(String messageId) throws JMSException
- {
- if(messageId == null)
- {
- _messageProps.clearMessageId();
- }
- else
- {
- if(messageId.startsWith("ID:"))
- {
- try
- {
- _messageProps.setMessageId(UUID.fromString(messageId.substring(3)));
- }
- catch(IllegalArgumentException ex)
- {
- throw new JMSException("MessageId '"+messageId+"' is not of the correct format, it must be ID: followed by a UUID");
- }
- }
- else
- {
- throw new JMSException("MessageId '"+messageId+"' is not of the correct format, it must be ID: followed by a UUID");
- }
- }
- }
-
- public void setJMSMessageID(UUID messageId) throws JMSException
- {
- if(messageId == null)
- {
- _messageProps.clearMessageId();
- }
- else
- {
- _messageProps.setMessageId(messageId);
- }
- }
-
-
- public long getJMSTimestamp() throws JMSException
- {
- return _deliveryProps.getTimestamp();
- }
-
- public void setJMSTimestamp(long timestamp) throws JMSException
- {
- _deliveryProps.setTimestamp(timestamp);
- }
-
- public byte[] getJMSCorrelationIDAsBytes() throws JMSException
- {
- return _messageProps.getCorrelationId();
- }
-
- public void setJMSCorrelationIDAsBytes(byte[] bytes) throws JMSException
- {
- _messageProps.setCorrelationId(bytes);
- }
-
- public void setJMSCorrelationID(String correlationId) throws JMSException
- {
-
- setJMSCorrelationIDAsBytes(correlationId == null ? null : correlationId.getBytes());
- }
-
- public String getJMSCorrelationID() throws JMSException
- {
-
- byte[] correlationIDAsBytes = getJMSCorrelationIDAsBytes();
- return correlationIDAsBytes == null ? null : new String(correlationIDAsBytes);
- }
-
- public Destination getJMSReplyTo()
- {
- ReplyTo replyTo = _messageProps.getReplyTo();
-
- if (replyTo == null)
- {
- return null;
- }
- else
- {
- Destination dest = _destinationCache.get(replyTo);
- if (dest == null)
- {
- String exchange = replyTo.getExchange();
- String routingKey = replyTo.getRoutingKey();
-
- dest = generateDestination(exchange == null ? null : new AMQShortString(exchange),
- routingKey == null ? null : new AMQShortString(routingKey));
-
-
-
-
-
- _destinationCache.put(replyTo, dest);
- }
-
- return dest;
- }
- }
-
- public void setJMSReplyTo(Destination destination) throws JMSException
- {
- if (destination == null)
- {
- throw new IllegalArgumentException("Null destination not allowed");
- }
-
- if (!(destination instanceof AMQDestination))
- {
- throw new IllegalArgumentException(
- "ReplyTo destination may only be an AMQDestination - passed argument was type " + destination.getClass());
- }
-
- final AMQDestination amqd = (AMQDestination) destination;
-
- final ReplyTo replyTo = new ReplyTo(amqd.getExchangeName().toString(), amqd.getRoutingKey().toString());
- _destinationCache.put(replyTo, destination);
- _messageProps.setReplyTo(replyTo);
-
- }
-
- public Destination getJMSDestination() throws JMSException
- {
- return _destination;
- }
-
- public void setJMSDestination(Destination destination)
- {
- _destination = destination;
- }
-
- public void setContentType(String contentType)
- {
- _messageProps.setContentType(contentType);
- }
-
- public String getContentType()
- {
- return _messageProps.getContentType();
- }
-
- public void setEncoding(String encoding)
- {
- if(encoding == null || encoding.length() == 0)
- {
- _messageProps.clearContentEncoding();
- }
- else
- {
- _messageProps.setContentEncoding(encoding);
- }
- }
-
- public String getEncoding()
- {
- return _messageProps.getContentEncoding();
- }
-
- public String getReplyToString()
- {
- Destination replyTo = getJMSReplyTo();
- if(replyTo != null)
- {
- return ((AMQDestination)replyTo).toURL();
- }
- else
- {
- return null;
- }
-
- }
-
- public int getJMSDeliveryMode() throws JMSException
- {
-
- MessageDeliveryMode deliveryMode = _deliveryProps.getDeliveryMode();
- if(deliveryMode != null)
- {
- switch(deliveryMode)
- {
- case PERSISTENT :
- return DeliveryMode.PERSISTENT;
- case NON_PERSISTENT:
- return DeliveryMode.NON_PERSISTENT;
- default:
- throw new JMSException("Unknown Message Delivery Mode: " + _deliveryProps.getDeliveryMode());
- }
- }
- else
- {
- return Message.DEFAULT_DELIVERY_MODE;
- }
-
- }
-
- public void setJMSDeliveryMode(int deliveryMode) throws JMSException
- {
- switch(deliveryMode)
- {
- case DeliveryMode.PERSISTENT:
- _deliveryProps.setDeliveryMode(MessageDeliveryMode.PERSISTENT);
- break;
- case DeliveryMode.NON_PERSISTENT:
- _deliveryProps.setDeliveryMode(MessageDeliveryMode.NON_PERSISTENT);
- break;
- default:
- throw new JMSException("Unknown JMS Delivery Mode: " + deliveryMode);
- }
-
- }
-
-
- public String getJMSType() throws JMSException
- {
- if(getApplicationHeaders().containsKey(JMS_TYPE))
- {
- return getStringProperty(JMS_TYPE);
- }
- else
- {
- return null;
- }
- }
-
- private Map<String, Object> getApplicationHeaders()
- {
- Map<String, Object> map = _messageProps.getApplicationHeaders();
- return map == null ? Collections.EMPTY_MAP : map;
- }
-
- public void setJMSType(String type) throws JMSException
- {
- Map<String, Object> headers = _messageProps.getApplicationHeaders();
- if(type == null)
- {
- if(headers != null)
- {
- headers.remove(JMS_TYPE);
- }
- }
- else
- {
- if(headers == null)
- {
- headers = new HashMap<String,Object>();
- _messageProps.setApplicationHeaders(headers);
-
- }
- headers.put(JMS_TYPE, type);
- }
- }
-
- public long getJMSExpiration() throws JMSException
- {
- return _deliveryProps.getExpiration();
- }
-
- public void setJMSExpiration(long l) throws JMSException
- {
- _deliveryProps.setExpiration(l);
- }
-
-
-
- public boolean propertyExists(String propertyName) throws JMSException
- {
- return getApplicationHeaders().containsKey(propertyName);
- }
-
- public boolean getBooleanProperty(String propertyName) throws JMSException
- {
- checkPropertyName(propertyName);
-
- Object o = getApplicationHeaders().get(propertyName);
-
- if(o instanceof Boolean)
- {
- return ((Boolean)o).booleanValue();
- }
- else if(o instanceof String)
- {
- return Boolean.valueOf((String) o).booleanValue();
- }
- else if(getApplicationHeaders().containsKey(propertyName))
- {
- throw new MessageFormatException("getBooleanProperty(\""+propertyName+"\") failed as value is not boolean: " + o);
- }
- else
- {
- return Boolean.valueOf(null);
- }
- }
-
- public byte getByteProperty(String propertyName) throws JMSException
- {
- checkPropertyName(propertyName);
-
- Map<String, Object> propertyMap = getApplicationHeaders();
-
- Object o = propertyMap.get(propertyName);
-
- if(o instanceof Byte)
- {
- return ((Byte)o).byteValue();
- }
- else if(o instanceof String)
- {
- return Byte.valueOf((String) o).byteValue();
- }
- else if(getApplicationHeaders().containsKey(propertyName))
- {
- throw new MessageFormatException("getByteProperty(\""+propertyName+"\") failed as value is not a byte: " + o);
- }
- else
- {
- return Byte.valueOf(null);
- }
- }
-
- public short getShortProperty(String propertyName) throws JMSException
- {
- checkPropertyName(propertyName);
-
- Map<String, Object> propertyMap = getApplicationHeaders();
-
- Object o = propertyMap.get(propertyName);
-
- if(o instanceof Short)
- {
- return ((Short)o).shortValue();
- }
- else
- {
- try
- {
- return Short.valueOf(getByteProperty(propertyName));
- }
- catch(MessageFormatException e)
- {
- throw new MessageFormatException("getShortProperty(\""+propertyName+"\") failed as value is not a short: " + o);
- }
- }
-
-
- }
-
- public int getIntProperty(String propertyName) throws JMSException
- {
- checkPropertyName(propertyName);
-
- Map<String, Object> propertyMap = getApplicationHeaders();
-
- Object o = propertyMap.get(propertyName);
-
- if(o instanceof Integer)
- {
- return ((Integer)o).intValue();
- }
- else
- {
- try
- {
- return Integer.valueOf(getShortProperty(propertyName));
- }
- catch(MessageFormatException e)
- {
- throw new MessageFormatException("getIntProperty(\""+propertyName+"\") failed as value is not an int: " + o);
- }
-
- }
- }
-
- public long getLongProperty(String propertyName) throws JMSException
- {
- checkPropertyName(propertyName);
-
- Map<String, Object> propertyMap = getApplicationHeaders();
-
- Object o = propertyMap.get(propertyName);
-
- if(o instanceof Long)
- {
- return ((Long)o).longValue();
- }
- else
- {
- try
- {
- return Long.valueOf(getIntProperty(propertyName));
- }
- catch(MessageFormatException e)
- {
- throw new MessageFormatException("getLongProperty(\""+propertyName+"\") failed as value is not a long: " + o);
- }
-
- }
- }
-
- public float getFloatProperty(String propertyName) throws JMSException
- {
- checkPropertyName(propertyName);
- Map<String, Object> propertyMap = getApplicationHeaders();
-
- Object o = propertyMap.get(propertyName);
-
- if(o instanceof Float)
- {
- return ((Float)o).floatValue();
- }
- else if(o instanceof String)
- {
- return Float.valueOf((String) o).floatValue();
- }
- else if(getApplicationHeaders().containsKey(propertyName))
- {
- throw new MessageFormatException("getFloatProperty(\""+propertyName+"\") failed as value is not a float: " + o);
- }
- else
- {
- return Float.valueOf(null);
- }
-
- }
-
- public double getDoubleProperty(String propertyName) throws JMSException
- {
- checkPropertyName(propertyName);
-
- Map<String, Object> propertyMap = getApplicationHeaders();
-
- Object o = propertyMap.get(propertyName);
-
- if(o instanceof Double)
- {
- return ((Double)o).doubleValue();
- }
- else
- {
- try
- {
- return Double.valueOf(getFloatProperty(propertyName));
- }
- catch(MessageFormatException e)
- {
- throw new MessageFormatException("getDoubleProperty(\""+propertyName+"\") failed as value is not a double: " + o);
- }
-
- }
- }
-
- public String getStringProperty(String propertyName) throws JMSException
- {
- if (propertyName.equals(CustomJMSXProperty.JMSXUserID.toString()))
- {
- return new String(_messageProps.getUserId());
- }
- else
- {
- checkPropertyName(propertyName);
- Map<String, Object> propertyMap = getApplicationHeaders();
-
- Object o = propertyMap.get(propertyName);
-
- if(o instanceof String)
- {
- return (String) o;
- }
- else if(o == null)
- {
- return null;
- }
- else if(o.getClass().isArray())
- {
- throw new MessageFormatException("getString(\""+propertyName+"\") failed as value of type " + o.getClass()+ " is an array.");
- }
- else
- {
- return String.valueOf(o);
- }
-
- }
- }
-
- public Object getObjectProperty(String propertyName) throws JMSException
- {
- checkPropertyName(propertyName);
- Map<String, Object> propertyMap = getApplicationHeaders();
-
- return propertyMap.get(propertyName);
-
- }
-
- public Enumeration getPropertyNames() throws JMSException
- {
- return java.util.Collections.enumeration(getApplicationHeaders().keySet());
- }
-
- public void setBooleanProperty(String propertyName, boolean b) throws JMSException
- {
- checkPropertyName(propertyName);
- checkWritableProperties();
- setApplicationHeader(propertyName, b);
- }
-
- public void setByteProperty(String propertyName, byte b) throws JMSException
- {
- checkPropertyName(propertyName);
- checkWritableProperties();
- setApplicationHeader(propertyName, b);
- }
-
- public void setShortProperty(String propertyName, short i) throws JMSException
- {
- checkPropertyName(propertyName);
- checkWritableProperties();
- setApplicationHeader(propertyName, i);
- }
-
- public void setIntProperty(String propertyName, int i) throws JMSException
- {
- checkPropertyName(propertyName);
- checkWritableProperties();
- setApplicationHeader(propertyName, i);
- }
-
- public void setLongProperty(String propertyName, long l) throws JMSException
- {
- checkPropertyName(propertyName);
- checkWritableProperties();
- setApplicationHeader(propertyName, l);
- }
-
- public void setFloatProperty(String propertyName, float f) throws JMSException
- {
- checkPropertyName(propertyName);
- checkWritableProperties();
- setApplicationHeader(propertyName, f);
- }
-
- public void setDoubleProperty(String propertyName, double v) throws JMSException
- {
- checkPropertyName(propertyName);
- checkWritableProperties();
- setApplicationHeader(propertyName, v);
- }
-
- public void setStringProperty(String propertyName, String value) throws JMSException
- {
- checkPropertyName(propertyName);
- checkWritableProperties();
- setApplicationHeader(propertyName, value);
- }
-
- private static final Set<Class> ALLOWED = new HashSet();
- static
- {
- ALLOWED.add(Boolean.class);
- ALLOWED.add(Byte.class);
- ALLOWED.add(Short.class);
- ALLOWED.add(Integer.class);
- ALLOWED.add(Long.class);
- ALLOWED.add(Float.class);
- ALLOWED.add(Double.class);
- ALLOWED.add(Character.class);
- ALLOWED.add(String.class);
- ALLOWED.add(byte[].class);
- }
-
- public void setObjectProperty(String propertyName, Object object) throws JMSException
- {
- checkPropertyName(propertyName);
- checkWritableProperties();
- if (object != null && !ALLOWED.contains(object.getClass()))
- {
- throw new MessageFormatException
- (String.format
- ("Cannot set a %s, allowed property types are: %s",
- object.getClass(), ALLOWED));
- }
- setApplicationHeader(propertyName, object);
- }
-
- private void setApplicationHeader(String propertyName, Object object)
- {
- Map<String, Object> headers = _messageProps.getApplicationHeaders();
- if(headers == null)
- {
- headers = new HashMap<String,Object>();
- _messageProps.setApplicationHeaders(headers);
- }
- headers.put(propertyName, object);
- }
-
- public void removeProperty(String propertyName) throws JMSException
- {
- Map<String, Object> headers = _messageProps.getApplicationHeaders();
- if(headers != null)
- {
- headers.remove(propertyName);
- }
- }
-
-
-
- protected void checkWritableProperties() throws MessageNotWriteableException
- {
- if (_readableProperties)
- {
- throw new MessageNotWriteableException("You need to call clearProperties() to make the message writable");
- }
- }
-
-
- public int getJMSPriority() throws JMSException
- {
- MessageDeliveryPriority messageDeliveryPriority = _deliveryProps.getPriority();
- return messageDeliveryPriority == null ? Message.DEFAULT_PRIORITY : messageDeliveryPriority.getValue();
- }
-
- public void setJMSPriority(int i) throws JMSException
- {
- _deliveryProps.setPriority(MessageDeliveryPriority.get((short)i));
- }
-
- public void clearProperties() throws JMSException
- {
- if(!getApplicationHeaders().isEmpty())
- {
- getApplicationHeaders().clear();
- }
-
- _readableProperties = false;
- }
-
-
- public void acknowledgeThis() throws JMSException
- {
- // the JMS 1.1 spec says in section 3.6 that calls to acknowledge are ignored when client acknowledge
- // is not specified. In our case, we only set the session field where client acknowledge mode is specified.
- if (_session != null)
- {
- if (_session.getAMQConnection().isClosed())
- {
- throw new javax.jms.IllegalStateException("Connection is already closed");
- }
-
- // we set multiple to true here since acknowledgement implies acknowledge of all previous messages
- // received on the session
- _session.acknowledgeMessage(_deliveryTag, true);
- }
- }
-
- public void acknowledge() throws JMSException
- {
- if (_session != null)
- {
- _session.acknowledge();
- }
- }
-
-
- /**
- * The session is set when CLIENT_ACKNOWLEDGE mode is used so that the CHANNEL ACK can be sent when the user calls
- * acknowledge()
- *
- * @param s the AMQ session that delivered this message
- */
- public void setAMQSession(AMQSession s)
- {
- _session = s;
- }
-
- public AMQSession getAMQSession()
- {
- return _session;
- }
-
- /**
- * Get the AMQ message number assigned to this message
- *
- * @return the message number
- */
- public long getDeliveryTag()
- {
- return _deliveryTag;
- }
-
-
-
-
-
-
- protected void checkPropertyName(CharSequence propertyName)
- {
- if (propertyName == null)
- {
- throw new IllegalArgumentException("Property name must not be null");
- }
- else if (propertyName.length() == 0)
- {
- throw new IllegalArgumentException("Property name must not be the empty string");
- }
-
- checkIdentiferFormat(propertyName);
- }
-
- protected void checkIdentiferFormat(CharSequence propertyName)
- {
-// JMS requirements 3.5.1 Property Names
-// Identifiers:
-// - An identifier is an unlimited-length character sequence that must begin
-// with a Java identifier start character; all following characters must be Java
-// identifier part characters. An identifier start character is any character for
-// which the method Character.isJavaIdentifierStart returns true. This includes
-// '_' and '$'. An identifier part character is any character for which the
-// method Character.isJavaIdentifierPart returns true.
-// - Identifiers cannot be the names NULL, TRUE, or FALSE.
-// Identifiers cannot be NOT, AND, OR, BETWEEN, LIKE, IN, IS, or
-// ESCAPE.
-// Identifiers are either header field references or property references. The
-// type of a property value in a message selector corresponds to the type
-// used to set the property. If a property that does not exist in a message is
-// referenced, its value is NULL. The semantics of evaluating NULL values
-// in a selector are described in Section 3.8.1.2, Null Values.
-// The conversions that apply to the get methods for properties do not
-// apply when a property is used in a message selector expression. For
-// example, suppose you set a property as a string value, as in the
-// following:
-// myMessage.setStringProperty("NumberOfOrders", "2");
-// The following expression in a message selector would evaluate to false,
-// because a string cannot be used in an arithmetic expression:
-// "NumberOfOrders > 1"
-// Identifiers are case sensitive.
-// Message header field references are restricted to JMSDeliveryMode,
-// JMSPriority, JMSMessageID, JMSTimestamp, JMSCorrelationID, and
-// JMSType. JMSMessageID, JMSCorrelationID, and JMSType values may be
-// null and if so are treated as a NULL value.
-
- if (Boolean.getBoolean("strict-jms"))
- {
- // JMS start character
- if (!(Character.isJavaIdentifierStart(propertyName.charAt(0))))
- {
- throw new IllegalArgumentException("Identifier '" + propertyName + "' does not start with a valid JMS identifier start character");
- }
-
- // JMS part character
- int length = propertyName.length();
- for (int c = 1; c < length; c++)
- {
- if (!(Character.isJavaIdentifierPart(propertyName.charAt(c))))
- {
- throw new IllegalArgumentException("Identifier '" + propertyName + "' contains an invalid JMS identifier character");
- }
- }
-
- // JMS invalid names
- if ((propertyName.equals("NULL")
- || propertyName.equals("TRUE")
- || propertyName.equals("FALSE")
- || propertyName.equals("NOT")
- || propertyName.equals("AND")
- || propertyName.equals("OR")
- || propertyName.equals("BETWEEN")
- || propertyName.equals("LIKE")
- || propertyName.equals("IN")
- || propertyName.equals("IS")
- || propertyName.equals("ESCAPE")))
- {
- throw new IllegalArgumentException("Identifier '" + propertyName + "' is not allowed in JMS");
- }
- }
-
- }
-
-
- public MessageProperties getMessageProperties()
- {
- return _messageProps;
- }
-
-
- public DeliveryProperties getDeliveryProperties()
- {
- return _deliveryProps;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_8.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_8.java
deleted file mode 100644
index 4c20a44849..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_8.java
+++ /dev/null
@@ -1,567 +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.
- *
- */
-
-package org.apache.qpid.client.message;
-
-import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.CustomJMSXProperty;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.AMQUndefinedDestination;
-import org.apache.qpid.client.JMSAMQException;
-import org.apache.qpid.framing.ContentHeaderProperties;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.url.BindingURL;
-import org.apache.qpid.url.AMQBindingURL;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.MessageNotWriteableException;
-import java.util.Map;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.UUID;
-import java.net.URISyntaxException;
-
-public class AMQMessageDelegate_0_8 implements AMQMessageDelegate
-{
- private static final Map _destinationCache = Collections.synchronizedMap(new ReferenceMap());
-
- public static final String JMS_TYPE = "x-jms-type";
-
-
- private boolean _readableProperties = false;
-
- private Destination _destination;
- private JMSHeaderAdapter _headerAdapter;
- private static final boolean STRICT_AMQP_COMPLIANCE =
- Boolean.parseBoolean(System.getProperties().getProperty(AMQSession.STRICT_AMQP, AMQSession.STRICT_AMQP_DEFAULT));
-
- private ContentHeaderProperties _contentHeaderProperties;
- /** If the acknowledge mode is CLIENT_ACKNOWLEDGE the session is required */
- private AMQSession _session;
- private final long _deliveryTag;
-
- protected AMQMessageDelegate_0_8()
- {
- this(new BasicContentHeaderProperties(), -1);
- _readableProperties = false;
- _headerAdapter = new JMSHeaderAdapter(((BasicContentHeaderProperties) _contentHeaderProperties).getHeaders());
-
- }
-
- protected AMQMessageDelegate_0_8(long deliveryTag, BasicContentHeaderProperties contentHeader, AMQShortString exchange,
- AMQShortString routingKey)
- {
- this(contentHeader, deliveryTag);
-
- Integer type = contentHeader.getHeaders().getInteger(CustomJMSXProperty.JMS_QPID_DESTTYPE.getShortStringName());
-
- if(type == null)
- {
- type = AMQDestination.UNKNOWN_TYPE;
- }
-
- AMQDestination dest;
-
- switch(type.intValue())
- {
- case AMQDestination.QUEUE_TYPE:
- dest = new AMQQueue(exchange, routingKey, routingKey);
- break;
- case AMQDestination.TOPIC_TYPE:
- dest = new AMQTopic(exchange, routingKey, null);
- break;
- default:
- dest = new AMQUndefinedDestination(exchange, routingKey, null);
- }
-
-
-
- // Destination dest = AMQDestination.createDestination(url);
- setJMSDestination(dest);
-
-
-
- }
-
- protected AMQMessageDelegate_0_8(BasicContentHeaderProperties properties, long deliveryTag)
- {
- _contentHeaderProperties = properties;
- _deliveryTag = deliveryTag;
- _readableProperties = (_contentHeaderProperties != null);
- _headerAdapter = new JMSHeaderAdapter(((BasicContentHeaderProperties) _contentHeaderProperties).getHeaders());
- }
-
-
- public String getJMSMessageID() throws JMSException
- {
- return getContentHeaderProperties().getMessageIdAsString();
- }
-
- public void setJMSMessageID(String messageId) throws JMSException
- {
- getContentHeaderProperties().setMessageId(messageId);
- }
-
- public void setJMSMessageID(UUID messageId) throws JMSException
- {
- getContentHeaderProperties().setMessageId("ID:" + messageId);
- }
-
-
- public long getJMSTimestamp() throws JMSException
- {
- return getContentHeaderProperties().getTimestamp();
- }
-
- public void setJMSTimestamp(long timestamp) throws JMSException
- {
- getContentHeaderProperties().setTimestamp(timestamp);
- }
-
- public byte[] getJMSCorrelationIDAsBytes() throws JMSException
- {
- return getContentHeaderProperties().getCorrelationIdAsString().getBytes();
- }
-
- public void setJMSCorrelationIDAsBytes(byte[] bytes) throws JMSException
- {
- getContentHeaderProperties().setCorrelationId(new String(bytes));
- }
-
- public void setJMSCorrelationID(String correlationId) throws JMSException
- {
- getContentHeaderProperties().setCorrelationId(correlationId);
- }
-
- public String getJMSCorrelationID() throws JMSException
- {
- return getContentHeaderProperties().getCorrelationIdAsString();
- }
-
- public Destination getJMSReplyTo() throws JMSException
- {
- String replyToEncoding = getContentHeaderProperties().getReplyToAsString();
- if (replyToEncoding == null)
- {
- return null;
- }
- else
- {
- Destination dest = (Destination) _destinationCache.get(replyToEncoding);
- if (dest == null)
- {
- try
- {
- BindingURL binding = new AMQBindingURL(replyToEncoding);
- dest = AMQDestination.createDestination(binding);
- }
- catch (URISyntaxException e)
- {
- throw new JMSAMQException("Illegal value in JMS_ReplyTo property: " + replyToEncoding, e);
- }
-
- _destinationCache.put(replyToEncoding, dest);
- }
-
- return dest;
- }
- }
-
- public void setJMSReplyTo(Destination destination) throws JMSException
- {
- if (destination == null)
- {
- throw new IllegalArgumentException("Null destination not allowed");
- }
-
- if (!(destination instanceof AMQDestination))
- {
- throw new IllegalArgumentException(
- "ReplyTo destination may only be an AMQDestination - passed argument was type " + destination.getClass());
- }
-
- final AMQDestination amqd = (AMQDestination) destination;
-
- final AMQShortString encodedDestination = amqd.getEncodedName();
- _destinationCache.put(encodedDestination, destination);
- getContentHeaderProperties().setReplyTo(encodedDestination);
- }
-
- public Destination getJMSDestination() throws JMSException
- {
- return _destination;
- }
-
- public void setJMSDestination(Destination destination)
- {
- _destination = destination;
- }
-
- public void setContentType(String contentType)
- {
- getContentHeaderProperties().setContentType(contentType);
- }
-
- public String getContentType()
- {
- return getContentHeaderProperties().getContentTypeAsString();
- }
-
- public void setEncoding(String encoding)
- {
- getContentHeaderProperties().setEncoding(encoding);
- }
-
- public String getEncoding()
- {
- return getContentHeaderProperties().getEncodingAsString();
- }
-
- public String getReplyToString()
- {
- return getContentHeaderProperties().getReplyToAsString();
- }
-
- public int getJMSDeliveryMode() throws JMSException
- {
- return getContentHeaderProperties().getDeliveryMode();
- }
-
- public void setJMSDeliveryMode(int i) throws JMSException
- {
- getContentHeaderProperties().setDeliveryMode((byte) i);
- }
-
- public BasicContentHeaderProperties getContentHeaderProperties()
- {
- return (BasicContentHeaderProperties) _contentHeaderProperties;
- }
-
-
- public String getJMSType() throws JMSException
- {
- return getContentHeaderProperties().getTypeAsString();
- }
-
- public void setJMSType(String string) throws JMSException
- {
- getContentHeaderProperties().setType(string);
- }
-
- public long getJMSExpiration() throws JMSException
- {
- return getContentHeaderProperties().getExpiration();
- }
-
- public void setJMSExpiration(long l) throws JMSException
- {
- getContentHeaderProperties().setExpiration(l);
- }
-
-
-
- public boolean propertyExists(String propertyName) throws JMSException
- {
- return getJmsHeaders().propertyExists(propertyName);
- }
-
- public boolean getBooleanProperty(String propertyName) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getBoolean(propertyName);
- }
-
- public byte getByteProperty(String propertyName) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getByte(propertyName);
- }
-
- public short getShortProperty(String propertyName) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getShort(propertyName);
- }
-
- public int getIntProperty(String propertyName) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getInteger(propertyName);
- }
-
- public long getLongProperty(String propertyName) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getLong(propertyName);
- }
-
- public float getFloatProperty(String propertyName) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getFloat(propertyName);
- }
-
- public double getDoubleProperty(String propertyName) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getDouble(propertyName);
- }
-
- public String getStringProperty(String propertyName) throws JMSException
- {
- //NOTE: if the JMSX Property is a non AMQP property then we must check _strictAMQP and throw as below.
- if (propertyName.equals(CustomJMSXProperty.JMSXUserID.toString()))
- {
- return ((BasicContentHeaderProperties) _contentHeaderProperties).getUserIdAsString();
- }
- else
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getString(propertyName);
- }
- }
-
- public Object getObjectProperty(String propertyName) throws JMSException
- {
- return getJmsHeaders().getObject(propertyName);
- }
-
- public Enumeration getPropertyNames() throws JMSException
- {
- return getJmsHeaders().getPropertyNames();
- }
-
- public void setBooleanProperty(String propertyName, boolean b) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- checkWritableProperties();
- getJmsHeaders().setBoolean(propertyName, b);
- }
-
- public void setByteProperty(String propertyName, byte b) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- checkWritableProperties();
- getJmsHeaders().setByte(propertyName, new Byte(b));
- }
-
- public void setShortProperty(String propertyName, short i) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- checkWritableProperties();
- getJmsHeaders().setShort(propertyName, new Short(i));
- }
-
- public void setIntProperty(String propertyName, int i) throws JMSException
- {
- checkWritableProperties();
- getJmsHeaders().setInteger(propertyName, new Integer(i));
- }
-
- public void setLongProperty(String propertyName, long l) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- checkWritableProperties();
- getJmsHeaders().setLong(propertyName, new Long(l));
- }
-
- public void setFloatProperty(String propertyName, float f) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- checkWritableProperties();
- getJmsHeaders().setFloat(propertyName, new Float(f));
- }
-
- public void setDoubleProperty(String propertyName, double v) throws JMSException
- {
- if (STRICT_AMQP_COMPLIANCE)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- checkWritableProperties();
- getJmsHeaders().setDouble(propertyName, new Double(v));
- }
-
- public void setStringProperty(String propertyName, String value) throws JMSException
- {
- checkWritableProperties();
- getJmsHeaders().setString(propertyName, value);
- }
-
- public void setObjectProperty(String propertyName, Object object) throws JMSException
- {
- checkWritableProperties();
- getJmsHeaders().setObject(propertyName, object);
- }
-
- public void removeProperty(String propertyName) throws JMSException
- {
- getJmsHeaders().remove(propertyName);
- }
-
-
- private JMSHeaderAdapter getJmsHeaders()
- {
- return _headerAdapter;
- }
-
- protected void checkWritableProperties() throws MessageNotWriteableException
- {
- if (_readableProperties)
- {
- throw new MessageNotWriteableException("You need to call clearProperties() to make the message writable");
- }
- _contentHeaderProperties.updated();
- }
-
-
- public int getJMSPriority() throws JMSException
- {
- return getContentHeaderProperties().getPriority();
- }
-
- public void setJMSPriority(int i) throws JMSException
- {
- getContentHeaderProperties().setPriority((byte) i);
- }
-
- public void clearProperties() throws JMSException
- {
- getJmsHeaders().clear();
-
- _readableProperties = false;
- }
-
-
- public void acknowledgeThis() throws JMSException
- {
- // the JMS 1.1 spec says in section 3.6 that calls to acknowledge are ignored when client acknowledge
- // is not specified. In our case, we only set the session field where client acknowledge mode is specified.
- if (_session != null)
- {
- if (_session.getAMQConnection().isClosed())
- {
- throw new javax.jms.IllegalStateException("Connection is already closed");
- }
-
- // we set multiple to true here since acknowledgement implies acknowledge of all previous messages
- // received on the session
- _session.acknowledgeMessage(_deliveryTag, true);
- }
- }
-
- public void acknowledge() throws JMSException
- {
- if (_session != null)
- {
- _session.acknowledge();
- }
- }
-
-
- /**
- * The session is set when CLIENT_ACKNOWLEDGE mode is used so that the CHANNEL ACK can be sent when the user calls
- * acknowledge()
- *
- * @param s the AMQ session that delivered this message
- */
- public void setAMQSession(AMQSession s)
- {
- _session = s;
- }
-
- public AMQSession getAMQSession()
- {
- return _session;
- }
-
- /**
- * Get the AMQ message number assigned to this message
- *
- * @return the message number
- */
- public long getDeliveryTag()
- {
- return _deliveryTag;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java
deleted file mode 100644
index c0d51fa726..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java
+++ /dev/null
@@ -1,149 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import java.io.IOException;
-import java.nio.charset.Charset;
-
-import javax.jms.JMSException;
-import javax.jms.MessageEOFException;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-/**
- * @author Apache Software Foundation
- */
-public abstract class AbstractBytesMessage extends AbstractJMSMessage
-{
-
- /**
- * The default initial size of the buffer. The buffer expands automatically.
- */
- private static final int DEFAULT_BUFFER_INITIAL_SIZE = 1024;
-
- AbstractBytesMessage(AMQMessageDelegateFactory delegateFactory)
- {
- this(delegateFactory, null);
- }
-
- /**
- * Construct a bytes message with existing data.
- *
- * @param delegateFactory
- * @param data the data that comprises this message. If data is null, you get a 1024 byte buffer that is
- */
- AbstractBytesMessage(AMQMessageDelegateFactory delegateFactory, ByteBuffer data)
- {
- super(delegateFactory, data); // this instanties a content header
- setContentType(getMimeType());
-
- if (_data == null)
- {
- allocateInitialBuffer();
- }
- }
-
- protected void allocateInitialBuffer()
- {
- _data = ByteBuffer.allocate(DEFAULT_BUFFER_INITIAL_SIZE);
- _data.setAutoExpand(true);
- }
-
- AbstractBytesMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
- super(delegate, data);
- setContentType(getMimeType());
- }
-
-
- public void clearBodyImpl() throws JMSException
- {
- allocateInitialBuffer();
- }
-
- public String toBodyString() throws JMSException
- {
- checkReadable();
- try
- {
- return getText();
- }
- catch (IOException e)
- {
- JMSException jmse = new JMSException(e.toString());
- jmse.setLinkedException(e);
- throw jmse;
- }
- }
-
- /**
- * We reset the stream before and after reading the data. This means that toString() will always output
- * the entire message and also that the caller can then immediately start reading as if toString() had
- * never been called.
- *
- * @return
- * @throws IOException
- */
- private String getText() throws IOException
- {
- // this will use the default platform encoding
- if (_data == null)
- {
- return null;
- }
-
- int pos = _data.position();
- _data.rewind();
- // one byte left is for the end of frame marker
- if (_data.remaining() == 0)
- {
- // this is really redundant since pos must be zero
- _data.position(pos);
-
- return null;
- }
- else
- {
- String data = _data.getString(Charset.forName("UTF8").newDecoder());
- _data.position(pos);
-
- return data;
- }
- }
-
- /**
- * Check that there is at least a certain number of bytes available to read
- *
- * @param len the number of bytes
- * @throws javax.jms.MessageEOFException if there are less than len bytes available to read
- */
- protected void checkAvailable(int len) throws MessageEOFException
- {
- if (_data.remaining() < len)
- {
- throw new MessageEOFException("Unable to read " + len + " bytes");
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesTypedMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesTypedMessage.java
deleted file mode 100644
index f0fc394b0b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesTypedMessage.java
+++ /dev/null
@@ -1,802 +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.
- *
- *
- */
-
-package org.apache.qpid.client.message;
-
-import java.nio.charset.CharacterCodingException;
-import java.nio.charset.Charset;
-
-import javax.jms.JMSException;
-import javax.jms.MessageEOFException;
-import javax.jms.MessageFormatException;
-import javax.jms.MessageNotReadableException;
-import javax.jms.MessageNotWriteableException;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-/**
- * @author Apache Software Foundation
- */
-public abstract class AbstractBytesTypedMessage extends AbstractBytesMessage
-{
-
- protected static final byte BOOLEAN_TYPE = (byte) 1;
-
- protected static final byte BYTE_TYPE = (byte) 2;
-
- protected static final byte BYTEARRAY_TYPE = (byte) 3;
-
- protected static final byte SHORT_TYPE = (byte) 4;
-
- protected static final byte CHAR_TYPE = (byte) 5;
-
- protected static final byte INT_TYPE = (byte) 6;
-
- protected static final byte LONG_TYPE = (byte) 7;
-
- protected static final byte FLOAT_TYPE = (byte) 8;
-
- protected static final byte DOUBLE_TYPE = (byte) 9;
-
- protected static final byte STRING_TYPE = (byte) 10;
-
- protected static final byte NULL_STRING_TYPE = (byte) 11;
-
- /**
- * This is set when reading a byte array. The readBytes(byte[]) method supports multiple calls to read
- * a byte array in multiple chunks, hence this is used to track how much is left to be read
- */
- private int _byteArrayRemaining = -1;
-
- AbstractBytesTypedMessage(AMQMessageDelegateFactory delegateFactory)
- {
-
- this(delegateFactory, null);
- }
-
- /**
- * Construct a stream message with existing data.
- *
- * @param delegateFactory
- * @param data the data that comprises this message. If data is null, you get a 1024 byte buffer that is
- */
- AbstractBytesTypedMessage(AMQMessageDelegateFactory delegateFactory, ByteBuffer data)
- {
-
- super(delegateFactory, data); // this instanties a content header
- }
-
- AbstractBytesTypedMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
-
- super(delegate, data);
- }
-
-
- protected byte readWireType() throws MessageFormatException, MessageEOFException,
- MessageNotReadableException
- {
- checkReadable();
- checkAvailable(1);
- return _data.get();
- }
-
- protected void writeTypeDiscriminator(byte type) throws MessageNotWriteableException
- {
- checkWritable();
- _data.put(type);
- _changedData = true;
- }
-
- protected boolean readBoolean() throws JMSException
- {
- int position = _data.position();
- byte wireType = readWireType();
- boolean result;
- try
- {
- switch (wireType)
- {
- case BOOLEAN_TYPE:
- checkAvailable(1);
- result = readBooleanImpl();
- break;
- case STRING_TYPE:
- checkAvailable(1);
- result = Boolean.parseBoolean(readStringImpl());
- break;
- default:
- _data.position(position);
- throw new MessageFormatException("Unable to convert " + wireType + " to a boolean");
- }
- return result;
- }
- catch (RuntimeException e)
- {
- _data.position(position);
- throw e;
- }
- }
-
- private boolean readBooleanImpl()
- {
- return _data.get() != 0;
- }
-
- protected byte readByte() throws JMSException
- {
- int position = _data.position();
- byte wireType = readWireType();
- byte result;
- try
- {
- switch (wireType)
- {
- case BYTE_TYPE:
- checkAvailable(1);
- result = readByteImpl();
- break;
- case STRING_TYPE:
- checkAvailable(1);
- result = Byte.parseByte(readStringImpl());
- break;
- default:
- _data.position(position);
- throw new MessageFormatException("Unable to convert " + wireType + " to a byte");
- }
- }
- catch (RuntimeException e)
- {
- _data.position(position);
- throw e;
- }
- return result;
- }
-
- private byte readByteImpl()
- {
- return _data.get();
- }
-
- protected short readShort() throws JMSException
- {
- int position = _data.position();
- byte wireType = readWireType();
- short result;
- try
- {
- switch (wireType)
- {
- case SHORT_TYPE:
- checkAvailable(2);
- result = readShortImpl();
- break;
- case STRING_TYPE:
- checkAvailable(1);
- result = Short.parseShort(readStringImpl());
- break;
- case BYTE_TYPE:
- checkAvailable(1);
- result = readByteImpl();
- break;
- default:
- _data.position(position);
- throw new MessageFormatException("Unable to convert " + wireType + " to a short");
- }
- }
- catch (RuntimeException e)
- {
- _data.position(position);
- throw e;
- }
- return result;
- }
-
- private short readShortImpl()
- {
- return _data.getShort();
- }
-
- /**
- * Note that this method reads a unicode character as two bytes from the stream
- *
- * @return the character read from the stream
- * @throws javax.jms.JMSException
- */
- protected char readChar() throws JMSException
- {
- int position = _data.position();
- byte wireType = readWireType();
- try
- {
- if(wireType == NULL_STRING_TYPE){
- throw new NullPointerException();
- }
-
- if (wireType != CHAR_TYPE)
- {
- _data.position(position);
- throw new MessageFormatException("Unable to convert " + wireType + " to a char");
- }
- else
- {
- checkAvailable(2);
- return readCharImpl();
- }
- }
- catch (RuntimeException e)
- {
- _data.position(position);
- throw e;
- }
- }
-
- private char readCharImpl()
- {
- return _data.getChar();
- }
-
- protected int readInt() throws JMSException
- {
- int position = _data.position();
- byte wireType = readWireType();
- int result;
- try
- {
- switch (wireType)
- {
- case INT_TYPE:
- checkAvailable(4);
- result = readIntImpl();
- break;
- case SHORT_TYPE:
- checkAvailable(2);
- result = readShortImpl();
- break;
- case STRING_TYPE:
- checkAvailable(1);
- result = Integer.parseInt(readStringImpl());
- break;
- case BYTE_TYPE:
- checkAvailable(1);
- result = readByteImpl();
- break;
- default:
- _data.position(position);
- throw new MessageFormatException("Unable to convert " + wireType + " to an int");
- }
- return result;
- }
- catch (RuntimeException e)
- {
- _data.position(position);
- throw e;
- }
- }
-
- protected int readIntImpl()
- {
- return _data.getInt();
- }
-
- protected long readLong() throws JMSException
- {
- int position = _data.position();
- byte wireType = readWireType();
- long result;
- try
- {
- switch (wireType)
- {
- case LONG_TYPE:
- checkAvailable(8);
- result = readLongImpl();
- break;
- case INT_TYPE:
- checkAvailable(4);
- result = readIntImpl();
- break;
- case SHORT_TYPE:
- checkAvailable(2);
- result = readShortImpl();
- break;
- case STRING_TYPE:
- checkAvailable(1);
- result = Long.parseLong(readStringImpl());
- break;
- case BYTE_TYPE:
- checkAvailable(1);
- result = readByteImpl();
- break;
- default:
- _data.position(position);
- throw new MessageFormatException("Unable to convert " + wireType + " to a long");
- }
- return result;
- }
- catch (RuntimeException e)
- {
- _data.position(position);
- throw e;
- }
- }
-
- private long readLongImpl()
- {
- return _data.getLong();
- }
-
- protected float readFloat() throws JMSException
- {
- int position = _data.position();
- byte wireType = readWireType();
- float result;
- try
- {
- switch (wireType)
- {
- case FLOAT_TYPE:
- checkAvailable(4);
- result = readFloatImpl();
- break;
- case STRING_TYPE:
- checkAvailable(1);
- result = Float.parseFloat(readStringImpl());
- break;
- default:
- _data.position(position);
- throw new MessageFormatException("Unable to convert " + wireType + " to a float");
- }
- return result;
- }
- catch (RuntimeException e)
- {
- _data.position(position);
- throw e;
- }
- }
-
- private float readFloatImpl()
- {
- return _data.getFloat();
- }
-
- protected double readDouble() throws JMSException
- {
- int position = _data.position();
- byte wireType = readWireType();
- double result;
- try
- {
- switch (wireType)
- {
- case DOUBLE_TYPE:
- checkAvailable(8);
- result = readDoubleImpl();
- break;
- case FLOAT_TYPE:
- checkAvailable(4);
- result = readFloatImpl();
- break;
- case STRING_TYPE:
- checkAvailable(1);
- result = Double.parseDouble(readStringImpl());
- break;
- default:
- _data.position(position);
- throw new MessageFormatException("Unable to convert " + wireType + " to a double");
- }
- return result;
- }
- catch (RuntimeException e)
- {
- _data.position(position);
- throw e;
- }
- }
-
- private double readDoubleImpl()
- {
- return _data.getDouble();
- }
-
- protected String readString() throws JMSException
- {
- int position = _data.position();
- byte wireType = readWireType();
- String result;
- try
- {
- switch (wireType)
- {
- case STRING_TYPE:
- checkAvailable(1);
- result = readStringImpl();
- break;
- case NULL_STRING_TYPE:
- result = null;
- throw new NullPointerException("data is null");
- case BOOLEAN_TYPE:
- checkAvailable(1);
- result = String.valueOf(readBooleanImpl());
- break;
- case LONG_TYPE:
- checkAvailable(8);
- result = String.valueOf(readLongImpl());
- break;
- case INT_TYPE:
- checkAvailable(4);
- result = String.valueOf(readIntImpl());
- break;
- case SHORT_TYPE:
- checkAvailable(2);
- result = String.valueOf(readShortImpl());
- break;
- case BYTE_TYPE:
- checkAvailable(1);
- result = String.valueOf(readByteImpl());
- break;
- case FLOAT_TYPE:
- checkAvailable(4);
- result = String.valueOf(readFloatImpl());
- break;
- case DOUBLE_TYPE:
- checkAvailable(8);
- result = String.valueOf(readDoubleImpl());
- break;
- case CHAR_TYPE:
- checkAvailable(2);
- result = String.valueOf(readCharImpl());
- break;
- default:
- _data.position(position);
- throw new MessageFormatException("Unable to convert " + wireType + " to a String");
- }
- return result;
- }
- catch (RuntimeException e)
- {
- _data.position(position);
- throw e;
- }
- }
-
- protected String readStringImpl() throws JMSException
- {
- try
- {
- return _data.getString(Charset.forName("UTF-8").newDecoder());
- }
- catch (CharacterCodingException e)
- {
- JMSException je = new JMSException("Error decoding byte stream as a UTF8 string: " + e);
- je.setLinkedException(e);
- throw je;
- }
- }
-
- protected int readBytes(byte[] bytes) throws JMSException
- {
- if (bytes == null)
- {
- throw new IllegalArgumentException("byte array must not be null");
- }
- checkReadable();
- // first call
- if (_byteArrayRemaining == -1)
- {
- // type discriminator checked separately so you get a MessageFormatException rather than
- // an EOF even in the case where both would be applicable
- checkAvailable(1);
- byte wireType = readWireType();
- if (wireType != BYTEARRAY_TYPE)
- {
- throw new MessageFormatException("Unable to convert " + wireType + " to a byte array");
- }
- checkAvailable(4);
- int size = _data.getInt();
- // length of -1 indicates null
- if (size == -1)
- {
- return -1;
- }
- else
- {
- if (size > _data.remaining())
- {
- throw new MessageEOFException("Byte array has stated length " + size + " but message only contains " +
- _data.remaining() + " bytes");
- }
- else
- {
- _byteArrayRemaining = size;
- }
- }
- }
- else if (_byteArrayRemaining == 0)
- {
- _byteArrayRemaining = -1;
- return -1;
- }
-
- int returnedSize = readBytesImpl(bytes);
- if (returnedSize < bytes.length)
- {
- _byteArrayRemaining = -1;
- }
- return returnedSize;
- }
-
- private int readBytesImpl(byte[] bytes)
- {
- int count = (_byteArrayRemaining >= bytes.length ? bytes.length : _byteArrayRemaining);
- _byteArrayRemaining -= count;
-
- if (count == 0)
- {
- return 0;
- }
- else
- {
- _data.get(bytes, 0, count);
- return count;
- }
- }
-
- protected Object readObject() throws JMSException
- {
- int position = _data.position();
- byte wireType = readWireType();
- Object result = null;
- try
- {
- switch (wireType)
- {
- case BOOLEAN_TYPE:
- checkAvailable(1);
- result = readBooleanImpl();
- break;
- case BYTE_TYPE:
- checkAvailable(1);
- result = readByteImpl();
- break;
- case BYTEARRAY_TYPE:
- checkAvailable(4);
- int size = _data.getInt();
- if (size == -1)
- {
- result = null;
- }
- else
- {
- _byteArrayRemaining = size;
- byte[] bytesResult = new byte[size];
- readBytesImpl(bytesResult);
- result = bytesResult;
- }
- break;
- case SHORT_TYPE:
- checkAvailable(2);
- result = readShortImpl();
- break;
- case CHAR_TYPE:
- checkAvailable(2);
- result = readCharImpl();
- break;
- case INT_TYPE:
- checkAvailable(4);
- result = readIntImpl();
- break;
- case LONG_TYPE:
- checkAvailable(8);
- result = readLongImpl();
- break;
- case FLOAT_TYPE:
- checkAvailable(4);
- result = readFloatImpl();
- break;
- case DOUBLE_TYPE:
- checkAvailable(8);
- result = readDoubleImpl();
- break;
- case NULL_STRING_TYPE:
- result = null;
- break;
- case STRING_TYPE:
- checkAvailable(1);
- result = readStringImpl();
- break;
- }
- return result;
- }
- catch (RuntimeException e)
- {
- _data.position(position);
- throw e;
- }
- }
-
- protected void writeBoolean(boolean b) throws JMSException
- {
- writeTypeDiscriminator(BOOLEAN_TYPE);
- _data.put(b ? (byte) 1 : (byte) 0);
- }
-
- protected void writeByte(byte b) throws JMSException
- {
- writeTypeDiscriminator(BYTE_TYPE);
- _data.put(b);
- }
-
- protected void writeShort(short i) throws JMSException
- {
- writeTypeDiscriminator(SHORT_TYPE);
- _data.putShort(i);
- }
-
- protected void writeChar(char c) throws JMSException
- {
- writeTypeDiscriminator(CHAR_TYPE);
- _data.putChar(c);
- }
-
- protected void writeInt(int i) throws JMSException
- {
- writeTypeDiscriminator(INT_TYPE);
- writeIntImpl(i);
- }
-
- protected void writeIntImpl(int i)
- {
- _data.putInt(i);
- }
-
- protected void writeLong(long l) throws JMSException
- {
- writeTypeDiscriminator(LONG_TYPE);
- _data.putLong(l);
- }
-
- protected void writeFloat(float v) throws JMSException
- {
- writeTypeDiscriminator(FLOAT_TYPE);
- _data.putFloat(v);
- }
-
- protected void writeDouble(double v) throws JMSException
- {
- writeTypeDiscriminator(DOUBLE_TYPE);
- _data.putDouble(v);
- }
-
- protected void writeString(String string) throws JMSException
- {
- if (string == null)
- {
- writeTypeDiscriminator(NULL_STRING_TYPE);
- }
- else
- {
- writeTypeDiscriminator(STRING_TYPE);
- try
- {
- writeStringImpl(string);
- }
- catch (CharacterCodingException e)
- {
- JMSException ex = new JMSException("Unable to encode string: " + e);
- ex.setLinkedException(e);
- throw ex;
- }
- }
- }
-
- protected void writeStringImpl(String string)
- throws CharacterCodingException
- {
- _data.putString(string, Charset.forName("UTF-8").newEncoder());
- // we must write the null terminator ourselves
- _data.put((byte) 0);
- }
-
- protected void writeBytes(byte[] bytes) throws JMSException
- {
- writeBytes(bytes, 0, bytes == null ? 0 : bytes.length);
- }
-
- protected void writeBytes(byte[] bytes, int offset, int length) throws JMSException
- {
- writeTypeDiscriminator(BYTEARRAY_TYPE);
- if (bytes == null)
- {
- _data.putInt(-1);
- }
- else
- {
- _data.putInt(length);
- _data.put(bytes, offset, length);
- }
- }
-
- protected void writeObject(Object object) throws JMSException
- {
- checkWritable();
- Class clazz;
-
- if (object == null)
- {
- // string handles the output of null values
- clazz = String.class;
- }
- else
- {
- clazz = object.getClass();
- }
-
- if (clazz == Byte.class)
- {
- writeByte((Byte) object);
- }
- else if (clazz == Boolean.class)
- {
- writeBoolean((Boolean) object);
- }
- else if (clazz == byte[].class)
- {
- writeBytes((byte[]) object);
- }
- else if (clazz == Short.class)
- {
- writeShort((Short) object);
- }
- else if (clazz == Character.class)
- {
- writeChar((Character) object);
- }
- else if (clazz == Integer.class)
- {
- writeInt((Integer) object);
- }
- else if (clazz == Long.class)
- {
- writeLong((Long) object);
- }
- else if (clazz == Float.class)
- {
- writeFloat((Float) object);
- }
- else if (clazz == Double.class)
- {
- writeDouble((Double) object);
- }
- else if (clazz == String.class)
- {
- writeString((String) object);
- }
- else
- {
- throw new MessageFormatException("Only primitives plus byte arrays and String are valid types");
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java
deleted file mode 100644
index 0700ce5d23..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java
+++ /dev/null
@@ -1,534 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.UUID;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.MessageNotReadableException;
-import javax.jms.MessageNotWriteableException;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-public abstract class AbstractJMSMessage implements org.apache.qpid.jms.Message
-{
-
-
-
- protected ByteBuffer _data;
- protected boolean _readableMessage = false;
- protected boolean _changedData = true;
-
- /** If the acknowledge mode is CLIENT_ACKNOWLEDGE the session is required */
-
-
-
-
- private AMQMessageDelegate _delegate;
- private boolean _redelivered;
-
- protected AbstractJMSMessage(AMQMessageDelegateFactory delegateFactory, ByteBuffer data)
- {
- _delegate = delegateFactory.createDelegate();
- _data = data;
- if (_data != null)
- {
- _data.acquire();
- }
-
-
- _readableMessage = (data != null);
- _changedData = (data == null);
-
- }
-
- protected AbstractJMSMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
-
- _delegate = delegate;
-
- _data = data;
- if (_data != null)
- {
- _data.acquire();
- }
-
- _readableMessage = data != null;
-
- }
-
- public String getJMSMessageID() throws JMSException
- {
- return _delegate.getJMSMessageID();
- }
-
- public void setJMSMessageID(String messageId) throws JMSException
- {
- _delegate.setJMSMessageID(messageId);
- }
-
- public void setJMSMessageID(UUID messageId) throws JMSException
- {
- _delegate.setJMSMessageID(messageId);
- }
-
-
- public long getJMSTimestamp() throws JMSException
- {
- return _delegate.getJMSTimestamp();
- }
-
- public void setJMSTimestamp(long timestamp) throws JMSException
- {
- _delegate.setJMSTimestamp(timestamp);
- }
-
- public byte[] getJMSCorrelationIDAsBytes() throws JMSException
- {
- return _delegate.getJMSCorrelationIDAsBytes();
- }
-
- public void setJMSCorrelationIDAsBytes(byte[] bytes) throws JMSException
- {
- _delegate.setJMSCorrelationIDAsBytes(bytes);
- }
-
- public void setJMSCorrelationID(String correlationId) throws JMSException
- {
- _delegate.setJMSCorrelationID(correlationId);
- }
-
- public String getJMSCorrelationID() throws JMSException
- {
- return _delegate.getJMSCorrelationID();
- }
-
- public Destination getJMSReplyTo() throws JMSException
- {
- return _delegate.getJMSReplyTo();
- }
-
- public void setJMSReplyTo(Destination destination) throws JMSException
- {
- _delegate.setJMSReplyTo(destination);
- }
-
- public Destination getJMSDestination() throws JMSException
- {
- return _delegate.getJMSDestination();
- }
-
- public void setJMSDestination(Destination destination)
- {
- _delegate.setJMSDestination(destination);
- }
-
- public int getJMSDeliveryMode() throws JMSException
- {
- return _delegate.getJMSDeliveryMode();
- }
-
- public void setJMSDeliveryMode(int i) throws JMSException
- {
- _delegate.setJMSDeliveryMode(i);
- }
-
-
- public boolean getJMSRedelivered() throws JMSException
- {
- return _redelivered;
- }
-
- public void setJMSRedelivered(boolean b) throws JMSException
- {
- _redelivered = b;
- }
-
-
- public String getJMSType() throws JMSException
- {
- return _delegate.getJMSType();
- }
-
- public void setJMSType(String string) throws JMSException
- {
- _delegate.setJMSType(string);
- }
-
- public long getJMSExpiration() throws JMSException
- {
- return _delegate.getJMSExpiration();
- }
-
- public void setJMSExpiration(long l) throws JMSException
- {
- _delegate.setJMSExpiration(l);
- }
-
- public int getJMSPriority() throws JMSException
- {
- return _delegate.getJMSPriority();
- }
-
- public void setJMSPriority(int i) throws JMSException
- {
- _delegate.setJMSPriority(i);
- }
-
-
- public boolean propertyExists(String propertyName) throws JMSException
- {
- return _delegate.propertyExists(propertyName);
- }
-
- public boolean getBooleanProperty(final String s)
- throws JMSException
- {
- return _delegate.getBooleanProperty(s);
- }
-
- public byte getByteProperty(final String s)
- throws JMSException
- {
- return _delegate.getByteProperty(s);
- }
-
- public short getShortProperty(final String s)
- throws JMSException
- {
- return _delegate.getShortProperty(s);
- }
-
- public int getIntProperty(final String s)
- throws JMSException
- {
- return _delegate.getIntProperty(s);
- }
-
- public long getLongProperty(final String s)
- throws JMSException
- {
- return _delegate.getLongProperty(s);
- }
-
- public float getFloatProperty(final String s)
- throws JMSException
- {
- return _delegate.getFloatProperty(s);
- }
-
- public double getDoubleProperty(final String s)
- throws JMSException
- {
- return _delegate.getDoubleProperty(s);
- }
-
- public String getStringProperty(final String s)
- throws JMSException
- {
- return _delegate.getStringProperty(s);
- }
-
- public Object getObjectProperty(final String s)
- throws JMSException
- {
- return _delegate.getObjectProperty(s);
- }
-
- public Enumeration getPropertyNames()
- throws JMSException
- {
- return _delegate.getPropertyNames();
- }
-
- public void setBooleanProperty(final String s, final boolean b)
- throws JMSException
- {
- _delegate.setBooleanProperty(s, b);
- }
-
- public void setByteProperty(final String s, final byte b)
- throws JMSException
- {
- _delegate.setByteProperty(s, b);
- }
-
- public void setShortProperty(final String s, final short i)
- throws JMSException
- {
- _delegate.setShortProperty(s, i);
- }
-
- public void setIntProperty(final String s, final int i)
- throws JMSException
- {
- _delegate.setIntProperty(s, i);
- }
-
- public void setLongProperty(final String s, final long l)
- throws JMSException
- {
- _delegate.setLongProperty(s, l);
- }
-
- public void setFloatProperty(final String s, final float v)
- throws JMSException
- {
- _delegate.setFloatProperty(s, v);
- }
-
- public void setDoubleProperty(final String s, final double v)
- throws JMSException
- {
- _delegate.setDoubleProperty(s, v);
- }
-
- public void setStringProperty(final String s, final String s1)
- throws JMSException
- {
- _delegate.setStringProperty(s, s1);
- }
-
- public void setObjectProperty(final String s, final Object o)
- throws JMSException
- {
- _delegate.setObjectProperty(s, o);
- }
-
-
-
- public void clearProperties() throws JMSException
- {
- _delegate.clearProperties();
- }
-
- public void clearBody() throws JMSException
- {
- clearBodyImpl();
- _readableMessage = false;
-
- }
-
-
- public void acknowledgeThis() throws JMSException
- {
- _delegate.acknowledgeThis();
- }
-
- public void acknowledge() throws JMSException
- {
- _delegate.acknowledge();
- }
-
- /**
- * This forces concrete classes to implement clearBody()
- *
- * @throws JMSException
- */
- public abstract void clearBodyImpl() throws JMSException;
-
- /**
- * Get a String representation of the body of the message. Used in the toString() method which outputs this before
- * message properties.
- */
- public abstract String toBodyString() throws JMSException;
-
- protected abstract String getMimeType();
-
-
-
- public String toString()
- {
- try
- {
- StringBuffer buf = new StringBuffer("Body:\n");
- buf.append(toBodyString());
- buf.append("\nJMS Correlation ID: ").append(getJMSCorrelationID());
- buf.append("\nJMS timestamp: ").append(getJMSTimestamp());
- buf.append("\nJMS expiration: ").append(getJMSExpiration());
- buf.append("\nJMS priority: ").append(getJMSPriority());
- buf.append("\nJMS delivery mode: ").append(getJMSDeliveryMode());
- //buf.append("\nJMS reply to: ").append(String.valueOf(getJMSReplyTo()));
- buf.append("\nJMS Redelivered: ").append(_redelivered);
- buf.append("\nJMS Destination: ").append(getJMSDestination());
- buf.append("\nJMS Type: ").append(getJMSType());
- buf.append("\nJMS MessageID: ").append(getJMSMessageID());
- buf.append("\nAMQ message number: ").append(getDeliveryTag());
-
- buf.append("\nProperties:");
- final Enumeration propertyNames = getPropertyNames();
- if (!propertyNames.hasMoreElements())
- {
- buf.append("<NONE>");
- }
- else
- {
- buf.append('\n');
- while(propertyNames.hasMoreElements())
- {
- String propertyName = (String) propertyNames.nextElement();
- buf.append(propertyName).append(":\t").append(getObjectProperty(propertyName));
- }
-
- }
-
- return buf.toString();
- }
- catch (JMSException e)
- {
- return e.toString();
- }
- }
-
-
- public AMQMessageDelegate getDelegate()
- {
- return _delegate;
- }
-
- public ByteBuffer getData()
- {
- // make sure we rewind the data just in case any method has moved the
- // position beyond the start
- if (_data != null)
- {
- reset();
- }
-
- return _data;
- }
-
- protected void checkReadable() throws MessageNotReadableException
- {
- if (!_readableMessage)
- {
- throw new MessageNotReadableException("You need to call reset() to make the message readable");
- }
- }
-
- protected void checkWritable() throws MessageNotWriteableException
- {
- if (_readableMessage)
- {
- throw new MessageNotWriteableException("You need to call clearBody() to make the message writable");
- }
- }
-
- public void reset()
- {
- if (!_changedData)
- {
- _data.rewind();
- }
- else
- {
- _data.flip();
- _changedData = false;
- }
- }
-
- public int getContentLength()
- {
- if(_data != null)
- {
- return _data.remaining();
- }
- else
- {
- return 0;
- }
- }
-
- public void receivedFromServer()
- {
- _changedData = false;
- }
-
- /**
- * The session is set when CLIENT_ACKNOWLEDGE mode is used so that the CHANNEL ACK can be sent when the user calls
- * acknowledge()
- *
- * @param s the AMQ session that delivered this message
- */
- public void setAMQSession(AMQSession s)
- {
- _delegate.setAMQSession(s);
- }
-
- public AMQSession getAMQSession()
- {
- return _delegate.getAMQSession();
- }
-
- /**
- * Get the AMQ message number assigned to this message
- *
- * @return the message number
- */
- public long getDeliveryTag()
- {
- return _delegate.getDeliveryTag();
- }
-
- /** Invoked prior to sending the message. Allows the message to be modified if necessary before sending. */
- public void prepareForSending() throws JMSException
- {
- }
-
-
- public void setContentType(String contentType)
- {
- _delegate.setContentType(contentType);
- }
-
- public String getContentType()
- {
- return _delegate.getContentType();
- }
-
- public void setEncoding(String encoding)
- {
- _delegate.setEncoding(encoding);
- }
-
- public String getEncoding()
- {
- return _delegate.getEncoding();
- }
-
- public String getReplyToString()
- {
- return _delegate.getReplyToString();
- }
-
- protected void removeProperty(final String propertyName) throws JMSException
- {
- _delegate.removeProperty(propertyName);
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java
deleted file mode 100644
index 3071abf6ff..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java
+++ /dev/null
@@ -1,187 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.transport.Struct;
-import org.apache.qpid.transport.MessageProperties;
-import org.apache.qpid.transport.DeliveryProperties;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-
-import java.util.Iterator;
-import java.util.List;
-
-public abstract class AbstractJMSMessageFactory implements MessageFactory
-{
- private static final Logger _logger = LoggerFactory.getLogger(AbstractJMSMessageFactory.class);
-
- protected AbstractJMSMessage create08MessageWithBody(long messageNbr, ContentHeaderBody contentHeader,
- AMQShortString exchange, AMQShortString routingKey,
- List bodies) throws AMQException
- {
- ByteBuffer data;
- final boolean debug = _logger.isDebugEnabled();
-
- // we optimise the non-fragmented case to avoid copying
- if ((bodies != null) && (bodies.size() == 1))
- {
- if (debug)
- {
- _logger.debug("Non-fragmented message body (bodySize=" + contentHeader.bodySize + ")");
- }
-
- data = ((ContentBody) bodies.get(0)).payload;
- }
- else if (bodies != null)
- {
- if (debug)
- {
- _logger.debug("Fragmented message body (" + bodies
- .size() + " frames, bodySize=" + contentHeader.bodySize + ")");
- }
-
- data = ByteBuffer.allocate((int) contentHeader.bodySize); // XXX: Is cast a problem?
- final Iterator it = bodies.iterator();
- while (it.hasNext())
- {
- ContentBody cb = (ContentBody) it.next();
- final ByteBuffer payload = cb.payload;
- if(payload.isDirect() || payload.isReadOnly())
- {
- data.put(payload);
- }
- else
- {
- data.put(payload.array(), payload.arrayOffset(), payload.limit());
- }
-
- payload.release();
- }
-
- data.flip();
- }
- else // bodies == null
- {
- data = ByteBuffer.allocate(0);
- }
-
- if (debug)
- {
- _logger.debug("Creating message from buffer with position=" + data.position() + " and remaining=" + data
- .remaining());
- }
-
- AMQMessageDelegate delegate = new AMQMessageDelegate_0_8(messageNbr,
- (BasicContentHeaderProperties) contentHeader.properties,
- exchange, routingKey);
-
- return createMessage(delegate, data);
- }
-
- protected abstract AbstractJMSMessage createMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException;
-
-
- protected AbstractJMSMessage create010MessageWithBody(long messageNbr, Struct[] contentHeader,
- java.nio.ByteBuffer body) throws AMQException
- {
- ByteBuffer data;
- final boolean debug = _logger.isDebugEnabled();
-
-
- if (body != null)
- {
- data = ByteBuffer.wrap(body);
- }
- else // body == null
- {
- data = ByteBuffer.allocate(0);
- }
-
- if (debug)
- {
- _logger.debug("Creating message from buffer with position=" + data.position() + " and remaining=" + data
- .remaining());
- }
- // set the properties of this message
- MessageProperties mprop;
- DeliveryProperties devprop;
- if( contentHeader.length >1 )
- {
- mprop = (MessageProperties) contentHeader[0];
- devprop = (DeliveryProperties) contentHeader[1];
- }
- else
- {
- mprop = new MessageProperties();
- devprop = (DeliveryProperties) contentHeader[0];
- }
-
- AMQMessageDelegate delegate = new AMQMessageDelegate_0_10(mprop, devprop, messageNbr);
-
- AbstractJMSMessage message = createMessage(delegate, data);
- return message;
- }
-
- private static final String asString(byte[] bytes)
- {
- if (bytes == null)
- {
- return null;
- }
- else
- {
- return new String(bytes);
- }
- }
-
-
- public AbstractJMSMessage createMessage(long messageNbr, boolean redelivered, ContentHeaderBody contentHeader,
- AMQShortString exchange, AMQShortString routingKey, List bodies)
- throws JMSException, AMQException
- {
- final AbstractJMSMessage msg = create08MessageWithBody(messageNbr, contentHeader, exchange, routingKey, bodies);
- msg.setJMSRedelivered(redelivered);
- msg.receivedFromServer();
- return msg;
- }
-
- public AbstractJMSMessage createMessage(long messageNbr, boolean redelivered, Struct[] contentHeader,
- java.nio.ByteBuffer body)
- throws JMSException, AMQException
- {
- final AbstractJMSMessage msg =
- create010MessageWithBody(messageNbr, contentHeader, body);
- msg.setJMSRedelivered(redelivered);
- msg.receivedFromServer();
- return msg;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/CloseConsumerMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/CloseConsumerMessage.java
deleted file mode 100644
index 4af04912e5..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/CloseConsumerMessage.java
+++ /dev/null
@@ -1,43 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import org.apache.qpid.client.BasicMessageConsumer;
-
-public final class CloseConsumerMessage extends UnprocessedMessage
-{
-
- public CloseConsumerMessage(BasicMessageConsumer consumer)
- {
- super(consumer.getConsumerTag());
- }
-
-
- public long getDeliveryTag()
- {
- return 0;
- }
-
- public boolean isRedelivered()
- {
- return false;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/FiledTableSupport.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/FiledTableSupport.java
deleted file mode 100644
index 5b8a4ce878..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/FiledTableSupport.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.apache.qpid.client.message;
-/*
- *
- * 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 java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-
-public class FiledTableSupport
-{
- public static FieldTable convertToFieldTable(Map<String,?> props)
- {
- FieldTable ft = new FieldTable();
- if (props != null)
- {
- for (String key : props.keySet())
- {
- ft.setObject(key, props.get(key));
- }
- }
- return ft;
- }
-
- public static Map<String,Object> convertToMap(FieldTable ft)
- {
- Map<String,Object> map = new HashMap<String,Object>();
- for (AMQShortString key: ft.keySet() )
- {
- map.put(key.asString(), ft.getObject(key));
- }
-
- return map;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessage.java
deleted file mode 100644
index cd9d7ccf8b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessage.java
+++ /dev/null
@@ -1,390 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import java.nio.CharBuffer;
-import java.nio.charset.CharacterCodingException;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.MessageFormatException;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-public class JMSBytesMessage extends AbstractBytesMessage implements BytesMessage
-{
- public static final String MIME_TYPE = "application/octet-stream";
-
-
-
- public JMSBytesMessage(AMQMessageDelegateFactory delegateFactory)
- {
- this(delegateFactory,null);
-
- }
-
- /**
- * Construct a bytes message with existing data.
- *
- * @param delegateFactory
- * @param data the data that comprises this message. If data is null, you get a 1024 byte buffer that is
- */
- JMSBytesMessage(AMQMessageDelegateFactory delegateFactory, ByteBuffer data)
- {
-
- super(delegateFactory, data); // this instanties a content header
- }
-
- JMSBytesMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
- super(delegate, data);
- }
-
-
- public void reset()
- {
- super.reset();
- _readableMessage = true;
- }
-
- protected String getMimeType()
- {
- return MIME_TYPE;
- }
-
- public long getBodyLength() throws JMSException
- {
- checkReadable();
- return _data.limit();
- }
-
- public boolean readBoolean() throws JMSException
- {
- checkReadable();
- checkAvailable(1);
- return _data.get() != 0;
- }
-
- public byte readByte() throws JMSException
- {
- checkReadable();
- checkAvailable(1);
- return _data.get();
- }
-
- public int readUnsignedByte() throws JMSException
- {
- checkReadable();
- checkAvailable(1);
- return _data.getUnsigned();
- }
-
- public short readShort() throws JMSException
- {
- checkReadable();
- checkAvailable(2);
- return _data.getShort();
- }
-
- public int readUnsignedShort() throws JMSException
- {
- checkReadable();
- checkAvailable(2);
- return _data.getUnsignedShort();
- }
-
- /**
- * Note that this method reads a unicode character as two bytes from the stream
- *
- * @return the character read from the stream
- * @throws JMSException
- */
- public char readChar() throws JMSException
- {
- checkReadable();
- checkAvailable(2);
- return _data.getChar();
- }
-
- public int readInt() throws JMSException
- {
- checkReadable();
- checkAvailable(4);
- return _data.getInt();
- }
-
- public long readLong() throws JMSException
- {
- checkReadable();
- checkAvailable(8);
- return _data.getLong();
- }
-
- public float readFloat() throws JMSException
- {
- checkReadable();
- checkAvailable(4);
- return _data.getFloat();
- }
-
- public double readDouble() throws JMSException
- {
- checkReadable();
- checkAvailable(8);
- return _data.getDouble();
- }
-
- public String readUTF() throws JMSException
- {
- checkReadable();
- // we check only for one byte since theoretically the string could be only a
- // single byte when using UTF-8 encoding
-
- try
- {
- short length = readShort();
- if(length == 0)
- {
- return "";
- }
- else
- {
- CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder();
- ByteBuffer encodedString = _data.slice();
- encodedString.limit(length);
- _data.position(_data.position()+length);
- CharBuffer string = decoder.decode(encodedString.buf());
-
- return string.toString();
- }
-
-
-
- }
- catch (CharacterCodingException e)
- {
- JMSException je = new JMSException("Error decoding byte stream as a UTF8 string: " + e);
- je.setLinkedException(e);
- throw je;
- }
- }
-
- public int readBytes(byte[] bytes) throws JMSException
- {
- if (bytes == null)
- {
- throw new IllegalArgumentException("byte array must not be null");
- }
- checkReadable();
- int count = (_data.remaining() >= bytes.length ? bytes.length : _data.remaining());
- if (count == 0)
- {
- return -1;
- }
- else
- {
- _data.get(bytes, 0, count);
- return count;
- }
- }
-
- public int readBytes(byte[] bytes, int maxLength) throws JMSException
- {
- if (bytes == null)
- {
- throw new IllegalArgumentException("byte array must not be null");
- }
- if (maxLength > bytes.length)
- {
- throw new IllegalArgumentException("maxLength must be <= bytes.length");
- }
- checkReadable();
- int count = (_data.remaining() >= maxLength ? maxLength : _data.remaining());
- if (count == 0)
- {
- return -1;
- }
- else
- {
- _data.get(bytes, 0, count);
- return count;
- }
- }
-
- public void writeBoolean(boolean b) throws JMSException
- {
- checkWritable();
- _changedData = true;
- _data.put(b ? (byte) 1 : (byte) 0);
- }
-
- public void writeByte(byte b) throws JMSException
- {
- checkWritable();
- _changedData = true;
- _data.put(b);
- }
-
- public void writeShort(short i) throws JMSException
- {
- checkWritable();
- _changedData = true;
- _data.putShort(i);
- }
-
- public void writeChar(char c) throws JMSException
- {
- checkWritable();
- _changedData = true;
- _data.putChar(c);
- }
-
- public void writeInt(int i) throws JMSException
- {
- checkWritable();
- _changedData = true;
- _data.putInt(i);
- }
-
- public void writeLong(long l) throws JMSException
- {
- checkWritable();
- _changedData = true;
- _data.putLong(l);
- }
-
- public void writeFloat(float v) throws JMSException
- {
- checkWritable();
- _changedData = true;
- _data.putFloat(v);
- }
-
- public void writeDouble(double v) throws JMSException
- {
- checkWritable();
- _changedData = true;
- _data.putDouble(v);
- }
-
- public void writeUTF(String string) throws JMSException
- {
- checkWritable();
- try
- {
- CharsetEncoder encoder = Charset.forName("UTF-8").newEncoder();
- java.nio.ByteBuffer encodedString = encoder.encode(CharBuffer.wrap(string));
-
- _data.putShort((short)encodedString.limit());
- _data.put(encodedString);
- _changedData = true;
- //_data.putString(string, Charset.forName("UTF-8").newEncoder());
- // we must add the null terminator manually
- //_data.put((byte)0);
- }
- catch (CharacterCodingException e)
- {
- JMSException ex = new JMSException("Unable to encode string: " + e);
- ex.setLinkedException(e);
- throw ex;
- }
- }
-
- public void writeBytes(byte[] bytes) throws JMSException
- {
- checkWritable();
- _data.put(bytes);
- _changedData = true;
- }
-
- public void writeBytes(byte[] bytes, int offset, int length) throws JMSException
- {
- checkWritable();
- _data.put(bytes, offset, length);
- _changedData = true;
- }
-
- public void writeObject(Object object) throws JMSException
- {
- checkWritable();
- if (object == null)
- {
- throw new NullPointerException("Argument must not be null");
- }
- Class clazz = object.getClass();
- if (clazz == Byte.class)
- {
- writeByte((Byte) object);
- }
- else if (clazz == Boolean.class)
- {
- writeBoolean((Boolean) object);
- }
- else if (clazz == byte[].class)
- {
- writeBytes((byte[]) object);
- }
- else if (clazz == Short.class)
- {
- writeShort((Short) object);
- }
- else if (clazz == Character.class)
- {
- writeChar((Character) object);
- }
- else if (clazz == Integer.class)
- {
- writeInt((Integer) object);
- }
- else if (clazz == Long.class)
- {
- writeLong((Long) object);
- }
- else if (clazz == Float.class)
- {
- writeFloat((Float) object);
- }
- else if (clazz == Double.class)
- {
- writeDouble((Double) object);
- }
- else if (clazz == String.class)
- {
- writeUTF((String) object);
- }
- else
- {
- throw new MessageFormatException("Only primitives plus byte arrays and String are valid types");
- }
- }
-
- public String toString()
- {
- return String.valueOf(System.identityHashCode(this));
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessageFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessageFactory.java
deleted file mode 100644
index cb04ebee1b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessageFactory.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import javax.jms.JMSException;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-public class JMSBytesMessageFactory extends AbstractJMSMessageFactory
-{
- protected AbstractJMSMessage createMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
- return new JMSBytesMessage(delegate, data);
- }
-
- public AbstractJMSMessage createMessage(AMQMessageDelegateFactory delegateFactory) throws JMSException
- {
- return new JMSBytesMessage(delegateFactory);
- }
-
- // 0_10 specific
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSHeaderAdapter.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSHeaderAdapter.java
deleted file mode 100644
index 6215652c80..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSHeaderAdapter.java
+++ /dev/null
@@ -1,552 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import java.util.Enumeration;
-
-import javax.jms.JMSException;
-import javax.jms.MessageFormatException;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQPInvalidClassException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-
-
-public final class JMSHeaderAdapter
-{
- private final FieldTable _headers;
-
- public JMSHeaderAdapter(FieldTable headers)
- {
- _headers = headers;
- }
-
-
- public FieldTable getHeaders()
- {
- return _headers;
- }
-
- public boolean getBoolean(String string) throws JMSException
- {
- checkPropertyName(string);
- Boolean b = getHeaders().getBoolean(string);
-
- if (b == null)
- {
- if (getHeaders().containsKey(string))
- {
- Object str = getHeaders().getObject(string);
-
- if (str == null || !(str instanceof String))
- {
- throw new MessageFormatException("getBoolean can't use " + string + " item.");
- }
- else
- {
- return Boolean.valueOf((String) str);
- }
- }
- else
- {
- b = Boolean.valueOf(null);
- }
- }
-
- return b;
- }
-
- public boolean getBoolean(AMQShortString string) throws JMSException
- {
- checkPropertyName(string);
- Boolean b = getHeaders().getBoolean(string);
-
- if (b == null)
- {
- if (getHeaders().containsKey(string))
- {
- Object str = getHeaders().getObject(string);
-
- if (str == null || !(str instanceof String))
- {
- throw new MessageFormatException("getBoolean can't use " + string + " item.");
- }
- else
- {
- return Boolean.valueOf((String) str);
- }
- }
- else
- {
- b = Boolean.valueOf(null);
- }
- }
-
- return b;
- }
-
- public char getCharacter(String string) throws JMSException
- {
- checkPropertyName(string);
- Character c = getHeaders().getCharacter(string);
-
- if (c == null)
- {
- if (getHeaders().isNullStringValue(string))
- {
- throw new NullPointerException("Cannot convert null char");
- }
- else
- {
- throw new MessageFormatException("getChar can't use " + string + " item.");
- }
- }
- else
- {
- return (char) c;
- }
- }
-
- public byte[] getBytes(String string) throws JMSException
- {
- return getBytes(new AMQShortString(string));
- }
-
- public byte[] getBytes(AMQShortString string) throws JMSException
- {
- checkPropertyName(string);
-
- byte[] bs = getHeaders().getBytes(string);
-
- if (bs == null)
- {
- throw new MessageFormatException("getBytes can't use " + string + " item.");
- }
- else
- {
- return bs;
- }
- }
-
- public byte getByte(String string) throws JMSException
- {
- checkPropertyName(string);
- Byte b = getHeaders().getByte(string);
- if (b == null)
- {
- if (getHeaders().containsKey(string))
- {
- Object str = getHeaders().getObject(string);
-
- if (str == null || !(str instanceof String))
- {
- throw new MessageFormatException("getByte can't use " + string + " item.");
- }
- else
- {
- return Byte.valueOf((String) str);
- }
- }
- else
- {
- b = Byte.valueOf(null);
- }
- }
-
- return b;
- }
-
- public short getShort(String string) throws JMSException
- {
- checkPropertyName(string);
- Short s = getHeaders().getShort(string);
-
- if (s == null)
- {
- s = Short.valueOf(getByte(string));
- }
-
- return s;
- }
-
- public int getInteger(String string) throws JMSException
- {
- checkPropertyName(string);
- Integer i = getHeaders().getInteger(string);
-
- if (i == null)
- {
- i = Integer.valueOf(getShort(string));
- }
-
- return i;
- }
-
- public long getLong(String string) throws JMSException
- {
- checkPropertyName(string);
- Long l = getHeaders().getLong(string);
-
- if (l == null)
- {
- l = Long.valueOf(getInteger(string));
- }
-
- return l;
- }
-
- public float getFloat(String string) throws JMSException
- {
- checkPropertyName(string);
- Float f = getHeaders().getFloat(string);
-
- if (f == null)
- {
- if (getHeaders().containsKey(string))
- {
- Object str = getHeaders().getObject(string);
-
- if (str == null || !(str instanceof String))
- {
- throw new MessageFormatException("getFloat can't use " + string + " item.");
- }
- else
- {
- return Float.valueOf((String) str);
- }
- }
- else
- {
- f = Float.valueOf(null);
- }
-
- }
-
- return f;
- }
-
- public double getDouble(String string) throws JMSException
- {
- checkPropertyName(string);
- Double d = getHeaders().getDouble(string);
-
- if (d == null)
- {
- d = Double.valueOf(getFloat(string));
- }
-
- return d;
- }
-
- public String getString(String string) throws JMSException
- {
- checkPropertyName(string);
- String s = getHeaders().getString(string);
-
- if (s == null)
- {
- if (getHeaders().containsKey(string))
- {
- Object o = getHeaders().getObject(string);
- if (o instanceof byte[])
- {
- throw new MessageFormatException("getObject couldn't find " + string + " item.");
- }
- else
- {
- if (o == null)
- {
- return null;
- }
- else
- {
- s = String.valueOf(o);
- }
- }
- }//else return s // null;
- }
-
- return s;
- }
-
- public Object getObject(String string) throws JMSException
- {
- checkPropertyName(string);
- return getHeaders().getObject(string);
- }
-
- public void setBoolean(AMQShortString string, boolean b) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setBoolean(string, b);
- }
-
- public void setBoolean(String string, boolean b) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setBoolean(string, b);
- }
-
- public void setChar(String string, char c) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setChar(string, c);
- }
-
- public Object setBytes(AMQShortString string, byte[] bytes)
- {
- checkPropertyName(string);
- return getHeaders().setBytes(string, bytes);
- }
-
- public Object setBytes(String string, byte[] bytes)
- {
- checkPropertyName(string);
- return getHeaders().setBytes(string, bytes);
- }
-
- public Object setBytes(String string, byte[] bytes, int start, int length)
- {
- checkPropertyName(string);
- return getHeaders().setBytes(string, bytes, start, length);
- }
-
- public void setByte(String string, byte b) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setByte(string, b);
- }
-
- public void setByte(AMQShortString string, byte b) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setByte(string, b);
- }
-
-
- public void setShort(String string, short i) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setShort(string, i);
- }
-
- public void setInteger(String string, int i) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setInteger(string, i);
- }
-
- public void setInteger(AMQShortString string, int i) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setInteger(string, i);
- }
-
- public void setLong(String string, long l) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setLong(string, l);
- }
-
- public void setFloat(String string, float v) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setFloat(string, v);
- }
-
- public void setDouble(String string, double v) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setDouble(string, v);
- }
-
- public void setString(String string, String string1) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setString(string, string1);
- }
-
- public void setString(AMQShortString string, String string1) throws JMSException
- {
- checkPropertyName(string);
- getHeaders().setString(string, string1);
- }
-
- public void setObject(String string, Object object) throws JMSException
- {
- checkPropertyName(string);
- try
- {
- getHeaders().setObject(string, object);
- }
- catch (AMQPInvalidClassException aice)
- {
- MessageFormatException mfe = new MessageFormatException("Only primatives are allowed object is:" + object.getClass());
- mfe.setLinkedException(aice);
- throw mfe;
- }
- }
-
- public boolean itemExists(String string) throws JMSException
- {
- checkPropertyName(string);
- return getHeaders().containsKey(string);
- }
-
- public Enumeration getPropertyNames()
- {
- return getHeaders().getPropertyNames();
- }
-
- public void clear()
- {
- getHeaders().clear();
- }
-
- public boolean propertyExists(AMQShortString propertyName)
- {
- checkPropertyName(propertyName);
- return getHeaders().propertyExists(propertyName);
- }
-
- public boolean propertyExists(String propertyName)
- {
- checkPropertyName(propertyName);
- return getHeaders().propertyExists(propertyName);
- }
-
- public Object put(Object key, Object value)
- {
- checkPropertyName(key.toString());
- return getHeaders().setObject(key.toString(), value);
- }
-
- public Object remove(AMQShortString propertyName)
- {
- checkPropertyName(propertyName);
- return getHeaders().remove(propertyName);
- }
-
- public Object remove(String propertyName)
- {
- checkPropertyName(propertyName);
- return getHeaders().remove(propertyName);
- }
-
- public boolean isEmpty()
- {
- return getHeaders().isEmpty();
- }
-
- public void writeToBuffer(ByteBuffer data)
- {
- getHeaders().writeToBuffer(data);
- }
-
- public Enumeration getMapNames()
- {
- return getPropertyNames();
- }
-
- protected void checkPropertyName(CharSequence propertyName)
- {
- if (propertyName == null)
- {
- throw new IllegalArgumentException("Property name must not be null");
- }
- else if (propertyName.length() == 0)
- {
- throw new IllegalArgumentException("Property name must not be the empty string");
- }
-
- checkIdentiferFormat(propertyName);
- }
-
- protected void checkIdentiferFormat(CharSequence propertyName)
- {
-// JMS requirements 3.5.1 Property Names
-// Identifiers:
-// - An identifier is an unlimited-length character sequence that must begin
-// with a Java identifier start character; all following characters must be Java
-// identifier part characters. An identifier start character is any character for
-// which the method Character.isJavaIdentifierStart returns true. This includes
-// '_' and '$'. An identifier part character is any character for which the
-// method Character.isJavaIdentifierPart returns true.
-// - Identifiers cannot be the names NULL, TRUE, or FALSE.
-// Identifiers cannot be NOT, AND, OR, BETWEEN, LIKE, IN, IS, or
-// ESCAPE.
-// Identifiers are either header field references or property references. The
-// type of a property value in a message selector corresponds to the type
-// used to set the property. If a property that does not exist in a message is
-// referenced, its value is NULL. The semantics of evaluating NULL values
-// in a selector are described in Section 3.8.1.2, Null Values.
-// The conversions that apply to the get methods for properties do not
-// apply when a property is used in a message selector expression. For
-// example, suppose you set a property as a string value, as in the
-// following:
-// myMessage.setStringProperty("NumberOfOrders", "2");
-// The following expression in a message selector would evaluate to false,
-// because a string cannot be used in an arithmetic expression:
-// "NumberOfOrders > 1"
-// Identifiers are case sensitive.
-// Message header field references are restricted to JMSDeliveryMode,
-// JMSPriority, JMSMessageID, JMSTimestamp, JMSCorrelationID, and
-// JMSType. JMSMessageID, JMSCorrelationID, and JMSType values may be
-// null and if so are treated as a NULL value.
-
- if (Boolean.getBoolean("strict-jms"))
- {
- // JMS start character
- if (!(Character.isJavaIdentifierStart(propertyName.charAt(0))))
- {
- throw new IllegalArgumentException("Identifier '" + propertyName + "' does not start with a valid JMS identifier start character");
- }
-
- // JMS part character
- int length = propertyName.length();
- for (int c = 1; c < length; c++)
- {
- if (!(Character.isJavaIdentifierPart(propertyName.charAt(c))))
- {
- throw new IllegalArgumentException("Identifier '" + propertyName + "' contains an invalid JMS identifier character");
- }
- }
-
- // JMS invalid names
- if ((propertyName.equals("NULL")
- || propertyName.equals("TRUE")
- || propertyName.equals("FALSE")
- || propertyName.equals("NOT")
- || propertyName.equals("AND")
- || propertyName.equals("OR")
- || propertyName.equals("BETWEEN")
- || propertyName.equals("LIKE")
- || propertyName.equals("IN")
- || propertyName.equals("IS")
- || propertyName.equals("ESCAPE")))
- {
- throw new IllegalArgumentException("Identifier '" + propertyName + "' is not allowed in JMS");
- }
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java
deleted file mode 100644
index b6e013ac8f..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java
+++ /dev/null
@@ -1,513 +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.
- *
- *
- */
-package org.apache.qpid.client.message;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-import javax.jms.MessageFormatException;
-
-import java.nio.charset.CharacterCodingException;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-
-public class JMSMapMessage extends AbstractBytesTypedMessage implements javax.jms.MapMessage
-{
- private static final Logger _logger = LoggerFactory.getLogger(JMSMapMessage.class);
-
- public static final String MIME_TYPE = "jms/map-message";
-
-
- private Map<String, Object> _map = new HashMap<String, Object>();
-
- public JMSMapMessage(AMQMessageDelegateFactory delegateFactory) throws JMSException
- {
- this(delegateFactory, null);
- }
-
- JMSMapMessage(AMQMessageDelegateFactory delegateFactory, ByteBuffer data) throws JMSException
- {
-
- super(delegateFactory, data); // this instantiates a content header
- if(data != null)
- {
- populateMapFromData();
- }
-
- }
-
- JMSMapMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
-
- super(delegate, data);
- try
- {
- populateMapFromData();
- }
- catch (JMSException je)
- {
- throw new AMQException(null, "Error populating MapMessage from ByteBuffer", je);
-
- }
-
- }
-
-
- public String toBodyString() throws JMSException
- {
- return _map == null ? "" : _map.toString();
- }
-
- protected String getMimeType()
- {
- return MIME_TYPE;
- }
-
- public ByteBuffer getData()
- {
- // What if _data is null?
- writeMapToData();
-
- return super.getData();
- }
-
- @Override
- public void clearBodyImpl() throws JMSException
- {
- super.clearBodyImpl();
- _map.clear();
- }
-
- public boolean getBoolean(String propName) throws JMSException
- {
- Object value = _map.get(propName);
-
- if (value instanceof Boolean)
- {
- return ((Boolean) value).booleanValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Boolean.valueOf((String) value);
- }
- else
- {
- throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
- + " cannot be converted to boolean.");
- }
-
- }
-
- public byte getByte(String propName) throws JMSException
- {
- Object value = _map.get(propName);
-
- if (value instanceof Byte)
- {
- return ((Byte) value).byteValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Byte.valueOf((String) value).byteValue();
- }
- else
- {
- throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
- + " cannot be converted to byte.");
- }
- }
-
- public short getShort(String propName) throws JMSException
- {
- Object value = _map.get(propName);
-
- if (value instanceof Short)
- {
- return ((Short) value).shortValue();
- }
- else if (value instanceof Byte)
- {
- return ((Byte) value).shortValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Short.valueOf((String) value).shortValue();
- }
- else
- {
- throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
- + " cannot be converted to short.");
- }
-
- }
-
- public int getInt(String propName) throws JMSException
- {
- Object value = _map.get(propName);
-
- if (value instanceof Integer)
- {
- return ((Integer) value).intValue();
- }
- else if (value instanceof Short)
- {
- return ((Short) value).intValue();
- }
- else if (value instanceof Byte)
- {
- return ((Byte) value).intValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Integer.valueOf((String) value).intValue();
- }
- else
- {
- throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
- + " cannot be converted to int.");
- }
-
- }
-
- public long getLong(String propName) throws JMSException
- {
- Object value = _map.get(propName);
-
- if (value instanceof Long)
- {
- return ((Long) value).longValue();
- }
- else if (value instanceof Integer)
- {
- return ((Integer) value).longValue();
- }
-
- if (value instanceof Short)
- {
- return ((Short) value).longValue();
- }
-
- if (value instanceof Byte)
- {
- return ((Byte) value).longValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Long.valueOf((String) value).longValue();
- }
- else
- {
- throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
- + " cannot be converted to long.");
- }
-
- }
-
- public char getChar(String propName) throws JMSException
- {
- Object value = _map.get(propName);
-
- if (!_map.containsKey(propName))
- {
- throw new MessageFormatException("Property " + propName + " not present");
- }
- else if (value instanceof Character)
- {
- return ((Character) value).charValue();
- }
- else if (value == null)
- {
- throw new NullPointerException("Property " + propName + " has null value and therefore cannot "
- + "be converted to char.");
- }
- else
- {
- throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
- + " cannot be converted to boolan.");
- }
-
- }
-
- public float getFloat(String propName) throws JMSException
- {
- Object value = _map.get(propName);
-
- if (value instanceof Float)
- {
- return ((Float) value).floatValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Float.valueOf((String) value).floatValue();
- }
- else
- {
- throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
- + " cannot be converted to float.");
- }
- }
-
- public double getDouble(String propName) throws JMSException
- {
- Object value = _map.get(propName);
-
- if (value instanceof Double)
- {
- return ((Double) value).doubleValue();
- }
- else if (value instanceof Float)
- {
- return ((Float) value).doubleValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Double.valueOf((String) value).doubleValue();
- }
- else
- {
- throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
- + " cannot be converted to double.");
- }
- }
-
- public String getString(String propName) throws JMSException
- {
- Object value = _map.get(propName);
-
- if ((value instanceof String) || (value == null))
- {
- return (String) value;
- }
- else if (value instanceof byte[])
- {
- throw new MessageFormatException("Property " + propName + " of type byte[] " + "cannot be converted to String.");
- }
- else
- {
- return value.toString();
- }
-
- }
-
- public byte[] getBytes(String propName) throws JMSException
- {
- Object value = _map.get(propName);
-
- if (!_map.containsKey(propName))
- {
- throw new MessageFormatException("Property " + propName + " not present");
- }
- else if ((value instanceof byte[]) || (value == null))
- {
- return (byte[]) value;
- }
- else
- {
- throw new MessageFormatException("Property " + propName + " of type " + value.getClass().getName()
- + " cannot be converted to byte[].");
- }
- }
-
- public Object getObject(String propName) throws JMSException
- {
- return _map.get(propName);
- }
-
- public Enumeration getMapNames() throws JMSException
- {
- return Collections.enumeration(_map.keySet());
- }
-
- public void setBoolean(String propName, boolean b) throws JMSException
- {
- checkWritable();
- checkPropertyName(propName);
- _map.put(propName, b);
- }
-
- public void setByte(String propName, byte b) throws JMSException
- {
- checkWritable();
- checkPropertyName(propName);
- _map.put(propName, b);
- }
-
- public void setShort(String propName, short i) throws JMSException
- {
- checkWritable();
- checkPropertyName(propName);
- _map.put(propName, i);
- }
-
- public void setChar(String propName, char c) throws JMSException
- {
- checkWritable();
- checkPropertyName(propName);
- _map.put(propName, c);
- }
-
- public void setInt(String propName, int i) throws JMSException
- {
- checkWritable();
- checkPropertyName(propName);
- _map.put(propName, i);
- }
-
- public void setLong(String propName, long l) throws JMSException
- {
- checkWritable();
- checkPropertyName(propName);
- _map.put(propName, l);
- }
-
- public void setFloat(String propName, float v) throws JMSException
- {
- checkWritable();
- checkPropertyName(propName);
- _map.put(propName, v);
- }
-
- public void setDouble(String propName, double v) throws JMSException
- {
- checkWritable();
- checkPropertyName(propName);
- _map.put(propName, v);
- }
-
- public void setString(String propName, String string1) throws JMSException
- {
- checkWritable();
- checkPropertyName(propName);
- _map.put(propName, string1);
- }
-
- public void setBytes(String propName, byte[] bytes) throws JMSException
- {
- checkWritable();
- checkPropertyName(propName);
- _map.put(propName, bytes);
- }
-
- public void setBytes(String propName, byte[] bytes, int offset, int length) throws JMSException
- {
- if ((offset == 0) && (length == bytes.length))
- {
- setBytes(propName, bytes);
- }
- else
- {
- byte[] newBytes = new byte[length];
- System.arraycopy(bytes, offset, newBytes, 0, length);
- setBytes(propName, newBytes);
- }
- }
-
- public void setObject(String propName, Object value) throws JMSException
- {
- checkWritable();
- checkPropertyName(propName);
- if ((value instanceof Boolean) || (value instanceof Byte) || (value instanceof Short) || (value instanceof Integer)
- || (value instanceof Long) || (value instanceof Character) || (value instanceof Float)
- || (value instanceof Double) || (value instanceof String) || (value instanceof byte[]) || (value == null))
- {
- _map.put(propName, value);
- }
- else
- {
- throw new MessageFormatException("Cannot set property " + propName + " to value " + value + "of type "
- + value.getClass().getName() + ".");
- }
- }
-
- private void checkPropertyName(String propName)
- {
- if ((propName == null) || propName.equals(""))
- {
- throw new IllegalArgumentException("Property name cannot be null, or the empty String.");
- }
- }
-
- public boolean itemExists(String propName) throws JMSException
- {
- return _map.containsKey(propName);
- }
-
- private void populateMapFromData() throws JMSException
- {
- if (_data != null)
- {
- _data.rewind();
-
- final int entries = readIntImpl();
- for (int i = 0; i < entries; i++)
- {
- String propName = readStringImpl();
- Object value = readObject();
- _map.put(propName, value);
- }
- }
- else
- {
- _map.clear();
- }
- }
-
- private void writeMapToData()
- {
- allocateInitialBuffer();
- final int size = _map.size();
- writeIntImpl(size);
- for (Map.Entry<String, Object> entry : _map.entrySet())
- {
- try
- {
- writeStringImpl(entry.getKey());
- }
- catch (CharacterCodingException e)
- {
- throw new IllegalArgumentException("Cannot encode property key name " + entry.getKey(), e);
-
- }
-
- try
- {
- writeObject(entry.getValue());
- }
- catch (JMSException e)
- {
- Object value = entry.getValue();
- throw new IllegalArgumentException("Cannot encode property key name " + entry.getKey() + " value : " + value
- + " (type: " + value.getClass().getName() + ").", e);
- }
- }
-
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessageFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessageFactory.java
deleted file mode 100644
index eccb90560b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessageFactory.java
+++ /dev/null
@@ -1,42 +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.
- *
- *
- */
-package org.apache.qpid.client.message;
-
-import javax.jms.JMSException;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-public class JMSMapMessageFactory extends AbstractJMSMessageFactory
-{
- public AbstractJMSMessage createMessage(AMQMessageDelegateFactory delegateFactory) throws JMSException
- {
- return new JMSMapMessage(delegateFactory);
- }
-
- protected AbstractJMSMessage createMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
- return new JMSMapMessage(delegate, data);
-
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java
deleted file mode 100644
index 39b9597af1..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java
+++ /dev/null
@@ -1,177 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.nio.charset.CharacterCodingException;
-import java.nio.charset.Charset;
-
-import javax.jms.JMSException;
-import javax.jms.MessageFormatException;
-import javax.jms.ObjectMessage;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-public class JMSObjectMessage extends AbstractJMSMessage implements ObjectMessage
-{
- public static final String MIME_TYPE = "application/java-object-stream";
-
-
- private static final int DEFAULT_BUFFER_SIZE = 1024;
-
- /**
- * Creates empty, writable message for use by producers
- * @param delegateFactory
- */
- public JMSObjectMessage(AMQMessageDelegateFactory delegateFactory)
- {
- this(delegateFactory, null);
- }
-
- private JMSObjectMessage(AMQMessageDelegateFactory delegateFactory, ByteBuffer data)
- {
- super(delegateFactory, data);
- if (data == null)
- {
- _data = ByteBuffer.allocate(DEFAULT_BUFFER_SIZE);
- _data.setAutoExpand(true);
- }
-
- setContentType(getMimeType());
- }
-
- /**
- * Creates read only message for delivery to consumers
- */
-
- JMSObjectMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
- super(delegate, data);
- }
-
-
- public void clearBodyImpl() throws JMSException
- {
- if (_data != null)
- {
- _data.release();
- _data = null;
- }
-
-
-
- }
-
- public String toBodyString() throws JMSException
- {
- return String.valueOf(getObject());
- }
-
- public String getMimeType()
- {
- return MIME_TYPE;
- }
-
- public void setObject(Serializable serializable) throws JMSException
- {
- checkWritable();
-
- if (_data == null)
- {
- _data = ByteBuffer.allocate(DEFAULT_BUFFER_SIZE);
- _data.setAutoExpand(true);
- }
- else
- {
- _data.rewind();
- }
-
- try
- {
- ObjectOutputStream out = new ObjectOutputStream(_data.asOutputStream());
- out.writeObject(serializable);
- out.flush();
- out.close();
- }
- catch (IOException e)
- {
- MessageFormatException mfe = new MessageFormatException("Message not serializable: " + e);
- mfe.setLinkedException(e);
- throw mfe;
- }
-
- }
-
- public Serializable getObject() throws JMSException
- {
- ObjectInputStream in = null;
- if (_data == null)
- {
- return null;
- }
-
- try
- {
- _data.rewind();
- in = new ObjectInputStream(_data.asInputStream());
-
- return (Serializable) in.readObject();
- }
- catch (IOException e)
- {
- MessageFormatException mfe = new MessageFormatException("Could not deserialize message: " + e);
- mfe.setLinkedException(e);
- throw mfe;
- }
- catch (ClassNotFoundException e)
- {
- MessageFormatException mfe = new MessageFormatException("Could not deserialize message: " + e);
- mfe.setLinkedException(e);
- throw mfe;
- }
- finally
- {
- _data.rewind();
- close(in);
- }
- }
-
- private static void close(InputStream in)
- {
- try
- {
- if (in != null)
- {
- in.close();
- }
- }
- catch (IOException ignore)
- { }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessageFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessageFactory.java
deleted file mode 100644
index 03851dfa01..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessageFactory.java
+++ /dev/null
@@ -1,41 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import javax.jms.JMSException;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-public class JMSObjectMessageFactory extends AbstractJMSMessageFactory
-{
- protected AbstractJMSMessage createMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
- return new JMSObjectMessage(delegate, data);
- }
-
- public AbstractJMSMessage createMessage(AMQMessageDelegateFactory delegateFactory) throws JMSException
- {
- return new JMSObjectMessage(delegateFactory);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
deleted file mode 100644
index ad2620852b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
+++ /dev/null
@@ -1,206 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import javax.jms.JMSException;
-import javax.jms.StreamMessage;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-/**
- * @author Apache Software Foundation
- */
-public class JMSStreamMessage extends AbstractBytesTypedMessage implements StreamMessage
-{
- public static final String MIME_TYPE="jms/stream-message";
-
-
-
- /**
- * This is set when reading a byte array. The readBytes(byte[]) method supports multiple calls to read
- * a byte array in multiple chunks, hence this is used to track how much is left to be read
- */
- private int _byteArrayRemaining = -1;
-
- public JMSStreamMessage(AMQMessageDelegateFactory delegateFactory)
- {
- this(delegateFactory,null);
-
- }
-
- /**
- * Construct a stream message with existing data.
- *
- * @param delegateFactory
- * @param data the data that comprises this message. If data is null, you get a 1024 byte buffer that is
- */
- JMSStreamMessage(AMQMessageDelegateFactory delegateFactory, ByteBuffer data)
- {
-
- super(delegateFactory, data); // this instanties a content header
- }
-
- JMSStreamMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
-
- super(delegate, data);
- }
-
-
- public void reset()
- {
- super.reset();
- _readableMessage = true;
- }
-
- protected String getMimeType()
- {
- return MIME_TYPE;
- }
-
-
-
- public boolean readBoolean() throws JMSException
- {
- return super.readBoolean();
- }
-
-
- public byte readByte() throws JMSException
- {
- return super.readByte();
- }
-
- public short readShort() throws JMSException
- {
- return super.readShort();
- }
-
- /**
- * Note that this method reads a unicode character as two bytes from the stream
- *
- * @return the character read from the stream
- * @throws JMSException
- */
- public char readChar() throws JMSException
- {
- return super.readChar();
- }
-
- public int readInt() throws JMSException
- {
- return super.readInt();
- }
-
- public long readLong() throws JMSException
- {
- return super.readLong();
- }
-
- public float readFloat() throws JMSException
- {
- return super.readFloat();
- }
-
- public double readDouble() throws JMSException
- {
- return super.readDouble();
- }
-
- public String readString() throws JMSException
- {
- return super.readString();
- }
-
- public int readBytes(byte[] bytes) throws JMSException
- {
- return super.readBytes(bytes);
- }
-
-
- public Object readObject() throws JMSException
- {
- return super.readObject();
- }
-
- public void writeBoolean(boolean b) throws JMSException
- {
- super.writeBoolean(b);
- }
-
- public void writeByte(byte b) throws JMSException
- {
- super.writeByte(b);
- }
-
- public void writeShort(short i) throws JMSException
- {
- super.writeShort(i);
- }
-
- public void writeChar(char c) throws JMSException
- {
- super.writeChar(c);
- }
-
- public void writeInt(int i) throws JMSException
- {
- super.writeInt(i);
- }
-
- public void writeLong(long l) throws JMSException
- {
- super.writeLong(l);
- }
-
- public void writeFloat(float v) throws JMSException
- {
- super.writeFloat(v);
- }
-
- public void writeDouble(double v) throws JMSException
- {
- super.writeDouble(v);
- }
-
- public void writeString(String string) throws JMSException
- {
- super.writeString(string);
- }
-
- public void writeBytes(byte[] bytes) throws JMSException
- {
- super.writeBytes(bytes);
- }
-
- public void writeBytes(byte[] bytes, int offset, int length) throws JMSException
- {
- super.writeBytes(bytes,offset,length);
- }
-
- public void writeObject(Object object) throws JMSException
- {
- super.writeObject(object);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessageFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessageFactory.java
deleted file mode 100644
index 5e25db9ae0..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessageFactory.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import javax.jms.JMSException;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-public class JMSStreamMessageFactory extends AbstractJMSMessageFactory
-{
- protected AbstractJMSMessage createMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
- return new JMSStreamMessage(delegate, data);
- }
- public AbstractJMSMessage createMessage(AMQMessageDelegateFactory delegateFactory) throws JMSException
- {
- return new JMSStreamMessage(delegateFactory);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessage.java
deleted file mode 100644
index c290149cef..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessage.java
+++ /dev/null
@@ -1,185 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.CharacterCodingException;
-import java.nio.charset.Charset;
-
-import javax.jms.JMSException;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.CustomJMSXProperty;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.util.Strings;
-
-public class JMSTextMessage extends AbstractJMSMessage implements javax.jms.TextMessage
-{
- private static final String MIME_TYPE = "text/plain";
-
- private String _decodedValue;
-
- /**
- * This constant represents the name of a property that is set when the message payload is null.
- */
- private static final String PAYLOAD_NULL_PROPERTY = CustomJMSXProperty.JMS_AMQP_NULL.toString();
- private static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
-
- public JMSTextMessage(AMQMessageDelegateFactory delegateFactory) throws JMSException
- {
- this(delegateFactory, null, null);
- }
-
- JMSTextMessage(AMQMessageDelegateFactory delegateFactory, ByteBuffer data, String encoding) throws JMSException
- {
- super(delegateFactory, data); // this instantiates a content header
- setContentType(getMimeType());
- setEncoding(encoding);
- }
-
- JMSTextMessage(AMQMessageDelegate delegate, ByteBuffer data)
- throws AMQException
- {
- super(delegate, data);
- setContentType(getMimeType());
- _data = data;
- }
-
-
- public void clearBodyImpl() throws JMSException
- {
- if (_data != null)
- {
- _data.release();
- _data = null;
- }
-
- _decodedValue = null;
- }
-
- public String toBodyString() throws JMSException
- {
- return getText();
- }
-
- protected String getMimeType()
- {
- return MIME_TYPE;
- }
-
- public void setText(String text) throws JMSException
- {
- checkWritable();
-
- clearBody();
- try
- {
- if (text != null)
- {
- final String encoding = getEncoding();
- if (encoding == null || encoding.equalsIgnoreCase("UTF-8"))
- {
- _data = ByteBuffer.wrap(Strings.toUTF8(text));
- }
- else
- {
- _data = ByteBuffer.wrap(text.getBytes(encoding));
- }
- _data.position(_data.limit());
- _changedData=true;
- }
- _decodedValue = text;
- }
- catch (UnsupportedEncodingException e)
- {
- // should never occur
- JMSException jmse = new JMSException("Unable to decode text data");
- jmse.setLinkedException(e);
- throw jmse;
- }
- }
-
- public String getText() throws JMSException
- {
- if (_data == null && _decodedValue == null)
- {
- return null;
- }
- else if (_decodedValue != null)
- {
- return _decodedValue;
- }
- else
- {
- _data.rewind();
-
- if (propertyExists(PAYLOAD_NULL_PROPERTY) && getBooleanProperty(PAYLOAD_NULL_PROPERTY))
- {
- return null;
- }
- if (getEncoding() != null)
- {
- try
- {
- _decodedValue = _data.getString(Charset.forName(getEncoding()).newDecoder());
- }
- catch (CharacterCodingException e)
- {
- JMSException je = new JMSException("Could not decode string data: " + e);
- je.setLinkedException(e);
- throw je;
- }
- }
- else
- {
- try
- {
- _decodedValue = _data.getString(DEFAULT_CHARSET.newDecoder());
- }
- catch (CharacterCodingException e)
- {
- JMSException je = new JMSException("Could not decode string data: " + e);
- je.setLinkedException(e);
- throw je;
- }
- }
- return _decodedValue;
- }
- }
-
- @Override
- public void prepareForSending() throws JMSException
- {
- super.prepareForSending();
- if (_data == null)
- {
- setBooleanProperty(PAYLOAD_NULL_PROPERTY, true);
- }
- else
- {
- removeProperty(PAYLOAD_NULL_PROPERTY);
- }
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessageFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessageFactory.java
deleted file mode 100644
index 1f4d64c78f..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessageFactory.java
+++ /dev/null
@@ -1,42 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import javax.jms.JMSException;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-
-public class JMSTextMessageFactory extends AbstractJMSMessageFactory
-{
-
- public AbstractJMSMessage createMessage(AMQMessageDelegateFactory delegateFactory) throws JMSException
- {
- return new JMSTextMessage(delegateFactory);
- }
-
- protected AbstractJMSMessage createMessage(AMQMessageDelegate delegate, ByteBuffer data) throws AMQException
- {
- return new JMSTextMessage(delegate, data);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageConverter.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageConverter.java
deleted file mode 100644
index e606ef11c9..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageConverter.java
+++ /dev/null
@@ -1,195 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.client.AMQSession;
-
-import javax.jms.*;
-
-import java.util.Enumeration;
-
-public class MessageConverter
-{
-
- /**
- * Log4J logger
- */
- protected final Logger _logger = LoggerFactory.getLogger(getClass());
-
- /**
- * AbstractJMSMessage which will hold the converted message
- */
- private AbstractJMSMessage _newMessage;
-
- public MessageConverter(AbstractJMSMessage message) throws JMSException
- {
- _newMessage = message;
- }
-
- public MessageConverter(AMQSession session, BytesMessage bytesMessage) throws JMSException
- {
- bytesMessage.reset();
-
- JMSBytesMessage nativeMsg = (JMSBytesMessage) session.createBytesMessage();
-
- byte[] buf = new byte[1024];
-
- int len;
-
- while ((len = bytesMessage.readBytes(buf)) != -1)
- {
- nativeMsg.writeBytes(buf, 0, len);
- }
-
- _newMessage = nativeMsg;
- setMessageProperties(bytesMessage);
- }
-
- public MessageConverter(AMQSession session, MapMessage message) throws JMSException
- {
- MapMessage nativeMessage = session.createMapMessage();
-
- Enumeration mapNames = message.getMapNames();
- while (mapNames.hasMoreElements())
- {
- String name = (String) mapNames.nextElement();
- nativeMessage.setObject(name, message.getObject(name));
- }
-
- _newMessage = (AbstractJMSMessage) nativeMessage;
- setMessageProperties(message);
- }
-
- public MessageConverter(AMQSession session, ObjectMessage origMessage) throws JMSException
- {
-
- ObjectMessage nativeMessage = session.createObjectMessage();
-
- nativeMessage.setObject(origMessage.getObject());
-
- _newMessage = (AbstractJMSMessage) nativeMessage;
- setMessageProperties(origMessage);
-
- }
-
- public MessageConverter(AMQSession session, TextMessage message) throws JMSException
- {
- TextMessage nativeMessage = session.createTextMessage();
-
- nativeMessage.setText(message.getText());
-
- _newMessage = (AbstractJMSMessage) nativeMessage;
- setMessageProperties(message);
- }
-
- public MessageConverter(AMQSession session, StreamMessage message) throws JMSException
- {
- StreamMessage nativeMessage = session.createStreamMessage();
-
- try
- {
- message.reset();
- while (true)
- {
- nativeMessage.writeObject(message.readObject());
- }
- }
- catch (MessageEOFException e)
- {
- // we're at the end so don't mind the exception
- }
-
- _newMessage = (AbstractJMSMessage) nativeMessage;
- setMessageProperties(message);
- }
-
- public MessageConverter(AMQSession session, Message message) throws JMSException
- {
- // Send a message with just properties.
- // Throwing away content
- Message nativeMessage = session.createMessage();
-
- _newMessage = (AbstractJMSMessage) nativeMessage;
- setMessageProperties(message);
- }
-
- public AbstractJMSMessage getConvertedMessage()
- {
- return _newMessage;
- }
-
- /**
- * Sets all message properties
- */
- protected void setMessageProperties(Message message) throws JMSException
- {
- setNonJMSProperties(message);
- setJMSProperties(message);
- }
-
- /**
- * Sets all non-JMS defined properties on converted message
- */
- protected void setNonJMSProperties(Message message) throws JMSException
- {
- Enumeration propertyNames = message.getPropertyNames();
- while (propertyNames.hasMoreElements())
- {
- String propertyName = String.valueOf(propertyNames.nextElement());
- // TODO: Shouldn't need to check for JMS properties here as don't think getPropertyNames() should return them
- if (!propertyName.startsWith("JMSX_"))
- {
- Object value = message.getObjectProperty(propertyName);
- _newMessage.setObjectProperty(propertyName, value);
- }
- }
- }
-
- /**
- * Exposed JMS defined properties on converted message:
- * JMSDestination - we don't set here
- * JMSDeliveryMode - set
- * JMSExpiration - we don't set here
- * JMSPriority - we don't set here
- * JMSMessageID - we don't set here
- * JMSTimestamp - we don't set here
- * JMSCorrelationID - set
- * JMSReplyTo - set
- * JMSType - set
- * JMSRedlivered - we don't set here
- */
- protected void setJMSProperties(Message message) throws JMSException
- {
- _newMessage.setJMSDeliveryMode(message.getJMSDeliveryMode());
-
- if (message.getJMSReplyTo() != null)
- {
- _newMessage.setJMSReplyTo(message.getJMSReplyTo());
- }
-
- _newMessage.setJMSType(message.getJMSType());
-
- _newMessage.setJMSCorrelationID(message.getJMSCorrelationID());
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactory.java
deleted file mode 100644
index e1275c37f7..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactory.java
+++ /dev/null
@@ -1,47 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import java.util.List;
-
-import javax.jms.JMSException;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.transport.Struct;
-
-
-public interface MessageFactory
-{
- AbstractJMSMessage createMessage(long deliveryTag, boolean redelivered,
- ContentHeaderBody contentHeader,
- AMQShortString exchange, AMQShortString routingKey,
- List bodies)
- throws JMSException, AMQException;
-
- AbstractJMSMessage createMessage(long deliveryTag, boolean redelivered,
- Struct[] contentHeader,
- java.nio.ByteBuffer body)
- throws JMSException, AMQException;
-
- AbstractJMSMessage createMessage(AMQMessageDelegateFactory delegateFactory) throws JMSException;
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java
deleted file mode 100644
index 461fec73bc..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java
+++ /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.
- *
- */
-package org.apache.qpid.client.message;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.nio.ByteBuffer;
-
-import javax.jms.JMSException;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.transport.Struct;
-import org.apache.qpid.transport.MessageProperties;
-import org.apache.qpid.transport.MessageTransfer;
-import org.apache.qpid.transport.DeliveryProperties;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class MessageFactoryRegistry
-{
- /**
- * This class logger
- */
- protected final Logger _logger = LoggerFactory.getLogger(getClass());
-
- private final Map<String, MessageFactory> _mimeStringToFactoryMap = new HashMap<String, MessageFactory>();
- private final Map<AMQShortString, MessageFactory> _mimeShortStringToFactoryMap =
- new HashMap<AMQShortString, MessageFactory>();
-
- /**
- * Construct a new registry with the default message factories registered
- *
- * @return a message factory registry
- */
- public static MessageFactoryRegistry newDefaultRegistry()
- {
- MessageFactoryRegistry mf = new MessageFactoryRegistry();
- mf.registerFactory(JMSMapMessage.MIME_TYPE, new JMSMapMessageFactory());
- mf.registerFactory("text/plain", new JMSTextMessageFactory());
- mf.registerFactory("text/xml", new JMSTextMessageFactory());
- mf.registerFactory(JMSBytesMessage.MIME_TYPE, new JMSBytesMessageFactory());
- mf.registerFactory(JMSObjectMessage.MIME_TYPE, new JMSObjectMessageFactory());
- mf.registerFactory(JMSStreamMessage.MIME_TYPE, new JMSStreamMessageFactory());
- mf.registerFactory(null, new JMSBytesMessageFactory());
-
- return mf;
- }
-
-
- public void registerFactory(String mimeType, MessageFactory mf)
- {
- if (mf == null)
- {
- throw new IllegalArgumentException("Message factory must not be null");
- }
-
- _mimeStringToFactoryMap.put(mimeType, mf);
- _mimeShortStringToFactoryMap.put(new AMQShortString(mimeType), mf);
- }
-
- public MessageFactory deregisterFactory(String mimeType)
- {
- _mimeShortStringToFactoryMap.remove(new AMQShortString(mimeType));
-
- return _mimeStringToFactoryMap.remove(mimeType);
- }
-
- /**
- * Create a message. This looks up the MIME type from the content header and instantiates the appropriate
- * concrete message type.
- *
- * @param deliveryTag the AMQ message id
- * @param redelivered true if redelivered
- * @param contentHeader the content header that was received
- * @param bodies a list of ContentBody instances @return the message.
- * @throws AMQException
- * @throws JMSException
- */
- public AbstractJMSMessage createMessage(long deliveryTag, boolean redelivered, AMQShortString exchange,
- AMQShortString routingKey, ContentHeaderBody contentHeader, List bodies)
- throws AMQException, JMSException
- {
- BasicContentHeaderProperties properties = (BasicContentHeaderProperties) contentHeader.properties;
-
- // Get the message content type. This may be null for pure AMQP messages, but will always be set for JMS over
- // AMQP. When the type is null, it can only be assumed that the message is a byte message.
- AMQShortString contentTypeShortString = properties.getContentType();
- contentTypeShortString = (contentTypeShortString == null) ? new AMQShortString(
- JMSBytesMessage.MIME_TYPE) : contentTypeShortString;
-
- MessageFactory mf = _mimeShortStringToFactoryMap.get(contentTypeShortString);
- if (mf == null)
- {
- throw new AMQException(null, "Unsupport MIME type of " + properties.getContentTypeAsString(), null);
- }
- else
- {
- return mf.createMessage(deliveryTag, redelivered, contentHeader, exchange, routingKey, bodies);
- }
- }
-
- public AbstractJMSMessage createMessage(MessageTransfer transfer) throws AMQException, JMSException
- {
-
- MessageProperties mprop = transfer.getHeader().get(MessageProperties.class);
- String messageType = "";
- if ( mprop == null || mprop.getContentType() == null)
- {
- _logger.debug("no message type specified, building a byte message");
- messageType = JMSBytesMessage.MIME_TYPE;
- }
- else
- {
- messageType = mprop.getContentType();
- }
- MessageFactory mf = _mimeStringToFactoryMap.get(messageType);
- if (mf == null)
- {
- throw new AMQException(null, "Unsupport MIME type of " + messageType, null);
- }
- else
- {
- boolean redelivered = false;
- DeliveryProperties deliverProps;
- if((deliverProps = transfer.getHeader().get(DeliveryProperties.class)) != null)
- {
- redelivered = deliverProps.getRedelivered();
- }
- return mf.createMessage(transfer.getId(), redelivered, transfer.getHeader().getStructs(), transfer.getBody());
- }
- }
-
-
- public AbstractJMSMessage createMessage(AMQMessageDelegateFactory delegateFactory, String mimeType) throws AMQException, JMSException
- {
- if (mimeType == null)
- {
- throw new IllegalArgumentException("Mime type must not be null");
- }
-
- MessageFactory mf = _mimeStringToFactoryMap.get(mimeType);
- if (mf == null)
- {
- throw new AMQException(null, "Unsupport MIME type of " + mimeType, null);
- }
- else
- {
- return mf.createMessage(delegateFactory);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/ReturnMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/ReturnMessage.java
deleted file mode 100644
index 6e5f33a65c..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/ReturnMessage.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.apache.qpid.client.message;
-/*
- *
- * 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 org.apache.qpid.framing.AMQShortString;
-
-public class ReturnMessage extends UnprocessedMessage_0_8
-{
- final private AMQShortString _replyText;
- final private int _replyCode;
-
- public ReturnMessage(AMQShortString exchange, AMQShortString routingKey, AMQShortString replyText, int replyCode)
- {
- super(-1,0,exchange,routingKey,false);
- _replyText = replyText;
- _replyCode = replyCode;
- }
-
- public int getReplyCode()
- {
- return _replyCode;
- }
-
- public AMQShortString getReplyText()
- {
- return _replyText;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java
deleted file mode 100644
index 713c87260c..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java
+++ /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.
- *
- */
-package org.apache.qpid.client.message;
-
-import org.apache.qpid.client.BasicMessageConsumer;
-
-
-/**
- * This class contains everything needed to process a JMS message. It assembles the deliver body, the content header and
- * the content body/ies.
- *
- * Note that the actual work of creating a JMS message for the client code's use is done outside of the MINA dispatcher
- * thread in order to minimise the amount of work done in the MINA dispatcher thread.
- */
-public abstract class UnprocessedMessage
-{
- private final int _consumerTag;
-
-
- public UnprocessedMessage(int consumerTag)
- {
- _consumerTag = consumerTag;
- }
-
-
- abstract public long getDeliveryTag();
-
-
- public int getConsumerTag()
- {
- return _consumerTag;
- }
-
-
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage_0_10.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage_0_10.java
deleted file mode 100644
index f31bc88509..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage_0_10.java
+++ /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.
- *
- */
-package org.apache.qpid.client.message;
-
-import org.apache.qpid.transport.MessageTransfer;
-
-/**
- * This class contains everything needed to process a JMS message. It assembles the deliver body, the content header and
- * the content body/ies.
- *
- * Note that the actual work of creating a JMS message for the client code's use is done outside of the MINA dispatcher
- * thread in order to minimise the amount of work done in the MINA dispatcher thread.
- */
-public class UnprocessedMessage_0_10 extends UnprocessedMessage
-{
- private MessageTransfer _transfer;
-
- public UnprocessedMessage_0_10(MessageTransfer xfr)
- {
- super(Integer.parseInt(xfr.getDestination()));
- _transfer = xfr;
- }
-
- // additional 0_10 method
-
- public long getDeliveryTag()
- {
- return _transfer.getId();
- }
-
- public MessageTransfer getMessageTransfer()
- {
- return _transfer;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage_0_8.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage_0_8.java
deleted file mode 100644
index 685e646d85..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage_0_8.java
+++ /dev/null
@@ -1,163 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicDeliverBody;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.ContentHeaderBody;
-
-/**
- * This class contains everything needed to process a JMS message. It assembles the deliver body, the content header and
- * the content body/ies.
- *
- * Note that the actual work of creating a JMS message for the client code's use is done outside of the MINA dispatcher
- * thread in order to minimise the amount of work done in the MINA dispatcher thread.
- */
-public class UnprocessedMessage_0_8 extends UnprocessedMessage
-{
- private long _bytesReceived = 0;
-
-
- private AMQShortString _exchange;
- private AMQShortString _routingKey;
- private final long _deliveryId;
- protected boolean _redelivered;
-
- private BasicDeliverBody _deliverBody;
- private ContentHeaderBody _contentHeader;
-
- /** List of ContentBody instances. Due to fragmentation you don't know how big this will be in general */
- private List<ContentBody> _bodies;
-
- public UnprocessedMessage_0_8(long deliveryId, int consumerTag, AMQShortString exchange, AMQShortString routingKey, boolean redelivered)
- {
- super(consumerTag);
- _exchange = exchange;
- _routingKey = routingKey;
-
- _redelivered = redelivered;
- _deliveryId = deliveryId;
- }
-
-
- public AMQShortString getExchange()
- {
- return _exchange;
- }
-
- public AMQShortString getRoutingKey()
- {
- return _routingKey;
- }
-
- public long getDeliveryTag()
- {
- return _deliveryId;
- }
-
- public boolean isRedelivered()
- {
- return _redelivered;
- }
-
-
- public void receiveBody(ContentBody body)
- {
-
- if (body.payload != null)
- {
- final long payloadSize = body.payload.remaining();
-
- if (_bodies == null)
- {
- if (payloadSize == getContentHeader().bodySize)
- {
- _bodies = Collections.singletonList(body);
- }
- else
- {
- _bodies = new ArrayList<ContentBody>();
- _bodies.add(body);
- }
-
- }
- else
- {
- _bodies.add(body);
- }
- _bytesReceived += payloadSize;
- }
- }
-
- public void setMethodBody(BasicDeliverBody deliverBody)
- {
- _deliverBody = deliverBody;
- }
-
- public void setContentHeader(ContentHeaderBody contentHeader)
- {
- this._contentHeader = contentHeader;
- }
-
- public boolean isAllBodyDataReceived()
- {
- return _bytesReceived == getContentHeader().bodySize;
- }
-
- public BasicDeliverBody getDeliverBody()
- {
- return _deliverBody;
- }
-
- public ContentHeaderBody getContentHeader()
- {
- return _contentHeader;
- }
-
- public List<ContentBody> getBodies()
- {
- return _bodies;
- }
-
- public String toString()
- {
- StringBuilder buf = new StringBuilder();
-
- if (_contentHeader != null)
- {
- buf.append("ContentHeader " + _contentHeader);
- }
- if(_deliverBody != null)
- {
- buf.append("Delivery tag " + _deliverBody.getDeliveryTag());
- buf.append("Consumer tag " + _deliverBody.getConsumerTag());
- buf.append("Deliver Body " + _deliverBody);
- }
-
- return buf.toString();
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQIoTransportProtocolSession.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQIoTransportProtocolSession.java
deleted file mode 100644
index f2aca58deb..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQIoTransportProtocolSession.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.apache.qpid.client.protocol;
-/*
- *
- * 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 java.util.UUID;
-
-import javax.security.sasl.SaslClient;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.mina.common.IdleStatus;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.ConnectionTuneParameters;
-import org.apache.qpid.client.handler.ClientMethodDispatcherImpl;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ProtocolInitiation;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.transport.Sender;
-
-public class AMQIoTransportProtocolSession extends AMQProtocolSession
-{
-
- protected Sender<java.nio.ByteBuffer> _ioSender;
- private SaslClient _saslClient;
- private ConnectionTuneParameters _connectionTuneParameters;
-
- public AMQIoTransportProtocolSession(AMQProtocolHandler protocolHandler, AMQConnection connection)
- {
- super(protocolHandler, connection);
- }
-
- @Override
- public void closeProtocolSession(boolean waitLast) throws AMQException
- {
- _ioSender.close();
- _protocolHandler.getStateManager().changeState(AMQState.CONNECTION_CLOSED);
- }
-
- @Override
- public void init()
- {
- _ioSender.send(new ProtocolInitiation(_connection.getProtocolVersion()).toNioByteBuffer());
- _ioSender.flush();
- }
-
- @Override
- protected AMQShortString generateQueueName()
- {
- int id;
- synchronized (_queueIdLock)
- {
- id = _queueId++;
- }
- return new AMQShortString("tmp_" + UUID.randomUUID() + "_" + id);
- }
-
- @Override
- public AMQConnection getAMQConnection()
- {
- return _connection;
- }
-
- @Override
- public SaslClient getSaslClient()
- {
- return _saslClient;
- }
-
- @Override
- public void setSaslClient(SaslClient client)
- {
- _saslClient = client;
- }
-
- /** @param delay delay in seconds (not ms) */
- @Override
- void initHeartbeats(int delay)
- {
- if (delay > 0)
- {
- // FIXME: actually do something here
- HeartbeatDiagnostics.init(delay, HeartbeatConfig.CONFIG.getTimeout(delay));
- }
- }
-
- @Override
- public void methodFrameReceived(final int channel, final AMQMethodBody amqMethodBody) throws AMQException
- {
- // FIXME?
- _protocolHandler.methodBodyReceived(channel, amqMethodBody, null);
- }
-
- @Override
- public void writeFrame(AMQDataBlock frame, boolean wait)
- {
- _ioSender.send(frame.toNioByteBuffer());
- if (wait)
- {
- _ioSender.flush();
- }
- }
-
- @Override
- public void setSender(Sender<java.nio.ByteBuffer> sender)
- {
- _ioSender = sender;
- }
-
- @Override
- public ConnectionTuneParameters getConnectionTuneParameters()
- {
- return _connectionTuneParameters;
- }
-
- @Override
- public void setConnectionTuneParameters(ConnectionTuneParameters params)
- {
- _connectionTuneParameters = params;
- AMQConnection con = getAMQConnection();
- con.setMaximumChannelCount(params.getChannelMax());
- con.setMaximumFrameSize(params.getFrameMax());
- initHeartbeats((int) params.getHeartbeat());
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java
deleted file mode 100644
index 2389c9e2da..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java
+++ /dev/null
@@ -1,856 +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.
- *
- */
-package org.apache.qpid.client.protocol;
-
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.filter.ReadThrottleFilterBuilder;
-import org.apache.mina.filter.SSLFilter;
-import org.apache.mina.filter.WriteBufferLimitFilterBuilder;
-import org.apache.mina.filter.codec.ProtocolCodecException;
-import org.apache.mina.filter.codec.ProtocolCodecFilter;
-import org.apache.mina.filter.executor.ExecutorFilter;
-import org.apache.qpid.AMQConnectionClosedException;
-import org.apache.qpid.AMQDisconnectedException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQTimeoutException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.SSLConfiguration;
-import org.apache.qpid.client.configuration.ClientProperties;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.failover.FailoverHandler;
-import org.apache.qpid.client.failover.FailoverState;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.StateWaiter;
-import org.apache.qpid.client.state.listener.SpecificMethodFrameListener;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.pool.ReadWriteThreadModel;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.protocol.AMQMethodListener;
-import org.apache.qpid.ssl.SSLContextFactory;
-import org.apache.qpid.transport.network.io.IoTransport;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * AMQProtocolHandler is the client side protocol handler for AMQP, it handles all protocol events received from the
- * network by MINA. The primary purpose of AMQProtocolHandler is to translate the generic event model of MINA into the
- * specific event model of AMQP, by revealing the type of the received events (from decoded data), and passing the
- * event on to more specific handlers for the type. In this sense, it channels the richer event model of AMQP,
- * expressed in terms of methods and so on, through the cruder, general purpose event model of MINA, expressed in
- * terms of "message received" and so on.
- *
- * <p/>There is a 1:1 mapping between an AMQProtocolHandler and an {@link AMQConnection}. The connection class is
- * exposed to the end user of the AMQP client API, and also implements the JMS Connection API, so provides the public
- * API calls through which an individual connection can be manipulated. This protocol handler talks to the network
- * through MINA, in a behind the scenes role; it is not an exposed part of the client API.
- *
- * <p/>There is a 1:many mapping between an AMQProtocolHandler and a set of {@link AMQSession}s. At the MINA level,
- * there is one session per connection. At the AMQP level there can be many channels which are also called sessions in
- * JMS parlance. The {@link AMQSession}s are managed through an {@link AMQProtocolSession} instance. The protocol
- * session is similar to the MINA per-connection session, except that it can span the lifecycle of multiple MINA sessions
- * in the event of failover. See below for more information about this.
- *
- * <p/>Mina provides a session container that can be used to store/retrieve arbitrary objects as String named
- * attributes. A more convenient, type-safe, container for session data is provided in the form of
- * {@link AMQProtocolSession}.
- *
- * <p/>A common way to use MINA is to have a single instance of the event handler, and for MINA to pass in its session
- * object with every event, and for per-connection data to be held in the MINA session (perhaps using a type-safe wrapper
- * as described above). This event handler is different, because dealing with failover complicates things. To the
- * end client of an AMQConnection, a failed over connection is still handled through the same connection instance, but
- * behind the scenes a new transport connection, and MINA session will have been created. The MINA session object cannot
- * be used to track the state of the fail-over process, because it is destroyed and a new one is created, as the old
- * connection is shutdown and a new one created. For this reason, an AMQProtocolHandler is created per AMQConnection
- * and the protocol session data is held outside of the MINA IOSession.
- *
- * <p/>This handler is responsibile for setting up the filter chain to filter all events for this handler through.
- * The filter chain is set up as a stack of event handers that perform the following functions (working upwards from
- * the network traffic at the bottom), handing off incoming events to an asynchronous thread pool to do the work,
- * optionally handling secure sockets encoding/decoding, encoding/decoding the AMQP format itself.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create the filter chain to filter this handlers events.
- * <td> {@link ProtocolCodecFilter}, {@link SSLContextFactory}, {@link SSLFilter}, {@link ReadWriteThreadModel}.
- *
- * <tr><td> Maintain fail-over state.
- * <tr><td>
- * </table>
- *
- * @todo Explain the system property: amqj.shared_read_write_pool. How does putting the protocol codec filter before the
- * async write filter make it a shared pool? The pooling filter uses the same thread pool for reading and writing
- * anyway, see {@link org.apache.qpid.pool.PoolingFilter}, docs for comments. Will putting the protocol codec
- * filter before it mean not doing the read/write asynchronously but in the main filter thread?
- * @todo Use a single handler instance, by shifting everything to do with the 'protocol session' state, including
- * failover state, into AMQProtocolSession, and tracking that from AMQConnection? The lifecycles of
- * AMQProtocolSesssion and AMQConnection will be the same, so if there is high cohesion between them, they could
- * be merged, although there is sense in keeping the session model seperate. Will clarify things by having data
- * held per protocol handler, per protocol session, per network connection, per channel, in seperate classes, so
- * that lifecycles of the fields match lifecycles of their containing objects.
- */
-public class AMQProtocolHandler extends IoHandlerAdapter
-{
- /** Used for debugging. */
- private static final Logger _logger = LoggerFactory.getLogger(AMQProtocolHandler.class);
- private static final Logger _protocolLogger = LoggerFactory.getLogger("qpid.protocol");
- private static final boolean PROTOCOL_DEBUG = (System.getProperty("amqj.protocol.logging.level") != null);
-
- /**
- * The connection that this protocol handler is associated with. There is a 1-1 mapping between connection
- * instances and protocol handler instances.
- */
- private AMQConnection _connection;
-
- /** Our wrapper for a protocol session that provides access to session values in a typesafe manner. */
- private volatile AMQProtocolSession _protocolSession;
-
- /** Holds the state of the protocol session. */
- private AMQStateManager _stateManager = new AMQStateManager();
-
- /** Holds the method listeners, */
- private final CopyOnWriteArraySet<AMQMethodListener> _frameListeners = new CopyOnWriteArraySet<AMQMethodListener>();
-
- /**
- * We create the failover handler when the session is created since it needs a reference to the IoSession in order
- * to be able to send errors during failover back to the client application. The session won't be available in the
- * case where we failing over due to a Connection.Redirect message from the broker.
- */
- private FailoverHandler _failoverHandler;
-
- /**
- * This flag is used to track whether failover is being attempted. It is used to prevent the application constantly
- * attempting failover where it is failing.
- */
- private FailoverState _failoverState = FailoverState.NOT_STARTED;
-
- /** Used to provide a condition to wait upon for operations that are required to wait for failover to complete. */
- private CountDownLatch _failoverLatch;
-
- /** The last failover exception that occured */
- private FailoverException _lastFailoverException;
-
- /** Defines the default timeout to use for synchronous protocol commands. */
- private final long DEFAULT_SYNC_TIMEOUT = Long.getLong("amqj.default_syncwrite_timeout", 1000 * 30);
-
- /** Object to lock on when changing the latch */
- private Object _failoverLatchChange = new Object();
-
- /**
- * Creates a new protocol handler, associated with the specified client connection instance.
- *
- * @param con The client connection that this is the event handler for.
- */
- public AMQProtocolHandler(AMQConnection con)
- {
- _connection = con;
- }
-
- /**
- * Invoked by MINA when a MINA session for a new connection is created. This method sets up the filter chain on the
- * session, which filters the events handled by this handler. The filter chain consists of, handing off events
- * to an asynchronous thread pool, optionally encoding/decoding ssl, encoding/decoding AMQP.
- *
- * @param session The MINA session.
- *
- * @throws Exception Any underlying exceptions are allowed to fall through to MINA.
- */
- public void sessionCreated(IoSession session) throws Exception
- {
- _logger.debug("Protocol session created for session " + System.identityHashCode(session));
- _failoverHandler = new FailoverHandler(this, session);
-
- final ProtocolCodecFilter pcf = new ProtocolCodecFilter(new AMQCodecFactory(false));
-
- if (Boolean.getBoolean("amqj.shared_read_write_pool"))
- {
- session.getFilterChain().addBefore("AsynchronousWriteFilter", "protocolFilter", pcf);
- }
- else
- {
- session.getFilterChain().addLast("protocolFilter", pcf);
- }
- // we only add the SSL filter where we have an SSL connection
- if (_connection.getSSLConfiguration() != null)
- {
- SSLConfiguration sslConfig = _connection.getSSLConfiguration();
- SSLContextFactory sslFactory =
- new SSLContextFactory(sslConfig.getKeystorePath(), sslConfig.getKeystorePassword(), sslConfig.getCertType());
- SSLFilter sslFilter = new SSLFilter(sslFactory.buildClientContext());
- sslFilter.setUseClientMode(true);
- session.getFilterChain().addBefore("protocolFilter", "ssl", sslFilter);
- }
-
- try
- {
- ReadWriteThreadModel threadModel = ReadWriteThreadModel.getInstance();
- threadModel.getAsynchronousReadFilter().createNewJobForSession(session);
- threadModel.getAsynchronousWriteFilter().createNewJobForSession(session);
- }
- catch (RuntimeException e)
- {
- _logger.error(e.getMessage(), e);
- }
-
- if (Boolean.getBoolean(ClientProperties.PROTECTIO_PROP_NAME))
- {
- try
- {
- //Add IO Protection Filters
- IoFilterChain chain = session.getFilterChain();
-
- session.getFilterChain().addLast("tempExecutorFilterForFilterBuilder", new ExecutorFilter());
-
- ReadThrottleFilterBuilder readfilter = new ReadThrottleFilterBuilder();
- readfilter.setMaximumConnectionBufferSize(Integer.parseInt(System.getProperty(
- ClientProperties.READ_BUFFER_LIMIT_PROP_NAME, ClientProperties.READ_BUFFER_LIMIT_DEFAULT)));
- readfilter.attach(chain);
-
- WriteBufferLimitFilterBuilder writefilter = new WriteBufferLimitFilterBuilder();
- writefilter.setMaximumConnectionBufferSize(Integer.parseInt(System.getProperty(
- ClientProperties.WRITE_BUFFER_LIMIT_PROP_NAME, ClientProperties.WRITE_BUFFER_LIMIT_DEFAULT)));
- writefilter.attach(chain);
- session.getFilterChain().remove("tempExecutorFilterForFilterBuilder");
-
- _logger.info("Using IO Read/Write Filter Protection");
- }
- catch (Exception e)
- {
- _logger.error("Unable to attach IO Read/Write Filter Protection :" + e.getMessage());
- }
- }
- _protocolSession = new AMQProtocolSession(this, session, _connection);
-
- _stateManager.setProtocolSession(_protocolSession);
-
- _protocolSession.init();
- }
-
- /**
- * Called when we want to create a new IoTransport session
- * @param brokerDetail
- */
- public void createIoTransportSession(BrokerDetails brokerDetail)
- {
- _protocolSession = new AMQProtocolSession(this, _connection);
- _stateManager.setProtocolSession(_protocolSession);
- IoTransport.connect_0_9(getProtocolSession(),
- brokerDetail.getHost(),
- brokerDetail.getPort(),
- brokerDetail.useSSL());
- _protocolSession.init();
- }
-
- /**
- * Called when the network connection is closed. This can happen, either because the client explicitly requested
- * that the connection be closed, in which case nothing is done, or because the connection died. In the case
- * where the connection died, an attempt to failover automatically to a new connection may be started. The failover
- * process will be started, provided that it is the clients policy to allow failover, and provided that a failover
- * has not already been started or failed.
- *
- * <p/>It is important to note that when the connection dies this method may be called or {@link #exceptionCaught}
- * may be called first followed by this method. This depends on whether the client was trying to send data at the
- * time of the failure.
- *
- * @param session The MINA session.
- *
- * @todo Clarify: presumably exceptionCaught is called when the client is sending during a connection failure and
- * not otherwise? The above comment doesn't make that clear.
- */
- public void sessionClosed(IoSession session)
- {
- if (_connection.isClosed())
- {
- _logger.debug("Session closed called by client");
- }
- else
- {
- _logger.debug("Session closed called with failover state currently " + _failoverState);
-
- // reconnetablility was introduced here so as not to disturb the client as they have made their intentions
- // known through the policy settings.
-
- if ((_failoverState != FailoverState.IN_PROGRESS) && _connection.failoverAllowed())
- {
- _logger.debug("FAILOVER STARTING");
- if (_failoverState == FailoverState.NOT_STARTED)
- {
- _failoverState = FailoverState.IN_PROGRESS;
- startFailoverThread();
- }
- else
- {
- _logger.debug("Not starting failover as state currently " + _failoverState);
- }
- }
- else
- {
- _logger.debug("Failover not allowed by policy."); // or already in progress?
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug(_connection.getFailoverPolicy().toString());
- }
-
- if (_failoverState != FailoverState.IN_PROGRESS)
- {
- _logger.debug("sessionClose() not allowed to failover");
- _connection.exceptionReceived(new AMQDisconnectedException(
- "Server closed connection and reconnection " + "not permitted.", null));
- }
- else
- {
- _logger.debug("sessionClose() failover in progress");
- }
- }
- }
-
- _logger.debug("Protocol Session [" + this + "] closed");
- }
-
- /** See {@link FailoverHandler} to see rationale for separate thread. */
- private void startFailoverThread()
- {
- Thread failoverThread = new Thread(_failoverHandler);
- failoverThread.setName("Failover");
- // Do not inherit daemon-ness from current thread as this can be a daemon
- // thread such as a AnonymousIoService thread.
- failoverThread.setDaemon(false);
- failoverThread.start();
- }
-
- public void sessionIdle(IoSession session, IdleStatus status) throws Exception
- {
- _logger.debug("Protocol Session [" + this + ":" + session + "] idle: " + status);
- if (IdleStatus.WRITER_IDLE.equals(status))
- {
- // write heartbeat frame:
- _logger.debug("Sent heartbeat");
- session.write(HeartbeatBody.FRAME);
- HeartbeatDiagnostics.sent();
- }
- else if (IdleStatus.READER_IDLE.equals(status))
- {
- // failover:
- HeartbeatDiagnostics.timeout();
- _logger.warn("Timed out while waiting for heartbeat from peer.");
- session.close();
- }
- }
-
- /**
- * Invoked when any exception is thrown by a user IoHandler implementation or by MINA. If the cause is an
- * IOException, MINA will close the connection automatically.
- *
- * @param session The MINA session.
- * @param cause The exception that triggered this event.
- */
- public void exceptionCaught(IoSession session, Throwable cause)
- {
- if (_failoverState == FailoverState.NOT_STARTED)
- {
- // if (!(cause instanceof AMQUndeliveredException) && (!(cause instanceof AMQAuthenticationException)))
- if ((cause instanceof AMQConnectionClosedException) || cause instanceof IOException)
- {
- _logger.info("Exception caught therefore going to attempt failover: " + cause, cause);
- // this will attemp failover
-
- sessionClosed(session);
- }
- else
- {
-
- if (cause instanceof ProtocolCodecException)
- {
- _logger.info("Protocol Exception caught NOT going to attempt failover as " +
- "cause isn't AMQConnectionClosedException: " + cause, cause);
-
- AMQException amqe = new AMQException("Protocol handler error: " + cause, cause);
- propagateExceptionToAllWaiters(amqe);
- }
- _connection.exceptionReceived(cause);
-
- }
-
- // FIXME Need to correctly handle other exceptions. Things like ...
- // if (cause instanceof AMQChannelClosedException)
- // which will cause the JMSSession to end due to a channel close and so that Session needs
- // to be removed from the map so we can correctly still call close without an exception when trying to close
- // the server closed session. See also CloseChannelMethodHandler as the sessionClose is never called on exception
- }
- // we reach this point if failover was attempted and failed therefore we need to let the calling app
- // know since we cannot recover the situation
- else if (_failoverState == FailoverState.FAILED)
- {
- _logger.error("Exception caught by protocol handler: " + cause, cause);
-
- // we notify the state manager of the error in case we have any clients waiting on a state
- // change. Those "waiters" will be interrupted and can handle the exception
- AMQException amqe = new AMQException("Protocol handler error: " + cause, cause);
- propagateExceptionToAllWaiters(amqe);
- _connection.exceptionReceived(cause);
- }
- }
-
- /**
- * There are two cases where we have other threads potentially blocking for events to be handled by this class.
- * These are for the state manager (waiting for a state change) or a frame listener (waiting for a particular type
- * of frame to arrive). When an error occurs we need to notify these waiters so that they can react appropriately.
- *
- * This should be called only when the exception is fatal for the connection.
- *
- * @param e the exception to propagate
- *
- * @see #propagateExceptionToFrameListeners
- * @see #propagateExceptionToStateWaiters
- */
- public void propagateExceptionToAllWaiters(Exception e)
- {
- propagateExceptionToFrameListeners(e);
- propagateExceptionToStateWaiters(e);
- }
-
- /**
- * This caters for the case where we only need to propogate an exception to the the frame listeners to interupt any
- * protocol level waits.
- *
- * This will would normally be used to notify all Frame Listeners that Failover is about to occur and they should
- * stop waiting and relinquish the Failover lock {@see FailoverHandler}.
- *
- * Once the {@link FailoverHandler} has re-established the connection then the listeners will be able to re-attempt
- * their protocol request and so listen again for the correct frame.
- *
- * @param e the exception to propagate
- */
- public void propagateExceptionToFrameListeners(Exception e)
- {
- synchronized (_frameListeners)
- {
- if (!_frameListeners.isEmpty())
- {
- final Iterator it = _frameListeners.iterator();
- while (it.hasNext())
- {
- final AMQMethodListener ml = (AMQMethodListener) it.next();
- ml.error(e);
- }
- }
- }
- }
-
- /**
- * This caters for the case where we only need to propogate an exception to the the state manager to interupt any
- * thing waiting for a state change.
- *
- * Currently (2008-07-15) the state manager is only used during 0-8/0-9 Connection establishement.
- *
- * Normally the state manager would not need to be notified without notifiying the frame listeners so in normal
- * cases {@link #propagateExceptionToAllWaiters} would be the correct choice.
- *
- * @param e the exception to propagate
- */
- public void propagateExceptionToStateWaiters(Exception e)
- {
- getStateManager().error(e);
- }
-
- public void notifyFailoverStarting()
- {
- // Set the last exception in the sync block to ensure the ordering with add.
- // either this gets done and the add does the ml.error
- // or the add completes first and the iterator below will do ml.error
- synchronized (_frameListeners)
- {
- _lastFailoverException = new FailoverException("Failing over about to start");
- }
-
- //Only notify the Frame listeners that failover is going to occur as the State listeners shouldn't be
- // interupted unless failover cannot restore the state.
- propagateExceptionToFrameListeners(_lastFailoverException);
- }
-
- public void failoverInProgress()
- {
- _lastFailoverException = null;
- }
-
- private static int _messageReceivedCount;
-
- public void messageReceived(IoSession session, Object message) throws Exception
- {
- if (PROTOCOL_DEBUG)
- {
- _protocolLogger.info(String.format("RECV: [%s] %s", this, message));
- }
-
- if(message instanceof AMQFrame)
- {
- final boolean debug = _logger.isDebugEnabled();
- final long msgNumber = ++_messageReceivedCount;
-
- if (debug && ((msgNumber % 1000) == 0))
- {
- _logger.debug("Received " + _messageReceivedCount + " protocol messages");
- }
-
- AMQFrame frame = (AMQFrame) message;
-
- final AMQBody bodyFrame = frame.getBodyFrame();
-
- HeartbeatDiagnostics.received(bodyFrame instanceof HeartbeatBody);
-
- bodyFrame.handle(frame.getChannel(), _protocolSession);
-
- _connection.bytesReceived(_protocolSession.getIoSession().getReadBytes());
- }
- else if (message instanceof ProtocolInitiation)
- {
- // We get here if the server sends a response to our initial protocol header
- // suggesting an alternate ProtocolVersion; the server will then close the
- // connection.
- ProtocolInitiation protocolInit = (ProtocolInitiation) message;
- ProtocolVersion pv = protocolInit.checkVersion();
- getConnection().setProtocolVersion(pv);
-
- // get round a bug in old versions of qpid whereby the connection is not closed
- _stateManager.changeState(AMQState.CONNECTION_CLOSED);
- }
- }
-
- public void methodBodyReceived(final int channelId, final AMQBody bodyFrame, IoSession session)//, final IoSession session)
- throws AMQException
- {
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("(" + System.identityHashCode(this) + ")Method frame received: " + bodyFrame);
- }
-
- final AMQMethodEvent<AMQMethodBody> evt =
- new AMQMethodEvent<AMQMethodBody>(channelId, (AMQMethodBody) bodyFrame);
-
- try
- {
-
- boolean wasAnyoneInterested = getStateManager().methodReceived(evt);
- synchronized (_frameListeners)
- {
- if (!_frameListeners.isEmpty())
- {
- //This iterator is safe from the error state as the frame listeners always add before they send so their
- // will be ready and waiting for this response.
- Iterator it = _frameListeners.iterator();
- while (it.hasNext())
- {
- final AMQMethodListener listener = (AMQMethodListener) it.next();
- wasAnyoneInterested = listener.methodReceived(evt) || wasAnyoneInterested;
- }
- }
- }
- if (!wasAnyoneInterested)
- {
- throw new AMQException(null, "AMQMethodEvent " + evt + " was not processed by any listener. Listeners:"
- + _frameListeners, null);
- }
- }
- catch (AMQException e)
- {
- propagateExceptionToFrameListeners(e);
-
- exceptionCaught(session, e);
- }
-
- }
-
- private static int _messagesOut;
-
- public void messageSent(IoSession session, Object message) throws Exception
- {
- if (PROTOCOL_DEBUG)
- {
- _protocolLogger.debug(String.format("SEND: [%s] %s", this, message));
- }
-
- final long sentMessages = _messagesOut++;
-
- final boolean debug = _logger.isDebugEnabled();
-
- if (debug && ((sentMessages % 1000) == 0))
- {
- _logger.debug("Sent " + _messagesOut + " protocol messages");
- }
-
- _connection.bytesSent(session.getWrittenBytes());
- }
-
- public StateWaiter createWaiter(Set<AMQState> states) throws AMQException
- {
- return getStateManager().createWaiter(states);
- }
-
- /**
- * Convenience method that writes a frame to the protocol session. Equivalent to calling
- * getProtocolSession().write().
- *
- * @param frame the frame to write
- */
- public void writeFrame(AMQDataBlock frame)
- {
- _protocolSession.writeFrame(frame);
- }
-
- public void writeFrame(AMQDataBlock frame, boolean wait)
- {
- _protocolSession.writeFrame(frame, wait);
- }
-
- /**
- * Convenience method that writes a frame to the protocol session and waits for a particular response. Equivalent to
- * calling getProtocolSession().write() then waiting for the response.
- *
- * @param frame
- * @param listener the blocking listener. Note the calling thread will block.
- */
- public AMQMethodEvent writeCommandFrameAndWaitForReply(AMQFrame frame, BlockingMethodFrameListener listener)
- throws AMQException, FailoverException
- {
- return writeCommandFrameAndWaitForReply(frame, listener, DEFAULT_SYNC_TIMEOUT);
- }
-
- /**
- * Convenience method that writes a frame to the protocol session and waits for a particular response. Equivalent to
- * calling getProtocolSession().write() then waiting for the response.
- *
- * @param frame
- * @param listener the blocking listener. Note the calling thread will block.
- */
- public AMQMethodEvent writeCommandFrameAndWaitForReply(AMQFrame frame, BlockingMethodFrameListener listener,
- long timeout) throws AMQException, FailoverException
- {
- try
- {
- synchronized (_frameListeners)
- {
- if (_lastFailoverException != null)
- {
- throw _lastFailoverException;
- }
-
- if(_stateManager.getCurrentState() == AMQState.CONNECTION_CLOSED)
- {
- Exception e = _stateManager.getLastException();
- if (e != null)
- {
- if (e instanceof AMQException)
- {
- AMQException amqe = (AMQException) e;
-
- throw amqe.cloneForCurrentThread();
- }
- else
- {
- throw new AMQException(AMQConstant.INTERNAL_ERROR, e.getMessage(), e);
- }
- }
- }
-
- _frameListeners.add(listener);
- //FIXME: At this point here we should check or before add we should check _stateManager is in an open
- // state so as we don't check we are likely just to time out here as I believe is being seen in QPID-1255
- }
- _protocolSession.writeFrame(frame);
-
- return listener.blockForFrame(timeout);
- // When control resumes before this line, a reply will have been received
- // that matches the criteria defined in the blocking listener
- }
- finally
- {
- // If we don't removeKey the listener then no-one will
- _frameListeners.remove(listener);
- }
-
- }
-
- /** More convenient method to write a frame and wait for it's response. */
- public AMQMethodEvent syncWrite(AMQFrame frame, Class responseClass) throws AMQException, FailoverException
- {
- return syncWrite(frame, responseClass, DEFAULT_SYNC_TIMEOUT);
- }
-
- /** More convenient method to write a frame and wait for it's response. */
- public AMQMethodEvent syncWrite(AMQFrame frame, Class responseClass, long timeout) throws AMQException, FailoverException
- {
- return writeCommandFrameAndWaitForReply(frame, new SpecificMethodFrameListener(frame.getChannel(), responseClass),
- timeout);
- }
-
- public void closeSession(AMQSession session) throws AMQException
- {
- _protocolSession.closeSession(session);
- }
-
- /**
- * Closes the connection.
- *
- * <p/>If a failover exception occurs whilst closing the connection it is ignored, as the connection is closed
- * anyway.
- *
- * @param timeout The timeout to wait for an acknowledgement to the close request.
- *
- * @throws AMQException If the close fails for any reason.
- */
- public void closeConnection(long timeout) throws AMQException
- {
- getStateManager().changeState(AMQState.CONNECTION_CLOSING);
-
- ConnectionCloseBody body = _protocolSession.getMethodRegistry().createConnectionCloseBody(AMQConstant.REPLY_SUCCESS.getCode(), // replyCode
- new AMQShortString("JMS client is closing the connection."), 0, 0);
-
- final AMQFrame frame = body.generateFrame(0);
-
- try
- {
- syncWrite(frame, ConnectionCloseOkBody.class, timeout);
- _protocolSession.closeProtocolSession();
- }
- catch (AMQTimeoutException e)
- {
- _protocolSession.closeProtocolSession(false);
- }
- catch (FailoverException e)
- {
- _logger.debug("FailoverException interrupted connection close, ignoring as connection close anyway.");
- }
- }
-
- /** @return the number of bytes read from this protocol session */
- public long getReadBytes()
- {
- return _protocolSession.getIoSession().getReadBytes();
- }
-
- /** @return the number of bytes written to this protocol session */
- public long getWrittenBytes()
- {
- return _protocolSession.getIoSession().getWrittenBytes();
- }
-
- public void failover(String host, int port)
- {
- _failoverHandler.setHost(host);
- _failoverHandler.setPort(port);
- // see javadoc for FailoverHandler to see rationale for separate thread
- startFailoverThread();
- }
-
- public void blockUntilNotFailingOver() throws InterruptedException
- {
- synchronized(_failoverLatchChange)
- {
- if (_failoverLatch != null)
- {
- _failoverLatch.await();
- }
- }
- }
-
- public AMQShortString generateQueueName()
- {
- return _protocolSession.generateQueueName();
- }
-
- public CountDownLatch getFailoverLatch()
- {
- return _failoverLatch;
- }
-
- public void setFailoverLatch(CountDownLatch failoverLatch)
- {
- synchronized (_failoverLatchChange)
- {
- _failoverLatch = failoverLatch;
- }
- }
-
- public AMQConnection getConnection()
- {
- return _connection;
- }
-
- public AMQStateManager getStateManager()
- {
- return _stateManager;
- }
-
- public void setStateManager(AMQStateManager stateManager)
- {
- _stateManager = stateManager;
- }
-
- public AMQProtocolSession getProtocolSession()
- {
- return _protocolSession;
- }
-
- FailoverState getFailoverState()
- {
- return _failoverState;
- }
-
- public void setFailoverState(FailoverState failoverState)
- {
- _failoverState = failoverState;
- }
-
- public byte getProtocolMajorVersion()
- {
- return _protocolSession.getProtocolMajorVersion();
- }
-
- public byte getProtocolMinorVersion()
- {
- return _protocolSession.getProtocolMinorVersion();
- }
-
- public MethodRegistry getMethodRegistry()
- {
- return _protocolSession.getMethodRegistry();
- }
-
- public ProtocolVersion getProtocolVersion()
- {
- return _protocolSession.getProtocolVersion();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
deleted file mode 100644
index 5e12a5e6f8..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
+++ /dev/null
@@ -1,545 +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.
- *
- */
-package org.apache.qpid.client.protocol;
-
-import org.apache.commons.lang.StringUtils;
-import org.apache.mina.common.CloseFuture;
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.WriteFuture;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-import javax.security.sasl.SaslClient;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.ConnectionTuneParameters;
-import org.apache.qpid.client.message.UnprocessedMessage;
-import org.apache.qpid.client.message.UnprocessedMessage_0_8;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-import org.apache.qpid.transport.Sender;
-import org.apache.qpid.client.handler.ClientMethodDispatcherImpl;
-
-/**
- * Wrapper for protocol session that provides type-safe access to session attributes. <p/> The underlying protocol
- * session is still available but clients should not use it to obtain session attributes.
- */
-public class AMQProtocolSession implements AMQVersionAwareProtocolSession
-{
- protected static final int LAST_WRITE_FUTURE_JOIN_TIMEOUT = 1000 * 60 * 2;
-
- protected static final Logger _logger = LoggerFactory.getLogger(AMQProtocolSession.class);
-
- public static final String PROTOCOL_INITIATION_RECEIVED = "ProtocolInitiatiionReceived";
-
- protected static final String CONNECTION_TUNE_PARAMETERS = "ConnectionTuneParameters";
-
- protected static final String AMQ_CONNECTION = "AMQConnection";
-
- protected static final String SASL_CLIENT = "SASLClient";
-
- protected final IoSession _minaProtocolSession;
-
- protected WriteFuture _lastWriteFuture;
-
- /**
- * The handler from which this session was created and which is used to handle protocol events. We send failover
- * events to the handler.
- */
- protected final AMQProtocolHandler _protocolHandler;
-
- /** Maps from the channel id to the AMQSession that it represents. */
- protected ConcurrentMap<Integer, AMQSession> _channelId2SessionMap = new ConcurrentHashMap<Integer, AMQSession>();
-
- protected ConcurrentMap _closingChannels = new ConcurrentHashMap();
-
- /**
- * Maps from a channel id to an unprocessed message. This is used to tie together the JmsDeliverBody (which arrives
- * first) with the subsequent content header and content bodies.
- */
- private final ConcurrentMap<Integer, UnprocessedMessage> _channelId2UnprocessedMsgMap = new ConcurrentHashMap<Integer, UnprocessedMessage>();
- private final UnprocessedMessage[] _channelId2UnprocessedMsgArray = new UnprocessedMessage[16];
-
- /** Counter to ensure unique queue names */
- protected int _queueId = 1;
- protected final Object _queueIdLock = new Object();
-
- private ProtocolVersion _protocolVersion;
-// private VersionSpecificRegistry _registry =
-// MainRegistry.getVersionSpecificRegistry(ProtocolVersion.getLatestSupportedVersion());
-
- private MethodRegistry _methodRegistry =
- MethodRegistry.getMethodRegistry(ProtocolVersion.getLatestSupportedVersion());
-
- private MethodDispatcher _methodDispatcher;
-
- protected final AMQConnection _connection;
-
- private static final int FAST_CHANNEL_ACCESS_MASK = 0xFFFFFFF0;
-
- public AMQProtocolSession(AMQProtocolHandler protocolHandler, IoSession protocolSession, AMQConnection connection)
- {
- _protocolHandler = protocolHandler;
- _minaProtocolSession = protocolSession;
- _minaProtocolSession.setAttachment(this);
- // properties of the connection are made available to the event handlers
- _minaProtocolSession.setAttribute(AMQ_CONNECTION, connection);
- // fixme - real value needed
- _minaProtocolSession.setWriteTimeout(LAST_WRITE_FUTURE_JOIN_TIMEOUT);
- _protocolVersion = connection.getProtocolVersion();
- _methodDispatcher = ClientMethodDispatcherImpl.newMethodDispatcher(ProtocolVersion.getLatestSupportedVersion(),
- this);
- _connection = connection;
-
- }
-
- public AMQProtocolSession(AMQProtocolHandler protocolHandler, AMQConnection connection)
- {
- _protocolHandler = protocolHandler;
- _minaProtocolSession = null;
- _protocolVersion = connection.getProtocolVersion();
- _methodDispatcher = ClientMethodDispatcherImpl.newMethodDispatcher(ProtocolVersion.getLatestSupportedVersion(),
- this);
- _connection = connection;
- }
-
- public void init()
- {
- // start the process of setting up the connection. This is the first place that
- // data is written to the server.
- _minaProtocolSession.write(new ProtocolInitiation(_connection.getProtocolVersion()));
- }
-
- public String getClientID()
- {
- try
- {
- return getAMQConnection().getClientID();
- }
- catch (JMSException e)
- {
- // we never throw a JMSException here
- return null;
- }
- }
-
- public void setClientID(String clientID) throws JMSException
- {
- getAMQConnection().setClientID(clientID);
- }
-
- public AMQStateManager getStateManager()
- {
- return _protocolHandler.getStateManager();
- }
-
- public String getVirtualHost()
- {
- return getAMQConnection().getVirtualHost();
- }
-
- public String getUsername()
- {
- return getAMQConnection().getUsername();
- }
-
- public String getPassword()
- {
- return getAMQConnection().getPassword();
- }
-
- public IoSession getIoSession()
- {
- return _minaProtocolSession;
- }
-
- public SaslClient getSaslClient()
- {
- return (SaslClient) _minaProtocolSession.getAttribute(SASL_CLIENT);
- }
-
- /**
- * Store the SASL client currently being used for the authentication handshake
- *
- * @param client if non-null, stores this in the session. if null clears any existing client being stored
- */
- public void setSaslClient(SaslClient client)
- {
- if (client == null)
- {
- _minaProtocolSession.removeAttribute(SASL_CLIENT);
- }
- else
- {
- _minaProtocolSession.setAttribute(SASL_CLIENT, client);
- }
- }
-
- public ConnectionTuneParameters getConnectionTuneParameters()
- {
- return (ConnectionTuneParameters) _minaProtocolSession.getAttribute(CONNECTION_TUNE_PARAMETERS);
- }
-
- public void setConnectionTuneParameters(ConnectionTuneParameters params)
- {
- _minaProtocolSession.setAttribute(CONNECTION_TUNE_PARAMETERS, params);
- AMQConnection con = getAMQConnection();
- con.setMaximumChannelCount(params.getChannelMax());
- con.setMaximumFrameSize(params.getFrameMax());
- initHeartbeats((int) params.getHeartbeat());
- }
-
- /**
- * Callback invoked from the BasicDeliverMethodHandler when a message has been received. This is invoked on the MINA
- * dispatcher thread.
- *
- * @param message
- *
- * @throws AMQException if this was not expected
- */
- public void unprocessedMessageReceived(final int channelId, UnprocessedMessage message) throws AMQException
- {
- if ((channelId & FAST_CHANNEL_ACCESS_MASK) == 0)
- {
- _channelId2UnprocessedMsgArray[channelId] = message;
- }
- else
- {
- _channelId2UnprocessedMsgMap.put(channelId, message);
- }
- }
-
- public void contentHeaderReceived(int channelId, ContentHeaderBody contentHeader) throws AMQException
- {
- final UnprocessedMessage_0_8 msg = (UnprocessedMessage_0_8) ((channelId & FAST_CHANNEL_ACCESS_MASK) == 0 ? _channelId2UnprocessedMsgArray[channelId]
- : _channelId2UnprocessedMsgMap.get(channelId));
-
- if (msg == null)
- {
- throw new AMQException(null, "Error: received content header without having received a BasicDeliver frame first on session:" + this, null);
- }
-
- if (msg.getContentHeader() != null)
- {
- throw new AMQException(null, "Error: received duplicate content header or did not receive correct number of content body frames on session:" + this, null);
- }
-
- msg.setContentHeader(contentHeader);
- if (contentHeader.bodySize == 0)
- {
- deliverMessageToAMQSession(channelId, msg);
- }
- }
-
- public void contentBodyReceived(final int channelId, ContentBody contentBody) throws AMQException
- {
- UnprocessedMessage_0_8 msg;
- final boolean fastAccess = (channelId & FAST_CHANNEL_ACCESS_MASK) == 0;
- if (fastAccess)
- {
- msg = (UnprocessedMessage_0_8) _channelId2UnprocessedMsgArray[channelId];
- }
- else
- {
- msg = (UnprocessedMessage_0_8) _channelId2UnprocessedMsgMap.get(channelId);
- }
-
- if (msg == null)
- {
- throw new AMQException(null, "Error: received content body without having received a JMSDeliver frame first", null);
- }
-
- if (msg.getContentHeader() == null)
- {
- if (fastAccess)
- {
- _channelId2UnprocessedMsgArray[channelId] = null;
- }
- else
- {
- _channelId2UnprocessedMsgMap.remove(channelId);
- }
- throw new AMQException(null, "Error: received content body without having received a ContentHeader frame first", null);
- }
-
- msg.receiveBody(contentBody);
-
- if (msg.isAllBodyDataReceived())
- {
- deliverMessageToAMQSession(channelId, msg);
- }
- }
-
- public void heartbeatBodyReceived(int channelId, HeartbeatBody body) throws AMQException
- {
-
- }
-
- /**
- * Deliver a message to the appropriate session, removing the unprocessed message from our map
- *
- * @param channelId the channel id the message should be delivered to
- * @param msg the message
- */
- private void deliverMessageToAMQSession(int channelId, UnprocessedMessage msg)
- {
- AMQSession session = getSession(channelId);
- session.messageReceived(msg);
- if ((channelId & FAST_CHANNEL_ACCESS_MASK) == 0)
- {
- _channelId2UnprocessedMsgArray[channelId] = null;
- }
- else
- {
- _channelId2UnprocessedMsgMap.remove(channelId);
- }
- }
-
- protected AMQSession getSession(int channelId)
- {
- return _connection.getSession(channelId);
- }
-
- /**
- * Convenience method that writes a frame to the protocol session. Equivalent to calling
- * getProtocolSession().write().
- *
- * @param frame the frame to write
- */
- public void writeFrame(AMQDataBlock frame)
- {
- writeFrame(frame, false);
- }
-
- public void writeFrame(AMQDataBlock frame, boolean wait)
- {
- WriteFuture f = _minaProtocolSession.write(frame);
- if (wait)
- {
- // fixme -- time out?
- f.join();
- }
- else
- {
- _lastWriteFuture = f;
- }
- }
-
- /**
- * Starts the process of closing a session
- *
- * @param session the AMQSession being closed
- */
- public void closeSession(AMQSession session)
- {
- _logger.debug("closeSession called on protocol session for session " + session.getChannelId());
- final int channelId = session.getChannelId();
- if (channelId <= 0)
- {
- throw new IllegalArgumentException("Attempt to close a channel with id < 0");
- }
- // we need to know when a channel is closing so that we can respond
- // with a channel.close frame when we receive any other type of frame
- // on that channel
- _closingChannels.putIfAbsent(channelId, session);
- }
-
- /**
- * Called from the ChannelClose handler when a channel close frame is received. This method decides whether this is
- * a response or an initiation. The latter case causes the AMQSession to be closed and an exception to be thrown if
- * appropriate.
- *
- * @param channelId the id of the channel (session)
- *
- * @return true if the client must respond to the server, i.e. if the server initiated the channel close, false if
- * the channel close is just the server responding to the client's earlier request to close the channel.
- */
- public boolean channelClosed(int channelId, AMQConstant code, String text) throws AMQException
- {
-
- // if this is not a response to an earlier request to close the channel
- if (_closingChannels.remove(channelId) == null)
- {
- final AMQSession session = getSession(channelId);
- try
- {
- session.closed(new AMQException(code, text, null));
- }
- catch (JMSException e)
- {
- throw new AMQException(null, "JMSException received while closing session", e);
- }
-
- return true;
- }
- else
- {
- return false;
- }
- }
-
- public AMQConnection getAMQConnection()
- {
- return (AMQConnection) _minaProtocolSession.getAttribute(AMQ_CONNECTION);
- }
-
- public void closeProtocolSession() throws AMQException
- {
- closeProtocolSession(true);
- }
-
- public void closeProtocolSession(boolean waitLast) throws AMQException
- {
- _logger.debug("Waiting for last write to join.");
- if (waitLast && (_lastWriteFuture != null))
- {
- _lastWriteFuture.join(LAST_WRITE_FUTURE_JOIN_TIMEOUT);
- }
-
- _logger.debug("Closing protocol session");
-
- final CloseFuture future = _minaProtocolSession.close();
-
- // There is no recovery we can do if the join on the close failes so simply mark the connection CLOSED
- // then wait for the connection to close.
- // ritchiem: Could this release BlockingWaiters to early? The close has been done as much as possible so any
- // error now shouldn't matter.
-
- _protocolHandler.getStateManager().changeState(AMQState.CONNECTION_CLOSED);
- future.join(LAST_WRITE_FUTURE_JOIN_TIMEOUT);
- }
-
- public void failover(String host, int port)
- {
- _protocolHandler.failover(host, port);
- }
-
- protected AMQShortString generateQueueName()
- {
- int id;
- synchronized (_queueIdLock)
- {
- id = _queueId++;
- }
- // get rid of / and : and ; from address for spec conformance
- String localAddress = StringUtils.replaceChars(_minaProtocolSession.getLocalAddress().toString(), "/;:", "");
-
- return new AMQShortString("tmp_" + localAddress + "_" + id);
- }
-
- /** @param delay delay in seconds (not ms) */
- void initHeartbeats(int delay)
- {
- if (delay > 0)
- {
- _minaProtocolSession.setIdleTime(IdleStatus.WRITER_IDLE, delay);
- _minaProtocolSession.setIdleTime(IdleStatus.READER_IDLE, HeartbeatConfig.CONFIG.getTimeout(delay));
- HeartbeatDiagnostics.init(delay, HeartbeatConfig.CONFIG.getTimeout(delay));
- }
- }
-
- public void confirmConsumerCancelled(int channelId, AMQShortString consumerTag)
- {
- final AMQSession session = getSession(channelId);
-
- session.confirmConsumerCancelled(consumerTag.toIntValue());
- }
-
- public void setProtocolVersion(final ProtocolVersion pv)
- {
- _protocolVersion = pv;
- _methodRegistry = MethodRegistry.getMethodRegistry(pv);
- _methodDispatcher = ClientMethodDispatcherImpl.newMethodDispatcher(pv, this);
-
- // _registry = MainRegistry.getVersionSpecificRegistry(versionMajor, versionMinor);
- }
-
- public byte getProtocolMinorVersion()
- {
- return _protocolVersion.getMinorVersion();
- }
-
- public byte getProtocolMajorVersion()
- {
- return _protocolVersion.getMajorVersion();
- }
-
- public ProtocolVersion getProtocolVersion()
- {
- return _protocolVersion;
- }
-
-// public VersionSpecificRegistry getRegistry()
-// {
-// return _registry;
-// }
-
- public MethodRegistry getMethodRegistry()
- {
- return _methodRegistry;
- }
-
- public MethodDispatcher getMethodDispatcher()
- {
- return _methodDispatcher;
- }
-
- public void setTicket(int ticket, int channelId)
- {
- final AMQSession session = getSession(channelId);
- session.setTicket(ticket);
- }
-
- public void setMethodDispatcher(MethodDispatcher methodDispatcher)
- {
- _methodDispatcher = methodDispatcher;
- }
-
- public void setFlowControl(final int channelId, final boolean active)
- {
- final AMQSession session = getSession(channelId);
- session.setFlowControl(active);
- }
-
- public void methodFrameReceived(final int channel, final AMQMethodBody amqMethodBody) throws AMQException
- {
- _protocolHandler.methodBodyReceived(channel, amqMethodBody, _minaProtocolSession);
- }
-
- public void notifyError(Exception error)
- {
- _protocolHandler.propagateExceptionToAllWaiters(error);
- }
-
- public void setSender(Sender<java.nio.ByteBuffer> sender)
- {
- // No-op, interface munging
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java
deleted file mode 100644
index 2bc609ebf2..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java
+++ /dev/null
@@ -1,136 +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.
- *
- */
-package org.apache.qpid.client.protocol;
-
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQTimeoutException;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.util.BlockingWaiter;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.protocol.AMQMethodListener;
-
-/**
- * BlockingMethodFrameListener is a 'rendezvous' which acts as a {@link AMQMethodListener} that delegates handling of
- * incoming methods to a method listener implemented as a sub-class of this and hands off the processed method or
- * error to a consumer. The producer of the event does not have to wait for the consumer to take the event, so this
- * differs from a 'rendezvous' in that sense.
- *
- * <p/>BlockingMethodFrameListeners are used to coordinate waiting for replies to method calls that expect a response.
- * They are always used in a 'one-shot' manner, that is, to recieve just one response. Usually the caller has to register
- * them as method listeners with an event dispatcher and remember to de-register them (in a finally block) once they
- * have been completed.
- *
- * <p/>The {@link #processMethod} must return <tt>true</tt> on any incoming method that it handles. This indicates to
- * this listeners that the method it is waiting for has arrived. Incoming methods are also filtered by channel prior to
- * being passed to the {@link #processMethod} method, so responses are only received for a particular channel. The
- * channel id must be passed to the constructor.
- *
- * <p/>Errors from the producer are rethrown to the consumer.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Accept notification of AMQP method events. <td> {@link AMQMethodEvent}
- * <tr><td> Delegate handling of the method to another method listener. <td> {@link AMQMethodBody}
- * <tr><td> Block until a method is handled by the delegated to handler.
- * <tr><td> Propagate the most recent exception to the consumer.
- * </table>
- *
- * @todo Might be neater if this method listener simply wrapped another that provided the method handling using a
- * methodRecevied method. The processMethod takes an additional channelId, however none of the implementations
- * seem to use it. So wrapping the listeners is possible.
- * @todo If the retrotranslator can handle it, could use a SynchronousQueue to implement this rendezvous. Need to
- * check that SynchronousQueue has a non-blocking put method available.
- */
-public abstract class BlockingMethodFrameListener extends BlockingWaiter<AMQMethodEvent> implements AMQMethodListener
-{
-
- /** Holds the channel id for the channel upon which this listener is waiting for a response. */
- protected int _channelId;
-
- /**
- * Creates a new method listener, that filters incoming method to just those that match the specified channel id.
- *
- * @param channelId The channel id to filter incoming methods with.
- */
- public BlockingMethodFrameListener(int channelId)
- {
- _channelId = channelId;
- }
-
- /**
- * Delegates any additional handling of the incoming methods to another handler.
- *
- * @param channelId The channel id of the incoming method.
- * @param frame The method body.
- *
- * @return <tt>true</tt> if the method was handled, <tt>false</tt> otherwise.
- */
- public abstract boolean processMethod(int channelId, AMQMethodBody frame);
-
- public boolean process(AMQMethodEvent evt)
- {
- AMQMethodBody method = evt.getMethod();
-
- return (evt.getChannelId() == _channelId) && processMethod(evt.getChannelId(), method);
- }
-
- /**
- * Informs this listener that an AMQP method has been received.
- *
- * @param evt The AMQP method.
- *
- * @return <tt>true</tt> if this listener has handled the method, <tt>false</tt> otherwise.
- */
- public boolean methodReceived(AMQMethodEvent evt)
- {
- return received(evt);
- }
-
- /**
- * Blocks until a method is received that is handled by the delegated to method listener, or the specified timeout
- * has passed.
- *
- * @param timeout The timeout in milliseconds.
- *
- * @return The AMQP method that was received.
- *
- * @throws AMQException
- * @throws FailoverException
- */
- public AMQMethodEvent blockForFrame(long timeout) throws AMQException, FailoverException
- {
- try
- {
- return (AMQMethodEvent) block(timeout);
- }
- finally
- {
- //Prevent any more errors being notified to this waiter.
- close();
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatConfig.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatConfig.java
deleted file mode 100644
index 35ea44a331..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatConfig.java
+++ /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.
- *
- */
-package org.apache.qpid.client.protocol;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-class HeartbeatConfig
-{
- private static final Logger _logger = LoggerFactory.getLogger(HeartbeatConfig.class);
- static final HeartbeatConfig CONFIG = new HeartbeatConfig();
-
- /**
- * The factor used to get the timeout from the delay between heartbeats.
- */
- private float timeoutFactor = 2;
-
- HeartbeatConfig()
- {
- String property = System.getProperty("amqj.heartbeat.timeoutFactor");
- if (property != null)
- {
- try
- {
- timeoutFactor = Float.parseFloat(property);
- }
- catch (NumberFormatException e)
- {
- _logger.warn("Invalid timeout factor (amqj.heartbeat.timeoutFactor): " + property);
- }
- }
- }
-
- float getTimeoutFactor()
- {
- return timeoutFactor;
- }
-
- int getTimeout(int writeDelay)
- {
- return (int) (timeoutFactor * writeDelay);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatDiagnostics.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatDiagnostics.java
deleted file mode 100644
index d44faeab04..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatDiagnostics.java
+++ /dev/null
@@ -1,121 +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.
- *
- */
-package org.apache.qpid.client.protocol;
-
-class HeartbeatDiagnostics
-{
- private static final Diagnostics _impl = init();
-
- private static Diagnostics init()
- {
- return Boolean.getBoolean("amqj.heartbeat.diagnostics") ? new On() : new Off();
- }
-
- static void sent()
- {
- _impl.sent();
- }
-
- static void timeout()
- {
- _impl.timeout();
- }
-
- static void received(boolean heartbeat)
- {
- _impl.received(heartbeat);
- }
-
- static void init(int delay, int timeout)
- {
- _impl.init(delay, timeout);
- }
-
- private static interface Diagnostics
- {
- void sent();
- void timeout();
- void received(boolean heartbeat);
- void init(int delay, int timeout);
- }
-
- private static class On implements Diagnostics
- {
- private final String[] messages = new String[50];
- private int i;
-
- private void save(String msg)
- {
- messages[i++] = msg;
- if(i >= messages.length){
- i = 0;//i.e. a circular buffer
- }
- }
-
- public void sent()
- {
- save(System.currentTimeMillis() + ": sent heartbeat");
- }
-
- public void timeout()
- {
- for(int i = 0; i < messages.length; i++)
- {
- if(messages[i] != null)
- {
- System.out.println(messages[i]);
- }
- }
- System.out.println(System.currentTimeMillis() + ": timed out");
- }
-
- public void received(boolean heartbeat)
- {
- save(System.currentTimeMillis() + ": received " + (heartbeat ? "heartbeat" : "data"));
- }
-
- public void init(int delay, int timeout)
- {
- System.out.println(System.currentTimeMillis() + ": initialised delay=" + delay + ", timeout=" + timeout);
- }
- }
-
- private static class Off implements Diagnostics
- {
- public void sent()
- {
-
- }
- public void timeout()
- {
-
- }
- public void received(boolean heartbeat)
- {
-
- }
-
- public void init(int delay, int timeout)
- {
-
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/ProtocolBufferMonitorFilter.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/ProtocolBufferMonitorFilter.java
deleted file mode 100644
index 93cc5e7ec3..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/ProtocolBufferMonitorFilter.java
+++ /dev/null
@@ -1,115 +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.
- *
- */
-package org.apache.qpid.client.protocol;
-
-import org.apache.mina.common.IoFilterAdapter;
-import org.apache.mina.common.IoSession;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A MINA filter that monitors the numbers of messages pending to be sent by MINA. It outputs a message
- * when a threshold has been exceeded, and has a frequency configuration so that messages are not output
- * too often.
- *
- */
-public class ProtocolBufferMonitorFilter extends IoFilterAdapter
-{
- private static final Logger _logger = LoggerFactory.getLogger(ProtocolBufferMonitorFilter.class);
-
- public static long DEFAULT_FREQUENCY = 5000;
-
- public static int DEFAULT_THRESHOLD = 3000;
-
- private int _bufferedMessages = 0;
-
- private int _threshold;
-
- private long _lastMessageOutputTime;
-
- private long _outputFrequencyInMillis;
-
- public ProtocolBufferMonitorFilter()
- {
- _threshold = DEFAULT_THRESHOLD;
- _outputFrequencyInMillis = DEFAULT_FREQUENCY;
- }
-
- public ProtocolBufferMonitorFilter(int threshold, long frequency)
- {
- _threshold = threshold;
- _outputFrequencyInMillis = frequency;
- }
-
- public void messageReceived(NextFilter nextFilter, IoSession session, Object message) throws Exception
- {
- _bufferedMessages++;
- if (_bufferedMessages > _threshold)
- {
- long now = System.currentTimeMillis();
- if ((now - _lastMessageOutputTime) > _outputFrequencyInMillis)
- {
- _logger.warn("Protocol message buffer exceeded threshold of " + _threshold + ". Current backlog: "
- + _bufferedMessages);
- _lastMessageOutputTime = now;
- }
- }
-
- nextFilter.messageReceived(session, message);
- }
-
- public void messageSent(NextFilter nextFilter, IoSession session, Object message) throws Exception
- {
- _bufferedMessages--;
- nextFilter.messageSent(session, message);
- }
-
- public int getBufferedMessages()
- {
- return _bufferedMessages;
- }
-
- public int getThreshold()
- {
- return _threshold;
- }
-
- public void setThreshold(int threshold)
- {
- _threshold = threshold;
- }
-
- public long getOutputFrequencyInMillis()
- {
- return _outputFrequencyInMillis;
- }
-
- public void setOutputFrequencyInMillis(long outputFrequencyInMillis)
- {
- _outputFrequencyInMillis = outputFrequencyInMillis;
- }
-
- public long getLastMessageOutputTime()
- {
- return _lastMessageOutputTime;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/AMQCallbackHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/AMQCallbackHandler.java
deleted file mode 100644
index fbca444208..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/AMQCallbackHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.client.security;
-
-import javax.security.auth.callback.CallbackHandler;
-
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-
-public interface AMQCallbackHandler extends CallbackHandler
-{
- void initialise(AMQProtocolSession protocolSession);
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.java
deleted file mode 100644
index 140cbdeb75..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.java
+++ /dev/null
@@ -1,231 +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.
- *
- */
-package org.apache.qpid.client.security;
-
-import org.apache.qpid.util.FileUtils;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * CallbackHandlerRegistry is a registry for call back handlers for user authentication and interaction during user
- * authentication. It is capable of reading its configuration from a properties file containing call back handler
- * implementing class names for different SASL mechanism names. Instantiating this registry also has the effect of
- * configuring and registering the SASL client factory implementations using {@link DynamicSaslRegistrar}.
- *
- * <p/>The callback configuration should be specified in a properties file, refered to by the System property
- * "amp.callbackhandler.properties". The format of the properties file is:
- *
- * <p/><pre>
- * CallbackHanlder.mechanism=fully.qualified.class.name
- * </pre>
- *
- * <p/>Where mechanism is an IANA-registered mechanism name and the fully qualified class name refers to a
- * class that implements org.apache.qpid.client.security.AMQCallbackHanlder and provides a call back handler for the
- * specified mechanism.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Parse callback properties.
- * <tr><td> Provide mapping from SASL mechanisms to callback implementations.
- * </table>
- */
-public class CallbackHandlerRegistry
-{
- private static final Logger _logger = LoggerFactory.getLogger(CallbackHandlerRegistry.class);
-
- /** The name of the system property that holds the name of the callback handler properties file. */
- private static final String FILE_PROPERTY = "amq.callbackhandler.properties";
-
- /** The default name of the callback handler properties resource. */
- public static final String DEFAULT_RESOURCE_NAME = "org/apache/qpid/client/security/CallbackHandlerRegistry.properties";
-
- /** A static reference to the singleton instance of this registry. */
- private static CallbackHandlerRegistry _instance = new CallbackHandlerRegistry();
-
- /** Holds a map from SASL mechanism names to call back handlers. */
- private Map<String, Class> _mechanismToHandlerClassMap = new HashMap<String, Class>();
-
- /** Holds a space delimited list of mechanisms that callback handlers exist for. */
- private String _mechanisms;
-
- /**
- * Gets the singleton instance of this registry.
- *
- * @return The singleton instance of this registry.
- */
- public static CallbackHandlerRegistry getInstance()
- {
- return _instance;
- }
-
- /**
- * Gets the callback handler class for a given SASL mechanism name.
- *
- * @param mechanism The SASL mechanism name.
- *
- * @return The callback handler class for the mechanism, or null if none is configured for that mechanism.
- */
- public Class getCallbackHandlerClass(String mechanism)
- {
- return (Class) _mechanismToHandlerClassMap.get(mechanism);
- }
-
- /**
- * Gets a space delimited list of supported SASL mechanisms.
- *
- * @return A space delimited list of supported SASL mechanisms.
- */
- public String getMechanisms()
- {
- return _mechanisms;
- }
-
- /**
- * Creates the call back handler registry from its configuration resource or file. This also has the side effect
- * of configuring and registering the SASL client factory implementations using {@link DynamicSaslRegistrar}.
- */
- private CallbackHandlerRegistry()
- {
- // Register any configured SASL client factories.
- DynamicSaslRegistrar.registerSaslProviders();
-
- String filename = System.getProperty(FILE_PROPERTY);
- InputStream is =
- FileUtils.openFileOrDefaultResource(filename, DEFAULT_RESOURCE_NAME,
- CallbackHandlerRegistry.class.getClassLoader());
-
- try
- {
- Properties props = new Properties();
- props.load(is);
- parseProperties(props);
- _logger.info("Callback handlers available for SASL mechanisms: " + _mechanisms);
- }
- catch (IOException e)
- {
- _logger.error("Error reading properties: " + e, e);
- }
- finally
- {
- if (is != null)
- {
- try
- {
- is.close();
-
- }
- catch (IOException e)
- {
- _logger.error("Unable to close properties stream: " + e, e);
- }
- }
- }
- }
-
- /*private InputStream openPropertiesInputStream(String filename)
- {
- boolean useDefault = true;
- InputStream is = null;
- if (filename != null)
- {
- try
- {
- is = new BufferedInputStream(new FileInputStream(new File(filename)));
- useDefault = false;
- }
- catch (FileNotFoundException e)
- {
- _logger.error("Unable to read from file " + filename + ": " + e, e);
- }
- }
-
- if (useDefault)
- {
- is = CallbackHandlerRegistry.class.getResourceAsStream(DEFAULT_RESOURCE_NAME);
- }
-
- return is;
- }*/
-
- /**
- * Scans the specified properties as a mapping from IANA registered SASL mechanism to call back handler
- * implementations, that provide the necessary call back handling for obtaining user log in credentials
- * during authentication for the specified mechanism, and builds a map from mechanism names to handler
- * classes.
- *
- * @param props
- */
- private void parseProperties(Properties props)
- {
- Enumeration e = props.propertyNames();
- while (e.hasMoreElements())
- {
- String propertyName = (String) e.nextElement();
- int period = propertyName.indexOf(".");
- if (period < 0)
- {
- _logger.warn("Unable to parse property " + propertyName + " when configuring SASL providers");
-
- continue;
- }
-
- String mechanism = propertyName.substring(period + 1);
- String className = props.getProperty(propertyName);
- Class clazz = null;
- try
- {
- clazz = Class.forName(className);
- if (!AMQCallbackHandler.class.isAssignableFrom(clazz))
- {
- _logger.warn("SASL provider " + clazz + " does not implement " + AMQCallbackHandler.class
- + ". Skipping");
-
- continue;
- }
-
- _mechanismToHandlerClassMap.put(mechanism, clazz);
- if (_mechanisms == null)
- {
- _mechanisms = mechanism;
- }
- else
- {
- // one time cost
- _mechanisms = _mechanisms + " " + mechanism;
- }
- }
- catch (ClassNotFoundException ex)
- {
- _logger.warn("Unable to load class " + className + ". Skipping that SASL provider");
-
- continue;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.properties b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.properties
deleted file mode 100644
index 1fcfde3579..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.properties
+++ /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.
-#
-CallbackHandler.CRAM-MD5-HASHED=org.apache.qpid.client.security.UsernameHashedPasswordCallbackHandler
-CallbackHandler.CRAM-MD5=org.apache.qpid.client.security.UsernamePasswordCallbackHandler
-CallbackHandler.AMQPLAIN=org.apache.qpid.client.security.UsernamePasswordCallbackHandler
-CallbackHandler.PLAIN=org.apache.qpid.client.security.UsernamePasswordCallbackHandler
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.java
deleted file mode 100644
index 2b4261b4b7..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.java
+++ /dev/null
@@ -1,210 +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.
- *
- */
-package org.apache.qpid.client.security;
-
-import org.apache.qpid.util.FileUtils;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.security.sasl.SaslClientFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.Security;
-import java.util.Enumeration;
-import java.util.Map;
-import java.util.Properties;
-import java.util.TreeMap;
-
-/**
- * DynamicSaslRegistrar provides a collection of helper methods for reading a configuration file that contains a mapping
- * from SASL mechanism names to implementing client factory class names and registering a security provider with the
- * Java runtime system, that uses the configured client factory implementations.
- *
- * <p/>The sasl configuration should be specified in a properties file, refered to by the System property
- * "amp.dynamicsaslregistrar.properties". The format of the properties file is:
- *
- * <p/><pre>
- * mechanism=fully.qualified.class.name
- * </pre>
- *
- * <p/>Where mechanism is an IANA-registered mechanism name and the fully qualified class name refers to a class that
- * implements javax.security.sasl.SaslClientFactory and provides the specified mechanism.
- *
- * <p><table id="crc"><caption>CRC Card</caption> <tr><th> Responsibilities <th> Collaborations <tr><td> Parse SASL
- * mechanism properties. <tr><td> Create and register security provider for SASL mechanisms. </table>
- */
-public class DynamicSaslRegistrar
-{
- private static final Logger _logger = LoggerFactory.getLogger(DynamicSaslRegistrar.class);
-
- /** The name of the system property that holds the name of the SASL configuration properties. */
- private static final String FILE_PROPERTY = "amq.dynamicsaslregistrar.properties";
-
- /** The default name of the SASL properties file resource. */
- public static final String DEFAULT_RESOURCE_NAME = "org/apache/qpid/client/security/DynamicSaslRegistrar.properties";
-
- /** Reads the properties file, and creates a dynamic security provider to register the SASL implementations with. */
- public static void registerSaslProviders()
- {
- _logger.debug("public static void registerSaslProviders(): called");
-
- // Open the SASL properties file, using the default name is one is not specified.
- String filename = System.getProperty(FILE_PROPERTY);
- InputStream is =
- FileUtils.openFileOrDefaultResource(filename, DEFAULT_RESOURCE_NAME,
- DynamicSaslRegistrar.class.getClassLoader());
-
- try
- {
- Properties props = new Properties();
- props.load(is);
-
- _logger.debug("props = " + props);
-
- Map<String, Class<? extends SaslClientFactory>> factories = parseProperties(props);
-
- if (factories.size() > 0)
- {
- // Ensure we are used before the defaults
- if (Security.insertProviderAt(new JCAProvider(factories), 1) == -1)
- {
- _logger.error("Unable to load custom SASL providers.");
- }
- else
- {
- _logger.info("Additional SASL providers successfully registered.");
- }
- }
- else
- {
- _logger.warn("No additional SASL providers registered.");
- }
- }
- catch (IOException e)
- {
- _logger.error("Error reading properties: " + e, e);
- }
- finally
- {
- if (is != null)
- {
- try
- {
- is.close();
-
- }
- catch (IOException e)
- {
- _logger.error("Unable to close properties stream: " + e, e);
- }
- }
- }
- }
-
- /**
- * Either attempts to open the specified filename as an input stream, or uses the default SASL configuration
- * resource.
- *
- * @param filename The name of the file to get the SASL properties from, null to use the default.
- *
- * @return An input stream to read the dynamic SASL configuration from, or null if one could not be opened.
- */
- /*private static InputStream openPropertiesInputStream(String filename)
- {
- InputStream is = null;
-
- // Flag to indicate whether the default resource should be used. By default this is true, so that the default
- // is used when opening the file fails.
- boolean useDefault = true;
-
- // Try to open the file if one was specified.
- if (filename != null)
- {
- try
- {
- is = new BufferedInputStream(new FileInputStream(new File(filename)));
-
- // Clear the default flag because the file was succesfully opened.
- useDefault = false;
- }
- catch (FileNotFoundException e)
- {
- _logger.error("Unable to read from file " + filename + ": " + e, e);
- }
- }
-
- // Load the default resource if a file was not specified, or if opening the file failed.
- if (useDefault)
- {
- is = CallbackHandlerRegistry.class.getResourceAsStream(DEFAULT_RESOURCE_NAME);
- }
-
- return is;
- }*/
-
- /**
- * Parses the specified properties as a mapping from IANA registered SASL mechanism names to implementing client
- * factories. If the client factories cannot be instantiated or do not implement SaslClientFactory then the
- * properties refering to them are ignored.
- *
- * @param props The properties to scan for Sasl client factory implementations.
- *
- * @return A map from SASL mechanism names to implementing client factory classes.
- *
- * @todo Why tree map here? Do really want mechanisms in alphabetical order? Seems more likely that the declared
- * order of the mechanisms is intended to be preserved, so that they are registered in the declared order of
- * preference. Consider LinkedHashMap instead.
- */
- private static Map<String, Class<? extends SaslClientFactory>> parseProperties(Properties props)
- {
- Enumeration e = props.propertyNames();
-
- TreeMap<String, Class<? extends SaslClientFactory>> factoriesToRegister =
- new TreeMap<String, Class<? extends SaslClientFactory>>();
-
- while (e.hasMoreElements())
- {
- String mechanism = (String) e.nextElement();
- String className = props.getProperty(mechanism);
- try
- {
- Class<?> clazz = Class.forName(className);
- if (!(SaslClientFactory.class.isAssignableFrom(clazz)))
- {
- _logger.error("Class " + clazz + " does not implement " + SaslClientFactory.class + " - skipping");
-
- continue;
- }
-
- _logger.debug("Registering class "+ clazz.getName() +" for mechanism "+mechanism);
- factoriesToRegister.put(mechanism, (Class<? extends SaslClientFactory>) clazz);
- }
- catch (Exception ex)
- {
- _logger.error("Error instantiating SaslClientFactory calss " + className + " - skipping");
- }
- }
-
- return factoriesToRegister;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.properties b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.properties
deleted file mode 100644
index 1bff43142b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.properties
+++ /dev/null
@@ -1,20 +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.
-#
-AMQPLAIN=org.apache.qpid.client.security.amqplain.AmqPlainSaslClientFactory
-CRAM-MD5-HASHED=org.apache.qpid.client.security.crammd5hashed.CRAMMD5HashedSaslClientFactory
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/JCAProvider.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/JCAProvider.java
deleted file mode 100644
index 828d26ed0d..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/JCAProvider.java
+++ /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.
- *
- */
-package org.apache.qpid.client.security;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.security.sasl.SaslClientFactory;
-
-import java.security.Provider;
-import java.security.Security;
-import java.util.Map;
-
-/**
- * JCAProvider is a security provider for SASL client factories that is configured from a map of SASL mechanism names
- * to client factories implementation class names. It is intended that the map of client factories can be read from a
- * configuration file or other application configuration mechanism.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Register SASL mechanism implementations.
- * </table>
- */
-public class JCAProvider extends Provider
-{
- private static final Logger log = LoggerFactory.getLogger(JCAProvider.class);
-
- /**
- * Creates the security provider with a map from SASL mechanisms to implementing factories.
- *
- * @param providerMap The map from SASL mechanims to implementing factory classes.
- */
- public JCAProvider(Map<String, Class<? extends SaslClientFactory>> providerMap)
- {
- super("AMQSASLProvider-Client", 1.0, "A JCA provider that registers all "
- + "AMQ SASL providers that want to be registered");
- register(providerMap);
-// Security.addProvider(this);
- }
-
- /**
- * Registers client factory classes for a map of mechanism names to client factory classes.
- *
- * @param providerMap The map from SASL mechanims to implementing factory classes.
- */
- private void register(Map<String, Class<? extends SaslClientFactory>> providerMap)
- {
- for (Map.Entry<String, Class<? extends SaslClientFactory>> me : providerMap.entrySet())
- {
- put( "SaslClientFactory."+me.getKey(), me.getValue().getName());
- log.debug("Registered SASL Client factory for " + me.getKey() + " as " + me.getValue().getName());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/UsernameHashedPasswordCallbackHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/UsernameHashedPasswordCallbackHandler.java
deleted file mode 100644
index 66176dac3c..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/UsernameHashedPasswordCallbackHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.client.security;
-
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-public class UsernameHashedPasswordCallbackHandler implements AMQCallbackHandler
-{
- private static final Logger _logger = LoggerFactory.getLogger(UsernameHashedPasswordCallbackHandler.class);
-
- private AMQProtocolSession _protocolSession;
-
- public void initialise(AMQProtocolSession protocolSession)
- {
- _protocolSession = protocolSession;
- }
-
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- for (int i = 0; i < callbacks.length; i++)
- {
- Callback cb = callbacks[i];
- if (cb instanceof NameCallback)
- {
- ((NameCallback) cb).setName(_protocolSession.getUsername());
- }
- else if (cb instanceof PasswordCallback)
- {
- try
- {
- ((PasswordCallback) cb).setPassword(getHash(_protocolSession.getPassword()));
- }
- catch (NoSuchAlgorithmException e)
- {
- UnsupportedCallbackException uce = new UnsupportedCallbackException(cb);
- uce.initCause(e);
- throw uce;
- }
- }
- else
- {
- throw new UnsupportedCallbackException(cb);
- }
- }
- }
-
- private char[] getHash(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException
- {
-
- byte[] data = text.getBytes("utf-8");
-
- MessageDigest md = MessageDigest.getInstance("MD5");
-
- for (byte b : data)
- {
- md.update(b);
- }
-
- byte[] digest = md.digest();
-
- char[] hash = new char[digest.length];
-
- int index = 0;
- for (byte b : digest)
- {
- hash[index++] = (char) b;
- }
-
- return hash;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/UsernamePasswordCallbackHandler.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/UsernamePasswordCallbackHandler.java
deleted file mode 100644
index c50c62710f..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/UsernamePasswordCallbackHandler.java
+++ /dev/null
@@ -1,60 +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.
- *
- */
-package org.apache.qpid.client.security;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-
-public class UsernamePasswordCallbackHandler implements AMQCallbackHandler
-{
- private AMQProtocolSession _protocolSession;
-
- public void initialise(AMQProtocolSession protocolSession)
- {
- _protocolSession = protocolSession;
- }
-
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- for (int i = 0; i < callbacks.length; i++)
- {
- Callback cb = callbacks[i];
- if (cb instanceof NameCallback)
- {
- ((NameCallback)cb).setName(_protocolSession.getUsername());
- }
- else if (cb instanceof PasswordCallback)
- {
- ((PasswordCallback)cb).setPassword(_protocolSession.getPassword().toCharArray());
- }
- else
- {
- throw new UnsupportedCallbackException(cb);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClient.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClient.java
deleted file mode 100644
index f8a25c630c..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClient.java
+++ /dev/null
@@ -1,105 +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.
- *
- */
-package org.apache.qpid.client.security.amqplain;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslException;
-
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.FieldTableFactory;
-
-/**
- * Implements the "AMQPlain" authentication protocol that uses FieldTables to send username and pwd.
- *
- */
-public class AmqPlainSaslClient implements SaslClient
-{
- /**
- * The name of this mechanism
- */
- public static final String MECHANISM = "AMQPLAIN";
-
- private CallbackHandler _cbh;
-
- public AmqPlainSaslClient(CallbackHandler cbh)
- {
- _cbh = cbh;
- }
-
- public String getMechanismName()
- {
- return "AMQPLAIN";
- }
-
- public boolean hasInitialResponse()
- {
- return true;
- }
-
- public byte[] evaluateChallenge(byte[] challenge) throws SaslException
- {
- // we do not care about the prompt or the default name
- NameCallback nameCallback = new NameCallback("prompt", "defaultName");
- PasswordCallback pwdCallback = new PasswordCallback("prompt", false);
- Callback[] callbacks = new Callback[]{nameCallback, pwdCallback};
- try
- {
- _cbh.handle(callbacks);
- }
- catch (Exception e)
- {
- throw new SaslException("Error handling SASL callbacks: " + e, e);
- }
- FieldTable table = FieldTableFactory.newFieldTable();
- table.setString("LOGIN", nameCallback.getName());
- table.setString("PASSWORD", new String(pwdCallback.getPassword()));
- return table.getDataAsBytes();
- }
-
- public boolean isComplete()
- {
- return true;
- }
-
- public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
- {
- throw new SaslException("Not supported");
- }
-
- public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
- {
- throw new SaslException("Not supported");
- }
-
- public Object getNegotiatedProperty(String propName)
- {
- return null;
- }
-
- public void dispose() throws SaslException
- {
- _cbh = null;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClientFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClientFactory.java
deleted file mode 100644
index 30cc786890..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClientFactory.java
+++ /dev/null
@@ -1,63 +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.
- *
- */
-package org.apache.qpid.client.security.amqplain;
-
-import java.util.Map;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslClientFactory;
-import javax.security.sasl.SaslException;
-
-public class AmqPlainSaslClientFactory implements SaslClientFactory
-{
- public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Map props, CallbackHandler cbh) throws SaslException
- {
- for (int i = 0; i < mechanisms.length; i++)
- {
- if (mechanisms[i].equals(AmqPlainSaslClient.MECHANISM))
- {
- if (cbh == null)
- {
- throw new SaslException("CallbackHandler must not be null");
- }
- return new AmqPlainSaslClient(cbh);
- }
- }
- return null;
- }
-
- public String[] getMechanismNames(Map props)
- {
- if (props.containsKey(Sasl.POLICY_NOPLAINTEXT) ||
- props.containsKey(Sasl.POLICY_NODICTIONARY) ||
- props.containsKey(Sasl.POLICY_NOACTIVE))
- {
- // returned array must be non null according to interface documentation
- return new String[0];
- }
- else
- {
- return new String[]{AmqPlainSaslClient.MECHANISM};
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/crammd5hashed/CRAMMD5HashedSaslClientFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/crammd5hashed/CRAMMD5HashedSaslClientFactory.java
deleted file mode 100644
index 22bb1ac156..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/security/crammd5hashed/CRAMMD5HashedSaslClientFactory.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.client.security.crammd5hashed;
-
-import org.apache.qpid.client.security.amqplain.AmqPlainSaslClient;
-
-import javax.security.sasl.SaslClientFactory;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.Sasl;
-import javax.security.auth.callback.CallbackHandler;
-import java.util.Map;
-import java.security.Security;
-
-public class CRAMMD5HashedSaslClientFactory implements SaslClientFactory
-{
- /** The name of this mechanism */
- public static final String MECHANISM = "CRAM-MD5-HASHED";
-
-
- public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException
- {
- for (int i = 0; i < mechanisms.length; i++)
- {
- if (mechanisms[i].equals(MECHANISM))
- {
- if (cbh == null)
- {
- throw new SaslException("CallbackHandler must not be null");
- }
-
- String[] mechs = {"CRAM-MD5"};
- return Sasl.createSaslClient(mechs, authorizationId, protocol, serverName, props, cbh);
- }
- }
- return null;
- }
-
- public String[] getMechanismNames(Map props)
- {
- if (props != null)
- {
- if (props.containsKey(Sasl.POLICY_NOPLAINTEXT) ||
- props.containsKey(Sasl.POLICY_NODICTIONARY) ||
- props.containsKey(Sasl.POLICY_NOACTIVE))
- {
- // returned array must be non null according to interface documentation
- return new String[0];
- }
- }
-
- return new String[]{MECHANISM};
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQMethodNotImplementedException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQMethodNotImplementedException.java
deleted file mode 100644
index 2c99b9a97b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQMethodNotImplementedException.java
+++ /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.
- *
- */
-package org.apache.qpid.client.state;
-
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.AMQException;
-
-public class AMQMethodNotImplementedException extends AMQException
-{
- public AMQMethodNotImplementedException(AMQMethodBody body)
- {
- super(null, "Unexpected Method Received: " + body.getClass().getName(), null);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQState.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQState.java
deleted file mode 100644
index d32d10542f..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQState.java
+++ /dev/null
@@ -1,60 +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.
- *
- */
-package org.apache.qpid.client.state;
-
-/**
- * States used in the AMQ protocol. Used by the finite state machine to determine
- * valid responses.
- */
-public enum AMQState
-{
-
- CONNECTION_NOT_STARTED(1, "CONNECTION_NOT_STARTED"),
-
- CONNECTION_NOT_TUNED(2, "CONNECTION_NOT_TUNED"),
-
- CONNECTION_NOT_OPENED(3, "CONNECTION_NOT_OPENED"),
-
- CONNECTION_OPEN(4, "CONNECTION_OPEN"),
-
- CONNECTION_CLOSING(5, "CONNECTION_CLOSING"),
-
- CONNECTION_CLOSED(6, "CONNECTION_CLOSED");
-
-
- private final int _id;
-
- private final String _name;
-
- private AMQState(int id, String name)
- {
- _id = id;
- _name = name;
- }
-
- public String toString()
- {
- return "AMQState: id = " + _id + " name: " + _name;
- }
-
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateChangedEvent.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateChangedEvent.java
deleted file mode 100644
index edef54ccd6..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateChangedEvent.java
+++ /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.
- *
- */
-package org.apache.qpid.client.state;
-
-/**
- * An event that is fired when the protocol state has changed.
- *
- */
-public class AMQStateChangedEvent
-{
- private final AMQState _oldState;
-
- private final AMQState _newState;
-
- public AMQStateChangedEvent(AMQState oldState, AMQState newState)
- {
- _oldState = oldState;
- _newState = newState;
- }
-
- public AMQState getOldState()
- {
- return _oldState;
- }
-
- public AMQState getNewState()
- {
- return _newState;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateListener.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateListener.java
deleted file mode 100644
index 110471aad0..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateListener.java
+++ /dev/null
@@ -1,26 +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.
- *
- */
-package org.apache.qpid.client.state;
-
-public interface AMQStateListener
-{
- void stateChanged(AMQStateChangedEvent evt);
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java
deleted file mode 100644
index f8645139f2..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java
+++ /dev/null
@@ -1,199 +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.
- *
- */
-package org.apache.qpid.client.state;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.protocol.AMQMethodListener;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Set;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-/**
- * The state manager is responsible for managing the state of the protocol session. <p/>
- * For each {@link org.apache.qpid.client.protocol.AMQProtocolHandler} there is a separate state manager.
- *
- * The AMQStateManager is now attached to the {@link org.apache.qpid.client.protocol.AMQProtocolHandler} and that is the sole point of reference so that
- * As the {@link AMQProtocolSession} changes due to failover the AMQStateManager need not be copied around.
- *
- * The StateManager works by any component can wait for a state change to occur by using the following sequence.
- *
- * <li>StateWaiter waiter = stateManager.createWaiter(Set<AMQState> states);
- * <li> // Perform action that will cause state change
- * <li>waiter.await();
- *
- * The two step process is required as there is an inherit race condition between starting a process that will cause
- * the state to change and then attempting to wait for that change. The interest in the change must be first set up so
- * that any asynchrous errors that occur can be delivered to the correct waiters.
- */
-public class AMQStateManager implements AMQMethodListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(AMQStateManager.class);
-
- private AMQProtocolSession _protocolSession;
-
- /** The current state */
- private AMQState _currentState;
-
- private final Object _stateLock = new Object();
-
- private static final long MAXIMUM_STATE_WAIT_TIME = Long.parseLong(System.getProperty("amqj.MaximumStateWait", "30000"));
-
- protected final List<StateWaiter> _waiters = new CopyOnWriteArrayList<StateWaiter>();
- private Exception _lastException;
-
- public AMQStateManager()
- {
- this(null);
- }
-
- public AMQStateManager(AMQProtocolSession protocolSession)
- {
- this(AMQState.CONNECTION_NOT_STARTED, protocolSession);
- }
-
- protected AMQStateManager(AMQState state, AMQProtocolSession protocolSession)
- {
- _protocolSession = protocolSession;
- _currentState = state;
- }
-
- public AMQState getCurrentState()
- {
- return _currentState;
- }
-
- public void changeState(AMQState newState) throws AMQException
- {
- _logger.debug("State changing to " + newState + " from old state " + _currentState);
-
- synchronized (_stateLock)
- {
- _currentState = newState;
-
- _logger.debug("Notififying State change to " + _waiters.size() + " : " + _waiters);
-
- for (StateWaiter waiter : _waiters)
- {
- waiter.received(newState);
- }
- }
- }
-
- public <B extends AMQMethodBody> boolean methodReceived(AMQMethodEvent<B> evt) throws AMQException
- {
- B method = evt.getMethod();
-
- // StateAwareMethodListener handler = findStateTransitionHandler(_currentState, evt.getMethod());
- method.execute(_protocolSession.getMethodDispatcher(), evt.getChannelId());
- return true;
- }
-
- /**
- * Setting of the ProtocolSession will be required when Failover has been successfuly compeleted.
- *
- * The new {@link AMQProtocolSession} that has been re-established needs to be provided as that is now the
- * connection to the network.
- *
- * @param session The new protocol session
- */
- public void setProtocolSession(AMQProtocolSession session)
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Setting ProtocolSession:" + session);
- }
- _protocolSession = session;
- }
-
- /**
- * Propogate error to waiters
- *
- * @param error The error to propogate.
- */
- public void error(Exception error)
- {
- if (_waiters.size() == 0)
- {
- _logger.error("No Waiters for error saving as last error:" + error.getMessage());
- _lastException = error;
- }
- for (StateWaiter waiter : _waiters)
- {
- _logger.error("Notifying Waiters(" + _waiters + ") for error:" + error.getMessage());
- waiter.error(error);
- }
- }
-
- /**
- * This provides a single place that the maximum time for state change to occur can be accessed.
- * It is currently set via System property amqj.MaximumStateWait
- *
- * @return long Milliseconds value for a timeout
- */
- public long getWaitTimeout()
- {
- return MAXIMUM_STATE_WAIT_TIME;
- }
-
- /**
- * Create and add a new waiter to the notifcation list.
- *
- * @param states The waiter will attempt to wait for one of these desired set states to be achived.
- *
- * @return the created StateWaiter.
- */
- public StateWaiter createWaiter(Set<AMQState> states)
- {
- final StateWaiter waiter;
- synchronized (_stateLock)
- {
- waiter = new StateWaiter(this, _currentState, states);
-
- _waiters.add(waiter);
- }
-
- return waiter;
- }
-
- /**
- * Remove the waiter from the notification list.
- *
- * @param waiter The waiter to remove.
- */
- public void removeWaiter(StateWaiter waiter)
- {
- synchronized (_stateLock)
- {
- _waiters.remove(waiter);
- }
- }
-
- public Exception getLastException()
- {
- return _lastException;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/StateAwareMethodListener.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/StateAwareMethodListener.java
deleted file mode 100644
index 17d04f4fa3..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/StateAwareMethodListener.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.client.state;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-/**
- * A frame listener that is informed of the protocl state when invoked and has
- * the opportunity to update state.
- *
- */
-public interface StateAwareMethodListener<B extends AMQMethodBody>
-{
-
- void methodReceived(AMQProtocolSession session, B body, int channelId) throws AMQException;
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.java
deleted file mode 100644
index 4695b195d5..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.java
+++ /dev/null
@@ -1,129 +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.
- *
- */
-package org.apache.qpid.client.state;
-
-import org.apache.qpid.client.util.BlockingWaiter;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.AMQException;
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
-import java.util.Set;
-
-/**
- * This is an implementation of the {@link BlockingWaiter} to provide error handing and a waiting mechanism for state
- * changes.
- *
- * On construction the current state and a set of States to await for is provided.
- *
- * When await() is called the state at constuction is compared against the awaitStates. If the state at construction is
- * a desired state then await() returns immediately.
- *
- * Otherwise it will block for the set timeout for a desired state to be achieved.
- *
- * The state changes are notified via the {@link #process} method.
- *
- * Any notified error is handled by the BlockingWaiter and thrown from the {@link #block} method.
- *
- */
-public class StateWaiter extends BlockingWaiter<AMQState>
-{
- private static final Logger _logger = LoggerFactory.getLogger(StateWaiter.class);
-
- Set<AMQState> _awaitStates;
- private AMQState _startState;
- private AMQStateManager _stateManager;
-
- /**
- *
- * @param stateManager The StateManager
- * @param currentState
- * @param awaitStates
- */
- public StateWaiter(AMQStateManager stateManager, AMQState currentState, Set<AMQState> awaitStates)
- {
- _logger.info("New StateWaiter :" + currentState + ":" + awaitStates);
- _stateManager = stateManager;
- _awaitStates = awaitStates;
- _startState = currentState;
- }
-
- /**
- * When the state is changed this StateWaiter is notified to process the change.
- *
- * @param state The new state that has been achieved.
- * @return
- */
- public boolean process(AMQState state)
- {
- return _awaitStates.contains(state);
- }
-
- /**
- * Await for the requried State to be achieved within the default timeout.
- * @return The achieved state that was requested.
- * @throws AMQException The exception that prevented the required state from being achived.
- */
- public AMQState await() throws AMQException
- {
- return await(_stateManager.getWaitTimeout());
- }
-
- /**
- * Await for the requried State to be achieved.
- *
- * <b>It is the responsibility of this class to remove the waiter from the StateManager
- *
- * @param timeout The time in milliseconds to wait for any of the states to be achived.
- * @return The achieved state that was requested.
- * @throws AMQException The exception that prevented the required state from being achived.
- */
- public AMQState await(long timeout) throws AMQException
- {
- try
- {
- if (process(_startState))
- {
- return _startState;
- }
-
- try
- {
- return (AMQState) block(timeout);
- }
- catch (FailoverException e)
- {
- _logger.error("Failover occured whilst waiting for states:" + _awaitStates);
-
- e.printStackTrace();
- return null;
- }
- }
- finally
- {
- //Prevent any more errors being notified to this waiter.
- close();
-
- //Remove the waiter from the notifcation list in the statee manager
- _stateManager.removeWaiter(this);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/listener/SpecificMethodFrameListener.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/listener/SpecificMethodFrameListener.java
deleted file mode 100644
index f0d7feb059..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/state/listener/SpecificMethodFrameListener.java
+++ /dev/null
@@ -1,41 +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.
- *
- */
-package org.apache.qpid.client.state.listener;
-
-
-import org.apache.qpid.client.protocol.BlockingMethodFrameListener;
-import org.apache.qpid.framing.AMQMethodBody;
-
-public class SpecificMethodFrameListener extends BlockingMethodFrameListener
-{
- private final Class _expectedClass;
-
- public SpecificMethodFrameListener(int channelId, Class expectedClass)
- {
- super(channelId);
- _expectedClass = expectedClass;
- }
-
- public boolean processMethod(int channelId, AMQMethodBody frame)
- {
- return _expectedClass.isInstance(frame);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java
deleted file mode 100644
index 6e47e2ce28..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-package org.apache.qpid.client.transport;
-
-import org.apache.qpid.jms.BrokerDetails;
-
-/**
- * AMQNoTransportForProtocolException represents a connection failure where there is no transport medium to connect
- * to the broker available. This may be the case if their is a error in the connection url, or an unsupported transport
- * type is specified.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent absence of a transport medium.
- * </table>
- *
- * @todo Error code never used. This is not an AMQException.
- */
-public class AMQNoTransportForProtocolException extends AMQTransportConnectionException
-{
- BrokerDetails _details;
-
- public AMQNoTransportForProtocolException(BrokerDetails details, String message, Throwable cause)
- {
- super(null, message, cause);
-
- _details = details;
- }
-
- public String toString()
- {
- if (_details != null)
- {
- return super.toString() + _details.toString();
- }
- else
- {
- return super.toString();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java
deleted file mode 100644
index 6bef6216bd..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java
+++ /dev/null
@@ -1,43 +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.
- *
- */
-package org.apache.qpid.client.transport;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQTransportConnectionException indicates a failure to establish a connection through the transporting medium, to
- * an AMQP broker.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent failure to connect through the transport medium.
- * </table>
- *
- * @todo Error code never used. This is not an AMQException.
- */
-public class AMQTransportConnectionException extends AMQException
-{
- public AMQTransportConnectionException(AMQConstant errorCode, String message, Throwable cause)
- {
- super(errorCode, message, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/ITransportConnection.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/ITransportConnection.java
deleted file mode 100644
index 7a24d6e15a..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/ITransportConnection.java
+++ /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.
- *
- */
-package org.apache.qpid.client.transport;
-
-import java.io.IOException;
-
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.jms.BrokerDetails;
-
-public interface ITransportConnection
-{
- void connect(AMQProtocolHandler protocolHandler, BrokerDetails brokerDetail)
- throws IOException;
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.java
deleted file mode 100644
index b2f7ae8395..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.java
+++ /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.
- *
- */
-package org.apache.qpid.client.transport;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.IoConnector;
-import org.apache.mina.common.SimpleByteBufferAllocator;
-import org.apache.mina.transport.socket.nio.ExistingSocketConnector;
-import org.apache.mina.transport.socket.nio.SocketConnectorConfig;
-import org.apache.mina.transport.socket.nio.SocketSessionConfig;
-
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.pool.ReadWriteThreadModel;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-public class SocketTransportConnection implements ITransportConnection
-{
- private static final Logger _logger = LoggerFactory.getLogger(SocketTransportConnection.class);
- private static final int DEFAULT_BUFFER_SIZE = 32 * 1024;
-
- private SocketConnectorFactory _socketConnectorFactory;
-
- static interface SocketConnectorFactory
- {
- IoConnector newSocketConnector();
- }
-
- public SocketTransportConnection(SocketConnectorFactory socketConnectorFactory)
- {
- _socketConnectorFactory = socketConnectorFactory;
- }
-
- public void connect(AMQProtocolHandler protocolHandler, BrokerDetails brokerDetail) throws IOException
- {
- ByteBuffer.setUseDirectBuffers(Boolean.getBoolean("amqj.enableDirectBuffers"));
-
- // the MINA default is currently to use the pooled allocator although this may change in future
- // once more testing of the performance of the simple allocator has been done
- if (!Boolean.getBoolean("amqj.enablePooledAllocator"))
- {
- _logger.info("Using SimpleByteBufferAllocator");
- ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
- }
-
- final IoConnector ioConnector = _socketConnectorFactory.newSocketConnector();
- SocketConnectorConfig cfg = (SocketConnectorConfig) ioConnector.getDefaultConfig();
-
- // if we do not use our own thread model we get the MINA default which is to use
- // its own leader-follower model
- boolean readWriteThreading = Boolean.getBoolean("amqj.shared_read_write_pool");
- if (readWriteThreading)
- {
- cfg.setThreadModel(ReadWriteThreadModel.getInstance());
- }
-
- SocketSessionConfig scfg = (SocketSessionConfig) cfg.getSessionConfig();
- scfg.setTcpNoDelay("true".equalsIgnoreCase(System.getProperty("amqj.tcpNoDelay", "true")));
- scfg.setSendBufferSize(Integer.getInteger("amqj.sendBufferSize", DEFAULT_BUFFER_SIZE));
- _logger.info("send-buffer-size = " + scfg.getSendBufferSize());
- scfg.setReceiveBufferSize(Integer.getInteger("amqj.receiveBufferSize", DEFAULT_BUFFER_SIZE));
- _logger.info("recv-buffer-size = " + scfg.getReceiveBufferSize());
-
- final InetSocketAddress address;
-
- if (brokerDetail.getTransport().equals(BrokerDetails.SOCKET))
- {
- address = null;
-
- Socket socket = TransportConnection.removeOpenSocket(brokerDetail.getHost());
-
- if (socket != null)
- {
- _logger.info("Using existing Socket:" + socket);
-
- ((ExistingSocketConnector) ioConnector).setOpenSocket(socket);
- }
- else
- {
- throw new IllegalArgumentException("Active Socket must be provided for broker " +
- "with 'socket://<SocketID>' transport:" + brokerDetail);
- }
- }
- else
- {
- address = new InetSocketAddress(brokerDetail.getHost(), brokerDetail.getPort());
- _logger.info("Attempting connection to " + address);
- }
-
-
- ConnectFuture future = ioConnector.connect(address, protocolHandler);
-
- // wait for connection to complete
- if (future.join(brokerDetail.getTimeout()))
- {
- // we call getSession which throws an IOException if there has been an error connecting
- future.getSession();
- }
- else
- {
- throw new IOException("Timeout waiting for connection.");
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java
deleted file mode 100644
index 6c12821c74..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java
+++ /dev/null
@@ -1,335 +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.
- *
- */
-package org.apache.qpid.client.transport;
-
-import org.apache.mina.common.IoConnector;
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.transport.socket.nio.ExistingSocketConnector;
-import org.apache.mina.transport.socket.nio.MultiThreadSocketConnector;
-import org.apache.mina.transport.socket.nio.SocketConnector;
-import org.apache.mina.transport.vmpipe.VmPipeAcceptor;
-import org.apache.mina.transport.vmpipe.VmPipeAddress;
-import org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.pool.ReadWriteThreadModel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.net.Socket;
-
-/**
- * The TransportConnection is a helper class responsible for connecting to an AMQ server. It sets up the underlying
- * connector, which currently always uses TCP/IP sockets. It creates the "protocol handler" which deals with MINA
- * protocol events. <p/> Could be extended in future to support different transport types by turning this into concrete
- * class/interface combo.
- */
-public class TransportConnection
-{
- private static ITransportConnection _instance;
-
- private static Map _inVmPipeAddress = new HashMap();
- private static VmPipeAcceptor _acceptor;
- private static int _currentInstance = -1;
- private static int _currentVMPort = -1;
-
- private static final int TCP = 0;
- private static final int VM = 1;
- private static final int SOCKET = 2;
-
- private static Logger _logger = LoggerFactory.getLogger(TransportConnection.class);
-
- private static final String DEFAULT_QPID_SERVER = "org.apache.qpid.server.protocol.AMQPFastProtocolHandler";
-
- private static Map<String, Socket> _openSocketRegister = new ConcurrentHashMap<String, Socket>();
-
- public static void registerOpenSocket(String socketID, Socket openSocket)
- {
- _openSocketRegister.put(socketID, openSocket);
- }
-
- public static Socket removeOpenSocket(String socketID)
- {
- return _openSocketRegister.remove(socketID);
- }
-
- public static synchronized ITransportConnection getInstance(BrokerDetails details) throws AMQTransportConnectionException
- {
- int transport = getTransport(details.getTransport());
-
- if (transport == -1)
- {
- throw new AMQNoTransportForProtocolException(details, null, null);
- }
-
- switch (transport)
- {
- case SOCKET:
- return new SocketTransportConnection(new SocketTransportConnection.SocketConnectorFactory()
- {
- public IoConnector newSocketConnector()
- {
- return new ExistingSocketConnector();
- }
- });
- case TCP:
- return new SocketTransportConnection(new SocketTransportConnection.SocketConnectorFactory()
- {
- public IoConnector newSocketConnector()
- {
- SocketConnector result;
- // FIXME - this needs to be sorted to use the new Mina MultiThread SA.
- if (Boolean.getBoolean("qpidnio"))
- {
- _logger.warn("Using Qpid MultiThreaded NIO - " + (System.getProperties().containsKey("qpidnio")
- ? "Qpid NIO is new default"
- : "Sysproperty 'qpidnio' is set"));
- result = new MultiThreadSocketConnector();
- }
- else
- {
- _logger.info("Using Mina NIO");
- result = new SocketConnector(); // non-blocking connector
- }
- // Don't have the connector's worker thread wait around for other connections (we only use
- // one SocketConnector per connection at the moment anyway). This allows short-running
- // clients (like unit tests) to complete quickly.
- result.setWorkerTimeout(0);
- return result;
- }
- });
- case VM:
- {
- return getVMTransport(details, Boolean.getBoolean("amqj.AutoCreateVMBroker"));
- }
- default:
- throw new AMQNoTransportForProtocolException(details, "Transport not recognised:" + transport, null);
- }
- }
-
- private static int getTransport(String transport)
- {
- if (transport.equals(BrokerDetails.SOCKET))
- {
- return SOCKET;
- }
-
- if (transport.equals(BrokerDetails.TCP))
- {
- return TCP;
- }
-
- if (transport.equals(BrokerDetails.VM))
- {
- return VM;
- }
-
- return -1;
- }
-
- private static ITransportConnection getVMTransport(BrokerDetails details, boolean AutoCreate)
- throws AMQVMBrokerCreationException
- {
- int port = details.getPort();
-
- synchronized (_inVmPipeAddress)
- {
- if (!_inVmPipeAddress.containsKey(port))
- {
- if (AutoCreate)
- {
- if (AutoCreate)
- {
- _logger.warn("Auto Creating InVM Broker on port:" + port);
- createVMBroker(port);
- }
- else
- {
- throw new AMQVMBrokerCreationException(null, port, "VM Broker on port " + port
- + " does not exist. Auto create disabled.", null);
- }
- }
- else
- {
- throw new AMQVMBrokerCreationException(null, port, "VM Broker on port " + port
- + " does not exist. Auto create disabled.", null);
- }
- }
- }
-
- return new VmPipeTransportConnection(port);
- }
-
- public static void createVMBroker(int port) throws AMQVMBrokerCreationException
- {
- if (_acceptor == null)
- {
- _acceptor = new VmPipeAcceptor();
-
- IoServiceConfig config = _acceptor.getDefaultConfig();
-
- config.setThreadModel(ReadWriteThreadModel.getInstance());
- }
- synchronized (_inVmPipeAddress)
- {
-
- if (!_inVmPipeAddress.containsKey(port))
- {
- _logger.info("Creating InVM Qpid.AMQP listening on port " + port);
- IoHandlerAdapter provider = null;
- try
- {
- VmPipeAddress pipe = new VmPipeAddress(port);
-
- provider = createBrokerInstance(port);
-
- _acceptor.bind(pipe, provider);
-
- _inVmPipeAddress.put(port, pipe);
- _logger.info("Created InVM Qpid.AMQP listening on port " + port);
- }
- catch (IOException e)
- {
- _logger.error("Got IOException.", e);
-
- // Try and unbind provider
- try
- {
- VmPipeAddress pipe = new VmPipeAddress(port);
-
- try
- {
- _acceptor.unbind(pipe);
- }
- catch (Exception ignore)
- {
- // ignore
- }
-
- if (provider == null)
- {
- provider = createBrokerInstance(port);
- }
-
- _acceptor.bind(pipe, provider);
- _inVmPipeAddress.put(port, pipe);
- _logger.info("Created InVM Qpid.AMQP listening on port " + port);
- }
- catch (IOException justUseFirstException)
- {
- String because;
- if (e.getCause() == null)
- {
- because = e.toString();
- }
- else
- {
- because = e.getCause().toString();
- }
-
- throw new AMQVMBrokerCreationException(null, port, because + " Stopped binding of InVM Qpid.AMQP", e);
- }
- }
-
- }
- else
- {
- _logger.info("InVM Qpid.AMQP on port " + port + " already exits.");
- }
- }
- }
-
- private static IoHandlerAdapter createBrokerInstance(int port) throws AMQVMBrokerCreationException
- {
- String protocolProviderClass = System.getProperty("amqj.protocolprovider.class", DEFAULT_QPID_SERVER);
- _logger.info("Creating Qpid protocol provider: " + protocolProviderClass);
-
- // can't use introspection to get Provider as it is a server class.
- // need to go straight to IoHandlerAdapter but that requries the queues and exchange from the ApplicationRegistry which we can't access.
-
- // get right constructor and pass in instancec ID - "port"
- IoHandlerAdapter provider;
- try
- {
- Class[] cnstr = {Integer.class};
- Object[] params = {port};
- provider = (IoHandlerAdapter) Class.forName(protocolProviderClass).getConstructor(cnstr).newInstance(params);
- // Give the broker a second to create
- _logger.info("Created VMBroker Instance:" + port);
- }
- catch (Exception e)
- {
- _logger.info("Unable to create InVM Qpid.AMQP on port " + port + ". Because: " + e.getCause());
- String because;
- if (e.getCause() == null)
- {
- because = e.toString();
- }
- else
- {
- because = e.getCause().toString();
- }
-
- AMQVMBrokerCreationException amqbce =
- new AMQVMBrokerCreationException(null, port, because + " Stopped InVM Qpid.AMQP creation", e);
- throw amqbce;
- }
-
- return provider;
- }
-
- public static void killAllVMBrokers()
- {
- _logger.info("Killing all VM Brokers");
- if (_acceptor != null)
- {
- _acceptor.unbindAll();
- }
- synchronized (_inVmPipeAddress)
- {
- _inVmPipeAddress.clear();
- }
- _acceptor = null;
- _currentInstance = -1;
- _currentVMPort = -1;
- }
-
- public static void killVMBroker(int port)
- {
- synchronized (_inVmPipeAddress)
- {
- VmPipeAddress pipe = (VmPipeAddress) _inVmPipeAddress.get(port);
- if (pipe != null)
- {
- _logger.info("Killing VM Broker:" + port);
- _inVmPipeAddress.remove(port);
- // This does need to be sychronized as otherwise mina can hang
- // if a new connection is made
- _acceptor.unbind(pipe);
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/VmPipeTransportConnection.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/VmPipeTransportConnection.java
deleted file mode 100644
index dca6efba67..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/transport/VmPipeTransportConnection.java
+++ /dev/null
@@ -1,62 +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.
- *
- */
-package org.apache.qpid.client.transport;
-
-import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.transport.vmpipe.QpidVmPipeConnector;
-import org.apache.mina.transport.vmpipe.VmPipeAddress;
-import org.apache.mina.transport.vmpipe.VmPipeConnector;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.pool.ReadWriteThreadModel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-
-public class VmPipeTransportConnection implements ITransportConnection
-{
- private static final Logger _logger = LoggerFactory.getLogger(VmPipeTransportConnection.class);
-
- private static int _port;
-
- public VmPipeTransportConnection(int port)
- {
- _port = port;
- }
-
- public void connect(AMQProtocolHandler protocolHandler, BrokerDetails brokerDetail) throws IOException
- {
- final VmPipeConnector ioConnector = new QpidVmPipeConnector();
- final IoServiceConfig cfg = ioConnector.getDefaultConfig();
-
- cfg.setThreadModel(ReadWriteThreadModel.getInstance());
-
- final VmPipeAddress address = new VmPipeAddress(_port);
- _logger.info("Attempting connection to " + address);
- ConnectFuture future = ioConnector.connect(address, protocolHandler);
- // wait for connection to complete
- future.join();
- // we call getSession which throws an IOException if there has been an error connecting
- future.getSession();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java
deleted file mode 100644
index fab95f754c..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser.java
+++ /dev/null
@@ -1,244 +0,0 @@
-package org.apache.qpid.client.url;
-/*
- *
- * 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 java.net.URI;
-import java.net.URISyntaxException;
-import java.util.StringTokenizer;
-
-import org.apache.qpid.client.AMQBrokerDetails;
-import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.client.AMQConnectionURL;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.url.URLHelper;
-import org.apache.qpid.url.URLSyntaxException;
-
-public class URLParser
-{
- private AMQConnectionURL _url;
-
- public URLParser(AMQConnectionURL url)throws URLSyntaxException
- {
- _url = url;
- parseURL(_url.getURL());
- }
-
- private void parseURL(String fullURL) throws URLSyntaxException
- {
- // Connection URL format
- // amqp://[user:pass@][clientid]/virtualhost?brokerlist='tcp://host:port?option=\'value\',option=\'value\';vm://:3/virtualpath?option=\'value\'',failover='method?option=\'value\',option='value''"
- // Options are of course optional except for requiring a single broker in the broker list.
- try
- {
- URI connection = new URI(fullURL);
-
- if ((connection.getScheme() == null) || !(connection.getScheme().equalsIgnoreCase(AMQConnectionURL.AMQ_PROTOCOL)))
- {
- throw new URISyntaxException(fullURL, "Not an AMQP URL");
- }
-
- if ((connection.getHost() == null) || connection.getHost().equals(""))
- {
- String uid = AMQConnectionFactory.getUniqueClientID();
- if (uid == null)
- {
- throw URLHelper.parseError(-1, "Client Name not specified", fullURL);
- }
- else
- {
- _url.setClientName(uid);
- }
-
- }
- else
- {
- _url.setClientName(connection.getHost());
- }
-
- String userInfo = connection.getUserInfo();
-
- if (userInfo == null)
- {
- // Fix for Java 1.5 which doesn't parse UserInfo for non http URIs
- userInfo = connection.getAuthority();
-
- if (userInfo != null)
- {
- int atIndex = userInfo.indexOf('@');
-
- if (atIndex != -1)
- {
- userInfo = userInfo.substring(0, atIndex);
- }
- else
- {
- userInfo = null;
- }
- }
-
- }
-
- if (userInfo == null)
- {
- throw URLHelper.parseError(AMQConnectionURL.AMQ_PROTOCOL.length() + 3, "User information not found on url", fullURL);
- }
- else
- {
- parseUserInfo(userInfo);
- }
-
- String virtualHost = connection.getPath();
-
- if ((virtualHost != null) && (!virtualHost.equals("")))
- {
- _url.setVirtualHost(virtualHost);
- }
- else
- {
- int authLength = connection.getAuthority().length();
- int start = AMQConnectionURL.AMQ_PROTOCOL.length() + 3;
- int testIndex = start + authLength;
- if ((testIndex < fullURL.length()) && (fullURL.charAt(testIndex) == '?'))
- {
- throw URLHelper.parseError(start, testIndex - start, "Virtual host found", fullURL);
- }
- else
- {
- throw URLHelper.parseError(-1, "Virtual host not specified", fullURL);
- }
-
- }
-
- URLHelper.parseOptions(_url.getOptions(), connection.getQuery());
-
- processOptions();
- }
- catch (URISyntaxException uris)
- {
- if (uris instanceof URLSyntaxException)
- {
- throw (URLSyntaxException) uris;
- }
-
- int slash = fullURL.indexOf("\\");
-
- if (slash == -1)
- {
- throw URLHelper.parseError(uris.getIndex(), uris.getReason(), uris.getInput());
- }
- else
- {
- if ((slash != 0) && (fullURL.charAt(slash - 1) == ':'))
- {
- throw URLHelper.parseError(slash - 2, fullURL.indexOf('?') - slash + 2,
- "Virtual host looks like a windows path, forward slash not allowed in URL", fullURL);
- }
- else
- {
- throw URLHelper.parseError(slash, "Forward slash not allowed in URL", fullURL);
- }
- }
-
- }
- }
-
- private void parseUserInfo(String userinfo) throws URLSyntaxException
- {
- // user info = user:pass
-
- int colonIndex = userinfo.indexOf(':');
-
- if (colonIndex == -1)
- {
- throw URLHelper.parseError(AMQConnectionURL.AMQ_PROTOCOL.length() + 3, userinfo.length(),
- "Null password in user information not allowed.", _url.getURL());
- }
- else
- {
- _url.setUsername(userinfo.substring(0, colonIndex));
- _url.setPassword(userinfo.substring(colonIndex + 1));
- }
-
- }
-
- private void processOptions() throws URLSyntaxException
- {
- if (_url.getOptions().containsKey(AMQConnectionURL.OPTIONS_BROKERLIST))
- {
- String brokerlist = _url.getOptions().get(AMQConnectionURL.OPTIONS_BROKERLIST);
-
- // brokerlist tcp://host:port?option='value',option='value';vm://:3/virtualpath?option='value'
- StringTokenizer st = new StringTokenizer(brokerlist, "" + URLHelper.BROKER_SEPARATOR);
-
- while (st.hasMoreTokens())
- {
- String broker = st.nextToken();
-
- _url.addBrokerDetails(new AMQBrokerDetails(broker));
- }
-
- _url.getOptions().remove(AMQConnectionURL.OPTIONS_BROKERLIST);
- }
-
- if (_url.getOptions().containsKey(AMQConnectionURL.OPTIONS_FAILOVER))
- {
- String failover = _url.getOptions().get(AMQConnectionURL.OPTIONS_FAILOVER);
-
- // failover='method?option='value',option='value''
-
- int methodIndex = failover.indexOf('?');
-
- if (methodIndex > -1)
- {
- _url.setFailoverMethod(failover.substring(0, methodIndex));
- URLHelper.parseOptions(_url.getFailoverOptions(), failover.substring(methodIndex + 1));
- }
- else
- {
- _url.setFailoverMethod(failover);
- }
-
- _url.getOptions().remove(AMQConnectionURL.OPTIONS_FAILOVER);
- }
-
- if (_url.getOptions().containsKey(AMQConnectionURL.OPTIONS_DEFAULT_TOPIC_EXCHANGE))
- {
- _url.setDefaultTopicExchangeName(new AMQShortString(_url.getOptions().get(AMQConnectionURL.OPTIONS_DEFAULT_TOPIC_EXCHANGE)));
- }
-
- if (_url.getOptions().containsKey(AMQConnectionURL.OPTIONS_DEFAULT_QUEUE_EXCHANGE))
- {
- _url.setDefaultQueueExchangeName(new AMQShortString(_url.getOptions().get(AMQConnectionURL.OPTIONS_DEFAULT_QUEUE_EXCHANGE)));
- }
-
- if (_url.getOptions().containsKey(AMQConnectionURL.OPTIONS_TEMPORARY_QUEUE_EXCHANGE))
- {
- _url.setTemporaryQueueExchangeName(new AMQShortString(_url.getOptions().get(AMQConnectionURL.OPTIONS_TEMPORARY_QUEUE_EXCHANGE)));
- }
-
- if (_url.getOptions().containsKey(AMQConnectionURL.OPTIONS_TEMPORARY_TOPIC_EXCHANGE))
- {
- _url.setTemporaryTopicExchangeName(new AMQShortString(_url.getOptions().get(AMQConnectionURL.OPTIONS_TEMPORARY_TOPIC_EXCHANGE)));
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser_0_10.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser_0_10.java
deleted file mode 100644
index 605e9ee154..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/url/URLParser_0_10.java
+++ /dev/null
@@ -1,423 +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.
- */
-package org.apache.qpid.client.url;
-
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.qpid.client.AMQBrokerDetails;
-import org.apache.qpid.jms.BrokerDetails;
-
-/**
- * The format Qpid URL is based on the AMQP one.
- * The grammar is as follows:
- * <p> qpid_url = "qpid:" [client_props "@"] port_addr_list ["/" future-parameters]
- * <p> port_addr_list = [port_addr ","]* port_addr
- * <p> port_addr = tcp_port_addr | tls_prot_addr | future_prot_addr
- * <p> tcp_port_addr = tcp_id tcp_addr
- * <p> tcp_id = "tcp:" | ""
- * <p> tcp_addr = host [":" port]
- * <p> host = <as per http://www.apps.ietf.org/>
- * <p> port = number
- * <p> tls_prot_addr = tls_id tls_addr
- * <p> tls_id = "tls:" | ""
- * <p> tls_addr = host [":" port]
- * <p> future_prot_addr = future_prot_id future_prot_addr
- * <p> future_prot_id = <placeholder, must end in ":". Example "sctp:">
- * <p> future_prot_addr = <placeholder, protocl-specific address>
- * <p> future_parameters = <placeholder, not used in failover addresses>
- * <p> client_props = [client_prop ";"]* client_prop
- * <p> client_prop = prop "=" val
- * <p> prop = chars as per <as per http://www.apps.ietf.org/>
- * <p> val = valid as per <as per http://www.apps.ietf.org/>
- * <p/>
- * Ex: qpid:virtualhost=tcp:host-foo,test,client_id=foo@tcp:myhost.com:5672,virtualhost=prod;
- * keystore=/opt/keystore@client_id2@tls:mysecurehost.com:5672
- */
-public class URLParser_0_10
-{
- private static final char[] URL_START_SEQ = new char[]{'q', 'p', 'i', 'd', ':'};
- private static final char PROPERTY_EQUALS_CHAR = '=';
- private static final char PROPERTY_SEPARATOR_CHAR = ';';
- private static final char ADDRESS_SEPERATOR_CHAR = ',';
-
- //private static final char CLIENT_ID_TRANSPORT_SEPARATOR_CHAR = ':';
- private static final char TRANSPORT_HOST_SEPARATOR_CHAR = ':';
- private static final char HOST_PORT_SEPARATOR_CHAR = ':';
- private static final char AT_CHAR = '@';
- private static final char END_OF_URL_MARKER = '^';
-
- enum URLParserState
- {
- QPID_URL_START,
- ADDRESS_START,
- PROPERTY_NAME,
- PROPERTY_EQUALS,
- PROPERTY_VALUE,
- PROPERTY_SEPARATOR,
- AT_CHAR,
- TRANSPORT,
- TRANSPORT_HOST_SEPARATOR,
- HOST,
- HOST_PORT_SEPARATOR,
- PORT,
- ADDRESS_END,
- ADDRESS_SEPERATOR,
- QPID_URL_END,
- ERROR
- }
-
- //-- Constructors
-
- private char[] _url;
- private List<BrokerDetails> _brokerDetailList = new ArrayList<BrokerDetails>();
- private String _error;
- private int _index = 0;
- private BrokerDetails _currentBroker;
- private String _currentPropName;
- private boolean _endOfURL = false;
- private URLParserState _currentParserState;
-
- public URLParser_0_10(String url) throws MalformedURLException
- {
- _url = (url + END_OF_URL_MARKER).toCharArray();
- _endOfURL = false;
- _currentParserState = URLParserState.QPID_URL_START;
- URLParserState prevState = _currentParserState; // for error handling
- try
- {
- while (_currentParserState != URLParserState.ERROR && _currentParserState != URLParserState.QPID_URL_END)
- {
- prevState = _currentParserState;
- _currentParserState = next();
- }
-
- if (_currentParserState == URLParserState.ERROR)
- {
- _error =
- "Invalid URL format [current_state = " + prevState + ", broker details parsed so far " + _currentBroker + " ] error at (" + _index + ") due to " + _error;
- MalformedURLException ex;
- ex = new MalformedURLException(_error);
- throw ex;
- }
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- _error = "Invalid URL format [current_state = " + prevState + ", broker details parsed so far " + _currentBroker + " ] error at (" + _index + ")";
- MalformedURLException ex = new MalformedURLException(_error);
- throw ex;
- }
- }
-
- //-- interface QpidURL
- public List<BrokerDetails> getAllBrokerDetails()
- {
- return _brokerDetailList;
- }
-
- public String getURL()
- {
- return new String(_url);
- }
-
- private URLParserState next()
- {
- switch (_currentParserState)
- {
- case QPID_URL_START:
- return checkSequence(URL_START_SEQ, URLParserState.ADDRESS_START);
- case ADDRESS_START:
- return startAddress();
- case PROPERTY_NAME:
- return extractPropertyName();
- case PROPERTY_EQUALS:
- _index++; // skip the equal sign
- return URLParserState.PROPERTY_VALUE;
- case PROPERTY_VALUE:
- return extractPropertyValue();
- case PROPERTY_SEPARATOR:
- _index++; // skip ","
- return URLParserState.PROPERTY_NAME;
- case AT_CHAR:
- _index++; // skip the @ sign
- return URLParserState.TRANSPORT;
- case TRANSPORT:
- return extractTransport();
- case TRANSPORT_HOST_SEPARATOR:
- _index++; // skip ":"
- return URLParserState.HOST;
- case HOST:
- return extractHost();
- case HOST_PORT_SEPARATOR:
- _index++; // skip ":"
- return URLParserState.PORT;
- case PORT:
- return extractPort();
- case ADDRESS_END:
- return endAddress();
- case ADDRESS_SEPERATOR:
- _index++; // skip ","
- return URLParserState.ADDRESS_START;
- default:
- return URLParserState.ERROR;
- }
- }
-
- private URLParserState checkSequence(char[] expected, URLParserState nextPart)
- {
- for (char expectedChar : expected)
- {
- if (expectedChar != _url[_index])
- {
- _error = "Excepted (" + expectedChar + ") at position " + _index + ", got (" + _url[_index] + ")";
- return URLParserState.ERROR;
- }
- _index++;
- }
- return nextPart;
- }
-
- private URLParserState startAddress()
- {
- _currentBroker = new AMQBrokerDetails();
-
- for (int j = _index; j < _url.length; j++)
- {
- if (_url[j] == PROPERTY_EQUALS_CHAR)
- {
- return URLParserState.PROPERTY_NAME;
- }
- else if (_url[j] == ADDRESS_SEPERATOR_CHAR)
- {
- return URLParserState.TRANSPORT;
- }
- }
- return URLParserState.TRANSPORT;
- }
-
- private URLParserState endAddress()
- {
- _brokerDetailList.add(_currentBroker);
- if (_endOfURL)
- {
- return URLParserState.QPID_URL_END;
- }
- else
- {
- return URLParserState.ADDRESS_SEPERATOR;
- }
- }
-
- private URLParserState extractPropertyName()
- {
- StringBuilder b = new StringBuilder();
- char next = _url[_index];
- while (next != PROPERTY_EQUALS_CHAR && next != AT_CHAR)
- {
- b.append(next);
- next = _url[++_index];
- }
- _currentPropName = b.toString();
- if (_currentPropName.trim().equals(""))
- {
- _error = "Property name cannot be empty";
- return URLParserState.ERROR;
- }
- else if (next == PROPERTY_EQUALS_CHAR)
- {
- return URLParserState.PROPERTY_EQUALS;
- }
- else
- {
- return URLParserState.AT_CHAR;
- }
- }
-
- private URLParserState extractPropertyValue()
- {
- StringBuilder b = new StringBuilder();
- char next = _url[_index];
- while (next != PROPERTY_SEPARATOR_CHAR && next != AT_CHAR)
- {
- b.append(next);
- next = _url[++_index];
- }
- String propValue = b.toString();
- if (propValue.trim().equals(""))
- {
- _error = "Property values cannot be empty";
- return URLParserState.ERROR;
- }
- else
- {
- _currentBroker.setProperty(_currentPropName, propValue);
- if (next == PROPERTY_SEPARATOR_CHAR)
- {
- return URLParserState.PROPERTY_SEPARATOR;
- }
- else
- {
- return URLParserState.AT_CHAR;
- }
- }
- }
-
- private URLParserState extractTransport()
- {
- String transport = buildUntil(TRANSPORT_HOST_SEPARATOR_CHAR);
- if (transport.trim().equals(""))
- {
- _error = "Transport cannot be empty";
- return URLParserState.ERROR;
- }
- else if (!(transport.trim().equals(BrokerDetails.PROTOCOL_TCP) || transport.trim()
- .equals(BrokerDetails.PROTOCOL_TLS)))
- {
- _error = "Transport cannot be " + transport + " value must be tcp or tls";
- return URLParserState.ERROR;
- }
- else
- {
- _currentBroker.setTransport(transport);
- return URLParserState.TRANSPORT_HOST_SEPARATOR;
- }
- }
-
- private URLParserState extractHost()
- {
- char nextSep = 'c';
- String host;
- URLParserState nextState;
-
- for (int i = _index; i < _url.length; i++)
- {
- if (_url[i] == HOST_PORT_SEPARATOR_CHAR)
- {
- nextSep = HOST_PORT_SEPARATOR_CHAR;
- break;
- }
- else if (_url[i] == ADDRESS_SEPERATOR_CHAR)
- {
- nextSep = ADDRESS_SEPERATOR_CHAR;
- break;
- }
- }
-
- if (nextSep == HOST_PORT_SEPARATOR_CHAR)
- {
- host = buildUntil(HOST_PORT_SEPARATOR_CHAR);
- nextState = URLParserState.HOST_PORT_SEPARATOR;
- }
- else if (nextSep == ADDRESS_SEPERATOR_CHAR)
- {
- host = buildUntil(ADDRESS_SEPERATOR_CHAR);
- nextState = URLParserState.ADDRESS_END;
- }
- else
- {
- host = buildUntil(END_OF_URL_MARKER);
- nextState = URLParserState.ADDRESS_END;
- _endOfURL = true;
- }
-
- if (host.trim().equals(""))
- {
- _error = "Host cannot be empty";
- return URLParserState.ERROR;
- }
- else
- {
- _currentBroker.setHost(host);
- return nextState;
- }
- }
-
-
- private URLParserState extractPort()
- {
-
- StringBuilder b = new StringBuilder();
- try
- {
- char next = _url[_index];
- while (next != ADDRESS_SEPERATOR_CHAR && next != END_OF_URL_MARKER )
- {
- b.append(next);
- next = _url[++_index];
- }
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- _endOfURL = true;
- }
- String portStr = b.toString();
- if (portStr.trim().equals(""))
- {
- _error = "Host cannot be empty";
- return URLParserState.ERROR;
- }
- else
- {
- try
- {
- int port = Integer.parseInt(portStr);
- _currentBroker.setPort(port);
- if( _url[_index] == END_OF_URL_MARKER )
- {
- _endOfURL = true;
- }
- return URLParserState.ADDRESS_END;
- }
- catch (NumberFormatException e)
- {
- _error = "Illegal number for port";
- return URLParserState.ERROR;
- }
- }
- }
-
- private String buildUntil(char c)
- {
- StringBuilder b = new StringBuilder();
- char next = _url[_index];
- while (next != c)
- {
- b.append(next);
- next = _url[++_index];
- }
- return b.toString();
- }
-
- public static void main(String[] args)
- {
- String testurl = "qpid:password=pass;username=name@tcp:test1";
- try
- {
- URLParser_0_10 impl = new URLParser_0_10(testurl);
- for (BrokerDetails d : impl.getAllBrokerDetails())
- {
- System.out.println(d);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/util/BlockingWaiter.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/util/BlockingWaiter.java
deleted file mode 100644
index 67cda957fb..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/util/BlockingWaiter.java
+++ /dev/null
@@ -1,348 +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.
- *
- */
-package org.apache.qpid.client.util;
-
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQTimeoutException;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.protocol.AMQMethodListener;
-
-/**
- * BlockingWaiter is a 'rendezvous' which delegates handling of
- * incoming Objects to a listener implemented as a sub-class of this and hands off the process or
- * error to a consumer. The producer of the event does not have to wait for the consumer to take the event, so this
- * differs from a 'rendezvous' in that sense.
- *
- * <p/>BlockingWaiters are used to coordinate when waiting for an an event that expect a response.
- * They are always used in a 'one-shot' manner, that is, to recieve just one response. Usually the caller has to register
- * them as method listeners with an event dispatcher and remember to de-register them (in a finally block) once they
- * have been completed.
- *
- * <p/>The {@link #process} must return <tt>true</tt> on any incoming method that it handles. This indicates to
- * this listeners that the object just processed ends the waiting process.
- *
- * <p/>Errors from the producer are rethrown to the consumer.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations </td>
- * <tr><td> Accept generic objects as events for processing via {@link #process}. <td>
- * <tr><td> Delegate handling and undserstanding of the object to a concrete implementation. <td>
- * <tr><td> Block until {@link #process} determines that waiting is no longer required <td>
- * <tr><td> Propagate the most recent exception to the consumer.<td>
- * </table>
- *
- * @todo Interuption is caught but not handled. This could be allowed to fall through. This might actually be usefull
- * for fail-over where a thread is blocking when failure happens, it could be interrupted to abandon or retry
- * when this happens. At the very least, restore the interrupted status flag.
- * @todo If the retrotranslator can handle it, could use a SynchronousQueue to implement this rendezvous. Need to
- * check that SynchronousQueue has a non-blocking put method available.
- */
-public abstract class BlockingWaiter<T>
-{
- /** This flag is used to indicate that the blocked for method has been received. */
- private volatile boolean _ready = false;
-
- /** This flag is used to indicate that the received error has been processed. */
- private volatile boolean _errorAck = false;
-
- /** Used to protect the shared event and ready flag between the producer and consumer. */
- private final ReentrantLock _lock = new ReentrantLock();
-
- /** Used to signal that a method has been received */
- private final Condition _receivedCondition = _lock.newCondition();
-
- /** Used to signal that a error has been processed */
- private final Condition _errorConditionAck = _lock.newCondition();
-
- /** Used to hold the most recent exception that is passed to the {@link #error(Exception)} method. */
- private volatile Exception _error;
-
- /** Holds the incomming Object. */
- protected Object _doneObject = null;
- private AtomicBoolean _waiting = new AtomicBoolean(false);
- private boolean _closed = false;
-
- /**
- * Delegates processing of the incomming object to the handler.
- *
- * @param object The object to process.
- *
- * @return <tt>true</tt> if the waiting is complete, <tt>false</tt> if waiting should continue.
- */
- public abstract boolean process(T object);
-
- /**
- * An Object has been received and should be processed to see if our wait condition has been reached.
- *
- * @param object The object received.
- *
- * @return <tt>true</tt> if the waiting is complete, <tt>false</tt> if waiting should continue.
- */
- public boolean received(T object)
- {
-
- boolean ready = process(object);
-
- if (ready)
- {
- // we only update the flag from inside the synchronized block
- // so that the blockForFrame method cannot "miss" an update - it
- // will only ever read the flag from within the synchronized block
- _lock.lock();
- try
- {
- _doneObject = object;
- _ready = ready;
- _receivedCondition.signal();
- }
- finally
- {
- _lock.unlock();
- }
- }
-
- return ready;
- }
-
- /**
- * Blocks until an object is received that is handled by process, or the specified timeout
- * has passed.
- *
- * Once closed any attempt to wait will throw an exception.
- *
- * @param timeout The timeout in milliseconds.
- *
- * @return The object that resolved the blocking.
- *
- * @throws AMQException
- * @throws FailoverException
- */
- public Object block(long timeout) throws AMQException, FailoverException
- {
- long nanoTimeout = TimeUnit.MILLISECONDS.toNanos(timeout);
-
- _lock.lock();
-
- try
- {
- if (_closed)
- {
- throw throwClosedException();
- }
-
- if (_error == null)
- {
- _waiting.set(true);
-
- while (!_ready)
- {
- try
- {
- if (timeout == -1)
- {
- _receivedCondition.await();
- }
- else
- {
- nanoTimeout = _receivedCondition.awaitNanos(nanoTimeout);
-
- if (nanoTimeout <= 0 && !_ready && _error == null)
- {
- _error = new AMQTimeoutException("Server did not respond in a timely fashion", null);
- _ready = true;
- }
- }
- }
- catch (InterruptedException e)
- {
- System.err.println(e.getMessage());
- // IGNORE -- //fixme this isn't ideal as being interrupted isn't equivellant to sucess
- // if (!_ready && timeout != -1)
- // {
- // _error = new AMQException("Server did not respond timely");
- // _ready = true;
- // }
- }
- }
- }
-
- if (_error != null)
- {
- if (_error instanceof AMQException)
- {
- throw (AMQException) _error;
- }
- else if (_error instanceof FailoverException)
- {
- // This should ensure that FailoverException is not wrapped and can be caught.
- throw (FailoverException) _error; // needed to expose FailoverException.
- }
- else
- {
- throw new AMQException("Woken up due to " + _error.getClass(), _error);
- }
- }
-
- }
- finally
- {
- _waiting.set(false);
-
- //Release Error handling thread
- if (_error != null)
- {
- _errorAck = true;
- _errorConditionAck.signal();
-
- _error = null;
- }
- _lock.unlock();
- }
-
- return _doneObject;
- }
-
- /**
- * This is a callback, called when an error has occured that should interupt any waiter.
- * It is also called from within this class to avoid code repetition but it should only be called by the MINA threads.
- *
- * Once closed any notification of an exception will be ignored.
- *
- * @param e The exception being propogated.
- */
- public void error(Exception e)
- {
- // set the error so that the thread that is blocking (against blockForFrame())
- // can pick up the exception and rethrow to the caller
-
- _lock.lock();
-
- if (_closed)
- {
- return;
- }
-
- if (_error == null)
- {
- _error = e;
- }
- else
- {
- System.err.println("WARNING: new error arrived while old one not yet processed");
- }
-
- try
- {
- if (_waiting.get())
- {
-
- _ready = true;
- _receivedCondition.signal();
-
- while (!_errorAck)
- {
- try
- {
- _errorConditionAck.await();
- }
- catch (InterruptedException e1)
- {
- System.err.println(e.getMessage());
- }
- }
- _errorAck = false;
- }
- }
- finally
- {
- _lock.unlock();
- }
- }
-
- /**
- * Close this Waiter so that no more errors are processed.
- * This is a preventative method to ensure that a second error thread does not get stuck in the error method after
- * the await has returned. This has not happend but in practise but if two errors occur on the Connection at
- * the same time then it is conceiveably possible for the second to get stuck if the first one is processed by a
- * waiter.
- *
- * Once closed any attempt to wait will throw an exception.
- * Any notification of an exception will be ignored.
- */
- public void close()
- {
- _lock.lock();
- try
- {
- //if we have already closed then our job is done.
- if (_closed)
- {
- return;
- }
-
- //Close Waiter so no more exceptions are processed
- _closed = true;
-
- //Wake up any await() threads
-
- //If we are waiting then use the error() to wake them up.
- if (_waiting.get())
- {
- error(throwClosedException());
- }
- //If they are not waiting then there is nothing to do.
-
- // Wake up any error handling threads
-
- if (!_errorAck)
- {
- _errorAck = true;
- _errorConditionAck.signal();
-
- _error = null;
- }
- }
- finally
- {
- _lock.unlock();
- }
- }
-
- /**
- * Helper method to generate the a closed Exception.
- *
- * todo: This should be converted to something more friendly.
- *
- * @return AMQException to throw to waiters when the Waiter is closed.
- */
- private AMQException throwClosedException()
- {
- return new AMQException(null, "Waiter was closed.", null);
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java
deleted file mode 100644
index bddbc329ab..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java
+++ /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.
- *
- */
-package org.apache.qpid.client.util;
-
-import java.util.Iterator;
-import java.util.Queue;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-/**
- * A blocking queue that emits events above a user specified threshold allowing the caller to take action (e.g. flow
- * control) to try to prevent the queue growing (much) further. The underlying queue itself is not bounded therefore the
- * caller is not obliged to react to the events. <p/> This implementation is <b>only</b> safe where we have a single
- * thread adding items and a single (different) thread removing items.
- *
- * @todo Make this implement java.util.Queue and hide the implementation. Then different queue types can be substituted.
- */
-public class FlowControllingBlockingQueue
-{
- /** This queue is bounded and is used to store messages before being dispatched to the consumer */
- private final Queue _queue = new ConcurrentLinkedQueue();
-
- private final int _flowControlHighThreshold;
- private final int _flowControlLowThreshold;
-
- private final ThresholdListener _listener;
-
- /** We require a separate count so we can track whether we have reached the threshold */
- private int _count;
-
- public boolean isEmpty()
- {
- return _queue.isEmpty();
- }
-
- public interface ThresholdListener
- {
- void aboveThreshold(int currentValue);
-
- void underThreshold(int currentValue);
- }
-
- public FlowControllingBlockingQueue(int threshold, ThresholdListener listener)
- {
- this(threshold, threshold, listener);
- }
-
- public FlowControllingBlockingQueue(int highThreshold, int lowThreshold, ThresholdListener listener)
- {
- _flowControlHighThreshold = highThreshold;
- _flowControlLowThreshold = lowThreshold;
- _listener = listener;
- }
-
- public Object take() throws InterruptedException
- {
- Object o = _queue.poll();
- if(o == null)
- {
- synchronized(this)
- {
- while((o = _queue.poll())==null)
- {
- wait();
- }
- }
- }
- if (_listener != null)
- {
- synchronized (_listener)
- {
- if (_count-- == _flowControlLowThreshold)
- {
- _listener.underThreshold(_count);
- }
- }
- }
-
- return o;
- }
-
- public void add(Object o)
- {
- synchronized(this)
- {
- _queue.add(o);
-
- notifyAll();
- }
- if (_listener != null)
- {
- synchronized (_listener)
- {
- if (++_count == _flowControlHighThreshold)
- {
- _listener.aboveThreshold(_count);
- }
- }
- }
- }
-
- public Iterator iterator()
- {
- return _queue.iterator();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java
deleted file mode 100644
index dc0d9b8c78..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java
+++ /dev/null
@@ -1,60 +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.
- *
- */
-package org.apache.qpid.client.vmbroker;
-
-import org.apache.qpid.client.transport.AMQTransportConnectionException;
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQVMBrokerCreationException represents failure to create an in VM broker on the vm transport medium.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent failure to create an in VM broker.
- * </table>
- *
- * @todo Error code never used. This is not an AMQException.
- */
-public class AMQVMBrokerCreationException extends AMQTransportConnectionException
-{
- private int _port;
-
- /**
- * @param port
- *
- * @deprecated
- */
- public AMQVMBrokerCreationException(int port)
- {
- this(null, port, "Unable to create vm broker", null);
- }
-
- public AMQVMBrokerCreationException(AMQConstant errorCode, int port, String message, Throwable cause)
- {
- super(errorCode, message, cause);
- _port = port;
- }
-
- public String toString()
- {
- return super.toString() + " on port " + _port;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ArithmeticExpression.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ArithmeticExpression.java
deleted file mode 100644
index 56d1bdcdc5..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ArithmeticExpression.java
+++ /dev/null
@@ -1,268 +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.
- */
-package org.apache.qpid.filter;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-
-
-/**
- * An expression which performs an operation on two expression values
- */
-public abstract class ArithmeticExpression extends BinaryExpression
-{
-
- protected static final int INTEGER = 1;
- protected static final int LONG = 2;
- protected static final int DOUBLE = 3;
-
-
- public ArithmeticExpression(Expression left, Expression right)
- {
- super(left, right);
- }
-
- public static Expression createPlus(Expression left, Expression right)
- {
- return new ArithmeticExpression(left, right)
- {
- protected Object evaluate(Object lvalue, Object rvalue)
- {
- if (lvalue instanceof String)
- {
- String text = (String) lvalue;
- return text + rvalue;
- }
- else if (lvalue instanceof Number)
- {
- return plus((Number) lvalue, asNumber(rvalue));
- }
-
- throw new RuntimeException("Cannot call plus operation on: " + lvalue + " and: " + rvalue);
- }
-
- public String getExpressionSymbol()
- {
- return "+";
- }
- };
- }
-
- public static Expression createMinus(Expression left, Expression right)
- {
- return new ArithmeticExpression(left, right)
- {
- protected Object evaluate(Object lvalue, Object rvalue)
- {
- if (lvalue instanceof Number)
- {
- return minus((Number) lvalue, asNumber(rvalue));
- }
-
- throw new RuntimeException("Cannot call minus operation on: " + lvalue + " and: " + rvalue);
- }
-
- public String getExpressionSymbol()
- {
- return "-";
- }
- };
- }
-
- public static Expression createMultiply(Expression left, Expression right)
- {
- return new ArithmeticExpression(left, right)
- {
-
- protected Object evaluate(Object lvalue, Object rvalue)
- {
- if (lvalue instanceof Number)
- {
- return multiply((Number) lvalue, asNumber(rvalue));
- }
-
- throw new RuntimeException("Cannot call multiply operation on: " + lvalue + " and: " + rvalue);
- }
-
- public String getExpressionSymbol()
- {
- return "*";
- }
- };
- }
-
- public static Expression createDivide(Expression left, Expression right)
- {
- return new ArithmeticExpression(left, right)
- {
-
- protected Object evaluate(Object lvalue, Object rvalue)
- {
- if (lvalue instanceof Number)
- {
- return divide((Number) lvalue, asNumber(rvalue));
- }
-
- throw new RuntimeException("Cannot call divide operation on: " + lvalue + " and: " + rvalue);
- }
-
- public String getExpressionSymbol()
- {
- return "/";
- }
- };
- }
-
- public static Expression createMod(Expression left, Expression right)
- {
- return new ArithmeticExpression(left, right)
- {
-
- protected Object evaluate(Object lvalue, Object rvalue)
- {
- if (lvalue instanceof Number)
- {
- return mod((Number) lvalue, asNumber(rvalue));
- }
-
- throw new RuntimeException("Cannot call mod operation on: " + lvalue + " and: " + rvalue);
- }
-
- public String getExpressionSymbol()
- {
- return "%";
- }
- };
- }
-
- protected Number plus(Number left, Number right)
- {
- switch (numberType(left, right))
- {
-
- case ArithmeticExpression.INTEGER:
- return new Integer(left.intValue() + right.intValue());
-
- case ArithmeticExpression.LONG:
- return new Long(left.longValue() + right.longValue());
-
- default:
- return new Double(left.doubleValue() + right.doubleValue());
- }
- }
-
- protected Number minus(Number left, Number right)
- {
- switch (numberType(left, right))
- {
-
- case ArithmeticExpression.INTEGER:
- return new Integer(left.intValue() - right.intValue());
-
- case ArithmeticExpression.LONG:
- return new Long(left.longValue() - right.longValue());
-
- default:
- return new Double(left.doubleValue() - right.doubleValue());
- }
- }
-
- protected Number multiply(Number left, Number right)
- {
- switch (numberType(left, right))
- {
-
- case ArithmeticExpression.INTEGER:
- return new Integer(left.intValue() * right.intValue());
-
- case ArithmeticExpression.LONG:
- return new Long(left.longValue() * right.longValue());
-
- default:
- return new Double(left.doubleValue() * right.doubleValue());
- }
- }
-
- protected Number divide(Number left, Number right)
- {
- return new Double(left.doubleValue() / right.doubleValue());
- }
-
- protected Number mod(Number left, Number right)
- {
- return new Double(left.doubleValue() % right.doubleValue());
- }
-
- private int numberType(Number left, Number right)
- {
- if (isDouble(left) || isDouble(right))
- {
- return ArithmeticExpression.DOUBLE;
- }
- else if ((left instanceof Long) || (right instanceof Long))
- {
- return ArithmeticExpression.LONG;
- }
- else
- {
- return ArithmeticExpression.INTEGER;
- }
- }
-
- private boolean isDouble(Number n)
- {
- return (n instanceof Float) || (n instanceof Double);
- }
-
- protected Number asNumber(Object value)
- {
- if (value instanceof Number)
- {
- return (Number) value;
- }
- else
- {
- throw new RuntimeException("Cannot convert value: " + value + " into a number");
- }
- }
-
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
- Object lvalue = left.evaluate(message);
- if (lvalue == null)
- {
- return null;
- }
-
- Object rvalue = right.evaluate(message);
- if (rvalue == null)
- {
- return null;
- }
-
- return evaluate(lvalue, rvalue);
- }
-
- /**
- * @param lvalue
- * @param rvalue
- * @return
- */
- protected abstract Object evaluate(Object lvalue, Object rvalue);
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/BinaryExpression.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/BinaryExpression.java
deleted file mode 100644
index f97f858fad..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/BinaryExpression.java
+++ /dev/null
@@ -1,103 +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.
- */
-package org.apache.qpid.filter;
-
-/**
- * An expression which performs an operation on two expression values.
- */
-public abstract class BinaryExpression implements Expression
-{
- protected Expression left;
- protected Expression right;
-
- public BinaryExpression(Expression left, Expression right)
- {
- this.left = left;
- this.right = right;
- }
-
- public Expression getLeft()
- {
- return left;
- }
-
- public Expression getRight()
- {
- return right;
- }
-
- /**
- * @see Object#toString()
- */
- public String toString()
- {
- return "(" + left.toString() + " " + getExpressionSymbol() + " " + right.toString() + ")";
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see Object#hashCode()
- */
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see Object#equals(Object)
- */
- public boolean equals(Object o)
- {
-
- if ((o == null) || !this.getClass().equals(o.getClass()))
- {
- return false;
- }
-
- return toString().equals(o.toString());
-
- }
-
- /**
- * Returns the symbol that represents this binary expression. For example, addition is
- * represented by "+"
- *
- * @return
- */
- public abstract String getExpressionSymbol();
-
- /**
- * @param expression
- */
- public void setRight(Expression expression)
- {
- right = expression;
- }
-
- /**
- * @param expression
- */
- public void setLeft(Expression expression)
- {
- left = expression;
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/BooleanExpression.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/BooleanExpression.java
deleted file mode 100644
index cc24c81729..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/BooleanExpression.java
+++ /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.
- */
-package org.apache.qpid.filter;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-
-
-/**
- * A BooleanExpression is an expression that always
- * produces a Boolean result.
- */
-public interface BooleanExpression extends Expression
-{
-
- public boolean matches(AbstractJMSMessage message) throws QpidException;
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ComparisonExpression.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ComparisonExpression.java
deleted file mode 100644
index adf360698b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ComparisonExpression.java
+++ /dev/null
@@ -1,589 +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.
- */
-package org.apache.qpid.filter;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.regex.Pattern;
-
-/**
- * A filter performing a comparison of two objects
- */
-public abstract class ComparisonExpression extends BinaryExpression implements BooleanExpression
-{
-
- public static BooleanExpression createBetween(Expression value, Expression left, Expression right)
- {
- return LogicExpression.createAND(ComparisonExpression.createGreaterThanEqual(value, left), ComparisonExpression.createLessThanEqual(value, right));
- }
-
- public static BooleanExpression createNotBetween(Expression value, Expression left, Expression right)
- {
- return LogicExpression.createOR(ComparisonExpression.createLessThan(value, left), ComparisonExpression.createGreaterThan(value, right));
- }
-
- private static final HashSet REGEXP_CONTROL_CHARS = new HashSet();
-
- static
- {
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('.'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('\\'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('['));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character(']'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('^'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('$'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('?'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('*'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('+'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('{'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('}'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('|'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('('));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character(')'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character(':'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('&'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('<'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('>'));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('='));
- ComparisonExpression.REGEXP_CONTROL_CHARS.add(new Character('!'));
- }
-
- static class LikeExpression extends UnaryExpression implements BooleanExpression
- {
-
- Pattern likePattern;
-
- /**
- * @param right
- */
- public LikeExpression(Expression right, String like, int escape)
- {
- super(right);
-
- StringBuffer regexp = new StringBuffer(like.length() * 2);
- regexp.append("\\A"); // The beginning of the input
- for (int i = 0; i < like.length(); i++)
- {
- char c = like.charAt(i);
- if (escape == (0xFFFF & c))
- {
- i++;
- if (i >= like.length())
- {
- // nothing left to escape...
- break;
- }
-
- char t = like.charAt(i);
- regexp.append("\\x");
- regexp.append(Integer.toHexString(0xFFFF & t));
- }
- else if (c == '%')
- {
- regexp.append(".*?"); // Do a non-greedy match
- }
- else if (c == '_')
- {
- regexp.append("."); // match one
- }
- else if (ComparisonExpression.REGEXP_CONTROL_CHARS.contains(new Character(c)))
- {
- regexp.append("\\x");
- regexp.append(Integer.toHexString(0xFFFF & c));
- }
- else
- {
- regexp.append(c);
- }
- }
-
- regexp.append("\\z"); // The end of the input
-
- likePattern = Pattern.compile(regexp.toString(), Pattern.DOTALL);
- }
-
- /**
- * org.apache.activemq.filter.UnaryExpression#getExpressionSymbol()
- */
- public String getExpressionSymbol()
- {
- return "LIKE";
- }
-
- /**
- * org.apache.activemq.filter.Expression#evaluate(MessageEvaluationContext)
- */
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
-
- Object rv = this.getRight().evaluate(message);
-
- if (rv == null)
- {
- return null;
- }
-
- if (!(rv instanceof String))
- {
- return
- Boolean.FALSE;
- // throw new RuntimeException("LIKE can only operate on String identifiers. LIKE attemped on: '" + rv.getClass());
- }
-
- return likePattern.matcher((String) rv).matches() ? Boolean.TRUE : Boolean.FALSE;
- }
-
- public boolean matches(AbstractJMSMessage message) throws QpidException
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
- }
-
- public static BooleanExpression createLike(Expression left, String right, String escape)
- {
- if ((escape != null) && (escape.length() != 1))
- {
- throw new RuntimeException(
- "The ESCAPE string litteral is invalid. It can only be one character. Litteral used: " + escape);
- }
-
- int c = -1;
- if (escape != null)
- {
- c = 0xFFFF & escape.charAt(0);
- }
-
- return new LikeExpression(left, right, c);
- }
-
- public static BooleanExpression createNotLike(Expression left, String right, String escape)
- {
- return UnaryExpression.createNOT(ComparisonExpression.createLike(left, right, escape));
- }
-
- public static BooleanExpression createInFilter(Expression left, List elements)
- {
-
- if (!(left instanceof PropertyExpression))
- {
- throw new RuntimeException("Expected a property for In expression, got: " + left);
- }
-
- return UnaryExpression.createInExpression((PropertyExpression) left, elements, false);
-
- }
-
- public static BooleanExpression createNotInFilter(Expression left, List elements)
- {
-
- if (!(left instanceof PropertyExpression))
- {
- throw new RuntimeException("Expected a property for In expression, got: " + left);
- }
-
- return UnaryExpression.createInExpression((PropertyExpression) left, elements, true);
-
- }
-
- public static BooleanExpression createIsNull(Expression left)
- {
- return ComparisonExpression.doCreateEqual(left, ConstantExpression.NULL);
- }
-
- public static BooleanExpression createIsNotNull(Expression left)
- {
- return UnaryExpression.createNOT(ComparisonExpression.doCreateEqual(left, ConstantExpression.NULL));
- }
-
- public static BooleanExpression createNotEqual(Expression left, Expression right)
- {
- return UnaryExpression.createNOT(ComparisonExpression.createEqual(left, right));
- }
-
- public static BooleanExpression createEqual(Expression left, Expression right)
- {
- ComparisonExpression.checkEqualOperand(left);
- ComparisonExpression.checkEqualOperand(right);
- ComparisonExpression.checkEqualOperandCompatability(left, right);
-
- return ComparisonExpression.doCreateEqual(left, right);
- }
-
- private static BooleanExpression doCreateEqual(Expression left, Expression right)
- {
- return new ComparisonExpression(left, right)
- {
-
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
- Object lv = left.evaluate(message);
- Object rv = right.evaluate(message);
-
- // Iff one of the values is null
- if ((lv == null) ^ (rv == null))
- {
- return Boolean.FALSE;
- }
-
- if ((lv == rv) || lv.equals(rv))
- {
- return Boolean.TRUE;
- }
-
- if ((lv instanceof Comparable) && (rv instanceof Comparable))
- {
- return compare((Comparable) lv, (Comparable) rv);
- }
-
- return Boolean.FALSE;
- }
-
- protected boolean asBoolean(int answer)
- {
- return answer == 0;
- }
-
- public String getExpressionSymbol()
- {
- return "=";
- }
- };
- }
-
- public static BooleanExpression createGreaterThan(final Expression left, final Expression right)
- {
- ComparisonExpression.checkLessThanOperand(left);
- ComparisonExpression.checkLessThanOperand(right);
-
- return new ComparisonExpression(left, right)
- {
- protected boolean asBoolean(int answer)
- {
- return answer > 0;
- }
-
- public String getExpressionSymbol()
- {
- return ">";
- }
- };
- }
-
- public static BooleanExpression createGreaterThanEqual(final Expression left, final Expression right)
- {
- ComparisonExpression.checkLessThanOperand(left);
- ComparisonExpression.checkLessThanOperand(right);
-
- return new ComparisonExpression(left, right)
- {
- protected boolean asBoolean(int answer)
- {
- return answer >= 0;
- }
-
- public String getExpressionSymbol()
- {
- return ">=";
- }
- };
- }
-
- public static BooleanExpression createLessThan(final Expression left, final Expression right)
- {
- ComparisonExpression.checkLessThanOperand(left);
- ComparisonExpression.checkLessThanOperand(right);
-
- return new ComparisonExpression(left, right)
- {
-
- protected boolean asBoolean(int answer)
- {
- return answer < 0;
- }
-
- public String getExpressionSymbol()
- {
- return "<";
- }
-
- };
- }
-
- public static BooleanExpression createLessThanEqual(final Expression left, final Expression right)
- {
- ComparisonExpression.checkLessThanOperand(left);
- ComparisonExpression.checkLessThanOperand(right);
-
- return new ComparisonExpression(left, right)
- {
-
- protected boolean asBoolean(int answer)
- {
- return answer <= 0;
- }
-
- public String getExpressionSymbol()
- {
- return "<=";
- }
- };
- }
-
- /**
- * Only Numeric expressions can be used in >, >=, < or <= expressions.s
- *
- * @param expr
- */
- public static void checkLessThanOperand(Expression expr)
- {
- if (expr instanceof ConstantExpression)
- {
- Object value = ((ConstantExpression) expr).getValue();
- if (value instanceof Number)
- {
- return;
- }
-
- // Else it's boolean or a String..
- throw new RuntimeException("Value '" + expr + "' cannot be compared.");
- }
-
- if (expr instanceof BooleanExpression)
- {
- throw new RuntimeException("Value '" + expr + "' cannot be compared.");
- }
- }
-
- /**
- * Validates that the expression can be used in == or <> expression.
- * Cannot not be NULL TRUE or FALSE litterals.
- *
- * @param expr
- */
- public static void checkEqualOperand(Expression expr)
- {
- if (expr instanceof ConstantExpression)
- {
- Object value = ((ConstantExpression) expr).getValue();
- if (value == null)
- {
- throw new RuntimeException("'" + expr + "' cannot be compared.");
- }
- }
- }
-
- /**
- *
- * @param left
- * @param right
- */
- private static void checkEqualOperandCompatability(Expression left, Expression right)
- {
- if ((left instanceof ConstantExpression) && (right instanceof ConstantExpression))
- {
- if ((left instanceof BooleanExpression) && !(right instanceof BooleanExpression))
- {
- throw new RuntimeException("'" + left + "' cannot be compared with '" + right + "'");
- }
- }
- }
-
- /**
- * @param left
- * @param right
- */
- public ComparisonExpression(Expression left, Expression right)
- {
- super(left, right);
- }
-
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
- Comparable lv = (Comparable) left.evaluate(message);
- if (lv == null)
- {
- return null;
- }
-
- Comparable rv = (Comparable) right.evaluate(message);
- if (rv == null)
- {
- return null;
- }
-
- return compare(lv, rv);
- }
-
- protected Boolean compare(Comparable lv, Comparable rv)
- {
- Class lc = lv.getClass();
- Class rc = rv.getClass();
- // If the the objects are not of the same type,
- // try to convert up to allow the comparison.
- if (lc != rc)
- {
- if (lc == Byte.class)
- {
- if (rc == Short.class)
- {
- lv = new Short(((Number) lv).shortValue());
- }
- else if (rc == Integer.class)
- {
- lv = new Integer(((Number) lv).intValue());
- }
- else if (rc == Long.class)
- {
- lv = new Long(((Number) lv).longValue());
- }
- else if (rc == Float.class)
- {
- lv = new Float(((Number) lv).floatValue());
- }
- else if (rc == Double.class)
- {
- lv = new Double(((Number) lv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else if (lc == Short.class)
- {
- if (rc == Integer.class)
- {
- lv = new Integer(((Number) lv).intValue());
- }
- else if (rc == Long.class)
- {
- lv = new Long(((Number) lv).longValue());
- }
- else if (rc == Float.class)
- {
- lv = new Float(((Number) lv).floatValue());
- }
- else if (rc == Double.class)
- {
- lv = new Double(((Number) lv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else if (lc == Integer.class)
- {
- if (rc == Long.class)
- {
- lv = new Long(((Number) lv).longValue());
- }
- else if (rc == Float.class)
- {
- lv = new Float(((Number) lv).floatValue());
- }
- else if (rc == Double.class)
- {
- lv = new Double(((Number) lv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else if (lc == Long.class)
- {
- if (rc == Integer.class)
- {
- rv = new Long(((Number) rv).longValue());
- }
- else if (rc == Float.class)
- {
- lv = new Float(((Number) lv).floatValue());
- }
- else if (rc == Double.class)
- {
- lv = new Double(((Number) lv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else if (lc == Float.class)
- {
- if (rc == Integer.class)
- {
- rv = new Float(((Number) rv).floatValue());
- }
- else if (rc == Long.class)
- {
- rv = new Float(((Number) rv).floatValue());
- }
- else if (rc == Double.class)
- {
- lv = new Double(((Number) lv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else if (lc == Double.class)
- {
- if (rc == Integer.class)
- {
- rv = new Double(((Number) rv).doubleValue());
- }
- else if (rc == Long.class)
- {
- rv = new Double(((Number) rv).doubleValue());
- }
- else if (rc == Float.class)
- {
- rv = new Float(((Number) rv).doubleValue());
- }
- else
- {
- return Boolean.FALSE;
- }
- }
- else
- {
- return Boolean.FALSE;
- }
- }
-
- return asBoolean(lv.compareTo(rv)) ? Boolean.TRUE : Boolean.FALSE;
- }
-
- protected abstract boolean asBoolean(int answer);
-
- public boolean matches(AbstractJMSMessage message) throws QpidException
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ConstantExpression.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ConstantExpression.java
deleted file mode 100644
index 447de914a4..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/ConstantExpression.java
+++ /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.
- */
-package org.apache.qpid.filter;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-
-import java.math.BigDecimal;
-
-/**
- * Represents a constant expression
- */
-public class ConstantExpression implements Expression
-{
-
- static class BooleanConstantExpression extends ConstantExpression implements BooleanExpression
- {
- public BooleanConstantExpression(Object value)
- {
- super(value);
- }
-
- public boolean matches(AbstractJMSMessage message) throws QpidException
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
- }
-
- public static final BooleanConstantExpression NULL = new BooleanConstantExpression(null);
- public static final BooleanConstantExpression TRUE = new BooleanConstantExpression(Boolean.TRUE);
- public static final BooleanConstantExpression FALSE = new BooleanConstantExpression(Boolean.FALSE);
-
- private Object value;
-
- public static ConstantExpression createFromDecimal(String text)
- {
-
- // Strip off the 'l' or 'L' if needed.
- if (text.endsWith("l") || text.endsWith("L"))
- {
- text = text.substring(0, text.length() - 1);
- }
-
- Number value;
- try
- {
- value = new Long(text);
- }
- catch (NumberFormatException e)
- {
- // The number may be too big to fit in a long.
- value = new BigDecimal(text);
- }
-
- long l = value.longValue();
- if ((Integer.MIN_VALUE <= l) && (l <= Integer.MAX_VALUE))
- {
- value = new Integer(value.intValue());
- }
-
- return new ConstantExpression(value);
- }
-
- public static ConstantExpression createFromHex(String text)
- {
- Number value = new Long(Long.parseLong(text.substring(2), 16));
- long l = value.longValue();
- if ((Integer.MIN_VALUE <= l) && (l <= Integer.MAX_VALUE))
- {
- value = new Integer(value.intValue());
- }
-
- return new ConstantExpression(value);
- }
-
- public static ConstantExpression createFromOctal(String text)
- {
- Number value = new Long(Long.parseLong(text, 8));
- long l = value.longValue();
- if ((Integer.MIN_VALUE <= l) && (l <= Integer.MAX_VALUE))
- {
- value = new Integer(value.intValue());
- }
-
- return new ConstantExpression(value);
- }
-
- public static ConstantExpression createFloat(String text)
- {
- Number value = new Double(text);
-
- return new ConstantExpression(value);
- }
-
- public ConstantExpression(Object value)
- {
- this.value = value;
- }
-
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
- return value;
- }
-
- public Object getValue()
- {
- return value;
- }
-
- /**
- * @see Object#toString()
- */
- public String toString()
- {
- if (value == null)
- {
- return "NULL";
- }
-
- if (value instanceof Boolean)
- {
- return ((Boolean) value).booleanValue() ? "TRUE" : "FALSE";
- }
-
- if (value instanceof String)
- {
- return ConstantExpression.encodeString((String) value);
- }
-
- return value.toString();
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see Object#hashCode()
- */
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see Object#equals(Object)
- */
- public boolean equals(Object o)
- {
-
- if ((o == null) || !this.getClass().equals(o.getClass()))
- {
- return false;
- }
-
- return toString().equals(o.toString());
-
- }
-
- /**
- * Encodes the value of string so that it looks like it would look like
- * when it was provided in a selector.
- *
- * @param s
- * @return
- */
- public static String encodeString(String s)
- {
- StringBuffer b = new StringBuffer();
- b.append('\'');
- for (int i = 0; i < s.length(); i++)
- {
- char c = s.charAt(i);
- if (c == '\'')
- {
- b.append(c);
- }
-
- b.append(c);
- }
-
- b.append('\'');
-
- return b.toString();
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/Expression.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/Expression.java
deleted file mode 100644
index e578775a77..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/Expression.java
+++ /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.
- */
-package org.apache.qpid.filter;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-
-
-/**
- * Represents an expression
- */
-public interface Expression
-{
- /**
- * @param message The message to evaluate
- * @return the value of this expression
- */
- public Object evaluate(AbstractJMSMessage message) throws QpidException;
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/JMSSelectorFilter.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/JMSSelectorFilter.java
deleted file mode 100644
index dcfb9a9940..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/JMSSelectorFilter.java
+++ /dev/null
@@ -1,70 +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.
- */
-package org.apache.qpid.filter;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.QpidException;
-import org.apache.qpid.filter.selector.SelectorParser;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-
-
-public class JMSSelectorFilter implements MessageFilter
-{
- /**
- * this JMSSelectorFilter's logger
- */
- private static final Logger _logger = LoggerFactory.getLogger(JMSSelectorFilter.class);
-
- private String _selector;
- private BooleanExpression _matcher;
-
- public JMSSelectorFilter(String selector) throws QpidException
- {
- _selector = selector;
- if (JMSSelectorFilter._logger.isDebugEnabled())
- {
- JMSSelectorFilter._logger.debug("Created JMSSelectorFilter with selector:" + _selector);
- }
- _matcher = new SelectorParser().parse(selector);
- }
-
- public boolean matches(AbstractJMSMessage message)
- {
- try
- {
- boolean match = _matcher.matches(message);
- if (JMSSelectorFilter._logger.isDebugEnabled())
- {
- JMSSelectorFilter._logger.debug(message + " match(" + match + ") selector(" + System
- .identityHashCode(_selector) + "):" + _selector);
- }
- return match;
- }
- catch (QpidException e)
- {
- JMSSelectorFilter._logger.warn("Caght exception when evaluating message selector for message " + message, e);
- }
- return false;
- }
-
- public String getSelector()
- {
- return _selector;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/LogicExpression.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/LogicExpression.java
deleted file mode 100644
index d7aabd5a46..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/LogicExpression.java
+++ /dev/null
@@ -1,108 +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.
- */
-package org.apache.qpid.filter;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-
-
-/**
- * A filter performing a comparison of two objects
- */
-public abstract class LogicExpression extends BinaryExpression implements BooleanExpression
-{
-
- public static BooleanExpression createOR(BooleanExpression lvalue, BooleanExpression rvalue)
- {
- return new LogicExpression(lvalue, rvalue)
- {
-
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
-
- Boolean lv = (Boolean) left.evaluate(message);
- // Can we do an OR shortcut??
- if ((lv != null) && lv.booleanValue())
- {
- return Boolean.TRUE;
- }
-
- Boolean rv = (Boolean) right.evaluate(message);
-
- return (rv == null) ? null : rv;
- }
-
- public String getExpressionSymbol()
- {
- return "OR";
- }
- };
- }
-
- public static BooleanExpression createAND(BooleanExpression lvalue, BooleanExpression rvalue)
- {
- return new LogicExpression(lvalue, rvalue)
- {
-
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
-
- Boolean lv = (Boolean) left.evaluate(message);
-
- // Can we do an AND shortcut??
- if (lv == null)
- {
- return null;
- }
-
- if (!lv.booleanValue())
- {
- return Boolean.FALSE;
- }
-
- Boolean rv = (Boolean) right.evaluate(message);
-
- return (rv == null) ? null : rv;
- }
-
- public String getExpressionSymbol()
- {
- return "AND";
- }
- };
- }
-
- /**
- * @param left
- * @param right
- */
- public LogicExpression(BooleanExpression left, BooleanExpression right)
- {
- super(left, right);
- }
-
- public abstract Object evaluate(AbstractJMSMessage message) throws QpidException;
-
- public boolean matches(AbstractJMSMessage message) throws QpidException
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/MessageFilter.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/MessageFilter.java
deleted file mode 100644
index a775080d81..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/MessageFilter.java
+++ /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.
- */
-package org.apache.qpid.filter;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-
-
-public interface MessageFilter
-{
- boolean matches(AbstractJMSMessage message) throws QpidException;
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/PropertyExpression.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/PropertyExpression.java
deleted file mode 100644
index 2c05f5ce0f..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/PropertyExpression.java
+++ /dev/null
@@ -1,279 +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.
- */
-package org.apache.qpid.filter;
-
-import org.apache.qpid.client.message.AbstractJMSMessage;
-import org.apache.qpid.QpidException;
-import org.apache.qpid.ErrorCode;
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
-import javax.jms.JMSException;
-import java.util.HashMap;
-
-/**
- * Represents a property expression
- */
-public class PropertyExpression implements Expression
-{
- // Constants - defined the same as JMS
- private static final int NON_PERSISTENT = 1;
- private static final int DEFAULT_PRIORITY = 4;
-
- private static final Logger _logger = LoggerFactory.getLogger(PropertyExpression.class);
-
- private static final HashMap<String, Expression> JMS_PROPERTY_EXPRESSIONS = new HashMap<String, Expression>();
-
- static
- {
- JMS_PROPERTY_EXPRESSIONS.put("JMSDestination", new Expression()
- {
- public Object evaluate(AbstractJMSMessage message)
- {
- //TODO
- return null;
- }
- });
- JMS_PROPERTY_EXPRESSIONS.put("JMSReplyTo", new Expression()
- {
- public Object evaluate(AbstractJMSMessage message)
- {
- return message.getReplyToString();
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSType", new Expression()
- {
- public Object evaluate(AbstractJMSMessage message)
- {
- try
- {
- return message.getJMSType();
- }
- catch (JMSException e)
- {
- _logger.warn("Error evaluating property", e);
-
- return null;
- }
-
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSDeliveryMode", new Expression()
- {
- public Object evaluate(AbstractJMSMessage message)
- {
- try
- {
- int mode = message.getJMSDeliveryMode();
- if (_logger.isDebugEnabled())
- {
- _logger.debug("JMSDeliveryMode is :" + mode);
- }
-
- return mode;
- }
- catch (JMSException e)
- {
- _logger.warn("Error evaluating property",e);
- }
-
- return NON_PERSISTENT;
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSPriority", new Expression()
- {
- public Object evaluate(AbstractJMSMessage message)
- {
- try
- {
- return message.getJMSPriority();
- }
- catch (Exception e)
- {
- _logger.warn("Error evaluating property",e);
- }
-
- return DEFAULT_PRIORITY;
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("AMQMessageID", new Expression()
- {
- public Object evaluate(AbstractJMSMessage message)
- {
-
- try
- {
- return message.getJMSMessageID();
- }
- catch (JMSException e)
- {
- _logger.warn("Error evaluating property",e);
-
- return null;
- }
-
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSTimestamp", new Expression()
- {
- public Object evaluate(AbstractJMSMessage message)
- {
- try
- {
- return message.getJMSTimestamp();
- }
- catch (Exception e)
- {
- _logger.warn("Error evaluating property",e);
-
- return null;
- }
-
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSCorrelationID", new Expression()
- {
- public Object evaluate(AbstractJMSMessage message)
- {
-
- try
- {
- return message.getJMSCorrelationID();
- }
- catch (JMSException e)
- {
- _logger.warn("Error evaluating property",e);
-
- return null;
- }
-
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSExpiration", new Expression()
- {
- public Object evaluate(AbstractJMSMessage message)
- {
-
- try
- {
- return message.getJMSExpiration();
- }
- catch (JMSException e)
- {
- _logger.warn("Error evaluating property",e);
- return null;
- }
-
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSRedelivered", new Expression()
- {
- public Object evaluate(AbstractJMSMessage message)
- {
- try
- {
- return message.getJMSRedelivered();
- }
- catch (JMSException e)
- {
- _logger.warn("Error evaluating property",e);
- return null;
- }
- }
- });
-
- }
-
- private final String name;
- private final Expression jmsPropertyExpression;
-
- public PropertyExpression(String name)
- {
- this.name = name;
- jmsPropertyExpression = JMS_PROPERTY_EXPRESSIONS.get(name);
- }
-
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
-
- if (jmsPropertyExpression != null)
- {
- return jmsPropertyExpression.evaluate(message);
- }
- else
- {
-
- try
- {
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Looking up property:" + name);
- _logger.debug("Properties are:" + message.getPropertyNames());
- }
- return message.getObjectProperty(name);
- }
- catch(JMSException e)
- {
- throw new QpidException("Exception evaluating properties for filter", ErrorCode.INTERNAL_ERROR, e);
- }
- }
- }
-
- public String getName()
- {
- return name;
- }
-
- /**
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return name;
- }
-
- /**
- * @see java.lang.Object#hashCode()
- */
- public int hashCode()
- {
- return name.hashCode();
- }
-
- /**
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object o)
- {
- if ((o == null) || !this.getClass().equals(o.getClass()))
- {
- return false;
- }
- return name.equals(((PropertyExpression) o).name);
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/UnaryExpression.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/UnaryExpression.java
deleted file mode 100644
index b620b107c4..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/filter/UnaryExpression.java
+++ /dev/null
@@ -1,321 +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.
- */
-package org.apache.qpid.filter;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-
-import java.math.BigDecimal;
-import java.util.List;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-
-/**
- * An expression which performs an operation on two expression values
- */
-public abstract class UnaryExpression implements Expression
-{
-
- private static final BigDecimal BD_LONG_MIN_VALUE = BigDecimal.valueOf(Long.MIN_VALUE);
- protected Expression right;
-
- public static Expression createNegate(Expression left)
- {
- return new UnaryExpression(left)
- {
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
- Object rvalue = right.evaluate(message);
- if (rvalue == null)
- {
- return null;
- }
-
- if (rvalue instanceof Number)
- {
- return UnaryExpression.negate((Number) rvalue);
- }
-
- return null;
- }
-
- public String getExpressionSymbol()
- {
- return "-";
- }
- };
- }
-
- public static BooleanExpression createInExpression(PropertyExpression right, List elements, final boolean not)
- {
-
- // Use a HashSet if there are many elements.
- Collection t;
- if (elements.size() == 0)
- {
- t = null;
- }
- else if (elements.size() < 5)
- {
- t = elements;
- }
- else
- {
- t = new HashSet(elements);
- }
-
- final Collection inList = t;
-
- return new BooleanUnaryExpression(right)
- {
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
-
- Object rvalue = right.evaluate(message);
- if (rvalue == null)
- {
- return null;
- }
-
- if (rvalue.getClass() != String.class)
- {
- return null;
- }
-
- if (((inList != null) && inList.contains(rvalue)) ^ not)
- {
- return Boolean.TRUE;
- }
- else
- {
- return Boolean.FALSE;
- }
-
- }
-
- public String toString()
- {
- StringBuffer answer = new StringBuffer();
- answer.append(right);
- answer.append(" ");
- answer.append(getExpressionSymbol());
- answer.append(" ( ");
-
- int count = 0;
- for (Iterator i = inList.iterator(); i.hasNext();)
- {
- Object o = (Object) i.next();
- if (count != 0)
- {
- answer.append(", ");
- }
-
- answer.append(o);
- count++;
- }
-
- answer.append(" )");
-
- return answer.toString();
- }
-
- public String getExpressionSymbol()
- {
- if (not)
- {
- return "NOT IN";
- }
- else
- {
- return "IN";
- }
- }
- };
- }
-
- abstract static class BooleanUnaryExpression extends UnaryExpression implements BooleanExpression
- {
- public BooleanUnaryExpression(Expression left)
- {
- super(left);
- }
-
- public boolean matches(AbstractJMSMessage message) throws QpidException
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
- }
-
- ;
-
- public static BooleanExpression createNOT(BooleanExpression left)
- {
- return new BooleanUnaryExpression(left)
- {
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
- Boolean lvalue = (Boolean) right.evaluate(message);
- if (lvalue == null)
- {
- return null;
- }
-
- return lvalue.booleanValue() ? Boolean.FALSE : Boolean.TRUE;
- }
-
- public String getExpressionSymbol()
- {
- return "NOT";
- }
- };
- }
- public static BooleanExpression createBooleanCast(Expression left)
- {
- return new BooleanUnaryExpression(left)
- {
- public Object evaluate(AbstractJMSMessage message) throws QpidException
- {
- Object rvalue = right.evaluate(message);
- if (rvalue == null)
- {
- return null;
- }
-
- if (!rvalue.getClass().equals(Boolean.class))
- {
- return Boolean.FALSE;
- }
-
- return ((Boolean) rvalue).booleanValue() ? Boolean.TRUE : Boolean.FALSE;
- }
-
- public String toString()
- {
- return right.toString();
- }
-
- public String getExpressionSymbol()
- {
- return "";
- }
- };
- }
-
- private static Number negate(Number left)
- {
- Class clazz = left.getClass();
- if (clazz == Integer.class)
- {
- return new Integer(-left.intValue());
- }
- else if (clazz == Long.class)
- {
- return new Long(-left.longValue());
- }
- else if (clazz == Float.class)
- {
- return new Float(-left.floatValue());
- }
- else if (clazz == Double.class)
- {
- return new Double(-left.doubleValue());
- }
- else if (clazz == BigDecimal.class)
- {
- // We ussually get a big deciamal when we have Long.MIN_VALUE constant in the
- // Selector. Long.MIN_VALUE is too big to store in a Long as a positive so we store it
- // as a Big decimal. But it gets Negated right away.. to here we try to covert it back
- // to a Long.
- BigDecimal bd = (BigDecimal) left;
- bd = bd.negate();
-
- if (UnaryExpression.BD_LONG_MIN_VALUE.compareTo(bd) == 0)
- {
- return new Long(Long.MIN_VALUE);
- }
-
- return bd;
- }
- else
- {
- throw new RuntimeException("Don't know how to negate: " + left);
- }
- }
-
- public UnaryExpression(Expression left)
- {
- this.right = left;
- }
-
- public Expression getRight()
- {
- return right;
- }
-
- public void setRight(Expression expression)
- {
- right = expression;
- }
-
- /**
- * @see Object#toString()
- */
- public String toString()
- {
- return "(" + getExpressionSymbol() + " " + right.toString() + ")";
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see Object#hashCode()
- */
- public int hashCode()
- {
- return toString().hashCode();
- }
-
- /**
- * TODO: more efficient hashCode()
- *
- * @see Object#equals(Object)
- */
- public boolean equals(Object o)
- {
-
- if ((o == null) || !this.getClass().equals(o.getClass()))
- {
- return false;
- }
-
- return toString().equals(o.toString());
-
- }
-
- /**
- * Returns the symbol that represents this binary expression. For example, addition is
- * represented by "+"
- *
- * @return
- */
- public abstract String getExpressionSymbol();
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/BrokerDetails.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/BrokerDetails.java
deleted file mode 100644
index 07e1be95dc..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/BrokerDetails.java
+++ /dev/null
@@ -1,103 +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.
- *
- */
-package org.apache.qpid.jms;
-
-import java.util.Map;
-
-import org.apache.qpid.client.SSLConfiguration;
-
-public interface BrokerDetails
-{
-
- /*
- * Known URL Options
- * @see ConnectionURL
- */
- public static final String OPTIONS_RETRY = "retries";
- public static final String OPTIONS_CONNECT_TIMEOUT = "connecttimeout";
- public static final String OPTIONS_CONNECT_DELAY = "connectdelay";
- public static final int DEFAULT_PORT = 5672;
-
- public static final String SOCKET = "socket";
- public static final String TCP = "tcp";
- public static final String VM = "vm";
-
- public static final String DEFAULT_TRANSPORT = TCP;
-
- public static final String URL_FORMAT_EXAMPLE =
- "<transport>://<hostname>[:<port Default=\"" + DEFAULT_PORT + "\">][?<option>='<value>'[,<option>='<value>']]";
-
- public static final long DEFAULT_CONNECT_TIMEOUT = 30000L;
- public static final boolean USE_SSL_DEFAULT = false;
-
- // pulled these properties from the new BrokerDetails class in the qpid package
- public static final String PROTOCOL_TCP = "tcp";
- public static final String PROTOCOL_TLS = "tls";
-
- public static final String VIRTUAL_HOST = "virtualhost";
- public static final String CLIENT_ID = "client_id";
- public static final String USERNAME = "username";
- public static final String PASSWORD = "password";
-
- String getHost();
-
- void setHost(String host);
-
- int getPort();
-
- void setPort(int port);
-
- String getTransport();
-
- void setTransport(String transport);
-
- String getProperty(String key);
-
- void setProperty(String key, String value);
-
- /**
- * Ex: keystore path
- *
- * @return the Properties associated with this connection.
- */
- public Map<String,String> getProperties();
-
- /**
- * Sets the properties associated with this connection
- *
- * @param props the new p[roperties.
- */
- public void setProperties(Map<String,String> props);
-
- long getTimeout();
-
- void setTimeout(long timeout);
-
- SSLConfiguration getSSLConfiguration();
-
- void setSSLConfiguration(SSLConfiguration sslConfiguration);
-
- boolean useSSL();
-
- String toString();
-
- boolean equals(Object o);
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ChannelLimitReachedException.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ChannelLimitReachedException.java
deleted file mode 100644
index 3d4a4573ed..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ChannelLimitReachedException.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.jms;
-
-import javax.jms.ResourceAllocationException;
-
-/**
- * Indicates that the maximum number of sessions per connection limit has been reached.
- */
-public class ChannelLimitReachedException extends ResourceAllocationException
-{
- private static final String ERROR_CODE = "1";
-
- private long _limit;
-
- public ChannelLimitReachedException(long limit)
- {
- super("Unable to create session since maximum number of sessions per connection is " +
- limit + ". Either close one or more sessions or increase the " +
- "maximum number of sessions per connection (or contact your AMQP administrator.", ERROR_CODE);
- _limit = limit;
- }
-
- public long getLimit()
- {
- return _limit;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Connection.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Connection.java
deleted file mode 100644
index 616c6dbbec..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Connection.java
+++ /dev/null
@@ -1,69 +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.
- *
- */
-package org.apache.qpid.jms;
-
-import javax.jms.JMSException;
-
-public interface Connection extends javax.jms.Connection
-{
- /**
- * @return the maximum number of sessions supported by this Connection
- */
- long getMaximumChannelCount() throws JMSException;
-
- void setConnectionListener(ConnectionListener listener);
-
- /**
- * Get the connection listener that has been registered with this connection, if any
- *
- * @return the listener or null if none has been set
- */
- ConnectionListener getConnectionListener();
-
- /**
- * Create a session specifying the prefetch limit of messages.
- *
- * @param transacted
- * @param acknowledgeMode
- * @param prefetch the maximum number of messages to buffer in the client. This
- * applies as a total across all consumers
- * @return
- * @throws JMSException
- */
- org.apache.qpid.jms.Session createSession(boolean transacted, int acknowledgeMode,
- int prefetch) throws JMSException;
-
-
- /**
- * Create a session specifying the prefetch limit of messages.
- *
- * @param transacted
- * @param acknowledgeMode
- * @param prefetchHigh the maximum number of messages to buffer in the client.
- * This applies as a total across all consumers
- * @param prefetchLow the number of messages that must be in the buffer in the client to renable message flow.
- * This applies as a total across all consumers
- * @return
- * @throws JMSException
- */
- org.apache.qpid.jms.Session createSession(boolean transacted, int acknowledgeMode,
- int prefetchHigh, int prefetchLow) throws JMSException;
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ConnectionListener.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ConnectionListener.java
deleted file mode 100644
index 11c235901c..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ConnectionListener.java
+++ /dev/null
@@ -1,58 +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.
- *
- */
-package org.apache.qpid.jms;
-
-public interface ConnectionListener
-{
- /**
- * Called when bytes have been transmitted to the server
- * @param count the number of bytes sent in total since the connection was opened
- */
- void bytesSent(long count);
-
- /**
- * Called when some bytes have been received on a connection
- * @param count the number of bytes received in total since the connection was opened
- */
- void bytesReceived(long count);
-
- /**
- * Called after the infrastructure has detected that failover is required but before attempting failover.
- * @param redirect true if the broker requested redirect. false if failover is occurring due to a connection error.
- * @return true to continue failing over, false to veto failover and raise a connection exception
- */
- boolean preFailover(boolean redirect);
-
- /**
- * Called after connection has been made to another broker after failover has been started but before
- * any resubscription has been done.
- * @return true to continue with resubscription, false to prevent automatic resubscription. This is useful in
- * cases where the application wants to handle resubscription. Note that in the latter case all sessions, producers
- * and consumers are invalidated.
- */
- boolean preResubscribe();
-
- /**
- * Called once failover has completed successfully. This is called irrespective of whether the client has
- * vetoed automatic resubscription.
- */
- void failoverComplete();
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.java
deleted file mode 100644
index da8cd4f750..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.java
+++ /dev/null
@@ -1,94 +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.
- *
- */
-package org.apache.qpid.jms;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ProtocolVersion;
-
-import java.util.List;
-
-/**
- Connection URL format
- amqp://[user:pass@][clientid]/virtualhost?brokerlist='tcp://host:port?option=\'value\'&option=\'value\';vm://:3/virtualpath?option=\'value\''&failover='method?option=\'value\'&option='value''"
- Options are of course optional except for requiring a single broker in the broker list.
- The option seperator is defined to be either '&' or ','
- */
-public interface ConnectionURL
-{
- public static final String AMQ_SYNC_PERSISTENCE = "sync_persistence";
- public static final String AMQ_MAXPREFETCH = "maxprefetch";
- public static final String AMQ_PROTOCOL = "amqp";
- public static final String OPTIONS_BROKERLIST = "brokerlist";
- public static final String OPTIONS_FAILOVER = "failover";
- public static final String OPTIONS_FAILOVER_CYCLE = "cyclecount";
- public static final String OPTIONS_SSL = "ssl";
- public static final String OPTIONS_DEFAULT_TOPIC_EXCHANGE = "defaultTopicExchange";
- public static final String OPTIONS_DEFAULT_QUEUE_EXCHANGE = "defaultQueueExchange";
- public static final String OPTIONS_TEMPORARY_TOPIC_EXCHANGE = "temporaryTopicExchange";
- public static final String OPTIONS_TEMPORARY_QUEUE_EXCHANGE = "temporaryQueueExchange";
- public static final byte URL_0_8 = 1;
- public static final byte URL_0_10 = 2;
-
- String getURL();
-
- String getFailoverMethod();
-
- String getFailoverOption(String key);
-
- int getBrokerCount();
-
- BrokerDetails getBrokerDetails(int index);
-
- void addBrokerDetails(BrokerDetails broker);
-
- void setBrokerDetails(List<BrokerDetails> brokers);
-
- List<BrokerDetails> getAllBrokerDetails();
-
- String getClientName();
-
- void setClientName(String clientName);
-
- String getUsername();
-
- void setUsername(String username);
-
- String getPassword();
-
- void setPassword(String password);
-
- String getVirtualHost();
-
- void setVirtualHost(String virtualHost);
-
- String getOption(String key);
-
- void setOption(String key, String value);
-
- AMQShortString getDefaultQueueExchangeName();
-
- AMQShortString getDefaultTopicExchangeName();
-
- AMQShortString getTemporaryQueueExchangeName();
-
- AMQShortString getTemporaryTopicExchangeName();
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java
deleted file mode 100644
index 8e3ccc3b02..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java
+++ /dev/null
@@ -1,314 +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.
- *
- */
-package org.apache.qpid.jms;
-
-import org.apache.qpid.jms.failover.FailoverMethod;
-import org.apache.qpid.jms.failover.FailoverRoundRobinServers;
-import org.apache.qpid.jms.failover.FailoverSingleServer;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class FailoverPolicy
-{
- private static final Logger _logger = LoggerFactory.getLogger(FailoverPolicy.class);
-
- private static final long MINUTE = 60000L;
-
- private static final long DEFAULT_METHOD_TIMEOUT = 1 * MINUTE;
-
- private FailoverMethod[] _methods = new FailoverMethod[1];
-
- private int _currentMethod;
-
- private int _methodsRetries;
-
- private int _currentRetry;
-
- private boolean _timing;
-
- private long _lastMethodTime;
- private long _lastFailTime;
-
- public FailoverPolicy(ConnectionURL connectionDetails)
- {
- FailoverMethod method;
-
- // todo This should be integrated in to the connection url when it supports
- // multiple strategies.
-
- _methodsRetries = 0;
-
- if (connectionDetails.getFailoverMethod() == null)
- {
- if (connectionDetails.getBrokerCount() > 1)
- {
- method = new FailoverRoundRobinServers(connectionDetails);
- }
- else
- {
- method = new FailoverSingleServer(connectionDetails);
- }
- }
- else
- {
- String failoverMethod = connectionDetails.getFailoverMethod();
-
- /*
- if (failoverMethod.equals(FailoverMethod.RANDOM))
- {
- //todo write a random connection Failover
- }
- */
- if (failoverMethod.equals(FailoverMethod.SINGLE_BROKER))
- {
- method = new FailoverRoundRobinServers(connectionDetails);
- }
- else
- {
- if (failoverMethod.equals(FailoverMethod.ROUND_ROBIN))
- {
- method = new FailoverRoundRobinServers(connectionDetails);
- }
- else
- {
- try
- {
- Class[] constructorSpec = { ConnectionURL.class };
- Object[] params = { connectionDetails };
-
- method =
- (FailoverMethod) ClassLoader.getSystemClassLoader().loadClass(failoverMethod)
- .getConstructor(constructorSpec).newInstance(params);
- }
- catch (Exception cnfe)
- {
- throw new IllegalArgumentException("Unknown failover method:" + failoverMethod, cnfe);
- }
- }
- }
- }
-
- if (method == null)
- {
- throw new IllegalArgumentException("Unknown failover method specified.");
- }
-
- reset();
-
- _methods[_currentMethod] = method;
- }
-
- public FailoverPolicy(FailoverMethod method)
- {
- this(method, 0);
- }
-
- public FailoverPolicy(FailoverMethod method, int retries)
- {
- _methodsRetries = retries;
-
- reset();
-
- _methods[_currentMethod] = method;
- }
-
- private void reset()
- {
- _currentMethod = 0;
- _currentRetry = 0;
- _timing = false;
-
- }
-
- public boolean failoverAllowed()
- {
- boolean failoverAllowed;
-
- if (_timing)
- {
- long now = System.currentTimeMillis();
-
- if ((now - _lastMethodTime) >= DEFAULT_METHOD_TIMEOUT)
- {
- _logger.info("Failover method timeout");
- _lastMethodTime = now;
-
- if (!nextMethod())
- {
- return false;
- }
-
- }
- else
- {
- _lastMethodTime = now;
- }
- }
- else
- {
- _timing = true;
- _lastMethodTime = System.currentTimeMillis();
- _lastFailTime = _lastMethodTime;
- }
-
- if (_methods[_currentMethod].failoverAllowed())
- {
- failoverAllowed = true;
- }
- else
- {
- if (_currentMethod < (_methods.length - 1))
- {
- nextMethod();
- _logger.info("Changing method to " + _methods[_currentMethod].methodName());
-
- return failoverAllowed();
- }
- else
- {
- return cycleMethods();
- }
- }
-
- return failoverAllowed;
- }
-
- private boolean nextMethod()
- {
- if (_currentMethod < (_methods.length - 1))
- {
- _currentMethod++;
- _methods[_currentMethod].reset();
-
- return true;
- }
- else
- {
- return cycleMethods();
- }
- }
-
- private boolean cycleMethods()
- {
- if (_currentRetry < _methodsRetries)
- {
- _currentRetry++;
-
- _currentMethod = 0;
-
- _logger.info("Retrying methods starting with " + _methods[_currentMethod].methodName());
- _methods[_currentMethod].reset();
-
- return failoverAllowed();
- }
- else
- {
- _logger.debug("All failover methods exhausted");
-
- return false;
- }
- }
-
- /**
- * Notification that connection was successful.
- */
- public void attainedConnection()
- {
- _currentRetry = 0;
-
- _methods[_currentMethod].attainedConnection();
-
- _timing = false;
- }
-
- public BrokerDetails getCurrentBrokerDetails()
- {
- return _methods[_currentMethod].getCurrentBrokerDetails();
- }
-
- public BrokerDetails getNextBrokerDetails()
- {
- return _methods[_currentMethod].getNextBrokerDetails();
- }
-
- public void setBroker(BrokerDetails broker)
- {
- _methods[_currentMethod].setBroker(broker);
- }
-
- public void addMethod(FailoverMethod method)
- {
- int len = _methods.length + 1;
- FailoverMethod[] newMethods = new FailoverMethod[len];
- System.arraycopy(_methods, 0, newMethods, 0, _methods.length);
- int index = len - 1;
- newMethods[index] = method;
- _methods = newMethods;
- }
-
- public void setMethodRetries(int retries)
- {
- _methodsRetries = retries;
- }
-
- public FailoverMethod getCurrentMethod()
- {
- if ((_currentMethod >= 0) && (_currentMethod < (_methods.length - 1)))
- {
- return _methods[_currentMethod];
- }
- else
- {
- return null;
- }
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
-
- sb.append("Failover Policy:\n");
-
- if (failoverAllowed())
- {
- sb.append("Failover allowed\n");
- }
- else
- {
- sb.append("Failover not allowed\n");
- }
-
- sb.append("Failover policy methods\n");
- for (int i = 0; i < _methods.length; i++)
- {
-
- if (i == _currentMethod)
- {
- sb.append(">");
- }
-
- sb.append(_methods[i].toString());
- }
-
- return sb.toString();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Message.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Message.java
deleted file mode 100644
index 53c615a1fd..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Message.java
+++ /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.
- *
- */
-package org.apache.qpid.jms;
-
-import javax.jms.JMSException;
-
-public interface Message extends javax.jms.Message
-{
- public static final String JMS_TYPE = "x-jms-type";
-
- public void acknowledgeThis() throws JMSException;
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/MessageConsumer.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/MessageConsumer.java
deleted file mode 100644
index caac2b5c1f..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/MessageConsumer.java
+++ /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.
- *
- */
-package org.apache.qpid.jms;
-
-/**
- */
-public interface MessageConsumer extends javax.jms.MessageConsumer
-{
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/MessageProducer.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/MessageProducer.java
deleted file mode 100644
index b830c377b8..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/MessageProducer.java
+++ /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.
- *
- */
-package org.apache.qpid.jms;
-
-import java.io.UnsupportedEncodingException;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-/**
- */
-public interface MessageProducer extends javax.jms.MessageProducer
-{
- /**
- * Set the default MIME type for messages produced by this producer. This reduces the overhead of each message.
- * @param mimeType
- */
- void setMimeType(String mimeType) throws JMSException;
-
- /**
- * Set the default encoding for messages produced by this producer. This reduces the overhead of each message.
- * @param encoding the encoding as understood by XXXX how do I specify this?? RG
- * @throws UnsupportedEncodingException if the encoding is not understood
- */
- void setEncoding(String encoding) throws UnsupportedEncodingException, JMSException;
-
- void send(Destination destination, Message message, int deliveryMode,
- int priority, long timeToLive, boolean immediate)
- throws JMSException;
-
- void send(Destination destination, Message message, int deliveryMode,
- int priority, long timeToLive, boolean mandatory, boolean immediate)
- throws JMSException;
-
- void send(Destination destination, Message message, int deliveryMode, int priority, long timeToLive,
- boolean mandatory, boolean immediate, boolean waitUntilSent) throws JMSException;
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Session.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Session.java
deleted file mode 100644
index 5287381fae..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/Session.java
+++ /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.
- *
- */
-package org.apache.qpid.jms;
-
-import org.apache.qpid.framing.AMQShortString;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-
-
-public interface Session extends javax.jms.Session
-{
- /**
- * Indicates that no client acknowledgements are required. Broker assumes that once it has delivered
- * a message packet successfully it is acknowledged.
- */
- static final int NO_ACKNOWLEDGE = 257;
-
- /**
- * Pre acknowledge means that an ack is sent per message but sent before user code has processed
- * the message (i.e. before the onMessage() call or the receive() method has returned).
- */
- static final int PRE_ACKNOWLEDGE = 258;
-
- MessageConsumer createConsumer(Destination destination,
- int prefetch,
- boolean noLocal,
- boolean exclusive,
- String selector) throws JMSException;
-
- MessageConsumer createConsumer(Destination destination,
- int prefetchHigh,
- int prefetchLow,
- boolean noLocal,
- boolean exclusive,
- String selector) throws JMSException;
-
- /**
- * @return the prefetch value used by default for consumers created on this session.
- */
- int getDefaultPrefetch();
-
- /**
- * @return the High water prefetch value used by default for consumers created on this session.
- */
- int getDefaultPrefetchHigh();
-
- /**
- * @return the Low water prefetch value used by default for consumers created on this session.
- */
- int getDefaultPrefetchLow();
-
- /**
- * Create a producer
- * @param destination
- * @param mandatory the value of the mandatory flag used by default on the producer
- * @param immediate the value of the immediate flag used by default on the producer
- * @return
- * @throws JMSException
- */
- MessageProducer createProducer(Destination destination, boolean mandatory, boolean immediate)
- throws JMSException;
-
- /**
- * Create a producer
- * @param destination
- * @param immediate the value of the immediate flag used by default on the producer
- * @return
- * @throws JMSException
- */
- MessageProducer createProducer(Destination destination, boolean immediate)
- throws JMSException;
-
- AMQShortString getTemporaryTopicExchangeName();
-
- AMQShortString getDefaultQueueExchangeName();
-
- AMQShortString getDefaultTopicExchangeName();
-
- AMQShortString getTemporaryQueueExchangeName();
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/TopicSubscriber.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/TopicSubscriber.java
deleted file mode 100644
index 1dbe464230..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/TopicSubscriber.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.apache.qpid.jms;
-/*
- *
- * 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 org.apache.qpid.AMQException;
-
-import javax.jms.Topic;
-
-public interface TopicSubscriber extends javax.jms.TopicSubscriber
-{
-
- void addBindingKey(Topic topic, String bindingKey) throws AMQException;
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverMethod.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverMethod.java
deleted file mode 100644
index d7ec46dea3..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverMethod.java
+++ /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.
- *
- */
-
-package org.apache.qpid.jms.failover;
-
-import org.apache.qpid.jms.BrokerDetails;
-
-public interface FailoverMethod
-{
- public static final String SINGLE_BROKER = "singlebroker";
- public static final String ROUND_ROBIN = "roundrobin";
- public static final String RANDOM = "random";
- /**
- * Reset the Failover to initial conditions
- */
- void reset();
-
- /**
- * Check if failover is possible for this method
- *
- * @return true if failover is allowed
- */
- boolean failoverAllowed();
-
- /**
- * Notification to the Failover method that a connection has been attained.
- */
- void attainedConnection();
-
- /**
- * If there is no current BrokerDetails the null will be returned.
- * @return The current BrokerDetail value to use
- */
- BrokerDetails getCurrentBrokerDetails();
-
- /**
- * Move to the next BrokerDetails if one is available.
- * @return the next BrokerDetail or null if there is none.
- */
- BrokerDetails getNextBrokerDetails();
-
- /**
- * Set the currently active broker to be the new value.
- * @param broker The new BrokerDetail value
- */
- void setBroker(BrokerDetails broker);
-
- /**
- * Set the retries for this method
- * @param maxRetries the maximum number of time to retry this Method
- */
- void setRetries(int maxRetries);
-
- /**
- * @return The name of this method for display purposes.
- */
- String methodName();
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java
deleted file mode 100644
index 9c172da6a2..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java
+++ /dev/null
@@ -1,273 +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.
- *
- */
-package org.apache.qpid.jms.failover;
-
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.jms.ConnectionURL;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class FailoverRoundRobinServers implements FailoverMethod
-{
- private static final Logger _logger = LoggerFactory.getLogger(FailoverRoundRobinServers.class);
-
- /** The default number of times to cycle through all servers */
- public static final int DEFAULT_CYCLE_RETRIES = 0;
- /** The default number of times to retry each server */
- public static final int DEFAULT_SERVER_RETRIES = 0;
-
- /** The index into the hostDetails array of the broker to which we are connected */
- private int _currentBrokerIndex = -1;
-
- /** The number of times to retry connecting for each server */
- private int _serverRetries;
-
- /** The current number of retry attempts made */
- private int _currentServerRetry;
-
- /** The number of times to cycle through the servers */
- private int _cycleRetries;
-
- /** The current number of cycles performed. */
- private int _currentCycleRetries;
-
- /** Array of BrokerDetail used to make connections. */
- private ConnectionURL _connectionDetails;
-
- public FailoverRoundRobinServers(ConnectionURL connectionDetails)
- {
- if (!(connectionDetails.getBrokerCount() > 0))
- {
- throw new IllegalArgumentException("At least one broker details must be specified.");
- }
-
- _connectionDetails = connectionDetails;
-
- // There is no current broker at startup so set it to -1.
- _currentBrokerIndex = -1;
-
- String cycleRetries = _connectionDetails.getFailoverOption(ConnectionURL.OPTIONS_FAILOVER_CYCLE);
-
- if (cycleRetries != null)
- {
- try
- {
- _cycleRetries = Integer.parseInt(cycleRetries);
- }
- catch (NumberFormatException nfe)
- {
- _cycleRetries = DEFAULT_CYCLE_RETRIES;
- }
- }
-
- _currentCycleRetries = 0;
-
- _serverRetries = 0;
- _currentServerRetry = -1;
- }
-
- public void reset()
- {
- _currentBrokerIndex = 0;
- _currentCycleRetries = 0;
- _currentServerRetry = -1;
- }
-
- public boolean failoverAllowed()
- {
- return ((_currentCycleRetries < _cycleRetries) || (_currentServerRetry < _serverRetries)
- || (_currentBrokerIndex < (_connectionDetails.getBrokerCount() - 1)));
- }
-
- public void attainedConnection()
- {
- _currentCycleRetries = 0;
- _currentServerRetry = -1;
- }
-
- public BrokerDetails getCurrentBrokerDetails()
- {
- if (_currentBrokerIndex == -1)
- {
- return null;
- }
-
- return _connectionDetails.getBrokerDetails(_currentBrokerIndex);
- }
-
- public BrokerDetails getNextBrokerDetails()
- {
- boolean doDelay = false;
-
- if (_currentBrokerIndex == (_connectionDetails.getBrokerCount() - 1))
- {
- if (_currentServerRetry < _serverRetries)
- {
- if (_currentBrokerIndex == -1)
- {
- _currentBrokerIndex = 0;
-
- setBroker(_connectionDetails.getBrokerDetails(_currentBrokerIndex));
-
- _logger.info("First run using " + _connectionDetails.getBrokerDetails(_currentBrokerIndex));
- }
- else
- {
- _logger.info("Retrying " + _connectionDetails.getBrokerDetails(_currentBrokerIndex));
- doDelay=true;
- }
-
- _currentServerRetry++;
- }
- else
- {
- _currentCycleRetries++;
- // failed to connect to first broker
- _currentBrokerIndex = 0;
-
- setBroker(_connectionDetails.getBrokerDetails(_currentBrokerIndex));
-
- // This is zero rather than -1 as we are already retrieving the details.
- _currentServerRetry = 0;
- }
- // else - should force client to stop as max retries has been reached.
- }
- else
- {
- if (_currentServerRetry < _serverRetries)
- {
- if (_currentBrokerIndex == -1)
- {
- _currentBrokerIndex = 0;
-
- setBroker(_connectionDetails.getBrokerDetails(_currentBrokerIndex));
-
- _logger.info("First run using " + _connectionDetails.getBrokerDetails(_currentBrokerIndex));
- }
- else
- {
- _logger.info("Retrying " + _connectionDetails.getBrokerDetails(_currentBrokerIndex));
- doDelay=true;
- }
-
- _currentServerRetry++;
- }
- else
- {
- _currentBrokerIndex++;
-
- setBroker(_connectionDetails.getBrokerDetails(_currentBrokerIndex));
- // This is zero rather than -1 as we are already retrieving the details.
- _currentServerRetry = 0;
- }
- }
-
- BrokerDetails broker = _connectionDetails.getBrokerDetails(_currentBrokerIndex);
-
- String delayStr = broker.getProperty(BrokerDetails.OPTIONS_CONNECT_DELAY);
- if (delayStr != null && doDelay)
- {
- Long delay = Long.parseLong(delayStr);
- _logger.info("Delay between connect retries:" + delay);
- try
- {
- Thread.sleep(delay);
- }
- catch (InterruptedException ie)
- {
- return null;
- }
- }
- else
- {
- _logger.info("No delay between connect retries, use tcp://host:port?connectdelay='value' to enable.");
- }
-
- return broker;
- }
-
- public void setBroker(BrokerDetails broker)
- {
-
- _connectionDetails.addBrokerDetails(broker);
-
- int index = _connectionDetails.getAllBrokerDetails().indexOf(broker);
-
- String serverRetries = broker.getProperty(BrokerDetails.OPTIONS_RETRY);
-
- if (serverRetries != null)
- {
- try
- {
- _serverRetries = Integer.parseInt(serverRetries);
- }
- catch (NumberFormatException nfe)
- {
- _serverRetries = DEFAULT_SERVER_RETRIES;
- }
- }
-
- _currentServerRetry = -1;
- _currentBrokerIndex = index;
- }
-
- public void setRetries(int maxRetries)
- {
- _cycleRetries = maxRetries;
- }
-
- public String methodName()
- {
- return "Cycle Servers";
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
-
- sb.append("Cycle Servers:\n");
-
- sb.append("Cycle Retries:");
- sb.append(_cycleRetries);
- sb.append("\nCurrent Cycle:");
- sb.append(_currentCycleRetries);
- sb.append("\nServer Retries:");
- sb.append(_serverRetries);
- sb.append("\nCurrent Retry:");
- sb.append(_currentServerRetry);
- sb.append("\nCurrent Broker:");
- sb.append(_currentBrokerIndex);
- sb.append("\n");
-
- for (int i = 0; i < _connectionDetails.getBrokerCount(); i++)
- {
- if (i == _currentBrokerIndex)
- {
- sb.append(">");
- }
-
- sb.append(_connectionDetails.getBrokerDetails(i));
- sb.append("\n");
- }
-
- return sb.toString();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java
deleted file mode 100644
index 9fa006233b..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java
+++ /dev/null
@@ -1,166 +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.
- *
- */
-package org.apache.qpid.jms.failover;
-
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.jms.ConnectionURL;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class FailoverSingleServer implements FailoverMethod
-{
- private static final Logger _logger = LoggerFactory.getLogger(FailoverSingleServer.class);
-
- /** The default number of times to rety a conection to this server */
- public static final int DEFAULT_SERVER_RETRIES = 1;
-
- /** The details of the Single Server */
- private BrokerDetails _brokerDetail;
-
- /** The number of times to retry connecting to the sever */
- private int _retries;
-
- /** The current number of attempts made to the server */
- private int _currentRetries;
-
-
- public FailoverSingleServer(ConnectionURL connectionDetails)
- {
- if (connectionDetails.getBrokerCount() > 0)
- {
- setBroker(connectionDetails.getBrokerDetails(0));
- }
- else
- {
- throw new IllegalArgumentException("BrokerDetails details required for connection.");
- }
- }
-
- public FailoverSingleServer(BrokerDetails brokerDetail)
- {
- setBroker(brokerDetail);
- }
-
- public void reset()
- {
- _currentRetries = -1;
- }
-
- public boolean failoverAllowed()
- {
- return _currentRetries < _retries;
- }
-
- public void attainedConnection()
- {
- reset();
- }
-
- public BrokerDetails getCurrentBrokerDetails()
- {
- return _brokerDetail;
- }
-
- public BrokerDetails getNextBrokerDetails()
- {
- if (_currentRetries == _retries)
- {
- return null;
- }
- else
- {
- if (_currentRetries < _retries)
- {
- _currentRetries++;
- }
- }
-
-
- String delayStr = _brokerDetail.getProperty(BrokerDetails.OPTIONS_CONNECT_DELAY);
- if (delayStr != null && _currentRetries > 0)
- {
- Long delay = Long.parseLong(delayStr);
- _logger.info("Delay between connect retries:" + delay);
- try
- {
-
- Thread.sleep(delay);
- }
- catch (InterruptedException ie)
- {
- return null;
- }
- }
- else
- {
- _logger.info("No delay between connect retries, use tcp://host:port?connectdelay='value' to enable.");
- }
-
- return _brokerDetail;
- }
-
- public void setBroker(BrokerDetails broker)
- {
- if (broker == null)
- {
- throw new IllegalArgumentException("BrokerDetails details cannot be null");
- }
- _brokerDetail = broker;
-
- String retries = broker.getProperty(BrokerDetails.OPTIONS_RETRY);
- if (retries != null)
- {
- try
- {
- _retries = Integer.parseInt(retries);
- }
- catch (NumberFormatException nfe)
- {
- _retries = DEFAULT_SERVER_RETRIES;
- }
- }
- else
- {
- _retries = DEFAULT_SERVER_RETRIES;
- }
-
- reset();
- }
-
- public void setRetries(int retries)
- {
- _retries = retries;
- }
-
- public String methodName()
- {
- return "Single Server";
- }
-
- public String toString()
- {
- return "SingleServer:\n" +
- "Max Retries:" + _retries +
- "\nCurrent Retry:" + _currentRetries +
- "\n" + _brokerDetail + "\n";
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/Example.properties b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/Example.properties
deleted file mode 100644
index def53d8494..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/Example.properties
+++ /dev/null
@@ -1,40 +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.
-#
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialConextFactory
-
-# use the following property to configure the default connector
-#java.naming.provider.url - ignored.
-
-# register some connection factories
-# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.local = amqp://guest:guest@clientid/testpath?brokerlist='vm://:1'
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.MyQueue = example.MyQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-topic.ibmStocks = stocks.nyse.ibm
-
-# Register an AMQP destination in JNDI
-# NOTE: Qpid currently only supports direct,topics and headers
-# destination.[jniName] = [BindingURL]
-destination.direct = direct://amq.direct//directQueue
-destination.directQueue = direct://amq.direct//message_queue?routingkey="routing_key"
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/NameParserImpl.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/NameParserImpl.java
deleted file mode 100644
index a3174aec7a..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/NameParserImpl.java
+++ /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.
- */
-
-package org.apache.qpid.jndi;
-
-import javax.naming.CompositeName;
-import javax.naming.Name;
-import javax.naming.NameParser;
-import javax.naming.NamingException;
-
-/**
- * A default implementation of {@link NameParser}
- * <p/>
- * Based on class from ActiveMQ.
- */
-public class NameParserImpl implements NameParser
-{
- public Name parse(String name) throws NamingException
- {
- return new CompositeName(name);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java
deleted file mode 100644
index 43ac56dee9..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java
+++ /dev/null
@@ -1,359 +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.
- *
- */
-package org.apache.qpid.jndi;
-
-import java.io.BufferedInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.Queue;
-import javax.jms.Topic;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.spi.InitialContextFactory;
-
-import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQHeadersExchange;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.qpid.url.BindingURL;
-import org.apache.qpid.url.URLSyntaxException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class PropertiesFileInitialContextFactory implements InitialContextFactory
-{
- protected final Logger _logger = LoggerFactory.getLogger(PropertiesFileInitialContextFactory.class);
-
- private String CONNECTION_FACTORY_PREFIX = "connectionfactory.";
- private String DESTINATION_PREFIX = "destination.";
- private String QUEUE_PREFIX = "queue.";
- private String TOPIC_PREFIX = "topic.";
-
- public Context getInitialContext(Hashtable environment) throws NamingException
- {
- Map data = new ConcurrentHashMap();
-
- try
- {
-
- String file = null;
- if (environment.containsKey(Context.PROVIDER_URL))
- {
- file = (String) environment.get(Context.PROVIDER_URL);
- }
- else
- {
- file = System.getProperty(Context.PROVIDER_URL);
- }
-
- if (file != null)
- {
- _logger.info("Loading Properties from:" + file);
- // Load the properties specified
- Properties p = new Properties();
-
- p.load(new BufferedInputStream(new FileInputStream(file)));
-
- environment.putAll(p);
- System.getProperties().putAll(p);
- _logger.info("Loaded Context Properties:" + environment.toString());
- }
- else
- {
- _logger.info("No Provider URL specified.");
- }
- }
- catch (IOException ioe)
- {
- _logger.warn("Unable to load property file specified in Provider_URL:" + environment.get(Context.PROVIDER_URL));
- }
-
- createConnectionFactories(data, environment);
-
- createDestinations(data, environment);
-
- createQueues(data, environment);
-
- createTopics(data, environment);
-
- return createContext(data, environment);
- }
-
- // Implementation methods
- // -------------------------------------------------------------------------
- protected ReadOnlyContext createContext(Map data, Hashtable environment)
- {
- return new ReadOnlyContext(environment, data);
- }
-
- protected void createConnectionFactories(Map data, Hashtable environment)
- {
- for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();)
- {
- Map.Entry entry = (Map.Entry) iter.next();
- String key = entry.getKey().toString();
- if (key.startsWith(CONNECTION_FACTORY_PREFIX))
- {
- String jndiName = key.substring(CONNECTION_FACTORY_PREFIX.length());
- ConnectionFactory cf = createFactory(entry.getValue().toString());
- if (cf != null)
- {
- data.put(jndiName, cf);
- }
- }
- }
- }
-
- protected void createDestinations(Map data, Hashtable environment)
- {
- for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();)
- {
- Map.Entry entry = (Map.Entry) iter.next();
- String key = entry.getKey().toString();
- if (key.startsWith(DESTINATION_PREFIX))
- {
- String jndiName = key.substring(DESTINATION_PREFIX.length());
- Destination dest = createDestination(entry.getValue().toString());
- if (dest != null)
- {
- data.put(jndiName, dest);
- }
- }
- }
- }
-
- protected void createQueues(Map data, Hashtable environment)
- {
- for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();)
- {
- Map.Entry entry = (Map.Entry) iter.next();
- String key = entry.getKey().toString();
- if (key.startsWith(QUEUE_PREFIX))
- {
- String jndiName = key.substring(QUEUE_PREFIX.length());
- Queue q = createQueue(entry.getValue().toString());
- if (q != null)
- {
- data.put(jndiName, q);
- }
- }
- }
- }
-
- protected void createTopics(Map data, Hashtable environment)
- {
- for (Iterator iter = environment.entrySet().iterator(); iter.hasNext();)
- {
- Map.Entry entry = (Map.Entry) iter.next();
- String key = entry.getKey().toString();
- if (key.startsWith(TOPIC_PREFIX))
- {
- String jndiName = key.substring(TOPIC_PREFIX.length());
- Topic t = createTopic(entry.getValue().toString());
- if (t != null)
- {
- if (_logger.isDebugEnabled())
- {
- StringBuffer b = new StringBuffer();
- b.append("Creating the topic: " + jndiName + " with the following binding keys ");
- for (AMQShortString binding:((AMQTopic)t).getBindingKeys())
- {
- b.append(binding.toString()).append(",");
- }
-
- _logger.debug(b.toString());
- }
- data.put(jndiName, t);
- }
- }
- }
- }
-
- /**
- * Factory method to create new Connection Factory instances
- */
- protected ConnectionFactory createFactory(String url)
- {
- try
- {
- return new AMQConnectionFactory(url);
- }
- catch (URLSyntaxException urlse)
- {
- _logger.warn("Unable to createFactories:" + urlse);
- }
-
- return null;
- }
-
- /**
- * Factory method to create new Destination instances from an AMQP BindingURL
- */
- protected Destination createDestination(String bindingURL)
- {
- AMQBindingURL binding;
- try
- {
- binding = new AMQBindingURL(bindingURL);
- }
- catch (URISyntaxException urlse)
- {
- _logger.warn("Unable to create destination:" + urlse, urlse);
-
- return null;
- }
-
- try
- {
- return AMQDestination.createDestination(binding);
- }
- catch (IllegalArgumentException iaw)
- {
- _logger.warn("Binding: '" + binding + "' not supported");
-
- return null;
- }
- }
-
- /**
- * Factory method to create new Queue instances
- */
- protected Queue createQueue(Object value)
- {
- if (value instanceof AMQShortString)
- {
- return new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, (AMQShortString) value);
- }
- else if (value instanceof String)
- {
- return new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, new AMQShortString((String) value));
- }
- else if (value instanceof BindingURL)
- {
- return new AMQQueue((BindingURL) value);
- }
-
- return null;
- }
-
- /**
- * Factory method to create new Topic instances
- */
- protected Topic createTopic(Object value)
- {
- if (value instanceof AMQShortString)
- {
- return new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME, (AMQShortString) value);
- }
- else if (value instanceof String)
- {
- String[] keys = ((String)value).split(",");
- AMQShortString[] bindings = new AMQShortString[keys.length];
- int i = 0;
- for (String key:keys)
- {
- bindings[i] = new AMQShortString(key);
- i++;
- }
- // The Destination has a dual nature. If this was used for a producer the key is used
- // for the routing key. If it was used for the consumer it becomes the bindingKey
- return new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME,bindings[0],null,bindings);
- }
- else if (value instanceof BindingURL)
- {
- return new AMQTopic((BindingURL) value);
- }
-
- return null;
- }
-
- /**
- * Factory method to create new HeaderExcahnge instances
- */
- protected Destination createHeaderExchange(Object value)
- {
- if (value instanceof String)
- {
- return new AMQHeadersExchange((String) value);
- }
- else if (value instanceof BindingURL)
- {
- return new AMQHeadersExchange((BindingURL) value);
- }
-
- return null;
- }
-
- // Properties
- // -------------------------------------------------------------------------
- public String getConnectionPrefix()
- {
- return CONNECTION_FACTORY_PREFIX;
- }
-
- public void setConnectionPrefix(String connectionPrefix)
- {
- this.CONNECTION_FACTORY_PREFIX = connectionPrefix;
- }
-
- public String getDestinationPrefix()
- {
- return DESTINATION_PREFIX;
- }
-
- public void setDestinationPrefix(String destinationPrefix)
- {
- this.DESTINATION_PREFIX = destinationPrefix;
- }
-
- public String getQueuePrefix()
- {
- return QUEUE_PREFIX;
- }
-
- public void setQueuePrefix(String queuePrefix)
- {
- this.QUEUE_PREFIX = queuePrefix;
- }
-
- public String getTopicPrefix()
- {
- return TOPIC_PREFIX;
- }
-
- public void setTopicPrefix(String topicPrefix)
- {
- this.TOPIC_PREFIX = topicPrefix;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/ReadOnlyContext.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/ReadOnlyContext.java
deleted file mode 100644
index 1719ea1219..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/jndi/ReadOnlyContext.java
+++ /dev/null
@@ -1,527 +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.
- *
- */
-package org.apache.qpid.jndi;
-
-import java.io.Serializable;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.naming.Binding;
-import javax.naming.CompositeName;
-import javax.naming.Context;
-import javax.naming.LinkRef;
-import javax.naming.Name;
-import javax.naming.NameClassPair;
-import javax.naming.NameNotFoundException;
-import javax.naming.NameParser;
-import javax.naming.NamingEnumeration;
-import javax.naming.NamingException;
-import javax.naming.NotContextException;
-import javax.naming.OperationNotSupportedException;
-import javax.naming.Reference;
-import javax.naming.spi.NamingManager;
-
-/**
- * Based on class from ActiveMQ.
- * A read-only Context
- * <p/>
- * This version assumes it and all its subcontext are read-only and any attempt
- * to modify (e.g. through bind) will result in an OperationNotSupportedException.
- * Each Context in the tree builds a cache of the entries in all sub-contexts
- * to optimise the performance of lookup.
- * </p>
- * <p>This implementation is intended to optimise the performance of lookup(String)
- * to about the level of a HashMap get. It has been observed that the scheme
- * resolution phase performed by the JVM takes considerably longer, so for
- * optimum performance lookups should be coded like:</p>
- * <code>
- * Context componentContext = (Context)new InitialContext().lookup("java:comp");
- * String envEntry = (String) componentContext.lookup("env/myEntry");
- * String envEntry2 = (String) componentContext.lookup("env/myEntry2");
- * </code>
- */
-public class ReadOnlyContext implements Context, Serializable
-{
- private static final long serialVersionUID = -5754338187296859149L;
- protected static final NameParser nameParser = new NameParserImpl();
-
- protected final Hashtable environment; // environment for this context
- protected final Map bindings; // bindings at my level
- protected final Map treeBindings; // all bindings under me
-
- private boolean frozen = false;
- private String nameInNamespace = "";
- public static final String SEPARATOR = "/";
-
- public ReadOnlyContext()
- {
- environment = new Hashtable();
- bindings = new HashMap();
- treeBindings = new HashMap();
- }
-
- public ReadOnlyContext(Hashtable env)
- {
- if (env == null)
- {
- this.environment = new Hashtable();
- }
- else
- {
- this.environment = new Hashtable(env);
- }
-
- this.bindings = Collections.EMPTY_MAP;
- this.treeBindings = Collections.EMPTY_MAP;
- }
-
- public ReadOnlyContext(Hashtable environment, Map bindings)
- {
- if (environment == null)
- {
- this.environment = new Hashtable();
- }
- else
- {
- this.environment = new Hashtable(environment);
- }
-
- this.bindings = bindings;
- treeBindings = new HashMap();
- frozen = true;
- }
-
- public ReadOnlyContext(Hashtable environment, Map bindings, String nameInNamespace)
- {
- this(environment, bindings);
- this.nameInNamespace = nameInNamespace;
- }
-
- protected ReadOnlyContext(ReadOnlyContext clone, Hashtable env)
- {
- this.bindings = clone.bindings;
- this.treeBindings = clone.treeBindings;
- this.environment = new Hashtable(env);
- }
-
- protected ReadOnlyContext(ReadOnlyContext clone, Hashtable env, String nameInNamespace)
- {
- this(clone, env);
- this.nameInNamespace = nameInNamespace;
- }
-
- public void freeze()
- {
- frozen = true;
- }
-
- boolean isFrozen()
- {
- return frozen;
- }
-
- /**
- * internalBind is intended for use only during setup or possibly by suitably synchronized superclasses.
- * It binds every possible lookup into a map in each context. To do this, each context
- * strips off one name segment and if necessary creates a new context for it. Then it asks that context
- * to bind the remaining name. It returns a map containing all the bindings from the next context, plus
- * the context it just created (if it in fact created it). (the names are suitably extended by the segment
- * originally lopped off).
- *
- * @param name
- * @param value
- * @return
- * @throws javax.naming.NamingException
- */
- protected Map internalBind(String name, Object value) throws NamingException
- {
- assert (name != null) && (name.length() > 0);
- assert !frozen;
-
- Map newBindings = new HashMap();
- int pos = name.indexOf('/');
- if (pos == -1)
- {
- if (treeBindings.put(name, value) != null)
- {
- throw new NamingException("Something already bound at " + name);
- }
-
- bindings.put(name, value);
- newBindings.put(name, value);
- }
- else
- {
- String segment = name.substring(0, pos);
- assert segment != null;
- assert !segment.equals("");
- Object o = treeBindings.get(segment);
- if (o == null)
- {
- o = newContext();
- treeBindings.put(segment, o);
- bindings.put(segment, o);
- newBindings.put(segment, o);
- }
- else if (!(o instanceof ReadOnlyContext))
- {
- throw new NamingException("Something already bound where a subcontext should go");
- }
-
- ReadOnlyContext readOnlyContext = (ReadOnlyContext) o;
- String remainder = name.substring(pos + 1);
- Map subBindings = readOnlyContext.internalBind(remainder, value);
- for (Iterator iterator = subBindings.entrySet().iterator(); iterator.hasNext();)
- {
- Map.Entry entry = (Map.Entry) iterator.next();
- String subName = segment + "/" + (String) entry.getKey();
- Object bound = entry.getValue();
- treeBindings.put(subName, bound);
- newBindings.put(subName, bound);
- }
- }
-
- return newBindings;
- }
-
- protected ReadOnlyContext newContext()
- {
- return new ReadOnlyContext();
- }
-
- public Object addToEnvironment(String propName, Object propVal) throws NamingException
- {
- return environment.put(propName, propVal);
- }
-
- public Hashtable getEnvironment() throws NamingException
- {
- return (Hashtable) environment.clone();
- }
-
- public Object removeFromEnvironment(String propName) throws NamingException
- {
- return environment.remove(propName);
- }
-
- public Object lookup(String name) throws NamingException
- {
- if (name.length() == 0)
- {
- return this;
- }
-
- Object result = treeBindings.get(name);
- if (result == null)
- {
- result = bindings.get(name);
- }
-
- if (result == null)
- {
- int pos = name.indexOf(':');
- if (pos > 0)
- {
- String scheme = name.substring(0, pos);
- Context ctx = NamingManager.getURLContext(scheme, environment);
- if (ctx == null)
- {
- throw new NamingException("scheme " + scheme + " not recognized");
- }
-
- return ctx.lookup(name);
- }
- else
- {
- // Split out the first name of the path
- // and look for it in the bindings map.
- CompositeName path = new CompositeName(name);
-
- if (path.size() == 0)
- {
- return this;
- }
- else
- {
- String first = path.get(0);
- Object obj = bindings.get(first);
- if (obj == null)
- {
- throw new NameNotFoundException(name);
- }
- else if ((obj instanceof Context) && (path.size() > 1))
- {
- Context subContext = (Context) obj;
- obj = subContext.lookup(path.getSuffix(1));
- }
-
- return obj;
- }
- }
- }
-
- if (result instanceof LinkRef)
- {
- LinkRef ref = (LinkRef) result;
- result = lookup(ref.getLinkName());
- }
-
- if (result instanceof Reference)
- {
- try
- {
- result = NamingManager.getObjectInstance(result, null, null, this.environment);
- }
- catch (NamingException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw (NamingException) new NamingException("could not look up : " + name).initCause(e);
- }
- }
-
- if (result instanceof ReadOnlyContext)
- {
- String prefix = getNameInNamespace();
- if (prefix.length() > 0)
- {
- prefix = prefix + SEPARATOR;
- }
-
- result = new ReadOnlyContext((ReadOnlyContext) result, environment, prefix + name);
- }
-
- return result;
- }
-
- public Object lookup(Name name) throws NamingException
- {
- return lookup(name.toString());
- }
-
- public Object lookupLink(String name) throws NamingException
- {
- return lookup(name);
- }
-
- public Name composeName(Name name, Name prefix) throws NamingException
- {
- Name result = (Name) prefix.clone();
- result.addAll(name);
-
- return result;
- }
-
- public String composeName(String name, String prefix) throws NamingException
- {
- CompositeName result = new CompositeName(prefix);
- result.addAll(new CompositeName(name));
-
- return result.toString();
- }
-
- public NamingEnumeration list(String name) throws NamingException
- {
- Object o = lookup(name);
- if (o == this)
- {
- return new ListEnumeration();
- }
- else if (o instanceof Context)
- {
- return ((Context) o).list("");
- }
- else
- {
- throw new NotContextException();
- }
- }
-
- public NamingEnumeration listBindings(String name) throws NamingException
- {
- Object o = lookup(name);
- if (o == this)
- {
- return new ListBindingEnumeration();
- }
- else if (o instanceof Context)
- {
- return ((Context) o).listBindings("");
- }
- else
- {
- throw new NotContextException();
- }
- }
-
- public Object lookupLink(Name name) throws NamingException
- {
- return lookupLink(name.toString());
- }
-
- public NamingEnumeration list(Name name) throws NamingException
- {
- return list(name.toString());
- }
-
- public NamingEnumeration listBindings(Name name) throws NamingException
- {
- return listBindings(name.toString());
- }
-
- public void bind(Name name, Object obj) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void bind(String name, Object obj) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void close() throws NamingException
- {
- // ignore
- }
-
- public Context createSubcontext(Name name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public Context createSubcontext(String name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void destroySubcontext(Name name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void destroySubcontext(String name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public String getNameInNamespace() throws NamingException
- {
- return nameInNamespace;
- }
-
- public NameParser getNameParser(Name name) throws NamingException
- {
- return nameParser;
- }
-
- public NameParser getNameParser(String name) throws NamingException
- {
- return nameParser;
- }
-
- public void rebind(Name name, Object obj) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void rebind(String name, Object obj) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void rename(Name oldName, Name newName) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void rename(String oldName, String newName) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void unbind(Name name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void unbind(String name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- private abstract class LocalNamingEnumeration implements NamingEnumeration
- {
- private Iterator i = bindings.entrySet().iterator();
-
- public boolean hasMore() throws NamingException
- {
- return i.hasNext();
- }
-
- public boolean hasMoreElements()
- {
- return i.hasNext();
- }
-
- protected Map.Entry getNext()
- {
- return (Map.Entry) i.next();
- }
-
- public void close() throws NamingException
- { }
- }
-
- private class ListEnumeration extends LocalNamingEnumeration
- {
- public Object next() throws NamingException
- {
- return nextElement();
- }
-
- public Object nextElement()
- {
- Map.Entry entry = getNext();
-
- return new NameClassPair((String) entry.getKey(), entry.getValue().getClass().getName());
- }
- }
-
- private class ListBindingEnumeration extends LocalNamingEnumeration
- {
- public Object next() throws NamingException
- {
- return nextElement();
- }
-
- public Object nextElement()
- {
- Map.Entry entry = getNext();
-
- return new Binding((String) entry.getKey(), entry.getValue());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/naming/ReadOnlyContext.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/naming/ReadOnlyContext.java
deleted file mode 100644
index 59ec4cfba7..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/naming/ReadOnlyContext.java
+++ /dev/null
@@ -1,509 +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.
- */
-package org.apache.qpid.naming;
-
-import org.apache.qpid.jndi.NameParserImpl;
-
-import javax.naming.*;
-import javax.naming.spi.NamingManager;
-import java.io.Serializable;
-import java.util.*;
-
-/**
- * Based on class from ActiveMQ.
- * A read-only Context
- * <p/>
- * This version assumes it and all its subcontext are read-only and any attempt
- * to modify (e.g. through bind) will result in an OperationNotSupportedException.
- * Each Context in the tree builds a cache of the entries in all sub-contexts
- * to optimise the performance of lookup.
- * </p>
- * <p>This implementation is intended to optimise the performance of lookup(String)
- * to about the level of a HashMap get. It has been observed that the scheme
- * resolution phase performed by the JVM takes considerably longer, so for
- * optimum performance lookups should be coded like:</p>
- * <code>
- * Context componentContext = (Context)new InitialContext().lookup("java:comp");
- * String envEntry = (String) componentContext.lookup("env/myEntry");
- * String envEntry2 = (String) componentContext.lookup("env/myEntry2");
- * </code>
- */
-public class ReadOnlyContext implements Context, Serializable
-{
- private static final long serialVersionUID = -5754338187296859149L;
- protected static final NameParser nameParser = new NameParserImpl();
-
- protected final Hashtable environment; // environment for this context
- protected final Map bindings; // bindings at my level
- protected final Map treeBindings; // all bindings under me
-
- private boolean frozen = false;
- private String nameInNamespace = "";
- public static final String SEPARATOR = "/";
-
- public ReadOnlyContext()
- {
- environment = new Hashtable();
- bindings = new HashMap();
- treeBindings = new HashMap();
- }
-
- public ReadOnlyContext(Hashtable env)
- {
- if (env == null)
- {
- this.environment = new Hashtable();
- }
- else
- {
- this.environment = new Hashtable(env);
- }
-
- this.bindings = Collections.EMPTY_MAP;
- this.treeBindings = Collections.EMPTY_MAP;
- }
-
- public ReadOnlyContext(Hashtable environment, Map bindings)
- {
- if (environment == null)
- {
- this.environment = new Hashtable();
- }
- else
- {
- this.environment = new Hashtable(environment);
- }
-
- this.bindings = bindings;
- treeBindings = new HashMap();
- frozen = true;
- }
-
- public ReadOnlyContext(Hashtable environment, Map bindings, String nameInNamespace)
- {
- this(environment, bindings);
- this.nameInNamespace = nameInNamespace;
- }
-
- protected ReadOnlyContext(ReadOnlyContext clone, Hashtable env)
- {
- this.bindings = clone.bindings;
- this.treeBindings = clone.treeBindings;
- this.environment = new Hashtable(env);
- }
-
- protected ReadOnlyContext(ReadOnlyContext clone, Hashtable env, String nameInNamespace)
- {
- this(clone, env);
- this.nameInNamespace = nameInNamespace;
- }
-
- public void freeze()
- {
- frozen = true;
- }
-
- boolean isFrozen()
- {
- return frozen;
- }
-
- /**
- * internalBind is intended for use only during setup or possibly by suitably synchronized superclasses.
- * It binds every possible lookup into a map in each context. To do this, each context
- * strips off one name segment and if necessary creates a new context for it. Then it asks that context
- * to bind the remaining name. It returns a map containing all the bindings from the next context, plus
- * the context it just created (if it in fact created it). (the names are suitably extended by the segment
- * originally lopped off).
- *
- * @param name
- * @param value
- * @return
- * @throws javax.naming.NamingException
- */
- protected Map internalBind(String name, Object value) throws NamingException
- {
- assert (name != null) && (name.length() > 0);
- assert !frozen;
-
- Map newBindings = new HashMap();
- int pos = name.indexOf('/');
- if (pos == -1)
- {
- if (treeBindings.put(name, value) != null)
- {
- throw new NamingException("Something already bound at " + name);
- }
-
- bindings.put(name, value);
- newBindings.put(name, value);
- }
- else
- {
- String segment = name.substring(0, pos);
- assert segment != null;
- assert !segment.equals("");
- Object o = treeBindings.get(segment);
- if (o == null)
- {
- o = newContext();
- treeBindings.put(segment, o);
- bindings.put(segment, o);
- newBindings.put(segment, o);
- }
- else if (!(o instanceof ReadOnlyContext))
- {
- throw new NamingException("Something already bound where a subcontext should go");
- }
-
- ReadOnlyContext readOnlyContext = (ReadOnlyContext) o;
- String remainder = name.substring(pos + 1);
- Map subBindings = readOnlyContext.internalBind(remainder, value);
- for (Iterator iterator = subBindings.entrySet().iterator(); iterator.hasNext();)
- {
- Map.Entry entry = (Map.Entry) iterator.next();
- String subName = segment + "/" + (String) entry.getKey();
- Object bound = entry.getValue();
- treeBindings.put(subName, bound);
- newBindings.put(subName, bound);
- }
- }
-
- return newBindings;
- }
-
- protected ReadOnlyContext newContext()
- {
- return new ReadOnlyContext();
- }
-
- public Object addToEnvironment(String propName, Object propVal) throws NamingException
- {
- return environment.put(propName, propVal);
- }
-
- public Hashtable getEnvironment() throws NamingException
- {
- return (Hashtable) environment.clone();
- }
-
- public Object removeFromEnvironment(String propName) throws NamingException
- {
- return environment.remove(propName);
- }
-
- public Object lookup(String name) throws NamingException
- {
- if (name.length() == 0)
- {
- return this;
- }
-
- Object result = treeBindings.get(name);
- if (result == null)
- {
- result = bindings.get(name);
- }
-
- if (result == null)
- {
- int pos = name.indexOf(':');
- if (pos > 0)
- {
- String scheme = name.substring(0, pos);
- Context ctx = NamingManager.getURLContext(scheme, environment);
- if (ctx == null)
- {
- throw new NamingException("scheme " + scheme + " not recognized");
- }
-
- return ctx.lookup(name);
- }
- else
- {
- // Split out the first name of the path
- // and look for it in the bindings map.
- CompositeName path = new CompositeName(name);
-
- if (path.size() == 0)
- {
- return this;
- }
- else
- {
- String first = path.get(0);
- Object obj = bindings.get(first);
- if (obj == null)
- {
- throw new NameNotFoundException(name);
- }
- else if ((obj instanceof Context) && (path.size() > 1))
- {
- Context subContext = (Context) obj;
- obj = subContext.lookup(path.getSuffix(1));
- }
-
- return obj;
- }
- }
- }
-
- if (result instanceof LinkRef)
- {
- LinkRef ref = (LinkRef) result;
- result = lookup(ref.getLinkName());
- }
-
- if (result instanceof Reference)
- {
- try
- {
- result = NamingManager.getObjectInstance(result, null, null, this.environment);
- }
- catch (NamingException e)
- {
- throw e;
- }
- catch (Exception e)
- {
- throw (NamingException) new NamingException("could not look up : " + name).initCause(e);
- }
- }
-
- if (result instanceof ReadOnlyContext)
- {
- String prefix = getNameInNamespace();
- if (prefix.length() > 0)
- {
- prefix = prefix + SEPARATOR;
- }
-
- result = new ReadOnlyContext((ReadOnlyContext) result, environment, prefix + name);
- }
-
- return result;
- }
-
- public Object lookup(Name name) throws NamingException
- {
- return lookup(name.toString());
- }
-
- public Object lookupLink(String name) throws NamingException
- {
- return lookup(name);
- }
-
- public Name composeName(Name name, Name prefix) throws NamingException
- {
- Name result = (Name) prefix.clone();
- result.addAll(name);
-
- return result;
- }
-
- public String composeName(String name, String prefix) throws NamingException
- {
- CompositeName result = new CompositeName(prefix);
- result.addAll(new CompositeName(name));
-
- return result.toString();
- }
-
- public NamingEnumeration list(String name) throws NamingException
- {
- Object o = lookup(name);
- if (o == this)
- {
- return new ReadOnlyContext.ListEnumeration();
- }
- else if (o instanceof Context)
- {
- return ((Context) o).list("");
- }
- else
- {
- throw new NotContextException();
- }
- }
-
- public NamingEnumeration listBindings(String name) throws NamingException
- {
- Object o = lookup(name);
- if (o == this)
- {
- return new ReadOnlyContext.ListBindingEnumeration();
- }
- else if (o instanceof Context)
- {
- return ((Context) o).listBindings("");
- }
- else
- {
- throw new NotContextException();
- }
- }
-
- public Object lookupLink(Name name) throws NamingException
- {
- return lookupLink(name.toString());
- }
-
- public NamingEnumeration list(Name name) throws NamingException
- {
- return list(name.toString());
- }
-
- public NamingEnumeration listBindings(Name name) throws NamingException
- {
- return listBindings(name.toString());
- }
-
- public void bind(Name name, Object obj) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void bind(String name, Object obj) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void close() throws NamingException
- {
- // ignore
- }
-
- public Context createSubcontext(Name name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public Context createSubcontext(String name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void destroySubcontext(Name name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void destroySubcontext(String name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public String getNameInNamespace() throws NamingException
- {
- return nameInNamespace;
- }
-
- public NameParser getNameParser(Name name) throws NamingException
- {
- return nameParser;
- }
-
- public NameParser getNameParser(String name) throws NamingException
- {
- return nameParser;
- }
-
- public void rebind(Name name, Object obj) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void rebind(String name, Object obj) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void rename(Name oldName, Name newName) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void rename(String oldName, String newName) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void unbind(Name name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- public void unbind(String name) throws NamingException
- {
- throw new OperationNotSupportedException();
- }
-
- private abstract class LocalNamingEnumeration implements NamingEnumeration
- {
- private Iterator i = bindings.entrySet().iterator();
-
- public boolean hasMore() throws NamingException
- {
- return i.hasNext();
- }
-
- public boolean hasMoreElements()
- {
- return i.hasNext();
- }
-
- protected Map.Entry getNext()
- {
- return (Map.Entry) i.next();
- }
-
- public void close() throws NamingException
- { }
- }
-
- private class ListEnumeration extends ReadOnlyContext.LocalNamingEnumeration
- {
- public Object next() throws NamingException
- {
- return nextElement();
- }
-
- public Object nextElement()
- {
- Map.Entry entry = getNext();
-
- return new NameClassPair((String) entry.getKey(), entry.getValue().getClass().getName());
- }
- }
-
- private class ListBindingEnumeration extends ReadOnlyContext.LocalNamingEnumeration
- {
- public Object next() throws NamingException
- {
- return nextElement();
- }
-
- public Object nextElement()
- {
- Map.Entry entry = getNext();
-
- return new Binding((String) entry.getKey(), entry.getValue());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/naming/jndi.properties b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/naming/jndi.properties
deleted file mode 100644
index 830de5f619..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/naming/jndi.properties
+++ /dev/null
@@ -1,40 +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.
-#
-java.naming.factory.initial = org.apache.qpid.naming.PropertiesFileInitialConextFactory
-
-# use the following property to configure the default connector
-#java.naming.provider.url - ignored.
-
-# register some connection factories
-# connectionfactory.[jndiname] = [ConnectionURL]
-# qpid:username=foo;password=password;client_id=id;virtualhost=path@tpc:localhost:1556
-connectionfactory.local = qpid:tcp:localhost'
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.MyQueue = example.MyQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-topic.ibmStocks = stocks.nyse.ibm
-
-# Register an AMQP destination in JNDI
-# NOTE: Qpid currently only supports direct,topics and headers
-# destination.[jniName] = [BindingURL]
-destination.direct = direct://amq.direct//directQueue
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/JMSTestCase.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/JMSTestCase.java
deleted file mode 100644
index e19058881e..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/JMSTestCase.java
+++ /dev/null
@@ -1,135 +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.
- *
- */
-package org.apache.qpid.nclient;
-
-import java.util.Enumeration;
-
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.framing.AMQShortString;
-
-public class JMSTestCase
-{
-
- public static void main(String[] args)
- {
-
- try
- {
- javax.jms.Connection con = new AMQConnection("qpid:password=pass;username=name@tcp:localhost:5672");
- con.start();
-
- javax.jms.Session ssn = con.createSession(false, 1);
-
- javax.jms.Destination dest = new AMQQueue(new AMQShortString("direct"),"test");
- javax.jms.MessageProducer prod = ssn.createProducer(dest);
- QueueBrowser browser = ssn.createBrowser((Queue)dest, "Test = 'test'");
-
- javax.jms.TextMessage msg = ssn.createTextMessage();
- msg.setStringProperty("TEST", "test");
- msg.setText("Should get this");
- prod.send(msg);
-
- javax.jms.TextMessage msg2 = ssn.createTextMessage();
- msg2.setStringProperty("TEST", "test2");
- msg2.setText("Shouldn't get this");
- prod.send(msg2);
-
-
- Enumeration enu = browser.getEnumeration();
- for (;enu.hasMoreElements();)
- {
- System.out.println(enu.nextElement());
- System.out.println("\n");
- }
-
- javax.jms.MessageConsumer cons = ssn.createConsumer(dest, "Test = 'test'");
- javax.jms.TextMessage m = null; // (javax.jms.TextMessage)cons.receive();
- cons.setMessageListener(new MessageListener()
- {
- public void onMessage(Message m)
- {
- javax.jms.TextMessage m2 = (javax.jms.TextMessage)m;
- try
- {
- System.out.println("headers : " + m2.toString());
- System.out.println("m : " + m2.getText());
- System.out.println("\n\n");
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
-
- });
-
- con.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException e)
- {
- e.printStackTrace();
- }
- });
-
- System.out.println("Waiting");
- while (m == null)
- {
-
- }
-
- System.out.println("Exiting");
-
- /*javax.jms.TextMessage msg = ssn.createTextMessage();
- msg.setText("This is a test message");
- msg.setBooleanProperty("targetMessage", false);
- prod.send(msg);
-
- msg.setBooleanProperty("targetMessage", true);
- prod.send(msg);
-
- javax.jms.TextMessage m = (javax.jms.TextMessage)cons.receiveNoWait();
-
- if (m == null)
- {
- System.out.println("message is null");
- }
- else
- {
- System.out.println("message is not null" + m);
- }*/
-
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/MessagePartListener.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/MessagePartListener.java
deleted file mode 100644
index 6f07dcb469..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/MessagePartListener.java
+++ /dev/null
@@ -1,46 +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.
- */
-package org.apache.qpid.nclient;
-
-import java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.Header;
-import org.apache.qpid.transport.MessageTransfer;
-
-/**
- * Assembles message parts.
- * <p> The sequence of event for transferring a message is as follows:
- * <ul>
- * <li> messageHeaders
- * <li> n calls to addData
- * <li> messageReceived
- * </ul>
- * It is up to the implementation to assemble the message once the different parts
- * are transferred.
- */
-public interface MessagePartListener
-{
-
- /**
- * Inform the listener of the message transfer
- *
- * @param xfr the message transfer object
- */
- public void messageTransfer(MessageTransfer xfr);
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/ByteBufferMessage.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/ByteBufferMessage.java
deleted file mode 100644
index 14bfb4f95e..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/ByteBufferMessage.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.apache.qpid.nclient.util;
-/*
- *
- * 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 java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.*;
-
-import org.apache.qpid.transport.DeliveryProperties;
-import org.apache.qpid.transport.MessageProperties;
-import org.apache.qpid.transport.Header;
-import org.apache.qpid.api.Message;
-
-/**
- * <p>A Simple implementation of the message interface
- * for small messages. When the readData methods are called
- * we assume the message is complete. i.e there want be any
- * appendData operations after that.</p>
- *
- * <p>If you need large message support please see
- * <code>FileMessage</code> and <code>StreamingMessage</code>
- * </p>
- */
-public class ByteBufferMessage implements Message
-{
- private List<ByteBuffer> _data;// = new ArrayList<ByteBuffer>();
- private ByteBuffer _readBuffer;
- private int _dataSize;
- private DeliveryProperties _currentDeliveryProps;
- private MessageProperties _currentMessageProps;
- private int _transferId;
- private Header _header;
-
- public ByteBufferMessage(MessageProperties messageProperties, DeliveryProperties deliveryProperties)
- {
- _currentMessageProps = messageProperties;
- _currentDeliveryProps = deliveryProperties;
- }
-
- public void setHeader(Header header) {
- _header = header;
- }
-
- public Header getHeader() {
- return _header;
- }
-
- public ByteBufferMessage()
- {
- _currentDeliveryProps = new DeliveryProperties();
- _currentMessageProps = new MessageProperties();
- }
-
- public ByteBufferMessage(int transferId)
- {
- _transferId = transferId;
- }
-
- public int getMessageTransferId()
- {
- return _transferId;
- }
-
- public void clearData()
- {
- _data = new LinkedList<ByteBuffer>();
- _readBuffer = null;
- }
-
- public void appendData(byte[] src) throws IOException
- {
- appendData(ByteBuffer.wrap(src));
- }
-
- /**
- * write the data from the current position up to the buffer limit
- */
- public void appendData(ByteBuffer src) throws IOException
- {
- if(_data == null)
- {
- _data = Collections.singletonList(src);
- }
- else
- {
- if(_data.size() == 1)
- {
- _data = new ArrayList<ByteBuffer>(_data);
- }
- _data.add(src);
- }
- _dataSize += src.remaining();
- }
-
- public DeliveryProperties getDeliveryProperties()
- {
- return _currentDeliveryProps;
- }
-
- public MessageProperties getMessageProperties()
- {
- return _currentMessageProps;
- }
-
- public void setDeliveryProperties(DeliveryProperties props)
- {
- _currentDeliveryProps = props;
- }
-
- public void setMessageProperties(MessageProperties props)
- {
- _currentMessageProps = props;
- }
-
- public void readData(byte[] target)
- {
- getReadBuffer().get(target);
- }
-
- public ByteBuffer readData()
- {
- return getReadBuffer();
- }
-
- private void buildReadBuffer()
- {
- //optimize for the simple cases
- if(_data.size() == 1)
- {
- _readBuffer = _data.get(0).duplicate();
- }
- else
- {
- _readBuffer = ByteBuffer.allocate(_dataSize);
- for(ByteBuffer buf:_data)
- {
- _readBuffer.put(buf);
- }
- _readBuffer.flip();
- }
- }
-
- private ByteBuffer getReadBuffer()
- {
- if (_readBuffer != null )
- {
- return _readBuffer.slice();
- }
- else
- {
- if (_data.size() >0)
- {
- buildReadBuffer();
- return _readBuffer.slice();
- }
- else
- {
- return ByteBuffer.allocate(0);
- }
- }
- }
-
- //hack for testing
- @Override public String toString()
- {
- ByteBuffer temp = getReadBuffer();
- byte[] b = new byte[temp.remaining()];
- temp.get(b);
- return new String(b);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/MessageListener.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/MessageListener.java
deleted file mode 100644
index c5edd62143..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/MessageListener.java
+++ /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.
- */
-package org.apache.qpid.nclient.util;
-
-import org.apache.qpid.api.Message;
-
-/**
- *A message listener
- */
-public interface MessageListener
-{
- /**
- * Process an incoming message.
- *
- * @param message The incoming message.
- */
- public void onMessage(Message message);
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/MessagePartListenerAdapter.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/MessagePartListenerAdapter.java
deleted file mode 100644
index 10fd8d2a80..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/nclient/util/MessagePartListenerAdapter.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.apache.qpid.nclient.util;
-/*
- *
- * 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 java.io.IOException;
-import java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.*;
-import org.apache.qpid.nclient.MessagePartListener;
-
-/**
- * This is a simple message assembler.
- * Will call onMessage method of the adaptee
- * when all message data is read.
- *
- * This is a good convinience utility for handling
- * small messages
- */
-public class MessagePartListenerAdapter implements MessagePartListener
-{
- MessageListener _adaptee;
- ByteBufferMessage _currentMsg;
-
- public MessagePartListenerAdapter(MessageListener listener)
- {
- _adaptee = listener;
- }
-
- public void messageTransfer(MessageTransfer xfr)
- {
- _currentMsg = new ByteBufferMessage(xfr.getId());
-
- for (Struct st : xfr.getHeader().getStructs())
- {
- if(st instanceof DeliveryProperties)
- {
- _currentMsg.setDeliveryProperties((DeliveryProperties)st);
-
- }
- else if(st instanceof MessageProperties)
- {
- _currentMsg.setMessageProperties((MessageProperties)st);
- }
-
- }
-
-
- ByteBuffer body = xfr.getBody();
- if (body == null)
- {
- body = ByteBuffer.allocate(0);
- }
-
-
- try
- {
- _currentMsg.appendData(body);
- }
- catch(IOException e)
- {
- // A chance for IO exception
- // doesn't occur as we are using
- // a ByteBuffer
- }
-
- _adaptee.onMessage(_currentMsg);
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/njms/ExceptionHelper.java b/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/njms/ExceptionHelper.java
deleted file mode 100644
index ce790a3b24..0000000000
--- a/M4-RCs/qpid/java/client/src/main/java/org/apache/qpid/njms/ExceptionHelper.java
+++ /dev/null
@@ -1,60 +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.
- */
-package org.apache.qpid.njms;
-
-import org.apache.qpid.QpidException;
-
-import javax.jms.JMSException;
-import javax.transaction.xa.XAException;
-
-/**
- * Helper class for handling exceptions
- */
-public class ExceptionHelper
-{
- static public JMSException convertQpidExceptionToJMSException(Exception exception)
- {
- JMSException jmsException = null;
- if (!(exception instanceof JMSException))
- {
- if (exception instanceof QpidException)
- {
- jmsException = new JMSException(exception.getMessage(), String.valueOf(((QpidException) exception).getErrorCode()));
- }
- else
- {
- jmsException = new JMSException(exception.getMessage());
- }
- jmsException.setLinkedException(exception);
- jmsException.initCause(exception);
- }
- else
- {
- jmsException = (JMSException) exception;
- }
- return jmsException;
- }
-
- static public XAException convertQpidExceptionToXAException(QpidException exception)
- {
- String qpidErrorCode = String.valueOf(exception.getErrorCode());
- // todo map this error to an XA code
- int xaCode = XAException.XAER_PROTO;
- return new XAException(xaCode);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java
deleted file mode 100644
index 2c08f1e34a..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java
+++ /dev/null
@@ -1,185 +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.
- *
- */
-package org.apache.qpid.IBMPerfTest;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.url.URLSyntaxException;
-
-import javax.jms.ConnectionFactory;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.io.File;
-import java.util.Hashtable;
-
-public class JNDIBindConnectionFactory
-{
-
- public static final String CONNECTION_FACTORY_BINDING = "amq.ConnectionFactory";
- public static final String DEFAULT_PROVIDER_FILE_PATH = System.getProperty("java.io.tmpdir") + File.separator + "IBMPerfTestsJNDI";
- public static final String PROVIDER_URL = "file://" + DEFAULT_PROVIDER_FILE_PATH;
- public static final String FSCONTEXT_FACTORY = "com.sun.jndi.fscontext.RefFSContextFactory";
- public static final String DEFAULT_CONNECTION_URL = "amqp://guest:guest@clientid/testpath?brokerlist='tcp://localhost:5672'";
-
- private static void printUsage()
- {
- System.out.println("Using default values: Usage:java JNDIBindConnectionFactory <connection url> [<Connection Factory Binding>] [<Provider URL>] [<JNDI Context Factory>]");
-
- }
-
- public static void main(String[] args)
- {
- Logger.getRootLogger().setLevel(Level.OFF);
-
- String connectionFactoryBinding = CONNECTION_FACTORY_BINDING;
- String provider = PROVIDER_URL;
- String contextFactory = FSCONTEXT_FACTORY;
- if (args.length == 0)
- {
- printUsage();
- System.exit(1);
- }
-
- String connectionURL = args[0];
-
- System.out.println("Using Connection:" + connectionURL + "\n");
-
-
- if (args.length > 1)
- {
- connectionFactoryBinding = args[1];
-
- if (args.length > 2)
- {
- provider = args[2];
-
- if (args.length > 3)
- {
- contextFactory = args[3];
- }
- }
- else
- {
- System.out.println("Using default File System Context Factory");
- System.out.println("Using default Connection Factory Binding:" + connectionFactoryBinding);
- }
- }
- else
- {
- printUsage();
- }
-
-
- System.out.println("File System Context Factory\n" +
- "Connection:" + connectionURL + "\n" +
- "Connection Factory Binding:" + connectionFactoryBinding + "\n" +
- "JNDI Provider URL:" + provider);
-
- if (provider.startsWith("file"))
- {
- File file = new File(provider.substring(provider.indexOf("://") + 3));
-
- if (file.exists() && !file.isDirectory())
- {
- System.out.println("Couldn't make directory file already exists");
- System.exit(1);
- }
- else
- {
- if (!file.exists())
- {
- if (!file.mkdirs())
- {
- System.out.println("Couldn't make directory");
- System.exit(1);
- }
- }
- }
- }
-
- new JNDIBindConnectionFactory(provider, connectionFactoryBinding, contextFactory, connectionURL);
-
- }
-
- public JNDIBindConnectionFactory(String provider, String binding, String contextFactory, String CONNECTION_URL)
- {
- // Set up the environment for creating the initial context
- Hashtable env = new Hashtable(11);
- env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
-
- env.put(Context.PROVIDER_URL, provider);
-
- try
- {
- // Create the initial context
- Context ctx = new InitialContext(env);
-
- // Create the object to be bound
- ConnectionFactory factory = null;
-
- try
- {
- factory = new AMQConnectionFactory(CONNECTION_URL);
-
-
- try
- {
- Object obj = ctx.lookup(binding);
-
- if (obj != null)
- {
- System.out.println("Un-binding previous Connection Factory");
- ctx.unbind(binding);
- }
- }
- catch (NamingException e)
- {
- System.out.println("Operation failed: " + e);
- }
-
- // Perform the bind
- ctx.bind(binding, factory);
- System.out.println("Bound Connection Factory:" + binding);
-
- // Check that it is bound
- Object obj = ctx.lookup(binding);
- System.out.println("Connection URL:" + ((AMQConnectionFactory) obj).getConnectionURL());
-
- System.out.println("JNDI FS Context:" + provider);
- }
- catch (NamingException amqe)
- {
- System.out.println("Operation failed: " + amqe);
- }
- catch (URLSyntaxException e)
- {
- System.out.println("Operation failed: " + e);
- }
-
- }
- catch (NamingException e)
- {
- System.out.println("Operation failed: " + e);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindQueue.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindQueue.java
deleted file mode 100644
index 10e8b94311..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindQueue.java
+++ /dev/null
@@ -1,213 +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.
- *
- */
-package org.apache.qpid.IBMPerfTest;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.io.File;
-import java.util.Hashtable;
-
-public class JNDIBindQueue
-{
- public static final String DEFAULT_PROVIDER_FILE_PATH = System.getProperty("java.io.tmpdir") + File.separator + "IBMPerfTestsJNDI";
- public static final String PROVIDER_URL = "file://" + DEFAULT_PROVIDER_FILE_PATH;
- public static final String FSCONTEXT_FACTORY = "com.sun.jndi.fscontext.RefFSContextFactory";
-
- Connection _connection = null;
- Context _ctx = null;
-
-
- public JNDIBindQueue(String queueBinding, String queueName, String provider, String contextFactory)
- {
- // Set up the environment for creating the initial context
- Hashtable env = new Hashtable(11);
- env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
-
- env.put(Context.PROVIDER_URL, provider);
-
- try
- {
- // Create the initial context
- _ctx = new InitialContext(env);
-
- // Create the object to be bound
-
- try
- {
- _connection = new AMQConnection("amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'");
- System.out.println("Connected");
- }
- catch (Exception amqe)
- {
- System.out.println("Unable to create AMQConnectionFactory:" + amqe);
- }
-
- if (_connection != null)
- {
- bindQueue(queueName, queueBinding);
- }
-
- // Check that it is bound
- Object obj = _ctx.lookup(queueBinding);
-
- System.out.println("Bound Queue:" + ((AMQQueue) obj).toURL());
-
- System.out.println("JNDI FS Context:" + provider);
-
- }
- catch (NamingException e)
- {
- System.out.println("Operation failed: " + e);
- }
- finally
- {
- try
- {
- if (_connection != null)
- {
- _connection.close();
- }
- }
- catch (JMSException closeE)
- {
- System.out.println("Connection closing failed: " + closeE);
- }
- }
-
-
- }
-
-
- private void bindQueue(String queueName, String queueBinding) throws NamingException
- {
-
- try
- {
- Object obj = _ctx.lookup(queueBinding);
-
- if (obj != null)
- {
- System.out.println("Un-binding exisiting object");
- _ctx.unbind(queueBinding);
- }
- }
- catch (NamingException e)
- {
-
- }
-
- Queue queue = null;
- try
- {
-
- Session session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- if (session != null)
- {
- queue = ((AMQSession) session).createQueue(queueName);
- }
- }
- catch (JMSException jmse)
- {
- System.out.println("Unable to create Queue:" + jmse);
- }
-
- // Perform the bind
- _ctx.bind(queueBinding, queue);
- }
-
-
- public static void main(String[] args)
- {
- Logger.getRootLogger().setLevel(Level.OFF);
-
- String provider = JNDIBindQueue.PROVIDER_URL;
- String contextFactory = JNDIBindQueue.FSCONTEXT_FACTORY;
-
- if (args.length > 1)
- {
- String binding = args[0];
- String queueName = args[1];
-
- if (args.length > 2)
- {
- provider = args[2];
-
- if (args.length > 3)
- {
- contextFactory = args[3];
- }
- }
- else
- {
- System.out.println("Using default File System Context Factory");
- }
-
- System.out.println("File System Context Factory\n" +
- "Binding Queue:'" + queueName + "' to '" + binding + "'\n" +
- "JNDI Provider URL:" + provider);
-
- if (provider.startsWith("file"))
- {
- File file = new File(provider.substring(provider.indexOf("://") + 3));
-
- if (file.exists() && !file.isDirectory())
- {
- System.out.println("Couldn't make directory file already exists");
- System.exit(1);
- }
- else
- {
- if (!file.exists())
- {
- if (!file.mkdirs())
- {
- System.out.println("Couldn't make directory");
- System.exit(1);
- }
- }
- }
- }
-
-
- new JNDIBindQueue(binding, queueName, provider, contextFactory);
-
- }
- else
- {
- System.out.println("Using Defaults: Usage:java JNDIBindQueue <Binding> <queue name> [<Provider URL> [<JNDI Context Factory>]]");
- }
-
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindTopic.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindTopic.java
deleted file mode 100644
index ca071c1187..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindTopic.java
+++ /dev/null
@@ -1,212 +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.
- *
- */
-package org.apache.qpid.IBMPerfTest;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.io.File;
-import java.util.Hashtable;
-
-public class JNDIBindTopic
-{
- public static final String DEFAULT_PROVIDER_FILE_PATH = System.getProperty("java.io.tmpdir") + File.separator + "IBMPerfTestsJNDI";
- public static final String PROVIDER_URL = "file://" + DEFAULT_PROVIDER_FILE_PATH;
-
- public static final String FSCONTEXT_FACTORY = "com.sun.jndi.fscontext.RefFSContextFactory";
-
- Connection _connection = null;
- Context _ctx = null;
-
-
- public JNDIBindTopic(String topicBinding, String topicName, String provider, String contextFactory)
- {
- // Set up the environment for creating the initial context
- Hashtable env = new Hashtable(11);
- env.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
-
- env.put(Context.PROVIDER_URL, provider);
-
- try
- {
- // Create the initial context
- _ctx = new InitialContext(env);
-
- // Create the object to be bound
-
- try
- {
- _connection = new AMQConnection("amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'");
- System.out.println("Connected");
- }
- catch (Exception amqe)
- {
- System.out.println("Unable to create AMQConnectionFactory:" + amqe);
- }
-
- if (_connection != null)
- {
- bindTopic(topicName, topicBinding);
- }
-
- // Check that it is bound
- Object obj = _ctx.lookup(topicBinding);
-
- System.out.println("Bound Queue:" + ((AMQTopic) obj).toURL());
-
- System.out.println("JNDI FS Context:" + provider);
-
- }
- catch (NamingException e)
- {
- System.out.println("Operation failed: " + e);
- }
- finally
- {
- try
- {
- if (_connection != null)
- {
- _connection.close();
- }
- }
- catch (JMSException closeE)
- {
- System.out.println("Operation failed: " + closeE);
- }
- }
- }
-
-
- private void bindTopic(String topicName, String topicBinding) throws NamingException
- {
-
- try
- {
- Object obj = _ctx.lookup(topicBinding);
-
- if (obj != null)
- {
- System.out.println("Un-binding exisiting object");
- _ctx.unbind(topicBinding);
- }
- }
- catch (NamingException e)
- {
-
- }
-
- Topic topic = null;
- try
- {
-
- Session session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- if (session != null)
- {
- topic = ((AMQSession) session).createTopic(topicName);
- }
- }
- catch (JMSException jmse)
- {
- System.out.println("Unable to create Topic:" + jmse);
- }
-
- // Perform the bind
- _ctx.bind(topicBinding, topic);
- }
-
-
- public static void main(String[] args)
- {
- Logger.getRootLogger().setLevel(Level.OFF);
-
- String provider = JNDIBindTopic.PROVIDER_URL;
- String contextFactory = JNDIBindTopic.FSCONTEXT_FACTORY;
-
- if (args.length > 1)
- {
- String binding = args[0];
- String queueName = args[1];
-
- if (args.length > 2)
- {
- provider = args[2];
-
- if (args.length > 3)
- {
- contextFactory = args[3];
- }
- }
- else
- {
- System.out.println("Using default File System Context Factory");
- }
-
- System.out.println("File System Context Factory\n" +
- "Binding Topic:'" + queueName + "' to '" + binding + "'\n" +
- "JNDI Provider URL:" + provider);
-
-
- if (provider.startsWith("file"))
- {
- File file = new File(provider.substring(provider.indexOf("://") + 3));
-
- if (file.exists() && !file.isDirectory())
- {
- System.out.println("Couldn't make directory file already exists");
- System.exit(1);
- }
- else
- {
- if (!file.exists())
- {
- if (!file.mkdirs())
- {
- System.out.println("Couldn't make directory");
- System.exit(1);
- }
- }
- }
- }
-
- new JNDIBindTopic(binding, queueName, provider, contextFactory);
-
- }
- else
- {
- System.out.println("Usage:java JNDIBindTopic <Binding> <topic name> [<Provider URL> [<JNDI Context Factory>]]");
- }
-
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/README.txt b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/README.txt
deleted file mode 100644
index 95ee9f9c77..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/README.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-These JNDI setup tools are mainly for use in conjunction with the IBM JMS Performance Harness available here:
-The jar should be placed in the client/test/lib/ directory.
-
-http://www.alphaworks.ibm.com/tech/perfharness
-
-
-These JNDI classes use the the SUN FileSystem context.
-There are two jar files that should be placed in your client/test/lib directory.
-
-http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=7110-jndi-1.2.1-oth-JPR&SiteId=JSC&TransactionId=noreg
-
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/cluster/Client.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/cluster/Client.java
deleted file mode 100644
index cf8059a143..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/cluster/Client.java
+++ /dev/null
@@ -1,129 +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.
- *
- */
-package org.apache.qpid.cluster;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.url.URLSyntaxException;
-
-import javax.jms.MessageListener;
-import javax.jms.Message;
-import javax.jms.Session;
-import javax.jms.JMSException;
-import javax.jms.MessageProducer;
-import javax.jms.TextMessage;
-import java.util.Random;
-
-public class Client
-{
- private final Random random = new Random();
- private final String name;
- private final Session session;
- private final MessageProducer topicProducer;
- private final MessageProducer queueProducer;
-
- Client(AMQConnection connection, String name) throws JMSException, InterruptedException
- {
- this.name = name;
- session = connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
-
- AMQTopic topic = new AMQTopic(((AMQSession)session).getDefaultTopicExchangeName(), new AMQShortString("cluster_test_topic"));
- AMQQueue queue = new AMQQueue(((AMQSession)session).getDefaultQueueExchangeName(), new AMQShortString("cluster_test_queue"));
-
- topicProducer = session.createProducer(topic);
- queueProducer = session.createProducer(queue);
-
- //subscribe to a known topic
- session.createConsumer(topic).setMessageListener(new TopicHandler());
- //subscribe to a known queue
- session.createConsumer(queue).setMessageListener(new QueueHandler());
-
- connection.start();
-
- while(true)
- {
- Thread.sleep(random.nextInt(60000));
- sendToQueue(name + ":" + randomString(5));
- }
- }
-
- private synchronized void sendToTopic(String message) throws JMSException
- {
- topicProducer.send(session.createTextMessage(message));
- }
-
- private synchronized void sendToQueue(String message) throws JMSException
- {
- queueProducer.send(session.createTextMessage(message));
- }
-
- private String randomString(int length){
- char[] c = new char[length];
- for(int i = 0; i < length; i++)
- {
- c[i] = (char) ('A' + random.nextInt(26));
- }
- return new String(c);
- }
-
- private class QueueHandler implements MessageListener
- {
- public void onMessage(Message message)
- {
- try
- {
- sendToTopic(((TextMessage) message).getText());
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- }
- }
- }
-
- private class TopicHandler implements MessageListener
- {
- public void onMessage(Message message)
- {
- try
- {
- System.out.println(((TextMessage) message).getText());
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- }
- }
- }
-
- public static void main(String[] argv) throws AMQException, JMSException, InterruptedException, URLSyntaxException
- {
- //assume args describe the set of brokers to try
-
- String clientName = argv.length > 1 ? argv[1] : "testClient";
- new Client(new AMQConnection(argv.length > 0 ? argv[0] : "vm://:1", "guest", "guest", clientName, "/test"), clientName);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/BasicDeliverTest.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/BasicDeliverTest.java
deleted file mode 100644
index 1db7e200bd..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/BasicDeliverTest.java
+++ /dev/null
@@ -1,277 +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.
- *
- */
-package org.apache.qpid.codec;
-
-import org.apache.qpid.framing.*;
-import org.apache.mina.common.*;
-import org.apache.mina.common.support.BaseIoSession;
-import org.apache.mina.filter.codec.ProtocolDecoderOutput;
-import org.apache.mina.filter.codec.ProtocolEncoderOutput;
-
-import java.net.SocketAddress;
-
-/**
- */
-public class BasicDeliverTest
-{
- public static void main(String[] argv) throws Exception
- {
- BasicDeliverTest test = new BasicDeliverTest();
-
- //warm up:
- test.encode(512, 100000);
-
- //real tests:
- test.encode(16, 10000, 15);
- test.encode(32, 10000, 15);
- test.encode(64, 10000, 15);
- test.encode(128, 10000, 15);
- test.encode(256, 10000, 15);
- test.encode(512, 10000, 15);
- test.encode(1024, 10000, 15);
- test.encode(2048, 10000, 15);
-
- test.decode(16, 10000, 15);
- test.decode(32, 10000, 15);
- test.decode(64, 10000, 15);
- test.decode(128, 10000, 15);
- test.decode(256, 10000, 15);
- test.decode(512, 10000, 15);
- test.decode(1024, 10000, 15);
- test.decode(2048, 10000, 15);
- }
-
- void decode(int size, int count, int iterations) throws Exception
- {
- long min = Long.MAX_VALUE;
- long max = 0;
- long total = 0;
- for (int i = 0; i < iterations; i++)
- {
- long time = decode(size, count);
- total += time;
- if (time < min)
- {
- min = time;
- }
- if (time > max)
- {
- max = time;
- }
- }
- System.out.println("Decoded " + count + " messages of " + size +
- " bytes: avg=" + (total / iterations) + ", min=" + min + ", max=" + max);
- }
-
-
- long decode(int size, int count) throws Exception
- {
- AMQDataBlock block = getDataBlock(size);
- ByteBuffer data = ByteBuffer.allocate((int) block.getSize()); // XXX: Is cast a problem?
- block.writePayload(data);
- data.flip();
- AMQDecoder decoder = new AMQDecoder(false);
- long start = System.currentTimeMillis();
- for (int i = 0; i < count; i++)
- {
- decoder.decode(session, data, decoderOutput);
- data.rewind();
- }
- return System.currentTimeMillis() - start;
- }
-
- void encode(int size, int count, int iterations) throws Exception
- {
- long min = Long.MAX_VALUE;
- long max = 0;
- long total = 0;
- for (int i = 0; i < iterations; i++)
- {
- long time = encode(size, count);
- total += time;
- if (time < min)
- {
- min = time;
- }
- if (time > max)
- {
- max = time;
- }
- }
- System.out.println("Encoded " + count + " messages of " + size +
- " bytes: avg=" + (total / iterations) + ", min=" + min + ", max=" + max);
- }
-
- long encode(int size, int count) throws Exception
- {
- IoSession session = null;
- AMQDataBlock block = getDataBlock(size);
- AMQEncoder encoder = new AMQEncoder();
- long start = System.currentTimeMillis();
- for (int i = 0; i < count; i++)
- {
- encoder.encode(session, block, encoderOutput);
- }
- return System.currentTimeMillis() - start;
- }
-
- private final ProtocolEncoderOutput encoderOutput = new ProtocolEncoderOutput()
- {
-
- public void write(ByteBuffer byteBuffer)
- {
- }
-
- public void mergeAll()
- {
- }
-
- public WriteFuture flush()
- {
- return null;
- }
- };
-
- private final ProtocolDecoderOutput decoderOutput = new ProtocolDecoderOutput()
- {
- public void write(Object object)
- {
- }
-
- public void flush()
- {
- }
- };
-
- private final IoSession session = new BaseIoSession()
- {
-
- protected void updateTrafficMask()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IoService getService()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IoServiceConfig getServiceConfig()
- {
- return null;
- }
-
- public IoHandler getHandler()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IoSessionConfig getConfig()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IoFilterChain getFilterChain()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public TransportType getTransportType()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public SocketAddress getRemoteAddress()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public SocketAddress getLocalAddress()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public SocketAddress getServiceAddress()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getScheduledWriteRequests()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getScheduledWriteBytes()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
- };
-
- private static final char[] DATA = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
-
- static CompositeAMQDataBlock getDataBlock(int size)
- {
- //create a frame representing message delivery
- AMQFrame[] frames = new AMQFrame[3];
- frames[0] = wrapBody(createBasicDeliverBody());
- frames[1] = wrapBody(createContentHeaderBody());
- frames[2] = wrapBody(createContentBody(size));
-
- return new CompositeAMQDataBlock(frames);
- }
-
- static AMQFrame wrapBody(AMQBody body)
- {
- AMQFrame frame = new AMQFrame(1, body);
- return frame;
- }
-
- static ContentBody createContentBody(int size)
- {
- ContentBody body = new ContentBody();
- body.payload = ByteBuffer.allocate(size);
- for (int i = 0; i < size; i++)
- {
- body.payload.put((byte) DATA[i % DATA.length]);
- }
- return body;
- }
-
- static ContentHeaderBody createContentHeaderBody()
- {
- ContentHeaderBody body = new ContentHeaderBody();
- body.properties = new BasicContentHeaderProperties();
- body.weight = 1;
- body.classId = 6;
- return body;
- }
-
- static BasicDeliverBody createBasicDeliverBody()
- {
- BasicDeliverBody body = new BasicDeliverBody((byte) 8, (byte) 0,
- BasicDeliverBody.getClazz((byte) 8, (byte) 0),
- BasicDeliverBody.getMethod((byte) 8, (byte) 0),
- new AMQShortString("myConsumerTag"), 1,
- new AMQShortString("myExchange"), false,
- new AMQShortString("myRoutingKey"));
- return body;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/Client.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/Client.java
deleted file mode 100644
index 3886021277..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/Client.java
+++ /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.
- *
- */
-package org.apache.qpid.codec;
-
-import org.apache.mina.transport.socket.nio.SocketConnector;
-import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.filter.codec.ProtocolCodecFilter;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.BasicDeliverBody;
-import org.apache.qpid.framing.ContentBody;
-
-import java.net.InetSocketAddress;
-
-public class Client extends IoHandlerAdapter
-{
- //private static final int[] DEFAULT_SIZES = new int[]{1024, 512, 256, 128, 56};
- //private static final int[] DEFAULT_SIZES = new int[]{256, 256, 256, 256, 256, 512, 512, 512, 512, 512};
- private static final int[] DEFAULT_SIZES = new int[]{256, 512, 256, 512, 256, 512, 256, 512, 256, 512};
- //private static final int[] DEFAULT_SIZES = new int[]{1024, 1024, 1024, 1024, 1024};
-
- private final IoSession _session;
- private final long _start;
- private final int _size;
- private final int _count;
- private int _received;
- private boolean _closed;
-
- Client(String host, int port, int size, int count) throws Exception
- {
- _count = count;
- _size = size;
- AMQDataBlock block = BasicDeliverTest.getDataBlock(size);
-
- InetSocketAddress address = new InetSocketAddress(host, port);
- ConnectFuture future = new SocketConnector().connect(address, this);
- future.join();
- _session = future.getSession();
-
- _start = System.currentTimeMillis();
- for(int i = 0; i < count; i++)
- {
- _session.write(block);
- }
- }
-
- void close()
- {
- long time = System.currentTimeMillis() - _start;
- System.out.println("Received " + _received + " messages of " + _size
- + " bytes in " + time + "ms.");
- _session.close();
- synchronized(this)
- {
- _closed = true;
- notify();
- }
- }
-
- void waitForClose() throws InterruptedException
- {
- synchronized(this)
- {
- while(!_closed)
- {
- wait();
- }
- }
- }
-
- public void sessionCreated(IoSession session) throws Exception
- {
- session.getFilterChain().addLast("protocolFilter", new ProtocolCodecFilter(new AMQCodecFactory(false)));
- }
-
- public void messageReceived(IoSession session, Object object) throws Exception
- {
- if(isContent(object) && ++_received == _count) close();
- }
-
- public void exceptionCaught(IoSession session, Throwable throwable) throws Exception
- {
- throwable.printStackTrace();
- close();
- }
-
- private static boolean isDeliver(Object o)
- {
- return o instanceof AMQFrame && ((AMQFrame) o).getBodyFrame() instanceof BasicDeliverBody;
- }
-
- private static boolean isContent(Object o)
- {
- return o instanceof AMQFrame && ((AMQFrame) o).getBodyFrame() instanceof ContentBody;
- }
-
- public static void main(String[] argv) throws Exception
- {
- String host = argv.length > 0 ? argv[0] : "localhost";
- int port = argv.length > 1 ? Integer.parseInt(argv[1]) : 8888;
- int count = argv.length > 2 ? Integer.parseInt(argv[2]) : 10000;
- int[] sizes = argv.length > 3 ? new int[]{Integer.parseInt(argv[3])} : DEFAULT_SIZES;
-
- System.out.println("Connecting to " + host + ":" + port);
-
- for(int i = 0; i < sizes.length; i++)
- {
- new Client(host, port, sizes[i], count).waitForClose();
- Thread.sleep(1000);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/Server.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/Server.java
deleted file mode 100644
index fa4295e0b2..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/codec/Server.java
+++ /dev/null
@@ -1,103 +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.
- *
- */
-package org.apache.qpid.codec;
-
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.transport.socket.nio.SocketAcceptor;
-import org.apache.mina.util.SessionUtil;
-import org.apache.mina.filter.codec.ProtocolCodecFilter;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.CompositeAMQDataBlock;
-
-import java.net.InetSocketAddress;
-
-public class Server extends IoHandlerAdapter
-{
- Server(int port) throws Exception
- {
- new SocketAcceptor().bind(new InetSocketAddress(port), this);
- System.out.println("Listening on " + port);
- }
-
- public void sessionCreated(IoSession session) throws Exception
- {
- SessionUtil.initialize(session);
- session.getFilterChain().addLast("protocolFilter", new ProtocolCodecFilter(new AMQCodecFactory(false)));
- }
-
- public void messageReceived(IoSession session, Object object) throws Exception
- {
- getAccumulator(session).received(session, (AMQFrame) object);
- }
-
- public void sessionOpened(IoSession session) throws Exception
- {
- System.out.println("sessionOpened()");
- }
-
- public void sessionClosed(IoSession session) throws Exception
- {
- System.out.println("sessionClosed()");
- }
-
- public void exceptionCaught(IoSession session, Throwable t) throws Exception
- {
- System.out.println("exceptionCaught()");
- t.printStackTrace();
- session.close();
- }
-
- private Accumulator getAccumulator(IoSession session)
- {
- Accumulator a = (Accumulator) session.getAttribute(ACCUMULATOR);
- if(a == null)
- {
- a = new Accumulator();
- session.setAttribute(ACCUMULATOR, a);
- }
- return a;
- }
-
- private static final String ACCUMULATOR = Accumulator.class.getName();
-
- private static class Accumulator
- {
- private final AMQFrame[] frames = new AMQFrame[3];
- private int i;
-
- void received(IoSession session, AMQFrame frame)
- {
- frames[i++] = frame;
- if(i >= frames.length)
- {
- i = 0;
- session.write(new CompositeAMQDataBlock(frames));
- }
- }
- }
-
- public static void main(String[] argv) throws Exception
- {
- int port = argv.length > 0 ? Integer.parseInt(argv[0]) : 8888;
- new Server(port);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java
deleted file mode 100644
index cac0064785..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java
+++ /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.
- *
- */
-package org.apache.qpid.config;
-
-import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.config.ConnectionFactoryInitialiser;
-import org.apache.qpid.config.ConnectorConfig;
-
-import javax.jms.ConnectionFactory;
-
-class AMQConnectionFactoryInitialiser implements ConnectionFactoryInitialiser
-{
- public ConnectionFactory getFactory(ConnectorConfig config)
- {
- return new AMQConnectionFactory(config.getHost(), config.getPort(), "/test_path");
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/AbstractConfig.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/AbstractConfig.java
deleted file mode 100644
index 04381d66a0..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/AbstractConfig.java
+++ /dev/null
@@ -1,69 +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.
- *
- */
-package org.apache.qpid.config;
-
-public abstract class AbstractConfig
-{
- public boolean setOptions(String[] argv)
- {
- try
- {
- for(int i = 0; i < argv.length - 1; i += 2)
- {
- String key = argv[i];
- String value = argv[i+1];
- setOption(key, value);
- }
- return true;
- }
- catch(Exception e)
- {
- System.out.println(e.getMessage());
- }
- return false;
- }
-
- protected int parseInt(String msg, String i)
- {
- try
- {
- return Integer.parseInt(i);
- }
- catch(NumberFormatException e)
- {
- throw new RuntimeException(msg + ": " + i);
- }
- }
-
- protected long parseLong(String msg, String i)
- {
- try
- {
- return Long.parseLong(i);
- }
- catch(NumberFormatException e)
- {
- throw new RuntimeException(msg + ": " + i);
- }
- }
-
- public abstract void setOption(String key, String value);
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java
deleted file mode 100644
index a9984eb09a..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java
+++ /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.
- *
- */
-package org.apache.qpid.config;
-
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-
-public interface ConnectionFactoryInitialiser
-{
- public ConnectionFactory getFactory(ConnectorConfig config) throws JMSException;
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/Connector.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/Connector.java
deleted file mode 100644
index ff2377f087..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/Connector.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.config;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-
-public class Connector
-{
- public Connection createConnection(ConnectorConfig config) throws Exception
- {
- return getConnectionFactory(config).createConnection();
- }
-
- ConnectionFactory getConnectionFactory(ConnectorConfig config) throws Exception
- {
- String factory = config.getFactory();
- if(factory == null) factory = AMQConnectionFactoryInitialiser.class.getName();
- System.out.println("Using " + factory);
- return ((ConnectionFactoryInitialiser) Class.forName(factory).newInstance()).getFactory(config);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/ConnectorConfig.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/ConnectorConfig.java
deleted file mode 100644
index b120ed3f12..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/ConnectorConfig.java
+++ /dev/null
@@ -1,28 +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.
- *
- */
-package org.apache.qpid.config;
-
-public interface ConnectorConfig
-{
- public String getHost();
- public int getPort();
- public String getFactory();
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java
deleted file mode 100644
index 44285efd96..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java
+++ /dev/null
@@ -1,111 +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.
- *
- */
-package org.apache.qpid.config;
-
-import org.apache.qpid.config.ConnectionFactoryInitialiser;
-import org.apache.qpid.config.ConnectorConfig;
-
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.MBeanException;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.naming.NameNotFoundException;
-import java.util.Hashtable;
-
-public class JBossConnectionFactoryInitialiser implements ConnectionFactoryInitialiser
-{
- public ConnectionFactory getFactory(ConnectorConfig config) throws JMSException
- {
- ConnectionFactory cf = null;
- InitialContext ic = null;
- Hashtable ht = new Hashtable();
- ht.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
- String jbossHost = System.getProperty("jboss.host", "eqd-lxamq01");
- String jbossPort = System.getProperty("jboss.port", "1099");
- ht.put(InitialContext.PROVIDER_URL, "jnp://" + jbossHost + ":" + jbossPort);
- ht.put(InitialContext.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
-
- try
- {
- ic = new InitialContext(ht);
- if (!doesDestinationExist("topictest.messages", ic))
- {
- deployTopic("topictest.messages", ic);
- }
- if (!doesDestinationExist("topictest.control", ic))
- {
- deployTopic("topictest.control", ic);
- }
-
- cf = (ConnectionFactory) ic.lookup("/ConnectionFactory");
- return cf;
- }
- catch (NamingException e)
- {
- throw new JMSException("Unable to lookup object: " + e);
- }
- catch (Exception e)
- {
- throw new JMSException("Error creating topic: " + e);
- }
- }
-
- private boolean doesDestinationExist(String name, InitialContext ic) throws Exception
- {
- try
- {
- ic.lookup("/" + name);
- }
- catch (NameNotFoundException e)
- {
- return false;
- }
- return true;
- }
-
- private void deployTopic(String name, InitialContext ic) throws Exception
- {
- MBeanServerConnection mBeanServer = lookupMBeanServerProxy(ic);
-
- ObjectName serverObjectName = new ObjectName("jboss.messaging:service=ServerPeer");
-
- String jndiName = "/" + name;
- try
- {
- mBeanServer.invoke(serverObjectName, "createTopic",
- new Object[]{name, jndiName},
- new String[]{"java.lang.String", "java.lang.String"});
- }
- catch (MBeanException e)
- {
- System.err.println("Error: " + e);
- System.err.println("Cause: " + e.getCause());
- }
- }
-
- private MBeanServerConnection lookupMBeanServerProxy(InitialContext ic) throws NamingException
- {
- return (MBeanServerConnection) ic.lookup("jmx/invoker/RMIAdaptor");
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/flow/ChannelFlowTest.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/flow/ChannelFlowTest.java
deleted file mode 100644
index cb8adae18c..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/flow/ChannelFlowTest.java
+++ /dev/null
@@ -1,112 +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.
- *
- */
-package org.apache.qpid.flow;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-
-public class ChannelFlowTest implements MessageListener
-{
- private int sent;
- private int received;
-
- ChannelFlowTest(String broker) throws Exception
- {
- this(new AMQConnection(broker, "guest", "guest", randomize("Client"), "/test"));
- }
-
- ChannelFlowTest(AMQConnection connection) throws Exception
- {
- this(connection, new AMQQueue(connection.getDefaultQueueExchangeName(), new AMQShortString(randomize("ChannelFlowTest")), true));
- }
-
- ChannelFlowTest(AMQConnection connection, AMQDestination destination) throws Exception
- {
- AMQSession session = (AMQSession) connection.createSession(false, AMQSession.NO_ACKNOWLEDGE, 50,25);
-
- //set up a slow consumer
- session.createConsumer(destination).setMessageListener(this);
- connection.start();
-
- //create a publisher
- MessageProducer producer = session.createProducer(destination);
- Message msg = session.createTextMessage("Message");
-
- //publish in bursts that are fast enough to cause channel flow control
- for(int i = 0; i < 10; i++)
- {
- for(int j = 0; j < 100; j++)
- {
- producer.send(msg);
- sent++;
- }
- waitUntilReceived(sent - 40);
- }
-
- waitUntilReceived(sent);
-
- session.close();
- connection.close();
- }
-
-
- private synchronized void waitUntilReceived(int count) throws InterruptedException
- {
- while(received <count)
- {
- wait();
- }
- }
-
- public synchronized void onMessage(Message message)
- {
- try
- {
- Thread.sleep(50);
-
- received++;
- notify();
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- public static void main(String[] argv) throws Exception
- {
- new ChannelFlowTest(argv.length == 0 ? "localhost:5672" : argv[0]);
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargePublisher.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargePublisher.java
deleted file mode 100644
index 2fe01fc126..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargePublisher.java
+++ /dev/null
@@ -1,196 +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.
- *
- */
-package org.apache.qpid.fragmentation;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.url.URLSyntaxException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.jms.MessageProducer;
-import org.apache.qpid.jms.Session;
-import org.apache.log4j.Logger;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * A client that behaves as follows:
- * <ul><li>Connects to a queue, whose name is specified as a cmd-line argument</li>
- * <li>Creates a temporary queue</li>
- * <li>Creates messages containing a property that is the name of the temporary queue</li>
- * <li>Fires off a message on the original queue and waits for a response on the temporary queue</li>
- * </ul>
- */
-public class TestLargePublisher
-{
- private static final Logger _log = Logger.getLogger(TestLargePublisher.class);
-
- private AMQConnection _connection;
-
- private AMQSession _session;
-
- private class CallbackHandler implements MessageListener
- {
- private int _expectedMessageCount;
-
- private int _actualMessageCount;
-
- private long _startTime;
-
- public CallbackHandler(int expectedMessageCount, long startTime)
- {
- _expectedMessageCount = expectedMessageCount;
- _startTime = startTime;
- }
-
- public void onMessage(Message m)
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Message received: " + m);
- }
- _actualMessageCount++;
- if (_actualMessageCount%1000 == 0)
- {
- _log.info("Received message count: " + _actualMessageCount);
- }
- /*if (!"henson".equals(m.toString()))
- {
- _log.error("AbstractJMSMessage response not correct: expected 'henson' but got " + m.toString());
- }
- else
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("AbstractJMSMessage " + m + " received");
- }
- else
- {
- _log.info("AbstractJMSMessage received");
- }
- } */
-
- if (_actualMessageCount == _expectedMessageCount)
- {
- long timeTaken = System.currentTimeMillis() - _startTime;
- System.out.println("Total time taken to receive " + _expectedMessageCount+ " messages was " +
- timeTaken + "ms, equivalent to " +
- (_expectedMessageCount/(timeTaken/1000.0)) + " messages per second");
- }
- }
- }
-
- public TestLargePublisher(String host, int port, String clientID,
- final int messageCount) throws AMQException,URLSyntaxException
- {
- try
- {
- createConnection(host, port, clientID);
-
- _session = (AMQSession) _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- AMQTopic destination = new AMQTopic(_session.getDefaultTopicExchangeName(), new AMQShortString("large"));
- MessageProducer producer = (MessageProducer) _session.createProducer(destination);
-
- _connection.start();
- //TextMessage msg = _session.createTextMessage(tempDestination.getQueueName() + "/Presented to in conjunction with Mahnah Mahnah and the Snowths");
- final long startTime = System.currentTimeMillis();
-
- for (int i = 0; i < messageCount; i++)
- {
- BytesMessage msg = _session.createBytesMessage();
- populateMessage(msg);
- producer.send(msg);
- }
- _log.info("Finished sending " + messageCount + " messages");
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- }
- }
-
- private void createConnection(String host, int port, String clientID) throws AMQException , URLSyntaxException
- {
- _connection = new AMQConnection(host, port, "guest", "guest",
- clientID, "/test");
- }
-
- private void populateMessage(BytesMessage msg) throws JMSException
- {
- int size = 1024 * 187; // 187k
- byte[] data = new byte[size];
- for (int i = 0; i < data.length; i++)
- {
- data[i] = (byte)(i%25);
- }
- msg.writeBytes(data);
- }
-
- /**
- *
- * @param args argument 1 if present specifies the name of the temporary queue to create. Leaving it blank
- * means the server will allocate a name.
- */
- public static void main(String[] args) throws URLSyntaxException
- {
- final String host;
- final int port;
- final int numMessages;
- if (args.length == 0)
- {
- host = "localhost";
- port = 5672;
- numMessages = 100;
-// System.err.println("Usage: TestLargePublisher <host> <port> <number of messages>");
- }
- else
- {
- host = args[0];
- port = Integer.parseInt(args[1]);
- numMessages = Integer.parseInt(args[2]);
- }
-
- try
- {
- InetAddress address = InetAddress.getLocalHost();
- String clientID = address.getHostName() + System.currentTimeMillis();
- TestLargePublisher client = new TestLargePublisher(host, port, clientID, numMessages);
- }
- catch (UnknownHostException e)
- {
- e.printStackTrace();
- }
- catch (AMQException e)
- {
- System.err.println("Error in client: " + e);
- e.printStackTrace();
- }
-
- //System.exit(0);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargeSubscriber.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargeSubscriber.java
deleted file mode 100644
index b0cde22349..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargeSubscriber.java
+++ /dev/null
@@ -1,167 +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.
- *
- */
-package org.apache.qpid.fragmentation;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.log4j.Logger;
-
-import javax.jms.*;
-import java.net.InetAddress;
-
-public class TestLargeSubscriber
-{
- private static final Logger _logger = Logger.getLogger(TestLargeSubscriber.class);
-
- private static MessageProducer _destinationProducer;
-
- private static String _destinationName;
-
- public static void main(String[] args)
- {
- _logger.info("Starting...");
-
- final String host;
- final int port;
- final String username;
- final String password;
- final String virtualPath;
- final int numExpectedMessages;
- if (args.length == 0)
- {
- host = "localhost";
- port = 5672;
- username = "guest";
- password = "guest";
- virtualPath = "/test";
- numExpectedMessages = 100;
- }
- else if (args.length == 6)
- {
- host = args[0];
- port = Integer.parseInt(args[1]);
- username = args[2];
- password = args[3];
- virtualPath = args[4];
- numExpectedMessages = Integer.parseInt(args[5]);
- }
- else
- {
- System.out.println("Usage: host port username password virtual-path expectedMessageCount");
- System.exit(1);
- throw new RuntimeException("cannot be reached");
- }
-
- try
- {
- InetAddress address = InetAddress.getLocalHost();
- AMQConnection con = new AMQConnection(host, port, username, password,
- address.getHostName(), virtualPath);
- final AMQSession session = (AMQSession) con.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- final int expectedMessageCount = numExpectedMessages;
-
- MessageConsumer consumer = session.createConsumer(new AMQTopic(session.getDefaultTopicExchangeName(),
- new AMQShortString("large")),
- 100, true, false, null);
-
- consumer.setMessageListener(new MessageListener()
- {
- private int _messageCount;
-
- private long _startTime = 0;
-
- public void onMessage(Message message)
- {
- validateMessage(message);
- if (_messageCount++ == 0)
- {
- _startTime = System.currentTimeMillis();
- }
- if (_logger.isInfoEnabled())
- {
- _logger.info("Got message '" + message + "'");
- }
- if (_messageCount == expectedMessageCount)
- {
- long totalTime = System.currentTimeMillis() - _startTime;
- _logger.error("Total time to receive " + _messageCount + " messages was " +
- totalTime + "ms. Rate is " + (_messageCount/(totalTime/1000.0)));
- }
- }
-
- private void validateMessage(Message message)
- {
- if (!(message instanceof BytesMessage))
- {
- _logger.error("Message is not of correct type - should be BytesMessage and is " +
- message.getClass());
- }
- BytesMessage bm = (BytesMessage) message;
- final int expectedSize = 1024 * 187; // 187k
- try
- {
- if (bm.getBodyLength() != expectedSize)
- {
- _logger.error("Message is not correct length - should be " + expectedSize + " and is " +
- bm.getBodyLength());
- }
- }
- catch (JMSException e)
- {
- _logger.error("Failed to validate message: " + e, e);
- }
- try
- {
- byte[] data = new byte[(int)bm.getBodyLength()];
- bm.readBytes(data);
- for (int i = 0; i < data.length; i++)
- {
- if (data[i] != (byte)(i%25))
- {
- _logger.error("byte " + i + " of message is wrong - should be " + i%25 + " but is " +
- data[i]);
- }
- }
- _logger.info("***** Validated message successfully");
- }
- catch (JMSException e)
- {
- _logger.error("Failed to validate message: " + e, e);
- }
- }
- });
- con.start();
- }
- catch (Throwable t)
- {
- System.err.println("Fatal error: " + t);
- t.printStackTrace();
- }
-
- System.out.println("Waiting...");
- }
-}
-
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/Listener.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/Listener.java
deleted file mode 100644
index cb5caefc1e..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/Listener.java
+++ /dev/null
@@ -1,117 +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.
- *
- */
-package org.apache.qpid.headers;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.jms.Session;
-//import org.apache.qpid.testutil.Config;
-
-import javax.jms.MessageListener;
-import javax.jms.Message;
-import javax.jms.Destination;
-import javax.jms.MessageProducer;
-import javax.jms.JMSException;
-
-public class Listener //implements MessageListener
-{
-/* private final AMQConnection _connection;
- private final MessageProducer _controller;
- private final AMQSession _session;
- private final MessageFactory _factory;
- private int count;
- private long start;
-
- Listener(AMQConnection connection, Destination exchange) throws Exception
- {
- _connection = connection;
- _session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- _factory = new MessageFactory(_session, 0, 19);
-
- //register for events
- _factory.createConsumer(exchange).setMessageListener(this);
- _connection.start();
-
- _controller = _session.createProducer(exchange);
- }
-
- private void shutdown()
- {
- try
- {
- _session.close();
- _connection.stop();
- _connection.close();
- }
- catch(Exception e)
- {
- e.printStackTrace(System.out);
- }
- }
-
- private void report()
- {
- try
- {
- String msg = getReport();
- _controller.send(_factory.createReportResponseMessage(msg));
- System.out.println("Sent report: " + msg);
- }
- catch(Exception e)
- {
- e.printStackTrace(System.out);
- }
- }
-
- private String getReport() throws JMSException
- {
- long time = (System.currentTimeMillis() - start);
- return "Received " + count + " in " + time + "ms";
- }
-
- public void onMessage(Message message)
- {
- if(count == 0) start = System.currentTimeMillis();
-
- if(_factory.isShutdown(message))
- {
- shutdown();
- }
- else if(_factory.isReport(message))
- {
- //send a report:
- report();
- }
- else if (++count % 100 == 0)
- {
- System.out.println("Received " + count + " messages.");
- }
- }
-
- public static void main(String[] argv) throws Exception
- {
- Config config = new Config();
- config.setType(Config.HEADERS);
- config.setName("test_headers_exchange");
- config.setOptions(argv);
- new Listener((AMQConnection) config.getConnection(), config.getDestination());
- }*/
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/MessageFactory.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/MessageFactory.java
deleted file mode 100644
index a2d575fdd4..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/MessageFactory.java
+++ /dev/null
@@ -1,175 +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.
- *
- */
-package org.apache.qpid.headers;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.FieldTableFactory;
-
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.TextMessage;
-
-/**
- */
-class MessageFactory
-{
- private static final char[] DATA = "abcdefghijklmnopqrstuvwxyz".toCharArray();
-
- private final AMQSession _session;
- private final byte[] _payload;
-
- private String[] _headerNames;
-
- MessageFactory(AMQSession session)
- {
- this(session, Integer.getInteger("amqj.test.message_size", 256).intValue(), 5);
- }
-
- MessageFactory(AMQSession session, int payloadSize, int headerCount)
- {
- if (headerCount < 1)
- {
- throw new IllegalArgumentException("Header count must be positive");
- }
- _session = session;
- _payload = new byte[payloadSize];
- for (int i = 0; i < _payload.length; i++)
- {
- _payload[i] = (byte) DATA[i % DATA.length];
- }
- _headerNames = new String[headerCount];
- // note that with the standard encoding the headers get prefixed with an S to indicate their type
- for (int i = 0; i < _headerNames.length; i++)
- {
- if (i < 10)
- {
- _headerNames[i] = "F000" + i;
- }
- else if (i >= 10 && i < 100)
- {
- _headerNames[i] = "F00" + i;
- }
- else
- {
- _headerNames[i] = "F0" + i;
- }
- }
- }
-
- Message createEventMessage() throws JMSException
- {
- BytesMessage msg = _session.createBytesMessage();
- if (_payload.length != 0)
- {
- msg.writeBytes(_payload);
- }
- return setHeaders(msg, _headerNames);
- }
-
- Message createShutdownMessage() throws JMSException
- {
- return setHeaders(_session.createMessage(), new String[]{"F0000", "SHUTDOWN"});
- }
-
- Message createReportRequestMessage() throws JMSException
- {
- return setHeaders(_session.createMessage(), new String[]{"F0000", "REPORT"});
- }
-
- Message createReportResponseMessage(String msg) throws JMSException
- {
- return setHeaders(_session.createTextMessage(msg), new String[]{"CONTROL", "REPORT"});
- }
-
- boolean isShutdown(Message m)
- {
- return checkPresent(m, "SHUTDOWN");
- }
-
- boolean isReport(Message m)
- {
- return checkPresent(m, "REPORT");
- }
-
- Object getReport(Message m)
- {
- try
- {
- return ((TextMessage) m).getText();
- }
- catch (JMSException e)
- {
- e.printStackTrace(System.out);
- return e.toString();
- }
- }
-
- FieldTable getConsumerBinding()
- {
- FieldTable binding = FieldTableFactory.newFieldTable();
- binding.setString("SF0000", "value");
- return binding;
- }
-
- FieldTable getControllerBinding()
- {
- FieldTable binding = FieldTableFactory.newFieldTable();
- binding.setString("SCONTROL", "value");
- return binding;
- }
-
- MessageConsumer createConsumer(Destination source) throws Exception
- {
- return _session.createConsumer(source, 0, false, true, null, getConsumerBinding());
- }
-
- MessageConsumer createController(Destination source) throws Exception
- {
- return _session.createConsumer(source, 0, false, true, null, getControllerBinding());
- }
-
- private static boolean checkPresent(Message m, String s)
- {
- try
- {
- return m.getStringProperty(s) != null;
- }
- catch (JMSException e)
- {
- e.printStackTrace(System.out);
- return false;
- }
- }
-
- private static Message setHeaders(Message m, String[] headers) throws JMSException
- {
- for (int i = 0; i < headers.length; i++)
- {
- // the value in GRM is 5 bytes
- m.setStringProperty(headers[i], "value");
- }
- return m;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/Publisher.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/Publisher.java
deleted file mode 100644
index d9ef702c48..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/headers/Publisher.java
+++ /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.
- *
- */
-package org.apache.qpid.headers;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-//import org.apache.qpid.testutil.Config;
-
-import javax.jms.*;
-
-public class Publisher // implements MessageListener
-{
-/* private final Object _lock = new Object();
- private final AMQConnection _connection;
- private final AMQSession _session;
- private final Destination _exchange;
- private final MessageFactory _factory;
- private final MessageProducer _publisher;
- private int _count;
-
- Publisher(AMQConnection connection, Destination exchange) throws Exception
- {
- _connection = connection;
- _exchange = exchange;
- _session = (AMQSession) _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- _factory = new MessageFactory(_session, 0, 19);
- _publisher = _session.createProducer(_exchange);
- }
-
- Publisher(Config config) throws Exception
- {
- this((AMQConnection) config.getConnection(), config.getDestination());
- }
-
- private void test(int msgCount, int consumerCount) throws Exception
- {
- _count = consumerCount;
- _factory.createController(_exchange).setMessageListener(this);
- _connection.start();
- long start = System.currentTimeMillis();
- publish(msgCount);
- waitForCompletion(consumerCount);
- long end = System.currentTimeMillis();
-
- System.out.println("Completed in " + (end - start) + " ms.");
-
- //request shutdown
- _publisher.send(_factory.createShutdownMessage());
-
- _connection.stop();
- _connection.close();
- }
-
- private void publish(int count) throws Exception
- {
-
- //send events
- for (int i = 0; i < count; i++)
- {
- _publisher.send(_factory.createEventMessage());
- if ((i + 1) % 100 == 0)
- {
- System.out.println("Sent " + (i + 1) + " messages");
- }
- }
-
- //request report
- _publisher.send(_factory.createReportRequestMessage());
- }
-
- private void waitForCompletion(int consumers) throws Exception
- {
- System.out.println("Waiting for completion...");
- synchronized (_lock)
- {
- while (_count > 0)
- {
- _lock.wait();
- }
- }
- }
-
-
- public void onMessage(Message message)
- {
- System.out.println("Received report " + _factory.getReport(message) + " " + --_count + " remaining");
- if (_count == 0)
- {
- synchronized (_lock)
- {
- _lock.notify();
- }
- }
- }
-
-
- public static void main(String[] argv) throws Exception
- {
- if (argv.length >= 2)
- {
- int msgCount = Integer.parseInt(argv[argv.length - 2]);
- int consumerCount = Integer.parseInt(argv[argv.length - 1]);
-
- Config config = new Config();
- config.setType(Config.HEADERS);
- config.setName("test_headers_exchange");
- String[] options = new String[argv.length - 2];
- System.arraycopy(argv, 0, options, 0, options.length);
- config.setOptions(options);
-
- new Publisher(config).test(msgCount, consumerCount);
- }
-
- }*/
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Bind.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Bind.java
deleted file mode 100644
index ee6a12c233..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Bind.java
+++ /dev/null
@@ -1,273 +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.
- *
- */
-package org.apache.qpid.jndi.referenceable;
-
-import org.apache.qpid.client.*;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.url.URLSyntaxException;
-
-import javax.jms.*;
-import javax.naming.*;
-
-import java.util.Properties;
-import java.io.InputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-/**
- * Binds a reference from a JNDI source.
- * Given a properties file with the JNDI information and a binding string.
- */
-public class Bind
-{
- private static final String USAGE="USAGE: java bind <JNDI Properties file> -cf <url> <binding> | -c <url> <binding> [-t <topic Name> <binding>] [-q <queue Name> <binding>]";
- public Bind(String propertiesFile, String bindingURL, Referenceable reference) throws NameAlreadyBoundException, NoInitialContextException
- {
- // Set up the environment for creating the initial context
- String qpid_home = System.getProperty("QPID_HOME");
-
- if (qpid_home == null || qpid_home.equals(""))
- {
- System.out.println("QPID_HOME is not set");
- System.exit(1);
- }
-
- if (qpid_home.charAt(qpid_home.length() - 1) != '/')
- {
- qpid_home += "/";
- }
-
- try
- {
- InputStream inputStream = new FileInputStream(qpid_home + propertiesFile);
- Properties properties = new Properties();
- properties.load(inputStream);
-
- // Create the initial context
- Context ctx = new InitialContext(properties);
-
- // Perform the binds
- ctx.bind(bindingURL, reference);
-
- // Close the context when we're done
- ctx.close();
- }
- catch (IOException ioe)
- {
- System.out.println("Unable to access properties file:" + propertiesFile + " Due to:" + ioe);
- }
- catch (NamingException e)
- {
- System.out.println("Operation failed: " + e);
- if (e instanceof NameAlreadyBoundException)
- {
- throw (NameAlreadyBoundException) e;
- }
-
- if (e instanceof NoInitialContextException)
- {
- throw (NoInitialContextException) e;
- }
- }
-
- }
-
- private static String parse(String[] args, int index, String what, String type)
- {
- try
- {
- return args[index];
- }
- catch (IndexOutOfBoundsException ioobe)
- {
- System.out.println("ERROR: No " + what + " specified for " + type + ".");
- System.out.println(USAGE);
- System.exit(1);
- }
-
- // The path is either return normally or exception.. which calls system exit so keep the compiler happy
- return "Never going to happen";
- }
-
-
- public static void main(String[] args) throws NameAlreadyBoundException, NoInitialContextException, URLSyntaxException, AMQException, JMSException
- {
-
-
- org.apache.log4j.Logger.getRootLogger().setLevel(org.apache.log4j.Level.OFF);
-
-// org.apache.log4j.Logger _logger = org.apache.log4j.Logger.getLogger(AMQConnection.class);
-// _logger.setLevel(org.apache.log4j.Level.OFF);
-
- boolean exit = false;
-
- String qpid_home = System.getProperty("QPID_HOME");
-
- if (qpid_home == null || qpid_home.equals(""))
- {
- System.out.println("QPID_HOME is not set");
- exit = true;
- }
-
- if (args.length <= 2)
- {
- System.out.println("At least a connection or connection factory must be requested to be bound.");
- exit = true;
- }
- else
- {
- if ((args.length - 1) % 3 != 0)
- {
- System.out.println("Not all values have full details");
- exit = true;
- }
- }
- if (exit)
- {
- System.out.println(USAGE);
- System.exit(1);
- }
-
- if (qpid_home.charAt(qpid_home.length() - 1) != '/')
-
- {
- qpid_home += "/";
- }
-
- AMQConnectionFactory cf = null;
- AMQConnection c = null;
- AMQSession session = null;
- Referenceable reference = null;
-
- for (int index = 1; index < args.length; index ++)
- {
- String obj = args[index];
-
- String what = "Invalid";
- String binding;
-
- if (obj.startsWith("-c"))
- {
- boolean isFactory = obj.contains("f");
-
-
- if (isFactory)
- {
- what = "ConnectionFactory";
- }
- else
- {
- what = "Factory";
- }
-
- String url = parse(args, ++index, "url", what);
-
- if (isFactory)
- {
-
- cf = new AMQConnectionFactory(url);
- reference = cf;
- }
- else
- {
- c = new AMQConnection(url);
- reference = c;
- }
-
- }
-
- if (obj.equals("-t") || obj.equals("-q"))
- {
- if (c == null)
- {
- c = (AMQConnection) cf.createConnection();
- }
-
- if (session == null)
- {
- session = (AMQSession) c.createSession(false, Session.AUTO_ACKNOWLEDGE);
- }
-
- }
-
- if (obj.equals("-t"))
- {
-
- String topicName = parse(args, ++index, "Topic Name", "Topic");
- reference = (AMQTopic) session.createTopic(topicName);
- what = "Topic";
- }
- else
- {
- if (obj.equals("-q"))
- {
- String topicName = parse(args, ++index, "Queue Name", "Queue");
- reference = (AMQQueue) session.createQueue(topicName);
- what = "Queue";
- }
- }
-
- binding = parse(args, ++index, "binding", what);
- if (binding == null)
- {
- System.out.println(obj + " is not a known Object to bind.");
- System.exit(1);
- }
- else
- {
- System.out.print("Binding:" + reference + " to " + binding);
- try
- {
- new Bind(args[0], binding, reference);
- System.out.println(" ..Successful");
-
- }
- catch (NameAlreadyBoundException nabe)
- {
- System.out.println("");
- if (!obj.startsWith("-c") || index == args.length - 1)
- {
- throw nabe;
- }
- else
- {
- System.out.println("Continuing with other bindings using the same connection details");
- }
- }
- finally
- {
- if (!obj.startsWith("-c") || index == args.length - 1)
- {
- if (c != null)
- {
- c.close();
- }
- }
- }
- }
- }
-
- if (c != null)
- {
- c.close();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Lookup.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Lookup.java
deleted file mode 100644
index 1c9d8b0fd5..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Lookup.java
+++ /dev/null
@@ -1,196 +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.
- *
- */
-package org.apache.qpid.jndi.referenceable;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- * Looksup a reference from a JNDI source.
- * Given a properties file with the JNDI information and a binding string.
- */
-public class Lookup
-{
- private static final String USAGE = "USAGE: java lookup <JNDI Properties file> -b <binding>";
- private Properties _properties;
- private Object _object;
-
- public Lookup(String propertiesFile, String bindingValue) throws NamingException
- {
- // Set up the environment for creating the initial context
- String qpid_home = System.getProperty("QPID_HOME");
-
- if (qpid_home == null || qpid_home.equals(""))
- {
- System.out.println("QPID_HOME is not set");
- System.exit(1);
- }
-
- if (qpid_home.charAt(qpid_home.length() - 1) != '/')
- {
- qpid_home += "/";
- }
-
- try
- {
- InputStream inputStream = new FileInputStream(qpid_home + propertiesFile);
- Properties properties = new Properties();
- properties.load(inputStream);
-
- _properties = properties;
- lookup(bindingValue);
- }
- catch (IOException ioe)
- {
- System.out.println("Unable to access properties file:" + propertiesFile + " Due to:" + ioe);
- }
- }
-
- public Object lookup(String bindingValue) throws NamingException
- {
-
- // Create the initial context
- Context ctx = new InitialContext(_properties);
-
- // Perform the binds
- _object = ctx.lookup(bindingValue);
-
- // Close the context when we're done
- ctx.close();
-
- return getObject();
- }
-
- public Object getObject()
- {
- return _object;
- }
-
- private static String parse(String[] args, int index, String what)
- {
- try
- {
- return args[index];
- }
- catch (IndexOutOfBoundsException ioobe)
- {
- System.out.println("ERROR: No " + what + " specified.");
- System.out.println(USAGE);
- System.exit(1);
- }
-
- // The path is either return normally or exception.. which calls system exit so keep the compiler happy
- return "Never going to happen";
- }
-
-
- public static void main(String[] args) throws NamingException
- {
- boolean exit = false;
-
- String qpid_home = System.getProperty("QPID_HOME");
-
- if (qpid_home == null || qpid_home.equals(""))
- {
- System.out.println("QPID_HOME is not set");
- exit = true;
- }
-
- if (args.length <= 2)
- {
- System.out.println("At least a connection or connection factory must be requested to be bound.");
- exit = true;
- }
- else
- {
- if ((args.length - 1) % 2 != 0)
- {
- System.out.println("Not all values have full details");
- exit = true;
- }
- }
- if (exit)
- {
- System.out.println(USAGE);
- System.exit(1);
- }
-
- if (qpid_home.charAt(qpid_home.length() - 1) != '/')
-
- {
- qpid_home += "/";
- }
-
- for (int index = 1; index < args.length; index ++)
- {
- String obj = args[index];
-
-
- if (obj.equals("-b"))
- {
- String binding = parse(args, ++index, "binding");
-
- if (binding == null)
- {
- System.out.println("Binding not specified.");
- System.exit(1);
- }
- else
- {
- System.out.print("Looking up:" + binding);
- try
- {
- Lookup l = new Lookup(args[0], binding);
-
- Object object = l.getObject();
-
- if (object instanceof Connection)
- {
- try
- {
- ((Connection) object).close();
- }
- catch (JMSException jmse)
- {
- ;
- }
- }
- }
- catch (NamingException nabe)
- {
- System.out.println("Problem unbinding " + binding + " continuing with other values.");
- }
- }
- }// if -b
- else
- {
- System.out.println("Continuing with other bindings option not known:" + obj);
- }
- }//for
- }//main
-}//class
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Unbind.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Unbind.java
deleted file mode 100644
index 1acead674c..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Unbind.java
+++ /dev/null
@@ -1,166 +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.
- *
- */
-package org.apache.qpid.jndi.referenceable;
-
-import javax.naming.*;
-
-import java.util.Properties;
-import java.io.InputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-/**
- * Unbinds a reference from a JNDI source.
- * Given a properties file with the JNDI information and a binding string.
- */
-public class Unbind
-{
- private static final String USAGE = "USAGE: java unbind <JNDI Properties file> -b <binding>";
-
- public Unbind(String propertiesFile, String bindingValue) throws NamingException
- {
- // Set up the environment for creating the initial context
- String qpid_home = System.getProperty("QPID_HOME");
-
- if (qpid_home == null || qpid_home.equals(""))
- {
- System.out.println("QPID_HOME is not set");
- System.exit(1);
- }
-
- if (qpid_home.charAt(qpid_home.length() - 1) != '/')
- {
- qpid_home += "/";
- }
-
- try
- {
- InputStream inputStream = new FileInputStream(qpid_home + propertiesFile);
- Properties properties = new Properties();
- properties.load(inputStream);
-
- // Create the initial context
- Context ctx = new InitialContext(properties);
-
- // Perform the binds
- ctx.unbind(bindingValue);
-
- // Close the context when we're done
- ctx.close();
- }
- catch (IOException ioe)
- {
- System.out.println("Unable to access properties file:" + propertiesFile + " Due to:" + ioe);
- }
- }
-
- private static String parse(String[] args, int index, String what)
- {
- try
- {
- return args[index];
- }
- catch (IndexOutOfBoundsException ioobe)
- {
- System.out.println("ERROR: No " + what + " specified.");
- System.out.println(USAGE);
- System.exit(1);
- }
-
- // The path is either return normally or exception.. which calls system exit so keep the compiler happy
- return "Never going to happen";
- }
-
-
- public static void main(String[] args) throws NamingException
- {
- boolean exit = false;
-
- String qpid_home = System.getProperty("QPID_HOME");
-
- if (qpid_home == null || qpid_home.equals(""))
- {
- System.out.println("QPID_HOME is not set");
- exit = true;
- }
-
- if (args.length <= 2)
- {
- System.out.println("At least a connection or connection factory must be requested to be bound.");
- exit = true;
- }
- else
- {
- if ((args.length - 1) % 2 != 0)
- {
- System.out.println("Not all values have full details");
- exit = true;
- }
- }
- if (exit)
- {
- System.out.println(USAGE);
- System.exit(1);
- }
-
- if (qpid_home.charAt(qpid_home.length() - 1) != '/')
-
- {
- qpid_home += "/";
- }
-
- for (int index = 1; index < args.length; index ++)
- {
- String obj = args[index];
-
-
- if (obj.equals("-b"))
- {
- String binding = parse(args, ++index, "binding");
-
- if (binding == null)
- {
- System.out.println("Binding not specified.");
- System.exit(1);
- }
- else
- {
- System.out.print("UnBinding:" + binding);
- try
- {
- new Unbind(args[0], binding);
- System.out.println(" ..Successful");
- }
- catch (NamingException nabe)
- {
- System.out.println("");
-
- System.out.println("Problem unbinding " + binding + " continuing with other values.");
- }
- }
- }// if -b
- else
- {
- System.out.println("Continuing with other bindings option not known:" + obj);
- }
- }//for
- }//main
-}//class
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/latency/LatencyTest.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/latency/LatencyTest.java
deleted file mode 100644
index 4865a68dc4..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/latency/LatencyTest.java
+++ /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.
- *
- */
-package org.apache.qpid.latency;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-
-import javax.jms.MessageProducer;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.JMSException;
-import javax.jms.TextMessage;
-import javax.jms.BytesMessage;
-
-public class LatencyTest implements MessageListener
-{
- private volatile boolean waiting;
- private int sent;
- private int received;
-
- private final byte[] data;
-
- private long min = Long.MAX_VALUE;
- private long max = 0;
- private long total = 0;
-
- LatencyTest(String broker, int count, int delay, int length) throws Exception
- {
- this(new AMQConnection(broker, "guest", "guest", randomize("Client"), "/test"), count, delay, length);
- }
-
- LatencyTest(AMQConnection connection, int count, int delay, int length) throws Exception
- {
- this(connection, new AMQQueue(connection.getDefaultQueueExchangeName(), new AMQShortString(randomize("LatencyTest")), true), count, delay, length);
- }
-
- LatencyTest(AMQConnection connection, AMQDestination destination, int count, int delay, int length) throws Exception
- {
- AMQSession session = (AMQSession) connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
-
- data = new byte[length];
- for(int i = 0; i < data.length; i++)
- {
- data[i] = (byte) (i % 100);
- }
-
- //set up a consumer
- session.createConsumer(destination).setMessageListener(this);
- connection.start();
-
- //create a publisher
- MessageProducer producer = session.createProducer(destination, false, false, true);
-
- //publish at a low volume
- for(int i = 0; i < count; i++)
- {
- BytesMessage msg = session.createBytesMessage();
- msg.writeBytes(data);
- msg.setStringProperty("sent-at", Long.toString(System.nanoTime()));
- producer.send(msg);
- Thread.sleep(delay);
- if(++sent % 100 == 0)
- {
- System.out.println("Sent " + sent + " of " + count);
- }
- }
-
- waitUntilReceived(sent);
-
- session.close();
- connection.close();
-
- System.out.println("Latency (in nanoseconds): avg=" + (total/sent) + ", min=" + min + ", max=" + max
- + ", avg(discarding min and max)=" + ((total - min - max) / (sent - 2)));
- }
-
-
- private synchronized void waitUntilReceived(int count) throws InterruptedException
- {
- waiting = true;
- while(received < count)
- {
- wait();
- }
- waiting = false;
- }
-
- public void onMessage(Message message)
- {
- received++;
- try
- {
- long sent = Long.parseLong(message.getStringProperty("sent-at"));
- long time = System.nanoTime() - sent;
- total += time;
- min = Math.min(min, time);
- max = Math.max(max, time);
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- }
-
- if(waiting){
- synchronized(this)
- {
- notify();
- }
- }
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- public static void main(String[] argv) throws Exception
- {
- String host = argv.length > 0 ? argv[0] : "localhost:5672";
- if("-help".equals(host))
- {
- System.out.println("Usage: <broker> <message count> <delay between messages> <message size>");
- }
- int count = argv.length > 1 ? Integer.parseInt(argv[1]) : 1000;
- int delay = argv.length > 2 ? Integer.parseInt(argv[2]) : 1000;
- int size = argv.length > 3 ? Integer.parseInt(argv[3]) : 512;
- new LatencyTest(host, count, delay, size);
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/AcceptorTest.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/AcceptorTest.java
deleted file mode 100644
index f0ac0e6902..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/AcceptorTest.java
+++ /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.
- *
- */
-package org.apache.qpid.mina;
-
-import org.apache.log4j.Logger;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoAcceptor;
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.transport.socket.nio.SocketAcceptor;
-import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
-import org.apache.mina.transport.socket.nio.SocketSessionConfig;
-import org.apache.qpid.pool.ReadWriteThreadModel;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-
-import junit.framework.TestCase;
-
-/**
- * Tests MINA socket performance. This acceptor simply reads data from the network and writes it back again.
- *
- */
-public class AcceptorTest extends TestCase
-{
- private static final Logger _logger = Logger.getLogger(AcceptorTest.class);
-
- public static int PORT = 9999;
-
- private static class TestHandler extends IoHandlerAdapter
- {
- private int _sentCount;
-
- private int _bytesSent;
-
- public void messageReceived(IoSession session, Object message) throws Exception
- {
- ((ByteBuffer) message).acquire();
- session.write(message);
- _logger.debug("Sent response " + ++_sentCount);
- _bytesSent += ((ByteBuffer)message).remaining();
- _logger.debug("Bytes sent: " + _bytesSent);
- }
-
- public void messageSent(IoSession session, Object message) throws Exception
- {
- //((ByteBuffer) message).release();
- }
-
- public void exceptionCaught(IoSession session, Throwable cause) throws Exception
- {
- _logger.error("Error: " + cause, cause);
- }
- }
-
- public void testStartAcceptor() throws IOException
- {
- IoAcceptor acceptor = null;
- acceptor = new SocketAcceptor();
-
- SocketAcceptorConfig config = (SocketAcceptorConfig) acceptor.getDefaultConfig();
- SocketSessionConfig sc = (SocketSessionConfig) config.getSessionConfig();
- sc.setTcpNoDelay(true);
- sc.setSendBufferSize(32768);
- sc.setReceiveBufferSize(32768);
-
- config.setThreadModel(ReadWriteThreadModel.getInstance());
-
- acceptor.bind(new InetSocketAddress(PORT),
- new TestHandler());
- _logger.info("Bound on port " + PORT);
- }
-
- public static void main(String[] args) throws IOException
- {
- AcceptorTest a = new AcceptorTest();
- a.testStartAcceptor();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(AcceptorTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/BlockingAcceptorTest.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/BlockingAcceptorTest.java
deleted file mode 100644
index bfe29c47e6..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/BlockingAcceptorTest.java
+++ /dev/null
@@ -1,93 +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.
- *
- */
-package org.apache.qpid.mina;
-
-import org.apache.log4j.Logger;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.ServerSocket;
-import java.net.Socket;
-
-import junit.framework.TestCase;
-
-public class BlockingAcceptorTest extends TestCase
-{
- private static final Logger _logger = Logger.getLogger(BlockingAcceptorTest.class);
-
- public static int PORT = 9999;
-
- public void testStartAcceptor() throws IOException
- {
-
- ServerSocket sock = new ServerSocket(PORT);
-
- sock.setReuseAddress(true);
- sock.setReceiveBufferSize(32768);
- _logger.info("Bound on port " + PORT);
-
- while (true)
- {
- final Socket s = sock.accept();
- _logger.info("Received connection from " + s.getRemoteSocketAddress());
- s.setReceiveBufferSize(32768);
- s.setSendBufferSize(32768);
- s.setTcpNoDelay(true);
- new Thread(new Runnable()
- {
- public void run()
- {
- byte[] chunk = new byte[32768];
- try
- {
- InputStream is = s.getInputStream();
- OutputStream os = s.getOutputStream();
-
- while (true)
- {
- int count = is.read(chunk, 0, chunk.length);
- if (count > 0)
- {
- os.write(chunk, 0, count);
- }
- }
- }
- catch (IOException e)
- {
- _logger.error("Error - closing connection: " + e, e);
- }
- }
- }, "SocketReaderWriter").start();
- }
- }
-
- public static void main(String[] args) throws IOException
- {
- BlockingAcceptorTest a = new BlockingAcceptorTest();
- a.testStartAcceptor();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(AcceptorTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/WriterTest.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/WriterTest.java
deleted file mode 100644
index 910345624f..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/mina/WriterTest.java
+++ /dev/null
@@ -1,271 +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.
- *
- */
-package org.apache.qpid.mina;
-
-import org.apache.log4j.Logger;
-import org.apache.mina.common.*;
-import org.apache.mina.transport.socket.nio.SocketConnector;
-import org.apache.mina.transport.socket.nio.SocketConnectorConfig;
-import org.apache.mina.transport.socket.nio.SocketSessionConfig;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.concurrent.CountDownLatch;
-
-import junit.framework.TestCase;
-
-public class WriterTest extends TestCase
-{
- private static final Logger _logger = Logger.getLogger(WriterTest.class);
-
- private static class RunnableWriterTest implements Runnable
- {
- private Logger _logger;
-
- private IoSession _session;
-
- private long _startTime;
-
- private long[] _chunkTimes;
-
- private int _chunkCount = 500000;
-
- private int _chunkSize = 1024;
-
- private CountDownLatch _notifier;
-
- public RunnableWriterTest(Logger logger)
- {
- _logger = logger;
- }
-
- public void run()
- {
- _startTime = System.currentTimeMillis();
- _notifier = new CountDownLatch(1);
- for (int i = 0; i < _chunkCount; i++)
- {
- ByteBuffer buf = ByteBuffer.allocate(_chunkSize, false);
- byte check = (byte) (i % 128);
- buf.put(check);
- buf.fill((byte)88, buf.remaining());
- buf.flip();
- _session.write(buf);
- }
-
- try
- {
- _logger.info("All buffers sent; waiting for receipt from server");
- _notifier.await();
- }
- catch (InterruptedException e)
- {
- }
- _logger.info("Completed");
- long totalTime = System.currentTimeMillis() - _startTime;
- _logger.info("Total time: " + totalTime);
- _logger.info("MB per second: " + (_chunkSize * _chunkCount)/totalTime);
- long lastChunkTime = _startTime;
- double average = 0;
- for (int i = 0; i < _chunkTimes.length; i++)
- {
- if (i == 0)
- {
- average = _chunkTimes[i] - _startTime;
- }
- else
- {
- long delta = _chunkTimes[i] - lastChunkTime;
- if (delta != 0)
- {
- average = (average + delta)/2;
- }
- }
- lastChunkTime = _chunkTimes[i];
- }
- _logger.info("Average chunk time: " + average + "ms");
- CloseFuture cf = _session.close();
- cf.join();
- }
-
- private class WriterHandler extends IoHandlerAdapter
- {
- private int _chunksReceived = 0;
-
- private int _partialBytesRead = 0;
-
- private byte _partialCheckNumber;
-
- private int _totalBytesReceived = 0;
-
- public void messageReceived(IoSession session, Object message) throws Exception
- {
- ByteBuffer result = (ByteBuffer) message;
- _totalBytesReceived += result.remaining();
- int size = result.remaining();
- long now = System.currentTimeMillis();
- if (_partialBytesRead > 0)
- {
- int offset = _chunkSize - _partialBytesRead;
- if (size >= offset)
- {
- _chunkTimes[_chunksReceived++] = now;
- result.position(offset);
- }
- else
- {
- // have not read even one chunk, including the previous partial bytes
- _partialBytesRead += size;
- return;
- }
- }
-
- int chunkCount = result.remaining()/_chunkSize;
-
- for (int i = 0; i < chunkCount; i++)
- {
- _chunkTimes[_chunksReceived++] = now;
- byte check = result.get();
- _logger.debug("Check number " + check + " read");
- if (check != (byte)((_chunksReceived - 1)%128))
- {
- _logger.error("Check number " + check + " read when expected " + (_chunksReceived%128));
- }
- _logger.debug("Chunk times recorded");
-
- try
- {
- result.skip(_chunkSize - 1);
- }
- catch (IllegalArgumentException e)
- {
- _logger.error("Position was: " + result.position());
- _logger.error("Tried to skip to: " + (_chunkSize * i));
- _logger.error("limit was; " + result.limit());
- }
- }
- _logger.debug("Chunks received now " + _chunksReceived);
- _logger.debug("Bytes received: " + _totalBytesReceived);
- _partialBytesRead = result.remaining();
-
- if (_partialBytesRead > 0)
- {
- _partialCheckNumber = result.get();
- }
-
- if (_chunksReceived >= _chunkCount)
- {
- _notifier.countDown();
- }
-
- }
-
- public void exceptionCaught(IoSession session, Throwable cause) throws Exception
- {
- _logger.error("Error: " + cause, cause);
- }
- }
-
- public void startWriter(int chunkSize) throws IOException, InterruptedException
- {
- _chunkSize = chunkSize;
-
- IoConnector ioConnector = null;
-
- ioConnector = new SocketConnector();
-
- SocketConnectorConfig cfg = (SocketConnectorConfig) ioConnector.getDefaultConfig();
- cfg.setThreadModel(ThreadModel.MANUAL);
- SocketSessionConfig scfg = (SocketSessionConfig) cfg.getSessionConfig();
- scfg.setTcpNoDelay(true);
- scfg.setSendBufferSize(32768);
- scfg.setReceiveBufferSize(32768);
-
- final InetSocketAddress address = new InetSocketAddress("localhost", AcceptorTest.PORT);
- _logger.info("Attempting connection to " + address);
- ConnectFuture future = ioConnector.connect(address, new WriterHandler());
- // wait for connection to complete
- future.join();
- _logger.info("Connection completed");
- // we call getSession which throws an IOException if there has been an error connecting
- _session = future.getSession();
- _chunkTimes = new long[_chunkCount];
- Thread t = new Thread(this);
- t.start();
- t.join();
- _logger.info("Test completed");
- }
- }
-
- private RunnableWriterTest _runnableWriterTest = new RunnableWriterTest(_logger);
-
- public void test1k() throws IOException, InterruptedException
- {
- _logger.info("Starting 1k test");
- _runnableWriterTest.startWriter(1024);
- }
-
- public void test2k() throws IOException, InterruptedException
- {
- _logger.info("Starting 2k test");
- _runnableWriterTest.startWriter(2048);
- }
-
- public void test4k() throws IOException, InterruptedException
- {
- _logger.info("Starting 4k test");
- _runnableWriterTest.startWriter(4096);
- }
-
- public void test8k() throws IOException, InterruptedException
- {
- _logger.info("Starting 8k test");
- _runnableWriterTest.startWriter(8192);
- }
-
- public void test16k() throws IOException, InterruptedException
- {
- _logger.info("Starting 16k test");
- _runnableWriterTest.startWriter(16384);
- }
-
- public void test32k() throws IOException, InterruptedException
- {
- _logger.info("Starting 32k test");
- _runnableWriterTest.startWriter(32768);
- }
-
- public static void main(String[] args) throws IOException, InterruptedException
- {
- WriterTest w = new WriterTest();
- //w.test1k();
- //w.test2k();
- //w.test4k();
- w.test8k();
- //w.test16k();
- //w.test32k();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(WriterTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/multiconsumer/AMQTest.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/multiconsumer/AMQTest.java
deleted file mode 100644
index db02b9954a..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/multiconsumer/AMQTest.java
+++ /dev/null
@@ -1,269 +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.
- *
- */
-package org.apache.qpid.multiconsumer;
-
-import java.io.ByteArrayOutputStream;
-import java.util.zip.Deflater;
-import java.util.zip.Inflater;
-
-import javax.jms.Connection;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-
-import junit.framework.TestCase;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.jms.Session;
-
-/**
- * Test AMQ.
- */
-public class AMQTest extends TestCase implements ExceptionListener
-{
-
- private final static String COMPRESSION_PROPNAME = "_MSGAPI_COMP";
- private final static String UTF8 = "UTF-8";
- private static final String SUBJECT = "test.amq";
- private static final String DUMMYCONTENT = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- private static final String HUGECONTENT;
-
- private AMQConnection connect = null;
- private Session pubSession = null;
- private Session subSession = null;
- private Topic topic = null;
-
- static
- {
- StringBuilder sb = new StringBuilder(DUMMYCONTENT.length() * 115);
- for (int i = 0; i < 100; i++)
- {
- sb.append(DUMMYCONTENT);
- }
- HUGECONTENT = sb.toString();
- }
-
- private void setup() throws Exception
- {
- connect = new AMQConnection("localhost", 5672, "guest", "guest", "client1", "/");
- connect.setExceptionListener(this);
- pubSession = connect.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
- subSession = connect.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
- topic = new AMQTopic(pubSession.getDefaultTopicExchangeName(), new AMQShortString(SUBJECT));
-
- connect.start();
- }
-
- public void testMultipleListeners() throws Exception
- {
- setup();
- try
- {
- // Create 5 listeners
- MsgHandler[] listeners = new MsgHandler[5];
- for (int i = 0; i < listeners.length; i++)
- {
- listeners[i] = new MsgHandler();
- MessageConsumer subscriber = subSession.createConsumer(topic);
- subscriber.setMessageListener(listeners[i]);
- }
- MessageProducer publisher = pubSession.createProducer(topic);
- // Send a single message
- TextMessage msg = pubSession.createTextMessage();
- msg.setText(DUMMYCONTENT);
- publisher.send(msg);
- Thread.sleep(5000);
- // Check listeners to ensure they all got it
- for (int i = 0; i < listeners.length; i++)
- {
- if (listeners[i].isGotIt())
- {
- System.out.println("Got callback for listener " + i);
- }
- else
- {
- TestCase.fail("Listener " + i + " did not get callback");
- }
- }
- }
- catch (Throwable e)
- {
- System.err.println("Error: " + e);
- e.printStackTrace(System.err);
- }
- finally
- {
- close();
- }
- }
-
- public void testCompression() throws Exception
- {
- setup();
- String comp = this.compressString(HUGECONTENT);
- try
- {
- MsgHandler listener = new MsgHandler();
- MessageConsumer subscriber = subSession.createConsumer(topic);
- subscriber.setMessageListener(listener);
- MessageProducer publisher = pubSession.createProducer(topic);
-
- // Send a single message
- TextMessage msg = pubSession.createTextMessage();
- // Set the compressed text
- msg.setText(comp);
- msg.setBooleanProperty(COMPRESSION_PROPNAME, true);
- publisher.send(msg);
- Thread.sleep(1000);
- // Check listeners to ensure we got it
- if (listener.isGotIt())
- {
- System.out.println("Got callback for listener");
- }
- else
- {
- TestCase.fail("Listener did not get callback");
- }
- }
- finally
- {
- close();
- }
- }
-
- private void close() throws Exception
- {
- if (connect != null)
- {
- connect.close();
- }
- }
-
- private class MsgHandler implements MessageListener
- {
- private boolean gotIt = false;
-
- public void onMessage(Message msg)
- {
- try
- {
- TextMessage textMessage = (TextMessage) msg;
- String string = textMessage.getText();
- if (string != null && string.length() > 0)
- {
- gotIt = true;
- }
- if (textMessage.getBooleanProperty(COMPRESSION_PROPNAME))
- {
- string = inflateString(string);
- }
- System.out.println("Got callback of size " + (string==null?0:string.length()));
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public boolean isGotIt()
- {
- return this.gotIt;
- }
- }
-
- private String compressString(String string) throws Exception
- {
- long start = System.currentTimeMillis();
- byte[] input = string.getBytes();
- Deflater compressor = new Deflater(Deflater.BEST_COMPRESSION);
- compressor.setInput(input);
- compressor.finish();
-
- // Get byte array from output of compressor
- ByteArrayOutputStream baos = new ByteArrayOutputStream(input.length);
- byte[] buf = new byte[1024];
- while (!compressor.finished())
- {
- int cnt = compressor.deflate(buf);
- baos.write(buf, 0, cnt);
- }
- baos.close();
- byte[] output = baos.toByteArray();
-
- // Convert byte array into String
- byte[] base64 = Base64.encodeBase64(output);
- String sComp = new String(base64, UTF8);
-
- long diff = System.currentTimeMillis() - start;
- System.out.println("Compressed text from " + input.length + " to "
- + sComp.getBytes().length + " in " + diff + " ms");
- System.out.println("Compressed text = '" + sComp + "'");
-
- return sComp;
- }
-
- private String inflateString(String string) throws Exception
- {
- byte[] input = string.getBytes();
-
- // First convert Base64 string back to binary array
- byte[] bytes = Base64.decodeBase64(input);
-
- // Set string as input data for decompressor
- Inflater decompressor = new Inflater();
- decompressor.setInput(bytes);
-
- // Decompress the data
- ByteArrayOutputStream bos = new ByteArrayOutputStream(input.length);
- byte[] buf = new byte[1024];
- while (!decompressor.finished())
- {
- int count = decompressor.inflate(buf);
- bos.write(buf, 0, count);
- }
- bos.close();
- byte[] output = bos.toByteArray();
-
- // Get the decompressed data
- return new String(output, UTF8);
- }
-
- /**
- * @see javax.jms.ExceptionListener#onException(javax.jms.JMSException)
- */
- public void onException(JMSException e)
- {
- System.err.println(e.getMessage());
- e.printStackTrace(System.err);
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestPublisher.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestPublisher.java
deleted file mode 100644
index 37b4ff1498..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestPublisher.java
+++ /dev/null
@@ -1,176 +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.
- *
- */
-package org.apache.qpid.pubsub1;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.url.URLSyntaxException;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.jms.MessageProducer;
-import org.apache.qpid.jms.Session;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.TextMessage;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-/**
- * A client that behaves as follows:
- * <ul><li>Connects to a queue, whose name is specified as a cmd-line argument</li>
- * <li>Creates a temporary queue</li>
- * <li>Creates messages containing a property that is the name of the temporary queue</li>
- * <li>Fires off a message on the original queue and waits for a response on the temporary queue</li>
- * </ul>
- *
- */
-public class TestPublisher
-{
- private static final Logger _log = Logger.getLogger(TestPublisher.class);
-
- private AMQConnection _connection;
-
- private Session _session;
-
- private class CallbackHandler implements MessageListener
- {
- private int _expectedMessageCount;
-
- private int _actualMessageCount;
-
- private long _startTime;
-
- public CallbackHandler(int expectedMessageCount, long startTime)
- {
- _expectedMessageCount = expectedMessageCount;
- _startTime = startTime;
- }
-
- public void onMessage(Message m)
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Message received: " + m);
- }
- _actualMessageCount++;
- if (_actualMessageCount%1000 == 0)
- {
- _log.info("Received message count: " + _actualMessageCount);
- }
- /*if (!"henson".equals(m.toString()))
- {
- _log.error("AbstractJMSMessage response not correct: expected 'henson' but got " + m.toString());
- }
- else
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("AbstractJMSMessage " + m + " received");
- }
- else
- {
- _log.info("AbstractJMSMessage received");
- }
- } */
-
- if (_actualMessageCount == _expectedMessageCount)
- {
- long timeTaken = System.currentTimeMillis() - _startTime;
- System.out.println("Total time taken to receive " + _expectedMessageCount+ " messages was " +
- timeTaken + "ms, equivalent to " +
- (_expectedMessageCount/(timeTaken/1000.0)) + " messages per second");
- }
- }
- }
-
- public TestPublisher(String host, int port, String clientID, String commandQueueName,
- final int messageCount) throws AMQException, URLSyntaxException
- {
- try
- {
- createConnection(host, port, clientID);
-
- _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- AMQTopic destination = new AMQTopic(_session.getDefaultTopicExchangeName(), new AMQShortString(commandQueueName));
- MessageProducer producer = (MessageProducer) _session.createProducer(destination);
-
- _connection.start();
- //TextMessage msg = _session.createTextMessage(tempDestination.getQueueName() + "/Presented to in conjunction with Mahnah Mahnah and the Snowths");
- final long startTime = System.currentTimeMillis();
-
- for (int i = 0; i < messageCount; i++)
- {
- TextMessage msg = _session.createTextMessage(destination.getTopicName() + "/Presented to in conjunction with Mahnah Mahnah and the Snowths: " + i);
-
- //msg.setIntProperty("a",i % 2);
- //msg.setIntProperty("b",i % 4);
-
- producer.send(msg);
- }
- _log.info("Finished sending " + messageCount + " messages");
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- }
- }
-
- private void createConnection(String host, int port, String clientID) throws AMQException, URLSyntaxException
- {
- _connection = new AMQConnection(host, port, "guest", "guest",
- clientID, "/test");
- }
-
- /**
- *
- * @param args argument 1 if present specifies the name of the temporary queue to create. Leaving it blank
- * means the server will allocate a name.
- */
- public static void main(String[] args) throws URLSyntaxException
- {
- if (args.length == 0)
- {
- System.err.println("Usage: TestPublisher <host> <port> <command queue name> <number of messages>");
- }
- try
- {
- int port = Integer.parseInt(args[1]);
- InetAddress address = InetAddress.getLocalHost();
- String clientID = address.getHostName() + System.currentTimeMillis();
- TestPublisher client = new TestPublisher(args[0], port, clientID, args[2], Integer.parseInt(args[3]));
- }
- catch (UnknownHostException e)
- {
- e.printStackTrace();
- }
- catch (AMQException e)
- {
- System.err.println("Error in client: " + e);
- e.printStackTrace();
- }
-
- //System.exit(0);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestSubscriber.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestSubscriber.java
deleted file mode 100644
index 450d9b3914..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestSubscriber.java
+++ /dev/null
@@ -1,122 +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.
- *
- */
-package org.apache.qpid.pubsub1;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.Topic;
-import java.net.InetAddress;
-
-public class TestSubscriber
-{
- private static final Logger _logger = Logger.getLogger(TestSubscriber.class);
-
- private static class TestMessageListener implements MessageListener
- {
- private String _name;
-
- private int _expectedMessageCount;
-
- private int _messageCount;
-
- private long _startTime = 0;
-
- public TestMessageListener(String name, int expectedMessageCount)
- {
- _name = name;
- _expectedMessageCount = expectedMessageCount;
- }
-
- public void onMessage(javax.jms.Message message)
- {
- if (_messageCount++ == 0)
- {
- _startTime = System.currentTimeMillis();
- }
- if (_logger.isInfoEnabled())
- {
- _logger.info(_name + " got message '" + message + "'");
- }
- if (_messageCount == _expectedMessageCount)
- {
- long totalTime = System.currentTimeMillis() - _startTime;
- _logger.error(_name + ": Total time to receive " + _messageCount + " messages was " +
- totalTime + "ms. Rate is " + (_messageCount/(totalTime/1000.0)));
- }
- if (_messageCount > _expectedMessageCount)
- {
- _logger.error("Oops! More messages received than expected (" + _messageCount + ")");
- }
- }
- }
-
- public static void main(String[] args)
- {
- _logger.info("Starting...");
-
- if (args.length != 7)
- {
- System.out.println("Usage: host port username password virtual-path expectedMessageCount selector");
- System.exit(1);
- }
- try
- {
- InetAddress address = InetAddress.getLocalHost();
- AMQConnection con1 = new AMQConnection(args[0], Integer.parseInt(args[1]), args[2], args[3],
- address.getHostName(), args[4]);
- final Session session1 = con1.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- AMQConnection con2 = new AMQConnection(args[0], Integer.parseInt(args[1]), args[2], args[3],
- address.getHostName(), args[4]);
- final Session session2 = con2.createSession(false, Session.AUTO_ACKNOWLEDGE);
- String selector = args[6];
-
- final int expectedMessageCount = Integer.parseInt(args[5]);
- _logger.info("Message selector is <" + selector + ">...");
-
- Topic t = new AMQTopic(session1.getDefaultTopicExchangeName(), new AMQShortString("cbr"));
- MessageConsumer consumer1 = session1.createConsumer(t,
- 100, false, false, selector);
- MessageConsumer consumer2 = session2.createConsumer(t,
- 100, false, false, selector);
-
- consumer1.setMessageListener(new TestMessageListener("ML 1", expectedMessageCount));
- consumer2.setMessageListener(new TestMessageListener("ML 2", expectedMessageCount));
- con1.start();
- con2.start();
- }
- catch (Throwable t)
- {
- System.err.println("Fatal error: " + t);
- t.printStackTrace();
- }
-
- System.out.println("Waiting...");
- }
-}
-
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/client/connection/TestManyConnections.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/client/connection/TestManyConnections.java
deleted file mode 100644
index f59b36166a..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/client/connection/TestManyConnections.java
+++ /dev/null
@@ -1,95 +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.
- *
- */
-package org.apache.qpid.test.unit.client.connection;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.url.URLSyntaxException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.log4j.Logger;
-
-import junit.framework.TestCase;
-
-public class TestManyConnections extends TestCase
-{
- private static final Logger _log = Logger.getLogger(TestManyConnections.class);
-
- private AMQConnection[] _connections;
-
- private void createConnection(int index, String brokerHosts, String clientID, String username, String password,
- String vpath) throws AMQException, URLSyntaxException
- {
- _connections[index] = new AMQConnection(brokerHosts, username, password,
- clientID, vpath);
- }
-
- private void createConnections(int count) throws AMQException, URLSyntaxException
- {
- _connections = new AMQConnection[count];
- long startTime = System.currentTimeMillis();
- for (int i = 0; i < count; i++)
- {
- createConnection(i, "vm://:1", "myClient" + i, "guest", "guest", "test");
- }
- long endTime = System.currentTimeMillis();
- _log.info("Time to create " + count + " connections: " + (endTime - startTime) +
- "ms");
- }
-
- public void testCreate10Connections() throws AMQException, URLSyntaxException
- {
- createConnections(10);
- }
-
- public void testCreate50Connections() throws AMQException, URLSyntaxException
- {
- createConnections(50);
- }
-
- public void testCreate100Connections() throws AMQException, URLSyntaxException
- {
- createConnections(100);
- }
-
- public void testCreate250Connections() throws AMQException, URLSyntaxException
- {
- createConnections(250);
- }
-
- public void testCreate500Connections() throws AMQException, URLSyntaxException
- {
- createConnections(500);
- }
-
- public void testCreate1000Connections() throws AMQException, URLSyntaxException
- {
- createConnections(1000);
- }
-
- public void testCreate5000Connections() throws AMQException, URLSyntaxException
- {
- createConnections(5000);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TestManyConnections.class);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/PropertiesFileInitialContextFactoryTest.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/PropertiesFileInitialContextFactoryTest.java
deleted file mode 100644
index 5ab5722146..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/PropertiesFileInitialContextFactoryTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.unit.jndi;
-
-import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQTopic;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.naming.spi.InitialContextFactory;
-import java.util.Properties;
-import java.io.InputStream;
-
-
-import junit.framework.TestCase;
-
-public class PropertiesFileInitialContextFactoryTest extends TestCase
-{
- InitialContextFactory contextFactory;
- Properties _properties;
- Properties _fileProperties;
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- //create simple set of hardcoded props
- _properties = new Properties();
- _properties.put("java.naming.factory.initial", "org.apache.qpid.jndi.PropertiesFileInitialContextFactory");
- _properties.put("connectionfactory.local", "amqp://guest:guest@clientid/testpath?brokerlist='vm://:1'");
- _properties.put("queue.MyQueue", "example.MyQueue");
- _properties.put("topic.ibmStocks", "stocks.nyse.ibm");
- _properties.put("destination.direct", "direct://amq.direct//directQueue");
-
- //create properties from file as a more realistic test
- _fileProperties = new Properties();
- ClassLoader cl = this.getClass().getClassLoader();
- InputStream is = cl.getResourceAsStream("org/apache/qpid/test/unit/jndi/example.properties");
- _fileProperties.load(is);
- }
-
- /**
- * Test using hardcoded properties
- */
- public void testWithoutFile()
- {
- Context ctx = null;
-
- try
- {
- ctx = new InitialContext(_properties);
- }
- catch (NamingException ne)
- {
- fail("Error loading context:" + ne);
- }
-
- checkPropertiesMatch(ctx, "Using hardcoded properties: ");
- }
-
- /**
- * Test using properties from example file
- */
- public void testWithFile()
- {
- Context ctx = null;
-
- try
- {
- ctx = new InitialContext(_fileProperties);
- }
- catch (Exception e)
- {
- fail("Error loading context:" + e);
- }
-
- checkPropertiesMatch(ctx, "Using properties from file: ");
- }
-
- public void tearDown()
- {
- _properties = null;
- _fileProperties = null;
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(PropertiesFileInitialContextFactoryTest.class);
- }
-
- private void checkPropertiesMatch(Context ctx, String errorInfo)
- {
- try
- {
- AMQConnectionFactory cf = (AMQConnectionFactory) ctx.lookup("local");
- assertEquals("amqp://guest:guest@clientid/testpath?brokerlist='vm://:1'", cf.getConnectionURL().toString());
- }
- catch (NamingException ne)
- {
- fail(errorInfo + "Unable to create Connection Factory:" + ne);
- }
-
- try
- {
- AMQQueue queue = (AMQQueue) ctx.lookup("MyQueue");
- assertEquals("example.MyQueue", queue.getRoutingKey().toString());
- }
- catch (NamingException ne)
- {
- fail(errorInfo + "Unable to create queue:" + ne);
- }
-
- try
- {
- AMQTopic topic = (AMQTopic) ctx.lookup("ibmStocks");
- assertEquals("stocks.nyse.ibm", topic.getTopicName().toString());
- }
- catch (Exception ne)
- {
- fail(errorInfo + "Unable to create topic:" + ne);
- }
-
- try
- {
- AMQQueue direct = (AMQQueue) ctx.lookup("direct");
- assertEquals("directQueue", direct.getRoutingKey().toString());
- }
- catch (NamingException ne)
- {
- fail(errorInfo + "Unable to create direct destination:" + ne);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/example.properties b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/example.properties
deleted file mode 100644
index ea9dc5ae0e..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/example.properties
+++ /dev/null
@@ -1,38 +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.
-
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-
-# use the following property to configure the default connector
-#java.naming.provider.url - ignored.
-
-# register some connection factories
-# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.local = amqp://guest:guest@clientid/testpath?brokerlist='vm://:1'
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.MyQueue = example.MyQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-topic.ibmStocks = stocks.nyse.ibm
-
-# Register an AMQP destination in JNDI
-# NOTE: Qpid currently only supports direct,topics and headers
-# destination.[jniName] = [BindingURL]
-destination.direct = direct://amq.direct//directQueue
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Config.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Config.java
deleted file mode 100644
index bb740f9094..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Config.java
+++ /dev/null
@@ -1,243 +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.
- *
- */
-package org.apache.qpid.topic;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.config.ConnectorConfig;
-import org.apache.qpid.config.ConnectionFactoryInitialiser;
-import org.apache.qpid.config.Connector;
-import org.apache.qpid.config.AbstractConfig;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-
-class Config extends AbstractConfig implements ConnectorConfig
-{
-
- private String host = "localhost";
- private int port = 5672;
- private String factory = null;
-
- private int payload = 256;
- private int messages = 1000;
- private int clients = 1;
- private int batch = 1;
- private long delay = 1;
- private int warmup;
- private int ackMode= AMQSession.NO_ACKNOWLEDGE;
- private String clientId;
- private String subscriptionId;
- private boolean persistent;
-
- public Config()
- {
- }
-
- int getAckMode()
- {
- return ackMode;
- }
-
- void setPayload(int payload)
- {
- this.payload = payload;
- }
-
- int getPayload()
- {
- return payload;
- }
-
- void setClients(int clients)
- {
- this.clients = clients;
- }
-
- int getClients()
- {
- return clients;
- }
-
- void setMessages(int messages)
- {
- this.messages = messages;
- }
-
- int getMessages()
- {
- return messages;
- }
-
- public String getHost()
- {
- return host;
- }
-
- public void setHost(String host)
- {
- this.host = host;
- }
-
- public int getPort()
- {
- return port;
- }
-
- public String getFactory()
- {
- return factory;
- }
-
- public void setPort(int port)
- {
- this.port = port;
- }
-
- int getBatch()
- {
- return batch;
- }
-
- void setBatch(int batch)
- {
- this.batch = batch;
- }
-
- int getWarmup()
- {
- return warmup;
- }
-
- void setWarmup(int warmup)
- {
- this.warmup = warmup;
- }
-
- public long getDelay()
- {
- return delay;
- }
-
- public void setDelay(long delay)
- {
- this.delay = delay;
- }
-
- String getClientId()
- {
- return clientId;
- }
-
- String getSubscriptionId()
- {
- return subscriptionId;
- }
-
- boolean usePersistentMessages()
- {
- return persistent;
- }
-
- public void setOption(String key, String value)
- {
- if("-host".equalsIgnoreCase(key))
- {
- setHost(value);
- }
- else if("-port".equalsIgnoreCase(key))
- {
- try
- {
- setPort(Integer.parseInt(value));
- }
- catch(NumberFormatException e)
- {
- throw new RuntimeException("Bad port number: " + value);
- }
- }
- else if("-payload".equalsIgnoreCase(key))
- {
- setPayload(parseInt("Bad payload size", value));
- }
- else if("-messages".equalsIgnoreCase(key))
- {
- setMessages(parseInt("Bad message count", value));
- }
- else if("-clients".equalsIgnoreCase(key))
- {
- setClients(parseInt("Bad client count", value));
- }
- else if("-batch".equalsIgnoreCase(key))
- {
- setBatch(parseInt("Bad batch count", value));
- }
- else if("-delay".equalsIgnoreCase(key))
- {
- setDelay(parseLong("Bad batch delay", value));
- }
- else if("-warmup".equalsIgnoreCase(key))
- {
- setWarmup(parseInt("Bad warmup count", value));
- }
- else if("-ack".equalsIgnoreCase(key))
- {
- ackMode = parseInt("Bad ack mode", value);
- }
- else if("-factory".equalsIgnoreCase(key))
- {
- factory = value;
- }
- else if("-clientId".equalsIgnoreCase(key))
- {
- clientId = value;
- }
- else if("-subscriptionId".equalsIgnoreCase(key))
- {
- subscriptionId = value;
- }
- else if("-persistent".equalsIgnoreCase(key))
- {
- persistent = "true".equalsIgnoreCase(value);
- }
- else
- {
- System.out.println("Ignoring unrecognised option: " + key);
- }
- }
-
- static String getAckModeDescription(int ackMode)
- {
- switch(ackMode)
- {
- case AMQSession.NO_ACKNOWLEDGE: return "NO_ACKNOWLEDGE";
- case AMQSession.AUTO_ACKNOWLEDGE: return "AUTO_ACKNOWLEDGE";
- case AMQSession.CLIENT_ACKNOWLEDGE: return "CLIENT_ACKNOWLEDGE";
- case AMQSession.DUPS_OK_ACKNOWLEDGE: return "DUPS_OK_ACKNOWELDGE";
- case AMQSession.PRE_ACKNOWLEDGE: return "PRE_ACKNOWLEDGE";
- }
- return "AckMode=" + ackMode;
- }
-
- public Connection createConnection() throws Exception
- {
- return new Connector().createConnection(this);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Listener.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Listener.java
deleted file mode 100644
index 47c608cfe4..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Listener.java
+++ /dev/null
@@ -1,141 +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.
- *
- */
-package org.apache.qpid.topic;
-
-import javax.jms.Connection;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-public class Listener implements MessageListener
-{
- private final Connection _connection;
- private final MessageProducer _controller;
- private final javax.jms.Session _session;
- private final MessageFactory _factory;
- private boolean init;
- private int count;
- private long start;
-
- Listener(Connection connection, int ackMode) throws Exception
- {
- this(connection, ackMode, null);
- }
-
- Listener(Connection connection, int ackMode, String name) throws Exception
- {
- _connection = connection;
- _session = connection.createSession(false, ackMode);
- _factory = new MessageFactory(_session);
-
- //register for events
- if(name == null)
- {
- _factory.createTopicConsumer().setMessageListener(this);
- }
- else
- {
- _factory.createDurableTopicConsumer(name).setMessageListener(this);
- }
-
- _connection.start();
-
- _controller = _factory.createControlPublisher();
- System.out.println("Waiting for messages " +
- Config.getAckModeDescription(ackMode)
- + (name == null ? "" : " (subscribed with name " + name + " and client id " + connection.getClientID() + ")")
- + "...");
-
- }
-
- private void shutdown()
- {
- try
- {
- _session.close();
- _connection.stop();
- _connection.close();
- }
- catch(Exception e)
- {
- e.printStackTrace(System.out);
- }
- }
-
- private void report()
- {
- try
- {
- String msg = getReport();
- _controller.send(_factory.createReportResponseMessage(msg));
- System.out.println("Sent report: " + msg);
- }
- catch(Exception e)
- {
- e.printStackTrace(System.out);
- }
- }
-
- private String getReport()
- {
- long time = (System.currentTimeMillis() - start);
- return "Received " + count + " in " + time + "ms";
- }
-
- public void onMessage(Message message)
- {
- if(!init)
- {
- start = System.currentTimeMillis();
- count = 0;
- init = true;
- }
-
- if(_factory.isShutdown(message))
- {
- shutdown();
- }
- else if(_factory.isReport(message))
- {
- //send a report:
- report();
- init = false;
- }
- else if (++count % 100 == 0)
- {
- System.out.println("Received " + count + " messages.");
- }
- }
-
- public static void main(String[] argv) throws Exception
- {
- Config config = new Config();
- config.setOptions(argv);
-
- Connection con = config.createConnection();
- if(config.getClientId() != null)
- {
- con.setClientID(config.getClientId());
- }
- new Listener(con, config.getAckMode(), config.getSubscriptionId());
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/MessageFactory.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/MessageFactory.java
deleted file mode 100644
index 39d64069d1..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/MessageFactory.java
+++ /dev/null
@@ -1,155 +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.
- *
- */
-package org.apache.qpid.topic;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-
-import javax.jms.*;
-
-/**
- */
-class MessageFactory
-{
- private static final char[] DATA = "abcdefghijklmnopqrstuvwxyz".toCharArray();
-
- private final Session _session;
- private final Topic _topic;
- private final Topic _control;
- private final byte[] _payload;
-
-
- MessageFactory(Session session) throws JMSException
- {
- this(session, 256);
- }
-
- MessageFactory(Session session, int size) throws JMSException
- {
- _session = session;
- if(session instanceof AMQSession)
- {
- _topic = new AMQTopic(((AMQSession)session).getDefaultTopicExchangeName(),new AMQShortString("topictest.messages"));
- _control = new AMQTopic(((AMQSession)session).getDefaultTopicExchangeName(),new AMQShortString("topictest.control"));
- }
- else
- {
- _topic = session.createTopic("topictest.messages");
- _control = session.createTopic("topictest.control");
- }
- _payload = new byte[size];
-
- for(int i = 0; i < size; i++)
- {
- _payload[i] = (byte) DATA[i % DATA.length];
- }
- }
-
- Topic getTopic()
- {
- return _topic;
- }
-
- Message createEventMessage() throws JMSException
- {
- BytesMessage msg = _session.createBytesMessage();
- msg.writeBytes(_payload);
- return msg;
- }
-
- Message createShutdownMessage() throws JMSException
- {
- return _session.createTextMessage("SHUTDOWN");
- }
-
- Message createReportRequestMessage() throws JMSException
- {
- return _session.createTextMessage("REPORT");
- }
-
- Message createReportResponseMessage(String msg) throws JMSException
- {
- return _session.createTextMessage(msg);
- }
-
- boolean isShutdown(Message m)
- {
- return checkText(m, "SHUTDOWN");
- }
-
- boolean isReport(Message m)
- {
- return checkText(m, "REPORT");
- }
-
- Object getReport(Message m)
- {
- try
- {
- return ((TextMessage) m).getText();
- }
- catch (JMSException e)
- {
- e.printStackTrace(System.out);
- return e.toString();
- }
- }
-
- MessageConsumer createTopicConsumer() throws Exception
- {
- return _session.createConsumer(_topic);
- }
-
- MessageConsumer createDurableTopicConsumer(String name) throws Exception
- {
- return _session.createDurableSubscriber(_topic, name);
- }
-
- MessageConsumer createControlConsumer() throws Exception
- {
- return _session.createConsumer(_control);
- }
-
- MessageProducer createTopicPublisher() throws Exception
- {
- return _session.createProducer(_topic);
- }
-
- MessageProducer createControlPublisher() throws Exception
- {
- return _session.createProducer(_control);
- }
-
- private static boolean checkText(Message m, String s)
- {
- try
- {
- return m instanceof TextMessage && ((TextMessage) m).getText().equals(s);
- }
- catch (JMSException e)
- {
- e.printStackTrace(System.out);
- return false;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Publisher.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Publisher.java
deleted file mode 100644
index d788029ee9..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/topic/Publisher.java
+++ /dev/null
@@ -1,175 +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.
- *
- */
-package org.apache.qpid.topic;
-
-import javax.jms.*;
-
-public class Publisher implements MessageListener
-{
- private final Object _lock = new Object();
- private final Connection _connection;
- private final Session _session;
- private final MessageFactory _factory;
- private final MessageProducer _publisher;
- private int _count;
-
- Publisher(Connection connection, int size, int ackMode, boolean persistent) throws Exception
- {
- _connection = connection;
- _session = _connection.createSession(false, ackMode);
- _factory = new MessageFactory(_session, size);
- _publisher = _factory.createTopicPublisher();
- _publisher.setDeliveryMode(persistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
- System.out.println("Publishing " + (persistent ? "persistent" : "non-persistent") + " messages of " + size + " bytes, " + Config.getAckModeDescription(ackMode) + ".");
- }
-
- private void test(Config config) throws Exception
- {
- test(config.getBatch(), config.getDelay(), config.getMessages(), config.getClients(), config.getWarmup());
- }
-
- private void test(int batches, long delay, int msgCount, int consumerCount, int warmup) throws Exception
- {
- _factory.createControlConsumer().setMessageListener(this);
- _connection.start();
-
- if(warmup > 0)
- {
- System.out.println("Runing warmup (" + warmup + " msgs)");
- long time = batch(warmup, consumerCount);
- System.out.println("Warmup completed in " + time + "ms");
- }
-
- long[] times = new long[batches];
- for(int i = 0; i < batches; i++)
- {
- if(i > 0) Thread.sleep(delay*1000);
- times[i] = batch(msgCount, consumerCount);
- System.out.println("Batch " + (i+1) + " of " + batches + " completed in " + times[i] + " ms.");
- }
-
- long min = min(times);
- long max = max(times);
- System.out.println("min: " + min + ", max: " + max + " avg: " + avg(times, min, max));
-
- //request shutdown
- _publisher.send(_factory.createShutdownMessage());
-
- _connection.stop();
- _connection.close();
- }
-
- private long batch(int msgCount, int consumerCount) throws Exception
- {
- _count = consumerCount;
- long start = System.currentTimeMillis();
- publish(msgCount);
- waitForCompletion(consumerCount);
- return System.currentTimeMillis() - start;
- }
-
- private void publish(int count) throws Exception
- {
-
- //send events
- for (int i = 0; i < count; i++)
- {
- _publisher.send(_factory.createEventMessage());
- if ((i + 1) % 100 == 0)
- {
- System.out.println("Sent " + (i + 1) + " messages");
- }
- }
-
- //request report
- _publisher.send(_factory.createReportRequestMessage());
- }
-
- private void waitForCompletion(int consumers) throws Exception
- {
- System.out.println("Waiting for completion...");
- synchronized (_lock)
- {
- while (_count > 0)
- {
- _lock.wait();
- }
- }
- }
-
-
- public void onMessage(Message message)
- {
- System.out.println("Received report " + _factory.getReport(message) + " " + --_count + " remaining");
- if (_count == 0)
- {
- synchronized (_lock)
- {
- _lock.notify();
- }
- }
- }
-
- static long min(long[] times)
- {
- long min = times.length > 0 ? times[0] : 0;
- for(int i = 0; i < times.length; i++)
- {
- min = Math.min(min, times[i]);
- }
- return min;
- }
-
- static long max(long[] times)
- {
- long max = times.length > 0 ? times[0] : 0;
- for(int i = 0; i < times.length; i++)
- {
- max = Math.max(max, times[i]);
- }
- return max;
- }
-
- static long avg(long[] times, long min, long max)
- {
- long sum = 0;
- for(int i = 0; i < times.length; i++)
- {
- sum += times[i];
- }
- sum -= min;
- sum -= max;
-
- return (sum / (times.length - 2));
- }
-
- public static void main(String[] argv) throws Exception
- {
- Config config = new Config();
- config.setOptions(argv);
-
- Connection con = config.createConnection();
- int size = config.getPayload();
- int ackMode = config.getAckMode();
- boolean persistent = config.usePersistentMessages();
- new Publisher(con, size, ackMode, persistent).test(config);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Config.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Config.java
deleted file mode 100644
index bd104e5407..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Config.java
+++ /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.
- *
- */
-package org.apache.qpid.transacted;
-
-import org.apache.qpid.config.ConnectorConfig;
-import org.apache.qpid.config.AbstractConfig;
-import org.apache.qpid.config.Connector;
-
-import javax.jms.Connection;
-
-class Config extends AbstractConfig implements ConnectorConfig
-{
- private String host = "localhost";
- private int port = 5672;
- private String factory;
- private boolean echo;
- private int batch = 100;
- private boolean persistent = true;
-
- Config(String[] argv)
- {
- setOptions(argv);
- }
-
- Connection createConnection() throws Exception
- {
- return new Connector().createConnection(this);
- }
-
- public boolean isEchoOn()
- {
- return echo;
- }
-
- public boolean usePersistentMessages()
- {
- return persistent;
- }
-
- public int getBatchSize()
- {
- return batch;
- }
-
- public String getHost()
- {
- return host;
- }
-
- public int getPort()
- {
- return port;
- }
-
- public String getFactory()
- {
- return factory;
- }
-
- public void setOption(String key, String value)
- {
- if("-host".equalsIgnoreCase(key))
- {
- host = value;
- }
- else if("-port".equalsIgnoreCase(key))
- {
- port = parseInt("Bad port number", value);
- }
- else if("-factory".equalsIgnoreCase(key))
- {
- factory = value;
- }
- else if("-echo".equalsIgnoreCase(key))
- {
- echo = "true".equalsIgnoreCase(value);
- }
- else if("-persistent".equalsIgnoreCase(key))
- {
- persistent = "true".equalsIgnoreCase(value);
- }
- else if("-batch".equalsIgnoreCase(key))
- {
- batch = parseInt("Bad batch size", value);
- }
- else
- {
- System.out.println("Ignoring nrecognised option " + key);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Ping.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Ping.java
deleted file mode 100644
index 8f15bf089e..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Ping.java
+++ /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.
- *
- */
-package org.apache.qpid.transacted;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.client.AMQQueue;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import java.util.Arrays;
-
-public class Ping
-{
- public static void main(String[] argv) throws Exception
- {
- Config config = new Config(argv);
- Connection con = config.createConnection();
- con.setClientID("ping");
- new Relay(new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, new AMQShortString("ping")), new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, new AMQShortString("pong")), con,
- config.isEchoOn(),
- config.getBatchSize(),
- config.usePersistentMessages()).start();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Pong.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Pong.java
deleted file mode 100644
index f4f4b20d7c..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Pong.java
+++ /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.
- *
- */
-package org.apache.qpid.transacted;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.client.AMQQueue;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-
-public class Pong
-{
- public static void main(String[] argv) throws Exception
- {
- Config config = new Config(argv);
- Connection con = config.createConnection();
- con.setClientID("pong");
- new Relay(new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, new AMQShortString("pong")), new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, new AMQShortString("ping")), con,
- config.isEchoOn(),
- config.getBatchSize(),
- config.usePersistentMessages()).start();
-
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Relay.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Relay.java
deleted file mode 100644
index cede95e5f0..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Relay.java
+++ /dev/null
@@ -1,127 +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.
- *
- */
-package org.apache.qpid.transacted;
-
-import org.apache.qpid.client.AMQSession;
-
-import javax.jms.MessageProducer;
-import javax.jms.MessageConsumer;
-import javax.jms.Session;
-import javax.jms.Destination;
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.TextMessage;
-import javax.jms.DeliveryMode;
-
-class Relay implements Runnable
-{
- private final Connection _con;
- private final Session _session;
- private final MessageConsumer _src;
- private final MessageProducer _dest;
- private final int _batch;
- private final boolean _echo;
- private int _counter;
- private long start;
- private boolean _running;
-
- Relay(Destination src, Destination dest, Connection con) throws JMSException
- {
- this(src, dest, con, false, 100, true);
- }
-
- Relay(Destination src, Destination dest, Connection con, boolean echo, int batch, boolean persistent) throws JMSException
- {
- _echo = echo;
- _batch = batch;
- _con = con;
- _session = con.createSession(true, AMQSession.NO_ACKNOWLEDGE);
- _src = _session.createConsumer(src);
- _dest = _session.createProducer(dest);
- _dest.setDeliveryMode(persistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
-
- }
-
- public void run()
- {
- start = System.currentTimeMillis();
- try{
- while(true) relay();
- }
- catch(JMSException e)
- {
- e.printStackTrace();
- }
- try
- {
- _session.close();
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- }
- }
-
- void relay() throws JMSException
- {
- _dest.send(relay(_src.receive()));
- _session.commit();
- }
-
- Message relay(Message in) throws JMSException
- {
- if(!_running)
- {
- System.out.println(_con.getClientID() + " started.");
- _running = true;
- }
- if(++_counter % _batch == 0)
- {
- long time = System.currentTimeMillis() - start;
- System.out.println(_batch + " iterations performed in " + time + " ms");
- try
- {
- Thread.sleep(100);
- }
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }
- start = System.currentTimeMillis();
- }
- if(_echo)
- {
- System.out.println("Received: " + ((TextMessage) in).getText());
- }
- return _session.createTextMessage(_con.getClientID() + _counter);
- }
-
- void start() throws InterruptedException, JMSException
- {
- Thread runner = new Thread(this);
- runner.start();
- _con.start();
- System.out.println(_con.getClientID() + " waiting...");
- runner.join();
- _con.close();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Start.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Start.java
deleted file mode 100644
index de718d828a..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/transacted/Start.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.transacted;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.client.AMQQueue;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Session;
-
-public class Start
-{
- public static void main(String[] argv) throws Exception
- {
- Connection con = new Config(argv).createConnection();
- AMQQueue ping = new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, new AMQShortString("ping"));
- Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- session.createProducer(ping).send(session.createTextMessage("start"));
- session.close();
- con.close();
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceProvider.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceProvider.java
deleted file mode 100644
index 71d806b338..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceProvider.java
+++ /dev/null
@@ -1,151 +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.
- *
- */
-package org.apache.qpid.weblogic;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQDestination;
-
-import javax.jms.*;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.naming.Context;
-import java.net.InetAddress;
-import java.util.Hashtable;
-
-public class ServiceProvider
-{
- private static final String JNDI_FACTORY = "weblogic.jndi.WLInitialContextFactory";
- private static final String JMS_FACTORY = "transientJMSConnectionFactory";
-
- private static final Logger _logger = Logger.getLogger(ServiceProvider.class);
-
- private static MessageProducer _destinationProducer;
-
- private static Queue _destinationQ;
-
- public static void main(String[] args)
- {
- _logger.info("Starting...");
-
- if (args.length != 2)
- {
- System.out.println("Usage: <WLS URI> <service queue>");
- System.exit(1);
- }
- try
- {
- String url = args[0];
- String receiveQueue = args[1];
-
- final InitialContext ctx = getInitialContext(url);
-
- QueueConnectionFactory qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
- QueueConnection qcon = qconFactory.createQueueConnection();
- final QueueSession qsession = qcon.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
- Queue receiveQ = (Queue) ctx.lookup(receiveQueue);
-
- _logger.info("Service (queue) name is '" + receiveQ + "'...");
-
- String selector = (args.length > 2 && args[2] != null && args[2].length() > 1) ? args[2] : null;
-
- _logger.info("Message selector is <" + selector + ">...");
-
- MessageConsumer consumer = qsession.createConsumer(receiveQ, selector);
-
- consumer.setMessageListener(new MessageListener()
- {
- private int _messageCount;
-
- public void onMessage(javax.jms.Message message)
- {
- //_logger.info("Got message '" + message + "'");
-
- TextMessage tm = (TextMessage) message;
-
- try
- {
- Queue responseQueue = (Queue)tm.getJMSReplyTo();
- if (!responseQueue.equals(_destinationQ))
- {
- _destinationQ = responseQueue;
- _logger.info("Creating destination for " + responseQueue);
-
- try
- {
- _destinationProducer = qsession.createProducer(_destinationQ);
- _destinationProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
- }
- catch (JMSException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- _messageCount++;
- if (_messageCount % 1000 == 0)
- {
- _logger.info("Received message total: " + _messageCount);
- _logger.info("Sending response to '" + responseQueue + "'");
- }
-
- String payload = "This is a response: sing together: 'Mahnah mahnah...'" + tm.getText();
- TextMessage msg = qsession.createTextMessage(payload);
- if (tm.propertyExists("timeSent"))
- {
- _logger.info("timeSent property set on message");
- final long timeSent = tm.getLongProperty("timeSent");
- msg.setLongProperty("timeSent", timeSent);
- _logger.info("time taken to go from service request to provider is: " + (System.currentTimeMillis() - timeSent));
- }
- _destinationProducer.send(msg);
- if (_messageCount % 1000 == 0)
- {
- tm.acknowledge();
- _logger.info("Sent response to '" + responseQueue + "'");
- }
- }
- catch (JMSException e)
- {
- _logger.error("Error sending message: " + e, e);
- }
- }
- });
- qcon.start();
- }
- catch (Throwable t)
- {
- System.err.println("Fatal error: " + t);
- t.printStackTrace();
- }
-
-
- System.out.println("Waiting...");
- }
-
- private static InitialContext getInitialContext(String url) throws NamingException
- {
- Hashtable env = new Hashtable();
- env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
- env.put(Context.PROVIDER_URL, url);
- return new InitialContext(env);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceRequestingClient.java b/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceRequestingClient.java
deleted file mode 100644
index 2f64a1dde5..0000000000
--- a/M4-RCs/qpid/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceRequestingClient.java
+++ /dev/null
@@ -1,185 +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.
- *
- */
-package org.apache.qpid.weblogic;
-
-import org.apache.log4j.Logger;
-
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.Hashtable;
-
-/**
- * Created by IntelliJ IDEA.
- * User: U806869
- * Date: 28-May-2005
- * Time: 21:54:51
- * To change this template use File | Settings | File Templates.
- */
-public class ServiceRequestingClient
-{
- private static final Logger _log = Logger.getLogger(ServiceRequestingClient.class);
- private static final String JNDI_FACTORY = "weblogic.jndi.WLInitialContextFactory";
- private static final String JMS_FACTORY = "transientJMSConnectionFactory";
-
- private static class CallbackHandler implements MessageListener
- {
- private int _expectedMessageCount;
-
- private int _actualMessageCount;
-
- private long _startTime;
-
- private long _averageLatency;
-
- public CallbackHandler(int expectedMessageCount, long startTime)
- {
- _expectedMessageCount = expectedMessageCount;
- _startTime = startTime;
- }
-
- public void onMessage(Message m)
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Message received: " + m);
- }
- try
- {
- if (m.propertyExists("timeSent"))
- {
- long timeSent = m.getLongProperty("timeSent");
- long now = System.currentTimeMillis();
- if (_averageLatency == 0)
- {
- _averageLatency = now - timeSent;
- _log.info("Latency " + _averageLatency);
- }
- else
- {
- _log.info("Individual latency: " + (now-timeSent));
- _averageLatency = (_averageLatency + (now - timeSent))/2;
- _log.info("Average latency now: " + _averageLatency);
- }
- }
- }
- catch (JMSException e)
- {
- _log.error("Could not calculate latency");
- }
-
- _actualMessageCount++;
- if (_actualMessageCount%1000 == 0)
- {
- try
- {
- m.acknowledge();
- }
- catch (JMSException e)
- {
- _log.error("Error acknowledging message");
- }
- _log.info("Received message count: " + _actualMessageCount);
- }
- /*if (!"henson".equals(m.toString()))
- {
- _log.error("Message response not correct: expected 'henson' but got " + m.toString());
- }
- else
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Message " + m + " received");
- }
- else
- {
- _log.info("Message received");
- }
- } */
-
- if (_actualMessageCount == _expectedMessageCount)
- {
- long timeTaken = System.currentTimeMillis() - _startTime;
- System.out.println("Total time taken to receive " + _expectedMessageCount+ " messages was " +
- timeTaken + "ms, equivalent to " +
- (_expectedMessageCount/(timeTaken/1000.0)) + " messages per second");
- System.out.println("Average latency is: " + _averageLatency);
- }
- }
- }
-
- public static void main(String[] args) throws Exception
- {
- if (args.length != 3)
- {
- System.out.println("Usage: IXPublisher <WLS URL> <sendQueue> <count> will publish count messages to ");
- System.out.println("queue sendQueue and waits for a response on a temp queue");
- System.exit(1);
- }
-
- String url = args[0];
- String sendQueue = args[1];
- int messageCount = Integer.parseInt(args[2]);
-
- InitialContext ctx = getInitialContext(url);
-
- QueueConnectionFactory qconFactory = (QueueConnectionFactory) ctx.lookup(JMS_FACTORY);
- QueueConnection qcon = qconFactory.createQueueConnection();
- QueueSession qsession = qcon.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
- Queue sendQ = (Queue) ctx.lookup(sendQueue);
- Queue receiveQ = qsession.createTemporaryQueue();
- QueueSender qsender = qsession.createSender(sendQ);
- qsender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
- _log.debug("Queue sender created for service queue " + sendQ);
-
- javax.jms.MessageConsumer messageConsumer = (javax.jms.MessageConsumer) qsession.createConsumer(receiveQ);
-
- //TextMessage msg = _session.createTextMessage(tempDestination.getQueueName() + "/Presented to in conjunction with Mahnah Mahnah and the Snowths");
- final long startTime = System.currentTimeMillis();
-
- messageConsumer.setMessageListener(new CallbackHandler(messageCount, startTime));
- qcon.start();
- for (int i = 0; i < messageCount; i++)
- {
- TextMessage msg = qsession.createTextMessage("/Presented to in conjunction with Mahnah Mahnah and the Snowths:" + i);
- msg.setJMSReplyTo(receiveQ);
- if (i%1000 == 0)
- {
- long timeNow = System.currentTimeMillis();
- msg.setLongProperty("timeSent", timeNow);
- }
- qsender.send(msg);
- }
-
- new Thread("foo").start();
- //qsession.close();
- //qcon.close();
- }
-
- private static InitialContext getInitialContext(String url) throws NamingException
- {
- Hashtable env = new Hashtable();
- env.put(Context.INITIAL_CONTEXT_FACTORY, JNDI_FACTORY);
- env.put(Context.PROVIDER_URL, url);
- return new InitialContext(env);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java
deleted file mode 100644
index 5323ad28bf..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java
+++ /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.
- *
- */
-package org.apache.mina.transport.vmpipe.support;
-
-import org.apache.mina.common.IdleStatus;
-
-import java.util.HashMap;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * This file is a patch to override MINA, because of the IdentityHashMap bug. Workaround to be supplied in MINA 1.0.7.
- * This patched file will be removed once upgraded onto a newer MINA.
- *
- * Dectects idle sessions and fires <tt>sessionIdle</tt> events to them.
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- */
-public class VmPipeIdleStatusChecker
-{
- private static final VmPipeIdleStatusChecker INSTANCE = new VmPipeIdleStatusChecker();
-
- public static VmPipeIdleStatusChecker getInstance()
- {
- return INSTANCE;
- }
-
- private final Map sessions = new HashMap(); // will use as a set
-
- private final Worker worker = new Worker();
-
- private VmPipeIdleStatusChecker()
- {
- worker.start();
- }
-
- public void addSession(VmPipeSessionImpl session)
- {
- synchronized (sessions)
- {
- sessions.put(session, session);
- }
- }
-
- private class Worker extends Thread
- {
- private Worker()
- {
- super("VmPipeIdleStatusChecker");
- setDaemon(true);
- }
-
- public void run()
- {
- for (;;)
- {
- try
- {
- Thread.sleep(1000);
- }
- catch (InterruptedException e)
- { }
-
- long currentTime = System.currentTimeMillis();
-
- synchronized (sessions)
- {
- Iterator it = sessions.keySet().iterator();
- while (it.hasNext())
- {
- VmPipeSessionImpl session = (VmPipeSessionImpl) it.next();
- if (!session.isConnected())
- {
- it.remove();
- }
- else
- {
- notifyIdleSession(session, currentTime);
- }
- }
- }
- }
- }
- }
-
- private void notifyIdleSession(VmPipeSessionImpl session, long currentTime)
- {
- notifyIdleSession0(session, currentTime, session.getIdleTimeInMillis(IdleStatus.BOTH_IDLE), IdleStatus.BOTH_IDLE,
- Math.max(session.getLastIoTime(), session.getLastIdleTime(IdleStatus.BOTH_IDLE)));
- notifyIdleSession0(session, currentTime, session.getIdleTimeInMillis(IdleStatus.READER_IDLE), IdleStatus.READER_IDLE,
- Math.max(session.getLastReadTime(), session.getLastIdleTime(IdleStatus.READER_IDLE)));
- notifyIdleSession0(session, currentTime, session.getIdleTimeInMillis(IdleStatus.WRITER_IDLE), IdleStatus.WRITER_IDLE,
- Math.max(session.getLastWriteTime(), session.getLastIdleTime(IdleStatus.WRITER_IDLE)));
- }
-
- private void notifyIdleSession0(VmPipeSessionImpl session, long currentTime, long idleTime, IdleStatus status,
- long lastIoTime)
- {
- if ((idleTime > 0) && (lastIoTime != 0) && ((currentTime - lastIoTime) >= idleTime))
- {
- session.increaseIdleCount(status);
- session.getFilterChain().fireSessionIdle(session, status);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/AMQQueueTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/AMQQueueTest.java
deleted file mode 100644
index 7789f87ace..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/AMQQueueTest.java
+++ /dev/null
@@ -1,42 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.framing.AMQShortString;
-
-import junit.framework.TestCase;
-
-public class AMQQueueTest extends TestCase
-{
- AMQShortString exchange = new AMQShortString("test.exchange");
- AMQShortString routingkey = new AMQShortString("test-route");
- AMQShortString qname = new AMQShortString("test-queue");
- AMQShortString[] oneBinding = new AMQShortString[]{new AMQShortString("bindingA")};
- AMQShortString[] bindings = new AMQShortString[]{new AMQShortString("bindingB"),
- new AMQShortString("bindingC")};
-
- public void testToURLNoBindings()
- {
- AMQQueue dest = new AMQQueue(exchange, routingkey, qname);
- String url = dest.toURL();
- assertEquals("direct://test.exchange/test-route/test-queue?routingkey='test-route'", url);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/MockAMQConnection.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/MockAMQConnection.java
deleted file mode 100644
index ce79080e97..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/MockAMQConnection.java
+++ /dev/null
@@ -1,94 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.url.URLSyntaxException;
-
-import java.io.IOException;
-
-public class MockAMQConnection extends AMQConnection
-{
- public MockAMQConnection(String broker, String username, String password, String clientName, String virtualHost)
- throws AMQException, URLSyntaxException
- {
- super(broker, username, password, clientName, virtualHost);
- }
-
- public MockAMQConnection(String broker, String username, String password, String clientName, String virtualHost, SSLConfiguration sslConfig)
- throws AMQException, URLSyntaxException
- {
- super(broker, username, password, clientName, virtualHost, sslConfig);
- }
-
- public MockAMQConnection(String host, int port, String username, String password, String clientName, String virtualHost)
- throws AMQException, URLSyntaxException
- {
- super(host, port, username, password, clientName, virtualHost);
- }
-
- public MockAMQConnection(String host, int port, String username, String password, String clientName, String virtualHost, SSLConfiguration sslConfig)
- throws AMQException, URLSyntaxException
- {
- super(host, port, username, password, clientName, virtualHost, sslConfig);
- }
-
- public MockAMQConnection(String host, int port, boolean useSSL, String username, String password, String clientName, String virtualHost, SSLConfiguration sslConfig)
- throws AMQException, URLSyntaxException
- {
- super(host, port, useSSL, username, password, clientName, virtualHost, sslConfig);
- }
-
- public MockAMQConnection(String connection)
- throws AMQException, URLSyntaxException
- {
- super(connection);
- }
-
- public MockAMQConnection(String connection, SSLConfiguration sslConfig)
- throws AMQException, URLSyntaxException
- {
- super(connection, sslConfig);
- }
-
- public MockAMQConnection(ConnectionURL connectionURL, SSLConfiguration sslConfig)
- throws AMQException
- {
- super(connectionURL, sslConfig);
- }
-
- protected MockAMQConnection(String username, String password, String clientName, String virtualHost)
- {
- super(username, password, clientName, virtualHost);
- }
-
- @Override
- public ProtocolVersion makeBrokerConnection(BrokerDetails brokerDetail) throws IOException, AMQException
- {
- _connected = true;
- _protocolHandler.getStateManager().changeState(AMQState.CONNECTION_OPEN);
- return null;
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/message/TestMessageHelper.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/message/TestMessageHelper.java
deleted file mode 100644
index 7ee991b63c..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/message/TestMessageHelper.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import javax.jms.JMSException;
-
-public class TestMessageHelper
-{
- public static JMSTextMessage newJMSTextMessage() throws JMSException
- {
- return new JMSTextMessage(AMQMessageDelegateFactory.FACTORY_0_8);
- }
-
- public static JMSBytesMessage newJMSBytesMessage() throws JMSException
- {
- return new JMSBytesMessage(AMQMessageDelegateFactory.FACTORY_0_8);
- }
-
- public static JMSMapMessage newJMSMapMessage() throws JMSException
- {
- return new JMSMapMessage(AMQMessageDelegateFactory.FACTORY_0_8);
- }
-
- public static JMSStreamMessage newJMSStreamMessage()
- {
- return new JMSStreamMessage(AMQMessageDelegateFactory.FACTORY_0_8);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java
deleted file mode 100644
index 10ec220d9e..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/AMQProtocolHandlerTest.java
+++ /dev/null
@@ -1,297 +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.
- *
- */
-package org.apache.qpid.client.protocol;
-
-import junit.framework.TestCase;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQBody;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.amqp_8_0.BasicRecoverOkBodyImpl;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.client.MockAMQConnection;
-import org.apache.qpid.client.AMQAuthenticationException;
-import org.apache.qpid.client.state.AMQState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * This is a test address QPID-1431 where frame listeners would fail to be notified of an incomming exception.
- *
- * Currently we do checks at the Session level to ensure that the connection/session are open. However, it is possible
- * for the connection to close AFTER this check has been performed.
- *
- * Performing a similar check at the frameListener level in AMQProtocolHandler makes most sence as this will prevent
- * listening when there can be no returning frames.
- *
- * With the correction in place it also means that the new listener will either make it on to the list for notification
- * or it will be notified of any existing exception due to the connection being closed.
- *
- * There may still be an issue in this space if the client utilises a second thread to close the session as there will
- * be no exception set to throw and so the wait will occur. That said when the session is closed the framelisteners
- * should be notified. Not sure this is tested.
- */
-public class AMQProtocolHandlerTest extends TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(AMQProtocolHandlerTest.class);
-
- // The handler to test
- AMQProtocolHandler _handler;
-
- // A frame to block upon whilst waiting the exception
- AMQFrame _blockFrame;
-
- // Latch to know when the listener receives an exception
- private CountDownLatch _handleCountDown;
- // The listener that will receive an exception
- BlockToAccessFrameListener _listener;
-
- @Override
- public void setUp() throws Exception
- {
- //Create a new ProtocolHandler with a fake connection.
- _handler = new AMQProtocolHandler(new MockAMQConnection("amqp://guest:guest@client/test?brokerlist='vm://:1'"));
-
- _handler.sessionCreated(new MockIoSession());
-
- AMQBody body = BasicRecoverOkBodyImpl.getFactory().newInstance(null, 1);
- _blockFrame = new AMQFrame(0, body);
-
- _handleCountDown = new CountDownLatch(1);
-
- _logger.info("Creating _Listener that should also receive the thrown exception.");
- _listener = new BlockToAccessFrameListener(1);
- }
-
- /**
- * There are two paths based on the type of exception thrown.
- *
- * This tests that when an AMQException is thrown we get the same type of AMQException back with the real exception
- * wrapped as the cause.
- *
- * @throws InterruptedException - if we are unable to wait for the test signals
- */
- public void testFrameListenerUpdateWithAMQException() throws InterruptedException
- {
- AMQException trigger = new AMQAuthenticationException(AMQConstant.ACCESS_REFUSED,
- "AMQPHTest", new RuntimeException());
-
- performWithException(trigger);
-
-
- AMQException receivedException = (AMQException) _listener.getReceivedException();
-
- assertEquals("Return exception was not the expected type",
- AMQAuthenticationException.class, receivedException.getClass());
-
- assertEquals("The _Listener did not receive the correct error code",
- trigger.getErrorCode(), receivedException.getErrorCode());
- }
-
- /**
- * There are two paths based on the type of exception thrown.
- *
- * This tests that when a generic Exception is thrown we get the exception back wrapped in a AMQException
- * as the cause.
- * @throws InterruptedException - if we are unable to wait for the test signals
- */
- public void testFrameListenerUpdateWithException() throws InterruptedException
- {
-
- Exception trigger = new Exception(new RuntimeException());
-
- performWithException(trigger);
-
- assertEquals("The _Listener did not receive the correct error code",
- AMQConstant.INTERNAL_ERROR, ((AMQException)_listener.getReceivedException()).getErrorCode());
- }
-
- /**
- * This is the main test method for both test cases.
- *
- * What occurs is that we create a new thread that will block (<30s[DEFAULT]) for a frame or exception to occur .
- *
- * We use a CountDownLatch to ensure that the new thread is running before we then yield and sleep to help ensure
- * the new thread has entered the synchronized block in the writeCommandFrameAndWaitForReply.
- *
- * We can then ack like an the incomming exception handler in (ConnectionCloseMethodHandler).
- *
- * We fire the error to the stateManager, which in this case will recored the error as there are no state listeners.
- *
- * We then set the connection to be closed, as we would normally close the socket at this point.
- *
- * Then fire the exception in to any frameListeners.
- *
- * The blocked listener (created above) when receiving the error simulates the user by creating a new request to
- * block for a frame.
- *
- * This request should fail. Prior to the fix this will fail with a NPE as we are attempting to use a null listener
- * in the writeCommand.... call L:268.
- *
- * This highlights that the listener would be added dispite there being a pending error state that the listener will
- * miss as it is not currently part of the _frameListeners set that is being notified by the iterator.
- *
- * The method waits to ensure that an exception is received before returning.
- *
- * The calling methods validate that exception that was received based on the one they sent in.
- *
- * @param trigger The exception to throw through the handler
- */
- private void performWithException(Exception trigger) throws InterruptedException
- {
-
- final CountDownLatch callingWriteCommand = new CountDownLatch(1);
-
- //Set an initial listener that will allow us to create a new blocking method
- new Thread(new Runnable()
- {
- public void run()
- {
-
- try
- {
-
- _logger.info("At initial block, signalling to fire new exception");
- callingWriteCommand.countDown();
-
- _handler.writeCommandFrameAndWaitForReply(_blockFrame, _listener);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
- }).start();
-
- _logger.info("Waiting for 'initial block' to start ");
- if (!callingWriteCommand.await(1000, TimeUnit.MILLISECONDS))
- {
- fail("Failed to start new thread to block for frame");
- }
-
- // Do what we can to ensure that this thread does not continue before the above thread has hit the synchronized
- // block in the writeCommandFrameAndWaitForReply
- Thread.yield();
- Thread.sleep(1000);
-
- _logger.info("Firing Erorr through state manager. There should be not state waiters here.");
- _handler.getStateManager().error(trigger);
-
- _logger.info("Setting state to be CONNECTION_CLOSED.");
- try
- {
- _handler.getStateManager().changeState(AMQState.CONNECTION_CLOSED);
- }
- catch (AMQException e)
- {
- _logger.error("Unable to change the state to closed.", e);
- fail("Unable to change the state to closed due to :"+e.getMessage());
- }
-
- _logger.info("Firing exception");
- _handler.propagateExceptionToFrameListeners(trigger);
-
- _logger.info("Awaiting notifcation from handler that exception arrived.");
-
- if (!_handleCountDown.await(2000, TimeUnit.MILLISECONDS))
- {
- fail("Failed to handle exception and timeout has not occured");
- }
-
-
- assertNotNull("The _Listener did not receive the exception", _listener.getReceivedException());
-
- assertTrue("Received exception not an AMQException",
- _listener.getReceivedException() instanceof AMQException);
-
- AMQException receivedException = (AMQException) _listener.getReceivedException();
-
- assertTrue("The _Listener did not receive the correct message",
- receivedException.getMessage().startsWith(trigger.getMessage()));
-
-
- assertEquals("The _Listener did not receive the correct cause",
- trigger, receivedException.getCause());
-
- assertEquals("The _Listener did not receive the correct sub cause",
- trigger.getCause(), receivedException.getCause().getCause());
-
- }
-
- class BlockToAccessFrameListener extends BlockingMethodFrameListener
- {
- private Exception _receivedException = null;
-
- /**
- * Creates a new method listener, that filters incoming method to just those that match the specified channel id.
- *
- * @param channelId The channel id to filter incoming methods with.
- */
- public BlockToAccessFrameListener(int channelId)
- {
- super(channelId);
- _logger.info("Creating a listener:" + this);
- }
-
- public boolean processMethod(int channelId, AMQMethodBody frame)
- {
- return true;
- }
-
- @Override
- public void error(Exception e)
- {
- _logger.info("Exception(" + e + ") Received by:" + this);
- // Create a new Thread to start the blocking registration.
- new Thread(new Runnable()
- {
-
- public void run()
- {
- //Set an initial listener that will allow us to create a new blocking method
- try
- {
- _handler.writeCommandFrameAndWaitForReply(_blockFrame, null, 2000L);
- _logger.info("listener(" + this + ") Wait completed");
- }
- catch (Exception e)
- {
- _logger.info("listener(" + this + ") threw exception:" + e.getMessage());
- _receivedException = e;
- }
-
- _logger.info("listener(" + this + ") completed");
- _handleCountDown.countDown();
- }
- }).start();
- }
-
- public Exception getReceivedException()
- {
- return _receivedException;
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/MockIoSession.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/MockIoSession.java
deleted file mode 100644
index f0938a4bc0..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/client/protocol/MockIoSession.java
+++ /dev/null
@@ -1,312 +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.
- *
- */
-package org.apache.qpid.client.protocol;
-
-import org.apache.mina.common.*;
-import org.apache.mina.common.support.DefaultCloseFuture;
-import org.apache.mina.common.support.DefaultWriteFuture;
-import org.apache.mina.common.support.AbstractIoFilterChain;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-
-import java.net.SocketAddress;
-import java.net.InetSocketAddress;
-import java.util.Set;
-
-public class MockIoSession implements IoSession
-{
- private AMQProtocolSession _protocolSession;
-
- /**
- * Stores the last response written
- */
- private Object _lastWrittenObject;
-
- private boolean _closing;
- private IoFilterChain _filterChain;
-
- public MockIoSession()
- {
- _filterChain = new AbstractIoFilterChain(this)
- {
- protected void doWrite(IoSession ioSession, IoFilter.WriteRequest writeRequest) throws Exception
- {
-
- }
-
- protected void doClose(IoSession ioSession) throws Exception
- {
-
- }
- };
- }
-
- public Object getLastWrittenObject()
- {
- return _lastWrittenObject;
- }
-
- public IoService getService()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IoServiceConfig getServiceConfig()
- {
- return null;
- }
-
- public IoHandler getHandler()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IoSessionConfig getConfig()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IoFilterChain getFilterChain()
- {
- return _filterChain;
- }
-
- public WriteFuture write(Object message)
- {
- WriteFuture wf = new DefaultWriteFuture(null);
- _lastWrittenObject = message;
- return wf;
- }
-
- public CloseFuture close()
- {
- _closing = true;
- CloseFuture cf = new DefaultCloseFuture(null);
- cf.setClosed();
- return cf;
- }
-
- public Object getAttachment()
- {
- return _protocolSession;
- }
-
- public Object setAttachment(Object attachment)
- {
- Object current = _protocolSession;
- _protocolSession = (AMQProtocolSession) attachment;
- return current;
- }
-
- public Object getAttribute(String key)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public Object setAttribute(String key, Object value)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public Object setAttribute(String key)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public Object removeAttribute(String key)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean containsAttribute(String key)
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public Set getAttributeKeys()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public TransportType getTransportType()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isConnected()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isClosing()
- {
- return _closing;
- }
-
- public CloseFuture getCloseFuture()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public SocketAddress getRemoteAddress()
- {
- return new InetSocketAddress("127.0.0.1", 1234); //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public SocketAddress getLocalAddress()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public SocketAddress getServiceAddress()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getIdleTime(IdleStatus status)
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getIdleTimeInMillis(IdleStatus status)
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setIdleTime(IdleStatus status, int idleTime)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getWriteTimeout()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getWriteTimeoutInMillis()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setWriteTimeout(int writeTimeout)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public TrafficMask getTrafficMask()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setTrafficMask(TrafficMask trafficMask)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void suspendRead()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void suspendWrite()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void resumeRead()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void resumeWrite()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getReadBytes()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getWrittenBytes()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getReadMessages()
- {
- return 0L;
- }
-
- public long getWrittenMessages()
- {
- return 0L;
- }
-
- public long getWrittenWriteRequests()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getScheduledWriteRequests()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getScheduledWriteBytes()
- {
- return 0; //TODO
- }
-
- public long getCreationTime()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getLastIoTime()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getLastReadTime()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getLastWriteTime()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isIdle(IdleStatus status)
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getIdleCount(IdleStatus status)
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getLastIdleTime(IdleStatus status)
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableKeyEnumeratorTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableKeyEnumeratorTest.java
deleted file mode 100644
index ddbc69826d..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableKeyEnumeratorTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.NoSuchElementException;
-
-import javax.jms.JMSException;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.message.JMSTextMessage;
-import org.apache.qpid.client.message.TestMessageHelper;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.FieldTableFactory;
-
-public class FieldTableKeyEnumeratorTest extends TestCase
-{
- public void testTrue()
- {
-
- }
- public void testKeyEnumeration()
- {
- FieldTable result = FieldTableFactory.newFieldTable();
- result.setObject("one", 1L);
- result.setObject("two", 2L);
- result.setObject("three", 3L);
- result.setObject("four", 4L);
- result.setObject("five", 5L);
-
- Iterator iterator = result.keys().iterator();
-
- try
- {
- assertTrue("one".equals(iterator.next()));
- assertTrue("two".equals(iterator.next()));
- assertTrue("three".equals(iterator.next()));
- assertTrue("four".equals(iterator.next()));
- assertTrue("five".equals(iterator.next()));
- }
- catch (NoSuchElementException e)
- {
- fail("All elements should be found.");
- }
-
- }
-
- public void testPropertEnu()
- {
- try
- {
- JMSTextMessage text = TestMessageHelper.newJMSTextMessage();
-
- text.setBooleanProperty("Boolean1", true);
- text.setBooleanProperty("Boolean2", true);
- text.setIntProperty("Int", 2);
- text.setLongProperty("Long", 2);
-
- Enumeration e = text.getPropertyNames();
-
- assertTrue("Boolean1".equals(e.nextElement()));
- assertTrue("Boolean2".equals(e.nextElement()));
- assertTrue("Int".equals(e.nextElement()));
- assertTrue("Long".equals(e.nextElement()));
- }
- catch (JMSException e)
- {
-
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(FieldTableKeyEnumeratorTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTablePropertyTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTablePropertyTest.java
deleted file mode 100644
index 60ed688897..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTablePropertyTest.java
+++ /dev/null
@@ -1,62 +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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import java.util.Enumeration;
-
-import javax.jms.JMSException;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.message.JMSTextMessage;
-import org.apache.qpid.client.message.TestMessageHelper;
-
-public class FieldTablePropertyTest extends TestCase
-{
- public void testPropertyNames()
- {
- try
- {
- JMSTextMessage text = TestMessageHelper.newJMSTextMessage();
-
- text.setBooleanProperty("Boolean1", true);
- text.setBooleanProperty("Boolean2", true);
- text.setIntProperty("Int", 2);
- text.setLongProperty("Long", 2);
-
- Enumeration e = text.getPropertyNames();
-
- assertEquals("Boolean1", e.nextElement());
- assertTrue("Boolean2".equals(e.nextElement()));
- assertTrue("Int".equals(e.nextElement()));
- assertTrue("Long".equals(e.nextElement()));
- }
- catch (JMSException e)
- {
-
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(FieldTablePropertyTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java
deleted file mode 100644
index 1b27ff6300..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java
+++ /dev/null
@@ -1,99 +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.
- *
- *
- */
-package org.apache.qpid.test.unit.client.BrokerDetails;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQBrokerDetails;
-import org.apache.qpid.client.AMQConnectionURL;
-import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.url.URLSyntaxException;
-
-public class BrokerDetailsTest extends TestCase
-{
- public void testMultiParameters() throws URLSyntaxException
- {
- String url = "tcp://localhost:5672?timeout='200',immediatedelivery='true'";
-
- AMQBrokerDetails broker = new AMQBrokerDetails(url);
-
- assertTrue(broker.getProperty("timeout").equals("200"));
- assertTrue(broker.getProperty("immediatedelivery").equals("true"));
- }
-
- public void testVMBroker() throws URLSyntaxException
- {
- String url = "vm://:2";
-
- AMQBrokerDetails broker = new AMQBrokerDetails(url);
- assertTrue(broker.getTransport().equals("vm"));
- assertEquals(broker.getPort(), 2);
- }
-
- public void testTransportsDefaultToTCP() throws URLSyntaxException
- {
- String url = "localhost:5672";
-
- AMQBrokerDetails broker = new AMQBrokerDetails(url);
- assertTrue(broker.getTransport().equals("tcp"));
- }
-
- public void testCheckDefaultPort() throws URLSyntaxException
- {
- String url = "tcp://localhost";
-
- AMQBrokerDetails broker = new AMQBrokerDetails(url);
- assertTrue(broker.getPort() == AMQBrokerDetails.DEFAULT_PORT);
- }
-
- public void testBothDefaults() throws URLSyntaxException
- {
- String url = "localhost";
-
- AMQBrokerDetails broker = new AMQBrokerDetails(url);
-
- assertTrue(broker.getTransport().equals("tcp"));
- assertTrue(broker.getPort() == AMQBrokerDetails.DEFAULT_PORT);
- }
-
- public void testWrongOptionSeparatorInBroker()
- {
- String url = "tcp://localhost:5672+option='value'";
- try
- {
- new AMQBrokerDetails(url);
- }
- catch (URLSyntaxException urise)
- {
- assertTrue(urise.getReason().equals("Illegal character in port number"));
- }
-
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(BrokerDetailsTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java
deleted file mode 100644
index 66f220643c..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.test.unit.client.channelclose;
-
-import org.apache.qpid.AMQChannelClosedException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQInvalidArgumentException;
-import org.apache.qpid.AMQInvalidRoutingKeyException;
-import org.apache.qpid.client.AMQNoConsumersException;
-import org.apache.qpid.client.AMQNoRouteException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ChannelCloseBody;
-import org.apache.qpid.protocol.AMQConstant;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ChannelCloseMethodHandlerNoCloseOk implements StateAwareMethodListener<ChannelCloseBody>
-{
- private static final Logger _logger = LoggerFactory.getLogger(ChannelCloseMethodHandlerNoCloseOk.class);
-
- private static ChannelCloseMethodHandlerNoCloseOk _handler = new ChannelCloseMethodHandlerNoCloseOk();
-
- public static ChannelCloseMethodHandlerNoCloseOk getInstance()
- {
- return _handler;
- }
-
- public void methodReceived(AMQProtocolSession session, ChannelCloseBody method, int channelId)
- throws AMQException
- {
- _logger.debug("ChannelClose method received");
-
- AMQConstant errorCode = AMQConstant.getConstant(method.getReplyCode());
- AMQShortString reason = method.getReplyText();
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Channel close reply code: " + errorCode + ", reason: " + reason);
- }
-
- // For this test Method Handler .. don't send Close-OK
- // // TODO: Be aware of possible changes to parameter order as versions change.
- // AMQFrame frame = ChannelCloseOkBody.createAMQFrame(evt.getChannelId(), method.getMajor(), method.getMinor());
- // protocolSession.writeFrame(frame);
- if (errorCode != AMQConstant.REPLY_SUCCESS)
- {
- _logger.error("Channel close received with errorCode " + errorCode + ", and reason " + reason);
- if (errorCode == AMQConstant.NO_CONSUMERS)
- {
- throw new AMQNoConsumersException("Error: " + reason, null, null);
- }
- else if (errorCode == AMQConstant.NO_ROUTE)
- {
- throw new AMQNoRouteException("Error: " + reason, null, null);
- }
- else if (errorCode == AMQConstant.INVALID_ARGUMENT)
- {
- _logger.debug("Broker responded with Invalid Argument.");
-
- throw new AMQInvalidArgumentException(String.valueOf(reason), null);
- }
- else if (errorCode == AMQConstant.INVALID_ROUTING_KEY)
- {
- _logger.debug("Broker responded with Invalid Routing Key.");
-
- throw new AMQInvalidRoutingKeyException(String.valueOf(reason), null);
- }
- else
- {
- throw new AMQChannelClosedException(errorCode, "Error: " + reason, null);
- }
-
- }
-
- session.channelClosed(channelId, errorCode, String.valueOf(reason));
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/NoCloseOKStateManager.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/NoCloseOKStateManager.java
deleted file mode 100644
index c7eb745566..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/NoCloseOKStateManager.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.test.unit.client.channelclose;
-
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.client.handler.ConnectionStartMethodHandler;
-import org.apache.qpid.client.handler.ConnectionCloseMethodHandler;
-import org.apache.qpid.client.handler.ConnectionTuneMethodHandler;
-import org.apache.qpid.client.handler.ConnectionSecureMethodHandler;
-import org.apache.qpid.client.handler.ConnectionOpenOkMethodHandler;
-import org.apache.qpid.client.handler.ChannelCloseOkMethodHandler;
-import org.apache.qpid.client.handler.BasicDeliverMethodHandler;
-import org.apache.qpid.client.handler.BasicReturnMethodHandler;
-import org.apache.qpid.client.handler.BasicCancelOkMethodHandler;
-import org.apache.qpid.client.handler.ChannelFlowOkMethodHandler;
-import org.apache.qpid.client.handler.QueueDeleteOkMethodHandler;
-import org.apache.qpid.client.handler.ExchangeBoundOkMethodHandler;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.framing.ConnectionStartBody;
-import org.apache.qpid.framing.ConnectionCloseBody;
-import org.apache.qpid.framing.ConnectionTuneBody;
-import org.apache.qpid.framing.ConnectionSecureBody;
-import org.apache.qpid.framing.ConnectionOpenOkBody;
-import org.apache.qpid.framing.ChannelCloseBody;
-import org.apache.qpid.framing.ChannelCloseOkBody;
-import org.apache.qpid.framing.BasicDeliverBody;
-import org.apache.qpid.framing.BasicReturnBody;
-import org.apache.qpid.framing.BasicCancelOkBody;
-import org.apache.qpid.framing.ChannelFlowOkBody;
-import org.apache.qpid.framing.QueueDeleteOkBody;
-import org.apache.qpid.framing.ExchangeBoundOkBody;
-
-import java.util.Map;
-import java.util.HashMap;
-
-public class NoCloseOKStateManager extends AMQStateManager
-{
- public NoCloseOKStateManager(AMQProtocolSession protocolSession)
- {
- super(protocolSession);
- }
-
-
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java
deleted file mode 100644
index d05e90823c..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java
+++ /dev/null
@@ -1,532 +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.
- *
- */
-package org.apache.qpid.test.unit.client.connectionurl;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQBrokerDetails;
-import org.apache.qpid.client.AMQConnectionURL;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.url.URLSyntaxException;
-
-public class ConnectionURLTest extends TestCase
-{
-
- public void testFailoverURL() throws URLSyntaxException
- {
- String url = "amqp://ritchiem:bob@/test?brokerlist='tcp://localhost:5672;tcp://fancyserver:3000/',failover='roundrobin?cyclecount='100''";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getFailoverMethod().equals("roundrobin"));
- assertEquals("100", connectionurl.getFailoverOption(ConnectionURL.OPTIONS_FAILOVER_CYCLE));
- assertTrue(connectionurl.getUsername().equals("ritchiem"));
- assertTrue(connectionurl.getPassword().equals("bob"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
- assertTrue(connectionurl.getBrokerCount() == 2);
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("tcp"));
- assertTrue(service.getHost().equals("localhost"));
- assertTrue(service.getPort() == 5672);
-
- service = connectionurl.getBrokerDetails(1);
-
- assertTrue(service.getTransport().equals("tcp"));
- assertTrue(service.getHost().equals("fancyserver"));
- assertTrue(service.getPort() == 3000);
-
- }
-
- public void testSingleTransportUsernamePasswordURL() throws URLSyntaxException
- {
- String url = "amqp://ritchiem:bob@/test?brokerlist='tcp://localhost:5672'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getFailoverMethod() == null);
- assertTrue(connectionurl.getUsername().equals("ritchiem"));
- assertTrue(connectionurl.getPassword().equals("bob"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
- assertTrue(connectionurl.getBrokerCount() == 1);
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("tcp"));
- assertTrue(service.getHost().equals("localhost"));
- assertTrue(service.getPort() == 5672);
- }
-
- public void testSingleTransportUsernameBlankPasswordURL() throws URLSyntaxException
- {
- String url = "amqp://ritchiem:@/test?brokerlist='tcp://localhost:5672'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getFailoverMethod() == null);
- assertTrue(connectionurl.getUsername().equals("ritchiem"));
- assertTrue(connectionurl.getPassword().equals(""));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
- assertTrue(connectionurl.getBrokerCount() == 1);
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("tcp"));
- assertTrue(service.getHost().equals("localhost"));
- assertTrue(service.getPort() == 5672);
- }
-
- public void testFailedURLNullPassword()
- {
- String url = "amqp://ritchiem@/test?brokerlist='tcp://localhost:5672'";
-
- try
- {
- new AMQConnectionURL(url);
- fail("URL has null password");
- }
- catch (URLSyntaxException e)
- {
- assertTrue(e.getReason().equals("Null password in user information not allowed."));
- assertTrue(e.getIndex() == 7);
- }
- }
-
-
- public void testSingleTransportURL() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
-
- assertTrue(connectionurl.getFailoverMethod() == null);
- assertTrue(connectionurl.getUsername().equals("guest"));
- assertTrue(connectionurl.getPassword().equals("guest"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
-
- assertTrue(connectionurl.getBrokerCount() == 1);
-
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("tcp"));
- assertTrue(service.getHost().equals("localhost"));
- assertTrue(service.getPort() == 5672);
- }
-
- public void testSingleTransportWithClientURLURL() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@clientname/test?brokerlist='tcp://localhost:5672'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
-
- assertTrue(connectionurl.getFailoverMethod() == null);
- assertTrue(connectionurl.getUsername().equals("guest"));
- assertTrue(connectionurl.getPassword().equals("guest"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
- assertTrue(connectionurl.getClientName().equals("clientname"));
-
-
- assertTrue(connectionurl.getBrokerCount() == 1);
-
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("tcp"));
- assertTrue(service.getHost().equals("localhost"));
- assertTrue(service.getPort() == 5672);
- }
-
- public void testSingleTransport1OptionURL() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672',routingkey='jim'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getFailoverMethod() == null);
- assertTrue(connectionurl.getUsername().equals("guest"));
- assertTrue(connectionurl.getPassword().equals("guest"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
-
- assertTrue(connectionurl.getBrokerCount() == 1);
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("tcp"));
-
- assertTrue(service.getHost().equals("localhost"));
- assertTrue(service.getPort() == 5672);
- assertTrue(connectionurl.getOption("routingkey").equals("jim"));
- }
-
- public void testSingleTransportDefaultedBroker() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@/test?brokerlist='localhost'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getFailoverMethod() == null);
- assertTrue(connectionurl.getUsername().equals("guest"));
- assertTrue(connectionurl.getPassword().equals("guest"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
-
- assertTrue(connectionurl.getBrokerCount() == 1);
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("tcp"));
-
- assertTrue(service.getHost().equals("localhost"));
- assertTrue(service.getPort() == 5672);
- }
-
- public void testSingleTransportDefaultedBrokerWithPort() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@/test?brokerlist='localhost:1234'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getFailoverMethod() == null);
- assertTrue(connectionurl.getUsername().equals("guest"));
- assertTrue(connectionurl.getPassword().equals("guest"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
-
- assertTrue(connectionurl.getBrokerCount() == 1);
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("tcp"));
-
- assertTrue(service.getHost().equals("localhost"));
- assertTrue(service.getPort() == 1234);
- }
-
- public void testSingleTransportDefaultedBrokerWithIP() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@/test?brokerlist='127.0.0.1'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getFailoverMethod() == null);
- assertTrue(connectionurl.getUsername().equals("guest"));
- assertTrue(connectionurl.getPassword().equals("guest"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
-
- assertTrue(connectionurl.getBrokerCount() == 1);
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("tcp"));
-
- assertTrue(service.getHost().equals("127.0.0.1"));
- assertTrue(service.getPort() == 5672);
- }
-
- public void testSingleTransportDefaultedBrokerWithIPandPort() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@/test?brokerlist='127.0.0.1:1234'";
-
-// ConnectionURL connectionurl = new AMQConnectionURL(url);
-//
-// assertTrue(connectionurl.getFailoverMethod() == null);
-// assertTrue(connectionurl.getUsername().equals("guest"));
-// assertTrue(connectionurl.getPassword().equals("guest"));
-// assertTrue(connectionurl.getVirtualHost().equals("/temp"));
-//
-//
-// assertTrue(connectionurl.getBrokerCount() == 1);
-//
-// BrokerDetails service = connectionurl.getBrokerDetails(0);
-//
-// assertTrue(service.getTransport().equals("tcp"));
-//
-// assertTrue(service.getHost().equals("127.0.0.1"));
-// assertTrue(service.getPort() == 1234);
- }
-
-
- public void testSingleTransportMultiOptionURL() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672?foo='jim'&bar='bob'&fred='jimmy'',routingkey='jim',timeout='200',immediatedelivery='true'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getFailoverMethod() == null);
- assertTrue(connectionurl.getUsername().equals("guest"));
- assertTrue(connectionurl.getPassword().equals("guest"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
- assertTrue(connectionurl.getBrokerCount() == 1);
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("tcp"));
-
- assertTrue(service.getHost().equals("localhost"));
- assertTrue(service.getPort() == 5672);
-
- assertTrue(connectionurl.getOption("routingkey").equals("jim"));
- assertTrue(connectionurl.getOption("timeout").equals("200"));
- assertTrue(connectionurl.getOption("immediatedelivery").equals("true"));
- }
-
- public void testSinglevmURL() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@/test?brokerlist='vm://:2'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getFailoverMethod() == null);
- assertTrue(connectionurl.getUsername().equals("guest"));
- assertTrue(connectionurl.getPassword().equals("guest"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
- assertTrue(connectionurl.getBrokerCount() == 1);
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("vm"));
- assertTrue(service.getHost().equals(""));
- assertTrue(service.getPort() == 2);
-
- }
-
- public void testFailoverVMURL() throws URLSyntaxException
- {
- String url = "amqp://ritchiem:bob@/test?brokerlist='vm://:2;vm://:3',failover='roundrobin'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getFailoverMethod().equals("roundrobin"));
- assertTrue(connectionurl.getUsername().equals("ritchiem"));
- assertTrue(connectionurl.getPassword().equals("bob"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
- assertTrue(connectionurl.getBrokerCount() == 2);
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("vm"));
- assertTrue(service.getHost().equals(""));
- assertTrue(service.getPort() == 2);
-
- service = connectionurl.getBrokerDetails(1);
- assertTrue(service.getTransport().equals("vm"));
- assertTrue(service.getHost().equals(""));
- assertTrue(service.getPort() == 3);
- }
-
-
- public void testNoVirtualHostURL()
- {
- String url = "amqp://user@?brokerlist='tcp://localhost:5672'";
-
- try
- {
- new AMQConnectionURL(url);
- fail("URL has no virtual host should not parse");
- }
- catch (URLSyntaxException e)
- {
- // This should occur.
- }
- }
-
- public void testNoClientID() throws URLSyntaxException
- {
- String url = "amqp://user:@/test?brokerlist='tcp://localhost:5672'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getUsername().equals("user"));
- assertTrue(connectionurl.getPassword().equals(""));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
- assertTrue(connectionurl.getBrokerCount() == 1);
- }
-
-
- public void testWrongOptionSeparatorInOptions()
- {
- String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672;tcp://localhost:5673'+failover='roundrobin'";
- try
- {
- new AMQConnectionURL(url);
- fail("URL Should not parse");
- }
- catch (URLSyntaxException urise)
- {
- assertTrue(urise.getReason().equals("Unterminated option. Possible illegal option separator:'+'"));
- }
-
- }
-
-
- public void testNoUserDetailsProvidedWithClientID()
-
- {
- String url = "amqp://clientID/test?brokerlist='tcp://localhost:5672;tcp://localhost:5673'";
- try
- {
- new AMQConnectionURL(url);
- fail("URL Should not parse");
- }
- catch (URLSyntaxException urise)
- {
- assertTrue(urise.getMessage().startsWith("User information not found on url"));
- }
-
- }
-
- public void testNoUserDetailsProvidedNOClientID()
-
- {
- String url = "amqp:///test?brokerlist='tcp://localhost:5672;tcp://localhost:5673'";
- try
- {
- new AMQConnectionURL(url);
- fail("URL Should not parse");
- }
- catch (URLSyntaxException urise)
- {
- assertTrue(urise.getMessage().startsWith("User information not found on url"));
- }
-
- }
-
- public void testCheckVirtualhostFormat() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@/t.-_+!=:?brokerlist='tcp://localhost:5672'";
-
- AMQConnectionURL connection = new AMQConnectionURL(url);
- assertTrue(connection.getVirtualHost().equals("/t.-_+!=:"));
- }
-
- public void testCheckDefaultPort() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@/test=:?brokerlist='tcp://localhost'";
-
- AMQConnectionURL connection = new AMQConnectionURL(url);
-
- BrokerDetails broker = connection.getBrokerDetails(0);
- assertTrue(broker.getPort() == AMQBrokerDetails.DEFAULT_PORT);
-
- }
-
- public void testCheckMissingFinalQuote() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@id/test" + "?brokerlist='tcp://localhost:5672";
-
- try
- {
- new AMQConnectionURL(url);
- }
- catch (URLSyntaxException e)
- {
- assertEquals(e.getMessage(), "Unterminated option at index 32: brokerlist='tcp://localhost:5672");
- }
- }
-
-
- public void testDefaultExchanges() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@id/test" + "?defaultQueueExchange='test.direct'&defaultTopicExchange='test.topic'&temporaryQueueExchange='tmp.direct'&temporaryTopicExchange='tmp.topic'";
-
- AMQConnectionURL conn = new AMQConnectionURL(url);
-
- assertEquals(conn.getDefaultQueueExchangeName(),"test.direct");
-
- assertEquals(conn.getDefaultTopicExchangeName(),"test.topic");
-
- assertEquals(conn.getTemporaryQueueExchangeName(),"tmp.direct");
-
- assertEquals(conn.getTemporaryTopicExchangeName(),"tmp.topic");
-
- }
-
- public void testSocketProtocol() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@id/test" + "?brokerlist='socket://VM-Unique-socketID'";
-
- try
- {
- AMQConnectionURL curl = new AMQConnectionURL(url);
- assertNotNull(curl);
- assertEquals(1, curl.getBrokerCount());
- assertNotNull(curl.getBrokerDetails(0));
- assertEquals(BrokerDetails.SOCKET, curl.getBrokerDetails(0).getTransport());
- assertEquals("VM-Unique-socketID", curl.getBrokerDetails(0).getHost());
- assertEquals("URL does not toString as expected",
- url.replace(":guest", ":********"), curl.toString());
- }
- catch (URLSyntaxException e)
- {
- fail(e.getMessage());
- }
- }
-
- public void testSingleTransportMultiOptionOnBrokerURL() throws URLSyntaxException
- {
- String url = "amqp://guest:guest@/test?brokerlist='tcp://localhost:5672?foo='jim'&bar='bob'&fred='jimmy'',routingkey='jim',timeout='200',immediatedelivery='true'";
-
- ConnectionURL connectionurl = new AMQConnectionURL(url);
-
- assertTrue(connectionurl.getFailoverMethod() == null);
- assertTrue(connectionurl.getUsername().equals("guest"));
- assertTrue(connectionurl.getPassword().equals("guest"));
- assertTrue(connectionurl.getVirtualHost().equals("/test"));
-
- assertTrue(connectionurl.getBrokerCount() == 1);
-
- BrokerDetails service = connectionurl.getBrokerDetails(0);
-
- assertTrue(service.getTransport().equals("tcp"));
-
-
- assertTrue(service.getHost().equals("localhost"));
- assertTrue(service.getPort() == 5672);
- assertEquals("jim",service.getProperty("foo"));
- assertEquals("bob",service.getProperty("bar"));
- assertEquals("jimmy",service.getProperty("fred"));
-
- assertTrue(connectionurl.getOption("routingkey").equals("jim"));
- assertTrue(connectionurl.getOption("timeout").equals("200"));
- assertTrue(connectionurl.getOption("immediatedelivery").equals("true"));
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(ConnectionURLTest.class);
- }
-}
-
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java
deleted file mode 100644
index 2a66b86985..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java
+++ /dev/null
@@ -1,185 +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.
- *
- */
-package org.apache.qpid.test.unit.client.destinationurl;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.url.AMQBindingURL;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.URISyntaxException;
-
-public class DestinationURLTest extends TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(DestinationURLTest.class);
-
- public void testFullURL() throws URISyntaxException
- {
-
- String url = "exchange.Class://exchangeName/Destination/Queue";
-
- AMQBindingURL dest = new AMQBindingURL(url);
-
- assertTrue(url.equals(dest.toString()));
-
- assertTrue(dest.getExchangeClass().equals("exchange.Class"));
- assertTrue(dest.getExchangeName().equals("exchangeName"));
- assertTrue(dest.getDestinationName().equals("Destination"));
- assertTrue(dest.getQueueName().equals("Queue"));
- }
-
- public void testQueue() throws URISyntaxException
- {
-
- String url = "exchangeClass://exchangeName//Queue";
-
- AMQBindingURL dest = new AMQBindingURL(url);
-
- assertTrue(url.equals(dest.toString()));
-
- assertTrue(dest.getExchangeClass().equals("exchangeClass"));
- assertTrue(dest.getExchangeName().equals("exchangeName"));
- assertTrue(dest.getDestinationName().equals(""));
- assertTrue(dest.getQueueName().equals("Queue"));
- }
-
- public void testQueueWithOption() throws URISyntaxException
- {
-
- String url = "exchangeClass://exchangeName//Queue?option='value'";
-
- AMQBindingURL dest = new AMQBindingURL(url);
-
- assertTrue(url.equals(dest.toString()));
-
- assertTrue(dest.getExchangeClass().equals("exchangeClass"));
- assertTrue(dest.getExchangeName().equals("exchangeName"));
- assertTrue(dest.getDestinationName().equals(""));
- assertTrue(dest.getQueueName().equals("Queue"));
- assertTrue(dest.getOption("option").equals("value"));
- }
-
-
- public void testDestination() throws URISyntaxException
- {
-
- String url = "exchangeClass://exchangeName/Destination/";
-
- AMQBindingURL dest = new AMQBindingURL(url);
-
- assertTrue(url.equals(dest.toString()));
-
- assertTrue(dest.getExchangeClass().equals("exchangeClass"));
- assertTrue(dest.getExchangeName().equals("exchangeName"));
- assertTrue(dest.getDestinationName().equals("Destination"));
- assertTrue(dest.getQueueName().equals(""));
- }
-
- public void testDestinationWithOption() throws URISyntaxException
- {
-
- String url = "exchangeClass://exchangeName/Destination/?option='value'";
-
- AMQBindingURL dest = new AMQBindingURL(url);
-
- assertTrue(url.equals(dest.toString()));
-
- assertTrue(dest.getExchangeClass().equals("exchangeClass"));
- assertTrue(dest.getExchangeName().equals("exchangeName"));
- assertTrue(dest.getDestinationName().equals("Destination"));
- assertTrue(dest.getQueueName().equals(""));
-
- assertTrue(dest.getOption("option").equals("value"));
- }
-
- public void testDestinationWithMultiOption() throws URISyntaxException
- {
-
- String url = "exchangeClass://exchangeName/Destination/?option='value',option2='value2'";
-
- AMQBindingURL dest = new AMQBindingURL(url);
-
- assertTrue(dest.getExchangeClass().equals("exchangeClass"));
- assertTrue(dest.getExchangeName().equals("exchangeName"));
- assertTrue(dest.getDestinationName().equals("Destination"));
- assertTrue(dest.getQueueName().equals(""));
-
- assertTrue(dest.getOption("option").equals("value"));
- assertTrue(dest.getOption("option2").equals("value2"));
- }
-
- public void testDestinationWithNoExchangeDefaultsToDirect() throws URISyntaxException
- {
-
- String url = "IBMPerfQueue1?durable='true'";
-
- AMQBindingURL dest = new AMQBindingURL(url);
-
- assertTrue(dest.getExchangeClass().equals(ExchangeDefaults.DIRECT_EXCHANGE_CLASS));
- assertTrue(dest.getExchangeName().equals(""));
- assertTrue(dest.getDestinationName().equals(""));
- assertTrue(dest.getQueueName().equals("IBMPerfQueue1"));
-
- assertTrue(dest.getOption("durable").equals("true"));
- }
-
- public void testDestinationWithMultiBindingKeys() throws URISyntaxException
- {
-
- String url = "exchangeClass://exchangeName/Destination/?bindingkey='key1',bindingkey='key2'";
-
- AMQBindingURL dest = new AMQBindingURL(url);
-
- assertTrue(dest.getExchangeClass().equals("exchangeClass"));
- assertTrue(dest.getExchangeName().equals("exchangeName"));
- assertTrue(dest.getDestinationName().equals("Destination"));
- assertTrue(dest.getQueueName().equals(""));
-
- assertTrue(dest.getBindingKeys().length == 2);
- }
-
- // You can only specify only a routing key or binding key, but not both.
- public void testDestinationIfOnlyRoutingKeyOrBindingKeyIsSpecified() throws URISyntaxException
- {
-
- String url = "exchangeClass://exchangeName/Destination/?bindingkey='key1',routingkey='key2'";
- boolean exceptionThrown = false;
- try
- {
-
- AMQBindingURL dest = new AMQBindingURL(url);
- }
- catch(URISyntaxException e)
- {
- exceptionThrown = true;
- _logger.info("Exception thrown",e);
- }
-
- assertTrue("Failed to throw an URISyntaxException when both the bindingkey and routingkey is specified",exceptionThrown);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(DestinationURLTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/BytesMessageTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/BytesMessageTest.java
deleted file mode 100644
index bbabf0b57d..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/BytesMessageTest.java
+++ /dev/null
@@ -1,569 +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.
- *
- */
-package org.apache.qpid.test.unit.client.message;
-
-import java.util.HashMap;
-
-import javax.jms.MessageEOFException;
-import javax.jms.MessageFormatException;
-import javax.jms.MessageNotReadableException;
-import javax.jms.MessageNotWriteableException;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.message.JMSBytesMessage;
-import org.apache.qpid.client.message.TestMessageHelper;
-
-public class BytesMessageTest extends TestCase
-{
- /**
- * Tests that on creation a call to getBodyLength() throws an exception
- * if null was passed in during creation
- */
- public void testNotReadableOnCreationWithNull() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.getBodyLength();
- fail("expected exception did not occur");
- }
- catch (MessageNotReadableException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageNotReadableException, got " + e);
- }
- }
-
- public void testResetMakesReadble() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeInt(10);
- bm.reset();
- bm.writeInt(12);
- fail("expected exception did not occur");
- }
- catch (MessageNotWriteableException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageNotWriteableException, got " + e);
- }
- }
-
- public void testClearBodyMakesWritable() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeInt(10);
- bm.reset();
- bm.clearBody();
- bm.writeInt(10);
- }
-
- public void testWriteBoolean() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeBoolean(true);
- bm.writeBoolean(false);
- bm.reset();
- boolean val = bm.readBoolean();
- assertEquals(true, val);
- val = bm.readBoolean();
- assertEquals(false, val);
- }
-
- public void testWriteInt() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeInt(10);
- bm.reset();
- long len = bm.getBodyLength();
- assertTrue(len == 4);
- int val = bm.readInt();
- assertTrue(val == 10);
- }
-
- public void testWriteString() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeUTF("Bananas");
- bm.reset();
- String res = bm.readUTF();
- assertEquals("Bananas", res);
- }
-
- public void testWriteBytes() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- byte[] bytes = {1,2,3,4};
- bm.writeBytes(bytes, 1, 2);
- bm.reset();
- bytes = new byte[2];
- bm.readBytes(bytes);
- assertEquals(2, bytes[0]);
- assertEquals(3, bytes[1]);
- }
-
- public void testWriteObject() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeObject(new Boolean(true));
- bm.writeObject(new Boolean(false));
- bm.writeObject(new Byte((byte)2));
- bm.writeObject(new byte[]{1,2,3,4});
- bm.writeObject(new Character('g'));
- bm.writeObject(new Short((short) 29));
- bm.writeObject(new Integer(101));
- bm.writeObject(new Long(50003222L));
- bm.writeObject("Foobar");
- bm.writeObject(new Float(1.7f));
- bm.writeObject(new Double(8.7d));
- bm.reset();
- assertTrue(bm.readBoolean());
- assertTrue(!bm.readBoolean());
- assertEquals((byte)2, bm.readByte());
- byte[] bytes = new byte[4];
- bm.readBytes(bytes);
- assertEquals('g', bm.readChar());
- assertEquals((short) 29, bm.readShort());
- assertEquals(101, bm.readInt());
- assertEquals(50003222L, bm.readLong());
- assertEquals("Foobar", bm.readUTF());
- assertEquals(1.7f, bm.readFloat());
- assertEquals(8.7d, bm.readDouble());
- }
-
- public void testWriteObjectRejectsNonPrimitives() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeObject(new HashMap());
- fail("expected MessageFormatException was not thrown");
- }
- catch (MessageFormatException e)
- {
- // pass
- }
- }
-
- public void testWriteObjectThrowsNPE() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeObject(null);
- fail("expected exception did not occur");
- }
- catch (NullPointerException n)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected NullPointerException, got " + e);
- }
- }
-
- public void testReadBoolean() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeBoolean(true);
- bm.reset();
- boolean result = bm.readBoolean();
- assertTrue(result);
- }
-
- public void testReadUnsignedByte() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeByte((byte) 9);
- bm.reset();
- int result = bm.readUnsignedByte();
- assertEquals(9, result);
- }
-
- public void testReadUnsignedShort() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeShort((byte) 9);
- bm.reset();
- int result = bm.readUnsignedShort();
- assertEquals(9, result);
- }
-
- public void testReadBytesChecksNull() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.readBytes(null);
- }
- catch (IllegalArgumentException e)
- {
- // pass
- }
-
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.readBytes(null, 1);
- }
- catch (IllegalArgumentException e)
- {
- // pass
- }
- }
-
- public void testReadBytesChecksMaxSize() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- byte[] bytes = new byte[100];
- bm.readBytes(bytes, 120);
- }
- catch (IllegalArgumentException e)
- {
- // pass
- }
- }
-
- public void testReadBytesReturnsCorrectLengths() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- byte[] bytes = {2, 3};
- bm.writeBytes(bytes);
- bm.reset();
- int len = bm.readBytes(bytes);
- assertEquals(2, len);
- len = bm.readBytes(bytes);
- assertEquals(-1, len);
- len = bm.readBytes(bytes, 2);
- assertEquals(-1, len);
- bm.reset();
- len = bm.readBytes(bytes, 2);
- assertEquals(2, len);
- bm.reset();
- len = bm.readBytes(bytes, 1);
- assertEquals(1, len);
-
- }
-
- public void testEOFByte() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeByte((byte)1);
- bm.reset();
- bm.readByte();
- // should throw
- bm.readByte();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFUnsignedByte() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeByte((byte)1);
- bm.reset();
- bm.readByte();
- // should throw
- bm.readUnsignedByte();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFBoolean() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeBoolean(true);
- bm.reset();
- bm.readBoolean();
- // should throw
- bm.readBoolean();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFChar() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeChar('A');
- bm.reset();
- bm.readChar();
- // should throw
- bm.readChar();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFDouble() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeDouble(1.3d);
- bm.reset();
- bm.readDouble();
- // should throw
- bm.readDouble();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFFloat() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeFloat(1.3f);
- bm.reset();
- bm.readFloat();
- // should throw
- bm.readFloat();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFInt() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeInt(99);
- bm.reset();
- bm.readInt();
- // should throw
- bm.readInt();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFLong() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeLong(4L);
- bm.reset();
- bm.readLong();
- // should throw
- bm.readLong();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFShort() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeShort((short)4);
- bm.reset();
- bm.readShort();
- // should throw
- bm.readShort();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFUnsignedShort() throws Exception
- {
- try
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeShort((short)4);
- bm.reset();
- bm.readUnsignedShort();
- // should throw
- bm.readUnsignedShort();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- /**
- * Tests that the readBytes() method populates the passed in array
- * correctly
- * @throws Exception
- */
- public void testReadBytes() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeByte((byte)3);
- bm.writeByte((byte)4);
- bm.reset();
- byte[] result = new byte[2];
- int count = bm.readBytes(result);
- assertEquals((byte)3, result[0]);
- assertEquals((byte)4, result[1]);
- assertEquals(2, count);
- }
-
- public void testReadBytesEOF() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeByte((byte)3);
- bm.writeByte((byte)4);
- bm.reset();
- byte[] result = new byte[2];
- bm.readBytes(result);
- int count = bm.readBytes(result);
- assertEquals(-1, count);
- }
-
- public void testReadBytesWithLargerArray() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeByte((byte)3);
- bm.writeByte((byte)4);
- bm.reset();
- byte[] result = new byte[3];
- int count = bm.readBytes(result);
- assertEquals(2, count);
- assertEquals((byte)3, result[0]);
- assertEquals((byte)4, result[1]);
- assertEquals((byte)0, result[2]);
- }
-
- public void testReadBytesWithCount() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.writeByte((byte)3);
- bm.writeByte((byte)4);
- bm.writeByte((byte)5);
- bm.reset();
- byte[] result = new byte[3];
- int count = bm.readBytes(result, 2);
- assertEquals(2, count);
- assertEquals((byte)3, result[0]);
- assertEquals((byte)4, result[1]);
- assertEquals((byte)0, result[2]);
- }
-
- public void testToBodyStringWithNull() throws Exception
- {
- JMSBytesMessage bm = TestMessageHelper.newJMSBytesMessage();
- bm.reset();
- String result = bm.toBodyString();
- assertNull(result);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(BytesMessageTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/MapMessageTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/MapMessageTest.java
deleted file mode 100644
index 3e04c36b38..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/MapMessageTest.java
+++ /dev/null
@@ -1,383 +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.
- *
- *
- */
-package org.apache.qpid.test.unit.client.message;
-
-import javax.jms.JMSException;
-import javax.jms.MessageFormatException;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.message.JMSMapMessage;
-import org.apache.qpid.client.message.TestMessageHelper;
-
-
-public class MapMessageTest extends TestCase
-{
-
- //Test Lookups
-
- public void testBooleanLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
-
- mm.setBoolean("value", true);
- Assert.assertEquals(true, mm.getBoolean("value"));
- Assert.assertEquals("true", mm.getString("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testByteLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setByte("value", Byte.MAX_VALUE);
-
- Assert.assertEquals(Byte.MAX_VALUE, mm.getByte("value"));
- Assert.assertEquals((short) Byte.MAX_VALUE, mm.getShort("value"));
- Assert.assertEquals(Byte.MAX_VALUE, mm.getInt("value"));
- Assert.assertEquals((long) Byte.MAX_VALUE, mm.getLong("value"));
- Assert.assertEquals("" + Byte.MAX_VALUE, mm.getString("value"));
-
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testShortLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setShort("value", Short.MAX_VALUE);
- Assert.assertEquals(Short.MAX_VALUE, mm.getShort("value"));
- Assert.assertEquals((int) Short.MAX_VALUE, mm.getInt("value"));
- Assert.assertEquals((long) Short.MAX_VALUE, mm.getLong("value"));
- Assert.assertEquals("" + Short.MAX_VALUE, mm.getString("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
-
- public void testCharLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
-
- mm.setChar("value", 'c');
- Assert.assertEquals('c', mm.getChar("value"));
- Assert.assertEquals("c", mm.getString("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
-
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
-
- mm.setString("value", null);
- mm.getChar("value");
- fail("Expected NullPointerException");
-
- }
- catch (NullPointerException e)
- {
- ; // pass
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
-
-
-
- }
-
- public void testDoubleLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setDouble("value", Double.MAX_VALUE);
- Assert.assertEquals(Double.MAX_VALUE, mm.getDouble("value"));
- Assert.assertEquals("" + Double.MAX_VALUE, mm.getString("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testFloatLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setFloat("value", Float.MAX_VALUE);
- Assert.assertEquals(Float.MAX_VALUE, mm.getFloat("value"));
- Assert.assertEquals((double) Float.MAX_VALUE, mm.getDouble("value"));
- Assert.assertEquals("" + Float.MAX_VALUE, mm.getString("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testIntLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setInt("value", Integer.MAX_VALUE);
- Assert.assertEquals(Integer.MAX_VALUE, mm.getInt("value"));
- Assert.assertEquals((long) Integer.MAX_VALUE, mm.getLong("value"));
- Assert.assertEquals("" + Integer.MAX_VALUE, mm.getString("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testLongLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setLong("value", Long.MAX_VALUE);
- Assert.assertEquals(Long.MAX_VALUE, mm.getLong("value"));
- Assert.assertEquals("" + Long.MAX_VALUE, mm.getString("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testBytesLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- byte[] bytes = {99, 98, 97, 96, 95};
- mm.setBytes("bytes", bytes);
- assertBytesEqual(bytes, mm.getBytes("bytes"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- // Failed Lookups
-
- public void testFailedBooleanLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- Assert.assertEquals(false, mm.getBoolean("int"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testFailedByteLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getByte("random");
- Assert.fail("NumberFormatException expected");
- }
- catch (NumberFormatException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
-
- }
-
- public void testFailedBytesLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getBytes("random");
- Assert.fail("MessageFormatException expected");
- }
- catch (MessageFormatException mfe)
- {
- //normal path
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
- public void testFailedCharLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getChar("random");
- Assert.fail("MessageFormatException expected");
- }
- catch (MessageFormatException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
- public void testFailedDoubleLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getDouble("random");
- Assert.fail("NullPointerException should be received.");
- }
- catch (NullPointerException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
- public void testFailedFloatLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getFloat("random");
- Assert.fail("NullPointerException should be received.");
- }
- catch (NullPointerException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
- public void testFailedIntLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getInt("random");
- Assert.fail("NumberFormatException should be received.");
- }
- catch (NumberFormatException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
- public void testFailedLongLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getLong("random");
- Assert.fail("NumberFormatException should be received.");
- }
- catch (NumberFormatException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
- public void testFailedShortLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getShort("random");
- Assert.fail("NumberFormatException should be received.");
- }
- catch (NumberFormatException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
-
- private void assertBytesEqual(byte[] expected, byte[] actual)
- {
- Assert.assertEquals(expected.length, actual.length);
-
- for (int index = 0; index < expected.length; index++)
- {
- Assert.assertEquals(expected[index], actual[index]);
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(MapMessageTest.class);
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/StreamMessageTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/StreamMessageTest.java
deleted file mode 100644
index 802f1e6c2e..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/StreamMessageTest.java
+++ /dev/null
@@ -1,623 +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.
- *
- */
-package org.apache.qpid.test.unit.client.message;
-
-import java.util.HashMap;
-
-import javax.jms.JMSException;
-import javax.jms.MessageEOFException;
-import javax.jms.MessageFormatException;
-import javax.jms.MessageNotReadableException;
-import javax.jms.MessageNotWriteableException;
-import javax.jms.StreamMessage;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.message.JMSStreamMessage;
-import org.apache.qpid.client.message.TestMessageHelper;
-
-/**
- * @author Apache Software Foundation
- */
-public class StreamMessageTest extends TestCase
-{
- /**
- * Tests that on creation a call to getBodyLength() throws an exception
- * if null was passed in during creation
- */
- public void testNotReadableOnCreationWithNull() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.readByte();
- fail("expected exception did not occur");
- }
- catch (MessageNotReadableException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageNotReadableException, got " + e);
- }
- }
-
- public void testResetMakesReadble() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeInt(10);
- bm.reset();
- bm.writeInt(12);
- fail("expected exception did not occur");
- }
- catch (MessageNotWriteableException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageNotWriteableException, got " + e);
- }
- }
-
- public void testClearBodyMakesWritable() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeInt(10);
- bm.reset();
- bm.clearBody();
- bm.writeInt(10);
- }
-
- public void testWriteBoolean() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeBoolean(true);
- bm.writeBoolean(false);
- bm.reset();
- boolean val = bm.readBoolean();
- assertEquals(true, val);
- val = bm.readBoolean();
- assertEquals(false, val);
- }
-
- public void testWriteInt() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeInt(10);
- bm.reset();
- int val = bm.readInt();
- assertTrue(val == 10);
- }
-
- public void testWriteString() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeString("Bananas");
- bm.reset();
- String res = bm.readString();
- assertEquals("Bananas", res);
- }
-
- public void testWriteBytes() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- byte[] bytes = {1,2,3,4};
- bm.writeBytes(bytes, 1, 2);
- bm.reset();
- bytes = new byte[2];
- bm.readBytes(bytes);
- assertEquals(2, bytes[0]);
- assertEquals(3, bytes[1]);
- }
-
- public void testWriteObject() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeObject(new Boolean(true));
- bm.writeObject(new Boolean(false));
- bm.writeObject(new Byte((byte)2));
- bm.writeObject(new byte[]{1,2,3,4});
- bm.writeObject(new Character('g'));
- bm.writeObject(new Short((short) 29));
- bm.writeObject(new Integer(101));
- bm.writeObject(new Long(50003222L));
- bm.writeObject("Foobar");
- bm.writeObject(new Float(1.7f));
- bm.writeObject(new Double(8.7d));
- bm.reset();
- assertTrue(bm.readBoolean());
- assertTrue(!bm.readBoolean());
- assertEquals((byte)2, bm.readByte());
- byte[] bytes = new byte[4];
- bm.readBytes(bytes);
- assertEquals('g', bm.readChar());
- assertEquals((short) 29, bm.readShort());
- assertEquals(101, bm.readInt());
- assertEquals(50003222L, bm.readLong());
- assertEquals("Foobar", bm.readString());
- assertEquals(1.7f, bm.readFloat());
- assertEquals(8.7d, bm.readDouble());
- }
-
- public void testWriteObjectRejectsNonPrimitives() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeObject(new HashMap());
- fail("expected MessageFormatException was not thrown");
- }
- catch (MessageFormatException e)
- {
- // pass
- }
- }
-
- public void testReadBoolean() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeBoolean(true);
- bm.reset();
- boolean result = bm.readBoolean();
- assertTrue(result);
- }
-
- public void testReadBytesChecksNull() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.readBytes(null);
- }
- catch (IllegalArgumentException e)
- {
- // pass
- }
- }
-
- public void testReadBytesReturnsCorrectLengths() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- byte[] bytes = {2, 3};
- bm.writeBytes(bytes);
- bm.writeBytes(null);
- bm.writeBytes(new byte[]{});
- bm.reset();
- int len = bm.readBytes(bytes);
- assertEquals(2, len);
- len = bm.readBytes(bytes);
- assertEquals(-1, len);
- len = bm.readBytes(bytes);
- assertEquals(-1, len);
- len = bm.readBytes(bytes);
- assertEquals(0, len);
- }
-
- public void testReadBytesFollowedByPrimitive() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeBytes(new byte[]{2, 3, 4, 5, 6, 7, 8});
- bm.writeBytes(new byte[]{2, 3, 4, 5, 6, 7});
- bm.writeString("Foo");
- bm.reset();
- int len;
- do
- {
- len = bm.readBytes(new byte[2]);
- }
- while (len == 2);
-
- do
- {
- len = bm.readBytes(new byte[2]);
- }
- while (len == 2);
-
- assertEquals("Foo", bm.readString());
- }
-
- public void testReadMultipleByteArrays() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- byte[] bytes = {2, 3, 4};
- bm.writeBytes(bytes);
- bm.writeBytes(bytes);
- bm.reset();
- byte[] result = new byte[2];
- int len = bm.readBytes(result);
- assertEquals(2, len);
- len = bm.readBytes(result);
- assertEquals(1, len);
- len = bm.readBytes(result);
- assertEquals(2, len);
- }
-
- public void testEOFByte() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeByte((byte)1);
- bm.reset();
- bm.readByte();
- // should throw
- bm.readByte();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFBoolean() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeBoolean(true);
- bm.reset();
- bm.readBoolean();
- // should throw
- bm.readBoolean();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFChar() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeChar('A');
- bm.reset();
- bm.readChar();
- // should throw
- bm.readChar();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFDouble() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeDouble(1.3d);
- bm.reset();
- bm.readDouble();
- // should throw
- bm.readDouble();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFFloat() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeFloat(1.3f);
- bm.reset();
- bm.readFloat();
- // should throw
- bm.readFloat();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFInt() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeInt(99);
- bm.reset();
- bm.readInt();
- // should throw
- bm.readInt();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFLong() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeLong(4L);
- bm.reset();
- bm.readLong();
- // should throw
- bm.readLong();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testEOFShort() throws Exception
- {
- try
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeShort((short)4);
- bm.reset();
- bm.readShort();
- // should throw
- bm.readShort();
- fail("expected exception did not occur");
- }
- catch (MessageEOFException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected MessageEOFException, got " + e);
- }
- }
-
- public void testToBodyStringWithNull() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.reset();
- String result = bm.toBodyString();
- assertNull(result);
- }
-
- private void checkConversionsFail(StreamMessage sm, int[] conversions) throws JMSException
- {
- for (int conversion : conversions)
- {
- try
- {
- switch (conversion)
- {
- case 0:
- sm.readBoolean();
- break;
- case 1:
- sm.readByte();
- break;
- case 2:
- sm.readShort();
- break;
- case 3:
- sm.readChar();
- break;
- case 4:
- sm.readInt();
- break;
- case 5:
- sm.readLong();
- break;
- case 6:
- sm.readFloat();
- break;
- case 7:
- sm.readDouble();
- break;
- case 8:
- sm.readString();
- break;
- case 9:
- sm.readBytes(new byte[3]);
- break;
- }
- fail("MessageFormatException was not thrown");
- }
- catch (MessageFormatException e)
- {
- // PASS
- }
- sm.reset();
- }
- }
- public void testBooleanConversions() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeBoolean(true);
- bm.reset();
- String result = bm.readString();
- assertEquals("true", result);
- bm.reset();
- checkConversionsFail(bm, new int[]{1,2,3,4,5,6,7,9});
- }
-
- public void testByteConversions() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeByte((byte) 43);
- bm.reset();
- assertEquals(43, bm.readShort());
- bm.reset();
- assertEquals(43, bm.readInt());
- bm.reset();
- assertEquals(43, bm.readLong());
- bm.reset();
- String result = bm.readString();
- assertEquals("43", result);
- bm.reset();
- checkConversionsFail(bm, new int[]{0, 3, 6, 7, 9});
- }
-
- public void testShortConversions() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeShort((short) 87);
- bm.reset();
- assertEquals(87, bm.readInt());
- bm.reset();
- assertEquals(87, bm.readLong());
- bm.reset();
- assertEquals("87", bm.readString());
- bm.reset();
- checkConversionsFail(bm, new int[]{0, 1, 3, 6, 7, });
- }
-
- public void testCharConversions() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeChar('d');
- bm.reset();
- assertEquals("d", bm.readString());
- bm.reset();
- checkConversionsFail(bm, new int[]{0, 1, 2, 4, 5, 6, 7, 9});
- }
-
- public void testIntConversions() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeInt(167);
- bm.reset();
- assertEquals(167, bm.readLong());
- bm.reset();
- assertEquals("167", bm.readString());
- bm.reset();
- checkConversionsFail(bm, new int[]{0, 1, 2, 3, 6, 7, 9});
- }
-
- public void testLongConversions() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeLong(1678);
- bm.reset();
- assertEquals("1678", bm.readString());
- bm.reset();
- checkConversionsFail(bm, new int[]{0, 1, 2, 3, 4, 6, 7, 9});
- }
-
- public void testFloatConversions() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeFloat(6.2f);
- bm.reset();
- assertEquals(6.2d, bm.readDouble(), 0.01);
- bm.reset();
- assertEquals("6.2", bm.readString());
- bm.reset();
- checkConversionsFail(bm, new int[]{0, 1, 2, 3, 4, 5, 9});
- }
-
- public void testDoubleConversions() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeDouble(88.35d);
- bm.reset();
- assertEquals("88.35", bm.readString());
- bm.reset();
- checkConversionsFail(bm, new int[]{0, 1, 2, 3, 4, 5, 6, 9});
- }
-
- public void testStringConversions() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeString("true");
- bm.reset();
- assertEquals(true, bm.readBoolean());
- bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeString("2");
- bm.reset();
- assertEquals((byte)2, bm.readByte());
- bm.reset();
- assertEquals((short)2, bm.readShort());
- bm.reset();
- assertEquals(2, bm.readInt());
- bm.reset();
- assertEquals((long)2, bm.readLong());
- bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeString("5.7");
- bm.reset();
- assertEquals(5.7f, bm.readFloat());
- bm.reset();
- assertEquals(5.7d, bm.readDouble());
- }
-
- public void testNulls() throws Exception
- {
- JMSStreamMessage bm = TestMessageHelper.newJMSStreamMessage();
- bm.writeString(null);
- bm.writeObject(null);
- bm.reset();
- assertNull(bm.readObject());
- assertNull(bm.readObject());
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(StreamMessageTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/TextMessageTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/TextMessageTest.java
deleted file mode 100644
index 30f3b0b4eb..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/TextMessageTest.java
+++ /dev/null
@@ -1,300 +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.
- *
- */
-package org.apache.qpid.test.unit.client.message;
-
-import javax.jms.JMSException;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.message.JMSMapMessage;
-import org.apache.qpid.client.message.JMSTextMessage;
-import org.apache.qpid.client.message.TestMessageHelper;
-
-public class TextMessageTest extends TestCase
-{
- public void testTextOnConstruction() throws Exception
- {
- JMSTextMessage tm = TestMessageHelper.newJMSTextMessage();
- tm.setText("pies");
- String val = tm.getText();
- assertEquals(val, "pies");
- }
-
- public void testClearBody() throws Exception
- {
- JMSTextMessage tm = TestMessageHelper.newJMSTextMessage();
- tm.setText("pies");
- tm.clearBody();
- String val = tm.getText();
- assertNull(val);
- tm.setText("Banana");
- val = tm.getText();
- assertEquals(val, "Banana");
- }
-
-
- public void testBooleanPropertyLookup()
- {
- try
- {
- JMSTextMessage tm = TestMessageHelper.newJMSTextMessage();
-
- tm.setBooleanProperty("value", true);
- Assert.assertEquals(true, tm.getBooleanProperty("value"));
- Assert.assertEquals("true", tm.getStringProperty("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testBytePropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setByteProperty("value", Byte.MAX_VALUE);
-
- Assert.assertEquals(Byte.MAX_VALUE, mm.getByteProperty("value"));
- Assert.assertEquals((short) Byte.MAX_VALUE, mm.getShortProperty("value"));
- Assert.assertEquals(Byte.MAX_VALUE, mm.getIntProperty("value"));
- Assert.assertEquals((long) Byte.MAX_VALUE, mm.getLongProperty("value"));
- Assert.assertEquals("" + Byte.MAX_VALUE, mm.getStringProperty("value"));
-
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testShortPropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setShortProperty("value", Short.MAX_VALUE);
- Assert.assertEquals(Short.MAX_VALUE, mm.getShortProperty("value"));
- Assert.assertEquals((int) Short.MAX_VALUE, mm.getIntProperty("value"));
- Assert.assertEquals((long) Short.MAX_VALUE, mm.getLongProperty("value"));
- Assert.assertEquals("" + Short.MAX_VALUE, mm.getStringProperty("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testDoublePropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setDoubleProperty("value", Double.MAX_VALUE);
- Assert.assertEquals(Double.MAX_VALUE, mm.getDoubleProperty("value"));
- Assert.assertEquals("" + Double.MAX_VALUE, mm.getStringProperty("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testFloatPropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setFloatProperty("value", Float.MAX_VALUE);
- Assert.assertEquals(Float.MAX_VALUE, mm.getFloatProperty("value"));
- Assert.assertEquals((double) Float.MAX_VALUE, mm.getDoubleProperty("value"));
- Assert.assertEquals("" + Float.MAX_VALUE, mm.getStringProperty("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testIntPropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setIntProperty("value", Integer.MAX_VALUE);
- Assert.assertEquals(Integer.MAX_VALUE, mm.getIntProperty("value"));
- Assert.assertEquals((long) Integer.MAX_VALUE, mm.getLongProperty("value"));
- Assert.assertEquals("" + Integer.MAX_VALUE, mm.getStringProperty("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testLongPropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.setLongProperty("value", Long.MAX_VALUE);
- Assert.assertEquals(Long.MAX_VALUE, mm.getLongProperty("value"));
- Assert.assertEquals("" + Long.MAX_VALUE, mm.getStringProperty("value"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
-
- // Failed Lookups
-
- public void testFailedBooleanPropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- Assert.assertEquals(false, mm.getBooleanProperty("int"));
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received." + e);
- }
- }
-
- public void testFailedBytePropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getByteProperty("random");
- Assert.fail("NumberFormatException expected");
- }
- catch (NumberFormatException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
-
- }
-
- public void testFailedDoublePropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getDoubleProperty("random");
- Assert.fail("NullPointerException should be received.");
- }
- catch (NullPointerException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
- public void testFailedFloatPropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getFloatProperty("random");
- Assert.fail("NullPointerException should be received.");
- }
- catch (NullPointerException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
- public void testFailedIntPropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getIntProperty("random");
- Assert.fail("NumberFormatException should be received.");
- }
- catch (NumberFormatException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
- public void testFailedLongPropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getLongProperty("random");
- Assert.fail("NumberFormatException should be received.");
- }
- catch (NumberFormatException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
- public void testFailedShortPropertyLookup()
- {
- try
- {
- JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
- mm.getShortProperty("random");
- Assert.fail("NumberFormatException should be received.");
- }
- catch (NumberFormatException e)
- {
- //normal execution
- }
- catch (JMSException e)
- {
- Assert.fail("JMSException received:" + e);
- }
- }
-
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TextMessageTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.java
deleted file mode 100644
index b5e7ae82b5..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.java
+++ /dev/null
@@ -1,140 +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.
- *
- */
-package org.apache.qpid.test.unit.message;
-
-import javax.jms.*;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.*;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.message.*;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.AMQException;
-
-import java.util.Map;
-
-
-public class MessageConverterTest extends TestCase
-{
-
- public static final String JMS_CORR_ID = "QPIDID_01";
- public static final int JMS_DELIV_MODE = 1;
- public static final String JMS_TYPE = "test.jms.type";
- public static final Destination JMS_REPLY_TO = new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME,"my.replyto");
-
- protected JMSTextMessage testTextMessage;
-
- protected JMSMapMessage testMapMessage;
- private AMQSession _session = new TestAMQSession();
-
-
- protected void setUp() throws Exception
- {
- super.setUp();
- testTextMessage = new JMSTextMessage(AMQMessageDelegateFactory.FACTORY_0_8);
-
- //Set Message Text
- testTextMessage.setText("testTextMessage text");
- setMessageProperties(testTextMessage);
-
- testMapMessage = new JMSMapMessage(AMQMessageDelegateFactory.FACTORY_0_8);
- testMapMessage.setString("testMapString", "testMapStringValue");
- testMapMessage.setDouble("testMapDouble", Double.MAX_VALUE);
- }
-
- public void testSetProperties() throws Exception
- {
- AbstractJMSMessage newMessage = new MessageConverter(_session, (TextMessage) testTextMessage).getConvertedMessage();
- mesagePropertiesTest(testTextMessage, newMessage);
- }
-
- public void testJMSTextMessageConversion() throws Exception
- {
- AbstractJMSMessage newMessage = new MessageConverter(_session, (TextMessage) testTextMessage).getConvertedMessage();
- assertEquals("Converted message text mismatch", ((JMSTextMessage) newMessage).getText(), testTextMessage.getText());
- }
-
- public void testJMSMapMessageConversion() throws Exception
- {
- AbstractJMSMessage newMessage = new MessageConverter(_session, (MapMessage) testMapMessage).getConvertedMessage();
- assertEquals("Converted map message String mismatch", ((JMSMapMessage) newMessage).getString("testMapString"),
- testMapMessage.getString("testMapString"));
- assertEquals("Converted map message Double mismatch", ((JMSMapMessage) newMessage).getDouble("testMapDouble"),
- testMapMessage.getDouble("testMapDouble"));
-
- }
-
- public void testMessageConversion() throws Exception
- {
- Message newMessage = new NonQpidMessage();
- setMessageProperties(newMessage);
- mesagePropertiesTest(testTextMessage, newMessage);
- }
-
- private void setMessageProperties(Message message) throws JMSException
- {
- message.setJMSCorrelationID(JMS_CORR_ID);
- message.setJMSDeliveryMode(JMS_DELIV_MODE);
- message.setJMSType(JMS_TYPE);
- message.setJMSReplyTo(JMS_REPLY_TO);
-
- //Add non-JMS properties
- message.setStringProperty("testProp1", "testValue1");
- message.setDoubleProperty("testProp2", Double.MIN_VALUE);
- }
-
-
- private void mesagePropertiesTest(Message expectedMessage, Message actualMessage)
- {
- try
- {
- //check JMS prop values on newMessage match
- assertEquals("JMS Correlation ID mismatch", expectedMessage.getJMSCorrelationID(), actualMessage.getJMSCorrelationID());
- assertEquals("JMS Delivery mode mismatch", expectedMessage.getJMSDeliveryMode(), actualMessage.getJMSDeliveryMode());
- assertEquals("JMS Type mismatch", expectedMessage.getJMSType(), actualMessage.getJMSType());
- assertEquals("JMS Reply To mismatch", expectedMessage.getJMSReplyTo(), actualMessage.getJMSReplyTo());
-
- //check non-JMS standard props ok too
- assertEquals("Test String prop value mismatch", expectedMessage.getStringProperty("testProp1"),
- actualMessage.getStringProperty("testProp1"));
-
- assertEquals("Test Double prop value mismatch", expectedMessage.getDoubleProperty("testProp2"),
- actualMessage.getDoubleProperty("testProp2"));
- }
- catch (JMSException e)
- {
- fail("An error occured testing the property values" + e.getCause());
- e.printStackTrace();
- }
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- testTextMessage = null;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/NonQpidMessage.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/NonQpidMessage.java
deleted file mode 100644
index df53c796b2..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/NonQpidMessage.java
+++ /dev/null
@@ -1,411 +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.
- *
- *
- */
-package org.apache.qpid.test.unit.message;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-public class NonQpidMessage implements Message
-{
- private String _JMSMessageID;
- private long _JMSTimestamp;
- private byte[] _JMSCorrelationIDAsBytes;
- private String _JMSCorrelationID;
- private Destination _JMSReplyTo;
- private Destination _JMSDestination;
- private int _JMSDeliveryMode;
- private boolean _JMSRedelivered;
- private String _JMSType;
- private long _JMSExpiration;
- private int _JMSPriority;
- private Hashtable _properties;
-
- public NonQpidMessage()
- {
- _properties = new Hashtable();
- _JMSPriority = javax.jms.Message.DEFAULT_PRIORITY;
- _JMSDeliveryMode = javax.jms.Message.DEFAULT_DELIVERY_MODE;
- }
-
- public String getJMSMessageID() throws JMSException
- {
- return _JMSMessageID;
- }
-
- public void setJMSMessageID(String string) throws JMSException
- {
- _JMSMessageID = string;
- }
-
- public long getJMSTimestamp() throws JMSException
- {
- return _JMSTimestamp;
- }
-
- public void setJMSTimestamp(long l) throws JMSException
- {
- _JMSTimestamp = l;
- }
-
- public byte[] getJMSCorrelationIDAsBytes() throws JMSException
- {
- return _JMSCorrelationIDAsBytes;
- }
-
- public void setJMSCorrelationIDAsBytes(byte[] bytes) throws JMSException
- {
- _JMSCorrelationIDAsBytes = bytes;
- }
-
- public void setJMSCorrelationID(String string) throws JMSException
- {
- _JMSCorrelationID = string;
- }
-
- public String getJMSCorrelationID() throws JMSException
- {
- return _JMSCorrelationID;
- }
-
- public Destination getJMSReplyTo() throws JMSException
- {
- return _JMSReplyTo;
- }
-
- public void setJMSReplyTo(Destination destination) throws JMSException
- {
- _JMSReplyTo = destination;
- }
-
- public Destination getJMSDestination() throws JMSException
- {
- return _JMSDestination;
- }
-
- public void setJMSDestination(Destination destination) throws JMSException
- {
- _JMSDestination = destination;
- }
-
- public int getJMSDeliveryMode() throws JMSException
- {
- return _JMSDeliveryMode;
- }
-
- public void setJMSDeliveryMode(int i) throws JMSException
- {
- _JMSDeliveryMode = i;
- }
-
- public boolean getJMSRedelivered() throws JMSException
- {
- return _JMSRedelivered;
- }
-
- public void setJMSRedelivered(boolean b) throws JMSException
- {
- _JMSRedelivered = b;
- }
-
- public String getJMSType() throws JMSException
- {
- return _JMSType;
- }
-
- public void setJMSType(String string) throws JMSException
- {
- _JMSType = string;
- }
-
- public long getJMSExpiration() throws JMSException
- {
- return _JMSExpiration;
- }
-
- public void setJMSExpiration(long l) throws JMSException
- {
- _JMSExpiration = l;
- }
-
- public int getJMSPriority() throws JMSException
- {
- return _JMSPriority;
- }
-
- public void setJMSPriority(int i) throws JMSException
- {
- _JMSPriority = i;
- }
-
- public void clearProperties() throws JMSException
- {
- _properties.clear();
- }
-
- public boolean propertyExists(String string) throws JMSException
- {
- return _properties.containsKey(string);
- }
-
- public boolean getBooleanProperty(String string) throws JMSException
- {
- if (propertyExists(string))
- {
- Object o = _properties.get(string);
- if (o instanceof Boolean)
- {
- return (Boolean) o;
- }
- else
- {
- return Boolean.valueOf(null);
- }
- }
- else
- {
- throw new JMSException("property does not exist: " + string);
- }
- }
-
- public byte getByteProperty(String string) throws JMSException
- {
- if (propertyExists(string))
- {
- Object o = _properties.get(string);
- if (o instanceof Byte)
- {
- return (Byte) o;
- }
- else
- {
- return Byte.valueOf(null);
- }
- }
- else
- {
- throw new JMSException("property does not exist: " + string);
- }
- }
-
- public short getShortProperty(String string) throws JMSException
- {
- if (propertyExists(string))
- {
- Object o = _properties.get(string);
- if (o instanceof Short)
- {
- return (Short) o;
- }
- else
- {
- return Short.valueOf(null);
- }
- }
- else
- {
- throw new JMSException("property does not exist: " + string);
- }
- }
-
- public int getIntProperty(String string) throws JMSException
- {
- if (propertyExists(string))
- {
- Object o = _properties.get(string);
- if (o instanceof Integer)
- {
- return (Integer) o;
- }
- else
- {
- return Integer.valueOf(null);
- }
- }
- else
- {
- throw new JMSException("property does not exist: " + string);
- }
- }
-
- public long getLongProperty(String string) throws JMSException
- {
- if (propertyExists(string))
- {
- Object o = _properties.get(string);
- if (o instanceof Long)
- {
- return (Long) o;
- }
- else
- {
- return Long.valueOf(null);
- }
- }
- else
- {
- throw new JMSException("property does not exist: " + string);
- }
- }
-
- public float getFloatProperty(String string) throws JMSException
- {
- if (propertyExists(string))
- {
- Object o = _properties.get(string);
- if (o instanceof Float)
- {
- return (Float) o;
- }
- else
- {
- return Float.valueOf(null);
- }
- }
- else
- {
- throw new JMSException("property does not exist: " + string);
- }
- }
-
- public double getDoubleProperty(String string) throws JMSException
- {
- if (propertyExists(string))
- {
- Object o = _properties.get(string);
- if (o instanceof Double)
- {
- return (Double) o;
- }
- else
- {
- return Double.valueOf(null);
- }
- }
- else
- {
- throw new JMSException("property does not exist: " + string);
- }
- }
-
- public String getStringProperty(String string) throws JMSException
- {
- if (propertyExists(string))
- {
- Object o = _properties.get(string);
- if (o instanceof String)
- {
- return (String) o;
- }
- else
- {
- return null;
- }
- }
- else
- {
- throw new JMSException("property does not exist: " + string);
- }
- }
-
- public Object getObjectProperty(String string) throws JMSException
- {
- if (propertyExists(string))
- {
- Object o = _properties.get(string);
- if (o instanceof Boolean)
- {
- return (Boolean) o;
- }
- else
- {
- return Boolean.valueOf(null);
- }
- }
- else
- {
- throw new JMSException("property does not exist: " + string);
- }
- }
-
- public Enumeration getPropertyNames() throws JMSException
- {
- return _properties.keys();
- }
-
- public void setBooleanProperty(String string, boolean b) throws JMSException
- {
- _properties.put(string, b);
- }
-
- public void setByteProperty(String string, byte b) throws JMSException
- {
- _properties.put(string, b);
- }
-
- public void setShortProperty(String string, short i) throws JMSException
- {
- _properties.put(string, i);
- }
-
- public void setIntProperty(String string, int i) throws JMSException
- {
- _properties.put(string, i);
- }
-
- public void setLongProperty(String string, long l) throws JMSException
- {
- _properties.put(string, l);
- }
-
- public void setFloatProperty(String string, float v) throws JMSException
- {
- _properties.put(string, v);
- }
-
- public void setDoubleProperty(String string, double v) throws JMSException
- {
- _properties.put(string, v);
- }
-
- public void setStringProperty(String string, String string1) throws JMSException
- {
- _properties.put(string, string1);
- }
-
- public void setObjectProperty(String string, Object object) throws JMSException
- {
- _properties.put(string, object);
- }
-
- public void acknowledge() throws JMSException
- {
-
- }
-
- public void clearBody() throws JMSException
- {
-
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java
deleted file mode 100644
index a881f6a822..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/TestAMQSession.java
+++ /dev/null
@@ -1,171 +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.
- *
- */
-package org.apache.qpid.test.unit.message;
-
-import org.apache.qpid.client.*;
-import org.apache.qpid.client.message.AMQMessageDelegateFactory;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.AMQException;
-
-import javax.jms.*;
-import java.util.Map;
-
-public class TestAMQSession extends AMQSession<BasicMessageConsumer_0_8, BasicMessageProducer_0_8>
-{
-
- public TestAMQSession()
- {
- super(null, 0, false, AUTO_ACKNOWLEDGE, null, 0, 0);
- }
-
- public void acknowledgeMessage(long deliveryTag, boolean multiple)
- {
-
- }
-
- public void sendQueueBind(AMQShortString queueName, AMQShortString routingKey, FieldTable arguments, AMQShortString exchangeName, AMQDestination destination) throws AMQException, FailoverException
- {
-
- }
-
- public void sendClose(long timeout) throws AMQException, FailoverException
- {
-
- }
-
- public void sendCommit() throws AMQException, FailoverException
- {
-
- }
-
- public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
- {
- return null;
- }
-
- public void sendCreateQueue(AMQShortString name, boolean autoDelete, boolean durable, boolean exclusive, Map<String, Object> arguments) throws AMQException, FailoverException
- {
-
- }
-
- public TemporaryQueue createTemporaryQueue() throws JMSException
- {
- return null;
- }
-
- protected void sendRecover() throws AMQException, FailoverException
- {
-
- }
-
- public void rejectMessage(long deliveryTag, boolean requeue)
- {
-
- }
-
- public void releaseForRollback()
- {
-
- }
-
- public void sendRollback() throws AMQException, FailoverException
- {
-
- }
-
- public BasicMessageConsumer_0_8 createMessageConsumer(AMQDestination destination, int prefetchHigh, int prefetchLow, boolean noLocal, boolean exclusive, String selector, FieldTable arguments, boolean noConsume, boolean autoClose) throws JMSException
- {
- return null;
- }
-
- public boolean isQueueBound(AMQShortString exchangeName, AMQShortString queueName, AMQShortString routingKey) throws JMSException
- {
- return false;
- }
-
- public boolean isQueueBound(AMQDestination destination) throws JMSException
- {
- return false;
- }
-
- public void sendConsume(BasicMessageConsumer_0_8 consumer, AMQShortString queueName, AMQProtocolHandler protocolHandler, boolean nowait, String messageSelector, int tag) throws AMQException, FailoverException
- {
-
- }
-
- public BasicMessageProducer_0_8 createMessageProducer(Destination destination, boolean mandatory, boolean immediate, boolean waitUntilSent, long producerId)
- {
- return null;
- }
-
- protected Long requestQueueDepth(AMQDestination amqd) throws AMQException, FailoverException
- {
- return null;
- }
-
- public void sendExchangeDeclare(AMQShortString name, AMQShortString type, AMQProtocolHandler protocolHandler, boolean nowait) throws AMQException, FailoverException
- {
-
- }
-
- public void sendQueueDeclare(AMQDestination amqd, AMQProtocolHandler protocolHandler) throws AMQException, FailoverException
- {
-
- }
-
- public void sendQueueDelete(AMQShortString queueName) throws AMQException, FailoverException
- {
-
- }
-
- public void sendSuspendChannel(boolean suspend) throws AMQException, FailoverException
- {
-
- }
-
- protected boolean tagLE(long tag1, long tag2)
- {
- return false;
- }
-
- protected boolean updateRollbackMark(long current, long deliveryTag)
- {
- return false;
- }
-
- public AMQMessageDelegateFactory getMessageDelegateFactory()
- {
- return AMQMessageDelegateFactory.FACTORY_0_8;
- }
-
- protected Object getFailoverMutex()
- {
- return this;
- }
-
- public void checkNotClosed()
- {
-
- }
-}
diff --git a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/tests.properties b/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/tests.properties
deleted file mode 100644
index 2fd961a078..0000000000
--- a/M4-RCs/qpid/java/client/src/test/java/org/apache/qpid/test/unit/tests.properties
+++ /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.
-
-
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-
-# use the following property to configure the default connector
-#java.naming.provider.url - ignored.
-
-# register some connection factories
-# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.local = amqp://username:password@clientid/test?brokerlist='tcp://localhost:5672'
-#qpid:password=guest;username=guest;client_id=clientid;virtualhost=test@tcp:127.0.0.1:5672
-
-
-# register some queues in JNDI using the form
-# queue.[jndiName] = [physicalName]
-queue.MyQueue = example.MyQueue
-queue.queue = example.queue
-queue.xaQueue = xaQueue
-
-# register some topics in JNDI using the form
-# topic.[jndiName] = [physicalName]
-#topic.ibmStocks = stocks.nyse.ibm
-topic.xaTopic = xaTopic
-topic.durableSubscriberTopic = durableSubscriberTopic
-
-# Register an AMQP destination in JNDI
-# NOTE: Qpid currently only supports direct,topics and headers
-# destination.[jniName] = [BindingURL]
-#destination.direct = direct://amq.direct//directQueue
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-JNDI-Setup.bat b/M4-RCs/qpid/java/client/test/bin/IBM-JNDI-Setup.bat
deleted file mode 100644
index eb6a87fa9e..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-JNDI-Setup.bat
+++ /dev/null
@@ -1,69 +0,0 @@
-@REM
-@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.
-@REM
-
-@echo off
-REM Script to run the Qpid Java Broker
-
-set CMD="IBM-JNDI-Setup.bat"
-set JAVACLASS=
-
-rem Guess QPID_HOME if not defined
-set CURRENT_DIR=%cd%
-if not "%QPID_HOME%" == "" goto gotHome
-set QPID_HOME=%CURRENT_DIR%
-echo %QPID_HOME%
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-cd ..
-set QPID_HOME=%cd%
-cd %CURRENT_DIR%
-:gotHome
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-echo The QPID_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-:okHome
-
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto exit
-:gotJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program.
-goto exit
-:okJavaHome
-
-set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
-
-echo on
-"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindConnectionFactory amqp://guest:guest@clientid/testpath?brokerlist='localhost' amq.ConnectionFactory
-"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindConnectionFactory amqp://guest:guest@clientid/testpath?brokerlist='vm://:1' amq.VMConnectionFactory
-"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindQueue amq.Queue direct://amq.direct//IBMPerfQueue1
-"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic1 topic://amq.topic/IBMPerfTopic1/
-"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic2 topic://amq.topic/IBMPerfTopic2/
-"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic3 topic://amq.topic/IBMPerfTopic3/
-
-
-
-:end
-
-pause \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-JNDI-Setup.sh b/M4-RCs/qpid/java/client/test/bin/IBM-JNDI-Setup.sh
deleted file mode 100755
index e3112f812d..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-JNDI-Setup.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-qpid-run org.apache.qpid.IBMPerfTest.JNDIBindConnectionFactory amqp://guest:guest@clientid/testpath?brokerlist=\'tcp://localhost\' amq.ConnectionFactory
-qpid-run org.apache.qpid.IBMPerfTest.JNDIBindConnectionFactory amqp://guest:guest@clientid/testpath?brokerlist=\'vm://:1\' amq.VMConnectionFactory
-qpid-run org.apache.qpid.IBMPerfTest.JNDIBindQueue amq.Queue direct://amq.direct//IBMPerfQueue1
-qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic1 topic://amq.topic/IBMPerfTopic1/
-qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic2 topic://amq.topic/IBMPerfTopic2/
-qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic3 topic://amq.topic/IBMPerfTopic3/
-qpid-run org.apache.qpid.IBMPerfTest.JNDIBindTopic amq.Topic4 topic://amq.topic/IBMPerfTopic4/ \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-Publisher.bat b/M4-RCs/qpid/java/client/test/bin/IBM-Publisher.bat
deleted file mode 100644
index 5bb4343c4c..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-Publisher.bat
+++ /dev/null
@@ -1,62 +0,0 @@
-@REM
-@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.
-@REM
-
-@echo off
-REM Script to run the Qpid Java Broker
-
-set CMD="IBM-Publisher.bat"
-set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Topic -db 1 -dx 4 -tc jms.r11.Publisher -nt 4 %*
-
-rem Guess QPID_HOME if not defined
-set CURRENT_DIR=%cd%
-if not "%QPID_HOME%" == "" goto gotHome
-set QPID_HOME=%CURRENT_DIR%
-echo %QPID_HOME%
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-cd ..
-set QPID_HOME=%cd%
-cd %CURRENT_DIR%
-:gotHome
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-echo The QPID_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-:okHome
-
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto exit
-:gotJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program.
-goto exit
-:okJavaHome
-
-set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
-
-echo on
-"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
-
-:end
-
-pause \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-Publisher.sh b/M4-RCs/qpid/java/client/test/bin/IBM-Publisher.sh
deleted file mode 100755
index adecf040bc..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-Publisher.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-export MSGSIZE=100
-qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:///tmp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Topic -db 1 -dx 4 -tc jms.r11.Publisher -nt 4 $* \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-PutGet.bat b/M4-RCs/qpid/java/client/test/bin/IBM-PutGet.bat
deleted file mode 100644
index c4316f1256..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-PutGet.bat
+++ /dev/null
@@ -1,62 +0,0 @@
-@REM
-@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.
-@REM
-
-@echo off
-REM Script to run the Qpid Java Broker
-
-set CMD="IBM-PutGet.bat"
-set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.PutGet -nt 6 %*
-
-rem Guess QPID_HOME if not defined
-set CURRENT_DIR=%cd%
-if not "%QPID_HOME%" == "" goto gotHome
-set QPID_HOME=%CURRENT_DIR%
-echo %QPID_HOME%
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-cd ..
-set QPID_HOME=%cd%
-cd %CURRENT_DIR%
-:gotHome
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-echo The QPID_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-:okHome
-
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto exit
-:gotJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program.
-goto exit
-:okJavaHome
-
-set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
-
-echo on
-"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
-
-:end
-
-pause \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-PutGet.sh b/M4-RCs/qpid/java/client/test/bin/IBM-PutGet.sh
deleted file mode 100755
index c75667c9f6..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-PutGet.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:///tmp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.PutGet -nt 6 $* \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-README.txt b/M4-RCs/qpid/java/client/test/bin/IBM-README.txt
deleted file mode 100644
index b076f3b3ca..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-README.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-The IBM JMS Performance Harness scripts have take the following additional parameters
-
--tx : Enable transactions
--pp : Enable persistent messaging
-
--ms 1000 : Set message size (default 1000 bytes)
--cc 1 : Number of messages to per commit (default 1) Only applies to Sender/Subscriber
-
-The IBM JMS Performance Harness will need to be downloaded and the library added to client/test/lib.
-
-The Library can be found here:
-
-http://www.alphaworks.ibm.com/tech/perfharness
-
-Before running the required test the IBM JNDI Setup script should be run.
-
-This will create a filesystem based JNDI Context located at:
-
-System.properties{java.io.tmpdir}/IBMPerfTestsJNDI/ \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-Receiver.bat b/M4-RCs/qpid/java/client/test/bin/IBM-Receiver.bat
deleted file mode 100644
index dff44d472a..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-Receiver.bat
+++ /dev/null
@@ -1,62 +0,0 @@
-@REM
-@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.
-@REM
-
-@echo off
-REM Script to run the Qpid Java Broker
-
-set CMD="IBM-Receiver.bat"
-set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.Receiver %*
-
-rem Guess QPID_HOME if not defined
-set CURRENT_DIR=%cd%
-if not "%QPID_HOME%" == "" goto gotHome
-set QPID_HOME=%CURRENT_DIR%
-echo %QPID_HOME%
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-cd ..
-set QPID_HOME=%cd%
-cd %CURRENT_DIR%
-:gotHome
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-echo The QPID_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-:okHome
-
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto exit
-:gotJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program.
-goto exit
-:okJavaHome
-
-set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
-
-echo on
-"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
-
-:end
-
-pause \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-Receiver.sh b/M4-RCs/qpid/java/client/test/bin/IBM-Receiver.sh
deleted file mode 100755
index f50f0f744e..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-Receiver.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-export MSGSIZE=100
-qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:///tmp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.Receiver $* \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-Sender.bat b/M4-RCs/qpid/java/client/test/bin/IBM-Sender.bat
deleted file mode 100644
index b8826322e5..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-Sender.bat
+++ /dev/null
@@ -1,62 +0,0 @@
-@REM
-@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.
-@REM
-
-@echo off
-REM Script to run the Qpid Java Broker
-
-set CMD="IBM-Sender.bat"
-set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.Sender -ms $MSGSIZE -mg 1000000 %*
-
-rem Guess QPID_HOME if not defined
-set CURRENT_DIR=%cd%
-if not "%QPID_HOME%" == "" goto gotHome
-set QPID_HOME=%CURRENT_DIR%
-echo %QPID_HOME%
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-cd ..
-set QPID_HOME=%cd%
-cd %CURRENT_DIR%
-:gotHome
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-echo The QPID_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-:okHome
-
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto exit
-:gotJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program.
-goto exit
-:okJavaHome
-
-set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
-
-echo on
-"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
-
-:end
-
-pause \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-Sender.sh b/M4-RCs/qpid/java/client/test/bin/IBM-Sender.sh
deleted file mode 100755
index b99429fd54..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-Sender.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-export MSGSIZE=100
-qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:///tmp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Queue -tc jms.r11.Sender -ms $MSGSIZE -mg 1000000 $* \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-Subscriber.bat b/M4-RCs/qpid/java/client/test/bin/IBM-Subscriber.bat
deleted file mode 100644
index 5245639eba..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-Subscriber.bat
+++ /dev/null
@@ -1,62 +0,0 @@
-@REM
-@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.
-@REM
-
-@echo off
-REM Script to run the Qpid Java Broker
-
-set CMD="IBM-Subscriber.bat"
-set JAVACLASS=JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:/C:/temp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Topic -db 1 -dx 4 -tc jms.r11.Subscriber -nt 4 %*
-
-rem Guess QPID_HOME if not defined
-set CURRENT_DIR=%cd%
-if not "%QPID_HOME%" == "" goto gotHome
-set QPID_HOME=%CURRENT_DIR%
-echo %QPID_HOME%
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-cd ..
-set QPID_HOME=%cd%
-cd %CURRENT_DIR%
-:gotHome
-if exist "%QPID_HOME%\bin\%CMD%" goto okHome
-echo The QPID_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-:okHome
-
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto exit
-:gotJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program.
-goto exit
-:okJavaHome
-
-set CLIENT_TEST_CLASSES=%QPID_HOME%\lib\client-test-launch.jar
-
-echo on
-"%JAVA_HOME%\bin\java" -server -Xmx1024m -DQPID_HOME="%QPID_HOME%" -cp "%CLIENT_TEST_CLASSES%" %JAVACLASS%
-
-:end
-
-pause \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/IBM-Subscriber.sh b/M4-RCs/qpid/java/client/test/bin/IBM-Subscriber.sh
deleted file mode 100755
index 43550100be..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/IBM-Subscriber.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-export MSGSIZE=100
-qpid-run JMSPerfHarness -pc JNDI -ii com.sun.jndi.fscontext.RefFSContextFactory -iu file:///tmp/IBMPerfTestsJNDI/ -cf amq.ConnectionFactory -d amq.Topic -db 1 -dx 4 -tc jms.r11.Subscriber -nt 4 $* \ No newline at end of file
diff --git a/M4-RCs/qpid/java/client/test/bin/headersListener.sh b/M4-RCs/qpid/java/client/test/bin/headersListener.sh
deleted file mode 100755
index 81930b7043..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/headersListener.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-
-. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.headers.Listener $*
diff --git a/M4-RCs/qpid/java/client/test/bin/headersListenerGroup.sh b/M4-RCs/qpid/java/client/test/bin/headersListenerGroup.sh
deleted file mode 100755
index e1cc05cfd2..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/headersListenerGroup.sh
+++ /dev/null
@@ -1,25 +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.
-#
-
-
-for i; do
- ./headersListener.sh -host 10.0.0.1 -port 5672 >$i.out 2>$i.err &
- echo $! > $i.pid
-done;
diff --git a/M4-RCs/qpid/java/client/test/bin/headersPublisher.sh b/M4-RCs/qpid/java/client/test/bin/headersPublisher.sh
deleted file mode 100755
index fd9fd26416..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/headersPublisher.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-
-. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.headers.Publisher $*
diff --git a/M4-RCs/qpid/java/client/test/bin/run_many.sh b/M4-RCs/qpid/java/client/test/bin/run_many.sh
deleted file mode 100755
index cca2ffec21..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/run_many.sh
+++ /dev/null
@@ -1,30 +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.
-#
-
-
-# args:
-# <number of processes to start>
-# <name of run>
-# <command ro run>
-
-for i in `seq 1 $1`; do
- $3 >$2.$i.out 2>>$2.err &
- echo $! > $2.$i.pid
-done;
diff --git a/M4-RCs/qpid/java/client/test/bin/serviceProvidingClient.sh b/M4-RCs/qpid/java/client/test/bin/serviceProvidingClient.sh
deleted file mode 100755
index cbcf5a0f4b..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/serviceProvidingClient.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-PROFILE=$1
-shift
-# XXX -Xms1024m -XX:NewSize=300m
-. qpid-run org.apache.qpid.requestreply1.ServiceProvidingClient $1 guest guest /test serviceQ
diff --git a/M4-RCs/qpid/java/client/test/bin/serviceRequestingClient.sh b/M4-RCs/qpid/java/client/test/bin/serviceRequestingClient.sh
deleted file mode 100755
index 213f44c00b..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/serviceRequestingClient.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-PROFILE=$1
-shift
-thehosts=$1
-shift
-echo $thehosts
-# XXX -Xms1024m -XX:NewSize=300m
-. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.requestreply1.ServiceRequestingClient $thehosts guest guest /test serviceQ "$@"
diff --git a/M4-RCs/qpid/java/client/test/bin/testService.sh b/M4-RCs/qpid/java/client/test/bin/testService.sh
deleted file mode 100755
index 20161c3abf..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/testService.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-
-. qpid-run org.apache.qpid.requestreply1.TestService 192.168.55.63 5672 foo x x
diff --git a/M4-RCs/qpid/java/client/test/bin/topicListener.sh b/M4-RCs/qpid/java/client/test/bin/topicListener.sh
deleted file mode 100755
index ac0cb63c91..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/topicListener.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-
-# XXX -Xmx512m -Xms512m -XX:NewSize=150m
-. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.topic.Listener $*
diff --git a/M4-RCs/qpid/java/client/test/bin/topicPublisher.sh b/M4-RCs/qpid/java/client/test/bin/topicPublisher.sh
deleted file mode 100755
index e35c131fe8..0000000000
--- a/M4-RCs/qpid/java/client/test/bin/topicPublisher.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-# XXX -Xmx512m -Xms512m -XX:NewSize=150m
-. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.topic.Publisher $*
diff --git a/M4-RCs/qpid/java/client/test/etc/ApacheDS.properties b/M4-RCs/qpid/java/client/test/etc/ApacheDS.properties
deleted file mode 100644
index 6c5cb4cec4..0000000000
--- a/M4-RCs/qpid/java/client/test/etc/ApacheDS.properties
+++ /dev/null
@@ -1,24 +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.
-#
-# Standard JNDI properties
-java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
-java.naming.provider.url=ldap://localhost:389/ou=system
-java.naming.security.authentication=simple
-java.naming.security.principal=uid=admin,ou=system
-java.naming.security.credentials=secret
diff --git a/M4-RCs/qpid/java/client/test/example_build.xml b/M4-RCs/qpid/java/client/test/example_build.xml
deleted file mode 100644
index a12862be04..0000000000
--- a/M4-RCs/qpid/java/client/test/example_build.xml
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.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.
- -
- -->
-
-<!-- example Blaze Component Java build file -->
-
-<project name="example-client" default="jar" basedir=".">
- <property name="lib" value="${basedir}/lib"/>
- <property name="common.lib" value="${basedir}/../common/lib"/>
- <property name="example.dir" value="${basedir}"/>
- <property name="example.src" value="${example.dir}/src"/>
- <property name="example.lib" value="${example.dir}/lib"/>
- <property name="example.tests" value="${example.dir}/test"/>
- <property name="example.classes" value="${example.dir}/classes"/>
- <property name="dist" value="${basedir}/dist"/>
- <property name="dam.dist" value="${basedir}/damPackage"/>
-
- <!-- Setup details -->
- <target name="init">
- <tstamp>
- <format property="release" pattern="-dMMMyy" locale="en" timezone="GMT"/>
- </tstamp>
- <mkdir dir="${example.classes}"/>
- </target>
-
- <path id="example.classpath">
- <fileset dir="${common}/lib">
- <include name="**/*.jar"/>
- </fileset>
- <pathelement path="${example.classes}"/>
- </path>
-
- <!-- Remove all built files -->
- <target name="clean" depends="init">
- <delete dir="${example.classes}"/>
- </target>
-
- <path id="example_amq.classpath">
- <fileset dir="${basedir}/lib">
- <include name="**/*.jar"/>
- </fileset>
- <fileset dir="${example.lib}">
- <include name="**/*.jar"/>
- </fileset>
- <pathelement path="${example.classes}"/>
-
- </path>
-
- <!-- Compile Java -->
- <target name="compile" depends="init">
- <javac destdir="${example.classes}" debug="on">
- <classpath refid="example_amq.classpath"/>
- <src path="${example.src}"/>
- <exclude name="**/Test*.java"/>
- </javac>
-
- <copy todir="${example.classes}">
- <!-- copy any non java src files into the build tree, e.g. log4j.properties -->
- <fileset dir="${example.src}">
- <exclude name="**/*.java"/>
- <exclude name="**/package.html"/>
- </fileset>
- </copy>
- </target>
-
- <!-- Compile and build jar archive -->
- <target name="dist" depends="compile">
- <mkdir dir="${dist}"/>
- <jar basedir="${example.classes}" jarfile="${dist}/example_amq.jar"/>
- </target>
-
- <!-- Create release zip and tar -->
- <target name="release" depends="dist" description="Create a release package">
-
- <zip destfile="${dist}/example_client.zip">
- <zipfileset prefix="lib" file="${dist}/example_amq.jar" />
- </zip>
-
- <tar destfile="${dist}/example_client.tar.gz" compression="gzip">
- <tarfileset prefix="lib" file="${dist}/example_amq.jar" />
- </tar>
- </target>
-
-
-
-</project>
diff --git a/M4-RCs/qpid/java/common.xml b/M4-RCs/qpid/java/common.xml
deleted file mode 100644
index 146781ec23..0000000000
--- a/M4-RCs/qpid/java/common.xml
+++ /dev/null
@@ -1,268 +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.
- -
- -->
-<project name="common">
-
- <dirname property="project.root" file="${ant.file.common}"/>
-
- <property name="project.name" value="qpid"/>
- <property name="project.version" value="M4"/>
- <property name="project.namever" value="${project.name}-${project.version}"/>
-
- <property name="resources" location="${project.root}/resources"/>
- <property name="build" location="${project.root}/build"/>
- <property name="build.bin" location="${build}/bin"/>
- <property name="build.etc" location="${build}/etc"/>
- <property name="build.lib" location="${build}/lib"/>
- <property name="build.results" location="${build}/results"/>
- <property name="build.failed" location="${build.results}/FAILED"/>
- <property name="build.report" location="${build}/report"/>
- <property name="build.release" location="${build}/release"/>
- <property name="build.release.prepare" location="${build.release}/prepare"/>
- <property name="build.data" location="${build}/data"/>
- <property name="build.plugins" location="${build}/lib/plugins"/>
- <property name="build.coveragereport" location="${build}/coverage"/>
-
- <property name="java.target" value="1.5"/>
- <property name="java.source" value="1.5"/>
-
- <property name="release" location="${project.root}/release"/>
-
- <property name="tasks" location="${project.root}/tasks"/>
- <property name="tasks.classes" location="${tasks}/classes"/>
- <property name="tasks.src" location="${tasks}/src"/>
-
- <property name="javac.compiler.args" value=""/>
-
- <property name="cobertura.dir" value="${project.root}/lib/cobertura" />
- <property name="mllib.dir" value="${project.root}/../python" />
-
- <path id="cobertura.classpath">
- <fileset dir="${cobertura.dir}">
- <include name="cobertura.jar" />
- <include name="lib/**/*.jar" />
- </fileset>
- </path>
-
- <taskdef classpathref="cobertura.classpath" resource="tasks.properties" />
-
- <macrodef name="indirect">
- <attribute name="name"/>
- <attribute name="variable"/>
- <sequential>
- <property name="@{name}" value="${@{variable}}"/>
- </sequential>
- </macrodef>
-
- <macrodef name="echo-path">
- <attribute name="refid"/>
- <sequential>
- <property name="@{refid}" refid="@{refid}"/>
- <echo message="@{refid} = ${@{refid}}"/>
- <pathconvert property="@{refid}.pretty"
- refid="@{refid}"
- pathsep="${line.separator} |-- "/>
- <echo message="@{refid}.pretty =${line.separator} |-- ${@{refid}.pretty}"/>
- </sequential>
- </macrodef>
-
- <macrodef name="echo-prop">
- <attribute name="name"/>
- <sequential>
- <echo message="@{name} = ${@{name}}"/>
- </sequential>
- </macrodef>
-
- <macrodef name="jython">
- <attribute name="path"/>
- <element name="args"/>
- <sequential>
- <java classname="org.python.util.jython" fork="true" failonerror="true">
- <arg value="-Dpython.cachedir.skip=true"/>
- <arg value="-Dpython.path=${project.root}/lib/jython-lib.jar/Lib${path.separator}@{path}"/>
- <args/>
- <classpath>
- <pathelement location="${project.root}/lib/jython-2.2-rc2.jar"/>
- </classpath>
- </java>
- </sequential>
- </macrodef>
-
- <mkdir dir="${tasks.classes}"/>
- <javac source="${java.source}" target="${java.target}" srcdir="${tasks.src}" destdir="${tasks.classes}" classpath="${java.class.path}">
- <compilerarg line="${javac.compiler.args}"/>
- </javac>
-
- <taskdef name="map" classname="org.apache.qpid.tasks.Map"
- classpath="${tasks.classes}"/>
- <taskdef name="foreach" classname="org.apache.qpid.tasks.Foreach"
- classpath="${tasks.classes}"/>
-
- <target name="clean-tasks">
- <delete dir="${tasks.classes}"/>
- </target>
-
- <target name="clean-results">
- <delete dir="${build.results}"/>
- </target>
-
- <target name="report" description="generate test report">
- <delete dir="${build.report}"/>
- <mkdir dir="${build.report}"/>
- <junitreport todir="${build.report}">
- <fileset dir="${build.results}">
- <include name="**/TEST-*.xml"/>
- </fileset>
- <report todir="${build.report}"/>
- </junitreport>
- </target>
-
- <target name="help" description="display detailed build documentation">
- <echo>
- ant build
-
- This target compiles all sources, creates java archives, and
- copies scripts and configurations into the build directory:
-
- ${build}
-
- The build directory is treated as a live distro which this target
- will incrementally update. Developers can put the build/bin
- directory into their path in order to run any scripts or code
- directly out of the live build:
-
- ${build.bin}
-
- ant test [ -Dtest=&lt;pattern&gt; ] [-Dprofile=&lt;profile&gt;] [ report ]
-
- Execute unit tests and place the output in the build results
- directory:
-
- ${build.results}
-
- All test output will be redirected to a file of the form:
-
- TEST-&lt;class&gt;.txt
-
- The same output is available using an xml file format:
-
- TEST-&lt;class&gt;.xml
-
- The test system property may be used to restrict the number of
- tests run by a given invocation of the ant test target. The
- following command will run just the MongooseTest test case:
-
- ant test -Dtest=MongooseTest
-
- In addition, patterns may be used to specify more than one test.
- The following command will run both the MongooseTest and GooseTest
- test cases:
-
- ant test -Dtest=*ooseTest
-
- If no test property is specified, the "ant test" target will
- default to running all available tests for the project or module
- depending on the current working directory.
-
- Test Reports
-
- It can be useful to append the report target in order to
- generate an html summary of the tests that were just run. The
- following command will run both the MongooseTest and GooseTest
- test cases and generate an html summary of the results:
-
- ant test -Dtest=*ooseTest report
-
- See the documentation for the "ant report" target for more details
- on the generated report.
-
- Test Profiles
-
- There are a number of profiles defined for running the test suite.
- These test profiles define how the test should be run. If the test
- profile is not specified then 'default.testprofile' is utilised.
- This runs the system tests against the Java InVM broker. Additional
- test profiles exists as follows:
-
- cpp : Runs against the built cpp tree broker.
-
- ant report
-
- The report target will generate an html summary of the current
- test results into the report directory:
-
- ${build.report}
-
- The report target will operate on all results currently in the
- build results directory. Results are not cleared unless the clean
- target is used. This means that several consecutive test runs can
- be summarized into a single report. The following commands will
- produce a report summarizing both the MongooseTest and GooseTest
- test cases:
-
- ant test -Dtest=MongooseTest
- ...
- ant test -Dtest=GooseTest
- ...
- ant report
-
- ant release
-
- The release target generates binary distribution archives and
- places them into the release directory:
-
- ${release}
-
- ant release-bin
-
- The release-bin target generates binary distribution archives for
- modules that have a specific binary package configured.
- To enable for other modules create a target "release-bin" that
- depends on target "release-bin-tasks". The output is placed in:
-
- ${module.release}
-
- ant clean
-
- The clean target removes build artifacts. When invoked from the
- project root this target will remove the entire project build and
- release directories:
-
- ${build}
- and
- ${release}
- and
- ${module.release}
-
- When invoked from a specific module, the clean target will delete
- that modules build root from underneath the project build root:
-
- ${build}/&lt;module&gt;
-
- ant clean-results
-
- The clean-results target removes all test output from the test
- results directory:
-
- ${build.results}
- </echo>
- </target>
-
-</project>
diff --git a/M4-RCs/qpid/java/common/Composite.tpl b/M4-RCs/qpid/java/common/Composite.tpl
deleted file mode 100644
index 17cf846d8c..0000000000
--- a/M4-RCs/qpid/java/common/Composite.tpl
+++ /dev/null
@@ -1,336 +0,0 @@
-package org.apache.qpid.transport;
-/*
- *
- * 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 java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encodable;
-import org.apache.qpid.transport.codec.Encoder;
-
-import org.apache.qpid.transport.network.Frame;
-
-import org.apache.qpid.util.Strings;
-
-
-${
-from genutil import *
-
-cls = klass(type)["@name"]
-
-segments = type["segments"]
-
-if type.name in ("control", "command"):
- base = "Method"
- size = 0
- pack = 2
- if segments:
- payload = "true"
- else:
- payload = "false"
- if type.name == "control" and cls == "connection":
- track = "Frame.L1"
- elif cls == "session" and type["@name"] in ("attach", "attached", "detach", "detached"):
- track = "Frame.L2"
- elif type.name == "command":
- track = "Frame.L4"
- else:
- track = "Frame.L3"
-else:
- base = "Struct"
- size = type["@size"]
- pack = num(type["@pack"])
- payload = "false"
- track = "-1"
-
-PACK_TYPES = {
- 1: "byte",
- 2: "short",
- 4: "int"
-}
-
-typecode = code(type)
-}
-
-public final class $name extends $base {
-
- public static final int TYPE = $typecode;
-
- public final int getStructType() {
- return TYPE;
- }
-
- public final int getSizeWidth() {
- return $size;
- }
-
- public final int getPackWidth() {
- return $pack;
- }
-
- public final boolean hasPayload() {
- return $payload;
- }
-
- public final byte getEncodedTrack() {
- return $track;
- }
-
-${
-
-if pack > 0:
- out(" private $(PACK_TYPES[pack]) packing_flags = 0;\n");
-
-fields = get_fields(type)
-params = get_parameters(type, fields)
-options = get_options(fields)
-
-for f in fields:
- if not f.empty:
- out(" private $(f.type) $(f.name);\n")
-
-if segments:
- out(" private Header header;\n")
- out(" private ByteBuffer body;\n")
-}
-
-${
-if fields:
- out(" public $name() {}\n")
-}
-
- public $name($(", ".join(params))) {
-${
-for f in fields:
- if f.option: continue
- out(" $(f.set)($(f.name));\n")
-
-if segments:
- out(" setHeader(header);\n")
- out(" setBody(body);\n")
-
-if options or base == "Method":
- out("""
- for (int i=0; i < _options.length; i++) {
- switch (_options[i]) {
-""")
-
- for f in options:
- out(" case $(f.option): packing_flags |= $(f.flag_mask(pack)); break;\n")
-
- if base == "Method":
- out(""" case SYNC: this.setSync(true); break;
- case BATCH: this.setBatch(true); break;
-""")
- out(""" case NONE: break;
- default: throw new IllegalArgumentException("invalid option: " + _options[i]);
- }
- }
-""")
-}
- }
-
-${
-
-if base == "Method":
- out(""" public <C> void dispatch(C context, MethodDelegate<C> delegate) {
- delegate.$(dromedary(name))(context, this);
- }""")
-}
-
-${
-for f in fields:
- if pack > 0:
- out("""
- public final boolean $(f.has)() {
- return (packing_flags & $(f.flag_mask(pack))) != 0;
- }
-
- public final $name $(f.clear)() {
- packing_flags &= ~$(f.flag_mask(pack));
-${
-if not f.empty:
- out(" this.$(f.name) = $(f.default);")
-}
- this.dirty = true;
- return this;
- }
-""")
-
- out("""
- public final $(f.type) $(f.get)() {
-${
-if f.empty:
- out(" return $(f.has)();")
-else:
- out(" return $(f.name);")
-}
- }
-
- public final $name $(f.set)($(f.type) value) {
-${
-if not f.empty:
- out(" this.$(f.name) = value;")
-}
-${
-if pack > 0:
- if f.empty:
- out(" if (value)\\n")
- out(" packing_flags |= $(f.flag_mask(pack));\\n")
- out(" else\\n")
- out(" packing_flags &= ~$(f.flag_mask(pack));")
- else:
- out(" packing_flags |= $(f.flag_mask(pack));")
-}
- this.dirty = true;
- return this;
- }
-
- public final $name $(f.name)($(f.type) value) {
- return $(f.set)(value);
- }
-""")
-}
-
-${
-if segments:
- out(""" public final Header getHeader() {
- return this.header;
- }
-
- public final void setHeader(Header header) {
- this.header = header;
- }
-
- public final $name header(Header header) {
- setHeader(header);
- return this;
- }
-
- public final ByteBuffer getBody() {
- if (this.body == null)
- {
- return null;
- }
- else
- {
- return this.body.slice();
- }
- }
-
- public final void setBody(ByteBuffer body) {
- this.body = body;
- }
-
- public final $name body(ByteBuffer body)
- {
- setBody(body);
- return this;
- }
-
- public final byte[] getBodyBytes() {
- ByteBuffer buf = getBody();
- byte[] bytes = new byte[buf.remaining()];
- buf.get(bytes);
- return bytes;
- }
-
- public final void setBody(byte[] body)
- {
- setBody(ByteBuffer.wrap(body));
- }
-
- public final String getBodyString() {
- return Strings.fromUTF8(getBodyBytes());
- }
-
- public final void setBody(String body) {
- setBody(Strings.toUTF8(body));
- }
-""")
-}
-
- public void write(Encoder enc)
- {
-${
-if pack > 0:
- out(" enc.writeUint%s(packing_flags);\n" % (pack*8));
-
-for f in fields:
- if f.empty:
- continue
- if pack > 0:
- out(" if ((packing_flags & $(f.flag_mask(pack))) != 0)\n ")
- pre = ""
- post = ""
- if f.type_node.name == "struct":
- pre = "%s.TYPE, " % cname(f.type_node)
- elif f.type_node.name == "domain":
- post = ".getValue()"
- out(" enc.write$(f.coder)($(pre)this.$(f.name)$(post));\n")
-}
- }
-
- public void read(Decoder dec)
- {
-${
-if pack > 0:
- out(" packing_flags = ($(PACK_TYPES[pack])) dec.readUint%s();\n" % (pack*8));
-
-for f in fields:
- if f.empty:
- continue
- if pack > 0:
- out(" if ((packing_flags & $(f.flag_mask(pack))) != 0)\n ")
- pre = ""
- post = ""
- arg = ""
- if f.type_node.name == "struct":
- pre = "(%s)" % cname(f.type_node)
- arg = "%s.TYPE" % cname(f.type_node)
- elif f.type_node.name == "domain":
- pre = "%s.get(" % cname(f.type_node)
- post = ")"
- out(" this.$(f.name) = $(pre)dec.read$(f.coder)($(arg))$(post);\n")
-}
- }
-
- public Map<String,Object> getFields()
- {
- Map<String,Object> result = new LinkedHashMap<String,Object>();
-
-${
-for f in fields:
- if pack > 0:
- out(" if ((packing_flags & $(f.flag_mask(pack))) != 0)\n ")
- out(' result.put("$(f.name)", $(f.get)());\n')
-}
-
- return result;
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/Constant.tpl b/M4-RCs/qpid/java/common/Constant.tpl
deleted file mode 100644
index da4233c847..0000000000
--- a/M4-RCs/qpid/java/common/Constant.tpl
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.apache.qpid.transport;
-/*
- *
- * 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 genutil import *}
-
-public interface Constant
-{
-${
-constants = spec.query["amqp/constant"]
-
-for c in constants:
- name = scream(c["@name"])
- value = c["@value"]
- out(" public static final int $name = $value;\n")
-}}
diff --git a/M4-RCs/qpid/java/common/Enum.tpl b/M4-RCs/qpid/java/common/Enum.tpl
deleted file mode 100644
index 0835d34a20..0000000000
--- a/M4-RCs/qpid/java/common/Enum.tpl
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.apache.qpid.transport;
-/*
- *
- * 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.
- *
- */
-
-
-public enum $name {
-${
-from genutil import *
-
-vtype = jtype(resolve_type(type))
-
-choices = [(scream(ch["@name"]), "(%s) %s" % (vtype, ch["@value"]))
- for ch in type.query["enum/choice"]]
-}
- $(",\n ".join(["%s(%s)" % ch for ch in choices]));
-
- private final $vtype value;
-
- $name($vtype value)
- {
- this.value = value;
- }
-
- public $vtype getValue()
- {
- return value;
- }
-
- public static $name get($vtype value)
- {
- switch (value)
- {
-${
-for ch, value in choices:
- out(' case $value: return $ch;\n')
-} default: throw new IllegalArgumentException("no such value: " + value);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/Invoker.tpl b/M4-RCs/qpid/java/common/Invoker.tpl
deleted file mode 100644
index 2eed43ad28..0000000000
--- a/M4-RCs/qpid/java/common/Invoker.tpl
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.apache.qpid.transport;
-/*
- *
- * 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 java.nio.ByteBuffer;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-public abstract class $(invoker) {
-${
-from genutil import *
-
-results = False
-
-for c in composites:
- name = cname(c)
- fields = get_fields(c)
- params = get_parameters(c, fields)
- args = get_arguments(c, fields)
- result = c["result"]
- if result:
- results = True
- if not result["@type"]:
- rname = cname(result["struct"])
- else:
- rname = cname(result, "@type")
- jresult = "Future<%s>" % rname
- jreturn = "return "
- jclass = ", %s.class" % rname
- else:
- jresult = "void"
- jreturn = ""
- jclass = ""
-
- if c.name == "command":
- access = "public "
- else:
- access = ""
-
- out("""
- $(access)final $jresult $(dromedary(name))($(", ".join(params))) {
- $(jreturn)invoke(new $name($(", ".join(args)))$jclass);
- }
-""")
-}
- protected abstract void invoke(Method method);
-${
-if results:
- out("""
- protected abstract <T> Future<T> invoke(Method method, Class<T> resultClass);
-""")
-}
-}
diff --git a/M4-RCs/qpid/java/common/MethodDelegate.tpl b/M4-RCs/qpid/java/common/MethodDelegate.tpl
deleted file mode 100644
index 27e20a7ef2..0000000000
--- a/M4-RCs/qpid/java/common/MethodDelegate.tpl
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.apache.qpid.transport;
-/*
- *
- * 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.
- *
- */
-
-
-public abstract class MethodDelegate<C> {
-
- public abstract void handle(C context, Method method);
-${
-from genutil import *
-
-for c in composites:
- name = cname(c)
- out("""
- public void $(dromedary(name))(C context, $name method) {
- handle(context, method);
- }""")
-}
-}
diff --git a/M4-RCs/qpid/java/common/Option.tpl b/M4-RCs/qpid/java/common/Option.tpl
deleted file mode 100644
index 776b211ad5..0000000000
--- a/M4-RCs/qpid/java/common/Option.tpl
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.apache.qpid.transport;
-/*
- *
- * 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.
- *
- */
-
-
-public enum Option {
-
-${
-from genutil import *
-
-options = {}
-
-for c in composites:
- for f in c.query["field"]:
- t = resolve_type(f)
- if t["@name"] == "bit":
- option = scream(f["@name"])
- if not options.has_key(option):
- options[option] = None
- out(" $option,\n")}
- BATCH,
- NONE
-}
diff --git a/M4-RCs/qpid/java/common/StructFactory.tpl b/M4-RCs/qpid/java/common/StructFactory.tpl
deleted file mode 100644
index 09c669f74e..0000000000
--- a/M4-RCs/qpid/java/common/StructFactory.tpl
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.apache.qpid.transport;
-/*
- *
- * 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 StructFactory {
-
- public static Struct create(int type)
- {
- switch (type)
- {
-${
-from genutil import *
-
-fragment = """ case $name.TYPE:
- return new $name();
-"""
-
-for c in composites:
- name = cname(c)
- if c.name == "struct":
- out(fragment)
-} default:
- throw new IllegalArgumentException("type: " + type);
- }
- }
-
- public static Struct createInstruction(int type)
- {
- switch (type)
- {
-${
-for c in composites:
- name = cname(c)
- if c.name in ("command", "control"):
- out(fragment)
-} default:
- throw new IllegalArgumentException("type: " + type);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/Type.tpl b/M4-RCs/qpid/java/common/Type.tpl
deleted file mode 100644
index 7f9cfee268..0000000000
--- a/M4-RCs/qpid/java/common/Type.tpl
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.apache.qpid.transport;
-/*
- *
- * 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 genutil import *}
-
-public enum Type
-{
-
-${
-types = spec.query["amqp/type"] + spec.query["amqp/class/type"]
-codes = {}
-first = True
-for t in types:
- code = t["@code"]
- fix_width = t["@fixed-width"]
- var_width = t["@variable-width"]
-
- if code is None:
- continue
-
- if fix_width is None:
- width = var_width
- fixed = "false"
- else:
- width = fix_width
- fixed = "true"
-
- name = scream(t["@name"])
- codes[code] = name
-
- if first:
- first = False
- else:
- out(",\n")
-
- out(" $name((byte) $code, $width, $fixed)")
-};
-
- public byte code;
- public int width;
- public boolean fixed;
-
- Type(byte code, int width, boolean fixed)
- {
- this.code = code;
- this.width = width;
- this.fixed = fixed;
- }
-
- public static Type get(byte code)
- {
- switch (code)
- {
-${
-keys = list(codes.keys())
-keys.sort()
-
-for code in keys:
- out(" case (byte) $code: return $(codes[code]);\n")
-}
- default: return null;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/bin/qpid-run b/M4-RCs/qpid/java/common/bin/qpid-run
deleted file mode 100755
index 0b5070d937..0000000000
--- a/M4-RCs/qpid/java/common/bin/qpid-run
+++ /dev/null
@@ -1,264 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-# Test if we're running on cygwin.
-cygwin=false
-if [[ "$(uname -a | fgrep Cygwin)" != "" ]]; then
- cygwin=true
-fi
-
-die() {
- if [[ $1 = -usage ]]; then
- shift
- usage=true
- else
- usage=false
- fi
- echo "$@"
- $usage && echo
- $usage && usage
- exit 1
-}
-
-OFF=0
-WARN=1
-INFO=2
-
-if [ -z "$QPID_RUN_LOG" ]; then
- QPID_RUN_LOG=$OFF
-fi
-
-log() {
- if [ "$1" -le "$QPID_RUN_LOG" ]; then
- shift
- echo "$@"
- fi
-}
-
-if [ -z $AMQJ_LOGGING_LEVEL ]; then
- export AMQJ_LOGGING_LEVEL=info
-fi
-
-#Set to help us get round the manifold problems of ps/pgrep on various
-#platforms which gather up to prevent qpid_stop from working .....
-if [ -z "$QPID_PNAME" ]; then
- export QPID_PNAME=" -DPNAME=QPBRKR"
-fi
-
-if [ -z "$QPID_HOME" ]; then
- export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
- export PATH=${PATH}:${QPID_HOME}/bin
-fi
-
-if [ -z "$QPID_WORK" ]; then
- log $INFO Setting QPID_WORK to $HOME as default
- QPID_WORK=$HOME
-fi
-
-if [ -z "$JAVA" ]; then
- JAVA=java
-fi
-
-if $cygwin; then
- QPID_HOME=$(cygpath -w $QPID_HOME)
- QPID_WORK=$(cygpath -w $QPID_WORK)
-fi
-
-#Set the default system properties that we'll use now that they have
-#all been initialised
-SYSTEM_PROPS="-Damqj.logging.level=$AMQJ_LOGGING_LEVEL -DQPID_HOME=$QPID_HOME -DQPID_WORK=$QPID_WORK"
-
-#If logprefix or logsuffix set to use PID make that happen
-#Otherwise just pass the value through for these props
-#Using X character to avoid probs with empty strings
-if [ -n "$QPID_LOG_PREFIX" ]; then
- if [ "X$QPID_LOG_PREFIX" = "XPID" ]; then
- log $INFO Using pid in qpid log name prefix
- LOG_PREFIX=" -Dlogprefix=$$"
- else
- log $INFO Using qpid logprefix property
- LOG_PREFIX=" -Dlogprefix=$QPID_LOG_PREFIX"
- fi
- SYSTEM_PROPS="${SYSTEM_PROPS} ${LOG_PREFIX}"
-fi
-
-if [ -n "$QPID_LOG_SUFFIX" ]; then
- if [ "X$QPID_LOG_SUFFIX" = "XPID" ]; then
- log $INFO Using pid in qpid log name suffix
- LOG_SUFFIX=" -Dlogsuffix=$$"
- else
- log $INFO Using qpig logsuffix property
- LOG_SUFFIX=" -Dlogsuffix=$QPID_LOG_SUFFIX"
- fi
- SYSTEM_PROPS="${SYSTEM_PROPS} ${LOG_SUFFIX}"
-fi
-
-log $INFO System Properties set to $SYSTEM_PROPS
-
-program=$(basename $0)
-sourced=${BASH_SOURCE[0]}
-if [[ -z ${sourced:-''} ]]; then
- sourced=$(which qpid-run) || ${QPID_HOME}/bin/qpid-run
-fi
-
-usage() {
- echo Usage: $program ... "[-run:<option>]" ...
- echo
- echo Options:
- egrep -B 1 "^\s*#USAGE: " ${sourced} |\
- sed "s/#USAGE:/ /" |\
- sed "s/-run:\(.*\))/-run:\1/" |\
- sed "s/-run:\(.*\)=\*/-run:\1=<value>/" |\
- sed "s/^--$//"
-}
-
-export EXTERNAL_CLASSPATH=$CLASSPATH
-unset CLASSPATH
-
-#Use QPID_CLASSPATH if set
-if [ -n "$QPID_CLASSPATH" ]; then
- export CLASSPATH=$QPID_CLASSPATH
- log $INFO "Using QPID_CLASSPATH" $QPID_CLASSPATH
-else
- log $WARN "Warning: Qpid classpath not set. CLASSPATH must include qpid jars."
-fi
-
-#Use QPID_JAVA_GC if set
-if [ -n "$QPID_JAVA_GC" ]; then
- export JAVA_GC=$QPID_JAVA_GC
- log $INFO "Using QPID_JAVA_GC setting" $QPID_JAVA_GC
-else
- log $INFO "Info: QPID_JAVA_GC not set. Defaulting to JAVA_GC" $JAVA_GC
-fi
-
-
-#Use QPID_JAVA_MEM if set
-if [ -n "$QPID_JAVA_MEM" ]; then
- export JAVA_MEM=$QPID_JAVA_MEM
- log $INFO "Using QPID_JAVA_MEM setting" $QPID_JAVA_MEM
-else
- log $INFO "Info: QPID_JAVA_MEM not set. Defaulting to JAVA_MEM" $JAVA_MEM
-fi
-
-declare -a RUN_ARGS JAVA_ARGS
-for arg in "$@"; do
- if [[ $arg == -run:* ]]; then
- RUN_ARGS[${#RUN_ARGS[@]}]="$arg"
- else
- JAVA_ARGS[${#JAVA_ARGS[@]}]="$arg"
- fi
-done
-
-# this defines the default behavior, it may be modified during option
-# processing below
-DISPATCH() {
- if $debug; then
- echo "CLASSPATH=${CLASSPATH}"
- echo "${COMMAND[@]}"
- fi
-
- exec "${COMMAND[@]}"
-}
-
-exclusive() {
- if [ -z "$PREVIOUS_ARGS" ]; then
- PREVIOUS_ARGS=$1
- else
- PREVIOUS_ARGS="${PREVIOUS_ARGS}, $1"
- DISPATCH() {
- die -usage "you must choose one of: $PREVIOUS_ARGS"
- }
- fi
-}
-
-debug=false
-
-for arg in "${RUN_ARGS[@]}"; do
- case $arg in
- -run:debug)
-#USAGE: print the classpath and command before running it
- debug=true
- ;;
- -run:jpda)
-#USAGE: adds debugging options to the java command, use
-#USAGE: JPDA_TRANSPORT and JPDA_ADDRESS to customize the debugging
-#USAGE: behavior and use JPDA_OPTS to override it entirely
- if [ -z "$JPDA_OPTS" ]; then
- JPDA_OPTS="-Xdebug -Xrunjdwp:transport=${JPDA_TRANSPORT:-dt_socket},address=${JPDA_ADDRESS:-8000},server=y,suspend=n"
- fi
- QPID_OPTS="${QPID_OPTS} ${JPDA_OPTS}"
- ;;
- -run:external-classpath=*)
-#USAGE: controls how the CLASSPATH environment variable is used by
-#USAGE: this script, value can be one of ignore (the default), first,
-#USAGE: last, and only
- case $arg in
- *=ignore)
- # do nothing
- ;;
- *=first)
- CLASSPATH=$EXTERNAL_CLASSPATH:$CLASSPATH
- ;;
- *=last)
- CLASSPATH=$CLASSPATH:$EXTERNAL_CLASSPATH
- ;;
- *=only)
- CLASSPATH=$EXTERNAL_CLASSPATH
- ;;
- *)
- die -usage $(echo $arg | sed "s/=/: invalid value '/")\'
- ;;
- esac
- ;;
- -run:print-classpath)
-#USAGE: print the classpath
- DISPATCH() {
- echo $CLASSPATH
- }
- exclusive $arg
- ;;
- -run:print-command)
-#USAGE: print the command
- DISPATCH() {
- echo "${COMMAND[@]}"
- }
- exclusive $arg
- ;;
- -run:help)
-#USAGE: print this message
- DISPATCH() {
- usage
- }
- exclusive $arg
- ;;
- *)
- die -usage "unrecognized -run option '$arg'"
- ;;
- esac
-done
-
-if $cygwin; then
- CLASSPATH=$(cygpath -w -p $CLASSPATH)
- JAVA=$(cygpath -u $JAVA)
-fi
-
-COMMAND=($JAVA $JAVA_VM $QPID_PNAME $JAVA_GC $JAVA_MEM $SYSTEM_PROPS $JAVA_OPTS $QPID_OPTS "${JAVA_ARGS[@]}")
-
-DISPATCH
diff --git a/M4-RCs/qpid/java/common/build.xml b/M4-RCs/qpid/java/common/build.xml
deleted file mode 100644
index dfe060cdef..0000000000
--- a/M4-RCs/qpid/java/common/build.xml
+++ /dev/null
@@ -1,104 +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.
- -
- -->
-<project name="AMQ Common" default="build">
-
- <import file="../module.xml"/>
-
- <property name="gentools.home" location="${project.root}/../gentools" />
- <property name="generated.package" value="org/apache/qpid/framing" />
- <property name="generated.dir" location="${module.precompiled}/${generated.package}" />
- <property name="xml.spec.dir" location="${project.root}/../specs" />
- <property name="xml.spec.deps" value="amqp.0-8.xml amqp.0-9.xml" />
- <property name="xml.spec.list" value="${xml.spec.dir}/amqp.0-8.xml ${xml.spec.dir}/amqp.0-9.xml" />
- <property name="gentools.timestamp" location="${generated.dir}/gentools.timestamp" />
- <property name="jython.timestamp" location="${generated.dir}/jython.timestamp" />
-
- <target name="check_jython_deps">
- <uptodate property="jython.notRequired" targetfile="${jython.timestamp}">
- <srcfiles dir="${xml.spec.dir}" includes="amqp.0-10-qpid-errata.xml" />
- </uptodate>
- </target>
-
- <target name="jython" depends="check_jython_deps" unless="jython.notRequired">
- <jython path="${mllib.dir}">
- <args>
- <arg value="${basedir}/codegen"/>
- <arg value="${module.precompiled}"/>
- <arg value="${xml.spec.dir}/amqp.0-10-qpid-errata.xml"/>
- <arg value="${basedir}"/>
- </args>
- </jython>
- <touch file="${jython.timestamp}" />
- </target>
-
- <target name="compile_gentools">
- <ant dir="${gentools.home}" />
- </target>
-
- <target name="check_gentool_deps">
- <uptodate property="gentools.notRequired" targetfile="${gentools.timestamp}">
- <srcfiles dir="${xml.spec.dir}" includes="${xml.spec.deps}" />
- </uptodate>
- </target>
-
- <target name="gentools" depends="compile_gentools,check_gentool_deps" unless="gentools.notRequired">
- <mkdir dir="${generated.dir}"/>
- <java classname="org.apache.qpid.gentools.Main" fork="true" dir="${gentools.home}/src" failonerror="true">
- <arg line="-j -o ${generated.dir} -t ${project.root}/common/templates ${xml.spec.list}"/>
- <classpath>
- <pathelement path="${gentools.home}/src" />
- <fileset dir="${gentools.home}/lib">
- <include name="**/*.jar"/>
- </fileset>
- <pathelement path="${gentools.home}/lib/velocity-1.4.jar" />
- <pathelement path="${gentools.home}/lib/velocity-dep-1.4.jar" />
- </classpath>
- </java>
- <touch file="${gentools.timestamp}" />
- </target>
-
- <property name="version.file" location="${module.classes}/qpidversion.properties"/>
- <property file="${version.file}" prefix="old."/>
-
- <target name="check-version">
- <exec executable="svnversion" spawn="false" failifexecutionfails="false"
- dir="${project.root}" outputproperty="qpid.svnversion">
- <arg line="."/>
- </exec>
- <condition property="version.stale">
- <not>
- <equals arg1="${qpid.svnversion}" arg2="${old.qpid.svnversion}"/>
- </not>
- </condition>
- </target>
-
- <target name="version" depends="check-version" if="version.stale">
- <!-- Write the version.properties out. -->
- <echo file="${version.file}" append="true">
- qpid.svnversion=${qpid.svnversion}
- qpid.name=${project.name}
- qpid.version=${project.version}
- </echo>
- </target>
-
- <target name="precompile" depends="gentools,jython,version"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/common/codegen b/M4-RCs/qpid/java/common/codegen
deleted file mode 100755
index 6a1effc07b..0000000000
--- a/M4-RCs/qpid/java/common/codegen
+++ /dev/null
@@ -1,89 +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, sys, mllib
-from templating import Parser
-from genutil import *
-
-out_dir = sys.argv[1]
-spec_file = sys.argv[2]
-tpl_dir = sys.argv[3]
-pkg_dir = os.path.join(out_dir, "org/apache/qpid/transport")
-
-if not os.path.exists(pkg_dir):
- os.makedirs(pkg_dir)
-
-spec = mllib.xml_parse(spec_file)
-
-def excludes(nd):
- if (nd.parent is not None and
- nd.parent.name == "class" and
- nd.parent["@name"] in ("file", "stream")):
- return False
- else:
- return True
-
-def execute(output, template, **kwargs):
- f = open(os.path.join(tpl_dir, template))
- input = f.read()
- f.close()
- p = Parser(**kwargs)
- p.parse(input)
- fname = os.path.join(pkg_dir, output)
- f = open(fname, "w")
- f.write(p.output)
- f.close()
-
-execute("Type.java", "Type.tpl", spec = spec)
-execute("Constant.java", "Constant.tpl", spec = spec)
-
-structs = spec.query["amqp/struct"] + \
- spec.query["amqp/class/struct", excludes] + \
- spec.query["amqp/class/command/result/struct", excludes]
-controls = spec.query["amqp/class/control", excludes]
-commands = spec.query["amqp/class/command", excludes]
-
-composites = structs + controls + commands
-actions = controls + commands
-connection = [c for c in actions if c.parent["@name"] == "connection"]
-session = [c for c in actions if c.parent["@name"] != "connection"]
-
-for c in composites:
- name = cname(c)
- execute("%s.java" % name, "Composite.tpl", type = c, name = name)
-
-execute("MethodDelegate.java", "MethodDelegate.tpl", composites = actions)
-execute("Option.java", "Option.tpl", composites = composites)
-execute("ConnectionInvoker.java", "Invoker.tpl", invoker = "ConnectionInvoker",
- composites = connection)
-execute("SessionInvoker.java", "Invoker.tpl", invoker = "SessionInvoker",
- composites = session)
-execute("StructFactory.java", "StructFactory.tpl", composites = composites)
-
-def is_enum(nd):
- return nd["enum"] is not None
-
-enums = spec.query["amqp/domain", is_enum] + \
- spec.query["amqp/class/domain", is_enum]
-
-for e in enums:
- name = cname(e)
- execute("%s.java" % name, "Enum.tpl", name = name, type = e)
diff --git a/M4-RCs/qpid/java/common/etc/qpid-run.conf b/M4-RCs/qpid/java/common/etc/qpid-run.conf
deleted file mode 100644
index b9765fe3ce..0000000000
--- a/M4-RCs/qpid/java/common/etc/qpid-run.conf
+++ /dev/null
@@ -1,25 +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.
-#
-
-QPID_LIBS=$(find ${QPID_HOME}/lib -name "*.jar" -print | sed -e :a -e '$!N;s/\n/:/;ta' -e 'P;D')
-
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM=-Xmx1024m \
- CLASSPATH=$QPID_LIBS
diff --git a/M4-RCs/qpid/java/common/etc/qpid-run.conf.dev b/M4-RCs/qpid/java/common/etc/qpid-run.conf.dev
deleted file mode 100644
index a5419eb4e8..0000000000
--- a/M4-RCs/qpid/java/common/etc/qpid-run.conf.dev
+++ /dev/null
@@ -1,26 +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.
-#
-
-QPID_LIBS=$(find ${QPID_HOME} -type d -name "classes" -print | sed -e :a -e '$!N;s/\n/:/;ta' -e 'P;D')
-QPID_LIBS=${QPID_LIBS}:$(find $(dirname ${QPID_HOME}) -name "*.jar" -print | sed -e :a -e '$!N;s/\n/:/;ta' -e 'P;D')
-
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM=-Xmx1024m \
- CLASSPATH=$QPID_LIBS
diff --git a/M4-RCs/qpid/java/common/genutil.py b/M4-RCs/qpid/java/common/genutil.py
deleted file mode 100644
index 5a75c2e48c..0000000000
--- a/M4-RCs/qpid/java/common/genutil.py
+++ /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.
-#
-
-def camel(offset, *args):
- parts = []
- for a in args:
- parts.extend(a.split("-"))
- return "".join(parts[:offset] + [p[0].upper() + p[1:] for p in parts[offset:]])
-
-def dromedary(s):
- return s[0].lower() + s[1:]
-
-def scream(*args):
- return "_".join([a.replace("-", "_").upper() for a in args])
-
-def num(x, default=None):
- if x is not None and x != "":
- return int(x, 0)
- else:
- return default
-
-def klass(nd):
- parent = nd.parent
- while parent is not None:
- if hasattr(parent, "name") and parent.name == "class":
- return parent
- parent = parent.parent
-
-untyped = -1
-
-def code(nd):
- global untyped
- cd = num(nd["@code"])
- if cd is None:
- cd = untyped
- untyped -= 1
- return cd
-
- cls = klass(nd)
- if cls:
- cd |= (num(cls["@code"]) << 8)
- return cd
-
-def root(nd):
- if nd.parent is None:
- return nd
- else:
- return root(nd.parent)
-
-def qname(nd):
- name = nd["@name"]
- cls = klass(nd)
- if cls != None:
- return "%s.%s" % (cls["@name"], name)
- else:
- return name
-
-RESOLVED = {}
-
-def resolve(node, name):
- key = (node, name)
- if RESOLVED.has_key(key):
- return RESOLVED[key]
- else:
- spec = root(node)
- cls = klass(node)
- if cls:
- for nd in cls.query["#tag"]:
- if nd["@name"] == name:
- RESOLVED[key] = nd
- return nd
- for nd in spec.query["amqp/#tag"] + spec.query["amqp/class/#tag"]:
- if name == qname(nd):
- RESOLVED[key] = nd
- return nd
- raise Exception("unresolved name: %s" % name)
-
-def resolve_type(nd):
- if hasattr(nd, "_resolved_type"):
- return nd._resolved_type
- else:
- name = nd["@type"]
- type = resolve(nd, name)
- if type.name == "domain" and not type["enum"]:
- type = resolve_type(type)
- nd._resolved_type = type
- return type
-
-TYPES = {
- "bit": "boolean",
- "uint8": "short",
- "uint16": "int",
- "uint32": "long",
- "uint64": "long",
- "datetime": "long",
- "uuid": "UUID",
- "sequence-no": "int",
- "sequence-set": "RangeSet", # XXX
- "byte-ranges": "RangeSet", # XXX
- "str8": "String",
- "str16": "String",
- "vbin8": "byte[]",
- "vbin16": "byte[]",
- "vbin32": "byte[]",
- "struct32": "Struct",
- "map": "Map<String,Object>",
- "array": "List<Object>"
- }
-
-def cname(nd, field="@name"):
- cls = klass(nd)
- if cls:
- if (nd.name in ("struct", "result") and
- cls["@name"] != "session" and
- nd[field] != "header"):
- return camel(0, nd[field])
- else:
- return camel(0, cls["@name"], nd[field])
- else:
- return camel(0, nd[field])
-
-def jtype(nd):
- if nd.name == "struct" or nd["enum"]:
- return cname(nd)
- else:
- return TYPES[nd["@name"]]
-
-REFS = {
- "boolean": "Boolean",
- "byte": "Byte",
- "short": "Short",
- "int": "Integer",
- "long": "Long",
- "float": "Float",
- "double": "Double",
- "char": "Character"
-}
-
-def jref(jt):
- return REFS.get(jt, jt)
-
-def jclass(jt):
- idx = jt.find('<')
- if idx > 0:
- return jt[:idx]
- else:
- return jt
-
-DEFAULTS = {
- "long": 0,
- "int": 0,
- "short": 0,
- "byte": 0,
- "char": 0,
- "boolean": "false"
- }
-
-class Field:
-
- def __init__(self, index, nd):
- self.index = index
- self.name = camel(1, nd["@name"])
- self.type_node = resolve_type(nd)
- if self.type_node.name == "domain":
- self.prim_type = resolve_type(self.type_node)
- else:
- self.prim_type = self.type_node
- self.variable_width = num(self.prim_type["@variable-width"], 0)
- self.fixed_width = num(self.prim_type["@fixed-width"], 0)
- self.empty = self.variable_width == 0 and self.fixed_width == 0 and self.prim_type.name != "struct"
- tname = cname(self.type_node)
- if self.type_node.name == "struct":
- self.read = "(%s) dec.readStruct(%s.TYPE)" % (tname, tname)
- self.write = "enc.writeStruct(%s.TYPE, check(struct).%s)" % (tname, self.name)
- self.coder = "Struct"
- elif self.type_node.name == "domain":
- self.coder = camel(0, self.prim_type["@name"])
- self.read = "%s.get(dec.read%s())" % (tname, self.coder)
- self.write = "enc.write%s(check(struct).%s.getValue())" % (self.coder, self.name)
- else:
- self.coder = camel(0, self.type_node["@name"])
- self.read = "dec.read%s()" % self.coder
- self.write = "enc.write%s(check(struct).%s)" % (self.coder, self.name)
- self.type = jtype(self.type_node)
- self.default = DEFAULTS.get(self.type, "null")
- self.has = camel(1, "has", self.name)
- self.get = camel(1, "get", self.name)
- self.set = camel(1, "set", self.name)
- self.clear = camel(1, "clear", self.name)
- if self.type == "boolean":
- self.option = scream(nd["@name"])
- else:
- self.option = None
-
- def flag_mask(self, pack):
- flag = pack * 8 - 8 - (self.index/8)*8 + (self.index % 8)
- return 1 << flag
-
-
-def get_fields(nd):
- fields = []
- index = 0
- for f in nd.query["field"]:
- fields.append(Field(index, f))
- index += 1
- return fields
-
-def get_parameters(type, fields):
- params = []
- options = False
- for f in fields:
- if f.option:
- options = True
- else:
- params.append("%s %s" % (f.type, f.name))
- if type["segments"]:
- params.append("Header header")
- params.append("ByteBuffer body")
- if options or type.name in ("control", "command"):
- params.append("Option ... _options")
- return params
-
-def get_arguments(type, fields):
- args = []
- options = False
- for f in fields:
- if f.option:
- options = True
- else:
- args.append(f.name)
- if type["segments"]:
- args.append("header")
- args.append("body")
- if options or type.name in ("control", "command"):
- args.append("_options")
- return args
-
-def get_options(fields):
- return [f for f in fields if f.option]
diff --git a/M4-RCs/qpid/java/common/protocol-version.xml b/M4-RCs/qpid/java/common/protocol-version.xml
deleted file mode 100644
index ee9db6049b..0000000000
--- a/M4-RCs/qpid/java/common/protocol-version.xml
+++ /dev/null
@@ -1,70 +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.
- -
- -->
-<project name="Qpid Common Protocol Versions" default="generate">
- <property name="topDirectoryLocation" location=".." />
- <property name="project.build.directory" location="target" />
- <property name="gentools.home" location="${topDirectoryLocation}/../gentools" />
- <property name="generated.path" location="${project.build.directory}/generated-sources/gentools" />
- <property name="generated.package" value="org/apache/qpid/framing" />
- <property name="generated.dir" location="${generated.path}/${generated.package}" />
- <property name="generated.timestamp" location="${generated.dir}/timestamp" />
- <property name="xml.spec.dir" location="${topDirectoryLocation}/../specs" />
- <property name="xml.spec.deps" value="amqp.0-8.xml amqp.0-9.xml" />
- <property name="xml.spec.list" value="${xml.spec.dir}/amqp.0-8.xml ${xml.spec.dir}/amqp.0-9.xml" />
- <property name="template.dir" value="${topDirectoryLocation}/common/templates" />
-
-
- <!--<target name="generate" depends="compile_generator,check_generate_deps" unless="generation.notRequired">-->
- <target name="generate" depends="compile_generator" unless="generation.notRequired">
- <mkdir dir="${generated.dir}"/>
- <java classname="org.apache.qpid.gentools.Main" fork="true" dir="${gentools.home}/src" failonerror="true">
- <arg line="-j -o ${generated.dir} -t ${template.dir} ${xml.spec.list}" />
- <classpath>
- <pathelement path="${gentools.home}/src" />
- <fileset dir="${gentools.home}/lib">
- <include name="**/*.jar"/>
- </fileset>
- <pathelement path="${gentools.home}/lib/velocity-1.4.jar" />
- <pathelement path="${gentools.home}/lib/velocity-dep-1.4.jar" />
- </classpath>
- </java>
- <touch file="${generated.timestamp}" />
- </target>
-
- <target name="check_generate_deps">
- <uptodate property="generation.notRequired" targetfile="${generated.timestamp}">
- <srcfiles dir="${xml.spec.dir}" includes="${xml.spec.deps}" />
- <srcfiles dir="${template.dir}" includes="**/*.vm **/*.tmpl" />
- </uptodate>
- </target>
-
- <target name="compile_generator">
- <ant dir="${gentools.home}" />
- </target>
-
- <target name="precompile" depends="generate"/>
-
- <target name="clean">
- <delete dir="${generated.path}" />
- </target>
-
-</project>
-
diff --git a/M4-RCs/qpid/java/common/readme.txt b/M4-RCs/qpid/java/common/readme.txt
deleted file mode 100644
index 12841fa08d..0000000000
--- a/M4-RCs/qpid/java/common/readme.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-AMQP Common Java API
-
-Common generated functionality for AMQP Java client and broker. See the
-readme in the client and broker directories.
diff --git a/M4-RCs/qpid/java/common/src/main/java/common.bnd b/M4-RCs/qpid/java/common/src/main/java/common.bnd
deleted file mode 100755
index a534451390..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/common.bnd
+++ /dev/null
@@ -1,6 +0,0 @@
-ver: M4
-
-Bundle-SymbolicName: qpid_common
-Bundle-Version: ${ver}
-Export-Package: *;version=${ver}
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/M4-RCs/qpid/java/common/src/main/java/log4j.properties b/M4-RCs/qpid/java/common/src/main/java/log4j.properties
deleted file mode 100644
index 44f89dc805..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/log4j.properties
+++ /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.
-#
-log4j.rootLogger=${root.logging.level}
-
-
-log4j.logger.qpid.protocol=${amqj.protocol.logging.level}, console
-log4j.additivity.qpid.protocol=false
-log4j.logger.org.apache.qpid=${amqj.logging.level}, console
-log4j.additivity.org.apache.qpid=false
-
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=all
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/FixedSizeByteBufferAllocator.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/FixedSizeByteBufferAllocator.java
deleted file mode 100644
index 0c311b6645..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/FixedSizeByteBufferAllocator.java
+++ /dev/null
@@ -1,467 +0,0 @@
-package org.apache.mina.common;
-
-import org.apache.mina.common.ByteBuffer;
-
-import java.nio.*;
-
-/*
-*
-* 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.
-*
-*/
-public class FixedSizeByteBufferAllocator implements ByteBufferAllocator
-{
-
-
- private static final int MINIMUM_CAPACITY = 1;
-
- public FixedSizeByteBufferAllocator ()
- {
- }
-
- public ByteBuffer allocate( int capacity, boolean direct )
- {
- java.nio.ByteBuffer nioBuffer;
- if( direct )
- {
- nioBuffer = java.nio.ByteBuffer.allocateDirect( capacity );
- }
- else
- {
- nioBuffer = java.nio.ByteBuffer.allocate( capacity );
- }
- return new FixedSizeByteBuffer( nioBuffer );
- }
-
- public ByteBuffer wrap( java.nio.ByteBuffer nioBuffer )
- {
- return new FixedSizeByteBuffer( nioBuffer );
- }
-
- public void dispose()
- {
- }
-
-
-
- private static final class FixedSizeByteBuffer extends ByteBuffer
- {
- private java.nio.ByteBuffer buf;
- private int mark = -1;
-
-
- protected FixedSizeByteBuffer( java.nio.ByteBuffer buf )
- {
- this.buf = buf;
- buf.order( ByteOrder.BIG_ENDIAN );
- }
-
- public synchronized void acquire()
- {
- }
-
- public void release()
- {
- }
-
- public java.nio.ByteBuffer buf()
- {
- return buf;
- }
-
- public boolean isPooled()
- {
- return false;
- }
-
- public void setPooled( boolean pooled )
- {
- }
-
- public ByteBuffer duplicate() {
- return new FixedSizeByteBuffer( this.buf.duplicate() );
- }
-
- public ByteBuffer slice() {
- return new FixedSizeByteBuffer( this.buf.slice() );
- }
-
- public ByteBuffer asReadOnlyBuffer() {
- return new FixedSizeByteBuffer( this.buf.asReadOnlyBuffer() );
- }
-
- public byte[] array()
- {
- return buf.array();
- }
-
- public int arrayOffset()
- {
- return buf.arrayOffset();
- }
-
- public boolean isDirect()
- {
- return buf.isDirect();
- }
-
- public boolean isReadOnly()
- {
- return buf.isReadOnly();
- }
-
- public int capacity()
- {
- return buf.capacity();
- }
-
- public ByteBuffer capacity( int newCapacity )
- {
- if( newCapacity > capacity() )
- {
- throw new IllegalArgumentException();
- }
-
- return this;
- }
-
-
-
- public boolean isAutoExpand()
- {
- return false;
- }
-
- public ByteBuffer setAutoExpand( boolean autoExpand )
- {
- if(autoExpand) throw new IllegalArgumentException();
- else return this;
- }
-
- public ByteBuffer expand( int pos, int expectedRemaining )
- {
- int end = pos + expectedRemaining;
- if( end > capacity() )
- {
- // The buffer needs expansion.
- capacity( end );
- }
-
- if( end > limit() )
- {
- // We call limit() directly to prevent StackOverflowError
- buf.limit( end );
- }
- return this;
- }
-
- public int position()
- {
- return buf.position();
- }
-
- public ByteBuffer position( int newPosition )
- {
-
- buf.position( newPosition );
- if( mark > newPosition )
- {
- mark = -1;
- }
- return this;
- }
-
- public int limit()
- {
- return buf.limit();
- }
-
- public ByteBuffer limit( int newLimit )
- {
- buf.limit( newLimit );
- if( mark > newLimit )
- {
- mark = -1;
- }
- return this;
- }
-
- public ByteBuffer mark()
- {
- buf.mark();
- mark = position();
- return this;
- }
-
- public int markValue()
- {
- return mark;
- }
-
- public ByteBuffer reset()
- {
- buf.reset();
- return this;
- }
-
- public ByteBuffer clear()
- {
- buf.clear();
- mark = -1;
- return this;
- }
-
- public ByteBuffer flip()
- {
- buf.flip();
- mark = -1;
- return this;
- }
-
- public ByteBuffer rewind()
- {
- buf.rewind();
- mark = -1;
- return this;
- }
-
- public byte get()
- {
- return buf.get();
- }
-
- public ByteBuffer put( byte b )
- {
- buf.put( b );
- return this;
- }
-
- public byte get( int index )
- {
- return buf.get( index );
- }
-
- public ByteBuffer put( int index, byte b )
- {
- buf.put( index, b );
- return this;
- }
-
- public ByteBuffer get( byte[] dst, int offset, int length )
- {
- buf.get( dst, offset, length );
- return this;
- }
-
- public ByteBuffer put( java.nio.ByteBuffer src )
- {
- buf.put( src );
- return this;
- }
-
- public ByteBuffer put( byte[] src, int offset, int length )
- {
- buf.put( src, offset, length );
- return this;
- }
-
- public ByteBuffer compact()
- {
- buf.compact();
- mark = -1;
- return this;
- }
-
- public ByteOrder order()
- {
- return buf.order();
- }
-
- public ByteBuffer order( ByteOrder bo )
- {
- buf.order( bo );
- return this;
- }
-
- public char getChar()
- {
- return buf.getChar();
- }
-
- public ByteBuffer putChar( char value )
- {
- buf.putChar( value );
- return this;
- }
-
- public char getChar( int index )
- {
- return buf.getChar( index );
- }
-
- public ByteBuffer putChar( int index, char value )
- {
- buf.putChar( index, value );
- return this;
- }
-
- public CharBuffer asCharBuffer()
- {
- return buf.asCharBuffer();
- }
-
- public short getShort()
- {
- return buf.getShort();
- }
-
- public ByteBuffer putShort( short value )
- {
- buf.putShort( value );
- return this;
- }
-
- public short getShort( int index )
- {
- return buf.getShort( index );
- }
-
- public ByteBuffer putShort( int index, short value )
- {
- buf.putShort( index, value );
- return this;
- }
-
- public ShortBuffer asShortBuffer()
- {
- return buf.asShortBuffer();
- }
-
- public int getInt()
- {
- return buf.getInt();
- }
-
- public ByteBuffer putInt( int value )
- {
- buf.putInt( value );
- return this;
- }
-
- public int getInt( int index )
- {
- return buf.getInt( index );
- }
-
- public ByteBuffer putInt( int index, int value )
- {
- buf.putInt( index, value );
- return this;
- }
-
- public IntBuffer asIntBuffer()
- {
- return buf.asIntBuffer();
- }
-
- public long getLong()
- {
- return buf.getLong();
- }
-
- public ByteBuffer putLong( long value )
- {
- buf.putLong( value );
- return this;
- }
-
- public long getLong( int index )
- {
- return buf.getLong( index );
- }
-
- public ByteBuffer putLong( int index, long value )
- {
- buf.putLong( index, value );
- return this;
- }
-
- public LongBuffer asLongBuffer()
- {
- return buf.asLongBuffer();
- }
-
- public float getFloat()
- {
- return buf.getFloat();
- }
-
- public ByteBuffer putFloat( float value )
- {
- buf.putFloat( value );
- return this;
- }
-
- public float getFloat( int index )
- {
- return buf.getFloat( index );
- }
-
- public ByteBuffer putFloat( int index, float value )
- {
- buf.putFloat( index, value );
- return this;
- }
-
- public FloatBuffer asFloatBuffer()
- {
- return buf.asFloatBuffer();
- }
-
- public double getDouble()
- {
- return buf.getDouble();
- }
-
- public ByteBuffer putDouble( double value )
- {
- buf.putDouble( value );
- return this;
- }
-
- public double getDouble( int index )
- {
- return buf.getDouble( index );
- }
-
- public ByteBuffer putDouble( int index, double value )
- {
- buf.putDouble( index, value );
- return this;
- }
-
- public DoubleBuffer asDoubleBuffer()
- {
- return buf.asDoubleBuffer();
- }
-
-
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/support/DefaultIoFuture.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/support/DefaultIoFuture.java
deleted file mode 100644
index 4fd28c4eb5..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/support/DefaultIoFuture.java
+++ /dev/null
@@ -1,227 +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.
- *
- */
-package org.apache.mina.common.support;
-
-import org.apache.mina.common.IoFuture;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoFutureListener;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/**
- * A default implementation of {@link org.apache.mina.common.IoFuture}.
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- */
-public class DefaultIoFuture implements IoFuture
-{
- private final IoSession session;
- private final Object lock;
- private List listeners;
- private Object result;
- private boolean ready;
-
-
- /**
- * Creates a new instance.
- *
- * @param session an {@link IoSession} which is associated with this future
- */
- public DefaultIoFuture( IoSession session )
- {
- this.session = session;
- this.lock = this;
- }
-
- /**
- * Creates a new instance which uses the specified object as a lock.
- */
- public DefaultIoFuture( IoSession session, Object lock )
- {
- if( lock == null )
- {
- throw new NullPointerException( "lock" );
- }
- this.session = session;
- this.lock = lock;
- }
-
- public IoSession getSession()
- {
- return session;
- }
-
- public Object getLock()
- {
- return lock;
- }
-
- public void join()
- {
- synchronized( lock )
- {
- while( !ready )
- {
- try
- {
- lock.wait();
- }
- catch( InterruptedException e )
- {
- }
- }
- }
- }
-
- public boolean join( long timeoutInMillis )
- {
- long startTime = ( timeoutInMillis <= 0 ) ? 0 : System
- .currentTimeMillis();
- long waitTime = timeoutInMillis;
-
- synchronized( lock )
- {
- if( ready )
- {
- return ready;
- }
- else if( waitTime <= 0 )
- {
- return ready;
- }
-
- for( ;; )
- {
- try
- {
- lock.wait( waitTime );
- }
- catch( InterruptedException e )
- {
- }
-
- if( ready )
- return true;
- else
- {
- waitTime = timeoutInMillis - ( System.currentTimeMillis() - startTime );
- if( waitTime <= 0 )
- {
- return ready;
- }
- }
- }
- }
- }
-
- public boolean isReady()
- {
- synchronized( lock )
- {
- return ready;
- }
- }
-
- /**
- * Sets the result of the asynchronous operation, and mark it as finished.
- */
- protected void setValue( Object newValue )
- {
- synchronized( lock )
- {
- // Allow only once.
- if( ready )
- {
- return;
- }
-
- result = newValue;
- ready = true;
- lock.notifyAll();
-
- notifyListeners();
- }
- }
-
- /**
- * Returns the result of the asynchronous operation.
- */
- protected Object getValue()
- {
- synchronized( lock )
- {
- return result;
- }
- }
-
- public void addListener( IoFutureListener listener )
- {
- if( listener == null )
- {
- throw new NullPointerException( "listener" );
- }
-
- synchronized( lock )
- {
- if(listeners == null)
- {
- listeners = new ArrayList();
- }
- listeners.add( listener );
- if( ready )
- {
- listener.operationComplete( this );
- }
- }
- }
-
- public void removeListener( IoFutureListener listener )
- {
- if( listener == null )
- {
- throw new NullPointerException( "listener" );
- }
-
- synchronized( lock )
- {
- listeners.remove( listener );
- }
- }
-
- private void notifyListeners()
- {
- synchronized( lock )
- {
-
- if(listeners != null)
- {
-
- for( Iterator i = listeners.iterator(); i.hasNext(); ) {
- ( ( IoFutureListener ) i.next() ).operationComplete( this );
- }
- }
- }
- }
-}
-
-
-
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/support/IoServiceListenerSupport.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/support/IoServiceListenerSupport.java
deleted file mode 100644
index 5723ffbaa9..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/common/support/IoServiceListenerSupport.java
+++ /dev/null
@@ -1,351 +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.
- *
- */
-package org.apache.mina.common.support;
-
-import java.net.SocketAddress;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.CountDownLatch;
-
-import org.apache.mina.common.IoAcceptorConfig;
-import org.apache.mina.common.IoConnector;
-import org.apache.mina.common.IoFuture;
-import org.apache.mina.common.IoFutureListener;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoService;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.IoServiceListener;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.util.IdentityHashSet;
-
-/**
- * A helper which provides addition and removal of {@link IoServiceListener}s and firing
- * events.
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- * @version $Rev: 446526 $, $Date: 2006-09-15 01:44:11 -0400 (Fri, 15 Sep 2006) $
- */
-public class IoServiceListenerSupport
-{
- /**
- * A list of {@link IoServiceListener}s.
- */
- private final List listeners = new ArrayList();
-
- /**
- * Tracks managed <tt>serviceAddress</tt>es.
- */
- private final Set managedServiceAddresses = new HashSet();
-
- /**
- * Tracks managed sesssions with <tt>serviceAddress</tt> as a key.
- */
- private final Map managedSessions = new HashMap();
-
- /**
- * Creates a new instance.
- */
- public IoServiceListenerSupport()
- {
- }
-
- /**
- * Adds a new listener.
- */
- public void add( IoServiceListener listener )
- {
- synchronized( listeners )
- {
- listeners.add( listener );
- }
- }
-
- /**
- * Removes an existing listener.
- */
- public void remove( IoServiceListener listener )
- {
- synchronized( listeners )
- {
- listeners.remove( listener );
- }
- }
-
- public Set getManagedServiceAddresses()
- {
- return Collections.unmodifiableSet( managedServiceAddresses );
- }
-
- public boolean isManaged( SocketAddress serviceAddress )
- {
- synchronized( managedServiceAddresses )
- {
- return managedServiceAddresses.contains( serviceAddress );
- }
- }
-
- public Set getManagedSessions( SocketAddress serviceAddress )
- {
- Set sessions;
- synchronized( managedSessions )
- {
- sessions = ( Set ) managedSessions.get( serviceAddress );
- if( sessions == null )
- {
- sessions = new IdentityHashSet();
- }
- }
-
- synchronized( sessions )
- {
- return new IdentityHashSet( sessions );
- }
- }
-
- /**
- * Calls {@link IoServiceListener#serviceActivated(IoService, SocketAddress, IoHandler, IoServiceConfig)}
- * for all registered listeners.
- */
- public void fireServiceActivated(
- IoService service, SocketAddress serviceAddress,
- IoHandler handler, IoServiceConfig config )
- {
- synchronized( managedServiceAddresses )
- {
- if( !managedServiceAddresses.add( serviceAddress ) )
- {
- return;
- }
- }
-
- synchronized( listeners )
- {
- for( Iterator i = listeners.iterator(); i.hasNext(); )
- {
- ( ( IoServiceListener ) i.next() ).serviceActivated(
- service, serviceAddress, handler, config );
- }
- }
- }
-
- /**
- * Calls {@link IoServiceListener#serviceDeactivated(IoService, SocketAddress, IoHandler, IoServiceConfig)}
- * for all registered listeners.
- */
- public synchronized void fireServiceDeactivated(
- IoService service, SocketAddress serviceAddress,
- IoHandler handler, IoServiceConfig config )
- {
- synchronized( managedServiceAddresses )
- {
- if( !managedServiceAddresses.remove( serviceAddress ) )
- {
- return;
- }
- }
-
- try
- {
- synchronized( listeners )
- {
- for( Iterator i = listeners.iterator(); i.hasNext(); )
- {
- ( ( IoServiceListener ) i.next() ).serviceDeactivated(
- service, serviceAddress, handler, config );
- }
- }
- }
- finally
- {
- disconnectSessions( serviceAddress, config );
- }
- }
-
-
- /**
- * Calls {@link IoServiceListener#sessionCreated(IoSession)} for all registered listeners.
- */
- public void fireSessionCreated( IoSession session )
- {
- SocketAddress serviceAddress = session.getServiceAddress();
-
- // Get the session set.
- boolean firstSession = false;
- Set sessions;
- synchronized( managedSessions )
- {
- sessions = ( Set ) managedSessions.get( serviceAddress );
- if( sessions == null )
- {
- sessions = new IdentityHashSet();
- managedSessions.put( serviceAddress, sessions );
- firstSession = true;
- }
- }
-
- // If already registered, ignore.
- synchronized( sessions )
- {
- if ( !sessions.add( session ) )
- {
- return;
- }
- }
-
- // If the first connector session, fire a virtual service activation event.
- if( session.getService() instanceof IoConnector && firstSession )
- {
- fireServiceActivated(
- session.getService(), session.getServiceAddress(),
- session.getHandler(), session.getServiceConfig() );
- }
-
- // Fire session events.
- session.getFilterChain().fireSessionCreated( session );
- session.getFilterChain().fireSessionOpened( session);
-
- // Fire listener events.
- synchronized( listeners )
- {
- for( Iterator i = listeners.iterator(); i.hasNext(); )
- {
- ( ( IoServiceListener ) i.next() ).sessionCreated( session );
- }
- }
- }
-
- /**
- * Calls {@link IoServiceListener#sessionDestroyed(IoSession)} for all registered listeners.
- */
- public void fireSessionDestroyed( IoSession session )
- {
- SocketAddress serviceAddress = session.getServiceAddress();
-
- // Get the session set.
- Set sessions;
- boolean lastSession = false;
- synchronized( managedSessions )
- {
- sessions = ( Set ) managedSessions.get( serviceAddress );
- // Ignore if unknown.
- if( sessions == null )
- {
- return;
- }
-
- // Try to remove the remaining empty seession set after removal.
- synchronized( sessions )
- {
- sessions.remove( session );
- if( sessions.isEmpty() )
- {
- managedSessions.remove( serviceAddress );
- lastSession = true;
- }
- }
- }
-
- // Fire session events.
- session.getFilterChain().fireSessionClosed( session );
-
- // Fire listener events.
- try
- {
- synchronized( listeners )
- {
- for( Iterator i = listeners.iterator(); i.hasNext(); )
- {
- ( ( IoServiceListener ) i.next() ).sessionDestroyed( session );
- }
- }
- }
- finally
- {
- // Fire a virtual service deactivation event for the last session of the connector.
- //TODO double-check that this is *STILL* the last session. May not be the case
- if( session.getService() instanceof IoConnector && lastSession )
- {
- fireServiceDeactivated(
- session.getService(), session.getServiceAddress(),
- session.getHandler(), session.getServiceConfig() );
- }
- }
- }
-
- private void disconnectSessions( SocketAddress serviceAddress, IoServiceConfig config )
- {
- if( !( config instanceof IoAcceptorConfig ) )
- {
- return;
- }
-
- if( !( ( IoAcceptorConfig ) config ).isDisconnectOnUnbind() )
- {
- return;
- }
-
- Set sessions;
- synchronized( managedSessions )
- {
- sessions = ( Set ) managedSessions.get( serviceAddress );
- }
-
- if( sessions == null )
- {
- return;
- }
-
- Set sessionsCopy;
-
- // Create a copy to avoid ConcurrentModificationException
- synchronized( sessions )
- {
- sessionsCopy = new IdentityHashSet( sessions );
- }
-
- final CountDownLatch latch = new CountDownLatch(sessionsCopy.size());
-
- for( Iterator i = sessionsCopy.iterator(); i.hasNext(); )
- {
- ( ( IoSession ) i.next() ).close().addListener( new IoFutureListener()
- {
- public void operationComplete( IoFuture future )
- {
- latch.countDown();
- }
- } );
- }
-
- try
- {
- latch.await();
- }
- catch( InterruptedException ie )
- {
- // Ignored
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/WriteBufferFullExeception.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/WriteBufferFullExeception.java
deleted file mode 100644
index 47f19aa76d..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/WriteBufferFullExeception.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.apache.mina.filter;
-
-import org.apache.mina.common.IoFilter;/*
- *
- * 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.
- *
- */
-
-public class WriteBufferFullExeception extends RuntimeException
-{
- private IoFilter.WriteRequest _writeRequest;
-
- public WriteBufferFullExeception()
- {
- this(null);
- }
-
- public WriteBufferFullExeception(IoFilter.WriteRequest writeRequest)
- {
- _writeRequest = writeRequest;
- }
-
-
- public void setWriteRequest(IoFilter.WriteRequest writeRequest)
- {
- _writeRequest = writeRequest;
- }
-
- public IoFilter.WriteRequest getWriteRequest()
- {
- return _writeRequest;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/WriteBufferLimitFilterBuilder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/WriteBufferLimitFilterBuilder.java
deleted file mode 100644
index 4e9db9071a..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/WriteBufferLimitFilterBuilder.java
+++ /dev/null
@@ -1,272 +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.
- *
- */
-package org.apache.mina.filter;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.DefaultIoFilterChainBuilder;
-import org.apache.mina.common.IoFilterAdapter;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.filter.executor.ExecutorFilter;
-
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * This filter will turn the asynchronous filterWrite method in to a blocking send when there are more than
- * the prescribed number of messages awaiting filterWrite. It should be used in conjunction with the
- * {@link ReadThrottleFilterBuilder} on a server as the blocking writes will allow the read thread to
- * cause an Out of Memory exception due to a back log of unprocessed messages.
- *
- * This is should only be viewed as a temporary work around for DIRMINA-302.
- *
- * A true solution should not be implemented as a filter as this issue will always occur. On a machine
- * where the network is slower than the local producer.
- *
- * Suggested improvement is to allow implementation of policices on what to do when buffer is full.
- *
- * They could be:
- * Block - As this does
- * Wait on a given Future - to drain more of the queue.. in essence this filter with high/low watermarks
- * Throw Exception - through the client filterWrite() method to allow them to get immediate feedback on buffer state
- *
- * <p/>
- * <p>Usage:
- * <p/>
- * <pre><code>
- * DefaultFilterChainBuilder builder = ...
- * WriteBufferLimitFilterBuilder filter = new WriteBufferLimitFilterBuilder();
- * filter.attach( builder );
- * </code></pre>
- * <p/>
- * or
- * <p/>
- * <pre><code>
- * IoFilterChain chain = ...
- * WriteBufferLimitFilterBuilder filter = new WriteBufferLimitFilterBuilder();
- * filter.attach( chain );
- * </code></pre>
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- * @version $Rev: 619823 $, $Date: 2008-02-08 10:09:37 +0000 (Fri, 08 Feb 2008) $
- */
-public class WriteBufferLimitFilterBuilder
-{
- public static final String PENDING_SIZE = WriteBufferLimitFilterBuilder.class.getName() + ".pendingSize";
-
- private static int DEFAULT_CONNECTION_BUFFER_MESSAGE_COUNT = 5000;
-
- private volatile boolean throwNotBlock = false;
-
- private volatile int maximumConnectionBufferCount;
- private volatile long maximumConnectionBufferSize;
-
- private final Object _blockLock = new Object();
-
- private int _blockWaiters = 0;
-
-
- public WriteBufferLimitFilterBuilder()
- {
- this(DEFAULT_CONNECTION_BUFFER_MESSAGE_COUNT);
- }
-
- public WriteBufferLimitFilterBuilder(int maxWriteBufferSize)
- {
- setMaximumConnectionBufferCount(maxWriteBufferSize);
- }
-
-
- /**
- * Set the maximum amount pending items in the writeQueue for a given session.
- * Changing the value will only take effect when new data is received for a
- * connection, including existing connections. Default value is 5000 msgs.
- *
- * @param maximumConnectionBufferCount New buffer size. Must be > 0
- */
- public void setMaximumConnectionBufferCount(int maximumConnectionBufferCount)
- {
- this.maximumConnectionBufferCount = maximumConnectionBufferCount;
- this.maximumConnectionBufferSize = 0;
- }
-
- public void setMaximumConnectionBufferSize(long maximumConnectionBufferSize)
- {
- this.maximumConnectionBufferSize = maximumConnectionBufferSize;
- this.maximumConnectionBufferCount = 0;
- }
-
- /**
- * Attach this filter to the specified filter chain. It will search for the ThreadPoolFilter, and attach itself
- * before and after that filter.
- *
- * @param chain {@link IoFilterChain} to attach self to.
- */
- public void attach(IoFilterChain chain)
- {
- String name = getThreadPoolFilterEntryName(chain.getAll());
-
- chain.addBefore(name, getClass().getName() + ".sendlimit", new SendLimit());
- }
-
- /**
- * Attach this filter to the specified builder. It will search for the
- * {@link ExecutorFilter}, and attach itself before and after that filter.
- *
- * @param builder {@link DefaultIoFilterChainBuilder} to attach self to.
- */
- public void attach(DefaultIoFilterChainBuilder builder)
- {
- String name = getThreadPoolFilterEntryName(builder.getAll());
-
- builder.addBefore(name, getClass().getName() + ".sendlimit", new SendLimit());
- }
-
- private String getThreadPoolFilterEntryName(List entries)
- {
- Iterator i = entries.iterator();
-
- while (i.hasNext())
- {
- IoFilterChain.Entry entry = (IoFilterChain.Entry) i.next();
-
- if (entry.getFilter().getClass().isAssignableFrom(ExecutorFilter.class))
- {
- return entry.getName();
- }
- }
-
- throw new IllegalStateException("Chain does not contain a ExecutorFilter");
- }
-
-
- public class SendLimit extends IoFilterAdapter
- {
- public void filterWrite(NextFilter nextFilter, IoSession session, WriteRequest writeRequest) throws Exception
- {
- try
- {
- waitTillSendAllowed(session);
- }
- catch (WriteBufferFullExeception wbfe)
- {
- nextFilter.exceptionCaught(session, wbfe);
- }
-
- if (writeRequest.getMessage() instanceof ByteBuffer)
- {
- increasePendingWriteSize(session, (ByteBuffer) writeRequest.getMessage());
- }
-
- nextFilter.filterWrite(session, writeRequest);
- }
-
- private void increasePendingWriteSize(IoSession session, ByteBuffer message)
- {
- synchronized (session)
- {
- Long pendingSize = getScheduledWriteBytes(session) + message.remaining();
- session.setAttribute(PENDING_SIZE, pendingSize);
- }
- }
-
- private boolean sendAllowed(IoSession session)
- {
- if (session.isClosing())
- {
- return true;
- }
-
- int lmswm = maximumConnectionBufferCount;
- long lmswb = maximumConnectionBufferSize;
-
- return (lmswm == 0 || session.getScheduledWriteRequests() < lmswm)
- && (lmswb == 0 || getScheduledWriteBytes(session) < lmswb);
- }
-
- private long getScheduledWriteBytes(IoSession session)
- {
- synchronized (session)
- {
- Long i = (Long) session.getAttribute(PENDING_SIZE);
- return null == i ? 0 : i;
- }
- }
-
- private void waitTillSendAllowed(IoSession session)
- {
- synchronized (_blockLock)
- {
- if (throwNotBlock)
- {
- throw new WriteBufferFullExeception();
- }
-
- _blockWaiters++;
-
- while (!sendAllowed(session))
- {
- try
- {
- _blockLock.wait();
- }
- catch (InterruptedException e)
- {
- // Ignore.
- }
- }
- _blockWaiters--;
- }
- }
-
- public void messageSent(NextFilter nextFilter, IoSession session, Object message) throws Exception
- {
- if (message instanceof ByteBuffer)
- {
- decrementPendingWriteSize(session, (ByteBuffer) message);
- }
- notifyWaitingWriters();
- nextFilter.messageSent(session, message);
- }
-
- private void decrementPendingWriteSize(IoSession session, ByteBuffer message)
- {
- synchronized (session)
- {
- session.setAttribute(PENDING_SIZE, getScheduledWriteBytes(session) - message.remaining());
- }
- }
-
- private void notifyWaitingWriters()
- {
- synchronized (_blockLock)
- {
- if (_blockWaiters != 0)
- {
- _blockLock.notifyAll();
- }
- }
-
- }
-
- }//SentLimit
-
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/codec/OurCumulativeProtocolDecoder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/codec/OurCumulativeProtocolDecoder.java
deleted file mode 100644
index 3f7e206cb4..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/codec/OurCumulativeProtocolDecoder.java
+++ /dev/null
@@ -1,197 +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.
- *
- */
-package org.apache.mina.filter.codec;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
-
-/**
- * A {@link ProtocolDecoder} that cumulates the content of received
- * buffers to a <em>cumulative buffer</em> to help users implement decoders.
- * <p>
- * If the received {@link ByteBuffer} is only a part of a message.
- * decoders should cumulate received buffers to make a message complete or
- * to postpone decoding until more buffers arrive.
- * <p>
- * Here is an example decoder that decodes CRLF terminated lines into
- * <code>Command</code> objects:
- * <pre>
- * public class CRLFTerminatedCommandLineDecoder
- * extends CumulativeProtocolDecoder {
- *
- * private Command parseCommand(ByteBuffer in) {
- * // Convert the bytes in the specified buffer to a
- * // Command object.
- * ...
- * }
- *
- * protected boolean doDecode(IoSession session, ByteBuffer in,
- * ProtocolDecoderOutput out)
- * throws Exception {
- *
- * // Remember the initial position.
- * int start = in.position();
- *
- * // Now find the first CRLF in the buffer.
- * byte previous = 0;
- * while (in.hasRemaining()) {
- * byte current = in.get();
- *
- * if (previous == '\r' && current == '\n') {
- * // Remember the current position and limit.
- * int position = in.position();
- * int limit = in.limit();
- * try {
- * in.position(start);
- * in.limit(position);
- * // The bytes between in.position() and in.limit()
- * // now contain a full CRLF terminated line.
- * out.write(parseCommand(in.slice()));
- * } finally {
- * // Set the position to point right after the
- * // detected line and set the limit to the old
- * // one.
- * in.position(position);
- * in.limit(limit);
- * }
- * // Decoded one line; CumulativeProtocolDecoder will
- * // call me again until I return false. So just
- * // return true until there are no more lines in the
- * // buffer.
- * return true;
- * }
- *
- * previous = current;
- * }
- *
- * // Could not find CRLF in the buffer. Reset the initial
- * // position to the one we recorded above.
- * in.position(start);
- *
- * return false;
- * }
- * }
- * </pre>
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- * @version $Rev: 619823 $, $Date: 2008-02-08 10:09:37 +0000 (Fri, 08 Feb 2008) $
- */
-public abstract class OurCumulativeProtocolDecoder extends ProtocolDecoderAdapter {
-
- private static final String BUFFER = OurCumulativeProtocolDecoder.class
- .getName()
- + ".Buffer";
-
- /**
- * Creates a new instance.
- */
- protected OurCumulativeProtocolDecoder() {
- }
-
- /**
- * Cumulates content of <tt>in</tt> into internal buffer and forwards
- * decoding request to {@link #doDecode(IoSession, ByteBuffer, ProtocolDecoderOutput)}.
- * <tt>doDecode()</tt> is invoked repeatedly until it returns <tt>false</tt>
- * and the cumulative buffer is NOT compacted after decoding ends.
- *
- * @throws IllegalStateException if your <tt>doDecode()</tt> returned
- * <tt>true</tt> not consuming the cumulative buffer.
- */
- public void decode(IoSession session, ByteBuffer in,
- ProtocolDecoderOutput out) throws Exception {
- boolean usingSessionBuffer = true;
- ByteBuffer buf = (ByteBuffer) session.getAttribute(BUFFER);
- // If we have a session buffer, append data to that; otherwise
- // use the buffer read from the network directly.
- if (buf != null) {
- buf.put(in);
- buf.flip();
- } else {
- buf = in;
- usingSessionBuffer = false;
- }
-
- for (;;) {
- int oldPos = buf.position();
- boolean decoded = doDecode(session, buf, out);
- if (decoded) {
- if (buf.position() == oldPos) {
- throw new IllegalStateException(
- "doDecode() can't return true when buffer is not consumed.");
- }
-
- if (!buf.hasRemaining()) {
- break;
- }
- } else {
- break;
- }
- }
-
-
- // if there is any data left that cannot be decoded, we store
- // it in a buffer in the session and next time this decoder is
- // invoked the session buffer gets appended to
- if (buf.hasRemaining()) {
- storeRemainingInSession(buf, session);
- } else {
- if (usingSessionBuffer)
- removeSessionBuffer(session);
- }
- }
-
- /**
- * Implement this method to consume the specified cumulative buffer and
- * decode its content into message(s).
- *
- * @param in the cumulative buffer
- * @return <tt>true</tt> if and only if there's more to decode in the buffer
- * and you want to have <tt>doDecode</tt> method invoked again.
- * Return <tt>false</tt> if remaining data is not enough to decode,
- * then this method will be invoked again when more data is cumulated.
- * @throws Exception if cannot decode <tt>in</tt>.
- */
- protected abstract boolean doDecode(IoSession session, ByteBuffer in,
- ProtocolDecoderOutput out) throws Exception;
-
- /**
- * Releases the cumulative buffer used by the specified <tt>session</tt>.
- * Please don't forget to call <tt>super.dispose( session )</tt> when
- * you override this method.
- */
- public void dispose(IoSession session) throws Exception {
- removeSessionBuffer(session);
- }
-
- private void removeSessionBuffer(IoSession session) {
- ByteBuffer buf = (ByteBuffer) session.removeAttribute(BUFFER);
- if (buf != null) {
- buf.release();
- }
- }
-
- private void storeRemainingInSession(ByteBuffer buf, IoSession session) {
- ByteBuffer remainingBuf = ByteBuffer.allocate(buf.capacity());
- remainingBuf.setAutoExpand(true);
- remainingBuf.order(buf.order());
- remainingBuf.put(buf);
- session.setAttribute(BUFFER, remainingBuf);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/codec/QpidProtocolCodecFilter.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/codec/QpidProtocolCodecFilter.java
deleted file mode 100644
index b8c6f29720..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/filter/codec/QpidProtocolCodecFilter.java
+++ /dev/null
@@ -1,440 +0,0 @@
-package org.apache.mina.filter.codec;
-
-
-/*
-*
-* 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 org.apache.mina.common.*;
-import org.apache.mina.common.support.DefaultWriteFuture;
-import org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput;
-import org.apache.mina.util.SessionLog;
-import org.apache.mina.util.Queue;
-
-
-public class QpidProtocolCodecFilter extends IoFilterAdapter
-{
- public static final String ENCODER = QpidProtocolCodecFilter.class.getName() + ".encoder";
- public static final String DECODER = QpidProtocolCodecFilter.class.getName() + ".decoder";
-
- private static final Class[] EMPTY_PARAMS = new Class[0];
- private static final ByteBuffer EMPTY_BUFFER = ByteBuffer.wrap( new byte[0] );
-
- private final ProtocolCodecFactory factory;
-
- public QpidProtocolCodecFilter( ProtocolCodecFactory factory )
- {
- if( factory == null )
- {
- throw new NullPointerException( "factory" );
- }
- this.factory = factory;
- }
-
- public QpidProtocolCodecFilter( final ProtocolEncoder encoder, final ProtocolDecoder decoder )
- {
- if( encoder == null )
- {
- throw new NullPointerException( "encoder" );
- }
- if( decoder == null )
- {
- throw new NullPointerException( "decoder" );
- }
-
- this.factory = new ProtocolCodecFactory()
- {
- public ProtocolEncoder getEncoder()
- {
- return encoder;
- }
-
- public ProtocolDecoder getDecoder()
- {
- return decoder;
- }
- };
- }
-
- public QpidProtocolCodecFilter( final Class encoderClass, final Class decoderClass )
- {
- if( encoderClass == null )
- {
- throw new NullPointerException( "encoderClass" );
- }
- if( decoderClass == null )
- {
- throw new NullPointerException( "decoderClass" );
- }
- if( !ProtocolEncoder.class.isAssignableFrom( encoderClass ) )
- {
- throw new IllegalArgumentException( "encoderClass: " + encoderClass.getName() );
- }
- if( !ProtocolDecoder.class.isAssignableFrom( decoderClass ) )
- {
- throw new IllegalArgumentException( "decoderClass: " + decoderClass.getName() );
- }
- try
- {
- encoderClass.getConstructor( EMPTY_PARAMS );
- }
- catch( NoSuchMethodException e )
- {
- throw new IllegalArgumentException( "encoderClass doesn't have a public default constructor." );
- }
- try
- {
- decoderClass.getConstructor( EMPTY_PARAMS );
- }
- catch( NoSuchMethodException e )
- {
- throw new IllegalArgumentException( "decoderClass doesn't have a public default constructor." );
- }
-
- this.factory = new ProtocolCodecFactory()
- {
- public ProtocolEncoder getEncoder() throws Exception
- {
- return ( ProtocolEncoder ) encoderClass.newInstance();
- }
-
- public ProtocolDecoder getDecoder() throws Exception
- {
- return ( ProtocolDecoder ) decoderClass.newInstance();
- }
- };
- }
-
- public void onPreAdd( IoFilterChain parent, String name, IoFilter.NextFilter nextFilter ) throws Exception
- {
- if( parent.contains( ProtocolCodecFilter.class ) )
- {
- throw new IllegalStateException( "A filter chain cannot contain more than one QpidProtocolCodecFilter." );
- }
- }
-
- public void messageReceived( IoFilter.NextFilter nextFilter, IoSession session, Object message ) throws Exception
- {
- if( !( message instanceof ByteBuffer ) )
- {
- nextFilter.messageReceived( session, message );
- return;
- }
-
- ByteBuffer in = ( ByteBuffer ) message;
- ProtocolDecoder decoder = getDecoder( session );
- ProtocolDecoderOutput decoderOut = getDecoderOut( session, nextFilter );
-
- try
- {
- decoder.decode( session, in, decoderOut );
- }
- catch( Throwable t )
- {
- ProtocolDecoderException pde;
- if( t instanceof ProtocolDecoderException )
- {
- pde = ( ProtocolDecoderException ) t;
- }
- else
- {
- pde = new ProtocolDecoderException( t );
- }
- pde.setHexdump( in.getHexDump() );
- throw pde;
- }
- finally
- {
- // Dispose the decoder if this session is connectionless.
- if( session.getTransportType().isConnectionless() )
- {
- disposeDecoder( session );
- }
-
- // Release the read buffer.
- in.release();
-
- decoderOut.flush();
- }
- }
-
- public void messageSent( IoFilter.NextFilter nextFilter, IoSession session, Object message ) throws Exception
- {
- if( message instanceof HiddenByteBuffer )
- {
- return;
- }
-
- if( !( message instanceof MessageByteBuffer ) )
- {
- nextFilter.messageSent( session, message );
- return;
- }
-
- nextFilter.messageSent( session, ( ( MessageByteBuffer ) message ).message );
- }
-
- public void filterWrite( IoFilter.NextFilter nextFilter, IoSession session, IoFilter.WriteRequest writeRequest ) throws Exception
- {
- Object message = writeRequest.getMessage();
- if( message instanceof ByteBuffer )
- {
- nextFilter.filterWrite( session, writeRequest );
- return;
- }
-
- ProtocolEncoder encoder = getEncoder( session );
- ProtocolEncoderOutputImpl encoderOut = getEncoderOut( session, nextFilter, writeRequest );
-
- try
- {
- encoder.encode( session, message, encoderOut );
- encoderOut.flush();
- nextFilter.filterWrite(
- session,
- new IoFilter.WriteRequest(
- new MessageByteBuffer( writeRequest.getMessage() ),
- writeRequest.getFuture(), writeRequest.getDestination() ) );
- }
- catch( Throwable t )
- {
- ProtocolEncoderException pee;
- if( t instanceof ProtocolEncoderException )
- {
- pee = ( ProtocolEncoderException ) t;
- }
- else
- {
- pee = new ProtocolEncoderException( t );
- }
- throw pee;
- }
- finally
- {
- // Dispose the encoder if this session is connectionless.
- if( session.getTransportType().isConnectionless() )
- {
- disposeEncoder( session );
- }
- }
- }
-
- public void sessionClosed( IoFilter.NextFilter nextFilter, IoSession session ) throws Exception
- {
- // Call finishDecode() first when a connection is closed.
- ProtocolDecoder decoder = getDecoder( session );
- ProtocolDecoderOutput decoderOut = getDecoderOut( session, nextFilter );
- try
- {
- decoder.finishDecode( session, decoderOut );
- }
- catch( Throwable t )
- {
- ProtocolDecoderException pde;
- if( t instanceof ProtocolDecoderException )
- {
- pde = ( ProtocolDecoderException ) t;
- }
- else
- {
- pde = new ProtocolDecoderException( t );
- }
- throw pde;
- }
- finally
- {
- // Dispose all.
- disposeEncoder( session );
- disposeDecoder( session );
-
- decoderOut.flush();
- }
-
- nextFilter.sessionClosed( session );
- }
-
- private ProtocolEncoder getEncoder( IoSession session ) throws Exception
- {
- ProtocolEncoder encoder = ( ProtocolEncoder ) session.getAttribute( ENCODER );
- if( encoder == null )
- {
- encoder = factory.getEncoder();
- session.setAttribute( ENCODER, encoder );
- }
- return encoder;
- }
-
- private ProtocolEncoderOutputImpl getEncoderOut( IoSession session, IoFilter.NextFilter nextFilter, IoFilter.WriteRequest writeRequest )
- {
- return new ProtocolEncoderOutputImpl( session, nextFilter, writeRequest );
- }
-
- private ProtocolDecoder getDecoder( IoSession session ) throws Exception
- {
- ProtocolDecoder decoder = ( ProtocolDecoder ) session.getAttribute( DECODER );
- if( decoder == null )
- {
- decoder = factory.getDecoder();
- session.setAttribute( DECODER, decoder );
- }
- return decoder;
- }
-
- private ProtocolDecoderOutput getDecoderOut( IoSession session, IoFilter.NextFilter nextFilter )
- {
- return new SimpleProtocolDecoderOutput( session, nextFilter );
- }
-
- private void disposeEncoder( IoSession session )
- {
- ProtocolEncoder encoder = ( ProtocolEncoder ) session.removeAttribute( ENCODER );
- if( encoder == null )
- {
- return;
- }
-
- try
- {
- encoder.dispose( session );
- }
- catch( Throwable t )
- {
- SessionLog.warn(
- session,
- "Failed to dispose: " + encoder.getClass().getName() +
- " (" + encoder + ')' );
- }
- }
-
- private void disposeDecoder( IoSession session )
- {
- ProtocolDecoder decoder = ( ProtocolDecoder ) session.removeAttribute( DECODER );
- if( decoder == null )
- {
- return;
- }
-
- try
- {
- decoder.dispose( session );
- }
- catch( Throwable t )
- {
- SessionLog.warn(
- session,
- "Falied to dispose: " + decoder.getClass().getName() +
- " (" + decoder + ')' );
- }
- }
-
- private static class HiddenByteBuffer extends ByteBufferProxy
- {
- private HiddenByteBuffer( ByteBuffer buf )
- {
- super( buf );
- }
- }
-
- private static class MessageByteBuffer extends ByteBufferProxy
- {
- private final Object message;
-
- private MessageByteBuffer( Object message )
- {
- super( EMPTY_BUFFER );
- this.message = message;
- }
-
- public void acquire()
- {
- // no-op since we are wraping a zero-byte buffer, this instance is to just curry the message
- }
-
- public void release()
- {
- // no-op since we are wraping a zero-byte buffer, this instance is to just curry the message
- }
- }
-
- private static class ProtocolEncoderOutputImpl implements ProtocolEncoderOutput
- {
- private ByteBuffer buffer;
-
- private final IoSession session;
- private final IoFilter.NextFilter nextFilter;
- private final IoFilter.WriteRequest writeRequest;
-
- public ProtocolEncoderOutputImpl( IoSession session, IoFilter.NextFilter nextFilter, IoFilter.WriteRequest writeRequest )
- {
- this.session = session;
- this.nextFilter = nextFilter;
- this.writeRequest = writeRequest;
- }
-
-
-
- public void write( ByteBuffer buf )
- {
- if(buffer != null)
- {
- flush();
- }
- buffer = buf;
- }
-
- public void mergeAll()
- {
- }
-
- public WriteFuture flush()
- {
- WriteFuture future = null;
- if( buffer == null )
- {
- return null;
- }
- else
- {
- ByteBuffer buf = buffer;
- // Flush only when the buffer has remaining.
- if( buf.hasRemaining() )
- {
- future = doFlush( buf );
- }
-
- }
-
- return future;
- }
-
-
- protected WriteFuture doFlush( ByteBuffer buf )
- {
- WriteFuture future = new DefaultWriteFuture( session );
- nextFilter.filterWrite(
- session,
- new IoFilter.WriteRequest(
- buf,
- future, writeRequest.getDestination() ) );
- return future;
- }
- }
-}
-
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketAcceptor.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketAcceptor.java
deleted file mode 100644
index e5360d32e0..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketAcceptor.java
+++ /dev/null
@@ -1,547 +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.
- *
- */
-package org.apache.mina.transport.socket.nio;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.ServerSocketChannel;
-import java.nio.channels.SocketChannel;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.mina.common.ExceptionMonitor;
-import org.apache.mina.common.IoAcceptor;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.support.BaseIoAcceptor;
-import org.apache.mina.util.Queue;
-import org.apache.mina.util.NewThreadExecutor;
-import org.apache.mina.util.NamePreservingRunnable;
-import edu.emory.mathcs.backport.java.util.concurrent.Executor;
-
-/**
- * {@link IoAcceptor} for socket transport (TCP/IP).
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- * @version $Rev: 619823 $, $Date: 2008-02-08 10:09:37 +0000 (Fri, 08 Feb 2008) $
- */
-public class MultiThreadSocketAcceptor extends SocketAcceptor
-{
- /**
- * @noinspection StaticNonFinalField
- */
- private static volatile int nextId = 0;
-
- private final Executor executor;
- private final Object lock = new Object();
- private final int id = nextId ++;
- private final String threadName = "SocketAcceptor-" + id;
- private final Map channels = new HashMap();
-
- private final Queue registerQueue = new Queue();
- private final Queue cancelQueue = new Queue();
-
- private final MultiThreadSocketIoProcessor[] ioProcessors;
- private final int processorCount;
-
- /**
- * @noinspection FieldAccessedSynchronizedAndUnsynchronized
- */
- private Selector selector;
- private Worker worker;
- private int processorDistributor = 0;
-
- /**
- * Create an acceptor with a single processing thread using a NewThreadExecutor
- */
- public MultiThreadSocketAcceptor()
- {
- this( 1, new NewThreadExecutor() );
- }
-
- /**
- * Create an acceptor with the desired number of processing threads
- *
- * @param processorCount Number of processing threads
- * @param executor Executor to use for launching threads
- */
- public MultiThreadSocketAcceptor( int processorCount, Executor executor )
- {
- if( processorCount < 1 )
- {
- throw new IllegalArgumentException( "Must have at least one processor" );
- }
-
- this.executor = executor;
- this.processorCount = processorCount;
- ioProcessors = new MultiThreadSocketIoProcessor[processorCount];
-
- for( int i = 0; i < processorCount; i++ )
- {
- ioProcessors[i] = new MultiThreadSocketIoProcessor( "SocketAcceptorIoProcessor-" + id + "." + i, executor );
- }
- }
-
-
- /**
- * Binds to the specified <code>address</code> and handles incoming connections with the specified
- * <code>handler</code>. Backlog value is configured to the value of <code>backlog</code> property.
- *
- * @throws IOException if failed to bind
- */
- public void bind( SocketAddress address, IoHandler handler, IoServiceConfig config ) throws IOException
- {
- if( handler == null )
- {
- throw new NullPointerException( "handler" );
- }
-
- if( address != null && !( address instanceof InetSocketAddress ) )
- {
- throw new IllegalArgumentException( "Unexpected address type: " + address.getClass() );
- }
-
- if( config == null )
- {
- config = getDefaultConfig();
- }
-
- RegistrationRequest request = new RegistrationRequest( address, handler, config );
-
- synchronized( registerQueue )
- {
- registerQueue.push( request );
- }
-
- startupWorker();
-
- selector.wakeup();
-
- synchronized( request )
- {
- while( !request.done )
- {
- try
- {
- request.wait();
- }
- catch( InterruptedException e )
- {
- ExceptionMonitor.getInstance().exceptionCaught( e );
- }
- }
- }
-
- if( request.exception != null )
- {
- throw request.exception;
- }
- }
-
-
- private synchronized void startupWorker() throws IOException
- {
- synchronized( lock )
- {
- if( worker == null )
- {
- selector = Selector.open();
- worker = new Worker();
-
- executor.execute( new NamePreservingRunnable( worker ) );
- }
- }
- }
-
- public void unbind( SocketAddress address )
- {
- if( address == null )
- {
- throw new NullPointerException( "address" );
- }
-
- CancellationRequest request = new CancellationRequest( address );
-
- try
- {
- startupWorker();
- }
- catch( IOException e )
- {
- // IOException is thrown only when Worker thread is not
- // running and failed to open a selector. We simply throw
- // IllegalArgumentException here because we can simply
- // conclude that nothing is bound to the selector.
- throw new IllegalArgumentException( "Address not bound: " + address );
- }
-
- synchronized( cancelQueue )
- {
- cancelQueue.push( request );
- }
-
- selector.wakeup();
-
- synchronized( request )
- {
- while( !request.done )
- {
- try
- {
- request.wait();
- }
- catch( InterruptedException e )
- {
- ExceptionMonitor.getInstance().exceptionCaught( e );
- }
- }
- }
-
- if( request.exception != null )
- {
- request.exception.fillInStackTrace();
-
- throw request.exception;
- }
- }
-
-
- private class Worker implements Runnable
- {
- public void run()
- {
- Thread.currentThread().setName(MultiThreadSocketAcceptor.this.threadName );
-
- for( ; ; )
- {
- try
- {
- int nKeys = selector.select();
-
- registerNew();
-
- if( nKeys > 0 )
- {
- processSessions( selector.selectedKeys() );
- }
-
- cancelKeys();
-
- if( selector.keys().isEmpty() )
- {
- synchronized( lock )
- {
- if( selector.keys().isEmpty() &&
- registerQueue.isEmpty() &&
- cancelQueue.isEmpty() )
- {
- worker = null;
- try
- {
- selector.close();
- }
- catch( IOException e )
- {
- ExceptionMonitor.getInstance().exceptionCaught( e );
- }
- finally
- {
- selector = null;
- }
- break;
- }
- }
- }
- }
- catch( IOException e )
- {
- ExceptionMonitor.getInstance().exceptionCaught( e );
-
- try
- {
- Thread.sleep( 1000 );
- }
- catch( InterruptedException e1 )
- {
- ExceptionMonitor.getInstance().exceptionCaught( e1 );
- }
- }
- }
- }
-
- private void processSessions( Set keys ) throws IOException
- {
- Iterator it = keys.iterator();
- while( it.hasNext() )
- {
- SelectionKey key = ( SelectionKey ) it.next();
-
- it.remove();
-
- if( !key.isAcceptable() )
- {
- continue;
- }
-
- ServerSocketChannel ssc = ( ServerSocketChannel ) key.channel();
-
- SocketChannel ch = ssc.accept();
-
- if( ch == null )
- {
- continue;
- }
-
- boolean success = false;
- try
- {
-
- RegistrationRequest req = ( RegistrationRequest ) key.attachment();
-
- MultiThreadSocketSessionImpl session = new MultiThreadSocketSessionImpl(
- MultiThreadSocketAcceptor.this, nextProcessor(), getListeners(),
- req.config, ch, req.handler, req.address );
-
- // New Interface
-// SocketSessionImpl session = new SocketSessionImpl(
-// SocketAcceptor.this, nextProcessor(), getListeners(),
-// req.config, ch, req.handler, req.address );
-
-
- getFilterChainBuilder().buildFilterChain( session.getFilterChain() );
- req.config.getFilterChainBuilder().buildFilterChain( session.getFilterChain() );
- req.config.getThreadModel().buildFilterChain( session.getFilterChain() );
- session.getIoProcessor().addNew( session );
- success = true;
- }
- catch( Throwable t )
- {
- ExceptionMonitor.getInstance().exceptionCaught( t );
- }
- finally
- {
- if( !success )
- {
- ch.close();
- }
- }
- }
- }
- }
-
- private MultiThreadSocketIoProcessor nextProcessor()
- {
- return ioProcessors[processorDistributor++ % processorCount];
- }
-
-
- private void registerNew()
- {
- if( registerQueue.isEmpty() )
- {
- return;
- }
-
- for( ; ; )
- {
- RegistrationRequest req;
-
- synchronized( registerQueue )
- {
- req = ( RegistrationRequest ) registerQueue.pop();
- }
-
- if( req == null )
- {
- break;
- }
-
- ServerSocketChannel ssc = null;
-
- try
- {
- ssc = ServerSocketChannel.open();
- ssc.configureBlocking( false );
-
- // Configure the server socket,
- SocketAcceptorConfig cfg;
- if( req.config instanceof SocketAcceptorConfig )
- {
- cfg = ( SocketAcceptorConfig ) req.config;
- }
- else
- {
- cfg = ( SocketAcceptorConfig ) getDefaultConfig();
- }
-
- ssc.socket().setReuseAddress( cfg.isReuseAddress() );
- ssc.socket().setReceiveBufferSize(
- ( ( SocketSessionConfig ) cfg.getSessionConfig() ).getReceiveBufferSize() );
-
- // and bind.
- ssc.socket().bind( req.address, cfg.getBacklog() );
- if( req.address == null || req.address.getPort() == 0 )
- {
- req.address = ( InetSocketAddress ) ssc.socket().getLocalSocketAddress();
- }
- ssc.register( selector, SelectionKey.OP_ACCEPT, req );
-
- synchronized( channels )
- {
- channels.put( req.address, ssc );
- }
-
- getListeners().fireServiceActivated(
- this, req.address, req.handler, req.config );
- }
- catch( IOException e )
- {
- req.exception = e;
- }
- finally
- {
- synchronized( req )
- {
- req.done = true;
-
- req.notifyAll();
- }
-
- if( ssc != null && req.exception != null )
- {
- try
- {
- ssc.close();
- }
- catch( IOException e )
- {
- ExceptionMonitor.getInstance().exceptionCaught( e );
- }
- }
- }
- }
- }
-
-
- private void cancelKeys()
- {
- if( cancelQueue.isEmpty() )
- {
- return;
- }
-
- for( ; ; )
- {
- CancellationRequest request;
-
- synchronized( cancelQueue )
- {
- request = ( CancellationRequest ) cancelQueue.pop();
- }
-
- if( request == null )
- {
- break;
- }
-
- ServerSocketChannel ssc;
- synchronized( channels )
- {
- ssc = ( ServerSocketChannel ) channels.remove( request.address );
- }
-
- // close the channel
- try
- {
- if( ssc == null )
- {
- request.exception = new IllegalArgumentException( "Address not bound: " + request.address );
- }
- else
- {
- SelectionKey key = ssc.keyFor( selector );
- request.registrationRequest = ( RegistrationRequest ) key.attachment();
- key.cancel();
-
- selector.wakeup(); // wake up again to trigger thread death
-
- ssc.close();
- }
- }
- catch( IOException e )
- {
- ExceptionMonitor.getInstance().exceptionCaught( e );
- }
- finally
- {
- synchronized( request )
- {
- request.done = true;
- request.notifyAll();
- }
-
- if( request.exception == null )
- {
- getListeners().fireServiceDeactivated(
- this, request.address,
- request.registrationRequest.handler,
- request.registrationRequest.config );
- }
- }
- }
- }
-
- private static class RegistrationRequest
- {
- private InetSocketAddress address;
- private final IoHandler handler;
- private final IoServiceConfig config;
- private IOException exception;
- private boolean done;
-
- private RegistrationRequest( SocketAddress address, IoHandler handler, IoServiceConfig config )
- {
- this.address = ( InetSocketAddress ) address;
- this.handler = handler;
- this.config = config;
- }
- }
-
-
- private static class CancellationRequest
- {
- private final SocketAddress address;
- private boolean done;
- private RegistrationRequest registrationRequest;
- private RuntimeException exception;
-
- private CancellationRequest( SocketAddress address )
- {
- this.address = address;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketConnector.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketConnector.java
deleted file mode 100644
index b1612840db..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketConnector.java
+++ /dev/null
@@ -1,486 +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.
- *
- */
-package org.apache.mina.transport.socket.nio;
-
-import edu.emory.mathcs.backport.java.util.concurrent.Executor;
-import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.ExceptionMonitor;
-import org.apache.mina.common.IoConnector;
-import org.apache.mina.common.IoConnectorConfig;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.support.AbstractIoFilterChain;
-import org.apache.mina.common.support.DefaultConnectFuture;
-import org.apache.mina.util.NamePreservingRunnable;
-import org.apache.mina.util.NewThreadExecutor;
-import org.apache.mina.util.Queue;
-
-import java.io.IOException;
-import java.net.ConnectException;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.SocketChannel;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * {@link IoConnector} for socket transport (TCP/IP).
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- * @version $Rev: 619823 $, $Date: 2008-02-08 10:09:37 +0000 (Fri, 08 Feb 2008) $
- */
-public class MultiThreadSocketConnector extends SocketConnector
-{
- /** @noinspection StaticNonFinalField */
- private static volatile int nextId = 0;
-
- private final Object lock = new Object();
- private final int id = nextId++;
- private final String threadName = "SocketConnector-" + id;
- private SocketConnectorConfig defaultConfig = new SocketConnectorConfig();
- private final Queue connectQueue = new Queue();
- private final MultiThreadSocketIoProcessor[] ioProcessors;
- private final int processorCount;
- private final Executor executor;
-
- /** @noinspection FieldAccessedSynchronizedAndUnsynchronized */
- private Selector selector;
- private Worker worker;
- private int processorDistributor = 0;
- private int workerTimeout = 60; // 1 min.
-
- /** Create a connector with a single processing thread using a NewThreadExecutor */
- public MultiThreadSocketConnector()
- {
- this(1, new NewThreadExecutor());
- }
-
- /**
- * Create a connector with the desired number of processing threads
- *
- * @param processorCount Number of processing threads
- * @param executor Executor to use for launching threads
- */
- public MultiThreadSocketConnector(int processorCount, Executor executor)
- {
- if (processorCount < 1)
- {
- throw new IllegalArgumentException("Must have at least one processor");
- }
-
- this.executor = executor;
- this.processorCount = processorCount;
- ioProcessors = new MultiThreadSocketIoProcessor[processorCount];
-
- for (int i = 0; i < processorCount; i++)
- {
- ioProcessors[i] = new MultiThreadSocketIoProcessor("SocketConnectorIoProcessor-" + id + "." + i, executor);
- }
- }
-
- /**
- * How many seconds to keep the connection thread alive between connection requests
- *
- * @return Number of seconds to keep connection thread alive
- */
- public int getWorkerTimeout()
- {
- return workerTimeout;
- }
-
- /**
- * Set how many seconds the connection worker thread should remain alive once idle before terminating itself.
- *
- * @param workerTimeout Number of seconds to keep thread alive. Must be >=0
- */
- public void setWorkerTimeout(int workerTimeout)
- {
- if (workerTimeout < 0)
- {
- throw new IllegalArgumentException("Must be >= 0");
- }
- this.workerTimeout = workerTimeout;
- }
-
- public ConnectFuture connect(SocketAddress address, IoHandler handler, IoServiceConfig config)
- {
- return connect(address, null, handler, config);
- }
-
- public ConnectFuture connect(SocketAddress address, SocketAddress localAddress,
- IoHandler handler, IoServiceConfig config)
- {
- if (address == null)
- {
- throw new NullPointerException("address");
- }
- if (handler == null)
- {
- throw new NullPointerException("handler");
- }
-
- if (!(address instanceof InetSocketAddress))
- {
- throw new IllegalArgumentException("Unexpected address type: "
- + address.getClass());
- }
-
- if (localAddress != null && !(localAddress instanceof InetSocketAddress))
- {
- throw new IllegalArgumentException("Unexpected local address type: "
- + localAddress.getClass());
- }
-
- if (config == null)
- {
- config = getDefaultConfig();
- }
-
- SocketChannel ch = null;
- boolean success = false;
- try
- {
- ch = SocketChannel.open();
- ch.socket().setReuseAddress(true);
- if (localAddress != null)
- {
- ch.socket().bind(localAddress);
- }
-
- ch.configureBlocking(false);
-
- if (ch.connect(address))
- {
- DefaultConnectFuture future = new DefaultConnectFuture();
- newSession(ch, handler, config, future);
- success = true;
- return future;
- }
-
- success = true;
- }
- catch (IOException e)
- {
- return DefaultConnectFuture.newFailedFuture(e);
- }
- finally
- {
- if (!success && ch != null)
- {
- try
- {
- ch.close();
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
- }
- }
- }
-
- ConnectionRequest request = new ConnectionRequest(ch, handler, config);
- synchronized (lock)
- {
- try
- {
- startupWorker();
- }
- catch (IOException e)
- {
- try
- {
- ch.close();
- }
- catch (IOException e2)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e2);
- }
-
- return DefaultConnectFuture.newFailedFuture(e);
- }
- }
-
- synchronized (connectQueue)
- {
- connectQueue.push(request);
- }
- selector.wakeup();
-
- return request;
- }
-
- private synchronized void startupWorker() throws IOException
- {
- if (worker == null)
- {
- selector = Selector.open();
- worker = new Worker();
- executor.execute(new NamePreservingRunnable(worker));
- }
- }
-
- private void registerNew()
- {
- if (connectQueue.isEmpty())
- {
- return;
- }
-
- for (; ;)
- {
- ConnectionRequest req;
- synchronized (connectQueue)
- {
- req = (ConnectionRequest) connectQueue.pop();
- }
-
- if (req == null)
- {
- break;
- }
-
- SocketChannel ch = req.channel;
- try
- {
- ch.register(selector, SelectionKey.OP_CONNECT, req);
- }
- catch (IOException e)
- {
- req.setException(e);
- }
- }
- }
-
- private void processSessions(Set keys)
- {
- Iterator it = keys.iterator();
-
- while (it.hasNext())
- {
- SelectionKey key = (SelectionKey) it.next();
-
- if (!key.isConnectable())
- {
- continue;
- }
-
- SocketChannel ch = (SocketChannel) key.channel();
- ConnectionRequest entry = (ConnectionRequest) key.attachment();
-
- boolean success = false;
- try
- {
- ch.finishConnect();
- newSession(ch, entry.handler, entry.config, entry);
- success = true;
- }
- catch (Throwable e)
- {
- entry.setException(e);
- }
- finally
- {
- key.cancel();
- if (!success)
- {
- try
- {
- ch.close();
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
- }
- }
- }
- }
-
- keys.clear();
- }
-
- private void processTimedOutSessions(Set keys)
- {
- long currentTime = System.currentTimeMillis();
- Iterator it = keys.iterator();
-
- while (it.hasNext())
- {
- SelectionKey key = (SelectionKey) it.next();
-
- if (!key.isValid())
- {
- continue;
- }
-
- ConnectionRequest entry = (ConnectionRequest) key.attachment();
-
- if (currentTime >= entry.deadline)
- {
- entry.setException(new ConnectException());
- try
- {
- key.channel().close();
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
- }
- finally
- {
- key.cancel();
- }
- }
- }
- }
-
- private void newSession(SocketChannel ch, IoHandler handler, IoServiceConfig config, ConnectFuture connectFuture)
- throws IOException
- {
- MultiThreadSocketSessionImpl session =
- new MultiThreadSocketSessionImpl(this, nextProcessor(), getListeners(),
- config, ch, handler, ch.socket().getRemoteSocketAddress());
-
- //new interface
-// SocketSessionImpl session = new SocketSessionImpl(
-// this, nextProcessor(), getListeners(),
-// config, ch, handler, ch.socket().getRemoteSocketAddress() );
- try
- {
- getFilterChainBuilder().buildFilterChain(session.getFilterChain());
- config.getFilterChainBuilder().buildFilterChain(session.getFilterChain());
- config.getThreadModel().buildFilterChain(session.getFilterChain());
- }
- catch (Throwable e)
- {
- throw (IOException) new IOException("Failed to create a session.").initCause(e);
- }
-
- // Set the ConnectFuture of the specified session, which will be
- // removed and notified by AbstractIoFilterChain eventually.
- session.setAttribute( AbstractIoFilterChain.CONNECT_FUTURE, connectFuture );
-
- // Forward the remaining process to the SocketIoProcessor.
- session.getIoProcessor().addNew(session);
- }
-
- private MultiThreadSocketIoProcessor nextProcessor()
- {
- return ioProcessors[processorDistributor++ % processorCount];
- }
-
- private class Worker implements Runnable
- {
- private long lastActive = System.currentTimeMillis();
-
- public void run()
- {
- Thread.currentThread().setName(MultiThreadSocketConnector.this.threadName);
-
- for (; ;)
- {
- try
- {
- int nKeys = selector.select(1000);
-
- registerNew();
-
- if (nKeys > 0)
- {
- processSessions(selector.selectedKeys());
- }
-
- processTimedOutSessions(selector.keys());
-
- if (selector.keys().isEmpty())
- {
- if (System.currentTimeMillis() - lastActive > workerTimeout * 1000L)
- {
- synchronized (lock)
- {
- if (selector.keys().isEmpty() &&
- connectQueue.isEmpty())
- {
- worker = null;
- try
- {
- selector.close();
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
- }
- finally
- {
- selector = null;
- }
- break;
- }
- }
- }
- }
- else
- {
- lastActive = System.currentTimeMillis();
- }
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
-
- try
- {
- Thread.sleep(1000);
- }
- catch (InterruptedException e1)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e1);
- }
- }
- }
- }
- }
-
- private class ConnectionRequest extends DefaultConnectFuture
- {
- private final SocketChannel channel;
- private final long deadline;
- private final IoHandler handler;
- private final IoServiceConfig config;
-
- private ConnectionRequest(SocketChannel channel, IoHandler handler, IoServiceConfig config)
- {
- this.channel = channel;
- long timeout;
- if (config instanceof IoConnectorConfig)
- {
- timeout = ((IoConnectorConfig) config).getConnectTimeoutMillis();
- }
- else
- {
- timeout = ((IoConnectorConfig) getDefaultConfig()).getConnectTimeoutMillis();
- }
- this.deadline = System.currentTimeMillis() + timeout;
- this.handler = handler;
- this.config = config;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketFilterChain.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketFilterChain.java
deleted file mode 100644
index 67b8c8d820..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketFilterChain.java
+++ /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.
- *
- */
-package org.apache.mina.transport.socket.nio;
-
-import java.io.IOException;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoFilter.WriteRequest;
-import org.apache.mina.common.support.AbstractIoFilterChain;
-import org.apache.mina.util.Queue;
-
-/**
- * An {@link IoFilterChain} for socket transport (TCP/IP).
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- */
-class MultiThreadSocketFilterChain extends AbstractIoFilterChain {
-
- MultiThreadSocketFilterChain( IoSession parent )
- {
- super( parent );
- }
-
- protected void doWrite( IoSession session, WriteRequest writeRequest )
- {
- MultiThreadSocketSessionImpl s = (MultiThreadSocketSessionImpl) session;
- Queue writeRequestQueue = s.getWriteRequestQueue();
-
- // SocketIoProcessor.doFlush() will reset it after write is finished
- // because the buffer will be passed with messageSent event.
- ( ( ByteBuffer ) writeRequest.getMessage() ).mark();
- synchronized( writeRequestQueue )
- {
- writeRequestQueue.push( writeRequest );
- if( writeRequestQueue.size() == 1 && session.getTrafficMask().isWritable() )
- {
- // Notify SocketIoProcessor only when writeRequestQueue was empty.
- s.getIoProcessor().flush( s );
- }
- }
- }
-
- protected void doClose( IoSession session ) throws IOException
- {
- MultiThreadSocketSessionImpl s = (MultiThreadSocketSessionImpl) session;
- s.getIoProcessor().remove( s );
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketIoProcessor.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketIoProcessor.java
deleted file mode 100644
index c23ad8686f..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketIoProcessor.java
+++ /dev/null
@@ -1,1026 +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.
- *
- */
-package org.apache.mina.transport.socket.nio;
-
-import edu.emory.mathcs.backport.java.util.concurrent.Executor;
-import edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantLock;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.ExceptionMonitor;
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoFilter.WriteRequest;
-import org.apache.mina.common.WriteTimeoutException;
-import org.apache.mina.util.IdentityHashSet;
-import org.apache.mina.util.NamePreservingRunnable;
-import org.apache.mina.util.Queue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.Selector;
-import java.nio.channels.SocketChannel;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-/**
- * Performs all I/O operations for sockets which is connected or bound. This class is used by MINA internally.
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- * @version $Rev: 619823 $, $Date: 2008-02-08 10:09:37 +0000 (Fri, 08 Feb 2008) $,
- */
-class MultiThreadSocketIoProcessor extends SocketIoProcessor
-{
- Logger _logger = LoggerFactory.getLogger(MultiThreadSocketIoProcessor.class);
- Logger _loggerRead = LoggerFactory.getLogger(MultiThreadSocketIoProcessor.class + ".Reader");
- Logger _loggerWrite = LoggerFactory.getLogger(MultiThreadSocketIoProcessor.class + ".Writer");
-
- private static final long SELECTOR_TIMEOUT = 1000L;
-
- private int MAX_READ_BYTES_PER_SESSION = 524288; //512K
- private int MAX_FLUSH_BYTES_PER_SESSION = 524288; //512K
-
- private final Object readLock = new Object();
- private final Object writeLock = new Object();
-
- private final String threadName;
- private final Executor executor;
-
- private ReentrantLock trafficMaskUpdateLock = new ReentrantLock();
-
- /** @noinspection FieldAccessedSynchronizedAndUnsynchronized */
- private volatile Selector selector, writeSelector;
-
- private final Queue newSessions = new Queue();
- private final Queue removingSessions = new Queue();
- private final BlockingQueue flushingSessions = new LinkedBlockingQueue();
- private final IdentityHashSet flushingSessionsSet = new IdentityHashSet();
-
- private final Queue trafficControllingSessions = new Queue();
-
- private ReadWorker readWorker;
- private WriteWorker writeWorker;
- private long lastIdleReadCheckTime = System.currentTimeMillis();
- private long lastIdleWriteCheckTime = System.currentTimeMillis();
-
- MultiThreadSocketIoProcessor(String threadName, Executor executor)
- {
- super(threadName, executor);
- this.threadName = threadName;
- this.executor = executor;
- }
-
- void addNew(SocketSessionImpl session) throws IOException
- {
- synchronized (newSessions)
- {
- newSessions.push(session);
- }
-
- startupWorker();
-
- selector.wakeup();
- writeSelector.wakeup();
- }
-
- void remove(SocketSessionImpl session) throws IOException
- {
- scheduleRemove(session);
- startupWorker();
- selector.wakeup();
- }
-
- private void startupWorker() throws IOException
- {
- synchronized (readLock)
- {
- if (readWorker == null)
- {
- selector = Selector.open();
- readWorker = new ReadWorker();
- executor.execute(new NamePreservingRunnable(readWorker));
- }
- }
-
- synchronized (writeLock)
- {
- if (writeWorker == null)
- {
- writeSelector = Selector.open();
- writeWorker = new WriteWorker();
- executor.execute(new NamePreservingRunnable(writeWorker));
- }
- }
-
- }
-
- void flush(SocketSessionImpl session)
- {
- scheduleFlush(session);
- Selector selector = this.writeSelector;
-
- if (selector != null)
- {
- selector.wakeup();
- }
- }
-
- void updateTrafficMask(SocketSessionImpl session)
- {
- scheduleTrafficControl(session);
- Selector selector = this.selector;
- if (selector != null)
- {
- selector.wakeup();
- }
- }
-
- private void scheduleRemove(SocketSessionImpl session)
- {
- synchronized (removingSessions)
- {
- removingSessions.push(session);
- }
- }
-
- private void scheduleFlush(SocketSessionImpl session)
- {
- synchronized (flushingSessionsSet)
- {
- //if flushingSessions grows to contain Integer.MAX_VALUE sessions
- // then this will fail.
- if (flushingSessionsSet.add(session))
- {
- flushingSessions.offer(session);
- }
- }
- }
-
- private void scheduleTrafficControl(SocketSessionImpl session)
- {
- synchronized (trafficControllingSessions)
- {
- trafficControllingSessions.push(session);
- }
- }
-
- private void doAddNewReader() throws InterruptedException
- {
- if (newSessions.isEmpty())
- {
- return;
- }
-
- for (; ;)
- {
- MultiThreadSocketSessionImpl session;
-
- synchronized (newSessions)
- {
- session = (MultiThreadSocketSessionImpl) newSessions.peek();
- }
-
- if (session == null)
- {
- break;
- }
-
- SocketChannel ch = session.getChannel();
-
-
- try
- {
-
- ch.configureBlocking(false);
- session.setSelectionKey(ch.register(selector,
- SelectionKey.OP_READ,
- session));
-
- //System.out.println("ReadDebug:"+"Awaiting Registration");
- session.awaitRegistration();
- sessionCreated(session);
- }
- catch (IOException e)
- {
- // Clear the AbstractIoFilterChain.CONNECT_FUTURE attribute
- // and call ConnectFuture.setException().
- session.getFilterChain().fireExceptionCaught(session, e);
- }
- }
- }
-
-
- private void doAddNewWrite() throws InterruptedException
- {
- if (newSessions.isEmpty())
- {
- return;
- }
-
- for (; ;)
- {
- MultiThreadSocketSessionImpl session;
-
- synchronized (newSessions)
- {
- session = (MultiThreadSocketSessionImpl) newSessions.peek();
- }
-
- if (session == null)
- {
- break;
- }
-
- SocketChannel ch = session.getChannel();
-
- try
- {
- ch.configureBlocking(false);
- synchronized (flushingSessionsSet)
- {
- flushingSessionsSet.add(session);
- }
-
- session.setWriteSelectionKey(ch.register(writeSelector,
- SelectionKey.OP_WRITE,
- session));
-
- //System.out.println("WriteDebug:"+"Awaiting Registration");
- session.awaitRegistration();
- sessionCreated(session);
- }
- catch (IOException e)
- {
-
- // Clear the AbstractIoFilterChain.CONNECT_FUTURE attribute
- // and call ConnectFuture.setException().
- session.getFilterChain().fireExceptionCaught(session, e);
- }
- }
- }
-
-
- private void sessionCreated(SocketSessionImpl sessionParam) throws InterruptedException
- {
- MultiThreadSocketSessionImpl session = (MultiThreadSocketSessionImpl) sessionParam;
- synchronized (newSessions)
- {
- if (!session.created())
- {
- _logger.debug("Popping new session");
- newSessions.pop();
-
- // AbstractIoFilterChain.CONNECT_FUTURE is cleared inside here
- // in AbstractIoFilterChain.fireSessionOpened().
- session.getServiceListeners().fireSessionCreated(session);
-
- session.doneCreation();
- }
- }
- }
-
- private void doRemove()
- {
- if (removingSessions.isEmpty())
- {
- return;
- }
-
- for (; ;)
- {
- MultiThreadSocketSessionImpl session;
-
- synchronized (removingSessions)
- {
- session = (MultiThreadSocketSessionImpl) removingSessions.pop();
- }
-
- if (session == null)
- {
- break;
- }
-
- SocketChannel ch = session.getChannel();
- SelectionKey key = session.getReadSelectionKey();
- SelectionKey writeKey = session.getWriteSelectionKey();
-
- // Retry later if session is not yet fully initialized.
- // (In case that Session.close() is called before addSession() is processed)
- if (key == null || writeKey == null)
- {
- scheduleRemove(session);
- break;
- }
- // skip if channel is already closed
- if (!key.isValid() || !writeKey.isValid())
- {
- continue;
- }
-
- try
- {
- //System.out.println("ReadDebug:"+"Removing Session: " + System.identityHashCode(session));
- synchronized (readLock)
- {
- key.cancel();
- }
- synchronized (writeLock)
- {
- writeKey.cancel();
- }
- ch.close();
- }
- catch (IOException e)
- {
- session.getFilterChain().fireExceptionCaught(session, e);
- }
- finally
- {
- releaseWriteBuffers(session);
- session.getServiceListeners().fireSessionDestroyed(session);
- }
- }
- }
-
- private void processRead(Set selectedKeys)
- {
- Iterator it = selectedKeys.iterator();
-
- while (it.hasNext())
- {
- SelectionKey key = (SelectionKey) it.next();
- MultiThreadSocketSessionImpl session = (MultiThreadSocketSessionImpl) key.attachment();
-
- synchronized (readLock)
- {
- if (key.isValid() && key.isReadable() && session.getTrafficMask().isReadable())
- {
- read(session);
- }
- }
-
- }
-
- selectedKeys.clear();
- }
-
- private void processWrite(Set selectedKeys)
- {
- Iterator it = selectedKeys.iterator();
-
- while (it.hasNext())
- {
- SelectionKey key = (SelectionKey) it.next();
- SocketSessionImpl session = (SocketSessionImpl) key.attachment();
-
- synchronized (writeLock)
- {
- if (key.isValid() && key.isWritable() && session.getTrafficMask().isWritable())
- {
-
- // Clear OP_WRITE
- key.interestOps(key.interestOps() & (~SelectionKey.OP_WRITE));
-
- synchronized (flushingSessionsSet)
- {
- flushingSessions.offer(session);
- }
- }
- }
- }
-
- selectedKeys.clear();
- }
-
- private void read(SocketSessionImpl session)
- {
-
- //if (_loggerWrite.isDebugEnabled())
- {
- //System.out.println("WriteDebug:"+"Starting read for Session:" + System.identityHashCode(session));
- }
-
- int totalReadBytes = 0;
-
- while (totalReadBytes <= MAX_READ_BYTES_PER_SESSION)
- {
- ByteBuffer buf = ByteBuffer.allocate(session.getReadBufferSize());
- SocketChannel ch = session.getChannel();
-
- try
- {
- buf.clear();
-
- int readBytes = 0;
- int ret;
-
- try
- {
- while ((ret = ch.read(buf.buf())) > 0)
- {
- readBytes += ret;
- totalReadBytes += ret;
- }
- }
- finally
- {
- buf.flip();
- }
-
-
- if (readBytes > 0)
- {
- session.increaseReadBytes(readBytes);
-
- session.getFilterChain().fireMessageReceived(session, buf);
- buf = null;
- }
-
- if (ret <= 0)
- {
- if (ret == 0)
- {
- if (readBytes == session.getReadBufferSize())
- {
- continue;
- }
- }
- else
- {
- scheduleRemove(session);
- }
-
- break;
- }
- }
- catch (Throwable e)
- {
- if (e instanceof IOException)
- {
- scheduleRemove(session);
- }
- session.getFilterChain().fireExceptionCaught(session, e);
-
- //Stop Reading this session.
- return;
- }
- finally
- {
- if (buf != null)
- {
- buf.release();
- }
- }
- }//for
-
- // if (_loggerWrite.isDebugEnabled())
- {
- //System.out.println("WriteDebug:"+"Read for Session:" + System.identityHashCode(session) + " got: " + totalReadBytes);
- }
- }
-
-
- private void notifyReadIdleness()
- {
- // process idle sessions
- long currentTime = System.currentTimeMillis();
- if ((currentTime - lastIdleReadCheckTime) >= 1000)
- {
- lastIdleReadCheckTime = currentTime;
- Set keys = selector.keys();
- if (keys != null)
- {
- for (Iterator it = keys.iterator(); it.hasNext();)
- {
- SelectionKey key = (SelectionKey) it.next();
- SocketSessionImpl session = (SocketSessionImpl) key.attachment();
- notifyReadIdleness(session, currentTime);
- }
- }
- }
- }
-
- private void notifyWriteIdleness()
- {
- // process idle sessions
- long currentTime = System.currentTimeMillis();
- if ((currentTime - lastIdleWriteCheckTime) >= 1000)
- {
- lastIdleWriteCheckTime = currentTime;
- Set keys = writeSelector.keys();
- if (keys != null)
- {
- for (Iterator it = keys.iterator(); it.hasNext();)
- {
- SelectionKey key = (SelectionKey) it.next();
- SocketSessionImpl session = (SocketSessionImpl) key.attachment();
- notifyWriteIdleness(session, currentTime);
- }
- }
- }
- }
-
- private void notifyReadIdleness(SocketSessionImpl session, long currentTime)
- {
- notifyIdleness0(
- session, currentTime,
- session.getIdleTimeInMillis(IdleStatus.BOTH_IDLE),
- IdleStatus.BOTH_IDLE,
- Math.max(session.getLastIoTime(), session.getLastIdleTime(IdleStatus.BOTH_IDLE)));
- notifyIdleness0(
- session, currentTime,
- session.getIdleTimeInMillis(IdleStatus.READER_IDLE),
- IdleStatus.READER_IDLE,
- Math.max(session.getLastReadTime(), session.getLastIdleTime(IdleStatus.READER_IDLE)));
-
- notifyWriteTimeout(session, currentTime, session
- .getWriteTimeoutInMillis(), session.getLastWriteTime());
- }
-
- private void notifyWriteIdleness(SocketSessionImpl session, long currentTime)
- {
- notifyIdleness0(
- session, currentTime,
- session.getIdleTimeInMillis(IdleStatus.BOTH_IDLE),
- IdleStatus.BOTH_IDLE,
- Math.max(session.getLastIoTime(), session.getLastIdleTime(IdleStatus.BOTH_IDLE)));
- notifyIdleness0(
- session, currentTime,
- session.getIdleTimeInMillis(IdleStatus.WRITER_IDLE),
- IdleStatus.WRITER_IDLE,
- Math.max(session.getLastWriteTime(), session.getLastIdleTime(IdleStatus.WRITER_IDLE)));
-
- notifyWriteTimeout(session, currentTime, session
- .getWriteTimeoutInMillis(), session.getLastWriteTime());
- }
-
- private void notifyIdleness0(SocketSessionImpl session, long currentTime,
- long idleTime, IdleStatus status,
- long lastIoTime)
- {
- if (idleTime > 0 && lastIoTime != 0
- && (currentTime - lastIoTime) >= idleTime)
- {
- session.increaseIdleCount(status);
- session.getFilterChain().fireSessionIdle(session, status);
- }
- }
-
- private void notifyWriteTimeout(SocketSessionImpl session,
- long currentTime,
- long writeTimeout, long lastIoTime)
- {
-
- MultiThreadSocketSessionImpl sesh = (MultiThreadSocketSessionImpl) session;
- SelectionKey key = sesh.getWriteSelectionKey();
-
- synchronized (writeLock)
- {
- if (writeTimeout > 0
- && (currentTime - lastIoTime) >= writeTimeout
- && key != null && key.isValid()
- && (key.interestOps() & SelectionKey.OP_WRITE) != 0)
- {
- session.getFilterChain().fireExceptionCaught(session, new WriteTimeoutException());
- }
- }
- }
-
- private SocketSessionImpl getNextFlushingSession()
- {
- return (SocketSessionImpl) flushingSessions.poll();
- }
-
- private void releaseSession(SocketSessionImpl session)
- {
- synchronized (session.getWriteRequestQueue())
- {
- synchronized (flushingSessionsSet)
- {
- if (session.getScheduledWriteRequests() > 0)
- {
- if (_loggerWrite.isDebugEnabled())
- {
- //System.out.println("WriteDebug:"+"Reflush" + System.identityHashCode(session));
- }
- flushingSessions.offer(session);
- }
- else
- {
- if (_loggerWrite.isDebugEnabled())
- {
- //System.out.println("WriteDebug:"+"Releasing session " + System.identityHashCode(session));
- }
- flushingSessionsSet.remove(session);
- }
- }
- }
- }
-
- private void releaseWriteBuffers(SocketSessionImpl session)
- {
- Queue writeRequestQueue = session.getWriteRequestQueue();
- WriteRequest req;
-
- //Should this be synchronized?
- synchronized (writeRequestQueue)
- {
- while ((req = (WriteRequest) writeRequestQueue.pop()) != null)
- {
- try
- {
- ((ByteBuffer) req.getMessage()).release();
- }
- catch (IllegalStateException e)
- {
- session.getFilterChain().fireExceptionCaught(session, e);
- }
- finally
- {
- req.getFuture().setWritten(false);
- }
- }
- }
- }
-
- private void doFlush()
- {
- MultiThreadSocketSessionImpl session;
-
- while ((session = (MultiThreadSocketSessionImpl) getNextFlushingSession()) != null)
- {
- if (!session.isConnected())
- {
- releaseWriteBuffers(session);
- releaseSession(session);
- continue;
- }
-
- SelectionKey key = session.getWriteSelectionKey();
- // Retry later if session is not yet fully initialized.
- // (In case that Session.write() is called before addSession() is processed)
- if (key == null)
- {
- scheduleFlush(session);
- releaseSession(session);
- continue;
- }
- // skip if channel is already closed
- if (!key.isValid())
- {
- releaseSession(session);
- continue;
- }
-
- try
- {
- if (doFlush(session))
- {
- releaseSession(session);
- }
- }
- catch (IOException e)
- {
- releaseSession(session);
- scheduleRemove(session);
- session.getFilterChain().fireExceptionCaught(session, e);
- }
-
- }
-
- }
-
- private boolean doFlush(SocketSessionImpl sessionParam) throws IOException
- {
- MultiThreadSocketSessionImpl session = (MultiThreadSocketSessionImpl) sessionParam;
- // Clear OP_WRITE
- SelectionKey key = session.getWriteSelectionKey();
- synchronized (writeLock)
- {
- key.interestOps(key.interestOps() & (~SelectionKey.OP_WRITE));
- }
- SocketChannel ch = session.getChannel();
- Queue writeRequestQueue = session.getWriteRequestQueue();
-
- long totalFlushedBytes = 0;
- while (true)
- {
- WriteRequest req;
-
- synchronized (writeRequestQueue)
- {
- req = (WriteRequest) writeRequestQueue.first();
- }
-
- if (req == null)
- {
- break;
- }
-
- ByteBuffer buf = (ByteBuffer) req.getMessage();
- if (buf.remaining() == 0)
- {
- synchronized (writeRequestQueue)
- {
- writeRequestQueue.pop();
- }
-
- session.increaseWrittenMessages();
-
- buf.reset();
- session.getFilterChain().fireMessageSent(session, req);
- continue;
- }
-
-
- int writtenBytes = 0;
-
- // Reported as DIRMINA-362
- //note: todo: fixme: Not sure it is important but if we see NoyYetConnected exceptions or 100% CPU in the kernel then this is it.
- if (key.isWritable())
- {
- writtenBytes = ch.write(buf.buf());
- totalFlushedBytes += writtenBytes;
- }
-
- if (writtenBytes > 0)
- {
- session.increaseWrittenBytes(writtenBytes);
- }
-
- if (buf.hasRemaining() || (totalFlushedBytes <= MAX_FLUSH_BYTES_PER_SESSION))
- {
- // Kernel buffer is full
- synchronized (writeLock)
- {
- key.interestOps(key.interestOps() | SelectionKey.OP_WRITE);
- }
- if (_loggerWrite.isDebugEnabled())
- {
- //System.out.println("WriteDebug:"+"Written BF: " + (session.getWrittenBytes() - totalFlushedBytes) + " bytes");
- }
- return false;
- }
- }
-
- if (_loggerWrite.isDebugEnabled())
- {
- //System.out.println("WriteDebug:"+"Written : " + (session.getWrittenBytes() - totalFlushedBytes) + " bytes");
- }
- return true;
- }
-
- private void doUpdateTrafficMask()
- {
- if (trafficControllingSessions.isEmpty() || trafficMaskUpdateLock.isLocked())
- {
- return;
- }
-
- // Synchronize over entire operation as this method should be called
- // from both read and write thread and we don't want the order of the
- // updates to get changed.
- trafficMaskUpdateLock.lock();
- try
- {
- for (; ;)
- {
- MultiThreadSocketSessionImpl session;
-
- session = (MultiThreadSocketSessionImpl) trafficControllingSessions.pop();
-
- if (session == null)
- {
- break;
- }
-
- SelectionKey key = session.getReadSelectionKey();
- // Retry later if session is not yet fully initialized.
- // (In case that Session.suspend??() or session.resume??() is
- // called before addSession() is processed)
- if (key == null)
- {
- scheduleTrafficControl(session);
- break;
- }
- // skip if channel is already closed
- if (!key.isValid())
- {
- continue;
- }
-
- // The normal is OP_READ and, if there are write requests in the
- // session's write queue, set OP_WRITE to trigger flushing.
-
- //Sset to Read and Write if there is nothing then the cost
- // is one loop through the flusher.
- int ops = SelectionKey.OP_READ;
-
- // Now mask the preferred ops with the mask of the current session
- int mask = session.getTrafficMask().getInterestOps();
- synchronized (readLock)
- {
- key.interestOps(ops & mask);
- }
- //Change key to the WriteSelection Key
- key = session.getWriteSelectionKey();
- if (key != null && key.isValid())
- {
- Queue writeRequestQueue = session.getWriteRequestQueue();
- synchronized (writeRequestQueue)
- {
- if (!writeRequestQueue.isEmpty())
- {
- ops = SelectionKey.OP_WRITE;
- synchronized (writeLock)
- {
- key.interestOps(ops & mask);
- }
- }
- }
- }
- }
- }
- finally
- {
- trafficMaskUpdateLock.unlock();
- }
-
- }
-
- private class WriteWorker implements Runnable
- {
-
- public void run()
- {
- Thread.currentThread().setName(MultiThreadSocketIoProcessor.this.threadName + "Writer");
-
- //System.out.println("WriteDebug:"+"Startup");
- for (; ;)
- {
- try
- {
- int nKeys = writeSelector.select(SELECTOR_TIMEOUT);
-
- doAddNewWrite();
- doUpdateTrafficMask();
-
- if (nKeys > 0)
- {
- //System.out.println("WriteDebug:"+nKeys + " keys from writeselector");
- processWrite(writeSelector.selectedKeys());
- }
- else
- {
- //System.out.println("WriteDebug:"+"No keys from writeselector");
- }
-
- doRemove();
- notifyWriteIdleness();
-
- if (flushingSessionsSet.size() > 0)
- {
- doFlush();
- }
-
- if (writeSelector.keys().isEmpty())
- {
- synchronized (writeLock)
- {
-
- if (writeSelector.keys().isEmpty() && newSessions.isEmpty())
- {
- writeWorker = null;
- try
- {
- writeSelector.close();
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
- }
- finally
- {
- writeSelector = null;
- }
-
- break;
- }
- }
- }
-
- }
- catch (Throwable t)
- {
- ExceptionMonitor.getInstance().exceptionCaught(t);
-
- try
- {
- Thread.sleep(1000);
- }
- catch (InterruptedException e1)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e1);
- }
- }
- }
- //System.out.println("WriteDebug:"+"Shutdown");
- }
-
- }
-
- private class ReadWorker implements Runnable
- {
-
- public void run()
- {
- Thread.currentThread().setName(MultiThreadSocketIoProcessor.this.threadName + "Reader");
-
- //System.out.println("ReadDebug:"+"Startup");
- for (; ;)
- {
- try
- {
- int nKeys = selector.select(SELECTOR_TIMEOUT);
-
- doAddNewReader();
- doUpdateTrafficMask();
-
- if (nKeys > 0)
- {
- //System.out.println("ReadDebug:"+nKeys + " keys from selector");
-
- processRead(selector.selectedKeys());
- }
- else
- {
- //System.out.println("ReadDebug:"+"No keys from selector");
- }
-
-
- doRemove();
- notifyReadIdleness();
-
- if (selector.keys().isEmpty())
- {
-
- synchronized (readLock)
- {
- if (selector.keys().isEmpty() && newSessions.isEmpty())
- {
- readWorker = null;
- try
- {
- selector.close();
- }
- catch (IOException e)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
- }
- finally
- {
- selector = null;
- }
-
- break;
- }
- }
- }
- }
- catch (Throwable t)
- {
- ExceptionMonitor.getInstance().exceptionCaught(t);
-
- try
- {
- Thread.sleep(1000);
- }
- catch (InterruptedException e1)
- {
- ExceptionMonitor.getInstance().exceptionCaught(e1);
- }
- }
- }
- //System.out.println("ReadDebug:"+"Shutdown");
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketSessionConfigImpl.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketSessionConfigImpl.java
deleted file mode 100644
index 043d4800b6..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketSessionConfigImpl.java
+++ /dev/null
@@ -1,240 +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.
- *
- */
-package org.apache.mina.transport.socket.nio;
-
-import org.apache.mina.common.ExceptionMonitor;
-import org.apache.mina.common.IoConnectorConfig;
-import org.apache.mina.common.support.BaseIoSessionConfig;
-
-import java.io.IOException;
-import java.net.Socket;
-import java.net.SocketException;
-
-/**
- * An {@link IoConnectorConfig} for {@link SocketConnector}.
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- * @version $Rev: 619823 $, $Date: 2008-02-08 10:09:37 +0000 (Fri, 08 Feb 2008) $
- */
-public class MultiThreadSocketSessionConfigImpl extends org.apache.mina.transport.socket.nio.SocketSessionConfigImpl
-{
- private static boolean SET_RECEIVE_BUFFER_SIZE_AVAILABLE = false;
- private static boolean SET_SEND_BUFFER_SIZE_AVAILABLE = false;
- private static boolean GET_TRAFFIC_CLASS_AVAILABLE = false;
- private static boolean SET_TRAFFIC_CLASS_AVAILABLE = false;
-
- private static boolean DEFAULT_REUSE_ADDRESS;
- private static int DEFAULT_RECEIVE_BUFFER_SIZE;
- private static int DEFAULT_SEND_BUFFER_SIZE;
- private static int DEFAULT_TRAFFIC_CLASS;
- private static boolean DEFAULT_KEEP_ALIVE;
- private static boolean DEFAULT_OOB_INLINE;
- private static int DEFAULT_SO_LINGER;
- private static boolean DEFAULT_TCP_NO_DELAY;
-
- static
- {
- initialize();
- }
-
- private static void initialize()
- {
- Socket socket = null;
-
- socket = new Socket();
-
- try
- {
- DEFAULT_REUSE_ADDRESS = socket.getReuseAddress();
- DEFAULT_RECEIVE_BUFFER_SIZE = socket.getReceiveBufferSize();
- DEFAULT_SEND_BUFFER_SIZE = socket.getSendBufferSize();
- DEFAULT_KEEP_ALIVE = socket.getKeepAlive();
- DEFAULT_OOB_INLINE = socket.getOOBInline();
- DEFAULT_SO_LINGER = socket.getSoLinger();
- DEFAULT_TCP_NO_DELAY = socket.getTcpNoDelay();
-
- // Check if setReceiveBufferSize is supported.
- try
- {
- socket.setReceiveBufferSize(DEFAULT_RECEIVE_BUFFER_SIZE);
- SET_RECEIVE_BUFFER_SIZE_AVAILABLE = true;
- }
- catch( SocketException e )
- {
- SET_RECEIVE_BUFFER_SIZE_AVAILABLE = false;
- }
-
- // Check if setSendBufferSize is supported.
- try
- {
- socket.setSendBufferSize(DEFAULT_SEND_BUFFER_SIZE);
- SET_SEND_BUFFER_SIZE_AVAILABLE = true;
- }
- catch( SocketException e )
- {
- SET_SEND_BUFFER_SIZE_AVAILABLE = false;
- }
-
- // Check if getTrafficClass is supported.
- try
- {
- DEFAULT_TRAFFIC_CLASS = socket.getTrafficClass();
- GET_TRAFFIC_CLASS_AVAILABLE = true;
- }
- catch( SocketException e )
- {
- GET_TRAFFIC_CLASS_AVAILABLE = false;
- DEFAULT_TRAFFIC_CLASS = 0;
- }
- }
- catch( SocketException e )
- {
- throw new ExceptionInInitializerError(e);
- }
- finally
- {
- if( socket != null )
- {
- try
- {
- socket.close();
- }
- catch( IOException e )
- {
- ExceptionMonitor.getInstance().exceptionCaught(e);
- }
- }
- }
- }
-
- public static boolean isSetReceiveBufferSizeAvailable() {
- return SET_RECEIVE_BUFFER_SIZE_AVAILABLE;
- }
-
- public static boolean isSetSendBufferSizeAvailable() {
- return SET_SEND_BUFFER_SIZE_AVAILABLE;
- }
-
- public static boolean isGetTrafficClassAvailable() {
- return GET_TRAFFIC_CLASS_AVAILABLE;
- }
-
- public static boolean isSetTrafficClassAvailable() {
- return SET_TRAFFIC_CLASS_AVAILABLE;
- }
-
- private boolean reuseAddress = DEFAULT_REUSE_ADDRESS;
- private int receiveBufferSize = DEFAULT_RECEIVE_BUFFER_SIZE;
- private int sendBufferSize = DEFAULT_SEND_BUFFER_SIZE;
- private int trafficClass = DEFAULT_TRAFFIC_CLASS;
- private boolean keepAlive = DEFAULT_KEEP_ALIVE;
- private boolean oobInline = DEFAULT_OOB_INLINE;
- private int soLinger = DEFAULT_SO_LINGER;
- private boolean tcpNoDelay = DEFAULT_TCP_NO_DELAY;
-
- /**
- * Creates a new instance.
- */
- MultiThreadSocketSessionConfigImpl()
- {
- }
-
- public boolean isReuseAddress()
- {
- return reuseAddress;
- }
-
- public void setReuseAddress( boolean reuseAddress )
- {
- this.reuseAddress = reuseAddress;
- }
-
- public int getReceiveBufferSize()
- {
- return receiveBufferSize;
- }
-
- public void setReceiveBufferSize( int receiveBufferSize )
- {
- this.receiveBufferSize = receiveBufferSize;
- }
-
- public int getSendBufferSize()
- {
- return sendBufferSize;
- }
-
- public void setSendBufferSize( int sendBufferSize )
- {
- this.sendBufferSize = sendBufferSize;
- }
-
- public int getTrafficClass()
- {
- return trafficClass;
- }
-
- public void setTrafficClass( int trafficClass )
- {
- this.trafficClass = trafficClass;
- }
-
- public boolean isKeepAlive()
- {
- return keepAlive;
- }
-
- public void setKeepAlive( boolean keepAlive )
- {
- this.keepAlive = keepAlive;
- }
-
- public boolean isOobInline()
- {
- return oobInline;
- }
-
- public void setOobInline( boolean oobInline )
- {
- this.oobInline = oobInline;
- }
-
- public int getSoLinger()
- {
- return soLinger;
- }
-
- public void setSoLinger( int soLinger )
- {
- this.soLinger = soLinger;
- }
-
- public boolean isTcpNoDelay()
- {
- return tcpNoDelay;
- }
-
- public void setTcpNoDelay( boolean tcpNoDelay )
- {
- this.tcpNoDelay = tcpNoDelay;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketSessionImpl.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketSessionImpl.java
deleted file mode 100644
index be4a2d289d..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/socket/nio/MultiThreadSocketSessionImpl.java
+++ /dev/null
@@ -1,488 +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.
- *
- */
-package org.apache.mina.transport.socket.nio;
-
-import org.apache.mina.common.IoFilter.WriteRequest;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoService;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IoSessionConfig;
-import org.apache.mina.common.RuntimeIOException;
-import org.apache.mina.common.TransportType;
-import org.apache.mina.common.support.BaseIoSessionConfig;
-import org.apache.mina.common.support.IoServiceListenerSupport;
-import org.apache.mina.util.Queue;
-
-import java.net.SocketAddress;
-import java.net.SocketException;
-import java.nio.channels.SelectionKey;
-import java.nio.channels.SocketChannel;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * An {@link IoSession} for socket transport (TCP/IP).
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- * @version $Rev: 619823 $, $Date: 2008-02-08 10:09:37 +0000 (Fri, 08 Feb 2008) $
- */
-class MultiThreadSocketSessionImpl extends SocketSessionImpl
-{
- private final IoService manager;
- private final IoServiceConfig serviceConfig;
- private final SocketSessionConfig config = new SessionConfigImpl();
- private final MultiThreadSocketIoProcessor ioProcessor;
- private final MultiThreadSocketFilterChain filterChain;
- private final SocketChannel ch;
- private final Queue writeRequestQueue;
- private final IoHandler handler;
- private final SocketAddress remoteAddress;
- private final SocketAddress localAddress;
- private final SocketAddress serviceAddress;
- private final IoServiceListenerSupport serviceListeners;
- private SelectionKey readKey, writeKey;
- private int readBufferSize;
- private CountDownLatch registeredReadyLatch = new CountDownLatch(2);
- private AtomicBoolean created = new AtomicBoolean(false);
-
- /**
- * Creates a new instance.
- */
- MultiThreadSocketSessionImpl( IoService manager,
- SocketIoProcessor ioProcessor,
- IoServiceListenerSupport listeners,
- IoServiceConfig serviceConfig,
- SocketChannel ch,
- IoHandler defaultHandler,
- SocketAddress serviceAddress )
- {
- super(manager, ioProcessor, listeners, serviceConfig, ch,defaultHandler,serviceAddress);
- this.manager = manager;
- this.serviceListeners = listeners;
- this.ioProcessor = (MultiThreadSocketIoProcessor) ioProcessor;
- this.filterChain = new MultiThreadSocketFilterChain(this);
- this.ch = ch;
- this.writeRequestQueue = new Queue();
- this.handler = defaultHandler;
- this.remoteAddress = ch.socket().getRemoteSocketAddress();
- this.localAddress = ch.socket().getLocalSocketAddress();
- this.serviceAddress = serviceAddress;
- this.serviceConfig = serviceConfig;
-
- // Apply the initial session settings
- IoSessionConfig sessionConfig = serviceConfig.getSessionConfig();
- if( sessionConfig instanceof SocketSessionConfig )
- {
- SocketSessionConfig cfg = ( SocketSessionConfig ) sessionConfig;
- this.config.setKeepAlive( cfg.isKeepAlive() );
- this.config.setOobInline( cfg.isOobInline() );
- this.config.setReceiveBufferSize( cfg.getReceiveBufferSize() );
- this.readBufferSize = cfg.getReceiveBufferSize();
- this.config.setReuseAddress( cfg.isReuseAddress() );
- this.config.setSendBufferSize( cfg.getSendBufferSize() );
- this.config.setSoLinger( cfg.getSoLinger() );
- this.config.setTcpNoDelay( cfg.isTcpNoDelay() );
-
- if( this.config.getTrafficClass() != cfg.getTrafficClass() )
- {
- this.config.setTrafficClass( cfg.getTrafficClass() );
- }
- }
- }
-
- void awaitRegistration() throws InterruptedException
- {
- registeredReadyLatch.countDown();
-
- registeredReadyLatch.await();
- }
-
- boolean created() throws InterruptedException
- {
- return created.get();
- }
-
- void doneCreation()
- {
- created.getAndSet(true);
- }
-
- public IoService getService()
- {
- return manager;
- }
-
- public IoServiceConfig getServiceConfig()
- {
- return serviceConfig;
- }
-
- public IoSessionConfig getConfig()
- {
- return config;
- }
-
- SocketIoProcessor getIoProcessor()
- {
- return ioProcessor;
- }
-
- public IoFilterChain getFilterChain()
- {
- return filterChain;
- }
-
- SocketChannel getChannel()
- {
- return ch;
- }
-
- IoServiceListenerSupport getServiceListeners()
- {
- return serviceListeners;
- }
-
- SelectionKey getSelectionKey()
- {
- return readKey;
- }
-
- SelectionKey getReadSelectionKey()
- {
- return readKey;
- }
-
- SelectionKey getWriteSelectionKey()
- {
- return writeKey;
- }
-
- void setSelectionKey(SelectionKey key)
- {
- this.readKey = key;
- }
-
- void setWriteSelectionKey(SelectionKey key)
- {
- this.writeKey = key;
- }
-
- public IoHandler getHandler()
- {
- return handler;
- }
-
- protected void close0()
- {
- filterChain.fireFilterClose( this );
- }
-
- Queue getWriteRequestQueue()
- {
- return writeRequestQueue;
- }
-
- /**
- @return int Number of write scheduled write requests
- @deprecated
- */
- public int getScheduledWriteMessages()
- {
- return getScheduledWriteRequests();
- }
-
- public int getScheduledWriteRequests()
- {
- synchronized( writeRequestQueue )
- {
- return writeRequestQueue.size();
- }
- }
-
- public int getScheduledWriteBytes()
- {
- synchronized( writeRequestQueue )
- {
- return writeRequestQueue.byteSize();
- }
- }
-
- protected void write0( WriteRequest writeRequest )
- {
- filterChain.fireFilterWrite( this, writeRequest );
- }
-
- public TransportType getTransportType()
- {
- return TransportType.SOCKET;
- }
-
- public SocketAddress getRemoteAddress()
- {
- //This is what I had previously
-// return ch.socket().getRemoteSocketAddress();
- return remoteAddress;
- }
-
- public SocketAddress getLocalAddress()
- {
- //This is what I had previously
-// return ch.socket().getLocalSocketAddress();
- return localAddress;
- }
-
- public SocketAddress getServiceAddress()
- {
- return serviceAddress;
- }
-
- protected void updateTrafficMask()
- {
- this.ioProcessor.updateTrafficMask( this );
- }
-
- int getReadBufferSize()
- {
- return readBufferSize;
- }
-
- private class SessionConfigImpl extends BaseIoSessionConfig implements SocketSessionConfig
- {
- public boolean isKeepAlive()
- {
- try
- {
- return ch.socket().getKeepAlive();
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public void setKeepAlive( boolean on )
- {
- try
- {
- ch.socket().setKeepAlive( on );
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public boolean isOobInline()
- {
- try
- {
- return ch.socket().getOOBInline();
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public void setOobInline( boolean on )
- {
- try
- {
- ch.socket().setOOBInline( on );
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public boolean isReuseAddress()
- {
- try
- {
- return ch.socket().getReuseAddress();
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public void setReuseAddress( boolean on )
- {
- try
- {
- ch.socket().setReuseAddress( on );
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public int getSoLinger()
- {
- try
- {
- return ch.socket().getSoLinger();
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public void setSoLinger( int linger )
- {
- try
- {
- if( linger < 0 )
- {
- ch.socket().setSoLinger( false, 0 );
- }
- else
- {
- ch.socket().setSoLinger( true, linger );
- }
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public boolean isTcpNoDelay()
- {
- try
- {
- return ch.socket().getTcpNoDelay();
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public void setTcpNoDelay( boolean on )
- {
- try
- {
- ch.socket().setTcpNoDelay( on );
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public int getTrafficClass()
- {
- if( SocketSessionConfigImpl.isGetTrafficClassAvailable() )
- {
- try
- {
- return ch.socket().getTrafficClass();
- }
- catch( SocketException e )
- {
- // Throw an exception only when setTrafficClass is also available.
- if( SocketSessionConfigImpl.isSetTrafficClassAvailable() )
- {
- throw new RuntimeIOException( e );
- }
- }
- }
-
- return 0;
- }
-
- public void setTrafficClass( int tc )
- {
- if( SocketSessionConfigImpl.isSetTrafficClassAvailable() )
- {
- try
- {
- ch.socket().setTrafficClass( tc );
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
- }
-
- public int getSendBufferSize()
- {
- try
- {
- return ch.socket().getSendBufferSize();
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public void setSendBufferSize( int size )
- {
- if( SocketSessionConfigImpl.isSetSendBufferSizeAvailable() )
- {
- try
- {
- ch.socket().setSendBufferSize( size );
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
- }
-
- public int getReceiveBufferSize()
- {
- try
- {
- return ch.socket().getReceiveBufferSize();
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
-
- public void setReceiveBufferSize( int size )
- {
- if( SocketSessionConfigImpl.isSetReceiveBufferSizeAvailable() )
- {
- try
- {
- ch.socket().setReceiveBufferSize( size );
- MultiThreadSocketSessionImpl.this.readBufferSize = size;
- }
- catch( SocketException e )
- {
- throw new RuntimeIOException( e );
- }
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/vmpipe/QpidVmPipeConnector.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/vmpipe/QpidVmPipeConnector.java
deleted file mode 100644
index a23e546af5..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/mina/transport/vmpipe/QpidVmPipeConnector.java
+++ /dev/null
@@ -1,151 +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.
- *
- */
-package org.apache.mina.transport.vmpipe;
-
-import java.io.IOException;
-import java.net.SocketAddress;
-
-import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.ExceptionMonitor;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.IoSessionConfig;
-import org.apache.mina.common.support.AbstractIoFilterChain;
-import org.apache.mina.common.support.BaseIoConnector;
-import org.apache.mina.common.support.BaseIoConnectorConfig;
-import org.apache.mina.common.support.BaseIoSessionConfig;
-import org.apache.mina.common.support.DefaultConnectFuture;
-import org.apache.mina.transport.vmpipe.support.VmPipe;
-import org.apache.mina.transport.vmpipe.support.VmPipeIdleStatusChecker;
-import org.apache.mina.transport.vmpipe.support.VmPipeSessionImpl;
-import org.apache.mina.util.AnonymousSocketAddress;
-
-/**
- * Connects to {@link IoHandler}s which is bound on the specified
- * {@link VmPipeAddress}.
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- * @version $Rev: 619823 $, $Date: 2008-02-08 10:09:37 +0000 (Fri, 08 Feb 2008) $
- */
-public class QpidVmPipeConnector extends VmPipeConnector
-{
- private static final IoSessionConfig CONFIG = new BaseIoSessionConfig() {};
- private final IoServiceConfig defaultConfig = new BaseIoConnectorConfig()
- {
- public IoSessionConfig getSessionConfig()
- {
- return CONFIG;
- }
- };
-
- /**
- * Creates a new instance.
- */
- public QpidVmPipeConnector()
- {
- }
-
- public ConnectFuture connect( SocketAddress address, IoHandler handler, IoServiceConfig config )
- {
- return connect( address, null, handler, config );
- }
-
- public ConnectFuture connect( SocketAddress address, SocketAddress localAddress, IoHandler handler, IoServiceConfig config )
- {
- if( address == null )
- throw new NullPointerException( "address" );
- if( handler == null )
- throw new NullPointerException( "handler" );
- if( ! ( address instanceof VmPipeAddress ) )
- throw new IllegalArgumentException(
- "address must be VmPipeAddress." );
-
- if( config == null )
- {
- config = getDefaultConfig();
- }
-
- VmPipe entry = ( VmPipe ) VmPipeAcceptor.boundHandlers.get( address );
- if( entry == null )
- {
- return DefaultConnectFuture.newFailedFuture(
- new IOException( "Endpoint unavailable: " + address ) );
- }
-
- DefaultConnectFuture future = new DefaultConnectFuture();
- VmPipeSessionImpl localSession =
- new VmPipeSessionImpl(
- this,
- config,
- getListeners(),
- new Object(), // lock
- new AnonymousSocketAddress(),
- handler,
- entry );
-
- // initialize acceptor session
- VmPipeSessionImpl remoteSession = localSession.getRemoteSession();
- try
- {
- IoFilterChain filterChain = remoteSession.getFilterChain();
- entry.getAcceptor().getFilterChainBuilder().buildFilterChain( filterChain );
- entry.getConfig().getFilterChainBuilder().buildFilterChain( filterChain );
- entry.getConfig().getThreadModel().buildFilterChain( filterChain );
-
- // The following sentences don't throw any exceptions.
- entry.getListeners().fireSessionCreated( remoteSession );
- VmPipeIdleStatusChecker.getInstance().addSession( remoteSession );
- }
- catch( Throwable t )
- {
- ExceptionMonitor.getInstance().exceptionCaught( t );
- remoteSession.close();
- }
-
-
- // initialize connector session
- try
- {
- IoFilterChain filterChain = localSession.getFilterChain();
- this.getFilterChainBuilder().buildFilterChain( filterChain );
- config.getFilterChainBuilder().buildFilterChain( filterChain );
- config.getThreadModel().buildFilterChain( filterChain );
-
- // The following sentences don't throw any exceptions.
- localSession.setAttribute( AbstractIoFilterChain.CONNECT_FUTURE, future );
- getListeners().fireSessionCreated( localSession );
- VmPipeIdleStatusChecker.getInstance().addSession( localSession);
- }
- catch( Throwable t )
- {
- future.setException( t );
- }
-
-
-
- return future;
- }
-
- public IoServiceConfig getDefaultConfig()
- {
- return defaultConfig;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java
deleted file mode 100644
index 1b2eabdc86..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java
+++ /dev/null
@@ -1,41 +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.
- *
- */
-package org.apache.qpid;
-
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQChannelClosedException indicates that an operation cannot be performed becauase a channel has been closed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents a failed operation on a closed channel.
- * </table>
- *
- * @todo Does this duplicate AMQChannelException?
- */
-public class AMQChannelClosedException extends AMQException
-{
- public AMQChannelClosedException(AMQConstant errorCode, String msg, Throwable cause)
- {
- super(errorCode, msg, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java
deleted file mode 100644
index ef9420ba87..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-package org.apache.qpid;
-
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQChannelException indicates that an error that requires the channel to be closed has occurred.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents an error that rquires the channel to be closed.
- * </table>
- *
- * @todo Does this duplicate AMQChannelClosedException?
- */
-public class AMQChannelException extends AMQException
-{
- private final int _classId;
- private final int _methodId;
- /* AMQP version for which exception ocurred */
- private final byte major;
- private final byte minor;
-
- public AMQChannelException(AMQConstant errorCode, String msg, int classId, int methodId, byte major, byte minor,
- Throwable cause)
- {
- super(errorCode, msg, cause);
- _classId = classId;
- _methodId = methodId;
- this.major = major;
- this.minor = minor;
- }
-
- public AMQFrame getCloseFrame(int channel)
- {
- MethodRegistry reg = MethodRegistry.getMethodRegistry(new ProtocolVersion(major,minor));
- return new AMQFrame(channel, reg.createChannelCloseBody(getErrorCode() == null ? AMQConstant.INTERNAL_ERROR.getCode() : getErrorCode().getCode(), new AMQShortString(getMessage()),_classId,_methodId));
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java
deleted file mode 100644
index b2ce3c1b32..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid;
-
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQConnectionClosedException indicates that a connection has been closed.
- *
- * <p/>This exception is really used as an event, in order that the method handler that raises it creates an event
- * which is propagated to the io handler, in order to notify it of the connection closure.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents a the closure of a connection.
- * </table>
- *
- * @todo Should review where exceptions-as-events
- */
-public class AMQConnectionClosedException extends AMQException
-{
- public AMQConnectionClosedException(AMQConstant errorCode, String msg, Throwable cause)
- {
- super(errorCode, msg, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java
deleted file mode 100644
index afd415b1eb..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java
+++ /dev/null
@@ -1,70 +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.
- *
- */
-
-package org.apache.qpid;
-
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQConnectionException indicates that an error that requires the channel to be closed has occurred.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents an error that rquires the channel to be closed.
- * </table>
- *
- * @todo Does this duplicate AMQChannelClosedException?
- */
-public class AMQConnectionException extends AMQException
-{
- private final int _classId;
- private final int _methodId;
-
- /** AMQP version for which exception ocurred, major code. */
- private final byte major;
-
- /** AMQP version for which exception ocurred, minor code. */
- private final byte minor;
-
- boolean _closeConnetion;
-
- public AMQConnectionException(AMQConstant errorCode, String msg, int classId, int methodId, byte major, byte minor,
- Throwable cause)
- {
- super(errorCode, msg, cause);
- _classId = classId;
- _methodId = methodId;
- this.major = major;
- this.minor = minor;
- }
-
- public AMQFrame getCloseFrame(int channel)
- {
- MethodRegistry reg = MethodRegistry.getMethodRegistry(new ProtocolVersion(major,minor));
- return new AMQFrame(channel,
- reg.createConnectionCloseBody(getErrorCode().getCode(),
- new AMQShortString(getMessage()),
- _classId,
- _methodId));
-
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java
deleted file mode 100644
index fa69f7f91b..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java
+++ /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.
- *
- */
-
-package org.apache.qpid;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQConnectionFailureException indicates that a connection to a broker could not be formed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents failure to connect to a broker.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- */
-public class AMQConnectionFailureException extends AMQException
-{
- Collection<Exception> _exceptions;
-
- public AMQConnectionFailureException(String message, Throwable cause)
- {
- super(null, message, cause);
- }
-
- public AMQConnectionFailureException(AMQConstant errorCode, String message, Throwable cause)
- {
- super(errorCode, message, cause);
- }
-
- public AMQConnectionFailureException(String message, Collection<Exception> exceptions)
- {
- // Blah, I hate ? but java won't let super() be anything other than the first thing, sorry...
- super (null, message, exceptions.isEmpty() ? null : exceptions.iterator().next());
- this._exceptions = exceptions;
- }
-
- public Collection<Exception> getLinkedExceptions()
- {
- return _exceptions;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java
deleted file mode 100644
index 5ec5c42ab9..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java
+++ /dev/null
@@ -1,39 +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.
- *
- */
-package org.apache.qpid;
-
-/**
- * AMQDisconnectedException indicates that a broker disconnected without failover.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents disconnection without failover by the broker.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- */
-public class AMQDisconnectedException extends AMQException
-{
- public AMQDisconnectedException(String msg, Throwable cause)
- {
- super(null, msg, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQException.java
deleted file mode 100644
index be335c5dba..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQException.java
+++ /dev/null
@@ -1,122 +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.
- *
- */
-package org.apache.qpid;
-
-import javax.management.JMException;
-
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQException forms the root exception of all exceptions relating to the AMQ protocol. It provides space to associate
- * a required AMQ error code with the exception, which is a numeric value, with a meaning defined by the protocol.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents an exception condition associated with an AMQ protocol status code.
- * </table>
- *
- * @todo This exception class is also used as a generic exception throughout Qpid code. This usage may not be strictly
- * correct if this is to signify a protocol exception. Should review.
- */
-public class AMQException extends Exception
-{
- /** Holds the AMQ error code constant associated with this exception. */
- private AMQConstant _errorCode;
-
- /**
- * Creates an exception with an optional error code, optional message and optional underlying cause.
- *
- * @param errorCode The error code. May be null if not to be set.
- * @param msg The exception message. May be null if not to be set.
- * @param cause The underlying cause of the exception. May be null if not to be set.
- */
- public AMQException(AMQConstant errorCode, String msg, Throwable cause)
- {
- super(((msg == null) ? "" : msg) + ((errorCode == null) ? "" : (" [error code " + errorCode + "]")), cause);
- _errorCode = errorCode;
- }
-
- /*
- * Deprecated constructors brought from M2.1
- */
- @Deprecated
- public AMQException (String msg)
- {
- this(null, (msg == null) ? "" : msg);
- }
-
- @Deprecated
- public AMQException (AMQConstant errorCode, String msg)
- {
- this(errorCode, (msg == null) ? "" : msg, null);
- }
-
- @Deprecated
- public AMQException(String msg, Throwable cause)
- {
- this(null, msg, cause);
- }
-
-
- /**
- * Gets the AMQ protocol exception code associated with this exception.
- *
- * @return The AMQ protocol exception code associated with this exception.
- */
- public AMQConstant getErrorCode()
- {
- return _errorCode;
- }
-
- public boolean isHardError()
- {
- return true;
- }
-
- /**
- * Rethrown this exception as a new exception.
- *
- * Attempt to create a new exception of the same class if they hav the default constructor of:
- * {AMQConstant.class, String.class, Throwable.class}
- *
- * Individual subclasses may override as requried to create a new instance.
- *
- */
- public AMQException cloneForCurrentThread()
- {
- Class amqeClass = this.getClass();
- Class<?>[] paramClasses = {AMQConstant.class, String.class, Throwable.class};
- Object[] params = {getErrorCode(), getMessage(), this};
-
- AMQException newAMQE;
-
- try
- {
- newAMQE = (AMQException) amqeClass.getConstructor(paramClasses).newInstance(params);
- }
- catch (Exception creationException)
- {
- newAMQE = new AMQException(getErrorCode(), getMessage(), this);
- }
-
- return newAMQE;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java
deleted file mode 100644
index baca2a4773..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java
+++ /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.
- *
- *
- */
-package org.apache.qpid;
-
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQInvalidArgumentException indicates that an invalid argument has been passed to an AMQP method.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents an error due to an invalid argument being passed to an AMQP method.
- * </table>
- */
-public class AMQInvalidArgumentException extends AMQException
-{
- public AMQInvalidArgumentException(String message, Throwable cause)
- {
- super(AMQConstant.INVALID_ARGUMENT, message, cause);
- }
-
- public boolean isHardError()
- {
- return false;
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java
deleted file mode 100644
index c117968a29..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java
+++ /dev/null
@@ -1,39 +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.
- *
- *
- */
-package org.apache.qpid;
-
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQInvalidRoutingKeyException indicates an error with a routing key having an invalid format.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents a format error in a routing key.
- * </table>
- */
-public class AMQInvalidRoutingKeyException extends AMQException
-{
- public AMQInvalidRoutingKeyException(String message, Throwable cause)
- {
- super(AMQConstant.INVALID_ROUTING_KEY, message, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQPInvalidClassException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQPInvalidClassException.java
deleted file mode 100644
index a0574efa72..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQPInvalidClassException.java
+++ /dev/null
@@ -1,39 +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.
- *
- *
- */
-package org.apache.qpid;
-
-/**
- * AMQPInvalidClassException indicates an error when trying to store an illegally typed argument in a field table.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents illegal argument type for field table values.
- * </table>
- *
- * @todo Could just re-use an exising exception like IllegalArgumentException or ClassCastException.
- */
-public class AMQPInvalidClassException extends RuntimeException
-{
- public AMQPInvalidClassException(String s)
- {
- super(s);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQProtocolException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQProtocolException.java
deleted file mode 100644
index bbc569839a..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQProtocolException.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.apache.qpid;
-
-import org.apache.qpid.protocol.AMQConstant;
-
-/* 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.
-*/
-
-public class AMQProtocolException extends AMQException
-{
- /**
- * Constructor for a Protocol Exception
- * <p> This is the only provided constructor and the parameters have to be
- * set to null when they are unknown.
- *
- * @param msg A description of the reason of this exception .
- * @param errorCode A string specifyin the error code of this exception.
- * @param cause The linked Execption.
- */
- public AMQProtocolException(AMQConstant errorCode, String msg, Throwable cause)
- {
- super(errorCode, msg, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java
deleted file mode 100644
index 4ae8282af5..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java
+++ /dev/null
@@ -1,39 +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.
- *
- *
- */
-package org.apache.qpid;
-
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQTimeoutException indicates that an expected response from a broker took too long.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Indicates that an expected response from a broker took too long.
- * </table>
- */
-public class AMQTimeoutException extends AMQException
-{
- public AMQTimeoutException(String message, Throwable cause)
- {
- super(AMQConstant.REQUEST_TIMEOUT, message, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java
deleted file mode 100644
index 01a569b693..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-package org.apache.qpid;
-
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQUndeliveredException indicates that a message, marked immediate or mandatory, could not be delivered.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents failure to delivery a message that must be delivered.
- * </table>
- */
-public class AMQUndeliveredException extends AMQException
-{
- private Object _bounced;
-
- public AMQUndeliveredException(AMQConstant errorCode, String msg, Object bounced, Throwable cause)
- {
- super(errorCode, msg, cause);
-
- _bounced = bounced;
- }
-
- public Object getUndeliveredMessage()
- {
- return _bounced;
- }
-
- public boolean isHardError()
- {
- return false;
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java
deleted file mode 100644
index 0eefc03016..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java
+++ /dev/null
@@ -1,43 +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.
- *
- */
-
-package org.apache.qpid;
-
-/**
- * AMQUnknownExchangeType represents coding error where unknown exchange type requested from exchange factory.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents unknown exchange type request.
- * <tr><td>
- *
- * @todo Not an AMQP exception as no status code.
- *
- * @todo Represent coding error, where unknown exchange type is requested by passing a string parameter. Use a type safe
- * enum for the exchange type, or replace with IllegalArgumentException. Should be runtime.
- */
-public class AMQUnknownExchangeType extends AMQException
-{
- public AMQUnknownExchangeType(String message, Throwable cause)
- {
- super(null, message, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java
deleted file mode 100644
index eee3e6afcf..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java
+++ /dev/null
@@ -1,50 +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.
- *
- */
-package org.apache.qpid;
-
-/**
- * AMQUnresolvedAddressException indicates failure to resolve a socket address.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents failre to resolve a socket address.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- *
- * @todo Why replace java.nio.UnresolvedAddressException with this? This is checked, which may explain why, but it
- * doesn't wrap the underlying exception.
- */
-public class AMQUnresolvedAddressException extends AMQException
-{
- String _broker;
-
- public AMQUnresolvedAddressException(String message, String broker, Throwable cause)
- {
- super(null, message, cause);
- _broker = broker;
- }
-
- public String toString()
- {
- return super.toString() + " Broker, \"" + _broker + "\"";
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/BrokerDetails.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/BrokerDetails.java
deleted file mode 100644
index 63f67a7857..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/BrokerDetails.java
+++ /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.
- */
-package org.apache.qpid;
-
-import java.util.Map;
-
-/**
- * This interface represents a broker and provides the basic information
- * required for opening a connection with a broker.
- */
-public interface BrokerDetails
-{
- /**
- * Those are the supported protocols
- */
- public static final String PROTOCOL_TCP = "tcp";
- public static final String PROTOCOL_TLS = "tls";
-
- public static final String VIRTUAL_HOST = "virtualhost";
- public static final String CLIENT_ID = "client_id";
- public static final String USERNAME = "username";
- public static final String PASSWORD = "password";
-
- /**
- * Get the broker host name.
- *
- * @return The broker host name.
- */
- public String getHost();
-
- /**
- * Get the broker port number.
- *
- * @return The broker port number.
- */
- public int getPort();
-
- /**
- * Get the virtual host to connect to.
- *
- * @return The virtual host of this broker.
- */
- public String getVirtualHost();
-
- /**
- * Get the user name.
- *
- * @return The user name
- */
- public String getUserName();
-
- /**
- * Get the user password
- *
- * @return The user password
- */
- public String getPassword();
-
- /**
- * Get the protocol used to connect to hise broker.
- *
- * @return the protocol used to connect to the broker.
- */
- public String getProtocol();
-
- /**
- * Set the broker host name.
- *
- * @param host The broker host name.
- */
- public void setHost(String host);
-
- /**
- * Set the broker port number.
- *
- * @param port The broker port number.
- */
- public void setPort(int port);
-
- /**
- * Set the virtual host to connect to.
- *
- * @param virtualHost The virtual host of this broker.
- */
- public void setVirtualHost(String virtualHost);
-
- /**
- * Set the user name.
- *
- * @param userName The user name
- */
- public void setUserName(String userName);
-
- /**
- * Set the user password
- *
- * @param password The user password
- */
- public void setPassword(String password);
-
- /**
- * Set the protocol used to connect to hise broker.
- *
- * @param protocol the protocol used to connect to the broker.
- */
- public void setProtocol(String protocol);
-
- /**
- * Ex: keystore path
- *
- * @return the Properties associated with this connection.
- */
- public Map<String,String> getProperties();
-
- /**
- * Sets the properties associated with this connection
- *
- * @param props the new p[roperties.
- */
- public void setProperties(Map<String,String> props);
-
- public void setProperty(String key,String value);
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/BrokerDetailsImpl.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/BrokerDetailsImpl.java
deleted file mode 100644
index 201d43e21f..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/BrokerDetailsImpl.java
+++ /dev/null
@@ -1,264 +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.
- */
-package org.apache.qpid;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Implements the interface BrokerDetails
- */
-public class BrokerDetailsImpl implements BrokerDetails
-{
- //--- Those are the default values
- private final String DEFAULT_USERNAME = "guest";
- private final String DEFAULT_PASSWORD = "guest";
- private final String DEFAULT_VIRTUALHOST = "";
-
- //---- The brker details
- private String _host;
- private int _port = 0;
- private String _virtualHost;
- private String _userName = DEFAULT_USERNAME;
- private String _password = DEFAULT_PASSWORD;
- private String _protocol;
- private Map<String, String> _props = new HashMap<String, String>();
- ;
-
- //--- Constructors
-
- public BrokerDetailsImpl()
- {
- }
-
- /**
- * Create a new broker details given all the reuqired information
- *
- * @param protocol The protocol used for this broker connection
- * @param host The host name.
- * @param port The port number.
- * @param virtualHost The virtual host.
- * @param userName The user name.
- * @param password The user password.
- */
- public BrokerDetailsImpl(String protocol, String host, int port, String virtualHost, String userName,
- String password, Map<String, String> props)
- {
- _protocol = protocol;
- _host = host;
- _port = port;
- _virtualHost = virtualHost;
- _userName = userName;
- _password = password;
- _props = props;
- }
-
- /**
- * Create a new broker details given the host name and the procol type,
- * default values are used for the other details.
- *
- * @param protocol The protocol used for this broker connection
- * @param host The host name.
- */
- public BrokerDetailsImpl(String protocol, String host)
- {
- _protocol = protocol;
- _host = host;
- _virtualHost = DEFAULT_VIRTUALHOST;
- _userName = DEFAULT_USERNAME;
- _password = DEFAULT_PASSWORD;
- }
-
- //--- API BrokerDetails
- /**
- * Get the user password
- *
- * @return The user password
- */
- public String getPassword()
- {
- return _password;
- }
-
- /**
- * Get the broker host name.
- *
- * @return The broker host name.
- */
- public String getHost()
- {
- return _host;
- }
-
- /**
- * Get the broker port number.
- *
- * @return The broker port number.
- */
- public int getPort()
- {
- if (_port == 0)
- {
- if (getProtocol().equals(BrokerDetails.PROTOCOL_TCP))
- {
- _port = 5672;
- }
- else if (getProtocol().equals(BrokerDetails.PROTOCOL_TLS))
- {
- _port = 5555;
- }
- }
- return _port;
- }
-
- /**
- * Get the virtual host to connect to.
- *
- * @return The virtual host of this broker.
- */
- public String getVirtualHost()
- {
- return _virtualHost;
- }
-
- /**
- * Get the user name.
- *
- * @return The user name
- */
- public String getUserName()
- {
- return _userName;
- }
-
- /**
- * Get the protocol used to connect to hise broker.
- *
- * @return the protocol used to connect to the broker.
- */
- public String getProtocol()
- {
- return _protocol;
- }
-
- /**
- * Set the broker host name.
- *
- * @param host The broker host name.
- */
- public void setHost(String host)
- {
- _host = host;
- }
-
- /**
- * Set the broker port number.
- *
- * @param port The broker port number.
- */
- public void setPort(int port)
- {
- _port = port;
- }
-
- /**
- * Set the virtual host to connect to.
- *
- * @param virtualHost The virtual host of this broker.
- */
- public void setVirtualHost(String virtualHost)
- {
- _virtualHost = virtualHost;
- }
-
- /**
- * Set the user name.
- *
- * @param userName The user name
- */
- public void setUserName(String userName)
- {
- _userName = userName;
- }
-
- /**
- * Set the user password
- *
- * @param password The user password
- */
- public void setPassword(String password)
- {
- _password = password;
- }
-
- /**
- * Set the protocol used to connect to hise broker.
- *
- * @param protocol the protocol used to connect to the broker.
- */
- public void setProtocol(String protocol)
- {
- _protocol = protocol;
- }
-
- /**
- * Ex: keystore path
- *
- * @return the Properties associated with this connection.
- */
- public Map<String, String> getProperties()
- {
- return _props;
- }
-
- /**
- * Sets the properties associated with this connection
- *
- * @param props
- */
- public void setProperties(Map<String, String> props)
- {
- _props = props;
- }
-
- public void setProperty(String key, String value)
- {
- _props.put(key, value);
- }
-
- public String toString()
- {
- StringBuilder b = new StringBuilder();
- b.append("[username=" + _userName);
- b.append(",password=" + _password);
- b.append(",transport=" + _protocol);
- b.append(",host=" + _host);
- b.append(",port=" + getPort() + "]");
- b.append(" - Properties[");
- if (_props != null)
- {
- for (String k : _props.keySet())
- {
- b.append(k + "=" + _props.get(k) + ",");
- }
- }
- b.append("]");
-
- return b.toString();
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java
deleted file mode 100644
index f17782ebf4..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ConsoleOutput.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-package org.apache.qpid;
-
-import java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.Sender;
-
-import static org.apache.qpid.transport.util.Functions.*;
-
-
-/**
- * ConsoleOutput
- *
- * @author Rafael H. Schloming
- */
-
-public class ConsoleOutput implements Sender<ByteBuffer>
-{
-
- public void send(ByteBuffer buf)
- {
- System.out.println(str(buf));
- }
-
- public void flush()
- {
- // pass
- }
-
- public void close()
- {
- System.out.println("CLOSED");
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ErrorCode.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ErrorCode.java
deleted file mode 100644
index 0549869e71..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ErrorCode.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.apache.qpid;
-/*
- *
- * 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.
- *
- */
-
-
-public enum ErrorCode
-{
- //Qpid specific - for the time being
- UNDEFINED(1,"undefined",true),
- MESSAGE_REJECTED(2,"message_rejected",true),
- CONNECTION_ERROR(3,"connection was closed",true),
- UNSUPPORTED_PROTOCOL(4, "protocol version is unsupported", true),
-
- //This might change in the spec, the error class is not applicable
- NO_ERROR(200,"reply-success",true),
-
- //From the spec
- CONTENT_TOO_LARGE(311,"content-too-large",false),
- NO_ROUTE(312,"no-route",false),
- NO_CONSUMERS(313,"content-consumers",false),
- CONNECTION_FORCED(320,"connection-forced",true),
- INVALID_PATH(402,"invalid-path",true),
- ACCESS_REFUSED(403,"access-refused",false),
- NOT_FOUND(404,"not-found",false),
- RESOURCE_LOCKED(405,"resource-locked",false),
- PRE_CONDITION_FAILED(406,"precondition-failed",false),
-
- FRAME_ERROR(501,"frame_error",true),
- SYNTAX_ERROR(502,"syntax_error",true),
- COMMAND_INVALID(503,"command_invalid",true),
- SESSION_ERROR(504,"sesion_error",true),
- NOT_ALLOWED(530,"not_allowed",true),
- NOT_IMPLEMENTED(540,"not_implemented",true),
- INTERNAL_ERROR(541,"internal_error",true),
- INVALID_ARGUMENT(542,"invalid_argument",true);
-
- private int _code;
- private String _desc;
- private boolean _hardError;
-
- private ErrorCode(int code,String desc,boolean hardError)
- {
- _code = code;
- _desc= desc;
- _hardError = hardError;
- }
-
- public int getCode()
- {
- return _code;
- }
-
- public String getDesc()
- {
- return _desc;
- }
-
- private boolean isHardError()
- {
- return _hardError;
- }
-
- public static ErrorCode get(int code)
- {
- switch(code)
- {
- case 200 : return NO_ERROR;
- case 311 : return CONTENT_TOO_LARGE;
- case 312 : return NO_ROUTE;
- case 313 : return NO_CONSUMERS;
- case 320 : return CONNECTION_FORCED;
- case 402 : return INVALID_PATH;
- case 403 : return ACCESS_REFUSED;
- case 404 : return NOT_FOUND;
- case 405 : return RESOURCE_LOCKED;
- case 406 : return PRE_CONDITION_FAILED;
- case 501 : return FRAME_ERROR;
- case 502 : return SYNTAX_ERROR;
- case 503 : return COMMAND_INVALID;
- case 504 : return SESSION_ERROR;
- case 530 : return NOT_ALLOWED;
- case 540 : return NOT_IMPLEMENTED;
- case 541 : return INTERNAL_ERROR;
- case 542 : return INVALID_ARGUMENT;
-
- default : return UNDEFINED;
- }
- }
- }
-
-/*
-
-<constant name="internal-error" value="541" class="hard-error">
-<doc>
- The server could not complete the method because of an internal error. The server may require
- intervention by an operator in order to resume normal operations.
-</doc>
-</constant>
-
-<constant name="invalid-argument" value="542" class="hard-error">
-<doc>
- An invalid or illegal argument was passed to a method, and the operation could not proceed.
-</doc>
-</constant>
-*/
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/QpidConfig.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/QpidConfig.java
deleted file mode 100644
index 9c8019f109..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/QpidConfig.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package org.apache.qpid;
-/*
- *
- * 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.
- *
- */
-
-
-/**
- * API to configure the Security parameters of the client.
- * The user can choose to pick the config from any source
- * and set it using this class.
- *
- */
-public class QpidConfig
-{
- private static QpidConfig _instance = new QpidConfig();
-
- private SecurityMechanism[] securityMechanisms =
- new SecurityMechanism[]{new SecurityMechanism("PLAIN","org.apache.qpid.security.UsernamePasswordCallbackHandler"),
- new SecurityMechanism("CRAM_MD5","org.apache.qpid.security.UsernamePasswordCallbackHandler")};
-
- private SaslClientFactory[] saslClientFactories =
- new SaslClientFactory[]{new SaslClientFactory("AMQPLAIN","org.apache.qpid.security.amqplain.AmqPlainSaslClientFactory")};
-
- private QpidConfig(){}
-
- public static QpidConfig get()
- {
- return _instance;
- }
-
- public void setSecurityMechanisms(SecurityMechanism... securityMechanisms)
- {
- this.securityMechanisms = securityMechanisms;
- }
-
- public SecurityMechanism[] getSecurityMechanisms()
- {
- return securityMechanisms;
- }
-
- public void setSaslClientFactories(SaslClientFactory... saslClientFactories)
- {
- this.saslClientFactories = saslClientFactories;
- }
-
- public SaslClientFactory[] getSaslClientFactories()
- {
- return saslClientFactories;
- }
-
- public class SecurityMechanism
- {
- String type;
- String handler;
-
- SecurityMechanism(String type,String handler)
- {
- this.type = type;
- this.handler = handler;
- }
-
- public String getHandler()
- {
- return handler;
- }
-
- public String getType()
- {
- return type;
- }
- }
-
- public class SaslClientFactory
- {
- String type;
- String factoryClass;
-
- SaslClientFactory(String type,String factoryClass)
- {
- this.type = type;
- this.factoryClass = factoryClass;
- }
-
- public String getFactoryClass()
- {
- return factoryClass;
- }
-
- public String getType()
- {
- return type;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/QpidException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/QpidException.java
deleted file mode 100644
index 8503adaef8..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/QpidException.java
+++ /dev/null
@@ -1,58 +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.
- */
-package org.apache.qpid;
-
-public class QpidException extends Exception
-{
- /**
- * AMQP error code
- */
- private ErrorCode _errorCode;
-
- /**
- * Constructor for a Qpid Exception.
- * <p> This is the only provided constructor and the parameters have to be set to null when
- * they are unknown.
- * @param message A description of the reason of this exception .
- * @param errorCode A string specifyin the error code of this exception.
- * @param cause The linked Execption. *
- *
- */
- public QpidException(String message, ErrorCode errorCode, Throwable cause)
- {
- super(message, cause);
- _errorCode = errorCode;
- }
-
- /*hack to get rid of a compile error from a generated class
- public QpidException(String message, String errorCode, Throwable cause)
- {
-
- }*/
-
- /**
- * Get this execption error code.
- *
- * @return This exception error code.
- */
- public ErrorCode getErrorCode()
- {
- return _errorCode;
- }
-}
-
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/SecurityHelper.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/SecurityHelper.java
deleted file mode 100644
index dda5a6506d..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/SecurityHelper.java
+++ /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.
- *
- */
-package org.apache.qpid;
-
-import java.io.UnsupportedEncodingException;
-import java.util.HashSet;
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.apache.qpid.security.AMQPCallbackHandler;
-import org.apache.qpid.security.CallbackHandlerRegistry;
-
-public class SecurityHelper
-{
- public static String chooseMechanism(List<Object> mechanisms) throws UnsupportedEncodingException
- {
- HashSet mechanismSet = new HashSet();
- for (Object m : mechanisms)
- {
- mechanismSet.add(m);
- }
-
- String preferredMechanisms = CallbackHandlerRegistry.getInstance().getMechanisms();
- StringTokenizer prefTokenizer = new StringTokenizer(preferredMechanisms, " ");
- while (prefTokenizer.hasMoreTokens())
- {
- String mech = prefTokenizer.nextToken();
- if (mechanismSet.contains(mech))
- {
- return mech;
- }
- }
- return null;
- }
-
- public static AMQPCallbackHandler createCallbackHandler(String mechanism, String username,String password)
- throws QpidException
- {
- Class mechanismClass = CallbackHandlerRegistry.getInstance().getCallbackHandlerClass(mechanism);
- try
- {
- Object instance = mechanismClass.newInstance();
- AMQPCallbackHandler cbh = (AMQPCallbackHandler) instance;
- cbh.initialise(username,password);
- return cbh;
- }
- catch (Exception e)
- {
- throw new QpidException("Unable to create callback handler: " + e,ErrorCode.UNDEFINED, e.getCause());
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/SerialException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/SerialException.java
deleted file mode 100644
index c59a6af779..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/SerialException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.apache.qpid;
-/*
- *
- * 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 exception is used by the serial class (imp RFC 1982)
- *
- */
-public class SerialException extends ArithmeticException
-{
- /**
- * Constructs an <code>SerialException</code> with the specified
- * detail message.
- *
- * @param message The exception message.
- */
- public SerialException(String message)
- {
- super(message);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyBroker.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyBroker.java
deleted file mode 100644
index db84b83adb..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyBroker.java
+++ /dev/null
@@ -1,188 +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.
- *
- */
-package org.apache.qpid;
-
-import org.apache.qpid.transport.*;
-import org.apache.qpid.transport.network.mina.MinaHandler;
-
-import static org.apache.qpid.transport.util.Functions.str;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.LinkedBlockingQueue;
-
-
-/**
- * ToyBroker
- *
- * @author Rafael H. Schloming
- */
-
-class ToyBroker extends SessionDelegate
-{
-
- private ToyExchange exchange;
- private Map<String,Consumer> consumers = new ConcurrentHashMap<String,Consumer>();
-
- public ToyBroker(ToyExchange exchange)
- {
- this.exchange = exchange;
- }
-
- public void messageAcquire(Session context, MessageAcquire struct)
- {
- System.out.println("\n==================> messageAcquire " );
- context.executionResult((int) struct.getId(), new Acquired(struct.getTransfers()));
- }
-
- @Override public void queueDeclare(Session ssn, QueueDeclare qd)
- {
- exchange.createQueue(qd.getQueue());
- System.out.println("\n==================> declared queue: " + qd.getQueue() + "\n");
- }
-
- @Override public void exchangeBind(Session ssn, ExchangeBind qb)
- {
- exchange.bindQueue(qb.getExchange(), qb.getBindingKey(),qb.getQueue());
- System.out.println("\n==================> bound queue: " + qb.getQueue() + " with binding key " + qb.getBindingKey() + "\n");
- }
-
- @Override public void queueQuery(Session ssn, QueueQuery qq)
- {
- QueueQueryResult result = new QueueQueryResult().queue(qq.getQueue());
- ssn.executionResult((int) qq.getId(), result);
- }
-
- @Override public void messageSubscribe(Session ssn, MessageSubscribe ms)
- {
- Consumer c = new Consumer();
- c._queueName = ms.getQueue();
- consumers.put(ms.getDestination(),c);
- System.out.println("\n==================> message subscribe : " + ms.getDestination() + " queue: " + ms.getQueue() + "\n");
- }
-
- @Override public void messageFlow(Session ssn,MessageFlow struct)
- {
- Consumer c = consumers.get(struct.getDestination());
- c._credit = struct.getValue();
- System.out.println("\n==================> message flow : " + struct.getDestination() + " credit: " + struct.getValue() + "\n");
- }
-
- @Override public void messageFlush(Session ssn,MessageFlush struct)
- {
- System.out.println("\n==================> message flush for consumer : " + struct.getDestination() + "\n");
- checkAndSendMessagesToConsumer(ssn,struct.getDestination());
- }
-
- @Override public void messageTransfer(Session ssn, MessageTransfer xfr)
- {
- String dest = xfr.getDestination();
- System.out.println("received transfer " + dest);
- Header header = xfr.getHeader();
- DeliveryProperties props = header.get(DeliveryProperties.class);
- if (props != null)
- {
- System.out.println("received headers routing_key " + props.getRoutingKey());
- }
- MessageProperties mp = header.get(MessageProperties.class);
- System.out.println("MP: " + mp);
- if (mp != null)
- {
- System.out.println(mp.getApplicationHeaders());
- }
-
- if (exchange.route(dest,props.getRoutingKey(),xfr))
- {
- System.out.println("queued " + xfr);
- dispatchMessages(ssn);
- }
- else
- {
-
- if (props == null || !props.getDiscardUnroutable())
- {
- RangeSet ranges = new RangeSet();
- ranges.add(xfr.getId());
- ssn.messageReject(ranges, MessageRejectCode.UNROUTABLE,
- "no such destination");
- }
- }
- ssn.processed(xfr);
- }
-
- private void transferMessageToPeer(Session ssn,String dest, MessageTransfer m)
- {
- System.out.println("\n==================> Transfering message to: " +dest + "\n");
- ssn.messageTransfer(m.getDestination(), MessageAcceptMode.EXPLICIT,
- MessageAcquireMode.PRE_ACQUIRED,
- m.getHeader(), m.getBody());
- }
-
- private void dispatchMessages(Session ssn)
- {
- for (String dest: consumers.keySet())
- {
- checkAndSendMessagesToConsumer(ssn,dest);
- }
- }
-
- private void checkAndSendMessagesToConsumer(Session ssn,String dest)
- {
- Consumer c = consumers.get(dest);
- LinkedBlockingQueue<MessageTransfer> queue = exchange.getQueue(c._queueName);
- MessageTransfer m = queue.poll();
- while (m != null && c._credit>0)
- {
- transferMessageToPeer(ssn,dest,m);
- c._credit--;
- m = queue.poll();
- }
- }
-
- // ugly, but who cares :)
- // assumes unit is always no of messages, not bytes
- // assumes it's credit mode and not window
- private class Consumer
- {
- long _credit;
- String _queueName;
- }
-
- public static final void main(String[] args) throws IOException
- {
- final ToyExchange exchange = new ToyExchange();
- ConnectionDelegate delegate = new ServerDelegate()
- {
- public SessionDelegate getSessionDelegate()
- {
- return new ToyBroker(exchange);
- }
- };
-
- MinaHandler.accept("0.0.0.0", 5672, delegate);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyClient.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyClient.java
deleted file mode 100644
index 3491af8cd2..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyClient.java
+++ /dev/null
@@ -1,106 +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.
- *
- */
-package org.apache.qpid;
-
-import java.nio.*;
-import java.util.*;
-
-import org.apache.qpid.transport.*;
-import org.apache.qpid.transport.network.mina.MinaHandler;
-
-
-/**
- * ToyClient
- *
- * @author Rafael H. Schloming
- */
-
-class ToyClient implements SessionListener
-{
- public void opened(Session ssn) {}
-
- public void exception(Session ssn, SessionException exc)
- {
- exc.printStackTrace();
- }
-
- public void message(Session ssn, MessageTransfer xfr)
- {
- System.out.println("msg: " + xfr);
- }
-
- public void closed(Session ssn) {}
-
- public static final void main(String[] args)
- {
- Connection conn = new Connection();
- conn.connect("0.0.0.0", 5672, null, "guest", "guest", false);
- Session ssn = conn.createSession();
- ssn.setSessionListener(new ToyClient());
-
- ssn.queueDeclare("asdf", null, null);
- ssn.sync();
-
- Map<String,Object> nested = new LinkedHashMap<String,Object>();
- nested.put("list", Arrays.asList("one", "two", "three"));
- Map<String,Object> map = new LinkedHashMap<String,Object>();
-
- map.put("str", "this is a string");
-
- map.put("+int", 3);
- map.put("-int", -3);
- map.put("maxint", Integer.MAX_VALUE);
- map.put("minint", Integer.MIN_VALUE);
-
- map.put("+short", (short) 1);
- map.put("-short", (short) -1);
- map.put("maxshort", (short) Short.MAX_VALUE);
- map.put("minshort", (short) Short.MIN_VALUE);
-
- map.put("float", (float) 3.3);
- map.put("double", 4.9);
- map.put("char", 'c');
-
- map.put("table", nested);
- map.put("list", Arrays.asList(1, 2, 3));
- map.put("binary", new byte[] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10});
-
- ssn.messageTransfer("asdf", MessageAcceptMode.EXPLICIT,
- MessageAcquireMode.PRE_ACQUIRED,
- new Header(new DeliveryProperties(),
- new MessageProperties()
- .setApplicationHeaders(map)),
- "this is the data");
-
- ssn.messageTransfer("fdsa", MessageAcceptMode.EXPLICIT,
- MessageAcquireMode.PRE_ACQUIRED,
- null,
- "this should be rejected");
- ssn.sync();
-
- Future<QueueQueryResult> future = ssn.queueQuery("asdf");
- System.out.println(future.get().getQueue());
- ssn.sync();
- ssn.close();
- conn.close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyExchange.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyExchange.java
deleted file mode 100644
index da6aed9629..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ToyExchange.java
+++ /dev/null
@@ -1,154 +0,0 @@
-package org.apache.qpid;
-/*
- *
- * 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 java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.qpid.transport.MessageTransfer;
-
-
-public class ToyExchange
-{
- final static String DIRECT = "amq.direct";
- final static String TOPIC = "amq.topic";
-
- private Map<String,List<LinkedBlockingQueue<MessageTransfer>>> directEx = new HashMap<String,List<LinkedBlockingQueue<MessageTransfer>>>();
- private Map<String,List<LinkedBlockingQueue<MessageTransfer>>> topicEx = new HashMap<String,List<LinkedBlockingQueue<MessageTransfer>>>();
- private Map<String,LinkedBlockingQueue<MessageTransfer>> queues = new HashMap<String,LinkedBlockingQueue<MessageTransfer>>();
-
- public void createQueue(String name)
- {
- queues.put(name, new LinkedBlockingQueue<MessageTransfer>());
- }
-
- public LinkedBlockingQueue<MessageTransfer> getQueue(String name)
- {
- return queues.get(name);
- }
-
- public void bindQueue(String type,String binding,String queueName)
- {
- LinkedBlockingQueue<MessageTransfer> queue = queues.get(queueName);
- binding = normalizeKey(binding);
- if(DIRECT.equals(type))
- {
-
- if (directEx.containsKey(binding))
- {
- List<LinkedBlockingQueue<MessageTransfer>> list = directEx.get(binding);
- list.add(queue);
- }
- else
- {
- List<LinkedBlockingQueue<MessageTransfer>> list = new LinkedList<LinkedBlockingQueue<MessageTransfer>>();
- list.add(queue);
- directEx.put(binding,list);
- }
- }
- else
- {
- if (topicEx.containsKey(binding))
- {
- List<LinkedBlockingQueue<MessageTransfer>> list = topicEx.get(binding);
- list.add(queue);
- }
- else
- {
- List<LinkedBlockingQueue<MessageTransfer>> list = new LinkedList<LinkedBlockingQueue<MessageTransfer>>();
- list.add(queue);
- topicEx.put(binding,list);
- }
- }
- }
-
- public boolean route(String dest, String routingKey, MessageTransfer msg)
- {
- List<LinkedBlockingQueue<MessageTransfer>> queues;
- if(DIRECT.equals(dest))
- {
- queues = directEx.get(routingKey);
- }
- else
- {
- queues = matchWildCard(routingKey);
- }
- if(queues != null && queues.size()>0)
- {
- System.out.println("Message stored in " + queues.size() + " queues");
- storeMessage(msg,queues);
- return true;
- }
- else
- {
- System.out.println("Message unroutable " + msg);
- return false;
- }
- }
-
- private String normalizeKey(String routingKey)
- {
- if(routingKey.indexOf(".*")>1)
- {
- return routingKey.substring(0,routingKey.indexOf(".*"));
- }
- else
- {
- return routingKey;
- }
- }
-
- private List<LinkedBlockingQueue<MessageTransfer>> matchWildCard(String routingKey)
- {
- List<LinkedBlockingQueue<MessageTransfer>> selected = new ArrayList<LinkedBlockingQueue<MessageTransfer>>();
-
- for(String key: topicEx.keySet())
- {
- Pattern p = Pattern.compile(key);
- Matcher m = p.matcher(routingKey);
- if (m.find())
- {
- for(LinkedBlockingQueue<MessageTransfer> queue : topicEx.get(key))
- {
- selected.add(queue);
- }
- }
- }
-
- return selected;
- }
-
- private void storeMessage(MessageTransfer msg,List<LinkedBlockingQueue<MessageTransfer>> selected)
- {
- for(LinkedBlockingQueue<MessageTransfer> queue : selected)
- {
- queue.offer(msg);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/api/Message.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/api/Message.java
deleted file mode 100644
index df6f279026..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/api/Message.java
+++ /dev/null
@@ -1,126 +0,0 @@
-package org.apache.qpid.api;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.MessageProperties;
-import org.apache.qpid.transport.DeliveryProperties;
-import org.apache.qpid.transport.Header;
-
-/*
- * 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.
- */
-
-public interface Message
-{
- public Header getHeader();
-
- public void setHeader(Header header);
-
- public MessageProperties getMessageProperties();
-
- public DeliveryProperties getDeliveryProperties();
-
- /**
- * This will abstract the underlying message data.
- * The Message implementation may not hold all message
- * data in memory (especially in the case of large messages)
- *
- * The appendData function might write data to
- * <ul>
- * <li> Memory (Ex: ByteBuffer)
- * <li> To Disk
- * <li> To Socket (Stream)
- * </ul>
- * @param src - the data to append
- */
- public void appendData(byte[] src) throws IOException;
-
-
- /**
- * This will abstract the underlying message data.
- * The Message implementation may not hold all message
- * data in memory (especially in the case of large messages)
- *
- * The appendData function might write data to
- * <ul>
- * <li> Memory (Ex: ByteBuffer)
- * <li> To Disk
- * <li> To Socket (Stream)
- * </ul>
- * @param src - the data to append
- */
- public void appendData(ByteBuffer src) throws IOException;
-
- /**
- * This will abstract the underlying message data.
- * The Message implementation may not hold all message
- * data in memory (especially in the case of large messages)
- *
- * The read function might copy data from
- * <ul>
- * <li> From memory (Ex: ByteBuffer)
- * <li> From Disk
- * <li> From Socket as and when it gets streamed
- * </ul>
- * @param target The target byte[] which the data gets copied to
- */
- public void readData(byte[] target) throws IOException;
-
- /**
- * * This will abstract the underlying message data.
- * The Message implementation may not hold all message
- * data in memory (especially in the case of large messages)
- *
- * The read function might copy data from
- * <ul>
- * <li> From memory (Ex: ByteBuffer)
- * <li> From Disk
- * <li> From Socket as and when it gets streamed
- * </ul>
- *
- * @return A ByteBuffer containing data
- * @throws IOException
- */
- public ByteBuffer readData() throws IOException;
-
- /**
- * This should clear the body of the message.
- */
- public void clearData();
-
- /**
- * The provides access to the command Id assigned to the
- * message transfer.
- * This id is useful when you do
- * <ul>
- * <li>For message acquiring - If the transfer happend in no-acquire mode
- * you could use this id to accquire it.
- * <li>For releasing a message. You can use this id to release an acquired
- * message
- * <li>For Acknowledging a message - You need to pass this ID, in order to
- * acknowledge the message
- * <li>For Rejecting a message - You need to pass this ID, in order to reject
- * the message.
- * </ul>
- *
- * @return the message transfer id.
- */
- public int getMessageTransferId();
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQCodecFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQCodecFactory.java
deleted file mode 100644
index fa890d0ebb..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQCodecFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.codec;
-
-import org.apache.mina.filter.codec.ProtocolCodecFactory;
-import org.apache.mina.filter.codec.ProtocolDecoder;
-import org.apache.mina.filter.codec.ProtocolEncoder;
-
-/**
- * AMQCodecFactory is a Mina codec factory. It supplies the encoders and decoders need to read and write the bytes to
- * the wire.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations.
- * <tr><td> Supply the protocol encoder. <td> {@link AMQEncoder}
- * <tr><td> Supply the protocol decoder. <td> {@link AMQDecoder}
- * </table>
- */
-public class AMQCodecFactory implements ProtocolCodecFactory
-{
- /** Holds the protocol encoder. */
- private final AMQEncoder _encoder = new AMQEncoder();
-
- /** Holds the protocol decoder. */
- private final AMQDecoder _frameDecoder;
-
- /**
- * Creates a new codec factory, specifiying whether it is expected that the first frame of data should be an
- * initiation. This is the case for the broker, which always expects to received the protocol initiation on a newly
- * connected client.
- *
- * @param expectProtocolInitiation <tt>true</tt> if the first frame received is going to be a protocol initiation
- * frame, <tt>false</tt> if it is going to be a standard AMQ data block.
- */
- public AMQCodecFactory(boolean expectProtocolInitiation)
- {
- _frameDecoder = new AMQDecoder(expectProtocolInitiation);
- }
-
- /**
- * Gets the AMQP encoder.
- *
- * @return The AMQP encoder.
- */
- public ProtocolEncoder getEncoder()
- {
- return _encoder;
- }
-
- /**
- * Gets the AMQP decoder.
- *
- * @return The AMQP decoder.
- */
- public ProtocolDecoder getDecoder()
- {
- return _frameDecoder;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java
deleted file mode 100644
index 7eef73f337..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java
+++ /dev/null
@@ -1,271 +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.
- *
- */
-package org.apache.qpid.codec;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.SimpleByteBufferAllocator;
-import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
-import org.apache.mina.filter.codec.ProtocolDecoderOutput;
-
-import org.apache.qpid.framing.AMQDataBlockDecoder;
-import org.apache.qpid.framing.ProtocolInitiation;
-
-/**
- * AMQDecoder delegates the decoding of AMQP either to a data block decoder, or in the case of new connections, to a
- * protocol initiation decoder. It is a cumulative decoder, which means that it can accumulate data to decode in the
- * buffer until there is enough data to decode.
- *
- * <p/>One instance of this class is created per session, so any changes or configuration done at run time to the
- * decoder will only affect decoding of the protocol session data to which is it bound.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Delegate protocol initiation to its decoder. <td> {@link ProtocolInitiation.Decoder}
- * <tr><td> Delegate AMQP data to its decoder. <td> {@link AMQDataBlockDecoder}
- * <tr><td> Accept notification that protocol initiation has completed.
- * </table>
- *
- * @todo If protocol initiation decoder not needed, then don't create it. Probably not a big deal, but it adds to the
- * per-session overhead.
- */
-public class AMQDecoder extends CumulativeProtocolDecoder
-{
-
- private static final String BUFFER = AMQDecoder.class.getName() + ".Buffer";
-
- /** Holds the 'normal' AMQP data decoder. */
- private AMQDataBlockDecoder _dataBlockDecoder = new AMQDataBlockDecoder();
-
- /** Holds the protocol initiation decoder. */
- private ProtocolInitiation.Decoder _piDecoder = new ProtocolInitiation.Decoder();
-
- /** Flag to indicate whether this decoder needs to handle protocol initiation. */
- private boolean _expectProtocolInitiation;
- private boolean firstDecode = true;
-
- /**
- * Creates a new AMQP decoder.
- *
- * @param expectProtocolInitiation <tt>true</tt> if this decoder needs to handle protocol initiation.
- */
- public AMQDecoder(boolean expectProtocolInitiation)
- {
- _expectProtocolInitiation = expectProtocolInitiation;
- }
-
- /**
- * Delegates decoding AMQP from the data buffer that Mina has retrieved from the wire, to the data or protocol
- * intiation decoders.
- *
- * @param session The Mina session.
- * @param in The raw byte buffer.
- * @param out The Mina object output gatherer to write decoded objects to.
- *
- * @return <tt>true</tt> if the data was decoded, <tt>false<tt> if more is needed and the data should accumulate.
- *
- * @throws Exception If the data cannot be decoded for any reason.
- */
- protected boolean doDecode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception
- {
-
- boolean decoded;
- if (_expectProtocolInitiation
- || (firstDecode
- && (in.remaining() > 0)
- && (in.get(in.position()) == (byte)'A')))
- {
- decoded = doDecodePI(session, in, out);
- }
- else
- {
- decoded = doDecodeDataBlock(session, in, out);
- }
- if(firstDecode && decoded)
- {
- firstDecode = false;
- }
- return decoded;
- }
-
- /**
- * Decodes AMQP data, delegating the decoding to an {@link AMQDataBlockDecoder}.
- *
- * @param session The Mina session.
- * @param in The raw byte buffer.
- * @param out The Mina object output gatherer to write decoded objects to.
- *
- * @return <tt>true</tt> if the data was decoded, <tt>false<tt> if more is needed and the data should accumulate.
- *
- * @throws Exception If the data cannot be decoded for any reason.
- */
- protected boolean doDecodeDataBlock(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception
- {
- int pos = in.position();
- boolean enoughData = _dataBlockDecoder.decodable(session, in);
- in.position(pos);
- if (!enoughData)
- {
- // returning false means it will leave the contents in the buffer and
- // call us again when more data has been read
- return false;
- }
- else
- {
- _dataBlockDecoder.decode(session, in, out);
-
- return true;
- }
- }
-
- /**
- * Decodes an AMQP initiation, delegating the decoding to a {@link ProtocolInitiation.Decoder}.
- *
- * @param session The Mina session.
- * @param in The raw byte buffer.
- * @param out The Mina object output gatherer to write decoded objects to.
- *
- * @return <tt>true</tt> if the data was decoded, <tt>false<tt> if more is needed and the data should accumulate.
- *
- * @throws Exception If the data cannot be decoded for any reason.
- */
- private boolean doDecodePI(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception
- {
- boolean enoughData = _piDecoder.decodable(session, in);
- if (!enoughData)
- {
- // returning false means it will leave the contents in the buffer and
- // call us again when more data has been read
- return false;
- }
- else
- {
- _piDecoder.decode(session, in, out);
-
- return true;
- }
- }
-
- /**
- * Sets the protocol initation flag, that determines whether decoding is handled by the data decoder of the protocol
- * initation decoder. This method is expected to be called with <tt>false</tt> once protocol initation completes.
- *
- * @param expectProtocolInitiation <tt>true</tt> to use the protocol initiation decoder, <tt>false</tt> to use the
- * data decoder.
- */
- public void setExpectProtocolInitiation(boolean expectProtocolInitiation)
- {
- _expectProtocolInitiation = expectProtocolInitiation;
- }
-
-
- /**
- * Cumulates content of <tt>in</tt> into internal buffer and forwards
- * decoding request to {@link #doDecode(IoSession, ByteBuffer, ProtocolDecoderOutput)}.
- * <tt>doDecode()</tt> is invoked repeatedly until it returns <tt>false</tt>
- * and the cumulative buffer is compacted after decoding ends.
- *
- * @throws IllegalStateException if your <tt>doDecode()</tt> returned
- * <tt>true</tt> not consuming the cumulative buffer.
- */
- public void decode( IoSession session, ByteBuffer in,
- ProtocolDecoderOutput out ) throws Exception
- {
- ByteBuffer buf = ( ByteBuffer ) session.getAttribute( BUFFER );
- // if we have a session buffer, append data to that otherwise
- // use the buffer read from the network directly
- if( buf != null )
- {
- buf.put( in );
- buf.flip();
- }
- else
- {
- buf = in;
- }
-
- for( ;; )
- {
- int oldPos = buf.position();
- boolean decoded = doDecode( session, buf, out );
- if( decoded )
- {
- if( buf.position() == oldPos )
- {
- throw new IllegalStateException(
- "doDecode() can't return true when buffer is not consumed." );
- }
-
- if( !buf.hasRemaining() )
- {
- break;
- }
- }
- else
- {
- break;
- }
- }
-
- // if there is any data left that cannot be decoded, we store
- // it in a buffer in the session and next time this decoder is
- // invoked the session buffer gets appended to
- if ( buf.hasRemaining() )
- {
- storeRemainingInSession( buf, session );
- }
- else
- {
- removeSessionBuffer( session );
- }
- }
-
- /**
- * Releases the cumulative buffer used by the specified <tt>session</tt>.
- * Please don't forget to call <tt>super.dispose( session )</tt> when
- * you override this method.
- */
- public void dispose( IoSession session ) throws Exception
- {
- removeSessionBuffer( session );
- }
-
- private void removeSessionBuffer(IoSession session)
- {
- ByteBuffer buf = ( ByteBuffer ) session.getAttribute( BUFFER );
- if( buf != null )
- {
- buf.release();
- session.removeAttribute( BUFFER );
- }
- }
-
- private static final SimpleByteBufferAllocator SIMPLE_BYTE_BUFFER_ALLOCATOR = new SimpleByteBufferAllocator();
-
- private void storeRemainingInSession(ByteBuffer buf, IoSession session)
- {
- ByteBuffer remainingBuf = SIMPLE_BYTE_BUFFER_ALLOCATOR.allocate( buf.remaining(), false );
- remainingBuf.setAutoExpand( true );
- remainingBuf.put( buf );
- session.setAttribute( BUFFER, remainingBuf );
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQEncoder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQEncoder.java
deleted file mode 100644
index 53f48ae1c8..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/codec/AMQEncoder.java
+++ /dev/null
@@ -1,66 +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.
- *
- */
-package org.apache.qpid.codec;
-
-import org.apache.mina.common.IoSession;
-import org.apache.mina.filter.codec.ProtocolEncoder;
-import org.apache.mina.filter.codec.ProtocolEncoderOutput;
-
-import org.apache.qpid.framing.AMQDataBlockEncoder;
-
-/**
- * AMQEncoder delegates encoding of AMQP to a data encoder.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Delegate AMQP encoding. <td> {@link AMQDataBlockEncoder}
- * </table>
- *
- * @todo This class just delegates to another, so seems to be pointless. Unless it is going to handle some
- * responsibilities in the future, then drop it.
- */
-public class AMQEncoder implements ProtocolEncoder
-{
- /** The data encoder that is delegated to. */
- private AMQDataBlockEncoder _dataBlockEncoder = new AMQDataBlockEncoder();
-
- /**
- * Encodes AMQP.
- *
- * @param session The Mina session.
- * @param message The data object to encode.
- * @param out The Mina writer to output the raw byte data to.
- *
- * @throws Exception If the data cannot be encoded for any reason.
- */
- public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception
- {
- _dataBlockEncoder.encode(session, message, out);
- }
-
- /**
- * Does nothing. Called by Mina to allow this to clean up resources when it is no longer needed.
- *
- * @param session The Mina session.
- */
- public void dispose(IoSession session)
- { }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/AMQPFilterTypes.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/AMQPFilterTypes.java
deleted file mode 100644
index 9ed915cc35..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/AMQPFilterTypes.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.common;
-
-import org.apache.qpid.framing.AMQShortString;
-
-/**
- * Specifies the different filter types for consumers that filter their messages.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent different consumer filter types.
- * </table>
- */
-public enum AMQPFilterTypes
-{
- JMS_SELECTOR("x-filter-jms-selector"),
- NO_CONSUME("x-filter-no-consume"),
- AUTO_CLOSE("x-filter-auto-close");
-
- /** The identifying string for the filter type. */
- private final AMQShortString _value;
-
- /**
- * Creates a new filter type from its identifying string.
- *
- * @param value The identifying string.
- */
- AMQPFilterTypes(String value)
- {
- _value = new AMQShortString(value);
- }
-
- /**
- * Gets the identifying string of the filter type.
- *
- * @return The identifying string of the filter type.
- */
- public AMQShortString getValue()
- {
- return _value;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/ClientProperties.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/ClientProperties.java
deleted file mode 100644
index 7371c12519..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/ClientProperties.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.common;
-
-import org.apache.qpid.framing.AMQShortString;
-
-/**
- * Specifies the available client property types that different clients can use to identify themselves with.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Specify the available client property types.
- * </table>
- */
-public enum ClientProperties
-{
- instance("instance"),
- product("product"),
- version("version"),
- platform("platform");
-
- private final AMQShortString _amqShortString;
-
- private ClientProperties(String name)
- {
- _amqShortString = new AMQShortString(name);
- }
-
-
- public AMQShortString toAMQShortString()
- {
- return _amqShortString;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java
deleted file mode 100644
index 2c783aeaa4..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.common;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * QpidProperties captures the project name, version number, and source code repository revision number from a properties
- * file which is generated as part of the build process. Normally, the name and version number are pulled from the module
- * name and version number of the Maven build POM, but could come from other sources if the build system is changed. The
- * idea behind this, is that every build has these values incorporated directly into its jar file, so that code in the
- * wild can be identified, should its origination be forgotten.
- *
- * <p/>To get the build version of any Qpid code call the {@link #main} method. This version string is usually also
- * printed to the console on broker start up.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><td>Load build versioning information into the runtime, for code identification purposes.
- * </table>
- *
- * @todo Code to locate/load/log properties can be factored into a reusable properties utils class. Avoid having this
- * same snippet of loading code scattered in many places.
- *
- * @todo Could also add a build number property for a sequential build number assigned by an automated build system, for
- * build reproducability purposes.
- */
-public class QpidProperties
-{
- /** Used for debugging purposes. */
- private static final Logger _logger = LoggerFactory.getLogger(QpidProperties.class);
-
- /** The name of the version properties file to load from the class path. */
- public static final String VERSION_RESOURCE = "qpidversion.properties";
-
- /** Defines the name of the product property. */
- public static final String PRODUCT_NAME_PROPERTY = "qpid.name";
-
- /** Defines the name of the version property. */
- public static final String RELEASE_VERSION_PROPERTY = "qpid.version";
-
- /** Defines the name of the source code revision property. */
- public static final String BUILD_VERSION_PROPERTY = "qpid.svnversion";
-
- /** Defines the default value for all properties that cannot be loaded. */
- private static final String DEFAULT = "unknown";
-
- /** Holds the product name. */
- private static String productName = DEFAULT;
-
- /** Holds the product version. */
- private static String releaseVersion = DEFAULT;
-
- /** Holds the source code revision. */
- private static String buildVersion = DEFAULT;
-
- // Loads the values from the version properties file.
- static
- {
- Properties props = new Properties();
-
- try
- {
- InputStream propertyStream = QpidProperties.class.getClassLoader().getResourceAsStream(VERSION_RESOURCE);
- if (propertyStream == null)
- {
- _logger.warn("Unable to find resource " + VERSION_RESOURCE + " from classloader");
- }
- else
- {
- props.load(propertyStream);
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Dumping QpidProperties");
- for (Map.Entry<Object, Object> entry : props.entrySet())
- {
- _logger.debug("Property: " + entry.getKey() + " Value: " + entry.getValue());
- }
-
- _logger.debug("End of property dump");
- }
-
- productName = readPropertyValue(props, PRODUCT_NAME_PROPERTY);
- releaseVersion = readPropertyValue(props, RELEASE_VERSION_PROPERTY);
- buildVersion = readPropertyValue(props, BUILD_VERSION_PROPERTY);
- }
- }
- catch (IOException e)
- {
- // Log a warning about this and leave the values initialized to unknown.
- _logger.error("Could not load version.properties resource: " + e, e);
- }
- }
-
- /**
- * Gets the product name.
- *
- * @return The product name.
- */
- public static String getProductName()
- {
- return productName;
- }
-
- /**
- * Gets the product version.
- *
- * @return The product version.
- */
- public static String getReleaseVersion()
- {
- return releaseVersion;
- }
-
- /**
- * Gets the source code revision.
- *
- * @return The source code revision.
- */
- public static String getBuildVersion()
- {
- return buildVersion;
- }
-
- /**
- * Extracts all of the version information as a printable string.
- *
- * @return All of the version information as a printable string.
- */
- public static String getVersionString()
- {
- return getProductName() + " - " + getReleaseVersion() + " build: " + getBuildVersion();
- }
-
- /**
- * Helper method to extract a named property from properties.
- *
- * @param props The properties.
- * @param propertyName The named property to extract.
- *
- * @return The extracted property or a default value if the properties do not contain the named property.
- *
- * @todo A bit pointless.
- */
- private static String readPropertyValue(Properties props, String propertyName)
- {
- String retVal = (String) props.get(propertyName);
- if (retVal == null)
- {
- retVal = DEFAULT;
- }
-
- return retVal;
- }
-
- /**
- * Prints the versioning information to the console. This is extremely usefull for identifying Qpid code in the
- * wild, where the origination of the code has been forgotten.
- *
- * @param args Does not require any arguments.
- */
- public static void main(String[] args)
- {
- System.out.println(getVersionString());
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/Configured.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/Configured.java
deleted file mode 100644
index 22903888fe..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/Configured.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.configuration;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Marks a field as having a "configured" value injected into it by a configurator.
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
-public @interface Configured
-{
- /**
- * The Commons Configuration path to the configuration element
- */
- String path();
-
- /**
- * The default value to use should the path not be found in the configuration source
- */
- String defaultValue();
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java
deleted file mode 100644
index 73a336321c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java
+++ /dev/null
@@ -1,43 +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.
- *
- */
-package org.apache.qpid.configuration;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * Indicates a failure to parse a property expansion. See {@link PropertyUtils} for the code that does property
- * expansions.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaboration
- * <tr><td> Represent failure to expand a property name into a value.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- */
-public class PropertyException extends AMQException
-{
- public PropertyException(String message, Throwable cause)
- {
- super(null, message, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyUtils.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyUtils.java
deleted file mode 100644
index 6e2b25fb2c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/configuration/PropertyUtils.java
+++ /dev/null
@@ -1,164 +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.
- *
- */
-package org.apache.qpid.configuration;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/**
- * PropertyUtils provides helper methods for dealing with Java properties.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Expand system properties into strings with named expansions.
- * </table>
- *
- * @todo Make the lookup method generic by passing in the properties to use for the expansion, rather than hard coding
- * as system properties. The expansion code has greater potential for re-use that way.
- *
- * @todo Some more property related code could be added to this utils class, which might more appropriately reside under
- * org.apache.qpid.util. For example standardised code to load properties from a resource name, currently found in
- * QpidProperties and possibly other places could be moved here.
- */
-public class PropertyUtils
-{
- /**
- * Given a string that contains substrings of the form <code>${xxx}</code>, looks up the valuea of 'xxx' as a
- * system properties and substitutes tham back into the original string, to provide a property value expanded
- * string.
- *
- * @param value The string to be scanned for property references. May be <code>null</code>, in which case this
- * method returns immediately with no effect.
- *
- * @return The original string with the properties replaced, or <code>null</code> if the original string is
- * <code>null</code>.
- *
- * @throws PropertyException If the string contains an opening <code>${</code> without a balancing <code>}</code>,
- * or if the property to expand does not exist as a system property.
- */
- public static String replaceProperties(String value) throws PropertyException
- {
- if (value == null)
- {
- return null;
- }
-
- ArrayList<String> fragments = new ArrayList<String>();
- ArrayList<String> propertyRefs = new ArrayList<String>();
- parsePropertyString(value, fragments, propertyRefs);
-
- StringBuffer sb = new StringBuffer();
- Iterator j = propertyRefs.iterator();
-
- for (String fragment : fragments)
- {
- if (fragment == null)
- {
- String propertyName = (String) j.next();
-
- // try to get it from the project or keys
- // Backward compatibility
- String replacement = System.getProperty(propertyName);
-
- if (replacement == null)
- {
- throw new PropertyException("Property ${" + propertyName + "} has not been set", null);
- }
-
- fragment = replacement;
- }
-
- sb.append(fragment);
- }
-
- return sb.toString();
- }
-
- /**
- * Parses the supplied value for properties which are specified using ${foo} syntax. $X is left as is, and $$
- * specifies a single $.
- *
- * @param value The property string to parse.
- * @param fragments Is populated with the string fragments. A null means "insert a property value here. The number
- * of nulls in the list when populated is equal to the size of the propertyRefs list.
- * @param propertyRefs Populated with the property names to be added into the final string.
- */
- private static void parsePropertyString(String value, ArrayList<String> fragments, ArrayList<String> propertyRefs)
- throws PropertyException
- {
- int prev = 0;
- int pos;
- // search for the next instance of $ from the 'prev' position
- while ((pos = value.indexOf("$", prev)) >= 0)
- {
-
- // if there was any text before this, add it as a fragment
- if (pos > 0)
- {
- fragments.add(value.substring(prev, pos));
- }
- // if we are at the end of the string, we tack on a $
- // then move past it
- if (pos == (value.length() - 1))
- {
- fragments.add("$");
- prev = pos + 1;
- }
- else if (value.charAt(pos + 1) != '{')
- {
- // peek ahead to see if the next char is a property or not
- // not a property: insert the char as a literal
- if (value.charAt(pos + 1) == '$')
- {
- // two $ map to one $
- fragments.add("$");
- prev = pos + 2;
- }
- else
- {
- // $X maps to $X for all values of X!='$'
- fragments.add(value.substring(pos, pos + 2));
- prev = pos + 2;
- }
- }
- else
- {
- // property found, extract its name or bail on a typo
- int endName = value.indexOf('}', pos);
- if (endName < 0)
- {
- throw new PropertyException("Syntax error in property: " + value, null);
- }
-
- String propertyName = value.substring(pos + 2, endName);
- fragments.add(null);
- propertyRefs.add(propertyName);
- prev = endName + 1;
- }
- }
- // no more $ signs found
- // if there is any tail to the file, append it
- if (prev < value.length())
- {
- fragments.add(value.substring(prev));
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java
deleted file mode 100644
index 49effc2dae..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/dtx/XidImpl.java
+++ /dev/null
@@ -1,250 +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.
- */
-package org.apache.qpid.dtx;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.qpid.QpidException;
-
-import javax.transaction.xa.Xid;
-
-import java.io.*;
-
-/**
- * Implements javax.transaction.dtx.Xid
- */
-public class XidImpl implements Xid
-{
- /**
- * this session's logger
- */
- private static final Logger _logger = LoggerFactory.getLogger(XidImpl.class);
-
- /**
- * the transaction branch identifier part of XID as an array of bytes
- */
- private byte[] _branchQualifier;
-
- /**
- * the format identifier part of the XID.
- */
- private int _formatID;
-
- /**
- * the global transaction identifier part of XID as an array of bytes.
- */
- private byte[] _globalTransactionID;
-
- //--- Constructors
-
- /**
- * Create new Xid.
- * this is an empty constructor.
- */
- public XidImpl()
- {
-
- }
-
- /**
- * Create a new XidImpl from an existing Xid.
- * <p> Usefull for casting external Xids
- *
- * @param xid Foreign Xid.
- */
- public XidImpl(Xid xid)
- {
- _branchQualifier = xid.getBranchQualifier();
- _formatID = xid.getFormatId();
- _globalTransactionID = xid.getGlobalTransactionId();
- }
-
- /**
- * Create a new Xid.
- *
- * @param branchQualifier The transaction branch identifier part of XID as an array of bytes.
- * @param format The format identifier part of the XID.
- * @param globalTransactionID The global transaction identifier part of XID as an array of bytes.
- */
- public XidImpl(byte[] branchQualifier, int format, byte[] globalTransactionID)
- {
- _branchQualifier = branchQualifier;
- _formatID = format;
- _globalTransactionID = globalTransactionID;
- }
-
- /**
- * Create a new Xid form its String form
- * 4 1 1 g b
- * +---+---+---+---+---+---+---+- -+---+---+- -+---+
- * | format_id | g | b | txn-id | br-id |
- * +---+---+---+---+---+---+---+- -+---+---+- -+---+
- * 0 4 5 6 6+g 6+g+b
- * format_id: an implementation specific format identifier
- * <p/>
- * gtrid_length: how many bytes of this form the transaction id
- * <p/>
- * bqual_length: how many bytes of this form the branch id
- * <p/>
- * data: a sequence of octets of at most 128 bytes containing the txn id and the
- * branch id
- * <p/>
- * Note - The sum of the two lengths must equal the length of the data field.
- *
- * @param xid an XID STring Form
- * @throws QpidException If the string does not represent a valid Xid
- */
- public XidImpl(String xid) throws QpidException
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("converting string " + xid + " into XidImpl");
- }
- try
- {
- DataInputStream input = new DataInputStream(new ByteArrayInputStream(xid.getBytes()));
- _formatID = (int) input.readLong();
- int g = input.readByte();
- int b = input.readByte();
- _globalTransactionID = new byte[g];
- _branchQualifier = new byte[b];
- if (input.read(_globalTransactionID, 0, g) != g)
- {
- throw new QpidException("Cannot convert the string " + xid + " into an Xid", null, null);
- }
- if (input.read(_branchQualifier, 0, b) != b)
- {
- throw new QpidException("Cannot convert the string " + xid + " into an Xid", null, null);
- }
- }
- catch (IOException e)
- {
- throw new QpidException("cannot convert the string " + xid + " into an Xid", null, e);
- }
- }
-
- //--- Xid interface implementation
-
- /**
- * Format identifier. O means the OSI CCR format.
- *
- * @return Global transaction identifier.
- */
- public byte[] getGlobalTransactionId()
- {
- return _globalTransactionID;
- }
-
- /**
- * Obtain the transaction branch identifier part of XID as an array of bytes.
- *
- * @return Branch identifier part of XID.
- */
- public byte[] getBranchQualifier()
- {
- return _branchQualifier;
- }
-
- /**
- * Obtain the format identifier part of the XID.
- *
- * @return Format identifier. O means the OSI CCR format.
- */
- public int getFormatId()
- {
- return _formatID;
- }
-
- //--- Object operations
-
- /**
- * Indicates whether some other Xid is "equal to" this one.
- * <p> Two Xids are equal if and only if their three elementary parts are equal
- *
- * @param o the object to compare this <code>XidImpl</code> against.
- * @return true if the <code>XidImpl</code> are equal, false otherwise.
- */
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
- if (o instanceof XidImpl)
- {
- XidImpl other = (XidImpl) o;
- if (_formatID == other.getFormatId())
- {
- if (_branchQualifier.length == other.getBranchQualifier().length)
- {
- for (int i = 0; i < _branchQualifier.length; i++)
- {
- if (_branchQualifier[i] != other.getBranchQualifier()[i])
- {
- return false;
- }
- }
- if (_globalTransactionID.length == other.getGlobalTransactionId().length)
- {
- for (int i = 0; i < _globalTransactionID.length; i++)
- {
- if (_globalTransactionID[i] != other.getGlobalTransactionId()[i])
- {
- return false;
- }
- }
- // everithing is equal
- return true;
- }
- }
- }
- }
- return false;
- }
-
- //-- Static helper method
- /**
- * Convert an Xid into the AMQP String format.
- *
- * 4 1 1 g b
- * +---+---+---+---+---+---+---+- -+---+---+- -+---+
- * | format_id | g | b | txn-id | br-id |
- * +---+---+---+---+---+---+---+- -+---+---+- -+---+
- * 0 4 5 6 6+g 6+g+b
- * format_id: an implementation specific format identifier
- * <p/>
- * gtrid_length: how many bytes of this form the transaction id
- * <p/>
- * bqual_length: how many bytes of this form the branch id
- * <p/>
- * data: a sequence of octets of at most 128 bytes containing the txn id and the
- * branch id
- * <p/>
- * Note - The sum of the two lengths must equal the length of the data field.
- *
- * @param xid an Xid to convert.
- * @return The String representation of this Xid
- * @throws QpidException In case of problem when converting this Xid into a string.
- */
- public static org.apache.qpid.transport.Xid convert(Xid xid) throws QpidException
- {
- return new org.apache.qpid.transport.Xid(xid.getFormatId(),
- xid.getGlobalTransactionId(),
- xid.getBranchQualifier());
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java
deleted file mode 100644
index 123901b577..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java
+++ /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.
- *
- */
-package org.apache.qpid.exchange;
-
-import org.apache.qpid.framing.AMQShortString;
-
-/**
- * Defines the names of the standard AMQP exchanges that every AMQP broker should provide. These exchange names
- * and type are given in the specification.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Defines the standard AMQP exchange names.
- * <tr><td> Defines the standard AMQP exchange types.
- * </table>
- *
- * @todo A type safe enum, might be more appropriate for the exchange types.
- */
-public class ExchangeDefaults
-{
- /** The default direct exchange, which is a special internal exchange that cannot be explicitly bound to. */
- public static final AMQShortString DEFAULT_EXCHANGE_NAME = new AMQShortString("<<default>>");
-
- /** The pre-defined topic exchange, the broker SHOULD provide this. */
- public static final AMQShortString TOPIC_EXCHANGE_NAME = new AMQShortString("amq.topic");
-
- /** Defines the identifying type name of topic exchanges. */
- public static final AMQShortString TOPIC_EXCHANGE_CLASS = new AMQShortString("topic");
-
- /** The pre-defined direct exchange, the broker MUST provide this. */
- public static final AMQShortString DIRECT_EXCHANGE_NAME = new AMQShortString("amq.direct");
-
- /** Defines the identifying type name of direct exchanges. */
- public static final AMQShortString DIRECT_EXCHANGE_CLASS = new AMQShortString("direct");
-
- /** The pre-defined headers exchange, the specification does not say this needs to be provided. */
- public static final AMQShortString HEADERS_EXCHANGE_NAME = new AMQShortString("amq.match");
-
- /** Defines the identifying type name of headers exchanges. */
- public static final AMQShortString HEADERS_EXCHANGE_CLASS = new AMQShortString("headers");
-
- /** The pre-defined fanout exchange, the boker MUST provide this. */
- public static final AMQShortString FANOUT_EXCHANGE_NAME = new AMQShortString("amq.fanout");
-
- /** Defines the identifying type name of fanout exchanges. */
- public static final AMQShortString FANOUT_EXCHANGE_CLASS = new AMQShortString("fanout");
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java
deleted file mode 100644
index fe04155bb8..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-import org.apache.qpid.AMQException;
-
-public interface AMQBody
-{
- public byte getFrameType();
-
- /**
- * Get the size of the body
- * @return unsigned short
- */
- public abstract int getSize();
-
- public void writePayload(ByteBuffer buffer);
-
- void handle(final int channelId, final AMQVersionAwareProtocolSession amqMinaProtocolSession) throws AMQException;
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.java
deleted file mode 100644
index a2fc3a03ef..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.java
+++ /dev/null
@@ -1,63 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-/**
- * A data block represents something that has a size in bytes and the ability to write itself to a byte
- * buffer (similar to a byte array).
- */
-public abstract class AMQDataBlock implements EncodableAMQDataBlock
-{
- /**
- * Get the size of buffer needed to store the byte representation of this
- * frame.
- * @return unsigned integer
- */
- public abstract long getSize();
-
- /**
- * Writes the datablock to the specified buffer.
- * @param buffer
- */
- public abstract void writePayload(ByteBuffer buffer);
-
- public ByteBuffer toByteBuffer()
- {
- final ByteBuffer buffer = ByteBuffer.allocate((int)getSize());
-
- writePayload(buffer);
- buffer.flip();
- return buffer;
- }
-
- public java.nio.ByteBuffer toNioByteBuffer()
- {
- final java.nio.ByteBuffer buffer = java.nio.ByteBuffer.allocate((int) getSize());
-
- ByteBuffer buf = ByteBuffer.wrap(buffer);
- writePayload(buf);
- buffer.flip();
- return buffer;
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java
deleted file mode 100644
index 82ffc60802..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java
+++ /dev/null
@@ -1,120 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.filter.codec.ProtocolDecoderOutput;
-
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AMQDataBlockDecoder
-{
- private static final String SESSION_METHOD_BODY_FACTORY = "QPID_SESSION_METHOD_BODY_FACTORY";
-
- private static final BodyFactory[] _bodiesSupported = new BodyFactory[Byte.MAX_VALUE];
-
- static
- {
- _bodiesSupported[ContentHeaderBody.TYPE] = ContentHeaderBodyFactory.getInstance();
- _bodiesSupported[ContentBody.TYPE] = ContentBodyFactory.getInstance();
- _bodiesSupported[HeartbeatBody.TYPE] = new HeartbeatBodyFactory();
- }
-
- Logger _logger = LoggerFactory.getLogger(AMQDataBlockDecoder.class);
-
- public AMQDataBlockDecoder()
- { }
-
- public boolean decodable(IoSession session, ByteBuffer in) throws AMQFrameDecodingException
- {
- final int remainingAfterAttributes = in.remaining() - (1 + 2 + 4 + 1);
- // type, channel, body length and end byte
- if (remainingAfterAttributes < 0)
- {
- return false;
- }
-
- in.skip(1 + 2);
- final long bodySize = in.getUnsignedInt();
-
- return (remainingAfterAttributes >= bodySize);
-
- }
-
- protected Object createAndPopulateFrame(IoSession session, ByteBuffer in)
- throws AMQFrameDecodingException, AMQProtocolVersionException
- {
- final byte type = in.get();
-
- BodyFactory bodyFactory;
- if (type == AMQMethodBody.TYPE)
- {
- bodyFactory = (BodyFactory) session.getAttribute(SESSION_METHOD_BODY_FACTORY);
- if (bodyFactory == null)
- {
- AMQVersionAwareProtocolSession protocolSession = (AMQVersionAwareProtocolSession) session.getAttachment();
- bodyFactory = new AMQMethodBodyFactory(protocolSession);
- session.setAttribute(SESSION_METHOD_BODY_FACTORY, bodyFactory);
-
- }
-
- }
- else
- {
- bodyFactory = _bodiesSupported[type];
- }
-
- if (bodyFactory == null)
- {
- throw new AMQFrameDecodingException(null, "Unsupported frame type: " + type, null);
- }
-
- final int channel = in.getUnsignedShort();
- final long bodySize = in.getUnsignedInt();
-
- // bodySize can be zero
- if ((channel < 0) || (bodySize < 0))
- {
- throw new AMQFrameDecodingException(null, "Undecodable frame: type = " + type + " channel = " + channel
- + " bodySize = " + bodySize, null);
- }
-
- AMQFrame frame = new AMQFrame(in, channel, bodySize, bodyFactory);
-
- byte marker = in.get();
- if ((marker & 0xFF) != 0xCE)
- {
- throw new AMQFrameDecodingException(null, "End of frame marker not found. Read " + marker + " length=" + bodySize
- + " type=" + type, null);
- }
-
- return frame;
- }
-
- public void decode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception
- {
- out.write(createAndPopulateFrame(session, in));
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockEncoder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockEncoder.java
deleted file mode 100644
index 05fd2bb480..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockEncoder.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.filter.codec.ProtocolEncoderOutput;
-import org.apache.mina.filter.codec.demux.MessageEncoder;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Collections;
-import java.util.Set;
-
-public final class AMQDataBlockEncoder implements MessageEncoder
-{
- private static final Logger _logger = LoggerFactory.getLogger(AMQDataBlockEncoder.class);
-
- private final Set _messageTypes = Collections.singleton(EncodableAMQDataBlock.class);
-
- public AMQDataBlockEncoder()
- { }
-
- public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception
- {
- final AMQDataBlock frame = (AMQDataBlock) message;
-
- final ByteBuffer buffer = frame.toByteBuffer();
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Encoded frame byte-buffer is '" + EncodingUtils.convertToHexString(buffer) + "'");
- }
-
- out.write(buffer);
- }
-
- public Set getMessageTypes()
- {
- return _messageTypes;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java
deleted file mode 100644
index 02a46f3748..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class AMQFrame extends AMQDataBlock implements EncodableAMQDataBlock
-{
- private final int _channel;
-
- private final AMQBody _bodyFrame;
- public static final byte FRAME_END_BYTE = (byte) 0xCE;
-
-
- public AMQFrame(final int channel, final AMQBody bodyFrame)
- {
- _channel = channel;
- _bodyFrame = bodyFrame;
- }
-
- public AMQFrame(final ByteBuffer in, final int channel, final long bodySize, final BodyFactory bodyFactory) throws AMQFrameDecodingException
- {
- this._channel = channel;
- this._bodyFrame = bodyFactory.createBody(in,bodySize);
- }
-
- public long getSize()
- {
- return 1 + 2 + 4 + _bodyFrame.getSize() + 1;
- }
-
- public static final int getFrameOverhead()
- {
- return 1 + 2 + 4 + 1;
- }
-
-
- public void writePayload(ByteBuffer buffer)
- {
- buffer.put(_bodyFrame.getFrameType());
- EncodingUtils.writeUnsignedShort(buffer, _channel);
- EncodingUtils.writeUnsignedInteger(buffer, _bodyFrame.getSize());
- _bodyFrame.writePayload(buffer);
- buffer.put(FRAME_END_BYTE);
- }
-
- public final int getChannel()
- {
- return _channel;
- }
-
- public final AMQBody getBodyFrame()
- {
- return _bodyFrame;
- }
-
- public String toString()
- {
- return "Frame channelId: " + _channel + ", bodyFrame: " + String.valueOf(_bodyFrame);
- }
-
- public static void writeFrame(ByteBuffer buffer, final int channel, AMQBody body)
- {
- buffer.put(body.getFrameType());
- EncodingUtils.writeUnsignedShort(buffer, channel);
- EncodingUtils.writeUnsignedInteger(buffer, body.getSize());
- body.writePayload(buffer);
- buffer.put(FRAME_END_BYTE);
-
- }
-
- public static void writeFrames(ByteBuffer buffer, final int channel, AMQBody body1, AMQBody body2)
- {
- buffer.put(body1.getFrameType());
- EncodingUtils.writeUnsignedShort(buffer, channel);
- EncodingUtils.writeUnsignedInteger(buffer, body1.getSize());
- body1.writePayload(buffer);
- buffer.put(FRAME_END_BYTE);
- buffer.put(body2.getFrameType());
- EncodingUtils.writeUnsignedShort(buffer, channel);
- EncodingUtils.writeUnsignedInteger(buffer, body2.getSize());
- body2.writePayload(buffer);
- buffer.put(FRAME_END_BYTE);
-
- }
-
- public static void writeFrames(ByteBuffer buffer, final int channel, AMQBody body1, AMQBody body2, AMQBody body3)
- {
- buffer.put(body1.getFrameType());
- EncodingUtils.writeUnsignedShort(buffer, channel);
- EncodingUtils.writeUnsignedInteger(buffer, body1.getSize());
- body1.writePayload(buffer);
- buffer.put(FRAME_END_BYTE);
- buffer.put(body2.getFrameType());
- EncodingUtils.writeUnsignedShort(buffer, channel);
- EncodingUtils.writeUnsignedInteger(buffer, body2.getSize());
- body2.writePayload(buffer);
- buffer.put(FRAME_END_BYTE);
- buffer.put(body3.getFrameType());
- EncodingUtils.writeUnsignedShort(buffer, channel);
- EncodingUtils.writeUnsignedInteger(buffer, body3.getSize());
- body3.writePayload(buffer);
- buffer.put(FRAME_END_BYTE);
-
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java
deleted file mode 100644
index 2373edb478..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java
+++ /dev/null
@@ -1,47 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * AMQFrameDecodingException indicates that an AMQP frame cannot be decoded because it does not have the correct
- * format as defined by the protocol.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents a format error in a protocol frame.
- * </table>
- */
-public class AMQFrameDecodingException extends AMQException
-{
- public AMQFrameDecodingException(AMQConstant errorCode, String message, Throwable cause)
- {
- super(errorCode, message, cause);
- }
-
- public AMQFrameDecodingException(AMQConstant errorCode, String message)
- {
- super(errorCode, message, null);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java
deleted file mode 100644
index 4763b22290..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQChannelException;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-
-public interface AMQMethodBody extends AMQBody
-{
- public static final byte TYPE = 1;
-
- /** AMQP version */
- public byte getMajor();
-
- public byte getMinor();
-
-
-
- /** @return unsigned short */
- public int getClazz();
-
- /** @return unsigned short */
- public int getMethod();
-
- public void writeMethodPayload(ByteBuffer buffer);
-
-
- public int getSize();
-
- public void writePayload(ByteBuffer buffer);
-
- //public abstract void populateMethodBodyFromBuffer(ByteBuffer buffer) throws AMQFrameDecodingException;
-
- //public void populateFromBuffer(ByteBuffer buffer, long size) throws AMQFrameDecodingException;
-
- public AMQFrame generateFrame(int channelId);
-
- public String toString();
-
-
-
- /**
- * Convenience Method to create a channel not found exception
- *
- * @param channelId The channel id that is not found
- *
- * @return new AMQChannelException
- */
- public AMQChannelException getChannelNotFoundException(int channelId);
-
- public AMQChannelException getChannelException(AMQConstant code, String message);
-
- public AMQChannelException getChannelException(AMQConstant code, String message, Throwable cause);
-
- public AMQConnectionException getConnectionException(AMQConstant code, String message);
-
-
- public AMQConnectionException getConnectionException(AMQConstant code, String message, Throwable cause);
-
-
- public boolean execute(MethodDispatcher methodDispatcher, int channelId) throws AMQException;
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java
deleted file mode 100644
index 1a7022c11b..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AMQMethodBodyFactory implements BodyFactory
-{
- private static final Logger _log = LoggerFactory.getLogger(AMQMethodBodyFactory.class);
-
- private final AMQVersionAwareProtocolSession _protocolSession;
-
- public AMQMethodBodyFactory(AMQVersionAwareProtocolSession protocolSession)
- {
- _protocolSession = protocolSession;
- }
-
- public AMQBody createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
- {
- return _protocolSession.getMethodRegistry().convertToBody(in, bodySize);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyImpl.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyImpl.java
deleted file mode 100644
index ad7f36f790..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyImpl.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.apache.qpid.framing;
-
-/*
- *
- * 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 org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQChannelException;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-
-public abstract class AMQMethodBodyImpl implements AMQMethodBody
-{
- public static final byte TYPE = 1;
-
- public AMQMethodBodyImpl()
- {
- }
-
- public byte getFrameType()
- {
- return TYPE;
- }
-
-
- /** unsigned short */
- abstract protected int getBodySize();
-
-
- public AMQFrame generateFrame(int channelId)
- {
- return new AMQFrame(channelId, this);
- }
-
- /**
- * Creates an AMQChannelException for the corresponding body type (a channel exception should include the class and
- * method ids of the body it resulted from).
- */
-
- /**
- * Convenience Method to create a channel not found exception
- *
- * @param channelId The channel id that is not found
- *
- * @return new AMQChannelException
- */
- public AMQChannelException getChannelNotFoundException(int channelId)
- {
- return getChannelException(AMQConstant.NOT_FOUND, "Channel not found for id:" + channelId);
- }
-
- public AMQChannelException getChannelException(AMQConstant code, String message)
- {
- return new AMQChannelException(code, message, getClazz(), getMethod(), getMajor(), getMinor(), null);
- }
-
- public AMQChannelException getChannelException(AMQConstant code, String message, Throwable cause)
- {
- return new AMQChannelException(code, message, getClazz(), getMethod(), getMajor(), getMinor(), cause);
- }
-
- public AMQConnectionException getConnectionException(AMQConstant code, String message)
- {
- return new AMQConnectionException(code, message, getClazz(), getMethod(), getMajor(), getMinor(), null);
- }
-
- public AMQConnectionException getConnectionException(AMQConstant code, String message, Throwable cause)
- {
- return new AMQConnectionException(code, message, getClazz(), getMethod(), getMajor(), getMinor(), cause);
- }
-
- public void handle(final int channelId, final AMQVersionAwareProtocolSession session) throws AMQException
- {
- session.methodFrameReceived(channelId, this);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java
deleted file mode 100644
index 0c61d9db3c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java
+++ /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.
- *
- */
-
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-
-public abstract interface AMQMethodBodyInstanceFactory
-{
- public AMQMethodBody newInstance(ByteBuffer buffer, long size) throws AMQFrameDecodingException;
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodFactory.java
deleted file mode 100644
index bfcc38ad60..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodFactory.java
+++ /dev/null
@@ -1,90 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-
-public interface AMQMethodFactory
-{
-
- // Connection Methods
-
- ConnectionCloseBody createConnectionClose();
-
- // Access Methods
-
- AccessRequestBody createAccessRequest(boolean active, boolean exclusive, boolean passive, boolean read, AMQShortString realm, boolean write);
-
-
- // Tx Methods
-
- TxSelectBody createTxSelect();
-
- TxCommitBody createTxCommit();
-
- TxRollbackBody createTxRollback();
-
- // Channel Methods
-
- ChannelOpenBody createChannelOpen();
-
- ChannelCloseBody createChannelClose(int replyCode, AMQShortString replyText);
-
- ChannelFlowBody createChannelFlow(boolean active);
-
-
- // Exchange Methods
-
-
- ExchangeBoundBody createExchangeBound(AMQShortString exchangeName,
- AMQShortString queueName,
- AMQShortString routingKey);
-
- ExchangeDeclareBody createExchangeDeclare(AMQShortString name, AMQShortString type, int ticket);
-
-
- // Queue Methods
-
- QueueDeclareBody createQueueDeclare(AMQShortString name, FieldTable arguments, boolean autoDelete, boolean durable, boolean exclusive, boolean passive, int ticket);
-
- QueueBindBody createQueueBind(AMQShortString queueName, AMQShortString exchangeName, AMQShortString routingKey, FieldTable arguments, int ticket);
-
- QueueDeleteBody createQueueDelete(AMQShortString queueName, boolean ifEmpty, boolean ifUnused, int ticket);
-
-
- // Message Methods
-
- // In different versions of the protocol we change the class used for message transfer
- // abstract this out so the appropriate methods are created
- AMQMethodBody createRecover(boolean requeue);
-
- AMQMethodBody createConsumer(AMQShortString tag, AMQShortString queueName, FieldTable arguments, boolean noAck, boolean exclusive, boolean noLocal, int ticket);
-
- AMQMethodBody createConsumerCancel(AMQShortString consumerTag);
-
- AMQMethodBody createAcknowledge(long deliveryTag, boolean multiple);
-
- AMQMethodBody createRejectBody(long deliveryTag, boolean requeue);
-
- AMQMethodBody createMessageQos(int prefetchCount, int prefetchSize);
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java
deleted file mode 100644
index ab09c1de6d..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java
+++ /dev/null
@@ -1,39 +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.
- *
- */
-package org.apache.qpid.framing;
-
-/**
- * AMQProtocolInstanceException indicates that the protocol class is incorrect in a header.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent incorrect protocol class in frame header.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- */
-public class AMQProtocolClassException extends AMQProtocolHeaderException
-{
- public AMQProtocolClassException(String message, Throwable cause)
- {
- super(message, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolHeaderException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolHeaderException.java
deleted file mode 100644
index 6b819364da..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolHeaderException.java
+++ /dev/null
@@ -1,41 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.qpid.AMQException;
-
-/**
- * AMQProtocolHeaderException indicates a format error in an AMQP frame header.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent format error in frame header.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- */
-public class AMQProtocolHeaderException extends AMQException
-{
- public AMQProtocolHeaderException(String message, Throwable cause)
- {
- super(null, message, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolInstanceException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolInstanceException.java
deleted file mode 100644
index 3165c373a9..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolInstanceException.java
+++ /dev/null
@@ -1,39 +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.
- *
- */
-package org.apache.qpid.framing;
-
-/**
- * AMQProtocolInstanceException indicates that the protocol instance is incorrect in a header.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent incorrect protocol instance in frame header.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- */
-public class AMQProtocolInstanceException extends AMQProtocolHeaderException
-{
- public AMQProtocolInstanceException(String message, Throwable cause)
- {
- super(message, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolVersionException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolVersionException.java
deleted file mode 100644
index c9b0973ea6..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolVersionException.java
+++ /dev/null
@@ -1,39 +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.
- *
- */
-package org.apache.qpid.framing;
-
-/**
- * AMQProtocolInstanceException indicates that the client and server differ on expected protocol version in a header.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent incorrect protocol version in frame header.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- */
-public class AMQProtocolVersionException extends AMQProtocolHeaderException
-{
- public AMQProtocolVersionException(String message, Throwable cause)
- {
- super(message, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java
deleted file mode 100644
index a8e7f47db0..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java
+++ /dev/null
@@ -1,776 +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.
- *
- */
-
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.*;
-import java.lang.ref.WeakReference;
-
-/**
- * A short string is a representation of an AMQ Short String
- * Short strings differ from the Java String class by being limited to on ASCII characters (0-127)
- * and thus can be held more effectively in a byte buffer.
- *
- */
-public final class AMQShortString implements CharSequence, Comparable<AMQShortString>
-{
- private static final byte MINUS = (byte)'-';
- private static final byte ZERO = (byte) '0';
-
-
-
- private final class TokenizerImpl implements AMQShortStringTokenizer
- {
- private final byte _delim;
- private int _count = -1;
- private int _pos = 0;
-
- public TokenizerImpl(final byte delim)
- {
- _delim = delim;
- }
-
- public int countTokens()
- {
- if(_count == -1)
- {
- _count = 1 + AMQShortString.this.occurences(_delim);
- }
- return _count;
- }
-
- public AMQShortString nextToken()
- {
- if(_pos <= AMQShortString.this.length())
- {
- int nextDelim = AMQShortString.this.indexOf(_delim, _pos);
- if(nextDelim == -1)
- {
- nextDelim = AMQShortString.this.length();
- }
-
- AMQShortString nextToken = AMQShortString.this.substring(_pos, nextDelim++);
- _pos = nextDelim;
- return nextToken;
- }
- else
- {
- return null;
- }
- }
-
- public boolean hasMoreTokens()
- {
- return _pos <= AMQShortString.this.length();
- }
- }
-
- private AMQShortString substring(final int from, final int to)
- {
- return new AMQShortString(_data, from+_offset, to+_offset);
- }
-
-
- private static final ThreadLocal<Map<AMQShortString, WeakReference<AMQShortString>>> _localInternMap =
- new ThreadLocal<Map<AMQShortString, WeakReference<AMQShortString>>>()
- {
- protected Map<AMQShortString, WeakReference<AMQShortString>> initialValue()
- {
- return new WeakHashMap<AMQShortString, WeakReference<AMQShortString>>();
- };
- };
-
- private static final Map<AMQShortString, WeakReference<AMQShortString>> _globalInternMap =
- new WeakHashMap<AMQShortString, WeakReference<AMQShortString>>();
-
- private static final Logger _logger = LoggerFactory.getLogger(AMQShortString.class);
-
- private final byte[] _data;
- private final int _offset;
- private int _hashCode;
- private String _asString = null;
-
- private final int _length;
- private static final char[] EMPTY_CHAR_ARRAY = new char[0];
-
- public static final AMQShortString EMPTY_STRING = new AMQShortString((String)null);
-
- public AMQShortString(byte[] data)
- {
-
- _data = data.clone();
- _length = data.length;
- _offset = 0;
- }
-
- public AMQShortString(byte[] data, int pos)
- {
- final int size = data[pos++];
- final byte[] dataCopy = new byte[size];
- System.arraycopy(data,pos,dataCopy,0,size);
- _length = size;
- _data = dataCopy;
- _offset = 0;
- }
-
- public AMQShortString(String data)
- {
- this((data == null) ? EMPTY_CHAR_ARRAY : data.toCharArray());
- _asString = data;
- }
-
- public AMQShortString(char[] data)
- {
- if (data == null)
- {
- throw new NullPointerException("Cannot create AMQShortString with null char[]");
- }
-
- final int length = data.length;
- final byte[] stringBytes = new byte[length];
- int hash = 0;
- for (int i = 0; i < length; i++)
- {
- stringBytes[i] = (byte) (0xFF & data[i]);
- hash = (31 * hash) + stringBytes[i];
- }
- _hashCode = hash;
- _data = stringBytes;
-
- _length = length;
- _offset = 0;
-
- }
-
- public AMQShortString(CharSequence charSequence)
- {
- final int length = charSequence.length();
- final byte[] stringBytes = new byte[length];
- int hash = 0;
- for (int i = 0; i < length; i++)
- {
- stringBytes[i] = ((byte) (0xFF & charSequence.charAt(i)));
- hash = (31 * hash) + stringBytes[i];
-
- }
-
- _data = stringBytes;
- _hashCode = hash;
- _length = length;
- _offset = 0;
-
- }
-
- private AMQShortString(ByteBuffer data, final int length)
- {
- if(data.isDirect() || data.isReadOnly())
- {
- byte[] dataBytes = new byte[length];
- data.get(dataBytes);
- _data = dataBytes;
- _offset = 0;
- }
- else
- {
-
- _data = data.array();
- _offset = data.arrayOffset() + data.position();
- data.skip(length);
-
- }
- _length = length;
-
- }
-
- private AMQShortString(final byte[] data, final int from, final int to)
- {
- _offset = from;
- _length = to - from;
- _data = data;
- }
-
- public AMQShortString shrink()
- {
- if(_data.length != _length)
- {
- byte[] dataBytes = new byte[_length];
- System.arraycopy(_data,_offset,dataBytes,0,_length);
- return new AMQShortString(dataBytes,0,_length);
- }
- else
- {
- return this;
- }
- }
-
- /**
- * Get the length of the short string
- * @return length of the underlying byte array
- */
- public int length()
- {
- return _length;
- }
-
- public char charAt(int index)
- {
-
- return (char) _data[_offset + index];
-
- }
-
- public CharSequence subSequence(int start, int end)
- {
- return new CharSubSequence(start, end);
- }
-
- public int writeToByteArray(byte[] encoding, int pos)
- {
- final int size = length();
- encoding[pos++] = (byte) size;
- System.arraycopy(_data,_offset,encoding,pos,size);
- return pos+size;
- }
-
- public static AMQShortString readFromByteArray(byte[] byteEncodedDestination, int pos)
- {
-
-
- final AMQShortString shortString = new AMQShortString(byteEncodedDestination, pos);
- if(shortString.length() == 0)
- {
- return null;
- }
- else
- {
- return shortString;
- }
- }
-
- public static AMQShortString readFromBuffer(ByteBuffer buffer)
- {
- final short length = buffer.getUnsigned();
- if (length == 0)
- {
- return null;
- }
- else
- {
-
- return new AMQShortString(buffer, length);
- }
- }
-
- public byte[] getBytes()
- {
- if(_offset == 0 && _length == _data.length)
- {
- return _data.clone();
- }
- else
- {
- byte[] data = new byte[_length];
- System.arraycopy(_data,_offset,data,0,_length);
- return data;
- }
- }
-
- public void writeToBuffer(ByteBuffer buffer)
- {
-
- final int size = length();
- //buffer.setAutoExpand(true);
- buffer.put((byte) size);
- buffer.put(_data, _offset, size);
-
- }
-
- public boolean endsWith(String s)
- {
- return endsWith(new AMQShortString(s));
- }
-
-
- public boolean endsWith(AMQShortString otherString)
- {
-
- if (otherString.length() > length())
- {
- return false;
- }
-
-
- int thisLength = length();
- int otherLength = otherString.length();
-
- for (int i = 1; i <= otherLength; i++)
- {
- if (charAt(thisLength - i) != otherString.charAt(otherLength - i))
- {
- return false;
- }
- }
- return true;
- }
-
- public boolean startsWith(String s)
- {
- return startsWith(new AMQShortString(s));
- }
-
- public boolean startsWith(AMQShortString otherString)
- {
-
- if (otherString.length() > length())
- {
- return false;
- }
-
- for (int i = 0; i < otherString.length(); i++)
- {
- if (charAt(i) != otherString.charAt(i))
- {
- return false;
- }
- }
-
- return true;
-
- }
-
- public boolean startsWith(CharSequence otherString)
- {
- if (otherString.length() > length())
- {
- return false;
- }
-
- for (int i = 0; i < otherString.length(); i++)
- {
- if (charAt(i) != otherString.charAt(i))
- {
- return false;
- }
- }
-
- return true;
- }
-
-
- private final class CharSubSequence implements CharSequence
- {
- private final int _sequenceOffset;
- private final int _end;
-
- public CharSubSequence(final int offset, final int end)
- {
- _sequenceOffset = offset;
- _end = end;
- }
-
- public int length()
- {
- return _end - _sequenceOffset;
- }
-
- public char charAt(int index)
- {
- return AMQShortString.this.charAt(index + _sequenceOffset);
- }
-
- public CharSequence subSequence(int start, int end)
- {
- return new CharSubSequence(start + _sequenceOffset, end + _sequenceOffset);
- }
- }
-
- public char[] asChars()
- {
- final int size = length();
- final char[] chars = new char[size];
-
- for (int i = 0; i < size; i++)
- {
- chars[i] = (char) _data[i + _offset];
- }
-
- return chars;
- }
-
-
- public String asString()
- {
- if (_asString == null)
- {
- _asString = new String(asChars());
- }
- return _asString;
- }
-
- public boolean equals(Object o)
- {
-
-
- if(o instanceof AMQShortString)
- {
- return equals((AMQShortString)o);
- }
- if(o instanceof CharSequence)
- {
- return equals((CharSequence)o);
- }
-
- if (o == null)
- {
- return false;
- }
-
- if (o == this)
- {
- return true;
- }
-
-
- return false;
-
- }
-
- public boolean equals(final AMQShortString otherString)
- {
- if (otherString == this)
- {
- return true;
- }
-
- if (otherString == null)
- {
- return false;
- }
-
- final int hashCode = _hashCode;
-
- final int otherHashCode = otherString._hashCode;
-
- if ((hashCode != 0) && (otherHashCode != 0) && (hashCode != otherHashCode))
- {
- return false;
- }
-
- final int length = _length;
-
- if(length != otherString._length)
- {
- return false;
- }
-
-
- final byte[] data = _data;
-
- final byte[] otherData = otherString._data;
-
- final int offset = _offset;
-
- final int otherOffset = otherString._offset;
-
- if(offset == 0 && otherOffset == 0 && length == data.length && length == otherData.length)
- {
- return Arrays.equals(data, otherData);
- }
- else
- {
- int thisIdx = offset;
- int otherIdx = otherOffset;
- for(int i = length; i-- != 0; )
- {
- if(!(data[thisIdx++] == otherData[otherIdx++]))
- {
- return false;
- }
- }
- }
-
- return true;
-
- }
-
- public boolean equals(CharSequence s)
- {
- if(s instanceof AMQShortString)
- {
- return equals((AMQShortString)s);
- }
-
- if (s == null)
- {
- return false;
- }
-
- if (s.length() != length())
- {
- return false;
- }
-
- for (int i = 0; i < length(); i++)
- {
- if (charAt(i) != s.charAt(i))
- {
- return false;
- }
- }
-
- return true;
- }
-
- public int hashCode()
- {
- int hash = _hashCode;
- if (hash == 0)
- {
- final int size = length();
-
- for (int i = 0; i < size; i++)
- {
- hash = (31 * hash) + _data[i+_offset];
- }
-
- _hashCode = hash;
- }
-
- return hash;
- }
-
- public void setDirty()
- {
- _hashCode = 0;
- }
-
- public String toString()
- {
- return asString();
- }
-
- public int compareTo(AMQShortString name)
- {
- if (name == null)
- {
- return 1;
- }
- else
- {
-
- if (name.length() < length())
- {
- return -name.compareTo(this);
- }
-
- for (int i = 0; i < length(); i++)
- {
- final byte d = _data[i+_offset];
- final byte n = name._data[i+name._offset];
- if (d < n)
- {
- return -1;
- }
-
- if (d > n)
- {
- return 1;
- }
- }
-
- return (length() == name.length()) ? 0 : -1;
- }
- }
-
-
- public AMQShortStringTokenizer tokenize(byte delim)
- {
- return new TokenizerImpl(delim);
- }
-
-
- public AMQShortString intern()
- {
-
- hashCode();
-
- Map<AMQShortString, WeakReference<AMQShortString>> localMap =
- _localInternMap.get();
-
- WeakReference<AMQShortString> ref = localMap.get(this);
- AMQShortString internString;
-
- if(ref != null)
- {
- internString = ref.get();
- if(internString != null)
- {
- return internString;
- }
- }
-
-
- synchronized(_globalInternMap)
- {
-
- ref = _globalInternMap.get(this);
- if((ref == null) || ((internString = ref.get()) == null))
- {
- internString = shrink();
- ref = new WeakReference(internString);
- _globalInternMap.put(internString, ref);
- }
-
- }
- localMap.put(internString, ref);
- return internString;
-
- }
-
- private int occurences(final byte delim)
- {
- int count = 0;
- final int end = _offset + _length;
- for(int i = _offset ; i < end ; i++ )
- {
- if(_data[i] == delim)
- {
- count++;
- }
- }
- return count;
- }
-
- private int indexOf(final byte val, final int pos)
- {
-
- for(int i = pos; i < length(); i++)
- {
- if(_data[_offset+i] == val)
- {
- return i;
- }
- }
- return -1;
- }
-
-
- public static AMQShortString join(final Collection<AMQShortString> terms,
- final AMQShortString delim)
- {
- if(terms.size() == 0)
- {
- return EMPTY_STRING;
- }
-
- int size = delim.length() * (terms.size() - 1);
- for(AMQShortString term : terms)
- {
- size += term.length();
- }
-
- byte[] data = new byte[size];
- int pos = 0;
- final byte[] delimData = delim._data;
- final int delimOffset = delim._offset;
- final int delimLength = delim._length;
-
-
- for(AMQShortString term : terms)
- {
-
- if(pos!=0)
- {
- System.arraycopy(delimData, delimOffset,data,pos, delimLength);
- pos+=delimLength;
- }
- System.arraycopy(term._data,term._offset,data,pos,term._length);
- pos+=term._length;
- }
-
-
-
- return new AMQShortString(data,0,size);
- }
-
- public int toIntValue()
- {
- int pos = _offset;
- int val = 0;
-
-
- boolean isNegative = (_data[pos] == MINUS);
- if(isNegative)
- {
- pos++;
- }
-
- final int end = _length + _offset;
-
- while(pos < end)
- {
- int digit = (int) (_data[pos++] - ZERO);
- if((digit < 0) || (digit > 9))
- {
- throw new NumberFormatException("\""+toString()+"\" is not a valid number");
- }
- val = val * 10;
- val += digit;
- }
- if(isNegative)
- {
- val = val * -1;
- }
- return val;
- }
-
- public boolean contains(final byte b)
- {
- final int end = _length + _offset;
- for(int i = _offset; i < end; i++)
- {
- if(_data[i] == b)
- {
- return true;
- }
- }
- return false; //To change body of created methods use File | Settings | File Templates.
- }
-
-
- public static void main(String args[])
- {
- AMQShortString s = new AMQShortString("a.b.c.d.e.f.g.h.i.j.k");
- AMQShortString s2 = s.substring(2, 7);
-
- AMQShortStringTokenizer t = s2.tokenize((byte) '.');
- while(t.hasMoreTokens())
- {
- System.err.println(t.nextToken());
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortStringTokenizer.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortStringTokenizer.java
deleted file mode 100644
index e2db8906a1..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQShortStringTokenizer.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.apache.qpid.framing;
-
-/*
-*
-* 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.
-*
-*/
-public interface AMQShortStringTokenizer
-{
-
- public int countTokens();
-
- public AMQShortString nextToken();
-
- boolean hasMoreTokens();
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQType.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQType.java
deleted file mode 100644
index 14fb63da03..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQType.java
+++ /dev/null
@@ -1,795 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import java.math.BigDecimal;
-
-/**
- * AMQType is a type that represents the different possible AMQP field table types. It provides operations for each
- * of the types to perform tasks such as calculating the size of an instance of the type, converting types between AMQP
- * and Java native types, and reading and writing instances of AMQP types in binary formats to and from byte buffers.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Get the equivalent one byte identifier for a type.
- * <tr><td> Calculate the size of an instance of an AMQP parameter type. <td> {@link EncodingUtils}
- * <tr><td> Convert an instance of an AMQP parameter into a compatable Java object tagged with its AMQP type.
- * <td> {@link AMQTypedValue}
- * <tr><td> Write an instance of an AMQP parameter type to a byte buffer. <td> {@link EncodingUtils}
- * <tr><td> Read an instance of an AMQP parameter from a byte buffer. <td> {@link EncodingUtils}
- * </table>
- */
-public enum AMQType
-{
- LONG_STRING('S')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedLongStringLength((String) value);
- }
-
- public String toNativeValue(Object value)
- {
- if (value != null)
- {
- return value.toString();
- }
- else
- {
- throw new NullPointerException("Cannot convert: null to String.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeLongStringBytes(buffer, (String) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readLongString(buffer);
- }
- },
-
- INTEGER('i')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.unsignedIntegerLength();
- }
-
- public Long toNativeValue(Object value)
- {
- if (value instanceof Long)
- {
- return (Long) value;
- }
- else if (value instanceof Integer)
- {
- return ((Integer) value).longValue();
- }
- else if (value instanceof Short)
- {
- return ((Short) value).longValue();
- }
- else if (value instanceof Byte)
- {
- return ((Byte) value).longValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Long.valueOf((String) value);
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName() + ") to int.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeUnsignedInteger(buffer, (Long) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readUnsignedInteger(buffer);
- }
- },
-
- DECIMAL('D')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedByteLength() + EncodingUtils.encodedIntegerLength();
- }
-
- public Object toNativeValue(Object value)
- {
- if (value instanceof BigDecimal)
- {
- return (BigDecimal) value;
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName()
- + ") to BigDecimal.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- BigDecimal bd = (BigDecimal) value;
-
- byte places = new Integer(bd.scale()).byteValue();
-
- int unscaled = bd.intValue();
-
- EncodingUtils.writeByte(buffer, places);
-
- EncodingUtils.writeInteger(buffer, unscaled);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- byte places = EncodingUtils.readByte(buffer);
-
- int unscaled = EncodingUtils.readInteger(buffer);
-
- BigDecimal bd = new BigDecimal(unscaled);
-
- return bd.setScale(places);
- }
- },
-
- TIMESTAMP('T')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedLongLength();
- }
-
- public Object toNativeValue(Object value)
- {
- if (value instanceof Long)
- {
- return (Long) value;
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName()
- + ") to timestamp.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeLong(buffer, (Long) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readLong(buffer);
- }
- },
-
- /**
- * Implements the field table type. The native value of a field table type will be an instance of
- * {@link FieldTable}, which itself may contain name/value pairs encoded as {@link AMQTypedValue}s.
- */
- FIELD_TABLE('F')
- {
- /**
- * Calculates the size of an instance of the type in bytes.
- *
- * @param value An instance of the type.
- *
- * @return The size of the instance of the type in bytes.
- */
- public int getEncodingSize(Object value)
- {
- // Ensure that the value is a FieldTable.
- if (!(value instanceof FieldTable))
- {
- throw new IllegalArgumentException("Value is not a FieldTable.");
- }
-
- FieldTable ftValue = (FieldTable) value;
-
- // Loop over all name/value pairs adding up size of each. FieldTable itself keeps track of its encoded
- // size as entries are added, so no need to loop over all explicitly.
- // EncodingUtils calculation of the encoded field table lenth, will include 4 bytes for its 'size' field.
- return EncodingUtils.encodedFieldTableLength(ftValue);
- }
-
- /**
- * Converts an instance of the type to an equivalent Java native representation.
- *
- * @param value An instance of the type.
- *
- * @return An equivalent Java native representation.
- */
- public Object toNativeValue(Object value)
- {
- // Ensure that the value is a FieldTable.
- if (!(value instanceof FieldTable))
- {
- throw new IllegalArgumentException("Value is not a FieldTable.");
- }
-
- return (FieldTable) value;
- }
-
- /**
- * Writes an instance of the type to a specified byte buffer.
- *
- * @param value An instance of the type.
- * @param buffer The byte buffer to write it to.
- */
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- // Ensure that the value is a FieldTable.
- if (!(value instanceof FieldTable))
- {
- throw new IllegalArgumentException("Value is not a FieldTable.");
- }
-
- FieldTable ftValue = (FieldTable) value;
-
- // Loop over all name/values writing out into buffer.
- ftValue.writeToBuffer(buffer);
- }
-
- /**
- * Reads an instance of the type from a specified byte buffer.
- *
- * @param buffer The byte buffer to write it to.
- *
- * @return An instance of the type.
- */
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- try
- {
- // Read size of field table then all name/value pairs.
- return EncodingUtils.readFieldTable(buffer);
- }
- catch (AMQFrameDecodingException e)
- {
- throw new IllegalArgumentException("Unable to read field table from buffer.", e);
- }
- }
- },
-
- VOID('V')
- {
- public int getEncodingSize(Object value)
- {
- return 0;
- }
-
- public Object toNativeValue(Object value)
- {
- if (value == null)
- {
- return null;
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName()
- + ") to null String.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- { }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return null;
- }
- },
-
- BINARY('x')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedLongstrLength((byte[]) value);
- }
-
- public Object toNativeValue(Object value)
- {
- if ((value instanceof byte[]) || (value == null))
- {
- return value;
- }
- else
- {
- throw new IllegalArgumentException("Value: " + value + " (" + value.getClass().getName()
- + ") cannot be converted to byte[]");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeLongstr(buffer, (byte[]) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readLongstr(buffer);
- }
- },
-
- ASCII_STRING('c')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedLongStringLength((String) value);
- }
-
- public String toNativeValue(Object value)
- {
- if (value != null)
- {
- return value.toString();
- }
- else
- {
- throw new NullPointerException("Cannot convert: null to String.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeLongStringBytes(buffer, (String) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readLongString(buffer);
- }
- },
-
- WIDE_STRING('C')
- {
- public int getEncodingSize(Object value)
- {
- // FIXME: use proper charset encoder
- return EncodingUtils.encodedLongStringLength((String) value);
- }
-
- public String toNativeValue(Object value)
- {
- if (value != null)
- {
- return value.toString();
- }
- else
- {
- throw new NullPointerException("Cannot convert: null to String.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeLongStringBytes(buffer, (String) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readLongString(buffer);
- }
- },
-
- BOOLEAN('t')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedBooleanLength();
- }
-
- public Object toNativeValue(Object value)
- {
- if (value instanceof Boolean)
- {
- return (Boolean) value;
- }
- else if ((value instanceof String) || (value == null))
- {
- return Boolean.valueOf((String) value);
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName()
- + ") to boolean.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeBoolean(buffer, (Boolean) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readBoolean(buffer);
- }
- },
-
- ASCII_CHARACTER('k')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedCharLength();
- }
-
- public Character toNativeValue(Object value)
- {
- if (value instanceof Character)
- {
- return (Character) value;
- }
- else if (value == null)
- {
- throw new NullPointerException("Cannot convert null into char");
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName()
- + ") to char.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeChar(buffer, (Character) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readChar(buffer);
- }
- },
-
- BYTE('b')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedByteLength();
- }
-
- public Byte toNativeValue(Object value)
- {
- if (value instanceof Byte)
- {
- return (Byte) value;
- }
- else if ((value instanceof String) || (value == null))
- {
- return Byte.valueOf((String) value);
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName()
- + ") to byte.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeByte(buffer, (Byte) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readByte(buffer);
- }
- },
-
- SHORT('s')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedShortLength();
- }
-
- public Short toNativeValue(Object value)
- {
- if (value instanceof Short)
- {
- return (Short) value;
- }
- else if (value instanceof Byte)
- {
- return ((Byte) value).shortValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Short.valueOf((String) value);
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName()
- + ") to short.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeShort(buffer, (Short) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readShort(buffer);
- }
- },
-
- INT('I')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedIntegerLength();
- }
-
- public Integer toNativeValue(Object value)
- {
- if (value instanceof Integer)
- {
- return (Integer) value;
- }
- else if (value instanceof Short)
- {
- return ((Short) value).intValue();
- }
- else if (value instanceof Byte)
- {
- return ((Byte) value).intValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Integer.valueOf((String) value);
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName() + ") to int.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeInteger(buffer, (Integer) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readInteger(buffer);
- }
- },
-
- LONG('l')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedLongLength();
- }
-
- public Object toNativeValue(Object value)
- {
- if (value instanceof Long)
- {
- return (Long) value;
- }
- else if (value instanceof Integer)
- {
- return ((Integer) value).longValue();
- }
- else if (value instanceof Short)
- {
- return ((Short) value).longValue();
- }
- else if (value instanceof Byte)
- {
- return ((Byte) value).longValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Long.valueOf((String) value);
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName()
- + ") to long.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeLong(buffer, (Long) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readLong(buffer);
- }
- },
-
- FLOAT('f')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedFloatLength();
- }
-
- public Float toNativeValue(Object value)
- {
- if (value instanceof Float)
- {
- return (Float) value;
- }
- else if ((value instanceof String) || (value == null))
- {
- return Float.valueOf((String) value);
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName()
- + ") to float.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeFloat(buffer, (Float) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readFloat(buffer);
- }
- },
-
- DOUBLE('d')
- {
- public int getEncodingSize(Object value)
- {
- return EncodingUtils.encodedDoubleLength();
- }
-
- public Double toNativeValue(Object value)
- {
- if (value instanceof Double)
- {
- return (Double) value;
- }
- else if (value instanceof Float)
- {
- return ((Float) value).doubleValue();
- }
- else if ((value instanceof String) || (value == null))
- {
- return Double.valueOf((String) value);
- }
- else
- {
- throw new NumberFormatException("Cannot convert: " + value + "(" + value.getClass().getName()
- + ") to double.");
- }
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- EncodingUtils.writeDouble(buffer, (Double) value);
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- return EncodingUtils.readDouble(buffer);
- }
- };
-
- /** Holds the defined one byte identifier for the type. */
- private final byte _identifier;
-
- /**
- * Creates an instance of an AMQP type from its defined one byte identifier.
- *
- * @param identifier The one byte identifier for the type.
- */
- AMQType(char identifier)
- {
- _identifier = (byte) identifier;
- }
-
- /**
- * Extracts the byte identifier for the typ.
- *
- * @return The byte identifier for the typ.
- */
- public final byte identifier()
- {
- return _identifier;
- }
-
- /**
- * Calculates the size of an instance of the type in bytes.
- *
- * @param value An instance of the type.
- *
- * @return The size of the instance of the type in bytes.
- */
- public abstract int getEncodingSize(Object value);
-
- /**
- * Converts an instance of the type to an equivalent Java native representation.
- *
- * @param value An instance of the type.
- *
- * @return An equivalent Java native representation.
- */
- public abstract Object toNativeValue(Object value);
-
- /**
- * Converts an instance of the type to an equivalent Java native representation, packaged as an
- * {@link AMQTypedValue} tagged with its AMQP type.
- *
- * @param value An instance of the type.
- *
- * @return An equivalent Java native representation, tagged with its AMQP type.
- */
- public AMQTypedValue asTypedValue(Object value)
- {
- return new AMQTypedValue(this, toNativeValue(value));
- }
-
- /**
- * Writes an instance of the type to a specified byte buffer, preceded by its one byte identifier. As the type and
- * value are both written, this provides a fully encoded description of a parameters type and value.
- *
- * @param value An instance of the type.
- * @param buffer The byte buffer to write it to.
- */
- public void writeToBuffer(Object value, ByteBuffer buffer)
- {
- buffer.put(identifier());
- writeValueImpl(value, buffer);
- }
-
- /**
- * Writes an instance of the type to a specified byte buffer.
- *
- * @param value An instance of the type.
- * @param buffer The byte buffer to write it to.
- */
- abstract void writeValueImpl(Object value, ByteBuffer buffer);
-
- /**
- * Reads an instance of the type from a specified byte buffer.
- *
- * @param buffer The byte buffer to write it to.
- *
- * @return An instance of the type.
- */
- abstract Object readValueFromBuffer(ByteBuffer buffer);
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypeMap.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypeMap.java
deleted file mode 100644
index a16e137466..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypeMap.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class AMQTypeMap
-{
- public static Map<Byte, AMQType> _reverseTypeMap = new HashMap<Byte, AMQType>();
-
- static
- {
- for(AMQType type : AMQType.values())
- {
- _reverseTypeMap.put(type.identifier(), type);
- }
- }
-
- public static AMQType getType(Byte identifier)
- {
- AMQType result = _reverseTypeMap.get(identifier);
- if (result == null) {
- throw new IllegalArgumentException
- ("no such type code: " + Integer.toHexString(identifier.intValue()));
- }
- return result;
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.java
deleted file mode 100644
index 1ff39ca790..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.java
+++ /dev/null
@@ -1,116 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-/**
- * AMQTypedValue combines together a native Java Object value, and an {@link AMQType}, as a fully typed AMQP parameter
- * value. It provides the ability to read and write fully typed parameters to and from byte buffers. It also provides
- * the ability to create such parameters from Java native value and a type tag or to extract the native value and type
- * from one.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create a fully typed AMQP value from a native type and a type tag. <td> {@link AMQType}
- * <tr><td> Create a fully typed AMQP value from a binary representation in a byte buffer. <td> {@link AMQType}
- * <tr><td> Write a fully typed AMQP value to a binary representation in a byte buffer. <td> {@link AMQType}
- * <tr><td> Extract the type from a fully typed AMQP value.
- * <tr><td> Extract the value from a fully typed AMQP value.
- * </table>
- */
-public class AMQTypedValue
-{
- /** The type of the value. */
- private final AMQType _type;
-
- /** The Java native representation of the AMQP typed value. */
- private final Object _value;
-
- public AMQTypedValue(AMQType type, Object value)
- {
- if (type == null)
- {
- throw new NullPointerException("Cannot create a typed value with null type");
- }
-
- _type = type;
- _value = type.toNativeValue(value);
- }
-
- private AMQTypedValue(AMQType type, ByteBuffer buffer)
- {
- _type = type;
- _value = type.readValueFromBuffer(buffer);
- }
-
- public AMQType getType()
- {
- return _type;
- }
-
- public Object getValue()
- {
- return _value;
- }
-
- public void writeToBuffer(ByteBuffer buffer)
- {
- _type.writeToBuffer(_value, buffer);
- }
-
- public int getEncodingSize()
- {
- return _type.getEncodingSize(_value);
- }
-
- public static AMQTypedValue readFromBuffer(ByteBuffer buffer)
- {
- AMQType type = AMQTypeMap.getType(buffer.get());
-
- return new AMQTypedValue(type, buffer);
- }
-
- public String toString()
- {
- return "[" + getType() + ": " + getValue() + "]";
- }
-
-
- public boolean equals(Object o)
- {
- if(o instanceof AMQTypedValue)
- {
- AMQTypedValue other = (AMQTypedValue) o;
- return _type == other._type && (_value == null ? other._value == null : _value.equals(other._value));
- }
- else
- {
- return false;
- }
- }
-
- public int hashCode()
- {
- return _type.hashCode() ^ (_value == null ? 0 : _value.hashCode());
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java
deleted file mode 100644
index 47b5c02beb..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java
+++ /dev/null
@@ -1,834 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BasicContentHeaderProperties implements CommonContentHeaderProperties
-{
- private static final Logger _logger = LoggerFactory.getLogger(BasicContentHeaderProperties.class);
-
- private static final AMQShortString ZERO_STRING = null;
-
- /**
- * We store the encoded form when we decode the content header so that if we need to write it out without modifying
- * it we can do so without incurring the expense of reencoding it
- */
- private byte[] _encodedForm;
-
- /** Flag indicating whether the entire content header has been decoded yet */
- private boolean _decoded = true;
-
- /**
- * We have some optimisations for partial decoding for maximum performance. The headers are used in the broker for
- * routing in some cases so we can decode that separately.
- */
- private boolean _decodedHeaders = true;
-
- /**
- * We have some optimisations for partial decoding for maximum performance. The content type is used by all clients
- * to determine the message type
- */
- private boolean _decodedContentType = true;
-
- private AMQShortString _contentType;
-
- private AMQShortString _encoding;
-
- private FieldTable _headers;
-
- private byte _deliveryMode;
-
- private byte _priority;
-
- private AMQShortString _correlationId;
-
- private AMQShortString _replyTo;
-
- private long _expiration;
-
- private AMQShortString _messageId;
-
- private long _timestamp;
-
- private AMQShortString _type;
-
- private AMQShortString _userId;
-
- private AMQShortString _appId;
-
- private AMQShortString _clusterId;
-
- private int _propertyFlags = 0;
- private static final int CONTENT_TYPE_MASK = 1 << 15;
- private static final int ENCONDING_MASK = 1 << 14;
- private static final int HEADERS_MASK = 1 << 13;
- private static final int DELIVERY_MODE_MASK = 1 << 12;
- private static final int PROPRITY_MASK = 1 << 11;
- private static final int CORRELATION_ID_MASK = 1 << 10;
- private static final int REPLY_TO_MASK = 1 << 9;
- private static final int EXPIRATION_MASK = 1 << 8;
- private static final int MESSAGE_ID_MASK = 1 << 7;
- private static final int TIMESTAMP_MASK = 1 << 6;
- private static final int TYPE_MASK = 1 << 5;
- private static final int USER_ID_MASK = 1 << 4;
- private static final int APPLICATION_ID_MASK = 1 << 3;
- private static final int CLUSTER_ID_MASK = 1 << 2;
-
-
- /**
- * This is 0_10 specific. We use this property to check if some message properties have been changed.
- */
- private boolean _hasBeenUpdated = false;
-
- public boolean reset()
- {
- boolean result = _hasBeenUpdated;
- _hasBeenUpdated = false;
- return result;
- }
-
- public void updated()
- {
- _hasBeenUpdated = true;
- }
-
- public BasicContentHeaderProperties()
- { }
-
- public int getPropertyListSize()
- {
- if (_encodedForm != null)
- {
- return _encodedForm.length;
- }
- else
- {
- int size = 0;
-
- if ((_propertyFlags & (CONTENT_TYPE_MASK)) > 0)
- {
- size += EncodingUtils.encodedShortStringLength(_contentType);
- }
-
- if ((_propertyFlags & ENCONDING_MASK) > 0)
- {
- size += EncodingUtils.encodedShortStringLength(_encoding);
- }
-
- if ((_propertyFlags & HEADERS_MASK) > 0)
- {
- size += EncodingUtils.encodedFieldTableLength(_headers);
- }
-
- if ((_propertyFlags & DELIVERY_MODE_MASK) > 0)
- {
- size += 1;
- }
-
- if ((_propertyFlags & PROPRITY_MASK) > 0)
- {
- size += 1;
- }
-
- if ((_propertyFlags & CORRELATION_ID_MASK) > 0)
- {
- size += EncodingUtils.encodedShortStringLength(_correlationId);
- }
-
- if ((_propertyFlags & REPLY_TO_MASK) > 0)
- {
- size += EncodingUtils.encodedShortStringLength(_replyTo);
- }
-
- if ((_propertyFlags & EXPIRATION_MASK) > 0)
- {
- if (_expiration == 0L)
- {
- size += EncodingUtils.encodedShortStringLength(ZERO_STRING);
- }
- else
- {
- size += EncodingUtils.encodedShortStringLength(_expiration);
- }
- }
-
- if ((_propertyFlags & MESSAGE_ID_MASK) > 0)
- {
- size += EncodingUtils.encodedShortStringLength(_messageId);
- }
-
- if ((_propertyFlags & TIMESTAMP_MASK) > 0)
- {
- size += 8;
- }
-
- if ((_propertyFlags & TYPE_MASK) > 0)
- {
- size += EncodingUtils.encodedShortStringLength(_type);
- }
-
- if ((_propertyFlags & USER_ID_MASK) > 0)
- {
- size += EncodingUtils.encodedShortStringLength(_userId);
- }
-
- if ((_propertyFlags & APPLICATION_ID_MASK) > 0)
- {
- size += EncodingUtils.encodedShortStringLength(_appId);
- }
-
- if ((_propertyFlags & CLUSTER_ID_MASK) > 0)
- {
- size += EncodingUtils.encodedShortStringLength(_clusterId);
- }
-
- return size;
- }
- }
-
- private void clearEncodedForm()
- {
- if (!_decoded && (_encodedForm != null))
- {
- // decode();
- }
-
- _encodedForm = null;
- }
-
- public void setPropertyFlags(int propertyFlags)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags = propertyFlags;
- }
-
- public int getPropertyFlags()
- {
- return _propertyFlags;
- }
-
- public void writePropertyListPayload(ByteBuffer buffer)
- {
- if (_encodedForm != null)
- {
- buffer.put(_encodedForm);
- }
- else
- {
- if ((_propertyFlags & (CONTENT_TYPE_MASK)) != 0)
- {
- EncodingUtils.writeShortStringBytes(buffer, _contentType);
- }
-
- if ((_propertyFlags & ENCONDING_MASK) != 0)
- {
- EncodingUtils.writeShortStringBytes(buffer, _encoding);
- }
-
- if ((_propertyFlags & HEADERS_MASK) != 0)
- {
- EncodingUtils.writeFieldTableBytes(buffer, _headers);
- }
-
- if ((_propertyFlags & DELIVERY_MODE_MASK) != 0)
- {
- buffer.put(_deliveryMode);
- }
-
- if ((_propertyFlags & PROPRITY_MASK) != 0)
- {
- buffer.put(_priority);
- }
-
- if ((_propertyFlags & CORRELATION_ID_MASK) != 0)
- {
- EncodingUtils.writeShortStringBytes(buffer, _correlationId);
- }
-
- if ((_propertyFlags & REPLY_TO_MASK) != 0)
- {
- EncodingUtils.writeShortStringBytes(buffer, _replyTo);
- }
-
- if ((_propertyFlags & EXPIRATION_MASK) != 0)
- {
- if (_expiration == 0L)
- {
- EncodingUtils.writeShortStringBytes(buffer, ZERO_STRING);
- }
- else
- {
- EncodingUtils.writeShortStringBytes(buffer, String.valueOf(_expiration));
- }
- }
-
- if ((_propertyFlags & MESSAGE_ID_MASK) != 0)
- {
- EncodingUtils.writeShortStringBytes(buffer, _messageId);
- }
-
- if ((_propertyFlags & TIMESTAMP_MASK) != 0)
- {
- EncodingUtils.writeTimestamp(buffer, _timestamp);
- }
-
- if ((_propertyFlags & TYPE_MASK) != 0)
- {
- EncodingUtils.writeShortStringBytes(buffer, _type);
- }
-
- if ((_propertyFlags & USER_ID_MASK) != 0)
- {
- EncodingUtils.writeShortStringBytes(buffer, _userId);
- }
-
- if ((_propertyFlags & APPLICATION_ID_MASK) != 0)
- {
- EncodingUtils.writeShortStringBytes(buffer, _appId);
- }
-
- if ((_propertyFlags & CLUSTER_ID_MASK) != 0)
- {
- EncodingUtils.writeShortStringBytes(buffer, _clusterId);
- }
- }
- }
-
- public void populatePropertiesFromBuffer(ByteBuffer buffer, int propertyFlags, int size) throws AMQFrameDecodingException
- {
- _propertyFlags = propertyFlags;
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Property flags: " + _propertyFlags);
- }
-
- decode(buffer);
- /*_encodedForm = new byte[size];
- buffer.get(_encodedForm, 0, size);
- _decoded = false;
- _decodedHeaders = false;
- _decodedContentType = false;*/
- }
-
- private void decode(ByteBuffer buffer)
- {
- // ByteBuffer buffer = ByteBuffer.wrap(_encodedForm);
- int pos = buffer.position();
- try
- {
- if ((_propertyFlags & (CONTENT_TYPE_MASK)) != 0)
- {
- _contentType = EncodingUtils.readAMQShortString(buffer);
- }
-
- if ((_propertyFlags & ENCONDING_MASK) != 0)
- {
- _encoding = EncodingUtils.readAMQShortString(buffer);
- }
-
- if ((_propertyFlags & HEADERS_MASK) != 0)
- {
- _headers = EncodingUtils.readFieldTable(buffer);
- }
-
- if ((_propertyFlags & DELIVERY_MODE_MASK) != 0)
- {
- _deliveryMode = buffer.get();
- }
-
- if ((_propertyFlags & PROPRITY_MASK) != 0)
- {
- _priority = buffer.get();
- }
-
- if ((_propertyFlags & CORRELATION_ID_MASK) != 0)
- {
- _correlationId = EncodingUtils.readAMQShortString(buffer);
- }
-
- if ((_propertyFlags & REPLY_TO_MASK) != 0)
- {
- _replyTo = EncodingUtils.readAMQShortString(buffer);
- }
-
- if ((_propertyFlags & EXPIRATION_MASK) != 0)
- {
- _expiration = EncodingUtils.readLongAsShortString(buffer);
- }
-
- if ((_propertyFlags & MESSAGE_ID_MASK) != 0)
- {
- _messageId = EncodingUtils.readAMQShortString(buffer);
- }
-
- if ((_propertyFlags & TIMESTAMP_MASK) != 0)
- {
- _timestamp = EncodingUtils.readTimestamp(buffer);
- }
-
- if ((_propertyFlags & TYPE_MASK) != 0)
- {
- _type = EncodingUtils.readAMQShortString(buffer);
- }
-
- if ((_propertyFlags & USER_ID_MASK) != 0)
- {
- _userId = EncodingUtils.readAMQShortString(buffer);
- }
-
- if ((_propertyFlags & APPLICATION_ID_MASK) != 0)
- {
- _appId = EncodingUtils.readAMQShortString(buffer);
- }
-
- if ((_propertyFlags & CLUSTER_ID_MASK) != 0)
- {
- _clusterId = EncodingUtils.readAMQShortString(buffer);
- }
- }
- catch (AMQFrameDecodingException e)
- {
- throw new RuntimeException("Error in content header data: " + e, e);
- }
-
- final int endPos = buffer.position();
- buffer.position(pos);
- final int len = endPos - pos;
- _encodedForm = new byte[len];
- final int limit = buffer.limit();
- buffer.limit(endPos);
- buffer.get(_encodedForm, 0, len);
- buffer.limit(limit);
- buffer.position(endPos);
- _decoded = true;
- }
-
- private void decodeUpToHeaders()
- {
- ByteBuffer buffer = ByteBuffer.wrap(_encodedForm);
- try
- {
- if ((_propertyFlags & (CONTENT_TYPE_MASK)) != 0)
- {
- byte length = buffer.get();
- buffer.skip(length);
- }
-
- if ((_propertyFlags & ENCONDING_MASK) != 0)
- {
- byte length = buffer.get();
- buffer.skip(length);
- }
-
- if ((_propertyFlags & HEADERS_MASK) != 0)
- {
- _headers = EncodingUtils.readFieldTable(buffer);
-
- }
-
- _decodedHeaders = true;
- }
- catch (AMQFrameDecodingException e)
- {
- throw new RuntimeException("Error in content header data: " + e, e);
- }
- }
-
- private void decodeUpToContentType()
- {
- ByteBuffer buffer = ByteBuffer.wrap(_encodedForm);
-
- if ((_propertyFlags & (CONTENT_TYPE_MASK)) != 0)
- {
- _contentType = EncodingUtils.readAMQShortString(buffer);
- }
-
- _decodedContentType = true;
- }
-
- private void decodeIfNecessary()
- {
- if (!_decoded)
- {
- // decode();
- }
- }
-
- private void decodeHeadersIfNecessary()
- {
- if (!_decoded && !_decodedHeaders)
- {
- decodeUpToHeaders();
- }
- }
-
- private void decodeContentTypeIfNecessary()
- {
- if (!_decoded && !_decodedContentType)
- {
- decodeUpToContentType();
- }
- }
-
- public AMQShortString getContentType()
- {
- decodeContentTypeIfNecessary();
-
- return _contentType;
- }
-
- public String getContentTypeAsString()
- {
- decodeContentTypeIfNecessary();
-
- return (_contentType == null) ? null : _contentType.toString();
- }
-
- public void setContentType(AMQShortString contentType)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= (CONTENT_TYPE_MASK);
- _contentType = contentType;
- }
-
- public void setContentType(String contentType)
- {
- _hasBeenUpdated = true;
- setContentType((contentType == null) ? null : new AMQShortString(contentType));
- }
-
- public String getEncodingAsString()
- {
-
- return (getEncoding() == null) ? null : getEncoding().toString();
- }
-
- public AMQShortString getEncoding()
- {
- decodeIfNecessary();
-
- return _encoding;
- }
-
- public void setEncoding(String encoding)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= ENCONDING_MASK;
- _encoding = (encoding == null) ? null : new AMQShortString(encoding);
- }
-
- public void setEncoding(AMQShortString encoding)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= ENCONDING_MASK;
- _encoding = encoding;
- }
-
- public FieldTable getHeaders()
- {
- decodeHeadersIfNecessary();
-
- if (_headers == null)
- {
- setHeaders(FieldTableFactory.newFieldTable());
- }
-
- return _headers;
- }
-
- public void setHeaders(FieldTable headers)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= HEADERS_MASK;
- _headers = headers;
- }
-
- public byte getDeliveryMode()
- {
- decodeIfNecessary();
-
- return _deliveryMode;
- }
-
- public void setDeliveryMode(byte deliveryMode)
- {
- clearEncodedForm();
- _propertyFlags |= DELIVERY_MODE_MASK;
- _deliveryMode = deliveryMode;
- }
-
- public byte getPriority()
- {
- decodeIfNecessary();
-
- return _priority;
- }
-
- public void setPriority(byte priority)
- {
- clearEncodedForm();
- _propertyFlags |= PROPRITY_MASK;
- _priority = priority;
- }
-
- public AMQShortString getCorrelationId()
- {
- decodeIfNecessary();
-
- return _correlationId;
- }
-
- public String getCorrelationIdAsString()
- {
- decodeIfNecessary();
-
- return (_correlationId == null) ? null : _correlationId.toString();
- }
-
- public void setCorrelationId(String correlationId)
- {
- _hasBeenUpdated = true;
- setCorrelationId((correlationId == null) ? null : new AMQShortString(correlationId));
- }
-
- public void setCorrelationId(AMQShortString correlationId)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= CORRELATION_ID_MASK;
- _correlationId = correlationId;
- }
-
- public String getReplyToAsString()
- {
- decodeIfNecessary();
-
- return (_replyTo == null) ? null : _replyTo.toString();
- }
-
- public AMQShortString getReplyTo()
- {
- decodeIfNecessary();
-
- return _replyTo;
- }
-
- public void setReplyTo(String replyTo)
- {
- _hasBeenUpdated = true;
- setReplyTo((replyTo == null) ? null : new AMQShortString(replyTo));
- }
-
- public void setReplyTo(AMQShortString replyTo)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= REPLY_TO_MASK;
- _replyTo = replyTo;
- }
-
- public long getExpiration()
- {
- decodeIfNecessary();
- return _expiration;
- }
-
- public void setExpiration(long expiration)
- {
- clearEncodedForm();
- _propertyFlags |= EXPIRATION_MASK;
- _expiration = expiration;
- }
-
- public AMQShortString getMessageId()
- {
- decodeIfNecessary();
-
- return _messageId;
- }
-
- public String getMessageIdAsString()
- {
- decodeIfNecessary();
-
- return (_messageId == null) ? null : _messageId.toString();
- }
-
- public void setMessageId(String messageId)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= MESSAGE_ID_MASK;
- _messageId = (messageId == null) ? null : new AMQShortString(messageId);
- }
-
- public void setMessageId(AMQShortString messageId)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= MESSAGE_ID_MASK;
- _messageId = messageId;
- }
-
- public long getTimestamp()
- {
- decodeIfNecessary();
- return _timestamp;
- }
-
- public void setTimestamp(long timestamp)
- {
- clearEncodedForm();
- _propertyFlags |= TIMESTAMP_MASK;
- _timestamp = timestamp;
- }
-
- public String getTypeAsString()
- {
- decodeIfNecessary();
-
- return (_type == null) ? null : _type.toString();
- }
-
- public AMQShortString getType()
- {
- decodeIfNecessary();
-
- return _type;
- }
-
- public void setType(String type)
- {
- _hasBeenUpdated = true;
- setType((type == null) ? null : new AMQShortString(type));
- }
-
- public void setType(AMQShortString type)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= TYPE_MASK;
- _type = type;
- }
-
- public String getUserIdAsString()
- {
- decodeIfNecessary();
-
- return (_userId == null) ? null : _userId.toString();
- }
-
- public AMQShortString getUserId()
- {
- decodeIfNecessary();
-
- return _userId;
- }
-
- public void setUserId(String userId)
- {
- setUserId((userId == null) ? null : new AMQShortString(userId));
- }
-
- public void setUserId(AMQShortString userId)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= USER_ID_MASK;
- _userId = userId;
- }
-
- public String getAppIdAsString()
- {
- decodeIfNecessary();
-
- return (_appId == null) ? null : _appId.toString();
- }
-
- public AMQShortString getAppId()
- {
- decodeIfNecessary();
-
- return _appId;
- }
-
- public void setAppId(String appId)
- {
- _hasBeenUpdated = true;
- setAppId((appId == null) ? null : new AMQShortString(appId));
- }
-
- public void setAppId(AMQShortString appId)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= APPLICATION_ID_MASK;
- _appId = appId;
- _hasBeenUpdated = true;
- }
-
- public String getClusterIdAsString()
- {
- _hasBeenUpdated = true;
- decodeIfNecessary();
- return (_clusterId == null) ? null : _clusterId.toString();
- }
-
- public AMQShortString getClusterId()
- {
- _hasBeenUpdated = true;
- decodeIfNecessary();
- return _clusterId;
- }
-
- public void setClusterId(String clusterId)
- {
- _hasBeenUpdated = true;
- setClusterId((clusterId == null) ? null : new AMQShortString(clusterId));
- }
-
- public void setClusterId(AMQShortString clusterId)
- {
- _hasBeenUpdated = true;
- clearEncodedForm();
- _propertyFlags |= CLUSTER_ID_MASK;
- _clusterId = clusterId;
- }
-
- public String toString()
- {
- return "reply-to = " + _replyTo + ",propertyFlags = " + _propertyFlags + ",ApplicationID = " + _appId
- + ",ClusterID = " + _clusterId + ",UserId = " + _userId + ",JMSMessageID = " + _messageId
- + ",JMSCorrelationID = " + _correlationId + ",JMSDeliveryMode = " + _deliveryMode + ",JMSExpiration = "
- + _expiration + ",JMSPriority = " + _priority + ",JMSTimestamp = " + _timestamp + ",JMSType = " + _type;
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/BodyFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/BodyFactory.java
deleted file mode 100644
index 59646577e1..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/BodyFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-/**
- * Any class that is capable of turning a stream of bytes into an AMQ structure must implement this interface.
- */
-public interface BodyFactory
-{
- AMQBody createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException;
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/CommonContentHeaderProperties.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/CommonContentHeaderProperties.java
deleted file mode 100644
index 7162c37062..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/CommonContentHeaderProperties.java
+++ /dev/null
@@ -1,81 +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.
- *
- */
-
-package org.apache.qpid.framing;
-
-public interface CommonContentHeaderProperties extends ContentHeaderProperties
-{
- AMQShortString getContentType();
-
- void setContentType(AMQShortString contentType);
-
- FieldTable getHeaders();
-
- void setHeaders(FieldTable headers);
-
- byte getDeliveryMode();
-
- void setDeliveryMode(byte deliveryMode);
-
- byte getPriority();
-
- void setPriority(byte priority);
-
- AMQShortString getCorrelationId();
-
- void setCorrelationId(AMQShortString correlationId);
-
- AMQShortString getReplyTo();
-
- void setReplyTo(AMQShortString replyTo);
-
- long getExpiration();
-
- void setExpiration(long expiration);
-
- AMQShortString getMessageId();
-
- void setMessageId(AMQShortString messageId);
-
- long getTimestamp();
-
- void setTimestamp(long timestamp);
-
- AMQShortString getType();
-
- void setType(AMQShortString type);
-
- AMQShortString getUserId();
-
- void setUserId(AMQShortString userId);
-
- AMQShortString getAppId();
-
- void setAppId(AMQShortString appId);
-
- AMQShortString getClusterId();
-
- void setClusterId(AMQShortString clusterId);
-
- AMQShortString getEncoding();
-
- void setEncoding(AMQShortString encoding);
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/CompositeAMQDataBlock.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/CompositeAMQDataBlock.java
deleted file mode 100644
index 94030f383e..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/CompositeAMQDataBlock.java
+++ /dev/null
@@ -1,78 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class CompositeAMQDataBlock extends AMQDataBlock implements EncodableAMQDataBlock
-{
-
- private AMQDataBlock[] _blocks;
-
- public CompositeAMQDataBlock(AMQDataBlock[] blocks)
- {
- _blocks = blocks;
- }
-
-
- public AMQDataBlock[] getBlocks()
- {
- return _blocks;
- }
-
-
- public long getSize()
- {
- long frameSize = 0;
- for (int i = 0; i < _blocks.length; i++)
- {
- frameSize += _blocks[i].getSize();
- }
- return frameSize;
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- for (int i = 0; i < _blocks.length; i++)
- {
- _blocks[i].writePayload(buffer);
- }
- }
-
- public String toString()
- {
- if (_blocks == null)
- {
- return "No blocks contained in composite frame";
- }
- else
- {
- StringBuilder buf = new StringBuilder(this.getClass().getName());
- buf.append("{");
- for (int i = 0 ; i < _blocks.length; i++)
- {
- buf.append(" ").append(i).append("=[").append(_blocks[i].toString()).append("]");
- }
- buf.append("}");
- return buf.toString();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/Content.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/Content.java
deleted file mode 100644
index e5feeec2a4..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/Content.java
+++ /dev/null
@@ -1,26 +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.
- *
- */
-package org.apache.qpid.framing;
-
-public interface Content
-{
- // TODO: New Content class required for AMQP 0-9.
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java
deleted file mode 100644
index 9d39f8aa86..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java
+++ /dev/null
@@ -1,121 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-import org.apache.qpid.AMQException;
-
-public class ContentBody implements AMQBody
-{
- public static final byte TYPE = 3;
-
- public ByteBuffer payload;
-
- public ContentBody()
- {
- }
-
- public ContentBody(ByteBuffer buffer, long size) throws AMQFrameDecodingException
- {
- if (size > 0)
- {
- payload = buffer.slice();
- payload.limit((int) size);
- buffer.skip((int) size);
- }
-
- }
-
-
- public ContentBody(ByteBuffer payload)
- {
- this.payload = payload;
- }
-
- public byte getFrameType()
- {
- return TYPE;
- }
-
- public int getSize()
- {
- return (payload == null ? 0 : payload.limit());
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- if (payload != null)
- {
- if(payload.isDirect() || payload.isReadOnly())
- {
- ByteBuffer copy = payload.duplicate();
- buffer.put(copy.rewind());
- }
- else
- {
- buffer.put(payload.array(),payload.arrayOffset(),payload.limit());
- }
- }
- }
-
- public void handle(final int channelId, final AMQVersionAwareProtocolSession session)
- throws AMQException
- {
- session.contentBodyReceived(channelId, this);
- }
-
- protected void populateFromBuffer(ByteBuffer buffer, long size) throws AMQFrameDecodingException
- {
- if (size > 0)
- {
- payload = buffer.slice();
- payload.limit((int) size);
- buffer.skip((int) size);
- }
-
- }
-
- public void reduceBufferToFit()
- {
- if (payload != null && (payload.remaining() < payload.capacity() / 2))
- {
- int size = payload.limit();
- ByteBuffer newPayload = ByteBuffer.allocate(size);
-
- newPayload.put(payload);
- newPayload.flip();
-
- //reduce reference count on payload
- payload.release();
-
- payload = newPayload;
- }
- }
-
-
-
- public static AMQFrame createAMQFrame(int channelId, ContentBody body)
- {
- final AMQFrame frame = new AMQFrame(channelId, body);
- return frame;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java
deleted file mode 100644
index c42995d148..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ContentBodyFactory implements BodyFactory
-{
- private static final Logger _log = LoggerFactory.getLogger(AMQMethodBodyFactory.class);
-
- private static final ContentBodyFactory _instance = new ContentBodyFactory();
-
- public static ContentBodyFactory getInstance()
- {
- return _instance;
- }
-
- private ContentBodyFactory()
- {
- _log.debug("Creating content body factory");
- }
-
- public AMQBody createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
- {
- return new ContentBody(in, bodySize);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java
deleted file mode 100644
index 83e5a7e341..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-import org.apache.qpid.AMQException;
-
-public class ContentHeaderBody implements AMQBody
-{
- public static final byte TYPE = 2;
-
- public int classId;
-
- public int weight;
-
- /** unsigned long but java can't handle that anyway when allocating byte array */
- public long bodySize;
-
- /** must never be null */
- public ContentHeaderProperties properties;
-
- public ContentHeaderBody()
- {
- }
-
- public ContentHeaderBody(ByteBuffer buffer, long size) throws AMQFrameDecodingException
- {
- classId = buffer.getUnsignedShort();
- weight = buffer.getUnsignedShort();
- bodySize = buffer.getLong();
- int propertyFlags = buffer.getUnsignedShort();
- ContentHeaderPropertiesFactory factory = ContentHeaderPropertiesFactory.getInstance();
- properties = factory.createContentHeaderProperties(classId, propertyFlags, buffer, (int)size - 14);
-
- }
-
-
- public ContentHeaderBody(ContentHeaderProperties props, int classId)
- {
- properties = props;
- this.classId = classId;
- }
-
- public ContentHeaderBody(int classId, int weight, ContentHeaderProperties props, long bodySize)
- {
- this(props, classId);
- this.weight = weight;
- this.bodySize = bodySize;
- }
-
- public byte getFrameType()
- {
- return TYPE;
- }
-
- protected void populateFromBuffer(ByteBuffer buffer, long size)
- throws AMQFrameDecodingException, AMQProtocolVersionException
- {
- classId = buffer.getUnsignedShort();
- weight = buffer.getUnsignedShort();
- bodySize = buffer.getLong();
- int propertyFlags = buffer.getUnsignedShort();
- ContentHeaderPropertiesFactory factory = ContentHeaderPropertiesFactory.getInstance();
- properties = factory.createContentHeaderProperties(classId, propertyFlags, buffer, (int)size - 14);
- }
-
- /**
- * Helper method that is used currently by the persistence layer (by BDB at the moment).
- * @param buffer
- * @param size
- * @return
- * @throws AMQFrameDecodingException
- */
- public static ContentHeaderBody createFromBuffer(ByteBuffer buffer, long size)
- throws AMQFrameDecodingException, AMQProtocolVersionException
- {
- ContentHeaderBody body = new ContentHeaderBody(buffer, size);
-
- return body;
- }
-
- public int getSize()
- {
- return 2 + 2 + 8 + 2 + properties.getPropertyListSize();
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- EncodingUtils.writeUnsignedShort(buffer, classId);
- EncodingUtils.writeUnsignedShort(buffer, weight);
- buffer.putLong(bodySize);
- EncodingUtils.writeUnsignedShort(buffer, properties.getPropertyFlags());
- properties.writePropertyListPayload(buffer);
- }
-
- public void handle(final int channelId, final AMQVersionAwareProtocolSession session)
- throws AMQException
- {
- session.contentHeaderReceived(channelId, this);
- }
-
- public static AMQFrame createAMQFrame(int channelId, int classId, int weight, BasicContentHeaderProperties properties,
- long bodySize)
- {
- return new AMQFrame(channelId, new ContentHeaderBody(classId, weight, properties, bodySize));
- }
-
- public static AMQFrame createAMQFrame(int channelId, ContentHeaderBody body)
- {
- return new AMQFrame(channelId, body);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java
deleted file mode 100644
index 8d5e2f9fb4..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java
+++ /dev/null
@@ -1,50 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ContentHeaderBodyFactory implements BodyFactory
-{
- private static final Logger _log = LoggerFactory.getLogger(AMQMethodBodyFactory.class);
-
- private static final ContentHeaderBodyFactory _instance = new ContentHeaderBodyFactory();
-
- public static ContentHeaderBodyFactory getInstance()
- {
- return _instance;
- }
-
- private ContentHeaderBodyFactory()
- {
- _log.debug("Creating content header body factory");
- }
-
- public AMQBody createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
- {
- // all content headers are the same - it is only the properties that differ.
- // the content header body further delegates construction of properties
- return new ContentHeaderBody(in, bodySize);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java
deleted file mode 100644
index 7ef538cfdc..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java
+++ /dev/null
@@ -1,60 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-/**
- * There will be an implementation of this interface for each content type. All content types have associated
- * header properties and this provides a way to encode and decode them.
- */
-public interface ContentHeaderProperties
-{
- /**
- * Writes the property list to the buffer, in a suitably encoded form.
- * @param buffer The buffer to write to
- */
- void writePropertyListPayload(ByteBuffer buffer);
-
- /**
- * Populates the properties from buffer.
- * @param buffer The buffer to read from.
- * @param propertyFlags he property flags.
- * @throws AMQFrameDecodingException when the buffer does not contain valid data
- */
- void populatePropertiesFromBuffer(ByteBuffer buffer, int propertyFlags, int size)
- throws AMQFrameDecodingException;
-
- /**
- * @return the size of the encoded property list in bytes.
- */
- int getPropertyListSize();
-
- /**
- * Gets the property flags. Property flags indicate which properties are set in the list. The
- * position and meaning of each flag is defined in the protocol specification for the particular
- * content type with which these properties are associated.
- * @return flags
- */
- int getPropertyFlags();
-
- void updated();
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java
deleted file mode 100644
index 46189b63d7..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.framing.amqp_8_0.BasicConsumeBodyImpl;
-
-public class ContentHeaderPropertiesFactory
-{
- private static final ContentHeaderPropertiesFactory _instance = new ContentHeaderPropertiesFactory();
-
- public static ContentHeaderPropertiesFactory getInstance()
- {
- return _instance;
- }
-
- private ContentHeaderPropertiesFactory()
- {
- }
-
- public ContentHeaderProperties createContentHeaderProperties(int classId, int propertyFlags,
- ByteBuffer buffer, int size)
- throws AMQFrameDecodingException
- {
- ContentHeaderProperties properties;
- // AMQP version change: "Hardwired" version to major=8, minor=0
- // TODO: Change so that the actual version is obtained from
- // the ProtocolInitiation object for this session.
- if (classId == BasicConsumeBodyImpl.CLASS_ID)
- {
- properties = new BasicContentHeaderProperties();
- }
- else
- {
- throw new AMQFrameDecodingException(null, "Unsupport content header class id: " + classId, null);
- }
- properties.populatePropertiesFromBuffer(buffer, propertyFlags, size);
- return properties;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/DeferredDataBlock.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/DeferredDataBlock.java
deleted file mode 100644
index f6795ff200..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/DeferredDataBlock.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-/*
-*
-* 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.
-*
-*/
-public abstract class DeferredDataBlock extends AMQDataBlock
-{
- private AMQDataBlock _underlyingDataBlock;
-
-
- public long getSize()
- {
- if(_underlyingDataBlock == null)
- {
- _underlyingDataBlock = createAMQDataBlock();
- }
- return _underlyingDataBlock.getSize();
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- if(_underlyingDataBlock == null)
- {
- _underlyingDataBlock = createAMQDataBlock();
- }
- _underlyingDataBlock.writePayload(buffer);
- }
-
- abstract protected AMQDataBlock createAMQDataBlock();
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodableAMQDataBlock.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodableAMQDataBlock.java
deleted file mode 100644
index 9cf96e698c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodableAMQDataBlock.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-/**
- * Marker interface to indicate to MINA that a data block should be encoded with the
- * single encoder/decoder that we have defined.
- *
- * Note that due to a bug in MINA all classes must directly implement this interface, even if
- * a superclass implements it.
- * TODO: fix MINA so that this is not necessary
- *
- */
-public interface EncodableAMQDataBlock
-{
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java
deleted file mode 100644
index 6425f8c591..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java
+++ /dev/null
@@ -1,1033 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.nio.charset.Charset;
-
-public class EncodingUtils
-{
- private static final Logger _logger = LoggerFactory.getLogger(EncodingUtils.class);
-
- private static final String STRING_ENCODING = "iso8859-15";
-
- private static final Charset _charset = Charset.forName("iso8859-15");
-
- public static final int SIZEOF_UNSIGNED_SHORT = 2;
- public static final int SIZEOF_UNSIGNED_INT = 4;
- private static final boolean[] ALL_FALSE_ARRAY = new boolean[8];
-
- public static int encodedShortStringLength(String s)
- {
- if (s == null)
- {
- return 1;
- }
- else
- {
- return (short) (1 + s.length());
- }
- }
-
- public static int encodedShortStringLength(short s)
- {
- if (s == 0)
- {
- return 1 + 1;
- }
-
- int len = 0;
- if (s < 0)
- {
- len = 1;
- // sloppy - doesn't work of Integer.MIN_VALUE
- s = (short) -s;
- }
-
- if (s > 9999)
- {
- return 1 + 5;
- }
- else if (s > 999)
- {
- return 1 + 4;
- }
- else if (s > 99)
- {
- return 1 + 3;
- }
- else if (s > 9)
- {
- return 1 + 2;
- }
- else
- {
- return 1 + 1;
- }
-
- }
-
- public static int encodedShortStringLength(int i)
- {
- if (i == 0)
- {
- return 1 + 1;
- }
-
- int len = 0;
- if (i < 0)
- {
- len = 1;
- // sloppy - doesn't work of Integer.MIN_VALUE
- i = -i;
- }
-
- // range is now 1 - 2147483647
- if (i < Short.MAX_VALUE)
- {
- return len + encodedShortStringLength((short) i);
- }
- else if (i > 999999)
- {
- return len + 6 + encodedShortStringLength((short) (i / 1000000));
- }
- else // if (i > 99999)
- {
- return len + 5 + encodedShortStringLength((short) (i / 100000));
- }
-
- }
-
- public static int encodedShortStringLength(long l)
- {
- if (l == 0)
- {
- return 1 + 1;
- }
-
- int len = 0;
- if (l < 0)
- {
- len = 1;
- // sloppy - doesn't work of Long.MIN_VALUE
- l = -l;
- }
-
- if (l < Integer.MAX_VALUE)
- {
- return len + encodedShortStringLength((int) l);
- }
- else if (l > 9999999999L)
- {
- return len + 10 + encodedShortStringLength((int) (l / 10000000000L));
- }
- else
- {
- return len + 1 + encodedShortStringLength((int) (l / 10L));
- }
-
- }
-
- public static int encodedShortStringLength(AMQShortString s)
- {
- if (s == null)
- {
- return 1;
- }
- else
- {
- return (1 + s.length());
- }
- }
-
- public static int encodedLongStringLength(String s)
- {
- if (s == null)
- {
- return 4;
- }
- else
- {
- return 4 + s.length();
- }
- }
-
- public static int encodedLongStringLength(char[] s)
- {
- if (s == null)
- {
- return 4;
- }
- else
- {
- return 4 + s.length;
- }
- }
-
- public static int encodedLongstrLength(byte[] bytes)
- {
- if (bytes == null)
- {
- return 4;
- }
- else
- {
- return 4 + bytes.length;
- }
- }
-
- public static int encodedFieldTableLength(FieldTable table)
- {
- if (table == null)
- {
- // length is encoded as 4 octets
- return 4;
- }
- else
- {
- // length of the table plus 4 octets for the length
- return (int) table.getEncodedSize() + 4;
- }
- }
-
- public static int encodedContentLength(Content table)
- {
- // TODO: New Content class required for AMQP 0-9.
- return 0;
- }
-
- public static void writeShortStringBytes(ByteBuffer buffer, String s)
- {
- if (s != null)
- {
- byte[] encodedString = new byte[s.length()];
- char[] cha = s.toCharArray();
- for (int i = 0; i < cha.length; i++)
- {
- encodedString[i] = (byte) cha[i];
- }
-
- // TODO: check length fits in an unsigned byte
- writeUnsignedByte(buffer, (short)encodedString.length);
- buffer.put(encodedString);
-
-
- }
- else
- {
- // really writing out unsigned byte
- buffer.put((byte) 0);
- }
- }
-
- public static void writeShortStringBytes(ByteBuffer buffer, AMQShortString s)
- {
- if (s != null)
- {
-
- s.writeToBuffer(buffer);
- }
- else
- {
- // really writing out unsigned byte
- buffer.put((byte) 0);
- }
- }
-
- public static void writeLongStringBytes(ByteBuffer buffer, String s)
- {
- assert (s == null) || (s.length() <= 0xFFFE);
- if (s != null)
- {
- int len = s.length();
- writeUnsignedInteger(buffer, s.length());
- byte[] encodedString = new byte[len];
- char[] cha = s.toCharArray();
- for (int i = 0; i < cha.length; i++)
- {
- encodedString[i] = (byte) cha[i];
- }
-
- buffer.put(encodedString);
- }
- else
- {
- writeUnsignedInteger(buffer, 0);
- }
- }
-
- public static void writeLongStringBytes(ByteBuffer buffer, char[] s)
- {
- assert (s == null) || (s.length <= 0xFFFE);
- if (s != null)
- {
- int len = s.length;
- writeUnsignedInteger(buffer, s.length);
- byte[] encodedString = new byte[len];
- for (int i = 0; i < s.length; i++)
- {
- encodedString[i] = (byte) s[i];
- }
-
- buffer.put(encodedString);
- }
- else
- {
- writeUnsignedInteger(buffer, 0);
- }
- }
-
- public static void writeLongStringBytes(ByteBuffer buffer, byte[] bytes)
- {
- assert (bytes == null) || (bytes.length <= 0xFFFE);
- if (bytes != null)
- {
- writeUnsignedInteger(buffer, bytes.length);
- buffer.put(bytes);
- }
- else
- {
- writeUnsignedInteger(buffer, 0);
- }
- }
-
- public static void writeUnsignedByte(ByteBuffer buffer, short b)
- {
- byte bv = (byte) b;
- buffer.put(bv);
- }
-
- public static void writeUnsignedShort(ByteBuffer buffer, int s)
- {
- // TODO: Is this comparison safe? Do I need to cast RHS to long?
- if (s < Short.MAX_VALUE)
- {
- buffer.putShort((short) s);
- }
- else
- {
- short sv = (short) s;
- buffer.put((byte) (0xFF & (sv >> 8)));
- buffer.put((byte) (0xFF & sv));
- }
- }
-
- public static int unsignedIntegerLength()
- {
- return 4;
- }
-
- public static void writeUnsignedInteger(ByteBuffer buffer, long l)
- {
- // TODO: Is this comparison safe? Do I need to cast RHS to long?
- if (l < Integer.MAX_VALUE)
- {
- buffer.putInt((int) l);
- }
- else
- {
- int iv = (int) l;
-
- // FIXME: This *may* go faster if we build this into a local 4-byte array and then
- // put the array in a single call.
- buffer.put((byte) (0xFF & (iv >> 24)));
- buffer.put((byte) (0xFF & (iv >> 16)));
- buffer.put((byte) (0xFF & (iv >> 8)));
- buffer.put((byte) (0xFF & iv));
- }
- }
-
- public static void writeFieldTableBytes(ByteBuffer buffer, FieldTable table)
- {
- if (table != null)
- {
- table.writeToBuffer(buffer);
- }
- else
- {
- EncodingUtils.writeUnsignedInteger(buffer, 0);
- }
- }
-
- public static void writeContentBytes(ByteBuffer buffer, Content content)
- {
- // TODO: New Content class required for AMQP 0-9.
- }
-
- public static void writeBooleans(ByteBuffer buffer, boolean[] values)
- {
- byte packedValue = 0;
- for (int i = 0; i < values.length; i++)
- {
- if (values[i])
- {
- packedValue = (byte) (packedValue | (1 << i));
- }
- }
-
- buffer.put(packedValue);
- }
-
- public static void writeBooleans(ByteBuffer buffer, boolean value)
- {
-
- buffer.put(value ? (byte) 1 : (byte) 0);
- }
-
- public static void writeBooleans(ByteBuffer buffer, boolean value0, boolean value1)
- {
- byte packedValue = value0 ? (byte) 1 : (byte) 0;
-
- if (value1)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 1));
- }
-
- buffer.put(packedValue);
- }
-
- public static void writeBooleans(ByteBuffer buffer, boolean value0, boolean value1, boolean value2)
- {
- byte packedValue = value0 ? (byte) 1 : (byte) 0;
-
- if (value1)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 1));
- }
-
- if (value2)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 2));
- }
-
- buffer.put(packedValue);
- }
-
- public static void writeBooleans(ByteBuffer buffer, boolean value0, boolean value1, boolean value2, boolean value3)
- {
- byte packedValue = value0 ? (byte) 1 : (byte) 0;
-
- if (value1)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 1));
- }
-
- if (value2)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 2));
- }
-
- if (value3)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 3));
- }
-
- buffer.put(packedValue);
- }
-
- public static void writeBooleans(ByteBuffer buffer, boolean value0, boolean value1, boolean value2, boolean value3,
- boolean value4)
- {
- byte packedValue = value0 ? (byte) 1 : (byte) 0;
-
- if (value1)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 1));
- }
-
- if (value2)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 2));
- }
-
- if (value3)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 3));
- }
-
- if (value4)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 4));
- }
-
- buffer.put(packedValue);
- }
-
- public static void writeBooleans(ByteBuffer buffer, boolean value0, boolean value1, boolean value2, boolean value3,
- boolean value4, boolean value5)
- {
- byte packedValue = value0 ? (byte) 1 : (byte) 0;
-
- if (value1)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 1));
- }
-
- if (value2)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 2));
- }
-
- if (value3)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 3));
- }
-
- if (value4)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 4));
- }
-
- if (value5)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 5));
- }
-
- buffer.put(packedValue);
- }
-
- public static void writeBooleans(ByteBuffer buffer, boolean value0, boolean value1, boolean value2, boolean value3,
- boolean value4, boolean value5, boolean value6)
- {
- byte packedValue = value0 ? (byte) 1 : (byte) 0;
-
- if (value1)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 1));
- }
-
- if (value2)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 2));
- }
-
- if (value3)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 3));
- }
-
- if (value4)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 4));
- }
-
- if (value5)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 5));
- }
-
- if (value6)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 6));
- }
-
- buffer.put(packedValue);
- }
-
- public static void writeBooleans(ByteBuffer buffer, boolean value0, boolean value1, boolean value2, boolean value3,
- boolean value4, boolean value5, boolean value6, boolean value7)
- {
- byte packedValue = value0 ? (byte) 1 : (byte) 0;
-
- if (value1)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 1));
- }
-
- if (value2)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 2));
- }
-
- if (value3)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 3));
- }
-
- if (value4)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 4));
- }
-
- if (value5)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 5));
- }
-
- if (value6)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 6));
- }
-
- if (value7)
- {
- packedValue = (byte) (packedValue | (byte) (1 << 7));
- }
-
- buffer.put(packedValue);
- }
-
- /**
- * This is used for writing longstrs.
- *
- * @param buffer
- * @param data
- */
- public static void writeLongstr(ByteBuffer buffer, byte[] data)
- {
- if (data != null)
- {
- writeUnsignedInteger(buffer, data.length);
- buffer.put(data);
- }
- else
- {
- writeUnsignedInteger(buffer, 0);
- }
- }
-
- public static void writeTimestamp(ByteBuffer buffer, long timestamp)
- {
- writeLong(buffer, timestamp);
- }
-
- public static boolean[] readBooleans(ByteBuffer buffer)
- {
- final byte packedValue = buffer.get();
- if (packedValue == 0)
- {
- return ALL_FALSE_ARRAY;
- }
-
- final boolean[] result = new boolean[8];
-
- result[0] = ((packedValue & 1) != 0);
- result[1] = ((packedValue & (1 << 1)) != 0);
- result[2] = ((packedValue & (1 << 2)) != 0);
- result[3] = ((packedValue & (1 << 3)) != 0);
- if ((packedValue & 0xF0) == 0)
- {
- result[0] = ((packedValue & 1) != 0);
- }
-
- result[4] = ((packedValue & (1 << 4)) != 0);
- result[5] = ((packedValue & (1 << 5)) != 0);
- result[6] = ((packedValue & (1 << 6)) != 0);
- result[7] = ((packedValue & (1 << 7)) != 0);
-
- return result;
- }
-
- public static FieldTable readFieldTable(ByteBuffer buffer) throws AMQFrameDecodingException
- {
- long length = buffer.getUnsignedInt();
- if (length == 0)
- {
- return null;
- }
- else
- {
- return FieldTableFactory.newFieldTable(buffer, length);
- }
- }
-
- public static Content readContent(ByteBuffer buffer) throws AMQFrameDecodingException
- {
- // TODO: New Content class required for AMQP 0-9.
- return null;
- }
-
- public static AMQShortString readAMQShortString(ByteBuffer buffer)
- {
- return AMQShortString.readFromBuffer(buffer);
-
- }
-
- public static String readShortString(ByteBuffer buffer)
- {
- short length = buffer.getUnsigned();
- if (length == 0)
- {
- return null;
- }
- else
- {
- // this may seem rather odd to declare two array but testing has shown
- // that constructing a string from a byte array is 5 (five) times slower
- // than constructing one from a char array.
- // this approach here is valid since we know that all the chars are
- // ASCII (0-127)
- byte[] stringBytes = new byte[length];
- buffer.get(stringBytes, 0, length);
- char[] stringChars = new char[length];
- for (int i = 0; i < stringChars.length; i++)
- {
- stringChars[i] = (char) stringBytes[i];
- }
-
- return new String(stringChars);
- }
- }
-
- public static String readLongString(ByteBuffer buffer)
- {
- long length = buffer.getUnsignedInt();
- if (length == 0)
- {
- return "";
- }
- else
- {
- // this may seem rather odd to declare two array but testing has shown
- // that constructing a string from a byte array is 5 (five) times slower
- // than constructing one from a char array.
- // this approach here is valid since we know that all the chars are
- // ASCII (0-127)
- byte[] stringBytes = new byte[(int) length];
- buffer.get(stringBytes, 0, (int) length);
- char[] stringChars = new char[(int) length];
- for (int i = 0; i < stringChars.length; i++)
- {
- stringChars[i] = (char) stringBytes[i];
- }
-
- return new String(stringChars);
- }
- }
-
- public static byte[] readLongstr(ByteBuffer buffer)
- {
- long length = buffer.getUnsignedInt();
- if (length == 0)
- {
- return null;
- }
- else
- {
- byte[] result = new byte[(int) length];
- buffer.get(result);
-
- return result;
- }
- }
-
- public static long readTimestamp(ByteBuffer buffer)
- {
- // Discard msb from AMQ timestamp
- // buffer.getUnsignedInt();
- return buffer.getLong();
- }
-
- static byte[] hexToByteArray(String id)
- {
- // Should check param for null, long enough for this check, upper-case and trailing char
- String s = (id.charAt(1) == 'x') ? id.substring(2) : id; // strip 0x
-
- int len = s.length();
- int byte_len = len / 2;
- byte[] b = new byte[byte_len];
-
- for (int i = 0; i < byte_len; i++)
- {
- // fixme: refine these repetitive subscript calcs.
- int ch = i * 2;
-
- byte b1 = Byte.parseByte(s.substring(ch, ch + 1), 16);
- byte b2 = Byte.parseByte(s.substring(ch + 1, ch + 2), 16);
-
- b[i] = (byte) ((b1 * 16) + b2);
- }
-
- return (b);
- }
-
- public static char[] convertToHexCharArray(byte[] from)
- {
- int length = from.length;
- char[] result_buff = new char[(length * 2) + 2];
-
- result_buff[0] = '0';
- result_buff[1] = 'x';
-
- int bite;
- int dest = 2;
-
- for (int i = 0; i < length; i++)
- {
- bite = from[i];
-
- if (bite < 0)
- {
- bite += 256;
- }
-
- result_buff[dest++] = hex_chars[bite >> 4];
- result_buff[dest++] = hex_chars[bite & 0x0f];
- }
-
- return (result_buff);
- }
-
- public static String convertToHexString(byte[] from)
- {
- return (new String(convertToHexCharArray(from)));
- }
-
- public static String convertToHexString(ByteBuffer bb)
- {
- int size = bb.limit();
-
- byte[] from = new byte[size];
-
- // Is this not the same.
- // bb.get(from, 0, length);
- for (int i = 0; i < size; i++)
- {
- from[i] = bb.get(i);
- }
-
- return (new String(convertToHexCharArray(from)));
- }
-
- private static char[] hex_chars = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
-
- // **** new methods
-
- // AMQP_BOOLEAN_PROPERTY_PREFIX
-
- public static void writeBoolean(ByteBuffer buffer, Boolean aBoolean)
- {
- buffer.put((byte) (aBoolean ? 1 : 0));
- }
-
- public static boolean readBoolean(ByteBuffer buffer)
- {
- byte packedValue = buffer.get();
-
- return (packedValue == 1);
- }
-
- public static int encodedBooleanLength()
- {
- return 1;
- }
-
- // AMQP_BYTE_PROPERTY_PREFIX
- public static void writeByte(ByteBuffer buffer, Byte aByte)
- {
- buffer.put(aByte);
- }
-
- public static byte readByte(ByteBuffer buffer)
- {
- return buffer.get();
- }
-
- public static int encodedByteLength()
- {
- return 1;
- }
-
- // AMQP_SHORT_PROPERTY_PREFIX
- public static void writeShort(ByteBuffer buffer, Short aShort)
- {
- buffer.putShort(aShort);
- }
-
- public static short readShort(ByteBuffer buffer)
- {
- return buffer.getShort();
- }
-
- public static int encodedShortLength()
- {
- return 2;
- }
-
- // INTEGER_PROPERTY_PREFIX
- public static void writeInteger(ByteBuffer buffer, Integer aInteger)
- {
- buffer.putInt(aInteger);
- }
-
- public static int readInteger(ByteBuffer buffer)
- {
- return buffer.getInt();
- }
-
- public static int encodedIntegerLength()
- {
- return 4;
- }
-
- // AMQP_LONG_PROPERTY_PREFIX
- public static void writeLong(ByteBuffer buffer, Long aLong)
- {
- buffer.putLong(aLong);
- }
-
- public static long readLong(ByteBuffer buffer)
- {
- return buffer.getLong();
- }
-
- public static int encodedLongLength()
- {
- return 8;
- }
-
- // Float_PROPERTY_PREFIX
- public static void writeFloat(ByteBuffer buffer, Float aFloat)
- {
- buffer.putFloat(aFloat);
- }
-
- public static float readFloat(ByteBuffer buffer)
- {
- return buffer.getFloat();
- }
-
- public static int encodedFloatLength()
- {
- return 4;
- }
-
- // Double_PROPERTY_PREFIX
- public static void writeDouble(ByteBuffer buffer, Double aDouble)
- {
- buffer.putDouble(aDouble);
- }
-
- public static double readDouble(ByteBuffer buffer)
- {
- return buffer.getDouble();
- }
-
- public static int encodedDoubleLength()
- {
- return 8;
- }
-
- public static byte[] readBytes(ByteBuffer buffer)
- {
- long length = buffer.getUnsignedInt();
- if (length == 0)
- {
- return null;
- }
- else
- {
- byte[] dataBytes = new byte[(int)length];
- buffer.get(dataBytes, 0, (int)length);
-
- return dataBytes;
- }
- }
-
- public static void writeBytes(ByteBuffer buffer, byte[] data)
- {
- if (data != null)
- {
- // TODO: check length fits in an unsigned byte
- writeUnsignedInteger(buffer, (long)data.length);
- buffer.put(data);
- }
- else
- {
- // really writing out unsigned byte
- //buffer.put((byte) 0);
- writeUnsignedInteger(buffer, 0L);
- }
- }
-
- // CHAR_PROPERTY
- public static int encodedCharLength()
- {
- return encodedByteLength();
- }
-
- public static char readChar(ByteBuffer buffer)
- {
- // This is valid as we know that the Character is ASCII 0..127
- return (char) buffer.get();
- }
-
- public static void writeChar(ByteBuffer buffer, char character)
- {
- // This is valid as we know that the Character is ASCII 0..127
- writeByte(buffer, (byte) character);
- }
-
- public static long readLongAsShortString(ByteBuffer buffer)
- {
- short length = buffer.getUnsigned();
- short pos = 0;
- if (length == 0)
- {
- return 0L;
- }
-
- byte digit = buffer.get();
- boolean isNegative;
- long result = 0;
- if (digit == (byte) '-')
- {
- isNegative = true;
- pos++;
- digit = buffer.get();
- }
- else
- {
- isNegative = false;
- }
-
- result = digit - (byte) '0';
- pos++;
-
- while (pos < length)
- {
- pos++;
- digit = buffer.get();
- result = (result << 3) + (result << 1);
- result += digit - (byte) '0';
- }
-
- return result;
- }
-
- public static long readUnsignedInteger(ByteBuffer buffer)
- {
- long l = 0xFF & buffer.get();
- l <<= 8;
- l = l | (0xFF & buffer.get());
- l <<= 8;
- l = l | (0xFF & buffer.get());
- l <<= 8;
- l = l | (0xFF & buffer.get());
-
- return l;
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java
deleted file mode 100644
index ed01c91804..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java
+++ /dev/null
@@ -1,1187 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.AMQPInvalidClassException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.math.BigDecimal;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-// extends FieldTable
-public class FieldTable
-{
- private static final Logger _logger = LoggerFactory.getLogger(FieldTable.class);
- private static final String STRICT_AMQP = "STRICT_AMQP";
- private final boolean _strictAMQP = Boolean.valueOf(System.getProperty(STRICT_AMQP, "false"));
-
- private ByteBuffer _encodedForm;
- private LinkedHashMap<AMQShortString, AMQTypedValue> _properties;
- private long _encodedSize;
- private static final int INITIAL_HASHMAP_CAPACITY = 16;
- private static final int INITIAL_ENCODED_FORM_SIZE = 256;
-
- public FieldTable()
- {
- super();
- // _encodedForm = ByteBuffer.allocate(INITIAL_ENCODED_FORM_SIZE);
- // _encodedForm.setAutoExpand(true);
- // _encodedForm.limit(0);
- }
-
- /**
- * Construct a new field table.
- *
- * @param buffer the buffer from which to read data. The length byte must be read already
- * @param length the length of the field table. Must be > 0.
- *
- * @throws AMQFrameDecodingException if there is an error decoding the table
- */
- public FieldTable(ByteBuffer buffer, long length) throws AMQFrameDecodingException
- {
- this();
- _encodedForm = buffer.slice();
- _encodedForm.limit((int) length);
- _encodedSize = length;
- buffer.skip((int) length);
- }
-
- public AMQTypedValue getProperty(AMQShortString string)
- {
- checkPropertyName(string);
-
- synchronized (this)
- {
- if (_properties == null)
- {
- if (_encodedForm == null)
- {
- return null;
- }
- else
- {
- populateFromBuffer();
- }
- }
- }
-
- if (_properties == null)
- {
- return null;
- }
- else
- {
- return _properties.get(string);
- }
- }
-
- private void populateFromBuffer()
- {
- try
- {
- setFromBuffer(_encodedForm, _encodedSize);
- }
- catch (AMQFrameDecodingException e)
- {
- _logger.error("Error decoding FieldTable in deferred decoding mode ", e);
- throw new IllegalArgumentException(e);
- }
- }
-
- private AMQTypedValue setProperty(AMQShortString key, AMQTypedValue val)
- {
- checkPropertyName(key);
- initMapIfNecessary();
- if (_properties.containsKey(key))
- {
- _encodedForm = null;
-
- if (val == null)
- {
- return removeKey(key);
- }
- }
- else if ((_encodedForm != null) && (val != null))
- {
- EncodingUtils.writeShortStringBytes(_encodedForm, key);
- val.writeToBuffer(_encodedForm);
-
- }
- else if (val == null)
- {
- return null;
- }
-
- AMQTypedValue oldVal = _properties.put(key, val);
- if (oldVal != null)
- {
- _encodedSize -= oldVal.getEncodingSize();
- }
- else
- {
- _encodedSize += EncodingUtils.encodedShortStringLength(key) + 1;
- }
-
- _encodedSize += val.getEncodingSize();
-
- return oldVal;
- }
-
- private void initMapIfNecessary()
- {
- synchronized (this)
- {
- if (_properties == null)
- {
- if ((_encodedForm == null) || (_encodedSize == 0))
- {
- _properties = new LinkedHashMap<AMQShortString, AMQTypedValue>();
- }
- else
- {
- populateFromBuffer();
- }
- }
-
- }
- }
-
- public Boolean getBoolean(String string)
- {
- return getBoolean(new AMQShortString(string));
- }
-
- public Boolean getBoolean(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
- if ((value != null) && (value.getType() == AMQType.BOOLEAN))
- {
- return (Boolean) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- public Byte getByte(String string)
- {
- return getByte(new AMQShortString(string));
- }
-
- public Byte getByte(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
- if ((value != null) && (value.getType() == AMQType.BYTE))
- {
- return (Byte) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- public Short getShort(String string)
- {
- return getShort(new AMQShortString(string));
- }
-
- public Short getShort(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
- if ((value != null) && (value.getType() == AMQType.SHORT))
- {
- return (Short) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- public Integer getInteger(String string)
- {
- return getInteger(new AMQShortString(string));
- }
-
- public Integer getInteger(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
- if ((value != null) && (value.getType() == AMQType.INT))
- {
- return (Integer) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- public Long getLong(String string)
- {
- return getLong(new AMQShortString(string));
- }
-
- public Long getLong(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
- if ((value != null) && (value.getType() == AMQType.LONG))
- {
- return (Long) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- public Float getFloat(String string)
- {
- return getFloat(new AMQShortString(string));
- }
-
- public Float getFloat(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
- if ((value != null) && (value.getType() == AMQType.FLOAT))
- {
- return (Float) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- public Double getDouble(String string)
- {
- return getDouble(new AMQShortString(string));
- }
-
- public Double getDouble(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
- if ((value != null) && (value.getType() == AMQType.DOUBLE))
- {
- return (Double) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- public String getString(String string)
- {
- return getString(new AMQShortString(string));
- }
-
- public String getString(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
- if ((value != null) && ((value.getType() == AMQType.WIDE_STRING) || (value.getType() == AMQType.ASCII_STRING)))
- {
- return (String) value.getValue();
- }
- else if ((value != null) && (value.getValue() != null) && !(value.getValue() instanceof byte[]))
- {
- return String.valueOf(value.getValue());
- }
- else
- {
- return null;
- }
-
- }
-
- public Character getCharacter(String string)
- {
- return getCharacter(new AMQShortString(string));
- }
-
- public Character getCharacter(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
- if ((value != null) && (value.getType() == AMQType.ASCII_CHARACTER))
- {
- return (Character) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- public byte[] getBytes(String string)
- {
- return getBytes(new AMQShortString(string));
- }
-
- public byte[] getBytes(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
- if ((value != null) && (value.getType() == AMQType.BINARY))
- {
- return (byte[]) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- /**
- * Extracts a value from the field table that is itself a FieldTable associated with the specified parameter name.
- *
- * @param string The name of the parameter to get the associated FieldTable value for.
- *
- * @return The associated FieldTable value, or <tt>null</tt> if the associated value is not of FieldTable type or
- * not present in the field table at all.
- */
- public FieldTable getFieldTable(String string)
- {
- return getFieldTable(new AMQShortString(string));
- }
-
- /**
- * Extracts a value from the field table that is itself a FieldTable associated with the specified parameter name.
- *
- * @param string The name of the parameter to get the associated FieldTable value for.
- *
- * @return The associated FieldTable value, or <tt>null</tt> if the associated value is not of FieldTable type or
- * not present in the field table at all.
- */
- public FieldTable getFieldTable(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
-
- if ((value != null) && (value.getType() == AMQType.FIELD_TABLE))
- {
- return (FieldTable) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- public Object getObject(String string)
- {
- return getObject(new AMQShortString(string));
- }
-
- public Object getObject(AMQShortString string)
- {
- AMQTypedValue value = getProperty(string);
- if (value != null)
- {
- return value.getValue();
- }
- else
- {
- return value;
- }
-
- }
-
- public Long getTimestamp(AMQShortString name)
- {
- AMQTypedValue value = getProperty(name);
- if ((value != null) && (value.getType() == AMQType.TIMESTAMP))
- {
- return (Long) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- public BigDecimal getDecimal(AMQShortString propertyName)
- {
- AMQTypedValue value = getProperty(propertyName);
- if ((value != null) && (value.getType() == AMQType.DECIMAL))
- {
- return (BigDecimal) value.getValue();
- }
- else
- {
- return null;
- }
- }
-
- // ************ Setters
- public Object setBoolean(String string, Boolean b)
- {
- return setBoolean(new AMQShortString(string), b);
- }
-
- public Object setBoolean(AMQShortString string, Boolean b)
- {
- return setProperty(string, AMQType.BOOLEAN.asTypedValue(b));
- }
-
- public Object setByte(String string, Byte b)
- {
- return setByte(new AMQShortString(string), b);
- }
-
- public Object setByte(AMQShortString string, Byte b)
- {
- return setProperty(string, AMQType.BYTE.asTypedValue(b));
- }
-
- public Object setShort(String string, Short i)
- {
- return setShort(new AMQShortString(string), i);
- }
-
- public Object setShort(AMQShortString string, Short i)
- {
- return setProperty(string, AMQType.SHORT.asTypedValue(i));
- }
-
- public Object setInteger(String string, Integer i)
- {
- return setInteger(new AMQShortString(string), i);
- }
-
- public Object setInteger(AMQShortString string, Integer i)
- {
- return setProperty(string, AMQType.INT.asTypedValue(i));
- }
-
- public Object setLong(String string, Long l)
- {
- return setLong(new AMQShortString(string), l);
- }
-
- public Object setLong(AMQShortString string, Long l)
- {
- return setProperty(string, AMQType.LONG.asTypedValue(l));
- }
-
- public Object setFloat(String string, Float f)
- {
- return setFloat(new AMQShortString(string), f);
- }
-
- public Object setFloat(AMQShortString string, Float v)
- {
- return setProperty(string, AMQType.FLOAT.asTypedValue(v));
- }
-
- public Object setDouble(String string, Double d)
- {
- return setDouble(new AMQShortString(string), d);
- }
-
- public Object setDouble(AMQShortString string, Double v)
- {
- return setProperty(string, AMQType.DOUBLE.asTypedValue(v));
- }
-
- public Object setString(String string, String s)
- {
- return setString(new AMQShortString(string), s);
- }
-
- public Object setAsciiString(AMQShortString string, String value)
- {
- if (value == null)
- {
- return setProperty(string, AMQType.VOID.asTypedValue(null));
- }
- else
- {
- return setProperty(string, AMQType.ASCII_STRING.asTypedValue(value));
- }
- }
-
- public Object setString(AMQShortString string, String value)
- {
- if (value == null)
- {
- return setProperty(string, AMQType.VOID.asTypedValue(null));
- }
- else
- {
- return setProperty(string, AMQType.LONG_STRING.asTypedValue(value));
- }
- }
-
- public Object setChar(String string, char c)
- {
- return setChar(new AMQShortString(string), c);
- }
-
- public Object setChar(AMQShortString string, char c)
- {
- return setProperty(string, AMQType.ASCII_CHARACTER.asTypedValue(c));
- }
-
- public Object setBytes(String string, byte[] b)
- {
- return setBytes(new AMQShortString(string), b);
- }
-
- public Object setBytes(AMQShortString string, byte[] bytes)
- {
- return setProperty(string, AMQType.BINARY.asTypedValue(bytes));
- }
-
- public Object setBytes(String string, byte[] bytes, int start, int length)
- {
- return setBytes(new AMQShortString(string), bytes, start, length);
- }
-
- public Object setBytes(AMQShortString string, byte[] bytes, int start, int length)
- {
- byte[] newBytes = new byte[length];
- System.arraycopy(bytes, start, newBytes, 0, length);
-
- return setBytes(string, bytes);
- }
-
- public Object setObject(String string, Object o)
- {
- return setObject(new AMQShortString(string), o);
- }
-
- public Object setTimestamp(AMQShortString string, long datetime)
- {
- return setProperty(string, AMQType.TIMESTAMP.asTypedValue(datetime));
- }
-
- public Object setDecimal(AMQShortString string, BigDecimal decimal)
- {
- if (decimal.longValue() > Integer.MAX_VALUE)
- {
- throw new UnsupportedOperationException("AMQP doesnot support decimals larger than " + Integer.MAX_VALUE);
- }
-
- if (decimal.scale() > Byte.MAX_VALUE)
- {
- throw new UnsupportedOperationException("AMQP doesnot support decimal scales larger than " + Byte.MAX_VALUE);
- }
-
- return setProperty(string, AMQType.DECIMAL.asTypedValue(decimal));
- }
-
- public Object setVoid(AMQShortString string)
- {
- return setProperty(string, AMQType.VOID.asTypedValue(null));
- }
-
- /**
- * Associates a nested field table with the specified parameter name.
- *
- * @param string The name of the parameter to store in the table.
- * @param ftValue The field table value to associate with the parameter name.
- *
- * @return The stored value.
- */
- public Object setFieldTable(String string, FieldTable ftValue)
- {
- return setFieldTable(new AMQShortString(string), ftValue);
- }
-
- /**
- * Associates a nested field table with the specified parameter name.
- *
- * @param string The name of the parameter to store in the table.
- * @param ftValue The field table value to associate with the parameter name.
- *
- * @return The stored value.
- */
- public Object setFieldTable(AMQShortString string, FieldTable ftValue)
- {
- return setProperty(string, AMQType.FIELD_TABLE.asTypedValue(ftValue));
- }
-
- public Object setObject(AMQShortString string, Object object)
- {
- if (object instanceof Boolean)
- {
- return setBoolean(string, (Boolean) object);
- }
- else if (object instanceof Byte)
- {
- return setByte(string, (Byte) object);
- }
- else if (object instanceof Short)
- {
- return setShort(string, (Short) object);
- }
- else if (object instanceof Integer)
- {
- return setInteger(string, (Integer) object);
- }
- else if (object instanceof Long)
- {
- return setLong(string, (Long) object);
- }
- else if (object instanceof Float)
- {
- return setFloat(string, (Float) object);
- }
- else if (object instanceof Double)
- {
- return setDouble(string, (Double) object);
- }
- else if (object instanceof String)
- {
- return setString(string, (String) object);
- }
- else if (object instanceof Character)
- {
- return setChar(string, (Character) object);
- }
- else if (object instanceof byte[])
- {
- return setBytes(string, (byte[]) object);
- }
-
- throw new AMQPInvalidClassException("Only Primatives objects allowed Object is:" + object.getClass());
- }
-
- public boolean isNullStringValue(String name)
- {
- AMQTypedValue value = getProperty(new AMQShortString(name));
-
- return (value != null) && (value.getType() == AMQType.VOID);
- }
-
- // ***** Methods
-
- public Enumeration getPropertyNames()
- {
- return Collections.enumeration(keys());
- }
-
- public boolean propertyExists(AMQShortString propertyName)
- {
- return itemExists(propertyName);
- }
-
- public boolean propertyExists(String propertyName)
- {
- return itemExists(propertyName);
- }
-
- public boolean itemExists(AMQShortString propertyName)
- {
- checkPropertyName(propertyName);
- initMapIfNecessary();
-
- return _properties.containsKey(propertyName);
- }
-
- public boolean itemExists(String string)
- {
- return itemExists(new AMQShortString(string));
- }
-
- public String toString()
- {
- initMapIfNecessary();
-
- return _properties.toString();
- }
-
- private void checkPropertyName(AMQShortString propertyName)
- {
- if (propertyName == null)
- {
- throw new IllegalArgumentException("Property name must not be null");
- }
- else if (propertyName.length() == 0)
- {
- throw new IllegalArgumentException("Property name must not be the empty string");
- }
-
- if (_strictAMQP)
- {
- checkIdentiferFormat(propertyName);
- }
- }
-
- protected static void checkIdentiferFormat(AMQShortString propertyName)
- {
- // AMQP Spec: 4.2.5.5 Field Tables
- // Guidelines for implementers:
- // * Field names MUST start with a letter, '$' or '#' and may continue with
- // letters, '$' or '#', digits, or underlines, to a maximum length of 128
- // characters.
- // * The server SHOULD validate field names and upon receiving an invalid
- // field name, it SHOULD signal a connection exception with reply code
- // 503 (syntax error). Conformance test: amq_wlp_table_01.
- // * A peer MUST handle duplicate fields by using only the first instance.
-
- // AMQP length limit
- if (propertyName.length() > 128)
- {
- throw new IllegalArgumentException("AMQP limits property names to 128 characters");
- }
-
- // AMQ start character
- if (!(Character.isLetter(propertyName.charAt(0)) || (propertyName.charAt(0) == '$')
- || (propertyName.charAt(0) == '#') || (propertyName.charAt(0) == '_'))) // Not official AMQP added for JMS.
- {
- throw new IllegalArgumentException("Identifier '" + propertyName
- + "' does not start with a valid AMQP start character");
- }
- }
-
- // ************************* Byte Buffer Processing
-
- public void writeToBuffer(ByteBuffer buffer)
- {
- final boolean trace = _logger.isDebugEnabled();
-
- if (trace)
- {
- _logger.debug("FieldTable::writeToBuffer: Writing encoded length of " + getEncodedSize() + "...");
- if (_properties != null)
- {
- _logger.debug(_properties.toString());
- }
- }
-
- EncodingUtils.writeUnsignedInteger(buffer, getEncodedSize());
-
- putDataInBuffer(buffer);
- }
-
- public byte[] getDataAsBytes()
- {
- final int encodedSize = (int) getEncodedSize();
- final ByteBuffer buffer = ByteBuffer.allocate(encodedSize); // FIXME XXX: Is cast a problem?
-
- putDataInBuffer(buffer);
-
- final byte[] result = new byte[encodedSize];
- buffer.flip();
- buffer.get(result);
- buffer.release();
-
- return result;
- }
-
- public long getEncodedSize()
- {
- return _encodedSize;
- }
-
- private void recalculateEncodedSize()
- {
-
- int encodedSize = 0;
- if (_properties != null)
- {
- for (Map.Entry<AMQShortString, AMQTypedValue> e : _properties.entrySet())
- {
- encodedSize += EncodingUtils.encodedShortStringLength(e.getKey());
- encodedSize++; // the byte for the encoding Type
- encodedSize += e.getValue().getEncodingSize();
-
- }
- }
-
- _encodedSize = encodedSize;
- }
-
- public void addAll(FieldTable fieldTable)
- {
- initMapIfNecessary();
- _encodedForm = null;
- _properties.putAll(fieldTable._properties);
- recalculateEncodedSize();
- }
-
- public static interface FieldTableElementProcessor
- {
- public boolean processElement(String propertyName, AMQTypedValue value);
-
- public Object getResult();
- }
-
- public Object processOverElements(FieldTableElementProcessor processor)
- {
- initMapIfNecessary();
- if (_properties != null)
- {
- for (Map.Entry<AMQShortString, AMQTypedValue> e : _properties.entrySet())
- {
- boolean result = processor.processElement(e.getKey().toString(), e.getValue());
- if (!result)
- {
- break;
- }
- }
- }
-
- return processor.getResult();
-
- }
-
- public int size()
- {
- initMapIfNecessary();
-
- return _properties.size();
-
- }
-
- public boolean isEmpty()
- {
- return size() == 0;
- }
-
- public boolean containsKey(AMQShortString key)
- {
- initMapIfNecessary();
-
- return _properties.containsKey(key);
- }
-
- public boolean containsKey(String key)
- {
- return containsKey(new AMQShortString(key));
- }
-
- public Set<String> keys()
- {
- initMapIfNecessary();
- Set<String> keys = new LinkedHashSet<String>();
- for (AMQShortString key : _properties.keySet())
- {
- keys.add(key.toString());
- }
-
- return keys;
- }
-
- public Iterator<Map.Entry<AMQShortString, AMQTypedValue>> iterator()
- {
- if(_encodedForm != null)
- {
- return new FieldTableIterator(_encodedForm.duplicate().rewind(),(int)_encodedSize);
- }
- else
- {
- initMapIfNecessary();
- return _properties.entrySet().iterator();
- }
- }
-
-
- public Object get(AMQShortString key)
- {
-
- return getObject(key);
- }
-
- public Object put(AMQShortString key, Object value)
- {
- return setObject(key, value);
- }
-
- public Object remove(String key)
- {
-
- return remove(new AMQShortString(key));
-
- }
-
- public Object remove(AMQShortString key)
- {
- AMQTypedValue val = removeKey(key);
-
- return (val == null) ? null : val.getValue();
-
- }
-
- public AMQTypedValue removeKey(AMQShortString key)
- {
- initMapIfNecessary();
- _encodedForm = null;
- AMQTypedValue value = _properties.remove(key);
- if (value == null)
- {
- return null;
- }
- else
- {
- _encodedSize -= EncodingUtils.encodedShortStringLength(key);
- _encodedSize--;
- _encodedSize -= value.getEncodingSize();
-
- return value;
- }
-
- }
-
- public void clear()
- {
- initMapIfNecessary();
- _encodedForm = null;
- _properties.clear();
- _encodedSize = 0;
- }
-
- public Set<AMQShortString> keySet()
- {
- initMapIfNecessary();
-
- return _properties.keySet();
- }
-
- private void putDataInBuffer(ByteBuffer buffer)
- {
-
- if (_encodedForm != null)
- {
- if(buffer.isDirect() || buffer.isReadOnly())
- {
- ByteBuffer encodedForm = _encodedForm.duplicate();
-
- if (encodedForm.position() != 0)
- {
- encodedForm.flip();
- }
-
- buffer.put(encodedForm);
- }
- else
- {
- buffer.put(_encodedForm.array(),_encodedForm.arrayOffset(),(int)_encodedSize);
- }
- }
- else if (_properties != null)
- {
- final Iterator<Map.Entry<AMQShortString, AMQTypedValue>> it = _properties.entrySet().iterator();
-
- // If there are values then write out the encoded Size... could check _encodedSize != 0
- // write out the total length, which we have kept up to date as data is added
-
- while (it.hasNext())
- {
- final Map.Entry<AMQShortString, AMQTypedValue> me = it.next();
- try
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Writing Property:" + me.getKey() + " Type:" + me.getValue().getType() + " Value:"
- + me.getValue().getValue());
- _logger.debug("Buffer Position:" + buffer.position() + " Remaining:" + buffer.remaining());
- }
-
- // Write the actual parameter name
- EncodingUtils.writeShortStringBytes(buffer, me.getKey());
- me.getValue().writeToBuffer(buffer);
- }
- catch (Exception e)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Exception thrown:" + e);
- _logger.debug("Writing Property:" + me.getKey() + " Type:" + me.getValue().getType() + " Value:"
- + me.getValue().getValue());
- _logger.debug("Buffer Position:" + buffer.position() + " Remaining:" + buffer.remaining());
- }
-
- throw new RuntimeException(e);
- }
- }
- }
- }
-
- private void setFromBuffer(ByteBuffer buffer, long length) throws AMQFrameDecodingException
- {
-
- final boolean trace = _logger.isDebugEnabled();
- if (length > 0)
- {
-
- final int expectedRemaining = buffer.remaining() - (int) length;
-
- _properties = new LinkedHashMap<AMQShortString, AMQTypedValue>(INITIAL_HASHMAP_CAPACITY);
-
- do
- {
-
- final AMQShortString key = EncodingUtils.readAMQShortString(buffer);
- AMQTypedValue value = AMQTypedValue.readFromBuffer(buffer);
-
- if (trace)
- {
- _logger.debug("FieldTable::PropFieldTable(buffer," + length + "): Read type '" + value.getType()
- + "', key '" + key + "', value '" + value.getValue() + "'");
- }
-
- _properties.put(key, value);
-
- }
- while (buffer.remaining() > expectedRemaining);
-
- }
-
- _encodedSize = length;
-
- if (trace)
- {
- _logger.debug("FieldTable::FieldTable(buffer," + length + "): Done.");
- }
- }
-
- private static final class FieldTableEntry implements Map.Entry<AMQShortString, AMQTypedValue>
- {
- private final AMQTypedValue _value;
- private final AMQShortString _key;
-
- public FieldTableEntry(final AMQShortString key, final AMQTypedValue value)
- {
- _key = key;
- _value = value;
- }
-
- public AMQShortString getKey()
- {
- return _key;
- }
-
- public AMQTypedValue getValue()
- {
- return _value;
- }
-
- public AMQTypedValue setValue(final AMQTypedValue value)
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean equals(Object o)
- {
- if(o instanceof FieldTableEntry)
- {
- FieldTableEntry other = (FieldTableEntry) o;
- return (_key == null ? other._key == null : _key.equals(other._key))
- && (_value == null ? other._value == null : _value.equals(other._value));
- }
- else
- {
- return false;
- }
- }
-
- public int hashCode()
- {
- return (getKey()==null ? 0 : getKey().hashCode())
- ^ (getValue()==null ? 0 : getValue().hashCode());
- }
-
- }
-
-
- private static final class FieldTableIterator implements Iterator<Map.Entry<AMQShortString, AMQTypedValue>>
- {
-
- private final ByteBuffer _buffer;
- private int _expectedRemaining;
-
- public FieldTableIterator(ByteBuffer buffer, int length)
- {
- _buffer = buffer;
- _expectedRemaining = buffer.remaining() - length;
- }
-
- public boolean hasNext()
- {
- return (_buffer.remaining() > _expectedRemaining);
- }
-
- public Map.Entry<AMQShortString, AMQTypedValue> next()
- {
- if(hasNext())
- {
- final AMQShortString key = EncodingUtils.readAMQShortString(_buffer);
- AMQTypedValue value = AMQTypedValue.readFromBuffer(_buffer);
- return new FieldTableEntry(key, value);
- }
- else
- {
- return null;
- }
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- }
-
-
-
-
- public int hashCode()
- {
- initMapIfNecessary();
-
- return _properties.hashCode();
- }
-
- public boolean equals(Object o)
- {
- if (o == this)
- {
- return true;
- }
-
- if (o == null)
- {
- return false;
- }
-
- if (!(o instanceof FieldTable))
- {
- return false;
- }
-
- initMapIfNecessary();
-
- FieldTable f = (FieldTable) o;
- f.initMapIfNecessary();
-
- return _properties.equals(f._properties);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTableFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTableFactory.java
deleted file mode 100644
index e9d75137ef..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/FieldTableFactory.java
+++ /dev/null
@@ -1,38 +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.
- *
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class FieldTableFactory
-{
- public static FieldTable newFieldTable()
- {
- return new FieldTable();
- }
-
- public static FieldTable newFieldTable(ByteBuffer byteBuffer, long length) throws AMQFrameDecodingException
- {
- return new FieldTable(byteBuffer, length);
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java
deleted file mode 100644
index 15a43345b5..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-import org.apache.qpid.AMQException;
-
-public class HeartbeatBody implements AMQBody
-{
- public static final byte TYPE = 8;
- public static AMQFrame FRAME = new HeartbeatBody().toFrame();
-
- public HeartbeatBody()
- {
-
- }
-
- public HeartbeatBody(ByteBuffer buffer, long size)
- {
- if(size > 0)
- {
- //allow other implementations to have a payload, but ignore it:
- buffer.skip((int) size);
- }
- }
-
- public byte getFrameType()
- {
- return TYPE;
- }
-
- public int getSize()
- {
- return 0;//heartbeats we generate have no payload
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- }
-
- public void handle(final int channelId, final AMQVersionAwareProtocolSession session)
- throws AMQException
- {
- session.heartbeatBodyReceived(channelId, this);
- }
-
- protected void populateFromBuffer(ByteBuffer buffer, long size) throws AMQFrameDecodingException
- {
- if(size > 0)
- {
- //allow other implementations to have a payload, but ignore it:
- buffer.skip((int) size);
- }
- }
-
- public AMQFrame toFrame()
- {
- return new AMQFrame(0, this);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBodyFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBodyFactory.java
deleted file mode 100644
index c7ada708dc..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBodyFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class HeartbeatBodyFactory implements BodyFactory
-{
- public AMQBody createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
- {
- return new HeartbeatBody();
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java
deleted file mode 100644
index 3ac17e9204..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java
+++ /dev/null
@@ -1,195 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.filter.codec.ProtocolDecoderOutput;
-import org.apache.qpid.AMQException;
-
-import java.io.UnsupportedEncodingException;
-
-public class ProtocolInitiation extends AMQDataBlock implements EncodableAMQDataBlock
-{
-
- // TODO: generate these constants automatically from the xml protocol spec file
- public static final byte[] AMQP_HEADER = new byte[]{(byte)'A',(byte)'M',(byte)'Q',(byte)'P'};
-
- private static final byte CURRENT_PROTOCOL_CLASS = 1;
- private static final byte TCP_PROTOCOL_INSTANCE = 1;
-
- public final byte[] _protocolHeader;
- public final byte _protocolClass;
- public final byte _protocolInstance;
- public final byte _protocolMajor;
- public final byte _protocolMinor;
-
-
-// public ProtocolInitiation() {}
-
- public ProtocolInitiation(byte[] protocolHeader, byte protocolClass, byte protocolInstance, byte protocolMajor, byte protocolMinor)
- {
- _protocolHeader = protocolHeader;
- _protocolClass = protocolClass;
- _protocolInstance = protocolInstance;
- _protocolMajor = protocolMajor;
- _protocolMinor = protocolMinor;
- }
-
- public ProtocolInitiation(ProtocolVersion pv)
- {
- this(AMQP_HEADER, CURRENT_PROTOCOL_CLASS, TCP_PROTOCOL_INSTANCE, pv.getMajorVersion(), pv.getMinorVersion());
- }
-
-
- public ProtocolInitiation(ByteBuffer in)
- {
- _protocolHeader = new byte[4];
- in.get(_protocolHeader);
-
- _protocolClass = in.get();
- _protocolInstance = in.get();
- _protocolMajor = in.get();
- _protocolMinor = in.get();
- }
-
- public long getSize()
- {
- return 4 + 1 + 1 + 1 + 1;
- }
-
- public void writePayload(ByteBuffer buffer)
- {
-
- buffer.put(_protocolHeader);
- buffer.put(_protocolClass);
- buffer.put(_protocolInstance);
- buffer.put(_protocolMajor);
- buffer.put(_protocolMinor);
- }
-
- public boolean equals(Object o)
- {
- if (!(o instanceof ProtocolInitiation))
- {
- return false;
- }
-
- ProtocolInitiation pi = (ProtocolInitiation) o;
- if (pi._protocolHeader == null)
- {
- return false;
- }
-
- if (_protocolHeader.length != pi._protocolHeader.length)
- {
- return false;
- }
-
- for (int i = 0; i < _protocolHeader.length; i++)
- {
- if (_protocolHeader[i] != pi._protocolHeader[i])
- {
- return false;
- }
- }
-
- return (_protocolClass == pi._protocolClass &&
- _protocolInstance == pi._protocolInstance &&
- _protocolMajor == pi._protocolMajor &&
- _protocolMinor == pi._protocolMinor);
- }
-
- public static class Decoder //implements MessageDecoder
- {
- /**
- *
- * @param session the session
- * @param in input buffer
- * @return true if we have enough data to decode the PI frame fully, false if more
- * data is required
- */
- public boolean decodable(IoSession session, ByteBuffer in)
- {
- return (in.remaining() >= 8);
- }
-
- public void decode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out)
- {
- ProtocolInitiation pi = new ProtocolInitiation(in);
- out.write(pi);
- }
- }
-
- public ProtocolVersion checkVersion() throws AMQException
- {
-
- if(_protocolHeader.length != 4)
- {
- throw new AMQProtocolHeaderException("Protocol header should have exactly four octets", null);
- }
- for(int i = 0; i < 4; i++)
- {
- if(_protocolHeader[i] != AMQP_HEADER[i])
- {
- try
- {
- throw new AMQProtocolHeaderException("Protocol header is not correct: Got " + new String(_protocolHeader,"ISO-8859-1") + " should be: " + new String(AMQP_HEADER, "ISO-8859-1"), null);
- }
- catch (UnsupportedEncodingException e)
- {
-
- }
- }
- }
- if (_protocolClass != CURRENT_PROTOCOL_CLASS)
- {
- throw new AMQProtocolClassException("Protocol class " + CURRENT_PROTOCOL_CLASS + " was expected; received " +
- _protocolClass, null);
- }
- if (_protocolInstance != TCP_PROTOCOL_INSTANCE)
- {
- throw new AMQProtocolInstanceException("Protocol instance " + TCP_PROTOCOL_INSTANCE + " was expected; received " +
- _protocolInstance, null);
- }
-
- ProtocolVersion pv = new ProtocolVersion(_protocolMajor, _protocolMinor);
-
-
- if (!pv.isSupported())
- {
- // TODO: add list of available versions in list to msg...
- throw new AMQProtocolVersionException("Protocol version " +
- _protocolMajor + "." + _protocolMinor + " not suppoerted by this version of the Qpid broker.", null);
- }
- return pv;
- }
-
- public String toString()
- {
- StringBuffer buffer = new StringBuffer(new String(_protocolHeader));
- buffer.append(Integer.toHexString(_protocolClass));
- buffer.append(Integer.toHexString(_protocolInstance));
- buffer.append(Integer.toHexString(_protocolMajor));
- buffer.append(Integer.toHexString(_protocolMinor));
- return buffer.toString();
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/SmallCompositeAMQDataBlock.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/SmallCompositeAMQDataBlock.java
deleted file mode 100644
index bd763599b0..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/SmallCompositeAMQDataBlock.java
+++ /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.
- *
- */
-
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class SmallCompositeAMQDataBlock extends AMQDataBlock implements EncodableAMQDataBlock
-{
- private AMQDataBlock _firstFrame;
-
- private AMQDataBlock _block;
-
- public SmallCompositeAMQDataBlock(AMQDataBlock block)
- {
- _block = block;
- }
-
- /**
- * The encoded block will be logically first before the AMQDataBlocks which are encoded
- * into the buffer afterwards.
- * @param encodedBlock already-encoded data
- * @param block a block to be encoded.
- */
- public SmallCompositeAMQDataBlock(AMQDataBlock encodedBlock, AMQDataBlock block)
- {
- this(block);
- _firstFrame = encodedBlock;
- }
-
- public AMQDataBlock getBlock()
- {
- return _block;
- }
-
- public AMQDataBlock getFirstFrame()
- {
- return _firstFrame;
- }
-
- public long getSize()
- {
- long frameSize = _block.getSize();
-
- if (_firstFrame != null)
- {
-
- frameSize += _firstFrame.getSize();
- }
- return frameSize;
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- if (_firstFrame != null)
- {
- _firstFrame.writePayload(buffer);
- }
- _block.writePayload(buffer);
-
- }
-
- public String toString()
- {
- if (_block == null)
- {
- return "No blocks contained in composite frame";
- }
- else
- {
- StringBuilder buf = new StringBuilder(this.getClass().getName());
- buf.append("{encodedBlock=").append(_firstFrame);
-
- buf.append(" _block=[").append(_block.toString()).append("]");
-
- buf.append("}");
- return buf.toString();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java
deleted file mode 100644
index 76c154581d..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class VersionSpecificRegistry
-{
- private static final Logger _log = LoggerFactory.getLogger(VersionSpecificRegistry.class);
-
- private final byte _protocolMajorVersion;
- private final byte _protocolMinorVersion;
-
- private static final int DEFAULT_MAX_CLASS_ID = 200;
- private static final int DEFAULT_MAX_METHOD_ID = 50;
-
- private AMQMethodBodyInstanceFactory[][] _registry = new AMQMethodBodyInstanceFactory[DEFAULT_MAX_CLASS_ID][];
-
- private ProtocolVersionMethodConverter _protocolVersionConverter;
-
- public VersionSpecificRegistry(byte major, byte minor)
- {
- _protocolMajorVersion = major;
- _protocolMinorVersion = minor;
-
- _protocolVersionConverter = loadProtocolVersionConverters(major, minor);
- }
-
- private static ProtocolVersionMethodConverter loadProtocolVersionConverters(byte protocolMajorVersion,
- byte protocolMinorVersion)
- {
- try
- {
- Class<ProtocolVersionMethodConverter> versionMethodConverterClass =
- (Class<ProtocolVersionMethodConverter>) Class.forName("org.apache.qpid.framing.MethodConverter_"
- + protocolMajorVersion + "_" + protocolMinorVersion);
-
- return versionMethodConverterClass.newInstance();
-
- }
- catch (ClassNotFoundException e)
- {
- _log.warn("Could not find protocol conversion classes for " + protocolMajorVersion + "-" + protocolMinorVersion);
- if (protocolMinorVersion != 0)
- {
- protocolMinorVersion--;
-
- return loadProtocolVersionConverters(protocolMajorVersion, protocolMinorVersion);
- }
- else if (protocolMajorVersion != 0)
- {
- protocolMajorVersion--;
-
- return loadProtocolVersionConverters(protocolMajorVersion, protocolMinorVersion);
- }
- else
- {
- return null;
- }
-
- }
- catch (IllegalAccessException e)
- {
- throw new IllegalStateException("Unable to load protocol version converter: ", e);
- }
- catch (InstantiationException e)
- {
- throw new IllegalStateException("Unable to load protocol version converter: ", e);
- }
- }
-
- public byte getProtocolMajorVersion()
- {
- return _protocolMajorVersion;
- }
-
- public byte getProtocolMinorVersion()
- {
- return _protocolMinorVersion;
- }
-
- public AMQMethodBodyInstanceFactory getMethodBody(final short classID, final short methodID)
- {
- try
- {
- return _registry[classID][methodID];
- }
- catch (IndexOutOfBoundsException e)
- {
- return null;
- }
- catch (NullPointerException e)
- {
- return null;
- }
- }
-
- public void registerMethod(final short classID, final short methodID, final AMQMethodBodyInstanceFactory instanceFactory)
- {
- if (_registry.length <= classID)
- {
- AMQMethodBodyInstanceFactory[][] oldRegistry = _registry;
- _registry = new AMQMethodBodyInstanceFactory[classID + 1][];
- System.arraycopy(oldRegistry, 0, _registry, 0, oldRegistry.length);
- }
-
- if (_registry[classID] == null)
- {
- _registry[classID] =
- new AMQMethodBodyInstanceFactory[(methodID > DEFAULT_MAX_METHOD_ID) ? (methodID + 1)
- : (DEFAULT_MAX_METHOD_ID + 1)];
- }
- else if (_registry[classID].length <= methodID)
- {
- AMQMethodBodyInstanceFactory[] oldMethods = _registry[classID];
- _registry[classID] = new AMQMethodBodyInstanceFactory[methodID + 1];
- System.arraycopy(oldMethods, 0, _registry[classID], 0, oldMethods.length);
- }
-
- _registry[classID][methodID] = instanceFactory;
-
- }
-
- public AMQMethodBody get(short classID, short methodID, ByteBuffer in, long size) throws AMQFrameDecodingException
- {
- AMQMethodBodyInstanceFactory bodyFactory;
- try
- {
- bodyFactory = _registry[classID][methodID];
- }
- catch (NullPointerException e)
- {
- throw new AMQFrameDecodingException(null, "Class " + classID + " unknown in AMQP version "
- + _protocolMajorVersion + "-" + _protocolMinorVersion + " (while trying to decode class " + classID
- + " method " + methodID + ".", e);
- }
- catch (IndexOutOfBoundsException e)
- {
- if (classID >= _registry.length)
- {
- throw new AMQFrameDecodingException(null, "Class " + classID + " unknown in AMQP version "
- + _protocolMajorVersion + "-" + _protocolMinorVersion + " (while trying to decode class " + classID
- + " method " + methodID + ".", e);
-
- }
- else
- {
- throw new AMQFrameDecodingException(null, "Method " + methodID + " unknown in AMQP version "
- + _protocolMajorVersion + "-" + _protocolMinorVersion + " (while trying to decode class " + classID
- + " method " + methodID + ".", e);
-
- }
- }
-
- if (bodyFactory == null)
- {
- throw new AMQFrameDecodingException(null, "Method " + methodID + " unknown in AMQP version "
- + _protocolMajorVersion + "-" + _protocolMinorVersion + " (while trying to decode class " + classID
- + " method " + methodID + ".", null);
- }
-
- return bodyFactory.newInstance( in, size);
-
- }
-
- public ProtocolVersionMethodConverter getProtocolVersionMethodConverter()
- {
- return _protocolVersionConverter;
- }
-
- public void configure()
- {
- _protocolVersionConverter.configure();
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/AbstractMethodConverter.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/AbstractMethodConverter.java
deleted file mode 100644
index 1d7c05e9cc..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/AbstractMethodConverter.java
+++ /dev/null
@@ -1,47 +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.
- *
- */
-
-package org.apache.qpid.framing.abstraction;
-
-public abstract class AbstractMethodConverter implements ProtocolVersionMethodConverter
-{
- private final byte _protocolMajorVersion;
-
-
- private final byte _protocolMinorVersion;
-
- public AbstractMethodConverter(byte major, byte minor)
- {
- _protocolMajorVersion = major;
- _protocolMinorVersion = minor;
- }
-
-
- public final byte getProtocolMajorVersion()
- {
- return _protocolMajorVersion;
- }
-
- public final byte getProtocolMinorVersion()
- {
- return _protocolMinorVersion;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ContentChunk.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ContentChunk.java
deleted file mode 100644
index 0695349f76..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ContentChunk.java
+++ /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.
- *
- */
-
-package org.apache.qpid.framing.abstraction;
-
-import org.apache.mina.common.ByteBuffer;
-
-public interface ContentChunk
-{
- int getSize();
- ByteBuffer getData();
-
- void reduceToFit();
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfo.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfo.java
deleted file mode 100644
index a96bdcc171..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfo.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.framing.abstraction;
-
-import org.apache.qpid.framing.AMQShortString;
-
-public interface MessagePublishInfo
-{
-
- public AMQShortString getExchange();
-
- public void setExchange(AMQShortString exchange);
-
- public boolean isImmediate();
-
- public boolean isMandatory();
-
- public AMQShortString getRoutingKey();
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java
deleted file mode 100644
index 01d1a8a17b..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java
+++ /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.
- *
- */
-
-package org.apache.qpid.framing.abstraction;
-
-import org.apache.qpid.framing.AMQMethodBody;
-
-
-public interface MessagePublishInfoConverter
-{
- public MessagePublishInfo convertToInfo(AMQMethodBody body);
- public AMQMethodBody convertToBody(MessagePublishInfo info);
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java
deleted file mode 100644
index 0a1cedc4e6..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java
+++ /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.
- *
- */
-
-package org.apache.qpid.framing.abstraction;
-
-import org.apache.qpid.framing.AMQBody;
-
-public interface ProtocolVersionMethodConverter extends MessagePublishInfoConverter
-{
- AMQBody convertToBody(ContentChunk contentBody);
- ContentChunk convertToContentChunk(AMQBody body);
-
- void configure();
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AMQMethodBody_0_9.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AMQMethodBody_0_9.java
deleted file mode 100644
index 948f5baaf6..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AMQMethodBody_0_9.java
+++ /dev/null
@@ -1,209 +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.
- *
- */
-
-package org.apache.qpid.framing.amqp_0_9;
-
-import org.apache.qpid.framing.EncodingUtils;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.AMQFrameDecodingException;
-import org.apache.qpid.framing.Content;
-
-import org.apache.mina.common.ByteBuffer;
-
-public abstract class AMQMethodBody_0_9 extends org.apache.qpid.framing.AMQMethodBodyImpl
-{
-
- public byte getMajor()
- {
- return 0;
- }
-
- public byte getMinor()
- {
- return 9;
- }
-
- public int getSize()
- {
- return 2 + 2 + getBodySize();
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- EncodingUtils.writeUnsignedShort(buffer, getClazz());
- EncodingUtils.writeUnsignedShort(buffer, getMethod());
- writeMethodPayload(buffer);
- }
-
-
- protected byte readByte(ByteBuffer buffer)
- {
- return buffer.get();
- }
-
- protected AMQShortString readAMQShortString(ByteBuffer buffer)
- {
- return EncodingUtils.readAMQShortString(buffer);
- }
-
- protected int getSizeOf(AMQShortString string)
- {
- return EncodingUtils.encodedShortStringLength(string);
- }
-
- protected void writeByte(ByteBuffer buffer, byte b)
- {
- buffer.put(b);
- }
-
- protected void writeAMQShortString(ByteBuffer buffer, AMQShortString string)
- {
- EncodingUtils.writeShortStringBytes(buffer, string);
- }
-
- protected int readInt(ByteBuffer buffer)
- {
- return buffer.getInt();
- }
-
- protected void writeInt(ByteBuffer buffer, int i)
- {
- buffer.putInt(i);
- }
-
- protected FieldTable readFieldTable(ByteBuffer buffer) throws AMQFrameDecodingException
- {
- return EncodingUtils.readFieldTable(buffer);
- }
-
- protected int getSizeOf(FieldTable table)
- {
- return EncodingUtils.encodedFieldTableLength(table); //To change body of created methods use File | Settings | File Templates.
- }
-
- protected void writeFieldTable(ByteBuffer buffer, FieldTable table)
- {
- EncodingUtils.writeFieldTableBytes(buffer, table);
- }
-
- protected long readLong(ByteBuffer buffer)
- {
- return buffer.getLong();
- }
-
- protected void writeLong(ByteBuffer buffer, long l)
- {
- buffer.putLong(l);
- }
-
- protected int getSizeOf(byte[] response)
- {
- return (response == null) ? 4 :response.length + 4;
- }
-
- protected void writeBytes(ByteBuffer buffer, byte[] data)
- {
- EncodingUtils.writeBytes(buffer,data);
- }
-
- protected byte[] readBytes(ByteBuffer buffer)
- {
- return EncodingUtils.readBytes(buffer);
- }
-
- protected short readShort(ByteBuffer buffer)
- {
- return EncodingUtils.readShort(buffer);
- }
-
- protected void writeShort(ByteBuffer buffer, short s)
- {
- EncodingUtils.writeShort(buffer, s);
- }
-
- protected Content readContent(ByteBuffer buffer)
- {
- return null; //To change body of created methods use File | Settings | File Templates.
- }
-
- protected int getSizeOf(Content body)
- {
- return 0; //To change body of created methods use File | Settings | File Templates.
- }
-
- protected void writeContent(ByteBuffer buffer, Content body)
- {
- //To change body of created methods use File | Settings | File Templates.
- }
-
- protected byte readBitfield(ByteBuffer buffer)
- {
- return readByte(buffer); //To change body of created methods use File | Settings | File Templates.
- }
-
- protected int readUnsignedShort(ByteBuffer buffer)
- {
- return buffer.getUnsignedShort(); //To change body of created methods use File | Settings | File Templates.
- }
-
- protected void writeBitfield(ByteBuffer buffer, byte bitfield0)
- {
- buffer.put(bitfield0);
- }
-
- protected void writeUnsignedShort(ByteBuffer buffer, int s)
- {
- EncodingUtils.writeUnsignedShort(buffer, s);
- }
-
- protected long readUnsignedInteger(ByteBuffer buffer)
- {
- return buffer.getUnsignedInt();
- }
- protected void writeUnsignedInteger(ByteBuffer buffer, long i)
- {
- EncodingUtils.writeUnsignedInteger(buffer, i);
- }
-
-
- protected short readUnsignedByte(ByteBuffer buffer)
- {
- return buffer.getUnsigned();
- }
-
- protected void writeUnsignedByte(ByteBuffer buffer, short unsignedByte)
- {
- EncodingUtils.writeUnsignedByte(buffer, unsignedByte);
- }
-
- protected long readTimestamp(ByteBuffer buffer)
- {
- return EncodingUtils.readTimestamp(buffer);
- }
-
- protected void writeTimestamp(ByteBuffer buffer, long t)
- {
- EncodingUtils.writeTimestamp(buffer, t);
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java
deleted file mode 100644
index fd5195eb6b..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java
+++ /dev/null
@@ -1,172 +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.
- *
- */
-
-package org.apache.qpid.framing.amqp_0_9;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.framing.abstraction.AbstractMethodConverter;
-import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.framing.amqp_0_9.*;
-import org.apache.qpid.framing.amqp_0_9.BasicPublishBodyImpl;
-
-public class MethodConverter_0_9 extends AbstractMethodConverter implements ProtocolVersionMethodConverter
-{
- private int _basicPublishClassId;
- private int _basicPublishMethodId;
-
- public MethodConverter_0_9()
- {
- super((byte)0,(byte)9);
-
-
- }
-
- public AMQBody convertToBody(ContentChunk contentChunk)
- {
- if(contentChunk instanceof ContentChunk_0_9)
- {
- return ((ContentChunk_0_9)contentChunk).toBody();
- }
- else
- {
- return new ContentBody(contentChunk.getData());
- }
- }
-
- public ContentChunk convertToContentChunk(AMQBody body)
- {
- final ContentBody contentBodyChunk = (ContentBody) body;
-
- return new ContentChunk_0_9(contentBodyChunk);
-
- }
-
- public void configure()
- {
-
- _basicPublishClassId = org.apache.qpid.framing.amqp_0_9.BasicPublishBodyImpl.CLASS_ID;
- _basicPublishMethodId = BasicPublishBodyImpl.METHOD_ID;
-
- }
-
- public MessagePublishInfo convertToInfo(AMQMethodBody methodBody)
- {
- final BasicPublishBody publishBody = ((BasicPublishBody) methodBody);
-
- final AMQShortString exchange = publishBody.getExchange();
- final AMQShortString routingKey = publishBody.getRoutingKey();
-
- return new MethodConverter_0_9.MessagePublishInfoImpl(exchange,
- publishBody.getImmediate(),
- publishBody.getMandatory(),
- routingKey);
-
- }
-
- public AMQMethodBody convertToBody(MessagePublishInfo info)
- {
-
- return new BasicPublishBodyImpl(0,
- info.getExchange(),
- info.getRoutingKey(),
- info.isMandatory(),
- info.isImmediate()) ;
-
- }
-
- private static class MessagePublishInfoImpl implements MessagePublishInfo
- {
- private AMQShortString _exchange;
- private final boolean _immediate;
- private final boolean _mandatory;
- private final AMQShortString _routingKey;
-
- public MessagePublishInfoImpl(final AMQShortString exchange,
- final boolean immediate,
- final boolean mandatory,
- final AMQShortString routingKey)
- {
- _exchange = exchange;
- _immediate = immediate;
- _mandatory = mandatory;
- _routingKey = routingKey;
- }
-
- public AMQShortString getExchange()
- {
- return _exchange;
- }
-
- public void setExchange(AMQShortString exchange)
- {
- _exchange = exchange;
- }
-
- public boolean isImmediate()
- {
- return _immediate;
- }
-
- public boolean isMandatory()
- {
- return _mandatory;
- }
-
- public AMQShortString getRoutingKey()
- {
- return _routingKey;
- }
- }
-
- private static class ContentChunk_0_9 implements ContentChunk
- {
- private final ContentBody _contentBodyChunk;
-
- public ContentChunk_0_9(final ContentBody contentBodyChunk)
- {
- _contentBodyChunk = contentBodyChunk;
- }
-
- public int getSize()
- {
- return _contentBodyChunk.getSize();
- }
-
- public ByteBuffer getData()
- {
- return _contentBodyChunk.payload;
- }
-
- public void reduceToFit()
- {
- _contentBodyChunk.reduceBufferToFit();
- }
-
- public AMQBody toBody()
- {
- return _contentBodyChunk;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java
deleted file mode 100644
index e9b4447140..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java
+++ /dev/null
@@ -1,209 +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.
- *
- */
-
-package org.apache.qpid.framing.amqp_8_0;
-
-import org.apache.qpid.framing.EncodingUtils;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.AMQFrameDecodingException;
-import org.apache.qpid.framing.Content;
-
-import org.apache.mina.common.ByteBuffer;
-
-public abstract class AMQMethodBody_8_0 extends org.apache.qpid.framing.AMQMethodBodyImpl
-{
-
- public byte getMajor()
- {
- return 8;
- }
-
- public byte getMinor()
- {
- return 0;
- }
-
- public int getSize()
- {
- return 2 + 2 + getBodySize();
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- EncodingUtils.writeUnsignedShort(buffer, getClazz());
- EncodingUtils.writeUnsignedShort(buffer, getMethod());
- writeMethodPayload(buffer);
- }
-
-
- protected byte readByte(ByteBuffer buffer)
- {
- return buffer.get();
- }
-
- protected AMQShortString readAMQShortString(ByteBuffer buffer)
- {
- return EncodingUtils.readAMQShortString(buffer);
- }
-
- protected int getSizeOf(AMQShortString string)
- {
- return EncodingUtils.encodedShortStringLength(string);
- }
-
- protected void writeByte(ByteBuffer buffer, byte b)
- {
- buffer.put(b);
- }
-
- protected void writeAMQShortString(ByteBuffer buffer, AMQShortString string)
- {
- EncodingUtils.writeShortStringBytes(buffer, string);
- }
-
- protected int readInt(ByteBuffer buffer)
- {
- return buffer.getInt();
- }
-
- protected void writeInt(ByteBuffer buffer, int i)
- {
- buffer.putInt(i);
- }
-
- protected FieldTable readFieldTable(ByteBuffer buffer) throws AMQFrameDecodingException
- {
- return EncodingUtils.readFieldTable(buffer);
- }
-
- protected int getSizeOf(FieldTable table)
- {
- return EncodingUtils.encodedFieldTableLength(table); //To change body of created methods use File | Settings | File Templates.
- }
-
- protected void writeFieldTable(ByteBuffer buffer, FieldTable table)
- {
- EncodingUtils.writeFieldTableBytes(buffer, table);
- }
-
- protected long readLong(ByteBuffer buffer)
- {
- return buffer.getLong();
- }
-
- protected void writeLong(ByteBuffer buffer, long l)
- {
- buffer.putLong(l);
- }
-
- protected int getSizeOf(byte[] response)
- {
- return (response == null) ? 4 : response.length + 4;
- }
-
- protected void writeBytes(ByteBuffer buffer, byte[] data)
- {
- EncodingUtils.writeBytes(buffer,data);
- }
-
- protected byte[] readBytes(ByteBuffer buffer)
- {
- return EncodingUtils.readBytes(buffer);
- }
-
- protected short readShort(ByteBuffer buffer)
- {
- return EncodingUtils.readShort(buffer);
- }
-
- protected void writeShort(ByteBuffer buffer, short s)
- {
- EncodingUtils.writeShort(buffer, s);
- }
-
- protected Content readContent(ByteBuffer buffer)
- {
- return null; //To change body of created methods use File | Settings | File Templates.
- }
-
- protected int getSizeOf(Content body)
- {
- return 0; //To change body of created methods use File | Settings | File Templates.
- }
-
- protected void writeContent(ByteBuffer buffer, Content body)
- {
- //To change body of created methods use File | Settings | File Templates.
- }
-
- protected byte readBitfield(ByteBuffer buffer)
- {
- return readByte(buffer); //To change body of created methods use File | Settings | File Templates.
- }
-
- protected int readUnsignedShort(ByteBuffer buffer)
- {
- return buffer.getUnsignedShort(); //To change body of created methods use File | Settings | File Templates.
- }
-
- protected void writeBitfield(ByteBuffer buffer, byte bitfield0)
- {
- buffer.put(bitfield0);
- }
-
- protected void writeUnsignedShort(ByteBuffer buffer, int s)
- {
- EncodingUtils.writeUnsignedShort(buffer, s);
- }
-
- protected long readUnsignedInteger(ByteBuffer buffer)
- {
- return buffer.getUnsignedInt();
- }
- protected void writeUnsignedInteger(ByteBuffer buffer, long i)
- {
- EncodingUtils.writeUnsignedInteger(buffer, i);
- }
-
-
- protected short readUnsignedByte(ByteBuffer buffer)
- {
- return buffer.getUnsigned();
- }
-
- protected void writeUnsignedByte(ByteBuffer buffer, short unsignedByte)
- {
- EncodingUtils.writeUnsignedByte(buffer, unsignedByte);
- }
-
- protected long readTimestamp(ByteBuffer buffer)
- {
- return EncodingUtils.readTimestamp(buffer);
- }
-
- protected void writeTimestamp(ByteBuffer buffer, long t)
- {
- EncodingUtils.writeTimestamp(buffer, t);
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java
deleted file mode 100644
index 299c655698..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java
+++ /dev/null
@@ -1,151 +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.
- *
- */
-
-package org.apache.qpid.framing.amqp_8_0;
-
-import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.framing.abstraction.AbstractMethodConverter;
-import org.apache.qpid.framing.amqp_8_0.BasicPublishBodyImpl;
-import org.apache.qpid.framing.*;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class MethodConverter_8_0 extends AbstractMethodConverter implements ProtocolVersionMethodConverter
-{
- private int _basicPublishClassId;
- private int _basicPublishMethodId;
-
- public MethodConverter_8_0()
- {
- super((byte)8,(byte)0);
-
-
- }
-
- public AMQBody convertToBody(ContentChunk contentChunk)
- {
- return new ContentBody(contentChunk.getData());
- }
-
- public ContentChunk convertToContentChunk(AMQBody body)
- {
- final ContentBody contentBodyChunk = (ContentBody) body;
-
- return new ContentChunk()
- {
-
- public int getSize()
- {
- return contentBodyChunk.getSize();
- }
-
- public ByteBuffer getData()
- {
- return contentBodyChunk.payload;
- }
-
- public void reduceToFit()
- {
- contentBodyChunk.reduceBufferToFit();
- }
- };
-
- }
-
- public void configure()
- {
-
- _basicPublishClassId = BasicPublishBodyImpl.CLASS_ID;
- _basicPublishMethodId = BasicPublishBodyImpl.METHOD_ID;
-
- }
-
- public MessagePublishInfo convertToInfo(AMQMethodBody methodBody)
- {
- final BasicPublishBody publishBody = ((BasicPublishBody) methodBody);
-
- final AMQShortString exchange = publishBody.getExchange();
- final AMQShortString routingKey = publishBody.getRoutingKey();
-
- return new MessagePublishInfoImpl(exchange == null ? null : exchange.intern(),
- publishBody.getImmediate(),
- publishBody.getMandatory(),
- routingKey == null ? null : routingKey.intern());
-
- }
-
- public AMQMethodBody convertToBody(MessagePublishInfo info)
- {
-
- return new BasicPublishBodyImpl(0,
- info.getExchange(),
- info.getRoutingKey(),
- info.isMandatory(),
- info.isImmediate()) ;
-
- }
-
- private static class MessagePublishInfoImpl implements MessagePublishInfo
- {
- private AMQShortString _exchange;
- private final boolean _immediate;
- private final boolean _mandatory;
- private final AMQShortString _routingKey;
-
- public MessagePublishInfoImpl(final AMQShortString exchange,
- final boolean immediate,
- final boolean mandatory,
- final AMQShortString routingKey)
- {
- _exchange = exchange;
- _immediate = immediate;
- _mandatory = mandatory;
- _routingKey = routingKey;
- }
-
- public AMQShortString getExchange()
- {
- return _exchange;
- }
-
- public void setExchange(AMQShortString exchange)
- {
- _exchange = exchange;
- }
-
- public boolean isImmediate()
- {
- return _immediate;
- }
-
- public boolean isMandatory()
- {
- return _mandatory;
- }
-
- public AMQShortString getRoutingKey()
- {
- return _routingKey;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/Event.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/Event.java
deleted file mode 100644
index 5996cbf89c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/Event.java
+++ /dev/null
@@ -1,155 +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.
- *
- */
-package org.apache.qpid.pool;
-
-import org.apache.mina.common.IoFilter;
-import org.apache.mina.common.IoSession;
-
-/**
- * An Event is a continuation, which is used to break a Mina filter chain and save the current point in the chain
- * for later processing. It is an abstract class, with different implementations for continuations of different kinds
- * of Mina events.
- *
- * <p/>These continuations are typically batched by {@link Job} for processing by a worker thread pool.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Process a continuation in the context of a Mina session.
- * </table>
- *
- * @todo Pull up _nextFilter and getNextFilter into Event, as all events use it. Inner classes need to be non-static
- * to use instance variables in the parent. Consequently they need to be non-inner to be instantiable outside of
- * the context of the outer Event class. The inner class construction used here is preventing common code re-use
- * (though not by a huge amount), but makes for an inelegent way of handling inheritance and doesn't seem like
- * a justifiable use of inner classes. Move the inner classes out into their own files.
- *
- * @todo Could make Event implement Runnable, FutureTask, or a custom Continuation interface, to clarify its status as
- * a continuation. Job is also a continuation, as is the job completion handler. Or, as Event is totally abstract,
- * it is really an interface, so could just drop it and use the continuation interface instead.
- */
-public abstract class Event
-{
- /**
- * Creates a continuation.
- */
- public Event()
- { }
-
- /**
- * Processes the continuation in the context of a Mina session.
- *
- * @param session The Mina session.
- */
- public abstract void process(IoSession session);
-
- /**
- * A continuation ({@link Event}) that takes a Mina messageReceived event, and passes it to a NextFilter.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Pass a Mina messageReceived event to a NextFilter. <td> {@link IoFilter.NextFilter}, {@link IoSession}
- * </table>
- */
- public static final class ReceivedEvent extends Event
- {
- private final Object _data;
-
- private final IoFilter.NextFilter _nextFilter;
-
- public ReceivedEvent(final IoFilter.NextFilter nextFilter, final Object data)
- {
- super();
- _nextFilter = nextFilter;
- _data = data;
- }
-
- public void process(IoSession session)
- {
- _nextFilter.messageReceived(session, _data);
- }
-
- public IoFilter.NextFilter getNextFilter()
- {
- return _nextFilter;
- }
- }
-
- /**
- * A continuation ({@link Event}) that takes a Mina filterWrite event, and passes it to a NextFilter.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Pass a Mina filterWrite event to a NextFilter.
- * <td> {@link IoFilter.NextFilter}, {@link IoFilter.WriteRequest}, {@link IoSession}
- * </table>
- */
- public static final class WriteEvent extends Event
- {
- private final IoFilter.WriteRequest _data;
- private final IoFilter.NextFilter _nextFilter;
-
- public WriteEvent(final IoFilter.NextFilter nextFilter, final IoFilter.WriteRequest data)
- {
- super();
- _nextFilter = nextFilter;
- _data = data;
- }
-
- public void process(IoSession session)
- {
- _nextFilter.filterWrite(session, _data);
- }
-
- public IoFilter.NextFilter getNextFilter()
- {
- return _nextFilter;
- }
- }
-
- /**
- * A continuation ({@link Event}) that takes a Mina sessionClosed event, and passes it to a NextFilter.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Pass a Mina sessionClosed event to a NextFilter. <td> {@link IoFilter.NextFilter}, {@link IoSession}
- * </table>
- */
- public static final class CloseEvent extends Event
- {
- private final IoFilter.NextFilter _nextFilter;
-
- public CloseEvent(final IoFilter.NextFilter nextFilter)
- {
- super();
- _nextFilter = nextFilter;
- }
-
- public void process(IoSession session)
- {
- _nextFilter.sessionClosed(session);
- }
-
- public IoFilter.NextFilter getNextFilter()
- {
- return _nextFilter;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/Job.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/Job.java
deleted file mode 100644
index 00da005515..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/Job.java
+++ /dev/null
@@ -1,192 +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.
- *
- */
-package org.apache.qpid.pool;
-
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.mina.common.IoSession;
-
-/**
- * A Job is a continuation that batches together other continuations, specifically {@link Event}s, into one continuation.
- * The {@link Event}s themselves provide methods to process themselves, so processing a job simply consists of sequentially
- * processing all of its aggregated events.
- *
- * The constructor accepts a maximum number of events for the job, and only runs up to that maximum number when
- * processing the job, but the add method does not enforce this maximum. In other words, not all the enqueued events
- * may be processed in each run of the job, several runs may be required to clear the queue.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Aggregate many coninuations together into a single continuation.
- * <tr><td> Sequentially process aggregated continuations. <td> {@link Event}
- * <tr><td> Provide running and completion status of the aggregate continuation.
- * <tr><td> Execute a terminal continuation upon job completion. <td> {@link JobCompletionHandler}
- * </table>
- *
- * @todo Could make Job implement Runnable, FutureTask, or a custom Continuation interface, to clarify its status as a
- * continuation. Job is a continuation that aggregates other continuations and as such is a usefull re-usable
- * piece of code. There may be other palces than the mina filter chain where continuation batching is used within
- * qpid, so abstracting this out could provide a usefull building block. This also opens the way to different
- * kinds of job with a common interface, e.g. parallel or sequential jobs etc.
- *
- * @todo For better re-usability could make the completion handler optional. Only run it when one is set.
- */
-public class Job implements ReadWriteRunnable
-{
- /** The maximum number of events to process per run of the job. More events than this may be queued in the job. */
- private final int _maxEvents;
-
- /** The Mina session. */
- private final IoSession _session;
-
- /** Holds the queue of events that make up the job. */
- private final java.util.Queue<Event> _eventQueue = new ConcurrentLinkedQueue<Event>();
-
- /** Holds a status flag, that indicates when the job is actively running. */
- private final AtomicBoolean _active = new AtomicBoolean();
-
- /** Holds the completion continuation, called upon completion of a run of the job. */
- private final JobCompletionHandler _completionHandler;
-
- private final boolean _readJob;
-
- /**
- * Creates a new job that aggregates many continuations together.
- *
- * @param session The Mina session.
- * @param completionHandler The per job run, terminal continuation.
- * @param maxEvents The maximum number of aggregated continuations to process per run of the job.
- * @param readJob
- */
- Job(IoSession session, JobCompletionHandler completionHandler, int maxEvents, final boolean readJob)
- {
- _session = session;
- _completionHandler = completionHandler;
- _maxEvents = maxEvents;
- _readJob = readJob;
- }
-
- /**
- * Enqueus a continuation for sequential processing by this job.
- *
- * @param evt The continuation to enqueue.
- */
- void add(Event evt)
- {
- _eventQueue.add(evt);
- }
-
- /**
- * Sequentially processes, up to the maximum number per job, the aggregated continuations in enqueued in this job.
- */
- boolean processAll()
- {
- // limit the number of events processed in one run
- int i = _maxEvents;
- while( --i != 0 )
- {
- Event e = _eventQueue.poll();
- if (e == null)
- {
- return true;
- }
- else
- {
- e.process(_session);
- }
- }
- return false;
- }
-
- /**
- * Tests if there are no more enqueued continuations to process.
- *
- * @return <tt>true</tt> if there are no enqueued continuations in this job, <tt>false</tt> otherwise.
- */
- public boolean isComplete()
- {
- return _eventQueue.peek() == null;
- }
-
- /**
- * Marks this job as active if it is inactive. This method is thread safe.
- *
- * @return <tt>true</tt> if this job was inactive and has now been marked as active, <tt>false</tt> otherwise.
- */
- public boolean activate()
- {
- return _active.compareAndSet(false, true);
- }
-
- /**
- * Marks this job as inactive. This method is thread safe.
- */
- public void deactivate()
- {
- _active.set(false);
- }
-
- /**
- * Processes a batch of aggregated continuations, marks this job as inactive and call the terminal continuation.
- */
- public void run()
- {
- if(processAll())
- {
- deactivate();
- _completionHandler.completed(_session, this);
- }
- else
- {
- _completionHandler.notCompleted(_session, this);
- }
- }
-
- public boolean isReadJob()
- {
- return _readJob;
- }
-
- public boolean isRead()
- {
- return _readJob;
- }
-
- public boolean isWrite()
- {
- return !_readJob;
- }
-
-
- /**
- * Another interface for a continuation.
- *
- * @todo Get rid of this interface as there are other interfaces that could be used instead, such as FutureTask,
- * Runnable or a custom Continuation interface.
- */
- static interface JobCompletionHandler
- {
- public void completed(IoSession session, Job job);
-
- public void notCompleted(final IoSession session, final Job job);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
deleted file mode 100644
index a080cc7e04..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
+++ /dev/null
@@ -1,491 +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.
- *
- */
-package org.apache.qpid.pool;
-
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoFilterAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.qpid.pool.Event.CloseEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ExecutorService;
-
-/**
- * PoolingFilter, is a no-op pass through filter that hands all events down the Mina filter chain by default. As it
- * adds no behaviour by default to the filter chain, it is abstract.
- *
- * <p/>PoolingFilter provides a capability, available to sub-classes, to handle events in the chain asynchronously, by
- * adding them to a job. If a job is not active, adding an event to it activates it. If it is active, the event is
- * added to the job, which will run to completion and eventually process the event. The queue on the job itself acts as
- * a buffer between stages of the pipeline.
- *
- * <p/>There are two convenience methods, {@link #createAynschReadPoolingFilter} and
- * {@link #createAynschWritePoolingFilter}, for obtaining pooling filters that handle 'messageReceived' and
- * 'filterWrite' events, making it possible to process these event streams seperately.
- *
- * <p/>Pooling filters have a name, in order to distinguish different filter types. They set up a {@link Job} on the
- * Mina session they are working with, and store it in the session against their identifying name. This allows different
- * filters with different names to be set up on the same filter chain, on the same Mina session, that batch their
- * workloads in different jobs.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Implement default, pass through filter.
- * <tr><td> Create pooling filters and a specific thread pool. <td> {@link ReferenceCountingExecutorService}
- * <tr><td> Provide the ability to batch Mina events for asynchronous processing. <td> {@link Job}, {@link Event}
- * <tr><td> Provide a terminal continuation to keep jobs running till empty.
- * <td> {@link Job}, {@link Job.JobCompletionHandler}
- * </table>
- *
- * @todo The static helper methods are pointless. Could just call new.
- */
-public abstract class PoolingFilter extends IoFilterAdapter implements Job.JobCompletionHandler
-{
- /** Used for debugging purposes. */
- private static final Logger _logger = LoggerFactory.getLogger(PoolingFilter.class);
-
- /** Holds the managed reference to obtain the executor for the batched jobs. */
- private final ReferenceCountingExecutorService _poolReference;
-
- /** Used to hold a name for identifying differeny pooling filter types. */
- private final String _name;
-
- /** Defines the maximum number of events that will be batched into a single job. */
- static final int MAX_JOB_EVENTS = Integer.getInteger("amqj.server.read_write_pool.max_events", 10);
-
- private final int _maxEvents;
-
- private final boolean _readFilter;
-
- /**
- * Creates a named pooling filter, on the specified shared thread pool.
- *
- * @param refCountingPool The thread pool reference.
- * @param name The identifying name of the filter type.
- */
- public PoolingFilter(ReferenceCountingExecutorService refCountingPool, String name, int maxEvents, boolean readFilter)
- {
- _poolReference = refCountingPool;
- _name = name;
- _maxEvents = maxEvents;
- _readFilter = readFilter;
- }
-
- /**
- * Helper method to get an instance of a pooling filter that handles read events asynchronously.
- *
- * @param refCountingPool A managed reference to the thread pool.
- * @param name The filter types identifying name.
- *
- * @return A pooling filter for asynchronous read events.
- */
- public static PoolingFilter createAynschReadPoolingFilter(ReferenceCountingExecutorService refCountingPool, String name)
- {
- return new AsynchReadPoolingFilter(refCountingPool, name);
- }
-
- /**
- * Helper method to get an instance of a pooling filter that handles write events asynchronously.
- *
- * @param refCountingPool A managed reference to the thread pool.
- * @param name The filter types identifying name.
- *
- * @return A pooling filter for asynchronous write events.
- */
- public static PoolingFilter createAynschWritePoolingFilter(ReferenceCountingExecutorService refCountingPool, String name)
- {
- return new AsynchWritePoolingFilter(refCountingPool, name);
- }
-
- /**
- * Called by Mina to initialize this filter. Takes a reference to the thread pool.
- */
- public void init()
- {
- _logger.debug("Init called on PoolingFilter " + toString());
-
- // Called when the filter is initialised in the chain. If the reference count is
- // zero this acquire will initialise the pool.
- _poolReference.acquireExecutorService();
- }
-
- /**
- * Called by Mina to clean up this filter. Releases the reference to the thread pool.
- */
- public void destroy()
- {
- _logger.debug("Destroy called on PoolingFilter " + toString());
-
- // When the reference count gets to zero we release the executor service.
- _poolReference.releaseExecutorService();
- }
-
- /**
- * Adds an {@link Event} to a {@link Job}, triggering the execution of the job if it is not already running.
- *
- * @param job The job.
- * @param event The event to hand off asynchronously.
- */
- void fireAsynchEvent(Job job, Event event)
- {
-
- job.add(event);
-
- final ExecutorService pool = _poolReference.getPool();
-
- if(pool == null)
- {
- return;
- }
-
- // rather than perform additional checks on pool to check that it hasn't shutdown.
- // catch the RejectedExecutionException that will result from executing on a shutdown pool
- if (job.activate())
- {
- try
- {
- pool.execute(job);
- }
- catch(RejectedExecutionException e)
- {
- _logger.warn("Thread pool shutdown while tasks still outstanding");
- }
- }
-
- }
-
- /**
- * Creates a Job on the Mina session, identified by this filters name, in which this filter places asynchronously
- * handled events.
- *
- * @param session The Mina session.
- */
- public void createNewJobForSession(IoSession session)
- {
- Job job = new Job(session, this, MAX_JOB_EVENTS,_readFilter);
- session.setAttribute(_name, job);
- }
-
- /**
- * Retrieves this filters Job, by this filters name, from the Mina session.
- *
- * @param session The Mina session.
- *
- * @return The Job for this filter to place asynchronous events into.
- */
- public Job getJobForSession(IoSession session)
- {
- return (Job) session.getAttribute(_name);
- }
-
- /**
- * Implements a terminal continuation for the {@link Job} for this filter. Whenever the Job completes its processing
- * of a batch of events this is called. This method simply re-activates the job, if it has more events to process.
- *
- * @param session The Mina session to work in.
- * @param job The job that completed.
- */
- public void completed(IoSession session, Job job)
- {
-
-
- if (!job.isComplete())
- {
- final ExecutorService pool = _poolReference.getPool();
-
- if(pool == null)
- {
- return;
- }
-
-
- // ritchiem : 2006-12-13 Do we need to perform the additional checks here?
- // Can the pool be shutdown at this point?
- if (job.activate())
- {
- try
- {
- pool.execute(job);
- }
- catch(RejectedExecutionException e)
- {
- _logger.warn("Thread pool shutdown while tasks still outstanding");
- }
-
- }
- }
- }
-
- public void notCompleted(IoSession session, Job job)
- {
- final ExecutorService pool = _poolReference.getPool();
-
- if(pool == null)
- {
- return;
- }
-
- try
- {
- pool.execute(job);
- }
- catch(RejectedExecutionException e)
- {
- _logger.warn("Thread pool shutdown while tasks still outstanding");
- }
-
- }
-
-
-
- /**
- * No-op pass through filter to the next filter in the chain.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- *
- * @throws Exception This method does not throw any exceptions, but has Exception in its signature to allow
- * overriding sub-classes the ability to.
- */
- public void sessionOpened(final NextFilter nextFilter, final IoSession session) throws Exception
- {
- nextFilter.sessionOpened(session);
- }
-
- /**
- * No-op pass through filter to the next filter in the chain.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- *
- * @throws Exception This method does not throw any exceptions, but has Exception in its signature to allow
- * overriding sub-classes the ability to.
- */
- public void sessionClosed(final NextFilter nextFilter, final IoSession session) throws Exception
- {
- nextFilter.sessionClosed(session);
- }
-
- /**
- * No-op pass through filter to the next filter in the chain.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- * @param status The session idle status.
- *
- * @throws Exception This method does not throw any exceptions, but has Exception in its signature to allow
- * overriding sub-classes the ability to.
- */
- public void sessionIdle(final NextFilter nextFilter, final IoSession session, final IdleStatus status) throws Exception
- {
- nextFilter.sessionIdle(session, status);
- }
-
- /**
- * No-op pass through filter to the next filter in the chain.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- * @param cause The underlying exception.
- *
- * @throws Exception This method does not throw any exceptions, but has Exception in its signature to allow
- * overriding sub-classes the ability to.
- */
- public void exceptionCaught(final NextFilter nextFilter, final IoSession session, final Throwable cause) throws Exception
- {
- nextFilter.exceptionCaught(session, cause);
- }
-
- /**
- * No-op pass through filter to the next filter in the chain.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- * @param message The message received.
- *
- * @throws Exception This method does not throw any exceptions, but has Exception in its signature to allow
- * overriding sub-classes the ability to.
- */
- public void messageReceived(final NextFilter nextFilter, final IoSession session, final Object message) throws Exception
- {
- nextFilter.messageReceived(session, message);
- }
-
- /**
- * No-op pass through filter to the next filter in the chain.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- * @param message The message sent.
- *
- * @throws Exception This method does not throw any exceptions, but has Exception in its signature to allow
- * overriding sub-classes the ability to.
- */
- public void messageSent(final NextFilter nextFilter, final IoSession session, final Object message) throws Exception
- {
- nextFilter.messageSent(session, message);
- }
-
- /**
- * No-op pass through filter to the next filter in the chain.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- * @param writeRequest The write request event.
- *
- * @throws Exception This method does not throw any exceptions, but has Exception in its signature to allow
- * overriding sub-classes the ability to.
- */
- public void filterWrite(final NextFilter nextFilter, final IoSession session, final WriteRequest writeRequest)
- throws Exception
- {
- nextFilter.filterWrite(session, writeRequest);
- }
-
- /**
- * No-op pass through filter to the next filter in the chain.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- *
- * @throws Exception This method does not throw any exceptions, but has Exception in its signature to allow
- * overriding sub-classes the ability to.
- */
- public void filterClose(NextFilter nextFilter, IoSession session) throws Exception
- {
- nextFilter.filterClose(session);
- }
-
- /**
- * No-op pass through filter to the next filter in the chain.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- *
- * @throws Exception This method does not throw any exceptions, but has Exception in its signature to allow
- * overriding sub-classes the ability to.
- */
- public void sessionCreated(NextFilter nextFilter, IoSession session) throws Exception
- {
- nextFilter.sessionCreated(session);
- }
-
- /**
- * Prints the filter types identifying name to a string, mainly for debugging purposes.
- *
- * @return The filter types identifying name.
- */
- public String toString()
- {
- return _name;
- }
-
- /**
- * AsynchReadPoolingFilter is a pooling filter that handles 'messageReceived' and 'sessionClosed' events
- * asynchronously.
- */
- public static class AsynchReadPoolingFilter extends PoolingFilter
- {
- /**
- * Creates a pooling filter that handles read events asynchronously.
- *
- * @param refCountingPool A managed reference to the thread pool.
- * @param name The filter types identifying name.
- */
- public AsynchReadPoolingFilter(ReferenceCountingExecutorService refCountingPool, String name)
- {
- super(refCountingPool, name, Integer.getInteger("amqj.server.read_write_pool.max_read_events", MAX_JOB_EVENTS),true);
- }
-
- /**
- * Hands off this event for asynchronous execution.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- * @param message The message received.
- */
- public void messageReceived(NextFilter nextFilter, final IoSession session, Object message)
- {
- Job job = getJobForSession(session);
- fireAsynchEvent(job, new Event.ReceivedEvent(nextFilter, message));
- }
-
- /**
- * Hands off this event for asynchronous execution.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- */
- public void sessionClosed(final NextFilter nextFilter, final IoSession session)
- {
- Job job = getJobForSession(session);
- fireAsynchEvent(job, new CloseEvent(nextFilter));
- }
- }
-
- /**
- * AsynchWritePoolingFilter is a pooling filter that handles 'filterWrite' and 'sessionClosed' events
- * asynchronously.
- */
- public static class AsynchWritePoolingFilter extends PoolingFilter
- {
- /**
- * Creates a pooling filter that handles write events asynchronously.
- *
- * @param refCountingPool A managed reference to the thread pool.
- * @param name The filter types identifying name.
- */
- public AsynchWritePoolingFilter(ReferenceCountingExecutorService refCountingPool, String name)
- {
- super(refCountingPool, name, Integer.getInteger("amqj.server.read_write_pool.max_write_events", MAX_JOB_EVENTS),false);
- }
-
- /**
- * Hands off this event for asynchronous execution.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- * @param writeRequest The write request event.
- */
- public void filterWrite(final NextFilter nextFilter, final IoSession session, final WriteRequest writeRequest)
- {
- Job job = getJobForSession(session);
- fireAsynchEvent(job, new Event.WriteEvent(nextFilter, writeRequest));
- }
-
- /**
- * Hands off this event for asynchronous execution.
- *
- * @param nextFilter The next filter in the chain.
- * @param session The Mina session.
- */
- public void sessionClosed(final NextFilter nextFilter, final IoSession session)
- {
- Job job = getJobForSession(session);
- fireAsynchEvent(job, new CloseEvent(nextFilter));
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteJobQueue.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteJobQueue.java
deleted file mode 100644
index 8de0f93ce9..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteJobQueue.java
+++ /dev/null
@@ -1,432 +0,0 @@
-package org.apache.qpid.pool;
-
-import java.util.AbstractQueue;
-import java.util.Iterator;
-import java.util.Collection;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.locks.ReentrantLock;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/*
-*
-* 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.
-*
-*/
-public class ReadWriteJobQueue extends AbstractQueue<Runnable> implements BlockingQueue<Runnable>
-{
-
- private final AtomicInteger _count = new AtomicInteger(0);
-
- private final ReentrantLock _takeLock = new ReentrantLock();
-
- private final Condition _notEmpty = _takeLock.newCondition();
-
- private final ReentrantLock _putLock = new ReentrantLock();
-
- private final ConcurrentLinkedQueue<ReadWriteRunnable> _readJobQueue = new ConcurrentLinkedQueue<ReadWriteRunnable>();
-
- private final ConcurrentLinkedQueue<ReadWriteRunnable> _writeJobQueue = new ConcurrentLinkedQueue<ReadWriteRunnable>();
-
-
- private class ReadWriteJobIterator implements Iterator<Runnable>
- {
-
- private boolean _onReads;
- private Iterator<ReadWriteRunnable> _iter = _writeJobQueue.iterator();
-
- public boolean hasNext()
- {
- if(!_iter.hasNext())
- {
- if(_onReads)
- {
- _iter = _readJobQueue.iterator();
- _onReads = true;
- return _iter.hasNext();
- }
- else
- {
- return false;
- }
- }
- else
- {
- return true;
- }
- }
-
- public Runnable next()
- {
- if(_iter.hasNext())
- {
- return _iter.next();
- }
- else
- {
- return null;
- }
- }
-
- public void remove()
- {
- _takeLock.lock();
- try
- {
- _iter.remove();
- _count.decrementAndGet();
- }
- finally
- {
- _takeLock.unlock();
- }
- }
- }
-
- public Iterator<Runnable> iterator()
- {
- return new ReadWriteJobIterator();
- }
-
- public int size()
- {
- return _count.get();
- }
-
- public boolean offer(final Runnable runnable)
- {
- final ReadWriteRunnable job = (ReadWriteRunnable) runnable;
- final ReentrantLock putLock = _putLock;
- putLock.lock();
- try
- {
- if(job.isRead())
- {
- _readJobQueue.offer(job);
- }
- else
- {
- _writeJobQueue.offer(job);
- }
- if(_count.getAndIncrement() == 0)
- {
- _takeLock.lock();
- try
- {
- _notEmpty.signal();
- }
- finally
- {
- _takeLock.unlock();
- }
- }
- return true;
- }
- finally
- {
- putLock.unlock();
- }
- }
-
- public void put(final Runnable runnable) throws InterruptedException
- {
- final ReadWriteRunnable job = (ReadWriteRunnable) runnable;
- final ReentrantLock putLock = _putLock;
- putLock.lock();
-
- try
- {
- if(job.isRead())
- {
- _readJobQueue.offer(job);
- }
- else
- {
- _writeJobQueue.offer(job);
- }
- if(_count.getAndIncrement() == 0)
- {
- _takeLock.lock();
- try
- {
- _notEmpty.signal();
- }
- finally
- {
- _takeLock.unlock();
- }
- }
-
- }
- finally
- {
- putLock.unlock();
- }
- }
-
-
-
- public boolean offer(final Runnable runnable, final long timeout, final TimeUnit unit) throws InterruptedException
- {
- final ReadWriteRunnable job = (ReadWriteRunnable) runnable;
- final ReentrantLock putLock = _putLock;
- putLock.lock();
-
- try
- {
- if(job.isRead())
- {
- _readJobQueue.offer(job);
- }
- else
- {
- _writeJobQueue.offer(job);
- }
- if(_count.getAndIncrement() == 0)
- {
- _takeLock.lock();
- try
- {
- _notEmpty.signal();
- }
- finally
- {
- _takeLock.unlock();
- }
- }
-
- return true;
- }
- finally
- {
- putLock.unlock();
- }
-
- }
-
- public Runnable take() throws InterruptedException
- {
- final ReentrantLock takeLock = _takeLock;
- takeLock.lockInterruptibly();
- try
- {
- try
- {
- while (_count.get() == 0)
- {
- _notEmpty.await();
- }
- }
- catch (InterruptedException ie)
- {
- _notEmpty.signal();
- throw ie;
- }
-
- ReadWriteRunnable job = _writeJobQueue.poll();
- if(job == null)
- {
- job = _readJobQueue.poll();
- }
- int c = _count.getAndDecrement();
- if (c > 1)
- {
- _notEmpty.signal();
- }
- return job;
- }
- finally
- {
- takeLock.unlock();
- }
-
-
- }
-
- public Runnable poll(final long timeout, final TimeUnit unit) throws InterruptedException
- {
- final ReentrantLock takeLock = _takeLock;
- final AtomicInteger count = _count;
- long nanos = unit.toNanos(timeout);
- takeLock.lockInterruptibly();
- ReadWriteRunnable job = null;
- try
- {
-
- for (;;)
- {
- if (count.get() > 0)
- {
- job = _writeJobQueue.poll();
- if(job == null)
- {
- job = _readJobQueue.poll();
- }
- int c = count.getAndDecrement();
- if (c > 1)
- {
- _notEmpty.signal();
- }
- break;
- }
- if (nanos <= 0)
- {
- return null;
- }
- try
- {
- nanos = _notEmpty.awaitNanos(nanos);
- }
- catch (InterruptedException ie)
- {
- _notEmpty.signal();
- throw ie;
- }
- }
- }
- finally
- {
- takeLock.unlock();
- }
-
- return job;
- }
-
- public int remainingCapacity()
- {
- return Integer.MAX_VALUE;
- }
-
- public int drainTo(final Collection<? super Runnable> c)
- {
- int total = 0;
-
- _putLock.lock();
- _takeLock.lock();
- try
- {
- ReadWriteRunnable job;
- while((job = _writeJobQueue.peek())!= null)
- {
- c.add(job);
- _writeJobQueue.poll();
- _count.decrementAndGet();
- total++;
- }
-
- while((job = _readJobQueue.peek())!= null)
- {
- c.add(job);
- _readJobQueue.poll();
- _count.decrementAndGet();
- total++;
- }
-
- }
- finally
- {
- _takeLock.unlock();
- _putLock.unlock();
- }
- return total;
- }
-
- public int drainTo(final Collection<? super Runnable> c, final int maxElements)
- {
- int total = 0;
-
- _putLock.lock();
- _takeLock.lock();
- try
- {
- ReadWriteRunnable job;
- while(total<=maxElements && (job = _writeJobQueue.peek())!= null)
- {
- c.add(job);
- _writeJobQueue.poll();
- _count.decrementAndGet();
- total++;
- }
-
- while(total<=maxElements && (job = _readJobQueue.peek())!= null)
- {
- c.add(job);
- _readJobQueue.poll();
- _count.decrementAndGet();
- total++;
- }
-
- }
- finally
- {
- _takeLock.unlock();
- _putLock.unlock();
- }
- return total;
-
- }
-
- public Runnable poll()
- {
- final ReentrantLock takeLock = _takeLock;
- takeLock.lock();
- try
- {
- if(_count.get() > 0)
- {
- ReadWriteRunnable job = _writeJobQueue.poll();
- if(job == null)
- {
- job = _readJobQueue.poll();
- }
- _count.decrementAndGet();
- return job;
- }
- else
- {
- return null;
- }
- }
- finally
- {
- takeLock.unlock();
- }
-
- }
-
- public Runnable peek()
- {
- final ReentrantLock takeLock = _takeLock;
- takeLock.lock();
- try
- {
- ReadWriteRunnable job = _writeJobQueue.peek();
- if(job == null)
- {
- job = _readJobQueue.peek();
- }
- return job;
- }
- finally
- {
- takeLock.unlock();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteRunnable.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteRunnable.java
deleted file mode 100644
index ad04a923e1..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteRunnable.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.apache.qpid.pool;
-
-/*
-*
-* 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.
-*
-*/
-public interface ReadWriteRunnable extends Runnable
-{
- boolean isRead();
- boolean isWrite();
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteThreadModel.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteThreadModel.java
deleted file mode 100644
index 8cea70e597..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReadWriteThreadModel.java
+++ /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.
- *
- */
-package org.apache.qpid.pool;
-
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.ThreadModel;
-import org.apache.mina.filter.ReferenceCountingIoFilter;
-
-/**
- * ReadWriteThreadModel is a Mina i/o filter chain factory, which creates a filter chain with seperate filters to
- * handle read and write events. The seperate filters are {@link PoolingFilter}s, which have thread pools to handle
- * these events. The effect of this is that reading and writing may happen concurrently.
- *
- * <p/>Socket i/o will only happen with concurrent reads and writes if Mina has seperate selector threads for each.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create a filter chain with seperate read and write thread pools for read/write Mina events.
- * <td> {@link PoolingFilter}
- * </table>
- */
-public class ReadWriteThreadModel implements ThreadModel
-{
- /** Holds the singleton instance of this factory. */
- private static final ReadWriteThreadModel _instance = new ReadWriteThreadModel();
-
- /** Holds the thread pooling filter for reads. */
- private final PoolingFilter _asynchronousReadFilter;
-
- /** Holds the thread pooloing filter for writes. */
- private final PoolingFilter _asynchronousWriteFilter;
-
- /**
- * Creates a new factory for concurrent i/o, thread pooling filter chain construction. This is private, so that
- * only a singleton instance of the factory is ever created.
- */
- private ReadWriteThreadModel()
- {
- final ReferenceCountingExecutorService executor = ReferenceCountingExecutorService.getInstance();
- _asynchronousReadFilter = PoolingFilter.createAynschReadPoolingFilter(executor, "AsynchronousReadFilter");
- _asynchronousWriteFilter = PoolingFilter.createAynschWritePoolingFilter(executor, "AsynchronousWriteFilter");
- }
-
- /**
- * Gets the singleton instance of this filter chain factory.
- *
- * @return The singleton instance of this filter chain factory.
- */
- public static ReadWriteThreadModel getInstance()
- {
- return _instance;
- }
-
- /**
- * Gets the read filter.
- *
- * @return The read filter.
- */
- public PoolingFilter getAsynchronousReadFilter()
- {
- return _asynchronousReadFilter;
- }
-
- /**
- * Gets the write filter.
- *
- * @return The write filter.
- */
- public PoolingFilter getAsynchronousWriteFilter()
- {
- return _asynchronousWriteFilter;
- }
-
- /**
- * Adds the concurrent read and write filters to a filter chain.
- *
- * @param chain The Mina filter chain to add to.
- */
- public void buildFilterChain(IoFilterChain chain)
- {
- chain.addFirst("AsynchronousReadFilter", new ReferenceCountingIoFilter(_asynchronousReadFilter));
- chain.addLast("AsynchronousWriteFilter", new ReferenceCountingIoFilter(_asynchronousWriteFilter));
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.java
deleted file mode 100644
index 20a30b3ed3..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.java
+++ /dev/null
@@ -1,172 +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.
- *
- */
-package org.apache.qpid.pool;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.LinkedBlockingQueue;
-
-/**
- * ReferenceCountingExecutorService wraps an ExecutorService in order to provide shared reference to it. It counts
- * the references taken, instantiating the service on the first reference, and shutting it down when the last
- * reference is released.
- *
- * <p/>It is important to ensure that an executor service is correctly shut down as failing to do so prevents the JVM
- * from terminating due to the existence of non-daemon threads.
- *
- * <p/><table id="crc><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide a shared exector service. <td> {@link Executors}
- * <tr><td> Shutdown the executor service when not needed. <td> {@link ExecutorService}
- * <tr><td> Track references to the executor service.
- * <tr><td> Provide configuration of the executor service.
- * </table>
- *
- * @todo Might be more elegant to make this actually implement ExecutorService, providing better hiding of the
- * implementation details. Also this class introduces a pattern (albeit specific to this usage) that could be
- * generalized to reference count anything. That is, on first instance call a create method, on release of last
- * instance call a destroy method. This could definitely be abstracted out as a re-usable piece of code; a
- * reference counting factory. It could then be re-used to do reference counting in other places (such as
- * messages). Countable objects have a simple create/destroy life cycle, capturable by an interface that the
- * ref counting factory can call to manage the lifecycle.
- *
- * @todo {@link #_poolSize} should be static?
- *
- * @todo The {@link #getPool()} method breaks the encapsulation of the reference counter. Generally when getPool is used
- * further checks are applied to ensure that the exector service has not been shutdown. This passes responsibility
- * for managing the lifecycle of the reference counted object onto the caller rather than neatly encapsulating it
- * here. Could think about adding more state to the lifecycle, to mark ref counted objects as invalid, and have an
- * isValid method, or could make calling code deal with RejectedExecutionException raised by shutdown executors.
- */
-public class ReferenceCountingExecutorService
-{
- /** Defines the smallest thread pool that will be allocated, irrespective of the number of processors. */
- private static final int MINIMUM_POOL_SIZE = 4;
-
- /** Holds the number of processors on the machine. */
- private static final int NUM_CPUS = Runtime.getRuntime().availableProcessors();
-
- /** Defines the thread pool size to use, which is the larger of the number of CPUs or the minimum size. */
- private static final int DEFAULT_POOL_SIZE = Math.max(NUM_CPUS, MINIMUM_POOL_SIZE);
-
- /**
- * Holds the singleton instance of this reference counter. This is only created once, statically, so the
- * {@link #getInstance()} method does not need to be synchronized.
- */
- private static final ReferenceCountingExecutorService _instance = new ReferenceCountingExecutorService();
-
- /** This lock is used to ensure that reference counts are updated atomically with create/destroy operations. */
- private final Object _lock = new Object();
-
- /** The shared executor service that is reference counted. */
- private ExecutorService _pool;
-
- /** Holds the number of references given out to the executor service. */
- private int _refCount = 0;
-
- /** Holds the number of executor threads to create. */
- private int _poolSize = Integer.getInteger("amqj.read_write_pool_size", DEFAULT_POOL_SIZE);
-
- private final boolean _useBiasedPool = Boolean.getBoolean("org.apache.qpid.use_write_biased_pool");
-
- /**
- * Retrieves the singleton instance of this reference counter.
- *
- * @return The singleton instance of this reference counter.
- */
- public static ReferenceCountingExecutorService getInstance()
- {
- return _instance;
- }
-
- /**
- * Private constructor to ensure that only a singleton instance can be created.
- */
- private ReferenceCountingExecutorService()
- { }
-
- /**
- * Provides a reference to a shared executor service, incrementing the reference count.
- *
- * @return An executor service.
- */
- public ExecutorService acquireExecutorService()
- {
- synchronized (_lock)
- {
- if (_refCount++ == 0)
- {
-// _pool = Executors.newFixedThreadPool(_poolSize);
-
- // Use a job queue that biases to writes
- if(_useBiasedPool)
- {
- _pool = new ThreadPoolExecutor(_poolSize, _poolSize,
- 0L, TimeUnit.MILLISECONDS,
- new ReadWriteJobQueue());
- }
- else
- {
- _pool = Executors.newFixedThreadPool(_poolSize);
- }
- }
-
-
- return _pool;
- }
- }
-
- /**
- * Releases a reference to a shared executor service, decrementing the reference count. If the refence count falls
- * to zero, the executor service is shut down.
- */
- public void releaseExecutorService()
- {
- synchronized (_lock)
- {
- if (--_refCount == 0)
- {
- _pool.shutdownNow();
- }
- }
- }
-
- /**
- * Provides access to the executor service, without touching the reference count.
- *
- * @return The shared executor service, or <tt>null</tt> if none has been instantiated yet.
- */
- public ExecutorService getPool()
- {
- return _pool;
- }
-
- /**
- * Return the ReferenceCount to this ExecutorService
- * @return reference count
- */
- public int getReferenceCount()
- {
- return _refCount;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java
deleted file mode 100644
index 8dee790a9e..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java
+++ /dev/null
@@ -1,236 +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.
- *
- */
-package org.apache.qpid.protocol;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.qpid.framing.AMQShortString;
-
-/**
- * Defines constants for AMQP codes and also acts as a factory for creating such constants from the raw codes. Each
- * constant also defines a short human readable description of the constant.
- *
- * @todo Why would a constant be defined that is not in the map? Seems more natural that getConstant should raise an
- * exception for an unknown constant. Or else provide an explanation of why this is so. Also, there is no way for
- * callers to determine the unknown status of a code except by comparing its name to "unknown code", which would
- * seem to render this scheme a little bit pointless?
- *
- * @todo Java has a nice enum construct for doing this sort of thing. Maybe this is done in the old style for Java 1.4
- * backward compatability? Now that is handled through retrotranslater it may be time to use enum.
- *
- * <p/><tabld id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Define the set of AMQP status codes.
- * <tr><td> Provide a factory to lookup constants by their code.
- * <tr><td>
- */
-public final class AMQConstant
-{
- /** Defines a map from codes to constants. */
- private static Map _codeMap = new HashMap();
-
- /** Indicates that the method completed successfully. */
- public static final AMQConstant REPLY_SUCCESS = new AMQConstant(200, "reply success", true);
-
- public static final AMQConstant FRAME_END = new AMQConstant(206, "frame end", true);
-
- /**
- * The client asked for a specific message that is no longer available. The message was delivered to another
- * client, or was purged from the queue for some other reason.
- */
- public static final AMQConstant NOT_DELIVERED = new AMQConstant(310, "not delivered", true);
-
- /**
- * The client attempted to transfer content larger than the server could accept at the present time. The client
- * may retry at a later time.
- */
- public static final AMQConstant MESSAGE_TOO_LARGE = new AMQConstant(311, "message too large", true);
-
- /**
- * When the exchange cannot route the result of a .Publish, most likely due to an invalid routing key. Only when
- * the mandatory flag is set.
- */
- public static final AMQConstant NO_ROUTE = new AMQConstant(312, "no route", true);
-
- /**
- * When the exchange cannot deliver to a consumer when the immediate flag is set. As a result of pending data on
- * the queue or the absence of any consumers of the queue.
- */
- public static final AMQConstant NO_CONSUMERS = new AMQConstant(313, "no consumers", true);
-
- /**
- * An operator intervened to close the connection for some reason. The client may retry at some later date.
- */
- public static final AMQConstant CONTEXT_IN_USE = new AMQConstant(320, "context in use", true);
-
- /** The client tried to work with an unknown virtual host or cluster. */
- public static final AMQConstant INVALID_PATH = new AMQConstant(402, "invalid path", true);
-
- /** The client attempted to work with a server entity to which it has no access due to security settings. */
- public static final AMQConstant ACCESS_REFUSED = new AMQConstant(403, "access refused", true);
-
- /** The client attempted to work with a server entity that does not exist. */
- public static final AMQConstant NOT_FOUND = new AMQConstant(404, "not found", true);
-
- /**
- * The client attempted to work with a server entity to which it has no access because another client is
- * working with it.
- */
- public static final AMQConstant ALREADY_EXISTS = new AMQConstant(405, "Already exists", true);
-
- /** The client requested a method that was not allowed because some precondition failed. */
- public static final AMQConstant IN_USE = new AMQConstant(406, "In use", true);
-
- public static final AMQConstant INVALID_ROUTING_KEY = new AMQConstant(407, "routing key invalid", true);
-
- public static final AMQConstant REQUEST_TIMEOUT = new AMQConstant(408, "Request Timeout", true);
-
- public static final AMQConstant INVALID_ARGUMENT = new AMQConstant(409, "argument invalid", true);
-
- /**
- * The client sent a malformed frame that the server could not decode. This strongly implies a programming error
- * in the client.
- */
- public static final AMQConstant FRAME_ERROR = new AMQConstant(501, "frame error", true);
-
- /**
- * The client sent a frame that contained illegal values for one or more fields. This strongly implies a
- * programming error in the client.
- */
- public static final AMQConstant SYNTAX_ERROR = new AMQConstant(502, "syntax error", true);
-
- /**
- * The client sent an invalid sequence of frames, attempting to perform an operation that was considered invalid
- * by the server. This usually implies a programming error in the client.
- */
- public static final AMQConstant COMMAND_INVALID = new AMQConstant(503, "command invalid", true);
-
- /**
- * The client attempted to work with a channel that had not been correctly opened. This most likely indicates a
- * fault in the client layer.
- */
- public static final AMQConstant CHANNEL_ERROR = new AMQConstant(504, "channel error", true);
-
- /**
- * The server could not complete the method because it lacked sufficient resources. This may be due to the client
- * creating too many of some type of entity.
- */
- public static final AMQConstant RESOURCE_ERROR = new AMQConstant(506, "resource error", true);
-
- /**
- * The client tried to work with some entity in a manner that is prohibited by the server, due to security settings
- * or by some other criteria.
- */
- public static final AMQConstant NOT_ALLOWED = new AMQConstant(530, "not allowed", true);
-
- /** The client tried to use functionality that is not implemented in the server. */
- public static final AMQConstant NOT_IMPLEMENTED = new AMQConstant(540, "not implemented", true);
-
- /**
- * The server could not complete the method because of an internal error. The server may require intervention by
- * an operator in order to resume normal operations.
- */
- public static final AMQConstant INTERNAL_ERROR = new AMQConstant(541, "internal error", true);
-
- public static final AMQConstant FRAME_MIN_SIZE = new AMQConstant(4096, "frame min size", true);
-
- /**
- * The server does not support the protocol version
- */
- public static final AMQConstant UNSUPPORTED_BROKER_PROTOCOL_ERROR = new AMQConstant(542, "broker unsupported protocol", true);
- /**
- * The client imp does not support the protocol version
- */
- public static final AMQConstant UNSUPPORTED_CLIENT_PROTOCOL_ERROR = new AMQConstant(543, "client unsupported protocol", true);
-
- /** The AMQP status code. */
- private int _code;
-
- /** A short description of the status code. */
- private AMQShortString _name;
-
- /**
- * Creates a new AMQP status code.
- *
- * @param code The code.
- * @param name A short description of the code.
- * @param map <tt>true</tt> to register the code as a known code, <tt>false</tt> otherwise.
- */
- private AMQConstant(int code, String name, boolean map)
- {
- _code = code;
- _name = new AMQShortString(name);
- if (map)
- {
- _codeMap.put(new Integer(code), this);
- }
- }
-
- /**
- * Creates a constant for a status code by looking up the code in the map of known codes. If the code is not known
- * a constant is still created for it, but it is marked as unknown.
- *
- * @param code The AMQP status code.
- *
- * @return The AMQP status code encapsulated as a constant.
- */
- public static AMQConstant getConstant(int code)
- {
- AMQConstant c = (AMQConstant) _codeMap.get(new Integer(code));
- if (c == null)
- {
- c = new AMQConstant(code, "unknown code", false);
- }
-
- return c;
- }
-
- /**
- * Gets the underlying AMQP status code.
- *
- * @return The AMQP status code.
- */
- public int getCode()
- {
- return _code;
- }
-
- /**
- * Gets a short description of the status code.
- *
- * @return A short description of the status code.
- */
- public AMQShortString getName()
- {
- return _name;
- }
-
- /**
- * Renders the constant as a string, mainly for debugging purposes.
- *
- * @return The status code and its description.
- */
- public String toString()
- {
- return _code + ": " + _name;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java
deleted file mode 100644
index fd6907a152..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java
+++ /dev/null
@@ -1,95 +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.
- *
- */
-package org.apache.qpid.protocol;
-
-import org.apache.qpid.framing.AMQMethodBody;
-
-/**
- * AMQMethodEvent encapsulates an AMQP method call, and the channel on which that method call occurred.
- *
- * <p/>Supplies the:
- * <ul>
- * <li>channel id</li>
- * <li>protocol method</li>
- * </ul>
- *
- * <p/>As the event contains the context in which it occurred, event listeners do not need to be statefull.
- * to listeners. Events are often handled by {@link AMQMethodListener}s.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Encapsulate an AMQP method call and the channel as the context for the method call.
- * </table>
- */
-public class AMQMethodEvent<M extends AMQMethodBody>
-{
- /** Holds the method call. */
- private final M _method;
-
- /** Holds the channel handle for the method call. */
- private final int _channelId;
-
- /**
- * Creates a method event to encasulate a method call and channel.
- *
- * @param channelId The channel on which the method call occurred.
- * @param method The method call.
- */
- public AMQMethodEvent(int channelId, M method)
- {
- _channelId = channelId;
- _method = method;
- }
-
- /**
- * Gets the method call.
- *
- * @return The method call.
- */
- public M getMethod()
- {
- return _method;
- }
-
- /**
- * Gets the channel handle for the method call.
- *
- * @return The channel handle for the method call.
- */
- public int getChannelId()
- {
- return _channelId;
- }
-
- /**
- * Prints the method call as a string, mainly for debugging purposes.
- *
- * @return The method call as a string, mainly for debugging purposes.
- */
- public String toString()
- {
- StringBuilder buf = new StringBuilder("Method event: ");
- buf.append("\nChannel id: ").append(_channelId);
- buf.append("\nMethod: ").append(_method);
-
- return buf.toString();
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java
deleted file mode 100644
index 5a7679a972..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java
+++ /dev/null
@@ -1,70 +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.
- *
- */
-package org.apache.qpid.protocol;
-
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.AMQException;
-
-/**
- * AMQMethodListener is a listener that receives notifications of AMQP methods. The methods are packaged as events in
- * {@link AMQMethodEvent}.
- *
- * <p/>An event listener may be associated with a particular context, usually an AMQP channel, and in addition to
- * receiving method events will be notified of errors on that context. This enables listeners to perform any clean
- * up that they need to do before the context is closed or retried.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Accept notification of AMQP method events. <td> {@link AMQMethodEvent}
- * <tr><td> Accept notification of errors on the event context.
- * </table>
- *
- * @todo Document why the exception is passed to the error method. Is it so that the exception can be passed
- * from the event handling thread to another thread and rethown from there? It is unusual to pass exceptions as
- * method arguments, because they have their own mechanism for propagating through the call stack, so some
- * explanation ought to be provided.
- */
-public interface AMQMethodListener
-{
- /**
- * Notifies the listener that an AMQP method event has occurred.
- *
- * @param evt The AMQP method event (contains the method and channel).
- *
- * @return <tt>true</tt> if the handler processes the method frame, <tt>false<tt> otherwise. Note that this does
- * not prohibit the method event being delivered to subsequent listeners but can be used to determine if
- * nobody has dealt with an incoming method frame.
- *
- * @throws Exception if an error has occurred. This exception may be delivered to all registered listeners using
- * the error() method (see below) allowing them to perform cleanup if necessary.
- *
- * @todo Consider narrowing the exception.
- */
- <B extends AMQMethodBody> boolean methodReceived(AMQMethodEvent<B> evt) throws AMQException;
-
- /**
- * Notifies the listener of an error on the event context to which it is listening. The listener should perform
- * any necessary clean-up for the context.
- *
- * @param e The underlying exception that is the source of the error.
- */
- void error(Exception e);
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQProtocolWriter.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQProtocolWriter.java
deleted file mode 100644
index 65884e4950..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQProtocolWriter.java
+++ /dev/null
@@ -1,43 +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.
- *
- */
-package org.apache.qpid.protocol;
-
-import org.apache.qpid.framing.AMQDataBlock;
-
-/**
- * AMQProtocolWriter provides a method to write a frame of data 'to the wire', in the context of the object
- * that implements the method, usually some sort of session. The block of data, encapsulated by {@link AMQDataBlock},
- * will be encoded as it is written.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Write an encoded block of data to the write, in the context of a session.
- * </table>
- */
-public interface AMQProtocolWriter
-{
- /**
- * Writes a frame to the wire, encoding it as necessary, for example, into a sequence of bytes.
- *
- * @param frame The frame to be encoded and written.
- */
- public void writeFrame(AMQDataBlock frame);
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java
deleted file mode 100644
index b58e7d01dc..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java
+++ /dev/null
@@ -1,64 +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.
- *
- */
-package org.apache.qpid.protocol;
-
-import org.apache.qpid.framing.*;
-import org.apache.qpid.transport.Sender;
-import org.apache.qpid.AMQException;
-
-import java.nio.ByteBuffer;
-
-
-/**
- * AMQVersionAwareProtocolSession is implemented by all AMQP session classes, that need to provide an awareness to
- * callers of the version of the AMQP protocol that they are able to work with.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Provide the method registry for a specific version of the AMQP.
- * </table>
- *
- * @todo Why is this a seperate interface to {@link ProtocolVersionAware}, could they be combined into a single
- * interface and one of them eliminated? Move getRegistry method to ProtocolVersionAware, make the sessions
- * implement AMQProtocolWriter directly and drop this interface.
- */
-public interface AMQVersionAwareProtocolSession extends AMQProtocolWriter, ProtocolVersionAware
-{
- /**
- * Gets the method registry for a specific version of the AMQP.
- *
- * @return The method registry for a specific version of the AMQP.
- */
-// public VersionSpecificRegistry getRegistry();
-
- MethodRegistry getMethodRegistry();
-
-
- public void methodFrameReceived(int channelId, AMQMethodBody body) throws AMQException;
- public void contentHeaderReceived(int channelId, ContentHeaderBody body) throws AMQException;
- public void contentBodyReceived(int channelId, ContentBody body) throws AMQException;
- public void heartbeatBodyReceived(int channelId, HeartbeatBody body) throws AMQException;
-
-
- public void setSender(Sender<ByteBuffer> sender);
- public void init();
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java
deleted file mode 100644
index 56f950dd85..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java
+++ /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.
- *
- */
-package org.apache.qpid.protocol;
-
-import org.apache.qpid.framing.ProtocolVersion;
-
-/**
- * ProtocolVersionAware is implemented by all AMQP handling classes, that need to provide an awareness to callers of
- * the version of the AMQP protocol that they are able to handle.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Report the major and minor AMQP version handled.
- * </table>
- */
-public interface ProtocolVersionAware
-{
- /**
- * @deprecated
- * Reports the AMQP minor version, that the implementer can handle.
- *
- * @return The AMQP minor version.
- */
- public byte getProtocolMinorVersion();
-
- /**
- * @deprecated
- * Reports the AMQP major version, that the implementer can handle.
- *
- * @return The AMQP major version.
- */
- public byte getProtocolMajorVersion();
-
- public ProtocolVersion getProtocolVersion();
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/AMQPCallbackHandler.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/AMQPCallbackHandler.java
deleted file mode 100644
index a3dad9acdc..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/AMQPCallbackHandler.java
+++ /dev/null
@@ -1,28 +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.
- *
- */
-package org.apache.qpid.security;
-
-import javax.security.auth.callback.CallbackHandler;
-
-public interface AMQPCallbackHandler extends CallbackHandler
-{
- void initialise(String username,String password);
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/CallbackHandlerRegistry.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/CallbackHandlerRegistry.java
deleted file mode 100644
index 8c80a1b5b7..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/CallbackHandlerRegistry.java
+++ /dev/null
@@ -1,94 +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.
- *
- */
-package org.apache.qpid.security;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.qpid.QpidConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class CallbackHandlerRegistry
-{
- private static final Logger _logger = LoggerFactory.getLogger(CallbackHandlerRegistry.class);
- private static CallbackHandlerRegistry _instance = new CallbackHandlerRegistry();
-
- private Map<String,Class> _mechanismToHandlerClassMap = new HashMap<String,Class>();
-
- private StringBuilder _mechanisms;
-
- public static CallbackHandlerRegistry getInstance()
- {
- return _instance;
- }
-
- public Class getCallbackHandlerClass(String mechanism)
- {
- return _mechanismToHandlerClassMap.get(mechanism);
- }
-
- public String getMechanisms()
- {
- return _mechanisms.toString();
- }
-
- private CallbackHandlerRegistry()
- {
- // first we register any Sasl client factories
- DynamicSaslRegistrar.registerSaslProviders();
- registerMechanisms();
- }
-
- private void registerMechanisms()
- {
- for (QpidConfig.SecurityMechanism securityMechanism: QpidConfig.get().getSecurityMechanisms() )
- {
- Class clazz = null;
- try
- {
- clazz = Class.forName(securityMechanism.getHandler());
- if (!AMQPCallbackHandler.class.isAssignableFrom(clazz))
- {
- _logger.debug("SASL provider " + clazz + " does not implement " + AMQPCallbackHandler.class +
- ". Skipping");
- continue;
- }
- _mechanismToHandlerClassMap.put(securityMechanism.getType(), clazz);
- if (_mechanisms == null)
- {
-
- _mechanisms = new StringBuilder();
- _mechanisms.append(securityMechanism.getType());
- }
- else
- {
- _mechanisms.append(" " + securityMechanism.getType());
- }
- }
- catch (ClassNotFoundException ex)
- {
- _logger.debug("Unable to load class " + securityMechanism.getHandler() + ". Skipping that SASL provider");
- continue;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/DynamicSaslRegistrar.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/DynamicSaslRegistrar.java
deleted file mode 100644
index d2bf979d0a..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/DynamicSaslRegistrar.java
+++ /dev/null
@@ -1,80 +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.
- *
- */
-package org.apache.qpid.security;
-
-import java.security.Security;
-import java.util.Map;
-import java.util.TreeMap;
-
-import javax.security.sasl.SaslClientFactory;
-
-import org.apache.qpid.QpidConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DynamicSaslRegistrar
-{
- private static final Logger _logger = LoggerFactory.getLogger(DynamicSaslRegistrar.class);
-
- public static void registerSaslProviders()
- {
- Map<String, Class> factories = registerSaslClientFactories();
- if (factories.size() > 0)
- {
- if (Security.addProvider(new JCAProvider(factories)) == -1)
- {
- _logger.error("Unable to load custom SASL providers. Qpid custom SASL authenticators unavailable.");
- }
- else
- {
- _logger.debug("Dynamic SASL provider added as a security provider");
- }
- }
- }
-
- private static Map<String, Class> registerSaslClientFactories()
- {
- TreeMap<String, Class> factoriesToRegister =
- new TreeMap<String, Class>();
-
- for (QpidConfig.SaslClientFactory factory: QpidConfig.get().getSaslClientFactories())
- {
- String className = factory.getFactoryClass();
- try
- {
- Class clazz = Class.forName(className);
- if (!(SaslClientFactory.class.isAssignableFrom(clazz)))
- {
- _logger.debug("Class " + clazz + " does not implement " + SaslClientFactory.class + " - skipping");
- continue;
- }
- factoriesToRegister.put(factory.getType(), clazz);
- }
- catch (Exception ex)
- {
- _logger.debug("Error instantiating SaslClientFactory calss " + className + " - skipping");
- }
- }
- return factoriesToRegister;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/JCAProvider.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/JCAProvider.java
deleted file mode 100644
index 033deb550c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/JCAProvider.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.security;
-
-import java.security.Provider;
-import java.security.Security;
-import java.util.Map;
-
-public class JCAProvider extends Provider
-{
- public JCAProvider(Map<String, Class> providerMap)
- {
- super("AMQSASLProvider", 1.0, "A JCA provider that registers all " +
- "AMQ SASL providers that want to be registered");
- register(providerMap);
- Security.addProvider(this);
- }
-
- private void register(Map<String, Class> providerMap)
- {
- for (Map.Entry<String, Class> me :providerMap.entrySet())
- {
- put("SaslClientFactory." + me.getKey(), me.getValue().getName());
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/UsernamePasswordCallbackHandler.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/UsernamePasswordCallbackHandler.java
deleted file mode 100644
index 89a63abeab..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/UsernamePasswordCallbackHandler.java
+++ /dev/null
@@ -1,60 +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.
- *
- */
-package org.apache.qpid.security;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-public class UsernamePasswordCallbackHandler implements AMQPCallbackHandler
-{
- private String _username;
- private String _password;
-
- public void initialise(String username,String password)
- {
- _username = username;
- _password = password;
- }
-
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- for (int i = 0; i < callbacks.length; i++)
- {
- Callback cb = callbacks[i];
- if (cb instanceof NameCallback)
- {
- ((NameCallback)cb).setName(_username);
- }
- else if (cb instanceof PasswordCallback)
- {
- ((PasswordCallback)cb).setPassword((_password).toCharArray());
- }
- else
- {
- throw new UnsupportedCallbackException(cb);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/amqplain/AmqPlainSaslClient.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/amqplain/AmqPlainSaslClient.java
deleted file mode 100644
index 81acc66de4..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/amqplain/AmqPlainSaslClient.java
+++ /dev/null
@@ -1,105 +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.
- *
- */
-package org.apache.qpid.security.amqplain;
-
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.FieldTableFactory;
-
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslException;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.Callback;
-
-/**
- * Implements the "AMQPlain" authentication protocol that uses FieldTables to send username and pwd.
- *
- */
-public class AmqPlainSaslClient implements SaslClient
-{
- /**
- * The name of this mechanism
- */
- public static final String MECHANISM = "AMQPLAIN";
-
- private CallbackHandler _cbh;
-
- public AmqPlainSaslClient(CallbackHandler cbh)
- {
- _cbh = cbh;
- }
-
- public String getMechanismName()
- {
- return "AMQPLAIN";
- }
-
- public boolean hasInitialResponse()
- {
- return true;
- }
-
- public byte[] evaluateChallenge(byte[] challenge) throws SaslException
- {
- // we do not care about the prompt or the default name
- NameCallback nameCallback = new NameCallback("prompt", "defaultName");
- PasswordCallback pwdCallback = new PasswordCallback("prompt", false);
- Callback[] callbacks = new Callback[]{nameCallback, pwdCallback};
- try
- {
- _cbh.handle(callbacks);
- }
- catch (Exception e)
- {
- throw new SaslException("Error handling SASL callbacks: " + e, e);
- }
- FieldTable table = FieldTableFactory.newFieldTable();
- table.setString("LOGIN", nameCallback.getName());
- table.setString("PASSWORD", new String(pwdCallback.getPassword()));
- return table.getDataAsBytes();
- }
-
- public boolean isComplete()
- {
- return true;
- }
-
- public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
- {
- throw new SaslException("Not supported");
- }
-
- public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
- {
- throw new SaslException("Not supported");
- }
-
- public Object getNegotiatedProperty(String propName)
- {
- return null;
- }
-
- public void dispose() throws SaslException
- {
- _cbh = null;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/amqplain/AmqPlainSaslClientFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/amqplain/AmqPlainSaslClientFactory.java
deleted file mode 100644
index 6c66c87f4c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/security/amqplain/AmqPlainSaslClientFactory.java
+++ /dev/null
@@ -1,62 +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.
- *
- */
-package org.apache.qpid.security.amqplain;
-
-import javax.security.sasl.SaslClientFactory;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.Sasl;
-import javax.security.auth.callback.CallbackHandler;
-import java.util.Map;
-
-public class AmqPlainSaslClientFactory implements SaslClientFactory
-{
- public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Map props, CallbackHandler cbh) throws SaslException
- {
- for (int i = 0; i < mechanisms.length; i++)
- {
- if (mechanisms[i].equals(AmqPlainSaslClient.MECHANISM))
- {
- if (cbh == null)
- {
- throw new SaslException("CallbackHandler must not be null");
- }
- return new AmqPlainSaslClient(cbh);
- }
- }
- return null;
- }
-
- public String[] getMechanismNames(Map props)
- {
- if (props.containsKey(Sasl.POLICY_NOPLAINTEXT) ||
- props.containsKey(Sasl.POLICY_NODICTIONARY) ||
- props.containsKey(Sasl.POLICY_NOACTIVE))
- {
- // returned array must be non null according to interface documentation
- return new String[0];
- }
- else
- {
- return new String[]{AmqPlainSaslClient.MECHANISM};
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.java
deleted file mode 100644
index e142d21e06..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.java
+++ /dev/null
@@ -1,195 +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.
- *
- */
-package org.apache.qpid.ssl;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.GeneralSecurityException;
-import java.security.KeyStore;
-
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManagerFactory;
-
-/**
- * Factory used to create SSLContexts. SSL needs to be configured
- * before this will work.
- *
- */
-public class SSLContextFactory {
-
- /**
- * Path to the Java keystore file
- */
- private String _keyStorePath;
-
- /**
- * Password for the keystore
- */
- private String _keyStorePassword;
-
- /**
- * Cert type to use in keystore
- */
- private String _keyStoreCertType;
-
- /**
- * Path to the Java truststore file
- */
- private String _trustStorePath;
-
- /**
- * Password for the truststore
- */
- private String _trustStorePassword;
-
- /**
- * Cert type to use in truststore
- */
- private String _trustStoreCertType;
-
-
-
- public SSLContextFactory(String trustStorePath, String trustStorePassword,
- String trustStoreCertType)
- {
- this(trustStorePath,trustStorePassword,trustStoreCertType,
- trustStorePath,trustStorePassword,trustStoreCertType);
- }
-
- /**
- * Create a factory instance
- * @param keystorePath path to the Java keystore file
- * @param keystorePassword password for the Java keystore
- * @param certType certificate type
- */
- public SSLContextFactory(String trustStorePath, String trustStorePassword, String trustStoreCertType,
- String keyStorePath, String keyStorePassword, String keyStoreCertType)
- {
-
- _trustStorePath = trustStorePath;
- _trustStorePassword = trustStorePassword;
-
- if (_trustStorePassword.equals("none"))
- {
- _trustStorePassword = null;
- }
- _trustStoreCertType = trustStoreCertType;
-
- _keyStorePath = keyStorePath;
- _keyStorePassword = keyStorePassword;
-
- if (_keyStorePassword.equals("none"))
- {
- _keyStorePassword = null;
- }
- _keyStoreCertType = keyStoreCertType;
-
- if (_trustStorePath == null) {
- throw new IllegalArgumentException("A TrustStore path or KeyStore path must be specified");
- }
- if (_trustStoreCertType == null) {
- throw new IllegalArgumentException("Cert type must be specified");
- }
- }
-
- /**
- * Builds a SSLContext appropriate for use with a server
- * @return SSLContext
- * @throws GeneralSecurityException
- * @throws IOException
- */
- public SSLContext buildServerContext() throws GeneralSecurityException, IOException
- {
- // Create keystore
- KeyStore ks = getInitializedKeyStore(_keyStorePath,_keyStorePassword);
-
- // Set up key manager factory to use our key store
- KeyManagerFactory kmf = KeyManagerFactory.getInstance(_keyStoreCertType);
- kmf.init(ks, _keyStorePassword.toCharArray());
-
- KeyStore ts = getInitializedKeyStore(_trustStorePath,_trustStorePassword);
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(_trustStoreCertType);
- tmf.init(ts);
-
- // Initialize the SSLContext to work with our key managers.
- SSLContext sslContext = SSLContext.getInstance("TLS");
- sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
-
- return sslContext;
- }
-
- /**
- * Creates a SSLContext factory appropriate for use with a client
- * @return SSLContext
- * @throws GeneralSecurityException
- * @throws IOException
- */
- public SSLContext buildClientContext() throws GeneralSecurityException, IOException
- {
- KeyStore ks = getInitializedKeyStore(_trustStorePath,_trustStorePassword);
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(_trustStoreCertType);
- tmf.init(ks);
- SSLContext context = SSLContext.getInstance("TLS");
- context.init(null, tmf.getTrustManagers(), null);
- return context;
- }
-
- private KeyStore getInitializedKeyStore(String storePath, String storePassword) throws GeneralSecurityException, IOException
- {
- KeyStore ks = KeyStore.getInstance("JKS");
- InputStream in = null;
- try
- {
- File f = new File(storePath);
- if (f.exists())
- {
- in = new FileInputStream(f);
- }
- else
- {
- in = Thread.currentThread().getContextClassLoader().getResourceAsStream(storePath);
- }
- if (in == null)
- {
- throw new IOException("Unable to load keystore resource: " + storePath);
- }
- ks.load(in, storePassword.toCharArray());
- }
- finally
- {
- if (in != null)
- {
- //noinspection EmptyCatchBlock
- try
- {
- in.close();
- }
- catch (IOException ignored)
- {
- }
- }
- }
- return ks;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Binary.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Binary.java
deleted file mode 100644
index 4e97855a6f..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Binary.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.nio.ByteBuffer;
-
-import static org.apache.qpid.transport.util.Functions.*;
-
-
-/**
- * Binary
- *
- */
-
-public final class Binary
-{
-
- private byte[] bytes;
- private int offset;
- private int size;
- private int hash = 0;
-
- public Binary(byte[] bytes, int offset, int size)
- {
- if (offset + size > bytes.length)
- {
- throw new ArrayIndexOutOfBoundsException();
- }
-
- this.bytes = bytes;
- this.offset = offset;
- this.size = size;
- }
-
- public Binary(byte[] bytes)
- {
- this(bytes, 0, bytes.length);
- }
-
- public final byte[] getBytes()
- {
- byte[] result = new byte[size];
- System.arraycopy(bytes, offset, result, 0, size);
- return result;
- }
-
- public final byte[] array()
- {
- return bytes;
- }
-
- public final int offset()
- {
- return offset;
- }
-
- public final int size()
- {
- return size;
- }
-
- public final Binary slice(int low, int high)
- {
- int sz;
-
- if (high < 0)
- {
- sz = size + high;
- }
- else
- {
- sz = high - low;
- }
-
- if (sz < 0)
- {
- sz = 0;
- }
-
- return new Binary(bytes, offset + low, sz);
- }
-
- public final int hashCode()
- {
- if (hash == 0)
- {
- int hc = 0;
- for (int i = 0; i < size; i++)
- {
- hc = 31*hc + (0xFF & bytes[offset + i]);
- }
- hash = hc;
- }
-
- return hash;
- }
-
- public final boolean equals(Object o)
- {
- if (!(o instanceof Binary))
- {
- return false;
- }
-
- Binary buf = (Binary) o;
- if (this.size != buf.size)
- {
- return false;
- }
-
- for (int i = 0; i < size; i++)
- {
- if (bytes[offset + i] != buf.bytes[buf.offset + i])
- {
- return false;
- }
- }
-
- return true;
- }
-
- public String toString()
- {
- return str(ByteBuffer.wrap(bytes, offset, size));
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Binding.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Binding.java
deleted file mode 100644
index 8418c42189..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Binding.java
+++ /dev/null
@@ -1,36 +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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * Binding
- *
- */
-
-public interface Binding<E,T>
-{
-
- E endpoint(Sender<T> sender);
-
- Receiver<T> receiver(E endpoint);
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java
deleted file mode 100644
index 2604f6970c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ClientDelegate.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-
-import java.io.UnsupportedEncodingException;
-
-import org.apache.qpid.QpidException;
-
-import org.apache.qpid.security.UsernamePasswordCallbackHandler;
-
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-
-
-import static org.apache.qpid.transport.Connection.State.*;
-
-
-/**
- * ClientDelegate
- *
- */
-
-public class ClientDelegate extends ConnectionDelegate
-{
-
- private String vhost;
- private String username;
- private String password;
-
- public ClientDelegate(String vhost, String username, String password)
- {
- this.vhost = vhost;
- this.username = username;
- this.password = password;
- }
-
- public void init(Connection conn, ProtocolHeader hdr)
- {
- if (!(hdr.getMajor() == 0 && hdr.getMinor() == 10))
- {
- conn.exception(new ProtocolVersionException(hdr.getMajor(), hdr.getMinor()));
- }
- }
-
- @Override public void connectionStart(Connection conn, ConnectionStart start)
- {
- List<Object> mechanisms = start.getMechanisms();
- if (mechanisms == null || mechanisms.isEmpty())
- {
- conn.connectionStartOk
- (Collections.EMPTY_MAP, null, null, conn.getLocale());
- return;
- }
-
- String[] mechs = new String[mechanisms.size()];
- mechanisms.toArray(mechs);
-
- try
- {
- UsernamePasswordCallbackHandler handler =
- new UsernamePasswordCallbackHandler();
- handler.initialise(username, password);
- SaslClient sc = Sasl.createSaslClient
- (new String[] {"PLAIN"}, null, "AMQP", "localhost", null, handler);
- conn.setSaslClient(sc);
-
- byte[] response = sc.hasInitialResponse() ?
- sc.evaluateChallenge(new byte[0]) : null;
- conn.connectionStartOk
- (Collections.EMPTY_MAP, sc.getMechanismName(), response,
- conn.getLocale());
- }
- catch (SaslException e)
- {
- conn.exception(e);
- }
- }
-
- @Override public void connectionSecure(Connection conn, ConnectionSecure secure)
- {
- SaslClient sc = conn.getSaslClient();
- try
- {
- byte[] response = sc.evaluateChallenge(secure.getChallenge());
- conn.connectionSecureOk(response);
- }
- catch (SaslException e)
- {
- conn.exception(e);
- }
- }
-
- @Override public void connectionTune(Connection conn, ConnectionTune tune)
- {
- conn.setChannelMax(tune.getChannelMax());
- conn.connectionTuneOk(tune.getChannelMax(), tune.getMaxFrameSize(), tune.getHeartbeatMax());
- conn.connectionOpen(vhost, null, Option.INSIST);
- }
-
- @Override public void connectionOpenOk(Connection conn, ConnectionOpenOk ok)
- {
- conn.setState(OPEN);
- }
-
- @Override public void connectionRedirect(Connection conn, ConnectionRedirect redir)
- {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java
deleted file mode 100644
index 56cbf5ee13..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java
+++ /dev/null
@@ -1,505 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import org.apache.qpid.transport.network.ConnectionBinding;
-import org.apache.qpid.transport.network.io.IoTransport;
-import org.apache.qpid.transport.util.Logger;
-import org.apache.qpid.transport.util.Waiter;
-import org.apache.qpid.util.Strings;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import java.util.UUID;
-
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslServer;
-
-import static org.apache.qpid.transport.Connection.State.*;
-
-
-/**
- * Connection
- *
- * @author Rafael H. Schloming
- *
- * @todo the channels map should probably be replaced with something
- * more efficient, e.g. an array or a map implementation that can use
- * short instead of Short
- */
-
-public class Connection extends ConnectionInvoker
- implements Receiver<ProtocolEvent>, Sender<ProtocolEvent>
-{
-
- private static final Logger log = Logger.get(Connection.class);
-
- enum State { NEW, CLOSED, OPENING, OPEN, CLOSING, CLOSE_RCVD }
-
- class DefaultConnectionListener implements ConnectionListener
- {
- public void opened(Connection conn) {}
- public void exception(Connection conn, ConnectionException exception)
- {
- log.error(exception, "connection exception");
- }
- public void closed(Connection conn) {}
- }
-
- private ConnectionDelegate delegate;
- private Sender<ProtocolEvent> sender;
-
- final private Map<Binary,Session> sessions = new HashMap<Binary,Session>();
- final private Map<Integer,Session> channels = new HashMap<Integer,Session>();
-
- private State state = NEW;
- private Object lock = new Object();
- private long timeout = 60000;
- private ConnectionListener listener = new DefaultConnectionListener();
- private ConnectionException error = null;
-
- private int channelMax = 1;
- private String locale;
- private SaslServer saslServer;
- private SaslClient saslClient;
-
- // want to make this final
- private int _connectionId;
-
- public Connection() {}
-
- public void setConnectionDelegate(ConnectionDelegate delegate)
- {
- this.delegate = delegate;
- }
-
- public void setConnectionListener(ConnectionListener listener)
- {
- if (listener == null)
- {
- this.listener = new DefaultConnectionListener();
- }
- else
- {
- this.listener = listener;
- }
- }
-
- public Sender<ProtocolEvent> getSender()
- {
- return sender;
- }
-
- public void setSender(Sender<ProtocolEvent> sender)
- {
- this.sender = sender;
- }
-
- void setState(State state)
- {
- synchronized (lock)
- {
- this.state = state;
- lock.notifyAll();
- }
- }
-
- void setLocale(String locale)
- {
- this.locale = locale;
- }
-
- String getLocale()
- {
- return locale;
- }
-
- void setSaslServer(SaslServer saslServer)
- {
- this.saslServer = saslServer;
- }
-
- SaslServer getSaslServer()
- {
- return saslServer;
- }
-
- void setSaslClient(SaslClient saslClient)
- {
- this.saslClient = saslClient;
- }
-
- SaslClient getSaslClient()
- {
- return saslClient;
- }
-
- public void connect(String host, int port, String vhost, String username, String password)
- {
- connect(host, port, vhost, username, password, false);
- }
-
- public void connect(String host, int port, String vhost, String username, String password, boolean ssl)
- {
- synchronized (lock)
- {
- state = OPENING;
-
- delegate = new ClientDelegate(vhost, username, password);
-
- IoTransport.connect(host, port, ConnectionBinding.get(this), ssl);
- send(new ProtocolHeader(1, 0, 10));
-
- Waiter w = new Waiter(lock, timeout);
- while (w.hasTime() && state == OPENING && error == null)
- {
- w.await();
- }
-
- if (error != null)
- {
- ConnectionException t = error;
- error = null;
- try
- {
- close();
- }
- catch (ConnectionException ce)
- {
- if (!(t instanceof ProtocolVersionException))
- {
- throw ce;
- }
- }
- t.rethrow();
- }
-
- switch (state)
- {
- case OPENING:
- close();
- throw new ConnectionException("connect() timed out");
- case OPEN:
- break;
- case CLOSED:
- throw new ConnectionException("connect() aborted");
- default:
- throw new IllegalStateException(String.valueOf(state));
- }
- }
-
- listener.opened(this);
- }
-
- public Session createSession()
- {
- return createSession(0);
- }
-
- public Session createSession(long expiry)
- {
- return createSession(UUID.randomUUID().toString(), expiry);
- }
-
- public Session createSession(String name)
- {
- return createSession(name, 0);
- }
-
- public Session createSession(String name, long expiry)
- {
- return createSession(Strings.toUTF8(name), expiry);
- }
-
- public Session createSession(byte[] name, long expiry)
- {
- return createSession(new Binary(name), expiry);
- }
-
- public Session createSession(Binary name, long expiry)
- {
- synchronized (lock)
- {
- Session ssn = new Session(this, name, expiry);
- sessions.put(name, ssn);
- map(ssn);
- ssn.attach();
- return ssn;
- }
- }
-
- void removeSession(Session ssn)
- {
- synchronized (lock)
- {
- sessions.remove(ssn.getName());
- }
- }
-
- public void setConnectionId(int id)
- {
- _connectionId = id;
- }
-
- public int getConnectionId()
- {
- return _connectionId;
- }
-
- public ConnectionDelegate getConnectionDelegate()
- {
- return delegate;
- }
-
- public void received(ProtocolEvent event)
- {
- log.debug("RECV: [%s] %s", this, event);
- event.delegate(this, delegate);
- }
-
- public void send(ProtocolEvent event)
- {
- log.debug("SEND: [%s] %s", this, event);
- Sender s = sender;
- if (s == null)
- {
- throw new ConnectionException("connection closed");
- }
- s.send(event);
- }
-
- public void flush()
- {
- log.debug("FLUSH: [%s]", this);
- sender.flush();
- }
-
- protected void invoke(Method method)
- {
- method.setChannel(0);
- send(method);
- if (!method.isBatch())
- {
- flush();
- }
- }
-
- public void dispatch(Method method)
- {
- Session ssn = getSession(method.getChannel());
- ssn.received(method);
- }
-
- public int getChannelMax()
- {
- return channelMax;
- }
-
- void setChannelMax(int max)
- {
- channelMax = max;
- }
-
- private int map(Session ssn)
- {
- synchronized (lock)
- {
- for (int i = 0; i < getChannelMax(); i++)
- {
- if (!channels.containsKey(i))
- {
- map(ssn, i);
- return i;
- }
- }
-
- throw new RuntimeException("no more channels available");
- }
- }
-
- void map(Session ssn, int channel)
- {
- synchronized (lock)
- {
- channels.put(channel, ssn);
- ssn.setChannel(channel);
- }
- }
-
- void unmap(Session ssn)
- {
- synchronized (lock)
- {
- channels.remove(ssn.getChannel());
- }
- }
-
- Session getSession(int channel)
- {
- synchronized (lock)
- {
- return channels.get(channel);
- }
- }
-
- public void resume()
- {
- synchronized (lock)
- {
- for (Session ssn : sessions.values())
- {
- map(ssn);
- ssn.attach();
- ssn.resume();
- }
- }
- }
-
- public void exception(ConnectionException e)
- {
- synchronized (lock)
- {
- switch (state)
- {
- case OPENING:
- case CLOSING:
- error = e;
- lock.notifyAll();
- return;
- }
- }
-
- listener.exception(this, e);
- }
-
- public void exception(Throwable t)
- {
- exception(new ConnectionException(t));
- }
-
- void closeCode(ConnectionClose close)
- {
- synchronized (lock)
- {
- for (Session ssn : channels.values())
- {
- ssn.closeCode(close);
- }
- ConnectionCloseCode code = close.getReplyCode();
- if (code != ConnectionCloseCode.NORMAL)
- {
- exception(new ConnectionException(close));
- }
- }
- }
-
- public void closed()
- {
- if (state == OPEN)
- {
- exception(new ConnectionException("connection aborted"));
- }
-
- log.debug("connection closed: %s", this);
-
- synchronized (lock)
- {
- List<Session> values = new ArrayList<Session>(channels.values());
- for (Session ssn : values)
- {
- ssn.closed();
- }
-
- sender = null;
- setState(CLOSED);
- }
-
- listener.closed(this);
- }
-
- public void close()
- {
- synchronized (lock)
- {
- switch (state)
- {
- case OPEN:
- state = CLOSING;
- connectionClose(ConnectionCloseCode.NORMAL, null);
- Waiter w = new Waiter(lock, timeout);
- while (w.hasTime() && state == CLOSING && error == null)
- {
- w.await();
- }
-
- if (error != null)
- {
- close();
- throw new ConnectionException(error);
- }
-
- switch (state)
- {
- case CLOSING:
- close();
- throw new ConnectionException("close() timed out");
- case CLOSED:
- break;
- default:
- throw new IllegalStateException(String.valueOf(state));
- }
- break;
- case CLOSED:
- break;
- default:
- if (sender != null)
- {
- sender.close();
- w = new Waiter(lock, timeout);
- while (w.hasTime() && sender != null && error == null)
- {
- w.await();
- }
-
- if (error != null)
- {
- throw new ConnectionException(error);
- }
-
- if (sender != null)
- {
- throw new ConnectionException("close() timed out");
- }
- }
- break;
- }
- }
- }
-
- public String toString()
- {
- return String.format("conn:%x", System.identityHashCode(this));
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java
deleted file mode 100644
index a1e3dee024..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-import org.apache.qpid.transport.util.Logger;
-
-import static org.apache.qpid.transport.Connection.State.*;
-
-
-/**
- * ConnectionDelegate
- *
- * @author Rafael H. Schloming
- */
-
-/**
- * Currently only implemented client specific methods
- * the server specific methods are dummy impls for testing
- *
- * the connectionClose is kind of different for both sides
- */
-public abstract class ConnectionDelegate
- extends MethodDelegate<Connection>
- implements ProtocolDelegate<Connection>
-{
-
- private static final Logger log = Logger.get(ConnectionDelegate.class);
-
- public void control(Connection conn, Method method)
- {
- method.dispatch(conn, this);
- }
-
- public void command(Connection conn, Method method)
- {
- method.dispatch(conn, this);
- }
-
- public void error(Connection conn, ProtocolError error)
- {
- conn.exception(new ConnectionException(error.getMessage()));
- }
-
- public void handle(Connection conn, Method method)
- {
- conn.dispatch(method);
- }
-
- @Override public void connectionClose(Connection conn, ConnectionClose close)
- {
- conn.connectionCloseOk();
- conn.getSender().close();
- conn.closeCode(close);
- conn.setState(CLOSE_RCVD);
- }
-
- @Override public void connectionCloseOk(Connection conn, ConnectionCloseOk ok)
- {
- conn.getSender().close();
- }
-
- @Override public void sessionDetach(Connection conn, SessionDetach dtc)
- {
- Session ssn = conn.getSession(dtc.getChannel());
- conn.unmap(ssn);
- ssn.sessionDetached(dtc.getName(), SessionDetachCode.NORMAL);
- ssn.closed();
- }
-
- @Override public void sessionDetached(Connection conn, SessionDetached dtc)
- {
- Session ssn = conn.getSession(dtc.getChannel());
- if (ssn != null)
- {
- conn.unmap(ssn);
- ssn.closed();
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionException.java
deleted file mode 100644
index 6d3972eb43..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionException.java
+++ /dev/null
@@ -1,70 +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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * ConnectionException
- *
- */
-
-public class ConnectionException extends TransportException
-{
-
- private ConnectionClose close;
-
- public ConnectionException(String message, ConnectionClose close, Throwable cause)
- {
- super(message, cause);
- this.close = close;
- }
-
- public ConnectionException(String message)
- {
- this(message, null, null);
- }
-
- public ConnectionException(String message, Throwable cause)
- {
- this(message, null, cause);
- }
-
- public ConnectionException(Throwable cause)
- {
- this(cause.getMessage(), null, cause);
- }
-
- public ConnectionException(ConnectionClose close)
- {
- this(close.getReplyText(), close, null);
- }
-
- public ConnectionClose getClose()
- {
- return close;
- }
-
- @Override public void rethrow()
- {
- throw new ConnectionException(getMessage(), close, this);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionListener.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionListener.java
deleted file mode 100644
index 616e76825a..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionListener.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * ConnectionListener
- *
- */
-
-public interface ConnectionListener
-{
-
- void opened(Connection connection);
-
- void exception(Connection connection, ConnectionException exception);
-
- void closed(Connection connection);
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Echo.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Echo.java
deleted file mode 100644
index c1031c9a1c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Echo.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.network.ConnectionBinding;
-import org.apache.qpid.transport.network.io.IoAcceptor;
-
-
-/**
- * Echo
- *
- */
-
-public class Echo implements SessionListener
-{
-
- public void opened(Session ssn) {}
-
- public void message(Session ssn, MessageTransfer xfr)
- {
- int id = xfr.getId();
- ssn.invoke(xfr);
- ssn.processed(id);
- }
-
- public void exception(Session ssn, SessionException exc)
- {
- exc.printStackTrace();
- }
-
- public void closed(Session ssn) {}
-
- public static final void main(String[] args) throws IOException
- {
- ConnectionDelegate delegate = new ServerDelegate()
- {
- @Override public Session getSession(Connection conn, SessionAttach atc)
- {
- Session ssn = super.getSession(conn, atc);
- ssn.setSessionListener(new Echo());
- return ssn;
- }
- };
-
- IoAcceptor ioa = new IoAcceptor
- ("0.0.0.0", 5672, ConnectionBinding.get(delegate));
- ioa.start();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Field.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Field.java
deleted file mode 100644
index bc6bf10041..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Field.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-
-/**
- * Field
- *
- */
-
-public abstract class Field<C,T>
-{
-
- private final Class<C> container;
- private final Class<T> type;
- private final String name;
- private final int index;
-
- Field(Class<C> container, Class<T> type, String name, int index)
- {
- this.container = container;
- this.type = type;
- this.name = name;
- this.index = index;
- }
-
- public final Class<C> getContainer()
- {
- return container;
- }
-
- public final Class<T> getType()
- {
- return type;
- }
-
- public final String getName()
- {
- return name;
- }
-
- public final int getIndex()
- {
- return index;
- }
-
- protected final C check(Object struct)
- {
- return container.cast(struct);
- }
-
- public abstract boolean has(Object struct);
-
- public abstract void has(Object struct, boolean value);
-
- public abstract T get(Object struct);
-
- public abstract void read(Decoder dec, Object struct);
-
- public abstract void write(Encoder enc, Object struct);
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Future.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Future.java
deleted file mode 100644
index d8cde61af5..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Future.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * Future
- *
- * @author Rafael H. Schloming
- */
-
-public interface Future<T>
-{
-
- T get();
-
- boolean isDone();
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Header.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Header.java
deleted file mode 100644
index 9439e5e0de..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Header.java
+++ /dev/null
@@ -1,92 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import org.apache.qpid.transport.network.Frame;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.LinkedHashMap;
-import java.nio.ByteBuffer;
-
-
-/**
- * Header
- *
- * @author Rafael H. Schloming
- */
-
-public class Header {
-
- private final Struct[] structs;
-
- public Header(List<Struct> structs)
- {
- this(structs.toArray(new Struct[structs.size()]));
- }
-
- public Header(Struct ... structs)
- {
- this.structs = structs;
- }
-
- public Struct[] getStructs()
- {
- return structs;
- }
-
-
- public <T> T get(Class<T> klass)
- {
- for (Struct st : structs)
- {
- if (klass.isInstance(st))
- {
- return (T) st;
- }
- }
-
- return null;
- }
-
- public String toString()
- {
- StringBuffer str = new StringBuffer();
- str.append(" Header(");
- boolean first = true;
- for (Struct s : structs)
- {
- if (first)
- {
- first = false;
- }
- else
- {
- str.append(", ");
- }
- str.append(s);
- }
- str.append(")");
- return str.toString();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Method.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Method.java
deleted file mode 100644
index 6b99f6d5d3..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Method.java
+++ /dev/null
@@ -1,180 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import org.apache.qpid.transport.network.Frame;
-
-import java.nio.ByteBuffer;
-
-import static org.apache.qpid.transport.util.Functions.*;
-
-/**
- * Method
- *
- * @author Rafael H. Schloming
- */
-
-public abstract class Method extends Struct implements ProtocolEvent
-{
-
- public static final Method create(int type)
- {
- // XXX: should generate separate factories for separate
- // namespaces
- return (Method) StructFactory.createInstruction(type);
- }
-
- // XXX: command subclass?
- private int id;
- private int channel;
- private boolean idSet = false;
- private boolean sync = false;
- private boolean batch = false;
-
- public final int getId()
- {
- return id;
- }
-
- void setId(int id)
- {
- this.id = id;
- this.idSet = true;
- }
-
- public final int getChannel()
- {
- return channel;
- }
-
- public final void setChannel(int channel)
- {
- this.channel = channel;
- }
-
- public final boolean isSync()
- {
- return sync;
- }
-
- final void setSync(boolean value)
- {
- this.sync = value;
- }
-
- public final boolean isBatch()
- {
- return batch;
- }
-
- final void setBatch(boolean value)
- {
- this.batch = value;
- }
-
- public abstract boolean hasPayload();
-
- public Header getHeader()
- {
- return null;
- }
-
- public void setHeader(Header header)
- {
- throw new UnsupportedOperationException();
- }
-
- public ByteBuffer getBody()
- {
- return null;
- }
-
- public void setBody(ByteBuffer body)
- {
- throw new UnsupportedOperationException();
- }
-
- public abstract byte getEncodedTrack();
-
- public abstract <C> void dispatch(C context, MethodDelegate<C> delegate);
-
- public <C> void delegate(C context, ProtocolDelegate<C> delegate)
- {
- if (getEncodedTrack() == Frame.L4)
- {
- delegate.command(context, this);
- }
- else
- {
- delegate.control(context, this);
- }
- }
-
- public String toString()
- {
- StringBuilder str = new StringBuilder();
-
- str.append("ch=");
- str.append(channel);
-
- if (getEncodedTrack() == Frame.L4 && idSet)
- {
- str.append(" id=");
- str.append(id);
- }
-
- if (sync || batch)
- {
- str.append(" ");
- str.append("[");
- if (sync)
- {
- str.append("S");
- }
- if (batch)
- {
- str.append("B");
- }
- str.append("]");
- }
-
- str.append(" ");
- str.append(super.toString());
- Header hdr = getHeader();
- if (hdr != null)
- {
- for (Struct st : hdr.getStructs())
- {
- str.append("\n ");
- str.append(st);
- }
- }
- ByteBuffer body = getBody();
- if (body != null)
- {
- str.append("\n body=");
- str.append(str(body, 64));
- }
-
- return str.toString();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolDelegate.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolDelegate.java
deleted file mode 100644
index a90948fc1d..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolDelegate.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * ProtocolDelegate
- *
- */
-
-public interface ProtocolDelegate<C>
-{
-
- void init(C context, ProtocolHeader header);
-
- void control(C context, Method control);
-
- void command(C context, Method command);
-
- void error(C context, ProtocolError error);
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolError.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolError.java
deleted file mode 100644
index bd6ab81997..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolError.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-import org.apache.qpid.transport.network.NetworkDelegate;
-import org.apache.qpid.transport.network.NetworkEvent;
-
-
-/**
- * ProtocolError
- *
- * @author Rafael H. Schloming
- */
-
-public final class ProtocolError implements NetworkEvent, ProtocolEvent
-{
-
- private int channel;
- private final byte track;
- private final String format;
- private final Object[] args;
-
- public ProtocolError(byte track, String format, Object ... args)
- {
- this.track = track;
- this.format = format;
- this.args = args;
- }
-
- public int getChannel()
- {
- return channel;
- }
-
- public void setChannel(int channel)
- {
- this.channel = channel;
- }
-
- public byte getEncodedTrack()
- {
- return track;
- }
-
- public String getMessage()
- {
- return String.format(format, args);
- }
-
- public <C> void delegate(C context, ProtocolDelegate<C> delegate)
- {
- delegate.error(context, this);
- }
-
- public void delegate(NetworkDelegate delegate)
- {
- delegate.error(this);
- }
-
- public String toString()
- {
- return String.format("protocol error: %s", getMessage());
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolEvent.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolEvent.java
deleted file mode 100644
index 60234c1537..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolEvent.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * ProtocolEvent
- *
- */
-
-public interface ProtocolEvent
-{
-
- int getChannel();
-
- void setChannel(int channel);
-
- byte getEncodedTrack();
-
- <C> void delegate(C context, ProtocolDelegate<C> delegate);
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java
deleted file mode 100644
index fa0c1e9c63..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolHeader.java
+++ /dev/null
@@ -1,116 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.network.NetworkDelegate;
-import org.apache.qpid.transport.network.NetworkEvent;
-import org.apache.qpid.transport.network.Frame;
-
-
-/**
- * ProtocolHeader
- *
- * @author Rafael H. Schloming
- */
-
-public final class ProtocolHeader implements NetworkEvent, ProtocolEvent
-{
-
- private static final byte[] AMQP = {'A', 'M', 'Q', 'P' };
- private static final byte CLASS = 1;
-
- final private byte instance;
- final private byte major;
- final private byte minor;
- private int channel;
-
- public ProtocolHeader(byte instance, byte major, byte minor)
- {
- this.instance = instance;
- this.major = major;
- this.minor = minor;
- }
-
- public ProtocolHeader(int instance, int major, int minor)
- {
- this((byte) instance, (byte) major, (byte) minor);
- }
-
- public byte getInstance()
- {
- return instance;
- }
-
- public byte getMajor()
- {
- return major;
- }
-
- public byte getMinor()
- {
- return minor;
- }
-
- public int getChannel()
- {
- return channel;
- }
-
- public void setChannel(int channel)
- {
- this.channel = channel;
- }
-
- public byte getEncodedTrack()
- {
- return Frame.L1;
- }
-
- public ByteBuffer toByteBuffer()
- {
- ByteBuffer buf = ByteBuffer.allocate(8);
- buf.put(AMQP);
- buf.put(CLASS);
- buf.put(instance);
- buf.put(major);
- buf.put(minor);
- buf.flip();
- return buf;
- }
-
- public <C> void delegate(C context, ProtocolDelegate<C> delegate)
- {
- delegate.init(context, this);
- }
-
- public void delegate(NetworkDelegate delegate)
- {
- delegate.init(this);
- }
-
- public String toString()
- {
- return String.format("AMQP.%d %d-%d", instance, major, minor);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolVersionException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolVersionException.java
deleted file mode 100644
index db8064268c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ProtocolVersionException.java
+++ /dev/null
@@ -1,62 +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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * ProtocolVersionException
- *
- */
-
-public final class ProtocolVersionException extends ConnectionException
-{
-
- private final byte major;
- private final byte minor;
-
- public ProtocolVersionException(byte major, byte minor, Throwable cause)
- {
- super(String.format("version mismatch: %s-%s", major, minor), cause);
- this.major = major;
- this.minor = minor;
- }
-
- public ProtocolVersionException(byte major, byte minor)
- {
- this(major, minor, null);
- }
-
- public byte getMajor()
- {
- return this.major;
- }
-
- public byte getMinor()
- {
- return this.minor;
- }
-
- @Override public void rethrow()
- {
- throw new ProtocolVersionException(major, minor, this);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Range.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Range.java
deleted file mode 100644
index f4335dc8a6..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Range.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import static org.apache.qpid.util.Serial.*;
-
-
-/**
- * Range
- *
- * @author Rafael H. Schloming
- */
-
-public final class Range
-{
- private final int lower;
- private final int upper;
-
- public Range(int lower, int upper)
- {
- this.lower = lower;
- this.upper = upper;
- }
-
- public int getLower()
- {
- return lower;
- }
-
- public int getUpper()
- {
- return upper;
- }
-
- public boolean includes(int value)
- {
- return le(lower, value) && le(value, upper);
- }
-
- public boolean includes(Range range)
- {
- return includes(range.lower) && includes(range.upper);
- }
-
- public boolean intersects(Range range)
- {
- return (includes(range.lower) || includes(range.upper) ||
- range.includes(lower) || range.includes(upper));
- }
-
- public boolean touches(Range range)
- {
- return (intersects(range) ||
- includes(range.upper + 1) || includes(range.lower - 1) ||
- range.includes(upper + 1) || range.includes(lower - 1));
- }
-
- public Range span(Range range)
- {
- return new Range(min(lower, range.lower), max(upper, range.upper));
- }
-
- public List<Range> subtract(Range range)
- {
- List<Range> result = new ArrayList<Range>();
-
- if (includes(range.lower) && le(lower, range.lower - 1))
- {
- result.add(new Range(lower, range.lower - 1));
- }
-
- if (includes(range.upper) && le(range.upper + 1, upper))
- {
- result.add(new Range(range.upper + 1, upper));
- }
-
- if (result.isEmpty() && !range.includes(this))
- {
- result.add(this);
- }
-
- return result;
- }
-
- public Range intersect(Range range)
- {
- int l = max(lower, range.lower);
- int r = min(upper, range.upper);
- if (gt(l, r))
- {
- return null;
- }
- else
- {
- return new Range(l, r);
- }
- }
-
- public String toString()
- {
- return "[" + lower + ", " + upper + "]";
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSet.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSet.java
deleted file mode 100644
index 9b2744ee8b..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/RangeSet.java
+++ /dev/null
@@ -1,147 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.LinkedList;
-
-import static org.apache.qpid.util.Serial.*;
-
-/**
- * RangeSet
- *
- * @author Rafael H. Schloming
- */
-
-public final class RangeSet implements Iterable<Range>
-{
-
- private LinkedList<Range> ranges = new LinkedList<Range>();
-
- public int size()
- {
- return ranges.size();
- }
-
- public Iterator<Range> iterator()
- {
- return ranges.iterator();
- }
-
- public Range getFirst()
- {
- return ranges.getFirst();
- }
-
- public boolean includes(Range range)
- {
- for (Range r : this)
- {
- if (r.includes(range))
- {
- return true;
- }
- }
-
- return false;
- }
-
- public boolean includes(int n)
- {
- for (Range r : this)
- {
- if (r.includes(n))
- {
- return true;
- }
- }
-
- return false;
- }
-
- public void add(Range range)
- {
- ListIterator<Range> it = ranges.listIterator();
-
- while (it.hasNext())
- {
- Range next = it.next();
- if (range.touches(next))
- {
- it.remove();
- range = range.span(next);
- }
- else if (lt(range.getUpper(), next.getLower()))
- {
- it.previous();
- it.add(range);
- return;
- }
- }
-
- it.add(range);
- }
-
- public void add(int lower, int upper)
- {
- add(new Range(lower, upper));
- }
-
- public void add(int value)
- {
- add(value, value);
- }
-
- public void clear()
- {
- ranges.clear();
- }
-
- public RangeSet copy()
- {
- RangeSet copy = new RangeSet();
- copy.ranges.addAll(ranges);
- return copy;
- }
-
- public String toString()
- {
- StringBuffer str = new StringBuffer();
- str.append("{");
- boolean first = true;
- for (Range range : ranges)
- {
- if (first)
- {
- first = false;
- }
- else
- {
- str.append(", ");
- }
- str.append(range);
- }
- str.append("}");
- return str.toString();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Receiver.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Receiver.java
deleted file mode 100644
index 2a994580dc..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Receiver.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * Receiver
- *
- */
-
-public interface Receiver<T>
-{
-
- void received(T msg);
-
- void exception(Throwable t);
-
- void closed();
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Result.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Result.java
deleted file mode 100644
index 1116492a8d..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Result.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * Result
- *
- * @author Rafael H. Schloming
- */
-
-public abstract class Result extends Struct {}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Sender.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Sender.java
deleted file mode 100644
index 9a6f675d7f..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Sender.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * Sender
- *
- */
-
-public interface Sender<T>
-{
-
- void send(T msg);
-
- void flush();
-
- void close();
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SenderException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SenderException.java
deleted file mode 100644
index a96079dc27..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SenderException.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * SenderException
- *
- */
-
-public class SenderException extends TransportException
-{
-
- public SenderException(String message, Throwable cause)
- {
- super(message, cause);
- }
-
- public SenderException(String message)
- {
- super(message);
- }
-
- public SenderException(Throwable cause)
- {
- super(cause);
- }
-
- public void rethrow()
- {
- throw new SenderException(getMessage(), this);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java
deleted file mode 100644
index 529871fbf6..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/ServerDelegate.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.util.Collections;
-
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-
-import java.io.UnsupportedEncodingException;
-
-import org.apache.qpid.QpidException;
-
-import org.apache.qpid.SecurityHelper;
-
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslException;
-import javax.security.sasl.SaslServer;
-
-
-import static org.apache.qpid.transport.Connection.State.*;
-
-
-/**
- * ServerDelegate
- *
- */
-
-public class ServerDelegate extends ConnectionDelegate
-{
-
- private SaslServer saslServer;
-
- public void init(Connection conn, ProtocolHeader hdr)
- {
- conn.send(new ProtocolHeader(1, 0, 10));
- List<Object> utf8 = new ArrayList<Object>();
- utf8.add("utf8");
- conn.connectionStart(null, Collections.EMPTY_LIST, utf8);
- }
-
- @Override public void connectionStartOk(Connection conn, ConnectionStartOk ok)
- {
- conn.setLocale(ok.getLocale());
- String mechanism = ok.getMechanism();
-
- if (mechanism == null || mechanism.length() == 0)
- {
- conn.connectionTune
- (Integer.MAX_VALUE,
- org.apache.qpid.transport.network.ConnectionBinding.MAX_FRAME_SIZE,
- 0, Integer.MAX_VALUE);
- return;
- }
-
- try
- {
- SaslServer ss = Sasl.createSaslServer
- (mechanism, "AMQP", "localhost", null, null);
- if (ss == null)
- {
- conn.connectionClose
- (ConnectionCloseCode.CONNECTION_FORCED,
- "null SASL mechanism: " + mechanism);
- return;
- }
- conn.setSaslServer(ss);
- secure(conn, ok.getResponse());
- }
- catch (SaslException e)
- {
- conn.exception(e);
- }
- }
-
- private void secure(Connection conn, byte[] response)
- {
- SaslServer ss = conn.getSaslServer();
- try
- {
- byte[] challenge = ss.evaluateResponse(response);
- if (ss.isComplete())
- {
- ss.dispose();
- conn.connectionTune
- (Integer.MAX_VALUE,
- org.apache.qpid.transport.network.ConnectionBinding.MAX_FRAME_SIZE,
- 0, Integer.MAX_VALUE);
- }
- else
- {
- conn.connectionSecure(challenge);
- }
- }
- catch (SaslException e)
- {
- conn.exception(e);
- }
- }
-
- @Override public void connectionSecureOk(Connection conn, ConnectionSecureOk ok)
- {
- secure(conn, ok.getResponse());
- }
-
- @Override public void connectionTuneOk(Connection conn, ConnectionTuneOk ok)
- {
-
- }
-
- @Override public void connectionOpen(Connection conn, ConnectionOpen open)
- {
- conn.connectionOpenOk(Collections.EMPTY_LIST);
- conn.setState(OPEN);
- }
-
- public Session getSession(Connection conn, SessionAttach atc)
- {
- return new Session(conn, new Binary(atc.getName()), 0);
- }
-
- @Override public void sessionAttach(Connection conn, SessionAttach atc)
- {
- Session ssn = getSession(conn, atc);
- conn.map(ssn, atc.getChannel());
- ssn.sessionAttached(atc.getName());
- ssn.setState(Session.State.OPEN);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java
deleted file mode 100644
index 1a44ed8973..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java
+++ /dev/null
@@ -1,799 +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.
- *
- */
-package org.apache.qpid.transport;
-
-
-import org.apache.qpid.transport.network.Frame;
-
-import org.apache.qpid.transport.util.Logger;
-import org.apache.qpid.transport.util.Waiter;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import static org.apache.qpid.transport.Option.*;
-import static org.apache.qpid.transport.Session.State.*;
-import static org.apache.qpid.transport.util.Functions.*;
-import static org.apache.qpid.util.Serial.*;
-import static org.apache.qpid.util.Strings.*;
-
-/**
- * Session
- *
- * @author Rafael H. Schloming
- */
-
-public class Session extends SessionInvoker
-{
-
- private static final Logger log = Logger.get(Session.class);
-
- enum State { NEW, DETACHED, OPEN, CLOSING, CLOSED }
-
- class DefaultSessionListener implements SessionListener
- {
-
- public void opened(Session ssn) {}
-
- public void message(Session ssn, MessageTransfer xfr)
- {
- log.info("message: %s", xfr);
- }
-
- public void exception(Session ssn, SessionException exc)
- {
- log.error(exc, "session exception");
- }
-
- public void closed(Session ssn) {}
- }
-
- public static final int UNLIMITED_CREDIT = 0xFFFFFFFF;
-
- private Connection connection;
- private Binary name;
- private long expiry;
- private int channel;
- private SessionDelegate delegate = new SessionDelegate();
- private SessionListener listener = new DefaultSessionListener();
- private long timeout = 60000;
- private boolean autoSync = false;
-
- private boolean incomingInit;
- // incoming command count
- private int commandsIn;
- // completed incoming commands
- private final Object processedLock = new Object();
- private RangeSet processed;
- private int maxProcessed;
- private int syncPoint;
-
- // outgoing command count
- private int commandsOut = 0;
- private Method[] commands = new Method[64*1024];
- private int maxComplete = commandsOut - 1;
- private boolean needSync = false;
-
- private State state = NEW;
-
- Session(Connection connection, Binary name, long expiry)
- {
- this.connection = connection;
- this.name = name;
- this.expiry = expiry;
- initReceiver();
- }
-
- public Connection getConnection()
- {
- return connection;
- }
-
- public Binary getName()
- {
- return name;
- }
-
- void setExpiry(long expiry)
- {
- this.expiry = expiry;
- }
-
- int getChannel()
- {
- return channel;
- }
-
- void setChannel(int channel)
- {
- this.channel = channel;
- }
-
- public void setSessionListener(SessionListener listener)
- {
- if (listener == null)
- {
- this.listener = new DefaultSessionListener();
- }
- else
- {
- this.listener = listener;
- }
- }
-
- public SessionListener getSessionListener()
- {
- return listener;
- }
-
- public void setAutoSync(boolean value)
- {
- synchronized (commands)
- {
- this.autoSync = value;
- }
- }
-
- void setState(State state)
- {
- synchronized (commands)
- {
- this.state = state;
- commands.notifyAll();
- }
- }
-
- private void initReceiver()
- {
- synchronized (processedLock)
- {
- incomingInit = false;
- processed = new RangeSet();
- }
- }
-
- void attach()
- {
- initReceiver();
- sessionAttach(name.getBytes());
- // XXX: when the broker and client support full session
- // recovery we should use expiry as the requested timeout
- sessionRequestTimeout(0);
- }
-
- void resume()
- {
- synchronized (commands)
- {
- for (int i = maxComplete + 1; lt(i, commandsOut); i++)
- {
- Method m = commands[mod(i, commands.length)];
- if (m != null)
- {
- sessionCommandPoint(m.getId(), 0);
- send(m);
- }
- }
-
- sessionCommandPoint(commandsOut, 0);
- sessionFlush(COMPLETED);
- }
- }
-
- void dump()
- {
- synchronized (commands)
- {
- for (Method m : commands)
- {
- if (m != null)
- {
- System.out.println(m);
- }
- }
- }
- }
-
- final void commandPoint(int id)
- {
- synchronized (processedLock)
- {
- this.commandsIn = id;
- if (!incomingInit)
- {
- incomingInit = true;
- maxProcessed = commandsIn - 1;
- syncPoint = maxProcessed;
- }
- }
- }
-
- public int getCommandsOut()
- {
- return commandsOut;
- }
-
- public int getCommandsIn()
- {
- return commandsIn;
- }
-
- public int nextCommandId()
- {
- return commandsIn++;
- }
-
- final void identify(Method cmd)
- {
- if (!incomingInit)
- {
- throw new IllegalStateException();
- }
-
- int id = nextCommandId();
- cmd.setId(id);
-
- if(log.isDebugEnabled())
- {
- log.debug("ID: [%s] %s", this.channel, id);
- }
-
- //if ((id % 65536) == 0)
- if ((id & 0xff) == 0)
- {
- flushProcessed(TIMELY_REPLY);
- }
- }
-
- public void processed(Method command)
- {
- processed(command.getId());
- }
-
- public void processed(int command)
- {
- processed(new Range(command, command));
- }
-
- public void processed(int lower, int upper)
- {
-
- processed(new Range(lower, upper));
- }
-
- public void processed(Range range)
- {
- log.debug("%s processed(%s) %s %s", this, range, syncPoint, maxProcessed);
-
- boolean flush;
- synchronized (processedLock)
- {
- log.debug("%s", processed);
- processed.add(range);
- Range first = processed.getFirst();
- int lower = first.getLower();
- int upper = first.getUpper();
- int old = maxProcessed;
- if (le(lower, maxProcessed + 1))
- {
- maxProcessed = max(maxProcessed, upper);
- }
- boolean synced = ge(maxProcessed, syncPoint);
- flush = lt(old, syncPoint) && synced;
- if (synced)
- {
- syncPoint = maxProcessed;
- }
- }
- if (flush)
- {
- flushProcessed();
- }
- }
-
- void flushExpected()
- {
- RangeSet rs = new RangeSet();
- synchronized (processedLock)
- {
- if (incomingInit)
- {
- rs.add(commandsIn);
- }
- }
- sessionExpected(rs, null);
- }
-
- public void flushProcessed(Option ... options)
- {
- RangeSet copy;
- synchronized (processedLock)
- {
- copy = processed.copy();
- }
- sessionCompleted(copy, options);
- }
-
- void knownComplete(RangeSet kc)
- {
- synchronized (processedLock)
- {
- RangeSet newProcessed = new RangeSet();
- for (Range pr : processed)
- {
- for (Range kr : kc)
- {
- for (Range r : pr.subtract(kr))
- {
- newProcessed.add(r);
- }
- }
- }
- this.processed = newProcessed;
- }
- }
-
- void syncPoint()
- {
- int id = getCommandsIn() - 1;
- log.debug("%s synced to %d", this, id);
- boolean flush;
- synchronized (processedLock)
- {
- syncPoint = id;
- flush = ge(maxProcessed, syncPoint);
- }
- if (flush)
- {
- flushProcessed();
- }
- }
-
- boolean complete(int lower, int upper)
- {
- //avoid autoboxing
- if(log.isDebugEnabled())
- {
- log.debug("%s complete(%d, %d)", this, lower, upper);
- }
- synchronized (commands)
- {
- int old = maxComplete;
- for (int id = max(maxComplete, lower); le(id, upper); id++)
- {
- commands[mod(id, commands.length)] = null;
- }
- if (le(lower, maxComplete + 1))
- {
- maxComplete = max(maxComplete, upper);
- }
- log.debug("%s commands remaining: %s", this, commandsOut - maxComplete);
- commands.notifyAll();
- return gt(maxComplete, old);
- }
- }
-
- void received(Method m)
- {
- m.delegate(this, delegate);
- }
-
- private void send(Method m)
- {
- m.setChannel(channel);
- connection.send(m);
-
- if (!m.isBatch())
- {
- connection.flush();
- }
- }
-
- final private boolean isFull(int id)
- {
- return id - maxComplete >= commands.length;
- }
-
- public void invoke(Method m)
- {
- if (m.getEncodedTrack() == Frame.L4)
- {
- synchronized (commands)
- {
- if (state != OPEN && state != CLOSED)
- {
- Waiter w = new Waiter(commands, timeout);
- while (w.hasTime() && (state != OPEN && state != CLOSED))
- {
- w.await();
- }
- }
-
- switch (state)
- {
- case OPEN:
- break;
- case CLOSED:
- throw new SessionClosedException();
- default:
- throw new SessionException
- (String.format
- ("timed out waiting for session to become open " +
- "(state=%s)", state));
- }
-
- int next = commandsOut++;
- m.setId(next);
-
- if (isFull(next))
- {
- Waiter w = new Waiter(commands, timeout);
- while (w.hasTime() && isFull(next))
- {
- if (state == OPEN)
- {
- try
- {
- sessionFlush(COMPLETED);
- }
- catch (SenderException e)
- {
- if (expiry > 0)
- {
- // if expiry is > 0 then this will
- // happen again on resume
- log.error(e, "error sending flush (full replay buffer)");
- }
- else
- {
- e.rethrow();
- }
- }
- }
- w.await();
- }
- }
-
- if (isFull(next))
- {
- throw new SessionException("timed out waiting for completion");
- }
-
- if (next == 0)
- {
- sessionCommandPoint(0, 0);
- }
- if (expiry > 0)
- {
- commands[mod(next, commands.length)] = m;
- }
- if (autoSync)
- {
- m.setSync(true);
- }
- needSync = !m.isSync();
- try
- {
- send(m);
- }
- catch (SenderException e)
- {
- if (expiry > 0)
- {
- // if expiry is > 0 then this will happen
- // again on resume
- log.error(e, "error sending command");
- }
- else
- {
- e.rethrow();
- }
- }
- if (autoSync)
- {
- sync();
- }
-
- // flush every 64K commands to avoid ambiguity on
- // wraparound
- if ((next % 65536) == 0)
- {
- try
- {
- sessionFlush(COMPLETED);
- }
- catch (SenderException e)
- {
- if (expiry > 0)
- {
- // if expiry is > 0 then this will happen
- // again on resume
- log.error(e, "error sending flush (periodic)");
- }
- else
- {
- e.rethrow();
- }
- }
- }
- }
- }
- else
- {
- send(m);
- }
- }
-
- public void sync()
- {
- sync(timeout);
- }
-
- public void sync(long timeout)
- {
- log.debug("%s sync()", this);
- synchronized (commands)
- {
- int point = commandsOut - 1;
-
- if (needSync && lt(maxComplete, point))
- {
- executionSync(SYNC);
- }
-
- Waiter w = new Waiter(commands, timeout);
- while (w.hasTime() && state != CLOSED && lt(maxComplete, point))
- {
- log.debug("%s waiting for[%d]: %d, %s", this, point,
- maxComplete, commands);
- w.await();
- }
-
- if (lt(maxComplete, point))
- {
- if (state == CLOSED)
- {
- throw new SessionException(getException());
- }
- else
- {
- throw new SessionException
- (String.format
- ("timed out waiting for sync: complete = %s, point = %s", maxComplete, point));
- }
- }
- }
- }
-
- private Map<Integer,ResultFuture<?>> results =
- new HashMap<Integer,ResultFuture<?>>();
- private ExecutionException exception = null;
-
- void result(int command, Struct result)
- {
- ResultFuture<?> future;
- synchronized (results)
- {
- future = results.remove(command);
- }
- future.set(result);
- }
-
- void setException(ExecutionException exc)
- {
- synchronized (results)
- {
- if (exception != null)
- {
- throw new IllegalStateException
- (String.format
- ("too many exceptions: %s, %s", exception, exc));
- }
- exception = exc;
- }
- }
-
- private ConnectionClose close = null;
-
- void closeCode(ConnectionClose close)
- {
- this.close = close;
- }
-
- ExecutionException getException()
- {
- synchronized (results)
- {
- return exception;
- }
- }
-
- protected <T> Future<T> invoke(Method m, Class<T> klass)
- {
- synchronized (commands)
- {
- int command = commandsOut;
- ResultFuture<T> future = new ResultFuture<T>(klass);
- synchronized (results)
- {
- results.put(command, future);
- }
- invoke(m);
- return future;
- }
- }
-
- private class ResultFuture<T> implements Future<T>
- {
-
- private final Class<T> klass;
- private T result;
-
- private ResultFuture(Class<T> klass)
- {
- this.klass = klass;
- }
-
- private void set(Struct result)
- {
- synchronized (this)
- {
- this.result = klass.cast(result);
- notifyAll();
- }
- }
-
- public T get(long timeout)
- {
- synchronized (this)
- {
- Waiter w = new Waiter(this, timeout);
- while (w.hasTime() && state != CLOSED && !isDone())
- {
- log.debug("%s waiting for result: %s", Session.this, this);
- w.await();
- }
- }
-
- if (isDone())
- {
- return result;
- }
- else if (state == CLOSED)
- {
- throw new SessionException(getException());
- }
- else
- {
- throw new SessionException
- (String.format("%s timed out waiting for result: %s",
- Session.this, this));
- }
- }
-
- public T get()
- {
- return get(timeout);
- }
-
- public boolean isDone()
- {
- return result != null;
- }
-
- public String toString()
- {
- return String.format("Future(%s)", isDone() ? result : klass);
- }
-
- }
-
- public final void messageTransfer(String destination,
- MessageAcceptMode acceptMode,
- MessageAcquireMode acquireMode,
- Header header,
- byte[] body,
- Option ... _options) {
- messageTransfer(destination, acceptMode, acquireMode, header,
- ByteBuffer.wrap(body), _options);
- }
-
- public final void messageTransfer(String destination,
- MessageAcceptMode acceptMode,
- MessageAcquireMode acquireMode,
- Header header,
- String body,
- Option ... _options) {
- messageTransfer(destination, acceptMode, acquireMode, header,
- toUTF8(body), _options);
- }
-
- public void close()
- {
- synchronized (commands)
- {
- state = CLOSING;
- // XXX: we manually set the expiry to zero here to
- // simulate full session recovery in brokers that don't
- // support it, we should remove this line when there is
- // broker support for full session resume:
- expiry = 0;
- sessionRequestTimeout(0);
- sessionDetach(name.getBytes());
- Waiter w = new Waiter(commands, timeout);
- while (w.hasTime() && state != CLOSED)
- {
- w.await();
- }
-
- if (state != CLOSED)
- {
- throw new SessionException("close() timed out");
- }
-
- connection.removeSession(this);
- }
- }
-
- public void exception(Throwable t)
- {
- log.error(t, "caught exception");
- }
-
- public void closed()
- {
- synchronized (commands)
- {
- if (expiry == 0)
- {
- state = CLOSED;
- }
- else
- {
- state = DETACHED;
- }
-
- commands.notifyAll();
-
- synchronized (results)
- {
- for (ResultFuture<?> result : results.values())
- {
- synchronized(result)
- {
- result.notifyAll();
- }
- }
- }
- }
- }
-
- public String toString()
- {
- return String.format("ssn:%s", name);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionClosedException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionClosedException.java
deleted file mode 100644
index 64f9039484..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionClosedException.java
+++ /dev/null
@@ -1,49 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.util.Collections;
-
-
-/**
- * SessionClosedException
- *
- */
-
-public class SessionClosedException extends SessionException
-{
-
- public SessionClosedException()
- {
- this(null);
- }
-
- public SessionClosedException(Throwable cause)
- {
- super("session closed", null, cause);
- }
-
- @Override public void rethrow()
- {
- throw new SessionClosedException(this);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDelegate.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDelegate.java
deleted file mode 100644
index b2c22f22e9..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDelegate.java
+++ /dev/null
@@ -1,149 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import org.apache.qpid.transport.util.Logger;
-
-
-/**
- * SessionDelegate
- *
- * @author Rafael H. Schloming
- */
-
-public class SessionDelegate
- extends MethodDelegate<Session>
- implements ProtocolDelegate<Session>
-{
- private static final Logger log = Logger.get(SessionDelegate.class);
-
- public void init(Session ssn, ProtocolHeader hdr) { }
-
- public void control(Session ssn, Method method) {
- method.dispatch(ssn, this);
- }
-
- public void command(Session ssn, Method method) {
- ssn.identify(method);
- method.dispatch(ssn, this);
- if (!method.hasPayload())
- {
- ssn.processed(method);
- }
- }
-
- public void error(Session ssn, ProtocolError error) { }
-
- public void handle(Session ssn, Method method)
- {
- log.warn("UNHANDLED: [%s] %s", ssn, method);
- }
-
- @Override public void sessionAttached(Session ssn, SessionAttached atc)
- {
- ssn.setState(Session.State.OPEN);
- }
-
- @Override public void sessionTimeout(Session ssn, SessionTimeout t)
- {
- // XXX: we ignore this right now, we should uncomment this
- // when full session resume is supported:
- // ssn.setExpiry(t.getTimeout());
- }
-
- @Override public void sessionCompleted(Session ssn, SessionCompleted cmp)
- {
- RangeSet ranges = cmp.getCommands();
- RangeSet known = null;
- if (cmp.getTimelyReply())
- {
- known = new RangeSet();
- }
-
- if (ranges != null)
- {
- for (Range range : ranges)
- {
- boolean advanced = ssn.complete(range.getLower(), range.getUpper());
- if (advanced && known != null)
- {
- known.add(range);
- }
- }
- }
-
- if (known != null)
- {
- ssn.sessionKnownCompleted(known);
- }
- }
-
- @Override public void sessionKnownCompleted(Session ssn, SessionKnownCompleted kcmp)
- {
- RangeSet kc = kcmp.getCommands();
- if (kc != null)
- {
- ssn.knownComplete(kc);
- }
- }
-
- @Override public void sessionFlush(Session ssn, SessionFlush flush)
- {
- if (flush.getCompleted())
- {
- ssn.flushProcessed();
- }
- if (flush.getConfirmed())
- {
- ssn.flushProcessed();
- }
- if (flush.getExpected())
- {
- ssn.flushExpected();
- }
- }
-
- @Override public void sessionCommandPoint(Session ssn, SessionCommandPoint scp)
- {
- ssn.commandPoint(scp.getCommandId());
- }
-
- @Override public void executionSync(Session ssn, ExecutionSync sync)
- {
- ssn.syncPoint();
- }
-
- @Override public void executionResult(Session ssn, ExecutionResult result)
- {
- ssn.result(result.getCommandId(), result.getValue());
- }
-
- @Override public void executionException(Session ssn, ExecutionException exc)
- {
- ssn.setException(exc);
- }
-
- @Override public void messageTransfer(Session ssn, MessageTransfer xfr)
- {
- ssn.getSessionListener().message(ssn, xfr);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionException.java
deleted file mode 100644
index c4fc9558a1..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionException.java
+++ /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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.util.List;
-
-/**
- * SessionException
- *
- */
-
-public class SessionException extends TransportException
-{
-
- private ExecutionException exception;
-
- public SessionException(String message, ExecutionException exception, Throwable cause)
- {
- super(message, cause);
- this.exception = exception;
- }
-
- public SessionException(ExecutionException exception)
- {
- this(String.valueOf(exception), exception, null);
- }
-
- public SessionException(String message)
- {
- this(message, null, null);
- }
-
- public ExecutionException getException()
- {
- return exception;
- }
-
- @Override public void rethrow()
- {
- throw new SessionException(getMessage(), exception, this);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionListener.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionListener.java
deleted file mode 100644
index 63690177f9..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionListener.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * SessionListener
- *
- */
-
-public interface SessionListener
-{
-
- void opened(Session session);
-
- void message(Session ssn, MessageTransfer xfr);
-
- void exception(Session session, SessionException exception);
-
- void closed(Session session);
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Sink.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Sink.java
deleted file mode 100644
index 622993effb..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Sink.java
+++ /dev/null
@@ -1,136 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.network.ConnectionBinding;
-import org.apache.qpid.transport.network.io.IoAcceptor;
-
-/**
- * Sink
- *
- */
-
-public class Sink implements SessionListener
-{
-
- private static final String FORMAT_HDR = "%-12s %-18s %-18s %-18s";
- private static final String FORMAT_ROW = "SSN#%-8X %-18s %-18s %-18s";
-
- private long interval = 100000;
- private long start = System.currentTimeMillis();
- private long count = 0;
- private long bytes = 0;
- private long interval_start = start;
- private long bytes_start = bytes;
- private long time = start;
- private int id = System.identityHashCode(this);
-
- public Sink()
- {
- }
-
- private double msg_rate()
- {
- return 1000 * (double) count / (double) (time - start);
- }
-
- private double byte_rate()
- {
- return (1000 * (double) bytes / (double) (time - start)) / (1024*1024);
- }
-
- private double msg_interval_rate()
- {
- return 1000 * (double) interval / (double) (time - interval_start);
- }
-
- private double byte_interval_rate()
- {
- return (1000 * (double) (bytes - bytes_start) / (double) (time - interval_start)) / (1024*1024);
- }
-
- private String rates()
- {
- return String.format("%.2f/%.2f", msg_rate(), byte_rate());
- }
-
- private String interval_rates()
- {
- return String.format("%.2f/%.2f", msg_interval_rate(), byte_interval_rate());
- }
-
- private String counts()
- {
- return String.format("%d/%.2f", count, ((double) bytes)/(1024*1024));
- }
-
- public void opened(Session ssn) {}
-
- public void message(Session ssn, MessageTransfer xfr)
- {
- count++;
- bytes += xfr.getBody().remaining();
- if ((count % interval) == 0)
- {
- time = System.currentTimeMillis();
- System.out.println
- (String.format
- (FORMAT_ROW, id, counts(), rates(), interval_rates()));
- interval_start = time;
- bytes_start = bytes;
- }
- ssn.processed(xfr);
- }
-
- public void exception(Session ssn, SessionException exc)
- {
- exc.printStackTrace();
- }
-
- public void closed(Session ssn) {}
-
- public static final void main(String[] args) throws IOException
- {
- ConnectionDelegate delegate = new ServerDelegate()
- {
- @Override public Session getSession(Connection conn, SessionAttach atc)
- {
- Session ssn = super.getSession(conn, atc);
- ssn.setSessionListener(new Sink());
- return ssn;
- }
- };
-
- IoAcceptor ioa = new IoAcceptor
- ("0.0.0.0", 5672, ConnectionBinding.get(delegate));
- System.out.println
- (String.format
- (FORMAT_HDR, "Session", "Count/MBytes", "Cumulative Rate", "Interval Rate"));
- System.out.println
- (String.format
- (FORMAT_HDR, "-------", "------------", "---------------", "-------------"));
- ioa.start();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Struct.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Struct.java
deleted file mode 100644
index 22bd9f34ad..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/Struct.java
+++ /dev/null
@@ -1,142 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encodable;
-import org.apache.qpid.transport.codec.Encoder;
-
-
-/**
- * Struct
- *
- * @author Rafael H. Schloming
- */
-
-public abstract class Struct implements Encodable
-{
-
- public static Struct create(int type)
- {
- return StructFactory.create(type);
- }
-
- boolean dirty = true;
-
- public boolean isDirty()
- {
- return dirty;
- }
-
- public void setDirty(boolean dirty)
- {
- this.dirty = dirty;
- }
-
- public abstract int getStructType();
-
- public abstract int getSizeWidth();
-
- public abstract int getPackWidth();
-
- public final int getEncodedType()
- {
- int type = getStructType();
- if (type < 0)
- {
- throw new UnsupportedOperationException();
- }
- return type;
- }
-
- private final boolean isBit(Field<?,?> f)
- {
- return f.getType().equals(Boolean.class);
- }
-
- private final boolean packed()
- {
- return getPackWidth() > 0;
- }
-
- private final boolean encoded(Field<?,?> f)
- {
- return !packed() || !isBit(f) && f.has(this);
- }
-
- private final int getFlagWidth()
- {
- return (getFields().size() + 7)/8;
- }
-
- private final int getPaddWidth()
- {
- int pw = getPackWidth() - getFlagWidth();
- assert pw > 0;
- return pw;
- }
-
- private final int getFlagCount()
- {
- return 8*getPackWidth();
- }
-
- private final int getReservedFlagCount()
- {
- return getFlagCount() - getFields().size();
- }
-
- public abstract void read(Decoder dec);
-
- public abstract void write(Encoder enc);
-
- public abstract Map<String,Object> getFields();
-
- public String toString()
- {
- StringBuilder str = new StringBuilder();
- str.append(getClass().getSimpleName());
-
- str.append("(");
- boolean first = true;
- for (Map.Entry<String,Object> me : getFields().entrySet())
- {
- if (first)
- {
- first = false;
- }
- else
- {
- str.append(", ");
- }
- str.append(me.getKey());
- str.append("=");
- str.append(me.getValue());
- }
- str.append(")");
-
- return str.toString();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/TransportException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/TransportException.java
deleted file mode 100644
index 0de190dfad..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/TransportException.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-package org.apache.qpid.transport;
-
-
-/**
- * TransportException
- */
-
-public class TransportException extends RuntimeException
-{
-
- public TransportException(String msg)
- {
- super(msg);
- }
-
- public TransportException(String msg, Throwable cause)
- {
- super(msg, cause);
- }
-
- public TransportException(Throwable cause)
- {
- super(cause);
- }
-
- public void rethrow()
- {
- throw new TransportException(getMessage(), this);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractDecoder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractDecoder.java
deleted file mode 100644
index a8a4997ae7..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractDecoder.java
+++ /dev/null
@@ -1,470 +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.
- *
- */
-package org.apache.qpid.transport.codec;
-
-import java.io.UnsupportedEncodingException;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.transport.Binary;
-import org.apache.qpid.transport.RangeSet;
-import org.apache.qpid.transport.Struct;
-import org.apache.qpid.transport.Type;
-
-import static org.apache.qpid.transport.util.Functions.*;
-
-
-/**
- * AbstractDecoder
- *
- * @author Rafael H. Schloming
- */
-
-abstract class AbstractDecoder implements Decoder
-{
-
- private final Map<Binary,String> str8cache = new LinkedHashMap<Binary,String>()
- {
- @Override protected boolean removeEldestEntry(Map.Entry<Binary,String> me)
- {
- return size() > 4*1024;
- }
- };
-
- protected abstract byte doGet();
-
- protected abstract void doGet(byte[] bytes);
-
- protected byte get()
- {
- return doGet();
- }
-
- protected void get(byte[] bytes)
- {
- doGet(bytes);
- }
-
- protected Binary get(int size)
- {
- byte[] bytes = new byte[size];
- get(bytes);
- return new Binary(bytes);
- }
-
- protected short uget()
- {
- return (short) (0xFF & get());
- }
-
- public short readUint8()
- {
- return uget();
- }
-
- public int readUint16()
- {
- int i = uget() << 8;
- i |= uget();
- return i;
- }
-
- public long readUint32()
- {
- long l = uget() << 24;
- l |= uget() << 16;
- l |= uget() << 8;
- l |= uget();
- return l;
- }
-
- public int readSequenceNo()
- {
- return (int) readUint32();
- }
-
- public long readUint64()
- {
- long l = 0;
- for (int i = 0; i < 8; i++)
- {
- l |= ((long) (0xFF & get())) << (56 - i*8);
- }
- return l;
- }
-
- public long readDatetime()
- {
- return readUint64();
- }
-
- private static final String decode(byte[] bytes, int offset, int length, String charset)
- {
- try
- {
- return new String(bytes, offset, length, charset);
- }
- catch (UnsupportedEncodingException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- private static final String decode(byte[] bytes, String charset)
- {
- return decode(bytes, 0, bytes.length, charset);
- }
-
- public String readStr8()
- {
- short size = readUint8();
- Binary bin = get(size);
- String str = str8cache.get(bin);
- if (str == null)
- {
- str = decode(bin.array(), bin.offset(), bin.size(), "UTF-8");
- str8cache.put(bin, str);
- }
- return str;
- }
-
- public String readStr16()
- {
- int size = readUint16();
- byte[] bytes = new byte[size];
- get(bytes);
- return decode(bytes, "UTF-8");
- }
-
- public byte[] readVbin8()
- {
- int size = readUint8();
- byte[] bytes = new byte[size];
- get(bytes);
- return bytes;
- }
-
- public byte[] readVbin16()
- {
- int size = readUint16();
- byte[] bytes = new byte[size];
- get(bytes);
- return bytes;
- }
-
- public byte[] readVbin32()
- {
- int size = (int) readUint32();
- byte[] bytes = new byte[size];
- get(bytes);
- return bytes;
- }
-
- public RangeSet readSequenceSet()
- {
- int count = readUint16()/8;
- if (count == 0)
- {
- return null;
- }
- else
- {
- RangeSet ranges = new RangeSet();
- for (int i = 0; i < count; i++)
- {
- ranges.add(readSequenceNo(), readSequenceNo());
- }
- return ranges;
- }
- }
-
- public RangeSet readByteRanges()
- {
- throw new Error("not implemented");
- }
-
- public UUID readUuid()
- {
- long msb = readUint64();
- long lsb = readUint64();
- return new UUID(msb, lsb);
- }
-
- public String readContent()
- {
- throw new Error("Deprecated");
- }
-
- public Struct readStruct(int type)
- {
- Struct st = Struct.create(type);
- int width = st.getSizeWidth();
- if (width > 0)
- {
- long size = readSize(width);
- if (size == 0)
- {
- return null;
- }
- }
- if (type > 0)
- {
- int code = readUint16();
- assert code == type;
- }
- st.read(this);
- return st;
- }
-
- public Struct readStruct32()
- {
- long size = readUint32();
- if (size == 0)
- {
- return null;
- }
- else
- {
- int type = readUint16();
- Struct result = Struct.create(type);
- result.read(this);
- return result;
- }
- }
-
- public Map<String,Object> readMap()
- {
- long size = readUint32();
-
- if (size == 0)
- {
- return null;
- }
-
- long count = readUint32();
-
- if (count == 0)
- {
- return Collections.EMPTY_MAP;
- }
-
- Map<String,Object> result = new LinkedHashMap();
- for (int i = 0; i < count; i++)
- {
- String key = readStr8();
- byte code = get();
- Type t = getType(code);
- Object value = read(t);
- result.put(key, value);
- }
-
- return result;
- }
-
- public List<Object> readList()
- {
- long size = readUint32();
-
- if (size == 0)
- {
- return null;
- }
-
- long count = readUint32();
-
- if (count == 0)
- {
- return Collections.EMPTY_LIST;
- }
-
- List<Object> result = new ArrayList();
- for (int i = 0; i < count; i++)
- {
- byte code = get();
- Type t = getType(code);
- Object value = read(t);
- result.add(value);
- }
- return result;
- }
-
- public List<Object> readArray()
- {
- long size = readUint32();
-
- if (size == 0)
- {
- return null;
- }
-
- byte code = get();
- Type t = getType(code);
- long count = readUint32();
-
- if (count == 0)
- {
- return Collections.EMPTY_LIST;
- }
-
- List<Object> result = new ArrayList<Object>();
- for (int i = 0; i < count; i++)
- {
- Object value = read(t);
- result.add(value);
- }
- return result;
- }
-
- private Type getType(byte code)
- {
- Type type = Type.get(code);
- if (type == null)
- {
- throw new IllegalArgumentException("unknown code: " + code);
- }
- else
- {
- return type;
- }
- }
-
- private long readSize(Type t)
- {
- if (t.fixed)
- {
- return t.width;
- }
- else
- {
- return readSize(t.width);
- }
- }
-
- private long readSize(int width)
- {
- switch (width)
- {
- case 1:
- return readUint8();
- case 2:
- return readUint16();
- case 4:
- return readUint32();
- default:
- throw new IllegalStateException("illegal width: " + width);
- }
- }
-
- private byte[] readBytes(Type t)
- {
- long size = readSize(t);
- byte[] result = new byte[(int) size];
- get(result);
- return result;
- }
-
- private Object read(Type t)
- {
- switch (t)
- {
- case BIN8:
- case UINT8:
- return readUint8();
- case INT8:
- return get();
- case CHAR:
- return (char) get();
- case BOOLEAN:
- return get() > 0;
-
- case BIN16:
- case UINT16:
- return readUint16();
-
- case INT16:
- return (short) readUint16();
-
- case BIN32:
- case UINT32:
- return readUint32();
-
- case CHAR_UTF32:
- case INT32:
- return (int) readUint32();
-
- case FLOAT:
- return Float.intBitsToFloat((int) readUint32());
-
- case BIN64:
- case UINT64:
- case INT64:
- case DATETIME:
- return readUint64();
-
- case DOUBLE:
- return Double.longBitsToDouble(readUint64());
-
- case UUID:
- return readUuid();
-
- case STR8:
- return readStr8();
-
- case STR16:
- return readStr16();
-
- case STR8_LATIN:
- case STR8_UTF16:
- case STR16_LATIN:
- case STR16_UTF16:
- // XXX: need to do character conversion
- return new String(readBytes(t));
-
- case MAP:
- return readMap();
- case LIST:
- return readList();
- case ARRAY:
- return readArray();
- case STRUCT32:
- return readStruct32();
-
- case BIN40:
- case DEC32:
- case BIN72:
- case DEC64:
- // XXX: what types are we supposed to use here?
- return readBytes(t);
-
- case VOID:
- return null;
-
- default:
- return readBytes(t);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java
deleted file mode 100644
index 908d14a307..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/AbstractEncoder.java
+++ /dev/null
@@ -1,620 +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.
- *
- */
-package org.apache.qpid.transport.codec;
-
-import java.io.UnsupportedEncodingException;
-
-import java.nio.ByteBuffer;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.transport.Range;
-import org.apache.qpid.transport.RangeSet;
-import org.apache.qpid.transport.Struct;
-import org.apache.qpid.transport.Type;
-
-import static org.apache.qpid.transport.util.Functions.*;
-
-
-/**
- * AbstractEncoder
- *
- * @author Rafael H. Schloming
- */
-
-abstract class AbstractEncoder implements Encoder
-{
-
- private static Map<Class<?>,Type> ENCODINGS = new HashMap<Class<?>,Type>();
- static
- {
- ENCODINGS.put(Boolean.class, Type.BOOLEAN);
- ENCODINGS.put(String.class, Type.STR16);
- ENCODINGS.put(Long.class, Type.INT64);
- ENCODINGS.put(Integer.class, Type.INT32);
- ENCODINGS.put(Short.class, Type.INT16);
- ENCODINGS.put(Byte.class, Type.INT8);
- ENCODINGS.put(Map.class, Type.MAP);
- ENCODINGS.put(List.class, Type.LIST);
- ENCODINGS.put(Float.class, Type.FLOAT);
- ENCODINGS.put(Double.class, Type.DOUBLE);
- ENCODINGS.put(Character.class, Type.CHAR);
- ENCODINGS.put(byte[].class, Type.VBIN32);
- }
-
- private final Map<String,byte[]> str8cache = new LinkedHashMap<String,byte[]>()
- {
- @Override protected boolean removeEldestEntry(Map.Entry<String,byte[]> me)
- {
- return size() > 4*1024;
- }
- };
-
- protected abstract void doPut(byte b);
-
- protected abstract void doPut(ByteBuffer src);
-
- protected void put(byte b)
- {
- doPut(b);
- }
-
- protected void put(ByteBuffer src)
- {
- doPut(src);
- }
-
- protected void put(byte[] bytes)
- {
- put(ByteBuffer.wrap(bytes));
- }
-
- protected abstract int beginSize8();
- protected abstract void endSize8(int pos);
-
- protected abstract int beginSize16();
- protected abstract void endSize16(int pos);
-
- protected abstract int beginSize32();
- protected abstract void endSize32(int pos);
-
- public void writeUint8(short b)
- {
- assert b < 0x100;
-
- put((byte) b);
- }
-
- public void writeUint16(int s)
- {
- assert s < 0x10000;
-
- put(lsb(s >>> 8));
- put(lsb(s));
- }
-
- public void writeUint32(long i)
- {
- assert i < 0x100000000L;
-
- put(lsb(i >>> 24));
- put(lsb(i >>> 16));
- put(lsb(i >>> 8));
- put(lsb(i));
- }
-
- public void writeSequenceNo(int i)
- {
- writeUint32(i);
- }
-
- public void writeUint64(long l)
- {
- for (int i = 0; i < 8; i++)
- {
- put(lsb(l >> (56 - i*8)));
- }
- }
-
-
- public void writeDatetime(long l)
- {
- writeUint64(l);
- }
-
- private static final byte[] encode(String s, String charset)
- {
- try
- {
- return s.getBytes(charset);
- }
- catch (UnsupportedEncodingException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public void writeStr8(String s)
- {
- if (s == null)
- {
- s = "";
- }
-
- byte[] bytes = str8cache.get(s);
- if (bytes == null)
- {
- bytes = encode(s, "UTF-8");
- str8cache.put(s, bytes);
- }
- writeUint8((short) bytes.length);
- put(bytes);
- }
-
- public void writeStr16(String s)
- {
- if (s == null)
- {
- s = "";
- }
-
- byte[] bytes = encode(s, "UTF-8");
- writeUint16(bytes.length);
- put(bytes);
- }
-
- public void writeVbin8(byte[] bytes)
- {
- if (bytes == null) { bytes = new byte[0]; }
- if (bytes.length > 255)
- {
- throw new IllegalArgumentException("array too long: " + bytes.length);
- }
- writeUint8((short) bytes.length);
- put(ByteBuffer.wrap(bytes));
- }
-
- public void writeVbin16(byte[] bytes)
- {
- if (bytes == null) { bytes = new byte[0]; }
- writeUint16(bytes.length);
- put(ByteBuffer.wrap(bytes));
- }
-
- public void writeVbin32(byte[] bytes)
- {
- if (bytes == null) { bytes = new byte[0]; }
- writeUint32(bytes.length);
- put(ByteBuffer.wrap(bytes));
- }
-
- public void writeSequenceSet(RangeSet ranges)
- {
- if (ranges == null)
- {
- writeUint16((short) 0);
- }
- else
- {
- writeUint16(ranges.size() * 8);
- for (Range range : ranges)
- {
- writeSequenceNo(range.getLower());
- writeSequenceNo(range.getUpper());
- }
- }
- }
-
- public void writeByteRanges(RangeSet ranges)
- {
- throw new Error("not implemented");
- }
-
- public void writeUuid(UUID uuid)
- {
- long msb = 0;
- long lsb = 0;
- if (uuid != null)
- {
- msb = uuid.getMostSignificantBits();
- lsb = uuid.getLeastSignificantBits();
- }
- writeUint64(msb);
- writeUint64(lsb);
- }
-
- public void writeStruct(int type, Struct s)
- {
- boolean empty = false;
- if (s == null)
- {
- s = Struct.create(type);
- empty = true;
- }
-
- int width = s.getSizeWidth();
- int pos = -1;
- if (width > 0)
- {
- pos = beginSize(width);
- }
-
- if (type > 0)
- {
- writeUint16(type);
- }
-
- s.write(this);
-
- if (width > 0)
- {
- endSize(width, pos);
- }
- }
-
- public void writeStruct32(Struct s)
- {
- if (s == null)
- {
- writeUint32(0);
- }
- else
- {
- int pos = beginSize32();
- writeUint16(s.getEncodedType());
- s.write(this);
- endSize32(pos);
- }
- }
-
- private Type encoding(Object value)
- {
- if (value == null)
- {
- return Type.VOID;
- }
-
- Class klass = value.getClass();
- Type type = resolve(klass);
-
- if (type == null)
- {
- throw new IllegalArgumentException
- ("unable to resolve type: " + klass + ", " + value);
- }
- else
- {
- return type;
- }
- }
-
- static final Type resolve(Class klass)
- {
- Type type = ENCODINGS.get(klass);
- if (type != null)
- {
- return type;
- }
-
- Class sup = klass.getSuperclass();
- if (sup != null)
- {
- type = resolve(klass.getSuperclass());
-
- if (type != null)
- {
- return type;
- }
- }
-
- for (Class iface : klass.getInterfaces())
- {
- type = resolve(iface);
- if (type != null)
- {
- return type;
- }
- }
-
- return null;
- }
-
- public void writeMap(Map<String,Object> map)
- {
- int pos = beginSize32();
- if (map != null)
- {
- writeUint32(map.size());
- writeMapEntries(map);
- }
- endSize32(pos);
- }
-
- protected void writeMapEntries(Map<String,Object> map)
- {
- for (Map.Entry<String,Object> entry : map.entrySet())
- {
- String key = entry.getKey();
- Object value = entry.getValue();
- Type type = encoding(value);
- writeStr8(key);
- put(type.code);
- write(type, value);
- }
- }
-
- public void writeList(List<Object> list)
- {
- int pos = beginSize32();
- if (list != null)
- {
- writeUint32(list.size());
- writeListEntries(list);
- }
- endSize32(pos);
- }
-
- protected void writeListEntries(List<Object> list)
- {
- for (Object value : list)
- {
- Type type = encoding(value);
- put(type.code);
- write(type, value);
- }
- }
-
- public void writeArray(List<Object> array)
- {
- int pos = beginSize32();
- if (array != null)
- {
- writeArrayEntries(array);
- }
- endSize32(pos);
- }
-
- protected void writeArrayEntries(List<Object> array)
- {
- Type type;
-
- if (array.isEmpty())
- {
- return;
- }
- else
- {
- type = encoding(array.get(0));
- }
-
- put(type.code);
-
- writeUint32(array.size());
-
- for (Object value : array)
- {
- write(type, value);
- }
- }
-
- private void writeSize(Type t, int size)
- {
- if (t.fixed)
- {
- if (size != t.width)
- {
- throw new IllegalArgumentException
- ("size does not match fixed width " + t.width + ": " +
- size);
- }
- }
- else
- {
- writeSize(t.width, size);
- }
- }
-
- private void writeSize(int width, int size)
- {
- // XXX: should check lengths
- switch (width)
- {
- case 1:
- writeUint8((short) size);
- break;
- case 2:
- writeUint16(size);
- break;
- case 4:
- writeUint32(size);
- break;
- default:
- throw new IllegalStateException("illegal width: " + width);
- }
- }
-
- private int beginSize(int width)
- {
- switch (width)
- {
- case 1:
- return beginSize8();
- case 2:
- return beginSize16();
- case 4:
- return beginSize32();
- default:
- throw new IllegalStateException("illegal width: " + width);
- }
- }
-
- private void endSize(int width, int pos)
- {
- switch (width)
- {
- case 1:
- endSize8(pos);
- break;
- case 2:
- endSize16(pos);
- break;
- case 4:
- endSize32(pos);
- break;
- default:
- throw new IllegalStateException("illegal width: " + width);
- }
- }
-
- private void writeBytes(Type t, byte[] bytes)
- {
- writeSize(t, bytes.length);
- put(bytes);
- }
-
- private <T> T coerce(Class<T> klass, Object value)
- {
- if (klass.isInstance(value))
- {
- return klass.cast(value);
- }
- else
- {
- throw new IllegalArgumentException("" + value);
- }
- }
-
- private void write(Type t, Object value)
- {
- switch (t)
- {
- case BIN8:
- case UINT8:
- writeUint8(coerce(Short.class, value));
- break;
- case INT8:
- put(coerce(Byte.class, value));
- break;
- case CHAR:
- put((byte) ((char)coerce(Character.class, value)));
- break;
- case BOOLEAN:
- if (coerce(Boolean.class, value))
- {
- put((byte) 1);
- }
- else
- {
- put((byte) 0);
- }
- break;
-
- case BIN16:
- case UINT16:
- writeUint16(coerce(Integer.class, value));
- break;
-
- case INT16:
- writeUint16(coerce(Short.class, value));
- break;
-
- case BIN32:
- case UINT32:
- writeUint32(coerce(Long.class, value));
- break;
-
- case CHAR_UTF32:
- case INT32:
- writeUint32(coerce(Integer.class, value));
- break;
-
- case FLOAT:
- writeUint32(Float.floatToIntBits(coerce(Float.class, value)));
- break;
-
- case BIN64:
- case UINT64:
- case INT64:
- case DATETIME:
- writeUint64(coerce(Long.class, value));
- break;
-
- case DOUBLE:
- long bits = Double.doubleToLongBits(coerce(Double.class, value));
- writeUint64(bits);
- break;
-
- case UUID:
- writeUuid(coerce(UUID.class, value));
- break;
-
- case STR8:
- writeStr8(coerce(String.class, value));
- break;
-
- case STR16:
- writeStr16(coerce(String.class, value));
- break;
-
- case STR8_LATIN:
- case STR8_UTF16:
- case STR16_LATIN:
- case STR16_UTF16:
- // XXX: need to do character conversion
- writeBytes(t, coerce(String.class, value).getBytes());
- break;
-
- case MAP:
- writeMap((Map<String,Object>) coerce(Map.class, value));
- break;
- case LIST:
- writeList(coerce(List.class, value));
- break;
- case ARRAY:
- writeArray(coerce(List.class, value));
- break;
- case STRUCT32:
- writeStruct32(coerce(Struct.class, value));
- break;
-
- case BIN40:
- case DEC32:
- case BIN72:
- case DEC64:
- // XXX: what types are we supposed to use here?
- writeBytes(t, coerce(byte[].class, value));
- break;
-
- case VOID:
- break;
-
- default:
- writeBytes(t, coerce(byte[].class, value));
- break;
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBDecoder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBDecoder.java
deleted file mode 100644
index 6f7a2fa3b2..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBDecoder.java
+++ /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.
- *
- */
-package org.apache.qpid.transport.codec;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-import org.apache.qpid.transport.Binary;
-
-/**
- * Byte Buffer Decoder.
- * Decoder concrete implementor using a backing byte buffer for decoding data.
- *
- * @author Rafael H. Schloming
- */
-public final class BBDecoder extends AbstractDecoder
-{
- private ByteBuffer in;
-
- public void init(ByteBuffer in)
- {
- this.in = in;
- this.in.order(ByteOrder.BIG_ENDIAN);
- }
-
- protected byte doGet()
- {
- return in.get();
- }
-
- protected void doGet(byte[] bytes)
- {
- in.get(bytes);
- }
-
- protected Binary get(int size)
- {
- if (in.hasArray())
- {
- byte[] bytes = in.array();
- Binary bin = new Binary(bytes, in.arrayOffset() + in.position(), size);
- in.position(in.position() + size);
- return bin;
- }
- else
- {
- return super.get(size);
- }
- }
-
- public boolean hasRemaining()
- {
- return in.hasRemaining();
- }
-
- public short readUint8()
- {
- return (short) (0xFF & in.get());
- }
-
- public int readUint16()
- {
- return 0xFFFF & in.getShort();
- }
-
- public long readUint32()
- {
- return 0xFFFFFFFFL & in.getInt();
- }
-
- public long readUint64()
- {
- return in.getLong();
- }
-
- public byte[] readBin128()
- {
- byte[] result = new byte[16];
- get(result);
- return result;
- }
-
- public byte[] readBytes(int howManyBytes)
- {
- byte[] result = new byte[howManyBytes];
- get(result);
- return result;
- }
-
- public double readDouble()
- {
- return in.getDouble();
- }
-
- public float readFloat()
- {
- return in.getFloat();
- }
-
- public short readInt16()
- {
- return in.getShort();
- }
-
- public int readInt32()
- {
- return in.getInt();
- }
-
- public byte readInt8()
- {
- return in.get();
- }
-
- public byte[] readReaminingBytes()
- {
- byte[] result = new byte[in.limit() - in.position()];
- get(result);
- return result;
- }
-
- public long readInt64()
- {
- return in.getLong();
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBEncoder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBEncoder.java
deleted file mode 100644
index 532c19ec18..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/BBEncoder.java
+++ /dev/null
@@ -1,323 +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.
- *
- */
-package org.apache.qpid.transport.codec;
-
-import java.nio.BufferOverflowException;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-
-/**
- * Byte Buffer Encoder.
- * Encoder concrete implementor using a backing byte buffer for encoding data.
- *
- * @author Rafael H. Schloming
- */
-public final class BBEncoder extends AbstractEncoder
-{
- private ByteBuffer out;
- private int segment;
-
- public BBEncoder(int capacity) {
- out = ByteBuffer.allocate(capacity);
- out.order(ByteOrder.BIG_ENDIAN);
- segment = 0;
- }
-
- public void init()
- {
- out.clear();
- segment = 0;
- }
-
- public ByteBuffer segment()
- {
- int pos = out.position();
- out.position(segment);
- ByteBuffer slice = out.slice();
- slice.limit(pos - segment);
- out.position(pos);
- segment = pos;
- return slice;
- }
-
- private void grow(int size)
- {
- ByteBuffer old = out;
- int capacity = old.capacity();
- out = ByteBuffer.allocate(Math.max(capacity + size, 2*capacity));
- out.order(ByteOrder.BIG_ENDIAN);
- out.put(old);
- }
-
- protected void doPut(byte b)
- {
- try
- {
- out.put(b);
- }
- catch (BufferOverflowException e)
- {
- grow(1);
- out.put(b);
- }
- }
-
- protected void doPut(ByteBuffer src)
- {
- try
- {
- out.put(src);
- }
- catch (BufferOverflowException e)
- {
- grow(src.remaining());
- out.put(src);
- }
- }
-
- protected void put(byte[] bytes)
- {
- try
- {
- out.put(bytes);
- }
- catch (BufferOverflowException e)
- {
- grow(bytes.length);
- out.put(bytes);
- }
- }
-
- public void writeUint8(short b)
- {
- assert b < 0x100;
-
- try
- {
- out.put((byte) b);
- }
- catch (BufferOverflowException e)
- {
- grow(1);
- out.put((byte) b);
- }
- }
-
- public void writeUint16(int s)
- {
- assert s < 0x10000;
-
- try
- {
- out.putShort((short) s);
- }
- catch (BufferOverflowException e)
- {
- grow(2);
- out.putShort((short) s);
- }
- }
-
- public void writeUint32(long i)
- {
- assert i < 0x100000000L;
-
- try
- {
- out.putInt((int) i);
- }
- catch (BufferOverflowException e)
- {
- grow(4);
- out.putInt((int) i);
- }
- }
-
- public void writeUint64(long l)
- {
- try
- {
- out.putLong(l);
- }
- catch (BufferOverflowException e)
- {
- grow(8);
- out.putLong(l);
- }
- }
-
- public int beginSize8()
- {
- int pos = out.position();
- try
- {
- out.put((byte) 0);
- }
- catch (BufferOverflowException e)
- {
- grow(1);
- out.put((byte) 0);
- }
- return pos;
- }
-
- public void endSize8(int pos)
- {
- int cur = out.position();
- out.put(pos, (byte) (cur - pos - 1));
- }
-
- public int beginSize16()
- {
- int pos = out.position();
- try
- {
- out.putShort((short) 0);
- }
- catch (BufferOverflowException e)
- {
- grow(2);
- out.putShort((short) 0);
- }
- return pos;
- }
-
- public void endSize16(int pos)
- {
- int cur = out.position();
- out.putShort(pos, (short) (cur - pos - 2));
- }
-
- public int beginSize32()
- {
- int pos = out.position();
- try
- {
- out.putInt(0);
- }
- catch (BufferOverflowException e)
- {
- grow(4);
- out.putInt(0);
- }
- return pos;
- }
-
- public void endSize32(int pos)
- {
- int cur = out.position();
- out.putInt(pos, (cur - pos - 4));
- }
-
- public void writeDouble(double aDouble)
- {
- try
- {
- out.putDouble(aDouble);
- } catch(BufferOverflowException exception)
- {
- grow(8);
- out.putDouble(aDouble);
- }
- }
-
- public void writeInt16(short aShort)
- {
- try
- {
- out.putShort(aShort);
- } catch(BufferOverflowException exception)
- {
- grow(2);
- out.putShort(aShort);
- }
- }
-
- public void writeInt32(int anInt)
- {
- try
- {
- out.putInt(anInt);
- } catch(BufferOverflowException exception)
- {
- grow(4);
- out.putInt(anInt);
- }
- }
-
- public void writeInt64(long aLong)
- {
- try
- {
- out.putLong(aLong);
- } catch(BufferOverflowException exception)
- {
- grow(8);
- out.putLong(aLong);
- }
- }
-
- public void writeInt8(byte aByte)
- {
- try
- {
- out.put(aByte);
- } catch(BufferOverflowException exception)
- {
- grow(1);
- out.put(aByte);
- }
- }
-
- public void writeBin128(byte[] byteArray)
- {
- byteArray = (byteArray != null) ? byteArray : new byte [16];
-
- assert byteArray.length == 16;
-
- try
- {
- out.put(byteArray);
- } catch(BufferOverflowException exception)
- {
- grow(16);
- out.put(byteArray);
- }
- }
-
- public void writeFloat(float aFloat)
- {
- try
- {
- out.putFloat(aFloat);
- } catch(BufferOverflowException exception)
- {
- grow(4);
- out.putFloat(aFloat);
- }
- }
-
- public void writeMagicNumber()
- {
- out.put("AM2".getBytes());
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Decoder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Decoder.java
deleted file mode 100644
index a4df5b5fcb..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Decoder.java
+++ /dev/null
@@ -1,283 +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.
- *
- */
-package org.apache.qpid.transport.codec;
-
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.transport.RangeSet;
-import org.apache.qpid.transport.Struct;
-
-
-/**
- * Decoder interface.
- * Each concrete implementor must specify how to decode given values.
- *
- * @author Rafael H. Schloming
- */
-public interface Decoder
-{
- /**
- * Tells whether there are any remaining byte(s) to be read.
- *
- * @return true if there are remaining bytes, false otherwise.
- */
- boolean hasRemaining();
-
- /**
- * The uint8 type is an 8-bit unsigned integral value.
- *
- * @return an 8-bit unsigned integral value.
- */
- short readUint8();
-
- /**
- *The uint16 type is a 16-bit unsigned integral value encoded in network byte order.
- *
- * @return a 16-bit unsigned integral value encoded in network byte order.
- */
- int readUint16();
-
- /**
- *The uint32 type is a 32-bit unsigned integral value encoded in network byte order.
- *
- * @return a 32-bit unsigned integral value encoded in network byte order.
- */
- long readUint32();
-
- /**
- * The uint64 type is a 64-bit unsigned integral value encoded in network byte order.
- *
- * @return a 64-bit unsigned integral value encoded in network byte order.
- */
- long readUint64();
-
- /**
- * The datetime type encodes a date and time using the 64 bit POSIX time_t format.
- *
- * @return a date and time using the 64 bit POSIX time_t format.
- */
- long readDatetime();
-
- /**
- * The uuid type encodes a universally unique id as defined by RFC-4122.
- * The format and operations for this type can be found in section 4.1.2 of RFC-4122.
- *
- * return a universally unique id as defined by RFC-4122.
- */
- UUID readUuid();
-
- /**
-// *The sequence-no type encodes, in network byte order, a serial number as defined in RFC-1982.
- *
- * @return a serial number as defined in RFC-1982.
- */
- int readSequenceNo();
-
- RangeSet readSequenceSet(); // XXX
- RangeSet readByteRanges(); // XXX
-
- /**
- * The str8 type encodes up to 255 octets worth of UTF-8 unicode.
- * The number of octets of unicode is first encoded as an 8-bit unsigned integral value.
- * This is followed by the actual UTF-8 unicode.
- * Note that the encoded size refers to the number of octets of unicode, not necessarily the number of characters since
- * the UTF-8 unicode may include multi-byte character sequences.
- *
- * @return a string.
- */
- String readStr8();
-
- /**
- * The str16 type encodes up to 65535 octets worth of UTF-8 unicode.
- * The number of octets is first encoded as a 16-bit unsigned integral value in network byte order.
- * This is followed by the actual UTF-8 unicode.
- * Note that the encoded size refers to the number of octets of unicode, not necessarily the number of unicode
- * characters since the UTF-8 unicode may include multi-byte character sequences.
- *
- * return a string.
- */
- String readStr16();
-
- /**
- * The vbin8 type encodes up to 255 octets of opaque binary data.
- *
- * return a byte array.
- */
- byte[] readVbin8();
-
- /**
- * The vbin16 type encodes up to 65535 octets of opaque binary data.
- *
- * @return the corresponding byte array.
- */
- byte[] readVbin16();
-
- /**
- * The vbin32 type encodes up to 4294967295 octets of opaque binary data.
- *
- * @return the corresponding byte array.
- */
- byte[] readVbin32();
-
- /**
- * The struct32 type describes any coded struct with a 32-bit (4 octet) size.
- * The type is restricted to be only coded structs with a 32-bit size, consequently the first six octets of any encoded
- * value for this type MUST always contain the size, class-code, and struct-code in that order.
- * The size is encoded as a 32-bit unsigned integral value in network byte order that is equal to the size of the
- * encoded field-data, packing-flags, class-code, and struct-code. The class-code is a single octet that may be set to any
- * valid class code.
- * The struct-code is a single octet that may be set to any valid struct code within the given class-code.
- * The first six octets are then followed by the packing flags and encoded field data.
- * The presence and quantity of packingflags, as well as the specific fields are determined by the struct definition
- * identified with the encoded class-code and struct-code.
- *
- * @return the decoded struct.
- */
- Struct readStruct32();
-
- /**
- * A map is a set of distinct keys where each key has an associated (type,value) pair.
- * The triple of the key, type, and value, form an entry within a map. Each entry within a given map MUST have a
- * distinct key.
- * A map is encoded as a size in octets, a count of the number of entries, followed by the encoded entries themselves.
- * An encoded map may contain up to (4294967295 - 4) octets worth of encoded entries.
- * The size is encoded as a 32-bit unsigned integral value in network byte order equal to the number of octets worth of
- * encoded entries plus 4. (The extra 4 octets is added for the entry count.)
- * The size is then followed by the number of entries encoded as a 32-bit unsigned integral value in network byte order.
- * Finally the entries are encoded sequentially.
- * An entry is encoded as the key, followed by the type, and then the value. The key is always a string encoded as a str8.
- * The type is a single octet that may contain any valid AMQP type code.
- * The value is encoded according to the rules defined by the type code for that entry.
- *
- * @return the decoded map.
- */
- Map<String,Object> readMap();
-
- /**
- * A list is an ordered sequence of (type, value) pairs. The (type, value) pair forms an item within the list.
- * The list may contain items of many distinct types. A list is encoded as a size in octets, followed by a count of the
- * number of items, followed by the items themselves encoded in their defined order.
- * An encoded list may contain up to (4294967295 - 4) octets worth of encoded items.
- * The size is encoded as a 32-bit unsigned integral value in network byte order equal to the number of octets worth
- * of encoded items plus 4. (The extra4 octets is added for the item count.)
- * The size is then followed by the number of items encoded as a 32-bit unsigned integral value in network byte order.
- * Finally the items are encoded sequentially in their defined order.
- * An item is encoded as the type followed by the value. The type is a single octet that may contain any valid AMQP type
- * code.
- * The value is encoded according to the rules defined by the type code for that item.
- *
- * @return the decoded list.
- */
- List<Object> readList();
-
- /**
- * An array is an ordered sequence of values of the same type.
- * The array is encoded in as a size in octets, followed by a type code, then a count of the number values in the array,
- * and finally the values encoded in their defined order.
- * An encoded array may contain up to (4294967295 - 5) octets worth of encoded values.
- * The size is encoded as a 32-bit unsigned integral value in network byte order equal to the number of octets worth of
- * encoded values plus 5. (The extra 5 octets consist of 4 octets for the count of the number of values, and one octet to
- * hold the type code for the items inthe array.)
- * The size is then followed by a single octet that may contain any valid AMQP type code.
- * The type code is then followed by the number of values encoded as a 32-bit unsigned integral value in network byte
- * order.
- * Finally the values are encoded sequentially in their defined order according to the rules defined by the type code for
- * the array.
- *
- * @return the decoded array.
- */
- List<Object> readArray();
-
- /**
- *
- * @param type the type of the struct.
- * @return the decoded struct.
- */
- Struct readStruct(int type);
-
- /**
- * The float type encodes a single precision 32-bit floating point number.
- * The format and operations are defined by the IEEE 754 standard for 32-bit single precision floating point numbers.
- *
- * @return the decoded float.
- */
- float readFloat();
-
- /**
- * The double type encodes a double precision 64-bit floating point number.
- * The format and operations are defined by the IEEE 754 standard for 64-bit double precision floating point numbers.
- *
- * @return the decoded double
- */
- double readDouble();
-
- /**
- * The int8 type is a signed integral value encoded using an 8-bit two's complement representation.
- *
- * @return the decoded integer.
- */
- byte readInt8();
-
- /**
- * The int16 type is a signed integral value encoded using a 16-bit two's complement representation in network byte order.
- *
- * @return the decoded integer.
- */
- short readInt16();
-
- /**
- * The int32 type is a signed integral value encoded using a 32-bit two's complement representation in network byte order.
- *
- * @return the decoded integer.
- */
- int readInt32();
-
- /**
- * The int64 type is a signed integral value encoded using a 64-bit two's complement representation in network byte order.
- *
- * @return the decoded integer (as long).
- */
- long readInt64();
-
- /**
- * The bin128 type consists of 16 consecutive octets of opaque binary data.
- *
- * @return the decoded byte array.
- */
- byte [] readBin128();
-
- /**
- * Reads the remaining bytes on the underlying buffer.
- *
- * @return the remaining bytes on the underlying buffer.
- */
- byte[] readReaminingBytes ();
-
- /**
- * Reads the given number of bytes.
- *
- * @param howManyBytes how many bytes need to be read?
- * @return a byte array containing the requested data.
- */
- byte[] readBytes (int howManyBytes);
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encodable.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encodable.java
deleted file mode 100644
index 37ce8a5cb7..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encodable.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.transport.codec;
-
-
-/**
- * Encodable
- *
- * @author Rafael H. Schloming
- */
-public interface Encodable
-{
- /**
- * Encodes this encodable using the given encoder.
- *
- * @param encoder the encoder.
- */
- void write(Encoder encoder);
-
- /**
- * Decodes this encodable using the given decoder.
- *
- * @param decoder the decoder.
- */
- void read(Decoder decoder);
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encoder.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encoder.java
deleted file mode 100644
index 7d4f02af31..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/codec/Encoder.java
+++ /dev/null
@@ -1,282 +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.
- *
- */
-package org.apache.qpid.transport.codec;
-
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.transport.RangeSet;
-import org.apache.qpid.transport.Struct;
-
-
-/**
- * Encoder interface.
- * Each concrete implementor must specify how to encode given values.
- *
- * @author Rafael H. Schloming
- */
-public interface Encoder
-{
- /**
- * The uint8 type is an 8-bit unsigned integral value.
- *
- * @param b the unsigned integer to be encoded.
- */
- void writeUint8(short b);
-
- /**
- *The uint16 type is a 16-bit unsigned integral value encoded in network byte order.
- *
- * @param s the unsigned integer to be encoded.
- */
- void writeUint16(int s);
-
- /**
- *The uint32 type is a 32-bit unsigned integral value encoded in network byte order.
- *
- * @param i the unsigned integer to be encoded.
- */
- void writeUint32(long i);
-
- /**
- * The uint64 type is a 64-bit unsigned integral value encoded in network byte order.
- *
- * @param b the unsigned integer to be encoded.
- */
- void writeUint64(long l);
-
- /**
- * The datetime type encodes a date and time using the 64 bit POSIX time_t format.
- *
- * @param l the datetime (as long) to be encoded.
- */
- void writeDatetime(long l);
-
- /**
- * The uuid type encodes a universally unique id as defined by RFC-4122.
- * The format and operations for this type can be found in section 4.1.2 of RFC-4122.
- *
- * @param uuid the uuid to be encoded.
- */
- void writeUuid(UUID uuid);
-
- /**
- *The sequence-no type encodes, in network byte order, a serial number as defined in RFC-1982.
- *
- * @param s the sequence number to be encoded.
- */
- void writeSequenceNo(int s);
-
- void writeSequenceSet(RangeSet ranges); // XXX
- void writeByteRanges(RangeSet ranges); // XXX
-
- /**
- * The str8 type encodes up to 255 octets worth of UTF-8 unicode.
- * The number of octets of unicode is first encoded as an 8-bit unsigned integral value.
- * This is followed by the actual UTF-8 unicode.
- * Note that the encoded size refers to the number of octets of unicode, not necessarily the number of characters since
- * the UTF-8 unicode may include multi-byte character sequences.
- *
- * @param s the string to be encoded.
- */
- void writeStr8(String s);
-
- /**
- * The str16 type encodes up to 65535 octets worth of UTF-8 unicode.
- * The number of octets is first encoded as a 16-bit unsigned integral value in network byte order.
- * This is followed by the actual UTF-8 unicode.
- * Note that the encoded size refers to the number of octets of unicode, not necessarily the number of unicode
- * characters since the UTF-8 unicode may include multi-byte character sequences.
- *
- * @param s the string to be encoded.
- */
- void writeStr16(String s);
-
- /**
- * The vbin8 type encodes up to 255 octets of opaque binary data.
- * The number of octets is first encoded as an 8-bit unsigned integral value.
- * This is followed by the actual data.
- *
- * @param bytes the byte array to be encoded.
- */
- void writeVbin8(byte[] bytes);
-
- /**
- * The vbin16 type encodes up to 65535 octets of opaque binary data.
- * The number of octets is first encoded as a 16-bit unsigned integral value in network byte order.
- * This is followed by the actual data.
- *
- * @param bytes the byte array to be encoded.
- */
- void writeVbin16(byte[] bytes);
-
- /**
- * The vbin32 type encodes up to 4294967295 octets of opaque binary data.
- * The number of octets is first encoded as a 32-bit unsigned integral value in network byte order.
- * This is followed by the actual data.
- *
- * @param bytes the byte array to be encoded.
- */
- void writeVbin32(byte[] bytes);
-
- /**
- * The struct32 type describes any coded struct with a 32-bit (4 octet) size.
- * The type is restricted to be only coded structs with a 32-bit size, consequently the first six octets of any encoded
- * value for this type MUST always contain the size, class-code, and struct-code in that order.
- * The size is encoded as a 32-bit unsigned integral value in network byte order that is equal to the size of the
- * encoded field-data, packing-flags, class-code, and struct-code. The class-code is a single octet that may be set to any
- * valid class code.
- * The struct-code is a single octet that may be set to any valid struct code within the given class-code.
- * The first six octets are then followed by the packing flags and encoded field data.
- * The presence and quantity of packingflags, as well as the specific fields are determined by the struct definition
- * identified with the encoded class-code and struct-code.
- *
- * @param struct the struct to be encoded.
- */
- void writeStruct32(Struct struct);
-
- /**
- * A map is a set of distinct keys where each key has an associated (type,value) pair.
- * The triple of the key, type, and value, form an entry within a map. Each entry within a given map MUST have a
- * distinct key.
- * A map is encoded as a size in octets, a count of the number of entries, followed by the encoded entries themselves.
- * An encoded map may contain up to (4294967295 - 4) octets worth of encoded entries.
- * The size is encoded as a 32-bit unsigned integral value in network byte order equal to the number of octets worth of
- * encoded entries plus 4. (The extra 4 octets is added for the entry count.)
- * The size is then followed by the number of entries encoded as a 32-bit unsigned integral value in network byte order.
- * Finally the entries are encoded sequentially.
- * An entry is encoded as the key, followed by the type, and then the value. The key is always a string encoded as a str8.
- * The type is a single octet that may contain any valid AMQP type code.
- * The value is encoded according to the rules defined by the type code for that entry.
- *
- * @param map the map to be encoded.
- */
- void writeMap(Map<String,Object> map);
-
- /**
- * A list is an ordered sequence of (type, value) pairs. The (type, value) pair forms an item within the list.
- * The list may contain items of many distinct types. A list is encoded as a size in octets, followed by a count of the
- * number of items, followed by the items themselves encoded in their defined order.
- * An encoded list may contain up to (4294967295 - 4) octets worth of encoded items.
- * The size is encoded as a 32-bit unsigned integral value in network byte order equal to the number of octets worth
- * of encoded items plus 4. (The extra4 octets is added for the item count.)
- * The size is then followed by the number of items encoded as a 32-bit unsigned integral value in network byte order.
- * Finally the items are encoded sequentially in their defined order.
- * An item is encoded as the type followed by the value. The type is a single octet that may contain any valid AMQP type
- * code.
- * The value is encoded according to the rules defined by the type code for that item.
- *
- * @param list the list to be encoded.
- */
- void writeList(List<Object> list);
-
- /**
- * An array is an ordered sequence of values of the same type.
- * The array is encoded in as a size in octets, followed by a type code, then a count of the number values in the array,
- * and finally the values encoded in their defined order.
- * An encoded array may contain up to (4294967295 - 5) octets worth of encoded values.
- * The size is encoded as a 32-bit unsigned integral value in network byte order equal to the number of octets worth of
- * encoded values plus 5. (The extra 5 octets consist of 4 octets for the count of the number of values, and one octet to
- * hold the type code for the items inthe array.)
- * The size is then followed by a single octet that may contain any valid AMQP type code.
- * The type code is then followed by the number of values encoded as a 32-bit unsigned integral value in network byte
- * order.
- * Finally the values are encoded sequentially in their defined order according to the rules defined by the type code for
- * the array.
- *
- * @param array the array to be encoded.
- */
- void writeArray(List<Object> array);
-
- /**
- * The struct32 type describes any coded struct with a 32-bit (4 octet) size.
- * The type is restricted to be only coded structs with a 32-bit size, consequently the first six octets of any encoded
- * value for this type MUST always contain the size, class-code, and struct-code in that order.
- * The size is encoded as a 32-bit unsigned integral value in network byte order that is equal to the size of the
- * encoded field-data, packing-flags, class-code, and struct-code. The class-code is a single octet that may be set to any
- * valid class code.
- * The struct-code is a single octet that may be set to any valid struct code within the given class-code.
- * The first six octets are then followed by the packing flags and encoded field data.
- * The presence and quantity of packingflags, as well as the specific fields are determined by the struct definition
- * identified with the encoded class-code and struct-code.
- *
- * @param type the type of the struct.
- * @param struct the struct to be encoded.
- */
- void writeStruct(int type, Struct struct);
-
- /**
- * The float type encodes a single precision 32-bit floating point number.
- * The format and operations are defined by the IEEE 754 standard for 32-bit single precision floating point numbers.
- *
- * @param aFloat the float to be encoded.
- */
- void writeFloat(float aFloat);
-
- /**
- * The double type encodes a double precision 64-bit floating point number.
- * The format and operations are defined by the IEEE 754 standard for 64-bit double precision floating point numbers.
- *
- * @param aDouble the double to be encoded.
- */
- void writeDouble(double aDouble);
-
- /**
- * The int8 type is a signed integral value encoded using an 8-bit two's complement representation.
- *
- * @param aByte the integer to be encoded.
- */
- void writeInt8(byte aByte);
-
- /**
- * The int16 type is a signed integral value encoded using a 16-bit two's complement representation in network byte order.
- *
- * @param aShort the integer to be encoded.
- */
- void writeInt16(short aShort);
-
- /**
- * The int32 type is a signed integral value encoded using a 32-bit two's complement representation in network byte order.
- *
- * @param anInt the integer to be encoded.
- */
- void writeInt32(int anInt);
-
- /**
- * The int64 type is a signed integral value encoded using a 64-bit two's complement representation in network byte order.
- *
- * @param aLong the integer to be encoded.
- */
- void writeInt64(long aLong);
-
- /**
- * The bin128 type consists of 16 consecutive octets of opaque binary data.
- *
- * @param bytes the bytes array to be encoded.
- */
- void writeBin128(byte [] bytes);
-
- /**
- * Encodes the AMQP magic number.
- */
- void writeMagicNumber();
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Assembler.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Assembler.java
deleted file mode 100644
index 33d552b91e..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Assembler.java
+++ /dev/null
@@ -1,226 +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.
- *
- */
-package org.apache.qpid.transport.network;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.codec.BBDecoder;
-import org.apache.qpid.transport.codec.Decoder;
-
-import org.apache.qpid.transport.Header;
-import org.apache.qpid.transport.Method;
-import org.apache.qpid.transport.ProtocolError;
-import org.apache.qpid.transport.ProtocolEvent;
-import org.apache.qpid.transport.ProtocolHeader;
-import org.apache.qpid.transport.Receiver;
-import org.apache.qpid.transport.SegmentType;
-import org.apache.qpid.transport.Struct;
-
-
-/**
- * Assembler
- *
- */
-
-public class Assembler implements Receiver<NetworkEvent>, NetworkDelegate
-{
-
- private final Receiver<ProtocolEvent> receiver;
- private final Map<Integer,List<Frame>> segments;
- private final Method[] incomplete;
- private final ThreadLocal<BBDecoder> decoder = new ThreadLocal<BBDecoder>()
- {
- public BBDecoder initialValue()
- {
- return new BBDecoder();
- }
- };
-
- public Assembler(Receiver<ProtocolEvent> receiver)
- {
- this.receiver = receiver;
- segments = new HashMap<Integer,List<Frame>>();
- incomplete = new Method[64*1024];
- }
-
- private int segmentKey(Frame frame)
- {
- return (frame.getTrack() + 1) * frame.getChannel();
- }
-
- private List<Frame> getSegment(Frame frame)
- {
- return segments.get(segmentKey(frame));
- }
-
- private void setSegment(Frame frame, List<Frame> segment)
- {
- int key = segmentKey(frame);
- if (segments.containsKey(key))
- {
- error(new ProtocolError(Frame.L2, "segment in progress: %s",
- frame));
- }
- segments.put(segmentKey(frame), segment);
- }
-
- private void clearSegment(Frame frame)
- {
- segments.remove(segmentKey(frame));
- }
-
- private void emit(int channel, ProtocolEvent event)
- {
- event.setChannel(channel);
- receiver.received(event);
- }
-
- public void received(NetworkEvent event)
- {
- event.delegate(this);
- }
-
- public void exception(Throwable t)
- {
- this.receiver.exception(t);
- }
-
- public void closed()
- {
- this.receiver.closed();
- }
-
- public void init(ProtocolHeader header)
- {
- emit(0, header);
- }
-
- public void error(ProtocolError error)
- {
- emit(0, error);
- }
-
- public void frame(Frame frame)
- {
- ByteBuffer segment;
- if (frame.isFirstFrame() && frame.isLastFrame())
- {
- segment = frame.getBody();
- assemble(frame, segment);
- }
- else
- {
- List<Frame> frames;
- if (frame.isFirstFrame())
- {
- frames = new ArrayList<Frame>();
- setSegment(frame, frames);
- }
- else
- {
- frames = getSegment(frame);
- }
-
- frames.add(frame);
-
- if (frame.isLastFrame())
- {
- clearSegment(frame);
-
- int size = 0;
- for (Frame f : frames)
- {
- size += f.getSize();
- }
- segment = ByteBuffer.allocate(size);
- for (Frame f : frames)
- {
- segment.put(f.getBody());
- }
- segment.flip();
- assemble(frame, segment);
- }
- }
-
- }
-
- private void assemble(Frame frame, ByteBuffer segment)
- {
- BBDecoder dec = decoder.get();
- dec.init(segment);
-
- int channel = frame.getChannel();
- Method command;
-
- switch (frame.getType())
- {
- case CONTROL:
- int controlType = dec.readUint16();
- Method control = Method.create(controlType);
- control.read(dec);
- emit(channel, control);
- break;
- case COMMAND:
- int commandType = dec.readUint16();
- // read in the session header, right now we don't use it
- dec.readUint16();
- command = Method.create(commandType);
- command.read(dec);
- if (command.hasPayload())
- {
- incomplete[channel] = command;
- }
- else
- {
- emit(channel, command);
- }
- break;
- case HEADER:
- command = incomplete[channel];
- List<Struct> structs = new ArrayList(2);
- while (dec.hasRemaining())
- {
- structs.add(dec.readStruct32());
- }
- command.setHeader(new Header(structs));
- if (frame.isLastSegment())
- {
- incomplete[channel] = null;
- emit(channel, command);
- }
- break;
- case BODY:
- command = incomplete[channel];
- command.setBody(segment);
- incomplete[channel] = null;
- emit(channel, command);
- break;
- default:
- throw new IllegalStateException("unknown frame type: " + frame.getType());
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ConnectionBinding.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ConnectionBinding.java
deleted file mode 100644
index 8a2aba2e6d..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ConnectionBinding.java
+++ /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.
- *
- */
-package org.apache.qpid.transport.network;
-
-import java.nio.ByteBuffer;
-
-import org.apache.qpid.transport.Binding;
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.ConnectionDelegate;
-import org.apache.qpid.transport.Receiver;
-import org.apache.qpid.transport.Sender;
-
-/**
- * ConnectionBinding
- *
- */
-
-public abstract class ConnectionBinding
- implements Binding<Connection,ByteBuffer>
-{
-
- public static Binding<Connection,ByteBuffer> get(final Connection connection)
- {
- return new ConnectionBinding()
- {
- public Connection connection()
- {
- return connection;
- }
- };
- }
-
- public static Binding<Connection,ByteBuffer> get(final ConnectionDelegate delegate)
- {
- return new ConnectionBinding()
- {
- public Connection connection()
- {
- Connection conn = new Connection();
- conn.setConnectionDelegate(delegate);
- return conn;
- }
- };
- }
-
- public static final int MAX_FRAME_SIZE = 64 * 1024 - 1;
-
- public abstract Connection connection();
-
- public Connection endpoint(Sender<ByteBuffer> sender)
- {
- Connection conn = connection();
-
- // XXX: hardcoded max-frame
- Disassembler dis = new Disassembler(sender, MAX_FRAME_SIZE);
- conn.setSender(dis);
- return conn;
- }
-
- public Receiver<ByteBuffer> receiver(Connection conn)
- {
- return new InputHandler(new Assembler(conn));
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java
deleted file mode 100644
index 7908700cbe..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Disassembler.java
+++ /dev/null
@@ -1,239 +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.
- *
- */
-package org.apache.qpid.transport.network;
-
-import org.apache.qpid.transport.codec.BBEncoder;
-
-import org.apache.qpid.transport.Header;
-import org.apache.qpid.transport.Method;
-import org.apache.qpid.transport.ProtocolDelegate;
-import org.apache.qpid.transport.ProtocolError;
-import org.apache.qpid.transport.ProtocolEvent;
-import org.apache.qpid.transport.ProtocolHeader;
-import org.apache.qpid.transport.SegmentType;
-import org.apache.qpid.transport.Sender;
-import org.apache.qpid.transport.Struct;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-import static org.apache.qpid.transport.network.Frame.*;
-
-import static java.lang.Math.*;
-
-
-/**
- * Disassembler
- *
- */
-
-public final class Disassembler implements Sender<ProtocolEvent>,
- ProtocolDelegate<Void>
-{
-
- private final Sender<ByteBuffer> sender;
- private final int maxPayload;
- private final ByteBuffer header;
- private final Object sendlock = new Object();
- private final ThreadLocal<BBEncoder> encoder = new ThreadLocal()
- {
- public BBEncoder initialValue()
- {
- return new BBEncoder(4*1024);
- }
- };
-
- public Disassembler(Sender<ByteBuffer> sender, int maxFrame)
- {
- if (maxFrame <= HEADER_SIZE || maxFrame >= 64*1024)
- {
- throw new IllegalArgumentException
- ("maxFrame must be > HEADER_SIZE and < 64K: " + maxFrame);
- }
- this.sender = sender;
- this.maxPayload = maxFrame - HEADER_SIZE;
- this.header = ByteBuffer.allocate(HEADER_SIZE);
- this.header.order(ByteOrder.BIG_ENDIAN);
-
- }
-
- public void send(ProtocolEvent event)
- {
- event.delegate(null, this);
- }
-
- public void flush()
- {
- synchronized (sendlock)
- {
- sender.flush();
- }
- }
-
- public void close()
- {
- synchronized (sendlock)
- {
- sender.close();
- }
- }
-
- private final void frame(byte flags, byte type, byte track, int channel, int size, ByteBuffer buf)
- {
- synchronized (sendlock)
- {
- header.put(0, flags);
- header.put(1, type);
- header.putShort(2, (short) (size + HEADER_SIZE));
- header.put(5, track);
- header.putShort(6, (short) channel);
-
- header.rewind();
-
- sender.send(header);
-
- int limit = buf.limit();
- buf.limit(buf.position() + size);
- sender.send(buf);
- buf.limit(limit);
- }
- }
-
- private void fragment(byte flags, SegmentType type, ProtocolEvent event,
- ByteBuffer buf)
- {
- byte typeb = (byte) type.getValue();
- byte track = event.getEncodedTrack() == Frame.L4 ? (byte) 1 : (byte) 0;
-
- int remaining = buf.remaining();
- boolean first = true;
- while (true)
- {
- int size = min(maxPayload, remaining);
- remaining -= size;
-
- byte newflags = flags;
- if (first)
- {
- newflags |= FIRST_FRAME;
- first = false;
- }
- if (remaining == 0)
- {
- newflags |= LAST_FRAME;
- }
-
- frame(newflags, typeb, track, event.getChannel(), size, buf);
-
- if (remaining == 0)
- {
- break;
- }
- }
- }
-
- public void init(Void v, ProtocolHeader header)
- {
- synchronized (sendlock)
- {
- sender.send(header.toByteBuffer());
- sender.flush();
- }
- }
-
- public void control(Void v, Method method)
- {
- method(method, SegmentType.CONTROL);
- }
-
- public void command(Void v, Method method)
- {
- method(method, SegmentType.COMMAND);
- }
-
- private ByteBuffer copy(ByteBuffer src)
- {
- ByteBuffer buf = ByteBuffer.allocate(src.remaining());
- buf.put(src);
- buf.flip();
- return buf;
- }
-
- private void method(Method method, SegmentType type)
- {
- BBEncoder enc = encoder.get();
- enc.init();
- enc.writeUint16(method.getEncodedType());
- if (type == SegmentType.COMMAND)
- {
- if (method.isSync())
- {
- enc.writeUint16(0x0101);
- }
- else
- {
- enc.writeUint16(0x0100);
- }
- }
- method.write(enc);
- ByteBuffer methodSeg = enc.segment();
-
- byte flags = FIRST_SEG;
-
- boolean payload = method.hasPayload();
- if (!payload)
- {
- flags |= LAST_SEG;
- }
-
- ByteBuffer headerSeg = null;
- if (payload)
- {
- final Header hdr = method.getHeader();
- if (hdr != null)
- {
- final Struct[] structs = hdr.getStructs();
-
- for (Struct st : structs)
- {
- enc.writeStruct32(st);
- }
- }
- headerSeg = enc.segment();
- }
-
- synchronized (sendlock)
- {
- fragment(flags, type, method, methodSeg);
- if (payload)
- {
- fragment((byte) 0x0, SegmentType.HEADER, method, headerSeg);
- fragment(LAST_SEG, SegmentType.BODY, method, method.getBody());
- }
- }
- }
-
- public void error(Void v, ProtocolError error)
- {
- throw new IllegalArgumentException("" + error);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Frame.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Frame.java
deleted file mode 100644
index 849355276e..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/Frame.java
+++ /dev/null
@@ -1,151 +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.
- *
- */
-package org.apache.qpid.transport.network;
-
-import org.apache.qpid.transport.SegmentType;
-import org.apache.qpid.transport.util.SliceIterator;
-
-import java.nio.ByteBuffer;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Iterator;
-
-import static org.apache.qpid.transport.util.Functions.*;
-
-
-/**
- * Frame
- *
- * @author Rafael H. Schloming
- */
-
-public final class Frame implements NetworkEvent
-{
- public static final int HEADER_SIZE = 12;
-
- // XXX: enums?
- public static final byte L1 = 0;
- public static final byte L2 = 1;
- public static final byte L3 = 2;
- public static final byte L4 = 3;
-
- public static final byte RESERVED = 0x0;
-
- public static final byte VERSION = 0x0;
-
- public static final byte FIRST_SEG = 0x8;
- public static final byte LAST_SEG = 0x4;
- public static final byte FIRST_FRAME = 0x2;
- public static final byte LAST_FRAME = 0x1;
-
- final private byte flags;
- final private SegmentType type;
- final private byte track;
- final private int channel;
- final private ByteBuffer body;
-
- public Frame(byte flags, SegmentType type, byte track, int channel,
- ByteBuffer body)
- {
- this.flags = flags;
- this.type = type;
- this.track = track;
- this.channel = channel;
- this.body = body;
- }
-
- public ByteBuffer getBody()
- {
- return body.slice();
- }
-
- public byte getFlags()
- {
- return flags;
- }
-
- public int getChannel()
- {
- return channel;
- }
-
- public int getSize()
- {
- return body.remaining();
- }
-
- public SegmentType getType()
- {
- return type;
- }
-
- public byte getTrack()
- {
- return track;
- }
-
- private boolean flag(byte mask)
- {
- return (flags & mask) != 0;
- }
-
- public boolean isFirstSegment()
- {
- return flag(FIRST_SEG);
- }
-
- public boolean isLastSegment()
- {
- return flag(LAST_SEG);
- }
-
- public boolean isFirstFrame()
- {
- return flag(FIRST_FRAME);
- }
-
- public boolean isLastFrame()
- {
- return flag(LAST_FRAME);
- }
-
- public void delegate(NetworkDelegate delegate)
- {
- delegate.frame(this);
- }
-
- public String toString()
- {
- StringBuilder str = new StringBuilder();
-
- str.append(String.format
- ("[%05d %05d %1d %s %d%d%d%d] ", getChannel(), getSize(),
- getTrack(), getType(),
- isFirstSegment() ? 1 : 0, isLastSegment() ? 1 : 0,
- isFirstFrame() ? 1 : 0, isLastFrame() ? 1 : 0));
-
- str.append(str(body));
-
- return str.toString();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/InputHandler.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/InputHandler.java
deleted file mode 100644
index 408c95e075..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/InputHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.transport.network;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-
-import org.apache.qpid.transport.ProtocolError;
-import org.apache.qpid.transport.ProtocolHeader;
-import org.apache.qpid.transport.Receiver;
-import org.apache.qpid.transport.SegmentType;
-
-import static org.apache.qpid.transport.util.Functions.*;
-
-import static org.apache.qpid.transport.network.InputHandler.State.*;
-
-
-/**
- * InputHandler
- *
- * @author Rafael H. Schloming
- */
-
-public final class InputHandler implements Receiver<ByteBuffer>
-{
-
- public enum State
- {
- PROTO_HDR,
- FRAME_HDR,
- FRAME_BODY,
- ERROR;
- }
-
- private final Receiver<NetworkEvent> receiver;
- private State state;
- private ByteBuffer input = null;
- private int needed;
-
- private byte flags;
- private SegmentType type;
- private byte track;
- private int channel;
-
- public InputHandler(Receiver<NetworkEvent> receiver, State state)
- {
- this.receiver = receiver;
- this.state = state;
-
- switch (state)
- {
- case PROTO_HDR:
- needed = 8;
- break;
- case FRAME_HDR:
- needed = Frame.HEADER_SIZE;
- break;
- }
- }
-
- public InputHandler(Receiver<NetworkEvent> receiver)
- {
- this(receiver, PROTO_HDR);
- }
-
- private void error(String fmt, Object ... args)
- {
- receiver.received(new ProtocolError(Frame.L1, fmt, args));
- }
-
- public void received(ByteBuffer buf)
- {
- int limit = buf.limit();
- int remaining = buf.remaining();
- while (remaining > 0)
- {
- if (remaining >= needed)
- {
- int consumed = needed;
- int pos = buf.position();
- if (input == null)
- {
- buf.limit(pos + needed);
- input = buf;
- state = next(pos);
- buf.limit(limit);
- buf.position(pos + consumed);
- }
- else
- {
- buf.limit(pos + needed);
- input.put(buf);
- buf.limit(limit);
- input.flip();
- state = next(0);
- }
-
- remaining -= consumed;
- input = null;
- }
- else
- {
- if (input == null)
- {
- input = ByteBuffer.allocate(needed);
- }
- input.put(buf);
- needed -= remaining;
- remaining = 0;
- }
- }
- }
-
- private State next(int pos)
- {
- input.order(ByteOrder.BIG_ENDIAN);
-
- switch (state) {
- case PROTO_HDR:
- if (input.get(pos) != 'A' &&
- input.get(pos + 1) != 'M' &&
- input.get(pos + 2) != 'Q' &&
- input.get(pos + 3) != 'P')
- {
- error("bad protocol header: %s", str(input));
- return ERROR;
- }
-
- byte instance = input.get(pos + 5);
- byte major = input.get(pos + 6);
- byte minor = input.get(pos + 7);
- receiver.received(new ProtocolHeader(instance, major, minor));
- needed = Frame.HEADER_SIZE;
- return FRAME_HDR;
- case FRAME_HDR:
- flags = input.get(pos);
- type = SegmentType.get(input.get(pos + 1));
- int size = (0xFFFF & input.getShort(pos + 2));
- size -= Frame.HEADER_SIZE;
- if (size < 0 || size > (64*1024 - 12))
- {
- error("bad frame size: %d", size);
- return ERROR;
- }
- byte b = input.get(pos + 5);
- if ((b & 0xF0) != 0) {
- error("non-zero reserved bits in upper nibble of " +
- "frame header byte 5: '%x'", b);
- return ERROR;
- } else {
- track = (byte) (b & 0xF);
- }
- channel = (0xFFFF & input.getShort(pos + 6));
- if (size == 0)
- {
- Frame frame = new Frame(flags, type, track, channel, ByteBuffer.allocate(0));
- receiver.received(frame);
- needed = Frame.HEADER_SIZE;
- return FRAME_HDR;
- }
- else
- {
- needed = size;
- return FRAME_BODY;
- }
- case FRAME_BODY:
- Frame frame = new Frame(flags, type, track, channel, input.slice());
- receiver.received(frame);
- needed = Frame.HEADER_SIZE;
- return FRAME_HDR;
- default:
- throw new IllegalStateException();
- }
- }
-
- public void exception(Throwable t)
- {
- receiver.exception(t);
- }
-
- public void closed()
- {
- receiver.closed();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkDelegate.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkDelegate.java
deleted file mode 100644
index fbdfe6e84c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkDelegate.java
+++ /dev/null
@@ -1,42 +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.
- *
- */
-package org.apache.qpid.transport.network;
-
-import org.apache.qpid.transport.ProtocolError;
-import org.apache.qpid.transport.ProtocolHeader;
-
-
-/**
- * NetworkDelegate
- *
- * @author Rafael H. Schloming
- */
-
-public interface NetworkDelegate
-{
-
- void init(ProtocolHeader header);
-
- void frame(Frame frame);
-
- void error(ProtocolError error);
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkEvent.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkEvent.java
deleted file mode 100644
index 91314cd4ad..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/NetworkEvent.java
+++ /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.
- *
- */
-package org.apache.qpid.transport.network;
-
-
-/**
- * NetworkEvent
- *
- */
-
-public interface NetworkEvent
-{
-
- void delegate(NetworkDelegate delegate);
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/InputHandler_0_9.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/InputHandler_0_9.java
deleted file mode 100644
index ecc5f6d07c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/InputHandler_0_9.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package org.apache.qpid.transport.network.io;
-/*
- *
- * 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 java.nio.ByteBuffer;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQFrameDecodingException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.AMQMethodBodyFactory;
-import org.apache.qpid.framing.BodyFactory;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.ContentBodyFactory;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.ContentHeaderBodyFactory;
-import org.apache.qpid.framing.HeartbeatBody;
-import org.apache.qpid.framing.HeartbeatBodyFactory;
-import org.apache.qpid.framing.MethodRegistry;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-import org.apache.qpid.transport.Receiver;
-
-public class InputHandler_0_9 implements Receiver<ByteBuffer>
-{
-
- private AMQVersionAwareProtocolSession _session;
- private MethodRegistry _registry;
- private BodyFactory bodyFactory;
- private static final BodyFactory[] _bodiesSupported = new BodyFactory[Byte.MAX_VALUE];
-
- static
- {
- _bodiesSupported[ContentHeaderBody.TYPE] = ContentHeaderBodyFactory.getInstance();
- _bodiesSupported[ContentBody.TYPE] = ContentBodyFactory.getInstance();
- _bodiesSupported[HeartbeatBody.TYPE] = new HeartbeatBodyFactory();
- }
-
- public InputHandler_0_9(AMQVersionAwareProtocolSession session)
- {
- _session = session;
- _registry = _session.getMethodRegistry();
- }
-
- public void closed()
- {
- // AS FIXME: implement
- }
-
- public void exception(Throwable t)
- {
- // TODO: propogate exception to things
- t.printStackTrace();
- }
-
- public void received(ByteBuffer buf)
- {
- org.apache.mina.common.ByteBuffer in = org.apache.mina.common.ByteBuffer.wrap(buf);
- try
- {
- final byte type = in.get();
- if (type == AMQMethodBody.TYPE)
- {
- bodyFactory = new AMQMethodBodyFactory(_session);
- }
- else
- {
- bodyFactory = _bodiesSupported[type];
- }
-
- if (bodyFactory == null)
- {
- throw new AMQFrameDecodingException(null, "Unsupported frame type: " + type, null);
- }
-
- final int channel = in.getUnsignedShort();
- final long bodySize = in.getUnsignedInt();
-
- // bodySize can be zero
- if ((channel < 0) || (bodySize < 0))
- {
- throw new AMQFrameDecodingException(null, "Undecodable frame: type = " + type + " channel = " + channel
- + " bodySize = " + bodySize, null);
- }
-
- AMQFrame frame = new AMQFrame(in, channel, bodySize, bodyFactory);
-
- byte marker = in.get();
- if ((marker & 0xFF) != 0xCE)
- {
- throw new AMQFrameDecodingException(null, "End of frame marker not found. Read " + marker + " length=" + bodySize
- + " type=" + type, null);
- }
-
- try
- {
- frame.getBodyFrame().handle(frame.getChannel(), _session);
- }
- catch (AMQException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- catch (AMQFrameDecodingException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoAcceptor.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoAcceptor.java
deleted file mode 100644
index 8530240dcc..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoAcceptor.java
+++ /dev/null
@@ -1,92 +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.
- *
- */
-package org.apache.qpid.transport.network.io;
-
-import org.apache.qpid.transport.Binding;
-import org.apache.qpid.transport.TransportException;
-
-import java.io.IOException;
-
-import java.net.InetSocketAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.SocketAddress;
-
-import java.nio.ByteBuffer;
-
-
-/**
- * IoAcceptor
- *
- */
-
-public class IoAcceptor<E> extends Thread
-{
-
-
- private ServerSocket socket;
- private Binding<E,ByteBuffer> binding;
-
- public IoAcceptor(SocketAddress address, Binding<E,ByteBuffer> binding)
- throws IOException
- {
- socket = new ServerSocket();
- socket.setReuseAddress(true);
- socket.bind(address);
- this.binding = binding;
-
- setName(String.format("IoAcceptor - %s", socket.getInetAddress()));
- }
-
- /**
- Close the underlying ServerSocket if it has not already been closed.
- */
- public void close() throws IOException
- {
- if (!socket.isClosed())
- {
- socket.close();
- }
- }
-
- public IoAcceptor(String host, int port, Binding<E,ByteBuffer> binding)
- throws IOException
- {
- this(new InetSocketAddress(host, port), binding);
- }
-
- public void run()
- {
- while (true)
- {
- try
- {
- Socket sock = socket.accept();
- IoTransport<E> transport = new IoTransport<E>(sock, binding,false);
- }
- catch (IOException e)
- {
- throw new TransportException(e);
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java
deleted file mode 100644
index 351d8d24e8..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoReceiver.java
+++ /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.
- *
- */
-package org.apache.qpid.transport.network.io;
-
-import org.apache.qpid.transport.Receiver;
-import org.apache.qpid.transport.TransportException;
-import org.apache.qpid.transport.util.Logger;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.Socket;
-import java.net.SocketException;
-import java.nio.ByteBuffer;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * IoReceiver
- *
- */
-
-final class IoReceiver extends Thread
-{
-
- private static final Logger log = Logger.get(IoReceiver.class);
-
- private final IoTransport transport;
- private final Receiver<ByteBuffer> receiver;
- private final int bufferSize;
- private final Socket socket;
- private final long timeout;
- private final AtomicBoolean closed = new AtomicBoolean(false);
- private final boolean shutdownBroken =
- ((String) System.getProperties().get("os.name")).matches("(?i).*windows.*");
-
- public IoReceiver(IoTransport transport, Receiver<ByteBuffer> receiver,
- int bufferSize, long timeout)
- {
- this.transport = transport;
- this.receiver = receiver;
- this.bufferSize = bufferSize;
- this.socket = transport.getSocket();
- this.timeout = timeout;
-
- setDaemon(true);
- setName(String.format("IoReceiver - %s", socket.getRemoteSocketAddress()));
- start();
- }
-
- void close(boolean block)
- {
- if (!closed.getAndSet(true))
- {
- try
- {
- if (shutdownBroken)
- {
- socket.close();
- }
- else
- {
- socket.shutdownInput();
- }
- if (block && Thread.currentThread() != this)
- {
- join(timeout);
- if (isAlive())
- {
- throw new TransportException("join timed out");
- }
- }
- }
- catch (InterruptedException e)
- {
- throw new TransportException(e);
- }
- catch (IOException e)
- {
- throw new TransportException(e);
- }
- }
- }
-
- public void run()
- {
- final int threshold = bufferSize / 2;
-
- // I set the read buffer size simillar to SO_RCVBUF
- // Haven't tested with a lower value to see if it's better or worse
- byte[] buffer = new byte[bufferSize];
- try
- {
- InputStream in = socket.getInputStream();
- int read = 0;
- int offset = 0;
- while ((read = in.read(buffer, offset, bufferSize-offset)) != -1)
- {
- if (read > 0)
- {
- ByteBuffer b = ByteBuffer.wrap(buffer,offset,read);
- receiver.received(b);
- offset+=read;
- if (offset > threshold)
- {
- offset = 0;
- buffer = new byte[bufferSize];
- }
- }
- }
- socket.close();
- }
- catch (Throwable t)
- {
- if (!(shutdownBroken &&
- t instanceof SocketException &&
- t.getMessage().equalsIgnoreCase("socket closed") &&
- closed.get()))
- {
- receiver.exception(t);
- }
- }
- finally
- {
- receiver.closed();
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java
deleted file mode 100644
index 36ea14856a..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoSender.java
+++ /dev/null
@@ -1,286 +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.
- */
-package org.apache.qpid.transport.network.io;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.nio.ByteBuffer;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.qpid.transport.Sender;
-import org.apache.qpid.transport.SenderException;
-import org.apache.qpid.transport.TransportException;
-import org.apache.qpid.transport.util.Logger;
-
-import static org.apache.qpid.transport.util.Functions.*;
-
-
-public final class IoSender extends Thread implements Sender<ByteBuffer>
-{
-
- private static final Logger log = Logger.get(IoSender.class);
-
- // by starting here, we ensure that we always test the wraparound
- // case, we should probably make this configurable somehow so that
- // we can test other cases as well
- private final static int START = Integer.MAX_VALUE - 10;
-
- private final IoTransport transport;
- private final long timeout;
- private final Socket socket;
- private final OutputStream out;
-
- private final byte[] buffer;
- private volatile int head = START;
- private volatile int tail = START;
- private volatile boolean idle = true;
- private final Object notFull = new Object();
- private final Object notEmpty = new Object();
- private final AtomicBoolean closed = new AtomicBoolean(false);
-
- private volatile Throwable exception = null;
-
-
- public IoSender(IoTransport transport, int bufferSize, long timeout)
- {
- this.transport = transport;
- this.socket = transport.getSocket();
- this.buffer = new byte[pof2(bufferSize)]; // buffer size must be a power of 2
- this.timeout = timeout;
-
- try
- {
- out = socket.getOutputStream();
- }
- catch (IOException e)
- {
- throw new TransportException("Error getting output stream for socket", e);
- }
-
- setDaemon(true);
- setName(String.format("IoSender - %s", socket.getRemoteSocketAddress()));
- start();
- }
-
- private static final int pof2(int n)
- {
- int result = 1;
- while (result < n)
- {
- result *= 2;
- }
- return result;
- }
-
- public void send(ByteBuffer buf)
- {
- if (closed.get())
- {
- throw new SenderException("sender is closed", exception);
- }
-
- final int size = buffer.length;
- int remaining = buf.remaining();
-
- while (remaining > 0)
- {
- final int hd = head;
- final int tl = tail;
-
- if (hd - tl >= size)
- {
- flush();
- synchronized (notFull)
- {
- long start = System.currentTimeMillis();
- long elapsed = 0;
- while (!closed.get() && head - tail >= size && elapsed < timeout)
- {
- try
- {
- notFull.wait(timeout - elapsed);
- }
- catch (InterruptedException e)
- {
- // pass
- }
- elapsed += System.currentTimeMillis() - start;
- }
-
- if (closed.get())
- {
- throw new SenderException("sender is closed", exception);
- }
-
- if (head - tail >= size)
- {
- throw new SenderException(String.format("write timed out: %s, %s", head, tail));
- }
- }
- continue;
- }
-
- final int hd_idx = mod(hd, size);
- final int tl_idx = mod(tl, size);
- final int length;
-
- if (tl_idx > hd_idx)
- {
- length = Math.min(tl_idx - hd_idx, remaining);
- }
- else
- {
- length = Math.min(size - hd_idx, remaining);
- }
-
- buf.get(buffer, hd_idx, length);
- head += length;
- remaining -= length;
- }
- }
-
- public void flush()
- {
- if (idle)
- {
- synchronized (notEmpty)
- {
- notEmpty.notify();
- }
- }
- }
-
- public void close()
- {
- close(true);
- }
-
- void close(boolean reportException)
- {
- if (!closed.getAndSet(true))
- {
- synchronized (notFull)
- {
- notFull.notify();
- }
-
- synchronized (notEmpty)
- {
- notEmpty.notify();
- }
-
- try
- {
- if (Thread.currentThread() != this)
- {
- join(timeout);
- if (isAlive())
- {
- throw new SenderException("join timed out");
- }
- }
- transport.getReceiver().close(false);
- }
- catch (InterruptedException e)
- {
- throw new SenderException(e);
- }
-
- if (reportException && exception != null)
- {
- throw new SenderException(exception);
- }
- }
- }
-
- public void run()
- {
- final int size = buffer.length;
-
- while (true)
- {
- final int hd = head;
- final int tl = tail;
-
- if (hd == tl)
- {
- if (closed.get())
- {
- break;
- }
-
- idle = true;
-
- synchronized (notEmpty)
- {
- while (head == tail && !closed.get())
- {
- try
- {
- notEmpty.wait();
- }
- catch (InterruptedException e)
- {
- // pass
- }
- }
- }
-
- idle = false;
-
- continue;
- }
-
- final int hd_idx = mod(hd, size);
- final int tl_idx = mod(tl, size);
-
- final int length;
- if (tl_idx < hd_idx)
- {
- length = hd_idx - tl_idx;
- }
- else
- {
- length = size - tl_idx;
- }
-
- try
- {
- out.write(buffer, tl_idx, length);
- }
- catch (IOException e)
- {
- log.error(e, "error in write thread");
- exception = e;
- close(false);
- break;
- }
- tail += length;
- if (head - tl >= size)
- {
- synchronized (notFull)
- {
- notFull.notify();
- }
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoTransport.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoTransport.java
deleted file mode 100644
index 3615461e9f..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/io/IoTransport.java
+++ /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.
- */
-
-package org.apache.qpid.transport.network.io;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.Socket;
-import java.net.SocketException;
-import java.nio.ByteBuffer;
-
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLEngine;
-
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-import org.apache.qpid.ssl.SSLContextFactory;
-import org.apache.qpid.transport.Binding;
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.ConnectionDelegate;
-import org.apache.qpid.transport.Receiver;
-import org.apache.qpid.transport.Sender;
-import org.apache.qpid.transport.TransportException;
-import org.apache.qpid.transport.network.ConnectionBinding;
-import org.apache.qpid.transport.network.ssl.SSLReceiver;
-import org.apache.qpid.transport.network.ssl.SSLSender;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * This class provides a socket based transport using the java.io
- * classes.
- *
- * The following params are configurable via JVM arguments
- * TCP_NO_DELAY - amqj.tcpNoDelay
- * SO_RCVBUF - amqj.receiveBufferSize
- * SO_SNDBUF - amqj.sendBufferSize
- */
-public final class IoTransport<E>
-{
-
- static
- {
- org.apache.mina.common.ByteBuffer.setAllocator
- (new org.apache.mina.common.SimpleByteBufferAllocator());
- org.apache.mina.common.ByteBuffer.setUseDirectBuffers
- (Boolean.getBoolean("amqj.enableDirectBuffers"));
- }
-
- private static final Logger log = Logger.get(IoTransport.class);
-
- private static int DEFAULT_READ_WRITE_BUFFER_SIZE = 64 * 1024;
- private static int readBufferSize = Integer.getInteger
- ("amqj.receiveBufferSize", DEFAULT_READ_WRITE_BUFFER_SIZE);
- private static int writeBufferSize = Integer.getInteger
- ("amqj.sendBufferSize", DEFAULT_READ_WRITE_BUFFER_SIZE);
-
- private Socket socket;
- private Sender<ByteBuffer> sender;
- private E endpoint;
- private IoReceiver receiver;
- private long timeout = 60000;
-
- IoTransport(Socket socket, Binding<E,ByteBuffer> binding, boolean ssl)
- {
- this.socket = socket;
-
- if (ssl)
- {
- SSLEngine engine = null;
- SSLContext sslCtx;
- try
- {
- sslCtx = createSSLContext();
- }
- catch (Exception e)
- {
- throw new TransportException("Error creating SSL Context", e);
- }
-
- try
- {
- engine = sslCtx.createSSLEngine();
- engine.setUseClientMode(true);
- }
- catch(Exception e)
- {
- throw new TransportException("Error creating SSL Engine", e);
- }
-
- this.sender = new SSLSender(engine,new IoSender(this, 2*writeBufferSize, timeout));
- this.endpoint = binding.endpoint(sender);
- this.receiver = new IoReceiver(this, new SSLReceiver(engine,binding.receiver(endpoint),(SSLSender)sender),
- 2*readBufferSize, timeout);
- }
- else
- {
- this.sender = new IoSender(this, 2*writeBufferSize, timeout);
- this.endpoint = binding.endpoint(sender);
- this.receiver = new IoReceiver(this, binding.receiver(endpoint),
- 2*readBufferSize, timeout);
- }
- }
-
- Sender<ByteBuffer> getSender()
- {
- return sender;
- }
-
- IoReceiver getReceiver()
- {
- return receiver;
- }
-
- Socket getSocket()
- {
- return socket;
- }
-
- public static final <E> E connect(String host, int port,
- Binding<E,ByteBuffer> binding,
- boolean ssl)
- {
- Socket socket = createSocket(host, port);
- IoTransport<E> transport = new IoTransport<E>(socket, binding,ssl);
- return transport.endpoint;
- }
-
- public static final Connection connect(String host, int port,
- ConnectionDelegate delegate,
- boolean ssl)
- {
- return connect(host, port, ConnectionBinding.get(delegate),ssl);
- }
-
- public static void connect_0_9(AMQVersionAwareProtocolSession session, String host, int port, boolean ssl)
- {
- connect(host, port, new Binding_0_9(session),ssl);
- }
-
- private static class Binding_0_9
- implements Binding<AMQVersionAwareProtocolSession,ByteBuffer>
- {
-
- private AMQVersionAwareProtocolSession session;
-
- Binding_0_9(AMQVersionAwareProtocolSession session)
- {
- this.session = session;
- }
-
- public AMQVersionAwareProtocolSession endpoint(Sender<ByteBuffer> sender)
- {
- session.setSender(sender);
- return session;
- }
-
- public Receiver<ByteBuffer> receiver(AMQVersionAwareProtocolSession ssn)
- {
- return new InputHandler_0_9(ssn);
- }
-
- }
-
- private static Socket createSocket(String host, int port)
- {
- try
- {
- InetAddress address = InetAddress.getByName(host);
- Socket socket = new Socket();
- socket.setReuseAddress(true);
- socket.setTcpNoDelay(Boolean.getBoolean("amqj.tcpNoDelay"));
-
- log.debug("default-SO_RCVBUF : %s", socket.getReceiveBufferSize());
- log.debug("default-SO_SNDBUF : %s", socket.getSendBufferSize());
-
- socket.setSendBufferSize(writeBufferSize);
- socket.setReceiveBufferSize(readBufferSize);
-
- log.debug("new-SO_RCVBUF : %s", socket.getReceiveBufferSize());
- log.debug("new-SO_SNDBUF : %s", socket.getSendBufferSize());
-
- socket.connect(new InetSocketAddress(address, port));
- return socket;
- }
- catch (SocketException e)
- {
- throw new TransportException("Error connecting to broker", e);
- }
- catch (IOException e)
- {
- throw new TransportException("Error connecting to broker", e);
- }
- }
-
- private SSLContext createSSLContext() throws Exception
- {
- String trustStorePath = System.getProperty("javax.net.ssl.trustStore");
- String trustStorePassword = System.getProperty("javax.net.ssl.trustStorePassword");
- String trustStoreCertType = System.getProperty("qpid.ssl.trustStoreCertType","SunX509");
-
- String keyStorePath = System.getProperty("javax.net.ssl.keyStore",trustStorePath);
- String keyStorePassword = System.getProperty("javax.net.ssl.keyStorePassword",trustStorePassword);
- String keyStoreCertType = System.getProperty("qpid.ssl.keyStoreCertType","SunX509");
-
- SSLContextFactory sslContextFactory = new SSLContextFactory(trustStorePath,trustStorePassword,
- trustStoreCertType,keyStorePath,
- keyStorePassword,keyStoreCertType);
-
- return sslContextFactory.buildServerContext();
-
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaHandler.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaHandler.java
deleted file mode 100644
index b89eed48b0..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaHandler.java
+++ /dev/null
@@ -1,274 +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.
- *
- */
-package org.apache.qpid.transport.network.mina;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-
-import org.apache.mina.common.*;
-
-import org.apache.mina.transport.socket.nio.SocketAcceptor;
-import org.apache.mina.transport.socket.nio.SocketSessionConfig;
-import org.apache.mina.transport.socket.nio.SocketConnector;
-import org.apache.mina.filter.ReadThrottleFilterBuilder;
-import org.apache.mina.filter.WriteBufferLimitFilterBuilder;
-import org.apache.mina.filter.executor.ExecutorFilter;
-
-import org.apache.qpid.transport.Binding;
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.ConnectionDelegate;
-import org.apache.qpid.transport.Receiver;
-import org.apache.qpid.transport.Sender;
-import org.apache.qpid.transport.network.ConnectionBinding;
-
-import org.apache.qpid.transport.util.Logger;
-
-import org.apache.qpid.transport.network.Assembler;
-import org.apache.qpid.transport.network.Disassembler;
-import org.apache.qpid.transport.network.InputHandler;
-
-import static org.apache.qpid.transport.util.Functions.*;
-
-/**
- * MinaHandler
- *
- * @author Rafael H. Schloming
- */
-//RA making this public until we sort out the package issues
-public class MinaHandler<E> implements IoHandler
-{
- /** Default buffer size for pending messages reads */
- private static final String DEFAULT_READ_BUFFER_LIMIT = "262144";
- /** Default buffer size for pending messages writes */
- private static final String DEFAULT_WRITE_BUFFER_LIMIT = "262144";
- private static final int MAX_RCVBUF = 64*1024;
-
- private static final Logger log = Logger.get(MinaHandler.class);
-
- static
- {
- ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
- ByteBuffer.setUseDirectBuffers(Boolean.getBoolean("amqj.enableDirectBuffers"));
- }
-
- private final Binding<E,java.nio.ByteBuffer> binding;
-
- private MinaHandler(Binding<E,java.nio.ByteBuffer> binding)
- {
- this.binding = binding;
- }
-
- public void messageReceived(IoSession ssn, Object obj)
- {
- Attachment<E> attachment = (Attachment<E>) ssn.getAttachment();
- ByteBuffer buf = (ByteBuffer) obj;
- try
- {
- attachment.receiver.received(buf.buf());
- }
- catch (Throwable t)
- {
- log.error(t, "exception handling buffer %s", str(buf.buf()));
- throw new RuntimeException(t);
- }
- }
-
- public void messageSent(IoSession ssn, Object obj)
- {
- // do nothing
- }
-
- public void exceptionCaught(IoSession ssn, Throwable e)
- {
- Attachment<E> attachment = (Attachment<E>) ssn.getAttachment();
- attachment.receiver.exception(e);
- }
-
- /**
- * Invoked by MINA when a MINA session for a new connection is created. This method sets up the filter chain on the
- * session, which filters the events handled by this handler. The filter chain consists of, handing off events
- * to an optional protectio
- *
- * @param session The MINA session.
- * @throws Exception Any underlying exceptions are allowed to fall through to MINA.
- */
- public void sessionCreated(IoSession session) throws Exception
- {
- log.debug("Protocol session created for session " + System.identityHashCode(session));
-
- if (Boolean.getBoolean("protectio"))
- {
- try
- {
- //Add IO Protection Filters
- IoFilterChain chain = session.getFilterChain();
-
- session.getFilterChain().addLast("tempExecutorFilterForFilterBuilder", new ExecutorFilter());
-
- ReadThrottleFilterBuilder readfilter = new ReadThrottleFilterBuilder();
- readfilter.setMaximumConnectionBufferSize(
- Integer.parseInt(System.getProperty("qpid.read.buffer.limit", DEFAULT_READ_BUFFER_LIMIT)));
- readfilter.attach(chain);
-
- WriteBufferLimitFilterBuilder writefilter = new WriteBufferLimitFilterBuilder();
- writefilter.setMaximumConnectionBufferSize(
- Integer.parseInt(System.getProperty("qpid.write.buffer.limit", DEFAULT_WRITE_BUFFER_LIMIT)));
- writefilter.attach(chain);
- session.getFilterChain().remove("tempExecutorFilterForFilterBuilder");
-
- log.info("Using IO Read/Write Filter Protection");
- }
- catch (Exception e)
- {
- log.error("Unable to attach IO Read/Write Filter Protection :" + e.getMessage());
- }
- }
- }
-
- public void sessionOpened(final IoSession ssn)
- {
- log.debug("opened: %s", this);
- E endpoint = binding.endpoint(new MinaSender(ssn));
- Attachment<E> attachment =
- new Attachment<E>(endpoint, binding.receiver(endpoint));
-
- // We need to synchronize and notify here because the MINA
- // connect future returns the session prior to the attachment
- // being set. This is arguably a bug in MINA.
- synchronized (ssn)
- {
- ssn.setAttachment(attachment);
- ssn.notifyAll();
- }
- }
-
- public void sessionClosed(IoSession ssn)
- {
- log.debug("closed: %s", ssn);
- Attachment<E> attachment = (Attachment<E>) ssn.getAttachment();
- attachment.receiver.closed();
- ssn.setAttachment(null);
- }
-
- public void sessionIdle(IoSession ssn, IdleStatus status)
- {
- // do nothing
- }
-
- private static class Attachment<E>
- {
-
- E endpoint;
- Receiver<java.nio.ByteBuffer> receiver;
-
- Attachment(E endpoint, Receiver<java.nio.ByteBuffer> receiver)
- {
- this.endpoint = endpoint;
- this.receiver = receiver;
- }
- }
-
- public static final void accept(String host, int port,
- Binding<?,java.nio.ByteBuffer> binding)
- throws IOException
- {
- accept(new InetSocketAddress(host, port), binding);
- }
-
- public static final <E> void accept(SocketAddress address,
- Binding<E,java.nio.ByteBuffer> binding)
- throws IOException
- {
- IoAcceptor acceptor = new SocketAcceptor();
- acceptor.bind(address, new MinaHandler<E>(binding));
- }
-
- public static final <E> E connect(String host, int port,
- Binding<E,java.nio.ByteBuffer> binding)
- {
- return connect(new InetSocketAddress(host, port), binding);
- }
-
- public static final <E> E connect(SocketAddress address,
- Binding<E,java.nio.ByteBuffer> binding)
- {
- MinaHandler<E> handler = new MinaHandler<E>(binding);
- SocketConnector connector = new SocketConnector();
- IoServiceConfig acceptorConfig = connector.getDefaultConfig();
- acceptorConfig.setThreadModel(ThreadModel.MANUAL);
- SocketSessionConfig scfg = (SocketSessionConfig) acceptorConfig.getSessionConfig();
- scfg.setTcpNoDelay(Boolean.getBoolean("amqj.tcpNoDelay"));
- Integer sendBufferSize = Integer.getInteger("amqj.sendBufferSize");
- if (sendBufferSize != null && sendBufferSize > 0)
- {
- scfg.setSendBufferSize(sendBufferSize);
- }
- Integer receiveBufferSize = Integer.getInteger("amqj.receiveBufferSize");
- if (receiveBufferSize != null && receiveBufferSize > 0)
- {
- scfg.setReceiveBufferSize(receiveBufferSize);
- }
- else if (scfg.getReceiveBufferSize() > MAX_RCVBUF)
- {
- scfg.setReceiveBufferSize(MAX_RCVBUF);
- }
- connector.setWorkerTimeout(0);
- ConnectFuture cf = connector.connect(address, handler);
- cf.join();
- IoSession ssn = cf.getSession();
-
- // We need to synchronize and wait here because the MINA
- // connect future returns the session prior to the attachment
- // being set. This is arguably a bug in MINA.
- synchronized (ssn)
- {
- while (ssn.getAttachment() == null)
- {
- try
- {
- ssn.wait();
- }
- catch (InterruptedException e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-
- Attachment<E> attachment = (Attachment<E>) ssn.getAttachment();
- return attachment.endpoint;
- }
-
- public static final void accept(String host, int port,
- ConnectionDelegate delegate)
- throws IOException
- {
- accept(host, port, ConnectionBinding.get(delegate));
- }
-
- public static final Connection connect(String host, int port,
- ConnectionDelegate delegate)
- {
- return connect(host, port, ConnectionBinding.get(delegate));
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaSender.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaSender.java
deleted file mode 100644
index 69d4061e0c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/mina/MinaSender.java
+++ /dev/null
@@ -1,81 +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.
- *
- */
-package org.apache.qpid.transport.network.mina;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.CloseFuture;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.WriteFuture;
-
-import org.apache.qpid.transport.Sender;
-import org.apache.qpid.transport.TransportException;
-
-
-/**
- * MinaSender
- */
-
-public class MinaSender implements Sender<java.nio.ByteBuffer>
-{
- private static final int TIMEOUT = 2 * 60 * 1000;
-
- private final IoSession session;
- private WriteFuture lastWrite = null;
-
- public MinaSender(IoSession session)
- {
- this.session = session;
- }
-
- public void send(java.nio.ByteBuffer buf)
- {
- if (session.isClosing())
- {
- throw new TransportException("attempted to write to a closed socket");
- }
-
- synchronized (this)
- {
- lastWrite = session.write(ByteBuffer.wrap(buf));
- }
- }
-
- public void flush()
- {
- // pass
- }
-
- public synchronized void close()
- {
- // MINA will sometimes throw away in-progress writes when you
- // ask it to close
- synchronized (this)
- {
- if (lastWrite != null)
- {
- lastWrite.join();
- }
- }
- CloseFuture closed = session.close();
- closed.join();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioHandler.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioHandler.java
deleted file mode 100644
index 3bc6730623..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioHandler.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.apache.qpid.transport.network.nio;
-/*
- *
- * 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 java.io.EOFException;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.net.SocketException;
-import java.nio.ByteBuffer;
-import java.nio.channels.SocketChannel;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.ConnectionDelegate;
-import org.apache.qpid.transport.Receiver;
-import org.apache.qpid.transport.network.Assembler;
-import org.apache.qpid.transport.network.Disassembler;
-import org.apache.qpid.transport.network.InputHandler;
-
-public class NioHandler implements Runnable
-{
- private Receiver<ByteBuffer> _receiver;
- private SocketChannel _ch;
- private ByteBuffer _readBuf;
- private static Map<Integer,NioSender> _handlers = new ConcurrentHashMap<Integer,NioSender>();
- private AtomicInteger _count = new AtomicInteger();
-
- private NioHandler(){}
-
- public static final Connection connect(String host, int port,
- ConnectionDelegate delegate)
- {
- NioHandler handler = new NioHandler();
- return handler.connectInternal(host,port,delegate);
- }
-
- private Connection connectInternal(String host, int port,
- ConnectionDelegate delegate)
- {
- try
- {
- SocketAddress address = new InetSocketAddress(host,port);
- _ch = SocketChannel.open();
- _ch.socket().setReuseAddress(true);
- _ch.configureBlocking(true);
- _ch.socket().setTcpNoDelay(true);
- if (address != null)
- {
- _ch.socket().connect(address);
- }
- while (_ch.isConnectionPending())
- {
-
- }
-
- }
- catch (SocketException e)
- {
-
- e.printStackTrace();
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
-
- NioSender sender = new NioSender(_ch);
- Connection con = new Connection();
- con.setSender(new Disassembler(sender, 64*1024 - 1));
- con.setConnectionDelegate(delegate);
-
- con.setConnectionId(_count.incrementAndGet());
- _handlers.put(con.getConnectionId(),sender);
-
- _receiver = new InputHandler(new Assembler(con), InputHandler.State.FRAME_HDR);
-
- Thread t = new Thread(this);
- t.start();
-
- return con;
- }
-
- public void run()
- {
- _readBuf = ByteBuffer.allocate(512);
- long read = 0;
- while(_ch.isConnected() && _ch.isOpen())
- {
- try
- {
- read = _ch.read(_readBuf);
- if (read > 0)
- {
- _readBuf.flip();
- ByteBuffer b = ByteBuffer.allocate(_readBuf.remaining());
- b.put(_readBuf);
- b.flip();
- _readBuf.clear();
- _receiver.received(b);
- }
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
-
- //throw new EOFException("The underlying socket/channel has closed");
- }
-
- public static void startBatchingFrames(int connectionId)
- {
- NioSender sender = _handlers.get(connectionId);
- sender.setStartBatching();
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioSender.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioSender.java
deleted file mode 100644
index 8792fce142..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/nio/NioSender.java
+++ /dev/null
@@ -1,121 +0,0 @@
-package org.apache.qpid.transport.network.nio;
-/*
- *
- * 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 java.nio.ByteBuffer;
-import java.nio.channels.SocketChannel;
-
-import org.apache.qpid.transport.Sender;
-
-public class NioSender implements Sender<java.nio.ByteBuffer>
-{
- private final Object lock = new Object();
- private SocketChannel _ch;
- private boolean _batch = false;
- private ByteBuffer _batcher;
-
- public NioSender(SocketChannel ch)
- {
- this._ch = ch;
- }
-
- public void send(java.nio.ByteBuffer buf)
- {
- if (_batch)
- {
- //System.out.println(_batcher.position() + " , " + buf.remaining() + " , " + buf.position() + ","+_batcher.capacity());
- if (_batcher.position() + buf.remaining() >= _batcher.capacity())
- {
- _batcher.flip();
- write(_batcher);
- _batcher.clear();
- if (buf.remaining() > _batcher.capacity())
- {
- write(buf);
- }
- else
- {
- _batcher.put(buf);
- }
- }
- else
- {
- _batcher.put(buf);
- }
- }
- else
- {
- write(buf);
- }
- }
-
- public void flush()
- {
- // pass
- }
-
- private void write(java.nio.ByteBuffer buf)
- {
- synchronized (lock)
- {
- if( _ch.isConnected() && _ch.isOpen())
- {
- try
- {
- _ch.write(buf);
- }
- catch(Exception e)
- {
- e.fillInStackTrace();
- }
- }
- else
- {
- throw new RuntimeException("Trying to write on a closed socket");
- }
-
- }
- }
-
- public void setStartBatching()
- {
- _batch = true;
- _batcher = ByteBuffer.allocate(1024);
- }
-
- public void close()
- {
- // MINA will sometimes throw away in-progress writes when you
- // ask it to close
- synchronized (lock)
- {
- try
- {
- _ch.close();
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLReceiver.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLReceiver.java
deleted file mode 100644
index a9d2d50c51..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLReceiver.java
+++ /dev/null
@@ -1,179 +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.
- *
- */
-package org.apache.qpid.transport.network.ssl;
-
-import java.nio.ByteBuffer;
-
-import javax.net.ssl.SSLEngine;
-import javax.net.ssl.SSLEngineResult;
-import javax.net.ssl.SSLException;
-import javax.net.ssl.SSLEngineResult.HandshakeStatus;
-import javax.net.ssl.SSLEngineResult.Status;
-
-import org.apache.qpid.transport.Receiver;
-import org.apache.qpid.transport.TransportException;
-import org.apache.qpid.transport.util.Logger;
-
-public class SSLReceiver implements Receiver<ByteBuffer>
-{
- private Receiver<ByteBuffer> delegate;
- private SSLEngine engine;
- private SSLSender sender;
- private int sslBufSize;
- private ByteBuffer appData;
- private ByteBuffer localBuffer;
- private boolean dataCached = false;
- private final Object notificationToken;
-
- private static final Logger log = Logger.get(SSLReceiver.class);
-
- public SSLReceiver(SSLEngine engine, Receiver<ByteBuffer> delegate,SSLSender sender)
- {
- this.engine = engine;
- this.delegate = delegate;
- this.sender = sender;
- this.sslBufSize = engine.getSession().getApplicationBufferSize();
- appData = ByteBuffer.allocate(sslBufSize);
- localBuffer = ByteBuffer.allocate(sslBufSize);
- notificationToken = sender.getNotificationToken();
- }
-
- public void closed()
- {
- delegate.closed();
- }
-
- public void exception(Throwable t)
- {
- delegate.exception(t);
- }
-
- private ByteBuffer addPreviouslyUnreadData(ByteBuffer buf)
- {
- if (dataCached)
- {
- ByteBuffer b = ByteBuffer.allocate(localBuffer.remaining() + buf.remaining());
- b.put(localBuffer);
- b.put(buf);
- b.flip();
- dataCached = false;
- return b;
- }
- else
- {
- return buf;
- }
- }
-
- public void received(ByteBuffer buf)
- {
- ByteBuffer netData = addPreviouslyUnreadData(buf);
-
- HandshakeStatus handshakeStatus;
- Status status;
-
- while (netData.hasRemaining())
- {
- try
- {
- SSLEngineResult result = engine.unwrap(netData, appData);
- int read = result.bytesProduced();
- status = result.getStatus();
- handshakeStatus = result.getHandshakeStatus();
-
- if (read > 0)
- {
- int limit = appData.limit();
- appData.limit(appData.position());
- appData.position(appData.position() - read);
-
- ByteBuffer data = appData.slice();
-
- appData.limit(limit);
- appData.position(appData.position() + read);
-
- delegate.received(data);
- }
-
-
- switch(status)
- {
- case CLOSED:
- synchronized(notificationToken)
- {
- notificationToken.notifyAll();
- }
- return;
-
- case BUFFER_OVERFLOW:
- appData = ByteBuffer.allocate(sslBufSize);
- continue;
-
- case BUFFER_UNDERFLOW:
- localBuffer.clear();
- localBuffer.put(netData);
- localBuffer.flip();
- dataCached = true;
- break;
-
- case OK:
- break; // do nothing
-
- default:
- throw new IllegalStateException("SSLReceiver: Invalid State " + status);
- }
-
- switch (handshakeStatus)
- {
- case NEED_UNWRAP:
- if (netData.hasRemaining())
- {
- continue;
- }
- break;
-
- case NEED_TASK:
- sender.doTasks();
- handshakeStatus = engine.getHandshakeStatus();
-
- case NEED_WRAP:
- case FINISHED:
- case NOT_HANDSHAKING:
- synchronized(notificationToken)
- {
- notificationToken.notifyAll();
- }
- break;
-
- default:
- throw new IllegalStateException("SSLReceiver: Invalid State " + status);
- }
-
-
- }
- catch(SSLException e)
- {
- throw new TransportException("Error in SSLReceiver",e);
- }
-
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java
deleted file mode 100644
index f5bd18d848..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/network/ssl/SSLSender.java
+++ /dev/null
@@ -1,197 +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.
- *
- */
-package org.apache.qpid.transport.network.ssl;
-
-import java.nio.ByteBuffer;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import javax.net.ssl.SSLEngine;
-import javax.net.ssl.SSLEngineResult;
-import javax.net.ssl.SSLException;
-import javax.net.ssl.SSLEngineResult.HandshakeStatus;
-import javax.net.ssl.SSLEngineResult.Status;
-
-import org.apache.qpid.transport.Sender;
-import org.apache.qpid.transport.SenderException;
-import org.apache.qpid.transport.util.Logger;
-
-public class SSLSender implements Sender<ByteBuffer>
-{
- private Sender<ByteBuffer> delegate;
- private SSLEngine engine;
- private int sslBufSize;
- private ByteBuffer netData;
-
- private final Object engineState = new Object();
- private final AtomicBoolean closed = new AtomicBoolean(false);
-
- private static final Logger log = Logger.get(SSLSender.class);
-
- public SSLSender(SSLEngine engine, Sender<ByteBuffer> delegate)
- {
- this.engine = engine;
- this.delegate = delegate;
- sslBufSize = engine.getSession().getPacketBufferSize();
- netData = ByteBuffer.allocate(sslBufSize);
- }
-
- public void close()
- {
- if (!closed.getAndSet(true))
- {
- if (engine.isOutboundDone())
- {
- return;
- }
- log.debug("Closing SSL connection");
- engine.closeOutbound();
- send(ByteBuffer.allocate(0));
- flush();
- while (!engine.isOutboundDone())
- {
- synchronized(engineState)
- {
- try
- {
- engineState.wait();
- }
- catch(InterruptedException e)
- {
- // pass
- }
- }
- }
- delegate.close();
- }
- }
-
- public void flush()
- {
- delegate.flush();
- }
-
- public void send(ByteBuffer appData)
- {
- if (closed.get())
- {
- throw new SenderException("SSL Sender is closed");
- }
-
- HandshakeStatus handshakeStatus;
- Status status;
-
- while(appData.hasRemaining())
- {
-
- int read = 0;
- try
- {
- SSLEngineResult result = engine.wrap(appData, netData);
- read = result.bytesProduced();
- status = result.getStatus();
- handshakeStatus = result.getHandshakeStatus();
-
- }
- catch(SSLException e)
- {
- throw new SenderException("SSL, Error occurred while encrypting data",e);
- }
-
- if(read > 0)
- {
- int limit = netData.limit();
- netData.limit(netData.position());
- netData.position(netData.position() - read);
-
- ByteBuffer data = netData.slice();
-
- netData.limit(limit);
- netData.position(netData.position() + read);
-
- delegate.send(data);
- }
-
- switch(status)
- {
- case CLOSED:
- throw new SenderException("SSLEngine is closed");
-
- case BUFFER_OVERFLOW:
- netData.clear();
- continue;
-
- case OK:
- break; // do nothing
-
- default:
- throw new IllegalStateException("SSLReceiver: Invalid State " + status);
- }
-
- switch (handshakeStatus)
- {
- case NEED_WRAP:
- if (netData.hasRemaining())
- {
- continue;
- }
-
- case NEED_TASK:
- doTasks();
- break;
-
- case NEED_UNWRAP:
- flush();
- synchronized(engineState)
- {
- try
- {
- engineState.wait();
- }
- catch(InterruptedException e)
- {
- // pass
- }
- }
- break;
-
- case FINISHED:
- case NOT_HANDSHAKING:
- break; //do nothing
-
- default:
- throw new IllegalStateException("SSLReceiver: Invalid State " + status);
- }
-
- }
- }
-
- public void doTasks()
- {
- Runnable runnable;
- while ((runnable = engine.getDelegatedTask()) != null) {
- runnable.run();
- }
- }
-
- public Object getNotificationToken()
- {
- return engineState;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java
deleted file mode 100644
index c220694b50..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Functions.java
+++ /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.
- *
- */
-package org.apache.qpid.transport.util;
-
-import java.nio.ByteBuffer;
-
-import static java.lang.Math.*;
-
-
-/**
- * Functions
- *
- * @author Rafael H. Schloming
- */
-
-public class Functions
-{
-
- public static final int mod(int n, int m)
- {
- int r = n % m;
- return r < 0 ? m + r : r;
- }
-
- public static final byte lsb(int i)
- {
- return (byte) (0xFF & i);
- }
-
- public static final byte lsb(long l)
- {
- return (byte) (0xFF & l);
- }
-
- public static final String str(ByteBuffer buf)
- {
- return str(buf, buf.remaining());
- }
-
- public static final String str(ByteBuffer buf, int limit)
- {
- StringBuilder str = new StringBuilder();
- str.append('"');
-
- for (int i = 0; i < min(buf.remaining(), limit); i++)
- {
- byte c = buf.get(buf.position() + i);
-
- if (c > 31 && c < 127 && c != '\\')
- {
- str.append((char)c);
- }
- else
- {
- str.append(String.format("\\x%02x", c));
- }
- }
-
- str.append('"');
-
- if (limit < buf.remaining())
- {
- str.append("...");
- }
-
- return str.toString();
- }
-
- public static final String str(byte[] bytes)
- {
- return str(ByteBuffer.wrap(bytes));
- }
-
- public static final String str(byte[] bytes, int limit)
- {
- return str(ByteBuffer.wrap(bytes), limit);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Logger.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Logger.java
deleted file mode 100644
index 8c4818df92..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Logger.java
+++ /dev/null
@@ -1,130 +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.
- *
- */
-package org.apache.qpid.transport.util;
-
-import org.slf4j.LoggerFactory;
-
-/**
- * Logger
- *
- */
-
-public final class Logger
-{
-
- public static final Logger get(Class<?> klass)
- {
- return new Logger(LoggerFactory.getLogger(klass));
- }
-
- private final org.slf4j.Logger log;
-
- private Logger(org.slf4j.Logger log)
- {
- this.log = log;
- }
-
- public boolean isDebugEnabled()
- {
- return log.isDebugEnabled();
- }
-
- public void debug(String message, Object ... args)
- {
- if (log.isDebugEnabled())
- {
- log.debug(String.format(message, args));
- }
- }
-
- public void debug(Throwable t, String message, Object ... args)
- {
- if (log.isDebugEnabled())
- {
- log.debug(String.format(message, args), t);
- }
- }
-
- public void error(String message, Object ... args)
- {
- if (log.isErrorEnabled())
- {
- log.error(String.format(message, args));
- }
- }
-
- public void error(Throwable t, String message, Object ... args)
- {
- if (log.isErrorEnabled())
- {
- log.error(String.format(message, args), t);
- }
- }
-
- public void warn(String message, Object ... args)
- {
- if (log.isWarnEnabled())
- {
- log.warn(String.format(message, args));
- }
- }
-
- public void warn(Throwable t, String message, Object ... args)
- {
- if (log.isWarnEnabled())
- {
- log.warn(String.format(message, args), t);
- }
- }
-
- public void info(String message, Object ... args)
- {
- if (log.isInfoEnabled())
- {
- log.info(String.format(message, args));
- }
- }
-
- public void info(Throwable t, String message, Object ... args)
- {
- if (log.isInfoEnabled())
- {
- log.info(String.format(message, args), t);
- }
- }
-
- public void trace(String message, Object ... args)
- {
- if (log.isTraceEnabled())
- {
- log.trace(String.format(message, args));
- }
- }
-
- public void trace(Throwable t, String message, Object ... args)
- {
- if (log.isTraceEnabled())
- {
- log.trace(String.format(message, args), t);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/SliceIterator.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/SliceIterator.java
deleted file mode 100644
index 3db29847b2..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/SliceIterator.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-package org.apache.qpid.transport.util;
-
-import java.nio.ByteBuffer;
-
-import java.util.Iterator;
-
-
-/**
- * SliceIterator
- *
- * @author Rafael H. Schloming
- */
-
-public class SliceIterator implements Iterator<ByteBuffer>
-{
-
- final private Iterator<ByteBuffer> iterator;
-
- public SliceIterator(Iterator<ByteBuffer> iterator)
- {
- this.iterator = iterator;
- }
-
- public boolean hasNext()
- {
- return iterator.hasNext();
- }
-
- public ByteBuffer next()
- {
- return iterator.next().slice();
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Waiter.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Waiter.java
deleted file mode 100644
index e034d779ca..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/transport/util/Waiter.java
+++ /dev/null
@@ -1,63 +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.
- *
- */
-package org.apache.qpid.transport.util;
-
-
-/**
- * Waiter
- *
- */
-
-public final class Waiter
-{
-
- private final Object lock;
- private final long timeout;
- private final long start;
- private long elapsed;
-
- public Waiter(Object lock, long timeout)
- {
- this.lock = lock;
- this.timeout = timeout;
- this.start = System.currentTimeMillis();
- this.elapsed = 0;
- }
-
- public boolean hasTime()
- {
- return elapsed < timeout;
- }
-
- public void await()
- {
- try
- {
- lock.wait(timeout - elapsed);
- }
- catch (InterruptedException e)
- {
- // pass
- }
- elapsed = System.currentTimeMillis() - start;
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java
deleted file mode 100644
index 998242925c..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java
+++ /dev/null
@@ -1,236 +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.
- *
- */
-package org.apache.qpid.url;
-
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class AMQBindingURL implements BindingURL
-{
- private static final Logger _logger = LoggerFactory.getLogger(AMQBindingURL.class);
-
- String _url;
- AMQShortString _exchangeClass = ExchangeDefaults.DIRECT_EXCHANGE_CLASS;
- AMQShortString _exchangeName = new AMQShortString("");
- AMQShortString _destinationName = new AMQShortString("");;
- AMQShortString _queueName = new AMQShortString("");
- AMQShortString[] _bindingKeys = new AMQShortString[0];
- private HashMap<String, String> _options;
-
- public AMQBindingURL(String url) throws URISyntaxException
- {
- // format:
- // <exch_class>://<exch_name>/[<destination>]/[<queue>]?<option>='<value>'[,<option>='<value>']*
- _logger.debug("Parsing URL: " + url);
- _url = url;
- _options = new HashMap<String, String>();
-
- parseBindingURL();
- }
-
- private void parseBindingURL() throws URISyntaxException
- {
- BindingURLParser parser = new BindingURLParser(_url,this);
- processOptions();
- _logger.debug("URL Parsed: " + this);
- }
-
- public void setExchangeClass(String exchangeClass)
- {
- setExchangeClass(new AMQShortString(exchangeClass));
- }
-
- public void setQueueName(String name)
- {
- setQueueName(new AMQShortString(name));
- }
-
- public void setDestinationName(String name)
- {
- setDestinationName(new AMQShortString(name));
- }
-
- public void setExchangeName(String exchangeName)
- {
- setExchangeName(new AMQShortString(exchangeName));
- }
-
- private void processOptions() throws URISyntaxException
- {
- }
-
- public String getURL()
- {
- return _url;
- }
-
- public AMQShortString getExchangeClass()
- {
- return _exchangeClass;
- }
-
- private void setExchangeClass(AMQShortString exchangeClass)
- {
-
- _exchangeClass = exchangeClass;
- if (exchangeClass.equals(ExchangeDefaults.TOPIC_EXCHANGE_CLASS))
- {
- setOption(BindingURL.OPTION_EXCLUSIVE, "true");
- }
-
- }
-
- public AMQShortString getExchangeName()
- {
- return _exchangeName;
- }
-
- private void setExchangeName(AMQShortString name)
- {
- _exchangeName = name;
- }
-
- public AMQShortString getDestinationName()
- {
- return _destinationName;
- }
-
- private void setDestinationName(AMQShortString name)
- {
- _destinationName = name;
- }
-
- public AMQShortString getQueueName()
- {
- return _queueName;
- }
-
- public void setQueueName(AMQShortString name)
- {
- _queueName = name;
- }
-
- public String getOption(String key)
- {
- return _options.get(key);
- }
-
- public void setOption(String key, String value)
- {
- _options.put(key, value);
- }
-
- public boolean containsOption(String key)
- {
- return _options.containsKey(key);
- }
-
- public AMQShortString getRoutingKey()
- {
- if (_exchangeClass.equals(ExchangeDefaults.DIRECT_EXCHANGE_CLASS))
- {
- if (containsOption(BindingURL.OPTION_ROUTING_KEY))
- {
- return new AMQShortString((String)getOption(OPTION_ROUTING_KEY));
- }
- else
- {
- return getQueueName();
- }
- }
-
- if (containsOption(BindingURL.OPTION_ROUTING_KEY))
- {
- return new AMQShortString((String)getOption(OPTION_ROUTING_KEY));
- }
-
- return getDestinationName();
- }
-
- public AMQShortString[] getBindingKeys()
- {
- if (_bindingKeys != null && _bindingKeys.length>0)
- {
- return _bindingKeys;
- }
- else
- {
- return new AMQShortString[]{getRoutingKey()};
- }
- }
-
- public void setBindingKeys(AMQShortString[] keys)
- {
- _bindingKeys = keys;
- }
-
- public void setRoutingKey(AMQShortString key)
- {
- setOption(OPTION_ROUTING_KEY, key.toString());
- }
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
-
- sb.append(_exchangeClass);
- sb.append("://");
- sb.append(_exchangeName);
- sb.append('/');
- sb.append(_destinationName);
- sb.append('/');
- sb.append(_queueName);
-
- sb.append(URLHelper.printOptions(_options));
-
- // temp hack
- if (getRoutingKey() == null || getRoutingKey().toString().equals(""))
- {
-
- if (sb.toString().indexOf("?") == -1)
- {
- sb.append("?");
- }
- else
- {
- sb.append("&");
- }
-
- for (AMQShortString key :_bindingKeys)
- {
- sb.append(BindingURL.OPTION_BINDING_KEY).append("='").append(key.toString()).append("'&");
- }
-
- return sb.toString().substring(0,sb.toString().length()-1);
- }
- else
- {
- return sb.toString();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURL.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURL.java
deleted file mode 100644
index 25450fea64..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURL.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-package org.apache.qpid.url;
-
-import org.apache.qpid.framing.AMQShortString;
-
-/*
- Binding URL format:
- <exch_class>://<exch_name>/[<destination>]/[<queue>]?<option>='<value>'[,<option>='<value>']*
-*/
-public interface BindingURL
-{
- public static final String OPTION_EXCLUSIVE = "exclusive";
- public static final String OPTION_AUTODELETE = "autodelete";
- public static final String OPTION_DURABLE = "durable";
- public static final String OPTION_CLIENTID = "clientid";
- public static final String OPTION_SUBSCRIPTION = "subscription";
- public static final String OPTION_ROUTING_KEY = "routingkey";
- public static final String OPTION_BINDING_KEY = "bindingkey";
-
-
- String getURL();
-
- AMQShortString getExchangeClass();
-
- AMQShortString getExchangeName();
-
- AMQShortString getDestinationName();
-
- AMQShortString getQueueName();
-
- String getOption(String key);
-
- boolean containsOption(String key);
-
- AMQShortString getRoutingKey();
-
- AMQShortString[] getBindingKeys();
-
- String toString();
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java
deleted file mode 100644
index f73ae9c232..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/BindingURLParser.java
+++ /dev/null
@@ -1,466 +0,0 @@
-package org.apache.qpid.url;
-/*
- *
- * 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 java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BindingURLParser
-{
- private static final char PROPERTY_EQUALS_CHAR = '=';
- private static final char PROPERTY_SEPARATOR_CHAR = '&';
- private static final char ALTERNATIVE_PROPERTY_SEPARATOR_CHAR = ',';
- private static final char FORWARD_SLASH_CHAR = '/';
- private static final char QUESTION_MARK_CHAR = '?';
- private static final char SINGLE_QUOTE_CHAR = '\'';
- private static final char COLON_CHAR = ':';
- private static final char END_OF_URL_MARKER_CHAR = '%';
-
- private static final Logger _logger = LoggerFactory.getLogger(BindingURLParser.class);
-
- private char[] _url;
- private AMQBindingURL _bindingURL;
- private BindingURLParserState _currentParserState;
- private String _error;
- private int _index = 0;
- private String _currentPropName;
- private Map<String,Object> _options = new HashMap<String,Object>();
-
- //<exch_class>://<exch_name>/[<destination>]/[<queue>]?<option>='<value>'[,<option>='<value>']*
- public BindingURLParser(String url,AMQBindingURL bindingURL) throws URISyntaxException
- {
- _url = (url + END_OF_URL_MARKER_CHAR).toCharArray();
- _bindingURL = bindingURL;
- _currentParserState = BindingURLParserState.BINDING_URL_START;
- BindingURLParserState prevState = _currentParserState;
-
- try
- {
- while (_currentParserState != BindingURLParserState.ERROR && _currentParserState != BindingURLParserState.BINDING_URL_END)
- {
- prevState = _currentParserState;
- _currentParserState = next();
- }
-
- if (_currentParserState == BindingURLParserState.ERROR)
- {
- _error =
- "Invalid URL format [current_state = " + prevState + ", details parsed so far " + _bindingURL + " ] error at (" + _index + ") due to " + _error;
- _logger.debug(_error);
- URISyntaxException ex;
- ex = new URISyntaxException(markErrorLocation(),"Error occured while parsing URL",_index);
- throw ex;
- }
-
- processOptions();
- }
- catch (ArrayIndexOutOfBoundsException e)
- {
- _error = "Invalid URL format [current_state = " + prevState + ", details parsed so far " + _bindingURL + " ] error at (" + _index + ")";
- URISyntaxException ex = new URISyntaxException(markErrorLocation(),"Error occured while parsing URL",_index);
- ex.initCause(e);
- throw ex;
- }
- }
-
- enum BindingURLParserState
- {
- BINDING_URL_START,
- EXCHANGE_CLASS,
- COLON_CHAR,
- DOUBLE_SEP,
- EXCHANGE_NAME,
- EXCHANGE_SEPERATOR_CHAR,
- DESTINATION,
- DESTINATION_SEPERATOR_CHAR,
- QUEUE_NAME,
- QUESTION_MARK_CHAR,
- PROPERTY_NAME,
- PROPERTY_EQUALS,
- START_PROPERTY_VALUE,
- PROPERTY_VALUE,
- END_PROPERTY_VALUE,
- PROPERTY_SEPARATOR,
- BINDING_URL_END,
- ERROR
- }
-
- /**
- * I am fully ware that there are few optimizations
- * that can speed up things a wee bit. But I have opted
- * for readability and maintainability at the expense of
- * speed, as speed is not a critical factor here.
- *
- * One can understand the full parse logic by just looking at this method.
- */
- private BindingURLParserState next()
- {
- switch (_currentParserState)
- {
- case BINDING_URL_START:
- return extractExchangeClass();
- case COLON_CHAR:
- _index++; //skip ":"
- return BindingURLParserState.DOUBLE_SEP;
- case DOUBLE_SEP:
- _index = _index + 2; //skip "//"
- return BindingURLParserState.EXCHANGE_NAME;
- case EXCHANGE_NAME:
- return extractExchangeName();
- case EXCHANGE_SEPERATOR_CHAR:
- _index++; // skip '/'
- return BindingURLParserState.DESTINATION;
- case DESTINATION:
- return extractDestination();
- case DESTINATION_SEPERATOR_CHAR:
- _index++; // skip '/'
- return BindingURLParserState.QUEUE_NAME;
- case QUEUE_NAME:
- return extractQueueName();
- case QUESTION_MARK_CHAR:
- _index++; // skip '?'
- return BindingURLParserState.PROPERTY_NAME;
- case PROPERTY_NAME:
- return extractPropertyName();
- case PROPERTY_EQUALS:
- _index++; // skip the equal sign
- return BindingURLParserState.START_PROPERTY_VALUE;
- case START_PROPERTY_VALUE:
- _index++; // skip the '\''
- return BindingURLParserState.PROPERTY_VALUE;
- case PROPERTY_VALUE:
- return extractPropertyValue();
- case END_PROPERTY_VALUE:
- _index ++;
- return checkEndOfURL();
- case PROPERTY_SEPARATOR:
- _index++; // skip '&'
- return BindingURLParserState.PROPERTY_NAME;
- default:
- return BindingURLParserState.ERROR;
- }
- }
-
- private BindingURLParserState extractExchangeClass()
- {
- char nextChar = _url[_index];
-
- // check for the following special cases.
- // "myQueue?durable='true'" or just "myQueue";
-
- StringBuilder builder = new StringBuilder();
- while (nextChar != COLON_CHAR && nextChar != QUESTION_MARK_CHAR && nextChar != END_OF_URL_MARKER_CHAR)
- {
- builder.append(nextChar);
- _index++;
- nextChar = _url[_index];
- }
-
- // normal use case
- if (nextChar == COLON_CHAR)
- {
- _bindingURL.setExchangeClass(builder.toString());
- return BindingURLParserState.COLON_CHAR;
- }
- // "myQueue?durable='true'" use case
- else if (nextChar == QUESTION_MARK_CHAR)
- {
- _bindingURL.setExchangeClass(ExchangeDefaults.DIRECT_EXCHANGE_CLASS.asString());
- _bindingURL.setExchangeName("");
- _bindingURL.setQueueName(builder.toString());
- return BindingURLParserState.QUESTION_MARK_CHAR;
- }
- else
- {
- _bindingURL.setExchangeClass(ExchangeDefaults.DIRECT_EXCHANGE_CLASS.asString());
- _bindingURL.setExchangeName("");
- _bindingURL.setQueueName(builder.toString());
- return BindingURLParserState.BINDING_URL_END;
- }
- }
-
- private BindingURLParserState extractExchangeName()
- {
- char nextChar = _url[_index];
- StringBuilder builder = new StringBuilder();
- while (nextChar != FORWARD_SLASH_CHAR)
- {
- builder.append(nextChar);
- _index++;
- nextChar = _url[_index];
- }
-
- _bindingURL.setExchangeName(builder.toString());
- return BindingURLParserState.EXCHANGE_SEPERATOR_CHAR;
- }
-
- private BindingURLParserState extractDestination()
- {
- char nextChar = _url[_index];
-
- //The destination is and queue name are both optional
- // This is checking for the case where both are not specified.
- if (nextChar == QUESTION_MARK_CHAR)
- {
- return BindingURLParserState.QUESTION_MARK_CHAR;
- }
-
- StringBuilder builder = new StringBuilder();
- while (nextChar != FORWARD_SLASH_CHAR && nextChar != QUESTION_MARK_CHAR)
- {
- builder.append(nextChar);
- _index++;
- nextChar = _url[_index];
- }
-
- // This is the case where the destination is explictily stated.
- // ex direct://amq.direct/myDest/myQueue?option1='1' ... OR
- // direct://amq.direct//myQueue?option1='1' ...
- if (nextChar == FORWARD_SLASH_CHAR)
- {
- _bindingURL.setDestinationName(builder.toString());
- return BindingURLParserState.DESTINATION_SEPERATOR_CHAR;
- }
- // This is the case where destination is not explictly stated.
- // ex direct://amq.direct/myQueue?option1='1' ...
- else
- {
- _bindingURL.setQueueName(builder.toString());
- return BindingURLParserState.QUESTION_MARK_CHAR;
- }
- }
-
- private BindingURLParserState extractQueueName()
- {
- char nextChar = _url[_index];
- StringBuilder builder = new StringBuilder();
- while (nextChar != QUESTION_MARK_CHAR && nextChar != END_OF_URL_MARKER_CHAR)
- {
- builder.append(nextChar);
- nextChar = _url[++_index];
- }
- _bindingURL.setQueueName(builder.toString());
-
- if(nextChar == QUESTION_MARK_CHAR)
- {
- return BindingURLParserState.QUESTION_MARK_CHAR;
- }
- else
- {
- return BindingURLParserState.BINDING_URL_END;
- }
- }
-
- private BindingURLParserState extractPropertyName()
- {
- StringBuilder builder = new StringBuilder();
- char next = _url[_index];
- while (next != PROPERTY_EQUALS_CHAR)
- {
- builder.append(next);
- next = _url[++_index];
- }
- _currentPropName = builder.toString();
-
- if (_currentPropName.trim().equals(""))
- {
- _error = "Property name cannot be empty";
- return BindingURLParserState.ERROR;
- }
-
- return BindingURLParserState.PROPERTY_EQUALS;
- }
-
- private BindingURLParserState extractPropertyValue()
- {
- StringBuilder builder = new StringBuilder();
- char next = _url[_index];
- while (next != SINGLE_QUOTE_CHAR)
- {
- builder.append(next);
- next = _url[++_index];
- }
- String propValue = builder.toString();
-
- if (propValue.trim().equals(""))
- {
- _error = "Property values cannot be empty";
- return BindingURLParserState.ERROR;
- }
- else
- {
- if (_options.containsKey(_currentPropName))
- {
- Object obj = _options.get(_currentPropName);
- if (obj instanceof List)
- {
- List list = (List)obj;
- list.add(propValue);
- }
- else // it has to be a string
- {
- List<String> list = new ArrayList();
- list.add((String)obj);
- list.add(propValue);
- _options.put(_currentPropName, list);
- }
- }
- else
- {
- _options.put(_currentPropName, propValue);
- }
-
-
- return BindingURLParserState.END_PROPERTY_VALUE;
- }
- }
-
- private BindingURLParserState checkEndOfURL()
- {
- char nextChar = _url[_index];
- if ( nextChar == END_OF_URL_MARKER_CHAR)
- {
- return BindingURLParserState.BINDING_URL_END;
- }
- else if (nextChar == PROPERTY_SEPARATOR_CHAR || nextChar == ALTERNATIVE_PROPERTY_SEPARATOR_CHAR)
- {
- return BindingURLParserState.PROPERTY_SEPARATOR;
- }
- else
- {
- return BindingURLParserState.ERROR;
- }
- }
-
- private String markErrorLocation()
- {
- String tmp = String.valueOf(_url);
- // length -1 to remove ENDOF URL marker
- return tmp.substring(0,_index) + "^" + tmp.substring(_index+1> tmp.length()-1?tmp.length()-1:_index+1,tmp.length()-1);
- }
-
- private void processOptions() throws URISyntaxException
- {
-// check for bindingKey
- if (_options.containsKey(BindingURL.OPTION_BINDING_KEY) && _options.get(BindingURL.OPTION_BINDING_KEY) != null)
- {
- Object obj = _options.get(BindingURL.OPTION_BINDING_KEY);
-
- if (obj instanceof String)
- {
- AMQShortString[] bindingKeys = new AMQShortString[]{new AMQShortString((String)obj)};
- _bindingURL.setBindingKeys(bindingKeys);
- }
- else // it would be a list
- {
- List list = (List)obj;
- AMQShortString[] bindingKeys = new AMQShortString[list.size()];
- int i=0;
- for (Iterator it = list.iterator(); it.hasNext();)
- {
- bindingKeys[i] = new AMQShortString((String)it.next());
- i++;
- }
- _bindingURL.setBindingKeys(bindingKeys);
- }
-
- }
- for (String key: _options.keySet())
- {
- // We want to skip the bindingKey list
- if (_options.get(key) instanceof String)
- {
- _bindingURL.setOption(key, (String)_options.get(key));
- }
- }
-
-
- // check if both a binding key and a routing key is specified.
- if (_options.containsKey(BindingURL.OPTION_BINDING_KEY) && _options.containsKey(BindingURL.OPTION_ROUTING_KEY))
- {
- throw new URISyntaxException(String.valueOf(_url),"It is illegal to specify both a routingKey and a bindingKey in the same URL",-1);
- }
-
- // check for durable subscriptions
- if (_bindingURL.getExchangeClass().equals(ExchangeDefaults.TOPIC_EXCHANGE_CLASS))
- {
- String queueName = null;
- if (Boolean.parseBoolean(_bindingURL.getOption(BindingURL.OPTION_DURABLE)))
- {
- if (_bindingURL.containsOption(BindingURL.OPTION_CLIENTID) && _bindingURL.containsOption(BindingURL.OPTION_SUBSCRIPTION))
- {
- queueName = _bindingURL.getOption(BindingURL.OPTION_CLIENTID + ":" + BindingURL.OPTION_SUBSCRIPTION);
- }
- else
- {
- throw new URISyntaxException(String.valueOf(_url),"Durable subscription must have values for " + BindingURL.OPTION_CLIENTID
- + " and " + BindingURL.OPTION_SUBSCRIPTION , -1);
-
- }
- }
- _bindingURL.setQueueName(queueName);
- }
- }
-
- public static void main(String[] args)
- {
- String[] urls = new String[]
- {
- "topic://amq.topic//myTopic?routingkey='stocks.#'",
- "topic://amq.topic/message_queue?bindingkey='usa.*'&bindingkey='control',exclusive='true'",
- "topic://amq.topic//?bindingKey='usa.*',bindingkey='control',exclusive='true'",
- "direct://amq.direct/dummyDest/myQueue?routingkey='abc.*'",
- "exchange.Class://exchangeName/Destination/Queue",
- "exchangeClass://exchangeName/Destination/?option='value',option2='value2'",
- "IBMPerfQueue1?durable='true'",
- "exchangeClass://exchangeName/Destination/?bindingkey='key1',bindingkey='key2'",
- "exchangeClass://exchangeName/Destination/?bindingkey='key1'&routingkey='key2'"
- };
-
- try
- {
- for (String url: urls)
- {
- System.out.println("URL " + url);
- AMQBindingURL bindingURL = new AMQBindingURL(url);
- BindingURLParser parser = new BindingURLParser(url,bindingURL);
- System.out.println("\nX " + bindingURL.toString() + " \n");
-
- }
-
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java
deleted file mode 100644
index 2d496d2d54..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/URLHelper.java
+++ /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.
- *
- */
-package org.apache.qpid.url;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class URLHelper
-{
- public static char DEFAULT_OPTION_SEPERATOR = '&';
- public static char ALTERNATIVE_OPTION_SEPARATOR = ',';
- public static char BROKER_SEPARATOR = ';';
-
- public static void parseOptions(Map<String, String> optionMap, String options) throws URLSyntaxException
- {
- // options looks like this
- // brokerlist='tcp://host:port?option='value',option='value';vm://:3/virtualpath?option='value'',failover='method?option='value',option='value''
-
- if ((options == null) || (options.indexOf('=') == -1))
- {
- return;
- }
-
- int optionIndex = options.indexOf('=');
-
- String option = options.substring(0, optionIndex);
-
- int length = options.length();
-
- int nestedQuotes = 0;
-
- // to store index of final "'"
- int valueIndex = optionIndex;
-
- // Walk remainder of url.
- while ((nestedQuotes > 0) || (valueIndex < length))
- {
- valueIndex++;
-
- if (valueIndex >= length)
- {
- break;
- }
-
- if (options.charAt(valueIndex) == '\'')
- {
- if ((valueIndex + 1) < options.length())
- {
- if ((options.charAt(valueIndex + 1) == DEFAULT_OPTION_SEPERATOR)
- || (options.charAt(valueIndex + 1) == ALTERNATIVE_OPTION_SEPARATOR)
- || (options.charAt(valueIndex + 1) == BROKER_SEPARATOR)
- || (options.charAt(valueIndex + 1) == '\''))
- {
- nestedQuotes--;
-
- if (nestedQuotes == 0)
- {
- // We've found the value of an option
- break;
- }
- }
- else
- {
- nestedQuotes++;
- }
- }
- else
- {
- // We are at the end of the string
- // Check to see if we are corectly closing quotes
- if (options.charAt(valueIndex) == '\'')
- {
- nestedQuotes--;
- }
-
- break;
- }
- }
- }
-
- if ((nestedQuotes != 0) || (valueIndex < (optionIndex + 2)))
- {
- int sepIndex = 0;
-
- // Try and identify illegal separator character
- if (nestedQuotes > 1)
- {
- for (int i = 0; i < nestedQuotes; i++)
- {
- sepIndex = options.indexOf('\'', sepIndex);
- sepIndex++;
- }
- }
-
- if ((sepIndex >= options.length()) || (sepIndex == 0))
- {
- throw parseError(valueIndex, "Unterminated option", options);
- }
- else
- {
- throw parseError(sepIndex, "Unterminated option. Possible illegal option separator:'"
- + options.charAt(sepIndex) + "'", options);
- }
- }
-
- // optionIndex +2 to skip "='"
- String value = options.substring(optionIndex + 2, valueIndex);
-
- optionMap.put(option, value);
-
- if (valueIndex < (options.length() - 1))
- {
- // Recurse to get remaining options
- parseOptions(optionMap, options.substring(valueIndex + 2));
- }
- }
-
- public static URLSyntaxException parseError(int index, String error, String url)
- {
- return parseError(index, 1, error, url);
- }
-
- public static URLSyntaxException parseError(int index, int length, String error, String url)
- {
- return new URLSyntaxException(url, error, index, length);
- }
-
- public static String printOptions(Map<String, String> options)
- {
- if (options.isEmpty())
- {
- return "";
- }
- else
- {
- StringBuffer sb = new StringBuffer();
- sb.append('?');
- for (String key : options.keySet())
- {
- sb.append(key);
-
- sb.append("='");
-
- sb.append(options.get(key));
-
- sb.append("'");
- sb.append(DEFAULT_OPTION_SEPERATOR);
- }
-
- sb.deleteCharAt(sb.length() - 1);
-
- return sb.toString();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/URLSyntaxException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/URLSyntaxException.java
deleted file mode 100644
index 3ff7195794..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/url/URLSyntaxException.java
+++ /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.
- *
- */
-package org.apache.qpid.url;
-
-import java.net.URISyntaxException;
-
-public class URLSyntaxException extends URISyntaxException
-{
- private int _length;
-
- public URLSyntaxException(String url, String error, int index, int length)
- {
- super(url, error, index);
-
- _length = length;
- }
-
- private static String getPositionString(int index, int length)
- {
- StringBuffer sb = new StringBuffer(index + 1);
-
- for (int i = 0; i < index; i++)
- {
- sb.append(" ");
- }
-
- if (length > -1)
- {
- for (int i = 0; i < length; i++)
- {
- sb.append('^');
- }
- }
-
- return sb.toString();
- }
-
-
- public String toString()
- {
- StringBuffer sb = new StringBuffer();
-
- sb.append(getReason());
-
- if (getIndex() > -1)
- {
- if (_length != -1)
- {
- sb.append(" between indicies ");
- sb.append(getIndex());
- sb.append(" and ");
- sb.append(_length);
- }
- else
- {
- sb.append(" at index ");
- sb.append(getIndex());
- }
- }
-
- sb.append(" ");
- if (getIndex() != -1)
- {
- sb.append("\n");
- }
-
- sb.append(getInput());
-
- if (getIndex() != -1)
- {
- sb.append("\n");
- sb.append(getPositionString(getIndex(), _length));
- }
-
- return sb.toString();
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java
deleted file mode 100644
index baa68f87f9..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java
+++ /dev/null
@@ -1,689 +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.
- *
- */
-package org.apache.qpid.util;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.regex.*;
-
-/**
- * CommandLineParser provides a utility for specifying the format of a command line and parsing command lines to ensure
- * that they fit their specified format. A command line is made up of flags and options, both may be refered to as
- * options. A flag is an option that does not take an argument (specifying it means it has the value 'true' and not
- * specifying it means it has the value 'false'). Options must take arguments but they can be set up with defaults so
- * that they take a default value when not set. Options may be mandatory in wich case it is an error not to specify
- * them on the command line. Flags are never mandatory because they are implicitly set to false when not specified.
- *
- * <p/>Some example command lines are:
- *
- * <ul>
- * <li>This one has two options that expect arguments:
- * <pre>
- * cruisecontrol -configfile cruisecontrol.xml -port 9000
- * </pre>
- * <li>This has one no-arg flag and two 'free' arguments:
- * <pre>
- * zip -r project.zip project/*
- * </pre>
- * <li>This one concatenates multiple flags into a single block with only one '-':
- * <pre>
- * jar -tvf mytar.tar
- * </pre>
- *
- * <p/>The parsing rules are:
- *
- * <ol>
- * <li>Flags may be combined after a single '-' because they never take arguments. Normally such flags are single letter
- * flags but this is only a convention and not enforced. Flags of more than one letter are usually specified on their own.
- * <li>Options expecting arguments must always be on their own.
- * <li>The argument to an option may be seperated from it by whitespace or appended directly onto the option.
- * <li>The argument to an option may never begin with a '-' character.
- * <li>All other arguments not beginning with a '-' character are free arguments that do not belong to any option.
- * <li>The second or later of a set of duplicate or repeated flags are ignored.
- * <li>Options are matched up to the shortest matching option. This is because of the possibility of having no space
- * between an option and its argument. This rules out the possibility of using two options where one is an opening
- * substring of the other. For example, the options "foo" and "foobar" cannot be used on the same command line because
- * it is not possible to distinguish the argument "-foobar" from being the "foobar" option or the "foo" option with
- * the "bar" argument.
- * </ol>
- *
- * <p/>By default, unknown options are simply ignored if specified on the command line. This behaviour may be changed
- * so that the parser reports all unknowns as errors by using the {@link #setErrorsOnUnknowns} method.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Accept a command line specification.
- * <tr><td> Parse a command line into properties, validating it against its specification.
- * <tr><td> Report all errors between a command line and its specification.
- * <tr><td> Provide a formatted usage string for a command line.
- * <tr><td> Provide a formatted options in force string for a command line.
- * <tr><td> Allow errors on unknowns behaviour to be turned on or off.
- * </table>
- */
-public class CommandLineParser
-{
- /** Holds a mapping from command line option names to detailed information about those options. */
- private Map<String, CommandLineOption> optionMap = new HashMap<String, CommandLineOption>();
-
- /** Holds a list of parsing errors. */
- private List<String> parsingErrors = new ArrayList<String>();
-
- /** Holds the regular expression matcher to match command line options with. */
- private Matcher optionMatcher = null;
-
- /** Holds the parsed command line properties after parsing. */
- private Properties parsedProperties = null;
-
- /** Flag used to indicate that errors should be created for unknown options. False by default. */
- private boolean errorsOnUnknowns = false;
-
- /**
- * Creates a command line options parser from a command line specification. This is passed to this constructor
- * as an array of arrays of strings. Each array of strings specifies the command line for a single option. A static
- * array may therefore easily be used to configure the command line parser in a single method call with an easily
- * readable format.
- *
- * <p/>Each array of strings must be 2, 3, 4 or 5 elements long. If any of the last three elements are missing they
- * are assumed to be null. The elements specify the following parameters:
- * <ol>
- * <li>The name of the option without the leading '-'. For example, "file". To specify the format of the 'free'
- * arguments use the option names "1", "2", ... and so on.
- * <li>The option comment. A line of text describing the usage of the option. For example, "The file to be processed."
- * <li>The options argument. This is a very short description of the argument to the option, often a single word
- * or a reminder as to the arguments format. When this element is null the option is a flag and does not
- * accept any arguments. For example, "filename" or "(unix | windows)" or null. The actual text specified
- * is only used to print in the usage message to remind the user of the usage of the option.
- * <li>The mandatory flag. When set to "true" an option must always be specified. Any other value, including null,
- * means that the option is mandatory. Flags are always mandatory (see class javadoc for explanation of why) so
- * this is ignored for flags.
- * <li>A regular expression describing the format that the argument must take. Ignored if null.
- * </ol>
- * <p/>An example call to this constructor is:
- *
- * <pre>
- * CommandLineParser commandLine = new CommandLineParser(
- * new String[][] {{"file", "The file to be processed. ", "filename", "true"},
- * {"dir", "Directory to store results in. Current dir used if not set.", "out dir"},
- * {"os", "Operating system EOL format to use.", "(windows | unix)", null, "windows\|unix"},
- * {"v", "Verbose mode. Prints information about the processing as it goes."},
- * {"1", "The processing command to run.", "command", "true", "add\|remove\|list"}});
- * </pre>
- *
- * @param config The configuration as an array of arrays of strings.
- */
- public CommandLineParser(String[][] config)
- {
- // Loop through all the command line option specifications creating details for each in the options map.
- for (int i = 0; i < config.length; i++)
- {
- String[] nextOptionSpec = config[i];
-
- addOption(nextOptionSpec[0], nextOptionSpec[1], (nextOptionSpec.length > 2) ? nextOptionSpec[2] : null,
- (nextOptionSpec.length > 3) ? ("true".equals(nextOptionSpec[3]) ? true : false) : false,
- (nextOptionSpec.length > 4) ? nextOptionSpec[4] : null);
- }
- }
-
- /**
- * Lists all the parsing errors from the most recent parsing in a string.
- *
- * @return All the parsing errors from the most recent parsing.
- */
- public String getErrors()
- {
- // Return the empty string if there are no errors.
- if (parsingErrors.isEmpty())
- {
- return "";
- }
-
- // Concatenate all the parsing errors together.
- String result = "";
-
- for (String s : parsingErrors)
- {
- result += s;
- }
-
- return result;
- }
-
- /**
- * Lists the properties set from the most recent parsing or an empty string if no parsing has been done yet.
- *
- * @return The properties set from the most recent parsing or an empty string if no parsing has been done yet.
- */
- public String getOptionsInForce()
- {
- // Check if there are no properties to report and return and empty string if so.
- if (parsedProperties == null)
- {
- return "";
- }
-
- // List all the properties.
- String result = "Options in force:\n";
-
- for (Map.Entry<Object, Object> property : parsedProperties.entrySet())
- {
- result += property.getKey() + " = " + property.getValue() + "\n";
- }
-
- return result;
- }
-
- /**
- * Generates a usage string consisting of the name of each option and each options argument description and
- * comment.
- *
- * @return A usage string for all the options.
- */
- public String getUsage()
- {
- String result = "Options:\n";
-
- // Print usage on each of the command line options.
- for (CommandLineOption optionInfo : optionMap.values())
- {
- result +=
- optionInfo.option + " " + ((optionInfo.argument != null) ? (optionInfo.argument + " ") : "")
- + optionInfo.comment + "\n";
- }
-
- return result;
- }
-
- /**
- * Control the behaviour of the errors on unkowns reporting. When turned on this reports all unkowns options
- * as errors. When turned off, all unknowns are simply ignored.
- *
- * @param errors The setting of the errors on unkown flag. True to turn it on.
- */
- public void setErrorsOnUnknowns(boolean errors)
- {
- errorsOnUnknowns = errors;
- }
-
- /**
- * Parses a set of command line arguments into a set of properties, keyed by the argument flag. The free arguments
- * are keyed by integers as strings starting at "1" and then "2", ... and so on.
- *
- * <p/>See the class level comment for a description of the parsing rules.
- *
- * @param args The command line arguments.
- *
- * @return The arguments as a set of properties.
- *
- * @throws IllegalArgumentException If the command line cannot be parsed against its specification. If this exception
- * is thrown a call to {@link #getErrors} will provide a diagnostic of the command
- * line errors.
- */
- public Properties parseCommandLine(String[] args) throws IllegalArgumentException
- {
- Properties options = new Properties();
-
- // Used to keep count of the current 'free' argument.
- int free = 1;
-
- // Used to indicate that the most recently parsed option is expecting arguments.
- boolean expectingArgs = false;
-
- // The option that is expecting arguments from the next element of the command line.
- String optionExpectingArgs = null;
-
- // Used to indicate that the most recently parsed option is a duplicate and should be ignored.
- boolean ignore = false;
-
- // Create the regular expression matcher for the command line options.
- String regexp = "^(";
- int optionsAdded = 0;
-
- for (Iterator<String> i = optionMap.keySet().iterator(); i.hasNext();)
- {
- String nextOption = i.next();
-
- // Check that the option is not a free argument definition.
- boolean notFree = false;
-
- try
- {
- Integer.parseInt(nextOption);
- }
- catch (NumberFormatException e)
- {
- notFree = true;
- }
-
- // Add the option to the regular expression matcher if it is not a free argument definition.
- if (notFree)
- {
- regexp += nextOption + (i.hasNext() ? "|" : "");
- optionsAdded++;
- }
- }
-
- // There has to be more that one option in the regular expression or else the compiler complains that the close
- // cannot be nullable if the '?' token is used to make the matched option string optional.
- regexp += ")" + ((optionsAdded > 0) ? "?" : "") + "(.*)";
- Pattern pattern = Pattern.compile(regexp);
-
- // Loop through all the command line arguments.
- for (int i = 0; i < args.length; i++)
- {
- // Check if the next command line argument begins with a '-' character and is therefore the start of
- // an option.
- if (args[i].startsWith("-"))
- {
- // Extract the value of the option without the leading '-'.
- String arg = args[i].substring(1);
-
- // Match up to the longest matching option.
- optionMatcher = pattern.matcher(arg);
- optionMatcher.matches();
-
- String matchedOption = optionMatcher.group(1);
-
- // Match any argument directly appended onto the longest matching option.
- String matchedArg = optionMatcher.group(2);
-
- // Check that a known option was matched.
- if ((matchedOption != null) && !"".equals(matchedOption))
- {
- // Get the command line option information for the matched option.
- CommandLineOption optionInfo = optionMap.get(matchedOption);
-
- // Check if this option is expecting arguments.
- if (optionInfo.expectsArgs)
- {
- // The option is expecting arguments so swallow the next command line argument as an
- // argument to this option.
- expectingArgs = true;
- optionExpectingArgs = matchedOption;
-
- // In the mean time set this options argument to the empty string in case no argument is ever
- // supplied.
- // options.put(matchedOption, "");
- }
-
- // Check if the option was matched on its own and is a flag in which case set that flag.
- if ("".equals(matchedArg) && !optionInfo.expectsArgs)
- {
- options.put(matchedOption, "true");
- }
- // The option was matched as a substring with its argument appended to it or is a flag that is
- // condensed together with other flags.
- else if (!"".equals(matchedArg))
- {
- // Check if the option is a flag and therefore is allowed to be condensed together
- // with other flags.
- if (!optionInfo.expectsArgs)
- {
- // Set the first matched flag.
- options.put(matchedOption, "true");
-
- // Repeat the longest matching process on the remainder but ensure that the remainder
- // consists only of flags as only flags may be condensed together in this fashion.
- do
- {
- // Match the remainder against the options.
- optionMatcher = pattern.matcher(matchedArg);
- optionMatcher.matches();
-
- matchedOption = optionMatcher.group(1);
- matchedArg = optionMatcher.group(2);
-
- // Check that an option was matched.
- if (matchedOption != null)
- {
- // Get the command line option information for the next matched option.
- optionInfo = optionMap.get(matchedOption);
-
- // Ensure that the next option is a flag or raise an error if not.
- if (optionInfo.expectsArgs == true)
- {
- parsingErrors.add("Option " + matchedOption + " cannot be combined with flags.\n");
- }
-
- options.put(matchedOption, "true");
- }
- // The remainder could not be matched against a flag it is either an unknown flag
- // or an illegal argument to a flag.
- else
- {
- parsingErrors.add("Illegal argument to a flag in the option " + arg + "\n");
-
- break;
- }
- }
- // Continue until the remainder of the argument has all been matched with flags.
- while (!"".equals(matchedArg));
- }
- // The option is expecting an argument, so store the unmatched portion against it
- // as its argument.
- else
- {
- // Check the arguments format is correct against any specified format.
- checkArgumentFormat(optionInfo, matchedArg);
-
- // Store the argument against its option (regardless of its format).
- options.put(matchedOption, matchedArg);
-
- // The argument to this flag has already been supplied to it. Do not swallow the
- // next command line argument as an argument to this flag.
- expectingArgs = false;
- }
- }
- }
- else // No matching option was found.
- {
- // Add this to the list of parsing errors if errors on unkowns is being used.
- if (errorsOnUnknowns)
- {
- parsingErrors.add("Option " + matchedOption + " is not a recognized option.\n");
- }
- }
- }
- // The command line argument did not being with a '-' so it is an argument to the previous flag or it
- // is a free argument.
- else
- {
- // Check if a previous flag is expecting to swallow this next argument as its argument.
- if (expectingArgs)
- {
- // Get the option info for the option waiting for arguments.
- CommandLineOption optionInfo = optionMap.get(optionExpectingArgs);
-
- // Check the arguments format is correct against any specified format.
- checkArgumentFormat(optionInfo, args[i]);
-
- // Store the argument against its option (regardless of its format).
- options.put(optionExpectingArgs, args[i]);
-
- // Clear the expecting args flag now that the argument has been swallowed.
- expectingArgs = false;
- optionExpectingArgs = null;
- }
- // This command line option is not an argument to any option. Add it to the set of 'free' options.
- else
- {
- // Get the option info for the free option, if there is any.
- CommandLineOption optionInfo = optionMap.get(Integer.toString(free));
-
- if (optionInfo != null)
- {
- // Check the arguments format is correct against any specified format.
- checkArgumentFormat(optionInfo, args[i]);
- }
-
- // Add to the list of free options.
- options.put(Integer.toString(free), args[i]);
-
- // Move on to the next free argument.
- free++;
- }
- }
- }
-
- // Scan through all the specified options to check that all mandatory options have been set and that all flags
- // that were not set are set to false in the set of properties.
- for (CommandLineOption optionInfo : optionMap.values())
- {
- // Check if this is a flag.
- if (!optionInfo.expectsArgs)
- {
- // Check if the flag is not set in the properties and set it to false if so.
- if (!options.containsKey(optionInfo.option))
- {
- options.put(optionInfo.option, "false");
- }
- }
- // Check if this is a mandatory option and was not set.
- else if (optionInfo.mandatory && !options.containsKey(optionInfo.option))
- {
- // Create an error for the missing option.
- parsingErrors.add("Option " + optionInfo.option + " is mandatory but not was not specified.\n");
- }
- }
-
- // Check if there were any errors.
- if (!parsingErrors.isEmpty())
- {
- // Throw an illegal argument exception to signify that there were parsing errors.
- throw new IllegalArgumentException();
- }
-
- // Convert any name/value pairs in the free arguments into properties in the parsed options.
- options = takeFreeArgsAsProperties(options, 1);
-
- parsedProperties = options;
-
- return options;
- }
-
- /**
- * If a command line has been parsed, calling this method sets all of its parsed options into the specified properties.
- */
- public void addCommandLineToProperties(Properties properties)
- {
- if (parsedProperties != null)
- {
- for (Object propKey : parsedProperties.keySet())
- {
- String name = (String) propKey;
- String value = parsedProperties.getProperty(name);
-
- properties.setProperty(name, value);
- }
- }
- }
-
- /**
- * Resets this command line parser after it has been used to parse a command line. This method will only need
- * to be called to use this parser a second time which is not likely seeing as a command line is usually only
- * specified once. However, it is exposed as a public method for the rare case where this may be done.
- *
- * <p/>Cleans the internal state of this parser, removing all stored errors and information about the options in
- * force.
- */
- public void reset()
- {
- parsingErrors = new ArrayList<String>();
- parsedProperties = null;
- }
-
- /**
- * Adds the option to list of available command line options.
- *
- * @param option The option to add as an available command line option.
- * @param comment A comment for the option.
- * @param argument The text that appears after the option in the usage string.
- * @param mandatory When true, indicates that this option is mandatory.
- * @param formatRegexp The format that the argument must take, defined as a regular expression.
- */
- protected void addOption(String option, String comment, String argument, boolean mandatory, String formatRegexp)
- {
- // Check if usage text has been set in which case this option is expecting arguments.
- boolean expectsArgs = ((argument == null) || argument.equals("")) ? false : true;
-
- // Add the option to the map of command line options.
- CommandLineOption opt = new CommandLineOption(option, expectsArgs, comment, argument, mandatory, formatRegexp);
- optionMap.put(option, opt);
- }
-
- /**
- * Converts the free arguments into property declarations. After parsing the command line the free arguments
- * are numbered from 1, such that the parsed properties contain values for the keys "1", "2", ... This method
- * converts any free arguments declared using the 'name=value' syntax into properties with key 'name', value
- * 'value'.
- *
- * <p/>For example the comand line:
- * <pre>
- * ... debug=true
- * </pre>
- *
- * <p/>After parsing has properties:
- * <pre>[[1, debug=true]]</pre>
- *
- * <p/>After applying this method the properties are:
- * <pre>[[1, debug=true], [debug, true]]</pre>
- *
- * @param properties The parsed command line properties.
- * @param from The free argument index to convert to properties from.
- *
- * @return The parsed command line properties, with free argument name value pairs too.
- */
- private Properties takeFreeArgsAsProperties(Properties properties, int from)
- {
- for (int i = from; true; i++)
- {
- String nextFreeArg = properties.getProperty(Integer.toString(i));
-
- // Terminate the loop once all free arguments have been consumed.
- if (nextFreeArg == null)
- {
- break;
- }
-
- // Split it on the =, strip any whitespace and set it as a system property.
- String[] nameValuePair = nextFreeArg.split("=");
-
- if (nameValuePair.length == 2)
- {
- properties.setProperty(nameValuePair[0], nameValuePair[1]);
- }
- }
-
- return properties;
- }
-
- /**
- * Checks the format of an argument to an option against its specified regular expression format if one has
- * been set. Any errors are added to the list of parsing errors.
- *
- * @param optionInfo The command line option information for the option which is havings its argument checked.
- * @param matchedArg The string argument to the option.
- */
- private void checkArgumentFormat(CommandLineOption optionInfo, String matchedArg)
- {
- // Check if this option enforces a format for its argument.
- if (optionInfo.argumentFormatRegexp != null)
- {
- Pattern pattern = Pattern.compile(optionInfo.argumentFormatRegexp);
- Matcher argumentMatcher = pattern.matcher(matchedArg);
-
- // Check if the argument does not meet its required format.
- if (!argumentMatcher.matches())
- {
- // Create an error for this badly formed argument.
- parsingErrors.add("The argument to option " + optionInfo.option + " does not meet its required format.\n");
- }
- }
- }
-
- /**
- * Extracts all name=value pairs from the command line, sets them all as system properties and also returns
- * a map of properties containing them.
- *
- * @param args The command line.
- * @param commandLine The command line parser.
- * @param properties The properties object to inject all parsed properties into (optional may be <tt>null</tt>).
- *
- * @return A set of properties containing all name=value pairs from the command line.
- */
- public static Properties processCommandLine(String[] args, CommandLineParser commandLine, Properties properties)
- {
- // Capture the command line arguments or display errors and correct usage and then exit.
- Properties options = null;
-
- try
- {
- options = commandLine.parseCommandLine(args);
-
- // Add all the trailing command line options (name=value pairs) to system properties. They may be picked up
- // from there.
- commandLine.addCommandLineToProperties(properties);
- }
- catch (IllegalArgumentException e)
- {
- System.out.println(commandLine.getErrors());
- System.out.println(commandLine.getUsage());
- System.exit(1);
- }
-
- return options;
- }
-
- /**
- * Holds information about a command line options. This includes what its name is, whether or not it is a flag,
- * whether or not it is mandatory, what its user comment is, what its argument reminder text is and what its
- * regular expression format is.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Hold details of a command line option.
- * </table>
- */
- protected class CommandLineOption
- {
- /** Holds the text for the flag to match this argument with. */
- public String option = null;
-
- /** Holds a string describing how to use this command line argument. */
- public String argument = null;
-
- /** Flag that determines whether or not this command line argument can take arguments. */
- public boolean expectsArgs = false;
-
- /** Holds a short comment describing what this command line argument is for. */
- public String comment = null;
-
- /** Flag that determines whether or not this is an mandatory command line argument. */
- public boolean mandatory = false;
-
- /** A regular expression describing what format the argument to this option muist have. */
- public String argumentFormatRegexp = null;
-
- /**
- * Create a command line option object that holds specific information about a command line option.
- *
- * @param option The text that matches the option.
- * @param expectsArgs Whether or not the option expects arguments. It is a flag if this is false.
- * @param comment A comment explaining how to use this option.
- * @param argument A short reminder of the format of the argument to this option/
- * @param mandatory Set to true if this option is mandatory.
- * @param formatRegexp The regular expression that the argument to this option must meet to be valid.
- */
- public CommandLineOption(String option, boolean expectsArgs, String comment, String argument, boolean mandatory,
- String formatRegexp)
- {
- this.option = option;
- this.expectsArgs = expectsArgs;
- this.comment = comment;
- this.argument = argument;
- this.mandatory = mandatory;
- this.argumentFormatRegexp = formatRegexp;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedMessageQueueAtomicSize.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedMessageQueueAtomicSize.java
deleted file mode 100644
index 633cf4fe3a..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedMessageQueueAtomicSize.java
+++ /dev/null
@@ -1,258 +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.
- *
- *
- */
-package org.apache.qpid.util;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Queue;
-import java.util.concurrent.atomic.AtomicInteger;
-
-public class ConcurrentLinkedMessageQueueAtomicSize<E> extends ConcurrentLinkedQueueAtomicSize<E> implements MessageQueue<E>
-{
- private static final Logger _logger = LoggerFactory.getLogger(ConcurrentLinkedMessageQueueAtomicSize.class);
-
- protected Queue<E> _messageHead = new ConcurrentLinkedQueueAtomicSize<E>();
-
- protected AtomicInteger _messageHeadSize = new AtomicInteger(0);
-
- @Override
- public int size()
- {
- return super.size() + _messageHeadSize.get();
- }
-
- public int headSize()
- {
- return _messageHeadSize.get();
- }
-
- @Override
- public E poll()
- {
- if (_messageHead.isEmpty())
- {
- return super.poll();
- }
- else
- {
- E e = _messageHead.poll();
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Providing item(" + e + ")from message head");
- }
-
- if (e != null)
- {
- _messageHeadSize.decrementAndGet();
- }
-
- return e;
- }
- }
-
- @Override
- public boolean remove(Object o)
- {
-
- if (_messageHead.isEmpty())
- {
- return super.remove(o);
- }
- else
- {
- if (_messageHead.remove(o))
- {
- _messageHeadSize.decrementAndGet();
-
- return true;
- }
-
- return super.remove(o);
- }
- }
-
- @Override
- public boolean removeAll(Collection<?> c)
- {
- if (_messageHead.isEmpty())
- {
- return super.removeAll(c);
- }
- else
- {
- // fixme this is super.removeAll but iterator here doesn't work
- // we need to be able to correctly decrement _messageHeadSize
- // boolean modified = false;
- // Iterator<?> e = iterator();
- // while (e.hasNext())
- // {
- // if (c.contains(e.next()))
- // {
- // e.remove();
- // modified = true;
- // _size.decrementAndGet();
- // }
- // }
- // return modified;
-
- throw new RuntimeException("Not implemented");
- }
- }
-
- @Override
- public boolean isEmpty()
- {
- return (_messageHead.isEmpty() && super.isEmpty());
- }
-
- @Override
- public void clear()
- {
- super.clear();
- _messageHead.clear();
- }
-
- @Override
- public boolean contains(Object o)
- {
- return _messageHead.contains(o) || super.contains(o);
- }
-
- @Override
- public boolean containsAll(Collection<?> o)
- {
- return _messageHead.containsAll(o) || super.containsAll(o);
- }
-
- @Override
- public E element()
- {
- if (_messageHead.isEmpty())
- {
- return super.element();
- }
- else
- {
- return _messageHead.element();
- }
- }
-
- @Override
- public E peek()
- {
- if (_messageHead.isEmpty())
- {
- return super.peek();
- }
- else
- {
- E o = _messageHead.peek();
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Peeking item (" + o + ") from message head");
- }
-
- return o;
- }
-
- }
-
- @Override
- public Iterator<E> iterator()
- {
- final Iterator<E> mainMessageIterator = super.iterator();
-
- return new Iterator<E>()
- {
- final Iterator<E> _headIterator = _messageHead.iterator();
- final Iterator<E> _mainIterator = mainMessageIterator;
-
- Iterator<E> last;
-
- public boolean hasNext()
- {
- return _headIterator.hasNext() || _mainIterator.hasNext();
- }
-
- public E next()
- {
- if (_headIterator.hasNext())
- {
- last = _headIterator;
-
- return _headIterator.next();
- }
- else
- {
- last = _mainIterator;
-
- return _mainIterator.next();
- }
- }
-
- public void remove()
- {
- last.remove();
- if(last == _mainIterator)
- {
- _size.decrementAndGet();
- }
- else
- {
- _messageHeadSize.decrementAndGet();
- }
- }
- };
- }
-
- @Override
- public boolean retainAll(Collection<?> c)
- {
- throw new RuntimeException("Not Implemented");
- }
-
- @Override
- public Object[] toArray()
- {
- throw new RuntimeException("Not Implemented");
- }
-
- public boolean pushHead(E o)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Adding item(" + o + ") to head of queue");
- }
-
- if (_messageHead.offer(o))
- {
- _messageHeadSize.incrementAndGet();
-
- return true;
- }
-
- return false;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueAtomicSize.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueAtomicSize.java
deleted file mode 100644
index c4d7683a02..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueAtomicSize.java
+++ /dev/null
@@ -1,70 +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.
- *
- */
-package org.apache.qpid.util;
-
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.atomic.AtomicInteger;
-
-public class ConcurrentLinkedQueueAtomicSize<E> extends ConcurrentLinkedQueue<E>
-{
- AtomicInteger _size = new AtomicInteger(0);
-
- public int size()
- {
- return _size.get();
- }
-
- public boolean offer(E o)
- {
-
- if (super.offer(o))
- {
- _size.incrementAndGet();
- return true;
- }
-
- return false;
- }
-
- public E poll()
- {
- E e = super.poll();
-
- if (e != null)
- {
- _size.decrementAndGet();
- }
-
- return e;
- }
-
- @Override
- public boolean remove(Object o)
- {
- if (super.remove(o))
- {
- _size.decrementAndGet();
- return true;
- }
-
- return false;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueNoSize.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueNoSize.java
deleted file mode 100644
index 1f168345a1..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueNoSize.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.util;
-
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-public class ConcurrentLinkedQueueNoSize<E> extends ConcurrentLinkedQueue<E>
-{
- public int size()
- {
- if (isEmpty())
- {
- return 0;
- }
- else
- {
- return 1;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java
deleted file mode 100644
index 3e13259ee3..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/FileUtils.java
+++ /dev/null
@@ -1,316 +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.
- *
- */
-package org.apache.qpid.util;
-
-import java.io.*;
-
-/**
- * FileUtils provides some simple helper methods for working with files. It follows the convention of wrapping all
- * checked exceptions as runtimes, so code using these methods is free of try-catch blocks but does not expect to
- * recover from errors.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Read a text file as a string.
- * <tr><td> Open a file or default resource as an input stream.
- * </table>
- */
-public class FileUtils
-{
- /**
- * Reads a text file as a string.
- *
- * @param filename The name of the file.
- *
- * @return The contents of the file.
- */
- public static String readFileAsString(String filename)
- {
- BufferedInputStream is = null;
-
- try{
- try
- {
- is = new BufferedInputStream(new FileInputStream(filename));
- }
- catch (FileNotFoundException e)
- {
- throw new RuntimeException(e);
- }
-
- return readStreamAsString(is);
- }finally {
- if (is != null)
- {
- try
- {
- is.close();
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
- }
- }
-
- /**
- * Reads a text file as a string.
- *
- * @param file The file.
- *
- * @return The contents of the file.
- */
- public static String readFileAsString(File file)
- {
- BufferedInputStream is = null;
-
- try
- {
- is = new BufferedInputStream(new FileInputStream(file));
- }
- catch (FileNotFoundException e)
- {
- throw new RuntimeException(e);
- }
-
- return readStreamAsString(is);
- }
-
- /**
- * Reads the contents of a reader, one line at a time until the end of stream is encountered, and returns all
- * together as a string.
- *
- * @param is The reader.
- *
- * @return The contents of the reader.
- */
- private static String readStreamAsString(BufferedInputStream is)
- {
- try
- {
- byte[] data = new byte[4096];
-
- StringBuffer inBuffer = new StringBuffer();
-
- String line;
- int read;
-
- while ((read = is.read(data)) != -1)
- {
- String s = new String(data, 0, read);
- inBuffer.append(s);
- }
-
- return inBuffer.toString();
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Either opens the specified filename as an input stream, or uses the default resource loaded using the
- * specified class loader, if opening the file fails or no file name is specified.
- *
- * @param filename The name of the file to open.
- * @param defaultResource The name of the default resource on the classpath if the file cannot be opened.
- * @param cl The classloader to load the default resource with.
- *
- * @return An input stream for the file or resource, or null if one could not be opened.
- */
- public static InputStream openFileOrDefaultResource(String filename, String defaultResource, ClassLoader cl)
- {
- InputStream is = null;
-
- // Flag to indicate whether the default resource should be used. By default this is true, so that the default
- // is used when opening the file fails.
- boolean useDefault = true;
-
- // Try to open the file if one was specified.
- if (filename != null)
- {
- try
- {
- is = new BufferedInputStream(new FileInputStream(new File(filename)));
-
- // Clear the default flag because the file was succesfully opened.
- useDefault = false;
- }
- catch (FileNotFoundException e)
- {
- // Ignore this exception, the default will be used instead.
- }
- }
-
- // Load the default resource if a file was not specified, or if opening the file failed.
- if (useDefault)
- {
- is = cl.getResourceAsStream(defaultResource);
- }
-
- return is;
- }
-
- /**
- * Copies the specified source file to the specified destintaion file. If the destinationst file does not exist,
- * it is created.
- *
- * @param src The source file name.
- * @param dst The destination file name.
- */
- public static void copy(File src, File dst)
- {
- try
- {
- InputStream in = new FileInputStream(src);
- if (!dst.exists())
- {
- dst.createNewFile();
- }
-
- OutputStream out = new FileOutputStream(dst);
-
- // Transfer bytes from in to out
- byte[] buf = new byte[1024];
- int len;
- while ((len = in.read(buf)) > 0)
- {
- out.write(buf, 0, len);
- }
-
- in.close();
- out.close();
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /*
- * Deletes a given file
- */
- public static boolean deleteFile(String filePath)
- {
- return delete(new File(filePath), false);
- }
-
- /*
- * Deletes a given empty directory
- */
- public static boolean deleteDirectory(String directoryPath)
- {
- File directory = new File(directoryPath);
-
- if (directory.isDirectory())
- {
- if (directory.listFiles().length == 0)
- {
- return delete(directory, true);
- }
- }
-
- return false;
- }
-
- /**
- * Delete a given file/directory,
- * A directory will always require the recursive flag to be set.
- * if a directory is specified and recursive set then delete the whole tree
- * @param file the File object to start at
- * @param recursive boolean to recurse if a directory is specified.
- * @return <code>true</code> if and only if the file or directory is
- * successfully deleted; <code>false</code> otherwise
- */
- public static boolean delete(File file, boolean recursive)
- {
- boolean success = true;
-
- if (file.isDirectory())
- {
- if (recursive)
- {
- for (File subFile : file.listFiles())
- {
- success = delete(subFile, true) & success ;
- }
-
- return file.delete();
- }
-
- return false;
- }
-
- return success && file.delete();
- }
-
-
- public static class UnableToCopyException extends Exception
- {
- UnableToCopyException(String msg)
- {
- super(msg);
- }
- }
-
- public static void copyRecursive(File source, File dst) throws FileNotFoundException, UnableToCopyException
- {
-
- if (!source.exists())
- {
- throw new FileNotFoundException("Unable to copy '" + source.toString() + "' as it does not exist.");
- }
-
- if (dst.exists() && !dst.isDirectory())
- {
- throw new IllegalArgumentException("Unable to copy '" + source.toString() + "' to '" + dst + "' a file with same name exists.");
- }
-
-
- if (source.isFile())
- {
- copy(source, dst);
- }
-
- //else we have a source directory
- if (!dst.isDirectory() && !dst.mkdir())
- {
- throw new UnableToCopyException("Unable to create destination directory");
- }
-
-
- for (File file : source.listFiles())
- {
- if (file.isFile())
- {
- copy(file, new File(dst.toString() + File.separator + file.getName()));
- }
- else
- {
- copyRecursive(file, new File(dst + File.separator + file.getName()));
- }
- }
-
-
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/MessageQueue.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/MessageQueue.java
deleted file mode 100644
index b5efaa61b6..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/MessageQueue.java
+++ /dev/null
@@ -1,43 +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.
- *
- *
- */
-package org.apache.qpid.util;
-
-import java.util.Queue;
-
-/**
- * Defines a queue that has a push operation to add an element to the head of the queue.
- *
- * @todo Seems like this may be pointless, the implementation uses this method to increment the message count
- * then calls offer. Why not simply override offer and drop this interface?
- */
-public interface MessageQueue<E> extends Queue<E>
-{
- /**
- * Inserts the specified element into this queue, if possible. When using queues that may impose insertion
- * restrictions (for example capacity bounds), method offer is generally preferable to method Collection.add(E),
- * which can fail to insert an element only by throwing an exception.
- *
- * @param o The element to insert.
- *
- * @return <tt>true</tt> if it was possible to add the element to this queue, else <tt>false</tt>
- */
- boolean pushHead(E o);
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/NameUUIDGen.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/NameUUIDGen.java
deleted file mode 100644
index e764c8536b..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/NameUUIDGen.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-package org.apache.qpid.util;
-
-import java.nio.ByteBuffer;
-import java.util.UUID;
-
-
-/**
- * NameUUIDGen
- *
- */
-
-public final class NameUUIDGen implements UUIDGen
-{
-
- private static final int WIDTH = 8;
-
- final private byte[] seed;
- final private ByteBuffer seedBuf;
- private long counter;
-
- public NameUUIDGen()
- {
- String namespace = UUID.randomUUID().toString();
- this.seed = new byte[namespace.length() + WIDTH];
- for (int i = WIDTH; i < seed.length; i++)
- {
- seed[i] = (byte) namespace.charAt(i - WIDTH);
- }
- this.seedBuf = ByteBuffer.wrap(seed);
- this.counter = 0;
- }
-
- public UUID generate()
- {
- seedBuf.putLong(0, counter++);
- return UUID.nameUUIDFromBytes(seed);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/PrettyPrintingUtils.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/PrettyPrintingUtils.java
deleted file mode 100644
index 4677713dc9..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/PrettyPrintingUtils.java
+++ /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.
- *
- */
-package org.apache.qpid.util;
-
-/**
- * Contains pretty printing convenienve methods for producing formatted logging output, mostly for debugging purposes.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * </table>
- *
- * @todo Drop this. There are already array pretty printing methods it java.utils.Arrays.
- */
-public class PrettyPrintingUtils
-{
- /**
- * Pretty prints an array of ints as a string.
- *
- * @param array The array to pretty print.
- *
- * @return The pretty printed string.
- */
- public static String printArray(int[] array)
- {
- String result = "[";
- for (int i = 0; i < array.length; i++)
- {
- result += array[i];
- result += (i < (array.length - 1)) ? ", " : "";
- }
-
- result += "]";
-
- return result;
- }
-
- /**
- * Pretty prints an array of strings as a string.
- *
- * @param array The array to pretty print.
- *
- * @return The pretty printed string.
- */
- public static String printArray(String[] array)
- {
- String result = "[";
- for (int i = 0; i < array.length; i++)
- {
- result += array[i];
- result += (i < (array.length - 1)) ? ", " : "";
- }
-
- result += "]";
-
- return result;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/PropertiesUtils.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/PropertiesUtils.java
deleted file mode 100644
index d90e3b1a17..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/PropertiesUtils.java
+++ /dev/null
@@ -1,200 +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.
- *
- */
-package org.apache.qpid.util;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Properties;
-
-/**
- * PropertiesHelper defines some static methods which are useful when working with properties
- * files.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Read properties from an input stream
- * <tr><td> Read properties from a file
- * <tr><td> Read properties from a URL
- * <tr><td> Read properties given a path to a file
- * <tr><td> Trim any whitespace from property values
- * </table>
- */
-public class PropertiesUtils
-{
- /** Used for logging. */
- private static final Logger log = LoggerFactory.getLogger(PropertiesUtils.class);
-
- /**
- * Get properties from an input stream.
- *
- * @param is The input stream.
- *
- * @return The properties loaded from the input stream.
- *
- * @throws IOException If the is an I/O error reading from the stream.
- */
- public static Properties getProperties(InputStream is) throws IOException
- {
- log.debug("getProperties(InputStream): called");
-
- // Create properties object laoded from input stream
- Properties properties = new Properties();
-
- properties.load(is);
-
- return properties;
- }
-
- /**
- * Get properties from a file.
- *
- * @param file The file.
- *
- * @return The properties loaded from the file.
- *
- * @throws IOException If there is an I/O error reading from the file.
- */
- public static Properties getProperties(File file) throws IOException
- {
- log.debug("getProperties(File): called");
-
- // Open the file as an input stream
- InputStream is = new FileInputStream(file);
-
- // Create properties object loaded from the stream
- Properties properties = getProperties(is);
-
- // Close the file
- is.close();
-
- return properties;
- }
-
- /**
- * Get properties from a url.
- *
- * @param url The URL.
- *
- * @return The properties loaded from the url.
- *
- * @throws IOException If there is an I/O error reading from the URL.
- */
- public static Properties getProperties(URL url) throws IOException
- {
- log.debug("getProperties(URL): called");
-
- // Open the URL as an input stream
- InputStream is = url.openStream();
-
- // Create properties object loaded from the stream
- Properties properties = getProperties(is);
-
- // Close the url
- is.close();
-
- return properties;
- }
-
- /**
- * Get properties from a path name. The path name may refer to either a file or a URL.
- *
- * @param pathname The path name.
- *
- * @return The properties loaded from the file or URL.
- *
- * @throws IOException If there is an I/O error reading from the URL or file named by the path.
- */
- public static Properties getProperties(String pathname) throws IOException
- {
- log.debug("getProperties(String): called");
-
- // Check that the path is not null
- if (pathname == null)
- {
- return null;
- }
-
- // Check if the path is a URL
- if (isURL(pathname))
- {
- // The path is a URL
- return getProperties(new URL(pathname));
- }
- else
- {
- // Assume the path is a file name
- return getProperties(new File(pathname));
- }
- }
-
- /**
- * Trims whitespace from property values. This method returns a new set of properties
- * the same as the properties specified as an argument but with any white space removed by
- * the {@link java.lang.String#trim} method.
- *
- * @param properties The properties to trim whitespace from.
- *
- * @return The white space trimmed properties.
- */
- public static Properties trim(Properties properties)
- {
- Properties trimmedProperties = new Properties();
-
- // Loop over all the properties
- for (Iterator i = properties.keySet().iterator(); i.hasNext();)
- {
- String next = (String) i.next();
- String nextValue = properties.getProperty(next);
-
- // Trim the value if it is not null
- if (nextValue != null)
- {
- nextValue.trim();
- }
-
- // Store the trimmed value in the trimmed properties
- trimmedProperties.setProperty(next, nextValue);
- }
-
- return trimmedProperties;
- }
-
- /**
- * Helper method. Guesses whether a string is a URL or not. A String is considered to be a url if it begins with
- * http:, ftp:, or uucp:.
- *
- * @param name The string to test for being a URL.
- *
- * @return True if the string is a URL and false if not.
- */
- private static boolean isURL(String name)
- {
- return (name.toLowerCase().startsWith("http:") || name.toLowerCase().startsWith("ftp:")
- || name.toLowerCase().startsWith("uucp:"));
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/RandomUUIDGen.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/RandomUUIDGen.java
deleted file mode 100644
index 60b402a105..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/RandomUUIDGen.java
+++ /dev/null
@@ -1,39 +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.
- *
- */
-package org.apache.qpid.util;
-
-import java.util.UUID;
-
-
-/**
- * RandomUUIDGen
- *
- */
-
-public final class RandomUUIDGen implements UUIDGen
-{
-
- public UUID generate()
- {
- return UUID.randomUUID();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/Serial.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/Serial.java
deleted file mode 100644
index 8ad9d00f54..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/Serial.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package org.apache.qpid.util;
-/*
- *
- * 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 java.util.Comparator;
-
-import org.apache.qpid.SerialException;
-
-/**
- * This class provides basic serial number comparisons as defined in
- * RFC 1982.
- */
-
-public class Serial
-{
-
- public static final Comparator<Integer> COMPARATOR = new Comparator<Integer>()
- {
- public int compare(Integer s1, Integer s2)
- {
- return Serial.compare(s1, s2);
- }
- };
-
- /**
- * Compares two numbers using serial arithmetic.
- *
- * @param s1 the first serial number
- * @param s2 the second serial number
- *
- * @return a negative integer, zero, or a positive integer as the
- * first argument is less than, equal to, or greater than the
- * second
- */
- public static final int compare(int s1, int s2)
- {
- return s1 - s2;
- }
-
- public static final boolean lt(int s1, int s2)
- {
- return compare(s1, s2) < 0;
- }
-
- public static final boolean le(int s1, int s2)
- {
- return compare(s1, s2) <= 0;
- }
-
- public static final boolean gt(int s1, int s2)
- {
- return compare(s1, s2) > 0;
- }
-
- public static final boolean ge(int s1, int s2)
- {
- return compare(s1, s2) >= 0;
- }
-
- public static final boolean eq(int s1, int s2)
- {
- return s1 == s2;
- }
-
- public static final int min(int s1, int s2)
- {
- if (lt(s1, s2))
- {
- return s1;
- }
- else
- {
- return s2;
- }
- }
-
- public static final int max(int s1, int s2)
- {
- if (gt(s1, s2))
- {
- return s1;
- }
- else
- {
- return s2;
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java
deleted file mode 100644
index a0bbbb22de..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/Strings.java
+++ /dev/null
@@ -1,94 +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.
- *
- */
-package org.apache.qpid.util;
-
-import java.io.UnsupportedEncodingException;
-
-
-/**
- * Strings
- *
- */
-
-public final class Strings
-{
-
- private static final byte[] EMPTY = new byte[0];
-
- private static final ThreadLocal<char[]> charbuf = new ThreadLocal()
- {
- public char[] initialValue()
- {
- return new char[4096];
- }
- };
-
- public static final byte[] toUTF8(String str)
- {
- if (str == null)
- {
- return EMPTY;
- }
- else
- {
- final int size = str.length();
- char[] chars = charbuf.get();
- if (size > chars.length)
- {
- chars = new char[Math.max(size, 2*chars.length)];
- charbuf.set(chars);
- }
-
- str.getChars(0, size, chars, 0);
- final byte[] bytes = new byte[size];
- for (int i = 0; i < size; i++)
- {
- if (chars[i] > 127)
- {
- try
- {
- return str.getBytes("UTF-8");
- }
- catch (UnsupportedEncodingException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- bytes[i] = (byte) chars[i];
- }
- return bytes;
- }
- }
-
- public static final String fromUTF8(byte[] bytes)
- {
- try
- {
- return new String(bytes, "UTF-8");
- }
- catch (UnsupportedEncodingException e)
- {
- throw new RuntimeException(e);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/UUIDGen.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/UUIDGen.java
deleted file mode 100644
index 3cfe5afdac..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/UUIDGen.java
+++ /dev/null
@@ -1,36 +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.
- *
- */
-package org.apache.qpid.util;
-
-
-import java.util.UUID;
-
-/**
- * UUIDGen
- *
- */
-
-public interface UUIDGen
-{
-
- public UUID generate();
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/UUIDs.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/UUIDs.java
deleted file mode 100644
index 4bf6b7f0a2..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/UUIDs.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-package org.apache.qpid.util;
-
-
-/**
- * UUIDs
- *
- */
-
-public final class UUIDs
-{
-
- public static final UUIDGen newGenerator()
- {
- return newGenerator(System.getProperty("qpid.uuid.generator",
- NameUUIDGen.class.getName()));
- }
-
- public static UUIDGen newGenerator(String name)
- {
- try
- {
- Class cls = Class.forName(name);
- return (UUIDGen) cls.newInstance();
- }
- catch (InstantiationException e)
- {
- throw new RuntimeException(e);
- }
- catch (IllegalAccessException e)
- {
- throw new RuntimeException(e);
- }
- catch (ClassNotFoundException e)
- {
- throw new RuntimeException(e);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/AlreadyUnblockedException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/AlreadyUnblockedException.java
deleted file mode 100644
index e0c0337898..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/AlreadyUnblockedException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.apache.qpid.util.concurrent;
-/*
- *
- * 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.
- *
- */
-
-
-/**
- * Used to signal that a data element and its producer cannot be requeued or sent an error message when using a
- * {@link BatchSynchQueue} because the producer has already been unblocked by an unblocking take on the queue.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Signal that an unblocking take has already occurred.
- * </table>
- */
-public class AlreadyUnblockedException extends RuntimeException
-{ }
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueue.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueue.java
deleted file mode 100644
index 63d8f77edb..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueue.java
+++ /dev/null
@@ -1,122 +0,0 @@
-package org.apache.qpid.util.concurrent;
-/*
- *
- * 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 java.util.Collection;
-import java.util.concurrent.BlockingQueue;
-
-/**
- * BatchSynchQueue is an abstraction of the classic producer/consumer buffer pattern for thread interaction. In this
- * pattern threads can deposit data onto a buffer whilst other threads take data from the buffer and perform usefull
- * work with it. A BatchSynchQueue adds to this the possibility that producers can be blocked until their data is
- * consumed or until a consumer chooses to release the producer some time after consuming the data from the queue.
- *
- * <p>There are a number of possible advantages to using this technique when compared with having the producers
- * processing their own data:
- *
- * <ul>
- * <li>Data may be deposited asynchronously in the buffer allowing the producers to continue running.</li>
- * <li>Data may be deposited synchronously in the buffer so that producers wait until their data has been processed
- * before being allowed to continue.</li>
- * <li>Variable rates of production/consumption can be smoothed over by the buffer as it provides space in memory to
- * hold data between production and consumption.</li>
- * <li>Consumers may be able to batch data as they consume it leading to more efficient consumption over
- * individual data item consumption where latency associated with the consume operation can be ammortized.
- * For example, it may be possibly to ammortize the cost of a disk seek over many producers.</li>
- * <li>Data from seperate threads can be combined together in the buffer, providing a convenient way of spreading work
- * amongst many workers and gathering the results together again.</li>
- * <li>Different types of queue can be used to hold the buffer, resulting in different processing orders. For example,
- * lifo, fifo, priority heap, etc.</li>
- * </ul>
- *
- * <p/>The asynchronous type of producer/consumer buffers is already well supported by the java.util.concurrent package
- * (in Java 5) and there is also a synchronous queue implementation available there too. This interface extends the
- * blocking queue with some more methods for controlling a synchronous blocking queue. In particular it adds additional
- * take methods that can be used to take data from a queue without releasing producers, so that consumers have an
- * opportunity to confirm correct processing of the data before producers are released. It also adds a put method with
- * exceptions so that consumers can signal exception cases back to producers where there are errors in the data.
- *
- * <p/>This type of queue is usefull in situations where consumers can obtain an efficiency gain by batching data
- * from many threads but where synchronous handling of that data is neccessary because producers need to know that
- * their data has been processed before they continue. For example, sending a bundle of messages together, or writing
- * many records to disk at once, may result in improved performance but the originators of the messages or disk records
- * need confirmation that their data has really been sent or saved to disk.
- *
- * <p/>The consumer can put an element back onto the queue or send an error message to the elements producer using the
- * {@link SynchRecord} interface.
- *
- * <p/>The {@link #take()}, {@link #drainTo(java.util.Collection<? super E>)} and
- * {@link #drainTo(java.util.Collection<? super E>, int)} methods from {@link BlockingQueue} should behave as if they
- * have been called with unblock set to false. That is they take elements from the queue but leave the producers
- * blocked. These methods do not return collections of {@link SynchRecord}s so they do not supply an interface through
- * which errors or re-queuings can be applied. If these methods are used then the consumer must succesfully process
- * all the records it takes.
- *
- * <p/>The {@link #put} method should silently swallow any exceptions that consumers attempt to return to the caller.
- * In order to handle exceptions the {@link #tryPut} method must be used.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Handle synchronous puts, with possible exceptions.
- * <tr><td> Allow consumers to take many records from a queue in a batch.
- * <tr><td> Allow consumers to decide when to unblock synchronous producers.
- * </table>
- */
-public interface BatchSynchQueue<E> extends BlockingQueue<E>
-{
- /**
- * Tries a synchronous put into the queue. If a consumer encounters an exception condition whilst processing the
- * data that is put, then this is returned to the caller wrapped inside a {@link SynchException}.
- *
- * @param e The data element to put into the queue.
- *
- * @throws InterruptedException If the thread is interrupted whilst waiting to write to the queue or whilst waiting
- * on its entry in the queue being consumed.
- * @throws SynchException If a consumer encounters an error whilst processing the data element.
- */
- public void tryPut(E e) throws InterruptedException, SynchException;
-
- /**
- * Takes all available data items from the queue or blocks until some become available. The returned items
- * are wrapped in a {@link SynchRecord} which provides an interface to requeue them or send errors to their
- * producers, where the producers are still blocked.
- *
- * @param c The collection to drain the data items into.
- * @param unblock If set to <tt>true</tt> the producers for the taken items will be immediately unblocked.
- *
- * @return A count of the number of elements that were drained from the queue.
- */
- public SynchRef drainTo(Collection<SynchRecord<E>> c, boolean unblock);
-
- /**
- * Takes up to maxElements available data items from the queue or blocks until some become available. The returned
- * items are wrapped in a {@link SynchRecord} which provides an interface to requeue them or send errors to their
- * producers, where the producers are still blocked.
- *
- * @param c The collection to drain the data items into.
- * @param maxElements The maximum number of elements to drain.
- * @param unblock If set to <tt>true</tt> the producers for the taken items will be immediately unblocked.
- *
- * @return A count of the number of elements that were drained from the queue.
- */
- public SynchRef drainTo(Collection<SynchRecord<E>> c, int maxElements, boolean unblock);
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueueBase.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueueBase.java
deleted file mode 100644
index 4564b1d686..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BatchSynchQueueBase.java
+++ /dev/null
@@ -1,834 +0,0 @@
-package org.apache.qpid.util.concurrent;
-/*
- *
- * 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 java.util.*;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * Synchronous/Asynchronous puts. Asynchronous is easiest, just wait till can write to queue and deposit data.
- * Synchronous is harder. Deposit data, but then must wait until deposited element/elements are taken before being
- * allowed to unblock and continue. Consumer needs some options here too. Can just get the data from the buffer and
- * allow any producers unblocked as a result to continue, or can get data but continue blocking while the data is
- * processed before sending a message to do the unblocking. Synch/Asynch mode to be controlled by a switch.
- * Unblocking/not unblocking during consumer processing to be controlled by the consumers calls.
- *
- * <p/>Implementing sub-classes only need to supply an implementation of a queue to produce a valid concrete
- * implementation of this. This queue is only accessed through the methods {@link #insert}, {@link #extract},
- * {@link #getBufferCapacity()}, {@link #peekAtBufferHead()}. An implementation can override these methods to implement
- * the buffer other than by a queue, for example, by using an array.
- *
- * <p/>Normal queue methods to work asynchronously.
- * <p/>Put, take and drain methods from the BlockingQueue interface work synchronously but unblock producers immediately
- * when their data is taken.
- * <p/>The additional put, take and drain methods from the BatchSynchQueue interface work synchronously and provide the
- * option to keep producers blocked until the consumer decides to release them.
- *
- * <p/>Removed take method that keeps producers blocked as it is pointless. Essentially it reduces this class to
- * synchronous processing of individual data items, which negates the point of the hand-off design. The efficiency
- * gain of the hand off design comes in being able to batch consume requests, ammortizing latency (such as caused by io)
- * accross many producers. The only advantage of the single blocking take method is that it did take advantage of the
- * queue ordering, which ma be usefull, for example to apply a priority ordering amongst producers. This is also an
- * advantage over the java.util.concurrent.SynchronousQueue which doesn't have a backing queue which can be used to
- * apply orderings. If a single item take is really needed can just use the drainTo method with a maximum of one item.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * </table>
- */
-public abstract class BatchSynchQueueBase<E> extends AbstractQueue<E> implements BatchSynchQueue<E>
-{
- /** Used for logging. */
- private static final Logger log = LoggerFactory.getLogger(BatchSynchQueueBase.class);
-
- /** Holds a reference to the queue implementation that holds the buffer. */
- Queue<SynchRecordImpl<E>> buffer;
-
- /** Holds the number of items in the queue */
- private int count;
-
- /** Main lock guarding all access */
- private ReentrantLock lock;
-
- /** Condition for waiting takes */
- private Condition notEmpty;
-
- /** Condition for waiting puts */
- private Condition notFull;
-
- /**
- * Creates a batch synch queue without fair thread scheduling.
- */
- public BatchSynchQueueBase()
- {
- this(false);
- }
-
- /**
- * Ensures that the underlying buffer implementation is created.
- *
- * @param fair <tt>true</tt> if fairness is to be applied to threads waiting to access the buffer.
- */
- public BatchSynchQueueBase(boolean fair)
- {
- buffer = this.createQueue();
-
- // Create the buffer lock with the fairness flag set accordingly.
- lock = new ReentrantLock(fair);
-
- // Create the non-empty and non-full condition monitors on the buffer lock.
- notEmpty = lock.newCondition();
- notFull = lock.newCondition();
- }
-
- /**
- * Returns an iterator over the elements contained in this collection.
- *
- * @return An iterator over the elements contained in this collection.
- */
- public Iterator<E> iterator()
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Returns the number of elements in this collection. If the collection contains more than
- * <tt>Integer.MAX_VALUE</tt> elements, returns <tt>Integer.MAX_VALUE</tt>.
- *
- * @return The number of elements in this collection.
- */
- public int size()
- {
- final ReentrantLock lock = this.lock;
- lock.lock();
-
- try
- {
- return count;
- }
- finally
- {
- lock.unlock();
- }
- }
-
- /**
- * Inserts the specified element into this queue, if possible. When using queues that may impose insertion
- * restrictions (for example capacity bounds), method <tt>offer</tt> is generally preferable to method
- * {@link java.util.Collection#add}, which can fail to insert an element only by throwing an exception.
- *
- * @param e The element to insert.
- *
- * @return <tt>true</tt> if it was possible to add the element to this queue, else <tt>false</tt>
- */
- public boolean offer(E e)
- {
- if (e == null)
- {
- throw new NullPointerException();
- }
-
- final ReentrantLock lock = this.lock;
- lock.lock();
-
- try
- {
- return insert(e, false);
- }
- finally
- {
- lock.unlock();
- }
- }
-
- /**
- * Inserts the specified element into this queue, waiting if necessary up to the specified wait time for space to
- * become available.
- *
- * @param e The element to add.
- * @param timeout How long to wait before giving up, in units of <tt>unit</tt>
- * @param unit A <tt>TimeUnit</tt> determining how to interpret the <tt>timeout</tt> parameter.
- *
- * @return <tt>true</tt> if successful, or <tt>false</tt> if the specified waiting time elapses before space is
- * available.
- *
- * @throws InterruptedException If interrupted while waiting.
- * @throws NullPointerException If the specified element is <tt>null</tt>.
- */
- public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException
- {
- if (e == null)
- {
- throw new NullPointerException();
- }
-
- final ReentrantLock lock = this.lock;
- lock.lockInterruptibly();
-
- long nanos = unit.toNanos(timeout);
-
- try
- {
- do
- {
- if (insert(e, false))
- {
- return true;
- }
-
- try
- {
- nanos = notFull.awaitNanos(nanos);
- }
- catch (InterruptedException ie)
- {
- notFull.signal(); // propagate to non-interrupted thread
- throw ie;
- }
- }
- while (nanos > 0);
-
- return false;
- }
- finally
- {
- lock.unlock();
- }
- }
-
- /**
- * Retrieves and removes the head of this queue, or <tt>null</tt> if this queue is empty.
- *
- * @return The head of this queue, or <tt>null</tt> if this queue is empty.
- */
- public E poll()
- {
- final ReentrantLock lock = this.lock;
-
- lock.lock();
- try
- {
- if (count == 0)
- {
- return null;
- }
-
- E x = extract(true, true).getElement();
-
- return x;
- }
- finally
- {
- lock.unlock();
- }
- }
-
- /**
- * Retrieves and removes the head of this queue, waiting if necessary up to the specified wait time if no elements
- * are present on this queue.
- *
- * @param timeout How long to wait before giving up, in units of <tt>unit</tt>.
- * @param unit A <tt>TimeUnit</tt> determining how to interpret the <tt>timeout</tt> parameter.
- *
- * @return The head of this queue, or <tt>null</tt> if the specified waiting time elapses before an element is present.
- *
- * @throws InterruptedException If interrupted while waiting.
- */
- public E poll(long timeout, TimeUnit unit) throws InterruptedException
- {
- final ReentrantLock lock = this.lock;
- lock.lockInterruptibly();
- try
- {
- long nanos = unit.toNanos(timeout);
-
- do
- {
- if (count != 0)
- {
- E x = extract(true, true).getElement();
-
- return x;
- }
-
- try
- {
- nanos = notEmpty.awaitNanos(nanos);
- }
- catch (InterruptedException ie)
- {
- notEmpty.signal(); // propagate to non-interrupted thread
- throw ie;
- }
- }
- while (nanos > 0);
-
- return null;
- }
- finally
- {
- lock.unlock();
- }
- }
-
- /**
- * Retrieves, but does not remove, the head of this queue, returning <tt>null</tt> if this queue is empty.
- *
- * @return The head of this queue, or <tt>null</tt> if this queue is empty.
- */
- public E peek()
- {
- final ReentrantLock lock = this.lock;
- lock.lock();
-
- try
- {
- return peekAtBufferHead();
- }
- finally
- {
- lock.unlock();
- }
- }
-
- /**
- * Returns the number of elements that this queue can ideally (in the absence of memory or resource constraints)
- * accept without blocking, or <tt>Integer.MAX_VALUE</tt> if there is no intrinsic limit.
- *
- * <p>Note that you <em>cannot</em> always tell if an attempt to <tt>add</tt> an element will succeed by
- * inspecting <tt>remainingCapacity</tt> because it may be the case that another thread is about to <tt>put</tt>
- * or <tt>take</tt> an element.
- *
- * @return The remaining capacity.
- */
- public int remainingCapacity()
- {
- final ReentrantLock lock = this.lock;
- lock.lock();
-
- try
- {
- return getBufferCapacity() - count;
- }
- finally
- {
- lock.unlock();
- }
- }
-
- /**
- * Adds the specified element to this queue, waiting if necessary for space to become available.
- *
- * <p/>This method delegated to {@link #tryPut} which can raise {@link SynchException}s. If any are raised
- * this method silently ignores them. Use the {@link #tryPut} method directly if you want to catch these
- * exceptions.
- *
- * @param e The element to add.
- *
- * @throws InterruptedException If interrupted while waiting.
- */
- public void put(E e) throws InterruptedException
- {
- try
- {
- tryPut(e);
- }
- catch (SynchException ex)
- {
- // This exception is deliberately ignored. See the method comment for information about this.
- }
- }
-
- /**
- * Tries a synchronous put into the queue. If a consumer encounters an exception condition whilst processing the
- * data that is put, then this is returned to the caller wrapped inside a {@link SynchException}.
- *
- * @param e The data element to put into the queue. Cannot be null.
- *
- * @throws InterruptedException If the thread is interrupted whilst waiting to write to the queue or whilst waiting
- * on its entry in the queue being consumed.
- * @throws SynchException If a consumer encounters an error whilst processing the data element.
- */
- public void tryPut(E e) throws InterruptedException, SynchException
- {
- if (e == null)
- {
- throw new NullPointerException();
- }
-
- // final Queue<E> items = this.buffer;
- final ReentrantLock lock = this.lock;
- lock.lockInterruptibly();
-
- try
- {
- while (count == getBufferCapacity())
- {
- // Release the lock and wait until the queue is not full.
- notFull.await();
- }
- }
- catch (InterruptedException ie)
- {
- notFull.signal(); // propagate to non-interrupted thread
- throw ie;
- }
-
- // There is room in the queue so insert must succeed. Insert into the queu, release the lock and block
- // the producer until its data is taken.
- insert(e, true);
- }
-
- /**
- * Retrieves and removes the head of this queue, waiting if no elements are present on this queue.
- * Any producer that has its data element taken by this call will be immediately unblocked. To keep the
- * producer blocked whilst taking just a single item, use the
- * {@link #drainTo(java.util.Collection<org.apache.qpid.util.concurrent.SynchRecord<E>>, int, boolean)}
- * method. There is no take method to do that because there is not usually any advantage in a synchronous hand
- * off design that consumes data one item at a time. It is normal to consume data in chunks to ammortize consumption
- * latencies accross many producers where possible.
- *
- * @return The head of this queue.
- *
- * @throws InterruptedException if interrupted while waiting.
- */
- public E take() throws InterruptedException
- {
- final ReentrantLock lock = this.lock;
- lock.lockInterruptibly();
-
- try
- {
- try
- {
- while (count == 0)
- {
- // Release the lock and wait until the queue becomes non-empty.
- notEmpty.await();
- }
- }
- catch (InterruptedException ie)
- {
- notEmpty.signal(); // propagate to non-interrupted thread
- throw ie;
- }
-
- // There is data in the queue so extraction must succeed. Notify any waiting threads that the queue is
- // not full, and unblock the producer that owns the data item that is taken.
- E x = extract(true, true).getElement();
-
- return x;
- }
- finally
- {
- lock.unlock();
- }
- }
-
- /**
- * Removes all available elements from this queue and adds them into the given collection. This operation may be
- * more efficient than repeatedly polling this queue. A failure encountered while attempting to <tt>add</tt> elements
- * to collection <tt>c</tt> may result in elements being in neither, either or both collections when the associated
- * exception is thrown. Attempts to drain a queue to itself result in <tt>IllegalArgumentException</tt>. Further,
- * the behavior of this operation is undefined if the specified collection is modified while the operation is in
- * progress.
- *
- * @param objects The collection to transfer elements into.
- *
- * @return The number of elements transferred.
- *
- * @throws NullPointerException If objects is null.
- * @throws IllegalArgumentException If objects is this queue.
- */
- public int drainTo(Collection<? super E> objects)
- {
- return drainTo(objects, -1);
- }
-
- /**
- * Removes at most the given number of available elements from this queue and adds them into the given collection.
- * A failure encountered while attempting to <tt>add</tt> elements to collection <tt>c</tt> may result in elements
- * being in neither, either or both collections when the associated exception is thrown. Attempts to drain a queue
- * to itself result in <tt>IllegalArgumentException</tt>. Further, the behavior of this operation is undefined if
- * the specified collection is modified while the operation is in progress.
- *
- * @param objects The collection to transfer elements into.
- * @param maxElements The maximum number of elements to transfer. If this is -1 then that is interpreted as meaning
- * all elements.
- *
- * @return The number of elements transferred.
- *
- * @throws NullPointerException If c is null.
- * @throws IllegalArgumentException If c is this queue.
- */
- public int drainTo(Collection<? super E> objects, int maxElements)
- {
- if (objects == null)
- {
- throw new NullPointerException();
- }
-
- if (objects == this)
- {
- throw new IllegalArgumentException();
- }
-
- // final Queue<E> items = this.buffer;
- final ReentrantLock lock = this.lock;
- lock.lock();
-
- try
- {
- int n = 0;
-
- for (int max = ((maxElements >= count) || (maxElements < 0)) ? count : maxElements; n < max; n++)
- {
- // Take items from the queue, do unblock the producers, but don't send not full signals yet.
- objects.add(extract(true, false).getElement());
- }
-
- if (n > 0)
- {
- // count -= n;
- notFull.signalAll();
- }
-
- return n;
- }
- finally
- {
- lock.unlock();
- }
- }
-
- /**
- * Takes all available data items from the queue or blocks until some become available. The returned items
- * are wrapped in a {@link SynchRecord} which provides an interface to requeue them or send errors to their
- * producers, where the producers are still blocked.
- *
- * @param c The collection to drain the data items into.
- * @param unblock If set to <tt>true</tt> the producers for the taken items will be immediately unblocked.
- *
- * @return A count of the number of elements that were drained from the queue.
- */
- public SynchRef drainTo(Collection<SynchRecord<E>> c, boolean unblock)
- {
- return drainTo(c, -1, unblock);
- }
-
- /**
- * Takes up to maxElements available data items from the queue or blocks until some become available. The returned
- * items are wrapped in a {@link SynchRecord} which provides an interface to requeue them or send errors to their
- * producers, where the producers are still blocked.
- *
- * @param coll The collection to drain the data items into.
- * @param maxElements The maximum number of elements to drain.
- * @param unblock If set to <tt>true</tt> the producers for the taken items will be immediately unblocked.
- *
- * @return A count of the number of elements that were drained from the queue.
- */
- public SynchRef drainTo(Collection<SynchRecord<E>> coll, int maxElements, boolean unblock)
- {
- if (coll == null)
- {
- throw new NullPointerException();
- }
-
- // final Queue<E> items = this.buffer;
- final ReentrantLock lock = this.lock;
- lock.lock();
-
- try
- {
- int n = 0;
-
- for (int max = ((maxElements >= count) || (maxElements < 0)) ? count : maxElements; n < max; n++)
- {
- // Extract the next record from the queue, don't signall the not full condition yet and release
- // producers depending on whether the caller wants to or not.
- coll.add(extract(false, unblock));
- }
-
- if (n > 0)
- {
- // count -= n;
- notFull.signalAll();
- }
-
- return new SynchRefImpl(n, coll);
- }
- finally
- {
- lock.unlock();
- }
- }
-
- /**
- * This abstract method should be overriden to return an empty queue. Different implementations of producer
- * consumer buffers can control the order in which data is accessed using different queue implementations.
- * This method allows the type of queue to be abstracted out of this class and to be supplied by concrete
- * implementations.
- *
- * @return An empty queue.
- */
- protected abstract <T> Queue<T> createQueue();
-
- /**
- * Insert element into the queue, then possibly signal that the queue is not empty and block the producer
- * on the element until permission to procede is given.
- *
- * <p/>If the producer is to be blocked then the lock must be released first, otherwise no other process
- * will be able to get access to the queue. Hence, unlock and block are always set together.
- *
- * <p/>Call only when holding the global lock.
- *
- * @param unlockAndBlock <tt>true</tt>If the global queue lock should be released and the producer should be blocked.
- *
- * @return <tt>true</tt> if the operation succeeded, <tt>false</tt> otherwise. If the result is <tt>true</tt> this
- * method may not return straight away, but only after the producer is unblocked by having its data
- * consumed if the unlockAndBlock flag is set. In the false case the method will return straight away, no
- * matter what value the unlockAndBlock flag has, leaving the global lock on.
- */
- protected boolean insert(E x, boolean unlockAndBlock)
- {
- // Create a new record for the data item.
- SynchRecordImpl<E> record = new SynchRecordImpl<E>(x);
-
- boolean result = buffer.offer(record);
-
- if (result)
- {
- count++;
-
- // Tell any waiting consumers that the queue is not empty.
- notEmpty.signal();
-
- if (unlockAndBlock)
- {
- // Allow other threads to read/write the queue.
- lock.unlock();
-
- // Wait until a consumer takes this data item.
- record.waitForConsumer();
- }
-
- return true;
- }
- else
- {
- return false;
- }
- }
-
- /**
- * Extract element at current take position, advance, and signal.
- *
- * <p/>Call only when holding lock.
- */
- protected SynchRecordImpl<E> extract(boolean unblock, boolean signal)
- {
- SynchRecordImpl<E> result = buffer.remove();
- count--;
-
- if (signal)
- {
- notFull.signal();
- }
-
- if (unblock)
- {
- result.releaseImmediately();
- }
-
- return result;
- }
-
- /**
- * Get the capacity of the buffer. If the buffer has no maximum capacity then Integer.MAX_VALUE is returned.
- *
- * <p/>Call only when holding lock.
- *
- * @return The maximum capacity of the buffer.
- */
- protected int getBufferCapacity()
- {
- if (buffer instanceof Capacity)
- {
- return ((Capacity) buffer).getCapacity();
- }
- else
- {
- return Integer.MAX_VALUE;
- }
- }
-
- /**
- * Return the head element from the buffer.
- *
- * <p/>Call only when holding lock.
- *
- * @return The head element from the buffer.
- */
- protected E peekAtBufferHead()
- {
- return buffer.peek().getElement();
- }
-
- public class SynchRefImpl implements SynchRef
- {
- /** Holds the number of synch records associated with this reference. */
- int numRecords;
-
- /** Holds a reference to the collection of synch records managed by this. */
- Collection<SynchRecord<E>> records;
-
- public SynchRefImpl(int n, Collection<SynchRecord<E>> records)
- {
- this.numRecords = n;
- this.records = records;
- }
-
- public int getNumRecords()
- {
- return numRecords;
- }
-
- /**
- * Any producers that have had their data elements taken from the queue but have not been unblocked are unblocked
- * when this method is called. The exception to this is producers that have had their data put back onto the queue
- * by a consumer. Producers that have had exceptions for their data items registered by consumers will be unblocked
- * but will not return from their put call normally, but with an exception instead.
- */
- public void unblockProducers()
- {
- log.debug("public void unblockProducers(): called");
-
- if (records != null)
- {
- for (SynchRecord<E> record : records)
- {
- // This call takes account of items that have already been released, are to be requeued or are in
- // error.
- record.releaseImmediately();
- }
- }
-
- records = null;
- }
- }
-
- /**
- * A SynchRecordImpl is used by a {@link BatchSynchQueue} to pair together a producer with its data. This allows
- * the producer of data to be identified so that it can be unblocked when its data is consumed or sent errors when
- * its data cannot be consumed.
- */
- public class SynchRecordImpl<E> implements SynchRecord<E>
- {
- /** A boolean latch that determines when the producer for this data item will be allowed to continue. */
- BooleanLatch latch = new BooleanLatch();
-
- /** The data element associated with this item. */
- E element;
-
- /**
- * Create a new synch record.
- *
- * @param e The data element that the record encapsulates.
- */
- public SynchRecordImpl(E e)
- {
- // Keep the data element.
- element = e;
- }
-
- /**
- * Waits until the producer is given permission to proceded by a consumer.
- */
- public void waitForConsumer()
- {
- latch.await();
- }
-
- /**
- * Gets the data element contained by this record.
- *
- * @return The data element contained by this record.
- */
- public E getElement()
- {
- return element;
- }
-
- /**
- * Immediately releases the producer of this data record. Consumers can bring the synchronization time of
- * producers to a minimum by using this method to release them at the earliest possible moment when batch
- * consuming records from sychronized producers.
- */
- public void releaseImmediately()
- {
- // Check that the record has not already been released, is in error or is to be requeued.
- latch.signal();
-
- // Propagate errors to the producer.
-
- // Requeue items to be requeued.
- }
-
- /**
- * Tells the synch queue to put this element back onto the queue instead of releasing its producer.
- * The element is not requeued immediately but upon calling the {@link SynchRef#unblockProducers()} method or
- * the {@link #releaseImmediately()} method.
- *
- * <p/>This method will raise a runtime exception {@link AlreadyUnblockedException} if the producer for this
- * element has already been unblocked.
- */
- public void reQueue()
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Tells the synch queue to raise an exception with this elements producer. The exception is not raised
- * immediately but upon calling the {@link SynchRef#unblockProducers()} method or the
- * {@link #releaseImmediately()} method. The exception will be wrapped in a {@link SynchException} before it is
- * raised on the producer.
- *
- * <p/>This method is unusual in that it accepts an exception as an argument. This is non-standard but is used
- * because the exception is to be passed onto a different thread.
- *
- * <p/>This method will raise a runtime exception {@link AlreadyUnblockedException} if the producer for this
- * element has already been unblocked.
- *
- * @param e The exception to raise on the producer.
- */
- public void inError(Exception e)
- {
- throw new RuntimeException("Not implemented.");
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BooleanLatch.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BooleanLatch.java
deleted file mode 100644
index 0e4a07594f..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/BooleanLatch.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.apache.qpid.util.concurrent;
-/*
- *
- * 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 java.util.concurrent.locks.AbstractQueuedSynchronizer;
-
-/**
- * A BooleanLatch is like a set of traffic lights, where threads can wait at a red light until another thread gives
- * the green light. When threads arrive at the latch it is initially red. They queue up until the green signal is
- * given, at which point they can all acquire the latch in shared mode and continue to run concurrently. Once the latch
- * is signalled it cannot be reset to red again.
- *
- * <p/> The latch uses a {@link java.util.concurrent.locks.AbstractQueuedSynchronizer} to implement its synchronization.
- * This has two internal states, 0 which means that the latch is blocked, and 1 which means that the latch is open.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Block threads until a go signal is given.
- * </table>
- *
- * @todo Might be better to use a countdown latch to count down from 1. Its await method can throw interrupted
- * exception which makes the possibility of interruption more explicit, and provides a reminder to recheck the
- * latch condition before continuing.
- */
-public class BooleanLatch
-{
- /** Holds the synchronizer that provides the thread queueing synchronization. */
- private final Sync sync = new Sync();
-
- /**
- * Tests whether or not the latch has been signalled, that is to say that, the light is green.
- *
- * <p/>This method is non-blocking.
- *
- * @return <tt>true</tt> if the latch may be acquired; the light is green.
- */
- public boolean isSignalled()
- {
- return sync.isSignalled();
- }
-
- /**
- * Waits on the latch until the signal is given and the light is green. If the light is already green then the
- * latch will be acquired and the thread will not have to wait.
- *
- * <p/>This method will block until the go signal is given or the thread is otherwise interrupted. Before carrying
- * out any processing threads that return from this method should confirm that the go signal has really been given
- * on this latch by calling the {@link #isSignalled()} method.
- */
- public void await()
- {
- sync.acquireShared(1);
- }
-
- /**
- * Releases any threads currently waiting on the latch. This flips the light to green allowing any threads that
- * were waiting for this condition to now run.
- *
- * <p/>This method is non-blocking.
- */
- public void signal()
- {
- sync.releaseShared(1);
- }
-
- /**
- * Implements a thread queued synchronizer. The internal state 0 means that the queue is blocked and the internl
- * state 1 means that the queue is released and that all waiting threads can acquire the synchronizer in shared
- * mode.
- */
- private static class Sync extends AbstractQueuedSynchronizer
- {
- /**
- * Attempts to acquire this synchronizer in shared mode. It may be acquired once it has been released.
- *
- * @param ignore This parameter is ignored.
- *
- * @return 1 if the shared acquisition succeeds and -1 if it fails.
- */
- protected int tryAcquireShared(int ignore)
- {
- return isSignalled() ? 1 : -1;
- }
-
- /**
- * Releases the synchronizer, setting its internal state to 1.
- *
- * @param ignore This parameter is ignored.
- *
- * @return <tt>true</tt> always.
- */
- protected boolean tryReleaseShared(int ignore)
- {
- setState(1);
-
- return true;
- }
-
- /**
- * Tests if the synchronizer is signalled. It is signalled when its internal state it 1.
- *
- * @return <tt>true</tt> if the internal state is 1, <tt>false</tt> otherwise.
- */
- boolean isSignalled()
- {
- return getState() != 0;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/Capacity.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/Capacity.java
deleted file mode 100644
index a97ce0e172..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/Capacity.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.apache.qpid.util.concurrent;
-/*
- *
- * 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.
- *
- */
-
-
-/**
- * An interface exposed by data structures that have a maximum capacity.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Report the maximum capacity.
- * </table>
- */
-public interface Capacity
-{
- public int getCapacity();
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/Condition.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/Condition.java
deleted file mode 100644
index bbd1722677..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/Condition.java
+++ /dev/null
@@ -1,50 +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.
- *
- */
-package org.apache.qpid.util.concurrent;
-
-
-/**
- * Condition
- *
- */
-
-public class Condition
-{
-
- private boolean value = false;
-
- public synchronized void set()
- {
- value = true;
- notifyAll();
- }
-
- public synchronized boolean get(long timeout) throws InterruptedException
- {
- if (!value)
- {
- wait(timeout);
- }
-
- return value;
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchBuffer.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchBuffer.java
deleted file mode 100644
index bc63eb0353..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchBuffer.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.apache.qpid.util.concurrent;
-/*
- *
- * 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 java.util.Queue;
-
-/**
- * SynchBuffer completes the {@link BatchSynchQueueBase} abstract class by providing an implementation of the underlying
- * queue as an array. This uses FIFO ordering for the queue but restricts the maximum size of the queue to a fixed
- * amount. It also has the advantage that, as the buffer does not grow and shrink dynamically, memory for the buffer
- * is allocated up front and does not create garbage during the operation of the queue.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide array based FIFO queue to create a batch synched queue around.
- * </table>
- *
- * @todo Write an array based buffer implementation that implements Queue.
- */
-public class SynchBuffer<E> extends BatchSynchQueueBase<E>
-{
- /**
- * Returns an empty queue, implemented as an array.
- *
- * @return An empty queue, implemented as an array.
- */
- protected <T> Queue<T> createQueue()
- {
- throw new RuntimeException("Not implemented.");
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchException.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchException.java
deleted file mode 100644
index 99a83f96cd..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchException.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.apache.qpid.util.concurrent;
-/*
- *
- * 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.
- *
- */
-
-
-/**
- * SynchException is used to encapsulate exceptions with the data elements that caused them in order to send exceptions
- * back from the consumers of a {@link BatchSynchQueue} to producers. The underlying exception should be retrieved from
- * the {@link #getCause} method.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Encapsulate a data element and exception.
- * </table>
- */
-public class SynchException extends Exception
-{
- /** Holds the data element that is in error. */
- Object element;
-
- /**
- * Creates a new BaseApplicationException object.
- *
- * @param message The exception message.
- * @param cause The underlying throwable cause. This may be null.
- */
- public SynchException(String message, Throwable cause, Object element)
- {
- super(message, cause);
-
- // Keep the data element that was in error.
- this.element = element;
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchQueue.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchQueue.java
deleted file mode 100644
index 95833f398a..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchQueue.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.apache.qpid.util.concurrent;
-/*
- *
- * 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 java.util.LinkedList;
-import java.util.Queue;
-
-/**
- * SynchQueue completes the {@link BatchSynchQueueBase} abstract class by providing an implementation of the underlying
- * queue as a linked list. This uses FIFO ordering for the queue and allows the queue to grow to accomodate more
- * elements as needed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide linked list FIFO queue to create a batch synched queue around.
- * </table>
- */
-public class SynchQueue<E> extends BatchSynchQueueBase<E>
-{
- /**
- * Returns an empty queue, implemented as a linked list.
- *
- * @return An empty queue, implemented as a linked list.
- */
- protected <T> Queue<T> createQueue()
- {
- return new LinkedList<T>();
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchRecord.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchRecord.java
deleted file mode 100644
index fd740c20cd..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchRecord.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.apache.qpid.util.concurrent;
-/*
- *
- * 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.
- *
- */
-
-
-/**
- * SynchRecord associates a data item from a {@link BatchSynchQueue} with its producer. This enables the data item data
- * item to be put back on the queue without unblocking its producer, or to send exceptions to the producer.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Get the underlying data element.
- * <tr><td> Put the data element back on the queue without unblocking its producer.
- * <tr><td> Send and exception to the data elements producer.
- * </table>
- */
-public interface SynchRecord<E>
-{
- /**
- * Gets the data element contained by this record.
- *
- * @return The data element contained by this record.
- */
- public E getElement();
-
- /**
- * Tells the synch queue to put this element back onto the queue instead of releasing its producer.
- * The element is not requeued immediately but upon calling the {@link SynchRef#unblockProducers()} method.
- *
- * <p/>This method will raise a runtime exception {@link AlreadyUnblockedException} if the producer for this element
- * has already been unblocked.
- */
- public void reQueue();
-
- /**
- * Immediately releases the producer of this data record. Consumers can bring the synchronization time of
- * producers to a minimum by using this method to release them at the earliest possible moment when batch
- * consuming records from sychronized producers.
- */
- public void releaseImmediately();
-
- /**
- * Tells the synch queue to raise an exception with this elements producer. The exception is not raised immediately
- * but upon calling the {@link SynchRef#unblockProducers()} method. The exception will be wrapped in a
- * {@link SynchException} before it is raised on the producer.
- *
- * <p/>This method is unusual in that it accepts an exception as an argument. This is non-standard but is used
- * because the exception is to be passed onto a different thread.
- *
- * <p/>This method will raise a runtime exception {@link AlreadyUnblockedException} if the producer for this element
- * has already been unblocked.
- *
- * @param e The exception to raise on the producer.
- */
- public void inError(Exception e);
-}
diff --git a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchRef.java b/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchRef.java
deleted file mode 100644
index efe2344c06..0000000000
--- a/M4-RCs/qpid/java/common/src/main/java/org/apache/qpid/util/concurrent/SynchRef.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.qpid.util.concurrent;
-/*
- *
- * 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 SynchRef is an interface which is returned from the synchronous take and drain methods of {@link BatchSynchQueue},
- * allowing call-backs to be made against the synchronizing strucutre. It allows the consumer to communicate when it
- * wants producers that have their data taken to be unblocked.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Report number of records returned by a taking operation.
- * <tr><td> Provide call-back to release producers of taken records.
- * </table>
- */
-public interface SynchRef
-{
- /**
- * Reports the number of records taken by the take or drain operation.
- *
- * @return The number of records taken by the take or drain operation.
- */
- public int getNumRecords();
-
- /**
- * Any producers that have had their data elements taken from the queue but have not been unblocked are
- * unblocked when this method is called. The exception to this is producers that have had their data put back
- * onto the queue by a consumer. Producers that have had exceptions for their data items registered by consumers
- * will be unblocked but will not return from their put call normally, but with an exception instead.
- */
- public void unblockProducers();
-}
diff --git a/M4-RCs/qpid/java/common/src/main/resources/org/apache/qpid/ssl/qpid.cert b/M4-RCs/qpid/java/common/src/main/resources/org/apache/qpid/ssl/qpid.cert
deleted file mode 100644
index e6702108e6..0000000000
--- a/M4-RCs/qpid/java/common/src/main/resources/org/apache/qpid/ssl/qpid.cert
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/mina/SocketIOTest/IOWriterClient.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/mina/SocketIOTest/IOWriterClient.java
deleted file mode 100644
index b93dc46741..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/mina/SocketIOTest/IOWriterClient.java
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.mina.SocketIOTest;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.CloseFuture;
-import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.IoConnector;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.SimpleByteBufferAllocator;
-import org.apache.mina.filter.ReadThrottleFilterBuilder;
-import org.apache.mina.filter.WriteBufferLimitFilterBuilder;
-import org.apache.mina.transport.socket.nio.SocketSessionConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.util.concurrent.CountDownLatch;
-
-public class IOWriterClient implements Runnable
-{
- private static final Logger _logger = LoggerFactory.getLogger(IOWriterClient.class);
-
- public static int DEFAULT_TEST_SIZE = 2;
-
- private IoSession _session;
-
- private long _startTime;
-
- private long[] _chunkTimes;
-
- public int _chunkCount = 200000;
-
- private int _chunkSize = 1024;
-
- private CountDownLatch _notifier;
-
- private int _maximumWriteQueueLength;
-
- static public int _PORT = IOWriterServer._PORT;
-
- public void run()
- {
- _logger.info("Starting to send " + _chunkCount + " buffers of " + _chunkSize + "B");
- _startTime = System.currentTimeMillis();
- _notifier = new CountDownLatch(1);
-
- for (int i = 0; i < _chunkCount; i++)
- {
- ByteBuffer buf = ByteBuffer.allocate(_chunkSize, false);
- byte check = (byte) (i % 128);
- buf.put(check);
- buf.fill((byte) 88, buf.remaining());
- buf.flip();
-
- _session.write(buf);
- }
-
- long _sentall = System.currentTimeMillis();
- long _receivedall = _sentall;
- try
- {
- _logger.info("All buffers sent; waiting for receipt from server");
- _notifier.await();
- _receivedall = System.currentTimeMillis();
- }
- catch (InterruptedException e)
- {
- //Ignore
- }
- _logger.info("Completed");
- _logger.info("Total time waiting for server after last write: " + (_receivedall - _sentall));
-
- long totalTime = System.currentTimeMillis() - _startTime;
-
- _logger.info("Total time: " + totalTime);
- _logger.info("MB per second: " + (int) ((1.0 * _chunkSize * _chunkCount) / totalTime));
- long lastChunkTime = _startTime;
- double average = 0;
- for (int i = 0; i < _chunkTimes.length; i++)
- {
- if (i == 0)
- {
- average = _chunkTimes[i] - _startTime;
- }
- else
- {
- long delta = _chunkTimes[i] - lastChunkTime;
- if (delta != 0)
- {
- average = (average + delta) / 2;
- }
- }
- lastChunkTime = _chunkTimes[i];
- }
- _logger.info("Average chunk time: " + average + "ms");
- _logger.info("Maximum WriteRequestQueue size: " + _maximumWriteQueueLength);
-
- CloseFuture cf = _session.close();
- _logger.info("Closing session");
- cf.join();
- }
-
- private class WriterHandler extends IoHandlerAdapter
- {
- private int _chunksReceived = 0;
-
- private int _partialBytesRead = 0;
-
- private byte _partialCheckNumber;
-
- private int _totalBytesReceived = 0;
-
- private int _receivedCount = 0;
- private int _sentCount = 0;
- private static final String DEFAULT_READ_BUFFER = "262144";
- private static final String DEFAULT_WRITE_BUFFER = "262144";
-
- public void sessionCreated(IoSession session) throws Exception
- {
- IoFilterChain chain = session.getFilterChain();
-
- ReadThrottleFilterBuilder readfilter = new ReadThrottleFilterBuilder();
- readfilter.setMaximumConnectionBufferSize(Integer.parseInt(System.getProperty("qpid.read.buffer.limit", DEFAULT_READ_BUFFER)));
- readfilter.attach(chain);
-
- WriteBufferLimitFilterBuilder writefilter = new WriteBufferLimitFilterBuilder();
-
- writefilter.setMaximumConnectionBufferSize(Integer.parseInt(System.getProperty("qpid.write.buffer.limit", DEFAULT_WRITE_BUFFER)));
-
- writefilter.attach(chain);
- }
-
- public void messageSent(IoSession session, Object message) throws Exception
- {
- _maximumWriteQueueLength = Math.max(session.getScheduledWriteRequests(), _maximumWriteQueueLength);
-
- if (_logger.isDebugEnabled())
- {
- ++_sentCount;
- if (_sentCount % 1000 == 0)
- {
- _logger.debug("Sent count " + _sentCount + ":WQueue" + session.getScheduledWriteRequests());
-
- }
- }
- }
-
- public void messageReceived(IoSession session, Object message) throws Exception
- {
- if (_logger.isDebugEnabled())
- {
- ++_receivedCount;
-
- if (_receivedCount % 1000 == 0)
- {
- _logger.debug("Receieved count " + _receivedCount);
- }
- }
-
- ByteBuffer result = (ByteBuffer) message;
- _totalBytesReceived += result.remaining();
- int size = result.remaining();
- long now = System.currentTimeMillis();
- if (_partialBytesRead > 0)
- {
- int offset = _chunkSize - _partialBytesRead;
- if (size >= offset)
- {
- _chunkTimes[_chunksReceived++] = now;
- result.position(offset);
- }
- else
- {
- // have not read even one chunk, including the previous partial bytes
- _partialBytesRead += size;
- return;
- }
- }
-
-
- int chunkCount = result.remaining() / _chunkSize;
-
- for (int i = 0; i < chunkCount; i++)
- {
- _chunkTimes[_chunksReceived++] = now;
- byte check = result.get();
- _logger.debug("Check number " + check + " read");
- if (check != (byte) ((_chunksReceived - 1) % 128))
- {
- _logger.error("Check number " + check + " read when expected " + (_chunksReceived % 128));
- }
- _logger.debug("Chunk times recorded");
-
- try
- {
- result.skip(_chunkSize - 1);
- }
- catch (IllegalArgumentException e)
- {
- _logger.error("Position was: " + result.position());
- _logger.error("Tried to skip to: " + (_chunkSize * i));
- _logger.error("limit was; " + result.limit());
- }
- }
- _logger.debug("Chunks received now " + _chunksReceived);
- _logger.debug("Bytes received: " + _totalBytesReceived);
- _partialBytesRead = result.remaining();
-
- if (_partialBytesRead > 0)
- {
- _partialCheckNumber = result.get();
- }
-
-
- if (_chunksReceived >= _chunkCount)
- {
- _notifier.countDown();
- }
-
- }
-
- public void exceptionCaught(IoSession session, Throwable cause) throws Exception
- {
- _logger.error("Error: " + cause, cause);
- }
- }
-
- public void startWriter() throws IOException, InterruptedException
- {
-
- _maximumWriteQueueLength = 0;
-
- IoConnector ioConnector = null;
-
- if (Boolean.getBoolean("multinio"))
- {
- _logger.warn("Using MultiThread NIO");
- ioConnector = new org.apache.mina.transport.socket.nio.MultiThreadSocketConnector();
- }
- else
- {
- _logger.warn("Using MINA NIO");
- ioConnector = new org.apache.mina.transport.socket.nio.SocketConnector();
- }
-
- SocketSessionConfig scfg = (SocketSessionConfig) ioConnector.getDefaultConfig().getSessionConfig();
- scfg.setTcpNoDelay(true);
- scfg.setSendBufferSize(32768);
- scfg.setReceiveBufferSize(32768);
-
- ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
-
-
- final InetSocketAddress address = new InetSocketAddress("localhost", _PORT);
- _logger.info("Attempting connection to " + address);
-
- //Old mina style
-// ioConnector.setHandler(new WriterHandler());
-// ConnectFuture future = ioConnector.connect(address);
- ConnectFuture future = ioConnector.connect(address, new WriterHandler());
- // wait for connection to complete
- future.join();
- _logger.info("Connection completed");
- // we call getSession which throws an IOException if there has been an error connecting
- _session = future.getSession();
-
- _chunkTimes = new long[_chunkCount];
- Thread t = new Thread(this);
- t.start();
- t.join();
- _logger.info("Test Complete");
- }
-
-
- public void test1k() throws IOException, InterruptedException
- {
- _logger.info("Starting 1k test");
- _chunkSize = 1024;
- startWriter();
- }
-
-
- public void test2k() throws IOException, InterruptedException
- {
- _logger.info("Starting 2k test");
- _chunkSize = 2048;
- startWriter();
- }
-
-
- public void test4k() throws IOException, InterruptedException
- {
- _logger.info("Starting 4k test");
- _chunkSize = 4096;
- startWriter();
- }
-
-
- public void test8k() throws IOException, InterruptedException
- {
- _logger.info("Starting 8k test");
- _chunkSize = 8192;
- startWriter();
- }
-
-
- public void test16k() throws IOException, InterruptedException
- {
- _logger.info("Starting 16k test");
- _chunkSize = 16384;
- startWriter();
- }
-
-
- public void test32k() throws IOException, InterruptedException
- {
- _logger.info("Starting 32k test");
- _chunkSize = 32768;
- startWriter();
- }
-
-
- public static int getIntArg(String[] args, int index, int defaultValue)
- {
- if (args.length > index)
- {
- try
- {
- return Integer.parseInt(args[index]);
- }
- catch (NumberFormatException e)
- {
- //Do nothing
- }
- }
- return defaultValue;
- }
-
- public static void main(String[] args) throws IOException, InterruptedException
- {
- _PORT = getIntArg(args, 0, _PORT);
-
- int test = getIntArg(args, 1, DEFAULT_TEST_SIZE);
-
- IOWriterClient w = new IOWriterClient();
- w._chunkCount = getIntArg(args, 2, w._chunkCount);
- switch (test)
- {
- case 0:
- w.test1k();
- w.test2k();
- w.test4k();
- w.test8k();
- w.test16k();
- w.test32k();
- break;
- case 1:
- w.test1k();
- break;
- case 2:
- w.test2k();
- break;
- case 4:
- w.test4k();
- break;
- case 8:
- w.test8k();
- break;
- case 16:
- w.test16k();
- break;
- case 32:
- w.test32k();
- break;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/mina/SocketIOTest/IOWriterServer.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/mina/SocketIOTest/IOWriterServer.java
deleted file mode 100644
index 423e98c67b..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/mina/SocketIOTest/IOWriterServer.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.mina.SocketIOTest;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoAcceptor;
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.SimpleByteBufferAllocator;
-import org.apache.mina.filter.ReadThrottleFilterBuilder;
-import org.apache.mina.filter.WriteBufferLimitFilterBuilder;
-import org.apache.mina.transport.socket.nio.SocketSessionConfig;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-
-/** Tests MINA socket performance. This acceptor simply reads data from the network and writes it back again. */
-public class IOWriterServer
-{
- private static final Logger _logger = LoggerFactory.getLogger(IOWriterServer.class);
-
- static public int _PORT = 9999;
-
- private static final String DEFAULT_READ_BUFFER = "262144";
- private static final String DEFAULT_WRITE_BUFFER = "262144";
-
-
- private static class TestHandler extends IoHandlerAdapter
- {
- private int _sentCount = 0;
-
- private int _bytesSent = 0;
-
- private int _receivedCount = 0;
-
- public void sessionCreated(IoSession ioSession) throws java.lang.Exception
- {
- IoFilterChain chain = ioSession.getFilterChain();
-
- ReadThrottleFilterBuilder readfilter = new ReadThrottleFilterBuilder();
- readfilter.setMaximumConnectionBufferSize(Integer.parseInt(System.getProperty("qpid.read.buffer.limit", DEFAULT_READ_BUFFER)));
- readfilter.attach(chain);
-
- WriteBufferLimitFilterBuilder writefilter = new WriteBufferLimitFilterBuilder();
-
- writefilter.setMaximumConnectionBufferSize(Integer.parseInt(System.getProperty("qpid.write.buffer.limit", DEFAULT_WRITE_BUFFER)));
-
- writefilter.attach(chain);
-
- }
-
- public void messageReceived(IoSession session, Object message) throws Exception
- {
- ((ByteBuffer) message).acquire();
- session.write(message);
-
- if (_logger.isDebugEnabled())
- {
- _bytesSent += ((ByteBuffer) message).remaining();
-
- _sentCount++;
-
- if (_sentCount % 1000 == 0)
- {
- _logger.debug("Bytes sent: " + _bytesSent);
- }
- }
- }
-
- public void messageSent(IoSession session, Object message) throws Exception
- {
- if (_logger.isDebugEnabled())
- {
- ++_receivedCount;
-
- if (_receivedCount % 1000 == 0)
- {
- _logger.debug("Receieved count " + _receivedCount);
- }
- }
- }
-
- public void exceptionCaught(IoSession session, Throwable cause) throws Exception
- {
- _logger.error("Error: " + cause, cause);
- }
- }
-
- public void startAcceptor() throws IOException
- {
- IoAcceptor acceptor;
- if (Boolean.getBoolean("multinio"))
- {
- _logger.warn("Using MultiThread NIO");
- acceptor = new org.apache.mina.transport.socket.nio.MultiThreadSocketAcceptor();
- }
- else
- {
- _logger.warn("Using MINA NIO");
- acceptor = new org.apache.mina.transport.socket.nio.SocketAcceptor();
- }
-
-
- SocketSessionConfig sc = (SocketSessionConfig) acceptor.getDefaultConfig().getSessionConfig();
- sc.setTcpNoDelay(true);
- sc.setSendBufferSize(32768);
- sc.setReceiveBufferSize(32768);
-
- ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
-
- //The old mina style
-// acceptor.setLocalAddress(new InetSocketAddress(_PORT));
-// acceptor.setHandler(new TestHandler());
-// acceptor.bind();
- acceptor.bind(new InetSocketAddress(_PORT), new TestHandler());
-
- _logger.info("Bound on port " + _PORT + ":" + _logger.isDebugEnabled());
- _logger.debug("debug on");
- }
-
- public static void main(String[] args) throws IOException
- {
-
- if (args.length > 0)
- {
- try
- {
- _PORT = Integer.parseInt(args[0]);
- }
- catch (NumberFormatException e)
- {
- //IGNORE so use default port 9999;
- }
- }
-
- IOWriterServer a = new IOWriterServer();
- a.startAcceptor();
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/AMQExceptionTest.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/AMQExceptionTest.java
deleted file mode 100644
index ef6cd41492..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/AMQExceptionTest.java
+++ /dev/null
@@ -1,106 +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.
- *
- */
-package org.apache.qpid;
-
-import junit.framework.TestCase;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.framing.AMQFrameDecodingException;
-
-/**
- * This test is to ensure that when an AMQException is rethrown that the specified exception is correctly wrapped up.
- *
- * There are three cases:
- * Re-throwing an AMQException
- * Re-throwing a Subclass of AMQException
- * Re-throwing a Subclass of AMQException that does not have the default AMQException constructor which will force the
- * creation of an AMQException.
- */
-public class AMQExceptionTest extends TestCase
-{
- /**
- * Test that an AMQException will be correctly created and rethrown.
- */
- public void testRethrowGeneric()
- {
- AMQException test = new AMQException(AMQConstant.ACCESS_REFUSED, "refused", new RuntimeException());
-
- AMQException e = reThrowException(test);
-
- assertEquals("Exception not of correct class", AMQException.class, e.getClass());
-
- }
-
- /**
- * Test that a subclass of AMQException that has the default constructor will be correctly created and rethrown.
- */
- public void testRethrowAMQESubclass()
- {
- AMQFrameDecodingException test = new AMQFrameDecodingException(AMQConstant.INTERNAL_ERROR,
- "Error",
- new Exception());
- AMQException e = reThrowException(test);
-
- assertEquals("Exception not of correct class", AMQFrameDecodingException.class, e.getClass());
- }
-
- /**
- * Test that a subclass of AMQException that doesnot have the default constructor will be correctly rethrown as an
- * AMQException
- */
- public void testRethrowAMQESubclassNoConstructor()
- {
- AMQExceptionSubclass test = new AMQExceptionSubclass("Invalid Argument Exception");
-
- AMQException e = reThrowException(test);
-
- assertEquals("Exception not of correct class", AMQException.class, e.getClass());
- }
-
- /**
- * Private method to rethrown and validate the basic values of the rethrown
- * @param test Exception to rethrow
- * @throws AMQException the rethrown exception
- */
- private AMQException reThrowException(AMQException test)
- {
- AMQException amqe = test.cloneForCurrentThread();
-
- assertEquals("Error code does not match.", test.getErrorCode(), amqe.getErrorCode());
- assertTrue("Exception message does not start as expected.", amqe.getMessage().startsWith(test.getMessage()));
- assertEquals("Test Exception is not set as the cause", test, amqe.getCause());
- assertEquals("Cause is not correct", test.getCause(), amqe.getCause().getCause());
-
- return amqe;
- }
-
- /**
- * Private class that extends AMQException but does not have a default exception.
- */
- private class AMQExceptionSubclass extends AMQException
- {
-
- public AMQExceptionSubclass(String msg)
- {
- super(null, msg, null);
- }
- }
-}
-
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java
deleted file mode 100644
index 92e7ce0a80..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/AMQShortStringTest.java
+++ /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.
- *
- */
-
-package org.apache.qpid.framing;
-
-import junit.framework.TestCase;
-public class AMQShortStringTest extends TestCase
-{
-
- public static final AMQShortString HELLO = new AMQShortString("Hello");
- public static final AMQShortString HELL = new AMQShortString("Hell");
- public static final AMQShortString GOODBYE = new AMQShortString("Goodbye");
- public static final AMQShortString GOOD = new AMQShortString("Good");
- public static final AMQShortString BYE = new AMQShortString("BYE");
-
- public void testStartsWith()
- {
- assertTrue(HELLO.startsWith(HELL));
-
- assertFalse(HELL.startsWith(HELLO));
-
- assertTrue(GOODBYE.startsWith(GOOD));
-
- assertFalse(GOOD.startsWith(GOODBYE));
- }
-
- public void testEndWith()
- {
- assertFalse(HELL.endsWith(HELLO));
-
- assertTrue(GOODBYE.endsWith(new AMQShortString("bye")));
-
- assertFalse(GOODBYE.endsWith(BYE));
- }
-
-
- public void testTokenize()
- {
- AMQShortString dotSeparatedWords = new AMQShortString("this.is.a.test.with.1.2.3.-numbers-and-then--dashes-");
- AMQShortStringTokenizer dotTokenizer = dotSeparatedWords.tokenize((byte) '.');
-
- assertTrue(dotTokenizer.hasMoreTokens());
- assertEquals(new AMQShortString("this"),(dotTokenizer.nextToken()));
- assertTrue(dotTokenizer.hasMoreTokens());
- assertEquals(new AMQShortString("is"),(dotTokenizer.nextToken()));
- assertTrue(dotTokenizer.hasMoreTokens());
- assertEquals(new AMQShortString("a"),(dotTokenizer.nextToken()));
- assertTrue(dotTokenizer.hasMoreTokens());
- assertEquals(new AMQShortString("test"),(dotTokenizer.nextToken()));
- assertTrue(dotTokenizer.hasMoreTokens());
- assertEquals(new AMQShortString("with"),(dotTokenizer.nextToken()));
- assertTrue(dotTokenizer.hasMoreTokens());
- assertEquals(dotTokenizer.nextToken().toIntValue() , 1);
- assertTrue(dotTokenizer.hasMoreTokens());
- assertEquals(dotTokenizer.nextToken().toIntValue() , 2);
- assertTrue(dotTokenizer.hasMoreTokens());
- assertEquals(dotTokenizer.nextToken().toIntValue() , 3);
- assertTrue(dotTokenizer.hasMoreTokens());
- AMQShortString dashString = dotTokenizer.nextToken();
- assertEquals(new AMQShortString("-numbers-and-then--dashes-"),(dashString));
-
- AMQShortStringTokenizer dashTokenizer = dashString.tokenize((byte)'-');
- assertEquals(dashTokenizer.countTokens(), 7);
-
- AMQShortString[] expectedResults = new AMQShortString[]
- { AMQShortString.EMPTY_STRING,
- new AMQShortString("numbers"),
- new AMQShortString("and"),
- new AMQShortString("then"),
- AMQShortString.EMPTY_STRING,
- new AMQShortString("dashes"),
- AMQShortString.EMPTY_STRING };
-
- for(int i = 0; i < 7; i++)
- {
- assertTrue(dashTokenizer.hasMoreTokens());
- assertEquals(dashTokenizer.nextToken(), expectedResults[i]);
- }
-
- assertFalse(dotTokenizer.hasMoreTokens());
- }
-
-
- public void testEquals()
- {
- assertEquals(GOODBYE, new AMQShortString("Goodbye"));
- assertEquals(new AMQShortString("A"), new AMQShortString("A"));
- assertFalse(new AMQShortString("A").equals(new AMQShortString("a")));
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java
deleted file mode 100644
index 4fd1f60d69..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java
+++ /dev/null
@@ -1,188 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import junit.framework.TestCase;
-
-
-public class BasicContentHeaderPropertiesTest extends TestCase
-{
-
- BasicContentHeaderProperties _testProperties;
- FieldTable _testTable;
- String _testString = "This is a test string";
- int _testint = 666;
-
- /**
- * Currently only test setting/getting String, int and boolean props
- */
- public BasicContentHeaderPropertiesTest()
- {
- _testProperties = new BasicContentHeaderProperties();
- }
-
- public void setUp()
- {
- _testTable = new FieldTable();
- _testTable.setString("TestString", _testString);
- _testTable.setInteger("Testint", _testint);
- _testProperties = new BasicContentHeaderProperties();
- _testProperties.setHeaders(_testTable);
- }
-
- public void testGetPropertyListSize()
- {
- //needs a better test but at least we're exercising the code !
- // FT length is encoded in an int
- int expectedSize = EncodingUtils.encodedIntegerLength();
-
- expectedSize += EncodingUtils.encodedShortStringLength("TestInt");
- // 1 is for the Encoding Letter. here an 'i'
- expectedSize += 1 + EncodingUtils.encodedIntegerLength();
-
- expectedSize += EncodingUtils.encodedShortStringLength("TestString");
- // 1 is for the Encoding Letter. here an 'S'
- expectedSize += 1 + EncodingUtils.encodedLongStringLength(_testString);
-
-
- int size = _testProperties.getPropertyListSize();
-
- assertEquals(expectedSize, size);
- }
-
- public void testGetSetPropertyFlags()
- {
- _testProperties.setPropertyFlags(99);
- assertEquals(99, _testProperties.getPropertyFlags());
- }
-
- public void testWritePropertyListPayload()
- {
- ByteBuffer buf = ByteBuffer.allocate(300);
- _testProperties.writePropertyListPayload(buf);
- }
-
- public void testPopulatePropertiesFromBuffer() throws Exception
- {
- ByteBuffer buf = ByteBuffer.allocate(300);
- _testProperties.populatePropertiesFromBuffer(buf, 99, 99);
- }
-
- public void testSetGetContentType()
- {
- String contentType = "contentType";
- _testProperties.setContentType(contentType);
- assertEquals(contentType, _testProperties.getContentTypeAsString());
- }
-
- public void testSetGetEncoding()
- {
- String encoding = "encoding";
- _testProperties.setEncoding(encoding);
- assertEquals(encoding, _testProperties.getEncodingAsString());
- }
-
- public void testSetGetHeaders()
- {
- _testProperties.setHeaders(_testTable);
- assertEquals(_testTable, _testProperties.getHeaders());
- }
-
- public void testSetGetDeliveryMode()
- {
- byte deliveryMode = 1;
- _testProperties.setDeliveryMode(deliveryMode);
- assertEquals(deliveryMode, _testProperties.getDeliveryMode());
- }
-
- public void testSetGetPriority()
- {
- byte priority = 1;
- _testProperties.setPriority(priority);
- assertEquals(priority, _testProperties.getPriority());
- }
-
- public void testSetGetCorrelationId()
- {
- String correlationId = "correlationId";
- _testProperties.setCorrelationId(correlationId);
- assertEquals(correlationId, _testProperties.getCorrelationIdAsString());
- }
-
- public void testSetGetReplyTo()
- {
- String replyTo = "replyTo";
- _testProperties.setReplyTo(replyTo);
- assertEquals(replyTo, _testProperties.getReplyToAsString());
- }
-
- public void testSetGetExpiration()
- {
- long expiration = 999999999;
- _testProperties.setExpiration(expiration);
- assertEquals(expiration, _testProperties.getExpiration());
- }
-
- public void testSetGetMessageId()
- {
- String messageId = "messageId";
- _testProperties.setMessageId(messageId);
- assertEquals(messageId, _testProperties.getMessageIdAsString());
- }
-
- public void testSetGetTimestamp()
- {
- long timestamp = System.currentTimeMillis();
- _testProperties.setTimestamp(timestamp);
- assertEquals(timestamp, _testProperties.getTimestamp());
- }
-
- public void testSetGetType()
- {
- String type = "type";
- _testProperties.setType(type);
- assertEquals(type, _testProperties.getTypeAsString());
- }
-
- public void testSetGetUserId()
- {
- String userId = "userId";
- _testProperties.setUserId(userId);
- assertEquals(userId, _testProperties.getUserIdAsString());
- }
-
- public void testSetGetAppId()
- {
- String appId = "appId";
- _testProperties.setAppId(appId);
- assertEquals(appId, _testProperties.getAppIdAsString());
- }
-
- public void testSetGetClusterId()
- {
- String clusterId = "clusterId";
- _testProperties.setClusterId(clusterId);
- assertEquals(clusterId, _testProperties.getClusterIdAsString());
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java
deleted file mode 100644
index 007da7423e..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java
+++ /dev/null
@@ -1,960 +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.
- *
- */
-package org.apache.qpid.framing;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.AMQPInvalidClassException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class PropertyFieldTableTest extends TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(PropertyFieldTableTest.class);
-
- /**
- * Test that setting a similar named value replaces any previous value set on that name
- */
- public void testReplacement()
- {
- FieldTable table1 = new FieldTable();
- // Set a boolean value
- table1.setBoolean("value", true);
- // Check length of table is correct (<Value length> + <type> + <Boolean length>)
- int size = EncodingUtils.encodedShortStringLength("value") + 1 + EncodingUtils.encodedBooleanLength();
- Assert.assertEquals(size, table1.getEncodedSize());
-
- // reset value to an integer
- table1.setInteger("value", Integer.MAX_VALUE);
-
- // Check the length has changed accordingly (<Value length> + <type> + <Integer length>)
- size = EncodingUtils.encodedShortStringLength("value") + 1 + EncodingUtils.encodedIntegerLength();
- Assert.assertEquals(size, table1.getEncodedSize());
-
- // Check boolean value is null
- Assert.assertEquals(null, table1.getBoolean("value"));
- // ... and integer value is good
- Assert.assertEquals((Integer) Integer.MAX_VALUE, table1.getInteger("value"));
- }
-
- /**
- * Set a boolean and check that we can only get it back as a boolean and a string
- * Check that attempting to lookup a non existent value returns null
- */
- public void testBoolean()
- {
- FieldTable table1 = new FieldTable();
- table1.setBoolean("value", true);
- Assert.assertTrue(table1.propertyExists("value"));
-
- // Test Getting right value back
- Assert.assertEquals((Boolean) true, table1.getBoolean("value"));
-
- // Check we don't get anything back for other gets
- Assert.assertEquals(null, table1.getByte("value"));
- Assert.assertEquals(null, table1.getByte("value"));
- Assert.assertEquals(null, table1.getShort("value"));
- Assert.assertEquals(null, table1.getCharacter("value"));
- Assert.assertEquals(null, table1.getDouble("value"));
- Assert.assertEquals(null, table1.getFloat("value"));
- Assert.assertEquals(null, table1.getInteger("value"));
- Assert.assertEquals(null, table1.getLong("value"));
- Assert.assertEquals(null, table1.getBytes("value"));
-
- // except value as a string
- Assert.assertEquals("true", table1.getString("value"));
-
- table1.remove("value");
-
- // Table should now have zero length for encoding
- checkEmpty(table1);
-
- // Looking up an invalid value returns null
- Assert.assertEquals(null, table1.getBoolean("Rubbish"));
- }
-
- /**
- * Set a byte and check that we can only get it back as a byte and a string
- * Check that attempting to lookup a non existent value returns null
- */
- public void testByte()
- {
- FieldTable table1 = new FieldTable();
- table1.setByte("value", Byte.MAX_VALUE);
- Assert.assertTrue(table1.propertyExists("value"));
-
- // Tets lookups we shouldn't get anything back for other gets
- // we should get right value back for this type ....
- Assert.assertEquals(null, table1.getBoolean("value"));
- Assert.assertEquals(Byte.MAX_VALUE, (byte) table1.getByte("value"));
- Assert.assertEquals(null, table1.getShort("value"));
- Assert.assertEquals(null, table1.getCharacter("value"));
- Assert.assertEquals(null, table1.getDouble("value"));
- Assert.assertEquals(null, table1.getFloat("value"));
- Assert.assertEquals(null, table1.getInteger("value"));
- Assert.assertEquals(null, table1.getLong("value"));
- Assert.assertEquals(null, table1.getBytes("value"));
-
- // ... and a the string value of it.
- Assert.assertEquals("" + Byte.MAX_VALUE, table1.getString("value"));
-
- table1.remove("value");
- // Table should now have zero length for encoding
- checkEmpty(table1);
-
- // Looking up an invalid value returns null
- Assert.assertEquals(null, table1.getByte("Rubbish"));
- }
-
- /**
- * Set a short and check that we can only get it back as a short and a string
- * Check that attempting to lookup a non existent value returns null
- */
- public void testShort()
- {
- FieldTable table1 = new FieldTable();
- table1.setShort("value", Short.MAX_VALUE);
- Assert.assertTrue(table1.propertyExists("value"));
-
- // Tets lookups we shouldn't get anything back for other gets
- // we should get right value back for this type ....
- Assert.assertEquals(null, table1.getBoolean("value"));
- Assert.assertEquals(null, table1.getByte("value"));
- Assert.assertEquals(Short.MAX_VALUE, (short) table1.getShort("value"));
- Assert.assertEquals(null, table1.getCharacter("value"));
- Assert.assertEquals(null, table1.getDouble("value"));
- Assert.assertEquals(null, table1.getFloat("value"));
- Assert.assertEquals(null, table1.getInteger("value"));
- Assert.assertEquals(null, table1.getLong("value"));
- Assert.assertEquals(null, table1.getBytes("value"));
-
- // ... and a the string value of it.
- Assert.assertEquals("" + Short.MAX_VALUE, table1.getString("value"));
-
- table1.remove("value");
- // Table should now have zero length for encoding
- checkEmpty(table1);
-
- // Looking up an invalid value returns null
- Assert.assertEquals(null, table1.getShort("Rubbish"));
- }
-
- /**
- * Set a char and check that we can only get it back as a char
- * Check that attempting to lookup a non existent value returns null
- */
- public void testChar()
- {
- FieldTable table1 = new FieldTable();
- table1.setChar("value", 'c');
- Assert.assertTrue(table1.propertyExists("value"));
-
- // Tets lookups we shouldn't get anything back for other gets
- // we should get right value back for this type ....
- Assert.assertEquals(null, table1.getBoolean("value"));
- Assert.assertEquals(null, table1.getByte("value"));
- Assert.assertEquals(null, table1.getShort("value"));
- Assert.assertEquals('c', (char) table1.getCharacter("value"));
- Assert.assertEquals(null, table1.getDouble("value"));
- Assert.assertEquals(null, table1.getFloat("value"));
- Assert.assertEquals(null, table1.getInteger("value"));
- Assert.assertEquals(null, table1.getLong("value"));
- Assert.assertEquals(null, table1.getBytes("value"));
-
- // ... and a the string value of it.
- Assert.assertEquals("c", table1.getString("value"));
-
- table1.remove("value");
-
- // Table should now have zero length for encoding
- checkEmpty(table1);
-
- // Looking up an invalid value returns null
- Assert.assertEquals(null, table1.getCharacter("Rubbish"));
- }
-
- /**
- * Set a double and check that we can only get it back as a double
- * Check that attempting to lookup a non existent value returns null
- */
- public void testDouble()
- {
- FieldTable table1 = new FieldTable();
- table1.setDouble("value", Double.MAX_VALUE);
- Assert.assertTrue(table1.propertyExists("value"));
-
- // Tets lookups we shouldn't get anything back for other gets
- // we should get right value back for this type ....
- Assert.assertEquals(null, table1.getBoolean("value"));
- Assert.assertEquals(null, table1.getByte("value"));
- Assert.assertEquals(null, table1.getShort("value"));
- Assert.assertEquals(null, table1.getCharacter("value"));
- Assert.assertEquals(Double.MAX_VALUE, (double) table1.getDouble("value"));
- Assert.assertEquals(null, table1.getFloat("value"));
- Assert.assertEquals(null, table1.getInteger("value"));
- Assert.assertEquals(null, table1.getLong("value"));
- Assert.assertEquals(null, table1.getBytes("value"));
-
- // ... and a the string value of it.
- Assert.assertEquals("" + Double.MAX_VALUE, table1.getString("value"));
- table1.remove("value");
- // but after a removeKey it doesn't
- Assert.assertFalse(table1.containsKey("value"));
-
- // Table should now have zero length for encoding
- checkEmpty(table1);
-
- // Looking up an invalid value returns null
- Assert.assertEquals(null, table1.getDouble("Rubbish"));
- }
-
- /**
- * Set a float and check that we can only get it back as a float
- * Check that attempting to lookup a non existent value returns null
- */
- public void testFloat()
- {
- FieldTable table1 = new FieldTable();
- table1.setFloat("value", Float.MAX_VALUE);
- Assert.assertTrue(table1.propertyExists("value"));
-
- // Tets lookups we shouldn't get anything back for other gets
- // we should get right value back for this type ....
- Assert.assertEquals(null, table1.getBoolean("value"));
- Assert.assertEquals(null, table1.getByte("value"));
- Assert.assertEquals(null, table1.getShort("value"));
- Assert.assertEquals(null, table1.getCharacter("value"));
- Assert.assertEquals(null, table1.getDouble("value"));
- Assert.assertEquals(Float.MAX_VALUE, (float) table1.getFloat("value"));
- Assert.assertEquals(null, table1.getInteger("value"));
- Assert.assertEquals(null, table1.getLong("value"));
- Assert.assertEquals(null, table1.getBytes("value"));
-
- // ... and a the string value of it.
- Assert.assertEquals("" + Float.MAX_VALUE, table1.getString("value"));
-
- table1.remove("value");
- // but after a removeKey it doesn't
- Assert.assertFalse(table1.containsKey("value"));
-
- // Table should now have zero length for encoding
- checkEmpty(table1);
-
- // Looking up an invalid value returns null
- Assert.assertEquals(null, table1.getFloat("Rubbish"));
- }
-
- /**
- * Set an int and check that we can only get it back as an int
- * Check that attempting to lookup a non existent value returns null
- */
- public void testInt()
- {
- FieldTable table1 = new FieldTable();
- table1.setInteger("value", Integer.MAX_VALUE);
- Assert.assertTrue(table1.propertyExists("value"));
-
- // Tets lookups we shouldn't get anything back for other gets
- // we should get right value back for this type ....
- Assert.assertEquals(null, table1.getBoolean("value"));
- Assert.assertEquals(null, table1.getByte("value"));
- Assert.assertEquals(null, table1.getShort("value"));
- Assert.assertEquals(null, table1.getCharacter("value"));
- Assert.assertEquals(null, table1.getDouble("value"));
- Assert.assertEquals(null, table1.getFloat("value"));
- Assert.assertEquals(Integer.MAX_VALUE, (int) table1.getInteger("value"));
- Assert.assertEquals(null, table1.getLong("value"));
- Assert.assertEquals(null, table1.getBytes("value"));
-
- // ... and a the string value of it.
- Assert.assertEquals("" + Integer.MAX_VALUE, table1.getString("value"));
-
- table1.remove("value");
- // but after a removeKey it doesn't
- Assert.assertFalse(table1.containsKey("value"));
-
- // Table should now have zero length for encoding
- checkEmpty(table1);
-
- // Looking up an invalid value returns null
- Assert.assertEquals(null, table1.getInteger("Rubbish"));
- }
-
- /**
- * Set a long and check that we can only get it back as a long
- * Check that attempting to lookup a non existent value returns null
- */
- public void testLong()
- {
- FieldTable table1 = new FieldTable();
- table1.setLong("value", Long.MAX_VALUE);
- Assert.assertTrue(table1.propertyExists("value"));
-
- // Tets lookups we shouldn't get anything back for other gets
- // we should get right value back for this type ....
- Assert.assertEquals(null, table1.getBoolean("value"));
- Assert.assertEquals(null, table1.getByte("value"));
- Assert.assertEquals(null, table1.getShort("value"));
- Assert.assertEquals(null, table1.getCharacter("value"));
- Assert.assertEquals(null, table1.getDouble("value"));
- Assert.assertEquals(null, table1.getFloat("value"));
- Assert.assertEquals(null, table1.getInteger("value"));
- Assert.assertEquals(Long.MAX_VALUE, (long) table1.getLong("value"));
- Assert.assertEquals(null, table1.getBytes("value"));
-
- // ... and a the string value of it.
- Assert.assertEquals("" + Long.MAX_VALUE, table1.getString("value"));
-
- table1.remove("value");
- // but after a removeKey it doesn't
- Assert.assertFalse(table1.containsKey("value"));
-
- // Table should now have zero length for encoding
- checkEmpty(table1);
-
- // Looking up an invalid value returns null
- Assert.assertEquals(null, table1.getLong("Rubbish"));
- }
-
- /**
- * Set a double and check that we can only get it back as a double
- * Check that attempting to lookup a non existent value returns null
- */
- public void testBytes()
- {
- byte[] bytes = { 99, 98, 97, 96, 95 };
-
- FieldTable table1 = new FieldTable();
- table1.setBytes("value", bytes);
- Assert.assertTrue(table1.propertyExists("value"));
-
- // Tets lookups we shouldn't get anything back for other gets
- // we should get right value back for this type ....
- Assert.assertEquals(null, table1.getBoolean("value"));
- Assert.assertEquals(null, table1.getByte("value"));
- Assert.assertEquals(null, table1.getShort("value"));
- Assert.assertEquals(null, table1.getCharacter("value"));
- Assert.assertEquals(null, table1.getDouble("value"));
- Assert.assertEquals(null, table1.getFloat("value"));
- Assert.assertEquals(null, table1.getInteger("value"));
- Assert.assertEquals(null, table1.getLong("value"));
- assertBytesEqual(bytes, table1.getBytes("value"));
-
- // ... and a the string value of it is null
- Assert.assertEquals(null, table1.getString("value"));
-
- table1.remove("value");
- // but after a removeKey it doesn't
- Assert.assertFalse(table1.containsKey("value"));
-
- // Table should now have zero length for encoding
- checkEmpty(table1);
-
- // Looking up an invalid value returns null
- Assert.assertEquals(null, table1.getBytes("Rubbish"));
- }
-
- /**
- * Calls all methods that can be used to check the table is empty
- * - getEncodedSize
- * - isEmpty
- * - length
- *
- * @param table to check is empty
- */
- private void checkEmpty(FieldTable table)
- {
- Assert.assertEquals(0, table.getEncodedSize());
- Assert.assertTrue(table.isEmpty());
- Assert.assertEquals(0, table.size());
-
- Assert.assertEquals(0, table.keySet().size());
- }
-
- /**
- * Set a String and check that we can only get it back as a String
- * Check that attempting to lookup a non existent value returns null
- */
- public void testString()
- {
- FieldTable table1 = new FieldTable();
- table1.setString("value", "Hello");
- Assert.assertTrue(table1.propertyExists("value"));
-
- // Tets lookups we shouldn't get anything back for other gets
- // we should get right value back for this type ....
- Assert.assertEquals(null, table1.getBoolean("value"));
- Assert.assertEquals(null, table1.getByte("value"));
- Assert.assertEquals(null, table1.getShort("value"));
- Assert.assertEquals(null, table1.getCharacter("value"));
- Assert.assertEquals(null, table1.getDouble("value"));
- Assert.assertEquals(null, table1.getFloat("value"));
- Assert.assertEquals(null, table1.getInteger("value"));
- Assert.assertEquals(null, table1.getLong("value"));
- Assert.assertEquals(null, table1.getBytes("value"));
- Assert.assertEquals("Hello", table1.getString("value"));
-
- // Try setting a null value and read it back
- table1.setString("value", null);
-
- Assert.assertEquals(null, table1.getString("value"));
-
- // but still contains the value
- Assert.assertTrue(table1.containsKey("value"));
-
- table1.remove("value");
- // but after a removeKey it doesn't
- Assert.assertFalse(table1.containsKey("value"));
-
- checkEmpty(table1);
-
- // Looking up an invalid value returns null
- Assert.assertEquals(null, table1.getString("Rubbish"));
-
- // Additional Test that haven't been covered for string
- table1.setObject("value", "Hello");
- // Check that it was set correctly
- Assert.assertEquals("Hello", table1.getString("value"));
- }
-
- /** Check that a nested field table parameter correctly encodes and decodes to a byte buffer. */
- public void testNestedFieldTable()
- {
- byte[] testBytes = new byte[] { 0, 1, 2, 3, 4, 5 };
-
- FieldTable outerTable = new FieldTable();
- FieldTable innerTable = new FieldTable();
-
- // Put some stuff in the inner table.
- innerTable.setBoolean("bool", true);
- innerTable.setByte("byte", Byte.MAX_VALUE);
- innerTable.setBytes("bytes", testBytes);
- innerTable.setChar("char", 'c');
- innerTable.setDouble("double", Double.MAX_VALUE);
- innerTable.setFloat("float", Float.MAX_VALUE);
- innerTable.setInteger("int", Integer.MAX_VALUE);
- innerTable.setLong("long", Long.MAX_VALUE);
- innerTable.setShort("short", Short.MAX_VALUE);
- innerTable.setString("string", "hello");
- innerTable.setString("null-string", null);
-
- // Put the inner table in the outer one.
- outerTable.setFieldTable("innerTable", innerTable);
-
- // Write the outer table into the buffer.
- final ByteBuffer buffer = ByteBuffer.allocate((int) outerTable.getEncodedSize() + 4);
- outerTable.writeToBuffer(buffer);
- buffer.flip();
-
- // Extract the table back from the buffer again.
- try
- {
- FieldTable extractedOuterTable = EncodingUtils.readFieldTable(buffer);
-
- FieldTable extractedTable = extractedOuterTable.getFieldTable("innerTable");
-
- Assert.assertEquals((Boolean) true, extractedTable.getBoolean("bool"));
- Assert.assertEquals((Byte) Byte.MAX_VALUE, extractedTable.getByte("byte"));
- assertBytesEqual(testBytes, extractedTable.getBytes("bytes"));
- Assert.assertEquals((Character) 'c', extractedTable.getCharacter("char"));
- Assert.assertEquals(Double.MAX_VALUE, extractedTable.getDouble("double"));
- Assert.assertEquals(Float.MAX_VALUE, extractedTable.getFloat("float"));
- Assert.assertEquals((Integer) Integer.MAX_VALUE, extractedTable.getInteger("int"));
- Assert.assertEquals((Long) Long.MAX_VALUE, extractedTable.getLong("long"));
- Assert.assertEquals((Short) Short.MAX_VALUE, extractedTable.getShort("short"));
- Assert.assertEquals("hello", extractedTable.getString("string"));
- Assert.assertEquals(null, extractedTable.getString("null-string"));
- }
- catch (AMQFrameDecodingException e)
- {
- fail("Failed to decode field table with nested inner table.");
- }
- }
-
- public void testValues()
- {
- FieldTable table = new FieldTable();
- table.setBoolean("bool", true);
- table.setByte("byte", Byte.MAX_VALUE);
- byte[] bytes = { 99, 98, 97, 96, 95 };
- table.setBytes("bytes", bytes);
- table.setChar("char", 'c');
- table.setDouble("double", Double.MAX_VALUE);
- table.setFloat("float", Float.MAX_VALUE);
- table.setInteger("int", Integer.MAX_VALUE);
- table.setLong("long", Long.MAX_VALUE);
- table.setShort("short", Short.MAX_VALUE);
- table.setString("string", "Hello");
- table.setString("null-string", null);
-
- table.setObject("object-bool", true);
- table.setObject("object-byte", Byte.MAX_VALUE);
- table.setObject("object-bytes", bytes);
- table.setObject("object-char", 'c');
- table.setObject("object-double", Double.MAX_VALUE);
- table.setObject("object-float", Float.MAX_VALUE);
- table.setObject("object-int", Integer.MAX_VALUE);
- table.setObject("object-long", Long.MAX_VALUE);
- table.setObject("object-short", Short.MAX_VALUE);
- table.setObject("object-string", "Hello");
-
- Assert.assertEquals((Boolean) true, table.getBoolean("bool"));
- Assert.assertEquals((Byte) Byte.MAX_VALUE, table.getByte("byte"));
- assertBytesEqual(bytes, table.getBytes("bytes"));
- Assert.assertEquals((Character) 'c', table.getCharacter("char"));
- Assert.assertEquals(Double.MAX_VALUE, table.getDouble("double"));
- Assert.assertEquals(Float.MAX_VALUE, table.getFloat("float"));
- Assert.assertEquals((Integer) Integer.MAX_VALUE, table.getInteger("int"));
- Assert.assertEquals((Long) Long.MAX_VALUE, table.getLong("long"));
- Assert.assertEquals((Short) Short.MAX_VALUE, table.getShort("short"));
- Assert.assertEquals("Hello", table.getString("string"));
- Assert.assertEquals(null, table.getString("null-string"));
-
- Assert.assertEquals(true, table.getObject("object-bool"));
- Assert.assertEquals(Byte.MAX_VALUE, table.getObject("object-byte"));
- assertBytesEqual(bytes, (byte[]) table.getObject("object-bytes"));
- Assert.assertEquals('c', table.getObject("object-char"));
- Assert.assertEquals(Double.MAX_VALUE, table.getObject("object-double"));
- Assert.assertEquals(Float.MAX_VALUE, table.getObject("object-float"));
- Assert.assertEquals(Integer.MAX_VALUE, table.getObject("object-int"));
- Assert.assertEquals(Long.MAX_VALUE, table.getObject("object-long"));
- Assert.assertEquals(Short.MAX_VALUE, table.getObject("object-short"));
- Assert.assertEquals("Hello", table.getObject("object-string"));
- }
-
- public void testwriteBuffer()
- {
- byte[] bytes = { 99, 98, 97, 96, 95 };
-
- FieldTable table = new FieldTable();
- table.setBoolean("bool", true);
- table.setByte("byte", Byte.MAX_VALUE);
-
- table.setBytes("bytes", bytes);
- table.setChar("char", 'c');
- table.setDouble("double", Double.MAX_VALUE);
- table.setFloat("float", Float.MAX_VALUE);
- table.setInteger("int", Integer.MAX_VALUE);
- table.setLong("long", Long.MAX_VALUE);
- table.setShort("short", Short.MAX_VALUE);
- table.setString("string", "hello");
- table.setString("null-string", null);
-
- final ByteBuffer buffer = ByteBuffer.allocate((int) table.getEncodedSize() + 4); // FIXME XXX: Is cast a problem?
-
- table.writeToBuffer(buffer);
-
- buffer.flip();
-
- long length = buffer.getUnsignedInt();
-
- try
- {
- FieldTable table2 = new FieldTable(buffer, length);
-
- Assert.assertEquals((Boolean) true, table2.getBoolean("bool"));
- Assert.assertEquals((Byte) Byte.MAX_VALUE, table2.getByte("byte"));
- assertBytesEqual(bytes, table2.getBytes("bytes"));
- Assert.assertEquals((Character) 'c', table2.getCharacter("char"));
- Assert.assertEquals(Double.MAX_VALUE, table2.getDouble("double"));
- Assert.assertEquals(Float.MAX_VALUE, table2.getFloat("float"));
- Assert.assertEquals((Integer) Integer.MAX_VALUE, table2.getInteger("int"));
- Assert.assertEquals((Long) Long.MAX_VALUE, table2.getLong("long"));
- Assert.assertEquals((Short) Short.MAX_VALUE, table2.getShort("short"));
- Assert.assertEquals("hello", table2.getString("string"));
- Assert.assertEquals(null, table2.getString("null-string"));
-
- }
- catch (AMQFrameDecodingException e)
- {
- e.printStackTrace();
- fail("PFT should be instantiated from bytes." + e.getCause());
- }
- }
-
- public void testEncodingSize()
- {
- FieldTable result = new FieldTable();
- int size = 0;
-
- result.setBoolean("boolean", true);
- size += 1 + EncodingUtils.encodedShortStringLength("boolean") + EncodingUtils.encodedBooleanLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setByte("byte", (byte) Byte.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("byte") + EncodingUtils.encodedByteLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- byte[] _bytes = { 99, 98, 97, 96, 95 };
-
- result.setBytes("bytes", _bytes);
- size += 1 + EncodingUtils.encodedShortStringLength("bytes") + 4 + _bytes.length;
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setChar("char", (char) 'c');
- size += 1 + EncodingUtils.encodedShortStringLength("char") + EncodingUtils.encodedCharLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setDouble("double", (double) Double.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("double") + EncodingUtils.encodedDoubleLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setFloat("float", (float) Float.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("float") + EncodingUtils.encodedFloatLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setInteger("int", (int) Integer.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("int") + EncodingUtils.encodedIntegerLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setLong("long", (long) Long.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("long") + EncodingUtils.encodedLongLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setShort("short", (short) Short.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("short") + EncodingUtils.encodedShortLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setString("result", "Hello");
- size += 1 + EncodingUtils.encodedShortStringLength("result") + EncodingUtils.encodedLongStringLength("Hello");
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setObject("object-bool", true);
- size += 1 + EncodingUtils.encodedShortStringLength("object-bool") + EncodingUtils.encodedBooleanLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setObject("object-byte", Byte.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("object-byte") + EncodingUtils.encodedByteLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setObject("object-bytes", _bytes);
- size += 1 + EncodingUtils.encodedShortStringLength("object-bytes") + 4 + _bytes.length;
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setObject("object-char", 'c');
- size += 1 + EncodingUtils.encodedShortStringLength("object-char") + EncodingUtils.encodedCharLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setObject("object-double", Double.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("object-double") + EncodingUtils.encodedDoubleLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setObject("object-float", Float.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("object-float") + EncodingUtils.encodedFloatLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setObject("object-int", Integer.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("object-int") + EncodingUtils.encodedIntegerLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setObject("object-long", Long.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("object-long") + EncodingUtils.encodedLongLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- result.setObject("object-short", Short.MAX_VALUE);
- size += 1 + EncodingUtils.encodedShortStringLength("object-short") + EncodingUtils.encodedShortLength();
- Assert.assertEquals(size, result.getEncodedSize());
-
- }
-
- // public void testEncodingSize1()
- // {
- // PropertyFieldTable table = new PropertyFieldTable();
- // int length = 0;
- // result.put("one", 1L);
- // length = EncodingUtils.encodedShortStringLength("one");
- // length += 1 + EncodingUtils.encodedLongLength();
- // assertEquals(length, result.getEncodedSize());
- //
- // result.put("two", 2L);
- // length += EncodingUtils.encodedShortStringLength("two");
- // length += 1 + EncodingUtils.encodedLongLength();
- // assertEquals(length, result.getEncodedSize());
- //
- // result.put("three", 3L);
- // length += EncodingUtils.encodedShortStringLength("three");
- // length += 1 + EncodingUtils.encodedLongLength();
- // assertEquals(length, result.getEncodedSize());
- //
- // result.put("four", 4L);
- // length += EncodingUtils.encodedShortStringLength("four");
- // length += 1 + EncodingUtils.encodedLongLength();
- // assertEquals(length, result.getEncodedSize());
- //
- // result.put("five", 5L);
- // length += EncodingUtils.encodedShortStringLength("five");
- // length += 1 + EncodingUtils.encodedLongLength();
- // assertEquals(length, result.getEncodedSize());
- //
- // //fixme should perhaps be expanded to incorporate all types.
- //
- // final ByteBuffer buffer = ByteBuffer.allocate((int) result.getEncodedSize()); // FIXME XXX: Is cast a problem?
- //
- // result.writeToBuffer(buffer);
- //
- // buffer.flip();
- //
- // long length = buffer.getUnsignedInt();
- //
- // try
- // {
- // PropertyFieldTable table2 = new PropertyFieldTable(buffer, length);
- //
- // Assert.assertEquals((Long) 1L, table2.getLong("one"));
- // Assert.assertEquals((Long) 2L, table2.getLong("two"));
- // Assert.assertEquals((Long) 3L, table2.getLong("three"));
- // Assert.assertEquals((Long) 4L, table2.getLong("four"));
- // Assert.assertEquals((Long) 5L, table2.getLong("five"));
- // }
- // catch (AMQFrameDecodingException e)
- // {
- // e.printStackTrace();
- // fail("PFT should be instantiated from bytes." + e.getCause());
- // }
- //
- // }
-
- /**
- * Additional test for setObject
- */
- public void testSetObject()
- {
- FieldTable table = new FieldTable();
-
- // Try setting a non primative object
-
- try
- {
- table.setObject("value", this);
- fail("Only primative values allowed in setObject");
- }
- catch (AMQPInvalidClassException iae)
- {
- // normal path
- }
- // so length should be zero
- Assert.assertEquals(0, table.getEncodedSize());
- }
-
- /**
- * Additional test checkPropertyName doesn't accept Null
- */
- public void testCheckPropertyNameasNull()
- {
- FieldTable table = new FieldTable();
-
- try
- {
- table.setObject((String) null, "String");
- fail("Null property name is not allowed");
- }
- catch (IllegalArgumentException iae)
- {
- // normal path
- }
- // so length should be zero
- Assert.assertEquals(0, table.getEncodedSize());
- }
-
- /**
- * Additional test checkPropertyName doesn't accept an empty String
- */
- public void testCheckPropertyNameasEmptyString()
- {
- FieldTable table = new FieldTable();
-
- try
- {
- table.setObject("", "String");
- fail("empty property name is not allowed");
- }
- catch (IllegalArgumentException iae)
- {
- // normal path
- }
- // so length should be zero
- Assert.assertEquals(0, table.getEncodedSize());
- }
-
- /**
- * Additional test checkPropertyName doesn't accept an empty String
- */
- public void testCheckPropertyNamehasMaxLength()
- {
- String oldVal = System.getProperty("STRICT_AMQP");
- System.setProperty("STRICT_AMQP", "true");
- FieldTable table = new FieldTable();
-
- StringBuffer longPropertyName = new StringBuffer(129);
-
- for (int i = 0; i < 129; i++)
- {
- longPropertyName.append("x");
- }
-
- try
- {
- table.setObject(longPropertyName.toString(), "String");
- fail("property name must be < 128 characters");
- }
- catch (IllegalArgumentException iae)
- {
- // normal path
- }
- // so length should be zero
- Assert.assertEquals(0, table.getEncodedSize());
- if (oldVal != null)
- {
- System.setProperty("STRICT_AMQP", oldVal);
- }
- else
- {
- System.clearProperty("STRICT_AMQP");
- }
- }
-
- /**
- * Additional test checkPropertyName starts with a letter
- */
- public void testCheckPropertyNameStartCharacterIsLetter()
- {
- String oldVal = System.getProperty("STRICT_AMQP");
- System.setProperty("STRICT_AMQP", "true");
- FieldTable table = new FieldTable();
-
- // Try a name that starts with a number
- try
- {
- table.setObject("1", "String");
- fail("property name must start with a letter");
- }
- catch (IllegalArgumentException iae)
- {
- // normal path
- }
- // so length should be zero
- Assert.assertEquals(0, table.getEncodedSize());
- if (oldVal != null)
- {
- System.setProperty("STRICT_AMQP", oldVal);
- }
- else
- {
- System.clearProperty("STRICT_AMQP");
- }
- }
-
- /**
- * Additional test checkPropertyName starts with a hash or a dollar
- */
- public void testCheckPropertyNameStartCharacterIsHashorDollar()
- {
- String oldVal = System.getProperty("STRICT_AMQP");
- System.setProperty("STRICT_AMQP", "true");
- FieldTable table = new FieldTable();
-
- // Try a name that starts with a number
- try
- {
- table.setObject("#", "String");
- table.setObject("$", "String");
- }
- catch (IllegalArgumentException iae)
- {
- fail("property name are allowed to start with # and $s");
- }
-
- if (oldVal != null)
- {
- System.setProperty("STRICT_AMQP", oldVal);
- }
- else
- {
- System.clearProperty("STRICT_AMQP");
- }
- }
-
- /**
- * Additional test to test the contents of the table
- */
- public void testContents()
- {
- FieldTable table = new FieldTable();
-
- table.setObject("StringProperty", "String");
-
- Assert.assertEquals("String", table.getString("StringProperty"));
-
- // Test Clear
-
- table.clear();
-
- checkEmpty(table);
- }
-
- /**
- * Test the contents of the sets
- */
- public void testSets()
- {
-
- FieldTable table = new FieldTable();
-
- table.setObject("n1", "1");
- table.setObject("n2", "2");
- table.setObject("n3", "3");
-
- Assert.assertEquals("1", table.getObject("n1"));
- Assert.assertEquals("2", table.getObject("n2"));
- Assert.assertEquals("3", table.getObject("n3"));
-
- }
-
- private void assertBytesEqual(byte[] expected, byte[] actual)
- {
- Assert.assertEquals(expected.length, actual.length);
-
- for (int index = 0; index < expected.length; index++)
- {
- Assert.assertEquals(expected[index], actual[index]);
- }
- }
-
- private void assertBytesNotEqual(byte[] expected, byte[] actual)
- {
- Assert.assertEquals(expected.length, actual.length);
-
- for (int index = 0; index < expected.length; index++)
- {
- Assert.assertFalse(expected[index] == actual[index]);
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(PropertyFieldTableTest.class);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java
deleted file mode 100644
index 6383d52298..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java
+++ /dev/null
@@ -1,111 +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.
- *
- *
- */
-package org.apache.qpid.pool;
-
-import junit.framework.TestCase;
-import junit.framework.Assert;
-import org.apache.qpid.session.TestSession;
-import org.apache.mina.common.IoFilter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.IdleStatus;
-
-import java.util.concurrent.RejectedExecutionException;
-
-public class PoolingFilterTest extends TestCase
-{
- private PoolingFilter _pool;
- ReferenceCountingExecutorService _executorService;
-
- public void setUp()
- {
-
- //Create Pool
- _executorService = ReferenceCountingExecutorService.getInstance();
- _executorService.acquireExecutorService();
- _pool = PoolingFilter.createAynschWritePoolingFilter(_executorService,
- "AsynchronousWriteFilter");
-
- }
-
- public void testRejectedExecution() throws Exception
- {
-
- TestSession testSession = new TestSession();
- _pool.createNewJobForSession(testSession);
- _pool.filterWrite(new NoOpFilter(), testSession, new IoFilter.WriteRequest("Message"));
-
- //Shutdown the pool
- _executorService.getPool().shutdownNow();
-
- try
- {
-
- testSession = new TestSession();
- _pool.createNewJobForSession(testSession);
- //prior to fix for QPID-172 this would throw RejectedExecutionException
- _pool.filterWrite(null, testSession, null);
- }
- catch (RejectedExecutionException rje)
- {
- Assert.fail("RejectedExecutionException should not occur after pool has shutdown:" + rje);
- }
- }
-
- private static class NoOpFilter implements IoFilter.NextFilter
- {
-
- public void sessionOpened(IoSession session)
- {
- }
-
- public void sessionClosed(IoSession session)
- {
- }
-
- public void sessionIdle(IoSession session, IdleStatus status)
- {
- }
-
- public void exceptionCaught(IoSession session, Throwable cause)
- {
- }
-
- public void messageReceived(IoSession session, Object message)
- {
- }
-
- public void messageSent(IoSession session, Object message)
- {
- }
-
- public void filterWrite(IoSession session, IoFilter.WriteRequest writeRequest)
- {
- }
-
- public void filterClose(IoSession session)
- {
- }
-
- public void sessionCreated(IoSession session)
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/session/TestSession.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/session/TestSession.java
deleted file mode 100644
index aafc91b03b..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/session/TestSession.java
+++ /dev/null
@@ -1,277 +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.
- *
- */
-package org.apache.qpid.session;
-
-import org.apache.mina.common.*;
-
-import java.net.SocketAddress;
-import java.util.Set;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.ConcurrentHashMap;
-
-public class TestSession implements IoSession
-{
- private final ConcurrentMap attributes = new ConcurrentHashMap();
-
- public TestSession()
- {
- }
-
- public IoService getService()
- {
- return null; //TODO
- }
-
- public IoServiceConfig getServiceConfig()
- {
- return null; //TODO
- }
-
- public IoHandler getHandler()
- {
- return null; //TODO
- }
-
- public IoSessionConfig getConfig()
- {
- return null; //TODO
- }
-
- public IoFilterChain getFilterChain()
- {
- return null; //TODO
- }
-
- public WriteFuture write(Object message)
- {
- return null; //TODO
- }
-
- public CloseFuture close()
- {
- return null; //TODO
- }
-
- public Object getAttachment()
- {
- return getAttribute("");
- }
-
- public Object setAttachment(Object attachment)
- {
- return setAttribute("",attachment);
- }
-
- public Object getAttribute(String key)
- {
- return attributes.get(key);
- }
-
- public Object setAttribute(String key, Object value)
- {
- return attributes.put(key,value);
- }
-
- public Object setAttribute(String key)
- {
- return attributes.put(key, Boolean.TRUE);
- }
-
- public Object removeAttribute(String key)
- {
- return attributes.remove(key);
- }
-
- public boolean containsAttribute(String key)
- {
- return attributes.containsKey(key);
- }
-
- public Set getAttributeKeys()
- {
- return attributes.keySet();
- }
-
- public TransportType getTransportType()
- {
- return null; //TODO
- }
-
- public boolean isConnected()
- {
- return false; //TODO
- }
-
- public boolean isClosing()
- {
- return false; //TODO
- }
-
- public CloseFuture getCloseFuture()
- {
- return null; //TODO
- }
-
- public SocketAddress getRemoteAddress()
- {
- return null; //TODO
- }
-
- public SocketAddress getLocalAddress()
- {
- return null; //TODO
- }
-
- public SocketAddress getServiceAddress()
- {
- return null; //TODO
- }
-
- public int getIdleTime(IdleStatus status)
- {
- return 0; //TODO
- }
-
- public long getIdleTimeInMillis(IdleStatus status)
- {
- return 0; //TODO
- }
-
- public void setIdleTime(IdleStatus status, int idleTime)
- {
- //TODO
- }
-
- public int getWriteTimeout()
- {
- return 0; //TODO
- }
-
- public long getWriteTimeoutInMillis()
- {
- return 0; //TODO
- }
-
- public void setWriteTimeout(int writeTimeout)
- {
- //TODO
- }
-
- public TrafficMask getTrafficMask()
- {
- return null; //TODO
- }
-
- public void setTrafficMask(TrafficMask trafficMask)
- {
- //TODO
- }
-
- public void suspendRead()
- {
- //TODO
- }
-
- public void suspendWrite()
- {
- //TODO
- }
-
- public void resumeRead()
- {
- //TODO
- }
-
- public void resumeWrite()
- {
- //TODO
- }
-
- public long getReadBytes()
- {
- return 0; //TODO
- }
-
- public long getWrittenBytes()
- {
- return 0; //TODO
- }
-
- public long getReadMessages()
- {
- return 0;
- }
-
- public long getWrittenMessages()
- {
- return 0;
- }
-
- public long getWrittenWriteRequests()
- {
- return 0; //TODO
- }
-
- public int getScheduledWriteRequests()
- {
- return 0; //TODO
- }
-
- public int getScheduledWriteBytes()
- {
- return 0; //TODO
- }
-
- public long getCreationTime()
- {
- return 0; //TODO
- }
-
- public long getLastIoTime()
- {
- return 0; //TODO
- }
-
- public long getLastReadTime()
- {
- return 0; //TODO
- }
-
- public long getLastWriteTime()
- {
- return 0; //TODO
- }
-
- public boolean isIdle(IdleStatus status)
- {
- return false; //TODO
- }
-
- public int getIdleCount(IdleStatus status)
- {
- return 0; //TODO
- }
-
- public long getLastIdleTime(IdleStatus status)
- {
- return 0; //TODO
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java
deleted file mode 100644
index 7ce41db4d0..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/ConnectionTest.java
+++ /dev/null
@@ -1,385 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import org.apache.mina.util.AvailablePortFinder;
-
-import org.apache.qpid.util.concurrent.Condition;
-
-import org.apache.qpid.transport.network.ConnectionBinding;
-import org.apache.qpid.transport.network.io.IoAcceptor;
-import org.apache.qpid.transport.util.Logger;
-import org.apache.qpid.transport.util.Waiter;
-
-import junit.framework.TestCase;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Collections;
-import java.io.IOException;
-
-import static org.apache.qpid.transport.Option.*;
-
-/**
- * ConnectionTest
- */
-
-public class ConnectionTest extends TestCase implements SessionListener
-{
-
- private static final Logger log = Logger.get(ConnectionTest.class);
-
- private int port;
- private volatile boolean queue = false;
- private List<MessageTransfer> messages = new ArrayList<MessageTransfer>();
- private List<MessageTransfer> incoming = new ArrayList<MessageTransfer>();
-
- private IoAcceptor _ioa = null;
-
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- port = AvailablePortFinder.getNextAvailable(12000);
- }
-
- protected void tearDown() throws Exception
- {
- if (_ioa != null)
- {
- _ioa.close();
- }
-
- super.tearDown();
- }
-
- public void opened(Session ssn) {}
-
- public void message(final Session ssn, MessageTransfer xfr)
- {
- if (queue)
- {
- messages.add(xfr);
- ssn.processed(xfr);
- return;
- }
-
- String body = xfr.getBodyString();
-
- if (body.startsWith("CLOSE"))
- {
- ssn.getConnection().close();
- }
- else if (body.startsWith("DELAYED_CLOSE"))
- {
- ssn.processed(xfr);
- new Thread()
- {
- public void run()
- {
- try
- {
- sleep(3000);
- }
- catch (InterruptedException e)
- {
- throw new RuntimeException(e);
- }
- ssn.getConnection().close();
- }
- }.start();
- }
- else if (body.startsWith("ECHO"))
- {
- int id = xfr.getId();
- ssn.invoke(xfr);
- ssn.processed(id);
- }
- else if (body.startsWith("SINK"))
- {
- ssn.processed(xfr);
- }
- else if (body.startsWith("DROP"))
- {
- // do nothing
- }
- else
- {
- throw new IllegalArgumentException
- ("unrecognized message: " + body);
- }
- }
-
- public void exception(Session ssn, SessionException exc)
- {
- throw exc;
- }
-
- public void closed(Session ssn) {}
-
- private void send(Session ssn, String msg)
- {
- ssn.messageTransfer
- ("xxx", MessageAcceptMode.NONE, MessageAcquireMode.PRE_ACQUIRED,
- null, msg);
- }
-
- private Connection connect(final Condition closed)
- {
- Connection conn = new Connection();
- conn.setConnectionListener(new ConnectionListener()
- {
- public void opened(Connection conn) {}
- public void exception(Connection conn, ConnectionException exc)
- {
- exc.printStackTrace();
- }
- public void closed(Connection conn)
- {
- if (closed != null)
- {
- closed.set();
- }
- }
- });
- conn.connect("localhost", port, null, "guest", "guest", false);
- return conn;
- }
-
- public void testProtocolNegotiationExceptionOverridesCloseException() throws Exception
- {
- // Force os.name to be windows to exercise code in IoReceiver
- // that looks for the value of os.name
- System.setProperty("os.name","windows");
-
- // Start server as 0-9 to froce a ProtocolVersionException
- startServer(new ProtocolHeader(1, 0, 9));
-
- Condition closed = new Condition();
-
- try
- {
- connect(closed);
- fail("ProtocolVersionException expected");
- }
- catch (ProtocolVersionException pve)
- {
- //Expected code path
- }
- catch (Exception e)
- {
- fail("ProtocolVersionException expected. Got:" + e.getMessage());
- }
- }
-
- private void startServer()
- {
- startServer(new ProtocolHeader(1, 0, 10));
- }
-
- private void startServer(final ProtocolHeader protocolHeader)
- {
- ConnectionDelegate server = new ServerDelegate()
- {
- @Override
- public void init(Connection conn, ProtocolHeader hdr)
- {
- conn.send(protocolHeader);
- List<Object> utf8 = new ArrayList<Object>();
- utf8.add("utf8");
- conn.connectionStart(null, Collections.EMPTY_LIST, utf8);
- }
-
- @Override
- public Session getSession(Connection conn, SessionAttach atc)
- {
- Session ssn = super.getSession(conn, atc);
- ssn.setSessionListener(ConnectionTest.this);
- return ssn;
- }
- };
-
- try
- {
- _ioa = new IoAcceptor("localhost", port, ConnectionBinding.get(server));
- }
- catch (IOException e)
- {
- e.printStackTrace();
- fail("Unable to start Server for test due to:" + e.getMessage());
- }
-
- _ioa.start();
- }
-
- public void testClosedNotificationAndWriteToClosed() throws Exception
- {
- startServer();
-
- Condition closed = new Condition();
- Connection conn = connect(closed);
-
- Session ssn = conn.createSession(1);
- send(ssn, "CLOSE");
-
- if (!closed.get(3000))
- {
- fail("never got notified of connection close");
- }
-
- try
- {
- conn.connectionCloseOk();
- fail("writing to a closed socket succeeded");
- }
- catch (TransportException e)
- {
- // expected
- }
- }
-
- class FailoverConnectionListener implements ConnectionListener
- {
- public void opened(Connection conn) {}
-
- public void exception(Connection conn, ConnectionException e)
- {
- throw e;
- }
-
- public void closed(Connection conn)
- {
- queue = true;
- conn.connect("localhost", port, null, "guest", "guest");
- conn.resume();
- }
- }
-
- class TestSessionListener implements SessionListener
- {
- public void opened(Session s) {}
- public void exception(Session s, SessionException e) {}
- public void message(Session s, MessageTransfer xfr)
- {
- synchronized (incoming)
- {
- incoming.add(xfr);
- incoming.notifyAll();
- }
-
- s.processed(xfr);
- }
- public void closed(Session s) {}
- }
-
- public void testResumeNonemptyReplayBuffer() throws Exception
- {
- startServer();
-
- Connection conn = new Connection();
- conn.setConnectionListener(new FailoverConnectionListener());
- conn.connect("localhost", port, null, "guest", "guest");
- Session ssn = conn.createSession(1);
- ssn.setSessionListener(new TestSessionListener());
-
- send(ssn, "SINK 0");
- send(ssn, "ECHO 1");
- send(ssn, "ECHO 2");
-
- ssn.sync();
-
- String[] msgs = { "DROP 3", "DROP 4", "DROP 5", "CLOSE 6", "SINK 7" };
- for (String m : msgs)
- {
- send(ssn, m);
- }
-
- ssn.sync();
-
- assertEquals(msgs.length, messages.size());
- for (int i = 0; i < msgs.length; i++)
- {
- assertEquals(msgs[i], messages.get(i).getBodyString());
- }
-
- queue = false;
-
- send(ssn, "ECHO 8");
- send(ssn, "ECHO 9");
-
- synchronized (incoming)
- {
- Waiter w = new Waiter(incoming, 30000);
- while (w.hasTime() && incoming.size() < 4)
- {
- w.await();
- }
-
- assertEquals(4, incoming.size());
- assertEquals("ECHO 1", incoming.get(0).getBodyString());
- assertEquals(0, incoming.get(0).getId());
- assertEquals("ECHO 2", incoming.get(1).getBodyString());
- assertEquals(1, incoming.get(1).getId());
- assertEquals("ECHO 8", incoming.get(2).getBodyString());
- assertEquals(0, incoming.get(0).getId());
- assertEquals("ECHO 9", incoming.get(3).getBodyString());
- assertEquals(1, incoming.get(1).getId());
- }
- }
-
- public void testResumeEmptyReplayBuffer() throws InterruptedException
- {
- startServer();
-
- Connection conn = new Connection();
- conn.setConnectionListener(new FailoverConnectionListener());
- conn.connect("localhost", port, null, "guest", "guest");
- Session ssn = conn.createSession(1);
- ssn.setSessionListener(new TestSessionListener());
-
- send(ssn, "SINK 0");
- send(ssn, "SINK 1");
- send(ssn, "DELAYED_CLOSE 2");
- ssn.sync();
- Thread.sleep(6000);
- send(ssn, "SINK 3");
- ssn.sync();
- System.out.println(messages);
- assertEquals(1, messages.size());
- assertEquals("SINK 3", messages.get(0).getBodyString());
- }
-
- public void testFlushExpected() throws InterruptedException
- {
- startServer();
-
- Connection conn = new Connection();
- conn.connect("localhost", port, null, "guest", "guest");
- Session ssn = conn.createSession();
- ssn.sessionFlush(EXPECTED);
- send(ssn, "SINK 0");
- ssn.sessionFlush(EXPECTED);
- send(ssn, "SINK 1");
- ssn.sync();
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/GenTest.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/GenTest.java
deleted file mode 100644
index 512a0a29a6..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/GenTest.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import junit.framework.TestCase;
-
-/**
- * GenTest
- *
- */
-
-public class GenTest extends TestCase
-{
-
- public void testBooleans()
- {
- QueueDeclare qd = new QueueDeclare().queue("test-queue").durable(false);
- assertEquals(qd.getQueue(), "test-queue");
- assertFalse("durable should be false", qd.getDurable());
- qd.setDurable(true);
- assertTrue("durable should be true", qd.getDurable());
- qd.setDurable(false);
- assertFalse("durable should be false again", qd.getDurable());
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/RangeSetTest.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/RangeSetTest.java
deleted file mode 100644
index ad45d00e46..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/transport/RangeSetTest.java
+++ /dev/null
@@ -1,238 +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.
- *
- */
-package org.apache.qpid.transport;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import static org.apache.qpid.util.Serial.*;
-
-/**
- * RangeSetTest
- *
- */
-
-public class RangeSetTest extends TestCase
-{
-
- private void check(RangeSet ranges)
- {
- List<Integer> posts = new ArrayList<Integer>();
- for (Range range : ranges)
- {
- posts.add(range.getLower());
- posts.add(range.getUpper());
- }
-
- List<Integer> sorted = new ArrayList<Integer>(posts);
- Collections.sort(sorted, COMPARATOR);
-
- assertEquals(posts, sorted);
-
- int idx = 1;
- while (idx + 1 < posts.size())
- {
- assertTrue(!eq(posts.get(idx) + 1, posts.get(idx+1)));
- idx += 2;
- }
- }
-
- public void test1()
- {
- RangeSet ranges = new RangeSet();
- ranges.add(5, 10);
- check(ranges);
- ranges.add(15, 20);
- check(ranges);
- ranges.add(23, 25);
- check(ranges);
- ranges.add(12, 14);
- check(ranges);
- ranges.add(0, 1);
- check(ranges);
- ranges.add(3, 11);
- check(ranges);
- }
-
- public void test2()
- {
- RangeSet rs = new RangeSet();
- check(rs);
-
- rs.add(1);
- assertTrue(rs.includes(1));
- assertTrue(!rs.includes(2));
- assertTrue(!rs.includes(0));
- check(rs);
-
- rs.add(2);
- assertTrue(!rs.includes(0));
- assertTrue(rs.includes(1));
- assertTrue(rs.includes(2));
- assertTrue(!rs.includes(3));
- check(rs);
-
- rs.add(0);
-
- assertTrue(!rs.includes(-1));
- assertTrue(rs.includes(0));
- assertTrue(rs.includes(1));
- assertTrue(rs.includes(2));
- assertTrue(!rs.includes(3));
- check(rs);
-
- rs.add(37);
-
- assertTrue(!rs.includes(-1));
- assertTrue(rs.includes(0));
- assertTrue(rs.includes(1));
- assertTrue(rs.includes(2));
- assertTrue(!rs.includes(3));
- assertTrue(!rs.includes(36));
- assertTrue(rs.includes(37));
- assertTrue(!rs.includes(38));
- check(rs);
-
- rs.add(-1);
- check(rs);
-
- rs.add(-3);
- check(rs);
-
- rs.add(1, 20);
- assertTrue(!rs.includes(21));
- assertTrue(rs.includes(20));
- check(rs);
- }
-
- public void testAddSelf()
- {
- RangeSet a = new RangeSet();
- a.add(0, 8);
- check(a);
- a.add(0, 8);
- check(a);
- assertEquals(a.size(), 1);
- Range range = a.iterator().next();
- assertEquals(range.getLower(), 0);
- assertEquals(range.getUpper(), 8);
- }
-
- public void testIntersect1()
- {
- Range a = new Range(0, 10);
- Range b = new Range(9, 20);
- Range i1 = a.intersect(b);
- Range i2 = b.intersect(a);
- assertEquals(i1.getUpper(), 10);
- assertEquals(i2.getUpper(), 10);
- assertEquals(i1.getLower(), 9);
- assertEquals(i2.getLower(), 9);
- }
-
- public void testIntersect2()
- {
- Range a = new Range(0, 10);
- Range b = new Range(11, 20);
- assertNull(a.intersect(b));
- assertNull(b.intersect(a));
- }
-
- public void testIntersect3()
- {
- Range a = new Range(0, 10);
- Range b = new Range(3, 5);
- Range i1 = a.intersect(b);
- Range i2 = b.intersect(a);
- assertEquals(i1.getUpper(), 5);
- assertEquals(i2.getUpper(), 5);
- assertEquals(i1.getLower(), 3);
- assertEquals(i2.getLower(), 3);
- }
-
- public void testSubtract1()
- {
- Range a = new Range(0, 10);
- assertTrue(a.subtract(a).isEmpty());
- }
-
- public void testSubtract2()
- {
- Range a = new Range(0, 10);
- Range b = new Range(20, 30);
- List<Range> ranges = a.subtract(b);
- assertEquals(ranges.size(), 1);
- Range d = ranges.get(0);
- assertEquals(d.getLower(), a.getLower());
- assertEquals(d.getUpper(), a.getUpper());
- }
-
- public void testSubtract3()
- {
- Range a = new Range(20, 30);
- Range b = new Range(0, 10);
- List<Range> ranges = a.subtract(b);
- assertEquals(ranges.size(), 1);
- Range d = ranges.get(0);
- assertEquals(d.getLower(), a.getLower());
- assertEquals(d.getUpper(), a.getUpper());
- }
-
- public void testSubtract4()
- {
- Range a = new Range(0, 10);
- Range b = new Range(3, 5);
- List<Range> ranges = a.subtract(b);
- assertEquals(ranges.size(), 2);
- Range low = ranges.get(0);
- Range high = ranges.get(1);
- assertEquals(low.getLower(), 0);
- assertEquals(low.getUpper(), 2);
- assertEquals(high.getLower(), 6);
- assertEquals(high.getUpper(), 10);
- }
-
- public void testSubtract5()
- {
- Range a = new Range(0, 10);
- Range b = new Range(3, 20);
- List<Range> ranges = a.subtract(b);
- assertEquals(ranges.size(), 1);
- Range d = ranges.get(0);
- assertEquals(d.getLower(), 0);
- assertEquals(d.getUpper(), 2);
- }
-
- public void testSubtract6()
- {
- Range a = new Range(0, 10);
- Range b = new Range(-10, 5);
- List<Range> ranges = a.subtract(b);
- assertEquals(ranges.size(), 1);
- Range d = ranges.get(0);
- assertEquals(d.getLower(), 6);
- assertEquals(d.getUpper(), 10);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java
deleted file mode 100644
index 942901f1c0..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java
+++ /dev/null
@@ -1,554 +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.
- *
- */
-
-package org.apache.qpid.util;
-
-import junit.framework.*;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Properties;
-
-/**
- * Unit tests the {@link CommandLineParser} class.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Check that parsing a single flag works ok.
- * <tr><td> Check that parsing multiple flags condensed together works ok.
- * <tr><td> Check that parsing an option with a space between it and its argument works ok.
- * <tr><td> Check that parsing an option with no space between it and its argument works ok.
- * <tr><td> Check that parsing an option with specific argument format works ok.
- * <tr><td> Check that parsing an option with specific argument format fails on bad argument.
- * <tr><td> Check that parsing a flag condensed together with an option fails.
- * <tr><td> Check that parsing a free argument works ok.
- * <tr><td> Check that parsing a free argument with specific format works ok.
- * <tr><td> Check that parsing a free argument with specific format fails on bad argument.
- * <tr><td> Check that parsing a mandatory option works ok.
- * <tr><td> Check that parsing a mandatory free argument works ok.
- * <tr><td> Check that parsing a mandatory option fails when no option is set.
- * <tr><td> Check that parsing a mandatory free argument fails when no argument is specified.
- * <tr><td> Check that parsing an unknown option works when unknowns not errors.
- * <tr><td> Check that parsing an unknown flag fails when unknowns are to be reported as errors.
- * <tr><td> Check that parsing an unknown option fails when unknowns are to be reported as errors.
- * <tr><td> Check that get errors returns a string on errors.
- * <tr><td> Check that get errors returns an empty string on no errors.
- * <tr><td> Check that get usage returns a string.
- * <tr><td> Check that get options in force returns an empty string before parsing.
- * <tr><td> Check that get options in force return a non-empty string after parsing.
- * </table>
- */
-public class CommandLineParserTest extends TestCase
-{
- private static final Logger log = LoggerFactory.getLogger(CommandLineParserTest.class);
-
- public CommandLineParserTest(String name)
- {
- super(name);
- }
-
- /**
- * Compile all the tests for the default test implementation of a traversable state into a test suite.
- */
- public static Test suite()
- {
- // Build a new test suite
- TestSuite suite = new TestSuite("CommandLineParser Tests");
-
- // Add all the tests defined in this class (using the default constructor)
- suite.addTestSuite(CommandLineParserTest.class);
-
- return suite;
- }
-
- /** Check that get errors returns an empty string on no errors. */
- public void testGetErrorsReturnsEmptyStringOnNoErrors() throws Exception
- {
- // Create a command line parser for some flags and options.
- CommandLineParser parser =
- new CommandLineParser(
- new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" },
- { "t3", "Test Option 3.", "test", "true" },
- { "t4", "Test Option 4.", "test", null, "^test$" }
- });
-
- // Do some legal parsing.
- parser.parseCommandLine(new String[] { "-t1", "-t2test", "-t3test", "-t4test" });
-
- // Check that the get errors message returns an empty string.
- assertTrue("The errors method did not return an empty string.", "".equals(parser.getErrors()));
- }
-
- /** Check that get errors returns a string on errors. */
- public void testGetErrorsReturnsStringOnErrors() throws Exception
- {
- // Create a command line parser for some flags and options.
- CommandLineParser parser =
- new CommandLineParser(
- new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" },
- { "t3", "Test Option 3.", "test", "true" },
- { "t4", "Test Option 4.", "test", null, "^test$" }
- });
-
- try
- {
- // Do some illegal parsing.
- parser.parseCommandLine(new String[] { "-t1", "-t1t2test", "-t4fail" });
- }
- catch (IllegalArgumentException e)
- { }
-
- // Check that the get errors message returns a string.
- assertTrue("The errors method returned an empty string.",
- !((parser.getErrors() == null) || "".equals(parser.getErrors())));
-
- }
-
- /** Check that get options in force returns an empty string before parsing. */
- public void testGetOptionsInForceReturnsEmptyStringBeforeParsing() throws Exception
- {
- // Create a command line parser for some flags and options.
- CommandLineParser parser =
- new CommandLineParser(
- new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" },
- { "t3", "Test Option 3.", "test", "true" },
- { "t4", "Test Option 4.", "test", null, "^test$" }
- });
-
- // Check that the options in force method returns an empty string.
- assertTrue("The options in force method did not return an empty string.", "".equals(parser.getOptionsInForce()));
- }
-
- /** Check that get options in force return a non-empty string after parsing. */
- public void testGetOptionsInForceReturnsNonEmptyStringAfterParsing() throws Exception
- {
- // Create a command line parser for some flags and options.
- CommandLineParser parser =
- new CommandLineParser(
- new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" },
- { "t3", "Test Option 3.", "test", "true" },
- { "t4", "Test Option 4.", "test", null, "^test$" }
- });
-
- // Do some parsing.
- parser.parseCommandLine(new String[] { "-t1", "-t2test", "-t3test", "-t4test" });
-
- // Check that the options in force method returns a string.
- assertTrue("The options in force method did not return a non empty string.",
- !((parser.getOptionsInForce() == null) || "".equals(parser.getOptionsInForce())));
- }
-
- /** Check that get usage returns a string. */
- public void testGetUsageReturnsString() throws Exception
- {
- // Create a command line parser for some flags and options.
- CommandLineParser parser =
- new CommandLineParser(
- new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" },
- { "t3", "Test Option 3.", "test", "true" },
- { "t4", "Test Option 4.", "test", null, "^test$" }
- });
-
- // Check that the usage method returns a string.
- assertTrue("The usage method did not return a non empty string.",
- !((parser.getUsage() == null) || "".equals(parser.getUsage())));
- }
-
- /** Check that parsing multiple flags condensed together works ok. */
- public void testParseCondensedFlagsOk() throws Exception
- {
- // Create a command line parser for multiple flags.
- CommandLineParser parser =
- new CommandLineParser(
- new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Flag 2." },
- { "t3", "Test Flag 3." }
- });
-
- // Parse a command line with the flags set and condensed together.
- Properties testProps = parser.parseCommandLine(new String[] { "-t1t2t3" });
-
- // Check that the flags were set in the parsed properties.
- assertTrue("The t1 flag was not \"true\", it was: " + testProps.get("t1"), "true".equals(testProps.get("t1")));
- assertTrue("The t2 flag was not \"true\", it was: " + testProps.get("t2"), "true".equals(testProps.get("t2")));
- assertTrue("The t3 flag was not \"true\", it was: " + testProps.get("t3"), "true".equals(testProps.get("t3")));
- }
-
- /** Check that parsing a flag condensed together with an option fails. */
- public void testParseFlagCondensedWithOptionFails() throws Exception
- {
- // Create a command line parser for a flag and an option.
- CommandLineParser parser =
- new CommandLineParser(new String[][]
- {
- { "t1", "Test Flag 1." },
- { "t2", "Test Option 2.", "test" }
- });
-
- // Check that the parser reports an error.
- boolean testPassed = false;
-
- try
- {
- // Parse a command line with the flag and option condensed together.
- Properties testProps = parser.parseCommandLine(new String[] { "-t1t2" });
- }
- catch (IllegalArgumentException e)
- {
- testPassed = true;
- }
-
- assertTrue("IllegalArgumentException not thrown when a flag and option are condensed together.", testPassed);
- }
-
- /** Check that parsing a free argument with specific format fails on bad argument. */
- public void testParseFormattedFreeArgumentFailsBadArgument() throws Exception
- {
- // Create a command line parser for a formatted free argument.
- CommandLineParser parser =
- new CommandLineParser(new String[][]
- {
- { "1", "Test Free Argument.", "test", null, "^test$" }
- });
-
- // Check that the parser signals an error for a badly formatted argument.
- boolean testPassed = false;
-
- try
- {
- // Parse a command line with this option set incorrectly.
- Properties testProps = parser.parseCommandLine(new String[] { "fail" });
- }
- catch (IllegalArgumentException e)
- {
- testPassed = true;
- }
-
- assertTrue("IllegalArgumentException not thrown when a badly formatted argument was set.", testPassed);
- }
-
- /** Check that parsing a free argument with specific format works ok. */
- public void testParseFormattedFreeArgumentOk() throws Exception
- {
- // Create a command line parser for a formatted free argument.
- CommandLineParser parser =
- new CommandLineParser(new String[][]
- {
- { "1", "Test Free Argument.", "test", null, "^test$" }
- });
-
- // Parse a command line with this argument set correctly.
- Properties testProps = parser.parseCommandLine(new String[] { "test" });
-
- // Check that the resultant properties contains the correctly parsed option.
- assertTrue("The first free argument was not equal to \"test\" but was: " + testProps.get("1"),
- "test".equals(testProps.get("1")));
- }
-
- /** Check that parsing an option with specific argument format fails on bad argument. */
- public void testParseFormattedOptionArgumentFailsBadArgument() throws Exception
- {
- // Create a command line parser for a formatted option.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test", null, "^test$" }
- });
-
- // Check that the parser signals an error for a badly formatted argument.
- boolean testPassed = false;
-
- try
- {
- // Parse a command line with this option set incorrectly.
- Properties testProps = parser.parseCommandLine(new String[] { "-t", "fail" });
- }
- catch (IllegalArgumentException e)
- {
- testPassed = true;
- }
-
- assertTrue("IllegalArgumentException not thrown when a badly formatted argument was set.", testPassed);
- }
-
- /** Check that parsing an option with specific argument format works ok. */
- public void testParseFormattedOptionArgumentOk() throws Exception
- {
- // Create a command line parser for a formatted option.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test", null, "^test$" }
- });
-
- // Parse a command line with this option set correctly.
- Properties testProps = parser.parseCommandLine(new String[] { "-t", "test" });
-
- // Check that the resultant properties contains the correctly parsed option.
- assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"),
- "test".equals(testProps.get("t")));
- }
-
- /** Check that parsing a free argument works ok. */
- public void testParseFreeArgumentOk() throws Exception
- {
- // Create a command line parser for a free argument.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "1", "Test Free Argument.", "test" }
- });
-
- // Parse a command line with this argument set.
- Properties testProps = parser.parseCommandLine(new String[] { "test" });
-
- // Check that the resultant properties contains the correctly parsed option.
- assertTrue("The first free argument was not equal to \"test\" but was: " + testProps.get("1"),
- "test".equals(testProps.get("1")));
- }
-
- /** Check that parsing a mandatory option works ok. */
- public void testParseMandatoryOptionOk() throws Exception
- {
- // Create a command line parser for a mandatory option.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test", "true" }
- });
-
- // Parse a command line with this option set correctly.
- Properties testProps = parser.parseCommandLine(new String[] { "-t", "test" });
-
- // Check that the resultant properties contains the correctly parsed option.
- assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"),
- "test".equals(testProps.get("t")));
- }
-
- /** Check that parsing a mandatory free argument works ok. */
- public void testParseMandatoryFreeArgumentOk() throws Exception
- {
- // Create a command line parser for a mandatory free argument.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "1", "Test Option.", "test", "true" }
- });
-
- // Parse a command line with this argument set.
- Properties testProps = parser.parseCommandLine(new String[] { "test" });
-
- // Check that the resultant properties contains the correctly parsed option.
- assertTrue("The first free argument was not equal to \"test\" but was: " + testProps.get("1"),
- "test".equals(testProps.get("1")));
- }
-
- /** Check that parsing a mandatory free argument fails when no argument is specified. */
- public void testParseManadatoryFreeArgumentFailsNoArgument() throws Exception
- {
- // Create a command line parser for a mandatory free argument.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "1", "Test Option.", "test", "true" }
- });
-
- // Check that parsing fails when this mandatory free argument is missing.
- boolean testPassed = false;
-
- try
- {
- // Parse a command line with this free argument not set.
- Properties testProps = parser.parseCommandLine(new String[] {});
- }
- catch (IllegalArgumentException e)
- {
- testPassed = true;
- }
-
- // Check that the resultant properties contains the correctly parsed option.
- assertTrue("IllegalArgumentException not thrown for a missing mandatory option.", testPassed);
- }
-
- /** Check that parsing a mandatory option fails when no option is set. */
- public void testParseMandatoryFailsNoOption() throws Exception
- {
- // Create a command line parser for a mandatory option.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test", "true" }
- });
-
- // Check that parsing fails when this mandatory option is missing.
- boolean testPassed = false;
-
- try
- {
- // Parse a command line with this option not set.
- Properties testProps = parser.parseCommandLine(new String[] {});
- }
- catch (IllegalArgumentException e)
- {
- testPassed = true;
- }
-
- // Check that the resultant properties contains the correctly parsed option.
- assertTrue("IllegalArgumentException not thrown for a missing mandatory option.", testPassed);
- }
-
- /** Check that parsing an option with no space between it and its argument works ok. */
- public void testParseOptionWithNoSpaceOk() throws Exception
- {
- // Create a command line parser for an option.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test" }
- });
-
- // Parse a command line with this option set with no space.
- Properties testProps = parser.parseCommandLine(new String[] { "-ttest" });
-
- // Check that the resultant properties contains the correctly parsed option.
- assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"),
- "test".equals(testProps.get("t")));
- }
-
- /** Check that parsing an option with a space between it and its argument works ok. */
- public void testParseOptionWithSpaceOk() throws Exception
- {
- // Create a command line parser for an option.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Option.", "test" }
- });
-
- // Parse a command line with this option set with a space.
- Properties testProps = parser.parseCommandLine(new String[] { "-t", "test" });
-
- // Check that the resultant properties contains the correctly parsed option.
- assertTrue("The test option was not equal to \"test\" but was: " + testProps.get("t"),
- "test".equals(testProps.get("t")));
- }
-
- /** Check that parsing a single flag works ok. */
- public void testParseSingleFlagOk() throws Exception
- {
- // Create a command line parser for a single flag.
- CommandLineParser parser = new CommandLineParser(new String[][]
- {
- { "t", "Test Flag." }
- });
-
- // Parse a command line with the single flag set.
- Properties testProps = parser.parseCommandLine(new String[] { "-t" });
-
- // Check that the flag is set in the parsed properties.
- assertTrue("The t flag was not \"true\", it was: " + testProps.get("t"), "true".equals(testProps.get("t")));
-
- // Reset the parser.
- parser.reset();
-
- // Parse a command line with the single flag not set.
- testProps = parser.parseCommandLine(new String[] {});
-
- // Check that the flag is cleared in the parsed properties.
- assertTrue("The t flag was not \"false\", it was: " + testProps.get("t"), "false".equals(testProps.get("t")));
- }
-
- /** Check that parsing an unknown option works when unknowns not errors. */
- public void testParseUnknownOptionOk() throws Exception
- {
- // Create a command line parser for no flags or options
- CommandLineParser parser = new CommandLineParser(new String[][] {});
-
- // Check that parsing does not fail on an unknown flag.
- try
- {
- parser.parseCommandLine(new String[] { "-t" });
- }
- catch (IllegalArgumentException e)
- {
- fail("The parser threw an IllegalArgumentException on an unknown flag when errors on unkowns is off.");
- }
- }
-
- /** Check that parsing an unknown flag fails when unknowns are to be reported as errors. */
- public void testParseUnknownFlagFailsWhenUnknownsAreErrors() throws Exception
- {
- // Create a command line parser for no flags or options
- CommandLineParser parser = new CommandLineParser(new String[][] {});
-
- // Turn on fail on unknowns mode.
- parser.setErrorsOnUnknowns(true);
-
- // Check that parsing fails on an unknown flag.
- boolean testPassed = false;
-
- try
- {
- parser.parseCommandLine(new String[] { "-t" });
- }
- catch (IllegalArgumentException e)
- {
- testPassed = true;
- }
-
- assertTrue("IllegalArgumentException not thrown for an unknown flag when errors on unknowns mode is on.",
- testPassed);
- }
-
- /** Check that parsing an unknown option fails when unknowns are to be reported as errors. */
- public void testParseUnknownOptionFailsWhenUnknownsAreErrors() throws Exception
- {
- // Create a command line parser for no flags or options
- CommandLineParser parser = new CommandLineParser(new String[][] {});
-
- // Turn on fail on unknowns mode.
- parser.setErrorsOnUnknowns(true);
-
- // Check that parsing fails on an unknown flag.
- boolean testPassed = false;
-
- try
- {
- parser.parseCommandLine(new String[] { "-t", "test" });
- }
- catch (IllegalArgumentException e)
- {
- testPassed = true;
- }
-
- assertTrue("IllegalArgumentException not thrown for an unknown option when errors on unknowns mode is on.",
- testPassed);
- }
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java
deleted file mode 100644
index fb367d042c..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java
+++ /dev/null
@@ -1,522 +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.
- *
- */
-package org.apache.qpid.util;
-
-import junit.framework.TestCase;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.FileNotFoundException;
-
-public class FileUtilsTest extends TestCase
-{
- private static final String COPY = "-Copy";
- private static final String SUB = "-Sub";
-
- /**
- * Additional test for the copy method.
- * Ensures that the directory count did increase by more than 1 after the copy.
- */
- public void testCopyFile()
- {
- final String TEST_DATA = "FileUtilsTest-testCopy-TestDataTestDataTestDataTestDataTestDataTestData";
- String fileName = "FileUtilsTest-testCopy";
- String fileNameCopy = fileName + COPY;
-
- File[] beforeCopyFileList = null;
-
- //Create initial file
- File test = createTestFile(fileName, TEST_DATA);
-
- try
- {
- //Check number of files before copy
- beforeCopyFileList = test.getAbsoluteFile().getParentFile().listFiles();
- int beforeCopy = beforeCopyFileList.length;
-
- //Perform Copy
- File destination = new File(fileNameCopy);
- FileUtils.copy(test, destination);
- //Ensure the JVM cleans up if cleanup failues
- destination.deleteOnExit();
-
- //Retrieve counts after copy
- int afterCopy = test.getAbsoluteFile().getParentFile().listFiles().length;
-
- int afterCopyFromCopy = new File(fileNameCopy).getAbsoluteFile().getParentFile().listFiles().length;
-
- // Validate the copy counts
- assertEquals("The file listing from the original and the copy differ in length.", afterCopy, afterCopyFromCopy);
- assertEquals("The number of files did not increase.", beforeCopy + 1, afterCopy);
- assertEquals("The number of files did not increase.", beforeCopy + 1, afterCopyFromCopy);
-
- //Validate copy
- // Load content
- String copiedFileContent = FileUtils.readFileAsString(fileNameCopy);
- assertEquals(TEST_DATA, copiedFileContent);
- }
- finally // Ensure clean
- {
- //Clean up
- assertTrue("Unable to cleanup", FileUtils.deleteFile(fileNameCopy));
-
- //Check file list after cleanup
- File[] afterCleanup = new File(test.getAbsoluteFile().getParent()).listFiles();
- checkFileLists(beforeCopyFileList, afterCleanup);
-
- //Remove original file
- assertTrue("Unable to cleanup", test.delete());
- }
- }
-
- /**
- * Create and Copy the following structure:
- *
- * testDirectory --+
- * +-- testSubDirectory --+
- * +-- testSubFile
- * +-- File
- *
- * to testDirectory-Copy
- *
- * Validate that the file count in the copy is correct and contents of the copied files is correct.
- */
- public void testCopyRecursive()
- {
- final String TEST_DATA = "FileUtilsTest-testDirectoryCopy-TestDataTestDataTestDataTestDataTestDataTestData";
- String fileName = "FileUtilsTest-testCopy";
- String TEST_DIR = "testDirectoryCopy";
-
- //Create Initial Structure
- File testDir = new File(TEST_DIR);
-
- //Check number of files before copy
- File[] beforeCopyFileList = testDir.getAbsoluteFile().getParentFile().listFiles();
-
- try
- {
- //Create Directories
- assertTrue("Test directory already exists cannot test.", !testDir.exists());
-
- if (!testDir.mkdir())
- {
- fail("Unable to make test Directory");
- }
-
- File testSubDir = new File(TEST_DIR + File.separator + TEST_DIR + SUB);
- if (!testSubDir.mkdir())
- {
- fail("Unable to make test sub Directory");
- }
-
- //Create Files
- createTestFile(testDir.toString() + File.separator + fileName, TEST_DATA);
- createTestFile(testSubDir.toString() + File.separator + fileName + SUB, TEST_DATA);
-
- //Ensure the JVM cleans up if cleanup failues
- testSubDir.deleteOnExit();
- testDir.deleteOnExit();
-
-
- //Perform Copy
- File copyDir = new File(testDir.toString() + COPY);
- try
- {
- FileUtils.copyRecursive(testDir, copyDir);
- }
- catch (FileNotFoundException e)
- {
- fail(e.getMessage());
- }
- catch (FileUtils.UnableToCopyException e)
- {
- fail(e.getMessage());
- }
-
- //Validate Copy
- assertEquals("Copied directory should only have one file and one directory in it.", 2, copyDir.listFiles().length);
-
- //Validate Copy File Contents
- String copiedFileContent = FileUtils.readFileAsString(copyDir.toString() + File.separator + fileName);
- assertEquals(TEST_DATA, copiedFileContent);
-
- //Validate Name of Sub Directory
- assertTrue("Expected subdirectory is not a directory", new File(copyDir.toString() + File.separator + TEST_DIR + SUB).isDirectory());
-
- //Assert that it contains only one item
- assertEquals("Copied sub directory should only have one directory in it.", 1, new File(copyDir.toString() + File.separator + TEST_DIR + SUB).listFiles().length);
-
- //Validate content of Sub file
- copiedFileContent = FileUtils.readFileAsString(copyDir.toString() + File.separator + TEST_DIR + SUB + File.separator + fileName + SUB);
- assertEquals(TEST_DATA, copiedFileContent);
- }
- finally
- {
- //Clean up source and copy directory.
- assertTrue("Unable to cleanup", FileUtils.delete(testDir, true));
- assertTrue("Unable to cleanup", FileUtils.delete(new File(TEST_DIR + COPY), true));
-
- //Check file list after cleanup
- File[] afterCleanup = testDir.getAbsoluteFile().getParentFile().listFiles();
- checkFileLists(beforeCopyFileList, afterCleanup);
- }
- }
-
- /**
- * Helper method to create a test file with a string content
- *
- * @param fileName The fileName to use in the creation
- * @param test_data The data to store in the file
- *
- * @return The File reference
- */
- private File createTestFile(String fileName, String test_data)
- {
- File test = new File(fileName);
-
- try
- {
- test.createNewFile();
- //Ensure the JVM cleans up if cleanup failues
- test.deleteOnExit();
- }
- catch (IOException e)
- {
- fail(e.getMessage());
- }
-
- BufferedWriter writer = null;
- try
- {
- writer = new BufferedWriter(new FileWriter(test));
- try
- {
- writer.write(test_data);
- }
- catch (IOException e)
- {
- fail(e.getMessage());
- }
- }
- catch (IOException e)
- {
- fail(e.getMessage());
- }
- finally
- {
- try
- {
- if (writer != null)
- {
- writer.close();
- }
- }
- catch (IOException e)
- {
- fail(e.getMessage());
- }
- }
-
- return test;
- }
-
- /** Test that deleteFile only deletes the specified file */
- public void testDeleteFile()
- {
- File test = new File("FileUtilsTest-testDelete");
- //Record file count in parent directory to check it is not changed by delete
- String path = test.getAbsolutePath();
- File[] filesBefore = new File(path.substring(0, path.lastIndexOf(File.separator))).listFiles();
- int fileCountBefore = filesBefore.length;
-
- try
- {
- test.createNewFile();
- //Ensure the JVM cleans up if cleanup failues
- test.deleteOnExit();
- }
- catch (IOException e)
- {
- fail(e.getMessage());
- }
-
- assertTrue("File does not exists", test.exists());
- assertTrue("File is not a file", test.isFile());
-
- //Check that file creation can be seen on disk
- int fileCountCreated = new File(path.substring(0, path.lastIndexOf(File.separator))).listFiles().length;
- assertEquals("File creation was no registered", fileCountBefore + 1, fileCountCreated);
-
- //Perform Delete
- assertTrue("Unable to cleanup", FileUtils.deleteFile("FileUtilsTest-testDelete"));
-
- assertTrue("File exists after delete", !test.exists());
-
- //Check that after deletion the file count is now accurate
- File[] filesAfter = new File(path.substring(0, path.lastIndexOf(File.separator))).listFiles();
- int fileCountAfter = filesAfter.length;
- assertEquals("File creation was no registered", fileCountBefore, fileCountAfter);
-
- checkFileLists(filesBefore, filesAfter);
- }
-
- /**
- * Given two lists of File arrays ensure they are the same length and all entries in Before are in After
- *
- * @param filesBefore File[]
- * @param filesAfter File[]
- */
- private void checkFileLists(File[] filesBefore, File[] filesAfter)
- {
- assertNotNull("Before file list cannot be null", filesBefore);
- assertNotNull("After file list cannot be null", filesAfter);
-
- assertEquals("File lists are unequal", filesBefore.length, filesAfter.length);
-
- for (File fileBefore : filesBefore)
- {
- boolean found = false;
-
- for (File fileAfter : filesAfter)
- {
- if (fileBefore.getAbsolutePath().equals(fileAfter.getAbsolutePath()))
- {
- found = true;
- break;
- }
- }
-
- assertTrue("File'" + fileBefore.getName() + "' was not in directory afterwards", found);
- }
- }
-
- public void testNonRecursiveNonEmptyDirectoryDeleteFails()
- {
- String directoryName = "FileUtilsTest-testRecursiveDelete";
- File test = new File(directoryName);
-
- //Record file count in parent directory to check it is not changed by delete
- String path = test.getAbsolutePath();
- File[] filesBefore = new File(path.substring(0, path.lastIndexOf(File.separator))).listFiles();
- int fileCountBefore = filesBefore.length;
-
- assertTrue("Directory exists", !test.exists());
-
- test.mkdir();
-
- //Create a file in the directory
- String fileName = test.getAbsolutePath() + File.separatorChar + "testFile";
- File subFile = new File(fileName);
- try
- {
- subFile.createNewFile();
- //Ensure the JVM cleans up if cleanup failues
- subFile.deleteOnExit();
- }
- catch (IOException e)
- {
- fail(e.getMessage());
- }
- //Ensure the JVM cleans up if cleanup failues
- // This must be after the subFile as the directory must be empty before
- // the delete is performed
- test.deleteOnExit();
-
- //Try and delete the non-empty directory
- assertFalse("Non Empty Directory was successfully deleted.", FileUtils.deleteDirectory(directoryName));
-
- //Check directory is still there
- assertTrue("Directory was deleted.", test.exists());
-
- // Clean up
- assertTrue("Unable to cleanup", FileUtils.delete(test, true));
-
- //Check that after deletion the file count is now accurate
- File[] filesAfter = new File(path.substring(0, path.lastIndexOf(File.separator))).listFiles();
- int fileCountAfter = filesAfter.length;
- assertEquals("File creation was no registered", fileCountBefore, fileCountAfter);
-
- checkFileLists(filesBefore, filesAfter);
- }
-
- /** Test that an empty directory can be deleted with deleteDirectory */
- public void testEmptyDirectoryDelete()
- {
- String directoryName = "FileUtilsTest-testRecursiveDelete";
- File test = new File(directoryName);
-
- //Record file count in parent directory to check it is not changed by delete
- String path = test.getAbsolutePath();
- File[] filesBefore = new File(path.substring(0, path.lastIndexOf(File.separator))).listFiles();
- int fileCountBefore = filesBefore.length;
-
- assertTrue("Directory exists", !test.exists());
-
- test.mkdir();
- //Ensure the JVM cleans up if cleanup failues
- test.deleteOnExit();
-
- //Try and delete the empty directory
- assertTrue("Non Empty Directory was successfully deleted.", FileUtils.deleteDirectory(directoryName));
-
- //Check directory is still there
- assertTrue("Directory was deleted.", !test.exists());
-
- //Check that after deletion the file count is now accurate
- File[] filesAfter = new File(path.substring(0, path.lastIndexOf(File.separator))).listFiles();
- int fileCountAfter = filesAfter.length;
- assertEquals("File creation was no registered", fileCountBefore, fileCountAfter);
-
- checkFileLists(filesBefore, filesAfter);
-
- }
-
- /** Test that deleteDirectory on a non empty directory to complete */
- public void testNonEmptyDirectoryDelete()
- {
- String directoryName = "FileUtilsTest-testRecursiveDelete";
- File test = new File(directoryName);
-
- assertTrue("Directory exists", !test.exists());
-
- //Record file count in parent directory to check it is not changed by delete
- String path = test.getAbsolutePath();
- File[] filesBefore = new File(path.substring(0, path.lastIndexOf(File.separator))).listFiles();
- int fileCountBefore = filesBefore.length;
-
- test.mkdir();
-
- //Create a file in the directory
- String fileName = test.getAbsolutePath() + File.separatorChar + "testFile";
- File subFile = new File(fileName);
- try
- {
- subFile.createNewFile();
- //Ensure the JVM cleans up if cleanup failues
- subFile.deleteOnExit();
- }
- catch (IOException e)
- {
- fail(e.getMessage());
- }
-
- // Ensure the JVM cleans up if cleanup failues
- // This must be after the subFile as the directory must be empty before
- // the delete is performed
- test.deleteOnExit();
-
- //Try and delete the non-empty directory non-recursively
- assertFalse("Non Empty Directory was successfully deleted.", FileUtils.delete(test, false));
-
- //Check directory is still there
- assertTrue("Directory was deleted.", test.exists());
-
- // Clean up
- assertTrue("Unable to cleanup", FileUtils.delete(test, true));
-
- //Check that after deletion the file count is now accurate
- File[] filesAfter = new File(path.substring(0, path.lastIndexOf(File.separator))).listFiles();
- int fileCountAfter = filesAfter.length;
- assertEquals("File creation was no registered", fileCountBefore, fileCountAfter);
-
- checkFileLists(filesBefore, filesAfter);
-
- }
-
- /** Test that a recursive delete successeds */
- public void testRecursiveDelete()
- {
- String directoryName = "FileUtilsTest-testRecursiveDelete";
- File test = new File(directoryName);
-
- assertTrue("Directory exists", !test.exists());
-
- //Record file count in parent directory to check it is not changed by delete
- String path = test.getAbsolutePath();
- File[] filesBefore = new File(path.substring(0, path.lastIndexOf(File.separator))).listFiles();
- int fileCountBefore = filesBefore.length;
-
- test.mkdir();
-
- createSubDir(directoryName, 2, 4);
-
- //Ensure the JVM cleans up if cleanup failues
- // This must be after the sub dir creation as the delete order is
- // recorded and the directory must be empty to be deleted.
- test.deleteOnExit();
-
- assertFalse("Non recursive delete was able to directory", FileUtils.delete(test, false));
-
- assertTrue("File does not exist after non recursive delete", test.exists());
-
- assertTrue("Unable to cleanup", FileUtils.delete(test, true));
-
- assertTrue("File exist after recursive delete", !test.exists());
-
- //Check that after deletion the file count is now accurate
- File[] filesAfter = new File(path.substring(0, path.lastIndexOf(File.separator))).listFiles();
- int fileCountAfter = filesAfter.length;
- assertEquals("File creation was no registered", fileCountBefore, fileCountAfter);
-
- checkFileLists(filesBefore, filesAfter);
-
- }
-
- private void createSubDir(String path, int directories, int files)
- {
- File directory = new File(path);
-
- assertTrue("Directory" + path + " does not exists", directory.exists());
-
- for (int dir = 0; dir < directories; dir++)
- {
- String subDirName = path + File.separatorChar + "sub" + dir;
- File subDir = new File(subDirName);
-
- subDir.mkdir();
-
- createSubDir(subDirName, directories - 1, files);
- //Ensure the JVM cleans up if cleanup failues
- // This must be after the sub dir creation as the delete order is
- // recorded and the directory must be empty to be deleted.
- subDir.deleteOnExit();
- }
-
- for (int file = 0; file < files; file++)
- {
- String subDirName = path + File.separatorChar + "file" + file;
- File subFile = new File(subDirName);
- try
- {
- subFile.createNewFile();
- //Ensure the JVM cleans up if cleanup failues
- subFile.deleteOnExit();
- }
- catch (IOException e)
- {
- fail(e.getMessage());
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/SerialTest.java b/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/SerialTest.java
deleted file mode 100644
index b2578563e0..0000000000
--- a/M4-RCs/qpid/java/common/src/test/java/org/apache/qpid/util/SerialTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.apache.qpid.util;
-/*
- *
- * 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 junit.framework.TestCase;
-
-import java.util.Random;
-
-import org.apache.qpid.SerialException;
-
-/**
- *Junit tests for the Serial class
- */
-public class SerialTest extends TestCase
-{
-
- /**
- * Test the key boundaries where wraparound occurs.
- */
- public void testBoundaries()
- {
- assertTrue(Serial.gt(1, 0));
- assertTrue(Serial.lt(0, 1));
-
- assertTrue(Serial.gt(Integer.MAX_VALUE+1, Integer.MAX_VALUE));
- assertTrue(Serial.lt(Integer.MAX_VALUE, Integer.MAX_VALUE+1));
-
- assertTrue(Serial.gt(0xFFFFFFFF + 1, 0xFFFFFFFF));
- assertTrue(Serial.lt(0xFFFFFFFF, 0xFFFFFFFF + 1));
- }
-
- /**
- * Test the first Corollary of RFC 1982
- * For any sequence number s and any integer n such that addition of n
- * to s is well defined, (s + n) >= s. Further (s + n) == s only when
- * n == 0, in all other defined cases, (s + n) > s.
- */
- public void testCorollary1()
- {
- int wrapcount = 0;
-
- int s = 0;
-
- for (int i = 0; i < 67108664; i++)
- {
- for (int n = 1; n < 4096; n += 512)
- {
- assertTrue(Serial.gt(s+n, s));
- assertTrue(Serial.lt(s, s+n));
- }
-
- s += 1024;
-
- if (s == 0)
- {
- wrapcount += 1;
- }
- }
-
- assertTrue(wrapcount > 0);
- }
-
-}
diff --git a/M4-RCs/qpid/java/common/templates/method/MethodBodyInterface.vm b/M4-RCs/qpid/java/common/templates/method/MethodBodyInterface.vm
deleted file mode 100644
index d5feba12de..0000000000
--- a/M4-RCs/qpid/java/common/templates/method/MethodBodyInterface.vm
+++ /dev/null
@@ -1,62 +0,0 @@
-#macro( UpperCamel $name )
-#set( $name = "${name.substring(0,1).toUpperCase()}${name.substring(1)}" )
-#end
-#macro( toUpperCamel $name )${name.substring(0,1).toUpperCase()}${name.substring(1)}#end
-
-
-
-#set( $amqp_ClassName = $amqpClass.Name)
-#UpperCamel( $amqp_ClassName )
-#set( $amqp_MethodName = $amqpMethod.Name )
-#UpperCamel( $amqp_MethodName )
-#set( $javaClassName = "${amqp_ClassName}${amqp_MethodName}Body" )
-
-
-#set( $filename = "${javaClassName}.java")
-/*
- *
- * 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 file is auto-generated by ${generator} - do not modify.
- * Supported AMQP version:
- #foreach( $supportedVersion in $model.VersionSet )
- * $supportedVersion.getMajor()-$supportedVersion.getMinor()
- #end
- */
-
-
-package org.apache.qpid.framing;
-
-
-public interface ${javaClassName} extends EncodableAMQDataBlock, AMQMethodBody
-{
-
-
-#foreach( $field in $amqpMethod.Fields )
-
-#if( $amqpMethod.isCommon( $field ) )
- public $field.ConsistentNativeType get#toUpperCamel( ${field.Name} )();
-#end
-#end
-
-
-
-}
diff --git a/M4-RCs/qpid/java/common/templates/method/version/MethodBodyClass.vm b/M4-RCs/qpid/java/common/templates/method/version/MethodBodyClass.vm
deleted file mode 100644
index 9b2ba0fa39..0000000000
--- a/M4-RCs/qpid/java/common/templates/method/version/MethodBodyClass.vm
+++ /dev/null
@@ -1,209 +0,0 @@
-#macro( UpperCamel $name )
-#set( $name = "${name.substring(0,1).toUpperCase()}${name.substring(1)}" )
-#end
-#macro( toUpperCamel $name )${name.substring(0,1).toUpperCase()}${name.substring(1)}#end
-
-
-
-#set( $amqp_ClassName = $amqpClass.Name)
-#UpperCamel( $amqp_ClassName )
-#set( $amqp_MethodName = $amqpMethod.Name )
-#UpperCamel( $amqp_MethodName )
-#set( $javaClassName = "${amqp_ClassName}${amqp_MethodName}BodyImpl" )
-#set( $interfaceName = "${amqp_ClassName}${amqp_MethodName}Body" )
-#set( $amqpPackageName = "amqp_$version.getMajor()_$version.getMinor()" )
-
-#set( $filename = "${amqpPackageName}/${javaClassName}.java")
-/*
- *
- * 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 file is auto-generated by ${generator} - do not modify.
- * Supported AMQP version:
- * $version.getMajor()-$version.getMinor()
- */
-
-#set( $clazz = $amqpClass.asSingleVersionClass( $version ) )
-#set( $method = $amqpMethod.asSingleVersionMethod( $version ) )
-
-package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
-
-import java.util.HashMap;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.AMQException;
-
-public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version.getMinor() implements $interfaceName
-{
- private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
- {
- public AMQMethodBody newInstance(ByteBuffer in, long size) throws AMQFrameDecodingException
- {
- return new ${javaClassName}(in);
- }
-
-
- };
-
-
- public static AMQMethodBodyInstanceFactory getFactory()
- {
- return FACTORY_INSTANCE;
- }
-
- public static int CLASS_ID = $clazz.ClassId;
-
- public static int METHOD_ID = $method.MethodId;
-
-
-
- // Fields declared in specification
-#foreach( $field in $method.ConsolidatedFields )
- private final $field.NativeType _$field.getName(); // $field.UnderlyingFields
-#end
-
-
- // Constructor
-
- public ${javaClassName}(ByteBuffer buffer) throws AMQFrameDecodingException
- {
-#foreach( $field in $method.ConsolidatedFields )
- _$field.Name = read$field.getEncodingType()( buffer );
-#end
- }
-
- public ${javaClassName}(
-#foreach( $field in $method.FieldList )
-#if( $velocityCount == $method.getFieldList().size() )
- $field.NativeType $field.Name
-#else
- $field.NativeType $field.Name,
-#end
-#end
- )
- {
-#set( $consolidatedFieldName = "" )
-#foreach( $field in $method.FieldList )
-#if( $method.isConsolidated( $field.Name ) )
-#if( !$method.getConsolidatedFieldName( $field.Name ).equals( $consolidatedFieldName ) )
-#if( !$consolidatedFieldName.equals("") )
- _$consolidatedFieldName = $consolidatedFieldName; // 1
-#end
-#set( $consolidatedFieldName = $method.getConsolidatedFieldName( $field.Name ) )
- byte $consolidatedFieldName = (byte)0;
-#end
- if( $field.Name )
- {
- $consolidatedFieldName = (byte) (((int) $consolidatedFieldName) | (1 << $method.getPositionInBitField( $field.Name )));
- }
-#if( $velocityCount == $method.getFieldList().size())
- _$consolidatedFieldName = $consolidatedFieldName;
-#else
-
-#end
-#else
-#if( !$consolidatedFieldName.equals("") )
- _$consolidatedFieldName = $consolidatedFieldName;
-#end
-#set( $consolidatedFieldName = "" )
- _$field.Name = $field.Name;
-#end
-#end
- }
-
- public int getClazz()
- {
- return CLASS_ID;
- }
-
- public int getMethod()
- {
- return METHOD_ID;
- }
-
-
-#foreach( $field in $method.FieldList )
- public final $field.NativeType get#toUpperCamel( ${field.Name} )()
- {
-#if( $method.isConsolidated( $field.Name ) )
- return (((int)(_$method.getConsolidatedFieldName( $field.Name ))) & ( 1 << $method.getPositionInBitField( $field.Name ))) != 0;
-#else
- return _$field.Name;
-#end
- }
-#end
-
- protected int getBodySize()
- {
-#set( $fixedSize = 0 )
-#foreach( $field in $method.ConsolidatedFields )
-#if( $field.isFixedSize() )
-#set( $fixedSize = $fixedSize + $field.Size )
-#end
-#end
- int size = $fixedSize;
-#foreach( $field in $method.ConsolidatedFields )
-#if( ! $field.isFixedSize() )
- size += getSizeOf( _$field.Name );
-#end
-#end
- return size;
- }
-
- public void writeMethodPayload(ByteBuffer buffer)
- {
-#foreach( $field in $method.ConsolidatedFields )
- write$field.getEncodingType()( buffer, _$field.Name );
-#end
- }
-
- public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
- {
-#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
-#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
-#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
-#if( $amqpMethod.inAllVersions() )
- return dispatcher.dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(this, channelId);
-#else
- return ((MethodDispatcher_$version.getMajor()_$version.getMinor())dispatcher).dispatch${amqp_ClassName}${amqpMethodNameUpperCamel}(this, channelId);
-
-#end
-
- }
-
-
- public String toString()
- {
- StringBuilder buf = new StringBuilder("[$javaClassName: ");
-#foreach( $field in $method.FieldList )
- buf.append( "$field.Name=" );
- buf.append( get#toUpperCamel( $field.Name )() );
-#if( $velocityCount != $method.FieldList.size() )
- buf.append( ", " );
-#end
-#end
- buf.append("]");
- return buf.toString();
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/templates/model/ClientMethodDispatcherInterface.vm b/M4-RCs/qpid/java/common/templates/model/ClientMethodDispatcherInterface.vm
deleted file mode 100644
index 9e4aee7dee..0000000000
--- a/M4-RCs/qpid/java/common/templates/model/ClientMethodDispatcherInterface.vm
+++ /dev/null
@@ -1,56 +0,0 @@
-#set( $filename = "ClientMethodDispatcher.java")
-/*
- *
- * 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 file is auto-generated by $generator - do not modify.
- * Supported AMQP version:
- #foreach( $supportedVersion in $model.VersionSet )
- * $supportedVersion.getMajor()-$supportedVersion.getMinor()
- #end
- */
-
-package org.apache.qpid.framing;
-
-import org.apache.qpid.AMQException;
-
-
-public interface ClientMethodDispatcher
-{
-
-#foreach( $amqpClass in $model.getClasses() )
-#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
-#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
-#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
-#foreach( $amqpMethodVersions in $amqpClass.getMethods() )
-#if( $amqpMethodVersions.inAllVersions() )
-#set( $amqpMethod = $amqpMethodVersions.asSingleVersionMethod($amqpMethodVersions.getVersionSet().first()) )
-#if( $amqpMethod.isClientMethod() )
-#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
-#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
-#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
- public boolean dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body body, int channelId) throws AMQException;
-#end
-#end
-#end
-#end
-
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/templates/model/MethodDispatcherInterface.vm b/M4-RCs/qpid/java/common/templates/model/MethodDispatcherInterface.vm
deleted file mode 100644
index ff14715fef..0000000000
--- a/M4-RCs/qpid/java/common/templates/model/MethodDispatcherInterface.vm
+++ /dev/null
@@ -1,39 +0,0 @@
-#set( $filename = "MethodDispatcher.java")
-/*
- *
- * 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 file is auto-generated by $generator - do not modify.
- * Supported AMQP version:
- #foreach( $supportedVersion in $model.VersionSet )
- * $supportedVersion.getMajor()-$supportedVersion.getMinor()
- #end
- */
-
-package org.apache.qpid.framing;
-
-import org.apache.qpid.AMQException;
-
-
-public interface MethodDispatcher extends
- ClientMethodDispatcher, ServerMethodDispatcher
-{
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/templates/model/MethodRegistryClass.vm b/M4-RCs/qpid/java/common/templates/model/MethodRegistryClass.vm
deleted file mode 100644
index 759e5e4a42..0000000000
--- a/M4-RCs/qpid/java/common/templates/model/MethodRegistryClass.vm
+++ /dev/null
@@ -1,104 +0,0 @@
-#set( $filename = "MethodRegistry.java")
-/*
- *
- * 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 file is auto-generated by $generator - do not modify.
- * Supported AMQP version:
- #foreach( $supportedVersion in $model.VersionSet )
- * $supportedVersion.getMajor()-$supportedVersion.getMinor()
- #end
- */
-
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
-
-import java.util.Map;
-import java.util.HashMap;
-
-
-public abstract class MethodRegistry
-{
- private static final Map<ProtocolVersion, MethodRegistry> _registries =
- new HashMap<ProtocolVersion, MethodRegistry>();
-
-#foreach( $supportedVersion in $model.VersionSet )
-
-#set( $verName = "_$supportedVersion.getMajor()_$supportedVersion.getMinor()" )
-#set( $regPackage = "org.apache.qpid.framing.amqp$verName" )
- public static final MethodRegistry registry_$supportedVersion.getMajor()_$supportedVersion.getMinor() =
- new ${regPackage}.MethodRegistry${verName}();
-
-#end
-
-
- public abstract AMQMethodBody convertToBody(ByteBuffer in, long size)
- throws AMQFrameDecodingException;
-
- public abstract int getMaxClassId();
-
- public abstract int getMaxMethodId(int classId);
-
-
- protected MethodRegistry(ProtocolVersion pv)
- {
- _registries.put(pv, this);
- }
-
- public static MethodRegistry getMethodRegistry(ProtocolVersion pv)
- {
- return _registries.get(pv);
- }
-
-#foreach( $amqpClass in $model.getClasses() )
-#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
-#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
-#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
-
-#foreach( $amqpMethodVersions in $amqpClass.getMethods() )
-#if( $amqpMethodVersions.isVersionInterfaceConsistent() )
-#set( $amqpMethod = $amqpMethodVersions.asSingleVersionMethod($amqpMethodVersions.getVersionSet().first()) )
-
-#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
-#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
-#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
- public abstract ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body create${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body(
-#foreach( $field in $amqpMethod.FieldList )
-#if( $velocityCount == $amqpMethod.getFieldList().size() )
- final $field.NativeType $field.Name
-#else
- final $field.NativeType $field.Name,
-#end
-#end
- );
-
-
-#end
-#end
-#end
-
-
- public abstract ProtocolVersionMethodConverter getProtocolVersionMethodConverter();
-
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/templates/model/ProtocolVersionListClass.vm b/M4-RCs/qpid/java/common/templates/model/ProtocolVersionListClass.vm
deleted file mode 100644
index 9ac6adfdf5..0000000000
--- a/M4-RCs/qpid/java/common/templates/model/ProtocolVersionListClass.vm
+++ /dev/null
@@ -1,178 +0,0 @@
-#set( $filename = "ProtocolVersion.java" )
-/*
-*
-* 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 file is auto-generated by $generator - do not modify.
-* Supported AMQP versions:
-#foreach( $version in $model.getVersionSet() )
-* $version.getMajor()-$version.getMinor()
-#end
-*/
-
-package org.apache.qpid.framing;
-
-import java.util.SortedSet;
-import java.util.Collections;
-import java.util.TreeSet;
-import java.util.Map;
-import java.util.HashMap;
-
-
-public class ProtocolVersion implements Comparable
-{
- private final byte _majorVersion;
- private final byte _minorVersion;
-
-
- public ProtocolVersion(byte majorVersion, byte minorVersion)
- {
- _majorVersion = majorVersion;
- _minorVersion = minorVersion;
- }
-
- public byte getMajorVersion()
- {
- return _majorVersion;
- }
-
- public byte getMinorVersion()
- {
- return _minorVersion;
- }
-
-
- public int compareTo(Object o)
- {
- ProtocolVersion pv = (ProtocolVersion) o;
-
- /*
- * 0-8 has it's major and minor numbers the wrong way round (it's actually 8-0)...
- * so we need to deal with that case specially
- */
-
- if((_majorVersion == (byte) 8) && (_minorVersion == (byte) 0))
- {
- ProtocolVersion fixedThis = new ProtocolVersion(_minorVersion, _majorVersion);
- return fixedThis.compareTo(pv);
- }
-
- if((pv.getMajorVersion() == (byte) 8) && (pv.getMinorVersion() == (byte) 0))
- {
- ProtocolVersion fixedOther = new ProtocolVersion(pv.getMinorVersion(), pv.getMajorVersion());
- return this.compareTo(fixedOther);
- }
-
- if(_majorVersion > pv.getMajorVersion())
- {
- return 1;
- }
- else if(_majorVersion < pv.getMajorVersion())
- {
- return -1;
- }
- else if(_minorVersion > pv.getMinorVersion())
- {
- return 1;
- }
- else if(getMinorVersion() < pv.getMinorVersion())
- {
- return -1;
- }
- else
- {
- return 0;
- }
-
- }
-
- public boolean equals(Object o)
- {
- return o != null && (o == this || (compareTo(o) == 0));
- }
-
- public int hashCode()
- {
- return (0xFF & (int)_minorVersion) | ((0xFF & (int)_majorVersion) << 8);
- }
-
-
- public boolean isSupported()
- {
- return _supportedVersions.contains(this);
- }
-
- public static ProtocolVersion getLatestSupportedVersion()
- {
- return _supportedVersions.last();
- }
-
- private static final SortedSet<ProtocolVersion> _supportedVersions;
- private static final Map<String, ProtocolVersion> _nameToVersionMap =
- new HashMap<String, ProtocolVersion>();
- private static final ProtocolVersion _defaultVersion;
-
-
-#foreach( $version in $model.getVersionSet() )
-#set( $versionId = "v$version.getMajor()_$version.getMinor()" )
- public static final ProtocolVersion $versionId = new ProtocolVersion((byte)$version.getMajor(),(byte)$version.getMinor());
-#end
-
- static
- {
- SortedSet<ProtocolVersion> versions = new TreeSet<ProtocolVersion>();
-
-#foreach( $version in $model.getVersionSet() )
-#set( $versionId = "v$version.getMajor()_$version.getMinor()" )
- versions.add($versionId);
- _nameToVersionMap.put("${version.getMajor()}-${version.getMinor()}", $versionId);
-#end
- _supportedVersions = Collections.unmodifiableSortedSet(versions);
-
-
- ProtocolVersion systemDefinedVersion =
- _nameToVersionMap.get(System.getProperty("org.apache.qpid.amqp_version"));
-
- _defaultVersion = (systemDefinedVersion == null)
- ? getLatestSupportedVersion()
- : systemDefinedVersion;
- }
-
-
- public static SortedSet<ProtocolVersion> getSupportedProtocolVersions()
- {
- return _supportedVersions;
- }
-
-
-
- public static ProtocolVersion parse(String name)
- {
- return _nameToVersionMap.get(name);
- }
-
- public static ProtocolVersion defaultProtocolVersion()
- {
- return _defaultVersion;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/templates/model/ServerMethodDispatcherInterface.vm b/M4-RCs/qpid/java/common/templates/model/ServerMethodDispatcherInterface.vm
deleted file mode 100644
index b80d6027b7..0000000000
--- a/M4-RCs/qpid/java/common/templates/model/ServerMethodDispatcherInterface.vm
+++ /dev/null
@@ -1,56 +0,0 @@
-#set( $filename = "ServerMethodDispatcher.java")
-/*
- *
- * 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 file is auto-generated by $generator - do not modify.
- * Supported AMQP version:
- #foreach( $supportedVersion in $model.VersionSet )
- * $supportedVersion.getMajor()-$supportedVersion.getMinor()
- #end
- */
-
-package org.apache.qpid.framing;
-
-import org.apache.qpid.AMQException;
-
-
-public interface ServerMethodDispatcher
-{
-
-#foreach( $amqpClass in $model.getClasses() )
-#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
-#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
-#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
-#foreach( $amqpMethodVersions in $amqpClass.getMethods() )
-#if( $amqpMethodVersions.inAllVersions() )
-#set( $amqpMethod = $amqpMethodVersions.asSingleVersionMethod($amqpMethodVersions.getVersionSet().first()) )
-#if( $amqpMethod.isServerMethod() )
-#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
-#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
-#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
- public boolean dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body body, int channelId) throws AMQException;
-#end
-#end
-#end
-#end
-
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/templates/model/version/AmqpConstantsClass.vm b/M4-RCs/qpid/java/common/templates/model/version/AmqpConstantsClass.vm
deleted file mode 100644
index 8d459f2977..0000000000
--- a/M4-RCs/qpid/java/common/templates/model/version/AmqpConstantsClass.vm
+++ /dev/null
@@ -1,37 +0,0 @@
-&{AmqpConstants.java}
-/*
- *
- * 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 file is auto-generated by ${GENERATOR} - do not modify.
- * Supported AMQP versions:
-%{VLIST} * ${major}-${minor}
- */
-
-package org.apache.qpid.framing;
-
-class AmqpConstants
-{
- // Constant getValue methods
-
-%{TLIST} ${const_get_method}
-
-}
diff --git a/M4-RCs/qpid/java/common/templates/model/version/ClientMethodDispatcherInterface.vm b/M4-RCs/qpid/java/common/templates/model/version/ClientMethodDispatcherInterface.vm
deleted file mode 100644
index 80705c1a39..0000000000
--- a/M4-RCs/qpid/java/common/templates/model/version/ClientMethodDispatcherInterface.vm
+++ /dev/null
@@ -1,55 +0,0 @@
-#set( $filename = "amqp_$version.getMajor()_$version.getMinor()/ClientMethodDispatcher_${version.getMajor()}_${version.getMinor()}.java")
-/*
- *
- * 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 file is auto-generated by $generator - do not modify.
- * Supported AMQP version:
- #foreach( $supportedVersion in $model.VersionSet )
- * $supportedVersion.getMajor()-$supportedVersion.getMinor()
- #end
- */
-
-package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-
-
-public interface ClientMethodDispatcher_${version.getMajor()}_${version.getMinor()} extends ClientMethodDispatcher
-{
-
-#foreach( $amqpClass in $model.getClasses() )
-#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
-#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
-#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
-#foreach( $amqpMethodVersions in $amqpClass.getMethods() )
-#set( $amqpMethod = $amqpMethodVersions.asSingleVersionMethod($amqpMethodVersions.getVersionSet().first()) )
-#if( $amqpMethod.isClientMethod() )
-#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
-#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
-#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
- public boolean dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body body, int channelId) throws AMQException;
-#end
-#end
-#end
-
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm b/M4-RCs/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm
deleted file mode 100644
index 8a7b667a91..0000000000
--- a/M4-RCs/qpid/java/common/templates/model/version/MethodDispatcherInterface.vm
+++ /dev/null
@@ -1,43 +0,0 @@
-#set( $filename = "amqp_$version.getMajor()_$version.getMinor()/MethodDispatcher_${version.getMajor()}_${version.getMinor()}.java")
-/*
- *
- * 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 file is auto-generated by $generator - do not modify.
- * Supported AMQP version:
- #foreach( $supportedVersion in $model.VersionSet )
- * $supportedVersion.getMajor()-$supportedVersion.getMinor()
- #end
- */
-
-package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-
-
-public interface MethodDispatcher_${version.getMajor()}_${version.getMinor()}
- extends MethodDispatcher,
- ServerMethodDispatcher_${version.getMajor()}_${version.getMinor()},
- ClientMethodDispatcher_${version.getMajor()}_${version.getMinor()}
-{
-
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/templates/model/version/MethodRegistryClass.vm b/M4-RCs/qpid/java/common/templates/model/version/MethodRegistryClass.vm
deleted file mode 100644
index 277605e34b..0000000000
--- a/M4-RCs/qpid/java/common/templates/model/version/MethodRegistryClass.vm
+++ /dev/null
@@ -1,193 +0,0 @@
-#set( $filename = "amqp_$version.getMajor()_$version.getMinor()/MethodRegistry_${version.getMajor()}_${version.getMinor()}.java")
-/*
- *
- * 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 file is auto-generated by $generator - do not modify.
- * Supported AMQP version:
- * $version.getMajor()-$version.getMinor()
- */
-
-package org.apache.qpid.framing.amqp_${version.getMajor()}_${version.getMinor()};
-
-import org.apache.qpid.framing.*;
-import org.apache.qpid.protocol.AMQConstant;
-
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
-
-
-public class MethodRegistry_$version.getMajor()_$version.getMinor() extends MethodRegistry
-{
-
- private static final Logger _log = LoggerFactory.getLogger(MethodRegistry.class);
-
- private ProtocolVersionMethodConverter _protocolVersionConverter = new MethodConverter_$version.getMajor()_$version.getMinor()();
-
-#set( $specificModel = $model.asSingleVersionModel() )
-
-
-#set( $maxClassId = $specificModel.getMaximumClassId()+1 )
- private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[$maxClassId][];
-
- public MethodRegistry_$version.getMajor()_$version.getMinor()()
- {
- this(new ProtocolVersion((byte)$version.getMajor(),(byte)$version.getMinor()));
- }
-
- public MethodRegistry_$version.getMajor()_$version.getMinor()(ProtocolVersion pv)
- {
- super(pv);
-#foreach( $amqpClass in $specificModel.getClassList() )
-#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
-#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
-#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
-
-
-
- // Register method body instance factories for the $amqpClassNameUpperCamel class.
-
-#set( $maxMethodId = $amqpClass.getMaximumMethodId()+1 )
- _factories[$amqpClass.getClassId()] = new AMQMethodBodyInstanceFactory[$maxMethodId];
-
-#foreach( $amqpMethod in $amqpClass.getMethodList() )
-#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
-#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
-#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
- _factories[$amqpClass.getClassId()][$amqpMethod.getMethodId()] = ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}BodyImpl.getFactory();
-#end
-
-#end
-
-
- }
-
-
- public AMQMethodBody convertToBody(ByteBuffer in, long size)
- throws AMQFrameDecodingException
- {
- int classId = in.getUnsignedShort();
- int methodId = in.getUnsignedShort();
-
- AMQMethodBodyInstanceFactory bodyFactory;
- try
- {
- bodyFactory = _factories[classId][methodId];
- }
- catch(NullPointerException e)
- {
- throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
- "Class " + classId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
- + " (while trying to decode class " + classId + " method " + methodId + ".");
- }
- catch(IndexOutOfBoundsException e)
- {
- if(classId >= _factories.length)
- {
- throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
- "Class " + classId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
- + " (while trying to decode class " + classId + " method " + methodId + ".");
-
- }
- else
- {
- throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
- "Method " + methodId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
- + " (while trying to decode class " + classId + " method " + methodId + ".");
-
- }
- }
-
-
- if (bodyFactory == null)
- {
- throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
- "Method " + methodId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
- + " (while trying to decode class " + classId + " method " + methodId + ".");
- }
-
-
- return bodyFactory.newInstance(in, size);
-
-
- }
-
-
- public int getMaxClassId()
- {
- return $specificModel.getMaximumClassId();
- }
-
- public int getMaxMethodId(int classId)
- {
- return _factories[classId].length - 1;
- }
-
-
-
-#foreach( $amqpClass in $specificModel.getClassList() )
-#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
-#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
-#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
-
-
-#foreach( $amqpMethod in $amqpClass.getMethodList() )
-#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
-#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
-#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
- public ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body create${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body(
-#foreach( $field in $amqpMethod.FieldList )
-#if( $velocityCount == $amqpMethod.getFieldList().size() )
- final $field.NativeType $field.Name
-#else
- final $field.NativeType $field.Name,
-#end
-#end
- )
- {
- return new ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}BodyImpl(
-#foreach( $field in $amqpMethod.FieldList )
-#if( $velocityCount == $amqpMethod.getFieldList().size() )
- $field.Name
-#else
- $field.Name,
-#end
-#end
- );
- }
-
-#end
-
-#end
-
-
- public ProtocolVersionMethodConverter getProtocolVersionMethodConverter()
- {
- return _protocolVersionConverter;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/common/templates/model/version/ServerMethodDispatcherInterface.vm b/M4-RCs/qpid/java/common/templates/model/version/ServerMethodDispatcherInterface.vm
deleted file mode 100644
index db388fcc65..0000000000
--- a/M4-RCs/qpid/java/common/templates/model/version/ServerMethodDispatcherInterface.vm
+++ /dev/null
@@ -1,55 +0,0 @@
-#set( $filename = "amqp_$version.getMajor()_$version.getMinor()/ServerMethodDispatcher_${version.getMajor()}_${version.getMinor()}.java")
-/*
- *
- * 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 file is auto-generated by $generator - do not modify.
- * Supported AMQP version:
- #foreach( $supportedVersion in $model.VersionSet )
- * $supportedVersion.getMajor()-$supportedVersion.getMinor()
- #end
- */
-
-package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-
-
-public interface ServerMethodDispatcher_${version.getMajor()}_${version.getMinor()} extends ServerMethodDispatcher
-{
-
-#foreach( $amqpClass in $model.getClasses() )
-#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
-#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
-#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
-#foreach( $amqpMethodVersions in $amqpClass.getMethods() )
-#set( $amqpMethod = $amqpMethodVersions.asSingleVersionMethod($amqpMethodVersions.getVersionSet().first()) )
-#if( $amqpMethod.isServerMethod() )
-#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
-#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
-#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
- public boolean dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body body, int channelId) throws AMQException;
-#end
-#end
-#end
-
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/common/templating.py b/M4-RCs/qpid/java/common/templating.py
deleted file mode 100644
index 732e96fa60..0000000000
--- a/M4-RCs/qpid/java/common/templating.py
+++ /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.
-#
-
-class Parser:
-
- def __init__(self, **kwargs):
- self.output = ""
- self.environ = {"out": self.parse}
- for k, v in kwargs.items():
- self.environ[k] = v
- self.text = ""
- self.level = 0
- self.line = None
-
- def action(self, actor):
- text = self.text
- self.text = ""
- actor(text)
-
- def out(self, text):
- self.output += text
-
- def prefix_lines(self, text):
- return "%s%s" % ("\n"*(self.line - 1 - text.count("\n")), text)
-
- def evaluate(self, text):
- self.out(str(eval(self.prefix_lines(text), self.environ, self.environ)))
-
- def execute(self, text):
- exec self.prefix_lines(text) in self.environ, self.environ
-
- def parse(self, input):
- old_line = self.line
- try:
- state = self.start
- self.line = 1
- for ch in input:
- state = state(ch)
- if ch == "\n":
- self.line += 1
- if state == self.start:
- self.action(self.out)
- elif state == self.alnum:
- self.action(self.evaluate)
- else:
- raise ParseError()
- finally:
- self.line = old_line
-
- def start(self, ch):
- if ch == "$":
- return self.dollar
- else:
- self.text += ch
- return self.start
-
- def dollar(self, ch):
- if ch == "$":
- self.text += "$"
- return self.start
- elif ch == "(":
- self.action(self.out)
- return self.expression
- elif ch == "{":
- self.action(self.out)
- return self.block
- else:
- self.action(self.out)
- self.text += ch
- return self.alnum
-
- def alnum(self, ch):
- if ch.isalnum():
- self.text += ch
- return self.alnum
- else:
- self.action(self.evaluate)
- self.text += ch
- return self.start
-
- def match(self, ch, start, end):
- if ch == start:
- self.level += 1
- if ch == end:
- self.level -= 1
-
- def block(self, ch):
- if not self.level and ch == "}":
- self.action(self.execute)
- return self.start
- else:
- self.match(ch, "{", "}")
- self.text += ch
- return self.block
-
- def expression(self, ch):
- if not self.level and ch == ")":
- self.action(self.evaluate)
- return self.start
- else:
- self.match(ch, "(", ")")
- self.text += ch
- return self.expression
diff --git a/M4-RCs/qpid/java/cpp.async.testprofile b/M4-RCs/qpid/java/cpp.async.testprofile
deleted file mode 100644
index 746ef2c0ef..0000000000
--- a/M4-RCs/qpid/java/cpp.async.testprofile
+++ /dev/null
@@ -1,3 +0,0 @@
-broker.version=0-10
-broker=${project.root}/../cpp/src/qpidd -p @PORT --data-dir ${build.data}/@PORT -t --load-module ${project.root}/../../cppStore/cpp/lib/.libs/msgstore.so --auth no
-test.excludesfile=${project.root}/ExcludeList ${project.root}/010ExcludeList-store
diff --git a/M4-RCs/qpid/java/cpp.cluster.testprofile b/M4-RCs/qpid/java/cpp.cluster.testprofile
deleted file mode 100644
index 1807ae098b..0000000000
--- a/M4-RCs/qpid/java/cpp.cluster.testprofile
+++ /dev/null
@@ -1,5 +0,0 @@
-broker.version=0-10
-broker=${project.root}/../cpp/src/qpidd --load-module ${project.root}/../cpp/src/.libs/cluster.so --cluster-name cpp-java-test-cluster -p @PORT --data-dir ${build.data}/@PORT -t --auth no
-test.excludesfile=${project.root}/ExcludeList ${project.root}/XAExcludeList ${project.root}/010ExcludeList
-
-profile.clustered=true
diff --git a/M4-RCs/qpid/java/cpp.noprefetch.testprofile b/M4-RCs/qpid/java/cpp.noprefetch.testprofile
deleted file mode 100644
index e502f3c950..0000000000
--- a/M4-RCs/qpid/java/cpp.noprefetch.testprofile
+++ /dev/null
@@ -1,4 +0,0 @@
-broker.version=0-10
-broker=${project.root}/../cpp/src/qpidd -p @PORT --data-dir ${build.data}/@PORT -t --load-module ${project.root}/../../cppStore/cpp/lib/.libs/msgstore.so --auth no
-test.excludesfile=${project.root}/ExcludeList ${project.root}/010ExcludeList-noPrefetch
-max_prefetch=0
diff --git a/M4-RCs/qpid/java/cpp.testprofile b/M4-RCs/qpid/java/cpp.testprofile
deleted file mode 100644
index af2d0f58e4..0000000000
--- a/M4-RCs/qpid/java/cpp.testprofile
+++ /dev/null
@@ -1,3 +0,0 @@
-broker.version=0-10
-broker=${project.root}/../cpp/src/qpidd -p @PORT --data-dir ${build.data}/@PORT -t --auth no
-test.excludesfile=${project.root}/ExcludeList ${project.root}/010ExcludeList
diff --git a/M4-RCs/qpid/java/default-longrunning.testprofile b/M4-RCs/qpid/java/default-longrunning.testprofile
deleted file mode 100644
index 155e78ad0a..0000000000
--- a/M4-RCs/qpid/java/default-longrunning.testprofile
+++ /dev/null
@@ -1 +0,0 @@
-test.includesfile=${project.root}/08LongRunningList
diff --git a/M4-RCs/qpid/java/default.testprofile b/M4-RCs/qpid/java/default.testprofile
deleted file mode 100644
index ab22d58b28..0000000000
--- a/M4-RCs/qpid/java/default.testprofile
+++ /dev/null
@@ -1,25 +0,0 @@
-broker.version=0-8
-broker=vm
-broker.clean=${project.root}/clean-dir ${build.data}
-broker.ready=Listening on TCP port
-
-java.naming.provider.url=${project.root}/test-provider.properties
-max_prefetch=1000
-
-log=debug
-amqj.logging.level=${log}
-amqj.protocol.logging.level=${log}
-root.logging.level=${log}
-log4j.configuration=file:///${project.root}/log4j-test.xml
-log4j.debug=false
-
-test.excludes=true
-test.excludesfile=${project.root}/ExcludeList ${project.root}/XAExcludeList ${project.root}/08ExcludeList
-test.fork=no
-test.mem=512M
-test=*Test
-haltonfailure=no
-haltonerror=no
-exclude.modules=none
-
-profile.clustered=false
diff --git a/M4-RCs/qpid/java/doc/AMQBlazeDetailedDesign.vsd b/M4-RCs/qpid/java/doc/AMQBlazeDetailedDesign.vsd
deleted file mode 100644
index 90577c69cf..0000000000
--- a/M4-RCs/qpid/java/doc/AMQBlazeDetailedDesign.vsd
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/doc/FramingClassDiagram.vsd b/M4-RCs/qpid/java/doc/FramingClassDiagram.vsd
deleted file mode 100644
index 8db65255ea..0000000000
--- a/M4-RCs/qpid/java/doc/FramingClassDiagram.vsd
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/doc/broker-overview.dia b/M4-RCs/qpid/java/doc/broker-overview.dia
deleted file mode 100644
index 2d943beadf..0000000000
--- a/M4-RCs/qpid/java/doc/broker-overview.dia
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/etc/coding_standards.xml b/M4-RCs/qpid/java/etc/coding_standards.xml
deleted file mode 100644
index fdb42c1b9c..0000000000
--- a/M4-RCs/qpid/java/etc/coding_standards.xml
+++ /dev/null
@@ -1,138 +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.
-
--->
-
-<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.1//EN" "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
-<module name="Checker">
- <!-- Checks package.html defined for all packages. -->
- <module name="PackageHtml"/>
-
- <module name="TreeWalker">
-
- <!-- Whitespace conventions. -->
- <module name="TabCharacter"/>
-
- <!-- License conventions. Checks that the license is included in every file. -->
- <module name="Header">
- <property name="headerFile" value="${checkstyle.header.file}"/>
- </module>
-
- <!-- Coding style conventions. -->
- <module name="com.puppycrawl.tools.checkstyle.checks.coding.PackageDeclarationCheck">
- <property name="severity" value="error"/>
- </module>
-
- <!-- These rules ensure that everything is javadoc'ed. -->
- <!--
- <module name="RequiredRegexp">
- <property name="format" value="&lt;table id=&quot;crc&quot;&gt;&lt;caption&gt;CRC Card&lt;/caption&gt;"/>
- </module>
- -->
-
- <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTypeCheck">
- <property name="excludeScope" value="nothing"/>
- <property name="scope" value="private"/>
- <property name="severity" value="error"/>
- <property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/>
- <property name="allowMissingParamTags" value="true"/>
- </module>
-
- <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocVariableCheck">
- <property name="excludeScope" value="nothing"/>
- <property name="scope" value="private"/>
- <property name="severity" value="error"/>
- </module>
-
- <module name="com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck">
- <property name="allowMissingParamTags" value="false"/>
- <property name="allowMissingReturnTag" value="false"/>
- <property name="allowMissingThrowsTags" value="false"/>
- <property name="allowThrowsTagsForSubclasses" value="false"/>
- <property name="allowUndeclaredRTE" value="true"/>
- <property name="allowMissingJavadoc" value="false"/>
- <property name="allowMissingPropertyJavadoc" value="true"/>
- <property name="excludeScope" value="nothing"/>
- <property name="scope" value="private"/>
- <property name="severity" value="error"/>
- <property name="tokens" value="METHOD_DEF, CTOR_DEF"/>
- </module>
-
- <module name="JavadocStyle">
- <property name="scope" value="private"/>
- <property name="checkHtml" value="false"/>
- <property name="checkFirstSentence" value="true"/>
- <property name="checkEmptyJavadoc" value="true"/>
- </module>
-
- <!-- These rules enforce the conventions for the naming of variables. -->
- <!--
- <module name="com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck">
- <property name="format" value="^log$|^[A-Z](_?[A-Z0-9]+)*$"/>
- <property name="severity" value="error"/>
- </module>
-
- <module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck">
- <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
- <property name="severity" value="error"/>
- </module>
-
- <module name="com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck">
- <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
- <property name="severity" value="error"/>
- </module>
-
- <module name="com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck">
- <property name="applyToPackage" value="true"/>
- <property name="applyToPrivate" value="true"/>
- <property name="applyToProtected" value="true"/>
- <property name="applyToPublic" value="true"/>
- <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
- <property name="severity" value="error"/>
- </module>
-
- <module name="com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck">
- <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
- <property name="severity" value="error"/>
- </module>
-
- <module name="com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck">
- <property name="format" value="^[a-z]+(\.[a-zA-Z_][a-zA-Z0-9_]*)*$"/>
- <property name="severity" value="error"/>
- </module>
-
- <module name="com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck">
- <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
- <property name="severity" value="error"/>
- </module>
-
- <module name="com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck">
- <property name="format" value="^[a-z][a-zA-Z0-9_]*$"/>
- <property name="severity" value="error"/>
- </module>
-
- <module name="com.puppycrawl.tools.checkstyle.checks.naming.TypeNameCheck">
- <property name="format" value="^[A-Z][a-zA-Z0-9_]*$"/>
- <property name="severity" value="error"/>
- <property name="tokens" value="CLASS_DEF, INTERFACE_DEF"/>
- </module>
- -->
- </module>
-</module>
diff --git a/M4-RCs/qpid/java/etc/license_header.txt b/M4-RCs/qpid/java/etc/license_header.txt
deleted file mode 100644
index 02ee6e8f98..0000000000
--- a/M4-RCs/qpid/java/etc/license_header.txt
+++ /dev/null
@@ -1,20 +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.
- *
- */ \ No newline at end of file
diff --git a/M4-RCs/qpid/java/etc/log4j.xml b/M4-RCs/qpid/java/etc/log4j.xml
deleted file mode 100644
index 266c466a3a..0000000000
--- a/M4-RCs/qpid/java/etc/log4j.xml
+++ /dev/null
@@ -1,61 +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.
--->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <!-- ============================== -->
- <!-- Append messages to the console -->
- <!-- ============================== -->
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out"/>
- <param name="Threshold" value="ALL"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%m%n"/>
- </layout>
-
- </appender>
-
- <!-- ================ -->
- <!-- Limit categories -->
- <!-- ================ -->
-
- <category name="org.apache.qpid">
- <priority value="${amqj.logging.level}" logger="CONSOLE"/>
- </category>
-
- <!-- ======================= -->
- <!-- Setup the Root category -->
- <!-- ======================= -->
-
- <root level="${root.logging.level}">
- <appender-ref ref="CONSOLE"/>
- </root>
-
-</log4j:configuration>
diff --git a/M4-RCs/qpid/java/integrationtests/README.txt b/M4-RCs/qpid/java/integrationtests/README.txt
deleted file mode 100644
index 00a21883a9..0000000000
--- a/M4-RCs/qpid/java/integrationtests/README.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-This module contains integration tests, for testing a java client againt *any* broker
-implementation or against other clients. These tests must not rely on starting the
-Java broker in-vm but must depend on a broker being started independantly before running
-the tests in this module. By default tests in this module will expect the broker to be
-started on localhost on the default port, but this can be overridden by passing in a
-sys property to maven. Interop tests are in this module. Java broker specific tests that
-use an in-vm broker should go in the systests module.
-
-Don't set the tests in this module to run by default as part of the maven build, until
-there is a script to start and stop the broker; needed to fully automate these tests.
-Interop tests will always be run using a seperate script (not from maven) but it might
-be worthwile to script into the maven build starting of the Java broker, and running
-these tests against it. \ No newline at end of file
diff --git a/M4-RCs/qpid/java/integrationtests/bin/interoptests.py b/M4-RCs/qpid/java/integrationtests/bin/interoptests.py
deleted file mode 100755
index a883a22a5f..0000000000
--- a/M4-RCs/qpid/java/integrationtests/bin/interoptests.py
+++ /dev/null
@@ -1,180 +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 glob, os, subprocess
-from subprocess import Popen
-from optparse import OptionParser
-
-interop_cases = ["InteropTestCase1DummyRun", "InteropTestCase2BasicP2P", "InteropTestCase3BasicPubSub", "InteropTestCase4P2PMessageSize", "InteropTestCase5PubSubMessageSize"]
-
-interop_command = "java -cp %s org.apache.qpid.test.framework.distributedtesting.Coordinator --xml -e interop -o . -n interop org.apache.qpid.interop.testcases.%s"
-
-# TODO: read this from the ant properties file
-clientlibs = ["qpid-integrationtests-M4.jar",
- "qpid-junit-toolkit-M4.jar",
- "junit-3.8.1.jar",
- "qpid-systests-M4.jar",
- "qpid-junit-toolkit-M4.jar",
- "geronimo-jms_1.1_spec-1.0.jar",
- "log4j-1.2.12.jar"]
-
-def main():
- parser = OptionParser()
- parser.add_option("-t", "--testlib", dest="testlib", action="store",
- type="string",
- help="The directory containing the test classes to run")
- parser.add_option("-b", "--brokers", dest="brokers", action="store",
- type="string",
- help="The directory containing the unpacked brokers to test")
- parser.add_option("-j", "--java", dest="java", action="store",
- type="string",
- help="The directory containing the java client to test")
- parser.add_option("-d", "--dotnet", dest="dotnet", action="store",
- type="string",
- help="The directory containing the .Net client to test")
- parser.add_option("-c", "--cpp", dest="cpp", action="store",
- type="string",
- help="The directory containing the C++ client to test")
- (options, args) = parser.parse_args()
-
- # check available brokers
- if (options.brokers == None or
- not os.path.exists(options.brokers) or
- not os.path.isdir(options.brokers)):
- parser.error("Broker directory must be specified and must exist")
-
- # check available clients
- if (options.java == None or
- not os.path.exists(options.java) or
- not os.path.isdir(options.java)):
- parser.error("Java client directory must be specified and must exist")
-
- # check available tests
- if (options.testlib == None or
- not os.path.exists(options.testlib) or
- not os.path.isdir(options.testlib)):
- parser.error("Test directory must be specified and must exist")
-
- # check dotnet test client
- if (options.dotnet == None or
- not os.path.exists(options.dotnet) or
- not os.path.exists(options.dotnet+"/TestClient.exe")):
- parser.error(".Net test directory must be specified and must contain TestClient.exe")
-
- # check cpp test client
- if (options.cpp == None or
- not os.path.exists(options.cpp) or
- not os.path.exists(options.cpp+"/src/tests/interop_runner")):
- parser.error("C++ test directory must be specified and must contain test client")
-
- # Get list of available broker and client versions
- brokers = glob.glob(options.brokers+"/qpid-[0-9].[0-9].[0-9].[0-9]")
- java_clients = glob.glob(options.java+"/qpid-[0-9].[0-9].[0-9].[0-9]*")
-
- if (not len(brokers) > 0):
- parser.error("Broker directory did not contain any brokers!")
-
- if (not len(java_clients) > 0):
- parser.error("Broker directory did not contain any brokers!")
-
- for broker in brokers:
- for client in java_clients:
- test(options.testlib, broker, client, options.dotnet,
- options.cpp)
-
-def start_dotnet(dotnetpath):
- return Popen(["%s/TestClient.exe" % os.path.abspath(dotnetpath),
- "-bamqp://guest:guest@clientid/?brokerlist=\'tcp://localhost:5672\'"],
- stdin=subprocess.PIPE, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
-
-def start_java(javapath):
- # Setup classpath
- classpath = ""
- for lib in clientlibs:
- classpath = classpath + testlibdir+"/"+lib+";"
-
- classpath = classpath + javapath+"/lib/qpid-all.jar"
-
- # Add qpid common since the tests need that, classpath hatefulness
- classpath = classpath + ";"+testlibdir+"/qpid-common-M4.jar"
-
- return Popen(["java", "-cp","\""+classpath+"\"",
- "org.apache.qpid.test.framework.distributedtesting.TestClient"],
- stdin=subprocess.PIPE, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
-
-def start_cpp(cpppath):
- return Popen([cpppath+"tests/interop_runner"],
- stdin=subprocess.PIPE, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
-
-def run_tests():
- for testcase in interop_cases:
- cmd = " ".join(["java", "-cp","\""+classpath+"\"", "org.apache.qpid.test.framework.distributedtesting.Coordinator",
- "--xml", "-e", "interop", "-o", ".", "-n", "interop", ("org.apache.qpid.interop.testcases.%s" % testcase)])
- fd = os.popen(cmd, "r")
- output = fd.read()
- fd.close()
-
-def test(testlibdir, brokerpath, javapath, dotnetpath, cpppath):
- print ("Testing broker in %s\nclient in %s" % (brokerpath, javapath))
- print ("Logging too %s" % ("/tmp/qpid-interop-tests/%s-%s" %
- (os.path.basename(brokerpath), os.path.basename(javapath))))
- os.environ["QPID_HOME"] = brokerpath
- os.environ["QPID_WORK"] = ("/tmp/qpid-interop-tests/%s-%s" %
- (os.path.basename(brokerpath), os.path.basename(javapath)))
-
- brokerp, javacp, dotnetp, cppp, coordinatorp = (None, None, None, None, None)
-
- try:
- # Start broker
- brokerp = Popen(brokerpath+"/bin/qpid-server",
- stdin=subprocess.PIPE, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
- print ("Started broker, pid %s" % brokerp.pid)
-
- cppp = start_cpp(cpppath)
- print ("Started C++ client, pid %s" % cppp.pid)
-
- dotnetp = start_dotnet(dotnetpath)
- print ("Started .Net client, pid %s" % dotnetp.pid)
-
- javacp = start_java(javapath)
- print ("Started client, pid %s" % javacp.pid)
-
- run_tests()
-
- finally:
- # Shutdown broker and clients
- if javacp != None:
- os.kill(javacp.pid, 9)
- if dotnetp != None:
- os.kill(dotnetp.pid, 9)
- if coordinatorp != None:
- os.kill(coordinatorp.pid, 9)
- if brokerp != None:
- os.kill(brokerp.pid, 9)
-
- # Start coordinator
-
-
-if __name__ == "__main__":
- main()
diff --git a/M4-RCs/qpid/java/integrationtests/build.xml b/M4-RCs/qpid/java/integrationtests/build.xml
deleted file mode 100644
index 29d066edb7..0000000000
--- a/M4-RCs/qpid/java/integrationtests/build.xml
+++ /dev/null
@@ -1,28 +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.
- -
- -->
-<project name="Integration Tests" default="build">
-
- <property name="module.depends" value="systests client common junit-toolkit"/>
- <property name="module.dist" value="false"/>
-
- <import file="../module.xml"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/integrationtests/docs/RunningSustainedTests.txt b/M4-RCs/qpid/java/integrationtests/docs/RunningSustainedTests.txt
deleted file mode 100644
index db4405a32d..0000000000
--- a/M4-RCs/qpid/java/integrationtests/docs/RunningSustainedTests.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-In addition to the integration tests the framework provided by this package also allows for
-sustained tests to be run. Currently avaible tests:
-- org.apache.qpid.sustained.SustainedClientTestCase : Pub Sub test to determine steady state throughput.
-
-
-Running Tests.
-
-Run the tests as per the integration tests.
-- Start a broker
-- Start at least one test client [java org.apache.qpid.interop.TestClient], ensuring unique naming.
-
-- Start the test coordinator with the 'fanout' engine, on the sustained test case [java org.apache.qpid.test.framework.distributedtesting.Coordinator]
-
-- Additional Test clients can be started and joined into the running test: [java org.apache.qpid.interop.TestClient -j]
-
-
-
diff --git a/M4-RCs/qpid/java/integrationtests/jar-with-dependencies.xml b/M4-RCs/qpid/java/integrationtests/jar-with-dependencies.xml
deleted file mode 100644
index 3e95e7ab22..0000000000
--- a/M4-RCs/qpid/java/integrationtests/jar-with-dependencies.xml
+++ /dev/null
@@ -1,47 +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 is an assembly descriptor that produces a jar file that contains all the
- dependencies, fully expanded into a single jar, required to run the tests of
- a maven project.
- -->
-<assembly>
- <id>all-test-deps</id>
- <formats>
- <format>jar</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <outputDirectory></outputDirectory>
- <outputFileNameMapping></outputFileNameMapping>
- <unpack>true</unpack>
- <scope>test</scope>
- </dependencySet>
- </dependencySets>
- <fileSets>
- <fileSet>
- <directory>target/classes</directory>
- <outputDirectory></outputDirectory>
- </fileSet>
- <fileSet>
- <directory>target/test-classes</directory>
- <outputDirectory></outputDirectory>
- </fileSet>
- </fileSets>
-</assembly>
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java
deleted file mode 100644
index db17c7aacc..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java
+++ /dev/null
@@ -1,135 +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.
- *
- */
-package org.apache.qpid.interop.clienttestcases;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.distributedtesting.TestClientControlledTest;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Session;
-
-/**
- * Implements tet case 1, dummy run. This test case sends no test messages, it exists to confirm that the test harness
- * is interacting with the coordinator correctly.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Supply the name of the test case that this implements.
- * <tr><td> Accept/Reject invites based on test parameters.
- * <tr><td> Adapt to assigned roles.
- * <tr><td> Perform test case actions.
- * <tr><td> Generate test reports.
- * </table>
- */
-public class TestCase1DummyRun implements TestClientControlledTest
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(TestCase1DummyRun.class);
-
- /**
- * Should provide the name of the test case that this class implements. The exact names are defined in the
- * interop testing spec.
- *
- * @return The name of the test case that this implements.
- */
- public String getName()
- {
- log.debug("public String getName(): called");
-
- return "TC1_DummyRun";
- }
-
- /**
- * Determines whether the test invite that matched this test case is acceptable.
- *
- * @param inviteMessage The invitation to accept or reject.
- *
- * @return <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public boolean acceptInvite(Message inviteMessage) throws JMSException
- {
- log.debug("public boolean acceptInvite(Message inviteMessage): called");
-
- // Test parameters don't matter, accept all invites.
- return true;
- }
-
- /**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the
- * assignment message. When this method return the test case will be ready to execute.
- *
- * @param role The role to be played; sender or receivers.
- * @param assignRoleMessage The role assingment message, contains the full test parameters.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
- {
- log.debug("public void assignRole(Roles role, Message assignRoleMessage): called");
-
- // Do nothing, both roles are the same.
- }
-
- /**
- * Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
- *
- * @param numMessages The number of test messages to send.
- */
- public void start(int numMessages)
- {
- log.debug("public void start(): called");
-
- // Do nothing.
- }
-
- /**
- * Gets a report on the actions performed by the test case in its assigned role.
- *
- * @param session The controlSession to create the report message in.
- *
- * @return The report message.
- *
- * @throws JMSException Any JMSExceptions resulting from creating the report are allowed to fall through.
- */
- public Message getReport(Session session) throws JMSException
- {
- log.debug("public Message getReport(Session controlSession): called");
-
- // Generate a dummy report, the coordinator expects a report but doesn't care what it is.
- return session.createTextMessage("Dummy Run, Ok.");
- }
-
- /**
- * Handles incoming test messages. Does nothing.
- *
- * @param message The incoming test message.
- */
- public void onMessage(Message message)
- {
- log.debug("public void onMessage(Message message = " + message + "): called");
-
- // Ignore any messages.
- }
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java
deleted file mode 100644
index 36d3cce7f7..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java
+++ /dev/null
@@ -1,209 +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.
- *
- */
-package org.apache.qpid.interop.clienttestcases;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.TestUtils;
-import org.apache.qpid.test.framework.distributedtesting.TestClient;
-import org.apache.qpid.test.framework.distributedtesting.TestClientControlledTest;
-
-import javax.jms.*;
-
-/**
- * Implements test case 2, basic P2P. Sends/received a specified number of messages to a specified route on the
- * default direct exchange. Produces reports on the actual number of messages sent/received.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Supply the name of the test case that this implements.
- * <tr><td> Accept/Reject invites based on test parameters.
- * <tr><td> Adapt to assigned roles.
- * <tr><td> Send required number of test messages.
- * <tr><td> Generate test reports.
- * </table>
- */
-public class TestCase2BasicP2P implements TestClientControlledTest, MessageListener
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(TestCase2BasicP2P.class);
-
- /** Holds the count of test messages received. */
- private int messageCount;
-
- /** The role to be played by the test. */
- private Roles role;
-
- /** The number of test messages to send. */
- private int numMessages;
-
- /** The connection to send the test messages on. */
- private Connection connection;
-
- /** The controlSession to send the test messages on. */
- private Session session;
-
- /** The producer to send the test messages with. */
- MessageProducer producer;
-
- /**
- * Should provide the name of the test case that this class implements. The exact names are defined in the
- * interop testing spec.
- *
- * @return The name of the test case that this implements.
- */
- public String getName()
- {
- log.debug("public String getName(): called");
-
- return "TC2_BasicP2P";
- }
-
- /**
- * Determines whether the test invite that matched this test case is acceptable.
- *
- * @param inviteMessage The invitation to accept or reject.
- *
- * @return <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public boolean acceptInvite(Message inviteMessage) throws JMSException
- {
- log.debug("public boolean acceptInvite(Message inviteMessage = " + inviteMessage + "): called");
-
- // All invites are acceptable.
- return true;
- }
-
- /**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the
- * assignment message. When this method return the test case will be ready to execute.
- *
- * @param role The role to be played; sender or receivers.
- *
- * @param assignRoleMessage The role assingment message, contains the full test parameters.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
- {
- log.debug("public void assignRole(Roles role = " + role + ", Message assignRoleMessage = " + assignRoleMessage
- + "): called");
-
- // Reset the message count for a new test.
- messageCount = 0;
-
- // Take note of the role to be played.
- this.role = role;
-
- // Create a new connection to pass the test messages on.
- connection = TestUtils.createConnection(TestClient.testContextProperties);
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Extract and retain the test parameters.
- numMessages = assignRoleMessage.getIntProperty("P2P_NUM_MESSAGES");
- Destination sendDestination = session.createQueue(assignRoleMessage.getStringProperty("P2P_QUEUE_AND_KEY_NAME"));
-
- log.debug("numMessages = " + numMessages);
- log.debug("sendDestination = " + sendDestination);
- log.debug("role = " + role);
-
- switch (role)
- {
- // Check if the sender role is being assigned, and set up a message producer if so.
- case SENDER:
- producer = session.createProducer(sendDestination);
- break;
-
- // Otherwise the receivers role is being assigned, so set this up to listen for messages.
- case RECEIVER:
- MessageConsumer consumer = session.createConsumer(sendDestination);
- consumer.setMessageListener(this);
- break;
- }
-
- connection.start();
- }
-
- /**
- * Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
- *
- * @param numMessages The number of test messages to send.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void start(int numMessages) throws JMSException
- {
- log.debug("public void start(): called");
-
- // Check that the sender role is being performed.
- if (role.equals(Roles.SENDER))
- {
- Message testMessage = session.createTextMessage("test");
-
- for (int i = 0; i < this.numMessages; i++)
- {
- producer.send(testMessage);
-
- // Increment the message count.
- messageCount++;
- }
- }
- }
-
- /**
- * Gets a report on the actions performed by the test case in its assigned role.
- *
- * @param session The controlSession to create the report message in.
- *
- * @return The report message.
- *
- * @throws JMSException Any JMSExceptions resulting from creating the report are allowed to fall through.
- */
- public Message getReport(Session session) throws JMSException
- {
- log.debug("public Message getReport(Session controlSession): called");
-
- // Close the test connection.
- connection.close();
-
- // Generate a report message containing the count of the number of messages passed.
- Message report = session.createMessage();
- report.setStringProperty("CONTROL_TYPE", "REPORT");
- report.setIntProperty("MESSAGE_COUNT", messageCount);
-
- return report;
- }
-
- /**
- * Counts incoming test messages.
- *
- * @param message The incoming test message.
- */
- public void onMessage(Message message)
- {
- log.debug("public void onMessage(Message message = " + message + "): called");
-
- // Increment the message count.
- messageCount++;
- }
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java
deleted file mode 100644
index 205472716b..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java
+++ /dev/null
@@ -1,239 +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.
- *
- */
-package org.apache.qpid.interop.clienttestcases;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.TestUtils;
-import org.apache.qpid.test.framework.distributedtesting.TestClient;
-import org.apache.qpid.test.framework.distributedtesting.TestClientControlledTest;
-
-import javax.jms.*;
-
-/**
- * Implements test case 3, basic pub/sub. Sends/received a specified number of messages to a specified route on the
- * default topic exchange, using the specified number of receivers connections. Produces reports on the actual number of
- * messages sent/received.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Supply the name of the test case that this implements.
- * <tr><td> Accept/Reject invites based on test parameters.
- * <tr><td> Adapt to assigned roles.
- * <tr><td> Send required number of test messages using pub/sub.
- * <tr><td> Generate test reports.
- * </table>
- */
-public class TestCase3BasicPubSub implements TestClientControlledTest, MessageListener
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(TestCase3BasicPubSub.class);
-
- /** Holds the count of test messages received. */
- private int messageCount;
-
- /** The role to be played by the test. */
- private Roles role;
-
- /** The number of test messages to send. */
- private int numMessages;
-
- /** The connections to send/receive the test messages on. */
- private Connection[] connection;
-
- /** The sessions to send/receive the test messages on. */
- private Session[] session;
-
- /** The producer to send the test messages with. */
- MessageProducer producer;
-
- /**
- * Should provide the name of the test case that this class implements. The exact names are defined in the
- * interop testing spec.
- *
- * @return The name of the test case that this implements.
- */
- public String getName()
- {
- log.debug("public String getName(): called");
-
- return "TC3_BasicPubSub";
- }
-
- /**
- * Determines whether the test invite that matched this test case is acceptable.
- *
- * @param inviteMessage The invitation to accept or reject.
- *
- * @return <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it.
- *
- * @throws javax.jms.JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public boolean acceptInvite(Message inviteMessage) throws JMSException
- {
- log.debug("public boolean acceptInvite(Message inviteMessage = " + inviteMessage + "): called");
-
- // All invites are acceptable.
- return true;
- }
-
- /**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the
- * assignment message. When this method return the test case will be ready to execute.
- *
- * @param role The role to be played; sender or receivers.
- *
- * @param assignRoleMessage The role assingment message, contains the full test parameters.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
- {
- log.debug("public void assignRole(Roles role = " + role + ", Message assignRoleMessage = " + assignRoleMessage
- + "): called");
-
- // Reset the message count for a new test.
- messageCount = 0;
-
- // Take note of the role to be played.
- this.role = role;
-
- // Extract and retain the test parameters.
- numMessages = assignRoleMessage.getIntProperty("PUBSUB_NUM_MESSAGES");
- int numReceivers = assignRoleMessage.getIntProperty("PUBSUB_NUM_RECEIVERS");
- String sendKey = assignRoleMessage.getStringProperty("PUBSUB_KEY");
-
- log.debug("numMessages = " + numMessages);
- log.debug("numReceivers = " + numReceivers);
- log.debug("sendKey = " + sendKey);
- log.debug("role = " + role);
-
- switch (role)
- {
- // Check if the sender role is being assigned, and set up a single message producer if so.
- case SENDER:
- // Create a new connection to pass the test messages on.
- connection = new Connection[1];
- session = new Session[1];
-
- connection[0] = TestUtils.createConnection(TestClient.testContextProperties);
- session[0] = connection[0].createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Extract and retain the test parameters.
- Destination sendDestination = session[0].createTopic(sendKey);
-
- producer = session[0].createProducer(sendDestination);
- break;
-
- // Otherwise the receivers role is being assigned, so set this up to listen for messages on the required number
- // of receivers connections.
- case RECEIVER:
- // Create the required number of receivers connections.
- connection = new Connection[numReceivers];
- session = new Session[numReceivers];
-
- for (int i = 0; i < numReceivers; i++)
- {
- connection[i] = TestUtils.createConnection(TestClient.testContextProperties);
- session[i] = connection[i].createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- sendDestination = session[i].createTopic(sendKey);
-
- MessageConsumer consumer = session[i].createConsumer(sendDestination);
- consumer.setMessageListener(this);
- }
-
- break;
- }
-
- // Start all the connection dispatcher threads running.
- for (Connection conn : connection)
- {
- conn.start();
- }
- }
-
- /**
- * Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
- *
- * @param numMessages The number of test messages to send.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void start(int numMessages) throws JMSException
- {
- log.debug("public void start(): called");
-
- // Check that the sender role is being performed.
- if (role.equals(Roles.SENDER))
- {
- Message testMessage = session[0].createTextMessage("test");
-
- for (int i = 0; i < this.numMessages; i++)
- {
- producer.send(testMessage);
-
- // Increment the message count.
- messageCount++;
- }
- }
- }
-
- /**
- * Gets a report on the actions performed by the test case in its assigned role.
- *
- * @param session The controlSession to create the report message in.
- *
- * @return The report message.
- *
- * @throws JMSException Any JMSExceptions resulting from creating the report are allowed to fall through.
- */
- public Message getReport(Session session) throws JMSException
- {
- log.debug("public Message getReport(Session controlSession): called");
-
- // Close the test connections.
- for (Connection conn : connection)
- {
- conn.close();
- }
-
- // Generate a report message containing the count of the number of messages passed.
- Message report = session.createMessage();
- report.setStringProperty("CONTROL_TYPE", "REPORT");
- report.setIntProperty("MESSAGE_COUNT", messageCount);
-
- return report;
- }
-
- /**
- * Counts incoming test messages.
- *
- * @param message The incoming test message.
- */
- public void onMessage(Message message)
- {
- log.debug("public void onMessage(Message message = " + message + "): called");
-
- // Increment the message count.
- messageCount++;
- }
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase4P2PMessageSize.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase4P2PMessageSize.java
deleted file mode 100644
index 3730233264..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase4P2PMessageSize.java
+++ /dev/null
@@ -1,214 +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.
- *
- */
-package org.apache.qpid.interop.clienttestcases;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.TestUtils;
-import org.apache.qpid.test.framework.distributedtesting.TestClient;
-import org.apache.qpid.test.framework.distributedtesting.TestClientControlledTest;
-
-import javax.jms.*;
-
-/**
- * Implements test case 4, P2P messages with message size. Sends/received a specified number of messages to a specified
- * route on the default direct exchange, of a specified size. Produces reports on the actual number of messages
- * sent/received.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Supply the name of the test case that this implements.
- * <tr><td> Accept/Reject invites based on test parameters.
- * <tr><td> Adapt to assigned roles.
- * <tr><td> Send required number of test messages.
- * <tr><td> Generate test reports.
- * </table>
- */
-public class TestCase4P2PMessageSize implements TestClientControlledTest, MessageListener
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(TestCase4P2PMessageSize.class);
-
- /** Holds the count of test messages received. */
- private int messageCount;
-
- /** The role to be played by the test. */
- private Roles role;
-
- /** The number of test messages to send. */
- private int numMessages;
-
- /** The size of the test messages to send. */
- private int messageSize;
-
- /** The connection to send the test messages on. */
- private Connection connection;
-
- /** The controlSession to send the test messages on. */
- private Session session;
-
- /** The producer to send the test messages with. */
- MessageProducer producer;
-
- /**
- * Should provide the name of the test case that this class implements. The exact names are defined in the
- * interop testing spec.
- *
- * @return The name of the test case that this implements.
- */
- public String getName()
- {
- log.debug("public String getName(): called");
-
- return "TC4_P2PMessageSize";
- }
-
- /**
- * Determines whether the test invite that matched this test case is acceptable.
- *
- * @param inviteMessage The invitation to accept or reject.
- *
- * @return <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public boolean acceptInvite(Message inviteMessage) throws JMSException
- {
- log.debug("public boolean acceptInvite(Message inviteMessage = " + inviteMessage + "): called");
-
- // All invites are acceptable.
- return true;
- }
-
- /**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the
- * assignment message. When this method return the test case will be ready to execute.
- *
- * @param role The role to be played; sender or receivers.
- *
- * @param assignRoleMessage The role assingment message, contains the full test parameters.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
- {
- log.debug("public void assignRole(Roles role = " + role + ", Message assignRoleMessage = " + assignRoleMessage
- + "): called");
-
- // Reset the message count for a new test.
- messageCount = 0;
-
- // Take note of the role to be played.
- this.role = role;
-
- // Create a new connection to pass the test messages on.
- connection = TestUtils.createConnection(TestClient.testContextProperties);
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Extract and retain the test parameters.
- numMessages = assignRoleMessage.getIntProperty("P2P_NUM_MESSAGES");
- messageSize = assignRoleMessage.getIntProperty("messageSize");
- Destination sendDestination = session.createQueue(assignRoleMessage.getStringProperty("P2P_QUEUE_AND_KEY_NAME"));
-
- log.debug("numMessages = " + numMessages);
- log.debug("sendDestination = " + sendDestination);
- log.debug("role = " + role);
-
- switch (role)
- {
- // Check if the sender role is being assigned, and set up a message producer if so.
- case SENDER:
- producer = session.createProducer(sendDestination);
- break;
-
- // Otherwise the receivers role is being assigned, so set this up to listen for messages.
- case RECEIVER:
- MessageConsumer consumer = session.createConsumer(sendDestination);
- consumer.setMessageListener(this);
- break;
- }
-
- connection.start();
- }
-
- /**
- * Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
- *
- * @param numMessages The number of test messages to send.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void start(int numMessages) throws JMSException
- {
- log.debug("public void start(): called");
-
- // Check that the sender role is being performed.
- if (role.equals(Roles.SENDER))
- {
- Message testMessage = TestUtils.createTestMessageOfSize(session, messageSize);
-
- for (int i = 0; i < this.numMessages; i++)
- {
- producer.send(testMessage);
-
- // Increment the message count.
- messageCount++;
- }
- }
- }
-
- /**
- * Gets a report on the actions performed by the test case in its assigned role.
- *
- * @param session The controlSession to create the report message in.
- *
- * @return The report message.
- *
- * @throws JMSException Any JMSExceptions resulting from creating the report are allowed to fall through.
- */
- public Message getReport(Session session) throws JMSException
- {
- log.debug("public Message getReport(Session controlSession): called");
-
- // Close the test connection.
- connection.close();
-
- // Generate a report message containing the count of the number of messages passed.
- Message report = session.createMessage();
- report.setStringProperty("CONTROL_TYPE", "REPORT");
- report.setIntProperty("MESSAGE_COUNT", messageCount);
-
- return report;
- }
-
- /**
- * Counts incoming test messages.
- *
- * @param message The incoming test message.
- */
- public void onMessage(Message message)
- {
- log.debug("public void onMessage(Message message = " + message + "): called");
-
- // Increment the message count.
- messageCount++;
- }
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase5PubSubMessageSize.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase5PubSubMessageSize.java
deleted file mode 100644
index f601712bc9..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase5PubSubMessageSize.java
+++ /dev/null
@@ -1,243 +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.
- *
- */
-package org.apache.qpid.interop.clienttestcases;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.TestUtils;
-import org.apache.qpid.test.framework.distributedtesting.TestClient;
-import org.apache.qpid.test.framework.distributedtesting.TestClientControlledTest;
-
-import javax.jms.*;
-
-/**
- * Implements test case 5, pub/sub with message size. Sends/received a specified number of messages to a specified route
- * on the default topic exchange, using the specified number of receivers connections, and the specified message size.
- * Produces reports on the actual number of messages sent/received.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Supply the name of the test case that this implements.
- * <tr><td> Accept/Reject invites based on test parameters.
- * <tr><td> Adapt to assigned roles.
- * <tr><td> Send required number of test messages using pub/sub.
- * <tr><td> Generate test reports.
- * </table>
- */
-public class TestCase5PubSubMessageSize implements TestClientControlledTest, MessageListener
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(TestCase5PubSubMessageSize.class);
-
- /** Holds the count of test messages received. */
- private int messageCount;
-
- /** The role to be played by the test. */
- private Roles role;
-
- /** The number of test messages to send. */
- private int numMessages;
-
- /** The size of the test messages to send. */
- private int messageSize;
-
- /** The connections to send/receive the test messages on. */
- private Connection[] connection;
-
- /** The sessions to send/receive the test messages on. */
- private Session[] session;
-
- /** The producer to send the test messages with. */
- MessageProducer producer;
-
- /**
- * Should provide the name of the test case that this class implements. The exact names are defined in the
- * interop testing spec.
- *
- * @return The name of the test case that this implements.
- */
- public String getName()
- {
- log.debug("public String getName(): called");
-
- return "TC5_PubSubMessageSize";
- }
-
- /**
- * Determines whether the test invite that matched this test case is acceptable.
- *
- * @param inviteMessage The invitation to accept or reject.
- *
- * @return <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it.
- *
- * @throws javax.jms.JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public boolean acceptInvite(Message inviteMessage) throws JMSException
- {
- log.debug("public boolean acceptInvite(Message inviteMessage = " + inviteMessage + "): called");
-
- // All invites are acceptable.
- return true;
- }
-
- /**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the
- * assignment message. When this method return the test case will be ready to execute.
- *
- * @param role The role to be played; sender or receivers.
- *
- * @param assignRoleMessage The role assingment message, contains the full test parameters.
- *
- * @throws javax.jms.JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
- {
- log.debug("public void assignRole(Roles role = " + role + ", Message assignRoleMessage = " + assignRoleMessage
- + "): called");
-
- // Reset the message count for a new test.
- messageCount = 0;
-
- // Take note of the role to be played.
- this.role = role;
-
- // Extract and retain the test parameters.
- numMessages = assignRoleMessage.getIntProperty("PUBSUB_NUM_MESSAGES");
- messageSize = assignRoleMessage.getIntProperty("messageSize");
- int numReceivers = assignRoleMessage.getIntProperty("PUBSUB_NUM_RECEIVERS");
- String sendKey = assignRoleMessage.getStringProperty("PUBSUB_KEY");
-
- log.debug("numMessages = " + numMessages);
- log.debug("numReceivers = " + numReceivers);
- log.debug("sendKey = " + sendKey);
- log.debug("role = " + role);
-
- switch (role)
- {
- // Check if the sender role is being assigned, and set up a single message producer if so.
- case SENDER:
- // Create a new connection to pass the test messages on.
- connection = new Connection[1];
- session = new Session[1];
-
- connection[0] = TestUtils.createConnection(TestClient.testContextProperties);
- session[0] = connection[0].createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Extract and retain the test parameters.
- Destination sendDestination = session[0].createTopic(sendKey);
-
- producer = session[0].createProducer(sendDestination);
- break;
-
- // Otherwise the receivers role is being assigned, so set this up to listen for messages on the required number
- // of receivers connections.
- case RECEIVER:
- // Create the required number of receivers connections.
- connection = new Connection[numReceivers];
- session = new Session[numReceivers];
-
- for (int i = 0; i < numReceivers; i++)
- {
- connection[i] = TestUtils.createConnection(TestClient.testContextProperties);
- session[i] = connection[i].createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- sendDestination = session[i].createTopic(sendKey);
-
- MessageConsumer consumer = session[i].createConsumer(sendDestination);
- consumer.setMessageListener(this);
- }
-
- break;
- }
-
- // Start all the connection dispatcher threads running.
- for (Connection conn : connection)
- {
- conn.start();
- }
- }
-
- /**
- * Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
- *
- * @param numMessages The number of test messages to send.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void start(int numMessages) throws JMSException
- {
- log.debug("public void start(): called");
-
- // Check that the sender role is being performed.
- if (role.equals(Roles.SENDER))
- {
- Message testMessage = TestUtils.createTestMessageOfSize(session[0], messageSize);
-
- for (int i = 0; i < this.numMessages; i++)
- {
- producer.send(testMessage);
-
- // Increment the message count.
- messageCount++;
- }
- }
- }
-
- /**
- * Gets a report on the actions performed by the test case in its assigned role.
- *
- * @param session The controlSession to create the report message in.
- *
- * @return The report message.
- *
- * @throws javax.jms.JMSException Any JMSExceptions resulting from creating the report are allowed to fall through.
- */
- public Message getReport(Session session) throws JMSException
- {
- log.debug("public Message getReport(Session controlSession): called");
-
- // Close the test connections.
- for (Connection conn : connection)
- {
- conn.close();
- }
-
- // Generate a report message containing the count of the number of messages passed.
- Message report = session.createMessage();
- report.setStringProperty("CONTROL_TYPE", "REPORT");
- report.setIntProperty("MESSAGE_COUNT", messageCount);
-
- return report;
- }
-
- /**
- * Counts incoming test messages.
- *
- * @param message The incoming test message.
- */
- public void onMessage(Message message)
- {
- log.debug("public void onMessage(Message message = " + message + "): called");
-
- // Increment the message count.
- messageCount++;
- }
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java
deleted file mode 100644
index a2e4a00aa6..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java
+++ /dev/null
@@ -1,84 +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.
- *
- */
-package org.apache.qpid.interop.testcases;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-
-import java.util.Properties;
-
-/**
- * Coordinates test case 1, from the interop test specification. This test connects up the sender and receivers roles,
- * and gets some dummy test reports from them, in order to check that the test framework itself is operational.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Exercises the interop testing framework without actually sending any test messages.
- * <td> {@link FrameworkBaseCase}
- * </table>
- */
-public class InteropTestCase1DummyRun extends FrameworkBaseCase
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(InteropTestCase1DummyRun.class);
-
- /**
- * Creates a new coordinating test case with the specified name.
- *
- * @param name The test case name.
- */
- public InteropTestCase1DummyRun(String name)
- {
- super(name);
- }
-
- /**
- * Performs the basic P2P test case, "Test Case 2" in the specification.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testDummyRun() throws Exception
- {
- log.debug("public void testDummyRun(): called");
-
- Properties testConfig = new Properties();
- testConfig.put("TEST_NAME", "TC1_DummyRun");
-
- /*Message[] reports =*/ getCircuitFactory().sequenceTest(null, null, testConfig);
-
- // Compare sender and receivers reports.
- // Assert.assertEquals("Expected to get 2 dummy reports.", 2, reports.length);
- }
-
- /**
- * Should provide a translation from the junit method name of a test to its test case name as defined in the
- * interop testing specification. For example the method "testP2P" might map onto the interop test case name
- * "TC2_BasicP2P".
- *
- * @param methodName The name of the JUnit test method.
- * @return The name of the corresponding interop test case.
- */
- public String getTestCaseNameForTestMethod(String methodName)
- {
- return "TC1_DummyRun";
- }
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java
deleted file mode 100644
index 6d6515f1fd..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java
+++ /dev/null
@@ -1,90 +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.
- *
- */
-package org.apache.qpid.interop.testcases;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-
-import java.util.Properties;
-
-/**
- * Implements test case 2, from the interop test specification. This test sets up the TC2_BasicP2P test for 50
- * messages. It checks that the sender and receivers reports both indicate that all the test messages were transmitted
- * successfully.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Setup p2p test parameters and compare with test output. <td> {@link FrameworkBaseCase}
- * </table>
- */
-public class InteropTestCase2BasicP2P extends FrameworkBaseCase
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(InteropTestCase2BasicP2P.class);
-
- /**
- * Creates a new coordinating test case with the specified name.
- *
- * @param name The test case name.
- */
- public InteropTestCase2BasicP2P(String name)
- {
- super(name);
- }
-
- /**
- * Performs the basic P2P test case, "Test Case 2" in the specification.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testBasicP2P() throws Exception
- {
- log.debug("public void testBasicP2P(): called");
-
- Properties testConfig = new Properties();
- testConfig.setProperty("TEST_NAME", "TC2_BasicP2P");
- testConfig.setProperty("P2P_QUEUE_AND_KEY_NAME", "tc2queue");
- testConfig.put("P2P_NUM_MESSAGES", 50);
-
- /*Message[] reports =*/ getCircuitFactory().sequenceTest(null, null, testConfig);
-
- // Compare sender and receivers reports.
- /*int messagesSent = reports[0].getIntProperty("MESSAGE_COUNT");
- int messagesReceived = reports[1].getIntProperty("MESSAGE_COUNT");
-
- Assert.assertEquals("The requested number of messages were not sent.", 50, messagesSent);
- Assert.assertEquals("Sender and receivers messages sent did not match up.", messagesSent, messagesReceived);*/
- }
-
- /**
- * Should provide a translation from the junit method name of a test to its test case name as defined in the
- * interop testing specification. For example the method "testP2P" might map onto the interop test case name
- * "TC2_BasicP2P".
- *
- * @param methodName The name of the JUnit test method.
- * @return The name of the corresponding interop test case.
- */
- public String getTestCaseNameForTestMethod(String methodName)
- {
- return "TC2_BasicP2P";
- }
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java
deleted file mode 100644
index 2faca91e73..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java
+++ /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.
- *
- */
-package org.apache.qpid.interop.testcases;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-
-import java.util.Properties;
-
-/**
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Setup pub/sub test parameters and compare with test output. <td> {@link FrameworkBaseCase}
- * </table>
- */
-public class InteropTestCase3BasicPubSub extends FrameworkBaseCase
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(InteropTestCase3BasicPubSub.class);
-
- /**
- * Creates a new coordinating test case with the specified name.
- *
- * @param name The test case name.
- */
- public InteropTestCase3BasicPubSub(String name)
- {
- super(name);
- }
-
- /**
- * Performs the basic P2P test case, "Test Case 2" in the specification.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testBasicPubSub() throws Exception
- {
- log.debug("public void testBasicPubSub(): called");
-
- Properties testConfig = new Properties();
- testConfig.put("TEST_NAME", "TC3_BasicPubSub");
- testConfig.put("PUBSUB_KEY", "tc3route");
- testConfig.put("PUBSUB_NUM_MESSAGES", 10);
- testConfig.put("PUBSUB_NUM_RECEIVERS", 5);
-
- /*Message[] reports =*/ getCircuitFactory().sequenceTest(null, null, testConfig);
-
- // Compare sender and receivers reports.
- /*int messagesSent = reports[0].getIntProperty("MESSAGE_COUNT");
- int messagesReceived = reports[1].getIntProperty("MESSAGE_COUNT");
-
- Assert.assertEquals("The requested number of messages were not sent.", 10, messagesSent);
- Assert.assertEquals("Received messages did not match up to num sent * num receivers.", messagesSent * 5,
- messagesReceived);*/
- }
-
- /**
- * Should provide a translation from the junit method name of a test to its test case name as defined in the
- * interop testing specification. For example the method "testP2P" might map onto the interop test case name
- * "TC2_BasicP2P".
- *
- * @param methodName The name of the JUnit test method.
- * @return The name of the corresponding interop test case.
- */
- public String getTestCaseNameForTestMethod(String methodName)
- {
- return "TC3_BasicPubSub";
- }
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase4P2PMessageSize.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase4P2PMessageSize.java
deleted file mode 100644
index 2d64f2b805..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase4P2PMessageSize.java
+++ /dev/null
@@ -1,193 +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.
- *
- */
-package org.apache.qpid.interop.testcases;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-
-import java.util.Properties;
-
-/**
- * Implements test case 4, from the interop test specification. This test sets up the TC2_P2PMessageSize test for 50
- * messages, and a variety of message sizes. It checks that the sender and receivers reports both indicate that all
- * the test messages were transmitted successfully.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Setup p2p test parameters and compare with test output. <td> {@link FrameworkBaseCase}
- * </table>
- */
-public class InteropTestCase4P2PMessageSize extends FrameworkBaseCase
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(InteropTestCase4P2PMessageSize.class);
-
- /**
- * Creates a new coordinating test case with the specified name.
- *
- * @param name The test case name.
- */
- public InteropTestCase4P2PMessageSize(String name)
- {
- super(name);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 0K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testP2PMessageSize0K() throws Exception
- {
- runTestForMessagesOfSize(0);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 63K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testP2PMessageSize63K() throws Exception
- {
- runTestForMessagesOfSize(63 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 64K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testP2PMessageSize64K() throws Exception
- {
- runTestForMessagesOfSize(64 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 65K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testP2PMessageSize65K() throws Exception
- {
- runTestForMessagesOfSize(65 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 127K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testP2PMessageSize127K() throws Exception
- {
- runTestForMessagesOfSize(127 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 128K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testP2PMessageSize128K() throws Exception
- {
- runTestForMessagesOfSize(128 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 129K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testP2PMessageSize129K() throws Exception
- {
- runTestForMessagesOfSize(129 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 255K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testP2PMessageSize255K() throws Exception
- {
- runTestForMessagesOfSize(255 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 256K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testP2PMessageSize256K() throws Exception
- {
- runTestForMessagesOfSize(256 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 257K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testP2PMessageSize257K() throws Exception
- {
- runTestForMessagesOfSize(257 * 1024);
- }
-
- /**
- * Sends 50 test messages of the specified size, and asserts that all were received.
- *
- * @param size The size of the messages to send in bytes.
- */
- private void runTestForMessagesOfSize(int size)
- {
- Properties testConfig = new Properties();
- testConfig.setProperty("TEST_NAME", "TC4_P2PMessageSize");
- testConfig.setProperty("P2P_QUEUE_AND_KEY_NAME", "tc2queue");
- testConfig.put("P2P_NUM_MESSAGES", 50);
- testConfig.put("messageSize", size);
-
- /*Message[] reports =*/
- getCircuitFactory().sequenceTest(null, null, testConfig);
-
- // Compare sender and receivers reports.
- /*
- int messagesSent = reports[0].getIntProperty("MESSAGE_COUNT");
- int messagesReceived = reports[1].getIntProperty("MESSAGE_COUNT");
-
- Assert.assertEquals("The requested number of messages were not sent.", 50, messagesSent);
- Assert.assertEquals("Sender and receivers messages sent did not match up.", messagesSent, messagesReceived);
- */
- }
-
- /**
- * Should provide a translation from the junit method name of a test to its test case name as defined in the
- * interop testing specification. For example the method "testP2P" might map onto the interop test case name
- * "TC2_BasicP2P".
- *
- * @param methodName The name of the JUnit test method.
- *
- * @return The name of the corresponding interop test case.
- */
- public String getTestCaseNameForTestMethod(String methodName)
- {
- return "TC4_P2PMessageSize";
- }
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase5PubSubMessageSize.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase5PubSubMessageSize.java
deleted file mode 100644
index 23d33fc115..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase5PubSubMessageSize.java
+++ /dev/null
@@ -1,193 +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.
- *
- */
-package org.apache.qpid.interop.testcases;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-
-import java.util.Properties;
-
-/**
- * Implements test case 5, from the interop test specification. This test sets up the TC2_PubSubMessageSize test for 10
- * messages, sent to 5 consumers, and a variety of message sizes. It checks that the sender and receivers reports both
- * indicate that all the test messages were transmitted successfully.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Setup pub/sub test parameters and compare with test output. <td> {@link FrameworkBaseCase}
- * </table>
- */
-public class InteropTestCase5PubSubMessageSize extends FrameworkBaseCase
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(InteropTestCase5PubSubMessageSize.class);
-
- /**
- * Creates a new coordinating test case with the specified name.
- *
- * @param name The test case name.
- */
- public InteropTestCase5PubSubMessageSize(String name)
- {
- super(name);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 0K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testPubSubMessageSize0K() throws Exception
- {
- runTestForMessagesOfSize(0);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 63K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testPubSubMessageSize63K() throws Exception
- {
- runTestForMessagesOfSize(63 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 64K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testPubSubMessageSize64K() throws Exception
- {
- runTestForMessagesOfSize(64 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 65K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testPubSubMessageSize65K() throws Exception
- {
- runTestForMessagesOfSize(65 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 127K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testPubSubMessageSize127K() throws Exception
- {
- runTestForMessagesOfSize(127 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 128K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testPubSubMessageSize128K() throws Exception
- {
- runTestForMessagesOfSize(128 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 129K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testPubSubMessageSize129K() throws Exception
- {
- runTestForMessagesOfSize(129 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 255K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testPubSubMessageSize255K() throws Exception
- {
- runTestForMessagesOfSize(255 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 256K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testPubSubMessageSize256K() throws Exception
- {
- runTestForMessagesOfSize(256 * 1024);
- }
-
- /**
- * Performs the P2P message test case, "Test Case 4" in the specification, for messages 257K in size.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testPubSubMessageSize257K() throws Exception
- {
- runTestForMessagesOfSize(257 * 1024);
- }
-
- /**
- * Sends 50 test messages of the specified size, and asserts that all were received.
- *
- * @param size The size of the messages to send in bytes.
- */
- private void runTestForMessagesOfSize(int size)
- {
- Properties testConfig = new Properties();
- testConfig.put("TEST_NAME", "TC5_PubSubMessageSize");
- testConfig.put("PUBSUB_KEY", "tc3route");
- testConfig.put("PUBSUB_NUM_MESSAGES", 10);
- testConfig.put("PUBSUB_NUM_RECEIVERS", 5);
- testConfig.put("messageSize", size);
-
- /*Message[] reports =*/
- getCircuitFactory().sequenceTest(null, null, testConfig);
-
- // Compare sender and receivers reports.
- /*
- int messagesSent = reports[0].getIntProperty("MESSAGE_COUNT");
- int messagesReceived = reports[1].getIntProperty("MESSAGE_COUNT");
-
- Assert.assertEquals("The requested number of messages were not sent.", 50, messagesSent);
- Assert.assertEquals("Sender and receivers messages sent did not match up.", messagesSent, messagesReceived);
- */
- }
-
- /**
- * Should provide a translation from the junit method name of a test to its test case name as defined in the
- * interop testing specification. For example the method "testP2P" might map onto the interop test case name
- * "TC2_BasicP2P".
- *
- * @param methodName The name of the JUnit test method.
- * @return The name of the corresponding interop test case.
- */
- public String getTestCaseNameForTestMethod(String methodName)
- {
- return "TC5_PubSubMessageSize";
- }
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java
deleted file mode 100644
index 63e2c75509..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java
+++ /dev/null
@@ -1,906 +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.
- *
- */
-package org.apache.qpid.sustained;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.client.AMQNoConsumersException;
-import org.apache.qpid.client.AMQNoRouteException;
-import org.apache.qpid.test.framework.distributedtesting.TestClient;
-import org.apache.qpid.interop.clienttestcases.TestCase3BasicPubSub;
-import org.apache.qpid.test.framework.TestUtils;
-
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.CountDownLatch;
-
-/**
- * Implements test case 3, basic pub/sub. Sends/received a specified number of messages to a specified route on the
- * default topic exchange, using the specified number of receivers connections. Produces reports on the actual number of
- * messages sent/received.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Supply the name of the test case that this implements.
- * <tr><td> Accept/Reject invites based on test parameters.
- * <tr><td> Adapt to assigned roles.
- * <tr><td> Send required number of test messages using pub/sub. <tr><td> Generate test reports.
- * </table>
- */
-public class SustainedClientTestCase extends TestCase3BasicPubSub implements ExceptionListener, MessageListener
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(SustainedClientTestCase.class);
-
- /** Used to log to the console. */
- private static final Logger console = Logger.getLogger("SustainedTest");
-
- /** The role to be played by the test. */
- private Roles role;
-
- /** The number of receivers connection to use. */
- private int numReceivers;
-
- /** The routing key to send them to on the default direct exchange. */
- private Destination sendDestination;
-
- /** The routing key to send updates to on the default direct exchange. */
- private Destination sendUpdateDestination;
-
- /** The connections to send/receive the test messages on. */
- private Connection[] connection;
-
- /** The sessions to send/receive the test messages on. */
- private Session[] session;
-
- /** The producer to send the test messages with. */
- MessageProducer producer;
-
- /** Adapter that adjusts the send rate based on the updates from clients. */
- SustainedRateAdapter _rateAdapter;
-
- /** */
- int _batchSize;
-
- private static final long TEN_MILLI_SEC = 10000000;
- private static final int DEBUG_LOG_UPATE_INTERVAL = 10;
- private static final int LOG_UPATE_INTERVAL = 10;
- private static final boolean SLEEP_PER_MESSAGE = Boolean.getBoolean("sleepPerMessage");
-
- /**
- * Should provide the name of the test case that this class implements. The exact names are defined in the interop
- * testing spec.
- *
- * @return The name of the test case that this implements.
- */
- public String getName()
- {
- log.debug("public String getName(): called");
-
- return "Perf_SustainedPubSub";
- }
-
- /**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the assignment
- * message. When this method return the test case will be ready to execute.
- *
- * @param role The role to be played; sender or receivers.
- * @param assignRoleMessage The role assingment message, contains the full test parameters.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
- {
- log.debug("public void assignRole(Roles role = " + role + ", Message assignRoleMessage = " + assignRoleMessage
- + "): called");
-
- // Take note of the role to be played.
- this.role = role;
-
- // Extract and retain the test parameters.
- numReceivers = assignRoleMessage.getIntProperty("SUSTAINED_NUM_RECEIVERS");
- _batchSize = assignRoleMessage.getIntProperty("SUSTAINED_UPDATE_INTERVAL");
- String sendKey = assignRoleMessage.getStringProperty("SUSTAINED_KEY");
- String sendUpdateKey = assignRoleMessage.getStringProperty("SUSTAINED_UPDATE_KEY");
- int ackMode = assignRoleMessage.getIntProperty("ACKNOWLEDGE_MODE");
- String clientName = assignRoleMessage.getStringProperty("CLIENT_NAME");
-
- if (log.isDebugEnabled())
- {
- log.debug("numReceivers = " + numReceivers);
- log.debug("_batchSize = " + _batchSize);
- log.debug("ackMode = " + ackMode);
- log.debug("sendKey = " + sendKey);
- log.debug("sendUpdateKey = " + sendUpdateKey);
- log.debug("role = " + role);
- }
-
- switch (role)
- {
- // Check if the sender role is being assigned, and set up a single message producer if so.
- case SENDER:
- console.info("Creating Sender");
- // Create a new connection to pass the test messages on.
- connection = new Connection[1];
- session = new Session[1];
-
- connection[0] = TestUtils.createConnection(TestClient.testContextProperties);
- session[0] = connection[0].createSession(false, ackMode);
-
- // Extract and retain the test parameters.
- sendDestination = session[0].createTopic(sendKey);
-
- connection[0].setExceptionListener(this);
-
- producer = session[0].createProducer(sendDestination);
-
- sendUpdateDestination = session[0].createTopic(sendUpdateKey);
- MessageConsumer updateConsumer = session[0].createConsumer(sendUpdateDestination);
-
- _rateAdapter = new SustainedRateAdapter(this);
- updateConsumer.setMessageListener(_rateAdapter);
-
- break;
-
- // Otherwise the receivers role is being assigned, so set this up to listen for messages on the required number
- // of receivers connections.
- case RECEIVER:
- console.info("Creating Receiver");
- // Create the required number of receivers connections.
- connection = new Connection[numReceivers];
- session = new Session[numReceivers];
-
- for (int i = 0; i < numReceivers; i++)
- {
- connection[i] = TestUtils.createConnection(TestClient.testContextProperties);
- session[i] = connection[i].createSession(false, ackMode);
-
- sendDestination = session[i].createTopic(sendKey);
-
- sendUpdateDestination = session[i].createTopic(sendUpdateKey);
-
- MessageConsumer consumer = session[i].createConsumer(sendDestination);
-
- consumer.setMessageListener(new SustainedListener(clientName + "-" + i, _batchSize, session[i],
- sendUpdateDestination));
- }
-
- break;
- }
-
- // Start all the connection dispatcher threads running.
- for (int i = 0; i < connection.length; i++)
- {
- connection[i].start();
- }
- }
-
- /** Performs the test case actions.
- * @param numMessages*/
- public void start(int numMessages) throws JMSException
- {
- log.debug("public void start(): called");
-
- // Check that the sender role is being performed.
- switch (role)
- {
- // Check if the sender role is being assigned, and set up a single message producer if so.
- case SENDER:
- _rateAdapter.run();
- break;
- case RECEIVER:
-
- }
-
- // return from here when you have finished the test.. this will signal the controller and
- }
-
- public void terminate() throws JMSException, InterruptedException
- {
- if (_rateAdapter != null)
- {
- _rateAdapter.stop();
- }
- }
-
- /**
- * Gets a report on the actions performed by the test case in its assigned role.
- *
- * @param session The controlSession to create the report message in.
- *
- * @return The report message.
- *
- * @throws JMSException Any JMSExceptions resulting from creating the report are allowed to fall through.
- */
- public Message getReport(Session session) throws JMSException
- {
- log.debug("public Message getReport(Session controlSession): called");
-
- // Close the test connections.
- for (int i = 0; i < connection.length; i++)
- {
- connection[i].close();
- }
-
- Message report = session.createMessage();
- report.setStringProperty("CONTROL_TYPE", "REPORT");
-
- return report;
- }
-
- public void onException(JMSException jmsException)
- {
- Exception linked = jmsException.getLinkedException();
-
- if (linked != null)
- {
- if (log.isDebugEnabled())
- {
- log.debug("Linked Exception:" + linked);
- }
-
- if ((linked instanceof AMQNoRouteException) || (linked instanceof AMQNoConsumersException))
- {
- if (log.isDebugEnabled())
- {
- if (linked instanceof AMQNoConsumersException)
- {
- log.warn("No clients currently available for message:"
- + ((AMQNoConsumersException) linked).getUndeliveredMessage());
- }
- else
- {
- log.warn("No route for message");
- }
- }
-
- // Tell the rate adapter that there are no clients ready yet
- _rateAdapter.NO_CLIENTS = true;
- }
- }
- else
- {
- log.warn("Exception:" + linked);
- }
- }
-
- /**
- * Inner class that listens for messages and sends a report for the time taken between receiving the 'start' and
- * 'end' messages.
- */
- class SustainedListener implements MessageListener
- {
- /** Number of messages received */
- private long _received = 0;
- /** The number of messages in the batch */
- private int _batchSize = 0;
- /** Record of the when the 'start' messagse was sen */
- private Long _startTime;
- /** Message producer to use to send reports */
- MessageProducer _updater;
- /** Session to create the report message on */
- Session _session;
- /** Record of the client ID used for this SustainedListnener */
- String _client;
-
- /**
- * Main Constructor
- *
- * @param clientname The _client id used to identify this connection.
- * @param batchSize The number of messages that are to be sent per batch. Note: This is not used to
- * control the interval between sending reports.
- * @param session The controlSession used for communication.
- * @param sendDestination The destination that update reports should be sent to.
- *
- * @throws JMSException My occur if creatingthe Producer fails
- */
- public SustainedListener(String clientname, int batchSize, Session session, Destination sendDestination)
- throws JMSException
- {
- _batchSize = batchSize;
- _client = clientname;
- _session = session;
- _updater = session.createProducer(sendDestination);
- }
-
- public void onMessage(Message message)
- {
- if (log.isDebugEnabled())
- {
- log.debug("Message " + _received + "received in listener");
- }
-
- if (message instanceof TextMessage)
- {
- try
- {
- _received++;
- if (((TextMessage) message).getText().equals("start"))
- {
- log.debug("Starting Batch");
- _startTime = System.nanoTime();
- }
- else if (((TextMessage) message).getText().equals("end"))
- {
- if (_startTime != null)
- {
- long currentTime = System.nanoTime();
- sendStatus(currentTime - _startTime, _received, message.getIntProperty("BATCH"));
- log.debug("End Batch");
- }
- }
- }
- catch (JMSException e)
- {
- // ignore error
- }
- }
-
- }
-
- /**
- * sendStatus creates and sends the report back to the publisher
- *
- * @param time taken for the the last batch
- * @param received Total number of messages received.
- * @param batchNumber the batch number
- * @throws JMSException if an error occurs during the send
- */
- private void sendStatus(long time, long received, int batchNumber) throws JMSException
- {
- Message updateMessage = _session.createTextMessage("update");
- updateMessage.setStringProperty("CLIENT_ID", ":" + _client);
- updateMessage.setStringProperty("CONTROL_TYPE", "UPDATE");
- updateMessage.setLongProperty("RECEIVED", received);
- updateMessage.setIntProperty("BATCH", batchNumber);
- updateMessage.setLongProperty("DURATION", time);
-
- if (log.isInfoEnabled())
- {
- log.info("**** SENDING [" + batchNumber + "]**** " + "CLIENT_ID:" + _client + " RECEIVED:" + received
- + " BATCH:" + batchNumber + " DURATION:" + time);
- }
-
- // Output on the main console.info the details of this batch
- if ((batchNumber % 10) == 0)
- {
- console.info("Sending Report [" + batchNumber + "] " + "CLIENT_ID:" + _client + " RECEIVED:" + received
- + " BATCH:" + batchNumber + " DURATION:" + time);
- }
-
- _updater.send(updateMessage);
- }
- }
-
- /**
- * This class is used here to adjust the _delay value which in turn is used to control the number of messages/second
- * that are sent through the test system.
- *
- * By keeping a record of the messages recevied and the average time taken to process the batch size can be
- * calculated and so the delay can be adjusted to maintain that rate.
- *
- * Given that delays of < 10ms can be rounded up the delay is only used between messages if the _delay > 10ms * no
- * messages in the batch. Otherwise the delay is used at the end of the batch.
- */
- class SustainedRateAdapter implements MessageListener, Runnable
- {
- private SustainedClientTestCase _client;
- private long _batchVariance = Integer.getInteger("batchVariance", 3); // no. batches to allow drifting
- private long _timeVariance = TEN_MILLI_SEC * 5; // no. nanos between send and report delay (10ms)
- private volatile long _delay; // in nanos
- private long _sent;
- private Map<String, Long> _slowClients = new HashMap<String, Long>();
- private static final long PAUSE_SLEEP = TEN_MILLI_SEC / 1000; // 10 ms
- private static final long NO_CLIENT_SLEEP = 1000; // 1s
- private volatile boolean NO_CLIENTS = true;
- private int _delayShifting;
- private final int REPORTS_WITHOUT_CHANGE = Integer.getInteger("stableReportCount", 5);
- private boolean _warmedup = false;
- private static final long EXPECTED_TIME_PER_BATCH = 100000L;
- private int _warmUpBatches = Integer.getInteger("warmUpBatches", 10);
-
- SustainedRateAdapter(SustainedClientTestCase client)
- {
- _client = client;
- }
-
- public void onMessage(Message message)
- {
- if (log.isDebugEnabled())
- {
- log.debug("SustainedRateAdapter onMessage(Message message = " + message + "): called");
- }
-
- try
- {
- String controlType = message.getStringProperty("CONTROL_TYPE");
-
- // Check if the message is a test invite.
- if ("UPDATE".equals(controlType))
- {
- NO_CLIENTS = false;
- long duration = message.getLongProperty("DURATION");
- long totalReceived = message.getLongProperty("RECEIVED");
- String client = message.getStringProperty("CLIENT_ID");
- int batchNumber = message.getIntProperty("BATCH");
-
- if (log.isInfoEnabled() && ((batchNumber % DEBUG_LOG_UPATE_INTERVAL) == 0))
- {
- log.info("Update Report: CLIENT_ID:" + client + " RECEIVED:" + totalReceived + " Recevied BATCH:"
- + batchNumber + " DURATION:" + duration);
- }
-
- recordSlow(client, totalReceived, batchNumber);
-
- adjustDelay(client, batchNumber, duration);
-
- // Warm up completes when:
- // we haven't warmed up
- // and the number of batches sent to each client is at least half of the required warmup batches
- if (!_warmedup && (batchNumber >= _warmUpBatches))
- {
- _warmedup = true;
- _warmup.countDown();
-
- }
- }
- }
- catch (JMSException e)
- {
- //
- }
- }
-
- CountDownLatch _warmup = new CountDownLatch(1);
-
- int _numBatches = 10000;
-
- // long[] _timings = new long[_numBatches];
- private boolean _running = true;
-
- public void run()
- {
- console.info("Warming up");
-
- doBatch(_warmUpBatches);
-
- try
- {
- // wait for warmup to complete.
- _warmup.await();
-
- // set delay to the average length of the batches
- _delay = _totalDuration / _warmUpBatches / delays.size();
-
- console.info("Warmup complete delay set : " + _delay + " based on _totalDuration: " + _totalDuration
- + " over no. batches: " + _warmUpBatches + " with client count: " + delays.size());
-
- _totalDuration = 0L;
- _totalReceived = 0L;
- _sent = 0L;
- }
- catch (InterruptedException e)
- {
- //
- }
-
- doBatch(_numBatches);
-
- }
-
- private void doBatch(int batchSize) // long[] timings,
- {
- TextMessage testMessage = null;
- try
- {
- testMessage = _client.session[0].createTextMessage("start");
-
- for (int batch = 0; batch <= batchSize; batch++)
- // while (_running)
- {
- long start = System.nanoTime();
-
- testMessage.setText("start");
- testMessage.setIntProperty("BATCH", batch);
-
- _client.producer.send(testMessage);
- _rateAdapter.sentMessage();
-
- testMessage.setText("test");
- // start at 2 so start and end count as part of batch
- for (int m = 2; m < _batchSize; m++)
- {
- _client.producer.send(testMessage);
- _rateAdapter.sentMessage();
- }
-
- testMessage.setText("end");
- _client.producer.send(testMessage);
- _rateAdapter.sentMessage();
-
- long end = System.nanoTime();
-
- long sendtime = end - start;
-
- if (log.isDebugEnabled())
- {
- log.info("Sent batch[" + batch + "](" + _batchSize + ") in " + sendtime); // timings[batch]);
- }
-
- if ((batch % LOG_UPATE_INTERVAL) == 0)
- {
- console.info("Sent Batch[" + batch + "](" + _batchSize + ")" + status());
- }
-
- _rateAdapter.sleepBatch();
-
- }
- }
- catch (JMSException e)
- {
- console.error("Runner ended");
- }
- }
-
- private String status()
- {
- return " TotalDuration: " + _totalDuration + " for " + delays.size() + " consumers" + " Delay is " + _delay
- + " resulting in "
- + ((_delay > (TEN_MILLI_SEC * _batchSize)) ? ((_delay / _batchSize) + "/msg") : (_delay + "/batch"));
- }
-
- private void sleepBatch()
- {
- if (checkForSlowClients())
- { // if there werwe slow clients we have already slept so don't sleep anymore again.
- return;
- }
-
- if (!SLEEP_PER_MESSAGE)
- {
- // per batch sleep.. if sleep is to small to spread over the batch.
- if (_delay <= (TEN_MILLI_SEC * _batchSize))
- {
- sleepLong(_delay);
- }
- else
- {
- log.info("Not sleeping _delay > ten*batch is:" + _delay);
- }
- }
- }
-
- public void stop()
- {
- _running = false;
- }
-
- Map<String, Long> delays = new HashMap<String, Long>();
- Long _totalReceived = 0L;
- Long _totalDuration = 0L;
- int _skipUpdate = 0;
-
- /**
- * Adjust the delay for sending messages based on this update from the client
- *
- * @param client The client that send this update
- * @param duration The time taken for the last batch of messagse
- * @param batchNumber The reported batchnumber from the client
- */
- private void adjustDelay(String client, int batchNumber, long duration)
- {
- // Retrieve the current total time taken for this client.
- Long currentTime = delays.get(client);
-
- // Add the new duration time to this client
- if (currentTime == null)
- {
- currentTime = duration;
- }
- else
- {
- currentTime += duration;
- }
-
- delays.put(client, currentTime);
-
- long batchesSent = _sent / _batchSize;
-
- // ensure we don't divide by zero
- if (batchesSent == 0)
- {
- batchesSent = 1L;
- }
-
- _totalReceived += _batchSize;
- _totalDuration += duration;
-
- // calculate average duration accross clients per batch
- long averageDuration = _totalDuration / delays.size() / batchesSent;
-
- // calculate the difference between current send delay and average report delay
- long diff = (duration) - averageDuration;
-
- if (log.isInfoEnabled() && ((batchNumber % DEBUG_LOG_UPATE_INTERVAL) == 0))
- {
- log.info("TotalDuration:" + _totalDuration + " for " + delays.size() + " consumers." + " on batch: "
- + batchesSent + " received batch: " + batchNumber + " Batch Duration: " + duration + " Average: "
- + averageDuration + " so diff: " + diff + " for : " + client + " Delay is " + _delay + " resulting in "
- + ((_delay > (TEN_MILLI_SEC * _batchSize)) ? ((_delay / _batchSize) + "/msg") : (_delay + "/batch")));
- }
-
- // if the averageDuration differs from the current by more than the specified variane then adjust delay.
- if (Math.abs(diff) > _timeVariance)
- {
-
- // if the the _delay is larger than the required duration to send report
- // speed up
- if (diff > TEN_MILLI_SEC)
- {
- _delay -= TEN_MILLI_SEC;
-
- if (_delay < 0)
- {
- _delay = 0;
- log.info("Reset _delay to 0");
- delayStable();
- }
- else
- {
- delayChanged();
- }
-
- }
- else if (diff < 0) // diff < 0 diff cannot be 0 as it is > _timeVariance
- {
- // the report took longer
- _delay += TEN_MILLI_SEC;
- delayChanged();
- }
- }
- else
- {
- delayStable();
- }
-
- // If we have a consumer that is behind with the batches.
- if ((batchesSent - batchNumber) > _batchVariance)
- {
- log.debug("Increasing _delay as sending more than receiving");
-
- _delay += 2 * TEN_MILLI_SEC;
- delayChanged();
- }
-
- }
-
- /** Reset the number of iterations before we say the delay has stabilised. */
- private void delayChanged()
- {
- _delayShifting = REPORTS_WITHOUT_CHANGE;
- }
-
- /**
- * Record the fact that delay has stabilised If delay has stablised for REPORTS_WITHOUT_CHANGE then it will
- * output Delay stabilised
- */
- private void delayStable()
- {
- _delayShifting--;
-
- if (_delayShifting < 0)
- {
- _delayShifting = 0;
- console.debug("Delay stabilised:" + _delay);
- }
- }
-
- /**
- * Checks that the client has received enough messages. If the client has fallen behind then they are put in the
- * _slowClients lists which will increase the delay.
- *
- * @param client The client identifier to check
- * @param received the number of messages received by that client
- * @param batchNumber
- */
- private void recordSlow(String client, long received, int batchNumber)
- {
- if (Math.abs(batchNumber - (_sent / _batchSize)) > _batchVariance)
- {
- _slowClients.put(client, received);
- }
- else
- {
- _slowClients.remove(client);
- }
- }
-
- /** Incrment the number of sent messages and then sleep, if required. */
- public void sentMessage()
- {
-
- _sent++;
-
- if (_delay > (TEN_MILLI_SEC * _batchSize))
- {
- long batchDelay = _delay / _batchSize;
- // less than 10ms sleep doesn't always work.
- // _delay is in nano seconds
- // if (batchDelay < (TEN_MILLI_SEC))
- // {
- // sleep(0, (int) batchDelay);
- // }
- // else
- {
- // if (batchDelay < 30000000000L)
- {
- sleepLong(batchDelay);
- }
- }
- }
- else
- {
- if (SLEEP_PER_MESSAGE && (_delay > 0))
- {
- sleepLong(_delay / _batchSize);
- }
- }
- }
-
- /**
- * Check at the end of each batch and pause sending messages to allow slow clients to catch up.
- *
- * @return true if there were slow clients that caught up.
- */
- private boolean checkForSlowClients()
- {
- // This will allways be true as we are running this at the end of each batchSize
- // if (_sent % _batchSize == 0)
- {
- // Cause test to pause when we have slow
- if (!_slowClients.isEmpty() || NO_CLIENTS)
- {
-
- while (!_slowClients.isEmpty())
- {
- if (log.isInfoEnabled() && ((_sent / _batchSize % DEBUG_LOG_UPATE_INTERVAL) == 0))
- {
- String clients = "";
- Iterator it = _slowClients.keySet().iterator();
- while (it.hasNext())
- {
- clients += it.next();
- if (it.hasNext())
- {
- clients += ", ";
- }
- }
-
- log.info("Pausing for slow clients:" + clients);
- }
-
- if (console.isDebugEnabled() && ((_sent / _batchSize % LOG_UPATE_INTERVAL) == 0))
- {
- console.debug(_slowClients.size() + " slow clients.");
- }
-
- sleep(PAUSE_SLEEP);
- }
-
- if (NO_CLIENTS)
- {
- sleep(NO_CLIENT_SLEEP);
- }
-
- log.debug("Continuing");
-
- return true;
- }
- else
- {
- if ((_sent / _batchSize % LOG_UPATE_INTERVAL) == 0)
- {
- console.info("Total Delay :" + _delay + " "
- + ((_delayShifting == 0) ? "Stablised" : ("Not Stablised(" + _delayShifting + ")")));
- }
- }
-
- }
-
- return false;
- }
-
- /**
- * Sleep normally takes micro-seconds this allows the use of a nano-second value.
- *
- * @param delay nanoseconds to sleep for.
- */
- private void sleepLong(long delay)
- {
- sleep(delay / 1000000, (int) (delay % 1000000));
- }
-
- /**
- * Sleep for the specified micro-seconds.
- * @param sleep microseconds to sleep for.
- */
- private void sleep(long sleep)
- {
- sleep(sleep, 0);
- }
-
- /**
- * Perform the sleep , swallowing any InteruptException.
- *
- * NOTE: If a sleep request is > 10s then reset only sleep for 5s
- *
- * @param milli to sleep for
- * @param nano sub miliseconds to sleep for
- */
- private void sleep(long milli, int nano)
- {
- try
- {
- log.debug("Sleep:" + milli + ":" + nano);
- if (milli > 10000)
- {
-
- if (_delay == milli)
- {
- _totalDuration = _totalReceived / _batchSize * EXPECTED_TIME_PER_BATCH;
- log.error("Sleeping for more than 10 seconds adjusted to 5s!:" + (milli / 1000)
- + "s. Reset _totalDuration:" + _totalDuration);
- }
- else
- {
- log.error("Sleeping for more than 10 seconds adjusted to 5s!:" + (milli / 1000) + "s");
- }
-
- milli = 5000;
- }
-
- Thread.sleep(milli, nano);
- }
- catch (InterruptedException e)
- {
- //
- }
- }
-
- public void setClient(SustainedClientTestCase client)
- {
- _client = client;
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java b/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java
deleted file mode 100644
index 0077b4727a..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java
+++ /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.
- *
- */
-package org.apache.qpid.sustained;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.framework.DropInTest;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-import java.util.Properties;
-
-/**
- * SustainedTestCase is a {@link FrameworkBaseCase} that runs the "Perf_SustainedPubSub" test case. This consists of one
- * test client sending, and several receiving, and attempts to find the highest rate at which messages can be broadcast
- * to the receivers. It is also a {@link DropInTest} to which more test clients may be added during a test run.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </table>
- */
-public class SustainedTestCase extends FrameworkBaseCase implements DropInTest
-{
- /** Used for debugging. */
- Logger log = Logger.getLogger(SustainedTestCase.class);
-
- /** Holds the root name of the topic on which to send the test messages. */
- private static final String SUSTAINED_KEY = "Perf_SustainedPubSub";
-
- /**
- * Creates a new coordinating test case with the specified name.
- *
- * @param name The test case name.
- */
- public SustainedTestCase(String name)
- {
- super(name);
- }
-
- /**
- * Performs a single test run of the sustained test.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- public void testBasicPubSub() throws Exception
- {
- log.debug("public void testSinglePubSubCycle(): called");
-
- Properties testConfig = new Properties();
- testConfig.put("TEST_NAME", "Perf_SustainedPubSub");
- testConfig.put("SUSTAINED_KEY", SUSTAINED_KEY);
- testConfig.put("SUSTAINED_NUM_RECEIVERS", Integer.getInteger("numReceives", 2));
- testConfig.put("SUSTAINED_UPDATE_INTERVAL", Integer.getInteger("batchSize", 1000));
- testConfig.put("SUSTAINED_UPDATE_KEY", SUSTAINED_KEY + ".UPDATE");
- testConfig.put("ACKNOWLEDGE_MODE", Integer.getInteger("ackMode", AMQSession.AUTO_ACKNOWLEDGE));
-
- log.info("Created Config: " + testConfig.entrySet().toArray());
-
- getCircuitFactory().sequenceTest(null, null, testConfig);
- }
-
- /**
- * Accepts a late joining client into this test case. The client will be enlisted with a control message
- * with the 'CONTROL_TYPE' field set to the value 'LATEJOIN'. It should also provide values for the fields:
- *
- * <p/><table>
- * <tr><td> CLIENT_NAME <td> A unique name for the new client.
- * <tr><td> CLIENT_PRIVATE_CONTROL_KEY <td> The key for the route on which the client receives its control messages.
- * </table>
- *
- * @param message The late joiners join message.
- *
- * @throws JMSException Any JMS Exception are allowed to fall through, indicating that the join failed.
- */
- public void lateJoin(Message message) throws JMSException
- {
- throw new RuntimeException("Not implemented.");
- /*
- // Extract the joining clients details from its join request message.
- TestClientDetails clientDetails = new TestClientDetails();
- clientDetails.clientName = message.getStringProperty("CLIENT_NAME");
- clientDetails.privateControlKey = message.getStringProperty("CLIENT_PRIVATE_CONTROL_KEY");
-
- // Register the joining client, but do block for confirmation as cannot do a synchronous receivers during this
- // method call, as it may have been called from an 'onMessage' method.
- assignReceiverRole(clientDetails, new Properties(), false);
- */
- }
-
- /**
- * Should provide a translation from the junit method name of a test to its test case name as known to the test
- * clients that will run the test. The purpose of this is to convert the JUnit method name into the correct test
- * case name to place into the test invite. For example the method "testP2P" might map onto the interop test case
- * name "TC2_BasicP2P".
- *
- * @param methodName The name of the JUnit test method.
- *
- * @return The name of the corresponding interop test case.
- */
- public String getTestCaseNameForTestMethod(String methodName)
- {
- return "Perf_SustainedPubSub";
- }
-}
diff --git a/M4-RCs/qpid/java/integrationtests/src/resources/sustained-log4j.xml b/M4-RCs/qpid/java/integrationtests/src/resources/sustained-log4j.xml
deleted file mode 100644
index c5ab3137bf..0000000000
--- a/M4-RCs/qpid/java/integrationtests/src/resources/sustained-log4j.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-<?xml version="1.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.
- -
- -->
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-
-
- <appender name="FileAppender" class="org.apache.log4j.FileAppender">
- <param name="File" value="${QPID_WORK}/log/${logprefix}qpid${logsuffix}.log"/>
- <param name="Append" value="false"/>
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
- </layout>
- </appender>
-
- <appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
-
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%d %-5p (%F:%L) - %m%n"/>
- <!--param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/-->
- </layout>
- </appender>
-
- <category name="SustainedTest">
- <priority value="${sustained.level}"/>
- </category>
-
- <category name="org.apache">
- <priority value="warn"/>
- </category>
-
- <category name="org.apache.qpid.interop">
- <priority value="${interop.logging.level}"/>
- </category>
-
-
- <category name="org.apache.qpid.sustained">
- <priority value="${amqj.logging.level}"/>
- </category>
-
- <!--category name="org.apache.qpid.server.txn">
- <priority value="debug"/>
- </category>-->
-
- <root>
- <priority value="all"/>
- <appender-ref ref="STDOUT"/>
- <!--appender-ref ref="ArchivingFileAppender"/-->
- </root>
-</log4j:configuration>
diff --git a/M4-RCs/qpid/java/java.testprofile b/M4-RCs/qpid/java/java.testprofile
deleted file mode 100644
index 95282b8ee1..0000000000
--- a/M4-RCs/qpid/java/java.testprofile
+++ /dev/null
@@ -1,5 +0,0 @@
-broker=${project.root}/build/bin/qpid-server -p @PORT -m @MPORT
-broker.clean=${project.root}/clean-dir ${build.data}
-broker.ready=Qpid Broker Ready
-
-test.excludesfile=${project.root}/ExcludeList ${project.root}/XAExcludeList ${project.root}/08ExcludeList-nonvm
diff --git a/M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/IsolatedClassLoader.java b/M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/IsolatedClassLoader.java
deleted file mode 100644
index fdae005f00..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/IsolatedClassLoader.java
+++ /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.
- *
- */
-package org.apache.qpid.junit.maven;
-
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * </table>
- *
- * @author Rupert Smith
- *
- * @noinspection CustomClassloader
- */
-public class IsolatedClassLoader extends URLClassLoader
-{
-
- private static final URL[] EMPTY_URL_ARRAY = new URL[0];
- private ClassLoader parent = ClassLoader.getSystemClassLoader();
-
- private Set urls = new HashSet();
-
- private boolean childDelegation = true;
-
- public IsolatedClassLoader()
- {
- super(EMPTY_URL_ARRAY, null);
- }
-
- public IsolatedClassLoader(ClassLoader parent, boolean childDelegation)
- {
- super(EMPTY_URL_ARRAY, parent);
-
- this.childDelegation = childDelegation;
- }
-
- public IsolatedClassLoader(ClassLoader parent)
- {
- super(EMPTY_URL_ARRAY, parent);
- }
-
- public void addURL(URL url)
- {
- // avoid duplicates
- if (!urls.contains(url))
- {
- super.addURL(url);
- urls.add(url);
- }
- }
-
- public synchronized Class loadClass(String name) throws ClassNotFoundException
- {
- Class c;
-
- if (childDelegation)
- {
- c = findLoadedClass(name);
-
- ClassNotFoundException ex = null;
-
- if (c == null)
- {
- try
- {
- c = findClass(name);
- }
- catch (ClassNotFoundException e)
- {
- ex = e;
-
- if (parent != null)
- {
- c = parent.loadClass(name);
- }
- }
- }
-
- if (c == null)
- {
- throw ex;
- }
- }
- else
- {
- c = super.loadClass(name);
- }
-
- return c;
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/TKTestRunnerMojo.java b/M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/TKTestRunnerMojo.java
deleted file mode 100644
index 36e594d9dc..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/TKTestRunnerMojo.java
+++ /dev/null
@@ -1,274 +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.
- *
- */
-package org.apache.qpid.junit.maven;
-
-import org.apache.maven.plugin.AbstractMojo;
-
-import java.io.File;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.*;
-
-/**
- * TKTestRunnerMojo is a JUnit test runner plugin for Maven 2. It is intended to be compatible with the surefire
- * plugin (though not all features of that are yet implemented), with some extended capabilities.
- *
- * <p/>This plugin adds the ability to use different JUnit test runners, and to pass arbitrary options to them.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * </table>
- *
- * @author Rupert Smith
- *
- * @goal tktest
- * @phase test
- * @requiresDependencyResolution test
- */
-public class TKTestRunnerMojo extends AbstractMojo
-{
- private static final BitSet UNRESERVED = new BitSet(256);
-
- /**
- * Set this to 'true' to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.
- *
- * @parameter expression="${maven.test.skip}"
- */
- private boolean skip;
-
- /**
- * The TKTest runner command lines. There are passed directly to the TKTestRunner main method.
- *
- * @parameter
- */
- private Map<String, String> commands = new LinkedHashMap<String, String>();
-
- /**
- * The base directory of the project being tested. This can be obtained in your unit test by
- * System.getProperty("basedir").
- *
- * @parameter expression="${basedir}"
- * @required
- */
- private File basedir;
-
- /**
- * The directory containing generated classes of the project being tested.
- *
- * @parameter expression="${project.build.outputDirectory}"
- * @required
- */
- private File classesDirectory;
-
- /**
- * The directory containing generated test classes of the project being tested.
- *
- * @parameter expression="${project.build.testOutputDirectory}"
- * @required
- */
- private File testClassesDirectory;
-
- /**
- * The classpath elements of the project being tested.
- *
- * @parameter expression="${project.testClasspathElements}"
- * @required
- * @readonly
- */
- private List classpathElements;
-
- /**
- * List of System properties to pass to the tests.
- *
- * @parameter
- */
- private Properties systemProperties;
-
- /**
- * Map of of plugin artifacts.
- *
- * @parameter expression="${plugin.artifactMap}"
- * @required
- * @readonly
- */
- private Map pluginArtifactMap;
-
- /**
- * Map of of project artifacts.
- *
- * @parameter expression="${project.artifactMap}"
- * @required
- * @readonly
- */
- private Map projectArtifactMap;
-
- /**
- * Option to specify the forking mode. Can be "never" (default), "once" or "always".
- * "none" and "pertest" are also accepted for backwards compatibility.
- *
- * @parameter expression="${forkMode}" default-value="once"
- */
- private String forkMode;
-
- /**
- * Option to specify the jvm (or path to the java executable) to use with
- * the forking options. For the default we will assume that java is in the path.
- *
- * @parameter expression="${jvm}"
- * default-value="java"
- */
- private String jvm;
-
- /**
- * The test runner to use.
- *
- * @parameter
- */
- private String testrunner;
-
- /**
- * The additional properties to append to the test runner invocation command line.
- *
- * @parameter
- */
- private Properties testrunnerproperties;
-
- /**
- * The options to pass to all test runner invocation command lines.
- *
- * @parameter
- */
- private String[] testrunneroptions;
-
- /**
- * Implementation of the tktest goal.
- */
- public void execute()
- {
- // Skip these tests if test skipping is turned on.
- if (skip)
- {
- getLog().info("Skipping Tests.");
-
- return;
- }
-
- // Log out the classpath if debugging is on.
- if (getLog().isDebugEnabled())
- {
- getLog().info("Test Classpath :");
-
- for (Object classpathElement1 : classpathElements)
- {
- String classpathElement = (String) classpathElement1;
- getLog().info(" " + classpathElement);
- }
- }
-
- try
- {
- // Create a class loader to load the test runner with. This also gets set as the context loader for this
- // thread, so that all subsequent class loading activity by the test runner or the test code, has the
- // test classes available to it. The system loader is set up for the maven build, which is why a seperate
- // loader needs to be created; in order to inject the test dependencies into it.
- ClassLoader runnerClassLoader = createClassLoader(classpathElements, ClassLoader.getSystemClassLoader(), true);
- Thread.currentThread().setContextClassLoader(runnerClassLoader);
-
- // Load the test runner implementation that will be used to run the tests.
- if ((testrunner == null) || "".equals(testrunner))
- {
- testrunner = "org.apache.qpid.junit.extensions.TKTestRunner";
- }
-
- Class testRunnerClass = Class.forName(testrunner, false, runnerClassLoader);
- Method run = testRunnerClass.getMethod("main", String[].class);
-
- // Concatenate all of the options to pass on the command line to the test runner.
- String preOptions = "";
-
- for (String option : testrunneroptions)
- {
- preOptions += option + " ";
- }
-
- // Concatenate all of the additional properties as name=value pairs on the command line.
- String nvPairs = "";
-
- if (testrunnerproperties != null)
- {
- for (Object objKey : testrunnerproperties.keySet())
- {
- String key = (String) objKey;
- String value = testrunnerproperties.getProperty(key);
-
- nvPairs = key + "=" + value + " ";
- }
- }
-
- // Pass each of the test runner command lines in turn to the toolkit test runner.
- // The command line is made up of the options, the command specific command line, then the trailing
- // name=value pairs.
- for (String testName : commands.keySet())
- {
- String commandLine = preOptions + " " + commands.get(testName) + " " + nvPairs;
- getLog().info("commandLine = " + commandLine);
-
- // Tokenize the command line on white space, into an array of string components.
- String[] tokenizedCommandLine = commandLine.split("\\s+");
-
- // Run the tests.
- run.invoke(testRunnerClass, new Object[] { tokenizedCommandLine });
- }
- }
- catch (Exception e)
- {
- getLog().error("There was an exception: " + e.getMessage(), e);
- }
- }
-
- private static ClassLoader createClassLoader(List classPathUrls, ClassLoader parent, boolean childDelegation)
- throws MalformedURLException
- {
- List urls = new ArrayList();
-
- for (Iterator i = classPathUrls.iterator(); i.hasNext();)
- {
- String url = (String) i.next();
-
- if (url != null)
- {
- File f = new File(url);
- urls.add(f.toURL());
- }
- }
-
- IsolatedClassLoader classLoader = new IsolatedClassLoader(parent, childDelegation);
-
- for (Iterator iter = urls.iterator(); iter.hasNext();)
- {
- URL url = (URL) iter.next();
- classLoader.addURL(url);
- }
-
- return classLoader;
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/TKTestScriptGenMojo.java b/M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/TKTestScriptGenMojo.java
deleted file mode 100644
index adbe527e5e..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit-maven-plugin/src/main/org/apache/qpid/junit/maven/TKTestScriptGenMojo.java
+++ /dev/null
@@ -1,148 +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.
- *
- */
-package org.apache.qpid.junit.maven;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * </table>
- *
- * @author Rupert Smith
- * @goal tkscriptgen
- * @phase test
- * @execute phase="test"
- * @requiresDependencyResolution test
- */
-public class TKTestScriptGenMojo extends AbstractMojo
-{
- private static final String _scriptLanguage = "#!/bin/bash\n\n";
-
- private static final String _javaOptArgParser =
- "# Parse arguements taking all - prefixed args as JAVA_OPTS\n" + "for arg in \"$@\"; do\n"
- + " if [[ $arg == -java:* ]]; then\n" + " JAVA_OPTS=\"${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2` \"\n"
- + " else\n" + " ARGS=\"${ARGS}$arg \"\n" + " fi\n" + "done\n\n";
-
- /**
- * Where to write out the scripts.
- *
- * @parameter
- */
- private String scriptOutDirectory;
-
- /**
- * The all-in-one test jar location.
- *
- * @parameter
- */
- private String testJar;
-
- /**
- * The system properties to pass to java runtime.
- *
- * @parameter
- */
- private Properties systemproperties;
-
- /**
- * The TKTest runner command lines. There are passed directly to the TKTestRunner main method.
- *
- * @parameter
- */
- private Map<String, String> commands = new LinkedHashMap<String, String>();
-
- /**
- * Implementation of the tkscriptgen goal.
- *
- * @throws MojoExecutionException
- */
- public void execute() throws MojoExecutionException
- {
- // Turn each of the test runner command lines into a script.
- for (String testName : commands.keySet())
- {
- String testOptions = commands.get(testName);
- String commandLine = "java ";
-
- String logdir = null;
-
- for (Object key : systemproperties.keySet())
- {
- String keyString = (String) key;
- String value = systemproperties.getProperty(keyString);
-
- if (keyString.equals("logdir"))
- {
- logdir = value;
- }
- else
- {
- if (keyString.startsWith("-X"))
- {
- commandLine += keyString + value + " ";
- }
- else
- {
- commandLine += "-D" + keyString + "=" + value + " ";
- }
- }
- }
-
- commandLine +=
- "${JAVA_OPTS} -cp " + testJar + " org.apache.qpid.junit.extensions.TKTestRunner " + testOptions + " ${ARGS}";
-
- getLog().info("Generating Script for test: " + testName);
- getLog().debug(commandLine);
-
- String fileName = scriptOutDirectory + "/" + testName + ".sh";
-
- try
- {
- File scriptFile = new File(fileName);
- Writer scriptWriter = new FileWriter(scriptFile);
- scriptWriter.write(_scriptLanguage);
- scriptWriter.write(_javaOptArgParser);
- if (logdir != null)
- {
- scriptWriter.write("mkdir -p " + logdir + "\n");
- }
-
- scriptWriter.write(commandLine);
- scriptWriter.flush();
- scriptWriter.close();
- }
- catch (IOException e)
- {
- getLog().error("Failed to write: " + fileName);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/build.xml b/M4-RCs/qpid/java/junit-toolkit/build.xml
deleted file mode 100644
index a2f352c4b7..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/build.xml
+++ /dev/null
@@ -1,26 +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.
- -
- -->
-<project name="Junit Toolkit" default="build">
- <property name="module.src" value="src/main"/>
-
- <import file="../module.xml"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/DefaultThreadFactory.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/DefaultThreadFactory.java
deleted file mode 100644
index 8fb0a6a90e..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/DefaultThreadFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.junit.concurrency;
-
-import java.util.concurrent.ThreadFactory;
-
-/**
- * Implements a default thread factory.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create default threads with no specialization.
- * </table>
- *
- * @author Rupert Smith
- */
-public class DefaultThreadFactory implements ThreadFactory
-{
- /**
- * Constructs a new <tt>Thread</tt>.
- *
- * @param r A runnable to be executed by new thread instance.
- *
- * @return The constructed thread.
- */
- public Thread newThread(Runnable r)
- {
- return new Thread(r);
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/PossibleDeadlockException.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/PossibleDeadlockException.java
deleted file mode 100644
index 3bbfc2d502..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/PossibleDeadlockException.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.junit.concurrency;
-
-/**
- * PossibleDeadlockException is used to signal that two test threads being executed by a {@link ThreadTestCoordinator}
- * may be in a state of deadlock because they are mutually blocking each other or one is waiting on the other and the
- * other has been blocked elsewhere for longer than a specified timeout.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Signal a possible state of deadlock between coordinated test threads.
- * </table>
- *
- * @author Rupert Smith
- */
-public class PossibleDeadlockException extends RuntimeException
-{
- /**
- * Create a new possible deadlock execption.
- *
- * @param message The exception message.
- */
- public PossibleDeadlockException(String message)
- {
- super(message);
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/TestRunnable.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/TestRunnable.java
deleted file mode 100644
index 02e776a4ea..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/TestRunnable.java
+++ /dev/null
@@ -1,239 +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.
- *
- */
-package org.apache.qpid.junit.concurrency;
-
-/**
- * TestRunnable is an extension of java.util.Runnable that adds some features to make it easier to coordinate the
- * activities of threads in such a way as to expose bugs in multi threaded code.
- *
- * <p/>Sometimes several threads will run in a particular order so that a bug is not revealed. Other times the ordering
- * of the threads will expose a bug. Such bugs can be hard to replicate as the exact execution ordering of threads is not
- * usually controlled. This class adds some methods that allow threads to synchronize other threads, either allowing them
- * to run, or waiting for them to allow this thread to run. It also provides convenience methods to gather error messages
- * and exceptions from threads, which will often be reported in unit testing code.
- *
- * <p/>Coordination between threads is handled by the {@link ThreadTestCoordinator}. It is called through the convenience
- * methods {@link #allow} and {@link #waitFor}. Threads to be coordinated must be set up with the coordinator and assigned
- * integer ids. It is then possible to call the coordinator with an array of thread ids requesting that those threads
- * be allowed to continue, or to wait until one of them allows this thread to continue. The otherwise non-deterministic
- * execution order of threads can be controlled into a carefully determined sequence using these methods in order
- * to reproduce race conditions, dead locks, live locks, dirty reads, phantom reads, non repeatable reads and so on.
- *
- * <p/>When waiting for another thread to give a signal to continue it is sometimes the case that the other thread has
- * become blocked by the code under test. For example in testing for a dirty read (for example in database code),
- * thread 1 lets thread 2 perform a write but not commit it, then thread 2 lets thread 1 run and attempt to perform a
- * dirty read on its uncommitted write. Transaction synchronization code being tested against the possibility of a dirty
- * write may make use of snapshots in which case both threads should be able to read and write without blocking. It may
- * make use of explicit keys in which case thread 2 may become blocked on its write attempt because thread 1 holds a
- * read lock and it must wait until thread 1 completes its transaction before it can acquire this lock. The
- * {@link #waitFor} method accepts a boolean parameter to indicate that threads being blocked (other than on the
- * coordinator) can be interpreted the same as if the thread explicitly allows the thread calling waitFor to continue.
- * Using this technique a dirty read test could be written that works against either the snapshot or the locking
- * implementation, allowing both approaches to pass the test yet arranging for multiple threads to run against the
- * implementation in such a way that a potential dirty read bug is exposed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Wait for another thread to allow this one to continue.
- * <tr><td> Allow another thread to continue.
- * <tr><td> Accumulate error messages.
- * <tr><td> Record exceptions from thread run.
- * <tr><td> Maintain link to thread coordinator.
- * <tr><td> Explicitly mark a thread with an integer id.
- * <tr><td> Maintian a flag to indicate whether or not this thread is waiting on the coordinator.
- * </table>
- *
- * @todo The allow then waitFor operations are very often used as a pair. So create a method allowAndWait that combines
- * them into a single method call.
- *
- * @author Rupert Smith
- */
-public abstract class TestRunnable implements Runnable
-{
- /** Holds a reference to the thread coordinator. */
- private ThreadTestCoordinator coordinator;
-
- /** Holds the explicit integer id of this thread. */
- private int id;
-
- /** Used to indicate that this thread is waiting on the coordinator and not elsewhere. */
- private boolean waitingOnCoordinator = false;
-
- /** Used to accumulate error messsages. */
- private String errorMessage = "";
-
- /** Holds the Java thread object that this is running under. */
- private Thread thisThread;
-
- /** Used to hold any exceptions resulting from the run method. */
- private Exception runException = null;
-
- /**
- * Implementations override this to perform coordinated thread sequencing.
- *
- * @throws Exception Any exception raised by the implementation will be caught by the default {@link #run()}
- * implementation for later querying by the {@link #getException()} method.
- */
- public abstract void runWithExceptions() throws Exception;
-
- /**
- * Provides a default implementation of the run method that allows exceptions to be thrown and keeps a record
- * of those exceptions. Defers to the {@link #runWithExceptions()} method to provide the thread body implementation
- * and catches any exceptions thrown by it.
- */
- public void run()
- {
- try
- {
- runWithExceptions();
- }
- catch (Exception e)
- {
- this.runException = e;
- }
- }
-
- /**
- * Attempt to consume an allow event from one of the specified threads and blocks until such an event occurrs.
- *
- * @param threads The set of threads that can allow this one to continue.
- * @param otherWaitIsAllow If set to <tt>true</tt> if the threads being waited on are blocked other than on
- * the coordinator itself then this is to be interpreted as allowing this thread to
- * continue.
- *
- * @return If the <tt>otherWaitIsAllow</tt> flag is set, then <tt>true</tt> is returned when the thread being waited on is found
- * to be blocked outside of the thread test coordinator. <tt>false</tt> under all other conditions.
- */
- protected boolean waitFor(int[] threads, boolean otherWaitIsAllow)
- {
- return coordinator.consumeAllowEvent(threads, otherWaitIsAllow, id, this);
- }
-
- /**
- * Produces allow events on each of the specified threads.
- *
- * @param threads The set of threads that are to be allowed to continue.
- */
- protected void allow(int[] threads)
- {
- coordinator.produceAllowEvents(threads, id, this);
- }
-
- /**
- * Keeps the error message for later reporting by the coordinator.
- *
- * @param message The error message to keep.
- */
- protected void addErrorMessage(String message)
- {
- errorMessage += message;
- }
-
- /**
- * Sets the coordinator for this thread.
- *
- * @param coordinator The coordinator for this thread.
- */
- void setCoordinator(ThreadTestCoordinator coordinator)
- {
- this.coordinator = coordinator;
- }
-
- /**
- * Reports whether or not this thread is waiting on the coordinator.
- *
- * @return <tt>If this thread is waiting on the coordinator.
- */
- boolean isWaitingOnCoordinator()
- {
- return waitingOnCoordinator;
- }
-
- /**
- * Sets the value of the waiting on coordinator flag.
- *
- * @param waiting The value of the waiting on coordinator flag.
- */
- void setWaitingOnCoordinator(boolean waiting)
- {
- waitingOnCoordinator = waiting;
- }
-
- /**
- * Sets up the explicit int id for this thread.
- *
- * @param id The integer id.
- */
- void setId(int id)
- {
- this.id = id;
- }
-
- /**
- * Reports any accumulated error messages.
- *
- * @return Any accumulated error messages.
- */
- String getErrorMessage()
- {
- return errorMessage;
- }
-
- /**
- * Reports any exception thrown by the {@link #runWithExceptions} method.
- *
- * @return Any exception thrown by the {@link #runWithExceptions} method.
- */
- Exception getException()
- {
- return runException;
- }
-
- /**
- * Sets the Java thread under which this runs.
- *
- * @param thread The Java thread under which this runs.
- */
- void setThread(Thread thread)
- {
- thisThread = thread;
- }
-
- /**
- * Gets the Java thread under which this runs.
- *
- * @return The Java thread under which this runs.
- */
- Thread getThread()
- {
- return thisThread;
- }
-
- /**
- * Provides a string summary of this test threads status.
- *
- * @return Summarizes this threads status.
- */
- public String toString()
- {
- return "id = " + id + ", waitingOnCoordinator = " + waitingOnCoordinator;
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/ThreadTestCoordinator.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/ThreadTestCoordinator.java
deleted file mode 100644
index 3cf8543656..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/ThreadTestCoordinator.java
+++ /dev/null
@@ -1,486 +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.
- *
- */
-package org.apache.qpid.junit.concurrency;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.concurrent.ThreadFactory;
-
-/**
- * ThreadTestCoordinator provides an array of binary latches that allows threads to wait for other threads or to send
- * them a signal that allows them to continue running or to wait for another thread to signal them. The binary latch
- * array is always a square array, allowing one latch from and to every thread. Upon accepting an allow signal from one
- * sender the latches for all senders for a are cleared. This class is always used in conjunction with
- * {@link TestRunnable} for writing concurrent test code that coordinates multi-threaded activity in order to reproduce
- * concurrency bugs.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Accept test threads to coordinate.
- * <tr><td> Allow test threads to send 'allow to continue' signals.
- * <tr><td> Allow test threads to wait on this coordinator for 'allow to continue' signals.
- * <tr><td> Report error messages from test threads.
- * <tr><td> Report exceptions from test threads.
- * <tr><td> Provide method to wait until all test threads have completed.
- * </table>
- *
- * @todo This code was hacked together as a bit of an experiment, because I wasn't sure if this idea would work. It has
- * proved extremely usefull. Some documentation for this needs to be written to explain it better.
- *
- * @todo Consider how deadlock detection will be handled. If all threads are blocking on the coordinator, waiting for
- * each other, they are deadlocked and there is something wrong with the test code that put them in that
- * situation. If they are all blocked elsewhere, they may be deadlocked, or could just be waiting on some
- * external event. A timeout should be used. Timeout is already implemented, just need to sanity check how
- * this is working and document it.
- *
- * @todo Consider how livelock detection could be implemented? LockFree data structures might cause live locks. I
- * guess a longish timeout is the only thing that can be done for that.
- *
- * @todo Only course grained synchronous at the method class level can be obtained. This is because test code can
- * only insert synchronization points between method calls it makes. So this code will not be usefull for
- * checking sequences of events within methods, unless the code under test is explicitly instrumented for it.
- * It might be possible to instrument code by using labels, and then use the debugger/profiler interface to
- * put breakpoints on the labels and use them as synchronization points. Not perfect, but at the unused labels
- * can be left in the code, without altering its behaviour.
- *
- * @author Rupert Smith
- */
-public class ThreadTestCoordinator
-{
- /** Used for logging. */
- private static final Logger log = LoggerFactory.getLogger(ThreadTestCoordinator.class);
-
- /** Keeps track of the test threads by their ids. */
- private TestRunnable[] testThreads; // = new TestRunnable[2];
-
- /** An explicit thread monitor for the coordinator. Threads wait on the coordinator whilst waiting for events. */
- private final Object coordinatorLock = new Object();
-
- /** A set of monitors for each test thread. */
- private Object[] locks;
-
- /** The binary latch array, this is always a square array allowing one event from and to every thread. */
- private boolean[][] allowEvents;
-
- /** Keeps track of the number of threads being coordinated. */
- private int threadCount = 0;
-
- /** Accumulates any exceptions resulting from the threads run methods. */
- private Collection<Exception> exceptions = new ArrayList<Exception>();
-
- /**
- * Holds the deadlock timeout after which threads are given a runtime exception to signal that a potential
- * deadlock may be happening.
- */
- private long deadlockTimeout = 1000 * 1000000;
-
- /** Holds the factory to create test thread with. */
- private ThreadFactory threadFactory;
-
- /**
- * Creates a new test thread coordinator. The number of threads to run must be specified here.
- *
- * @param numThreads The number of threads to run.
- */
- public ThreadTestCoordinator(int numThreads)
- {
- this.threadCount = numThreads;
-
- // Create an array big enough to hold all the test threads.
- testThreads = new TestRunnable[threadCount];
-
- // Use the default thread factory, as none specified.
- threadFactory = new DefaultThreadFactory();
- }
-
- /**
- * Creates a new test thread coordinator with a specific thread factory. The number of threads to run must be
- * specified here.
- *
- * @param numThreads The number of threads to run.
- * @param threadFactory The factory to use to create the test threads.
- */
- public ThreadTestCoordinator(int numThreads, ThreadFactory threadFactory)
- {
- this.threadCount = numThreads;
-
- // Create an array big enough to hold all the test threads.
- testThreads = new TestRunnable[threadCount];
-
- // Use the specified thread factory.
- this.threadFactory = threadFactory;
- }
-
- /**
- * Adds a thread to this coordinator and assigns an id to it. The ids must be numbered sequentially from 0 and
- * it is up to the caller to do this.
- *
- * @param runnable The test thread.
- * @param id The explicit id to assign to the test thread.
- */
- public void addTestThread(TestRunnable runnable, int id)
- {
- testThreads[id] = runnable;
- runnable.setCoordinator(this);
- runnable.setId(id);
- }
-
- /**
- * Starts all the coordinated threads running.
- */
- public void run()
- {
- // Create the monitors for each thread.
- locks = new Object[threadCount];
-
- // Create an appropriately sized event queue to allow one event from and to each thread.
- allowEvents = new boolean[threadCount][threadCount];
-
- // Initialize the monitors and clear the event queues.
- for (int i = 0; i < locks.length; i++)
- {
- locks[i] = new Object();
-
- for (int j = 0; j < locks.length; j++)
- {
- allowEvents[i][j] = false;
- }
- }
-
- // Start all the threads running.
- for (TestRunnable nextRunnable : testThreads)
- {
- // Create a Java thread for the test thread.
- Thread newThread = threadFactory.newThread(nextRunnable);
- nextRunnable.setThread(newThread);
-
- // Start it running.
- newThread.start();
- }
- }
-
- /**
- * Waits until all the test threads have completed and returns any accumulated error messages from them. Any
- * exceptions thrown by their run methods are also kept at this point.
- *
- * @return The accumulated error messages from all the threads concatenated together.
- */
- public String joinAndRetrieveMessages()
- {
- // Create an empty error message.
- String errorMessage = "";
-
- // Join all the test threads.
- for (TestRunnable r : testThreads)
- {
- Thread t = r.getThread();
-
- try
- {
- t.join();
- }
- catch (InterruptedException e)
- { }
-
- // Add any accumulated error messages to the return value.
- errorMessage += r.getErrorMessage();
-
- // Keep any exceptions resulting from the threads run method.
- Exception e = r.getException();
-
- if (e != null)
- {
- exceptions.add(e);
- }
- }
-
- return errorMessage;
- }
-
- /**
- * Reports any accumulated exceptions from the test threads run methods. This method must be called after
- * {@link #joinAndRetrieveMessages}.
- *
- * @return Any accumulated exceptions from the test threads run methods. This method must be called after
- */
- public Collection<Exception> getExceptions()
- {
- return exceptions;
- }
-
- /**
- * Sets a timeout to break out of potential deadlocks. If all threads are waiting for other threads to send
- * them continue events for longer than this timeout then the threads are all terminated.
- *
- * @param millis The minimum time to allow to pass before breaking out of any potential deadlocks.
- *
- * @todo This has not been implemented yet. If a potential deadlock happens then the joinAndRetrieveMessages
- * method should throw a PotentialDeadlockException.
- */
- public void setDeadlockTimeout(long millis)
- {
- deadlockTimeout = millis * 1000000;
- }
-
- /**
- * Creates a set of 'allow to continue' events on the event queues of the specified threads.
- *
- * @param threads The set of threads to allow to continue.
- * @param callerId The explicit id of the calling test thread.
- * @param caller The calling test thread.
- */
- void produceAllowEvents(int[] threads, int callerId, TestRunnable caller)
- {
- // Generate some debugging messages. Very usefull to know how thread synchronization is progressing.
- String message = "Thread " + callerId + " is allowing threads [ ";
-
- for (int j = 0; j < threads.length; j++)
- {
- message += threads[j] + ((j < (threads.length - 1)) ? ", " : "");
- }
-
- message += " ] to continue.";
- log.debug(message);
-
- // For each allow event, synchronize on the threads lock then set the event flag to true.
- for (int id : threads)
- {
- // Set the waiting on coordinator flag to true in case the coordinator tries to test this thread for
- // being blocked at this time.
- caller.setWaitingOnCoordinator(true);
-
- synchronized (locks[id])
- {
- // Release the wating on coordinator flag now that this thread is running again.
- caller.setWaitingOnCoordinator(false);
-
- // Send the allow to continue event to the receiving thread.
- allowEvents[id][callerId] = true;
- }
- }
-
- // Wake up any threads waiting on the coordinator lock to recheck their event queues.
- // Set the waiting on coordinator flag to true in case the coordinator tries to test this thread for
- // being blocked at this time.
- caller.setWaitingOnCoordinator(true);
-
- synchronized (coordinatorLock)
- {
- // Release the wating on coordinator flag now that this thread is running again.
- caller.setWaitingOnCoordinator(false);
- coordinatorLock.notifyAll();
- }
- }
-
- /**
- * Consumes an 'allow to continue' from one of the specified threads or waits until one is available or in some
- * cases if one of the specified threads is blocked elsewhere to accept that as an 'allow to continue' event.
- *
- * @param threads The set of threads to accept an allow to continue event from.
- * @param otherWaitIsAllow Whether or not to accept threads being blocked elsewhere as permission to continue.
- * @param callerId The explicit id of the calling test thread.
- * @param caller The calling test thread.
- *
- * @return If the <tt>otherWaitIsAllow</tt> flag is set, then <tt>true</tt> is returned when the thread being waited on is found
- * to be blocked outside of the thread test coordinator. <tt>false</tt> under all other conditions.
- */
- boolean consumeAllowEvent(int[] threads, boolean otherWaitIsAllow, int callerId, TestRunnable caller)
- {
- // Generate some debugging messages. Very usefull to know how thread synchronization is progressing.
- String message = "Thread " + callerId + " is requesting threads [ ";
-
- // Record the time at which this method was called. Will be used for breaking out of potential deadlocks.
- long startTime = System.nanoTime();
-
- for (int j = 0; j < threads.length; j++)
- {
- message += threads[j] + ((j < (threads.length - 1)) ? ", " : "");
- }
-
- message += " ] to allow it to continue.";
- log.debug(message);
-
- // Loop until an allow to continue event is received.
- while (true)
- {
- // Look at all the allowing thread to see if one has created an event for consumption.
- for (int allowerId : threads)
- {
- // Get the threads lock for the event to consume.
- // Set the waiting on coordinator flag to true in case the coordinator tries to test this thread for
- // being blocked at this time.
- caller.setWaitingOnCoordinator(true);
-
- synchronized (locks[callerId])
- {
- // Release the wating on coordinator flag now that this thread is running again.
- caller.setWaitingOnCoordinator(false);
-
- // Check if there is an event on the queue from the allowing thread to this one.
- if (allowEvents[callerId][allowerId])
- {
- log.debug("Found an allow event, thread " + allowerId + ", is allowing thread " + callerId
- + ", to continue.");
-
- // Consume all the allow events for this thread.
- /*for (int i = 0; i < allowEvents[callerId].length; i++)
- {
- allowEvents[callerId][i] = false;
- }*/
-
- // Consume just the event from the allower to the consumer, leaving other pending allow events alone.
- allowEvents[callerId][allowerId] = false;
-
- return false;
- }
- }
- }
-
- // If waiting elsewhere is to be interpreted as an 'allow to continue' event, then look at the thread status
- // for the threads being waited on to see if any are blocked on other resources.
- if (otherWaitIsAllow)
- {
- log.debug("Other wait is to be interpreted as an allow event.");
-
- // Look at all the potential allower threads.
- for (int allowerId : threads)
- {
- // Get the Java thread state for the allowing thread.
- Thread threadToTest = testThreads[allowerId].getThread();
- Thread.State state = threadToTest.getState();
-
- // Check if the thread is blocked and so a potential candidate for releasing this one.
- if ((state == Thread.State.BLOCKED) || (state == Thread.State.WAITING)
- || (state == Thread.State.TIMED_WAITING))
- {
- log.debug("Found an allower thread, id = " + allowerId + ", that is blocked or wating.");
-
- // Check that the allower thread is not waiting on the coordinator lock or any of the
- // individual thread locks. It must be waiting or blocked on another monitor.
- TestRunnable allowingRunnable = testThreads[allowerId];
- boolean isWaitingOnCoordinator = allowingRunnable.isWaitingOnCoordinator();
-
- if (!isWaitingOnCoordinator)
- {
- log.debug("The allower thread, id = " + allowerId
- + ", is blocked or waiting other than on the coordinator.");
-
- // Get the threads lock for the event to consume.
- caller.setWaitingOnCoordinator(true);
-
- synchronized (locks[callerId])
- {
- caller.setWaitingOnCoordinator(false);
-
- // Consume all the allow events for this thread.
- for (int i = 0; i < allowEvents[callerId].length; i++)
- {
- allowEvents[callerId][i] = false;
- }
-
- return true;
- }
- }
- else
- {
- log.debug("The waiting allower thread, " + allowerId
- + ", is waiting on the coordinator so does not allow thread " + callerId + " to continue.");
- }
- }
- }
- }
-
- // Keep waiting until an 'allow to continue' event can be consumed.
- try
- {
- // Set the waiting on coordinator flag to true in case the coordinator tries to test this thread for
- // being blocked at this time.
- caller.setWaitingOnCoordinator(true);
-
- synchronized (coordinatorLock)
- {
- // Release the wating on coordinator flag now that this thread is running again.
- caller.setWaitingOnCoordinator(false);
-
- log.debug("Thread " + callerId + " is waiting on coordinator lock for more allow events.");
-
- // Set the waiting on coordinator flag to true in case the coordinator tries to test this thread for
- // being blocked at this time.
- caller.setWaitingOnCoordinator(true);
- coordinatorLock.wait(10);
- }
- }
- catch (InterruptedException e)
- { }
-
- // Release the waiting on coordinator flag now that this thread is running again.
- caller.setWaitingOnCoordinator(false);
-
- // Check if this thread has been waiting for longer than the deadlock timeout and raise a possible
- // deadlock exception if so.
- long waitTime = System.nanoTime() - startTime;
- log.debug("Thread " + callerId + " has been waiting for " + (waitTime / 1000000) + " milliseconds.");
-
- if (waitTime > deadlockTimeout)
- {
- // Throw a possible deadlock exception.
- throw new PossibleDeadlockException("Possible deadlock due to timeout with state:\n" + this);
- }
-
- log.debug("Thread " + callerId + " has woken up, was waiting for more allow events to become available.");
- }
- }
-
- /**
- * Pretty prints the state of the thread test coordinator, for debugging purposes.
- *
- * @return Pretty printed state of the thread test coordinator.
- */
- public String toString()
- {
- String result = "[";
-
- for (int i = 0; i < allowEvents.length; i++)
- {
- for (int j = 0; j < allowEvents[i].length; j++)
- {
- result += allowEvents[i][j];
-
- result += (j < (allowEvents[i].length - 1)) ? ", " : "";
- }
-
- result += (i < (allowEvents.length - 1)) ? ",\n " : "";
- }
-
- result += "]";
-
- for (int i = 0; i < testThreads.length; i++)
- {
- result += "thread[" + i + "] = " + testThreads[i].toString();
- }
-
- return result;
- }
-
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/ThreadTestExample.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/ThreadTestExample.java
deleted file mode 100644
index b9865f2e22..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/ThreadTestExample.java
+++ /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.
- *
- */
-package org.apache.qpid.junit.concurrency;
-
-import org.apache.log4j.Logger;
-
-/**
- * An example to illustrate the use of the {@link ThreadTestCoordinator} and {@link TestRunnable}s.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Demo multi-threaded testing.
- * </table>
- *
- * @author Rupert Smith
- */
-public class ThreadTestExample
-{
- /** Used for logging. */
- private static final Logger log = Logger.getLogger(ThreadTestExample.class);
-
- /** Test thread 1. */
- TestRunnable testThread1 =
- new TestRunnable()
- {
- public void runWithExceptions() throws Exception
- {
- log.debug("public void run(): called");
- log.info("in testThread0, block 1");
-
- // Wait for t2 to allow t1 to continue.
- allow(new int[] { 1 });
- waitFor(new int[] { 1 }, false);
-
- log.info("in testThread0, block 2");
-
- // Wait for t2 to allow t1 to continue. T2 is allowed to be blocked elsewhere than giving explicit
- // permission to allow t1 to continue.
- allow(new int[] { 1 });
- waitFor(new int[] { 1 }, true);
-
- log.info("in testThread0, block 3");
-
- // Release thread 2 from waiting on the shared lock.
- synchronized (sharedLock)
- {
- sharedLock.notifyAll();
- }
-
- allow(new int[] { 1 });
- }
- };
-
- /** A shared lock between the test threads. */
- final Object sharedLock = new Object();
-
- /** Test thread 2. */
- TestRunnable testThread2 =
- new TestRunnable()
- {
- public void runWithExceptions() throws Exception
- {
- log.debug("public void run(): called");
- log.info("in testThread1, block 1");
-
- // Wait for t1 to allow t2 to continue.
- allow(new int[] { 0 });
- waitFor(new int[] { 0 }, false);
-
- log.info("in testThread1, block 2");
-
- // Wait on another resource. T1 should accept this as permission to continue.
- try
- {
- synchronized (sharedLock)
- {
- log.debug("in testThread1, waiting on shared lock.");
- sharedLock.wait();
- }
- }
- catch (InterruptedException e)
- {
- // Bail-out with a runtime if this happens.
- throw new RuntimeException("Interrupted whilst waiting for shared lock.", e);
- }
-
- log.info("in testThread1, finished waiting on shared lock.");
-
- // allow(new int[] { 0 });
-
- // Wait for t1 to allow t2 to continue.
- waitFor(new int[] { 0 }, false);
-
- log.info("in testThread1, block 3");
-
- allow(new int[] { 0 });
- }
- };
-
- /**
- * Executes the test threads with coordination.
- *
- * @param args Ignored.
- */
- public void main(String[] args)
- {
- ThreadTestCoordinator tt = new ThreadTestCoordinator(2);
-
- tt.addTestThread(testThread1, 0);
- tt.addTestThread(testThread2, 1);
- tt.setDeadlockTimeout(500);
- tt.run();
-
- String errorMessage = tt.joinAndRetrieveMessages();
-
- // Print any error messages or exceptions.
- log.info(errorMessage);
-
- if (!tt.getExceptions().isEmpty())
- {
- for (Exception e : tt.getExceptions())
- {
- log.warn("Exception thrown during test thread: ", e);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/package.html b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/package.html
deleted file mode 100644
index 904fd0fd05..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/concurrency/package.html
+++ /dev/null
@@ -1,28 +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.
-
--->
-
-<html>
-<body>
-Contains code to assist in testing concurrency issues using coordinated threads to present code under test with
-oportunities to expose concurrency bugs. Some example concurrency bugs that may be tested using these techniques are
-race conditions, dead locks, live locks, dirty reads, phantom reads, non repeatable reads and so on.
-</body>
-</html>
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestCase.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestCase.java
deleted file mode 100644
index 58a7f60f3c..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestCase.java
+++ /dev/null
@@ -1,303 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-/**
- * AsymptoticTestCase is an extension of TestCase for writing unit tests to analyze asymptotic time and space behaviour.
- *
- * <p>ParameterizedTestCases allow tests to be defined which have test methods that take a single int argument. Normal
- * JUnit test methods do not take any arguments. This int argument can be interpreted in any way by the test but it is
- * intended to denote the 'size' of the test to be run. For example, when testing the performance of a data structure
- * for different numbers of data elements held in the data structure the int parameter should be interpreted as the
- * number of elements. Test timings for different numbers of elements can then be captured and the asymptotic behaviour
- * of the data structure with respect to time analyzed. Any non-parameterized tests defined in extensions of this class
- * will also be run.
- *
- * <p>TestCases derived from this class may also define tear down methods to clean up their memory usage. This is
- * intended to be used in conjunction with memory listeners that report the amount of memory a test uses. The idea is
- * to write a test that allocates memory in the main test method in such a way that it leaves that memory still
- * allocated at the end of the test. The amount of memory used can then be measured before calling the tear down method
- * to clean it up. In the data structure example above, a test will allocate as many elements as are requested by the
- * int parameter and deallocate them in the tear down method. In this way memory readings for different numbers of
- * elements can be captured and the asymptotic behaviour of the data structure with respect to space analyzed.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Store the current int parameter value. <td> {@link TKTestResult} and see {@link AsymptoticTestDecorator} too.
- * <tr><td> Invoke parameterized test methods.
- * </table>
- *
- * @todo If possible try to move the code that invokes the test and setup/teardown methods into {@link TKTestResult} or
- * {@link AsymptoticTestDecorator} rather than this class. This would mean that tests don't have to extend this
- * class to do time and space performance analysis, these methods could be added to any JUnit TestCase class
- * instead. This would be an improvement because existing unit tests wouldn't have to extend a different class to
- * work with this extension, and also tests that extend other junit extension classes could have parameterized
- * and tear down methods too.
- *
- * @author Rupert Smith
- */
-public class AsymptoticTestCase extends TestCase implements InstrumentedTest
-{
- /** Used for logging. */
- private static final Logger log = Logger.getLogger(AsymptoticTestCase.class);
-
- /** The name of the test case. */
- private String testCaseName;
-
- /** Thread local for holding measurements on a per thread basis. */
- ThreadLocal<TestMeasurements> threadLocalMeasurement =
- new ThreadLocal<TestMeasurements>()
- {
- /**
- * Sets up a default set test measurements (zeroed, apart from the size param which defaults to 1).
- *
- * @return A set of default test measurements.
- */
- protected synchronized TestMeasurements initialValue()
- {
- return new TestMeasurements();
- }
- };
-
- /**
- * Constructs a test case with the given name.
- *
- * @param name The name of the test.
- */
- public AsymptoticTestCase(String name)
- {
- super(name);
-
- log.debug("public AsymptoticTestCase(String " + name + "): called");
- testCaseName = name;
- }
-
- /**
- * Gets the current value of the integer parameter to be passed to the parameterized test.
- *
- * @return The current value of the integer parameter.
- */
- public int getN()
- {
- log.debug("public int getN(): called");
- int n = threadLocalMeasurement.get().n;
-
- log.debug("return: " + n);
-
- return n;
- }
-
- /**
- * Sets the current value of the integer parameter to be passed to the parameterized test.
- *
- * @param n The new current value of the integer parameter.
- */
- public void setN(int n)
- {
- log.debug("public void setN(int " + n + "): called");
- threadLocalMeasurement.get().n = n;
- }
-
- /**
- * Reports how long the test took to run.
- *
- * @return The time in milliseconds that the test took to run.
- */
- public long getTestTime()
- {
- log.debug("public long getTestTime(): called");
- long startTime = threadLocalMeasurement.get().startTime;
- long endTime = threadLocalMeasurement.get().endTime;
- long testTime = endTime - startTime;
-
- log.debug("return: " + testTime);
-
- return testTime;
- }
-
- /**
- * Reports the memory usage at the start of the test.
- *
- * @return The memory usage at the start of the test.
- */
- public long getTestStartMemory()
- {
- // log.debug("public long getTestStartMemory(): called");
- long startMem = threadLocalMeasurement.get().startMem;
-
- // log.debug("return: " + startMem);
-
- return startMem;
- }
-
- /**
- * Reports the memory usage at the end of the test.
- *
- * @return The memory usage at the end of the test.
- */
- public long getTestEndMemory()
- {
- // log.debug("public long getTestEndMemory(): called");
- long endMem = threadLocalMeasurement.get().endMem;
-
- // log.debug("return: " + endMem);
- return endMem;
- }
-
- /**
- * Resets the instrumentation values to zero, and nulls any references to held measurements so that the memory
- * can be reclaimed.
- */
- public void reset()
- {
- log.debug("public void reset(): called");
- threadLocalMeasurement.remove();
- }
-
- /**
- * Runs the test method for this test case.
- *
- * @throws Throwable Any Throwables from the test methods invoked are allowed to fall through.
- */
- protected void runTest() throws Throwable
- {
- log.debug("protected void runTest(): called");
-
- // Check that a test name has been set. This is used to define which method to run.
- assertNotNull(testCaseName);
- log.debug("testCaseName = " + testCaseName);
-
- // Try to get the method with matching name.
- Method runMethod = null;
- boolean isParameterized = false;
-
- // Check if a parameterized test method is available.
- try
- {
- // Use getMethod to get all public inherited methods. getDeclaredMethods returns all
- // methods of this class but excludes the inherited ones.
- runMethod = getClass().getMethod(testCaseName, int.class);
- isParameterized = true;
- }
- catch (NoSuchMethodException e)
- {
- // log.debug("Parameterized method \"" + testCaseName + "\" not found.");
- // Set run method to null (it already will be but...) to indicate that no parameterized method
- // version could be found.
- runMethod = null;
- }
-
- // If no parameterized method is available, try and get the unparameterized method.
- if (runMethod == null)
- {
- try
- {
- runMethod = getClass().getMethod(testCaseName);
- isParameterized = false;
-
- }
- catch (NoSuchMethodException e)
- {
- fail("Method \"" + testCaseName + "\" not found.");
- }
- }
-
- // Check that the method is publicly accessable.
- if (!Modifier.isPublic(runMethod.getModifiers()))
- {
- fail("Method \"" + testCaseName + "\" should be public.");
- }
-
- // Try to execute the method, passing it the current int parameter value. Allow any invocation exceptions or
- // resulting exceptions from the method to fall through.
- try
- {
- Integer paramN = getN();
- log.debug("paramN = " + paramN);
-
- // Calculate parameters for parameterized tests so new does not get called during memory measurement.
- Object[] params = new Object[] { paramN };
-
- // Take the test start memory and start time.
- threadLocalMeasurement.get().startMem = 0; // SizeOf.getUsedMemory();
-
- threadLocalMeasurement.get().startTime = System.nanoTime();
-
- if (isParameterized)
- {
- runMethod.invoke(this, params);
- }
- else
- {
- runMethod.invoke(this);
- }
- }
- catch (InvocationTargetException e)
- {
- e.fillInStackTrace();
- throw e.getTargetException();
- }
- catch (IllegalAccessException e)
- {
- e.fillInStackTrace();
- throw e;
- }
- finally
- {
- // Take the test end memory and end time and calculate how long it took to run.
- long endTime = System.nanoTime();
- threadLocalMeasurement.get().endTime = endTime;
- log.debug("startTime = " + threadLocalMeasurement.get().startTime + ", endTime = " + endTime + ", testTime = "
- + getTestTime());
-
- threadLocalMeasurement.get().endMem = 0; // SizeOf.getUsedMemory();
- }
- }
-
- /**
- * The test parameters, encapsulated as a unit for attaching on a per thread basis.
- */
- private static class TestMeasurements
- {
- /** Holds the current value of the integer parameter to run tests on. */
- public int n = 1;
-
- /** Holds the test start memory. */
- public long startTime = 0;
-
- /** Holds the test end memory. */
- public long endTime = 0;
-
- /** Holds the test start memory. */
- public long startMem = 0;
-
- /** Holds the test end memory. */
- public long endMem = 0;
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java
deleted file mode 100644
index 4faa58688f..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/AsymptoticTestDecorator.java
+++ /dev/null
@@ -1,170 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import junit.framework.TestResult;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.junit.extensions.util.MathUtils;
-
-/**
- * A Decorator that runs a test repeatedly on an increasing int parameter, or for a fixed number of repeats. If both
- * a set of integer parameters and a repeat count are specified, then each test is run for the repeat count at each
- * integer parameter.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Repeat a test for each of a set of integer parameters. <td> {@link TKTestResult}
- * <tr><td> Repeat a test multiple times.
- * <tr><td>
- * </table>
- *
- * @author Rupert Smith
- */
-public class AsymptoticTestDecorator extends WrappedSuiteTestDecorator
-{
- /** Used for logging. */
- private static final Logger log = Logger.getLogger(AsymptoticTestDecorator.class);
-
- /** The int size parameters to run the test with. */
- private int[] params;
-
- /** The number of times the whole test should be repeated. */
- private int repeat;
-
- /**
- * Creates an asymptotic test decorator that wraps a test with repeats and a set of integer 'size' paramters
- * to call the test with.
- *
- * @param test The test to wrap.
- * @param params The integer 'size' parameters.
- * @param repeat The number of times to repeat the test.
- */
- public AsymptoticTestDecorator(WrappedSuiteTestDecorator test, int[] params, int repeat)
- {
- super(test);
-
- log.debug("public AsymptoticTestDecorator(Test \"" + test + "\", int[] "
- + ((params == null) ? null : MathUtils.printArray(params)) + ", int " + repeat + "): called");
-
- this.params = params;
- this.repeat = repeat;
- }
-
- /**
- * Creates a new AsymptoticTestDecorator object.
- *
- * @param test The test to decorate.
- * @param start The starting asymptotic integer parameter value.
- * @param end The ending asymptotic integer parameter value.
- * @param step The increment size to move from the start to end values by.
- * @param repeat The number of times to repeat the test at each step of the cycle.
- */
- public AsymptoticTestDecorator(WrappedSuiteTestDecorator test, int start, int end, int step, int repeat)
- {
- super(test);
-
- if (start < 0)
- {
- throw new IllegalArgumentException("Start must be >= 0");
- }
-
- if (end < start)
- {
- throw new IllegalArgumentException("End must be >= start");
- }
-
- if (step < 1)
- {
- throw new IllegalArgumentException("Step must be >= 1");
- }
-
- if (repeat < 1)
- {
- throw new IllegalArgumentException("Repeat must be >= 1");
- }
-
- // Generate the sequence.
- params = new int[((end - start) / step) + 1];
- int i = 0;
- for (int n = start; n <= end; n += step)
- {
- params[i++] = n;
- }
-
- this.repeat = repeat;
- }
-
- /**
- * Runs the test repeatedly for each value of the int parameter specified and for the correct number of test
- * repeats.
- *
- * @param result The test result object that the tests will indicate their results to. This is also used
- * to pass the int parameter from this class to the decorated test class.
- */
- public void run(TestResult result)
- {
- log.debug("public void run(TestResult result): called");
-
- if (!(result instanceof TKTestResult))
- {
- throw new IllegalArgumentException("AsymptoticTestDecorator only works with TKTestResult");
- }
-
- // Cast the test result into a TKTestResult to place the current parameter into.
- TKTestResult tkResult = (TKTestResult) result;
-
- log.debug("params = " + ((params == null) ? null : MathUtils.printArray(params)));
- log.debug("repeat = " + repeat);
-
- for (int n : params)
- {
- for (int j = 0; j < repeat; j++)
- {
- log.debug("n = " + n);
-
- // Set the integer parameter in the TKTestResult to be passed to the tests.
- tkResult.setN(n);
-
- if (tkResult.shouldStop())
- {
- log.debug("tkResult.shouldStop = " + true);
-
- break;
- }
-
- log.debug("Calling super#run");
- super.run(tkResult);
- }
- }
- }
-
- /**
- * Prints out the name of this test with the string "(parameterized)" appended onto it for debugging purposes.
- *
- * @return The name of this test with the string "(parameterized)" appended onto it.
- */
- public String toString()
- {
- return super.toString() + "(parameterized)";
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/BaseThrottle.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/BaseThrottle.java
deleted file mode 100644
index 61d5746421..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/BaseThrottle.java
+++ /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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-/**
- * Provides a base implementation of the non-waiting throttle checking method, using the system nano timer.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Check against a throttle speed without waiting.
- * </table>
- *
- * @author Rupert Smith
- */
-public abstract class BaseThrottle implements Throttle
-{
- /** Holds the length of a single cycle in nano seconds. */
- protected long cycleTimeNanos;
-
- /** Holds the time of the last succesfull call to the check method. */
- private long lastCheckTimeNanos;
-
- /** Flag used to detect the first call to the {@link #checkThrottle()} method. */
- boolean firstCheckCall = true;
-
- /**
- * Flag used to detect the first call to the {@link #throttle()} method. Zero or negative start time cannot be
- * relied on to detect this as System.nanoTime can return zero or negative values.
- */
- boolean firstCall = true;
-
- /**
- * Specifies the throttling rate in operations per second. This must be called with with a value, the inverse
- * of which is a measurement in nano seconds, such that the number of nano seconds do not overflow a long integer.
- * The value must also be larger than zero.
- *
- * @param hertz The throttling rate in cycles per second.
- */
- public void setRate(float hertz)
- {
- // Check that the argument is above zero.
- if (hertz <= 0.0f)
- {
- throw new IllegalArgumentException("The throttle rate must be above zero.");
- }
-
- // Calculate the cycle time.
- cycleTimeNanos = (long) (1000000000f / hertz);
-
- // Reset the first pass flag.
- firstCall = false;
- firstCheckCall = false;
- }
-
- /**
- * Checks but does not enforce the throttle rate. When this method is called, it checks if a length of time greater
- * than that equal to the inverse of the throttling rate has passed since it was last called and returned <tt>true</tt>
- *
- * @return <tt>true</tt> if a length of time greater than that equal to the inverse of the throttling rate has
- * passed since this method was last called and returned <tt>true</tt>, <tt>false</tt> otherwise. The very
- * first time this method is called on a throttle, it returns <tt>true</tt> as the base case to the above
- * self-referential definition.
- */
- public boolean checkThrottle()
- {
- long now = System.nanoTime();
-
- if ((now > (cycleTimeNanos + lastCheckTimeNanos)) || firstCheckCall)
- {
- firstCheckCall = false;
- lastCheckTimeNanos = now;
-
- return true;
- }
- else
- {
- return false;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/BatchedThrottle.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/BatchedThrottle.java
deleted file mode 100644
index 241e7aa2b7..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/BatchedThrottle.java
+++ /dev/null
@@ -1,94 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-/**
- * BatchedThrottle is a {@link SleepThrottle} that uses batching to achieve much higher throttling rates than a sleep
- * throttle can. Sleep throttle has difficulties once the rate gets above a few hundred hertz, because the JVM cannot
- * generate timed pauses that are that short. BatchedThrottle gets around this by only inserting pauses once every so
- * many calls to the {@link #throttle()} method, and using a sleep throttle run at a lower rate. The rate for the sleep
- * throttle is chosen so that it remains under 100hz. The final throttling rate of this throttle is equal to the batch
- * size times the rate of the underlying sleep throttle.
- *
- * <p/>The batching calculation involves taking the log to the base 100 of the desired rate and rounding this to
- * an integer. The batch size is always an exact power of 100 because of the rounding. The rate for an underlying
- * sleep throttle is then chosen appropriately.
- *
- * <p/>In practice, the accuracy of a BacthedThrottle skews off but can sometimes even be reasonable up to ten thousand
- * hertz compared with 100 Hz for a {@link SleepThrottle}.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Accept throttling rate in operations per second.
- * <tr><td> Inject short pauses, occasionaly, to fill out processing cycles to a specified rate.
- * <tr><td> Check against a throttle speed without waiting.
- * </table>
- *
- * @todo Should always round the log base 100 down to the nearest integer?
- *
- * @author Rupert Smith
- */
-public class BatchedThrottle extends BaseThrottle
-{
- /** Holds the batch size. */
- int batchSize;
-
- /** The call count within the current batch. */
- long callCount;
-
- /** Holds a sleep throttle configured to run at the batched rate. */
- private Throttle batchRateThrottle = new SleepThrottle();
-
- /**
- * Specifies the throttling rate in operations per second.
- *
- * @param hertz The throttling rate in cycles per second.
- */
- public void setRate(float hertz)
- {
- // Pass the rate unaltered down to the base implementation, for the check method.
- super.setRate(hertz);
-
- // Log base 10 over 2 is used here to get a feel for what power of 100 the total rate is.
- // As the total rate goes up the powers of 100 the batch size goes up by powers of 100 to keep the
- // throttle rate in the range 1 to 100.
- int x = (int) (Math.log10(hertz) / 2);
- batchSize = (int) Math.pow(100, x);
- float throttleRate = hertz / batchSize;
-
- // Reset the call count.
- callCount = 0;
-
- // Set the sleep throttle wrapped implementation at a rate within its abilities.
- batchRateThrottle.setRate(throttleRate);
- }
-
- /**
- * Throttle calls to this method to the rate specified by the {@link #setRate(float)} method.
- */
- public void throttle()
- {
- if ((callCount++ % batchSize) == 0)
- {
- batchRateThrottle.throttle();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/DurationTestDecorator.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/DurationTestDecorator.java
deleted file mode 100644
index e99fcce752..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/DurationTestDecorator.java
+++ /dev/null
@@ -1,205 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import junit.framework.Test;
-import junit.framework.TestResult;
-
-import org.apache.log4j.Logger;
-
-import java.util.Timer;
-import java.util.TimerTask;
-
-/**
- * A test decorator that runs a test repeatedly until a specified length of time has passed.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Repeatedly run a test for a fixed length of time.
- * </table>
- *
- * @todo The count of the number of tests run is an important number to keep. Also num passed/error/failed is also
- * important to record. What to do with these numbers? They are already logged to the test listeners.
- *
- * @todo The duration test runner wraps on top of size, repeat or thread wrappers, need a way for it to tell
- * TKTestResult when the duration is up, so that it can terminate any repeats in progress. It should end
- * as soon as possible once the test method exits.
- *
- * @author Rupert Smith
- */
-public class DurationTestDecorator extends WrappedSuiteTestDecorator implements ShutdownHookable
-{
- /** Used for logging. */
- private static final Logger log = Logger.getLogger(DurationTestDecorator.class);
-
- /** The test to run. */
- private Test test;
-
- /** The length of time to run the test for. */
- private long duration;
-
- /** Flag set by the shutdown hook. This decorator will not start any new tests when this is set. */
- private boolean shutdown = false;
-
- /**
- * Creates an active test with default multiplier (1).
- *
- * @param test The target test.
- */
- public DurationTestDecorator(WrappedSuiteTestDecorator test)
- {
- super(test);
- this.test = test;
- }
-
- /**
- * Creates active test with default multiplier (1).
- *
- * @param test The target test.
- * @param duration The duration in milliseconds.
- */
- public DurationTestDecorator(WrappedSuiteTestDecorator test, long duration)
- {
- super(test);
-
- // log.debug("public DurationTestDecorator(Test \"" + test + "\", long " + duration + "): called");
-
- this.test = test;
- this.duration = duration;
- }
-
- /**
- * Runs the test repeatedly for the fixed duration.
- *
- * @param testResult The the results object to monitor the test results with.
- */
- public void run(TestResult testResult)
- {
- log.debug("public void run(TestResult testResult): called");
-
-// Removing the durationTimer as this addition prevents this TestDecorator being wrapped with a Scaled Test Decorator.
- // This change will cause the tests to run for at least the specified duration
- // If we need the test to stop much closer to the specified duration then we need to
- // ensure that the solution doesn't prevent this Decorator being wrapped with other Decorators.
-
-// // Cast the test result to expose it as a TKTestResult if the test is running under the TKTestRunner.
-// TKTestResult tkTestResult = null;
-//
-// if (testResult instanceof TKTestResult)
-// {
-// tkTestResult = (TKTestResult) testResult;
-// }
-//
-// // If running under the TKTestRunner, set up a timer to notify the test framework when the test reaches its
-// // completion time.
-// Timer durationTimer = null;
-//
-// if (tkTestResult != null)
-// {
-// log.debug("Creating duration timer.");
-//
-// durationTimer = new Timer();
-// durationTimer.schedule(new DurationTimerTask((TKTestResult) testResult), duration);
-// }
-
-
- // Work out when the test should end.
- long now = System.nanoTime();
- long end = (duration * 1000000) + now;
-
- // Run the test until the duration times out or the shutdown flag is set. The test method may not exit until
- // interrupted in some cases, in which case the timer will do the interrupting.
- while ((now < end) && !shutdown)
- {
- test.run(testResult);
-
- now = System.nanoTime();
- }
-
-// // Clean up any timer that was used.
-// if (durationTimer != null)
-// {
-// log.debug("Cancelling duration timer.");
-//
-// durationTimer.cancel();
-// }
- }
-
- /**
- * Supplies the shutdown hook. This shutdown hook does not call {@link TKTestResult#shutdownNow()} because the
- * {@link ScaledTestDecorator} already takes care of that.
- *
- * @return The shut down hook.
- */
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- // log.debug("DurationTestDecorator::ShutdownHook: called");
-
- // Set the shutdown flag so that no new tests are started.
- shutdown = true;
- }
- });
- }
-
-// /**
-// * DurationTimerTask is a timer task that is configured, upon expiry of its timer, to invoke
-// * {@link TKTestResult#shutdownNow()}, for the test result object on which it is set. It also sets
-// * the {@link DurationTestDecorator#shutdown} flag to indicate that no new tests should be run.
-// *
-// * <p/>The test loop implemented by DurationTestDecorator checks that the duration has not expired, on each
-// * test case that it runs. However, it is possible to write test cases that never return until explicitly
-// * interrupted by the test framework. This timer task exists to notify the test framework
-// */
-// private class DurationTimerTask extends TimerTask
-// {
-// /** Used for debugging purposes. */
-// private final Logger log = Logger.getLogger(DurationTimerTask.class);
-//
-// /** Holds the test result for the test to which a duration limit is being applied. */
-// TKTestResult testResult;
-//
-// /**
-// * Creates a duration limit timer which will notify the specified test result when the duration has
-// * expired.
-// *
-// * @param testResult The test result to notify upon expiry of the test duration.
-// */
-// public DurationTimerTask(TKTestResult testResult)
-// {
-// this.testResult = testResult;
-// }
-//
-// /**
-// * The action to be performed by this timer task.
-// */
-// public void run()
-// {
-// log.debug("public void run(): called");
-//
-// shutdown = true;
-// testResult.shutdownNow();
-// }
-// }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/InstrumentedTest.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/InstrumentedTest.java
deleted file mode 100644
index 0804757dce..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/InstrumentedTest.java
+++ /dev/null
@@ -1,66 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import junit.framework.Test;
-
-/**
- * An InstrumentedTest is one which can supply some additional instrumentation on top of the pass/fail/error behaviour
- * of normal junit tests. Tests implementing this interface must additionally supply information about how long they
- * took to run and how much memory they used.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Report test run time.
- * <tr><td> Report test memory usage.
- * </table>
- *
- * @author Rupert Smith
- */
-public interface InstrumentedTest extends Test
-{
- /**
- * Reports how long the test took to run.
- *
- * @return The time in milliseconds that the test took to run.
- */
- public long getTestTime();
-
- /**
- * Reports the memory usage at the start of the test.
- *
- * @return The memory usage at the start of the test.
- */
- public long getTestStartMemory();
-
- /**
- * Reports the memory usage at the end of the test.
- *
- * @return The memory usage at the end of the test.
- */
- public long getTestEndMemory();
-
- /**
- * Resets the instrumentation values to zero, and nulls any references to held measurements so that the memory
- * can be reclaimed.
- */
- public void reset();
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/NullResultPrinter.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/NullResultPrinter.java
deleted file mode 100644
index 6727f6f152..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/NullResultPrinter.java
+++ /dev/null
@@ -1,92 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-
-import junit.textui.ResultPrinter;
-
-import java.io.PrintStream;
-
-/**
- * A ResultPrinter that prints nothing. This exists, in order to provide a replacement to JUnit's ResultPrinter, which
- * is refered to directly by JUnit code, rather that as an abstracted TestListener. JUnit's text ui TestRunner must
- * have a ResultPrinter. This provides an implementation of it that prints nothing, so that a better mechanism can
- * be used for providing feedback to the console instead.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </table>
- *
- * @todo See todo in TKTestRunner about completely replacing the test ui runner. Doing things like this in order to
- * extend JUnit is not nice, and there needs to be a better way to do it. Delete this class and use a listener
- * instead.
- *
- * @author Rupert Smith
- */
-public class NullResultPrinter extends ResultPrinter
-{
- /**
- * Builds a fake ResultPrinter that prints nothing.
- *
- * @param writer The writer to send output to.
- */
- public NullResultPrinter(PrintStream writer)
- {
- super(writer);
- }
-
- /**
- * Does nothing.
- *
- * @param test Ignored.
- * @param t Ignored.
- */
- public void addError(Test test, Throwable t)
- { }
-
- /**
- * Does nothing.
- *
- * @param test Ignored.
- * @param t Ignored.
- */
- public void addFailure(Test test, AssertionFailedError t)
- { }
-
- /**
- * Does nothing.
- *
- * @param test Ignored.
- */
- public void endTest(Test test)
- { }
-
- /**
- * Does nothing.
- *
- * @param test Ignored.
- */
- public void startTest(Test test)
- { }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java
deleted file mode 100644
index 2c207635c7..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ParameterVariationTestDecorator.java
+++ /dev/null
@@ -1,172 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import junit.framework.TestResult;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.junit.extensions.util.MathUtils;
-
-/**
- * ParameterVariationTestDecorator is a test decorator that runs a test repeatedly under all permutations of its
- * test parameters.
- *
- * a set of integer parameters and a repeat count are specified, then each test is run for the repeat count at each
- * integer parameter.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Repeat a test for each of a set of integer parameters. <td> {@link org.apache.qpid.junit.extensions.TKTestResult}
- * <tr><td> Repeat a test multiple times.
- * <tr><td>
- * </table>
- *
- * @author Rupert Smith
- */
-public class ParameterVariationTestDecorator extends WrappedSuiteTestDecorator
-{
- /** Used for logging. */
- private static final Logger log = Logger.getLogger(ParameterVariationTestDecorator.class);
-
- /** The int size parameters to run the test with. */
- private int[] params;
-
- /** The number of times the whole test should be repeated. */
- private int repeat;
-
- /**
- * Creates an asymptotic test decorator that wraps a test with repeats and a set of integer 'size' paramters
- * to call the test with.
- *
- * @param test The test to wrap.
- * @param params The integer 'size' parameters.
- * @param repeat The number of times to repeat the test.
- */
- public ParameterVariationTestDecorator(WrappedSuiteTestDecorator test, int[] params, int repeat)
- {
- super(test);
-
- log.debug("public AsymptoticTestDecorator(Test \"" + test + "\", int[] "
- + ((params == null) ? null : MathUtils.printArray(params)) + ", int " + repeat + "): called");
-
- this.params = params;
- this.repeat = repeat;
- }
-
- /**
- * Creates a new AsymptoticTestDecorator object.
- *
- * @param test The test to decorate.
- * @param start The starting asymptotic integer parameter value.
- * @param end The ending asymptotic integer parameter value.
- * @param step The increment size to move from the start to end values by.
- * @param repeat The number of times to repeat the test at each step of the cycle.
- */
- public ParameterVariationTestDecorator(WrappedSuiteTestDecorator test, int start, int end, int step, int repeat)
- {
- super(test);
-
- if (start < 0)
- {
- throw new IllegalArgumentException("Start must be >= 0");
- }
-
- if (end < start)
- {
- throw new IllegalArgumentException("End must be >= start");
- }
-
- if (step < 1)
- {
- throw new IllegalArgumentException("Step must be >= 1");
- }
-
- if (repeat < 1)
- {
- throw new IllegalArgumentException("Repeat must be >= 1");
- }
-
- // Generate the sequence.
- params = new int[((end - start) / step) + 1];
- int i = 0;
- for (int n = start; n <= end; n += step)
- {
- params[i++] = n;
- }
-
- this.repeat = repeat;
- }
-
- /**
- * Runs the test repeatedly for each value of the int parameter specified and for the correct number of test
- * repeats.
- *
- * @param result The test result object that the tests will indicate their results to. This is also used
- * to pass the int parameter from this class to the decorated test class.
- */
- public void run(TestResult result)
- {
- log.debug("public void run(TestResult result): called");
-
- if (!(result instanceof TKTestResult))
- {
- throw new IllegalArgumentException("AsymptoticTestDecorator only works with TKTestResult");
- }
-
- // Cast the test result into a TKTestResult to place the current parameter into.
- TKTestResult tkResult = (TKTestResult) result;
-
- log.debug("params = " + ((params == null) ? null : MathUtils.printArray(params)));
- log.debug("repeat = " + repeat);
-
- for (int n : params)
- {
- for (int j = 0; j < repeat; j++)
- {
- log.debug("n = " + n);
-
- // Set the integer parameter in the TKTestResult to be passed to the tests.
- tkResult.setN(n);
-
- if (tkResult.shouldStop())
- {
- log.debug("tkResult.shouldStop = " + true);
-
- break;
- }
-
- log.debug("Calling super#run");
- super.run(tkResult);
- }
- }
- }
-
- /**
- * Prints out the name of this test with the string "(parameterized)" appended onto it for debugging purposes.
- *
- * @return The name of this test with the string "(parameterized)" appended onto it.
- */
- public String toString()
- {
- return super.toString() + "(parameterized)";
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ScaledTestDecorator.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ScaledTestDecorator.java
deleted file mode 100644
index e0af22cfb7..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ScaledTestDecorator.java
+++ /dev/null
@@ -1,375 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import junit.framework.Test;
-import junit.framework.TestResult;
-
-import java.util.concurrent.BrokenBarrierException;
-import java.util.concurrent.CyclicBarrier;
-
-/**
- * A test decorator that runs a test many times simultaneously in many threads.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Clone a test run into many threads and run them simultaneously.
- * <tr><td> Inform the test results of the start and end of each concurrent test batch. <td> {@link TKTestResult}
- * <tr><td> Inform the test results of the concurrency level. <td> {@link TKTestResult}
- * </table>
- *
- * @author Rupert Smith
- */
-public class ScaledTestDecorator extends WrappedSuiteTestDecorator implements ShutdownHookable // TestDecorator
-{
- /** Used for logging. */
- // private static final Logger log = Logger.getLogger(ScaledTestDecorator.class);
-
- /** Determines how long to wait for tests to cleanly exit on shutdown. */
- private static final long SHUTDOWN_PAUSE = 3000;
-
- /**
- * The stress levels or numbers of simultaneous threads to run the test in. The test is repeated at each of
- * the concurrency levels specified here. Defaults to 1 thread.
- */
- private int[] threads = new int[] { 1 };
-
- /** Used to hold the number of tests currently being run in parallel. */
- private int concurrencyLevel;
-
- /** The test to run. */
- private WrappedSuiteTestDecorator test;
-
- /**
- * Used to hold the current {@link TKTestResult} for the tests currently being run. This is made available so that
- * the shutdown hook can ask it to cleanly end the current tests in the event of a shutdown.
- */
- private TKTestResult currentTestResult;
-
- /** Flag set by the shutdown hook. This decorator will not start any new tests when this is set. */
- private boolean shutdown = false;
-
- /**
- * Creates an active test with default multiplier (1).
- *
- * @param test The target test.
- */
- public ScaledTestDecorator(WrappedSuiteTestDecorator test)
- {
- super(test);
- this.test = test;
- }
-
- /**
- * Creates a concurrently scaled test with the specified number of threads.
- *
- * @param test The target test.
- * @param numThreads The stress level.
- */
- public ScaledTestDecorator(WrappedSuiteTestDecorator test, int numThreads)
- {
- this(test, new int[] { numThreads });
- }
-
- /**
- * Creates a concurrently scaled test with the specified thread levels, the test is repeated at each level.
- *
- * @param test The target test.
- * @param threads The concurrency levels.
- */
- public ScaledTestDecorator(WrappedSuiteTestDecorator test, int[] threads)
- {
- super(test);
-
- /*log.debug("public ScaledTestDecorator(WrappedSuiteTestDecorator test = \"" + test + "\", int[] threads = "
- + MathUtils.printArray(threads) + "): called");*/
-
- this.test = test;
- this.threads = threads;
- }
-
- /**
- * Runs the test simultaneously in at the specified concurrency levels.
- *
- * @param testResult The results object to monitor the test results with.
- */
- public void run(TestResult testResult)
- {
- // log.debug("public void run(TestResult testResult = " + testResult + "): called");
-
- // Loop through all of the specified concurrent levels for the test, provided shutdown has not been called.
- for (int i = 0; (i < threads.length) && !shutdown; i++)
- {
- // Get the number of threads for this run.
- int numThreads = threads[i];
-
- // Create test thread handlers for all the threads.
- TestThreadHandler[] threadHandlers = new TestThreadHandler[numThreads];
-
- // Create a cyclic barrier for the test threads to synch their setups and teardowns on.
- CyclicBarrier barrier = new CyclicBarrier(numThreads);
-
- // Set up the test thread handlers to output results to the same test results object.
- for (int j = 0; j < numThreads; j++)
- {
- threadHandlers[j] = new TestThreadHandler(testResult, test, barrier);
- }
-
- // Ensure the concurrency level statistic is set up correctly.
- concurrencyLevel = numThreads;
-
- // Begin batch.
- if (testResult instanceof TKTestResult)
- {
- TKTestResult tkResult = (TKTestResult) testResult;
- // tkResult.notifyStartBatch();
- tkResult.setConcurrencyLevel(numThreads);
-
- // Set the test result for the currently running tests, so that the shutdown hook can call it if necessary.
- currentTestResult = tkResult;
- }
-
- // Run all the tests and wait for them all to finish.
- executeAndWaitForRunnables(threadHandlers);
-
- // Clear the test result for the currently running tests.
- currentTestResult = null;
-
- // End batch.
- if (testResult instanceof TKTestResult)
- {
- TKTestResult tkResult = (TKTestResult) testResult;
- tkResult.notifyEndBatch();
- }
-
- // Clear up all the test threads, they hold references to their associated TestResult object and Test object,
- // which may prevent them from being garbage collected as the TestResult and Test objects are long lived.
- for (int j = 0; j < numThreads; j++)
- {
- threadHandlers[j].testResult = null;
- threadHandlers[j].test = null;
- threadHandlers[j] = null;
- }
- }
- }
-
- /**
- * Reports the number of tests that the scaled decorator is currently running concurrently.
- *
- * @return The number of tests that the scaled decorator is currently running concurrently.
- */
- public int getConcurrencyLevel()
- {
- return concurrencyLevel;
- }
-
- /**
- * Executes all of the specifed runnable using the thread pool and waits for them all to complete.
- *
- * @param runnables The set of runnables to execute concurrently.
- */
- private void executeAndWaitForRunnables(Runnable[] runnables)
- {
- int numThreads = runnables.length;
-
- // Used to keep track of the test threads in order to know when they have all completed.
- Thread[] threads = new Thread[numThreads];
-
- // Create all the test threads.
- for (int j = 0; j < numThreads; j++)
- {
- threads[j] = new Thread(runnables[j]);
- }
-
- // Start all the test threads.
- for (int j = 0; j < numThreads; j++)
- {
- threads[j].start();
- }
-
- // Wait for all the test threads to complete.
- for (int j = 0; j < numThreads; j++)
- {
- try
- {
- threads[j].join();
- }
- catch (InterruptedException e)
- {
- // Restore the interrupted state of the thread.
- Thread.currentThread().interrupt();
- }
- }
- }
-
- /**
- * Supplies the shut-down hook.
- *
- * @return The shut-down hook.
- */
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- // log.debug("ScaledTestDecorator::ShutdownHook: called");
-
- // Set the shutdown flag so that no new tests are started.
- shutdown = true;
-
- // Check if tests are currently running, and ask them to complete as soon as possible. Allow
- // a short pause for this to happen.
- TKTestResult testResult = currentTestResult;
-
- if (testResult != null)
- {
- // log.debug("There is a test result currently running tests, asking it to terminate ASAP.");
- testResult.shutdownNow();
-
- try
- {
- Thread.sleep(SHUTDOWN_PAUSE);
- }
- catch (InterruptedException e)
- {
- // Restore the interrupted state of the thread.
- Thread.currentThread().interrupt();
- }
- }
- }
- });
- }
-
- /**
- * Prints a string summarizing this test decorator, mainly for debugging purposes.
- *
- * @return String representation for debugging purposes.
- */
- public String toString()
- {
- return "ScaledTestDecorator: [ test = " + test + ", concurrencyLevel = " + concurrencyLevel + " ]";
- }
-
- /**
- * TestThreadHandler is a runnable used to execute a test in. This is static to avoid implicit 'this' reference to
- * the longer lived ScaledTestDecorator class. The scaled test decorator may execute many repeats but creates fresh
- * handlers for each one. It re-uses the threads in a pool but does not re-use these handlers.
- */
- private static class TestThreadHandler implements Runnable
- {
- /** The test result object for the test to be run with. */
- TestResult testResult;
-
- /** The test to run. */
- WrappedSuiteTestDecorator test;
-
- /** Holds the cyclic barrier to synchronize on the end of the setups and before the tear downs. */
- CyclicBarrier barrier;
-
- /**
- * Creates a new TestThreadHandler object.
- *
- * @param testResult The test result object for the test to be run with.
- * @param test The test to run in a sperate thread.
- * @param barrier The barrier implementation to use to synchronize per-thread setup completion and test
- * completion before moving on through the setup, test, teardown phases. The barrier should
- * be configured for the number of test threads.
- */
- TestThreadHandler(TestResult testResult, WrappedSuiteTestDecorator test, CyclicBarrier barrier)
- {
- this.testResult = testResult;
- this.test = test;
- this.barrier = barrier;
- }
-
- /**
- * Runs the test associated with this pool.
- */
- public void run()
- {
- try
- {
- // Call setup on all underlying tests in the suite that are thread aware.
- for (Test childTest : test.getAllUnderlyingTests())
- {
- // Check that the test is concurrency aware, so provides a setup method to call.
- if (childTest instanceof TestThreadAware)
- {
- // Call the tests per thread setup.
- TestThreadAware setupTest = (TestThreadAware) childTest;
- setupTest.threadSetUp();
- }
- }
-
- // Wait until all test threads have completed their setups.
- barrier.await();
-
- // Start timing the test batch, only after thread setups have completed.
- if (testResult instanceof TKTestResult)
- {
- ((TKTestResult) testResult).notifyStartBatch();
- }
-
- // Run the tests.
- test.run(testResult);
-
- // Wait unitl all test threads have completed their tests.
- barrier.await();
-
- // Call tear down on all underlying tests in the suite that are thread aware.
- for (Test childTest : test.getAllUnderlyingTests())
- {
- // Check that the test is concurrency aware, so provides a teardown method to call.
- if (childTest instanceof TestThreadAware)
- {
- // Call the tests per thread tear down.
- TestThreadAware setupTest = (TestThreadAware) childTest;
- setupTest.threadTearDown();
- }
- }
- }
- catch (InterruptedException e)
- {
- // Restore the interrupted state of the thread.
- Thread.currentThread().interrupt();
- }
- catch (BrokenBarrierException e)
- {
- // Set the interrupted state on the thread. The BrokenBarrierException may be caused where one thread
- // waiting for the barrier is interrupted, causing the remaining threads correctly waiting on the
- // barrier to fail. This condition is expected during test interruptions, and the response to it is to
- // interrupt all the other threads running in the same scaled test.
- Thread.currentThread().interrupt();
- }
- }
-
- /**
- * Prints the name of the test for debugging purposes.
- *
- * @return The name of the test.
- */
- public String toString()
- {
- return "ScaledTestDecorator: [test = \"" + test + "\"]";
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SetupTaskAware.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SetupTaskAware.java
deleted file mode 100644
index e462145d7d..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SetupTaskAware.java
+++ /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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-/**
- * SetupTaskAware is an interface that tests that can accept injectable setup tasks may implement. Typically this
- * is used by configurable decorator stack to inject setup tasks into tests. It is then up to the test case to run
- * the tasks in the setup or threadSetup methods as it chooses.
- *
- * <p/>Set up tasks should be chained so that they are executed in the order that they are applied. Tear down tasks
- * should be chained so that they are executed in the reverse order to which they are applied. That way the set up and
- * tear down tasks act as a 'task' stack, with nested setups and tear downs.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities.
- * <tr><td> Handle injection of set up tasks.
- * <tr><td> Handle injection of tear down tasks.
- * </table>
- *
- * @author Rupert Smith
- */
-public interface SetupTaskAware
-{
- /**
- * Adds the specified task to the tests setup.
- *
- * @param task The task to add to the tests setup.
- */
- public void chainSetupTask(Runnable task);
-
- /**
- * Adds the specified task to the tests tear down.
- *
- * @param task The task to add to the tests tear down.
- */
- public void chainTearDownTask(Runnable task);
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SetupTaskHandler.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SetupTaskHandler.java
deleted file mode 100644
index b91ce41ad3..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SetupTaskHandler.java
+++ /dev/null
@@ -1,92 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import org.apache.qpid.junit.extensions.util.StackQueue;
-
-import java.util.LinkedList;
-import java.util.Queue;
-
-/**
- * SetupTaskHandler implements a task stack. It can be used, by delegation, as a base implementation for tests that want
- * to have configurable setup/teardown task stacks. Typically it is up to the test implementation to decide whether the
- * stack is executed in the setup/teardown methods or in the threadSetup/threadTeaddown methods.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Handle injection of set up tasks.
- * <tr><td> Handle injection of tear down tasks.
- * <tr><td> Run set up tasks in chain order.
- * <tr><td> Run tear down tasks in reverse chain order.
- * </table>
- *
- * @author Rupert Smith
- */
-public class SetupTaskHandler implements SetupTaskAware
-{
- /** Holds the set up tasks. */
- Queue<Runnable> setups = new LinkedList<Runnable>();
-
- /** Holds the tear down tasks. */
- Queue<Runnable> teardowns = new StackQueue<Runnable>();
-
- /**
- * Adds the specified task to the tests setup.
- *
- * @param task The task to add to the tests setup.
- */
- public void chainSetupTask(Runnable task)
- {
- setups.offer(task);
- }
-
- /**
- * Adds the specified task to the tests tear down.
- *
- * @param task The task to add to the tests tear down.
- */
- public void chainTearDownTask(Runnable task)
- {
- teardowns.offer(task);
- }
-
- /**
- * Runs the set up tasks in the order that they way chained.
- */
- public void runSetupTasks()
- {
- while (!setups.isEmpty())
- {
- setups.remove().run();
- }
- }
-
- /**
- * Runs the tear down tasks in the reverse of the order in which they were chained.
- */
- public void runTearDownTasks()
- {
- while (!teardowns.isEmpty())
- {
- teardowns.remove().run();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ShutdownHookable.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ShutdownHookable.java
deleted file mode 100644
index dc6aa3c291..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/ShutdownHookable.java
+++ /dev/null
@@ -1,42 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-/**
- * Defines an interface that classes which supply shutdown hooks implement. Code that creates these classes can check
- * if they supply a shutdown hook and register these hooks when the obejct are created.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Supply a shutdown hook.
- * </table>
- *
- * @author Rupert Smith
- */
-public interface ShutdownHookable
-{
- /**
- * Supplies the shutdown hook.
- *
- * @return The shut down hook.
- */
- public Thread getShutdownHook();
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SleepThrottle.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SleepThrottle.java
deleted file mode 100644
index 2dc4c0e272..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/SleepThrottle.java
+++ /dev/null
@@ -1,81 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-/**
- * SleepThrottle is a Throttle implementation that generates short pauses using the thread sleep methods. As the pauses
- * get shorter, this technique gets more innacurate. In practice, around 100 Hz is the cap rate for accuracy.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Accept throttling rate in operations per second.
- * <tr><td> Inject short pauses to fill out processing cycles to a specified rate.
- * <tr><td> Check against a throttle speed without waiting.
- * </table>
- *
- * @author Rupert Smith
- */
-public class SleepThrottle extends BaseThrottle implements Throttle
-{
- /** Holds the time of the last call to the throttle method in nano seconds. */
- private long lastTimeNanos;
-
- /**
- * This method can only be called at the rate set by the {@link #setRate} method, if it is called faster than this
- * it will inject short pauses to restrict the call rate to that rate.
- */
- public void throttle()
- {
- // Get the current time in nanos.
- long currentTimeNanos = System.nanoTime();
-
- // Don't introduce any pause on the first call.
- if (!firstCall)
- {
- // Check if there is any time left in the cycle since the last call to this method and introduce a short pause
- // to fill that time if there is.
- long remainingTimeNanos = cycleTimeNanos - (currentTimeNanos - lastTimeNanos);
-
- if (remainingTimeNanos > 0)
- {
- long milliPause = remainingTimeNanos / 1000000;
- int nanoPause = (int) (remainingTimeNanos % 1000000);
-
- try
- {
- Thread.sleep(milliPause, nanoPause);
- }
- catch (InterruptedException e)
- {
- // Restore the interrupted thread, in-case the caller is checking for it.
- Thread.currentThread().interrupt();
- }
- }
- }
- else
- {
- firstCall = false;
- }
-
- // Update the last time stamp.
- lastTimeNanos = System.nanoTime();
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TKTestResult.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TKTestResult.java
deleted file mode 100644
index ae497c671b..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TKTestResult.java
+++ /dev/null
@@ -1,625 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestResult;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.junit.extensions.listeners.TKTestListener;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Properties;
-
-/**
- * TKTestResult extends TestResult in order to calculate test timings, to pass the variable integer parameter for
- * parameterized test cases to those test cases and to introduce an optional delay before test starts. Interested
- * {@link TKTestListener}s may be attached to this and will be informed of all relevant test statistics.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Calculate test timings.
- * <tr><td> Inform timing listeners of timings.
- * <tr><td> Inform memory listeners of memory readings.
- * <tr><td> Inform parameters listeners of parameters.
- * <tr><td> Pass the integer parameter to parameterized test cases.
- * <tr><td> Provide verbose test information on test start and end.
- * </table>
- *
- * @todo Move the verbose test information on test start/end into a test listener instead. It confuses the intention
- * of this class. Could also move the delay into a listener but that seems less appropriate as it would be a
- * side-effecting listener. Delay and timing calculation are fundamental enough to this class.
- *
- * @todo The need for this class to act as a place-holder for the integer parameter for parameterized test cases is
- * because this behaviour has been factored out into a test decorator class, see {@link AsymptoticTestDecorator}.
- * The {@link AsymptoticTestDecorator#run} method takes a TestResult as an argument and cannot easily get to the
- * {@link AsymptoticTestCase} class other than through this class. The option of using this class as a place hold
- * for this value was chosen. Alternatively this class could provide a method for decorators to access the
- * underlying test case through and then leave the setting of this parameter to the decorator which is a more
- * natural home for this behaviour. It would also provide a more general framework for decorators.
- *
- * @todo The memory usage may need to be moved in closer to the test method invocation so that as little code as possible
- * exists between it and the test or the results may be obscured. In fact it certainly does as the teardown method
- * is getting called first. Wouldn't be a bad idea to move the timing code in closer too.
- *
- * @todo Get rid of the delay logic. Will be replaced by throttle control.
- *
- * @author Rupert Smith
- */
-public class TKTestResult extends TestResult
-{
- /** Used for logging. */
- private static final Logger log = Logger.getLogger(TKTestResult.class);
-
- /** The delay between two tests. */
- private int delay = 0;
-
- /**
- * This flag indicates that the #completeTest method of the timing controller has been called. Once this has
- * been called once, the end test event for the whole test method should be ignored because tests have taken
- * charge of outputing their own timings.
- */
- private boolean completeTestUsed = false;
-
- /**
- * Thread locals to hold test start time for non-instrumented tests. (Instrumented tests hold their own
- * measurement data).
- */
- // private Hashtable threadStartTimeMap = new Hashtable();
- private ThreadLocal<ThreadLocalSettings> threadLocals = new ThreadLocal<ThreadLocalSettings>();
-
- /** Used to hold the current integer parameter to pass to parameterized tests. This defaults to 1. */
- private int n = 1;
-
- /** The timing listeners. */
- private Collection<TKTestListener> tkListeners;
-
- /** The test case name. */
- private String testCaseName;
-
- /** Used to hold the current concurrency level, set by the {@link ScaledTestDecorator}. */
- private int concurrencyLevel = 1;
-
- /** Flag used to indicate that this test result should attempt to complete its current tests as soon as possible. */
- private boolean shutdownNow = false;
-
- /** Holds the parametes that the test is run with. */
- private Properties testParameters;
-
- /**
- * Creates a new TKTestResult object.
- *
- * @param delay A delay in milliseconds to introduce before every test start.
- * @param testCaseName The name of the test case that this is the TestResult object for.
- */
- public TKTestResult(int delay, String testCaseName)
- {
- super();
-
- /*log.debug("public TKTestResult(PrintStream writer, int " + delay + ", boolean " + verbose + ", String "
- + testCaseName + "): called");*/
-
- // Keep all the parameters that this is created with.
- this.delay = delay;
- this.testCaseName = testCaseName;
- }
-
- /**
- * Callback method use to inform this test result that a test will be started. Waits for the configured delay time
- * if one has been set, starts the timer, then delegates to the super class implementation.
- *
- * @param test The test to be started.
- */
- public void startTest(Test test)
- {
- // log.debug("public void startTest(Test test): called");
-
- // If a delay time has been specified then wait for that length of time.
- if (this.delay > 0)
- {
- try
- {
- Thread.sleep(delay);
- }
- catch (InterruptedException e)
- {
- // Ignore, but restore the interrupted flag.
- Thread.currentThread().interrupt();
- }
- }
-
- // Create the thread local settings for the test.
- ThreadLocalSettings threadLocalSettings = new ThreadLocalSettings();
- threadLocals.set(threadLocalSettings);
-
- // Record the test start time against this thread for calculating the test timing. (Consider using ThreadLocal
- // instead?)
- Long startTime = System.nanoTime();
- threadLocalSettings.startTime = startTime;
- // log.debug("startTime = " + startTime);
-
- // Check if the test is timing controller aware, in which case set up a new timing controller and hold it
- // in the thread local settings.
- if (test instanceof TimingControllerAware)
- {
- TimingControllerAware controllerAware = (TimingControllerAware) test;
- TimingControllerImpl controller =
- new TimingControllerImpl(this, test, startTime, Thread.currentThread().getId());
- controllerAware.setTimingController(controller);
-
- threadLocalSettings.timingController = controller;
- }
-
- // Delegate to the super method to notify test event listeners.
- super.startTest(test);
- }
-
- /**
- * Callback method use to inform this result that a test was completed. This calculates how long the test took
- * to run, then delegates to the super class implementation.
- *
- * @param test The test that has ended.
- */
- public void endTest(Test test)
- {
- // log.debug("public void endTest(Test test): called");
-
- long runTime = 0;
-
- // Recover the thread local settings.
- ThreadLocalSettings threadLocalSettings = threadLocals.get();
-
- // Check if the test is an instrumented test and get the timing information from the instrumentation as this
- // will be more accurate.
- if (test instanceof InstrumentedTest)
- {
- InstrumentedTest iTest = (InstrumentedTest) test;
-
- // Calculate the test run time.
- runTime = iTest.getTestTime();
- // log.debug("runTime = " + runTime);
-
- // Calculate the test memory usage.
- long startMem = iTest.getTestStartMemory();
- long endMem = iTest.getTestEndMemory();
-
- // log.debug("startMem = " + startMem);
- // log.debug("endMem = " + endMem);
-
- // Inform any memory listeners of the test memory.
- if (tkListeners != null)
- {
- for (TKTestListener memoryListener : tkListeners)
- {
- memoryListener.memoryUsed(test, startMem, endMem, null);
- }
- }
- }
- else
- {
- // Calculate the test run time.
- long endTime = System.nanoTime();
- Long startTime = threadLocalSettings.startTime;
- runTime = endTime - startTime;
- // log.debug("runTime = " + runTime);
-
- threadLocals.remove();
- }
-
- // Output end test stats. This is only done when the tests have not used the timing controller to output
- // mutiple timings.
- if (!completeTestUsed)
- {
- // Check if the test is an asymptotic test case and get its int parameter if so.
- if (test instanceof AsymptoticTestCase)
- {
- AsymptoticTestCase pTest = (AsymptoticTestCase) test;
-
- // Set the parameter.
- int paramValue = pTest.getN();
-
- // Inform any parameter listeners of the test parameter.
- if (tkListeners != null)
- {
- for (TKTestListener parameterListener : tkListeners)
- {
- parameterListener.parameterValue(test, paramValue, null);
- }
- }
- }
-
- // Inform any timing listeners of the test timing and concurrency level.
- if (tkListeners != null)
- {
- for (TKTestListener tkListener : tkListeners)
- {
- TKTestListener next = tkListener;
-
- next.timing(test, runTime, null);
- next.concurrencyLevel(test, concurrencyLevel, null);
- }
- }
-
- // Call the super method to notify test event listeners of the end event.
- super.endTest(test);
- }
- }
-
- /**
- * Gets the integer parameter to pass to parameterized test cases.
- *
- * @return The value of the integer parameter.
- */
- public int getN()
- {
- return n;
- }
-
- /**
- * Sets the integer parameter to pass to parameterized test cases.
- *
- * @param n The new value of the integer parameter.
- */
- public void setN(int n)
- {
- // log.debug("public void setN(int " + n + "): called");
-
- this.n = n;
- }
-
- /**
- * Adds a timing listener to pass all timing events to.
- *
- * @param listener The timing listener to register.
- */
- public void addTKTestListener(TKTestListener listener)
- {
- // Create the collection to hold the timing listeners if it does not already exist.
- if (tkListeners == null)
- {
- tkListeners = new ArrayList<TKTestListener>();
- }
-
- // Keep the new timing listener.
- tkListeners.add(listener);
- }
-
- /**
- * Called by the test runner to notify this that a new test batch is being begun. This method forwards this
- * notification to all batch listeners.
- */
- public void notifyStartBatch()
- {
- if (tkListeners != null)
- {
- for (TKTestListener batchListener : tkListeners)
- {
- batchListener.startBatch();
- }
- }
- }
-
- /**
- * Called by the test runner to notify this that the current test batch has been ended. This method forwards this
- * notification to all batch listener.
- */
- public void notifyEndBatch()
- {
- // log.debug("public void notifyEndBatch(): called");
-
- if (tkListeners != null)
- {
- for (TKTestListener batchListener : tkListeners)
- {
- batchListener.endBatch(testParameters);
- }
- }
- }
-
- /**
- * Called by the test runner to notify this of the properties that the test is using.
- *
- * @param properties The tests set/read properties.
- */
- public void notifyTestProperties(Properties properties)
- {
- // log.debug("public void notifyTestProperties(Properties properties): called");
-
- this.testParameters = properties;
-
- /*
- if (tkListeners != null)
- {
- for (TKTestListener batchListener : tkListeners)
- {
- batchListener.properties(properties);
- }
- }
- */
- }
-
- /**
- * Intercepts the execution of a test case to pass the variable integer parameter to a test if it is a parameterized
- * test case.
- *
- * @param test The test to run.
- */
- protected void run(final TestCase test)
- {
- // log.debug("protected void run(final TestCase test): called");
-
- // Check if the test case is a parameterized test and set its integer parameter if so.
- if (test instanceof AsymptoticTestCase)
- {
- AsymptoticTestCase pTest = (AsymptoticTestCase) test;
-
- // Set up the integer parameter.
- pTest.setN(n);
- }
-
- // Delegate to the super method to run the test.
- super.run(test);
- }
-
- /**
- * Helper method that generats a String of verbose information about a test. This includes the thread name, test
- * class name and test method name.
- *
- * @param test The test to generate the info string for.
- *
- * @return Returns a string with the thread name, test class name and test method name.
- */
- protected String getTestInfo(Test test)
- {
- // log.debug("protected String getTestInfo(Test test): called");
-
- return "[" + Thread.currentThread().getName() + "@" + test.getClass().getName() + "."
- + ((test instanceof TestCase) ? ((TestCase) test).getName() : "") + "]";
- }
-
- /**
- * Sets the concurrency level to pass into the test result.
- *
- * @param concurrencyLevel The concurrency level the tests are running out.
- */
- public void setConcurrencyLevel(int concurrencyLevel)
- {
- this.concurrencyLevel = concurrencyLevel;
- }
-
- /**
- * Tells this test result that it should stop running tests. Once this method has been called this test result
- * will not start any new tests, and any tests that use the timing controller will be passed interrupted exceptions,
- * to indicate that they should end immediately. Usually the caller of this method will introduce a short wait
- * to allow an opporunity for running tests to complete, before forcing the shutdown of the JVM.
- */
- public void shutdownNow()
- {
- log.debug("public void shutdownNow(): called on " + this);
-
- shutdownNow = true;
- }
-
- /**
- * Prints a string summary of this class, mainly for debugging purposes.
- *
- * @return A string summary of this class, mainly for debugging purposes.
- */
- public String toString()
- {
- return "TKTestResult@" + Integer.toString(hashCode(), 16) + ": [ testCaseName = " + testCaseName + ", n = " + n
- + ", tkListeners = " + tkListeners + " ]";
- }
-
- /**
- * Holds things that need to be kept on a per thread basis for each test invocation, such as the test start
- * time and its timing controller.
- */
- private static class ThreadLocalSettings
- {
- /** Holds the test start time. */
- Long startTime;
-
- /** Holds the test threads timing controller. */
- TimingController timingController;
- }
-
- /**
- * Provides an implementation of the {@link TimingController} interface that timing aware tests can use to call
- * back to reset timers, and register additional test timings.
- */
- private static class TimingControllerImpl implements TimingController
- {
- /** Holds an explicit reference to the test TKTestResult that created this. */
- TKTestResult testResult;
-
- /** Holds a reference to the test that this is the timing controller for. */
- Test test;
-
- /** Holds the start time for this timing controller. This gets reset to now on each completed test. */
- long startTime;
-
- /**
- * Holds the thread id of the thread that started the test, so that this controller may be called from other
- * threads but still identify itself correctly to {@link TKTestListener}s as being associated with the
- * thread that called the test method.
- */
- long threadId;
-
- /**
- * Creates a timing controller on a specified TKTestResult and a test.
- *
- * @param testResult The TKTestResult that this controller interacts with.
- * @param test The test that this is the timing controller for.
- * @param startTime The test start time in nanoseconds.
- * @param threadId The thread id of the thread that is calling the test method.
- */
- public TimingControllerImpl(TKTestResult testResult, Test test, long startTime, long threadId)
- {
- this.testResult = testResult;
- this.test = test;
- this.startTime = startTime;
- this.threadId = threadId;
- }
-
- /**
- * Gets the timing controller associated with the current test thread. Tests that use timing controller should
- * always get the timing controller from this method in the same thread that called the setUp, tearDown or test
- * method. The controller returned by this method may be called from any thread because it remembers the thread
- * id of the original test thread.
- *
- * @return The timing controller associated with the current test thread.
- */
- public TimingController getControllerForCurrentThread()
- {
- // Recover the thread local settings and extract the timing controller from them.
- ThreadLocalSettings threadLocalSettings = testResult.threadLocals.get();
-
- return threadLocalSettings.timingController;
- }
-
- /**
- * Not implemented yet.
- *
- * @return Nothing.
- */
- public long suspend()
- {
- throw new RuntimeException("Method not implemented.");
- }
-
- /**
- * Not implemented yet.
- *
- * @return Nothing.
- */
- public long resume()
- {
- throw new RuntimeException("Method not implemented.");
- }
-
- /**
- * Resets the timer start time to now.
- *
- * @return The new value of the start time.
- */
- public long restart()
- {
- startTime = System.nanoTime();
-
- return startTime;
- }
-
- /**
- * Register an additional pass/fail for the current test. The test result is assumed to apply to a test of
- * 'size' parmeter 1. Use the {@link #completeTest(boolean, int)} method to register timings with parameters.
- *
- * @param testPassed Whether or not this timing is for a test pass or fail.
- *
- * @throws InterruptedException If the test runner decides that testing should stop it throws this exception to
- * indicate to the test method that it should stop immediately.
- */
- public void completeTest(boolean testPassed) throws InterruptedException
- {
- completeTest(testPassed, 1);
- }
-
- /**
- * Register an additional pass/fail for the current test. The test result is applies to a test of the specified
- * 'size' parmeter.
- *
- * @param testPassed Whether or not this timing is for a test pass or fail.
- * @param param The test parameter size for parameterized tests.
- *
- * @throws InterruptedException If the test runner decides that testing should stop it throws this exception to
- * indicate to the test method that it should stop immediately.
- */
- public void completeTest(boolean testPassed, int param) throws InterruptedException
- {
- /*log.debug("public long completeTest(boolean testPassed = " + testPassed + ", int param = " + param
- + "): called");*/
-
- // Calculate the test run time.
- long endTime = System.nanoTime();
- long runTime = endTime - startTime;
- // log.debug("runTime = " + runTime);
-
- // Reset the test start time to now, to reset the timer for the next result.
- startTime = endTime;
-
- completeTest(testPassed, param, runTime);
- }
-
- /**
- * Register an additional pass/fail for the current test. The test result is applies to a test of the specified
- * 'size' parmeter and allows the caller to sepecify the timing to log.
- *
- * @param testPassed Whether or not this timing is for a test pass or fail.
- * @param param The test parameter size for parameterized tests.
- * @param timeNanos The time in nano-seconds to log the test result with.
- *
- * @throws InterruptedException If the test runner decides that testing should stop it throws this exception to
- * indicate to the test method that it should stop immediately.
- */
- public void completeTest(boolean testPassed, int param, long timeNanos) throws InterruptedException
- {
- log.debug("public void completeTest(boolean testPassed, int param, long timeNanos): called");
- log.debug("testResult = " + testResult);
-
- // Tell the test result that completeTest has been used, so to not register end test events for the whole
- // test method.
- testResult.completeTestUsed = true;
-
- // Inform any timing listeners of the test timings and parameters and send an end test notification using
- // the thread id of the thread that started the test.
- if (testResult.tkListeners != null)
- {
- for (TKTestListener listener : testResult.tkListeners)
- {
- listener.reset(test, threadId);
- listener.timing(test, timeNanos, threadId);
- listener.parameterValue(test, param, threadId);
- listener.concurrencyLevel(test, testResult.concurrencyLevel, threadId);
-
- if (!testPassed)
- {
- listener.addFailure(test, null, threadId);
- }
-
- listener.endTest(test, threadId);
- }
- }
-
- // log.debug("testResult.shutdownNow = " + testResult.shutdownNow);
-
- // Check if the test runner has been asked to shutdown and raise an interuppted exception if so.
- if (testResult.shutdownNow)
- {
- // log.debug("The shutdown flag is set.");
-
- throw new InterruptedException("Attempting clean shutdown by suspending current test.");
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TKTestRunner.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TKTestRunner.java
deleted file mode 100644
index 671d33feed..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TKTestRunner.java
+++ /dev/null
@@ -1,694 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import junit.framework.Test;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.junit.extensions.listeners.CSVTestListener;
-import org.apache.qpid.junit.extensions.listeners.ConsoleTestListener;
-import org.apache.qpid.junit.extensions.listeners.XMLTestListener;
-import org.apache.qpid.junit.extensions.util.CommandLineParser;
-import org.apache.qpid.junit.extensions.util.MathUtils;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-import java.io.*;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * TKTestRunner extends {@link junit.textui.TestRunner} with the ability to run tests multiple times, to execute a test
- * simultaneously using many threads, to put a delay between test runs and adds support for tests that take integer
- * parameters that can be 'stepped' through on multiple test runs. These features can be accessed by using this class
- * as an entry point and passing command line arguments to specify which features to use:
- *
- * <pre>
- * -w ms The number of milliseconds between invocations of test cases.
- * -c pattern The number of tests to run concurrently.
- * -r num The number of times to repeat each test.
- * -d duration The length of time to run the tests for.
- * -t name The name of the test case to execute.
- * -s pattern The size parameter to run tests with.
- * -o dir The name of the directory to output test timings to.
- * --csv Output test results in CSV format.
- * --xml Output test results in XML format.
- * </pre>
- *
- * <p/>This command line may also have trailing 'name=value' parameters added to it. All of these values are added
- * to the test context properties and passed to the test, which can access them by name.
- *
- * <p/>The pattern arguments are of the form [lowest(: ...)(: highest)](:sample=s)(:exp), where round brackets
- * enclose optional values. Using this pattern form it is possible to specify a single value, a range of values divided
- * into s samples, a range of values divided into s samples but distributed exponentially, or a fixed set of samples.
- *
- * <p/>The duration arguments are of the form (dD)(hH)(mM)(sS), where round brackets enclose optional values. At least
- * one of the optional values must be present.
- *
- * <p/>When specifying optional test parameters on the command line, in 'name=value' format, it is also possible to use
- * the format 'name=[value1:value2:value3:...]', to specify multiple values for a parameter. All permutations of all
- * parameters with multiple values will be created and tested. If the values are numerical, it is also possible to use
- * the sequence generation patterns instead of fully specifying all of the values.
- *
- * <p/>Here are some examples:
- *
- * <p/><table>
- * <tr><td><pre> -c [10:20:30:40:50] </pre><td> Runs the test with 10,20,...,50 threads.
- * <tr><td><pre> -s [1:100]:samples=10 </pre>
- * <td> Runs the test with ten different size parameters evenly spaced between 1 and 100.
- * <tr><td><pre> -s [1:1000000]:samples=10:exp </pre>
- * <td> Runs the test with ten different size parameters exponentially spaced between 1 and 1000000.
- * <tr><td><pre> -r 10 </pre><td> Runs each test ten times.
- * <tr><td><pre> -d 10H </pre><td> Runs the test repeatedly for 10 hours.
- * <tr><td><pre> -d 1M, -r 10 </pre>
- * <td> Runs the test repeatedly for 1 minute but only takes a timing sample every 10 test runs.
- * <tr><td><pre> -r 10, -c [1:5:10:50], -s [100:1000:10000] </pre>
- * <td> Runs 12 test cycles (4 concurrency samples * 3 size sample), with 10 repeats each. In total the test
- * will be run 199 times (3 + 15 + 30 + 150)
- * <tr><td><pre> cache=true </pre><td> Passes the 'cache' parameter with value 'true' to the test.
- * <tr><td><pre> cache=[true:false] </pre><td> Runs the test with the 'cache' parameter set to 'true' and 'false'.
- * <tr><td><pre> cacheSize=[1000:1000000],samples=4,exp </pre>
- * <td> Runs the test with the 'cache' parameter set to a series of exponentially increasing sizes.
- * </table>
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create the test configuration specified by the command line parameters.
- * </table>
- *
- * @todo Verify that the output directory exists or can be created.
- *
- * @todo Verify that the specific named test case to execute exists.
- *
- * @todo Drop the delay parameter as it is being replaced by throttling.
- *
- * @todo Completely replace the test ui test runner, instead of having TKTestRunner inherit from it, its just not
- * good code to extend.
- *
- * @author Rupert Smith
- */
-public class TKTestRunner extends TestRunnerImprovedErrorHandling
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(TKTestRunner.class);
-
- /** Used for displaying information on the console. */
- // private static final Logger console = Logger.getLogger("CONSOLE." + TKTestRunner.class.getName());
-
- /** Used for generating the timestamp when naming output files. */
- protected static final DateFormat TIME_STAMP_FORMAT = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss");
-
- /** Number of times to rerun the test. */
- protected Integer repetitions = 1;
-
- /** The length of time to run the tests for. */
- protected Long duration;
-
- /** Number of threads running the tests. */
- protected int[] threads;
-
- /** Delay in ms to wait between two test cases. */
- protected int delay = 0;
-
- /** The parameter values to pass to parameterized tests. */
- protected int[] params;
-
- /** Name of the single test case to execute. */
- protected String testCaseName = null;
-
- /** Name of the test class. */
- protected String testClassName = null;
-
- /** Name of the test run. */
- protected String testRunName = null;
-
- /** Directory to output XML reports into, if specified. */
- protected String reportDir = null;
-
- /** Flag that indicates the CSV results listener should be used to output results. */
- protected boolean csvResults;
-
- /** Flag that indiciates the XML results listener should be used to output results. */
- protected boolean xmlResults;
-
- /**
- * Holds the name of the class of the test currently being run. Ideally passed into the {@link #createTestResult}
- * method, but as the signature is already fixed for this, the current value gets pushed here as a member variable.
- */
- protected String currentTestClassName;
-
- /** Holds the test results object, which is reponsible for instrumenting tests/threads to record results. */
- protected TKTestResult result;
-
- /** Holds a list of factories for instantiating optional user specified test decorators. */
- protected List<TestDecoratorFactory> decoratorFactories;
-
- /**
- * Constructs a TKTestRunner using System.out for all the output.
- *
- * @param repetitions The number of times to repeat the test, or test batch size.
- * @param duration The length of time to run the tests for. -1 means no duration has been set.
- * @param threads The concurrency levels to ramp up to.
- * @param delay A delay in milliseconds between test runs.
- * @param params The sets of 'size' parameters to pass to test.
- * @param testCaseName The name of the test case to run.
- * @param reportDir The directory to output the test results to.
- * @param runName The name of the test run; used to name the output file.
- * @param csvResults <tt>true</tt> if the CSV results listener should be attached.
- * @param xmlResults <tt>true</tt> if the XML results listener should be attached.
- * @param decoratorFactories List of factories for user specified decorators.
- */
- public TKTestRunner(Integer repetitions, Long duration, int[] threads, int delay, int[] params, String testCaseName,
- String reportDir, String runName, boolean csvResults, boolean xmlResults,
- List<TestDecoratorFactory> decoratorFactories)
- {
- super(new NullResultPrinter(System.out));
-
- log.debug("public TKTestRunner(): called");
-
- // Keep all the test parameters.
- this.repetitions = repetitions;
- this.duration = duration;
- this.threads = threads;
- this.delay = delay;
- this.params = params;
- this.testCaseName = testCaseName;
- this.reportDir = reportDir;
- this.testRunName = runName;
- this.csvResults = csvResults;
- this.xmlResults = xmlResults;
- this.decoratorFactories = decoratorFactories;
- }
-
- /**
- * The entry point for the toolkit test runner.
- *
- * @param args The command line arguments.
- */
- public static void main(String[] args)
- {
- // Use the command line parser to evaluate the command line.
- CommandLineParser commandLine =
- new CommandLineParser(
- new String[][]
- {
- { "w", "The number of milliseconds between invocations of test cases.", "ms", "false" },
- { "c", "The number of tests to run concurrently.", "num", "false", MathUtils.SEQUENCE_REGEXP },
- { "r", "The number of times to repeat each test.", "num", "false" },
- { "d", "The length of time to run the tests for.", "duration", "false", MathUtils.DURATION_REGEXP },
- { "f", "The maximum rate to call the tests at.", "frequency", "false", "^([1-9][0-9]*)/([1-9][0-9]*)$" },
- { "s", "The size parameter to run tests with.", "size", "false", MathUtils.SEQUENCE_REGEXP },
- { "t", "The name of the test case to execute.", "name", "false" },
- { "o", "The name of the directory to output test timings to.", "dir", "false" },
- { "n", "A name for this test run, used to name the output file.", "name", "true" },
- {
- "X:decorators", "A list of additional test decorators to wrap the tests in.",
- "\"class.name[:class.name]*\"", "false"
- },
- { "1", "Test class.", "class", "true" },
- { "-csv", "Output test results in CSV format.", null, "false" },
- { "-xml", "Output test results in XML format.", null, "false" }
- });
-
- // Capture the command line arguments or display errors and correct usage and then exit.
- ParsedProperties options = null;
-
- try
- {
- options = new ParsedProperties(commandLine.parseCommandLine(args));
- }
- catch (IllegalArgumentException e)
- {
- System.out.println(commandLine.getErrors());
- System.out.println(commandLine.getUsage());
- System.exit(FAILURE_EXIT);
- }
-
- // Extract the command line options.
- Integer delay = options.getPropertyAsInteger("w");
- String threadsString = options.getProperty("c");
- Integer repetitions = options.getPropertyAsInteger("r");
- String durationString = options.getProperty("d");
- String paramsString = options.getProperty("s");
- String testCaseName = options.getProperty("t");
- String reportDir = options.getProperty("o");
- String testRunName = options.getProperty("n");
- String decorators = options.getProperty("X:decorators");
- String testClassName = options.getProperty("1");
- boolean csvResults = options.getPropertyAsBoolean("-csv");
- boolean xmlResults = options.getPropertyAsBoolean("-xml");
-
- int[] threads = (threadsString == null) ? null : MathUtils.parseSequence(threadsString);
- int[] params = (paramsString == null) ? null : MathUtils.parseSequence(paramsString);
- Long duration = (durationString == null) ? null : MathUtils.parseDuration(durationString);
-
- // The test run name defaults to the test class name unless a value was specified for it.
- testRunName = (testRunName == null) ? testClassName : testRunName;
-
- // Add all the command line options and trailing settings to test context properties. Tests may pick up
- // overridden values from there, and these values will be logged in the test results, for analysis and
- // to make tests repeatable.
- commandLine.addTrailingPairsToProperties(TestContextProperties.getInstance());
- commandLine.addOptionsToProperties(TestContextProperties.getInstance());
-
- // Create and start the test runner.
- try
- {
- // Create a list of test decorator factories for use specified decorators to be applied.
- List<TestDecoratorFactory> decoratorFactories = parseDecorators(decorators);
-
- TKTestRunner testRunner =
- new TKTestRunner(repetitions, duration, threads, (delay == null) ? 0 : delay, params, testCaseName,
- reportDir, testRunName, csvResults, xmlResults, decoratorFactories);
-
- TestResult testResult = testRunner.start(testClassName);
-
- if (!testResult.wasSuccessful())
- {
- System.exit(FAILURE_EXIT);
- }
- }
- catch (Exception e)
- {
- System.err.println(e.getMessage());
- e.printStackTrace(new PrintStream(System.err));
- System.exit(EXCEPTION_EXIT);
- }
- }
-
- /**
- * Parses a list of test decorators, in the form "class.name[:class.name]*", and creates factories for those
- * TestDecorator classes , and returns a list of the factories. This list of factories will be in the same
- * order as specified in the string. The factories can be used to succesively wrap tests in layers of
- * decorators, as decorators themselves implement the 'Test' interface.
- *
- * <p/>If the string fails to parse, or if any of the decorators specified in it are cannot be loaded, or are not
- * TestDecorators, a runtime exception with a suitable error message will be thrown. The factories themselves
- * throw runtimes if the constructor method calls on the decorators fail.
- *
- * @param decorators The decorators list to be parsed.
- *
- * @return A list of instantiated decorators.
- */
- protected static List<TestDecoratorFactory> parseDecorators(String decorators)
- {
- List<TestDecoratorFactory> result = new LinkedList<TestDecoratorFactory>();
- String toParse = decorators;
-
- // Check that the decorators string is not null or empty, returning an empty list of decorator factories it
- // it is.
- if ((decorators == null) || "".equals(decorators))
- {
- return result;
- }
-
- // Strip any leading and trailing quotes from the string.
- if (toParse.charAt(0) == '\"')
- {
- toParse = toParse.substring(1, toParse.length() - 1);
- }
-
- if (toParse.charAt(toParse.length() - 1) == '\"')
- {
- toParse = toParse.substring(0, toParse.length() - 2);
- }
-
- // Instantiate all decorators.
- for (String decoratorClassName : toParse.split(":"))
- {
- try
- {
- Class decoratorClass = Class.forName(decoratorClassName);
- final Constructor decoratorConstructor = decoratorClass.getConstructor(WrappedSuiteTestDecorator.class);
-
- // Check that the decorator is an instance of WrappedSuiteTestDecorator.
- if (!WrappedSuiteTestDecorator.class.isAssignableFrom(decoratorClass))
- {
- throw new RuntimeException("The decorator class " + decoratorClassName
- + " is not a sub-class of WrappedSuiteTestDecorator, which it needs to be.");
- }
-
- result.add(new TestDecoratorFactory()
- {
- public WrappedSuiteTestDecorator decorateTest(Test test)
- {
- try
- {
- return (WrappedSuiteTestDecorator) decoratorConstructor.newInstance(test);
- }
- catch (InstantiationException e)
- {
- throw new RuntimeException(
- "The decorator class " + decoratorConstructor.getDeclaringClass().getName()
- + " cannot be instantiated.", e);
- }
- catch (IllegalAccessException e)
- {
- throw new RuntimeException(
- "The decorator class " + decoratorConstructor.getDeclaringClass().getName()
- + " does not have a publicly accessable constructor.", e);
- }
- catch (InvocationTargetException e)
- {
- throw new RuntimeException(
- "The decorator class " + decoratorConstructor.getDeclaringClass().getName()
- + " cannot be invoked.", e);
- }
- }
- });
- }
- catch (ClassNotFoundException e)
- {
- throw new RuntimeException("The decorator class " + decoratorClassName + " could not be found.", e);
- }
- catch (NoSuchMethodException e)
- {
- throw new RuntimeException("The decorator class " + decoratorClassName
- + " does not have a constructor that accepts a single 'WrappedSuiteTestDecorator' argument.", e);
- }
- }
-
- return result;
- }
-
- /**
- * TestDecoratorFactory is a factory for creating test decorators from tests.
- */
- protected interface TestDecoratorFactory
- {
- /**
- * Decorates the specified test with a new decorator.
- *
- * @param test The test to decorate.
- *
- * @return The decorated test.
- */
- public WrappedSuiteTestDecorator decorateTest(Test test);
- }
-
- /**
- * Runs a test or suite of tests, using the super class implemenation. This method wraps the test to be run
- * in any test decorators needed to add in the configured toolkits enhanced junit functionality.
- *
- * @param test The test to run.
- * @param wait Undocumented. Nothing in the JUnit javadocs to say what this is for.
- *
- * @return The results of the test run.
- */
- public TestResult doRun(Test test, boolean wait)
- {
- log.debug("public TestResult doRun(Test \"" + test + "\", boolean " + wait + "): called");
-
- // Wrap the tests in decorators for duration, scaling, repetition, parameterization etc.
- WrappedSuiteTestDecorator targetTest = decorateTests(test);
-
- // Delegate to the super method to run the decorated tests.
- log.debug("About to call super.doRun");
-
- TestResult result = super.doRun(targetTest, wait);
- log.debug("super.doRun returned.");
-
- /*if (result instanceof TKTestResult)
- {
- TKTestResult tkResult = (TKTestResult) result;
-
- tkResult.notifyEndBatch();
- }*/
-
- return result;
- }
-
- /**
- * Applies test decorators to the tests for parameterization, duration, scaling and repetition.
- *
- * @param test The test to decorat.
- *
- * @return The decorated test.
- */
- protected WrappedSuiteTestDecorator decorateTests(Test test)
- {
- log.debug("params = " + ((params == null) ? null : MathUtils.printArray(params)));
- log.debug("repetitions = " + repetitions);
- log.debug("threads = " + ((threads == null) ? null : MathUtils.printArray(threads)));
- log.debug("duration = " + duration);
-
- // Wrap all tests in the test suite with WrappedSuiteTestDecorators. This is quite ugly and a bit baffling,
- // but the reason it is done is because the JUnit implementation of TestDecorator has some bugs in it.
- WrappedSuiteTestDecorator targetTest = null;
-
- if (test instanceof TestSuite)
- {
- log.debug("targetTest is a TestSuite");
-
- TestSuite suite = (TestSuite) test;
-
- int numTests = suite.countTestCases();
- log.debug("There are " + numTests + " in the suite.");
-
- for (int i = 0; i < numTests; i++)
- {
- Test nextTest = suite.testAt(i);
- log.debug("suite.testAt(" + i + ") = " + nextTest);
-
- if (nextTest instanceof TimingControllerAware)
- {
- log.debug("nextTest is TimingControllerAware");
- }
-
- if (nextTest instanceof TestThreadAware)
- {
- log.debug("nextTest is TestThreadAware");
- }
- }
-
- targetTest = new WrappedSuiteTestDecorator(suite);
- log.debug("Wrapped with a WrappedSuiteTestDecorator.");
- }
- // If the test has already been wrapped, no need to do it again.
- else if (test instanceof WrappedSuiteTestDecorator)
- {
- targetTest = (WrappedSuiteTestDecorator) test;
- }
-
- // If size parameter values have been set, then wrap the test in an asymptotic test decorator.
- if (params != null)
- {
- targetTest = new AsymptoticTestDecorator(targetTest, params, (repetitions == null) ? 1 : repetitions);
- log.debug("Wrapped with asymptotic test decorator.");
- log.debug("targetTest = " + targetTest);
- }
-
- // If no size parameters are set but the repitions parameter is, then wrap the test in an asymptotic test decorator.
- else if ((repetitions != null) && (repetitions > 1))
- {
- targetTest = new AsymptoticTestDecorator(targetTest, new int[] { 1 }, repetitions);
- log.debug("Wrapped with asymptotic test decorator.");
- log.debug("targetTest = " + targetTest);
- }
-
- // Apply any optional user specified decorators.
- targetTest = applyOptionalUserDecorators(targetTest);
-
- // If a test run duration has been set then wrap the test in a duration test decorator. This will wrap on
- // top of size, repeat or concurrency wrappings already applied.
- if (duration != null)
- {
- DurationTestDecorator durationTest = new DurationTestDecorator(targetTest, duration);
- targetTest = durationTest;
-
- log.debug("Wrapped with duration test decorator.");
- log.debug("targetTest = " + targetTest);
-
- registerShutdownHook(durationTest);
- }
-
- // ParameterVariationTestDecorator...
-
- // If a test thread concurrency level is set then wrap the test in a scaled test decorator. This will wrap on
- // top of size scaling or repetition wrappings.
- ScaledTestDecorator scaledDecorator;
-
- if ((threads != null) && ((threads.length > 1) || (MathUtils.maxInArray(threads) > 1)))
- {
- scaledDecorator = new ScaledTestDecorator(targetTest, threads);
- targetTest = scaledDecorator;
- log.debug("Wrapped with scaled test decorator.");
- log.debug("targetTest = " + targetTest);
- }
- else
- {
- scaledDecorator = new ScaledTestDecorator(targetTest, new int[] { 1 });
- targetTest = scaledDecorator;
- log.debug("Wrapped with scaled test decorator with default of 1 thread.");
- log.debug("targetTest = " + targetTest);
- }
-
- // Register the scaled test decorators shutdown hook.
- registerShutdownHook(scaledDecorator);
-
- return targetTest;
- }
-
- /**
- * If there were any user specified test decorators on the command line, this method instantiates them and wraps
- * the test in them, from inner-most to outer-most in the order in which the decorators were supplied on the
- * command line.
- *
- * @param targetTest The test to wrap.
- *
- * @return A wrapped test.
- */
- protected WrappedSuiteTestDecorator applyOptionalUserDecorators(WrappedSuiteTestDecorator targetTest)
- {
- // If there are user defined test decorators apply them in order now.
- for (TestDecoratorFactory factory : decoratorFactories)
- {
- targetTest = factory.decorateTest(targetTest);
- }
-
- return targetTest;
- }
-
- /**
- * Creates the TestResult object to be used for test runs. See {@link TKTestResult} for more information and the
- * enhanced test result class that this uses.
- *
- * @return An instance of the enhanced test result object, {@link TKTestResult}.
- */
- protected TestResult createTestResult()
- {
- log.debug("protected TestResult createTestResult(): called");
-
- TKTestResult result = new TKTestResult(delay, testCaseName);
-
- // Check if a directory to output reports to has been specified and attach test listeners if so.
- if (reportDir != null)
- {
- // Create the report directory if it does not already exist.
- File reportDirFile = new File(reportDir);
-
- if (!reportDirFile.exists())
- {
- reportDirFile.mkdir();
- }
-
- // Create the results file (make the name of this configurable as a command line parameter).
- Writer timingsWriter;
-
- // Always set up a console feedback listener.
- ConsoleTestListener feedbackListener = new ConsoleTestListener();
- result.addListener(feedbackListener);
- result.addTKTestListener(feedbackListener);
-
- // Set up an XML results listener to output the timings to the results file, if requested on the command line.
- if (xmlResults)
- {
- try
- {
- File timingsFile = new File(reportDirFile, "TEST-" + currentTestClassName + ".xml");
- timingsWriter = new BufferedWriter(new FileWriter(timingsFile), 20000);
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to create the log file to write test results to: " + e, e);
- }
-
- XMLTestListener listener = new XMLTestListener(timingsWriter, currentTestClassName);
- result.addListener(listener);
- result.addTKTestListener(listener);
-
- registerShutdownHook(listener);
- }
-
- // Set up an CSV results listener to output the timings to the results file, if requested on the command line.
- if (csvResults)
- {
- try
- {
- File timingsFile =
- new File(reportDirFile, testRunName + "-" + TIME_STAMP_FORMAT.format(new Date()) + "-timings.csv");
- timingsWriter = new BufferedWriter(new FileWriter(timingsFile), 20000);
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to create the log file to write test results to: " + e, e);
- }
-
- CSVTestListener listener = new CSVTestListener(timingsWriter);
- result.addListener(listener);
- result.addTKTestListener(listener);
-
- // Register the results listeners shutdown hook to flush its data if the test framework is shutdown
- // prematurely.
- registerShutdownHook(listener);
- }
-
- // Register the results listeners shutdown hook to flush its data if the test framework is shutdown
- // prematurely.
- // registerShutdownHook(listener);
-
- // Record the start time of the batch.
- // result.notifyStartBatch();
-
- // At this point in time the test class has been instantiated, giving it an opportunity to read its parameters.
- // Inform any test listers of the test properties.
- result.notifyTestProperties(TestContextProperties.getAccessedProps());
- }
-
- return result;
- }
-
- /**
- * Registers the shutdown hook of a {@link ShutdownHookable}.
- *
- * @param hookable The hookable to register.
- */
- protected void registerShutdownHook(ShutdownHookable hookable)
- {
- Runtime.getRuntime().addShutdownHook(hookable.getShutdownHook());
- }
-
- /**
- * Initializes the test runner with the provided command line arguments and and starts the test run.
- *
- * @param testClassName The fully qualified name of the test class to run.
- *
- * @return The test results.
- *
- * @throws Exception Any exceptions from running the tests are allowed to fall through.
- */
- protected TestResult start(String testClassName) throws Exception
- {
- // Record the current test class, so that the test results can be output to a file incorporating this name.
- this.currentTestClassName = testClassName;
-
- // Delegate to the super method to run the tests.
- return super.start(new String[] { testClassName });
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TestRunnerImprovedErrorHandling.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TestRunnerImprovedErrorHandling.java
deleted file mode 100644
index c68405bd06..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TestRunnerImprovedErrorHandling.java
+++ /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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import junit.framework.Test;
-import junit.framework.TestResult;
-
-import junit.runner.Version;
-
-import junit.textui.ResultPrinter;
-import junit.textui.TestRunner;
-
-import org.apache.log4j.Logger;
-
-import java.io.PrintStream;
-
-/**
- * The {@link junit.textui.TestRunner} does not provide very good error handling. It does not wrap exceptions and
- * does not print out stack traces, losing valuable error tracing information. This class overrides methods in it
- * in order to improve their error handling. The {@link TKTestRunner} is then built on top of this.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * </table>
- *
- * @author Rupert Smith
- */
-public class TestRunnerImprovedErrorHandling extends TestRunner
-{
- /** Used for logging. */
- Logger log = Logger.getLogger(TestRunnerImprovedErrorHandling.class);
-
- /**
- * Delegates to the super constructor.
- */
- public TestRunnerImprovedErrorHandling()
- {
- super();
- }
-
- /**
- * Delegates to the super constructor.
- *
- * @param printStream The location to write test results to.
- */
- public TestRunnerImprovedErrorHandling(PrintStream printStream)
- {
- super(printStream);
- }
-
- /**
- * Delegates to the super constructor.
- *
- * @param resultPrinter The location to write test results to.
- */
- public TestRunnerImprovedErrorHandling(ResultPrinter resultPrinter)
- {
- super(resultPrinter);
- }
-
- /**
- * Starts a test run. Analyzes the command line arguments
- * and runs the given test suite.
- *
- * @param args The command line arguments.
- *
- * @return The test results.
- *
- * @throws Exception Any exceptions falling through the tests are wrapped in Exception and rethrown.
- */
- public TestResult start(String[] args) throws Exception
- {
- String testCase = "";
- boolean wait = false;
-
- for (int i = 0; i < args.length; i++)
- {
- if (args[i].equals("-wait"))
- {
- wait = true;
- }
- else if (args[i].equals("-c"))
- {
- testCase = extractClassName(args[++i]);
- }
- else if (args[i].equals("-v"))
- {
- System.err.println("JUnit " + Version.id() + " by Kent Beck and Erich Gamma");
- }
- else
- {
- testCase = args[i];
- }
- }
-
- if (testCase.equals(""))
- {
- throw new Exception("Usage: TestRunner [-wait] testCaseName, where name is the name of the TestCase class");
- }
-
- try
- {
- Test suite = getTest(testCase);
-
- return doRun(suite, wait);
- }
- catch (Exception e)
- {
- log.warn("Got exception whilst creating and running test suite.", e);
- throw new Exception("Could not create and run the test suite.", e);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TestThreadAware.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TestThreadAware.java
deleted file mode 100644
index d7de2822a2..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TestThreadAware.java
+++ /dev/null
@@ -1,49 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-/**
- * This interface can be implemented by tests that want to know if they are being run concurrently. It provides
- * lifecycle notification events to tell the test implementation when test threads are being created and destroyed.
- * This can assist tests in creating and destroying resources that exist over the life of a test thread. A single
- * test thread can excute the same test many times, and often it is convenient to keep resources, for example network
- * connections, open over many test calls.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Set up per thread test fixtures.
- * <tr><td> Clean up per thread test fixtures.
- * </table>
- *
- * @author Rupert Smith
- */
-public interface TestThreadAware
-{
- /**
- * Called when a test thread is created.
- */
- public void threadSetUp();
-
- /**
- * Called when a test thread is destroyed.
- */
- public void threadTearDown();
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/Throttle.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/Throttle.java
deleted file mode 100644
index 1ea8e8e2be..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/Throttle.java
+++ /dev/null
@@ -1,73 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-/**
- * Throttle is an interface that supplies a {@link #throttle} method, that can only be called at the rate specified
- * in a call to the {@link #setRate} method. This can be used to restict processing to run at a certain number
- * of operations per second.
- *
- * <p/>Throttle also supplies a method to check the throttle rate, without waiting. This could be used to update a user
- * interface every time an event occurs, but only up to a maximum rate. For example, as elements are added to a list,
- * a count of elements is updated for the user to see, but only up to a maximum rate of ten updates a second, as updating
- * faster than that slows the processing of element-by-element additions to the list unnecessarily.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Accept throttling rate in operations per second.
- * <tr><td> Inject short pauses to fill-out processing cycles to a specified rate.
- * <tr><td> Check against a throttle speed without waiting.
- * </table>
- *
- * @author Rupert Smith
- */
-public interface Throttle
-{
- /**
- * Specifies the throttling rate in operations per second. This must be called with with a value, the inverse
- * of which is a measurement in nano seconds, such that the number of nano seconds do not overflow a long integer.
- * The value must also be larger than zero.
- *
- * @param hertz The throttling rate in cycles per second.
- */
- public void setRate(float hertz);
-
- /**
- * This method can only be called at the rate set by the {@link #setRate} method, if it is called faster than this
- * it will inject short pauses to restrict the call rate to that rate.
- *
- * <p/>If the thread executing this method is interrupted, it must ensure that the threads interrupt thread
- * remains set upon exit from the method. This method does not expose InterruptedException, to indicate interruption
- * of the throttle during a timed wait. It may be changed so that it does.
- */
- public void throttle();
-
- /**
- * Checks but does not enforce the throttle rate. When this method is called, it checks if a length of time greater
- * than that equal to the inverse of the throttling rate has passed since it was last called and returned <tt>true</tt>
- *
- * @return <tt>true</tt> if a length of time greater than that equal to the inverse of the throttling rate has
- * passed since this method was last called and returned <tt>true</tt>, <tt>false</tt> otherwise. The very
- * first time this method is called on a throttle, it returns <tt>true</tt> as the base case to the above
- * self-referential definition.
- */
- public boolean checkThrottle();
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TimingController.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TimingController.java
deleted file mode 100644
index b69df84045..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TimingController.java
+++ /dev/null
@@ -1,175 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-/**
- * A TimingController is a interface that a test that is aware of the fact that it is being timed can use to manage
- * the timer. Using this interface tests can suspend and resume test timers. This is usefull if you want to exclude
- * some expensive preparation from being timed as part of a test. In general when timing tests to measure the
- * performance of code, you should try to set up data in the #setUp where possible, or as static members in the test
- * class. This is not always convenient, this interface gives you a way to suspend and resume, or event completely
- * restart test timers, to get accurate measurements.
- *
- * <p/>The interface can also be used to register multiple test pass/fails and timings from a single test method.
- * In some cases it is easier to write tests in this way. For example a concurrent and asynchronous test may make
- * many asynchronous requests and then wait for replies to all its requests. Writing such a test with one send/reply
- * per test method and trying to scale up using many threads will quickly run into limitations if more than about
- * 100 asynchronous calls need to be made at once. A better way to write such a test is as a single method that sends
- * many (perhaps thousands or millions) and waits for replies in two threads, one for send, one for replies. It can
- * then log pass/fails and timings on each individual reply as they come back in, even though the test has been written
- * to send thousands of requests per test method in order to do volume testing.
- *
- * <p/>If when the {@link #completeTest(boolean)} is called, the test runner decides that testing should stop (perhaps
- * because a duration test has expired), it throws an InterruptedException to indicate that the test method should stop
- * immediately. The test method can do this by allowing this exception to fall through, if no other clean-up handling
- * is necessary, or it can simply return as soon as it possibly can. The test runner will still call the tearDown
- * method in the usual way when this happens.
- *
- * <p/>Below are some examples of how this can be used. Not how checking that the timing controller is really available
- * rather than assuming it is, means that the test can run as an ordinary JUnit test under the default test runners. In
- * general code should be written to take advantage of the extended capabilities of junit toolkit, without assuming they
- * are going to be run under its test runner.
- *
- * <pre>
- * public class MyTest extends TestCase implements TimingControllerAware {
- * ...
- *
- * timingUtils = this.getTimingController();
- *
- * // Do expensive data preparation here...
- *
- * if (timingUtils != null)
- * timingUtils.restart();
- * </pre>
- *
- * <pre>
- * public class MyTest extends TestCase implements TimingControllerAware {
- * ...
- *
- * public void myVolumeTest(int size) {
- *
- * timingUtils = this.getTimingController();
- *
- * boolean stopNow = false;
- *
- * // In Sender thread.
- * for(int i = 0; !stopNow && i < size; i++)
- * // Send request i.
- * ...
- *
- * // In Receiver thread.
- * onReceive(Object o) {
- * try {
- * // Check o is as expected.
- * if (....)
- * {
- * if (timingUtils != null)
- * timingUtils.completeTest(true);
- * }
- * else
- * {
- * if (timingUtils != null)
- * timingUtils.completeTest(false);
- * }
- * } catch (InterruptedException e) {
- * stopNow = true;
- * return;
- * }
- * }
- * </pre>
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Allow test timers to be suspended, restarted or reset.
- * <tr><td> Allow tests to register multiple pass/fails and timings.
- * </table>
- *
- * @author Rupert Smith
- */
-public interface TimingController
-{
- /**
- * Gets the timing controller associated with the current test thread. Tests that use timing controller should
- * always get the timing controller from this method in the same thread that called the setUp, tearDown or test
- * method. The controller returned by this method may be called from any thread because it remembers the thread
- * id of the original test thread.
- *
- * @return The timing controller associated with the current test thread.
- */
- public TimingController getControllerForCurrentThread();
-
- /**
- * Suspends the test timer.
- *
- * @return The current time in nanoseconds.
- */
- public long suspend();
-
- /**
- * Allows the test timer to continue running after a suspend.
- *
- * @return The current time in nanoseconds.
- */
- public long resume();
-
- /**
- * Completely restarts the test timer from zero.
- *
- * @return The current time in nanoseconds.
- */
- public long restart();
-
- /**
- * Register an additional pass/fail for the current test. The test result is assumed to apply to a test of
- * 'size' parmeter 1. Use the {@link #completeTest(boolean, int)} method to register timings with parameters.
- *
- * @param testPassed Whether or not this timing is for a test pass or fail.
- *
- * @throws InterruptedException If the test runner decides that testing should stop it throws this exception to
- * indicate to the test method that it should stop immediately.
- */
- public void completeTest(boolean testPassed) throws InterruptedException;
-
- /**
- * Register an additional pass/fail for the current test. The test result is applies to a test of the specified
- * 'size' parmeter.
- *
- * @param testPassed Whether or not this timing is for a test pass or fail.
- * @param param The test parameter size for parameterized tests.
- *
- * @throws InterruptedException If the test runner decides that testing should stop it throws this exception to
- * indicate to the test method that it should stop immediately.
- */
- public void completeTest(boolean testPassed, int param) throws InterruptedException;
-
- /**
- * Register an additional pass/fail for the current test. The test result is applies to a test of the specified
- * 'size' parmeter and allows the caller to sepecify the timing to log.
- *
- * @param testPassed Whether or not this timing is for a test pass or fail.
- * @param param The test parameter size for parameterized tests.
- * @param timeNanos The time in nano seconds to log the test result with.
- *
- * @throws InterruptedException If the test runner decides that testing should stop it throws this exception to
- * indicate to the test method that it should stop immediately.
- */
- public void completeTest(boolean testPassed, int param, long timeNanos) throws InterruptedException;
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TimingControllerAware.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TimingControllerAware.java
deleted file mode 100644
index 11db87e073..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/TimingControllerAware.java
+++ /dev/null
@@ -1,43 +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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-/**
- * TimingControllerAware is an interface that tests that manipulate the timing controller should implement. It enables
- * the TK test runner to set the test up with a handle on the timing controller which the test can use to call back
- * to the test runner to manage the timers.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Provide timing controller insertion point for tests.
- * </table>
- *
- * @author Rupert Smith
- */
-public interface TimingControllerAware
-{
- /**
- * Used by test runners that can supply a {@link TimingController} to set the controller on an aware test.
- *
- * @param controller The timing controller.
- */
- public void setTimingController(TimingController controller);
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/WrappedSuiteTestDecorator.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/WrappedSuiteTestDecorator.java
deleted file mode 100644
index d5690fc24a..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/WrappedSuiteTestDecorator.java
+++ /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.
- *
- */
-package org.apache.qpid.junit.extensions;
-
-import junit.extensions.TestDecorator;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * WrappedSuiteTestDecorator is a test decorator that wraps a test suite, or another wrapped suite, but provides the
- * same functionality for the {@link junit.extensions.TestDecorator#countTestCases()} and {@link TestSuite#testAt(int)}
- * methods as the underlying suite. It returns the values that these methods provide, to enable classes using decorated
- * tests to drill down to the underlying tests in the suite. That is to say that it indexes and reports the number of
- * distinct tests in the suite, not the number of test runs that would result from, for example, wrapping the suite in a
- * repeating decorator.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Provide access to the underlying tests in a suite.
- * </table>
- *
- * @author Rupert Smith
- */
-public class WrappedSuiteTestDecorator extends TestDecorator
-{
- /** Used for logging. */
- private static Logger log = Logger.getLogger(WrappedSuiteTestDecorator.class);
-
- /** Holds the test suite that this supplies access to. */
- protected Test suite;
-
- /**
- * Creates a wrappred suite test decorator from a test suite.
- *
- * @param suite The test suite.
- */
- public WrappedSuiteTestDecorator(TestSuite suite)
- {
- super(suite);
- this.suite = suite;
- }
-
- /**
- * Creates a wrapped suite test decorator from another one.
- *
- * @param suite The test suite.
- */
- public WrappedSuiteTestDecorator(WrappedSuiteTestDecorator suite)
- {
- super(suite);
- this.suite = suite;
- }
-
- /**
- * Returns the test count of the wrapped suite.
- *
- * @return The test count of the wrapped suite.
- */
- public int countTestCases()
- {
- return suite.countTestCases();
- }
-
- /**
- * Gets the ith test from the test suite.
- *
- * @param i The index of the test within the suite to get.
- *
- * @return The test with the specified index.
- */
- public Test testAt(int i)
- {
- log.debug("public Test testAt(int i = " + i + "): called");
-
- if (suite instanceof WrappedSuiteTestDecorator)
- {
- return ((WrappedSuiteTestDecorator) suite).testAt(i);
- }
- else if (suite instanceof TestSuite)
- {
- return ((TestSuite) suite).testAt(i);
- }
-
- // This should never happen.
- return null;
- }
-
- /**
- * Gets all the tests from the underlying test suite.
- *
- * @return All the tests from the underlying test suite.
- */
- public Collection<Test> getAllUnderlyingTests()
- {
- log.debug("public Collection<Test> getAllUnderlyingTests(): called");
-
- List<Test> tests = new ArrayList<Test>();
-
- int numTests = countTestCases();
- log.debug("numTests = " + numTests);
-
- for (int i = 0; i < numTests; i++)
- {
- tests.add(testAt(i));
- }
-
- return tests;
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/CSVTestListener.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/CSVTestListener.java
deleted file mode 100644
index f93212e0c5..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/CSVTestListener.java
+++ /dev/null
@@ -1,532 +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.
- *
- */
-package org.apache.qpid.junit.extensions.listeners;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestListener;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.junit.extensions.ShutdownHookable;
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.TreeSet;
-
-/**
- * CSVTestListener is both a test listener, a timings listener, a memory listener and a parameter listener. It listens for test completion events and
- * then writes out all the data that it has listened to into a '.csv' (comma seperated values) file.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Listen to test events; start, end, fail, error.
- * <tr><td> Listen to test timings.
- * <tr><td> Listen to test memory usage.
- * <tr><td> Listen to parameterized test parameters.
- * <tr><td> Output all test data to a CSV file.
- * </table>
- *
- * @author Rupert Smith
- *
- * @todo Write an XML output class. Write a transform to convert it into an HTML page with timings as graphs.
- */
-public class CSVTestListener implements TestListener, TKTestListener, ShutdownHookable
-{
- /** Used for logging. */
- private static final Logger log = Logger.getLogger(CSVTestListener.class);
-
- /** The timings file writer. */
- private Writer timingsWriter;
-
- /**
- * Map for holding results on a per thread basis as they come in. A ThreadLocal is not used as sometimes an
- * explicit thread id must be used, where notifications come from different threads than the ones that called
- * the test method.
- */
- Map<Long, TestResult> threadLocalResults = Collections.synchronizedMap(new HashMap<Long, TestResult>());
-
- /** Used to record the start time of a complete test run, for outputing statistics at the end of the test run. */
- private long batchStartTime;
-
- /** Used to record the number of errors accross a complete test run. */
- private int numError;
-
- /** Used to record the number of failures accross a complete test run. */
- private int numFailed;
-
- /** Used to record the number of passes accross a complete test run. */
- private int numPassed;
-
- /** Used to record the total tests run accross a complete test run. Always equal to passes + errors + fails. */
- private int totalTests;
-
- /** Used to recrod the current concurrency level for the test batch. */
- private int concurrencyLevel;
-
- /**
- * Used to record the total 'size' of the tests run, this is the number run times the average value of the test
- * size parameters.
- */
- private int totalSize;
-
- /**
- * Used to record the summation of all of the individual test timgings. Note that total time and summed time
- * are unlikely to be in agreement, exception for a single threaded test (with no setup time). Total time is
- * the time taken to run all the tests, summed time is the added up time that each individual test took. So if
- * two tests run in parallel and take one second each, total time will be one seconds, summed time will be two
- * seconds.
- */
- private long summedTime;
-
- /** Flag to indicate when batch has been started but not ended to ensure end batch stats are output only once. */
- private boolean batchStarted = false;
-
- /**
- * Creates a new CSVTestListener object.
- *
- * @param writer A writer where this CSV listener should write out its output to.
- */
- public CSVTestListener(Writer writer)
- {
- // log.debug("public CSVTestListener(Writer writer): called");
-
- // Keep the writer.
- this.timingsWriter = writer;
- }
-
- /**
- * Resets the test results to the default state of time zero, memory usage zero, test passed.
- *
- * @param test The test to resest any results for.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void reset(Test test, Long threadId)
- {
- // log.debug("public void reset(Test test = \"" + test + "\", Long threadId = " + threadId + "): called");
-
- TestResult r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
-
- r.testTime = 0L;
- r.testStartMem = 0L;
- r.testEndMem = 0L;
- r.testState = "Pass";
- r.testParam = 0;
- }
-
- /**
- * Called when a test results in an error.
- *
- * @param test The test which is in error.
- * @param t Any Throwable raised by the test in error.
- */
- public void addError(Test test, Throwable t)
- {
- // log.debug("public void addError(Test test, Throwable t): called");
-
- TestResult r = threadLocalResults.get(Thread.currentThread().getId());
- r.testState = "Error";
- }
-
- /**
- * Called when a test results in a failure.
- *
- * @param test The test which failed.
- * @param t The AssertionFailedError that encapsulates the test failure.
- */
- public void addFailure(Test test, AssertionFailedError t)
- {
- // log.debug("public void addFailure(Test \"" + test + "\", AssertionFailedError t): called");
-
- TestResult r = threadLocalResults.get(Thread.currentThread().getId());
- r.testState = "Failure";
- }
-
- /**
- * Called when a test completes to mark it as a test fail. This method should be used when registering a
- * failure from a different thread than the one that started the test.
- *
- * @param test The test which failed.
- * @param e The assertion that failed the test.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void addFailure(Test test, AssertionFailedError e, Long threadId)
- {
- // log.debug("public void addFailure(Test test = \"" + test + "\", AssertionFailedError e, Long threadId = " + threadId
- // + "): called");
-
- TestResult r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
-
- r.testState = "Failure";
- }
-
- /**
- * Called when a test completes. Success, failure and errors.
- *
- * @param test The test which completed.
- */
- public void endTest(Test test)
- {
- // log.debug("public void endTest(Test \"" + test + "\"): called");
-
- TestResult r = threadLocalResults.get(Thread.currentThread().getId());
-
- writeTestResults(r, test);
-
- // Clear all the test results for the thread.
- threadLocalResults.remove(Thread.currentThread().getId());
- }
-
- /**
- * Called when a test starts.
- *
- * @param test The test wich has started.
- */
- public void startTest(Test test)
- {
- // log.debug("public void startTest(Test \"" + test + "\"): called");
-
- // Initialize the thread local test results.
- threadLocalResults.put(Thread.currentThread().getId(), new TestResult());
- }
-
- /**
- * Should be called every time a test completes with the run time of that test.
- *
- * @param test The name of the test.
- * @param nanos The run time of the test in nanoseconds.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void timing(Test test, long nanos, Long threadId)
- {
- // log.debug("public void timing(String \"" + test + "\", long " + nanos + "): called");
-
- TestResult r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
-
- r.testTime = nanos;
- summedTime += nanos;
- }
-
- /**
- * Should be called every time a test completed with the amount of memory used before and after the test was run.
- *
- * @param test The test which memory was measured for.
- * @param memStart The total JVM memory used before the test was run.
- * @param memEnd The total JVM memory used after the test was run.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void memoryUsed(Test test, long memStart, long memEnd, Long threadId)
- {
- // log.debug("public void memoryUsed(Test \"" + test + "\", long " + memStart + ", long " + memEnd + ", Long "
- // + threadId + "): called");
-
- TestResult r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
-
- r.testStartMem = memStart;
- r.testEndMem = memEnd;
- }
-
- /**
- * Should be called every time a parameterized test completed with the int value of its test parameter.
- *
- * @param test The test which memory was measured for.
- * @param parameter The int parameter value.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void parameterValue(Test test, int parameter, Long threadId)
- {
- // log.debug("public void parameterValue(Test test = \"" + test + "\", int parameter = " + parameter + "): called");
-
- TestResult r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
-
- r.testParam = parameter;
- totalSize += parameter;
- }
-
- /**
- * Should be called every time a test completes with the current number of test threads running. This should not
- * change within a test batch, therefore it is safe to take this as a batch level property value too.
- *
- * @param test The test for which the measurement is being generated.
- * @param threads The number of tests being run concurrently.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void concurrencyLevel(Test test, int threads, Long threadId)
- {
- // log.debug("public void concurrencyLevel(Test test = \"" + test + "\", int threads = " + threads + "): called");
-
- TestResult r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
-
- r.testConcurrency = threads;
- concurrencyLevel = threads;
-
- }
-
- /**
- * Called when a test completes. Success, failure and errors. This method should be used when registering an
- * end test from a different thread than the one that started the test.
- *
- * @param test The test which completed.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void endTest(Test test, Long threadId)
- {
- // log.debug("public void endTest(Test test = \"" + test + "\", Long threadId " + threadId + "): called");
-
- TestResult r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
-
- writeTestResults(r, test);
- }
-
- /**
- * Takes a time stamp for the beginning of the batch and resets stats counted for the batch.
- */
- public synchronized void startBatch()
- {
- numError = 0;
- numFailed = 0;
- numPassed = 0;
- totalTests = 0;
- totalSize = 0;
- batchStartTime = System.nanoTime();
- summedTime = 0;
- batchStarted = true;
-
- // Write out the column headers for the batch.
- writeColumnHeaders();
- }
-
- /**
- * Takes a time stamp for the end of the batch to calculate the total run time.
- * Write this and other stats out to the tail of the csv file.
- *
- * @param parameters The optional test parameters, may be null.
- */
- public synchronized void endBatch(Properties parameters)
- {
- boolean noParams = (parameters == null) || (parameters.size() == 0);
-
- // Check that a batch has been started but not ended.
- if (batchStarted)
- {
- long batchEndTime = System.nanoTime();
- float totalTimeMillis = ((float) (batchEndTime - batchStartTime)) / 1000000f;
- float summedTimeMillis = ((float) summedTime) / 1000000f;
-
- // Write the stats for the batch out.
- try
- {
- synchronized (this.getClass())
- {
- timingsWriter.write("Total Tests:, " + totalTests + ", ");
- timingsWriter.write("Total Passed:, " + numPassed + ", ");
- timingsWriter.write("Total Failed:, " + numFailed + ", ");
- timingsWriter.write("Total Error:, " + numError + ", ");
- timingsWriter.write("Total Size:, " + totalSize + ", ");
- timingsWriter.write("Summed Time:, " + summedTimeMillis + ", ");
- timingsWriter.write("Concurrency Level:, " + concurrencyLevel + ", ");
- timingsWriter.write("Total Time:, " + totalTimeMillis + ", ");
- timingsWriter.write("Test Throughput:, " + (((float) totalTests) / totalTimeMillis) + ", ");
- timingsWriter.write("Test * Size Throughput:, " + (((float) totalSize) / totalTimeMillis)
- + (noParams ? "\n\n" : ", "));
-
- // Write out the test parameters if there are any specified.
- if (!noParams)
- {
- properties(parameters);
- }
-
- timingsWriter.flush();
- }
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to write out end batch statistics: " + e, e);
- }
- }
-
- // Reset the batch started flag to ensure stats are only output once.
- batchStarted = false;
- }
-
- /**
- * Notifies listeners of the tests read/set properties.
- *
- * @param properties The tests read/set properties.
- */
- public void properties(Properties properties)
- {
- // log.debug("public void properties(Properties properties): called");
-
- // Write the properties out to the results file.
- try
- {
- synchronized (this.getClass())
- {
- Set keySet = new TreeSet(properties.keySet());
-
- // timingsWriter.write("\n");
-
- for (Object key : keySet)
- {
- timingsWriter.write(key + " = , " + properties.getProperty((String) key) + ", ");
- }
-
- timingsWriter.write("\n\n");
- // timingsWriter.flush();
- }
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to write out test parameters: " + e, e);
- }
-
- // Write out the column headers after the properties.
- // writeColumnHeaders();
- }
-
- /**
- * Writes out and flushes the column headers for raw test data.
- */
- private void writeColumnHeaders()
- {
- // Write the column headers for the CSV file. Any IO exceptions are ignored.
- try
- {
- timingsWriter.write("Class, ");
- timingsWriter.write("Method, ");
- timingsWriter.write("Thread, ");
- timingsWriter.write("Test Outcome, ");
- timingsWriter.write("Time (milliseconds), ");
- timingsWriter.write("Memory Used (bytes), ");
- timingsWriter.write("Concurrency level, ");
- timingsWriter.write("Test Size\n");
-
- timingsWriter.flush();
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to write out column headers: " + e, e);
- }
- }
-
- /**
- * Writes out the test results for the specified test. This outputs a single line of results to the csv file.
- *
- * @param r The test results to write out.
- * @param test The test to write them out for.
- */
- private void writeTestResults(TestResult r, Test test)
- {
- // Update the running stats for this batch.
- if ("Error".equals(r.testState))
- {
- numError++;
- }
- else if ("Failure".equals(r.testState))
- {
- numFailed++;
- }
- else if ("Pass".equals(r.testState))
- {
- numPassed++;
- }
-
- totalTests++;
-
- // Write the test name and thread information plus all instrumenation a line of the CSV ouput. Any IO
- // exceptions are ignored.
- try
- {
- synchronized (this.getClass())
- {
- timingsWriter.write(test.getClass().getName() + ", ");
- timingsWriter.write(((test instanceof TestCase) ? ((TestCase) test).getName() : "") + ", ");
- timingsWriter.write(Thread.currentThread().getName() + ", ");
- timingsWriter.write(r.testState + ", ");
- timingsWriter.write((((float) r.testTime) / 1000000f) + ", ");
- timingsWriter.write((r.testEndMem - r.testStartMem) + ", ");
- timingsWriter.write(r.testConcurrency + ", ");
- timingsWriter.write(r.testParam + "\n");
- }
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to write out test results: " + e, e);
- }
- }
-
- /**
- * Supplies the shutdown hook. This attempts to flush the results in the event of the test runner being prematurely
- * suspended before the end of the current test batch.
- *
- * @return The shut down hook.
- */
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- log.debug("CSVTestListener::ShutdownHook: called");
-
- // Complete the current test batch stats.
- endBatch(TestContextProperties.getInstance());
- }
- });
- }
-
- /** Captures test results packaged into a single object, so that it can be set up as a thread local. */
- private static class TestResult
- {
- /** Used to hold the test timing. */
- public long testTime;
-
- /** Used to hold the test start memory usage. */
- public long testStartMem;
-
- /** Used to hold the test end memory usage. */
- public long testEndMem;
-
- /** Used to hold the test pass/fail/error state. */
- public String testState = "Pass";
-
- /** Used to hold the test parameter value. */
- public int testParam;
-
- /** Used to hold the concurrency level under which the test was run. */
- public int testConcurrency;
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/ConsoleTestListener.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/ConsoleTestListener.java
deleted file mode 100644
index 2955fba2bd..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/ConsoleTestListener.java
+++ /dev/null
@@ -1,264 +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.
- *
- */
-package org.apache.qpid.junit.extensions.listeners;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-import junit.framework.TestListener;
-
-import org.apache.qpid.junit.extensions.SleepThrottle;
-import org.apache.qpid.junit.extensions.Throttle;
-
-import java.util.Properties;
-
-/**
- * ConsoleTestListener provides feedback to the console, as test timings are taken, by drawing a '.', or an 'E', or an
- * 'F', for each test that passes, is in error or fails. It does this for every test result registered with the framework,
- * not just on the completion of each test method as the JUnit one does. It also uses a throttle to cap the rate of
- * dot drawing, as exessively high rates can degrade test performance without providing much usefull feedback to the user.
- * Unlike the JUnit dot drawing feedback, this one will correctly wrap lines when tests are run concurrently (the
- * rate capping ensures that this does not become a hot-spot for thread contention).
- *
- * <p/>Where rate capping causes the conflation of multiple requested dots into a single dot, the dot that is actually
- * drawn will be the worst result within the conflation period, that is, error is worse than fail which is worse than pass.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Draw dots as each test result completes, at a capped rate.
- * </table>
- *
- * @author Rupert Smith
- */
-public class ConsoleTestListener implements TestListener, TKTestListener
-{
- /** Used to indicate a test pass. */
- private static final int PASS = 1;
-
- /** Used to indicate a test failure. */
- private static final int FAIL = 2;
-
- /** Used to indicate a test error. */
- private static final int ERROR = 3;
-
- /** Defines the maximum number of columns of dots to print. */
- private static final int MAX_COLUMNS = 80;
-
- /** Used to throttle the dot writing rate. */
- Throttle throttle;
-
- /** Tracks the worst test result so far, when the throttled print method must conflate results due to throttling. */
- private int conflatedResult = 0;
-
- /** Tracks the column count as dots are printed, so that newlines can be inserted at the right margin. */
- private int columnCount = 0;
-
- /** Used as a monitor on the print method criticial section, to ensure that line ends always happen in the right place. */
- private final Object printMonitor = new Object();
-
- /**
- * Creates a dot drawing feedback test listener, set by default to 80 columns at 80 dots per second capped rate.
- */
- public ConsoleTestListener()
- {
- throttle = new SleepThrottle();
- throttle.setRate(80f);
- }
-
- /**
- * Prints dots at a capped rate, conflating the requested type of dot to draw if this method is called at a rate
- * higher than the capped rate. The conflation works by always printing the worst result that occurs within the
- * conflation period, that is, error is worse than fail which is worse than a pass.
- *
- * @param result The type of dot to draw, {@link #PASS}, {@link #FAIL} or {@link #ERROR}.
- */
- private void throttledPrint(int result)
- {
- conflatedResult = (result > conflatedResult) ? result : conflatedResult;
-
- if (throttle.checkThrottle())
- {
- synchronized (printMonitor)
- {
- switch (conflatedResult)
- {
- default:
- case PASS:
- System.out.print('.');
- break;
-
- case FAIL:
- System.out.print('F');
- break;
-
- case ERROR:
- System.out.print('E');
- break;
- }
-
- columnCount = (columnCount >= MAX_COLUMNS) ? 0 : (columnCount + 1);
-
- if (columnCount == 0)
- {
- System.out.print('\n');
- }
-
- conflatedResult = 0;
- }
- }
- }
-
- /**
- * An error occurred.
- *
- * @param test The test in error. Ignored.
- * @param t The error that the test threw. Ignored.
- */
- public void addError(Test test, Throwable t)
- {
- throttledPrint(ERROR);
- }
-
- /**
- * A failure occurred.
- *
- * @param test The test that failed. Ignored.
- * @param t The assertion failure that the test threw. Ignored.
- */
- public void addFailure(Test test, AssertionFailedError t)
- {
- throttledPrint(FAIL);
- }
-
- /**
- * A test ended.
- *
- * @param test The test that ended. Ignored.
- */
- public void endTest(Test test)
- {
- throttledPrint(PASS);
- }
-
- /**
- * A test started.
- *
- * @param test The test that started. Ignored.
- */
- public void startTest(Test test)
- { }
-
- /**
- * Resets the test results to the default state of time zero, memory usage zero, parameter zero, test passed.
- *
- * @param test The test to resest any results for.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void reset(Test test, Long threadId)
- { }
-
- /**
- * Should be called every time a test completes with the run time of that test.
- *
- * @param test The name of the test.
- * @param nanos The run time of the test in nanoseconds.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void timing(Test test, long nanos, Long threadId)
- { }
-
- /**
- * Should be called every time a test completed with the amount of memory used before and after the test was run.
- *
- * @param test The test which memory was measured for.
- * @param memStart The total JVM memory used before the test was run.
- * @param memEnd The total JVM memory used after the test was run.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void memoryUsed(Test test, long memStart, long memEnd, Long threadId)
- { }
-
- /**
- * Should be called every time a parameterized test completed with the int value of its test parameter.
- *
- * @param test The test which memory was measured for.
- * @param parameter The int parameter value.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void parameterValue(Test test, int parameter, Long threadId)
- { }
-
- /**
- * Should be called every time a test completes with the current number of test threads running.
- *
- * @param test The test for which the measurement is being generated.
- * @param threads The number of tests being run concurrently.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void concurrencyLevel(Test test, int threads, Long threadId)
- { }
-
- /**
- * Called when a test completes. Success, failure and errors. This method should be used when registering an
- * end test from a different thread than the one that started the test.
- *
- * @param test The test which completed.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void endTest(Test test, Long threadId)
- {
- throttledPrint(PASS);
- }
-
- /**
- * Called when a test completes to mark it as a test fail. This method should be used when registering a
- * failure from a different thread than the one that started the test.
- *
- * @param test The test which failed.
- * @param e The assertion that failed the test.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void addFailure(Test test, AssertionFailedError e, Long threadId)
- {
- throttledPrint(FAIL);
- }
-
- /**
- * Notifies listeners of the start of a complete run of tests.
- */
- public void startBatch()
- { }
-
- /**
- * Notifies listeners of the end of a complete run of tests.
- *
- * @param parameters The optional test parameters to log out with the batch results.
- */
- public void endBatch(Properties parameters)
- { }
-
- /**
- * Notifies listeners of the tests read/set properties.
- *
- * @param properties The tests read/set properties.
- */
- public void properties(Properties properties)
- { }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/TKTestListener.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/TKTestListener.java
deleted file mode 100644
index 11fc6a7451..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/TKTestListener.java
+++ /dev/null
@@ -1,132 +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.
- *
- */
-package org.apache.qpid.junit.extensions.listeners;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-import junit.framework.TestListener;
-
-import java.util.Properties;
-
-/**
- * TKTestListener is a listener interface for listeners that want to be informed of the run times of tests, the memory
- * usage of tests, the 'size' parameters of parameterized tests and the begin and end events of complete test runs.
- * {@link org.apache.qpid.junit.extensions.TKTestResult} is an example of a test result class that listeners
- * interested in these events can be attached to.
- *
- * The {@link #timing(junit.framework.Test, long, Long)}, {@link #memoryUsed(junit.framework.Test, long, long, Long)},
- * {@link #parameterValue(junit.framework.Test, int, Long)} and {@link #endTest(junit.framework.Test, Long)} methods
- * all accept on optional thread id parameter.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Listen to test timings.
- * <tr><td> Listen to test memory usages.
- * <tr><td> Listen to parameterized test parameters.
- * </table>
- *
- * @author Rupert Smith
- */
-public interface TKTestListener extends TestListener
-{
- /**
- * Resets the test results to the default state of time zero, memory usage zero, parameter zero, test passed.
- *
- * @param test The test to resest any results for.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void reset(Test test, Long threadId);
-
- /**
- * Should be called every time a test completes with the run time of that test.
- *
- * @param test The name of the test.
- * @param nanos The run time of the test in nanoseconds.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void timing(Test test, long nanos, Long threadId);
-
- /**
- * Should be called every time a test completed with the amount of memory used before and after the test was run.
- *
- * @param test The test which memory was measured for.
- * @param memStart The total JVM memory used before the test was run.
- * @param memEnd The total JVM memory used after the test was run.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void memoryUsed(Test test, long memStart, long memEnd, Long threadId);
-
- /**
- * Should be called every time a parameterized test completed with the int value of its test parameter.
- *
- * @param test The test which memory was measured for.
- * @param parameter The int parameter value.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void parameterValue(Test test, int parameter, Long threadId);
-
- /**
- * Should be called every time a test completes with the current number of test threads running.
- *
- * @param test The test for which the measurement is being generated.
- * @param threads The number of tests being run concurrently.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void concurrencyLevel(Test test, int threads, Long threadId);
-
- /**
- * Called when a test completes. Success, failure and errors. This method should be used when registering an
- * end test from a different thread than the one that started the test.
- *
- * @param test The test which completed.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void endTest(Test test, Long threadId);
-
- /**
- * Called when a test completes to mark it as a test fail. This method should be used when registering a
- * failure from a different thread than the one that started the test.
- *
- * @param test The test which failed.
- * @param e The assertion that failed the test.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void addFailure(Test test, AssertionFailedError e, Long threadId);
-
- /**
- * Notifies listeners of the start of a complete run of tests.
- */
- public void startBatch();
-
- /**
- * Notifies listeners of the end of a complete run of tests.
- *
- * @param parameters The optional test parameters to log out with the batch results.
- */
- public void endBatch(Properties parameters);
-
- /**
- * Notifies listeners of the tests read/set properties.
- *
- * @param properties The tests read/set properties.
- */
- public void properties(Properties properties);
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/XMLTestListener.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/XMLTestListener.java
deleted file mode 100644
index ded07ef5bb..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/XMLTestListener.java
+++ /dev/null
@@ -1,400 +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.
- *
- */
-package org.apache.qpid.junit.extensions.listeners;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.junit.extensions.ShutdownHookable;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.util.*;
-
-/**
- * Listens for test results for a named test and outputs these in the standard JUnit XML format to the specified
- * writer.
- *
- * <p/>The API for this listener accepts notifications about different aspects of a tests results through different
- * methods, so some assumption needs to be made as to which test result a notification refers to. For example
- * {@link #startTest} will be called, then possibly {@link #timing} will be called, even though the test instance is
- * passed in both cases, it is not enough to distinguish a particular run of the test, as the test case instance may
- * be being shared between multiple threads, or being run a repeated number of times, and can therfore be re-used
- * between calls. The listeners make the assumption that, for every test, a unique thread will call {@link #startTest}
- * and {@link #endTest} to delimit each test. All calls to set test parameters, timings, state and so on, will occur
- * between the start and end and will be given with the same thread id as the start and end, so the thread id provides
- * a unqiue value to identify a particular test run against.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Listen to test lifecycle notifications.
- * <tr><td> Listen to test errors and failures.
- * <tr><td> Listen to test timings.
- * <tr><td> Listen to test memory usages.
- * <tr><td> Listen to parameterized test parameters.
- * <tr><th> Responsibilities
- * </table>
- *
- * @todo Merge this class with CSV test listener, making the collection of results common to both, and only factoring
- * out the results printing code into sub-classes. Provide a simple XML results formatter with the same format as
- * the ant XML formatter, and a more structured one for outputing results with timings and summaries from
- * performance tests.
- *
- * @author Rupert Smith
- */
-public class XMLTestListener implements TKTestListener, ShutdownHookable
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(XMLTestListener.class);
-
- /** The results file writer. */
- protected Writer writer;
-
- /** Holds the results for individual tests. */
- // protected Map<Result, Result> results = new LinkedHashMap<Result, Result>();
- // protected List<Result> results = new ArrayList<Result>();
-
- /**
- * Map for holding results on a per thread basis as they come in. A ThreadLocal is not used as sometimes an
- * explicit thread id must be used, where notifications come from different threads than the ones that called
- * the test method.
- */
- Map<Long, Result> threadLocalResults = Collections.synchronizedMap(new LinkedHashMap<Long, Result>());
-
- /**
- * Holds results for tests that have ended. Transferring these results here from the per-thread results map, means
- * that the thread id is freed for the thread to generate more results.
- */
- List<Result> results = new ArrayList<Result>();
-
- /** Holds the overall error count. */
- protected int errors = 0;
-
- /** Holds the overall failure count. */
- protected int failures = 0;
-
- /** Holds the overall tests run count. */
- protected int runs = 0;
-
- /** Holds the name of the class that tests are being run for. */
- String testClassName;
-
- /**
- * Creates a new XML results output listener that writes to the specified location.
- *
- * @param writer The location to write results to.
- * @param testClassName The name of the test class to include in the test results.
- */
- public XMLTestListener(Writer writer, String testClassName)
- {
- log.debug("public XMLTestListener(Writer writer, String testClassName = " + testClassName + "): called");
-
- this.writer = writer;
- this.testClassName = testClassName;
- }
-
- /**
- * Resets the test results to the default state of time zero, memory usage zero, parameter zero, test passed.
- *
- * @param test The test to resest any results for.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void reset(Test test, Long threadId)
- {
- log.debug("public void reset(Test test = " + test + ", Long threadId = " + threadId + "): called");
-
- XMLTestListener.Result r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
-
- r.error = null;
- r.failure = null;
-
- }
-
- /**
- * Notification that a test started.
- *
- * @param test The test that started.
- */
- public void startTest(Test test)
- {
- log.debug("public void startTest(Test test = " + test + "): called");
-
- Result newResult = new Result(test.getClass().getName(), ((TestCase) test).getName());
-
- // Initialize the thread local test results.
- threadLocalResults.put(Thread.currentThread().getId(), newResult);
- runs++;
- }
-
- /**
- * Should be called every time a test completes with the run time of that test.
- *
- * @param test The name of the test.
- * @param nanos The run time of the test in nanoseconds.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void timing(Test test, long nanos, Long threadId)
- { }
-
- /**
- * Should be called every time a test completed with the amount of memory used before and after the test was run.
- *
- * @param test The test which memory was measured for.
- * @param memStart The total JVM memory used before the test was run.
- * @param memEnd The total JVM memory used after the test was run.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void memoryUsed(Test test, long memStart, long memEnd, Long threadId)
- { }
-
- /**
- * Should be called every time a parameterized test completed with the int value of its test parameter.
- *
- * @param test The test which memory was measured for.
- * @param parameter The int parameter value.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void parameterValue(Test test, int parameter, Long threadId)
- { }
-
- /**
- * Should be called every time a test completes with the current number of test threads running.
- *
- * @param test The test for which the measurement is being generated.
- * @param threads The number of tests being run concurrently.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void concurrencyLevel(Test test, int threads, Long threadId)
- { }
-
- /**
- * Notifies listeners of the tests read/set properties.
- *
- * @param properties The tests read/set properties.
- */
- public void properties(Properties properties)
- { }
-
- /**
- * Notification that a test ended.
- *
- * @param test The test that ended.
- */
- public void endTest(Test test)
- {
- log.debug("public void endTest(Test test = " + test + "): called");
-
- // Move complete test results into the completed tests list.
- Result r = threadLocalResults.get(Thread.currentThread().getId());
- results.add(r);
-
- // Clear all the test results for the thread.
- threadLocalResults.remove(Thread.currentThread().getId());
- }
-
- /**
- * Called when a test completes. Success, failure and errors. This method should be used when registering an
- * end test from a different thread than the one that started the test.
- *
- * @param test The test which completed.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void endTest(Test test, Long threadId)
- {
- log.debug("public void endTest(Test test = " + test + ", Long threadId = " + threadId + "): called");
-
- // Move complete test results into the completed tests list.
- Result r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
- results.add(r);
-
- // Clear all the test results for the thread.
- threadLocalResults.remove(Thread.currentThread().getId());
- }
-
- /**
- * An error occurred.
- *
- * @param test The test in which the error occurred.
- * @param t The throwable that resulted from the error.
- */
- public void addError(Test test, Throwable t)
- {
- log.debug("public void addError(Test test = " + test + ", Throwable t = " + t + "): called");
-
- Result r = threadLocalResults.get(Thread.currentThread().getId());
- r.error = t;
- errors++;
- }
-
- /**
- * A failure occurred.
- *
- * @param test The test in which the failure occurred.
- * @param t The JUnit assertions that led to the failure.
- */
- public void addFailure(Test test, AssertionFailedError t)
- {
- log.debug("public void addFailure(Test test = " + test + ", AssertionFailedError t = " + t + "): called");
-
- Result r = threadLocalResults.get(Thread.currentThread().getId());
- r.failure = t;
- failures++;
- }
-
- /**
- * Called when a test completes to mark it as a test fail. This method should be used when registering a
- * failure from a different thread than the one that started the test.
- *
- * @param test The test which failed.
- * @param e The assertion that failed the test.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void addFailure(Test test, AssertionFailedError e, Long threadId)
- {
- log.debug("public void addFailure(Test test, AssertionFailedError e, Long threadId): called");
-
- Result r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
- r.failure = e;
- failures++;
- }
-
- /**
- * Notifies listeners of the start of a complete run of tests.
- */
- public void startBatch()
- {
- log.debug("public void startBatch(): called");
-
- // Reset all results counts.
- threadLocalResults = Collections.synchronizedMap(new HashMap<Long, Result>());
- errors = 0;
- failures = 0;
- runs = 0;
-
- // Write out the file header.
- try
- {
- writer.write("<?xml version=\"1.0\" ?>\n");
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to write the test results.", e);
- }
- }
-
- /**
- * Notifies listeners of the end of a complete run of tests.
- *
- * @param parameters The optional test parameters to log out with the batch results.
- */
- public void endBatch(Properties parameters)
- {
- log.debug("public void endBatch(Properties parameters = " + parameters + "): called");
-
- // Write out the results.
- try
- {
- // writer.write("<?xml version=\"1.0\" ?>\n");
- writer.write("<testsuite errors=\"" + errors + "\" failures=\"" + failures + "\" tests=\"" + runs + "\" name=\""
- + testClassName + "\">\n");
-
- for (Result result : results)
- {
- writer.write(" <testcase classname=\"" + result.testClass + "\" name=\"" + result.testName + "\">\n");
-
- if (result.error != null)
- {
- writer.write(" <error type=\"" + result.error.getClass() + "\">");
- result.error.printStackTrace(new PrintWriter(writer));
- writer.write(" </error>");
- }
- else if (result.failure != null)
- {
- writer.write(" <failure type=\"" + result.failure.getClass() + "\">");
- result.failure.printStackTrace(new PrintWriter(writer));
- writer.write(" </failure>");
- }
-
- writer.write(" </testcase>\n");
- }
-
- writer.write("</testsuite>\n");
- writer.flush();
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to write the test results.", e);
- }
- }
-
- /**
- * Supplies the shutdown hook.
- *
- * @return The shut down hook.
- */
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- log.debug("XMLTestListener::ShutdownHook: called");
- }
- });
- }
-
- /**
- * Used to capture the results of a particular test run.
- */
- protected static class Result
- {
- /** Holds the name of the test class. */
- public String testClass;
-
- /** Holds the name of the test method. */
- public String testName;
-
- /** Holds the exception that caused error in this test. */
- public Throwable error;
-
- /** Holds the assertion exception that caused failure in this test. */
- public AssertionFailedError failure;
-
- /**
- * Creates a placeholder for the results of a test.
- *
- * @param testClass The test class.
- * @param testName The name of the test that was run.
- */
- public Result(String testClass, String testName)
- {
- this.testClass = testClass;
- this.testName = testName;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/package.html b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/package.html
deleted file mode 100644
index 15acc02ab1..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/listeners/package.html
+++ /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.
-
--->
-
-<html>
-<body>
-Listners for test statistics are defined in this package. At the moment there is only one listener which writes all test
-statistics out to a CSV (comma seperated values) file which can be loaded by most spread sheets.
-</body>
-</html>
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/package.html b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/package.html
deleted file mode 100644
index 4cab8d936a..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/package.html
+++ /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.
-
--->
-
-<html>
-<body>
-Basic JUnit is enahanced with test runners to run tests repeatedly, simultaneously in many threads and with increasing
-test sizes for asymptotic performance measurements. There are features to measure the time and amount of memory that
-tests use as well as to record the asymptotic test size parameters. There are some utilities to write these test
-statistics to various file formats too and these can be found in the listeners package.
-
-</p>The main test runner class is TKTestRunner which can be called with command line parameters to specify how tests
-should be run.
-
-</body>
-</html>
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/CommandLineParser.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/CommandLineParser.java
deleted file mode 100644
index f158090e96..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/CommandLineParser.java
+++ /dev/null
@@ -1,787 +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.
- *
- */
-package org.apache.qpid.junit.extensions.util;
-
-import java.text.CharacterIterator;
-import java.text.StringCharacterIterator;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * CommandLineParser provides a utility for specifying the format of a command line and parsing command lines to ensure
- * that they fit their specified format. A command line is made up of flags and options, both may be refered to as
- * options. A flag is an option that does not take an argument (specifying it means it has the value 'true' and not
- * specifying it means it has the value 'false'). Options must take arguments but they can be set up with defaults so
- * that they take a default value when not set. Options may be mandatory in wich case it is an error not to specify
- * them on the command line. Flags are never mandatory because they are implicitly set to false when not specified.
- *
- * <p/>Some examples command line are:
- *
- * <ul>
- * <li>This one has two options that expect arguments:
- * <pre>
- * cruisecontrol -configfile cruisecontrol.xml -port 9000
- * </pre>
- * <li>This has one no-arg flag and two 'free' arguments:
- * <pre>
- * zip -r project.zip project/*
- * </pre>
- * <li>This one concatenates multiple flags into a single block with only one '-':
- * <pre>
- * jar -tvf mytar.tar
- * </pre>
- *
- * <p/>The parsing rules are:
- *
- * <ol>
- * <li>Flags may be combined after a single '-' because they never take arguments. Normally such flags are single letter
- * flags but this is only a convention and not enforced. Flags of more than one letter are usually specified on their own.
- * <li>Options expecting arguments must always be on their own.
- * <li>The argument to an option may be seperated from it by whitespace or appended directly onto the option.
- * <li>The argument to an option may never begin with a '-' character.
- * <li>All other arguments not beginning with a '-' character are free arguments that do not belong to any option.
- * <li>The second or later of a set of duplicate or repeated flags override earlier ones.
- * <li>Options are matched up to the shortest matching option. This is because of the possibility of having no space
- * between an option and its argument. This rules out the possibility of using two options where one is an opening
- * substring of the other. For example, the options "foo" and "foobar" cannot be used on the same command line because
- * it is not possible to distinguish the argument "-foobar" from being the "foobar" option or the "foo" option with
- * the "bar" argument.
- * </ol>
- *
- * <p/>By default, unknown options are simply ignored if specified on the command line. This behaviour may be changed
- * so that the parser reports all unknowns as errors by using the {@link #setErrorsOnUnknowns} method.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Accept a command line specification.
- * <tr><td> Parse a command line into properties, validating it against its specification.
- * <tr><td> Report all errors between a command line and its specification.
- * <tr><td> Provide a formatted usage string for a command line.
- * <tr><td> Provide a formatted options in force string for a command line.
- * <tr><td> Allow errors on unknowns behaviour to be turned on or off.
- * </table>
- *
- * @author Rupert Smith
- */
-public class CommandLineParser
-{
- /**
- * Holds a mapping from command line option names to detailed information about those options.
- * Use of a tree map ensures that the options are easy to print in alphabetical order as a usage string.
- * An alternative might be to use a LinkedHashMap to print them in the order they are specified.
- */
- private Map<String, CommandLineOption> optionMap = new TreeMap<String, CommandLineOption>();
-
- /** Holds a list of parsing errors. */
- private List<String> parsingErrors = new ArrayList<String>();
-
- /** Holds the regular head matcher to match command line options with. */
- private Matcher optionMatcher = null;
-
- /** Holds the parsed command line properties after parsing. */
- private Properties parsedProperties = null;
-
- /** Holds any trailing name=value pairs specified in the free arguments. */
- private Properties trailingProperties = null;
-
- /** Flag used to indicate that errors should be created for unknown options. False by default. */
- private boolean errorsOnUnknowns = false;
-
- /**
- * Creates a command line options parser from a command line specification. This is passed to this constructor
- * as an array of arrays of strings. Each array of strings specifies the command line for a single option. A static
- * array may therefore easily be used to configure the command line parser in a single method call with an easily
- * readable format.
- *
- * <p/>Each array of strings must be 2, 3, 4 or 5 elements long. If any of the last three elements are missing they
- * are assumed to be null. The elements specify the following parameters:
- * <ol>
- * <li>The name of the option without the leading '-'. For example, "file". To specify the format of the 'free'
- * arguments use the option names "1", "2", ... and so on.
- * <li>The option comment. A line of text describing the usage of the option. For example, "The file to be processed."
- * <li>The options argument. This is a very short description of the argument to the option, often a single word
- * or a reminder as to the arguments format. When this element is null the option is a flag and does not
- * accept any arguments. For example, "filename" or "(unix | windows)" or null. The actual text specified
- * is only used to print in the usage message to remind the user of the usage of the option.
- * <li>The mandatory flag. When set to "true" an option must always be specified. Any other value, including null,
- * means that the option is mandatory. Flags are always mandatory (see class javadoc for explanation of why) so
- * this is ignored for flags.
- * <li>A regular head describing the format that the argument must take. Ignored if null.
- * </ol>
- * <p/>An example call to this constructor is:
- *
- * <pre>
- * CommandLineParser commandLine = new CommandLineParser(
- * new String[][] {{"file", "The file to be processed. ", "filename", "true"},
- * {"dir", "Directory to store results in. Current dir used if not set.", "out dir"},
- * {"os", "Operating system EOL format to use.", "(windows | unix)", null, "windows\|unix"},
- * {"v", "Verbose mode. Prints information about the processing as it goes."},
- * {"1", "The processing command to run.", "command", "true", "add\|remove\|list"}});
- * </pre>
- *
- * @param config The configuration as an array of arrays of strings.
- */
- public CommandLineParser(String[][] config)
- {
- // Loop through all the command line option specifications creating details for each in the options map.
- for (String[] nextOptionSpec : config)
- {
- addOption(nextOptionSpec[0], nextOptionSpec[1], (nextOptionSpec.length > 2) ? nextOptionSpec[2] : null,
- (nextOptionSpec.length > 3) && ("true".equals(nextOptionSpec[3])),
- (nextOptionSpec.length > 4) ? nextOptionSpec[4] : null);
- }
- }
-
- /**
- * Extracts all name=value pairs from the command line, sets them all as system properties and also returns
- * a map of properties containing them.
- *
- * @param args The command line.
- * @param commandLine The command line parser.
- * @param properties The properties object to inject all parsed properties into (optional may be <tt>null</tt>).
- *
- * @return A set of properties containing all name=value pairs from the command line.
- */
- public static Properties processCommandLine(String[] args, CommandLineParser commandLine, Properties properties)
- {
- // Capture the command line arguments or display errors and correct usage and then exit.
- Properties options = null;
-
- try
- {
- options = commandLine.parseCommandLine(args);
-
- // Add all the command line options and trailing settings to properties if the optional properties object
- // to copy them into has been set.
- if (properties != null)
- {
- commandLine.addTrailingPairsToProperties(properties);
- commandLine.addOptionsToProperties(properties);
- }
- }
- catch (IllegalArgumentException e)
- {
- System.out.println(commandLine.getErrors());
- System.out.println(commandLine.getUsage());
- System.exit(1);
- }
-
- return options;
- }
-
- /**
- * Lists all the parsing errors from the most recent parsing in a string.
- *
- * @return All the parsing errors from the most recent parsing.
- */
- public String getErrors()
- {
- // Return the empty string if there are no errors.
- if (parsingErrors.isEmpty())
- {
- return "";
- }
-
- // Concatenate all the parsing errors together.
- String result = "";
-
- for (String s : parsingErrors)
- {
- result += s;
- }
-
- return result;
- }
-
- /**
- * Lists the properties set from the most recent parsing or an empty string if no parsing has been done yet.
- *
- * @return The properties set from the most recent parsing or an empty string if no parsing has been done yet.
- */
- public String getOptionsInForce()
- {
- // Check if there are no properties to report and return and empty string if so.
- if (parsedProperties == null)
- {
- return "";
- }
-
- // List all the properties.
- String result = "Options in force:\n";
-
- for (Map.Entry<Object, Object> property : parsedProperties.entrySet())
- {
- result += property.getKey() + " = " + property.getValue() + "\n";
- }
-
- return result;
- }
-
- /**
- * Generates a usage string consisting of the name of each option and each options argument description and
- * comment.
- *
- * @return A usage string for all the options.
- */
- public String getUsage()
- {
- String result = "Options:\n";
-
- int optionWidth = 0;
- int argumentWidth = 0;
-
- // Calculate the column widths required for aligned layout.
- for (CommandLineOption optionInfo : optionMap.values())
- {
- int oWidth = optionInfo.option.length();
- int aWidth = (optionInfo.argument != null) ? (optionInfo.argument.length()) : 0;
-
- optionWidth = (oWidth > optionWidth) ? oWidth : optionWidth;
- argumentWidth = (aWidth > argumentWidth) ? aWidth : argumentWidth;
- }
-
- // Print usage on each of the command line options.
- for (CommandLineOption optionInfo : optionMap.values())
- {
- String argString = ((optionInfo.argument != null) ? (optionInfo.argument) : "");
- String optionString = optionInfo.option;
-
- argString = rightPad(argString, " ", argumentWidth);
- optionString = rightPad(optionString, " ", optionWidth);
-
- result += "-" + optionString + " " + argString + " " + optionInfo.comment + "\n";
- }
-
- return result;
- }
-
- /**
- * Right pads a string with a given string to a given size. This method will repeat the padder string as many
- * times as is necessary until the exact specified size is reached. If the specified size is less than the size
- * of the original string then the original string is returned unchanged.
- *
- * <pre>
- * Example1 - original string "cat", padder string "white", size 8 gives "catwhite".
- * Example2 - original string "cat", padder string "white", size 15 gives "catwhitewhitewh".
- * Example3 - original string "cat", padder string "white", size 2 gives "cat".
- * </pre>
- *
- * @param stringToPad The original string.
- * @param padder The string to pad onto the original string.
- * @param size The required size of the new string.
- *
- * @return The newly padded string.
- */
- public static String rightPad(String stringToPad, String padder, int size)
- {
- if (padder.length() == 0)
- {
- return stringToPad;
- }
-
- StringBuffer strb = new StringBuffer(stringToPad);
- StringCharacterIterator sci = new StringCharacterIterator(padder);
-
- while (strb.length() < size)
- {
- for (char ch = sci.first(); ch != CharacterIterator.DONE; ch = sci.next())
- {
- if (strb.length() < size)
- {
- strb.append(String.valueOf(ch));
- }
- }
- }
-
- return strb.toString();
- }
-
- /**
- * Control the behaviour of the errors on unkowns reporting. When turned on this reports all unkowns options
- * as errors. When turned off, all unknowns are simply ignored.
- *
- * @param errors The setting of the errors on unkown flag. True to turn it on.
- */
- public void setErrorsOnUnknowns(boolean errors)
- {
- errorsOnUnknowns = errors;
- }
-
- /**
- * Parses a set of command line arguments into a set of properties, keyed by the argument flag. The free arguments
- * are keyed by integers as strings starting at "1" and then "2", ... and so on.
- *
- * <p/>See the class level comment for a description of the parsing rules.
- *
- * @param args The command line arguments.
- *
- * @return The arguments as a set of properties.
- *
- * @throws IllegalArgumentException If the command line cannot be parsed against its specification. If this exception
- * is thrown a call to {@link #getErrors} will provide a diagnostic of the command
- * line errors.
- */
- public Properties parseCommandLine(String[] args) throws IllegalArgumentException
- {
- Properties options = new Properties();
-
- // Used to keep count of the current 'free' argument.
- int free = 1;
-
- // Used to indicate that the most recently parsed option is expecting arguments.
- boolean expectingArgs = false;
-
- // The option that is expecting arguments from the next element of the command line.
- String optionExpectingArgs = null;
-
- // Used to indicate that the most recently parsed option is a duplicate and should be ignored.
- // boolean ignore = false;
-
- // Create the regular head matcher for the command line options.
- String regexp = "^(";
- int optionsAdded = 0;
-
- for (Iterator<String> i = optionMap.keySet().iterator(); i.hasNext();)
- {
- String nextOption = i.next();
-
- // Check that the option is not a free argument definition.
- boolean notFree = false;
-
- try
- {
- Integer.parseInt(nextOption);
- }
- catch (NumberFormatException e)
- {
- notFree = true;
- }
-
- // Add the option to the regular head matcher if it is not a free argument definition.
- if (notFree)
- {
- regexp += nextOption + (i.hasNext() ? "|" : "");
- optionsAdded++;
- }
- }
-
- // There has to be more that one option in the regular head or else the compiler complains that the close
- // cannot be nullable if the '?' token is used to make the matched option string optional.
- regexp += ")" + ((optionsAdded > 0) ? "?" : "") + "(.*)";
- Pattern pattern = Pattern.compile(regexp);
-
- // Loop through all the command line arguments.
- for (String arg1 : args)
- {
- // Check if the next command line argument begins with a '-' character and is therefore the start of
- // an option.
- if (arg1.startsWith("-"))
- {
- // Extract the value of the option without the leading '-'.
- String arg = arg1.substring(1);
-
- // Match up to the longest matching option.
- optionMatcher = pattern.matcher(arg);
- optionMatcher.matches();
-
- String matchedOption = optionMatcher.group(1);
-
- // Match any argument directly appended onto the longest matching option.
- String matchedArg = optionMatcher.group(2);
-
- // Check that a known option was matched.
- if ((matchedOption != null) && !"".equals(matchedOption))
- {
- // Get the command line option information for the matched option.
- CommandLineOption optionInfo = optionMap.get(matchedOption);
-
- // Check if this option is expecting arguments.
- if (optionInfo.expectsArgs)
- {
- // The option is expecting arguments so swallow the next command line argument as an
- // argument to this option.
- expectingArgs = true;
- optionExpectingArgs = matchedOption;
-
- // In the mean time set this options argument to the empty string in case no argument is ever
- // supplied.
- // options.put(matchedOption, "");
- }
-
- // Check if the option was matched on its own and is a flag in which case set that flag.
- if ("".equals(matchedArg) && !optionInfo.expectsArgs)
- {
- options.put(matchedOption, "true");
- }
- // The option was matched as a substring with its argument appended to it or is a flag that is
- // condensed together with other flags.
- else if (!"".equals(matchedArg))
- {
- // Check if the option is a flag and therefore is allowed to be condensed together
- // with other flags.
- if (!optionInfo.expectsArgs)
- {
- // Set the first matched flag.
- options.put(matchedOption, "true");
-
- // Repeat the longest matching process on the remainder but ensure that the remainder
- // consists only of flags as only flags may be condensed together in this fashion.
- do
- {
- // Match the remainder against the options.
- optionMatcher = pattern.matcher(matchedArg);
- optionMatcher.matches();
-
- matchedOption = optionMatcher.group(1);
- matchedArg = optionMatcher.group(2);
-
- // Check that an option was matched.
- if (matchedOption != null)
- {
- // Get the command line option information for the next matched option.
- optionInfo = optionMap.get(matchedOption);
-
- // Ensure that the next option is a flag or raise an error if not.
- if (optionInfo.expectsArgs)
- {
- parsingErrors.add("Option " + matchedOption + " cannot be combined with flags.\n");
- }
-
- options.put(matchedOption, "true");
- }
- // The remainder could not be matched against a flag it is either an unknown flag
- // or an illegal argument to a flag.
- else
- {
- parsingErrors.add("Illegal argument to a flag in the option " + arg + "\n");
-
- break;
- }
- }
- // Continue until the remainder of the argument has all been matched with flags.
- while (!"".equals(matchedArg));
- }
- // The option is expecting an argument, so store the unmatched portion against it
- // as its argument.
- else
- {
- // Check the arguments format is correct against any specified format.
- checkArgumentFormat(optionInfo, matchedArg);
-
- // Store the argument against its option (regardless of its format).
- options.put(matchedOption, matchedArg);
-
- // The argument to this flag has already been supplied to it. Do not swallow the
- // next command line argument as an argument to this flag.
- expectingArgs = false;
- }
- }
- }
- else // No matching option was found.
- {
- // Add this to the list of parsing errors if errors on unkowns is being used.
- if (errorsOnUnknowns)
- {
- parsingErrors.add("Option " + matchedOption + " is not a recognized option.\n");
- }
- }
- }
- // The command line argument did not being with a '-' so it is an argument to the previous flag or it
- // is a free argument.
- else
- {
- // Check if a previous flag is expecting to swallow this next argument as its argument.
- if (expectingArgs)
- {
- // Get the option info for the option waiting for arguments.
- CommandLineOption optionInfo = optionMap.get(optionExpectingArgs);
-
- // Check the arguments format is correct against any specified format.
- checkArgumentFormat(optionInfo, arg1);
-
- // Store the argument against its option (regardless of its format).
- options.put(optionExpectingArgs, arg1);
-
- // Clear the expecting args flag now that the argument has been swallowed.
- expectingArgs = false;
- optionExpectingArgs = null;
- }
- // This command line option is not an argument to any option. Add it to the set of 'free' options.
- else
- {
- // Get the option info for the free option, if there is any.
- CommandLineOption optionInfo = optionMap.get(Integer.toString(free));
-
- if (optionInfo != null)
- {
- // Check the arguments format is correct against any specified format.
- checkArgumentFormat(optionInfo, arg1);
- }
-
- // Add to the list of free options.
- options.put(Integer.toString(free), arg1);
-
- // Move on to the next free argument.
- free++;
- }
- }
- }
-
- // Scan through all the specified options to check that all mandatory options have been set and that all flags
- // that were not set are set to false in the set of properties.
- for (CommandLineOption optionInfo : optionMap.values())
- {
- // Check if this is a flag.
- if (!optionInfo.expectsArgs)
- {
- // Check if the flag is not set in the properties and set it to false if so.
- if (!options.containsKey(optionInfo.option))
- {
- options.put(optionInfo.option, "false");
- }
- }
- // Check if this is a mandatory option and was not set.
- else if (optionInfo.mandatory && !options.containsKey(optionInfo.option))
- {
- // Create an error for the missing option.
- parsingErrors.add("Option " + optionInfo.option + " is mandatory but not was not specified.\n");
- }
- }
-
- // Check if there were any errors.
- if (!parsingErrors.isEmpty())
- {
- // Throw an illegal argument exception to signify that there were parsing errors.
- throw new IllegalArgumentException();
- }
-
- // Convert any name/value pairs in the free arguments into properties in the parsed options.
- trailingProperties = takeFreeArgsAsProperties(options, 1);
-
- parsedProperties = options;
-
- return options;
- }
-
- /**
- * If a command line has been parsed, calling this method sets all of its free arguments that were name=value pairs
- * on the specified properties.
- *
- * @param properties The property set to add the name=value pairs to.
- */
- public void addTrailingPairsToProperties(Properties properties)
- {
- if (trailingProperties != null)
- {
- for (Object propKey : trailingProperties.keySet())
- {
- String name = (String) propKey;
- String value = trailingProperties.getProperty(name);
-
- properties.setProperty(name, value);
- }
- }
- }
-
- /**
- * If a command line has been parsed, calling this method sets all of its options that were set to the specified
- * properties.
- *
- * @param properties The property set to the options to.
- */
- public void addOptionsToProperties(Properties properties)
- {
- if (parsedProperties != null)
- {
- for (Object propKey : parsedProperties.keySet())
- {
- String name = (String) propKey;
- String value = parsedProperties.getProperty(name);
-
- // This filters out all trailing items.
- if (!name.matches("^[0-9]+$"))
- {
- properties.setProperty(name, value);
- }
- }
- }
- }
-
- /**
- * Resets this command line parser after it has been used to parse a command line. This method will only need
- * to be called to use this parser a second time which is not likely seeing as a command line is usually only
- * specified once. However, it is exposed as a public method for the rare case where this may be done.
- *
- * <p/>Cleans the internal state of this parser, removing all stored errors and information about the options in
- * force.
- */
- public void reset()
- {
- parsingErrors = new ArrayList<String>();
- parsedProperties = null;
- }
-
- /**
- * Adds the option to list of available command line options.
- *
- * @param option The option to add as an available command line option.
- * @param comment A comment for the option.
- * @param argument The text that appears after the option in the usage string.
- * @param mandatory When true, indicates that this option is mandatory.
- * @param formatRegexp The format that the argument must take, defined as a regular head.
- */
- protected void addOption(String option, String comment, String argument, boolean mandatory, String formatRegexp)
- {
- // Check if usage text has been set in which case this option is expecting arguments.
- boolean expectsArgs = (!((argument == null) || argument.equals("")));
-
- // Add the option to the map of command line options.
- CommandLineOption opt = new CommandLineOption(option, expectsArgs, comment, argument, mandatory, formatRegexp);
- optionMap.put(option, opt);
- }
-
- /**
- * Converts the free arguments into property declarations. After parsing the command line the free arguments
- * are numbered from 1, such that the parsed properties contain values for the keys "1", "2", ... This method
- * converts any free arguments declared using the 'name=value' syntax into properties with key 'name', value
- * 'value'.
- *
- * <p/>For example the comand line:
- * <pre>
- * ... debug=true
- * </pre>
- *
- * <p/>After parsing has properties:
- * <pre>[[1, debug=true]]</pre>
- *
- * <p/>After applying this method the properties are:
- * <pre>[[1, debug=true], [debug, true]]</pre>
- *
- * @param properties The parsed command line properties.
- * @param from The free argument index to convert to properties from.
- *
- * @return The parsed command line properties, with free argument name value pairs too.
- */
- private Properties takeFreeArgsAsProperties(Properties properties, int from)
- {
- Properties result = new Properties();
-
- for (int i = from; true; i++)
- {
- String nextFreeArg = properties.getProperty(Integer.toString(i));
-
- // Terminate the loop once all free arguments have been consumed.
- if (nextFreeArg == null)
- {
- break;
- }
-
- // Split it on the =, strip any whitespace and set it as a system property.
- String[] nameValuePair = nextFreeArg.split("=");
-
- if (nameValuePair.length == 2)
- {
- result.setProperty(nameValuePair[0], nameValuePair[1]);
- }
- }
-
- return result;
- }
-
- /**
- * Checks the format of an argument to an option against its specified regular head format if one has
- * been set. Any errors are added to the list of parsing errors.
- *
- * @param optionInfo The command line option information for the option which is havings its argument checked.
- * @param matchedArg The string argument to the option.
- */
- private void checkArgumentFormat(CommandLineOption optionInfo, String matchedArg)
- {
- // Check if this option enforces a format for its argument.
- if (optionInfo.argumentFormatRegexp != null)
- {
- Pattern pattern = Pattern.compile(optionInfo.argumentFormatRegexp);
- Matcher argumentMatcher = pattern.matcher(matchedArg);
-
- // Check if the argument does not meet its required format.
- if (!argumentMatcher.matches())
- {
- // Create an error for this badly formed argument.
- parsingErrors.add("The argument to option " + optionInfo.option + " does not meet its required format.\n");
- }
- }
- }
-
- /**
- * Holds information about a command line options. This includes what its name is, whether or not it is a flag,
- * whether or not it is mandatory, what its user comment is, what its argument reminder text is and what its
- * regular head format is.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Hold details of a command line option.
- * </table>
- *
- * @author Rupert Smith
- */
- protected class CommandLineOption
- {
- /** Holds the text for the flag to match this argument with. */
- public String option = null;
-
- /** Holds a string describing how to use this command line argument. */
- public String argument = null;
-
- /** Flag that determines whether or not this command line argument can take arguments. */
- public boolean expectsArgs = false;
-
- /** Holds a short comment describing what this command line argument is for. */
- public String comment = null;
-
- /** Flag that determines whether or not this is an mandatory command line argument. */
- public boolean mandatory = false;
-
- /** A regular head describing what format the argument to this option muist have. */
- public String argumentFormatRegexp = null;
-
- /**
- * Create a command line option object that holds specific information about a command line option.
- *
- * @param option The text that matches the option.
- * @param expectsArgs Whether or not the option expects arguments. It is a flag if this is false.
- * @param comment A comment explaining how to use this option.
- * @param argument A short reminder of the format of the argument to this option/
- * @param mandatory Set to true if this option is mandatory.
- * @param formatRegexp The regular head that the argument to this option must meet to be valid.
- */
- public CommandLineOption(String option, boolean expectsArgs, String comment, String argument, boolean mandatory,
- String formatRegexp)
- {
- this.option = option;
- this.expectsArgs = expectsArgs;
- this.comment = comment;
- this.argument = argument;
- this.mandatory = mandatory;
- this.argumentFormatRegexp = formatRegexp;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/ContextualProperties.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/ContextualProperties.java
deleted file mode 100644
index 14de96d165..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/ContextualProperties.java
+++ /dev/null
@@ -1,494 +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.
- *
- */
-package org.apache.qpid.junit.extensions.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * ContextualProperties is an extension of {@link java.util.Properties} that automatically selects properties based on an
- * environment parameter (defined by the system property {@link #ENV_SYS_PROPERTY}), the name of a class, plus a modifier
- * (which can be used to name a method of a class) and a property key. It also supports the definition of arrays of
- * property values using indexes. The properties are searched in the following order until a match is found:
- *
- * <ol>
- * <li>environment + class name with package name + modifier + key
- * <li>environment + class name with package name + key
- * <li>environment + key
- * <li>class name with package name + modifier + key
- * <li>class name with package name + key
- * <li>key
- * </ol>
- *
- * <p>To create arrays of property values add index numbers onto the end of the property keys. An array of string values
- * will be created with the elements of the array set to the value of the property at the matching index. Ideally the
- * index values will be contiguous, starting at 0. This does not need to be the case however. If an array definition
- * begins at index n, and ends at index m, Then an array big enough to hold m + 1 elements will be created and populated
- * with values from n to m. Values before n and any missing values between n and m will be null in the array.
- *
- * <p>To give an example, suppose you have two different environments 'DEVELOPMENT' and 'PRODUCTION' and they each need
- * the same properties but set to different values for each environment and some properties the same in both, you could
- * create a properties file like:
- *
- * <p><code>
- * # Project configuration properties file.<br/>
- * <br/>
- * # These properties are environment specific.<br/>
- * DEVELOPMENT.debug=true<br/>
- * PRODUCTION.debug=false<br/>
- * <br/>
- * # Always debug MyClass in all environments but not the myMethod method.<br/>
- * MyClass.debug=true<br/>
- * MyClass.myMethod.debug=false<br/>
- * <br/>
- * # Set up an array of my ten favourite animals. Leave elements 3 to 8 as null as I haven't decided on them yet.<br/>
- * animals.0=cat<br/>
- * animals.1=dog<br/>
- * animals.2=elephant<br/>
- * animals.9=lion<br/>
- * <br/>
- * # This is a default value that will be used when the environment is not known.<br/>
- * debug=false<br/>
- * </code>
- *
- * <p>The most specific definition of a property is searched for first moving out to the most general. This allows
- * general property defaults to be set and then overiden for specific uses by some classes and modifiers.
- *
- * <p>A ContextualProperties object can be loaded in the same way as a java.utils.Properties. A recommended way to do
- * this that does not assume that the properties file is a file (it could be in a jar) is to load the properties from the
- * url for the resource lookup up on the classpath:
- *
- * <p><code>
- * Properties configProperties = new ContextualProperties();<br/>
- * configProperties.load(this.getClass().getClassLoader().getResourceAsStream("config.properties"));<br/>
- * </code>
- *
- * <p>EnvironmentProperties will load the 'DEVELOPMENT.debug' property or 'PROUCTION.debug' property based on the setting
- * of the system environment property. If a matching property for the environment cannot be found then the simple property
- * name without the environment pre-pended onto it will be used instead. This 'use of default environments' behaviour is
- * turned on initially but it can be disabled by calling the {@link #useDefaultEnvironments} method.
- *
- * <p>When a property matching a key cannot be found then the property accessor methods will always return null. If a
- * default value for a property exists but the 'use of default environments' behavious prevents it being used then the
- * accessor methods will return null.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Automatically select properties dependant on environment, class name and modifier as well as property key.
- * <tr><td> Convert indexed properties into arrays.
- * </table>
- *
- * @author Rupert Smith
- */
-public class ContextualProperties extends ParsedProperties
-{
- /** The name of the system property that is used to define the environment. */
- public static final String ENV_SYS_PROPERTY = "environment";
-
- /**
- * <p>Holds the iteration count down order.
- *
- * <p>If e = 4, b = 2, m = 1 then the iteration order or i is 7,6,4 and then if using environment defaults 3,2,0
- * where the accessor key is:
- * (i & e != 0 ? environment : "") + (i & b != 0 ? base : "") + (1 + m != 0 ? modifier : "") + key
- *
- * <p>In other words the presence or otherwise of the three least significant bits when counting down from 7
- * specifies which of the environment, base and modifier are to be included in the key where the environment, base
- * and modifier stand for the bits in positions 2, 1 and 0. The numbers 5 and 1 are missed out of the count because
- * they stand for the case where the modifier is used without the base which is not done.
- */
- private static final int[] ORDER = new int[] { 7, 6, 4, 3, 2, 0 };
-
- /**
- * Defines the point in the iteration count order below which the 'use environment defaults' feature is being used.
- */
- private static final int ENVIRONMENT_DEFAULTS_CUTOFF = 4;
-
- /** Defines the bit representation for the environment in the key ordering. See {@link #ORDER}. */
- private static final int E = 4;
-
- /** Defines the bit representation for the base in the key ordering. See {@link #ORDER}. */
- private static final int B = 2;
-
- /** Defines the bit representation for the modifier in the key ordering. See {@link #ORDER}. */
- private static final int M = 1;
-
- /** Used to hold the value of the environment system property. */
- private String environment;
-
- /** Used to indicate that the 'use of defaults' behaviour should be used. */
- private boolean useDefaults = true;
-
- /** Used to hold all the array properties. This is a mapping from property names to ArrayLists of Strings. */
- protected Map arrayProperties = new HashMap();
-
- /**
- * Default constructor that builds a ContextualProperties that uses environment defaults.
- */
- public ContextualProperties()
- {
- super();
-
- // Keep the value of the system environment property.
- environment = System.getProperty(ENV_SYS_PROPERTY);
- }
-
- /**
- * Creates a ContextualProperties that uses environment defaults and is initialized with the specified properties.
- *
- * @param props The properties to initialize this with.
- */
- public ContextualProperties(Properties props)
- {
- super(props);
-
- // Keep the value of the system environment property.
- environment = System.getProperty(ENV_SYS_PROPERTY);
-
- // Extract any array properties as arrays.
- createArrayProperties();
- }
-
- /**
- * Parses an input stream as properties.
- *
- * @param inStream The input stream to read the properties from.
- *
- * @exception IOException If there is an IO error during reading from the input stream.
- */
- public void load(InputStream inStream) throws IOException
- {
- super.load(inStream);
-
- // Extract any array properties as arrays.
- createArrayProperties();
- }
-
- /**
- * Tells this environment aware properties object whether it should use default environment properties without a
- * pre-pended environment when a property for the current environment cannot be found.
- *
- * @param flag True to use defaults, false to not use defaults.
- */
- public void useDefaultEnvironments(boolean flag)
- {
- useDefaults = flag;
- }
-
- /**
- * Looks up a property value relative to the environment, callers class and method. The default environment will be
- * checked for a matching property if defaults are being used. In order to work out the callers class and method this
- * method throws an exception and then searches one level up its stack frames.
- *
- * @param key The property key.
- *
- * @return The value of this property searching from the most specific definition (environment, class, method, key)
- * to the most general (key only), unless use of default environments is turned off in which case the most general
- * proeprty searched is (environment, key).
- */
- public String getProperty(String key)
- {
- // Try to get the callers class name and method name by examing the stack.
- String className = null;
- String methodName = null;
-
- // Java 1.4 onwards only.
- /*try
- {
- throw new Exception();
- }
- catch (Exception e)
- {
- StackTraceElement[] stack = e.getStackTrace();
-
- // Check that the stack trace contains at least two elements, one for this method and one for the caller.
- if (stack.length >= 2)
- {
- className = stack[1].getClassName();
- methodName = stack[1].getMethodName();
- }
- }*/
-
- // Java 1.5 onwards only.
- StackTraceElement[] stack = Thread.currentThread().getStackTrace();
-
- // Check that the stack trace contains at least two elements, one for this method and one for the caller.
- if (stack.length >= 2)
- {
- className = stack[1].getClassName();
- methodName = stack[1].getMethodName();
- }
-
- // Java 1.3 and before? Not sure, some horrible thing that parses the text spat out by printStackTrace?
-
- return getProperty(className, methodName, key);
- }
-
- /**
- * Looks up a property value relative to the environment, base class and modifier. The default environment will be
- * checked for a matching property if defaults are being used.
- *
- * @param base An object of the class to retrieve properties relative to.
- * @param modifier The modifier (which may stand for a method of the class).
- * @param key The property key.
- *
- * @return The value of this property searching from the most specific definition (environment, class, modifier, key)
- * to the most general (key only), unless use of default environments is turned off in which case the most general
- * property searched is (environment, key).
- */
- public String getProperty(Object base, String modifier, String key)
- {
- return getProperty(base.getClass().getName(), modifier, key);
- }
-
- /**
- * Looks up a property value relative to the environment, base class and modifier. The default environment will be
- * checked for a matching property if defaults are being used.
- *
- * @param base The name of the class to retrieve properties relative to.
- * @param modifier The modifier (which may stand for a method of the class).
- * @param key The property key.
- *
- * @return The value of this property searching from the most specific definition (environment, class, modifier, key)
- * to the most general (key only), unless use of default environments is turned off in which case the most general
- * property searched is (environment, key).
- */
- public String getProperty(String base, String modifier, String key)
- {
- String result = null;
-
- // Loop over the key orderings, from the most specific to the most general, until a matching value is found.
- for (Iterator i = getKeyIterator(base, modifier, key); i.hasNext();)
- {
- String nextKey = (String) i.next();
-
- result = super.getProperty(nextKey);
-
- if (result != null)
- {
- break;
- }
- }
-
- return result;
- }
-
- /**
- * Looks up an array property value relative to the environment, callers class and method. The default environment
- * will be checked for a matching array property if defaults are being used. In order to work out the callers class
- * and method this method throws an exception and then searches one level up its stack frames.
- *
- * @param key The property key.
- *
- * @return The array value of this indexed property searching from the most specific definition (environment, class,
- * method, key) to the most general (key only), unless use of default environments is turned off in which
- * case the most general proeprty searched is (environment, key).
- */
- public String[] getProperties(String key)
- {
- // Try to get the callers class name and method name by throwing an exception an searching the stack frames.
- String className = null;
- String methodName = null;
-
- /* Java 1.4 onwards only.
- try {
- throw new Exception();
- } catch (Exception e) {
- StackTraceElement[] stack = e.getStackTrace();
- // Check that the stack trace contains at least two elements, one for this method and one for the caller.
- if (stack.length >= 2) {
- className = stack[1].getClassName();
- methodName = stack[1].getMethodName();
- }
- }*/
- return getProperties(className, methodName, key);
- }
-
- /**
- * Looks up an array property value relative to the environment, base class and modifier. The default environment will
- * be checked for a matching array property if defaults are being used.
- *
- * @param base An object of the class to retrieve properties relative to.
- * @param modifier The modifier (which may stand for a method of the class).
- * @param key The property key.
- *
- * @return The array value of this indexed property searching from the most specific definition (environment, class,
- * modifier, key) to the most general (key only), unless use of default environments is turned off in which
- * case the most general proeprty searched is (environment, key).
- */
- public String[] getProperties(Object base, String modifier, String key)
- {
- return getProperties(base.getClass().getName(), modifier, key);
- }
-
- /**
- * Looks up an array property value relative to the environment, base class and modifier. The default environment will
- * be checked for a matching array property if defaults are being used.
- *
- * @param base The name of the class to retrieve properties relative to.
- * @param modifier The modifier (which may stand for a method of the class).
- * @param key The property key.
- *
- * @return The array value of this indexed property searching from the most specific definition (environment, class,
- * modifier, key) to the most general (key only), unless use of default environments is turned off in which
- * case the most general property searched is (environment, key).
- */
- public String[] getProperties(String base, String modifier, String key)
- {
- String[] result = null;
-
- // Loop over the key orderings, from the most specific to the most general, until a matching value is found.
- for (Iterator i = getKeyIterator(base, modifier, key); i.hasNext();)
- {
- String nextKey = (String) i.next();
- ArrayList arrayList = (ArrayList) arrayProperties.get(nextKey);
-
- if (arrayList != null)
- {
- result = (String[]) arrayList.toArray(new String[] {});
-
- break;
- }
- }
-
- return result;
- }
-
- /**
- * For a given environment, base, modifier and key and setting of the use of default environments feature this
- * generates an iterator that walks over the order in which to try and access properties.
- *
- * <p>See the {@link #ORDER} constant for an explanation of how the key ordering is generated.
- *
- * @param base The name of the class to retrieve properties relative to.
- * @param modifier The modifier (which may stand for a method of the class).
- * @param key The property key.
- *
- * @return An Iterator over String keys defining the order in which properties should be accessed.
- */
- protected Iterator getKeyIterator(final String base, final String modifier, final String key)
- {
- return new Iterator()
- {
- // The key ordering count always begins at the start of the ORDER array.
- private int i = 0;
-
- public boolean hasNext()
- {
- return (useDefaults ? ((i < ORDER.length) && (ORDER[i] > ENVIRONMENT_DEFAULTS_CUTOFF))
- : (i < ORDER.length));
- }
-
- public Object next()
- {
- // Check that there is a next element and return null if not.
- if (!hasNext())
- {
- return null;
- }
-
- // Get the next ordering count.
- int o = ORDER[i];
-
- // Do bit matching on the count to choose which elements to include in the key.
- String result =
- (((o & E) != 0) ? (environment + ".") : "") + (((o & B) != 0) ? (base + ".") : "")
- + (((o & M) != 0) ? (modifier + ".") : "") + key;
-
- // Increment the iterator to get the next key on the next call.
- i++;
-
- return result;
- }
-
- public void remove()
- {
- // This method is not supported.
- throw new UnsupportedOperationException("remove() is not supported on this key order iterator as "
- + "the ordering cannot be changed");
- }
- };
- }
-
- /**
- * Scans all the properties in the parent Properties object and creates arrays for any array property definitions.
- *
- * <p>Array properties are defined with indexes. For example:
- *
- * <p><code>
- * property.1=one<br/>
- * property.2=two<br/>
- * property.3=three<br/>
- * </code>
- *
- * <p>Note that these properties will be stored as the 'empty string' or "" property array.
- *
- * <p><code>
- * .1=one<br/>
- * 2=two<br/>
- * </code>
- */
- protected void createArrayProperties()
- {
- // Scan through all defined properties.
- for (Object o : keySet())
- {
- String key = (String) o;
- String value = super.getProperty(key);
-
- // Split the property key into everything before the last '.' and after it.
- int lastDotIndex = key.lastIndexOf('.');
- String keyEnding = key.substring(lastDotIndex + 1, key.length());
- String keyStart = key.substring(0, (lastDotIndex == -1) ? 0 : lastDotIndex);
-
- // Check if the property key ends in an integer, in which case it is an array property.
- int index = 0;
-
- try
- {
- index = Integer.parseInt(keyEnding);
- }
- // The ending is not an integer so its not an array.
- catch (NumberFormatException e)
- {
- // Scan the next property.
- continue;
- }
-
- // Check if an array property already exists for this base name and create one if not.
- ArrayList propArray = (ArrayList) arrayProperties.get(keyStart);
-
- if (propArray == null)
- {
- propArray = new ArrayList();
- arrayProperties.put(keyStart, propArray);
- }
-
- // Add the new property value to the array property for the index.
- propArray.set(index, value);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/MathUtils.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/MathUtils.java
deleted file mode 100644
index 7c803294f4..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/MathUtils.java
+++ /dev/null
@@ -1,428 +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.
- *
- */
-package org.apache.qpid.junit.extensions.util;
-
-import java.util.ArrayList;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Mathematical support methods for the toolkit. Caculating averages, variances, min/max for test latencies and
- * generating linear/exponential sequences for test size/concurrency ramping up.
- *
- * <p/>The sequence specifications are of the form [lowest(, ...)(, highest)](,sample=s)(,exp), where round brackets
- * enclose optional values. Using this pattern form it is possible to specify a single value, a range of values divided
- * into s samples, a range of values divided into s samples but distributed exponentially, or a fixed set of samples.
- *
- * <p/>The duration arguments are of the form (dD)(hH)(mM)(sS), where round brackets enclose optional values. At least
- * one of the optional values must be present.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Generate a sequene of integers from a sequence specification.
- * <tr><td> Parse an encoded duration into milliseconds.
- * </table>
- *
- * @author Rupert Smith
- */
-public class MathUtils
-{
- /** Used for debugging. */
- // private static final Logger log = Logger.getLogger(MathUtils.class);
-
- /** The sequence defintion matching regular expression. */
- public static final String SEQUENCE_REGEXP = "^(\\[[0-9:]+\\])(:samples=[0-9]+)?(:exp)?$";
-
- /** The regular expression that matches sequence definitions. */
- private static final Pattern SEQUENCE_PATTERN = Pattern.compile(SEQUENCE_REGEXP);
-
- /** The duration definition matching regular expression. */
- public static final String DURATION_REGEXP = "^(\\d+D)?(\\d+H)?(\\d+M)?(\\d+S)?$";
-
- /** The regular expression that matches the duration expression. */
- public static final Pattern DURATION_PATTERN = Pattern.compile(DURATION_REGEXP);
-
- /** For matching name=value pairs. */
- public static final String NAME_VALUE_REGEXP = "^\\w+=\\w+$";
-
- /** For matching name=[value1: value2: ...] variations. */
- public static final String NAME_VALUE_VARIATION_REGEXP = "^\\w+=\\[[\\w:]+\\]$";
-
- /** For matching name=[n: ... :m](:sample=s)(:exp) sequences. */
- public static final String NAME_VALUE_SEQUENCE_REGEXP = "^\\w+=(\\[[0-9:]+\\])(:samples=[0-9]+)?(:exp)?$";
-
- /** The regular expression that matches name=value pairs and variations. */
- public static final Pattern NAME_VALUE_PATTERN =
- Pattern.compile("(" + NAME_VALUE_REGEXP + ")|(" + NAME_VALUE_VARIATION_REGEXP + ")|(" + NAME_VALUE_SEQUENCE_REGEXP
- + ")");
-
- /**
- * Runs a quick test of the sequence generation methods to confirm that they work as expected.
- *
- * @param args The command line parameters.
- */
- public static void main(String[] args)
- {
- // Use the command line parser to evaluate the command line.
- CommandLineParser commandLine =
- new CommandLineParser(
- new String[][]
- {
- { "s", "The sequence definition.", "[m:...:n](:sample=s)(:exp)", "true", MathUtils.SEQUENCE_REGEXP },
- { "d", "The duration definition.", "dDhHmMsS", "false", MathUtils.DURATION_REGEXP }
- });
-
- // Capture the command line arguments or display errors and correct usage and then exit.
- ParsedProperties options = null;
-
- try
- {
- options = new ParsedProperties(commandLine.parseCommandLine(args));
- }
- catch (IllegalArgumentException e)
- {
- System.out.println(commandLine.getErrors());
- System.out.println(commandLine.getUsage());
- System.exit(-1);
- }
-
- // Extract the command line options.
- String sequence = options.getProperty("s");
- String durationString = options.getProperty("d");
-
- System.out.println("Sequence is: " + printArray(parseSequence(sequence)));
-
- if (durationString != null)
- {
- System.out.println("Duration is: " + parseDuration(durationString));
- }
- }
-
- /**
- * Given a start and end and a number of steps this method generates a sequence of evenly spaced integer
- * values, starting at the start (inclusive) and finishing at the end (inclusive) with the specified number
- * of values in the sequence. The sequence returned may contain less than the specified number where the integer
- * range between start and end is too small to contain that many.
- *
- * <p/>As the results are integers, they will not be perfectly evenly spaced but a best-fit.
- *
- * @param start The sequence start.
- * @param end The sequence end.
- * @param steps The number of steps.
- *
- * @return The sequence.
- */
- public static int[] generateSequence(int start, int end, int steps)
- {
- // Check that there are at least two steps.
- if (steps < 2)
- {
- throw new IllegalArgumentException("There must be at least 2 steps.");
- }
-
- ArrayList<Integer> result = new ArrayList<Integer>();
-
- // Calculate the sequence using floating point, then round into the results.
- double fStart = start;
- double fEnd = end;
- double fCurrent = start;
-
- for (int i = 0; i < steps; i++)
- {
- fCurrent = (((fEnd - fStart) / (steps - 1)) * i) + fStart;
-
- roundAndAdd(result, fCurrent);
- }
-
- // Return the results after converting to a primitive array.
- return intListToPrimitiveArray(result);
- }
-
- /**
- * Given a start and end and a number of steps this method generates a sequence of expontentially spaced integer
- * values, starting at the start (inclusive) and finishing at the end (inclusive) with the specified number
- * of values in the sequence. An exponentially spaced sequence is one where the ratio between any two consecutive
- * numbers in the sequence remains constant. The sequence returned may contain less than the specified number where
- * the difference between two consecutive values is too small (this is more likely at the start of the sequence,
- * where the values are closer together).
- *
- * <p/>As the results are integers, they will not be perfectly exponentially spaced but a best-fit.
- *
- * @param start The sequence start.
- * @param end The sequence end.
- * @param steps The number of steps.
- *
- * @return The sequence.
- */
- public static int[] generateExpSequence(int start, int end, int steps)
- {
- // Check that there are at least two steps.
- if (steps < 2)
- {
- throw new IllegalArgumentException("There must be at least 2 steps.");
- }
-
- ArrayList<Integer> result = new ArrayList<Integer>();
-
- // Calculate the sequence using floating point, then round into the results.
- double fStart = start;
- double fEnd = end;
- // float fCurrent = start;
- double diff = fEnd - fStart;
- double factor = java.lang.Math.pow(diff, (1.0f / (steps - 1)));
-
- for (int i = 0; i < steps; i++)
- {
- // This is a cheat to get the end exactly on and lose the accumulated rounding error.
- if (i == (steps - 1))
- {
- result.add(end);
- }
- else
- {
- roundAndAdd(result, fStart - 1.0f + java.lang.Math.pow(factor, i));
- }
- }
-
- // Return the results after converting to a primitive array.
- return intListToPrimitiveArray(result);
- }
-
- /**
- * Parses a string defintion of a sequence into an int array containing the sequence. The definition will conform
- * to the regular expression: "^(\[[0-9,]+\])(,samples=[0-9]+)?(,exp)?$". This splits it into three parts,
- * an array of integers, the optional sample count and the optional exponential flag.
- *
- * @param sequenceDef The sequence definition.
- *
- * @return The sequence as a fully expanded int array.
- */
- public static int[] parseSequence(String sequenceDef)
- {
- // Match the sequence definition against the regular expression for sequences.
- Matcher matcher = SEQUENCE_PATTERN.matcher(sequenceDef);
-
- // Check that the argument is of the right format accepted by this method.
- if (!matcher.matches())
- {
- throw new IllegalArgumentException("The sequence definition is not in the correct format.");
- }
-
- // Get the total number of matching groups to see if either of the optional samples or exponential flag
- // goups were set.
- int numGroups = matcher.groupCount();
-
- // Split the array of integers on commas.
- String intArrayString = matcher.group(1);
-
- String[] intSplits = intArrayString.split("[:\\[\\]]");
-
- int[] sequence = new int[intSplits.length - 1];
-
- for (int i = 1; i < intSplits.length; i++)
- {
- sequence[i - 1] = Integer.parseInt(intSplits[i]);
- }
-
- // Check for the optional samples count.
- int samples = 0;
-
- if ((numGroups > 1) && (matcher.group(2) != null))
- {
- String samplesGroup = matcher.group(2);
-
- String samplesString = samplesGroup.substring(",samples=".length());
- samples = Integer.parseInt(samplesString);
- }
-
- // Check for the optional exponential flag.
- boolean expFlag = false;
-
- if ((numGroups > 2) && (matcher.group(3) != null))
- {
- expFlag = true;
- }
-
- // If there is a sample count and 2 or more sequence values defined, then generate the sequence from the first
- // and last sequence values.
- if ((samples != 0) && (sequence.length >= 2))
- {
- int start = sequence[0];
- int end = sequence[sequence.length - 1];
-
- if (!expFlag)
- {
- sequence = generateSequence(start, end, samples);
- }
- else
- {
- sequence = generateExpSequence(start, end, samples);
- }
- }
-
- return sequence;
- }
-
- /**
- * Parses a duration defined as a string, giving a duration in days, hours, minutes and seconds into a number
- * of milliseconds equal to that duration.
- *
- * @param duration The duration definition string.
- *
- * @return The duration in millliseconds.
- */
- public static long parseDuration(String duration)
- {
- // Match the duration against the regular expression.
- Matcher matcher = DURATION_PATTERN.matcher(duration);
-
- // Check that the argument is of the right format accepted by this method.
- if (!matcher.matches())
- {
- throw new IllegalArgumentException("The duration definition is not in the correct format.");
- }
-
- // This accumulates the duration.
- long result = 0;
-
- int numGroups = matcher.groupCount();
-
- // Extract the days.
- if (numGroups >= 1)
- {
- String daysString = matcher.group(1);
- result +=
- (daysString == null)
- ? 0 : (Long.parseLong(daysString.substring(0, daysString.length() - 1)) * 24 * 60 * 60 * 1000);
- }
-
- // Extract the hours.
- if (numGroups >= 2)
- {
- String hoursString = matcher.group(2);
- result +=
- (hoursString == null) ? 0
- : (Long.parseLong(hoursString.substring(0, hoursString.length() - 1)) * 60 * 60 * 1000);
- }
-
- // Extract the minutes.
- if (numGroups >= 3)
- {
- String minutesString = matcher.group(3);
- result +=
- (minutesString == null)
- ? 0 : (Long.parseLong(minutesString.substring(0, minutesString.length() - 1)) * 60 * 1000);
- }
-
- // Extract the seconds.
- if (numGroups >= 4)
- {
- String secondsString = matcher.group(4);
- result +=
- (secondsString == null) ? 0 : (Long.parseLong(secondsString.substring(0, secondsString.length() - 1)) * 1000);
- }
-
- return result;
- }
-
- /**
- * Pretty prints an array of ints as a string.
- *
- * @param array The array to pretty print.
- *
- * @return The pretty printed string.
- */
- public static String printArray(int[] array)
- {
- String result = "[";
- for (int i = 0; i < array.length; i++)
- {
- result += array[i];
- result += (i < (array.length - 1)) ? ", " : "";
- }
-
- result += "]";
-
- return result;
- }
-
- /**
- * Returns the maximum value in an array of integers.
- *
- * @param values The array to find the amx in.
- *
- * @return The max value.
- */
- public static int maxInArray(int[] values)
- {
- if ((values == null) || (values.length == 0))
- {
- throw new IllegalArgumentException("Cannot find the max of a null or empty array.");
- }
-
- int max = values[0];
-
- for (int value : values)
- {
- max = (max < value) ? value : max;
- }
-
- return max;
- }
-
- /**
- * The #toArray methods of collections cannot be used with primitive arrays. This loops over and array list
- * of Integers and outputs and array of int.
- *
- * @param result The array of Integers to convert.
- *
- * @return An array of int.
- */
- private static int[] intListToPrimitiveArray(ArrayList<Integer> result)
- {
- int[] resultArray = new int[result.size()];
- int index = 0;
- for (int r : result)
- {
- resultArray[index] = result.get(index);
- index++;
- }
-
- return resultArray;
- }
-
- /**
- * Rounds the specified floating point value to the nearest integer and adds it to the specified list of
- * integers, provided it is not already in the list.
- *
- * @param result The list of integers to add to.
- * @param value The new candidate to round and add to the list.
- */
- private static void roundAndAdd(ArrayList<Integer> result, double value)
- {
- int roundedValue = (int) Math.round(value);
-
- if (!result.contains(roundedValue))
- {
- result.add(roundedValue);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/ParsedProperties.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/ParsedProperties.java
deleted file mode 100644
index 1cc6757675..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/ParsedProperties.java
+++ /dev/null
@@ -1,390 +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.
- *
- */
-package org.apache.qpid.junit.extensions.util;
-
-import java.util.Properties;
-
-/**
- * ParsedProperties extends the basic Properties class with methods to extract properties, not as strings but as strings
- * parsed into basic types.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * </table>
- *
- * @author Rupert Smith
- */
-public class ParsedProperties extends Properties
-{
- /**
- * Creates an empty ParsedProperties.
- */
- public ParsedProperties()
- {
- super();
- }
-
- /**
- * Creates a ParsedProperties initialized with the specified properties.
- *
- * @param props The properties to initialize this with.
- */
- public ParsedProperties(Properties props)
- {
- super(props);
- }
-
- /**
- * Helper method for setting system properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public static boolean setSysPropertyIfNull(String propname, boolean value)
- {
- return Boolean.parseBoolean(setSysPropertyIfNull(propname, Boolean.toString(value)));
- }
-
- /**
- * Helper method for setting system properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public static short setSysPropertyIfNull(String propname, short value)
- {
- return Short.parseShort(setSysPropertyIfNull(propname, Short.toString(value)));
- }
-
- /**
- * Helper method for setting system properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public static int setSysPropertyIfNull(String propname, int value)
- {
- return Integer.parseInt(setSysPropertyIfNull(propname, Integer.toString(value)));
- }
-
- /**
- * Helper method for setting system properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public static long setSysPropertyIfNull(String propname, long value)
- {
- return Long.parseLong(setSysPropertyIfNull(propname, Long.toString(value)));
- }
-
- /**
- * Helper method for setting system properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public static float setSysPropertyIfNull(String propname, float value)
- {
- return Float.parseFloat(setSysPropertyIfNull(propname, Float.toString(value)));
- }
-
- /**
- * Helper method for setting system properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public static double setSysPropertyIfNull(String propname, double value)
- {
- return Double.parseDouble(setSysPropertyIfNull(propname, Double.toString(value)));
- }
-
- /**
- * Helper method for setting system properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the system property after this method call.
- */
- public static String setSysPropertyIfNull(String propname, String value)
- {
- String property = System.getProperty(propname);
-
- if (property == null)
- {
- System.setProperty(propname, value);
-
- return value;
- }
- else
- {
- return property;
- }
- }
-
- /**
- * Helper method for setting properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public boolean setPropertyIfNull(String propname, boolean value)
- {
- return Boolean.parseBoolean(setPropertyIfNull(propname, Boolean.toString(value)));
- }
-
- /**
- * Helper method for setting properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public short setPropertyIfNull(String propname, short value)
- {
- return Short.parseShort(setPropertyIfNull(propname, Short.toString(value)));
- }
-
- /**
- * Helper method for setting properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public int setPropertyIfNull(String propname, int value)
- {
- return Integer.parseInt(setPropertyIfNull(propname, Integer.toString(value)));
- }
-
- /**
- * Helper method for setting properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public long setPropertyIfNull(String propname, long value)
- {
- return Long.parseLong(setPropertyIfNull(propname, Long.toString(value)));
- }
-
- /**
- * Helper method for setting properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public float setPropertyIfNull(String propname, float value)
- {
- return Float.parseFloat(setPropertyIfNull(propname, Float.toString(value)));
- }
-
- /**
- * Helper method for setting properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public double setPropertyIfNull(String propname, double value)
- {
- return Double.parseDouble(setPropertyIfNull(propname, Double.toString(value)));
- }
-
- /**
- * Helper method for setting properties to defaults when they are not already set.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public String setPropertyIfNull(String propname, String value)
- {
- String property = super.getProperty(propname);
-
- if (property == null)
- {
- super.setProperty(propname, value);
-
- return value;
- }
- else
- {
- return property;
- }
- }
-
- /**
- * Helper method for setting properties.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public boolean setProperty(String propname, boolean value)
- {
- setProperty(propname, Boolean.toString(value));
-
- return value;
- }
-
- /**
- * Helper method for setting properties.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public short setProperty(String propname, short value)
- {
- setProperty(propname, Short.toString(value));
-
- return value;
- }
-
- /**
- * Helper method for setting properties.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public int setProperty(String propname, int value)
- {
- setProperty(propname, Integer.toString(value));
-
- return value;
- }
-
- /**
- * Helper method for setting properties.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public long setProperty(String propname, long value)
- {
- setProperty(propname, Long.toString(value));
-
- return value;
- }
-
- /**
- * Helper method for setting properties.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public float setProperty(String propname, float value)
- {
- setProperty(propname, Float.toString(value));
-
- return value;
- }
-
- /**
- * Helper method for setting properties.
- *
- * @param propname The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property after this method call.
- */
- public double setProperty(String propname, double value)
- {
- setProperty(propname, Double.toString(value));
-
- return value;
- }
-
- /**
- * Parses a property as a boolean.
- *
- * @param propName The property.
- *
- * @return The property as a boolean, or false if it does not exist.
- */
- public boolean getPropertyAsBoolean(String propName)
- {
- String prop = getProperty(propName);
-
- return (prop != null) && Boolean.parseBoolean(prop);
- }
-
- /**
- * Parses a property as an integer.
- *
- * @param propName The property.
- *
- * @return The property as a integer, or null if it does not exist.
- */
- public Integer getPropertyAsInteger(String propName)
- {
- String prop = getProperty(propName);
-
- return (prop != null) ? new Integer(prop) : null;
- }
-
- /**
- * Parses a property as a long.
- *
- * @param propName The property.
- *
- * @return The property as a long, or null if it does not exist.
- */
- public Long getPropertyAsLong(String propName)
- {
- String prop = getProperty(propName);
-
- return (prop != null) ? new Long(prop) : null;
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/SizeOf.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/SizeOf.java
deleted file mode 100644
index ecc08770a9..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/SizeOf.java
+++ /dev/null
@@ -1,94 +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.
- *
- */
-package org.apache.qpid.junit.extensions.util;
-
-/**
- * SizeOf provides a static method that does its best to return an accurate measure of the total amount of memory used by
- * the virtual machine. This is calculated as the total memory available to the VM minus the actual amount used by it.
- * Before this measurement is taken the garbage collector is run many times until the used memory calculation stabilizes.
- * Generally, this trick works quite well to provide an accurate reading, however, it cannot be relied upon to be totally
- * accurate. It is also quite slow.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Calculate total memory used.
- * </table>
- *
- * @author Rupert Smith
- */
-public class SizeOf
-{
- /** Holds a reference to the runtime object. */
- private static final Runtime RUNTIME = Runtime.getRuntime();
-
- /**
- * Makes 4 calls the {@link #runGCTillStable} method.
- */
- public static void runGCTillStableSeveralTimes()
- {
- // It helps to call Runtime.gc() using several method calls.
- for (int r = 0; r < 4; ++r)
- {
- runGCTillStable();
- }
- }
-
- /**
- * Runs the garbage collector until the used memory reading stabilizes. It may run the garbage collector up
- * to 500 times.
- */
- public static void runGCTillStable()
- {
- long usedMem1 = usedMemory(), usedMem2 = Long.MAX_VALUE;
-
- for (int i = 0; (usedMem1 < usedMem2) && (i < 500); ++i)
- {
- RUNTIME.runFinalization();
- RUNTIME.gc();
- Thread.currentThread().yield();
-
- usedMem2 = usedMem1;
- usedMem1 = usedMemory();
- }
- }
-
- /**
- * Runs the garbage collector until the used memory stabilizes and then measures it.
- *
- * @return The amount of memory used by the virtual machine.
- */
- public static long getUsedMemory()
- {
- runGCTillStableSeveralTimes();
-
- return usedMemory();
- }
-
- /**
- * Returns the amount of memory used by subtracting the free memory from the total available memory.
- *
- * @return The amount of memory used.
- */
- private static long usedMemory()
- {
- return RUNTIME.totalMemory() - RUNTIME.freeMemory();
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/StackQueue.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/StackQueue.java
deleted file mode 100644
index acc1e2c218..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/StackQueue.java
+++ /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.
- *
- */
-package org.apache.qpid.junit.extensions.util;
-
-import java.util.EmptyStackException;
-import java.util.NoSuchElementException;
-import java.util.Queue;
-import java.util.Stack;
-
-/**
- * The Stack class in java.util (most unhelpfully) does not implement the Queue interface. This is an adaption of that
- * class as a queue.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Turn a stack into a queue.
- * </table>
- *
- * @todo Need to override the add method, and iterator and consider other methods too. They work like LIFO but
- * really wany FIFO behaviour accross the whole data structure.
- *
- * @author Rupert Smith
- */
-public class StackQueue<E> extends Stack<E> implements Queue<E>
-{
- /**
- * Retrieves, but does not remove, the head of this queue.
- *
- * @return The element at the top of the stack.
- */
- public E element()
- {
- try
- {
- return super.peek();
- }
- catch (EmptyStackException e)
- {
- NoSuchElementException t = new NoSuchElementException();
- t.initCause(e);
- throw t;
- }
- }
-
- /**
- * Inserts the specified element into this queue, if possible.
- *
- * @param o The data element to push onto the stack.
- *
- * @return True if it was added to the stack, false otherwise (this implementation always returns true).
- */
- public boolean offer(E o)
- {
- push(o);
-
- return true;
- }
-
- /**
- * Retrieves, but does not remove, the head of this queue, returning null if this queue is empty.
- *
- * @return The top element from the stack, or null if the stack is empty.
- */
- public E peek()
- {
- try
- {
- return super.peek();
- }
- catch (EmptyStackException e)
- {
- return null;
- }
- }
-
- /**
- * Retrieves and removes the head of this queue, or null if this queue is empty.
- *
- * @return The top element from the stack, or null if the stack is empty.
- */
- public E poll()
- {
- try
- {
- return super.pop();
- }
- catch (EmptyStackException e)
- {
- return null;
- }
- }
-
- /**
- * Retrieves and removes the head of this queue.
- *
- * @return The top element from the stack, or null if the stack is empty.
- *
- * @throws NoSuchElementException If the stack is empty so no element can be removed from it.
- */
- public E remove()
- {
- try
- {
- return super.pop();
- }
- catch (EmptyStackException e)
- {
- NoSuchElementException t = new NoSuchElementException();
- t.initCause(e);
- throw t;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/TestContextProperties.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/TestContextProperties.java
deleted file mode 100644
index d402077963..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/TestContextProperties.java
+++ /dev/null
@@ -1,202 +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.
- *
- */
-package org.apache.qpid.junit.extensions.util;
-
-import java.util.Properties;
-
-/**
- * TestContextProperties is an extension of {@link ParsedProperties} that keeps track of property key/value pairs
- * that are used by tests being run under the {@link org.apache.qpid.junit.extensions.TKTestRunner}. To keep the
- * test runner notified of configurable test parameters, tests should establish their required property values by
- * initiliazing fields or statics or in the constructor, through this class. The tk test runner automatically places
- * any additional properties specified on the command line into the this class, and these are held statically.
- *
- * <p/>Here is an example:
- *
- * <pre>
- * public class MyTestClass extends TestCase {
- * ParsedProperties testProps = TestContextProperties.getInstance();
- * private int testParam = testProps.setPropertyIfNull("testParam", 1);
- * ...
- * </pre>
- *
- * <p/>This has the effect of setting up the field testParam with the default value of 1, unless it is overridden
- * by values passed to the tk test runner. It also notifies the tk test runner of the name and value of the test
- * parameter actually used for the test, so that this can be logged in the test output file.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Log all name/value pairs read or written.
- * </table>
- *
- * @author Rupert Smith
- */
-public class TestContextProperties extends ParsedProperties
-{
- /** Used for debugging. */
- // Logger log = Logger.getLogger(TestContextProperties.class);
-
- /** Holds all properties set or read through this property extension class. */
- private Properties accessedProps = new Properties();
-
- /** The singleton instance of the test context properties. */
- private static TestContextProperties singleton = null;
-
- /**
- * Default constructor that builds a ContextualProperties that uses environment defaults.
- */
- private TestContextProperties()
- {
- super();
- }
-
- /**
- * Gets the singleton instance of the test context properties.
- *
- * @return The singleton instance of the test context properties.
- */
- public static synchronized ParsedProperties getInstance()
- {
- if (singleton == null)
- {
- singleton = new TestContextProperties();
- }
-
- return singleton;
- }
-
- /**
- * Gets the singleton instance of the test context properties, applying a specified set of default properties to
- * it, if they are not already set.
- *
- * @param defaults The defaults to apply for properties not already set.
- *
- * @return The singleton instance of the test context properties.
- */
- public static synchronized ParsedProperties getInstance(Properties defaults)
- {
- ParsedProperties props = getInstance();
-
- for (Object key : defaults.keySet())
- {
- String stringKey = (String) key;
- String value = defaults.getProperty(stringKey);
-
- props.setPropertyIfNull(stringKey, value);
- }
-
- return props;
- }
-
- /*
- * Creates a ContextualProperties that uses environment defaults and is initialized with the specified properties.
- *
- * @param props The properties to initialize this with.
- */
- /*public TestContextProperties(Properties props)
- {
- super();
- }*/
-
- /**
- * Gets all of the properties (with their most recent values) that have been set or read through this class.
- *
- * @return All of the properties accessed through this class.
- */
- public static Properties getAccessedProps()
- {
- return (singleton == null) ? new Properties() : singleton;
- // return accessedProps;
- }
-
- /**
- * Looks up a property value relative to the environment, callers class and method. The default environment will be
- * checked for a matching property if defaults are being used. The property key/value pair is remembered and made
- * available to {@link org.apache.qpid.junit.extensions.TKTestRunner}.
- *
- * @param key The property key.
- *
- * @return The value of this property searching from the most specific definition (environment, class, method, key)
- * to the most general (key only), unless use of default environments is turned off in which case the most general
- * proeprty searched is (environment, key).
- */
- public String getProperty(String key)
- {
- // log.debug("public String getProperty(String key = " + key + "): called");
-
- String value = super.getProperty(key);
-
- if (value != null)
- {
- accessedProps.setProperty(key, value);
- }
-
- // log.debug("value = " + value);
-
- return value;
- }
-
- /**
- * Calls the <tt>Hashtable</tt> method <code>put</code>. Provided for parallelism with the <tt>getProperty</tt>
- * method. Enforces use of strings for property keys and values. The value returned is the result of the
- * <tt>Hashtable</tt> call to <code>put</code>. The property key/value pair is remembered and made
- * available to {@link org.apache.qpid.junit.extensions.TKTestRunner}.
- *
- * @param key The key to be placed into this property list.
- * @param value The value corresponding to <tt>key</tt>.
- *
- * @return The previous value of the specified key in this property list, or <code>null</code> if it did not have one.
- */
- public synchronized Object setProperty(String key, String value)
- {
- // log.debug("public synchronized Object setProperty(String key = " + key + ", String value = " + value + "): called");
-
- Object result = super.setProperty(key, value);
- accessedProps.setProperty(key, value);
-
- return result;
- }
-
- /**
- * Helper method for setting properties to defaults when they are not already set. The property key/value pair is
- * remembered and made available to {@link org.apache.qpid.junit.extensions.TKTestRunner}.
- *
- * @param key The name of the system property to set.
- * @param value The value to set it to.
- *
- * @return The value of the property, which will be the value passed in if it was null, or the existing value otherwise.
- */
- public String setPropertyIfNull(String key, String value)
- {
- // log.debug("public String setPropertyIfNull(String key = " + key + ", String value = " + value + "): called");
-
- String result = super.setPropertyIfNull(key, value);
-
- if (value != null)
- {
- accessedProps.setProperty(key, result);
- }
-
- // log.debug("result = " + result);
-
- return result;
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/TestUtils.java b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/TestUtils.java
deleted file mode 100644
index 553a41ecae..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/TestUtils.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-package org.apache.qpid.junit.extensions.util;
-
-/**
- * Provides commonly used functions that aid testing.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide a short pause.
- * </table>
- *
- * @author Rupert Smith
- */
-public class TestUtils
-{
- /**
- * Injects a short pause. The pause may not complete its full length, if the thread is interrupted when waiting.
- * In most cases, this will not happen and this method is a vry adequate pause implementation, without the
- * need to handle interrupted exceptions.
- *
- * @param millis The length of the pause in milliseconds.
- */
- public static void pause(long millis)
- {
- try
- {
- Thread.sleep(millis);
- }
- catch (InterruptedException e)
- {
- // Clear the flag and ignore.
- Thread.interrupted();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/package.html b/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/package.html
deleted file mode 100644
index f39b892e2d..0000000000
--- a/M4-RCs/qpid/java/junit-toolkit/src/main/org/apache/qpid/junit/extensions/util/package.html
+++ /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.
-
--->
-
-<html>
-<body>
-Provides some helper classes. ContextualProperties allows a hierarchy of properties to be used in properties file with
-default overrides. SizeOf takes memeory measurements by stabilizing the garbage collector.
-</body>
-</html>
diff --git a/M4-RCs/qpid/java/lib/backport-util-concurrent-2.2.jar b/M4-RCs/qpid/java/lib/backport-util-concurrent-2.2.jar
deleted file mode 100644
index 20a16877bd..0000000000
--- a/M4-RCs/qpid/java/lib/backport-util-concurrent-2.2.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/bnd-0.0.249.jar b/M4-RCs/qpid/java/lib/bnd-0.0.249.jar
deleted file mode 100644
index 7d216ea9e0..0000000000
--- a/M4-RCs/qpid/java/lib/bnd-0.0.249.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/cobertura/README.txt b/M4-RCs/qpid/java/lib/cobertura/README.txt
deleted file mode 100644
index 62daac2edc..0000000000
--- a/M4-RCs/qpid/java/lib/cobertura/README.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Download the cobertura binary from the following location:
-
-http://cobertura.sourceforge.net/download.html
-
-
-Unpack it into the cobertura (this) directory and then move the contents up one level i.e. once unpacked it will create a cobertura-<version>. directory with the cobertura.jar and scripts and a lib dir. All this content needs to move up to the cobertura directory proper.
-
-Run "ant cover-test coverage-report" to generate coverage report.
-
diff --git a/M4-RCs/qpid/java/lib/com.ibm.icu_3.4.4.jar b/M4-RCs/qpid/java/lib/com.ibm.icu_3.4.4.jar
deleted file mode 100644
index 9df503a2a3..0000000000
--- a/M4-RCs/qpid/java/lib/com.ibm.icu_3.4.4.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/commons-cli-1.0.jar b/M4-RCs/qpid/java/lib/commons-cli-1.0.jar
deleted file mode 100644
index 22a004e14e..0000000000
--- a/M4-RCs/qpid/java/lib/commons-cli-1.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/commons-codec-1.3.jar b/M4-RCs/qpid/java/lib/commons-codec-1.3.jar
deleted file mode 100644
index 957b6752af..0000000000
--- a/M4-RCs/qpid/java/lib/commons-codec-1.3.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/commons-collections-3.2.jar b/M4-RCs/qpid/java/lib/commons-collections-3.2.jar
deleted file mode 100644
index 75580be255..0000000000
--- a/M4-RCs/qpid/java/lib/commons-collections-3.2.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/commons-configuration-1.2.jar b/M4-RCs/qpid/java/lib/commons-configuration-1.2.jar
deleted file mode 100644
index 574d0ac789..0000000000
--- a/M4-RCs/qpid/java/lib/commons-configuration-1.2.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/commons-lang-2.2.jar b/M4-RCs/qpid/java/lib/commons-lang-2.2.jar
deleted file mode 100644
index b9105611f3..0000000000
--- a/M4-RCs/qpid/java/lib/commons-lang-2.2.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/commons-logging-1.0.4.jar b/M4-RCs/qpid/java/lib/commons-logging-1.0.4.jar
deleted file mode 100644
index b73a80fab6..0000000000
--- a/M4-RCs/qpid/java/lib/commons-logging-1.0.4.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/commons-pool-1.4.jar b/M4-RCs/qpid/java/lib/commons-pool-1.4.jar
deleted file mode 100644
index d6bc185450..0000000000
--- a/M4-RCs/qpid/java/lib/commons-pool-1.4.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/geronimo-jms_1.1_spec-1.0.jar b/M4-RCs/qpid/java/lib/geronimo-jms_1.1_spec-1.0.jar
deleted file mode 100644
index 42bf403e28..0000000000
--- a/M4-RCs/qpid/java/lib/geronimo-jms_1.1_spec-1.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/geronimo-servlet_2.5_spec-1.2.jar b/M4-RCs/qpid/java/lib/geronimo-servlet_2.5_spec-1.2.jar
deleted file mode 100644
index 00a2010036..0000000000
--- a/M4-RCs/qpid/java/lib/geronimo-servlet_2.5_spec-1.2.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/javacc.jar b/M4-RCs/qpid/java/lib/javacc.jar
deleted file mode 100644
index 5506008402..0000000000
--- a/M4-RCs/qpid/java/lib/javacc.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/jline-0.9.94.jar b/M4-RCs/qpid/java/lib/jline-0.9.94.jar
deleted file mode 100644
index dafca7c46e..0000000000
--- a/M4-RCs/qpid/java/lib/jline-0.9.94.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/junit-3.8.1.jar b/M4-RCs/qpid/java/lib/junit-3.8.1.jar
deleted file mode 100644
index 674d71e89e..0000000000
--- a/M4-RCs/qpid/java/lib/junit-3.8.1.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/junit-4.4.jar b/M4-RCs/qpid/java/lib/junit-4.4.jar
deleted file mode 100644
index 649b0b327f..0000000000
--- a/M4-RCs/qpid/java/lib/junit-4.4.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/jython-2.2-rc2.jar b/M4-RCs/qpid/java/lib/jython-2.2-rc2.jar
deleted file mode 100644
index e25e2cb945..0000000000
--- a/M4-RCs/qpid/java/lib/jython-2.2-rc2.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/jython-lib.jar b/M4-RCs/qpid/java/lib/jython-lib.jar
deleted file mode 100644
index bb3ba82db5..0000000000
--- a/M4-RCs/qpid/java/lib/jython-lib.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/log4j-1.2.12.jar b/M4-RCs/qpid/java/lib/log4j-1.2.12.jar
deleted file mode 100644
index 9b5a720088..0000000000
--- a/M4-RCs/qpid/java/lib/log4j-1.2.12.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/mina-core-1.0.1.jar b/M4-RCs/qpid/java/lib/mina-core-1.0.1.jar
deleted file mode 100755
index f12067aa90..0000000000
--- a/M4-RCs/qpid/java/lib/mina-core-1.0.1.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/mina-filter-ssl-1.0.1.jar b/M4-RCs/qpid/java/lib/mina-filter-ssl-1.0.1.jar
deleted file mode 100755
index 53738e6498..0000000000
--- a/M4-RCs/qpid/java/lib/mina-filter-ssl-1.0.1.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.apache.felix.framework-1.0.0.jar b/M4-RCs/qpid/java/lib/org.apache.felix.framework-1.0.0.jar
deleted file mode 100755
index 51401807bb..0000000000
--- a/M4-RCs/qpid/java/lib/org.apache.felix.framework-1.0.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.core.commands_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.core.commands_3.2.0.jar
deleted file mode 100644
index c864864689..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.core.commands_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.core.contenttype_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.core.contenttype_3.2.0.jar
deleted file mode 100644
index 816e3fc938..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.core.contenttype_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.core.expressions_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.core.expressions_3.2.0.jar
deleted file mode 100644
index 51d2a0204c..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.core.expressions_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.core.jobs_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.core.jobs_3.2.0.jar
deleted file mode 100644
index 995bcd2e27..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.core.jobs_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.core.runtime.compatibility.auth_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.core.runtime.compatibility.auth_3.2.0.jar
deleted file mode 100644
index 26bb49fe12..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.core.runtime.compatibility.auth_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.core.runtime.compatibility.registry_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.core.runtime.compatibility.registry_3.2.0.jar
deleted file mode 100644
index 4ffbb0db56..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.core.runtime.compatibility.registry_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.core.runtime_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.core.runtime_3.2.0.jar
deleted file mode 100644
index 85e61cca58..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.core.runtime_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.common_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.equinox.common_3.2.0.jar
deleted file mode 100644
index e28a631ebb..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.common_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/ECLIPSE.RSA b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/ECLIPSE.RSA
deleted file mode 100644
index 29e6f3e7a0..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/ECLIPSE.RSA
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/ECLIPSE.SF b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/ECLIPSE.SF
deleted file mode 100644
index 1d2eece149..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/ECLIPSE.SF
+++ /dev/null
@@ -1,17 +0,0 @@
-Signature-Version: 1.0
-SHA1-Digest-Manifest: FheFhPCFIe9e17dtN19PvFpfHzs=
-Created-By: 1.5.0 (IBM Corporation)
-SHA1-Digest-Manifest-Main-Attributes: X4gDjCpbD8vwxPcCNeLjJjIHBoU=
-
-Name: about.html
-SHA1-Digest: xGcp/Hbq/ywyvVWkPzD/2vkIzdY=
-
-Name: eclipse_1115.so
-SHA1-Digest: ItFKEUKn9bCxLiWwFj8ubKbopDg=
-
-Name: META-INF/eclipse.inf
-SHA1-Digest: SAqY+5ITAL0mkdYeijlSRhyIaZk=
-
-Name: launcher.carbon.macosx.properties
-SHA1-Digest: iJiwtqN46CqxjQPiFqskiJDS2hk=
-
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/MANIFEST.MF b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/MANIFEST.MF
deleted file mode 100644
index f9ef43c43a..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-SymbolicName: org.eclipse.equinox.launcher.carbon.macosx;single
- ton:=true
-Bundle-ManifestVersion: 2
-Bundle-Localization: launcher.carbon.macosx
-Bundle-Name: %pluginName
-Eclipse-PlatformFilter: (& (osgi.ws=carbon) (osgi.os=macosx) (|(osgi.a
- rch=x86)(osgi.arch=ppc)) )
-Bundle-Version: 1.0.101.R34x_v20080731
-Fragment-Host: org.eclipse.equinox.launcher;bundle-version="[1.0.0,1.1
- .0)"
-Bundle-Vendor: %providerName
-
-Name: eclipse_1115.so
-SHA1-Digest: RRLhb5Prci79GCZFsylKadyPBvM=
-
-Name: about.html
-SHA1-Digest: a9lDHrGuLPkvHBUhsqWU+V2mhPw=
-
-Name: META-INF/eclipse.inf
-SHA1-Digest: KyT9FF7C7t86NoBoa2kZT3ZJBfw=
-
-Name: launcher.carbon.macosx.properties
-SHA1-Digest: L4VSSU2M0KAWyhCp8QBLMsnC6Jk=
-
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/eclipse.inf b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/eclipse.inf
deleted file mode 100644
index 7864d3c4c3..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/META-INF/eclipse.inf
+++ /dev/null
@@ -1,3 +0,0 @@
-#Processed using Jarprocessor
-pack200.args = -E4
-pack200.conditioned = true
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/about.html b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/about.html
deleted file mode 100644
index 395df3ba90..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).
-Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor&rsquo;s license
-that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/eclipse_1115.so b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/eclipse_1115.so
deleted file mode 100644
index 17e8230b19..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/eclipse_1115.so
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/launcher.carbon.macosx.properties b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/launcher.carbon.macosx.properties
deleted file mode 100644
index 4373d35790..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731/launcher.carbon.macosx.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-pluginName = Equinox Launcher MacOSX Fragment
-providerName = Eclipse.org
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/ECLIPSE.SF b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/ECLIPSE.SF
deleted file mode 100644
index 4122b4ea8f..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/ECLIPSE.SF
+++ /dev/null
@@ -1,17 +0,0 @@
-Signature-Version: 1.0
-SHA1-Digest-Manifest: tswsDz0e+s2SPhfY7LybTLEXoI4=
-Created-By: 1.5.0 (IBM Corporation)
-SHA1-Digest-Manifest-Main-Attributes: Ymnpf9HjgpR8t0MrPx1wLH4tJFQ=
-
-Name: launcher.gtk.linux.x86.properties
-SHA1-Digest: +CJXeQUkWFS+xYpRY6jNNT065mI=
-
-Name: about.html
-SHA1-Digest: xGcp/Hbq/ywyvVWkPzD/2vkIzdY=
-
-Name: eclipse_1115.so
-SHA1-Digest: gvha3rnYpdA1SDXsMMxPKyEB/Xg=
-
-Name: META-INF/eclipse.inf
-SHA1-Digest: SAqY+5ITAL0mkdYeijlSRhyIaZk=
-
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/MANIFEST.MF b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/MANIFEST.MF
deleted file mode 100644
index d699938858..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-SymbolicName: org.eclipse.equinox.launcher.gtk.linux.x86;single
- ton:=true
-Bundle-ManifestVersion: 2
-Bundle-Localization: launcher.gtk.linux.x86
-Bundle-Name: %pluginName
-Eclipse-PlatformFilter: (& (osgi.ws=gtk) (osgi.os=linux) (osgi.arch=x8
- 6))
-Bundle-Version: 1.0.101.R34x_v20080805
-Fragment-Host: org.eclipse.equinox.launcher;bundle-version="[1.0.0,1.1
- .0)"
-Bundle-Vendor: %providerName
-
-Name: launcher.gtk.linux.x86.properties
-SHA1-Digest: BSbhScorws9R/DVRUdKNmymMSIU=
-
-Name: eclipse_1115.so
-SHA1-Digest: n3UyHV1KgJ0YuFIDUxPBXj2dxw0=
-
-Name: about.html
-SHA1-Digest: a9lDHrGuLPkvHBUhsqWU+V2mhPw=
-
-Name: META-INF/eclipse.inf
-SHA1-Digest: KyT9FF7C7t86NoBoa2kZT3ZJBfw=
-
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/eclipse.inf b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/eclipse.inf
deleted file mode 100644
index 7864d3c4c3..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/META-INF/eclipse.inf
+++ /dev/null
@@ -1,3 +0,0 @@
-#Processed using Jarprocessor
-pack200.args = -E4
-pack200.conditioned = true
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/about.html b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/about.html
deleted file mode 100644
index 395df3ba90..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/about.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
-<title>About</title>
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 5, 2006</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;).
-Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
-at <a href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
-being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor&rsquo;s license
-that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
-
-</body>
-</html> \ No newline at end of file
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/launcher.gtk.linux.x86.properties b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/launcher.gtk.linux.x86.properties
deleted file mode 100644
index 792485112e..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805/launcher.gtk.linux.x86.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2007 IBM Corporation and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# IBM Corporation - initial API and implementation
-###############################################################################
-pluginName = Equinox Launcher Linux X86 Fragment
-providerName = Eclipse.org
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar b/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
deleted file mode 100644
index 21cc2a6a07..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.preferences_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.equinox.preferences_3.2.0.jar
deleted file mode 100644
index 0ca4767ced..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.preferences_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.equinox.registry_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.equinox.registry_3.2.0.jar
deleted file mode 100644
index 750fab0e76..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.equinox.registry_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.help_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.help_3.2.0.jar
deleted file mode 100644
index 12ac13f918..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.help_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.jdt.launching.macosx_3.1.100.v20080422.jar b/M4-RCs/qpid/java/lib/org.eclipse.jdt.launching.macosx_3.1.100.v20080422.jar
deleted file mode 100644
index 26764dcfe7..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.jdt.launching.macosx_3.1.100.v20080422.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.jface_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.jface_3.2.0.jar
deleted file mode 100644
index 1d5035a859..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.jface_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar b/M4-RCs/qpid/java/lib/org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
deleted file mode 100644
index 673f3f5932..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.osgi_3.4.2.R34x_v20080826-1230.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.swt.carbon.macosx_3.4.1.v3449c.jar b/M4-RCs/qpid/java/lib/org.eclipse.swt.carbon.macosx_3.4.1.v3449c.jar
deleted file mode 100644
index d64249df6a..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.swt.carbon.macosx_3.4.1.v3449c.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.swt.gtk.linux.x86_3.4.1.v3449c.jar b/M4-RCs/qpid/java/lib/org.eclipse.swt.gtk.linux.x86_3.4.1.v3449c.jar
deleted file mode 100644
index cda22da341..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.swt.gtk.linux.x86_3.4.1.v3449c.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.swt.win32.win32.x86_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.swt.win32.win32.x86_3.2.0.jar
deleted file mode 100644
index 8fbebc2401..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.swt.win32.win32.x86_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.swt_3.4.1.v3449c.jar b/M4-RCs/qpid/java/lib/org.eclipse.swt_3.4.1.v3449c.jar
deleted file mode 100644
index 606abc5a3b..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.swt_3.4.1.v3449c.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.ui.forms_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.ui.forms_3.2.0.jar
deleted file mode 100644
index 460585e68b..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.ui.forms_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.ui.workbench_3.2.1.jar b/M4-RCs/qpid/java/lib/org.eclipse.ui.workbench_3.2.1.jar
deleted file mode 100644
index 4a10e210df..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.ui.workbench_3.2.1.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.eclipse.ui_3.2.0.jar b/M4-RCs/qpid/java/lib/org.eclipse.ui_3.2.0.jar
deleted file mode 100644
index b96dac530d..0000000000
--- a/M4-RCs/qpid/java/lib/org.eclipse.ui_3.2.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/org.osgi.core_1.0.0.jar b/M4-RCs/qpid/java/lib/org.osgi.core_1.0.0.jar
deleted file mode 100755
index dcddc09bc0..0000000000
--- a/M4-RCs/qpid/java/lib/org.osgi.core_1.0.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/slf4j-api-1.4.0.jar b/M4-RCs/qpid/java/lib/slf4j-api-1.4.0.jar
deleted file mode 100644
index 9ce2532aa4..0000000000
--- a/M4-RCs/qpid/java/lib/slf4j-api-1.4.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/slf4j-log4j12-1.4.0.jar b/M4-RCs/qpid/java/lib/slf4j-log4j12-1.4.0.jar
deleted file mode 100644
index e8e09f35ca..0000000000
--- a/M4-RCs/qpid/java/lib/slf4j-log4j12-1.4.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/lib/xalan-2.7.0.jar b/M4-RCs/qpid/java/lib/xalan-2.7.0.jar
deleted file mode 100644
index 007be3960a..0000000000
--- a/M4-RCs/qpid/java/lib/xalan-2.7.0.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/log4j-test.xml b/M4-RCs/qpid/java/log4j-test.xml
deleted file mode 100644
index c242286b70..0000000000
--- a/M4-RCs/qpid/java/log4j-test.xml
+++ /dev/null
@@ -1,53 +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.
--->
-
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Log4j configuration for unit tests -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
- <appender name="console" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out"/>
- <layout class="org.apache.log4j.PatternLayout">
- <param name="ConversionPattern" value="%t %d %p [%c{4}] %m%n"/>
- </layout>
- </appender>
-
- <logger name="org.apache.qpid">
- <level value="${amqj.logging.level}"/>
- </logger>
-
- <logger name="qpid.protocol">
- <level value="${amqj.protocol.logging.level}"/>
- </logger>
-
- <logger name="org.apache.qpid.test.utils.QpidTestCase">
- <level value="ALL"/>
- </logger>
-
- <root>
- <level value="${root.logging.level}"/>
- <appender-ref ref="console" />
- </root>
-</log4j:configuration>
diff --git a/M4-RCs/qpid/java/management/client/README.txt b/M4-RCs/qpid/java/management/client/README.txt
deleted file mode 100644
index 0c2a702a46..0000000000
--- a/M4-RCs/qpid/java/management/client/README.txt
+++ /dev/null
@@ -1,117 +0,0 @@
-1)DESCRIPTION
-Q-Man is a Management bridge that exposes one (or several) Qpid broker domain model as MBeans that are accessible through the Java Management Extensions (JMX).
-The following README content could be read also in http://cwiki.apache.org/confluence/display/qpid/Qman+Tool
-
-2)HOW TO RUN Q-Man
-
-2.1)PREREQUISITES
-QMan is a standalone application that is packaged as qpid-management-client-<version>.jar. To run QMan you need to add the following jars in your CLASSPATH:
-
-log4j-1.2.12.jar
-slf4j-api-1.4.0.jar
-slf4j-log4j12-1.4.0.jar
-commons-pool-1.4.jar
-commons-codec-1.3.jar
-commons-lang-2.2.jar
-commons-collections-3.2.jar
-commons-configuration-1.2.jar
-qpid-client-<version>.jar (were <version> is the current qpid version)
-qpid-common-<version>.jar (were <version> is the current qpid version)
-
-alternatively you can run the following script (that add all the qpid jars to the CLASSPATH):
-
-> CLASSPATH=`find <lib-root> -name '*.jar' | tr '\n' ":"`
-
-Where <lib-root> is the directory containing the qpid jars (when qpid is built from source <lib-root> is equal to qpid/java/build/lib)
-
-You should have in your classpath a log4j.xml configuration file too with a category defined as this :
-
-<category name="org.apache.qpid.management">
-<priority value="INFO"/>
-</category>
-
-2.2) CONFIGURATION
-QMan can be connected at run time against any broker. However if you wish to automatically connect to one or several brokers you can do so by providing a configuration file as follows:
-
-<configuration>
- <brokers>
- <broker>
- <host>localhost</host>
- <port>5672</port>
- <virtual-host>test</virtual-host>
- <user>guest</user>
- <password>guest</password>
- <max-pool-capacity>4</max-pool-capacity>
- <initial-pool-capacity>0</initial-pool-capacity>
- <max-wait-timeout>-1</max-wait-timeout>
- </broker>
- <broker>
- <host>myhost</host>
- <port>5672</port>
- <virtual-host>test</virtual-host>
- <user>guest</user>
- <password>guest</password>
- <max-pool-capacity>4</max-pool-capacity>
- <initial-pool-capacity>0</initial-pool-capacity>
- <max-wait-timeout>-1</max-wait-timeout>
- </broker>
- </brokers>
-</configuration>
-The configuration above specifies that QMan should connect to two brokers, one on localhos and one on myhost, both listening on port 5672.
-
-The configuration file to use is specified through the JVM parameter "qman-config" that must point onto a valid configuration file.
-
-2.3)RUNNING Q-Man
-
-To run QMan in a console run the following command:
-
-> java -Dcom.sun.management.jmxremote org.apache.qpid.management.domain.services.QMan
-
-Messages similar to those should be displayed:
-
-... [org.apache.qpid.management.domain.services.QMan] <QMAN-000001> : Starting Q-Man...
-...
-Type "q" to quit.
-
-if you wish to use a configuration file <home>/myconfiguration.xml so QMan establishes a connection with one or several brokers, run the following command:
-
-java -Dqman-config="<home>/myconfiguration.xml" org.apache.qpid.management.domain.services.QMan
-
-
-2.4) STOPPING Q-Man
-Type "q" In the console from which QMan has been started.
-
-3) Browsing Manageable Beans using JConsole
-The jconsole tool (JMX-compliant graphical tool for monitoring a Java virtual machine) can be used for monitoring and QMan Mbeans. for more information see http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html
-
-The jconsole executable can be found in JDK_HOME/bin, where JDK_HOME is the directory in which the JDK software is installed. If this directory is in your system path, you can start JConsole by simply typing jconsole in a console. Otherwise, you have to type the full path to the executable file.
-
-As jconsole needs to perform operations invocation you will need to add the QMan jar in jconsole classpath. In a console type:
-
-jconsole -J-Djava.class.path=$CLASSPATH:$JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools.jar
-Where CLASSPATH contains the QMan jars and JAVA_HOME point on your JDK home.
-
-NOte that in order to see QMan JVM on JConsole you need to add the following command line option to QMan launcher : -Dcom.sun.management.jmxremote
-
-4) Deploying Q-Man on JBoss
-QMan comes with a servlet that can be deployed in any application server. In the following we show how to deploy the qman servlet within JBoss application server.
-
-4.1) PREREQUISITES
-You mus install JBoss:
-
-- Download the latest stable version from: http://www.jboss.org/jbossas/downloads/
-- Unzip the download archive in <jboss-home>
-
-4.2) Deploying
-First you need to copy the provided qman.war in <jboss-home>/server/default/deploy/ (note that you can use another server configuration like for example minimal)
-
-Then run JBoss:
-
-Add the following option-Djboss.platform.mbeanserver to JAVA_OPTS (for example: export JAVA_OPTS=-Djboss.platform.mbeanserver)
-Execute <jboss-home>/binrun.sh (or run.bat on a windows platform)
-Notes:
-
-If you wish to configure QMan via a configuration file so QMan establishes a connection with one or several broker at starting time then add the options -Dqman-config=myconfigFile.xml to JAVA_OPTS.
-When Qpid is built form source, the war archive qman.war is located in qpid/java/build/management/client/servlet
-
-Enjoy!
diff --git a/M4-RCs/qpid/java/management/client/bin/qman b/M4-RCs/qpid/java/management/client/bin/qman
deleted file mode 100755
index 7352bb0388..0000000000
--- a/M4-RCs/qpid/java/management/client/bin/qman
+++ /dev/null
@@ -1,31 +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.
-#
-
-if [ "$QPID_LIB_PATH" = "" ] ; then
- QPID_LIB_PATH=/usr/share/java
-fi
-
-if [ "$QPID_CONFIG_PATH" = "" ] ; then
- QPID_CONFIG_PATH=/etc
-fi
-
-QMAN_CLASSPATH=`find $QPID_LIB_PATH | tr '\n' ":"`
-
-java -cp $QMAN_CLASSPATH -Dcom.sun.management.jmxremote -Dlog4j.configuration=qman.log4j -Dqman-config=$QPID_CONFIG_PATH/qman-config.xml org.apache.qpid.management.domain.services.QMan
diff --git a/M4-RCs/qpid/java/management/client/build.xml b/M4-RCs/qpid/java/management/client/build.xml
deleted file mode 100644
index bf32233214..0000000000
--- a/M4-RCs/qpid/java/management/client/build.xml
+++ /dev/null
@@ -1,66 +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.
- -
- -->
-<project name="Qpid Management Client" default="build">
-
- <property name="module.depends" value="client common"/>
-
- <import file="../../module.xml"/>
-
-
- <property name="servlet.war" value="qman.war"/>
- <property name="servlet.root" value="${module.build}/servlet"/>
- <property name="servlet.web-inf" value="${servlet.root}/WEB-INF"/>
- <property name="servlet.classes" value="${servlet.web-inf}/classes"/>
-
-
- <target name="servlet-prepare">
- <mkdir dir="${servlet.root}"/>
- <mkdir dir="${servlet.web-inf}"/>
- <mkdir dir="${servlet.classes}"/>
- <copy file="./web.xml" todir="${servlet.web-inf}" verbose="false"/>
- <copy todir="${servlet.classes}" verbose="false">
- <fileset dir="${module.classes}">
- <include name="org/apache/qpid/management/servlet/*"/>
- </fileset>
- </copy>
- <copy todir="${servlet.web-inf}">
- <fileset dir="${build}" includes="${module.libs}"/>
- </copy>
- <copy todir="${servlet.web-inf}/lib">
- <fileset dir="${build}/lib">
- <include name="qpid-client-*.jar"/>
- <include name="qpid-common-*.jar"/>
- <include name="qpid-management-client-*.jar"/>
- </fileset>
- </copy>
- </target>
-
- <target name="servlet-clean">
- <delete dir="${servlet.root}"/>
- </target>
-
- <target name="servlet">
- <jar destfile="${servlet.root}/${servlet.war}" basedir="${servlet.root}"/>
- </target>
-
- <target name="postbuild" depends="servlet-clean,servlet-prepare,servlet" description="run after a build"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/management/client/doc/man/qman b/M4-RCs/qpid/java/management/client/doc/man/qman
deleted file mode 100644
index cf4f90845c..0000000000
--- a/M4-RCs/qpid/java/management/client/doc/man/qman
+++ /dev/null
@@ -1,17 +0,0 @@
-.TH qman
-.SH NAME
-qman is a Management bridge that exposes one (or several) Qpid broker domain model as MBeans that are accessible through the Java Management Extensions (JMX). Once you run qman you need to start a JMX Console such as JConsole to browse the MBeans exposed by Q-Man.
-.SH SYNOPSIS
-qman
-.SH DESCRIPTION
-For more information on customizing QMan for your own environment please read http://cwiki.apache.org/confluence/display/qpid/Qman+Tool
-.SH Configuration
-.SS Classpath
-By default qman jars will be loaded from /usr/share/java. If you want to load from an alternative location you could specify it using QPID_LIB_PATH var.
-.SS Config file
-qman can be configured to connect to one or more brokers at startup by adding brokers in
-.I /etc/qman-config.xml
-If you want to load qman with qma-config.xml from a different location, you can specify it using QPID_CONFIG_PATH var.
-.SS log4j configuration
-qman expects qman.log4j file to be in the classpath. By default it will be put in
-.I /usr/share/java
diff --git a/M4-RCs/qpid/java/management/client/etc/qman-config.xml b/M4-RCs/qpid/java/management/client/etc/qman-config.xml
deleted file mode 100644
index 68ca3c6edf..0000000000
--- a/M4-RCs/qpid/java/management/client/etc/qman-config.xml
+++ /dev/null
@@ -1,47 +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.
- -
- -->
-
-<configuration>
- <brokers>
- <broker>
- <host>localhost</host>
- <port>5672</port>
- <virtual-host>test</virtual-host>
- <user>guest</user>
- <password>guest</password>
- <max-pool-capacity>4</max-pool-capacity>
- <initial-pool-capacity>0</initial-pool-capacity>
- <max-wait-timeout>-1</max-wait-timeout>
- </broker>
-<!--
- <broker>
- <host>myhost</host>
- <port>5672</port>
- <virtual-host>test</virtual-host>
- <user>guest</user>
- <password>guest</password>
- <max-pool-capacity>4</max-pool-capacity>
- <initial-pool-capacity>0</initial-pool-capacity>
- <max-wait-timeout>-1</max-wait-timeout>
- </broker>
--->
- </brokers>
-</configuration>
diff --git a/M4-RCs/qpid/java/management/client/etc/qman.log4j b/M4-RCs/qpid/java/management/client/etc/qman.log4j
deleted file mode 100644
index c2d0b050bb..0000000000
--- a/M4-RCs/qpid/java/management/client/etc/qman.log4j
+++ /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.
-#
-log4j.rootLogger=${root.logging.level}
-
-log4j.logger.org.apache.qpid=ERROR, console
-log4j.additivity.org.apache.qpid=false
-
-log4j.logger.org.apache.qpid.management.client=DEBUG, console
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=error
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n
-
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java
deleted file mode 100644
index 579b00c2db..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Messages.java
+++ /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.
- *
- */
-
-package org.apache.qpid.management;
-
-/**
- * Enumerative interfaces containing all QMan messages.
- *
- * @author Andrea Gazzarini
- */
-public interface Messages
-{
- // INFO
- String QMAN_000001_STARTING_QMAN = "<QMAN-000001> : Starting Q-Man...";
- String QMAN_000002_READING_CONFIGURATION = "<QMAN-000002> : Reading Q-Man configuration...";
- String QMAN_000003_CREATING_MANAGEMENT_CLIENTS = "<QMAN-000003> : Creating management client(s)...";
- String QMAN_000004_MANAGEMENT_CLIENT_CONNECTED = "<QMAN-000004> : Management client for broker %s successfully connected.";
- String QMAN_000005_TYPE_MAPPING_CONFIGURED = "<QMAN-000005> : Type mapping : code = %s associated to %s (validator class is %s)";
- String QMAN_000006_ACCESS_MODE_MAPPING_CONFIGURED = "<QMAN-000006> : Access Mode mapping : code = %s associated to %s";
- String QMAN_000007_MANAGEMENT_HANDLER_MAPPING_CONFIGURED = "<QMAN-000007> : Management Queue Message Handler Mapping : opcode = %s associated with %s";
- String QMAN_000008_METHOD_REPLY_HANDLER_MAPPING_CONFIGURED = "<QMAN-000008> : Method-Reply Queue Message Handler Mapping : opcode = %s associated with %s";
- String QMAN_000009_BROKER_DATA_CONFIGURED = "<QMAN-000009> : Broker configuration %s: %s";
- String QMAN_000010_INCOMING_SCHEMA = "<QMAN-000010> : Incoming schema for %s::%s.%s";
- String QMAN_000011_SHUTDOWN_INITIATED = "<QMAN-000011> : The shutdown sequence has been initiated for management client connected with broker %s";
- String QMAN_000012_MANAGEMENT_CLIENT_SHUT_DOWN = "<QMAN-000012> : Management client connected with broker %s shut down successfully.";
- String QMAN_000013_METHOD_REPLY_CONSUMER_INSTALLED = "<QMAN-000013> : Method-reply queue consumer has been successfully installed and bound on broker %s.";
- String QMAN_000014_MANAGEMENT_CONSUMER_INSTALLED ="<QMAN-000014> : Management queue consumer has been successfully installed and bound on broker %s.";
- String QMAN_000015_MANAGEMENT_QUEUE_DECLARED = "<QMAN-000015> : Management queue with name %s has been successfully declared and bound on broker %s.";
- String QMAN_000016_METHOD_REPLY_QUEUE_DECLARED = "<QMAN-000016> : Method-reply queue with name %s has been successfully declared and bound on broker %s.";
- String QMAN_000017_CONSUMER_HAS_BEEN_REMOVED = "<QMAN-000017> : Consumer %s has been removed from broker %s.";
- String QMAN_000018_QUEUE_UNDECLARED = "<QMAN-000018> : Queue %s has been removed from broker %s.";
- String QMAN_000019_QMAN_STARTED = "<QMAN-000019> : Q-Man open for e-business.";
- String QMAN_000020_SHUTTING_DOWN_QMAN = "<QMAN-000020> : Shutting down Q-Man...";
- String QMAN_000021_SHUT_DOWN = "<QMAN-000021> : Q-Man shut down.";
- String QMAN_000022_NO_BROKER_CONFIGURED = "<QMAN-000022> : Q-Man has no configured broker : in order to connect with a running one use Q-Man Administration interface.";
- String QMAN_000023_QMAN_REGISTERED_AS_MBEAN = "<QMAN-000023> : Q-Man service is now available on MBeanServer.";
-
- // DEBUG
- String QMAN_200001_INCOMING_MESSAGE_HAS_BEEN_RECEIVED = "<QMAN-200001> : New incoming message has been received. Message content is %s";
- String QMAN_200002_OPCODE_HANDLER_ASSOCIATION = "<QMAN-200002> : \"%s\" opcode is associated to handler %s";
- String QMAN_200003_MESSAGE_FORWARDING = "<QMAN-200003> : Incoming message with \"%s\" as opcode will be forwarded to %s for processing.";
- String QMAN_200004_MANAGEMENT_QUEUE_NAME = "<QMAN-200004> : Management queue name : %s";
- String QMAN_200005_METHOD_REPLY_QUEUE_NAME = "<QMAN-200005> : Method-reply queue name : %s";
- String QMAN_200006_QPID_CONNECTION_RELEASED = "<QMAN-200006> : Connection %s returned to the pool.";
- String QMAN_200007_TEST_CONNECTION_ON_RESERVE = "<QMAN-200007> : Test connection on reserve. Is valid? %s";
- String QMAN_200008_CONNECTION_DESTROYED = "<QMAN-200008> : Connection has been destroyed.";
- String QMAN_200009_CONNECTION_DESTROY_FAILURE = "<QMAN-200009> : Unable to destroy a connection object.";
- String QMAN_200010_EVENT_MBEAN_REGISTERED = "<QMAN-200010> : Event instance %s::%s::%s successfully registered with MBean Server with name %s";
- String QMAN_200011_OBJECT_MBEAN_REGISTERED = "<QMAN-200011> : Object instance %s::%s::%s:%s successfully registered with MBean Server with name %s";
- String QMAN_200012_OBJECT_MBEAN_UNREGISTERED = "<QMAN-200012> : Object instance %s::%s::%s:%s successfully unregistered from MBean Server. Name was %s";
- String QMAN_200013_ARGUMENT_VALUE_ENCODED = "<QMAN-200013> : Encoded value %S for argument %s. Type is %s";
- String QMAN_200014_INCOMING_INSTRUMENTATION_DATA = "<QMAN-200014> : Incoming instrumentation data for %s::%s.%s.%s";
- String QMAN_200015_INCOMING_CONFIGURATION_DATA = "<QMAN-200015> : Incoming configuration data for %s::%s.%s.%s";
- String QMAN_200016_PROPERTY_DEFINITION_HAS_BEEN_BUILT = "<QMAN-200016> : Property definition for %s::%s.%s has been built.";
- String QMAN_200017_STATISTIC_DEFINITION_HAS_BEEN_BUILT = "<QMAN-200017> : Statistic definition for %s::%s.%s has been built.";
- String QMAN_200018_OPTIONAL_PROPERTIES_INFO = "<QMAN-200018> : Class %s::%s.%s has %s optional properties.";
- String QMAN_200019_EVENT_ARGUMENT_DEFINITION_HAS_BEEN_BUILT = "<QMAN-200019> : Event argument definition for %s::%s.%s has been built.";
- String QMAN_200020_ENTITY_DEFINITION_HAS_BEEN_BUILT = "<QMAN-200020> : Entity definition has been built (without schema) for %s::%s.%s";
- String QMAN_200021_INCOMING_EVENT_DATA = "<QMAN-200021> : Incoming data for event %s::%s.%s";
- String QMAN_200022_VALIDATOR_INSTALLED = "<QMAN-200022> : Validator %s for type %s successfully installed.";
- String QMAN_200023_VALIDATOR_NOT_FOUND = "<QMAN-200023> : No validator was found for type %s. The default (empty) validator will be used.";
- String QMAN_200024_MANAGEMENT_MESSAGE_HAS_BEEN_SENT = "<QMAN-200024> : Message has been sent to management exchange. Message content : %s";
- String QMAN_200025_SUBSCRIPTION_DECLARED = "<QMAN-200025> : New subscription between queue %s and destination %s has been declared.";
- String QMAN_200026_SUBSCRIPTION_REMOVED = "<QMAN-200026> : Subscription named %s has been removed from remote broker.";
- String QMAN_200027_QUEUE_DECLARED = "<QMAN-200027> : New queue with name %s has been declared.";
- String QMAN_200028_QUEUE_REMOVED= "<QMAN-200028> : New queue with name %s has been undeclared.";
- String QMAN_200029_BINDING_DECLARED = "<QMAN-200029> : New binding with %s as routing key has been declared between queue %s and exchange %s.";
- String QMAN_200030_BINDING_REMOVED = "<QMAN-200030> : Binding with %s as routing key has been removed between queue %s and exchange %s.";
- String QMAN_200031_COMPOUND_MESSAGE_CONTAINS = "<QMAN-200031> : Incoming compound message contains %s message(s).";
- String QMAN_200032_COMMAND_MESSAGE_ROUTING_KEY = "<QMAN-200032> : Command message routing key : %s";
-
- // WARNING
- String QMAN_300001_MESSAGE_DISCARDED = "<QMAN-300001> : No handler has been configured for processing messages with \"%s\" as opcode. Message will be discarded.";
- String QMAN_300002_UNKNOWN_SEQUENCE_NUMBER = "<QMAN-300002> : Unable to deal with incoming message because it contains a unknown sequence number (%s).";
- String QMAN_300003_BROKER_ALREADY_CONNECTED = "<QMAN-300003> : Unable to enlist given broker connection data : QMan is already connected with broker %s";
- String QMAN_300004_INVALID_CONFIGURATION_FILE = "<QMAN-300004> : The given configuration file (%s) is not valid (it doesn't exist or cannot be read)";
-
- // ERROR
- String QMAN_100001_BAD_MAGIC_NUMBER_FAILURE = "<QMAN-100001> : Message processing failure : incoming message contains a bad magic number (%s) and therefore will be discaded.";
- String QMAN_100002_MESSAGE_READ_FAILURE = "<QMAN-100002> : Message I/O failure : unable to read byte message content and therefore it will be discarded.";
- String QMAN_100003_MESSAGE_PROCESS_FAILURE = "<QMAN-100003> : Message processing failure : unknown exception; see logs for more details.";
- String QMAN_100004_HANDLER_INITIALIZATION_FAILURE = "<QMAN-100004> : Message handler configured for opcode %s thrown an exception in initialization and therefore will be discarded.";
- String QMAN_100005_CLASS_SCHEMA_PROCESSING_FAILURE = "<QMAN-100005> : Q-Man was unable to process the schema response message.";
- String QMAN_100006_EVENT_SCHEMA_PROCESSING_FAILURE = "<QMAN-100006> : Q-Man was unable to process the schema response message.";
- String QMAN_100007_UNABLE_TO_CONNECT_WITH_BROKER = "<QMAN-100007> : Unable to connect with broker located on %s. This broker will be ignored.";
- String QMAN_100008_MANAGEMENT_MESSAGE_HANDLER_NOT_AVAILABLE = "<QMAN-100008> : Management Message Handler configured for opcode %s is not available and therefore will be discarded.";
- String QMAN_100009_METHOD_REPLY_MESSAGE_HANDLER_NOT_AVAILABLE = "<QMAN-100009> :Method-Reply Message Handler configured for opcode %s is not available and therefore will be discarded.";
- String QMAN_100010_METHOD_INVOCATION_RESULT_FAILURE = "<QMAN-100010> : an exception occurred while storing the result of a method invocation. Sequence number was %s";
- String QMAN_100011_UNKNOWN_CLASS_KIND = "<QMAN-100011> : Unknwon class kind : %s).";
- String QMAN_100012_SCHEMA_MESSAGE_PROCESSING_FAILURE = "<QMAN-100012> : Q-Man was unable to process the schema response message.";
- String QMAN_100013_MBEAN_REGISTRATION_FAILURE = "<QMAN-100013> : Unable to unregister object instance %s.";
- String QMAN_100014_ATTRIBUTE_DECODING_FAILURE = "<QMAN-100014> : Unable to decode value for attribute %s";
- String QMAN_100015_UNABLE_TO_SEND_SCHEMA_REQUEST = "<QMAN-100015> : Unable to send a schema request schema for %s.%s";
- String QMAN_100016_UNABLE_TO_DECODE_FEATURE_VALUE = "<QMAN-100016> : Unable to decode value for %s::%s::%s";
- String QMAN_100017_UNABLE_TO_CONNECT = "<QMAN-100017>: Cannot connect to broker %s on %s";
- String QMAN_100018_UNABLE_TO_STARTUP_CORRECTLY = "<QMAN-100018> : Q-Man was unable to startup correctly : see logs for further details.";
-
- // MESSAGES
- String EVENT_SEVERITY_ATTRIBUTE_DESCRIPTION = "Severity level for this event.";
- String EVENT_TIMESTAMP_ATTRIBUTE_DESCRIPTION = "Current timestamp of this event.";
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Names.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Names.java
deleted file mode 100644
index 7ed0f8b24d..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Names.java
+++ /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.
- *
- */
-package org.apache.qpid.management;
-
-/**
- * Enumeration of literal strings to avoid code duplication.
- *
- * @author Andrea Gazzarini
- */
-public interface Names
-{
- /** Name of the qpid management exchange. */
- String MANAGEMENT_EXCHANGE = "qpid.management";
- String MANAGEMENT_ROUTING_KEY = "console.#";
-
- String MANAGEMENT_QUEUE_PREFIX = "management.";
- String METHOD_REPLY_QUEUE_PREFIX = "reply.";
-
- String AMQ_DIRECT_QUEUE = "amq.direct";
- String AGENT_ROUTING_KEY_PREFIX = "agent.";
- String AGENT_ROUTING_KEY = AGENT_ROUTING_KEY_PREFIX+"1.0";
-
- // Attributes
- String PACKAGE = "package";
- String CLASS = "class";
- String OBJECT_ID="objectID";
- String BROKER_ID = "brokerID";
- String DOMAIN_NAME = "Q-MAN";
-
- String ARG_COUNT_PARAM_NAME = "argCount";
- String DEFAULT_PARAM_NAME ="default";
-
- String NUMBER_VALIDATOR = "org.apache.qpid.management.domain.model.QpidProperty$NumberValidator";
- String STRING_VALIDATOR = "org.apache.qpid.management.domain.model.QpidProperty$StringValidator";
-
- String QMAN_CONFIG_OPTION_NAME = "qman-config";
-
- String ADD_BROKER_OPERATION_NAME = "addBroker";
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Protocol.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Protocol.java
deleted file mode 100644
index 5b41785b11..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/Protocol.java
+++ /dev/null
@@ -1,47 +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.
- *
- */
-package org.apache.qpid.management;
-
-/**
- * Protocol defined constants.
- *
- * @author Andrea Gazzarini
- */
-public interface Protocol
-{
- String MAGIC_NUMBER = "AM2";
-
- char SCHEMA_REQUEST_OPCODE = 'S';
- char SCHEMA_RESPONSE_OPCODE = Character.toLowerCase(SCHEMA_REQUEST_OPCODE);
-
- char OPERATION_INVOCATION_REQUEST_OPCODE = 'M';
- char OPERATION_INVOCATION_RESPONSE_OPCODE = Character.toLowerCase(OPERATION_INVOCATION_REQUEST_OPCODE);
-
- char INSTRUMENTATION_CONTENT_RESPONSE_OPCODE = 'i';
- char CONFIGURATION_CONTENT_RESPONSE_OPCDE = 'c';
- char EVENT_CONTENT_RESPONSE_OPCDE = 'e';
- char INSTR_AND_CONFIG_CONTENT_RESPONSE_OPCODE = 'g';
-
- char HEARTBEAT_INDICATION_RESPONSE_OPCODE = 'h';
-
- int CLASS = 1;
- int EVENT = 2;
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/AccessModeMapping.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/AccessModeMapping.java
deleted file mode 100644
index af6aaa36bf..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/AccessModeMapping.java
+++ /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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-import org.apache.qpid.management.domain.model.AccessMode;
-
-/**
- * Class used to encapsulate a mapping between an access mode and a code.
- *
- * @author Andrea Gazzarini
- */
-class AccessModeMapping
-{
- private final int _code;
- private final AccessMode _accessMode;
-
- /**
- * Builds a new access mode mapping with the given parameters.
- *
- * @param code the access code.
- * @param accessMode the access mode.
- */
- AccessModeMapping(int code, AccessMode accessMode)
- {
- this._code = code;
- this._accessMode = accessMode;
- }
-
- /**
- * Returns the access mode of this mapping.
- *
- * @return the access mode of this mapping.
- */
- AccessMode getAccessMode ()
- {
- return _accessMode;
- }
-
- /**
- * Returns the code of this mapping.
- *
- * @return the code of this mapping.
- */
- int getCode ()
- {
- return _code;
- }
-
- /**
- * Returns a string representation of this mapping.
- * The returned string is indicating the code and the corresponding access mode.
- *
- * @return a string representation of this mapping.
- */
- @Override
- public String toString ()
- {
- return new StringBuilder()
- .append("AccessMode mapping (")
- .append(_code)
- .append(',')
- .append(_accessMode)
- .append(')').toString();
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerAlreadyConnectedException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerAlreadyConnectedException.java
deleted file mode 100644
index f23bf9d25e..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerAlreadyConnectedException.java
+++ /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.
- *
- */
-
-package org.apache.qpid.management.configuration;
-
-/**
- * Thrown when an attempt is made in order to connect QMan with an already connected broker.
- *
- * @author Andrea Gazzarini
- */
-public class BrokerAlreadyConnectedException extends Exception {
-
- private static final long serialVersionUID = -5082431738056504669L;
-
- private BrokerConnectionData _connectionData;
-
- /**
- * Builds a new exception with the given data.
- *
- * @param connectionData the broker connection data.
- */
- public BrokerAlreadyConnectedException(BrokerConnectionData connectionData) {
- this._connectionData = connectionData;
- }
-
- /**
- * Returns the connection data of the connected broker.
- *
- * @return the connection data of the connected broker.
- */
- public BrokerConnectionData getBrokerConnectionData()
- {
- return _connectionData;
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java
deleted file mode 100644
index be04c67555..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionData.java
+++ /dev/null
@@ -1,270 +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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-/**
- * Value object which is holding connection data for a specific broker.
- *
- * @author Andrea Gazzarini
- */
-public class BrokerConnectionData
-{
- private String _host;
- private int _port;
- private String _virtualHost;
- private String _username;
- private String _password;
- private int _maxPoolCapacity;
- private int _initialPoolCapacity;
- private long _maxWaitTimeout;
-
- /**
- * Builds a connection data with the given parameters.
- *
- * @param host the hostname where the broker is running.
- * @param port the port where the broker is running.
- * @param username the username for connecting with the broker.
- * @param password the password for connecting with the broker.
- * @param virtualHost the virtual host.
- * @param initialPoolCapacity the number of the connection that must be immediately opened.
- * @param maxPoolCapacity the maximum number of opened connection.
- * @param maxWaitTimeout the maximum amount of time that a client will wait for obtaining a connection.
- */
- public BrokerConnectionData(
- String host,
- int port,
- String virtualHost,
- String username,
- String password,
- int initialPoolCapacity,
- int maxPoolCapacity,
- long waitTimeout) {
-
- this._host = host;
- this._port = port;
- this._virtualHost = virtualHost;
- this._username = username;
- this._password = password;
- _maxPoolCapacity = maxPoolCapacity;
- _initialPoolCapacity = initialPoolCapacity;
- _maxWaitTimeout = waitTimeout;
- }
-
- /**
- * Builds a new empty broker connection data object.
- */
- BrokerConnectionData()
- {
- }
-
- /**
- * Sets the value of host property for this connection data.
- *
- * @param host the host name.
- */
- void setHost (String host)
- {
- this._host = host;
- }
-
- /**
- * Sets the value of port property for this connection data.
- *
- * @param port the port.
- */
- void setPort (String port)
- {
- this._port = Integer.parseInt(port);
- }
-
- /**
- * Sets the value of virtual host property for this connection data.
- *
- * @param virtualHost the virtual host.
- */
- void setVirtualHost (String virtualHost)
- {
- this._virtualHost = virtualHost;
- }
-
- /**
- * Sets the value of username property for this connection data.
- *
- * @param username the username.
- */
- void setUsername(String username)
- {
- this._username = username;
- }
-
- /**
- * Sets the value of password property for this connection data.
- *
- * @param password the password.
- */
- void setPassword(String password)
- {
- this._password = password;
- }
-
- /**
- * Returns the value of the host property.
- *
- * @return the value of the host property.
- */
- public String getHost ()
- {
- return _host;
- }
-
- /**
- * Returns the value of the port property.
- *
- * @return the value of the port property.
- */
- public int getPort ()
- {
- return _port;
- }
-
- /**
- * Returns the value of the virtual host property.
- *
- * @return the value of the virtual host property.
- */
- public String getVirtualHost ()
- {
- return _virtualHost;
- }
-
- /**
- * Returns the value of the username property.
- *
- * @return the value of the username property.
- */
- public String getUsername ()
- {
- return _username;
- }
-
- /**
- * Returns the value of the password property.
- *
- * @return the value of the password property.
- */
- public String getPassword ()
- {
- return _password;
- }
-
- // sofia:5663@pippo/sung1
- @Override
- public String toString ()
- {
- return new StringBuilder()
- .append(_host)
- .append(':')
- .append(_port)
- .append('@')
- .append(_virtualHost)
- .toString();
- }
-
- /**
- * Sets the max number of allowed connections that can be opened.
- *
- * @param value the max number of allowed connections that can be opened.
- * @throws NumberFormatException if the given value is not a valid integer.
- */
- public void setMaxPoolCapacity (String value)
- {
- _maxPoolCapacity = Integer.parseInt(value);
- }
-
- /**
- * Sets the max wait timeout for retrieving an available connections from the pool.
- *
- * @param value the max wait timeout for retrieving an available connections from the pool..
- * @throws NumberFormatException if the given value is not a valid long.
- */
- public void setMaxWaitTimeout (String value)
- {
- this._maxWaitTimeout = Long.parseLong(value);
- }
-
- /**
- * Returns the max number of allowed connections that can be opened.
- *
- * @return the max number of allowed connections that can be opened.
- */
- public int getMaxPoolCapacity ()
- {
- return _maxPoolCapacity;
- }
-
- /**
- * Returns the max wait timeout for retrieving an available connections from the pool.
- *
- * @return the max wait timeout for retrieving an available connections from the pool.
- */
- public long getMaxWaitTimeout ()
- {
- return _maxWaitTimeout;
- }
-
- /**
- * Sets the initial connection pool capacity.
- *
- * @param capacity the initial connection pool capacity.
- */
- public void setInitialPoolCapacity (String capacity)
- {
- _initialPoolCapacity = Integer.parseInt(capacity);
- }
-
- /**
- * Returns the initial connection pool capacity.
- *
- * @return the initial connection pool capacity.
- */
- public int getInitialPoolCapacity ()
- {
- return _initialPoolCapacity;
- }
-
- @Override
- public boolean equals(Object object) {
- try
- {
- BrokerConnectionData connectionData = (BrokerConnectionData) object;
- return (_host.equals(connectionData._host) )
- && (_port == connectionData._port)
- && (_virtualHost.equals(connectionData._virtualHost));
- } catch (Exception exception) {
- return false;
- }
- }
-
- @Override
- public int hashCode() {
- return _host.hashCode()+_port+_virtualHost.hashCode();
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionDataParser.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionDataParser.java
deleted file mode 100644
index 368970af00..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionDataParser.java
+++ /dev/null
@@ -1,137 +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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-import java.util.UUID;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Parser used for building access mode mappings.
- * For each access-mode-mappings/mapping element found in the configuration file, a new access mode mapping
- * is built and injected into the bridge configuration.
- *
- <broker>
- <host>192.168.148.131</host>
- <port>5672</port>
- <virtual-host>test</virtual-host>
- <user>guest</user>
- <password>guest</password>
- <max-pool-capacity>4</max-pool-capacity>
- <initial-pool-capacity>4</initial-pool-capacity>
- <max-wait-timeout>-1</max-wait-timeout>
- </broker>
- *
- * @author Andrea Gazzarini
- */
-class BrokerConnectionDataParser implements IParser
-{
- private final static Logger LOGGER = Logger.get(Configuration.class);
- private BrokerConnectionData _connectionData = new BrokerConnectionData();
- private String _currentValue;
-
- /**
- * Callback : the given value is the text content of the current node.
- */
- public void setCurrrentAttributeValue (String value)
- {
- this._currentValue = value;
- }
-
- /**
- * Callback: each time the end of an element is reached this method is called.
- * It's here that the built mapping is injected into the configuration.
- * <broker>
- <host>192.168.61.130</host>
- <port>5673</port>
- <virtual-host>test</virtual-host>
- <user>andrea</user>
- <password>andrea</password>
- </broker>
- */
- public void setCurrentAttributeName (String name)
- {
- switch (Tag.get(name))
- {
- case HOST:
- {
- _connectionData.setHost(_currentValue);
- break;
- }
- case PORT :
- {
- _connectionData.setPort(_currentValue);
- break;
- }
- case VIRTUAL_HOST:
- {
- _connectionData.setVirtualHost(_currentValue);
- break;
- }
- case USER :
- {
- _connectionData.setUsername(_currentValue);
- break;
- }
- case MAX_POOL_CAPACITY:
- {
- _connectionData.setMaxPoolCapacity (_currentValue);
- break;
- }
- case INITIAL_POOL_CAPACITY:
- {
- _connectionData.setInitialPoolCapacity(_currentValue);
- break;
- }
- case MAX_WAIT_TIMEOUT:
- {
- _connectionData.setMaxWaitTimeout(_currentValue);
- break;
- }
- case PASSWORD:
- {
- _connectionData.setPassword(_currentValue);
- break;
- }
- case BROKER:
- {
- try
- {
- Configuration.getInstance().addBrokerConnectionData(getUUId(),_connectionData);
- } catch(Exception exception)
- {
- LOGGER.error(exception, Messages.QMAN_100007_UNABLE_TO_CONNECT_WITH_BROKER, _connectionData);
- }
- _connectionData = new BrokerConnectionData();
- break;
- }
- }
- }
-
- /**
- * Gets an uuid in order to associate current connection data with a broker.
- * @return
- */
- UUID getUUId(){
- return UUID.randomUUID();
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionException.java
deleted file mode 100644
index 9294cf740e..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/BrokerConnectionException.java
+++ /dev/null
@@ -1,42 +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.
- *
- */
-
-package org.apache.qpid.management.configuration;
-
-/**
- * Thrown when a connection to a broker cannot be estabilished.
- *
- * @author Andrea Gazzarini
- */
-public class BrokerConnectionException extends Exception
-{
- private static final long serialVersionUID = 8170112238862494025L;
-
- /**
- * Builds a new exception with the given cause.
- *
- * @param cause the exception cause.
- */
- BrokerConnectionException(Throwable cause)
- {
- super(cause);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configuration.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configuration.java
deleted file mode 100644
index 12b3c6be9e..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configuration.java
+++ /dev/null
@@ -1,383 +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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.Map.Entry;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.SynchronousQueue;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.Names;
-import org.apache.qpid.management.domain.handler.base.IMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.InvocationResult;
-import org.apache.qpid.management.domain.model.AccessMode;
-import org.apache.qpid.management.domain.model.type.Type;
-import org.apache.qpid.transport.DeliveryProperties;
-import org.apache.qpid.transport.Header;
-import org.apache.qpid.transport.MessageProperties;
-import org.apache.qpid.transport.ReplyTo;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Qpid Management bridge configuration.
- * Basically iy is a singleton that is holding all the configurtion data loaded at startup.
- *
- * @author Andrea Gazzarini
- */
-public final class Configuration
-{
- private final static Logger LOGGER = Logger.get(Configuration.class);
- private static Configuration INSTANCE = new Configuration();
-
- Map<Integer, Type> _typeMappings = new HashMap<Integer,Type>();
- Map<Integer,AccessMode> _accessModes = new HashMap<Integer, AccessMode>();
- Map<Type,String> _validators = new HashMap<Type, String>();
-
- Map<UUID,BrokerConnectionData> _brokerConnectionInfos = new HashMap<UUID, BrokerConnectionData>();
-
- Map<Character, String> _managementQueueHandlers = new HashMap<Character, String>();
- Map<Character, String> _methodReplyQueueHandlers = new HashMap<Character, String>();
-
- private String _managementQueueName;
- private String _methodReplyQueueName;
-
- private Header _headerForCommandMessages;
- private DeliveryProperties _deliveryProperties = new DeliveryProperties();
- private MessageProperties _messageProperties = new MessageProperties();
- public BlockingQueue<InvocationResult> _resultExchangeChannel = new SynchronousQueue<InvocationResult>();
-
- // Private constructor.
- private Configuration()
- {
- defineQueueNames();
- createHeaderForCommandMessages();
- }
-
- /**
- * Returns the singleton instance.
- *
- * @return the singleton instance.
- */
- public static Configuration getInstance ()
- {
- return INSTANCE;
- }
-
- /**
- * Returns true if this configuration has at least one broker connection data.
- *
- * @return true if this configuration has at least one broker connection data.
- */
- public boolean hasOneOrMoreBrokersDefined()
- {
- return !_brokerConnectionInfos.isEmpty();
- }
-
- /**
- * Returns the type associated to the given code.
- *
- * @param code the code used as search criteria.
- * @return the type associated to the given code.
- * @throws UnknownTypeCodeException when the given code is not associated to any type.
- */
- public Type getType(int code) throws UnknownTypeCodeException
- {
- Type result = _typeMappings.get(code);
- if (result == null)
- {
- throw new UnknownTypeCodeException(code);
- }
- return result;
- }
-
- /**
- * Returns the access mode associated to the given code.
- *
- * @param code the code used as search criteria.
- * @return the access mode associated to the given code.
- * @throws UnknownAccessCodeException when the given code is not associated to any access mode.
- */
- public AccessMode getAccessMode(int code) throws UnknownAccessCodeException
- {
- AccessMode result = _accessModes.get(code);
- if (result == null)
- {
- throw new UnknownAccessCodeException(code);
- }
- return result;
- }
-
- /**
- * Returns the validator class name associated to the given type.
- *
- * @param type the type.
- * @return the validator class name associated to the given type.
- */
- public String getValidatorClassName (Type type)
- {
- return _validators.get(type);
- }
-
- /**
- * Gets from this configuration the list of known broker (I mean, only their connection data).
- *
- * @return the list of known broker
- */
- public Set<Entry<UUID, BrokerConnectionData>> getConnectionInfos(){
- return _brokerConnectionInfos.entrySet();
- }
-
- /**
- * Gets from this configuration the connection data of the broker associated with the given id.
- *
- * @param brokerId the broker identifier.
- * @return the connection data of the broker associated with the given id.
- * @throws UnknownBrokerException when the given id is not associated with any broker.
- */
- public BrokerConnectionData getBrokerConnectionData (UUID brokerId) throws UnknownBrokerException
- {
- BrokerConnectionData connectionData = _brokerConnectionInfos.get(brokerId);
- if (connectionData == null)
- {
- throw new UnknownBrokerException(brokerId);
- }
- return _brokerConnectionInfos.get(brokerId);
- }
-
- /**
- * Returns the name of the management queue.
- *
- * @return the name of the management queue.
- */
- public String getManagementQueueName() {
- return _managementQueueName;
- }
-
- /**
- * Returns the name of the method-reply queue.
- *
- * @return the name of the method-reply queue.
- */
- public String getMethodReplyQueueName() {
- return _methodReplyQueueName;
- }
-
- /**
- * Returns a map containing all the configured management message handlers.
- * A management message handler it is a basically a processor for a management queue incoming message associated
- * with a specific opcode.
- *
- * @return a map containing all the configured management message handlers.
- */
- public Map<Character, IMessageHandler> getManagementQueueHandlers()
- {
- Map<Character, IMessageHandler> result = new HashMap<Character, IMessageHandler>();
-
- for (Entry<Character, String> entry : _managementQueueHandlers.entrySet())
- {
- Character opcode = entry.getKey();
- String className = entry.getValue();
- try
- {
- result.put(opcode, (IMessageHandler)Class.forName(className).newInstance());
- } catch(Exception exception)
- {
- LOGGER.error(exception,Messages.QMAN_100008_MANAGEMENT_MESSAGE_HANDLER_NOT_AVAILABLE,opcode);
- }
- }
- return result;
- }
-
- /**
- * Returns a map containing all the configured method-reply message handlers.
- * A management message handler it is a basically a processor for a method-reply queue incoming message associated
- * with a specific opcode.
- *
- * @return a map containing all the configured method-reply message handlers.
- */
- public Map<Character, IMessageHandler> getMethodReplyQueueHandlers()
- {
- Map<Character, IMessageHandler> result = new HashMap<Character, IMessageHandler>();
-
- for (Entry<Character, String> entry : _methodReplyQueueHandlers.entrySet())
- {
- Character opcode = entry.getKey();
- String className = entry.getValue();
- try
- {
- result.put(opcode, (IMessageHandler)Class.forName(className).newInstance());
- } catch(Exception exception)
- {
- LOGGER.error(exception,Messages.QMAN_100009_METHOD_REPLY_MESSAGE_HANDLER_NOT_AVAILABLE,opcode);
- }
- }
- return result;
- }
-
- /**
- * Returns the message header used for sending command message on management queue.
- *
- * @return the message header used for sending command message on management queue.
- */
- public Header getCommandMessageHeader ()
- {
- return _headerForCommandMessages;
- }
-
- /**
- * Returns the command message properties.
- *
- * @return the command message properties.
- */
- public MessageProperties getCommandMessageProperties ()
- {
- return _messageProperties;
- }
-
- /**
- * Returns the command message delivery properties.
- *
- * @return the command message delivery properties.
- */
- public DeliveryProperties getCommandDeliveryProperties ()
- {
- return _deliveryProperties;
- }
-
- /**
- * Adds a new type mapping to this configuration.
- *
- * @param mapping the type mapping that will be added.
- */
- void addTypeMapping(TypeMapping mapping) {
- int code = mapping.getCode();
- Type type = mapping.getType();
- String validatorClassName = mapping.getValidatorClassName();
- _typeMappings.put(code, type);
- _validators.put(type, validatorClassName);
-
- LOGGER.info(Messages.QMAN_000005_TYPE_MAPPING_CONFIGURED, code,type,validatorClassName);
- }
-
- /**
- * Adds a new access mode mapping to this configuration.
- *
- * @param mapping the mapping that will be added.
- */
- void addAccessModeMapping(AccessModeMapping mapping){
- int code = mapping.getCode();
- AccessMode accessMode = mapping.getAccessMode();
- _accessModes.put(code, accessMode);
-
- LOGGER.info(Messages.QMAN_000006_ACCESS_MODE_MAPPING_CONFIGURED, code,accessMode);
- }
-
- /**
- * Adds a new management message handler to this configuration.
- * The incoming mapping object will contains an opcode and the class (as a string) of the message handler that will be used
- * for processing incoming messages with that opcode.
- *
- * @param mapping the message handler mapping.
- */
- void addManagementMessageHandlerMapping (MessageHandlerMapping mapping)
- {
- Character opcode = mapping.getOpcode();
- String handlerClass = mapping.getMessageHandlerClass();
- _managementQueueHandlers.put(opcode, handlerClass);
-
- LOGGER.info(Messages.QMAN_000007_MANAGEMENT_HANDLER_MAPPING_CONFIGURED, opcode,handlerClass);
- }
-
- /**
- * Adds a new method-reply message handler to this configuration.
- * The incoming mapping object will contains an opcode and the class (as a string) of the message handler that will be used
- * for processing incoming messages with that opcode.
- *
- * @param mapping the message handler mapping.
- */
- void addMethodReplyMessageHandlerMapping (MessageHandlerMapping mapping)
- {
- Character opcode = mapping.getOpcode();
- String handlerClass = mapping.getMessageHandlerClass();
- _methodReplyQueueHandlers.put(opcode, handlerClass);
-
- LOGGER.info(Messages.QMAN_000008_METHOD_REPLY_HANDLER_MAPPING_CONFIGURED, opcode,handlerClass);
- }
-
- /**
- * Adds to this configuration a new broker connection data.
- *
- * @param brokerId the broker identifier.
- * @param connectionData the connection data.
- * @throws BrokerAlreadyConnectedException when the broker is already connected.
- * @throws BrokerConnectionException when a connection cannot be estabilished.
- */
- void addBrokerConnectionData (UUID brokerId, BrokerConnectionData connectionData) throws BrokerAlreadyConnectedException, BrokerConnectionException
- {
- if (_brokerConnectionInfos.containsValue(connectionData))
- {
- throw new BrokerAlreadyConnectedException(connectionData);
- }
-
- try
- {
- QpidDatasource.getInstance().addConnectionPool(brokerId, connectionData);
- _brokerConnectionInfos.put(brokerId,connectionData);
-
- LOGGER.info(Messages.QMAN_000009_BROKER_DATA_CONFIGURED,brokerId,connectionData);
- } catch(Exception exception)
- {
- throw new BrokerConnectionException(exception);
- }
-
- }
-
- /**
- * Header for command messages is created once because it only contains static values.
- */
- private void createHeaderForCommandMessages ()
- {
- ReplyTo replyTo=new ReplyTo();
- replyTo.setRoutingKey(_methodReplyQueueName);
- _messageProperties.setReplyTo(replyTo);
- _deliveryProperties.setRoutingKey(Names.AGENT_ROUTING_KEY);
- _headerForCommandMessages = new Header(_deliveryProperties, _messageProperties);
- }
-
- /**
- * Creates the name of the queues used by this service.
- * This is done because if a broker should be managed by one or more management client, then each of them
- * must have its own channels to communicate with.
- */
- private void defineQueueNames()
- {
- UUID uuid = UUID.randomUUID();
- _managementQueueName = Names.MANAGEMENT_QUEUE_PREFIX+uuid;
- _methodReplyQueueName = Names.METHOD_REPLY_QUEUE_PREFIX+uuid;
-
- LOGGER.debug(Messages.QMAN_200004_MANAGEMENT_QUEUE_NAME,_managementQueueName);
- LOGGER.debug(Messages.QMAN_200005_METHOD_REPLY_QUEUE_NAME,_methodReplyQueueName);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/ConfigurationException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/ConfigurationException.java
deleted file mode 100644
index 6eed515e11..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/ConfigurationException.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-/**
- * Thrown when a problem is encountered during building the configuration.
- *
- * @author Andrea Gazzarini
- */
-public class ConfigurationException extends Exception
-{
- private static final long serialVersionUID = 8238481177714286259L;
-
- public ConfigurationException(String msg)
- {
- super(msg);
- }
-
- /**
- * Builds a new ConfigurationException with the given cause.
- *
- * @param exception the exception cause.
- */
- public ConfigurationException(Exception exception)
- {
- super(exception);
- }
-
- public ConfigurationException(String msg,Exception exception)
- {
- super(msg,exception);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configurator.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configurator.java
deleted file mode 100644
index 0051b19c99..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Configurator.java
+++ /dev/null
@@ -1,287 +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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
-import java.util.UUID;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.Names;
-import org.apache.qpid.management.Protocol;
-import org.apache.qpid.management.domain.handler.impl.ConfigurationMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.EventContentMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.HeartBeatIndicationMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.InstrumentationMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.MethodResponseMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.SchemaResponseMessageHandler;
-import org.apache.qpid.management.domain.model.AccessMode;
-import org.apache.qpid.management.domain.model.type.AbsTime;
-import org.apache.qpid.management.domain.model.type.DeltaTime;
-import org.apache.qpid.management.domain.model.type.Int16;
-import org.apache.qpid.management.domain.model.type.Int32;
-import org.apache.qpid.management.domain.model.type.Int64;
-import org.apache.qpid.management.domain.model.type.Int8;
-import org.apache.qpid.management.domain.model.type.ObjectReference;
-import org.apache.qpid.management.domain.model.type.Str16;
-import org.apache.qpid.management.domain.model.type.Str8;
-import org.apache.qpid.management.domain.model.type.Uint16;
-import org.apache.qpid.management.domain.model.type.Uint32;
-import org.apache.qpid.management.domain.model.type.Uint64;
-import org.apache.qpid.management.domain.model.type.Uint8;
-import org.apache.qpid.transport.util.Logger;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * Director used for coordinating the build process of configuration.
- * This is the only component which has a read-write permission on Configuration object.
- *
- * @author Andrea Gazzarini
- */
-public class Configurator extends DefaultHandler
-{
- private final static Logger LOGGER = Logger.get(Configurator.class);
-
- /**
- * Default (empty) parser used when there's no need to process data (non relevant elements).
- */
- final static IParser DEFAULT_PARSER = new IParser() {
-
- public void setCurrrentAttributeValue (String value)
- {
- }
-
- public void setCurrentAttributeName (String name)
- {
- }
- };
-
- IParser _brokerConfigurationParser = new BrokerConnectionDataParser();
- IParser _currentParser = DEFAULT_PARSER;
-
- /**
- * Delegates the processing to the current parser.
- */
- @Override
- public void characters (char[] ch, int start, int length) throws SAXException
- {
- String value = new String(ch,start,length).trim();
- if (value.length() != 0) {
- _currentParser.setCurrrentAttributeValue(value);
- }
- }
-
- /**
- * Here is defined what parser needs to be used for processing the current data.
- */
- @Override
- public void startElement (String uri, String localName, String name, Attributes attributes) throws SAXException
- {
- switch(Tag.get(name)) {
- case BROKERS:
- {
- _currentParser = _brokerConfigurationParser;
- break;
- }
- }
- }
-
- @Override
- public void endElement (String uri, String localName, String name) throws SAXException
- {
- _currentParser.setCurrentAttributeName(name);
- }
-
- /**
- * Builds whole configuration.
- *
- * @throws ConfigurationException when the build fails.
- */
- public void configure() throws ConfigurationException
- {
- BufferedReader reader = null;
- try
- {
- String initialConfigFileName = System.getProperty(Names.QMAN_CONFIG_OPTION_NAME);
- if (initialConfigFileName != null && initialConfigFileName.trim().length() != 0)
- {
- File initialConfigurationFile = new File(initialConfigFileName);
- if (initialConfigurationFile.canRead())
- {
- SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
- reader = new BufferedReader(new InputStreamReader(new FileInputStream(initialConfigFileName)));
- InputSource source = new InputSource(reader);
- parser.parse(source, this);
- } else {
- LOGGER.warn(Messages.QMAN_300004_INVALID_CONFIGURATION_FILE, initialConfigFileName);
- throw new ConfigurationException(String.format(Messages.QMAN_300004_INVALID_CONFIGURATION_FILE, initialConfigFileName));
- }
- }
-
- addTypeMappings();
- addAccessModeMappings();
-
- addMandatoryManagementMessageHandlers();
- addMandatoryMethodReplyMessageHandlers();
- } catch (Exception exception)
- {
- throw new ConfigurationException(exception);
- } finally
- {
- try
- {
- reader.close();
- } catch (Exception ignore)
- {
- }
- }
- }
-
- /**
- * Creates and return a value object (BrokerConnectionData) with the given parameters.
- * Note that that object will be stored on configuration and it could be used to set a connection with the broker.
- * This happens when the "initialPoolCapacity" is greater than 0 : in this case the caller is indicatinf that it wants to open
- * one or more connections immediately at startup and therefore Q-Man will try to do that.
- *
- * @param host the hostname where the broker is running.
- * @param port the port where the broker is running.
- * @param username the username for connecting with the broker.
- * @param password the password for connecting with the broker.
- * @param virtualHost the virtual host.
- * @param initialPoolCapacity the number of the connection that must be immediately opened.
- * @param maxPoolCapacity the maximum number of opened connection.
- * @param maxWaitTimeout the maximum amount of time that a client will wait for obtaining a connection.
- * @return the value object containing the data above.
- * @throws BrokerAlreadyConnectedException when the broker is already connected.
- * @throws BrokerConnectionException when a connection cannot be estabilished.
- */
- public BrokerConnectionData createAndReturnBrokerConnectionData(
- UUID brokerId,
- String host,
- int port,
- String username,
- String password,
- String virtualHost,
- int initialPoolCapacity,
- int maxPoolCapacity,
- long maxWaitTimeout) throws BrokerAlreadyConnectedException, BrokerConnectionException
- {
- BrokerConnectionData data = new BrokerConnectionData(
- host,
- port,
- virtualHost,
- username,
- password,
- initialPoolCapacity,
- maxPoolCapacity,
- maxWaitTimeout);
- Configuration.getInstance().addBrokerConnectionData(brokerId, data);
- return data;
- }
-
- /**
- * Configures access mode mappings.
- * An access mode mapping is an association between a code and an access mode.
- */
- private void addAccessModeMappings() {
- Configuration configuration = Configuration.getInstance();
- configuration.addAccessModeMapping(new AccessModeMapping(1,AccessMode.RC));
- configuration.addAccessModeMapping(new AccessModeMapping(2,AccessMode.RW));
- configuration.addAccessModeMapping(new AccessModeMapping(3,AccessMode.RO));
- }
-
- /**
- * Configures type mappings.
- * A type mapping is an association between a code and a management type.
- */
- private void addTypeMappings()
- {
- Configuration configuration = Configuration.getInstance();
- configuration.addTypeMapping(new TypeMapping(1,new Uint8(),Names.NUMBER_VALIDATOR));
- configuration.addTypeMapping(new TypeMapping(2,new Uint16(),Names.NUMBER_VALIDATOR));
- configuration.addTypeMapping(new TypeMapping(3,new Uint32(),Names.NUMBER_VALIDATOR));
- configuration.addTypeMapping(new TypeMapping(4,new Uint64(),Names.NUMBER_VALIDATOR));
- configuration.addTypeMapping(new TypeMapping(6,new Str8(),Names.STRING_VALIDATOR));
- configuration.addTypeMapping(new TypeMapping(7,new Str16(),Names.STRING_VALIDATOR));
- configuration.addTypeMapping(new TypeMapping(8,new AbsTime()));
- configuration.addTypeMapping(new TypeMapping(9,new DeltaTime()));
- configuration.addTypeMapping(new TypeMapping(10,new ObjectReference()));
- configuration.addTypeMapping(new TypeMapping(11,new org.apache.qpid.management.domain.model.type.Boolean()));
- configuration.addTypeMapping(new TypeMapping(12,new org.apache.qpid.management.domain.model.type.Float(),Names.NUMBER_VALIDATOR));
- configuration.addTypeMapping(new TypeMapping(13,new org.apache.qpid.management.domain.model.type.Double(),Names.NUMBER_VALIDATOR));
- configuration.addTypeMapping(new TypeMapping(14,new org.apache.qpid.management.domain.model.type.Uuid()));
- configuration.addTypeMapping(new TypeMapping(15,new org.apache.qpid.management.domain.model.type.Map()));
- configuration.addTypeMapping(new TypeMapping(16,new Int8(),Names.NUMBER_VALIDATOR));
- configuration.addTypeMapping(new TypeMapping(17,new Int16(),Names.NUMBER_VALIDATOR));
- configuration.addTypeMapping(new TypeMapping(18,new Int32(),Names.NUMBER_VALIDATOR));
- configuration.addTypeMapping(new TypeMapping(19,new Int64(),Names.NUMBER_VALIDATOR));
- }
-
- /**
- * Configures the mandatory management message handlers.
- */
- private void addMandatoryMethodReplyMessageHandlers ()
- {
- Configuration.getInstance().addMethodReplyMessageHandlerMapping(
- new MessageHandlerMapping(
- Protocol.OPERATION_INVOCATION_RESPONSE_OPCODE,
- MethodResponseMessageHandler.class.getName()));
-
- Configuration.getInstance().addMethodReplyMessageHandlerMapping(
- new MessageHandlerMapping(
- Protocol.SCHEMA_RESPONSE_OPCODE,
- SchemaResponseMessageHandler.class.getName()));
- }
-
- /**
- * Configures the mandatory management message handlers.
- */
- private void addMandatoryManagementMessageHandlers ()
- {
- Configuration.getInstance().addManagementMessageHandlerMapping(
- new MessageHandlerMapping(
- Protocol.INSTRUMENTATION_CONTENT_RESPONSE_OPCODE,
- InstrumentationMessageHandler.class.getName()));
-
- Configuration.getInstance().addManagementMessageHandlerMapping(
- new MessageHandlerMapping(
- Protocol.CONFIGURATION_CONTENT_RESPONSE_OPCDE,
- ConfigurationMessageHandler.class.getName()));
-
- Configuration.getInstance().addManagementMessageHandlerMapping(
- new MessageHandlerMapping(
- Protocol.EVENT_CONTENT_RESPONSE_OPCDE,
- EventContentMessageHandler.class.getName()));
-
- Configuration.getInstance().addManagementMessageHandlerMapping(
- new MessageHandlerMapping(
- Protocol.HEARTBEAT_INDICATION_RESPONSE_OPCODE,
- HeartBeatIndicationMessageHandler.class.getName()));
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/IParser.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/IParser.java
deleted file mode 100644
index a221686765..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/IParser.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-/**
- * Interface definition for configuration parser
- * Concrete implementors are responsible for parsing a specific XML part of configuration data.
- *
- * @author Andrea Gazzarini
- */
-interface IParser
-{
- /**
- * Main director callback : Sets the name of the current attribute.
- *
- * @param name the name of the current attribute.
- */
- void setCurrentAttributeName(String name);
-
- /**
- * Main director callback : sets the value of the current attribute.
- *
- * @param value the value of the current attribute.
- */
- void setCurrrentAttributeValue(String value);
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/MessageHandlerMapping.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/MessageHandlerMapping.java
deleted file mode 100644
index 5e38346a2d..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/MessageHandlerMapping.java
+++ /dev/null
@@ -1,90 +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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-/**
- * Message Handler mapping used for associating an opcode with a message handler.
- *
- * @author Andrea Gazzarini
- */
-class MessageHandlerMapping
-{
- private Character _opcode;
- private String _handlerClass;
-
- /**
- * Builds an empty message handler mapping.
- */
- MessageHandlerMapping()
- {
- }
-
- /**
- * Builds a new mapping with the given opcode and handler class.
- *
- * @param opcode the opcode.
- * @param handlerClass the handler class.
- */
- MessageHandlerMapping(Character opcode, String handlerClass) {
- this._opcode = opcode;
- this._handlerClass = handlerClass;
- }
-
- /**
- * Returns the opcode of this mapping.
- *
- * @return the code of this mapping.
- */
- Character getOpcode ()
- {
- return _opcode;
- }
-
- /**
- * Sets the opcode for this mapping.
- *
- * @param codeAsString the opcode as a string.
- */
- void setOpcode (String codeAsString)
- {
- this._opcode = codeAsString.charAt(0);
- }
-
- /**
- * Returns the message handler for this mapping.
- *
- * @return the message handler for this mapping.
- */
- String getMessageHandlerClass()
- {
- return _handlerClass;
- }
-
- /**
- * Sets the message handler of this mapping.
- *
- * @param handlerClass the handler class as a string.
- */
- void setMessageHandlerClass(String handlerClass)
- {
- this._handlerClass = handlerClass;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/QpidDatasource.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/QpidDatasource.java
deleted file mode 100644
index 569a65a782..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/QpidDatasource.java
+++ /dev/null
@@ -1,249 +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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.commons.pool.BasePoolableObjectFactory;
-import org.apache.commons.pool.ObjectPool;
-import org.apache.commons.pool.impl.GenericObjectPool;
-import org.apache.commons.pool.impl.GenericObjectPoolFactory;
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.ConnectionException;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Qpid datasource.
- * Basically it is a connection pool manager used for optimizing broker connections usage.
- *
- * @author Andrea Gazzarini
- */
-public final class QpidDatasource
-{
- private final static Logger LOGGER = Logger.get(QpidDatasource.class);
-
- /**
- * A connection decorator used for adding pool interaction behaviour to an existing connection.
- *
- * @author Andrea Gazzarini
- */
- class PooledConnection extends Connection
- {
- private final UUID _brokerId;
- private boolean _valid;
-
- /**
- * Builds a new decorator with the given connection.
- *
- * @param brokerId the broker identifier.
- */
- private PooledConnection(UUID brokerId)
- {
- this._brokerId = brokerId;
- _valid = true;
- }
-
- /**
- * Returns true if the underlying connection is still valid and can be used.
- *
- * @return true if the underlying connection is still valid and can be used.
- */
- boolean isValid()
- {
- return _valid;
- }
-
- void reallyClose()
- {
- super.close();
- }
-
- /**
- * Returns the connection to the pool. That is, marks this connections as available.
- * After that, this connection will be available for further operations.
- */
- public void close()
- {
- try
- {
- pools.get(_brokerId).returnObject(this);
-
- LOGGER.debug(Messages.QMAN_200006_QPID_CONNECTION_RELEASED, this);
- }
- catch (Exception e)
- {
- throw new ConnectionException(e);
- }
- }
-
- public void exception(Throwable t)
- {
- //super.exception(t);
- _valid = false;
- }
- }
-
- /**
- * This is the connection factory, that is, the factory used to manage the lifecycle (create, validate & destroy) of
- * the broker connection(s).
- *
- * @author Andrea Gazzarini
- */
- class QpidConnectionFactory extends BasePoolableObjectFactory
- {
- private final BrokerConnectionData _connectionData;
- private final UUID _brokerId;
-
- /**
- * Builds a new connection factory with the given parameters.
- *
- * @param brokerId the broker identifier.
- * @param connectionData the connecton data.
- */
- private QpidConnectionFactory(UUID brokerId, BrokerConnectionData connectionData)
- {
- this._connectionData = connectionData;
- this._brokerId = brokerId;
- }
-
- /**
- * Creates a new underlying connection.
- */
- @Override
- public Connection makeObject () throws Exception
- {
- PooledConnection connection = new PooledConnection(_brokerId);
- connection.connect(
- _connectionData.getHost(),
- _connectionData.getPort(),
- _connectionData.getVirtualHost(),
- _connectionData.getUsername(),
- _connectionData.getPassword(),
- false);
- return connection;
- }
-
- /**
- * Validates the underlying connection.
- */
- @Override
- public boolean validateObject (Object obj)
- {
- PooledConnection connection = (PooledConnection) obj;
- boolean isValid = connection.isValid();
-
- LOGGER.debug(Messages.QMAN_200007_TEST_CONNECTION_ON_RESERVE,isValid);
-
- return isValid;
- }
-
- /**
- * Closes the underlying connection.
- */
- @Override
- public void destroyObject (Object obj) throws Exception
- {
- try
- {
- PooledConnection connection = (PooledConnection) obj;
- connection.reallyClose();
-
- LOGGER.debug(Messages.QMAN_200008_CONNECTION_DESTROYED);
- } catch (Exception exception)
- {
- LOGGER.debug(exception, Messages.QMAN_200009_CONNECTION_DESTROY_FAILURE);
- }
- }
- }
-
- // Singleton instance.
- private static QpidDatasource instance = new QpidDatasource();
-
- // Each entry contains a connection pool for a specific broker.
- private Map<UUID, ObjectPool> pools = new HashMap<UUID, ObjectPool>();
-
- // Private constructor.
- private QpidDatasource()
- {
- }
-
- /**
- * Gets an available connection from the pool of the given broker.
- *
- * @param brokerId the broker identifier.
- * @return a valid connection to the broker associated with the given identifier.
- */
- public Connection getConnection(UUID brokerId) throws Exception
- {
- return (Connection) pools.get(brokerId).borrowObject();
- }
-
- /**
- * Entry point method for retrieving the singleton instance of this datasource.
- *
- * @return the qpid datasource singleton instance.
- */
- public static QpidDatasource getInstance()
- {
- return instance;
- }
-
- /**
- * Adds a connection pool to this datasource.
- *
- * @param brokerId the broker identifier that will be associated with the new connection pool.
- * @param connectionData the broker connection data.
- * @throws Exception when the pool cannot be created.
- */
- void addConnectionPool(UUID brokerId,BrokerConnectionData connectionData) throws Exception
- {
- GenericObjectPoolFactory factory = new GenericObjectPoolFactory(
- new QpidConnectionFactory(brokerId,connectionData),
- connectionData.getMaxPoolCapacity(),
- GenericObjectPool.WHEN_EXHAUSTED_BLOCK,
- connectionData.getMaxWaitTimeout(),-1,
- true,
- false);
-
- ObjectPool pool = factory.createPool();
-
- // Open connections at startup according to initial capacity param value.
- int howManyConnectionAtStartup = connectionData.getInitialPoolCapacity();
- Object [] openStartupList = new Object[howManyConnectionAtStartup];
-
- // Open...
- for (int index = 0; index < howManyConnectionAtStartup; index++)
- {
- openStartupList[index] = pool.borrowObject();
- }
-
- // ...and immediately return them to pool. In this way the pooled connection has been opened.
- for (int index = 0; index < howManyConnectionAtStartup; index++)
- {
- pool.returnObject(openStartupList[index]);
- }
-
- pools.put(brokerId,pool);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Tag.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Tag.java
deleted file mode 100644
index 7ff23c9d13..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/Tag.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-
-package org.apache.qpid.management.configuration;
-
-/**
- * Configuration Tag catalogue.
- *
- * @author Andrea Gazzarini
- */
-public enum Tag {
- CONFIGURATION { @Override public String toString() { return "configuration"; }},
- BROKER { @Override public String toString() { return "broker"; }},
- HOST { @Override public String toString() { return "host"; }},
- PORT { @Override public String toString() { return "port"; }},
- MAX_POOL_CAPACITY { @Override public String toString() { return "max-pool-capacity"; }},
- MAX_WAIT_TIMEOUT { @Override public String toString() { return "max-wait-timeout"; }},
- INITIAL_POOL_CAPACITY { @Override public String toString() { return "initial-pool-capacity"; }},
- VIRTUAL_HOST { @Override public String toString() { return "virtual-host"; }},
- USER { @Override public String toString() { return "user"; }},
- PASSWORD { @Override public String toString() { return "password"; }},
- BROKERS { @Override public String toString() { return "brokers"; }};
-
- /**
- * Returns the enum entry associated to the given tag name.
- *
- * @param name the name of tag.
- * @return the enum entry associated to the given tag name.
- */
- public static Tag get(String name) {
- return valueOf(name.replaceAll("-", "_").toUpperCase());
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/TypeMapping.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/TypeMapping.java
deleted file mode 100644
index 2c0a460c1a..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/TypeMapping.java
+++ /dev/null
@@ -1,90 +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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-import org.apache.qpid.management.domain.model.type.Type;
-
-/**
- * Type Mapping used for associating a code with a management type.
- *
- * @author Andrea Gazzarini
- */
-class TypeMapping
-{
- private final int _code;
- private final Type _type;
- private final String _validatorClass;
-
- /**
- * Builds a new type mapping with the given parameters and no validator.
- *
- * @param code the code.
- * @param type the management type.
- */
- TypeMapping(int code, Type type)
- {
- this(code,type,null);
- }
-
- /**
- * Builds a new type mapping with the given parameters.
- *
- * @param code the code.
- * @param type the management type.
- * @param validatorClassName the class name of the validator to be used.
- */
- TypeMapping(int code, Type type, String validatorClassName)
- {
- this._code = code;
- this._type = type;
- this._validatorClass = validatorClassName;
- }
-
- /**
- * Returns the code of this mapping.
- *
- * @return the code of this mapping.
- */
- int getCode ()
- {
- return _code;
- }
-
- /**
- * Returns the type for this mapping.
- *
- * @return the type for this mapping.
- */
- Type getType ()
- {
- return _type;
- }
-
- /**
- * Returns the validator class of this mapping.
- *
- * @return the validator class (as a string) of this mapping.
- */
- public String getValidatorClassName()
- {
- return _validatorClass;
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownAccessCodeException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownAccessCodeException.java
deleted file mode 100644
index b7f1c0a7ec..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownAccessCodeException.java
+++ /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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-/**
- * Thrown when no access mode is found in configuration associated to the given code.
- *
- * @author Andrea Gazzarini
- */
-public class UnknownAccessCodeException extends Exception
-{
- private static final long serialVersionUID = 2350963503092509119L;
- private final int _code;
-
- /**
- * Builds a new UnknownAccessCodeException with the given code.
- *
- * @param code the access code.
- */
- UnknownAccessCodeException(int code)
- {
- super(String.valueOf(code));
- this._code = code;
- }
-
- /**
- * Returns the unknown code.
- *
- * @return the unknown code.
- */
- public int getCode ()
- {
- return _code;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownBrokerException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownBrokerException.java
deleted file mode 100644
index 5b08e09c24..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownBrokerException.java
+++ /dev/null
@@ -1,43 +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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-import java.util.UUID;
-
-/**
- * Thrown when someone requests connection data for an unknown broker.
- *
- * @author Andrea Gazzarini
- */
-public class UnknownBrokerException extends Exception
-{
- private static final long serialVersionUID = 4965395428832158924L;
-
- /**
- * Builds a new UnknownBrokerException with the given broker id.
- *
- * @param brokerId the broker identifier.
- */
- UnknownBrokerException(UUID brokerId)
- {
- super(String.valueOf(brokerId));
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownTypeCodeException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownTypeCodeException.java
deleted file mode 100644
index 57005d21e5..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/configuration/UnknownTypeCodeException.java
+++ /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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-/**
- * Thrown when no type is found in configuration associated to the given code.
- *
- * @author Andrea Gazzarini
- */
-public class UnknownTypeCodeException extends Exception
-{
- private static final long serialVersionUID = 5440934037645111591L;
- private int _code;
-
- /**
- * Builds a new UnknownTypeCodeException with the given code.
- *
- * @param code the access code.
- */
- UnknownTypeCodeException(int code)
- {
- super(String.valueOf(code));
- this._code = code;
- }
-
- /**
- * Returns the unknown code.
- *
- * @return the unknown code.
- */
- public int getCode ()
- {
- return _code;
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/BaseMessageHandler.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/BaseMessageHandler.java
deleted file mode 100644
index 798e835ff4..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/BaseMessageHandler.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-package org.apache.qpid.management.domain.handler.base;
-
-import org.apache.qpid.management.domain.model.DomainModel;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Base class for all message handlers.
- * A message handler is an handler for a specific type of message.
- * Message type is defined by the opcode.
- *
- * @author Andrea Gazzarini
- */
-public abstract class BaseMessageHandler implements IMessageHandler
-{
- /**
- * Logger used for logging.
- */
- protected final Logger _logger = Logger.get(getClass());
-
- /**
- * Managed broker domain model.
- */
- protected DomainModel _domainModel;
-
- /**
- * Sets the broker domain model.
- *
- * @param domainModel the broker domain model.
- */
- public void setDomainModel(DomainModel domainModel)
- {
- this._domainModel = domainModel;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/ContentIndicationMessageHandler.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/ContentIndicationMessageHandler.java
deleted file mode 100644
index be000e9a05..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/ContentIndicationMessageHandler.java
+++ /dev/null
@@ -1,114 +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.
- *
- */
-package org.apache.qpid.management.domain.handler.base;
-
-import org.apache.qpid.management.domain.model.type.Binary;
-import org.apache.qpid.transport.codec.Decoder;
-
-/**
- * Base class for content indication message handlers.
- *
- * @author Andrea Gazzarini
- */
-public abstract class ContentIndicationMessageHandler extends BaseMessageHandler
-{
- /**
- * Processes the income message.
- *
- * @param decoder the decoder used to parse the message.
- * @param sequenceNumber the sequence number of the message.
- */
- public final void process (Decoder decoder, int sequenceNumber)
- {
- String packageName = decoder.readStr8();
- String className = decoder.readStr8();
- Binary classHash = new Binary(decoder.readBin128());
-
- long timeStampOfCurrentSample = decoder.readDatetime();
- long timeObjectWasCreated = decoder.readDatetime();
- long timeObjectWasDeleted = decoder.readDatetime();
-
- Binary objectId = new Binary(decoder.readBin128());
-
- if (objectHasBeenRemoved(timeObjectWasDeleted, timeStampOfCurrentSample))
- {
- removeObjectInstance(packageName,className,classHash,objectId);
- } else
- {
- updateDomainModel(
- packageName,
- className,
- classHash,
- objectId,
- timeStampOfCurrentSample,
- timeObjectWasCreated,
- timeObjectWasDeleted,
- decoder.readReaminingBytes());
- }
- }
-
- /**
- * Removes an object instance from the domain model.
- *
- * @param packageName the package name.
- * @param className the class name.
- * @param classHash the class hash.
- * @param objectId the object identifier.
- */
- void removeObjectInstance(String packageName, String className,Binary classHash, Binary objectId)
- {
- _domainModel.removeObjectInstance(packageName,className,classHash,objectId);
- }
-
- /**
- * Checks if the timestamps contained in the message indicate that the object has been removed.
- *
- * @param deletionTimestamp time object was deleted.
- * @param now timestamp of the current message.
- * @return true if the object has been removed, false otherwise.
- */
- boolean objectHasBeenRemoved(long deletionTimestamp, long now) {
- return (deletionTimestamp != 0) && (now > deletionTimestamp);
- }
-
- /**
- * Updates domain model with the incoming data.
- * This is a template method that each concrete subclass must implement in order to update the domain model
- * with the incoming data.
- *
- * @param packageName the name of the package.
- * @param className the name of the class.
- * @param objectId the object identifier.
- * @param timeStampOfCurrentSample timestamp of current sample.
- * @param timeObjectWasCreated time object was created.
- * @param timeObjectWasDeleted time object was deleted.
- * @param contentData object instance incoming data.
- */
- protected abstract void updateDomainModel(
- String packageName,
- String className,
- Binary classHash,
- Binary objectId,
- long timeStampOfCurrentSample,
- long timeObjectWasCreated,
- long timeObjectWasDeleted,
- byte []contentData );
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/IMessageHandler.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/IMessageHandler.java
deleted file mode 100644
index c120334d30..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/base/IMessageHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.handler.base;
-
-import org.apache.qpid.management.domain.model.DomainModel;
-import org.apache.qpid.transport.codec.Decoder;
-
-/**
- * Interface definition for a processor able to deal with a specific message.
- * The concrete implementor must define what has to be done with the supplied (incoming) stream and the sequence
- * number.
- *
- * @author Andrea Gazzarini.
- */
-public interface IMessageHandler
-{
- /**
- * Processes the (incoming) stream message.
- * Note that the main controller (the component that is controlling this handler) has already read the magic number and
- * the sequence number so here concrete implementors must start from that point (that is, just after the sequence
- * number).
- *
- * @param decoder the stream decoder.
- * @param sequenceNumber the sequence number of the message.
- */
- void process (Decoder decoder, int sequenceNumber);
-
- /**
- * Injects the domain model into this handler.
- *
- * @param domainModel the domain model.
- */
- void setDomainModel(DomainModel domainModel);
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/ConfigurationMessageHandler.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/ConfigurationMessageHandler.java
deleted file mode 100644
index 3158138172..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/ConfigurationMessageHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.handler.impl;
-
-import org.apache.qpid.management.domain.handler.base.ContentIndicationMessageHandler;
-import org.apache.qpid.management.domain.model.type.Binary;
-
-/**
- * Schema Response message handler.
- * This handler is responsible to process 'c'(opcode) messages sent by the management broker.
- *
- * @author Andrea Gazzarini
- */
-public class ConfigurationMessageHandler extends ContentIndicationMessageHandler
-{
- /**
- * Broker domain model is going to be updated with incoming configuration data.
- *
- * @param packageName the name of the package.
- * @param className the name of the class.
- * @param objectId the object identifier.
- * @param timeStampOfCurrentSample the timestamp of incoming data.
- * @param timeObjectWasCreated time object was created.
- * @param timeObjectWasDeleted time object was deleted.
- */
- @Override
- protected void updateDomainModel (
- String packageName,
- String className,
- Binary classHash,
- Binary objectId,
- long timeStampOfCurrentSample,
- long timeObjectWasCreated,
- long timeObjectWasDeleted,
- byte[] contentData)
- {
- _domainModel.addConfigurationRawData(packageName,className,classHash,objectId,contentData);
- }
- }
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/EventContentMessageHandler.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/EventContentMessageHandler.java
deleted file mode 100644
index 0a590d2836..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/EventContentMessageHandler.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-package org.apache.qpid.management.domain.handler.impl;
-
-import org.apache.qpid.management.domain.handler.base.BaseMessageHandler;
-import org.apache.qpid.management.domain.model.type.Binary;
-import org.apache.qpid.transport.codec.Decoder;
-
-/**
- * Base class for content indication message handlers.
- *
- * @author Andrea Gazzarini
- */
-public class EventContentMessageHandler extends BaseMessageHandler
-{
- /**
- * Processes the income message.
- *
- * @param decoder the decoder used to parse the message.
- * @param sequenceNumber the sequence number of the message.
- */
- public final void process (Decoder decoder, int sequenceNumber)
- {
- String packageName = decoder.readStr8();
- String eventName = decoder.readStr8();
- Binary eventHash = new Binary(decoder.readBin128());
- long timeStampOfCurrentSample = decoder.readDatetime();
- int severity = decoder.readUint8();
- byte[] argumentsData = decoder.readReaminingBytes();
-
- _domainModel.addEventRawData(packageName, eventName, eventHash, argumentsData,timeStampOfCurrentSample,severity);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/HeartBeatIndicationMessageHandler.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/HeartBeatIndicationMessageHandler.java
deleted file mode 100644
index 08c4f1bc5d..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/HeartBeatIndicationMessageHandler.java
+++ /dev/null
@@ -1,39 +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.
- *
- */
-
-package org.apache.qpid.management.domain.handler.impl;
-
-import org.apache.qpid.management.domain.handler.base.BaseMessageHandler;
-import org.apache.qpid.transport.codec.Decoder;
-
-/**
- * This is the handler responsible for processing the heartbeat indication response messages.
- * At the moment it simply updates the last refresh update timestamp of the domain model.
- *
- * @author Andrea Gazzarini.
- */
-public class HeartBeatIndicationMessageHandler extends BaseMessageHandler
-{
- public void process(Decoder decoder, int sequenceNumber)
- {
- _domainModel.updateLastRefreshDate();
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/IMethodInvocationListener.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/IMethodInvocationListener.java
deleted file mode 100644
index 4ce64dd339..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/IMethodInvocationListener.java
+++ /dev/null
@@ -1,41 +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.
- *
- */
-package org.apache.qpid.management.domain.handler.impl;
-
-import java.util.EventListener;
-
-import org.apache.qpid.management.domain.model.InvocationEvent;
-
-/**
- * Listener interface used to denote a component interested in method invocation events.
- *
- * @author Andrea Gazzarini
- */
-public interface IMethodInvocationListener extends EventListener
-{
- /**
- * An operation is going to be invoked on a specific object instance.
- * This lets this listener to be informed about the imminent invocation.
- *
- * @param event the invocation event.
- */
- void operationIsGoingToBeInvoked(InvocationEvent event);
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/InstrumentationMessageHandler.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/InstrumentationMessageHandler.java
deleted file mode 100644
index e86a44f829..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/InstrumentationMessageHandler.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.handler.impl;
-
-import org.apache.qpid.management.domain.handler.base.ContentIndicationMessageHandler;
-import org.apache.qpid.management.domain.model.type.Binary;
-
-/**
- * Schema Response message handler.
- * This handler is responsible to process 'i'(opcode) messages sent by the management broker.
- *
- * @author Andrea Gazzarini
- */
-public class InstrumentationMessageHandler extends ContentIndicationMessageHandler
-{
- /**
- * Broker domain model is going to be updated with incoming instrumentation data.
- *
- * @param packageName the name of the package.
- * @param className the name of the class.
- * @param objectId the object identifier.
- * @param timeStampOfCurrentSample the timestamp of incoming data.
- * @param timeObjectWasCreated time object was created.
- * @param timeObjectWasDeleted time object was deleted.
- */
- @Override
- protected void updateDomainModel (
- String packageName,
- String className,
- Binary classHash,
- Binary objectId,
- long timeStampOfCurrentSample,
- long timeObjectWasCreated,
- long timeObjectWasDeleted,
- byte[] contentData)
- {
- _domainModel.addInstrumentationRawData(packageName,className,classHash,objectId,contentData);
- }
- }
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/InvocationResult.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/InvocationResult.java
deleted file mode 100644
index d188d20976..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/InvocationResult.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.handler.impl;
-
-import java.io.Serializable;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.qpid.management.domain.services.MethodInvocationException;
-
-/**
- * Value object used for storing an invocation method result.
- * This is done in order to accomplish multiple return value requirement.
- * As we know, it's not possible to do that only with method signature and therefore this value object / struct is used.
- *
- * @author Andrea Gazzarini
- */
-public class InvocationResult implements Serializable
-{
- private static final long serialVersionUID = 2062662997326399693L;
-
- private final long _returnCode;
- private final String _statusText;
- private final byte [] _outputAndBidirectionalArgumentValues;
- private Map<String, Object> _outputSection;
-
- /**
- * Builds an invocation result with the given status code and status text.
- *
- * @param statusCode the status code.
- * @param statusText the status text.
- */
- InvocationResult(long statusCode, String statusText,byte [] outputAndBidirectionalArgumentValues)
- {
- this._returnCode = statusCode;
- this._statusText = statusText;
- this._outputAndBidirectionalArgumentValues = outputAndBidirectionalArgumentValues;
- }
-
- /**
- * Checks if this result contains an error return code.
- *
- * @return true if this result object contains an error return code.
- */
- public boolean isException ()
- {
- return _returnCode != 0;
- }
-
- /**
- * Simply throws a new MethodInvocationException.
- * Usually this method is called in conjunction with the isException() method in order to raise an exception if
- * the wrapped return code means that there was an error.
- *
- * @throws MethodInvocationException always.
- */
- public void createAndThrowException() throws MethodInvocationException
- {
- throw new MethodInvocationException(_returnCode, _statusText);
- }
-
- @Override
- public String toString ()
- {
- StringBuilder builder = new StringBuilder()
- .append("Status code : ")
- .append(_returnCode)
- .append(",")
- .append("Status Text : ")
- .append(_statusText);
- if (_outputSection != null && !_outputSection.isEmpty())
- {
- builder.append(". Parameters : ");
- for (Entry<String, Object> outputEntry : _outputSection.entrySet())
- {
- builder.append(outputEntry.getKey()).append('=').append(outputEntry.getValue());
- builder.append(',');
- }
- }
- return builder.toString();
- }
-
- /**
- * Returns the return code of this invocation result.
- *
- * @return the return code of this invocation result.
- */
- public long getReturnCode ()
- {
- return _returnCode;
- }
-
- /**
- * Contains the status text of this invocation result.
- *
- * @return the status text of this invocation result.
- */
- public String getStatusText ()
- {
- return _statusText;
- }
-
- /**
- * Returns the output and bidirectional argument values in raw format (byte [])
- *
- * @return the output and bidirectional argument values in raw format (byte [])
- */
- public byte [] getOutputAndBidirectionalArgumentValues()
- {
- return _outputAndBidirectionalArgumentValues;
- }
-
- /**
- * Sets the output section (decoded) of this invocation result.
- * When an incoming message arrives, the output section (output and bidirectional argument values) are
- * initially stored in raw format.
- * After that, their values need to be converted.
- * The final result is a map containing (for each Output or Input/Output parameter) the name of the argument as key
- * and its value as value.
- *
- * @param output a map containing outptu and bidirectional values (not in schema order).
- */
- public void setOutputSection (Map<String, Object> outputSection)
- {
- this._outputSection = outputSection;
- }
-
- /**
- * Returns the output section of this invocation result.
- * The output section consists in output and bidirectional argument values.
- * Note that the order of the arguments is not guaranteed.
- *
- * @param outputSection the output section of this invocation result;
- */
- public Map<String, Object> getOutputSection ()
- {
- return _outputSection;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/MethodOrEventDataTransferObject.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/MethodOrEventDataTransferObject.java
deleted file mode 100644
index bc6a77d804..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/MethodOrEventDataTransferObject.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.handler.impl;
-
-import java.util.List;
-import java.util.Map;
-
-/**
- * Simple transfer object used for holding method / event definition data.
- *
- * @author Andrea Gazzarini
- */
-public class MethodOrEventDataTransferObject
-{
- private final Map<String, Object> _definition;
- private List<Map<String, Object>> _argumentDefinitions;
-
- /**
- * Builds a new trasfer object with the given parameters.
- *
- * @param definition the method definition.
- * @param argumentDefinitions the arguments definitions.
- */
- public MethodOrEventDataTransferObject(
- Map<String, Object> definition,
- List<Map<String, Object>> argumentDefinitions)
- {
- this._definition = definition;
- this._argumentDefinitions = argumentDefinitions;
- }
-
- /**
- * Returns the method definition.
- *
- * @return the method definition.
- */
- public Map<String, Object> getDefinition() {
- return _definition;
- }
-
- /**
- * Returns the arguemnts definitions.
- *
- * @return the arguemnts definitions.
- */
- public List<Map<String, Object>> getArgumentsDefinitions()
- {
- return _argumentDefinitions;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/MethodResponseMessageHandler.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/MethodResponseMessageHandler.java
deleted file mode 100644
index 9c99eb09aa..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/MethodResponseMessageHandler.java
+++ /dev/null
@@ -1,106 +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.
- *
- */
-package org.apache.qpid.management.domain.handler.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.BlockingQueue;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.domain.handler.base.BaseMessageHandler;
-import org.apache.qpid.management.domain.model.DomainModel;
-import org.apache.qpid.management.domain.model.InvocationEvent;
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Message handler for method response messages.
- * This handler is installed on domain model as a method invocation result listener.
- * When a method is going to be invoked this listener is notified with the exchange channel that will be used between it and
- * the event (method invocation) source object.
- *
- * @author Andrea Gazzarini
- *
- */
-public class MethodResponseMessageHandler extends BaseMessageHandler
-{
- private final static Logger LOGGER = Logger.get(MethodResponseMessageHandler.class);
-
- private Map<Integer, BlockingQueue<InvocationResult>> _exchangeChannels = new HashMap<Integer, BlockingQueue<InvocationResult>>();
-
- /**
- * This is the listener installed on domain model for method invocations.
- */
- private final IMethodInvocationListener methodInvocationListener = new IMethodInvocationListener()
- {
- /**
- * Event source callback.
- * A method is going to be invoked and this method lets this listener take the exchange channel that will be used
- * with the event source for synchronous communication.
- *
- * @param event the operation invocation event.
- */
- public void operationIsGoingToBeInvoked (InvocationEvent event)
- {
- _exchangeChannels.put(event.getSequenceNumber(), event.getExchangeChannel());
- }
- };
-
- /**
- * Processes the incoming message.
- *
- * @param decoder the decoder used for parsing incoming data.
- * @param sequenceNumber the sequence number of the incoming message.
- */
- public void process (Decoder decoder, int sequenceNumber)
- {
- InvocationResult result = new InvocationResult(decoder.readUint32(), decoder.readStr16(),decoder.readReaminingBytes());
- BlockingQueue<InvocationResult> exchangeChannel = _exchangeChannels.remove(sequenceNumber);
- if (exchangeChannel != null)
- {
- try
- {
- exchangeChannel.put(result);
- } catch (InterruptedException exception)
- {
- LOGGER.error(exception,Messages.QMAN_100010_METHOD_INVOCATION_RESULT_FAILURE,sequenceNumber);
- }
- } else
- {
- LOGGER.warn(
- "Unable to deal with incoming message because it contains a unknown sequence number (%s).",
- sequenceNumber);
- }
- }
-
- /**
- * Sets the domain model on this handler.
- * In addiction, this handler registers a method invocation listener on the domain model.
- *
- * @param domainModel the managed broker domain model.
- */
- @Override
- public void setDomainModel (DomainModel domainModel)
- {
- super.setDomainModel(domainModel);
- domainModel.setMethodInvocationListener(methodInvocationListener);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/SchemaResponseMessageHandler.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/SchemaResponseMessageHandler.java
deleted file mode 100644
index ee5efe2af6..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/handler/impl/SchemaResponseMessageHandler.java
+++ /dev/null
@@ -1,217 +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.
- *
- */
-package org.apache.qpid.management.domain.handler.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.Names;
-import org.apache.qpid.management.Protocol;
-import org.apache.qpid.management.domain.handler.base.BaseMessageHandler;
-import org.apache.qpid.management.domain.model.type.Binary;
-import org.apache.qpid.transport.codec.Decoder;
-
-/**
- * Schema Response message handler.
- * This handler is responsible to process 'S'(opcode) messages sent by the management broker containing the full
- * schema details for a class.
- *
- * @author Andrea Gazzarini
- */
-public class SchemaResponseMessageHandler extends BaseMessageHandler
-{
- /**
- * Behavioural interface for classes that are responsible to deal with schema messages.
- *
- * @author Andrea Gazzarini
- */
- interface IProcessor
- {
- /**
- * Processes the incoming message using the given decoder.
- *
- * @param decoder the decoder used for dealing with incoming message.
- */
- void process(Decoder decoder);
- }
-
- /**
- * Processor responsible to deal with class schema related messages.
- */
- final IProcessor _classSchemaProcessor = new IProcessor()
- {
- public void process(Decoder decoder)
- {
- try
- {
- String packageName = decoder.readStr8();
- String className = decoder.readStr8();
-
- Binary schemaHash = new Binary(decoder.readBin128());
-
- int howManyProperties = decoder.readUint16();
- int howManyStatistics = decoder.readUint16();
- int howManyMethods = decoder.readUint16();
-
- _domainModel.addSchema(
- packageName,
- className,
- schemaHash,
- getAttributes(decoder, howManyProperties),
- getAttributes(decoder, howManyStatistics),
- getMethods(decoder, howManyMethods));
- } catch(Exception exception)
- {
- _logger.error(exception,Messages.QMAN_100005_CLASS_SCHEMA_PROCESSING_FAILURE);
- }
- }
- };
-
- /**
- * Processor responsible to deal with class event related messages.
- */
- final IProcessor _eventSchemaProcessor = new IProcessor()
- {
- public void process(Decoder decoder)
- {
- try
- {
- String packageName = decoder.readStr8();
- String className = decoder.readStr8();
- Binary hash = new Binary(decoder.readBin128());
- int howManyArguments = decoder.readUint16();
-
- _domainModel.addEventSchema(
- packageName,
- className,
- hash,
- getAttributes(decoder, howManyArguments));
- } catch(Exception exception)
- {
- _logger.error(exception,Messages.QMAN_100006_EVENT_SCHEMA_PROCESSING_FAILURE);
- }
- }
- };
-
- /**
- * Processes an incoming schema response.
- * This will be used for building the corresponding class definition.
- *
- * @param decoder the decoder used for parsing the incoming stream.
- * @param sequenceNumber the sequence number of the incoming message.
- */
- public void process (Decoder decoder, int sequenceNumber)
- {
- try
- {
- int classKind = decoder.readUint8();
- switch(classKind)
- {
- case Protocol.CLASS :
- {
- _classSchemaProcessor.process(decoder);
- break;
- }
- case Protocol.EVENT :
- {
- _eventSchemaProcessor.process(decoder);
- break;
- }
- default :
- {
- _logger.error(Messages.QMAN_100011_UNKNOWN_CLASS_KIND,classKind);
- }
- }
- } catch(Exception exception)
- {
- _logger.error(exception,Messages.QMAN_100012_SCHEMA_MESSAGE_PROCESSING_FAILURE);
- }
- }
-
- /**
- * Reads from the incoming message stream the properties definitions.
- *
- * @param decoder the decoder used for decode incoming data.
- * @param howManyProperties the number of properties to read.
- * @return a list of maps. Each map contains a property definition.
- */
- List<Map<String, Object>> getAttributes(Decoder decoder,int howMany)
- {
- List<Map<String, Object>> result = new ArrayList<Map<String, Object>>(howMany);
- for (int i = 0; i < howMany; i++ )
- {
- result.add(decoder.readMap());
- }
- return result;
- }
-
- /**
- * Reads the methods definitions from the incoming message stream.
- *
- * @param decoder the decoder used for decode incoming data.
- * @param howManyMethods the number of methods to read.
- * @return a list method definitions.
- */
- List<MethodOrEventDataTransferObject> getMethods(Decoder decoder, int howManyMethods)
- {
- List<MethodOrEventDataTransferObject> result = new ArrayList<MethodOrEventDataTransferObject>(howManyMethods);
- for (int i = 0; i < howManyMethods; i++)
- {
- Map<String,Object> method = decoder.readMap();
- int howManyArguments = (Integer) method.get(Names.ARG_COUNT_PARAM_NAME);
-
- List<Map<String,Object>> arguments = new ArrayList<Map<String,Object>>(howManyArguments);
- for (int argIndex = 0; argIndex < howManyArguments; argIndex++)
- {
- arguments.add(decoder.readMap());
- }
- result.add(new MethodOrEventDataTransferObject(method,arguments));
- }
- return result;
- }
-
- /**
- * Reads the events definitions from the incoming message stream.
- *
- * @param decoder the decoder used for decode incoming data.
- * @param howManyEvents the number of events to read.
- * @return a list event definitions.
- */
- List<MethodOrEventDataTransferObject> getEvents(Decoder decoder, int howManyEvents)
- {
- List<MethodOrEventDataTransferObject> result = new ArrayList<MethodOrEventDataTransferObject>(howManyEvents);
- for (int i = 0; i < howManyEvents; i++)
- {
- Map<String,Object> method = decoder.readMap();
- int howManyArguments = (Integer) method.get(Names.ARG_COUNT_PARAM_NAME);
-
- List<Map<String,Object>> arguments = new ArrayList<Map<String,Object>>(howManyArguments);
- for (int argIndex = 0; argIndex < howManyArguments; argIndex++)
- {
- arguments.add(decoder.readMap());
- }
- result.add(new MethodOrEventDataTransferObject(method,arguments));
- }
- return result;
- }
- } \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/AccessMode.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/AccessMode.java
deleted file mode 100644
index 6d1426c122..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/AccessMode.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-/**
- * Enumeration for Access modes.
- *
- * @author Andrea Gazzarini
- */
-public enum AccessMode
-{
- RC { @Override public String toString() { return "Read-Create"; }},
- RO { @Override public String toString() { return "Read-Only"; }},
- RW { @Override public String toString() { return "Read-Write"; }}
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/Direction.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/Direction.java
deleted file mode 100644
index 8166c35eb6..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/Direction.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-/**
- * Enumeration of allowed method argument direction codes.
- *
- * @author Andrea Gazzarini
- */
-public enum Direction
-{
- I{ @Override public String toString() { return "Input"; }},
- O{ @Override public String toString() { return "Output"; }},
- IO{ @Override public String toString() { return "Input-Output"; }};
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/DomainModel.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/DomainModel.java
deleted file mode 100644
index 5a0ebaf1f7..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/DomainModel.java
+++ /dev/null
@@ -1,239 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.management.domain.handler.impl.IMethodInvocationListener;
-import org.apache.qpid.management.domain.handler.impl.MethodOrEventDataTransferObject;
-import org.apache.qpid.management.domain.model.type.Binary;
-
-/**
- * Broker domain model.
- * This is the local representation of a remote broker domain model.
- *
- * @author Andrea Gazzarini
- */
-public class DomainModel
-{
- private final UUID _id;
-
- /** Here the known packages of the remote broker are stored. */
- Map<String,QpidPackage> _packages = new HashMap<String, QpidPackage>();
-
- private Date _lastRefreshDate = new Date();
-
- private IMethodInvocationListener _methodInvocationListener;
-
- /**
- * Builds a new domain model with the given broker identifier.
- *
- * @param brokerId the broker identifier.
- */
- public DomainModel(UUID brokerId)
- {
- this._id = brokerId;
- }
-
- /**
- * Returns the identifier of the broker associated with this domain model.
- *
- * @return the identifier of the broker associated with this domain model.
- */
- public UUID getBrokerId()
- {
- return _id;
- }
-
- /**
- * Adds the specified schema to this domain model.
- *
- * @param packageName the package name.
- * @param className the class name.
- * @param classHash the class schema hash.
- * @param properties the class properties.
- * @param statistics the class statistics.
- * @param methods the class methods.
- * @throws UnableToBuildFeatureException
- */
- public void addSchema(
- String packageName,
- String className,
- Binary classHash,
- List<Map<String, Object>> properties,
- List<Map<String, Object>> statistics,
- List<MethodOrEventDataTransferObject> methods) throws UnableToBuildFeatureException
- {
- QpidPackage qpidPackage = getPackageByName(packageName);
- qpidPackage.addClassDefinition(className,classHash,properties,statistics,methods);
- }
-
- /**
- * Updates the last refresh date.
- */
- public void updateLastRefreshDate()
- {
- this._lastRefreshDate = new Date();
- }
-
- /**
- * Returns the last refresh date.
- *
- * @return the last refresh date.
- */
- public Date getLastRefreshDate()
- {
- return _lastRefreshDate;
- }
-
- /**
- * Adds the specified schema to this domain model.
- *
- * @param packageName the package name.
- * @param className the class name.
- * @param classHash the class schema hash.
- * @param properties the class properties.
- * @param statistics the class statistics.
- * @param methods the class methods.
- * @throws UnableToBuildFeatureException
- */
- public void addEventSchema(
- String packageName,
- String className,
- Binary classHash,
- List<Map<String, Object>> arguments) throws UnableToBuildFeatureException
- {
- QpidPackage qpidPackage = getPackageByName(packageName);
- qpidPackage.addEventDefinition(className,classHash,arguments);
- }
-
- /**
- * Gets the package with the specified name.
- * Note that if the package doesn't exist a new one will be created and returned.
- *
- * @param packageName the name of the package.
- * @return the package.
- */
- QpidPackage getPackageByName (String packageName)
- {
- QpidPackage qpidPackage = _packages.get(packageName);
- if (qpidPackage == null)
- {
- qpidPackage = new QpidPackage(packageName,this);
- _packages.put(packageName, qpidPackage);
- }
- return qpidPackage;
- }
-
- /**
- * Returns true if a package with the specified name already exists on this domain model.
- *
- * @param packageName the name of the package.
- * @return true if the package exists, false otherwise.
- */
- boolean containsPackage (String packageName)
- {
- return _packages.containsKey(packageName);
- }
-
- /**
- * Adds the given instrumentation data (raw format) to this domain model.
- * Note that this data is belonging to a specific object instance.
- *
- * @param packageName the name of the ower package.
- * @param className the name of the owner class.
- * @param classHash the schema hash for this class.
- * @param objectId the object instance identifier.
- * @param rawData the instrumentation data.
- */
- public void addInstrumentationRawData (String packageName, String className,Binary classHash, Binary objectId, byte[] rawData)
- {
- QpidPackage qpidPackage = getPackageByName(packageName);
- qpidPackage.setObjectInstanceInstrumentationRawData(className,classHash,objectId,rawData);
- }
-
- public void addEventRawData (
- String packageName,
- String eventName,
- Binary eventHash,
- byte[] rawData,
- long currentTimestamp,
- int severity)
- {
- QpidPackage qpidPackage = getPackageByName(packageName);
- qpidPackage.setEventInstanceRawData(eventName,eventHash,rawData,currentTimestamp,severity);
- }
-
- /**
- * Adds the given configuration data (raw format) to this domain model.
- * Note that this data is belonging to a specific object instance.
- *
- * @param packageName the name of the ower package.
- * @param className the name of the owner class.
- * @param classHash the schema hash for this class.
- * @param objectId the object instance identifier.
- * @param rawData the configuration data.
- */
- public void addConfigurationRawData (String packageName, String className, Binary classHash,Binary objectId, byte[] rawData)
- {
- QpidPackage qpidPackage = getPackageByName(packageName);
- qpidPackage.setObjectInstanceConfigurationRawData(className,classHash,objectId,rawData);
- }
-
- /**
- * Removes the object instance associated to the given parameters.
- *
- * @param packageName the owner package.
- * @param className the class definition of the object instance.
- * @param classHash the class hash
- * @param objectId the object identifier.
- */
- public void removeObjectInstance (String packageName, String className, Binary classHash, Binary objectId)
- {
- QpidPackage qpidPackage = getPackageByName(packageName);
- qpidPackage.removeObjectInstance(className, classHash, objectId);
- }
-
- /**
- * Releases all the resources kept by domain model entitiies.
- */
- public void releaseResources()
- {
- for (QpidPackage qpidPackage : _packages.values())
- {
- qpidPackage.releaseResources();
- }
- }
-
- public void setMethodInvocationListener(IMethodInvocationListener listener)
- {
- this._methodInvocationListener = listener;
- }
-
- IMethodInvocationListener getMethodInvocationListener ()
- {
- return _methodInvocationListener;
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/IValidator.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/IValidator.java
deleted file mode 100644
index 1ede559145..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/IValidator.java
+++ /dev/null
@@ -1,38 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-/**
- * Interface definition for attribute validators.
- *
- * @author Andrea Gazzarini
- */
-interface IValidator
-{
- /**
- * Validates the given value according to the rules definied by this validator.
- *
- * @param value the value be checked.
- *
- * @throws ValidationException when the value is violating validator's rules.
- */
- void validate(Object value) throws ValidationException;
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/InvocationEvent.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/InvocationEvent.java
deleted file mode 100644
index d84a018346..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/InvocationEvent.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.util.EventObject;
-import java.util.concurrent.BlockingQueue;
-
-import org.apache.qpid.management.domain.handler.impl.InvocationResult;
-
-/**
- * Operation invocation event.
- * This encapsulates all the information that a method invocation listener needs to know about an operation which is
- * going to be invoked.
- *
- * @author Andrea Gazzarini
- */
-public class InvocationEvent extends EventObject
-{
- private static final long serialVersionUID = 240229490753008597L;
-
- private final int _sequenceNumber;
- private final BlockingQueue<InvocationResult> _exchangeChannel;
-
- /**
- * Builds a new invocation event with the given data.
- *
- * @param source the event source.
- * @param sequenceNumber the sequence number of the method invocation.
- * @param exchangeChannel the exchange channel for synchronous communication.
- */
- InvocationEvent(Object source, int sequenceNumber, BlockingQueue<InvocationResult> exchangeChannel)
- {
- super(source);
- this._sequenceNumber = sequenceNumber;
- this._exchangeChannel = exchangeChannel;
- }
-
- /**
- * Returns the sequence number that will be / has been used for method invocation.
- *
- * @return the sequence number that will be / has been used for method invocation.
- */
- public int getSequenceNumber()
- {
- return _sequenceNumber;
- }
-
- /**
- * Returns the exchange channel that will be used between event source and event listener for synchronous
- * communication.
- *
- * @return the exchange channel that will be used for synchronous communication.
- */
- public BlockingQueue<InvocationResult> getExchangeChannel()
- {
- return _exchangeChannel;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/JmxService.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/JmxService.java
deleted file mode 100644
index d919fdacae..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/JmxService.java
+++ /dev/null
@@ -1,348 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.lang.management.ManagementFactory;
-import java.util.Set;
-import java.util.UUID;
-
-import javax.management.MBeanException;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.Names;
-import org.apache.qpid.management.domain.model.QpidClass.QpidManagedObject;
-import org.apache.qpid.management.domain.model.QpidEvent.QpidManagedEvent;
-import org.apache.qpid.management.domain.model.type.Binary;
-import org.apache.qpid.management.domain.services.QMan;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * A simple facade used to perform operations on Mbean server.
- *
- * @author Andrea Gazzarini
- */
-public class JmxService
-{
- private final static Logger LOGGER = Logger.get(JmxService.class);
- MBeanServer _mxServer = ManagementFactory.getPlatformMBeanServer();
-
- /**
- * Registers QMan with the MBeanServer.
- * After that QMan management interface will be JMX-exposed.
- *
- * @param qman QMan
- * @throws MBeanException when some error occurs during registration.
- */
- public void registerQManService(QMan qman) throws MBeanException
- {
- ObjectName name = createQManName();
- if (!_mxServer.isRegistered(name))
- {
- try {
- _mxServer.registerMBean(qman, name);
- } catch (Exception exception) {
- throw new MBeanException(exception);
- }
- }
- }
-
- void registerEventInstance(
- QpidManagedEvent eventInstance,
- UUID brokerId,
- String packageName,
- String eventClassName)
- {
- ObjectName name = createEventName(brokerId, packageName, eventClassName);
- if (!_mxServer.isRegistered(name))
- {
- try
- {
- _mxServer.registerMBean(eventInstance, name);
-
- LOGGER.debug(
- Messages.QMAN_200010_EVENT_MBEAN_REGISTERED,
- brokerId,
- packageName,
- eventClassName,
- name);
- } catch (Exception exception)
- {
- throw new RuntimeException(exception);
- }
- }
-}
-
- /**
- * Registers a pre-existing object instance as an MBean with the MBean
- * server.
- *
- * @param instance the object instance.
- * @param brokerId the broker identifier.
- * @param packageName the name of the package containing this instance.
- * @param className the name of the owner class of this instance.
- * @param objectId the object instance identifier.
- */
- void registerObjectInstance(
- QpidManagedObject instance,
- UUID brokerId,
- String packageName,
- String className,
- Binary objectId)
- {
- ObjectName name = createObjectName(brokerId, packageName, className, objectId);
- if (!_mxServer.isRegistered(name))
- {
- try
- {
- _mxServer.registerMBean(instance, name);
-
- LOGGER.debug(
- Messages.QMAN_200011_OBJECT_MBEAN_REGISTERED,
- brokerId,
- packageName,
- className,
- objectId,
- name);
- } catch (Exception exception)
- {
- throw new RuntimeException(exception);
- }
- }
- }
-
- /**
- * Removes / unregisters a managed object instance from the MBean Server.
- *
- * @param brokerId the broker identifier.
- * @param packageName the name of the package containing this instance.
- * @param className the name of the owner class of this instance.
- * @param objectId the object instance identifier.
- */
- void unregisterObjectInstance(
- UUID brokerId,
- String packageName,
- String className,
- Binary objectId)
- {
- ObjectName name = createObjectName(brokerId, packageName, className, objectId);
- if (_mxServer.isRegistered(name))
- {
- try
- {
- _mxServer.unregisterMBean(name);
-
- LOGGER.debug(
- Messages.QMAN_200012_OBJECT_MBEAN_UNREGISTERED,
- brokerId,
- packageName,
- className,
- objectId,
- name);
- } catch (Exception exception)
- {
- LOGGER.error(exception,Messages.QMAN_100013_MBEAN_REGISTRATION_FAILURE,name);
- }
- }
- }
-
- /**
- * Removes (unregister) all events from MBean Server.
- */
- void unregisterEvents()
- {
- for (ObjectName name : getEventMBeans())
- {
- try
- {
- _mxServer.unregisterMBean(name);
- } catch(Exception ignore)
- {
- }
- }
- }
-
- Set<ObjectName> getEventMBeans()
- {
- return _mxServer.queryNames(createEventSearchName(),null);
- }
-
- /**
- * Removes (unregister) all object instances from MBean Server.
- */
- void unregisterObjectInstances()
- {
- Set<ObjectName> names = _mxServer.queryNames(createObjectInstanceSearchName(),null);
- for (ObjectName name : names)
- {
- try
- {
- _mxServer.unregisterMBean(name);
- } catch(Exception ignore)
- {
- }
- }
- }
-
- /**
- * Factory method for ObjectNames.
- *
- * @param brokerId the broker identifier.
- * @param packageName the name of the package containing this instance.
- * @param className the name of the owner class of this instance.
- * @param objectId the object instance identifier.
- * @return the object name built according to the given parameters.
- */
- private ObjectName createObjectName(UUID brokerId, String packageName, String className, Binary objectId)
- {
- String asString = new StringBuilder()
- .append(Names.DOMAIN_NAME)
- .append(':')
- .append(Names.BROKER_ID)
- .append('=')
- .append(brokerId)
- .append(",type=Object,")
- .append(Names.PACKAGE)
- .append('=')
- .append(packageName)
- .append(',')
- .append(Names.CLASS)
- .append('=')
- .append(className)
- .append(',')
- .append(Names.OBJECT_ID)
- .append('=')
- .append(objectId)
- .toString();
- try
- {
- return new ObjectName(asString);
- } catch (MalformedObjectNameException exception)
- {
- throw new RuntimeException(exception);
- }
- }
-
- /**
- * Creates an object name that will be used for searching all registered events.
- *
- * @return the object name that will be used for searching all registered events.
- */
- ObjectName createEventSearchName()
- {
- String asString = new StringBuilder()
- .append(Names.DOMAIN_NAME)
- .append(':')
- .append('*')
- .append(",type=Event")
- .toString();
- try
- {
- return new ObjectName(asString);
- } catch (MalformedObjectNameException exception)
- {
- throw new RuntimeException(exception);
- }
- }
-
- /**
- * Creates an object name that will be used for searching all registered object instances.
- *
- * @return the object name that will be used for searching all registered object instances.
- */
- private ObjectName createObjectInstanceSearchName()
- {
- String asString = new StringBuilder()
- .append(Names.DOMAIN_NAME)
- .append(':')
- .append('*')
- .append(",type=Object")
- .toString();
- try
- {
- return new ObjectName(asString);
- } catch (MalformedObjectNameException exception)
- {
- throw new RuntimeException(exception);
- }
- }
-
- /**
- * Factory method for ObjectNames.
- *
- * @param brokerId the broker identifier.
- * @param packageName the name of the package containing this instance.
- * @param className the name of the owner class of this instance.
- * @return the object name built according to the given parameters.
- */
- private ObjectName createEventName(UUID brokerId, String packageName, String className)
- {
- String asString = new StringBuilder()
- .append(Names.DOMAIN_NAME)
- .append(':')
- .append(Names.BROKER_ID)
- .append('=')
- .append(brokerId)
- .append(",type=Event,")
- .append(Names.PACKAGE)
- .append('=')
- .append(packageName)
- .append(',')
- .append(Names.CLASS)
- .append('=')
- .append(className)
- .append(',')
- .append(Names.OBJECT_ID)
- .append('=')
- .append(UUID.randomUUID())
- .toString();
- try
- {
- return new ObjectName(asString);
- } catch (MalformedObjectNameException exception)
- {
- throw new RuntimeException(exception);
- }
- }
-
- /**
- * Creates the QMan object name.
- *
- * @return the QMan object name.
- */
- private ObjectName createQManName()
- {
- String asString = new StringBuilder()
- .append(Names.DOMAIN_NAME)
- .append(':')
- .append("Type=Service")
- .toString();
- try
- {
- return new ObjectName(asString);
- } catch (MalformedObjectNameException exception)
- {
- throw new RuntimeException(exception);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/MissingFeatureAttributesException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/MissingFeatureAttributesException.java
deleted file mode 100644
index 160054059b..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/MissingFeatureAttributesException.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.util.List;
-
-import org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute;
-
-public class MissingFeatureAttributesException extends UnableToBuildFeatureException
-{
- private static final long serialVersionUID = 671471705085787235L;
-
- public MissingFeatureAttributesException(List<Attribute> missingAttributeList)
- {
- super(String.valueOf(missingAttributeList));
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidArgument.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidArgument.java
deleted file mode 100644
index 1e90479c0b..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidArgument.java
+++ /dev/null
@@ -1,82 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.transport.codec.Encoder;
-import org.apache.qpid.transport.util.Logger;
-
-class QpidArgument extends QpidProperty
-{
- private final static Logger LOGGER = Logger.get(QpidArgument.class);
-
- private Object _defaultValue;
-
- private Direction _direction;
-
- public void setDirection(String code)
- {
- this._direction = Direction.valueOf(code);
- }
-
- public Direction getDirection()
- {
- return _direction;
- }
-
- public void setDefaultValue(Object defaultValue)
- {
- this._defaultValue = defaultValue;
- }
-
- public Object getDefaultValue()
- {
- return _defaultValue;
- }
-
- public boolean isInput(){
- return _direction != Direction.O;
- }
-
- @Override
- public String toString ()
- {
- return new StringBuilder()
- .append(getJavaType().getName())
- .append(' ')
- .append(_name)
- .append("(")
- .append(_direction)
- .append(")")
- .toString();
- }
-
- public void encode(Object value,Encoder encoder)
- {
- _type.encode(value, encoder);
- LOGGER.debug(Messages.QMAN_200013_ARGUMENT_VALUE_ENCODED,value,_name,_type);
- }
-
- public Object decode(org.apache.qpid.transport.codec.Decoder decoder)
- {
- return _type.decode(decoder);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidAttribute.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidAttribute.java
deleted file mode 100644
index 6712a14075..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidAttribute.java
+++ /dev/null
@@ -1,105 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.domain.model.type.Type;
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Layer supertype for qpid properties and statistics.
- *
- * @author Andrea Gazzarini
- */
-class QpidAttribute extends QpidFeature
-{
- private final static Logger LOGGER = Logger.get(QpidAttribute.class);
-
- /** feature type */
- protected Type _type;
-
- /** feature unit */
- protected String _unit;
-
- /**
- * Returns the units used for numeric values (i.e. seconds, bytes, etc.)
- *
- * @return the units used for numeric values (i.e. seconds, bytes, etc.)
- */
- String getUnit ()
- {
- return _unit;
- }
-
- /**
- * Sets the unit for this property.
- *
- * @param unit the unit of this property.
- */
- void setUnit (String unit)
- {
- this._unit = unit;
- }
-
- /**
- * Returns the java type (class) of this feature.
- *
- * @return the java type (class) of this feature.
- */
- Class<?> getJavaType ()
- {
- return _type.getJavaType();
- }
-
- /**
- * Sets the type of this feature.
- *
- * @param type the type of this feature.
- */
- void setType (Type type)
- {
- this._type = type;
- }
-
- /**
- * Gets the value of this feature according to its type definition.
- *
- * @param decoder the decoder used to extract the value.
- * @return the value of this feature according to its type definition
- */
- Object decodeValue(Decoder decoder)
- {
- try {
- return _type.decode(decoder);
- } catch(RuntimeException exception)
- {
- LOGGER.error(exception,Messages.QMAN_100014_ATTRIBUTE_DECODING_FAILURE,this);
- throw exception;
- }
- }
-
- @Override
- public String toString ()
- {
- return super.toString()+",type="+_type;
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidClass.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidClass.java
deleted file mode 100644
index c7dfcb033c..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidClass.java
+++ /dev/null
@@ -1,768 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.SynchronousQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.AttributeNotFoundException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanRegistration;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.management.RuntimeOperationsException;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.domain.handler.impl.IMethodInvocationListener;
-import org.apache.qpid.management.domain.handler.impl.InvocationResult;
-import org.apache.qpid.management.domain.handler.impl.MethodOrEventDataTransferObject;
-import org.apache.qpid.management.domain.model.type.Binary;
-import org.apache.qpid.management.domain.services.SequenceNumberGenerator;
-import org.apache.qpid.transport.codec.BBDecoder;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Qpid Class definition.
- * A type definition for a manageable object.
- * This class is also responsible to manage incoming obejct instance data (configuration & instrumentation).
- * How can we handle data before schema is injected into this class? simply we must retain that data in raw format.
- * This class has 2 states :
- * 1) first state is when schema is not yet injected. In this case the incoming object data is retained as is (in raw format);
- * 2) second state is when schema is injected. In this case each injection of data will result in an update / create / delete of
- * the corresponding object instance. In addition, the first time the state change, the old retained raw data is cnverted in
- * object instance(s).
- *
- * @author Andrea Gazzarini
- */
-class QpidClass extends QpidEntity
-{
- /**
- * State interface for this class definition.
- * Each state is responsible to handle the injection of the data and / or schema.
- *
- * @author Andrea Gazzarini
- */
- interface State
- {
- /**
- * Adds configuration data for the object instance associated to the given object identifier.
- *
- * @param objectId the object identifier.
- * @param rawData the raw configuration data.
- */
- void addInstrumentationData (Binary objectId, byte[] rawData);
-
- /**
- * Adds instrumentation data for the object instance associated to the given object identifier.
- *
- * @param objectId the object identifier.
- * @param rawData the raw instrumentation data.
- */
- void addConfigurationData (Binary objectId, byte[] rawData);
-
- /**
- * Inject the schema into this class definition.
- *
- * @param propertyDefinitions
- * @param statisticDefinitions
- * @param methodDefinitions
- * @throws UnableToBuildFeatureException when it's not possibile to parse schema and build the class definition.
- */
- public void setSchema (
- List<Map<String, Object>> propertyDefinitions,
- List<Map<String, Object>> statisticDefinitions,
- List<MethodOrEventDataTransferObject> methodDefinitions) throws UnableToBuildFeatureException;
- };
-
- /**
- * This is the initial state of every qpid class.
- * The class definition instance is created but its schema has not been injected.
- * Incoming configuration & instrumentation data will be stored in raw format because we don't know how to
- * parse it until the schema arrives.
- * In addition, this state is responsible (when data arrives) to request its schema.
- */
- final State _schemaNotRequested = new State() {
-
- /**
- * Stores the incoming data in raw format and request the schema for this class.
- * After that a transition to the next state is made.
- *
- * @param objectId the object instance identifier.
- * @param rawData incoming configuration data.
- */
- public synchronized void addConfigurationData (Binary objectId, byte[] rawData)
- {
- try
- {
- requestSchema();
- _state = _schemaRequestedButNotYetInjected;
- } catch (Exception e)
- {
- _logger.error(
- Messages.QMAN_100015_UNABLE_TO_SEND_SCHEMA_REQUEST,
- _parent.getName(),
- _name);
- } finally {
- QpidManagedObject instance = getObjectInstance(objectId,false);
- instance._rawConfigurationData.add(rawData);
- }
- }
-
- /**
- * Stores the incoming data in raw format and request the schema for this class.
- * After that a transition to the next state is made.
- *
- * @param objectId the object instance identifier.
- * @param rawData incoming instrumentation data.
- */
- public synchronized void addInstrumentationData (Binary objectId, byte[] rawData)
- {
- try
- {
- requestSchema();
- _state = _schemaRequestedButNotYetInjected;
- } catch (Exception e)
- {
- _logger.error(
- Messages.QMAN_100015_UNABLE_TO_SEND_SCHEMA_REQUEST,
- _parent.getName(),
- _name);
- } finally {
- QpidManagedObject instance = getObjectInstance(objectId,false);
- instance._rawConfigurationData.add(rawData);
- }
- }
-
- /**
- * This method only throws an illegal state exception because when a schema arrives
- * this state is no longer valid.
- */
- public void setSchema (
- List<Map<String, Object>> propertyDefinitions,
- List<Map<String, Object>> statisticDefinitions,
- List<MethodOrEventDataTransferObject> methodDefinitions) throws UnableToBuildFeatureException
- {
- throw new IllegalStateException("When a schema arrives it's not possible for this class to be in this state.");
- }
- };
-
- /**
- * This is the first state of this class definition : the schema is not yet injected so each injection of object data will be
- * retained in raw format.
- */
- final State _schemaRequestedButNotYetInjected = new State()
- {
- /**
- * Stores the incoming data in raw format.
- *
- * @param objectId the object instance identifier.
- * @param rawData incoming configuration data.
- */
- public void addConfigurationData (Binary objectId, byte[] rawData)
- {
- QpidManagedObject instance = getObjectInstance(objectId,false);
- instance._rawConfigurationData.add(rawData);
- }
-
- /**
- * Stores the incoming data in raw format.
- *
- * @param objectId the object instance identifier.
- * @param rawData incoming instrumentation data.
- */
- public void addInstrumentationData (Binary objectId, byte[] rawData)
- {
- QpidManagedObject instance = getObjectInstance(objectId,false);
- instance._rawInstrumentationData.add(rawData);
- }
-
- /**
- * When a schema is injected into this defintiion the following should happen :
- * 1) the incoming schema is parsed and the class definition is built;
- * 2) the retained raw data is converted into object instance(s)
- * 3) the internal state of this class changes;
- *
- * If someting is wrong during that process the schema is not built and the state don't change.
- */
- public synchronized void setSchema (
- List<Map<String, Object>> propertyDefinitions,
- List<Map<String, Object>> statisticDefinitions,
- List<MethodOrEventDataTransferObject> methodDefinitions) throws UnableToBuildFeatureException
- {
-
- MBeanAttributeInfo [] attributesMetadata = new MBeanAttributeInfo[propertyDefinitions.size()+statisticDefinitions.size()];
- MBeanOperationInfo [] operationsMetadata = new MBeanOperationInfo[methodDefinitions.size()];
-
- buildAttributes(propertyDefinitions,statisticDefinitions,attributesMetadata);
- buildMethods(methodDefinitions,operationsMetadata);
-
- _metadata = new MBeanInfo(_name,_name,attributesMetadata,null,operationsMetadata,null);
-
- // Converting stored object instances into JMX MBean and removing raw instance data.
- for (Entry<Binary, QpidManagedObject> instanceEntry : _objectInstances.entrySet())
- {
- Binary objectId = instanceEntry.getKey();
- QpidManagedObject instance = instanceEntry.getValue();
-
- for (Iterator<byte[]> iterator = instance._rawInstrumentationData.iterator(); iterator.hasNext();)
- {
- updateInstanceWithInstrumentationData(instance,iterator.next());
- iterator.remove();
- }
-
- for (Iterator<byte[]> iterator = instance._rawConfigurationData.iterator(); iterator.hasNext();)
- {
- updateInstanceWithConfigurationData(instance, iterator.next());
- iterator.remove();
- }
-
- JMX_SERVICE.registerObjectInstance(instance,_parent.getOwnerId(),_parent.getName(),_name,objectId);
- }
- _state = _schemaInjected;
- }
- };
-
- /**
- * After a schema is built into this definition this is the current state of the class.
- */
- final State _schemaInjected = new State()
- {
- /**
- * Updates the configuration state of the object instance associates with the given object identifier.
- *
- * @param objectId the object identifier.
- * @param rawData the configuration data (raw format).
- */
- public void addConfigurationData (Binary objectId, byte[] rawData)
- {
- QpidManagedObject instance = getObjectInstance(objectId,true);
- updateInstanceWithConfigurationData(instance, rawData);
- }
-
- /**
- * Updates the instrumentation state of the object instance associates with the given object identifier.
- *
- * @param objectId the object identifier.
- * @param rawData the instrumentation data (raw format).
- */
- public void addInstrumentationData (Binary objectId, byte[] rawData)
- {
- QpidManagedObject instance = getObjectInstance(objectId,true);
- updateInstanceWithInstrumentationData(instance, rawData);
- }
-
- /**
- * Never called when the class definition has this state.
- */
- public void setSchema (
- List<Map<String, Object>> propertyDefinitions,
- List<Map<String, Object>> statisticDefinitions,
- List<MethodOrEventDataTransferObject> methodDefinitions) throws UnableToBuildFeatureException
- {
- throw new IllegalStateException("When a schema arrives it's not possible for this class to be in this state.");
- }
- };
-
- /**
- * MBean used for representing remote broker object instances.
- * This is the core component of the QMan domain model
- *
- * @author Andrea Gazzarini
- */
- class QpidManagedObject extends QpidManagedEntity implements MBeanRegistration
- {
- private Binary _objectId;
-
- // Arrays used for storing raw data before this mbean is registered to mbean server.
- List<byte[]> _rawInstrumentationData = new ArrayList<byte[]>();
- List<byte[]> _rawConfigurationData = new ArrayList<byte[]>();
-
- /**
- * Builds a new managed object with the given object identifier.
- *
- * @param objectId the object identifier.
- */
- QpidManagedObject(Binary objectId)
- {
- this._objectId = objectId;
- }
-
- /**
- * Returns the value of the given attribute.s
- *
- * @throws AttributeNotFoundException when no attribute is found with the given name.
- */
- public Object getAttribute (String attributeName) throws AttributeNotFoundException, MBeanException, ReflectionException
- {
- if (attributeName == null)
- {
- throw new RuntimeOperationsException(new IllegalArgumentException("attribute name must not be null"));
- }
-
- if (_properties.containsKey(attributeName) || _statistics.containsKey(attributeName))
- {
- return _attributes.get(attributeName);
- } else
- {
- throw new AttributeNotFoundException(attributeName);
- }
- }
-
- /**
- * Executes an operation on this object instance.
- *
- * @param actionName the name of the method.
- * @param params the method parameters
- * @param signature the method signature.
- */
- public Object invoke (String actionName, Object[] params, String[] signature) throws MBeanException,ReflectionException
- {
- // TODO : Overloaded methods
- QpidMethod method = _methods.get(actionName);
- if (method != null)
- {
- try
- {
- method.validate(params);
- return invokeMethod(_objectId, method, params);
- } catch (Exception exception)
- {
- throw new MBeanException(exception);
- }
- } else {
- throw new ReflectionException(new NoSuchMethodException(actionName));
- }
- }
-
- /**
- * Sets the value of the given attribute on this object instance.
- *
- * @param attribute contains the new value of the attribute.
- * @throws AttributeNotFoundException when the given attribute is not found on this object instance.
- * @throws InvalidAttributeValueException when the given value is violating one attribute invariant.
- */
- public void setAttribute (Attribute attribute) throws AttributeNotFoundException,
- InvalidAttributeValueException, MBeanException, ReflectionException
- {
- QpidProperty property = _properties.get(attribute.getName());
- try
- {
- property.validate(attribute.getValue());
- } catch(ValidationException exception)
- {
- throw new InvalidAttributeValueException(exception.getMessage());
- }
- throw new RuntimeException("Not yet implemented.");
- }
-
- /**
- * Sets the values of several attributes of this MBean.
- *
- * @param attributes a list of attributes: The identification of the attributes to be set and the values they are to be set to.
- * @return The list of attributes that were set, with their new values.
- */
- public AttributeList setAttributes (AttributeList attributes)
- {
- throw new RuntimeException("Not yet implemented.");
- }
-
- /**
- * MBean server callback after deregistration.
- */
- public void postDeregister ()
- {
- }
-
- /**
- * After the object is registered the raw data is set to null.
- * This is done because we no longer need this data : it has already been
- * injected into this object instance.
- *
- * @param registrationDone a flag indicating if the instance has been registered to mbean server.
- */
- public void postRegister (Boolean registrationDone)
- {
- if (registrationDone)
- {
- _rawConfigurationData = null;
- _rawInstrumentationData = null;
- }
- }
-
- /**
- * MBean server callback before deregistration.
- */
- public void preDeregister () throws Exception
- {
- }
-
- /**
- * MBean server callback before registration.
- */
- public ObjectName preRegister (MBeanServer server, ObjectName name) throws Exception
- {
- return name;
- }
- }
-
- Map<String, QpidProperty> _properties = new HashMap<String, QpidProperty>();
- Map<String, QpidStatistic> _statistics = new HashMap<String, QpidStatistic>();
- private Map<String, QpidMethod> _methods = new HashMap<String, QpidMethod>();
-
- private List<QpidProperty> _schemaOrderedProperties = new ArrayList<QpidProperty>();
- private List<QpidStatistic> _schemaOrderedStatistics= new ArrayList<QpidStatistic>();
-
- private int _howManyPresenceBitMasks;
- private BlockingQueue<InvocationResult> _exchangeChannelForMethodInvocations;
- private final IMethodInvocationListener _methodInvocationListener;
-
- Map<Binary, QpidManagedObject> _objectInstances = new HashMap<Binary, QpidManagedObject>();
- State _state = _schemaNotRequested;;
-
- private final static class Log
- {
- private final static Logger LOGGER = Logger.get(QpidClass.class);
- final static void logMethodInvocationResult(InvocationResult result)
- {
- if (LOGGER.isDebugEnabled())
- {
- LOGGER.debug(String.valueOf(result));
- }
- }
- }
-
- /**
- * Builds a new class with the given name and package as parent.
- *
- * @param className the name of the class.
- * @param hash the class schema hash.
- * @param parentPackage the parent of this class.
- */
- QpidClass(String className, Binary hash, QpidPackage parentPackage)
- {
- super(className,hash, parentPackage);
- this._methodInvocationListener = _parent.getMethodInvocationListener();
- this._exchangeChannelForMethodInvocations = new SynchronousQueue<InvocationResult>();
- }
-
- /**
- * Adds the configuration data for the object instance associated to the given object identifier.
- *
- * @param objectId the object identifier.
- * @param rawData the raw configuration data.
- */
- void addInstrumentationData (Binary objectId, byte[] rawData)
- {
- _logger.debug(
- Messages.QMAN_200014_INCOMING_INSTRUMENTATION_DATA,
- _parent.getOwnerId(),
- _parent.getName(),
- _name,
- objectId);
- _state.addInstrumentationData(objectId, rawData);
- }
-
- /**
- * Adds the instrumentation data for the object instance associated to the given object identifier.
- *
- * @param objectId the object identifier.
- * @param rawData the raw instrumentation data.
- */
- void addConfigurationData (Binary objectId, byte[] rawData)
- {
- _logger.debug(
- Messages.QMAN_200015_INCOMING_CONFIGURATION_DATA,
- _parent.getOwnerId(),
- _parent.getName(),
- _name,
- objectId);
- _state.addConfigurationData(objectId, rawData);
- }
-
- /**
- * Sets the schema for this class definition.
- * A schema is basically a metadata description of all properties, statistics, methods and events of this class.
- *
- * @param propertyDefinitions properties metadata.
- * @param statisticDefinitions statistics metadata.
- * @param methodDefinitions methods metadata.
- * @throws UnableToBuildFeatureException when some error occurs while parsing the incoming schema.
- */
- void setSchema (
- List<Map<String, Object>> propertyDefinitions,
- List<Map<String, Object>> statisticDefinitions,
- List<MethodOrEventDataTransferObject> methodDefinitions) throws UnableToBuildFeatureException
- {
- _logger.info(Messages.QMAN_000010_INCOMING_SCHEMA,_parent.getOwnerId(),_parent.getName(),_name);
- _state.setSchema(propertyDefinitions, statisticDefinitions, methodDefinitions);
- }
-
- /**
- * Internal method used for building attributes definitions.
- *
- * @param props the map contained in the properties schema.
- * @param stats the map contained in the statistics schema.
- * @param attributes the management metadata for attributes.
- * @throws UnableToBuildFeatureException when it's not possibile to build one attribute definition.
- */
- void buildAttributes (
- List<Map<String, Object>> props,
- List<Map<String, Object>> stats,
- MBeanAttributeInfo[] attributes) throws UnableToBuildFeatureException
- {
- int index = 0;
- int howManyOptionalProperties = 0;
-
- for (Map<String, Object> propertyDefinition : props)
- {
- QpidFeatureBuilder builder = QpidFeatureBuilder.createPropertyBuilder(propertyDefinition);
- builder.build();
-
- QpidProperty property = (QpidProperty) builder.getQpidFeature();
-
- howManyOptionalProperties += (property.isOptional()) ? 1 : 0;
-
- _properties.put(property.getName(),property);
- _schemaOrderedProperties.add(property);
- attributes[index++]=(MBeanAttributeInfo) builder.getManagementFeature();
-
- _logger.debug(
- Messages.QMAN_200016_PROPERTY_DEFINITION_HAS_BEEN_BUILT,
- _parent.getName(),
- _name,
- property);
- }
-
- _howManyPresenceBitMasks = (int)Math.ceil((double)howManyOptionalProperties / 8);
-
- _logger.debug(
- Messages.QMAN_200018_OPTIONAL_PROPERTIES_INFO,
- _parent.getOwnerId(),
- _parent.getName(),
- _name,
- _howManyPresenceBitMasks);
-
- for (Map<String, Object> statisticDefinition : stats)
- {
- QpidFeatureBuilder builder = QpidFeatureBuilder.createStatisticBuilder(statisticDefinition);
- builder.build();
- QpidStatistic statistic = (QpidStatistic) builder.getQpidFeature();
-
- _statistics.put(statistic.getName(),statistic);
- _schemaOrderedStatistics.add(statistic);
- attributes[index++]=(MBeanAttributeInfo) builder.getManagementFeature();
-
- _logger.debug(
- Messages.QMAN_200017_STATISTIC_DEFINITION_HAS_BEEN_BUILT,
- _parent.getName(),
- _name,
- statistic);
- }
- }
-
- /**
- * Returns the object instance associated to the given identifier.
- * Note that if the identifier is not associated to any obejct instance, a new one will be created.
- *
- * @param objectId the object identifier.
- * @param registration a flag indicating whenever the (new ) instance must be registered with MBean server.
- * @return the object instance associated to the given identifier.
- */
- QpidManagedObject getObjectInstance(Binary objectId, boolean registration)
- {
- QpidManagedObject objectInstance = _objectInstances.get(objectId);
- if (objectInstance == null)
- {
- objectInstance = new QpidManagedObject(objectId);
- _objectInstances.put(objectId, objectInstance);
- if (registration)
- {
- JMX_SERVICE.registerObjectInstance(objectInstance,_parent.getOwnerId(),_parent.getName(),_name,objectId);
- }
- }
- return objectInstance;
- }
-
- /**
- * Internal method used for building method defintiions.
- *
- * @param definitions the properties map contained in the incoming schema.
- * @param operationsMetadata
- * @throws UnableToBuildFeatureException when it's not possibile to build one or more definitions.
- */
- void buildMethods (List<MethodOrEventDataTransferObject> definitions, MBeanOperationInfo[] operationsMetadata) throws UnableToBuildFeatureException
- {
- int index = 0;
- for (MethodOrEventDataTransferObject definition: definitions)
- {
- QpidFeatureBuilder builder = QpidFeatureBuilder.createMethodBuilder(definition);
- builder.build();
- operationsMetadata [index++]= (MBeanOperationInfo) builder.getManagementFeature();
- QpidMethod method = (QpidMethod) builder.getQpidFeature();
- _methods.put(method.getName(),method);
- }
- }
-
- /**
- * Header (opcode='M')
- * ObjectId of target object (128 bits)
- * Package name (str8)
- * Class name (str8)
- * Class hash (bin128)
- * Method name (str8) [as defined in the schema]
- * Now encode all input ("I") and i/o (IO) arguments in the order in which they are defined in the schema.
- * (i.e. make one pass over the argument list and encode arguments that are either input or inptu/output).
-
- * @param objectId
- * @param method
- * @param parameters
- * @throws Exception
- */
- private InvocationResult invokeMethod(Binary objectId,QpidMethod method,Object [] parameters) throws Exception
- {
- try
- {
- _service.connect();
-
- int sequenceNumber = SequenceNumberGenerator.getNextSequenceNumber();
- _methodInvocationListener.operationIsGoingToBeInvoked(new InvocationEvent(this,sequenceNumber,_exchangeChannelForMethodInvocations));
- _service.invoke(_parent.getName(), _name, _hash,objectId,parameters, method,sequenceNumber,objectId.getBankId(),objectId.getBrokerId());
-
- InvocationResult result = _exchangeChannelForMethodInvocations.poll(5000,TimeUnit.MILLISECONDS);
-
- if (result == null)
- {
- throw new TimeoutException();
- }
-
- Map<String, Object> output = method.decodeParameters(result.getOutputAndBidirectionalArgumentValues());
- result.setOutputSection(output);
-
- Log.logMethodInvocationResult(result);
-
- if (result.isException())
- {
- result.createAndThrowException();
- }
- return result;
- } finally
- {
- _service.close();
- }
- }
-
- /**
- * Updates the given obejct instance with the given incoming configuration data.
- *
- * @param instance the managed object instance.
- * @param rawData the incoming configuration data which contains new values for instance properties.
- */
- void updateInstanceWithConfigurationData(QpidManagedObject instance,byte [] rawData)
- {
- BBDecoder decoder = new BBDecoder();
- decoder.init(ByteBuffer.wrap(rawData));
-
- byte [] presenceBitMasks = decoder.readBytes(_howManyPresenceBitMasks);
- for (QpidProperty property : _schemaOrderedProperties)
- {
- try {
- Object value = property.decodeValue(decoder,presenceBitMasks);
- instance.createOrReplaceAttributeValue(property.getName(),value);
- } catch(Exception ignore) {
- _logger.error(Messages.QMAN_100016_UNABLE_TO_DECODE_FEATURE_VALUE, _parent.getName(),_name,property.getName());
- }
- }
- }
-
- /**
- * Updates the given object instance with the given incoming instrumentation data.
- *
- * @param instance the managed object instance.
- * @param rawData the incoming instrumentation data which contains new values for instance properties.
- */
- void updateInstanceWithInstrumentationData(QpidManagedObject instance,byte [] rawData)
- {
- BBDecoder decoder = new BBDecoder();
- decoder.init(ByteBuffer.wrap(rawData));
-
- for (QpidStatistic statistic : _schemaOrderedStatistics)
- {
- try {
- Object value = statistic.decodeValue(decoder);
- instance.createOrReplaceAttributeValue(statistic.getName(),value);
- } catch(Exception ignore) {
- _logger.error(Messages.QMAN_100016_UNABLE_TO_DECODE_FEATURE_VALUE, _parent.getName(),_name,statistic.getName());
- }
- }
- }
-
- @Override
- public String toString ()
- {
- return new StringBuilder()
- .append(_parent.getOwnerId())
- .append("::")
- .append(_parent.getName())
- .append('.')
- .append(_name)
- .toString();
- }
-
- /**
- * Removes the object instance associated to the given identifier.
- *
- * @param objectId the object identifier.
- */
- void removeObjectInstance (Binary objectId)
- {
- QpidManagedObject toBeRemoved = _objectInstances.remove(objectId);
- if (toBeRemoved != null)
- {
- JMX_SERVICE.unregisterObjectInstance(_parent.getOwnerId(),_parent.getName(),_name,toBeRemoved._objectId);
- }
- }
-
- /**
- * Deregisters all the object instances and release all previously acquired resources.
- */
- void releaseResources ()
- {
- _objectInstances.clear();
- JMX_SERVICE.unregisterObjectInstances();
- _service.close();
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidEntity.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidEntity.java
deleted file mode 100644
index 59f8d807b2..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidEntity.java
+++ /dev/null
@@ -1,158 +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.
- *
- */
-
-package org.apache.qpid.management.domain.model;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.DynamicMBean;
-import javax.management.MBeanInfo;
-import javax.management.RuntimeOperationsException;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.domain.model.type.Binary;
-import org.apache.qpid.management.domain.services.QpidService;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Layer supertype for QMan entities.
- *
- * @author Andrea Gazzarini
- */
-public abstract class QpidEntity
-{
- /**
- * Layer supertype for QMan managed bean entities.
- *
- * @author Andrea Gazzarini
- */
- abstract class QpidManagedEntity implements DynamicMBean
- {
- // After mbean is registered with the MBean server this collection holds the mbean attribute values.
- Map<String,Object> _attributes = new HashMap<String, Object>();
-
- /**
- * Creates or replace the given attribute.
- * Note that this is not part of the management interface of this object instance and therefore will be accessible only
- * from within this class.
- * It is used to update directly the object attributes bypassing jmx interface.
- *
- * @param attributeName the name of the attribute.
- * @param property newValue the new value of the attribute.
- */
- void createOrReplaceAttributeValue(String attributeName, Object newValue)
- {
- _attributes.put(attributeName, newValue);
- }
-
- /**
- * Get the values of several attributes of the Dynamic MBean.
- *
- * @param attributes A list of the attributes to be retrieved.
- *
- * @return The list of attributes retrieved.
- */
- public AttributeList getAttributes (String[] attributes)
- {
- if (attributes == null)
- {
- throw new RuntimeOperationsException(new IllegalArgumentException("Attributes array must not be null"));
- }
-
- AttributeList result = new AttributeList(attributes.length);
- for (int i = 0; i < attributes.length; i++)
- {
- String attributeName = attributes[i];
- try
- {
- result.add(new Attribute(attributeName,getAttribute(attributeName)));
- } catch(Exception exception)
- {
- // Already logged.
- }
- }
- return result;
- }
-
- /**
- * Returns metadata for this object instance.
- */
- // Developer Note : note that this metadata is a member of the outer class definition : in that way we create
- // that metadata only once and then it will be shared between all object instances (it's a readonly object)
- public MBeanInfo getMBeanInfo ()
- {
- return _metadata;
- }
- };
-
- final Logger _logger = Logger.get(getClass());
- final static JmxService JMX_SERVICE = new JmxService();
-
- final String _name;
- final Binary _hash;
-
- final QpidPackage _parent;
- MBeanInfo _metadata;
-
- final QpidService _service;
-
- /**
- * Builds a new class with the given name and package as parent.
- *
- * @param className the name of the class.
- * @param hash the class schema hash.
- * @param parentPackage the parent of this class.
- */
- QpidEntity(String className, Binary hash, QpidPackage parentPackage)
- {
- this._name = className;
- this._parent = parentPackage;
- this._hash = hash;
- this._service = new QpidService(_parent.getOwnerId());
-
- _logger.debug(
- Messages.QMAN_200020_ENTITY_DEFINITION_HAS_BEEN_BUILT,
- _parent.getOwnerId(),
- _parent.getName(),
- _name);
- }
-
- /**
- * Internal method used to send a schema request for this entity.
- *
- * @throws Exception when the request cannot be sent.
- */
- void requestSchema() throws Exception
- {
- try
- {
- _service.connect();
- _service.requestSchema(_parent.getName(), _name, _hash);
- _service.sync();
- } finally
- {
- _service.close();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidEvent.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidEvent.java
deleted file mode 100644
index 273ae650c1..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidEvent.java
+++ /dev/null
@@ -1,456 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.AttributeNotFoundException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.ReflectionException;
-import javax.management.RuntimeOperationsException;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.domain.model.type.Binary;
-import org.apache.qpid.transport.codec.BBDecoder;
-
-/**
- * Qpid event definition.
- *
- * @author Andrea Gazzarini
- */
-class QpidEvent extends QpidEntity
-{
-
- /**
- * State interface for this event definition.
- * Each state is responsible to handle the injection of the data and / or schema.
- *
- * @author Andrea Gazzarini
- */
- interface State
- {
- /**
- * Adds the given data for the object instance associated to the given object identifier.
- *
- * @param rawData the raw configuration data.
- */
- void addNewEventData (byte[] rawData, long currentTimestamp, int severity);
-
- /**
- * Inject the schema into this class definition.
- *
- * @param propertyDefinitions
- * @param statisticDefinitions
- * @param methodDefinitions
- * @throws UnableToBuildFeatureException when it's not possibile to parse schema and build the class definition.
- */
- public void setSchema (List<Map<String, Object>> agumentDefinitions) throws UnableToBuildFeatureException;
- };
-
-
- /**
- * This is the initial state of every qpid class.
- * The class definition instance is created but its schema has not been injected.
- * Incoming configuration & instrumentation data will be stored in raw format because we don't know how to
- * parse it until the schema arrives.
- * In addition, this state is responsible (when data arrives) to request its schema.
- */
- final State _schemaNotRequested = new State() {
-
- /**
- * Stores the incoming data in raw format and request the schema for this class.
- * After that a transition to the next state is made.
- *
- * @param objectId the object instance identifier.
- * @param rawData incoming configuration data.
- */
- public synchronized void addNewEventData (byte[] rawData, long currentTimestamp, int severity)
- {
- try
- {
- requestSchema();
- _state = _schemaRequestedButNotYetInjected;
- } catch (Exception e)
- {
- _logger.error(
- Messages.QMAN_100015_UNABLE_TO_SEND_SCHEMA_REQUEST,
- _parent.getName(),
- _name);
- } finally {
- createEventInstance(rawData,currentTimestamp,severity);
- }
- }
-
- /**
- * This method only throws an illegal state exception because when a schema arrives
- * this state is no longer valid.
- */
- public void setSchema (List<Map<String, Object>> agumentDefinitions) throws UnableToBuildFeatureException
- {
- throw new IllegalStateException("When a schema arrives it's not possible for this class to be in this state.");
- }
- };
-
- /**
- * This is the first state of this class definition : the schema is not yet injected so each injection of object data will be
- * retained in raw format.
- */
- final State _schemaRequestedButNotYetInjected = new State()
- {
- /**
- * Stores the incoming data in raw format and request the schema for this class.
- * After that a transition to the next state is made.
- *
- * @param objectId the object instance identifier.
- * @param rawData incoming configuration data.
- */
- public synchronized void addNewEventData (byte[] rawData,long currentTimestamp, int severity)
- {
- createEventInstance(rawData,currentTimestamp, severity);
- }
-
- /**
- * When a schema is injected into this defintiion the following should happen :
- * 1) the incoming schema is parsed and the class definition is built;
- * 2) the retained raw data is converted into object instance(s)
- * 3) the internal state of this class changes;
- *
- * If someting is wrong during that process the schema is not built and the state don't change.
- */
- public synchronized void setSchema (List<Map<String, Object>> argumentDefinitions) throws UnableToBuildFeatureException
- {
- MBeanAttributeInfo [] attributesMetadata = new MBeanAttributeInfo[argumentDefinitions.size()+2];
-
- buildArguments(argumentDefinitions, attributesMetadata);
-
- _metadata = new MBeanInfo(_name,_name,attributesMetadata,null,null,null);
-
- // Converting stored object instances into JMX MBean and removing raw instance data.
- for (QpidManagedEvent instance : _eventInstances)
- {
- updateEventInstanceWithData(instance);
- JMX_SERVICE.registerEventInstance(instance,_parent.getOwnerId(),_parent.getName(),_name);
- }
- _state = _schemaInjected;
- }
- };
-
- /**
- * After a schema is built into this definition this is the current state of the class.
- */
- final State _schemaInjected = new State()
- {
- /**
- * Updates the configuration state of the object instance associates with the given object identifier.
- *
- * @param objectId the object identifier.
- * @param rawData the configuration data (raw format).
- */
- public void addNewEventData (byte[] rawData,long currentTimestamp, int severity)
- {
- QpidManagedEvent instance = createEventInstance(rawData,currentTimestamp, severity);
- updateEventInstanceWithData(instance);
- JMX_SERVICE.registerEventInstance(instance,_parent.getOwnerId(),_parent.getName(),_name);
- }
-
- /**
- * Never called when the class definition has this state.
- */
- public void setSchema (List<Map<String, Object>> agumentDefinitions) throws UnableToBuildFeatureException
- {
- // N.A. : Schema is already injected.
- }
- };
-
- /**
- * MBean used for representing remote broker object instances.
- * This is the core component of the QMan domain model
- *
- * @author Andrea Gazzarini
- */
- class QpidManagedEvent extends QpidManagedEntity
- {
-
-
- // Arrays used for storing raw data before this mbean is registered to mbean server.
- final byte[] _rawEventData;
- final long _timestamp;
- final int _severity;
-
- /**
- * Builds a new managed object with the given object identifier.
- *
- * @param objectId the object identifier.
- */
- private QpidManagedEvent(byte [] data, long timestamp, int severity)
- {
- this._rawEventData = data;
- this._timestamp = timestamp;
- this._severity = severity;
- _attributes.put(SEVERITY_ATTR_NAME, _severity);
- _attributes.put(TIMESTAMP_ATTR_NAME, new Date(_timestamp));
- }
-
- /**
- * Returns the value of the given attribute.s
- *
- * @throws AttributeNotFoundException when no attribute is found with the given name.
- */
- public Object getAttribute (String attributeName) throws AttributeNotFoundException, MBeanException, ReflectionException
- {
- if (attributeName == null)
- {
- throw new RuntimeOperationsException(new IllegalArgumentException("Attribute name must not be null."));
- }
-
- if (_arguments.containsKey(attributeName) || SEVERITY_ATTR_NAME.equals(attributeName) || TIMESTAMP_ATTR_NAME.equals(attributeName))
- {
- return _attributes.get(attributeName);
- } else
- {
- throw new AttributeNotFoundException(attributeName);
- }
- }
-
- /**
- * Executes an operation on this object instance.
- *
- * @param actionName the name of the method.
- * @param params the method parameters
- * @param signature the method signature.
- */
- public Object invoke (String actionName, Object[] params, String[] signature) throws MBeanException,ReflectionException
- {
- throw new ReflectionException(new NoSuchMethodException(actionName));
- }
-
- /**
- * Sets the value of the given attribute on this object instance.
- *
- * @param attribute contains the new value of the attribute.
- * @throws AttributeNotFoundException when the given attribute is not found on this object instance.
- * @throws InvalidAttributeValueException when the given value is violating one attribute invariant.
- */
- public void setAttribute (Attribute attribute) throws AttributeNotFoundException,
- InvalidAttributeValueException, MBeanException, ReflectionException
- {
- throw new ReflectionException(new NoSuchMethodException());
- }
-
- /**
- * Sets the values of several attributes of this MBean.
- *
- * @param attributes a list of attributes: The identification of the attributes to be set and the values they are to be set to.
- * @return The list of attributes that were set, with their new values.
- */
- public AttributeList setAttributes (AttributeList attributes)
- {
- throw new RuntimeException();
- }
- }
-
- final static String SEVERITY_ATTR_NAME = "Severity";
- final static String TIMESTAMP_ATTR_NAME = "Date";
-
- private List<QpidProperty> _schemaOrderedArguments = new ArrayList<QpidProperty>();
-
- Map<String, QpidProperty> _arguments = new HashMap<String, QpidProperty>();
- List<QpidManagedEvent> _eventInstances = new LinkedList<QpidManagedEvent>();
- State _state = _schemaNotRequested;;
-
- /**
- * Builds a new class with the given name and package as parent.
- *
- * @param className the name of the class.
- * @param hash the class schema hash.
- * @param parentPackage the parent of this class.
- */
- QpidEvent(String eventClassName, Binary hash, QpidPackage parentPackage)
- {
- super(eventClassName,hash,parentPackage);
- }
-
- /**
- * Adds the configuration data for the object instance associated to the given object identifier.
- *
- * @param objectId the object identifier.
- * @param rawData the raw configuration data.
- */
- void addEventData (byte[] rawData, long currentTimestamp, int severity)
- {
- _logger.debug(
- Messages.QMAN_200021_INCOMING_EVENT_DATA,
- _parent.getOwnerId(),
- _parent.getName(),
- _name);
- _state.addNewEventData(rawData, currentTimestamp, severity);
- }
-
- /**
- * Sets the schema for this class definition.
- * A schema is basically a metadata description of all properties, statistics, methods and events of this class.
- *
- * @param propertyDefinitions properties metadata.
- * @param statisticDefinitions statistics metadata.
- * @param methodDefinitions methods metadata.
- * @throws UnableToBuildFeatureException when some error occurs while parsing the incoming schema.
- */
- void setSchema (List<Map<String, Object>> argumentDefinitions) throws UnableToBuildFeatureException
- {
- _logger.info(Messages.QMAN_000010_INCOMING_SCHEMA,_parent.getOwnerId(),_parent.getName(),_name);
- _state.setSchema(argumentDefinitions);
- }
-
- /**
- * Internal method used for building attributes definitions.
- *
- * @param props the map contained in the properties schema.
- * @param stats the map contained in the statistics schema.
- * @param attributes the management metadata for attributes.
- * @throws UnableToBuildFeatureException when it's not possibile to build one attribute definition.
- */
- void buildArguments (
- List<Map<String, Object>> arguments,MBeanAttributeInfo[] attributes) throws UnableToBuildFeatureException
- {
- int index = 0;
-
- for (Map<String, Object> argumentDefinition : arguments)
- {
- // Force metadata attributes. It is needed because arguments are "similar" to properties but they
- // aren't properties and then they haven't optional, index and access metadata attributes
- // (mandatory for build a property definition).
- argumentDefinition.put(QpidFeatureBuilder.Attribute.optional.name(),0);
- argumentDefinition.put(QpidFeatureBuilder.Attribute.index.name(),1);
- argumentDefinition.put(QpidFeatureBuilder.Attribute.access.name(),3);
-
- QpidFeatureBuilder builder = QpidFeatureBuilder.createPropertyBuilder(argumentDefinition);
- builder.build();
-
- QpidProperty argument = (QpidProperty) builder.getQpidFeature();
-
- _arguments.put(argument.getName(),argument);
- _schemaOrderedArguments.add(argument);
- attributes[index++]=(MBeanAttributeInfo) builder.getManagementFeature();
-
- _logger.debug(
- Messages.QMAN_200019_EVENT_ARGUMENT_DEFINITION_HAS_BEEN_BUILT,
- _parent.getName(),
- _name,
- argument);
- }
-
- attributes[index++] = new MBeanAttributeInfo(
- SEVERITY_ATTR_NAME,
- Integer.class.getName(),
- Messages.EVENT_SEVERITY_ATTRIBUTE_DESCRIPTION,
- true,
- false,
- false);
-
- attributes[index++] = new MBeanAttributeInfo(
- TIMESTAMP_ATTR_NAME,
- Date.class.getName(),
- Messages.EVENT_TIMESTAMP_ATTRIBUTE_DESCRIPTION,
- true,
- false,
- false);
- }
-
- /**
- * Returns the object instance associated to the given identifier.
- * Note that if the identifier is not associated to any obejct instance, a new one will be created.
- *
- * @param objectId the object identifier.
- * @param registration a flag indicating whenever the (new ) instance must be registered with MBean server.
- * @return the object instance associated to the given identifier.
- */
- QpidManagedEvent createEventInstance(byte [] data, long timestamp, int severity)
- {
- QpidManagedEvent eventInstance = new QpidManagedEvent(data, timestamp, severity);
- _eventInstances.add(eventInstance);
- return eventInstance;
- }
-
- /**
- * Updates the given obejct instance with the given incoming configuration data.
- *
- * @param instance the managed object instance.
- * @param rawData the incoming configuration data which contains new values for instance properties.
- */
- void updateEventInstanceWithData(QpidManagedEvent instance)
- {
- BBDecoder decoder = new BBDecoder();
- decoder.init(ByteBuffer.wrap(instance._rawEventData));
-
- for (QpidProperty property : _schemaOrderedArguments)
- {
- try {
- Object value = property.decodeValue(decoder);
- instance.createOrReplaceAttributeValue(property.getName(),value);
- } catch(Exception ignore) {
- _logger.error(Messages.QMAN_100016_UNABLE_TO_DECODE_FEATURE_VALUE, _parent.getName(),_name,property.getName());
- }
- }
- }
-
- @Override
- public String toString ()
- {
- return new StringBuilder()
- .append(_parent.getOwnerId())
- .append("::")
- .append(_parent.getName())
- .append(".")
- .append(_name)
- .toString();
- }
-
- /**
- * Deregisters all the object instances and release all previously acquired resources.
- */
- void releaseResources ()
- {
- _eventInstances.clear();
- JMX_SERVICE.unregisterEvents();
- _service.close();
- }
-
- /**
- * Checks if this event definition contains event instance(s).
- *
- * @return true if there is one or more managed instances.
- */
- boolean hasNoInstances()
- {
- return _eventInstances.isEmpty();
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidFeature.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidFeature.java
deleted file mode 100644
index e1ca5a4d42..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidFeature.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-/**
- * Layer Supertype for all qpid management features.
- *
- * @author Andrea Gazzarini
- */
-abstract class QpidFeature
-{
- /** The name of the feature. */
- protected String _name;
-
- /**
- * The description of the feature.
- */
- protected String _description;
-
- /**
- * Returns the description of this feature.
- *
- * @return the description of this feature.
- */
- String getDescription ()
- {
- return _description;
- }
-
- /**
- * Sets the description for this feature.
- *
- * @param description the description for this feature.
- */
- void setDescription (String description)
- {
- this._description = description;
- }
-
- /**
- * Returns the name of the feature.
- *
- * @return the name of the feature.
- */
- public String getName ()
- {
- return _name;
- }
-
- /**
- * Sets the name for this feature.
- *
- * @param name the name of this feature.
- */
- void setName (String name)
- {
- this._name = name;
- }
-
- /**
- * Returns the name of the feature.
- *
- * @return the name of the feature.
- */
- @Override
- public String toString ()
- {
- return _name;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidFeatureBuilder.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidFeatureBuilder.java
deleted file mode 100644
index d0862c15ca..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidFeatureBuilder.java
+++ /dev/null
@@ -1,454 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanFeatureInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanParameterInfo;
-
-import org.apache.qpid.management.configuration.Configuration;
-import org.apache.qpid.management.configuration.UnknownTypeCodeException;
-import org.apache.qpid.management.domain.handler.impl.MethodOrEventDataTransferObject;
-import org.apache.qpid.management.Names;
-
-/**
- * A builder used to parse incoming schema message and therefore to build a feature (property, statistic, method, event)
- * definition.
- * In order to set up the correct state for this builder, clients must create an instance of this class
- * The product of the builder will be a QpidFeature and a JMX Managemtn feature used for describing that feature in a
- * JMX environment. So, for example, for building a property definition client code should be :
- *
- * <br>- QpidFeatureBuilder builder = QpidFeature.createPropertyBuilder(...);
- * <br>- builder.build();
- * <br>- QpidProperty property = (QpidProperty) builder.getQpidFeature();
- * <br>- MBeanAttributeInfo managementAttributeInfo = (MBeanAttributeInfo)builder.getManagementFeature();
- *
- * <br>N.B.: a builder instance is not supposed to be reused. One instance for one feature!
- *
- * @author Andrea Gazzarini
- */
-class QpidFeatureBuilder
-{
-
- static enum Attribute {
- name,type,access,index,optional,unit,min,max,maxlen,desc,dir,argCount;
- };
-
- private List<Attribute> _mandatoryAttributes = new ArrayList<Attribute>();
-
- /**
- * Builder state for this class.
- * Each concrete implementor is a builder for a specific feature.
- * using the appropriate factory method.
- *
- * @author Andrea Gazzarini
- */
- interface State {
- void build() throws UnableToBuildFeatureException;
- }
-
- /**
- * Builder used for building property definition.
- */
- final State _propertyBuilder = new State() {
-
- /**
- * Builds a property definition as well a management attribute feature.
- */
- public void build () throws UnableToBuildFeatureException
- {
- QpidProperty property = new QpidProperty();
- try {
- int optionalIndex = 0;
- for (Entry<String, Object> propertyAttribute : _featureDefinition.entrySet())
- {
- Attribute attribute = Attribute.valueOf(propertyAttribute.getKey());
- switch(attribute)
- {
- case name :
- {
- property.setName(String.valueOf(propertyAttribute.getValue()));
- break;
- }
- case access :
- {
- int code = (Integer)propertyAttribute.getValue();
- property.setAccessMode(Configuration.getInstance().getAccessMode(code));
- break;
- }
- case unit :
- {
- property.setUnit(String.valueOf(propertyAttribute.getValue()));
- break;
- }
- case min :
- {
- property.setMinValue((Integer)propertyAttribute.getValue());
- break;
- }
- case max :
- {
- property.setMaxValue((Integer)propertyAttribute.getValue());
- break;
- }
- case maxlen :
- {
- property.setMaxLength((Integer)propertyAttribute.getValue());
- break;
- }
- case desc :
- {
- property.setDescription(String.valueOf(propertyAttribute.getValue()));
- break;
- }
- case type :
- {
- int code = (Integer) propertyAttribute.getValue();
- property.setType(Configuration.getInstance().getType(code));
- break;
- }
- case index :
- {
- break;
- }
- case optional :
- {
- int code = (Integer) propertyAttribute.getValue();
- if (code == 1)
- {
- property.markAsOptional(optionalIndex);
- optionalIndex++;
- }
- break;
- }
- }
- _mandatoryAttributes.remove(attribute);
- }
- } catch(Exception exception)
- {
- throw new UnableToBuildFeatureException(exception,property.getName());
- }
-
- if (!_mandatoryAttributes.isEmpty())
- {
- throw new MissingFeatureAttributesException(_mandatoryAttributes);
- }
-
- _managementFeatureInfo = new MBeanAttributeInfo(
- property.getName(),
- property.getJavaType().getName(),
- property.getDescription(),
- true,
- property.getAccessMode()==AccessMode.RW,
- false);
- _qpidFeature = property;
- }
- };
-
- final State _statisticBuilder = new State()
- {
- public void build () throws UnableToBuildFeatureException
- {
- QpidStatistic statistic = new QpidStatistic();
- try
- {
- for (Entry<String, Object> statisticAttribute : _featureDefinition.entrySet())
- {
- Attribute attribute = Attribute.valueOf(statisticAttribute.getKey());
- switch(attribute)
- {
- case name :
- {
- statistic.setName(String.valueOf(statisticAttribute.getValue()));
- break;
- }
- case unit :
- {
- statistic.setUnit(String.valueOf(statisticAttribute.getValue()));
- break;
- }
- case desc :
- {
- statistic.setDescription(String.valueOf(statisticAttribute.getValue()));
- break;
- }
- case type :
- {
- int code = (Integer) statisticAttribute.getValue();
- statistic.setType(Configuration.getInstance().getType(code));
- break;
- }
- }
- _mandatoryAttributes.remove(attribute);
- }
- } catch(Exception exception)
- {
- throw new UnableToBuildFeatureException(exception,statistic.getName());
- }
-
- if (!_mandatoryAttributes.isEmpty())
- {
- throw new MissingFeatureAttributesException(_mandatoryAttributes);
- }
-
- _managementFeatureInfo = new MBeanAttributeInfo(
- statistic.getName(),
- statistic.getJavaType().getName(),
- statistic.getDescription(),
- true,
- false,
- false);
- _qpidFeature = statistic;
- }
- };
-
- /**
- * Builder used for building a statistic definition.
- */
- final State _argumentBuilder = new State()
- {
- /**
- * Builds a property definition as well a management attribute feature.
- */
- public void build () throws UnableToBuildFeatureException
- {
- QpidArgument argument = new QpidArgument();
- for (Entry<String, Object> argumentAttribute : _featureDefinition.entrySet())
- {
- String key = argumentAttribute.getKey();
- if (Names.DEFAULT_PARAM_NAME.equals(key))
- {
- argument.setDefaultValue(argumentAttribute.getValue());
- } else {
- Attribute attribute = Attribute.valueOf(key);
- switch (attribute)
- {
- case name :
- {
- argument.setName((String)argumentAttribute.getValue());
- break;
- }
- case desc :
- {
- argument.setDescription((String)argumentAttribute.getValue());
- break;
- }
- case type :
- {
- try
- {
- argument.setType(Configuration.getInstance().getType((Integer)argumentAttribute.getValue()));
- break;
- } catch(UnknownTypeCodeException exception)
- {
- throw new UnableToBuildFeatureException(exception,argument.getName());
- }
- }
- case dir :
- {
- argument.setDirection((String)argumentAttribute.getValue());
- break;
- }
- case unit :
- {
- argument.setUnit((String)argumentAttribute.getValue());
- break;
-
- }
- }
- }
- }
-
- if (!_mandatoryAttributes.isEmpty())
- {
- throw new MissingFeatureAttributesException(_mandatoryAttributes);
- }
-
- _qpidFeature = argument;
- _managementFeatureInfo = new MBeanParameterInfo(
- argument.getName(),
- argument.getJavaType().getName(),
- argument.getDescription());
- }
- };
-
- final State _methodBuilder = new State()
- {
- public void build () throws UnableToBuildFeatureException
- {
- Map<String,Object> definition = _methodOrEventDefinition.getDefinition();
- String name = (String)definition.get(Attribute.name.name());
- if (name == null)
- {
- throw new MissingFeatureAttributesException(_mandatoryAttributes);
- }
-
- QpidMethod method = new QpidMethod((String)definition.get(Attribute.name.name()),(String) definition.get(Attribute.desc.name()));
-
- List<Map<String,Object>> args = _methodOrEventDefinition.getArgumentsDefinitions();
-
- List<MBeanParameterInfo> signature = new LinkedList<MBeanParameterInfo>();
-
- for (Map<String,Object> argumentDefinition : args)
- {
- QpidFeatureBuilder builder = QpidFeatureBuilder.createArgumentBuilder(argumentDefinition);
- builder.build();
-
- QpidArgument argument = (QpidArgument) builder.getQpidFeature();
- method.addArgument(argument);
- if (argument.isInput())
- {
- signature.add((MBeanParameterInfo) builder.getManagementFeature());
- }
- }
-
- _qpidFeature = method;
- _managementFeatureInfo = new MBeanOperationInfo(
- method.getName(),
- method.getDescription(),
- (MBeanParameterInfo[])signature.toArray(new MBeanParameterInfo[signature.size()]),
- void.class.getName(),
- MBeanOperationInfo.ACTION);
- }
- };
-
- final State _eventBuilder = new State()
- {
- public void build () throws UnableToBuildFeatureException
- {
- }
- };
-
- private MBeanFeatureInfo _managementFeatureInfo;
- private QpidFeature _qpidFeature;
- private final Map <String, Object> _featureDefinition;
- private final MethodOrEventDataTransferObject _methodOrEventDefinition;
- private State _state;
-
- static QpidFeatureBuilder createPropertyBuilder(Map<String, Object> propertyDefinition)
- {
- QpidFeatureBuilder result = new QpidFeatureBuilder(propertyDefinition);
- result._state = result._propertyBuilder;
- result._mandatoryAttributes.add(Attribute.name);
- result._mandatoryAttributes.add(Attribute.access);
- result._mandatoryAttributes.add(Attribute.type);
- result._mandatoryAttributes.add(Attribute.optional);
- result._mandatoryAttributes.add(Attribute.index);
- return result;
- }
-
- static QpidFeatureBuilder createStatisticBuilder(Map<String, Object> statisticDefinition)
- {
- QpidFeatureBuilder result = new QpidFeatureBuilder(statisticDefinition);
- result._state = result._statisticBuilder;
- result._mandatoryAttributes.add(Attribute.name);
- result._mandatoryAttributes.add(Attribute.type);
- return result;
- }
-
- static QpidFeatureBuilder createEventBuilder(Map<String, Object> eventDefinition)
- {
- QpidFeatureBuilder result = new QpidFeatureBuilder(eventDefinition);
- result._state = result._eventBuilder;
- return result;
- }
-
- static QpidFeatureBuilder createMethodBuilder(MethodOrEventDataTransferObject methodDefinition)
- {
- QpidFeatureBuilder result = new QpidFeatureBuilder(methodDefinition);
- result._state = result._methodBuilder;
- result._mandatoryAttributes.add(Attribute.name);
- return result;
- }
-
- private static QpidFeatureBuilder createArgumentBuilder(Map<String, Object> argumentDefinition)
- {
- QpidFeatureBuilder result = new QpidFeatureBuilder(argumentDefinition);
- result._state = result._argumentBuilder;
- return result;
- }
-
-
- /**
- * Builds new builder with the given data.
- * This constructor is used for building properties, statistics and arguments.
- *
- * @param definition the feature definition data.
- */
- private QpidFeatureBuilder(Map<String, Object> definition)
- {
- this._featureDefinition = definition;
- this._methodOrEventDefinition = null;
- }
-
- /**
- * Builds new builder with the given data.
- * This constructor is used for building properties, statistics and arguments.
- *
- * @param definition the feature definition data.
- */
- private QpidFeatureBuilder(MethodOrEventDataTransferObject definition)
- {
- this._featureDefinition = null;
- this._methodOrEventDefinition = definition;
- }
-
- /**
- * Returns the just built qpid feature.
- *
- * @return the qpid feature.
- */
- QpidFeature getQpidFeature()
- {
- return _qpidFeature;
- }
-
- /**
- * Return the jmx metadata for the built feature.
- *
- * @return the jmx metadata for the built feature.
- */
- MBeanFeatureInfo getManagementFeature()
- {
- return _managementFeatureInfo;
- }
-
- void build() throws UnableToBuildFeatureException
- {
- try
- {
- _state.build();
- } catch(UnableToBuildFeatureException exception)
- {
- throw exception;
- } catch(Exception exception)
- {
- throw new UnableToBuildFeatureException(exception,"Feature name is not available for debugging.");
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidMethod.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidMethod.java
deleted file mode 100644
index 7824ecc9a4..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidMethod.java
+++ /dev/null
@@ -1,147 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.qpid.transport.codec.BBDecoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-
-/**
- * Qpid method definition.
- * An entity describing an invocation that can be made on a managed object instance.
- *
- * @author Andrea Gazzarini
- */
-public class QpidMethod extends QpidFeature
-{
- /** Argument list */
- List<QpidArgument> arguments = new LinkedList<QpidArgument>();
-
- /**
- * Builds a new qpid method definition with the given name and description.
- *
- * @param name the method name.
- * @param description the method description.
- */
- QpidMethod(String name, String description)
- {
- this._name = name;
- this._description = description;
- }
-
- /**
- * Adds an argument to this method.
- *
- * @param argument the new argument to be added.
- */
- void addArgument(QpidArgument argument)
- {
- arguments.add(argument);
- }
-
- /**
- * Returns a string representation of this method.
- * The result format is <method name>(argType1 argName1 (Direction), argType2 argName2 (Direction), etc...)
- *
- * @return a string representation of this method.
- */
- @Override
- public String toString ()
- {
- StringBuilder builder = new StringBuilder()
- .append(_name)
- .append('(');
-
- for (QpidArgument argument : arguments)
- {
- builder.append(argument).append(',');
- }
-
- builder.append(')');
- return builder.toString();
- }
-
- /**
- * Encodes the given parameter values according to this method arguments definitions.
- * Note that only Input/Output and Input parameters are encoded.
- *
- * @param parameters the parameters values.
- * @param encoder the encoder used for encoding.
- */
- public void encodeParameters (Object[] parameters, Encoder encoder)
- {
- int index = 0;
- for (QpidArgument argument : arguments)
- {
- if (argument.getDirection() != Direction.O)
- {
- argument.encode(parameters[index++],encoder);
- }
- }
- }
-
- /**
- * Decodes the given input raw according to this method arguments definitions.
- * Note that only Input/Output and Output parameters are encoded.
- *
- * @param parameters the parameters values.
- * @param encoder the encoder used for encoding.
- */
- public Map<String, Object> decodeParameters (byte [] values)
- {
- BBDecoder decoder = new BBDecoder();
- decoder.init(ByteBuffer.wrap(values));
- Map<String, Object> result = new HashMap<String, Object>();
-
- for (QpidArgument argument : arguments)
- {
- if (argument.getDirection() != Direction.I)
- {
- result.put(argument.getName(),argument.decode(decoder));
- }
- }
- return result;
- }
-
- /**
- * Validates the given array of parameters against the constraint defined on this method's arguments.
- *
- * @param parameters the parameters (values) to be validated.
- * @throws ValidationException when one of the supplied values is violating some constraint.
- */
- public void validate (Object[] parameters) throws ValidationException
- {
- int index = 0;
- for (QpidArgument argument : arguments)
- {
- if (argument.getDirection() != Direction.O)
- {
- argument.validate(parameters[index++]);
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidPackage.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidPackage.java
deleted file mode 100644
index e9799cb147..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidPackage.java
+++ /dev/null
@@ -1,279 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.management.domain.handler.impl.IMethodInvocationListener;
-import org.apache.qpid.management.domain.handler.impl.MethodOrEventDataTransferObject;
-import org.apache.qpid.management.domain.model.type.Binary;
-
-/**
- * Qpid package definition.
- * A grouping of class definitions that are related to a single software component.
- * The package concept is used to extend the management schema beyond just the QPID software components.
- * The name is prefixed with "Qpid" for avoiding name conficts with java.lang.Package.
- *
- * @author Andrea Gazzarini
- */
-final class QpidPackage
-{
- /**
- * Qpid class identity.
- * Each qpid class is uniquely identifier by its name and schema-hash.
- * The schema hash is an MD5 checksum of the schema for a class.
- * It is there so we can support the case where two different versions of the same class are present at the same time.
- *
- * @author Andrea Gazzarini
- */
- class QpidClassIdentity {
- final String name;
- final Binary hash;
-
- /**
- * Builds a new class identity with the given name and hash.
- *
- * @param name the class name.
- * @param hash is an MD5 checksum of the schema of this outer class.
- */
- QpidClassIdentity(String name,Binary hash) {
- this.name = name;
- this.hash = hash;
- }
-
- @Override
- public int hashCode ()
- {
- return name.hashCode()+hash.hashCode();
- }
-
- @Override
- public boolean equals (Object obj)
- {
- QpidClassIdentity identity = (QpidClassIdentity) obj;
- return name.equals(identity.name) && hash.equals(identity.hash);
- }
- }
-
- private String _name;
- private DomainModel _parent;
- private Map<QpidClassIdentity, QpidClass> _classes = new HashMap<QpidClassIdentity, QpidClass>();
- private Map<QpidClassIdentity, QpidEvent> _events = new HashMap<QpidClassIdentity, QpidEvent>();
-
- /**
- * Builds a new package with the supplied name.
- *
- * @param name the name of the package.
- */
- QpidPackage(String name, DomainModel parent)
- {
- this._name = name;
- this._parent = parent;
- }
-
- /**
- * Returns the identifier of the broker which contains this package.
- * @return
- */
- UUID getOwnerId()
- {
- return _parent.getBrokerId();
- }
-
- /**
- * Returns the name of this package.
- *
- * @return the name of this package.
- */
- String getName ()
- {
- return _name;
- }
-
- /**
- * Adds a class definition to this package.
- * The class will be added only if its definition doesn't already exists.
- *
- * @param className the name of the class.
- * @param classHash the class schema hash.
- * @param properties the properties of the class.
- * @param statistics the statistics of the class.
- * @param methods the methods of the class.
- * @param events the events of the class.
- *
- * @throws UnableToBuildFeatureException when the class definition cannot be built due to a feature build failure.
- */
- void addClassDefinition (
- String className,
- Binary classHash,
- List<Map<String, Object>> properties,
- List<Map<String, Object>> statistics,
- List<MethodOrEventDataTransferObject> methods) throws UnableToBuildFeatureException
- {
- getQpidClass(className,classHash,true).setSchema(properties,statistics,methods);
- }
-
- void addEventDefinition (
- String eventClassName,
- Binary classHash,
- List<Map<String, Object>> arguments) throws UnableToBuildFeatureException
- {
- getQpidEvent(eventClassName,classHash,true).setSchema(arguments);
- }
-
- /**
- * Returns true if this package contains the given class definition.
- *
- * @param className the name of the class.
- * @return true if this package contains the class definition, false otherwise.
- */
- boolean alreadyContainsClassDefinition (String className, Binary hash)
- {
- return _classes.containsKey(new QpidClassIdentity(className,hash));
- }
-
- /**
- * Injects into a class the given object instance instrumentation data.
- *
- * @param className the of the class the injected object data belongs to.
- * @param objectId the object identifier.
- * @param rawData the instrumentation data (in raw format).
- */
- void setObjectInstanceInstrumentationRawData (String className, Binary classHash,Binary objectId, byte[] rawData)
- {
- getQpidClass(className, classHash,true).addInstrumentationData(objectId,rawData);
- }
-
- /**
- * Injects into a class the given object instance configuration data.
- *
- * @param className the of the class the injected object data belongs to.
- * @param objectId the object identifier.
- * @param rawData the configuration data (in raw format).
- */
- void setObjectInstanceConfigurationRawData (String className,Binary classHash, Binary objectId, byte[] rawData)
- {
- getQpidClass(className,classHash,true).addConfigurationData(objectId,rawData);
- }
-
- void setEventInstanceRawData (String eventName,Binary eventHash, byte[] rawData,long currentTimestamp,int severity)
- {
- getQpidEvent(eventName,eventHash,true).addEventData(rawData, currentTimestamp, severity);
- }
-
- /**
- * Returns the definition of the class with given name.
- *
- * @param className the name of the class.
- * @param hash the class hash.
- * @param store a flag indicating if a just created class must be stored or not.
- * @return the definition of the class with given name.
- */
- QpidClass getQpidClass(String className, Binary hash, boolean store)
- {
- QpidClassIdentity identity = new QpidClassIdentity(className,hash);
- QpidClass classDefinition = _classes.get(identity);
- if (classDefinition == null)
- {
- classDefinition = new QpidClass(className, hash,this);
- if (store)
- {
- _classes.put(identity,classDefinition);
- }
- }
- return classDefinition;
- }
-
- /**
- * Returns the definition of the class with given name.
- *
- * @param className the name of the class.
- * @param hash the class hash.
- * @param store a flag indicating if a just created class must be stored or not.
- * @return the definition of the class with given name.
- */
- QpidEvent getQpidEvent(String className, Binary hash, boolean store)
- {
- QpidClassIdentity identity = new QpidClassIdentity(className,hash);
- QpidEvent eventDefinition = _events.get(identity);
- if (eventDefinition == null)
- {
- eventDefinition = new QpidEvent(className, hash,this);
- if (store)
- {
- _events.put(identity,eventDefinition);
- }
- }
- return eventDefinition;
- }
-
- /**
- * Returns a string representation of this class.
- * That is, this method returns the simple name (not FQN) of this class.
- */
- @Override
- public String toString ()
- {
- return _name;
- }
-
- /**
- * Removes the object instance associated to the given parameters.
- *
- * @param className the class definition of the object instance.
- * @param classHash the class hash
- * @param objectId the object identifier.
- */
- void removeObjectInstance (String className, Binary classHash, Binary objectId)
- {
- QpidClass qpidClass = getQpidClass(className,classHash,false);
- qpidClass.removeObjectInstance(objectId);
- }
-
- /**
- * Releases all previously acquired resources of this package.
- */
- void releaseResources ()
- {
- for (QpidClass qpidClass : _classes.values())
- {
- qpidClass.releaseResources();
- }
-
- for (QpidEvent qpidEvent: _events.values())
- {
- qpidEvent.releaseResources();
- }
- }
-
- /**
- * Returns the method invocation listener of the corresponing parent domain model.
- *
- * @return the method invocation listener of the corresponing parent domain model.
- */
- IMethodInvocationListener getMethodInvocationListener ()
- {
- return _parent.getMethodInvocationListener();
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidProperty.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidProperty.java
deleted file mode 100644
index 089b00c71c..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidProperty.java
+++ /dev/null
@@ -1,295 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.lang.reflect.Constructor;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.configuration.Configuration;
-import org.apache.qpid.management.domain.model.type.Type;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Qpid property definition.
- *
- * @author Andrea Gazzarini
- */
-class QpidProperty extends QpidAttribute
-{
- private final static Logger LOGGER = Logger.get(QpidProperty.class);
-
- private final static int [] MASKS = {1,2,4,8,16,32,64,128};
-
- /**
- * Decoder interface used for decoding incomng values for this property.
- *
- * @author Andrea Gazzarini
- */
- interface Decoder
- {
- Object decodeValue(org.apache.qpid.transport.codec.Decoder decoder,byte [] presenceBitMasks);
- }
-
- /**
- * Decoder used for decoding incoming values for this optional property.
- */
- final Decoder _optionalPropertyDecoder = new Decoder() {
-
- public Object decodeValue (org.apache.qpid.transport.codec.Decoder decoder, byte[] presenceBitMasks)
- {
- return ((presenceBitMasks[_optionalIndex/8] & MASKS[_maskIndex]) != 0)
- ? QpidProperty.this.decodeValue(decoder)
- : null;
- }
- };
-
- /**
- * Decoder used for decoding incoming values for this mandatory property.
- */
- final Decoder _mandatoryPropertyDecoder = new Decoder() {
-
- public Object decodeValue (org.apache.qpid.transport.codec.Decoder decoder, byte[] presenceBitMasks)
- {
- return QpidProperty.this.decodeValue(decoder);
- }
- };
-
-
- /**
- * Null object used to perform a dummy validation.
- * This is the default validator installed at creation time.
- */
- final static IValidator EMPTY_VALIDATOR = new IValidator()
- {
- public void validate (Object value) throws ValidationException
- {
- // Nothing to do here.
- }
- };
-
- /**
- * Validator responsible for validating strings.
- * At the moment the only constraint that should be applied to a string feature is the "max length"
- */
- class StringValidator implements IValidator
- {
- public void validate (Object value) throws ValidationException
- {
- if ((_maxLength != Integer.MIN_VALUE) && (value != null)){
- int length = value.toString().length();
- if (length > _maxLength) {
- throw new ValidationException(
- ValidationException.MAX_LENGTH,
- _maxLength,
- _name,
- length);
- }
- }
- }
- };
-
- /**
- * Validator responsible for validating numbers.
- */
- class NumberValidator implements IValidator
- {
- public void validate (Object value) throws ValidationException
- {
- if (value != null) {
- double numericValue = ((Number)value).doubleValue();
- if (_minValue != Integer.MIN_VALUE && numericValue < _minValue) {
- throw new ValidationException(
- ValidationException.MIN_VALUE,
- _minValue,
- _name,
- numericValue);
- }
-
- if (_maxValue != Integer.MIN_VALUE && numericValue > _maxValue) {
- throw new ValidationException(
- ValidationException.MAX_VALUE,
- _maxValue,
- _name,
- numericValue);
- }
- }
- }
- };
-
- private AccessMode _accessMode;
- private int _minValue = Integer.MIN_VALUE;
- private int _maxValue = Integer.MIN_VALUE;
- private int _maxLength = Integer.MIN_VALUE;
-
- private int _optionalIndex;
- private int _maskIndex;
-
- Decoder _decoder = _mandatoryPropertyDecoder;
-
- private IValidator _validator = EMPTY_VALIDATOR;
-
- /**
- * Validates the given value according to the current validator.
- * It delegates the validation to the current installed validator.
- *
- * @param value the value of this qpid property.
- * @throws ValidationException when the given value is violating the current validator constraints.
- */
- void validate(Object value) throws ValidationException {
- _validator.validate(value);
- }
-
- /**
- * Sets the type of this property.
- * In addition this method tries to detect if a validator has been associated with the type.
- * If no validator is found then the default validator will be used; that is : no validator will be performed on this
- * property.
- *
- * @param type the type of this property.
- */
- void setType (Type type)
- {
- super.setType(type);
- try {
- Class<?> validatorClass = Class.forName(Configuration.getInstance().getValidatorClassName(type));
- Constructor<?> validatorConstructor = validatorClass.getDeclaredConstructor(QpidProperty.class);
- _validator = (IValidator) validatorConstructor.newInstance(this);
- LOGGER.debug(Messages.QMAN_200022_VALIDATOR_INSTALLED ,validatorClass.getName(), type);
- } catch(Exception exception) {
- _validator = EMPTY_VALIDATOR;
- LOGGER.debug(Messages.QMAN_200023_VALIDATOR_NOT_FOUND , type);
- }
- }
-
- /**
- * Gets the value of this property according to its type definition.
- *
- * @param decoder the decoder used to extract the value.
- * @return the value of this feature according to its type definition
- */
- Object decodeValue(org.apache.qpid.transport.codec.Decoder decoder,byte [] presenceBitMasks)
- {
- return _decoder.decodeValue(decoder, presenceBitMasks);
- }
-
- /**
- * Sets access mode for this property.
- *
- * @param accessMode the access mode for this property.
- */
- void setAccessMode (AccessMode accessMode)
- {
- this._accessMode = accessMode;
- }
-
- /**
- * Gets the minimum allowed value for this property.
- *
- * @return the minimum allowed value for this property.
- */
- int getMinValue ()
- {
- return _minValue;
- }
-
- /**
- * Sets the minimum allowed value for this property.
- *
- * @param minValue the minimum allowed value for this property.
- */
- void setMinValue (int minValue)
- {
- this._minValue = minValue;
- }
-
- /**
- * Gets the maximum allowed value for this property.
- *
- * @return the maximum allowed value for this property.
- */
- int getMaxValue ()
- {
- return _maxValue;
- }
-
- /**
- * Sets the masimum allowed value for this property.
- *
- * @param maxValue the maximum allowed value for this property.
- */
- void setMaxValue (int maxValue)
- {
- this._maxValue = maxValue;
- }
-
- /**
- * Gets the max length value for this property.
- *
- * @return the max length value for this property.
- */
- int getMaxLength ()
- {
- return _maxLength;
- }
-
- /**
- * Sets the max length value for this property.
- *
- * @param maxLength the max length value for this property.
- */
- void setMaxLength (int maxLength)
- {
- this._maxLength = maxLength;
- }
-
- /**
- * Gets the description of this property.
- *
- * @return the description of this property.
- */
- AccessMode getAccessMode ()
- {
- return _accessMode;
- }
-
- /**
- * Marks this property as optional.
- *
- * @param optional the optional attribute value for this property.
- * @param index the index of this optional property
- */
- void markAsOptional (int index)
- {
- this._optionalIndex = index;
- this._maskIndex = (_optionalIndex >= 8) ? _optionalIndex-8 : _optionalIndex;
- _decoder = _optionalPropertyDecoder;
- }
-
- /**
- * Returns true if this property is marked as optional.
- *
- * @return true if this property is marked as optional, false otherwise.
- */
- boolean isOptional ()
- {
- return _decoder == _optionalPropertyDecoder;
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidStatistic.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidStatistic.java
deleted file mode 100644
index 37a652c098..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/QpidStatistic.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-/**
- * Qpid statistic definition.
- *
- * A statistic is a typed member of a class which represents an instrumentation attribute of the class.
- * Statistics are always read-only in nature and tend to change rapidly.
- *
- * @author Andrea Gazzarini
- */
-class QpidStatistic extends QpidAttribute
-{
- // EMPTY CLASS : Statistic metadata are all defined in superclasses.
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/UnableToBuildFeatureException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/UnableToBuildFeatureException.java
deleted file mode 100644
index fc4506779b..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/UnableToBuildFeatureException.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-/**
- * Thrown when a feature (property, statistic, method or event) definition cannot be built due to schema parsing errors.
- *
- * @author Andrea Gazzarini
- */
-public class UnableToBuildFeatureException extends Exception
-{
- private static final long serialVersionUID = 5180111828887602836L;
-
- /**
- * Builds a new UnableToBuildFeatureException with the specified cause.
- *
- * @param exception the exception cause.
- */
- UnableToBuildFeatureException(Exception exception, String featureName)
- {
- super( (featureName != null) ? featureName : "Feature name is not available for debugging purposes." ,exception);
- }
-
- /**
- * Builds a new UnableToBuildFeatureException with the specified message.
- *
- * @param message the detail message.
- */
- UnableToBuildFeatureException(String message)
- {
- super(message);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/ValidationException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/ValidationException.java
deleted file mode 100644
index 3b117e5b9d..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/ValidationException.java
+++ /dev/null
@@ -1,105 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-/**
- * Thrown when an attempt is made in order to update / change the state of an object and a constraint on that state
- * is violated.
- *
- * @author Andrea Gazzarini
- */
-public class ValidationException extends Exception
-{
- private static final long serialVersionUID = -5218828669655586205L;
-
- public final static String MAX_LENGTH = "Max Length";
- public final static String MAX_VALUE = "Max Value";
- public final static String MIN_VALUE = "Min Value";
-
- private final String _featureName;
- private final Object _featureValue;
-
- private final Number _constraintValue;
- private final String _constraintName;
-
- /**
- * Builds a new validation exception with the specified parameters.
- *
- * @param constraintName the name of the violated constraint.
- * @param constraintValue the value of the violated constraint.
- * @param featureName the name of the violating feature.
- * @param featureValue the value of the violating feature.
- */
- ValidationException(String constraintName,Number constraintValue, String featureName,Object featureValue)
- {
- super(String.format(
- "Property constraint violation : " +
- "%s allowed for property %s is %s but received value was %s",
- constraintName,
- featureName,
- constraintValue,
- featureValue));
- this._constraintName = constraintName;
- this._constraintValue = constraintValue;
- this._featureName = featureName;
- this._featureValue = featureValue;
- }
-
- /**
- * Returns the value of the violating feature.
- *
- * @return the value of the violating feature.
- */
- public Object getFeatureValue ()
- {
- return _featureValue;
- }
-
- /**
- * Returns the name of the violating feature.
- *
- * @return the name of the violating feature.
- */
- public String getFeatureName()
- {
- return _featureName;
- }
-
- /**
- * Returns the value of the violated constraint.
- *
- * @return the value of the violated constraint.
- */
- public Number getConstraintValue ()
- {
- return _constraintValue;
- }
-
- /**
- * Returns the name of the violated constraint.
- *
- * @return the name of the violated constraint.
- */
- public String getConstraintName ()
- {
- return _constraintName;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/AbsTime.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/AbsTime.java
deleted file mode 100644
index 28f5f70c04..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/AbsTime.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class AbsTime extends Type
-{
- public AbsTime()
- {
- super(Long.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return decoder.readInt64();
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeInt64((Long)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Binary.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Binary.java
deleted file mode 100644
index 8009150eb2..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Binary.java
+++ /dev/null
@@ -1,151 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import java.io.Serializable;
-import java.util.Arrays;
-import java.util.UUID;
-
-import org.apache.qpid.management.messages.AmqpCoDec;
-import org.apache.qpid.transport.codec.Encoder;
-
-/**
- * It is a simple wrapper for a byte array (for example a 128bin).
- * It is used to let QMan deal with an object instead of an array.
- *
- * @author Andrea Gazzarini
- */
-public final class Binary implements Serializable
-{
- private static final long serialVersionUID = -6865585077320637567L;
-
- // Marker internal (empty) interface
- private interface State extends Serializable{}
-
- /**
- * Internal state of this object used to denote the situation when the hashcode() method has never been called.
- * After the hashcode has been computed this class switches the state of the outer object to the next state.
- */
- State hashCodeNotYetComputed = new State()
- {
- private static final long serialVersionUID = 221632033761266959L;
-
- @Override
- public int hashCode ()
- {
- hashCode = Arrays.hashCode(_bytes);
- state = hashCodeAlreadyComputed;
- return hashCode;
- }
- };
-
- /**
- * Internal state of this object used to denote the situation where the hashcode() method has already been computed.
- * Simply it returns the just computed value for the hashcode.
- */
- State hashCodeAlreadyComputed = new State()
- {
- private static final long serialVersionUID = 221632033761266959L;
-
- @Override
- public int hashCode ()
- {
- return hashCode;
- }
- };
-
- private final UUID uuid;
- private final byte [] _bytes;
- private long _first;
- private int hashCode;
-
- /** Current state (hashcode computation). */
- State state = hashCodeNotYetComputed;
-
- /**
- * Builds a new binary with the given byte array.
- *
- * @param bytes the wrapped data.
- */
- public Binary(byte [] bytes)
- {
- this._bytes = bytes;
- byte [] array = new byte [8];
- System.arraycopy(_bytes, 0, array, 0, 8);
- _first = AmqpCoDec.unpack64(array);
- uuid = UUID.randomUUID();
- }
-
- @Override
- public int hashCode ()
- {
- return state.hashCode();
- }
-
- @Override
- public boolean equals (Object obj)
- {
- try
- {
- Binary binary = (Binary)obj;
- return Arrays.equals(_bytes, binary._bytes);
- } catch (Exception exception)
- {
- return false;
- }
- }
-
- /**
- * Encodes the content (wrapped byte array) of this instance using the given encoder.
- *
- * @param encoder the encoder used to encode instance content.
- */
- public void encode(Encoder encoder)
- {
- encoder.writeBin128(_bytes);
- }
-
- @Override
- public String toString ()
- {
- return uuid.toString();
- }
-
- /**
- * Returns the bank identifier derived from this object identifier.
- *
- * @return the bank identifier derived from this object identifier.
- */
- public long getBankId()
- {
- return _first & 0x000000000FFFFFFF;
- }
-
- /**
- * Returns the broker identifier derived from this object identifier.
- *
- * @return the broker identifier derived from this object identifier.
- */
- public long getBrokerId()
- {
- return (_first & 281474708275200L) >> 28;
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Boolean.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Boolean.java
deleted file mode 100644
index c339b870ac..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Boolean.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Boolean extends Type
-{
- public Boolean()
- {
- super(java.lang.Boolean.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return (decoder.readUint8() == 1);
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeUint8( ((java.lang.Boolean)value) ? (short)1 : 0 );
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/DeltaTime.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/DeltaTime.java
deleted file mode 100644
index a788e2f8e1..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/DeltaTime.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class DeltaTime extends Type
-{
- public DeltaTime()
- {
- super(Long.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return decoder.readUint64();
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeUint64((Long)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Double.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Double.java
deleted file mode 100644
index d36af3d3df..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Double.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Double extends Type
-{
- public Double()
- {
- super(java.lang.Double.class);
- }
-
- @Override
- public Object decode(Decoder decoder)
- {
- return decoder.readDouble();
- }
-
- @Override
- public void encode(Object value, Encoder encoder)
- {
- encoder.writeDouble((java.lang.Double)value);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Float.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Float.java
deleted file mode 100644
index cb1f6e78a7..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Float.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Float extends Type
-{
- public Float()
- {
- super(java.lang.Float.class);
- }
-
- @Override
- public Object decode(Decoder decoder)
- {
- return decoder.readFloat();
- }
-
- @Override
- public void encode(Object value, Encoder encoder)
- {
- encoder.writeFloat((java.lang.Float)value);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int16.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int16.java
deleted file mode 100644
index f4685f0295..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int16.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Int16 extends Type
-{
- public Int16()
- {
- super(Short.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return decoder.readInt16();
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeInt16((Short)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int32.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int32.java
deleted file mode 100644
index ae5be90a2d..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int32.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Int32 extends Type
-{
- public Int32()
- {
- super(Integer.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return decoder.readInt32();
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeInt32((Integer)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int64.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int64.java
deleted file mode 100644
index f76818344e..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int64.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Int64 extends Type
-{
- public Int64()
- {
- super(Long.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return decoder.readInt64();
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeInt64((Long)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int8.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int8.java
deleted file mode 100644
index 6f7c3b24d0..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Int8.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Int8 extends Type
-{
- public Int8()
- {
- super(Byte.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return decoder.readInt8();
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeInt8((Byte)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Map.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Map.java
deleted file mode 100644
index cc540ff4da..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Map.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Map extends Type
-{
- public Map()
- {
- super(java.util.Map.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return decoder.readMap();
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeMap((java.util.Map<String, Object>)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/ObjectReference.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/ObjectReference.java
deleted file mode 100644
index 13e1b68d26..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/ObjectReference.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class ObjectReference extends Type
-{
- public ObjectReference()
- {
- super(byte[].class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return decoder.readBin128();
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- ((Binary)value).encode(encoder);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Str16.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Str16.java
deleted file mode 100644
index 42829ce176..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Str16.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Str16 extends Type
-{
- public Str16()
- {
- super(String.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return decoder.readStr16();
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeStr16((String)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Str8.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Str8.java
deleted file mode 100644
index f9b747ce6d..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Str8.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Str8 extends Type
-{
- public Str8()
- {
- super(String.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return decoder.readStr8();
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeStr8((String)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Type.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Type.java
deleted file mode 100644
index c455faaf2c..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Type.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-/**
- * Layer supertype for all management "types".
- *
- * @author Andrea Gazzarini
- */
-public abstract class Type
-{
- /** Java representation of this type. */
- protected final Class<?> javaType;
-
- /**
- * Builds a new management type wiich wraps the given java type.
- *
- * @param javaType the java type.
- */
- Type(Class<?> javaType)
- {
- this.javaType = javaType;
- }
-
- /**
- * Returns the wrapped java type.
- *
- * @return the wrapped java type.
- */
- public Class<?> getJavaType ()
- {
- return javaType;
- }
-
- /**
- * Each concrete subclass must define here how to decode incoming data according.
- *
- * @param decoder the decoder used to extract data.
- * @return the "typed" value.
- *
- */
- public abstract Object decode(Decoder decoder);
-
- /**
- * Returns a string representation of this type.
- *
- * @return a string representation of this type.
- */
- @Override
- public String toString ()
- {
- return new StringBuilder(getClass().getName())
- .append(" (wraps ")
- .append(javaType.getName())
- .append(')').toString();
- }
-
- /**
- * Identity for types is based on wrapped java type identity.
- */
- @Override
- public boolean equals (Object obj)
- {
- return getClass() == obj.getClass();
- }
-
- @Override
- public int hashCode ()
- {
- return getClass().hashCode();
- }
-
- /**
- * Encodes the given values according to this type definition.
- *
- * @param value the value to be encoded.
- * @param encoder the encoder.
- */
- public abstract void encode (Object value,Encoder encoder);
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint16.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint16.java
deleted file mode 100644
index 2d3edd41ea..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint16.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Uint16 extends Type
-{
- public Uint16()
- {
- super(Integer.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return new Integer(decoder.readUint16());
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeUint16((Integer)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint32.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint32.java
deleted file mode 100644
index c5fb981bb0..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint32.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Uint32 extends Type
-{
- public Uint32()
- {
- super(Long.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return new Long(decoder.readUint32());
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeUint32((Long)value);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint64.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint64.java
deleted file mode 100644
index 9182f883bf..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint64.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Uint64 extends Type
-{
- public Uint64()
- {
- super(Long.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return new Long(decoder.readUint64());
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeUint64((Long)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint8.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint8.java
deleted file mode 100644
index ab7e78856c..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uint8.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Uint8 extends Type
-{
- public Uint8()
- {
- super(Short.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return new Short(decoder.readUint8());
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeUint8((Short)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uuid.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uuid.java
deleted file mode 100644
index 1b3be954d6..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/model/type/Uuid.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import java.util.UUID;
-
-import org.apache.qpid.transport.codec.Decoder;
-import org.apache.qpid.transport.codec.Encoder;
-
-public class Uuid extends Type
-{
- public Uuid()
- {
- super(UUID.class);
- }
-
- @Override
- public Object decode (Decoder decoder)
- {
- return decoder.readUuid();
- }
-
- @Override
- public void encode (Object value, Encoder encoder)
- {
- encoder.writeUuid((UUID)value);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/BrokerMessageListener.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/BrokerMessageListener.java
deleted file mode 100644
index aa588043aa..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/BrokerMessageListener.java
+++ /dev/null
@@ -1,177 +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.
- *
- */
-package org.apache.qpid.management.domain.services;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.qpid.api.Message;
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.Protocol;
-import org.apache.qpid.management.domain.handler.base.IMessageHandler;
-import org.apache.qpid.management.domain.model.DomainModel;
-import org.apache.qpid.nclient.util.MessageListener;
-import org.apache.qpid.transport.codec.BBDecoder;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Message listener used for processing incoming messages.
- * So it is installed as a consumer on a specific channel and when a new message arrives:
- *
- * 1) Performs a sanity check on the message (magic number, sequence number)
- * 2) Extracts the opcode and looks for one message handler associated with that opcode.
- * 3) If a message handler is found the delegates the message processing; otherwise a log message is written to indicate
- * that the message will be skipped.
- *
- * @author Andrea Gazzarini
- */
-class BrokerMessageListener implements MessageListener
-{
- private final static Logger LOGGER = Logger.get(BrokerMessageListener.class);
-
- private static class Log
- {
- // Debugs the content of the incoming message.
- static void debugIncomingMessage(ByteBuffer message)
- {
- if (LOGGER.isDebugEnabled())
- {
- LOGGER.debug(Messages.QMAN_200001_INCOMING_MESSAGE_HAS_BEEN_RECEIVED, Arrays.toString(message.array()));
- }
- }
-
- // Debugs all the configured handlers.
- static void debugConfiguredHandlers (Map<Character, IMessageHandler> _handlers)
- {
- if (LOGGER.isDebugEnabled())
- {
- for (Entry<Character, IMessageHandler> entry : _handlers.entrySet())
- {
- LOGGER.debug(Messages.QMAN_200002_OPCODE_HANDLER_ASSOCIATION,entry.getKey(),entry.getValue());
- }
- }
- }
- }
-
- Map<Character, IMessageHandler> _handlers = new HashMap<Character, IMessageHandler>();
- private DomainModel _domainModel;
-
- /**
- * Builds a new message listener with the given broker domain model.
- *
- * @param model the managed broker domain model.
- */
- BrokerMessageListener(DomainModel model)
- {
- this._domainModel = model;
- }
-
- /**
- * When a new message arrives this method is called.
- * 1) Performs a sanity check on the message (magic number, sequence number)
- * 2) Extracts the opcode and looks for one message handler associated with that opcode.
- * 3) If a message handler is found the delegates the message processing; otherwise a log message is written to indicate
- * that the message will be skipped.
- *
- * @param message the incoming message.
- */
- public void onMessage (Message compoundMessage)
- {
- try
- {
- MessageTokenizer tokenizer = new MessageTokenizer(compoundMessage);
- while (tokenizer.hasMoreElements())
- {
- dispatch(tokenizer.nextElement());
- }
- } catch(IOException exception)
- {
- LOGGER.error(exception,Messages.QMAN_100002_MESSAGE_READ_FAILURE);
- } catch(Exception exception)
- {
- LOGGER.error(exception,Messages.QMAN_100003_MESSAGE_PROCESS_FAILURE);
- }
- }
-
- /**
- * Configures a new handler with this listener.
- * After that, each time a message arrives with the specified opcode, this handler will be responsible for
- * processing.
- * Note that calling this method will switch this listener to a WORKING state.
- *
- * @param opcode the operation code.
- * @param handler the message handler.
- */
- void setHandlers(Map<Character, IMessageHandler> handlers)
- {
- for (Entry<Character, IMessageHandler> entry : handlers.entrySet())
- {
- char opcode = entry.getKey();
- IMessageHandler handler = entry.getValue();
- try
- {
- handler.setDomainModel(_domainModel);
- _handlers.put(opcode, handler);
- } catch(Exception exception) {
- LOGGER.error(exception,Messages.QMAN_100004_HANDLER_INITIALIZATION_FAILURE, opcode);
- }
- }
- }
-
- /**
- * Dispatches the given message to the appropriate handler.
- *
- * @param message the incoming message.
- * @throws IOException when the message content cannot be read.
- */
- private void dispatch(Message message) throws IOException
- {
- ByteBuffer buffer = message.readData();
-
- String magicNumber = new String(new byte[] {buffer.get(),buffer.get(),buffer.get()});
- if (!Protocol.MAGIC_NUMBER.equals(magicNumber))
- {
- LOGGER.error(Messages.QMAN_100001_BAD_MAGIC_NUMBER_FAILURE,magicNumber);
- return;
- }
-
- char opcode = (char)buffer.get();
-
- IMessageHandler handler = _handlers.get(opcode);
- if (handler != null)
- {
- BBDecoder decoder = new BBDecoder();
- decoder.init(buffer);
-
- LOGGER.debug(Messages.QMAN_200003_MESSAGE_FORWARDING,opcode,handler);
-
- handler.process(decoder,decoder.readSequenceNo());
- } else
- {
- LOGGER.warn(Messages.QMAN_300001_MESSAGE_DISCARDED,opcode);
- Log.debugConfiguredHandlers(_handlers);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/ManagementClient.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/ManagementClient.java
deleted file mode 100644
index a3584571f3..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/ManagementClient.java
+++ /dev/null
@@ -1,231 +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.
- *
- */
-package org.apache.qpid.management.domain.services;
-
-import java.util.UUID;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.Names;
-import org.apache.qpid.management.configuration.BrokerConnectionData;
-import org.apache.qpid.management.configuration.Configuration;
-import org.apache.qpid.management.domain.model.DomainModel;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * This is the Object representation of a management client.
- * According to specification : "A software component that is separate from the messaging broker, connected to the
- * management broker via an AMQP connection, which allows any software component to be managed remotely by QPID."
- *
- * @author Andrea Gazzarini
- */
-final class ManagementClient
-{
- private final static Logger LOGGER = Logger.get(ManagementClient.class);
-
- private final String _managementQueueName;
- private final String _methodReplyQueueName;
-
- private DomainModel _domainModel;
- private QpidService _service;
-
- /**
- * Builds a new <code>ManagementClient</code> with the given identifier and connection data.
- *
- * @param brokerId the broker identifier.
- * @param connectionData the broker connection data (host, port, etc...)
- */
- ManagementClient(UUID brokerId,BrokerConnectionData connectionData)
- {
- _service = new QpidService(brokerId);
- _domainModel = new DomainModel(brokerId);
- _managementQueueName = Configuration.getInstance().getManagementQueueName();
- _methodReplyQueueName = Configuration.getInstance().getMethodReplyQueueName();
- }
-
- /**
- * Establishing initial communication Between Client and Broker.
- * According to specification :
- * "Communication is established between the management client and management agent using normal AMQP procedures.
- * The client creates a connection to the broker and then establishes a session with its corresponding channel.
- * Two private queues are then declared.
- * A management queue is declared and bound to the qpid.management exchange with "mgmt.#" as routing key; in that
- * way all management-related messages sent to the exchange will be received by this client.
- * When a client successfully binds to the qpid.management exchange, the management agent schedules a schema
- * broadcast to be sent to the exchange.
- * The agent will publish, via the exchange, a description of the schema for all manageable objects in its control. That
- * schema is therefore received by this service and it will be part of service's domain model."
- *
- * @throws StartupFailureException when this management client cannot perform startup operations due to an error.
- */
- void estabilishFirstConnectionWithBroker() throws StartupFailureException{
- try {
- connectWithBroker();
-
- createAndBindMethodReplyQueue();
- createAndBindManagementQueue();
-
- registerConsumerOnManagementQueue();
- registerConsumerOnMethodReplyQueue();
-
- synchronize();
- } catch(Exception exception)
- {
- try {
- _service.close();
- } catch(Exception ignore)
- {
- }
- throw new StartupFailureException(exception);
- }
- }
-
- /**
- * Shutdown procedure for this management client.
- */
- void shutdown ()
- {
- LOGGER.info(Messages.QMAN_000011_SHUTDOWN_INITIATED,_domainModel.getBrokerId());
-
- removeMethodReplyConsumer();
- destroyAndUnbingMethodReplyQueue();
-
- removeManagementConsumer();
- destroyAndUnbingManagementQueue();
-
- _domainModel.releaseResources();
-
- _service.close();
-
- LOGGER.info(Messages.QMAN_000012_MANAGEMENT_CLIENT_SHUT_DOWN,_domainModel.getBrokerId());
- }
-
- /**
- * Registers a consumer (that is, a listener) on the method-reply queue.
- */
- private void registerConsumerOnMethodReplyQueue ()
- {
- BrokerMessageListener methodReplyChannelListener = new BrokerMessageListener(_domainModel);
- methodReplyChannelListener.setHandlers(Configuration.getInstance().getMethodReplyQueueHandlers());
- _service.createSubscription(_methodReplyQueueName, _methodReplyQueueName, methodReplyChannelListener);
-
- LOGGER.info(Messages.QMAN_000013_METHOD_REPLY_CONSUMER_INSTALLED, _domainModel.getBrokerId());
- }
-
- /**
- * Registers a consumer (listener) on the management queue.
- */
- private void registerConsumerOnManagementQueue () throws QpidException
- {
- BrokerMessageListener managementChannelListener = new BrokerMessageListener(_domainModel);
- managementChannelListener.setHandlers(Configuration.getInstance().getManagementQueueHandlers());
- _service.createSubscription(_managementQueueName, _managementQueueName, managementChannelListener);
-
- LOGGER.info(Messages.QMAN_000014_MANAGEMENT_CONSUMER_INSTALLED, _domainModel.getBrokerId());
- }
-
- /**
- * Declares a management queue and bound it to the "qpid.management" exchange with "mgmt.#" as routing key;
- */
- private void createAndBindManagementQueue ()
- {
- _service.declareQueue(_managementQueueName);
- _service.declareBinding(
- _managementQueueName,
- Names.MANAGEMENT_EXCHANGE,
- Names.MANAGEMENT_ROUTING_KEY);
-
- LOGGER.info(Messages.QMAN_000015_MANAGEMENT_QUEUE_DECLARED,_managementQueueName,_domainModel.getBrokerId());
- }
-
- /**
- * Declares a private queue for receiving method replies (after method invocations).
- * This queue is bound to the amq.direct exchange using a routing key equal to the name of the queue.
- */
- private void createAndBindMethodReplyQueue ()
- {
- _service.declareQueue(_methodReplyQueueName);
- _service.declareBinding(_methodReplyQueueName, Names.AMQ_DIRECT_QUEUE, _methodReplyQueueName);
-
- LOGGER.info(Messages.QMAN_000016_METHOD_REPLY_QUEUE_DECLARED,_methodReplyQueueName, _domainModel.getBrokerId());
- }
-
- /**
- * Removes the method-reply queue consumer.
- */
- private void removeMethodReplyConsumer()
- {
- _service.removeSubscription(_methodReplyQueueName);
-
- LOGGER.info(Messages.QMAN_000017_CONSUMER_HAS_BEEN_REMOVED,_methodReplyQueueName,_domainModel.getBrokerId());
- }
-
- /**
- * Unbind the method reply queue and after that destroy it from remote broker.
- */
- private void destroyAndUnbingMethodReplyQueue()
- {
- _service.declareUnbinding(_methodReplyQueueName, Names.AMQ_DIRECT_QUEUE, _methodReplyQueueName);
- _service.deleteQueue(_methodReplyQueueName);
-
- LOGGER.info(Messages.QMAN_000018_QUEUE_UNDECLARED,_methodReplyQueueName,_domainModel.getBrokerId());
- }
-
- /**
- * Removes the management queue consumer.
- */
- private void removeManagementConsumer()
- {
- _service.removeSubscription(_managementQueueName);
-
- LOGGER.info(Messages.QMAN_000017_CONSUMER_HAS_BEEN_REMOVED,_managementQueueName,_domainModel.getBrokerId());
- }
-
- /**
- * Unbind the management queue and after that destroy it from remote broker.
- */
- private void destroyAndUnbingManagementQueue()
- {
- _service.declareUnbinding(_managementQueueName, Names.MANAGEMENT_EXCHANGE, Names.MANAGEMENT_ROUTING_KEY);
- _service.deleteQueue(_managementQueueName);
-
- LOGGER.info(Messages.QMAN_000018_QUEUE_UNDECLARED, _managementQueueName,_domainModel.getBrokerId());
- }
-
- /**
- * Connects this client with the broker.
- *
- * @throws QpidException when it's not possibile to connect with the broker.
- */
- private void connectWithBroker() throws Exception
- {
- _service.connect();
- }
-
- /**
- * All the Management client commands are asynchronous.
- * Synchronous behavior is achieved through invoking the sync method.
- */
- private void synchronize()
- {
- _service.sync();
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/MessageTokenizer.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/MessageTokenizer.java
deleted file mode 100644
index 9275255517..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/MessageTokenizer.java
+++ /dev/null
@@ -1,152 +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.
- *
- */
-
-package org.apache.qpid.management.domain.services;
-
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.LinkedList;
-
-import org.apache.qpid.api.Message;
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.Protocol;
-import org.apache.qpid.nclient.util.ByteBufferMessage;
-import org.apache.qpid.transport.codec.BBDecoder;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * The message tokenizer class allows a multi message listener to break a
- * message into tokens where each token is itself a valid AMQP message.
- *
- * @author Andrea Gazzarini
- * @see QPID-1368
- */
-class MessageTokenizer implements Enumeration<Message>
-{
- private final static Logger LOGGER = Logger.get(MessageTokenizer.class);
-
- static byte [] MAGIC_NUMBER_BYTES;
-
- private LinkedList<Message> _messages = new LinkedList<Message>();
- private Iterator<Message> _iterator;
-
- static
- {
- try
- {
- MAGIC_NUMBER_BYTES = Protocol.MAGIC_NUMBER.getBytes("UTF-8");
- } catch(Exception exception)
- {
- throw new ExceptionInInitializerError(exception);
- }
- }
-
- /**
- * Builds a new Message tokenizer with the given message.
- * Note that if the given message is not a "compound" message this tokenizer will producer only one token;
- * That is, the token is a message equals to the given message.
- *
- * @param compoundMessage the compound message
- * @throws IOException when it's not possible to read the given message content.
- */
- MessageTokenizer(Message compoundMessage) throws IOException
- {
- build(compoundMessage);
- }
-
- public boolean hasMoreElements()
- {
- return _iterator.hasNext();
- }
-
- public Message nextElement()
- {
- return _iterator.next();
- }
-
- /**
- * Retruns the number of the tokens produced by this tokenizer.
- *
- * @return the number of the tokens produced by this tokenizer.
- */
- public int countTokens()
- {
- return _messages.size();
- }
-
- // Internal methods used for splitting the multi message byte array.
- int indexOf(byte[] source, int startIndex)
- {
- int currentSourceIndex;
- int currentExampleIndex;
-
- if (startIndex + 3 > source.length)
- return -1;
-
- for (currentSourceIndex = startIndex; currentSourceIndex <= source.length - 3; currentSourceIndex++)
- {
- for (currentExampleIndex = 0; currentExampleIndex < 3; currentExampleIndex++)
- {
- if (source[currentSourceIndex + currentExampleIndex] != MAGIC_NUMBER_BYTES[currentExampleIndex])
- break;
- }
-
- if (currentExampleIndex == 3)
- return currentSourceIndex;
- }
- return -1;
- }
-
- // Internal method used for building the tokens.
- private void build(Message compoundMessage) throws IOException
- {
- int startIndex = 0;
- int indexOfMagicNumber = 0;
-
- BBDecoder decoder = new BBDecoder();
- decoder.init(compoundMessage.readData());
- byte [] source = decoder.readReaminingBytes();
-
- int howManyTokens = 1;
-
- while ((indexOfMagicNumber = indexOf(source, startIndex+1)) != -1)
- {
- addMessageToken(source, startIndex, (indexOfMagicNumber-startIndex));
- startIndex = indexOfMagicNumber;
- howManyTokens++;
- }
- addMessageToken(source, startIndex, (source.length-startIndex));
- _iterator = _messages.iterator();
-
- LOGGER.debug(Messages.QMAN_200031_COMPOUND_MESSAGE_CONTAINS,howManyTokens);
- };
-
- // Builds & adds a new "message" token
- private void addMessageToken(byte [] source,int startIndex,int length) throws IOException
- {
- byte [] messageData = new byte[length];
- System.arraycopy(source, startIndex, messageData, 0, messageData.length);
- Message message = new ByteBufferMessage();
- message.appendData(messageData);
- _messages.add(message);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/MethodInvocationException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/MethodInvocationException.java
deleted file mode 100644
index 26fd8eee24..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/MethodInvocationException.java
+++ /dev/null
@@ -1,50 +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.
- *
- */
-package org.apache.qpid.management.domain.services;
-
-public class MethodInvocationException extends Exception
-{
- private static final long serialVersionUID = -7772343434879470351L;
- private final long _returnCode;
- private final String _statusText;
-
- public MethodInvocationException(long code, String text)
- {
- this._returnCode = code;
- this._statusText = text;
- }
-
- @Override
- public String getMessage ()
- {
- return String.format("Return code : \"%s, reason : \"%s\"",_returnCode,_statusText);
- }
-
- public long getReturnCode ()
- {
- return _returnCode;
- }
-
- public String getStatusText ()
- {
- return _statusText;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QMan.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QMan.java
deleted file mode 100644
index 600b54a6c9..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QMan.java
+++ /dev/null
@@ -1,365 +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.
- *
- */
-package org.apache.qpid.management.domain.services;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-import java.util.Map.Entry;
-
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.DynamicMBean;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanParameterInfo;
-import javax.management.ReflectionException;
-
-import org.apache.log4j.xml.DOMConfigurator;
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.Names;
-import org.apache.qpid.management.configuration.BrokerAlreadyConnectedException;
-import org.apache.qpid.management.configuration.BrokerConnectionData;
-import org.apache.qpid.management.configuration.BrokerConnectionException;
-import org.apache.qpid.management.configuration.Configuration;
-import org.apache.qpid.management.configuration.Configurator;
-import org.apache.qpid.management.domain.model.JmxService;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Main entry point for starting Q-Man application.
- *
- * @author Andrea Gazzarini
- */
-public class QMan implements DynamicMBean
-{
- private final static Logger LOGGER = Logger.get(QMan.class);
- private final List<ManagementClient> managementClients = new ArrayList<ManagementClient>();
-
- /**
- * Starts QMan.
- * @throws StartupFailureException when it's not possible to proceed with startup.
- */
- public void start() throws StartupFailureException
- {
- LOGGER.info(Messages.QMAN_000001_STARTING_QMAN);
- LOGGER.info(Messages.QMAN_000002_READING_CONFIGURATION);
-
- Configurator configurator = new Configurator();
- try
- {
- configurator.configure();
- Configuration configuration = Configuration.getInstance();
- if (configuration.hasOneOrMoreBrokersDefined())
- {
- LOGGER.info(Messages.QMAN_000003_CREATING_MANAGEMENT_CLIENTS);
- for (Entry<UUID, BrokerConnectionData> entry : Configuration.getInstance().getConnectionInfos())
- {
- createManagementClient(entry.getKey(), entry.getValue());
- }
- } else
- {
- LOGGER.info(Messages.QMAN_000022_NO_BROKER_CONFIGURED);
- }
-
- registerQManService();
-
- LOGGER.info(Messages.QMAN_000019_QMAN_STARTED);
- } catch(Exception exception) {
- LOGGER.error(exception,Messages.QMAN_100018_UNABLE_TO_STARTUP_CORRECTLY );
- throw new StartupFailureException(exception);
- }
- }
-
- /**
- * Creates a management client using the given data.
- *
- * @param brokerId the broker identifier.
- * @param data the broker connection data.
- */
- private void createManagementClient(UUID brokerId, BrokerConnectionData data)
- {
- try
- {
- ManagementClient client = new ManagementClient(brokerId,data);
- client.estabilishFirstConnectionWithBroker();
- managementClients.add(client);
-
- LOGGER.info(Messages.QMAN_000004_MANAGEMENT_CLIENT_CONNECTED,brokerId);
- } catch(StartupFailureException exception) {
- LOGGER.error(exception, Messages.QMAN_100017_UNABLE_TO_CONNECT,brokerId,data);
- }
- }
-
- /**
- * Connects Q-Man with a broker defined by the given parameter.
- *
- * @param host the hostname where the broker is running.
- * @param port the port where the broker is running.
- * @param username the username for connecting with the broker.
- * @param password the password for connecting with the broker.
- * @param virtualHost the virtual host.
- * @param initialPoolCapacity the number of the connection that must be immediately opened.
- * @param maxPoolCapacity the maximum number of opened connection.
- * @param maxWaitTimeout the maximum amount of time that a client will wait for obtaining a connection.
- * @throws MBeanException when it's not possible to connect with the broker.
- */
- public void addBroker(
- String host,
- int port,
- String username,
- String password,
- String virtualHost,
- int initialPoolCapacity,
- int maxPoolCapacity,
- long maxWaitTimeout) throws BrokerAlreadyConnectedException, BrokerConnectionException
- {
- Configurator configurator = new Configurator();
- try {
- UUID brokerId = UUID.randomUUID();
- BrokerConnectionData data = configurator.createAndReturnBrokerConnectionData(
- brokerId,
- host,
- port,
- username,
- password,
- virtualHost,
- initialPoolCapacity,
- maxPoolCapacity,
- maxWaitTimeout);
- createManagementClient(brokerId, data);
- } catch (BrokerAlreadyConnectedException exception)
- {
- LOGGER.warn(Messages.QMAN_300003_BROKER_ALREADY_CONNECTED, exception.getBrokerConnectionData());
- throw exception;
- }
- }
-
- /**
- * Stop Qman
- */
- public void stop()
- {
- LOGGER.info(Messages.QMAN_000020_SHUTTING_DOWN_QMAN);
- try
- {
- for (ManagementClient client : managementClients)
- {
- client.shutdown();
- }
- } catch(Exception exception)
- {
- }
- LOGGER.info(Messages.QMAN_000021_SHUT_DOWN);
- }
-
- /**
- * Main method used for starting Q-Man.
- *
- * @param args the command line arguments.
- */
- public static void main (String[] args)
- {
- if (args.length == 1)
- {
- String logFileName = args[0];
- DOMConfigurator.configureAndWatch(logFileName,5000);
- }
-
- final QMan qman = new QMan();
-
- Thread hook = new Thread()
- {
- @Override
- public void run ()
- {
- qman.stop();
- }
- };
-
- Runtime.getRuntime().addShutdownHook(hook);
- try
- {
- qman.start();
-
- System.out.println("Type \"q\" to quit.");
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- while ( !"q".equals(reader.readLine()) )
- {
-
- }
- Runtime.getRuntime().removeShutdownHook(hook);
- qman.stop();
- System.exit(-1);
- } catch (StartupFailureException exception)
- {
- qman.stop();
- System.exit(-1);
- } catch (IOException exception)
- {
- System.exit(-1);
- }
- }
-
- /**
- * Not implemented for this MBean.
- */
- public Object getAttribute(String attribute)
- {
- return null;
- }
-
- /**
- * Not implemented for this MBean.
- */
- public AttributeList getAttributes(String[] attributes)
- {
- return null;
- }
-
- /**
- * Returns the metadata for this MBean
- *
- * @return the metadata for this MBean
- */
- public MBeanInfo getMBeanInfo()
- {
- MBeanParameterInfo parameters [] = new MBeanParameterInfo[8];
-
- parameters[0] = new MBeanParameterInfo(
- "host",
- String.class.getName(),
- "The IP address or DNS name that Qpid Broker uses to listen for incoming connections.");
- parameters[1] = new MBeanParameterInfo(
- "port",
- int.class.getName(),
- "The port number that Qpid Broker uses to listen for incoming connections.");
- parameters[2] = new MBeanParameterInfo(
- "username",
- String.class.getName(),
- "The Qpid account name used in the physical connection.");
- parameters[3] = new MBeanParameterInfo(
- "password",
- String.class.getName(),
- "The Qpid account password used in the physical connection.");
- parameters[4]= new MBeanParameterInfo(
- "virtualHost",
- String.class.getName(),
- "The virtualHost name.");
- parameters[5]= new MBeanParameterInfo(
- "initialPoolCapacity",
- int.class.getName(),
- "The number of physical connections (between 0 and a positive 32-bit integer) to create when creating the (Qpid) connection pool.");
- parameters[6]= new MBeanParameterInfo(
- "maxPoolCapacity",
- int.class.getName(),
- "The maximum number of physical database connections (between 0 and a positive 32-bit integer) that the (Qpid) connection pool can contain. ");
- parameters[7]= new MBeanParameterInfo(
- "maxWaitTimeout",
- long.class.getName(),
- "The maximum amount of time to wait for an idle connection.A value of -1 indicates an illimted amount of time (i.e. forever)");
-
- MBeanOperationInfo operation = new MBeanOperationInfo(
- "addBroker",
- "Connects QMan with a broker.",
- parameters,
- void.class.getName(),
- MBeanOperationInfo.ACTION);
-
- MBeanInfo mbean = new MBeanInfo(
- QMan.class.getName(),
- "QMan Management & Administration interface.",
- null,
- null,
- new MBeanOperationInfo[]{operation},
- null);
-
- return mbean;
- }
-
- /**
- * Invokes an operation on QMan (MBean).
- *
- * @param actionName the operation name.
- * @param params the operation parameters.
- * @param signature the operation signature.
- * @return the result of the invocation (if the operation is not void);
- * @exception MBeanException Wraps a <CODE>java.lang.Exception</CODE> thrown by the MBean's invoked method.
- * @exception ReflectionException Wraps a <CODE>java.lang.Exception</CODE> thrown while trying to invoke the method
- */
- public Object invoke(String actionName, Object[] params, String[] signature) throws MBeanException, ReflectionException
- {
- if (Names.ADD_BROKER_OPERATION_NAME.equals(actionName))
- {
- try
- {
- addBroker(
- (String)params[0],
- (Integer)params[1],
- (String)params[2],
- (String)params[3],
- (String)params[4],
- (Integer)params[5],
- (Integer)params[6],
- (Long)params[7]);
- } catch(Exception exception)
- {
- throw new MBeanException(exception);
- }
- } else
- {
- throw new ReflectionException(new NoSuchMethodException(actionName));
- }
- return null;
- }
-
- /**
- * Not implemented for this MBean.
- */
- public void setAttribute(Attribute attribute)
- {
- }
-
- /**
- * Not implemented for this MBean.
- */
- public AttributeList setAttributes(AttributeList attributes)
- {
- return null;
- }
-
- /**
- * Registers QMan as an MBean on MBeanServer.
- *
- * @throws MBeanException when it's not possible to proceeed with registration.
- */
- private void registerQManService() throws MBeanException
- {
- JmxService service = new JmxService();
- service.registerQManService(this);
-
- LOGGER.info(Messages.QMAN_000023_QMAN_REGISTERED_AS_MBEAN);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QpidService.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QpidService.java
deleted file mode 100644
index a12993d40e..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/QpidService.java
+++ /dev/null
@@ -1,360 +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.
- *
- */
-package org.apache.qpid.management.domain.services;
-
-import java.io.IOException;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.qpid.QpidException;
-import org.apache.qpid.api.Message;
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.Names;
-import org.apache.qpid.management.configuration.QpidDatasource;
-import org.apache.qpid.management.domain.model.QpidMethod;
-import org.apache.qpid.management.domain.model.type.Binary;
-import org.apache.qpid.management.messages.MethodInvocationRequestMessage;
-import org.apache.qpid.management.messages.SchemaRequestMessage;
-import org.apache.qpid.nclient.util.MessageListener;
-import org.apache.qpid.nclient.util.MessagePartListenerAdapter;
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.MessageAcceptMode;
-import org.apache.qpid.transport.MessageAcquireMode;
-import org.apache.qpid.transport.MessageCreditUnit;
-import org.apache.qpid.transport.MessageTransfer;
-import org.apache.qpid.transport.Option;
-import org.apache.qpid.transport.Session;
-import org.apache.qpid.transport.SessionException;
-import org.apache.qpid.transport.SessionListener;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Qpid Broker facade.
- *
- * @author Andrea Gazzarini
- */
-public class QpidService implements SessionListener
-{
- private final static Logger LOGGER = Logger.get(QpidService.class);
-
- private UUID _brokerId;
- private Connection _connection;
- private Session _session;
- private Map<String,MessagePartListenerAdapter> _listeners;
-
- /**
- * Builds a new service with the given connection data.
- *
- * @param connectionData the connection data of the broker.
- */
- public QpidService(UUID brokerId)
- {
- this._brokerId = brokerId;
- }
-
- /**
- * Estabilishes a connection with the broker.
- *
- * @throws QpidException in case of connection failure.
- */
- public void connect() throws Exception
- {
- _connection = QpidDatasource.getInstance().getConnection(_brokerId);
- _listeners = new ConcurrentHashMap<String,MessagePartListenerAdapter>();
- _session = _connection.createSession(0);
- _session.setSessionListener(this);
- }
-
- public void opened(Session ssn) {}
-
- public void message(Session ssn, MessageTransfer xfr)
- {
- MessagePartListenerAdapter l = _listeners.get(xfr.getDestination());
- if (l == null)
- {
- LOGGER.error("unhandled message: %s", xfr);
- }
- else
- {
- l.messageTransfer(xfr);
- }
- }
-
-
- public void exception(Session ssn, SessionException exc)
- {
-
- }
-
- public void closed(Session ssn) {}
-
- /**
- * All the previously entered outstanding commands are asynchronous.
- * Synchronous behavior is achieved through invoking this method.
- */
- public void sync()
- {
- _session.sync();
- }
-
- /**
- * Closes communication with broker.
- */
- public void close()
- {
- try
- {
- _session.close();
- _session = null;
- _listeners = null;
- } catch (Exception e)
- {
- }
- try
- {
- _connection.close();
- _connection = null;
- } catch (Exception e)
- {
- }
- }
-
- /**
- * Associate a message listener with a destination therefore creating a new subscription.
- *
- * @param queueName The name of the queue that the subscriber is receiving messages from.
- * @param destinationName the name of the destination, or delivery tag, for the subscriber.
- * @param listener the listener for this destination.
- *
- * @see Session#messageSubscribe(String, String, short, short, org.apache.qpid.nclient.MessagePartListener, java.util.Map, org.apache.qpid.transport.Option...)
- */
- public void createSubscription(String queueName, String destinationName, MessageListener listener)
- {
- _listeners.put(destinationName, new MessagePartListenerAdapter(listener));
- _session.messageSubscribe
- (queueName,
- destinationName,
- MessageAcceptMode.NONE,
- MessageAcquireMode.PRE_ACQUIRED,
- null, 0, null);
-
- _session.messageFlow(destinationName, MessageCreditUnit.BYTE, Session.UNLIMITED_CREDIT);
- _session.messageFlow(destinationName, MessageCreditUnit.MESSAGE, Session.UNLIMITED_CREDIT);
-
- LOGGER.debug(Messages.QMAN_200025_SUBSCRIPTION_DECLARED,queueName,destinationName);
- }
-
- /**
- * Removes a previously declared consumer from the broker.
- *
- * @param destinationName the name of the destination, or delivery tag, for the subscriber.
- * @see Session#messageCancel(String, Option...)
- */
- public void removeSubscription(String destinationName)
- {
- _session.messageCancel(destinationName);
- LOGGER.debug(Messages.QMAN_200026_SUBSCRIPTION_REMOVED,destinationName);
- }
-
- /**
- * Declares a queue on the broker with the given name.
- *
- * @param queueName the name of the declared queue.
- * @see Session#queueDeclare(String, String, java.util.Map, Option...)
- */
- public void declareQueue(String queueName)
- {
- _session.queueDeclare(queueName, null, null);
- LOGGER.debug(Messages.QMAN_200027_QUEUE_DECLARED,queueName);
- }
-
- /**
- * Removes the queue with the given name from the broker.
- *
- * @param queueName the name of the queue.
- * @see Session#queueDelete(String, Option...)
- */
- public void deleteQueue(String queueName)
- {
- _session.queueDelete(queueName);
- LOGGER.debug(Messages.QMAN_200028_QUEUE_REMOVED,queueName);
- }
-
- /**
- * Binds (on the broker) a queue with an exchange.
- *
- * @param queueName the name of the queue to bind.
- * @param exchangeName the exchange name.
- * @param routingKey the routing key used for the binding.
- * @see Session#exchangeBind(String, String, String, java.util.Map, Option...)
- */
- public void declareBinding(String queueName, String exchangeName, String routingKey)
- {
- _session.exchangeBind(queueName, exchangeName, routingKey, null);
- LOGGER.debug(Messages.QMAN_200029_BINDING_DECLARED,routingKey,queueName,exchangeName);
- }
-
- /**
- * Removes a previously declare binding between an exchange and a queue.
- *
- * @param queueName the name of the queue.
- * @param exchangeName the name of the exchange.
- * @param routingKey the routing key used for binding.
- */
- public void declareUnbinding(String queueName, String exchangeName, String routingKey)
- {
- _session.exchangeUnbind(queueName, exchangeName, routingKey);
- LOGGER.debug(Messages.QMAN_200030_BINDING_REMOVED,routingKey,queueName,exchangeName);
- }
-
- /**
- * Sends a command message with the given data on the management queue.
- *
- * @param messageData the command message content.
- */
-
- /**
- * Requests a schema for the given package.class.hash.
- *
- * @param packageName the package name.
- * @param className the class name.
- * @param schemaHash the schema hash.
- * @throws IOException when the schema request cannot be sent.
- */
- public void requestSchema(final String packageName, final String className, final Binary schemaHash) throws IOException
- {
- Message message = new SchemaRequestMessage()
- {
- @Override
- protected String className ()
- {
- return className;
- }
-
- @Override
- protected String packageName ()
- {
- return packageName;
- }
-
- @Override
- protected Binary schemaHash ()
- {
- return schemaHash;
- }
- };
-
- sendMessage(message);
- }
-
- /**
- * Invokes an operation on a broker object instance.
- *
- * @param packageName the package name.
- * @param className the class name.
- * @param schemaHash the schema hash of the corresponding class.
- * @param objectId the object instance identifier.
- * @param parameters the parameters for this invocation.
- * @param method the method (definition) invoked.
- * @param bankId the object bank identifier.
- * @param brokerId the broker identifier.
- * @return the sequence number used for this message.
- * @throws MethodInvocationException when the invoked method returns an error code.
- * @throws UnableToComplyException when it wasn't possibile to invoke the requested operation.
- */
- public void invoke(
- final String packageName,
- final String className,
- final Binary schemaHash,
- final Binary objectId,
- final Object[] parameters,
- final QpidMethod method,
- final int sequenceNumber,
- final long bankId,
- final long brokerId) throws MethodInvocationException, UnableToComplyException
- {
- Message message = new MethodInvocationRequestMessage(bankId, brokerId)
- {
-
- @Override
- protected int sequenceNumber ()
- {
- return sequenceNumber;
- }
-
- protected Binary objectId() {
- return objectId;
- }
-
- protected String packageName()
- {
- return packageName;
- }
-
- protected String className()
- {
- return className;
- }
-
- @Override
- protected QpidMethod method ()
- {
- return method;
- }
-
- @Override
- protected Object[] parameters ()
- {
- return parameters;
- }
-
- @Override
- protected Binary schemaHash ()
- {
- return schemaHash;
- }
- };
-
- try {
- sendMessage(message);
- sync();
- } catch(Exception exception) {
- throw new UnableToComplyException(exception);
- }
- }
-
- /**
- * Sends a command message.
- *
- * @param message the command message.
- * @throws IOException when the message cannot be sent.
- */
- public void sendMessage(Message message) throws IOException
- {
- _session.messageTransfer(
- Names.MANAGEMENT_EXCHANGE,
- MessageAcceptMode.EXPLICIT,
- MessageAcquireMode.PRE_ACQUIRED,
- message.getHeader(),
- message.readData());
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/SequenceNumberGenerator.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/SequenceNumberGenerator.java
deleted file mode 100644
index e6d99971cd..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/SequenceNumberGenerator.java
+++ /dev/null
@@ -1,41 +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.
- *
- */
-package org.apache.qpid.management.domain.services;
-
-/**
- * Sequence number generator utility class.
- *
- * @author Andrea Gazzarini
- */
-public class SequenceNumberGenerator
-{
- private static int sequenceNumber;
-
- /**
- * Returns a valid sequence number.
- *
- * @return a sequence number.
- */
- public static synchronized int getNextSequenceNumber()
- {
- return sequenceNumber++;
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/StartupFailureException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/StartupFailureException.java
deleted file mode 100644
index 9da8832624..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/StartupFailureException.java
+++ /dev/null
@@ -1,42 +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.
- *
- */
-package org.apache.qpid.management.domain.services;
-
-/**
- * Thrown in case of service startup failure.
- * For example the configuration file couldn't be read because is not well-formed.
- *
- * @author Andrea Gazzarini.
- */
-public class StartupFailureException extends Exception
-{
- private static final long serialVersionUID = -4102037574602857703L;
-
- /**
- * Builds a new StartupFailureException with the given exception.
- *
- * @param exception the exception cause.
- */
- public StartupFailureException(Exception exception)
- {
- super(exception);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/UnableToComplyException.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/UnableToComplyException.java
deleted file mode 100644
index 2ab9a41e75..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/domain/services/UnableToComplyException.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.services;
-
-public class UnableToComplyException extends Exception
-{
- public UnableToComplyException(Exception exception)
- {
- super(exception);
- }
-
- private static final long serialVersionUID = -3071434478559509435L;
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/AmqpCoDec.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/AmqpCoDec.java
deleted file mode 100644
index 4d1dfe796a..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/AmqpCoDec.java
+++ /dev/null
@@ -1,178 +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.
- *
- */
-
-package org.apache.qpid.management.messages;
-
-import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-
-/**
- * AMQP Management messages codec.
- *
- * @author Andrea Gazzarini
- */
-public class AmqpCoDec
-{
- private byte [] _buffer;
- private int _position;
-
- /**
- * Builds a new codec.
- */
- AmqpCoDec()
- {
- _buffer = new byte [1000];
- _buffer[0] = 'A';
- _buffer[1] = 'M';
- _buffer[2] = '2';
- _position = 3;
- }
-
-
- /**
- * Int32-to-4 byte array marshalling.
- * Marshalles an integer using four bytes.
- *
- * @param data the result array.
- * @param pos the starting position of the array to be filled.
- * @param value the value to be marshalled.
- */
- public final void pack32(int value) {
- _buffer[_position++] = (byte) (value >> 24 & 0xff);
- _buffer[_position++] = (byte) (value >> 16 & 0xff);
- _buffer[_position++] = (byte) (value >> 8 & 0xff);
- _buffer[_position++] = (byte) (value & 0xff);
- }
-
- /**
- * Int32-to-4 byte array marshalling.
- * Marshalles an integer using four bytes.
- *
- * @param data the result array.
- * @param pos the starting position of the array to be filled.
- * @param value the value to be marshalled.
- */
- public final void pack16(int value) {
- _buffer[_position++] = (byte) (value >> 8 & 0xff);
- _buffer[_position++] = (byte) (value & 0xff);
- }
-
- /**
- * Int32-to-4 byte array marshalling.
- * Marshalles an integer using four bytes.
- *
- * @param data the result array.
- * @param pos the starting position of the array to be filled.
- * @param value the value to be marshalled.
- */
- public final void pack64(long value) {
- _buffer[_position++] = (byte) (value >> 56 & 0xff);
- _buffer[_position++] = (byte) (value >> 48 & 0xff);
- _buffer[_position++] = (byte) (value >> 40 & 0xff);
- _buffer[_position++] = (byte) (value >> 32 & 0xff);
- _buffer[_position++] = (byte) (value >> 24 & 0xff);
- _buffer[_position++] = (byte) (value >> 16 & 0xff);
- _buffer[_position++] = (byte) (value >> 8 & 0xff);
- _buffer[_position++] = (byte) (value & 0xff);
- }
-
- /**
- * Int32-to-byte array marshalling.
- * Marshalles an integer using two bytes.
- *
- * @param data the result array.
- * @param pos the starting position of the array to be filled.
- * @param value the value to be marshalled.
- */
- public final void pack24(int value) {
- _buffer[_position++] = (byte) (value >> 16 & 0xff);
- _buffer[_position++] = (byte) (value >> 8 & 0xff);
- _buffer[_position++] = (byte) (value & 0xff);
- }
-
- public final void pack8(int value) {
- _buffer[_position++] = (byte) (value & 0xff);
- }
-
- public void pack8 (byte aByte)
- {
- _buffer[_position++] = aByte;
- }
-
- public void packStr8(String aString)
- {
- try
- {
- byte [] toBytes = aString.getBytes("UTF-8");
- int length = toBytes.length;
- pack8(length);
- System.arraycopy(toBytes, 0, _buffer, _position, length);
- _position+=length;
- } catch (UnsupportedEncodingException exception)
- {
- throw new RuntimeException(exception);
- }
- }
-
- public void packStr16(String aString)
- {
- try
- {
- byte [] toBytes = aString.getBytes("UTF-8");
- int length = toBytes.length;
- pack16(length);
- System.arraycopy(toBytes, 0, _buffer, _position, length);
- _position+=length;
- } catch (UnsupportedEncodingException exception)
- {
- throw new RuntimeException(exception);
- }
- }
-
- public static final long unpack64(byte data[]) {
- return (
- ((long) (data[0] & 0xff) << 56) |
- ((long)(data[1] & 0xff) << 48) |
- ((long)(data[2] & 0xff) << 40) |
- ((long)(data[3] & 0xff) << 32) |
- ((long)(data[4] & 0xff) << 24) |
- ((long)(data[5] & 0xff) << 16) |
- ((long)(data[6] & 0xff) << 8) |
- (long) data[7] & 0xff);
- }
-
-
- public void pack (byte[] bytes)
- {
- System.arraycopy(bytes, 0, _buffer, _position, bytes.length);
- _position+=bytes.length;
- }
-
- /**
- * Retruns the byte buffer that is wrapping the backing array of this codec.
- *
- * @return the byte buffer that is wrapping the backing array of this codec.
- */
- public ByteBuffer getEncodedBuffer ()
- {
- return ByteBuffer.wrap(_buffer,0,_position);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/ManagementMessage.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/ManagementMessage.java
deleted file mode 100644
index 2fa20fb456..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/ManagementMessage.java
+++ /dev/null
@@ -1,189 +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.
- *
- */
-package org.apache.qpid.management.messages;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-import org.apache.qpid.api.Message;
-import org.apache.qpid.management.configuration.Configuration;
-import org.apache.qpid.management.domain.services.SequenceNumberGenerator;
-import org.apache.qpid.transport.DeliveryProperties;
-import org.apache.qpid.transport.Header;
-import org.apache.qpid.transport.MessageProperties;
-import org.apache.qpid.transport.codec.BBEncoder;
-
-/**
- * Message implementation used for specific management purposes.
- *
- * @author Andrea Gazzarini
- */
-public abstract class ManagementMessage implements Message
-{
- /**
- * Strategy interface for building / getting data.
- *
- * @author Andrea Gazzarini
- */
- private interface IDataBuilderStrategy
- {
- ByteBuffer getData();
- };
-
- /**
- * Strategy used for retrieving raw data from this message when it has been already encoded.
- */
- IDataBuilderStrategy READING = new IDataBuilderStrategy()
- {
- public ByteBuffer getData() {
- return _data;
- };
- };
-
- /**
- * Strategy used for retrieving raw data from this message when it hasn't been already encoded.
- */
- IDataBuilderStrategy ACCUMULATING = new IDataBuilderStrategy()
- {
- public ByteBuffer getData() {
- _codec.writeInt8((byte)opcode());
- _codec.writeSequenceNo(sequenceNumber());
-
- specificMessageEncoding();
-
- _data =_codec.segment();
- _reader = READING;
- return _data;
- }
- };
-
- protected BBEncoder _codec;
- protected ByteBuffer _data;
- private int _messageTransferId;
- private IDataBuilderStrategy _reader = ACCUMULATING;
-
- /**
- * Builds an empty management message.
- */
- ManagementMessage()
- {
- _codec = new BBEncoder(100);
- _codec.writeMagicNumber();
- }
-
- /**
- * Returns the sequence number that will be used for this message.
- *
- * @return the sequence number that will be used for this message.
- */
- protected int sequenceNumber ()
- {
- return SequenceNumberGenerator.getNextSequenceNumber();
- }
-
- /**
- * Returns the opcode that will be used for this message.
- *
- * @return the opcode that will be used for this message.
- */
- abstract char opcode ();
-
- /**
- * Returns the delivery properties of this message.
- *
- * @return the delivery properties of this message.
- */
- public DeliveryProperties getDeliveryProperties ()
- {
- return Configuration.getInstance().getCommandDeliveryProperties();
- }
-
- /**
- * Returns the header of this message.
- *
- * @return the header of this message.
- */
- public Header getHeader ()
- {
- return Configuration.getInstance().getCommandMessageHeader();
- }
-
- /**
- * Returns the messages header properties of this message.
- *
- * @return the message header properties of this message.
- */
- public MessageProperties getMessageProperties ()
- {
- return Configuration.getInstance().getCommandMessageProperties();
- }
-
- /**
- * Returns the transfer Id of this message.
- *
- * @return the transfer Id of this message.
- */
- public int getMessageTransferId ()
- {
- return _messageTransferId;
- }
-
- /**
- * Returns the encoded data of this message.
- *
- * @return the encoded data of this message.
- */
- public ByteBuffer readData () throws IOException
- {
- return _reader.getData();
- }
-
- /**
- * Sets the header for this message.
- *
- * @param header the new message header.
- */
- public void setHeader (Header header)
- {
- // N.A. at the moment.
- }
-
- public void appendData (byte[] src) throws IOException
- {
- }
-
- public void appendData (ByteBuffer src) throws IOException
- {
- }
-
- public void clearData ()
- {
- }
-
- public void readData (byte[] target) throws IOException
- {
- }
-
- /**
- * Concrete subclasses (message implementations) must define here their specific data encoding.
- */
- abstract void specificMessageEncoding();
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/MethodInvocationRequestMessage.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/MethodInvocationRequestMessage.java
deleted file mode 100644
index 99916085d6..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/MethodInvocationRequestMessage.java
+++ /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.
- *
- */
-package org.apache.qpid.management.messages;
-
-import org.apache.qpid.management.Messages;
-import org.apache.qpid.management.Names;
-import org.apache.qpid.management.Protocol;
-import org.apache.qpid.management.configuration.Configuration;
-import org.apache.qpid.management.domain.model.QpidMethod;
-import org.apache.qpid.management.domain.model.type.Binary;
-import org.apache.qpid.transport.DeliveryProperties;
-import org.apache.qpid.transport.Header;
-import org.apache.qpid.transport.MessageProperties;
-import org.apache.qpid.transport.ReplyTo;
-import org.apache.qpid.transport.util.Logger;
-
-/**
- * Abstract representation of a method invocation request message.
- * Concrete subclasses must supply the values needed to build & encode the message.
- *
- * @author Andrea Gazzarini
- */
-public abstract class MethodInvocationRequestMessage extends ManagementMessage
-{
- private final static Logger LOGGER = Logger.get(MethodInvocationRequestMessage.class);
-
- private DeliveryProperties _deliveryProperties;
- private MessageProperties _messageProperties;
- private Header _header;
-
- /**
- * Builds a new method invocation request message with the given target identifiers.
- *
- * @param bankId the bank identifier.
- * @param brokerId the broker identifier.
- */
- public MethodInvocationRequestMessage(long bankId, long brokerId)
- {
- ReplyTo replyTo=new ReplyTo();
- replyTo.setRoutingKey(Configuration.getInstance().getMethodReplyQueueName());
- _messageProperties = new MessageProperties();
- _messageProperties.setReplyTo(replyTo);
-
- String routingKey = String.format(Names.AGENT_ROUTING_KEY_PREFIX+"%s.%s", brokerId,bankId);
-
- LOGGER.debug(Messages.QMAN_200032_COMMAND_MESSAGE_ROUTING_KEY, routingKey);
-
- _deliveryProperties = new DeliveryProperties();
- _deliveryProperties.setRoutingKey(routingKey);
- _header = new Header(_deliveryProperties, _messageProperties);
- }
-
- @Override
- char opcode ()
- {
- return Protocol.OPERATION_INVOCATION_REQUEST_OPCODE;
- }
-
- /**
- * Returns the package name.
- *
- * @return the package name.
- */
- protected abstract String packageName();
-
- /**
- * Returns the class name.
- *
- * @return the class name.
- */
- protected abstract String className();
-
- /**
- * Returns the schema hash.
- *
- * @return the schema hash.
- */
- protected abstract Binary schemaHash();
-
- /**
- * Returns the object identifier.
- *
- * @return the object identifier.
- */
- protected abstract Binary objectId();
-
- /**
- * Returns the method to be invoked.
- *
- * @return the method to be invoked.
- */
- protected abstract QpidMethod method();
-
- /**
- * Returns the parameters used for method invocation.
- *
- * @return the parameters used for method invocation.
- */
- protected abstract Object[] parameters();
-
- /**
- * Returns the delivery properties of this message.
- *
- * @return the delivery properties of this message.
- */
- public DeliveryProperties getDeliveryProperties ()
- {
- return _deliveryProperties;
- }
-
- /**
- * Returns the header of this message.
- *
- * @return the header of this message.
- */
- public Header getHeader ()
- {
- return _header;
- }
-
- /**
- * Returns the messages header properties of this message.
- *
- * @return the message header properties of this message.
- */
- public MessageProperties getMessageProperties ()
- {
- return _messageProperties;
- }
-
- @Override
- void specificMessageEncoding ()
- {
- objectId().encode(_codec);
- _codec.writeStr8(packageName());
- _codec.writeStr8(className());
- schemaHash().encode(_codec);
-
- QpidMethod method = method();
- _codec.writeStr8(method.getName());
- method.encodeParameters(parameters(), _codec);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/SchemaRequestMessage.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/SchemaRequestMessage.java
deleted file mode 100644
index 9df1733649..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/messages/SchemaRequestMessage.java
+++ /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.
- *
- */
-package org.apache.qpid.management.messages;
-
-import org.apache.qpid.management.Protocol;
-import org.apache.qpid.management.domain.model.type.Binary;
-
-/**
- * Abstract representation of a schema request message.
- * Concrete subclasses must supply the values needed to build & encode the message.
- *
- * @author Andrea Gazzarini
- */
-public abstract class SchemaRequestMessage extends ManagementMessage
-{
- @Override
- char opcode ()
- {
- return Protocol.SCHEMA_REQUEST_OPCODE;
- }
-
- /**
- * Returns the package name.
- *
- * @return the package name.
- */
- protected abstract String packageName();
-
- /**
- * Returns the class name.
- *
- * @return the class name.
- */
- protected abstract String className();
-
- /**
- * Returns the schema hash.
- *
- * @return the schema hash.
- */
- protected abstract Binary schemaHash();
-
- @Override
- final void specificMessageEncoding ()
- {
- _codec.writeStr8(packageName());
- _codec.writeStr8(className());
- schemaHash().encode(_codec);
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/servlet/QManServlet.java b/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/servlet/QManServlet.java
deleted file mode 100644
index f0d663701b..0000000000
--- a/M4-RCs/qpid/java/management/client/src/main/java/org/apache/qpid/management/servlet/QManServlet.java
+++ /dev/null
@@ -1,66 +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.
- *
- */
-package org.apache.qpid.management.servlet;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-
-import org.apache.qpid.management.domain.services.QMan;
-import org.apache.qpid.management.domain.services.StartupFailureException;
-
-/**
- * QMan initializer.
- *
- * @author Andrea Gazzarini
- */
-public class QManServlet extends HttpServlet {
-
- private static final long serialVersionUID = 6149614872902682208L;
-
- // QMan instance
- private QMan qman;
-
- /**
- * Initializes QMan instance.
- *
- * @throws ServletException when It's not possibile to proceed with initialization.
- */
- @Override
- public void init() throws ServletException
- {
- qman = new QMan();
- try {
- qman.start();
- } catch (StartupFailureException exception)
- {
- throw new ServletException(exception);
- }
- }
-
- /**
- * Stops QMan instance.
- */
- @Override
- public void destroy()
- {
- qman.stop();
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/TestConstants.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/TestConstants.java
deleted file mode 100644
index 5855a3e60b..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/TestConstants.java
+++ /dev/null
@@ -1,64 +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.
- *
- */
-package org.apache.qpid.management;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.management.domain.handler.impl.MethodOrEventDataTransferObject;
-import org.apache.qpid.management.domain.model.DomainModel;
-import org.apache.qpid.management.domain.model.type.Binary;
-
-public interface TestConstants
-{
- UUID BROKER_ID = UUID.randomUUID();
- Binary OBJECT_ID = new Binary(new byte []{1,2,3,2,1,1,2,3});
-
- DomainModel DOMAIN_MODEL = new DomainModel(BROKER_ID);
-
- String AGE_ATTRIBUTE_NAME = "age";
- String AGE_ATTRIBUTE_DESCRIPTION = "The age of a person.";
- String SURNAME_ATTRIBUTE_NAME = "surname";
- String SURNAME_ATTRIBUTE_DESCRIPTION = "The surname of a person.";
- Integer _1 = new Integer(1);
-
- byte [] TEST_RAW_DATA= new byte []{1,4,5,7,8,9,4,44};
- long NOW = System.currentTimeMillis();
- int SEVERITY = _1;
-
- String QPID_PACKAGE_NAME = "qpid";
- String EXCHANGE_CLASS_NAME = "exchange";
- String BIND_EVENT_NAME = "bind";
- Binary HASH = new Binary(new byte []{1,2,3,4,5,6,7,8,9});
- int VALID_CODE = _1;
-
- List<Map<String, Object>> EMPTY_PROPERTIES_SCHEMA = new LinkedList<Map<String,Object>>();
- List<Map<String, Object>> EMPTY_STATISTICS_SCHEMA = new LinkedList<Map<String,Object>>();
- List<MethodOrEventDataTransferObject> EMPTY_METHODS_SCHEMA = new LinkedList<MethodOrEventDataTransferObject>();
- List<Map<String, Object>> EMPTY_ARGUMENTS_SCHEMA = new LinkedList<Map<String,Object>>();
- int _0 = 0;
- int SAMPLE_ACCESS_CODE = 1;
- String YEARS = "years";
- int SAMPLE_MIN_VALUE = 1;
- int SAMPLE_MAX_VALUE = 120;
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/ConfigurationTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/ConfigurationTest.java
deleted file mode 100644
index efd5990bd7..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/ConfigurationTest.java
+++ /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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.qpid.management.TestConstants;
-import org.apache.qpid.management.domain.handler.base.IMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.ConfigurationMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.InstrumentationMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.SchemaResponseMessageHandler;
-import org.apache.qpid.management.domain.model.AccessMode;
-import org.apache.qpid.management.domain.model.type.Type;
-import org.apache.qpid.management.domain.model.type.Uint8;
-
-import junit.framework.TestCase;
-
-/**
- * Test case for Configuration singleton.
- *
- * @author Andrea Gazzarini
- */
-public class ConfigurationTest extends TestCase
-{
- /**
- * Tests the singleton behaviour of the configuration object.
- */
- public void testSingleton()
- {
- assertSame(Configuration.getInstance(),Configuration.getInstance());
- }
-
- /**
- * Tests the execution of getType() method when a valid code is supplied.
- *
- * <br>precondition : the requested type already exist on the configuration.
- * <br>postcondition : the requested type is returned and no exception is thrown.
- */
- public void testGetTypeOk() throws UnknownTypeCodeException
- {
- TypeMapping mapping = new TypeMapping(TestConstants.VALID_CODE,new Uint8());
- Configuration.getInstance().addTypeMapping(mapping);
- Type type = Configuration.getInstance().getType(TestConstants.VALID_CODE);
-
- assertTrue(type instanceof Uint8);
- }
-
- /**
- * Tests the execution of getType() method when a unknown code is supplied.
- *
- * <br>precondition : the requested type doesn't exist on the configuration.
- * <br>postcondition : an exception is thrown indicating the failure.
- */
- public void testGetTypeKO()
- {
- try
- {
- Configuration.getInstance().getType(Integer.MIN_VALUE);
- fail("If an unknwon code is supplied an exception must be thrown.");
- } catch (UnknownTypeCodeException expected)
- {
- assertEquals(Integer.MIN_VALUE,expected.getCode());
- }
- }
-
- /**
- * Tests the execution of getAccessMode() method when a valid code is supplied.
- *
- * <br>precondition : the requested access mode already exist on the configuration.
- * <br>postcondition : the requested access mode is returned and no exception is thrown.
- */
- public void testGetAccessModeOk() throws UnknownAccessCodeException
- {
- AccessModeMapping mapping = new AccessModeMapping(TestConstants.VALID_CODE,AccessMode.RW);
- Configuration.getInstance().addAccessModeMapping(mapping);
- AccessMode accessMode = Configuration.getInstance().getAccessMode(TestConstants.VALID_CODE);
-
- assertSame(AccessMode.RW,accessMode);
- }
-
- /**
- * Tests the execution of getAccessMode() method when a unknown code is supplied.
- *
- * <br>precondition : the requested access mode doesn't exist on the configuration.
- * <br>postcondition : an exception is thrown indicating the failure.
- */
- public void testGetAccessModeKO()
- {
- try
- {
- Configuration.getInstance().getAccessMode(Integer.MIN_VALUE);
- fail("If an unknwon code is supplied an exception must be thrown.");
- } catch (UnknownAccessCodeException expected)
- {
- assertEquals(Integer.MIN_VALUE,expected.getCode());
- }
- }
-
- /**
- * Tests the execution of the getBrokerConnectionData when a valid broker id is supplied.
- *
- * <br>precondition : on configuration a connection data is stored and associated with the supplied id.
- * <br>postcondition : the requested connection data is returned and no exception is thrown.
- */
- public void testGetBrokerConnectionDataOK() throws Exception
- {
- BrokerConnectionData connectionData = new BrokerConnectionData();
- connectionData.setHost("host");
- connectionData.setPort("7001");
- connectionData.setInitialPoolCapacity("0");
- connectionData.setMaxPoolCapacity("10");
- connectionData.setMaxWaitTimeout("1");
- Configuration.getInstance().addBrokerConnectionData(TestConstants.BROKER_ID, connectionData);
-
- BrokerConnectionData result = Configuration.getInstance().getBrokerConnectionData(TestConstants.BROKER_ID);
- assertSame(connectionData, result);
- }
-
- /**
- * Tests the execution of the getBrokerConnectionData when a unknown broker id is supplied.
- *
- * <br>precondition : on configuration there's no connection data associated with the supplied id.
- * <br>postcondition : an exception is thrown indicating the failure.
- */
- public void testGetBrokerConnectionDataKO_withUnknownBrokerId()
- {
- UUID brokerId = UUID.randomUUID();
- try
- {
- Configuration.getInstance().getBrokerConnectionData(brokerId);
- fail("If an unknown broker id is supplied then an exception must be thrown.");
- } catch(UnknownBrokerException expected)
- {
- assertEquals(brokerId.toString(),expected.getMessage());
- }
- }
-
- /**
- * Tests the execution of the getBrokerConnectionData when a null id is supplied.
- *
- * <br>precondition : a null broker is given.
- * <br>postcondition : an exception is thrown indicating the failure.
- */
- public void testGetBrokerConnectionDataKO_withNullBrokerId()
- {
- try
- {
- Configuration.getInstance().getBrokerConnectionData(null);
- fail("If a null broker id is supplied then an exception must be thrown.");
- } catch(UnknownBrokerException expected)
- {
- }
- }
-
- /**
- * Tests the behaviour of the getManagementQueueHandlers() method.
- *
- * <br>precondition: 2 management handlers are in stored configuration
- * <br>postcondition : 2 management handlers are returned.
- */
- public void testGetManagementQueueHandlersOk()
- {
- String i = "i";
- String c = "c";
-
- String instrMessageHandlerClassName = InstrumentationMessageHandler.class.getName();
- String configMessageHandlerClassName = ConfigurationMessageHandler.class.getName();
-
- MessageHandlerMapping instrMapping = new MessageHandlerMapping();
- MessageHandlerMapping configMapping = new MessageHandlerMapping();
-
- instrMapping.setOpcode(i);
- instrMapping.setMessageHandlerClass(instrMessageHandlerClassName);
-
- configMapping.setOpcode(c);
- configMapping.setMessageHandlerClass(configMessageHandlerClassName);
-
- Configuration.getInstance().addManagementMessageHandlerMapping(instrMapping);
- Configuration.getInstance().addManagementMessageHandlerMapping(configMapping);
-
- Map<Character, IMessageHandler> handlerMappings = Configuration.getInstance().getManagementQueueHandlers();
-
- assertEquals(instrMessageHandlerClassName,handlerMappings.get(instrMapping.getOpcode()).getClass().getName());
- assertEquals(configMessageHandlerClassName,handlerMappings.get(configMapping.getOpcode()).getClass().getName());
- }
-
- /**
- * Tests the behaviour of the getManagementQueueHandlers() method.
- *
- * <br>precondition: 2 management handlers are in stored configuration
- * <br>postcondition : 2 management handlers are returned.
- */
- public void testGetMethodReplyQueueHandlersOk()
- {
- String s = "s";
-
- String schemaMessageHandlerClassName = SchemaResponseMessageHandler.class.getName();
-
- MessageHandlerMapping schemaMapping = new MessageHandlerMapping();
-
- schemaMapping.setOpcode(s);
- schemaMapping.setMessageHandlerClass(schemaMessageHandlerClassName);
-
- Configuration.getInstance().addMethodReplyMessageHandlerMapping(schemaMapping);
-
- Map<Character, IMessageHandler> handlerMappings = Configuration.getInstance().getMethodReplyQueueHandlers();
-
- assertEquals(schemaMessageHandlerClassName,handlerMappings.get(schemaMapping.getOpcode()).getClass().getName());
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/ConfiguratorTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/ConfiguratorTest.java
deleted file mode 100644
index 6237f21cc9..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/ConfiguratorTest.java
+++ /dev/null
@@ -1,164 +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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-import java.util.Map;
-import java.util.UUID;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.management.Names;
-import org.apache.qpid.management.Protocol;
-import org.apache.qpid.management.domain.handler.base.IMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.ConfigurationMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.EventContentMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.HeartBeatIndicationMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.InstrumentationMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.MethodResponseMessageHandler;
-import org.apache.qpid.management.domain.handler.impl.SchemaResponseMessageHandler;
-import org.apache.qpid.management.domain.model.AccessMode;
-import org.apache.qpid.management.domain.model.type.AbsTime;
-import org.apache.qpid.management.domain.model.type.DeltaTime;
-import org.apache.qpid.management.domain.model.type.ObjectReference;
-import org.apache.qpid.management.domain.model.type.Str16;
-import org.apache.qpid.management.domain.model.type.Str8;
-import org.apache.qpid.management.domain.model.type.Uint16;
-import org.apache.qpid.management.domain.model.type.Uint32;
-import org.apache.qpid.management.domain.model.type.Uint64;
-import org.apache.qpid.management.domain.model.type.Uint8;
-import org.xml.sax.SAXException;
-
-/**
- * Test case for configurator.
- *
- * @author Andrea Gazzarini
- *
- */
-public class ConfiguratorTest extends TestCase
-{
- /**
- * Tests the execution of the configure() method when no configuration file is given.
- *
- * <br>precondition : configuration file option is not set
- * <br>postcondition : no exception is thrown, the configuration is holding no broker data and the predefined mappings are
- * stored in configuration.
- */
- public void testConfigureOK_WithNoConfigurationFile() throws Exception
- {
- Configurator configurator = new Configurator();
- configurator.configure();
- Configuration configuration = Configuration.getInstance();
-
- assertEquals(new Uint8(), configuration.getType(1));
- assertEquals(new Uint16(), configuration.getType(2));
- assertEquals(new Uint32(), configuration.getType(3));
- assertEquals(new Uint64(), configuration.getType(4));
- assertEquals(new Str8(), configuration.getType(6));
- assertEquals(new Str16(), configuration.getType(7));
- assertEquals(new AbsTime(), configuration.getType(8));
- assertEquals(new DeltaTime(), configuration.getType(9));
- assertEquals(new ObjectReference(), configuration.getType(10));
- assertEquals(new org.apache.qpid.management.domain.model.type.Boolean(), configuration.getType(11));
- assertEquals(new org.apache.qpid.management.domain.model.type.Uuid(), configuration.getType(14));
- assertEquals(new org.apache.qpid.management.domain.model.type.Map(), configuration.getType(15));
-
- assertEquals(AccessMode.RC,configuration.getAccessMode(1));
- assertEquals(AccessMode.RW,configuration.getAccessMode(2));
- assertEquals(AccessMode.RO,configuration.getAccessMode(3));
-
- Map<Character, IMessageHandler> managementHandlers = configuration.getManagementQueueHandlers();
- assertEquals(4,managementHandlers.size());
- assertEquals(
- InstrumentationMessageHandler.class,
- managementHandlers.get(Protocol.INSTRUMENTATION_CONTENT_RESPONSE_OPCODE).getClass());
-
- assertEquals(
- ConfigurationMessageHandler.class,
- managementHandlers.get(Protocol.CONFIGURATION_CONTENT_RESPONSE_OPCDE).getClass());
-
- assertEquals(
- EventContentMessageHandler.class,
- managementHandlers.get(Protocol.EVENT_CONTENT_RESPONSE_OPCDE).getClass());
-
- assertEquals(
- HeartBeatIndicationMessageHandler.class,
- managementHandlers.get(Protocol.HEARTBEAT_INDICATION_RESPONSE_OPCODE).getClass());
-
- Map<Character, IMessageHandler> methodReplyHandlers = configuration.getMethodReplyQueueHandlers();
- assertEquals(2, methodReplyHandlers.size());
-
- assertEquals(
- MethodResponseMessageHandler.class,
- methodReplyHandlers.get(Protocol.OPERATION_INVOCATION_RESPONSE_OPCODE).getClass());
-
- assertEquals(
- SchemaResponseMessageHandler.class,
- methodReplyHandlers.get(Protocol.SCHEMA_RESPONSE_OPCODE).getClass());
- }
-
- /**
- * Tests the changes of the configurator internal state while configuration file is parsed.
- *
- * <br>precondition: N.A.
- * <br>postcondition: N.A.
- */
- public void testDirectorParsing() throws SAXException{
- Configurator configurator = new Configurator();
-
- assertSame(Configurator.DEFAULT_PARSER,configurator._currentParser);
-
- configurator.startElement(null, null, Tag.BROKERS.toString(), null);
- assertSame(configurator._brokerConfigurationParser,configurator._currentParser);
- }
-
- /**
- * It's not possibile to add twice the same broker connection data.
- * Is so an exception must be thrown indicating that the given broker is already connected.
- *
- * <br>precondition : the given data identifies an already connected broker.
- * <br>postcondition : an exception is thrown indicating the failure.
- */
- public void testAddTwoIdenticalBrokers() throws ConfigurationException, BrokerConnectionException
- {
- Configurator configurator = new Configurator();
- configurator.configure();
-
- BrokerConnectionData data = new BrokerConnectionData("sofia.gazzax.com",5672,"virtualHost","user","pwd",1,4,-1);
-
- Configuration.getInstance()._brokerConnectionInfos.put(UUID.randomUUID(),data);
-
- try {
- configurator.createAndReturnBrokerConnectionData(
- UUID.randomUUID(),
- data.getHost(),
- data.getPort(),
- "anotherUser",
- "anotherPassword",
- data.getVirtualHost(),
- 33,
- 12,
- 1000);
- fail("If a broker is added twice an exception must be thrown.");
- } catch (BrokerAlreadyConnectedException expected) {
- assertEquals(data,expected.getBrokerConnectionData());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/MappingParsersTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/MappingParsersTest.java
deleted file mode 100644
index af261024bd..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/configuration/MappingParsersTest.java
+++ /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.
- *
- */
-package org.apache.qpid.management.configuration;
-
-import java.util.UUID;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.management.TestConstants;
-
-/**
- * Test case for mapping parsers.
- *
- * @author Andrea Gazzarini.
- */
-public class MappingParsersTest extends TestCase
-{
- /**
- * Tests the execution of the broker connection data mapping parser.
- *
- * <br>precondition: A broker connection datamapping is built by the parser;
- * <br>postcondition: the corresponding connection data is available on the configuration.
- */
- public void testBrokerConnectionDataParser() throws UnknownBrokerException
- {
- String host = "127.0.0.1";
- String port = "7001";
- String virtualHost = "test";
- String username = "username_guest";
- String password ="password_guest";
-
- BrokerConnectionDataParser parser = new BrokerConnectionDataParser()
- {
- @Override
- UUID getUUId ()
- {
- return TestConstants.BROKER_ID;
- }
- };
-
- parser.setCurrrentAttributeValue(host);
- parser.setCurrentAttributeName(Tag.HOST.toString());
- parser.setCurrrentAttributeValue(port);
- parser.setCurrentAttributeName(Tag.PORT.toString());
- parser.setCurrrentAttributeValue(virtualHost);
- parser.setCurrentAttributeName(Tag.VIRTUAL_HOST.toString());
- parser.setCurrrentAttributeValue(username);
- parser.setCurrentAttributeName(Tag.USER.toString());
- parser.setCurrrentAttributeValue(password);
- parser.setCurrentAttributeName(Tag.PASSWORD.toString());
- parser.setCurrentAttributeName(Tag.BROKER.toString());
-
- BrokerConnectionData result = Configuration.getInstance().getBrokerConnectionData(TestConstants.BROKER_ID);
-
- assertEquals(host,result.getHost());
- assertEquals(Integer.parseInt(port),result.getPort());
- assertEquals(virtualHost,result.getVirtualHost());
- assertEquals(username,result.getUsername());
- assertEquals(password,result.getPassword());
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/handler/base/ContentIndicationMessageHandlerTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/handler/base/ContentIndicationMessageHandlerTest.java
deleted file mode 100644
index d6b51b64fc..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/handler/base/ContentIndicationMessageHandlerTest.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-package org.apache.qpid.management.domain.handler.base;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.management.domain.model.type.Binary;
-
-/**
- * Test case for Content indication message handler (base class).
- *
- * @author Andrea Gazzarini
- */
-public class ContentIndicationMessageHandlerTest extends TestCase
-{
- /**
- * Tests the behaviour of the objectHasBeenRemoved method().
- */
- public void testObjectHasBeenRemoved()
- {
- ContentIndicationMessageHandler mockHandler = new ContentIndicationMessageHandler()
- {
- @Override
- protected void updateDomainModel (String packageName, String className, Binary classHash, Binary objectId,
- long timeStampOfCurrentSample, long timeObjectWasCreated, long timeObjectWasDeleted, byte[] contentData)
- {
- }
- };
-
- long deletionTimestamp = 0;
- long now = System.currentTimeMillis();
-
- assertFalse(mockHandler.objectHasBeenRemoved(deletionTimestamp, now));
-
- deletionTimestamp = now + 1000;
- assertFalse(mockHandler.objectHasBeenRemoved(deletionTimestamp, now));
-
- deletionTimestamp = now - 1000;
- assertTrue(mockHandler.objectHasBeenRemoved(deletionTimestamp, now));
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/BaseDomainModelTestCase.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/BaseDomainModelTestCase.java
deleted file mode 100644
index c528392a93..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/BaseDomainModelTestCase.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import org.apache.qpid.management.configuration.Configurator;
-
-import junit.framework.TestCase;
-
-/**
- * Layer supertype for all domain model related test cases.
- *
- * @author Andrea Gazzarini
- */
-public abstract class BaseDomainModelTestCase extends TestCase
-{
- /**
- * Set up fixture for this test case.
- * In order to execute tests on domain model we need to build the configuration.
- */
- @Override
- protected void setUp () throws Exception
- {
- Configurator configurator = new Configurator();
- configurator.configure();
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/BaseQpidFeatureBuilderTestCase.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/BaseQpidFeatureBuilderTestCase.java
deleted file mode 100644
index 3d3783eb04..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/BaseQpidFeatureBuilderTestCase.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.desc;
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.name;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.management.configuration.Configurator;
-import org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute;
-
-/**
- * Layer supertype for feature builder test cases.
- *
- * @author Andrea Gazzarini
- */
-public abstract class BaseQpidFeatureBuilderTestCase extends TestCase
-{
- protected final static String NAME = "aName";
-
- protected final static String DESCRIPTION = "A description.";
-
- protected Map <String,Object> _featureDefinition;
- protected QpidFeatureBuilder _builder;
-
- /**
- * Set up fixture for all concrete builder test cases.
- */
- @Override
- protected void setUp () throws Exception
- {
- Configurator configurator = new Configurator();
- configurator.configure();
- _featureDefinition = new HashMap<String, Object>();
- _featureDefinition.put(name.name(),NAME);
- _featureDefinition.put(desc.name(), DESCRIPTION);
- }
-
- // Internal test used to avoid code duplication.
- protected void internalTestForMissingMandatoryAttribute(Attribute ...toBeRemoved)
- {
- try
- {
- for (Attribute attribute : toBeRemoved)
- {
- _featureDefinition.remove(attribute.name());
- }
- _builder.build();
- fail("If a mandatory attribute is missing an exception must be thrown!");
- } catch (UnableToBuildFeatureException expected)
- {
- assertTrue(expected instanceof MissingFeatureAttributesException);
- for (Attribute attribute : toBeRemoved)
- {
- assertTrue(expected.getMessage().contains(attribute.name()));
- }
- }
- }
-
- // Internal test used to avoid code duplication.
- protected void internalTestForMissingOptionalAttribute(Attribute ...toBeRemoved) throws UnableToBuildFeatureException
- {
- for (Attribute attribute : toBeRemoved)
- {
- _featureDefinition.remove(attribute.name());
- }
- _builder.build();
-
- assertNotNull(_builder.getQpidFeature());
- assertNotNull(_builder.getManagementFeature());
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/DomainModelTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/DomainModelTest.java
deleted file mode 100644
index 578fa36bc7..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/DomainModelTest.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.util.UUID;
-
-import org.apache.qpid.management.TestConstants;
-
-/**
- * Test case for domain model entity.
- *
- * @author Andrea Gazzarini
- */
-public class DomainModelTest extends BaseDomainModelTestCase
-{
- private DomainModel _model;
-
- @Override
- protected void setUp () throws Exception
- {
- _model = new DomainModel(UUID.randomUUID());
- }
-
- /**
- * Tests the execution of the getPackage() method.
- */
- public void testGetPackage()
- {
- assertFalse(_model.containsPackage(TestConstants.QPID_PACKAGE_NAME));
-
- QpidPackage qpidPackage = _model.getPackageByName(TestConstants.QPID_PACKAGE_NAME);
- assertEquals(TestConstants.QPID_PACKAGE_NAME,qpidPackage.getName());
-
- QpidPackage theSameAsPreviousOne = _model.getPackageByName(TestConstants.QPID_PACKAGE_NAME);
- assertSame(qpidPackage, theSameAsPreviousOne);
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/OptionalPropertiesTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/OptionalPropertiesTest.java
deleted file mode 100644
index 553c1c21de..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/OptionalPropertiesTest.java
+++ /dev/null
@@ -1,187 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.nio.ByteBuffer;
-import java.util.LinkedList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.management.domain.model.type.Uint64;
-import org.apache.qpid.transport.codec.BBDecoder;
-
-public class OptionalPropertiesTest extends TestCase
-{
- public void testDecoderStateChange()
- {
- QpidProperty property = new QpidProperty();
- assertSame(
- "Default decoder for properties is the one for mandatory properties.",
- property._mandatoryPropertyDecoder,
- property._decoder);
-
- property.markAsOptional(1);
- assertSame(
- "After a property has been marked as optional the corresponding decoder must be installed.",
- property._optionalPropertyDecoder,
- property._decoder);
- }
-
- /**
- * Tests the execution of the decode() method when the current property is optional but in the presence bitmask
- * there's no the corresponding bit set.
- *
- * <br>precondition : property is optional and corresponding presence bit is not set.
- * <br>postcondition : result must be null.
- */
- public void testDecodeValueWithOptionalPropertyAndMissingValue()
- {
- byte [] presenceBytes = {2};
-
- QpidProperty property = new QpidProperty();
-
- // We don't need a decoder so in order to be sure that it won't be invoked set it to null.
- BBDecoder nullDecoder = null;
-
- for (int i = 0; i < 8; i++)
- {
- // Property number 1 is declaring a value so skip it!
- if (i != 1)
- {
- property.markAsOptional(i);
- assertNull(property.decodeValue(nullDecoder, presenceBytes));
- }
- }
- }
-
- /**
- * Tests the execution of the decode() method when the current property is optional but in the presence bitmask
- * there's no the corresponding bit set.
- *
- * <br>precondition : property is optional and corresponding presence bit is not set.
- * <br>postcondition : result must be null.
- */
- public void testDecodeValueWithOptionalPropertyAndDeclaredValue()
- {
- byte [] presenceBytes = {4};
- Long _44 = new Long(44);
-
- QpidProperty property = new QpidProperty();
- property.setType(new Uint64());
- property.markAsOptional(2);
-
- ByteBuffer buffer = ByteBuffer.allocate(8);
- buffer.putLong(_44);
- buffer.rewind();
- BBDecoder decoder = new BBDecoder();
-
- decoder.init(buffer);
- assertEquals(_44,property.decodeValue(decoder, presenceBytes));
- }
-
- /**
- * Tests the execution of the decode() method with a real scenario where there are mandatory and optional
- * properties.
- */
- public void testDecodeValueWithOptionalAndMandatoryProperties()
- {
- // With this bitset :
- //
- // 1th opt property is null;
- // 2th opt property is null;
- // 3th opt property is not null;
- // 4th opt property is null;
- // 5th opt propertyis null;
- // 6th opt property is null;
- // 7th opt property is null;
- // 8th opt property is not null;
- byte [] presenceBytes = {4,1};
-
- List<QpidProperty> properties = new LinkedList<QpidProperty>();
-
- properties.add(createProperty(false, -1));
- properties.add(createProperty(false, -1));
- properties.add(createProperty(true, 0));
- properties.add(createProperty(false, -1));
- properties.add(createProperty(false, -1));
- properties.add(createProperty(true, 1));
- properties.add(createProperty(false, -1));
- properties.add(createProperty(false, -1));
- properties.add(createProperty(true, 2));
- properties.add(createProperty(true, 3));
- properties.add(createProperty(true, 4));
- properties.add(createProperty(true, 5));
- properties.add(createProperty(true, 6));
- properties.add(createProperty(true, 7));
- properties.add(createProperty(false, -1));
- properties.add(createProperty(true, 8));
-
- Long expectedResults [] = {
- 1L, // p1
- 22L, // p2
- null, // p3
- 232L, // p4
- 211L, // p5
- null, // p6
- 232L, // p7
- 211L, // p8
- 999L, // p9
- null, // p10
- null, // p11
- null, // p12
- null, // p13
- null, // p14
- 626L, // p15
- 969L // p16
- };
-
-
- ByteBuffer buffer = ByteBuffer.allocate(expectedResults.length * 8);
- for (Long expected : expectedResults)
- {
- if (expected != null)
- {
- buffer.putLong(expected);
- }
- }
- buffer.rewind();
- BBDecoder decoder = new BBDecoder();
-
- decoder.init(buffer);
- int index = 0;
- for (QpidProperty property : properties)
- {
- assertEquals(expectedResults[index++],property.decodeValue(decoder, presenceBytes));
- }
- }
-
- private QpidProperty createProperty(boolean isOptional, int optionalIndex)
- {
- QpidProperty property = new QpidProperty();
- property.setType(new Uint64());
- if (isOptional)
- {
- property.markAsOptional(optionalIndex);
- }
- return property;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidClassTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidClassTest.java
deleted file mode 100644
index 284f3841b8..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidClassTest.java
+++ /dev/null
@@ -1,408 +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.
- *
- */
-
-package org.apache.qpid.management.domain.model;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.management.TestConstants;
-import org.apache.qpid.management.configuration.ConfigurationException;
-import org.apache.qpid.management.configuration.Configurator;
-import org.apache.qpid.management.domain.handler.impl.MethodOrEventDataTransferObject;
-import org.apache.qpid.management.domain.model.QpidClass.QpidManagedObject;
-
-/**
- * Test case for Qpid Class.
- *
- * @author Andrea Gazzarini
- */
-public class QpidClassTest extends TestCase
-{
- private QpidClass _class;
- private QpidPackage _package;
-
- @Override
- protected void setUp () throws ConfigurationException
- {
- Configurator configurator = new Configurator();
- configurator.configure();
- _package = new QpidPackage(TestConstants.QPID_PACKAGE_NAME,TestConstants.DOMAIN_MODEL);
- _class = new QpidClass(TestConstants.EXCHANGE_CLASS_NAME,TestConstants.HASH,_package);
- }
-
- /**
- * Tests the execution of the getObjectInstance() method.
- * Basically it tests the addition of a new object instance.
- *
- * <br>precondition: class has no object instances.
- * <br>precondition : class contains the added object instance.
- */
- public void testGetObjectInstance()
- {
- assertFalse (
- "Nobody set instance #"+TestConstants.OBJECT_ID+" into this class so why is it there?",
- _class._objectInstances.containsKey(TestConstants.OBJECT_ID));
-
- QpidManagedObject instance = _class.getObjectInstance(TestConstants.OBJECT_ID, false);
-
- assertTrue (
- "Now the instance #"+TestConstants.OBJECT_ID+" should be there...",
- _class._objectInstances.containsKey(TestConstants.OBJECT_ID));
-
- assertEquals(instance,_class.getObjectInstance(TestConstants.OBJECT_ID, false));
- }
-
- /**
- * Tests the injection of instrumentation and configuration data (related to a specific object instance) before the
- * schema is installed.
- *
- * <br>precondition : the schema hasn't yet installed on this class.
- * <br>postcondition : incoming configuration & instrumentation data is stored into the corresponding object instance.
- */
- public void testAddInstrumentationAndConfigurationDataBeforeSchemaInstallation()
- {
- _class._state = _class._schemaRequestedButNotYetInjected;
- QpidManagedObject objectInstance = _class.getObjectInstance(TestConstants.OBJECT_ID,false);
-
- assertTrue(
- "This object instance is a new one so how is it possible that it has already instrumentation data? ",
- objectInstance._rawInstrumentationData.isEmpty());
- assertTrue(
- "This object instance is a new one so how is it possible that it has already configuration data? ",
- objectInstance._rawConfigurationData.isEmpty());
-
- byte [] dummyConfigurationData = {1,2,3,4,5,6,7,8};
- byte [] dummyInstrumentationData = {11,21,31,41,51,61,71,81};
-
- _class.addConfigurationData(TestConstants.OBJECT_ID, dummyConfigurationData);
- _class.addInstrumentationData(TestConstants.OBJECT_ID, dummyInstrumentationData);
-
- assertEquals("Now configuration data should be there...",1,objectInstance._rawConfigurationData.size());
- assertEquals("Now instrumentation data should be there...",1,objectInstance._rawInstrumentationData.size());
-
- assertTrue(
- "Object instance configuration data should be the previously set...",
- Arrays.equals(objectInstance._rawConfigurationData.get(0),
- dummyConfigurationData));
-
- assertTrue(
- "Object instance instrumentation data should be the previously set...",
- Arrays.equals(objectInstance._rawInstrumentationData.get(0),
- dummyInstrumentationData));
- }
-
- /**
- * Tests the internal state change of a class definition.
- */
- public void testStateChange() throws UnableToBuildFeatureException
- {
- _class = new QpidClass(TestConstants.EXCHANGE_CLASS_NAME,TestConstants.HASH,_package)
- {
- @Override
- void requestSchema() throws Exception {
- _state = _schemaRequestedButNotYetInjected;
- }
-
- @Override
- void setSchema(List<Map<String, Object>> propertyDefinitions,
- List<Map<String, Object>> statisticDefinitions,
- List<MethodOrEventDataTransferObject> methodDefinitions) throws UnableToBuildFeatureException {
- _state = _schemaInjected;
- }
- };
-
- assertSame(
- "Initial state doesn't match.",
- _class._schemaNotRequested,
- _class._state);
-
- _class.addConfigurationData(TestConstants.OBJECT_ID, TestConstants.TEST_RAW_DATA);
- _class.addInstrumentationData(TestConstants.OBJECT_ID, TestConstants.TEST_RAW_DATA);
-
- assertSame(
- "Request schema has been requested but not yet injected. The current state is not indicating that!",
- _class._schemaRequestedButNotYetInjected,
- _class._state);
-
- _class.setSchema(
- TestConstants.EMPTY_PROPERTIES_SCHEMA,
- TestConstants.EMPTY_STATISTICS_SCHEMA,
- new LinkedList<MethodOrEventDataTransferObject>());
-
- assertSame(
- "Request schema has been injected. The current state is not indicating that!",
- _class._schemaInjected,
- _class._state);
- }
-
- /**
- * Tests the injection of a valid schema on a QpidClass.
- *
- * <br>precondition : a valid arguments is injected on the qpid class.
- * <br>postcondition : class definition is built successfully.
- */
- public void testSchemaInjectionOk() throws UnableToBuildFeatureException
- {
- _class = new QpidClass(TestConstants.EXCHANGE_CLASS_NAME,TestConstants.HASH,_package)
- {
- @Override
- void requestSchema() throws Exception
- {
- // DO NOTHING : QMan is not running and therefore the schema will be manually injected.
- }
-
- @Override
- void updateInstanceWithConfigurationData(QpidManagedObject instance, byte[] rawData)
- {
- // DO NOTHING Given raw data is not valid so it cannot be converted.
- }
- };
-
- // Incoming configuration data : that will fire the schema request and a state change
- // from schema-not-requested to schema-requested-but-not-injected
- _class.addConfigurationData(TestConstants.OBJECT_ID, TestConstants.TEST_RAW_DATA);
-
- // I must be sure that what is obvious for me it's obvious for QMan... :)
- assertSame(
- "Request schema has been requested but not yet injected. The current state is not indicating that!",
- _class._schemaRequestedButNotYetInjected,
- _class._state);
-
- List<Map<String,Object>> propertyDefinitions = new ArrayList<Map<String,Object>>(2);
- propertyDefinitions.add(
- createProperty(
- TestConstants.AGE_ATTRIBUTE_NAME,
- 1,
- TestConstants.YEARS,
- TestConstants.SAMPLE_MIN_VALUE,
- TestConstants.SAMPLE_MAX_VALUE,
- null,
- TestConstants.AGE_ATTRIBUTE_DESCRIPTION,
- TestConstants._1,
- false,
- TestConstants._0));
-
- propertyDefinitions.add(
- createProperty(
- TestConstants.SURNAME_ATTRIBUTE_NAME,
- TestConstants.SAMPLE_ACCESS_CODE,
- null,
- null,
- null,
- TestConstants.SAMPLE_MAX_VALUE,
- TestConstants.SURNAME_ATTRIBUTE_DESCRIPTION,
- TestConstants._1,
- true,
- TestConstants._1));
-
- _class.setSchema(propertyDefinitions, TestConstants.EMPTY_STATISTICS_SCHEMA, TestConstants.EMPTY_METHODS_SCHEMA);
-
- assertEquals(2,_class._properties.size());
-
- QpidProperty property = _class._properties.get(TestConstants.AGE_ATTRIBUTE_NAME);
- assertEquals(TestConstants.AGE_ATTRIBUTE_NAME,property.getName());
- assertEquals(AccessMode.RC,property.getAccessMode());
- assertEquals(TestConstants.YEARS,property.getUnit());
- assertEquals(TestConstants.SAMPLE_MIN_VALUE,property.getMinValue());
- assertEquals(TestConstants.SAMPLE_MAX_VALUE,property.getMaxValue());
- assertEquals(Integer.MIN_VALUE,property.getMaxLength());
- assertEquals(TestConstants.AGE_ATTRIBUTE_DESCRIPTION,property.getDescription());
- assertEquals(Short.class,property.getJavaType());
- assertFalse(property.isOptional());
-
- property = _class._properties.get(TestConstants.SURNAME_ATTRIBUTE_NAME);
- assertEquals(TestConstants.SURNAME_ATTRIBUTE_NAME,property.getName());
- assertEquals(AccessMode.RC,property.getAccessMode());
- assertNull(property.getUnit());
- assertEquals(Integer.MIN_VALUE,property.getMinValue());
- assertEquals(Integer.MIN_VALUE,property.getMaxValue());
- assertEquals(TestConstants.SAMPLE_MAX_VALUE,property.getMaxLength());
- assertEquals(TestConstants.SURNAME_ATTRIBUTE_DESCRIPTION,property.getDescription());
- assertEquals(Short.class,property.getJavaType());
- assertTrue(property.isOptional());
-
- MBeanInfo mbeanInfo = _class._metadata;
- assertEquals(TestConstants.EXCHANGE_CLASS_NAME,mbeanInfo.getClassName());
-
- MBeanAttributeInfo [] attributes = mbeanInfo.getAttributes();
- assertEquals(2,attributes.length);
-
- MBeanAttributeInfo attribute = attributes[0];
- assertEquals(TestConstants.AGE_ATTRIBUTE_NAME,attribute.getName());
- assertEquals(TestConstants.AGE_ATTRIBUTE_DESCRIPTION,attribute.getDescription());
- assertFalse(attribute.isWritable());
- assertTrue(attribute.isReadable());
- assertEquals(Short.class.getName(),attribute.getType());
-
- attribute = attributes[1];
- assertEquals(TestConstants.SURNAME_ATTRIBUTE_NAME,attribute.getName());
- assertEquals(TestConstants.SURNAME_ATTRIBUTE_DESCRIPTION,attribute.getDescription());
- assertFalse(attribute.isWritable());
- assertTrue(attribute.isReadable());
- assertEquals(Short.class.getName(),attribute.getType());
- }
-
- /**
- * Tests the behaviour of the class when a schema request can't be made.
- *
- * <br>precondition : class must be in "schema-not-requested" state when incoming data arrives.
- * <br>postcondition : no exception is thrown and no state transition happens.
- */
- public void testStateChange_withRequestSchemaFailure()
- {
- _class= new QpidClass(TestConstants.EXCHANGE_CLASS_NAME,TestConstants.HASH,_package)
- {
- @Override
- void requestSchema() throws Exception {
- throw new Exception();
- }
-
- @Override
- void setSchema(
- List<Map<String, Object>> propertyDefinitions,
- List<Map<String, Object>> statisticDefinitions,
- List<MethodOrEventDataTransferObject> methodDefinitions) throws UnableToBuildFeatureException
- {
- }
- };
-
- assertSame(
- "Initial state must be schema-not-requested.",
- _class._schemaNotRequested,
- _class._state);
-
- _class.addInstrumentationData(TestConstants.OBJECT_ID, TestConstants.TEST_RAW_DATA);
-
- assertSame(
- "Current state must be still schema-not-requested.",
- _class._schemaNotRequested,
- _class._state);
- }
-
- /**
- * Tests the behaviour of the class when a schema injection fails.
- *
- * <br>precondition : class must be in "schema-not-requested" state when incoming data arrives.
- * <br>postcondition : an exception is thrown and no state transition happens.
- */
- public void testStateChange_withSchemaInjectionFailure()
- {
- _class = new QpidClass(TestConstants.EXCHANGE_CLASS_NAME,TestConstants.HASH,_package)
- {
- @Override
- void requestSchema() throws Exception
- {
- // DO NOTHING.
- }
-
- @Override
- void setSchema(List<Map<String, Object>> propertyDefinitions,
- List<Map<String, Object>> statisticDefinitions,
- List<MethodOrEventDataTransferObject> methodDefinitions)
- throws UnableToBuildFeatureException
- {
- throw new UnableToBuildFeatureException("");
- }
- };
-
- assertSame(
- "Initial state must be schema-not-requested.",
- _class._schemaNotRequested,
- _class._state);
-
- _class.addInstrumentationData(TestConstants.OBJECT_ID, TestConstants.TEST_RAW_DATA);
-
- assertSame(
- "Request schema has been requested but not yet injected. The current state is not indicating that!",
- _class._schemaRequestedButNotYetInjected,
- _class._state);
-
- try {
- _class.setSchema(
- TestConstants.EMPTY_PROPERTIES_SCHEMA,
- TestConstants.EMPTY_STATISTICS_SCHEMA,
- TestConstants.EMPTY_METHODS_SCHEMA);
- fail("If we are here something was wrong becuase the setSchema() of this event is throwing an exception...");
- } catch (UnableToBuildFeatureException expected) {
- assertSame(
- "Request schema has been requested but not yet injected. The current state is not indicating that!",
- _class._schemaRequestedButNotYetInjected,
- _class._state);
- }
- }
-
- private Map<String,Object> createProperty(
- String name,
- Integer accessCode,
- String unit,
- Integer min,
- Integer max,
- Integer maxLength,
- String description,
- Integer type,
- boolean optional,
- Integer index)
- {
- Map <String,Object> result = new HashMap<String, Object>();
- result.put(QpidFeatureBuilder.Attribute.name.name(),name);
- result.put(QpidFeatureBuilder.Attribute.access.name(), accessCode);
-
- if (unit != null)
- {
- result.put(QpidFeatureBuilder.Attribute.unit.name(),unit);
- }
-
- if (min != null)
- {
- result.put(QpidFeatureBuilder.Attribute.min.name(), min);
- }
-
- if (max != null)
- {
- result.put(QpidFeatureBuilder.Attribute.max.name(),max);
- }
-
- if (maxLength != null)
- {
- result.put(QpidFeatureBuilder.Attribute.maxlen.name(),maxLength);
- }
-
- result.put(QpidFeatureBuilder.Attribute.desc.name(), description);
- result.put(QpidFeatureBuilder.Attribute.type.name(), type);
- result.put(QpidFeatureBuilder.Attribute.optional.name(),optional ? 1 : 0);
-
- if (index != null)
- {
- result.put(QpidFeatureBuilder.Attribute.index.name(), index);
- }
- return result;
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidEventTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidEventTest.java
deleted file mode 100644
index 954a419787..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidEventTest.java
+++ /dev/null
@@ -1,293 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanException;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.management.TestConstants;
-import org.apache.qpid.management.configuration.ConfigurationException;
-import org.apache.qpid.management.configuration.Configurator;
-import org.apache.qpid.management.domain.model.QpidEvent.QpidManagedEvent;
-
-/**
- * Test case for qpid class entity.
- *
- * @author Andrea Gazzarini
- */
-public class QpidEventTest extends TestCase
-{
- private QpidEvent _event;
- private QpidPackage _qpidPackage;
-
- @Override
- protected void setUp () throws Exception
- {
- _qpidPackage = new QpidPackage(TestConstants.QPID_PACKAGE_NAME,TestConstants.DOMAIN_MODEL);
- _event = new QpidEvent(TestConstants.BIND_EVENT_NAME,TestConstants.HASH,_qpidPackage);
- }
-
- /**
- * Tests the execution of the createEventInstance() method.
- * Basically it tests the addition of a new event instance.
- *
- * <br>precondition: event deifinition has no object instances.
- * <br>precondition : event definition contains the new object instance.
- */
- public void testCreateEventInstance()
- {
- assertTrue(
- "A just created event should be empty. I mean there shouldn't be event instances inside.",
- _event.hasNoInstances());
-
- QpidManagedEvent instance = createEventInstance();
-
- assertFalse (
- "Now a new instance should be there...",
- _event.hasNoInstances());
-
- assertEquals(TestConstants.TEST_RAW_DATA,instance._rawEventData);
- assertEquals(TestConstants.NOW,instance._timestamp);
- assertEquals(TestConstants.SEVERITY, instance._severity);
- }
-
- /**
- * Tests the internal state change of an event definition.
- */
- public void testStateChange() throws UnableToBuildFeatureException
- {
- // Let's override this class because this is not an online tests and therefore
- // QMan is not supposed to be up.
- _event = new QpidEvent(TestConstants.BIND_EVENT_NAME,TestConstants.HASH,_qpidPackage)
- {
- @Override
- void requestSchema() throws Exception {
- // Do Nothing.
- }
-
- @Override
- void setSchema(List<Map<String, Object>> argumentDefinitions)throws UnableToBuildFeatureException {
- _state = _schemaInjected;
- }
- };
-
- assertSame(
- "Initial state doesn't match.",
- _event._schemaNotRequested,
- _event._state);
-
- _event.addEventData(TestConstants.TEST_RAW_DATA, TestConstants.NOW, TestConstants.SEVERITY);
-
- assertSame(
- "Request schema has been requested but not yet injected. The current state is not indicating that!",
- _event._schemaRequestedButNotYetInjected,
- _event._state);
-
- _event.setSchema(TestConstants.EMPTY_ARGUMENTS_SCHEMA);
-
- assertSame(
- "Request schema has been injected. The current state is not indicating that!",
- _event._schemaInjected,
- _event._state);
- }
-
- /**
- * Tests the injection of a valid schema on a QpidEvent.
- *
- * <br>precondition : a valid arguments is injected on the qpid event.
- * <br>postcondition : event definition is built successfully.
- */
- public void testSchemaInjectionOK() throws UnableToBuildFeatureException, ConfigurationException, InstanceNotFoundException, MBeanException, ReflectionException
- {
- _event = new QpidEvent(TestConstants.BIND_EVENT_NAME,TestConstants.HASH,_qpidPackage)
- {
- @Override
- void requestSchema() throws Exception
- {
- // DO NOTHING : QMan is not running and therefore the schema will be manually injected.
- }
-
- @Override
- void updateEventInstanceWithData(QpidManagedEvent instance)
- {
- // DO NOTHING : otherwise we should supply a valid raw data to be converted. ;-)
- }
- };
-
- Configurator configurator = new Configurator();
- configurator.configure();
-
- List<Map<String,Object>> arguments = new ArrayList<Map<String, Object>>();
- arguments.add(createArgument(TestConstants.AGE_ATTRIBUTE_NAME, TestConstants.AGE_ATTRIBUTE_DESCRIPTION));
- arguments.add(createArgument(TestConstants.SURNAME_ATTRIBUTE_NAME, TestConstants.SURNAME_ATTRIBUTE_DESCRIPTION));
-
- // Incoming data : that will fire the schema request and a state change from schema-not-requested to schema-requested-but-not-injected
- _event.addEventData(TestConstants.TEST_RAW_DATA, TestConstants.NOW, TestConstants.SEVERITY);
-
- // I must be sure that what is obvious for me it's obvious for QMan... :)
- assertSame(
- "Request schema has been requested but not yet injected. The current state is not indicating that!",
- _event._schemaRequestedButNotYetInjected,
- _event._state);
-
- // Inject schema
- _event.setSchema(arguments);
-
- // Arguments must be 2 + 2 (severity)
- assertEquals(2,_event._arguments.size());
-
- QpidProperty argument = _event._arguments.get(TestConstants.AGE_ATTRIBUTE_NAME);
- assertEquals(TestConstants.AGE_ATTRIBUTE_NAME,argument.getName());
- assertEquals(AccessMode.RO,argument.getAccessMode());
- assertEquals(TestConstants.AGE_ATTRIBUTE_DESCRIPTION,argument.getDescription());
- assertEquals(Short.class,argument.getJavaType());
- assertFalse(argument.isOptional());
-
- argument = _event._arguments.get(TestConstants.SURNAME_ATTRIBUTE_NAME);
- assertEquals(TestConstants.SURNAME_ATTRIBUTE_NAME,argument.getName());
- assertEquals(AccessMode.RO,argument.getAccessMode());
- assertEquals(TestConstants.SURNAME_ATTRIBUTE_DESCRIPTION,argument.getDescription());
- assertEquals(Short.class,argument.getJavaType());
- assertFalse(argument.isOptional());
-
- assertEquals(1,_event._eventInstances.size());
-
- JmxService service = new JmxService();
- Set<ObjectName> objectNames = service.getEventMBeans();
-
- assertEquals(1,objectNames.size());
- }
-
- /**
- * Tests the behaviour of the event class when a schema request can't be made.
- *
- * <br>precondition : event must be in "schema-not-requested" state when incoming data arrives.
- * <br>postcondition : no exception is thrown and no state transition happens.
- */
- public void testStateChange_withRequestSchemaFailure()
- {
- _event = new QpidEvent(TestConstants.BIND_EVENT_NAME,TestConstants.HASH,_qpidPackage)
- {
- @Override
- void requestSchema() throws Exception {
- throw new Exception();
- }
-
- @Override
- void setSchema(List<Map<String, Object>> argumentDefinitions)throws UnableToBuildFeatureException {
- _state = _schemaInjected;
- }
- };
-
- assertSame(
- "Initial state must be schema-not-requested.",
- _event._schemaNotRequested,
- _event._state);
-
- _event.addEventData(TestConstants.TEST_RAW_DATA, TestConstants.NOW, TestConstants.SEVERITY);
-
- assertSame(
- "Current state must be still schema-not-requested.",
- _event._schemaNotRequested,
- _event._state);
- }
-
- /**
- * Tests the behaviour of the event class when a schema injection fails.
- *
- * <br>precondition : event must be in "schema-not-requested" state when incoming data arrives.
- * <br>postcondition : an exception is thrown and no state transition happens.
- */
- public void testStateChange_withSchemaInjectionFailure()
- {
- _event = new QpidEvent(TestConstants.BIND_EVENT_NAME,TestConstants.HASH,_qpidPackage)
- {
- @Override
- void requestSchema() throws Exception {
- // DO NOTHING.
- }
-
- @Override
- void setSchema(List<Map<String, Object>> argumentDefinitions)throws UnableToBuildFeatureException {
- throw new UnableToBuildFeatureException("");
- }
- };
-
- assertSame(
- "Initial state must be schema-not-requested.",
- _event._schemaNotRequested,
- _event._state);
-
- _event.addEventData(TestConstants.TEST_RAW_DATA, TestConstants.NOW, TestConstants.SEVERITY);
-
- assertSame(
- "Request schema has been requested but not yet injected. The current state is not indicating that!",
- _event._schemaRequestedButNotYetInjected,
- _event._state);
-
- try {
- _event.setSchema(TestConstants.EMPTY_ARGUMENTS_SCHEMA);
- fail("If we are here something was wrong becuase the setSchema() of this event is throwing an exception...");
- } catch (UnableToBuildFeatureException expected) {
- assertSame(
- "Request schema has been requested but not yet injected. The current state is not indicating that!",
- _event._schemaRequestedButNotYetInjected,
- _event._state);
- }
- }
-
- /**
- * Factory method for qpid managed event instances.
- *
- * @return a new QpidManagedEvent with test data inside.
- */
- private QpidManagedEvent createEventInstance()
- {
- return _event.createEventInstance(
- TestConstants.TEST_RAW_DATA,
- TestConstants.NOW,
- TestConstants.SEVERITY);
- }
-
- /**
- * Factory method for event argument.
- *
- * @return a new argument metadata.
- */
- private Map<String,Object> createArgument(String name,String desc)
- {
- Map <String,Object> argument = new HashMap<String, Object>();
- argument.put(QpidFeatureBuilder.Attribute.name.name(),name);
- argument.put(QpidFeatureBuilder.Attribute.desc.name(), desc);
- argument.put(QpidFeatureBuilder.Attribute.type.name(), TestConstants._1);
- return argument;
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidMethodBuilderTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidMethodBuilderTest.java
deleted file mode 100644
index 06dc35b0b1..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidMethodBuilderTest.java
+++ /dev/null
@@ -1,147 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.dir;
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.name;
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.type;
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.unit;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.management.MBeanOperationInfo;
-
-import org.apache.qpid.management.Names;
-import org.apache.qpid.management.domain.handler.impl.MethodOrEventDataTransferObject;
-import org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute;
-
-/**
- * Test case for Qpid Statistic builder.
- *
- * @author Andrea Gazzarini
- */
-public class QpidMethodBuilderTest extends BaseQpidFeatureBuilderTestCase
-{
- private final static Integer ARG_COUNT = 3;
- private MethodOrEventDataTransferObject _methodDefinition;
-
- private List<Map<String,Object>> _argumentsDefinitons = new ArrayList<Map<String, Object>>();
-
- @Override
- protected void setUp () throws Exception
- {
- super.setUp();
- _featureDefinition.put(Names.ARG_COUNT_PARAM_NAME, ARG_COUNT);
-
- Map<String,Object> arg1 = new HashMap<String,Object>();
- arg1.put(name.name(), "arg1");
- arg1.put(type.name(),1);
- arg1.put(dir.name(),Direction.I.name());
- arg1.put(unit.name(), "bytes");
-
- Map<String,Object> arg2 = new HashMap<String,Object>();
- arg2.put(name.name(), "arg2");
- arg2.put(type.name(),1);
- arg2.put(dir.name(),Direction.O.name());
- arg2.put(unit.name(), "bytes");
-
- Map<String,Object> arg3 = new HashMap<String,Object>();
- arg3.put(name.name(), "arg3");
- arg3.put(type.name(),1);
- arg3.put(dir.name(),Direction.IO.name());
- arg3.put(unit.name(), "bytes");
-
- /*
- dir yes no yes Direction code for method arguments
- unit yes yes yes Units for numeric values (i.e. seconds, bytes, etc.)
- min yes no yes Minimum value for numerics
- max yes no yes Maximum value for numerics
- maxlen yes no yes Maximum length for strings
- desc yes yes yes Description of the argument
- default yes no yes Default value for the argument
- */
- _argumentsDefinitons.add(arg1);
- _argumentsDefinitons.add(arg2);
-
- _methodDefinition = new MethodOrEventDataTransferObject(_featureDefinition,_argumentsDefinitons);
- _builder = QpidFeatureBuilder.createMethodBuilder(_methodDefinition);
- }
-
- /**
- * Tests the build process for a statistic when the definition map doesn't contains type attribute.
- *
- * <br>precondition: definition map doesn't contains type attribute.
- * <br>postcondition : an exception should be thrown indicating the failure. That exception must contain the name of the
- * missing attribute.
- */
- public void testMethodBuilderKO_WithMissingName()
- {
- internalTestForMissingMandatoryAttribute(Attribute.name);
- }
-
- /**
- * Tests the build process for a statistic when the definition map doesn't contain type, name, index & optional attributes.
- *
- * <br>precondition: definition map doesn't contain type, name, index & optional attributes.
- * <br>postcondition : an exception should be thrown indicating the failure. That exception must contain the name of the
- * missing attributes.
- */
- public void testMethodBuilderOK_WithMissingUnit() throws UnableToBuildFeatureException
- {
- internalTestForMissingOptionalAttribute(Attribute.unit);
- }
-
- /**
- * Tests the build process for a statistic when the definition map doesn't unit attribute.
- * Note that this attribute is optional and therefore the build must succeed.
- *
- * <br>precondition: definition map doesn't contain unit attribute.
- * <br>postcondition : no exception is thrown and the statistic is built.
- */
- public void testMethodBuilderOK_WithMissingDescription() throws UnableToBuildFeatureException
- {
- internalTestForMissingOptionalAttribute(Attribute.desc);
- }
-
- /**
- * Tests the build process for a statistic when the definition map contains valid values.
- *
- * <br>precondition : the statistic definiton map contains valid values.
- * <br>postcondition : no exception is thrown and the statistisc is built as expected.
- */
- public void testMethodBuilderOK() throws UnableToBuildFeatureException
- {
- _builder.build();
-
- QpidMethod method = (QpidMethod) _builder.getQpidFeature();
- MBeanOperationInfo info = (MBeanOperationInfo) _builder.getManagementFeature();
-
- assertEquals(NAME,method.getName());
-
- assertEquals(DESCRIPTION,method.getDescription());
-
- assertEquals(method.getDescription(),info.getDescription());
- assertEquals(method.getName(),info.getName());
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidNumberPropertyTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidNumberPropertyTest.java
deleted file mode 100644
index 374011d150..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidNumberPropertyTest.java
+++ /dev/null
@@ -1,171 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.management.configuration.Configurator;
-import org.apache.qpid.management.domain.model.type.Uint8;
-
-public class QpidNumberPropertyTest extends TestCase
-{
- private QpidProperty _property;
- private Long _value = 55432L;
-
- @Override
- protected void setUp () throws Exception
- {
- Configurator configurator = new Configurator();
- configurator.configure();
- _property = new QpidProperty();
- _property.setName("average");
- _property.setAccessMode(AccessMode.RW);
- _property.setType(new Uint8());
- }
-
- /**
- * Tests the validation of a qpid property when the type is a number and no constraint has been set.
- *
- * <br>precondition : property type is a string, no constraint has been set.
- * <br>postcondition : no exception is thrown and the validation succeeds.
- */
- public void testValidationWithoutConstraints() {
- try
- {
- _property.validate(_value);
- } catch (ValidationException notExpected)
- {
- fail("If no constraint has been set on this property why the validation is failing?");
- }
- }
-
- /**
- * Tests the validation of a qpid property when the type is a number and a max value constraint has been set.
- *
- * <br>precondition : property type is a number, max value has been set and property value is greater than max value.
- * <br>postcondition : an exception is thrown indicating the validation failure.
- */
- public void testValidationKO_withMaxValue() {
- int maxValue = (int)(_value-1);
- _property.setMaxValue(maxValue);
-
- try
- {
- _property.validate(_value);
- fail("The given value is violating the installed constraint so an exception must be thrown.");
- } catch (ValidationException expected)
- {
- assertEquals(ValidationException.MAX_VALUE,expected.getConstraintName());
- assertEquals(maxValue,expected.getConstraintValue());
- assertEquals((double)_value,expected.getFeatureValue());
- assertEquals(_property.getName(),expected.getFeatureName());
- }
- }
-
- /**
- * Tests the validation of a qpid property when the type is a number and a min value constraint has been set.
- *
- * <br>precondition : property type is a number, min value has been set and property value is lesser than min value.
- * <br>postcondition : an exception is thrown indicating the validation failure.
- */
- public void testValidationKO_withMinValue() {
- int minValue = (int)(_value+1);
- _property.setMinValue(minValue);
-
- try
- {
- _property.validate(_value);
- fail("The given value is violating the installed constraint so an exception must be thrown.");
- } catch (ValidationException expected)
- {
- assertEquals(ValidationException.MIN_VALUE,expected.getConstraintName());
- assertEquals(minValue,expected.getConstraintValue());
- assertEquals((double)_value,expected.getFeatureValue());
- assertEquals(_property.getName(),expected.getFeatureName());
- }
- }
-
-
- /**
- * Tests the validation of a qpid property when the number is a string and the property value is null.
- *
- * <br>precondition : property type is a number and property value is null..
- * <br>postcondition : no exception is thrown. That is : the validation succeeds.
- */
- public void testValidationOK_withNullValue() {
- try
- {
- _property.validate(null);
- } catch (ValidationException notExpected)
- {
- fail("No constraint has been violated so validate() shouldn't raise an exception.");
- }
-
- _property.setMinValue(1);
- _property.setMaxValue(10);
-
- try
- {
- _property.validate(null);
- } catch (ValidationException notExpected)
- {
- fail("No constraint has been violated so validate() shouldn't raise an exception.");
- }
- }
-
- /**
- * Tests the validation of a qpid property when the type is a number and a max / min constraints have been set.
- *
- * <br>precondition : property type is a number, max / min constraint have been set and property value is wrong.
- * <br>postcondition : an exception is thrown indicating the validation failure.
- */
- public void testValidationOK_withMinAndMaxConstraint() {
- int minValue = (int)(_value+1);
- int maxValue = (int)(_value-1);
- _property.setMinValue(minValue);
- _property.setMaxValue(maxValue);
-
- try
- {
- _property.validate(_value);
- fail("The given value is violating the installed constraint so an exception must be thrown.");
- } catch (ValidationException expected)
- {
- assertEquals(ValidationException.MIN_VALUE,expected.getConstraintName());
- assertEquals(minValue,expected.getConstraintValue());
- assertEquals((double)_value,expected.getFeatureValue());
- assertEquals(_property.getName(),expected.getFeatureName());
- }
-
- _property.setMinValue(0);
- try
- {
- _property.validate(_value);
- fail("The given value is violating the installed constraint so an exception must be thrown.");
- } catch (ValidationException expected)
- {
- assertEquals(ValidationException.MAX_VALUE,expected.getConstraintName());
- assertEquals(maxValue,expected.getConstraintValue());
- assertEquals((double)_value,expected.getFeatureValue());
- assertEquals(_property.getName(),expected.getFeatureName());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidPackageTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidPackageTest.java
deleted file mode 100644
index b7eb9055ba..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidPackageTest.java
+++ /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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import org.apache.qpid.management.TestConstants;
-
-/**
- * Test case for Qpid package entity.
- *
- * @author Andrea Gazzarini
- */
-public class QpidPackageTest extends BaseDomainModelTestCase
-{
- private QpidPackage _qpidPackage;
-
- @Override
- protected void setUp () throws Exception
- {
- _qpidPackage = new QpidPackage(TestConstants.QPID_PACKAGE_NAME, TestConstants.DOMAIN_MODEL);
- }
-
- /**
- * Tests the association of a new class with a qpid package.
- *
- * <br>precondition : the package is not associated with any class.
- * <br>postcondition : the package is now associated with the given class.
- */
- public void testAddClass() throws UnableToBuildFeatureException {
- assertFalse(_qpidPackage.alreadyContainsClassDefinition(TestConstants.EXCHANGE_CLASS_NAME, TestConstants.HASH));
-
- _qpidPackage.getQpidClass(TestConstants.EXCHANGE_CLASS_NAME, TestConstants.HASH, true);
-
- assertTrue(_qpidPackage.alreadyContainsClassDefinition(TestConstants.EXCHANGE_CLASS_NAME, TestConstants.HASH));
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidPropertyBuilderTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidPropertyBuilderTest.java
deleted file mode 100644
index 8ad177645c..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidPropertyBuilderTest.java
+++ /dev/null
@@ -1,269 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.access;
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.index;
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.max;
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.min;
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.optional;
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.type;
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.unit;
-
-import javax.management.MBeanAttributeInfo;
-
-import org.apache.qpid.management.configuration.UnknownTypeCodeException;
-import org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute;
-
-/**
- * Test case for Qpid Property builder.
- *
- * @author Andrea Gazzarini
- */
-public class QpidPropertyBuilderTest extends BaseQpidFeatureBuilderTestCase
-{
- private final static Integer MIN = 0;
- private final static Integer MAX = 120;
- private final static String UNIT = "bytes";
-
- private Integer _access;
-
- @Override
- protected void setUp () throws Exception
- {
- super.setUp();
-
- _access = 1;
- _featureDefinition.put(access.name(), _access);
- _featureDefinition.put(unit.name(),UNIT);
- _featureDefinition.put(min.name(), MIN);
- _featureDefinition.put(max.name(),MAX);
-
- _featureDefinition.put(type.name(), 1);
- _featureDefinition.put(optional.name(),0);
- _featureDefinition.put(index.name(), 0);
-
- _builder = QpidFeatureBuilder.createPropertyBuilder(_featureDefinition);
- }
-
- /**
- * Tests the build process for a statistic when the definition map contains an unknown type code.
- *
- * <br>precondition : the statistic definiton map contains an unknown type code.
- * <br>postcondition : an exception is thrown indicating the failure.
- */
- public void testStatisticBuilderKO_WithUnknownType()
- {
- int unknownTypeCode =999;
- try
- {
- _featureDefinition.put(type.name(), unknownTypeCode);
- _builder.build();
- fail("An unknown type code should raise an exception to indicate a failure.");
- } catch (UnableToBuildFeatureException expected)
- {
- assertEquals(unknownTypeCode,((UnknownTypeCodeException)expected.getCause()).getCode());
- }
- }
-
- /**
- * Tests the build process for a statistic when the definition map contains a null value for a metadata attribute.
- *
- * <br>precondition : the statistic definiton map contains a null value for a metadata attribute.
- * <br>postcondition : an exception is thrown indicating the failure.
- */
- public void testMethodBuilderKO_WithNullMetadataValue()
- {
- try
- {
- _featureDefinition.put(type.name(), null);
- _builder.build();
- fail("An null value for a metadata attribute should raise an exception to indicate a failure.");
- } catch (UnableToBuildFeatureException expected)
- {
- assertTrue(expected.getCause() instanceof NullPointerException);
- }
- }
-
- /**
- * Tests the build process for a property when the definition map contains an invalid metadata type.
- *
- * <br>precondition : the property definiton map contains a wrong type for a metadata attribute.
- * <br>postcondition : an exception is thrown indicating the failure.
- */
- public void testPropertyBuilderKO_WithClassCastException()
- {
- try
- {
- _featureDefinition.put(access.name(), new String("a"));
- _builder.build();
- fail("A wrong metadata attribute type should raise an exception to indicate a failure.");
- } catch (UnableToBuildFeatureException expected)
- {
- assertTrue(expected.getCause() instanceof ClassCastException);
- }
- }
-
- /**
- * Tests the build process for a property when the definition map contains an unknown type code.
- *
- * <br>precondition : the property definiton map contains an unknown type code.
- * <br>postcondition : an exception is thrown indicating the failure.
- */
- public void testPropertyBuilderKO_WithUnknownType()
- {
- int unknownTypeCode = 999;
- try
- {
- _featureDefinition.put(type.name(), unknownTypeCode);
- _builder.build();
- fail("An unknown type code should raise an exception to indicate a failure.");
- } catch (UnableToBuildFeatureException expected)
- {
- assertEquals(unknownTypeCode,((UnknownTypeCodeException)expected.getCause()).getCode());
- }
- }
-
- /**
- * Tests the build process for a property when the definition map doesn't contains type attribute.
- *
- * <br>precondition: definition map doesn't contains type attribute.
- * <br>postcondition : an exception should be thrown indicating the failure. That exception must contain the name of the
- * missing attribute.
- */
- public void testPropertyBuilderKO_WithMissingType()
- {
- internalTestForMissingMandatoryAttribute(Attribute.type);
- }
-
- /**
- * Tests the build process for a property when the definition map doesn't contain type & name attributes.
- *
- * <br>precondition: definition map doesn't contain type & name attributes.
- * <br>postcondition : an exception should be thrown indicating the failure. That exception must contain the name of the
- * missing attributes.
- */
- public void testPropertyBuilderKO_WithMissingTypeAndName()
- {
- internalTestForMissingMandatoryAttribute(Attribute.type, Attribute.name);
- }
-
- /**
- * Tests the build process for a property when the definition map doesn't contain type & name & index attributes.
- *
- * <br>precondition: definition map doesn't contain type & name & index attributes.
- * <br>postcondition : an exception should be thrown indicating the failure. That exception must contain the name of the
- * missing attributes.
- */
- public void testPropertyBuilderKO_WithMissingTypeAndNameAndIndex()
- {
- internalTestForMissingMandatoryAttribute(Attribute.type, Attribute.name,Attribute.index);
- }
-
- /**
- * Tests the build process for a property when the definition map doesn't contain type, name, index & optional attributes.
- *
- * <br>precondition: definition map doesn't contain type, name, index & optional attributes.
- * <br>postcondition : an exception should be thrown indicating the failure. That exception must contain the name of the
- * missing attributes.
- */
- public void testPropertyBuilderKO_WithMissingTypeAndNameAndIndexAndOptional()
- {
- internalTestForMissingMandatoryAttribute(Attribute.type, Attribute.name,Attribute.index,Attribute.optional);
- }
-
- /**
- * Tests the build process for a property when the definition map doesn't contain type, name, index, optional and access
- * attributes.
- *
- * <br>precondition: definition map doesn't contain type, name, index, optional and access attributes.
- * <br>postcondition : an exception should be thrown indicating the failure. That exception must contain the name of the
- * missing attributes.
- */
- public void testPropertyBuilderKO_WithMissingTypeAndNameAndIndexAndOptionalAndAccess()
- {
- internalTestForMissingMandatoryAttribute(Attribute.type, Attribute.name,Attribute.index,Attribute.optional,Attribute.access);
- }
-
- /**
- * Tests the build process for a property when the definition map doesn't unit attribute.
- * Note that this attribute is optional and therefore the build must succeed.
- *
- * <br>precondition: definition map doesn't contain unit attribute.
- * <br>postcondition : no exception is thrown and the property is built.
- */
- public void testBuilderOK_WithMissingUnit() throws UnableToBuildFeatureException
- {
- internalTestForMissingOptionalAttribute(Attribute.unit);
- }
-
- /**
- * Tests the build process for a property when the definition map doesn't min and max attributes.
- * Note that those attributes are optional and therefore the build must succeed.
- *
- * <br>precondition: definition map doesn't contain min and max attributes.
- * <br>postcondition : no exception is thrown and the property is built.
- */
- public void testBuilderOK_WithMissingMinAndMax() throws UnableToBuildFeatureException
- {
- internalTestForMissingOptionalAttribute(Attribute.min,Attribute.max);
- }
-
- /**
- * Tests the build process for a property when the definition map doesn't description attribute.
- * Note that this attribute is optional and therefore the build must succeed.
- *
- * <br>precondition: definition map doesn't contain description attribute.
- * <br>postcondition : no exception is thrown and the property is built.
- */
- public void testBuilderOK_WithMissingDescription() throws UnableToBuildFeatureException
- {
- internalTestForMissingOptionalAttribute(Attribute.desc);
- }
-
- /**
- * Tests the build process for a property when the definition map contains valid values.
- *
- * <br>precondition : the property definiton map contains valid values.
- * <br>postcondition : no exception is thrown and the property is built as expected.
- */
- public void testPropertyBuilderOK() throws UnableToBuildFeatureException
- {
- _builder.build();
-
- QpidProperty property = (QpidProperty) _builder.getQpidFeature();
- MBeanAttributeInfo info = (MBeanAttributeInfo) _builder.getManagementFeature();
-
- assertEquals(NAME,property.getName());
- assertEquals(AccessMode.RC,property.getAccessMode());
- assertEquals(UNIT,property.getUnit());
- assertEquals(MIN.intValue(),property.getMinValue());
- assertEquals(MAX.intValue(),property.getMaxValue());
- assertEquals(Integer.MIN_VALUE,property.getMaxLength());
- assertEquals(DESCRIPTION,property.getDescription());
- assertEquals(Short.class,property.getJavaType());
- assertFalse(property.isOptional());
-
- assertEquals(property.getDescription(),info.getDescription());
- assertEquals(property.getName(),info.getName());
- assertEquals(property.getJavaType().getName(),info.getType());
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidStatisticBuilderTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidStatisticBuilderTest.java
deleted file mode 100644
index b7a8540b2d..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidStatisticBuilderTest.java
+++ /dev/null
@@ -1,159 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.type;
-import static org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute.unit;
-
-import javax.management.MBeanAttributeInfo;
-
-import org.apache.qpid.management.configuration.UnknownTypeCodeException;
-import org.apache.qpid.management.domain.model.QpidFeatureBuilder.Attribute;
-
-/**
- * Test case for Qpid Statistic builder.
- *
- * @author Andrea Gazzarini
- */
-public class QpidStatisticBuilderTest extends BaseQpidFeatureBuilderTestCase
-{
- private final static String UNIT = "bytes";
-
- @Override
- protected void setUp () throws Exception
- {
- super.setUp();
- _featureDefinition.put(unit.name(),UNIT);
- _featureDefinition.put(type.name(), 1);
-
- _builder = QpidFeatureBuilder.createStatisticBuilder(_featureDefinition);
- }
-
- /**
- * Tests the build process for a statistic when the definition map contains an unknown type code.
- *
- * <br>precondition : the statistic definiton map contains an unknown type code.
- * <br>postcondition : an exception is thrown indicating the failure.
- */
- public void testStatisticBuilderKO_WithUnknownType()
- {
- int unknownTypeCode = 999;
- try
- {
- _featureDefinition.put(type.name(), unknownTypeCode);
- _builder.build();
- fail("An unknown type code should raise an exception to indicate a failure.");
- } catch (UnableToBuildFeatureException expected)
- {
- assertEquals(unknownTypeCode,((UnknownTypeCodeException)expected.getCause()).getCode());
- }
- }
-
- /**
- * Tests the build process for a statistic when the definition map contains a null value for a metadata attribute.
- *
- * <br>precondition : the statistic definiton map contains a null value for a metadata attribute.
- * <br>postcondition : an exception is thrown indicating the failure.
- */
- public void testMethodBuilderKO_WithNullMetadataValue()
- {
- try
- {
- _featureDefinition.put(type.name(), null);
- _builder.build();
- fail("An null value for a metadata attribute should raise an exception to indicate a failure.");
- } catch (UnableToBuildFeatureException expected)
- {
- assertTrue(expected.getCause() instanceof NullPointerException);
- }
- }
-
- /**
- * Tests the build process for a statistic when the definition map doesn't contains type attribute.
- *
- * <br>precondition: definition map doesn't contains type attribute.
- * <br>postcondition : an exception should be thrown indicating the failure. That exception must contain the name of the
- * missing attribute.
- */
- public void testStatisticBuilderKO_WithMissingType()
- {
- internalTestForMissingMandatoryAttribute(Attribute.type);
- }
-
- /**
- * Tests the build process for a statistic when the definition map doesn't contain type & name attributes.
- *
- * <br>precondition: definition map doesn't contain type & name attributes.
- * <br>postcondition : an exception should be thrown indicating the failure. That exception must contain the name of the
- * missing attributes.
- */
- public void testStatisticBuilderKO_WithMissingTypeAndName()
- {
- internalTestForMissingMandatoryAttribute(Attribute.type, Attribute.name);
- }
-
- /**
- * Tests the build process for a statistic when the definition map doesn't contain type, name, index & optional attributes.
- *
- * <br>precondition: definition map doesn't contain type, name, index & optional attributes.
- * <br>postcondition : an exception should be thrown indicating the failure. That exception must contain the name of the
- * missing attributes.
- */
- public void testStatisticBuilderOK_WithMissingUnit() throws UnableToBuildFeatureException
- {
- internalTestForMissingOptionalAttribute(Attribute.unit);
- }
-
- /**
- * Tests the build process for a statistic when the definition map doesn't unit attribute.
- * Note that this attribute is optional and therefore the build must succeed.
- *
- * <br>precondition: definition map doesn't contain unit attribute.
- * <br>postcondition : no exception is thrown and the statistic is built.
- */
- public void testBuilderOK_WithMissingDescription() throws UnableToBuildFeatureException
- {
- internalTestForMissingOptionalAttribute(Attribute.desc);
- }
-
- /**
- * Tests the build process for a statistic when the definition map contains valid values.
- *
- * <br>precondition : the statistic definiton map contains valid values.
- * <br>postcondition : no exception is thrown and the statistisc is built as expected.
- */
- public void testStatisticBuilderOK() throws UnableToBuildFeatureException
- {
- _builder.build();
-
- QpidStatistic statistic= (QpidStatistic) _builder.getQpidFeature();
- MBeanAttributeInfo info = (MBeanAttributeInfo) _builder.getManagementFeature();
-
- assertEquals(NAME,statistic.getName());
- assertEquals(UNIT,statistic.getUnit());
- assertEquals(DESCRIPTION,statistic.getDescription());
- assertEquals(Short.class,statistic.getJavaType());
-
- assertEquals(statistic.getDescription(),info.getDescription());
- assertEquals(statistic.getName(),info.getName());
- assertEquals(statistic.getJavaType().getName(),info.getType());
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidStringPropertyTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidStringPropertyTest.java
deleted file mode 100644
index 8aeb7c8550..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/QpidStringPropertyTest.java
+++ /dev/null
@@ -1,127 +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.
- *
- */
-package org.apache.qpid.management.domain.model;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.management.configuration.Configurator;
-import org.apache.qpid.management.domain.model.type.Str16;
-
-public class QpidStringPropertyTest extends TestCase
-{
- private QpidProperty _property;
- private final String _5LettersString = "12345";
-
- @Override
- protected void setUp () throws Exception
- {
- Configurator configurator = new Configurator();
- configurator.configure();
- _property = new QpidProperty();
- _property.setName("name");
- _property.setAccessMode(AccessMode.RW);
- _property.setType(new Str16());
- }
-
- /**
- * Tests the validation of a qpid property when the type is a string and a max length constraint hasn't been set.
- *
- * <br>precondition : property type is a string, max length hasn't been set.
- * <br>postcondition : no exception is thrown. That is : the validation succeeds.
- */
- public void testValidationWithoutMaxLength() {
- try
- {
- _property.validate(_5LettersString);
- } catch (ValidationException notExpected)
- {
- fail("No max length has been set on property so validation must succeed.");
- }
- }
-
- /**
- * Tests the validation of a qpid property when the type is a string and a max length constraint has been set.
- *
- * <br>precondition : property type is a string, max length has been set and property value is longer than max length.
- * <br>postcondition : an exception is thrown indicating the validation failure.
- */
- public void testValidationKO_withMaxLength() {
- int maxLength = 2;
- _property.setMaxLength(maxLength);
-
- try
- {
- _property.validate(_5LettersString);
- fail("No max length has been set on property so validation must proceed.");
- } catch (ValidationException expected)
- {
- assertEquals(ValidationException.MAX_LENGTH,expected.getConstraintName());
- assertEquals(maxLength,expected.getConstraintValue());
- assertEquals(_5LettersString.length(),expected.getFeatureValue());
- assertEquals(_property.getName(),expected.getFeatureName());
- }
- }
-
- /**
- * Tests the validation of a qpid property when the type is a string and the property value is null.
- *
- * <br>precondition : property type is a string and property value is null..
- * <br>postcondition : no exception is thrown. That is : the validation succeeds.
- */
- public void testValidationOK_withNullValue() {
- try
- {
- _property.validate(null);
- } catch (ValidationException notExpected)
- {
- fail("No constraint has been violated so validate() shouldn't raise an exception.");
- }
-
- _property.setMaxLength(1);
-
- try
- {
- _property.validate(null);
- } catch (ValidationException notExpected)
- {
- fail("No constraint has been violated so validate() shouldn't raise an exception.");
- }
- }
-
- /**
- * Tests the validation of a qpid property when the type is a string and a max length constraint has been set.
- *
- * <br>precondition : property type is a string, max length has been set and property value is not violating that.
- * <br>postcondition : no exception is thrown. That is : the validation succeeds.
- */
- public void testValidationOK_withMaxLength() {
- int maxLength = (_5LettersString.length()+1);
- _property.setMaxLength(maxLength);
-
- try
- {
- _property.validate(_5LettersString);
- } catch (ValidationException notExpected)
- {
- fail("No constraint has been violated so validate() shouldn't raise an exception.");
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/type/BinaryTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/type/BinaryTest.java
deleted file mode 100644
index 6636c08710..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/model/type/BinaryTest.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-package org.apache.qpid.management.domain.model.type;
-
-import junit.framework.TestCase;
-
-/**
- * Test case for "Binary" type.
- *
- * @author Andrea Gazzarini
- */
-public class BinaryTest extends TestCase
-{
- /**
- * Tests the lazy & once hash code computation behaviour of the binary type.
- */
- public void testHashCodeComputation(){
- Binary binary = new Binary(new byte[]{1,2,3,4,5,6,7,6,3,3});
- assertSame(binary.state,binary.hashCodeNotYetComputed);
-
- int firstResult = binary.hashCode();
- assertSame(binary.state,binary.hashCodeAlreadyComputed);
-
- int secondResult = binary.hashCode();
- assertSame(binary.state,binary.hashCodeAlreadyComputed);
- assertEquals(firstResult,secondResult);
- }
-
- /**
- * Tests the equals() method of the binary class.
- * Two binary must be equals only if they contain the same array (that is, two arrays with the same size & content)
- */
- public void testIdentity() {
- Binary binary = new Binary(new byte[]{1,2,3,4,5,6,7,6,3,3});
- Binary theSame= new Binary(new byte[]{1,2,3,4,5,6,7,6,3,3});
- Binary aDifferentOne = new Binary(new byte[]{4,2,3,3,4,4,5,3,3,2});
-
- assertTrue(binary.equals(theSame));
- assertFalse(binary.equals(aDifferentOne));
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/services/BrokerMessageListenerTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/services/BrokerMessageListenerTest.java
deleted file mode 100644
index 805c039a6f..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/services/BrokerMessageListenerTest.java
+++ /dev/null
@@ -1,241 +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.
- *
- */
-package org.apache.qpid.management.domain.services;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Random;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.api.Message;
-import org.apache.qpid.management.TestConstants;
-import org.apache.qpid.management.domain.handler.base.IMessageHandler;
-import org.apache.qpid.management.domain.model.DomainModel;
-import org.apache.qpid.nclient.util.ByteBufferMessage;
-import org.apache.qpid.transport.codec.Decoder;
-
-/**
- * Test case for Broker Message Listener.
- *
- * @author Andrea Gazzarini
- */
-public class BrokerMessageListenerTest extends TestCase
-{
- // An empty message handler user for test.
- private IMessageHandler _emptyMessageHandler = new IMessageHandler()
- {
- public void process (Decoder decoder, int sequenceNumber)
- {
- }
- public void setDomainModel (DomainModel domainModel)
- {
- }
- };
-
- // Another empty message handler user for test.
- private IMessageHandler _anotherEmptyMessageHandler = new IMessageHandler()
- {
- public void process (Decoder decoder, int sequenceNumber)
- {
- }
- public void setDomainModel (DomainModel domainModel)
- {
- }
- };
-
- private Map<Character,IMessageHandler> _handlers = new HashMap<Character, IMessageHandler>();
- private BrokerMessageListener _listener;
- private final char opcode1 = 'x';
- private final char opcode2 = 'y';
-
-
- @Override
- protected void setUp () throws Exception
- {
- DomainModel domainModel = new DomainModel(TestConstants.BROKER_ID);
- _listener = new BrokerMessageListener(domainModel);
-
- _handlers.put(opcode1, _emptyMessageHandler);
- _handlers.put(opcode2, _anotherEmptyMessageHandler);
- }
-
- /**
- * Tests the installation of message handlers on a broker message listener.
- *
- * <br>precondition : no message handler has been installed on message listener.
- * <br>postcondition : two message handlers are installed on message listener.
- */
- public void testSetHandlersOK()
- {
- assertTrue(
- "No handler has yet been installed so how is it possible that the handlers map is not empty?",
- _listener._handlers.isEmpty());
-
- _listener.setHandlers(_handlers);
-
- assertEquals("Now we should have two handlers configured.",2,_listener._handlers.size());
- assertSame(_listener._handlers.get(opcode1),_emptyMessageHandler);
- assertSame(_listener._handlers.get(opcode2),_anotherEmptyMessageHandler);
- }
-
- /**
- * Tests the installation of message handlers on a broker message listener.
- * Specifically it tries to install three message handlers and one of them is throwing an exception at installation time.
- *
- * <br>precondition : no message handler has been installed on message listener.
- * <br>postcondition : two message handlers are installed on message listener. (the one that thrown exception has been
- * discarded).
- */
- public void testSetHandlerOK()
- {
- IMessageHandler wrongMessageHandler = new IMessageHandler()
- {
-
- public void process (Decoder decoder, int sequenceNumber)
- {
- }
-
- public void setDomainModel (DomainModel domainModel)
- {
- throw new RuntimeException();
- }
- };
-
- char opcodeForWrongHandler = 'k';
-
- assertTrue(
- "No handler has yet been installed so how is it possible that the handlers map is not empty?",
- _listener._handlers.isEmpty());
-
- _handlers.put(opcodeForWrongHandler,wrongMessageHandler);
-
- _listener.setHandlers(_handlers);
-
- assertEquals("Now we should have two handlers configured.",2,_listener._handlers.size());
- assertSame(_listener._handlers.get(opcode1),_emptyMessageHandler);
- assertSame(_listener._handlers.get(opcode2),_anotherEmptyMessageHandler);
- assertNull(_listener._handlers.get(opcodeForWrongHandler));
- }
-
- /**
- * Tests the execution of the onMessage() method when a message with a bad magic number is received.
- *
- * <br>precondition : a message with a bad magic number is received.
- * <br>postcondition : the processing of the incoming message is skipped and therefore no handler will be called.
- */
- public void testOnMessageKO_withBadMagicNumber() throws IOException
- {
- IMessageHandler neverCallMe = new IMessageHandler()
- {
-
- public void process (Decoder decoder, int sequenceNumber)
- {
- fail("This test shouldn't never arrive at this point...");
- }
-
- public void setDomainModel (DomainModel domainModel)
- {
- }
- };
-
- String opcodeForNeverCallMeHandler = "w";
-
- _handlers.put('w',neverCallMe);
- _listener.setHandlers(_handlers);
-
- Message message = new ByteBufferMessage();
- message.appendData( ("AMG"+opcodeForNeverCallMeHandler).getBytes());
-
- _listener.onMessage(message);
- }
-
- /**
- * Tests the execution of the onMessage() method when the incoming message is a compound message.
- *
- * <br>precondition : the incoming message is a compound message.
- * <br>postcondition : each tokenized message is forwarded to the appropriate handler.
- */
- public void testOnMessageOK_WithCompoundMessage() throws Exception
- {
- final Map<Character,IMessageHandler> handlersMap = new HashMap<Character,IMessageHandler>();
- char [] opcodes = {'a','b','c','d','e'};
-
- class MockMessageHandler implements IMessageHandler
- {
- private final char _opcode;
-
- public MockMessageHandler(char opcode)
- {
- this._opcode = opcode;
- }
-
- public void process (Decoder decoder, int sequenceNumber)
- {
- handlersMap.remove(_opcode);
- }
-
- public void setDomainModel (DomainModel domainModel)
- {
- // Do nothing here. It's just a mock handler.
- }
- };
-
- for (char opcode : opcodes)
- {
- handlersMap.put(opcode, new MockMessageHandler(opcode));
- }
-
- // Removes previously injected handlers (i.e. x & y)
- _listener._handlers.clear();
- _listener.setHandlers(handlersMap);
-
- Message compoundMessage = createCompoundMessage(opcodes);
- _listener.onMessage(compoundMessage);
-
- assertTrue(handlersMap.isEmpty());
- }
-
- // Creates a (non valid) compound message.
- private Message createCompoundMessage(char[] opcodes) throws IOException {
- byte [] compoundMessageData = new byte [12 * opcodes.length];
- Random randomizer = new Random();
- int position = 0;
-
- for (char opcode : opcodes) {
- System.arraycopy(MessageTokenizer.MAGIC_NUMBER_BYTES, 0, compoundMessageData, position, MessageTokenizer.MAGIC_NUMBER_BYTES.length);
- position+=MessageTokenizer.MAGIC_NUMBER_BYTES.length;
-
- compoundMessageData[position++] = (byte)opcode;
-
- for (int c = 4; c < 12; c++)
- {
- byte aByte = (byte)randomizer.nextInt(127);
- compoundMessageData[position++] = aByte;
- }
- }
-
- Message compoundMessage = new ByteBufferMessage();
- compoundMessage.appendData(compoundMessageData);
- return compoundMessage;
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/services/MessageTokenizerTest.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/services/MessageTokenizerTest.java
deleted file mode 100644
index 55b8b17f9d..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/domain/services/MessageTokenizerTest.java
+++ /dev/null
@@ -1,140 +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.
- *
- */
-
-package org.apache.qpid.management.domain.services;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.*;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.api.Message;
-import org.apache.qpid.nclient.util.ByteBufferMessage;
-import org.apache.qpid.transport.codec.BBDecoder;
-
-/**
- * Tests case for messaeg tokenizer.
- *
- * @author Andrea Gazzarini
- */
-public class MessageTokenizerTest extends TestCase {
-
- /**
- * Tests the execution of the message tokenizer when the given message is not a valid AMQP message.
- *
- * <br>precondition : the incoming message is not a valid AMQP message.
- * <br>postcondition : no exception is thrown and there will be exactly one token with the given message.
- */
- public void testOK_WithNoMessage() throws IOException{
- byte [] noMessage = {2,10,120,23,23,23,4,10,11,12,2,1,3,-22};
-
- Message multiMessage = new ByteBufferMessage();
- multiMessage.appendData(noMessage);
- MessageTokenizer tokenizer = new MessageTokenizer(multiMessage);
-
- assertEquals(1, tokenizer.countTokens());
- assertEquals(tokenizer.nextElement(),noMessage);
- assertFalse(tokenizer.hasMoreElements());
- }
-
- /**
- * Tests the execution of the message tokenizer when the given message contains only one message.
- *
- * <br>precondition : the incoming message contains only one message.
- * <br>postcondition : no exception is thrown and there will be exactly one token with the given message.
- */
- public void testOK_WithOneMessage() throws IOException{
- byte [] oneEncodedMessage = {'A','M','2',23,23,23,4,10,11,12,2,1,3,-22};
-
- Message multiMessage = new ByteBufferMessage();
- multiMessage.appendData(oneEncodedMessage);
- MessageTokenizer tokenizer = new MessageTokenizer(multiMessage);
-
- assertEquals(1, tokenizer.countTokens());
- assertEquals(tokenizer.nextElement(),oneEncodedMessage);
- assertFalse(tokenizer.hasMoreElements());
- }
-
- /**
- * Tests the execution of the message tokenizer when the given message contains a random number of messages.
- *
- * <br>precondition : the incoming message contains a random number of messages.
- * <br>postcondition : no exception is thrown and each built token is a valid message starting with right header.
- */
- public void testOK_WithRandomNUmberOfMessages() throws IOException{
- Random randomizer = new Random();
-
- int howManyLoops = randomizer.nextInt(10000);
- howManyLoops = (howManyLoops == 0) ? 10 : howManyLoops;
- byte [] compoundMessageData = new byte [12 * howManyLoops];
-
- List<byte []> messages = new ArrayList<byte[]>(howManyLoops);
-
- int position = 0;
- for (int i = 0; i < howManyLoops; i++)
- {
- byte [] message = new byte[12];
- System.arraycopy(MessageTokenizer.MAGIC_NUMBER_BYTES, 0, compoundMessageData, position, MessageTokenizer.MAGIC_NUMBER_BYTES.length);
- System.arraycopy(MessageTokenizer.MAGIC_NUMBER_BYTES, 0, message, 0, MessageTokenizer.MAGIC_NUMBER_BYTES.length);
- position+=MessageTokenizer.MAGIC_NUMBER_BYTES.length;
-
- for (int c = 3; c < 12; c++)
- {
- byte aByte = (byte)randomizer.nextInt(127);
- aByte = (aByte == 77) ? (byte)c : aByte;
- compoundMessageData[position++] = aByte;
- message[c] = aByte;
- }
- messages.add(message);
- }
-
- Message multiMessage = new ByteBufferMessage();
- multiMessage.appendData(compoundMessageData);
- MessageTokenizer tokenizer = new MessageTokenizer(multiMessage);
-
- int howManyTokens = tokenizer.countTokens();
- assertEquals(howManyLoops, howManyTokens);
-
- int index = 0;
- while (tokenizer.hasMoreElements())
- {
- assertEquals(tokenizer.nextElement(),messages.get(index++));
- }
-
- assertEquals((index),howManyTokens);
- }
-
- /**
- * Internal method used for comparison of two messages.
- *
- * @param message the token message just built by the tokenizer.
- * @param expected the expected result.
- */
- private void assertEquals(Message message, byte [] expected) throws IOException
- {
- ByteBuffer messageContent = message.readData();
- BBDecoder decoder = new BBDecoder();
- decoder.init(messageContent);
- byte [] content = decoder.readReaminingBytes();
- assertTrue(Arrays.equals(content, expected));
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/online/BaseOnlineTestCase.java b/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/online/BaseOnlineTestCase.java
deleted file mode 100644
index 82a7a1698c..0000000000
--- a/M4-RCs/qpid/java/management/client/src/test/java/org/apache/qpid/management/online/BaseOnlineTestCase.java
+++ /dev/null
@@ -1,58 +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.
- *
- */
-package org.apache.qpid.management.online;
-
-import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-
-import junit.framework.TestCase;
-
-/**
- * Layer supertype for all online QMan test cases.
- * Note that QMan must be running and up in order to run concrete subclasses (test cases).
- *
- * @author AGazzarini
- */
-public abstract class BaseOnlineTestCase extends TestCase
-{
- protected MBeanServerConnection connection;
-
- /**
- * Setup fixture for this test case.
- * Basically it estabilishes a connection to QMan using RMI JMX connector.
- */
- @Override
- protected void setUp ()
- {
- try
- {
- JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi");
- JMXConnector jmxc = JMXConnectorFactory.connect(url);
- connection = jmxc.getMBeanServerConnection();
- } catch(Exception exception)
- {
- fail("QMan must be running and up in order to run this test!");
- exception.printStackTrace();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/client/web.xml b/M4-RCs/qpid/java/management/client/web.xml
deleted file mode 100644
index 71ca74b2e5..0000000000
--- a/M4-RCs/qpid/java/management/client/web.xml
+++ /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.
- -
- -->
-
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- <display-name>QManEE</display-name>
- <description>Web Application used for integrating QMan onto an Application Server.</description>
- <servlet>
- <display-name>QMan Servlet (Initializer)</display-name>
- <servlet-name>QManServlet</servlet-name>
- <servlet-class>org.apache.qpid.management.servlet.QManServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
-</web-app>
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/META-INF/MANIFEST.MF b/M4-RCs/qpid/java/management/eclipse-plugin/META-INF/MANIFEST.MF
deleted file mode 100644
index 15fcd8d59a..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,21 +0,0 @@
-Manifest-Version: 1.0
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
-Bundle-ManifestVersion: 2
-Bundle-Name: Qpid Management Console Plug-in
-Bundle-SymbolicName: org.apache.qpid.management.ui; singleton:=true
-Bundle-Version: 0.1.0
-Bundle-Activator: org.apache.qpid.management.ui.Activator
-Bundle-Vendor: Apache Software Foundation
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.ui.forms,
- jmxremote.sasl;resolution:=optional
-Eclipse-LazyStart: true
-Export-Package: org.apache.qpid.management.ui,
- org.apache.qpid.management.ui.actions,
- org.apache.qpid.management.ui.exceptions,
- org.apache.qpid.management.ui.jmx,
- org.apache.qpid.management.ui.model,
- org.apache.qpid.management.ui.sasl,
- org.apache.qpid.management.ui.views
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/README.txt b/M4-RCs/qpid/java/management/eclipse-plugin/README.txt
deleted file mode 100644
index 5325bf27ec..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/README.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-
-Running the Qpid Management Console (eclipse-plugin)
-----------------------------------------------------
-
-To run the management console, set the QPIDMC_HOME environment variable to
-qpid management console root directory (e.g. C:/qpidmc)and add $QPIDMC_HOME/bin to your PATH.
-Then run the script to launch the management console-
-For Windows:
-------------
-qpidmc.bat
-qpidmc.sh (using cygwin)
-
-Unix:
------
-qpidmc.sh <operating system> <windowing system> <platform achitecture>
-eg. qpidms.sh linux motif x86
-qpidmc_motif.sh
-qpidmc_gtk.sh
-
-Apache confluence page for latest information:
-http://cwiki.apache.org/confluence/display/qpid/Qpid+Management+Console
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc.bat b/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc.bat
deleted file mode 100644
index 22a8a4d78c..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc.bat
+++ /dev/null
@@ -1,55 +0,0 @@
-@REM
-@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.
-@REM
-
-@echo off
-REM Script to run the Qpid Management Console
-
-rem Guess QPIDMC_HOME if not defined
-set CURRENT_DIR=%cd%
-if not "%QPIDMC_HOME%" == "" goto gotHome
-set QPIDMC_HOME=%CURRENT_DIR%
-echo %QPIDMC_HOME%
-if exist "%QPIDMC_HOME%\bin\qpidmc.bat" goto okHome
-cd ..
-set QPIDMC_HOME=%cd%
-cd %CURRENT_DIR%
-:gotHome
-if exist "%QPIDMC_HOME%\bin\qpidmc.bat" goto okHome
-echo The QPIDMC_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-:okHome
-
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto exit
-:gotJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program.
-goto exit
-:okJavaHome
-
-rem Slurp the command line arguments. This loop allows for an unlimited number
-rem of agruments (up to the command line limit, anyway).
-
-"%JAVA_HOME%\bin\java" -Xms40m -Xmx256m -Declipse.consoleLog=false -jar "%QPIDMC_HOME%\eclipse\startup.jar" org.eclipse.core.launcher.Main -launcher "%QPIDMC_HOME%\eclipse\eclipse" -name "Qpid Management Console" -showsplash 600 -configuration "file:%QPIDMC_HOME%\configuration" -os win32 -ws win32 -arch x86
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc.sh b/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc.sh
deleted file mode 100755
index 599d9bf7e0..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-if [ -z "$JAVA" ]; then
- JAVA=java
-fi
-
-if [ -z "$QPIDMC_HOME" ]; then
- export QPIDMC_HOME=$(dirname $(dirname $(readlink -f $0)))
- export PATH=${PATH}:${QPIDMC_HOME}/bin
-fi
-
-# Test if we're running on cygwin.
-cygwin=false
-if [[ "$(uname -a | fgrep Cygwin)" != "" ]]; then
- cygwin=true
-fi
-
-if $cygwin; then
- QPIDMC_HOME=$(cygpath -w $QPIDMC_HOME)
-fi
-
-
-## If this is to be run on different platform other than windows then following parameters should be passed
-## qpidmc.sh <windowing system>
-## eg. qpidmc.sh motif
-
-if [ $# -eq 1 ] ; then
- QPIDMC_WS=$1
-else
- # If the WS is not set via QPIDMC_WS then query uname for the WS
- if [ -z "$QPIDMC_WS" ] ; then
- echo "Usage qpidmc.sh <windowing system>
- echo "Alternatively set QPIDMC_WS to the windowing system you wish to use
- exit 1
- fi
-fi
-
-# If the OS is not set via QPIDMC_OS then query uname for the OS
-if [ -z "$QPIDMC_OS" ] ; then
- QPIDMC_OS=`uname | tr A-Z a-z`
-else
- # Force OS to be lower case
- QPIDMC_OS=`echo $QPIDMC_OS | tr A-Z a-z`
-fi
-
-# If the ARCH is not set via QPIDMC_ARCH then query uname for the arch,
-if [ -z "$QPIDMC_ARCH" ] ; then
- QPIDMC_ARCH=`uname -i`
-fi
-
-# Note that it sometimes returns i386 which needs to be changed to x86
-if [ "$QPIDMC_ARCH" == "i386" ] ; then
- QPIDMC_ARCH="x86"
-fi
-
-
-"$JAVA" -Xms40m -Xmx256m -Declipse.consoleLog=true -jar $QPIDMC_HOME/eclipse/startup.jar org.eclipse.core.launcher.Main -name "Qpid Management Console" -showsplash 600 -configuration "file:$QPIDMC_HOME/configuration" -os $QPIDMC_OS -ws $QPIDMC_WS -arch $QPIDMC_ARCH
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh b/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh
deleted file mode 100755
index 1d55743d84..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc_gtk.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-if [ -z "$QPIDMC_HOME" ]; then
- export QPIDMC_HOME=$(dirname $(dirname $(readlink -f $0)))
- export PATH=${PATH}:${QPIDMC_HOME}/bin
-fi
-
-$QPIDMC_HOME/bin/qpidmc.sh gtk
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh b/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh
deleted file mode 100755
index f49759cc91..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/bin/qpidmc_motif.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-$QPIDMC_HOME/bin/qpidmc.sh motif
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/build-release-common.properties b/M4-RCs/qpid/java/management/eclipse-plugin/build-release-common.properties
deleted file mode 100644
index 65ef9be092..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/build-release-common.properties
+++ /dev/null
@@ -1,38 +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.
-#
-#
-
-artifactId=org.apache.qpid.management.ui
-mcplugin.version=0.1.0-${project.version}
-mcplugin.filename=${artifactId}_${mcplugin.version}
-
-mcplugin.contents.dir=${module.classes}
-
-mcplugin.manifest=${module.manifest}
-
-bin.dir=bin
-
-startup.jar=src/main/resources/startup.jar
-
-eclipse.ini=src/main/resources/eclipse.ini
-
-license.eclipse.txt=src/main/resources/license.eclipse.txt
-
-jmxremote.sasl.manifest=src/main/resources/sasl/MANIFEST.MF
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/build-release-linux-gtk-x86.properties b/M4-RCs/qpid/java/management/eclipse-plugin/build-release-linux-gtk-x86.properties
deleted file mode 100644
index 5aef021763..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/build-release-linux-gtk-x86.properties
+++ /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.
-#
-#
-
-release.name=${module.namever}-linux-gtk-x86
-
-release.subdir=${module.release.base}/${release.name}
-
-release.tar.gz=${module.release.base}/${release.name}.tar.gz
-
-eclipse.ini=src/main/resources/unix/eclipse.ini
-
-rcp.libs=${management-eclipse-plugin-linux-gtk-x86.libs}
-
-rcp.configuration.dir=src/main/resources/unix/configuration
-
-bin.includes=qpidmc.sh qpidmc_gtk.sh
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/build-release-macosx.properties b/M4-RCs/qpid/java/management/eclipse-plugin/build-release-macosx.properties
deleted file mode 100644
index cdeef836ed..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/build-release-macosx.properties
+++ /dev/null
@@ -1,40 +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.
-#
-#
-
-application.name=Qpid Management Console
-
-application.dir=${application.name}.app
-
-release.name=${module.namever}-macosx
-
-release.subdir=${module.release.base}/${release.name}
-
-release.zip=${module.release.base}/${release.name}.zip
-
-rcp.libs=${management-eclipse-plugin-macosx.libs}
-
-rcp.configuration.dir=src/main/resources/macosx/Configuration
-
-eclipse.ini=src/main/resources/macosx/eclipse.ini
-bin.includes=src/main/resources/macosx/eclipse
-
-eclipse.icns=src/main/resources/icons/Console.icns
-macosx.plist=src/main/resources/macosx/Info.plist
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/build-release-macosx.xml b/M4-RCs/qpid/java/management/eclipse-plugin/build-release-macosx.xml
deleted file mode 100644
index 4a51ab5727..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/build-release-macosx.xml
+++ /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.
- -
- -->
-<project name="Eclipse Plugin Binary Release" default="release-bin">
-
- <import file="build-release.xml"/>
-
- <property name="release.app" value="${release.subdir}/${application.dir}"/>
-
- <target name="release-bin-mcplugin-jar">
- <jar destfile="${release.app}/plugins/${mcplugin.filename}.jar" basedir="${mcplugin.contents.dir}" manifest="${mcplugin.manifest}"/>
- </target>
-
- <target name="release-bin-jmxremote-plugin">
- <!-- Copy the jmxremote.sasl plugin's manifest, creating its plugin directory -->
- <copy todir="${release.app}/plugins/jmxremote.sasl_1.0.1/META-INF" flatten="true" failonerror="true">
- <fileset file="${jmxremote.sasl.manifest}"/>
- </copy>
- </target>
-
-
- <target name="release-bin-rcp-deps" description="copy eclipse-rcp dependencies into module release"
- depends="copy-executable">
-
- <!-- Copy remaining Eclipse binary and start-up files -->
- <copy todir="${release.app}/Contents/MacOS" flatten="true" failonerror="true">
- <fileset file="${eclipse.ini}"/>
- <fileset file="${bin.includes}"/>
- </copy>
-
- <chmod dir="${release.app}/Contents/MacOS" perm="u+rx" includes="**/*"/>
-
- <!-- Copy MacOS plist file -->
- <copy todir="${release.app}/Contents" flatten="true" failonerror="true">
- <fileset file="${macosx.plist}"/>
- </copy>
-
- <!-- Copy remaining Eclipse binary and start-up files -->
- <copy todir="${release.app}/Contents/Resources" flatten="true" failonerror="true">
- <fileset file="${eclipse.icns}"/>
- </copy>
-
- <!-- Copy License file -->
- <copy todir="${release.app}" flatten="true" failonerror="true">
- <fileset file="${license.eclipse.txt}"/>
- </copy>
-
- <!-- Copy the eclipse rcp module libs -->
- <copy todir="${release.app}/plugins" failonerror="true">
- <fileset dir="${project.root}" includes="${rcp.libs}"/>
- <globmapper from="lib/*" to="*"/>
- </copy>
-
- <!-- Copy the relevant configuration dir -->
- <copy todir="${release.app}/Configuration" failonerror="true">
- <fileset dir="${rcp.configuration.dir}"/>
- </copy>
- <chmod dir="${release.app}/Configuration" perm="ugo+r" includes="**/*"/>
- </target>
-
- <target name="release-bin-zip" if="release.zip" description="build mc zip archive">
-
- <zip destfile="${release.zip}">
- <zipfileset dir="${release.subdir}" filemode="755">
- <include name="${application.dir}/Contents/MacOS/**"/>
- </zipfileset>
-
- <zipfileset dir="${release.subdir}" filemode="644" dirmode="755">
- <exclude name="${application.dir}/Contents/MacOS/**"/>
- </zipfileset>
- </zip>
- </target>
-
-</project>
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/build-release-win32-win32-x86.properties b/M4-RCs/qpid/java/management/eclipse-plugin/build-release-win32-win32-x86.properties
deleted file mode 100644
index 1f28ccb99f..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/build-release-win32-win32-x86.properties
+++ /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.
-#
-#
-
-release.name=${module.namever}-win32-win32-x86
-
-release.subdir=${module.release.base}/${release.name}
-
-release.zip=${module.release.base}/${release.name}.zip
-
-eclipse.executable=src/main/resources/eclipse.exe
-
-rcp.libs=${management-eclipse-plugin-win32-win32-x86.libs}
-
-rcp.configuration.dir=src/main/resources/win32/configuration
-
-bin.includes=qpidmc.bat
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/build-release.xml b/M4-RCs/qpid/java/management/eclipse-plugin/build-release.xml
deleted file mode 100644
index b116fcb55c..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/build-release.xml
+++ /dev/null
@@ -1,152 +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.
- -
- -->
-<project name="Eclipse Plugin Binary Release" default="release-bin">
-
- <!-- check properties that must be set by caller -->
- <target name="check" description="ensure all required properties are set">
- <condition property="properties.set">
- <and>
- <!-- common properties -->
- <isset property ="mcplugin.contents.dir"/>
- <isset property ="mcplugin.manifest"/>
- <isset property ="mcplugin.filename"/>
- <isset property ="bin.dir"/>
- <isset property ="startup.jar"/>
- <isset property ="eclipse.ini"/>
- <isset property ="license.eclipse.txt"/>
- <isset property ="jmxremote.sasl.manifest"/>
- <!-- platform specific properties -->
- <isset property ="bin.includes"/>
- <isset property ="release.name"/>
- <isset property ="release.subdir"/>
- <isset property ="rcp.libs"/>
- <isset property ="rcp.configuration.dir"/>
- <or>
- <isset property ="release.zip"/>
- <isset property ="release.tar.gz"/>
- </or>
- </and>
- <!-- Optional Properties -->
- <!-- eclipse.executable.companion.library -->
- </condition>
-
- <fail unless="properties.set" message="required properties not set"/>
- </target>
-
- <target name="release-bin-prepare">
- <mkdir dir="${release.subdir}"/>
- </target>
-
- <target name="release-bin-mcplugin-jar">
- <jar destfile="${release.subdir}/eclipse/plugins/${mcplugin.filename}.jar" basedir="${mcplugin.contents.dir}" manifest="${mcplugin.manifest}"/>
- </target>
-
- <target name="release-bin-jmxremote-plugin">
- <!-- Copy the jmxremote.sasl plugin's manifest, creating its plugin directory -->
- <copy todir="${release.subdir}/eclipse/plugins/jmxremote.sasl_1.0.1/META-INF" flatten="true" failonerror="true">
- <fileset file="${jmxremote.sasl.manifest}"/>
- </copy>
- </target>
-
- <target name="copy-executable" description="Copy eclipse-rcp execuitable" if="eclipse.executable">
-
- <!-- Copy the eclipse rcp executable files -->
- <copy todir="${release.subdir}/eclipse" flatten="true" failonerror="true">
- <fileset file="${eclipse.executable}"/>
- </copy>
- <chmod dir="${release.subdir}/eclipse" perm="u+rx" includes="**/*"/>
-
-
- </target>
-
- <target name="release-bin-rcp-deps" description="copy eclipse-rcp dependencies into module release"
- depends="copy-executable">
-
- <!-- Copy remaining startup & license files -->
- <copy todir="${release.subdir}/eclipse" flatten="true" failonerror="true">
- <fileset file="${startup.jar}"/>
- <fileset file="${eclipse.ini}"/>
- <fileset file="${license.eclipse.txt}"/>
- </copy>
-
- <echo message="${ecl-swt-linux-gtk-x86}"/>
- <echo message="${management-eclipse-plugin-linux-gtk-x86.libs}"/>
- <echo message="${rcp.libs}"/>
- <!-- Copy the eclipse rcp module libs -->
- <copy todir="${release.subdir}/eclipse/plugins" failonerror="true">
-
- <fileset dir="${project.root}" includes="${rcp.libs}"/>
- <globmapper from="lib/*" to="*"/>
- </copy>
-
- <!-- Copy the relevant bin dir files-->
- <copy todir="${release.subdir}/bin" failonerror="true">
- <fileset dir="${bin.dir}" includes="${bin.includes}"/>
- </copy>
- <chmod dir="${release.subdir}/bin" perm="u+rx" includes="**/*"/>
-
- <!-- Copy the relevant configuration dir -->
- <copy todir="${release.subdir}/configuration" failonerror="true">
- <fileset dir="${rcp.configuration.dir}"/>
- </copy>
- <chmod dir="${release.subdir}/configuration" perm="ugo+r" includes="**/*"/>
- </target>
-
- <target name="release-bin-zip" if="release.zip" description="build mc zip archive">
- <zip destfile="${release.zip}">
- <zipfileset dir="${release.subdir}" prefix="${release.name}" filemode="755">
- <include name="bin/*"/>
- </zipfileset>
-
- <zipfileset dir="${release.subdir}" prefix="${release.name}" filemode="755">
- <include name="eclipse/eclipse*"/>
- </zipfileset>
-
- <zipfileset dir="${release.subdir}" prefix="${release.name}" filemode="644" dirmode="755">
- <exclude name="bin/**"/>
- <exclude name="eclipse/eclipse*"/>
- </zipfileset>
- </zip>
- </target>
-
- <target name="release-bin-gzip" if="release.tar.gz" description="build mc tar.gz archive">
- <tar destfile="${release.tar.gz}" longfile="gnu">
- <tarfileset dir="${release.subdir}" prefix="${release.name}" filemode="755">
- <include name="bin/*"/>
- </tarfileset>
-
- <tarfileset dir="${release.subdir}" prefix="${release.name}" filemode="755">
- <include name="eclipse/eclipse*"/>
- </tarfileset>
-
- <tarfileset dir="${release.subdir}" prefix="${release.name}" filemode="644" dirmode="755">
- <exclude name="bin/**"/>
- <exclude name="eclipse/eclipse*"/>
- </tarfileset>
- </tar>
- </target>
-
-
-
- <target name="release-bin" depends="check,release-bin-prepare,release-bin-rcp-deps,
- release-bin-mcplugin-jar,release-bin-jmxremote-plugin,release-bin-zip,release-bin-gzip"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/build.xml b/M4-RCs/qpid/java/management/eclipse-plugin/build.xml
deleted file mode 100644
index 2c36e79823..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/build.xml
+++ /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.
- -
- -->
-<project name="Eclipse Plugin" default="build">
-
- <property name="module.depends" value="broker common"/>
-
- <import file="../../module.xml"/>
-
- <!-- module.manifest property to invoke use of 'jar.manifest' jar target when building -->
- <property name="module.manifest" value="${module.classes}/META-INF/MANIFEST.MF"/>
-
- <target name="copy-plugin-files" description="copy eclipse management plugin files into build tree">
- <copy todir="${module.classes}/icons" failonerror="true">
- <fileset dir="icons/"/>
- </copy>
- <copy todir="${module.classes}/META-INF/" failonerror="true">
- <fileset dir="META-INF/"/>
- </copy>
- <copy todir="${module.classes}" failonerror="true">
- <fileset file="icons/splash.bmp"/>
- </copy>
- <copy todir="${module.classes}" failonerror="true">
- <fileset file="plugin.properties"/>
- </copy>
- <copy todir="${module.classes}" failonerror="true">
- <fileset file="plugin.xml"/>
- </copy>
- </target>
-
- <target name="create-version" description="Create the version file">
-
- <exec executable="svnversion" spawn="false" failifexecutionfails="false"
- dir="." outputproperty="svnversion">
- <arg line="."/>
- </exec>
-
- <!-- Write the version.properties out. -->
- <propertyfile file="${module.classes}/qpidversion.properties">
- <entry key="qpid.version" value="${project.version}"/>
- <entry key="qpid.svnversion" value="${svnversion}"/>
- <entry key="qpid.name" value="${project.name}"/>
- </propertyfile>
-
- </target>
-
-
- <!-- Override imported module.xml build target, create module jar containing plugin files -->
- <target name="build" depends="prepare, compile, copy-plugin-files, create-version, jar, jar-tests"/>
-
- <!-- Override imported module.xml release-bin target -->
- <target name="release-bin" depends="build">
- <!-- linux gtk x86 -->
- <ant antfile="build-release.xml">
- <property file="build-release-linux-gtk-x86.properties"/>
- <property file="build-release-common.properties"/>
- </ant>
- <!-- mac os x -->
- <ant antfile="build-release-macosx.xml">
- <property file="build-release-macosx.properties"/>
- <property file="build-release-common.properties"/>
- </ant>
-
- <!-- win32 win32 x86 -->
- <ant antfile="build-release.xml">
- <property file="build-release-win32-win32-x86.properties"/>
- <property file="build-release-common.properties"/>
- </ant>
- </target>
-
-</project>
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/Thumbs.db b/M4-RCs/qpid/java/management/eclipse-plugin/icons/Thumbs.db
deleted file mode 100644
index 306bfb2eda..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/Thumbs.db
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/add.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/add.gif
deleted file mode 100644
index 252d7ebcb8..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/add.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/delete.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/delete.gif
deleted file mode 100644
index 6f647666d3..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/delete.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/icon_ClosedFolder.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/icon_ClosedFolder.gif
deleted file mode 100644
index beb6ed134c..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/icon_ClosedFolder.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/icon_OpenFolder.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/icon_OpenFolder.gif
deleted file mode 100644
index a9c777343c..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/icon_OpenFolder.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/mbean_view.png b/M4-RCs/qpid/java/management/eclipse-plugin/icons/mbean_view.png
deleted file mode 100644
index 9871b72bb8..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/mbean_view.png
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/notifications.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/notifications.gif
deleted file mode 100644
index f1e585bdf7..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/notifications.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidConnections.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidConnections.gif
deleted file mode 100644
index 89489f11f2..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidConnections.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc.gif
deleted file mode 100644
index baf929fbc5..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc16.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc16.gif
deleted file mode 100644
index 4df535bb9a..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc16.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc32.bmp b/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc32.bmp
deleted file mode 100644
index e42ce01dff..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc32.bmp
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc32.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc32.gif
deleted file mode 100644
index e42ce01dff..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/qpidmc32.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/reconnect.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/reconnect.gif
deleted file mode 100644
index e2f8c3e1fe..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/reconnect.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/refresh.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/refresh.gif
deleted file mode 100644
index a063c230ac..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/refresh.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/splash.bmp b/M4-RCs/qpid/java/management/eclipse-plugin/icons/splash.bmp
deleted file mode 100644
index b528a508c5..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/splash.bmp
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/icons/stop.gif b/M4-RCs/qpid/java/management/eclipse-plugin/icons/stop.gif
deleted file mode 100644
index dc47edf069..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/icons/stop.gif
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/plugin.properties b/M4-RCs/qpid/java/management/eclipse-plugin/plugin.properties
deleted file mode 100644
index 8507441886..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/plugin.properties
+++ /dev/null
@@ -1,20 +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.
-###############################################################################
-pluginName = Qpid Management Console Plug-in
-providerName = Apache Software Foundation \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/plugin.xml b/M4-RCs/qpid/java/management/eclipse-plugin/plugin.xml
deleted file mode 100644
index 5774859b47..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/plugin.xml
+++ /dev/null
@@ -1,223 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
- 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.
--->
-<plugin>
-
- <extension
- id="application"
- point="org.eclipse.core.runtime.applications">
- <application>
- <run
- class="org.apache.qpid.management.ui.Application">
- </run>
- </application>
- </extension>
- <extension
- point="org.eclipse.ui.perspectives">
- <perspective
- name="qpid.management.perspective"
- class="org.apache.qpid.management.ui.Perspective"
- id="org.apache.qpid.management.ui.perspective">
- </perspective>
- </extension>
- <extension
- point="org.eclipse.ui.views">
- <category
- id="org.apache.qpid.management.ui.viewcategory"
- name="Qpid Management Console"/>
- <view
- allowMultiple="false"
- category="org.apache.qpid.management.ui.viewcategory"
- class="org.apache.qpid.management.ui.views.NavigationView"
- icon="icons/qpidConnections.gif"
- id="org.apache.qpid.management.ui.navigationView"
- name="Qpid Connections">
- </view>
- <view
- allowMultiple="false"
- category="org.apache.qpid.management.ui.viewcategory"
- class="org.apache.qpid.management.ui.views.MBeanView"
- icon="icons/mbean_view.png"
- id="org.apache.qpid.management.ui.mbeanView"
- name="Qpid Management">
- </view>
- </extension>
- <extension
- point="org.eclipse.ui.commands">
- <category
- name="qpid.manager.commands"
- id="org.apache.qpid.management.ui.category">
- </category>
- <command
- name="New Connection"
- description="Created a new Qpid server connection"
- categoryId="org.apache.qpid.management.ui.category"
- id="org.apache.qpid.management.ui.actions.cmd_add">
- </command>
- <command
- categoryId="org.apache.qpid.management.ui.category"
- description="Reconnect the Qpid server connection"
- id="org.apache.qpid.management.ui.actions.cmd_reconnect"
- name="Reconnect"/>
- <command
- categoryId="org.apache.qpid.management.ui.category"
- description="Disconnects the Qpid server connection"
- id="org.apache.qpid.management.ui.actions.cmd_disconnect"
- name="Disconnect"/>
- <command
- categoryId="org.apache.qpid.management.ui.category"
- description="Removes the server from management console"
- id="org.apache.qpid.management.ui.actions.cmd_remove"
- name="Remove Connection"/>
- <command
- categoryId="org.apache.qpid.management.ui.category"
- description="refreshes the views"
- id="org.apache.qpid.management.ui.actions.cmd_refresh"
- name="Refresh"/>
- <command
- categoryId="org.apache.qpid.management.ui.category"
- description="pops up the window for editing selected attribute"
- id="org.apache.qpid.management.ui.actions.cmd_editAttribute"
- name="Edit Attribute"/>
- <command
- categoryId="org.apache.qpid.management.ui.category"
- description="About Qpid Management Console"
- id="qpidmc.about"
- name="About"/>
- </extension>
- <extension
- point="org.eclipse.ui.bindings">
- <key
- commandId="org.apache.qpid.management.ui.actions.cmd_add"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+Alt+N">
- </key>
- <key
- commandId="org.apache.qpid.management.ui.actions.cmd_reconnect"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+Alt+C"/>
- <key
- commandId="org.apache.qpid.management.ui.actions.cmd_disconnect"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+Alt+D">
- </key>
- <key
- commandId="org.apache.qpid.management.ui.actions.cmd_remove"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+Alt+R"/>
- <key
- commandId="org.apache.qpid.management.ui.actions.cmd_refresh"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+Alt+F5"/>
- <key
- commandId="org.apache.qpid.management.ui.actions.cmd_editAttribute"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+Alt+E"/>
- <key
- commandId="org.eclipse.ui.file.exit"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- sequence="CTRL+Alt+X">
- </key>
- </extension>
-
- <extension
- id="product"
- point="org.eclipse.core.runtime.products">
- <product
- application="org.apache.qpid.management.ui.application"
- name="Qpid Management Console">
- <property
- name="windowImages"
- value="icons/qpidmc16.gif,icons/qpidmc32.gif">
- </property>
- <property
- name="aboutText"
- value="Qpid Management Console"/>
- </product>
- </extension>
- <extension
- point="org.eclipse.ui.actionSets">
- <actionSet
- id="org.apache.qpid.management.ui.actionSet"
- label="Qpid Action Set"
- visible="true">
- <menu
- id="qpidmanager"
- label="&amp;Qpid Manager">
- <separator name="qpidActionsGroup"/>
- </menu>
- <action
- class="org.apache.qpid.management.ui.actions.EditAttribute"
- definitionId="org.apache.qpid.management.ui.actions.cmd_editAttribute"
- id="org.apache.qpid.management.ui.actions.editAttribute"
- label="Edit Attribute"
- menubarPath="qpidmanager/mbeanactions"
- style="push"
- tooltip="Edit Attribute"/>
- <action
- class="org.apache.qpid.management.ui.actions.Refresh"
- definitionId="org.apache.qpid.management.ui.actions.cmd_refresh"
- icon="icons/refresh.gif"
- id="org.apache.qpid.management.ui.actions.refresh"
- label="Refresh"
- menubarPath="qpidmanager/additions"
- style="push"
- toolbarPath="qpidActionsGroup"
- tooltip="Refresh"/>
- <action
- class="org.apache.qpid.management.ui.actions.RemoveServer"
- definitionId="org.apache.qpid.management.ui.actions.cmd_remove"
- icon="icons/delete.gif"
- id="org.apache.qpid.management.ui.actions.remove"
- label="Remove Connection"
- menubarPath="qpidmanager/additions"
- style="push"
- toolbarPath="qpidActionsGroup"/>
- <action
- class="org.apache.qpid.management.ui.actions.CloseConnection"
- definitionId="org.apache.qpid.management.ui.actions.cmd_disconnect"
- icon="icons/stop.gif"
- id="org.apache.qpid.management.ui.disconnect"
- label="Disconnect"
- menubarPath="qpidmanager/additions"
- toolbarPath="qpidActionsGroup"
- tooltip="Disconnect"/>
- <action
- class="org.apache.qpid.management.ui.actions.ReconnectServer"
- definitionId="org.apache.qpid.management.ui.actions.cmd_reconnect"
- icon="icons/reconnect.gif"
- id="org.apache.qpid.management.ui.reconnect"
- label="Reconnect"
- menubarPath="qpidmanager/additions"
- toolbarPath="qpidActionsGroup"
- tooltip="Reconnect"/>
- <action
- class="org.apache.qpid.management.ui.actions.AddServer"
- definitionId="org.apache.qpid.management.ui.actions.cmd_add"
- icon="icons/add.gif"
- id="org.apache.qpid.management.ui.add"
- label="New Connection"
- menubarPath="qpidmanager/additions"
- toolbarPath="qpidActionsGroup"
- tooltip="New Connection"/>
- </actionSet>
- </extension>
-
-</plugin>
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Activator.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Activator.java
deleted file mode 100644
index 5eab267c28..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Activator.java
+++ /dev/null
@@ -1,84 +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.
- *
- */
-package org.apache.qpid.management.ui;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- * @author Bhupendra Bhardwaj
- */
-public class Activator extends AbstractUIPlugin
-{
- // The plug-in ID
- public static final String PLUGIN_ID = "org.apache.qpid.management.ui";
-
- // The shared instance
- private static Activator plugin;
-
- /**
- * The constructor
- */
- public Activator()
- {
- plugin = this;
- }
-
- /*
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception
- {
- super.start(context);
- }
-
- /*
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception
- {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static Activator getDefault()
- {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path)
- {
- return imageDescriptorFromPlugin(PLUGIN_ID, path);
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Application.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Application.java
deleted file mode 100644
index a1c4b7ddb0..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Application.java
+++ /dev/null
@@ -1,63 +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.
- *
- */
-package org.apache.qpid.management.ui;
-
-import org.eclipse.core.runtime.IPlatformRunnable;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * This class controls all aspects of the application's execution
- * @author Bhupendra Bhardwaj
- */
-public class Application implements IPlatformRunnable
-{
- static Shell shell = null;
-
- /*
- * The call to createAndRunWorkbench will not return until the workbench is closed.
- * The SWT event loop and other low-level logistics are handled inside this method.
- * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)
- */
- public Object run(Object args) throws Exception
- {
- Display display = PlatformUI.createDisplay();
- try
- {
- int returnCode = PlatformUI.createAndRunWorkbench(display,
- new ApplicationWorkbenchAdvisor());
- if (returnCode == PlatformUI.RETURN_RESTART)
- {
- return IPlatformRunnable.EXIT_RESTART;
- }
- return IPlatformRunnable.EXIT_OK;
- } finally
- {
- display.dispose();
- }
- }
-
- static Shell getActiveShell()
- {
- return shell;
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationActionBarAdvisor.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationActionBarAdvisor.java
deleted file mode 100644
index b5c1b5074a..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationActionBarAdvisor.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui;
-
-import org.apache.qpid.management.ui.actions.VersionAction;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.ICoolBarManager;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-
-/**
- * An action bar advisor is responsible for creating, adding, and disposing of the
- * actions added to a workbench window. Each window will be populated with
- * new actions.
- */
-public class ApplicationActionBarAdvisor extends ActionBarAdvisor
-{
-
- // Actions - important to allocate these only in makeActions, and then use them
- // in the fill methods. This ensures that the actions aren't recreated
- // when fillActionBars is called with FILL_PROXY.
- private IWorkbenchAction exitAction;
- private Action _aboutAction;
-
- public ApplicationActionBarAdvisor(IActionBarConfigurer configurer)
- {
- super(configurer);
- }
-
- protected void makeActions(final IWorkbenchWindow window)
- {
- // Creates the actions and registers them.
- // Registering is needed to ensure that key bindings work.
- // The corresponding commands keybindings are defined in the plugin.xml file.
- // Registering also provides automatic disposal of the actions when
- // the window is closed.
-
- exitAction = ActionFactory.QUIT.create(window);
- register(exitAction);
-
- _aboutAction = new VersionAction(window);
- register(_aboutAction);
- }
-
-
- protected void fillMenuBar(IMenuManager menuBar)
- {
- MenuManager fileMenu = new MenuManager("&Qpid Manager", "qpidmanager");
- MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
-
- menuBar.add(fileMenu);
- // Add a group marker indicating where action set menus will appear.
- menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- menuBar.add(helpMenu);
-
- fileMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- fileMenu.add(new Separator());
- fileMenu.add(new GroupMarker("mbeanactions"));
- fileMenu.add(new Separator());
- fileMenu.add(exitAction);
-
- // Help
- helpMenu.add(_aboutAction);
- }
-
- protected void fillCoolBar(ICoolBarManager coolBar)
- {
-
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
deleted file mode 100644
index f3b9943cbb..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
+++ /dev/null
@@ -1,136 +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.
- *
- */
-package org.apache.qpid.management.ui;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.eclipse.jface.resource.FontRegistry;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontData;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Main Application Registry, which contains shared resources and map to all connected servers.
- * @author Bhupendra Bhardwaj
- */
-public abstract class ApplicationRegistry
-{
- private static ImageRegistry imageRegistry = new ImageRegistry();
- private static FontRegistry fontRegistry = new FontRegistry();
- public static final boolean debug = Boolean.getBoolean("eclipse.consoleLog");
- public static final long timeout = Long.parseLong(System.getProperty("timeout", "5000"));
-
- static
- {
- imageRegistry.put(Constants.CONSOLE_IMAGE,
- org.apache.qpid.management.ui.Activator.getImageDescriptor("/icons/qpidmc.gif"));
- imageRegistry.put(Constants.CLOSED_FOLDER_IMAGE,
- org.apache.qpid.management.ui.Activator.getImageDescriptor("/icons/icon_ClosedFolder.gif"));
- imageRegistry.put(Constants.OPEN_FOLDER_IMAGE,
- PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER));
- imageRegistry.put(Constants.MBEAN_IMAGE,
- PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT));
- imageRegistry.put(Constants.NOTIFICATION_IMAGE,
- org.apache.qpid.management.ui.Activator.getImageDescriptor("/icons/notifications.gif"));
- }
-
- static
- {
- fontRegistry.put(Constants.FONT_BUTTON, new FontData[]{new FontData("Arial", 8, SWT.BOLD)} );
- fontRegistry.put(Constants.FONT_BOLD, new FontData[]{new FontData("Bold", 9, SWT.BOLD)} );
- fontRegistry.put(Constants.FONT_ITALIC, new FontData[]{new FontData("Italic", 9, SWT.ITALIC)} );
- fontRegistry.put(Constants.FONT_TABLE_CELL, new FontData[]{new FontData("Tablecell", 8, SWT.NORMAL)} );
- fontRegistry.put(Constants.FONT_NORMAL, new FontData[]{new FontData("Normal", 9, SWT.NORMAL)} );
- }
-
- /*
- * This maps all the managed servers to the respective server registry.
- * Server can be JMX MBeanServer or a C++ server
- */
- private static HashMap<ManagedServer, ServerRegistry> _serverRegistryMap = new HashMap<ManagedServer, ServerRegistry>();
-
- // This map gets updated when a server connection closes.
- private static List<ManagedServer> _closedServerList = new CopyOnWriteArrayList<ManagedServer>();
-
- public static Image getImage(String key)
- {
- return imageRegistry.get(key);
- }
-
- public static Font getFont(String key)
- {
- return fontRegistry.get(key);
- }
-
- public static void addServer(ManagedServer server, ServerRegistry registry)
- {
- _serverRegistryMap.put(server, registry);
- }
-
- public static void removeServer(ManagedServer server)
- {
- _serverRegistryMap.remove(server);
- }
-
- public static ServerRegistry getServerRegistry(ManagedServer server)
- {
- return _serverRegistryMap.get(server);
- }
-
- public static ServerRegistry getServerRegistry(ManagedBean mbean)
- {
- ManagedServer server = mbean.getServer();
- return getServerRegistry(server);
- }
-
- public static boolean isServerConnected(ManagedServer server)
- {
- return _serverRegistryMap.containsKey(server);
- }
-
- // remove the server from the registry
- public static void serverConnectionClosed(ManagedServer server)
- {
- _closedServerList.add(server);
- removeServer(server);
- }
-
- /*
- * Returns the lis of closed servers. The Thread in GUI, which keeps checking for closed connection
- * will check this and will remove the server links from the GUI.
- */
- public static List<ManagedServer> getClosedServers()
- {
- if (_closedServerList.isEmpty())
- return null;
-
- List<ManagedServer> list = new CopyOnWriteArrayList<ManagedServer>(_closedServerList);
- _closedServerList.clear();
- return list;
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchAdvisor.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchAdvisor.java
deleted file mode 100644
index a46fa870e4..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchAdvisor.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.management.ui;
-
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchAdvisor;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-/**
- * This workbench advisor creates the window advisor, and specifies
- * the perspective id for the initial window.
- */
-public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor
-{
- public static final String PERSPECTIVE_ID = "org.apache.qpid.management.ui.perspective";
-
- public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer)
- {
- return new ApplicationWorkbenchWindowAdvisor(configurer);
- }
-
-
- public String getInitialWindowPerspectiveId()
- {
- return PERSPECTIVE_ID;
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java
deleted file mode 100644
index e3aedef28e..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui;
-
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.application.ActionBarAdvisor;
-import org.eclipse.ui.application.IActionBarConfigurer;
-import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
-import org.eclipse.ui.application.WorkbenchWindowAdvisor;
-
-/**
- *
- * @author Bhupendra Bhardwaj
- */
-public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor
-{
- public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer)
- {
- super(configurer);
- }
-
- public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer)
- {
- return new ApplicationActionBarAdvisor(configurer);
- }
-
- public void preWindowOpen()
- {
- IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
- int x = Display.getDefault().getBounds().width;
- int y = Display.getDefault().getBounds().height;
- configurer.setInitialSize(new Point(9*x/10, 8*y/10));
- configurer.setShowCoolBar(true);
- configurer.setShowStatusLine(false);
-
- configurer.setTitle(Constants.APPLICATION_NAME);
- }
-
- public void postWindowCreate()
- {
- IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
- Shell shell = configurer.getWindow().getShell();
- shell.setImage(ApplicationRegistry.getImage(Constants.CONSOLE_IMAGE));
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
deleted file mode 100644
index d6f895b64a..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
+++ /dev/null
@@ -1,140 +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.
- *
- */
-package org.apache.qpid.management.ui;
-
-/**
- * Contains constants for the application
- * @author Bhupendra Bhardwaj
- *
- */
-public class Constants
-{
- public final static String APPLICATION_NAME = "Qpid Management Console";
-
- public final static String ACTION_REMOVE_MBEANNODE = "Remove from list";
- public final static String VALUE = "value";
- public final static String TYPE = "type";
- public final static String NODE_TYPE_SERVER = "server";
- public final static String NODE_TYPE_DOMAIN = "domain";
- public final static String NODE_TYPE_MBEANTYPE = "mbeantype";
- // currently used only for virtual host instances, but will work as general also
- public final static String NODE_TYPE_TYPEINSTANCE = "mbeantype_instance";
- public final static String MBEAN = "mbean";
- public final static String ATTRIBUTE = "Attribute";
- public final static String ATTRIBUTES = "Attributes";
- public final static String NOTIFICATIONS = "Notifications";
- public final static String RESULT = "Result";
- public final static String VIRTUAL_HOST = "VirtualHost";
- public final static String DEFAULT_VH = "Default";
- public final static String DEFAULT_USERNAME = "guest";
- public final static String DEFAULT_PASSWORD = "guest";
-
- public final static String USERNAME = "Username";
- public final static String PASSWORD = "Password";
-
- // Attributes and operations are used to customize the GUI for Qpid. If these are changes in the
- // Qpid server, then these should be updated accordingly
- public final static String ATTRIBUTE_QUEUE_OWNER = "owner";
- public final static String ATTRIBUTE_QUEUE_DEPTH = "QueueDepth";
- public final static String ATTRIBUTE_QUEUE_CONSUMERCOUNT = "ActiveConsumerCount";
- public final static String OPERATION_CREATE_QUEUE = "createNewQueue";
- public final static String OPERATION_CREATE_BINDING = "createNewBinding";
- public final static String OPERATION_MOVE_MESSAGES = "moveMessages";
-
- public final static String OPERATION_CREATEUSER = "createUser";
- public final static String OPERATION_DELETEUSER = "deleteUser";
- public final static String OPERATION_VIEWUSERS = "viewUsers";
- public final static String OPERATION_PARAM_USERNAME = "username";
-
- public final static String OPERATION_SUCCESSFUL = "Operation successful";
- public final static String OPERATION_UNSUCCESSFUL = "Operation unsuccessful";
-
- public final static String ALL = "All";
-
- public final static String NAVIGATION_ROOT = "Qpid Connections";
- public final static String DESCRIPTION = " Description";
-
- public final static String ADMIN_MBEAN_TYPE = "UserManagement";
- public final static String QUEUE = "Queue";
- public final static String CONNECTION ="Connection";
- public final static String EXCHANGE = "Exchange";
- public final static String EXCHANGE_TYPE = "ExchangeType";
- public final static String[] EXCHANGE_TYPE_VALUES = {"direct", "fanout", "headers", "topic"};
- public final static String[] BOOLEAN_TYPE_VALUES = {"false", "true"};
- public final static String[] ATTRIBUTE_TABLE_TITLES = {"Attribute Name", "Value"};
- public static final String[] CONNECTION_PROTOCOLS ={"RMI"};
- public static final String DEFAULT_PROTOCOL = CONNECTION_PROTOCOLS[0];
-
- public final static String ACTION_ADDSERVER = "New Connection";
- public final static String ACTION_RECONNECT = "Reconnect";
- public final static String ACTION_CLOSE = "Close Connection";
- public final static String ACTION_EDITATTRIBUTE = "Edit Attribute";
- public final static String ACTION_LOGIN = "Login";
-
- public final static String QUEUE_SORT_BY_NAME = "Queue Name";
- public final static String QUEUE_SORT_BY_DEPTH = "Queue Depth";
- public final static String QUEUE_SORT_BY_CONSUMERCOUNT = "Consumer Count";
- public final static String QUEUE_SHOW_TEMP_QUEUES= "show temporary queues";
-
- public final static String SUBSCRIBE_BUTTON = "Subscribe";
- public final static String UNSUBSCRIBE_BUTTON = "Unsubscribe";
-
- public final static String CONSOLE_IMAGE = "ConsoelImage";
- public final static String CLOSED_FOLDER_IMAGE = "ClosedFolderImage";
- public final static String OPEN_FOLDER_IMAGE = "OpenFolderImage";
- public final static String MBEAN_IMAGE = "MBeanImage";
- public final static String NOTIFICATION_IMAGE = "NotificationImage";
-
- public final static String FONT_BUTTON = "ButtonFont";
- public final static String FONT_BOLD = "BoldFont";
- public final static String FONT_ITALIC = "ItalicFont";
- public final static String FONT_TABLE_CELL = "TableCellFont";
- public final static String FONT_NORMAL = "Normal";
-
- public final static String BUTTON_DETAILS = "Details";
- public final static String BUTTON_EDIT_ATTRIBUTE = "Edit Attribute";
- public final static String BUTTON_REFRESH = "Refresh";
- public final static String BUTTON_GRAPH = "Graph";
- public final static int TIMER_INTERVAL = 5000;
- public final static String BUTTON_EXECUTE = "Execute";
- public final static String BUTTON_CLEAR = "Clear";
- public final static String BUTTON_CONNECT = "Connect";
- public final static String BUTTON_CANCEL = "Cancel";
- public final static String BUTTON_UPDATE = "Update";
-
-
- public final static int OPERATION_IMPACT_INFO = 0;
- public final static int OPERATION_IMPACT_ACTION = 1;
- public final static int OPERATION_IMPACT_ACTIONINFO = 2;
- public final static int OPERATION_IMPACT_UNKNOWN = 3;
-
- public final static String ERROR_SERVER_CONNECTION = "Server Connection Failed";
- public final static String INFO_PROTOCOL = "Please select the protocol";
- public final static String INFO_HOST_ADDRESS = "Please enter the host address";
- public final static String INFO_HOST_PORT = "Please enter the port number";
- public final static String INFO_USERNAME = "Please enter the " + USERNAME;
- public final static String INFO_PASSWORD = "Please enter the " + PASSWORD;
-
- public final static String MECH_CRAMMD5 = "CRAM-MD5";
- public final static String MECH_PLAIN = "PLAIN";
- public final static String SASL_CRAMMD5 = "SASL/CRAM-MD5";
- public final static String SASL_PLAIN = "SASL/PLAIN";
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java
deleted file mode 100644
index 31825e925d..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java
+++ /dev/null
@@ -1,132 +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.
- *
- */
-package org.apache.qpid.management.ui;
-
-import static org.apache.qpid.management.ui.Constants.*;
-import java.util.HashMap;
-
-/**
- * Class representing a managed bean on the managed server
- * @author Bhupendra Bhardwaj
- *
- */
-public abstract class ManagedBean extends ManagedObject
-{
- private String _uniqueName = "";
- private String _domain = "";
- private String _type = "";
- private String _virtualHostName = null;
- private ManagedServer _server = null;
- private HashMap _properties = null;
-
- public String getProperty(String key)
- {
- return (String)_properties.get(key);
- }
-
- public HashMap getProperties()
- {
- return _properties;
- }
- public void setProperties(HashMap properties)
- {
- this._properties = properties;
- setName(getProperty("name"));
- setType(getProperty("type"));
- _virtualHostName = getProperty(VIRTUAL_HOST);
- }
- public String getDomain()
- {
- return _domain;
- }
- public void setDomain(String domain)
- {
- this._domain = domain;
- }
-
- public ManagedServer getServer()
- {
- return _server;
- }
- public void setServer(ManagedServer server)
- {
- this._server = server;
- }
- public String getType()
- {
- return _type;
- }
- public void setType(String type)
- {
- this._type = type;
- }
- public String getUniqueName()
- {
- return _uniqueName;
- }
- public void setUniqueName(String uniqueName)
- {
- this._uniqueName = uniqueName;
- }
-
- public String getVirtualHostName()
- {
- // To make it work with the broker with no virtual host implementation
- return _virtualHostName == null ? DEFAULT_VH : _virtualHostName;
- }
-
- /**
- * Returns mbean instance name. MBeans which have only one instance, the type attribute will be returned
- * @return
- */
- public String getInstanceName()
- {
- if (getName() != null)
- return getName();
- else
- return getType();
- }
-
- public boolean isQueue()
- {
- return _type.endsWith(QUEUE);
- }
-
- public boolean isConnection()
- {
- return _type.endsWith(CONNECTION);
- }
-
- public boolean isExchange()
- {
- return _type.endsWith(EXCHANGE);
- }
-
- public boolean isTempQueue()
- {
- return (isQueue() && getName().startsWith("tmp_"));
- }
-
- public boolean isAdmin()
- {
- return _type.endsWith(ADMIN_MBEAN_TYPE);
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedObject.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedObject.java
deleted file mode 100644
index 96e0fa46c6..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedObject.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.management.ui;
-
-/**
- * Abstract class representing a managed object
- * @author Bhupendra Bhardwaj
- */
-public abstract class ManagedObject
-{
- private String _name;
-
- public String getName()
- {
- return _name;
- }
-
- public void setName(String name)
- {
- this._name = name;
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedServer.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedServer.java
deleted file mode 100644
index 480fdb429a..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedServer.java
+++ /dev/null
@@ -1,103 +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.
- *
- */
-package org.apache.qpid.management.ui;
-
-import static org.apache.qpid.management.ui.Constants.DEFAULT_PROTOCOL;
-/**
- * Class representing a server being managed eg. MBeanServer
- * @author Bhupendra Bhardwaj
- */
-public class ManagedServer extends ManagedObject
-{
- private String _host;
- private int _port;
- private String _url;
- private String _domain;
- private String _user;
- private String _password;
- private String _protocol = DEFAULT_PROTOCOL;
-
- public ManagedServer(String host, int port, String domain)
- {
- this(host, port, domain, null, null);
- }
-
- public ManagedServer(String host, int port, String domain, String user, String password)
- {
- setName(host + ":" + port);
- _host = host;
- _port = port;
- _domain = domain;
- _url = getRMIURL(host, port);
- _user = user;
- _password = password;
- }
-
- public String getDomain()
- {
- return _domain;
- }
-
- public String getHost()
- {
- return _host;
- }
-
- public int getPort()
- {
- return _port;
- }
-
- public String getUrl()
- {
- return _url;
- }
-
- public String getProtocol()
- {
- return _protocol;
- }
-
- public String getPassword()
- {
- return _password;
- }
-
- public void setPassword(String password)
- {
- _password = password;
- }
-
- public String getUser()
- {
- return _user;
- }
-
- public void setUser(String user)
- {
- _user = user;
- }
-
- private String getRMIURL(String host, int port)
- {
- return "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi";
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java
deleted file mode 100644
index f93200cadf..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.management.ui;
-
-import org.apache.qpid.management.ui.views.MBeanView;
-import org.apache.qpid.management.ui.views.NavigationView;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-/**
- *
- * @author Bhupendra Bhardwaj
- */
-public class Perspective implements IPerspectiveFactory
-{
- public void createInitialLayout(IPageLayout layout)
- {
- String editorArea = layout.getEditorArea();
- layout.setEditorAreaVisible(false);
-
- // standalone view meaning it can't be docked or stacked with other views, and it doesn't have a title bar.
- layout.addStandaloneView(NavigationView.ID, true, IPageLayout.LEFT, 0.30f, editorArea);
- layout.addStandaloneView(MBeanView.ID, true, IPageLayout.RIGHT, 0.70f, editorArea);
-
- layout.getViewLayout(NavigationView.ID).setCloseable(false);
- layout.getViewLayout(MBeanView.ID).setCloseable(false);
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
deleted file mode 100644
index 313e143df5..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
+++ /dev/null
@@ -1,172 +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.
- *
- */
-package org.apache.qpid.management.ui;
-
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-import org.apache.qpid.management.ui.jmx.ClientListener;
-import org.apache.qpid.management.ui.model.ManagedAttributeModel;
-import org.apache.qpid.management.ui.model.NotificationObject;
-import org.apache.qpid.management.ui.model.OperationDataModel;
-
-public abstract class ServerRegistry
-{
- private ManagedServer _managedServer = null;
-
- // list of virtual hosts for this server
- private List<String> _virtualHosts = new ArrayList<String>();
- // map of all Connection mbeans
- private ConcurrentMap<String,List<ManagedBean>> _connections = new ConcurrentHashMap<String,List<ManagedBean>>();
- // map of all exchange mbeans
- private ConcurrentMap<String,List<ManagedBean>> _exchanges = new ConcurrentHashMap<String,List<ManagedBean>>();
- // map of all queue mbenas
- private ConcurrentMap<String,List<ManagedBean>> _queues = new ConcurrentHashMap<String,List<ManagedBean>>();
-
- public ServerRegistry()
- {
-
- }
-
- public ServerRegistry(ManagedServer server)
- {
- _managedServer = server;
- }
-
- public ManagedServer getManagedServer()
- {
- return _managedServer;
- }
-
- public void setManagedServer(ManagedServer server)
- {
- _managedServer = server;
- }
-
- protected void addConnectionMBean(ManagedBean mbean)
- {
- String vHost = mbean.getVirtualHostName();
- _connections.putIfAbsent(vHost, new ArrayList<ManagedBean>());
- _connections.get(vHost).add(mbean);
- }
-
- protected void addExchangeMBean(ManagedBean mbean)
- {
- String vHost = mbean.getVirtualHostName();
- _exchanges.putIfAbsent(vHost, new ArrayList<ManagedBean>());
- _exchanges.get(vHost).add(mbean);
- }
-
- protected void addQueueMBean(ManagedBean mbean)
- {
- String vHost = mbean.getVirtualHostName();
- _queues.putIfAbsent(vHost, new ArrayList<ManagedBean>());
- _queues.get(vHost).add(mbean);
- }
-
- protected void removeConnectionMBean(ManagedBean mbean)
- {
- _connections.get(mbean.getVirtualHostName()).remove(mbean);
- }
-
- protected void removeExchangeMBean(ManagedBean mbean)
- {
- _exchanges.get(mbean.getVirtualHostName()).remove(mbean);
- }
-
- protected void removeQueueMBean(ManagedBean mbean)
- {
- _queues.get(mbean.getVirtualHostName()).remove(mbean);
- }
-
- public List<ManagedBean> getConnections(String virtualHost)
- {
- return _connections.get(virtualHost);
- }
-
- public List<ManagedBean> getExchanges(String virtualHost)
- {
- return _exchanges.get(virtualHost);
- }
-
- public List<ManagedBean> getQueues(String virtualHost)
- {
- return _queues.get(virtualHost);
- }
-
- public void addVirtualHost(String name)
- {
- if (!_virtualHosts.contains(name))
- {
- _virtualHosts.add(name);
- }
- }
-
- public List<String> getVirtualHosts()
- {
- return _virtualHosts;
- }
-
- public abstract void setUserList(List<String> list);
-
- public abstract List<String> getUsernames();
-
- public abstract void addManagedObject(ManagedBean key);
-
- public abstract List<ManagedBean> getMBeans();
-
- public abstract void removeManagedObject(ManagedBean mbean);
-
- public abstract List<ManagedBean> getObjectsToBeRemoved();
-
- public abstract ManagedAttributeModel getAttributeModel(ManagedBean mbean);
-
- public abstract Object getServerConnection();
-
- public abstract void closeServerConnection() throws Exception;
-
- public abstract OperationDataModel getOperationModel(ManagedBean mbean);
-
- public abstract List<String> getQueueNames(String vistualHostName);
-
- public abstract String[] getExchangeNames(String vistualHostName);
-
- public abstract String[] getConnectionNames(String vistualHostName);
-
- public abstract List<NotificationObject> getNotifications(ManagedBean mbean);
-
- public abstract boolean hasSubscribedForNotifications(ManagedBean mbean, String name, String type);
-
- public abstract void clearNotifications(ManagedBean mbean, List<NotificationObject> list);
-
- public ClientListener getNotificationListener()
- {
- return null;
- }
-
- public ClientListener getClientListener()
- {
- return null;
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
deleted file mode 100644
index f74ab54cc3..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.actions;
-
-import static org.apache.qpid.management.ui.Constants.ERROR_SERVER_CONNECTION;
-
-import java.io.IOException;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ApplicationWorkbenchAdvisor;
-import org.apache.qpid.management.ui.Constants;
-import org.apache.qpid.management.ui.jmx.MBeanUtility;
-import org.apache.qpid.management.ui.views.NavigationView;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class AbstractAction
-{
- private NavigationView _navigationView;
-
- protected IWorkbenchWindow _window;
-
- public static final String RMI_SASL_ERROR = "non-JRMP server";
- public static final String SECURITY_FAILURE = "User authentication has failed";
- public static final String SERVER_UNAVAILABLE = "Qpid server is not running";
- public static final String INVALID_PERSPECTIVE = "Invalid Perspective";
- public static final String CHANGE_PERSPECTIVE = "Please use the Qpid Management Perspective";
-
- /**
- * We will cache window object in order to
- * be able to provide parent shell for the message dialog.
- * @see IWorkbenchWindowActionDelegate#init
- */
- public void init(IWorkbenchWindow window)
- {
- this._window = window;
- if (_window.getShell() != null)
- {
- _window.getShell().setImage(ApplicationRegistry.getImage(Constants.CONSOLE_IMAGE));
- }
- }
-
- protected NavigationView getNavigationView()
- {
- if (_navigationView == null)
- {
- _navigationView = (NavigationView)_window.getActivePage().findView(NavigationView.ID);
- }
-
- return _navigationView;
- }
-
-
- protected void handleException(Throwable ex, String title, String msg)
- {
- MBeanUtility.printStackTrace(ex);
- NavigationView view = (NavigationView)_window.getActivePage().findView(NavigationView.ID);
- if (view == null)
- {
- IStatus status = new Status(IStatus.WARNING, ApplicationWorkbenchAdvisor.PERSPECTIVE_ID,
- IStatus.OK, CHANGE_PERSPECTIVE, null);
- ErrorDialog.openError(_window.getShell(), "Warning", INVALID_PERSPECTIVE, status);
- return;
- }
- if (msg == null)
- {
- if (ex instanceof IOException)
- {
- if ((ex.getMessage() != null) && (ex.getMessage().indexOf(RMI_SASL_ERROR) != -1))
- {
- msg = SECURITY_FAILURE;
- }
- else
- {
- msg = SERVER_UNAVAILABLE;
- }
- }
- else if (ex instanceof SecurityException)
- {
- msg = SECURITY_FAILURE;
- }
- else
- {
- msg = ex.getMessage();
- }
- }
-
- if ((msg == null) && (ex.getCause() != null))
- {
- msg = ex.getCause().getMessage();
- }
-
- if (msg == null)
- {
- msg = ERROR_SERVER_CONNECTION;
- }
-
- if (title == null)
- {
- title = ERROR_SERVER_CONNECTION;
- }
- IStatus status = new Status(IStatus.ERROR, ApplicationWorkbenchAdvisor.PERSPECTIVE_ID,
- IStatus.OK, msg, null);
- ErrorDialog.openError(_window.getShell(), "Error", title, status);
- }
-
-
- /**
- * Selection in the workbench has been changed. We can change the state of the 'real' action here
- * if we want, but this can only happen after the delegate has been created.
- * @see IWorkbenchWindowActionDelegate#selectionChanged
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
- /**
- * We can use this method to dispose of any system resources we previously allocated.
- * @see IWorkbenchWindowActionDelegate#dispose
- */
- public void dispose() {
-
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java
deleted file mode 100644
index ce7d8816ba..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java
+++ /dev/null
@@ -1,326 +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.
- *
- */
-package org.apache.qpid.management.ui.actions;
-
-import static org.apache.qpid.management.ui.Constants.*;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
-import org.apache.qpid.management.ui.views.NumberVerifyListener;
-import org.apache.qpid.management.ui.views.ViewUtility;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class AddServer extends AbstractAction implements IWorkbenchWindowActionDelegate
-{
- private static final String[] _domains ={"org.apache.qpid"};
-
- private String _transport = DEFAULT_PROTOCOL;
- private String _host;
- private String _port;
- private String _domain;
- private String _user;
- private String _password;
-
- private boolean _addServer;
-
- public AddServer()
- {
-
- }
-
- public void run(IAction action)
- {
- if(_window == null)
- return;
-
- reset();
- createAddServerPopup();
- try
- {
- if (_addServer)
- {
- getNavigationView().addNewServer(_transport, _host, Integer.parseInt(_port), _domain, _user, _password);
- }
- }
- catch(InfoRequiredException ex)
- {
- ViewUtility.popupInfoMessage(ACTION_ADDSERVER, ex.getMessage());
- }
- catch (Exception ex)
- {
- handleException(ex, null, null);
- }
- }
-
- private void reset()
- {
- _addServer = false;
- _host = null;
- _port = null;
- _domain = null;
- _user = null;
- _password = null;
- }
-
- /**
- * Creates the shell and then opens the popup where user can enter new connection details.
- * Connects to the new server and adds the server in the navigation page.
- * Pops up any error occured in connecting to the new server
- */
- private void createAddServerPopup()
- {
- Display display = Display.getCurrent();
- final Shell shell = new Shell(display, SWT.BORDER | SWT.CLOSE);
- shell.setText(ACTION_ADDSERVER);
- shell.setImage(ApplicationRegistry.getImage(CONSOLE_IMAGE));
- shell.setLayout(new GridLayout());
-
- createWidgets(shell);
- shell.pack();
-
- //get current size dialog, and screen size
- int displayWidth = display.getBounds().width;
- int displayHeight = display.getBounds().height;
- int currentShellWidth = shell.getSize().x;
- int currentShellHeight = shell.getSize().y;
-
- //default sizes for the dialog
- int minShellWidth = 425;
- int minShellHeight= 290;
- //ensure this is large enough, increase it if its not
- int newShellWidth = currentShellWidth > minShellWidth ? currentShellWidth : minShellWidth;
- int newShellHeight = currentShellHeight > minShellHeight ? currentShellHeight : minShellHeight;
-
- //set the final size and centre the dialog
- shell.setBounds((displayWidth - newShellWidth)/2 , (displayHeight - newShellHeight)/2, newShellWidth, newShellHeight);
-
- shell.open();
- _window.getShell().setEnabled(false);
-
- while (!shell.isDisposed())
- {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
- }
-
- // enable the main shell
- _window.getShell().setEnabled(true);
- _window.getShell().open();
- }
-
- // Creates SWT widgets for the user to add server connection details.
- // Adds listeners to the widgets to take appropriate action
- private void createWidgets(final Shell shell)
- {
- Composite composite = new Composite(shell, SWT.NONE);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- GridLayout layout = new GridLayout(2, false);
- layout.horizontalSpacing = 10;
- layout.verticalSpacing = 10;
- layout.marginHeight = 20;
- layout.marginWidth = 20;
- composite.setLayout(layout);
-
- /* Commenting this, as there is only one protocol at the moment.
- * This can be uncommented and enhanced, if more protocols are added in future
- Label name = new Label(composite, SWT.NONE);
- name.setText("Connection Type");
- GridData layoutData = new GridData(SWT.TRAIL, SWT.TOP, false, false);
- name.setLayoutData(layoutData);
-
- final Combo comboTransport = new Combo(composite, SWT.READ_ONLY);
- comboTransport.setItems(CONNECTION_PROTOCOLS);
- comboTransport.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- comboTransport.select(0);
- */
-
- Label host = new Label(composite, SWT.NONE);
- host.setText("Host");
- host.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
-
- final Text textHost = new Text(composite, SWT.BORDER);
- textHost.setText("");
- textHost.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- textHost.setFocus();
-
- Label port = new Label(composite, SWT.NONE);
- port.setText("Port");
- port.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
-
- final Text textPort = new Text(composite, SWT.BORDER);
- textPort.setText("");
- textPort.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- // Verify if the value entered is numeric
- textPort.addVerifyListener(new NumberVerifyListener());
-
-
- Label domain = new Label(composite, SWT.NONE);
- domain.setText("Domain");
- domain.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
-
- final Combo comboDomain = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY);
- comboDomain.setItems(_domains);
- comboDomain.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- comboDomain.select(0);
-
-
- Label user = new Label(composite, SWT.NONE);
- user.setText(USERNAME);
- user.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
-
- final Text textUser = new Text(composite, SWT.BORDER);
- textUser.setText("");
- textUser.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
- Label password = new Label(composite, SWT.NONE);
- password.setText(PASSWORD);
- password.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
-
- final Text textPwd = new Text(composite, SWT.BORDER | SWT.SINGLE | SWT.PASSWORD);
- textPwd.setText("");
- //textPwd.setEchoChar('*');
- textPwd.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
- //Get the text widgets
- Control[] widgets = composite.getChildren();
- for (int i=0; i < widgets.length; i++)
- {
- widgets[i].addKeyListener(new KeyAdapter()
- {
- public void keyPressed(KeyEvent event)
- {
- if (event.character == SWT.ESC)
- {
- //Escape key acts as cancel on all widgets
- shell.close();
- }
- }
- });
- }
-
- Composite buttonsComposite = new Composite(composite, SWT.NONE);
- buttonsComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
- buttonsComposite.setLayout(new GridLayout(2, true));
-
- final Button connectButton = new Button(buttonsComposite, SWT.PUSH | SWT.CENTER);
- connectButton.setText(BUTTON_CONNECT);
- GridData gridData = new GridData (SWT.TRAIL, SWT.BOTTOM, true, true);
- gridData.widthHint = 100;
- connectButton.setLayoutData(gridData);
- connectButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- connectButton.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent event)
- {
- _host = textHost.getText();
- if ((_host == null) || (_host.trim().length() == 0))
- {
- ViewUtility.popupInfoMessage(ACTION_ADDSERVER, INFO_HOST_ADDRESS);
- textHost.setText("");
- textHost.setFocus();
- return;
- }
-
- _port = textPort.getText();
- if ((_port == null) || (_port.trim().length() == 0))
- {
- ViewUtility.popupInfoMessage(ACTION_ADDSERVER, INFO_HOST_PORT);
- textPort.setText("");
- textPort.setFocus();
- return;
- }
-
- _user = textUser.getText();
- if ((_user == null) || (_user.trim().length() == 0))
- {
- ViewUtility.popupInfoMessage(ACTION_ADDSERVER, INFO_USERNAME);
- textUser.setText("");
- textUser.setFocus();
- return;
- }
-
- _password = textPwd.getText();
- if (_password == null)
- {
- ViewUtility.popupInfoMessage(ACTION_ADDSERVER, INFO_PASSWORD);
- textPwd.setText("");
- textPwd.setFocus();
- return;
- }
-
- _domain = comboDomain.getText();
- _addServer = true;
- shell.dispose();
- }
- });
-
- final Button cancelButton = new Button(buttonsComposite, SWT.PUSH);
- cancelButton.setText(BUTTON_CANCEL);
- gridData = new GridData (SWT.LEAD, SWT.BOTTOM, true, true);
- gridData.widthHint = 100;
- cancelButton.setLayoutData(gridData);
- cancelButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- cancelButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- shell.dispose();
- }
- });
-
- //Get the ok/cancel button widgets and add a new key listener
- widgets = buttonsComposite.getChildren();
- for (int i=0; i < widgets.length; i++)
- {
- widgets[i].addKeyListener(new KeyAdapter()
- {
- public void keyPressed(KeyEvent event)
- {
- if (event.character == SWT.ESC)
- {
- //Escape key acts as cancel on all widgets
- shell.close();
- }
- }
- });
- }
-
- shell.setDefaultButton(connectButton);
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java
deleted file mode 100644
index a3e52149df..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.actions;
-
-import static org.apache.qpid.management.ui.Constants.ACTION_CLOSE;
-import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
-import org.apache.qpid.management.ui.views.NavigationView;
-import org.apache.qpid.management.ui.views.ViewUtility;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class CloseConnection extends AbstractAction implements IWorkbenchWindowActionDelegate
-{
- public CloseConnection()
- {
-
- }
-
- public void run(IAction action)
- {
- if(_window != null)
- {
- NavigationView view = (NavigationView)_window.getActivePage().findView(NavigationView.ID);
- try
- {
- view.disconnect();
- }
- catch(InfoRequiredException ex)
- {
- ViewUtility.popupInfoMessage(ACTION_CLOSE, ex.getMessage());
- }
- catch(Exception ex)
- {
- handleException(ex, null, null);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java
deleted file mode 100644
index d3af3661b0..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-package org.apache.qpid.management.ui.actions;
-
-import static org.apache.qpid.management.ui.Constants.ACTION_EDITATTRIBUTE;
-import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
-import org.apache.qpid.management.ui.views.MBeanView;
-import org.apache.qpid.management.ui.views.ViewUtility;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class EditAttribute extends AbstractAction implements IWorkbenchWindowActionDelegate
-{
- public void run(IAction action)
- {
- if(_window != null)
- {
- MBeanView view = (MBeanView)_window.getActivePage().findView(MBeanView.ID);
- try
- {
- view.editAttribute();
- }
- catch(InfoRequiredException ex)
- {
- ViewUtility.popupInfoMessage(ACTION_EDITATTRIBUTE, ex.getMessage());
- }
- catch(Exception ex)
- {
- handleException(ex, "Attribute could not be edited", null);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java
deleted file mode 100644
index ce9d80d49b..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java
+++ /dev/null
@@ -1,260 +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.
- *
- */
-package org.apache.qpid.management.ui.actions;
-
-import static org.apache.qpid.management.ui.Constants.ACTION_LOGIN;
-import static org.apache.qpid.management.ui.Constants.CONSOLE_IMAGE;
-import static org.apache.qpid.management.ui.Constants.INFO_PASSWORD;
-import static org.apache.qpid.management.ui.Constants.INFO_USERNAME;
-import static org.apache.qpid.management.ui.Constants.PASSWORD;
-import static org.apache.qpid.management.ui.Constants.USERNAME;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.Constants;
-import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
-import org.apache.qpid.management.ui.views.TreeObject;
-import org.apache.qpid.management.ui.views.ViewUtility;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class ReconnectServer extends AbstractAction implements IWorkbenchWindowActionDelegate
-{
- private String _title;
- private String _serverName;
- private String _user;
- private String _password;
- private boolean _connect;
-
- public void run(IAction action)
- {
- if(_window == null)
- return;
-
- try
- {
- reset();
- // Check if a server node is selected to be reconnected.
- TreeObject serverNode = getNavigationView().getSelectedServerNode();
- _serverName = serverNode.getName();
- _title = ACTION_LOGIN + " (" + _serverName + ")";
-
- // Get the login details(username/password)
- createLoginPopup();
-
- if (_connect)
- {
- // Connect the server
- getNavigationView().reconnect(_user, _password);
- }
- }
- catch(InfoRequiredException ex)
- {
- ViewUtility.popupInfoMessage("Reconnect Qpid server", ex.getMessage());
- }
- catch (Exception ex)
- {
- handleException(ex, null, null);
- }
- }
-
- private void reset()
- {
- _connect = false;
- _user = null;
- _password = null;
- }
-
- // Create the login popup fot th user to enter usernaem and password
- private void createLoginPopup()
- {
- Display display = Display.getCurrent();
- final Shell shell = new Shell(display, SWT.BORDER | SWT.CLOSE);
- shell.setText(_title);
- shell.setImage(ApplicationRegistry.getImage(CONSOLE_IMAGE));
- shell.setLayout(new GridLayout());
-
- createWidgets(shell);
- shell.pack();
-
- //get current size dialog, and screen size
- int displayWidth = display.getBounds().width;
- int displayHeight = display.getBounds().height;
- int currentShellWidth = shell.getSize().x;
- int currentShellHeight = shell.getSize().y;
-
- //default sizes for the dialog
- int minShellWidth = 350;
- int minShellHeight= 200;
- //ensure this is large enough, increase it if its not
- int newShellWidth = currentShellWidth > minShellWidth ? currentShellWidth : minShellWidth;
- int newShellHeight = currentShellHeight > minShellHeight ? currentShellHeight : minShellHeight;
-
- //set the final size and centre the dialog
- shell.setBounds((displayWidth - newShellWidth)/2 , (displayHeight - newShellHeight)/2, newShellWidth, newShellHeight);
-
- shell.open();
- _window.getShell().setEnabled(false);
-
- while (!shell.isDisposed())
- {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
- }
-
- // enable the main shell
- _window.getShell().setEnabled(true);
- _window.getShell().open();
- }
-
- // Creates the SWT widgets in the popup shell, to enter username and password.
- // Adds listeners to the widgets to take appropriate action
- private void createWidgets(final Shell shell)
- {
- Composite composite = new Composite(shell, SWT.NONE);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- GridLayout layout = new GridLayout(2, false);
- layout.horizontalSpacing = 10;
- layout.verticalSpacing = 10;
- layout.marginHeight = 20;
- layout.marginWidth = 20;
- composite.setLayout(layout);
-
- Label user = new Label(composite, SWT.NONE);
- user.setText(USERNAME);
- user.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
-
- final Text textUser = new Text(composite, SWT.BORDER);
- textUser.setText("");
- textUser.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- // Put cursor on this field
- textUser.setFocus();
-
- Label password = new Label(composite, SWT.NONE);
- password.setText(PASSWORD);
- password.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
-
- final Text textPwd = new Text(composite, SWT.BORDER | SWT.SINGLE | SWT.PASSWORD);
- textPwd.setText("");
- textPwd.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
- //Get the text widgets
- Control[] widgets = composite.getChildren();
- for (int i=0; i < widgets.length; i++)
- {
- widgets[i].addKeyListener(new KeyAdapter()
- {
- public void keyPressed(KeyEvent event)
- {
- if (event.character == SWT.ESC)
- {
- //Escape key acts as cancel on all widgets
- shell.close();
- }
- }
- });
- }
-
- Composite buttonsComposite = new Composite(composite, SWT.NONE);
- buttonsComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
- buttonsComposite.setLayout(new GridLayout(2, true));
-
- final Button connectButton = new Button(buttonsComposite, SWT.PUSH | SWT.CENTER);
- connectButton.setText(Constants.BUTTON_CONNECT);
- GridData gridData = new GridData (SWT.TRAIL, SWT.BOTTOM, true, true);
- gridData.widthHint = 100;
- connectButton.setLayoutData(gridData);
- connectButton.setFont(ApplicationRegistry.getFont(Constants.FONT_BUTTON));
- connectButton.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent event)
- {
- _user = textUser.getText();
- if ((_user == null) || (_user.trim().length() == 0))
- {
- ViewUtility.popupInfoMessage(_title, INFO_USERNAME);
- textUser.setText("");
- textUser.setFocus();
- return;
- }
-
- _password = textPwd.getText();
- if (_password == null)
- {
- ViewUtility.popupInfoMessage(_title, INFO_PASSWORD);
- textPwd.setText("");
- textPwd.setFocus();
- return;
- }
-
- _connect = true;
- shell.dispose();
- }
- });
-
- final Button cancelButton = new Button(buttonsComposite, SWT.PUSH);
- cancelButton.setText(Constants.BUTTON_CANCEL);
- gridData = new GridData (SWT.LEAD, SWT.BOTTOM, true, true);
- gridData.widthHint = 100;
- cancelButton.setLayoutData(gridData);
- cancelButton.setFont(ApplicationRegistry.getFont(Constants.FONT_BUTTON));
- cancelButton.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent event)
- {
- shell.dispose();
- }
- });
-
- //Get the ok/cancel button widgets and add a new key listener
- widgets = buttonsComposite.getChildren();
- for (int i=0; i < widgets.length; i++)
- {
- widgets[i].addKeyListener(new KeyAdapter()
- {
- public void keyPressed(KeyEvent event)
- {
- if (event.character == SWT.ESC)
- {
- //Escape key acts as cancel on all widgets
- shell.close();
- }
- }
- });
- }
-
- shell.setDefaultButton(connectButton);
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java
deleted file mode 100644
index 34251c12d7..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.actions;
-
-import org.apache.qpid.management.ui.jmx.MBeanUtility;
-import org.apache.qpid.management.ui.views.MBeanView;
-import org.apache.qpid.management.ui.views.NavigationView;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * This action refreshes both the views -Navigation and MBeanView
- * @author Bhupendra Bhardwaj
- */
-public class Refresh extends AbstractAction implements IWorkbenchWindowActionDelegate
-{
- public void run(IAction action)
- {
- if(_window != null)
- {
- NavigationView view = (NavigationView)_window.getActivePage().findView(NavigationView.ID);
- view.refresh();
-
- MBeanView mbeanview = (MBeanView)_window.getActivePage().findView(MBeanView.ID);
- try
- {
- mbeanview.refreshMBeanView();
- }
- catch (Exception ex)
- {
- MBeanUtility.handleException(ex);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java
deleted file mode 100644
index e329255414..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java
+++ /dev/null
@@ -1,50 +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.
- *
- */
-package org.apache.qpid.management.ui.actions;
-
-import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
-import org.apache.qpid.management.ui.views.NavigationView;
-import org.apache.qpid.management.ui.views.ViewUtility;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-public class RemoveServer extends AbstractAction implements IWorkbenchWindowActionDelegate
-{
- public void run(IAction action)
- {
- if(_window != null)
- {
- NavigationView view = (NavigationView)_window.getActivePage().findView(NavigationView.ID);
- try
- {
- view.removeServer();
- }
- catch(InfoRequiredException ex)
- {
- ViewUtility.popupInfoMessage("Remove Qpid server", ex.getMessage());
- }
- catch(Exception ex)
- {
- handleException(ex, "Server could not be removed", null);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/VersionAction.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/VersionAction.java
deleted file mode 100644
index be69fadbe8..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/VersionAction.java
+++ /dev/null
@@ -1,94 +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.
- *
- */
-package org.apache.qpid.management.ui.actions;
-
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.apache.qpid.management.ui.Constants;
-import org.apache.qpid.management.ui.jmx.MBeanUtility;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.IWorkbenchWindow;
-
-public class VersionAction extends Action
-{
- private IWorkbenchWindow _window;
- public static final String VERSION_RESOURCE = "qpidversion.properties";
-
- public static final String PRODUCT_NAME_PROPERTY = "qpid.name";
- public static final String RELEASE_VERSION_PROPERTY = "qpid.version";
- public static final String BUILD_VERSION_PROPERTY = "qpid.svnversion";
-
- private static final String DEFAULT = "unknown";
- private static String _releaseVersion;
- private static String _buildVersion;
- private static String _text;
-
- static
- {
- Properties props = new Properties();
- try
- {
- InputStream propertyStream = VersionAction.class.getClassLoader().getResourceAsStream(VERSION_RESOURCE);
- if (propertyStream != null)
- {
- props.load(propertyStream);
- _releaseVersion = readPropertyValue(props, RELEASE_VERSION_PROPERTY);
- _buildVersion = readPropertyValue(props, BUILD_VERSION_PROPERTY);
- _text = "Build Version : " + _buildVersion + "\n" +
- "Release Version : " + _releaseVersion;
- }
- else
- {
- _text = "Build Version : \n" +
- "Release Version : ";
- }
- }
- catch (Exception ex)
- {
- MBeanUtility.printStackTrace(ex);
- }
- }
-
- public VersionAction(IWorkbenchWindow window)
- {
- _window = window;
- setText("About " + Constants.APPLICATION_NAME);
- setId("qpidmc.about");
- setActionDefinitionId("qpidmc.about");
- }
-
- private static String readPropertyValue(Properties props, String propertyName)
- {
- String retVal = (String) props.get(propertyName);
- if (retVal == null)
- {
- retVal = DEFAULT;
- }
- return retVal;
- }
-
- public void run()
- {
- MessageDialog.openInformation(_window.getShell(), Constants.APPLICATION_NAME, _text);
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/InfoRequiredException.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/InfoRequiredException.java
deleted file mode 100644
index 672426a59d..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/InfoRequiredException.java
+++ /dev/null
@@ -1,36 +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.
- *
- */
-package org.apache.qpid.management.ui.exceptions;
-
-public class InfoRequiredException extends Exception
-{
- private static final long serialVersionUID = 1L;
-
- public InfoRequiredException(String message)
- {
- super(message);
- }
-
- public InfoRequiredException(String msg, Throwable t)
- {
- super(msg, t);
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/ManagementConsoleException.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/ManagementConsoleException.java
deleted file mode 100644
index 17c127c01a..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/ManagementConsoleException.java
+++ /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.
- *
- */
-
-package org.apache.qpid.management.ui.exceptions;
-
-@SuppressWarnings("serial")
-public class ManagementConsoleException extends Exception
-{
- public ManagementConsoleException(String message)
- {
- super(message);
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java
deleted file mode 100644
index 2be0ddbebf..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java
+++ /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.
- *
- */package org.apache.qpid.management.ui.jmx;
-
-import javax.management.MBeanServerNotification;
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnectionNotification;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ManagedServer;
-
-
-public class ClientListener implements NotificationListener
-{
- protected ManagedServer server = null;
- protected JMXServerRegistry serverRegistry = null;
-
- public ClientListener(ManagedServer server)
- {
- this.server = server;
- serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(server);
- }
-
- public void handleNotification(Notification notification, Object handback)
- {
- ObjectName objName = null;
- String type = notification.getType();
- MBeanUtility.printOutput(type + ":" + objName);
-
- if (MBeanServerNotification.REGISTRATION_NOTIFICATION.equals(type))
- {
- objName = ((MBeanServerNotification)notification).getMBeanName();
- getServerRegistry().registerManagedObject(objName);
- }
- else if (MBeanServerNotification.UNREGISTRATION_NOTIFICATION.equals(type))
- {
- objName = ((MBeanServerNotification)notification).getMBeanName();
- getServerRegistry().unregisterManagedObject(objName);
- }
- else if (JMXConnectionNotification.FAILED.equals(type))
- {
- ApplicationRegistry.serverConnectionClosed(server);
- }
- }
-
- protected JMXServerRegistry getServerRegistry()
- {
- if (serverRegistry == null)
- serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(server);
-
- return serverRegistry;
- }
- public ManagedServer getServer()
- {
- return server;
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientNotificationListener.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientNotificationListener.java
deleted file mode 100644
index c6ecda4b4c..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientNotificationListener.java
+++ /dev/null
@@ -1,41 +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.
- *
- */
-package org.apache.qpid.management.ui.jmx;
-
-import javax.management.Notification;
-import javax.management.ObjectName;
-
-import org.apache.qpid.management.ui.ManagedServer;
-
-public class ClientNotificationListener extends ClientListener
-{
- public ClientNotificationListener(ManagedServer server)
- {
- super(server);
- }
-
- public void handleNotification(Notification notification, Object handback)
- {
- ObjectName objName = (ObjectName)notification.getSource();
- //String type = notification.getType();
- getServerRegistry().addNotification(objName, notification);
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXManagedObject.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXManagedObject.java
deleted file mode 100644
index 3561e16098..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXManagedObject.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.jmx;
-
-import java.util.HashMap;
-
-import javax.management.ObjectName;
-
-import org.apache.qpid.management.ui.ManagedBean;
-
-
-public class JMXManagedObject extends ManagedBean
-{
- private ObjectName _objName;
-
- @SuppressWarnings("unchecked")
- public JMXManagedObject(ObjectName objName)
- {
- super();
- this._objName = objName;
- setUniqueName(_objName.toString());
- setDomain(_objName.getDomain());
- super.setProperties(new HashMap(_objName.getKeyPropertyList()));
- }
-
- public ObjectName getObjectName()
- {
- return _objName;
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
deleted file mode 100644
index b27661e56c..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
+++ /dev/null
@@ -1,714 +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.
- *
- */
-package org.apache.qpid.management.ui.jmx;
-
-import static org.apache.qpid.management.ui.Constants.*;
-
-import java.io.IOException;
-import java.security.Security;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanServerConnection;
-import javax.management.Notification;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.sasl.SaslClientFactory;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.ManagedServer;
-import org.apache.qpid.management.ui.ServerRegistry;
-import org.apache.qpid.management.ui.model.ManagedAttributeModel;
-import org.apache.qpid.management.ui.model.NotificationInfoModel;
-import org.apache.qpid.management.ui.model.NotificationObject;
-import org.apache.qpid.management.ui.model.OperationDataModel;
-import org.apache.qpid.management.ui.sasl.JCAProvider;
-import org.apache.qpid.management.ui.sasl.SaslProvider;
-import org.apache.qpid.management.ui.sasl.UserPasswordCallbackHandler;
-import org.apache.qpid.management.ui.sasl.UsernameHashedPasswordCallbackHandler;
-
-
-public class JMXServerRegistry extends ServerRegistry
-{
- private boolean _connected = false;
- private ObjectName _serverObjectName = null;
- private Map<String, Object> _env = null;
- private JMXServiceURL _jmxUrl = null;
- private JMXConnector _jmxc = null;
- private MBeanServerConnection _mbsc = null;
- private Exception _connectionException = null;
- private String _securityMechanism = null;
-
- private List<String> _usersList;
- // When an mbean gets removed from mbean server, then the notification listener
- // will add that mbean in this list.
- private List<ManagedBean> _mbeansToBeRemoved = new ArrayList<ManagedBean>();
-
- // Map containing all managed beans and mapped with unique mbean name
- private HashMap<String, ManagedBean> _mbeansMap = new HashMap<String, ManagedBean>();
- // Map containing MBeanInfo for all mbeans and mapped with unique mbean name
- private HashMap<String, MBeanInfo> _mbeanInfoMap = new HashMap<String, MBeanInfo>();
- // Map containing attribute model for all mbeans and mapped with unique mbean name
- private HashMap<String, ManagedAttributeModel> _attributeModelMap = new HashMap<String, ManagedAttributeModel>();
- // Map containing operation model for all mbeans and mapped with unique mbean name
- private HashMap<String, OperationDataModel> _operationModelMap = new HashMap<String, OperationDataModel>();
- // Map containing NotificationInfo for all mbeans and mapped with unique mbean name
- private HashMap<String, List<NotificationInfoModel>> _notificationInfoMap = new HashMap<String, List<NotificationInfoModel>>();
- // Map containing all notifications sent for all mbeans, which are registered for notification
- private HashMap<String, List<NotificationObject>> _notificationsMap = new HashMap<String, List<NotificationObject>>();
- // For mbeans which have subscribed for a notification type
- // mbean unique name mapped with notification map. Notification map contains list of notification type
- // mapped with notification name. Notification type list contains those notification types,
- // which are subscribed for notification.
- private HashMap<String, HashMap<String, List<String>>> _subscribedNotificationMap = new HashMap<String, HashMap<String, List<String>>>();
-
- // listener for registration or unregistratioj of mbeans on mbean server
- private ClientNotificationListener _notificationListener = null;
- // listener for server connection. Receives notification if server connection goes down
- private ClientListener _clientListener = null;
-
- public JMXServerRegistry(ManagedServer server) throws Exception
- {
- super(server);
-
- long timeNow;
-
- //auto-negotiate an RMI or JMXMP (SASL/CRAM-MD5 or SASL/PLAIN) JMX connection to broker
- try
- {
- timeNow = System.currentTimeMillis();
- createJMXconnector("RMI");
- }
- catch (IOException rmiIOE)
- {
- // check if the ioe was raised because we tried connecting to a non RMI-JRMP based JMX server
- boolean jrmpServer = !rmiIOE.getMessage().contains("non-JRMP server at remote endpoint");
-
- if (jrmpServer)
- {
- IOException nioe = new IOException();
- nioe.initCause(rmiIOE);
- throw nioe;
- }
- else
- {
- try
- {
- //It wasnt an RMI ConnectorServer at the broker end. Try to establish a JMXMP SASL/CRAM-MD5 connection instead.
- timeNow = System.currentTimeMillis();
- createJMXconnector("JMXMP_CRAM-MD5");
- }
- catch (IOException cramIOE)
- {
- // check if the IOE was raised because we tried connecting to a SASL/PLAIN server using SASL/CRAM-MD5
- boolean plainProfileServer = cramIOE.getMessage().contains("The server supported profiles [SASL/PLAIN]" +
- " do not match the client required profiles [SASL/CRAM-MD5]");
-
- if (!plainProfileServer)
- {
- IOException nioe = new IOException();
- nioe.initCause(cramIOE);
- throw nioe;
- }
- else
- {
- try
- {
- // Try to establish a JMXMP SASL/PLAIN connection instead.
- timeNow = System.currentTimeMillis();
- createJMXconnector("JMXMP_PLAIN");
- }
- catch (IOException plainIOE)
- {
- /* Out of options now. Check that the IOE was raised because we tried connecting to a server
- * which didnt support SASL/PLAIN. If so, signal an unknown profile type. If not, raise the exception. */
- boolean unknownProfile = cramIOE.getMessage().contains("do not match the client required profiles [SASL/PLAIN]");
-
- if (unknownProfile)
- {
- throw new Exception("Unknown JMXMP authentication mechanism, unable to connect.");
- }
- else
- {
- IOException nioe = new IOException();
- nioe.initCause(plainIOE);
- throw nioe;
- }
- }
- }
- }
- }
- }
-
- if (_connected)
- {
- _mbsc = _jmxc.getMBeanServerConnection();
-
- _clientListener = new ClientListener(server);
- _notificationListener = new ClientNotificationListener(server);
-
- _jmxc.addConnectionNotificationListener(_clientListener, null, null);
- _serverObjectName = new ObjectName("JMImplementation:type=MBeanServerDelegate");
- _mbsc.addNotificationListener(_serverObjectName, _clientListener, null, null);
- }
- else
- {
- if (System.currentTimeMillis() - timeNow >= ApplicationRegistry.timeout)
- throw new Exception("Qpid server connection timed out");
- else
- throw new Exception("Qpid server connection failed");
- }
- }
-
- public MBeanServerConnection getServerConnection()
- {
- return _mbsc;
- }
-
- private void createJMXconnector(String connectionType) throws IOException, Exception
- {
- if (connectionType == "RMI")
- {
- _securityMechanism = MECH_PLAIN;
-
- _jmxUrl = new JMXServiceURL(getManagedServer().getUrl());
- _env = null;
- }
- else if (connectionType.contains("JMXMP"))
- {
- // Check that the JMXMPConnector is available to provide SASL support
- final String jmxmpcClass = "javax.management.remote.jmxmp.JMXMPConnector";
-
- try
- {
- Class.forName(jmxmpcClass, false, this.getClass().getClassLoader());
- }
- catch (ClassNotFoundException cnfe)
- {
- throw new Exception("JMXMPConnector class not found, unable to connect to specified server.\n\n"
- + "Please add the jmxremote_optional.jar to the jmxremote.sasl plugin folder, or the classpath.");
- }
-
- _jmxUrl = new JMXServiceURL("jmxmp", getManagedServer().getHost(), getManagedServer().getPort());
- _env = new HashMap<String, Object>();
-
- /* set the package in which to find the JMXMP ClientProvider.class file loaded by the
- * jmxremote.sasl plugin (from the jmxremote_optional.jar) */
- _env.put("jmx.remote.protocol.provider.pkgs", "com.sun.jmx.remote.protocol");
-
- if (connectionType == "JMXMP_CRAM-MD5")
- {
- _securityMechanism = MECH_CRAMMD5;
-
- Map<String, Class<? extends SaslClientFactory>> map = new HashMap<String, Class<? extends SaslClientFactory>>();
- Class<?> clazz = Class.forName("org.apache.qpid.management.ui.sasl.CRAMMD5HashedSaslClientFactory");
- map.put("CRAM-MD5-HASHED", (Class<? extends SaslClientFactory>) clazz);
- Security.addProvider(new JCAProvider(map));
-
- CallbackHandler handler = new UsernameHashedPasswordCallbackHandler(
- getManagedServer().getUser(),
- getManagedServer().getPassword());
- _env.put("jmx.remote.profiles", SASL_CRAMMD5);
- _env.put("jmx.remote.sasl.callback.handler", handler);
- }
- else if (connectionType == "JMXMP_PLAIN")
- {
- _securityMechanism = MECH_PLAIN;
-
- Security.addProvider(new SaslProvider());
- CallbackHandler handler = new UserPasswordCallbackHandler(getManagedServer().getUser(), getManagedServer().getPassword());
- _env.put("jmx.remote.profiles", SASL_PLAIN);
- _env.put("jmx.remote.sasl.callback.handler", handler);
- }
- else
- {
- throw new Exception("Unknown authentication mechanism");
- }
- }
- else
- {
- throw new Exception("Unknown connection type");
- }
-
- Thread connectorThread = new Thread(new ConnectorThread());
- connectorThread.start();
- connectorThread.join(ApplicationRegistry.timeout);
-
- if (_connectionException != null)
- {
- throw _connectionException;
- }
- }
-
- public String getSecurityMechanism()
- {
- return _securityMechanism;
- }
-
- private class ConnectorThread implements Runnable
- {
- public void run()
- {
- try
- {
- _connected = false;
- _connectionException = null;
-
- _jmxc = JMXConnectorFactory.connect(_jmxUrl, _env);
-
- _connected = true;
- }
- catch (Exception ex)
- {
- _connectionException = ex;
- }
- }
- }
-
- /**
- * removes all listeners from the mbean server. This is required when user
- * disconnects the Qpid server connection
- */
- public void closeServerConnection() throws Exception
- {
- try
- {
- if (_jmxc != null && _clientListener != null)
- _jmxc.removeConnectionNotificationListener(_clientListener);
-
- if (_mbsc != null && _clientListener != null)
- _mbsc.removeNotificationListener(_serverObjectName, _clientListener);
-
- // remove mbean notification listeners
- for (String mbeanName : _subscribedNotificationMap.keySet())
- {
- _mbsc.removeNotificationListener(new ObjectName(mbeanName), _notificationListener);
- }
- }
- catch (ListenerNotFoundException ex)
- {
- MBeanUtility.printOutput(ex.toString());
- }
- }
-
- public ManagedBean getManagedObject(String uniqueName)
- {
- return _mbeansMap.get(uniqueName);
- }
-
- public void addManagedObject(ManagedBean mbean)
- {
- if (mbean.isQueue())
- {
- addQueueMBean(mbean);
- }
- else if (mbean.isExchange())
- {
- addExchangeMBean(mbean);
- }
- else if (mbean.isConnection())
- {
- addConnectionMBean(mbean);
- }
-
- addVirtualHost(mbean.getVirtualHostName());
- _mbeansMap.put(mbean.getUniqueName(), mbean);
- }
-
- public void removeManagedObject(ManagedBean mbean)
- {
- MBeanUtility.printOutput("Removing MBean:" + mbean.getUniqueName());
-
- if (mbean.isQueue())
- {
- removeQueueMBean(mbean);
- }
- else if (mbean.isExchange())
- {
- removeExchangeMBean(mbean);
- }
- else if (mbean.isConnection())
- {
- removeConnectionMBean(mbean);
- }
-
- _mbeansMap.remove(mbean.getUniqueName());
- }
-
- public void putMBeanInfo(ManagedBean mbean, MBeanInfo mbeanInfo)
- {
- _mbeanInfoMap.put(mbean.getUniqueName(), mbeanInfo);
- }
- public MBeanInfo getMBeanInfo(ManagedBean mbean)
- {
- return _mbeanInfoMap.get(mbean.getUniqueName());
- }
-
- public List<ManagedBean> getMBeans()
- {
- return new ArrayList<ManagedBean>(_mbeansMap.values());
- }
-
- public void setNotificationInfo(ManagedBean mbean, List<NotificationInfoModel>value)
- {
- _notificationInfoMap.put(mbean.getUniqueName(), value);
- }
-
- public List<NotificationInfoModel> getNotificationInfo(ManagedBean mbean)
- {
- return _notificationInfoMap.get(mbean.getUniqueName());
- }
-
- public void addNotification(ObjectName objName, Notification notification)
- {
- List<NotificationObject> list = _notificationsMap.get(objName.toString());
- NotificationObject obj = new NotificationObject(notification.getSequenceNumber(),
- new Date(notification.getTimeStamp()),
- notification.getMessage(),
- notification.getSource(),
- notification.getType());
-
- if (list == null)
- {
- list = new ArrayList<NotificationObject>();
- _notificationsMap.put(objName.toString(), list);
- }
-
- list.add(obj);
- }
-
- /**
- * Returns all the notification objects for a given mbean. If mbean is null, it returns
- * notification objects for all the mbeans.
- */
- public List<NotificationObject> getNotifications(ManagedBean mbean)
- {
- if (mbean == null)
- {
- List<NotificationObject> totalList = new ArrayList<NotificationObject>();
- for (List<NotificationObject> list : _notificationsMap.values())
- {
- totalList.addAll(list);
- }
- return totalList;
- }
- else
- {
- return _notificationsMap.get(mbean.getUniqueName());
- }
- }
-
- public void clearNotifications(ManagedBean mbean, List<NotificationObject> list)
- {
- if (mbean == null)
- {
- if (list == null || list.isEmpty())
- {
- // All notifications of all mbeans to be cleared
- _notificationsMap.clear();
- }
- else
- {
- // Clear the selected notifications
- for (NotificationObject obj : list)
- {
- mbean = _mbeansMap.get(obj.getSource().toString());
- List<NotificationObject> nList = _notificationsMap.get(mbean.getUniqueName());
- if (nList != null && !nList.isEmpty())
- {
- nList.remove(obj);
- }
- }
- }
- }
- else
- {
- if (list == null || list.isEmpty())
- {
- // All notifications of this mbean to be cleared
- List<NotificationObject> nList = _notificationsMap.get(mbean.getUniqueName());
- if (nList != null && !nList.isEmpty())
- {
- nList.clear();
- }
- }
- else
- {
- // Clear the selected notifications
- for (NotificationObject obj : list)
- {
- List<NotificationObject> nList = _notificationsMap.get(mbean.getUniqueName());
- if (nList != null && !nList.isEmpty())
- {
- nList.remove(obj);
- }
- }
- }
- }
- }
-
-
-
- /**
- * Adds notification name and type to the map. The map contains all the notification names,
- * subscribed for an mbean.
- * @param mbean
- * @param name
- * @param type
- */
- public void addNotificationListener(ManagedBean mbean, String name, String type)
- {
- // Get the subscribed notifications map for given mbean. If map is null then create a new one.
- HashMap<String, List<String>> map = _subscribedNotificationMap.get(mbean.getUniqueName());
- if (map == null)
- {
- map = new HashMap<String, List<String>>();
- _subscribedNotificationMap.put(mbean.getUniqueName(),map);
- }
-
- // Get the list of notification types for given notification name. If null, then create a new list.
- List<String> list = map.get(name);
- if (list == null)
- {
- list = new ArrayList<String>();
- map.put(name, list);
- }
- // Now add the notification type to the list
- if (ALL.equals(type))
- {
- List<NotificationInfoModel> infoList = _notificationInfoMap.get(mbean.getUniqueName());
- for (NotificationInfoModel model : infoList)
- {
- if (model.getName().equals(name))
- {
- String[] types = model.getTypes();
- for (int i = 0; i < types.length; i++)
- {
- list.add(types[i]);
- }
- }
- }
- }
- else
- {
- list.add(type);
- }
-
- //System.out.println("Subscribed for notification :" + mbean.getUniqueName());
- }
-
- /**
- * Checks if the given notification name and type are subscribed for the mbean.
- */
- public boolean hasSubscribedForNotifications(ManagedBean mbean, String name, String type)
- {
- if (_subscribedNotificationMap.containsKey(mbean.getUniqueName()))
- {
- HashMap<String, List<String>> map = _subscribedNotificationMap.get(mbean.getUniqueName());
- if (map.containsKey(name))
- {
- if (map.get(name).contains(type))
- {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Clears the notification name and type information from the subscribed notifications map
- * and removes the listener from mbeanserver connection
- * @param mbean
- * @param name
- * @param type
- * @throws Exception
- */
- public void removeNotificationListener(ManagedBean mbean, String name, String type) throws Exception
- {
- //System.out.println("Removed notification listener :" + mbean.getUniqueName() + name +type);
- if (_subscribedNotificationMap.containsKey(mbean.getUniqueName()))
- {
- // get the notifications map. This map contains the notification name mapped with the notification types
- HashMap<String, List<String>> map = _subscribedNotificationMap.get(mbean.getUniqueName());
- if (map.containsKey(name))
- {
- if (ALL.equals(type))
- {
- map.remove(name);
- }
- else if (type != null)
- {
- map.get(name).remove(type);
- if (map.get(name).isEmpty())
- {
- map.remove(name);
- }
- }
- }
- if (map.size() == 0)
- {
- _subscribedNotificationMap.remove(mbean.getUniqueName());
- }
-
- JMXManagedObject jmxbean = (JMXManagedObject)mbean;
- _mbsc.removeNotificationListener(jmxbean.getObjectName(), _notificationListener);
- }
- }
-
- /**
- * When the mbean registration request is received from the mbean server, then the client listener
- * can use this method. It will add the mbean to a list, which will be used to add the mbean to
- * the registry and gui
- * @param objName
- */
- public void registerManagedObject(ObjectName objName)
- {
- JMXManagedObject managedObject = new JMXManagedObject(objName);
- managedObject.setServer(getManagedServer());
- addManagedObject(managedObject);
- }
-
- /**
- * When mbean unregistration notification is received from the mbean server, then client listener
- * can invoke this method. It will add the mbean to the list of mbeans to be removed from registry
- * @param objName
- */
- public void unregisterManagedObject(ObjectName objName)
- {
- ManagedBean mbean = _mbeansMap.get(objName.toString());
- removeManagedObject(mbean);
- // Check if mbean was not available in the map. It can happen if mbean unregistration
- // notification is received and the mbean is not added in the map.
- if (mbean != null)
- {
- _mbeansToBeRemoved.add(mbean);
- }
- }
-
- public List<ManagedBean> getObjectsToBeRemoved()
- {
- if (_mbeansToBeRemoved.isEmpty())
- return null;
- else
- {
- List<ManagedBean> list = new CopyOnWriteArrayList<ManagedBean>(_mbeansToBeRemoved);
- _mbeansToBeRemoved.clear();
- return list;
- }
- }
-
- public void setAttributeModel(ManagedBean mbean, ManagedAttributeModel value)
- {
- _attributeModelMap.put(mbean.getUniqueName(), value);
- }
-
- public ManagedAttributeModel getAttributeModel(ManagedBean mbean)
- {
- return _attributeModelMap.get(mbean.getUniqueName());
- }
-
- public void setOperationModel(ManagedBean mbean, OperationDataModel value)
- {
- _operationModelMap.put(mbean.getUniqueName(), value);
- }
-
- public OperationDataModel getOperationModel(ManagedBean mbean)
- {
- return _operationModelMap.get(mbean.getUniqueName());
- }
-
- public List<String> getQueueNames(String virtualHostName)
- {
- List<ManagedBean> list = getQueues(virtualHostName);
- if (list == null)
- return null;
-
- List<String> queueNames = new ArrayList<String>();
- for (ManagedBean mbean : list)
- {
- queueNames.add(mbean.getName());
- }
- return queueNames;
- }
-
- public String[] getExchangeNames(String virtualHostName)
- {
- List<ManagedBean> list = getExchanges(virtualHostName);
- if (list == null)
- return null;
-
- String[] exchanges = new String[list.size()];
- int i = 0;
- for (ManagedBean mbean : list)
- {
- exchanges[i++] = mbean.getName();
- }
- return exchanges;
- }
-
- public String[] getConnectionNames(String virtualHostName)
- {
- List<ManagedBean> list = getExchanges(virtualHostName);
- if (list == null)
- return null;
-
- String[] connections = new String[list.size()];
- int i = 0;
- for (ManagedBean mbean : list)
- {
- connections[i++] = mbean.getName();
- }
- return connections;
- }
-
- public void setUserList(List<String> list)
- {
- _usersList = list;
- Collections.sort(_usersList);
- }
-
- public List<String> getUsernames()
- {
- return _usersList;
- }
-
- public ClientNotificationListener getNotificationListener()
- {
- return _notificationListener;
- }
-
- public ClientListener getClientListener()
- {
- return _clientListener;
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
deleted file mode 100644
index 2d1883533b..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
+++ /dev/null
@@ -1,466 +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.
- *
- */
-package org.apache.qpid.management.ui.jmx;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.InstanceNotFoundException;
-import javax.management.JMException;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanNotificationInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.ManagedServer;
-import org.apache.qpid.management.ui.exceptions.ManagementConsoleException;
-import org.apache.qpid.management.ui.model.AttributeData;
-import org.apache.qpid.management.ui.model.ManagedAttributeModel;
-import org.apache.qpid.management.ui.model.NotificationInfoModel;
-import org.apache.qpid.management.ui.model.OperationData;
-import org.apache.qpid.management.ui.model.OperationDataModel;
-import org.apache.qpid.management.ui.model.ParameterData;
-import org.apache.qpid.management.ui.views.ViewUtility;
-
-/**
- * Utility class for all mbeanserver related operations. Keeps all JMX code out from view and model classes
- * @author Bhupendra Bhardwaj
- */
-public class MBeanUtility
-{
- public static final BigInteger MAX_LONG = BigInteger.valueOf(Long.MAX_VALUE);
- public static final BigInteger MAX_INT = BigInteger.valueOf(Integer.MAX_VALUE);
- /**
- * Retrieves the MBeanInfo from MBeanServer and stores in the application registry
- * @param mbean managed bean
- * @return MBeanInfo
- * @throws Exception, if server connection is null or if server throws Exception
- */
- public static MBeanInfo getMBeanInfo(ManagedBean mbean) throws Exception
- {
- ManagedServer server = mbean.getServer();
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(server);
-
- MBeanServerConnection mbsc = serverRegistry.getServerConnection();
- if (mbsc == null)
- {
- throw new ManagementConsoleException("Server connection is broken");
- }
-
- JMXManagedObject jmxbean = (JMXManagedObject)mbean;
- MBeanInfo mbeanInfo = mbsc.getMBeanInfo(jmxbean.getObjectName());
- serverRegistry.putMBeanInfo(mbean, mbeanInfo);
-
- // populate the server registry with attribute and operation info
- getAttributes(mbean);
- getOperations(mbean);
-
- return mbeanInfo;
- }
-
- /**
- * executes the MBean operation
- * @param mbean
- * @param opData
- * @return MBean operation return value
- * @throws Exception if server connection is broken or if operation execution fails on the mbean server
- */
- public static Object execute(ManagedBean mbean, OperationData opData) throws Exception
- {
- String opName = opData.getName();
- Object[] values = null;
- String[] signature = null;
-
- List<ParameterData> params = opData.getParameters();
- if (params != null && !params.isEmpty())
- {
- signature = new String[params.size()];;
- values = new Object[params.size()];
- for (int i = 0; i < params.size(); i++)
- {
- signature[i] = params.get(i).getType();
- values[i] = params.get(i).getValue();
- }
- }
-
- ManagedServer server = mbean.getServer();
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(server);
-
- MBeanServerConnection mbsc = serverRegistry.getServerConnection();
- if (mbsc == null)
- {
- throw new ManagementConsoleException("Server connection is broken");
- // TODO
- // try and get the connection again if it was disconnected
- }
- JMXManagedObject jmxbean = (JMXManagedObject)mbean;
- return mbsc.invoke(jmxbean.getObjectName(), opName, values, signature);
- }
-
- /**
- * @see MBeanUtility#handleException(ManagedBean, Exception)
- */
- public static void handleException(Exception ex)
- {
- handleException(null, ex);
- }
-
- /**
- * handels the exception received. Shows the exception to the user in best suitable way
- * @param mbean managed bean
- * @param ex Exception
- */
- public static void handleException(ManagedBean mbean, Throwable ex)
- {
- if (mbean == null)
- {
- ViewUtility.popupErrorMessage("Error", "Managed Object is null \n" + ex.toString());
- printStackTrace(ex);
- }
- else if (ex instanceof ReflectionException)
- {
- ViewUtility.popupErrorMessage(mbean.getInstanceName(), "Server has thrown error \n" + ex.toString());
- printStackTrace(ex);
- }
- else if (ex instanceof InstanceNotFoundException)
- {
- ViewUtility.popupErrorMessage(mbean.getInstanceName(), "Managed Object Not Found \n" + ex.toString());
- printStackTrace(ex);
- }
- else if (ex instanceof MBeanException)
- {
- String cause = ((MBeanException)ex).getTargetException().getMessage();
- if (cause == null)
- cause = ex.toString();
- ViewUtility.popupInfoMessage(mbean.getInstanceName(), cause);
- }
- else if (ex instanceof JMException)
- {
- ViewUtility.popupErrorMessage(mbean.getInstanceName(), "Management Exception occured \n" + ex.toString());
- }
- else if (ex instanceof ManagementConsoleException)
- {
- ViewUtility.popupErrorMessage(mbean.getInstanceName(), ex.getMessage());
- }
- else
- {
- if (ex.getCause() != null)
- {
- handleException(mbean, ex.getCause());
- }
- else
- {
- String msg = ex.getMessage();
- if (msg == null)
- {
- msg = ex.toString();
- }
- ViewUtility.popupErrorMessage(mbean.getInstanceName(), msg);
- printStackTrace(ex);
- }
- }
-
- }
-
- /**
- * Registers the notification listener with the MBeanServer
- * @param mbean managed bean
- * @param name notification name
- * @param type notification type
- * @throws Exception if server connection is broken or if listener could not be created
- */
- public static void createNotificationlistener(ManagedBean mbean, String name, String type)
- throws Exception
- {
- JMXManagedObject jmxbean = (JMXManagedObject)mbean;
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
- serverRegistry.addNotificationListener(mbean, name, type);
- MBeanServerConnection mbsc = serverRegistry.getServerConnection();
-
- if (mbsc == null)
- {
- throw new ManagementConsoleException("Server connection is broken");
- }
- mbsc.addNotificationListener(jmxbean.getObjectName(), serverRegistry.getNotificationListener(), null, null);
- }
-
- public static void removeNotificationListener(ManagedBean mbean, String name, String type) throws Exception
- {
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
- serverRegistry.removeNotificationListener(mbean, name, type);
- }
-
- /**
- * Checks if the server registry contains attribute information for this mbean. If not then it queries the
- * mbean server for complete mbean information, else it gets the latest value of the given attribute
- * from mbean server.
- * @return attribute data for the given mbean attribute
- */
- public static AttributeData getAttributeData(ManagedBean mbean, String attribute) throws Exception
- {
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
- ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
- if (attributeModel == null)
- {
- // If process is here, it means the mbeanInfo is not retrieved from mbean server even once for this mbean
- getMBeanInfo(mbean);
- }
- else
- {
- // refresh attribute value from mbean server
- refreshAttribute(mbean, attribute);
- }
- attributeModel = serverRegistry.getAttributeModel(mbean);
- return attributeModel.getAttribute(attribute);
- }
-
- /**
- * Retrieves the latest attribute value from mbean server for the given mbean attribute
- * and also sets that value in the attribute model in the server registry
- * @return latest attribute value for the given mbean attribute
- */
- public static Object refreshAttribute(ManagedBean mbean, String attribute) throws Exception
- {
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
- MBeanServerConnection mbsc = serverRegistry.getServerConnection();
-
- if (mbsc == null)
- {
- throw new ManagementConsoleException("Server connection is broken");
- }
-
- Object value = mbsc.getAttribute(((JMXManagedObject)mbean).getObjectName(), attribute);
- // update the attribute data in server registry for this attribute
- ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
- attributeModel.setAttributeValue(attribute, value);
- return value;
- }
-
- /**
- * Retrieves the attribute values from MBeanSever and stores in the server registry.
- * @param mbean
- * @return the attribute model
- * @throws Exception if attributes can not be retrieved from MBeanServer
- */
- public static ManagedAttributeModel getAttributes(ManagedBean mbean) throws Exception
- {
- ObjectName objName = ((JMXManagedObject)mbean).getObjectName();
- String[] attributes = null;
- AttributeList list = null;
-
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
- MBeanServerConnection mbsc = serverRegistry.getServerConnection();
- MBeanAttributeInfo[] attributesInfo = null;
- ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
-
- if (attributeModel == null)
- {
- // If the process is here, then it means the attribute values are not retrieved from mbean server
- // even once for this mbean. Create attribute model, retrieve values from mbean server and
- // set the attribute model in server registry for this mbean
- attributeModel = new ManagedAttributeModel();
- attributesInfo = serverRegistry.getMBeanInfo(mbean).getAttributes();
- attributes = new String[attributesInfo.length];
- for (int i = 0; i< attributesInfo.length ; i++)
- {
- attributes[i] = attributesInfo[i].getName();
- attributeModel.setAttributeDescription(attributes[i], attributesInfo[i].getDescription());
- attributeModel.setAttributeWritable(attributes[i], attributesInfo[i].isWritable());
- attributeModel.setAttributeReadable(attributes[i], attributesInfo[i].isReadable());
- }
- }
- else
- {
- attributes = attributeModel.getAttributeNames().toArray(new String[0]);
- }
-
- if (attributes.length != 0)
- {
- list = mbsc.getAttributes(objName, attributes);
- for (Iterator itr = list.iterator(); itr.hasNext();)
- {
- Attribute attrib = (Attribute)itr.next();
- attributeModel.setAttributeValue(attrib.getName(), attrib.getValue());
- }
- }
-
- serverRegistry.setAttributeModel(mbean, attributeModel);
- return attributeModel;
- }
-
- /**
- * Updates the attribute value of an MBean
- * @param mbean
- * @param attribute
- * @param value
- * @throws Exception if MBeanServer throws exception in updating the attribute value
- */
- public static void updateAttribute(ManagedBean mbean, AttributeData attribute, String value) throws Exception
- {
- JMXManagedObject jmxbean = (JMXManagedObject)mbean;
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
-
- MBeanServerConnection mbsc = serverRegistry.getServerConnection();
-
- Object newValue = value;
- if (attribute.getDataType().equals(Long.class.getName()))
- {
- if (MAX_LONG.compareTo(new BigInteger(value)) == -1)
- {
- throw new ManagementConsoleException("Entered value is too big for \"" +
- ViewUtility.getDisplayText(attribute.getName()) + "\"");
- }
- newValue = new Long(Long.parseLong(value));
- }
- else if (attribute.getDataType().equals(Integer.class.getName()))
- {
- if (MAX_INT.compareTo(new BigInteger(value)) == -1)
- {
- throw new ManagementConsoleException("Entered value is too big for " + attribute.getName());
- }
- newValue = new Integer(Integer.parseInt(value));
- }
-
- mbsc.setAttribute(jmxbean.getObjectName(), new Attribute(attribute.getName(), newValue));
- // Update the value in the registry, to avoid refreshing from mbsc
- ManagedAttributeModel attributeModel = serverRegistry.getAttributeModel(mbean);
- attributeModel.setAttributeValue(attribute.getName(), newValue);
- }
-
- /**
- * populates the operation data model in server registry for given mbean
- * @param mbean
- * @return operation data model
- */
- public static OperationDataModel getOperations(ManagedBean mbean)
- {
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
- OperationDataModel dataModel = serverRegistry.getOperationModel(mbean);
- if (dataModel == null)
- {
- // Create operation model and set it in server registry for this mbean
- MBeanOperationInfo[] operationsInfo = serverRegistry.getMBeanInfo(mbean).getOperations();
- dataModel = new OperationDataModel();
-
- for (int i = 0; i < operationsInfo.length; i++)
- {
- dataModel.addOperation(operationsInfo[i]);
- }
-
- serverRegistry.setOperationModel(mbean, dataModel);
- }
- return dataModel;
- }
-
- /**
- * populates the notification in the server registry for given mbean
- * @param mbean
- * @return notification info model
- */
- public static NotificationInfoModel[] getNotificationInfo(ManagedBean mbean)
- {
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(mbean);
- MBeanNotificationInfo[] info = serverRegistry.getMBeanInfo(mbean).getNotifications();
-
- // Check if this mbean sends any notification
- if (info == null || info.length == 0)
- return null;
-
- // Create notification model if not already set in the server registry for this mbean
- List<NotificationInfoModel> list = serverRegistry.getNotificationInfo(mbean);
- if (list != null)
- return list.toArray(new NotificationInfoModel[0]);
- else
- list = new ArrayList<NotificationInfoModel>();
-
- for (int i = 0; i < info.length; i++)
- {
- list.add(new NotificationInfoModel(info[i].getName(), info[i].getDescription(), info[i].getNotifTypes()));
- }
-
- // Set the notification model in the server registry for this mbean
- serverRegistry.setNotificationInfo(mbean, list);
- return list.toArray(new NotificationInfoModel[0]);
- }
-
- /**
- * Retrieves all the MBeans from mbean server for a given domain
- * @return list of ManagedBeans
- */
- public static List<ManagedBean> getManagedObjectsForDomain(ManagedServer server, String domain) throws Exception
- {
- List<ManagedBean> mbeans = new ArrayList<ManagedBean>();
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(server);
- MBeanServerConnection mbsc = serverRegistry.getServerConnection();
- ObjectName objName = new ObjectName(domain + ":*");
- Set objectInstances = mbsc.queryMBeans(objName, null);
-
- for (Iterator itr = objectInstances.iterator(); itr.hasNext();)
- {
- ObjectInstance instance = (ObjectInstance)itr.next();
- ManagedBean obj = new JMXManagedObject(instance.getObjectName());
- mbeans.add(obj);
- }
-
- return mbeans;
- }
-
- /**
- * Returns all the domains for the given server. This method can be removed as now this RCP is specific to
- * Qpid and domain is also fixed
- */
- public static List<String> getAllDomains(ManagedServer server) throws Exception
- {
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(server);
- MBeanServerConnection mbsc = serverRegistry.getServerConnection();
- String[] domains = mbsc.getDomains();
- return Arrays.asList(domains);
- }
-
- public static void printOutput(String statement)
- {
- if (ApplicationRegistry.debug)
- {
- System.out.println(statement);
- }
- }
-
- public static void printStackTrace(Throwable ex)
- {
- if (ApplicationRegistry.debug)
- {
- ex.printStackTrace();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/AttributeData.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/AttributeData.java
deleted file mode 100644
index ccd4cf8df8..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/AttributeData.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.model;
-
-public class AttributeData
-{
- String name = "";
- String description = "";
- String dataType = "";
- Object value = "";
- boolean readable = true;
- boolean writable = false;
-
-
- public String getDataType()
- {
- return dataType;
- }
- public void setDataType(String dataType)
- {
- this.dataType = dataType;
- }
-
- public String getDescription()
- {
- return description;
- }
- public void setDescription(String description)
- {
- this.description = description;
- }
-
- public String getName()
- {
- return name;
- }
- public void setName(String name)
- {
- this.name = name;
- }
-
- public Object getValue()
- {
- return value;
- }
- public void setValue(Object value)
- {
- if (value != null)
- this.value = value;
- }
- public boolean isReadable()
- {
- return readable;
- }
- public void setReadable(boolean readable)
- {
- this.readable = readable;
- }
- public boolean isWritable()
- {
- return writable;
- }
- public void setWritable(boolean writable)
- {
- this.writable = writable;
- }
-
- public boolean isNumber()
- {
- if ("int".equals(dataType) || "java.lang.Integer".equals(dataType) ||
- "long".equals(dataType) || "java.lang.Long".equals(dataType) )
- {
- return true;
- }
- else
- return false;
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java
deleted file mode 100644
index b3219f15ea..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java
+++ /dev/null
@@ -1,118 +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.
- *
- */
-package org.apache.qpid.management.ui.model;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-public class ManagedAttributeModel
-{
- HashMap<String, AttributeData> _attributeMap = new HashMap<String, AttributeData>();
-
- public void setAttributeValue(String name, Object value)
- {
- if (value == null)
- return;
-
- AttributeData data = null;
- String dataType = value.getClass().getName();
- if (_attributeMap.containsKey(name))
- {
- data = _attributeMap.get(name);
- data.setValue(value);
- }
- else
- {
- data = new AttributeData();
- data.setName(name);
- data.setValue(value);
- _attributeMap.put(name, data);
- }
- data.setDataType(dataType);
- }
-
-
- public void setAttributeDescription(String name, String value)
- {
- if (_attributeMap.containsKey(name))
- {
- _attributeMap.get(name).setDescription(value);
- }
- else
- {
- AttributeData data = new AttributeData();
- data.setName(name);
- data.setDescription(value);
- _attributeMap.put(name, data);
- }
- }
-
- public void setAttributeReadable(String name, boolean readable)
- {
- if (_attributeMap.containsKey(name))
- {
- _attributeMap.get(name).setReadable(readable);
- }
- else
- {
- AttributeData data = new AttributeData();
- data.setName(name);
- data.setReadable(readable);
- _attributeMap.put(name, data);
- }
- }
-
- public void setAttributeWritable(String name, boolean writable)
- {
- if (_attributeMap.containsKey(name))
- {
- _attributeMap.get(name).setWritable(writable);
- }
- else
- {
- AttributeData data = new AttributeData();
- data.setName(name);
- data.setWritable(writable);
- _attributeMap.put(name, data);
- }
- }
-
- public List<String> getAttributeNames()
- {
- return new ArrayList<String>(_attributeMap.keySet());
- }
-
- public AttributeData[] getAttributes()
- {
- return _attributeMap.values().toArray(new AttributeData[0]);
- }
-
- public AttributeData getAttribute(String name)
- {
- return _attributeMap.get(name);
- }
-
- public int getCount()
- {
- return _attributeMap.size();
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationInfoModel.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationInfoModel.java
deleted file mode 100644
index 6d4160889e..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationInfoModel.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-package org.apache.qpid.management.ui.model;
-
-public class NotificationInfoModel
-{
- String name;
- String description;
- String[] types;
-
- public NotificationInfoModel(String name, String desc, String[] types)
- {
- this.name = name;
- this.description = desc;
- this.types = types;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public String getName()
- {
- return name;
- }
-
- public String[] getTypes()
- {
- return types;
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
deleted file mode 100644
index 926e5f0a24..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.model;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.TimeZone;
-
-import javax.management.ObjectName;
-
-public class NotificationObject
-{
-
- private long _sequenceNo;
- private Date _timeStamp;
- private String _message;
- private Object _source;
- private String _type; // INFO, WARN, etc
- private static final SimpleDateFormat dateFormat = new SimpleDateFormat("hh:mm:ss dd/MM/yy z");
-
- public NotificationObject(long seqNo, Date timeStamp, String message, Object source, String type)
- {
- this._sequenceNo = seqNo;
- this._message = message;
- this._source = source;
- this._type = type;
- this._timeStamp = timeStamp;
- dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
- }
-
- public Object getSource()
- {
- return _source;
- }
- public void setSource(Object _source)
- {
- this._source = _source;
- }
-
- public String getSourceName()
- {
- if (_source instanceof ObjectName)
- {
- return ((ObjectName)_source).getKeyProperty("name");
- }
-
- return null;
- }
-
- public String getMessage()
- {
- return _message;
- }
- public void setMessage(String _message)
- {
- this._message = _message;
- }
- public long getSequenceNo()
- {
- return _sequenceNo;
- }
- public void setSequenceNo(long no)
- {
- _sequenceNo = no;
- }
- public String getTimeStamp()
- {
- return dateFormat.format(_timeStamp);
- }
- public void setTimeStamp(Date stamp)
- {
- _timeStamp = stamp;
- }
- public String getType()
- {
- return _type;
- }
- public void setType(String _type)
- {
- this._type = _type;
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java
deleted file mode 100644
index bf3b730b3e..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.model;
-
-import java.util.List;
-
-public class OperationData
-{
- private String _name;
- private String _description;
- private String _returnType;
- private int _impact;
- private List<ParameterData> _parameters;
-
- public OperationData(String value)
- {
- this._name = value;
- }
-
- public String getName()
- {
- return _name;
- }
-
- public String getDescription()
- {
- return _description;
- }
-
- public void setDescription(String description)
- {
- this._description = description;
- }
-
- public List<ParameterData> getParameters()
- {
- return _parameters;
- }
-
- public void setParameters(List<ParameterData> parameters)
- {
- this._parameters = parameters;
- }
-
- public int getImpact()
- {
- return _impact;
- }
-
- public void setImpact(int impact)
- {
- this._impact = impact;
- }
-
- public String getReturnType()
- {
- return _returnType;
- }
-
- public void setReturnType(String returnType)
- {
- this._returnType = returnType;
- }
-
- public boolean isReturnTypeBoolean()
- {
- return (_returnType.equals("boolean") || _returnType.equals("java.lang.Boolean"));
- }
-
- public boolean isReturnTypeVoid()
- {
- return (_returnType.equals("void") || _returnType.equals("java.lang.Void"));
- }
-
- public Object getParameterValue(String paramName)
- {
- if (_parameters == null)
- {
- return null;
- }
-
- for (int i = 0; i < _parameters.size(); i++)
- {
- if (paramName.equalsIgnoreCase(_parameters.get(i).getName()))
- {
- return _parameters.get(i).getValue();
- }
- }
-
- return null;
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationDataModel.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationDataModel.java
deleted file mode 100644
index 96964a81ef..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationDataModel.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.model;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanParameterInfo;
-
-public class OperationDataModel
-{
- HashMap<String, OperationData> _operationMap = new HashMap<String, OperationData>();
-
- public void addOperation(MBeanOperationInfo opInfo)
- {
- OperationData opData = new OperationData(opInfo.getName());
- opData.setDescription(opInfo.getDescription());
- opData.setImpact(opInfo.getImpact());
- opData.setReturnType(opInfo.getReturnType());
-
- int parametersCount = opInfo.getSignature().length;
- if (parametersCount != 0)
- {
- List<ParameterData> paramList = new ArrayList<ParameterData>();
- for (int i = 0; i < parametersCount; i++)
- {
- MBeanParameterInfo paramInfo = opInfo.getSignature()[i];
- ParameterData param = new ParameterData(paramInfo.getName(), paramInfo.getDescription(),
- paramInfo.getType());
- paramList.add(param);
- }
- opData.setParameters(paramList);
- }
-
- _operationMap.put(opInfo.getName(), opData);
- }
-
- public OperationData getOperation(String name)
- {
- return _operationMap.get(name);
- }
-
- public List<OperationData> getOperations()
- {
- return new ArrayList<OperationData>(_operationMap.values());
- }
-
- public int getCount()
- {
- return _operationMap.size();
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ParameterData.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ParameterData.java
deleted file mode 100644
index d12217c6eb..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ParameterData.java
+++ /dev/null
@@ -1,95 +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.
- *
- */
-package org.apache.qpid.management.ui.model;
-
-/**
- * Class representing an mbean operation parameter
- * @author Bhupendra Bhardwaj
- */
-public class ParameterData
-{
- private String _name;
- private String _description;
- private String _type;
- private Object _value;
-
- ParameterData(String name, String desc, String type)
- {
- this._name = name;
- this._description = desc;
- this._type = type;
- setDefaultValue();
- }
-
- public String getDescription()
- {
- return _description;
- }
-
- public String getName()
- {
- return _name;
- }
-
- public String getType()
- {
- return _type;
- }
-
- public Object getValue()
- {
- return _value;
- }
-
- public void setValueFromString(String strValue)
- {
- if ("int".equals(_type))
- _value = Integer.parseInt(strValue);
- else if (isBoolean())
- _value = Boolean.valueOf(strValue);
- else if ("long".equals(_type))
- _value = Long.parseLong(strValue);
- else
- _value = strValue;
- }
-
- public void setValue(Object value)
- {
- this._value = value;
- }
-
- public boolean isBoolean()
- {
- return (_type.equals("boolean") || _type.equals("java.lang.Boolean"));
- }
-
- public void setDefaultValue()
- {
- if (isBoolean())
- {
- _value = Boolean.valueOf("false");
- }
- else
- {
- _value = null;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/CRAMMD5HashedSaslClientFactory.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/CRAMMD5HashedSaslClientFactory.java
deleted file mode 100644
index 32a0c12344..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/CRAMMD5HashedSaslClientFactory.java
+++ /dev/null
@@ -1,60 +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.
- *
- */
-package org.apache.qpid.management.ui.sasl;
-
-import java.util.Map;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslClientFactory;
-import javax.security.sasl.SaslException;
-
-public class CRAMMD5HashedSaslClientFactory implements SaslClientFactory
-{
- /** The name of this mechanism */
- public static final String MECHANISM = "CRAM-MD5-HASHED";
-
- public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol,
- String serverName, Map<String, ?> props, CallbackHandler cbh)
- throws SaslException
- {
- for (int i = 0; i < mechanisms.length; i++)
- {
- if (mechanisms[i].equals(MECHANISM))
- {
- if (cbh == null)
- {
- throw new SaslException("CallbackHandler must not be null");
- }
-
- String[] mechs = {"CRAM-MD5"};
- return Sasl.createSaslClient(mechs, authorizationId, protocol, serverName, props, cbh);
- }
- }
- return null;
- }
-
- public String[] getMechanismNames(Map props)
- {
- return new String[]{MECHANISM};
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/ClientSaslFactory.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/ClientSaslFactory.java
deleted file mode 100644
index ce9a273eaa..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/ClientSaslFactory.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-package org.apache.qpid.management.ui.sasl;
-
-import java.util.Map;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.sasl.SaslClient;
-import javax.security.sasl.SaslClientFactory;
-import javax.security.sasl.SaslException;
-
-public class ClientSaslFactory implements SaslClientFactory
-{
- public SaslClient createSaslClient(String[] mechs, String authorizationId, String protocol,
- String serverName, Map props, CallbackHandler cbh)
- throws SaslException
- {
- for (int i = 0; i < mechs.length; i++)
- {
- if (mechs[i].equals("PLAIN"))
- {
- return new PlainSaslClient(authorizationId, cbh);
- }
- }
- return null;
- }
-
- /**
- * Simple-minded implementation that ignores props
- */
- public String[] getMechanismNames(Map props)
- {
- return new String[]{"PLAIN"};
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/JCAProvider.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/JCAProvider.java
deleted file mode 100644
index d8189f3ac3..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/JCAProvider.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.sasl;
-
-import java.security.Provider;
-import java.util.Map;
-
-import javax.security.sasl.SaslClientFactory;
-
-public class JCAProvider extends Provider
-{
- private static final long serialVersionUID = 1L;
-
- /**
- * Creates the security provider with a map from SASL mechanisms to implementing factories.
- *
- * @param providerMap The map from SASL mechanims to implementing factory classes.
- */
- public JCAProvider(Map<String, Class<? extends SaslClientFactory>> providerMap)
- {
- super("AMQSASLProvider", 1.0, "A JCA provider that registers all "
- + "AMQ SASL providers that want to be registered");
- register(providerMap);
- }
-
- /**
- * Registers client factory classes for a map of mechanism names to client factory classes.
- *
- * @param providerMap The map from SASL mechanims to implementing factory classes.
- */
- private void register(Map<String, Class<? extends SaslClientFactory>> providerMap)
- {
- for (Map.Entry<String, Class<? extends SaslClientFactory>> me : providerMap.entrySet())
- {
- put("SaslClientFactory." + me.getKey(), me.getValue().getName());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/PlainSaslClient.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/PlainSaslClient.java
deleted file mode 100644
index 22190f29eb..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/PlainSaslClient.java
+++ /dev/null
@@ -1,203 +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.
- *
- */
-package org.apache.qpid.management.ui.sasl;
-
-import java.io.*;
-import javax.security.auth.callback.*;
-import javax.security.sasl.*;
-
-public class PlainSaslClient implements SaslClient
-{
-
- private boolean completed;
- private CallbackHandler cbh;
- private String authorizationID;
- private String authenticationID;
- private byte password[];
- private static byte SEPARATOR = 0;
-
- public PlainSaslClient(String authorizationID, CallbackHandler cbh) throws SaslException
- {
- completed = false;
- this.cbh = cbh;
- Object[] userInfo = getUserInfo();
- this.authorizationID = authorizationID;
- this.authenticationID = (String) userInfo[0];
- this.password = (byte[]) userInfo[1];
- if (authenticationID == null || password == null)
- {
- throw new SaslException("PLAIN: authenticationID and password must be specified");
- }
- }
-
- public byte[] evaluateChallenge(byte[] challenge) throws SaslException
- {
- if (completed)
- {
- throw new IllegalStateException("PLAIN: authentication already " +
- "completed");
- }
- completed = true;
- try
- {
- byte authzid[] =
- authorizationID == null ? null : authorizationID.getBytes("UTF8");
- byte authnid[] = authenticationID.getBytes("UTF8");
- byte response[] =
- new byte[
- password.length +
- authnid.length +
- 2 + // SEPARATOR
- (authzid != null ? authzid.length : 0)
- ];
- int size = 0;
- if (authzid != null) {
- System.arraycopy(authzid, 0, response, 0, authzid.length);
- size = authzid.length;
- }
- response[size++] = SEPARATOR;
- System.arraycopy(authnid, 0, response, size, authnid.length);
- size += authnid.length;
- response[size++] = SEPARATOR;
- System.arraycopy(password, 0, response, size, password.length);
- clearPassword();
- return response;
- } catch (UnsupportedEncodingException e) {
- throw new SaslException("PLAIN: Cannot get UTF-8 encoding of ids",
- e);
- }
- }
-
- public String getMechanismName()
- {
- return "PLAIN";
- }
-
- public boolean hasInitialResponse()
- {
- return true;
- }
-
- public boolean isComplete()
- {
- return completed;
- }
-
- public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
- {
- if (completed) {
- throw new IllegalStateException("PLAIN: this mechanism supports " +
- "neither integrity nor privacy");
- } else {
- throw new IllegalStateException("PLAIN: authentication not " +
- "completed");
- }
- }
-
- public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
- {
- if (completed)
- {
- throw new IllegalStateException("PLAIN: this mechanism supports " +
- "neither integrity nor privacy");
- }
- else
- {
- throw new IllegalStateException("PLAIN: authentication not " +
- "completed");
- }
- }
-
- public Object getNegotiatedProperty(String propName)
- {
- if (completed)
- {
- if (propName.equals(Sasl.QOP))
- {
- return "auth";
- }
- else
- {
- return null;
- }
- }
- else
- {
- throw new IllegalStateException("PLAIN: authentication not " +
- "completed");
- }
- }
-
- private void clearPassword()
- {
- if (password != null)
- {
- for (int i = 0 ; i < password.length ; i++)
- {
- password[i] = 0;
- }
- password = null;
- }
- }
-
- public void dispose() throws SaslException
- {
- clearPassword();
- }
-
- protected void finalize()
- {
- clearPassword();
- }
-
- private Object[] getUserInfo() throws SaslException
- {
- try
- {
- final String userPrompt = "PLAIN authentication id: ";
- final String pwPrompt = "PLAIN password: ";
- NameCallback nameCb = new NameCallback(userPrompt);
- PasswordCallback passwordCb = new PasswordCallback(pwPrompt, false);
- cbh.handle(new Callback[] { nameCb, passwordCb });
- String userid = nameCb.getName();
- char pwchars[] = passwordCb.getPassword();
- byte pwbytes[];
- if (pwchars != null)
- {
- pwbytes = (new String(pwchars)).getBytes("UTF8");
- passwordCb.clearPassword();
- }
- else
- {
- pwbytes = null;
- }
- return (new Object[] { userid, pwbytes });
- }
- catch (IOException e)
- {
- throw new SaslException("Cannot get password", e);
- }
- catch (UnsupportedCallbackException e)
- {
- throw new SaslException("Cannot get userid/password", e);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/SaslProvider.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/SaslProvider.java
deleted file mode 100644
index 2917de8740..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/SaslProvider.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.sasl;
-
-import java.security.Provider;
-
-public class SaslProvider extends Provider
-{
- private static final long serialVersionUID = -6978096016899676466L;
-
- public SaslProvider()
- {
- super("SaslClientFactory", 1.0, "SASL PLAIN CLIENT MECHANISM");
- put("SaslClientFactory.PLAIN", "ClientSaslFactory");
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UserPasswordCallbackHandler.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UserPasswordCallbackHandler.java
deleted file mode 100644
index 1602229c85..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UserPasswordCallbackHandler.java
+++ /dev/null
@@ -1,73 +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.
- *
- */
-package org.apache.qpid.management.ui.sasl;
-
-import java.io.*;
-import javax.security.auth.callback.*;
-
-public class UserPasswordCallbackHandler implements CallbackHandler
-{
- private String user;
- private char[] pwchars;
-
- public UserPasswordCallbackHandler(String user, String password)
- {
- this.user = user;
- this.pwchars = password.toCharArray();
- }
-
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- for (int i = 0; i < callbacks.length; i++)
- {
- if (callbacks[i] instanceof NameCallback)
- {
- NameCallback ncb = (NameCallback) callbacks[i];
- ncb.setName(user);
- }
- else if (callbacks[i] instanceof PasswordCallback)
- {
- PasswordCallback pcb = (PasswordCallback) callbacks[i];
- pcb.setPassword(pwchars);
- }
- else
- {
- throw new UnsupportedCallbackException(callbacks[i]);
- }
- }
- }
-
- private void clearPassword()
- {
- if (pwchars != null)
- {
- for (int i = 0 ; i < pwchars.length ; i++)
- {
- pwchars[i] = 0;
- }
- pwchars = null;
- }
- }
-
- protected void finalize()
- {
- clearPassword();
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UsernameHashedPasswordCallbackHandler.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UsernameHashedPasswordCallbackHandler.java
deleted file mode 100644
index f4e3d2661e..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UsernameHashedPasswordCallbackHandler.java
+++ /dev/null
@@ -1,82 +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.
- *
- */
-package org.apache.qpid.management.ui.sasl;
-
-import java.io.IOException;
-
-import javax.security.auth.callback.Callback;
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.callback.NameCallback;
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.callback.UnsupportedCallbackException;
-
-import org.apache.qpid.management.ui.views.ViewUtility;
-
-public class UsernameHashedPasswordCallbackHandler implements CallbackHandler
-{
- private String user;
- private char[] pwchars;
-
- public UsernameHashedPasswordCallbackHandler(String user, String password) throws Exception
- {
- this.user = user;
- this.pwchars = ViewUtility.getHash(password);
- }
-
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- for (int i = 0; i < callbacks.length; i++)
- {
- if (callbacks[i] instanceof NameCallback)
- {
- NameCallback ncb = (NameCallback) callbacks[i];
- ncb.setName(user);
- }
- else if (callbacks[i] instanceof PasswordCallback)
- {
- PasswordCallback pcb = (PasswordCallback) callbacks[i];
- pcb.setPassword(pwchars);
- }
- else
- {
- throw new UnsupportedCallbackException(callbacks[i]);
- }
- }
- }
-
-
- private void clearPassword()
- {
- if (pwchars != null)
- {
- for (int i = 0 ; i < pwchars.length ; i++)
- {
- pwchars[i] = 0;
- }
- pwchars = null;
- }
- }
-
- protected void finalize()
- {
- clearPassword();
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
deleted file mode 100644
index 3234503fb5..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
+++ /dev/null
@@ -1,936 +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.
- *
- */
-package org.apache.qpid.management.ui.views;
-
-import static org.apache.qpid.management.ui.Constants.*;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.jmx.JMXServerRegistry;
-import org.apache.qpid.management.ui.jmx.MBeanUtility;
-import org.apache.qpid.management.ui.model.AttributeData;
-import org.apache.qpid.management.ui.model.ManagedAttributeModel;
-import org.eclipse.jface.viewers.IColorProvider;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.events.MouseTrackListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Canvas;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.Form;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-
-/**
- * Creates controller composite for the attribute's tab.
- * @author Bhupendra Bhardwaj
- */
-public class AttributesTabControl extends TabControl
-{
- private FormToolkit _toolkit;
- private Form _form;
- private Table _table = null;
- private TableViewer _tableViewer = null;
- private static final int[] tableWidths = new int[] {300, 300};
-
- private Composite _tableComposite = null;
- private Composite _buttonsComposite = null;
-
- private DisposeListener tableDisposeListener = new DisposeListenerImpl();
- final Image image;
- private Button _detailsButton = null;
- private Button _editButton = null;
- private Button _graphButton = null;
- private Button _refreshButton = null;
- private boolean disableEditing = false;
-
- private static final String MAX_VALUE = "MaxValue";
- private static final String GRAPH_VALUES = "GraphValues";
- private int GRAPH_WIDTH = 700;
- private int GRAPH_HEIGHT = 450;
- private int GRAPH_ITEM_GAP = 100;
- private int startX = 80;
- private int startY = 60;
-
- public AttributesTabControl(TabFolder tabFolder)
- {
- super(tabFolder);
- _toolkit = new FormToolkit(_tabFolder.getDisplay());
- _form = _toolkit.createForm(_tabFolder);
- GridLayout gridLayout = new GridLayout(2, false);
- gridLayout.marginWidth = 0;
- gridLayout.marginHeight = 0;
- _form.getBody().setLayout(gridLayout);
- _tableComposite = _toolkit.createComposite(_form.getBody());
- _tableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- _tableComposite.setLayout(new GridLayout());
- _buttonsComposite = _toolkit.createComposite(_form.getBody());
- _buttonsComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
- _buttonsComposite.setLayout(new GridLayout());
-
- image = Display.getCurrent().getSystemImage(SWT.ICON_INFORMATION);
- createWidgets();
- }
-
- /**
- * @see TabControl#getControl()
- */
- public Control getControl()
- {
- return _form;
- }
-
- /**
- * Creates required widgets for Attribute's tab
- */
- protected void createWidgets()
- {
- createTable();
- createTableViewer();
- createButtons();
- addTableListeners();
- }
-
- /**
- * Creates table for listing the MBean attributes
- */
- private void createTable()
- {
- _table = _toolkit.createTable(_tableComposite, SWT.FULL_SELECTION);
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- _table.setLayoutData(gridData);
-
- for (int i = 0; i < ATTRIBUTE_TABLE_TITLES.length; ++i)
- {
- final TableColumn column = new TableColumn(_table, SWT.NONE);
- column.setText(ATTRIBUTE_TABLE_TITLES[i]);
- column.setWidth(tableWidths[i]);
- column.setResizable(false);
- }
-
- _table.setLinesVisible (true);
- _table.setHeaderVisible (true);
- }
-
- /**
- * Creates tableviewer for the attribute's table
- */
- private void createTableViewer()
- {
- _tableViewer = new TableViewer(_table);
- _tableViewer.setUseHashlookup(true);
- _tableViewer.setColumnProperties(ATTRIBUTE_TABLE_TITLES);
- _tableViewer.setContentProvider(new ContentProviderImpl());
- _tableViewer.setLabelProvider(new LabelProviderImpl());
- _tableViewer.setSorter(new ViewerSorterImpl());
- }
-
- private void createButtons()
- {
- addDetailsButton();
- addEditButton();
- addGraphButton();
- addRefreshButton();
- }
-
- private void addDetailsButton()
- {
- // Create and configure the button for attribute details
- _detailsButton = _toolkit.createButton(_buttonsComposite, BUTTON_DETAILS, SWT.PUSH | SWT.CENTER);
- _detailsButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- GridData gridData = new GridData(SWT.CENTER, SWT.TOP, false, false);
- gridData.widthHint = 80;
- _detailsButton.setLayoutData(gridData);
- _detailsButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- disableEditing = true;
- int index = _table.getSelectionIndex();
- TableItem item = _table.getItem(index);
- createDetailsPopup((AttributeData)item.getData());
- disableEditing = false;
- setFocus();
- }
- });
- }
-
- /**
- * Creates the button for editing attributes.
- */
- private void addEditButton()
- {
- // Create and configure the button for editing attribute
- _editButton = _toolkit.createButton(_buttonsComposite, BUTTON_EDIT_ATTRIBUTE, SWT.PUSH | SWT.CENTER);
- _editButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- GridData gridData = new GridData(SWT.CENTER, SWT.TOP, false, false);
- gridData.widthHint = 80;
- _editButton.setLayoutData(gridData);
- _editButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- int index = _table.getSelectionIndex();
- TableItem item = _table.getItem(index);
- createDetailsPopup((AttributeData)item.getData());
- setFocus();
- }
- });
- }
-
- /**
- * Creates the button for viewing Graphs
- */
- private void addGraphButton()
- {
- _graphButton = _toolkit.createButton(_buttonsComposite, BUTTON_GRAPH, SWT.PUSH | SWT.CENTER);
- _graphButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- GridData gridData = new GridData(SWT.CENTER, SWT.TOP, false, false);
- gridData.widthHint = 80;
- _graphButton.setLayoutData(gridData);
- _graphButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- int selectionIndex = _table.getSelectionIndex();
- AttributeData data = (AttributeData)_table.getItem(selectionIndex).getData();
- createGraph(data);
- setFocus();
- }
- });
- }
-
- /**
- * Creates the "Refresh" button
- */
- private void addRefreshButton()
- {
- _refreshButton = _toolkit.createButton(_buttonsComposite, BUTTON_REFRESH, SWT.PUSH | SWT.CENTER);
-
- _refreshButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- GridData gridData = new GridData(SWT.CENTER, SWT.TOP, false, false);
- gridData.widthHint = 80;
- _refreshButton.setLayoutData(gridData);
- _refreshButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- try
- {
- // refresh the attributes list
- refresh(_mbean);
- }
- catch (Exception ex)
- {
- MBeanUtility.handleException(_mbean, ex);
- }
-
- }
- });
- }
-
- private void addTableListeners()
- {
- _tableViewer.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent evt)
- {
- IStructuredSelection ss = (IStructuredSelection)evt.getSelection();
- checkForEnablingButtons((AttributeData)ss.getFirstElement());
- }
- });
-
- MouseListenerImpl listener = new MouseListenerImpl();
- _tableViewer.getTable().addMouseTrackListener(listener);
- _tableViewer.getTable().addMouseMoveListener(listener);
- _tableViewer.getTable().addMouseListener(listener);
-
- _table.addDisposeListener(tableDisposeListener);
-
- // _table is equal to _tableViewer.getControl()
- _table.addListener(SWT.MeasureItem, new Listener() {
- public void handleEvent(Event event)
- {
- event.height = event.gc.getFontMetrics().getHeight() * 3/2;
- }
- });
- }
-
- /**
- * Listeners implementation class for showing table tooltip
- * @author Bhupendra Bhardwaj
- */
- private class MouseListenerImpl implements MouseTrackListener, MouseMoveListener, KeyListener, MouseListener
- {
- Shell tooltipShell = null;
- Label tooltipLabel = null;
- public void mouseHover(MouseEvent event)
- {
- TableItem item = _table.getItem (new Point (event.x, event.y));
-
- if (item != null)
- {
- AttributeData data = (AttributeData)item.getData();
- if (tooltipShell != null && !tooltipShell.isDisposed ()) tooltipShell.dispose ();
- tooltipShell = new Shell(_table.getShell(), SWT.ON_TOP | SWT.NO_FOCUS | SWT.TOOL);
- tooltipShell.setBackground(event.display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- FillLayout layout = new FillLayout();
- layout.marginWidth = 2;
- tooltipShell.setLayout(layout);
- tooltipLabel = new Label(tooltipShell, SWT.NONE);
- tooltipLabel.setForeground(event.display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
- tooltipLabel.setBackground(event.display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- tooltipLabel.setText(data.getDescription());
- tooltipLabel.setData("_TABLEITEM", item);
- tooltipLabel.addListener(SWT.MouseExit, tooltipLabelListener);
- tooltipLabel.addListener(SWT.MouseDown, tooltipLabelListener);
- Point size = tooltipShell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Rectangle rect = item.getBounds(0);
- Point pt = _table.toDisplay(rect.x, rect.y);
- tooltipShell.setBounds(pt.x, pt.y, size.x, size.y);
- tooltipShell.setVisible(true);
- }
- }
- public void mouseEnter(MouseEvent e)
- {
- }
- public void mouseExit(MouseEvent e)
- {
- }
-
- // MouseMoveListener implementation
- public void mouseMove(MouseEvent event)
- {
- if (tooltipShell == null)
- return;
-
- tooltipShell.dispose();
- tooltipShell = null;
- tooltipLabel = null;
- }
-
- // KeyListener implementation
- public void keyPressed(KeyEvent e)
- {
- if (tooltipShell == null)
- return;
-
- tooltipShell.dispose();
- tooltipShell = null;
- tooltipLabel = null;
- }
- public void keyReleased(KeyEvent e)
- {
-
- }
-
- // MouseListener implementation
- public void mouseDoubleClick(MouseEvent event)
- {
- if (tooltipShell != null)
- {
- tooltipShell.dispose();
- tooltipShell = null;
- tooltipLabel = null;
- }
- Table table = (Table)event.getSource();
- int selectionIndex = table.getSelectionIndex();
- AttributeData data = (AttributeData)table.getItem(selectionIndex).getData();
- createDetailsPopup(data);
- }
- public void mouseDown(MouseEvent e)
- {
- if (tooltipShell != null)
- {
- tooltipShell.dispose();
- tooltipShell = null;
- tooltipLabel = null;
- }
- }
- public void mouseUp(MouseEvent e)
- {
-
- }
- } // end of MouseListenerImpl
-
- /**
- * Creates pop-up window for showing attribute details
- * @param data - Selectes attribute
- */
- public void createDetailsPopup(AttributeData data)
- {
- int width = 500;
- int height = 250;
- if (!isSimpleType(data.getValue()))
- {
- width = 650;
- height = 450;
- }
-
- Display display = Display.getCurrent();
- Shell shell = ViewUtility.createPopupShell(ATTRIBUTE, width, height);
- createDetailsPopupContents(shell, data);
-
- shell.open();
- while (!shell.isDisposed())
- {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
- }
- shell.dispose();
- }
-
- /**
- * Listener class for table tooltip label
- */
- final Listener tooltipLabelListener = new Listener ()
- {
- public void handleEvent (Event event)
- {
- Label label = (Label)event.widget;
- Shell shell = label.getShell();
- switch (event.type)
- {
- case SWT.MouseDown:
- Event e = new Event();
- e.item = (TableItem)label.getData ("_TABLEITEM");
- _table.setSelection(new TableItem[] {(TableItem)e.item});
- shell.dispose();
- _table.setFocus();
- break;
- case SWT.MouseExit:
- shell.dispose();
- break;
- }
- }
- };
-
-
- /**
- * Create the contents for the attribute details window pop-up
- * @param shell - The shell that will be filled with details.
- * @param attribute - Selected attribute
- */
- private void createDetailsPopupContents(Composite shell, AttributeData attribute)
- {
- GridLayout layout = new GridLayout(2, false);
- layout.horizontalSpacing = 10;
- layout.verticalSpacing = 10;
- layout.marginHeight = 20;
- layout.marginWidth = 20;
-
- Composite parent = _toolkit.createComposite(shell, SWT.NONE);
- parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- parent.setLayout(layout);
-
- // Name
- Label label = _toolkit.createLabel(parent, ATTRIBUTE_TABLE_TITLES[0], SWT.NONE);
- GridData layoutData = new GridData(SWT.TRAIL, SWT.TOP, false, false);
- label.setLayoutData(layoutData);
- int textStyle = SWT.BEGINNING | SWT.BORDER |SWT.READ_ONLY;
- Text value = _toolkit.createText(parent, ViewUtility.getDisplayText(attribute.getName()), textStyle);
- value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
-
- // Description
- label = _toolkit.createLabel(parent, DESCRIPTION, SWT.NONE);
- label.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
- value = _toolkit.createText(parent, attribute.getDescription(), textStyle);
- value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
- // value
- label = _toolkit.createLabel(parent, ATTRIBUTE_TABLE_TITLES[1], SWT.NONE);
- label.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
-
- if (!attribute.isReadable())
- {
- value = _toolkit.createText(parent, "", textStyle);
- value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- }
- else
- {
- if (!isSimpleType(attribute.getValue()))
- {
- Composite composite = new Composite(parent, SWT.BORDER);
- composite.setLayout(new GridLayout());
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
- ViewUtility.populateCompositeWithData(_toolkit, composite, attribute.getValue());
- }
- else
- {
- if (attribute.isWritable())
- {
- value = _toolkit.createText(parent, "", SWT.BEGINNING | SWT.BORDER);
- value.addVerifyListener(new NumberVerifyListener());
-
- // set data to access in the listener
- parent.setData(attribute);
- }
- else
- {
- value = _toolkit.createText(parent, "", textStyle);
- }
-
- value.setText(attribute.getValue().toString());
- value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- }
- }
-
-
- // Update button
- Button updateButton = addUpdateButton(parent);
- updateButton.setData(value);
- if (!attribute.isWritable())
- {
- updateButton.setVisible(false);
- }
-
- if (disableEditing)
- {
- value.setEditable(false);
- updateButton.setVisible(false);
- }
- }
-
- /**
- * Create the button for updating attributes. This should be enabled for writable attribute
- */
- private Button addUpdateButton(Composite parent)
- {
- final Button updateButton = new Button(parent, SWT.PUSH | SWT.CENTER);
- // set the data to access in the listener
- parent.setData(BUTTON_UPDATE, updateButton);
-
- updateButton.setText(BUTTON_UPDATE);
- GridData gridData = new GridData (SWT.CENTER, SWT.BOTTOM, true, true, 2, 1);
- gridData.widthHint = 100;
- updateButton.setLayoutData(gridData);
- updateButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent event)
- {
- try
- {
- Button button = (Button)event.widget;
- Text text = (Text)button.getData();
- AttributeData data = (AttributeData)button.getParent().getData();
- MBeanUtility.updateAttribute(_mbean, data, text.getText());
- button.getShell().close();
- refresh();
- }
- catch (Exception ex)
- {
- MBeanUtility.handleException(_mbean, ex);
- }
- }
- });
-
- return updateButton;
- }
-
- // Refresh from the server registry
- public void refresh()
- {
- JMXServerRegistry serverRegistry = (JMXServerRegistry)ApplicationRegistry.getServerRegistry(_mbean);
- ManagedAttributeModel attributesList = serverRegistry.getAttributeModel(_mbean);
- _tableViewer.setInput(attributesList);
- }
-
- /**
- * Refreshes the attribute tab by querying the mbean server for latest values
- */
- @Override
- public void refresh(ManagedBean mbean)
- {
- _mbean = mbean;
- if (_mbean == null)
- {
- _tableViewer.setInput(null);
- return;
- }
- ManagedAttributeModel attributesList = null;
- try
- {
- attributesList = MBeanUtility.getAttributes(mbean);
- }
- catch(Exception ex)
- {
- MBeanUtility.handleException(_mbean, ex);
- }
- _tableViewer.setInput(attributesList);
- checkForEnablingButtons(getSelectionAttribute());
-
- _form.layout(true);
- _form.getBody().layout(true, true);
- }
-
- /**
- * @see TabControl#setFocus()
- */
- public void setFocus()
- {
- _table.setFocus();
- }
-
- /**
- * Checks which buttons are to be enabled or disabled. The graph button will be enabled only
- * for readable number attributes. Editing is enabled for writeable attribtues.
- * @param attribute
- */
- private void checkForEnablingButtons(AttributeData attribute)
- {
- if (attribute == null)
- {
- _detailsButton.setEnabled(false);
- _editButton.setEnabled(false);
- _graphButton.setEnabled(false);
- _refreshButton.setEnabled(false);
- return;
- }
-
- _detailsButton.setEnabled(true);
- _refreshButton.setEnabled(true);
- if (attribute.isWritable())
- {
- _editButton.setEnabled(true);
- _graphButton.setEnabled(false);
- }
- else
- {
- _editButton.setEnabled(false);
- // Currently only Queues are having attributes, which are suitable for a graph
- if (attribute.isNumber() && _mbean.isQueue())
- {
- _graphButton.setEnabled(true);
- }
- else
- {
- _graphButton.setEnabled(false);
- }
- }
- }
-
- /**
- * Creates graph in a pop-up window for given attribute.
- * @param data
- */
- private void createGraph(final AttributeData data)
- {
- Display display = Display.getCurrent();
- Shell shell = new Shell(display, SWT.BORDER | SWT.CLOSE | SWT.MIN | SWT.MAX);
- shell.setText(_mbean.getName());
- int x = display.getBounds().width;
- int y = display.getBounds().height;
- shell.setBounds(x/4, y/4, GRAPH_WIDTH, GRAPH_HEIGHT);
- shell.setLayout(new FillLayout());
-
- final Canvas canvas = new Canvas(shell, SWT.NONE);
- long currentValue = Long.parseLong(data.getValue().toString());
- long mValue = getGraphMaxValue(currentValue);
- canvas.setData(MAX_VALUE, mValue);
- canvas.setData(GRAPH_VALUES, new long[] {0,0,0,0,0,currentValue});
-
- canvas.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
- canvas.addPaintListener(new PaintListener()
- {
- public void paintControl(PaintEvent event)
- {
- Canvas canvas = (Canvas)event.widget;
- int maxX = canvas.getSize().x;
- int maxY = canvas.getSize().y;
- event.gc.fillRectangle(canvas.getBounds());
- event.gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
- event.gc.setLineWidth(4);
-
- Object canvasData = canvas.getData(MAX_VALUE);
- String str = canvasData.toString();
- long maxValue = Long.parseLong(str);
- // Set the graph dimensions
- event.gc.drawText("0", startX - 40, maxY - startY - 10);
- event.gc.drawText("" + maxValue/2, startX - 40, maxY/2);
- event.gc.drawText("" + maxValue, startX - 40, startY);
-
- // horizontal line
- event.gc.drawLine(startX, maxY - startY, maxX - 60, maxY - startY);
- // vertical line
- event.gc.drawLine(startX, maxY - startY, startX, startY);
- // set graph text
- event.gc.drawText(data.getName(), startX - 40, startY - 40);
- event.gc.drawText("25 sec", startX, maxY - startY + 10);
- event.gc.drawText("20 sec", startX + GRAPH_ITEM_GAP, maxY - startY + 10);
- event.gc.drawText("15 sec", startX + GRAPH_ITEM_GAP * 2, maxY - startY + 10);
- event.gc.drawText("10 sec", startX + GRAPH_ITEM_GAP * 3, maxY - startY + 10);
- event.gc.drawText(" 5 sec", startX + GRAPH_ITEM_GAP * 4, maxY - startY + 10);
- event.gc.drawText(" 0 sec", startX + GRAPH_ITEM_GAP * 5, maxY - startY + 10);
-
- // plot the graph now for values
- event.gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
- canvasData = canvas.getData(GRAPH_VALUES);
- long[] graphValues = (long[]) canvasData;
- for (int i = 0; i < graphValues.length; i++)
- {
- int x = startX + i * GRAPH_ITEM_GAP;
- int yTotalLength = (maxY - 2 * startY);
- float ratio = ((float)graphValues[i]/(float)maxValue);
- int itemlength = (int)(yTotalLength * ratio);
- int y = maxY - startY - itemlength;
- event.gc.drawLine(x, maxY- startY, x, y);
- event.gc.drawText(String.valueOf(graphValues[i]), x, y - 20);
- }
- }
- });
-
- shell.open();
-
- // Set up the timer for the animation
- Runnable runnable = new Runnable()
- {
- public void run()
- {
- try
- {
- animate(canvas, data);
- Display.getCurrent().timerExec(TIMER_INTERVAL, this);
- }
- catch(Exception ex)
- {
- MBeanUtility.handleException(ex);
- }
- }
- };
-
- // Launch the timer
- display.timerExec(TIMER_INTERVAL, runnable);
-
- while (!shell.isDisposed())
- {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
- }
-
- // Kill the timer
- display.timerExec(-1, runnable);
- shell.dispose();
- }
-
- /**
- * @return selected attribute in the table
- */
- public AttributeData getSelectionAttribute()
- {
- int index = _table.getSelectionIndex();
- if (index == -1)
- return null;
-
- return (AttributeData)_table.getItem(index).getData();
- }
-
- /**
- * checks for newer values of selected attribute to update the graph
- * @param canvas
- * @param data
- * @throws Exception
- */
- private void animate(Canvas canvas, AttributeData data) throws Exception
- {
- String attribute = data.getName();
- Object valueObj = MBeanUtility.refreshAttribute(_mbean, attribute);
- int value = Integer.parseInt(String.valueOf(valueObj));
- Object canvasData = canvas.getData(GRAPH_VALUES);
- long[] graphValues = (long[]) canvasData;
-
- for (int i = 0; i < graphValues.length -1; i++)
- {
- graphValues[i] = graphValues[i + 1];
- }
- graphValues[graphValues.length - 1] = value;
-
- canvasData = canvas.getData(MAX_VALUE);
- long maxValue = Long.parseLong(String.valueOf(canvasData));
- if (maxValue < value)
- {
- maxValue = getGraphMaxValue(value);
- canvas.setData(MAX_VALUE, maxValue);
- }
-
- canvas.redraw();
- }
-
- /**
- * @param maxAttributeValue
- * @return dynamically calculated value for y-axis on the graph
- */
- private long getGraphMaxValue(long maxAttributeValue)
- {
- long maxGraphValue = 100;
- long temp = maxAttributeValue * 3/2;
- if (temp > maxGraphValue)
- {
- long modulus = temp % 100;
- maxGraphValue = temp + ( 100 - modulus);
- }
-
- return maxGraphValue;
- }
-
- /**
- * Content Provider class for the table viewer
- * @author Bhupendra Bhardwaj
- */
- private class ContentProviderImpl implements IStructuredContentProvider
- {
-
- public void inputChanged(Viewer v, Object oldInput, Object newInput)
- {
-
- }
-
- public void dispose()
- {
-
- }
-
- public Object[] getElements(Object parent)
- {
- return ((ManagedAttributeModel)parent).getAttributes();
- }
- }
-
- /**
- * Label Provider class for the table viewer
- * @author Bhupendra Bhardwaj
- */
- private class LabelProviderImpl extends LabelProvider implements ITableLabelProvider,
- IFontProvider,
- IColorProvider
- {
- AttributeData attribute = null;
- public String getColumnText(Object element, int columnIndex)
- {
- String result = "";
- attribute = (AttributeData) element;
-
- switch (columnIndex)
- {
- case 0 : // attribute name column
- result = ViewUtility.getDisplayText(attribute.getName());
- break;
- case 1 : // attribute value column
- if (attribute.getValue() != null)
- result = String.valueOf(attribute.getValue());
- break;
- default :
- result = "";
- }
-
- return result;
- }
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- return null;
- }
-
- public Font getFont(Object element)
- {
- return ApplicationRegistry.getFont(FONT_TABLE_CELL);
- }
-
- public Color getForeground(Object element)
- {
- attribute = (AttributeData) element;
- if (attribute.isWritable())
- return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_BLUE);
- else
- return Display.getCurrent().getSystemColor(SWT.COLOR_BLACK);
- }
- public Color getBackground(Object element)
- {
- return _form.getBackground();
- }
- }
-
- private class DisposeListenerImpl implements DisposeListener
- {
- public void widgetDisposed(DisposeEvent e)
- {
-
- }
- }
-
- /**
- * Sorter class for the table viewer. It sorts the table for according to attribute name.
- * @author Bhupendra Bhardwaj
- *
- */
- private class ViewerSorterImpl extends ViewerSorter
- {
- public int compare(Viewer viewer, Object o1, Object o2)
- {
- AttributeData attribtue1 = (AttributeData)o1;
- AttributeData attribtue2 = (AttributeData)o2;
-
- return collator.compare(attribtue1.getName(), attribtue2.getName());
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ConnectionTypeTabControl.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ConnectionTypeTabControl.java
deleted file mode 100644
index d891a45210..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ConnectionTypeTabControl.java
+++ /dev/null
@@ -1,59 +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.
- *
- */
-
-package org.apache.qpid.management.ui.views;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.Constants;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.ServerRegistry;
-import org.eclipse.swt.widgets.TabFolder;
-
-/**
- * Controller class, which takes care of displaying appropriate information and widgets for Connections.
- * This allows user to select Connections and add those to the navigation view
- */
-public class ConnectionTypeTabControl extends MBeanTypeTabControl
-{
-
- public ConnectionTypeTabControl(TabFolder tabFolder)
- {
- super(tabFolder, Constants.CONNECTION);
- createWidgets();
- }
-
- protected void createWidgets()
- {
- createHeaderComposite(getFormComposite());
- createButtonsComposite(getFormComposite());
- createListComposite(getFormComposite());
- }
-
- protected void populateList() throws Exception
- {
- // map should be cleared before populating it with new values
- getMBeansMap().clear();
-
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(MBeanView.getServer());
- java.util.List<ManagedBean> list = serverRegistry.getConnections(MBeanView.getVirtualHost());
- getListWidget().setItems(getItems(list));
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ExchangeTypeTabControl.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ExchangeTypeTabControl.java
deleted file mode 100644
index ee55b251ee..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ExchangeTypeTabControl.java
+++ /dev/null
@@ -1,60 +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.
- *
- */
-
-package org.apache.qpid.management.ui.views;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.Constants;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.ServerRegistry;
-import org.eclipse.swt.widgets.TabFolder;
-
-/**
- * Controller class, which takes care of displaying appropriate information and widgets for Exchanges.
- * This allows user to select Exchanges and add those to the navigation view
- * @author Bhupendra Bhardwaj
- */
-public class ExchangeTypeTabControl extends MBeanTypeTabControl
-{
-
- public ExchangeTypeTabControl(TabFolder tabFolder)
- {
- super(tabFolder, Constants.EXCHANGE);
- createWidgets();
- }
-
- protected void createWidgets()
- {
- createHeaderComposite(getFormComposite());
- createButtonsComposite(getFormComposite());
- createListComposite(getFormComposite());
- }
-
- protected void populateList() throws Exception
- {
- // map should be cleared before populating it with new values
- getMBeansMap().clear();
-
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(MBeanView.getServer());
- java.util.List<ManagedBean> list = serverRegistry.getExchanges(MBeanView.getVirtualHost());
- getListWidget().setItems(getItems(list));
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/INotificationViewer.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/INotificationViewer.java
deleted file mode 100644
index bc560b6064..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/INotificationViewer.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.views;
-
-import java.util.List;
-
-import org.apache.qpid.management.ui.model.NotificationObject;
-
-public interface INotificationViewer
-{
- public void addNotification(NotificationObject notification);
-
- public void addNotification(List<NotificationObject> notificationList);
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java
deleted file mode 100644
index 24dfb519fd..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java
+++ /dev/null
@@ -1,336 +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.
- *
- */
-
-package org.apache.qpid.management.ui.views;
-
-import static org.apache.qpid.management.ui.Constants.BUTTON_REFRESH;
-import static org.apache.qpid.management.ui.Constants.FONT_BOLD;
-import static org.apache.qpid.management.ui.Constants.FONT_ITALIC;
-import static org.apache.qpid.management.ui.Constants.FONT_NORMAL;
-
-import java.util.Collections;
-import java.util.HashMap;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.jmx.MBeanUtility;
-import org.apache.qpid.management.ui.model.AttributeData;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.widgets.Form;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * Abstract class to be extended by the Controller classes for different MBean types (Connection, Queue, Exchange)
- */
-public abstract class MBeanTypeTabControl
-{
- private FormToolkit _toolkit = null;
- private Form _form = null;
- private TabFolder _tabFolder = null;
- private Composite _composite = null;
- private Composite _headerComposite = null;
- private Composite _listComposite = null;
- private Label _labelName = null;
- private Label _labelDesc = null;
- private Label _labelList = null;
-
- private org.eclipse.swt.widgets.List _list = null;
- private Button _refreshButton = null;
- private Button _addButton = null;
-
- private String _type = null;
-
- // maps an mbean name with the mbean object. Required to get mbean object when an mbean
- // is to be added to the navigation view.
- private HashMap<String, ManagedBean> _objectsMap = new HashMap<String, ManagedBean>();
- private Sorter _sorterByName = new Sorter();
-
- public MBeanTypeTabControl(TabFolder tabFolder, String type)
- {
- _type = type;
- _tabFolder = tabFolder;
- _toolkit = new FormToolkit(_tabFolder.getDisplay());
- _form = _toolkit.createForm(_tabFolder);
- createFormComposite();
- }
-
- public FormToolkit getToolkit()
- {
- return _toolkit;
- }
-
- public Control getControl()
- {
- return _form;
- }
-
- public String getType()
- {
- return _type;
- }
-
- protected List getListWidget()
- {
- return _list;
- }
-
- protected HashMap<String, ManagedBean> getMBeansMap()
- {
- return _objectsMap;
- }
-
- public Sorter getMBeanNameSorter()
- {
- return _sorterByName;
- }
-
- public Button getAddButton()
- {
- return _addButton;
- }
-
- public Button getRefreshButton()
- {
- return _refreshButton;
- }
-
- /**
- * Creates the main Composite, which will contain all other Composites and Widgets
- */
- protected void createFormComposite()
- {
- _form.getBody().setLayout(new GridLayout());
- _composite = _toolkit.createComposite(_form.getBody(), SWT.NONE);
- _composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- GridLayout layout = new GridLayout();
- layout.verticalSpacing = 10;
- layout.horizontalSpacing = 0;
- _composite.setLayout(layout);
- }
-
- protected Composite getFormComposite()
- {
- return _composite;
- }
-
- /**
- * Creates the header composite, which has MBean type name and description
- * @param parentComposite
- */
- protected void createHeaderComposite(Composite parentComposite)
- {
- _headerComposite = _toolkit.createComposite(parentComposite);
- _headerComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- GridLayout layout = new GridLayout();
- layout.verticalSpacing = 10;
- layout.horizontalSpacing = 0;
- _headerComposite.setLayout(layout);
-
- _labelName = _toolkit.createLabel(_headerComposite, "Type:", SWT.NONE);
- GridData gridData = new GridData(SWT.CENTER, SWT.TOP, true, false);
- _labelName.setLayoutData(gridData);
- _labelName.setFont(ApplicationRegistry.getFont(FONT_BOLD));
-
- _labelDesc = _toolkit.createLabel(_headerComposite, " ", SWT.NONE);
- _labelDesc.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false));
- _labelDesc.setFont(ApplicationRegistry.getFont(FONT_ITALIC));
-
- _headerComposite.layout();
- }
-
- /**
- * Creates Composite, which contains the common buttons - Add and Refresh.
- * @param parentComposite
- */
- protected void createButtonsComposite(Composite parentComposite)
- {
- Composite composite = _toolkit.createComposite(parentComposite);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- GridLayout layout = new GridLayout(2, true);
- layout.verticalSpacing = 10;
- layout.horizontalSpacing = 20;
- composite.setLayout(layout);
-
- createAddButton(composite);
- createRefreshButton(composite);
- }
-
- /**
- * Creates the Add button, which adds the selected item to the navigation view
- * @param parentComposite
- */
- protected void createAddButton(Composite parentComposite)
- {
- Button _addButton = _toolkit.createButton(parentComposite, "<- Add to Navigation", SWT.PUSH);
- GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, false, false);
- _addButton.setLayoutData(gridData);
- _addButton.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e)
- {
- if (_list.getSelectionCount() == 0)
- return;
-
- String[] selectedItems = _list.getSelection();
- for (int i = 0; i < selectedItems.length; i++)
- {
- String name = selectedItems[i];
- // pass the ManagedBean to the navigation view to be added
- ManagedBean mbean = _objectsMap.get(name);
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
- NavigationView view = (NavigationView)window.getActivePage().findView(NavigationView.ID);
- try
- {
- view.addManagedBean(mbean);
- }
- catch (Exception ex)
- {
- MBeanUtility.handleException(mbean, ex);
- }
- }
- }
- });
- }
-
- /**
- * Creates the Refresh button, which gets syncs the items with the broker server
- * @param parentComposite
- */
- protected void createRefreshButton(Composite parentComposite)
- {
- Button _refreshButton = _toolkit.createButton(parentComposite, BUTTON_REFRESH, SWT.PUSH);
- GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, false, false);
- gridData.widthHint = 120;
- _refreshButton.setLayoutData(gridData);
- _refreshButton.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e)
- {
- try
- {
- // refresh the list from the broker server
- populateList();
- }
- catch (Exception ex)
- {
- MBeanUtility.handleException(ex);
- }
- }
- });
- }
-
- /**
- * Creates the Composite, which contains the items ( Connections, Exchanges or Queues)
- * @param parentComposite
- */
- protected void createListComposite(Composite parentComposite)
- {
- // Composite to contain the item list
- _listComposite = _toolkit.createComposite(parentComposite);
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- _listComposite.setLayoutData(gridData);
- GridLayout layout = new GridLayout();
- layout.verticalSpacing = 0;
- _listComposite.setLayout(layout);
-
- // Label for item name
- _labelList = _toolkit.createLabel(_listComposite, " ", SWT.CENTER);
- gridData = new GridData(SWT.CENTER, SWT.TOP, true, false, 1, 1);
- _labelList.setLayoutData(gridData);
- _labelList.setFont(ApplicationRegistry.getFont(FONT_NORMAL));
-
- _list = new List(_listComposite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- gridData = new GridData(SWT.FILL, SWT.FILL, true, true,1, 1);
- _list.setLayoutData(gridData);
-
- }
-
- /**
- * This is called from MBean View to refresh the tab contents
- * @throws Exception
- */
- public void refresh() throws Exception
- {
- setLabelValues();
- populateList();
- layout();
- }
-
- protected void setLabelValues()
- {
- _labelName.setText("Type : " + _type);
- _labelDesc.setText("Select the " + _type + "(s) to add in the Navigation View");
- _labelList.setText("-- List of " + _type + "s --");
- }
-
- protected abstract void populateList() throws Exception;
-
- public void layout()
- {
- _form.layout(true);
- _form.getBody().layout(true, true);
- }
-
- // sets the map with appropriate mbean and name
- protected String[] getItems(java.util.List<ManagedBean> list)
- {
- if (list == null)
- return new String[0];
-
- Collections.sort(list, _sorterByName);
- String[] items = new String[list.size()];
- int i = 0;
- for (ManagedBean mbean : list)
- {
- items[i++] = mbean.getName();
- _objectsMap.put(mbean.getName(), mbean);
- }
- return items;
- }
-
- protected class ComparatorImpl implements java.util.Comparator<AttributeData>
- {
- public int compare(AttributeData data1, AttributeData data2)
- {
- Integer int1 = Integer.parseInt(data1.getValue().toString());
- Integer int2 = Integer.parseInt(data2.getValue().toString());
- return int1.compareTo(int2) * -1;
- }
- }
-
- protected class Sorter implements java.util.Comparator<ManagedBean>
- {
- public int compare(ManagedBean mbean1, ManagedBean mbean2)
- {
- return mbean1.getName().compareTo(mbean2.getName());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java
deleted file mode 100644
index 5476c27871..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java
+++ /dev/null
@@ -1,545 +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.
- *
- */
-package org.apache.qpid.management.ui.views;
-
-import java.util.HashMap;
-
-import static org.apache.qpid.management.ui.Constants.*;
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.ManagedServer;
-import org.apache.qpid.management.ui.ServerRegistry;
-import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
-import org.apache.qpid.management.ui.jmx.MBeanUtility;
-import org.apache.qpid.management.ui.model.AttributeData;
-import org.apache.qpid.management.ui.model.OperationData;
-import org.apache.qpid.management.ui.model.OperationDataModel;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.TabItem;
-import org.eclipse.ui.ISelectionListener;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.forms.widgets.Form;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * MBean View create appropriate view based on the user selection on the Navigation View.
- * Create TabFolder for all MBeans and displays the attribtues and method tabs.
- * @author Bhupendra Bhardwaj
- *
- */
-public class MBeanView extends ViewPart
-{
- public static final String ID = "org.apache.qpid.management.ui.mbeanView";
- private static final String CONTROLLER = "CONTROLLER";
-
- private FormToolkit _toolkit = null;
- private Form _form = null;
- private String _formText = APPLICATION_NAME;
- private static ManagedServer _server = null;
- private TreeObject _selectedNode = null;
- private ManagedBean _mbean = null;
- private static String _virtualHostName = null;
- // This map contains a TabFolder for each kind of MBean.
- // TabFolder is mapped with mbeantype(Connection, Queue and Exchange)
- private HashMap<String, TabFolder> tabFolderMap = new HashMap<String, TabFolder>();
- private ISelectionListener selectionListener = new SelectionListenerImpl();
-
- // TabFolder to list all the mbeans for a given mbeantype(eg Connection, Queue, Exchange)
- private TabFolder typeTabFolder = null;
-
- private TabFolder notificationTabFolder = null;
- /*
- * Listener for the selection events in the navigation view
- */
- private class SelectionListenerImpl implements ISelectionListener
- {
- public void selectionChanged(IWorkbenchPart part, ISelection sel)
- {
- if (!(sel instanceof IStructuredSelection))
- return;
-
- IStructuredSelection ss = (IStructuredSelection) sel;
- _selectedNode = (TreeObject)ss.getFirstElement();
-
-
- // mbean should be set to null. A selection done on the navigation view can be either an mbean or
- // an mbeantype. For mbeantype selection(eg Connection, Queue, Exchange) _mbean will remain null.
- _mbean = null;
- setInvisible();
-
- // If a selected node(mbean) gets unregistered from mbean server, mbeanview should
- // make the tabfolber for that mbean invisible
- if (_selectedNode == null)
- return;
-
- setServer();
- refreshMBeanView();
- setFormTitle();
- }
- }
-
- private void setFormTitle()
- {
- if (_mbean != null)
- {
- _formText = _mbean.getType();
- if ((_mbean.getVirtualHostName() != null) && (!DEFAULT_VH.equals(_mbean.getVirtualHostName())) )
- {
- _formText = _formText.replaceFirst(VIRTUAL_HOST, _mbean.getVirtualHostName());
- if (_mbean.getName() != null && _mbean.getName().length() != 0)
- {
- _formText = _formText + ": " + _mbean.getName();
- }
- }
- }
- else if ((_selectedNode.getVirtualHost() != null) && (!DEFAULT_VH.equals(_selectedNode.getVirtualHost())))
- {
- _formText = _selectedNode.getVirtualHost();
- }
- else
- {
- _formText = APPLICATION_NAME;
- }
- _form.setText(_formText);
- }
-
- public void refreshMBeanView()
- {
- try
- {
- if (_selectedNode == null || NODE_TYPE_SERVER.equals(_selectedNode.getType()) ||
- NODE_TYPE_DOMAIN.equals(_selectedNode.getType()) )
- {
- return;
- }
- else if (NODE_TYPE_TYPEINSTANCE.equals(_selectedNode.getType()))
- {
- // An virtual host instance is selected
- refreshTypeTabFolder(typeTabFolder.getItem(0));
- }
- else if (NODE_TYPE_MBEANTYPE.equals(_selectedNode.getType()))
- {
- refreshTypeTabFolder(_selectedNode.getName());
- }
- else if (NOTIFICATIONS.equals(_selectedNode.getType()))
- {
- refreshNotificationPage();
- }
- else if (MBEAN.equals(_selectedNode.getType()))
- {
- _mbean = (ManagedBean)_selectedNode.getManagedObject();
- showSelectedMBean();
- }
-
- _form.layout(true);
- _form.getBody().layout(true, true);
- }
- catch(Exception ex)
- {
- MBeanUtility.handleException(_mbean, ex);
- }
- }
-
- /**
- * Sets the managedServer based on the selection in the navigation view
- * At any given time MBeanView will be displaying information for an mbean of mbeantype
- * for a specifiv managed server. This server information will be used by the tab controllers
- * to get server registry.
- */
- private void setServer()
- {
- if (NODE_TYPE_SERVER.equals(_selectedNode.getType()) ||
- NODE_TYPE_DOMAIN.equals(_selectedNode.getType()) )
- {
- _server = (ManagedServer)_selectedNode.getManagedObject();
- _virtualHostName = null;
- }
- else
- {
- TreeObject parent = _selectedNode.getParent();
- while (parent != null && !parent.getType().equals(NODE_TYPE_SERVER))
- {
- parent = parent.getParent();
- }
-
- if (parent != null && parent.getType().equals(NODE_TYPE_SERVER))
- _server = (ManagedServer)parent.getManagedObject();
-
- _virtualHostName = _selectedNode.getVirtualHost();
- }
- }
-
- public static ManagedServer getServer()
- {
- return _server;
- }
-
- public static String getVirtualHost()
- {
- return _virtualHostName;
- }
-
- private void showSelectedMBean() throws Exception
- {
- try
- {
- MBeanUtility.getMBeanInfo(_mbean);
- }
- catch(Exception ex)
- {
- MBeanUtility.handleException(_mbean, ex);
- return;
- }
-
- TabFolder tabFolder = tabFolderMap.get(_mbean.getType());
- /*
- * This solution can be used if there are many versions of Qpid running. Otherwise
- * there is no need to create a tabFolder everytime a bean is selected.
- if (tabFolder != null && !tabFolder.isDisposed())
- {
- tabFolder.dispose();
- }
- tabFolder = createTabFolder();
- */
- if (tabFolder == null)
- {
- tabFolder = createMBeanTabFolder();
- }
-
- int tabIndex = 0;
- if (NOTIFICATIONS.equals(_selectedNode.getType()))
- {
- tabIndex = tabFolder.getItemCount() -1;
- }
-
- TabItem tab = tabFolder.getItem(tabIndex);
- // If folder is being set as visible after tab refresh, then the tab
- // doesn't have the focus.
- tabFolder.setSelection(tabIndex);
- refreshTab(tab);
- setVisible(tabFolder);
- }
-
- public void createPartControl(Composite parent)
- {
- // Create the Form
- _toolkit = new FormToolkit(parent.getDisplay());
- _form = _toolkit.createForm(parent);
- _form.getBody().setLayout(new FormLayout());
- _form.setText(APPLICATION_NAME);
-
- // Add selection listener for selection events in the Navigation view
- getSite().getPage().addSelectionListener(NavigationView.ID, selectionListener);
-
- // Add mbeantype TabFolder. This will list all the mbeans under a mbeantype (eg Queue, Exchange).
- // Using this list mbeans will be added in the navigation view
- createMBeanTypeTabFolder();
-
- createNotificationsTabFolder();
- }
-
- private TabFolder createMBeanTabFolder()
- {
- TabFolder tabFolder = new TabFolder(_form.getBody(), SWT.NONE);
- FormData layoutData = new FormData();
- layoutData.left = new FormAttachment(0);
- layoutData.top = new FormAttachment(0);
- layoutData.right = new FormAttachment(100);
- layoutData.bottom = new FormAttachment(100);
- tabFolder.setLayoutData(layoutData);
- tabFolder.setVisible(false);
-
- createAttributesTab(tabFolder);
- createOperationTabs(tabFolder);
- createNotificationsTab(tabFolder);
-
- tabFolder.addListener(SWT.Selection, new Listener()
- {
- public void handleEvent(Event evt)
- {
- TabItem tab = (TabItem)evt.item;
- refreshTab(tab);
- }
- });
-
- tabFolderMap.put(_mbean.getType(), tabFolder);
- return tabFolder;
- }
-
- private void refreshTab(TabItem tab)
- {
- // We can avoid refreshing the attributes tab because it's control
- // already contains the required values. But it is added for now and
- // will remove if there is any performance issue or any other issue.
- // The operations control should be refreshed because there is only one
- // controller for all operations tab.
- // The Notifications control needs to refresh with latest set of notifications
-
- if (tab == null)
- return;
-
- TabControl controller = (TabControl)tab.getData(CONTROLLER);
- controller.refresh(_mbean);
- }
-
- public void setFocus()
- {
- //_form.setFocus();
- }
-
- public void dispose()
- {
- _toolkit.dispose();
- super.dispose();
- }
-
- private void createAttributesTab(TabFolder tabFolder)
- {
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);
- if (serverRegistry.getAttributeModel(_mbean).getCount() == 0)
- {
- return;
- }
-
- TabItem tab = new TabItem(tabFolder, SWT.NONE);
- tab.setText(ATTRIBUTES);
- AttributesTabControl controller = new AttributesTabControl(tabFolder);
- tab.setControl(controller.getControl());
- tab.setData(CONTROLLER, controller);
- }
-
- private void createOperationTabs(TabFolder tabFolder)
- {
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);
- int operationsCount = serverRegistry.getOperationModel(_mbean).getCount();
- if (operationsCount == 0)
- {
- return;
- }
-
- OperationDataModel operationModel = serverRegistry.getOperationModel(_mbean);
- for (OperationData operationData : operationModel.getOperations())
- {
- TabItem operationTab = new TabItem(tabFolder, SWT.NONE);
- operationTab.setText(ViewUtility.getDisplayText(operationData.getName()));
- operationTab.setData(operationData);
- OperationTabControl control = new OperationTabControl(tabFolder, operationData);
- operationTab.setData(CONTROLLER, control);
- operationTab.setControl(control.getControl());
- }
- }
-
- private void createNotificationsTab(TabFolder tabFolder)
- {
- NotificationsTabControl controller = new NotificationsTabControl(tabFolder);
-
- TabItem tab = new TabItem(tabFolder, SWT.NONE);
- tab.setText(NOTIFICATIONS);
- tab.setData(CONTROLLER, controller);
- tab.setControl(controller.getControl());
- }
-
- /**
- * For the EditAttribtue Action. Invoking this from action is same as clicking
- * "EditAttribute" button from Attribute tab.
- */
- public void editAttribute() throws Exception
- {
- if (_mbean == null)
- throw new InfoRequiredException("Please select the managed object and then attribute to be edited");
-
- String name = (_mbean.getName() != null) ? _mbean.getName() : _mbean.getType();
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);
- if (serverRegistry.getAttributeModel(_mbean).getCount() == 0)
- {
- throw new InfoRequiredException("There are no attributes to be edited for " + name);
- }
-
- TabFolder tabFolder = tabFolderMap.get(_mbean.getType());
- int index = tabFolder.getSelectionIndex();
- if (index != 0)
- {
- tabFolder.setSelection(0);
- throw new InfoRequiredException("Please select the attribute to be edited");
- }
-
- TabItem tab = tabFolder.getItem(0);
- AttributesTabControl tabControl = (AttributesTabControl)tab.getData(CONTROLLER);
- AttributeData attribute = tabControl.getSelectionAttribute();
- if (attribute == null)
- throw new InfoRequiredException("Please select the attribute to be edited");
-
- tabControl.createDetailsPopup(attribute);
- }
-
- /**
- * Creates TabFolder and tabs for each mbeantype (eg Connection, Queue, Exchange)
- */
- private void createMBeanTypeTabFolder()
- {
- typeTabFolder = new TabFolder(_form.getBody(), SWT.NONE);
- FormData layoutData = new FormData();
- layoutData.left = new FormAttachment(0);
- layoutData.top = new FormAttachment(0);
- layoutData.right = new FormAttachment(100);
- layoutData.bottom = new FormAttachment(100);
- typeTabFolder.setLayoutData(layoutData);
- typeTabFolder.setVisible(false);
-
- TabItem tab = new TabItem(typeTabFolder, SWT.NONE);
- tab.setText(CONNECTION);
- MBeanTypeTabControl controller = new ConnectionTypeTabControl(typeTabFolder);
- tab.setData(CONTROLLER, controller);
- tab.setControl(controller.getControl());
-
- tab = new TabItem(typeTabFolder, SWT.NONE);
- tab.setText(EXCHANGE);
- controller = new ExchangeTypeTabControl(typeTabFolder);
- tab.setData(CONTROLLER, controller);
- tab.setControl(controller.getControl());
-
- tab = new TabItem(typeTabFolder, SWT.NONE);
- tab.setText(QUEUE);
- controller = new QueueTypeTabControl(typeTabFolder);
- tab.setData(CONTROLLER, controller);
- tab.setControl(controller.getControl());
-
- typeTabFolder.addListener(SWT.Selection, new Listener()
- {
- public void handleEvent(Event evt)
- {
- TabItem tab = (TabItem)evt.item;
- try
- {
- refreshTypeTabFolder(tab);
- }
- catch (Exception ex)
- {
- MBeanUtility.handleException(ex);
- }
- }
- });
- }
-
- private void createNotificationsTabFolder()
- {
- notificationTabFolder = new TabFolder(_form.getBody(), SWT.NONE);
- FormData layoutData = new FormData();
- layoutData.left = new FormAttachment(0);
- layoutData.top = new FormAttachment(0);
- layoutData.right = new FormAttachment(100);
- layoutData.bottom = new FormAttachment(100);
- notificationTabFolder.setLayoutData(layoutData);
- notificationTabFolder.setVisible(false);
-
- VHNotificationsTabControl controller = new VHNotificationsTabControl(notificationTabFolder);
- TabItem tab = new TabItem(notificationTabFolder, SWT.NONE);
- tab.setText(NOTIFICATIONS);
- tab.setData(CONTROLLER, controller);
- tab.setControl(controller.getControl());
- }
-
- private void refreshNotificationPage()
- {
- TabItem tab = notificationTabFolder.getItem(0);
- VHNotificationsTabControl controller = (VHNotificationsTabControl)tab.getData(CONTROLLER);
- controller.refresh();
- notificationTabFolder.setVisible(true);
- }
-
- /**
- * Refreshes the Selected mbeantype tab. The control lists all the available mbeans
- * for an mbeantype(eg Queue, Exchange etc)
- * @param tab
- * @throws Exception
- */
- private void refreshTypeTabFolder(TabItem tab) throws Exception
- {
- if (tab == null)
- {
- return;
- }
- typeTabFolder.setSelection(tab);
- MBeanTypeTabControl controller = (MBeanTypeTabControl)tab.getData(CONTROLLER);
- controller.refresh();
- typeTabFolder.setVisible(true);
- }
-
- private void refreshTypeTabFolder(String type) throws Exception
- {
- if (CONNECTION.equals(type))
- {
- refreshTypeTabFolder(typeTabFolder.getItem(0));
- }
- else if (EXCHANGE.equals(type))
- {
- refreshTypeTabFolder(typeTabFolder.getItem(1));
- }
- else if (QUEUE.equals(type))
- {
- refreshTypeTabFolder(typeTabFolder.getItem(2));
- }
- }
-
- /**
- * hides other folders and makes the given one visible.
- * @param tabFolder
- */
- private void setVisible(TabFolder tabFolder)
- {
- for (TabFolder folder : tabFolderMap.values())
- {
- if (folder == tabFolder)
- folder.setVisible(true);
- else
- folder.setVisible(false);
- }
- }
-
- private void setInvisible()
- {
- for (TabFolder folder : tabFolderMap.values())
- {
- folder.setVisible(false);
- }
-
- if (typeTabFolder != null)
- {
- typeTabFolder.setVisible(false);
- }
-
- if (notificationTabFolder != null)
- {
- notificationTabFolder.setVisible(false);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
deleted file mode 100644
index 1da13a9b56..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
+++ /dev/null
@@ -1,1253 +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.
- *
- */
-package org.apache.qpid.management.ui.views;
-
-import static org.apache.qpid.management.ui.Constants.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.ManagedServer;
-import org.apache.qpid.management.ui.ServerRegistry;
-import org.apache.qpid.management.ui.exceptions.InfoRequiredException;
-import org.apache.qpid.management.ui.jmx.JMXServerRegistry;
-import org.apache.qpid.management.ui.jmx.MBeanUtility;
-import org.eclipse.jface.preference.PreferenceStore;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IFontProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ITreeViewerListener;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * Navigation View for navigating the managed servers and managed beans on
- * those servers
- * @author Bhupendra Bhardwaj
- */
-public class NavigationView extends ViewPart
-{
- public static final String ID = "org.apache.qpid.management.ui.navigationView";
- public static final String INI_FILENAME = System.getProperty("user.home") + File.separator + "qpidManagementConsole.ini";
-
- private static final String INI_SERVERS = "Servers";
- private static final String INI_QUEUES = QUEUE + "s";
- private static final String INI_CONNECTIONS = CONNECTION + "s";
- private static final String INI_EXCHANGES = EXCHANGE + "s";
-
- private TreeViewer _treeViewer = null;
- private TreeObject _rootNode = null;
- private TreeObject _serversRootNode = null;
-
- private PreferenceStore _preferences;
- // Map of connected servers
- private HashMap<ManagedServer, TreeObject> _managedServerMap = new HashMap<ManagedServer, TreeObject>();
-
- private void createTreeViewer(Composite parent)
- {
- _treeViewer = new TreeViewer(parent);
- _treeViewer.setContentProvider(new ContentProviderImpl());
- _treeViewer.setLabelProvider(new LabelProviderImpl());
- _treeViewer.setSorter(new ViewerSorterImpl());
-
- // layout the tree viewer below the label field, to cover the area
- GridData layoutData = new GridData();
- layoutData = new GridData();
- layoutData.grabExcessHorizontalSpace = true;
- layoutData.grabExcessVerticalSpace = true;
- layoutData.horizontalAlignment = GridData.FILL;
- layoutData.verticalAlignment = GridData.FILL;
- _treeViewer.getControl().setLayoutData(layoutData);
- _treeViewer.setUseHashlookup(true);
-
- createListeners();
- }
-
- /**
- * Creates listeners for the JFace treeviewer
- */
- private void createListeners()
- {
- _treeViewer.addDoubleClickListener(new IDoubleClickListener()
- {
- public void doubleClick(DoubleClickEvent event)
- {
- IStructuredSelection ss = (IStructuredSelection) event.getSelection();
- if ((ss == null) || (ss.getFirstElement() == null))
- {
- return;
- }
-
- boolean state = _treeViewer.getExpandedState(ss.getFirstElement());
- _treeViewer.setExpandedState(ss.getFirstElement(), !state);
- }
- });
-
- _treeViewer.addTreeListener(new ITreeViewerListener()
- {
- public void treeExpanded(TreeExpansionEvent event)
- {
- _treeViewer.setExpandedState(event.getElement(), true);
- // Following will cause the selection event to be sent, so commented
- // _treeViewer.setSelection(new StructuredSelection(event.getElement()));
- _treeViewer.refresh();
- }
-
- public void treeCollapsed(TreeExpansionEvent event)
- {
- _treeViewer.setExpandedState(event.getElement(), false);
- _treeViewer.refresh();
- }
- });
-
- // This listener is for popup menu, which pops up if a queue,exchange or connection is selected
- // with right click.
- _treeViewer.getTree().addListener(SWT.MenuDetect, new Listener()
- {
- Display display = getSite().getShell().getDisplay();
- final Shell shell = new Shell(display);
-
- public void handleEvent(Event event)
- {
- Tree widget = (Tree) event.widget;
- TreeItem[] items = widget.getSelection();
- if (items == null)
- {
- return;
- }
-
- // Get the selected node
- final TreeObject selectedNode = (TreeObject) items[0].getData();
- final TreeObject parentNode = selectedNode.getParent();
-
- // This popup is only for mbeans and only connection,exchange and queue types
- if ((parentNode == null) || !MBEAN.equals(selectedNode.getType())
- || !(CONNECTION.equals(parentNode.getName()) || QUEUE.equals(parentNode.getName())
- || EXCHANGE.equals(parentNode.getName())))
- {
- return;
- }
-
- Menu menu = new Menu(shell, SWT.POP_UP);
- MenuItem item = new MenuItem(menu, SWT.PUSH);
- // Add the action item, which will remove the node from the tree if selected
- item.setText(ACTION_REMOVE_MBEANNODE);
- item.addListener(SWT.Selection, new Listener()
- {
- public void handleEvent(Event e)
- {
- removeManagedObject(parentNode, (ManagedBean) selectedNode.getManagedObject());
- _treeViewer.refresh();
- // set the selection to the parent node
- _treeViewer.setSelection(new StructuredSelection(parentNode));
- }
- });
- menu.setLocation(event.x, event.y);
- menu.setVisible(true);
- while (!menu.isDisposed() && menu.isVisible())
- {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
- }
-
- menu.dispose();
- }
- });
- }
-
- /**
- * Creates Qpid Server connection using JMX RMI protocol
- * @param server
- * @throws Exception
- */
- private void createRMIServerConnection(ManagedServer server) throws Exception
- {
- // Currently Qpid Management Console only supports JMX MBeanServer
- ServerRegistry serverRegistry = new JMXServerRegistry(server);
- ApplicationRegistry.addServer(server, serverRegistry);
- }
-
- /**
- * Adds a new server node in the navigation view if server connection is successful.
- * @param transportProtocol
- * @param host
- * @param port
- * @param domain
- * @throws Exception
- */
- public void addNewServer(String transportProtocol, String host, int port, String domain, String user, String pwd)
- throws Exception
- {
- String serverAddress = host + ":" + port;
- String url = null;
- ManagedServer managedServer = new ManagedServer(host, port, domain, user, pwd);
-
- if ("RMI".equals(transportProtocol))
- {
- url = managedServer.getUrl();
- List<TreeObject> list = _serversRootNode.getChildren();
- for (TreeObject node : list)
- {
- ManagedServer nodeServer = (ManagedServer)node.getManagedObject();
- if (url.equals(nodeServer.getUrl()))
- {
- // Server is already in the list of added servers, so now connect it.
- // Set the server node as selected and then connect it.
- _treeViewer.setSelection(new StructuredSelection(node));
- reconnect(user, pwd);
-
- return;
- }
- }
-
- // The server is not in the list of already added servers, so now connect and add it.
- managedServer.setName(serverAddress);
- createRMIServerConnection(managedServer);
- }
- else
- {
- throw new InfoRequiredException(transportProtocol + " transport is not supported");
- }
-
- // Server connection is successful. Now add the server in the tree
- TreeObject serverNode = new TreeObject(serverAddress, NODE_TYPE_SERVER);
- serverNode.setManagedObject(managedServer);
- _serversRootNode.addChild(serverNode);
-
- // Add server in the connected server map
- _managedServerMap.put(managedServer, serverNode);
-
- // populate the server tree
- try
- {
- populateServer(serverNode);
- }
- catch (SecurityException ex)
- {
- disconnect(managedServer);
- throw ex;
- }
-
- // Add the Queue/Exchanges/Connections from config file into the navigation tree
- addConfiguredItems(managedServer);
-
- _treeViewer.refresh();
-
- // save server address in file
- addServerInConfigFile(serverAddress);
- }
-
- /**
- * Create the config file, if it doesn't already exist.
- * Exits the application if the file could not be created.
- */
- private void createConfigFile()
- {
- File file = new File(INI_FILENAME);
- try
- {
- if (!file.exists())
- {
- file.createNewFile();
- }
- }
- catch (IOException ex)
- {
- System.out.println("Could not write to the file " + INI_FILENAME);
- System.out.println(ex);
- System.exit(1);
- }
- }
-
- /**
- * Server addresses are stored in a file. When user launches the application again, the
- * server addresses are picked up from the file and shown in the navigfation view. This method
- * adds the server address in a file, when a new server is added in the navigation view.
- * @param serverAddress
- */
- private void addServerInConfigFile(String serverAddress)
- {
- // Check if the address already exists
- List<String> list = getServerListFromFile();
- if ((list != null) && list.contains(serverAddress))
- {
- return;
- }
-
- // Get the existing server list and add to that
- String servers = _preferences.getString(INI_SERVERS);
- String value = (servers.length() != 0) ? (servers + "," + serverAddress) : serverAddress;
- _preferences.putValue(INI_SERVERS, value);
- try
- {
- _preferences.save();
- }
- catch (IOException ex)
- {
- System.err.println("Could not add " + serverAddress + " in " + INI_SERVERS + " (" + INI_FILENAME + ")");
- System.out.println(ex);
- }
- }
-
- /**
- * Adds the item (Queue/Exchange/Connection) to the config file
- * @param server
- * @param virtualhost
- * @param type - (Queue or Exchange or Connection)
- * @param name - item name
- */
- private void addItemInConfigFile(TreeObject node)
- {
- ManagedBean mbean = (ManagedBean) node.getManagedObject();
- String server = mbean.getServer().getName();
- String virtualhost = mbean.getVirtualHostName();
- String type = node.getParent().getName() + "s";
- String name = node.getName();
- String itemKey = server + "." + virtualhost + "." + type;
-
- // Check if the item already exists in the config file
- List<String> list = getConfiguredItemsFromFile(itemKey);
- if ((list != null) && list.contains(name))
- {
- return;
- }
-
- // Add this item to the existing list of items
- String items = _preferences.getString(itemKey);
- String value = (items.length() != 0) ? (items + "," + name) : name;
- _preferences.putValue(itemKey, value);
- try
- {
- _preferences.save();
- }
- catch (IOException ex)
- {
- System.err.println("Could not add " + name + " in " + itemKey + " (" + INI_FILENAME + ")");
- System.out.println(ex);
- }
- }
-
- private void removeItemFromConfigFile(TreeObject node)
- {
- ManagedBean mbean = (ManagedBean) node.getManagedObject();
- String server = mbean.getServer().getName();
- String vHost = mbean.getVirtualHostName();
- String type = node.getParent().getName() + "s";
- String itemKey = server + "." + vHost + "." + type;
-
- List<String> list = getConfiguredItemsFromFile(itemKey);
- if (list.contains(node.getName()))
- {
- list.remove(node.getName());
- String value = "";
- for (String item : list)
- {
- value += item + ",";
- }
-
- value = (value.lastIndexOf(",") != -1) ? value.substring(0, value.lastIndexOf(",")) : value;
-
- _preferences.putValue(itemKey, value);
- try
- {
- _preferences.save();
- }
- catch (IOException ex)
- {
- System.err.println("Error in updating the config file " + INI_FILENAME);
- System.out.println(ex);
- }
- }
- }
-
- /**
- * Queries the qpid server for MBeans and populates the navigation view with all MBeans for
- * the given server node.
- * @param serverNode
- */
- private void populateServer(TreeObject serverNode) throws Exception
- {
- ManagedServer server = (ManagedServer) serverNode.getManagedObject();
- String domain = server.getDomain();
- if (!domain.equals(ALL))
- {
- TreeObject domainNode = new TreeObject(domain, NODE_TYPE_DOMAIN);
- domainNode.setParent(serverNode);
-
- populateDomain(domainNode);
- }
- else
- {
- List<TreeObject> domainList = new ArrayList<TreeObject>();
- List<String> domains = MBeanUtility.getAllDomains(server);
-
- for (String domainName : domains)
- {
- TreeObject domainNode = new TreeObject(domainName, NODE_TYPE_DOMAIN);
- domainNode.setParent(serverNode);
-
- domainList.add(domainNode);
- populateDomain(domainNode);
- }
- }
- }
-
- /**
- * Queries the Qpid Server and populates the given domain node with all MBeans undser that domain.
- * @param domain
- * @throws IOException
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- private void populateDomain(TreeObject domain) throws IOException, Exception
- {
- ManagedServer server = (ManagedServer) domain.getParent().getManagedObject();
-
- // Now populate the mbenas under those types
- List<ManagedBean> mbeans = MBeanUtility.getManagedObjectsForDomain(server, domain.getName());
- for (ManagedBean mbean : mbeans)
- {
- mbean.setServer(server);
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(server);
- serverRegistry.addManagedObject(mbean);
-
- // Add all mbeans other than Connections, Exchanges and Queues. Because these will be added
- // manually by selecting from MBeanView
- if (!(mbean.isConnection() || mbean.isExchange() || mbean.isQueue()))
- {
- addManagedBean(domain, mbean);
- }
- }
- // To make it work with the broker without virtual host implementation.
- // This will add the default nodes to the domain node
- for (TreeObject child : domain.getChildren())
- {
- if (!child.getName().startsWith(VIRTUAL_HOST))
- {
- addDefaultNodes(domain);
- }
-
- break;
- }
- }
-
- /**
- * Add these three types - Connection, Exchange, Queue
- * By adding these, these will always be available, even if there are no mbeans under thse types
- * This is required because, the mbeans will be added from mbeanview, by selecting from the list
- * @param parent Node
- */
- private void addDefaultNodes(TreeObject parent)
- {
- TreeObject typeChild = new TreeObject(CONNECTION, NODE_TYPE_MBEANTYPE);
- typeChild.setParent(parent);
- typeChild.setVirtualHost(parent.getVirtualHost());
- typeChild = new TreeObject(EXCHANGE, NODE_TYPE_MBEANTYPE);
- typeChild.setParent(parent);
- typeChild.setVirtualHost(parent.getVirtualHost());
- typeChild = new TreeObject(QUEUE, NODE_TYPE_MBEANTYPE);
- typeChild.setParent(parent);
- typeChild.setVirtualHost(parent.getVirtualHost());
-
- // Add common notification node for virtual host
- TreeObject notificationNode = new TreeObject(NOTIFICATIONS, NOTIFICATIONS);
- notificationNode.setParent(parent);
- notificationNode.setVirtualHost(parent.getVirtualHost());
- }
-
- /**
- * Checks if a particular mbeantype is already there in the navigation view for a domain.
- * This is used while populating domain with mbeans.
- * @param parent
- * @param typeName
- * @return Node if given mbeantype already exists, otherwise null
- */
- private TreeObject getMBeanTypeNode(TreeObject parent, String typeName)
- {
- List<TreeObject> childNodes = parent.getChildren();
- for (TreeObject child : childNodes)
- {
- if ((NODE_TYPE_MBEANTYPE.equals(child.getType()) || NODE_TYPE_TYPEINSTANCE.equals(child.getType()))
- && typeName.equals(child.getName()))
- {
- return child;
- }
- }
-
- return null;
- }
-
- private boolean doesMBeanNodeAlreadyExist(TreeObject typeNode, String mbeanName)
- {
- List<TreeObject> childNodes = typeNode.getChildren();
- for (TreeObject child : childNodes)
- {
- if (MBEAN.equals(child.getType()) && mbeanName.equals(child.getName()))
- {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Adds the given MBean to the given domain node. Creates Notification node for the MBean.
- * sample ObjectNames -
- * org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost=localhost
- * org.apache.qpid:type=VirtualHost.Queue,VirtualHost=test,name=ping_1
- * @param domain
- * @param mbean
- * @throws Exception
- */
- private void addManagedBean(TreeObject domain, ManagedBean mbean) // throws Exception
- {
- String name = mbean.getName();
- // Split the mbean type into array of Strings, to create hierarchy
- // eg. type=VirtualHost.VirtualHostManager,VirtualHost=localhost will be:
- // localhost->VirtualHostManager
- // eg. type=org.apache.qpid:type=VirtualHost.Queue,VirtualHost=test,name=ping will be:
- // test->Queue->ping
- String[] types = mbean.getType().split("\\.");
- TreeObject typeNode = null;
- TreeObject parentNode = domain;
-
- // Run this loop till all nodes(hierarchy) for this mbean are created. This loop only creates
- // all the required parent nodes for the mbean
- for (int i = 0; i < types.length; i++)
- {
- String type = types[i];
- String valueOftype = mbean.getProperty(type);
- // If value is not null, then there will be a parent node for this mbean
- // eg. for type=VirtualHost the value is "test"
- typeNode = getMBeanTypeNode(parentNode, type);
-
- // create the type node if not already created
- if (typeNode == null)
- {
- // If the ObjectName doesn't have name property, that means there will be only one instance
- // of this mbean for given "type". So there will be no type node created for this mbean.
- if ((name == null) && (i == (types.length - 1)))
- {
- break;
- }
-
- // create a node for "type"
- typeNode = createTypeNode(parentNode, type);
- if (!type.equals(VIRTUAL_HOST))
- {
- typeNode.setVirtualHost(mbean.getVirtualHostName());
- }
- }
-
- // now type node create becomes the parent node for next node in hierarchy
- parentNode = typeNode;
-
- /*
- * Now create instances node for this type if value exists.
- */
- if (valueOftype == null)
- {
- // No instance node will be created when value is null (eg type=Queue)
- break;
- }
-
- // For different virtual hosts, the nodes with given value will be created.
- // eg type=VirtualHost, value=test
- typeNode = getMBeanTypeNode(parentNode, valueOftype);
- if (typeNode == null)
- {
- typeNode = createTypeInstanceNode(parentNode, valueOftype);
- typeNode.setVirtualHost(mbean.getVirtualHostName());
-
- // Create default nodes for VHost instances
- if (type.equals(VIRTUAL_HOST))
- {
- addDefaultNodes(typeNode);
- }
- }
-
- parentNode = typeNode;
- }
-
- if (typeNode == null)
- {
- typeNode = parentNode;
- }
-
- // Check if an MBean is already added
- if (doesMBeanNodeAlreadyExist(typeNode, name))
- {
- return;
- }
-
- // Add the mbean node now
- TreeObject mbeanNode = new TreeObject(mbean);
- mbeanNode.setParent(typeNode);
-
- // Add the mbean to the config file
- if (mbean.isQueue() || mbean.isExchange() || mbean.isConnection())
- {
- addItemInConfigFile(mbeanNode);
- }
-
- // Add notification node
- // TODO: show this only if the mbean sends any notification
- //TreeObject notificationNode = new TreeObject(NOTIFICATION, NOTIFICATION);
- //notificationNode.setParent(mbeanNode);
- }
-
- private TreeObject createTypeNode(TreeObject parent, String name)
- {
- TreeObject typeNode = new TreeObject(name, NODE_TYPE_MBEANTYPE);
- typeNode.setParent(parent);
-
- return typeNode;
- }
-
- private TreeObject createTypeInstanceNode(TreeObject parent, String name)
- {
- TreeObject typeNode = new TreeObject(name, NODE_TYPE_TYPEINSTANCE);
- typeNode.setParent(parent);
-
- return typeNode;
- }
-
- /**
- * Removes all the child nodes of the given parent node. Used when closing a server.
- * @param parent
- */
- private void removeManagedObject(TreeObject parent)
- {
- List<TreeObject> list = parent.getChildren();
- for (TreeObject child : list)
- {
- removeManagedObject(child);
- }
-
- list.clear();
- }
-
- /**
- * Removes the mbean from the tree
- * @param parent
- * @param mbean
- */
- private void removeManagedObject(TreeObject parent, ManagedBean mbean)
- {
- List<TreeObject> list = parent.getChildren();
- TreeObject objectToRemove = null;
- for (TreeObject child : list)
- {
- if (MBEAN.equals(child.getType()))
- {
- String name = (mbean.getName() != null) ? mbean.getName() : mbean.getType();
- if (child.getName().equals(name))
- {
- objectToRemove = child;
-
- break;
- }
- }
- else
- {
- removeManagedObject(child, mbean);
- }
- }
-
- if (objectToRemove != null)
- {
- list.remove(objectToRemove);
- removeItemFromConfigFile(objectToRemove);
- }
-
- }
-
- /**
- * Closes the Qpid server connection
- */
- public void disconnect() throws Exception
- {
- TreeObject selectedNode = getSelectedServerNode();
- ManagedServer managedServer = (ManagedServer) selectedNode.getManagedObject();
- disconnect(managedServer);
- }
-
- private void disconnect(ManagedServer managedServer) throws Exception
- {
- if (!_managedServerMap.containsKey(managedServer))
- {
- return;
- }
-
- // Close server connection
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(managedServer);
- if (serverRegistry == null) // server connection is already closed
- {
- return;
- }
-
- serverRegistry.closeServerConnection();
- // Add server to the closed server list and the worker thread will remove the server from required places.
- ApplicationRegistry.serverConnectionClosed(managedServer);
- }
-
- /**
- * Connects the selected server node
- * @throws Exception
- */
- public void reconnect(String user, String password) throws Exception
- {
- TreeObject selectedNode = getSelectedServerNode();
- ManagedServer managedServer = (ManagedServer) selectedNode.getManagedObject();
- if (_managedServerMap.containsKey(managedServer))
- {
- throw new InfoRequiredException("Server " + managedServer.getName() + " is already connected");
- }
-
- managedServer.setUser(user);
- managedServer.setPassword(password);
- createRMIServerConnection(managedServer);
-
- // put the server in the managed server map
- _managedServerMap.put(managedServer, selectedNode);
-
- try
- {
- // populate the server tree now
- populateServer(selectedNode);
- }
- catch (SecurityException ex)
- {
- disconnect(managedServer);
- throw ex;
- }
-
-
- // Add the Queue/Exchanges/Connections from config file into the navigation tree
- addConfiguredItems(managedServer);
-
- _treeViewer.refresh();
- }
-
- /**
- * Adds the items(queues/exchanges/connectins) from config file to the server tree
- * @param server
- */
- private void addConfiguredItems(ManagedServer server)
- {
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(server);
- List<String> list = serverRegistry.getVirtualHosts();
- for (String virtualHost : list)
- {
- // Add Queues
- String itemKey = server.getName() + "." + virtualHost + "." + INI_QUEUES;
- List<String> items = getConfiguredItemsFromFile(itemKey);
- List<ManagedBean> mbeans = serverRegistry.getQueues(virtualHost);
- addConfiguredItems(items, mbeans);
-
- // Add Exchanges
- itemKey = server.getName() + "." + virtualHost + "." + INI_EXCHANGES;
- items = getConfiguredItemsFromFile(itemKey);
- mbeans = serverRegistry.getExchanges(virtualHost);
- addConfiguredItems(items, mbeans);
-
- // Add Connections
- itemKey = server.getName() + "." + virtualHost + "." + INI_CONNECTIONS;
- items = getConfiguredItemsFromFile(itemKey);
- mbeans = serverRegistry.getConnections(virtualHost);
- addConfiguredItems(items, mbeans);
- }
- }
-
- /**
- * Gets the mbeans corresponding to the items and adds those to the navigation tree
- * @param items
- * @param mbeans
- */
- private void addConfiguredItems(List<String> items, List<ManagedBean> mbeans)
- {
- if ((items == null) || (items.isEmpty() | (mbeans == null)) || mbeans.isEmpty())
- {
- return;
- }
-
- for (String item : items)
- {
- for (ManagedBean mbean : mbeans)
- {
- if (item.equals(mbean.getName()))
- {
- addManagedBean(mbean);
-
- break;
- }
- }
- }
- }
-
- /**
- * Closes the Qpid server connection if not already closed and removes the server node from the navigation view and
- * also from the ini file stored in the system.
- * @throws Exception
- */
- public void removeServer() throws Exception
- {
- disconnect();
-
- // Remove from the Tree
- String serverNodeName = getSelectedServerNode().getName();
- List<TreeObject> list = _serversRootNode.getChildren();
- TreeObject objectToRemove = null;
- for (TreeObject child : list)
- {
- if (child.getName().equals(serverNodeName))
- {
- objectToRemove = child;
-
- break;
- }
- }
-
- if (objectToRemove != null)
- {
- list.remove(objectToRemove);
- }
-
- _treeViewer.refresh();
-
- // Remove from the ini file
- removeServerFromConfigFile(serverNodeName);
- }
-
- private void removeServerFromConfigFile(String serverNodeName)
- {
- List<String> serversList = getServerListFromFile();
- serversList.remove(serverNodeName);
-
- String value = "";
- for (String item : serversList)
- {
- value += item + ",";
- }
-
- value = (value.lastIndexOf(",") != -1) ? value.substring(0, value.lastIndexOf(",")) : value;
-
- _preferences.putValue(INI_SERVERS, value);
-
- try
- {
- _preferences.save();
- }
- catch (IOException ex)
- {
- System.err.println("Error in updating the config file " + INI_FILENAME);
- System.out.println(ex);
- }
- }
-
- /**
- * @return the server addresses from the ini file
- * @throws Exception
- */
- private List<String> getServerListFromFile()
- {
- return getConfiguredItemsFromFile(INI_SERVERS);
- }
-
- /**
- * Returns the list of items from the config file.
- * sample ini file:
- * Servers=localhost:8999,127.0.0.1:8999
- * localhost.virtualhost1.Queues=queue1,queue2
- * localhost.virtualhost1.Exchanges=exchange1,exchange2
- * localhost.virtualhost2.Connections=conn1
- * @param key
- * @return
- */
- private List<String> getConfiguredItemsFromFile(String key)
- {
- List<String> list = new ArrayList<String>();
- String items = _preferences.getString(key);
- if (items.length() != 0)
- {
- String[] array = items.split(",");
- for (String item : array)
- {
- list.add(item);
- }
- }
-
- return list;
- }
-
- public TreeObject getSelectedServerNode() throws Exception
- {
- IStructuredSelection ss = (IStructuredSelection) _treeViewer.getSelection();
- TreeObject selectedNode = (TreeObject) ss.getFirstElement();
- if (ss.isEmpty() || (selectedNode == null) || (!selectedNode.getType().equals(NODE_TYPE_SERVER)))
- {
- throw new InfoRequiredException("Please select the server");
- }
-
- return selectedNode;
- }
-
- /**
- * This is a callback that will allow us to create the viewer and initialize
- * it.
- */
- public void createPartControl(Composite parent)
- {
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginHeight = 2;
- gridLayout.marginWidth = 2;
- gridLayout.horizontalSpacing = 0;
- gridLayout.verticalSpacing = 2;
- composite.setLayout(gridLayout);
-
- createTreeViewer(composite);
- _rootNode = new TreeObject("ROOT", "ROOT");
- _serversRootNode = new TreeObject(NAVIGATION_ROOT, "ROOT");
- _serversRootNode.setParent(_rootNode);
-
- _treeViewer.setInput(_rootNode);
- // set viewer as selection event provider for MBeanView
- getSite().setSelectionProvider(_treeViewer);
-
- // Start worker thread to refresh tree for added or removed objects
- (new Thread(new Worker())).start();
-
- createConfigFile();
- _preferences = new PreferenceStore(INI_FILENAME);
-
- try
- {
- _preferences.load();
- }
- catch (IOException ex)
- {
- System.out.println(ex);
- }
-
- // load the list of servers already added from file
- List<String> serversList = getServerListFromFile();
- if (serversList != null)
- {
- for (String serverAddress : serversList)
- {
- String[] server = serverAddress.split(":");
- ManagedServer managedServer = new ManagedServer(server[0], Integer.parseInt(server[1]), "org.apache.qpid");
- TreeObject serverNode = new TreeObject(serverAddress, NODE_TYPE_SERVER);
- serverNode.setManagedObject(managedServer);
- _serversRootNode.addChild(serverNode);
- }
- }
-
- _treeViewer.refresh();
-
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- public void setFocus()
- { }
-
- public void refresh()
- {
- _treeViewer.refresh();
- }
-
- /**
- * Content provider class for the tree viewer
- */
- private class ContentProviderImpl implements ITreeContentProvider
- {
- public Object[] getElements(Object parent)
- {
- return getChildren(parent);
- }
-
- public Object[] getChildren(final Object parentElement)
- {
- final TreeObject node = (TreeObject) parentElement;
-
- return node.getChildren().toArray(new TreeObject[0]);
- }
-
- public Object getParent(final Object element)
- {
- final TreeObject node = (TreeObject) element;
-
- return node.getParent();
- }
-
- public boolean hasChildren(final Object element)
- {
- final TreeObject node = (TreeObject) element;
-
- return !node.getChildren().isEmpty();
- }
-
- public void inputChanged(final Viewer viewer, final Object oldInput, final Object newInput)
- {
- // Do nothing
- }
-
- public void dispose()
- {
- // Do nothing
- }
- }
-
- /**
- * Label provider class for the tree viewer
- */
- private class LabelProviderImpl extends LabelProvider implements IFontProvider
- {
- public Image getImage(Object element)
- {
- TreeObject node = (TreeObject) element;
- if (node.getType().equals(NOTIFICATIONS))
- {
- return ApplicationRegistry.getImage(NOTIFICATION_IMAGE);
- }
- else if (!node.getType().equals(MBEAN))
- {
- if (_treeViewer.getExpandedState(node))
- {
- return ApplicationRegistry.getImage(OPEN_FOLDER_IMAGE);
- }
- else
- {
- return ApplicationRegistry.getImage(CLOSED_FOLDER_IMAGE);
- }
-
- }
- else
- {
- return ApplicationRegistry.getImage(MBEAN_IMAGE);
- }
- }
-
- public String getText(Object element)
- {
- TreeObject node = (TreeObject) element;
- if (node.getType().equals(NODE_TYPE_MBEANTYPE))
- {
- return node.getName() + "s";
- }
- else
- {
- return node.getName();
- }
- }
-
- public Font getFont(Object element)
- {
- TreeObject node = (TreeObject) element;
- if (node.getType().equals(NODE_TYPE_SERVER))
- {
- if (node.getChildren().isEmpty())
- {
- return ApplicationRegistry.getFont(FONT_NORMAL);
- }
- else
- {
- return ApplicationRegistry.getFont(FONT_BOLD);
- }
- }
-
- return ApplicationRegistry.getFont(FONT_NORMAL);
- }
- } // End of LabelProviderImpl
-
- private class ViewerSorterImpl extends ViewerSorter
- {
- public int category(Object element)
- {
- TreeObject node = (TreeObject) element;
- if (node.getType().equals(MBEAN))
- {
- return 1;
- }
- if (node.getType().equals(NOTIFICATIONS))
- {
- return 2;
- }
- return 3;
- }
- }
-
- /**
- * Worker thread, which keeps looking for new ManagedObjects to be added and
- * unregistered objects to be removed from the tree.
- * @author Bhupendra Bhardwaj
- */
- private class Worker implements Runnable
- {
- public void run()
- {
- while (true)
- {
- if (!_managedServerMap.isEmpty())
- {
- refreshRemovedObjects();
- refreshClosedServerConnections();
- }
-
- try
- {
- Thread.sleep(3000);
- }
- catch (Exception ex)
- { }
-
- } // end of while loop
- } // end of run method.
- } // end of Worker class
-
- /**
- * Adds the mbean to the navigation tree
- * @param mbean
- * @throws Exception
- */
- public void addManagedBean(ManagedBean mbean) // throws Exception
- {
- TreeObject treeServerObject = _managedServerMap.get(mbean.getServer());
- List<TreeObject> domains = treeServerObject.getChildren();
- TreeObject domain = null;
- for (TreeObject child : domains)
- {
- if (child.getName().equals(mbean.getDomain()))
- {
- domain = child;
-
- break;
- }
- }
-
- addManagedBean(domain, mbean);
- _treeViewer.refresh();
- }
-
- private void refreshRemovedObjects()
- {
- for (ManagedServer server : _managedServerMap.keySet())
- {
- final ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(server);
- if (serverRegistry == null) // server connection is closed
- {
- continue;
- }
-
- final List<ManagedBean> removalList = serverRegistry.getObjectsToBeRemoved();
- if (removalList != null)
- {
- Display display = getSite().getShell().getDisplay();
- display.syncExec(new Runnable()
- {
- public void run()
- {
- for (ManagedBean mbean : removalList)
- {
- TreeObject treeServerObject = _managedServerMap.get(mbean.getServer());
- List<TreeObject> domains = treeServerObject.getChildren();
- TreeObject domain = null;
- for (TreeObject child : domains)
- {
- if (child.getName().equals(mbean.getDomain()))
- {
- domain = child;
-
- break;
- }
- }
-
- removeManagedObject(domain, mbean);
- // serverRegistry.removeManagedObject(mbean);
- }
-
- _treeViewer.refresh();
- }
- });
- }
- }
- }
-
- /**
- * Gets the list of closed server connection from the ApplicationRegistry and then removes
- * the closed server nodes from the navigation view
- */
- private void refreshClosedServerConnections()
- {
- final List<ManagedServer> closedServers = ApplicationRegistry.getClosedServers();
- if (closedServers != null)
- {
- Display display = getSite().getShell().getDisplay();
- display.syncExec(new Runnable()
- {
- public void run()
- {
- for (ManagedServer server : closedServers)
- {
- removeManagedObject(_managedServerMap.get(server));
- _managedServerMap.remove(server);
- ApplicationRegistry.removeServer(server);
- }
-
- _treeViewer.refresh();
- }
- });
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java
deleted file mode 100644
index 6894080859..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java
+++ /dev/null
@@ -1,427 +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.
- *
- */
-package org.apache.qpid.management.ui.views;
-
-import static org.apache.qpid.management.ui.Constants.BUTTON_CLEAR;
-import static org.apache.qpid.management.ui.Constants.BUTTON_REFRESH;
-import static org.apache.qpid.management.ui.Constants.DESCRIPTION;
-import static org.apache.qpid.management.ui.Constants.FONT_BOLD;
-import static org.apache.qpid.management.ui.Constants.FONT_BUTTON;
-import static org.apache.qpid.management.ui.Constants.FONT_ITALIC;
-import static org.apache.qpid.management.ui.Constants.SUBSCRIBE_BUTTON;
-import static org.apache.qpid.management.ui.Constants.UNSUBSCRIBE_BUTTON;
-
-import java.util.List;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.ServerRegistry;
-import org.apache.qpid.management.ui.jmx.MBeanUtility;
-import org.apache.qpid.management.ui.model.NotificationInfoModel;
-import org.apache.qpid.management.ui.model.NotificationObject;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TabFolder;
-
-/**
- * Creates control composite for Notifications tab
- * @author Bhupendra Bhardwaj
- */
-public class NotificationsTabControl extends VHNotificationsTabControl
-{
- private static final String SELECT_NOTIFICATIONNAME = "Select Notification";
- private static final String SELECT_NOTIFICATIONTYPE = "Select Type";
- private SelectionListener selectionListener;
- private SelectionListener comboListener;
-
- private Combo notificationNameCombo = null;
- private Combo typesCombo = null;
- private Label descriptionLabel = null;
- private Button _subscribeButton = null;
- private Button _unsubscribeButton = null;
-
- public NotificationsTabControl(TabFolder tabFolder)
- {
- super(tabFolder);
- }
-
- protected void createWidgets()
- {
- selectionListener = new SelectionListenerImpl();
- comboListener = new ComboSelectionListener();
- createNotificationInfoComposite();
- //addFilterComposite();
- addButtons();
- createTableViewer();
- }
-
- /**
- * Creates composite and populates for displaying Notification Information (name, type, description)
- * and creates buttons for subscribing or unsubscribing for notifications
- */
- private void createNotificationInfoComposite()
- {
- Composite composite = _toolkit.createComposite(_form.getBody(), SWT.NONE);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- composite.setLayout(new FormLayout());
-
- Label label = _toolkit.createLabel(composite, "Select the notification to subscribe or unsubscribe");
- label.setFont(ApplicationRegistry.getFont(FONT_BOLD));
- FormData formData = new FormData();
- formData.top = new FormAttachment(0, 10);
- formData.left = new FormAttachment(0, 10);
- label.setLayoutData(formData);
-
- notificationNameCombo = new Combo(composite, SWT.READ_ONLY | SWT.DROP_DOWN);
- formData = new FormData();
- formData.top = new FormAttachment(label, 10);
- formData.left = new FormAttachment(0, 10);
- formData.right = new FormAttachment(40);
- notificationNameCombo.setLayoutData(formData);
- notificationNameCombo.addSelectionListener(comboListener);
-
- typesCombo = new Combo(composite, SWT.READ_ONLY | SWT.DROP_DOWN);
- formData = new FormData();
- formData.top = new FormAttachment(label, 10);
- formData.left = new FormAttachment(notificationNameCombo, 5);
- formData.right = new FormAttachment(65);
- typesCombo.setLayoutData(formData);
- typesCombo.addSelectionListener(comboListener);
-
- _subscribeButton = new Button(composite, SWT.PUSH | SWT.CENTER);
- _subscribeButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- _subscribeButton.setText(SUBSCRIBE_BUTTON);
- formData = new FormData();
- formData.top = new FormAttachment(label, 10);
- formData.left = new FormAttachment(65, 10);
- formData.width = 80;
- _subscribeButton.setLayoutData(formData);
- _subscribeButton.addSelectionListener(selectionListener);
-
- _unsubscribeButton = new Button(composite, SWT.PUSH | SWT.CENTER);
- _unsubscribeButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- _unsubscribeButton.setText(UNSUBSCRIBE_BUTTON);
- formData = new FormData();
- formData.top = new FormAttachment(label, 10);
- formData.left = new FormAttachment(_subscribeButton, 10);
- formData.width = 80;
- _unsubscribeButton.setLayoutData(formData);
- _unsubscribeButton.addSelectionListener(selectionListener);
-
- Label fixedLabel = _toolkit.createLabel(composite, "");
- formData = new FormData();
- formData.top = new FormAttachment(notificationNameCombo, 5);
- formData.left = new FormAttachment(0, 10);
- fixedLabel.setLayoutData(formData);
- fixedLabel.setText(DESCRIPTION + " : ");
- fixedLabel.setFont(ApplicationRegistry.getFont(FONT_BOLD));
-
- descriptionLabel = _toolkit.createLabel(composite, "");
- formData = new FormData();
- formData.top = new FormAttachment(notificationNameCombo, 5);
- formData.left = new FormAttachment(fixedLabel, 10);
- formData.right = new FormAttachment(100);
- descriptionLabel.setLayoutData(formData);
- descriptionLabel.setText(" ");
- descriptionLabel.setFont(ApplicationRegistry.getFont(FONT_ITALIC));
- }
-
- /**
- * Creates clear buttin and refresh button
- */
- protected void addButtons()
- {
- Composite composite = _toolkit.createComposite(_form.getBody(), SWT.NONE);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- composite.setLayout(new GridLayout(2, true));
-
- // Add Clear Button
- _clearButton = _toolkit.createButton(composite, BUTTON_CLEAR, SWT.PUSH | SWT.CENTER);
- _clearButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- GridData gridData = new GridData(SWT.LEAD, SWT.TOP, true, false);
- gridData.widthHint = 80;
- _clearButton.setLayoutData(gridData);
- _clearButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- if (_mbean == null)
- return;
-
- IStructuredSelection ss = (IStructuredSelection)_tableViewer.getSelection();
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);
- serverRegistry.clearNotifications(_mbean, ss.toList());
- refresh();
- }
- });
-
- // Add Refresh Button
- _refreshButton = _toolkit.createButton(composite, BUTTON_REFRESH, SWT.PUSH | SWT.CENTER);
- _refreshButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- gridData = new GridData(SWT.TRAIL, SWT.TOP, true, false);
- gridData.widthHint = 80;
- _refreshButton.setLayoutData(gridData);
- _refreshButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- if (_mbean == null)
- return;
-
- refresh();
- }
- });
- }
-
- @Override
- public void refresh(ManagedBean mbean)
- {
- _mbean = mbean;
- _notifications = null;
- _table.deselectAll();
- _tableViewer.getTable().clearAll();
-
- if (_mbean == null)
- {
- _tableViewer.getTable().clearAll();
- _subscribeButton.setEnabled(false);
- _unsubscribeButton.setEnabled(false);
- return;
- }
-
- if (!doesMBeanSendsNotification())
- {
- Control[] children = _form.getBody().getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].setVisible(false);
- }
-
- String name = (_mbean.getName() != null) ? _mbean.getName() : _mbean.getType();
- _form.setText(name + " does not send any notification");
- return;
- }
-
- Control[] children = _form.getBody().getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].setVisible(true);
- }
-
- populateNotificationInfo();
- workerRunning = true;
- _form.layout(true);
- _form.getBody().layout(true, true);
- }
-
- public void refresh()
- {
- _notifications = null;
- _table.deselectAll();
- _tableViewer.getTable().clearAll();
- }
-
- /**
- * Fills the notification information widgets for selected mbean
- */
- private void populateNotificationInfo()
- {
- notificationNameCombo.removeAll();
- NotificationInfoModel[] items = MBeanUtility.getNotificationInfo(_mbean);
- if (items.length > 1)
- {
- notificationNameCombo.add(SELECT_NOTIFICATIONNAME);
- }
-
- for (int i = 0; i < items.length; i++)
- {
- notificationNameCombo.add(items[i].getName());
- notificationNameCombo.setData(items[i].getName(), items[i]);
- }
- notificationNameCombo.select(0);
-
- typesCombo.removeAll();
- typesCombo.add("Select Type", 0);
- typesCombo.select(0);
- typesCombo.setEnabled(false);
-
- populateNotificationType(notificationNameCombo.getItem(0));
- checkForEnablingButtons();
- }
-
- /**
- * Checks and the enabing/disabling of buttons
- */
- private void checkForEnablingButtons()
- {
- int nameIndex = notificationNameCombo.getSelectionIndex();
- int itemCount = notificationNameCombo.getItems().length;
- if ((itemCount > 1) && (nameIndex == 0))
- {
- _subscribeButton.setEnabled(false);
- _unsubscribeButton.setEnabled(false);
- descriptionLabel.setText("");
- return;
- }
-
- int typeIndex = typesCombo.getSelectionIndex();
- itemCount = typesCombo.getItems().length;
- if ((itemCount > 1) && (typeIndex == 0))
- {
- _subscribeButton.setEnabled(false);
- _unsubscribeButton.setEnabled(false);
- return;
- }
-
- String type = typesCombo.getItem(typeIndex);
- String name = notificationNameCombo.getItem(nameIndex);
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);
-
- if (serverRegistry.hasSubscribedForNotifications(_mbean, name, type))
- {
- _subscribeButton.setEnabled(false);
- _unsubscribeButton.setEnabled(true);
- }
- else
- {
- _subscribeButton.setEnabled(true);
- _unsubscribeButton.setEnabled(false);
- }
- }
-
- private boolean doesMBeanSendsNotification()
- {
- NotificationInfoModel[] items = MBeanUtility.getNotificationInfo(_mbean);
- if (items == null || items.length == 0)
- return false;
- else
- return true;
- }
-
- /**
- * Selection listener for subscribing or unsubscribing the notifications
- */
- private class SelectionListenerImpl extends SelectionAdapter
- {
- public void widgetSelected(SelectionEvent e)
- {
- if (_mbean == null)
- return;
-
- Button source = (Button)e.getSource();
- String type = typesCombo.getItem(typesCombo.getSelectionIndex());
- String name = notificationNameCombo.getItem(notificationNameCombo.getSelectionIndex());
- if (source == _unsubscribeButton)
- {
- try
- {
- MBeanUtility.removeNotificationListener(_mbean, name, type);
- }
- catch(Exception ex)
- {
- MBeanUtility.handleException(ex);
- }
- }
- else if (source == _subscribeButton)
- {
- try
- {
- MBeanUtility.createNotificationlistener(_mbean, name, type);
- }
- catch(Exception ex)
- {
- MBeanUtility.handleException(ex);
- }
- }
- checkForEnablingButtons();
- }
- }
-
- /**
- * Selection listener class for the Notification Name. The notification type and description will be
- * displayed accordingly
- */
- private class ComboSelectionListener extends SelectionAdapter
- {
- public void widgetSelected(SelectionEvent e)
- {
- if (_mbean == null)
- return;
-
- Combo combo = (Combo)e.getSource();
- if (combo == notificationNameCombo)
- {
- String selectedItem = combo.getItem(combo.getSelectionIndex());
- populateNotificationType(selectedItem);
- }
- checkForEnablingButtons();
- }
- }
-
- private void populateNotificationType(String notificationName)
- {
- NotificationInfoModel data = (NotificationInfoModel)notificationNameCombo.getData(notificationName);
- if (data == null)
- {
- descriptionLabel.setText("");
- typesCombo.select(0);
- typesCombo.setEnabled(false);
- return;
- }
- descriptionLabel.setText(data.getDescription());
- typesCombo.removeAll();
- typesCombo.setItems(data.getTypes());
- if (typesCombo.getItemCount() > 1)
- {
- typesCombo.add(SELECT_NOTIFICATIONTYPE, 0);
- }
- typesCombo.select(0);
- typesCombo.setEnabled(true);
- }
-
- /**
- * Updates the table with new notifications received from mbean server for the selected mbean
- */
- protected void updateTableViewer()
- {
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(_mbean);
- List<NotificationObject> newList = serverRegistry.getNotifications(_mbean);
- if (newList == null)
- return;
-
- _notifications = newList;
- _tableViewer.setInput(_notifications);
- _tableViewer.refresh();
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NumberVerifyListener.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NumberVerifyListener.java
deleted file mode 100644
index 1774209dae..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NumberVerifyListener.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.management.ui.views;
-
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-
-/**
- * Implementation of VeryfyListener for numeric values
- * @author Bhupendra Bhardwaj
- */
-public class NumberVerifyListener implements VerifyListener
-{
- public void verifyText(VerifyEvent event)
- {
- String string = event.text;
- char [] chars = new char [string.length ()];
- string.getChars (0, chars.length, chars, 0);
- for (int i=0; i<chars.length; i++)
- {
- if (!('0' <= chars [i] && chars [i] <= '9'))
- {
- event.doit = false;
- return;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
deleted file mode 100644
index 36ad1b4fdc..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
+++ /dev/null
@@ -1,903 +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.
- *
- */
-package org.apache.qpid.management.ui.views;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map.Entry;
-
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.TabularDataSupport;
-
-import static org.apache.qpid.management.ui.Constants.*;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.ServerRegistry;
-import org.apache.qpid.management.ui.jmx.JMXServerRegistry;
-import org.apache.qpid.management.ui.jmx.MBeanUtility;
-import org.apache.qpid.management.ui.model.OperationData;
-import org.apache.qpid.management.ui.model.ParameterData;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.Form;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-
-/**
- * Control class for the MBean operations tab. It creates the required widgets
- * for the selected MBean.
- * @author Bhupendra Bhardwaj
- * @author Robert Gemmell
- */
-public class OperationTabControl extends TabControl
-{
- private static final int heightForAParameter = 30;
- private static final int labelWidth = 30;
- private static final int valueWidth = labelWidth + 25;
-
- private FormToolkit _toolkit;
- private Form _form;
- private OperationData _opData;
-
- private SelectionListener operationExecutionListener = new OperationExecutionListener();
- private SelectionListener refreshListener = new RefreshListener();
- private SelectionListener parameterSelectionListener = new ParameterSelectionListener();
- private SelectionListener booleanSelectionListener = new BooleanSelectionListener();
- private VerifyListener verifyListener = new VerifyListenerImpl();
- private KeyListener keyListener = new KeyListenerImpl();
- private KeyListener headerBindingListener = new HeaderBindingKeyListener();
-
- private Composite _headerComposite = null;
- private Composite _paramsComposite = null;
- private Composite _resultsComposite = null;
- private Button _executionButton = null;
-
- // for customized method in header exchange
- private HashMap<Text, Text> headerBindingHashMap = null;
- private String _virtualHostName = null;
-
- public OperationTabControl(TabFolder tabFolder, OperationData opData)
- {
- super(tabFolder);
- _toolkit = new FormToolkit(_tabFolder.getDisplay());
- _form = _toolkit.createForm(_tabFolder);
- _form.getBody().setLayout(new GridLayout());
- _opData = opData;
- createComposites();
- setHeader();
- }
-
- /**
- * Form area is devided in four parts:
- * Header composite - displays operaiton information
- * Patameters composite - displays parameters if there
- * Button - operation execution button
- * Results composite - displays results for operations, which have
- * no parameters but have some return value
- */
- private void createComposites()
- {
- //
- _headerComposite = _toolkit.createComposite(_form.getBody(), SWT.NONE);
- _headerComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-
- List<ParameterData> params = _opData.getParameters();
- if (params != null && !params.isEmpty())
- {
- _paramsComposite = _toolkit.createComposite(_form.getBody(), SWT.NONE);
- _paramsComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- }
- _executionButton = _toolkit.createButton(_form.getBody(), BUTTON_EXECUTE, SWT.PUSH | SWT.CENTER);
- _executionButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- GridData layoutData = new GridData(SWT.CENTER, SWT.TOP, true, false);
- layoutData.verticalIndent = 20;
- _executionButton.setLayoutData(layoutData);
-
- _resultsComposite = _toolkit.createComposite(_form.getBody(), SWT.NONE);
- layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
- layoutData.verticalIndent = 20;
- _resultsComposite.setLayoutData(layoutData);
- _resultsComposite.setLayout(new GridLayout());
- }
-
- /**
- * @see TabControl#getControl()
- */
- public Control getControl()
- {
- return _form;
- }
-
- @Override
- public void refresh(ManagedBean mbean)
- {
- _mbean = mbean;
- _virtualHostName = _mbean.getVirtualHostName();
-
- // Setting the form to be invisible. Just in case the mbean server connection
- // is done and it takes time in getting the response, then the ui should be blank
- // instead of having half the widgets displayed.
- _form.setVisible(false);
-
- ViewUtility.disposeChildren(_paramsComposite);
- createParameterWidgets();
-
- // Set button text and add appropriate listener to button.
- // If there are no parameters and it is info operation, then operation gets executed
- // and result is displayed
- List<ParameterData> params = _opData.getParameters();
- if (params != null && !params.isEmpty())
- {
- setButton(BUTTON_EXECUTE);
- }
- else if (_opData.getImpact() == OPERATION_IMPACT_ACTION)
- {
- setButton(BUTTON_EXECUTE);
- }
- else if (_opData.getImpact() == OPERATION_IMPACT_INFO)
- {
- setButton(BUTTON_REFRESH);
- executeAndShowResults();
- }
-
- _form.setVisible(true);
- layout();
- }
-
- public void layout()
- {
- _form.layout(true);
- _form.getBody().layout(true, true);
- }
-
- /**
- * populates the header composite, containing the operation name and description.
- */
- private void setHeader()
- {
- _form.setText(ViewUtility.getDisplayText(_opData.getName()));
- _headerComposite.setLayout(new GridLayout(2, false));
- //operation description
- Label label = _toolkit.createLabel(_headerComposite, DESCRIPTION + " : ");
- label.setFont(ApplicationRegistry.getFont(FONT_BOLD));
- label.setLayoutData(new GridData(SWT.LEAD, SWT.TOP, false, false));
-
- label = _toolkit.createLabel(_headerComposite, _opData.getDescription());
- label.setFont(ApplicationRegistry.getFont(FONT_NORMAL));
- label.setLayoutData(new GridData(SWT.LEAD, SWT.TOP, true, false));
-
- _headerComposite.layout();
- }
-
- /**
- * Creates the widgets for operation parameters if there are any
- */
- private void createParameterWidgets()
- {
- List<ParameterData> params = _opData.getParameters();
- if (params == null || params.isEmpty())
- {
- return;
- }
-
- // Customised parameter widgets
- if (_mbean.isExchange() &&
- EXCHANGE_TYPE_VALUES[2].equals(_mbean.getProperty(EXCHANGE_TYPE)) &&
- _opData.getName().equalsIgnoreCase(OPERATION_CREATE_BINDING))
- {
- customCreateNewBinding();
- return;
- }
- // end of Customised parameter widgets
-
- _paramsComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- _paramsComposite.setLayout(new FormLayout());
- int parameterPositionOffset = 0;
- for (ParameterData param : params)
- {
- boolean valueInCombo = false;
- Label label = _toolkit.createLabel(_paramsComposite, ViewUtility.getDisplayText(param.getName()));
- FormData formData = new FormData();
- if (params.indexOf(param) == 0)
- {
- parameterPositionOffset = 0;
- }
- else
- {
- parameterPositionOffset += heightForAParameter;
- }
- formData.top = new FormAttachment(0, parameterPositionOffset + 2);
- formData.right = new FormAttachment(labelWidth);
- label.setLayoutData(formData);
- label.setToolTipText(param.getDescription());
-
- formData = new FormData();
- formData.top = new FormAttachment(0, parameterPositionOffset);
- formData.left = new FormAttachment(label, 5);
- formData.right = new FormAttachment(valueWidth);
- // this will contain the list of items, if the list is to be made available to choose from
- // e.g. the list of exchanges
- String[] items = null;
- if (param.getName().equals(QUEUE))
- {
- List<String> qList = ApplicationRegistry.getServerRegistry(_mbean).getQueueNames(_virtualHostName);
- // Customization for AMQQueueMBean method OPERATION_MOVE_MESSAGES
- if (_opData.getName().equals(OPERATION_MOVE_MESSAGES))
- {
- qList.remove(_mbean.getName());
- }
- // End of Customization
- items = qList.toArray(new String[0]);
- }
- else if (param.getName().equals(EXCHANGE))
- {
- items = ApplicationRegistry.getServerRegistry(_mbean).getExchangeNames(_virtualHostName);
- }
- else if (param.getName().equals(EXCHANGE_TYPE))
- {
- items = EXCHANGE_TYPE_VALUES;
- }
- else if (isUserListParameter(param))
- {
- List<String> list = ApplicationRegistry.getServerRegistry(_mbean).getUsernames();
- if (list != null && !list.isEmpty())
- {
- items = list.toArray(new String[0]);
- }
- }
-
- if (items != null)
- {
- org.eclipse.swt.widgets.List _list = new org.eclipse.swt.widgets.List(_paramsComposite, SWT.BORDER | SWT.V_SCROLL);
- int listSize = _form.getClientArea().height * 2 / 3;
- int itemsHeight = items.length * (_list.getItemHeight() + 2);
- // Set a min height for the list widget (set it to min 4 items)
- if (items.length < 4)
- {
- itemsHeight = 4 * (_list.getItemHeight() + 2);
- }
-
- listSize = (listSize > itemsHeight) ? itemsHeight : listSize;
- parameterPositionOffset = parameterPositionOffset + listSize;
- formData.bottom = new FormAttachment(0, parameterPositionOffset);
- _list.setLayoutData(formData);
- _list.setData(param);
- _list.setItems(items);
- _list.addSelectionListener(parameterSelectionListener);
- valueInCombo = true;
- }
- else if (param.isBoolean())
- {
- Button booleanButton = _toolkit.createButton(_paramsComposite, "", SWT.CHECK);
- booleanButton.setLayoutData(formData);
- booleanButton.setData(param);
- booleanButton.addSelectionListener(booleanSelectionListener);
- valueInCombo = true;
- }
- else
- {
- int style = SWT.NONE;
- if (PASSWORD.equalsIgnoreCase(param.getName()))
- {
- style = SWT.PASSWORD;
- }
- Text text = _toolkit.createText(_paramsComposite, "", style);
- formData = new FormData();
- formData.top = new FormAttachment(0, parameterPositionOffset);
- formData.left = new FormAttachment(label, 5);
- formData.right = new FormAttachment(valueWidth);
- text.setLayoutData(formData);
- // Listener to assign value to the parameter
- text.addKeyListener(keyListener);
- // Listener to verify if the entered key is valid
- text.addVerifyListener(verifyListener);
- text.setData(param);
- }
-
- // display the parameter data type next to the text field
- if (valueInCombo)
- {
- label = _toolkit.createLabel(_paramsComposite, "");
- }
- else if (PASSWORD.equalsIgnoreCase(param.getName()))
- {
- label = _toolkit.createLabel(_paramsComposite, "(String)");
- }
- else
- {
- String str = param.getType();
-
- if (param.getType().lastIndexOf(".") != -1)
- str = param.getType().substring(1 + param.getType().lastIndexOf("."));
-
- label = _toolkit.createLabel(_paramsComposite, "(" + str + ")");
- }
- formData = new FormData();
- formData.top = new FormAttachment(0, parameterPositionOffset);
- formData.left = new FormAttachment(valueWidth, 5);
- label.setLayoutData(formData);
- }
- }
-
- private boolean isUserListParameter(ParameterData param)
- {
- if (_mbean.isAdmin() && param.getName().equals(OPERATION_PARAM_USERNAME)
- && !_opData.getName().equals(OPERATION_CREATEUSER))
- {
- return true;
- }
-
- return false;
- }
-
- /**
- * Creates customized dispaly for a method "CreateNewBinding" for Headers exchange
- *
- */
- private void customCreateNewBinding()
- {
- headerBindingHashMap = new HashMap<Text, Text>();
-
- _paramsComposite.setLayout(new GridLayout());
- _paramsComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
- final ScrolledComposite scrolledComposite = new ScrolledComposite(_paramsComposite, SWT.BORDER | SWT.V_SCROLL);
- scrolledComposite.setExpandHorizontal(true);
- scrolledComposite.setExpandVertical(true);
- GridData layoutData = new GridData(SWT.FILL, SWT.TOP, true, true);
- scrolledComposite.setLayoutData(layoutData);
- scrolledComposite.setLayout(new GridLayout());
-
- final Composite composite = _toolkit.createComposite(scrolledComposite, SWT.NONE);
- scrolledComposite.setContent(composite);
- layoutData = new GridData(SWT.FILL, SWT.FILL, true, true);
- layoutData.verticalIndent = 20;
- composite.setLayoutData(layoutData);
- composite.setLayout(new FormLayout());
-
- List<ParameterData> params = _opData.getParameters();
- ParameterData param = params.get(0);
- // Queue selection widget
- Label label = _toolkit.createLabel(composite, ViewUtility.getDisplayText(param.getName()));
- FormData formData = new FormData();
- formData.top = new FormAttachment(0, 2);
- formData.right = new FormAttachment(labelWidth);
- label.setLayoutData(formData);
- label.setToolTipText(param.getDescription());
-
- formData = new FormData();
- formData.top = new FormAttachment(0);
- formData.left = new FormAttachment(label, 5);
- formData.right = new FormAttachment(valueWidth);
-
- Combo combo = new Combo(composite, SWT.READ_ONLY | SWT.DROP_DOWN);
- List<String> qList = ApplicationRegistry.getServerRegistry(_mbean).getQueueNames(_virtualHostName);
- combo.setItems(qList.toArray(new String[0]));
- combo.add("Select Queue", 0);
- combo.select(0);
- combo.setLayoutData(formData);
- combo.setData(param);
- combo.addSelectionListener(parameterSelectionListener);
-
- // Binding creation widgets
- createARowForCreatingHeadersBinding(composite, 1);
- createARowForCreatingHeadersBinding(composite, 2);
- createARowForCreatingHeadersBinding(composite, 3);
- createARowForCreatingHeadersBinding(composite, 4);
- createARowForCreatingHeadersBinding(composite, 5);
- createARowForCreatingHeadersBinding(composite, 6);
- createARowForCreatingHeadersBinding(composite, 7);
- createARowForCreatingHeadersBinding(composite, 8);
-
- final Button addMoreButton = _toolkit.createButton(composite, "Add More", SWT.PUSH);
- formData = new FormData();
- formData.top = new FormAttachment(0, heightForAParameter);
- formData.left = new FormAttachment(70, 5);
- addMoreButton.setLayoutData(formData);
- addMoreButton.setData("rowCount", 8);
- addMoreButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- int count = Integer.parseInt(addMoreButton.getData("rowCount").toString());
- createARowForCreatingHeadersBinding(composite, ++count);
- addMoreButton.setData("rowCount", count);
- scrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
- composite.layout();
- _form.layout();
- }
- });
-
- scrolledComposite.setMinSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
- composite.layout();
- }
-
- /**
- * Adds a row for adding a binding for Headers Exchange. Used by the method, which creates the customized
- * layout and widgest for Header's exchange method createNewBinding.
- * @param parent composite
- * @param rowCount - row number
- */
- private void createARowForCreatingHeadersBinding(Composite parent, int rowCount)
- {
- Label key = _toolkit.createLabel(parent, "Name");
- FormData formData = new FormData();
- formData.top = new FormAttachment(0, rowCount * heightForAParameter + 2);
- formData.right = new FormAttachment(15);
- key.setLayoutData(formData);
-
- Text keyText = _toolkit.createText(parent, "", SWT.NONE);
- formData = new FormData();
- formData.top = new FormAttachment(0, rowCount * heightForAParameter);
- formData.left = new FormAttachment(key, 5);
- formData.right = new FormAttachment(40);
- keyText.setLayoutData(formData);
- keyText.addKeyListener(headerBindingListener);
-
- Label value = _toolkit.createLabel(parent, "Value");
- formData = new FormData();
- formData.top = new FormAttachment(0, rowCount * heightForAParameter + 2);
- formData.right = new FormAttachment(45);
- value.setLayoutData(formData);
-
- Text valueText = _toolkit.createText(parent, "", SWT.NONE);
- formData = new FormData();
- formData.top = new FormAttachment(0, rowCount * heightForAParameter);
- formData.left = new FormAttachment(value, 5);
- formData.right = new FormAttachment(70);
- valueText.setLayoutData(formData);
- valueText.addKeyListener(headerBindingListener);
-
- // Add these to the map, to retrieve the values while setting the parameter value
- headerBindingHashMap.put(keyText, valueText);
- }
-
- /**
- * Sets text and listener for the operation execution button
- * @param text
- */
- private void setButton(String text)
- {
- _executionButton.setText(text);
- _executionButton.removeSelectionListener(refreshListener);
- _executionButton.removeSelectionListener(operationExecutionListener);
-
- if (BUTTON_EXECUTE.equals(text))
- {
- _executionButton.addSelectionListener(operationExecutionListener);
- }
- else
- {
- _executionButton.addSelectionListener(refreshListener);
- }
- }
-
- /**
- * displays the operation result in a pop-up window
- * @param result
- */
- private void populateResults(Object result)
- {
- Display display = Display.getCurrent();
- int width = 600;
- int height = 400;
- Shell shell = ViewUtility.createPopupShell(RESULT, width, height);
- shell.setImage(ApplicationRegistry.getImage(CONSOLE_IMAGE));
- ViewUtility.populateCompositeWithData(_toolkit, shell, result);
-
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
- shell.dispose();
- }
-
- /**
- * Clears the parameter values of the operation
- */
- private void clearParameters()
- {
- List<ParameterData> params = _opData.getParameters();
- if (params != null && !params.isEmpty())
- {
- for (ParameterData param : params)
- {
- param.setDefaultValue();
- }
- }
- }
-
- /**
- * Clears the values entered by the user from parameter value widgets
- * @param control
- */
- private void clearParameterValues(Composite control)
- {
- if (control == null || (control.isDisposed()))
- return;
-
- Control[] controls = control.getChildren();
- if (controls == null || controls.length == 0)
- return;
-
- for (int i = 0; i < controls.length; i++)
- {
- if (controls[i] instanceof Combo)
- ((Combo)controls[i]).select(0);
- if (controls[i] instanceof org.eclipse.swt.widgets.List)
- ((org.eclipse.swt.widgets.List)controls[i]).deselectAll();
- else if (controls[i] instanceof Text)
- ((Text)controls[i]).setText("");
- else if (controls[i] instanceof Button)
- ((Button)controls[i]).setSelection(false);
- else if (controls[i] instanceof Composite)
- clearParameterValues((Composite)controls[i]);
- }
- }
-
- /**
- * Listener class for operation execution events
- */
- private class OperationExecutionListener extends SelectionAdapter
- {
- public void widgetSelected(SelectionEvent e)
- {
- List<ParameterData> params = _opData.getParameters();
- if (params != null && !params.isEmpty())
- {
- for (ParameterData param : params)
- {
- if (param.getValue() == null || param.getValue().toString().length() == 0)
- {
- // Customized check, because for this parameter null is allowed
- if (param.getName().equals(ATTRIBUTE_QUEUE_OWNER) &&
- _opData.getName().equals(OPERATION_CREATE_QUEUE))
- {
- continue;
- }
- // End of custom code
-
- ViewUtility.popupInfoMessage(_form.getText(), "Please select the " + ViewUtility.getDisplayText(param.getName()));
- return;
- }
-
- // customized for passwords
- if (PASSWORD.equalsIgnoreCase(param.getName()))
- {
- if (param.getType().equals("[C"))
- {
- try
- {
- param.setValue(ViewUtility.getHash((String)param.getValue()));
- }
- catch (Exception ex)
- {
- MBeanUtility.handleException(_mbean, ex);
- return;
- }
- }
- }
- // end of customization
- }
- }
-
- if (_opData.getImpact() == OPERATION_IMPACT_ACTION)
- {
- String bean = _mbean.getName() == null ? _mbean.getType() : _mbean.getName();
- int response = ViewUtility.popupConfirmationMessage(bean, "Do you want to " + _form.getText()+ " ?");
- if (response == SWT.YES)
- {
- executeAndShowResults();
- }
- }
- else
- {
- executeAndShowResults();
- }
-
- if (_mbean.isAdmin() && _opData.getName().equals(OPERATION_DELETEUSER))
- {
- refresh(_mbean);
- }
- else
- {
- clearParameters();
- clearParameterValues(_paramsComposite);
- }
- }
- }
-
- // Listener for the "Refresh" execution button
- private class RefreshListener extends SelectionAdapter
- {
- public void widgetSelected(SelectionEvent e)
- {
- executeAndShowResults();
- }
- }
-
- /**
- * Executres the operation, gets the result from server and displays to the user
- */
- private void executeAndShowResults()
- {
- Object result = null;
- try
- {
- result = MBeanUtility.execute(_mbean, _opData);
- }
- catch(Exception ex)
- {
- MBeanUtility.handleException(_mbean, ex);
- return;
- }
-
- // Custom code for Admin mbean operation
- /* These custome codes here are to make the GUI look more user friendly.
- * Here we are adding the users to a list, which will be used to list username to be selected on
- * pages like "delete user", "set password" instead of typing the username
- */
- if (_mbean.isAdmin())
- {
- if (_opData.getName().equals(OPERATION_VIEWUSERS))
- {
- ApplicationRegistry.getServerRegistry(_mbean).setUserList(extractUserList(result));
- }
- else if (_opData.getName().equals(OPERATION_DELETEUSER))
- {
- List<String> list = ApplicationRegistry.getServerRegistry(_mbean).getUsernames();
- Object userName = _opData.getParameterValue(OPERATION_PARAM_USERNAME);
- if ((list != null) && !list.isEmpty() && (userName != null))
- {
- list.remove(userName);
- ApplicationRegistry.getServerRegistry(_mbean).setUserList(list);
- }
- }
- else if (_opData.getName().equals(OPERATION_CREATEUSER))
- {
- List<String> list = ApplicationRegistry.getServerRegistry(_mbean).getUsernames();
- Object userName = _opData.getParameterValue(OPERATION_PARAM_USERNAME);
- if ((list != null) && !list.isEmpty() && (userName != null))
- {
- list.add(userName.toString());
- ApplicationRegistry.getServerRegistry(_mbean).setUserList(list);
- }
- }
- }
- // end of custom code
-
- // Some mbeans have only "type" and no "name".
- String title = _mbean.getType();
- if (_mbean.getName() != null && _mbean.getName().length() != 0)
- {
- title = _mbean.getName();
- }
-
- if (_opData.isReturnTypeVoid())
- {
- ViewUtility.popupInfoMessage(title, OPERATION_SUCCESSFUL);
- }
- else if (_opData.isReturnTypeBoolean())
- {
- boolean success = Boolean.parseBoolean(result.toString());
- String message = success ? OPERATION_SUCCESSFUL : OPERATION_UNSUCCESSFUL;
- ViewUtility.popupInfoMessage(title, message);
- }
- else if (_opData.getParameters() != null && !_opData.getParameters().isEmpty())
- {
- populateResults(result);
- }
- else
- {
- ViewUtility.disposeChildren(_resultsComposite);
- ViewUtility.populateCompositeWithData(_toolkit, _resultsComposite, result);
- _resultsComposite.layout();
- _form.layout();
- }
-
- }
-
- private List<String> extractUserList(Object result)
- {
- if (!(result instanceof TabularDataSupport))
- {
- return null;
- }
-
- TabularDataSupport tabularData = (TabularDataSupport)result;
- Collection<Object> records = tabularData.values();
- List<String> list = new ArrayList<String>();
- for (Object o : records)
- {
- CompositeData data = (CompositeData) o;
- if (data.containsKey(USERNAME))
- {
- list.add(data.get(USERNAME).toString());
- }
- }
-
- return list;
- }
-
- /**
- * Listener class for the operation parameters widget
- */
- private class ParameterSelectionListener extends SelectionAdapter
- {
- public void widgetSelected(SelectionEvent e)
- {
- ParameterData parameter = (ParameterData)e.widget.getData();
- parameter.setValue(null);
- if (e.widget instanceof Combo)
- {
- Combo combo = (Combo)e.widget;
- if (combo.getSelectionIndex() > 0)
- {
- String item = combo.getItem(combo.getSelectionIndex());
- parameter.setValueFromString(item);
- }
- }
- else if (e.widget instanceof org.eclipse.swt.widgets.List)
- {
- org.eclipse.swt.widgets.List list = (org.eclipse.swt.widgets.List)e.widget;
- String[] selectedItems = list.getSelection();
- if (selectedItems.length > 0)
- {
- parameter.setValueFromString(selectedItems[0]);
- }
- }
- }
- }
-
- /**
- * Listener class for boolean parameter widgets
- */
- private class BooleanSelectionListener extends SelectionAdapter
- {
- public void widgetSelected(SelectionEvent e)
- {
- ParameterData parameter = (ParameterData)(e.widget.getData());
- if (e.widget instanceof Button)
- {
- Button button = (Button)e.widget;
- parameter.setValue(button.getSelection());
- }
- else if (e.widget instanceof Combo)
- {
- Combo combo = (Combo)e.widget;
- String item = combo.getItem(combo.getSelectionIndex());
- parameter.setValueFromString(item);
- }
- }
- }
-
- /**
- * Listener class for the operation parameter value widget (Text field)
- */
- private class KeyListenerImpl extends KeyAdapter
- {
- public void keyReleased(KeyEvent e)
- {
- if (!(e.widget instanceof Text))
- return;
-
- Text text = (Text)e.widget;
- // Get the parameters widget and assign the text to the parameter
- String strValue = text.getText();
- ParameterData parameter = (ParameterData)text.getData();
- try
- {
- parameter.setValueFromString(strValue);
- }
- catch(Exception ex)
- {
- // Exception occured in setting parameter value.
- // ignore it. The value will not be assigned to the parameter
- }
- }
- }
-
- /**
- * Listener class for HeaderExchange's new binding widgets. Used when the new bindings are
- * being created for Header's Exchange
- */
- private class HeaderBindingKeyListener extends KeyAdapter
- {
- public void keyReleased(KeyEvent e)
- {
- ParameterData param = _opData.getParameters().get(1);
- StringBuffer paramValue = new StringBuffer();
- for (Entry<Text, Text> entry : headerBindingHashMap.entrySet())
- {
-
- Text nameText = entry.getKey();
- String name = nameText.getText();
- Text valueText = entry.getValue();
- String value = valueText.getText();
- if ((name != null) && (name.length() != 0) && (value != null) && (value.length() != 0))
- {
- if (paramValue.length() != 0)
- {
- paramValue.append(",");
- }
- paramValue.append(name + "=" + value);
- }
- }
-
- param.setValue(paramValue.toString());
- }
- }
-
- /**
- * Listener class for verifying the user input with parameter type
- */
- private class VerifyListenerImpl implements VerifyListener
- {
- public void verifyText(VerifyEvent event)
- {
- ParameterData parameter = (ParameterData)event.widget.getData();
- String text = event.text;
- char [] chars = new char [text.length ()];
- text.getChars(0, chars.length, chars, 0);
- String type = parameter.getType();
- if (type.equals("int") || type.equals("java.lang.Integer") ||
- type.equals("long") || type.equals("java.lang.Long"))
- {
- for (int i=0; i<chars.length; i++)
- {
- if (!('0' <= chars [i] && chars [i] <= '9'))
- {
- event.doit = false;
- return;
- }
- }
-
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/QueueTypeTabControl.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/QueueTypeTabControl.java
deleted file mode 100644
index 31a0bc857b..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/QueueTypeTabControl.java
+++ /dev/null
@@ -1,296 +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.
- *
- */
-
-package org.apache.qpid.management.ui.views;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.Constants;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.ServerRegistry;
-import org.apache.qpid.management.ui.jmx.MBeanUtility;
-import org.apache.qpid.management.ui.model.AttributeData;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.TabFolder;
-
-/**
- * Controller class, which takes care of displaying appropriate information and widgets for Queues.
- * This allows user to select Queues and add those to the navigation view
- */
-public class QueueTypeTabControl extends MBeanTypeTabControl
-{
- private boolean _showTempQueues = false;
- private Button _sortBySizeButton = null;
- private Button _sortByConsumercountButton = null;
- private Button _sortByNameButton = null;
- private Button _showTempQueuesButton = null;
-
- private ComparatorImpl _sorterByAttribute = new ComparatorImpl();
-
- // Map required for sorting queues based on attribute values
- private Map<AttributeData, ManagedBean> _queueDepthMap = new LinkedHashMap<AttributeData, ManagedBean>();
- // Map used for sorting Queues based on consumer count
- private Map<AttributeData, ManagedBean> _queueConsumerCountMap = new LinkedHashMap<AttributeData, ManagedBean>();
-
-
- public QueueTypeTabControl(TabFolder tabFolder)
- {
- super(tabFolder, Constants.QUEUE);
- createWidgets();
- }
-
- protected void createWidgets()
- {
- createHeaderComposite(getFormComposite());
- createButtonsComposite(getFormComposite());
- createListComposite();
- }
-
- @Override
- public void refresh() throws Exception
- {
- setLabelValues();
- selectDefaultSortingButton();
- populateList();
- layout();
- }
-
- /**
- * populates the map with mbean name and the mbean object.
- * @throws Exception
- */
- protected void populateList() throws Exception
- {
- // map should be cleared before populating it with new values
- getMBeansMap().clear();
- _queueDepthMap.clear();
- _queueConsumerCountMap.clear();
-
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(MBeanView.getServer());
- String[] items = null;
- java.util.List<ManagedBean> list = null;
-
- // populate the map and list with appropriate mbeans
- list = serverRegistry.getQueues(MBeanView.getVirtualHost());
- items = getQueueItems(list);
- // sort the refreshed list in the selected order
- if (_sortBySizeButton.getSelection())
- {
- sortQueuesByQueueDepth();
- }
- else if (_sortByConsumercountButton.getSelection())
- {
- sortQueuesByConsumerCount();
- }
- else
- {
- getListWidget().setItems(items);
- }
- }
-
- private void selectDefaultSortingButton()
- {
- _sortByNameButton.setSelection(true);
- _sortBySizeButton.setSelection(false);
- _sortByConsumercountButton.setSelection(false);
-
- _showTempQueues = false;
- _showTempQueuesButton.setSelection(_showTempQueues);
- }
-
- protected void createListComposite()
- {
- // Composite to contain the item list
- Composite composite = getToolkit().createComposite(getFormComposite());
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- composite.setLayoutData(gridData);
- GridLayout layout = new GridLayout(2, true);
- layout.verticalSpacing = 0;
- composite.setLayout(layout);
-
- createListComposite(composite);
-
- // Composite to contain buttons like - Sort by size
- Composite _sortingComposite = getToolkit().createComposite(composite);
- gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- _sortingComposite.setLayoutData(gridData);
- GridLayout gridLayout = new GridLayout();
- gridLayout.verticalSpacing = 20;
- _sortingComposite.setLayout(gridLayout);
-
- Group sortingGroup = new Group(_sortingComposite, SWT.SHADOW_NONE);
- sortingGroup.setBackground(_sortingComposite.getBackground());
- sortingGroup.setText(" Sort List By ");
- sortingGroup.setFont(ApplicationRegistry.getFont(Constants.FONT_BOLD));
- gridData = new GridData(SWT.CENTER, SWT.TOP, true, false);
- sortingGroup.setLayoutData(gridData);
- sortingGroup.setLayout(new GridLayout());
-
- _sortByNameButton = getToolkit().createButton(sortingGroup, Constants.QUEUE_SORT_BY_NAME, SWT.RADIO);
- gridData = new GridData(SWT.LEAD, SWT.CENTER, true, false);
- _sortByNameButton.setLayoutData(gridData);
- _sortByNameButton.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e)
- {
- try
- {
- // sort the stored list of items
- java.util.List<String> list = new ArrayList<String>(getMBeansMap().keySet());
- Collections.sort(list);
- getListWidget().setItems(list.toArray(new String[0]));
- }
- catch (Exception ex)
- {
- MBeanUtility.handleException(ex);
- }
- }
- });
-
- _sortBySizeButton = getToolkit().createButton(sortingGroup, Constants.QUEUE_SORT_BY_DEPTH, SWT.RADIO);
- gridData = new GridData(SWT.LEAD, SWT.CENTER, true, false);
- _sortBySizeButton.setLayoutData(gridData);
- _sortBySizeButton.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e)
- {
- try
- {
- // sort the stored list of items
- sortQueuesByQueueDepth();
- }
- catch (Exception ex)
- {
- MBeanUtility.handleException(ex);
- }
- }
- });
-
- _sortByConsumercountButton = getToolkit().createButton(sortingGroup, Constants.QUEUE_SORT_BY_CONSUMERCOUNT, SWT.RADIO);
- gridData = new GridData(SWT.LEAD, SWT.CENTER, true, false);
- _sortByConsumercountButton.setLayoutData(gridData);
- _sortByConsumercountButton.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e)
- {
- try
- {
- sortQueuesByConsumerCount();
- }
- catch (Exception ex)
- {
- MBeanUtility.handleException(ex);
- }
- }
- });
-
- _showTempQueuesButton = getToolkit().createButton(_sortingComposite, Constants.QUEUE_SHOW_TEMP_QUEUES, SWT.CHECK);
- _showTempQueuesButton.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false));
- _showTempQueuesButton.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e)
- {
- Button button = (Button)e.widget;
- _showTempQueues = button.getSelection();
- try
- {
- populateList();
- }
- catch (Exception ex)
- {
- MBeanUtility.handleException(ex);
- }
- }
- });
- }
-
-
- private String[] getQueueItems(java.util.List<ManagedBean> list) throws Exception
- {
- if (list == null)
- return new String[0];
-
- // Sort the list. It will keep the mbeans in sorted order in the _queueMap, which is required for
- // sorting the queue according to size etc
- Collections.sort(list, getMBeanNameSorter());
- java.util.List<String> items = new ArrayList<String>();;
- int i = 0;
- for (ManagedBean mbean : list)
- {
- if ((!_showTempQueues && mbean.isTempQueue()))
- {
- continue;
- }
- AttributeData data = MBeanUtility.getAttributeData(mbean, Constants.ATTRIBUTE_QUEUE_DEPTH);
- String value = mbean.getName() + " (" + data.getValue().toString() + " KB)";
- items.add(value);
- //items[i] = mbean.getName() + " (" + value + " KB)";
- getMBeansMap().put(value, mbean);
- _queueDepthMap.put(data, mbean);
- data = MBeanUtility.getAttributeData(mbean, Constants.ATTRIBUTE_QUEUE_CONSUMERCOUNT);
- _queueConsumerCountMap.put(data, mbean);
- i++;
- }
-
- return items.toArray(new String[0]);
- }
-
-
- private void sortQueuesByQueueDepth()
- {
- // Queues are already in the alphabetically sorted order in _queueMap, now sort for queueDepth
- java.util.List<AttributeData> list = new ArrayList<AttributeData>(_queueDepthMap.keySet());
- Collections.sort(list, _sorterByAttribute);
-
- String[] items = new String[list.size()];
- int i = 0;
- for (AttributeData data : list)
- {
- ManagedBean mbean = _queueDepthMap.get(data);
- String value = data.getValue().toString();
- items[i++] = mbean.getName() + " (" + value + " KB)";
- }
- getListWidget().setItems(items);
- }
-
- private void sortQueuesByConsumerCount()
- {
- java.util.List<AttributeData> list = new ArrayList<AttributeData>(_queueConsumerCountMap.keySet());
- Collections.sort(list, _sorterByAttribute);
-
- String[] items = new String[list.size()];
- int i = 0;
- for (AttributeData data : list)
- {
- ManagedBean mbean = _queueConsumerCountMap.get(data);
- String value = data.getValue().toString();
- items[i++] = mbean.getName() + " (" + value + " )";
- }
- getListWidget().setItems(items);
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java
deleted file mode 100644
index c13c92066c..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.views;
-
-import java.util.ArrayList;
-
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.model.OperationData;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.TabFolder;
-
-/**
- * Abstract class for all the control classes of tabs.
- * @author Bhupendra Bhardwaj
- */
-public abstract class TabControl
-{
- protected ManagedBean _mbean = null;
- protected TabFolder _tabFolder = null;
-
- private static java.util.List<String> simpleTypes = new ArrayList<String>();
-
- static
- {
- simpleTypes.add("java.math.BigDecimal");
- simpleTypes.add("java.math.BigInteger");
- simpleTypes.add("java.lang.Boolean");
- simpleTypes.add("java.lang.Byte");
- simpleTypes.add("java.lang.Character");
- simpleTypes.add("java.util.Date");
- simpleTypes.add("java.lang.Double");
- simpleTypes.add("java.lang.Float");
- simpleTypes.add("java.lang.Integer");
- simpleTypes.add("java.lang.Long");
- simpleTypes.add("javax.management.ObjectName");
- simpleTypes.add("java.lang.Short");
- simpleTypes.add("java.lang.String");
- simpleTypes.add("boolean");
- }
-
- public TabControl(TabFolder tabFolder)
- {
- _tabFolder = tabFolder;
- }
-
- /**
- * @return controller composite for the tab
- */
- public Control getControl()
- {
- return null;
- }
-
- public void refresh(ManagedBean mbean)
- {
- if (mbean == null)
- {
- refresh();
- }
- }
-
- public void refresh()
- {
-
- }
-
- public void refresh(ManagedBean mbean, OperationData opData)
- {
-
- }
-
- /**
- * Sets focus on a widget
- */
- public void setFocus()
- {
-
- }
-
- public boolean isSimpleType(Object data)
- {
- return simpleTypes.contains(data.getClass().getName());
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java
deleted file mode 100644
index 9545ed9876..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui.views;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.qpid.management.ui.Constants;
-import org.apache.qpid.management.ui.ManagedBean;
-import org.apache.qpid.management.ui.ManagedObject;
-
-public class TreeObject
-{
- private String _name;
- private String _type;
- private String _virtualHost;
- private TreeObject _parent;
- private List<TreeObject> _children = new ArrayList<TreeObject>();
- private ManagedObject _object;
-
- public TreeObject(String name, String type)
- {
- this._name = name;
- this._type = type;
- }
-
- public TreeObject(ManagedObject obj)
- {
- _name = obj.getName();
- if (_name == null && (obj instanceof ManagedBean))
- {
- String[] types = ((ManagedBean)obj).getType().split("\\.");
- _name = types[types.length - 1];
- }
- this._type = Constants.MBEAN;
- this._object = obj;
- }
-
- public void addChild(TreeObject child)
- {
- _children.add(child);
- }
-
- public void addChildren(List<TreeObject> subList)
- {
- _children.addAll(subList);
- }
-
- public List<TreeObject> getChildren()
- {
- return _children;
- }
-
- public void setChildren(List<TreeObject> children)
- {
- this._children = children;
- }
-
- public void setName(String value)
- {
- _name = value;
- }
-
- public String getName()
- {
- return _name;
- }
- public String getType()
- {
- return _type;
- }
-
- public String getVirtualHost()
- {
- // To make it work with the broker with no virtual host implementation
- return _virtualHost == null ? Constants.DEFAULT_VH : _virtualHost;
- }
-
- public void setVirtualHost(String vHost)
- {
- _virtualHost = vHost;
- }
-
- public ManagedObject getManagedObject()
- {
- return _object;
- }
-
- public void setManagedObject(ManagedObject obj)
- {
- this._object = obj;
- }
-
- public TreeObject getParent()
- {
- return _parent;
- }
-
- public void setParent(TreeObject parent)
- {
- this._parent = parent;
-
- if (parent != null)
- {
- parent.addChild(this);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java
deleted file mode 100644
index be25707bd3..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java
+++ /dev/null
@@ -1,483 +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.
- *
- */
-
-package org.apache.qpid.management.ui.views;
-
-import static org.apache.qpid.management.ui.Constants.BUTTON_CLEAR;
-import static org.apache.qpid.management.ui.Constants.BUTTON_REFRESH;
-import static org.apache.qpid.management.ui.Constants.CONSOLE_IMAGE;
-import static org.apache.qpid.management.ui.Constants.FONT_BUTTON;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.qpid.management.ui.ApplicationRegistry;
-import org.apache.qpid.management.ui.ServerRegistry;
-import org.apache.qpid.management.ui.model.NotificationObject;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.TabFolder;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.Form;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-public class VHNotificationsTabControl extends TabControl
-{
- protected FormToolkit _toolkit;
- protected Form _form;
- protected Table _table = null;
- protected TableViewer _tableViewer = null;
-
- protected Thread worker = null;
-
- protected List<NotificationObject> _notifications = null;
-
- private static final String COLUMN_OBJ = "Object Name";
- private static final String COLUMN_SEQ = "Sequence No";
- private static final String COLUMN_TIME = "TimeStamp";
- private static final String COLUMN_TYPE = "Type";
- private static final String COLUMN_MSG = "Notification Message";
- protected static final String[] _tableTitles = new String [] {
- COLUMN_OBJ,
- COLUMN_SEQ,
- COLUMN_TIME,
- COLUMN_TYPE,
- COLUMN_MSG
- };
-
- protected Button _clearButton = null;
- protected Button _refreshButton = null;
-
- public VHNotificationsTabControl(TabFolder tabFolder)
- {
- super(tabFolder);
- _toolkit = new FormToolkit(_tabFolder.getDisplay());
- _form = _toolkit.createForm(_tabFolder);
- GridLayout gridLayout = new GridLayout();
- gridLayout.marginWidth = 0;
- gridLayout.marginHeight = 0;
- _form.getBody().setLayout(gridLayout);
-
- worker = new Thread(new Worker());
- worker.start();
- }
-
- protected void createWidgets()
- {
- addButtons();
- createTableViewer();
- }
-
- /**
- * @see TabControl#getControl()
- */
- public Control getControl()
- {
- if (_table == null)
- {
- createWidgets();
- }
- return _form;
- }
-
- /**
- * Creates clear buttin and refresh button
- */
- protected void addButtons()
- {
- Composite composite = _toolkit.createComposite(_form.getBody(), SWT.NONE);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
- composite.setLayout(new GridLayout(2, true));
-
- // Add Clear Button
- _clearButton = _toolkit.createButton(composite, BUTTON_CLEAR, SWT.PUSH | SWT.CENTER);
- _clearButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- GridData gridData = new GridData(SWT.LEAD, SWT.TOP, true, false);
- gridData.widthHint = 80;
- _clearButton.setLayoutData(gridData);
- _clearButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- //TODO : Get selected rows and clear those
- IStructuredSelection ss = (IStructuredSelection)_tableViewer.getSelection();
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(MBeanView.getServer());
- serverRegistry.clearNotifications(null, ss.toList());
- refresh();
- }
- });
-
- // Add Refresh Button
- _refreshButton = _toolkit.createButton(composite, BUTTON_REFRESH, SWT.PUSH | SWT.CENTER);
- _refreshButton.setFont(ApplicationRegistry.getFont(FONT_BUTTON));
- gridData = new GridData(SWT.TRAIL, SWT.TOP, true, false);
- gridData.widthHint = 80;
- _refreshButton.setLayoutData(gridData);
- _refreshButton.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- refresh();
- }
- });
- }
-
- /**
- * Creates table to display notifications
- */
- private void createTable()
- {
- _table = _toolkit.createTable(_form.getBody(), SWT.MULTI | SWT.FULL_SELECTION);
- _table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- TableColumn column = new TableColumn(_table, SWT.NONE);
- column.setText(_tableTitles[0]);
- column.setWidth(100);
-
- column = new TableColumn(_table, SWT.NONE);
- column.setText(_tableTitles[1]);
- column.setWidth(100);
-
- column = new TableColumn(_table, SWT.NONE);
- column.setText(_tableTitles[2]);
- column.setWidth(130);
-
- column = new TableColumn(_table, SWT.NONE);
- column.setText(_tableTitles[3]);
- column.setWidth(100);
-
- column = new TableColumn(_table, SWT.NONE);
- column.setText(_tableTitles[4]);
- column.setWidth(500);
-
- _table.setHeaderVisible(true);
- _table.setLinesVisible(true);
- }
-
- /**
- * Creates JFace viewer for the notifications table
- */
- protected void createTableViewer()
- {
- createTable();
- _tableViewer = new TableViewer(_table);
- //_tableViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- _tableViewer.setUseHashlookup(true);
- _tableViewer.setContentProvider(new ContentProviderImpl());
- _tableViewer.setLabelProvider(new LabelProviderImpl());
- _tableViewer.setColumnProperties(_tableTitles);
- /*
- CellEditor[] cellEditors = new CellEditor[_tableTitles.length];
- TextCellEditor textEditor = new TextCellEditor(table);
- cellEditors[0] = textEditor;
- textEditor = new TextCellEditor(table);
- cellEditors[1] = textEditor;
- textEditor = new TextCellEditor(table);
- cellEditors[2] = textEditor;
- textEditor = new TextCellEditor(table);
- cellEditors[3] = textEditor;
-
- // Assign the cell editors to the viewer
- _tableViewer.setCellEditors(cellEditors);
- _tableViewer.setCellModifier(new TableCellModifier());
- */
-
- addTableListeners();
-
- //_tableViewer.addSelectionChangedListener(new );
-
- //_notificationDetails = new Composite(_tabControl, SWT.BORDER);
- //_notificationDetails.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- //_tabControl.layout();
- //viewerComposite.layout();
- }
-
- /**
- * Adds listeners to the viewer for displaying notification details
- */
- protected void addTableListeners()
- {
- _tableViewer.addDoubleClickListener(new IDoubleClickListener()
- {
- Display display = null;
- Shell shell = null;
- public void doubleClick(DoubleClickEvent event)
- {
- display = Display.getCurrent();
- shell = new Shell(display, SWT.BORDER | SWT.CLOSE | SWT.MIN | SWT.MAX | SWT.RESIZE);
- shell.setText("Notification");
- shell.setImage(ApplicationRegistry.getImage(CONSOLE_IMAGE));
-
- int x = display.getBounds().width;
- int y = display.getBounds().height;
- shell.setBounds(x/4, y/4, x/2, y/3);
- StructuredSelection selection = (StructuredSelection)event.getSelection();
- createPopupContents((NotificationObject)selection.getFirstElement());
- shell.open();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) {
- display.sleep();
- }
- }
-
- //If you create it, you dispose it.
- shell.dispose();
- }
-
- private void createPopupContents(NotificationObject obj)
- {
- shell.setLayout(new GridLayout());
-
- Composite parent = _toolkit.createComposite(shell, SWT.NONE);
- parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- GridLayout layout = new GridLayout(4, true);
- parent.setLayout(layout);
-
- // Object name record
- Label key = _toolkit.createLabel(parent, COLUMN_OBJ, SWT.TRAIL);
- GridData layoutData = new GridData(SWT.TRAIL, SWT.TOP, false, false,1,1);
- key.setLayoutData(layoutData);
- Text value = _toolkit.createText(parent, obj.getSourceName(), SWT.BEGINNING | SWT.BORDER |SWT.READ_ONLY);
- value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false,3,1));
-
- // Sequence no record
- key = _toolkit.createLabel(parent, COLUMN_SEQ, SWT.TRAIL);
- layoutData = new GridData(SWT.TRAIL, SWT.TOP, false, false,1,1);
- key.setLayoutData(layoutData);
- value = _toolkit.createText(parent, ""+obj.getSequenceNo(), SWT.BEGINNING | SWT.BORDER |SWT.READ_ONLY);
- value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false,3,1));
-
- // Time row
- key = _toolkit.createLabel(parent, COLUMN_TIME, SWT.TRAIL);
- key.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, true, false,1,1));
- value = _toolkit.createText(parent, obj.getTimeStamp(), SWT.BEGINNING | SWT.BORDER | SWT.READ_ONLY);
- value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false,3,1));
-
- key = _toolkit.createLabel(parent, COLUMN_TYPE, SWT.TRAIL);
- key.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, true, false,1,1));
- value = _toolkit.createText(parent, obj.getType(), SWT.BEGINNING | SWT.BORDER | SWT.READ_ONLY);
- value.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false,3,1));
-
- key = _toolkit.createLabel(parent, COLUMN_MSG, SWT.TRAIL);
- key.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, true, false,1,1));
- value = _toolkit.createText(parent, obj.getMessage(), SWT.MULTI | SWT.WRAP| SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY);
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1);
- gridData.heightHint = 100;
- value.setLayoutData(gridData);
- }
- });
- }
-
- public void refresh()
- {
- _notifications = null;
- _table.deselectAll();
- _tableViewer.getTable().clearAll();
-
- Control[] children = _form.getBody().getChildren();
- for (int i = 0; i < children.length; i++)
- {
- children[i].setVisible(true);
- }
-
- workerRunning = true;
- _form.layout(true);
- _form.getBody().layout(true, true);
- }
-
- /**
- * Content provider class for the table viewer
- */
- protected class ContentProviderImpl implements IStructuredContentProvider, INotificationViewer
- {
- public void inputChanged(Viewer v, Object oldInput, Object newInput)
- {
-
- }
- public void dispose()
- {
-
- }
- public Object[] getElements(Object parent)
- {
- return _notifications.toArray(new NotificationObject[0]);
- }
- public void addNotification(NotificationObject notification)
- {
- _tableViewer.add(notification);
- }
-
- public void addNotification(List<NotificationObject> notificationList)
- {
- _tableViewer.add(notificationList.toArray(new NotificationObject[0]));
- }
- }
-
- /**
- * Label provider for the table viewer
- */
- protected class LabelProviderImpl implements ITableLabelProvider
- {
- List<ILabelProviderListener> listeners = new ArrayList<ILabelProviderListener>();
- public void addListener(ILabelProviderListener listener)
- {
- listeners.add(listener);
- }
-
- public void dispose(){
-
- }
-
- public Image getColumnImage(Object element, int columnIndex)
- {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex)
- {
- String result = null;
- NotificationObject t = (NotificationObject)element;
- switch(columnIndex)
- {
- case 0 :
- result = t.getSourceName();
- break;
- case 1 :
- result = String.valueOf(t.getSequenceNo());
- break;
- case 2 :
- result = String.valueOf(t.getTimeStamp());
- break;
- case 3 :
- result = t.getType();
- break;
- case 4 :
- result = t.getMessage();
- break;
- default :
- result = "";
- }
-
- return result;
- }
-
- public boolean isLabelProperty(Object element, String property)
- {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener)
- {
- listeners.remove(listener);
- }
- } // end of LabelProviderImpl
-
- protected boolean workerRunning = false;
- protected void setWorkerRunning(boolean running)
- {
- workerRunning = running;
- }
-
- /**
- * Worker class which keeps looking if there are new notifications coming from server for the selected mbean
- */
- private class Worker implements Runnable
- {
- public void run()
- {
- Display display = _tabFolder.getDisplay();
- while(true)
- {
- if (!workerRunning || display == null)
- {
- sleep();
- continue;
- }
-
- display.syncExec(new Runnable()
- {
- public void run()
- {
- if (_form == null || _form.isDisposed())
- return;
- setWorkerRunning(_form.isVisible());
- if (!workerRunning) return;
-
- updateTableViewer();
- }
- });
-
- sleep();
- }
- }
-
- private void sleep()
- {
- try
- {
- Thread.sleep(2000);
- }
- catch(Exception ex)
- {
-
- }
- }
- }
-
- /**
- * Updates the table with new notifications received from mbean server for all mbeans
- */
- protected void updateTableViewer()
- {
- ServerRegistry serverRegistry = ApplicationRegistry.getServerRegistry(MBeanView.getServer());
- List<NotificationObject> newList = serverRegistry.getNotifications(null);
- if (newList == null)
- return;
-
- _notifications = newList;
- _tableViewer.setInput(_notifications);
- _tableViewer.refresh();
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java
deleted file mode 100644
index 5d6a03b238..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java
+++ /dev/null
@@ -1,593 +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.
- *
- */
-package org.apache.qpid.management.ui.views;
-
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.openmbean.ArrayType;
-import javax.management.openmbean.CompositeData;
-import javax.management.openmbean.CompositeDataSupport;
-import javax.management.openmbean.CompositeType;
-import javax.management.openmbean.OpenType;
-import javax.management.openmbean.TabularDataSupport;
-import javax.management.openmbean.TabularType;
-
-import org.apache.qpid.management.ui.ApplicationWorkbenchAdvisor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-
-/**
- * Utility Class for displaying OpenMbean data types by creating required SWT widgets
- * @author Bhupendra Bhardwaj
- */
-public class ViewUtility
-{
- public static final String OP_NAME = "operation_name";
- public static final String OP_PARAMS = "parameters";
- public static final String PARAMS_TEXT = "text";
-
- public static final String FIRST = "First";
- public static final String LAST = "Last";
- public static final String NEXT = "Next";
- public static final String PREV = "Previous";
- public static final String INDEX = "Index";
-
- private static final Comparator tabularDataComparator = new TabularDataComparator();
-
- private static List<String> SUPPORTED_ARRAY_DATATYPES = new ArrayList<String>();
- static
- {
- SUPPORTED_ARRAY_DATATYPES.add("java.lang.String");
- SUPPORTED_ARRAY_DATATYPES.add("java.lang.Boolean");
- SUPPORTED_ARRAY_DATATYPES.add("java.lang.Character");
- SUPPORTED_ARRAY_DATATYPES.add("java.lang.Integer");
- SUPPORTED_ARRAY_DATATYPES.add("java.lang.Long");
- SUPPORTED_ARRAY_DATATYPES.add("java.lang.Double");
- SUPPORTED_ARRAY_DATATYPES.add("java.util.Date");
- }
-
- /**
- * Populates the composite with given openmbean data type (TabularType or CompositeType)
- * @param toolkit
- * @param parent composite
- * @param data open mbean data type(either composite type or tabular data type)
- */
- public static void populateCompositeWithData(FormToolkit toolkit, Composite parent, Object data)
- {
- if (data instanceof TabularDataSupport)
- {
- ViewUtility.createTabularDataHolder(toolkit, parent, (TabularDataSupport)data);
- }
- else if (data instanceof CompositeDataSupport)
- {
- ViewUtility.populateCompositeWithCompositeData(toolkit, parent, (CompositeDataSupport)data);
- }
- }
-
- @SuppressWarnings("unchecked")
- private static void createTabularDataHolder(FormToolkit toolkit, Composite parent, TabularDataSupport tabularData)
- {
- Composite composite = toolkit.createComposite(parent, SWT.BORDER);
- GridLayout layout = new GridLayout(4, true);
- layout.horizontalSpacing = 0;
- layout.marginWidth = 0;
- layout.marginHeight = 10;
- layout.verticalSpacing = 10;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
- Set entrySet = tabularData.entrySet();
- ArrayList<Map.Entry> list = new ArrayList<Map.Entry>(entrySet);
- if (list.size() == 0)
- {
- Text text = toolkit.createText(composite, " No records ", SWT.CENTER | SWT.SINGLE | SWT.READ_ONLY);
- GridData layoutData = new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1);
- text.setLayoutData(layoutData);
- return;
- }
-
- Collections.sort(list, tabularDataComparator);
-
- // Attach the tabular record to be retrieved and shown later when record is traversed
- // using first/next/previous/last buttons
- composite.setData(list);
-
- // Create button and the composite for CompositeData
- Composite compositeDataHolder = createCompositeDataHolder(toolkit, composite,
- tabularData.getTabularType().getRowType());
-
- // display the first record
- CompositeData data = (CompositeData)(list.get(0)).getValue();
- composite.setData(INDEX, 0);
- populateCompositeWithCompositeData(toolkit, compositeDataHolder, data);
- enableOrDisableTraversalButtons(composite);
- }
-
- private static void enableOrDisableTraversalButtons(Composite composite)
- {
- int index = (Integer)composite.getData(INDEX);
- int size = ((List)composite.getData()).size();
-
- ((Button)composite.getData(FIRST)).setEnabled(true);
- ((Button)composite.getData(PREV)).setEnabled(true);
- ((Button)composite.getData(NEXT)).setEnabled(true);
- ((Button)composite.getData(LAST)).setEnabled(true);
-
- if (index == 0)
- {
- ((Button)composite.getData(FIRST)).setEnabled(false);
- ((Button)composite.getData(PREV)).setEnabled(false);
- }
- if (index == size -1)
- {
- ((Button)composite.getData(NEXT)).setEnabled(false);
- ((Button)composite.getData(LAST)).setEnabled(false);
- }
- }
-
- /**
- * Sets up the given composite for holding a CompositeData. Create traversal buttons, label etc and
- * creates a child Composite, which should be populated with the CompositeData
- * @param toolkit
- * @param dataHolder
- * @param compositeType
- * @return
- */
- private static Composite createCompositeDataHolder(final FormToolkit toolkit, final Composite dataHolder, CompositeType compositeType)
- {
- String desc = compositeType.getDescription();
- Label description = toolkit.createLabel(dataHolder, desc, SWT.CENTER);
- description.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false, 4, 1));
- // TODO nameLabel.setFont(font);
- description.setText(desc);
-
- // Add traversal buttons
- final Button firstRecordButton = toolkit.createButton(dataHolder, FIRST, SWT.PUSH);
- GridData layoutData = new GridData (GridData.HORIZONTAL_ALIGN_END);
- layoutData.widthHint = 80;
- firstRecordButton.setLayoutData(layoutData);
-
- final Button nextRecordButton = toolkit.createButton(dataHolder, NEXT, SWT.PUSH);
- layoutData = new GridData (GridData.HORIZONTAL_ALIGN_END);
- layoutData.widthHint = 80;
- nextRecordButton.setLayoutData(layoutData);
-
- final Button previousRecordButton = toolkit.createButton(dataHolder, PREV, SWT.PUSH);
- layoutData = new GridData (GridData.HORIZONTAL_ALIGN_BEGINNING);
- layoutData.widthHint = 80;
- previousRecordButton.setLayoutData(layoutData);
-
- final Button lastRecordButton = toolkit.createButton(dataHolder, LAST, SWT.PUSH);
- layoutData = new GridData (GridData.HORIZONTAL_ALIGN_BEGINNING);
- layoutData.widthHint = 80;
- lastRecordButton.setLayoutData(layoutData);
-
- // Now create the composite, which will hold the CompositeData
- final Composite composite = toolkit.createComposite(dataHolder, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.horizontalSpacing = layout.verticalSpacing = 0;
- layout.marginHeight = layout.marginWidth = 0;
- composite.setLayout(layout);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 4, 1));
-
- // Add button references. These references will be used when buttons
- // are to enabled or disabled based of record index. e.g. for first record
- // First and Previous buttons will be disabled.
- dataHolder.setData(FIRST, firstRecordButton);
- dataHolder.setData(NEXT, nextRecordButton);
- dataHolder.setData(PREV, previousRecordButton);
- dataHolder.setData(LAST, lastRecordButton);
-
- // Listener for the traversal buttons. When a button is clicked the respective
- // CompositeData will be populated in the composite
- SelectionListener listener = new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- if (!(e.widget instanceof Button))
- return;
-
- Button traverseButton =(Button)e.widget;
- // Get the CompositeData respective to the button selected
- CompositeData data = getCompositeData(dataHolder, traverseButton.getText());
- populateCompositeWithCompositeData(toolkit, composite, data);
- enableOrDisableTraversalButtons(dataHolder);
- }
- };
-
- firstRecordButton.addSelectionListener(listener);
- nextRecordButton.addSelectionListener(listener);
- previousRecordButton.addSelectionListener(listener);
- lastRecordButton.addSelectionListener(listener);
-
- return composite;
- }
-
- /**
- * The CompositeData is set as data with the Composite and using the index, this method will
- * return the corresponding CompositeData
- * @param compositeHolder
- * @param dataIndex
- * @return the CompositeData respective to the index
- */
- private static CompositeData getCompositeData(Composite compositeHolder, String dataIndex)
- {
- List objectData = (List)compositeHolder.getData();
- if (objectData == null || objectData.isEmpty())
- {
- // TODO
- }
-
- // Get the index of record to be shown.
- int index = 0;
- if (compositeHolder.getData(INDEX) != null)
- {
- index = (Integer)compositeHolder.getData(INDEX);
- }
-
- if (FIRST.equals(dataIndex))
- {
- index = 0;
- }
- else if (NEXT.equals(dataIndex))
- {
- index = index + 1;
- }
- else if (PREV.equals(dataIndex))
- {
- index = (index != 0) ? (index = index - 1) : index;
- }
- else if (LAST.equals(dataIndex))
- {
- index = objectData.size() -1;
- }
-
- // Set the index being shown.
- compositeHolder.setData(INDEX, index);
-
- return (CompositeData)((Map.Entry)objectData.get(index)).getValue();
- }
-
- /**
- * Populates the given composite with the CompositeData. Creates required widgets to hold the data types
- * @param toolkit
- * @param parent
- * @param data CompositeData
- */
- @SuppressWarnings("unchecked")
- private static void populateCompositeWithCompositeData(FormToolkit toolkit, Composite parent, CompositeData data)
- {
- Control[] oldControls = parent.getChildren();
- for (int i = 0; i < oldControls.length; i++)
- {
- oldControls[i].dispose();
- }
-
- Composite compositeHolder = toolkit.createComposite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(4, false);
- layout.horizontalSpacing = 10;
- compositeHolder.setLayout(layout);
- compositeHolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
-
- // ItemNames in composite data
- List<String> itemNames = new ArrayList<String>(data.getCompositeType().keySet());
-
- for (String itemName : itemNames)
- {
- OpenType itemType = data.getCompositeType().getType(itemName);
- Label keyLabel = toolkit.createLabel(compositeHolder, itemName, SWT.TRAIL);
- GridData layoutData = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
- layoutData.minimumWidth = 70;
- keyLabel.setLayoutData(layoutData);
-
- if (itemType.isArray())
- {
- OpenType type = ((ArrayType)itemType).getElementOpenType();
- // If Byte array and mimetype is text, convert to text string
- if (type.getClassName().equals(Byte.class.getName()))
- {
- String mimeType = null;
- String encoding = null;
- if (data.containsKey("MimeType"))
- {
- mimeType = (String)data.get("MimeType");
- }
- if (data.containsKey("Encoding"))
- {
- encoding = (String)data.get("Encoding");
- }
-
- if (encoding == null || encoding.length() == 0)
- {
- encoding = Charset.defaultCharset().name();
- }
-
- if ("text/plain".equals(mimeType))
- {
- convertByteArray(toolkit, compositeHolder, data, itemName, encoding);
- }
- else
- {
- setNotSupportedDataType(toolkit, compositeHolder);
- }
- }
- // If array of any other supported type, show as a list of String array
- else if (SUPPORTED_ARRAY_DATATYPES.contains(type.getClassName()))
- {
- convertArrayItemForDisplay(compositeHolder, data, itemName);
- }
- else
- {
- setNotSupportedDataType(toolkit, compositeHolder);
- }
- }
- else if (itemType instanceof TabularType)
- {
- Composite composite = toolkit.createComposite(compositeHolder, SWT.NONE);
- composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 3, 1));
- layout = new GridLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- composite.setLayout(layout);
- createTabularDataHolder(toolkit, composite, (TabularDataSupport)data.get(itemName));
- }
- else
- {
- Text valueText = toolkit.createText(compositeHolder, String.valueOf(data.get(itemName)), SWT.READ_ONLY | SWT.BORDER);
- valueText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 3, 1));
- }
- }
-
- // layout the composite after creating new widgets.
- parent.layout();
- } //end of method
-
-
- private static void convertByteArray(FormToolkit toolkit, Composite compositeHolder, CompositeData data, String itemName, String encoding)
- {
- Byte[] arrayItems = (Byte[])data.get(itemName);
- byte[] byteArray = new byte[arrayItems.length];
-
- for (int i = 0; i < arrayItems.length; i++)
- {
- byteArray[i] = arrayItems[i];
- }
- try
- {
- String textMessage = new String(byteArray, encoding);
-
- Text valueText = toolkit.createText(compositeHolder, textMessage, SWT.READ_ONLY | SWT.BORDER |
- SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1);
- gridData.heightHint = 300;
- valueText.setLayoutData(gridData);
- }
- catch(Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
- private static Shell getShell()
- {
- Shell shell = Display.getCurrent().getActiveShell();
-
- // Under linux GTK getActiveShell returns null so we need to make a new shell for display.
- // Under windows this is fine.
- if (shell == null)
- {
- // This occurs under linux gtk
- shell = new Shell(Display.getCurrent(), SWT.BORDER | SWT.CLOSE | SWT.MIN | SWT.MAX);
- }
-
- return shell;
- }
-
- private static int showBox(String title, String message, int icon)
- {
- MessageBox messageBox = new MessageBox(getShell(), icon);
- messageBox.setMessage(message);
- messageBox.setText(title);
-
- return messageBox.open();
- }
-
- public static int popupInfoMessage(String title, String message)
- {
- return showBox(title, message, SWT.ICON_INFORMATION | SWT.OK);
- }
-
- public static int popupErrorMessage(String title, String message)
- {
- return showBox(title, message, SWT.ICON_ERROR | SWT.OK);
- }
-
- public static int popupConfirmationMessage(String title, String message)
- {
- return showBox(title, message,SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL);
- }
-
-
- public static Shell createPopupShell(String title, int width, int height)
- {
- Display display = Display.getCurrent();
- Shell shell = new Shell(display, SWT.BORDER | SWT.CLOSE | SWT.MIN |SWT.MAX);
- shell.setText(title);
- shell.setLayout(new GridLayout());
- int x = display.getBounds().width;
- int y = display.getBounds().height;
- shell.setBounds(x/4, y/4, width, height);
-
- return shell;
- }
-
- /**
- * Creates a List widget for displaying array of strings
- * @param compositeHolder
- * @param data - containing the array item value
- * @param itemName - item name
- */
- private static void convertArrayItemForDisplay(Composite compositeHolder, CompositeData data, String itemName)
- {
- Object[] arrayItems = (Object[])data.get(itemName);
- String[] items = new String[arrayItems.length];
- for (int i = 0; i < arrayItems.length; i++)
- {
- items[i] = String.valueOf(arrayItems[i]);
- }
- org.eclipse.swt.widgets.List list = new org.eclipse.swt.widgets.List(compositeHolder,
- SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.READ_ONLY);
- list.setItems(items);
- //list.setBackground(compositeHolder.getBackground());
- list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 3, 1));
- }
-
- private static void setNotSupportedDataType(FormToolkit toolkit, Composite compositeHolder)
- {
- Text valueText = toolkit.createText(compositeHolder, "--- Content can not be displayed ---", SWT.READ_ONLY);
- valueText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 3, 1));
- }
-
- /**
- * Converts the input string to displayable format by converting some character case or inserting space
- * @param input
- * @return formatted string
- */
- public static String getDisplayText(String input)
- {
- StringBuffer result = new StringBuffer(input);
- if (Character.isLowerCase(result.charAt(0)))
- {
- result.setCharAt(0, Character.toUpperCase(result.charAt(0)));
- }
- for (int i = 1; i < input.length(); i++)
- {
- if (Character.isUpperCase(result.charAt(i)) && !Character.isWhitespace(result.charAt(i - 1))
- && Character.isLowerCase(result.charAt(i - 1)))
- {
- result.insert(i, " ");
- i++;
- }
- else if (Character.isLowerCase(result.charAt(i)) && Character.isWhitespace(result.charAt(i - 1)))
- {
- result.setCharAt(i, Character.toUpperCase(result.charAt(i)));
- }
-
- }
-
- return result.toString();
- }
-
- /**
- * Disposes the children of given Composite if not null and not already disposed
- * @param parent composite
- */
- public static void disposeChildren(Composite parent)
- {
- if (parent == null || parent.isDisposed())
- return;
-
- Control[] oldControls = parent.getChildren();
- for (int i = 0; i < oldControls.length; i++)
- {
- oldControls[i].dispose();
- }
- }
-
- public static char[] getHash(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException
- {
- byte[] data = text.getBytes("utf-8");
-
- MessageDigest md = MessageDigest.getInstance("MD5");
-
- for (byte b : data)
- {
- md.update(b);
- }
-
- byte[] digest = md.digest();
-
- char[] hash = new char[digest.length ];
-
- int index = 0;
- for (byte b : digest)
- {
- hash[index++] = (char) b;
- }
-
- return hash;
- }
-
- private static class TabularDataComparator implements java.util.Comparator<Map.Entry>
- {
- public int compare(Map.Entry data1, Map.Entry data2)
- {
- if (data1.getKey() instanceof List)
- {
- Object obj1 = ((List)data1.getKey()).get(0);
- Object obj2 = ((List)data2.getKey()).get(0);
- String str1 = obj1.toString();
- String str2 = obj2.toString();
- if (obj1 instanceof String)
- {
- return str1.compareTo(str2);
- }
-
- try
- {
- return Long.valueOf(str1).compareTo(Long.valueOf(str2));
- }
- catch (Exception ex)
- {
- return -1;
- }
- }
-
- return -1;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/.eclipseproduct b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/.eclipseproduct
deleted file mode 100644
index 28ee27ca17..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/.eclipseproduct
+++ /dev/null
@@ -1,23 +0,0 @@
-#Eclipse Product File
-#Fri Nov 03 14:47:54 GMT 2006
-#
-# 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.
-#
-version=1.0-incubating-M2-SNAPSHOT
-name=Qpid Management Console
-id=org.apache.qpid.manager.gui.product
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/eclipse.exe b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/eclipse.exe
deleted file mode 100644
index 7826d1ed80..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/eclipse.exe
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/eclipse.ini b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/eclipse.ini
deleted file mode 100644
index f56524580d..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/eclipse.ini
+++ /dev/null
@@ -1,23 +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.
-###############################################################################
-
--vmargs
--Xms40m
--Xmx256m
--Declipse.consoleLog=true
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/icons/Console.icns b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/icons/Console.icns
deleted file mode 100644
index 610976efab..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/icons/Console.icns
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/license.eclipse.txt b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/license.eclipse.txt
deleted file mode 100644
index da433e89f9..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/license.eclipse.txt
+++ /dev/null
@@ -1,88 +0,0 @@
-Eclipse Public License - v 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-
-i) changes to the Program, and
-
-ii) additions to the Program;
-
-where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
-
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
-
-2. GRANT OF RIGHTS
-
-a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
-
-b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
-
-c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
-
-d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
-
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
-
-a) it complies with the terms and conditions of this Agreement; and
-
-b) its license agreement:
-
-i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
-
-ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
-
-iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
-
-iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
-
-When the Program is made available in source code form:
-
-a) it must be made available under this Agreement; and
-
-b) a copy of this Agreement must be included with each copy of the Program.
-
-Contributors may not remove or alter any copyright notices contained within the Program.
-
-Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED 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. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
-
-
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Configuration/config.ini b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Configuration/config.ini
deleted file mode 100644
index fe1a9fe2c2..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Configuration/config.ini
+++ /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.
-###############################################################################
-
-#Product Runtime Configuration File
-
-org.eclipse.update.reconcile=false
-osgi.splashPath=platform\:/base/plugins/org.eclipse.platform
-eclipse.product=org.apache.qpid.management.ui.product
-eclipse.application=org.apache.qpid.management.ui.application
-
-osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start,com.ibm.icu,org.apache.qpid.management.ui,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.expressions,org.eclipse.core.jobs,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.jface,org.eclipse.swt,org.eclipse.swt.carbon.macosx,org.eclipse.ui,org.eclipse.ui.forms,org.eclipse.ui.workbench,org.eclipse.equinox.app,org.eclipse.core.databinding,org.eclipse.jface.databinding,jmxremote.sasl
-
-osgi.bundles.defaultStartLevel=4
-eof=eof
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Info.plist b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Info.plist
deleted file mode 100644
index 77f79a2944..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/Info.plist
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleExecutable</key>
- <string>eclipse</string>
- <key>CFBundleGetInfoString</key>
- <string>Apache Qpid Management Console for Mac OS X</string>
- <key>CFBundleIconFile</key>
- <string>Console.icns</string>
- <key>CFBundleIdentifier</key>
- <string>org.apache.qpid.management.ui</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>Qpid Management Console</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>3.4</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>3.4</string>
- <key>Qpid Management Console</key>
- <array>
- <string>-consoleLog</string>
- <string>-showlocation</string>
- </array>
-</dict>
-</plist>
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/eclipse b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/eclipse
deleted file mode 100755
index 36247a08e4..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/eclipse
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/eclipse.ini b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/eclipse.ini
deleted file mode 100644
index d3c2505730..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/macosx/eclipse.ini
+++ /dev/null
@@ -1,14 +0,0 @@
--showsplash
-org.eclipse.platform
--startup
-../../plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
---launcher.library
-../../plugins/org.eclipse.equinox.launcher.carbon.macosx_1.0.101.R34x_v20080731
--vmargs
-#-Xdock:icon=../Resources/Eclipse.icns
--XstartOnFirstThread
--Xms40m
--Xmx512m
--XX:MaxPermSize=256m
--Dosgi.requiredJavaVersion=1.5
--Dorg.eclipse.swt.internal.carbon.smallFonts
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF
deleted file mode 100644
index fa11bac2ea..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF
+++ /dev/null
@@ -1,19 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: jmx sasl Plug-in
-Bundle-SymbolicName: jmxremote.sasl
-Bundle-Version: 1.0.1
-Bundle-ClassPath: jmxremote_optional.jar
-Export-Package: com.sun.jmx.remote.generic,
- com.sun.jmx.remote.opt.internal,
- com.sun.jmx.remote.opt.security,
- com.sun.jmx.remote.opt.util,
- com.sun.jmx.remote.profile.sasl,
- com.sun.jmx.remote.profile.tls,
- com.sun.jmx.remote.protocol.jmxmp,
- com.sun.jmx.remote.socket,
- javax.management.remote.generic,
- javax.management.remote.jmxmp,
- javax.management.remote.message
-Bundle-Vendor:
-Bundle-Localization: plugin
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/startup.jar b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/startup.jar
deleted file mode 100644
index 2f26eceece..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/startup.jar
+++ /dev/null
Binary files differ
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini
deleted file mode 100644
index 5bbf344c17..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini
+++ /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.
-###############################################################################
-
-#Product Runtime Configuration File
-
-osgi.splashPath=platform:/base/plugins/org.apache.qpid.management.ui
-eclipse.product=org.apache.qpid.management.ui.product
-eclipse.application=org.apache.qpid.management.ui.application
-osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start,com.ibm.icu,org.apache.qpid.management.ui,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.expressions,org.eclipse.core.jobs,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.jface,org.eclipse.swt,org.eclipse.swt.gtk.linux.x86,org.eclipse.ui,org.eclipse.ui.forms,org.eclipse.ui.workbench,jmxremote.sasl
-osgi.bundles.defaultStartLevel=4
-eof=eof
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/unix/eclipse.ini b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/unix/eclipse.ini
deleted file mode 100644
index 33884bd8f1..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/unix/eclipse.ini
+++ /dev/null
@@ -1,11 +0,0 @@
--startup
-plugins/org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar
---launcher.library
-plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.101.R34x_v20080805
-#-showsplash
-#org.eclipse.platform
---launcher.XXMaxPermSize
-256m
--vmargs
--Xms40m
--Xmx256m
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini b/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini
deleted file mode 100644
index e83321e650..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini
+++ /dev/null
@@ -1,26 +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.
-###############################################################################
-
-#Product Runtime Configuration File
-
-osgi.splashPath=platform:/base/plugins/org.apache.qpid.management.ui
-eclipse.product=org.apache.qpid.management.ui.product
-eclipse.application=org.apache.qpid.management.ui.application
-osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.core.runtime@start,com.ibm.icu,org.apache.qpid.management.ui,org.eclipse.core.commands,org.eclipse.core.contenttype,org.eclipse.core.expressions,org.eclipse.core.jobs,org.eclipse.core.runtime.compatibility.auth,org.eclipse.core.runtime.compatibility.registry,org.eclipse.equinox.preferences,org.eclipse.equinox.registry,org.eclipse.help,org.eclipse.jface,org.eclipse.swt,org.eclipse.swt.win32.win32.x86,org.eclipse.ui,org.eclipse.ui.forms,jmxremote.sasl,org.eclipse.ui.workbench
-osgi.bundles.defaultStartLevel=4
diff --git a/M4-RCs/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.java b/M4-RCs/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.java
deleted file mode 100644
index 11ab6af064..0000000000
--- a/M4-RCs/qpid/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.java
+++ /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.
- *
- */
-package org.apache.qpid.management.ui;
-
-import junit.framework.TestCase;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.exchange.DirectExchange;
-import org.apache.qpid.server.management.AMQManagedObject;
-import org.apache.qpid.server.queue.AMQQueueMBean;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import javax.management.MBeanFeatureInfo;
-import javax.management.MBeanInfo;
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * Test class to test if any change in the broker JMX code is affesting the management console
- * There are some hardcoding of management feature names and parameter names to create a customized
- * look in the console.
- */
-public class ManagementConsoleTest extends TestCase
-{
- private VirtualHost _virtualHost;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance();
- _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- ApplicationRegistry.removeAll();
- }
-
- /**
- * Test for AMQQueueMBean attribute and operation names, which are used in the management console
- * @throws Exception
- */
- public void testAMQQueueMBeanInfo() throws Exception
- {
- // If this test fails due to changes in the broker code,
- // then the constants in the Constants.java shoule be updated accordingly
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueueForManagement"), false, null, false, _virtualHost,
- null);
- AMQManagedObject mbean = new AMQQueueMBean(queue);
- MBeanInfo mbeanInfo = mbean.getMBeanInfo();
-
- List<String> operationNames = getNamesList(mbeanInfo.getOperations());
- assertTrue(operationNames.contains(Constants.OPERATION_MOVE_MESSAGES));
-
- List<String> attributesList = getNamesList(mbeanInfo.getAttributes());
- assertTrue(attributesList.contains(Constants.ATTRIBUTE_QUEUE_CONSUMERCOUNT));
- assertTrue(attributesList.contains(Constants.ATTRIBUTE_QUEUE_DEPTH));
- }
-
- /**
- * Test for Exchange MBean attribute and operation names, which are used in the management console
- * @throws Exception
- */
- public void testExchangeMBeanInfo() throws Exception
- {
- // If this test fails due to changes in the broker code,
- // then the constants in the Constants.java shoule be updated accordingly
- DirectExchange exchange = new DirectExchange();
- exchange.initialise(_virtualHost, ExchangeDefaults.DIRECT_EXCHANGE_NAME, false, 0, true);
- AMQManagedObject mbean = (AMQManagedObject)exchange.getManagedObject();
- MBeanInfo mbeanInfo = mbean.getMBeanInfo();
-
- // Check for the Exchange Type property in the ObjectName
- assertNotNull(mbean.getObjectName().getKeyProperty(Constants.EXCHANGE_TYPE));
-
- // Check for operation names
- List<String> operationNames = getNamesList(mbeanInfo.getOperations());
- assertTrue(operationNames.contains(Constants.OPERATION_CREATE_BINDING));
- }
-
- /**
- * Test for VirtualHostManagerMBean features used in Management console for customizing the GUI
- * @throws Exception
- */
- public void testVirtualHostManagerMBeanInfo() throws Exception
- {
- AMQManagedObject mbean = (AMQManagedObject)_virtualHost.getManagedObject();
- assertTrue(mbean.getType().equals(Constants.VIRTUAL_HOST));
- }
-
- private List<String> getNamesList(MBeanFeatureInfo[] features)
- {
- List<String> names = new ArrayList<String>();
- for (MBeanFeatureInfo feature : features)
- {
- names.add(feature.getName());
- }
-
- return names;
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/Guide.txt b/M4-RCs/qpid/java/management/tools/qpid-cli/Guide.txt
deleted file mode 100644
index db841ebaa1..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/Guide.txt
+++ /dev/null
@@ -1,143 +0,0 @@
-
- * How to connect with the Broker *
- ---------------------------------
-
-Before you come in to this state you have to build the source or you
-can get the binary and extract then set the QPID_CLI environment
-variable to the main directory of the source or binary,then only you
-are in a position to start working with management console. First
-check whether the broker is up and running. In order to simply connect
-with the broker you can run the qpid-cli script which required
-arguments.
-
-${QPID_CLI}/bin/qpid-cli -h [HostName of IP of the broker ] -p [Port
-of the broker]
-
-Default values for arguments -h [localhost] -p [8999]
-
- * One Shot mode *
- -----------------
-
-With one shot mode you can run interactive mode commands for one time
-and disconnect with the broker.This feature is useful when you want to
-run particular command in the management console using a script which
-is running in the normal console.What you have to do is you have to
-give the command you want to run with the qpid-cli script running
-command.
-
-Ex 1: $QPID_CLI/bin/qpid-cli queue list -- This will list the queue
-objects and disconnect.
-
-Ex 2: $QPID_CLI/bin/qpid-cli queue view -n ping - This will display
-information about all the message in the queue with the name of ping
-
-Likewise you can run any command in one shot mode and get the output
-for one time.
-
- * Report Generation Mode *
- -------------------------
-
-If you want to generate reports you can do it by defining your
-required information using a property file. There's a sample property
-file in the parent directory and you can have a look and get an idea
-about that.You can generate reports by giving a time interval in the
-property file. In order to start the daemon mode you have to run the
-qpid-cli script with the option : -r by giving the path for your
-property file.
-
-Ex: $QPID_CLI/bin/qpid-cli -r ../report.property
-
-You should specify a property file in order to run the daemon mode and
-get information repeatedly.
-
- * Interactive mode with number of command *
- -------------------------------------------
-
-This is the mode you get when you run the qpid-cli script without the
-one shot mode and without the daemon mode with [-r] option.Once you
-connect with the broker it display you a prompt [qpid-admin-$], then
-you can run several commands to can perform following tasks.
-
-For all the commands object type is command and most important command
-so you can use this option value without giving the option letter by
-giving that option value at the beginning of the command.
-
-Ex: [list -o queue ] can use this command like this dropping -o option
-[queue list]
-Ex: [list -o queue -n ping] = [queue list -n ping]
-
- * Data displaying commands *
- ----------------------------
-
-This is the set of commands which display the information about
-broker.
-
-list :
-------
-list information about the given object type with limited
-number of attributes and you can use number of command options to get
-different useful behaviors with the list command.You can get the
-complete description about the command by running the command like
-this.[list -h].
-
-info :
-------
-list all the attributes of a given object type. This command
-works very similar way to list command. You can use -h option for help
-and get complete description of the info command.
-
-view :
-------
-view information about the content of the message in the queue
-object. In order to run this command you have to specify the object
-type at the beginning.You can give how many message informations you
-want to view from the top of the queue by using -t option.
-
-Ex : queue view -n message_queue -t 5
-[list the message info for top 5 messages in queue message_queue]
-
-viewcontent :
--------------
-view the content of the a given message in the
-queue. You have to give the messageId as a parameter with -id option
-letters.
-
-Ex: queue viewcontent -n message_queue -id 12
-[list the content encoding and Mimetype of the message with the
-messageId for the give message which is in the queue message_queue]
-
- * Data modification commands *
- ------------------------------
-
-This is a set of commands which allow users to deal with messages in
-queues.Users can delete messages from a give queue and user's can move
-one message from one queue to another queue.
-
-delete :
---------
-Using this command user can delete a give message from a given
-queue you can specify how many messages you want to delete from the
-queue from the top of the queue by using -t option.If user does not
-give how many messages to delete from the top of the queue program is
-going to delete all the messages from the queue after giving a prompt
-to confirm the deletion.
-
-Ex: queue delete -n message_queue -t 3
-[Delete top three messages in the queue message_queue ]
-
-move :
-------
-This command allow user to move number of messages from one
-queue to another queue. First you have to specify from which queue you
-want to move messages by using -n1 and -v1 option letters(-n1 queue
-name/ -v1 virtual host).Then you have to use -n2 option to give the
-target queue name and then you have to give From messageId and To
-messageId using -fmid and -tmid option letters to specify the messages
-range you want to do the move operation.
-
-Ex: queue move -n1 message_queue -n2 ping -fmid 13 -tmid 15
-[This will move messages with the messageId range of 13-15 from queue
-message_queue to queue ping.
-
-
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/LICENSE b/M4-RCs/qpid/java/management/tools/qpid-cli/LICENSE
deleted file mode 100644
index c6432e459f..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/LICENSE
+++ /dev/null
@@ -1,225 +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.
-
-
-=============================================================================
-== JLine (BSD) License
-=============================================================================
-Copyright (c) 2008, Apache Software Foundation
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-
-
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/NOTICE b/M4-RCs/qpid/java/management/tools/qpid-cli/NOTICE
deleted file mode 100644
index f1d9e54095..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/NOTICE
+++ /dev/null
@@ -1,12 +0,0 @@
-Apache Qpid
-Copyright 2006-2008 Apache Software Foundation
-This product includes software developed at
-Apache Software Foundation (http://www.apache.org/)
-
-Handling console input is provided bye the Jline library package,
-JLine is a Java library for handling console input. It is similar
-in functionality to BSD editline and GNU readline.Original software is
-available from
-
-http://jline.sourceforge.net/index.html
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/README b/M4-RCs/qpid/java/management/tools/qpid-cli/README
deleted file mode 100644
index 6db439aad0..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/README
+++ /dev/null
@@ -1,64 +0,0 @@
-README
-n======
-
-INSTALL
-=======
- source
- ======
- 1.Set the environment variable QPID_HOME to the root directory of the repository or the release.
-
- 2.Run these command to build the source
-
- ant compile OR run the ant build in the parent directory(main ant script)
-
- 3.To launch the CLI run the script in bin folder with appropriate parameters.
-
- ex:
-
- Linux $QPID_HOME/bin/qpid-cli -h 10.8.100.122 -p 8334
- Windows %QPID_HOME%/bin/qpid-cli.bat -h 10.8.100.122 -p 8334
-
- -h hostname (default localhost)
- -p broker port (default 8999)
-
- binary
- ======
- 1.Set the environment variable QPID_HOME to the root directory of the repository or the release.
-
- 2.To launch the CLI run the script in bin folder with appropriate parameters.
-
- ex:
-
- Linux $QPID_HOME/bin/qpid-cli -h 10.8.100.122 -p 8334
- Windows %QPID_HOME%/bin/qpid-cli.bat -h 10.8.100.122 -p 8334
-
- -h hostname (default localhost)
- -p broker port (default 8999)
-
- 3. No test cases are included in the binary version.
-
-TESTING
-=======
-
-1.Test source is located in the test directory.If you want to run the tests please start the
-Qpid java broker and run following ant targets.
-
- ant compile-tests This compile all the test sources
- ant test This runs all the test cases
-2.If you want to test with a remote broker please use the source release and change the constants in ConnectionConstants.java
-class.(Default values are BROKER_HOSTNAME="localhost" BROKER_PORT="8999")
-
-For more informations please visit the project home page.
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/bin/qpid-cli b/M4-RCs/qpid/java/management/tools/qpid-cli/bin/qpid-cli
deleted file mode 100755
index 0efb49dddd..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/bin/qpid-cli
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-#
-# License 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.
-#
-
-if [ -z "$QPID_HOME" ]; then
- export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
- export PATH=${PATH}:${QPID_HOME}/bin
-fi
-
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
-
-# Set other variables used by the qpid-run script before calling
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM=-Xmx1024m \
- QPID_CLASSPATH=$QPID_LIBS
-
-. qpid-run org.apache.qpid.CommandLineInterpreter "$@"
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/bin/qpid-cli.bat b/M4-RCs/qpid/java/management/tools/qpid-cli/bin/qpid-cli.bat
deleted file mode 100755
index e282114d75..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/bin/qpid-cli.bat
+++ /dev/null
@@ -1,27 +0,0 @@
-@REM
-@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.
-@REM
-set CLASSPATH=%CLASSPATH%;%QPID_HOME%/lib/jline-0.9.94.jar
-set CLASSPATH=%CLASSPATH%;%QPID_HOME%/lib/junit-4.4.jar
-set CLASSPATH=%CLASSPATH%;%QPID_HOME%/lib/qpid-cli-1.0.jar
-set CLASSPATH=%CLASSPATH%;%QPID_HOME%/management/tools/qpid-cli/main/classes/
-java -classpath %CLASSPATH% org.apache.qpid.CommandLineInterpreter %1
-
-
-
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/build.xml b/M4-RCs/qpid/java/management/tools/qpid-cli/build.xml
deleted file mode 100644
index 1c3c87cac6..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/build.xml
+++ /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.
- -
- -->
-<project name="qpid-cli">
-
- <property name="module.depends" value="common" />
- <property name="module.test.depends" value="common client" />
- <property name="module.src" value="src" />
- <!-- Disable tests as per QPID-1342 -->
- <!--property name="module.test.src" value="test" /-->
-
- <import file="../../../module.xml"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/report.property b/M4-RCs/qpid/java/management/tools/qpid-cli/report.property
deleted file mode 100644
index 46734d52a8..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/report.property
+++ /dev/null
@@ -1,26 +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.
-#
-
-object=queue
-column=Name,MessageCount,ActiveConsumerCount,Durable
-filter.name=ping
-filter.virtualhost=test
-output=csv
-seperator=|
-interval=1
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Command.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Command.java
deleted file mode 100644
index 6845361192..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Command.java
+++ /dev/null
@@ -1,62 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid;
-
-import org.apache.qpid.utils.CommandLineOption;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: May 29, 2008
- * Time: 9:21:46 PM
- * To change this template use File | Settings | File Templates.
- */
-public interface
- Command {
-
- public static String commandname = null;
- public static CommandLineOption options = null;
-
- void execute();
-
- void printusage();
-
- void optionchecker();
-
- void optionvaluechecker();
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandConstants.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandConstants.java
deleted file mode 100644
index 9285501693..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandConstants.java
+++ /dev/null
@@ -1,50 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid;
-
-public interface CommandConstants {
-
- String LIST_COMMAND = "list";
- String INFO_COMMAND = "info";
- String HELP_COMMAND = "help";
- String DELETE_COMMAND = "delete";
- String MOVE_COMMAND = "move";
- String VIEW_COMMAND = "view";
- String VIEWCONTENT_COMMAND = "viewcontent";
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecusionEngine.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecusionEngine.java
deleted file mode 100644
index ed54883759..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandExecusionEngine.java
+++ /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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid;
-
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.commands.*;
-import org.apache.qpid.commands.Command;
-
-
-public class CommandExecusionEngine {
- private Command currentcommand = null;
- private String commandname = null;
- private JMXinfo info = null;
-
- public CommandExecusionEngine(JMXinfo info) {
- this.info = info;
- this.commandname = info.getCommandLineOptionParser().getcommandname();
- }
-
- public boolean CommandSelector() {
-
- if (CommandConstants.INFO_COMMAND.equalsIgnoreCase(this.commandname))
- currentcommand = new Commandinfo(info, this.commandname);
- else if (CommandConstants.LIST_COMMAND.equalsIgnoreCase(this.commandname))
- currentcommand = new Commandlist(info, this.commandname);
- else if (CommandConstants.HELP_COMMAND.equalsIgnoreCase(this.commandname))
- currentcommand = new Commandhelp(info, this.commandname);
- else if (CommandConstants.DELETE_COMMAND.equalsIgnoreCase(this.commandname))
- currentcommand = new Commanddelete(info, this.commandname);
- else if (CommandConstants.MOVE_COMMAND.equalsIgnoreCase(this.commandname))
- currentcommand = new Commandmove(info, this.commandname);
- else if (CommandConstants.VIEW_COMMAND.equalsIgnoreCase(this.commandname))
- currentcommand = new Commandview(info, this.commandname);
- else if (CommandConstants.VIEWCONTENT_COMMAND.equalsIgnoreCase(this.commandname))
- currentcommand = new Commandviewcontent(info, this.commandname);
- else {
- usage();
- return false;
- }
- return true;
-
-
- }
-
- public void runcommand() {
- currentcommand.execute();
- }
-
- public void usage() {
- System.out.println(commandname + ":Command not found");
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java
deleted file mode 100644
index e9073c79ce..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/CommandLineInterpreter.java
+++ /dev/null
@@ -1,194 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-package org.apache.qpid;
-
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.utils.JMXConfiguration;
-import org.apache.qpid.utils.JMXinfo;
-
-import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.naming.ServiceUnavailableException;
-import java.io.PrintWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.FileInputStream;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.Properties;
-import java.rmi.ConnectException;
-
-import jline.ConsoleReader;
-import jline.ArgumentCompletor;
-import jline.SimpleCompletor;
-
-
-public class CommandLineInterpreter {
- public static void main(String[] args) {
- Connector conn = null;
- try {
- // Create an RMI connector client and
- // connect it to the RMI connector server
-
- /*checking the commandline options and
- parse them in to config method */
- JMXConnector jmxc = null;
- MBeanServerConnection mbsc = null;
- ConsoleReader reader = new ConsoleReader();
- reader.setBellEnabled(false);
- CommandLineOptionParser commandlineoptionparser = null;
-
- if ((args == null) || (args.length) == 0) {
- Usage();
- }
- /* here special constructor is calling, when parsing options,in here first option value is starting from minus sign
- so this is handle by a special constructor */
- else {
- if (args[0].startsWith("-")) {
- commandlineoptionparser = new CommandLineOptionParser(args, args[0]); // if user specify any argument with the qpid-cli script
- }
- }
-
- /* Connecting with the broker */
-// commandlineoptionparser = new CommandLineOptionParser(args);
-// JMXConfiguration config = new JMXConfiguration(commandlineoptionparser.getAlloptions());
- try {
- if (commandlineoptionparser == null)
- commandlineoptionparser = new CommandLineOptionParser(args);
-
- JMXConfiguration config = new JMXConfiguration(commandlineoptionparser.getAlloptions());
- conn = ConnectorFactory.getConnector(config.gethostname(), config.getport());
- jmxc = conn.getConnector();
- mbsc = conn.getMBeanServerConnection();
- if (config.checkoptionsetting("r", commandlineoptionparser.getAlloptions())) {
- JMXinfo info = new JMXinfo(jmxc, commandlineoptionparser, mbsc);
- ReportGenerator reportgen = new ReportGenerator(config.optionchecker("r", commandlineoptionparser.getAlloptions()), info);
- reportgen.loadproperties();
- reportgen.run();
- }
- /* This implementation is for the people who are using the interactive
- mode for one shot this run the user given command and exit */
- for (int i = 0; i < args.length; i++) {
- if (args[i].compareTo("list") == 0 || args[i].compareTo("info") == 0 || args[i].compareTo("view") == 0 || args[i].compareTo("viewcontent") == 0
- || args[i].compareTo("delete") == 0 || args[i].compareTo("move") == 0) {
- oneshotmode(args,commandlineoptionparser,jmxc,mbsc);
-
- return;
- }
- }
- } catch (Exception ex) {
- connectionrefuse();
- return;
- }
- /* In this point connection has been established */
- String line;
- String[] command;
-
- /* prividing GNU readline features using Jline library */
- //String list = "list";
- PrintWriter out = new PrintWriter(System.out);
- reader.addCompletor(new ArgumentCompletor(
- new SimpleCompletor(new String[]{"list", "info", "exit", "quit", "delete", "move", "view", "viewcontent", "queue", "exchange", "connection", "usermanagement", "virtualhost"})));
- while ((line = reader.readLine("qpid-admin-$ ")) != null) {
- out.flush();
- if (removeSpaces(line).equalsIgnoreCase("quit") || removeSpaces(line).equalsIgnoreCase("exit"))
- break;
- else if (line.length() == 0)
- continue;
- else {
- command = line.split("\\s+");
- commandlineoptionparser = new CommandLineOptionParser(command);
- JMXinfo info = new JMXinfo(jmxc, commandlineoptionparser, mbsc);
- CommandExecusionEngine engine = new CommandExecusionEngine(info);
- if (engine.CommandSelector())
- engine.runcommand();
- }
- }
- conn.getConnector().close();
- }
- catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- private static void Usage() {
- System.out.println("Connecting to localhost Qpid java broker...");
- }
-
- private static String removeSpaces(String s) {
- StringTokenizer st = new StringTokenizer(s, " ", false);
- String t = "";
- while (st.hasMoreElements()) t += st.nextElement();
- return t;
- }
-
- private static void connectionrefuse() {
- System.out.println("Cannot connect with the broker in given host with given port");
- System.out.println("Please check the host name and the port given");
- }
-
- private static void commandlineerror() {
- System.out.println("Please run the script again and try to connect to broker again");
- }
- public static String[] oneshotmode(String[] args,CommandLineOptionParser commandlineoptionparser,JMXConnector jmxc,MBeanServerConnection mbsc)
- {
- int check = 0;
- String [] temp;
- for (int i = 0; i < args.length; i++) {
-
- if (args[i].compareTo("-h") == 0)
- check++;
- else if (args[i].compareTo("-p") == 0)
- check++;
- }
- for (int i = 0; i < (args.length - 2 * check); i++) { // mulitply by 2 because have to remove the option letter with the option value//
- args[i] = args[i + check * 2];
- }
-
- commandlineoptionparser = new CommandLineOptionParser(args); //change the args string array which works as interactive mode//
- JMXinfo info = new JMXinfo(jmxc, commandlineoptionparser, mbsc);
- CommandExecusionEngine engine = new CommandExecusionEngine(info);
- if (engine.CommandSelector())
- engine.runcommand();
- return args;
-
- }
-}
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java
deleted file mode 100644
index d3357e31b7..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/Connector.java
+++ /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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid;
-
-import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.JMXConnectorFactory;
-import java.io.IOException;
-
-
-public class Connector {
- private JMXServiceURL url = null;
- private JMXConnector jmxc = null;
- private MBeanServerConnection mbsc = null;
-
-
- public Connector(JMXServiceURL url, JMXConnector jmxc, MBeanServerConnection mbsc) {
-
-
- this.url = url;
- this.jmxc = jmxc;
- this.mbsc = mbsc;
-
-
- }
-
- public JMXServiceURL getURL() {
- return url;
- }
-
- public JMXConnector getConnector() {
- return jmxc;
- }
-
- public MBeanServerConnection getMBeanServerConnection() {
- return mbsc;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java
deleted file mode 100644
index a94003dc45..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ConnectorFactory.java
+++ /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.
- *
- */
- /*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid;
-
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.JMXConnector;
-import javax.management.MBeanServerConnection;
-import java.io.IOException;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jul 3, 2008
- * Time: 10:51:28 AM
- * To change this template use File | Settings | File Templates.
- */
-public class ConnectorFactory {
-
- public static Connector getConnector(String host, String port) {
-
- String url_string = "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi";
- JMXServiceURL url;
- JMXConnector jmxc;
- MBeanServerConnection mbsc;
- try {
- url = new JMXServiceURL(url_string);
- jmxc = JMXConnectorFactory.connect(url, null);
- mbsc = jmxc.getMBeanServerConnection();
-
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- return new Connector(url, jmxc, mbsc);
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java
deleted file mode 100644
index 0a63d73a98..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/ReportGenerator.java
+++ /dev/null
@@ -1,180 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid;
-
-import org.apache.qpid.commands.objects.*;
-import org.apache.qpid.utils.JMXinfo;
-
-import javax.management.MBeanServerConnection;
-import java.util.*;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 12, 2008
- * Time: 4:03:21 PM
- * To change this template use File | Settings | File Templates.
- */
-public class ReportGenerator implements Runnable {
-
- String[] propertyname = {"object", "column", "filter.name", "filter.virtualhost", "output", "seperator", "interval"};
- String[] propertyvalue = null;
- String propertyfilepath = null;
- String[] columnvalue = null;
- List<String> columns = null;
- Properties props = null;
- JMXinfo info = null;
- int interval = 10;
-
- public void run() {
- for (; ;) // creating infinite loop
- {
- generatereport();
- try {
- Thread.sleep(this.interval * 60000);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
- }
-
- public ReportGenerator(String propfile, JMXinfo info) {
- this.propertyfilepath = propfile;
- props = new Properties();
- propertyvalue = new String[propertyname.length];
- this.info = info;
- columns = new ArrayList<String>();
- }
-
- public void loadproperties() // get all the property file values and set the columen values//
- {
- try {
-
- props.load(new FileInputStream(this.propertyfilepath));
- for (int i = 0; i < propertyname.length; i++) {
- propertyvalue[i] = props.getProperty(propertyname[i]);
- }
- this.setcolumnvalues();
- this.setinterval();
- }
-
- //catch exception in case properties file does not exist
-
- catch (IOException e) {
- System.out.println("Oooops Give property file is not exist");
- }
- }
-
- public void generatereport() {
- this.listobjects(propertyvalue[0]);
- }
-
- private void setcolumnvalues() {
- columnvalue = propertyvalue[1].split(",");
- for (int i = 0; i < columnvalue.length; i++) {
- columns.add(columnvalue[i]);
- }
- }
-
- private void setinterval() {
- this.interval = (new Integer(propertyvalue[6])).intValue();
- }
-
- private void listobjects(String option_value) {
- /*pring usage if use is not give the correct option letter or no options */
- if (option_value == null) {
-// System.out.println("testing");
- return;
- }
- MBeanServerConnection mbsc = info.getmbserverconnector();
- Set set = null;
- ObjectNames objname = null;
-
- try {
- if (option_value.compareToIgnoreCase("queue") == 0 || option_value.compareToIgnoreCase("queues") == 0) {
- objname = new QueueObject(mbsc);
-
- } else
- if (option_value.compareToIgnoreCase("Virtualhosts") == 0 || option_value.compareToIgnoreCase("Virtualhost") == 0) {
- objname = new VirtualHostObject(mbsc);
-// this.name = option_value;
- } else
- if (option_value.compareToIgnoreCase("Exchange") == 0 || option_value.compareToIgnoreCase("Exchanges") == 0) {
- objname = new ExchangeObject(mbsc);
-// this.name = option_value;
- } else
- if (option_value.compareToIgnoreCase("Connection") == 0 || option_value.compareToIgnoreCase("Connections") == 0) {
- objname = new ConnectionObject(mbsc);
-// this.name = option_value;
- } else if (option_value.compareToIgnoreCase("all") == 0) {
- objname = new AllObjects(mbsc);
-// this.name = option_value;
- } else
- if (option_value.compareToIgnoreCase("Usermanagement") == 0 || option_value.compareToIgnoreCase("Usermanagmenets") == 0) {
- objname = new UserManagementObject(mbsc);
-// this.name = option_value;
- } else {
- printusage();
- echo("Wrong objectName");
- return;
- }
- objname.setQueryString(this.propertyvalue[0], this.propertyvalue[2], this.propertyvalue[3]);
- objname.returnObjects();
- if (objname.getSet().size() != 0) {
- objname.reportgenerator(this.propertyvalue[4], this.propertyvalue[5], columns);
- } else {
- printusage();
- }
- }
- catch (Exception ex) {
- ex.printStackTrace();
- }
-
-
- }
-
- public void echo(String str) {
- System.out.println(str);
- }
-
- public void printusage() {
- System.out.println("Wrong option or wrong option value");
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Command.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Command.java
deleted file mode 100644
index 02c50e37e4..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Command.java
+++ /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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-package org.apache.qpid.commands;
-
-
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.utils.CommandLineOption;
-
-import javax.management.remote.JMXConnector;
-import javax.management.MBeanServerConnection;
-import java.util.Map;
-
-
-public class Command {
- public JMXinfo info = null;
- public String commandname = null;
-
-
- public Command(JMXinfo info, String name) {
- this.info = info;
- this.commandname = name;
- }
-
- public Command() {
-
- }
-
- public void execute() {
-
-
- }
-
- public void printusage() {
- }
-
-
- public String optionchecker(String option_letter) {
- Map map = info.getCommandLineOptionParser().getAlloptions();
- if (map == null)
- return null;
- CommandLineOption option = (CommandLineOption) map.get(option_letter);
- if (option == null)
- return null;
- String value = option.getOptionValue();
- return value;
- }
-
- public boolean checkoptionsetting(String option_letter) {
- Map map = info.getCommandLineOptionParser().getAlloptions();
- if (map == null)
- return false;
- CommandLineOption option = (CommandLineOption) map.get(option_letter);
- if (option == null)
- return false;
- String value = option.getOptionType();
-
- if (value != null)
- return true;
- else
- return false;
- }
-
- public void optionvaluechecker() {
-
- }
-
- public void echo(String str) {
- System.out.println(str);
- }
-
- public void unrecognizeoption() {
- echo("list: Unrecognized option");
- echo("Try `" + this.commandname + " --help` for more information");
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commanddelete.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commanddelete.java
deleted file mode 100644
index eb24012405..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commanddelete.java
+++ /dev/null
@@ -1,228 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-
-package org.apache.qpid.commands;
-
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.commands.objects.*;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
-import java.util.Set;
-import java.util.Iterator;
-import java.util.StringTokenizer;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 6, 2008
- * Time: 5:34:51 PM
- * To change this template use File | Settings | File Templates.
- */
-public class Commanddelete extends Command {
- private String object;
- private String name;
- private String vhost;
- private int number = 0;
- private QueueObject objname;
- private MBeanServerConnection mbsc;
- private String method1, method2;
- private ObjectName queue;
-
- public Commanddelete(JMXinfo info, String name) {
- super(info, name);
- this.mbsc = info.getmbserverconnector();
- this.objname = new QueueObject(mbsc);
- this.method1 = "deleteMessageFromTop";
- this.method2 = "clearQueue";
-
- }
-
- public void deletemessages() {
- Set set = null;
- objname.setQueryString(this.object, this.name, this.vhost);
- set = objname.returnObjects();
-
- if (objname.getSet().size() != 0) {
- Iterator it = set.iterator();
- this.queue = (ObjectName) it.next();
- try {
- if (this.number == 0) {
- echo("");
- System.out.print("Do you want to delete all the messages from the Queue [Y/N] :");
- InputStreamReader isr = new InputStreamReader(System.in);
- BufferedReader br = new BufferedReader(isr);
- String s = br.readLine();
- echo(s);
- if (s.compareToIgnoreCase("y") == 0)
- this.mbsc.invoke(queue, this.method2, null, null);
- else
- return;
- } else if (objname.getmessagecount(this.queue) < this.number) {
- echo("Given number is Greater than the Queue Depth");
- return;
- } else {
- for (int i = 0; i < this.number; i++) {
- this.mbsc.invoke(queue, this.method1, null, null);
- }
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- } else {
- if (isname()) {
-
- echo("The Queue you have specified is not in the current broker");
- echo("");
- } else {
- printusage();
- }
- }
- }
-
- public void execute() {
- /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
- with main option object or o
- */
-
- if (checkoptionsetting("object") || checkoptionsetting("o")) {
- String object = optionchecker("object");
- if (object == null) {
- object = optionchecker("o");
- }
- if (object.compareToIgnoreCase("queue") == 0)
- setobject(object);
- else {
- unrecognizeoption();
- echo("This command is only applicable for delete command so please start with queue");
- }
- if (checkoptionsetting("name") || checkoptionsetting("n")) {
- String name = optionchecker("name");
- if (name == null)
- name = optionchecker("n");
-
- setname(name);
- }
- if (checkoptionsetting("virtualhost") || checkoptionsetting("v")) {
- String vhost = optionchecker("virtualhost");
- if (vhost == null)
- vhost = optionchecker("v");
- setvhost(vhost);
- }
- if (checkoptionsetting("top") || checkoptionsetting("t")) {
- String number = optionchecker("top");
- if (number == null)
- number = optionchecker("t");
-
- setnumber(removeSpaces(number));
- }
- this.deletemessages();
- } else if (checkoptionsetting("h") || checkoptionsetting("help"))
- printusage();
- else
- unrecognizeoption();
- }
-
- public void printusage() {
- echo("");
- echo("Usage:delete [OPTION] ... [OBJECT TYPE]...\n");
- echo("Delete the top most messages from the given queue object\n");
- echo("To specify the desired queue you have to give the virtualhost name and the queue name with following commands\n");
- echo("Where possible options include:\n");
- echo(" -v --virtualhost Give the virtuallhost name of the desired queue");
- echo(" -n --name Give the queue name of the desired queue you want to do the delete operation");
- echo(" -t --top Give how many number of messages you want to delete from the top (Default = all the messages will be deleted");
- echo(" -h --help Display the help and back to the qpid-cli prompt\n");
-
- }
-
- private void setobject(String object) {
- this.object = object;
- }
-
- public String getobject() {
- return this.object;
- }
-
- private void setname(String name) {
- this.name = name;
- }
-
- private boolean isname() {
- if (this.name == null)
- return false;
-
- else
- return true;
- }
-
- private void setvhost(String vhost) {
- this.vhost = vhost;
- }
-
- public String getvhost() {
- return this.vhost;
- }
-
- public String getname() {
- return this.name;
- }
-
- private void setnumber(String number) {
- Integer i = new Integer(number);
- this.number = i.intValue();
- }
-
- public int getnumber() {
- return this.number;
- }
-
- private static String removeSpaces(String s) {
- StringTokenizer st = new StringTokenizer(s, " ", false);
- String t = "";
- while (st.hasMoreElements()) t += st.nextElement();
- return t;
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandhelp.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandhelp.java
deleted file mode 100644
index 962b606c12..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandhelp.java
+++ /dev/null
@@ -1,73 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-package org.apache.qpid.commands;
-
-import org.apache.qpid.utils.JMXinfo;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jul 6, 2008
- * Time: 5:55:28 PM
- * To change this template use File | Settings | File Templates.
- */
-public class Commandhelp extends Command {
- public Commandhelp(JMXinfo info, String name) {
- super(info, name);
- }
-
- public void execute() {
- displayhelp();
- }
-
- private void displayhelp() {
- echo("");
- echo("Current version of qpid CLI is supporting following commands");
- echo("");
- echo("[list] This command is listing limited information about a given type of object");
- echo(" For more information about list command run `list --help`");
- echo("[info] This command is listing All the information about a given type of object");
- echo(" For more information about list command run `info --help`");
-
- echo("");
- echo("[exit] This command is disconnect the connection with the Qpid Java broker and go back to normal propmt");
- echo("[quit] This command is disconnect the connection with the Qpid Java broker and go back to normal propmt");
- echo("");
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandinfo.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandinfo.java
deleted file mode 100644
index 51cbb2b929..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandinfo.java
+++ /dev/null
@@ -1,259 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-package org.apache.qpid.commands;
-
-
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.commands.objects.*;
-
-import javax.management.MBeanServerConnection;
-import java.util.Set;
-
-
-public class Commandinfo extends Command {
- private String object = null;
- private String name = null;
- private String virtualhost = null;
- private String outputformat = null;
- private String seperator = ",";
-
- public Commandinfo(JMXinfo info, String name) {
-
- super(info, name);
-
- }
-
- private void listobjects(String option_value) {
- /*pring usage if use is not give the correct option letter or no options */
- if (option_value == null) {
-// System.out.println("testing");
- printusage();
- return;
- }
- MBeanServerConnection mbsc = info.getmbserverconnector();
- Set set = null;
- ObjectNames objname = null;
-
- try {
- if (option_value.compareToIgnoreCase("queue") == 0 || option_value.compareToIgnoreCase("queues") == 0) {
- objname = new QueueObject(mbsc);
-
- } else
- if (option_value.compareToIgnoreCase("Virtualhosts") == 0 || option_value.compareToIgnoreCase("Virtualhost") == 0) {
- objname = new VirtualHostObject(mbsc);
-// this.name = option_value;
- } else
- if (option_value.compareToIgnoreCase("Exchange") == 0 || option_value.compareToIgnoreCase("Exchanges") == 0) {
- objname = new ExchangeObject(mbsc);
-// this.name = option_value;
- } else
- if (option_value.compareToIgnoreCase("Connection") == 0 || option_value.compareToIgnoreCase("Connections") == 0) {
- objname = new ConnectionObject(mbsc);
-// this.name = option_value;
- } else if (option_value.compareToIgnoreCase("all") == 0) {
- objname = new AllObjects(mbsc);
-// this.name = option_value;
- } else
- if (option_value.compareToIgnoreCase("Usermanagement") == 0 || option_value.compareToIgnoreCase("Usermanagmenets") == 0) {
- objname = new UserManagementObject(mbsc);
-// this.name = option_value;
- } else {
- printusage();
- echo("Wrong objectName");
- return;
- }
- objname.setQueryString(this.object, this.name, this.virtualhost);
- objname.returnObjects();
- if (objname.getSet().size() != 0) {
- objname.displayinfo(this.outputformat, this.seperator);
-
- } else {
- if (isname()) {
-
- echo("You might quering wrong " + this.object + " name with --name or -n option ");
- echo("");
- echo(this.object + "Type Objects might not in the broker currently");
- echo("");
- } else {
- printusage();
- }
- }
-
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
-
- }
-
- public void execute() {
- /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
- with main option object or o
- */
- if (checkoptionsetting("output")) {
- setoutputformat(optionchecker("output"));
- if (checkoptionsetting("separator"))
- setseperator(optionchecker("separator"));
- }
- if (checkoptionsetting("object") || checkoptionsetting("o")) {
- String object = optionchecker("object");
- if (object == null) {
- object = optionchecker("o");
- }
- setobject(object);
- if (checkoptionsetting("name") || checkoptionsetting("n")) {
- String name = optionchecker("name");
- if (name == null)
- name = optionchecker("n");
-
- setname(name);
- }
- if (checkoptionsetting("virtualhost") || checkoptionsetting("v")) {
- String vhost = optionchecker("virtualhost");
- if (vhost == null)
- vhost = optionchecker("v");
- setvirtualhost(vhost);
- }
- listobjects(this.object);
- } else if (checkoptionsetting("h") || checkoptionsetting("help"))
- printusage();
- else
- unrecognizeoption();
- }
-
- public void printusage() {
- echo("");
- echo("Usage:info [OPTION] ... [OBJECT TYPE]...\n");
- echo("Give ALL the information about the given object\n");
- echo("Where possible options include:\n");
- echo(" -o --object type of objects which you want to list\n");
- echo(" ex: < list -o queue > : lists all the queues created in the java broker\n");
- echo(" For now list command is supporting following object typse \n");
- echo(" Queue Connection VirtualHost UserMangement Exchange");
- echo(" Or You can specify object type by giving it at the beginning rather giving ");
- echo(" it as a argument");
- echo(" Ex:< queue info > this command is equal to <info -o queue> command \n");
- echo(" -v --virtualhost After specifying the object type you can filter output with this option");
- echo(" list objects with the given virtualhost which will help to find identical");
- echo(" queue objects with -n option");
- echo(" ex: queue info -v developement");
- echo(" -output Specify which output format you want to get the ouput");
- echo(" Although the option is there current version supports only for CSV output format");
- echo(" -separator This option use with output option to specify which separator you want to get the CSV output (default seperator is comma");
- echo(" -h --help Display the help and back to the qpid-cli prompt\n");
- echo(" -n --name After specifying what type of objects you want to monitor you can filter");
- echo(" the output using -n option by specifying the name of the object you want");
- echo(" to monitor exactly");
- echo(" ex: <queue info -n ping> : Give all the information about queue objects ");
- echo(" having queue name of ping\n");
- }
-
- private void setobject(String object) {
- this.object = object;
- }
-
- private void setname(String name) {
- this.name = name;
- }
-
- private boolean isname() {
- if (this.name == null)
- return false;
-
- else
- return true;
- }
-
- private void setvirtualhost(String vhost) {
- this.virtualhost = vhost;
- }
-
- public String getvirtualhost() {
- return this.virtualhost;
- }
-
- private void setoutputformat(String outputformat) {
- this.outputformat = outputformat;
- }
-
- private void setseperator(String seperator) {
- this.seperator = seperator;
- }
-
- private boolean isseperator() {
- if (this.seperator == null)
- return false;
-
- else
- return true;
- }
-
- private boolean isoutputformat() {
- if (this.outputformat == null)
- return false;
-
- else
- return true;
- }
-
- public String getname() {
- return this.name;
- }
-
- public String getobject() {
- return this.object;
- }
-
- /*
- public String optionchecker(String option_letter) {
- Map map = info.getCommandLineOptionParser().getAlloptions();
- if(map == null)
- return null;
- CommandLineOption option = (CommandLineOption) map.get(option_letter);
- if(option == null)
- return null;
- String value = option.getOptionValue();
- return value;
-
-
- }
- */
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandlist.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandlist.java
deleted file mode 100644
index 856dfcf0f2..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandlist.java
+++ /dev/null
@@ -1,296 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-package org.apache.qpid.commands;
-
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.utils.CommandLineOptionConstants;
-import org.apache.qpid.utils.CommandLineOption;
-import org.apache.qpid.commands.objects.*;
-
-import javax.management.ObjectName;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
-import javax.management.MBeanServerConnection;
-import java.util.Set;
-import java.util.Iterator;
-import java.util.Map;
-
-
-public class Commandlist extends Command {
-
- private String object;
- private String name;
- private String vhost;
- private String outputformat = null;
- private String seperator = ","; //this variable is assigning if -n option is used otherwise this is null
-
- public Commandlist(JMXinfo info, String name) {
- super(info, name);
-
- }
-
- private void listobjects(String option_value) {
- /*pring usage if use is not give the correct option letter or no options */
- if (option_value == null) {
-// System.out.println("testing");
- printusage();
- return;
- }
- MBeanServerConnection mbsc = info.getmbserverconnector();
- Set set = null;
- ObjectNames objname = null;
-
- try {
- if (option_value.compareToIgnoreCase("queue") == 0 || option_value.compareToIgnoreCase("queues") == 0) {
- objname = new QueueObject(mbsc);
-
- } else
- if (option_value.compareToIgnoreCase("Virtualhosts") == 0 || option_value.compareToIgnoreCase("Virtualhost") == 0) {
- objname = new VirtualHostObject(mbsc);
-// this.name = option_value;
- } else
- if (option_value.compareToIgnoreCase("Exchange") == 0 || option_value.compareToIgnoreCase("Exchanges") == 0) {
- objname = new ExchangeObject(mbsc);
-// this.name = option_value;
- } else
- if (option_value.compareToIgnoreCase("Connection") == 0 || option_value.compareToIgnoreCase("Connections") == 0) {
- objname = new ConnectionObject(mbsc);
-// this.name = option_value;
- } else if (option_value.compareToIgnoreCase("all") == 0) {
- objname = new AllObjects(mbsc);
-// this.name = option_value;
- } else
- if (option_value.compareToIgnoreCase("Usermanagement") == 0 || option_value.compareToIgnoreCase("Usermanagmenets") == 0) {
- objname = new UserManagementObject(mbsc);
-// this.name = option_value;
- } else {
- printusage();
- echo("Wrong objectName");
- return;
- }
- objname.setQueryString(this.object, this.name, this.vhost);
- objname.returnObjects();
- if (objname.getSet().size() != 0) {
- if (this.object.compareToIgnoreCase("queue") == 0 || this.object.compareToIgnoreCase("queues") == 0)
- objname.displayqueues(this.outputformat, this.seperator);
- else
- objname.displayobjects(this.outputformat, this.seperator);
- } else {
- if (isname()) {
-
- echo("You might quering wrong " + this.object + " name with --name or -n option ");
- echo("");
- echo(this.object + "Type Objects might not in the broker currently");
- echo("");
- } else {
- printusage();
- }
- }
-
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
-
- }
-
- public void listdomains() {
- MBeanServerConnection mbsc = info.getmbserverconnector();
- try {
- String[] domains = mbsc.getDomains();
- echo("DOMAINS");
- for (int i = 0; i < domains.length; i++)
- echo("\tDomain[" + i + "] = " + domains[i]);
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- public void execute() {
- /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
- with main option object or o
- */
- if (checkoptionsetting("output")) {
- setoutputformat(optionchecker("output"));
- if (checkoptionsetting("separator"))
- setseperator(optionchecker("separator"));
- }
- if (checkoptionsetting("object") || checkoptionsetting("o")) {
- String object = optionchecker("object");
- if (object == null) {
- object = optionchecker("o");
- }
- setobject(object);
- if (checkoptionsetting("name") || checkoptionsetting("n")) {
- String name = optionchecker("name");
- if (name == null)
- name = optionchecker("n");
-
- setname(name);
- }
- if (checkoptionsetting("virtualhost") || checkoptionsetting("v")) {
- String vhost = optionchecker("virtualhost");
- if (vhost == null)
- vhost = optionchecker("v");
- setvhost(vhost);
- }
- listobjects(this.object);
- } else if (checkoptionsetting("domain") || checkoptionsetting("d"))
- listdomains();
- else if (checkoptionsetting("h") || checkoptionsetting("help"))
- printusage();
- else
- unrecognizeoption();
- }
-
- public void printusage() {
- echo("");
- echo("Usage:list [OPTION] ... [OBJECT TYPE]...\n");
- echo("List the information about the given object\n");
- echo("Where possible options include:\n");
- echo(" -o --object type of objects which you want to list\n");
- echo(" ex: < list -o queue > : lists all the queues created in the java broker\n");
- echo(" For now list command is supporting following object typse \n");
- echo(" Queue Connection VirtualHost UserMangement Exchange");
- echo(" Or You can specify object type by giving it at the beginning");
- echo(" rather giving it as a argument");
- echo(" Ex:< queue list > this command is equal to list -o queue \n");
- echo(" -d --domain list all the domains of objects available for remote monitoring\n");
- echo(" -v --virtualhost After specifying the object type you can filter output with this option");
- echo(" list objects with the given virtualhost which will help to find ");
- echo(" identical queue objects with -n option");
- echo(" ex: queue list -v develop ment");
- echo(" -output Specify which output format you want to get the ouput");
- echo(" Although the option is there current version supports only for CSV output format");
- echo(" -separator This option use with output option to specify which separator you want to get the CSV output (default seperator is comma");
- echo(" -h --help Display the help and back to the qpid-cli prompt\n");
- echo(" -n --name After specifying what type of objects you want to monitor you can filter");
- echo(" the output using -n option by specifying the name of the object you want ");
- echo(" to monitor exactly");
- echo(" ex: <list -o queue -n ping> : list all the queue objects having queue name");
- echo(" of ping");
- echo(" ex: <queue list -n ping -v development> list all the queue objects with name ");
- echo(" of ping and virtualhost of developement \n");
-
-
- }
-
- private void setobject(String object) {
- this.object = object;
- }
-
- private void setname(String name) {
- this.name = name;
- }
-
- private boolean isname() {
- if (this.name == null)
- return false;
-
- else
- return true;
- }
-
- private void setvhost(String vhost) {
- this.vhost = vhost;
- }
-
- public String getvhost() {
- return this.vhost;
- }
-
- public String getname() {
- return this.name;
- }
-
- public String getobject() {
- return this.object;
- }
-
- private void setoutputformat(String outputformat) {
- this.outputformat = outputformat;
- }
-
- private void setseperator(String seperator) {
- this.seperator = seperator;
- }
-
- private boolean isseperator() {
- if (this.seperator == null)
- return false;
-
- else
- return true;
- }
-
- private boolean isoutputformat() {
- if (this.outputformat == null)
- return false;
-
- else
- return true;
- }
-
-
- /*
- public String optionchecker(String option_letter) {
- Map map = info.getCommandLineOptionParser().getAlloptions();
- if(map == null)
- return null;
- CommandLineOption option = (CommandLineOption) map.get(option_letter);
- if(option == null)
- return null;
- String value = option.getOptionValue();
- return value;
-
-
- }
- */
- public void optionvaluechecker() {
-
- }
-}
-
-
-
-
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandmove.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandmove.java
deleted file mode 100644
index a4deb19315..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandmove.java
+++ /dev/null
@@ -1,294 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-
-package org.apache.qpid.commands;
-
-
-import org.apache.qpid.commands.objects.QueueObject;
-import org.apache.qpid.commands.objects.ObjectNames;
-import org.apache.qpid.utils.JMXinfo;
-
-import javax.management.ObjectName;
-import javax.management.MBeanInfo;
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanAttributeInfo;
-import java.util.StringTokenizer;
-import java.util.Set;
-import java.util.Iterator;
-import java.util.List;
-import java.io.InputStreamReader;
-import java.io.BufferedReader;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 6, 2008
- * Time: 5:35:05 PM
- * To change this template use File | Settings | File Templates.
- */
-public class Commandmove extends Command {
- private String object;
- private String name1 = null, name2 = null, vhost1 = null, vhost2 = null, method1 = null, method2 = null; //target and starting queue specifications happen with these options
- private int number = 0;
- private QueueObject queue1, queue2;
- private MBeanServerConnection mbsc;
- private ObjectName queue;
- private int fmid = 0, tmid = 0;
-
- public Commandmove(JMXinfo info, String name) {
- super(info, name);
- this.mbsc = info.getmbserverconnector();
- this.queue1 = new QueueObject(mbsc);
-// this.queue2 = new QueueObject(mbsc);
- this.method1 = "moveMessages";
- this.method2 = "getMessagesOnTheQueue";
-
- }
-
- public void movemessages() {
- Set set = null;
- queue1.setQueryString(this.object, this.name1, this.vhost1);
-// queue2.setQueryString(this.object, this.name2, this.vhost2);
- set = queue1.returnObjects();
- List messageidlist = null;
- Long frommessageid = null, tomessageid, middle;
- int temp = 0;
- if (queue1.getSet().size() != 0) { // find the queue
- Iterator it = set.iterator();
- this.queue = (ObjectName) it.next();
- } else {
- if (isname1() || isname2()) { // if the specified queue is not there in the broker
-
- echo("The Queue you have specified is not in the current broker");
- echo("");
- } else {
- printusage();
- }
- }
-// if(this.tmid == 0 || this.fmid == 0)
-// {
-// this.number = queue1.getmessagecount(this.queue);
-// echo("");
-// System.out.print("Do you want to delete all the messages from the Queue[Y/N] :");
-// InputStreamReader isr = new InputStreamReader(System.in);
-// BufferedReader br = new BufferedReader(isr);
-// try{
-// String s = br.readLine();
-// echo(s);
-// if(s.compareToIgnoreCase("y") != 0)
-// return;
-// }catch(Exception ex)
-// {
-// ex.printStackTrace();
-// }
-//
-// }
-// if(this.number > queue1.getmessagecount(this.queue))
-// {
-// System.out.println("Given number is Greater than the Queue Depth");
-// return;
-// }//if user doesn't specify -t option all the messages will be moved
-// Object[] params = {new Integer(this.number)};
-// String[] signature = {new String("java.lang.Integer")};
-// try{
-// messageidlist = (List)this.mbsc.invoke(queue,this.method2,params,signature);
-// Iterator it1 = messageidlist.iterator();
-// temp++;
-// do
-// {
-// middle = (Long)it1.next();
-// if(temp == 1)
-// frommessageid = middle; // get the messageid of first message
-//
-// }while(it1.hasNext());
-// tomessageid = middle; // get the messageid of the last message
- try {
- Object[] params1 = {getfmid(), gettmid(), this.name2};
- String[] signature1 = {new String("long"), new String("long"), new String("java.lang.String")};
- this.mbsc.invoke(this.queue, this.method1, params1, signature1);
-
- } catch (Exception ex) {
- ex.printStackTrace();
- echo("Given messageId's might be wrong please run the view command and check messageId's you have given\n");
- echo("From MessageId should be greater than 0 and should less than To messageId");
- }
-
-
- }
-
- public void execute() {
- /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
- with main option object or o
- */
-
- if (checkoptionsetting("object") || checkoptionsetting("o")) {
- String object = optionchecker("object");
- if (object == null) {
- object = optionchecker("o");
- }
- if (object.compareToIgnoreCase("queue") == 0)
- setobject(object);
- else {
- unrecognizeoption();
- echo("This command is only applicable for queue command so please start with queue");
- }
- if (checkoptionsetting("n2") && checkoptionsetting("n1")) {
- setname1(optionchecker("n1"));
- setname2(optionchecker("n2"));
- } else {
- echo("You have to specify both n1 and n2 option value to move a message"); /* when user forget to specify target or starting queue name */
- return;
- }
-
- if (checkoptionsetting("v1")) {
-
- setvhost1(optionchecker("v1"));
- }
- if (checkoptionsetting("tmid") && checkoptionsetting("fmid")) {
- String tmid = optionchecker("tmid");
- String fmid = optionchecker("fmid");
-
-
- settomessageIdandfrommessageId(removeSpaces(tmid), removeSpaces(fmid));
- } else {
- echo("You have to set from MessageId and to MessageId in order to move messages between queues");
- echo("To view MessageId's use <view> command with -n and -v options");
- return;
- }
- this.movemessages();
-
- } else if (checkoptionsetting("h") || checkoptionsetting("help"))
- printusage();
- else
- unrecognizeoption();
- }
-
- public void printusage() {
- echo("");
- echo("Usage:move [OPTION] ... [OBJECT TYPE]...\n");
- echo("Move the top most messages from the given queue object to the given destination object\n");
- echo("To specify the desired queues you have to give the virtualhost name and the queue name with following commands\n");
- echo("Where possible options include:\n");
- echo(" -v1 Give the virtuallhost name from which queue you want to move messages");
- echo(" -n1 Give the queue name which you want to move messages from");
- echo(" -n2 Give the queue name of the destination queue");
- echo(" -tmid Give From MessageId you want to move from the Queue");
- echo(" -fmid Give To MessageId you want to move from the Queue");
- echo(" -h --help Display the help and back to the qpid-cli prompt\n");
-
- }
-
- private void setobject(String object) {
- this.object = object;
- }
-
- private void setname1(String name) {
- this.name1 = name;
- }
-
- private void setname2(String name) {
- this.name2 = name;
- }
-
- private boolean isname1() {
- if (this.name1 == null)
- return false;
-
- else
- return true;
- }
-
- private boolean isname2() {
- if (this.name2 == null)
- return false;
-
- else
- return true;
- }
-
- private void setvhost1(String vhost) {
- this.vhost1 = vhost;
- }
-// private void setvhost2(String vhost) {
-// this.vhost2 = vhost;
-// }
-
- private void setnumber(String number) {
- Integer i = new Integer(number);
- this.number = i.intValue();
- }
-
- private static String removeSpaces(String s) {
- StringTokenizer st = new StringTokenizer(s, " ", false);
- String t = "";
- while (st.hasMoreElements()) t += st.nextElement();
- return t;
- }
-
- private void settomessageIdandfrommessageId(String tmid, String fmid) {
- Integer i = new Integer(tmid);
- Integer j = new Integer(fmid);
- this.tmid = i.intValue();
- this.fmid = j.intValue();
- }
-
- public int gettmid() {
- return this.tmid;
- }
-
- public int getfmid() {
- return this.fmid;
- }
-
- public String getname1() {
- return this.name1;
- }
-
- public String getname2() {
- return this.name2;
- }
-
- public String getvhost() {
- return this.vhost1;
- }
-
- public String getobject() {
- return this.object;
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java
deleted file mode 100644
index a4c6394589..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandview.java
+++ /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.
- *
- */
- /*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-package org.apache.qpid.commands;
-
-import org.apache.qpid.commands.objects.ObjectNames;
-import org.apache.qpid.commands.objects.QueueObject;
-import org.apache.qpid.utils.JMXinfo;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
-import javax.management.openmbean.*;
-import java.util.*;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.awt.font.OpenType;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 8, 2008
- * Time: 11:33:05 PM
- * To change this template use File | Settings | File Templates.
- */
-public class Commandview extends Command {
- private String object;
- private String name;
- private String vhost;
- private int number = 0;
- private QueueObject objname;
- private MBeanServerConnection mbsc;
- private String method1, method2;
- private ObjectName queue;
-
- public Commandview(JMXinfo info, String name) {
- super(info, name);
- this.mbsc = info.getmbserverconnector();
- this.objname = new QueueObject(mbsc);
- this.method1 = "viewMessages";
- this.method2 = "viewMessaegContent";
-
- }
-
- public void viewmessages() {
- Set set = null;
- Object temp[] = {null};
- objname.setQueryString(this.object, this.name, this.vhost);
- set = objname.returnObjects();
- String header = "", temp_header = "", message_data = "", outline = "";
-
-
- if (objname.getSet().size() != 0) {
- Iterator it = set.iterator();
- this.queue = (ObjectName) it.next();
- try {
- if (objname.getmessagecount(this.queue) == 0) {
- echo("Selected Queue doesn't contain any messages");
- return;
- }
- if (this.number == 0)
- this.number = objname.getmessagecount(this.queue);
-
-
- if (objname.getmessagecount(this.queue) < this.number) {
- echo("Given number is Greater than the Queue Depth");
- return;
- } else {
- Object[] params = {1, this.number};
- String[] signature = {new String("int"), new String("int")};
- TabularDataSupport data = (TabularDataSupport) this.mbsc.invoke(queue, this.method1, params, signature);
-
- Set entrySet = data.entrySet();
- ArrayList<Map.Entry> list = new ArrayList<Map.Entry>(entrySet);
- if (list.size() != 0) {// no data}
- for (int i = 0; i < list.size(); i++) {
- CompositeData compositedata =
- (CompositeData) (list.get(i)).getValue();
- List<String> itemNames = new
- ArrayList<String>(compositedata.getCompositeType().keySet());
- if (i == 0) // display the table headers
- {
- for (int j = 0; j < itemNames.size(); j++) {
- temp_header = "";
- if (j != 1) //skipping header information
- {
- temp_header = itemNames.get(j);
- while (temp_header.length() < 15)
- temp_header = " " + temp_header;
-
- header = header + temp_header + "|";
- } else
- continue;
- }
- echo(header);
- while (outline.length() < header.length())
- outline = outline + "-";
- echo(outline);
- }
-
- for (int j = 0; j < itemNames.size(); j++) {
- temp_header = "";
- if (j != 1) {
- temp_header = String.valueOf(compositedata.get(itemNames.get(j)));
- while (temp_header.length() < 15)
- temp_header = " " + temp_header;
- message_data = message_data + temp_header + "|";
- } else // header information is not displaying unless user specify header information is needed
- continue;
-
-
- }
- echo(message_data);
- header = "";
- message_data = "";
- }
- } else {
- System.out.println("No Data to Display");
- }
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- } else {
- if (isname()) {
-
- echo("The Queue you have specified is not in the current broker");
- echo("");
- } else {
- printusage();
- }
- }
- }
-
- public void execute() {
- /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
- with main option object or o
- */
-
- if (checkoptionsetting("object") || checkoptionsetting("o")) {
- String object = optionchecker("object");
- if (object == null) {
- object = optionchecker("o");
- }
- if (object.compareToIgnoreCase("queue") == 0)
- setobject(object);
- else {
- unrecognizeoption();
- echo("This command is only applicable for delete command so please start with queue");
- }
- if (checkoptionsetting("name") || checkoptionsetting("n")) {
- String name = optionchecker("name");
- if (name == null)
- name = optionchecker("n");
-
- setname(name);
- }
- if (checkoptionsetting("virtualhost") || checkoptionsetting("v")) {
- String vhost = optionchecker("virtualhost");
- if (vhost == null)
- vhost = optionchecker("v");
- setvhost(vhost);
- }
- if (checkoptionsetting("top") || checkoptionsetting("t")) {
- String number = optionchecker("top");
- if (number == null)
- number = optionchecker("t");
-
- setnumber(removeSpaces(number));
- }
- this.viewmessages();
- } else if (checkoptionsetting("h") || checkoptionsetting("help"))
- printusage();
- else
- unrecognizeoption();
- }
-
- public void printusage() {
- echo("");
- echo("Usage:view [OPTION] ... [OBJECT TYPE]...\n");
- echo("view the information about given number of messages from the given queue object\n");
- echo("To specify the desired queue you have to give the virtualhost name and the queue name with following commands\n");
- echo("Where possible options include:\n");
- echo(" -v --virtualhost Give the virtuallhost name of the desired queue");
- echo(" -n --name Give the queue name of the desired queue you want to view messages");
- echo(" -t --top Give how many number of messages you want to delete from the top (Default = all the messages will be deleted");
- echo(" -h --help Display the help and back to the qpid-cli prompt\n");
-
- }
-
- private void setobject(String object) {
- this.object = object;
- }
-
- private void setname(String name) {
- this.name = name;
- }
-
- private boolean isname() {
- if (this.name == null)
- return false;
-
- else
- return true;
- }
-
- private void setvhost(String vhost) {
- this.vhost = vhost;
- }
-
- public String getvhost() {
- return this.vhost;
- }
-
- private void setnumber(String number) {
- Integer i = new Integer(number);
- this.number = i.intValue();
- }
-
- private static String removeSpaces(String s) {
- StringTokenizer st = new StringTokenizer(s, " ", false);
- String t = "";
- while (st.hasMoreElements()) t += st.nextElement();
- return t;
- }
-
- public String getname() {
- return this.name;
- }
-
- public String getobject() {
- return this.object;
- }
-
- public int getnumber() {
- return this.number;
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java
deleted file mode 100644
index f24fd08a99..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/Commandviewcontent.java
+++ /dev/null
@@ -1,284 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-package org.apache.qpid.commands;
-
-import org.apache.qpid.commands.objects.QueueObject;
-import org.apache.qpid.utils.JMXinfo;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.openmbean.TabularData;
-import javax.management.openmbean.CompositeData;
-import java.util.*;
-import java.nio.charset.Charset;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 10, 2008
- * Time: 12:19:16 PM
- * To change this template use File | Settings | File Templates.
- */
-public class Commandviewcontent extends Command {
- private String object;
- private String name;
- private String vhost;
- private int number = 0;
- private QueueObject objname;
- private MBeanServerConnection mbsc;
- private String method1;
- private ObjectName queue;
-
- public Commandviewcontent(JMXinfo info, String name) {
- super(info, name);
- this.mbsc = info.getmbserverconnector();
- this.objname = new QueueObject(mbsc);
- this.method1 = "viewMessageContent";
-
- }
-
- public void viewcontent() {
- Set set = null;
- Object temp[] = {null};
- objname.setQueryString(this.object, this.name, this.vhost);
- set = objname.returnObjects();
- String temp_header = "", header = "", message_data = "", encoding = null;
-
- if (objname.getSet().size() != 0) {
- Iterator it = set.iterator();
- this.queue = (ObjectName) it.next();
- try {
- if (objname.getmessagecount(this.queue) == 0) {
- echo("Selected Queue doesn't contain any messages");
- return;
- }
- if (this.number == 0) {
- echo("You haven't selected a MessageId Please use -id and give a message id");
- echo("Or run view command with same arguemnts to view messageId list for the queue");
- }
-
-// if(objname.getmessagecount(this.queue) < this.number)
-// {
-// echo("Given number is Greater than the Queue Depth");
-// return;
-// }
- else {
- Object[] params = {this.number};
- String[] signature = {new String("long")};
- CompositeData data = (CompositeData) this.mbsc.invoke(queue, this.method1, params, signature);
- List<String> itemNames = new
- ArrayList<String>(data.getCompositeType().keySet());
- for (int j = 0; j < itemNames.size(); j++) {
- temp_header = "";
- temp_header = itemNames.get(j);
- while (temp_header.length() < 15)
- temp_header = " " + temp_header;
-
- header = header + temp_header + "|";
- }
- echo(header);
- encoding = String.valueOf(data.get(itemNames.get(2))); // set the encoding at the beginning because encoding comes later in the loop
- if (encoding == null || encoding.length() == 0) {
- encoding = Charset.defaultCharset().name();
-
- }
- for (int j = 0; j < itemNames.size(); j++) {
- temp_header = "";
- if (j != 1) {
- temp_header = String.valueOf(data.get(itemNames.get(j)));
- while (temp_header.length() < 15)
- temp_header = " " + temp_header;
- } else {
- Byte[] arrayItems = (Byte[]) data.get(itemNames.get(j));
- byte[] byteArray = new byte[arrayItems.length];
- for (int i = 0; i < arrayItems.length; i++) {
- byteArray[i] = arrayItems[i];
- temp_header = new String(byteArray, encoding);
- while (temp_header.length() < 15)
- temp_header = " " + temp_header;
- }
- }
- message_data = message_data + temp_header + "|";
-
-
- }
- echo(message_data);
-// Object keys[] = data.keySet().toArray();
-// CompositeData comdata = data.get(keys);
-// for(int i=0;i < keys.length;i++)
-// {
-// System.out.println(keys[i].toString());
-// CompositeData cdata = data.get(temp);
-// System.out.println(cdata.toString());
-// temp[0] = null;
-// }
-// TabularType tabular = data.getTabularType();
-//// System.out.println(tabular.toString());
-// List info = tabular.getIndexNames();
-// Iterator it1 = info.iterator();
-//
-// do{
-// String temp1 = (String)it1.next();
-// System.out.println(temp1);
-// }while(it1.hasNext());
-
- }
- } catch (Exception ex) {
- echo("Given MessageId is invalid, There's no message with the given messageId");
- ex.printStackTrace();
- return;
- }
-
- } else {
- if (isname()) {
-
- echo("The Queue you have specified is not in the current broker");
- echo("");
- } else {
- printusage();
- }
- }
- }
-
- public void execute() {
- /* In here you it's easy to handle any number of otpions which are going to add with the list command which works
- with main option object or o
- */
-
- if (checkoptionsetting("object") || checkoptionsetting("o")) {
- String object = optionchecker("object");
- if (object == null) {
- object = optionchecker("o");
- }
- if (object.compareToIgnoreCase("queue") == 0)
- setobject(object);
- else {
- unrecognizeoption();
- echo("This command is only applicable for delete command so please start with queue");
- }
- if (checkoptionsetting("name") || checkoptionsetting("n")) {
- String name = optionchecker("name");
- if (name == null)
- name = optionchecker("n");
-
- setname(name);
- }
- if (checkoptionsetting("virtualhost") || checkoptionsetting("v")) {
- String vhost = optionchecker("virtualhost");
- if (vhost == null)
- vhost = optionchecker("v");
- setvhost(vhost);
- }
- if (checkoptionsetting("messageid") || checkoptionsetting("id")) {
- String number = optionchecker("id");
- if (number == null)
- number = optionchecker("id");
-
- setnumber(removeSpaces(number));
- }
- this.viewcontent();
- } else if (checkoptionsetting("h") || checkoptionsetting("help"))
- printusage();
- else
- unrecognizeoption();
- }
-
- public void printusage() {
- echo("");
- echo("Usage:viewcontent [OPTION] ... [OBJECT TYPE]...\n");
- echo("view the information about given number of messages from the given queue object\n");
- echo("To specify the desired queue you have to give the virtualhost name and the queue name with following commands\n");
- echo("Where possible options include:\n");
- echo(" -v --virtualhost Give the virtuallhost name of the desired queue");
- echo(" -n --name Give the queue name of the desired queue you want to view messages");
- echo(" -id Give the messageId of the required message you want to view the content");
- echo(" -h --help Display the help and back to the qpid-cli prompt\n");
-
- }
-
- private void setobject(String object) {
- this.object = object;
- }
-
- private void setname(String name) {
- this.name = name;
- }
-
- private boolean isname() {
- if (this.name == null)
- return false;
-
- else
- return true;
- }
-
- public void setvhost(String vhost) {
- this.vhost = vhost;
- }
-
- public String getvhost() {
- return this.vhost;
- }
-
- private void setnumber(String number) {
- Integer i = new Integer(number);
- this.number = i.intValue();
- }
-
- private static String removeSpaces(String s) {
- StringTokenizer st = new StringTokenizer(s, " ", false);
- String t = "";
- while (st.hasMoreElements()) t += st.nextElement();
- return t;
- }
-
- public String getname() {
- return this.name;
- }
-
- public String getobject() {
- return this.object;
- }
-
- public int getnumber() {
- return this.number;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/AllObjects.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/AllObjects.java
deleted file mode 100644
index 7f16109f0c..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/AllObjects.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-
-package org.apache.qpid.commands.objects;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 20, 2008
- * Time: 9:04:22 AM
- * To change this template use File | Settings | File Templates.
- */
-public class AllObjects extends ObjectNames {
-
- public AllObjects(MBeanServerConnection mbsc) {
- ObjectNames(mbsc);
-// querystring = "org.apache.qpid:*";
-// set = returnObjects();
- }
-
- public void setQueryString(String object, String name) {
- querystring = "org.apache.qpid:*";
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ConnectionObject.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ConnectionObject.java
deleted file mode 100644
index 6c427660c0..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ConnectionObject.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-
-package org.apache.qpid.commands.objects;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 26, 2008
- * Time: 9:58:02 PM
- * To change this template use File | Settings | File Templates.
- */
-public class ConnectionObject extends ObjectNames {
- public ConnectionObject(MBeanServerConnection mbsc) {
- /*calling parent classes constructor */
- ObjectNames(mbsc);
-// querystring = "org.apache.qpid:type=VirtualHost.Connection,*";
-// set = returnObjects();
-
- }
-
- public void setQueryString(String object, String name, String vhost) {
- if (name != null && vhost == null)
- querystring = "org.apache.qpid:type=Connection,name=" + name + ",*";
- else if (name != null && vhost != null)
- querystring = "org.apache.qpid:type=Connection,VirtualHost=" + vhost + ",name=" + name + ",*";
- else if (name == null && vhost != null)
- querystring = "org.apache.qpid:type=Connection,VirtualHost=" + vhost + ",*";
- else
- querystring = "org.apache.qpid:type=Connection,*";
-
- }
-}
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ExchangeObject.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ExchangeObject.java
deleted file mode 100644
index 22439e9d61..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ExchangeObject.java
+++ /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.
- *
- */
-
-package org.apache.qpid.commands.objects;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 24, 2008
- * Time: 12:15:19 AM
- * To change this template use File | Settings | File Templates.
- */
-public class ExchangeObject extends ObjectNames {
- public ExchangeObject(MBeanServerConnection mbsc) {
- ObjectNames(mbsc);
-// querystring = "org.apache.qpid:type=VirtualHost.Exchange,*";
-// set = returnObjects();
-
- }
-
- public void setQueryString(String object, String name, String vhost) {
- if (name != null && vhost == null)
- querystring = "org.apache.qpid:type=VirtualHost.Exchange,name=" + name + ",*";
- else if (name != null && vhost != null)
- querystring = "org.apache.qpid:type=VirtualHost.Exchange,VirtualHost=" + vhost + ",name=" + name + ",*";
- else if (name == null && vhost != null)
- querystring = "org.apache.qpid:type=VirtualHost.Exchange,VirtualHost=" + vhost + ",*";
- else
- querystring = "org.apache.qpid:type=VirtualHost.Exchange,*";
-
- }
-}
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ObjectNames.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ObjectNames.java
deleted file mode 100644
index 127c9f0a67..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/ObjectNames.java
+++ /dev/null
@@ -1,477 +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.
- *
- */
-
-package org.apache.qpid.commands.objects;
-
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.MBeanInfo;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 20, 2008
- * Time: 8:39:01 AM
- * To change this template use File | Settings | File Templates.
- */
-public class ObjectNames {
- public String querystring = null;
- public MBeanServerConnection mbsc;
- public Set set = null;
- public String attributes = "";
- public String attributevalues = "";// = null;
-
- /* method return the Set objects according to the Object type */
- public void ObjectNames(MBeanServerConnection mbsc) {
- this.mbsc = mbsc;
- }
-
- public Set returnObjects() {
- try {
- set = mbsc.queryNames(new ObjectName(querystring), null);
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- return set;
- }
-
- public void echo(String str) {
- System.out.println(str);
- }
- /* display appropriate objects according to the ojbect type */
-
- public void displayobjects(String output, String seperator) {
- Iterator it = set.iterator();
- String line = "";
- String temp2 = "";
- int iterator = 0;
- try {
- do {
- ObjectName temp_object = null;
- if (it.hasNext()) {
- temp_object = (ObjectName) it.next();
- if (temp_object == null)
- System.out.println("null test");
- }
- // echo(temp_object.getCanonicalKeyPropertyListString());
- MBeanInfo bean_info = mbsc.getMBeanInfo(temp_object);
- MBeanAttributeInfo[] attr_info = bean_info.getAttributes();
- if (attr_info == null) {
- echo(temp_object.toString());
- String temp = "";
- while (temp_object.toString().length() > temp.length())
- temp = "=" + temp;
- if (output == null)
- echo(temp);
-
- } else {
- for (MBeanAttributeInfo attr : attr_info) {
- Object toWrite = null;
-
- try {
- String temp1 = attr.getName();
- if (output == null) {
- while (temp1.length() < 15)
- temp1 = " " + temp1;
- attributes = attributes + temp1 + "|";
- } else if (output.compareToIgnoreCase("csv") == 0)
- attributes = attributes + temp1 + seperator;
- else {
- echo("Wrong output format current version is supporting only for CSV");
- return;
- }
- } catch (Exception x) {
- x.printStackTrace();
- }
- }
- if (attributes.equalsIgnoreCase("")) {
- echo(temp_object.toString());
- String temp = "";
- while (temp_object.toString().length() > temp.length())
- temp = "=" + temp;
- echo(temp);
- echo("There are no attributes for this object Type");
- return;
- }
- for (MBeanAttributeInfo attr : attr_info) {
- Object toWrite = null;
- temp2 = null;
- try {
- toWrite = mbsc.getAttribute(temp_object, attr.getName());
- } catch (Exception x) {
- temp2 = "-";
- }
- if (toWrite != null)
- temp2 = toWrite.toString();
- else
- temp2 = "-";
- if (output == null) {
-
- while (temp2.length() < 15)
- temp2 = " " + temp2;
-
- attributevalues = attributevalues + temp2 + "|";
- } else if (output.compareToIgnoreCase("csv") == 0)
- attributevalues = attributevalues + temp2 + seperator;
-
- //echo(temp1 + " " + temp2 + " " + temp3);
-
-
- }
- }
- iterator++;
- if (iterator == 1) {
- echo(attributes);
- for (int i = 0; i < attributes.length(); i++)
- line = line + "-";
- if (output == null)
- echo(line);
- }
- echo(attributevalues);
- line = "";
- attributes = "";
- attributevalues = "";
- } while (it.hasNext());
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- }
-
- public void reportgenerator(String output, String seperator, List<String> column) {
- Iterator it = set.iterator();
- String line = "";
- String temp2 = "";
- int iterator = 0;
- try {
- do {
- ObjectName temp_object = null;
- if (it.hasNext()) {
- temp_object = (ObjectName) it.next();
- if (temp_object == null)
- System.out.println("null test");
- }
- // echo(temp_object.getCanonicalKeyPropertyListString());
- MBeanInfo bean_info = mbsc.getMBeanInfo(temp_object);
- MBeanAttributeInfo[] attr_info = bean_info.getAttributes();
- if (attr_info == null) {
- echo(temp_object.toString());
- String temp = "";
- while (temp_object.toString().length() > temp.length())
- temp = "=" + temp;
- if (output == null)
- echo(temp);
-
- } else {
- for (MBeanAttributeInfo attr : attr_info) {
- Object toWrite = null;
-
- try {
- String temp1 = attr.getName();
- if (column.contains(temp1)) {
- if (output == null) {
- while (temp1.length() < 15)
- temp1 = " " + temp1;
- attributes = attributes + temp1 + "|";
- } else if (output.compareToIgnoreCase("csv") == 0)
- attributes = attributes + temp1 + seperator;
- else {
- echo("Wrong output format current version is supporting only for CSV");
- return;
- }
- }
- } catch (Exception x) {
- x.printStackTrace();
- }
- }
- if (attributes.equalsIgnoreCase("")) {
- echo(temp_object.toString());
- String temp = "";
- while (temp_object.toString().length() > temp.length())
- temp = "=" + temp;
- echo(temp);
- echo("There are no attributes for this object Type");
- return;
- }
- for (MBeanAttributeInfo attr : attr_info) {
- Object toWrite = null;
- temp2 = null;
- if (column.contains(attr.getName())) {
- try {
- toWrite = mbsc.getAttribute(temp_object, attr.getName());
- } catch (Exception x) {
- temp2 = "-";
- }
- if (toWrite != null)
- temp2 = toWrite.toString();
- else
- temp2 = "-";
- if (output == null) {
-
- while (temp2.length() < 15)
- temp2 = " " + temp2;
-
- attributevalues = attributevalues + temp2 + "|";
- } else if (output.compareToIgnoreCase("csv") == 0)
- attributevalues = attributevalues + temp2 + seperator;
-
- //echo(temp1 + " " + temp2 + " " + temp3);
-
- }
-
-
- }
- }
- iterator++;
- if (iterator == 1) {
- echo(attributes);
- for (int i = 0; i < attributes.length(); i++)
- line = line + "-";
- if (output == null)
- echo(line);
- }
- echo(attributevalues);
- line = "";
- attributes = "";
- attributevalues = "";
- } while (it.hasNext());
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- }
-
- public void displayqueues(String output, String seperator) {
- Iterator it = set.iterator();
- String line = "";
- int iterator = 0;
- int attr_count = 0;
- String temp1 = "";
- String temp2 = "";
- try {
- do {
- attr_count = 0;
- ObjectName temp_object = null;
- if (it.hasNext()) {
- temp_object = (ObjectName) it.next();
- }
- // echo(temp_object.getCanonicalKeyPropertyListString());
- MBeanInfo bean_info = mbsc.getMBeanInfo(temp_object);
- MBeanAttributeInfo[] attr_info = bean_info.getAttributes();
- if (attr_info == null) {
- echo(temp_object.toString());
- String temp = "";
- while (temp_object.toString().length() > temp.length())
- temp = "=" + temp;
- if (output == null)
- echo(temp);
-
- } else {
- for (MBeanAttributeInfo attr : attr_info) {
- Object toWrite = null;
- attr_count++;
- try {
- toWrite = mbsc.getAttribute(temp_object, attr.getName());
- if (output == null) {
- switch (attr_count) {
- case 1:
- case 3:
- temp1 = attr.getName();
- while (temp1.length() < 10)
- temp1 = " " + temp1;
- attributes = attributes + temp1 + "|";
- temp2 = toWrite.toString();
- while (temp2.length() < 10)
- temp2 = " " + temp2;
- attributevalues = attributevalues + temp2 + "|";
- break;
- case 6:
- temp1 = attr.getName();
- while (temp1.length() < 20)
- temp1 = " " + temp1;
- attributes = attributes + temp1 + "|";
- temp2 = toWrite.toString();
- while (temp2.length() < 20)
- temp2 = " " + temp2;
- attributevalues = attributevalues + temp2 + "|";
- break;
- case 7:
- temp1 = attr.getName();
- while (temp1.length() < 13)
- temp1 = " " + temp1;
- attributes = attributes + temp1 + "|";
- temp2 = toWrite.toString();
- while (temp2.length() < 13)
- temp2 = " " + temp2;
- attributevalues = attributevalues + temp2 + "|";
- break;
- case 9:
- temp1 = attr.getName();
- while (temp1.length() < 20)
- temp1 = " " + temp1;
- attributes = attributes + temp1 + "|";
- temp2 = toWrite.toString();
- while (temp2.length() < 20)
- temp2 = " " + temp2;
- attributevalues = attributevalues + temp2 + "|";
- break;
- }
- } else if (output.compareToIgnoreCase("csv") == 0) {
- switch (attr_count) {
- case 1:
- case 3:
- case 6:
- temp1 = attr.getName();
- attributes = attributes + temp1 + seperator;
- temp2 = toWrite.toString();
- attributevalues = attributevalues + temp2 + seperator;
- break;
- case 7:
- temp1 = attr.getName();
- attributes = attributes + temp1 + seperator;
- temp2 = toWrite.toString();
- attributevalues = attributevalues + temp2 + seperator;
- break;
- case 9:
- temp1 = attr.getName();
- attributes = attributes + temp1 + seperator;
- temp2 = toWrite.toString();
- attributevalues = attributevalues + temp2 + seperator;
- break;
- }
- } else {
- echo("Wrong output format specified currently CLI supports only csv output format");
- return;
- }
-
-
- } catch (Exception x) {
- x.printStackTrace();
- }
-
- }
- }
- iterator++;
- if (iterator == 1) {
- for (int i = 0; i < attributes.length(); i++)
- line = line + "-";
- if (output == null)
- echo(line);
- echo(attributes);
- if (output == null)
- echo(line);
- }
- echo(attributevalues);
- line = "";
- attributes = "";
- attributevalues = "";
- } while (it.hasNext());
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- public void displayinfo(String output, String seperator) {
- Iterator it = set.iterator();
- String temp1, temp2 = "";
- try {
- do {
-
- ObjectName temp_object = null;
- if (it.hasNext()) {
- temp_object = (ObjectName) it.next();
- }
- // echo(temp_object.getCanonicalKeyPropertyListString());
- MBeanInfo bean_info = mbsc.getMBeanInfo(temp_object);
- MBeanAttributeInfo[] attr_info = bean_info.getAttributes();
- if (attr_info == null) {
- echo(temp_object.toString());
- String temp = "";
- while (temp_object.toString().length() > temp.length())
- temp = "=" + temp;
- echo(temp);
-
- } else {
- echo(temp_object.toString());
- String temp = "";
- while (temp_object.toString().length() > temp.length())
- temp = "=" + temp;
- echo(temp);
-
- for (MBeanAttributeInfo attr : attr_info) {
- Object toWrite = null;
-
- try {
- toWrite = mbsc.getAttribute(temp_object, attr.getName());
- } catch (Exception x) {
- temp2 = "-";
- }
- temp1 = attr.getName();
- if (toWrite != null)
- temp2 = toWrite.toString();
-
- if (output == null) {
- while (temp1.length() < 35)
- temp1 = " " + temp1;
-
- while (temp2.length() < 35)
- temp2 = " " + temp2;
- echo(temp1 + " " + temp2);
- } else if (output.compareToIgnoreCase("csv") == 0)
- echo(temp1 + seperator + temp2);
- else {
- echo("Wrong output format specified currently CLI supports only csv output format");
- return;
- }
- }
- echo("");
- echo("");
-
- }
- } while (it.hasNext());
- } catch (Exception ex) {
- ex.printStackTrace();
- }
-
- }
-
- public void setQueryString(String object, String name, String vhost) {
-
- }
-
- public void setQueryStringforinfo(String object, String name, String virtualhost) {
-
- }
-
- public String getQueryString() {
- return querystring;
- }
-
- public Set getSet() {
- return set;
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/QueueObject.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/QueueObject.java
deleted file mode 100644
index 7bbcbf5840..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/QueueObject.java
+++ /dev/null
@@ -1,86 +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.
- *
- */
-
-package org.apache.qpid.commands.objects;
-
-import javax.management.MBeanServerConnection;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
-import javax.management.ObjectName;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 20, 2008
- * Time: 8:49:56 AM
- * To change this template use File | Settings | File Templates.
- */
-public class QueueObject extends ObjectNames {
- public QueueObject(MBeanServerConnection mbsc) {
- ObjectNames(mbsc);
- }
-
- public void setQueryString(String object, String name, String vhost) {
- if (name != null && vhost == null)
- querystring = "org.apache.qpid:type=VirtualHost.Queue,name=" + name + ",*";
- else if (name != null && vhost != null)
- querystring = "org.apache.qpid:type=VirtualHost.Queue,VirtualHost=" + vhost + ",name=" + name + ",*";
- else if (name == null && vhost != null)
- querystring = "org.apache.qpid:type=VirtualHost.Queue,VirtualHost=" + vhost + ",*";
- else
- querystring = "org.apache.qpid:type=VirtualHost.Queue,*";
- }
-
- public int getmessagecount(ObjectName queue) {
- int attr_count = 0;
- String value;
- Integer depth = null;
-
- try {
- MBeanInfo bean_info;
- bean_info = mbsc.getMBeanInfo(queue);
- MBeanAttributeInfo[] attr_info = bean_info.getAttributes();
- if (attr_info == null)
- return 0;
- else {
- for (MBeanAttributeInfo attr : attr_info) {
- Object toWrite = null;
- attr_count++;
- toWrite = mbsc.getAttribute(queue, attr.getName());
- if (attr_count == 7) {
- value = toWrite.toString();
- depth = new Integer(value);
- }
- }
-
- }
-
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- if (depth != null)
- return depth.intValue();
- else
- return -1;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/UserManagementObject.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/UserManagementObject.java
deleted file mode 100644
index a5f84ea39e..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/UserManagementObject.java
+++ /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.
- *
- */
-
-package org.apache.qpid.commands.objects;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 24, 2008
- * Time: 12:11:52 AM
- * To change this template use File | Settings | File Templates.
- */
-public class UserManagementObject extends ObjectNames {
- public UserManagementObject(MBeanServerConnection mbsc) {
- ObjectNames(mbsc);
-// querystring = "org.apache.qpid:type=UserManagement,*";
-// set = returnObjects();
-
- }
-
- public void setQueryString(String object, String name, String vhost) {
- querystring = "org.apache.qpid:type=UserManagement,*";
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/VirtualHostObject.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/VirtualHostObject.java
deleted file mode 100644
index 16bb159990..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/VirtualHostObject.java
+++ /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.
- *
- */
-
-package org.apache.qpid.commands.objects;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 20, 2008
- * Time: 9:02:04 AM
- * To change this template use File | Settings | File Templates.
- */
-public class VirtualHostObject extends ObjectNames {
-
- public VirtualHostObject(MBeanServerConnection mbsc) {
- ObjectNames(mbsc);
-// querystring = "org.apache.qpid:type=VirtualHost.VirtualHostManager,*";
-// set = returnObjects();
- }
-
- public void setQueryString(String object, String name, String vhost) {
- if (name != null && vhost == null)
- querystring = "org.apache.qpid:type=VirtualHost.VirtualHostManager,name=" + name + ",*";
- else if (name != null && vhost != null)
- querystring = "org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost=" + vhost + ",name=" + name + ",*";
- else if (name == null && vhost != null)
- querystring = "org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost=" + vhost + ",*";
- else
- querystring = "org.apache.qpid:type=VirtualHost.VirtualHostManager,*";
-
-
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOption.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOption.java
deleted file mode 100644
index fb6afa6344..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOption.java
+++ /dev/null
@@ -1,112 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-
-package org.apache.qpid.utils;
-
-import java.util.ArrayList;
-
-public class CommandLineOption implements CommandLineOptionConstants {
- private String type;
- private ArrayList optionValues;
-
- public CommandLineOption(String type, String[] values) {
- setOptionType(type);
- ArrayList arrayList = new ArrayList(values.length);
- for (int i = 0; i < values.length; i++) {
- arrayList.add(values[i]);
- }
- this.optionValues = arrayList;
- }
-
- private void setOptionType(String type) {
- //cater for the long options first
- if (type.startsWith("--")) {
- type = type.replaceFirst("--", "");
- }
- if (type.startsWith("-")) {
- type = type.replaceFirst("-", "");
- }
-
- //we do not change the case of the option!
-
- this.type = type;
- }
-
- /**
- * @param type
- */
- public CommandLineOption(String type, ArrayList values) {
- setOptionType(type);
-
- if (null != values) {
- this.optionValues = values;
- }
- }
-
-
- /**
- * @return Returns the type.
- * @see CommandLineOptionConstants
- */
- public String getOptionType() {
- return type;
- }
-
-
- /**
- * @return Returns the optionValues.
- */
- public String getOptionValue() {
- if ((optionValues != null) && (optionValues.size() > 0)) {
- return (String) optionValues.get(0);
- } else {
- return null;
- }
- }
-
-
- /**
- * @return Returns the optionValues.
- */
- public ArrayList getOptionValues() {
- return optionValues;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionConstants.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionConstants.java
deleted file mode 100644
index fe84e2ebd2..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionConstants.java
+++ /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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-
-package org.apache.qpid.utils;
-
-
-public interface CommandLineOptionConstants {
- static interface JMXCommandLineOptionConstants {
- String HOST_OPTION = "h";
- String PORT_OPTION = "p";
- String INTERVAL_OPTION = "i";
- String REPORT_OPTION = "r";
-
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionParser.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionParser.java
deleted file mode 100644
index 33a117cad5..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/CommandLineOptionParser.java
+++ /dev/null
@@ -1,218 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-package org.apache.qpid.utils;
-
-import java.util.Map;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.StringTokenizer;
-
-
-public class CommandLineOptionParser {
- private static int STARTED = 0;
- private static int NEW_OPTION = 1;
- private static int SUB_PARAM_OF_OPTION = 2;
-
- private Map commandlineoption;
- private String commandname;
-
- public CommandLineOptionParser(Map commandlineoptions) {
- this.commandlineoption = commandlineoptions;
- }
-
- public CommandLineOptionParser(String[] args) {
- /* check whether user just type the enter key */
- this.commandlineoption = this.parse(args);
-
- }
-
- public CommandLineOptionParser(String[] args, String first) {
- this.commandname = first;
- this.commandlineoption = this.parsefirst(args);
- }
-
- public Map parse(String[] args) {
- Map commandLineOptions = new HashMap();
-
- if (0 == args.length) {
- return commandLineOptions;
- } else if (1 == args.length) {
- commandname = args[0];
- return commandLineOptions;
- }
- /* when user is not giving the command line option with a "=" */
-// if (!args[2].startsWith("-"))
-// return commandLineOptions;
-
- //State 0 means started
- //State 1 means earlier one was a new -option
- //State 2 means earlier one was a sub param of a -option
-
- int state = STARTED;
- ArrayList optionBundle = null;
- String optionType = null;
- CommandLineOption commandLineOption;
- String newcommand = "";
- String[] newargs;
- int j;
- if (args[1].compareTo("list") == 0 || args[1].compareTo("info") == 0 || args[1].compareTo("delete") == 0 ||
- args[1].compareTo("move") == 0 || args[1].compareTo("view") == 0 || args[1].compareTo("viewcontent") == 0) {
- String object = args[0];
- for (j = 0; j < (args.length - 1); j++) {
- newcommand = newcommand + args[j + 1] + " ";
- }
- newcommand = newcommand + "-o " + object;
- newargs = newcommand.split(" ");
- args = newargs;
- } else
- if (!args[1].startsWith("-")) //if user give command like list queue or something without minus argument
- return commandLineOptions; //for the second wordxi
-
- commandname = args[0];
- for (int i = 0; i < args.length; i++) {
- if (args[i].startsWith("-")) {
- if (STARTED == state) {
- // fresh one
- state = NEW_OPTION;
- optionType = args[i];
- } else if (SUB_PARAM_OF_OPTION == state || NEW_OPTION == state) {
- // new one but old one should be saved
- commandLineOption =
- new CommandLineOption(optionType, optionBundle);
- commandLineOptions.put(commandLineOption.getOptionType(),
- commandLineOption);
- state = NEW_OPTION;
- optionType = args[i];
- optionBundle = null;
-
- }
- } else {
- if (NEW_OPTION == state) {
- optionBundle = new ArrayList();
- optionBundle.add(args[i]);
- state = SUB_PARAM_OF_OPTION;
-
- } else if (SUB_PARAM_OF_OPTION == state) {
- optionBundle.add(args[i]);
- }
-
-
- }
- }
- commandLineOption = new CommandLineOption(optionType, optionBundle);
- commandLineOptions.put(commandLineOption.getOptionType(), commandLineOption);
- return commandLineOptions;
-
- }
-
- public Map parsefirst(String[] args) {
- Map commandLineOptions = new HashMap();
- if (0 == args.length) {
- return commandLineOptions;
- } else if (1 == args.length) {
- return commandLineOptions;
- }
- /* when user is not giving the command line option with a "=" */
-// if (!args[2].startsWith("-"))
-// return commandLineOptions;
-
- //State 0 means started
- //State 1 means earlier one was a new -option
- //State 2 means earlier one was a sub param of a -option
-
- int state = STARTED;
- ArrayList optionBundle = null;
- String optionType = null;
- CommandLineOption commandLineOption;
- String newcommand = "";
- String[] newargs;
- int j;
-
- for (int i = 0; i < args.length; i++) {
- if (args[i].startsWith("-")) {
- if (STARTED == state) {
- // fresh one
- state = NEW_OPTION;
- optionType = args[i];
- } else if (SUB_PARAM_OF_OPTION == state || NEW_OPTION == state) {
- // new one but old one should be saved
- commandLineOption =
- new CommandLineOption(optionType, optionBundle);
- commandLineOptions.put(commandLineOption.getOptionType(),
- commandLineOption);
- state = NEW_OPTION;
- optionType = args[i];
- optionBundle = null;
-
- }
- } else {
- if (NEW_OPTION == state) {
- optionBundle = new ArrayList();
- optionBundle.add(args[i]);
- state = SUB_PARAM_OF_OPTION;
-
- } else if (SUB_PARAM_OF_OPTION == state) {
- optionBundle.add(args[i]);
- }
-
-
- }
- }
- commandLineOption = new CommandLineOption(optionType, optionBundle);
- commandLineOptions.put(commandLineOption.getOptionType(), commandLineOption);
- return commandLineOptions;
-
- }
-
- public Map getAlloptions() {
- return this.commandlineoption;
- }
-
- public String getcommandname() {
- return this.commandname;
- }
-
- private static String removeSpaces(String s) {
- StringTokenizer st = new StringTokenizer(s, " ", false);
- String t = "";
- while (st.hasMoreElements()) t += st.nextElement();
- return t;
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfigProperty.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfigProperty.java
deleted file mode 100644
index 27e4527619..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfigProperty.java
+++ /dev/null
@@ -1,47 +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.
-*
-*/
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-package org.apache.qpid.utils;
-
-
-public class JMXConfigProperty {
-
- private static final String DEFAULT_HOST_NAME = "localhost";
- private static final String DEFAULT_PORT = "8999";
- private static final String DEFAULT_INTERVAL = "4000";
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfiguration.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfiguration.java
deleted file mode 100644
index 622f9d78bd..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXConfiguration.java
+++ /dev/null
@@ -1,148 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-package org.apache.qpid.utils;
-
-import org.apache.qpid.Command;
-
-import java.util.Map;
-
-public class JMXConfiguration {
- private String hostname = "localhost";
- private String port = "8999";
- private String interval = "40000";
- private String outputpath = ".";
- private String report_file = "report.output";
- private boolean isreport_mode = false;
-
- public JMXConfiguration(Map map) {
- if (checkoptionsetting(CommandLineOptionConstants.JMXCommandLineOptionConstants.HOST_OPTION, map)) {
- this.hostname = optionchecker(CommandLineOptionConstants.JMXCommandLineOptionConstants.HOST_OPTION, map);
- }
- if (checkoptionsetting(CommandLineOptionConstants.JMXCommandLineOptionConstants.PORT_OPTION, map)) {
- this.port = optionchecker(CommandLineOptionConstants.JMXCommandLineOptionConstants.PORT_OPTION, map);
- }
- if (checkoptionsetting(CommandLineOptionConstants.JMXCommandLineOptionConstants.REPORT_OPTION, map)) {
-
- this.report_file = optionchecker(CommandLineOptionConstants.JMXCommandLineOptionConstants.REPORT_OPTION, map);
- }
-
- }
-
- public void sethostname(String hostname) {
- this.hostname = hostname;
- }
-
- public void setport(String port) {
- this.port = port;
- }
-
- public void setinterval(String interval) {
- this.interval = interval;
- }
-
- public void setoutputpath(String output) {
- this.outputpath = output;
- }
-
- public String gethostname() {
- return this.hostname;
- }
-
- public String getport() {
- return this.port;
- }
-
- public String getinterval() {
- return this.interval;
- }
-
- public String getoutputpath() {
- return this.outputpath;
- }
-
- public CommandLineOption loadoption(String option, Map options) {
- CommandLineOption op = null;
- if (option != null) {
- op = (CommandLineOption) options.get(option);
-
- }
- return op;
-
- }
-
- public void setreportfile(String reportfile) {
- this.report_file = reportfile;
- this.isreport_mode = true;
-
- }
-
- public boolean isreportmode() {
- return this.isreport_mode;
- }
-
- public String getreportfile() {
- return this.report_file;
- }
-
- public String optionchecker(String option_letter, Map map) {
-
- if (map == null)
- return null;
- CommandLineOption option = (CommandLineOption) map.get(option_letter);
- if (option == null)
- return null;
- String value = option.getOptionValue();
- return value;
- }
-
- public boolean checkoptionsetting(String option_letter, Map map) {
- if (map == null)
- return false;
- CommandLineOption option = (CommandLineOption) map.get(option_letter);
- if (option == null)
- return false;
- String value = option.getOptionType();
-
- if (value != null)
- return true;
- else
- return false;
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXinfo.java b/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXinfo.java
deleted file mode 100644
index af3e5c7be0..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/utils/JMXinfo.java
+++ /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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.utils;
-
-import javax.management.remote.JMXConnector;
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 3, 2008
- * Time: 9:21:08 PM
- * To change this template use File | Settings | File Templates.
- */
-public class JMXinfo {
- private JMXConnector jmxconnector;
- private CommandLineOptionParser input;
- private MBeanServerConnection mbserverconnector;
-
- public JMXinfo(JMXConnector jmxc, CommandLineOptionParser input, MBeanServerConnection mbsc) {
- this.jmxconnector = jmxc;
- this.input = input;
- this.mbserverconnector = mbsc;
- }
-
- public JMXConnector getjmxconnectot() {
- return jmxconnector;
- }
-
- public CommandLineOptionParser getCommandLineOptionParser() {
- return input;
- }
-
- public MBeanServerConnection getmbserverconnector() {
- return mbserverconnector;
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/AllTest.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/AllTest.java
deleted file mode 100644
index bdae5340b5..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/AllTest.java
+++ /dev/null
@@ -1,80 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.apache.qpid.commands.*;
-import org.apache.qpid.commands.objects.*;
-import org.apache.qpid.utils.TestCommandLineOption;
-import org.apache.qpid.utils.TestCommandLineOptionParser;
-import org.apache.qpid.utils.TestJMXConfiguration;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jul 7, 2008
- * Time: 1:09:50 PM
- * To change this template use File | Settings | File Templates.
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
- TestCommand.class,
- TestCommandExecusionEngine.class,
- TestCommandLineOption.class,
- TestCommandLineOptionParser.class,
- TestConnector.class,
- TestJMXConfiguration.class,
- TestAllObject.class,
- TestConnectionObject.class,
- TestExchangeObject.class,
- TestQueueObject.class,
- TestVirtualHostObject.class,
- TestUserManagementObject.class,
- TestCommanddelete.class,
- TestCommandlist.class,
- TestCommandinfo.class,
- TestCommandmove.class,
- TestCommandview.class,
- TestCommandviewcontent.class,
- TestCommandLineInterpreter.class
-
-
- })
-public class AllTest {
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java
deleted file mode 100644
index 58953e1693..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/ConnectionConstants.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-
-package org.apache.qpid;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 16, 2008
- * Time: 4:55:21 PM
- * To change this template use File | Settings | File Templates.
- */
-public interface ConnectionConstants {
- String BROKER_HOSTNAME="localhost";
- String BROKER_PORT="8999";
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecusionEngine.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecusionEngine.java
deleted file mode 100644
index bb5fa914d0..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandExecusionEngine.java
+++ /dev/null
@@ -1,90 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid;
-
-import junit.framework.TestCase;
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.After;
-
-import java.io.IOException;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:06:25 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestCommandExecusionEngine {
- String line;
- String [] command;
- CommandLineOptionParser commandlineoptionparser;
- JMXinfo info;
- CommandExecusionEngine engine;
- Connector connector;
- @Before
- public void setup(){
-
- connector = ConnectorFactory.getConnector("localhost","8999");
-
-
- }
- @Test
- public void TestCommandSelector()
- {
- line = "list -o queue";
- command = line.split(" ");
- commandlineoptionparser = new CommandLineOptionParser(command);
- info = new JMXinfo(connector.getConnector(), commandlineoptionparser,connector.getMBeanServerConnection());
- engine = new CommandExecusionEngine(info);
- Assert.assertEquals(engine.CommandSelector(),true);
- }
- @After
- public void cleanup()
- {
- try {
- connector.getConnector().close();
- } catch (IOException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java
deleted file mode 100644
index 36a2d29dfd..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestCommandLineInterpreter.java
+++ /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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid;
-
-import junit.framework.TestCase;
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.commands.Commandinfo;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.After;
-
-import javax.management.remote.JMXConnector;
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:08:52 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestCommandLineInterpreter {
-
-// CommandLineInterpreter test = new CommandLineInterpreter();
- /* In this class there are only methodes which are displaying data on console so no test can be written*/
- String command = "-h " + ConnectionConstants.BROKER_HOSTNAME + " -p " + ConnectionConstants.BROKER_PORT + " info -o queue -n ping -v test";
- Connector conn= null;
- JMXConnector jmxc=null;
- MBeanServerConnection mbsc=null;
- CommandLineOptionParser parser=null;
-
-
- String [] args = null;
- @Before
- public void startup()
- {
- args = command.split(" ");
-// System.out.println(args[0]);
- conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
- jmxc = conn.getConnector();
- mbsc = conn.getMBeanServerConnection();
- parser = new CommandLineOptionParser(args,args[0]);
-
- }
- @Test
- public void TestSetQueryString()
- {
- CommandLineInterpreter.oneshotmode(args,parser,jmxc,mbsc);
- Assert.assertEquals(args[0],"info");
- Assert.assertEquals(args[1],"-o");
- Assert.assertEquals(args[2],"queue");
- Assert.assertEquals(args[3],"-n");
- Assert.assertEquals(args[4],"ping");
- Assert.assertEquals(args[5],"-v");
- Assert.assertEquals(args[6],"test");
- }
-
- @After
- public void cleanup()
- {
-
- }
-}
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java
deleted file mode 100644
index e6b80aae66..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestConnector.java
+++ /dev/null
@@ -1,106 +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.
-*
-*/
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid;
-
-import junit.framework.TestCase;
-
-import javax.management.remote.JMXServiceURL;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXConnector;
-import javax.management.MBeanServerConnection;
-import java.net.MalformedURLException;
-import java.io.IOException;
-
-import org.junit.Test;
-import org.junit.Before;
-import org.junit.After;
-import org.junit.Assert;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:11:50 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestConnector {
- Connector test;
- JMXServiceURL svc_url;
- JMXConnector connector;
- MBeanServerConnection mbsc;
-
- @Before
- public void setup()
- {
- test = ConnectorFactory.getConnector("localhost","8999");
- String url = "service:jmx:rmi:///jndi/rmi://localhost:8999/jmxrmi";
-
- }
- @Test
- public void testGetURL()
- {
-
-
-// Assert.assertNotNull(test);
- Assert.assertEquals(test.getURL(),test.getURL());
- }
- @Test
- public void testGetConnector()
- {
- Assert.assertEquals(test.getConnector(),test.getConnector());
- }
- @Test
- public void testGetMBeanServerConnection()
- {
- Assert.assertEquals(test.getMBeanServerConnection(),test.getMBeanServerConnection());
- }
- @After
- public void cleanup()
- {
- try {
-
- test.getConnector().close();
- test = null;
- } catch (IOException e) {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- test = null;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestReportGenerator.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestReportGenerator.java
deleted file mode 100644
index a2ed94d948..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/TestReportGenerator.java
+++ /dev/null
@@ -1,50 +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.
-*
-*/
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 13, 2008
- * Time: 7:16:17 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestReportGenerator {
-
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java
deleted file mode 100644
index 2c92b8d66d..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommand.java
+++ /dev/null
@@ -1,99 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import junit.framework.JUnit4TestAdapter;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.After;
-import org.junit.Assert;
-import org.apache.qpid.Connector;
-import org.apache.qpid.ConnectorFactory;
-import org.apache.qpid.ConnectionConstants;
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.utils.CommandLineOptionParser;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:21:32 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestCommand{
- String command = "list -o queue";
- String [] list;
- Connector test;
- MBeanServerConnection mbsc;
- JMXinfo info;
- CommandLineOptionParser parser;
- Command cmd;
- @Before
- public void setup()
- {
- list = command.split(" ");
- parser = new CommandLineOptionParser(list);
- test = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME,ConnectionConstants.BROKER_PORT);
- info = new JMXinfo(test.getConnector(),parser,test.getMBeanServerConnection());
- cmd = new Command(info,"list");
-
- }
- @Test
- public void TestOptionChecker()
- {
- Assert.assertEquals(cmd.optionchecker("o"),"queue");
- }
- @Test
- public void TestCheckOptionSetting()
- {
- Assert.assertEquals(cmd.checkoptionsetting("o"),true);
- Assert.assertEquals(cmd.checkoptionsetting("p"),false);
- }
- @After
- public void cleanup()
- {
- parser = null;
- test = null;
- info = null;
- cmd = null;
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java
deleted file mode 100644
index 5bdca118d5..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommanddelete.java
+++ /dev/null
@@ -1,99 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands;
-
-import org.junit.After;
-import org.junit.Test;
-import org.junit.Before;
-import org.junit.Assert;
-import org.apache.qpid.ConnectorFactory;
-import org.apache.qpid.Connector;
-import org.apache.qpid.ConnectionConstants;
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.utils.CommandLineOptionParser;
-
-import javax.management.remote.JMXConnector;
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 11, 2008
- * Time: 10:13:45 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestCommanddelete {
- JMXinfo info=null;
- String command = "delete -o queue -n ping -v test -t 1";
- Commanddelete delete = null;
- Connector conn;
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
- JMXConnector jmxc = conn.getConnector();
- MBeanServerConnection mbsc = conn.getMBeanServerConnection();
- CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
- info = new JMXinfo(jmxc,parser,mbsc);
- delete = new Commanddelete(info,"delete");
-
-
-
- }
- @Test
- public void TestSetQueryString()
- {
- delete.execute();
- Assert.assertEquals(delete.getobject(),"queue");
- Assert.assertEquals(delete.getvhost(),"test");
- Assert.assertEquals(delete.getname(),"ping");
- Assert.assertEquals(delete.getnumber(),1);
-
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java
deleted file mode 100644
index f4bb403e18..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandinfo.java
+++ /dev/null
@@ -1,95 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands;
-
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.Connector;
-import org.apache.qpid.ConnectorFactory;
-import org.apache.qpid.ConnectionConstants;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.After;
-
-import javax.management.remote.JMXConnector;
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 16, 2008
- * Time: 6:30:24 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestCommandinfo {
- JMXinfo info=null;
- String command = "info -o queue -n ping -v test";
- Commandinfo infocommand = null;
- Connector conn = null;
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
- JMXConnector jmxc = conn.getConnector();
- MBeanServerConnection mbsc = conn.getMBeanServerConnection();
- CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
- info = new JMXinfo(jmxc,parser,mbsc);
- infocommand = new Commandinfo(info,"list");
-
- }
- @Test
- public void TestSetQueryString()
- {
- infocommand.execute();
- Assert.assertEquals(infocommand.getobject(),"queue");
- Assert.assertEquals(infocommand.getvirtualhost(),"test");
- Assert.assertEquals(infocommand.getname(),"ping");
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java
deleted file mode 100644
index c8e044d6fe..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandlist.java
+++ /dev/null
@@ -1,100 +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.
- *
- */
- /*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands;
-
-import junit.framework.TestCase;
-import org.apache.qpid.ConnectionConstants;
-import org.apache.qpid.Connector;
-import org.apache.qpid.ConnectorFactory;
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.utils.JMXinfo;
-import org.junit.Test;
-import org.junit.Before;
-import org.junit.After;
-import org.junit.Assert;
-
-import javax.management.remote.JMXConnector;
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:18:28 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestCommandlist {
- /* All the methods in Commandlist doesn't have any arguments
- and no return type.
- */
- JMXinfo info=null;
- String command = "list -o queue -n ping -v test";
- Commandlist list = null;
- Connector conn = null;
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
- JMXConnector jmxc = conn.getConnector();
- MBeanServerConnection mbsc = conn.getMBeanServerConnection();
- CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
- info = new JMXinfo(jmxc,parser,mbsc);
- list = new Commandlist(info,"list");
-
- }
- @Test
- public void TestSetQueryString()
- {
- list.execute();
- Assert.assertEquals(list.getobject(),"queue");
- Assert.assertEquals(list.getvhost(),"test");
- Assert.assertEquals(list.getname(),"ping");
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java
deleted file mode 100644
index 278fa72365..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandmove.java
+++ /dev/null
@@ -1,100 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands;
-
-import org.apache.qpid.ConnectionConstants;
-import org.apache.qpid.Connector;
-import org.apache.qpid.ConnectorFactory;
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.utils.JMXinfo;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.After;
-import org.junit.Assert;
-
-import javax.management.remote.JMXConnector;
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 11, 2008
- * Time: 10:14:34 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestCommandmove {
- JMXinfo info=null;
- String command = "move -o queue -n1 ping -v1 test -n2 message_queue -fmid 10 -tmid 12";
- Commandmove move = null;
- Connector conn=null;
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
- JMXConnector jmxc = conn.getConnector();
- MBeanServerConnection mbsc = conn.getMBeanServerConnection();
- CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
- info = new JMXinfo(jmxc,parser,mbsc);
- move = new Commandmove(info,"move");
-
-
-
- }
- @Test
- public void TestSetQueryString()
- {
- move.execute();
- Assert.assertEquals(move.getobject(),"queue");
- Assert.assertEquals(move.getvhost(),"test");
- Assert.assertEquals(move.getname1(),"ping");
- Assert.assertEquals(move.getname2(),"message_queue");
- Assert.assertEquals(move.getfmid(),10);
- Assert.assertEquals(move.gettmid(),12);
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java
deleted file mode 100644
index 385d197475..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandview.java
+++ /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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands;
-
-import org.apache.qpid.ConnectionConstants;
-import org.apache.qpid.ConnectorFactory;
-import org.apache.qpid.Connector;
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.utils.JMXinfo;
-import org.junit.Test;
-import org.junit.Before;
-import org.junit.After;
-import org.junit.Assert;
-
-import javax.management.MBeanServerConnection;
-import javax.management.remote.JMXConnector;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 11, 2008
- * Time: 10:14:58 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestCommandview {
- JMXinfo info=null;
- String command = "view -o queue -n ping -v test -t 10";
- Commandview view =null;
- Connector conn=null;
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
- JMXConnector jmxc = conn.getConnector();
- MBeanServerConnection mbsc = conn.getMBeanServerConnection();
- CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
- info = new JMXinfo(jmxc,parser,mbsc);
- view = new Commandview(info,"view");
- }
- @Test
- public void TestSetQueryString()
- {
- view.execute();
- Assert.assertEquals(view.getobject(),"queue");
- Assert.assertEquals(view.getvhost(),"test");
- Assert.assertEquals(view.getname(),"ping");
- Assert.assertEquals(view.getnumber(),10);
-
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java
deleted file mode 100644
index 2b8f0e3ffd..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/TestCommandviewcontent.java
+++ /dev/null
@@ -1,99 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands;
-
-import org.apache.qpid.utils.JMXinfo;
-import org.apache.qpid.utils.CommandLineOptionParser;
-import org.apache.qpid.Connector;
-import org.apache.qpid.ConnectorFactory;
-import org.apache.qpid.ConnectionConstants;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.After;
-import org.junit.Assert;
-
-import javax.management.remote.JMXConnector;
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Aug 11, 2008
- * Time: 10:15:17 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestCommandviewcontent {
- JMXinfo info=null;
- String command = "viewcontent -o queue -n ping -v test -id 10";
- Commandviewcontent viewcontent =null;
- Connector conn = null;
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector(ConnectionConstants.BROKER_HOSTNAME, ConnectionConstants.BROKER_PORT);
- JMXConnector jmxc = conn.getConnector();
- MBeanServerConnection mbsc = conn.getMBeanServerConnection();
- CommandLineOptionParser parser = new CommandLineOptionParser(command.split(" "));
- info = new JMXinfo(jmxc,parser,mbsc);
- viewcontent = new Commandviewcontent(info,"viewcontent");
-
-
-
- }
- @Test
- public void TestSetQueryString()
- {
- viewcontent.execute();
- Assert.assertEquals(viewcontent.getobject(),"queue");
- Assert.assertEquals(viewcontent.getnumber(),10);
- Assert.assertEquals(viewcontent.getname(),"ping");
- Assert.assertEquals(viewcontent.getvhost(),"test");
-
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java
deleted file mode 100644
index 25069e6dbb..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestAllObject.java
+++ /dev/null
@@ -1,93 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands.objects;
-
-import junit.framework.TestCase;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.After;
-import org.junit.Assert;
-import org.apache.qpid.ConnectorFactory;
-import org.apache.qpid.Connector;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:23:25 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestAllObject {
- Connector conn;
- MBeanServerConnection mbsc;
- AllObjects test;
- String test1,test2;
-
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector("localhost", "8999");
- mbsc = conn.getMBeanServerConnection();
- test = new AllObjects(mbsc);
- test1 = "empty input1";
- test2 = "empty input2";
-
-
- }
- @Test
- public void TestSetQueryString()
- {
- test.setQueryString(test1,test2);
- Assert.assertEquals(test.querystring,"org.apache.qpid:*");
-
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java
deleted file mode 100644
index 8f98d1ac37..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestConnectionObject.java
+++ /dev/null
@@ -1,105 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands.objects;
-
-import junit.framework.TestCase;
-import org.apache.qpid.ConnectorFactory;
-import org.apache.qpid.Connector;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.Before;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:24:14 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestConnectionObject {
- Connector conn;
- MBeanServerConnection mbsc;
- ConnectionObject test;
- String test1,test2,test3;
-
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector("localhost", "8999");
- mbsc = conn.getMBeanServerConnection();
- test = new ConnectionObject(mbsc);
- test1 = "ping";
- test2 = "test";
- test3 = "object";
-
-
- }
- @Test
- public void TestSetQueryString()
- {
- test.setQueryString(test3,test1,null);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=Connection,name=ping,*");
- test.querystring = null;
- test.setQueryString(test3,null,test2);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=Connection,VirtualHost=test,*");
- test.querystring = null;
- test.setQueryString(test3,test1,test2);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=Connection,VirtualHost=test,name=ping,*");
- test.querystring = null;
- test.setQueryString(test3,null,null);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=Connection,*");
-
-
-
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java
deleted file mode 100644
index 64f2bef79a..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestExchangeObject.java
+++ /dev/null
@@ -1,103 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands.objects;
-
-import junit.framework.TestCase;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.After;
-import org.junit.Before;
-import org.apache.qpid.Connector;
-import org.apache.qpid.ConnectorFactory;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:24:49 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestExchangeObject {
- Connector conn;
- MBeanServerConnection mbsc;
- ExchangeObject test;
- String test1,test2,test3;
-
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector("localhost", "8999");
- mbsc = conn.getMBeanServerConnection();
- test = new ExchangeObject(mbsc);
- test1 = "ping";
- test2 = "test";
- test3 = "object";
-
-
- }
- @Test
- public void TestSetQueryString()
- {
- test.setQueryString(test3,test1,null);
-// System.out.println(test.querystring);
-// System.out.println("org.apache.qpid:type=VitualHost.Exchange,name=ping,*");
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Exchange,name=ping,*");
- test.querystring = null;
- test.setQueryString(test3,null,test2);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Exchange,VirtualHost=test,*");
- test.querystring = null;
- test.setQueryString(test3,test1,test2);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Exchange,VirtualHost=test,name=ping,*");
- test.querystring = null;
- test.setQueryString(test3,null,null);
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java
deleted file mode 100644
index b26d1f5a82..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestObjectNames.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands.objects;
-
-import junit.framework.TestCase;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:22:54 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestObjectNames {
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java
deleted file mode 100644
index 96b153f65d..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestQueueObject.java
+++ /dev/null
@@ -1,106 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands.objects;
-
-import junit.framework.TestCase;
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.After;
-import org.junit.Before;
-import org.apache.qpid.Connector;
-import org.apache.qpid.ConnectorFactory;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:25:21 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestQueueObject{
- Connector conn;
- MBeanServerConnection mbsc;
- QueueObject test;
- String test1,test2,test3;
-
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector("localhost", "8999");
- mbsc = conn.getMBeanServerConnection();
- test = new QueueObject(mbsc);
- test1 = "ping";
- test2 = "test";
- test3 = "object";
-
-
- }
- @Test
- public void TestSetQueryString()
- {
- test.setQueryString(test3,test1,null);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Queue,name=ping,*");
- test.querystring = null;
- test.setQueryString(test3,null,test2);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Queue,VirtualHost=test,*");
- test.querystring = null;
- test.setQueryString(test3,test1,test2);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Queue,VirtualHost=test,name=ping,*");
- test.querystring = null;
- test.setQueryString(test3,null,null);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.Queue,*");
-
-
-
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
-
- }
-}
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java
deleted file mode 100644
index a9123eb604..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestUserManagementObject.java
+++ /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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.commands.objects;
-
-import junit.framework.TestCase;
-import org.junit.Assert;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.Before;
-import org.apache.qpid.Connector;
-import org.apache.qpid.ConnectorFactory;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:26:09 PM
- * To change this template use File | Settings | File Templates.
- */
-
-
-
-public class TestUserManagementObject{
- Connector conn;
- MBeanServerConnection mbsc;
- UserManagementObject test;
- String test1,test2,test3;
-
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector("localhost", "8999");
- mbsc = conn.getMBeanServerConnection();
- test = new UserManagementObject(mbsc);
- test1 = "ping";
- test2 = "test";
- test3 = "object";
-
-
- }
- @Test
- public void TestSetQueryString()
- {
- test.setQueryString(test3,test1,test2);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=UserManagement,*");
-
-
-
-
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
-
- }
-}
-
-
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java
deleted file mode 100644
index 29a233733d..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/commands/objects/TestVirtualHostObject.java
+++ /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.
-*
-*/
-package org.apache.qpid.commands.objects;
-
-import junit.framework.TestCase;
-import org.junit.Assert;
-import org.junit.After;
-import org.junit.Test;
-import org.junit.Before;
-import org.apache.qpid.Connector;
-import org.apache.qpid.ConnectorFactory;
-
-import javax.management.MBeanServerConnection;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:26:40 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestVirtualHostObject{
- Connector conn;
- MBeanServerConnection mbsc;
- VirtualHostObject test;
- String test1,test2,test3;
-
- @Before
- public void startup()
- {
- conn = ConnectorFactory.getConnector("localhost", "8999");
- mbsc = conn.getMBeanServerConnection();
- test = new VirtualHostObject(mbsc);
- test1 = "ping";
- test2 = "test";
- test3 = "object";
-
-
- }
- @Test
- public void TestSetQueryString()
- {
- test.setQueryString(test3,test1,null);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.VirtualHostManager,name=ping,*");
- test.querystring = null;
- test.setQueryString(test3,null,test2);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost=test,*");
- test.querystring = null;
- test.setQueryString(test3,test1,test2);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.VirtualHostManager,VirtualHost=test,name=ping,*");
- test.querystring = null;
- test.setQueryString(test3,null,null);
- Assert.assertEquals(test.querystring,"org.apache.qpid:type=VirtualHost.VirtualHostManager,*");
-
-
-
- }
-
- @After
- public void cleanup()
- {
- try{
- conn.getConnector().close();
- }catch(Exception ex)
- {
- ex.printStackTrace();
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java
deleted file mode 100644
index 58d71a4de6..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOption.java
+++ /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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.utils;
-
-import junit.framework.TestCase;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.Assert;
-import org.junit.After;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:17:26 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestCommandLineOption {
- String input1;
- String input2;
- String options;
- String [] list;
- CommandLineOption option;
-
- @Before
- public void setup()
- {
- input1 = "-h";
- input2 = "--help";
- options = "localhost testing";
- list = options.split(" ");
- option = new CommandLineOption(input1,list);
-
- }
- @Test
- public void TestGetOptinValue()
- {
- Assert.assertEquals(option.getOptionValue(),"localhost");
- }
- @Test
- public void TestGetOptionType()
- {
- Assert.assertEquals(option.getOptionType(),"h");
- }
- @After
- public void cleanup()
- {
- option = null;
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java
deleted file mode 100644
index 989fc61418..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestCommandLineOptionParser.java
+++ /dev/null
@@ -1,100 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.utils;
-
-import junit.framework.TestCase;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.After;
-import org.junit.Assert;
-
-import java.util.Map;
-import java.util.HashMap;
-import java.util.ArrayList;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:16:30 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestCommandLineOptionParser {
- CommandLineOptionParser parser;
- String [] input;
- CommandLineOption option1;
- CommandLineOption option2;
- ArrayList list1;
- ArrayList list2;
- @Before
- public void setup()
- {
- String temp = "run -h localhost -p 23232";
- input = temp.split(" ");
- parser = new CommandLineOptionParser(input);
- list1 = new ArrayList();
- list2 = new ArrayList();
- }
- @Test
- public void TestParse()
- {
- Map hash = new HashMap();
-
- list1.add("localhost");
- list2.add("23232");
- option1 = new CommandLineOption("h",list1);
- option2 = new CommandLineOption("p",list2);
- hash.put("h",option1);
- hash.put("p",option2);
- option1 = (CommandLineOption)parser.parse(input).get("h");
- Assert.assertEquals(option1.getOptionType(),"h");
- Assert.assertEquals(option1.getOptionValue(),"localhost");
- option1 = (CommandLineOption)parser.parse(input).get("p");
- Assert.assertEquals(option1.getOptionType(),"p");
- Assert.assertEquals(option1.getOptionValue(),"23232");
- Assert.assertEquals(parser.parse(input).size(),hash.size());
- }
- @After
- public void cleanup()
- {
- parser = null;
- option1 = null;
- option2 = null;
-
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java
deleted file mode 100644
index a5d3122406..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfigProperty.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.utils;
-
-import junit.framework.TestCase;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:15:35 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestJMXConfigProperty {
-
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java
deleted file mode 100644
index 02dd7219db..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXConfiguration.java
+++ /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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.utils;
-
-import junit.framework.TestCase;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.After;
-import org.junit.Assert;
-
-import java.util.ArrayList;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:14:32 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestJMXConfiguration {
- CommandLineOptionParser clop;
- JMXConfiguration jmc;
- CommandLineOption option;
- String [] input;
- @Before
- public void setup()
- {
- String temp = "command -h 127.0.0.1 -p 1234";
- input = temp.split(" ");
- clop = new CommandLineOptionParser(input);
- jmc = new JMXConfiguration(clop.getAlloptions());
- }
- @Test
- public void TestLoadOption()
- {
- ArrayList list = new ArrayList();
- list.add("127.0.0.1");
- option = new CommandLineOption("-h",list);
- CommandLineOption expect = jmc.loadoption("h",clop.getAlloptions());
- Assert.assertEquals(expect.getOptionType(),option.getOptionType());
- Assert.assertEquals(expect.getOptionValue(),option.getOptionValue());
- }
- @After
- public void cleanup()
- {
- clop = null;
- jmc = null;
- option = null;
- }
-}
diff --git a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java b/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java
deleted file mode 100644
index 449609c639..0000000000
--- a/M4-RCs/qpid/java/management/tools/qpid-cli/test/org/apache/qpid/utils/TestJMXinfo.java
+++ /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.
- *
- */
-/*
- *
- * Copyright (c) 2006 The Apache Software Foundation
- *
- * 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.
- *
- */
-package org.apache.qpid.utils;
-
-import junit.framework.TestCase;
-
-/**
- * Created by IntelliJ IDEA.
- * User: lahiru
- * Date: Jun 30, 2008
- * Time: 12:12:43 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TestJMXinfo {
- /* this class is having only three simple getter methods. Therefore no
- testcases
- */
-}
diff --git a/M4-RCs/qpid/java/module.xml b/M4-RCs/qpid/java/module.xml
deleted file mode 100644
index a9bd9a2b2a..0000000000
--- a/M4-RCs/qpid/java/module.xml
+++ /dev/null
@@ -1,542 +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.
- -
- -->
-<project name="module">
-
- <import file="common.xml"/>
-
- <map property="module" value="${basedir}" split="${path.separator}">
- <globmapper from="${project.root}${file.separator}*" to="*"/>
- </map>
-
- <map property="module.name" value="${module}">
- <filtermapper>
- <replacestring from="${file.separator}" to="-"/>
- </filtermapper>
- </map>
-
- <echo message="Running ant for module : ${module}" level="info"/>
-
- <property file="${project.root}/build.deps"/>
-
- <property name="module.build" location="${build}/${module}"/>
- <property name="module.classes" location="${module.build}/classes"/>
- <property name="module.instrumented" location="${module.build}/classes-instrumented"/>
- <property name="module.precompiled" location="${module.build}/src"/>
- <property name="module.api" location="${module.build}/api"/>
- <property name="module.test.classes" location="${module.build}/test/classes"/>
- <property name="module.results" location="${build.results}/${module}"/>
- <property name="module.failed" location="${module.results}/FAILED"/>
- <property name="module.src" location="src/main/java"/>
- <property name="module.test.src" location="src/test/java"/>
- <property name="module.bin" location="bin"/>
- <property name="module.etc" location="etc"/>
-
- <property name="module.namever" value="${project.name}-${module.name}-${project.version}"/>
- <property name="module.release.base" value="${basedir}/release"/>
- <property name="module.release" value="${module.release.base}/${module.namever}"/>
- <property name="module.release.lib" value="${module.release}/lib"/>
- <property name="module.release.zip" location="${module.release.base}/${module.namever}.zip"/>
- <property name="module.release.tar" location="${module.release.base}/${module.namever}.tar"/>
- <property name="module.release.tgz" location="${module.release.base}/${module.namever}.tar.gz"/>
- <property name="module.release.bz2" location="${module.release}/${module.namever}.tar.bz2"/>
-
- <property name="module.qpid.jar" location="${module.release.lib}/qpid-all.jar"/>
- <basename property="qpid.jar.name" file="${module.qpid.jar}"/>
-
- <property name="module.coverage" location="${module.build}/coverage"/>
- <property name="cobertura.datafile" location="${module.instrumented}/cobetura.ser"/>
-
- <available property="module.test.src.exists" file="${module.test.src}"/>
- <available property="module.etc.exists" file="${module.etc}"/>
- <available property="module.bin.exists" file="${module.bin}"/>
-
- <indirect name="module.libs" variable="${module.name}.libs"/>
- <indirect name="module.test.libs" variable="${module.name}.test.libs"/>
-
- <path id="module.libs">
- <filelist dir="${project.root}" files="${module.libs}"/>
- </path>
-
- <path id="module.test.libs">
- <filelist dir="${project.root}" files="${module.test.libs}"/>
- </path>
-
- <path id="module.src.path">
- <pathelement location="${module.src}"/>
- <pathelement location="${module.precompiled}"/>
- </path>
-
- <condition property="module.jar"
- value="${build.plugins}/${project.name}-${module.name}-${project.version}.jar"
- else="${build.lib}/${project.name}-${module.name}-${project.version}.jar">
- <and>
- <isset property="module.plugin"/>
- <istrue value="${module.plugin}"/>
- </and>
- </condition>
-
- <property name="module.test.jar"
- location="${build.lib}/${project.name}-${module.name}-tests-${project.version}.jar"/>
-
- <!-- module.depends and module.test.depends are supplied by the importing file -->
- <property name="module.depends" value=""/>
- <property name="module.test.depends" value=""/>
- <property name="module.test.excludes" value=""/>
-
- <map property="module.depends.path" value="${module.depends}" join="${path.separator}">
- <globmapper from="*" to="${build}/*/classes"/>
- </map>
-
- <map property="module.test.depends.path" value="${module.test.depends}" join="${path.separator}">
- <globmapper from="*" to="${build}/*/classes"/>
- </map>
-
- <path id="module.class.path">
- <pathelement location="${module.classes}"/>
- <pathelement path="${module.depends.path}"/>
- <path refid="module.libs"/>
- </path>
-
- <path id="module.test.path">
- <pathelement path="${module.test.classes}"/>
- <path refid="module.class.path"/>
- <pathelement path="${module.test.depends.path}"/>
- <path refid="module.test.libs"/>
- </path>
-
- <property name="javac.deprecation" value="off"/>
-
- <target name="debug">
- <echo-prop name="basedir"/>
- <echo-prop name="project.root"/>
- <echo-prop name="module"/>
- <echo-prop name="module.libs"/>
- <echo-prop name="module.test.libs"/>
- <echo-prop name="module.name"/>
- <echo-prop name="module.jar"/>
- <echo-prop name="module.depends"/>
- <echo-prop name="module.depends.path"/>
- <echo-prop name="module.test.depends"/>
- <echo-prop name="module.test.depends.path"/>
- <echo-path refid="module.src.path"/>
- <echo-path refid="module.class.path"/>
- <echo-path refid="module.test.path"/>
- </target>
-
- <target name="prepare">
- <mkdir dir="${build.bin}"/>
- <mkdir dir="${build.etc}"/>
- <mkdir dir="${build.lib}"/>
- <mkdir dir="${build.results}"/>
- <mkdir dir="${build.data}"/>
- <mkdir dir="${build.plugins}"/>
- <mkdir dir="${module.classes}"/>
- <mkdir dir="${module.precompiled}"/>
- <mkdir dir="${module.api}"/>
- <mkdir dir="${module.test.classes}"/>
- <mkdir dir="${module.results}"/>
- </target>
-
- <target name="precompile"/>
-
- <target name="compile" depends="prepare,precompile" description="compile sources">
-
- <echo message="Targeting : ${java.target}" level="info"/>
-
- <javac source="${java.source}" target="${java.target}"
- destdir="${module.classes}" debug="on"
- deprecation="${javac.deprecation}">
- <compilerarg line="${javac.compiler.args}"/>
- <src refid="module.src.path"/>
- <classpath refid="module.class.path"/>
- </javac>
-
- <!-- copy any non java src files into the build tree, e.g. log4j.properties -->
- <copy todir="${module.classes}" verbose="true">
- <fileset dir="${module.src}">
- <exclude name="**/*.java"/>
- <exclude name="**/package.html"/>
- </fileset>
- </copy>
- </target>
-
- <target name="precompile-tests" if="module.test.src.exists"/>
-
- <target name="compile-tests" depends="compile,precompile-tests" if="module.test.src.exists"
- description="compilte unit tests">
- <javac target="${java.target}" source="${java.source}"
- destdir="${module.test.classes}" debug="on"
- deprecation="${javac.deprecation}"
- srcdir="${module.test.src}">
- <classpath refid="module.test.path"/>
- </javac>
-
- <!-- copy any non java src files into the build tree, e.g. log4j.properties -->
- <copy todir="${module.test.classes}" verbose="true">
- <fileset dir="${module.test.src}">
- <exclude name="**/*.java"/>
- <exclude name="**/package.html"/>
- </fileset>
- </copy>
- </target>
-
- <property name="java.naming.factory.initial" value="org.apache.qpid.jndi.PropertiesFileInitialContextFactory"/>
-
- <condition property="config" value="${profile}.testprofile" else="default.testprofile">
- <and>
- <isset property="profile"/>
- <available file="${project.root}/${profile}.testprofile" type="file"/>
- </and>
- </condition>
-
-
- <property file="${project.root}/${config}"/>
- <property file="${project.root}/default.testprofile"/>
-
- <condition property="dontruntest" value="dontruntest" else="runtest">
- <contains substring="${module.name}" string="${exclude.modules}" />
- </condition>
-
- <target name="test" depends="build,compile-tests" if="module.test.src.exists"
- unless="${dontruntest}" description="execute unit tests">
-
- <delete file="${module.failed}"/>
-
- <echo message="Using config:${config}" level="info"/>
- <junit fork="${test.fork}" maxmemory="${test.mem}" reloading="no"
- haltonfailure="${haltonfailure}" haltonerror="${haltonerror}"
- failureproperty="test.failures" printsummary="on" timeout="600000" >
-
- <jvmarg value="${jvm.args}"/>
-
- <sysproperty key="amqj.logging.level" value="${amqj.logging.level}"/>
- <sysproperty key="amqj.protocol.logging.level" value="${amqj.protocol.logging.level}"/>
- <sysproperty key="log4j.debug" value="${log4j.debug}"/>
- <sysproperty key="root.logging.level" value="${root.logging.level}"/>
- <sysproperty key="log4j.configuration" value="${log4j.configuration}"/>
- <sysproperty key="java.naming.factory.initial" value="${java.naming.factory.initial}"/>
- <sysproperty key="java.naming.provider.url" value="${java.naming.provider.url}"/>
- <sysproperty key="broker" value="${broker}"/>
- <sysproperty key="broker.clean" value="${broker.clean}"/>
- <sysproperty key="broker.version" value="${broker.version}"/>
- <sysproperty key="broker.ready" value="${broker.ready}" />
- <sysproperty key="test.excludes" value="${test.excludes}"/>
- <sysproperty key="test.excludesfile" value="${test.excludesfile}"/>
- <sysproperty key="test.output" value="${module.results}"/>
- <syspropertyset>
- <propertyref prefix="profile"/>
- </syspropertyset>
- <sysproperty key="max_prefetch" value ="${max_prefetch}"/>
- <sysproperty key="example.plugin.target" value="${project.root}/build/lib/plugins"/>
- <sysproperty key="QPID_EXAMPLE_HOME" value="${project.root}/build"/>
- <sysproperty key="QPID_HOME" value="${project.root}/build"/>
-
- <formatter type="plain"/>
- <formatter type="xml"/>
-
- <classpath refid="module.test.path"/>
-
- <batchtest fork="${test.fork}" todir="${module.results}">
- <fileset dir="${module.test.src}" excludes="${module.test.excludes}">
- <include name="**/${test}.java"/>
- </fileset>
- </batchtest>
- </junit>
-
- <antcall target="touch-failed"/>
-
- <condition property="failed">
- <and>
- <isfalse value="${test.failures.ignore}"/>
- <available file="${module.failed}"/>
- </and>
- </condition>
-
- <fail if="failed" message="TEST SUITE FAILED"/>
-
- </target>
-
- <target name="touch-failed" if="test.failures">
- <touch file="${module.failed}"/>
- <touch file="${build.failed}"/>
- </target>
-
- <target name="copy-bin" if="module.bin.exists" description="copy bin directory if it exists to build tree">
- <copy todir="${build.bin}" failonerror="false">
- <fileset dir="${module.bin}"/>
- </copy>
- <chmod dir="${build.bin}" perm="ugo+rx" includes="**/*"/>
- </target>
-
- <target name="copy-bin-release" if="module.bin.exists" description="copy dependencies into module release">
- <copy todir="${module.release}/bin" failonerror="true">
- <fileset dir="${module.bin}" />
- </copy>
- <chmod dir="${module.release}/bin" perm="ugo+rx" includes="**/*"/>
- </target>
-
- <target name="copy-etc" if="module.etc.exists" description="copy etc directory if it exists to build tree">
- <copy todir="${build.etc}" failonerror="false">
- <fileset dir="${module.etc}"/>
- </copy>
- </target>
-
- <target name="copy-etc-release" if="module.etc.exists" description="copy etc directory if it exists to build tree">
- <copy todir="${module.release}/etc" failonerror="false" flatten="true">
- <fileset dir="${module.etc}"/>
- </copy>
- </target>
-
- <target name="postbuild" description="run after a build"/>
-
- <target name="build" depends="jar,jar-tests,libs,copy-bin,copy-etc,postbuild" description="compile and copy resources into build tree"/>
- <target name="jar.manifest" depends="compile" if="module.manifest">
- <jar destfile="${module.jar}" basedir="${module.classes}" manifest="${module.manifest}"/>
- </target>
-
- <target name="jar.nomanifest" depends="compile" unless="module.manifest">
- <jar destfile="${module.jar}" basedir="${module.classes}">
- <metainf dir="${project.root}/resources/" />
- </jar>
- </target>
-
- <target name="jar" depends="jar.manifest,jar.nomanifest" description="create jar"/>
-
- <target name="jar-tests" depends="compile-tests" description="create unit test jar">
- <jar destfile="${module.test.jar}" basedir="${module.test.classes}"/>
- </target>
-
- <target name="libs" description="copy dependencies into build tree">
- <copy todir="${build.lib}" failonerror="false" flatten="true">
- <fileset dir="${project.root}" includes="${module.libs}"/>
- </copy>
- </target>
-
- <map property="module.depends.jars" value="${module.depends}" join=",">
- <globmapper from="*" to="${project.name}-*-${project.version}.jar"/>
- </map>
-
-
- <target name="libs-release" description="copy dependencies into module release">
- <!-- Copy the module dependencies -->
- <copy todir="${module.release}" failonerror="true">
- <fileset dir="${basedir}${file.separator}.." includes="${module.libs}"/>
- </copy>
- <!-- Copy the jar for this module -->
- <copy todir="${module.release}/lib" failonerror="true">
- <fileset file="${module.jar}"/>
- <fileset dir="${build.lib}" includes="${module.depends.jars}"/>
- </copy>
- </target>
-
- <target name="resources" description="copy resources into build tree">
- <copy todir="${build}" failonerror="false" flatten="true">
- <fileset dir="${basedir}${file.separator}.." includes="${resources}"/>
- </copy>
- </target>
-
- <target name="resources-release" description="copy resources into module release">
- <copy todir="${module.release}" failonerror="false" flatten="true">
- <fileset dir="${resources}" excludes="META-INF"/>
- </copy>
- </target>
-
- <uptodate property="doc.done" targetfile="${module.api}/index.html">
- <srcfiles dir="${module.src}" includes="**/*.java"/>
- </uptodate>
-
- <target name="doc" depends="prepare" unless="doc.done" description="generate api-doc">
- <javadoc destdir="${module.api}" sourcepathref="module.src.path"
- classpathref="module.class.path" packagenames="*"/>
- </target>
-
- <target name="release-bin-prepare">
- <mkdir dir="${module.release}"/>
- <available property="module.release.exists" file="${module.release}"/>
- </target>
-
- <target name="check-module-manifest">
- <uptodate property="module-manifest.done" targetfile="${qpid.jar}">
- <srcfiles dir="${build.lib}" includes="**/*.jar" excludes="**/${qpid.jar.name}"/>
- </uptodate>
- </target>
-
- <target name="module-manifest" depends="check-module-manifest" unless="module-manifest.done">
- <path id="class.path">
- <fileset dir="${module.release.lib}" >
- <include name="*.jar"/>
- <exclude name="${qpid.jar.name}"/>
- </fileset>
- </path>
- <pathconvert property="qpid.jar.classpath" pathsep=" " dirsep="/">
- <path refid="class.path"/>
- <globmapper from="${module.release.lib}${file.separator}*" to="*"/>
- </pathconvert>
-
- <jar destfile="${module.qpid.jar}">
- <manifest>
- <attribute name="Class-Path" value="${qpid.jar.classpath}"/>
- </manifest>
- <metainf dir="${project.root}/resources/"/>
- </jar>
-
- <touch file="${module.qpid.jar}"/>
- </target>
-
-
- <target name="zip-release" depends="build-release-bin" description="build module release archive">
- <zip destfile="${module.release.zip}">
- <zipfileset dir="${module.release}" prefix="${module.namever}" filemode="755">
- <include name="bin/*"/>
- <exclude name="bin/*.txt"/>
- </zipfileset>
-
- <zipfileset dir="${module.release}" prefix="${module.namever}" filemode="644">
- <include name="bin/*.txt"/>
- </zipfileset>
-
- <zipfileset dir="${module.release}" prefix="${module.namever}" excludes="${module.release.excludes}" filemode="644" dirmode="755">
- <exclude name="bin/**"/>
- <exclude name="**/*.class"/>
- </zipfileset>
- </zip>
- </target>
-
- <target name="bundle" depends="jar">
- <taskdef resource="aQute/bnd/ant/taskdef.properties" classpath="${project.root}/lib/bnd-0.0.249.jar"/>
- <echo message="Bundling ${build}/lib/${module.namever}.jar with ${module.src}/${module}.bnd"/>
- <bnd
- classpath="${build}/lib/${module.namever}.jar"
- eclipse="false"
- failok="false"
- exceptions="true"
- output="${build}/lib/${module.namever}-osgi.jar"
- files="${module.src}/${module}.bnd"/>
- </target>
-
- <target name="tar-release" depends="zip-release" description="build release archive">
- <tar destfile="${module.release.tar}" longfile="gnu" >
- <zipfileset src="${module.release.zip}"/>
- </tar>
- </target>
-
- <target name="gzip-release" depends="tar-release" description="build release archive">
- <gzip src="${module.release.tar}" destfile="${module.release.tgz}"/>
- </target>
-
- <target name="bzip2-release" depends="tar-release" description="build release archive">
- <bzip2 src="${module.release.tar}" destfile="${module.release.bz2}"/>
- </target>
-
- <target name="doc-release" description="no-op override if a doc step is requried "/>
-
-
- <target name="build-release-bin" depends="release-bin-prepare,libs-release,copy-bin-release,
- copy-etc-release,doc-release,resources-release,release-bin-other,module-manifest"
- description="Task that includes all tasks required to create a module binary release"/>
-
- <!-- ,zip-release,gzip-release -->
- <target name="release-bin-tasks" depends="gzip-release" description="build all release archives except .bz2"/>
-
- <target name="release-bin-all-tasks" depends="bzip2-release" description="build all release archives"/>
-
- <!-- Dummy targets to no-op for most modules. Override if a module package is required -->
- <target name="release-bin-other" description="Override if there is tasks required for the module bin release to occur last"/>
- <target name="release-bin" description="Override and depend on release-bin-tasks to generate"/>
- <target name="release-bin-all" description="Override and depend on release-bin-tasks to generate"/>
-
- <target name="clean" description="remove build artifacts">
- <delete dir="${module.build}"/>
- <delete dir="${module.results}"/>
- <delete dir="${module.release.base}"/>
- <delete dir="${module.instrumented}"/>
- </target>
-
- <target name="instrument">
- <cobertura-instrument todir="${module.instrumented}"
- datafile="${cobertura.datafile}">
- <fileset dir="${module.classes}">
- <include name="**/*.class"/>
- </fileset>
- <fileset dir="${module.test.classes}">
- <include name="**/*.class"/>
- </fileset>
- </cobertura-instrument>
- </target>
-
- <target name="cover-test" depends="instrument">
- <mkdir dir="${build.coveragereport}" />
- <junit fork="yes" forkmode="once" maxmemory="${test.mem}" reloading="no"
- haltonfailure="${haltonfailure}" haltonerror="${haltonerror}"
- failureproperty="test.failures" printsummary="on" timeout="600000" >
-
- <sysproperty key="amqj.logging.level" value="${amqj.logging.level}"/>
- <sysproperty key="amqj.protocol.logging.level" value="${amqj.protocol.logging.level}"/>
- <sysproperty key="log4j.debug" value="${log4j.debug}"/>
- <sysproperty key="root.logging.level" value="${root.logging.level}"/>
- <sysproperty key="log4j.configuration" value="${log4j.configuration}"/>
- <sysproperty key="java.naming.factory.initial" value="${java.naming.factory.initial}"/>
- <sysproperty key="java.naming.provider.url" value="${java.naming.provider.url}"/>
- <sysproperty key="broker" value="${broker}"/>
- <sysproperty key="broker.clean" value="${broker.clean}"/>
- <sysproperty key="broker.version" value="${broker.version}"/>
- <sysproperty key="broker.ready" value="${broker.ready}" />
- <sysproperty key="test.excludes" value="${test.excludes}"/>
- <sysproperty key="test.excludesfile" value="${test.excludesfile}"/>
- <sysproperty key="test.output" value="${module.results}"/>
- <sysproperty key="max_prefetch" value ="${max_prefetch}"/>
- <sysproperty key="example.plugin.target" value="${project.root}/build/lib/plugins"/>
- <sysproperty key="QPID_EXAMPLE_HOME" value="${project.root}/build"/>
- <sysproperty key="QPID_HOME" value="${project.root}/build"/>
-
- <sysproperty key="net.sourceforge.cobertura.datafile"
- file="${cobertura.datafile}" />
-
- <formatter type="plain"/>
- <formatter type="xml"/>
-
- <classpath path="${module.instrumented}"/>
- <classpath>
- <fileset dir="${build}">
- <include name="**/classes-instrumented/*.class"/>
- </fileset>
- </classpath>
- <classpath refid="module.test.path"/>
- <classpath refid="cobertura.classpath"/>
-
- <batchtest todir="${module.results}">
- <fileset dir="${module.test.src}" excludes="${module.test.excludes}">
- <include name="**/${test}.java"/>
- </fileset>
- </batchtest>
- </junit>
- </target>
-
- <target name="coverage-report">
- <echo message="${cobertura.datafile}"/>
- <cobertura-report format="html"
- destdir="${module.coverage}"
- datafile="${cobertura.datafile}">
- <fileset dir="${module.src}" includes="**/*.java" />
- </cobertura-report>
- </target>
-
-</project>
diff --git a/M4-RCs/qpid/java/perftests/RunningPerformanceTests.txt b/M4-RCs/qpid/java/perftests/RunningPerformanceTests.txt
deleted file mode 100644
index 2bc9220774..0000000000
--- a/M4-RCs/qpid/java/perftests/RunningPerformanceTests.txt
+++ /dev/null
@@ -1,141 +0,0 @@
-The Performance Tests
--------------------------
-
-Building the Tests (Only develoeprs need to know how to do this).
------------------------------------------------------------------
-
-The performance tests are compiled as part of the Maven build by default, but the performance test scripts are not. There is also an additional step to perform, that generates a convenient Jar file containing all of the test dependencies, to simplify invoking Java with a very long command line. The steps to build the performance test suite are:
-
- 1. Cd to the /java/perftests directory.
- 2. Execute: mvn org.apache.qpid:junit-toolkit-maven-plugin:tkscriptgen (this generates the scripts).
- 3. Execute: mvn assembly:assembly
-
-The assembly:assembly step generates a Jar with all the dependecies in it in a file name ending with -all-test-deps.jar, which contains the client code and all its dependencies, plus JUnit and the toolkit test runners. The generated scripts expect to find the jar in the current directory. You can Cd to the /target directory and run the scripts from there. The assembly:assembly step also outputs some archives that contain all the scripts and required Jar for convenient shipping of the test suite. Unpack this anywhere you like and run the tests from there.
-
-Running the Tests
------------------
-
-All the performance tests are run through shell scripts, that have been configured with parameters set up in the pom.xml file. You can override any of these parameters on the command line. It is also possible to pass parameters through the script to the JVM that is running the test. For example to change the heap size you might do:
-
-./Ping-Once.sh -java:Xmx1024M
-
-The tests have all been set up to accept a single integer 'size' parameter, passed to the JUnit TestCase for the test, through the JUnit Toolkit asymptotic test case extension. The 'size' parameter is always interpreted in the performance tests as standing for the number of messages to send per test method invocation. Therefore, in the results of the test the throughput of messages is equal to the number of test method invocations times the 'size' divided by the time taken.
-
-** TODO: Change this, use seconds not millis.
-
-Test timing results are output to .csv files, which can easily be imported into a spreadsheet for graphing and analysis. The timings in this file are always given in milliseconds, which may be a bit confusing and should really be changed to seconds.
-
-The JUnit Toolkit provides a framework for controlling how long tests are run for, how many are run at once and what the 'size' parameter is, which is general enough to handle a wide variety of performance tests. Here is the documentation from the TKTestRunner class that explains what its command line parameters are:
-
- ...
- * TKTestRunner extends {@link junit.textui.TestRunner} with the ability to run tests multiple times, to execute a test
- * simultaneously using many threads, to put a delay between test runs and adds support for tests that take integer
- * parameters that can be 'stepped' through on multiple test runs. These features can be accessed by using this class
- * as an entry point and passing command line arguments to specify which features to use:
- *
- * <pre>
- * -w ms The number of milliseconds between invocations of test cases.
- * -c pattern The number of tests to run concurrently.
- * -r num The number of times to repeat each test.
- * -d duration The length of time to run the tests for.
- * -t name The name of the test case to execute.
- * -s pattern The size parameter to run tests with.
- * -o dir The name of the directory to output test timings to.
- * -v Verbose mode.
- * </pre>
- *
- * <p/>The pattern arguments are of the form [lowest(, ...)(, highest)](,sample=s)(,exp), where round brackets
- * enclose optional values. Using this pattern form it is possible to specify a single value, a range of values divided
- * into s samples, a range of values divided into s samples but distributed exponentially, or a fixed set of samples.
- *
- * <p/>The duration arguments are of the form dD(:hH)(:mM)(:sS), where round brackets enclose optional values.
- *
- * <p/>Here are some examples:
- *
- * <p/><table>
- * <tr><td><pre> -c [10,20,30,40,50] </pre><td> Runs the test with 10,20,...,50 threads.
- * <tr><td><pre> -s [1,100],samples=10 </pre>
- * <td> Runs the test with ten different size parameters evenly spaced between 1 and 100.
- * <tr><td><pre> -s [1,1000000],samples=10,exp </pre>
- * <td> Runs the test with ten different size parameters exponentially spaced between 1 and 1000000.
- * <tr><td><pre> -r 10 </pre><td> Runs each test ten times.
- * <tr><td><pre> -d 10H </pre><td> Runs the test repeatedly for 10 hours.
- * <tr><td><pre> -d 1M, -r 10 </pre>
- * <td> Runs the test repeatedly for 1 minute but only takes a timing sample every 10 test runs.
- * <tr><td><pre> -r 10, -c [1, 5, 10, 50], -s [100, 1000, 10000] </pre>
- * <td> Runs 12 test cycles (4 concurrency samples * 3 size sample), with 10 repeats each. In total the test
- * will be run 199 times (3 + 15 + 30 + 150)
- * </table>
- ...
-
-The specific performance test cases for QPid are implemented as extensions to JUnit TestCase (asymptotic test cases), and also accept a large number of different parameters to control the characteristics of the test. The are passed into the test scripts as name=value pairs. Here is the documentation from the PingPongProducer class that explains what the available parameters and default values are:
-
- ...
- * <p/>This ping tool accepts a vast number of configuration options, all of which are passed in to the constructor. It
- * can ping topics or queues; ping multiple destinations; do persistent pings; send messages of any size; do pings within
- * transactions; control the number of pings to send in each transaction; limit its sending rate; and perform failover
- * testing. A complete list of accepted parameters, default values and comments on their usage is provided here:
- *
- * <p/><table><caption>Parameters</caption>
- * <tr><th> Parameter <th> Default <th> Comments
- * <tr><td> messageSize <td> 0 <td> Message size in bytes. Not including any headers.
- * <tr><td> destinationName <td> ping <td> The root name to use to generate destination names to ping.
- * <tr><td> persistent <td> false <td> Determines whether peristent delivery is used.
- * <tr><td> transacted <td> false <td> Determines whether messages are sent/received in transactions.
- * <tr><td> broker <td> tcp://localhost:5672 <td> Determines the broker to connect to.
- * <tr><td> virtualHost <td> test <td> Determines the virtual host to send all ping over.
- * <tr><td> rate <td> 0 <td> The maximum rate (in hertz) to send messages at. 0 means no limit.
- * <tr><td> verbose <td> false <td> The verbose flag for debugging. Prints to console on every message.
- * <tr><td> pubsub <td> false <td> Whether to ping topics or queues. Uses p2p by default.
- * <tr><td> failAfterCommit <td> false <td> Whether to prompt user to kill broker after a commit batch.
- * <tr><td> failBeforeCommit <td> false <td> Whether to prompt user to kill broker before a commit batch.
- * <tr><td> failAfterSend <td> false <td> Whether to prompt user to kill broker after a send.
- * <tr><td> failBeforeSend <td> false <td> Whether to prompt user to kill broker before a send.
- * <tr><td> failOnce <td> true <td> Whether to prompt for failover only once.
- * <tr><td> username <td> guest <td> The username to access the broker with.
- * <tr><td> password <td> guest <td> The password to access the broker with.
- * <tr><td> selector <td> null <td> Not used. Defines a message selector to filter pings with.
- * <tr><td> destinationCount <td> 1 <td> The number of receivers listening to the pings.
- * <tr><td> timeout <td> 30000 <td> In milliseconds. The timeout to stop waiting for replies.
- * <tr><td> commitBatchSize <td> 1 <td> The number of messages per transaction in transactional mode.
- * <tr><td> uniqueDests <td> true <td> Whether each receiver only listens to one ping destination or all.
- * <tr><td> durableDests <td> false <td> Whether or not durable destinations are used.
- * <tr><td> ackMode <td> AUTO_ACK <td> The message acknowledgement mode. Possible values are:
- * 0 - SESSION_TRANSACTED
- * 1 - AUTO_ACKNOWLEDGE
- * 2 - CLIENT_ACKNOWLEDGE
- * 3 - DUPS_OK_ACKNOWLEDGE
- * 257 - NO_ACKNOWLEDGE
- * 258 - PRE_ACKNOWLEDGE
- * <tr><td> maxPending <td> 0 <td> The maximum size in bytes, of messages sent but not yet received.
- * Limits the volume of messages currently buffered on the client
- * or broker. Can help scale test clients by limiting amount of buffered
- * data to avoid out of memory errors.
- * </table>
- ...
-
-The most common test case to run is implemented in the class PingAsyncTestPerf, which sends and recieves messages simultaneously. This class uses a PingPongProdicer to do its sending and receiving, and wraps it in a suitable way to make it callable through the extended JUnit test runner. This class also accpets another parameter "batchSize" with a default of "1000". This tells the test how many messages to send before stopping sending and waiting for them all to come back. The actual value entered does not matter too much, but typically values larger than 1000 are used to ensure that there is a reasonable opportunity for simultaneous sending and receiving, and less than 10000 to ensure that each test method invocation does not go on for too long.
-
-The test script parameters can all be seen in the pom.xml file. A three letter code is used on the test scripts, first letter P or T for persistent or transient, second letter Q or T for queue (p2p) or topic (pub/sub), third letter R for reliability tests, C for client scaling tests, M for message size tests.Typically tests run and sample their results for 10 minutes, to get a reasonable measurement of a broker running under a steady load. The tests as configured do not measure 'burst' performance.
-
-The reliability/burn in tests, test the broker running at slightly below its maximum throughput for a period of 24 hours. Their purpose is to check that the broker remains stable under load for a reasonable duration, in order to provide some confidence in the long-term stability of its process. These tests are intended to be run as a two step process. The first two tests run for 10 minutes and are used to asses the broker throughput for the test. The output from these tests are to be fed into the rate limiter for the second set of tests, so that the broker may be set up to run at slightly below its maximum throughput for the 24 hour duration. It is suggested that 90% of the rate achieved by the first two tests should be used for this.
-
-The client scaling tests are split into two sub-sections. The first section tests the performance of increasing numbers of client connections, each sending at a fixed rate. The purpose of this is to determine the brokers saturation load, and to evaluate how its performance degrades uder higher loads. The second section varies the fan-out or fan-in ratio of the number of sending clients to receving clients. This is primarily intended to test the pubsub messaging model, but the tests are also run in p2p mode (with each message being received by one consumer), for completeness and to provide a comparison with the pubsub performance.
-
-The message size scaling tests, examine the brokers performance with different message payload sizes. The purpose of these tests is to evaluate where the broker process switches from being an io-bound to a cpu-bound process (if at all). The expected model is that the amount of CPU processing the broker has to carry out depends largely on the number of messages, and not on their size, because it carries out de-framing and routing for each message header but just copies payloads in-place or in a tight instruction loop. Therefore large message should be io-bound and a constant data rate through the broker should be seen for messages larger than the io/cpu threshold. Small messages require more processing so a constant message rate should be seen for message smaller than the io/cpu threshold. If the broker implementation is extremely efficient the threshold may dissapear altogether and the broker will be purely io-bound.
-The final variation, which is applied to all tests, is to run a transactional and non-transactional version of each. Messages are always batched into transactions of 100 messages each.
-
-Running the entire test suite can take some time, in particular their are about 4 24 hour burn-in tests. There are also 8 30 minute client scaling ramp up tests. If you want to run the test for a short time, to skim test that they work on your environment a command line like the following is usefull:
-
-> find . -name '*.sh' -exec {} -d10S \;
-
-If you want to run just a sub-set of the tests, you can use variations of the above command line. For example, to run just the message size tests using persistent p2p messaging do:
-
-> find . -name 'PPM-*.sh' -exec {} \;
-
-and so on.
-
-Interpreting the Results
-------------------------
-
-TODO: Explain what the results are expected to show and how to look for it. What should be graphed to get a visualization of the broker performance. How to turn the measurements into a description of the performance 'envelope'. \ No newline at end of file
diff --git a/M4-RCs/qpid/java/perftests/bin/run_many.sh b/M4-RCs/qpid/java/perftests/bin/run_many.sh
deleted file mode 100755
index cca2ffec21..0000000000
--- a/M4-RCs/qpid/java/perftests/bin/run_many.sh
+++ /dev/null
@@ -1,30 +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.
-#
-
-
-# args:
-# <number of processes to start>
-# <name of run>
-# <command ro run>
-
-for i in `seq 1 $1`; do
- $3 >$2.$i.out 2>>$2.err &
- echo $! > $2.$i.pid
-done;
diff --git a/M4-RCs/qpid/java/perftests/bin/topicListener.sh b/M4-RCs/qpid/java/perftests/bin/topicListener.sh
deleted file mode 100755
index 3a925910ad..0000000000
--- a/M4-RCs/qpid/java/perftests/bin/topicListener.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-
-# XXX -Xmx512m -Xms512m -XX:NewSize=150m
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
-
-# Set other variables used by the qpid-run script before calling
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM="-Xmx128m -Dlog4j.configuration=$HOME/log4j.properties" \
- JAVA_GC="-XX:-UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError" \
- QPID_CLASSPATH=$QPID_LIBS
-
-. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.oldtopic.Listener $*
diff --git a/M4-RCs/qpid/java/perftests/bin/topicPublisher.sh b/M4-RCs/qpid/java/perftests/bin/topicPublisher.sh
deleted file mode 100755
index e4e9981a75..0000000000
--- a/M4-RCs/qpid/java/perftests/bin/topicPublisher.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-# XXX -Xmx512m -Xms512m -XX:NewSize=150m
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
-
-# Set other variables used by the qpid-run script before calling
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM=-Xmx128m \
- JAVA_GC="-XX:-UseConcMarkSweepGC -XX:+HeapDumpOnOutOfMemoryError" \
- QPID_CLASSPATH=$QPID_LIBS
-
-. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.oldtopic.Publisher $*
diff --git a/M4-RCs/qpid/java/perftests/build.xml b/M4-RCs/qpid/java/perftests/build.xml
deleted file mode 100644
index b38201f5da..0000000000
--- a/M4-RCs/qpid/java/perftests/build.xml
+++ /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.
- -
- -->
-<project name="Performance Tests" default="build">
-
- <property name="module.depends" value="systests client broker common junit-toolkit"/>
-
- <import file="../module.xml"/>
-
- <property name="xms" value="-Xms256m"/>
- <property name="xmx" value="-Xmx1024m"/>
- <property name="test.logging.level" value="-Damqj.test.logging.level=info"/>
- <property name="qpid.logging.level" value="-Damqj.logging.level=warn"/>
- <property name="log4j.config" value="-Dlog4j.configuration=perftests.log4j"/>
- <property name="properties" value="perftests.properties"/>
- <property name="scripts.dir" value="${build.bin}/${module.name}"/>
-
- <condition property="results" value="${result-path}/results" else="${project.root}/${module}/results">
- <isset property="result-path"/>
- </condition>
-
- <target name="precompile">
- <mkdir dir="${scripts.dir}"/>
- <jython path="${mllib.dir}">
- <args>
- <arg value="generate-scripts"/>
- <arg value="scripts.xml"/>
- <arg value="${scripts.dir}"/>
- </args>
- </jython>
- </target>
-
- <target name="all-tests" depends="all-queue-tests,all-topic-tests"/>
-
- <target name="all-queue-tests" depends="Queue-Duration-Persistent,Queue-Concurrent,
- Queue-Duration,Queue-Latency,Queue-Duration-Transacted,Queue-LargeMessage-Persistent"/>
-
- <target name="all-topic-tests" depends="Topic-Concurrent,Topic-Duration,Topic-Latency,
- Topic-Duration-Transacted"/>
-
- <!-- Queue tests -->
-
- <!--
- Send 10000 (.5K) messages and measure the time for receiving 1000 messages (10 intervals)
- the overall latency is also calculated (See Test * Size Throughput)
- Note that "Test Throughput" is the average time for receiving 1000 messages
- -->
- <target name="Queue-Latency" depends="build" description="Run Queue-Latency">
- <java classname="org.apache.qpid.junit.extensions.TKTestRunner" fork="true">
- <classpath refid="module.test.path"/>
- <jvmarg value="${xms}"/>
- <jvmarg value="${xmx}"/>
- <jvmarg value="${test.logging.level}"/>
- <jvmarg value="${qpid.logging.level}"/>
- <jvmarg value="${log4j.config}"/>
- <!-- args -->
- <arg value="-n Queue-Latency"/>
- <arg value="-s[10000]"/>
- <arg value="-t testPingLatency"/>
- <arg value="-o${results}"/>
- <arg value="--csv"/>
- <arg value="org.apache.qpid.ping.PingLatencyTestPerf"/>
- <arg value="rate=100"/>
- <arg value="batchSize=1000"/>
- <arg value="messageSize=512"/>
- </java>
- </target>
-
- <!--
- Measure the time required for one producer/consumer pair
- for sending and receiving 10000 transient messages.
- The test last for 5 minutes.
- -->
- <target name="Queue-Duration" depends="build" description="">
- <java classname="org.apache.qpid.junit.extensions.TKTestRunner" fork="true">
- <classpath refid="module.test.path"/>
- <jvmarg value="${xms}"/>
- <jvmarg value="${xmx}"/>
- <jvmarg value="${test.logging.level}"/>
- <jvmarg value="${qpid.logging.level}"/>
- <jvmarg value="${log4j.config}"/>
- <!-- args -->
- <arg value="-d5M"/>
- <arg value="-n Queue-Duration"/>
- <arg value="-s[1000]"/>
- <arg value="-t testAsyncPingOk"/>
- <arg value="-o${results}"/>
- <arg value="--csv"/>
- <arg value="org.apache.qpid.ping.PingAsyncTestPerf"/>
- <arg value="messageSize=512"/>
- </java>
- </target>
-
- <!--
- Measure the time required for one producer/consumer pair
- for sending and receiving 10000 0.5K persistent messages.
- The test last for 5 minutes.
- -->
- <target name="Queue-Duration-Persistent" depends="build" description="">
- <java classname="org.apache.qpid.junit.extensions.TKTestRunner" fork="true">
- <classpath refid="module.test.path"/>
- <jvmarg value="${xms}"/>
- <jvmarg value="${xmx}"/>
- <jvmarg value="${test.logging.level}"/>
- <jvmarg value="${qpid.logging.level}"/>
- <jvmarg value="${log4j.config}"/>
- <!-- args -->
- <arg value="-d5M"/>
- <arg value="-n Queue-Duration-Persistent"/>
- <arg value="-s[1000]"/>
- <arg value="-t testAsyncPingOk"/>
- <arg value="-o${results}"/>
- <arg value="--csv"/>
- <arg value="org.apache.qpid.ping.PingAsyncTestPerf"/>
- <arg value="persistent=true"/>
- <arg value="messageSize=512"/>
- </java>
- </target>
-
- <!--
- Measure the time required for one producer/consumer pair
- for sending and receiving 10000 100K persistent messages.
- The test last for 5 minutes.
- -->
- <target name="Queue-LargeMessage-Persistent" depends="build" description="">
- <java classname="org.apache.qpid.junit.extensions.TKTestRunner" fork="true">
- <classpath refid="module.test.path"/>
- <jvmarg value="${xms}"/>
- <jvmarg value="${xmx}"/>
- <jvmarg value="${test.logging.level}"/>
- <jvmarg value="${qpid.logging.level}"/>
- <jvmarg value="${log4j.config}"/>
- <!-- args -->
- <arg value="-d5M"/>
- <arg value="-n Queue-LargeMessage-Persistent"/>
- <arg value="-s[1000]"/>
- <arg value="-t testAsyncPingOk"/>
- <arg value="-o${results}"/>
- <arg value="--csv"/>
- <arg value="org.apache.qpid.ping.PingAsyncTestPerf"/>
- <arg value="persistent=true"/>
- <arg value="messageSize=102400"/>
- </java>
- </target>
-
- <!--
- Measure the time required for one (transacted producer)/(Transacted consumer) pair
- for sending and receiving 10000 (0.5K) persistent messages.
- Tx batch size is 100 (consumer and producer)
- The test last for 5 minutes.
- -->
- <target name="Queue-Duration-Transacted" depends="build" description="">
- <java classname="org.apache.qpid.junit.extensions.TKTestRunner" fork="true">
- <classpath refid="module.test.path"/>
- <jvmarg value="${xms}"/>
- <jvmarg value="${xmx}"/>
- <jvmarg value="${test.logging.level}"/>
- <jvmarg value="${qpid.logging.level}"/>
- <jvmarg value="${log4j.config}"/>
- <!-- args -->
- <arg value="-d5M"/>
- <arg value="-n Queue-Duration-Transacted"/>
- <arg value="-s[1000]"/>
- <arg value="-t testAsyncPingOk"/>
- <arg value="-o${results}"/>
- <arg value="--csv"/>
- <arg value="org.apache.qpid.ping.PingAsyncTestPerf"/>
- <arg value="persistent=true"/>
- <arg value="transacted=true"/>
- <arg value="batchSize=100"/>
- <arg value="consTransacted=true"/>
- <arg value="commitBatchSize=100"/>
- <arg value="messageSize=512"/>
- </java>
- </target>
-
- <!--
- Measure the time for four concurrent producer/receiver pairs to send and receive 1000 transient messages
- -->
- <target name="Queue-Concurrent" depends="build" description="">
- <java classname="org.apache.qpid.junit.extensions.TKTestRunner" fork="true">
- <classpath refid="module.test.path"/>
- <jvmarg value="${xms}"/>
- <jvmarg value="${xmx}"/>
- <jvmarg value="${test.logging.level}"/>
- <jvmarg value="${qpid.logging.level}"/>
- <jvmarg value="${log4j.config}"/>
- <!-- args -->
- <arg value="-r1"/>
- <arg value="-n Queue-Concurrent"/>
- <arg value="-s[1000]"/>
- <arg value="-c[4]"/>
- <arg value="-t testAsyncPingOk"/>
- <arg value="-o${results}"/>
- <arg value="--csv"/>
- <arg value="org.apache.qpid.ping.PingAsyncTestPerf"/>
- <arg value="messageSize=512"/>
- </java>
- </target>
-
-
- <!-- Topic tests -->
-
- <!--
- Send 10000 (.5K) messages and measure the time for receiving 1000 messages (10 intervals)
- the overall latency is also calculated (See Test * Size Throughput)
- Note that "Test Throughput" is the average time for receiving 1000 messages
- -->
- <target name="Topic-Latency" depends="build" description="Run Queue-Latency">
- <java classname="org.apache.qpid.junit.extensions.TKTestRunner" fork="true">
- <classpath refid="module.test.path"/>
- <jvmarg value="${xms}"/>
- <jvmarg value="${xmx}"/>
- <jvmarg value="${test.logging.level}"/>
- <jvmarg value="${qpid.logging.level}"/>
- <jvmarg value="${log4j.config}"/>
- <!-- args -->
- <arg value="-n Topic-Latency"/>
- <arg value="-s[10000]"/>
- <arg value="-t testPingLatency"/>
- <arg value="-o${results}"/>
- <arg value="--csv"/>
- <arg value="org.apache.qpid.ping.PingLatencyTestPerf"/>
- <arg value="rate=100"/>
- <arg value="batchSize=1000"/>
- <arg value="messageSize=512"/>
- <arg value="pubsub=true"/>
- </java>
- </target>
-
- <!--
- Measure the time required for one producer/consumer pair
- for sending and receiving 10000 transient messages.
- The test last for 5 minutes.
- -->
- <target name="Topic-Duration" depends="build" description="">
- <java classname="org.apache.qpid.junit.extensions.TKTestRunner" fork="true">
- <classpath refid="module.test.path"/>
- <jvmarg value="${xms}"/>
- <jvmarg value="${xmx}"/>
- <jvmarg value="${test.logging.level}"/>
- <jvmarg value="${qpid.logging.level}"/>
- <jvmarg value="${log4j.config}"/>
- <!-- args -->
- <arg value="-d5M"/>
- <arg value="-n Topic-Duration"/>
- <arg value="-s[1000]"/>
- <arg value="-t testAsyncPingOk"/>
- <arg value="-o${results}"/>
- <arg value="--csv"/>
- <arg value="org.apache.qpid.ping.PingAsyncTestPerf"/>
- <arg value="messageSize=512"/>
- <arg value="pubsub=true"/>
- </java>
- </target>
-
- <!--
- Measure the time required for one (transacted producer)/(Transacted consumer) pair
- for sending and receiving 10000 (0.5K) persistent messages.
- Tx batch size is 100 (consumer and producer)
- The test last for 5 minutes.
- -->
- <target name="Topic-Duration-Transacted" depends="build" description="">
- <java classname="org.apache.qpid.junit.extensions.TKTestRunner" fork="true">
- <classpath refid="module.test.path"/>
- <jvmarg value="${xms}"/>
- <jvmarg value="${xmx}"/>
- <jvmarg value="${test.logging.level}"/>
- <jvmarg value="${qpid.logging.level}"/>
- <jvmarg value="${log4j.config}"/>
- <!-- args -->
- <arg value="-d5M"/>
- <arg value="-n Topic-Duration-Transacted"/>
- <arg value="-s[1000]"/>
- <arg value="-t testAsyncPingOk"/>
- <arg value="-o${results}"/>
- <arg value="--csv"/>
- <arg value="org.apache.qpid.ping.PingAsyncTestPerf"/>
- <arg value="persistent=true"/>
- <arg value="transacted=true"/>
- <arg value="batchSize=100"/>
- <arg value="consTransacted=true"/>
- <arg value="commitBatchSize=100"/>
- <arg value="messageSize=512"/>
- </java>
- </target>
-
- <!--
- Measure the time for four concurrent producer/receiver pairs to send and receive 1000 transient messages
- -->
- <target name="Topic-Concurrent" depends="build" description="">
- <java classname="org.apache.qpid.junit.extensions.TKTestRunner" fork="true">
- <classpath refid="module.test.path"/>
- <jvmarg value="${xms}"/>
- <jvmarg value="${xmx}"/>
- <jvmarg value="${test.logging.level}"/>
- <jvmarg value="${qpid.logging.level}"/>
- <jvmarg value="${log4j.config}"/>
- <!-- args -->
- <arg value="-r1"/>
- <arg value="-n Topic-Concurrent"/>
- <arg value="-s[1000]"/>
- <arg value="-c[4]"/>
- <arg value="-t testAsyncPingOk"/>
- <arg value="-o${results}"/>
- <arg value="--csv"/>
- <arg value="org.apache.qpid.ping.PingAsyncTestPerf"/>
- <arg value="messageSize=512"/>
- </java>
- </target>
-
-</project>
diff --git a/M4-RCs/qpid/java/perftests/dist-zip.xml b/M4-RCs/qpid/java/perftests/dist-zip.xml
deleted file mode 100644
index 0039bfb157..0000000000
--- a/M4-RCs/qpid/java/perftests/dist-zip.xml
+++ /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.
--->
-<!-- This is an assembly descriptor that produces a zip containing all the test scripts and
- the all dependencies jar. -->
-<assembly>
- <id>perftests</id>
- <formats>
- <format>zip</format>
- <format>tar.gz</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>target</directory>
- <outputDirectory>PerformanceTests</outputDirectory>
- <includes>
- <include>qpid-perftests-${qpid.version}-all-test-deps.jar</include>
- <include>*.sh</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>etc/scripts</directory>
- <outputDirectory>PerformanceTests</outputDirectory>
- <includes>
- <include>*.sh</include>
- </includes>
- </fileSet>
- </fileSets>
-</assembly>
diff --git a/M4-RCs/qpid/java/perftests/etc/jndi/activemq.properties b/M4-RCs/qpid/java/perftests/etc/jndi/activemq.properties
deleted file mode 100644
index 281577c4a8..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/jndi/activemq.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
-java.naming.provider.url= tcp://localhost:61616
-
diff --git a/M4-RCs/qpid/java/perftests/etc/jndi/failovertest.properties b/M4-RCs/qpid/java/perftests/etc/jndi/failovertest.properties
deleted file mode 100644
index b437d12062..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/jndi/failovertest.properties
+++ /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.
-
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-connectionfactory.local = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5001;tcp://localhost:5002'
diff --git a/M4-RCs/qpid/java/perftests/etc/jndi/perftests.properties b/M4-RCs/qpid/java/perftests/etc/jndi/perftests.properties
deleted file mode 100644
index a2348f4547..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/jndi/perftests.properties
+++ /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.
-
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-connectionfactory.local = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
diff --git a/M4-RCs/qpid/java/perftests/etc/jndi/swiftmq.properties b/M4-RCs/qpid/java/perftests/etc/jndi/swiftmq.properties
deleted file mode 100644
index 2d037a2513..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/jndi/swiftmq.properties
+++ /dev/null
@@ -1,20 +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.
-
-java.naming.factory.initial = com.swiftmq.jndi.InitialContextFactoryImpl
-java.naming.provider.url=smqp://localhost:4001/timeout=10000
-#connectionfactory.local = amqp://guest:guest@clientid/test?brokerlist='tcp://localhost:5672'
diff --git a/M4-RCs/qpid/java/perftests/etc/perftests.log4j b/M4-RCs/qpid/java/perftests/etc/perftests.log4j
deleted file mode 100644
index af8c1b0784..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/perftests.log4j
+++ /dev/null
@@ -1,46 +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.
-#
-log4j.rootLogger=${root.logging.level}
-
-
-log4j.logger.org.apache.mina=${amqj.logging.level}
-
-log4j.logger.org.apache.qpid=${amqj.logging.level}, console
-log4j.additivity.org.apache.qpid=false
-
-log4j.logger.org.apache.qpid.requestreply=${amqj.test.logging.level}
-log4j.logger.org.apache.qpid.pingpong=${amqj.test.logging.level}
-log4j.logger.org.apache.qpid.ping=${amqj.test.logging.level}
-log4j.logger.org.apache.qpid.topic=${amqj.test.logging.level}
-
-log4j.logger.org.apache.qpid.junit.extensions=${badger.level}, console
-log4j.additivity.org.apache.qpid.junit.extensions=false
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=all
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-
-log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n
-#log4j.appender.console.layout.ConversionPattern=%t %p [%c] %m%n
-
-log4j.appender.fileApp=org.apache.log4j.FileAppender
-log4j.appender.fileApp.file=${log.dir}/perftests.volumetest.log
-log4j.appender.fileApp.Threshold=info
-log4j.appender.fileApp.append=false
-log4j.appender.fileApp.layout=org.apache.log4j.PatternLayout
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-1.sh b/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-1.sh
deleted file mode 100755
index 057dec5c63..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-1.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-./PQ-Qpid-1.sh $@ & ./PQ-Qpid-1-P.sh $@
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-2.sh b/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-2.sh
deleted file mode 100755
index 08057cbf44..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-2.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-./PQ-Qpid-2.sh $@ & ./PQ-Qpid-2-P.sh $@
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-3.sh b/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-3.sh
deleted file mode 100755
index 0bb7e25197..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-3.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-./PQ-Qpid-3.sh $@ & ./PQ-Qpid-3-P.sh $@
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-4.sh b/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-4.sh
deleted file mode 100755
index 278e44d12b..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-4.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-./PQ-Qpid-4.sh $@ & ./PQ-Qpid-4-P.sh $@
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-5.sh b/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-5.sh
deleted file mode 100755
index 5dee0176b2..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-5.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-./PQ-Qpid-5.sh $@ & ./PQ-Qpid-5-P.sh $@
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-6.sh b/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-6.sh
deleted file mode 100755
index b9996da77d..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/CTQ-Qpid-6.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-./PQ-Qpid-6.sh $@ & ./PQ-Qpid-6-P.sh $@
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/Connections.sh b/M4-RCs/qpid/java/perftests/etc/scripts/Connections.sh
deleted file mode 100755
index 17e69166bf..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/Connections.sh
+++ /dev/null
@@ -1,20 +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.
-#
-find . -regex '\.\/[P|T].CT-.*\.sh' -exec {} -o results-Connections/ --csv \;
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/JobQueue.sh b/M4-RCs/qpid/java/perftests/etc/scripts/JobQueue.sh
deleted file mode 100755
index 312037f5ab..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/JobQueue.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-find . -regex '.*BL-.*\.sh' -exec {} -o results-JobQueue/ --csv \;
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/Latency.sh b/M4-RCs/qpid/java/perftests/etc/scripts/Latency.sh
deleted file mode 100755
index f70131de38..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/Latency.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-find . -regex '\.\/[P|T].CL-.*\.sh' -exec {} -o results-Latency/ --csv \;
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/MessageSize.sh b/M4-RCs/qpid/java/perftests/etc/scripts/MessageSize.sh
deleted file mode 100755
index bb10822257..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/MessageSize.sh
+++ /dev/null
@@ -1,20 +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.
-#
-find . -regex '.*M-Qpid-.*\.sh' -exec {} -o results-messageSize/ --csv $* \;
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/PT-Qpid-13.sh b/M4-RCs/qpid/java/perftests/etc/scripts/PT-Qpid-13.sh
deleted file mode 100755
index df35f718b9..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/PT-Qpid-13.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-# Parse arguements taking all - prefixed args as JAVA_OPTS
-for arg in "$@"; do
- if [[ $arg == -java:* ]]; then
- JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2` "
- else
- ARGS="${ARGS}$arg "
- fi
-done
-
-echo "Starting 6 parallel tests"
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-13.1 -s [250] -c[200] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256 destinationName=newd1 uniqueDests=true batchSize=250 transacted=true commitBatchSize=50 -o $QPID_WORK/results ${ARGS} &
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-13.2 -s [250] -c[200] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256 destinationName=newd2 uniqueDests=true batchSize=250 transacted=true commitBatchSize=50 -o $QPID_WORK/results ${ARGS} &
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-13.3 -s [250] -c[200] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256 destinationName=newd3 uniqueDests=true batchSize=250 transacted=true commitBatchSize=50 -o $QPID_WORK/results ${ARGS} &
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-13.4 -s [250] -c[200] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256 destinatioNname=newd4 uniqueDests=true batchSize=250 transacted=true commitBatchSize=50 -o $QPID_WORK/results ${ARGS} &
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-13.5 -s [250] -c[100] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256 destinationName=newd5 uniqueDests=true batchSize=250 transacted=true commitBatchSize=50 -o $QPID_WORK/results ${ARGS} &
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-13.6 -s [250] -c[100] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256 destinationName=newd6 uniqueDests=true batchSize=250 transacted=true commitBatchSize=50 -o $QPID_WORK/results ${ARGS}
-
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/PT-Qpid-14.sh b/M4-RCs/qpid/java/perftests/etc/scripts/PT-Qpid-14.sh
deleted file mode 100755
index ff5b8a76f9..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/PT-Qpid-14.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-# Parse arguements taking all - prefixed args as JAVA_OPTS
-for arg in "$@"; do
- if [[ $arg == -java:* ]]; then
- JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2` "
- else
- ARGS="${ARGS}$arg "
- fi
-done
-echo "Starting 6 parallel tests"
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-14 -s [250] -c[200] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256 destinationName=ping1 batchSize=250 -o $QPID_WORK/results ${ARGS} &
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-14 -s [250] -c[200] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256 destinationName=ping2 batchSize=250 -o $QPID_WORK/results ${ARGS} &
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-14 -s [250] -c[200] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256 destinationName=ping3 batchSize=250 -o $QPID_WORK/results ${ARGS} &
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-14 -s [250] -c[200] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256destinationname=ping4 batchSize=250 -o $QPID_WORK/results ${ARGS} &
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-14 -s [250] -c[100] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256 destinationName=ping5 batchSize=250 -o $QPID_WORK/results ${ARGS} &
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx3072m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.junit.extensions.TKTestRunner -n PT-Qpid-14 -s [250] -c[100] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true messageSize=256 destinationName=ping6 batchSize=250 -o $QPID_WORK/results ${ARGS}
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/Reliability.sh b/M4-RCs/qpid/java/perftests/etc/scripts/Reliability.sh
deleted file mode 100755
index 9e5e508743..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/Reliability.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-find . -regex '.*R-Qpid-0[1-8].*\.sh' -exec {} -o results-Reliability/ --csv \;
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/RunAll.sh b/M4-RCs/qpid/java/perftests/etc/scripts/RunAll.sh
deleted file mode 100755
index 60c04e3ed7..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/RunAll.sh
+++ /dev/null
@@ -1,25 +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.
-#
-Connections.sh && \
-JobQueue.sh && \
-Latency.sh && \
-MessageSize.sh && \
-Reliability.sh && \
-Throughput.sh
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/Test-ActiveMQ.sh b/M4-RCs/qpid/java/perftests/etc/scripts/Test-ActiveMQ.sh
deleted file mode 100644
index 27e0411870..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/Test-ActiveMQ.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-# Parse arguements taking all - prefixed args as JAVA_OPTS
-for arg in "$@"; do
- if [[ $arg == -java:* ]]; then
- JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2` "
- else
- ARGS="${ARGS}$arg "
- fi
-done
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx1024m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp "qpid-perftests-1.0-incubating-M2.1-SNAPSHOT.jar;activemq-jars/apache-activemq-4.1.1.jar" org.apache.qpid.junit.extensions.TKTestRunner -n Test-ActiveMQ -s[1] -r 1 -t testAsyncPingOk -o . org.apache.qpid.ping.PingAsyncTestPerf properties=activemq.properties factoryName=ConnectionFactory ${ARGS}
-
-# queueNamePostfix=@router1 overrideClientId=true
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/Test-SwiftMQ.sh b/M4-RCs/qpid/java/perftests/etc/scripts/Test-SwiftMQ.sh
deleted file mode 100644
index 1f0b38ccc2..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/Test-SwiftMQ.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-# Parse arguements taking all - prefixed args as JAVA_OPTS
-for arg in "$@"; do
- if [[ $arg == -java:* ]]; then
- JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2` "
- else
- ARGS="${ARGS}$arg "
- fi
-done
-
-java -Xms256m -Dlog4j.configuration=perftests.log4j -Xmx1024m -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn ${JAVA_OPTS} -cp "qpid-perftests-1.0-incubating-M2.1-SNAPSHOT.jar;swiftmqjars/swiftmq.jar" org.apache.qpid.junit.extensions.TKTestRunner -n Test-SwiftMQ -s[1] -r 1 -t testAsyncPingOk -o . org.apache.qpid.ping.PingAsyncTestPerf properties=swiftmq.properties factoryName=ConnectionFactory queueNamePostfix=@router1 overrideClientId=true ${ARGS}
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/Throughput.sh b/M4-RCs/qpid/java/perftests/etc/scripts/Throughput.sh
deleted file mode 100755
index d08ad248a5..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/Throughput.sh
+++ /dev/null
@@ -1,20 +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.
-#
-find . -regex '.*[P|T].BT-.*\.sh' -exec {} -o results-throughput/ --csv $* \;
diff --git a/M4-RCs/qpid/java/perftests/etc/scripts/sendAndWaitClient.sh b/M4-RCs/qpid/java/perftests/etc/scripts/sendAndWaitClient.sh
deleted file mode 100755
index af4b788658..0000000000
--- a/M4-RCs/qpid/java/perftests/etc/scripts/sendAndWaitClient.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-#
-
-$JAVA_HOME/bin/java -Dlog4j.configuration=backup-log4j.xml -cp qpid-perftests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar org.apache.qpid.ping.PingSendOnlyClient messageSize=512
diff --git a/M4-RCs/qpid/java/perftests/generate-scripts b/M4-RCs/qpid/java/perftests/generate-scripts
deleted file mode 100644
index 3d12cc13c3..0000000000
--- a/M4-RCs/qpid/java/perftests/generate-scripts
+++ /dev/null
@@ -1,74 +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, sys, mllib
-
-template = """#!/bin/bash
-#
-# 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.
-#
-
-if [ -z "$QPID_HOME" ]; then
- export QPID_HOME=$(dirname $(dirname $(dirname $(readlink -f $0))))
- export PATH=${PATH}:${QPID_HOME}/bin
-fi
-
-# Parse arguements taking all - prefixed args as JAVA_OPTS
-for arg in "$@"; do
- if [[ $arg == -java:* ]]; then
- JAVA_OPTS="${JAVA_OPTS}-`echo $arg|cut -d ':' -f 2` "
- else
- ARGS="${ARGS}$arg "
- fi
-done
-
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
-
-# Set other variables used by the qpid-run script before calling
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM=-Xmx1024m \
- QPID_CLASSPATH=$QPID_LIBS
-
-. qpid-run -Xms256m -Dlog4j.configuration=file://${QPID_HOME}/etc/perftests.log4j -Dbadger.level=warn -Damqj.test.logging.level=info -Damqj.logging.level=warn org.apache.qpid.junit.extensions.TKTestRunner %s ${ARGS}
-"""
-
-doc = mllib.xml_parse(sys.argv[1])
-dir = sys.argv[2]
-for s in doc.query["scripts/script"]:
- file = open(os.path.join(dir, "%s.sh" % s["@name"]), "w")
- file.write(template % s.text())
- file.close()
diff --git a/M4-RCs/qpid/java/perftests/jar-with-dependencies.xml b/M4-RCs/qpid/java/perftests/jar-with-dependencies.xml
deleted file mode 100644
index bbbbd3788e..0000000000
--- a/M4-RCs/qpid/java/perftests/jar-with-dependencies.xml
+++ /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.
--->
-<!-- This is an assembly descriptor that produces a distribution that contains all the
- dependencies, with a manifest only jar that references them, required to run the
- tests of a maven project.
--->
-<assembly>
- <id>all-test-deps</id>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <outputDirectory>/</outputDirectory>
- <unpack>false</unpack>
- <scope>test</scope>
- </dependencySet>
- </dependencySets>
- <fileSets>
- <fileSet>
- <directory>target/classes</directory>
- <outputDirectory></outputDirectory>
- </fileSet>
- <fileSet>
- <directory>target/test-classes</directory>
- <outputDirectory></outputDirectory>
- </fileSet>
-
- <!-- Include all the test scripts, both generated and hand-written. -->
- <fileSet>
- <directory>target</directory>
- <outputDirectory></outputDirectory>
- <includes>
- <include>*.sh</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>etc/scripts</directory>
- <outputDirectory></outputDirectory>
- <includes>
- <include>*.sh</include>
- </includes>
- </fileSet>
-
- <!-- Include all jndi configurations needed to run the tests. -->
- <fileSet>
- <directory>etc/jndi</directory>
- <outputDirectory></outputDirectory>
- <includes>
- <include>*.properties</include>
- </includes>
- </fileSet>
-
- <!-- Include the build artifact. -->
- <fileSet>
- <directory>target</directory>
- <outputDirectory></outputDirectory>
- <includes>
- <include>qpid-perftests-1.0-incubating-M2-SNAPSHOT.jar</include>
- </includes>
- </fileSet>
-
- <!-- Include the manifest with classpath jar. -->
- <fileSet>
- <directory>target</directory>
- <outputDirectory></outputDirectory>
- <includes>
- <include>qpid-perftests-${qpid.version}.jar</include>
- </includes>
- </fileSet>
-
- </fileSets>
-</assembly>
diff --git a/M4-RCs/qpid/java/perftests/scripts.xml b/M4-RCs/qpid/java/perftests/scripts.xml
deleted file mode 100644
index 9a5163c598..0000000000
--- a/M4-RCs/qpid/java/perftests/scripts.xml
+++ /dev/null
@@ -1,328 +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.
- -
- -->
-
-<scripts>
- <!-- Single pings. These can be scaled up by overriding the parameters when calling the test script. -->
- <script name="Ping-Once">-n Ping-Once -s[1] -r 1 -t testPingOk -o . org.apache.qpid.ping.PingTestPerf</script>
- <script name="Ping-Once-Async">-n Ping-Once-Async -s[1] -r 1 -t testAsyncPingOk -o . org.apache.qpid.ping.PingAsyncTestPerf</script>
- <script name="Ping-Latency">-n Ping-Latency -s[1000] -d10S -t testPingLatency -o . org.apache.qpid.ping.PingLatencyTestPerf rate=100 batchSize=100</script>
-
- <!-- More example Tests. These are examples to exercise all the features of the test harness. Can scale up with option overrides. -->
- <script name="Ping-Tx">-n Ping-Tx -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf transacted=true</script>
- <script name="Ping-Size">-n Ping-Size -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=512</script>
- <script name="Ping-Concurrent">-n Ping-Concurrent -s[100] -c [4] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf</script>
- <script name="Ping-Many-Queues">-n Ping-Many-Queues -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf destinationCount=4</script>
- <script name="Ping-Duration">-n Ping-Duration -s[100] -d10S -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf</script>
- <script name="Ping-Rate">-n Ping-Rate -s[100] -d10S -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf rate=500</script>
- <script name="Ping-PubSub">-n Ping-PubSub -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true</script>
- <script name="Ping-Many-Topics">-n Ping-Many-Topics -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true destinationCount=4</script>
- <script name="Ping-Persistent">-n Ping-Persistent -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true</script>
- <script name="Ping-Batch-Logging">-n Ping-Batch-Logging -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf batchSize=10</script>
- <script name="Ping-Failover-Before-Send">-n Ping-Failover-Before-Send -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf commitBatchSize=10 failBeforeSend=true</script>
- <script name="Ping-Failover-After-Send">-n Ping-Failover-After-Send -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf commitBatchSize=10 failAfterSend=true</script>
- <script name="Ping-Failover-Before-Commit">-n Ping-Failover-Before-Commit -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf commitBatchSize=10 failBeforeCommit=true</script>
- <script name="Ping-Failover-After-Commit">-n Ping-Failover-After-Commit -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf commitBatchSize=10 failAfterCommit=true</script>
-
- <!--
- ***** If editing below, please use a non line wrapping mode and keep in columns, makes it easier to check for consistent
- ***** parameter setting accross all of the tests.
- -->
-
- <!--
- Reliability tests. The longer these tests can be run, the better.
- Tests 01 and 02 run for a short time. Use these to get an idea of the expected throughput.
- Tests 03 to 08 test all ack modes, transient/persistent, p2p/pubsub. There are 24 tests in total running for 1 hour each.
- This can be shortened or lengthened for the desired burn-in test time.
- -->
- <script name="TQR-Qpid-01">-n TQR-Qpid-01 -d1M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TQR-Qpid-02">-n TQR-Qpid-02 -d1M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TTR-Qpid-01">-n TTR-Qpid-01 -d1M -s[100] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=8 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TTR-Qpid-02">-n TTR-Qpid-02 -d1M -s[100] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PQR-Qpid-01">-n PQR-Qpid-01 -d1M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PQR-Qpid-02">-n PQR-Qpid-02 -d1M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PTR-Qpid-01">-n PTR-Qpid-01 -d1M -s[100] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=8 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PTR-Qpid-02">-n PTR-Qpid-02 -d1M -s[100] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
-
- <script name="TQR-Qpid-03-TX">-n TQR-Qpid-03 -d1H -s[10000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TQR-Qpid-04-AUTOACK">-n TQR-Qpid-04 -d1H -s[10000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TQR-Qpid-05-CLIENTACK">-n TQR-Qpid-05 -d1H -s[10000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=2 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TQR-Qpid-06-DUPSOKACK">-n TQR-Qpid-06 -d1H -s[10000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=3 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TQR-Qpid-07-NOACK">-n TQR-Qpid-07 -d1H -s[10000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=257 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TQR-Qpid-08-PREACK">-n TQR-Qpid-08 -d1H -s[10000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=258 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
-
- <script name="TTR-Qpid-03-TX">-n TTR-Qpid-03 -d1H -s[1000] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=8 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TTR-Qpid-04-AUTOACK">-n TTR-Qpid-04 -d1H -s[1000] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TTR-Qpid-05-CLIENTACK">-n TTR-Qpid-05 -d1H -s[1000] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=2 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TTR-Qpid-06-DUPSOKACK">-n TTR-Qpid-06 -d1H -s[1000] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=3 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TTR-Qpid-07-NOACK">-n TTR-Qpid-07 -d1H -s[1000] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=257 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="TTR-Qpid-08-PREACK">-n TTR-Qpid-08 -d1H -s[1000] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=258 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
-
- <script name="PQR-Qpid-03-TX">-n PQR-Qpid-03 -d1H -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PQR-Qpid-04-AUTOACK">-n PQR-Qpid-04 -d1H -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PQR-Qpid-05-CLIENTACK">-n PQR-Qpid-05 -d1H -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=2 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PQR-Qpid-06-DUPSOKACK">-n PQR-Qpid-06 -d1H -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=3 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PQR-Qpid-07-NOACK">-n PQR-Qpid-07 -d1H -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=257 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PQR-Qpid-08-PREACK">-n PQR-Qpid-08 -d1H -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=258 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
-
- <script name="PTR-Qpid-03-TX">-n PTR-Qpid-03 -d1H -s[100] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=8 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PTR-Qpid-04-AUTOACK">-n PTR-Qpid-04 -d1H -s[100] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PTR-Qpid-05-CLIENTACK">-n PTR-Qpid-05 -d1H -s[100] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=2 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PTR-Qpid-06-DUPSOKACK">-n PTR-Qpid-06 -d1H -s[100] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=3 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PTR-Qpid-07-NOACK">-n PTR-Qpid-07 -d1H -s[100] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=257 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
- <script name="PTR-Qpid-08-PREACK">-n PTR-Qpid-08 -d1H -s[100] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=258 commitBatchSize=10 batchSize=100000 messageSize=256 destinationCount=1 rate=0 maxPending=500000 </script>
-
- <!-- Performance Tests. -->
-
- <!-- Transient, P2P Tests -->
- <!-- Concurrency Tests : What are the effects of increasing consumers from 1...30 consumers -->
- <script name="TQCT-Qpid-01">-n TQCT-Qpid-01 -d1M -s[1000] -c[1:30]:samples=30 -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=2000 maxPending=2000000 </script>
- <script name="TQCT-Qpid-02">-n TQCT-Qpid-02 -d1M -s[1000] -c[1:30]:samples=30 -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=2000 maxPending=2000000 </script>
- <!-- Latency Tests : What are the effects on latency of increasing consumers from 1...30 consumers -->
- <script name="TQCL-Qpid-01">-n TQCL-Qpid-01 -d1M -s[1000] -c[1:30]:samples=30 -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=2000 maxPending=2000000 </script>
- <script name="TQCL-Qpid-02">-n TQCL-Qpid-02 -d1M -s[1000] -c[1:30]:samples=30 -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=2000 maxPending=2000000 </script>
-
- <!-- <script name="TQC-Qpid-05">-n TQC-Qpid-05 -d10M -s[10] -c[100] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=10 rate=0 maxPending=100000 </script> -->
- <!-- <script name="TQC-Qpid-06">-n TQC-Qpid-06 -d10M -s[10] -c[100] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=10 rate=0 maxPending=100000 </script> -->
-
-
- <!-- Message Size Tests : Tests sending message from 512b upto 1M with Point to Point messaging -->
- <script name="TQM-Qpid-01-512b">-n TQM-Qpid-01-512b -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TQM-Qpid-02-512b">-n TQM-Qpid-02-512b -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TQM-Qpid-01-1K">-n TQM-Qpid-01-1K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TQM-Qpid-02-1K">-n TQM-Qpid-02-1K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TQM-Qpid-01-5K">-n TQM-Qpid-01-5K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TQM-Qpid-02-5K">-n TQM-Qpid-02-5K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TQM-Qpid-01-10K">-n TQM-Qpid-01-10K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TQM-Qpid-02-10K">-n TQM-Qpid-02-10K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TQM-Qpid-01-50K">-n TQM-Qpid-01-50K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=51200 destinationCount=1 rate=0 maxPending=100000000</script>
- <script name="TQM-Qpid-02-50K">-n TQM-Qpid-02-50K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=51200 destinationCount=1 rate=0 maxPending=100000000</script>
- <script name="TQM-Qpid-01-100K">-n TQM-Qpid-01-100K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=102400 destinationCount=1 rate=0 maxPending=100000000</script>
- <script name="TQM-Qpid-02-100K">-n TQM-Qpid-02-100K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=102400 destinationCount=1 rate=0 maxPending=100000000</script>
- <script name="TQM-Qpid-01-500K">-n TQM-Qpid-01-500K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=512000 destinationCount=1 rate=0 maxPending=100000000</script>
- <script name="TQM-Qpid-02-500K">-n TQM-Qpid-02-500K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=512000 destinationCount=1 rate=0 maxPending=100000000</script>
- <script name="TQM-Qpid-01-1M">-n TQM-Qpid-01-1M -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=1048576 destinationCount=1 rate=0 maxPending=100000000</script>
- <script name="TQM-Qpid-02-1M">-n TQM-Qpid-02-1M -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=1048576 destinationCount=1 rate=0 maxPending=100000000</script>
-
- <!-- Transient, Pub/Sub Tests -->
- <!-- Concurrency Tests : What are the effects of increasing consumers from 1...30 consumers -->
- <script name="TTCT-Qpid-01">-n TTCT-Qpid-01 -d1M -s[10] -c[1:30]:samples=30 -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=40 maxPending=2000000 </script>
- <script name="TTCT-Qpid-02">-n TTCT-Qpid-02 -d1M -s[10] -c[1:30]:samples=30 -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=40 maxPending=2000000 </script>
- <!-- Latency Tests : What are the effects on latency of increasing consumers from 1...30 consumers -->
- <script name="TTCL-Qpid-01">-n TTCL-Qpid-01 -d1M -s[10] -c[1:30]:samples=30 -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=40 maxPending=2000000 </script>
- <script name="TTCL-Qpid-02">-n TTCL-Qpid-02 -d1M -s[10] -c[1:30]:samples=30 -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=40 maxPending=2000000 </script>
-
- <!-- <script name="TTC-Qpid-05">-n TTC-Qpid-05 -d10M -s[10] -c[100] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=10 rate=0 maxPending=100000 </script> -->
- <!-- <script name="TTC-Qpid-06">-n TTC-Qpid-06 -d10M -s[10] -c[100] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=10 rate=0 maxPending=100000 </script> -->
-
- <!-- Message Size Tests : Tests sending message from 512b upto 1M with Point to Point messaging -->
- <script name="TTM-Qpid-01-512b">-n TTM-Qpid-01-512b -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TTM-Qpid-02-512b">-n TTM-Qpid-02-512b -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TTM-Qpid-01-1K">-n TTM-Qpid-01-1K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TTM-Qpid-02-1K">-n TTM-Qpid-02-1K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TTM-Qpid-01-5K">-n TTM-Qpid-01-5K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TTM-Qpid-02-5K">-n TTM-Qpid-02-5K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TTM-Qpid-01-10K">-n TTM-Qpid-01-10K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TTM-Qpid-02-10K">-n TTM-Qpid-02-10K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TTM-Qpid-01-50K">-n TTM-Qpid-01-50K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=51200 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="TTM-Qpid-02-50K">-n TTM-Qpid-02-50K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=51200 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="TTM-Qpid-01-100K">-n TTM-Qpid-01-100K -d10M -s[40] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=102400 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="TTM-Qpid-02-100K">-n TTM-Qpid-02-100K -d10M -s[40] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=102400 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="TTM-Qpid-01-500K">-n TTM-Qpid-01-500K -d10M -s[8] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=512000 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="TTM-Qpid-02-500K">-n TTM-Qpid-02-500K -d10M -s[8] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=512000 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="TTM-Qpid-01-1M">-n TTM-Qpid-01-1M -d10M -s[4] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=1048576 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="TTM-Qpid-02-1M">-n TTM-Qpid-02-1M -d10M -s[4] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=1048476 destinationCount=1 rate=0 maxPending=20000000</script>
-
- <!-- Persistent, P2P Tests -->
- <!-- Concurrency Tests : What are the effects of increasing consumers from 1...30 consumers -->
- <script name="PQCT-Qpid-01">-n PQCT-Qpid-01 -d1M -s[1000] -c[1:30]:samples=30 -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=600 maxPending=2000000 </script>
- <script name="PQCT-Qpid-02">-n PQCT-Qpid-02 -d1M -s[1000] -c[1:30]:samples=30 -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=100 maxPending=2000000 </script>
- <!-- Latency Tests : What are the effects on latency of increasing consumers from 1...30 consumers -->
- <script name="PQCL-Qpid-01">-n PQCL-Qpid-01 -d1M -s[1000] -c[1:30]:samples=30 -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=600 maxPending=2000000 </script>
- <script name="PQCL-Qpid-02">-n PQCL-Qpid-02 -d1M -s[1000] -c[1:30]:samples=30 -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=100 maxPending=2000000 </script>
-
- <!-- <script name="PQC-Qpid-05">-n PQC-Qpid-05 -d10M -s[10] -c[100] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=10 rate=0 maxPending=100000 </script> -->
- <!-- <script name="PQC-Qpid-06">-n PQC-Qpid-06 -d10M -s[10] -c[100] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=10 rate=0 maxPending=100000 </script> -->
-
- <!-- Message Size Tests : Tests sending message from 512b upto 1M with Point to Point messaging -->
- <script name="PQM-Qpid-01-512b">-n PQM-Qpid-01-512b -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PQM-Qpid-02-512b">-n PQM-Qpid-02-512b -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PQM-Qpid-01-1K">-n PQM-Qpid-01-1K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PQM-Qpid-02-1K">-n PQM-Qpid-02-1K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PQM-Qpid-01-5K">-n PQM-Qpid-01-5K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PQM-Qpid-02-5K">-n PQM-Qpid-02-5K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PQM-Qpid-01-10K">-n PQM-Qpid-01-10K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PQM-Qpid-02-10K">-n PQM-Qpid-02-10K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PQM-Qpid-01-50K">-n PQM-Qpid-01-50K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=51200 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PQM-Qpid-02-50K">-n PQM-Qpid-02-50K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=51200 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PQM-Qpid-01-100K">-n PQM-Qpid-01-100K -d10M -s[40] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=102400 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PQM-Qpid-02-100K">-n PQM-Qpid-02-100K -d10M -s[40] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=102400 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PQM-Qpid-01-500K">-n PQM-Qpid-01-500K -d10M -s[8] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=512000 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PQM-Qpid-02-500K">-n PQM-Qpid-02-500K -d10M -s[8] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=512000 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PQM-Qpid-01-1M">-n PQM-Qpid-01-1M -d10M -s[4] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=1048576 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PQM-Qpid-02-1M">-n PQM-Qpid-02-1M -d10M -s[4] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=1048576 destinationCount=1 rate=0 maxPending=20000000</script>
-
- <!-- Persistent, Pub/Sub Tests -->
- <script name="PTCT-Qpid-01">-n PTCT-Qpid-01 -d1M -s[1] -c[1:30]:samples=30 -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=1 maxPending=2000000 </script>
- <script name="PTCT-Qpid-02">-n PTCT-Qpid-02 -d1M -s[1] -c[1:30]:samples=30 -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=1 maxPending=2000000 </script>
- <script name="PTCL-Qpid-01">-n PTCL-Qpid-01 -d1M -s[1] -c[1:30]:samples=30 -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=1 maxPending=2000000 </script>
- <script name="PTCL-Qpid-02">-n PTCL-Qpid-02 -d1M -s[1] -c[1:30]:samples=30 -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=1 rate=1 maxPending=2000000 </script>
-
- <!-- <script name="PTC-Qpid-05">-n PTC-Qpid-05 -d10M -s[10] -c[100] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=10 rate=0 maxPending=100000 </script> -->
- <!-- <script name="PTC-Qpid-06">-n PTC-Qpid-06 -d10M -s[10] -c[100] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=256 destinationCount=10 rate=0 maxPending=100000 </script> -->
-
- <script name="PTM-Qpid-01-512b">-n PTM-Qpid-01-512b -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PTM-Qpid-02-512b">-n PTM-Qpid-02-512b -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PTM-Qpid-01-1K">-n PTM-Qpid-01-1K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PTM-Qpid-02-1K">-n PTM-Qpid-02-1K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PTM-Qpid-01-5K">-n PTM-Qpid-01-5K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PTM-Qpid-02-5K">-n PTM-Qpid-02-5K -d10M -s[1000] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PTM-Qpid-01-10K">-n PTM-Qpid-01-10K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PTM-Qpid-02-10K">-n PTM-Qpid-02-10K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PTM-Qpid-01-50K">-n PTM-Qpid-01-50K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=51200 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PTM-Qpid-02-50K">-n PTM-Qpid-02-50K -d10M -s[100] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=51200 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PTM-Qpid-01-100K">-n PTM-Qpid-01-100K -d10M -s[40] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=102400 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PTM-Qpid-02-100K">-n PTM-Qpid-02-100K -d10M -s[40] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=102400 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PTM-Qpid-01-500K">-n PTM-Qpid-01-500K -d10M -s[8] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=512000 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PTM-Qpid-02-500K">-n PTM-Qpid-02-500K -d10M -s[8] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=512000 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PTM-Qpid-01-1M">-n PTM-Qpid-01-1M -d10M -s[4] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=10 batchSize=1000 messageSize=1048576 destinationCount=1 rate=0 maxPending=20000000</script>
- <script name="PTM-Qpid-02-1M">-n PTM-Qpid-02-1M -d10M -s[4] -c[8] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=10 batchSize=1000 messageSize=1048476 destinationCount=1 rate=0 maxPending=20000000</script>
-
- <!-- Benchmarking tests. -->
- <!-- Throughput. -->
- <script name="TQBT-TX-Qpid-01">-n TQBT-TX-Qpid-01 -d10M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TQBT-AA-Qpid-01">-n TQBT-AA-Qpid-01 -d10M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TQBT-NA-Qpid-01">-n TQBT-NA-Qpid-01 -d10M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TTBT-TX-Qpid-01">-n TTBT-TX-Qpid-01 -d10M -s[1000] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=8 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TTBT-AA-Qpid-01">-n TTBT-AA-Qpid-01 -d10M -s[1000] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="TTBT-NA-Qpid-01">-n TTBT-NA-Qpid-01 -d10M -s[1000] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </script>
-
- <script name="PQBT-TX-Qpid-01">-n PQBT-TX-Qpid-01 -d10M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=true consAckMode=0 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PQBT-AA-Qpid-01">-n PQBT-AA-Qpid-01 -d10M -s[1000] -c[16] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PTBT-TX-Qpid-01">-n PTBT-TX-Qpid-01 -d10M -s[1000] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=8 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </script>
- <script name="PTBT-AA-Qpid-01">-n PTBT-AA-Qpid-01 -d10M -s[1000] -c[2] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=8 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </script>
-
- <!-- Benchmark Latency testing-->
- <!-- Job Queueing. 1:10 -->
- <script name="TQBL-AA-Qpid-02-01">-n TQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=1000 maxPending=2000000 </script>
- <script name="TQBL-AA-Qpid-02-02">-n TQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=2000 maxPending=2000000 </script>
- <script name="TQBL-AA-Qpid-02-03">-n TQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=3000 maxPending=2000000 </script>
- <script name="TQBL-AA-Qpid-02-04">-n TQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=4000 maxPending=2000000 </script>
- <script name="TQBL-AA-Qpid-02-05">-n TQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=5000 maxPending=2000000 </script>
- <script name="TQBL-AA-Qpid-02-06">-n TQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=6000 maxPending=2000000 </script>
- <script name="TQBL-AA-Qpid-02-07">-n TQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=7000 maxPending=2000000 </script>
- <script name="TQBL-AA-Qpid-02-08">-n TQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=8000 maxPending=2000000 </script>
- <script name="TQBL-AA-Qpid-02-09">-n TQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=9000 maxPending=2000000 </script>
- <script name="TQBL-AA-Qpid-02-10">-n TQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=10000 maxPending=2000000 </script>
-
- <script name="PQBL-AA-Qpid-02-01">-n PQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=100 maxPending=2000000 </script>
- <script name="PQBL-AA-Qpid-02-02">-n PQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=200 maxPending=2000000 </script>
- <script name="PQBL-AA-Qpid-02-03">-n PQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=300 maxPending=2000000 </script>
- <script name="PQBL-AA-Qpid-02-04">-n PQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=400 maxPending=2000000 </script>
- <script name="PQBL-AA-Qpid-02-05">-n PQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=500 maxPending=2000000 </script>
- <script name="PQBL-AA-Qpid-02-06">-n PQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=600 maxPending=2000000 </script>
- <script name="PQBL-AA-Qpid-02-07">-n PQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=700 maxPending=2000000 </script>
- <script name="PQBL-AA-Qpid-02-08">-n PQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=800 maxPending=2000000 </script>
- <script name="PQBL-AA-Qpid-02-09">-n PQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=900 maxPending=2000000 </script>
- <script name="PQBL-AA-Qpid-02-10">-n PQBL-AA-Qpid-02 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=10 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=5120 destinationCount=1 rate=1000 maxPending=2000000 </script>
-
- <!-- Broadcast of small sized time critical messages. Lowish rates. Transient/Persistent. 1:100, auto ack. -->
- <script name="TTBL-AA-Qpid-03-01">-n TTBL-AA-Qpid-03 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=200 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-03-02">-n TTBL-AA-Qpid-03 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=400 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-03-03">-n TTBL-AA-Qpid-03 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=600 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-03-04">-n TTBL-AA-Qpid-03 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=800 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-03-05">-n TTBL-AA-Qpid-03 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=1000 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-03-06">-n TTBL-AA-Qpid-03 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=1200 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-03-07">-n TTBL-AA-Qpid-03 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=1400 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-03-08">-n TTBL-AA-Qpid-03 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=1600 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-03-09">-n TTBL-AA-Qpid-03 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=1800 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-03-10">-n TTBL-AA-Qpid-03 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=2000 maxPending=2000000 </script>
-
- <script name="PTBL-AA-Qpid-03-01">-n PTBL-AA-Qpid-03 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=256 destinationCount=1 rate=10 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-03-02">-n PTBL-AA-Qpid-03 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=256 destinationCount=1 rate=20 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-03-03">-n PTBL-AA-Qpid-03 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=256 destinationCount=1 rate=30 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-03-04">-n PTBL-AA-Qpid-03 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=256 destinationCount=1 rate=40 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-03-05">-n PTBL-AA-Qpid-03 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=256 destinationCount=1 rate=50 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-03-06">-n PTBL-AA-Qpid-03 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=256 destinationCount=1 rate=60 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-03-07">-n PTBL-AA-Qpid-03 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=256 destinationCount=1 rate=70 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-03-08">-n PTBL-AA-Qpid-03 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=256 destinationCount=1 rate=80 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-03-09">-n PTBL-AA-Qpid-03 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=256 destinationCount=1 rate=90 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-03-10">-n PTBL-AA-Qpid-03 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=256 destinationCount=1 rate=100 maxPending=2000000 </script>
-
- <!-- Broadcast of medium sized time critical messages. Lowish rates. Transient/Persistent. 1:100, auto ack. -->
- <script name="TTBL-AA-Qpid-04-01">-n TTBL-AA-Qpid-04 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=100 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-04-02">-n TTBL-AA-Qpid-04 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=200 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-04-03">-n TTBL-AA-Qpid-04 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=300 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-04-04">-n TTBL-AA-Qpid-04 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=400 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-04-05">-n TTBL-AA-Qpid-04 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=500 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-04-06">-n TTBL-AA-Qpid-04 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=600 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-04-07">-n TTBL-AA-Qpid-04 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=700 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-04-08">-n TTBL-AA-Qpid-04 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=800 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-04-09">-n TTBL-AA-Qpid-04 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=900 maxPending=2000000 </script>
- <script name="TTBL-AA-Qpid-04-10">-n TTBL-AA-Qpid-04 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=1000 maxPending=2000000 </script>
-
- <script name="PTBL-AA-Qpid-04-01">-n PTBL-AA-Qpid-04 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=5120 destinationCount=1 rate=10 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-04-02">-n PTBL-AA-Qpid-04 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=5120 destinationCount=1 rate=20 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-04-03">-n PTBL-AA-Qpid-04 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=5120 destinationCount=1 rate=30 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-04-04">-n PTBL-AA-Qpid-04 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=5120 destinationCount=1 rate=40 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-04-05">-n PTBL-AA-Qpid-04 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=5120 destinationCount=1 rate=50 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-04-06">-n PTBL-AA-Qpid-04 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=5120 destinationCount=1 rate=60 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-04-07">-n PTBL-AA-Qpid-04 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=5120 destinationCount=1 rate=70 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-04-08">-n PTBL-AA-Qpid-04 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=5120 destinationCount=1 rate=80 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-04-09">-n PTBL-AA-Qpid-04 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=5120 destinationCount=1 rate=90 maxPending=2000000 </script>
- <script name="PTBL-AA-Qpid-04-10">-n PTBL-AA-Qpid-04 -d1M -s[100] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=101 messageSize=5120 destinationCount=1 rate=100 maxPending=2000000 </script>
-
- <!-- Low-latency broadcast of time sensitive events. Transient, no_ack. -->
- <script name="TTBL-NA-Qpid-05-01">-n TTBL-NA-Qpid-05 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=400 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-05-02">-n TTBL-NA-Qpid-05 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=800 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-05-03">-n TTBL-NA-Qpid-05 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=1200 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-05-04">-n TTBL-NA-Qpid-05 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=1600 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-05-05">-n TTBL-NA-Qpid-05 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=2000 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-05-06">-n TTBL-NA-Qpid-05 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=2400 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-05-07">-n TTBL-NA-Qpid-05 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=2800 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-05-08">-n TTBL-NA-Qpid-05 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=3200 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-05-09">-n TTBL-NA-Qpid-05 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=3600 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-05-10">-n TTBL-NA-Qpid-05 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=256 destinationCount=1 rate=4000 maxPending=2000000 </script>
-
- <!-- Low-latency broadcast of medium sized time sensitive events. Transient, no_ack. -->
- <script name="TTBL-NA-Qpid-06-01">-n TTBL-NA-Qpid-06 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=100 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-06-02">-n TTBL-NA-Qpid-06 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=200 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-06-03">-n TTBL-NA-Qpid-06 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=300 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-06-04">-n TTBL-NA-Qpid-06 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=400 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-06-05">-n TTBL-NA-Qpid-06 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=500 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-06-06">-n TTBL-NA-Qpid-06 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=600 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-06-07">-n TTBL-NA-Qpid-06 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=700 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-06-08">-n TTBL-NA-Qpid-06 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=800 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-06-09">-n TTBL-NA-Qpid-06 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=900 maxPending=2000000 </script>
- <script name="TTBL-NA-Qpid-06-10">-n TTBL-NA-Qpid-06 -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=true uniqueDests=false numConsumers=50 transacted=false consTransacted=false consAckMode=257 commitBatchSize=1 batchSize=1001 messageSize=5120 destinationCount=1 rate=1000 maxPending=2000000 </script>
-
- <!-- Failover Tests. -->
- <script name="FT-Qpid-01">-n FT-Qpid-01 -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 transacted=true properties=failovertest.properties failBeforeSend=true -o $QPID_WORK/results</script>
- <script name="FT-Qpid-02">-n FT-Qpid-02 -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 transacted=true properties=failovertest.properties failAfterSend=true -o $QPID_WORK/results</script>
- <script name="FT-Qpid-03">-n FT-Qpid-03 -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=1000 transacted=true properties=failovertest.properties failAfterCommit=true -o $QPID_WORK/results</script>
- <script name="FT-Qpid-04">-n FT-Qpid-04 -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=1000 properties=failovertest.properties transacted=false failBeforeSend=true -o $QPID_WORK/results</script>
- <script name="FT-Qpid-05">-n FT-Qpid-05 -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=1000 properties=failovertest.properties transacted=false failAfterSend=true -o $QPID_WORK/results</script>
- <script name="FT-Qpid-01-P">-n FT-Qpid-01-P -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=1000 transacted=true properties=failovertest.properties failBeforeSend=true -o $QPID_WORK/results</script>
- <script name="FT-Qpid-02-P">-n FT-Qpid-02-P -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=1000 transacted=true properties=failovertest.properties failAfterSend=true -o $QPID_WORK/results</script>
- <script name="FT-Qpid-03-P">-n FT-Qpid-03-P -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=1000 transacted=true properties=failovertest.properties failAfterCommit=true -o $QPID_WORK/results</script>
- <script name="FT-Qpid-04-P">-n FT-Qpid-04-P -s[250] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=1000 properties=failovertest.properties transacted=false failBeforeSend=true -o $QPID_WORK/results</script>
- <script name="FT-Qpid-05-P">-n FT-Qpid-05-P -s[250] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=1000 properties=failovertest.properties transacted=false failAfterSend=true -o $QPID_WORK/results</script>
-
-</scripts>
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java
deleted file mode 100644
index 3ad6c021bd..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java
+++ /dev/null
@@ -1,120 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.SimpleByteBufferAllocator;
-
-import javax.jms.JMSException;
-import javax.jms.Session;
-import javax.jms.ObjectMessage;
-import javax.jms.StreamMessage;
-import javax.jms.BytesMessage;
-import javax.jms.TextMessage;
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-
-public class TestMessageFactory
-{
- private static final String MESSAGE_DATA_BYTES = "-message payload-message paylaod-message payload-message paylaod";
-
- public static TextMessage newTextMessage(Session session, int size) throws JMSException
- {
- return session.createTextMessage(createMessagePayload(size));
- }
-
- public static TextMessage newJMSTextMessage(Session session, int size, String encoding) throws JMSException
- {
-
- TextMessage message = session.createTextMessage();
- message.clearBody();
- message.setText(createMessagePayload(size));
- return message;
- }
-
- public static BytesMessage newBytesMessage(Session session, int size) throws JMSException
- {
- BytesMessage message = session.createBytesMessage();
- message.writeUTF(createMessagePayload(size));
- return message;
- }
-
- public static StreamMessage newStreamMessage(Session session, int size) throws JMSException
- {
- StreamMessage message = session.createStreamMessage();
- message.writeString(createMessagePayload(size));
- return message;
- }
-
- public static ObjectMessage newObjectMessage(Session session, int size) throws JMSException
- {
- if (size == 0)
- {
- return session.createObjectMessage();
- }
- else
- {
- return session.createObjectMessage(createMessagePayload(size));
- }
- }
-
- /**
- * Creates an ObjectMessage with given size and sets the JMS properties (JMSReplyTo and DeliveryMode)
- * @param session
- * @param replyDestination
- * @param size
- * @param persistent
- * @return the new ObjectMessage
- * @throws JMSException
- */
- public static ObjectMessage newObjectMessage(Session session, Destination replyDestination, int size, boolean persistent) throws JMSException
- {
- ObjectMessage msg = newObjectMessage(session, size);
-
- // Set the messages persistent delivery flag.
- msg.setJMSDeliveryMode(persistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
-
- // Ensure that the temporary reply queue is set as the reply to destination for the message.
- if (replyDestination != null)
- {
- msg.setJMSReplyTo(replyDestination);
- }
-
- return msg;
- }
-
- public static String createMessagePayload(int size)
- {
- StringBuffer buf = new StringBuffer(size);
- int count = 0;
- while (count <= (size - MESSAGE_DATA_BYTES.length()))
- {
- buf.append(MESSAGE_DATA_BYTES);
- count += MESSAGE_DATA_BYTES.length();
- }
- if (count < size)
- {
- buf.append(MESSAGE_DATA_BYTES, 0, size - count);
- }
-
- return buf.toString();
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java
deleted file mode 100644
index cac0064785..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java
+++ /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.
- *
- */
-package org.apache.qpid.config;
-
-import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.config.ConnectionFactoryInitialiser;
-import org.apache.qpid.config.ConnectorConfig;
-
-import javax.jms.ConnectionFactory;
-
-class AMQConnectionFactoryInitialiser implements ConnectionFactoryInitialiser
-{
- public ConnectionFactory getFactory(ConnectorConfig config)
- {
- return new AMQConnectionFactory(config.getHost(), config.getPort(), "/test_path");
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java
deleted file mode 100644
index 14db74438f..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java
+++ /dev/null
@@ -1,69 +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.
- *
- */
-package org.apache.qpid.config;
-
-public abstract class AbstractConfig
-{
- public boolean setOptions(String[] argv)
- {
- try
- {
- for(int i = 0; i < argv.length - 1; i += 2)
- {
- String key = argv[i];
- String value = argv[i+1];
- setOption(key, value);
- }
- return true;
- }
- catch(Exception e)
- {
- System.out.println(e.getMessage());
- }
- return false;
- }
-
- protected int parseInt(String msg, String i)
- {
- try
- {
- return Integer.parseInt(i);
- }
- catch(NumberFormatException e)
- {
- throw new RuntimeException(msg + ": " + i, e);
- }
- }
-
- protected long parseLong(String msg, String i)
- {
- try
- {
- return Long.parseLong(i);
- }
- catch(NumberFormatException e)
- {
- throw new RuntimeException(msg + ": " + i, e);
- }
- }
-
- public abstract void setOption(String key, String value);
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java
deleted file mode 100644
index a9984eb09a..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java
+++ /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.
- *
- */
-package org.apache.qpid.config;
-
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-
-public interface ConnectionFactoryInitialiser
-{
- public ConnectionFactory getFactory(ConnectorConfig config) throws JMSException;
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/Connector.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/Connector.java
deleted file mode 100644
index ff2377f087..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/Connector.java
+++ /dev/null
@@ -1,40 +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.
- *
- */
-package org.apache.qpid.config;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-
-public class Connector
-{
- public Connection createConnection(ConnectorConfig config) throws Exception
- {
- return getConnectionFactory(config).createConnection();
- }
-
- ConnectionFactory getConnectionFactory(ConnectorConfig config) throws Exception
- {
- String factory = config.getFactory();
- if(factory == null) factory = AMQConnectionFactoryInitialiser.class.getName();
- System.out.println("Using " + factory);
- return ((ConnectionFactoryInitialiser) Class.forName(factory).newInstance()).getFactory(config);
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java
deleted file mode 100644
index b120ed3f12..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java
+++ /dev/null
@@ -1,28 +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.
- *
- */
-package org.apache.qpid.config;
-
-public interface ConnectorConfig
-{
- public String getHost();
- public int getPort();
- public String getFactory();
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java
deleted file mode 100644
index a0248a8f79..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java
+++ /dev/null
@@ -1,112 +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.
- *
- */
-package org.apache.qpid.config;
-
-import org.apache.qpid.config.ConnectionFactoryInitialiser;
-import org.apache.qpid.config.ConnectorConfig;
-import org.apache.qpid.client.JMSAMQException;
-
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.management.MBeanException;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.naming.NameNotFoundException;
-import java.util.Hashtable;
-
-public class JBossConnectionFactoryInitialiser implements ConnectionFactoryInitialiser
-{
- public ConnectionFactory getFactory(ConnectorConfig config) throws JMSException
- {
- ConnectionFactory cf = null;
- InitialContext ic = null;
- Hashtable ht = new Hashtable();
- ht.put(InitialContext.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
- String jbossHost = System.getProperty("jboss.host", "eqd-lxamq01");
- String jbossPort = System.getProperty("jboss.port", "1099");
- ht.put(InitialContext.PROVIDER_URL, "jnp://" + jbossHost + ":" + jbossPort);
- ht.put(InitialContext.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
-
- try
- {
- ic = new InitialContext(ht);
- if (!doesDestinationExist("topictest.messages", ic))
- {
- deployTopic("topictest.messages", ic);
- }
- if (!doesDestinationExist("topictest.control", ic))
- {
- deployTopic("topictest.control", ic);
- }
-
- cf = (ConnectionFactory) ic.lookup("/ConnectionFactory");
- return cf;
- }
- catch (NamingException e)
- {
- throw new JMSAMQException("Unable to lookup object: " + e, e);
- }
- catch (Exception e)
- {
- throw new JMSAMQException("Error creating topic: " + e, e);
- }
- }
-
- private boolean doesDestinationExist(String name, InitialContext ic) throws Exception
- {
- try
- {
- ic.lookup("/" + name);
- }
- catch (NameNotFoundException e)
- {
- return false;
- }
- return true;
- }
-
- private void deployTopic(String name, InitialContext ic) throws Exception
- {
- MBeanServerConnection mBeanServer = lookupMBeanServerProxy(ic);
-
- ObjectName serverObjectName = new ObjectName("jboss.messaging:service=ServerPeer");
-
- String jndiName = "/" + name;
- try
- {
- mBeanServer.invoke(serverObjectName, "createTopic",
- new Object[]{name, jndiName},
- new String[]{"java.lang.String", "java.lang.String"});
- }
- catch (MBeanException e)
- {
- System.err.println("Error: " + e);
- System.err.println("Cause: " + e.getCause());
- }
- }
-
- private MBeanServerConnection lookupMBeanServerProxy(InitialContext ic) throws NamingException
- {
- return (MBeanServerConnection) ic.lookup("jmx/invoker/RMIAdaptor");
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Config.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Config.java
deleted file mode 100644
index 5b6169ed2d..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Config.java
+++ /dev/null
@@ -1,243 +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.
- *
- */
-package org.apache.qpid.oldtopic;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.config.ConnectorConfig;
-import org.apache.qpid.config.ConnectionFactoryInitialiser;
-import org.apache.qpid.config.Connector;
-import org.apache.qpid.config.AbstractConfig;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-
-class Config extends AbstractConfig implements ConnectorConfig
-{
-
- private String host = "localhost";
- private int port = 5672;
- private String factory = null;
-
- private int payload = 256;
- private int messages = 1000;
- private int clients = 1;
- private int batch = 1;
- private long delay = 1;
- private int warmup;
- private int ackMode= AMQSession.NO_ACKNOWLEDGE;
- private String clientId;
- private String subscriptionId;
- private boolean persistent;
-
- public Config()
- {
- }
-
- int getAckMode()
- {
- return ackMode;
- }
-
- void setPayload(int payload)
- {
- this.payload = payload;
- }
-
- int getPayload()
- {
- return payload;
- }
-
- void setClients(int clients)
- {
- this.clients = clients;
- }
-
- int getClients()
- {
- return clients;
- }
-
- void setMessages(int messages)
- {
- this.messages = messages;
- }
-
- int getMessages()
- {
- return messages;
- }
-
- public String getHost()
- {
- return host;
- }
-
- public void setHost(String host)
- {
- this.host = host;
- }
-
- public int getPort()
- {
- return port;
- }
-
- public String getFactory()
- {
- return factory;
- }
-
- public void setPort(int port)
- {
- this.port = port;
- }
-
- int getBatch()
- {
- return batch;
- }
-
- void setBatch(int batch)
- {
- this.batch = batch;
- }
-
- int getWarmup()
- {
- return warmup;
- }
-
- void setWarmup(int warmup)
- {
- this.warmup = warmup;
- }
-
- public long getDelay()
- {
- return delay;
- }
-
- public void setDelay(long delay)
- {
- this.delay = delay;
- }
-
- String getClientId()
- {
- return clientId;
- }
-
- String getSubscriptionId()
- {
- return subscriptionId;
- }
-
- boolean usePersistentMessages()
- {
- return persistent;
- }
-
- public void setOption(String key, String value)
- {
- if("-host".equalsIgnoreCase(key))
- {
- setHost(value);
- }
- else if("-port".equalsIgnoreCase(key))
- {
- try
- {
- setPort(Integer.parseInt(value));
- }
- catch(NumberFormatException e)
- {
- throw new RuntimeException("Bad port number: " + value);
- }
- }
- else if("-payload".equalsIgnoreCase(key))
- {
- setPayload(parseInt("Bad payload size", value));
- }
- else if("-messages".equalsIgnoreCase(key))
- {
- setMessages(parseInt("Bad message count", value));
- }
- else if("-clients".equalsIgnoreCase(key))
- {
- setClients(parseInt("Bad client count", value));
- }
- else if("-batch".equalsIgnoreCase(key))
- {
- setBatch(parseInt("Bad batch count", value));
- }
- else if("-delay".equalsIgnoreCase(key))
- {
- setDelay(parseLong("Bad batch delay", value));
- }
- else if("-warmup".equalsIgnoreCase(key))
- {
- setWarmup(parseInt("Bad warmup count", value));
- }
- else if("-ack".equalsIgnoreCase(key))
- {
- ackMode = parseInt("Bad ack mode", value);
- }
- else if("-factory".equalsIgnoreCase(key))
- {
- factory = value;
- }
- else if("-clientId".equalsIgnoreCase(key))
- {
- clientId = value;
- }
- else if("-subscriptionId".equalsIgnoreCase(key))
- {
- subscriptionId = value;
- }
- else if("-persistent".equalsIgnoreCase(key))
- {
- persistent = "true".equalsIgnoreCase(value);
- }
- else
- {
- System.out.println("Ignoring unrecognised option: " + key);
- }
- }
-
- static String getAckModeDescription(int ackMode)
- {
- switch(ackMode)
- {
- case AMQSession.NO_ACKNOWLEDGE: return "NO_ACKNOWLEDGE";
- case AMQSession.AUTO_ACKNOWLEDGE: return "AUTO_ACKNOWLEDGE";
- case AMQSession.CLIENT_ACKNOWLEDGE: return "CLIENT_ACKNOWLEDGE";
- case AMQSession.DUPS_OK_ACKNOWLEDGE: return "DUPS_OK_ACKNOWELDGE";
- case AMQSession.PRE_ACKNOWLEDGE: return "PRE_ACKNOWLEDGE";
- }
- return "AckMode=" + ackMode;
- }
-
- public Connection createConnection() throws Exception
- {
- return new Connector().createConnection(this);
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Listener.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Listener.java
deleted file mode 100644
index 4732782d4c..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Listener.java
+++ /dev/null
@@ -1,141 +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.
- *
- */
-package org.apache.qpid.oldtopic;
-import org.apache.log4j.*;
-import javax.jms.Connection;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-public class Listener implements MessageListener
-{
- private final Connection _connection;
- private final MessageProducer _controller;
- private final javax.jms.Session _session;
- private final MessageFactory _factory;
- private boolean init;
- private int count;
- private long start;
-
- Listener(Connection connection, int ackMode) throws Exception
- {
- this(connection, ackMode, null);
- }
-
- Listener(Connection connection, int ackMode, String name) throws Exception
- {
- _connection = connection;
- _session = connection.createSession(false, ackMode);
- _factory = new MessageFactory(_session);
-
- //register for events
- if(name == null)
- {
- _factory.createTopicConsumer().setMessageListener(this);
- }
- else
- {
- _factory.createDurableTopicConsumer(name).setMessageListener(this);
- }
-
- _connection.start();
-
- _controller = _factory.createControlPublisher();
- System.out.println("Waiting for messages " +
- Config.getAckModeDescription(ackMode)
- + (name == null ? "" : " (subscribed with name " + name + " and client id " + connection.getClientID() + ")")
- + "...");
-
- }
-
- private void shutdown()
- {
- try
- {
- _session.close();
- _connection.stop();
- _connection.close();
- }
- catch(Exception e)
- {
- e.printStackTrace(System.out);
- }
- }
-
- private void report()
- {
- try
- {
- String msg = getReport();
- _controller.send(_factory.createReportResponseMessage(msg));
- System.out.println("Sent report: " + msg);
- }
- catch(Exception e)
- {
- e.printStackTrace(System.out);
- }
- }
-
- private String getReport()
- {
- long time = (System.currentTimeMillis() - start);
- return "Received " + count + " in " + time + "ms";
- }
-
- public void onMessage(Message message)
- {
- if(!init)
- {
- start = System.currentTimeMillis();
- count = 0;
- init = true;
- }
-
- if(_factory.isShutdown(message))
- {
- shutdown();
- }
- else if(_factory.isReport(message))
- {
- //send a report:
- report();
- init = false;
- }
- else if (++count % 100 == 0)
- {
- System.out.println("Received " + count + " messages.");
- }
- }
-
- public static void main(String[] argv) throws Exception
- {
- Config config = new Config();
- config.setOptions(argv);
-
- Connection con = config.createConnection();
- if(config.getClientId() != null)
- {
- con.setClientID(config.getClientId());
- }
- new Listener(con, config.getAckMode(), config.getSubscriptionId());
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/MessageFactory.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/MessageFactory.java
deleted file mode 100644
index b2fbeb7e35..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/MessageFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.oldtopic;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-
-import javax.jms.*;
-
-/**
- */
-class MessageFactory
-{
- private static final char[] DATA = "abcdefghijklmnopqrstuvwxyz".toCharArray();
-
- private final Session _session;
- private final Topic _topic;
- private final Topic _control;
- private final byte[] _payload;
-
-
- MessageFactory(Session session) throws JMSException
- {
- this(session, 256);
- }
-
- MessageFactory(Session session, int size) throws JMSException
- {
- _session = session;
-/* if(session instanceof AMQSession)
- {
- _topic = new AMQTopic("topictest.messages");
- _control = new AMQTopic("topictest.control");
- }
- else*/
- {
- _topic = session.createTopic("topictest.messages");
- _control = session.createTopic("topictest.control");
- }
- _payload = new byte[size];
-
- for(int i = 0; i < size; i++)
- {
- _payload[i] = (byte) DATA[i % DATA.length];
- }
- }
-
- Topic getTopic()
- {
- return _topic;
- }
-
- Message createEventMessage() throws JMSException
- {
- BytesMessage msg = _session.createBytesMessage();
- msg.writeBytes(_payload);
- return msg;
- }
-
- Message createShutdownMessage() throws JMSException
- {
- return _session.createTextMessage("SHUTDOWN");
- }
-
- Message createReportRequestMessage() throws JMSException
- {
- return _session.createTextMessage("REPORT");
- }
-
- Message createReportResponseMessage(String msg) throws JMSException
- {
- return _session.createTextMessage(msg);
- }
-
- boolean isShutdown(Message m)
- {
- return checkText(m, "SHUTDOWN");
- }
-
- boolean isReport(Message m)
- {
- return checkText(m, "REPORT");
- }
-
- Object getReport(Message m)
- {
- try
- {
- return ((TextMessage) m).getText();
- }
- catch (JMSException e)
- {
- e.printStackTrace(System.out);
- return e.toString();
- }
- }
-
- MessageConsumer createTopicConsumer() throws Exception
- {
- return _session.createConsumer(_topic);
- }
-
- MessageConsumer createDurableTopicConsumer(String name) throws Exception
- {
- return _session.createDurableSubscriber(_topic, name);
- }
-
- MessageConsumer createControlConsumer() throws Exception
- {
- return _session.createConsumer(_control);
- }
-
- MessageProducer createTopicPublisher() throws Exception
- {
- return _session.createProducer(_topic);
- }
-
- MessageProducer createControlPublisher() throws Exception
- {
- return _session.createProducer(_control);
- }
-
- private static boolean checkText(Message m, String s)
- {
- try
- {
- return m instanceof TextMessage && ((TextMessage) m).getText().equals(s);
- }
- catch (JMSException e)
- {
- e.printStackTrace(System.out);
- return false;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Publisher.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Publisher.java
deleted file mode 100644
index f811704323..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/oldtopic/Publisher.java
+++ /dev/null
@@ -1,175 +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.
- *
- */
-package org.apache.qpid.oldtopic;
-
-import javax.jms.*;
-
-public class Publisher implements MessageListener
-{
- private final Object _lock = new Object();
- private final Connection _connection;
- private final Session _session;
- private final MessageFactory _factory;
- private final MessageProducer _publisher;
- private int _count;
-
- Publisher(Connection connection, int size, int ackMode, boolean persistent) throws Exception
- {
- _connection = connection;
- _session = _connection.createSession(false, ackMode);
- _factory = new MessageFactory(_session, size);
- _publisher = _factory.createTopicPublisher();
- _publisher.setDeliveryMode(persistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
- System.out.println("Publishing " + (persistent ? "persistent" : "non-persistent") + " messages of " + size + " bytes, " + Config.getAckModeDescription(ackMode) + ".");
- }
-
- private void test(Config config) throws Exception
- {
- test(config.getBatch(), config.getDelay(), config.getMessages(), config.getClients(), config.getWarmup());
- }
-
- private void test(int batches, long delay, int msgCount, int consumerCount, int warmup) throws Exception
- {
- _factory.createControlConsumer().setMessageListener(this);
- _connection.start();
-
- if(warmup > 0)
- {
- System.out.println("Runing warmup (" + warmup + " msgs)");
- long time = batch(warmup, consumerCount);
- System.out.println("Warmup completed in " + time + "ms");
- }
-
- long[] times = new long[batches];
- for(int i = 0; i < batches; i++)
- {
- if(i > 0) Thread.sleep(delay*1000);
- times[i] = batch(msgCount, consumerCount);
- System.out.println("Batch " + (i+1) + " of " + batches + " completed in " + times[i] + " ms.");
- }
-
- long min = min(times);
- long max = max(times);
- System.out.println("min: " + min + ", max: " + max + " avg: " + avg(times, min, max));
-
- //request shutdown
- _publisher.send(_factory.createShutdownMessage());
-
- _connection.stop();
- _connection.close();
- }
-
- private long batch(int msgCount, int consumerCount) throws Exception
- {
- _count = consumerCount;
- long start = System.currentTimeMillis();
- publish(msgCount);
- waitForCompletion(consumerCount);
- return System.currentTimeMillis() - start;
- }
-
- private void publish(int count) throws Exception
- {
-
- //send events
- for (int i = 0; i < count; i++)
- {
- _publisher.send(_factory.createEventMessage());
- if ((i + 1) % 100 == 0)
- {
- System.out.println("Sent " + (i + 1) + " messages");
- }
- }
-
- //request report
- _publisher.send(_factory.createReportRequestMessage());
- }
-
- private void waitForCompletion(int consumers) throws Exception
- {
- System.out.println("Waiting for completion...");
- synchronized (_lock)
- {
- while (_count > 0)
- {
- _lock.wait();
- }
- }
- }
-
-
- public void onMessage(Message message)
- {
- System.out.println("Received report " + _factory.getReport(message) + " " + --_count + " remaining");
- if (_count == 0)
- {
- synchronized (_lock)
- {
- _lock.notify();
- }
- }
- }
-
- static long min(long[] times)
- {
- long min = times.length > 0 ? times[0] : 0;
- for(int i = 0; i < times.length; i++)
- {
- min = Math.min(min, times[i]);
- }
- return min;
- }
-
- static long max(long[] times)
- {
- long max = times.length > 0 ? times[0] : 0;
- for(int i = 0; i < times.length; i++)
- {
- max = Math.max(max, times[i]);
- }
- return max;
- }
-
- static long avg(long[] times, long min, long max)
- {
- long sum = 0;
- for(int i = 0; i < times.length; i++)
- {
- sum += times[i];
- }
- sum -= min;
- sum -= max;
-
- return (sum / (times.length - 2));
- }
-
- public static void main(String[] argv) throws Exception
- {
- Config config = new Config();
- config.setOptions(argv);
-
- Connection con = config.createConnection();
- int size = config.getPayload();
- int ackMode = config.getAckMode();
- boolean persistent = config.usePersistentMessages();
- new Publisher(con, size, ackMode, persistent).test(config);
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java
deleted file mode 100644
index 89fc805a34..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java
+++ /dev/null
@@ -1,292 +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.
- *
- */
-package org.apache.qpid.ping;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.requestreply.PingPongProducer;
-
-import org.apache.qpid.junit.extensions.TimingController;
-import org.apache.qpid.junit.extensions.TimingControllerAware;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * PingAsyncTestPerf is a performance test that outputs multiple timings from its test method, using the timing controller
- * interface supplied by the test runner from a seperate listener thread. It differs from the {@link PingTestPerf} test
- * that it extends because it can output timings as replies are received, rather than waiting until all expected replies
- * are received. This is less 'blocky' than the tests in {@link PingTestPerf}, and provides a truer simulation of sending
- * and recieving clients working asynchronously.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><td> Responsibilities <th> Collaborations
- * <tr><td> Send many ping messages and output timings asynchronously on batches received.
- * </table>
- */
-public class PingAsyncTestPerf extends PingTestPerf implements TimingControllerAware
-{
- private static Logger _logger = Logger.getLogger(PingAsyncTestPerf.class);
-
- /** Holds the name of the property to get the test results logging batch size. */
- public static final String TEST_RESULTS_BATCH_SIZE_PROPNAME = "batchSize";
-
- /** Holds the default test results logging batch size. */
- public static final int TEST_RESULTS_BATCH_SIZE_DEFAULT = 1000;
-
- /** Used to hold the timing controller passed from the test runner. */
- private TimingController _timingController;
-
- /** Used to generate unique correlation ids for each test run. */
- private AtomicLong corellationIdGenerator = new AtomicLong();
-
- /** Holds test specifics by correlation id. This consists of the expected number of messages and the timing controler. */
- private Map<String, PerCorrelationId> perCorrelationIds =
- Collections.synchronizedMap(new HashMap<String, PerCorrelationId>());
-
- /** Holds the batched results listener, that does logging on batch boundaries. */
- private BatchedResultsListener batchedResultsListener = null;
-
- /**
- * Creates a new asynchronous ping performance test with the specified name.
- *
- * @param name The test name.
- */
- public PingAsyncTestPerf(String name)
- {
- super(name);
-
- // Sets up the test parameters with defaults.
- testParameters.setPropertyIfNull(TEST_RESULTS_BATCH_SIZE_PROPNAME,
- Integer.toString(TEST_RESULTS_BATCH_SIZE_DEFAULT));
- }
-
- /**
- * Compile all the tests into a test suite.
- * @return The test suite to run. Should only contain testAsyncPingOk method.
- */
- public static Test suite()
- {
- // Build a new test suite
- TestSuite suite = new TestSuite("Ping Performance Tests");
-
- // Run performance tests in read committed mode.
- suite.addTest(new PingAsyncTestPerf("testAsyncPingOk"));
-
- return suite;
- }
-
- /**
- * Accepts a timing controller from the test runner.
- *
- * @param timingController The timing controller to register mutliple timings with.
- */
- public void setTimingController(TimingController timingController)
- {
- _timingController = timingController;
- }
-
- /**
- * Gets the timing controller passed in by the test runner.
- *
- * @return The timing controller passed in by the test runner.
- */
- public TimingController getTimingController()
- {
- return _timingController;
- }
-
- /**
- * Sends the specified number of pings, asynchronously outputs timings on every batch boundary, and waits until
- * all replies have been received or a time out occurs before exiting this method.
- *
- * @param numPings The number of pings to send.
- * @throws Exception pass all errors out to the test harness
- */
- public void testAsyncPingOk(int numPings) throws Exception
- {
- // _logger.debug("public void testAsyncPingOk(int numPings): called");
-
- // Ensure that at least one ping was requeusted.
- if (numPings == 0)
- {
- _logger.error("Number of pings requested was zero.");
- fail("Number of pings requested was zero.");
- }
-
- // Get the per thread test setup to run the test through.
- PerThreadSetup perThreadSetup = threadSetup.get();
- PingClient pingClient = perThreadSetup._pingClient;
-
- // Advance the correlation id of messages to send, to make it unique for this run.
- perThreadSetup._correlationId = Long.toString(corellationIdGenerator.incrementAndGet());
- // String messageCorrelationId = perThreadSetup._correlationId;
- // _logger.debug("messageCorrelationId = " + messageCorrelationId);
-
- // Initialize the count and timing controller for the new correlation id.
- PerCorrelationId perCorrelationId = new PerCorrelationId();
- TimingController tc = getTimingController().getControllerForCurrentThread();
- perCorrelationId._tc = tc;
- perCorrelationId._expectedCount = pingClient.getExpectedNumPings(numPings);
- perCorrelationIds.put(perThreadSetup._correlationId, perCorrelationId);
-
- // Send the requested number of messages, and wait until they have all been received.
- long timeout = Long.parseLong(testParameters.getProperty(PingPongProducer.TIMEOUT_PROPNAME));
- int numReplies = pingClient.pingAndWaitForReply(null, numPings, timeout, perThreadSetup._correlationId);
-
- // Check that all the replies were received and log a fail if they were not.
- if (numReplies < perCorrelationId._expectedCount)
- {
- perCorrelationId._tc.completeTest(false, numPings - perCorrelationId._expectedCount);
- }
-
- // Remove the expected count and timing controller for the message correlation id, to ensure they are cleaned up.
- perCorrelationIds.remove(perThreadSetup._correlationId);
- }
-
- /**
- * Performs test fixture creation on a per thread basis. This will only be called once for each test thread.
- */
- public void threadSetUp()
- {
- _logger.debug("public void threadSetUp(): called");
-
- try
- {
- // Call the set up method in the super class. This creates a PingClient pinger.
- super.threadSetUp();
-
- // Create the chained message listener, only if it has not already been created. This is set up with the
- // batch size property, to tell it what batch size to output results on. A synchronized block is used to
- // ensure that only one thread creates this.
- synchronized (this)
- {
- if (batchedResultsListener == null)
- {
- int batchSize = Integer.parseInt(testParameters.getProperty(TEST_RESULTS_BATCH_SIZE_PROPNAME));
- batchedResultsListener = new BatchedResultsListener(batchSize);
- }
- }
-
- // Get the set up that the super class created.
- PerThreadSetup perThreadSetup = threadSetup.get();
-
- // Register the chained message listener on the pinger to do its asynchronous test timings from.
- perThreadSetup._pingClient.setChainedMessageListener(batchedResultsListener);
- }
- catch (Exception e)
- {
- _logger.warn("There was an exception during per thread setup.", e);
- }
- }
-
- /**
- * BatchedResultsListener is a {@link PingPongProducer.ChainedMessageListener} that can be attached to the
- * pinger, in order to receive notifications about every message received and the number remaining to be
- * received. Whenever the number remaining crosses a batch size boundary this results listener outputs
- * a test timing for the actual number of messages received in the current batch.
- */
- private class BatchedResultsListener implements PingPongProducer.ChainedMessageListener
- {
- /** The test results logging batch size. */
- int _batchSize;
-
- /**
- * Creates a results listener on the specified batch size.
- *
- * @param batchSize The batch size to use.
- */
- public BatchedResultsListener(int batchSize)
- {
- _batchSize = batchSize;
- }
-
- /**
- * This callback method is called from all of the pingers that this test creates. It uses the correlation id
- * from the message to identify the timing controller for the test thread that was responsible for sending those
- * messages.
- *
- * @param message The message.
- * @param remainingCount The count of messages remaining to be received with a particular correlation id.
- *
- * @throws JMSException Any underlying JMSException is allowed to fall through.
- */
- public void onMessage(Message message, int remainingCount, long latency) throws JMSException
- {
- // Check if a batch boundary has been crossed.
- if ((remainingCount % _batchSize) == 0)
- {
- // Extract the correlation id from the message.
- String correlationId = message.getJMSCorrelationID();
-
- /*_logger.debug("public void onMessage(Message message, int remainingCount = " + remainingCount
- + "): called on batch boundary for message id: " + correlationId + " with thread id: "
- + Thread.currentThread().getId());*/
-
- // Get the details for the correlation id and check that they are not null. They can become null
- // if a test times out.
- PerCorrelationId perCorrelationId = perCorrelationIds.get(correlationId);
- if (perCorrelationId != null)
- {
- // Get the timing controller and expected count for this correlation id.
- TimingController tc = perCorrelationId._tc;
- int expected = perCorrelationId._expectedCount;
-
- // Calculate how many messages were actually received in the last batch. This will be the batch size
- // except where the number expected is not a multiple of the batch size and this is the first remaining
- // count to cross a batch size boundary, in which case it will be the number expected modulo the batch
- // size.
- int receivedInBatch = ((expected - remainingCount) < _batchSize) ? (expected % _batchSize) : _batchSize;
-
- // Register a test result for the correlation id.
- try
- {
- tc.completeTest(true, receivedInBatch);
- }
- catch (InterruptedException e)
- {
- // Ignore this. It means the test runner wants to stop as soon as possible.
- _logger.warn("Got InterruptedException.", e);
- }
- }
- // Else ignore, test timed out. Should log a fail here?
- }
- }
- }
-
- /**
- * Holds state specific to each correlation id, needed to output test results. This consists of the count of
- * the total expected number of messages, and the timing controller for the thread sending those message ids.
- */
- private static class PerCorrelationId
- {
- public int _expectedCount;
- public TimingController _tc;
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java
deleted file mode 100644
index 0afec83b19..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java
+++ /dev/null
@@ -1,107 +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.
- *
- */
-package org.apache.qpid.ping;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.requestreply.PingPongProducer;
-
-import javax.jms.Destination;
-
-import java.util.List;
-import java.util.Properties;
-
-/**
- * PingClient is a {@link PingPongProducer} that does not need a {@link org.apache.qpid.requestreply.PingPongBouncer}
- * to send replies to its pings. It simply listens to its own ping destinations, rather than seperate reply queues.
- * It is an all in one ping client, that produces and consumes its own pings.
- *
- * <p/>The constructor increments a count of the number of ping clients created. It is assumed that where many
- * are created they will all be run in parallel and be active in sending and consuming pings at the same time.
- * If the unique destinations flag is not set and a pub/sub ping cycle is being run, this means that they will all hear
- * pings sent by each other. The expected number of pings received will therefore be multiplied up by the number of
- * active ping clients. The {@link #getConsumersPerDestination()} method is used to supply this multiplier under these
- * conditions.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create a ping producer that listens to its own pings <td> {@link PingPongProducer}
- * <tr><td> Count the number of ping producers and produce multiplier for scaling up messages expected over topic pings.
- * </table>
- */
-public class PingClient extends PingPongProducer
-{
- /** Used for debugging. */
- private final Logger log = Logger.getLogger(PingClient.class);
-
- /** Used to count the number of ping clients created. */
- private static int _pingClientCount;
-
- /**
- * Creates a ping producer with the specified parameters, of which there are many. See the class level comments
- * for {@link PingPongProducer} for details. This constructor creates a connection to the broker and creates
- * producer and consumer sessions on it, to send and recieve its pings and replies on.
- *
- * @param overrides Properties containing any desired overrides to the defaults.
- *
- * @throws Exception Any exceptions are allowed to fall through.
- */
- public PingClient(Properties overrides) throws Exception
- {
- super(overrides);
-
- _pingClientCount++;
- }
-
- /**
- * Returns the ping destinations themselves as the reply destinations for this pinger to listen to. This has the
- * effect of making this pinger listen to its own pings.
- *
- * @return The ping destinations.
- */
- public List<Destination> getReplyDestinations()
- {
- return _pingDestinations;
- }
-
- /**
- * Supplies the multiplier for the number of ping clients that will hear each ping when doing pub/sub pinging.
- *
- * @return The scaling up of the number of expected pub/sub pings.
- */
- public int getConsumersPerDestination()
- {
- log.debug("public int getConsumersPerDestination(): called");
-
- if (_isUnique)
- {
- log.debug(_noOfConsumers + " consumer per destination.");
-
- return _noOfConsumers;
- }
- else
- {
- log.debug((_pingClientCount * _noOfConsumers) + " consumers per destination.");
-
- return _pingClientCount * _noOfConsumers;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java
deleted file mode 100644
index a15897c82b..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java
+++ /dev/null
@@ -1,452 +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.
- *
- */
-package org.apache.qpid.ping;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.requestreply.PingPongProducer;
-import org.apache.qpid.util.CommandLineParser;
-
-import org.apache.qpid.junit.extensions.util.MathUtils;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.*;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * PingDurableClient is a variation of the {@link PingPongProducer} ping tool. Instead of sending its pings and
- * receiving replies to them at the same time, this tool sends pings until it is signalled by some 'event' to stop
- * sending. It then waits for another signal before it re-opens a fresh connection and attempts to receive all of the
- * pings that it has succesfully sent. It is intended to be an interactive test that lets a user experiment with
- * failure conditions when using durable messaging.
- *
- * <p/>The events that can stop it from sending are input from the user on the console, failure of its connection to
- * the broker, completion of sending a specified number of messages, or expiry of a specified duration. In all cases
- * it will do its best to clean up and close the connection before opening a fresh connection to receive the pings
- * with.
- *
- * <p/>The event to re-connect and attempt to recieve the pings is input from the user on the console.
- *
- * <p/>This ping client inherits the configuration properties of its parent class ({@link PingPongProducer}) and
- * additionally accepts the following parameters:
- *
- * <p/><table><caption>Parameters</caption>
- * <tr><th> Parameter <th> Default <th> Comments
- * <tr><td> numMessages <td> 100 <td> The total number of messages to send.
- * <tr><td> numMessagesToAction <td> -1 <td> The number of messages to send before taking a custom 'action'.
- * <tr><td> duration <td> 30S <td> The length of time to ping for. (Format dDhHmMsS, for d days, h hours,
- * m minutes and s seconds).
- * </table>
- *
- * <p/>This ping client also overrides some of the defaults of its parent class, to provide a reasonable set up
- * when no parameters are specified.
- *
- * <p/><table><caption>Parameters</caption>
- * <tr><th> Parameter <th> Default <th> Comments
- * <tr><td> uniqueDests <td> false <td> Prevents destination names being timestamped.
- * <tr><td> transacted <td> true <td> Only makes sense to test with transactions.
- * <tr><td> persistent <td> true <td> Only makes sense to test persistent.
- * <tr><td> durableDests <td> true <td> Should use durable queues with persistent messages.
- * <tr><td> commitBatchSize <td> 10
- * <tr><td> rate <td> 20 <td> Total default test time is 5 seconds.
- * </table>
- *
- * <p/>When a number of messages or duration is specified, this ping client will ping until the first of those limits
- * is reached. Reaching the limit will be interpreted as the first signal to stop sending, and the ping client will
- * wait for the second signal before receiving its pings.
- *
- * <p/>This class provides a mechanism for extensions to add arbitrary actions, after a particular number of messages
- * have been sent. When the number of messages equal the value set in the 'numMessagesToAction' property is method,
- * the {@link #takeAction} method is called. By default this does nothing, but extensions of this class can provide
- * custom behaviour with alternative implementations of this method (for example taking a backup).
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Send and receive pings.
- * <tr><td> Accept user input to signal stop sending.
- * <tr><td> Accept user input to signal start receiving.
- * <tr><td> Provide feedback on pings sent versus pings received.
- * <tr><td> Provide extension point for arbitrary action on a particular message count.
- * </table>
- */
-public class PingDurableClient extends PingPongProducer implements ExceptionListener
-{
- private static final Logger log = Logger.getLogger(PingDurableClient.class);
-
- public static final String NUM_MESSAGES_PROPNAME = "numMessages";
- public static final String NUM_MESSAGES_DEFAULT = "100";
- public static final String DURATION_PROPNAME = "duration";
- public static final String DURATION_DEFAULT = "30S";
- public static final String NUM_MESSAGES_TO_ACTION_PROPNAME = "numMessagesToAction";
- public static final String NUM_MESSAGES_TO_ACTION_DEFAULT = "-1";
-
- /** The maximum length of time to wait whilst receiving pings before assuming that no more are coming. */
- private static final long TIME_OUT = 3000;
-
- static
- {
- defaults.setProperty(NUM_MESSAGES_PROPNAME, NUM_MESSAGES_DEFAULT);
- defaults.setProperty(DURATION_PROPNAME, DURATION_DEFAULT);
- defaults.setProperty(UNIQUE_DESTS_PROPNAME, "false");
- defaults.setProperty(TRANSACTED_PROPNAME, "true");
- defaults.setProperty(PERSISTENT_MODE_PROPNAME, "true");
- defaults.setProperty(TX_BATCH_SIZE_PROPNAME, "10");
- defaults.setProperty(RATE_PROPNAME, "20");
- defaults.setProperty(DURABLE_DESTS_PROPNAME, "true");
- defaults.setProperty(NUM_MESSAGES_TO_ACTION_PROPNAME, NUM_MESSAGES_TO_ACTION_DEFAULT);
- }
-
- /** Specifies the number of pings to send, if larger than 0. 0 means send until told to stop. */
- private int numMessages;
-
- /** Holds the number of messages to send before taking triggering the action. */
- private int numMessagesToAction;
-
- /** Sepcifies how long to ping for, if larger than 0. 0 means send until told to stop. */
- private long duration;
-
- /** Used to indciate that this application should terminate. Set by the shutdown hook. */
- private boolean terminate = false;
-
- /**
- * @throws Exception Any exceptions are allowed to fall through.
- */
- public PingDurableClient(Properties overrides) throws Exception
- {
- super(overrides);
- log.debug("public PingDurableClient(Properties overrides = " + overrides + "): called");
-
- // Extract the additional configuration parameters.
- ParsedProperties properties = new ParsedProperties(defaults);
- properties.putAll(overrides);
-
- numMessages = properties.getPropertyAsInteger(NUM_MESSAGES_PROPNAME);
- String durationSpec = properties.getProperty(DURATION_PROPNAME);
- numMessagesToAction = properties.getPropertyAsInteger(NUM_MESSAGES_TO_ACTION_PROPNAME);
-
- if (durationSpec != null)
- {
- duration = MathUtils.parseDuration(durationSpec) * 1000000;
- }
- }
-
- /**
- * Starts the ping/wait/receive process.
- *
- * @param args The command line arguments.
- */
- public static void main(String[] args)
- {
- try
- {
- // Create a ping producer overriding its defaults with all options passed on the command line.
- Properties options =
- CommandLineParser.processCommandLine(args, new CommandLineParser(new String[][] {}), System.getProperties());
- PingDurableClient pingProducer = new PingDurableClient(options);
-
- // Create a shutdown hook to terminate the ping-pong producer.
- Runtime.getRuntime().addShutdownHook(pingProducer.getShutdownHook());
-
- // Ensure that the ping pong producer is registered to listen for exceptions on the connection too.
- // pingProducer.getConnection().setExceptionListener(pingProducer);
-
- // Run the test procedure.
- int sent = pingProducer.send();
- pingProducer.closeConnection();
- pingProducer.waitForUser("Press return to begin receiving the pings.");
- pingProducer.receive(sent);
-
- System.exit(0);
- }
- catch (Exception e)
- {
- System.err.println(e.getMessage());
- log.error("Top level handler caught execption.", e);
- System.exit(1);
- }
- }
-
- /**
- * Performs the main test procedure implemented by this ping client. See the class level comment for details.
- */
- protected int send() throws Exception
- {
- log.debug("public void sendWaitReceive(): called");
-
- log.debug("duration = " + duration);
- log.debug("numMessages = " + numMessages);
-
- if (duration > 0)
- {
- System.out.println("Sending for up to " + (duration / 1000000000f) + " seconds.");
- }
-
- if (_rate > 0)
- {
- System.out.println("Sending at " + _rate + " messages per second.");
- }
-
- if (numMessages > 0)
- {
- System.out.println("Sending up to " + numMessages + " messages.");
- }
-
- // Establish the connection and the message producer.
- establishConnection(true, false);
- _connection.start();
-
- Message message = getTestMessage(getReplyDestinations().get(0), _messageSize, _persistent);
-
- // Send pings until a terminating condition is received.
- boolean endCondition = false;
- int messagesSent = 0;
- int messagesCommitted = 0;
- int messagesNotCommitted = 0;
- long start = System.nanoTime();
-
- // Clear console in.
- clearConsole();
-
- while (!endCondition)
- {
- boolean committed = false;
-
- try
- {
- committed = sendMessage(messagesSent, message) && _transacted;
-
- messagesSent++;
- messagesNotCommitted++;
-
- // Keep count of the number of messsages currently committed and pending commit.
- if (committed)
- {
- log.debug("Adding " + messagesNotCommitted + " messages to the committed count.");
- messagesCommitted += messagesNotCommitted;
- messagesNotCommitted = 0;
-
- System.out.println("Commited: " + messagesCommitted);
- }
- }
- catch (JMSException e)
- {
- log.debug("Got JMSException whilst sending.");
- _publish = false;
- }
-
- // Perform the arbitrary action if the number of messages sent has reached the right number.
- if (messagesSent == numMessagesToAction)
- {
- System.out.println("At action point, Messages sent = " + messagesSent + ", Messages Committed = "
- + messagesCommitted + ", Messages not Committed = " + messagesNotCommitted);
- takeAction();
- }
-
- // Determine if the end condition has been met, based on the number of messages, time passed, errors on
- // the connection or user input.
- long now = System.nanoTime();
-
- if ((duration != 0) && ((now - start) > duration))
- {
- System.out.println("Send halted because duration expired.");
- endCondition = true;
- }
- else if ((numMessages != 0) && (messagesSent >= numMessages))
- {
- System.out.println("Send halted because # messages completed.");
- endCondition = true;
- }
- else if (System.in.available() > 0)
- {
- System.out.println("Send halted by user input.");
- endCondition = true;
-
- clearConsole();
- }
- else if (!_publish)
- {
- System.out.println("Send halted by error on the connection.");
- endCondition = true;
- }
- }
-
- log.debug("messagesSent = " + messagesSent);
- log.debug("messagesCommitted = " + messagesCommitted);
- log.debug("messagesNotCommitted = " + messagesNotCommitted);
-
- System.out.println("Messages sent: " + messagesSent + ", Messages Committed = " + messagesCommitted
- + ", Messages not Committed = " + messagesNotCommitted);
-
- return messagesSent;
- }
-
- protected void closeConnection()
- {
- // Clean up the connection.
- try
- {
- close();
- }
- catch (JMSException e)
- {
- log.debug("There was an error whilst closing the connection: " + e, e);
- System.out.println("There was an error whilst closing the connection.");
-
- // Ignore as did best could manage to clean up.
- }
- }
-
- protected void receive(int messagesSent) throws Exception
- {
- // Re-establish the connection and the message consumer.
- _queueJVMSequenceID = new AtomicInteger();
- _queueSharedID = new AtomicInteger();
-
- establishConnection(false, true);
- _consumer[0].setMessageListener(null);
- _consumerConnection[0].start();
-
- // Try to receive all of the pings that were successfully sent.
- int messagesReceived = 0;
- boolean endCondition = false;
-
- while (!endCondition)
- {
- // Message received = _consumer.receiveNoWait();
- Message received = _consumer[0].receive(TIME_OUT);
- log.debug("received = " + received);
-
- if (received != null)
- {
- messagesReceived++;
- }
-
- // Determine if the end condition has been met, based on the number of messages and time passed since last
- // receiving a message.
- if (received == null)
- {
- System.out.println("Timed out.");
- endCondition = true;
- }
- else if (messagesReceived >= messagesSent)
- {
- System.out.println("Got all messages.");
- endCondition = true;
- }
- }
-
- // Ensure messages received are committed.
- if (_consTransacted)
- {
- try
- {
- _consumerSession[0].commit();
- System.out.println("Committed for all messages received.");
- }
- catch (JMSException e)
- {
- log.debug("Error during commit: " + e, e);
- System.out.println("Error during commit.");
- try
- {
- _consumerSession[0].rollback();
- System.out.println("Rolled back on all messages received.");
- }
- catch (JMSException e2)
- {
- log.debug("Error during rollback: " + e, e);
- System.out.println("Error on roll back of all messages received.");
- }
-
- }
- }
-
- log.debug("messagesReceived = " + messagesReceived);
-
- System.out.println("Messages received: " + messagesReceived);
-
- // Clean up the connection.
- close();
- }
-
- /**
- * Clears any pending input from the console.
- */
- private void clearConsole()
- {
- try
- {
- BufferedReader bis = new BufferedReader(new InputStreamReader(System.in));
-
- // System.in.skip(System.in.available());
- while (bis.ready())
- {
- bis.readLine();
- }
- }
- catch (IOException e)
- { }
- }
-
- /**
- * Returns the ping destinations themselves as the reply destinations for this pinger to listen to. This has the
- * effect of making this pinger listen to its own pings.
- *
- * @return The ping destinations.
- */
- public List<Destination> getReplyDestinations()
- {
- return _pingDestinations;
- }
-
- /**
- * Gets a shutdown hook that will cleanly shut this down when it is running the ping loop. This can be registered with
- * the runtime system as a shutdown hook. This shutdown hook sets an additional terminate flag, compared with the
- * shutdown hook in {@link PingPongProducer}, because the publish flag is used to indicate that sending or receiving
- * message should stop, not that the application should termiante.
- *
- * @return A shutdown hook for the ping loop.
- */
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- stop();
- terminate = true;
- }
- });
- }
-
- /**
- * Performs an aribtrary action once the 'numMesagesToAction' count is reached on sending messages. This default
- * implementation does nothing.
- */
- public void takeAction()
- { }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingLatencyTestPerf.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingLatencyTestPerf.java
deleted file mode 100644
index 5ba4004c56..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingLatencyTestPerf.java
+++ /dev/null
@@ -1,311 +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.
- *
- */
-package org.apache.qpid.ping;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.requestreply.PingPongProducer;
-
-import org.apache.qpid.junit.extensions.TimingController;
-import org.apache.qpid.junit.extensions.TimingControllerAware;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * PingLatencyTestPerf is a performance test that outputs multiple timings from its test method, using the timing
- * controller interface supplied by the test runner from a seperate listener thread. It outputs round trip timings for
- * individual ping messages rather than for how long a complete batch of messages took to process. It also differs from
- * the {@link PingTestPerf} test that it extends because it can output timings as replies are received, rather than
- * waiting until all expected replies are received.
- *
- * <p/>This test does not output timings for every single ping message, as when running at high volume, writing the test
- * log for a vast number of messages would slow the testing down. Instead samples ping latency occasionally. The
- * frequency of ping sampling is set using the {@link #TEST_RESULTS_BATCH_SIZE_PROPNAME} property, to override the
- * default of every {@link #DEFAULT_TEST_RESULTS_BATCH_SIZE}.
- *
- * <p/>The size parameter logged for each individual ping is set to the size of the batch of messages that the
- * individual timed ping was taken from, rather than 1 for a single message. This is so that the total throughput
- * (messages / time) can be calculated in order to examine the relationship between throughput and latency.
- *
- * <p/><table id="crc"><caption>CRC Card</caption> <tr><td> Responsibilities <th> Collaborations <tr><td> Send many ping
- * messages and output timings for sampled individual pings. </table>
- */
-public class PingLatencyTestPerf extends PingTestPerf implements TimingControllerAware
-{
- private static Logger _logger = Logger.getLogger(PingLatencyTestPerf.class);
-
- /** Holds the name of the property to get the test results logging batch size. */
- public static final String TEST_RESULTS_BATCH_SIZE_PROPNAME = "batchSize";
-
- /** Holds the default test results logging batch size. */
- public static final int DEFAULT_TEST_RESULTS_BATCH_SIZE = 1000;
-
- /** Used to hold the timing controller passed from the test runner. */
- private TimingController _timingController;
-
- /** Used to generate unique correlation ids for each test run. */
- private AtomicLong corellationIdGenerator = new AtomicLong();
-
- /**
- * Holds test specifics by correlation id. This consists of the expected number of messages and the timing
- * controler.
- */
- private Map<String, PerCorrelationId> perCorrelationIds =
- Collections.synchronizedMap(new HashMap<String, PerCorrelationId>());
-
- /** Holds the batched results listener, that does logging on batch boundaries. */
- private BatchedResultsListener batchedResultsListener = null;
-
- /**
- * Creates a new asynchronous ping performance test with the specified name.
- *
- * @param name The test name.
- */
- public PingLatencyTestPerf(String name)
- {
- super(name);
-
- // Sets up the test parameters with defaults.
- ParsedProperties.setSysPropertyIfNull(TEST_RESULTS_BATCH_SIZE_PROPNAME,
- Integer.toString(DEFAULT_TEST_RESULTS_BATCH_SIZE));
- }
-
- /** Compile all the tests into a test suite. */
- public static Test suite()
- {
- // Build a new test suite
- TestSuite suite = new TestSuite("Ping Latency Tests");
-
- // Run performance tests in read committed mode.
- suite.addTest(new PingLatencyTestPerf("testPingLatency"));
-
- return suite;
- }
-
- /**
- * Accepts a timing controller from the test runner.
- *
- * @param timingController The timing controller to register mutliple timings with.
- */
- public void setTimingController(TimingController timingController)
- {
- _timingController = timingController;
- }
-
- /**
- * Gets the timing controller passed in by the test runner.
- *
- * @return The timing controller passed in by the test runner.
- */
- public TimingController getTimingController()
- {
- return _timingController;
- }
-
- /**
- * Sends the specified number of pings, asynchronously outputs timings on every batch boundary, and waits until all
- * replies have been received or a time out occurs before exiting this method.
- *
- * @param numPings The number of pings to send.
- */
- public void testPingLatency(int numPings) throws Exception
- {
- _logger.debug("public void testPingLatency(int numPings): called");
-
- // Ensure that at least one ping was requeusted.
- if (numPings == 0)
- {
- _logger.error("Number of pings requested was zero.");
- }
-
- // Get the per thread test setup to run the test through.
- PerThreadSetup perThreadSetup = threadSetup.get();
- PingClient pingClient = perThreadSetup._pingClient;
-
- // Advance the correlation id of messages to send, to make it unique for this run.
- String messageCorrelationId = Long.toString(corellationIdGenerator.incrementAndGet());
- _logger.debug("messageCorrelationId = " + messageCorrelationId);
-
- // Initialize the count and timing controller for the new correlation id.
- PerCorrelationId perCorrelationId = new PerCorrelationId();
- TimingController tc = getTimingController().getControllerForCurrentThread();
- perCorrelationId._tc = tc;
- perCorrelationId._expectedCount = numPings;
- perCorrelationIds.put(messageCorrelationId, perCorrelationId);
-
- // Attach the chained message listener to the ping producer to listen asynchronously for the replies to these
- // messages.
- pingClient.setChainedMessageListener(batchedResultsListener);
-
- // Generate a sample message of the specified size.
- Message msg =
- pingClient.getTestMessage(perThreadSetup._pingClient.getReplyDestinations().get(0),
- testParameters.getPropertyAsInteger(PingPongProducer.MESSAGE_SIZE_PROPNAME),
- testParameters.getPropertyAsBoolean(PingPongProducer.PERSISTENT_MODE_PROPNAME));
-
- // Send the requested number of messages, and wait until they have all been received.
- long timeout = Long.parseLong(testParameters.getProperty(PingPongProducer.TIMEOUT_PROPNAME));
- int numReplies = pingClient.pingAndWaitForReply(msg, numPings, timeout, null);
-
- // Check that all the replies were received and log a fail if they were not.
- if (numReplies < numPings)
- {
- tc.completeTest(false, 0);
- }
-
- // Remove the chained message listener from the ping producer.
- pingClient.removeChainedMessageListener();
-
- // Remove the expected count and timing controller for the message correlation id, to ensure they are cleaned up.
- perCorrelationIds.remove(messageCorrelationId);
- }
-
- /** Performs test fixture creation on a per thread basis. This will only be called once for each test thread. */
- public void threadSetUp()
- {
- _logger.debug("public void threadSetUp(): called");
-
- try
- {
- // Call the set up method in the super class. This creates a PingClient pinger.
- super.threadSetUp();
-
- // Create the chained message listener, only if it has not already been created. This is set up with the
- // batch size property, to tell it what batch size to output results on. A synchronized block is used to
- // ensure that only one thread creates this.
- synchronized (this)
- {
- if (batchedResultsListener == null)
- {
- int batchSize = Integer.parseInt(testParameters.getProperty(TEST_RESULTS_BATCH_SIZE_PROPNAME));
- batchedResultsListener = new BatchedResultsListener(batchSize);
- }
- }
-
- // Get the set up that the super class created.
- PerThreadSetup perThreadSetup = threadSetup.get();
-
- // Register the chained message listener on the pinger to do its asynchronous test timings from.
- perThreadSetup._pingClient.setChainedMessageListener(batchedResultsListener);
- }
- catch (Exception e)
- {
- _logger.warn("There was an exception during per thread setup.", e);
- }
- }
-
- /**
- * BatchedResultsListener is a {@link org.apache.qpid.requestreply.PingPongProducer.ChainedMessageListener} that can
- * be attached to the pinger, in order to receive notifications about every message received and the number
- * remaining to be received. Whenever the number remaining crosses a batch size boundary this results listener
- * outputs a test timing for the actual number of messages received in the current batch.
- */
- private class BatchedResultsListener implements PingPongProducer.ChainedMessageListener
- {
- /** The test results logging batch size. */
- int _batchSize;
- private boolean _strictAMQP;
-
- /**
- * Creates a results listener on the specified batch size.
- *
- * @param batchSize The batch size to use.
- */
- public BatchedResultsListener(int batchSize)
- {
- _batchSize = batchSize;
- _strictAMQP =
- Boolean.parseBoolean(System.getProperties().getProperty(AMQSession.STRICT_AMQP,
- AMQSession.STRICT_AMQP_DEFAULT));
- }
-
- /**
- * This callback method is called from all of the pingers that this test creates. It uses the correlation id
- * from the message to identify the timing controller for the test thread that was responsible for sending those
- * messages.
- *
- * @param message The message.
- * @param remainingCount The count of messages remaining to be received with a particular correlation id.
- *
- * @throws javax.jms.JMSException Any underlying JMSException is allowed to fall through.
- */
- public void onMessage(Message message, int remainingCount, long latency) throws JMSException
- {
- _logger.debug("public void onMessage(Message message, int remainingCount = " + remainingCount + "): called");
-
- // Check if a batch boundary has been crossed.
- if ((remainingCount % _batchSize) == 0)
- {
- // Extract the correlation id from the message.
- String correlationId = message.getJMSCorrelationID();
-
- // Get the details for the correlation id and check that they are not null. They can become null
- // if a test times out.
- PerCorrelationId perCorrelationId = perCorrelationIds.get(correlationId);
- if (perCorrelationId != null)
- {
- // Get the timing controller and expected count for this correlation id.
- TimingController tc = perCorrelationId._tc;
- int expected = perCorrelationId._expectedCount;
-
- // Calculate how many messages were actually received in the last batch. This will be the batch size
- // except where the number expected is not a multiple of the batch size and this is the first remaining
- // count to cross a batch size boundary, in which case it will be the number expected modulo the batch
- // size.
- int receivedInBatch = ((expected - remainingCount) < _batchSize) ? (expected % _batchSize) : _batchSize;
-
- // Register a test result for the correlation id.
- try
- {
- tc.completeTest(true, receivedInBatch, latency);
- }
- catch (InterruptedException e)
- {
- // Ignore this. It means the test runner wants to stop as soon as possible.
- _logger.warn("Got InterruptedException.", e);
- }
- }
- // Else ignore, test timed out. Should log a fail here?
- }
- }
- }
-
- /**
- * Holds state specific to each correlation id, needed to output test results. This consists of the count of the
- * total expected number of messages, and the timing controller for the thread sending those message ids.
- */
- private static class PerCorrelationId
- {
- public int _expectedCount;
- public TimingController _tc;
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java
deleted file mode 100644
index 04e723069a..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java
+++ /dev/null
@@ -1,93 +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.
- *
- */
-
-package org.apache.qpid.ping;
-
-import java.util.Properties;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.client.message.TestMessageFactory;
-import org.apache.qpid.util.CommandLineParser;
-
-/**
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * </table>
- */
-public class PingSendOnlyClient extends PingDurableClient
-{
- private static final Logger log = Logger.getLogger(PingSendOnlyClient.class);
-
- public PingSendOnlyClient(Properties overrides) throws Exception
- {
- super(overrides);
- }
-
- /**
- * Starts the ping/wait/receive process.
- *
- * @param args The command line arguments.
- */
- public static void main(String[] args)
- {
- try
- {
- // Create a ping producer overriding its defaults with all options passed on the command line.
- Properties options = CommandLineParser.processCommandLine(args, new CommandLineParser(new String[][] {}), System.getProperties());
- PingSendOnlyClient pingProducer = new PingSendOnlyClient(options);
-
- // Create a shutdown hook to terminate the ping-pong producer.
- Runtime.getRuntime().addShutdownHook(pingProducer.getShutdownHook());
-
- // Ensure that the ping pong producer is registered to listen for exceptions on the connection too.
- // pingProducer.getConnection().setExceptionListener(pingProducer);
-
- // Run the test procedure.
- int sent = pingProducer.send();
- pingProducer.waitForUser("Press return to close connection and quit.");
- pingProducer.closeConnection();
-
- System.exit(0);
- }
- catch (Exception e)
- {
- System.err.println(e.getMessage());
- log.error("Top level handler caught execption.", e);
- System.exit(1);
- }
- }
-
- public Message getTestMessage(Destination replyQueue, int messageSize, boolean persistent) throws JMSException
- {
- Message msg = TestMessageFactory.newTextMessage(_producerSession, messageSize);
-
- // Timestamp the message in nanoseconds.
- msg.setLongProperty(MESSAGE_TIMESTAMP_PROPNAME, System.nanoTime());
-
- return msg;
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingTestPerf.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingTestPerf.java
deleted file mode 100644
index 94b8ea662e..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingTestPerf.java
+++ /dev/null
@@ -1,196 +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.
- *
- */
-package org.apache.qpid.ping;
-
-import junit.framework.Assert;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.requestreply.PingPongProducer;
-
-import org.apache.qpid.junit.extensions.AsymptoticTestCase;
-import org.apache.qpid.junit.extensions.TestThreadAware;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-import javax.jms.*;
-
-/**
- * PingTestPerf is a ping test, that has been written with the intention of being scaled up to run many times
- * simultaneously to simluate many clients/producers/connections.
- *
- * <p/>A single run of the test using the default JUnit test runner will result in the sending and timing of a single
- * full round trip ping. This test may be scaled up using a suitable JUnit test runner.
- *
- * <p/>The setup/teardown cycle establishes a connection to a broker and sets up a queue to send ping messages to and a
- * temporary queue for replies. This setup is only established once for all the test repeats/threads that may be run,
- * except if the connection is lost in which case an attempt to re-establish the setup is made.
- *
- * <p/>The test cycle is: Connects to a queue, creates a temporary queue, creates messages containing a property that
- * is the name of the temporary queue, fires off a message on the original queue and waits for a response on the
- * temporary queue.
- *
- * <p/>Configurable test properties: message size, transacted or not, persistent or not. Broker connection details.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * </table>
- */
-public class PingTestPerf extends AsymptoticTestCase implements TestThreadAware
-{
- private static Logger _logger = Logger.getLogger(PingTestPerf.class);
-
- /** Thread local to hold the per-thread test setup fields. */
- ThreadLocal<PerThreadSetup> threadSetup = new ThreadLocal<PerThreadSetup>();
-
- /** Holds a property reader to extract the test parameters from. */
- protected ParsedProperties testParameters =
- TestContextProperties.getInstance(PingPongProducer.defaults /*System.getProperties()*/);
-
- public PingTestPerf(String name)
- {
- super(name);
-
- _logger.debug("testParameters = " + testParameters);
- }
-
- /**
- * Compile all the tests into a test suite.
- * @return The test method testPingOk.
- */
- public static Test suite()
- {
- // Build a new test suite
- TestSuite suite = new TestSuite("Ping Performance Tests");
-
- // Run performance tests in read committed mode.
- suite.addTest(new PingTestPerf("testPingOk"));
-
- return suite;
- }
-
- public void testPingOk(int numPings) throws Exception
- {
- if (numPings == 0)
- {
- Assert.fail("Number of pings requested was zero.");
- }
-
- // Get the per thread test setup to run the test through.
- PerThreadSetup perThreadSetup = threadSetup.get();
-
- if (perThreadSetup == null)
- {
- Assert.fail("Could not get per thread test setup, it was null.");
- }
-
- // Generate a sample message. This message is already time stamped and has its reply-to destination set.
- Message msg =
- perThreadSetup._pingClient.getTestMessage(perThreadSetup._pingClient.getReplyDestinations().get(0),
- testParameters.getPropertyAsInteger(PingPongProducer.MESSAGE_SIZE_PROPNAME),
- testParameters.getPropertyAsBoolean(PingPongProducer.PERSISTENT_MODE_PROPNAME));
-
- // start the test
- long timeout = Long.parseLong(testParameters.getProperty(PingPongProducer.TIMEOUT_PROPNAME));
- int numReplies = perThreadSetup._pingClient.pingAndWaitForReply(msg, numPings, timeout, null);
-
- // Fail the test if the timeout was exceeded.
- if (numReplies != perThreadSetup._pingClient.getExpectedNumPings(numPings))
- {
- Assert.fail("The ping timed out after " + timeout + " ms. Messages Sent = " + numPings + ", MessagesReceived = "
- + numReplies);
- }
- }
-
- /**
- * Performs test fixture creation on a per thread basis. This will only be called once for each test thread.
- */
- public void threadSetUp()
- {
- _logger.debug("public void threadSetUp(): called");
-
- try
- {
- PerThreadSetup perThreadSetup = new PerThreadSetup();
-
- // This is synchronized because there is a race condition, which causes one connection to sleep if
- // all threads try to create connection concurrently.
- synchronized (this)
- {
- // Establish a client to ping a Destination and listen the reply back from same Destination
- perThreadSetup._pingClient = new PingClient(testParameters);
- perThreadSetup._pingClient.establishConnection(true, true);
- }
- // Start the client connection
- perThreadSetup._pingClient.start();
-
- // Attach the per-thread set to the thread.
- threadSetup.set(perThreadSetup);
- }
- catch (Exception e)
- {
- _logger.warn("There was an exception during per thread setup.", e);
- }
- }
-
- /**
- * Performs test fixture clean
- */
- public void threadTearDown()
- {
- _logger.debug("public void threadTearDown(): called");
-
- try
- {
- // Get the per thread test fixture.
- PerThreadSetup perThreadSetup = threadSetup.get();
-
- // Close the pingers so that it cleans up its connection cleanly.
- synchronized (this)
- {
- if ((perThreadSetup != null) && (perThreadSetup._pingClient != null))
- {
- perThreadSetup._pingClient.close();
- }
- }
- }
- catch (JMSException e)
- {
- _logger.warn("There was an exception during per thread tear down.");
- }
- finally
- {
- // Ensure the per thread fixture is reclaimed.
- threadSetup.remove();
- }
- }
-
- protected static class PerThreadSetup
- {
- /**
- * Holds the test ping client.
- */
- protected PingClient _pingClient;
- protected String _correlationId;
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java
deleted file mode 100644
index 8e010ccf07..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java
+++ /dev/null
@@ -1,453 +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.
- *
- */
-package org.apache.qpid.requestreply;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.jms.*;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.jms.ConnectionListener;
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.topic.Config;
-import org.apache.qpid.exchange.ExchangeDefaults;
-
-/**
- * PingPongBouncer is a message listener the bounces back messages to their reply to destination. This is used to return
- * ping messages generated by {@link org.apache.qpid.requestreply.PingPongProducer} but could be used for other purposes
- * too.
- *
- * <p/>The correlation id from the received message is extracted, and placed into the reply as the correlation id. Messages
- * are bounced back to their reply-to destination. The original sender of the message has the option to use either a unique
- * temporary queue or the correlation id to correlate the original message to the reply.
- *
- * <p/>There is a verbose mode flag which causes information about each ping to be output to the console
- * (info level logging, so usually console). This can be helpfull to check the bounce backs are happening but should
- * be disabled for real timing tests as writing to the console will slow things down.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Bounce back messages to their reply to destination.
- * <tr><td> Provide command line invocation to start the bounce back on a configurable broker url.
- * </table>
- *
- * @todo Replace the command line parsing with a neater tool.
- *
- * @todo Make verbose accept a number of messages, only prints to console every X messages.
- */
-public class PingPongBouncer implements MessageListener
-{
- private static final Logger _logger = Logger.getLogger(PingPongBouncer.class);
-
- /** The default prefetch size for the message consumer. */
- private static final int PREFETCH = 1;
-
- /** The default no local flag for the message consumer. */
- private static final boolean NO_LOCAL = true;
-
- private static final String DEFAULT_DESTINATION_NAME = "ping";
-
- /** The default exclusive flag for the message consumer. */
- private static final boolean EXCLUSIVE = false;
-
- /** A convenient formatter to use when time stamping output. */
- protected static final SimpleDateFormat timestampFormatter = new SimpleDateFormat("hh:mm:ss:SS");
-
- /** Used to indicate that the reply generator should log timing info to the console (logger info level). */
- private boolean _verbose = false;
-
- /** Determines whether this bounce back client bounces back messages persistently. */
- private boolean _persistent = false;
-
- private Destination _consumerDestination;
-
- /** Keeps track of the response destination of the previous message for the last reply to producer cache. */
- private Destination _lastResponseDest;
-
- /** The producer for sending replies with. */
- private MessageProducer _replyProducer;
-
- /** The consumer controlSession. */
- private Session _consumerSession;
-
- /** The producer controlSession. */
- private Session _producerSession;
-
- /** Holds the connection to the broker. */
- private AMQConnection _connection;
-
- /** Flag used to indicate if this is a point to point or pub/sub ping client. */
- private boolean _isPubSub = false;
-
- /**
- * This flag is used to indicate that the user should be prompted to kill a broker, in order to test
- * failover, immediately before committing a transaction.
- */
- protected boolean _failBeforeCommit = false;
-
- /**
- * This flag is used to indicate that the user should be prompted to a kill a broker, in order to test
- * failover, immediate after committing a transaction.
- */
- protected boolean _failAfterCommit = false;
-
- /**
- * Creates a PingPongBouncer on the specified producer and consumer sessions.
- *
- * @param brokerDetails The addresses of the brokers to connect to.
- * @param username The broker username.
- * @param password The broker password.
- * @param virtualpath The virtual host name within the broker.
- * @param destinationName The name of the queue to receive pings on
- * (or root of the queue name where many queues are generated).
- * @param persistent A flag to indicate that persistent message should be used.
- * @param transacted A flag to indicate that pings should be sent within transactions.
- * @param selector A message selector to filter received pings with.
- * @param verbose A flag to indicate that message timings should be sent to the console.
- *
- * @throws Exception All underlying exceptions allowed to fall through. This is only test code...
- */
- public PingPongBouncer(String brokerDetails, String username, String password, String virtualpath,
- String destinationName, boolean persistent, boolean transacted, String selector, boolean verbose,
- boolean pubsub) throws Exception
- {
- // Create a client id to uniquely identify this client.
- InetAddress address = InetAddress.getLocalHost();
- String clientId = address.getHostName() + System.currentTimeMillis();
- _verbose = verbose;
- _persistent = persistent;
- setPubSub(pubsub);
- // Connect to the broker.
- setConnection(new AMQConnection(brokerDetails, username, password, clientId, virtualpath));
- _logger.info("Connected with URL:" + getConnection().toURL());
-
- // Set up the failover notifier.
- getConnection().setConnectionListener(new FailoverNotifier());
-
- // Create a controlSession to listen for messages on and one to send replies on, transactional depending on the
- // command line option.
- _consumerSession = (Session) getConnection().createSession(transacted, Session.AUTO_ACKNOWLEDGE);
- _producerSession = (Session) getConnection().createSession(transacted, Session.AUTO_ACKNOWLEDGE);
-
- // Create the queue to listen for message on.
- createConsumerDestination(destinationName);
- MessageConsumer consumer =
- _consumerSession.createConsumer(_consumerDestination, PREFETCH, NO_LOCAL, EXCLUSIVE, selector);
-
- // Create a producer for the replies, without a default destination.
- _replyProducer = _producerSession.createProducer(null);
- _replyProducer.setDisableMessageTimestamp(true);
- _replyProducer.setDeliveryMode(_persistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
-
- // Set this up to listen for messages on the queue.
- consumer.setMessageListener(this);
- }
-
- /**
- * Starts a stand alone ping-pong client running in verbose mode.
- *
- * @param args
- */
- public static void main(String[] args) throws Exception
- {
- System.out.println("Starting...");
-
- // Display help on the command line.
- if (args.length == 0)
- {
- _logger.info("Running test with default values...");
- //usage();
- //System.exit(0);
- }
-
- // Extract all command line parameters.
- Config config = new Config();
- config.setOptions(args);
- String brokerDetails = config.getHost() + ":" + config.getPort();
- String virtualpath = "test";
- String destinationName = config.getDestination();
- if (destinationName == null)
- {
- destinationName = DEFAULT_DESTINATION_NAME;
- }
-
- String selector = config.getSelector();
- boolean transacted = config.isTransacted();
- boolean persistent = config.usePersistentMessages();
- boolean pubsub = config.isPubSub();
- boolean verbose = true;
-
- //String selector = null;
-
- // Instantiate the ping pong client with the command line options and start it running.
- PingPongBouncer pingBouncer =
- new PingPongBouncer(brokerDetails, "guest", "guest", virtualpath, destinationName, persistent, transacted,
- selector, verbose, pubsub);
- pingBouncer.getConnection().start();
-
- System.out.println("Waiting...");
- }
-
- private static void usage()
- {
- System.err.println("Usage: PingPongBouncer \n" + "-host : broker host\n" + "-port : broker port\n"
- + "-destinationname : queue/topic name\n" + "-transacted : (true/false). Default is false\n"
- + "-persistent : (true/false). Default is false\n"
- + "-pubsub : (true/false). Default is false\n" + "-selector : selector string\n");
- }
-
- /**
- * This is a callback method that is notified of all messages for which this has been registered as a message
- * listener on a message consumer. It sends a reply (pong) to all messages it receieves on the reply to
- * destination of the message.
- *
- * @param message The message that triggered this callback.
- */
- public void onMessage(Message message)
- {
- try
- {
- String messageCorrelationId = message.getJMSCorrelationID();
- if (_verbose)
- {
- _logger.info(timestampFormatter.format(new Date()) + ": Got ping with correlation id, "
- + messageCorrelationId);
- }
-
- // Get the reply to destination from the message and check it is set.
- Destination responseDest = message.getJMSReplyTo();
-
- if (responseDest == null)
- {
- _logger.debug("Cannot send reply because reply-to destination is null.");
-
- return;
- }
-
- // Spew out some timing information if verbose mode is on.
- if (_verbose)
- {
- Long timestamp = message.getLongProperty("timestamp");
-
- if (timestamp != null)
- {
- long diff = System.currentTimeMillis() - timestamp;
- _logger.info("Time to bounce point: " + diff);
- }
- }
-
- // Correlate the reply to the original.
- message.setJMSCorrelationID(messageCorrelationId);
-
- // Send the receieved message as the pong reply.
- _replyProducer.send(responseDest, message);
-
- if (_verbose)
- {
- _logger.info(timestampFormatter.format(new Date()) + ": Sent reply with correlation id, "
- + messageCorrelationId);
- }
-
- // Commit the transaction if running in transactional mode.
- commitTx(_producerSession);
- }
- catch (JMSException e)
- {
- _logger.debug("There was a JMSException: " + e.getMessage(), e);
- }
- }
-
- /**
- * Gets the underlying connection that this ping client is running on.
- *
- * @return The underlying connection that this ping client is running on.
- */
- public AMQConnection getConnection()
- {
- return _connection;
- }
-
- /**
- * Sets the connection that this ping client is using.
- *
- * @param connection The ping connection.
- */
- public void setConnection(AMQConnection connection)
- {
- this._connection = connection;
- }
-
- /**
- * Sets or clears the pub/sub flag to indiciate whether this client is pinging a queue or a topic.
- *
- * @param pubsub <tt>true</tt> if this client is pinging a topic, <tt>false</tt> if it is pinging a queue.
- */
- public void setPubSub(boolean pubsub)
- {
- _isPubSub = pubsub;
- }
-
- /**
- * Checks whether this client is a p2p or pub/sub ping client.
- *
- * @return <tt>true</tt> if this client is pinging a topic, <tt>false</tt> if it is pinging a queue.
- */
- public boolean isPubSub()
- {
- return _isPubSub;
- }
-
- /**
- * Convenience method to commit the transaction on the specified controlSession. If the controlSession to commit on is not
- * a transactional controlSession, this method does nothing.
- *
- * <p/>If the {@link #_failBeforeCommit} flag is set, this will prompt the user to kill the broker before the
- * commit is applied. If the {@link #_failAfterCommit} flag is set, this will prompt the user to kill the broker
- * after the commit is applied.
- *
- * @throws javax.jms.JMSException If the commit fails and then the rollback fails.
- */
- protected void commitTx(Session session) throws JMSException
- {
- if (session.getTransacted())
- {
- try
- {
- if (_failBeforeCommit)
- {
- _logger.debug("Failing Before Commit");
- doFailover();
- }
-
- session.commit();
-
- if (_failAfterCommit)
- {
- _logger.debug("Failing After Commit");
- doFailover();
- }
-
- _logger.debug("Session Commited.");
- }
- catch (JMSException e)
- {
- _logger.trace("JMSException on commit:" + e.getMessage(), e);
-
- try
- {
- session.rollback();
- _logger.debug("Message rolled back.");
- }
- catch (JMSException jmse)
- {
- _logger.trace("JMSE on rollback:" + jmse.getMessage(), jmse);
-
- // Both commit and rollback failed. Throw the rollback exception.
- throw jmse;
- }
- }
- }
- }
-
- /**
- * Prompts the user to terminate the named broker, in order to test failover functionality. This method will block
- * until the user supplied some input on the terminal.
- *
- * @param broker The name of the broker to terminate.
- */
- protected void doFailover(String broker)
- {
- System.out.println("Kill Broker " + broker + " now.");
- try
- {
- System.in.read();
- }
- catch (IOException e)
- { }
-
- System.out.println("Continuing.");
- }
-
- /**
- * Prompts the user to terminate the broker, in order to test failover functionality. This method will block
- * until the user supplied some input on the terminal.
- */
- protected void doFailover()
- {
- System.out.println("Kill Broker now.");
- try
- {
- System.in.read();
- }
- catch (IOException e)
- { }
-
- System.out.println("Continuing.");
-
- }
-
- private void createConsumerDestination(String name)
- {
- if (isPubSub())
- {
- _consumerDestination = new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME, name);
- }
- else
- {
- _consumerDestination = new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, name);
- }
- }
-
- /**
- * A connection listener that logs out any failover complete events. Could do more interesting things with this
- * at some point...
- */
- public static class FailoverNotifier implements ConnectionListener
- {
- public void bytesSent(long count)
- { }
-
- public void bytesReceived(long count)
- { }
-
- public boolean preFailover(boolean redirect)
- {
- return true;
- }
-
- public boolean preResubscribe()
- {
- return true;
- }
-
- public void failoverComplete()
- {
- _logger.info("App got failover complete callback.");
- }
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java
deleted file mode 100644
index f994cd138e..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java
+++ /dev/null
@@ -1,1718 +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.
- *
- */
-package org.apache.qpid.requestreply;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
-
-import org.apache.qpid.test.framework.TestUtils;
-
-import org.apache.qpid.junit.extensions.BatchedThrottle;
-import org.apache.qpid.junit.extensions.Throttle;
-import org.apache.qpid.junit.extensions.util.CommandLineParser;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import java.io.*;
-import java.net.InetAddress;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.SynchronousQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * PingPongProducer is a client that sends test messages, and waits for replies to these messages. The replies may
- * either be generated by another client (see {@link PingPongBouncer}, or an extension of it may be used that listens
- * to its own messages and does not send replies (see {@link org.apache.qpid.ping.PingClient}). The intention of ping
- * pong producer is that it is a swiss-army knife test client that makes almost every aspect of its behaviour
- * configurable.
- *
- * <p/>The pings are sent with a reply-to field set to a single temporary queue, which is the same for all pings. This
- * means that this class has to do some work to correlate pings with pongs; it expectes the original message correlation
- * id in the ping to be bounced back in the reply correlation id.
- *
- * <p/>This ping tool accepts a vast number of configuration options, all of which are passed in to the constructor. It
- * can ping topics or queues; ping multiple destinations; do persistent pings; send messages of any size; do pings within
- * transactions; control the number of pings to send in each transaction; limit its sending rate; and perform failover
- * testing. A complete list of accepted parameters, default values and comments on their usage is provided here:
- *
- * <p/><table><caption>Parameters</caption>
- * <tr><th> Parameter <th> Default <th> Comments
- * <tr><td> messageSize <td> 0 <td> Message size in bytes. Not including any headers.
- * <tr><td> destinationName <td> ping <td> The root name to use to generate destination names to ping.
- * <tr><td> persistent <td> false <td> Determines whether peristent delivery is used.
- * <tr><td> transacted <td> false <td> Determines whether messages are sent/received in transactions.
- * <tr><td> broker <td> tcp://localhost:5672 <td> Determines the broker to connect to.
- * <tr><td> virtualHost <td> test <td> Determines the virtual host to send all ping over.
- * <tr><td> rate <td> 0 <td> The maximum rate (in hertz) to send messages at. 0 means no limit.
- * <tr><td> verbose <td> false <td> The verbose flag for debugging. Prints to console on every message.
- * <tr><td> pubsub <td> false <td> Whether to ping topics or queues. Uses p2p by default.
- * <tr><td> failAfterCommit <td> false <td> Whether to prompt user to kill broker after a commit batch.
- * <tr><td> failBeforeCommit <td> false <td> Whether to prompt user to kill broker before a commit batch.
- * <tr><td> failAfterSend <td> false <td> Whether to prompt user to kill broker after a send.
- * <tr><td> failBeforeSend <td> false <td> Whether to prompt user to kill broker before a send.
- * <tr><td> failOnce <td> true <td> Whether to prompt for failover only once.
- * <tr><td> username <td> guest <td> The username to access the broker with.
- * <tr><td> password <td> guest <td> The password to access the broker with.
- * <tr><td> selector <td> null <td> Not used. Defines a message selector to filter pings with.
- * <tr><td> destinationCount <td> 1 <td> The number of destinations to send pings to.
- * <tr><td> numConsumers <td> 1 <td> The number of consumers on each destination.
- * <tr><td> timeout <td> 30000 <td> In milliseconds. The timeout to stop waiting for replies.
- * <tr><td> commitBatchSize <td> 1 <td> The number of messages per transaction in transactional mode.
- * <tr><td> uniqueDests <td> true <td> Whether each receivers only listens to one ping destination or all.
- * <tr><td> durableDests <td> false <td> Whether or not durable destinations are used.
- * <tr><td> ackMode <td> AUTO_ACK <td> The message acknowledgement mode. Possible values are:
- * 0 - SESSION_TRANSACTED
- * 1 - AUTO_ACKNOWLEDGE
- * 2 - CLIENT_ACKNOWLEDGE
- * 3 - DUPS_OK_ACKNOWLEDGE
- * 257 - NO_ACKNOWLEDGE
- * 258 - PRE_ACKNOWLEDGE
- * <tr><td> consTransacted <td> false <td> Whether or not consumers use transactions. Defaults to the same value
- * as the 'transacted' option if not seperately defined.
- * <tr><td> consAckMode <td> AUTO_ACK <td> The message acknowledgement mode for consumers. Defaults to the same
- * value as 'ackMode' if not seperately defined.
- * <tr><td> maxPending <td> 0 <td> The maximum size in bytes, of messages sent but not yet received.
- * Limits the volume of messages currently buffered on the client
- * or broker. Can help scale test clients by limiting amount of buffered
- * data to avoid out of memory errors.
- * </table>
- *
- * <p/>This implements the Runnable interface with a run method that implements an infinite ping loop. The ping loop
- * does all its work through helper methods, so that code wishing to run a ping-pong cycle is not forced to do so by
- * starting a new thread. The command line invocation does take advantage of this ping loop. A shutdown hook is also
- * registered to terminate the ping-pong loop cleanly.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide a ping and wait for all responses cycle.
- * <tr><td> Provide command line invocation to loop the ping cycle on a configurable broker url.
- * </table>
- *
- * @todo Use read/write lock in the onmessage, not for reading writing but to make use of a shared and exlcusive lock pair.
- * Obtain read lock on all messages, before decrementing the message count. At the end of the on message method add a
- * block that obtains the write lock for the very last message, releases any waiting producer. Means that the last
- * message waits until all other messages have been handled before releasing producers but allows messages to be
- * processed concurrently, unlike the current synchronized block.
- */
-public class PingPongProducer implements Runnable, ExceptionListener
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(PingPongProducer.class);
-
- /** Holds the name of the property to determine whether of not client id is overridden at connection time. */
- public static final String OVERRIDE_CLIENT_ID_PROPNAME = "overrideClientId";
-
- /** Holds the default value of the override client id flag. */
- public static final String OVERRIDE_CLIENT_ID_DEAFULT = "false";
-
- /** Holds the name of the property to define the JNDI factory name with. */
- public static final String FACTORY_NAME_PROPNAME = "factoryName";
-
- /** Holds the default JNDI name of the connection factory. */
- public static final String FACTORY_NAME_DEAFULT = "local";
-
- /** Holds the name of the property to set the JNDI initial context properties with. */
- public static final String FILE_PROPERTIES_PROPNAME = "properties";
-
- /** Holds the default file name of the JNDI initial context properties. */
- public static final String FILE_PROPERTIES_DEAFULT = "perftests.properties";
-
- /** Holds the name of the property to get the test message size from. */
- public static final String MESSAGE_SIZE_PROPNAME = "messageSize";
-
- /** Used to set up a default message size. */
- public static final int MESSAGE_SIZE_DEAFULT = 0;
-
- /** Holds the name of the property to get the ping queue name from. */
- public static final String PING_QUEUE_NAME_PROPNAME = "destinationName";
-
- /** Holds the name of the default destination to send pings on. */
- public static final String PING_QUEUE_NAME_DEFAULT = "ping";
-
- /** Holds the name of the property to get the queue name postfix from. */
- public static final String QUEUE_NAME_POSTFIX_PROPNAME = "queueNamePostfix";
-
- /** Holds the default queue name postfix value. */
- public static final String QUEUE_NAME_POSTFIX_DEFAULT = "";
-
- /** Holds the name of the property to get the test delivery mode from. */
- public static final String PERSISTENT_MODE_PROPNAME = "persistent";
-
- /** Holds the message delivery mode to use for the test. */
- public static final boolean PERSISTENT_MODE_DEFAULT = false;
-
- /** Holds the name of the property to get the test transactional mode from. */
- public static final String TRANSACTED_PROPNAME = "transacted";
-
- /** Holds the transactional mode to use for the test. */
- public static final boolean TRANSACTED_DEFAULT = false;
-
- /** Holds the name of the property to get the test consumer transacted mode from. */
- public static final String CONSUMER_TRANSACTED_PROPNAME = "consTransacted";
-
- /** Holds the consumer transactional mode default setting. */
- public static final boolean CONSUMER_TRANSACTED_DEFAULT = false;
-
- /** Holds the name of the property to get the test broker url from. */
- public static final String BROKER_PROPNAME = "broker";
-
- /** Holds the default broker url for the test. */
- public static final String BROKER_DEFAULT = "tcp://localhost:5672";
-
- /** Holds the name of the property to get the test broker virtual path. */
- public static final String VIRTUAL_HOST_PROPNAME = "virtualHost";
-
- /** Holds the default virtual path for the test. */
- public static final String VIRTUAL_HOST_DEFAULT = "";
-
- /** Holds the name of the property to get the message rate from. */
- public static final String RATE_PROPNAME = "rate";
-
- /** Defines the default rate (in pings per second) to send pings at. 0 means as fast as possible, no restriction. */
- public static final int RATE_DEFAULT = 0;
-
- /** Holds the name of the property to get the verbose mode proeprty from. */
- public static final String VERBOSE_PROPNAME = "verbose";
-
- /** Holds the default verbose mode. */
- public static final boolean VERBOSE_DEFAULT = false;
-
- /** Holds the name of the property to get the p2p or pub/sub messaging mode from. */
- public static final String PUBSUB_PROPNAME = "pubsub";
-
- /** Holds the pub/sub mode default, true means ping a topic, false means ping a queue. */
- public static final boolean PUBSUB_DEFAULT = false;
-
- /** Holds the name of the property to get the fail after commit flag from. */
- public static final String FAIL_AFTER_COMMIT_PROPNAME = "failAfterCommit";
-
- /** Holds the default failover after commit test flag. */
- public static final boolean FAIL_AFTER_COMMIT_DEFAULT = false;
-
- /** Holds the name of the proeprty to get the fail before commit flag from. */
- public static final String FAIL_BEFORE_COMMIT_PROPNAME = "failBeforeCommit";
-
- /** Holds the default failover before commit test flag. */
- public static final boolean FAIL_BEFORE_COMMIT_DEFAULT = false;
-
- /** Holds the name of the proeprty to get the fail after send flag from. */
- public static final String FAIL_AFTER_SEND_PROPNAME = "failAfterSend";
-
- /** Holds the default failover after send test flag. */
- public static final boolean FAIL_AFTER_SEND_DEFAULT = false;
-
- /** Holds the name of the property to get the fail before send flag from. */
- public static final String FAIL_BEFORE_SEND_PROPNAME = "failBeforeSend";
-
- /** Holds the default failover before send test flag. */
- public static final boolean FAIL_BEFORE_SEND_DEFAULT = false;
-
- /** Holds the name of the property to get the fail once flag from. */
- public static final String FAIL_ONCE_PROPNAME = "failOnce";
-
- /** The default failover once flag, true means only do one failover, false means failover on every commit cycle. */
- public static final boolean FAIL_ONCE_DEFAULT = true;
-
- /** Holds the name of the property to get the broker access username from. */
- public static final String USERNAME_PROPNAME = "username";
-
- /** Holds the default broker log on username. */
- public static final String USERNAME_DEFAULT = "guest";
-
- /** Holds the name of the property to get the broker access password from. */
- public static final String PASSWORD_PROPNAME = "password";
-
- /** Holds the default broker log on password. */
- public static final String PASSWORD_DEFAULT = "guest";
-
- /** Holds the name of the proeprty to get the. */
- public static final String SELECTOR_PROPNAME = "selector";
-
- /** Holds the default message selector. */
- public static final String SELECTOR_DEFAULT = "";
-
- /** Holds the name of the property to get the destination count from. */
- public static final String DESTINATION_COUNT_PROPNAME = "destinationCount";
-
- /** Defines the default number of destinations to ping. */
- public static final int DESTINATION_COUNT_DEFAULT = 1;
-
- /** Holds the name of the property to get the number of consumers per destination from. */
- public static final String NUM_CONSUMERS_PROPNAME = "numConsumers";
-
- /** Defines the default number consumers per destination. */
- public static final int NUM_CONSUMERS_DEFAULT = 1;
-
- /** Holds the name of the property to get the waiting timeout for response messages. */
- public static final String TIMEOUT_PROPNAME = "timeout";
-
- /** Default time to wait before assuming that a ping has timed out. */
- public static final long TIMEOUT_DEFAULT = 30000;
-
- /** Holds the name of the property to get the commit batch size from. */
- public static final String TX_BATCH_SIZE_PROPNAME = "commitBatchSize";
-
- /** Defines the default number of pings to send in each transaction when running transactionally. */
- public static final int TX_BATCH_SIZE_DEFAULT = 1;
-
- /** Holds the name of the property to get the unique destinations flag from. */
- public static final String UNIQUE_DESTS_PROPNAME = "uniqueDests";
-
- /** Defines the default value for the unique destinations property. */
- public static final boolean UNIQUE_DESTS_DEFAULT = true;
-
- /** Holds the name of the property to get the durable destinations flag from. */
- public static final String DURABLE_DESTS_PROPNAME = "durableDests";
-
- /** Defines the default value of the durable destinations flag. */
- public static final boolean DURABLE_DESTS_DEFAULT = false;
-
- /** Holds the name of the proeprty to get the message acknowledgement mode from. */
- public static final String ACK_MODE_PROPNAME = "ackMode";
-
- /** Defines the default message acknowledgement mode. */
- public static final int ACK_MODE_DEFAULT = Session.AUTO_ACKNOWLEDGE;
-
- /** Holds the name of the property to get the consumers message acknowledgement mode from. */
- public static final String CONSUMER_ACK_MODE_PROPNAME = "consAckMode";
-
- /** Defines the default consumers message acknowledgement mode. */
- public static final int CONSUMER_ACK_MODE_DEFAULT = Session.AUTO_ACKNOWLEDGE;
-
- /** Holds the name of the property to get the maximum pending message size setting from. */
- public static final String MAX_PENDING_PROPNAME = "maxPending";
-
- /** Defines the default value for the maximum pending message size setting. 0 means no limit. */
- public static final int MAX_PENDING_DEFAULT = 0;
-
- /** Defines the default prefetch size to use when consuming messages. */
- public static final int PREFETCH_DEFAULT = 100;
-
- /** Defines the default value of the no local flag to use when consuming messages. */
- public static final boolean NO_LOCAL_DEFAULT = false;
-
- /** Defines the default value of the exclusive flag to use when consuming messages. */
- public static final boolean EXCLUSIVE_DEFAULT = false;
-
- /** Holds the name of the property to store nanosecond timestamps in ping messages with. */
- public static final String MESSAGE_TIMESTAMP_PROPNAME = "timestamp";
-
- /** Holds the default configuration properties. */
- public static ParsedProperties defaults = new ParsedProperties();
-
- static
- {
- defaults.setPropertyIfNull(OVERRIDE_CLIENT_ID_PROPNAME, OVERRIDE_CLIENT_ID_DEAFULT);
- defaults.setPropertyIfNull(FILE_PROPERTIES_PROPNAME, FILE_PROPERTIES_DEAFULT);
- defaults.setPropertyIfNull(FACTORY_NAME_PROPNAME, FACTORY_NAME_DEAFULT);
- defaults.setPropertyIfNull(BROKER_PROPNAME, BROKER_DEFAULT);
- defaults.setPropertyIfNull(USERNAME_PROPNAME, USERNAME_DEFAULT);
- defaults.setPropertyIfNull(PASSWORD_PROPNAME, PASSWORD_DEFAULT);
- defaults.setPropertyIfNull(VIRTUAL_HOST_PROPNAME, VIRTUAL_HOST_DEFAULT);
- defaults.setPropertyIfNull(PING_QUEUE_NAME_PROPNAME, PING_QUEUE_NAME_DEFAULT);
- defaults.setPropertyIfNull(QUEUE_NAME_POSTFIX_PROPNAME, QUEUE_NAME_POSTFIX_DEFAULT);
- defaults.setPropertyIfNull(SELECTOR_PROPNAME, SELECTOR_DEFAULT);
- defaults.setPropertyIfNull(TRANSACTED_PROPNAME, TRANSACTED_DEFAULT);
- defaults.setPropertyIfNull(CONSUMER_TRANSACTED_PROPNAME, CONSUMER_TRANSACTED_DEFAULT);
- defaults.setPropertyIfNull(PERSISTENT_MODE_PROPNAME, PERSISTENT_MODE_DEFAULT);
- defaults.setPropertyIfNull(ACK_MODE_PROPNAME, ACK_MODE_DEFAULT);
- defaults.setPropertyIfNull(CONSUMER_ACK_MODE_PROPNAME, CONSUMER_ACK_MODE_DEFAULT);
- defaults.setPropertyIfNull(MESSAGE_SIZE_PROPNAME, MESSAGE_SIZE_DEAFULT);
- defaults.setPropertyIfNull(VERBOSE_PROPNAME, VERBOSE_DEFAULT);
- defaults.setPropertyIfNull(PUBSUB_PROPNAME, PUBSUB_DEFAULT);
- defaults.setPropertyIfNull(UNIQUE_DESTS_PROPNAME, UNIQUE_DESTS_DEFAULT);
- defaults.setPropertyIfNull(DURABLE_DESTS_PROPNAME, DURABLE_DESTS_DEFAULT);
- defaults.setPropertyIfNull(FAIL_BEFORE_COMMIT_PROPNAME, FAIL_BEFORE_COMMIT_DEFAULT);
- defaults.setPropertyIfNull(FAIL_AFTER_COMMIT_PROPNAME, FAIL_AFTER_COMMIT_DEFAULT);
- defaults.setPropertyIfNull(FAIL_BEFORE_SEND_PROPNAME, FAIL_BEFORE_SEND_DEFAULT);
- defaults.setPropertyIfNull(FAIL_AFTER_SEND_PROPNAME, FAIL_AFTER_SEND_DEFAULT);
- defaults.setPropertyIfNull(FAIL_ONCE_PROPNAME, FAIL_ONCE_DEFAULT);
- defaults.setPropertyIfNull(TX_BATCH_SIZE_PROPNAME, TX_BATCH_SIZE_DEFAULT);
- defaults.setPropertyIfNull(DESTINATION_COUNT_PROPNAME, DESTINATION_COUNT_DEFAULT);
- defaults.setPropertyIfNull(NUM_CONSUMERS_PROPNAME, NUM_CONSUMERS_DEFAULT);
- defaults.setPropertyIfNull(RATE_PROPNAME, RATE_DEFAULT);
- defaults.setPropertyIfNull(TIMEOUT_PROPNAME, TIMEOUT_DEFAULT);
- defaults.setPropertyIfNull(MAX_PENDING_PROPNAME, MAX_PENDING_DEFAULT);
- }
-
- /** Allows setting of client ID on the connection, rather than through the connection URL. */
- protected boolean _overrideClientId;
-
- /** Holds the JNDI name of the JMS connection factory. */
- protected String _factoryName;
-
- /** Holds the name of the properties file to configure JNDI with. */
- protected String _fileProperties;
-
- /** Holds the broker url. */
- protected String _brokerDetails;
-
- /** Holds the username to access the broker with. */
- protected String _username;
-
- /** Holds the password to access the broker with. */
- protected String _password;
-
- /** Holds the virtual host on the broker to run the tests through. */
- protected String _virtualpath;
-
- /** Holds the root name from which to generate test destination names. */
- protected String _destinationName;
-
- /** Holds the default queue name postfix value. */
- protected String _queueNamePostfix;
-
- /** Holds the message selector to filter the pings with. */
- protected String _selector;
-
- /** Holds the producers transactional mode flag. */
- protected boolean _transacted;
-
- /** Holds the consumers transactional mode flag. */
- protected boolean _consTransacted;
-
- /** Determines whether this producer sends persistent messages. */
- protected boolean _persistent;
-
- /** Holds the acknowledgement mode used for the producers. */
- protected int _ackMode;
-
- /** Holds the acknowledgement mode setting for the consumers. */
- protected int _consAckMode;
-
- /** Determines what size of messages this producer sends. */
- protected int _messageSize;
-
- /** Used to indicate that the ping loop should print out whenever it pings. */
- protected boolean _verbose;
-
- /** Flag used to indicate if this is a point to point or pub/sub ping client. */
- protected boolean _isPubSub;
-
- /** Flag used to indicate if the destinations should be unique client. */
- protected boolean _isUnique;
-
- /** Flag used to indicate that durable destination should be used. */
- protected boolean _isDurable;
-
- /** Flag used to indicate that the user should be prompted to terminate a broker, to test failover before a commit. */
- protected boolean _failBeforeCommit;
-
- /** Flag used to indicate that the user should be prompted to terminate a broker, to test failover after a commit. */
- protected boolean _failAfterCommit;
-
- /** Flag used to indicate that the user should be prompted to terminate a broker, to test failover before a send. */
- protected boolean _failBeforeSend;
-
- /** Flag used to indicate that the user should be prompted to terminate a broker, to test failover after a send. */
- protected boolean _failAfterSend;
-
- /** Flag used to indicate that failover prompting should only be done on the first commit, not on every commit. */
- protected boolean _failOnce;
-
- /** Holds the number of sends that should be performed in every transaction when using transactions. */
- protected int _txBatchSize;
-
- /** Holds the number of destinations to ping. */
- protected int _noOfDestinations;
-
- /** Holds the number of consumers per destination. */
- protected int _noOfConsumers;
-
- /** Holds the maximum send rate in herz. */
- protected int _rate;
-
- /**
- * Holds the size of the maximum amount of pending data that the client should buffer, sending is suspended
- * if this limit is breached.
- */
- protected int _maxPendingSize;
-
- /** A source for providing sequential unique correlation ids. These will be unique within the same JVM. */
- private static AtomicLong _correlationIdGenerator = new AtomicLong(0L);
-
- /** A source for providing sequential unqiue ids for instances of this class to be identifed with. */
- private static AtomicInteger _instanceIdGenerator = new AtomicInteger(0);
-
- /** Holds this instances unique id. */
- private int instanceId;
-
- /**
- * Holds a map from message ids to latches on which threads wait for replies. This map is shared accross multiple
- * ping producers on the same JVM.
- */
- private static Map<String, PerCorrelationId> perCorrelationIds =
- Collections.synchronizedMap(new HashMap<String, PerCorrelationId>());
-
- /** A convenient formatter to use when time stamping output. */
- protected static final DateFormat timestampFormatter = new SimpleDateFormat("hh:mm:ss:SS");
-
- /** Holds the connection for the message producer. */
- protected Connection _connection;
-
- /** Holds the consumer connections. */
- protected Connection[] _consumerConnection;
-
- /** Holds the controlSession on which ping replies are received. */
- protected Session[] _consumerSession;
-
- /** Holds the producer controlSession, needed to create ping messages. */
- protected Session _producerSession;
-
- /** Holds the destination where the response messages will arrive. */
- protected Destination _replyDestination;
-
- /** Holds the set of destinations that this ping producer pings. */
- protected List<Destination> _pingDestinations;
-
- /** Used to restrict the sending rate to a specified limit. */
- protected Throttle _rateLimiter;
-
- /** Holds a message listener that this message listener chains all its messages to. */
- protected ChainedMessageListener _chainedMessageListener = null;
-
- /**
- * This id generator is used to generate ids to append to the queue name to ensure that queues can be unique when
- * creating multiple ping producers in the same JVM.
- */
- protected static AtomicInteger _queueJVMSequenceID = new AtomicInteger();
-
- /**
- * This id generator is used to generates ids that are only unique within this pinger. Creating multiple pingers
- * on the same JVM using this id generator will allow them to ping on the same queues.
- */
- protected AtomicInteger _queueSharedID = new AtomicInteger();
-
- /** Used to tell the ping loop when to terminate, it only runs while this is true. */
- protected boolean _publish = true;
-
- /** Holds the message producer to send the pings through. */
- protected MessageProducer _producer;
-
- /** Holds the message consumer to receive the ping replies through. */
- protected MessageConsumer[] _consumer;
-
- /** The prompt to display when asking the user to kill the broker for failover testing. */
- private static final String KILL_BROKER_PROMPT = "Kill broker now, then press Return.";
-
- /** Holds the name for this test client to be identified to the broker with. */
- private String _clientID;
-
- /** Keeps count of the total messages sent purely for debugging purposes. */
- private static AtomicInteger numSent = new AtomicInteger();
-
- /**
- * Holds a monitor which is used to synchronize sender and receivers threads, where the sender has elected
- * to wait until the number of unreceived message is reduced before continuing to send. This monitor is a
- * fair SynchronousQueue becuase that provides fair scheduling, to ensure that all producer threads get an
- * equal chance to produce messages.
- */
- static final SynchronousQueue _sendPauseMonitor = new SynchronousQueue(true);
-
- /** Keeps a count of the number of message currently sent but not received. */
- static AtomicInteger _unreceived = new AtomicInteger(0);
-
- /**
- * Creates a ping producer with the specified parameters, of which there are many. See the class level comments
- * for details. This constructor creates a connection to the broker and creates producer and consumer sessions on
- * it, to send and recieve its pings and replies on.
- *
- * @param overrides Properties containing any desired overrides to the defaults.
- *
- * @throws Exception Any exceptions are allowed to fall through.
- */
- public PingPongProducer(Properties overrides) throws Exception
- {
- // log.debug("public PingPongProducer(Properties overrides = " + overrides + "): called");
- instanceId = _instanceIdGenerator.getAndIncrement();
-
- // Create a set of parsed properties from the defaults overriden by the passed in values.
- ParsedProperties properties = new ParsedProperties(defaults);
- properties.putAll(overrides);
-
- // Extract the configuration properties to set the pinger up with.
- _overrideClientId = properties.getPropertyAsBoolean(OVERRIDE_CLIENT_ID_PROPNAME);
- _factoryName = properties.getProperty(FACTORY_NAME_PROPNAME);
- _fileProperties = properties.getProperty(FILE_PROPERTIES_PROPNAME);
- _brokerDetails = properties.getProperty(BROKER_PROPNAME);
- _username = properties.getProperty(USERNAME_PROPNAME);
- _password = properties.getProperty(PASSWORD_PROPNAME);
- _virtualpath = properties.getProperty(VIRTUAL_HOST_PROPNAME);
- _destinationName = properties.getProperty(PING_QUEUE_NAME_PROPNAME);
- _queueNamePostfix = properties.getProperty(QUEUE_NAME_POSTFIX_PROPNAME);
- _selector = properties.getProperty(SELECTOR_PROPNAME);
- _transacted = properties.getPropertyAsBoolean(TRANSACTED_PROPNAME);
- _consTransacted = properties.getPropertyAsBoolean(CONSUMER_TRANSACTED_PROPNAME);
- _persistent = properties.getPropertyAsBoolean(PERSISTENT_MODE_PROPNAME);
- _messageSize = properties.getPropertyAsInteger(MESSAGE_SIZE_PROPNAME);
- _verbose = properties.getPropertyAsBoolean(VERBOSE_PROPNAME);
- _failAfterCommit = properties.getPropertyAsBoolean(FAIL_AFTER_COMMIT_PROPNAME);
- _failBeforeCommit = properties.getPropertyAsBoolean(FAIL_BEFORE_COMMIT_PROPNAME);
- _failAfterSend = properties.getPropertyAsBoolean(FAIL_AFTER_SEND_PROPNAME);
- _failBeforeSend = properties.getPropertyAsBoolean(FAIL_BEFORE_SEND_PROPNAME);
- _failOnce = properties.getPropertyAsBoolean(FAIL_ONCE_PROPNAME);
- _txBatchSize = properties.getPropertyAsInteger(TX_BATCH_SIZE_PROPNAME);
- _noOfDestinations = properties.getPropertyAsInteger(DESTINATION_COUNT_PROPNAME);
- _noOfConsumers = properties.getPropertyAsInteger(NUM_CONSUMERS_PROPNAME);
- _rate = properties.getPropertyAsInteger(RATE_PROPNAME);
- _isPubSub = properties.getPropertyAsBoolean(PUBSUB_PROPNAME);
- _isUnique = properties.getPropertyAsBoolean(UNIQUE_DESTS_PROPNAME);
- _isDurable = properties.getPropertyAsBoolean(DURABLE_DESTS_PROPNAME);
- _ackMode = _transacted ? 0 : properties.getPropertyAsInteger(ACK_MODE_PROPNAME);
- _consAckMode = _consTransacted ? 0 : properties.getPropertyAsInteger(CONSUMER_ACK_MODE_PROPNAME);
- _maxPendingSize = properties.getPropertyAsInteger(MAX_PENDING_PROPNAME);
-
- // Check that one or more destinations were specified.
- if (_noOfDestinations < 1)
- {
- throw new IllegalArgumentException("There must be at least one destination.");
- }
-
- // Set up a throttle to control the send rate, if a rate > 0 is specified.
- if (_rate > 0)
- {
- _rateLimiter = new BatchedThrottle();
- _rateLimiter.setRate(_rate);
- }
-
- // Create the connection and message producers/consumers.
- // establishConnection(true, true);
- }
-
- /**
- * Establishes a connection to the broker and creates message consumers and producers based on the parameters
- * that this ping client was created with.
- *
- * @param producer Flag to indicate whether or not the producer should be set up.
- * @param consumer Flag to indicate whether or not the consumers should be set up.
- *
- * @throws Exception Any exceptions are allowed to fall through.
- */
- public void establishConnection(boolean producer, boolean consumer) throws Exception
- {
- // log.debug("public void establishConnection(): called");
-
- // Generate a unique identifying name for this client, based on it ip address and the current time.
- InetAddress address = InetAddress.getLocalHost();
- // _clientID = address.getHostName() + System.currentTimeMillis();
- _clientID = "perftest_" + instanceId;
-
- // Create a connection to the broker.
- createConnection(_clientID);
-
- // Create transactional or non-transactional sessions, based on the command line arguments.
- _producerSession = _connection.createSession(_transacted, _ackMode);
-
- _consumerSession = new Session[_noOfConsumers];
-
- for (int i = 0; i < _noOfConsumers; i++)
- {
- _consumerSession[i] = _consumerConnection[i].createSession(_consTransacted, _consAckMode);
- }
-
- // Create the destinations to send pings to and receive replies from.
- _replyDestination = _consumerSession[0].createTemporaryQueue();
- createPingDestinations(_noOfDestinations, _selector, _destinationName, _isUnique, _isDurable);
-
- // Create the message producer only if instructed to.
- if (producer)
- {
- createProducer();
- }
-
- // Create the message consumer only if instructed to.
- if (consumer)
- {
- createReplyConsumers(getReplyDestinations(), _selector);
- }
- }
-
- /**
- * Establishes a connection to the broker, based on the configuration parameters that this ping client was
- * created with.
- *
- * @param clientID The clients identifier.
- *
- * @throws JMSException Underlying exceptions allowed to fall through.
- * @throws NamingException Underlying exceptions allowed to fall through.
- * @throws IOException Underlying exceptions allowed to fall through.
- */
- protected void createConnection(String clientID) throws JMSException, NamingException, IOException
- {
- // _log.debug("protected void createConnection(String clientID = " + clientID + "): called");
-
- // _log.debug("Creating a connection for the message producer.");
- File propsFile = new File(_fileProperties);
- InputStream is = new FileInputStream(propsFile);
- Properties properties = new Properties();
- properties.load(is);
-
- Context context = new InitialContext(properties);
- ConnectionFactory factory = (ConnectionFactory) context.lookup(_factoryName);
- _connection = factory.createConnection(_username, _password);
-
- if (_overrideClientId)
- {
- _connection.setClientID(clientID);
- }
-
- // _log.debug("Creating " + _noOfConsumers + " connections for the consumers.");
-
- _consumerConnection = new Connection[_noOfConsumers];
-
- for (int i = 0; i < _noOfConsumers; i++)
- {
- _consumerConnection[i] = factory.createConnection(_username, _password);
- // _consumerConnection[i].setClientID(clientID);
- }
- }
-
- /**
- * Starts a ping-pong loop running from the command line. The bounce back client {@link PingPongBouncer} also needs
- * to be started to bounce the pings back again.
- *
- * @param args The command line arguments.
- */
- public static void main(String[] args)
- {
- try
- {
- Properties options =
- CommandLineParser.processCommandLine(args, new CommandLineParser(new String[][] {}), System.getProperties());
-
- // Create a ping producer overriding its defaults with all options passed on the command line.
- PingPongProducer pingProducer = new PingPongProducer(options);
- pingProducer.establishConnection(true, true);
-
- // Start the ping producers dispatch thread running.
- pingProducer._connection.start();
-
- // Create a shutdown hook to terminate the ping-pong producer.
- Runtime.getRuntime().addShutdownHook(pingProducer.getShutdownHook());
-
- // Ensure that the ping pong producer is registered to listen for exceptions on the connection too.
- pingProducer._connection.setExceptionListener(pingProducer);
-
- // Create the ping loop thread and run it until it is terminated by the shutdown hook or exception.
- Thread pingThread = new Thread(pingProducer);
- pingThread.run();
- pingThread.join();
- }
- catch (Exception e)
- {
- System.err.println(e.getMessage());
- log.error("Top level handler caught execption.", e);
- System.exit(1);
- }
- }
-
- /**
- * Convenience method for a short pause.
- *
- * @param sleepTime The time in milliseconds to pause for.
- */
- public static void pause(long sleepTime)
- {
- if (sleepTime > 0)
- {
- try
- {
- Thread.sleep(sleepTime);
- }
- catch (InterruptedException ie)
- { }
- }
- }
-
- /**
- * Gets all the reply destinations (to listen for replies on). In this case this will just be the single reply to
- * destination of this pinger.
- *
- * @return The single reply to destination of this pinger, wrapped in a list.
- */
- public List<Destination> getReplyDestinations()
- {
- // log.debug("public List<Destination> getReplyDestinations(): called");
-
- List<Destination> replyDestinations = new ArrayList<Destination>();
- replyDestinations.add(_replyDestination);
-
- // log.debug("replyDestinations = " + replyDestinations);
-
- return replyDestinations;
- }
-
- /**
- * Creates the producer to send the pings on. This is created without a default destination. Its persistent delivery
- * flag is set accoring the ping producer creation options.
- *
- * @throws JMSException Any JMSExceptions are allowed to fall through.
- */
- public void createProducer() throws JMSException
- {
- // log.debug("public void createProducer(): called");
-
- _producer = (MessageProducer) _producerSession.createProducer(null);
- _producer.setDeliveryMode(_persistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
-
- // log.debug("Created producer for " + (_persistent ? "persistent" : "non-persistent") + " messages.");
- }
-
- /**
- * Creates consumers for the specified number of destinations. The destinations themselves are also created by this
- * method.
- *
- * @param noOfDestinations The number of destinations to create consumers for.
- * @param selector The message selector to filter the consumers with.
- * @param rootName The root of the name, or actual name if only one is being created.
- * @param unique <tt>true</tt> to make the destinations unique to this pinger, <tt>false</tt> to share the
- * numbering with all pingers on the same JVM.
- * @param durable If the destinations are durable topics.
- *
- * @throws JMSException Any JMSExceptions are allowed to fall through.
- */
- public void createPingDestinations(int noOfDestinations, String selector, String rootName, boolean unique,
- boolean durable) throws JMSException
- {
- /*log.debug("public void createPingDestinations(int noOfDestinations = " + noOfDestinations + ", String selector = "
- + selector + ", String rootName = " + rootName + ", boolean unique = " + unique + ", boolean durable = "
- + durable + "): called");*/
-
- _pingDestinations = new ArrayList<Destination>();
-
- // Create the desired number of ping destinations and consumers for them.
- // log.debug("Creating " + noOfDestinations + " destinations to ping.");
-
- for (int i = 0; i < noOfDestinations; i++)
- {
- Destination destination;
- String id;
-
- // Generate an id, unique within this pinger or to the whole JVM depending on the unique flag.
- if (unique)
- {
- // log.debug("Creating unique destinations.");
- id = "_" + _queueJVMSequenceID.incrementAndGet() + "_" + _connection.getClientID();
- }
- else
- {
- // log.debug("Creating shared destinations.");
- id = "_" + _queueSharedID.incrementAndGet();
- }
-
- // Check if this is a pub/sub pinger, in which case create topics.
- if (_isPubSub)
- {
- destination = _producerSession.createTopic(rootName + id);
- // log.debug("Created non-durable topic " + destination);
-
- if (durable)
- {
- _producerSession.createDurableSubscriber((Topic) destination, _connection.getClientID());
- }
- }
- // Otherwise this is a p2p pinger, in which case create queues.
- else
- {
- destination = _producerSession.createQueue(rootName + id + _queueNamePostfix);
- // log.debug("Created queue " + destination);
- }
-
- // Keep the destination.
- _pingDestinations.add(destination);
- }
- }
-
- /**
- * Creates consumers for the specified destinations and registers this pinger to listen to their messages.
- *
- * @param destinations The destinations to listen to.
- * @param selector A selector to filter the messages with.
- *
- * @throws javax.jms.JMSException Any JMSExceptions are allowed to fall through.
- */
- public void createReplyConsumers(Collection<Destination> destinations, String selector) throws JMSException
- {
- /*log.debug("public void createReplyConsumers(Collection<Destination> destinations = " + destinations
- + ", String selector = " + selector + "): called");*/
-
- log.debug("There are " + destinations.size() + " destinations.");
- log.debug("Creating " + _noOfConsumers + " consumers on each destination.");
- log.debug("Total number of consumers is: " + (destinations.size() * _noOfConsumers));
-
- for (Destination destination : destinations)
- {
- _consumer = new MessageConsumer[_noOfConsumers];
-
- for (int i = 0; i < _noOfConsumers; i++)
- {
- // Create a consumer for the destination and set this pinger to listen to its messages.
- _consumer[i] = _consumerSession[i].createConsumer(destination, selector, NO_LOCAL_DEFAULT);
-
- final int consumerNo = i;
-
- _consumer[i].setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- onMessageWithConsumerNo(message, consumerNo);
- }
- });
-
- log.debug("Set consumer " + i + " to listen to replies sent to destination: " + destination);
- }
- }
- }
-
- /**
- * Stores the received message in the replies map, then resets the boolean latch that a thread waiting for a
- * correlating reply may be waiting on. This is only done if the reply has a correlation id that is expected in the
- * replies map.
- *
- * @param message The received message.
- * @param consumerNo The consumer number within this test pinger instance.
- */
- public void onMessageWithConsumerNo(Message message, int consumerNo)
- {
- // log.debug("public void onMessageWithConsumerNo(Message message, int consumerNo = " + consumerNo + "): called");
- try
- {
- long now = System.nanoTime();
- long timestamp = getTimestamp(message);
- long pingTime = now - timestamp;
-
- // NDC.push("id" + instanceId + "/cons" + consumerNo);
-
- // Extract the messages correlation id.
- String correlationID = message.getJMSCorrelationID();
- // log.debug("correlationID = " + correlationID);
-
- // int num = message.getIntProperty("MSG_NUM");
- // log.info("Message " + num + " received.");
-
- boolean isRedelivered = message.getJMSRedelivered();
- // log.debug("isRedelivered = " + isRedelivered);
-
- if (!isRedelivered)
- {
- // Countdown on the traffic light if there is one for the matching correlation id.
- PerCorrelationId perCorrelationId = perCorrelationIds.get(correlationID);
-
- if (perCorrelationId != null)
- {
- CountDownLatch trafficLight = perCorrelationId.trafficLight;
-
- // Restart the timeout timer on every message.
- perCorrelationId.timeOutStart = System.nanoTime();
-
- // log.debug("Reply was expected, decrementing the latch for the id, " + correlationID);
-
- // Release waiting senders if there are some and using maxPending limit.
- if ((_maxPendingSize > 0))
- {
- // Decrement the count of sent but not yet received messages.
- int unreceived = _unreceived.decrementAndGet();
- int unreceivedSize =
- (unreceived * ((_messageSize == 0) ? 1 : _messageSize))
- / (_isPubSub ? getConsumersPerDestination() : 1);
-
- // log.debug("unreceived = " + unreceived);
- // log.debug("unreceivedSize = " + unreceivedSize);
-
- // synchronized (_sendPauseMonitor)
- // {
- if (unreceivedSize < _maxPendingSize)
- {
- _sendPauseMonitor.poll();
- }
- // }
- }
-
- // Decrement the countdown latch. Before this point, it is possible that two threads might enter this
- // method simultanesouly with the same correlation id. Decrementing the latch in a synchronized block
- // ensures that each thread will get a unique value for the remaining messages.
- long trueCount;
- long remainingCount;
-
- synchronized (trafficLight)
- {
- trafficLight.countDown();
-
- trueCount = trafficLight.getCount();
- remainingCount = trueCount - 1;
-
- // NDC.push("/rem" + remainingCount);
-
- // log.debug("remainingCount = " + remainingCount);
- // log.debug("trueCount = " + trueCount);
-
- // Commit on transaction batch size boundaries. At this point in time the waiting producer
- // remains blocked, even on the last message.
- // Commit count is divided by noOfConsumers in p2p mode, so that each consumer only commits on
- // each batch boundary. For pub/sub each consumer gets every message so no division is done.
- // When running in client ack mode, an ack is done instead of a commit, on the commit batch
- // size boundaries.
- long commitCount = _isPubSub ? remainingCount : (remainingCount / _noOfConsumers);
- // log.debug("commitCount = " + commitCount);
-
- if ((commitCount % _txBatchSize) == 0)
- {
- if (_consAckMode == 2)
- {
- // log.debug("Doing client ack for consumer " + consumerNo + ".");
- message.acknowledge();
- }
- else
- {
- // log.debug("Trying commit for consumer " + consumerNo + ".");
- commitTx(_consumerSession[consumerNo]);
- // log.info("Tx committed on consumer " + consumerNo);
- }
- }
-
- // Forward the message and remaining count to any interested chained message listener.
- if (_chainedMessageListener != null)
- {
- _chainedMessageListener.onMessage(message, (int) remainingCount, pingTime);
- }
-
- // Check if this is the last message, in which case release any waiting producers. This is done
- // after the transaction has been committed and any listeners notified.
- if (trueCount == 1)
- {
- trafficLight.countDown();
- }
- }
- }
- else
- {
- log.warn("Got unexpected message with correlationId: " + correlationID);
- }
- }
- else
- {
- log.warn("Got redelivered message, ignoring.");
- }
- }
- catch (JMSException e)
- {
- log.warn("There was a JMSException: " + e.getMessage(), e);
- }
- finally
- {
- // log.debug("public void onMessageWithConsumerNo(Message message, int consumerNo): ending");
- // NDC.clear();
- }
- }
-
- /**
- * Sends the specified number of ping message and then waits for all correlating replies. If the wait times out
- * before a reply arrives, then a null reply is returned from this method. This method allows the caller to specify
- * the correlation id.
- *
- * @param message The message to send. If this is null, one is generated.
- * @param numPings The number of ping messages to send.
- * @param timeout The timeout in milliseconds.
- * @param messageCorrelationId The message correlation id. If this is null, one is generated.
- *
- * @return The number of replies received. This may be less than the number sent if the timeout terminated the wait
- * for all prematurely.
- *
- * @throws JMSException All underlying JMSExceptions are allowed to fall through.
- * @throws InterruptedException When interrupted by a timeout
- */
- public int pingAndWaitForReply(Message message, int numPings, long timeout, String messageCorrelationId)
- throws JMSException, InterruptedException
- {
- /*log.debug("public int pingAndWaitForReply(Message message, int numPings = " + numPings + ", long timeout = "
- + timeout + ", String messageCorrelationId = " + messageCorrelationId + "): called");*/
-
- // Generate a unique correlation id to put on the messages before sending them, if one was not specified.
- if (messageCorrelationId == null)
- {
- messageCorrelationId = Long.toString(_correlationIdGenerator.incrementAndGet());
- }
-
- try
- {
- // NDC.push("prod");
-
- // Create a count down latch to count the number of replies with. This is created before the messages are
- // sent so that the replies cannot be received before the count down is created.
- // One is added to this, so that the last reply becomes a special case. The special case is that the
- // chained message listener must be called before this sender can be unblocked, but that decrementing the
- // countdown needs to be done before the chained listener can be called.
- PerCorrelationId perCorrelationId = new PerCorrelationId();
-
- perCorrelationId.trafficLight = new CountDownLatch(getExpectedNumPings(numPings) + 1);
- perCorrelationIds.put(messageCorrelationId, perCorrelationId);
-
- // Set up the current time as the start time for pinging on the correlation id. This is used to determine
- // timeouts.
- perCorrelationId.timeOutStart = System.nanoTime();
-
- // Send the specifed number of messages.
- pingNoWaitForReply(message, numPings, messageCorrelationId);
-
- boolean timedOut;
- boolean allMessagesReceived;
- int numReplies;
-
- do
- {
- // Block the current thread until replies to all the messages are received, or it times out.
- perCorrelationId.trafficLight.await(timeout, TimeUnit.MILLISECONDS);
-
- // Work out how many replies were receieved.
- numReplies = getExpectedNumPings(numPings) - (int) perCorrelationId.trafficLight.getCount();
-
- allMessagesReceived = numReplies == getExpectedNumPings(numPings);
-
- // log.debug("numReplies = " + numReplies);
- // log.debug("allMessagesReceived = " + allMessagesReceived);
-
- // Recheck the timeout condition.
- long now = System.nanoTime();
- long lastMessageReceievedAt = perCorrelationId.timeOutStart;
- timedOut = (now - lastMessageReceievedAt) > (timeout * 1000000);
-
- // log.debug("now = " + now);
- // log.debug("lastMessageReceievedAt = " + lastMessageReceievedAt);
- }
- while (!timedOut && !allMessagesReceived);
-
- if ((numReplies < getExpectedNumPings(numPings)) && _verbose)
- {
- log.info("Timed out (" + timeout + " ms) before all replies received on id, " + messageCorrelationId);
- }
- else if (_verbose)
- {
- log.info("Got all replies on id, " + messageCorrelationId);
- }
-
- // commitTx(_consumerSession);
-
- // log.debug("public int pingAndWaitForReply(Message message, int numPings, long timeout): ending");
-
- return numReplies;
- }
- // Ensure that the message countdown latch is always removed from the reply map. The reply map is long lived,
- // so will be a memory leak if this is not done.
- finally
- {
- // NDC.pop();
- perCorrelationIds.remove(messageCorrelationId);
- }
- }
-
- /**
- * Sends the specified number of ping messages and does not wait for correlating replies.
- *
- * @param message The message to send.
- * @param numPings The number of pings to send.
- * @param messageCorrelationId A correlation id to place on all messages sent.
- *
- * @throws JMSException All underlying JMSExceptions are allowed to fall through.
- */
- public void pingNoWaitForReply(Message message, int numPings, String messageCorrelationId) throws JMSException
- {
- /*log.debug("public void pingNoWaitForReply(Message message, int numPings = " + numPings
- + ", String messageCorrelationId = " + messageCorrelationId + "): called");*/
-
- if (message == null)
- {
- message = getTestMessage(getReplyDestinations().get(0), _messageSize, _persistent);
- }
-
- message.setJMSCorrelationID(messageCorrelationId);
-
- // Set up a committed flag to detect uncommitted messages at the end of the send loop. This may occurr if the
- // transaction batch size is not a factor of the number of pings. In which case an extra commit at the end is
- // needed.
- boolean committed = false;
-
- // Send all of the ping messages.
- for (int i = 0; i < numPings; i++)
- {
- // Re-timestamp the message.
- // message.setLongProperty(MESSAGE_TIMESTAMP_PROPNAME, System.nanoTime());
-
- // Send the message, passing in the message count.
- committed = sendMessage(i, message);
-
- // Spew out per message timings on every message sonly in verbose mode.
- /*if (_verbose)
- {
- log.info(timestampFormatter.format(new Date()) + ": Pinged at with correlation id, " + messageCorrelationId);
- }*/
- }
-
- // Call commit if the send loop finished before reaching a batch size boundary so there may still be uncommitted messages.
- if (!committed)
- {
- commitTx(_producerSession);
- }
- }
-
- /**
- * Sends the sepcified message, applies rate limiting and possibly commits the current transaction. The count of
- * messages sent so far must be specified and is used to round robin the ping destinations (where there are more
- * than one), and to determine if the transaction batch size has been reached and the sent messages should be
- * committed.
- *
- * @param i The count of messages sent so far in a loop of multiple calls to this send method.
- * @param message The message to send.
- *
- * @return <tt>true</tt> if the messages were committed, <tt>false</tt> otherwise.
- *
- * @throws JMSException All underlyiung JMSExceptions are allowed to fall through.
- */
- protected boolean sendMessage(int i, Message message) throws JMSException
- {
- try
- {
- NDC.push("id" + instanceId + "/prod");
-
- // log.debug("protected boolean sendMessage(int i = " + i + ", Message message): called");
- // log.debug("_txBatchSize = " + _txBatchSize);
-
- // Round robin the destinations as the messages are sent.
- Destination destination = _pingDestinations.get(i % _pingDestinations.size());
-
- // Prompt the user to kill the broker when doing failover testing.
- _failBeforeSend = waitForUserToPromptOnFailure(_failBeforeSend);
-
- // Get the test setup for the correlation id.
- String correlationID = message.getJMSCorrelationID();
- PerCorrelationId perCorrelationId = perCorrelationIds.get(correlationID);
-
- // If necessary, wait until the max pending message size comes within its limit.
- if (_maxPendingSize > 0)
- {
- synchronized (_sendPauseMonitor)
- {
- // Used to keep track of the number of times that send has to wait.
- int numWaits = 0;
-
- // The maximum number of waits before the test gives up and fails. This has been chosen to correspond with
- // the test timeout.
- int waitLimit = (int) (TIMEOUT_DEFAULT / 10000);
-
- while (true)
- {
- // Get the size estimate of sent but not yet received messages.
- int unreceived = _unreceived.get();
- int unreceivedSize =
- (unreceived * ((_messageSize == 0) ? 1 : _messageSize))
- / (_isPubSub ? getConsumersPerDestination() : 1);
-
- // log.debug("unreceived = " + unreceived);
- // log.debug("unreceivedSize = " + unreceivedSize);
- // log.debug("_maxPendingSize = " + _maxPendingSize);
-
- if (unreceivedSize > _maxPendingSize)
- {
- // log.debug("unreceived size estimate over limit = " + unreceivedSize);
-
- // Fail the test if the send has had to wait more than the maximum allowed number of times.
- if (numWaits > waitLimit)
- {
- String errorMessage =
- "Send has had to wait for the unreceivedSize (" + unreceivedSize
- + ") to come below the maxPendingSize (" + _maxPendingSize + ") more that " + waitLimit
- + " times.";
- log.warn(errorMessage);
- throw new RuntimeException(errorMessage);
- }
-
- // Wait on the send pause barrier for the limit to be re-established.
- try
- {
- long start = System.nanoTime();
- // _sendPauseMonitor.wait(10000);
- _sendPauseMonitor.offer(new Object(), 10000, TimeUnit.MILLISECONDS);
- long end = System.nanoTime();
-
- // Count the wait only if it was for > 99% of the requested wait time.
- if (((float) (end - start) / (float) (10000 * 1000000L)) > 0.99)
- {
- numWaits++;
- }
- }
- catch (InterruptedException e)
- {
- // Restore the interrupted status
- Thread.currentThread().interrupt();
- throw new RuntimeException(e);
- }
- }
- else
- {
- break;
- }
- }
- }
- }
-
- // Send the message either to its round robin destination, or its default destination.
- // int num = numSent.incrementAndGet();
- // message.setIntProperty("MSG_NUM", num);
- setTimestamp(message);
-
- if (destination == null)
- {
- _producer.send(message);
- }
- else
- {
- _producer.send(destination, message);
- }
-
- // Increase the unreceived size, this may actually happen after the message is received.
- // The unreceived size is incremented by the number of consumers that will get a copy of the message,
- // in pub/sub mode.
- if (_maxPendingSize > 0)
- {
- int newUnreceivedCount = _unreceived.addAndGet(_isPubSub ? getConsumersPerDestination() : 1);
- // log.debug("newUnreceivedCount = " + newUnreceivedCount);
- }
-
- // Apply message rate throttling if a rate limit has been set up.
- if (_rateLimiter != null)
- {
- _rateLimiter.throttle();
- }
-
- // Call commit every time the commit batch size is reached.
- boolean committed = false;
-
- // Commit on every transaction batch size boundary. Here i + 1 is the count of actual messages sent.
- if (((i + 1) % _txBatchSize) == 0)
- {
- // log.debug("Trying commit on producer session.");
- committed = commitTx(_producerSession);
- }
-
- return committed;
- }
- finally
- {
- NDC.clear();
- }
- }
-
- /**
- * If the specified fail flag is set, this method waits for the user to cause a failure and then indicate to the
- * test that the failure has occurred, before the method returns.
- *
- * @param failFlag The fail flag to test.
- *
- * @return The new value for the fail flag. If the {@link #_failOnce} flag is set, then each fail flag is only
- * used once, then reset.
- */
- private boolean waitForUserToPromptOnFailure(boolean failFlag)
- {
- if (failFlag)
- {
- if (_failOnce)
- {
- failFlag = false;
- }
-
- // log.debug("Failing Before Send");
- waitForUser(KILL_BROKER_PROMPT);
- }
-
- return failFlag;
- }
-
- /**
- * Implements a single iteration of the ping loop. This sends the number of pings specified by the transaction batch
- * size property, and waits for replies to all of them. Any errors cause the publish flag to be cleared, which will
- * terminate the pinger.
- */
- public void pingLoop()
- {
- try
- {
- // Generate a sample message and time stamp it.
- Message msg = getTestMessage(_replyDestination, _messageSize, _persistent);
- // setTimestamp(msg);
-
- // Send the message and wait for a reply.
- pingAndWaitForReply(msg, TX_BATCH_SIZE_DEFAULT, TIMEOUT_DEFAULT, null);
- }
- catch (JMSException e)
- {
- _publish = false;
- // log.debug("There was a JMSException: " + e.getMessage(), e);
- }
- catch (InterruptedException e)
- {
- _publish = false;
- // log.debug("There was an interruption: " + e.getMessage(), e);
- }
- }
-
- /**
- * Sets a chained message listener. The message listener on this pinger, chains all its messages to the one set
- * here.
- *
- * @param messageListener The chained message listener.
- */
- public void setChainedMessageListener(ChainedMessageListener messageListener)
- {
- _chainedMessageListener = messageListener;
- }
-
- /** Removes any chained message listeners from this pinger. */
- public void removeChainedMessageListener()
- {
- _chainedMessageListener = null;
- }
-
- /**
- * Generates a test message of the specified size, with the specified reply-to destination and persistence flag.
- *
- * @param replyQueue The reply-to destination for the message.
- * @param messageSize The desired size of the message in bytes.
- * @param persistent <tt>true</tt> if the message should use persistent delivery, <tt>false</tt> otherwise.
- *
- * @return A freshly generated test message.
- *
- * @throws javax.jms.JMSException All underlying JMSException are allowed to fall through.
- */
- public Message getTestMessage(Destination replyQueue, int messageSize, boolean persistent) throws JMSException
- {
- // return TestMessageFactory.newObjectMessage(_producerSession, replyQueue, messageSize, persistent);
- return TestUtils.createTestMessageOfSize(_producerSession, messageSize);
- }
-
- /**
- * Sets the current time in nanoseconds as the timestamp on the message.
- *
- * @param msg The message to timestamp.
- *
- * @throws JMSException Any JMSExceptions are allowed to fall through.
- */
- protected void setTimestamp(Message msg) throws JMSException
- {
- /*if (((AMQSession)_producerSession).isStrictAMQP())
- {
- ((AMQMessage)msg).setTimestampProperty(new AMQShortString(MESSAGE_TIMESTAMP_PROPNAME), System.nanoTime());
- }
- else
- {*/
- msg.setLongProperty(MESSAGE_TIMESTAMP_PROPNAME, System.nanoTime());
- // }
- }
-
- /**
- * Extracts the nanosecond timestamp from a message.
- *
- * @param msg The message to extract the time stamp from.
- *
- * @return The timestamp in nanos.
- *
- * @throws JMSException Any JMSExceptions are allowed to fall through.
- */
- protected long getTimestamp(Message msg) throws JMSException
- {
- /*if (((AMQSession)_producerSession).isStrictAMQP())
- {
- Long value = ((AMQMessage)msg).getTimestampProperty(new AMQShortString(MESSAGE_TIMESTAMP_PROPNAME));
-
- return (value == null) ? 0L : value;
- }
- else
- {*/
- return msg.getLongProperty(PingPongProducer.MESSAGE_TIMESTAMP_PROPNAME);
- // }
- }
-
- /**
- * Stops the ping loop by clearing the publish flag. The current loop will complete when it notices that this flag
- * has been cleared.
- */
- public void stop()
- {
- _publish = false;
- }
-
- /**
- * Starts the producer and consumer connections.
- *
- * @throws JMSException Any JMSExceptions are allowed to fall through.
- */
- public void start() throws JMSException
- {
- // log.debug("public void start(): called");
-
- _connection.start();
- // log.debug("Producer started.");
-
- for (int i = 0; i < _noOfConsumers; i++)
- {
- _consumerConnection[i].start();
- // log.debug("Consumer " + i + " started.");
- }
- }
-
- /** Implements a ping loop that repeatedly pings until the publish flag becomes false. */
- public void run()
- {
- // Keep running until the publish flag is cleared.
- while (_publish)
- {
- pingLoop();
- }
- }
-
- /**
- * Callback method, implementing ExceptionListener. This should be registered to listen for exceptions on the
- * connection, this clears the publish flag which in turn will halt the ping loop.
- *
- * @param e The exception that triggered this callback method.
- */
- public void onException(JMSException e)
- {
- // log.debug("public void onException(JMSException e = " + e + "): called", e);
- _publish = false;
- }
-
- /**
- * Gets a shutdown hook that will cleanly shut this down when it is running the ping loop. This can be registered
- * with the runtime system as a shutdown hook.
- *
- * @return A shutdown hook for the ping loop.
- */
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- stop();
- }
- });
- }
-
- /**
- * Closes all of the producer and consumer connections.
- *
- * @throws JMSException All JMSException are allowed to fall through.
- */
- public void close() throws JMSException
- {
- // log.debug("public void close(): called");
-
- try
- {
- if (_connection != null)
- {
- // log.debug("Before close producer connection.");
- _connection.close();
- // log.debug("Closed producer connection.");
- }
-
- for (int i = 0; i < _noOfConsumers; i++)
- {
- if (_consumerConnection[i] != null)
- {
- // log.debug("Before close consumer connection " + i + ".");
- _consumerConnection[i].close();
- // log.debug("Closed consumer connection " + i + ".");
- }
- }
- }
- finally
- {
- _connection = null;
- _producerSession = null;
- _consumerSession = null;
- _consumerConnection = null;
- _producer = null;
- _consumer = null;
- _pingDestinations = null;
- _replyDestination = null;
- }
- }
-
- /**
- * Convenience method to commit the transaction on the specified controlSession. If the controlSession to commit on is not a
- * transactional controlSession, this method does nothing (unless the failover after send flag is set).
- *
- * <p/>If the {@link #_failAfterSend} flag is set, this will prompt the user to kill the broker before the commit is
- * applied. This flag applies whether the pinger is transactional or not.
- *
- * <p/>If the {@link #_failBeforeCommit} flag is set, this will prompt the user to kill the broker before the commit
- * is applied. If the {@link #_failAfterCommit} flag is set, this will prompt the user to kill the broker after the
- * commit is applied. These flags will only apply if using a transactional pinger.
- *
- * @param session The controlSession to commit
- *
- * @return <tt>true</tt> if the controlSession was committed, <tt>false</tt> if it was not.
- *
- * @throws javax.jms.JMSException If the commit fails and then the rollback fails.
- *
- * @todo Consider moving the fail after send logic into the send method. It is confusing to have it in this commit
- * method, because commits only apply to transactional pingers, but fail after send applied to transactional and
- * non-transactional alike.
- */
- protected boolean commitTx(Session session) throws JMSException
- {
- // log.debug("protected void commitTx(Session session): called");
-
- boolean committed = false;
-
- _failAfterSend = waitForUserToPromptOnFailure(_failAfterSend);
-
- if (session.getTransacted())
- {
- // log.debug("Session is transacted.");
-
- try
- {
- _failBeforeCommit = waitForUserToPromptOnFailure(_failBeforeCommit);
-
- long start = System.nanoTime();
- session.commit();
- committed = true;
- // log.debug("Time taken to commit :" + ((System.nanoTime() - start) / 1000000f) + " ms");
-
- _failAfterCommit = waitForUserToPromptOnFailure(_failAfterCommit);
-
- // log.debug("Session Commited.");
- }
- catch (JMSException e)
- {
- // log.debug("JMSException on commit:" + e.getMessage(), e);
-
- try
- {
- session.rollback();
- // log.debug("Message rolled back.");
- }
- catch (JMSException jmse)
- {
- // log.debug("JMSE on rollback:" + jmse.getMessage(), jmse);
-
- // Both commit and rollback failed. Throw the rollback exception.
- throw jmse;
- }
- }
- }
-
- return committed;
- }
-
- /**
- * Outputs a prompt to the console and waits for the user to press return.
- *
- * @param prompt The prompt to display on the console.
- */
- public void waitForUser(String prompt)
- {
- System.out.println(prompt);
-
- try
- {
- System.in.read();
- }
- catch (IOException e)
- {
- // Ignored.
- }
-
- System.out.println("Continuing.");
- }
-
- /**
- * Gets the number of consumers that are listening to each destination in the test.
- *
- * @return int The number of consumers subscribing to each topic.
- */
- public int getConsumersPerDestination()
- {
- return _noOfConsumers;
- }
-
- /**
- * Calculates how many pings are expected to be received for the given number sent.
- *
- * @param numpings The number of pings that will be sent.
- *
- * @return The number that should be received, for the test to pass.
- */
- public int getExpectedNumPings(int numpings)
- {
- // Wow, I'm freaking sorry about this return here...
- return ((_failAfterSend || _failBeforeCommit) ? numpings - 1: numpings) *
- (_isPubSub ? getConsumersPerDestination() : 1);
- }
-
- /**
- * Defines a chained message listener interface that can be attached to this pinger. Whenever this pinger's {@link
- * PingPongProducer#onMessageWithConsumerNo} method is called, the chained listener set through the {@link
- * PingPongProducer#setChainedMessageListener} method is passed the message, and the remaining expected count of
- * messages with that correlation id.
- *
- * <p/>Provided only one pinger is producing messages with that correlation id, the chained listener will always be
- * given unique message counts. It will always be called while the producer waiting for all messages to arrive is
- * still blocked.
- */
- public static interface ChainedMessageListener
- {
- /**
- * Notifies interested listeners about message arrival and important test stats, the number of messages
- * remaining in the test, and the messages send timestamp.
- *
- * @param message The newly arrived message.
- * @param remainingCount The number of messages left to complete the test.
- * @param latency The nanosecond latency of the message.
- *
- * @throws JMSException Any JMS exceptions is allowed to fall through.
- */
- public void onMessage(Message message, int remainingCount, long latency) throws JMSException;
- }
-
- /**
- * Holds information on each correlation id. The countdown latch, the current timeout timer... More stuff to be
- * added to this: read/write lock to make onMessage more concurrent as described in class header comment.
- */
- protected static class PerCorrelationId
- {
- /** Holds a countdown on number of expected messages. */
- CountDownLatch trafficLight;
-
- /** Holds the last timestamp that the timeout was reset to. */
- Long timeOutStart;
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongTestPerf.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongTestPerf.java
deleted file mode 100644
index 009254c612..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongTestPerf.java
+++ /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.
- *
- */
-package org.apache.qpid.requestreply;
-
-import junit.framework.Assert;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.junit.extensions.AsymptoticTestCase;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-import javax.jms.*;
-
-/**
- * PingPongTestPerf is a full round trip ping test, that has been written with the intention of being scaled up to run
- * many times simultaneously to simluate many clients/producer/connections. A full round trip ping sends a message from
- * a producer to a conumer, then the consumer replies to the message on a temporary queue.
- *
- * <p/>A single run of the test using the default JUnit test runner will result in the sending and timing of the number
- * of pings specified by the test size and time how long it takes for all of these to complete. This test may be scaled
- * up using a suitable JUnit test runner. See {@link org.apache.qpid.junit.extensions.TKTestRunner} for more
- * information on how to do this.
- *
- * <p/>The setup/teardown cycle establishes a connection to a broker and sets up a queue to send ping messages to and a
- * temporary queue for replies. This setup is only established once for all the test repeats, but each test threads
- * gets its own connection/producer/consumer, this is only re-established if the connection is lost.
- *
- * <p/>The test cycle is: Connects to a queue, creates a temporary queue, creates messages containing a property that
- * is the name of the temporary queue, fires off many messages on the original queue and waits for them all to come
- * back on the temporary queue.
- *
- * <p/>Configurable test properties: message size, transacted or not, persistent or not. Broker connection details.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * </table>
- */
-public class PingPongTestPerf extends AsymptoticTestCase
-{
- private static Logger _logger = Logger.getLogger(PingPongTestPerf.class);
-
- /** Thread local to hold the per-thread test setup fields. */
- ThreadLocal<PerThreadSetup> threadSetup = new ThreadLocal<PerThreadSetup>();
-
- // Set up a property reader to extract the test parameters from. Once ContextualProperties is available in
- // the project dependencies, use it to get property overrides for configurable tests and to notify the test runner
- // of the test parameters to log with the results. It also providers some basic type parsing convenience methods.
- // private Properties testParameters = System.getProperties();
- private ParsedProperties testParameters =
- TestContextProperties.getInstance(PingPongProducer.defaults /*System.getProperties()*/);
-
- public PingPongTestPerf(String name)
- {
- super(name);
-
- _logger.debug(testParameters);
-
- // Sets up the test parameters with defaults.
- /*testParameters.setPropertyIfNull(PingPongProducer.TX_BATCH_SIZE_PROPNAME,
- Integer.toString(PingPongProducer.TX_BATCH_SIZE_DEFAULT));
- testParameters.setPropertyIfNull(PingPongProducer.MESSAGE_SIZE_PROPNAME,
- Integer.toString(PingPongProducer.MESSAGE_SIZE_DEAFULT));
- testParameters.setPropertyIfNull(PingPongProducer.PING_QUEUE_NAME_PROPNAME,
- PingPongProducer.PING_QUEUE_NAME_DEFAULT);
- testParameters.setPropertyIfNull(PingPongProducer.PERSISTENT_MODE_PROPNAME,
- Boolean.toString(PingPongProducer.PERSISTENT_MODE_DEFAULT));
- testParameters.setPropertyIfNull(PingPongProducer.TRANSACTED_PROPNAME,
- Boolean.toString(PingPongProducer.TRANSACTED_DEFAULT));
- testParameters.setPropertyIfNull(PingPongProducer.BROKER_PROPNAME, PingPongProducer.BROKER_DEFAULT);
- testParameters.setPropertyIfNull(PingPongProducer.USERNAME_PROPNAME, PingPongProducer.USERNAME_DEFAULT);
- testParameters.setPropertyIfNull(PingPongProducer.PASSWORD_PROPNAME, PingPongProducer.PASSWORD_DEFAULT);
- testParameters.setPropertyIfNull(PingPongProducer.VIRTUAL_HOST_PROPNAME, PingPongProducer.VIRTUAL_HOST_DEFAULT);
- testParameters.setPropertyIfNull(PingPongProducer.VERBOSE_PROPNAME,
- Boolean.toString(PingPongProducer.VERBOSE_DEFAULT));
- testParameters.setPropertyIfNull(PingPongProducer.RATE_PROPNAME, Integer.toString(PingPongProducer.RATE_DEFAULT));
- testParameters.setPropertyIfNull(PingPongProducer.PUBSUB_PROPNAME,
- Boolean.toString(PingPongProducer.PUBSUB_DEFAULT));
- testParameters.setPropertyIfNull(PingPongProducer.TX_BATCH_SIZE_PROPNAME,
- Integer.toString(PingPongProducer.TX_BATCH_SIZE_DEFAULT));
- testParameters.setPropertyIfNull(PingPongProducer.TIMEOUT_PROPNAME, Long.toString(PingPongProducer.TIMEOUT_DEFAULT));
- testParameters.setPropertyIfNull(PingPongProducer.DESTINATION_COUNT_PROPNAME,
- Integer.toString(PingPongProducer.DESTINATION_COUNT_DEFAULT));
- testParameters.setPropertyIfNull(PingPongProducer.FAIL_AFTER_COMMIT_PROPNAME,
- PingPongProducer.FAIL_AFTER_COMMIT_DEFAULT);
- testParameters.setPropertyIfNull(PingPongProducer.FAIL_BEFORE_COMMIT_PROPNAME,
- PingPongProducer.FAIL_BEFORE_COMMIT_DEFAULT);
- testParameters.setPropertyIfNull(PingPongProducer.FAIL_AFTER_SEND_PROPNAME,
- PingPongProducer.FAIL_AFTER_SEND_DEFAULT);
- testParameters.setPropertyIfNull(PingPongProducer.FAIL_BEFORE_SEND_PROPNAME,
- PingPongProducer.FAIL_BEFORE_SEND_DEFAULT);
- testParameters.setPropertyIfNull(PingPongProducer.FAIL_ONCE_PROPNAME, PingPongProducer.FAIL_ONCE_DEFAULT);
- testParameters.setPropertyIfNull(PingPongProducer.UNIQUE_DESTS_PROPNAME,
- Boolean.toString(PingPongProducer.UNIQUE_DESTS_DEFAULT));
- testParameters.setPropertyIfNull(PingPongProducer.ACK_MODE_PROPNAME,
- Integer.toString(PingPongProducer.ACK_MODE_DEFAULT));
- testParameters.setPropertyIfNull(PingPongProducer.PAUSE_AFTER_BATCH_PROPNAME,
- PingPongProducer.PAUSE_AFTER_BATCH_DEFAULT);*/
- }
-
- /**
- * Compile all the tests into a test suite.
- */
- public static Test suite()
- {
- // Build a new test suite
- TestSuite suite = new TestSuite("Ping-Pong Performance Tests");
-
- // Run performance tests in read committed mode.
- suite.addTest(new PingPongTestPerf("testPingPongOk"));
-
- return suite;
- }
-
- private static void setSystemPropertyIfNull(String propName, String propValue)
- {
- if (System.getProperty(propName) == null)
- {
- System.setProperty(propName, propValue);
- }
- }
-
- public void testPingPongOk(int numPings) throws Exception
- {
- // Get the per thread test setup to run the test through.
- PerThreadSetup perThreadSetup = threadSetup.get();
-
- // Generate a sample message. This message is already time stamped and has its reply-to destination set.
- Message msg =
- perThreadSetup._testPingProducer.getTestMessage(perThreadSetup._testPingProducer.getReplyDestinations().get(0),
- testParameters.getPropertyAsInteger(PingPongProducer.MESSAGE_SIZE_PROPNAME),
- testParameters.getPropertyAsBoolean(PingPongProducer.PERSISTENT_MODE_PROPNAME));
-
- // Send the message and wait for a reply.
- int numReplies =
- perThreadSetup._testPingProducer.pingAndWaitForReply(msg, numPings, PingPongProducer.TIMEOUT_DEFAULT, null);
-
- // Fail the test if the timeout was exceeded.
- if (numReplies != numPings)
- {
- Assert.fail("The ping timed out, got " + numReplies + " out of " + numPings);
- }
- }
-
- /**
- * Performs test fixture creation on a per thread basis. This will only be called once for each test thread.
- */
- public void threadSetUp()
- {
- try
- {
- PerThreadSetup perThreadSetup = new PerThreadSetup();
-
- // Extract the test set up paramaeters.
- String brokerDetails = testParameters.getProperty(PingPongProducer.BROKER_PROPNAME);
- String username = testParameters.getProperty(PingPongProducer.USERNAME_PROPNAME);
- String password = testParameters.getProperty(PingPongProducer.PASSWORD_PROPNAME);
- String virtualPath = testParameters.getProperty(PingPongProducer.VIRTUAL_HOST_PROPNAME);
- String destinationName = testParameters.getProperty(PingPongProducer.PING_QUEUE_NAME_PROPNAME);
- boolean persistent = testParameters.getPropertyAsBoolean(PingPongProducer.PERSISTENT_MODE_PROPNAME);
- boolean transacted = testParameters.getPropertyAsBoolean(PingPongProducer.TRANSACTED_PROPNAME);
- String selector = testParameters.getProperty(PingPongProducer.SELECTOR_PROPNAME);
- boolean verbose = testParameters.getPropertyAsBoolean(PingPongProducer.VERBOSE_PROPNAME);
- boolean pubsub = testParameters.getPropertyAsBoolean(PingPongProducer.PUBSUB_PROPNAME);
-
- synchronized (this)
- {
- // Establish a bounce back client on the ping queue to bounce back the pings.
- perThreadSetup._testPingBouncer =
- new PingPongBouncer(brokerDetails, username, password, virtualPath, destinationName, persistent,
- transacted, selector, verbose, pubsub);
-
- // Start the connections for client and producer running.
- perThreadSetup._testPingBouncer.getConnection().start();
-
- // Establish a ping-pong client on the ping queue to send the pings and receive replies with.
- perThreadSetup._testPingProducer = new PingPongProducer(testParameters);
- perThreadSetup._testPingProducer.establishConnection(true, true);
- perThreadSetup._testPingProducer.start();
- }
-
- // Attach the per-thread set to the thread.
- threadSetup.set(perThreadSetup);
- }
- catch (Exception e)
- {
- _logger.warn("There was an exception during per thread setup.", e);
- }
- }
-
- /**
- * Performs test fixture clean
- */
- public void threadTearDown()
- {
- _logger.debug("public void threadTearDown(): called");
-
- try
- {
- // Get the per thread test fixture.
- PerThreadSetup perThreadSetup = threadSetup.get();
-
- // Close the pingers so that it cleans up its connection cleanly.
- synchronized (this)
- {
- perThreadSetup._testPingProducer.close();
- // perThreadSetup._testPingBouncer.close();
- }
-
- // Ensure the per thread fixture is reclaimed.
- threadSetup.remove();
- }
- catch (JMSException e)
- {
- _logger.warn("There was an exception during per thread tear down.");
- }
- }
-
- protected static class PerThreadSetup
- {
- /**
- * Holds the test ping-pong producer.
- */
- private PingPongProducer _testPingProducer;
-
- /**
- * Holds the test ping client.
- */
- private PingPongBouncer _testPingBouncer;
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/test/testcases/MessageThroughputPerf.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/test/testcases/MessageThroughputPerf.java
deleted file mode 100644
index 9397db82c9..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/test/testcases/MessageThroughputPerf.java
+++ /dev/null
@@ -1,199 +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.
- *
- */
-package org.apache.qpid.test.testcases;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
-
-import org.apache.qpid.test.framework.Assertion;
-import org.apache.qpid.test.framework.Circuit;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import org.apache.qpid.test.framework.MessagingTestConfigProperties;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-
-import org.apache.qpid.junit.extensions.TestThreadAware;
-import org.apache.qpid.junit.extensions.TimingController;
-import org.apache.qpid.junit.extensions.TimingControllerAware;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-import java.util.LinkedList;
-
-/**
- * MessageThroughputPerf runs a test over a {@link Circuit} controlled by the test parameters. It logs timings of
- * the time required to receive samples consisting of batches of messages.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Measure message throughput accross a test circuit. <td> {@link Circuit}
- * </table>
- *
- * @todo Check that all of the messages were sent. Check that the receiving end got the same number of messages as
- * the publishing end.
- *
- * @todo Set this up to run with zero sized tests. Size zero means send forever. Continuous sending to be interrupted
- * by completion of the test duration, or shutdown hook when the user presses Ctrl-C.
- */
-public class MessageThroughputPerf extends FrameworkBaseCase implements TimingControllerAware, TestThreadAware
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(MessageThroughputPerf.class);
-
- /** Holds the timing controller, used to log test timings from self-timed tests. */
- private TimingController timingController;
-
- /** Thread local to hold the per-thread test setup fields. */
- ThreadLocal<PerThreadSetup> threadSetup = new ThreadLocal<PerThreadSetup>();
-
- /**
- * Creates a new test case with the specified name.
- *
- * @param name The test case name.
- */
- public MessageThroughputPerf(String name)
- {
- super(name);
- }
-
- /**
- * Performs the a basic P2P test case.
- *
- * @param numMessages The number of messages to send in the test.
- */
- public void testThroughput(int numMessages)
- {
- log.debug("public void testThroughput(): called");
-
- PerThreadSetup setup = threadSetup.get();
- assertNoFailures(setup.testCircuit.test(numMessages, new LinkedList<Assertion>()));
- }
-
- /**
- * Should provide a translation from the junit method name of a test to its test case name as known to the test
- * clients that will run the test. The purpose of this is to convert the JUnit method name into the correct test
- * case name to place into the test invite. For example the method "testP2P" might map onto the interop test case
- * name "TC2_BasicP2P".
- *
- * @param methodName The name of the JUnit test method.
- *
- * @return The name of the corresponding interop test case.
- */
- public String getTestCaseNameForTestMethod(String methodName)
- {
- log.debug("public String getTestCaseNameForTestMethod(String methodName = " + methodName + "): called");
-
- return "DEFAULT_CIRCUIT_TEST";
- }
-
- /**
- * Used by test runners that can supply a {@link org.apache.qpid.junit.extensions.TimingController} to set the
- * controller on an aware test.
- *
- * @param controller The timing controller.
- */
- public void setTimingController(TimingController controller)
- {
- timingController = controller;
- }
-
- /**
- * Overrides the parent setUp method so that the in-vm broker creation is not done on a per test basis.
- *
- * @throws Exception Any exceptions allowed to fall through and fail the test.
- */
- protected void setUp() throws Exception
- {
- NDC.push(getName());
-
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
- }
-
- /**
- * Overrides the parent setUp method so that the in-vm broker clean-up is not done on a per test basis.
- */
- protected void tearDown()
- {
- NDC.pop();
- }
-
- /**
- * Performs test fixture creation on a per thread basis. This will only be called once for each test thread.
- */
- public void threadSetUp()
- {
- // Run the test setup tasks. This may create an in-vm broker, if a decorator has injected a task for this.
- taskHandler.runSetupTasks();
-
- // Get the test parameters, any overrides on the command line will have been applied.
- ParsedProperties testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- // Customize the test parameters.
- testProps.setProperty("TEST_NAME", "DEFAULT_CIRCUIT_TEST");
- testProps.setProperty(MessagingTestConfigProperties.SEND_DESTINATION_NAME_ROOT_PROPNAME, "testqueue");
-
- // Get the test circuit factory to create test circuits and run the standard test procedure through.
- CircuitFactory circuitFactory = getCircuitFactory();
-
- // Create the test circuit. This projects the circuit onto the available test nodes and connects it up.
- Circuit testCircuit = circuitFactory.createCircuit(null, testProps);
-
- // Store the test configuration for the thread.
- PerThreadSetup setup = new PerThreadSetup();
- setup.testCircuit = testCircuit;
- threadSetup.set(setup);
- }
-
- /**
- * Called when a test thread is destroyed.
- */
- public void threadTearDown()
- {
- // Run the test teardown tasks. This may destroy the in-vm broker, if a decorator has injected a task for this.
- taskHandler.runSetupTasks();
- }
-
- /**
- * Holds the per-thread test configurations.
- */
- protected static class PerThreadSetup
- {
- /** Holds the test circuit to run tests on. */
- Circuit testCircuit;
- }
-
- /**
- * Compiles all the tests in this class into a suite.
- *
- * @return The test suite.
- */
- public static Test suite()
- {
- // Build a new test suite
- TestSuite suite = new TestSuite("Qpid Throughput Performance Tests");
-
- suite.addTest(new MessageThroughputPerf("testThroughput"));
-
- return suite;
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Config.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Config.java
deleted file mode 100644
index d5c0979399..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Config.java
+++ /dev/null
@@ -1,326 +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.
- *
- */
-package org.apache.qpid.topic;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.config.ConnectorConfig;
-import org.apache.qpid.config.Connector;
-import org.apache.qpid.config.AbstractConfig;
-
-import javax.jms.Connection;
-
-public class Config extends AbstractConfig implements ConnectorConfig
-{
-
- private String host = "localhost";
- private int port = 5672;
- private String factory = null;
-
- private int payload = 256;
- private int messages = 1000;
- private int clients = 1;
- private int batch = 1;
- private long delay = 1;
- private int warmup;
- private int ackMode= AMQSession.NO_ACKNOWLEDGE;
- private String clientId;
- private String subscriptionId;
- private String selector;
- private String destinationName;
- private boolean persistent;
- private boolean transacted;
- private int destinationsCount;
- private int batchSize;
- private int rate;
- private boolean ispubsub;
- private long timeout;
-
- public Config()
- {
- }
-
- public int getAckMode()
- {
- return ackMode;
- }
-
- public void setPayload(int payload)
- {
- this.payload = payload;
- }
-
- public int getPayload()
- {
- return payload;
- }
-
- void setClients(int clients)
- {
- this.clients = clients;
- }
-
- int getClients()
- {
- return clients;
- }
-
- void setMessages(int messages)
- {
- this.messages = messages;
- }
-
- public int getMessages()
- {
- return messages;
- }
-
- public int getBatchSize()
- {
- return batchSize;
- }
-
- public int getRate()
- {
- return rate;
- }
-
- public int getDestinationsCount()
- {
- return destinationsCount;
- }
-
- public String getHost()
- {
- return host;
- }
-
- public void setHost(String host)
- {
- this.host = host;
- }
-
- public int getPort()
- {
- return port;
- }
-
- public String getFactory()
- {
- return factory;
- }
-
- public void setPort(int port)
- {
- this.port = port;
- }
-
- int getBatch()
- {
- return batch;
- }
-
- void setBatch(int batch)
- {
- this.batch = batch;
- }
-
- int getWarmup()
- {
- return warmup;
- }
-
- void setWarmup(int warmup)
- {
- this.warmup = warmup;
- }
-
- public long getDelay()
- {
- return delay;
- }
-
- public void setDelay(long delay)
- {
- this.delay = delay;
- }
-
- public long getTimeout()
- {
- return timeout;
- }
-
- public void setTimeout(long time)
- {
- this.timeout = time;
- }
-
- public String getClientId()
- {
- return clientId;
- }
-
- public String getSubscriptionId()
- {
- return subscriptionId;
- }
-
- public String getSelector()
- {
- return selector;
- }
-
- public String getDestination()
- {
- return destinationName;
- }
-
- public boolean usePersistentMessages()
- {
- return persistent;
- }
-
- public boolean isTransacted()
- {
- return transacted;
- }
-
- public boolean isPubSub()
- {
- return ispubsub;
- }
-
- public void setOption(String key, String value)
- {
- if("-host".equalsIgnoreCase(key))
- {
- setHost(value);
- }
- else if("-port".equalsIgnoreCase(key))
- {
- try
- {
- setPort(Integer.parseInt(value));
- }
- catch(NumberFormatException e)
- {
- throw new RuntimeException("Bad port number: " + value, e);
- }
- }
- else if("-payload".equalsIgnoreCase(key))
- {
- setPayload(parseInt("Bad payload size", value));
- }
- else if("-messages".equalsIgnoreCase(key))
- {
- setMessages(parseInt("Bad message count", value));
- }
- else if("-clients".equalsIgnoreCase(key))
- {
- setClients(parseInt("Bad client count", value));
- }
- else if("-batch".equalsIgnoreCase(key))
- {
- setBatch(parseInt("Bad batch count", value));
- }
- else if("-delay".equalsIgnoreCase(key))
- {
- setDelay(parseLong("Bad batch delay", value));
- }
- else if("-warmup".equalsIgnoreCase(key))
- {
- setWarmup(parseInt("Bad warmup count", value));
- }
- else if("-ack".equalsIgnoreCase(key))
- {
- ackMode = parseInt("Bad ack mode", value);
- }
- else if("-factory".equalsIgnoreCase(key))
- {
- factory = value;
- }
- else if("-clientId".equalsIgnoreCase(key))
- {
- clientId = value;
- }
- else if("-subscriptionId".equalsIgnoreCase(key))
- {
- subscriptionId = value;
- }
- else if("-persistent".equalsIgnoreCase(key))
- {
- persistent = "true".equalsIgnoreCase(value);
- }
- else if("-transacted".equalsIgnoreCase(key))
- {
- transacted = "true".equalsIgnoreCase(value);
- }
- else if ("-destinationscount".equalsIgnoreCase(key))
- {
- destinationsCount = parseInt("Bad destinations count", value);
- }
- else if ("-batchsize".equalsIgnoreCase(key))
- {
- batchSize = parseInt("Bad batch size", value);
- }
- else if ("-rate".equalsIgnoreCase(key))
- {
- rate = parseInt("MEssage rate", value);
- }
- else if("-pubsub".equalsIgnoreCase(key))
- {
- ispubsub = "true".equalsIgnoreCase(value);
- }
- else if("-selector".equalsIgnoreCase(key))
- {
- selector = value;
- }
- else if("-destinationname".equalsIgnoreCase(key))
- {
- destinationName = value;
- }
- else if("-timeout".equalsIgnoreCase(key))
- {
- setTimeout(parseLong("Bad timeout data", value));
- }
- else
- {
- System.out.println("Ignoring unrecognised option: " + key);
- }
- }
-
- static String getAckModeDescription(int ackMode)
- {
- switch(ackMode)
- {
- case AMQSession.NO_ACKNOWLEDGE: return "NO_ACKNOWLEDGE";
- case AMQSession.AUTO_ACKNOWLEDGE: return "AUTO_ACKNOWLEDGE";
- case AMQSession.CLIENT_ACKNOWLEDGE: return "CLIENT_ACKNOWLEDGE";
- case AMQSession.DUPS_OK_ACKNOWLEDGE: return "DUPS_OK_ACKNOWELDGE";
- case AMQSession.PRE_ACKNOWLEDGE: return "PRE_ACKNOWLEDGE";
- }
- return "AckMode=" + ackMode;
- }
-
- public Connection createConnection() throws Exception
- {
- return new Connector().createConnection(this);
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java
deleted file mode 100644
index 6dcea42bfe..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java
+++ /dev/null
@@ -1,303 +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.
- *
- */
-package org.apache.qpid.topic;
-
-import java.util.Random;
-
-import javax.jms.*;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.exchange.ExchangeDefaults;
-
-/**
- * This class has not kept up to date with the topic_listener in the cpp tests. It should provide identical behaviour for
- * cross testing the java and cpp clients.
- *
- * <p/>How the cpp topic_publisher operates:
- * It publishes text messages to the default topic exchange, on virtual host "/test", on the topic "topic_control", for
- * the specified number of test messages to be sent.
- * It publishes a report request message (on same topic), with the header text field "TYPE", value "REPORT_REQUEST",
- * optionally within a transaction, and waits for the specified number of consumers to reply to this request. The
- * listeners should reply to this message on a queue named "response", on virtual host "/test", with some sort of message
- * about the number of messages received and how long it took, although the publisher never looks at the message content.
- * The publisher then send a message (on the same topic), with the header text field "TYPE", value "TERMINATION_REQUEST",
- * which the listener should close its connection and terminate upon receipt of.
- *
- * @todo I've added lots of field table types in the report message, just to check if the other end can decode them
- * correctly. Not really the right place to test this, so remove them from
- * {@link #createReportResponseMessage(String)} once a better test exists.
- */
-public class Listener implements MessageListener
-{
- private static Logger log = Logger.getLogger(Listener.class);
-
- public static final String CONTROL_TOPIC = "topic_control";
- public static final String RESPONSE_QUEUE = "response";
-
- private final Topic _topic;
- //private final Topic _control;
-
- private final Queue _response;
-
- /** Holds the connection to listen on. */
- private final Connection _connection;
-
- /** Holds the producer to send control messages on. */
- private final MessageProducer _controller;
-
- /** Holds the JMS session. */
- private final javax.jms.Session _session;
-
- /** Holds a flag to indicate that a timer has begun on the first message. Reset when report is sent. */
- private boolean init;
-
- /** Holds the count of messages received by this listener. */
- private int count;
-
- /** Used to hold the start time of the first message. */
- private long start;
- private static String clientId;
-
- Listener(Connection connection, int ackMode, String name) throws Exception
- {
- log.debug("Listener(Connection connection = " + connection + ", int ackMode = " + ackMode + ", String name = " + name
- + "): called");
-
- _connection = connection;
- _session = connection.createSession(false, ackMode);
-
- if (_session instanceof AMQSession)
- {
- _topic = new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME, CONTROL_TOPIC);
- //_control = new AMQTopic(CONTROL_TOPIC);
- _response = new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, RESPONSE_QUEUE);
- }
- else
- {
- _topic = _session.createTopic(CONTROL_TOPIC);
- //_control = _session.createTopic(CONTROL_TOPIC);
- _response = _session.createQueue(RESPONSE_QUEUE);
- }
-
- //register for events
- if (name == null)
- {
- log.debug("Calling _factory.createTopicConsumer().setMessageListener(this)");
- createTopicConsumer().setMessageListener(this);
- }
- else
- {
- log.debug("Calling createDurableTopicConsumer(name).setMessageListener(this)");
- createDurableTopicConsumer(name).setMessageListener(this);
- }
-
- _connection.start();
-
- _controller = createControlPublisher();
- System.out.println("Waiting for messages " + Config.getAckModeDescription(ackMode)
- +
- ((name == null)
- ? "" : (" (subscribed with name " + name + " and client id " + connection.getClientID() + ")"))
- + "...");
- }
-
- public static void main(String[] argv) throws Exception
- {
- clientId = "Listener-" + System.currentTimeMillis();
-
- NDC.push(clientId);
-
- Config config = new Config();
- config.setOptions(argv);
-
- //Connection con = config.createConnection();
- Connection con =
- new AMQConnection("amqp://guest:guest@testid/test?brokerlist='" + config.getHost() + ":" + config.getPort()
- + "'");
-
- if (config.getClientId() != null)
- {
- con.setClientID(config.getClientId());
- }
-
- new Listener(con, config.getAckMode(), config.getSubscriptionId());
-
- NDC.pop();
- NDC.remove();
- }
-
- /**
- * Checks whether or not a text field on a message has the specified value.
- *
- * @param m The message to check.
- * @param fieldName The name of the field to check.
- * @param value The expected value of the field to compare with.
- *
- * @return <tt>true</tt>If the specified field has the specified value, <tt>fals</tt> otherwise.
- *
- * @throws JMSException Any JMSExceptions are allowed to fall through.
- */
- private static boolean checkTextField(Message m, String fieldName, String value) throws JMSException
- {
- log.debug("private static boolean checkTextField(Message m = " + m + ", String fieldName = " + fieldName
- + ", String value = " + value + "): called");
-
- String comp = m.getStringProperty(fieldName);
- log.debug("comp = " + comp);
-
- boolean result = (comp != null) && comp.equals(value);
- log.debug("result = " + result);
-
- return result;
- }
-
- public void onMessage(Message message)
- {
- NDC.push(clientId);
-
- log.debug("public void onMessage(Message message = " + message + "): called");
-
- if (!init)
- {
- start = System.nanoTime() / 1000000;
- count = 0;
- init = true;
- }
-
- try
- {
- if (isShutdown(message))
- {
- log.debug("Got a shutdown message.");
- shutdown();
- }
- else if (isReport(message))
- {
- log.debug("Got a report request message.");
-
- // Send the report.
- report();
- init = false;
- }
- }
- catch (JMSException e)
- {
- log.warn("There was a JMSException during onMessage.", e);
- }
- finally
- {
- NDC.pop();
- }
- }
-
- Message createReportResponseMessage(String msg) throws JMSException
- {
- Message message = _session.createTextMessage(msg);
-
- // Shove some more field table type in the message just to see if the other end can handle it.
- message.setBooleanProperty("BOOLEAN", true);
- message.setByteProperty("BYTE", (byte) 5);
- message.setDoubleProperty("DOUBLE", Math.PI);
- message.setFloatProperty("FLOAT", 1.0f);
- message.setIntProperty("INT", 1);
- message.setShortProperty("SHORT", (short) 1);
- message.setLongProperty("LONG", (long) 1827361278);
- message.setStringProperty("STRING", "hello");
-
- return message;
- }
-
- boolean isShutdown(Message m) throws JMSException
- {
- boolean result = checkTextField(m, "TYPE", "TERMINATION_REQUEST");
-
- //log.debug("isShutdown = " + result);
-
- return result;
- }
-
- boolean isReport(Message m) throws JMSException
- {
- boolean result = checkTextField(m, "TYPE", "REPORT_REQUEST");
-
- //log.debug("isReport = " + result);
-
- return result;
- }
-
- MessageConsumer createTopicConsumer() throws Exception
- {
- return _session.createConsumer(_topic);
- }
-
- MessageConsumer createDurableTopicConsumer(String name) throws Exception
- {
- return _session.createDurableSubscriber(_topic, name);
- }
-
- MessageProducer createControlPublisher() throws Exception
- {
- return _session.createProducer(_response);
- }
-
- private void shutdown()
- {
- try
- {
- _session.close();
- _connection.stop();
- _connection.close();
- }
- catch (Exception e)
- {
- e.printStackTrace(System.out);
- }
- }
-
- private void report()
- {
- log.debug("private void report(): called");
-
- try
- {
- String msg = getReport();
- _controller.send(createReportResponseMessage(msg));
- log.debug("Sent report: " + msg);
- }
- catch (Exception e)
- {
- e.printStackTrace(System.out);
- }
- }
-
- private String getReport()
- {
- long time = ((System.nanoTime() / 1000000) - start);
-
- return "Received " + count + " in " + time + "ms";
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java
deleted file mode 100644
index 4efdc1cb56..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.topic;
-
-import javax.jms.*;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.exchange.ExchangeDefaults;
-
-/**
- */
-class MessageFactory
-{
- private static final char[] DATA = "abcdefghijklmnopqrstuvwxyz".toCharArray();
-
- private final Session _session;
- private final Topic _topic;
- private final Topic _control;
- private final byte[] _payload;
-
- MessageFactory(Session session) throws JMSException
- {
- this(session, 256);
- }
-
- MessageFactory(Session session, int size) throws JMSException
- {
- _session = session;
- if (session instanceof AMQSession)
- {
- _topic = new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME, "topic_control");
- _control = new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME, "topictest.control");
- }
- else
- {
- _topic = session.createTopic("topic_control");
- _control = session.createTopic("topictest.control");
- }
-
- _payload = new byte[size];
-
- for (int i = 0; i < size; i++)
- {
- _payload[i] = (byte) DATA[i % DATA.length];
- }
- }
-
- private static boolean checkText(Message m, String s)
- {
- try
- {
- return (m instanceof TextMessage) && ((TextMessage) m).getText().equals(s);
- }
- catch (JMSException e)
- {
- e.printStackTrace(System.out);
-
- return false;
- }
- }
-
- Topic getTopic()
- {
- return _topic;
- }
-
- Message createEventMessage() throws JMSException
- {
- BytesMessage msg = _session.createBytesMessage();
- msg.writeBytes(_payload);
-
- return msg;
- }
-
- Message createShutdownMessage() throws JMSException
- {
- return _session.createTextMessage("SHUTDOWN");
- }
-
- Message createReportRequestMessage() throws JMSException
- {
- return _session.createTextMessage("REPORT");
- }
-
- Message createReportResponseMessage(String msg) throws JMSException
- {
- return _session.createTextMessage(msg);
- }
-
- boolean isShutdown(Message m)
- {
- return checkText(m, "SHUTDOWN");
- }
-
- boolean isReport(Message m)
- {
- return checkText(m, "REPORT");
- }
-
- Object getReport(Message m)
- {
- try
- {
- return ((TextMessage) m).getText();
- }
- catch (JMSException e)
- {
- e.printStackTrace(System.out);
-
- return e.toString();
- }
- }
-
- MessageConsumer createTopicConsumer() throws Exception
- {
- return _session.createConsumer(_topic);
- }
-
- MessageConsumer createDurableTopicConsumer(String name) throws Exception
- {
- return _session.createDurableSubscriber(_topic, name);
- }
-
- MessageConsumer createControlConsumer() throws Exception
- {
- return _session.createConsumer(_control);
- }
-
- MessageProducer createTopicPublisher() throws Exception
- {
- return _session.createProducer(_topic);
- }
-
- MessageProducer createControlPublisher() throws Exception
- {
- return _session.createProducer(_control);
- }
-}
diff --git a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java b/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java
deleted file mode 100644
index c3b19b558a..0000000000
--- a/M4-RCs/qpid/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java
+++ /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.
- *
- */
-package org.apache.qpid.topic;
-
-import javax.jms.*;
-
-public class Publisher implements MessageListener
-{
- private final Object _lock = new Object();
- private final Connection _connection;
- private final Session _session;
- private final MessageFactory _factory;
- private final MessageProducer _publisher;
- private int _count;
-
- Publisher(Connection connection, int size, int ackMode, boolean persistent) throws Exception
- {
- _connection = connection;
- _session = _connection.createSession(false, ackMode);
- _factory = new MessageFactory(_session, size);
- _publisher = _factory.createTopicPublisher();
- _publisher.setDeliveryMode(persistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
- System.out.println("Publishing " + (persistent ? "persistent" : "non-persistent") + " messages of " + size + " bytes, " + Config.getAckModeDescription(ackMode) + ".");
- }
-
- private void test(Config config) throws Exception
- {
- test(config.getBatch(), config.getDelay(), config.getMessages(), config.getClients(), config.getWarmup());
- }
-
- private void test(int batches, long delay, int msgCount, int consumerCount, int warmup) throws Exception
- {
- _factory.createControlConsumer().setMessageListener(this);
- _connection.start();
-
- if (warmup > 0)
- {
- System.out.println("Runing warmup (" + warmup + " msgs)");
- long time = batch(warmup, consumerCount);
- System.out.println("Warmup completed in " + time + "ms");
- }
-
- long[] times = new long[batches];
- for (int i = 0; i < batches; i++)
- {
- if (i > 0)
- {
- Thread.sleep(delay * 1000);
- }
- times[i] = batch(msgCount, consumerCount);
- System.out.println("Batch " + (i + 1) + " of " + batches + " completed in " + times[i] + " ms.");
- }
-
- long min = min(times);
- long max = max(times);
- System.out.println("min: " + min + ", max: " + max + " avg: " + avg(times, min, max));
-
- //request shutdown
- _publisher.send(_factory.createShutdownMessage());
-
- _connection.stop();
- _connection.close();
- }
-
- private long batch(int msgCount, int consumerCount) throws Exception
- {
- _count = consumerCount;
- long start = System.currentTimeMillis();
- publish(msgCount);
- waitForCompletion(consumerCount);
- return System.currentTimeMillis() - start;
- }
-
- private void publish(int count) throws Exception
- {
-
- //send events
- for (int i = 0; i < count; i++)
- {
- _publisher.send(_factory.createEventMessage());
- if ((i + 1) % 100 == 0)
- {
- System.out.println("Sent " + (i + 1) + " messages");
- }
- }
-
- //request report
- _publisher.send(_factory.createReportRequestMessage());
- }
-
- private void waitForCompletion(int consumers) throws Exception
- {
- System.out.println("Waiting for completion...");
- synchronized (_lock)
- {
- while (_count > 0)
- {
- _lock.wait();
- }
- }
- }
-
-
- public void onMessage(Message message)
- {
- System.out.println("Received report " + _factory.getReport(message) + " " + --_count + " remaining");
- if (_count == 0)
- {
- synchronized (_lock)
- {
- _lock.notify();
- }
- }
- }
-
- static long min(long[] times)
- {
- long min = times.length > 0 ? times[0] : 0;
- for (int i = 0; i < times.length; i++)
- {
- min = Math.min(min, times[i]);
- }
- return min;
- }
-
- static long max(long[] times)
- {
- long max = times.length > 0 ? times[0] : 0;
- for (int i = 0; i < times.length; i++)
- {
- max = Math.max(max, times[i]);
- }
- return max;
- }
-
- static long avg(long[] times, long min, long max)
- {
- long sum = 0;
- for (int i = 0; i < times.length; i++)
- {
- sum += times[i];
- }
-
- int adjustment = 0;
-
- // Remove min and max if we have run enough batches.
- if (times.length > 2)
- {
- sum -= min;
- sum -= max;
- adjustment = 2;
- }
-
- return (sum / (times.length - adjustment));
- }
-
- public static void main(String[] argv) throws Exception
- {
- Config config = new Config();
- config.setOptions(argv);
-
- Connection con = config.createConnection();
- int size = config.getPayload();
- int ackMode = config.getAckMode();
- boolean persistent = config.usePersistentMessages();
- new Publisher(con, size, ackMode, persistent).test(config);
- }
-}
diff --git a/M4-RCs/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java b/M4-RCs/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java
deleted file mode 100644
index 85dffeb4bf..0000000000
--- a/M4-RCs/qpid/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java
+++ /dev/null
@@ -1,100 +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.
- *
- */
-package org.apache.qpid.plugins;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-
-import org.python.util.jython;
-
-
-/**
- * JythonMojo
- *
- * @author Rafael H. Schloming
- *
- * @goal jython
- */
-
-public class JythonMojo extends AbstractMojo
-{
-
- /**
- * Arguments to jython.
- *
- * @parameter
- */
- private String[] params = new String[0];
-
- /**
- * Source file.
- *
- * @parameter
- */
- private File[] sources;
-
- /**
- * Optional timestamp.
- *
- * @parameter
- */
- private File timestamp;
-
- public void execute() throws MojoExecutionException
- {
- boolean stale = true;
-
- if (sources != null && sources.length > 0 && timestamp != null)
- {
- stale = false;
- for (File source : sources)
- {
- if (source.lastModified() > timestamp.lastModified())
- {
- stale = true;
- break;
- }
- }
- }
-
- if (stale)
- {
- jython.main(params);
-
- if (timestamp != null)
- {
- try
- {
- timestamp.createNewFile();
- }
- catch (IOException e)
- {
- throw new MojoExecutionException("cannot create timestamp", e);
- }
- timestamp.setLastModified(System.currentTimeMillis());
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/release-docs/RELEASE_NOTES.txt b/M4-RCs/qpid/java/release-docs/RELEASE_NOTES.txt
deleted file mode 100644
index 690b04dfc0..0000000000
--- a/M4-RCs/qpid/java/release-docs/RELEASE_NOTES.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-Apache Qpid Incubating Java M4 Release Notes
--------------------------------------------
-
-The Qpid M4 release contains support for AMQP 0-8, 0-9 and 0-10. You
-can access the specifications from
-http://www.amqp.org/tikiwiki/tiki-index.php?page=Download
-
-For full details of Apache Qpid's capabilities see our detailed
-project documentation at:
-
-http://cwiki.apache.org/confluence/display/qpid/Qpid+Java+Documentation
-
-From the link above you can access our Getting Started Guide, FAQ, Build How To
-and detailed developer documentation.
-
-New features, Improvements and Bug fixes
-----------------------
-
-A security related problem was addressed. If Base64MD5 passwords are
-turned on on the broker and it has been configured to use JMXMP via
-the addition of jxmremote_optional.jar to the classpath, it is
-possible for an attacker to bypass the authentication on the JMX
-management interface due to a bug in password verification.
-
-A new command line management interface was added (qpid-cli)
-
-A full list of changes can be found at:
-https://issues.apache.org/jira/secure/ReleaseNote.jspa?version=12313279&styleName=Text&projectId=12310520
-
-
-Known Issues/Outstanding Work
------------------------------
-
-You can view the outstanding task list for Qpid by visiting our JIRA:
-http://issues.apache.org/jira/browse/QPID
diff --git a/M4-RCs/qpid/java/resources/LICENSE b/M4-RCs/qpid/java/resources/LICENSE
deleted file mode 100644
index ec795b23de..0000000000
--- a/M4-RCs/qpid/java/resources/LICENSE
+++ /dev/null
@@ -1,731 +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.
-
-
-=========================================================================
-== SL4Fj (MIT) License ==
-=========================================================================
-
-SLF4J source code and binaries are distributed under the following license.
-Copyright (c) 2004-2005 SLF4J.ORG
-Copyright (c) 2004-2005 QOS.ch
-
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, and/or sell copies of the Software, and to permit persons
-to whom the Software is furnished to do so, provided that the above
-copyright notice(s) and this permission notice appear in all copies of
-the Software and that both the above copyright notice(s) and this
-permission notice appear in supporting documentation.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
-SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
-RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
-CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-Except as contained in this notice, the name of a copyright holder
-shall not be used in advertising or otherwise to promote the sale, use
-or other dealings in this Software without prior written authorization
-of the copyright holder.
-
-=========================================================================
-== Public Domain License for Backport of JSR 166 ==
-=========================================================================
-
-Copyright-Only Dedication (based on United States law) or Public Domain Certification
-
-The person or persons who have associated work with this document (the "Dedicator" or "Certifier") hereby either (a) certifies that, to the best of his knowledge, the work of authorship identified is in the public domain of the country from which the work is published, or (b) hereby dedicates whatever copyright the dedicators holds in the work of authorship identified below (the "Work") to the public domain. A certifier, moreover, dedicates any copyright interest he may have in the associated work, and for these purposes, is described as a "dedicator" below.
-
-A certifier has taken reasonable steps to verify the copyright status of this work. Certifier recognizes that his good faith efforts may not shield him from liability if in fact the work certified is not in the public domain.
-
-Dedicator makes this dedication for the benefit of the public at large and to the detriment of the Dedicator's heirs and successors. Dedicator intends this dedication to be an overt act of relinquishment in perpetuity of all present and future rights under copyright law, whether vested or contingent, in the Work. Dedicator understands that such relinquishment of all rights includes the relinquishment of all rights to enforce (by lawsuit or otherwise) those copyrights in the Work.
-
-Dedicator recognizes that, once placed in the public domain, the Work may be freely reproduced, distributed, transmitted, used, modified, built upon, or otherwise exploited by anyone for any purpose, commercial or non-commercial, and in any way, including by methods that have not yet been invented or conceived.
-
-=========================================================================
-== Eclipse Public License ==
-=========================================================================
-
-Eclipse Public License - v 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-1. DEFINITIONS
-
-"Contribution" means:
-
-a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-
-i) changes to the Program, and
-
-ii) additions to the Program;
-
-where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
-
-"Contributor" means any person or entity that distributes the Program.
-
-"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
-
-"Program" means the Contributions distributed in accordance with this Agreement.
-
-"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
-
-2. GRANT OF RIGHTS
-
-a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
-
-b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
-
-c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
-
-d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
-
-3. REQUIREMENTS
-
-A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
-
-a) it complies with the terms and conditions of this Agreement; and
-
-b) its license agreement:
-
-i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
-
-ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
-
-iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
-
-iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
-
-When the Program is made available in source code form:
-
-a) it must be made available under this Agreement; and
-
-b) a copy of this Agreement must be included with each copy of the Program.
-
-Contributors may not remove or alter any copyright notices contained within the Program.
-
-Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
-
-4. COMMERCIAL DISTRIBUTION
-
-Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
-
-For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
-
-5. NO WARRANTY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED 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. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
-
-6. DISCLAIMER OF LIABILITY
-
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-7. GENERAL
-
-If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
-
-If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
-
-All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
-
-Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
-
-This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
-
-
-
-=========================================================================
-== ICU License ==
-=========================================================================
-ICU License - ICU 1.8.1 and later
-
-COPYRIGHT AND PERMISSION NOTICE
-
-Copyright (c) 1995-2006 International Business Machines Corporation and others
-
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
-
-All trademarks and registered trademarks mentioned herein are the property of their respective owners.
-
-
-=========================================================================
-== AMQP License ==
-=========================================================================
-Copyright Notice
- ================
- (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc.,
- iMatix Corporation, IONA\ufffd Technologies, Red Hat, Inc.,
- TWIST Process Innovations, and 29West Inc. 2006. All rights reserved.
-
- License
- =======
- JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
- Corporation, IONA Technologies, Red Hat, Inc., TWIST Process Innovations, and
- 29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide,
- perpetual, royalty-free, nontransferable, nonexclusive license to
- (i) copy, display, distribute and implement the Advanced Messaging Queue Protocol
- ("AMQP") Specification and (ii) the Licensed Claims that are held by
- the Authors, all for the purpose of implementing the Advanced Messaging
- Queue Protocol Specification. Your license and any rights under this
- Agreement will terminate immediately without notice from
- any Author if you bring any claim, suit, demand, or action related to
- the Advanced Messaging Queue Protocol Specification against any Author.
- Upon termination, you shall destroy all copies of the Advanced Messaging
- Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or
- patent application, throughout the world, excluding design patents and
- design registrations, owned or controlled, or that can be sublicensed
- without fee and in compliance with the requirements of this
- Agreement, by an Author or its affiliates now or at any
- future time and which would necessarily be infringed by implementation
- of the Advanced Messaging Queue Protocol Specification. A claim is
- necessarily infringed hereunder only when it is not possible to avoid
- infringing it because there is no plausible non-infringing alternative
- for implementing the required portions of the Advanced Messaging Queue
- Protocol Specification. Notwithstanding the foregoing, Licensed Claims
- shall not include any claims other than as set forth above even if
- contained in the same patent as Licensed Claims; or that read solely
- on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging
- Queue Protocol Specification, or that, if licensed, would require a
- payment of royalties by the licensor to unaffiliated third parties.
- Moreover, Licensed Claims shall not include (i) any enabling technologies
- that may be necessary to make or use any Licensed Product but are not
- themselves expressly set forth in the Advanced Messaging Queue Protocol
- Specification (e.g., semiconductor manufacturing technology, compiler
- technology, object oriented technology, networking technology, operating
- system technology, and the like); or (ii) the implementation of other
- published standards developed elsewhere and merely referred to in the
- body of the Advanced Messaging Queue Protocol Specification, or
- (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced
- Messaging Queue Protocol Specification. For purposes of this definition,
- the Advanced Messaging Queue Protocol Specification shall be deemed to
- include both architectural and interconnection requirements essential
- for interoperability and may also include supporting source code artifacts
- where such architectural, interconnection requirements and source code
- artifacts are expressly identified as being required or documentation to
- achieve compliance with the Advanced Messaging Queue Protocol Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions
- of products (hardware, software or combinations thereof) that implement
- and are compliant with all relevant portions of the Advanced Messaging
- Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any
- use you may make of the Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS,"
- AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
- IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE
- CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE
- SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY
- PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
- USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE
- PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner,
- including advertising or publicity pertaining to the Advanced Messaging
- Queue Protocol Specification or its contents without specific, written
- prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you
- shall destroy all copies of the Advanced Messaging Queue Protocol
- Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the
- Octagon Symbol are trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA
- Technologies PLC and/or its subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered
- trademarks of Red Hat, Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of
- Sun Microsystems, Inc. in the United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service
- marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
-
- JZlib 0.0.* were released under the GNU LGPL license. Later, we have switched
- over to a BSD-style license.
-
-
- =========================================================================
- == JCraft License ==
- =========================================================================
-
- ------------------------------------------------------------------------------
- Copyright (c) 2000,2001,2002,2003 ymnk, JCraft,Inc. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the distribution.
-
- 3. The names of the authors may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
- INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-=============================================================================
-== JLine (BSD) License
-=============================================================================
-Copyright (c) 2008, Apache Software Foundation
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-====================================
-== The Jython License
-====================================
-
-
-A. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING JYTHON
-==============================================================================================================
-
-PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
-----------------------------------------------------------------------------------------
-
-1. This LICENSE AGREEMENT is between the Python Software Foundation
-("PSF"), and the Individual or Organization ("Licensee") accessing and
-otherwise using this software ("Jython") in source or binary form and
-its associated documentation.
-
-2. Subject to the terms and conditions of this License Agreement, PSF
-hereby grants Licensee a nonexclusive, royalty-free, world-wide
-license to reproduce, analyze, test, perform and/or display publicly,
-prepare derivative works, distribute, and otherwise use Jython alone
-or in any derivative version, provided, however, that PSF's License
-Agreement and PSF's notice of copyright, i.e., "Copyright (c) 2007
-Python Software Foundation; All Rights Reserved" are retained in
-Jython alone or in any derivative version prepared by Licensee.
-
-3. In the event Licensee prepares a derivative work that is based on
-or incorporates Jython or any part thereof, and wants to make
-the derivative work available to others as provided herein, then
-Licensee hereby agrees to include in any such work a brief summary of
-the changes made to Jython.
-
-4. PSF is making Jython available to Licensee on an "AS IS"
-basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
-IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
-DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
-FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF JYTHON WILL NOT
-INFRINGE ANY THIRD PARTY RIGHTS.
-
-5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF JYTHON
-FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
-A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING JYTHON,
-OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
-
-6. This License Agreement will automatically terminate upon a material
-breach of its terms and conditions.
-
-7. Nothing in this License Agreement shall be deemed to create any
-relationship of agency, partnership, or joint venture between PSF and
-Licensee. This License Agreement does not grant permission to use PSF
-trademarks or trade name in a trademark sense to endorse or promote
-products or services of Licensee, or any third party.
-
-8. By copying, installing or otherwise using Jython, Licensee
-agrees to be bound by the terms and conditions of this License
-Agreement.
-
-Jython 2.0, 2.1 License
---------------------------------------------
-
-Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Jython Developers
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the distribution.
-
- - Neither the name of the Jython Developers nor the names of
- its contributors may be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-
-JPython 1.1.x Software License.
-______________________________________________________________________
-
- 1. This LICENSE AGREEMENT is between the Corporation for National Research
- Initiatives, having an office at 1895 Preston White Drive, Reston, VA
- 20191 ("CNRI"), and the Individual or Organization ("Licensee")
- accessing and using JPython version 1.1.x in source or binary form and
- its associated documentation as provided herein ("Software").
-
- 2. Subject to the terms and conditions of this License Agreement, CNRI
- hereby grants Licensee a non-exclusive, non-transferable, royalty-free,
- world-wide license to reproduce, analyze, test, perform and/or display
- publicly, prepare derivative works, distribute, and otherwise use the
- Software alone or in any derivative version, provided, however, that
- CNRI's License Agreement and CNRI's notice of copyright, i.e.,
- "Copyright ©1996-1999 Corporation for National Research Initiatives;
- All Rights Reserved" are both retained in the Software, alone or in any
- derivative version prepared by Licensee.
-
- Alternatively, in lieu of CNRI's License Agreement, Licensee may
- substitute the following text (omitting the quotes), provided, however,
- that such text is displayed prominently in the Software alone or in any
- derivative version prepared by Licensee: "JPython (Version 1.1.x) is
- made available subject to the terms and conditions in CNRI's License
- Agreement. This Agreement may be located on the Internet using the
- following unique, persistent identifier (known as a handle):
- 1895.22/1006. The License may also be obtained from a proxy server on
- the Web using the following URL: http://hdl.handle.net/1895.22/1006."
-
- 3. In the event Licensee prepares a derivative work that is based on or
- incorporates the Software or any part thereof, and wants to make the
- derivative work available to the public as provided herein, then
- Licensee hereby agrees to indicate in any such work, in a prominently
- visible way, the nature of the modifications made to CNRI's Software.
-
- 4. Licensee may not use CNRI trademarks or trade name, including JPython
- or CNRI, in a trademark sense to endorse or promote products or
- services of Licensee, or any third party. Licensee may use the mark
- JPython in connection with Licensee's derivative versions that are
- based on or incorporate the Software, but only in the form
- "JPython-based ___________________," or equivalent.
-
- 5. CNRI is making the Software available to Licensee on an "AS IS" basis.
- CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY
- OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND DISCLAIMS ANY
- REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY
- PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE
- ANY THIRD PARTY RIGHTS.
-
- 6. CNRI SHALL NOT BE LIABLE TO LICENSEE OR OTHER USERS OF THE SOFTWARE FOR
- ANY INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF
- USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY DERIVATIVE
- THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. SOME STATES DO NOT
- ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY SO THE ABOVE DISCLAIMER
- MAY NOT APPLY TO LICENSEE.
-
- 7. This License Agreement may be terminated by CNRI (i) immediately upon
- written notice from CNRI of any material breach by the Licensee, if the
- nature of the breach is such that it cannot be promptly remedied; or
- (ii) sixty (60) days following notice from CNRI to Licensee of a
- material remediable breach, if Licensee has not remedied such breach
- within that sixty-day period.
-
- 8. This License Agreement shall be governed by and interpreted in all
- respects by the law of the State of Virginia, excluding conflict of law
- provisions. Nothing in this Agreement shall be deemed to create any
- relationship of agency, partnership, or joint venture between CNRI and
- Licensee.
-
- 9. By clicking on the "ACCEPT" button where indicated, or by installing,
- copying or otherwise using the Software, Licensee agrees to be bound by
- the terms and conditions of this License Agreement.
-
- [ACCEPT BUTTON]
-
-B. HISTORY OF THE SOFTWARE
-=======================================================
-
-JPython was created in late 1997 by Jim Hugunin. Jim was also the
-primary developer while he was at CNRI. In February 1999 Barry Warsaw
-took over as primary developer and released JPython version 1.1.
-
-In October 2000 Barry helped move the software to SourceForge
-where it was renamed to Jython. Jython 2.0 and 2.1 were developed
-under the Jython specific license below.
-
-From the 2.2 release on, Jython contributors have signed
-Python Software Foundation contributor agreements and releases are
-covered under the Python Software Foundation license version 2.
-
-The standard library is covered by the Python Software Foundation
-license as well. See the Lib/LICENSE file for details.
-
-The zxJDBC package was written by Brian Zimmer and originally licensed
-under the GNU Public License. The package is now covered by the Jython
-Software License.
-
-The command line interpreter is covered by the Apache Software
-License. See the org/apache/LICENSE file for details.
-
diff --git a/M4-RCs/qpid/java/resources/NOTICE b/M4-RCs/qpid/java/resources/NOTICE
deleted file mode 100644
index 3958984d40..0000000000
--- a/M4-RCs/qpid/java/resources/NOTICE
+++ /dev/null
@@ -1,48 +0,0 @@
-Apache Qpid
-Copyright 2006-2008 Apache Software Foundation
-This product includes software developed at
-Apache Software Foundation (http://www.apache.org/)
-
-Message logging is provided by the SLF4J library package,
-which is open source software, written by Ceki Gülcü, and
-copyright by SLF4J.ORG and QOS.ch. The original software is
-available from
-
- http://www.slf4j.org/
-
-Concurrency utlitity classes are provided by the backport-util-concurrent
-library package, which is open source software, written by
-Dawid Kurzyniec, and copyright by Distributed Computing Laboratory,
-Emory University. The original software is available from
-
- http://dcl.mathcs.emory.edu/util/backport-util-concurrent/
-
-Data compression support is provided by the JZLib library package,
-which is open source software, written by JCraft, and copyright
-by JCraft. The original software is available from
-
- http://www.jcraft.com/jzlib/
-
-Spring framework is provided by the Spring framework library
-package, which is open source software, written by Rod Johnson
-et al, and copyright by Springframework.org. The original
-software is available from
-
- http://www.springframework.org/
-
-
-This product includes software developed at
-The OSGi Alliance (http://www.osgi.org/).
-Copyright 2006 The OSGi Alliance.
-Licensed under the Apache License 2.0.
-
-Handling console input is provided bye the Jline library package,
-JLine is a Java library for handling console input. It is similar
-in functionality to BSD editline and GNU readline.Original software is
-available from
-
-pphttp://jline.sourceforge.net/index.html
-
-Jython is used within ant scripts for generating code.
-Jython is hosted at http://www.jython.org
-The license for jython is located at http://www.jython.org/Project/license.txt
diff --git a/M4-RCs/qpid/java/resources/README b/M4-RCs/qpid/java/resources/README
deleted file mode 100644
index 1d52d487fb..0000000000
--- a/M4-RCs/qpid/java/resources/README
+++ /dev/null
@@ -1,40 +0,0 @@
-
-Documentation
---------------
-All of our user documentation for the Qpid Java components can be accessed on our wiki at:
-
-http://cwiki.apache.org/confluence/display/qpid/Qpid+Java+Documentation
-
-This includes a Getting Started Guide and FAQ as well as detailed developer documentation.
-However, here's a VERY quick guide to running the installed Qpid broker, once you have installed it somewhere !
-
-
-Running the Broker
-------------------
-
-To run the broker, set the QPID_HOME environment variable to
-distribution directory and add $QPID_HOME/bin to your PATH. Then run
-the qpid-server shell script or qpid-server.bat batch file to start
-the broker. By default, the broker will use $QPID_HOME/etc to find
-the configuration files. You can supply a custom configuration using
-the -c argument.
-
-For example:
-
-qpid-server -c ~/etc/config.xml
-
-You can get a list of all command line arguments by using the -h argument.
-
-
-Developing
-----------
-
-In order to build Qpid you need Ant 1.6.5. Use ant -p to list the
-available targets. The default ant target, build, creates a working
-development-mode distribution in the build directory. To run the
-scripts in build/bin set QPID_HOME to the build directory and put
-${QPID_HOME}/bin on your PATH. The scripts in that directory include
-the standard ones in the distribution and a number of testing scripts.
-
-
-
diff --git a/M4-RCs/qpid/java/systests/build.xml b/M4-RCs/qpid/java/systests/build.xml
deleted file mode 100644
index 4eb7275e73..0000000000
--- a/M4-RCs/qpid/java/systests/build.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
- -
- - Licensed to the Apache Software Foundation (ASF) under one
-nn - or more contributor license agreements. See the NOTICE file
- -n 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 name="System Tests" default="build">
-
- <property name="module.depends" value="client broker common junit-toolkit"/>
- <property name="module.test.src" location="src/main/java"/>
- <property name="module.test.excludes"
- value="**/TTLTest.java,**/DropInTest.java,**/TestClientControlledTest.java"/>
-
- <import file="../module.xml"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/systests/etc/bin/fail.py b/M4-RCs/qpid/java/systests/etc/bin/fail.py
deleted file mode 100644
index 517f31d075..0000000000
--- a/M4-RCs/qpid/java/systests/etc/bin/fail.py
+++ /dev/null
@@ -1,88 +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
-
-from optparse import OptionParser
-
-BASE_CMD = "mvn -Dskip.python.test=true %s test"
-
-def main():
- parser = OptionParser()
- parser.add_option("-t", "--test", dest="test",
- action="store", type="string",
- help="run specific tests")
- parser.add_option("-c", "--continuous", dest="continuous",
- action="store_true", default=False,
- help="run tests after failures, don't stop")
-
-
- (options, args) = parser.parse_args()
-
- # determine command to run
- if (options.test != None):
- cmd = (BASE_CMD % ("-Dtest="+options.test))
- else:
- cmd = (BASE_CMD % (""))
-
- run_forever = options.continuous
-
-
- failed_runs = []
- iteration = 0
- fail_match = re.compile("BUILD SUCCESSFUL")
- done = False
-
- while (run_forever or not (len(failed_runs) > 0)):
- iteration = iteration + 1
- if (run_forever):
- extra_text = (", %d failures so far: %s:" % (len(failed_runs), failed_runs))
- else:
- extra_text = ""
- print ("%s Test run %d%s" % (datetime.datetime.today().isoformat(), iteration, extra_text))
- (child_stdin, child_stdout_and_stderr) = os.popen4(cmd)
- output = child_stdout_and_stderr.read()
- child_stdin.close()
- child_stdout_and_stderr.close()
- matches = fail_match.search(output)
- if (matches == None):
- failed_runs.append(iteration)
- output_name = ("test-run-%d.out" % (iteration))
- #write testouput
- test_output = file(output_name, "w")
- test_output.write(output)
- test_output.close()
- #tar test-output and surefire reports together
- find_stdout = os.popen("find . -type d -name surefire-reports")
- surefire_dirs = find_stdout.read().replace('\n', ' ')
- find_stdout.close()
- tarcmd = ("tar -zcf test-failures-%d.tar.gz %s %s" % (iteration, output_name, surefire_dirs))
- tar_stdout = os.popen(tarcmd)
- tar_output = tar_stdout.read()
- tar_exitstatus = tar_stdout.close()
- print ("Something failed! Check %s" % (output_name))
- if (tar_exitstatus != None):
- print ("tar exited abornmally, aborting\n %s" % (tar_output))
- run_forever = False
-
-if __name__ == "__main__":
- main() \ No newline at end of file
diff --git a/M4-RCs/qpid/java/systests/etc/bin/testclients.sh b/M4-RCs/qpid/java/systests/etc/bin/testclients.sh
deleted file mode 100755
index 002f3d98bb..0000000000
--- a/M4-RCs/qpid/java/systests/etc/bin/testclients.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-for x in `seq 1 $1`;
-do
- java -cp qpid-integrationtests-1.0-incubating-M2-SNAPSHOT-all-test-deps.jar -Dlog4j.configuration=file:/home/rupert/qpid/trunk/qpid/java/etc/mylog4j.xml org.apache.qpid.test.framework.distributedtesting.TestClient -n java$x &
-done
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java
deleted file mode 100644
index 5323ad28bf..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java
+++ /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.
- *
- */
-package org.apache.mina.transport.vmpipe.support;
-
-import org.apache.mina.common.IdleStatus;
-
-import java.util.HashMap;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * This file is a patch to override MINA, because of the IdentityHashMap bug. Workaround to be supplied in MINA 1.0.7.
- * This patched file will be removed once upgraded onto a newer MINA.
- *
- * Dectects idle sessions and fires <tt>sessionIdle</tt> events to them.
- *
- * @author The Apache Directory Project (mina-dev@directory.apache.org)
- */
-public class VmPipeIdleStatusChecker
-{
- private static final VmPipeIdleStatusChecker INSTANCE = new VmPipeIdleStatusChecker();
-
- public static VmPipeIdleStatusChecker getInstance()
- {
- return INSTANCE;
- }
-
- private final Map sessions = new HashMap(); // will use as a set
-
- private final Worker worker = new Worker();
-
- private VmPipeIdleStatusChecker()
- {
- worker.start();
- }
-
- public void addSession(VmPipeSessionImpl session)
- {
- synchronized (sessions)
- {
- sessions.put(session, session);
- }
- }
-
- private class Worker extends Thread
- {
- private Worker()
- {
- super("VmPipeIdleStatusChecker");
- setDaemon(true);
- }
-
- public void run()
- {
- for (;;)
- {
- try
- {
- Thread.sleep(1000);
- }
- catch (InterruptedException e)
- { }
-
- long currentTime = System.currentTimeMillis();
-
- synchronized (sessions)
- {
- Iterator it = sessions.keySet().iterator();
- while (it.hasNext())
- {
- VmPipeSessionImpl session = (VmPipeSessionImpl) it.next();
- if (!session.isConnected())
- {
- it.remove();
- }
- else
- {
- notifyIdleSession(session, currentTime);
- }
- }
- }
- }
- }
- }
-
- private void notifyIdleSession(VmPipeSessionImpl session, long currentTime)
- {
- notifyIdleSession0(session, currentTime, session.getIdleTimeInMillis(IdleStatus.BOTH_IDLE), IdleStatus.BOTH_IDLE,
- Math.max(session.getLastIoTime(), session.getLastIdleTime(IdleStatus.BOTH_IDLE)));
- notifyIdleSession0(session, currentTime, session.getIdleTimeInMillis(IdleStatus.READER_IDLE), IdleStatus.READER_IDLE,
- Math.max(session.getLastReadTime(), session.getLastIdleTime(IdleStatus.READER_IDLE)));
- notifyIdleSession0(session, currentTime, session.getIdleTimeInMillis(IdleStatus.WRITER_IDLE), IdleStatus.WRITER_IDLE,
- Math.max(session.getLastWriteTime(), session.getLastIdleTime(IdleStatus.WRITER_IDLE)));
- }
-
- private void notifyIdleSession0(VmPipeSessionImpl session, long currentTime, long idleTime, IdleStatus status,
- long lastIoTime)
- {
- if ((idleTime > 0) && (lastIoTime != 0) && ((currentTime - lastIoTime) >= idleTime))
- {
- session.increaseIdleCount(status);
- session.getFilterChain().fireSessionIdle(session, status);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java
deleted file mode 100644
index fe418535d6..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java
+++ /dev/null
@@ -1,152 +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.
- *
- */
-package org.apache.qpid.client;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.TextMessage;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class tests all the alerts an AMQQueue can throw based on threshold
- * values of different parameters
- */
-public class AMQQueueDeferredOrderingTest extends TestCase
-{
-
- private static final int NUM_MESSAGES = 1000;
-
- private AMQConnection con;
- private Session session;
- private AMQQueue queue;
- private MessageConsumer consumer;
-
- private static final Logger _logger = LoggerFactory.getLogger(AMQQueueDeferredOrderingTest.class);
-
- private ASyncProducer producerThread;
- private static final String BROKER = "vm://:1";
-
- private class ASyncProducer extends Thread
- {
-
- private MessageProducer producer;
- private final Logger _logger = LoggerFactory.getLogger(ASyncProducer.class);
- private Session session;
- private int start;
- private int end;
-
- public ASyncProducer(AMQQueue q, int start, int end) throws Exception
- {
- this.session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- this._logger.info("Create Consumer of Q1");
- this.producer = this.session.createProducer(q);
- this.start = start;
- this.end = end;
- }
-
- public void run()
- {
- try
- {
- this._logger.info("Starting to send messages");
- for (int i = start; i < end && !interrupted(); i++)
- {
- producer.send(session.createTextMessage(Integer.toString(i)));
- }
- this._logger.info("Sent " + (end - start) + " messages");
- }
- catch (JMSException e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
-
- _logger.info("Create Connection");
- con = new AMQConnection(BROKER, "guest", "guest", "OrderingTest", "test");
- _logger.info("Create Session");
- session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- _logger.info("Create Q");
- queue = new AMQQueue(session.getDefaultQueueExchangeName(), new AMQShortString("Q"), new AMQShortString("Q"),
- false, true);
- _logger.info("Create Consumer of Q");
- consumer = session.createConsumer(queue);
- _logger.info("Start Connection");
- con.start();
- }
-
- public void testPausedOrder() throws Exception
- {
-
- // Setup initial messages
- _logger.info("Creating first producer thread");
- producerThread = new ASyncProducer(queue, 0, NUM_MESSAGES / 2);
- producerThread.start();
- // Wait for them to be done
- producerThread.join();
-
- // Setup second set of messages to produce while we consume
- _logger.info("Creating second producer thread");
- producerThread = new ASyncProducer(queue, NUM_MESSAGES / 2, NUM_MESSAGES);
- producerThread.start();
-
- // Start consuming and checking they're in order
- _logger.info("Consuming messages");
- for (int i = 0; i < NUM_MESSAGES; i++)
- {
- Message msg = consumer.receive(3000);
- assertNotNull("Message should not be null", msg);
- assertTrue("Message should be a text message", msg instanceof TextMessage);
- assertEquals("Message content does not match expected", Integer.toString(i), ((TextMessage) msg).getText());
- }
- }
-
- protected void tearDown() throws Exception
- {
- _logger.info("Interuptting producer thread");
- producerThread.interrupt();
- _logger.info("Closing connection");
- con.close();
-
- TransportConnection.killAllVMBrokers();
- super.tearDown();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(AMQQueueDeferredOrderingTest.class);
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java
deleted file mode 100644
index 7cca22de6c..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/DispatcherTest.java
+++ /dev/null
@@ -1,252 +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.
- *
- *
- */
-package org.apache.qpid.client;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.spi.InitialContextFactory;
-
-import java.util.Hashtable;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * QPID-293 Setting MessageListener after connection has started can cause messages to be "lost" on a internal delivery queue
- * <p/>
- * The message delivery process:
- * Mina puts a message on _queue in AMQSession and the dispatcher thread take()s
- * from here and dispatches to the _consumers. If the _consumer doesn't have a message listener set at connection start
- * then messages are stored on _synchronousQueue (which needs to be > 1 to pass JMS TCK as multiple consumers on a
- * session can run in any order and a synchronous put/poll will block the dispatcher).
- * <p/>
- * When setting the message listener later the _synchronousQueue is just poll()'ed and the first message delivered
- * the remaining messages will be left on the queue and lost, subsequent messages on the session will arrive first.
- */
-public class DispatcherTest extends TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(DispatcherTest.class);
-
- Context _context;
-
- private static final int MSG_COUNT = 6;
- private int _receivedCount = 0;
- private int _receivedCountWhileStopped = 0;
- private Connection _clientConnection, _producerConnection;
- private MessageConsumer _consumer;
- MessageProducer _producer;
- Session _clientSession, _producerSession;
-
- private final CountDownLatch _allFirstMessagesSent = new CountDownLatch(1); // all messages Sent Lock
- private final CountDownLatch _allSecondMessagesSent = new CountDownLatch(1); // all messages Sent Lock
-
- private volatile boolean _connectionStopped = false;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
-
- InitialContextFactory factory = new PropertiesFileInitialContextFactory();
-
- Hashtable<String, String> env = new Hashtable<String, String>();
-
- env.put("connectionfactory.connection", "amqp://guest:guest@MLT_ID/test?brokerlist='vm://:1'");
- env.put("queue.queue", "MessageListenerTest");
-
- _context = factory.getInitialContext(env);
-
- Queue queue = (Queue) _context.lookup("queue");
-
- // Create Client 1
- _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
-
- _clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _consumer = _clientSession.createConsumer(queue);
-
- // Create Producer
- _producerConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
-
- _producerConnection.start();
-
- _producerSession = _producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _producer = _producerSession.createProducer(queue);
-
- for (int msg = 0; msg < MSG_COUNT; msg++)
- {
- _producer.send(_producerSession.createTextMessage("Message " + msg));
- }
- }
-
- protected void tearDown() throws Exception
- {
-
- _clientConnection.close();
-
- _producerConnection.close();
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- public void testAsynchronousRecieve()
- {
- _logger.info("Test Start");
-
- assertTrue(!((AMQConnection) _clientConnection).started());
-
- // Set default Message Listener
- try
- {
- _consumer.setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- _logger.info("Client 1 ML 1 Received Message(" + _receivedCount + "):" + message);
-
- _receivedCount++;
-
- if (_receivedCount == MSG_COUNT)
- {
- _allFirstMessagesSent.countDown();
- }
-
- if (_connectionStopped)
- {
- _logger.info("Running with Message:" + _receivedCount);
- }
-
- if (_connectionStopped && (_allFirstMessagesSent.getCount() == 0))
- {
- _receivedCountWhileStopped++;
- }
-
- if (_allFirstMessagesSent.getCount() == 0)
- {
- if (_receivedCount == (MSG_COUNT * 2))
- {
- _allSecondMessagesSent.countDown();
- }
- }
- }
- });
-
- assertTrue("Connecion should not be started", !((AMQConnection) _clientConnection).started());
- _clientConnection.start();
- }
- catch (JMSException e)
- {
- _logger.error("Error Setting Default ML on consumer1");
- }
-
- try
- {
- _allFirstMessagesSent.await(1000, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- // do nothing
- }
-
- try
- {
- assertTrue("Connecion should be started", ((AMQConnection) _clientConnection).started());
- _clientConnection.stop();
- _connectionStopped = true;
- }
- catch (JMSException e)
- {
- _logger.error("Error stopping connection");
- }
-
- try
- {
- _logger.error("Send additional messages");
-
- for (int msg = 0; msg < MSG_COUNT; msg++)
- {
- _producer.send(_producerSession.createTextMessage("Message " + msg));
- }
- }
- catch (JMSException e)
- {
- _logger.error("Unable to send additional messages", e);
- }
-
- try
- {
- Thread.sleep(1000);
- }
- catch (InterruptedException e)
- {
- // ignore
- }
-
- try
- {
- _logger.info("Restarting connection");
-
- _connectionStopped = false;
- _clientConnection.start();
- }
- catch (JMSException e)
- {
- _logger.error("Error Setting Better ML on consumer1", e);
- }
-
- _logger.info("Waiting upto 2 seconds for messages");
-
- try
- {
- _allSecondMessagesSent.await(1000, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- // do nothing
- }
-
- assertEquals("Messages not received correctly", 0, _allFirstMessagesSent.getCount());
- assertEquals("Messages not received correctly", 0, _allSecondMessagesSent.getCount());
- assertEquals("Client didn't get all messages", MSG_COUNT * 2, _receivedCount);
- assertEquals("Messages received while stopped is not 0", 0, _receivedCountWhileStopped);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(DispatcherTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerImmediatePrefetch.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerImmediatePrefetch.java
deleted file mode 100644
index 7461f6c200..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerImmediatePrefetch.java
+++ /dev/null
@@ -1,44 +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.
- *
- *
- */
-package org.apache.qpid.client;
-
-/**
- * QPID-293 Setting MessageListener after connection has started can cause messages to be "lost" on a internal delivery
- * queue <p/> The message delivery process: Mina puts a message on _queue in AMQSession and the dispatcher thread
- * take()s from here and dispatches to the _consumers. If the _consumer1 doesn't have a message listener set at
- * connection start then messages are stored on _synchronousQueue (which needs to be > 1 to pass JMS TCK as multiple
- * consumers on a session can run in any order and a synchronous put/poll will block the dispatcher). <p/> When setting
- * the message listener later the _synchronousQueue is just poll()'ed and the first message delivered the remaining
- * messages will be left on the queue and lost, subsequent messages on the session will arrive first.
- */
-public class MessageListenerMultiConsumerImmediatePrefetch extends MessageListenerMultiConsumerTest
-{
- protected void setUp() throws Exception
- {
- System.setProperty(AMQSession.IMMEDIATE_PREFETCH, "true");
- super.setUp();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(MessageListenerMultiConsumerImmediatePrefetch.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java
deleted file mode 100644
index b438304892..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java
+++ /dev/null
@@ -1,245 +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.
- *
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.naming.Context;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * QPID-293 Setting MessageListener after connection has started can cause messages to be "lost" on a internal delivery
- * queue <p/> The message delivery process: Mina puts a message on _queue in AMQSession and the dispatcher thread
- * take()s from here and dispatches to the _consumers. If the _consumer1 doesn't have a message listener set at
- * connection start then messages are stored on _synchronousQueue (which needs to be > 1 to pass JMS TCK as multiple
- * consumers on a session can run in any order and a synchronous put/poll will block the dispatcher). <p/> When setting
- * the message listener later the _synchronousQueue is just poll()'ed and the first message delivered the remaining
- * messages will be left on the queue and lost, subsequent messages on the session will arrive first.
- */
-public class MessageListenerMultiConsumerTest extends QpidTestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(MessageListenerMultiConsumerTest.class);
-
- Context _context;
-
- private static final int MSG_COUNT = 6;
- private int receivedCount1 = 0;
- private int receivedCount2 = 0;
- private Connection _clientConnection;
- private MessageConsumer _consumer1;
- private MessageConsumer _consumer2;
- private Session _clientSession1;
- private Queue _queue;
- private final CountDownLatch _allMessagesSent = new CountDownLatch(2); // all messages Sent Lock
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- // Create Client 1
- _clientConnection = getConnection("guest", "guest");
-
- _clientConnection.start();
-
- _clientSession1 = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _queue =_clientSession1.createQueue("queue");
-
- _consumer1 = _clientSession1.createConsumer(_queue);
-
- // Create Client 2
- Session clientSession2 = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _consumer2 = clientSession2.createConsumer(_queue);
-
- // Create Producer
- Connection producerConnection = getConnection("guest", "guest");
-
- producerConnection.start();
-
- Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- MessageProducer producer = producerSession.createProducer(_queue);
-
- for (int msg = 0; msg < MSG_COUNT; msg++)
- {
- producer.send(producerSession.createTextMessage("Message " + msg));
- }
-
- producerConnection.close();
-
- }
-
- protected void tearDown() throws Exception
- {
- _clientConnection.close();
- super.tearDown();
- }
-
- public void testRecieveInterleaved() throws Exception
- {
- int msg = 0;
- int MAX_LOOPS = MSG_COUNT * 2;
- for (int loops = 0; (msg < MSG_COUNT) || (loops < MAX_LOOPS); loops++)
- {
-
- if (_consumer1.receive(100) != null)
- {
- msg++;
- }
-
- if (_consumer2.receive(100) != null)
- {
- msg++;
- }
- }
-
- assertEquals("Not all messages received.", MSG_COUNT, msg);
- }
-
- public void testAsynchronousRecieve() throws Exception
- {
- _consumer1.setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- _logger.info("Client 1 Received Message(" + receivedCount1 + "):" + message);
-
- receivedCount1++;
-
- if (receivedCount1 == (MSG_COUNT / 2))
- {
- _allMessagesSent.countDown();
- }
-
- }
- });
-
- _consumer2.setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- _logger.info("Client 2 Received Message(" + receivedCount2 + "):" + message);
-
- receivedCount2++;
- if (receivedCount2 == (MSG_COUNT / 2))
- {
- _allMessagesSent.countDown();
- }
- }
- });
-
- _logger.info("Waiting upto 2 seconds for messages");
-
- try
- {
- _allMessagesSent.await(4000, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- // do nothing
- }
-
- assertEquals(MSG_COUNT, receivedCount1 + receivedCount2);
- }
-
- public void testRecieveC2Only() throws Exception
- {
- if (
- !Boolean.parseBoolean(
- System.getProperties().getProperty(AMQSession.IMMEDIATE_PREFETCH,
- AMQSession.IMMEDIATE_PREFETCH_DEFAULT)))
- {
- _logger.info("Performing Receive only on C2");
- for (int msg = 0; msg < MSG_COUNT; msg++)
- {
- assertTrue(MSG_COUNT + " msg should be received. Only received:" + msg, _consumer2.receive(1000) != null);
- }
- }
- }
-
- public void testRecieveBoth() throws Exception
- {
- if (
- !Boolean.parseBoolean(
- System.getProperties().getProperty(AMQSession.IMMEDIATE_PREFETCH,
- AMQSession.IMMEDIATE_PREFETCH_DEFAULT)))
- {
- _logger.info("Performing Receive only with two consumers on one session ");
-
- MessageConsumer consumer2 = _clientSession1.createConsumer(_queue);
-
- int msg;
- for (msg = 0; msg < (MSG_COUNT / 2); msg++)
- {
-
-
- final Message message = _consumer1.receive(1000);
- if(message == null)
- {
- break;
- }
-
- }
-
- _consumer1.close();
- _clientSession1.close();
-
- for (; msg < MSG_COUNT ; msg++)
- {
- assertTrue("Failed at msg id" + msg, _consumer2.receive(1000) != null);
- }
-
- }
- else
- {
- _logger.info("Performing Receive only on both C1 and C2");
-
- for (int msg = 0; msg < (MSG_COUNT / 2); msg++)
- {
-
- assertTrue(_consumer1.receive(3000) != null);
- }
-
- for (int msg = 0; msg < (MSG_COUNT / 2); msg++)
- {
- assertTrue(_consumer2.receive(3000) != null);
- }
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(MessageListenerMultiConsumerTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerTest.java
deleted file mode 100644
index 4c1d5ee9c1..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MessageListenerTest.java
+++ /dev/null
@@ -1,179 +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.
- *
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.naming.Context;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * QPID-293 Setting MessageListener after connection has started can cause messages to be "lost" on a internal delivery
- * queue <p/> The message delivery process: Mina puts a message on _queue in AMQSession and the dispatcher thread
- * take()s from here and dispatches to the _consumers. If the _consumer doesn't have a message listener set at
- * connection start then messages are stored on _synchronousQueue (which needs to be > 1 to pass JMS TCK as multiple
- * consumers on a session can run in any order and a synchronous put/poll will block the dispatcher). <p/> When setting
- * the message listener later the _synchronousQueue is just poll()'ed and the first message delivered the remaining
- * messages will be left on the queue and lost, subsequent messages on the session will arrive first.
- */
-public class MessageListenerTest extends QpidTestCase implements MessageListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(MessageListenerTest.class);
-
- Context _context;
-
- private static final int MSG_COUNT = 5;
- private int receivedCount = 0;
- private MessageConsumer _consumer;
- private Connection _clientConnection;
- private CountDownLatch _awaitMessages = new CountDownLatch(MSG_COUNT);
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- // Create Client
- _clientConnection = getConnection("guest", "guest");
-
- _clientConnection.start();
-
- Session clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Queue queue =clientSession.createQueue("message-listener-test-queue");
-
- _consumer = clientSession.createConsumer(queue);
-
- // Create Producer
-
- Connection producerConnection = getConnection("guest", "guest");
-
- producerConnection.start();
-
- Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- MessageProducer producer = producerSession.createProducer(queue);
-
- for (int msg = 0; msg < MSG_COUNT; msg++)
- {
- producer.send(producerSession.createTextMessage("Message " + msg));
- }
-
- producerConnection.close();
-
- }
-
- protected void tearDown() throws Exception
- {
- _clientConnection.close();
- super.tearDown();
- }
-
- public void testSynchronousRecieve() throws Exception
- {
- for (int msg = 0; msg < MSG_COUNT; msg++)
- {
- assertTrue(_consumer.receive(2000) != null);
- }
- }
-
- public void testAsynchronousRecieve() throws Exception
- {
- _consumer.setMessageListener(this);
-
- _logger.info("Waiting 3 seconds for messages");
-
- try
- {
- _awaitMessages.await(3000, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- // do nothing
- }
- // Should have recieved all async messages
- assertEquals(MSG_COUNT, receivedCount);
-
- }
-
- public void testRecieveThenUseMessageListener() throws Exception
- {
-
- _logger.error("Test disabled as initial receive is not called first");
- // Perform initial receive to start connection
- assertTrue(_consumer.receive(2000) != null);
- receivedCount++;
-
- // Sleep to ensure remaining 4 msgs end up on _synchronousQueue
- Thread.sleep(1000);
-
- // Set the message listener and wait for the messages to come in.
- _consumer.setMessageListener(this);
-
- _logger.info("Waiting 3 seconds for messages");
-
- try
- {
- _awaitMessages.await(3000, TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- // do nothing
- }
- // Should have recieved all async messages
- assertEquals(MSG_COUNT, receivedCount);
-
- _clientConnection.close();
-
- Connection conn = getConnection("guest", "guest");
- Session clientSession = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Queue queue = clientSession.createQueue("message-listener-test-queue");
- MessageConsumer cons = clientSession.createConsumer(queue);
- conn.start();
-
- // check that the messages were actually dequeued
- assertTrue(cons.receive(2000) == null);
- }
-
- public void onMessage(Message message)
- {
- _logger.info("Received Message(" + receivedCount + "):" + message);
-
- receivedCount++;
- _awaitMessages.countDown();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(MessageListenerTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java
deleted file mode 100644
index ea0bae7a56..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java
+++ /dev/null
@@ -1,103 +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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.client.transport.TransportConnection;
-
-import java.io.File;
-import java.security.Provider;
-import java.security.Security;
-import java.util.List;
-import java.util.LinkedList;
-
-/**
- * QPID-1394 : Test to ensure that the client can register their custom JCAProviders after the broker to ensure that
- * the Qpid custom authentication SASL plugins are used.
- */
-public class MultipleJCAProviderRegistrationTest extends QpidTestCase
-{
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- stopBroker();
-
- _broker = VM;
-
- final String QpidHome = System.getProperty("QPID_HOME");
-
- assertNotNull("QPID_HOME not set",QpidHome);
-
- final File defaultaclConfigFile = new File(QpidHome, "etc/config.xml");
-
- if (!defaultaclConfigFile.exists())
- {
- System.err.println("Configuration file not found:" + defaultaclConfigFile);
- fail("Configuration file not found:" + defaultaclConfigFile);
- }
-
- ConfigurationFileApplicationRegistry config = new ConfigurationFileApplicationRegistry(defaultaclConfigFile);
-
- // This is a bit evil it should be updated with QPID-1103
- config.getConfiguration().setProperty("management.enabled", "false");
-
- startBroker();
- }
-
- public void test() throws Exception
- {
- // Get the providers before connection
- Provider[] providers = Security.getProviders();
-
- // Force the client to load the providers
- getConnection();
-
- Provider[] afterConnectionCreation = Security.getProviders();
-
- // Find the additions
- List additions = new LinkedList();
- for (Provider afterCreation : afterConnectionCreation)
- {
- boolean found = false;
- for (Provider provider : providers)
- {
- if (provider == afterCreation)
- {
- found=true;
- break;
- }
- }
-
- // Record added registies
- if (!found)
- {
- additions.add(afterCreation);
- }
- }
-
- assertTrue("Client did not register any providers", additions.size() > 0);
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/ResetMessageListenerTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/ResetMessageListenerTest.java
deleted file mode 100644
index 636fb714e0..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/ResetMessageListenerTest.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.Context;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * QPID-293 Setting MessageListener after connection has started can cause messages to be "lost" on a internal delivery
- * queue <p/> The message delivery process: Mina puts a message on _queue in AMQSession and the dispatcher thread
- * take()s from here and dispatches to the _consumers. If the _consumer1 doesn't have a message listener set at
- * connection start then messages are stored on _synchronousQueue (which needs to be > 1 to pass JMS TCK as multiple
- * consumers on a session can run in any order and a synchronous put/poll will block the dispatcher). <p/> When setting
- * the message listener later the _synchronousQueue is just poll()'ed and the first message delivered the remaining
- * messages will be left on the queue and lost, subsequent messages on the session will arrive first.
- */
-public class ResetMessageListenerTest extends QpidTestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(ResetMessageListenerTest.class);
-
- Context _context;
-
- private static final int MSG_COUNT = 6;
- private Connection _clientConnection, _producerConnection;
- private MessageConsumer _consumer1;
- MessageProducer _producer;
- Session _clientSession, _producerSession;
-
- private final CountDownLatch _allFirstMessagesSent = new CountDownLatch(MSG_COUNT); // all messages Sent Lock
- private final CountDownLatch _allSecondMessagesSent = new CountDownLatch(MSG_COUNT); // all messages Sent Lock
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- _clientConnection = getConnection("guest", "guest");
- _clientConnection.start();
- // Create Client 1
-
- _clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Queue queue = _clientSession.createQueue("reset-message-listener-test-queue");
-
- _consumer1 = _clientSession.createConsumer(queue);
-
- // Create Producer
- _producerConnection = getConnection("guest", "guest");
-
- _producerConnection.start();
-
- _producerSession = _producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _producer = _producerSession.createProducer(queue);
-
- TextMessage m = _producerSession.createTextMessage();
- m.setStringProperty("rank", "first");
- for (int msg = 0; msg < MSG_COUNT; msg++)
- {
- m.setText("Message " + msg);
- _producer.send(m);
- }
- }
-
- protected void tearDown() throws Exception
- {
- _clientConnection.close();
-
- super.tearDown();
- }
-
- public void testAsynchronousRecieve()
- {
-
- _logger.info("Test Start");
-
- try
- {
- _consumer1.setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- try
- {
- if (message.getStringProperty("rank").equals("first"))
- {
- _allFirstMessagesSent.countDown();
- }
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("error receiving message");
- }
- }
- });
- }
- catch (JMSException e)
- {
- _logger.error("Error Setting Default ML on consumer1");
- }
- try
- {
- assertTrue("Did not receive all first batch of messages",
- _allFirstMessagesSent.await(1000, TimeUnit.MILLISECONDS));
- _logger.info("Received first batch of messages");
- }
- catch (InterruptedException e)
- {
- // do nothing
- }
-
- try
- {
- _clientConnection.stop();
- }
- catch (JMSException e)
- {
- _logger.error("Error stopping connection");
- }
-
- _logger.info("Reset Message Listener ");
- try
- {
- _consumer1.setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- try
- {
- if (message.getStringProperty("rank").equals("first"))
- {
- // Something ugly will happen, it'll probably kill the dispatcher
- fail("All first set of messages should have been received");
- }
- else
- {
- _allSecondMessagesSent.countDown();
- }
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- // Something ugly will happen, it'll probably kill the dispatcher
- fail("error receiving message");
- }
- }
- });
-
- _clientConnection.start();
- }
- catch (javax.jms.IllegalStateException e)
- {
- _logger.error("Connection not stopped while setting ML", e);
- fail("Unable to change message listener:" + e.getCause());
- }
- catch (JMSException e)
- {
- _logger.error("Error Setting Better ML on consumer1", e);
- }
-
- try
- {
- _logger.info("Send additional messages");
- TextMessage m = _producerSession.createTextMessage();
- m.setStringProperty("rank", "second");
- for (int msg = 0; msg < MSG_COUNT; msg++)
- {
- m.setText("Message " + msg);
- _producer.send(m);
- }
- }
- catch (JMSException e)
- {
- _logger.error("Unable to send additional messages", e);
- }
-
- _logger.info("Waiting for messages");
-
- try
- {
- assertTrue(_allSecondMessagesSent.await(1000, TimeUnit.MILLISECONDS));
- }
- catch (InterruptedException e)
- {
- // do nothing
- }
- assertEquals("First batch of messages not received correctly", 0, _allFirstMessagesSent.getCount());
- assertEquals("Second batch of messages not received correctly", 0, _allSecondMessagesSent.getCount());
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(ResetMessageListenerTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/message/NonQpidObjectMessage.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/message/NonQpidObjectMessage.java
deleted file mode 100644
index 857adaf82c..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/client/message/NonQpidObjectMessage.java
+++ /dev/null
@@ -1,236 +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.
- *
- */
-package org.apache.qpid.client.message;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-import javax.jms.Session;
-
-public class NonQpidObjectMessage implements ObjectMessage {
-
- private ObjectMessage _realMessage;
- private String _contentString;
-
- /**
- * Allows us to construct a JMS message which
- * does not inherit from the Qpid message superclasses
- * and expand our unit testing of MessageConverter et al
- * @param session
- */
- public NonQpidObjectMessage(Session session) throws JMSException
- {
- _realMessage = session.createObjectMessage();
- }
-
- public String getJMSMessageID() throws JMSException {
- return _realMessage.getJMSMessageID();
- }
-
- public void setJMSMessageID(String string) throws JMSException {
- _realMessage.setJMSMessageID(string);
- }
-
- public long getJMSTimestamp() throws JMSException {
- return _realMessage.getJMSTimestamp();
- }
-
- public void setJMSTimestamp(long l) throws JMSException {
- _realMessage.setJMSTimestamp(l);
- }
-
- public byte[] getJMSCorrelationIDAsBytes() throws JMSException {
- return _realMessage.getJMSCorrelationIDAsBytes();
- }
-
- public void setJMSCorrelationIDAsBytes(byte[] bytes) throws JMSException {
- _realMessage.setJMSCorrelationIDAsBytes(bytes);
- }
-
- public void setJMSCorrelationID(String string) throws JMSException {
- _realMessage.setJMSCorrelationID(string);
- }
-
- public String getJMSCorrelationID() throws JMSException {
- return _realMessage.getJMSCorrelationID();
- }
-
- public Destination getJMSReplyTo() throws JMSException {
- return _realMessage.getJMSReplyTo();
- }
-
- public void setJMSReplyTo(Destination destination) throws JMSException {
- _realMessage.setJMSReplyTo(destination);
- }
-
- public Destination getJMSDestination() throws JMSException {
- return _realMessage.getJMSDestination();
- }
-
- public void setJMSDestination(Destination destination) throws JMSException {
- _realMessage.setJMSDestination(destination);
- }
-
- public int getJMSDeliveryMode() throws JMSException {
- return _realMessage.getJMSDeliveryMode();
- }
-
- public void setJMSDeliveryMode(int i) throws JMSException {
- _realMessage.setJMSDeliveryMode(i);
- }
-
- public boolean getJMSRedelivered() throws JMSException {
- return _realMessage.getJMSRedelivered();
- }
-
- public void setJMSRedelivered(boolean b) throws JMSException {
- _realMessage.setJMSRedelivered(b);
- }
-
- public String getJMSType() throws JMSException {
- return _realMessage.getJMSType();
- }
-
- public void setJMSType(String string) throws JMSException {
- _realMessage.setJMSType(string);
- }
-
- public long getJMSExpiration() throws JMSException {
- return _realMessage.getJMSExpiration();
- }
-
- public void setJMSExpiration(long l) throws JMSException {
- _realMessage.setJMSExpiration(l);
- }
-
- public int getJMSPriority() throws JMSException {
- return _realMessage.getJMSPriority();
- }
-
- public void setJMSPriority(int i) throws JMSException {
- _realMessage.setJMSPriority(i);
- }
-
- public void clearProperties() throws JMSException {
- _realMessage.clearProperties();
- }
-
- public boolean propertyExists(String string) throws JMSException {
- return _realMessage.propertyExists(string);
- }
-
- public boolean getBooleanProperty(String string) throws JMSException {
- return _realMessage.getBooleanProperty(string);
- }
-
- public byte getByteProperty(String string) throws JMSException {
- return _realMessage.getByteProperty(string);
- }
-
- public short getShortProperty(String string) throws JMSException {
- return _realMessage.getShortProperty(string);
- }
-
- public int getIntProperty(String string) throws JMSException {
- return _realMessage.getIntProperty(string);
- }
-
- public long getLongProperty(String string) throws JMSException {
- return _realMessage.getLongProperty(string);
- }
-
- public float getFloatProperty(String string) throws JMSException {
- return _realMessage.getFloatProperty(string);
- }
-
- public double getDoubleProperty(String string) throws JMSException {
- return _realMessage.getDoubleProperty(string);
- }
-
- public String getStringProperty(String string) throws JMSException {
- return _realMessage.getStringProperty(string);
- }
-
- public Object getObjectProperty(String string) throws JMSException {
- return _realMessage.getObjectProperty(string);
- }
-
- public Enumeration getPropertyNames() throws JMSException {
- return _realMessage.getPropertyNames();
- }
-
- public void setBooleanProperty(String string, boolean b) throws JMSException {
- _realMessage.setBooleanProperty(string,b);
- }
-
- public void setByteProperty(String string, byte b) throws JMSException {
- _realMessage.setByteProperty(string,b);
- }
-
- public void setShortProperty(String string, short i) throws JMSException {
- _realMessage.setShortProperty(string,i);
- }
-
- public void setIntProperty(String string, int i) throws JMSException {
- _realMessage.setIntProperty(string,i);
- }
-
- public void setLongProperty(String string, long l) throws JMSException {
- _realMessage.setLongProperty(string,l);
- }
-
- public void setFloatProperty(String string, float v) throws JMSException {
- _realMessage.setFloatProperty(string,v);
- }
-
- public void setDoubleProperty(String string, double v) throws JMSException {
- _realMessage.setDoubleProperty(string,v);
- }
-
- public void setStringProperty(String string, String string1) throws JMSException {
- _realMessage.setStringProperty(string,string1);
- }
-
- public void setObjectProperty(String string, Object object) throws JMSException {
- _realMessage.setObjectProperty(string,object);
- }
-
- public void acknowledge() throws JMSException {
- _realMessage.acknowledge();
- }
-
- public void clearBody() throws JMSException {
- _realMessage.clearBody();
- }
-
- public void setObject(Serializable serializable) throws JMSException {
- if (serializable instanceof String)
- {
- _contentString = (String)serializable;
- }
- }
-
- public Serializable getObject() throws JMSException {
- return _contentString; }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
deleted file mode 100644
index b9b3168fcc..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
+++ /dev/null
@@ -1,92 +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.
- *
- */
-package org.apache.qpid.server;
-
-import junit.framework.TestCase;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.management.ManagedBroker;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.client.transport.TransportConnection;
-
-public class AMQBrokerManagerMBeanTest extends TestCase
-{
- private QueueRegistry _queueRegistry;
- private ExchangeRegistry _exchangeRegistry;
-
- public void testExchangeOperations() throws Exception
- {
- String exchange1 = "testExchange1_" + System.currentTimeMillis();
- String exchange2 = "testExchange2_" + System.currentTimeMillis();
- String exchange3 = "testExchange3_" + System.currentTimeMillis();
-
- assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange1)) == null);
- assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange2)) == null);
- assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange3)) == null);
-
- VirtualHost vHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
-
- ManagedBroker mbean = new AMQBrokerManagerMBean((VirtualHost.VirtualHostMBean) vHost.getManagedObject());
- mbean.createNewExchange(exchange1, "direct", false);
- mbean.createNewExchange(exchange2, "topic", false);
- mbean.createNewExchange(exchange3, "headers", false);
-
- assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange1)) != null);
- assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange2)) != null);
- assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange3)) != null);
-
- mbean.unregisterExchange(exchange1);
- mbean.unregisterExchange(exchange2);
- mbean.unregisterExchange(exchange3);
-
- assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange1)) == null);
- assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange2)) == null);
- assertTrue(_exchangeRegistry.getExchange(new AMQShortString(exchange3)) == null);
- }
-
- public void testQueueOperations() throws Exception
- {
- String queueName = "testQueue_" + System.currentTimeMillis();
- VirtualHost vHost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
-
- ManagedBroker mbean = new AMQBrokerManagerMBean((VirtualHost.VirtualHostMBean) vHost.getManagedObject());
-
- assertTrue(_queueRegistry.getQueue(new AMQShortString(queueName)) == null);
-
- mbean.createNewQueue(queueName, "test", false);
- assertTrue(_queueRegistry.getQueue(new AMQShortString(queueName)) != null);
-
- mbean.deleteQueue(queueName);
- assertTrue(_queueRegistry.getQueue(new AMQShortString(queueName)) == null);
- }
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
- _queueRegistry = appRegistry.getVirtualHostRegistry().getVirtualHost("test").getQueueRegistry();
- _exchangeRegistry = appRegistry.getVirtualHostRegistry().getVirtualHost("test").getExchangeRegistry();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java
deleted file mode 100644
index aafddb810a..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java
+++ /dev/null
@@ -1,262 +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.
- *
- */
-package org.apache.qpid.server.ack;
-
-import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.MessageHandleFactory;
-import org.apache.qpid.server.queue.QueueEntry;
-import org.apache.qpid.server.queue.AMQMessageHandle;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.store.TestMemoryMessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.store.MemoryMessageStore;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.server.txn.TransactionalContext;
-
-import java.util.*;
-
-public class TxAckTest extends TestCase
-{
- private Scenario individual;
- private Scenario multiple;
- private Scenario combined;
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- //ack only 5th msg
- individual = new Scenario(10, Arrays.asList(5l), Arrays.asList(1l, 2l, 3l, 4l, 6l, 7l, 8l, 9l, 10l));
- individual.update(5, false);
-
- //ack all up to and including 5th msg
- multiple = new Scenario(10, Arrays.asList(1l, 2l, 3l, 4l, 5l), Arrays.asList(6l, 7l, 8l, 9l, 10l));
- multiple.update(5, true);
-
- //leave only 8th and 9th unacked
- combined = new Scenario(10, Arrays.asList(1l, 2l, 3l, 4l, 5l, 6l, 7l, 10l), Arrays.asList(8l, 9l));
- combined.update(3, false);
- combined.update(5, true);
- combined.update(7, true);
- combined.update(2, true);//should be ignored
- combined.update(1, false);//should be ignored
- combined.update(10, false);
- }
-
- public void testPrepare() throws AMQException
- {
- individual.prepare();
- multiple.prepare();
- combined.prepare();
- }
-
- public void testUndoPrepare() throws AMQException
- {
- individual.undoPrepare();
- multiple.undoPrepare();
- combined.undoPrepare();
- }
-
- public void testCommit() throws AMQException
- {
- individual.commit();
- multiple.commit();
- combined.commit();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TxAckTest.class);
- }
-
- private class Scenario
- {
- private final UnacknowledgedMessageMap _map = new UnacknowledgedMessageMapImpl(5000);
- private final TxAck _op = new TxAck(_map);
- private final List<Long> _acked;
- private final List<Long> _unacked;
- private StoreContext _storeContext = new StoreContext();
-
- Scenario(int messageCount, List<Long> acked, List<Long> unacked) throws Exception
- {
- TransactionalContext txnContext = new NonTransactionalContext(new TestMemoryMessageStore(),
- _storeContext, null,
- new LinkedList<RequiredDeliveryException>()
- );
- AMQQueue queue =
- AMQQueueFactory.createAMQQueueImpl(new AMQShortString("test"), false, null, false, new VirtualHost("test", new MemoryMessageStore()),
- null);
-
- for (int i = 0; i < messageCount; i++)
- {
- long deliveryTag = i + 1;
-
- MessagePublishInfo info = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public void setExchange(AMQShortString exchange)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return null;
- }
- };
-
- TestMessage message = new TestMessage(deliveryTag, i, info, txnContext.getStoreContext());
- _map.add(deliveryTag, queue.enqueue(new StoreContext(), message));
- }
- _acked = acked;
- _unacked = unacked;
- }
-
- void update(long deliverytag, boolean multiple)
- {
- _op.update(deliverytag, multiple);
- }
-
- private void assertCount(List<Long> tags, int expected)
- {
- for (long tag : tags)
- {
- QueueEntry u = _map.get(tag);
- assertTrue("Message not found for tag " + tag, u != null);
- ((TestMessage) u.getMessage()).assertCountEquals(expected);
- }
- }
-
- void prepare() throws AMQException
- {
- _op.consolidate();
- _op.prepare(_storeContext);
-
- assertCount(_acked, -1);
- assertCount(_unacked, 0);
-
- }
-
- void undoPrepare()
- {
- _op.consolidate();
- _op.undoPrepare();
-
- assertCount(_acked, 1);
- assertCount(_unacked, 0);
- }
-
- void commit()
- {
- _op.consolidate();
- _op.commit(_storeContext);
-
- //check acked messages are removed from map
- Set<Long> keys = new HashSet<Long>(_map.getDeliveryTags());
- keys.retainAll(_acked);
- assertTrue("Expected messages with following tags to have been removed from map: " + keys, keys.isEmpty());
- //check unacked messages are still in map
- keys = new HashSet<Long>(_unacked);
- keys.removeAll(_map.getDeliveryTags());
- assertTrue("Expected messages with following tags to still be in map: " + keys, keys.isEmpty());
- }
- }
-
- private static AMQMessageHandle createMessageHandle(final long messageId, final MessagePublishInfo publishBody)
- {
- final AMQMessageHandle amqMessageHandle = (new MessageHandleFactory()).createMessageHandle(messageId,
- null,
- false);
- try
- {
- amqMessageHandle.setPublishAndContentHeaderBody(new StoreContext(),
- publishBody,
- new ContentHeaderBody()
- {
- public int getSize()
- {
- return 1;
- }
- });
- }
- catch (AMQException e)
- {
- // won't happen
- }
-
-
- return amqMessageHandle;
- }
-
-
- private class TestMessage extends AMQMessage
- {
- private final long _tag;
- private int _count;
-
- TestMessage(long tag, long messageId, MessagePublishInfo publishBody, StoreContext storeContext)
- throws AMQException
- {
- super(createMessageHandle(messageId, publishBody), storeContext, publishBody);
- _tag = tag;
- }
-
-
- public boolean incrementReference()
- {
- _count++;
- return true;
- }
-
- public void decrementReference(StoreContext context)
- {
- _count--;
- }
-
- void assertCountEquals(int expected)
- {
- assertEquals("Wrong count for message with tag " + _tag, expected, _count);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java
deleted file mode 100644
index 6dcb187a37..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java
+++ /dev/null
@@ -1,562 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.queue.*;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.SkeletonMessageStore;
-import org.apache.qpid.server.store.MemoryMessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.server.txn.TransactionalContext;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.log4j.Logger;
-
-import java.util.*;
-
-public class AbstractHeadersExchangeTestBase extends TestCase
-{
- private static final Logger _log = Logger.getLogger(AbstractHeadersExchangeTestBase.class);
-
- private final HeadersExchange exchange = new HeadersExchange();
- protected final Set<TestQueue> queues = new HashSet<TestQueue>();
-
- /**
- * Not used in this test, just there to stub out the routing calls
- */
- private MessageStore _store = new MemoryMessageStore();
-
- private StoreContext _storeContext = new StoreContext();
-
- private MessageHandleFactory _handleFactory = new MessageHandleFactory();
-
- private int count;
-
- public void testDoNothing()
- {
- // this is here only to make junit under Eclipse happy
- }
-
- protected TestQueue bindDefault(String... bindings) throws AMQException
- {
- return bind("Queue" + (++count), bindings);
- }
-
- protected TestQueue bind(String queueName, String... bindings) throws AMQException
- {
- return bind(queueName, getHeaders(bindings));
- }
-
- protected TestQueue bind(String queue, FieldTable bindings) throws AMQException
- {
- return bind(new TestQueue(new AMQShortString(queue)), bindings);
- }
-
- protected TestQueue bind(TestQueue queue, String... bindings) throws AMQException
- {
- return bind(queue, getHeaders(bindings));
- }
-
- protected TestQueue bind(TestQueue queue, FieldTable bindings) throws AMQException
- {
- queues.add(queue);
- exchange.registerQueue(null, queue, bindings);
- return queue;
- }
-
-
- protected void route(Message m) throws AMQException
- {
- m.route(exchange);
- m.getIncomingMessage().routingComplete(_store, _handleFactory);
- if(m.getIncomingMessage().allContentReceived())
- {
- m.getIncomingMessage().deliverToQueues();
- }
- }
-
- protected void routeAndTest(Message m, TestQueue... expected) throws AMQException
- {
- routeAndTest(m, false, Arrays.asList(expected));
- }
-
- protected void routeAndTest(Message m, boolean expectReturn, TestQueue... expected) throws AMQException
- {
- routeAndTest(m, expectReturn, Arrays.asList(expected));
- }
-
- protected void routeAndTest(Message m, List<TestQueue> expected) throws AMQException
- {
- routeAndTest(m, false, expected);
- }
-
- protected void routeAndTest(Message m, boolean expectReturn, List<TestQueue> expected) throws AMQException
- {
- try
- {
- route(m);
- assertFalse("Expected "+m+" to be returned due to manadatory flag, and lack of routing",expectReturn);
- for (TestQueue q : queues)
- {
- if (expected.contains(q))
- {
- assertTrue("Expected " + m + " to be delivered to " + q, q.isInQueue(m));
- //assert m.isInQueue(q) : "Expected " + m + " to be delivered to " + q;
- }
- else
- {
- assertFalse("Did not expect " + m + " to be delivered to " + q, q.isInQueue(m));
- //assert !m.isInQueue(q) : "Did not expect " + m + " to be delivered to " + q;
- }
- }
- }
-
- catch (NoRouteException ex)
- {
- assertTrue("Expected "+m+" not to be returned",expectReturn);
- }
-
- }
-
- static FieldTable getHeaders(String... entries)
- {
- FieldTable headers = FieldTableFactory.newFieldTable();
- for (String s : entries)
- {
- String[] parts = s.split("=", 2);
- headers.setObject(parts[0], parts.length > 1 ? parts[1] : "");
- }
- return headers;
- }
-
-
- static final class MessagePublishInfoImpl implements MessagePublishInfo
- {
- private AMQShortString _exchange;
- private boolean _immediate;
- private boolean _mandatory;
- private AMQShortString _routingKey;
-
- public MessagePublishInfoImpl(AMQShortString routingKey)
- {
- _routingKey = routingKey;
- }
-
- public MessagePublishInfoImpl(AMQShortString exchange, boolean immediate, boolean mandatory, AMQShortString routingKey)
- {
- _exchange = exchange;
- _immediate = immediate;
- _mandatory = mandatory;
- _routingKey = routingKey;
- }
-
- public AMQShortString getExchange()
- {
- return _exchange;
- }
-
- public boolean isImmediate()
- {
- return _immediate;
-
- }
-
- public boolean isMandatory()
- {
- return _mandatory;
- }
-
- public AMQShortString getRoutingKey()
- {
- return _routingKey;
- }
-
-
- public void setExchange(AMQShortString exchange)
- {
- _exchange = exchange;
- }
-
- public void setImmediate(boolean immediate)
- {
- _immediate = immediate;
- }
-
- public void setMandatory(boolean mandatory)
- {
- _mandatory = mandatory;
- }
-
- public void setRoutingKey(AMQShortString routingKey)
- {
- _routingKey = routingKey;
- }
- }
-
- static MessagePublishInfo getPublishRequest(final String id)
- {
- return new MessagePublishInfoImpl(null, false, false, new AMQShortString(id));
- }
-
- static ContentHeaderBody getContentHeader(FieldTable headers)
- {
- ContentHeaderBody header = new ContentHeaderBody();
- header.properties = getProperties(headers);
- return header;
- }
-
- static BasicContentHeaderProperties getProperties(FieldTable headers)
- {
- BasicContentHeaderProperties properties = new BasicContentHeaderProperties();
- properties.setHeaders(headers);
- return properties;
- }
-
- static class TestQueue extends SimpleAMQQueue
- {
- final List<HeadersExchangeTest.Message> messages = new ArrayList<HeadersExchangeTest.Message>();
-
- public TestQueue(AMQShortString name) throws AMQException
- {
- super(name, false, new AMQShortString("test"), true, ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test"));
- ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test").getQueueRegistry().registerQueue(this);
- }
-
- /**
- * We override this method so that the default behaviour, which attempts to use a delivery manager, is
- * not invoked. It is unnecessary since for this test we only care to know whether the message was
- * sent to the queue; the queue processing logic is not being tested.
- * @param msg
- * @throws AMQException
- */
- @Override
- public QueueEntry enqueue(StoreContext context, AMQMessage msg) throws AMQException
- {
- messages.add( new HeadersExchangeTest.Message(msg));
- return new QueueEntry()
- {
-
- public AMQQueue getQueue()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public AMQMessage getMessage()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getSize()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean getDeliveredToConsumer()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean expired() throws AMQException
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isAcquired()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean acquire()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean acquire(Subscription sub)
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean delete()
- {
- return false;
- }
-
- public boolean isDeleted()
- {
- return false;
- }
-
- public boolean acquiredBySubscription()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setDeliveredToSubscription()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void release()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public String debugIdentity()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean immediateAndNotDelivered()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setRedelivered(boolean b)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public Subscription getDeliveredSubscription()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void reject()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void reject(Subscription subscription)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isRejectedBy(Subscription subscription)
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void requeue(StoreContext storeContext) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void dequeue(final StoreContext storeContext) throws FailedDequeueException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void dispose(final StoreContext storeContext) throws MessageCleanupException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void restoreCredit()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void discard(StoreContext storeContext) throws FailedDequeueException, MessageCleanupException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isQueueDeleted()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void addStateChangeListener(StateChangeListener listener)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean removeStateChangeListener(StateChangeListener listener)
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int compareTo(final QueueEntry o)
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
- };
- }
-
- boolean isInQueue(Message msg)
- {
- return messages.contains(msg);
- }
-
- }
-
- /**
- * Just add some extra utility methods to AMQMessage to aid testing.
- */
- static class Message extends AMQMessage
- {
- private class TestIncomingMessage extends IncomingMessage
- {
-
- public TestIncomingMessage(final long messageId,
- final MessagePublishInfo info,
- final TransactionalContext txnContext,
- final AMQProtocolSession publisher)
- {
- super(messageId, info, txnContext, publisher);
- }
-
-
- public AMQMessage getUnderlyingMessage()
- {
- return Message.this;
- }
-
-
- public ContentHeaderBody getContentHeaderBody()
- {
- try
- {
- return Message.this.getContentHeaderBody();
- }
- catch (AMQException e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-
- private IncomingMessage _incoming;
-
- private static MessageStore _messageStore = new SkeletonMessageStore();
-
- private static StoreContext _storeContext = new StoreContext();
-
-
- private static TransactionalContext _txnContext = new NonTransactionalContext(_messageStore, _storeContext,
- null,
- new LinkedList<RequiredDeliveryException>()
- );
-
- Message(String id, String... headers) throws AMQException
- {
- this(id, getHeaders(headers));
- }
-
- Message(String id, FieldTable headers) throws AMQException
- {
- this(_messageStore.getNewMessageId(),getPublishRequest(id), getContentHeader(headers), null);
- }
-
- public IncomingMessage getIncomingMessage()
- {
- return _incoming;
- }
-
- private Message(long messageId,
- MessagePublishInfo publish,
- ContentHeaderBody header,
- List<ContentBody> bodies) throws AMQException
- {
- super(createMessageHandle(messageId, publish, header), _txnContext.getStoreContext(), publish);
-
-
-
- _incoming = new TestIncomingMessage(getMessageId(),publish,_txnContext,new MockProtocolSession(_messageStore));
- _incoming.setContentHeaderBody(header);
-
-
- }
-
- private static AMQMessageHandle createMessageHandle(final long messageId,
- final MessagePublishInfo publish,
- final ContentHeaderBody header)
- {
-
- final AMQMessageHandle amqMessageHandle = (new MessageHandleFactory()).createMessageHandle(messageId,
- _messageStore,
- true);
-
- try
- {
- amqMessageHandle.setPublishAndContentHeaderBody(new StoreContext(),publish,header);
- }
- catch (AMQException e)
- {
-
- }
- return amqMessageHandle;
- }
-
- private Message(AMQMessage msg) throws AMQException
- {
- super(msg);
- }
-
-
-
- void route(Exchange exchange) throws AMQException
- {
- exchange.route(_incoming);
- }
-
-
- public int hashCode()
- {
- return getKey().hashCode();
- }
-
- public boolean equals(Object o)
- {
- return o instanceof HeadersExchangeTest.Message && equals((HeadersExchangeTest.Message) o);
- }
-
- private boolean equals(HeadersExchangeTest.Message m)
- {
- return getKey().equals(m.getKey());
- }
-
- public String toString()
- {
- return getKey().toString();
- }
-
- private Object getKey()
- {
- try
- {
- return getMessagePublishInfo().getRoutingKey();
- }
- catch (AMQException e)
- {
- _log.error("Error getting routing key: " + e, e);
- return null;
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java
deleted file mode 100644
index fd11ddeae2..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java
+++ /dev/null
@@ -1,106 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.util.NullApplicationRegistry;
-import org.apache.qpid.framing.BasicPublishBody;
-
-public class HeadersExchangeTest extends AbstractHeadersExchangeTestBase
-{
- protected void setUp() throws Exception
- {
- super.setUp();
- ApplicationRegistry.initialise(new NullApplicationRegistry(), 1);
- }
-
- protected void tearDown()
- {
- ApplicationRegistry.remove(1);
- }
-
- public void testSimple() throws AMQException
- {
- TestQueue q1 = bindDefault("F0000");
- TestQueue q2 = bindDefault("F0000=Aardvark");
- TestQueue q3 = bindDefault("F0001");
- TestQueue q4 = bindDefault("F0001=Bear");
- TestQueue q5 = bindDefault("F0000", "F0001");
- TestQueue q6 = bindDefault("F0000=Aardvark", "F0001=Bear");
- TestQueue q7 = bindDefault("F0000", "F0001=Bear");
- TestQueue q8 = bindDefault("F0000=Aardvark", "F0001");
-
- routeAndTest(new Message("Message1", "F0000"), q1);
- routeAndTest(new Message("Message2", "F0000=Aardvark"), q1, q2);
- routeAndTest(new Message("Message3", "F0000=Aardvark", "F0001"), q1, q2, q3, q5, q8);
- routeAndTest(new Message("Message4", "F0000", "F0001=Bear"), q1, q3, q4, q5, q7);
- routeAndTest(new Message("Message5", "F0000=Aardvark", "F0001=Bear"),
- q1, q2, q3, q4, q5, q6, q7, q8);
- routeAndTest(new Message("Message6", "F0002"));
-
- Message m7 = new Message("Message7", "XXXXX");
-
- MessagePublishInfoImpl pb7 = (MessagePublishInfoImpl) (m7.getMessagePublishInfo());
- pb7.setMandatory(true);
- routeAndTest(m7,true);
-
- Message m8 = new Message("Message8", "F0000");
- MessagePublishInfoImpl pb8 = (MessagePublishInfoImpl)(m8.getMessagePublishInfo());
- pb8.setMandatory(true);
- routeAndTest(m8,false,q1);
-
-
- }
-
- public void testAny() throws AMQException
- {
- TestQueue q1 = bindDefault("F0000", "F0001", "X-match=any");
- TestQueue q2 = bindDefault("F0000=Aardvark", "F0001=Bear", "X-match=any");
- TestQueue q3 = bindDefault("F0000", "F0001=Bear", "X-match=any");
- TestQueue q4 = bindDefault("F0000=Aardvark", "F0001", "X-match=any");
- TestQueue q6 = bindDefault("F0000=Apple", "F0001", "X-match=any");
-
- routeAndTest(new Message("Message1", "F0000"), q1, q3);
- routeAndTest(new Message("Message2", "F0000=Aardvark"), q1, q2, q3, q4);
- routeAndTest(new Message("Message3", "F0000=Aardvark", "F0001"), q1, q2, q3, q4, q6);
- routeAndTest(new Message("Message4", "F0000", "F0001=Bear"), q1, q2, q3, q4, q6);
- routeAndTest(new Message("Message5", "F0000=Aardvark", "F0001=Bear"), q1, q2, q3, q4, q6);
- routeAndTest(new Message("Message6", "F0002"));
- }
-
- public void testMandatory() throws AMQException
- {
- bindDefault("F0000");
- Message m1 = new Message("Message1", "XXXXX");
- Message m2 = new Message("Message2", "F0000");
- MessagePublishInfoImpl pb1 = (MessagePublishInfoImpl) (m1.getMessagePublishInfo());
- pb1.setMandatory(true);
- MessagePublishInfoImpl pb2 = (MessagePublishInfoImpl) (m2.getMessagePublishInfo());
- pb2.setMandatory(true);
- routeAndTest(m1,true);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(HeadersExchangeTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/MessagingTestConfigProperties.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/MessagingTestConfigProperties.java
deleted file mode 100644
index 2d89d319d7..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/MessagingTestConfigProperties.java
+++ /dev/null
@@ -1,308 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-/**
- * MessagingTestConfigProperties defines a set of property names and default values for specifying a messaging topology,
- * and test parameters for running a messaging test over that topology. A Properties object holding some of these
- * properties, superimposed onto the defaults, is used to establish test topologies and control test behaviour.
- *
- * <p/>A complete list of the parameters, default values and comments on their usage is provided here:
- *
- * <p/><table><caption>Parameters</caption>
- * <tr><th> Parameter <th> Default <th> Comments
- * <tr><td> messageSize <td> 0 <td> Message size in bytes. Not including any headers.
- * <tr><td> destinationName <td> ping <td> The root name to use to generate destination names to ping.
- * <tr><td> persistent <td> false <td> Determines whether peristent delivery is used.
- * <tr><td> transacted <td> false <td> Determines whether messages are sent/received in transactions.
- * <tr><td> broker <td> tcp://localhost:5672 <td> Determines the broker to connect to.
- * <tr><td> virtualHost <td> test <td> Determines the virtual host to send all ping over.
- * <tr><td> rate <td> 0 <td> The maximum rate (in hertz) to send messages at. 0 means no limit.
- * <tr><td> verbose <td> false <td> The verbose flag for debugging. Prints to console on every message.
- * <tr><td> pubsub <td> false <td> Whether to ping topics or queues. Uses p2p by default.
- * <tr><td> username <td> guest <td> The username to access the broker with.
- * <tr><td> password <td> guest <td> The password to access the broker with.
- * <tr><td> selector <td> null <td> Not used. Defines a message selector to filter pings with.
- * <tr><td> destinationCount <td> 1 <td> The number of receivers listening to the pings.
- * <tr><td> timeout <td> 30000 <td> In milliseconds. The timeout to stop waiting for replies.
- * <tr><td> commitBatchSize <td> 1 <td> The number of messages per transaction in transactional mode.
- * <tr><td> uniqueDests <td> true <td> Whether each receiver only listens to one ping destination or all.
- * <tr><td> durableDests <td> false <td> Whether or not durable destinations are used.
- * <tr><td> ackMode <td> AUTO_ACK <td> The message acknowledgement mode. Possible values are:
- * 0 - SESSION_TRANSACTED
- * 1 - AUTO_ACKNOWLEDGE
- * 2 - CLIENT_ACKNOWLEDGE
- * 3 - DUPS_OK_ACKNOWLEDGE
- * 257 - NO_ACKNOWLEDGE
- * 258 - PRE_ACKNOWLEDGE
- * <tr><td> maxPending <td> 0 <td> The maximum size in bytes, of messages sent but not yet received.
- * Limits the volume of messages currently buffered on the client
- * or broker. Can help scale test clients by limiting amount of buffered
- * data to avoid out of memory errors.
- * </table>
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide the names and defaults of all test parameters.
- * </table>
- */
-public class MessagingTestConfigProperties
-{
- // ====================== Connection Properties ==================================
-
- /** Holds the name of the default connection configuration. */
- public static final String CONNECTION_NAME = "broker";
-
- /** Holds the name of the property to get the initial context factory name from. */
- public static final String INITIAL_CONTEXT_FACTORY_PROPNAME = "java.naming.factory.initial";
-
- /** Defines the class to use as the initial context factory by default. */
- public static final String INITIAL_CONTEXT_FACTORY_DEFAULT = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
-
- /** Holds the name of the default connection factory configuration property. */
- public static final String CONNECTION_PROPNAME = "connectionfactory.broker";
-
- /** Defeins the default connection configuration. */
- public static final String CONNECTION_DEFAULT = "amqp://guest:guest@clientid/?brokerlist='vm://:1'";
-
- /** Holds the name of the property to get the test broker url from. */
- public static final String BROKER_PROPNAME = "qpid.test.broker";
-
- /** Holds the default broker url for the test. */
- public static final String BROKER_DEFAULT = "vm://:1";
-
- /** Holds the name of the property to get the test broker virtual path. */
- public static final String VIRTUAL_HOST_PROPNAME = "virtualHost";
-
- /** Holds the default virtual path for the test. */
- public static final String VIRTUAL_HOST_DEFAULT = "";
-
- /** Holds the name of the property to get the broker access username from. */
- public static final String USERNAME_PROPNAME = "username";
-
- /** Holds the default broker log on username. */
- public static final String USERNAME_DEFAULT = "guest";
-
- /** Holds the name of the property to get the broker access password from. */
- public static final String PASSWORD_PROPNAME = "password";
-
- /** Holds the default broker log on password. */
- public static final String PASSWORD_DEFAULT = "guest";
-
- // ====================== Messaging Topology Properties ==========================
-
- /** Holds the name of the property to get the bind publisher procuder flag from. */
- public static final String PUBLISHER_PRODUCER_BIND_PROPNAME = "publisherProducerBind";
-
- /** Holds the default value of the publisher producer flag. */
- public static final boolean PUBLISHER_PRODUCER_BIND_DEFAULT = true;
-
- /** Holds the name of the property to get the bind publisher procuder flag from. */
- public static final String PUBLISHER_CONSUMER_BIND_PROPNAME = "publisherConsumerBind";
-
- /** Holds the default value of the publisher consumer flag. */
- public static final boolean PUBLISHER_CONSUMER_BIND_DEFAULT = false;
-
- /** Holds the name of the property to get the bind receiver procuder flag from. */
- public static final String RECEIVER_PRODUCER_BIND_PROPNAME = "receiverProducerBind";
-
- /** Holds the default value of the receiver producer flag. */
- public static final boolean RECEIVER_PRODUCER_BIND_DEFAULT = false;
-
- /** Holds the name of the property to get the bind receiver procuder flag from. */
- public static final String RECEIVER_CONSUMER_BIND_PROPNAME = "receiverConsumerBind";
-
- /** Holds the default value of the receiver consumer flag. */
- public static final boolean RECEIVER_CONSUMER_BIND_DEFAULT = true;
-
- /** Holds the name of the property to get the destination name root from. */
- public static final String SEND_DESTINATION_NAME_ROOT_PROPNAME = "sendDestinationRoot";
-
- /** Holds the root of the name of the default destination to send to. */
- public static final String SEND_DESTINATION_NAME_ROOT_DEFAULT = "sendTo";
-
- /** Holds the name of the property to get the destination name root from. */
- public static final String RECEIVE_DESTINATION_NAME_ROOT_PROPNAME = "receiveDestinationRoot";
-
- /** Holds the root of the name of the default destination to send to. */
- public static final String RECEIVE_DESTINATION_NAME_ROOT_DEFAULT = "receiveFrom";
-
- /** Holds the name of the proeprty to get the destination count from. */
- public static final String DESTINATION_COUNT_PROPNAME = "destinationCount";
-
- /** Defines the default number of destinations to ping. */
- public static final int DESTINATION_COUNT_DEFAULT = 1;
-
- /** Holds the name of the property to get the p2p or pub/sub messaging mode from. */
- public static final String PUBSUB_PROPNAME = "pubsub";
-
- /** Holds the pub/sub mode default, true means ping a topic, false means ping a queue. */
- public static final boolean PUBSUB_DEFAULT = false;
-
- // ====================== JMS Options and Flags =================================
-
- /** Holds the name of the property to get the test delivery mode from. */
- public static final String PERSISTENT_MODE_PROPNAME = "persistent";
-
- /** Holds the message delivery mode to use for the test. */
- public static final boolean PERSISTENT_MODE_DEFAULT = false;
-
- /** Holds the name of the property to get the test transactional mode from. */
- public static final String TRANSACTED_PROPNAME = "transacted";
-
- /** Holds the transactional mode to use for the test. */
- public static final boolean TRANSACTED_DEFAULT = false;
-
- /** Holds the name of the property to set the no local flag from. */
- public static final String NO_LOCAL_PROPNAME = "noLocal";
-
- /** Defines the default value of the no local flag to use when consuming messages. */
- public static final boolean NO_LOCAL_DEFAULT = false;
-
- /** Holds the name of the property to get the message acknowledgement mode from. */
- public static final String ACK_MODE_PROPNAME = "ackMode";
-
- /** Defines the default message acknowledgement mode. */
- public static final int ACK_MODE_DEFAULT = Session.AUTO_ACKNOWLEDGE;
-
- /** Holds the name of the property to get the durable subscriptions flag from, when doing pub/sub messaging. */
- public static final String DURABLE_SUBSCRIPTION_PROPNAME = "durableSubscription";
-
- /** Defines the default value of the durable subscriptions flag. */
- public static final boolean DURABLE_SUBSCRIPTION_DEFAULT = false;
-
- // ====================== Qpid Options and Flags ================================
-
- /** Holds the name of the property to set the exclusive flag from. */
- public static final String EXCLUSIVE_PROPNAME = "exclusive";
-
- /** Defines the default value of the exclusive flag to use when consuming messages. */
- public static final boolean EXCLUSIVE_DEFAULT = false;
-
- /** Holds the name of the property to set the immediate flag from. */
- public static final String IMMEDIATE_PROPNAME = "immediate";
-
- /** Defines the default value of the immediate flag to use when sending messages. */
- public static final boolean IMMEDIATE_DEFAULT = false;
-
- /** Holds the name of the property to set the mandatory flag from. */
- public static final String MANDATORY_PROPNAME = "mandatory";
-
- /** Defines the default value of the mandatory flag to use when sending messages. */
- public static final boolean MANDATORY_DEFAULT = false;
-
- /** Holds the name of the property to get the durable destinations flag from. */
- public static final String DURABLE_DESTS_PROPNAME = "durableDests";
-
- /** Default value for the durable destinations flag. */
- public static final boolean DURABLE_DESTS_DEFAULT = false;
-
- /** Holds the name of the proeprty to set the prefetch size from. */
- public static final String PREFECTH_PROPNAME = "prefetch";
-
- /** Defines the default prefetch size to use when consuming messages. */
- public static final int PREFETCH_DEFAULT = 100;
-
- // ====================== Common Test Parameters ================================
-
- /** Holds the name of the property to get the test message size from. */
- public static final String MESSAGE_SIZE_PROPNAME = "messageSize";
-
- /** Used to set up a default message size. */
- public static final int MESSAGE_SIZE_DEAFULT = 0;
-
- /** Holds the name of the property to get the message rate from. */
- public static final String RATE_PROPNAME = "rate";
-
- /** Defines the default rate (in pings per second) to send pings at. 0 means as fast as possible, no restriction. */
- public static final int RATE_DEFAULT = 0;
-
- /** Holds the name of the proeprty to get the. */
- public static final String SELECTOR_PROPNAME = "selector";
-
- /** Holds the default message selector. */
- public static final String SELECTOR_DEFAULT = "";
-
- /** Holds the name of the property to get the waiting timeout for response messages. */
- public static final String TIMEOUT_PROPNAME = "timeout";
-
- /** Default time to wait before assuming that a ping has timed out. */
- public static final long TIMEOUT_DEFAULT = 30000;
-
- /** Holds the name of the property to get the commit batch size from. */
- public static final String TX_BATCH_SIZE_PROPNAME = "commitBatchSize";
-
- /** Defines the default number of pings to send in each transaction when running transactionally. */
- public static final int TX_BATCH_SIZE_DEFAULT = 1;
-
- /** Holds the name of the property to set the maximum amount of pending message data for a producer to hold. */
- public static final String MAX_PENDING_PROPNAME = "maxPending";
-
- /** Defines the default maximum quantity of pending message data to allow producers to hold. */
- public static final int MAX_PENDING_DEFAULT = 0;
-
- /** Holds the name of the property to get the verbose mode proeprty from. */
- public static final String VERBOSE_PROPNAME = "verbose";
-
- /** Holds the default verbose mode. */
- public static final boolean VERBOSE_DEFAULT = false;
-
- /** Holds the default configuration properties. */
- public static ParsedProperties defaults = new ParsedProperties();
-
- static
- {
- defaults.setPropertyIfNull(INITIAL_CONTEXT_FACTORY_PROPNAME, INITIAL_CONTEXT_FACTORY_DEFAULT);
- defaults.setPropertyIfNull(CONNECTION_PROPNAME, CONNECTION_DEFAULT);
- defaults.setPropertyIfNull(MESSAGE_SIZE_PROPNAME, MESSAGE_SIZE_DEAFULT);
- defaults.setPropertyIfNull(PUBLISHER_PRODUCER_BIND_PROPNAME, PUBLISHER_PRODUCER_BIND_DEFAULT);
- defaults.setPropertyIfNull(PUBLISHER_CONSUMER_BIND_PROPNAME, PUBLISHER_CONSUMER_BIND_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_PRODUCER_BIND_PROPNAME, RECEIVER_PRODUCER_BIND_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_CONSUMER_BIND_PROPNAME, RECEIVER_CONSUMER_BIND_DEFAULT);
- defaults.setPropertyIfNull(SEND_DESTINATION_NAME_ROOT_PROPNAME, SEND_DESTINATION_NAME_ROOT_DEFAULT);
- defaults.setPropertyIfNull(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME, RECEIVE_DESTINATION_NAME_ROOT_DEFAULT);
- defaults.setPropertyIfNull(PERSISTENT_MODE_PROPNAME, PERSISTENT_MODE_DEFAULT);
- defaults.setPropertyIfNull(TRANSACTED_PROPNAME, TRANSACTED_DEFAULT);
- defaults.setPropertyIfNull(BROKER_PROPNAME, BROKER_DEFAULT);
- defaults.setPropertyIfNull(VIRTUAL_HOST_PROPNAME, VIRTUAL_HOST_DEFAULT);
- defaults.setPropertyIfNull(RATE_PROPNAME, RATE_DEFAULT);
- defaults.setPropertyIfNull(VERBOSE_PROPNAME, VERBOSE_DEFAULT);
- defaults.setPropertyIfNull(PUBSUB_PROPNAME, PUBSUB_DEFAULT);
- defaults.setPropertyIfNull(USERNAME_PROPNAME, USERNAME_DEFAULT);
- defaults.setPropertyIfNull(PASSWORD_PROPNAME, PASSWORD_DEFAULT);
- defaults.setPropertyIfNull(SELECTOR_PROPNAME, SELECTOR_DEFAULT);
- defaults.setPropertyIfNull(DESTINATION_COUNT_PROPNAME, DESTINATION_COUNT_DEFAULT);
- defaults.setPropertyIfNull(TIMEOUT_PROPNAME, TIMEOUT_DEFAULT);
- defaults.setPropertyIfNull(TX_BATCH_SIZE_PROPNAME, TX_BATCH_SIZE_DEFAULT);
- defaults.setPropertyIfNull(DURABLE_DESTS_PROPNAME, DURABLE_DESTS_DEFAULT);
- defaults.setPropertyIfNull(ACK_MODE_PROPNAME, ACK_MODE_DEFAULT);
- defaults.setPropertyIfNull(DURABLE_SUBSCRIPTION_PROPNAME, DURABLE_SUBSCRIPTION_DEFAULT);
- defaults.setPropertyIfNull(MAX_PENDING_PROPNAME, MAX_PENDING_DEFAULT);
- defaults.setPropertyIfNull(PREFECTH_PROPNAME, PREFETCH_DEFAULT);
- defaults.setPropertyIfNull(NO_LOCAL_PROPNAME, NO_LOCAL_DEFAULT);
- defaults.setPropertyIfNull(EXCLUSIVE_PROPNAME, EXCLUSIVE_DEFAULT);
- defaults.setPropertyIfNull(IMMEDIATE_PROPNAME, IMMEDIATE_DEFAULT);
- defaults.setPropertyIfNull(MANDATORY_PROPNAME, MANDATORY_DEFAULT);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java
deleted file mode 100644
index 74d3c5f1cb..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java
+++ /dev/null
@@ -1,320 +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.
- *
- */
-
-package org.apache.qpid.server.exchange;
-
-import junit.framework.TestCase;
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.util.NullApplicationRegistry;
-import org.apache.qpid.client.*;
-import org.apache.qpid.client.configuration.ClientProperties;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.qpid.url.BindingURL;
-import org.apache.qpid.url.URLSyntaxException;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.AMQException;
-
-import javax.jms.*;
-import java.util.List;
-import java.util.Collections;
-import java.util.ArrayList;
-import java.net.URISyntaxException;
-
-public class ReturnUnroutableMandatoryMessageTest extends TestCase implements ExceptionListener
-{
- private static final Logger _logger = Logger.getLogger(ReturnUnroutableMandatoryMessageTest.class);
-
- private final List<Message> _bouncedMessageList = Collections.synchronizedList(new ArrayList<Message>());
- private static final String VIRTUALHOST = "test";
- private static final String BROKER = "vm://:1";
-
- static
- {
- String workdir = System.getProperty("QPID_WORK");
- if (workdir == null || workdir.equals(""))
- {
- String tempdir = System.getProperty("java.io.tmpdir");
- System.out.println("QPID_WORK not set using tmp directory: " + tempdir);
- System.setProperty("QPID_WORK", tempdir);
- }
-// DOMConfigurator.configure("../broker/etc/log4j.xml");
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- ApplicationRegistry.initialise(new NullApplicationRegistry(), 1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- ApplicationRegistry.remove(1);
- }
-
- /**
- * Tests that mandatory message which are not routable are returned to the producer
- *
- * @throws Exception
- */
- public void testReturnUnroutableMandatoryMessage_HEADERS() throws URISyntaxException, AMQException, JMSException
- {
- _bouncedMessageList.clear();
- MessageConsumer consumer = null;
- AMQSession producerSession = null;
- AMQHeadersExchange queue = null;
- Connection con=null, con2 = null;
- try
- {
- con = new AMQConnection(BROKER, "guest", "guest", "consumer1", VIRTUALHOST);
-
- AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- queue = new AMQHeadersExchange(new AMQBindingURL(ExchangeDefaults.HEADERS_EXCHANGE_CLASS + "://" + ExchangeDefaults.HEADERS_EXCHANGE_NAME + "/test/queue1?" + BindingURL.OPTION_ROUTING_KEY + "='F0000=1'"));
- FieldTable ft = new FieldTable();
- ft.setString("F1000", "1");
- consumer = consumerSession.createConsumer(queue, Integer.parseInt(ClientProperties.MAX_PREFETCH_DEFAULT), Integer.parseInt(ClientProperties.MAX_PREFETCH_DEFAULT) /2 , false, false, (String) null, ft);
-
- //force synch to ensure the consumer has resulted in a bound queue
- //((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.HEADERS_EXCHANGE_NAME, ExchangeDefaults.HEADERS_EXCHANGE_CLASS);
- // This is the default now
-
- con2 = new AMQConnection(BROKER, "guest", "guest", "producer1", VIRTUALHOST);
-
- con2.setExceptionListener(this);
- producerSession = (AMQSession) con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- // Need to start the "producer" connection in order to receive bounced messages
- _logger.info("Starting producer connection");
- con2.start();
- }
- catch (JMSException jmse)
- {
- fail(jmse.getMessage());
- }
-
- try
- {
- MessageProducer nonMandatoryProducer = producerSession.createProducer(queue, false, false);
- MessageProducer mandatoryProducer = producerSession.createProducer(queue);
-
- // First test - should neither be bounced nor routed
- _logger.info("Sending non-routable non-mandatory message");
- TextMessage msg1 = producerSession.createTextMessage("msg1");
- nonMandatoryProducer.send(msg1);
-
- // Second test - should be bounced
- _logger.info("Sending non-routable mandatory message");
- TextMessage msg2 = producerSession.createTextMessage("msg2");
- mandatoryProducer.send(msg2);
-
- // Third test - should be routed
- _logger.info("Sending routable message");
- TextMessage msg3 = producerSession.createTextMessage("msg3");
- msg3.setStringProperty("F1000", "1");
- mandatoryProducer.send(msg3);
-
- _logger.info("Starting consumer connection");
- con.start();
- TextMessage tm = (TextMessage) consumer.receive(1000L);
-
- assertTrue("No message routed to receiver", tm != null);
- assertTrue("Wrong message routed to receiver: " + tm.getText(), "msg3".equals(tm.getText()));
-
- try
- {
- Thread.sleep(1000L);
- }
- catch (InterruptedException e)
- {
- ;
- }
-
- assertTrue("Wrong number of messages bounced (expect 1): " + _bouncedMessageList.size(), _bouncedMessageList.size() == 1);
- Message m = _bouncedMessageList.get(0);
- assertTrue("Wrong message bounced: " + m.toString(), m.toString().contains("msg2"));
- }
- catch (JMSException jmse)
- {
-
- }
- con.close();
- con2.close();
-
- }
-
- public void testReturnUnroutableMandatoryMessage_QUEUE() throws Exception
- {
- _bouncedMessageList.clear();
- Connection con = new AMQConnection(BROKER, "guest", "guest", "consumer1", VIRTUALHOST);
-
- AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- AMQQueue valid_queue = new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, "testReturnUnroutableMandatoryMessage_QUEUE");
- AMQQueue invalid_queue = new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, "testReturnUnroutableMandatoryMessage_QUEUE_INVALID");
- MessageConsumer consumer = consumerSession.createConsumer(valid_queue);
-
- //force synch to ensure the consumer has resulted in a bound queue
- //((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.HEADERS_EXCHANGE_NAME, ExchangeDefaults.HEADERS_EXCHANGE_CLASS);
- // This is the default now
-
- Connection con2 = new AMQConnection(BROKER, "guest", "guest", "producer1", VIRTUALHOST);
-
- con2.setExceptionListener(this);
- AMQSession producerSession = (AMQSession) con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- // Need to start the "producer" connection in order to receive bounced messages
- _logger.info("Starting producer connection");
- con2.start();
-
- MessageProducer nonMandatoryProducer = producerSession.createProducer(valid_queue, false, false);
- MessageProducer mandatoryProducer = producerSession.createProducer(invalid_queue);
-
- // First test - should be routed
- _logger.info("Sending non-mandatory message");
- TextMessage msg1 = producerSession.createTextMessage("msg1");
- nonMandatoryProducer.send(msg1);
-
- // Second test - should be bounced
- _logger.info("Sending non-routable mandatory message");
- TextMessage msg2 = producerSession.createTextMessage("msg2");
- mandatoryProducer.send(msg2);
-
- _logger.info("Starting consumer connection");
- con.start();
- TextMessage tm = (TextMessage) consumer.receive(1000L);
-
- assertTrue("No message routed to receiver", tm != null);
- assertTrue("Wrong message routed to receiver: " + tm.getText(), "msg1".equals(tm.getText()));
-
- try
- {
- Thread.sleep(1000L);
- }
- catch (InterruptedException e)
- {
- ;
- }
-
- assertTrue("Wrong number of messages bounced (expect 1): " + _bouncedMessageList.size(), _bouncedMessageList.size() == 1);
- Message m = _bouncedMessageList.get(0);
- assertTrue("Wrong message bounced: " + m.toString(), m.toString().contains("msg2"));
-
- con.close();
- con2.close();
- }
-
- public void testReturnUnroutableMandatoryMessage_TOPIC() throws Exception
- {
- _bouncedMessageList.clear();
- Connection con = new AMQConnection(BROKER, "guest", "guest", "consumer1", VIRTUALHOST);
-
- AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- AMQTopic valid_topic = new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_CLASS, "test.Return.Unroutable.Mandatory.Message.TOPIC");
- AMQTopic invalid_topic = new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_CLASS, "test.Return.Unroutable.Mandatory.Message.TOPIC.invalid");
- MessageConsumer consumer = consumerSession.createConsumer(valid_topic);
-
- //force synch to ensure the consumer has resulted in a bound queue
- //((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.HEADERS_EXCHANGE_NAME, ExchangeDefaults.HEADERS_EXCHANGE_CLASS);
- // This is the default now
-
- Connection con2 = new AMQConnection(BROKER, "guest", "guest", "producer1", VIRTUALHOST);
-
- con2.setExceptionListener(this);
- AMQSession producerSession = (AMQSession) con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- // Need to start the "producer" connection in order to receive bounced messages
- _logger.info("Starting producer connection");
- con2.start();
-
- MessageProducer nonMandatoryProducer = producerSession.createProducer(valid_topic, false, false);
- MessageProducer mandatoryProducer = producerSession.createProducer(invalid_topic);
-
- // First test - should be routed
- _logger.info("Sending non-mandatory message");
- TextMessage msg1 = producerSession.createTextMessage("msg1");
- nonMandatoryProducer.send(msg1);
-
- // Second test - should be bounced
- _logger.info("Sending non-routable mandatory message");
- TextMessage msg2 = producerSession.createTextMessage("msg2");
- mandatoryProducer.send(msg2);
-
- _logger.info("Starting consumer connection");
- con.start();
- TextMessage tm = (TextMessage) consumer.receive(1000L);
-
- assertTrue("No message routed to receiver", tm != null);
- assertTrue("Wrong message routed to receiver: " + tm.getText(), "msg1".equals(tm.getText()));
-
- try
- {
- Thread.sleep(1000L);
- }
- catch (InterruptedException e)
- {
- ;
- }
-
- assertEquals("Wrong number of messages bounced: ", 1, _bouncedMessageList.size());
- Message m = _bouncedMessageList.get(0);
- assertTrue("Wrong message bounced: " + m.toString(), m.toString().contains("msg2"));
-
- con.close();
- con2.close();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(ReturnUnroutableMandatoryMessageTest.class);
- }
-
- public void onException(JMSException jmsException)
- {
-
- Exception linkedException = null;
- try
- {
- linkedException = jmsException.getLinkedException();
- }
- catch (Exception e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- if (linkedException instanceof AMQNoRouteException)
- {
- AMQNoRouteException noRoute = (AMQNoRouteException) linkedException;
- Message bounced = (Message) noRoute.getUndeliveredMessage();
- _bouncedMessageList.add(bounced);
- _logger.info("Caught expected NoRouteException");
- }
- else
- {
- _logger.warn("Caught exception on producer: ", jmsException);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java
deleted file mode 100644
index 14c7f26fad..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java
+++ /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.
- *
- */
-package org.apache.qpid.server.failover;
-
-import junit.framework.TestCase;
-import org.apache.qpid.AMQDisconnectedException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQConnectionURL;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException;
-import org.apache.qpid.url.URLSyntaxException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import java.util.concurrent.CountDownLatch;
-
-public class FailoverMethodTest extends TestCase implements ExceptionListener
-{
- private CountDownLatch _failoverComplete = new CountDownLatch(1);
-
- public void setUp() throws AMQVMBrokerCreationException
- {
- TransportConnection.createVMBroker(1);
- }
-
- public void tearDown() throws AMQVMBrokerCreationException
- {
- TransportConnection.killAllVMBrokers();
- }
-
- /**
- * Test that the round robin method has the correct delays.
- * The first connection to vm://:1 will work but the localhost connection should fail but the duration it takes
- * to report the failure is what is being tested.
- *
- * @throws URLSyntaxException
- * @throws InterruptedException
- * @throws JMSException
- */
- public void testFailoverRoundRobinDelay() throws URLSyntaxException, InterruptedException, JMSException
- {
- //note: The VM broker has no connect delay and the default 1 retry
- // while the tcp:localhost broker has 3 retries with a 2s connect delay
- String connectionString = "amqp://guest:guest@/test?brokerlist=" +
- "'vm://:1;tcp://localhost:5670?connectdelay='2000',retries='3''";
-
- AMQConnectionURL url = new AMQConnectionURL(connectionString);
-
- try
- {
- long start = System.currentTimeMillis();
- AMQConnection connection = new AMQConnection(url, null);
-
- connection.setExceptionListener(this);
-
- TransportConnection.killAllVMBrokers();
-
- _failoverComplete.await();
-
- long end = System.currentTimeMillis();
-
- long duration = (end - start);
-
- //Failover should take more that 6 seconds.
- // 3 Retires
- // so VM Broker NoDelay 0 (Connect) NoDelay 0
- // then TCP NoDelay 0 Delay 1 Delay 2 Delay 3
- // so 3 delays of 2s in total for connection
- // as this is a tcp connection it will take 1second per connection to fail
- // so max time is 6seconds of delay plus 4 seconds of TCP Delay + 1 second of runtime. == 11 seconds
-
- // Ensure we actually had the delay
- assertTrue("Failover took less than 6 seconds", duration > 6000);
-
- // Ensure we don't have delays before initial connection and reconnection.
- // We allow 1 second for initial connection and failover logic on top of 6s of sleep.
- assertTrue("Failover took more than 11 seconds:(" + duration + ")", duration < 11000);
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
- }
-
- public void testFailoverSingleDelay() throws URLSyntaxException, AMQVMBrokerCreationException,
- InterruptedException, JMSException
- {
- String connectionString = "amqp://guest:guest@/test?brokerlist='vm://:1?connectdelay='2000',retries='3''";
-
- AMQConnectionURL url = new AMQConnectionURL(connectionString);
-
- try
- {
- long start = System.currentTimeMillis();
- AMQConnection connection = new AMQConnection(url, null);
-
- connection.setExceptionListener(this);
-
- TransportConnection.killAllVMBrokers();
-
- _failoverComplete.await();
-
- long end = System.currentTimeMillis();
-
- long duration = (end - start);
-
- //Failover should take more that 6 seconds.
- // 3 Retires
- // so NoDelay 0 (Connect) NoDelay 0 Delay 1 Delay 2 Delay 3
- // so 3 delays of 2s in total for connection
- // so max time is 6 seconds of delay + 1 second of runtime. == 7 seconds
-
- // Ensure we actually had the delay
- assertTrue("Failover took less than 6 seconds", duration > 6000);
-
- // Ensure we don't have delays before initial connection and reconnection.
- // We allow 1 second for initial connection and failover logic on top of 6s of sleep.
- assertTrue("Failover took more than 7 seconds:(" + duration + ")", duration < 7000);
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
- }
-
- public void onException(JMSException e)
- {
- if (e.getLinkedException() instanceof AMQDisconnectedException)
- {
- _failoverComplete.countDown();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java
deleted file mode 100644
index 22a1b119fa..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java
+++ /dev/null
@@ -1,236 +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.
- *
- */
-
-package org.apache.qpid.server.failure;
-
-import junit.framework.TestCase;
-import org.apache.qpid.test.utils.QpidClientConnectionHelper;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.log4j.Logger;
-
-import javax.jms.JMSException;
-import javax.jms.DeliveryMode;
-import java.io.IOException;
-
-
-/** Test Case provided by client Non-functional Test NF101: heap exhaustion behaviour */
-public class HeapExhaustion extends TestCase
-{
- private static final Logger _logger = Logger.getLogger(HeapExhaustion.class);
-
- protected QpidClientConnectionHelper conn;
- protected final String BROKER = "localhost";
- protected final String vhost = "/test";
- protected final String queue = "direct://amq.direct//queue";
-
- protected String hundredK;
- protected String megabyte;
-
- protected String generatePayloadOfSize(Integer numBytes)
- {
- return new String(new byte[numBytes]);
- }
-
- protected void setUp() throws Exception
- {
- conn = new QpidClientConnectionHelper(BROKER);
- conn.setVirtualHost(vhost);
-
- try
- {
- conn.connect();
- } catch (JMSException e)
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- // clear queue
- _logger.debug("setup: clearing test queue");
- conn.consume(queue, 2000);
-
- hundredK = generatePayloadOfSize(1024 * 100);
- megabyte = generatePayloadOfSize(1024 * 1024);
- }
-
- protected void tearDown() throws Exception
- {
- conn.disconnect();
- }
-
-
- /**
- * PUT at maximum rate (although we commit after each PUT) until failure
- *
- * @throws Exception on error
- */
- public void testUntilFailureTransient() throws Exception
- {
- int copies = 0;
- int total = 0;
- String payload = hundredK;
- int size = payload.getBytes().length;
- while (true)
- {
- conn.put(queue, payload, 1, DeliveryMode.NON_PERSISTENT);
- copies++;
- total += size;
- System.out.println("put copy " + copies + " OK for total bytes: " + total);
- }
- }
-
- /**
- * PUT at lower rate (5 per second) until failure
- *
- * @throws Exception on error
- */
- public void testUntilFailureWithDelaysTransient() throws Exception
- {
- int copies = 0;
- int total = 0;
- String payload = hundredK;
- int size = payload.getBytes().length;
- while (true)
- {
- conn.put(queue, payload, 1, DeliveryMode.NON_PERSISTENT);
- copies++;
- total += size;
- System.out.println("put copy " + copies + " OK for total bytes: " + total);
- Thread.sleep(200);
- }
- }
-
- public static void noDelay()
- {
- HeapExhaustion he = new HeapExhaustion();
-
- try
- {
- he.setUp();
- }
- catch (Exception e)
- {
- _logger.info("Unable to connect");
- System.exit(0);
- }
-
- try
- {
- _logger.info("Running testUntilFailure");
- try
- {
- he.testUntilFailureTransient();
- }
- catch (FailoverException fe)
- {
- _logger.error("Caught failover:" + fe);
- }
- _logger.info("Finishing Connection ");
-
- try
- {
- he.tearDown();
- }
- catch (JMSException jmse)
- {
- if (((AMQException) jmse.getLinkedException()).getErrorCode() == AMQConstant.REQUEST_TIMEOUT)
- {
- _logger.info("Successful test of testUntilFailure");
- }
- else
- {
- _logger.error("Test Failed due to:" + jmse);
- }
- }
- }
- catch (Exception e)
- {
- _logger.error("Test Failed due to:" + e);
- }
- }
-
- public static void withDelay()
- {
- HeapExhaustion he = new HeapExhaustion();
-
- try
- {
- he.setUp();
- }
- catch (Exception e)
- {
- _logger.info("Unable to connect");
- System.exit(0);
- }
-
- try
- {
- _logger.info("Running testUntilFailure");
- try
- {
- he.testUntilFailureWithDelaysTransient();
- }
- catch (FailoverException fe)
- {
- _logger.error("Caught failover:" + fe);
- }
- _logger.info("Finishing Connection ");
-
- try
- {
- he.tearDown();
- }
- catch (JMSException jmse)
- {
- if (((AMQException) jmse.getLinkedException()).getErrorCode() == AMQConstant.REQUEST_TIMEOUT)
- {
- _logger.info("Successful test of testUntilFailure");
- }
- else
- {
- _logger.error("Test Failed due to:" + jmse);
- }
- }
- }
- catch (Exception e)
- {
- _logger.error("Test Failed due to:" + e);
- }
- }
-
- public static void main(String args[])
- {
- noDelay();
-
-
- try
- {
- System.out.println("Restart failed broker now to retest broker with delays in send.");
- System.in.read();
- }
- catch (IOException e)
- {
- _logger.info("Continuing");
- }
-
- withDelay();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/plugins/PluginTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/plugins/PluginTest.java
deleted file mode 100644
index 0762a7a561..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/plugins/PluginTest.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-
-package org.apache.qpid.server.plugins;
-
-import java.util.Map;
-
-import org.apache.qpid.server.exchange.ExchangeType;
-
-import junit.framework.TestCase;
-
-public class PluginTest extends TestCase
-{
-
- private static final String TEST_EXCHANGE_CLASS = "org.apache.qpid.extras.exchanges.example.TestExchangeType";
- private static final String PLUGIN_DIRECTORY = System.getProperty("example.plugin.target");
-
- public void testLoadExchanges() throws Exception
- {
- PluginManager manager = new PluginManager(PLUGIN_DIRECTORY);
- Map<String, ExchangeType<?>> exchanges = manager.getExchanges();
- assertNotNull("No exchanges found in "+PLUGIN_DIRECTORY, exchanges);
- assertEquals("Wrong number of exchanges found in "+PLUGIN_DIRECTORY,
- 2, exchanges.size());
- assertNotNull("Wrong exchange found in "+PLUGIN_DIRECTORY,
- exchanges.get(TEST_EXCHANGE_CLASS));
- }
-
- public void testNoExchanges() throws Exception
- {
- PluginManager manager = new PluginManager("/path/to/nowhere");
- Map<String, ExchangeType<?>> exchanges = manager.getExchanges();
- assertNull("Exchanges found", exchanges);
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
deleted file mode 100644
index 8e7038eec3..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
+++ /dev/null
@@ -1,124 +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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.queue.AMQQueueFactory;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.SkeletonMessageStore;
-
-import javax.management.JMException;
-
-/**
- * Test class to test MBean operations for AMQMinaProtocolSession.
- */
-public class AMQProtocolSessionMBeanTest extends TestCase
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(AMQProtocolSessionMBeanTest.class);
-
- private MessageStore _messageStore = new SkeletonMessageStore();
- private AMQMinaProtocolSession _protocolSession;
- private AMQChannel _channel;
- private AMQProtocolSessionMBean _mbean;
-
- public void testChannels() throws Exception
- {
- // check the channel count is correct
- int channelCount = _mbean.channels().size();
- assertTrue(channelCount == 1);
- AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("testQueue_" + System.currentTimeMillis()),
- false,
- new AMQShortString("test"),
- true,
- _protocolSession.getVirtualHost(), null);
- AMQChannel channel = new AMQChannel(_protocolSession,2, _messageStore);
- channel.setDefaultQueue(queue);
- _protocolSession.addChannel(channel);
- channelCount = _mbean.channels().size();
- assertTrue(channelCount == 2);
-
- // general properties test
- _mbean.setMaximumNumberOfChannels(1000L);
- assertTrue(_mbean.getMaximumNumberOfChannels() == 1000L);
-
- // check APIs
- AMQChannel channel3 = new AMQChannel(_protocolSession, 3, _messageStore);
- channel3.setLocalTransactional();
- _protocolSession.addChannel(channel3);
- _mbean.rollbackTransactions(2);
- _mbean.rollbackTransactions(3);
- _mbean.commitTransactions(2);
- _mbean.commitTransactions(3);
-
- // This should throw exception, because the channel does't exist
- try
- {
- _mbean.commitTransactions(4);
- fail();
- }
- catch (JMException ex)
- {
- log.debug("expected exception is thrown :" + ex.getMessage());
- }
-
- // check if closing of session works
- _protocolSession.addChannel(new AMQChannel(_protocolSession, 5, _messageStore));
- _mbean.closeConnection();
- try
- {
- channelCount = _mbean.channels().size();
- assertTrue(channelCount == 0);
- // session is now closed so adding another channel should throw an exception
- _protocolSession.addChannel(new AMQChannel(_protocolSession, 6, _messageStore));
- fail();
- }
- catch (AMQException ex)
- {
- log.debug("expected exception is thrown :" + ex.getMessage());
- }
- }
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
- _protocolSession =
- new AMQMinaProtocolSession(new MockIoSession(), appRegistry.getVirtualHostRegistry(), new AMQCodecFactory(true),
- null);
- _protocolSession.setVirtualHost(appRegistry.getVirtualHostRegistry().getVirtualHost("test"));
- _channel = new AMQChannel(_protocolSession, 1, _messageStore);
- _protocolSession.addChannel(_channel);
- _mbean = (AMQProtocolSessionMBean) _protocolSession.getManagedObject();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.java
deleted file mode 100644
index 62f5e0c6bf..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.java
+++ /dev/null
@@ -1,70 +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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-
-/** Test class to test MBean operations for AMQMinaProtocolSession. */
-public class MaxChannelsTest extends TestCase
-{
-// private MessageStore _messageStore = new SkeletonMessageStore();
-
- public void testChannels() throws Exception
- {
- IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
- AMQMinaProtocolSession _protocolSession = new AMQMinaProtocolSession(new MockIoSession(),
- appRegistry.getVirtualHostRegistry(),
- new AMQCodecFactory(true),
- null);
- _protocolSession.setVirtualHost(appRegistry.getVirtualHostRegistry().getVirtualHost("test"));
-
- // check the channel count is correct
- int channelCount = _protocolSession.getChannels().size();
- assertEquals("Initial channel count wrong", 0, channelCount);
-
- long maxChannels = 10L;
- _protocolSession.setMaximumNumberOfChannels(maxChannels);
- assertEquals("Number of channels not correctly set.", new Long(maxChannels), _protocolSession.getMaximumNumberOfChannels());
-
-
- try
- {
- for (long currentChannel = 0L; currentChannel < maxChannels; currentChannel++)
- {
- _protocolSession.addChannel(new AMQChannel(_protocolSession, (int) currentChannel, null));
- }
- }
- catch (AMQException e)
- {
- assertEquals("Wrong exception recevied.", e.getErrorCode(), AMQConstant.NOT_ALLOWED);
- }
- assertEquals("Maximum number of channels not set.", new Long(maxChannels), new Long(_protocolSession.getChannels().size()));
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MockIoSession.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MockIoSession.java
deleted file mode 100644
index cf6366b513..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MockIoSession.java
+++ /dev/null
@@ -1,297 +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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import org.apache.mina.common.*;
-import org.apache.mina.common.support.DefaultCloseFuture;
-import org.apache.mina.common.support.DefaultWriteFuture;
-
-import java.net.SocketAddress;
-import java.net.InetSocketAddress;
-import java.util.Set;
-
-public class MockIoSession implements IoSession
-{
- private AMQProtocolSession _protocolSession;
-
- /**
- * Stores the last response written
- */
- private Object _lastWrittenObject;
-
- private boolean _closing;
-
- public MockIoSession()
- {
- }
-
- public Object getLastWrittenObject()
- {
- return _lastWrittenObject;
- }
-
- public IoService getService()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IoServiceConfig getServiceConfig()
- {
- return null;
- }
-
- public IoHandler getHandler()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IoSessionConfig getConfig()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public IoFilterChain getFilterChain()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public WriteFuture write(Object message)
- {
- WriteFuture wf = new DefaultWriteFuture(null);
- _lastWrittenObject = message;
- return wf;
- }
-
- public CloseFuture close()
- {
- _closing = true;
- CloseFuture cf = new DefaultCloseFuture(null);
- cf.setClosed();
- return cf;
- }
-
- public Object getAttachment()
- {
- return _protocolSession;
- }
-
- public Object setAttachment(Object attachment)
- {
- Object current = _protocolSession;
- _protocolSession = (AMQProtocolSession) attachment;
- return current;
- }
-
- public Object getAttribute(String key)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public Object setAttribute(String key, Object value)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public Object setAttribute(String key)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public Object removeAttribute(String key)
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean containsAttribute(String key)
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public Set getAttributeKeys()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public TransportType getTransportType()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isConnected()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isClosing()
- {
- return _closing;
- }
-
- public CloseFuture getCloseFuture()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public SocketAddress getRemoteAddress()
- {
- return new InetSocketAddress("127.0.0.1", 1234); //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public SocketAddress getLocalAddress()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public SocketAddress getServiceAddress()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getIdleTime(IdleStatus status)
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getIdleTimeInMillis(IdleStatus status)
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setIdleTime(IdleStatus status, int idleTime)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getWriteTimeout()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getWriteTimeoutInMillis()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setWriteTimeout(int writeTimeout)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public TrafficMask getTrafficMask()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setTrafficMask(TrafficMask trafficMask)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void suspendRead()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void suspendWrite()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void resumeRead()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void resumeWrite()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getReadBytes()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getWrittenBytes()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getReadMessages()
- {
- return 0L;
- }
-
- public long getWrittenMessages()
- {
- return 0L;
- }
-
- public long getWrittenWriteRequests()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getScheduledWriteRequests()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getScheduledWriteBytes()
- {
- return 0; //TODO
- }
-
- public long getCreationTime()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getLastIoTime()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getLastReadTime()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getLastWriteTime()
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isIdle(IdleStatus status)
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public int getIdleCount(IdleStatus status)
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public long getLastIdleTime(IdleStatus status)
- {
- return 0; //To change body of implemented methods use File | Settings | File Templates.
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java
deleted file mode 100644
index 9c2932c5e2..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java
+++ /dev/null
@@ -1,420 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import junit.framework.TestCase;
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.subscription.SubscriptionFactoryImpl;
-import org.apache.qpid.server.flow.LimitlessCreditManager;
-import org.apache.qpid.server.flow.Pre0_10CreditManager;
-import org.apache.qpid.server.ack.UnacknowledgedMessageMap;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.TestMemoryMessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.server.txn.TransactionalContext;
-import org.apache.qpid.server.util.NullApplicationRegistry;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.Set;
-import java.util.Collections;
-
-/**
- * Tests that acknowledgements are handled correctly.
- */
-public class AckTest extends TestCase
-{
- private static final Logger _log = Logger.getLogger(AckTest.class);
-
- private Subscription _subscription;
-
- private MockProtocolSession _protocolSession;
-
- private TestMemoryMessageStore _messageStore;
-
- private StoreContext _storeContext = new StoreContext();
-
- private AMQChannel _channel;
-
- private AMQQueue _queue;
-
- private static final AMQShortString DEFAULT_CONSUMER_TAG = new AMQShortString("conTag");
-
- protected void setUp() throws Exception
- {
- super.setUp();
- ApplicationRegistry.initialise(new NullApplicationRegistry(), 1);
-
- _messageStore = new TestMemoryMessageStore();
- _protocolSession = new MockProtocolSession(_messageStore);
- _channel = new AMQChannel(_protocolSession,5, _messageStore /*dont need exchange registry*/);
-
- _protocolSession.addChannel(_channel);
-
- _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("myQ"), false, new AMQShortString("guest"), true, ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test"),
- null);
- }
-
- protected void tearDown()
- {
- ApplicationRegistry.remove(1);
- }
-
- private void publishMessages(int count) throws AMQException
- {
- publishMessages(count, false);
- }
-
- private void publishMessages(int count, boolean persistent) throws AMQException
- {
- TransactionalContext txnContext = new NonTransactionalContext(_messageStore, _storeContext, null,
- new LinkedList<RequiredDeliveryException>()
- );
- _queue.registerSubscription(_subscription,false);
- MessageHandleFactory factory = new MessageHandleFactory();
- for (int i = 1; i <= count; i++)
- {
- // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
- // TODO: Establish some way to determine the version for the test.
- MessagePublishInfo publishBody = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return new AMQShortString("someExchange");
- }
-
- public void setExchange(AMQShortString exchange)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return new AMQShortString("rk");
- }
- };
- IncomingMessage msg = new IncomingMessage(_messageStore.getNewMessageId(), publishBody, txnContext,_protocolSession);
- //IncomingMessage msg2 = null;
- if (persistent)
- {
- BasicContentHeaderProperties b = new BasicContentHeaderProperties();
- //This is DeliveryMode.PERSISTENT
- b.setDeliveryMode((byte) 2);
- ContentHeaderBody cb = new ContentHeaderBody();
- cb.properties = b;
- msg.setContentHeaderBody(cb);
- }
- else
- {
- msg.setContentHeaderBody(new ContentHeaderBody());
- }
- // we increment the reference here since we are not delivering the messaging to any queues, which is where
- // the reference is normally incremented. The test is easier to construct if we have direct access to the
- // subscription
- ArrayList<AMQQueue> qs = new ArrayList<AMQQueue>();
- qs.add(_queue);
- msg.enqueue(qs);
- msg.routingComplete(_messageStore, factory);
- if(msg.allContentReceived())
- {
- msg.deliverToQueues();
- }
- // we manually send the message to the subscription
- //_subscription.send(new QueueEntry(_queue,msg), _queue);
- }
- }
-
- /**
- * Tests that the acknowledgements are correctly associated with a channel and
- * order is preserved when acks are enabled
- */
- public void testAckChannelAssociationTest() throws AMQException
- {
- _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true, null, false, new LimitlessCreditManager());
- final int msgCount = 10;
- publishMessages(msgCount, true);
-
- UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
- assertTrue(map.size() == msgCount);
- assertTrue(_messageStore.getMessageMetaDataMap().size() == msgCount);
-
- Set<Long> deliveryTagSet = map.getDeliveryTags();
- int i = 1;
- for (long deliveryTag : deliveryTagSet)
- {
- assertTrue(deliveryTag == i);
- i++;
- QueueEntry unackedMsg = map.get(deliveryTag);
- assertTrue(unackedMsg.getQueue() == _queue);
- }
-
- assertTrue(map.size() == msgCount);
- assertTrue(_messageStore.getMessageMetaDataMap().size() == msgCount);
- }
-
- /**
- * Tests that in no-ack mode no messages are retained
- */
- public void testNoAckMode() throws AMQException
- {
- // false arg means no acks expected
- _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, false, null, false, new LimitlessCreditManager());
- final int msgCount = 10;
- publishMessages(msgCount);
-
- UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
- assertTrue(map.size() == 0);
- assertTrue(_messageStore.getMessageMetaDataMap().size() == 0);
- assertTrue(_messageStore.getContentBodyMap().size() == 0);
-
- }
-
- /**
- * Tests that in no-ack mode no messages are retained
- */
- public void testPersistentNoAckMode() throws AMQException
- {
- // false arg means no acks expected
- _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, false,null,false, new LimitlessCreditManager());
- final int msgCount = 10;
- publishMessages(msgCount, true);
-
- UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
- assertTrue(map.size() == 0);
- assertTrue(_messageStore.getMessageMetaDataMap().size() == 0);
- assertTrue(_messageStore.getContentBodyMap().size() == 0);
-
- }
-
- /**
- * Tests that a single acknowledgement is handled correctly (i.e multiple flag not
- * set case)
- */
- public void testSingleAckReceivedTest() throws AMQException
- {
- _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true,null,false, new LimitlessCreditManager());
- final int msgCount = 10;
- publishMessages(msgCount);
-
- _channel.acknowledgeMessage(5, false);
- UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
- assertTrue(map.size() == msgCount - 1);
-
- Set<Long> deliveryTagSet = map.getDeliveryTags();
- int i = 1;
- for (long deliveryTag : deliveryTagSet)
- {
- assertTrue(deliveryTag == i);
- QueueEntry unackedMsg = map.get(deliveryTag);
- assertTrue(unackedMsg.getQueue() == _queue);
- // 5 is the delivery tag of the message that *should* be removed
- if (++i == 5)
- {
- ++i;
- }
- }
- }
-
- /**
- * Tests that a single acknowledgement is handled correctly (i.e multiple flag not
- * set case)
- */
- public void testMultiAckReceivedTest() throws AMQException
- {
- _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true,null,false, new LimitlessCreditManager());
- final int msgCount = 10;
- publishMessages(msgCount);
-
- _channel.acknowledgeMessage(5, true);
- UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
- assertTrue(map.size() == 5);
-
- Set<Long> deliveryTagSet = map.getDeliveryTags();
- int i = 1;
- for (long deliveryTag : deliveryTagSet)
- {
- assertTrue(deliveryTag == i + 5);
- QueueEntry unackedMsg = map.get(deliveryTag);
- assertTrue(unackedMsg.getQueue() == _queue);
- ++i;
- }
- }
-
- /**
- * Tests that a multiple acknowledgement is handled correctly. When ack'ing all pending msgs.
- */
- public void testMultiAckAllReceivedTest() throws AMQException
- {
- _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true,null,false, new LimitlessCreditManager());
- final int msgCount = 10;
- publishMessages(msgCount);
-
- _channel.acknowledgeMessage(0, true);
- UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
- assertTrue(map.size() == 0);
-
- Set<Long> deliveryTagSet = map.getDeliveryTags();
- int i = 1;
- for (long deliveryTag : deliveryTagSet)
- {
- assertTrue(deliveryTag == i + 5);
- QueueEntry unackedMsg = map.get(deliveryTag);
- assertTrue(unackedMsg.getQueue() == _queue);
- ++i;
- }
- }
-
- /**
- * A regression fixing QPID-1136 showed this up
- *
- * @throws Exception
- */
- public void testMessageDequeueRestoresCreditTest() throws Exception
- {
- // Send 10 messages
- Pre0_10CreditManager creditManager = new Pre0_10CreditManager(0l, 1);
-
- _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession,
- DEFAULT_CONSUMER_TAG, true, null, false, creditManager);
- final int msgCount = 1;
- publishMessages(msgCount);
-
- _queue.deliverAsync(_subscription);
-
- _channel.acknowledgeMessage(1, false);
-
- // Check credit available
- assertTrue("No credit available", creditManager.hasCredit());
-
- }
-
-
-/*
- public void testPrefetchHighLow() throws AMQException
- {
- int lowMark = 5;
- int highMark = 10;
-
- _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true,null,false, new LimitlessCreditManager());
- _channel.setPrefetchLowMarkCount(lowMark);
- _channel.setPrefetchHighMarkCount(highMark);
-
- assertTrue(_channel.getPrefetchLowMarkCount() == lowMark);
- assertTrue(_channel.getPrefetchHighMarkCount() == highMark);
-
- publishMessages(highMark);
-
- // at this point we should have sent out only highMark messages
- // which have not bee received so will be queued up in the channel
- // which should be suspended
- assertTrue(_subscription.isSuspended());
- UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
- assertTrue(map.size() == highMark);
-
- //acknowledge messages so we are just above lowMark
- _channel.acknowledgeMessage(lowMark - 1, true);
-
- //we should still be suspended
- assertTrue(_subscription.isSuspended());
- assertTrue(map.size() == lowMark + 1);
-
- //acknowledge one more message
- _channel.acknowledgeMessage(lowMark, true);
-
- //and suspension should be lifted
- assertTrue(!_subscription.isSuspended());
-
- //pubilsh more msgs so we are just below the limit
- publishMessages(lowMark - 1);
-
- //we should not be suspended
- assertTrue(!_subscription.isSuspended());
-
- //acknowledge all messages
- _channel.acknowledgeMessage(0, true);
- try
- {
- Thread.sleep(3000);
- }
- catch (InterruptedException e)
- {
- _log.error("Error: " + e, e);
- }
- //map will be empty
- assertTrue(map.size() == 0);
- }
-
-*/
-/*
- public void testPrefetch() throws AMQException
- {
- _subscription = SubscriptionFactoryImpl.INSTANCE.createSubscription(5, _protocolSession, DEFAULT_CONSUMER_TAG, true,null,false, new LimitlessCreditManager());
- _channel.setMessageCredit(5);
-
- assertTrue(_channel.getPrefetchCount() == 5);
-
- final int msgCount = 5;
- publishMessages(msgCount);
-
- // at this point we should have sent out only 5 messages with a further 5 queued
- // up in the channel which should now be suspended
- assertTrue(_subscription.isSuspended());
- UnacknowledgedMessageMap map = _channel.getUnacknowledgedMessageMap();
- assertTrue(map.size() == 5);
- _channel.acknowledgeMessage(5, true);
- assertTrue(!_subscription.isSuspended());
- try
- {
- Thread.sleep(3000);
- }
- catch (InterruptedException e)
- {
- _log.error("Error: " + e, e);
- }
- assertTrue(map.size() == 0);
- }
-
-*/
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(AckTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java
deleted file mode 100644
index 99c88fac3e..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java
+++ /dev/null
@@ -1,262 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.output.ProtocolOutputConverter;
-import org.apache.qpid.server.output.ProtocolOutputConverterRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.transport.Sender;
-
-import javax.security.sasl.SaslServer;
-import java.util.HashMap;
-import java.util.Map;
-import java.security.Principal;
-
-/**
- * A protocol session that can be used for testing purposes.
- */
-public class MockProtocolSession implements AMQProtocolSession
-{
- private MessageStore _messageStore;
-
- private Map<Integer, AMQChannel> _channelMap = new HashMap<Integer, AMQChannel>();
-
- public MockProtocolSession(MessageStore messageStore)
- {
- _messageStore = messageStore;
- }
-
- public void dataBlockReceived(AMQDataBlock message) throws Exception
- {
- }
-
- public void writeFrame(AMQDataBlock frame)
- {
- }
-
- public AMQShortString getContextKey()
- {
- return null;
- }
-
- public void setContextKey(AMQShortString contextKey)
- {
- }
-
- public AMQChannel getChannel(int channelId)
- {
- AMQChannel channel = _channelMap.get(channelId);
- if (channel == null)
- {
- throw new IllegalArgumentException("Invalid channel id: " + channelId);
- }
- else
- {
- return channel;
- }
- }
-
- public void addChannel(AMQChannel channel)
- {
- if (channel == null)
- {
- throw new IllegalArgumentException("Channel must not be null");
- }
- else
- {
- _channelMap.put(channel.getChannelId(), channel);
- }
- }
-
- public void closeChannel(int channelId) throws AMQException
- {
- }
-
- public void closeChannelOk(int channelId)
- {
-
- }
-
- public boolean channelAwaitingClosure(int channelId)
- {
- return false;
- }
-
- public void removeChannel(int channelId)
- {
- _channelMap.remove(channelId);
- }
-
- public void initHeartbeats(int delay)
- {
- }
-
- public void closeSession() throws AMQException
- {
- }
-
- public void closeConnection(int channelId, AMQConnectionException e, boolean closeIoSession) throws AMQException
- {
- }
-
- public Object getKey()
- {
- return null;
- }
-
- public String getLocalFQDN()
- {
- return null;
- }
-
- public SaslServer getSaslServer()
- {
- return null;
- }
-
- public void setSaslServer(SaslServer saslServer)
- {
- }
-
- public FieldTable getClientProperties()
- {
- return null;
- }
-
- public void setClientProperties(FieldTable clientProperties)
- {
- }
-
- public Object getClientIdentifier()
- {
- return null;
- }
-
- public VirtualHost getVirtualHost()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setVirtualHost(VirtualHost virtualHost)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void addSessionCloseTask(Task task)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void removeSessionCloseTask(Task task)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public ProtocolOutputConverter getProtocolOutputConverter()
- {
- return ProtocolOutputConverterRegistry.getConverter(this);
- }
-
- public void setAuthorizedID(Principal authorizedID)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public Principal getAuthorizedID()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public MethodRegistry getMethodRegistry()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void methodFrameReceived(int channelId, AMQMethodBody body)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void contentHeaderReceived(int channelId, ContentHeaderBody body)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void contentBodyReceived(int channelId, ContentBody body)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void heartbeatBodyReceived(int channelId, HeartbeatBody body)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public MethodDispatcher getMethodDispatcher()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public ProtocolSessionIdentifier getSessionIdentifier()
- {
- return null;
- }
-
- public byte getProtocolMajorVersion()
- {
- return getProtocolVersion().getMajorVersion();
- }
-
- public byte getProtocolMinorVersion()
- {
- return getProtocolVersion().getMinorVersion();
- }
-
-
- public ProtocolVersion getProtocolVersion()
- {
- return ProtocolVersion.getLatestSupportedVersion(); //To change body of implemented methods use File | Settings | File Templates.
- }
-
-
- public VersionSpecificRegistry getRegistry()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void setSender(Sender<java.nio.ByteBuffer> sender)
- {
- // FIXME AS TODO
-
- }
-
- public void init()
- {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java
deleted file mode 100644
index c4e744573f..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQChannelClosedException;
-import org.apache.qpid.AMQConnectionClosedException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.url.URLSyntaxException;
-import org.apache.qpid.util.CommandLineParser;
-
-import javax.jms.JMSException;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.io.IOException;
-import java.util.Properties;
-
-public class PersistentTestManual
-{
- private static final Logger _logger = Logger.getLogger(PersistentTestManual.class);
-
-
- private static final String QUEUE = "direct://amq.direct//PersistentTest-Queue2?durable='true',exclusive='true'";
-
- protected AMQConnection _connection;
-
- protected Session _session;
-
- protected Queue _queue;
- private Properties properties;
-
- private String _brokerDetails;
- private String _username;
- private String _password;
- private String _virtualpath;
-
- public PersistentTestManual(Properties overrides)
- {
- properties = new Properties(defaults);
- properties.putAll(overrides);
-
- _brokerDetails = properties.getProperty(BROKER_PROPNAME);
- _username = properties.getProperty(USERNAME_PROPNAME);
- _password = properties.getProperty(PASSWORD_PROPNAME);
- _virtualpath = properties.getProperty(VIRTUAL_HOST_PROPNAME);
-
- createConnection();
- }
-
- protected void createConnection()
- {
- try
- {
- _connection = new AMQConnection(_brokerDetails, _username, _password, "PersistentTest", _virtualpath);
-
- _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _connection.start();
- }
- catch (Exception e)
- {
- _logger.error("Unable to create test class due to:" + e.getMessage(), e);
- System.exit(0);
- }
- }
-
- public void test() throws AMQException, URLSyntaxException
- {
-
- //Create the Durable Queue
- try
- {
- _session.createConsumer(_session.createQueue(QUEUE)).close();
- }
- catch (JMSException e)
- {
- _logger.error("Unable to create Queue due to:" + e.getMessage(), e);
- System.exit(0);
- }
-
- try
- {
- if (testQueue())
- {
- // close connection
- _connection.close();
- // wait
- System.out.println("Restart Broker Now");
- try
- {
- System.in.read();
- }
- catch (IOException e)
- {
- //
- }
- finally
- {
- System.out.println("Continuing....");
- }
-
- //Test queue is still there.
- AMQConnection connection = new AMQConnection(_brokerDetails, _username, _password, "DifferentClientID", _virtualpath);
-
- AMQSession session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- try
- {
- session.createConsumer(session.createQueue(QUEUE));
- _logger.error("Create consumer succeeded." +
- " This shouldn't be allowed as this means the queue didn't exist when it should");
-
- connection.close();
-
- exit();
- }
- catch (JMSException e)
- {
- try
- {
- connection.close();
- }
- catch (JMSException cce)
- {
- if (cce.getLinkedException() instanceof AMQConnectionClosedException)
- {
- _logger.error("Channel Close Bug still present QPID-432, should see an 'Error closing session'");
- }
- else
- {
- exit(cce);
- }
- }
-
- if (e.getLinkedException() instanceof AMQChannelClosedException)
- {
- _logger.info("AMQChannelClosedException received as expected");
- }
- else
- {
- exit(e);
- }
- }
- }
- }
- catch (JMSException e)
- {
- _logger.error("Unable to test Queue due to:" + e.getMessage(), e);
- System.exit(0);
- }
- }
-
- private void exit(JMSException e)
- {
- _logger.error("JMSException received:" + e.getMessage());
- e.printStackTrace();
- exit();
- }
-
- private void exit()
- {
- try
- {
- _connection.close();
- }
- catch (JMSException e)
- {
- //
- }
- System.exit(0);
- }
-
- private boolean testQueue() throws JMSException
- {
- String TEST_TEXT = "init";
-
- //Create a new session to send producer
- Session session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Queue q = session.createQueue(QUEUE);
- MessageProducer producer = session.createProducer(q);
-
- producer.send(session.createTextMessage(TEST_TEXT));
-
- //create a new consumer on the original session
- TextMessage m = (TextMessage) _session.createConsumer(q).receive();
-
-
- if ((m != null) && m.getText().equals(TEST_TEXT))
- {
- return true;
- }
- else
- {
- _logger.error("Incorrect values returned from Queue Test:" + m);
- System.exit(0);
- return false;
- }
- }
-
- /** Holds the name of the property to get the test broker url from. */
- public static final String BROKER_PROPNAME = "broker";
-
- /** Holds the default broker url for the test. */
- public static final String BROKER_DEFAULT = "tcp://localhost:5672";
-
- /** Holds the name of the property to get the test broker virtual path. */
- public static final String VIRTUAL_HOST_PROPNAME = "virtualHost";
-
- /** Holds the default virtual path for the test. */
- public static final String VIRTUAL_HOST_DEFAULT = "";
-
- /** Holds the name of the property to get the broker access username from. */
- public static final String USERNAME_PROPNAME = "username";
-
- /** Holds the default broker log on username. */
- public static final String USERNAME_DEFAULT = "guest";
-
- /** Holds the name of the property to get the broker access password from. */
- public static final String PASSWORD_PROPNAME = "password";
-
- /** Holds the default broker log on password. */
- public static final String PASSWORD_DEFAULT = "guest";
-
- /** Holds the default configuration properties. */
- public static Properties defaults = new Properties();
-
- static
- {
- defaults.setProperty(BROKER_PROPNAME, BROKER_DEFAULT);
- defaults.setProperty(USERNAME_PROPNAME, USERNAME_DEFAULT);
- defaults.setProperty(PASSWORD_PROPNAME, PASSWORD_DEFAULT);
- defaults.setProperty(VIRTUAL_HOST_PROPNAME, VIRTUAL_HOST_DEFAULT);
- }
-
- public static void main(String[] args)
- {
- PersistentTestManual test;
-
- Properties options =
- CommandLineParser.processCommandLine(args, new CommandLineParser(new String[][]{}), System.getProperties());
-
- test = new PersistentTestManual(options);
- try
- {
- test.test();
- System.out.println("Test was successfull.");
- }
- catch (Exception e)
- {
- _logger.error("Unable to test due to:" + e.getMessage(), e);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java
deleted file mode 100644
index bb386f9f6f..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/PriorityTest.java
+++ /dev/null
@@ -1,235 +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.
-*
-*/
-package org.apache.qpid.server.queue;
-
-import junit.framework.TestCase;
-import junit.framework.Assert;
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
-import org.apache.qpid.url.URLSyntaxException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-
-import javax.jms.*;
-import javax.naming.NamingException;
-import javax.naming.Context;
-import javax.naming.spi.InitialContextFactory;
-import java.util.Hashtable;
-import java.util.HashMap;
-import java.util.Map;
-
-/** Test Case provided by client Non-functional Test NF101: heap exhaustion behaviour */
-public class PriorityTest extends TestCase
-{
- private static final int TIMEOUT = 1500;
-
-
- private static final Logger _logger = Logger.getLogger(PriorityTest.class);
-
-
- protected final String BROKER = "vm://:1";
- protected final String VHOST = "/test";
- protected final String QUEUE = "PriorityQueue";
-
- private static final int MSG_COUNT = 50;
-
- private Context context = null;
- private Connection producerConnection;
- private MessageProducer producer;
- private Session producerSession;
- private Queue queue;
- private Connection consumerConnection;
- private Session consumerSession;
-
-
- private MessageConsumer consumer;
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- if (usingInVMBroker())
- {
- TransportConnection.createVMBroker(1);
- }
-
- InitialContextFactory factory = new PropertiesFileInitialContextFactory();
- Hashtable<String, String> env = new Hashtable<String, String>();
-
- env.put("connectionfactory.connection", "amqp://guest:guest@PRIORITY_TEST_ID" + VHOST + "?brokerlist='" + BROKER + "'");
- env.put("queue.queue", QUEUE);
-
- context = factory.getInitialContext(env);
- producerConnection = ((ConnectionFactory) context.lookup("connection")).createConnection();
- producerSession = producerConnection.createSession(true, Session.AUTO_ACKNOWLEDGE);
-
- producerConnection.start();
-
- consumerConnection = ((ConnectionFactory) context.lookup("connection")).createConnection();
- consumerSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- }
-
- private boolean usingInVMBroker()
- {
- return BROKER.startsWith("vm://");
- }
-
- protected void tearDown() throws Exception
- {
- producerConnection.close();
- consumerConnection.close();
- if (usingInVMBroker())
- {
- TransportConnection.killAllVMBrokers();
- }
- super.tearDown();
- }
-
- public void testPriority() throws JMSException, NamingException, AMQException
- {
- final Map<String,Object> arguments = new HashMap<String, Object>();
- arguments.put("x-qpid-priorities",10);
- ((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false, false, arguments);
- queue = new AMQQueue("amq.direct",QUEUE);
- ((AMQSession) producerSession).declareAndBind((AMQDestination)queue);
- producer = producerSession.createProducer(queue);
-
- for (int msg = 0; msg < MSG_COUNT; msg++)
- {
- producer.setPriority(msg % 10);
- producer.send(nextMessage(msg, false, producerSession, producer));
- }
- producerSession.commit();
- producer.close();
- producerSession.close();
- producerConnection.close();
-
- consumer = consumerSession.createConsumer(queue);
- consumerConnection.start();
- Message received;
- int receivedCount = 0;
- Message previous = null;
- int messageCount = 0;
- while((received = consumer.receive(1000))!=null)
- {
- messageCount++;
- if(previous != null)
- {
- assertTrue("Messages arrived in unexpected order " + messageCount + " " + previous.getIntProperty("msg") + " " + received.getIntProperty("msg") + " " + previous.getJMSPriority() + " " + received.getJMSPriority(), (previous.getJMSPriority() > received.getJMSPriority()) || ((previous.getJMSPriority() == received.getJMSPriority()) && previous.getIntProperty("msg") < received.getIntProperty("msg")) );
- }
-
- previous = received;
- receivedCount++;
- }
-
- assertEquals("Incorrect number of message received", 50, receivedCount);
- }
-
- public void testOddOrdering() throws AMQException, JMSException
- {
- final Map<String,Object> arguments = new HashMap<String, Object>();
- arguments.put("x-qpid-priorities",3);
- ((AMQSession) producerSession).createQueue(new AMQShortString(QUEUE), true, false, false, arguments);
- queue = new AMQQueue("amq.direct",QUEUE);
- ((AMQSession) producerSession).declareAndBind((AMQDestination)queue);
- producer = producerSession.createProducer(queue);
-
- // In order ABC
- producer.setPriority(9);
- producer.send(nextMessage(1, false, producerSession, producer));
- producer.setPriority(4);
- producer.send(nextMessage(2, false, producerSession, producer));
- producer.setPriority(1);
- producer.send(nextMessage(3, false, producerSession, producer));
-
- // Out of order BAC
- producer.setPriority(4);
- producer.send(nextMessage(4, false, producerSession, producer));
- producer.setPriority(9);
- producer.send(nextMessage(5, false, producerSession, producer));
- producer.setPriority(1);
- producer.send(nextMessage(6, false, producerSession, producer));
-
- // Out of order BCA
- producer.setPriority(4);
- producer.send(nextMessage(7, false, producerSession, producer));
- producer.setPriority(1);
- producer.send(nextMessage(8, false, producerSession, producer));
- producer.setPriority(9);
- producer.send(nextMessage(9, false, producerSession, producer));
-
- // Reverse order CBA
- producer.setPriority(1);
- producer.send(nextMessage(10, false, producerSession, producer));
- producer.setPriority(4);
- producer.send(nextMessage(11, false, producerSession, producer));
- producer.setPriority(9);
- producer.send(nextMessage(12, false, producerSession, producer));
- producerSession.commit();
-
- consumer = consumerSession.createConsumer(queue);
- consumerConnection.start();
-
- Message msg = consumer.receive(TIMEOUT);
- assertEquals(1, msg.getIntProperty("msg"));
- msg = consumer.receive(TIMEOUT);
- assertEquals(5, msg.getIntProperty("msg"));
- msg = consumer.receive(TIMEOUT);
- assertEquals(9, msg.getIntProperty("msg"));
- msg = consumer.receive(TIMEOUT);
- assertEquals(12, msg.getIntProperty("msg"));
-
- msg = consumer.receive(TIMEOUT);
- assertEquals(2, msg.getIntProperty("msg"));
- msg = consumer.receive(TIMEOUT);
- assertEquals(4, msg.getIntProperty("msg"));
- msg = consumer.receive(TIMEOUT);
- assertEquals(7, msg.getIntProperty("msg"));
- msg = consumer.receive(TIMEOUT);
- assertEquals(11, msg.getIntProperty("msg"));
-
- msg = consumer.receive(TIMEOUT);
- assertEquals(3, msg.getIntProperty("msg"));
- msg = consumer.receive(TIMEOUT);
- assertEquals(6, msg.getIntProperty("msg"));
- msg = consumer.receive(TIMEOUT);
- assertEquals(8, msg.getIntProperty("msg"));
- msg = consumer.receive(TIMEOUT);
- assertEquals(10, msg.getIntProperty("msg"));
- }
-
- private Message nextMessage(int msg, boolean first, Session producerSession, MessageProducer producer) throws JMSException
- {
- Message send = producerSession.createTextMessage("Message: " + msg);
- send.setIntProperty("msg", msg);
-
- return send;
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java
deleted file mode 100644
index 280d897852..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java
+++ /dev/null
@@ -1,258 +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.
- *
- */
-
-package org.apache.qpid.server.queue;
-
-import junit.framework.TestCase;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.log4j.PropertyConfigurator;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.naming.spi.InitialContextFactory;
-import java.util.Hashtable;
-
-/**
- * Test Case to ensure that messages are correctly returned.
- * This includes checking:
- * - The message is returned.
- * - The broker doesn't leak memory.
- * - The broker's state is correct after test.
- */
-public class QueueDepthWithSelectorTest extends TestCase
-{
- private static final Logger _logger = Logger.getLogger(QueueDepthWithSelectorTest.class);
-
- protected final String BROKER = "vm://:1";
- protected final String VHOST = "test";
- protected final String QUEUE = this.getClass().getName();
-
- private Context _context;
-
- private Connection _clientConnection, _producerConnection;
- private Session _clientSession, _producerSession;
- private MessageProducer _producer;
- private MessageConsumer _consumer;
-
- private static final int MSG_COUNT = 50;
-
- private Message[] _messages = new Message[MSG_COUNT];
-
- protected void setUp() throws Exception
- {
-
- System.err.println("amqj.logging.level:" + System.getProperty("amqj.logging.level"));
- System.err.println("_logger.level:" + _logger.getLevel());
- System.err.println("_logger.isE-Error:" + _logger.isEnabledFor(Level.ERROR));
- System.err.println("_logger.isE-Warn:" + _logger.isEnabledFor(Level.WARN));
- System.err.println("_logger.isInfo:" + _logger.isInfoEnabled() + ":" + _logger.isEnabledFor(Level.INFO));
- System.err.println("_logger.isDebug:" + _logger.isDebugEnabled() + ":" + _logger.isEnabledFor(Level.DEBUG));
- System.err.println("_logger.isTrace:" + _logger.isTraceEnabled() + ":" + _logger.isEnabledFor(Level.TRACE));
-
- System.err.println(Logger.getRootLogger().getLoggerRepository());
-
- if (BROKER.startsWith("vm://"))
- {
- TransportConnection.createVMBroker(1);
- }
- InitialContextFactory factory = new PropertiesFileInitialContextFactory();
-
- Hashtable<String, String> env = new Hashtable<String, String>();
-
- env.put("connectionfactory.connection", "amqp://guest:guest@TTL_TEST_ID/" + VHOST + "?brokerlist='" + BROKER + "'");
- env.put("queue.queue", QUEUE);
-
- _context = factory.getInitialContext(env);
-
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- if (_producerConnection != null)
- {
- _producerConnection.close();
- }
-
- if (_clientConnection != null)
- {
- _clientConnection.close();
- }
-
- if (BROKER.startsWith("vm://"))
- {
- TransportConnection.killAllVMBrokers();
- }
- }
-
- public void test() throws Exception
- {
-
- init();
- //Send messages
- _logger.info("Starting to send messages");
- for (int msg = 0; msg < MSG_COUNT; msg++)
- {
- _producer.send(nextMessage(msg));
- }
- _logger.info("Closing connection");
- //Close the connection.. .giving the broker time to clean up its state.
- _producerConnection.close();
-
- //Verify we get all the messages.
- _logger.info("Verifying messages");
- verifyAllMessagesRecevied();
-
- //Close the connection.. .giving the broker time to clean up its state.
- _clientConnection.close();
-
- //Verify Broker state
- _logger.info("Verifying broker state");
- verifyBrokerState();
- }
-
- private void init() throws NamingException, JMSException
- {
- _messages = new Message[MSG_COUNT];
-
- //Create Producer
- _producerConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
- _producerConnection.start();
- _producerSession = _producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- _producer = _producerSession.createProducer((Queue) _context.lookup("queue"));
-
- // Create consumer
- _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
- _clientConnection.start();
- _clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- _consumer = _clientSession.createConsumer((Queue) _context.lookup("queue"), "key = 23");
- }
-
- private void verifyBrokerState()
- {
- try
- {
- _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
-
- _clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- }
- catch (Exception e)
- {
- fail(e.getMessage());
- }
-
- try
- {
- Thread.sleep(2000);
- long queueDepth = ((AMQSession) _clientSession).getQueueDepth((AMQDestination) _context.lookup("queue"));
- assertEquals("Session reports Queue depth not as expected", 0, queueDepth);
- }
- catch (InterruptedException e)
- {
- fail(e.getMessage());
- }
- catch (NamingException e)
- {
- fail(e.getMessage());
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
- finally
- {
- try
- {
- _clientConnection.close();
- }
- catch (JMSException e)
- {
- fail(e.getMessage());
- }
- }
-
- }
-
- private void verifyAllMessagesRecevied() throws Exception
- {
-
- boolean[] msgIdRecevied = new boolean[MSG_COUNT];
-
- for (int i = 0; i < MSG_COUNT; i++)
- {
- _messages[i] = _consumer.receive(1000);
- assertNotNull("should have received a message but didn't", _messages[i]);
- }
- long queueDepth = ((AMQSession) _clientSession).getQueueDepth((AMQDestination) _context.lookup("queue"));
- assertEquals("Session reports Queue depth not as expected", 0, queueDepth);
-
- //Check received messages
- int msgId = 0;
- for (Message msg : _messages)
- {
- assertNotNull("Message should not be null", msg);
- assertEquals("msgId was wrong", msgId, msg.getIntProperty("ID"));
- assertFalse("Already received msg id " + msgId, msgIdRecevied[msgId]);
- msgIdRecevied[msgId] = true;
- msgId++;
- }
-
- //Check all received
- for (msgId = 0; msgId < MSG_COUNT; msgId++)
- {
- assertTrue("Message " + msgId + " not received.", msgIdRecevied[msgId]);
- }
- }
-
- /**
- * Get the next message putting the given count into the intProperties as ID.
- *
- * @param msgNo the message count to store as ID.
- *
- * @return
- *
- * @throws JMSException
- */
-
- private Message nextMessage(int msgNo) throws JMSException
- {
- Message send = _producerSession.createTextMessage("MessageReturnTest");
- send.setIntProperty("ID", msgNo);
- send.setIntProperty("key", 23);
- return send;
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java
deleted file mode 100644
index 66ec9686dd..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java
+++ /dev/null
@@ -1,227 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.framing.AMQShortString;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Queue;
-
-public class SubscriptionTestHelper implements Subscription
-{
- private final List<QueueEntry> messages;
- private final Object key;
- private boolean isSuspended;
-
- public SubscriptionTestHelper(Object key)
- {
- this(key, new ArrayList<QueueEntry>());
- }
-
- public SubscriptionTestHelper(final Object key, final boolean isSuspended)
- {
- this(key);
- setSuspended(isSuspended);
- }
-
- SubscriptionTestHelper(Object key, List<QueueEntry> messages)
- {
- this.key = key;
- this.messages = messages;
- }
-
- List<QueueEntry> getMessages()
- {
- return messages;
- }
-
- public void setQueue(AMQQueue queue)
- {
-
- }
-
- public void send(QueueEntry msg)
- {
- messages.add(msg);
- }
-
- public void setSuspended(boolean suspended)
- {
- isSuspended = suspended;
- }
-
- public boolean isSuspended()
- {
- return isSuspended;
- }
-
- public boolean wouldSuspend(QueueEntry msg)
- {
- return isSuspended;
- }
-
- public void addToResendQueue(QueueEntry msg)
- {
- //no-op
- }
-
- public void getSendLock()
- {
- return;
- }
-
- public void releaseSendLock()
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void resend(final QueueEntry entry)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void restoreCredit(final QueueEntry queueEntry)
- {
-
- }
-
- public void setStateListener(final StateListener listener)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public State getState()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public QueueEntry getLastSeenEntry()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean setLastSeenEntry(QueueEntry expected, QueueEntry newValue)
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public AMQChannel getChannel()
- {
- return null;
- }
-
- public void start()
- {
- //no-op
- }
-
- public AMQShortString getConsumerTag()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isActive()
- {
- return false; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public AMQQueue getQueue()
- {
- return null;
- }
-
- public QueueEntry.SubscriptionAcquiredState getOwningState()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void queueDeleted(AMQQueue queue)
- {
- }
-
- public boolean filtersMessages()
- {
- return false;
- }
-
- public boolean hasInterest(QueueEntry msg)
- {
- return true;
- }
-
- public boolean isAutoClose()
- {
- return false;
- }
-
- public Queue<QueueEntry> getPreDeliveryQueue()
- {
- return null;
- }
-
- public Queue<QueueEntry> getResendQueue()
- {
- return null;
- }
-
- public Queue<QueueEntry> getNextQueue(Queue<QueueEntry> messages)
- {
- return messages;
- }
-
- public void enqueueForPreDelivery(QueueEntry msg, boolean deliverFirst)
- {
- //no-op
- }
-
- public void close()
- {
- //no-op
- }
-
- public boolean isClosed()
- {
- return false;
- }
-
- public boolean isBrowser()
- {
- return false;
- }
-
- public int hashCode()
- {
- return key.hashCode();
- }
-
- public boolean equals(Object o)
- {
- return o instanceof SubscriptionTestHelper && ((SubscriptionTestHelper) o).key.equals(key);
- }
-
- public String toString()
- {
- return key.toString();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.java
deleted file mode 100644
index c60748b5cb..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.java
+++ /dev/null
@@ -1,213 +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.
- *
- */
-
-package org.apache.qpid.server.queue;
-
-import junit.framework.TestCase;
-import junit.framework.Assert;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
-import org.apache.qpid.url.URLSyntaxException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.log4j.Logger;
-
-import javax.jms.JMSException;
-import javax.jms.Session;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.ConnectionFactory;
-import javax.jms.Connection;
-import javax.jms.Message;
-import javax.naming.spi.InitialContextFactory;
-import javax.naming.Context;
-import javax.naming.NamingException;
-import java.util.Hashtable;
-
-
-/** Test Case provided by client Non-functional Test NF101: heap exhaustion behaviour */
-public class TimeToLiveTest extends TestCase
-{
- private static final Logger _logger = Logger.getLogger(TimeToLiveTest.class);
-
-
- protected final String BROKER = "vm://:1";
- protected final String VHOST = "/test";
- protected final String QUEUE = "TimeToLiveQueue";
-
- private final long TIME_TO_LIVE = 1000L;
-
- private static final int MSG_COUNT = 50;
- private static final long SERVER_TTL_TIMEOUT = 60000L;
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- if (usingInVMBroker())
- {
- TransportConnection.createVMBroker(1);
- }
-
-
- }
-
- private boolean usingInVMBroker()
- {
- return BROKER.startsWith("vm://");
- }
-
- protected void tearDown() throws Exception
- {
- if (usingInVMBroker())
- {
- TransportConnection.killVMBroker(1);
- ApplicationRegistry.remove(1);
- }
- super.tearDown();
- }
-
- public void testPassiveTTL() throws JMSException, NamingException
- {
- InitialContextFactory factory = new PropertiesFileInitialContextFactory();
-
- Hashtable<String, String> env = new Hashtable<String, String>();
-
- env.put("connectionfactory.connection", "amqp://guest:guest@TTL_TEST_ID" + VHOST + "?brokerlist='" + BROKER + "'");
- env.put("queue.queue", QUEUE);
-
- Context context = factory.getInitialContext(env);
-
- Queue queue = (Queue) context.lookup("queue");
-
- //Create Client 1
- Connection clientConnection = ((ConnectionFactory) context.lookup("connection")).createConnection();
-
- Session clientSession = clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- MessageConsumer consumer = clientSession.createConsumer(queue);
-
- //Create Producer
- Connection producerConnection = ((ConnectionFactory) context.lookup("connection")).createConnection();
-
- producerConnection.start();
-
- Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- MessageProducer producer = producerSession.createProducer(queue);
-
- //Set TTL
- int msg = 0;
- producer.send(nextMessage(String.valueOf(msg), true, producerSession, producer));
-
- producer.setTimeToLive(TIME_TO_LIVE);
-
- for (; msg < MSG_COUNT - 2; msg++)
- {
- producer.send(nextMessage(String.valueOf(msg), false, producerSession, producer));
- }
-
- //Reset TTL
- producer.setTimeToLive(0L);
- producer.send(nextMessage(String.valueOf(msg), false, producerSession, producer));
-
- try
- {
- // Sleep to ensure TTL reached
- Thread.sleep(2000);
- }
- catch (InterruptedException e)
- {
-
- }
-
- clientConnection.start();
-
- //Receive Message 0
- Message received = consumer.receive(1000);
- Assert.assertNotNull("First message not received", received);
- Assert.assertTrue("First message doesn't have first set.", received.getBooleanProperty("first"));
- Assert.assertEquals("First message has incorrect TTL.", 0L, received.getLongProperty("TTL"));
-
-
- received = consumer.receive(1000);
- Assert.assertNotNull("Final message not received", received);
- Assert.assertFalse("Final message has first set.", received.getBooleanProperty("first"));
- Assert.assertEquals("Final message has incorrect TTL.", 0L, received.getLongProperty("TTL"));
-
- received = consumer.receive(1000);
- Assert.assertNull("More messages received", received);
-
- clientConnection.close();
-
- producerConnection.close();
- }
-
- private Message nextMessage(String msg, boolean first, Session producerSession, MessageProducer producer) throws JMSException
- {
- Message send = producerSession.createTextMessage("Message " + msg);
- send.setBooleanProperty("first", first);
- send.setLongProperty("TTL", producer.getTimeToLive());
- return send;
- }
-
-
- /**
- * Tests the expired messages get actively deleted even on queues which have no consumers
- */
- public void testActiveTTL() throws URLSyntaxException, AMQException, JMSException, InterruptedException
- {
- Connection producerConnection = new AMQConnection(BROKER,"guest","guest","activeTTLtest","test");
- AMQSession producerSession = (AMQSession) producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Queue queue = producerSession.createTemporaryQueue();
- producerSession.declareAndBind((AMQDestination) queue);
- MessageProducer producer = producerSession.createProducer(queue);
- producer.setTimeToLive(1000L);
-
- // send Messages
- for(int i = 0; i < MSG_COUNT; i++)
- {
- producer.send(producerSession.createTextMessage("Message: "+i));
- }
- long failureTime = System.currentTimeMillis() + 2*SERVER_TTL_TIMEOUT;
-
- // check Queue depth for up to TIMEOUT seconds
- long messageCount;
-
- do
- {
- Thread.sleep(100);
- messageCount = producerSession.getQueueDepth((AMQDestination) queue);
- }
- while(messageCount > 0L && System.currentTimeMillis() < failureTime);
-
- assertEquals("Messages not automatically expired: ", 0L, messageCount);
-
- producer.close();
- producerSession.close();
- producerConnection.close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
deleted file mode 100644
index e6c9f43ffb..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
+++ /dev/null
@@ -1,656 +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.
- *
- *
- */
-
-package org.apache.qpid.server.security.acl;
-
-import junit.framework.TestCase;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.client.*;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.jms.ConnectionListener;
-import org.apache.qpid.url.URLSyntaxException;
-
-import javax.jms.*;
-import javax.jms.IllegalStateException;
-import java.io.File;
-
-public class SimpleACLTest extends QpidTestCase implements ConnectionListener
-{
- private String BROKER = "vm://:1";//"tcp://localhost:5672";
-
- public void setUp() throws Exception
- {
- //Shutdown the QTC broker
- stopBroker();
-
- // Initialise ACLs.
- final String QpidExampleHome = System.getProperty("QPID_EXAMPLE_HOME");
- final File defaultaclConfigFile = new File(QpidExampleHome, "etc/acl.config.xml");
-
- if (!defaultaclConfigFile.exists())
- {
- System.err.println("Configuration file not found:" + defaultaclConfigFile);
- fail("Configuration file not found:" + defaultaclConfigFile);
- }
-
- if (System.getProperty("QPID_HOME") == null)
- {
- fail("QPID_HOME not set");
- }
-
- ConfigurationFileApplicationRegistry config = new ConfigurationFileApplicationRegistry(defaultaclConfigFile);
-
- // This is a bit evil it should be updated with QPID-1103
- config.getConfiguration().setProperty("management.enabled", "false");
-
- ApplicationRegistry.initialise(config, 1);
-
- TransportConnection.createVMBroker(1);
- }
-
- public void tearDown()
- {
- TransportConnection.killAllVMBrokers();
- ApplicationRegistry.remove(1);
- }
-
- public String createConnectionString(String username, String password, String broker)
- {
-
- return "amqp://" + username + ":" + password + "@clientid/test?brokerlist='" + broker + "?retries='0''";
- }
-
- public void testAccessAuthorized() throws AMQException, URLSyntaxException
- {
- try
- {
- Connection conn = createConnection("client", "guest");
-
- Session sesh = conn.createSession(true, Session.SESSION_TRANSACTED);
-
- conn.start();
-
- //Do something to show connection is active.
- sesh.rollback();
-
- conn.close();
- }
- catch (Exception e)
- {
- fail("Connection was not created due to:" + e.getMessage());
- }
- }
-
- public void testAccessNoRights() throws URLSyntaxException, JMSException
- {
- try
- {
- Connection conn = createConnection("guest", "guest");
-
- //Attempt to do do things to test connection.
- Session sesh = conn.createSession(true, Session.SESSION_TRANSACTED);
- conn.start();
- sesh.rollback();
-
- conn.close();
- fail("Connection was created.");
- }
- catch (AMQException amqe)
- {
- Throwable cause = amqe.getCause();
- assertEquals("Exception was wrong type", AMQAuthenticationException.class, cause.getClass());
- assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
- }
- }
-
- public void testClientConsumeFromTempQueueValid() throws AMQException, URLSyntaxException
- {
- try
- {
- Connection conn = createConnection("client", "guest");
-
- Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- sesh.createConsumer(sesh.createTemporaryQueue());
-
- conn.close();
- }
- catch (Exception e)
- {
- fail("Test failed due to:" + e.getMessage());
- }
- }
-
- public void testClientConsumeFromNamedQueueInvalid() throws AMQException, URLSyntaxException
- {
- try
- {
- Connection conn = createConnection("client", "guest");
-
- //Prevent Failover
- ((AMQConnection) conn).setConnectionListener(this);
-
- Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- sesh.createConsumer(sesh.createQueue("IllegalQueue"));
- fail("Test failed as consumer was created.");
- //conn will be automatically closed
- }
- catch (JMSException e)
- {
- Throwable cause = e.getLinkedException();
-
- assertNotNull("There was no liked exception", cause);
- assertEquals("Wrong linked exception type", AMQAuthenticationException.class, cause.getClass());
- assertEquals("Incorrect error code received", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
- }
- }
-
- public void testClientCreateTemporaryQueue() throws JMSException, URLSyntaxException
- {
- try
- {
- Connection conn = createConnection("client", "guest");
-
- Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- //Create Temporary Queue - can't use the createTempQueue as QueueName is null.
- ((AMQSession) sesh).createQueue(new AMQShortString("doesnt_matter_as_autodelete_means_tmp"),
- true, false, false);
-
- conn.close();
- }
- catch (Exception e)
- {
- fail("Test failed due to:" + e.getMessage());
- }
- }
-
- public void testClientCreateNamedQueue() throws JMSException, URLSyntaxException, AMQException
- {
- try
- {
- Connection conn = createConnection("client", "guest");
-
- Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- //Create a Named Queue
- ((AMQSession) sesh).createQueue(new AMQShortString("IllegalQueue"), false, false, false);
-
- fail("Test failed as Queue creation succeded.");
- //conn will be automatically closed
- }
- catch (AMQAuthenticationException amqe)
- {
- assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) amqe).getErrorCode().getCode());
- }
- }
-
- public void testClientPublishUsingTransactionSuccess() throws AMQException, URLSyntaxException
- {
- try
- {
- Connection conn = createConnection("client", "guest");
-
- ((AMQConnection) conn).setConnectionListener(this);
-
- Session sesh = conn.createSession(true, Session.SESSION_TRANSACTED);
-
- conn.start();
-
- MessageProducer sender = sesh.createProducer(sesh.createQueue("example.RequestQueue"));
-
- sender.send(sesh.createTextMessage("test"));
-
- //Send the message using a transaction as this will allow us to retrieve any errors that occur on the broker.
- sesh.commit();
-
- conn.close();
- }
- catch (Exception e)
- {
- fail("Test publish failed:" + e);
- }
- }
-
- public void testClientPublishValidQueueSuccess() throws AMQException, URLSyntaxException
- {
- try
- {
- Connection conn = createConnection("client", "guest");
-
- ((AMQConnection) conn).setConnectionListener(this);
-
- Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- MessageProducer sender = ((AMQSession) sesh).createProducer(null);
-
- Queue queue = sesh.createQueue("example.RequestQueue");
-
- // Send a message that we will wait to be sent, this should give the broker time to process the msg
- // before we finish this test. Message is set !immed !mand as the queue is invalid so want to test ACLs not
- // queue existence.
- ((org.apache.qpid.jms.MessageProducer) sender).send(queue, sesh.createTextMessage("test"),
- DeliveryMode.NON_PERSISTENT, 0, 0L, false, false, true);
-
- conn.close();
- }
- catch (Exception e)
- {
- fail("Test publish failed:" + e);
- }
- }
-
- public void testClientPublishInvalidQueueSuccess() throws AMQException, URLSyntaxException, JMSException
- {
- try
- {
- Connection conn = createConnection("client", "guest");
-
- ((AMQConnection) conn).setConnectionListener(this);
-
- Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- MessageProducer sender = ((AMQSession) session).createProducer(null);
-
- Queue queue = session.createQueue("Invalid");
-
- // Send a message that we will wait to be sent, this should give the broker time to close the connection
- // before we finish this test. Message is set !immed !mand as the queue is invalid so want to test ACLs not
- // queue existence.
- ((org.apache.qpid.jms.MessageProducer) sender).send(queue, session.createTextMessage("test"),
- DeliveryMode.NON_PERSISTENT, 0, 0L, false, false, true);
-
- // Test the connection with a valid consumer
- // This may fail as the session may be closed before the queue or the consumer created.
- Queue temp = session.createTemporaryQueue();
-
- session.createConsumer(temp).close();
-
- //Connection should now be closed and will throw the exception caused by the above send
- conn.close();
-
- fail("Close is not expected to succeed.");
- }
- catch (JMSException e)
- {
- Throwable cause = e.getLinkedException();
- if (!(cause instanceof AMQAuthenticationException))
- {
- e.printStackTrace();
- }
- assertEquals("Incorrect exception", AMQAuthenticationException.class, cause.getClass());
- assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
- }
- }
-
- public void testServerConsumeFromNamedQueueValid() throws AMQException, URLSyntaxException
- {
- try
- {
- Connection conn = createConnection("server", "guest");
-
- Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- sesh.createConsumer(sesh.createQueue("example.RequestQueue"));
-
- conn.close();
- }
- catch (Exception e)
- {
- fail("Test failed due to:" + e.getMessage());
- }
- }
-
- public void testServerConsumeFromNamedQueueInvalid() throws AMQException, URLSyntaxException
- {
- try
- {
- Connection conn = createConnection("client", "guest");
-
- Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- sesh.createConsumer(sesh.createQueue("Invalid"));
-
- fail("Test failed as consumer was created.");
- //conn will be automatically closed
- }
- catch (JMSException e)
- {
- Throwable cause = e.getLinkedException();
-
- assertNotNull("There was no liked exception", cause);
- assertEquals("Wrong linked exception type", AMQAuthenticationException.class, cause.getClass());
- assertEquals("Incorrect error code received", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
- }
- }
-
- public void testServerConsumeFromTemporaryQueue() throws AMQException, URLSyntaxException
- {
- try
- {
- Connection conn = createConnection("server","guest");
-
- Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- sesh.createConsumer(sesh.createTemporaryQueue());
- fail("Test failed as consumer was created.");
- //conn will be automatically closed
- }
- catch (JMSException e)
- {
- Throwable cause = e.getLinkedException();
-
- assertNotNull("There was no liked exception", cause);
- assertEquals("Wrong linked exception type", AMQAuthenticationException.class, cause.getClass());
- assertEquals("Incorrect error code received", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
- }
- }
-
- private Connection createConnection(String username, String password) throws AMQException
- {
- AMQConnection connection = null;
- try
- {
- connection = new AMQConnection(createConnectionString(username, password, BROKER));
- }
- catch (URLSyntaxException e)
- {
- // This should never happen as we generate the URLs.
- fail(e.getMessage());
- }
-
- //Prevent Failover
- connection.setConnectionListener(this);
-
- return (Connection)connection;
- }
-
- public void testServerCreateNamedQueueValid() throws JMSException, URLSyntaxException
- {
- try
- {
- Connection conn = createConnection("server", "guest");
-
- Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- //Create Temporary Queue
- ((AMQSession) sesh).createQueue(new AMQShortString("example.RequestQueue"), false, false, false);
-
- conn.close();
- }
- catch (Exception e)
- {
- fail("Test failed due to:" + e.getMessage());
- }
- }
-
- public void testServerCreateNamedQueueInvalid() throws JMSException, URLSyntaxException, AMQException
- {
- try
- {
- Connection conn = createConnection("server", "guest");
-
- Session sesh = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- //Create a Named Queue
- ((AMQSession) sesh).createQueue(new AMQShortString("IllegalQueue"), false, false, false);
-
- fail("Test failed as creation succeded.");
- //conn will be automatically closed
- }
- catch (AMQAuthenticationException amqe)
- {
- assertEquals("Incorrect error code thrown", 403, amqe.getErrorCode().getCode());
- }
- }
-
- public void testServerCreateTemporaryQueueInvalid() throws JMSException, URLSyntaxException, AMQException
- {
- try
- {
- Connection conn = createConnection("server", "guest");
-
- Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- session.createTemporaryQueue();
-
- fail("Test failed as creation succeded.");
- //conn will be automatically closed
- }
- catch (JMSException e)
- {
- Throwable cause = e.getLinkedException();
-
- assertNotNull("There was no liked exception", cause);
- assertEquals("Wrong linked exception type", AMQAuthenticationException.class, cause.getClass());
- assertEquals("Incorrect error code received", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
- }
- }
-
- public void testServerCreateAutoDeleteQueueInvalid() throws JMSException, URLSyntaxException, AMQException
- {
- Connection connection = null;
- try
- {
- connection = createConnection("server", "guest");
-
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- connection.start();
-
- ((AMQSession) session).createQueue(new AMQShortString("again_ensure_auto_delete_queue_for_temporary"),
- true, false, false);
-
- fail("Test failed as creation succeded.");
- //connection will be automatically closed
- }
- catch (AMQAuthenticationException amqe)
- {
- assertEquals("Incorrect error code thrown", 403, amqe.getErrorCode().getCode());
- }
- }
-
- /**
- * This test uses both the cilent and sender to validate that the Server is able to publish to a temporary queue.
- * The reason the client must be in volved is that the Serve is unable to create its own Temporary Queues.
- *
- * @throws AMQException
- * @throws URLSyntaxException
- * @throws JMSException
- */
- public void testServerPublishUsingTransactionSuccess() throws AMQException, URLSyntaxException, JMSException
- {
- //Set up the Server
- Connection serverConnection = createConnection("server", "guest");
-
- ((AMQConnection) serverConnection).setConnectionListener(this);
-
- Session serverSession = serverConnection.createSession(true, Session.SESSION_TRANSACTED);
-
- Queue requestQueue = serverSession.createQueue("example.RequestQueue");
-
- MessageConsumer server = serverSession.createConsumer(requestQueue);
-
- serverConnection.start();
-
- //Set up the consumer
- Connection clientConnection = createConnection("client", "guest");
-
- //Send a test mesage
- Session clientSession = clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Queue responseQueue = clientSession.createTemporaryQueue();
-
- MessageConsumer clientResponse = clientSession.createConsumer(responseQueue);
-
- clientConnection.start();
-
- Message request = clientSession.createTextMessage("Request");
-
- assertNotNull("Response Queue is null", responseQueue);
-
- request.setJMSReplyTo(responseQueue);
-
- clientSession.createProducer(requestQueue).send(request);
-
- try
- {
- Message msg = null;
-
- msg = server.receive(2000);
-
- while (msg != null && !((TextMessage) msg).getText().equals("Request"))
- {
- msg = server.receive(2000);
- }
-
- assertNotNull("Message not received", msg);
-
- assertNotNull("Reply-To is Null", msg.getJMSReplyTo());
-
- MessageProducer sender = serverSession.createProducer(msg.getJMSReplyTo());
-
- sender.send(serverSession.createTextMessage("Response"));
-
- //Send the message using a transaction as this will allow us to retrieve any errors that occur on the broker.
- serverSession.commit();
-
-
-
- //Ensure Response is received.
- Message clientResponseMsg = clientResponse.receive(2000);
- assertNotNull("Client did not receive response message,", clientResponseMsg);
- assertEquals("Incorrect message received", "Response", ((TextMessage) clientResponseMsg).getText());
-
- }
- catch (Exception e)
- {
- fail("Test publish failed:" + e);
- }
- finally
- {
- try
- {
- serverConnection.close();
- }
- finally
- {
- clientConnection.close();
- }
- }
- }
-
- public void testServerPublishInvalidQueueSuccess() throws AMQException, URLSyntaxException, JMSException
- {
- try
- {
- Connection conn = createConnection("server", "guest");
-
- ((AMQConnection) conn).setConnectionListener(this);
-
- Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- conn.start();
-
- MessageProducer sender = ((AMQSession) session).createProducer(null);
-
- Queue queue = session.createQueue("Invalid");
-
- // Send a message that we will wait to be sent, this should give the broker time to close the connection
- // before we finish this test. Message is set !immed !mand as the queue is invalid so want to test ACLs not
- // queue existence.
- ((org.apache.qpid.jms.MessageProducer) sender).send(queue, session.createTextMessage("test"),
- DeliveryMode.NON_PERSISTENT, 0, 0L, false, false, true);
-
- // Test the connection with a valid consumer
- // This may not work as the session may be closed before the queue or consumer creation can occur.
- // The correct JMSexception with linked error will only occur when the close method is recevied whilst in
- // the failover safe block
- session.createConsumer(session.createQueue("example.RequestQueue")).close();
-
- //Connection should now be closed and will throw the exception caused by the above send
- conn.close();
-
- fail("Close is not expected to succeed.");
- }
- catch (JMSException e)
- {
- Throwable cause = e.getLinkedException();
-
- assertEquals("Incorrect exception", AMQAuthenticationException.class, cause.getClass());
- assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
- }
- }
-
- // Connection Listener Interface - Used here to block failover
-
- public void bytesSent(long count)
- {
- }
-
- public void bytesReceived(long count)
- {
- }
-
- public boolean preFailover(boolean redirect)
- {
- //Prevent failover.
- return false;
- }
-
- public boolean preResubscribe()
- {
- return false;
- }
-
- public void failoverComplete()
- {
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java
deleted file mode 100644
index f08a15a8a7..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java
+++ /dev/null
@@ -1,155 +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.
- *
- */
-package org.apache.qpid.server.store;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.server.queue.MessageMetaData;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.exchange.Exchange;
-
-import java.util.List;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * A message store that does nothing. Designed to be used in tests that do not want to use any message store
- * functionality.
- */
-public class SkeletonMessageStore implements MessageStore
-{
- private final AtomicLong _messageId = new AtomicLong(1);
-
- public void configure(String base, Configuration config) throws Exception
- {
- }
-
- public void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void close() throws Exception
- {
- }
-
- public void removeMessage(StoreContext s, Long messageId)
- {
- }
-
- public void createExchange(Exchange exchange) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void removeExchange(Exchange exchange) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void bindQueue(Exchange exchange, AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void unbindQueue(Exchange exchange, AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public void createQueue(AMQQueue queue) throws AMQException
- {
- }
-
- public void createQueue(AMQQueue queue, FieldTable arguments) throws AMQException
- {
- }
-
- public void beginTran(StoreContext s) throws AMQException
- {
- }
-
- public boolean inTran(StoreContext sc)
- {
- return false;
- }
-
- public void commitTran(StoreContext storeContext) throws AMQException
- {
- }
-
- public void abortTran(StoreContext storeContext) throws AMQException
- {
- }
-
- public List<AMQQueue> createQueues() throws AMQException
- {
- return null;
- }
-
- public Long getNewMessageId()
- {
- return _messageId.getAndIncrement();
- }
-
- public void storeContentBodyChunk(StoreContext sc, Long messageId, int index, ContentChunk contentBody, boolean lastContentBody) throws AMQException
- {
-
- }
-
- public void storeMessageMetaData(StoreContext sc, Long messageId, MessageMetaData messageMetaData) throws AMQException
- {
-
- }
-
- public MessageMetaData getMessageMetaData(StoreContext s,Long messageId) throws AMQException
- {
- return null;
- }
-
- public ContentChunk getContentBodyChunk(StoreContext s,Long messageId, int index) throws AMQException
- {
- return null;
- }
-
- public boolean isPersistent()
- {
- return false;
- }
-
- public void removeQueue(final AMQQueue queue) throws AMQException
- {
-
- }
-
- public void enqueueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException
- {
-
- }
-
- public void dequeueMessage(StoreContext context, final AMQQueue queue, Long messageId) throws AMQException
- {
-
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
deleted file mode 100644
index 92a142e402..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
+++ /dev/null
@@ -1,297 +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.
- *
- */
-package org.apache.qpid.server.store;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.MessageMetaData;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-public class SlowMessageStore implements MessageStore
-{
- private static final Logger _logger = Logger.getLogger(SlowMessageStore.class);
- private static final String DELAYS = "delays";
- private HashMap<String, Long> _preDelays = new HashMap<String, Long>();
- private HashMap<String, Long> _postDelays = new HashMap<String, Long>();
- private long _defaultDelay = 0L;
- private MessageStore _realStore = new MemoryMessageStore();
- private static final String PRE = "pre";
- private static final String POST = "post";
- private String DEFAULT_DELAY = "default";
-
- public void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception
- {
- _logger.info("Starting SlowMessageStore on Virtualhost:" + virtualHost.getName());
- Configuration delays = config.subset(base + "." + DELAYS);
-
- configureDelays(delays);
-
- String messageStoreClass = config.getString(base + ".store.class");
-
- if (delays.containsKey(DEFAULT_DELAY))
- {
- _defaultDelay = delays.getLong(DEFAULT_DELAY);
- }
-
- if (messageStoreClass != null)
- {
- Class clazz = Class.forName(messageStoreClass);
-
- Object o = clazz.newInstance();
-
- if (!(o instanceof MessageStore))
- {
- throw new ClassCastException("Message store class must implement " + MessageStore.class + ". Class " + clazz +
- " does not.");
- }
- _realStore = (MessageStore) o;
- _realStore.configure(virtualHost, base + ".store", config);
- }
- else
- {
- _realStore.configure(virtualHost, base + ".store", config);
- }
- }
-
- private void configureDelays(Configuration config)
- {
- Iterator delays = config.getKeys();
-
- while (delays.hasNext())
- {
- String key = (String) delays.next();
- if (key.endsWith(PRE))
- {
- _preDelays.put(key.substring(0, key.length() - PRE.length() - 1), config.getLong(key));
- }
- else if (key.endsWith(POST))
- {
- _postDelays.put(key.substring(0, key.length() - POST.length() - 1), config.getLong(key));
- }
- }
- }
-
- private void doPostDelay(String method)
- {
- long delay = lookupDelay(_postDelays, method);
- doDelay(delay);
- }
-
- private void doPreDelay(String method)
- {
- long delay = lookupDelay(_preDelays, method);
- doDelay(delay);
- }
-
- private long lookupDelay(HashMap<String, Long> delays, String method)
- {
- Long delay = delays.get(method);
- return (delay == null) ? _defaultDelay : delay;
- }
-
- private void doDelay(long delay)
- {
- if (delay > 0)
- {
- long start = System.nanoTime();
- try
- {
-
- Thread.sleep(delay);
- }
- catch (InterruptedException e)
- {
- _logger.warn("Interrupted : " + e);
- }
-
- long slept = (System.nanoTime() - start) / 1000000;
-
- if (slept >= delay)
- {
- _logger.info("Done sleep for:" + slept+":"+delay);
- }
- else
- {
- _logger.info("Only sleep for:" + slept + " re-sleeping");
- doDelay(delay - slept);
- }
- }
- }
-
- // ***** MessageStore Interface.
-
- public void close() throws Exception
- {
- doPreDelay("close");
- _realStore.close();
- doPostDelay("close");
- }
-
- public void removeMessage(StoreContext storeContext, Long messageId) throws AMQException
- {
- doPreDelay("removeMessage");
- _realStore.removeMessage(storeContext, messageId);
- doPostDelay("removeMessage");
- }
-
- public void createExchange(Exchange exchange) throws AMQException
- {
- doPreDelay("createExchange");
- _realStore.createExchange(exchange);
- doPostDelay("createExchange");
- }
-
- public void removeExchange(Exchange exchange) throws AMQException
- {
- doPreDelay("removeExchange");
- _realStore.removeExchange(exchange);
- doPostDelay("removeExchange");
- }
-
- public void bindQueue(Exchange exchange, AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- doPreDelay("bindQueue");
- _realStore.bindQueue(exchange, routingKey, queue, args);
- doPostDelay("bindQueue");
- }
-
- public void unbindQueue(Exchange exchange, AMQShortString routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- doPreDelay("unbindQueue");
- _realStore.unbindQueue(exchange, routingKey, queue, args);
- doPostDelay("unbindQueue");
- }
-
- public void createQueue(AMQQueue queue) throws AMQException
- {
- createQueue(queue, null);
- }
-
- public void createQueue(AMQQueue queue, FieldTable arguments) throws AMQException
- {
- doPreDelay("createQueue");
- _realStore.createQueue(queue, arguments);
- doPostDelay("createQueue");
- }
-
- public void removeQueue(AMQQueue queue) throws AMQException
- {
- doPreDelay("removeQueue");
- _realStore.removeQueue(queue);
- doPostDelay("removeQueue");
- }
-
- public void enqueueMessage(StoreContext context, AMQQueue queue, Long messageId) throws AMQException
- {
- doPreDelay("enqueueMessage");
- _realStore.enqueueMessage(context, queue, messageId);
- doPostDelay("enqueueMessage");
- }
-
- public void dequeueMessage(StoreContext context, AMQQueue queue, Long messageId) throws AMQException
- {
- doPreDelay("dequeueMessage");
- _realStore.dequeueMessage(context, queue, messageId);
- doPostDelay("dequeueMessage");
- }
-
- public void beginTran(StoreContext context) throws AMQException
- {
- doPreDelay("beginTran");
- _realStore.beginTran(context);
- doPostDelay("beginTran");
- }
-
- public void commitTran(StoreContext context) throws AMQException
- {
- doPreDelay("commitTran");
- _realStore.commitTran(context);
- doPostDelay("commitTran");
- }
-
- public void abortTran(StoreContext context) throws AMQException
- {
- doPreDelay("abortTran");
- _realStore.abortTran(context);
- doPostDelay("abortTran");
- }
-
- public boolean inTran(StoreContext context)
- {
- doPreDelay("inTran");
- boolean b = _realStore.inTran(context);
- doPostDelay("inTran");
- return b;
- }
-
- public Long getNewMessageId()
- {
- doPreDelay("getNewMessageId");
- Long l = _realStore.getNewMessageId();
- doPostDelay("getNewMessageId");
- return l;
- }
-
- public void storeContentBodyChunk(StoreContext context, Long messageId, int index, ContentChunk contentBody, boolean lastContentBody) throws AMQException
- {
- doPreDelay("storeContentBodyChunk");
- _realStore.storeContentBodyChunk(context, messageId, index, contentBody, lastContentBody);
- doPostDelay("storeContentBodyChunk");
- }
-
- public void storeMessageMetaData(StoreContext context, Long messageId, MessageMetaData messageMetaData) throws AMQException
- {
- doPreDelay("storeMessageMetaData");
- _realStore.storeMessageMetaData(context, messageId, messageMetaData);
- doPostDelay("storeMessageMetaData");
- }
-
- public MessageMetaData getMessageMetaData(StoreContext context, Long messageId) throws AMQException
- {
- doPreDelay("getMessageMetaData");
- MessageMetaData mmd = _realStore.getMessageMetaData(context, messageId);
- doPostDelay("getMessageMetaData");
- return mmd;
- }
-
- public ContentChunk getContentBodyChunk(StoreContext context, Long messageId, int index) throws AMQException
- {
- doPreDelay("getContentBodyChunk");
- ContentChunk c = _realStore.getContentBodyChunk(context, messageId, index);
- doPostDelay("getContentBodyChunk");
- return c;
- }
-
- public boolean isPersistent()
- {
- return _realStore.isPersistent();
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestMemoryMessageStore.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestMemoryMessageStore.java
deleted file mode 100644
index 4e48435962..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestMemoryMessageStore.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-package org.apache.qpid.server.store;
-
-import org.apache.qpid.server.queue.MessageMetaData;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.List;
-
-/**
- * Adds some extra methods to the memory message store for testing purposes.
- */
-public class TestMemoryMessageStore extends MemoryMessageStore
-{
- public TestMemoryMessageStore()
- {
- _metaDataMap = new ConcurrentHashMap<Long, MessageMetaData>();
- _contentBodyMap = new ConcurrentHashMap<Long, List<ContentChunk>>();
- }
-
- public ConcurrentMap<Long, MessageMetaData> getMessageMetaDataMap()
- {
- return _metaDataMap;
- }
-
- public ConcurrentMap<Long, List<ContentChunk>> getContentBodyMap()
- {
- return _contentBodyMap;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java
deleted file mode 100644
index 2346660d25..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java
+++ /dev/null
@@ -1,169 +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.
- *
- */
-package org.apache.qpid.server.store;
-
-import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.MessageHandleFactory;
-import org.apache.qpid.server.queue.AMQMessageHandle;
-
-/**
- * Tests that reference counting works correctly with AMQMessage and the message store
- */
-public class TestReferenceCounting extends TestCase
-{
- private TestMemoryMessageStore _store;
-
- private StoreContext _storeContext = new StoreContext();
-
-
- protected void setUp() throws Exception
- {
- super.setUp();
- _store = new TestMemoryMessageStore();
- }
-
- /**
- * Check that when the reference count is decremented the message removes itself from the store
- */
- public void testMessageGetsRemoved() throws AMQException
- {
- ContentHeaderBody chb = createPersistentContentHeader();
-
- MessagePublishInfo info = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public void setExchange(AMQShortString exchange)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return null;
- }
- };
-
-
- final long messageId = _store.getNewMessageId();
- AMQMessageHandle messageHandle = (new MessageHandleFactory()).createMessageHandle(messageId, _store, true);
- messageHandle.setPublishAndContentHeaderBody(_storeContext,info, chb);
- AMQMessage message = new AMQMessage(messageHandle,
- _storeContext,info);
-
- message = message.takeReference();
-
- // we call routing complete to set up the handle
- // message.routingComplete(_store, _storeContext, new MessageHandleFactory());
-
-
- assertEquals(1, _store.getMessageMetaDataMap().size());
- message.decrementReference(_storeContext);
- assertEquals(1, _store.getMessageMetaDataMap().size());
- }
-
- private ContentHeaderBody createPersistentContentHeader()
- {
- ContentHeaderBody chb = new ContentHeaderBody();
- BasicContentHeaderProperties bchp = new BasicContentHeaderProperties();
- bchp.setDeliveryMode((byte)2);
- chb.properties = bchp;
- return chb;
- }
-
- public void testMessageRemains() throws AMQException
- {
-
- MessagePublishInfo info = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public void setExchange(AMQShortString exchange)
- {
- //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return null;
- }
- };
-
- final Long messageId = _store.getNewMessageId();
- final ContentHeaderBody chb = createPersistentContentHeader();
- AMQMessageHandle messageHandle = (new MessageHandleFactory()).createMessageHandle(messageId, _store, true);
- messageHandle.setPublishAndContentHeaderBody(_storeContext,info,chb);
- AMQMessage message = new AMQMessage(messageHandle,
- _storeContext,
- info);
-
-
- message = message.takeReference();
- // we call routing complete to set up the handle
- // message.routingComplete(_store, _storeContext, new MessageHandleFactory());
-
-
-
- assertEquals(1, _store.getMessageMetaDataMap().size());
- message = message.takeReference();
- message.decrementReference(_storeContext);
- assertEquals(1, _store.getMessageMetaDataMap().size());
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TestReferenceCounting.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java
deleted file mode 100644
index 84d3d313d1..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java
+++ /dev/null
@@ -1,306 +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.
- *
- */
-package org.apache.qpid.server.txn;
-
-import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.TestMemoryMessageStore;
-import org.apache.qpid.server.store.StoreContext;
-
-import java.util.LinkedList;
-import java.util.NoSuchElementException;
-
-public class TxnBufferTest extends TestCase
-{
- private final LinkedList<MockOp> ops = new LinkedList<MockOp>();
-
- public void testCommit() throws AMQException
- {
- MockStore store = new MockStore();
-
- TxnBuffer buffer = new TxnBuffer();
- buffer.enlist(new MockOp().expectPrepare().expectCommit());
- //check relative ordering
- MockOp op = new MockOp().expectPrepare().expectPrepare().expectCommit().expectCommit();
- buffer.enlist(op);
- buffer.enlist(op);
- buffer.enlist(new MockOp().expectPrepare().expectCommit());
-
- buffer.commit(null);
-
- validateOps();
- store.validate();
- }
-
- public void testRollback() throws AMQException
- {
- MockStore store = new MockStore();
-
- TxnBuffer buffer = new TxnBuffer();
- buffer.enlist(new MockOp().expectRollback());
- buffer.enlist(new MockOp().expectRollback());
- buffer.enlist(new MockOp().expectRollback());
-
- buffer.rollback(null);
-
- validateOps();
- store.validate();
- }
-
- public void testCommitWithFailureDuringPrepare() throws AMQException
- {
- MockStore store = new MockStore();
- store.beginTran(null);
-
- TxnBuffer buffer = new TxnBuffer();
- buffer.enlist(new StoreMessageOperation(store));
- buffer.enlist(new MockOp().expectPrepare().expectUndoPrepare());
- buffer.enlist(new TxnTester(store));
- buffer.enlist(new MockOp().expectPrepare().expectUndoPrepare());
- buffer.enlist(new FailedPrepare());
- buffer.enlist(new MockOp());
-
- try
- {
- buffer.commit(null);
- }
- catch (NoSuchElementException e)
- {
-
- }
-
- validateOps();
- store.validate();
- }
-
- public void testCommitWithPersistance() throws AMQException
- {
- MockStore store = new MockStore();
- store.beginTran(null);
- store.expectCommit();
-
- TxnBuffer buffer = new TxnBuffer();
- buffer.enlist(new MockOp().expectPrepare().expectCommit());
- buffer.enlist(new MockOp().expectPrepare().expectCommit());
- buffer.enlist(new MockOp().expectPrepare().expectCommit());
- buffer.enlist(new StoreMessageOperation(store));
- buffer.enlist(new TxnTester(store));
-
- buffer.commit(null);
- validateOps();
- store.validate();
- }
-
- private void validateOps()
- {
- for (MockOp op : ops)
- {
- op.validate();
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TxnBufferTest.class);
- }
-
- class MockOp implements TxnOp
- {
- final Object PREPARE = "PREPARE";
- final Object COMMIT = "COMMIT";
- final Object UNDO_PREPARE = "UNDO_PREPARE";
- final Object ROLLBACK = "ROLLBACK";
-
- private final LinkedList expected = new LinkedList();
-
- MockOp()
- {
- ops.add(this);
- }
-
- public void prepare(StoreContext context)
- {
- assertEquals(expected.removeLast(), PREPARE);
- }
-
- public void commit(StoreContext context)
- {
- assertEquals(expected.removeLast(), COMMIT);
- }
-
- public void undoPrepare()
- {
- assertEquals(expected.removeLast(), UNDO_PREPARE);
- }
-
- public void rollback(StoreContext context)
- {
- assertEquals(expected.removeLast(), ROLLBACK);
- }
-
- private MockOp expect(Object optype)
- {
- expected.addFirst(optype);
- return this;
- }
-
- MockOp expectPrepare()
- {
- return expect(PREPARE);
- }
-
- MockOp expectCommit()
- {
- return expect(COMMIT);
- }
-
- MockOp expectUndoPrepare()
- {
- return expect(UNDO_PREPARE);
- }
-
- MockOp expectRollback()
- {
- return expect(ROLLBACK);
- }
-
- void validate()
- {
- assertEquals("Expected ops were not all invoked", new LinkedList(), expected);
- }
-
- void clear()
- {
- expected.clear();
- }
- }
-
- class MockStore extends TestMemoryMessageStore
- {
- final Object BEGIN = "BEGIN";
- final Object ABORT = "ABORT";
- final Object COMMIT = "COMMIT";
-
- private final LinkedList expected = new LinkedList();
- private boolean inTran;
-
- public void beginTran(StoreContext context) throws AMQException
- {
- inTran = true;
- }
-
- public void commitTran(StoreContext context) throws AMQException
- {
- assertEquals(expected.removeLast(), COMMIT);
- inTran = false;
- }
-
- public void abortTran(StoreContext context) throws AMQException
- {
- assertEquals(expected.removeLast(), ABORT);
- inTran = false;
- }
-
- public boolean inTran(StoreContext context)
- {
- return inTran;
- }
-
- private MockStore expect(Object optype)
- {
- expected.addFirst(optype);
- return this;
- }
-
- MockStore expectBegin()
- {
- return expect(BEGIN);
- }
-
- MockStore expectCommit()
- {
- return expect(COMMIT);
- }
-
- MockStore expectAbort()
- {
- return expect(ABORT);
- }
-
- void clear()
- {
- expected.clear();
- }
-
- void validate()
- {
- assertEquals("Expected ops were not all invoked", new LinkedList(), expected);
- }
- }
-
- class NullOp implements TxnOp
- {
- public void prepare(StoreContext context) throws AMQException
- {
- }
- public void commit(StoreContext context)
- {
- }
- public void undoPrepare()
- {
- }
- public void rollback(StoreContext context)
- {
- }
- }
-
- class FailedPrepare extends NullOp
- {
- public void prepare() throws AMQException
- {
- throw new AMQException(null, "Fail!", null);
- }
- }
-
- class TxnTester extends NullOp
- {
- private final MessageStore store;
-
- private final StoreContext context = new StoreContext();
-
- TxnTester(MessageStore store)
- {
- this.store = store;
- }
-
- public void prepare() throws AMQException
- {
- assertTrue("Expected prepare to be performed under txn", store.inTran(context));
- }
-
- public void commit()
- {
- assertTrue("Expected commit not to be performed under txn", !store.inTran(context));
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/AveragedRun.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/AveragedRun.java
deleted file mode 100644
index 1d17985ab5..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/AveragedRun.java
+++ /dev/null
@@ -1,66 +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.
- *
- */
-package org.apache.qpid.server.util;
-
-import org.apache.qpid.server.util.TimedRun;
-
-import java.util.concurrent.Callable;
-import java.util.Collection;
-
-public class AveragedRun implements Callable<RunStats>
-{
- private final RunStats stats = new RunStats();
- private final TimedRun test;
- private final int iterations;
-
- public AveragedRun(TimedRun test, int iterations)
- {
- this.test = test;
- this.iterations = iterations;
- }
-
- public RunStats call() throws Exception
- {
- for (int i = 0; i < iterations; i++)
- {
- stats.record(test.call());
- }
- return stats;
- }
-
- public void run() throws Exception
- {
- System.out.println(test + ": " + call());
- }
-
- public String toString()
- {
- return test.toString();
- }
-
- static void run(Collection<AveragedRun> tests) throws Exception
- {
- for(AveragedRun test : tests)
- {
- test.run();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/RunStats.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/RunStats.java
deleted file mode 100644
index ec67fc68b3..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/RunStats.java
+++ /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.
- *
- */
-package org.apache.qpid.server.util;
-
-public class RunStats
-{
- private long min = Long.MAX_VALUE;
- private long max;
- private long total;
- private int count;
-
- public void record(long time)
- {
- max = Math.max(time, max);
- min = Math.min(time, min);
- total += time;
- count++;
- }
-
- public long getMin()
- {
- return min;
- }
-
- public long getMax()
- {
- return max;
- }
-
- public long getAverage()
- {
- return total / count;
- }
-
- public String toString()
- {
- return "avg=" + getAverage() + ", min=" + min + ", max=" + max;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/TimedRun.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/TimedRun.java
deleted file mode 100644
index 1291380311..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/server/util/TimedRun.java
+++ /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.
- *
- */
-package org.apache.qpid.server.util;
-
-import java.util.concurrent.Callable;
-
-public abstract class TimedRun implements Callable<Long>
-{
- private final String description;
-
- public TimedRun(String description)
- {
- this.description = description;
- }
-
- public Long call() throws Exception
- {
- setup();
- long start = System.currentTimeMillis();
- run();
- long stop = System.currentTimeMillis();
- teardown();
- return stop - start;
- }
-
- public String toString()
- {
- return description;
- }
-
- protected void setup() throws Exception{}
- protected void teardown() throws Exception{}
- protected abstract void run() throws Exception;
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java
deleted file mode 100644
index 25b9b0ba14..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/CancelTest.java
+++ /dev/null
@@ -1,95 +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.
- *
- */
-
-package org.apache.qpid.test.client;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import javax.jms.Connection;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.Session;
-import java.util.Enumeration;
-
-public class CancelTest extends QpidTestCase
-{
- private static final Logger _logger = Logger.getLogger(CancelTest.class);
-
- private Connection _clientConnection;
- private Session _clientSession;
- private Queue _queue;
-
- public void setUp() throws Exception
- {
-
- super.setUp();
-
- _queue = (Queue) getInitialContext().lookup("queue");
-
- //Create Client
- _clientConnection = getConnection();
-
- _clientConnection.start();
-
- _clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- //Ensure _queue is created
- _clientSession.createConsumer(_queue).close();
- }
-
- /**
- * Simply
- * This test originally did not assert anything but was just checking
- * that a message could be browsed and consumed without throwing an exception.
- * It now checks that at least a message is browsed and that a message is received.
- */
- public void test() throws Exception
- {
- Connection producerConnection = getConnection();
-
- producerConnection.start();
-
- Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageProducer producer = producerSession.createProducer(_queue);
- producer.send(producerSession.createTextMessage());
- producerConnection.close();
-
-
- QueueBrowser browser = _clientSession.createBrowser(_queue);
- Enumeration e = browser.getEnumeration();
-
- assertTrue(e.hasMoreElements());
-
- while (e.hasMoreElements())
- {
- e.nextElement();
- }
-
- browser.close();
-
- MessageConsumer consumer = _clientSession.createConsumer(_queue);
- assertNotNull( consumer.receive() );
- consumer.close();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java
deleted file mode 100644
index d1bcaa1bb8..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/DupsOkTest.java
+++ /dev/null
@@ -1,164 +0,0 @@
-package org.apache.qpid.test.client;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQSession;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/*
-*
-* 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.
-*
-*/
-
-public class DupsOkTest extends QpidTestCase
-{
-
- private Queue _queue;
- // Question why do we need to send so many messages?
- private static final int MSG_COUNT = 4999;
- private CountDownLatch _awaitCompletion = new CountDownLatch(1);
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- _queue = (Queue) getInitialContext().lookup("queue");
-
-
- //Declare the queue
- Connection consumerConnection = getConnection();
- consumerConnection.createSession(false,Session.AUTO_ACKNOWLEDGE).createConsumer(_queue).close();
-
- //Create Producer put some messages on the queue
- Connection producerConnection = getConnection();
-
- producerConnection.start();
-
- Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- MessageProducer producer = producerSession.createProducer(_queue);
-
- for (int count = 1; count <= MSG_COUNT; count++)
- {
- Message msg = producerSession.createTextMessage("Message " + count);
- msg.setIntProperty("count", count);
- producer.send(msg);
- }
-
- producerConnection.close();
- }
-
- /**
- * This test sends x messages and receives them with an async consumer.
- * Waits for all messages to be received or for 60 s
- * and checks whether the queue is empty.
- *
- * @throws Exception
- */
- public void testDupsOK() throws Exception
- {
- //Create Client
- Connection clientConnection = getConnection();
-
- final Session clientSession = clientConnection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
-
- MessageConsumer consumer = clientSession.createConsumer(_queue);
-
- assertEquals("The queue should have msgs at start", MSG_COUNT, ((AMQSession) clientSession).getQueueDepth((AMQDestination) _queue));
-
- clientConnection.start();
-
- consumer.setMessageListener(new MessageListener()
- {
- int _msgCount = 0;
-
- public void onMessage(Message message)
- {
- _msgCount++;
- if (message == null)
- {
- fail("Should not get null messages");
- }
-
- if (message instanceof TextMessage)
- {
- try
- {
- if (message.getIntProperty("count") == MSG_COUNT)
- {
- try
- {
- if(_msgCount != MSG_COUNT)
- {
- assertEquals("Wrong number of messages seen.", MSG_COUNT, _msgCount);
- }
- }
- finally
- {
- //This is the last message so release test.
- _awaitCompletion.countDown();
- }
- }
- }
- catch (JMSException e)
- {
- fail("Unable to get int property 'count'");
- }
- }
- else
- {
- fail("Got wrong message type");
- }
- }
- });
-
- try
- {
- if (!_awaitCompletion.await(120, TimeUnit.SECONDS))
- {
- fail("Test did not complete in 120 seconds");
- }
- }
- catch (InterruptedException e)
- {
- fail("Unable to wait for test completion");
- throw e;
- }
-
- //Close consumer to give broker time to process in bound Acks. As The main thread will be released while
- // before the dispatcher has sent the ack back to the broker.
- consumer.close();
-
- assertEquals("The queue should have 0 msgs left", 0, ((AMQSession) clientSession).getQueueDepth((AMQDestination) _queue));
-
- clientConnection.close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java
deleted file mode 100644
index 91ed9766f6..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/FlowControlTest.java
+++ /dev/null
@@ -1,209 +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.
-*
-*/
-package org.apache.qpid.test.client;
-
-import org.apache.qpid.client.AMQSession_0_8;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.log4j.Logger;
-
-import javax.jms.*;
-
-public class FlowControlTest extends QpidTestCase
-{
- private static final Logger _logger = Logger.getLogger(FlowControlTest.class);
-
- private Connection _clientConnection;
- private Session _clientSession;
- private Queue _queue;
-
- /**
- * Simply
- *
- * @throws Exception
- */
- public void testBasicBytesFlowControl() throws Exception
- {
- _queue = (Queue) getInitialContext().lookup("queue");
-
- //Create Client
- _clientConnection = getConnection();
-
- _clientConnection.start();
-
- _clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- //Ensure _queue is created
- _clientSession.createConsumer(_queue).close();
-
- Connection producerConnection = getConnection();
-
- producerConnection.start();
-
- Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageProducer producer = producerSession.createProducer(_queue);
-
- BytesMessage m1 = producerSession.createBytesMessage();
- m1.writeBytes(new byte[128]);
- m1.setIntProperty("msg", 1);
- producer.send(m1);
- BytesMessage m2 = producerSession.createBytesMessage();
- m2.writeBytes(new byte[128]);
- m2.setIntProperty("msg", 2);
- producer.send(m2);
- BytesMessage m3 = producerSession.createBytesMessage();
- m3.writeBytes(new byte[256]);
- m3.setIntProperty("msg", 3);
- producer.send(m3);
-
- producer.close();
- producerSession.close();
- producerConnection.close();
-
- Connection consumerConnection = getConnection();
- Session consumerSession = consumerConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- ((AMQSession_0_8) consumerSession).setPrefetchLimits(0, 256);
- MessageConsumer recv = consumerSession.createConsumer(_queue);
- consumerConnection.start();
-
- Message r1 = recv.receive(RECEIVE_TIMEOUT);
- assertNotNull("First message not received", r1);
- assertEquals("Messages in wrong order", 1, r1.getIntProperty("msg"));
-
- Message r2 = recv.receive(RECEIVE_TIMEOUT);
- assertNotNull("Second message not received", r2);
- assertEquals("Messages in wrong order", 2, r2.getIntProperty("msg"));
-
- Message r3 = recv.receive(RECEIVE_TIMEOUT);
- assertNull("Third message incorrectly delivered", r3);
-
- ((AbstractJMSMessage)r1).acknowledgeThis();
-
- r3 = recv.receive(RECEIVE_TIMEOUT);
- assertNull("Third message incorrectly delivered", r3);
-
- ((AbstractJMSMessage)r2).acknowledgeThis();
-
- r3 = recv.receive(RECEIVE_TIMEOUT);
- assertNotNull("Third message not received", r3);
- assertEquals("Messages in wrong order", 3, r3.getIntProperty("msg"));
-
- ((AbstractJMSMessage)r3).acknowledgeThis();
- consumerConnection.close();
- }
-
- public void testTwoConsumersBytesFlowControl() throws Exception
- {
- _queue = (Queue) getInitialContext().lookup("queue");
-
- //Create Client
- _clientConnection = getConnection();
-
- _clientConnection.start();
-
- _clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- //Ensure _queue is created
- _clientSession.createConsumer(_queue).close();
-
- Connection producerConnection = getConnection();
-
- producerConnection.start();
-
- Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageProducer producer = producerSession.createProducer(_queue);
-
- BytesMessage m1 = producerSession.createBytesMessage();
- m1.writeBytes(new byte[128]);
- m1.setIntProperty("msg", 1);
- producer.send(m1);
- BytesMessage m2 = producerSession.createBytesMessage();
- m2.writeBytes(new byte[256]);
- m2.setIntProperty("msg", 2);
- producer.send(m2);
- BytesMessage m3 = producerSession.createBytesMessage();
- m3.writeBytes(new byte[128]);
- m3.setIntProperty("msg", 3);
- producer.send(m3);
-
- producer.close();
- producerSession.close();
- producerConnection.close();
-
- Connection consumerConnection = getConnection();
- Session consumerSession1 = consumerConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- ((AMQSession_0_8) consumerSession1).setPrefetchLimits(0, 256);
- MessageConsumer recv1 = consumerSession1.createConsumer(_queue);
-
- consumerConnection.start();
-
- Message r1 = recv1.receive(RECEIVE_TIMEOUT);
- assertNotNull("First message not received", r1);
- assertEquals("Messages in wrong order", 1, r1.getIntProperty("msg"));
-
- Message r2 = recv1.receive(RECEIVE_TIMEOUT);
- assertNull("Second message incorrectly delivered", r2);
-
- Session consumerSession2 = consumerConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- ((AMQSession_0_8) consumerSession2).setPrefetchLimits(0, 256);
- MessageConsumer recv2 = consumerSession2.createConsumer(_queue);
-
- r2 = recv2.receive(RECEIVE_TIMEOUT);
- assertNotNull("Second message not received", r2);
- assertEquals("Messages in wrong order", 2, r2.getIntProperty("msg"));
-
- Message r3 = recv2.receive(RECEIVE_TIMEOUT);
- assertNull("Third message incorrectly delivered", r3);
-
- r3 = recv1.receive(RECEIVE_TIMEOUT);
- assertNotNull("Third message not received", r3);
- assertEquals("Messages in wrong order", 3, r3.getIntProperty("msg"));
-
- r2.acknowledge();
- r3.acknowledge();
- recv1.close();
- recv2.close();
- consumerSession1.close();
- consumerSession2.close();
- consumerConnection.close();
-
- }
-
- public static void main(String args[]) throws Throwable
- {
- FlowControlTest test = new FlowControlTest();
-
- int run = 0;
- while (true)
- {
- System.err.println("Test Run:" + ++run);
- Thread.sleep(1000);
-
- test.startBroker();
- test.testBasicBytesFlowControl();
-
- Thread.sleep(1000);
-
- test.stopBroker();
- }
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java
deleted file mode 100644
index 737e7aa6a7..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserAutoAckTest.java
+++ /dev/null
@@ -1,537 +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.
- *
- *
- */
-package org.apache.qpid.test.client;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.utils.FailoverBaseCase;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.QueueBrowser;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.NamingException;
-import java.util.Enumeration;
-import java.util.Random;
-
-public class QueueBrowserAutoAckTest extends FailoverBaseCase
-{
- private static final Logger _logger = Logger.getLogger(QueueBrowserAutoAckTest.class);
-
- protected Connection _clientConnection;
- protected Session _clientSession;
- protected Queue _queue;
- protected static final String MESSAGE_ID_PROPERTY = "MessageIDProperty";
- protected boolean CLUSTERED = Boolean.getBoolean("profile.clustered");
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- _queue = (Queue) getInitialContext().lookup("queue");
-
- //Create Client
- _clientConnection = getConnection();
-
- _clientConnection.start();
-
- setupSession();
-
- //Ensure there are no messages on the queue to start with.
- checkQueueDepth(0);
- }
-
- protected void setupSession() throws Exception
- {
- _clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- }
-
- public void tearDown() throws Exception
- {
- if (_clientConnection != null)
- {
- _clientConnection.close();
- }
-
- super.tearDown();
- }
-
- protected void sendMessages(int num) throws JMSException
- {
- Connection producerConnection = null;
- try
- {
- producerConnection = getConnection();
- }
- catch (Exception e)
- {
- fail("Unable to lookup connection in JNDI.");
- }
-
- sendMessages(producerConnection, num);
- }
-
- protected void sendMessages(String connection, int num) throws JMSException
- {
- Connection producerConnection = null;
- try
- {
- producerConnection = getConnectionFactory(connection).createConnection("guest", "guest");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Unable to lookup connection in JNDI.");
- }
- sendMessages(producerConnection, num);
- }
-
-
- protected void sendMessages(Connection producerConnection, int messageSendCount) throws JMSException
- {
- producerConnection.start();
-
- Session producerSession = producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- //Ensure _queue is created
- producerSession.createConsumer(_queue).close();
-
- MessageProducer producer = producerSession.createProducer(_queue);
-
- for (int messsageID = 0; messsageID < messageSendCount; messsageID++)
- {
- TextMessage textMsg = producerSession.createTextMessage("Message " + messsageID);
- textMsg.setIntProperty(MESSAGE_ID_PROPERTY, messsageID);
- producer.send(textMsg);
- }
-
- producerConnection.close();
- }
-
- /**
- * Using the Protocol getQueueDepth method ensure that the correct number of messages are on the queue.
- *
- * Also uses a QueueBrowser as a second method of validating the message count on the queue.
- *
- * @param expectedDepth The expected Queue depth
- * @throws JMSException on error
- */
- protected void checkQueueDepth(int expectedDepth) throws JMSException
- {
-
- // create QueueBrowser
- _logger.info("Creating Queue Browser");
-
- QueueBrowser queueBrowser = _clientSession.createBrowser(_queue);
-
- // check for messages
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Checking for " + expectedDepth + " messages with QueueBrowser");
- }
-
- //Check what the session believes the queue count to be.
- long queueDepth = 0;
-
- try
- {
- queueDepth = ((AMQSession) _clientSession).getQueueDepth((AMQDestination) _queue);
- }
- catch (AMQException e)
- {
- }
-
- assertEquals("Session reports Queue expectedDepth not as expected", expectedDepth, queueDepth);
-
-
-
- // Browse the queue to get a second opinion
- int msgCount = 0;
- Enumeration msgs = queueBrowser.getEnumeration();
-
- while (msgs.hasMoreElements())
- {
- msgs.nextElement();
- msgCount++;
- }
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Found " + msgCount + " messages total in browser");
- }
-
- // check to see if all messages found
- assertEquals("Browser did not find all messages", expectedDepth, msgCount);
-
- //Close browser
- queueBrowser.close();
- }
-
- protected void closeBrowserBeforeAfterGetNext(int messageCount) throws JMSException
- {
- QueueBrowser queueBrowser = _clientSession.createBrowser(_queue);
-
- Enumeration msgs = queueBrowser.getEnumeration();
-
- int msgCount = 0;
-
- while (msgs.hasMoreElements() && msgCount < messageCount)
- {
- msgs.nextElement();
- msgCount++;
- }
-
- try
- {
- queueBrowser.close();
- }
- catch (JMSException e)
- {
- fail("Close should happen without error:" + e.getMessage());
- }
- }
-
- /**
- * This method checks that multiple calls to getEnumeration() on a queueBrowser provide the same behaviour.
- *
- * @param sentMessages The number of messages sent
- * @param browserEnumerationCount The number of times to call getEnumeration()
- * @throws JMSException
- */
- protected void checkMultipleGetEnum(int sentMessages, int browserEnumerationCount) throws JMSException
- {
- QueueBrowser queueBrowser = _clientSession.createBrowser(_queue);
-
- for (int count = 0; count < browserEnumerationCount; count++)
- {
- _logger.info("Checking getEnumeration:" + count);
- Enumeration msgs = queueBrowser.getEnumeration();
-
- int msgCount = 0;
-
- while (msgs.hasMoreElements())
- {
- msgs.nextElement();
- msgCount++;
- }
-
- // Verify that the browser can see all the messages sent.
- assertEquals(sentMessages, msgCount);
- }
-
- try
- {
- queueBrowser.close();
- }
- catch (JMSException e)
- {
- fail("Close should happen without error:" + e.getMessage());
- }
- }
-
- protected void checkOverlappingMultipleGetEnum(int expectedMessages, int browserEnumerationCount) throws JMSException
- {
- checkOverlappingMultipleGetEnum(expectedMessages, browserEnumerationCount, null);
- }
-
- protected void checkOverlappingMultipleGetEnum(int expectedMessages, int browserEnumerationCount, String selector) throws JMSException
- {
- QueueBrowser queueBrowser = selector == null ?
- _clientSession.createBrowser(_queue, selector) :
- _clientSession.createBrowser(_queue);
-
- Enumeration[] msgs = new Enumeration[browserEnumerationCount];
- int[] msgCount = new int[browserEnumerationCount];
-
- //create Enums
- for (int count = 0; count < browserEnumerationCount; count++)
- {
- msgs[count] = queueBrowser.getEnumeration();
- }
-
- //interleave reads
- for (int cnt = 0; cnt < expectedMessages; cnt++)
- {
- for (int count = 0; count < browserEnumerationCount; count++)
- {
- if (msgs[count].hasMoreElements())
- {
- msgs[count].nextElement();
- msgCount[count]++;
- }
- }
- }
-
- //validate all browsers get right message count.
- for (int count = 0; count < browserEnumerationCount; count++)
- {
- assertEquals(msgCount[count], expectedMessages);
- }
-
- try
- {
- queueBrowser.close();
- }
- catch (JMSException e)
- {
- fail("Close should happen without error:" + e.getMessage());
- }
- }
-
- protected void validate(int messages) throws JMSException
- {
- //Create a new connection to validate message content
- Connection connection = null;
-
- try
- {
- connection = getConnection();
- }
- catch (Exception e)
- {
- fail("Unable to make validation connection");
- }
-
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- connection.start();
-
- MessageConsumer consumer = session.createConsumer(_queue);
-
- _logger.info("Verify messages are still on the queue");
-
- Message tempMsg;
-
- for (int msgCount = 0; msgCount < messages; msgCount++)
- {
- tempMsg = (TextMessage) consumer.receive(RECEIVE_TIMEOUT);
- if (tempMsg == null)
- {
- fail("Message " + msgCount + " not retrieved from queue");
- }
- }
-
- //Close this new connection
- connection.close();
-
- _logger.info("All messages recevied from queue");
-
- //ensure no message left.
- checkQueueDepth(0);
- }
-
- protected void checkQueueDepthWithSelectors(int totalMessages, int clients) throws JMSException
- {
-
- String selector = MESSAGE_ID_PROPERTY + " % " + clients;
-
- checkOverlappingMultipleGetEnum(totalMessages / clients, clients, selector);
- }
-
-
- /**
- * This tests you can browse an empty queue, see QPID-785
- *
- * @throws Exception
- */
- public void testBrowsingEmptyQueue() throws Exception
- {
- checkQueueDepth(0);
- }
-
- /*
- * Test Messages Remain on Queue
- * Create a queu and send messages to it. Browse them and then receive them all to verify they were still there
- *
- */
- public void testQueueBrowserMsgsRemainOnQueue() throws Exception
- {
- int messages = 10;
-
- sendMessages(messages);
-
- checkQueueDepth(messages);
-
- validate(messages);
- }
-
-
- public void testClosingBrowserMidReceiving() throws NamingException, JMSException
- {
- int messages = 100;
-
- sendMessages(messages);
-
- checkQueueDepth(messages);
-
- closeBrowserBeforeAfterGetNext(10);
-
- validate(messages);
-
- }
-
- /**
- * This tests that multiple getEnumerations on a QueueBrowser return the required number of messages.
- * @throws NamingException
- * @throws JMSException
- */
- public void testMultipleGetEnum() throws NamingException, JMSException
- {
- int messages = 10;
-
- sendMessages(messages);
-
- checkQueueDepth(messages);
-
- checkMultipleGetEnum(messages, 5);
-
- validate(messages);
- }
-
- public void testMultipleOverlappingGetEnum() throws NamingException, JMSException
- {
- int messages = 25;
-
- sendMessages(messages);
-
- checkQueueDepth(messages);
-
- checkOverlappingMultipleGetEnum(messages, 5);
-
- validate(messages);
- }
-
-
- public void testBrowsingWithSelector() throws JMSException
- {
- int messages = 40;
-
- sendMessages(messages);
-
- checkQueueDepth(messages);
-
- for (int clients = 2; clients <= 10; clients++)
- {
- checkQueueDepthWithSelectors(messages, clients);
- }
-
- validate(messages);
- }
-
- /**
- * Testing that a QueueBrowser doesn't actually consume messages from a broker when it fails over.
- * @throws JMSException
- */
- public void testFailoverWithQueueBrowser() throws JMSException
- {
- int messages = 5;
-
-
- sendMessages("connection1", messages);
- if (!CLUSTERED)
- {
- sendMessages("connection2", messages);
- }
-
-
- checkQueueDepth(messages);
-
-
- _logger.info("Creating Queue Browser");
-
- QueueBrowser queueBrowser = _clientSession.createBrowser(_queue);
-
- long queueDepth = 0;
-
- try
- {
- queueDepth = ((AMQSession) _clientSession).getQueueDepth((AMQDestination) _queue);
- }
- catch (AMQException e)
- {
- }
-
- assertEquals("Session reports Queue depth not as expected", messages, queueDepth);
-
-
- int msgCount = 0;
-
- int failPoint = 0;
-
- failPoint = new Random().nextInt(messages) + 1;
-
- Enumeration msgs = queueBrowser.getEnumeration();
-
- while (msgs.hasMoreElements())
- {
- msgs.nextElement();
- msgCount++;
-
- if (msgCount == failPoint)
- {
- failBroker();
- }
- }
-
- assertTrue("We should get atleast " + messages + " msgs.", msgCount >= messages);
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("QBAAT Found " + msgCount + " messages total in browser");
- }
-
- //Close browser
- queueBrowser.close();
-
- _logger.info("Closed Queue Browser, validating messages on broker.");
-
- //Validate all messages still on Broker
- validate(messages);
- }
-
- public void testFailoverAsQueueBrowserCreated() throws JMSException
- {
- // The IoServiceListenerSupport seems to get stuck in with a managedSession that isn't closing when requested.
- // So it hangs waiting for the session.
- int messages = 50;
-
- sendMessages("connection1", messages);
- if (!CLUSTERED)
- {
- sendMessages("connection2", messages);
- }
-
- failBroker();
-
- checkQueueDepth(messages);
-
- //Validate all messages still on Broker 1
- validate(messages);
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserClientAckTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserClientAckTest.java
deleted file mode 100644
index d346aa514c..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserClientAckTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.client;
-
-import javax.jms.Session;
-
-public class QueueBrowserClientAckTest extends QueueBrowserAutoAckTest
-{
-
-
- protected void setupSession() throws Exception
- {
- _clientSession = _clientConnection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- //Ensure _queue is created
- _clientSession.createConsumer(_queue).close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserDupsOkTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserDupsOkTest.java
deleted file mode 100644
index 37174258dd..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserDupsOkTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.client;
-
-import javax.jms.Session;
-
-public class QueueBrowserDupsOkTest extends QueueBrowserAutoAckTest
-{
- protected void setupSession() throws Exception
- {
- _clientSession = _clientConnection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE);
-
- //Ensure _queue is created
- _clientSession.createConsumer(_queue).close();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserNoAckTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserNoAckTest.java
deleted file mode 100644
index 0ef788dae3..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserNoAckTest.java
+++ /dev/null
@@ -1,36 +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.
- *
- */
-package org.apache.qpid.test.client;
-
-import org.apache.qpid.client.AMQSession;
-
-
-public class QueueBrowserNoAckTest extends QueueBrowserAutoAckTest
-{
-
- protected void setupSession() throws Exception
- {
- _clientSession = _clientConnection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
-
- //Ensure _queue is created
- _clientSession.createConsumer(_queue).close();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserPreAckTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserPreAckTest.java
deleted file mode 100644
index 787c12dadb..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserPreAckTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.client;
-
-import org.apache.qpid.client.AMQSession;
-
-public class QueueBrowserPreAckTest extends QueueBrowserAutoAckTest
-{
-
- protected void setupSession() throws Exception
- {
- _clientSession = _clientConnection.createSession(false, AMQSession.PRE_ACKNOWLEDGE);
-
- //Ensure _queue is created
- _clientSession.createConsumer(_queue).close();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTransactedTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTransactedTest.java
deleted file mode 100644
index 6e3d6fd890..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTransactedTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.client;
-
-import javax.jms.Session;
-
-public class QueueBrowserTransactedTest extends QueueBrowserAutoAckTest
-{
- protected void setupSession() throws Exception
- {
- _clientSession = _clientConnection.createSession(true, Session.SESSION_TRANSACTED);
-
- //Ensure _queue is created
- _clientSession.createConsumer(_queue).close();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java
deleted file mode 100644
index 3a1fb50725..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/failover/FailoverTest.java
+++ /dev/null
@@ -1,272 +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.
- *
- */
-
-package org.apache.qpid.test.client.failover;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.client.AMQConnectionURL;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.jms.ConnectionListener;
-import org.apache.qpid.jms.ConnectionURL;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.test.utils.FailoverBaseCase;
-import org.apache.log4j.Logger;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Queue;
-import javax.naming.NamingException;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-public class FailoverTest extends FailoverBaseCase implements ConnectionListener
-{
- private static final Logger _logger = Logger.getLogger(FailoverTest.class);
-
- private static final String QUEUE = "queue";
- private static final int NUM_MESSAGES = 10;
- private Connection connnection;
- private Session producerSession;
- private Queue queue;
- private MessageProducer producer;
- private Session consumerSession;
- private MessageConsumer consumer;
-
- private static int usedBrokers = 0;
- private CountDownLatch failoverComplete;
- private static final long DEFAULT_FAILOVER_TIME = 10000L;
- private boolean CLUSTERED = Boolean.getBoolean("profile.clustered");
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- connnection = getConnection();
- ((AMQConnection) connnection).setConnectionListener(this);
- connnection.start();
- failoverComplete = new CountDownLatch(1);
- }
-
- private void init(boolean transacted, int mode) throws JMSException, NamingException
- {
- queue = (Queue) getInitialContext().lookup(QUEUE);
-
- consumerSession = connnection.createSession(transacted, mode);
- consumer = consumerSession.createConsumer(queue);
-
- producerSession = connnection.createSession(transacted, mode);
- producer = producerSession.createProducer(queue);
- }
-
- @Override
- public void tearDown() throws Exception
- {
- try
- {
- connnection.close();
- }
- catch (Exception e)
- {
-
- }
-
- super.tearDown();
- }
-
- private void consumeMessages(int toConsume, boolean transacted) throws JMSException
- {
- Message msg;
- for (int i = 0; i < toConsume; i++)
- {
- msg = consumer.receive(1000);
- assertNotNull("Message " + i + " was null!", msg);
- assertEquals("message " + i, ((TextMessage) msg).getText());
- }
- if (transacted) {
- consumerSession.commit();
- }
- }
-
- private void sendMessages(int totalMessages, boolean transacted) throws JMSException
- {
- for (int i = 0; i < totalMessages; i++)
- {
- producer.send(producerSession.createTextMessage("message " + i));
- }
- if (transacted)
- {
- producerSession.commit();
- }
- }
-
- public void testP2PFailover() throws Exception
- {
- testP2PFailover(NUM_MESSAGES, true, false);
- }
-
- public void testP2PFailoverWithMessagesLeft() throws Exception
- {
- testP2PFailover(NUM_MESSAGES, false, false);
- }
-
- public void testP2PFailoverTransacted() throws Exception
- {
- testP2PFailover(NUM_MESSAGES, true, false);
- }
-
- private void testP2PFailover(int totalMessages, boolean consumeAll, boolean transacted) throws JMSException, NamingException
- {
- Message msg = null;
- init(transacted, Session.AUTO_ACKNOWLEDGE);
- sendMessages(totalMessages, transacted);
-
- // Consume some messages
- int toConsume = totalMessages;
- if (!consumeAll)
- {
- toConsume = totalMessages / 2;
- }
-
- consumeMessages(toConsume, transacted);
-
- _logger.info("Failing over");
-
- causeFailure(DEFAULT_FAILOVER_TIME);
-
- if (!CLUSTERED)
- {
- msg = consumer.receive(500);
- assertNull("Should not have received message from new broker!", msg);
- }
-
- // Check that messages still sent / received
- sendMessages(totalMessages, transacted);
- consumeMessages(totalMessages, transacted);
- }
-
- private void causeFailure(long delay)
- {
-
- failBroker();
-
- _logger.info("Awaiting Failover completion");
- try
- {
- if (!failoverComplete.await(delay, TimeUnit.MILLISECONDS))
- {
- fail("failover did not complete");
- }
- }
- catch (InterruptedException e)
- {
- //evil ignore IE.
- }
- }
-
- public void testClientAckFailover() throws Exception
- {
- init(false, Session.CLIENT_ACKNOWLEDGE);
- sendMessages(1, false);
- Message msg = consumer.receive();
- assertNotNull("Expected msgs not received", msg);
-
- causeFailure(DEFAULT_FAILOVER_TIME);
-
- Exception failure = null;
- try
- {
- msg.acknowledge();
- }
- catch (Exception e)
- {
- failure = e;
- }
- assertNotNull("Exception should be thrown", failure);
- }
-
- /**
- * The client used to have a fixed timeout of 4 minutes after which failover would no longer work.
- * Check that this code has not regressed
- *
- * @throws Exception if something unexpected occurs in the test.
- */
- public void test4MinuteFailover() throws Exception
- {
- ConnectionURL connectionURL = getConnectionFactory().getConnectionURL();
-
- int RETRIES = 4;
- int DELAY = 60000;
-
- //Set up a long delay on and large number of retries
- BrokerDetails details = connectionURL.getBrokerDetails(1);
- details.setProperty(BrokerDetails.OPTIONS_RETRY, String.valueOf(RETRIES));
- details.setProperty(BrokerDetails.OPTIONS_CONNECT_DELAY, String.valueOf(DELAY));
-
- connnection = new AMQConnection(connectionURL, null);
-
- ((AMQConnection) connnection).setConnectionListener(this);
-
- //Start the connection
- connnection.start();
-
- long FAILOVER_DELAY = (RETRIES * DELAY);
-
- // Use Nano seconds as it is more accurate for comparision.
- long failTime = System.nanoTime() + FAILOVER_DELAY * 1000000;
-
- //Fail the first broker
- causeFailure(FAILOVER_DELAY + DEFAULT_FAILOVER_TIME);
-
- //Reconnection should occur
- assertTrue("Failover did not take long enough", System.nanoTime() > failTime);
- }
-
- public void bytesSent(long count)
- {
- }
-
- public void bytesReceived(long count)
- {
- }
-
- public boolean preFailover(boolean redirect)
- {
- return true;
- }
-
- public boolean preResubscribe()
- {
- return true;
- }
-
- public void failoverComplete()
- {
- failoverComplete.countDown();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/MessageToStringTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/MessageToStringTest.java
deleted file mode 100644
index 1744b92d62..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/message/MessageToStringTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.client.message;
-
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectOutput;
-import java.io.ObjectOutputStream;
-import java.util.UUID;
-
-public class MessageToStringTest extends QpidTestCase
-{
- private Connection _connection;
- private Session _session;
- private Queue _queue;
- MessageConsumer _consumer;
- private static final String BYTE_TEST = "MapByteTest";
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- //Create Producer put some messages on the queue
- _connection = getConnection();
-
- //Create Queue
- _queue = new AMQQueue("amq.direct", "queue");
-
- //Create Consumer
- _session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _consumer = _session.createConsumer(_queue);
-
- _connection.start();
- }
-
- public void tearDown() throws Exception
- {
- //clean up
- _connection.close();
-
- super.tearDown();
- }
-
- public void testBytesMessage() throws JMSException
- {
- //Create Sample Message using UUIDs
- UUID test = UUID.randomUUID();
-
- BytesMessage testMessage = _session.createBytesMessage();
-
- //Convert UUID into bytes for transit
- byte[] testBytes = test.toString().getBytes();
-
- testMessage.writeBytes(testBytes);
-
- sendAndTest(testMessage, testBytes);
- }
-
- public void testMapMessage() throws JMSException, IOException
- {
- //Create Sample Message using UUIDs
- UUID test = UUID.randomUUID();
-
- MapMessage testMessage = _session.createMapMessage();
-
- byte[] testBytes = convertToBytes(test);
-
- testMessage.setBytes(BYTE_TEST, testBytes);
-
- sendAndTest(testMessage, testBytes);
- }
-
- public void testObjectMessage() throws JMSException
- {
- MessageProducer producer = _session.createProducer(_queue);
-
- //Create Sample Message using UUIDs
- UUID test = UUID.randomUUID();
-
- Message testMessage = _session.createObjectMessage(test);
-
- sendAndTest(testMessage, test);
- }
-
- public void testStreamMessage() throws JMSException, IOException
- {
- //Create Sample Message using UUIDs
- UUID test = UUID.randomUUID();
-
- StreamMessage testMessage = _session.createStreamMessage();
-
- byte[] testBytes = convertToBytes(test);
-
- testMessage.writeBytes(testBytes);
-
- sendAndTest(testMessage, testBytes);
- }
-
- public void testTextMessage() throws JMSException, IOException
- {
- //Create Sample Message using UUIDs
- UUID test = UUID.randomUUID();
-
- TextMessage testMessage = _session.createTextMessage();
-
- String stringValue = String.valueOf(test);
- byte[] testBytes = stringValue.getBytes();
-
- testMessage.setText(stringValue);
-
- sendAndTest(testMessage, testBytes);
- }
-
- //***************** Helpers
-
- private void sendAndTest(Message message, Object testBytes) throws JMSException
- {
- MessageProducer producer = _session.createProducer(_queue);
-
- producer.send(message);
-
- Message receivedMessage = _consumer.receive(1000);
-
- assertNotNull("Message was not received.", receivedMessage);
-
- //Ensure that to calling toString doesn't error and that doing this doesn't break next tests.
- assertNotNull("Message returned null from toString", receivedMessage.toString());
-
- byte[] byteResults;
- UUID result;
-
- try
- {
- if (receivedMessage instanceof ObjectMessage)
- {
- result = (UUID) ((ObjectMessage) receivedMessage).getObject();
- assertEquals("UUIDs were not equal", testBytes, result);
- }
- else
- {
- byteResults = getBytes(receivedMessage, ((byte[]) testBytes).length);
- assertBytesEquals("UUIDs were not equal", (byte[]) testBytes, byteResults);
- }
- }
- catch (Exception e)
- {
- fail(e.getMessage());
- }
-
- }
-
- private void assertBytesEquals(String message, byte[] expected, byte[] actual)
- {
- if (expected.length == actual.length)
- {
- int index = 0;
- boolean failed = false;
- for (byte b : expected)
- {
- if (actual[index++] != b)
- {
- failed = true;
- break;
- }
- }
-
- if (!failed)
- {
- return;
- }
-
- }
-
- fail(message);
- }
-
- private byte[] getBytes(Message receivedMessage, int testBytesLength) throws JMSException
- {
- byte[] byteResults = new byte[testBytesLength];
-
- if (receivedMessage instanceof BytesMessage)
- {
- assertEquals(testBytesLength, ((BytesMessage) receivedMessage).readBytes(byteResults));
- }
- else if (receivedMessage instanceof StreamMessage)
- {
- assertEquals(testBytesLength, ((StreamMessage) receivedMessage).readBytes(byteResults));
- }
- else if (receivedMessage instanceof MapMessage)
- {
- byteResults = ((MapMessage) receivedMessage).getBytes(BYTE_TEST);
- assertEquals(testBytesLength, byteResults.length);
- }
- else if (receivedMessage instanceof TextMessage)
- {
- byteResults = ((TextMessage) receivedMessage).getText().getBytes();
- assertEquals(testBytesLength, byteResults.length);
- }
-
-
- return byteResults;
- }
-
- private byte[] convertToBytes(UUID test) throws IOException
- {
- //Convert UUID into bytes for transit
- ObjectOutput out;
- ByteArrayOutputStream bos = new ByteArrayOutputStream();
- out = new ObjectOutputStream(bos);
- out.writeObject(test);
- out.close();
-
- return bos.toByteArray();
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java
deleted file mode 100644
index f2c8a5e1f5..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.client.timeouts;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import java.io.File;
-
-/**
- * This tests that when the commit takes a long time(due to POST_COMMIT_DELAY) that the commit does not timeout
- * This test must be run in conjunction with SyncWaiteTimeoutDelay or be run with POST_COMMIT_DELAY > 30s to ensure
- * that the default value is being replaced.
- */
-public class SyncWaitDelayTest extends QpidTestCase
-{
- protected static final Logger _logger = LoggerFactory.getLogger(SyncWaitDelayTest.class);
-
- final String QpidHome = System.getProperty("QPID_HOME");
- final File _configFile = new File(QpidHome, "etc/config.xml");
-
- private String VIRTUALHOST = "test";
- protected long POST_COMMIT_DELAY = 1000L;
- protected long SYNC_WRITE_TIMEOUT = POST_COMMIT_DELAY + 1000;
-
- protected Connection _connection;
- protected Session _session;
- protected Queue _queue;
- protected MessageConsumer _consumer;
-
- public void setUp() throws Exception
- {
- super.setUp();
- stopBroker();
- if (!_configFile.exists())
- {
- fail("Unable to test without config file:" + _configFile);
- }
-
- ConfigurationFileApplicationRegistry config = new ConfigurationFileApplicationRegistry(_configFile);
-
- //Disable management on broker.
- config.getConfiguration().setProperty("management.enabled", "false");
-
- Configuration testVirtualhost = config.getConfiguration().subset("virtualhosts.virtualhost." + VIRTUALHOST);
- testVirtualhost.setProperty("store.class", "org.apache.qpid.server.store.SlowMessageStore");
- testVirtualhost.setProperty("store.delays.commitTran.post", POST_COMMIT_DELAY);
-
- startBroker(1, config);
-
- //Set the syncWrite timeout to be just larger than the delay on the commitTran.
- setSystemProperty("amqj.default_syncwrite_timeout", String.valueOf(SYNC_WRITE_TIMEOUT));
-
- _connection = getConnection();
-
- //Create Queue
- _queue = (Queue) getInitialContext().lookup("queue");
-
- //Create Consumer
- _session = _connection.createSession(true, Session.SESSION_TRANSACTED);
-
- //Ensure Queue exists
- _session.createConsumer(_queue).close();
- }
-
-
- public void test() throws JMSException
- {
- MessageProducer producer = _session.createProducer(_queue);
-
- Message message = _session.createTextMessage("Message");
-
- producer.send(message);
-
- long start = System.nanoTime();
-
- _logger.info("Calling Commit");
-
- try
- {
- _session.commit();
- long end = System.nanoTime();
- long time = (end - start);
- // As we are using Nano time ensure to multiply up the millis.
- assertTrue("Commit was quickier than the delay:" + time, time > 1000000L * POST_COMMIT_DELAY);
- assertFalse("Commit was to slower than the build in default", time > 1000000L * 1000 * 30);
- }
- catch (JMSException e)
- {
- fail(e.getMessage());
- }
-
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitTimeoutDelayTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitTimeoutDelayTest.java
deleted file mode 100644
index 1a23eee8ab..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitTimeoutDelayTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.client.timeouts;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQTimeoutException;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-
-/** This tests that when the syncWrite timeout is set that it will timeout on that time rather than the default 30s. */
-public class SyncWaitTimeoutDelayTest extends SyncWaitDelayTest
-{
- protected static final Logger _logger = Logger.getLogger(SyncWaitTimeoutDelayTest.class);
-
- public void setUp() throws Exception
- {
- POST_COMMIT_DELAY = 1000L;
-
- //Set the syncWrite timeout to be less than the COMMIT Delay so we can validate that it is being applied
- SYNC_WRITE_TIMEOUT = 500L;
-
- super.setUp();
- }
-
- @Override
- public void test() throws JMSException
- {
- MessageProducer producer = _session.createProducer(_queue);
-
- Message message = _session.createTextMessage("Message");
-
- producer.send(message);
-
- _logger.info("Calling Commit");
-
- long start = System.nanoTime();
- try
- {
- _session.commit();
- fail("Commit occured even though syncWait timeout is shorter than delay in commit");
- }
- catch (JMSException e)
- {
- assertTrue("Wrong exception type received.", e.getLinkedException() instanceof AMQTimeoutException);
- assertTrue("Wrong message received on exception.", e.getMessage().startsWith("Failed to commit"));
- // As we are using Nano time ensure to multiply up the millis.
- assertTrue("Timeout was more than 30s default", (System.nanoTime() - start) < (1000000L * 1000 * 30));
- }
-
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/AMQPPublisher.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/AMQPPublisher.java
deleted file mode 100644
index 13465741bd..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/AMQPPublisher.java
+++ /dev/null
@@ -1,54 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-/**
- * An AMQPPublisher represents the status of the publishing side of a test circuit that exposes AMQP specific features.
- * Its provides additional assertions not available through the plain JMS {@link Publisher} interface.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Provide assertion that the publishers received a no consumers error code on every message.
- * <tr><td> Provide assertion that the publishers received a no route error code on every message.
- * </table>
- */
-public interface AMQPPublisher extends Publisher
-{
- /**
- * Provides an assertion that the publisher got a no consumers exception on every message.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the publisher got a no consumers exception on every message.
- */
- Assertion noConsumersAssertion(ParsedProperties testProps);
-
- /**
- * Provides an assertion that the publisher got a no rout exception on every message.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the publisher got a no rout exception on every message.
- */
- Assertion noRouteAssertion(ParsedProperties testProps);
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Assertion.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Assertion.java
deleted file mode 100644
index 60d54f1f6f..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Assertion.java
+++ /dev/null
@@ -1,39 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-/**
- * Assertion models an assertion on a test {@link Circuit}.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Indicate whether or not the assertion passes when applied.
- * </table>
- */
-public interface Assertion
-{
- /**
- * Applies the assertion.
- *
- * @return <tt>true</tt> if the assertion passes, <tt>false</tt> if it fails.
- */
- public boolean apply();
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/AssertionBase.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/AssertionBase.java
deleted file mode 100644
index 0bb4911d4c..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/AssertionBase.java
+++ /dev/null
@@ -1,66 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * AssertionBase is a base class for implenmenting assertions. It provides a mechanism to store error messages, and
- * report all error messages when its {@link #toString()} method is called.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Collect error messages.
- * </table>
- */
-public abstract class AssertionBase implements Assertion
-{
- /** Holds the error messages. */
- List<String> errors = new LinkedList<String>();
-
- /**
- * Adds an error message to the assertion.
- *
- * @param error An error message to add to the assertion.
- */
- public void addError(String error)
- {
- errors.add(error);
- }
-
- /**
- * Prints all of the error messages in the assertion into a string.
- *
- * @return All of the error messages in the assertion as a string.
- */
- public String toString()
- {
- String result = "";
-
- for (String error : errors)
- {
- result += error;
- }
-
- return result;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/BrokerLifecycleAware.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/BrokerLifecycleAware.java
deleted file mode 100644
index 41614f92fc..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/BrokerLifecycleAware.java
+++ /dev/null
@@ -1,70 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-/**
- * BrokerLifecycleAware is an awareness interface implemented by test cases that can run control the life-cycle of
- * the brokers on which they run. Its purpose is to expose additional instrumentation of brokers during testing, that
- * enables tests to use an automated failure mechanism to simulate broker failures, and to re-start failed brokers.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Indicate whether or not a test case is using an in-vm broker.
- * <tr><td> Track which in-vm broker is currently in use.
- * <tr><td> Accept setting of a failure mechanism. <td> {@link CauseFailure}.
- * </table>
- *
- * @todo Need to think about how to present the brokers through this interface. Thinking numbering the available
- * brokers from 1 will do. Then can kill 1 and assume failing onto 2. Restart 1 and kill 2 and fail back onto
- * 1 again?
- */
-public interface BrokerLifecycleAware
-{
- public void setInVmBrokers();
-
- /**
- * Indicates whether or not a test case is using in-vm brokers.
- *
- * @return <tt>true</tt> if the test is using in-vm brokers, <tt>false</tt> otherwise.
- */
- public boolean usingInVmBroker();
-
- /**
- * Sets the currently live in-vm broker.
- *
- * @param i The currently live in-vm broker.
- */
- public void setLiveBroker(int i);
-
- /**
- * Reports the currently live in-vm broker.
- *
- * @return The currently live in-vm broker.
- */
- public int getLiveBroker();
-
- /**
- * Accepts a failure mechanism.
- *
- * @param failureMechanism The failure mechanism.
- */
- public void setFailureMechanism(CauseFailure failureMechanism);
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CauseFailure.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CauseFailure.java
deleted file mode 100644
index 9bdd5a72c5..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CauseFailure.java
+++ /dev/null
@@ -1,42 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-/**
- * CauseFailure provides a method to cause a failure in a messaging broker, usually used in conjunction with fail-over
- * or other failure mode testing. In some cases failures may be automated, for example by shutting down an in-vm broker,
- * or by sending a special control signal to a broker over a network connection. In other cases, it may be preferable
- * to ask a user interactively to cause a failure scenario, in which case an implementation may display a prompt or
- * dialog box asking for notification once the failure has been caused. The purpose of this interface is to abstract
- * the exact cause and nature of a failure out of failure test cases.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Cause messaging broker failure.
- * </table>
- */
-public interface CauseFailure
-{
- /**
- * Causes the active message broker to fail.
- */
- void causeFailure();
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CauseFailureUserPrompt.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CauseFailureUserPrompt.java
deleted file mode 100644
index 889df4ad07..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CauseFailureUserPrompt.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.qpid.test.framework.CauseFailure;
-
-import java.io.IOException;
-
-/**
- * Causes a message broker failure by interactively prompting the user to cause it.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Cause messaging broker failure.
- * </table>
- */
-public class CauseFailureUserPrompt implements CauseFailure
-{
- /**
- * Causes the active message broker to fail.
- */
- public void causeFailure()
- {
- waitForUser("Cause a broker failure now, then press Return.");
- }
-
- /**
- * Outputs a prompt to the console and waits for the user to press return.
- *
- * @param prompt The prompt to display on the console.
- */
- private void waitForUser(String prompt)
- {
- System.out.println(prompt);
-
- try
- {
- System.in.read();
- }
- catch (IOException e)
- {
- // Ignored.
- }
-
- System.out.println("Continuing.");
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Circuit.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Circuit.java
deleted file mode 100644
index 4f9ab1a273..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Circuit.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import java.util.List;
-
-/**
- * A Circuit is the basic test unit against which test cases are to be written. A circuit consists of two 'ends', an
- * instigating 'publisher' end and a more passive 'receivers' end.
- *
- * <p/>Once created, the life-cycle of a circuit may be controlled by {@link #start()}ing it, or {@link #close()}ing it.
- * Once started, the circuit is ready to send messages over. Once closed the circuit can no longer be used.
- *
- * <p/>The state of the circuit may be taken with the {@link #check()} method, and asserted against by the
- * {@link #applyAssertions(java.util.List)} method.
- *
- * <p/>There is a default test procedure which may be performed against the circuit. The outline of this procedure is:
- *
- * <p/><pre>
- * Start the circuit.
- * Send test messages.
- * Request a status report.
- * Assert conditions on the publishing end of the circuit.
- * Assert conditions on the receiving end of the circuit.
- * Close the circuit.
- * Pass with no failed assertions or fail with a list of failed assertions.
- * </pre>
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Supply the publishing and receiving ends of a test messaging circuit.
- * <tr><td> Start the circuit running.
- * <tr><td> Close the circuit down.
- * <tr><td> Take a reading of the circuits state.
- * <tr><td> Apply assertions against the circuits state.
- * <tr><td> Send test messages over the circuit.
- * <tr><td> Perform the default test procedue on the circuit.
- * </table>
- */
-public interface Circuit
-{
- /**
- * Gets the interface on the publishing end of the circuit.
- *
- * @return The publishing end of the circuit.
- */
- public Publisher getPublisher();
-
- /**
- * Gets the interface on the receiving end of the circuit.
- *
- * @return The receiving end of the circuit.
- */
- public Receiver getReceiver();
-
- /**
- * Connects and starts the circuit. After this method is called the circuit is ready to send messages.
- */
- public void start();
-
- /**
- * Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit,
- * into a report, against which assertions may be checked.
- */
- public void check();
-
- /**
- * Closes the circuit. All associated resources are closed.
- */
- public void close();
-
- /**
- * Applied a list of assertions against the test circuit. The {@link #check()} method should be called before doing
- * this, to ensure that the circuit has gathered its state into a report to assert against.
- *
- * @param assertions The list of assertions to apply to the circuit.
- *
- * @return Any assertions that failed.
- */
- public List<Assertion> applyAssertions(List<Assertion> assertions);
-
- /**
- * Runs the default test procedure against the circuit, and checks that all of the specified assertions hold.
- *
- * @param numMessages The number of messages to send using the default test procedure.
- * @param assertions The list of assertions to apply.
- *
- * @return Any assertions that failed.
- */
- public List<Assertion> test(int numMessages, List<Assertion> assertions);
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java
deleted file mode 100644
index 824edd7022..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import javax.jms.*;
-
-/**
- * A CircuitEnd is a pair consisting of one message producer and one message consumer, that represents one end of a
- * test circuit. It is a standard unit of connectivity allowing a full-duplex conversation to be held, provided both
- * the consumer and producer are instantiated and configured.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Provide a message producer for sending messages.
- * <tr><td> Provide a message consumer for receiving messages.
- * </table>
- *
- * @todo Update the {@link org.apache.qpid.test.utils.ConversationFactory} so that it accepts these as the basic conversation
- * connection units.
- */
-public interface CircuitEnd
-{
- /**
- * Gets the message producer at this circuit end point.
- *
- * @return The message producer at with this circuit end point.
- */
- public MessageProducer getProducer();
-
- /**
- * Gets the message consumer at this circuit end point.
- *
- * @return The message consumer at this circuit end point.
- */
- public MessageConsumer getConsumer();
-
- /**
- * Send the specified message over the producer at this end point.
- *
- * @param message The message to send.
- *
- * @throws JMSException Any JMS exception occuring during the send is allowed to fall through.
- */
- public void send(Message message) throws JMSException;
-
- /**
- * Gets the JMS Session associated with this circuit end point.
- *
- * @return The JMS Session associated with this circuit end point.
- */
- public Session getSession();
-
- /**
- * Closes the message producers and consumers and the sessions, associated with this circuit end point.
- *
- * @throws JMSException Any JMSExceptions occurring during the close are allowed to fall through.
- */
- public void close() throws JMSException;
-
- /**
- * Returns the message monitor for reporting on received messages on this circuit end.
- *
- * @return The message monitor for this circuit end.
- */
- public MessageMonitor getMessageMonitor();
-
- /**
- * Returns the exception monitor for reporting on exceptions received on this circuit end.
- *
- * @return The exception monitor for this circuit end.
- */
- public ExceptionMonitor getExceptionMonitor();
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEndBase.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEndBase.java
deleted file mode 100644
index d5a33514df..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEndBase.java
+++ /dev/null
@@ -1,152 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import javax.jms.*;
-
-/**
- * A CircuitEndBase is a pair consisting of one message producer and one message consumer, that represents one end of a
- * test circuit. It is a standard unit of connectivity allowing a full-duplex conversation to be held, provided both
- * the consumer and producer are instantiated and configured.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Provide a message producer for sending messages.
- * <tr><td> Provide a message consumer for receiving messages.
- * </table>
- */
-public class CircuitEndBase implements CircuitEnd
-{
- /** Holds the single message producer. */
- MessageProducer producer;
-
- /** Holds the single message consumer. */
- MessageConsumer consumer;
-
- /** Holds the controlSession for the circuit end. */
- Session session;
-
- /** Holds the message monitor for the circuit end. */
- MessageMonitor messageMonitor;
-
- /** Holds the exception monitor for the circuit end. */
- ExceptionMonitor exceptionMonitor;
-
- /**
- * Creates a circuit end point on the specified producer, consumer and controlSession. Monitors are also configured
- * for messages and exceptions received by the circuit end.
- *
- * @param producer The message producer for the circuit end point.
- * @param consumer The message consumer for the circuit end point.
- * @param session The controlSession for the circuit end point.
- * @param messageMonitor The monitor to notify of all messages received by the circuit end.
- * @param exceptionMonitor The monitor to notify of all exceptions received by the circuit end.
- */
- public CircuitEndBase(MessageProducer producer, MessageConsumer consumer, Session session, MessageMonitor messageMonitor,
- ExceptionMonitor exceptionMonitor)
- {
- this.producer = producer;
- this.consumer = consumer;
- this.session = session;
-
- this.messageMonitor = messageMonitor;
- this.exceptionMonitor = exceptionMonitor;
- }
-
- /**
- * Gets the message producer at this circuit end point.
- *
- * @return The message producer at with this circuit end point.
- */
- public MessageProducer getProducer()
- {
- return producer;
- }
-
- /**
- * Gets the message consumer at this circuit end point.
- *
- * @return The message consumer at this circuit end point.
- */
- public MessageConsumer getConsumer()
- {
- return consumer;
- }
-
- /**
- * Send the specified message over the producer at this end point.
- *
- * @param message The message to send.
- * @throws javax.jms.JMSException Any JMS exception occuring during the send is allowed to fall through.
- */
- public void send(Message message) throws JMSException
- {
- producer.send(message);
- }
-
- /**
- * Gets the JMS Session associated with this circuit end point.
- *
- * @return The JMS Session associated with this circuit end point.
- */
- public Session getSession()
- {
- return session;
- }
-
- /**
- * Closes the message producers and consumers and the sessions, associated with this circuit end point.
- *
- * @throws javax.jms.JMSException Any JMSExceptions occurring during the close are allowed to fall through.
- */
- public void close() throws JMSException
- {
- if (producer != null)
- {
- producer.close();
- }
-
- if (consumer != null)
- {
- consumer.close();
- }
- }
-
- /**
- * Returns the message monitor for reporting on received messages on this circuit end.
- *
- * @return The message monitor for this circuit end.
- */
- public MessageMonitor getMessageMonitor()
- {
- return messageMonitor;
- }
-
- /**
- * Returns the exception monitor for reporting on exceptions received on this circuit end.
- *
- * @return The exception monitor for this circuit end.
- */
- public ExceptionMonitor getExceptionMonitor()
- {
- return exceptionMonitor;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/DropInTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/DropInTest.java
deleted file mode 100644
index 78b5a72c1f..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/DropInTest.java
+++ /dev/null
@@ -1,51 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-/**
- * A DropIn test is a test case that can accept late joining test clients into a running test. This can be usefull,
- * for interactive experimentation.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Accept late joining test clients.
- * </table>
- */
-public interface DropInTest
-{
- /**
- * Should accept a late joining client into a running test case. The client will be enlisted with a control message
- * with the 'CONTROL_TYPE' field set to the value 'LATEJOIN'. It should also provide values for the fields:
- *
- * <p/><table>
- * <tr><td> CLIENT_NAME <td> A unique name for the new client.
- * <tr><td> CLIENT_PRIVATE_CONTROL_KEY <td> The key for the route on which the client receives its control messages.
- * </table>
- *
- * @param message The late joiners join message.
- *
- * @throws JMSException Any JMS Exception are allowed to fall through, indicating that the join failed.
- */
- public void lateJoin(Message message) throws JMSException;
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java
deleted file mode 100644
index 7d06aba1c0..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java
+++ /dev/null
@@ -1,205 +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
-/*
- *
- * 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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.log4j.Logger;
-
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * An exception monitor, listens for JMS exception on a connection or consumer. It record all exceptions that it receives
- * and provides methods to test the number and type of exceptions received.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Record all exceptions received.
- * </table>
- */
-public class ExceptionMonitor implements ExceptionListener
-{
- /** Used for debugging. */
- private final Logger log = Logger.getLogger(ExceptionMonitor.class);
-
- /** Holds the received exceptions. */
- List<Exception> exceptions = new ArrayList<Exception>();
-
- /**
- * Receives incoming exceptions.
- *
- * @param e The exception to record.
- */
- public synchronized void onException(JMSException e)
- {
- log.debug("public void onException(JMSException e): called", e);
-
- exceptions.add(e);
- }
-
- /**
- * Checks that no exceptions have been received.
- *
- * @return <tt>true</tt> if no exceptions have been received, <tt>false</tt> otherwise.
- */
- public synchronized boolean assertNoExceptions()
- {
- return exceptions.isEmpty();
- }
-
- /**
- * Checks that exactly one exception has been received.
- *
- * @return <tt>true</tt> if exactly one exception been received, <tt>false</tt> otherwise.
- */
- public synchronized boolean assertOneJMSException()
- {
- return exceptions.size() == 1;
- }
-
- /**
- * Checks that exactly one exception, with a linked cause of the specified type, has been received.
- *
- * @param aClass The type of the linked cause.
- *
- * @return <tt>true</tt> if exactly one exception, with a linked cause of the specified type, been received,
- * <tt>false</tt> otherwise.
- */
- public synchronized boolean assertOneJMSExceptionWithLinkedCause(Class aClass)
- {
- if (exceptions.size() == 1)
- {
- Exception e = exceptions.get(0);
-
- if (e instanceof JMSException)
- {
- JMSException jmse = (JMSException) e;
-
- Exception linkedCause = jmse.getLinkedException();
-
- if ((linkedCause != null) && aClass.isInstance(linkedCause))
- {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * Checks that at least one exception of the the specified type, has been received.
- *
- * @param exceptionClass The type of the exception.
- *
- * @return <tt>true</tt> if at least one exception of the specified type has been received, <tt>false</tt> otherwise.
- */
- public synchronized boolean assertExceptionOfType(Class exceptionClass)
- {
- // Start by assuming that the exception has no been received.
- boolean passed = false;
-
- // Scan all the exceptions for a match.
- for (Exception e : exceptions)
- {
- if (exceptionClass.isInstance(e))
- {
- passed = true;
-
- break;
- }
- }
-
- return passed;
- }
-
- /**
- * Reports the number of exceptions held by this monitor.
- *
- * @return The number of exceptions held by this monitor.
- */
- public synchronized int size()
- {
- return exceptions.size();
- }
-
- /**
- * Clears the record of received exceptions.
- */
- public synchronized void reset()
- {
- exceptions = new ArrayList<Exception>();
- }
-
- /**
- * Provides a dump of the stack traces of all exceptions that this exception monitor was notified of. Mainly
- * use for debugging/test failure reporting purposes.
- *
- * @return A string containing a dump of the stack traces of all exceptions.
- */
- public synchronized String toString()
- {
- String result = "ExceptionMonitor: holds " + exceptions.size() + " exceptions.\n\n";
-
- for (Exception ex : exceptions)
- {
- result += getStackTrace(ex) + "\n";
- }
-
- return result;
- }
-
- /**
- * Prints an exception stack trace into a string.
- *
- * @param t The throwable to get the stack trace from.
- *
- * @return A string containing the throwables stack trace.
- */
- public static String getStackTrace(Throwable t)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw, true);
- t.printStackTrace(pw);
- pw.flush();
- sw.flush();
-
- return sw.toString();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java
deleted file mode 100644
index eb51a32166..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
-
-import org.apache.qpid.test.framework.BrokerLifecycleAware;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.apache.qpid.junit.extensions.SetupTaskAware;
-import org.apache.qpid.junit.extensions.SetupTaskHandler;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * FrameworkBaseCase provides a starting point for writing test cases against the test framework. Its main purpose is
- * to provide some convenience methods for testing.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create and clean up in-vm brokers on every test case.
- * <tr><td> Produce lists of assertions from assertion creation calls.
- * <tr><td> Produce JUnit failures from assertion failures.
- * <tr><td> Convert failed assertions to error messages.
- * </table>
- */
-public class FrameworkBaseCase extends QpidTestCase implements FrameworkTestContext, SetupTaskAware,
- BrokerLifecycleAware
-{
- /** Used for debugging purposes. */
- private static final Logger log = Logger.getLogger(FrameworkBaseCase.class);
-
- /** Holds the test sequencer to create and run test circuits with. */
- protected CircuitFactory circuitFactory = new LocalAMQPCircuitFactory();
-
- /** Used to read the tests configurable properties through. */
- protected ParsedProperties testProps;
-
- /** A default setup task processor to delegate setup tasks to. */
- protected SetupTaskHandler taskHandler = new SetupTaskHandler();
-
- /** Flag used to track whether the test is in-vm or not. */
- protected boolean isUsingInVM;
-
- /** Holds the failure mechanism. */
- protected CauseFailure failureMechanism = new CauseFailureUserPrompt();
-
- /**
- * Creates a new test case with the specified name.
- *
- * @param name The test case name.
- */
- public FrameworkBaseCase(String name)
- {
- super(name);
- }
-
- /**
- * Returns the test case sequencer that provides test circuit, and test sequence implementations. The sequencer
- * that this base case returns by default is suitable for running a test circuit with both circuit ends colocated
- * on the same JVM.
- *
- * @return The test case sequencer.
- */
- protected CircuitFactory getCircuitFactory()
- {
- return circuitFactory;
- }
-
- /**
- * Overrides the default test circuit factory. Test decorators can use this to supply distributed test sequencers or
- * other test circuit factory specializations.
- *
- * @param circuitFactory The new test circuit factory.
- */
- public void setCircuitFactory(CircuitFactory circuitFactory)
- {
- this.circuitFactory = circuitFactory;
- }
-
- /**
- * Reports the current test case name.
- *
- * @return The current test case name.
- */
- public TestCaseVector getTestCaseVector()
- {
- return new TestCaseVector(this.getName(), 0);
- }
-
- /**
- * Reports the current test case parameters.
- *
- * @return The current test case parameters.
- */
- public MessagingTestConfigProperties getTestParameters()
- {
- return new MessagingTestConfigProperties(testProps);
- }
-
- /**
- * Creates a list of assertions.
- *
- * @param asserts The assertions to compile in a list.
- *
- * @return A list of assertions.
- */
- protected List<Assertion> assertionList(Assertion... asserts)
- {
- List<Assertion> result = new ArrayList<Assertion>();
-
- for (Assertion assertion : asserts)
- {
- result.add(assertion);
- }
-
- return result;
- }
-
- /**
- * Generates a JUnit assertion exception (failure) if any assertions are passed into this method, also concatenating
- * all of the error messages in the assertions together to form an error message to diagnose the test failure with.
- *
- * @param asserts The list of failed assertions.
- */
- protected static void assertNoFailures(List<Assertion> asserts)
- {
- log.debug("protected void assertNoFailures(List<Assertion> asserts = " + asserts + "): called");
-
- // Check if there are no assertion failures, and return without doing anything if so.
- if ((asserts == null) || asserts.isEmpty())
- {
- return;
- }
-
- // Compile all of the assertion failure messages together.
- String errorMessage = assertionsToString(asserts);
-
- // Fail with the error message from all of the assertions.
- fail(errorMessage);
- }
-
- /**
- * Converts a list of failed assertions into an error message.
- *
- * @param asserts The failed assertions.
- *
- * @return The error message.
- */
- protected static String assertionsToString(List<Assertion> asserts)
- {
- String errorMessage = "";
-
- for (Assertion assertion : asserts)
- {
- errorMessage += assertion.toString() + "\n";
- }
-
- return errorMessage;
- }
-
- /**
- * Ensures that the in-vm broker is created and initialized.
- *
- * @throws Exception Any exceptions allowed to fall through and fail the test.
- */
- protected void setUp() throws Exception
- {
- NDC.push(getName());
-
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
- }
-
- /**
- * Ensures that the in-vm broker is cleaned up after each test run.
- */
- protected void tearDown()
- {
- NDC.pop();
-
- // Process all optional tear down tasks. This may include in-vm broker clean up, if a decorator has added it.
- taskHandler.runTearDownTasks();
- }
-
- /**
- * Adds the specified task to the tests setup.
- *
- * @param task The task to add to the tests setup.
- */
- public void chainSetupTask(Runnable task)
- {
- taskHandler.chainSetupTask(task);
- }
-
- /**
- * Adds the specified task to the tests tear down.
- *
- * @param task The task to add to the tests tear down.
- */
- public void chainTearDownTask(Runnable task)
- {
- taskHandler.chainTearDownTask(task);
- }
-
- /**
- * Should provide a translation from the junit method name of a test to its test case name as known to the test
- * clients that will run the test. The purpose of this is to convert the JUnit method name into the correct test
- * case name to place into the test invite. For example the method "testP2P" might map onto the interop test case
- * name "TC2_BasicP2P".
- *
- * @param methodName The name of the JUnit test method.
- *
- * @return The name of the corresponding interop test case.
- */
- public String getTestCaseNameForTestMethod(String methodName)
- {
- return methodName;
- }
-
- public void setInVmBrokers()
- {
- isUsingInVM = true;
- }
-
- /**
- * Indicates whether or not a test case is using in-vm brokers.
- *
- * @return <tt>true</tt> if the test is using in-vm brokers, <tt>false</tt> otherwise.
- */
- public boolean usingInVmBroker()
- {
- return isUsingInVM;
- }
-
- /**
- * Sets the currently live in-vm broker.
- *
- * @param i The currently live in-vm broker.
- */
- public void setLiveBroker(int i)
- { }
-
- /**
- * Reports the currently live in-vm broker.
- *
- * @return The currently live in-vm broker.
- */
- public int getLiveBroker()
- {
- return 0;
- }
-
- /**
- * Accepts a failure mechanism.
- *
- * @param failureMechanism The failure mechanism.
- */
- public void setFailureMechanism(CauseFailure failureMechanism)
- {
- this.failureMechanism = failureMechanism;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java
deleted file mode 100644
index 2322955253..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework;
-
-/**
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </table>
- */
-public class FrameworkClientBaseCase
-{
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkTestContext.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkTestContext.java
deleted file mode 100644
index 9a4668e86f..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkTestContext.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework;
-
-/**
- * A FrameworkTestContext provides context information to test code about the current test case being run; its name, its
- * parameters.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide the name of the current test case.
- * <tr><td> Provide the test parameters.
- * </table>
- */
-public interface FrameworkTestContext
-{
- /**
- * Reports the current test case name.
- *
- * @return The current test case name.
- */
- TestCaseVector getTestCaseVector();
-
- /**
- * Reports the current test case parameters.
- *
- * @return The current test case parameters.
- */
- MessagingTestConfigProperties getTestParameters();
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalAMQPCircuitFactory.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalAMQPCircuitFactory.java
deleted file mode 100644
index 7fbef06265..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalAMQPCircuitFactory.java
+++ /dev/null
@@ -1,168 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.framework.localcircuit.LocalAMQPPublisherImpl;
-import org.apache.qpid.test.framework.localcircuit.LocalPublisherImpl;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.*;
-
-/**
- * LocalAMQPCircuitFactory is a test sequencer that creates test circuits with publishing and receiving ends rooted
- * on the same JVM, allowing AMQP/Qpid specific options to be applied to the circuit.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide a standard test procedure over a test circuit.
- * <tr><td> Construct test circuits appropriate to a tests context.
- * <tr><td> Construct test circuits the support AMQP specific options.
- * </table>
- */
-public class LocalAMQPCircuitFactory extends LocalCircuitFactory
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(LocalAMQPCircuitFactory.class);
-
- /**
- * Builds a circuit end suitable for the publishing side of a test circuit, from standard test parameters.
- *
- * @param connection The connection to build the circuit end on.
- * @param testProps The test parameters to configure the circuit end construction.
- * @param uniqueId A unique number to being numbering destinations from, to make this circuit unique.
- *
- * @return A circuit end suitable for the publishing side of a test circuit.
- *
- * @throws javax.jms.JMSException Any underlying JMSExceptions are allowed to fall through and fail the creation.
- */
- public CircuitEndBase createPublisherCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId)
- throws JMSException
- {
- log.debug(
- "public CircuitEndBase createPublisherCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId = "
- + uniqueId + "): called");
-
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- Session session = connection.createSession(props.getPublisherTransacted(), props.getAckMode());
-
- Destination destination =
- props.getPubsub() ? session.createTopic(props.getSendDestinationNameRoot() + "_" + uniqueId)
- : session.createQueue(props.getSendDestinationNameRoot() + "_" + uniqueId);
-
- MessageProducer producer =
- props.getPublisherProducerBind()
- ? ((props.getImmediate() | props.getMandatory())
- ? ((AMQSession) session).createProducer(destination, props.getMandatory(), props.getImmediate())
- : session.createProducer(destination)) : null;
-
- MessageConsumer consumer =
- props.getPublisherConsumerBind()
- ? session.createConsumer(session.createQueue(props.getReceiveDestinationNameRoot() + "_" + uniqueId)) : null;
-
- MessageMonitor messageMonitor = new MessageMonitor();
-
- if (consumer != null)
- {
- consumer.setMessageListener(messageMonitor);
- }
-
- ExceptionMonitor exceptionMonitor = new ExceptionMonitor();
- connection.setExceptionListener(exceptionMonitor);
-
- if (!props.getPublisherConsumerActive() && (consumer != null))
- {
- consumer.close();
- }
-
- return new CircuitEndBase(producer, consumer, session, messageMonitor, exceptionMonitor);
- }
-
- /**
- * Builds a circuit end suitable for the receiving side of a test circuit, from standard test parameters.
- *
- * @param connection The connection to build the circuit end on.
- * @param testProps The test parameters to configure the circuit end construction.
- * @param uniqueId A unique number to being numbering destinations from, to make this circuit unique.
- *
- * @return A circuit end suitable for the receiving side of a test circuit.
- *
- * @throws JMSException Any underlying JMSExceptions are allowed to fall through and fail the creation.
- */
- public CircuitEndBase createReceiverCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId)
- throws JMSException
- {
- log.debug(
- "public CircuitEndBase createReceiverCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId = "
- + uniqueId + "): called");
-
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- Session session = connection.createSession(props.getPublisherTransacted(), props.getAckMode());
-
- MessageProducer producer =
- props.getReceiverProducerBind()
- ? session.createProducer(session.createQueue(props.getReceiveDestinationNameRoot() + "_" + uniqueId)) : null;
-
- Destination destination =
- props.getPubsub() ? session.createTopic(props.getSendDestinationNameRoot() + "_" + uniqueId)
- : session.createQueue(props.getSendDestinationNameRoot() + "_" + uniqueId);
-
- MessageConsumer consumer =
- props.getReceiverConsumerBind()
- ? ((props.getDurableSubscription() && props.getPubsub())
- ? session.createDurableSubscriber((Topic) destination, "testsub") : session.createConsumer(destination))
- : null;
-
- MessageMonitor messageMonitor = new MessageMonitor();
-
- if (consumer != null)
- {
- consumer.setMessageListener(messageMonitor);
- }
-
- if (!props.getReceiverConsumerActive() && (consumer != null))
- {
- consumer.close();
- }
-
- return new CircuitEndBase(producer, consumer, session, messageMonitor, null);
- }
-
- /**
- * Creates a local {@link Publisher} from a {@link CircuitEnd}. The publisher implementation provides AMQP
- * specific assertion methods, for testing beyond JMS.
- *
- * @param publisherEnd The publishing circuit end.
- *
- * @return A {@link Receiver}.
- */
- protected LocalPublisherImpl createPublisherFromCircuitEnd(CircuitEndBase publisherEnd)
- {
- return new LocalAMQPPublisherImpl(publisherEnd);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalCircuitFactory.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalCircuitFactory.java
deleted file mode 100644
index ec70759cf7..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/LocalCircuitFactory.java
+++ /dev/null
@@ -1,316 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.localcircuit.LocalCircuitImpl;
-import org.apache.qpid.test.framework.localcircuit.LocalPublisherImpl;
-import org.apache.qpid.test.framework.localcircuit.LocalReceiverImpl;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-import org.apache.qpid.test.utils.ConversationFactory;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.*;
-
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * LocalCircuitFactory is a circuit factory that creates test circuits with publishing and receiving ends rooted
- * on the same JVM. The ends of the circuit are presented as {@link Publisher} and {@link Receiver} interfaces, which
- * in turn provide methods to apply assertions to the circuit. The creation of the circuit ends, and the presentation
- * of the ends as publisher/receiver interfaces, are designed to be overriden, so that circuits and assertions that
- * use messaging features not available in JMS can be written. This provides an extension point for writing tests
- * against proprietary features of JMS implementations.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide a standard test procedure over a test circuit.
- * <tr><td> Construct test circuits appropriate to a tests context.
- * </table>
- */
-public class LocalCircuitFactory implements CircuitFactory
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(LocalCircuitFactory.class);
-
- /** Used to create unique destination names for each test. */
- protected static AtomicLong uniqueDestsId = new AtomicLong();
-
- /**
- * Holds a test coordinating conversation with the test clients. This should consist of assigning the test roles,
- * begining the test and gathering the test reports from the participants.
- *
- * @param testCircuit The test circuit.
- * @param assertions The list of assertions to apply to the test circuit.
- * @param testProperties The test case definition.
- */
- public void sequenceTest(Circuit testCircuit, List<Assertion> assertions, Properties testProperties)
- {
- if (testCircuit != null)
- {
- FrameworkBaseCase.assertNoFailures(testCircuit.test(1, assertions));
- }
- }
-
- /**
- * Creates a test circuit for the test, configered by the test parameters specified.
- *
- * @param testProperties The test parameters.
- *
- * @return A test circuit.
- */
- public Circuit createCircuit(Connection connection, ParsedProperties testProperties)
- {
- Circuit result;
-
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProperties);
-
- // Create a standard publisher/receivers test client pair on a shared connection, individual sessions.
- try
- {
- // Get a unique offset to append to destination names to make them unique to the connection.
- long uniqueId = uniqueDestsId.incrementAndGet();
-
- // Add the connection exception listener to assert on exception conditions with.
- // ExceptionMonitor exceptionMonitor = new ExceptionMonitor();
- // connection.setExceptionListener(exceptionMonitor);
-
- // Set up the publisher.
- CircuitEndBase publisherEnd = createPublisherCircuitEnd(connection, props, uniqueId);
-
- // Set up the receiver.
- CircuitEndBase receiverEnd = createReceiverCircuitEnd(connection, props, uniqueId);
-
- // Start listening for incoming messages.
- connection.start();
-
- // Package everything up.
- LocalPublisherImpl publisher = createPublisherFromCircuitEnd(publisherEnd);
- LocalReceiverImpl receiver = createReceiverFromCircuitEnd(receiverEnd);
-
- result = new LocalCircuitImpl(testProperties, publisher, receiver, connection, publisher.getExceptionMonitor());
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Could not create publisher/receivers pair due to a JMSException.", e);
- }
-
- return result;
- }
-
- /**
- * Creates a local {@link Receiver} from a {@link CircuitEnd}. Sub-classes may override this to provide more
- * specialized receivers if necessary.
- *
- * @param receiverEnd The receiving circuit end.
- *
- * @return A {@link Receiver}.
- */
- protected LocalReceiverImpl createReceiverFromCircuitEnd(CircuitEndBase receiverEnd)
- {
- return new LocalReceiverImpl(receiverEnd);
- }
-
- /**
- * Creates a local {@link Publisher} from a {@link CircuitEnd}. Sub-classes may override this to provide more
- * specialized receivers if necessary.
- *
- * @param publisherEnd The publishing circuit end.
- *
- * @return A {@link Receiver}.
- */
- protected LocalPublisherImpl createPublisherFromCircuitEnd(CircuitEndBase publisherEnd)
- {
- return new LocalPublisherImpl(publisherEnd);
- }
-
- /**
- * Builds a circuit end suitable for the publishing side of a test circuit, from standard test parameters.
- *
- * @param connection The connection to build the circuit end on.
- * @param testProps The test parameters to configure the circuit end construction.
- * @param uniqueId A unique number to being numbering destinations from, to make this circuit unique.
- *
- * @return A circuit end suitable for the publishing side of a test circuit.
- *
- * @throws JMSException Any underlying JMSExceptions are allowed to fall through and fail the creation.
- */
- public CircuitEndBase createPublisherCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId)
- throws JMSException
- {
- log.debug(
- "public CircuitEndBase createPublisherCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId = "
- + uniqueId + "): called");
-
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- // Check that the test properties do not contain AMQP/Qpid specific settings, and fail if they do.
- if (props.getImmediate() || props.getMandatory())
- {
- throw new RuntimeException(
- "Cannot create a pure JMS circuit as the test properties require AMQP specific options.");
- }
-
- Session session = connection.createSession(props.getPublisherTransacted(), props.getAckMode());
-
- Destination destination =
- props.getPubsub() ? session.createTopic(props.getSendDestinationNameRoot() + "_" + uniqueId)
- : session.createQueue(props.getSendDestinationNameRoot() + "_" + uniqueId);
-
- MessageProducer producer = props.getPublisherProducerBind() ? session.createProducer(destination) : null;
-
- MessageConsumer consumer =
- props.getPublisherConsumerBind()
- ? session.createConsumer(session.createQueue(props.getReceiveDestinationNameRoot() + "_" + uniqueId)) : null;
-
- MessageMonitor messageMonitor = new MessageMonitor();
-
- if (consumer != null)
- {
- consumer.setMessageListener(messageMonitor);
- }
-
- ExceptionMonitor exceptionMonitor = new ExceptionMonitor();
- connection.setExceptionListener(exceptionMonitor);
-
- if (!props.getPublisherConsumerActive() && (consumer != null))
- {
- consumer.close();
- }
-
- return new CircuitEndBase(producer, consumer, session, messageMonitor, exceptionMonitor);
- }
-
- /**
- * Builds a circuit end suitable for the receiving side of a test circuit, from standard test parameters.
- *
- * @param connection The connection to build the circuit end on.
- * @param testProps The test parameters to configure the circuit end construction.
- * @param uniqueId A unique number to being numbering destinations from, to make this circuit unique.
- *
- * @return A circuit end suitable for the receiving side of a test circuit.
- *
- * @throws JMSException Any underlying JMSExceptions are allowed to fall through and fail the creation.
- */
- public CircuitEndBase createReceiverCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId)
- throws JMSException
- {
- log.debug(
- "public CircuitEndBase createReceiverCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId = "
- + uniqueId + "): called");
-
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- // Check that the test properties do not contain AMQP/Qpid specific settings, and fail if they do.
- if (props.getImmediate() || props.getMandatory())
- {
- throw new RuntimeException(
- "Cannot create a pure JMS circuit as the test properties require AMQP specific options.");
- }
-
- Session session = connection.createSession(props.getPublisherTransacted(), props.getAckMode());
-
- MessageProducer producer =
- props.getReceiverProducerBind()
- ? session.createProducer(session.createQueue(props.getReceiveDestinationNameRoot() + "_" + uniqueId)) : null;
-
- Destination destination =
- props.getPubsub() ? session.createTopic(props.getSendDestinationNameRoot() + "_" + uniqueId)
- : session.createQueue(props.getSendDestinationNameRoot() + "_" + uniqueId);
-
- MessageConsumer consumer =
- props.getReceiverConsumerBind()
- ? ((props.getDurableSubscription() && props.getPubsub())
- ? session.createDurableSubscriber((Topic) destination, "testsub") : session.createConsumer(destination))
- : null;
-
- MessageMonitor messageMonitor = new MessageMonitor();
-
- if (consumer != null)
- {
- consumer.setMessageListener(messageMonitor);
- }
-
- if (!props.getReceiverConsumerActive() && (consumer != null))
- {
- consumer.close();
- }
-
- return new CircuitEndBase(producer, consumer, session, messageMonitor, null);
- }
-
- /**
- * Sets the sender test client to coordinate the test with.
- *
- * @param sender The contact details of the sending client in the test.
- */
- public void setSender(TestClientDetails sender)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Sets the receiving test client to coordinate the test with.
- *
- * @param receiver The contact details of the sending client in the test.
- */
- public void setReceiver(TestClientDetails receiver)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Supplies the sending test client.
- *
- * @return The sending test client.
- */
- public TestClientDetails getSender()
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Supplies the receiving test client.
- *
- * @return The receiving test client.
- */
- public List<TestClientDetails> getReceivers()
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Accepts the conversation factory over which to hold the test coordinating conversation.
- *
- * @param conversationFactory The conversation factory to coordinate the test over.
- */
- public void setConversationFactory(ConversationFactory conversationFactory)
- {
- throw new RuntimeException("Not implemented.");
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessageIdentityVector.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessageIdentityVector.java
deleted file mode 100644
index 397c4e9fbd..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessageIdentityVector.java
+++ /dev/null
@@ -1,167 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-/**
- * MessageIdentityVector provides a message identification scheme, that matches individual messages with test cases.
- * Test messages are being sent by a number of test clients, sending messages over a set of routes, and being received
- * by another set of test clients. Each test is itself, being run within a test cycle, of which there could be many. It
- * is the job of the test coordinator to request and receive reports from the available test clients, on what has been
- * sent, what has been received, and what errors may have occurred, and to reconcile this information against the
- * assertions being applied by the test case. In order to be able to figure out which messages belong to which test,
- * there needs to be an identification scheme, that the coordinator can use to correlate messages in senders and
- * receiver reports. Every message sent in a test can be associated with this information.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Identify a test case, a handling client id, a circuit end within the client, and a test cycle number.
- * </table>
- */
-public class MessageIdentityVector
-{
- /** Holds the test case vector component of the message identity vector. */
- private TestCaseVector testCaseVector;
-
- /** The unique client id. */
- private String clientId;
-
- /** The unique circuit end number within the client id. */
- private int circuitEndId;
-
- /**
- * Creates a new identity vector for test messages.
- *
- * @param testCase The name of the test case generating the messages.
- * @param clientId The unique id of the client implementing a circuit end that is handling the messages.
- * @param circuitEndId The unique id number of the circuit end within the client.
- * @param testCycleNumber The cycle iteration number of the test case.
- */
- public MessageIdentityVector(String testCase, String clientId, int circuitEndId, int testCycleNumber)
- {
- this.testCaseVector = new TestCaseVector(testCase, testCycleNumber);
- this.clientId = clientId;
- this.circuitEndId = circuitEndId;
- }
-
- /**
- * Reports the test case vector component of the message identity vector.
- *
- * @return The test case vector component of the message identity vector.
- */
- public TestCaseVector getTestCaseVector()
- {
- return testCaseVector;
- }
-
- /**
- * Reports the name of the test case.
- *
- * @return The name of the test case.
- */
- public String getTestCase()
- {
- return testCaseVector.getTestCase();
- }
-
- /**
- * Reports the test iteration cycle number within the test case.
- *
- * @return The test iteration cycle number within the test case.
- */
- public int getTestCycleNumber()
- {
- return testCaseVector.getTestCycleNumber();
- }
-
- /**
- * Resports the client id.
- *
- * @return The client id.
- */
- public String getClientId()
- {
- return clientId;
- }
-
- /**
- * Reports the circuit end number within the test client.
- *
- * @return The circuit end number within the test client.
- */
- public int getCircuitEndId()
- {
- return circuitEndId;
- }
-
- /**
- * Compares this identity vector with another for equality. All fields must match.
- *
- * @param o The identity vector to compare with.
- *
- * @return <tt>true</tt> if the identity vector is identical to this one by all fields, <tt>false</tt> otherwise.
- */
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
-
- if ((o == null) || (getClass() != o.getClass()))
- {
- return false;
- }
-
- MessageIdentityVector that = (MessageIdentityVector) o;
-
- if (circuitEndId != that.circuitEndId)
- {
- return false;
- }
-
- if ((clientId != null) ? (!clientId.equals(that.clientId)) : (that.clientId != null))
- {
- return false;
- }
-
- if ((testCaseVector != null) ? (!testCaseVector.equals(that.testCaseVector)) : (that.testCaseVector != null))
- {
- return false;
- }
-
- return true;
- }
-
- /**
- * Computes a hash code for this identity vector based on all fields.
- *
- * @return A hash code for this identity vector based on all fields.
- */
- public int hashCode()
- {
- int result;
- result = ((testCaseVector != null) ? testCaseVector.hashCode() : 0);
- result = (31 * result) + ((clientId != null) ? clientId.hashCode() : 0);
- result = (31 * result) + circuitEndId;
-
- return result;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessageMonitor.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessageMonitor.java
deleted file mode 100644
index 3fac969369..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessageMonitor.java
+++ /dev/null
@@ -1,105 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.log4j.Logger;
-
-import javax.jms.Message;
-import javax.jms.MessageListener;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * MessageMonitor is used to record information about messages received. This will provide methods to check various
- * properties, such as the type, number and content of messages received in order to verify the correct behaviour of
- * tests.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Count incoming messages.
- * <tr><td> Record time ellapsed since the arrival of the first message.
- * <tr><td> Reset all counts and timings.
- * </table>
- */
-public class MessageMonitor implements MessageListener
-{
- /** Used for debugging. */
- private final Logger log = Logger.getLogger(MessageMonitor.class);
-
- /** Holds the count of messages received since the last query. */
- protected AtomicInteger numMessages = new AtomicInteger();
-
- /** Holds the time of arrival of the first message. */
- protected Long firstMessageTime = null;
-
- /**
- * Handles received messages. Does Nothing.
- *
- * @param message The message. Ignored.
- */
- public void onMessage(Message message)
- {
- // log.debug("public void onMessage(Message message): called");
-
- numMessages.getAndIncrement();
- }
-
- /**
- * Gets the count of messages.
- *
- * @return The count of messages.
- */
- public int getNumMessage()
- {
- if (firstMessageTime == null)
- {
- firstMessageTime = System.nanoTime();
- }
-
- return numMessages.get();
- }
-
- /**
- * Gets the time elapsed since the first message arrived, in nanos, or zero if no messages have arrived yet.
- *
- * @return The time elapsed since the first message arrived, in nanos, or zero if no messages have arrived yet.
- */
- public long getTime()
- {
- if (firstMessageTime != null)
- {
- return System.nanoTime() - firstMessageTime;
- }
- else
- {
- return 0L;
- }
- }
-
- /**
- * Resets the message count and timer to zero.
- */
- public void reset()
- {
- numMessages.set(0);
- firstMessageTime = null;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessagingTestConfigProperties.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessagingTestConfigProperties.java
deleted file mode 100644
index 27f9261d94..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/MessagingTestConfigProperties.java
+++ /dev/null
@@ -1,685 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.Session;
-
-import java.util.Properties;
-
-/**
- * MessagingTestConfigProperties defines a set of property names and default values for specifying a messaging topology,
- * and test parameters for running a messaging test over that topology. A Properties object holding some of these
- * properties, superimposed onto the defaults, is used to establish test topologies and control test behaviour.
- *
- * <p/>A complete list of the parameters, default values and comments on their usage is provided here:
- *
- * <p/><table><caption>Parameters</caption>
- * <tr><th> Parameter <th> Default <th> Comments
- * <tr><td> messageSize <td> 0 <td> Message size in bytes. Not including any headers.
- * <tr><td> destinationName <td> ping <td> The root name to use to generate destination names to ping.
- * <tr><td> persistent <td> false <td> Determines whether peristent delivery is used.
- * <tr><td> transacted <td> false <td> Determines whether messages are sent/received in transactions.
- * <tr><td> broker <td> tcp://localhost:5672 <td> Determines the broker to connect to.
- * <tr><td> virtualHost <td> test <td> Determines the virtual host to send all ping over.
- * <tr><td> rate <td> 0 <td> The maximum rate (in hertz) to send messages at. 0 means no limit.
- * <tr><td> verbose <td> false <td> The verbose flag for debugging. Prints to console on every message.
- * <tr><td> pubsub <td> false <td> Whether to ping topics or queues. Uses p2p by default.
- * <tr><td> username <td> guest <td> The username to access the broker with.
- * <tr><td> password <td> guest <td> The password to access the broker with.
- * <tr><td> selector <td> null <td> Not used. Defines a message selector to filter pings with.
- * <tr><td> destinationCount <td> 1 <td> The number of receivers listening to the pings.
- * <tr><td> timeout <td> 30000 <td> In milliseconds. The timeout to stop waiting for replies.
- * <tr><td> commitBatchSize <td> 1 <td> The number of messages per transaction in transactional mode.
- * <tr><td> uniqueDests <td> true <td> Whether each receivers only listens to one ping destination or all.
- * <tr><td> durableDests <td> false <td> Whether or not durable destinations are used.
- * <tr><td> ackMode <td> AUTO_ACK <td> The message acknowledgement mode. Possible values are:
- * 0 - SESSION_TRANSACTED
- * 1 - AUTO_ACKNOWLEDGE
- * 2 - CLIENT_ACKNOWLEDGE
- * 3 - DUPS_OK_ACKNOWLEDGE
- * 257 - NO_ACKNOWLEDGE
- * 258 - PRE_ACKNOWLEDGE
- * <tr><td> maxPending <td> 0 <td> The maximum size in bytes, of messages sent but not yet received.
- * Limits the volume of messages currently buffered on the client
- * or broker. Can help scale test clients by limiting amount of buffered
- * data to avoid out of memory errors.
- * </table>
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide the names and defaults of all test parameters.
- * </table>
- *
- * @todo Put a type-safe wrapper around these properties, but continue to store the parameters as properties. This is
- * simply to ensure that it is a simple matter to serialize/deserialize string/string pairs onto messages.
- */
-public class MessagingTestConfigProperties extends ParsedProperties
-{
- // ====================== Connection Properties ==================================
-
- /** Holds the name of the default connection configuration. */
- public static final String CONNECTION_NAME = "broker";
-
- /** Holds the name of the property to get the initial context factory name from. */
- public static final String INITIAL_CONTEXT_FACTORY_PROPNAME = "java.naming.factory.initial";
-
- /** Defines the class to use as the initial context factory by default. */
- public static final String INITIAL_CONTEXT_FACTORY_DEFAULT = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
-
- /** Holds the name of the property to get the test broker url from. */
- public static final String BROKER_PROPNAME = "qpid.test.broker";
-
- /** Holds the default broker url for the test. */
- public static final String BROKER_DEFAULT = "vm://:1";
-
- /** Holds the name of the property to get the test broker virtual path. */
- public static final String VIRTUAL_HOST_PROPNAME = "virtualHost";
-
- /** Holds the default virtual path for the test. */
- public static final String VIRTUAL_HOST_DEFAULT = "";
-
- /** Holds the name of the property to get the broker access username from. */
- public static final String USERNAME_PROPNAME = "username";
-
- /** Holds the default broker log on username. */
- public static final String USERNAME_DEFAULT = "guest";
-
- /** Holds the name of the property to get the broker access password from. */
- public static final String PASSWORD_PROPNAME = "password";
-
- /** Holds the default broker log on password. */
- public static final String PASSWORD_DEFAULT = "guest";
-
- // ====================== Messaging Topology Properties ==========================
-
- /** Holds the name of the property to get the bind publisher procuder flag from. */
- public static final String PUBLISHER_PRODUCER_BIND_PROPNAME = "publisherProducerBind";
-
- /** Holds the default value of the publisher producer flag. */
- public static final boolean PUBLISHER_PRODUCER_BIND_DEFAULT = true;
-
- /** Holds the name of the property to get the bind publisher procuder flag from. */
- public static final String PUBLISHER_CONSUMER_BIND_PROPNAME = "publisherConsumerBind";
-
- /** Holds the default value of the publisher consumer flag. */
- public static final boolean PUBLISHER_CONSUMER_BIND_DEFAULT = false;
-
- /** Holds the name of the property to get the bind receivers procuder flag from. */
- public static final String RECEIVER_PRODUCER_BIND_PROPNAME = "receiverProducerBind";
-
- /** Holds the default value of the receivers producer flag. */
- public static final boolean RECEIVER_PRODUCER_BIND_DEFAULT = false;
-
- /** Holds the name of the property to get the bind receivers procuder flag from. */
- public static final String RECEIVER_CONSUMER_BIND_PROPNAME = "receiverConsumerBind";
-
- /** Holds the default value of the receivers consumer flag. */
- public static final boolean RECEIVER_CONSUMER_BIND_DEFAULT = true;
-
- /** Holds the name of the property to get the publishers consumer active flag from. */
- public static final String PUBLISHER_CONSUMER_ACTIVE_PROPNAME = "publisherConsumerActive";
-
- /** Holds the default value of the publishers consumer active flag. */
- public static final boolean PUBLISHER_CONSUMER_ACTIVE_DEFAULT = true;
-
- /** Holds the name of the property to get the receivers consumer active flag from. */
- public static final String RECEIVER_CONSUMER_ACTIVE_PROPNAME = "receiverConsumerActive";
-
- /** Holds the default value of the receivers consumer active flag. */
- public static final boolean RECEIVER_CONSUMER_ACTIVE_DEFAULT = true;
-
- /** Holds the name of the property to get the destination name root from. */
- public static final String SEND_DESTINATION_NAME_ROOT_PROPNAME = "sendDestinationRoot";
-
- /** Holds the root of the name of the default destination to send to. */
- public static final String SEND_DESTINATION_NAME_ROOT_DEFAULT = "sendTo";
-
- /** Holds the name of the property to get the destination name root from. */
- public static final String RECEIVE_DESTINATION_NAME_ROOT_PROPNAME = "receiveDestinationRoot";
-
- /** Holds the root of the name of the default destination to send to. */
- public static final String RECEIVE_DESTINATION_NAME_ROOT_DEFAULT = "receiveFrom";
-
- /** Holds the name of the proeprty to get the destination count from. */
- public static final String DESTINATION_COUNT_PROPNAME = "destinationCount";
-
- /** Defines the default number of destinations to ping. */
- public static final int DESTINATION_COUNT_DEFAULT = 1;
-
- /** Holds the name of the property to get the p2p or pub/sub messaging mode from. */
- public static final String PUBSUB_PROPNAME = "pubsub";
-
- /** Holds the pub/sub mode default, true means ping a topic, false means ping a queue. */
- public static final boolean PUBSUB_DEFAULT = false;
-
- // ====================== JMS Options and Flags =================================
-
- /** Holds the name of the property to get the test delivery mode from. */
- public static final String PERSISTENT_MODE_PROPNAME = "persistent";
-
- /** Holds the message delivery mode to use for the test. */
- public static final boolean PERSISTENT_MODE_DEFAULT = false;
-
- /** Holds the name of the property to get the test transactional mode from. */
- public static final String TRANSACTED_PUBLISHER_PROPNAME = "transactedPublisher";
-
- /** Holds the transactional mode to use for the test. */
- public static final boolean TRANSACTED_PUBLISHER_DEFAULT = false;
-
- /** Holds the name of the property to get the test transactional mode from. */
- public static final String TRANSACTED_RECEIVER_PROPNAME = "transactedReceiver";
-
- /** Holds the transactional mode to use for the test. */
- public static final boolean TRANSACTED_RECEIVER_DEFAULT = false;
-
- /** Holds the name of the property to set the no local flag from. */
- public static final String NO_LOCAL_PROPNAME = "noLocal";
-
- /** Defines the default value of the no local flag to use when consuming messages. */
- public static final boolean NO_LOCAL_DEFAULT = false;
-
- /** Holds the name of the property to get the message acknowledgement mode from. */
- public static final String ACK_MODE_PROPNAME = "ackMode";
-
- /** Defines the default message acknowledgement mode. */
- public static final int ACK_MODE_DEFAULT = Session.AUTO_ACKNOWLEDGE;
-
- /** Holds the name of the property to get the durable subscriptions flag from, when doing pub/sub messaging. */
- public static final String DURABLE_SUBSCRIPTION_PROPNAME = "durableSubscription";
-
- /** Defines the default value of the durable subscriptions flag. */
- public static final boolean DURABLE_SUBSCRIPTION_DEFAULT = false;
-
- // ====================== Qpid/AMQP Options and Flags ================================
-
- /** Holds the name of the property to set the exclusive flag from. */
- public static final String EXCLUSIVE_PROPNAME = "exclusive";
-
- /** Defines the default value of the exclusive flag to use when consuming messages. */
- public static final boolean EXCLUSIVE_DEFAULT = false;
-
- /** Holds the name of the property to set the immediate flag from. */
- public static final String IMMEDIATE_PROPNAME = "immediate";
-
- /** Defines the default value of the immediate flag to use when sending messages. */
- public static final boolean IMMEDIATE_DEFAULT = false;
-
- /** Holds the name of the property to set the mandatory flag from. */
- public static final String MANDATORY_PROPNAME = "mandatory";
-
- /** Defines the default value of the mandatory flag to use when sending messages. */
- public static final boolean MANDATORY_DEFAULT = false;
-
- /** Holds the name of the property to get the durable destinations flag from. */
- public static final String DURABLE_DESTS_PROPNAME = "durableDests";
-
- /** Default value for the durable destinations flag. */
- public static final boolean DURABLE_DESTS_DEFAULT = false;
-
- /** Holds the name of the property to set the prefetch size from. */
- public static final String PREFETCH_PROPNAME = "prefetch";
-
- /** Defines the default prefetch size to use when consuming messages. */
- public static final int PREFETCH_DEFAULT = 100;
-
- // ====================== Common Test Parameters ================================
-
- /** Holds the name of the property to get the test message size from. */
- public static final String MESSAGE_SIZE_PROPNAME = "messageSize";
-
- /** Used to set up a default message size. */
- public static final int MESSAGE_SIZE_DEAFULT = 0;
-
- /** Holds the name of the property to get the message rate from. */
- public static final String RATE_PROPNAME = "rate";
-
- /** Defines the default rate (in pings per second) to send pings at. 0 means as fast as possible, no restriction. */
- public static final int RATE_DEFAULT = 0;
-
- /** Holds the name of the proeprty to get the. */
- public static final String SELECTOR_PROPNAME = "selector";
-
- /** Holds the default message selector. */
- public static final String SELECTOR_DEFAULT = "";
-
- /** Holds the name of the property to get the waiting timeout for response messages. */
- public static final String TIMEOUT_PROPNAME = "timeout";
-
- /** Default time to wait before assuming that a ping has timed out. */
- public static final long TIMEOUT_DEFAULT = 30000;
-
- /** Holds the name of the property to get the commit batch size from. */
- public static final String TX_BATCH_SIZE_PROPNAME = "commitBatchSize";
-
- /** Defines the default number of pings to send in each transaction when running transactionally. */
- public static final int TX_BATCH_SIZE_DEFAULT = 1;
-
- /** Holds the name of the property to set the maximum amount of pending message data for a producer to hold. */
- public static final String MAX_PENDING_PROPNAME = "maxPending";
-
- /** Defines the default maximum quantity of pending message data to allow producers to hold. */
- public static final int MAX_PENDING_DEFAULT = 0;
-
- /** Holds the name of the property to get the publisher rollback flag from. */
- public static final String ROLLBACK_PUBLISHER_PROPNAME = "rollbackPublisher";
-
- /** Holds the default publisher roll back setting. */
- public static final boolean ROLLBACK_PUBLISHER_DEFAULT = false;
-
- /** Holds the name of the property to get the publisher rollback flag from. */
- public static final String ROLLBACK_RECEIVER_PROPNAME = "rollbackReceiver";
-
- /** Holds the default publisher roll back setting. */
- public static final boolean ROLLBACK_RECEIVER_DEFAULT = false;
-
- // ====================== Options that control the bahviour of the test framework. =========================
-
- /** Holds the name of the property to get the behavioural mode of not applicable assertions. */
- public static final String NOT_APPLICABLE_ASSERTION_PROPNAME = "notApplicableAssertion";
-
- /** Holds the default behavioral mode of not applicable assertions, which is logging them as a warning. */
- public static final String NOT_APPLICABLE_ASSERTION_DEFAULT = "warn";
-
- /** Holds the name of the property to get the verbose mode proeprty from. */
- public static final String VERBOSE_PROPNAME = "verbose";
-
- /** Holds the default verbose mode. */
- public static final boolean VERBOSE_DEFAULT = false;
-
- /** Holds the default configuration properties. */
- public static ParsedProperties defaults = new ParsedProperties();
-
- static
- {
- defaults.setPropertyIfNull(INITIAL_CONTEXT_FACTORY_PROPNAME, INITIAL_CONTEXT_FACTORY_DEFAULT);
- defaults.setPropertyIfNull(BROKER_PROPNAME, BROKER_DEFAULT);
- defaults.setPropertyIfNull(VIRTUAL_HOST_PROPNAME, VIRTUAL_HOST_DEFAULT);
- defaults.setPropertyIfNull(USERNAME_PROPNAME, USERNAME_DEFAULT);
- defaults.setPropertyIfNull(PASSWORD_PROPNAME, PASSWORD_DEFAULT);
-
- defaults.setPropertyIfNull(PUBLISHER_PRODUCER_BIND_PROPNAME, PUBLISHER_PRODUCER_BIND_DEFAULT);
- defaults.setPropertyIfNull(PUBLISHER_CONSUMER_BIND_PROPNAME, PUBLISHER_CONSUMER_BIND_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_PRODUCER_BIND_PROPNAME, RECEIVER_PRODUCER_BIND_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_CONSUMER_BIND_PROPNAME, RECEIVER_CONSUMER_BIND_DEFAULT);
- defaults.setPropertyIfNull(PUBLISHER_CONSUMER_ACTIVE_PROPNAME, PUBLISHER_CONSUMER_ACTIVE_DEFAULT);
- defaults.setPropertyIfNull(RECEIVER_CONSUMER_ACTIVE_PROPNAME, RECEIVER_CONSUMER_ACTIVE_DEFAULT);
- defaults.setPropertyIfNull(SEND_DESTINATION_NAME_ROOT_PROPNAME, SEND_DESTINATION_NAME_ROOT_DEFAULT);
- defaults.setPropertyIfNull(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME, RECEIVE_DESTINATION_NAME_ROOT_DEFAULT);
- defaults.setPropertyIfNull(DESTINATION_COUNT_PROPNAME, DESTINATION_COUNT_DEFAULT);
- defaults.setPropertyIfNull(PUBSUB_PROPNAME, PUBSUB_DEFAULT);
-
- defaults.setPropertyIfNull(PERSISTENT_MODE_PROPNAME, PERSISTENT_MODE_DEFAULT);
- defaults.setPropertyIfNull(TRANSACTED_PUBLISHER_PROPNAME, TRANSACTED_PUBLISHER_DEFAULT);
- defaults.setPropertyIfNull(TRANSACTED_RECEIVER_PROPNAME, TRANSACTED_RECEIVER_DEFAULT);
- defaults.setPropertyIfNull(NO_LOCAL_PROPNAME, NO_LOCAL_DEFAULT);
- defaults.setPropertyIfNull(ACK_MODE_PROPNAME, ACK_MODE_DEFAULT);
- defaults.setPropertyIfNull(DURABLE_SUBSCRIPTION_PROPNAME, DURABLE_SUBSCRIPTION_DEFAULT);
-
- defaults.setPropertyIfNull(EXCLUSIVE_PROPNAME, EXCLUSIVE_DEFAULT);
- defaults.setPropertyIfNull(IMMEDIATE_PROPNAME, IMMEDIATE_DEFAULT);
- defaults.setPropertyIfNull(MANDATORY_PROPNAME, MANDATORY_DEFAULT);
- defaults.setPropertyIfNull(DURABLE_DESTS_PROPNAME, DURABLE_DESTS_DEFAULT);
- defaults.setPropertyIfNull(PREFETCH_PROPNAME, PREFETCH_DEFAULT);
-
- defaults.setPropertyIfNull(MESSAGE_SIZE_PROPNAME, MESSAGE_SIZE_DEAFULT);
- defaults.setPropertyIfNull(RATE_PROPNAME, RATE_DEFAULT);
- defaults.setPropertyIfNull(SELECTOR_PROPNAME, SELECTOR_DEFAULT);
- defaults.setPropertyIfNull(TIMEOUT_PROPNAME, TIMEOUT_DEFAULT);
- defaults.setPropertyIfNull(TX_BATCH_SIZE_PROPNAME, TX_BATCH_SIZE_DEFAULT);
- defaults.setPropertyIfNull(MAX_PENDING_PROPNAME, MAX_PENDING_DEFAULT);
- defaults.setPropertyIfNull(ROLLBACK_PUBLISHER_PROPNAME, ROLLBACK_PUBLISHER_DEFAULT);
- defaults.setPropertyIfNull(ROLLBACK_RECEIVER_PROPNAME, ROLLBACK_RECEIVER_DEFAULT);
-
- defaults.setPropertyIfNull(NOT_APPLICABLE_ASSERTION_PROPNAME, NOT_APPLICABLE_ASSERTION_DEFAULT);
- defaults.setPropertyIfNull(VERBOSE_PROPNAME, VERBOSE_DEFAULT);
- }
-
- /**
- * Creates a test configuration based on the defaults.
- */
- public MessagingTestConfigProperties()
- {
- super(defaults);
- }
-
- /**
- * Creates a test configuration based on the supplied properties.
- *
- * @param properties The test configuration.
- */
- public MessagingTestConfigProperties(Properties properties)
- {
- super(properties);
- }
-
- /**
- * The size of test messages to send.
- *
- * @return The size of test messages to send.
- */
- public int getMessageSize()
- {
- return getPropertyAsInteger(MESSAGE_SIZE_PROPNAME);
- }
-
- /**
- * Flag to indicate that the publishing producer should be set up to publish to a destination.
- *
- * @return Flag to indicate that the publishing producer should be set up to publish to a destination.
- */
- public boolean getPublisherProducerBind()
- {
- return getPropertyAsBoolean(PUBLISHER_PRODUCER_BIND_PROPNAME);
- }
-
- /**
- * Flag to indicate that the publishing consumer should be set up to receive from a destination.
- *
- * @return Flag to indicate that the publishing consumer should be set up to receive from a destination.
- */
- public boolean getPublisherConsumerBind()
- {
- return getPropertyAsBoolean(PUBLISHER_CONSUMER_BIND_PROPNAME);
- }
-
- /**
- * Flag to indicate that the receiving producer should be set up to publish to a destination.
- *
- * @return Flag to indicate that the receiving producer should be set up to publish to a destination.
- */
- public boolean getReceiverProducerBind()
- {
- return getPropertyAsBoolean(RECEIVER_PRODUCER_BIND_PROPNAME);
- }
-
- /**
- * Flag to indicate that the receiving consumer should be set up to receive from a destination.
- *
- * @return Flag to indicate that the receiving consumer should be set up to receive from a destination.
- */
- public boolean getReceiverConsumerBind()
- {
- return getPropertyAsBoolean(RECEIVER_CONSUMER_BIND_PROPNAME);
- }
-
- /**
- * Flag to indicate that the publishing consumer should be created and actively listening.
- *
- * @return Flag to indicate that the publishing consumer should be created.
- */
- public boolean getPublisherConsumerActive()
- {
- return getPropertyAsBoolean(PUBLISHER_CONSUMER_ACTIVE_PROPNAME);
- }
-
- /**
- * Flag to indicate that the receiving consumers should be created and actively listening.
- *
- * @return Flag to indicate that the receiving consumers should be created and actively listening.
- */
- public boolean getReceiverConsumerActive()
- {
- return getPropertyAsBoolean(RECEIVER_CONSUMER_ACTIVE_PROPNAME);
- }
-
- /**
- * A root to create all test destination names from.
- *
- * @return A root to create all test destination names from.
- */
- public String getSendDestinationNameRoot()
- {
- return getProperty(SEND_DESTINATION_NAME_ROOT_PROPNAME);
- }
-
- /**
- * A root to create all receiving destination names from.
- *
- * @return A root to create all receiving destination names from.
- */
- public String getReceiveDestinationNameRoot()
- {
- return getProperty(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME);
- }
-
- /**
- * Flag to indicate that persistent messages should be used.
- *
- * @return Flag to indicate that persistent messages should be used.
- */
- public boolean getPersistentMode()
- {
- return getPropertyAsBoolean(PERSISTENT_MODE_PROPNAME);
- }
-
- /**
- * Flag to indicate that transactional messages should be sent by the publisher.
- *
- * @return Flag to indicate that transactional messages should be sent by the publisher.
- */
- public boolean getPublisherTransacted()
- {
- return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME);
- }
-
- /**
- * Flag to indicate that transactional receives should be used by the receiver.
- *
- * @return Flag to indicate that transactional receives should be used by the receiver.
- */
- public boolean getReceiverTransacted()
- {
- return getPropertyAsBoolean(TRANSACTED_PUBLISHER_PROPNAME);
- }
-
- /**
- * The name of the virtual host to run all tests over.
- *
- * @return The name of the virtual host to run all tests over.
- */
- public String getVirtualHost()
- {
- return getProperty(VIRTUAL_HOST_PROPNAME);
- }
-
- /**
- * Limiting rate for each sender in messages per second, or zero for unlimited.
- *
- * @return Limiting rate for each sender in messages per second, or zero for unlimited.
- */
- public String getRate()
- {
- return getProperty(RATE_PROPNAME);
- }
-
- /**
- * Flag to indicate that test messages should be received publish/subscribe style by all receivers.
- *
- * @return Flag to indicate that test messages should be received publish/subscribe style by all receivers.
- */
- public boolean getPubsub()
- {
- return getPropertyAsBoolean(PUBSUB_PROPNAME);
- }
-
- /**
- * The username credentials to run tests with.
- *
- * @return The username credentials to run tests with.
- */
- public String getUsername()
- {
- return getProperty(USERNAME_PROPNAME);
- }
-
- /**
- * The password credentials to run tests with.
- *
- * @return The password credentials to run tests with.
- */
- public String getPassword()
- {
- return getProperty(PASSWORD_PROPNAME);
- }
-
- /**
- * The timeout duration to fail tests on, should they receive no messages within it.
- *
- * @return The timeout duration to fail tests on, should they receive no messages within it.
- */
- public long getTimeout()
- {
- return getPropertyAsLong(TIMEOUT_PROPNAME);
- }
-
- /**
- * The number of messages to batch into each transaction in transational tests.
- *
- * @return The number of messages to batch into each transaction in transational tests.
- */
- public int getTxBatchSize()
- {
- return getPropertyAsInteger(TX_BATCH_SIZE_PROPNAME);
- }
-
- /**
- * Flag to indicate that tests should use durable destinations.
- *
- * @return Flag to indicate that tests should use durable destinations.
- */
- public boolean getDurableDests()
- {
- return getPropertyAsBoolean(DURABLE_DESTS_PROPNAME);
- }
-
- /**
- * The ack mode for message receivers to use.
- *
- * @return The ack mode for message receivers to use.
- */
- public int getAckMode()
- {
- return getPropertyAsInteger(ACK_MODE_PROPNAME);
- }
-
- /**
- * Flag to indicate that tests should use durable subscriptions.
- *
- * @return Flag to indicate that tests should use durable subscriptions.
- */
- public boolean getDurableSubscription()
- {
- return getPropertyAsBoolean(DURABLE_SUBSCRIPTION_PROPNAME);
- }
-
- /**
- * The maximum amount of in-flight data, in bytes, that tests should send at any time.
- *
- * @return The maximum amount of in-flight data, in bytes, that tests should send at any time.
- */
- public int getMaxPending()
- {
- return getPropertyAsInteger(MAX_PENDING_PROPNAME);
- }
-
- /**
- * The size of the prefetch queue to use.
- *
- * @return The size of the prefetch queue to use.
- */
- public int getPrefetch()
- {
- return getPropertyAsInteger(PREFETCH_PROPNAME);
- }
-
- /**
- * Flag to indicate that subscriptions should be no-local.
- *
- * @return Flag to indicate that subscriptions should be no-local.
- */
- public boolean getNoLocal()
- {
- return getPropertyAsBoolean(NO_LOCAL_PROPNAME);
- }
-
- /**
- * Flag to indicate that subscriptions should be exclusive.
- *
- * @return Flag to indicate that subscriptions should be exclusive.
- */
- public boolean getExclusive()
- {
- return getPropertyAsBoolean(EXCLUSIVE_PROPNAME);
- }
-
- /**
- * Flag to indicate that messages must be delivered immediately.
- *
- * @return Flag to indicate that messages must be delivered immediately.
- */
- public boolean getImmediate()
- {
- return getPropertyAsBoolean(IMMEDIATE_PROPNAME);
- }
-
- /**
- * Flag to indicate that messages must be routable.
- *
- * @return Flag to indicate that messages must be routable.
- */
- public boolean getMandatory()
- {
- return getPropertyAsBoolean(MANDATORY_PROPNAME);
- }
-
- /**
- * Gets the value of a flag to indicate that the publisher should rollback all messages sent.
- *
- * @return A flag to indicate that the publisher should rollback all messages sent.
- */
- public boolean getRollbackPublisher()
- {
- return getPropertyAsBoolean(ROLLBACK_PUBLISHER_PROPNAME);
- }
-
- /**
- * Gets the value of a flag to indicate that the receiver should rollback all messages received, then receive them
- * again.
- *
- * @return A flag to indicate that the publisher should rollback all messages received.
- */
- public boolean getRollbackReceiver()
- {
- return getPropertyAsBoolean(ROLLBACK_RECEIVER_PROPNAME);
- }
-
- /**
- * Gets the behavioural mode of not applicable assertions. Should be one of 'quiet', 'warn' or 'fail'.
- *
- * @return The behavioural mode of not applicable assertions.
- */
- public String getNotApplicableAssertionMode()
- {
- return getProperty(NOT_APPLICABLE_ASSERTION_PROPNAME);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/NotApplicableAssertion.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/NotApplicableAssertion.java
deleted file mode 100644
index 2a20be12d6..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/NotApplicableAssertion.java
+++ /dev/null
@@ -1,112 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-/**
- * NotApplicableAssertion is a messaging assertion that can be used when an assertion requested by a test-case is not
- * applicable to the testing scenario. For example an assertion may relate to AMQP functionality, but a test case may be
- * being run over a non-AMQP JMS implementation, in which case the request to create the assertion may return this
- * instead of the proper assertion. The test framework is configurable to quietly drop these assertions, log them
- * as warnings to the console, or raise them as test failures.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Quitely pass.
- * <tr><td> Log a warning.
- * <tr><td> Raise a test failure.
- * </table>
- */
-public class NotApplicableAssertion implements Assertion
-{
- /** Used for logging to the console. */
- private static final Logger console = Logger.getLogger("CONSOLE." + NotApplicableAssertion.class.getName());
-
- /** The possible behavioural modes of this assertion. */
- private enum Mode
- {
- /** Quietly ignore the assertion by passing. */
- Quiet,
-
- /** Ignore the assertion by passing but log a warning about it. */
- Warn,
-
- /** Fail the assertion. */
- Fail;
- }
-
- /** The behavioural mode of the assertion. */
- private Mode mode;
-
- /**
- * Creates an assertion that is driven by the value of the 'notApplicableAssertion' property of the test
- * configuration. Its value should match one of 'quiet', 'warn' or 'fail' and if it does not it is automatically
- * read as 'fail'.
- *
- * @param testProperties The test configuration properties.
- */
- public NotApplicableAssertion(ParsedProperties testProperties)
- {
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProperties);
-
- String modeName = props.getNotApplicableAssertionMode();
-
- if ("quiet".equals(modeName))
- {
- mode = Mode.Quiet;
- }
- else if ("warn".equals(modeName))
- {
- mode = Mode.Warn;
- }
- else
- {
- mode = Mode.Fail;
- }
- }
-
- /**
- * Applies the assertion.
- *
- * @return <tt>true</tt> if the assertion passes, <tt>false</tt> if it fails.
- */
- public boolean apply()
- {
- switch (mode)
- {
- case Quiet:
- return true;
-
- case Warn:
- console.warn("Warning: Not applicable assertion being ignored.");
-
- return true;
-
- case Fail:
- default:
- return false;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Publisher.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Publisher.java
deleted file mode 100644
index 2c8be4f787..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Publisher.java
+++ /dev/null
@@ -1,74 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-/**
- * A Publisher represents the status of the publishing side of a test circuit. Its main purpose is to provide assertions
- * that can be applied to test the behaviour of the publishers.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Provide assertion that the publishers received no exceptions.
- * </table>
- *
- * @todo There are mixtures of AMQP and JMS assertions in this interface. Either keep them here, but quietly (or with a
- * warning or error) drop them from test cases where they are not relevant, or push them down into sub-classes.
- * I am tempted to go with the dropping/warning/error approach, that would imply that it makes sense to pull
- * the assertions back from AMQPPublisher to here.
- */
-public interface Publisher
-{
- // Assertions that are meaningfull to AMQP and to JMS.
-
- /**
- * Provides an assertion that the publisher encountered no exceptions.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the publisher encountered no exceptions.
- */
- public Assertion noExceptionsAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to AMQP.
-
- /**
- * Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the AMQP channel was forcibly closed by an error condition.
- */
- public Assertion channelClosedAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to Java/JMS.
-
- /**
- * Provides an assertion that the publisher got a given exception during the test.
- *
- * @param testProps The test configuration properties.
- * @param exceptionClass The exception class to check for.
- *
- * @return An assertion that the publisher got a given exception during the test.
- */
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass);
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Receiver.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Receiver.java
deleted file mode 100644
index 19dc4d90e7..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/Receiver.java
+++ /dev/null
@@ -1,92 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-/**
- * A Receiver is a {@link CircuitEnd} that represents the status of the receiving side of a test circuit. Its main
- * purpose is to provide assertions that can be applied to check the behaviour of the receivers.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Provide assertion that the receivers received no exceptions.
- * <tr><td> Provide assertion that the receivers received all test messages sent to it.
- * </table>
- *
- * @todo There are mixtures of AMQP and JMS assertions in this interface. Either keep them here, but quietly (or with a
- * warning or error) drop them from test cases where they are not relevant, or push them down into sub-classes.
- * I am tempted to go with the dropping/warning/error approach.
- */
-public interface Receiver
-{
- // Assertions that are meaningfull to AMQP and to JMS.
-
- /**
- * Provides an assertion that the receivers encountered no exceptions.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the receivers encountered no exceptions.
- */
- public Assertion noExceptionsAssertion(ParsedProperties testProps);
-
- /**
- * Provides an assertion that the receivers got all messages that were sent to it.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the receivers got all messages that were sent to it.
- */
- public Assertion allMessagesReceivedAssertion(ParsedProperties testProps);
-
- /**
- * Provides an assertion that the receivers got none of the messages that were sent to it.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the receivers got none of the messages that were sent to it.
- */
- public Assertion noMessagesReceivedAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to AMQP.
-
- /**
- * Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the AMQP channel was forcibly closed by an error condition.
- */
- public Assertion channelClosedAssertion(ParsedProperties testProps);
-
- // Assertions that are meaningfull only to Java/JMS.
-
- /**
- * Provides an assertion that the receiver got a given exception during the test.
- *
- * @param testProps The test configuration properties.
- * @param exceptionClass The exception class to check for.
- *
- * @return An assertion that the receiver got a given exception during the test.
- */
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass);
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestCaseVector.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestCaseVector.java
deleted file mode 100644
index ad1e70f6f7..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestCaseVector.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework;
-
-/**
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </table>
- */
-public class TestCaseVector
-{
- /** The test case name. */
- private String testCase;
-
- /** The test cycle number within the test case. */
- private int testCycleNumber;
-
- public TestCaseVector(String testCase, int testCycleNumber)
- {
- this.testCase = testCase;
- this.testCycleNumber = testCycleNumber;
- }
-
- public String getTestCase()
- {
- return testCase;
- }
-
- public int getTestCycleNumber()
- {
- return testCycleNumber;
- }
-
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
-
- if ((o == null) || (getClass() != o.getClass()))
- {
- return false;
- }
-
- TestCaseVector that = (TestCaseVector) o;
-
- if (testCycleNumber != that.testCycleNumber)
- {
- return false;
- }
-
- if ((testCase != null) ? (!testCase.equals(that.testCase)) : (that.testCase != null))
- {
- return false;
- }
-
- return true;
- }
-
- public int hashCode()
- {
- int result;
- result = ((testCase != null) ? testCase.hashCode() : 0);
- result = (31 * result) + testCycleNumber;
-
- return result;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestClientDetails.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestClientDetails.java
deleted file mode 100644
index 7498f2b6b5..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestClientDetails.java
+++ /dev/null
@@ -1,86 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-/**
- * TestClientDetails is used to encapsulate information about an interop test client. It pairs together the unique
- * name of the client, and the route on which it listens to its control messages.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Record test clients control addresses together with their names.
- * </table>
- */
-public class TestClientDetails
-{
- /** The test clients name. */
- public String clientName;
-
- /* The test clients unique sequence number. Not currently used. */
-
- /** The routing key of the test clients control topic. */
- public String privateControlKey;
-
- /**
- * Two TestClientDetails are considered to be equal, iff they have the same client name.
- *
- * @param o The object to compare to.
- *
- * @return <tt>If the object to compare to is a TestClientDetails equal to this one, <tt>false</tt> otherwise.
- */
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
-
- if (!(o instanceof TestClientDetails))
- {
- return false;
- }
-
- final TestClientDetails testClientDetails = (TestClientDetails) o;
-
- return !((clientName != null) ? (!clientName.equals(testClientDetails.clientName))
- : (testClientDetails.clientName != null));
- }
-
- /**
- * Computes a hash code compatible with the equals method; based on the client name alone.
- *
- * @return A hash code for this.
- */
- public int hashCode()
- {
- return ((clientName != null) ? clientName.hashCode() : 0);
- }
-
- /**
- * Outputs the client name and address details. Mostly used for debugging purposes.
- *
- * @return The client name and address.
- */
- public String toString()
- {
- return "TestClientDetails: [ clientName = " + clientName + ", privateControlKey = " + privateControlKey + " ]";
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestUtils.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestUtils.java
deleted file mode 100644
index d7a6f83527..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/TestUtils.java
+++ /dev/null
@@ -1,192 +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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.log4j.Logger;
-
-import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import java.util.Map;
-
-/**
- * TestUtils provides static helper methods that are usefull for writing tests against QPid.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create connections from test properties. <td> {@link MessagingTestConfigProperties}
- * <tr><td> Create test messages.
- * <tr><td> Inject a short pause in a test.
- * <tr><td> Serialize properties into a message.
- * </table>
- */
-public class TestUtils
-{
- /** Used for debugging. */
- private static Logger log = Logger.getLogger(TestUtils.class);
-
- /** Some dummy data to stuff all test messages with. */
- private static final byte[] MESSAGE_DATA_BYTES =
- "Test Message -- Test Message -- Test Message -- Test Message -- Test Message -- Test Message -- Test Message -- "
- .getBytes();
-
- /**
- * Establishes a JMS connection using a set of properties and qpids built in JNDI implementation. This is a simple
- * convenience method for code that does not anticipate handling connection failures. All exceptions that indicate
- * that the connection has failed, are wrapped as rutime exceptions, presumably handled by a top level failure
- * handler.
- *
- * <p/>This utility makes use of the following test parameters from {@link MessagingTestConfigProperties} to control
- * the connection creation:
- *
- * <p/><table>
- * <tr><td> {@link MessagingTestConfigProperties#USERNAME_PROPNAME} <td> The username.
- * <tr><td> {@link MessagingTestConfigProperties#PASSWORD_PROPNAME} <td> The password.
- * <tr><td> {@link MessagingTestConfigProperties#VIRTUAL_HOST_PROPNAME} <td> The virtual host name.
- * <tr><td> {@link MessagingTestConfigProperties#BROKER_PROPNAME} <td> The broker URL.
- * <tr><td> {@link MessagingTestConfigProperties#CONNECTION_NAME} <td> The broker name in the initial context.
- *
- * @param messagingProps Connection properties as defined in {@link MessagingTestConfigProperties}.
- *
- * @return A JMS conneciton.
- */
- public static Connection createConnection(ParsedProperties messagingProps)
- {
- log.debug("public static Connection createConnection(ParsedProperties messagingProps = " + messagingProps
- + "): called");
-
- try
- {
- // Extract the configured connection properties from the test configuration.
- String conUsername = messagingProps.getProperty(USERNAME_PROPNAME);
- String conPassword = messagingProps.getProperty(PASSWORD_PROPNAME);
- String virtualHost = messagingProps.getProperty(VIRTUAL_HOST_PROPNAME);
- String brokerUrl = messagingProps.getProperty(BROKER_PROPNAME);
-
- // Create the broker connection url.
- String connectionString =
- "amqp://" + conUsername + ":" + conPassword + "@clientid/" + ((virtualHost != null) ? virtualHost : "")
- + "?brokerlist='" + brokerUrl + "'";
-
- // Create properties to create the initial context from, and inject the connection factory configuration
- // for the defined connection name into it.
- messagingProps.setProperty("connectionfactory." + CONNECTION_NAME, connectionString);
-
- Context ctx = new InitialContext(messagingProps);
-
- ConnectionFactory cf = (ConnectionFactory) ctx.lookup(CONNECTION_NAME);
-
- return cf.createConnection();
- }
- catch (NamingException e)
- {
- throw new RuntimeException("Got JNDI NamingException whilst looking up the connection factory.", e);
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Could not establish connection due to JMSException.", e);
- }
- }
-
- /**
- * Creates a test message of the specified size, on the given JMS session.
- *
- * @param session The JMS session.
- * @param size The size of the message in bytes.
- *
- * @return A bytes message, of the specified size, filled with dummy data.
- *
- * @throws JMSException Any underlying JMSExceptions are allowed to fall through.
- */
- public static Message createTestMessageOfSize(Session session, int size) throws JMSException
- {
- BytesMessage message = session.createBytesMessage();
-
- if (size > 0)
- {
- int div = MESSAGE_DATA_BYTES.length / size;
- int mod = MESSAGE_DATA_BYTES.length % size;
-
- for (int i = 0; i < div; i++)
- {
- message.writeBytes(MESSAGE_DATA_BYTES);
- }
-
- if (mod != 0)
- {
- message.writeBytes(MESSAGE_DATA_BYTES, 0, mod);
- }
- }
-
- return message;
- }
-
- /**
- * Pauses for the specified length of time. In the event of failing to pause for at least that length of time
- * due to interuption of the thread, a RutimeException is raised to indicate the failure. The interupted status
- * of the thread is restores in that case. This method should only be used when it is expected that the pause
- * will be succesfull, for example in test code that relies on inejecting a pause.
- *
- * @param t The minimum time to pause for in milliseconds.
- */
- public static void pause(long t)
- {
- try
- {
- Thread.sleep(t);
- }
- catch (InterruptedException e)
- {
- // Restore the interrupted status
- Thread.currentThread().interrupt();
-
- throw new RuntimeException("Failed to generate the requested pause length.", e);
- }
- }
-
- /**
- * Sets properties of different types on a JMS Message.
- *
- * @param message The message to set properties on.
- * @param properties The property name/value pairs to set.
- *
- * @throws javax.jms.JMSException All underlying JMSExceptions are allowed to fall through.
- *
- * @todo Move this helper method somewhere else. For example, TestUtils.
- */
- public static void setPropertiesOnMessage(Message message, Map<Object, Object> properties) throws JMSException
- {
- for (Map.Entry<Object, Object> entry : properties.entrySet())
- {
- String name = entry.getKey().toString();
- Object value = entry.getValue();
-
- message.setObjectProperty(name, value);
- }
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchFailureException.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchFailureException.java
deleted file mode 100644
index 00cc2d8966..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchFailureException.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework.clocksynch;
-
-/**
- * ClockSynchFailureException represents failure of a {@link ClockSynchronizer} to achieve synchronization. For example,
- * this could be because a reference signal is not available, or because a desired accurracy cannot be attained.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represent failure to achieve synchronization.
- * </table>
- */
-public class ClockSynchFailureException extends Exception
-{
- /**
- * Creates a clock synch failure exception.
- *
- * @param message The detail message (which is saved for later retrieval by the {@link #getMessage()} method).
- * @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A <tt>null</tt>
- * value is permitted, and indicates that the cause is nonexistent or unknown.)
- */
- public ClockSynchFailureException(String message, Throwable cause)
- {
- super(message, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchThread.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchThread.java
deleted file mode 100644
index 3d4c4f7d12..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchThread.java
+++ /dev/null
@@ -1,124 +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.
- *
- */
-package org.apache.qpid.test.framework.clocksynch;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.junit.extensions.ShutdownHookable;
-import org.apache.qpid.junit.extensions.Throttle;
-
-/**
- * ClockSynchThread is a convenient utility for running a thread that periodically synchronizes the clock against
- * a reference. Supply it with a {@link ClockSynchronizer} and a {@link Throttle} and it will continually keep the
- * clock up-to-date at a rate determined by the throttle.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Continually sychronize the clock at a throttled rate.
- * </table>
- */
-public class ClockSynchThread extends Thread implements ShutdownHookable
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(ClockSynchThread.class);
-
- /** Holds the clock syncher for the synch thread. */
- private ClockSynchronizer clockSyncher;
-
- /** Holds the throttle to limit the synch rate. */
- private Throttle throttle;
-
- /** Flag to indicate that the periodic clock syncher should keep running. */
- boolean doSynch = true;
-
- /**
- * Creates a clock synchronizer thread from a clock synchronizer and a throttle.
- *
- * @param syncher The clock synchronizer.
- * @param throttle The throttle.
- */
- public ClockSynchThread(ClockSynchronizer syncher, Throttle throttle)
- {
- this.clockSyncher = syncher;
- this.throttle = throttle;
- }
-
- /**
- * Terminates the synchronization thread.
- */
- public void terminate()
- {
- doSynch = false;
- }
-
- /**
- * Continually updates the clock, until {@link #terminate()} is called.
- */
- public void run()
- {
- while (doSynch)
- {
- // Perform a clock clockSynch.
- try
- {
- // Wait controlled by the throttle before doing the next synch.
- throttle.throttle();
-
- clockSyncher.synch();
- log.debug("Clock synched, delta = " + clockSyncher.getDelta() + ", epsilon = " + clockSyncher.getEpsilon()
- + ".");
- }
- // Terminate the synch thread if the synchronization cannot be achieved.
- catch (ClockSynchFailureException e)
- {
- log.debug("Cannot synchronize the clock (reference service may be down). Terminating the synch thread.");
- doSynch = false;
- }
- }
- }
-
- /**
- * Gets the clock synchronizer that is kept continually up to date.
- *
- * @return The clock synchronizer that is kept continually up to date.
- */
- public ClockSynchronizer getClockSyncher()
- {
- return clockSyncher;
- }
-
- /**
- * Supplies a shutdown hook, that terminates the synching thread.
- *
- * @return The shut down hook.
- */
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- doSynch = false;
- }
- });
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchronizer.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchronizer.java
deleted file mode 100644
index a92c551bc2..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchronizer.java
+++ /dev/null
@@ -1,69 +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.
- *
- */
-package org.apache.qpid.test.framework.clocksynch;
-
-/**
- * ClockSynchronizer provides an interface through which two nodes may synchronize their clocks. It is expected that one
- * node will act as the reference clock, to which no delta need be applied, and the other node will act as the slave,
- * and which must apply a delta to its local clock to get a clock synchronized with the reference.
- *
- * <p/>The slave side will initiate the computation of a clock delta by calling the {@link #synch} method. This method
- * will not return until the delta has been computed, at which point there is a method to return its value, as well as
- * an estimate of the likely error (usually one standard deviation), in the synchronization. For convenience there is a
- * {@link #nanoTime} method to return the value of System.nanoTime() with the delta added in.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Trigger a clock synchronization.
- * <tr><td> Compute a clock delta to apply to the local clock.
- * <tr><td> Estimate the error in the synchronzation.
- * </table>
- */
-public interface ClockSynchronizer
-{
- /**
- * The slave side should call this to copute a clock delta with the reference.
- *
- * @throws ClockSynchFailureException If synchronization cannot be achieved.
- */
- public void synch() throws ClockSynchFailureException;
-
- /**
- * Gets the clock delta in nano seconds.
- *
- * @return The clock delta in nano seconds.
- */
- public long getDelta();
-
- /**
- * Gets an estimate of the clock error in nan seconds.
- *
- * @return An estimate of the clock error in nan seconds.
- */
- public long getEpsilon();
-
- /**
- * Gets the local clock time with any computed delta added in.
- *
- * @return The local clock time with any computed delta added in.
- */
- public long nanoTime();
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/LocalClockSynchronizer.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/LocalClockSynchronizer.java
deleted file mode 100644
index f448d5f23c..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/LocalClockSynchronizer.java
+++ /dev/null
@@ -1,73 +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.
- *
- */
-package org.apache.qpid.test.framework.clocksynch;
-
-/**
- * LocalClockSynchronizer is a fake {@link ClockSynchronizer} that simply calls System.nanoTime(). It exists so that
- * the same tests can be run distributed or locally, taking timings against the ClockSynchronizer interface without
- * being aware of how they are being run.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Supply the local clock with no delta.
- * </table>
- */
-public class LocalClockSynchronizer implements ClockSynchronizer
-{
- /**
- * The slave side should call this to copute a clock delta with the reference.
- *
- * @throws org.apache.qpid.test.framework.clocksynch.ClockSynchFailureException
- * If synchronization cannot be achieved.
- */
- public void synch() throws ClockSynchFailureException
- { }
-
- /**
- * Gets the clock delta in nano seconds.
- *
- * @return The clock delta in nano seconds.
- */
- public long getDelta()
- {
- return 0L;
- }
-
- /**
- * Gets an estimate of the clock error in nan seconds.
- *
- * @return An estimate of the clock error in nan seconds.
- */
- public long getEpsilon()
- {
- return 0L;
- }
-
- /**
- * Gets the local clock time with any computed delta added in.
- *
- * @return The local clock time with any computed delta added in.
- */
- public long nanoTime()
- {
- return System.nanoTime();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockReference.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockReference.java
deleted file mode 100644
index 8bce752f68..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockReference.java
+++ /dev/null
@@ -1,165 +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.
- *
- */
-package org.apache.qpid.test.framework.clocksynch;
-
-import org.apache.qpid.junit.extensions.ShutdownHookable;
-
-import java.io.IOException;
-import java.net.*;
-import java.nio.ByteBuffer;
-
-/**
- * UDPClockReference supplies a refernce clock signal (generated from System.nanoTime()).
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Supply a reference clock signal.
- * </table>
- *
- * @todo Port hard coded. Make configurable.
- *
- * @todo Errors rethrown as runtimes, or silently terminate the service. Could add better error handling if needed.
- */
-public class UDPClockReference implements Runnable, ShutdownHookable
-{
- /** Used for debugging. */
- // private static final Logger log = Logger.getLogger(UDPClockReference.class);
-
- /** Defines the timeout to use when polling the socket for time requests. */
- private static final int TIMEOUT = 200;
-
- /** Defines the port to run the clock reference on. */
- public static final int REFERENCE_PORT = 4444;
-
- /** Holds the socket to receive clock reference requests on. */
- protected DatagramSocket socket = null;
-
- /** Flag used to indicate that the time server should keep running. Set to false to terminate. */
- protected boolean publish = true;
-
- /**
- * Creates a clock reference service on the standard port.
- */
- public UDPClockReference()
- {
- try
- {
- socket = new DatagramSocket(REFERENCE_PORT);
- socket.setSoTimeout(TIMEOUT);
- }
- catch (SocketException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Implements the run loop for this reference time server. This waits for incoming time requests, and replies to
- * any, with a message with the local time stamp in it. Periodically (controlled by {@link #TIMEOUT}), the run
- * loop will check if the {@link #publish} flag has been cleared, and terminate the reference time service if so.
- */
- public void run()
- {
- byte[] buf = new byte[256];
- ByteBuffer bbuf = ByteBuffer.wrap(buf);
-
- while (publish)
- {
- try
- {
- // Wait for a reference time request.
- DatagramPacket packet = new DatagramPacket(buf, buf.length);
- boolean timedOut = false;
-
- try
- {
- socket.receive(packet);
- }
- catch (SocketTimeoutException e)
- {
- timedOut = true;
- }
-
- if (!timedOut)
- {
- // Work out from the received packet, where to reply to.
- InetAddress address = packet.getAddress();
- int port = packet.getPort();
-
- // Respond to the time request by sending back the local clock as the reference time.
- bbuf.putLong(System.nanoTime());
- bbuf.flip();
- packet = new DatagramPacket(bbuf.array(), bbuf.capacity(), address, port);
-
- socket.send(packet);
- }
- }
- catch (IOException e)
- {
- publish = false;
- }
- }
-
- socket.close();
- }
-
- /**
- * Supplies a shutdown hook.
- *
- * @return The shut down hook.
- */
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- publish = false;
- }
- });
- }
-
- /**
- * For testing purposes. Runs a reference clock on the default port.
- *
- * @param args None.
- */
- public static void main(String[] args)
- {
- try
- {
- // Create the clock reference service.
- UDPClockReference clock = new UDPClockReference();
-
- // Set up a shutdown hook for it.
- Runtime.getRuntime().addShutdownHook(clock.getShutdownHook());
-
- // Start the service.
- clock.run();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- System.exit(1);
- }
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockSynchronizer.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockSynchronizer.java
deleted file mode 100644
index c89112eff8..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockSynchronizer.java
+++ /dev/null
@@ -1,463 +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.
- *
- */
-package org.apache.qpid.test.framework.clocksynch;
-
-import org.apache.qpid.junit.extensions.util.CommandLineParser;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import java.io.IOException;
-import java.net.*;
-import java.nio.ByteBuffer;
-import java.util.Arrays;
-
-/**
- * UDPClockSynchronizer is a {@link ClockSynchronizer} that sends pings as UDP datagrams, and uses the following simple
- * algorithm to perform clock synchronization:
- *
- * <ol>
- * <li>Slave initiates synchronization with a Reference clock.</li>
- * <li>Slave stamps current local time on a "time request" message and sends to the Reference.</li>
- * <li>Upon receipt by Reference, Reference stamps Reference-time and returns.</li>
- * <li>Upon receipt by Slave, Slave subtracts current time from sent time and divides by two to compute latency. It
- * subtracts current time from Reference time to determine Slave-Reference time delta and adds in the
- * half-latency to get the correct clock delta.</li>
- * <li>The first result is immediately used to update the clock since it will get the local clock into at least
- * the right ballpark.</li>
- * <li>The Slave repeats steps 2 through 4, 15 more times.</li>
- * <li>The results of the packet receipts are accumulated and sorted in lowest-latency to highest-latency order. The
- * median latency is determined by picking the mid-point sample from this ordered list.</li>
- * <li>All samples outside 1 standard-deviation from the median are discarded and the remaining samples
- * are averaged using an arithmetic mean.</li>
- * </ol>
- *
- * <p/>The use of UDP datagrams, instead of TCP based communication eliminates the hidden delays that TCP can introduce,
- * as it can transparently re-order or re-send packets, or introduce delays as packets are naggled.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Trigger a clock synchronziation.
- * <tr><td> Compute a clock delta to apply to the local clock.
- * <tr><td> Estimate the error in the synchronzation.
- * </table>
- */
-public class UDPClockSynchronizer implements ClockSynchronizer
-{
- /** Used for debugging. */
- // private static final Logger log = Logger.getLogger(UDPClockSynchronizer.class);
-
- /** Defines the timeout to use when waiting for responses to time requests. */
- private static final int TIMEOUT = 50;
-
- /** The clock delta. */
- private long delta = 0L;
-
- /** Holds an estimate of the clock error relative to the reference clock. */
- private long epsilon = 0L;
-
- /** Holds the address of the reference clock. */
- private InetAddress referenceAddress;
-
- /** Holds the socket to communicate with the reference service over. */
- private DatagramSocket socket;
-
- /** Used to control the shutdown in the main test loop. */
- private static boolean doSynch = true;
-
- /**
- * Creates a clock synchronizer against the specified address for the reference.
- *
- * @param address The address of the reference service.
- */
- public UDPClockSynchronizer(String address)
- {
- try
- {
- referenceAddress = InetAddress.getByName(address);
- }
- catch (UnknownHostException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * The slave side should call this to compute a clock delta with the reference.
- *
- * @throws ClockSynchFailureException If synchronization cannot be achieved, due to unavailability of the reference
- * time service.
- */
- public void synch() throws ClockSynchFailureException
- {
- try
- {
- socket = new DatagramSocket();
- socket.setSoTimeout(TIMEOUT);
-
- // Synchronize on a single ping, to get the clock into the right ball-park.
- synch(1);
-
- // Synchronize on 15 pings.
- synch(15);
-
- // And again, for greater accuracy, on 31.
- synch(31);
-
- socket.close();
- }
- catch (SocketException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Updates the synchronization delta by performing the specified number of reference clock requests.
- *
- * @param n The number of reference clock request cycles to perform.
- *
- * @throws ClockSynchFailureException If synchronization cannot be achieved, due to unavailability of the reference
- * time service.
- */
- protected void synch(int n) throws ClockSynchFailureException
- {
- // log.debug("protected void synch(int n = " + n + "): called");
-
- // Create an array of deltas by performing n reference pings.
- long[] delta = new long[n];
-
- for (int i = 0; i < n; i++)
- {
- delta[i] = ping();
- }
-
- // Reject any deltas that are larger than 1 s.d. above the median.
- long median = median(delta);
- long sd = standardDeviation(delta);
-
- // log.debug("median = " + median);
- // log.debug("sd = " + sd);
-
- long[] tempDeltas = new long[n];
- int count = 0;
-
- for (int i = 0; i < n; i++)
- {
- if ((delta[i] <= (median + sd)) && (delta[i] >= (median - sd)))
- {
- tempDeltas[count] = delta[i];
- count++;
- }
- else
- {
- // log.debug("Rejected: " + delta[i]);
- }
- }
-
- System.arraycopy(tempDeltas, 0, delta, 0, count);
-
- // Estimate the delta as the mean of the remaining deltas.
- this.delta += mean(delta);
-
- // Estimate the error as the standard deviation of the remaining deltas.
- this.epsilon = standardDeviation(delta);
-
- // log.debug("this.delta = " + this.delta);
- // log.debug("this.epsilon = " + this.epsilon);
- }
-
- /**
- * Performs a single reference clock request cycle and returns the estimated delta relative to the local clock.
- * This is computed as the half-latency of the requst cycle, plus the reference clock, minus the local clock.
- *
- * @return The estimated clock delta.
- *
- * @throws ClockSynchFailureException If the reference service is not responding.
- */
- protected long ping() throws ClockSynchFailureException
- {
- // log.debug("protected long ping(): called");
-
- try
- {
- byte[] buf = new byte[256];
-
- boolean timedOut = false;
- long start = 0L;
- long refTime = 0L;
- long localTime = 0L;
- long latency = 0L;
- int failCount = 0;
-
- // Keep trying the ping until it gets a response, or 10 tries in a row all time out.
- do
- {
- // Start timing the request latency.
- start = nanoTime();
-
- // Get the reference time.
- DatagramPacket packet =
- new DatagramPacket(buf, buf.length, referenceAddress, UDPClockReference.REFERENCE_PORT);
- socket.send(packet);
- packet = new DatagramPacket(buf, buf.length);
-
- timedOut = false;
-
- try
- {
- socket.receive(packet);
- }
- catch (SocketTimeoutException e)
- {
- timedOut = true;
- failCount++;
-
- continue;
- }
-
- ByteBuffer bbuf = ByteBuffer.wrap(packet.getData());
- refTime = bbuf.getLong();
-
- // Stop timing the request latency.
- localTime = nanoTime();
- latency = localTime - start;
-
- // log.debug("refTime = " + refTime);
- // log.debug("localTime = " + localTime);
- // log.debug("start = " + start);
- // log.debug("latency = " + latency);
- // log.debug("delta = " + ((latency / 2) + (refTime - localTime)));
-
- }
- while (timedOut && (failCount < 10));
-
- // Fail completely if the fail count is too high.
- if (failCount >= 10)
- {
- throw new ClockSynchFailureException("Clock reference not responding.", null);
- }
-
- // Estimate delta as (ref clock + half-latency) - local clock.
- return (latency / 2) + (refTime - localTime);
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * Gets the clock delta in nano seconds.
- *
- * @return The clock delta in nano seconds.
- */
- public long getDelta()
- {
- return delta;
- }
-
- /**
- * Gets an estimate of the clock error in nan seconds.
- *
- * @return An estimate of the clock error in nan seconds.
- */
- public long getEpsilon()
- {
- return epsilon;
- }
-
- /**
- * Gets the local clock time with any computed delta added in.
- *
- * @return The local clock time with any computed delta added in.
- */
- public long nanoTime()
- {
- return System.nanoTime() + delta;
- }
-
- /**
- * Computes the median of a series of values.
- *
- * @param values The values.
- *
- * @return The median.
- */
- public static long median(long[] values)
- {
- // log.debug("public static long median(long[] values = " + Arrays.toString(values) + "): called");
-
- long median;
-
- // Order the list of values.
- long[] orderedValues = new long[values.length];
- System.arraycopy(values, 0, orderedValues, 0, values.length);
- Arrays.sort(orderedValues);
-
- // Check if the median is computed from a pair of middle value.
- if ((orderedValues.length % 2) == 0)
- {
- int middle = orderedValues.length / 2;
-
- median = (orderedValues[middle] + orderedValues[middle - 1]) / 2;
- }
- // The median is computed from a single middle value.
- else
- {
- median = orderedValues[orderedValues.length / 2];
- }
-
- // log.debug("median = " + median);
-
- return median;
- }
-
- /**
- * Computes the mean of a series of values.
- *
- * @param values The values.
- *
- * @return The mean.
- */
- public static long mean(long[] values)
- {
- // log.debug("public static long mean(long[] values = " + Arrays.toString(values) + "): called");
-
- long total = 0L;
-
- for (long value : values)
- {
- total += value;
- }
-
- long mean = total / values.length;
-
- // log.debug("mean = " + mean);
-
- return mean;
- }
-
- /**
- * Computes the variance of series of values.
- *
- * @param values The values.
- *
- * @return The variance of the values.
- */
- public static long variance(long[] values)
- {
- // log.debug("public static long variance(long[] values = " + Arrays.toString(values) + "): called");
-
- long mean = mean(values);
-
- long totalVariance = 0;
-
- for (long value : values)
- {
- long diff = (value - mean);
- totalVariance += diff * diff;
- }
-
- long variance = totalVariance / values.length;
-
- // log.debug("variance = " + variance);
-
- return variance;
- }
-
- /**
- * Computes the standard deviation of a series of values.
- *
- * @param values The values.
- *
- * @return The standard deviation.
- */
- public static long standardDeviation(long[] values)
- {
- // log.debug("public static long standardDeviation(long[] values = " + Arrays.toString(values) + "): called");
-
- long sd = Double.valueOf(Math.sqrt(variance(values))).longValue();
-
- // log.debug("sd = " + sd);
-
- return sd;
- }
-
- /**
- * For testing purposes. Supply address of reference clock as arg 1.
- *
- * @param args Address of reference clock as arg 1.
- */
- public static void main(String[] args)
- {
- ParsedProperties options =
- new ParsedProperties(CommandLineParser.processCommandLine(args,
- new CommandLineParser(
- new String[][]
- {
- { "1", "Address of clock reference service.", "address", "true" }
- }), System.getProperties()));
-
- String address = options.getProperty("1");
-
- // Create a clock synchronizer.
- UDPClockSynchronizer clockSyncher = new UDPClockSynchronizer(address);
-
- // Set up a shutdown hook for it.
- Runtime.getRuntime().addShutdownHook(new Thread(new Runnable()
- {
- public void run()
- {
- doSynch = false;
- }
- }));
-
- // Repeat the clock synching until the user kills the progam.
- while (doSynch)
- {
- // Perform a clock clockSynch.
- try
- {
- clockSyncher.synch();
-
- // Print out the clock delta and estimate of the error.
- System.out.println("Delta = " + clockSyncher.getDelta());
- System.out.println("Epsilon = " + clockSyncher.getEpsilon());
-
- try
- {
- Thread.sleep(250);
- }
- catch (InterruptedException e)
- {
- // Restore the interrupted status and terminate the loop.
- Thread.currentThread().interrupt();
- doSynch = false;
- }
- }
- // Terminate if the reference time service is unavailable.
- catch (ClockSynchFailureException e)
- {
- doSynch = false;
- }
- }
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java
deleted file mode 100644
index f375eda4d1..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java
+++ /dev/null
@@ -1,469 +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.
- *
- */
-package org.apache.qpid.test.framework.distributedcircuit;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.*;
-import org.apache.qpid.test.utils.ConversationFactory;
-
-import org.apache.qpid.junit.extensions.TimingController;
-import org.apache.qpid.junit.extensions.TimingControllerAware;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Session;
-
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * DistributedCircuitImpl is a distributed implementation of the test {@link Circuit}. Many publishers and receivers
- * accross multiple machines may be combined to form a single test circuit. The test circuit extracts reports from
- * all of its publishers and receivers, and applies its assertions to these reports.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Supply the publishing and receiving ends of a test messaging circuit.
- * <tr><td> Start the circuit running.
- * <tr><td> Close the circuit down.
- * <tr><td> Take a reading of the circuits state.
- * <tr><td> Apply assertions against the circuits state.
- * <tr><td> Send test messages over the circuit.
- * <tr><td> Perform the default test procedue on the circuit.
- * </table>
- *
- * @todo There is a short pause after receiving sender reports before asking for receiver reports, because receivers may
- * not have finished receiving all their test messages before the report request arrives. This is going to be a
- * problem for taking test timings and needs to be eliminiated. Suggested solution: have receiver send back reports
- * asynchronously, on test batch size boundaries, and do so automatically rather than having to have the report
- * request sent to them. Number each test run, or otherwise uniquely identify it, when a receiver does not get
- * any more messages on a test run for more than a timeout, it can assume the test is complete and send a final
- * report. On the coordinator end a future will need to be created to wait for all final reports to come in, and
- * to register results and timings for the test. This must work in such a way that a new test cycle can be started
- * without waiting for the results of the old one to come in.
- *
- * @todo Add in setting of timing controller, from timing aware test cases.
- */
-public class DistributedCircuitImpl implements Circuit, TimingControllerAware
-{
- /** Used for debugging purposes. */
- private static final Logger log = Logger.getLogger(DistributedCircuitImpl.class);
-
- /** Holds the conversation factory over which to coordinate the test. */
- protected ConversationFactory conversationFactory;
-
- /** Holds the controlSession over which to hold the control conversation. */
- protected Session controlSession;
-
- /** Holds the sender nodes in the test circuit. */
- protected List<TestClientDetails> senders;
-
- /** Holds the receiver nodes in the test circuit. */
- protected List<TestClientDetails> receivers;
-
- /** Holds the sender control conversations. */
- protected ConversationFactory.Conversation[] senderConversation;
-
- /** Holds the receiver control conversations. */
- protected ConversationFactory.Conversation[] receiverConversation;
-
- /** Holds the control topics for the senders in the test circuit. */
- protected Destination[] senderControlTopic;
-
- /** Holds the control topics for the receivers in the test circuit. */
- protected Destination[] receiverControlTopic;
-
- /** Holds the number of messages to send per test run. */
- protected int numMessages;
-
- /**
- * Holds the timing controller for the circuit. This is used to log test times asynchronously, when reciever nodes
- * return their reports after senders have completed a test case.
- */
- TimingController timingController;
-
- /**
- * Creates a distributed test circuit on the specified senders and receivers.
- *
- * @param session The controlSession for all control conversations.
- * @param senders The senders.
- * @param receivers The receivers.
- * @param senderConversation A control conversation with the senders.
- * @param receiverConversation A control conversation with the receivers.
- * @param senderControlTopic The senders control topic.
- * @param receiverControlTopic The receivers control topic.
- */
- protected DistributedCircuitImpl(Session session, List<TestClientDetails> senders, List<TestClientDetails> receivers,
- ConversationFactory.Conversation[] senderConversation, ConversationFactory.Conversation[] receiverConversation,
- Destination[] senderControlTopic, Destination[] receiverControlTopic)
- {
- this.controlSession = session;
- this.senders = senders;
- this.receivers = receivers;
- this.senderConversation = senderConversation;
- this.receiverConversation = receiverConversation;
- this.senderControlTopic = senderControlTopic;
- this.receiverControlTopic = receiverControlTopic;
- }
-
- /**
- * Creates a distributed test circuit from the specified test parameters, on the senders and receivers
- * given.
- *
- * @param testProps The test parameters.
- * @param senders The sender ends in the test circuit.
- * @param receivers The receiver ends in the test circuit.
- * @param conversationFactory A conversation factory for creating the control conversations with senders and receivers.
- *
- * @return A connected and ready to start, test circuit.
- */
- public static Circuit createCircuit(ParsedProperties testProps, List<TestClientDetails> senders,
- List<TestClientDetails> receivers, ConversationFactory conversationFactory)
- {
- log.debug("public static Circuit createCircuit(ParsedProperties testProps, List<TestClientDetails> senders, "
- + " List<TestClientDetails> receivers, ConversationFactory conversationFactory)");
-
- try
- {
- Session session = conversationFactory.getSession();
-
- // Create control conversations with each of the senders.
- ConversationFactory.Conversation[] senderConversation = new ConversationFactory.Conversation[senders.size()];
- Destination[] senderControlTopic = new Destination[senders.size()];
-
- for (int i = 0; i < senders.size(); i++)
- {
- TestClientDetails sender = senders.get(i);
-
- senderControlTopic[i] = session.createTopic(sender.privateControlKey);
- senderConversation[i] = conversationFactory.startConversation();
- }
-
- log.debug("Sender conversations created.");
-
- // Create control conversations with each of the receivers.
- ConversationFactory.Conversation[] receiverConversation = new ConversationFactory.Conversation[receivers.size()];
- Destination[] receiverControlTopic = new Destination[receivers.size()];
-
- for (int i = 0; i < receivers.size(); i++)
- {
- TestClientDetails receiver = receivers.get(i);
-
- receiverControlTopic[i] = session.createTopic(receiver.privateControlKey);
- receiverConversation[i] = conversationFactory.startConversation();
- }
-
- log.debug("Receiver conversations created.");
-
- // Assign the sender role to each of the sending test clients.
- for (int i = 0; i < senders.size(); i++)
- {
- TestClientDetails sender = senders.get(i);
-
- Message assignSender = conversationFactory.getSession().createMessage();
- TestUtils.setPropertiesOnMessage(assignSender, testProps);
- assignSender.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignSender.setStringProperty("ROLE", "SENDER");
-
- senderConversation[i].send(senderControlTopic[i], assignSender);
- }
-
- log.debug("Sender role assignments sent.");
-
- // Assign the receivers role to each of the receiving test clients.
- for (int i = 0; i < receivers.size(); i++)
- {
- TestClientDetails receiver = receivers.get(i);
-
- Message assignReceiver = session.createMessage();
- TestUtils.setPropertiesOnMessage(assignReceiver, testProps);
- assignReceiver.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignReceiver.setStringProperty("ROLE", "RECEIVER");
-
- receiverConversation[i].send(receiverControlTopic[i], assignReceiver);
- }
-
- log.debug("Receiver role assignments sent.");
-
- // Wait for the senders and receivers to confirm their roles.
- for (int i = 0; i < senders.size(); i++)
- {
- senderConversation[i].receive();
- }
-
- log.debug("Got all sender role confirmations");
-
- for (int i = 0; i < receivers.size(); i++)
- {
- receiverConversation[i].receive();
- }
-
- log.debug("Got all receiver role confirmations");
-
- // Package everything up as a circuit.
- return new DistributedCircuitImpl(session, senders, receivers, senderConversation, receiverConversation,
- senderControlTopic, receiverControlTopic);
- }
- catch (JMSException e)
- {
- throw new RuntimeException("JMSException not handled.");
- }
- }
-
- /**
- * Used by tests cases that can supply a {@link org.apache.qpid.junit.extensions.TimingController} to set the
- * controller on an aware test.
- *
- * @param controller The timing controller.
- */
- public void setTimingController(TimingController controller)
- {
- this.timingController = controller;
- }
-
- /**
- * Gets the interface on the publishing end of the circuit.
- *
- * @return The publishing end of the circuit.
- */
- public Publisher getPublisher()
- {
- throw new RuntimeException("Not Implemented.");
- }
-
- /**
- * Gets the interface on the receiving end of the circuit.
- *
- * @return The receiving end of the circuit.
- */
- public Receiver getReceiver()
- {
- throw new RuntimeException("Not Implemented.");
- }
-
- /**
- * Connects and starts the circuit. After this method is called the circuit is ready to send messages.
- */
- public void start()
- {
- log.debug("public void start(): called");
-
- try
- {
- // Start the test on each of the senders.
- Message start = controlSession.createMessage();
- start.setStringProperty("CONTROL_TYPE", "START");
- start.setIntProperty("MESSAGE_COUNT", numMessages);
-
- for (int i = 0; i < senders.size(); i++)
- {
- senderConversation[i].send(senderControlTopic[i], start);
- }
-
- log.debug("All senders told to start their tests.");
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Unhandled JMSException.", e);
- }
- }
-
- /**
- * Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit,
- * into a report, against which assertions may be checked.
- *
- * @todo Replace the asynch receiver report thread with a choice of direct or asynch executor, so that asynch
- * or synch logging of test timings is optional. Also need to provide an onMessage method that is capable
- * of receiving timing reports that receivers will generate during an ongoing test, on the test sample
- * size boundaries. The message timing logging code should be factored out as a common method that can
- * be called in response to the final report responses, or the onMessage method. Another alternative is
- * to abandon the final report request altogether and just use the onMessage method? I think the two
- * differ though, as the final report is used to apply assertions, and the ongoing report is just for
- * periodic timing results... In which case, maybe there needs to be a way for the onMessage method
- * to process just some of the incoming messages, and forward the rest on to the conversion helper, as
- * a sort of pre-conversation helper filter? Make conversation expose its onMessage method (it should
- * already) and allow another delivery thread to filter the incoming messages to the conversation.
- */
- public void check()
- {
- log.debug("public void check(): called");
-
- try
- {
- // Wait for all the test senders to return their reports.
- for (int i = 0; i < senders.size(); i++)
- {
- Message senderReport = senderConversation[i].receive();
- log.debug("Sender " + senderReport.getStringProperty("CLIENT_NAME") + " reports message count: "
- + senderReport.getIntProperty("MESSAGE_COUNT"));
- log.debug("Sender " + senderReport.getStringProperty("CLIENT_NAME") + " reports message time: "
- + senderReport.getLongProperty("TEST_TIME"));
- }
-
- log.debug("Got all sender test reports.");
-
- // Apply sender assertions to pass/fail the tests.
-
- // Inject a short pause to give the receivers time to finish receiving their test messages.
- TestUtils.pause(500);
-
- // Ask the receivers for their reports.
- Message statusRequest = controlSession.createMessage();
- statusRequest.setStringProperty("CONTROL_TYPE", "STATUS_REQUEST");
-
- for (int i = 0; i < receivers.size(); i++)
- {
- receiverConversation[i].send(receiverControlTopic[i], statusRequest);
- }
-
- log.debug("All receiver test reports requested.");
-
- // Wait for all receiver reports to come in, but do so asynchronously.
- Runnable gatherAllReceiverReports =
- new Runnable()
- {
- public void run()
- {
- try
- {
- // Wait for all the receivers to send their reports.
- for (int i = 0; i < receivers.size(); i++)
- {
- Message receiverReport = receiverConversation[i].receive();
-
- String clientName = receiverReport.getStringProperty("CLIENT_NAME");
- int messageCount = receiverReport.getIntProperty("MESSAGE_COUNT");
- long testTime = receiverReport.getLongProperty("TEST_TIME");
-
- log.debug("Receiver " + clientName + " reports message count: " + messageCount);
- log.debug("Receiver " + receiverReport.getStringProperty("CLIENT_NAME")
- + " reports message time: " + testTime);
-
- // Apply receiver assertions to pass/fail the tests.
-
- // Log the test timings on the asynchronous test timing controller.
- /*try
- {
- timingController.completeTest(true, messageCount, testTime);
- }
- // The timing controll can throw InterruptedException is the current test is to be
- // interrupted.
- catch (InterruptedException e)
- {
- e.printStackTrace();
- }*/
- }
-
- log.debug("All receiver test reports received.");
- }
- catch (JMSException e)
- {
- throw new RuntimeException(e);
- }
- }
- };
-
- Thread receiverReportsThread = new Thread(gatherAllReceiverReports);
- receiverReportsThread.start();
-
- // return new Message[] { senderReport, receiverReport };
-
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Unhandled JMSException.", e);
- }
- }
-
- /**
- * Closes the circuit. All associated resources are closed.
- */
- public void close()
- {
- log.debug("public void close(): called");
-
- // End the current test on all senders and receivers.
- }
-
- /**
- * Applies a list of assertions against the test circuit. The {@link #check()} method should be called before doing
- * this, to ensure that the circuit has gathered its state into a report to assert against.
- *
- * @param assertions The list of assertions to apply.
- *
- * @return Any assertions that failed.
- */
- public List<Assertion> applyAssertions(List<Assertion> assertions)
- {
- log.debug("public List<Assertion> applyAssertions(List<Assertion> assertions = " + assertions + "): called");
-
- List<Assertion> failures = new LinkedList<Assertion>();
-
- for (Assertion assertion : assertions)
- {
- if (!assertion.apply())
- {
- failures.add(assertion);
- }
- }
-
- return failures;
- }
-
- /**
- * Runs the default test procedure against the circuit, and checks that all of the specified assertions hold.
- *
- * @param numMessages The number of messages to send using the default test procedure.
- * @param assertions The list of assertions to apply.
- *
- * @return Any assertions that failed.
- *
- * @todo From check onwards needs to be handled as a future. The future must call back onto the test case to
- * report results asynchronously.
- */
- public List<Assertion> test(int numMessages, List<Assertion> assertions)
- {
- log.debug("public List<Assertion> test(int numMessages = " + numMessages + ", List<Assertion> assertions = "
- + assertions + "): called");
-
- // Keep the number of messages to send per test run, where the send method can reference it.
- this.numMessages = numMessages;
-
- // Start the test running on all sender circuit ends.
- start();
-
- // Request status reports to be handed in.
- check();
-
- // Assert conditions on the publishing end of the circuit.
- // Assert conditions on the receiving end of the circuit.
- List<Assertion> failures = applyAssertions(assertions);
-
- // Close the circuit ending the current test case.
- close();
-
- // Pass with no failed assertions or fail with a list of failed assertions.
- return failures;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedPublisherImpl.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedPublisherImpl.java
deleted file mode 100644
index c51f710494..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedPublisherImpl.java
+++ /dev/null
@@ -1,95 +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.
- *
- */
-package org.apache.qpid.test.framework.distributedcircuit;
-
-import org.apache.qpid.test.framework.Assertion;
-import org.apache.qpid.test.framework.Publisher;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-/**
- * DistributedPublisherImpl represents the status of the publishing side of a test circuit. Its main purpose is to
- * provide assertions that can be applied to verify the behaviour of a non-local publisher.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide assertion that the publishers received no exceptions.
- * <tr><td> Provide assertion that the publishers received a no consumers error code on every message.
- * <tr><td> Provide assertion that the publishers received a no route error code on every message.
- * </table>
- */
-public class DistributedPublisherImpl implements Publisher
-{
- /**
- * Provides an assertion that the publisher encountered no exceptions.
- *
- * @return An assertion that the publisher encountered no exceptions.
- * @param testProps
- */
- public Assertion noExceptionsAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Provides an assertion that the publisher got a no consumers exception on every message.
- *
- * @return An assertion that the publisher got a no consumers exception on every message.
- */
- public Assertion noConsumersAssertion()
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Provides an assertion that the publisher got a no rout exception on every message.
- *
- * @return An assertion that the publisher got a no rout exception on every message.
- */
- public Assertion noRouteAssertion()
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- *
- * @param testProps The test configuration properties.
- * @return An assertion that the AMQP channel was forcibly closed by an error condition.
- */
- public Assertion channelClosedAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Provides an assertion that the publisher got a given exception during the test.
- *
- * @param testProps The test configuration properties.
- * @param exceptionClass The exception class to check for.
- * @return An assertion that the publisher got a given exception during the test.
- */
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass)
- {
- throw new RuntimeException("Not implemented.");
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedReceiverImpl.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedReceiverImpl.java
deleted file mode 100644
index 863921e387..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedReceiverImpl.java
+++ /dev/null
@@ -1,95 +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.
- *
- */
-package org.apache.qpid.test.framework.distributedcircuit;
-
-import org.apache.qpid.test.framework.Assertion;
-import org.apache.qpid.test.framework.Receiver;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-/**
- * DistributedReceiverImpl represents the status of the receiving side of a test circuit. Its main purpose is to
- * provide assertions that can be applied to verify the behaviour of a non-local receiver.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide assertion that the receivers received no exceptions.
- * <tr><td> Provide assertion that the receivers received all test messages sent to it.
- * </table>
- */
-public class DistributedReceiverImpl implements Receiver
-{
- /**
- * Provides an assertion that the receivers encountered no exceptions.
- *
- * @return An assertion that the receivers encountered no exceptions.
- * @param testProps
- */
- public Assertion noExceptionsAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Provides an assertion that the receivers got all messages that were sent to it.
- *
- * @return An assertion that the receivers got all messages that were sent to it.
- * @param testProps
- */
- public Assertion allMessagesReceivedAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Provides an assertion that the receivers got none of the messages that were sent to it.
- *
- * @return An assertion that the receivers got none of the messages that were sent to it.
- * @param testProps
- */
- public Assertion noMessagesReceivedAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- *
- * @param testProps The test configuration properties.
- * @return An assertion that the AMQP channel was forcibly closed by an error condition.
- */
- public Assertion channelClosedAssertion(ParsedProperties testProps)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Provides an assertion that the receiver got a given exception during the test.
- *
- * @param testProps
- *@param exceptionClass The exception class to check for. @return An assertion that the receiver got a given exception during the test.
- */
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass)
- {
- throw new RuntimeException("Not implemented.");
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/TestClientCircuitEnd.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/TestClientCircuitEnd.java
deleted file mode 100644
index dce2706bc4..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/TestClientCircuitEnd.java
+++ /dev/null
@@ -1,324 +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.
- *
- */
-package org.apache.qpid.test.framework.distributedcircuit;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.*;
-import org.apache.qpid.test.framework.distributedtesting.TestClientControlledTest;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-import javax.jms.*;
-
-/**
- * A TestClientCircuitEnd is a {@link CircuitEnd} that may be controlled from a
- * {@link org.apache.qpid.test.framework.distributedtesting.TestClient}, and that forms a single publishing or
- * receiving end point in a distributed test {@link org.apache.qpid.test.framework.Circuit}.
- *
- * <p/>When operating in the SENDER role, this circuit end is capable of acting as part of the default circuit test
- * procedure (described in the class comment for {@link org.apache.qpid.test.framework.Circuit}). That is, it will
- * send the number of test messages required, using the test configuration parameters given in the test invite, and
- * return a report on its activities to the circuit controller.
- *
- * <p/>When operation in the RECEIVER role, this circuit end acts as part of the default circuit test procedure. It will
- * receive test messages, on the setup specified in the test configuration parameters, and keep count of the messages
- * received, and time taken to receive them. When requested by the circuit controller to provide a report, it will
- * return this report of its activities.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide a message producer for sending messages.
- * <td> {@link CircuitEnd}, {@link LocalCircuitFactory}, {@link TestUtils}
- * <tr><td> Provide a message consumer for receiving messages.
- * <td> {@link CircuitEnd}, {@link LocalCircuitFactory}, {@link TestUtils}
- * <tr><td> Supply the name of the test case that this implements.
- * <tr><td> Accept/Reject invites based on test parameters. <td> {@link MessagingTestConfigProperties}
- * <tr><td> Adapt to assigned roles. <td> {@link TestClientControlledTest.Roles}
- * <tr><td> Perform test case actions. <td> {@link MessageMonitor}
- * <tr><td> Generate test reports. <td> {@link MessageMonitor}
- * </table>
- */
-public class TestClientCircuitEnd implements CircuitEnd, TestClientControlledTest
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(TestClientCircuitEnd.class);
-
- /** Holds the test parameters. */
- ParsedProperties testProps;
-
- /** The number of test messages to send. */
- private int numMessages;
-
- /** The role to be played by the test. */
- private Roles role;
-
- /** The connection to send the test messages on. */
- private Connection connection;
-
- /** Holds the circuit end for this test. */
- CircuitEnd circuitEnd;
-
- /**
- * Holds a message monitor for this circuit end, either the monitor on the consumer when in RECEIVER more, or
- * a monitor updated on every message sent, when acting as a SENDER.
- */
- MessageMonitor messageMonitor;
-
- /**
- * Should provide the name of the test case that this class implements. The exact names are defined in the
- * interop testing spec.
- *
- * @return The name of the test case that this implements.
- */
- public String getName()
- {
- return "DEFAULT_CIRCUIT_TEST";
- }
-
- /**
- * Determines whether the test invite that matched this test case is acceptable.
- *
- * @param inviteMessage The invitation to accept or reject.
- * @return <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public boolean acceptInvite(Message inviteMessage) throws JMSException
- {
- log.debug("public boolean acceptInvite(Message inviteMessage): called");
-
- // Populate the test parameters from the invitation.
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- for (Object key : testProps.keySet())
- {
- String propName = (String) key;
-
- // If the test parameters is overridden by the invitation, use it instead.
- String inviteValue = inviteMessage.getStringProperty(propName);
-
- if (inviteValue != null)
- {
- testProps.setProperty(propName, inviteValue);
- log.debug("Test invite supplied override to " + propName + " of " + inviteValue);
- }
-
- }
-
- // Accept the invitation.
- return true;
- }
-
- /**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the
- * assignment message. When this method return the test case will be ready to execute.
- *
- * @param role The role to be played; sender or receivers.
- * @param assignRoleMessage The role assingment message, contains the full test parameters.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException
- {
- log.debug("public void assignRole(Roles role, Message assignRoleMessage): called");
-
- // Take note of the role to be played.
- this.role = role;
-
- // Extract and retain the test parameters.
- numMessages = 1; // assignRoleMessage.getIntProperty("NUM_MESSAGES");
-
- // Connect using the test parameters.
- connection = TestUtils.createConnection(testProps);
-
- // Create a circuit end that matches the assigned role and test parameters.
- LocalCircuitFactory circuitFactory = new LocalCircuitFactory();
-
- switch (role)
- {
- // Check if the sender role is being assigned, and set up a message producer if so.
- case SENDER:
-
- // Set up the publisher.
- circuitEnd = circuitFactory.createPublisherCircuitEnd(connection, testProps, 0L);
-
- // Create a custom message monitor that will be updated on every message sent.
- messageMonitor = new MessageMonitor();
-
- break;
-
- // Otherwise the receivers role is being assigned, so set this up to listen for messages.
- case RECEIVER:
-
- // Set up the receiver.
- circuitEnd = circuitFactory.createReceiverCircuitEnd(connection, testProps, 0L);
-
- // Use the message monitor from the consumer for stats.
- messageMonitor = getMessageMonitor();
-
- break;
- }
-
- // Reset all messaging stats for the report.
- messageMonitor.reset();
-
- connection.start();
- }
-
- /**
- * Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
- *
- * @param numMessages The number of test messages to send.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- *
- * @todo Add round robin on destinations where multiple destinations being used.
- *
- * @todo Add rate limiting when rate limit specified on publishers.
- *
- * @todo Add Max pending message size protection. The receiver will have to send back some acks once in a while,
- * to notify the publisher that its messages are being consumed. This makes the safety valve harder to
- * implement than in the single VM case. For example, if the limit is 1000 messages, might want to get back
- * an ack every 500, to notify the publisher that it can keep sending. What about pub/sub tests? Will it be
- * necessary to wait for an ack from every receiver? This will have the effect of rate limiting to slow
- * consumers too.
- *
- * @todo Add commits on every commit batch size boundary.
- */
- public void start(int numMessages) throws JMSException
- {
- log.debug("public void start(): called");
-
- // If in the SENDER role, send the specified number of test messages to the circuit destinations.
- if (role.equals(Roles.SENDER))
- {
- Message testMessage = getSession().createMessage();
-
- for (int i = 0; i < numMessages; i++)
- {
- getProducer().send(testMessage);
-
- // Increment the message count and timings.
- messageMonitor.onMessage(testMessage);
- }
- }
- }
-
- /**
- * Gets a report on the actions performed by the test case in its assigned role.
- *
- * @param session The controlSession to create the report message in.
- * @return The report message.
- *
- * @throws JMSException Any JMSExceptions resulting from creating the report are allowed to fall through.
- */
- public Message getReport(Session session) throws JMSException
- {
- Message report = session.createMessage();
- report.setStringProperty("CONTROL_TYPE", "REPORT");
-
- // Add the count of messages sent/received to the report.
- report.setIntProperty("MESSAGE_COUNT", messageMonitor.getNumMessage());
-
- // Add the time to send/receive messages to the report.
- report.setLongProperty("TEST_TIME", messageMonitor.getTime());
-
- // Add any exceptions detected to the report.
-
- return report;
- }
-
- /**
- * Gets the message producer at this circuit end point.
- *
- * @return The message producer at with this circuit end point.
- */
- public MessageProducer getProducer()
- {
- return circuitEnd.getProducer();
- }
-
- /**
- * Gets the message consumer at this circuit end point.
- *
- * @return The message consumer at this circuit end point.
- */
- public MessageConsumer getConsumer()
- {
- return circuitEnd.getConsumer();
- }
-
- /**
- * Send the specified message over the producer at this end point.
- *
- * @param message The message to send.
- *
- * @throws JMSException Any JMS exception occuring during the send is allowed to fall through.
- */
- public void send(Message message) throws JMSException
- {
- // Send the message on the circuit ends producer.
- circuitEnd.send(message);
- }
-
- /**
- * Gets the JMS Session associated with this circuit end point.
- *
- * @return The JMS Session associated with this circuit end point.
- */
- public Session getSession()
- {
- return circuitEnd.getSession();
- }
-
- /**
- * Closes the message producers and consumers and the sessions, associated with this circuit end point.
- *
- * @throws JMSException Any JMSExceptions occurring during the close are allowed to fall through.
- */
- public void close() throws JMSException
- {
- // Close the producer and consumer.
- circuitEnd.close();
- }
-
- /**
- * Returns the message monitor for reporting on received messages on this circuit end.
- *
- * @return The message monitor for this circuit end.
- */
- public MessageMonitor getMessageMonitor()
- {
- return circuitEnd.getMessageMonitor();
- }
-
- /**
- * Returns the exception monitor for reporting on exceptions received on this circuit end.
- *
- * @return The exception monitor for this circuit end.
- */
- public ExceptionMonitor getExceptionMonitor()
- {
- return circuitEnd.getExceptionMonitor();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java
deleted file mode 100644
index d532109dc3..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java
+++ /dev/null
@@ -1,539 +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.
- *
- */
-package org.apache.qpid.test.framework.distributedtesting;
-
-import java.net.InetAddress;
-import java.util.*;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import javax.jms.*;
-
-import junit.framework.Test;
-import junit.framework.TestResult;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import org.apache.qpid.test.framework.MessagingTestConfigProperties;
-import org.apache.qpid.test.framework.TestClientDetails;
-import org.apache.qpid.test.framework.TestUtils;
-import org.apache.qpid.test.framework.clocksynch.UDPClockReference;
-import org.apache.qpid.test.utils.ConversationFactory;
-
-import org.apache.qpid.junit.extensions.TKTestRunner;
-import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;
-import org.apache.qpid.junit.extensions.util.CommandLineParser;
-import org.apache.qpid.junit.extensions.util.MathUtils;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-/**
- * <p/>Implements the coordinator client described in the interop testing specification
- * (http://cwiki.apache.org/confluence/display/qpid/Interop+Testing+Specification). This coordinator is built on
- * top of the JUnit testing framework.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Find out what test clients are available. <td> {@link ConversationFactory}
- * <tr><td> Decorate available tests to run on all available clients. <td> {@link DistributedTestDecorator}
- * <tr><td> Attach XML test result logger.
- * <tr><td> Terminate the interop testing framework.
- * </table>
- *
- * @todo Should accumulate failures over all tests, and return with success or fail code based on all results. May need
- * to write a special TestResult to do this properly. At the moment only the last one used will be tested for
- * errors, as the start method creates a fresh one for each test case run.
- */
-public class Coordinator extends TKTestRunner
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(Coordinator.class);
-
- /** Used for reporting to the console. */
- private static final Logger console = Logger.getLogger("CONSOLE");
-
- /** Defines the possible distributed test engines available to run coordinated test cases with. */
- public enum TestEngine
- {
- /** Specifies the interop test engine. This tests all available clients in pairs. */
- INTEROP,
-
- /** Specifies the fanout test engine. This sets up one publisher role, and many reciever roles. */
- FANOUT
- }
-
- /**
- * Holds the test context properties that provides the default test parameters, plus command line overrides.
- * This is initialized with the default test parameters, to which command line overrides may be applied.
- */
- protected static ParsedProperties testContextProperties =
- TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- /** Holds the URL of the broker to coordinate the tests on. */
- protected String brokerUrl;
-
- /** Holds the virtual host to coordinate the tests on. If <tt>null</tt>, then the default virtual host is used. */
- protected String virtualHost;
-
- /** Holds the list of all clients that enlisted, when the compulsory invite was issued. */
- protected Set<TestClientDetails> enlistedClients = new HashSet<TestClientDetails>();
-
- /** Holds the conversation helper for the control conversation. */
- protected ConversationFactory conversationFactory;
-
- /** Holds the connection that the coordinating messages are sent over. */
- protected Connection connection;
-
- /** Holds the path of the directory to output test results too, if one is defined. */
- protected String reportDir;
-
- /** Holds the coordinating test engine type to run the tests through. */
- protected TestEngine engine;
-
- /** Flag that indicates that all test clients should be terminated upon completion of the test cases. */
- protected boolean terminate;
-
- /**
- * Creates an interop test coordinator on the specified broker and virtual host.
- *
- * @param repetitions The number of times to repeat the test, or test batch size.
- * @param duration The length of time to run the tests for. -1 means no duration has been set.
- * @param threads The concurrency levels to ramp up to.
- * @param delay A delay in milliseconds between test runs.
- * @param params The sets of 'size' parameters to pass to test.
- * @param testCaseName The name of the test case to run.
- * @param reportDir The directory to output the test results to.
- * @param runName The name of the test run; used to name the output file.
- * @param verbose Whether to print comments during test run.
- * @param brokerUrl The URL of the broker to connect to.
- * @param virtualHost The virtual host to run all tests on. Optional, may be <tt>null</tt>.
- * @param engine The distributed test engine type to run the tests with.
- * @param terminate <tt>true</tt> if test client nodes should be terminated at the end of the tests.
- * @param csv <tt>true</tt> if the CSV results listener should be attached.
- * @param xml <tt>true</tt> if the XML results listener should be attached.
- * @param decoratorFactories List of factories for user specified decorators.
- */
- public Coordinator(Integer repetitions, Long duration, int[] threads, int delay, int[] params, String testCaseName,
- String reportDir, String runName, boolean verbose, String brokerUrl, String virtualHost, TestEngine engine,
- boolean terminate, boolean csv, boolean xml, List<TestDecoratorFactory> decoratorFactories)
- {
- super(repetitions, duration, threads, delay, params, testCaseName, reportDir, runName, csv, xml, decoratorFactories);
-
- log.debug("public Coordinator(Integer repetitions = " + repetitions + " , Long duration = " + duration
- + ", int[] threads = " + Arrays.toString(threads) + ", int delay = " + delay + ", int[] params = "
- + Arrays.toString(params) + ", String testCaseName = " + testCaseName + ", String reportDir = " + reportDir
- + ", String runName = " + runName + ", boolean verbose = " + verbose + ", String brokerUrl = " + brokerUrl
- + ", String virtualHost =" + virtualHost + ", TestEngine engine = " + engine + ", boolean terminate = "
- + terminate + ", boolean csv = " + csv + ", boolean xml = " + xml + "): called");
-
- // Retain the connection parameters.
- this.brokerUrl = brokerUrl;
- this.virtualHost = virtualHost;
- this.reportDir = reportDir;
- this.engine = engine;
- this.terminate = terminate;
- }
-
- /**
- * The entry point for the interop test coordinator. This client accepts the following command line arguments:
- *
- * <p/><table>
- * <tr><td> -b <td> The broker URL. <td> Mandatory.
- * <tr><td> -h <td> The virtual host. <td> Optional.
- * <tr><td> -o <td> The directory to output test results to. <td> Optional.
- * <tr><td> -e <td> The type of test distribution engine to use. <td> Optional. One of: interop, fanout.
- * <tr><td> ... <td> Free arguments. The distributed test cases to run.
- * <td> Mandatory. At least one must be defined.
- * <tr><td> name=value <td> Trailing argument define name/value pairs. Added to the test contenxt properties.
- * <td> Optional.
- * </table>
- *
- * @param args The command line arguments.
- */
- public static void main(String[] args)
- {
- NDC.push("coordinator");
- log.debug("public static void main(String[] args = " + Arrays.toString(args) + "): called");
- console.info("Qpid Distributed Test Coordinator.");
-
- // Override the default broker url to be localhost:5672.
- testContextProperties.setProperty(MessagingTestConfigProperties.BROKER_PROPNAME, "tcp://localhost:5672");
-
- try
- {
- // Use the command line parser to evaluate the command line with standard handling behaviour (print errors
- // and usage then exist if there are errors).
- // Any options and trailing name=value pairs are also injected into the test context properties object,
- // to override any defaults that may have been set up.
- ParsedProperties options =
- new ParsedProperties(CommandLineParser.processCommandLine(args,
- new CommandLineParser(
- new String[][]
- {
- { "b", "The broker URL.", "broker", "false" },
- { "h", "The virtual host to use.", "virtual host", "false" },
- { "o", "The name of the directory to output test timings to.", "dir", "false" },
- {
- "e", "The test execution engine to use. Default is interop.", "engine", "interop",
- "^interop$|^fanout$", "true"
- },
- { "t", "Terminate test clients on completion of tests.", null, "false" },
- { "-csv", "Output test results in CSV format.", null, "false" },
- { "-xml", "Output test results in XML format.", null, "false" },
- {
- "-trefaddr", "To specify an alternative to hostname for time singal reference.",
- "address", "false"
- },
- {
- "c", "The number of tests to run concurrently.", "num", "false",
- MathUtils.SEQUENCE_REGEXP
- },
- { "r", "The number of times to repeat each test.", "num", "false" },
- {
- "d", "The length of time to run the tests for.", "duration", "false",
- MathUtils.DURATION_REGEXP
- },
- {
- "f", "The maximum rate to call the tests at.", "frequency", "false",
- "^([1-9][0-9]*)/([1-9][0-9]*)$"
- },
- { "s", "The size parameter to run tests with.", "size", "false", MathUtils.SEQUENCE_REGEXP },
- { "v", "Verbose mode.", null, "false" },
- { "n", "A name for this test run, used to name the output file.", "name", "true" },
- {
- "X:decorators", "A list of additional test decorators to wrap the tests in.",
- "\"class.name[:class.name]*\"", "false"
- }
- }), testContextProperties));
-
- // Extract the command line options.
- String brokerUrl = options.getProperty("b");
- String virtualHost = options.getProperty("h");
- String reportDir = options.getProperty("o");
- reportDir = (reportDir == null) ? "." : reportDir;
- String testEngine = options.getProperty("e");
- TestEngine engine = "fanout".equals(testEngine) ? TestEngine.FANOUT : TestEngine.INTEROP;
- boolean terminate = options.getPropertyAsBoolean("t");
- boolean csvResults = options.getPropertyAsBoolean("-csv");
- boolean xmlResults = options.getPropertyAsBoolean("-xml");
- String threadsString = options.getProperty("c");
- Integer repetitions = options.getPropertyAsInteger("r");
- String durationString = options.getProperty("d");
- String paramsString = options.getProperty("s");
- boolean verbose = options.getPropertyAsBoolean("v");
- String testRunName = options.getProperty("n");
- String decorators = options.getProperty("X:decorators");
-
- int[] threads = (threadsString == null) ? null : MathUtils.parseSequence(threadsString);
- int[] params = (paramsString == null) ? null : MathUtils.parseSequence(paramsString);
- Long duration = (durationString == null) ? null : MathUtils.parseDuration(durationString);
-
- // If broker or virtual host settings were specified as command line options, override the defaults in the
- // test context properties with them.
-
- // Collection all of the test cases to be run.
- Collection<Class<? extends FrameworkBaseCase>> testCaseClasses =
- new ArrayList<Class<? extends FrameworkBaseCase>>();
-
- // Create a list of test decorator factories for use specified decorators to be applied.
- List<TestDecoratorFactory> decoratorFactories = parseDecorators(decorators);
-
- // Scan for available test cases using a classpath scanner.
- // ClasspathScanner.getMatches(DistributedTestCase.class, "^Test.*", true);
-
- // Hard code the test classes till the classpath scanner is fixed.
- // Collections.addAll(testCaseClasses, InteropTestCase1DummyRun.class, InteropTestCase2BasicP2P.class,
- // InteropTestCase3BasicPubSub.class);
-
- // Parse all of the free arguments as test cases to run.
- for (int i = 1; true; i++)
- {
- String nextFreeArg = options.getProperty(Integer.toString(i));
-
- // Terminate the loop once all free arguments have been consumed.
- if (nextFreeArg == null)
- {
- break;
- }
-
- try
- {
- Class nextClass = Class.forName(nextFreeArg);
-
- if (FrameworkBaseCase.class.isAssignableFrom(nextClass))
- {
- testCaseClasses.add(nextClass);
- console.info("Found distributed test case: " + nextFreeArg);
- }
- }
- catch (ClassNotFoundException e)
- {
- console.info("Unable to instantiate the test case: " + nextFreeArg + ".");
- }
- }
-
- // Check that some test classes were actually found.
- if (testCaseClasses.isEmpty())
- {
- throw new RuntimeException(
- "No test cases implementing FrameworkBaseCase were specified on the command line.");
- }
-
- // Extract the names of all the test classes, to pass to the start method.
- int i = 0;
- String[] testClassNames = new String[testCaseClasses.size()];
-
- for (Class testClass : testCaseClasses)
- {
- testClassNames[i++] = testClass.getName();
- }
-
- // Create a coordinator and begin its test procedure.
- Coordinator coordinator =
- new Coordinator(repetitions, duration, threads, 0, params, null, reportDir, testRunName, verbose, brokerUrl,
- virtualHost, engine, terminate, csvResults, xmlResults, decoratorFactories);
-
- TestResult testResult = coordinator.start(testClassNames);
-
- // Return different error codes, depending on whether or not there were test failures.
- if (testResult.failureCount() > 0)
- {
- System.exit(FAILURE_EXIT);
- }
- else
- {
- System.exit(SUCCESS_EXIT);
- }
- }
- catch (Exception e)
- {
- log.debug("Top level handler caught execption.", e);
- console.info(e.getMessage());
- e.printStackTrace();
- System.exit(EXCEPTION_EXIT);
- }
- }
-
- /**
- * Starts all of the test classes to be run by this coordinator.
- *
- * @param testClassNames An array of all the coordinating test case implementations.
- *
- * @return A JUnit TestResult to run the tests with.
- *
- * @throws Exception Any underlying exceptions are allowed to fall through, and fail the test process.
- */
- public TestResult start(String[] testClassNames) throws Exception
- {
- log.debug("public TestResult start(String[] testClassNames = " + Arrays.toString(testClassNames) + ": called");
-
- // Connect to the broker.
- connection = TestUtils.createConnection(TestContextProperties.getInstance());
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- Destination controlTopic = session.createTopic("iop.control");
- Destination responseQueue = session.createQueue("coordinator");
-
- conversationFactory = new ConversationFactory(connection, responseQueue, LinkedBlockingQueue.class);
- ConversationFactory.Conversation conversation = conversationFactory.startConversation();
-
- connection.start();
-
- // Broadcast the compulsory invitation to find out what clients are available to test.
- Message invite = session.createMessage();
- invite.setStringProperty("CONTROL_TYPE", "INVITE");
- invite.setJMSReplyTo(responseQueue);
-
- conversation.send(controlTopic, invite);
-
- // Wait for a short time, to give test clients an opportunity to reply to the invitation.
- Collection<Message> enlists = conversation.receiveAll(0, 500);
- enlistedClients = extractEnlists(enlists);
-
- for (TestClientDetails client : enlistedClients)
- {
- log.debug("Got enlisted test client: " + client);
- console.info("Test node " + client.clientName + " available.");
- }
-
- // Start the clock reference service running.
- UDPClockReference clockReference = new UDPClockReference();
- Thread clockRefThread = new Thread(clockReference);
- registerShutdownHook(clockReference);
- clockRefThread.start();
-
- // Broadcast to all clients to synchronize their clocks against the coordinators clock reference.
- Message clockSynchRequest = session.createMessage();
- clockSynchRequest.setStringProperty("CONTROL_TYPE", "CLOCK_SYNCH");
-
- String localAddress = InetAddress.getByName(InetAddress.getLocalHost().getHostName()).getHostAddress();
- clockSynchRequest.setStringProperty("ADDRESS", localAddress);
-
- conversation.send(controlTopic, clockSynchRequest);
-
- // Run the test in the suite using JUnit.
- TestResult result = null;
-
- for (String testClassName : testClassNames)
- {
- // Record the current test class, so that the test results can be output to a file incorporating this name.
- this.currentTestClassName = testClassName;
-
- result = super.start(new String[] { testClassName });
- }
-
- // At this point in time, all tests have completed. Broadcast the shutdown message, if the termination option
- // was set on the command line.
- if (terminate)
- {
- Message terminate = session.createMessage();
- terminate.setStringProperty("CONTROL_TYPE", "TERMINATE");
-
- conversation.send(controlTopic, terminate);
- }
-
- return result;
- }
-
- /**
- * For a collection of enlist messages, this method pulls out of the client details for the enlisting clients.
- *
- * @param enlists The enlist messages.
- *
- * @return A set of enlisting clients, extracted from the enlist messages.
- *
- * @throws JMSException Any underlying JMSException is allowed to fall through.
- */
- public static Set<TestClientDetails> extractEnlists(Collection<Message> enlists) throws JMSException
- {
- log.debug("public static Set<TestClientDetails> extractEnlists(Collection<Message> enlists = " + enlists
- + "): called");
-
- Set<TestClientDetails> enlistedClients = new HashSet<TestClientDetails>();
-
- // Retain the list of all available clients.
- for (Message enlist : enlists)
- {
- TestClientDetails clientDetails = new TestClientDetails();
- clientDetails.clientName = enlist.getStringProperty("CLIENT_NAME");
- clientDetails.privateControlKey = enlist.getStringProperty("CLIENT_PRIVATE_CONTROL_KEY");
-
- String replyType = enlist.getStringProperty("CONTROL_TYPE");
-
- if ("ENLIST".equals(replyType))
- {
- enlistedClients.add(clientDetails);
- }
- else if ("DECLINE".equals(replyType))
- {
- log.debug("Test client " + clientDetails.clientName + " declined the invite.");
- }
- else
- {
- log.warn("Got an unknown reply type, " + replyType + ", to the invite.");
- }
- }
-
- return enlistedClients;
- }
-
- /**
- * Runs a test or suite of tests, using the super class implemenation. This method wraps the test to be run
- * in any test decorators needed to add in the coordinators ability to invite test clients to participate in
- * tests.
- *
- * @param test The test to run.
- * @param wait Undocumented. Nothing in the JUnit javadocs to say what this is for.
- *
- * @return The results of the test run.
- */
- public TestResult doRun(Test test, boolean wait)
- {
- log.debug("public TestResult doRun(Test \"" + test + "\", boolean " + wait + "): called");
-
- // Wrap all tests in the test suite with WrappedSuiteTestDecorators. This is quite ugly and a bit baffling,
- // but the reason it is done is because the JUnit implementation of TestDecorator has some bugs in it.
- WrappedSuiteTestDecorator targetTest = null;
-
- if (test instanceof TestSuite)
- {
- log.debug("targetTest is a TestSuite");
-
- TestSuite suite = (TestSuite)test;
-
- int numTests = suite.countTestCases();
- log.debug("There are " + numTests + " in the suite.");
-
- for (int i = 0; i < numTests; i++)
- {
- Test nextTest = suite.testAt(i);
- log.debug("suite.testAt(" + i + ") = " + nextTest);
-
- if (nextTest instanceof FrameworkBaseCase)
- {
- log.debug("nextTest is a FrameworkBaseCase");
- }
- }
-
- targetTest = new WrappedSuiteTestDecorator(suite);
- log.debug("Wrapped with a WrappedSuiteTestDecorator.");
- }
-
- // Apply any optional user specified decorators.
- targetTest = applyOptionalUserDecorators(targetTest);
-
- // Wrap the tests in a suitable distributed test decorator, to perform the invite/test cycle.
- targetTest = newTestDecorator(targetTest, enlistedClients, conversationFactory, connection);
-
- // TestSuite suite = new TestSuite();
- // suite.addTest(targetTest);
-
- // Wrap the tests in a scaled test decorator to them them as a 'batch' in one thread.
- // targetTest = new ScaledTestDecorator(targetTest, new int[] { 1 });
-
- return super.doRun(targetTest, wait);
- }
-
- /**
- * Creates a wrapped test decorator, that is capable of inviting enlisted clients to participate in a specified
- * test. This is the test engine that sets up the roles and sequences a distributed test case.
- *
- * @param targetTest The test decorator to wrap.
- * @param enlistedClients The enlisted clients available to run the test.
- * @param conversationFactory The conversation factory used to build conversation helper over the specified connection.
- * @param connection The connection to talk to the enlisted clients over.
- *
- * @return An invititing test decorator, that invites all the enlisted clients to participate in tests, in pairs.
- */
- protected DistributedTestDecorator newTestDecorator(WrappedSuiteTestDecorator targetTest,
- Set<TestClientDetails> enlistedClients, ConversationFactory conversationFactory, Connection connection)
- {
- switch (engine)
- {
- case FANOUT:
- return new FanOutTestDecorator(targetTest, enlistedClients, conversationFactory, connection);
- case INTEROP:
- default:
- return new InteropTestDecorator(targetTest, enlistedClients, conversationFactory, connection);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java
deleted file mode 100644
index bdcfc996d6..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java
+++ /dev/null
@@ -1,166 +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.
- *
- */
-package org.apache.qpid.test.framework.distributedtesting;
-
-import junit.framework.TestResult;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import org.apache.qpid.test.framework.TestClientDetails;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-import org.apache.qpid.test.utils.ConversationFactory;
-
-import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;
-
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-import java.util.*;
-
-/**
- * DistributedTestDecorator is a base class for writing test decorators that invite test clients to participate in
- * distributed test cases. It provides a helper method, {@link #signupClients}, that broadcasts an invitation and
- * returns the set of test clients that are available to particiapte in the test.
- *
- * <p/>When used to wrap a {@link FrameworkBaseCase} test, it replaces the default {@link CircuitFactory} implementations
- * with a suitable circuit factory for distributed tests. Concrete implementations can use this to configure the sending
- * and receiving roles on the test.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Broadcast test invitations and collect enlists. <td> {@link ConversationFactory}.
- * </table>
- */
-public abstract class DistributedTestDecorator extends WrappedSuiteTestDecorator
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(DistributedTestDecorator.class);
-
- /** Holds the contact information for all test clients that are available and that may take part in the test. */
- Set<TestClientDetails> allClients;
-
- /** Holds the conversation helper for the control level conversation for coordinating the test through. */
- ConversationFactory conversationFactory;
-
- /** Holds the connection that the control conversation is held over. */
- Connection connection;
-
- /** Holds the underlying test suite that this decorator wraps. */
- WrappedSuiteTestDecorator testSuite;
-
- /** Holds the control topic, on which test invitations are broadcast. */
- protected Destination controlTopic;
-
- /**
- * Creates a wrapped suite test decorator from another one.
- *
- * @param suite The test suite.
- * @param availableClients The list of all clients that responded to the compulsory invite.
- * @param controlConversation The conversation helper for the control level, test coordination conversation.
- * @param controlConnection The connection that the coordination messages are sent over.
- */
- public DistributedTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> availableClients,
- ConversationFactory controlConversation, Connection controlConnection)
- {
- super(suite);
-
- log.debug("public DistributedTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> allClients = "
- + availableClients + ", ConversationHelper controlConversation = " + controlConversation + "): called");
-
- testSuite = suite;
- allClients = availableClients;
- conversationFactory = controlConversation;
- connection = controlConnection;
-
- // Set up the test control topic.
- try
- {
- controlTopic = conversationFactory.getSession().createTopic("iop.control");
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Unable to create the coordinating control topic to broadcast test invites on.", e);
- }
- }
-
- /**
- * Should run all of the tests in the wrapped test suite.
- *
- * @param testResult The the results object to monitor the test results with.
- */
- public abstract void run(TestResult testResult);
-
- /**
- * Should provide the distributed test sequencer to pass to {@link org.apache.qpid.test.framework.FrameworkBaseCase}
- * tests.
- *
- * @return A distributed test sequencer.
- */
- public abstract CircuitFactory getTestSequencer();
-
- /**
- * Broadcasts an invitation to participate in a coordinating test case to find out what clients are available to
- * run the test case.
- *
- * @param coordTest The coordinating test case to broadcast an inviate for.
- *
- * @return A set of test clients that accepted the invitation.
- */
- protected Set<TestClientDetails> signupClients(FrameworkBaseCase coordTest)
- {
- // Broadcast the invitation to find out what clients are available to test.
- Set<TestClientDetails> enlists;
- try
- {
- Message invite = conversationFactory.getSession().createMessage();
-
- ConversationFactory.Conversation conversation = conversationFactory.startConversation();
-
- invite.setStringProperty("CONTROL_TYPE", "INVITE");
- invite.setStringProperty("TEST_NAME", coordTest.getTestCaseNameForTestMethod(coordTest.getName()));
-
- conversation.send(controlTopic, invite);
-
- // Wait for a short time, to give test clients an opportunity to reply to the invitation.
- Collection<Message> replies = conversation.receiveAll(allClients.size(), 500);
- enlists = Coordinator.extractEnlists(replies);
- }
- catch (JMSException e)
- {
- throw new RuntimeException("There was a JMSException during the invite/enlist conversation.", e);
- }
-
- return enlists;
- }
-
- /**
- * Prints a string summarizing this test decorator, mainly for debugging purposes.
- *
- * @return String representation for debugging purposes.
- */
- public String toString()
- {
- return "DistributedTestDecorator: [ testSuite = " + testSuite + " ]";
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java
deleted file mode 100644
index eed9b1f290..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java
+++ /dev/null
@@ -1,244 +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.
- *
- */
-package org.apache.qpid.test.framework.distributedtesting;
-
-import junit.framework.Test;
-import junit.framework.TestResult;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.DropInTest;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import org.apache.qpid.test.framework.TestClientDetails;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-import org.apache.qpid.test.framework.sequencers.FanOutCircuitFactory;
-import org.apache.qpid.test.utils.ConversationFactory;
-
-import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * FanOutTestDecorator is an {@link DistributedTestDecorator} that runs one test client in the sender role, and the remainder
- * in the receivers role. It also has the capability to listen for new test cases joining the test beyond the initial start
- * point. This feature can be usefull when experimenting with adding more load, in the form of more test clients, to assess
- * its impact on a running test.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Execute coordinated test cases. <td> {@link FrameworkBaseCase}
- * <tr><td> Accept test clients joining a running test.
- * </table>
- */
-public class FanOutTestDecorator extends DistributedTestDecorator implements MessageListener
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(FanOutTestDecorator.class);
-
- /** Holds the currently running test case. */
- FrameworkBaseCase currentTest = null;
-
- /**
- * Creates a wrapped suite test decorator from another one.
- *
- * @param suite The test suite.
- * @param availableClients The list of all clients that responded to the compulsory invite.
- * @param controlConversation The conversation helper for the control level, test coordination conversation.
- * @param controlConnection The connection that the coordination messages are sent over.
- */
- public FanOutTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> availableClients,
- ConversationFactory controlConversation, Connection controlConnection)
- {
- super(suite, availableClients, controlConversation, controlConnection);
-
- log.debug("public DistributedTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> allClients = "
- + availableClients + ", ConversationHelper controlConversation = " + controlConversation + "): called");
-
- testSuite = suite;
- allClients = availableClients;
- conversationFactory = controlConversation;
- connection = controlConnection;
-
- // Sign available clients up to the test.
- for (Test test : getAllUnderlyingTests())
- {
- FrameworkBaseCase coordTest = (FrameworkBaseCase) test;
-
- // Get all of the clients able to participate in the test.
- Set<TestClientDetails> enlists = signupClients(coordTest);
-
- // Check that there were some clients available.
- if (enlists.size() == 0)
- {
- throw new RuntimeException("No clients to test with");
- }
-
- // Create a distributed test circuit factory for the test.
- CircuitFactory circuitFactory = getTestSequencer();
-
- // Set up the first client in the sender role, and the remainder in the receivers role.
- Iterator<TestClientDetails> clients = enlists.iterator();
- circuitFactory.setSender(clients.next());
-
- while (clients.hasNext())
- {
- // Set the sending and receiving client details on the test case.
- circuitFactory.setReceiver(clients.next());
- }
-
- // Pass down the connection to hold the coordinating conversation over.
- circuitFactory.setConversationFactory(conversationFactory);
-
- // If the current test case is a drop-in test, set it up as the currently running test for late joiners to
- // add in to. Otherwise the current test field is set to null, to indicate that late joiners are not allowed.
- currentTest = (coordTest instanceof DropInTest) ? coordTest : null;
-
- // Execute the test case.
- coordTest.setCircuitFactory(circuitFactory);
- }
- }
-
- /**
- * Broadcasts a test invitation and accepts enlists from participating clients. The wrapped test cases are run
- * with one test client in the sender role, and the remaining test clients in the receiving role.
- *
- * <p/>Any JMSExceptions during the invite/enlist conversation will be allowed to fall through as runtime
- * exceptions, resulting in the non-completion of the test run.
- *
- * @param testResult The the results object to monitor the test results with.
- *
- * @todo Better error recovery for failure of the invite/enlist conversation could be added.
- */
- public void run(TestResult testResult)
- {
- log.debug("public void run(TestResult testResult): called");
-
- // Listen for late joiners on the control topic.
- try
- {
- conversationFactory.getSession().createConsumer(controlTopic).setMessageListener(this);
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Unable to set up the message listener on the control topic.", e);
- }
-
- // Run all of the test cases in the test suite.
- /*for (Test test : getAllUnderlyingTests())
- {
- FrameworkBaseCase coordTest = (FrameworkBaseCase) test;
-
- // Get all of the clients able to participate in the test.
- Set<TestClientDetails> enlists = signupClients(coordTest);
-
- // Check that there were some clients available.
- if (enlists.size() == 0)
- {
- throw new RuntimeException("No clients to test with");
- }
-
- // Create a distributed test circuit factory for the test.
- CircuitFactory circuitFactory = getTestSequencer();
-
- // Set up the first client in the sender role, and the remainder in the receivers role.
- Iterator<TestClientDetails> clients = enlists.iterator();
- circuitFactory.setSender(clients.next());
-
- while (clients.hasNext())
- {
- // Set the sending and receiving client details on the test case.
- circuitFactory.setReceiver(clients.next());
- }
-
- // Pass down the connection to hold the coordinating conversation over.
- circuitFactory.setConversationFactory(conversationFactory);
-
- // If the current test case is a drop-in test, set it up as the currently running test for late joiners to
- // add in to. Otherwise the current test field is set to null, to indicate that late joiners are not allowed.
- currentTest = (coordTest instanceof DropInTest) ? coordTest : null;
-
- // Execute the test case.
- coordTest.setCircuitFactory(circuitFactory);
- }*/
-
- // Run all of the test cases in the test suite.
- for (Test test : getAllUnderlyingTests())
- {
- FrameworkBaseCase coordTest = (FrameworkBaseCase) test;
-
- coordTest.run(testResult);
-
- currentTest = null;
- }
- }
-
- /**
- * Should provide the distributed test sequencer to pass to {@link org.apache.qpid.test.framework.FrameworkBaseCase}
- * tests.
- *
- * @return A distributed test sequencer.
- */
- public CircuitFactory getTestSequencer()
- {
- return new FanOutCircuitFactory();
- }
-
- /**
- * Listens to incoming messages on the control topic. If the messages are 'join' messages, signalling a new
- * test client wishing to join the current test, then the new client will be added to the current test in the
- * receivers role.
- *
- * @param message The incoming control message.
- */
- public void onMessage(Message message)
- {
- try
- {
- // Check if the message is from a test client attempting to join a running test, and join it to the current
- // test case if so.
- if (message.getStringProperty("CONTROL_TYPE").equals("JOIN") && (currentTest != null))
- {
- ((DropInTest) currentTest).lateJoin(message);
- }
- }
- // There is not a lot can be done with this error, so it is deliberately ignored.
- catch (JMSException e)
- {
- log.debug("Unable to process message:" + message);
- }
- }
-
- /**
- * Prints a string summarizing this test decorator, mainly for debugging purposes.
- *
- * @return String representation for debugging purposes.
- */
- public String toString()
- {
- return "FanOutTestDecorator: [ testSuite = " + testSuite + " ]";
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java
deleted file mode 100644
index 413d5558f2..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java
+++ /dev/null
@@ -1,209 +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.
- *
- */
-package org.apache.qpid.test.framework.distributedtesting;
-
-import junit.framework.Test;
-import junit.framework.TestResult;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import org.apache.qpid.test.framework.TestClientDetails;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-import org.apache.qpid.test.framework.sequencers.InteropCircuitFactory;
-import org.apache.qpid.test.utils.ConversationFactory;
-
-import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;
-
-import javax.jms.Connection;
-
-import java.util.*;
-
-/**
- * DistributedTestDecorator is a test decorator, written to implement the interop test specification. Given a list
- * of enlisted test clients, that are available to run interop tests, this decorator invites them to participate
- * in each test in the wrapped test suite. Amongst all the clients that respond to the invite, all pairs are formed,
- * and each pairing (in both directions, but excluding the reflexive pairings) is split into a sender and receivers
- * role and a test case run between them. Any enlisted combinations that do not accept a test invite are automatically
- * failed.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Broadcast test invitations and collect enlists. <td> {@link org.apache.qpid.test.utils.ConversationFactory}.
- * <tr><td> Output test failures for clients unwilling to run the test case. <td> {@link Coordinator}
- * <tr><td> Execute distributed test cases. <td> {@link FrameworkBaseCase}
- * <tr><td> Fail non-participating pairings. <td> {@link OptOutTestCase}
- * </table>
- */
-public class InteropTestDecorator extends DistributedTestDecorator
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(InteropTestDecorator.class);
-
- /**
- * Creates a wrapped suite test decorator from another one.
- *
- * @param suite The test suite.
- * @param availableClients The list of all clients that responded to the compulsory invite.
- * @param controlConversation The conversation helper for the control level, test coordination conversation.
- * @param controlConnection The connection that the coordination messages are sent over.
- */
- public InteropTestDecorator(WrappedSuiteTestDecorator suite, Set<TestClientDetails> availableClients,
- ConversationFactory controlConversation, Connection controlConnection)
- {
- super(suite, availableClients, controlConversation, controlConnection);
- }
-
- /**
- * Broadcasts a test invitation and accetps enlisting from participating clients. The wrapped test case is
- * then repeated for every combination of test clients (provided the wrapped test case extends
- * {@link FrameworkBaseCase}.
- *
- * <p/>Any JMSExceptions during the invite/enlist conversation will be allowed to fall through as runtime exceptions,
- * resulting in the non-completion of the test run.
- *
- * @todo Better error recovery for failure of the invite/enlist conversation could be added.
- *
- * @param testResult The the results object to monitor the test results with.
- */
- public void run(TestResult testResult)
- {
- log.debug("public void run(TestResult testResult): called");
-
- Collection<Test> tests = testSuite.getAllUnderlyingTests();
-
- for (Test test : getAllUnderlyingTests())
- {
- FrameworkBaseCase coordTest = (FrameworkBaseCase) test;
-
- // Broadcast the invitation to find out what clients are available to test.
- Set<TestClientDetails> enlists = signupClients(coordTest);
-
- // Compare the list of willing clients to the list of all available.
- Set<TestClientDetails> optOuts = new HashSet<TestClientDetails>(allClients);
- optOuts.removeAll(enlists);
-
- // Output test failures for clients that will not particpate in the test.
- Set<List<TestClientDetails>> failPairs = allPairs(optOuts, allClients);
-
- for (List<TestClientDetails> failPair : failPairs)
- {
- // Create a distributed test circuit factory for the test.
- CircuitFactory circuitFactory = getTestSequencer();
-
- // Create an automatic failure test for the opted out test pair.
- FrameworkBaseCase failTest = new OptOutTestCase("testOptOut");
- circuitFactory.setSender(failPair.get(0));
- circuitFactory.setReceiver(failPair.get(1));
- failTest.setCircuitFactory(circuitFactory);
-
- failTest.run(testResult);
- }
-
- // Loop over all combinations of clients, willing to run the test.
- Set<List<TestClientDetails>> enlistedPairs = allPairs(enlists, enlists);
-
- for (List<TestClientDetails> enlistedPair : enlistedPairs)
- {
- // Create a distributed test circuit factory for the test.
- CircuitFactory circuitFactory = getTestSequencer();
-
- // Set the sending and receiving client details on the test circuitFactory.
- circuitFactory.setSender(enlistedPair.get(0));
- circuitFactory.setReceiver(enlistedPair.get(1));
-
- // Pass down the connection to hold the coordination conversation over.
- circuitFactory.setConversationFactory(conversationFactory);
-
- // Execute the test case.
- coordTest.setCircuitFactory(circuitFactory);
- coordTest.run(testResult);
- }
- }
- }
-
- /**
- * Should provide the distributed test sequencer to pass to {@link org.apache.qpid.test.framework.FrameworkBaseCase}
- * tests.
- *
- * @return A distributed test sequencer.
- */
- public CircuitFactory getTestSequencer()
- {
- return new InteropCircuitFactory();
- }
-
- /**
- * Produces all pairs of combinations of elements from two sets. The ordering of the elements in the pair is
- * important, that is the pair <l, r> is distinct from <r, l>; both pairs are generated. For any element, i, in
- * both the left and right sets, the reflexive pair <i, i> is not generated.
- *
- * @param left The left set.
- * @param right The right set.
- * @param <E> The type of the content of the pairs.
- *
- * @return All pairs formed from the permutations of all elements of the left and right sets.
- */
- private <E> Set<List<E>> allPairs(Set<E> left, Set<E> right)
- {
- log.debug("private <E> Set<List<E>> allPairs(Set<E> left = " + left + ", Set<E> right = " + right + "): called");
-
- Set<List<E>> results = new HashSet<List<E>>();
-
- // Form all pairs from left to right.
- // Form all pairs from right to left.
- for (E le : left)
- {
- for (E re : right)
- {
- if (!le.equals(re))
- {
- results.add(new Pair<E>(le, re));
- results.add(new Pair<E>(re, le));
- }
- }
- }
-
- log.debug("results = " + results);
-
- return results;
- }
-
- /**
- * A simple implementation of a pair, using a list.
- */
- private class Pair<T> extends ArrayList<T>
- {
- /**
- * Creates a new pair of elements.
- *
- * @param first The first element.
- * @param second The second element.
- */
- public Pair(T first, T second)
- {
- super();
- super.add(first);
- super.add(second);
- }
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/OptOutTestCase.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/OptOutTestCase.java
deleted file mode 100644
index 008b89a981..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/OptOutTestCase.java
+++ /dev/null
@@ -1,69 +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.
- *
- */
-package org.apache.qpid.test.framework.distributedtesting;
-
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-
-/**
- * An OptOutTestCase is a test case that automatically fails. It is used when a list of test clients has been generated
- * from a compulsory invite, but only some of those clients have responded to a specific test case invite. The clients
- * that did not respond, may automatically be given a fail for some tests.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Fail the test with a suitable reason.
- * </table>
- */
-public class OptOutTestCase extends FrameworkBaseCase
-{
- /**
- * Creates a new coordinating test case with the specified name.
- *
- * @param name The test case name.
- */
- public OptOutTestCase(String name)
- {
- super(name);
- }
-
- /** Generates an appropriate test failure assertion. */
- public void testOptOut()
- {
- CircuitFactory circuitFactory = getCircuitFactory();
-
- fail("One of " + circuitFactory.getSender() + " and " + getCircuitFactory().getReceivers()
- + " opted out of the test.");
- }
-
- /**
- * Should provide a translation from the junit method name of a test to its test case name as defined in the
- * interop testing specification. For example the method "testP2P" might map onto the interop test case name
- * "TC2_BasicP2P".
- *
- * @param methodName The name of the JUnit test method.
- * @return The name of the corresponding interop test case.
- */
- public String getTestCaseNameForTestMethod(String methodName)
- {
- return "OptOutTest";
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java
deleted file mode 100644
index 642c690376..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java
+++ /dev/null
@@ -1,497 +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.
- *
- */
-package org.apache.qpid.test.framework.distributedtesting;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
-
-import org.apache.qpid.test.framework.MessagingTestConfigProperties;
-import org.apache.qpid.test.framework.TestUtils;
-import org.apache.qpid.test.framework.clocksynch.ClockSynchThread;
-import org.apache.qpid.test.framework.clocksynch.UDPClockSynchronizer;
-import org.apache.qpid.test.utils.ReflectionUtils;
-import org.apache.qpid.test.utils.ReflectionUtilsException;
-
-import org.apache.qpid.junit.extensions.SleepThrottle;
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-import javax.jms.*;
-
-import java.util.*;
-
-/**
- * Implements a test client as described in the interop testing spec
- * (http://cwiki.apache.org/confluence/display/qpid/Interop+Testing+Specification). A test client is an agent that
- * reacts to control message sequences send by the test {@link Coordinator}.
- *
- * <p/><table><caption>Messages Handled by TestClient</caption>
- * <tr><th> Message <th> Action
- * <tr><td> Invite(compulsory) <td> Reply with Enlist.
- * <tr><td> Invite(test case) <td> Reply with Enlist if test case available.
- * <tr><td> AssignRole(test case) <td> Reply with Accept Role if matches an enlisted test. Keep test parameters.
- * <tr><td> Start <td> Send test messages defined by test parameters. Send report on messages sent.
- * <tr><td> Status Request <td> Send report on messages received.
- * <tr><td> Terminate <td> Terminate the test client.
- * <tr><td> ClockSynch <td> Synch clock against the supplied UDP address.
- * </table>
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Handle all incoming control messages. <td> {@link TestClientControlledTest}
- * <tr><td> Configure and look up test cases by name. <td> {@link TestClientControlledTest}
- * </table>
- */
-public class TestClient implements MessageListener
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(TestClient.class);
-
- /** Used for reporting to the console. */
- private static final Logger console = Logger.getLogger("CONSOLE");
-
- /** Holds the default identifying name of the test client. */
- public static final String CLIENT_NAME = "java";
-
- /** Holds the URL of the broker to run the tests on. */
- public static String brokerUrl;
-
- /** Holds the virtual host to run the tests on. If <tt>null</tt>, then the default virtual host is used. */
- public static String virtualHost;
-
- /**
- * Holds the test context properties that provides the default test parameters, plus command line overrides.
- * This is initialized with the default test parameters, to which command line overrides may be applied.
- */
- public static ParsedProperties testContextProperties =
- TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- /** Holds all the test cases loaded from the classpath. */
- Map<String, TestClientControlledTest> testCases = new HashMap<String, TestClientControlledTest>();
-
- /** Holds the test case currently being run by this client. */
- protected TestClientControlledTest currentTestCase;
-
- /** Holds the connection to the broker that the test is being coordinated on. */
- protected Connection connection;
-
- /** Holds the message producer to hold the test coordination over. */
- protected MessageProducer producer;
-
- /** Holds the JMS controlSession for the test coordination. */
- protected Session session;
-
- /** Holds the name of this client, with a default value. */
- protected String clientName = CLIENT_NAME;
-
- /** This flag indicates that the test client should attempt to join the currently running test case on start up. */
- protected boolean join;
-
- /** Holds the clock synchronizer for the test node. */
- ClockSynchThread clockSynchThread;
-
- /**
- * Creates a new interop test client, listenting to the specified broker and virtual host, with the specified client
- * identifying name.
- *
- * @param pBrokerUrl The url of the broker to connect to.
- * @param pVirtualHost The virtual host to conect to.
- * @param clientName The client name to use.
- * @param join Flag to indicate that this client should attempt to join running tests.
- */
- public TestClient(String pBrokerUrl, String pVirtualHost, String clientName, boolean join)
- {
- log.debug("public TestClient(String pBrokerUrl = " + pBrokerUrl + ", String pVirtualHost = " + pVirtualHost
- + ", String clientName = " + clientName + ", boolean join = " + join + "): called");
-
- // Retain the connection parameters.
- brokerUrl = pBrokerUrl;
- virtualHost = pVirtualHost;
- this.clientName = clientName;
- this.join = join;
- }
-
- /**
- * The entry point for the interop test coordinator. This client accepts the following command line arguments:
- *
- * <p/><table>
- * <tr><td> -b <td> The broker URL. <td> Optional.
- * <tr><td> -h <td> The virtual host. <td> Optional.
- * <tr><td> -n <td> The test client name. <td> Optional.
- * <tr><td> name=value <td> Trailing argument define name/value pairs. Added to system properties. <td> Optional.
- * </table>
- *
- * @param args The command line arguments.
- */
- public static void main(String[] args)
- {
- log.debug("public static void main(String[] args = " + Arrays.toString(args) + "): called");
- console.info("Qpid Distributed Test Client.");
-
- // Override the default broker url to be localhost:5672.
- testContextProperties.setProperty(MessagingTestConfigProperties.BROKER_PROPNAME, "tcp://localhost:5672");
-
- // Use the command line parser to evaluate the command line with standard handling behaviour (print errors
- // and usage then exist if there are errors).
- // Any options and trailing name=value pairs are also injected into the test context properties object,
- // to override any defaults that may have been set up.
- ParsedProperties options =
- new ParsedProperties(org.apache.qpid.junit.extensions.util.CommandLineParser.processCommandLine(args,
- new org.apache.qpid.junit.extensions.util.CommandLineParser(
- new String[][]
- {
- { "b", "The broker URL.", "broker", "false" },
- { "h", "The virtual host to use.", "virtual host", "false" },
- { "o", "The name of the directory to output test timings to.", "dir", "false" },
- { "n", "The name of the test client.", "name", "false" },
- { "j", "Join this test client to running test.", "false" }
- }), testContextProperties));
-
- // Extract the command line options.
- String brokerUrl = options.getProperty("b");
- String virtualHost = options.getProperty("h");
- String clientName = options.getProperty("n");
- clientName = (clientName == null) ? CLIENT_NAME : clientName;
- boolean join = options.getPropertyAsBoolean("j");
-
- // To distinguish logging output set up an NDC on the client name.
- NDC.push(clientName);
-
- // Create a test client and start it running.
- TestClient client = new TestClient(brokerUrl, virtualHost, clientName, join);
-
- // Use a class path scanner to find all the interop test case implementations.
- // Hard code the test classes till the classpath scanner is fixed.
- Collection<Class<? extends TestClientControlledTest>> testCaseClasses =
- new ArrayList<Class<? extends TestClientControlledTest>>();
- // ClasspathScanner.getMatches(TestClientControlledTest.class, "^TestCase.*", true);
- testCaseClasses.addAll(loadTestCases("org.apache.qpid.interop.clienttestcases.TestCase1DummyRun",
- "org.apache.qpid.interop.clienttestcases.TestCase2BasicP2P",
- "org.apache.qpid.interop.clienttestcases.TestCase3BasicPubSub",
- "org.apache.qpid.interop.clienttestcases.TestCase4P2PMessageSize",
- "org.apache.qpid.interop.clienttestcases.TestCase5PubSubMessageSize",
- "org.apache.qpid.test.framework.distributedcircuit.TestClientCircuitEnd"));
-
- try
- {
- client.start(testCaseClasses);
- }
- catch (Exception e)
- {
- log.error("The test client was unable to start.", e);
- console.info(e.getMessage());
- System.exit(1);
- }
- }
-
- /**
- * Parses a list of class names, and loads them if they are available on the class path.
- *
- * @param classNames The names of the classes to load.
- *
- * @return A list of the loaded test case classes.
- */
- public static List<Class<? extends TestClientControlledTest>> loadTestCases(String... classNames)
- {
- List<Class<? extends TestClientControlledTest>> testCases =
- new LinkedList<Class<? extends TestClientControlledTest>>();
-
- for (String className : classNames)
- {
- try
- {
- Class<?> cls = ReflectionUtils.forName(className);
- testCases.add((Class<? extends TestClientControlledTest>) cls);
- }
- catch (ReflectionUtilsException e)
- {
- // Ignore, class could not be found, so test not available.
- console.warn("Requested class " + className + " cannot be found, ignoring it.");
- }
- catch (ClassCastException e)
- {
- // Ignore, class was not of correct type to be a test case.
- console.warn("Requested class " + className + " is not an instance of TestClientControlledTest.");
- }
- }
-
- return testCases;
- }
-
- /**
- * Starts the interop test client running. This causes it to start listening for incoming test invites.
- *
- * @param testCaseClasses The classes of the available test cases. The test case names from these are used to
- * matchin incoming test invites against.
- *
- * @throws JMSException Any underlying JMSExceptions are allowed to fall through.
- */
- protected void start(Collection<Class<? extends TestClientControlledTest>> testCaseClasses) throws JMSException
- {
- log.debug("protected void start(Collection<Class<? extends TestClientControlledTest>> testCaseClasses = "
- + testCaseClasses + "): called");
-
- // Create all the test case implementations and index them by the test names.
- for (Class<? extends TestClientControlledTest> nextClass : testCaseClasses)
- {
- try
- {
- TestClientControlledTest testCase = nextClass.newInstance();
- testCases.put(testCase.getName(), testCase);
- }
- catch (InstantiationException e)
- {
- log.warn("Could not instantiate test case class: " + nextClass.getName(), e);
- // Ignored.
- }
- catch (IllegalAccessException e)
- {
- log.warn("Could not instantiate test case class due to illegal access: " + nextClass.getName(), e);
- // Ignored.
- }
- }
-
- // Open a connection to communicate with the coordinator on.
- connection = TestUtils.createConnection(testContextProperties);
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Set this up to listen for control messages.
- Topic privateControlTopic = session.createTopic("iop.control." + clientName);
- MessageConsumer consumer = session.createConsumer(privateControlTopic);
- consumer.setMessageListener(this);
-
- Topic controlTopic = session.createTopic("iop.control");
- MessageConsumer consumer2 = session.createConsumer(controlTopic);
- consumer2.setMessageListener(this);
-
- // Create a producer to send replies with.
- producer = session.createProducer(null);
-
- // If the join flag was set, then broadcast a join message to notify the coordinator that a new test client
- // is available to join the current test case, if it supports it. This message may be ignored, or it may result
- // in this test client receiving a test invite.
- if (join)
- {
- Message joinMessage = session.createMessage();
-
- joinMessage.setStringProperty("CONTROL_TYPE", "JOIN");
- joinMessage.setStringProperty("CLIENT_NAME", clientName);
- joinMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
- producer.send(controlTopic, joinMessage);
- }
-
- // Start listening for incoming control messages.
- connection.start();
- }
-
- /**
- * Handles all incoming control messages.
- *
- * @param message The incoming message.
- */
- public void onMessage(Message message)
- {
- NDC.push(clientName);
- log.debug("public void onMessage(Message message = " + message + "): called");
-
- try
- {
- String controlType = message.getStringProperty("CONTROL_TYPE");
- String testName = message.getStringProperty("TEST_NAME");
-
- log.debug("Received control of type '" + controlType + "' for the test '" + testName + "'");
-
- // Check if the message is a test invite.
- if ("INVITE".equals(controlType))
- {
- // Flag used to indicate that an enlist should be sent. Only enlist to compulsory invites or invites
- // for which test cases exist.
- boolean enlist = false;
-
- if (testName != null)
- {
- log.debug("Got an invite to test: " + testName);
-
- // Check if the requested test case is available.
- TestClientControlledTest testCase = testCases.get(testName);
-
- if (testCase != null)
- {
- log.debug("Found implementing class for test '" + testName + "', enlisting for it.");
-
- // Check if the test case will accept the invitation.
- enlist = testCase.acceptInvite(message);
-
- log.debug("The test case "
- + (enlist ? " accepted the invite, enlisting for it."
- : " did not accept the invite, not enlisting."));
-
- // Make the requested test case the current test case.
- currentTestCase = testCase;
- }
- else
- {
- log.debug("Received an invite to the test '" + testName + "' but this test is not known.");
- }
- }
- else
- {
- log.debug("Got a compulsory invite, enlisting for it.");
-
- enlist = true;
- }
-
- if (enlist)
- {
- // Reply with the client name in an Enlist message.
- Message enlistMessage = session.createMessage();
- enlistMessage.setStringProperty("CONTROL_TYPE", "ENLIST");
- enlistMessage.setStringProperty("CLIENT_NAME", clientName);
- enlistMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
- enlistMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending enlist message '" + enlistMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), enlistMessage);
- }
- else
- {
- // Reply with the client name in an Decline message.
- Message enlistMessage = session.createMessage();
- enlistMessage.setStringProperty("CONTROL_TYPE", "DECLINE");
- enlistMessage.setStringProperty("CLIENT_NAME", clientName);
- enlistMessage.setStringProperty("CLIENT_PRIVATE_CONTROL_KEY", "iop.control." + clientName);
- enlistMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending decline message '" + enlistMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), enlistMessage);
- }
- }
- else if ("ASSIGN_ROLE".equals(controlType))
- {
- // Assign the role to the current test case.
- String roleName = message.getStringProperty("ROLE");
-
- log.debug("Got a role assignment to role: " + roleName);
-
- TestClientControlledTest.Roles role = Enum.valueOf(TestClientControlledTest.Roles.class, roleName);
-
- currentTestCase.assignRole(role, message);
-
- // Reply by accepting the role in an Accept Role message.
- Message acceptRoleMessage = session.createMessage();
- acceptRoleMessage.setStringProperty("CLIENT_NAME", clientName);
- acceptRoleMessage.setStringProperty("CONTROL_TYPE", "ACCEPT_ROLE");
- acceptRoleMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending accept role message '" + acceptRoleMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), acceptRoleMessage);
- }
- else if ("START".equals(controlType) || "STATUS_REQUEST".equals(controlType))
- {
- if ("START".equals(controlType))
- {
- log.debug("Got a start notification.");
-
- // Extract the number of test messages to send from the start notification.
- int numMessages;
-
- try
- {
- numMessages = message.getIntProperty("MESSAGE_COUNT");
- }
- catch (NumberFormatException e)
- {
- // If the number of messages is not specified, use the default of one.
- numMessages = 1;
- }
-
- // Start the current test case.
- currentTestCase.start(numMessages);
- }
- else
- {
- log.debug("Got a status request.");
- }
-
- // Generate the report from the test case and reply with it as a Report message.
- Message reportMessage = currentTestCase.getReport(session);
- reportMessage.setStringProperty("CLIENT_NAME", clientName);
- reportMessage.setStringProperty("CONTROL_TYPE", "REPORT");
- reportMessage.setJMSCorrelationID(message.getJMSCorrelationID());
-
- log.debug("Sending report message '" + reportMessage + "' to " + message.getJMSReplyTo());
-
- producer.send(message.getJMSReplyTo(), reportMessage);
- }
- else if ("TERMINATE".equals(controlType))
- {
- console.info("Received termination instruction from coordinator.");
-
- // Is a cleaner shutdown needed?
- connection.close();
- System.exit(0);
- }
- else if ("CLOCK_SYNCH".equals(controlType))
- {
- log.debug("Received clock synch command.");
- String address = message.getStringProperty("ADDRESS");
-
- log.debug("address = " + address);
-
- // Re-create (if necessary) and start the clock synch thread to synch the clock every ten seconds.
- if (clockSynchThread != null)
- {
- clockSynchThread.terminate();
- }
-
- SleepThrottle throttle = new SleepThrottle();
- throttle.setRate(0.1f);
-
- clockSynchThread = new ClockSynchThread(new UDPClockSynchronizer(address), throttle);
- clockSynchThread.start();
- }
- else
- {
- // Log a warning about this but otherwise ignore it.
- log.warn("Got an unknown control message, controlType = " + controlType + ", message = " + message);
- }
- }
- catch (JMSException e)
- {
- // Log a warning about this, but otherwise ignore it.
- log.warn("Got JMSException whilst handling message: " + message, e);
- }
- // Log any runtimes that fall through this message handler. These are fatal errors for the test client.
- catch (RuntimeException e)
- {
- log.error("The test client message handler got an unhandled exception: ", e);
- console.info("The message handler got an unhandled exception, terminating the test client.");
- System.exit(1);
- }
- finally
- {
- NDC.pop();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClientControlledTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClientControlledTest.java
deleted file mode 100644
index 30fd382333..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClientControlledTest.java
+++ /dev/null
@@ -1,108 +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.
- *
- */
-package org.apache.qpid.test.framework.distributedtesting;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-
-/**
- * TestClientControlledTest provides an interface that classes implementing test cases to run on a {@link TestClient}
- * node can use. Implementations must be Java beans, that is, to provide a default constructor and to implement the
- * {@link #getName} method.
- *
- * <p/>The methods specified in this interface are called when the {@link TestClient} receives control instructions to
- * apply to the test. There are control instructions to present the test case with the test invite, so that it may
- * choose whether or not to participate in the test, assign the test to play the sender or receiver role, start the
- * test and obtain the test status report.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Supply the name of the test case that this implements.
- * <tr><td> Accept/Reject invites based on test parameters.
- * <tr><td> Adapt to assigned roles.
- * <tr><td> Perform test case actions.
- * <tr><td> Generate test reports.
- * </table>
- */
-public interface TestClientControlledTest
-{
- /** Defines the possible test case roles that an interop test case can take on. */
- public enum Roles
- {
- /** Specifies the sender role. */
- SENDER,
-
- /** Specifies the receivers role. */
- RECEIVER
- }
-
- /**
- * Should provide the name of the test case that this class implements. The exact names are defined in the
- * interop testing spec.
- *
- * @return The name of the test case that this implements.
- */
- public String getName();
-
- /**
- * Determines whether the test invite that matched this test case is acceptable.
- *
- * @param inviteMessage The invitation to accept or reject.
- *
- * @return <tt>true</tt> to accept the invitation, <tt>false</tt> to reject it.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public boolean acceptInvite(Message inviteMessage) throws JMSException;
-
- /**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the
- * assignment message. When this method return the test case will be ready to execute.
- *
- * @param role The role to be played; sender or receivers.
- * @param assignRoleMessage The role assingment message, contains the full test parameters.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void assignRole(Roles role, Message assignRoleMessage) throws JMSException;
-
- /**
- * Performs the test case actions. Returning from here, indicates that the sending role has completed its test.
- *
- * @param numMessages The number of test messages to send.
- *
- * @throws JMSException Any JMSException resulting from reading the message are allowed to fall through.
- */
- public void start(int numMessages) throws JMSException;
-
- /**
- * Gets a report on the actions performed by the test case in its assigned role.
- *
- * @param session The controlSession to create the report message in.
- *
- * @return The report message.
- *
- * @throws JMSException Any JMSExceptions resulting from creating the report are allowed to fall through.
- */
- public Message getReport(Session session) throws JMSException;
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/listeners/XMLTestListener.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/listeners/XMLTestListener.java
deleted file mode 100644
index 8a82b12832..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/listeners/XMLTestListener.java
+++ /dev/null
@@ -1,399 +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.
- *
- */
-package org.apache.qpid.test.framework.listeners;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.junit.extensions.ShutdownHookable;
-import org.apache.qpid.junit.extensions.listeners.TKTestListener;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.Writer;
-import java.util.*;
-
-/**
- * Listens for test results for a named test and outputs these in the standard JUnit XML format to the specified
- * writer.
- *
- * <p/>The API for this listener accepts notifications about different aspects of a tests results through different
- * methods, so some assumption needs to be made as to which test result a notification refers to. For example
- * {@link #startTest} will be called, then possibly {@link #timing} will be called, even though the test instance is
- * passed in both cases, it is not enough to distinguish a particular run of the test, as the test case instance may
- * be being shared between multiple threads, or being run a repeated number of times, and can therfore be re-used
- * between calls. The listeners make the assumption that, for every test, a unique thread will call {@link #startTest}
- * and {@link #endTest} to delimit each test. All calls to set test parameters, timings, state and so on, will occur
- * between the start and end and will be given with the same thread id as the start and end, so the thread id provides
- * a unqiue value to identify a particular test run against.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Listen to test lifecycle notifications.
- * <tr><td> Listen to test errors and failures.
- * <tr><td> Listen to test timings.
- * <tr><td> Listen to test memory usages.
- * <tr><td> Listen to parameterized test parameters.
- * <tr><th> Responsibilities
- * </table>
- *
- * @todo Merge this class with CSV test listener, making the collection of results common to both, and only factoring
- * out the results printing code into sub-classes. Provide a simple XML results formatter with the same format as
- * the ant XML formatter, and a more structured one for outputing results with timings and summaries from
- * performance tests.
- */
-public class XMLTestListener implements TKTestListener, ShutdownHookable
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(XMLTestListener.class);
-
- /** The results file writer. */
- protected Writer writer;
-
- /** Holds the results for individual tests. */
- // protected Map<Result, Result> results = new LinkedHashMap<Result, Result>();
- // protected List<Result> results = new ArrayList<Result>();
-
- /**
- * Map for holding results on a per thread basis as they come in. A ThreadLocal is not used as sometimes an
- * explicit thread id must be used, where notifications come from different threads than the ones that called
- * the test method.
- */
- Map<Long, Result> threadLocalResults = Collections.synchronizedMap(new LinkedHashMap<Long, Result>());
-
- /**
- * Holds results for tests that have ended. Transferring these results here from the per-thread results map, means
- * that the thread id is freed for the thread to generate more results.
- */
- List<Result> results = new ArrayList<Result>();
-
- /** Holds the overall error count. */
- protected int errors = 0;
-
- /** Holds the overall failure count. */
- protected int failures = 0;
-
- /** Holds the overall tests run count. */
- protected int runs = 0;
-
- /** Holds the name of the class that tests are being run for. */
- String testClassName;
-
- /**
- * Creates a new XML results output listener that writes to the specified location.
- *
- * @param writer The location to write results to.
- * @param testClassName The name of the test class to include in the test results.
- */
- public XMLTestListener(Writer writer, String testClassName)
- {
- log.debug("public XMLTestListener(Writer writer, String testClassName = " + testClassName + "): called");
-
- this.writer = writer;
- this.testClassName = testClassName;
- }
-
- /**
- * Resets the test results to the default state of time zero, memory usage zero, parameter zero, test passed.
- *
- * @param test The test to resest any results for.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void reset(Test test, Long threadId)
- {
- log.debug("public void reset(Test test = " + test + ", Long threadId = " + threadId + "): called");
-
- XMLTestListener.Result r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
-
- r.error = null;
- r.failure = null;
-
- }
-
- /**
- * Notification that a test started.
- *
- * @param test The test that started.
- */
- public void startTest(Test test)
- {
- log.debug("public void startTest(Test test = " + test + "): called");
-
- Result newResult = new Result(test.getClass().getName(), ((TestCase) test).getName());
-
- // Initialize the thread local test results.
- threadLocalResults.put(Thread.currentThread().getId(), newResult);
- runs++;
- }
-
- /**
- * Should be called every time a test completes with the run time of that test.
- *
- * @param test The name of the test.
- * @param nanos The run time of the test in nanoseconds.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void timing(Test test, long nanos, Long threadId)
- { }
-
- /**
- * Should be called every time a test completed with the amount of memory used before and after the test was run.
- *
- * @param test The test which memory was measured for.
- * @param memStart The total JVM memory used before the test was run.
- * @param memEnd The total JVM memory used after the test was run.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void memoryUsed(Test test, long memStart, long memEnd, Long threadId)
- { }
-
- /**
- * Should be called every time a parameterized test completed with the int value of its test parameter.
- *
- * @param test The test which memory was measured for.
- * @param parameter The int parameter value.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void parameterValue(Test test, int parameter, Long threadId)
- { }
-
- /**
- * Should be called every time a test completes with the current number of test threads running.
- *
- * @param test The test for which the measurement is being generated.
- * @param threads The number of tests being run concurrently.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void concurrencyLevel(Test test, int threads, Long threadId)
- { }
-
- /**
- * Notifies listeners of the tests read/set properties.
- *
- * @param properties The tests read/set properties.
- */
- public void properties(Properties properties)
- { }
-
- /**
- * Notification that a test ended.
- *
- * @param test The test that ended.
- */
- public void endTest(Test test)
- {
- log.debug("public void endTest(Test test = " + test + "): called");
-
- // Move complete test results into the completed tests list.
- Result r = threadLocalResults.get(Thread.currentThread().getId());
- results.add(r);
-
- // Clear all the test results for the thread.
- threadLocalResults.remove(Thread.currentThread().getId());
- }
-
- /**
- * Called when a test completes. Success, failure and errors. This method should be used when registering an
- * end test from a different thread than the one that started the test.
- *
- * @param test The test which completed.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void endTest(Test test, Long threadId)
- {
- log.debug("public void endTest(Test test = " + test + ", Long threadId = " + threadId + "): called");
-
- // Move complete test results into the completed tests list.
- Result r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
- results.add(r);
-
- // Clear all the test results for the thread.
- threadLocalResults.remove(Thread.currentThread().getId());
- }
-
- /**
- * An error occurred.
- *
- * @param test The test in which the error occurred.
- * @param t The throwable that resulted from the error.
- */
- public void addError(Test test, Throwable t)
- {
- log.debug("public void addError(Test test = " + test + ", Throwable t = " + t + "): called");
-
- Result r = threadLocalResults.get(Thread.currentThread().getId());
- r.error = t;
- errors++;
- }
-
- /**
- * A failure occurred.
- *
- * @param test The test in which the failure occurred.
- * @param t The JUnit assertions that led to the failure.
- */
- public void addFailure(Test test, AssertionFailedError t)
- {
- log.debug("public void addFailure(Test test = " + test + ", AssertionFailedError t = " + t + "): called");
-
- Result r = threadLocalResults.get(Thread.currentThread().getId());
- r.failure = t;
- failures++;
- }
-
- /**
- * Called when a test completes to mark it as a test fail. This method should be used when registering a
- * failure from a different thread than the one that started the test.
- *
- * @param test The test which failed.
- * @param e The assertion that failed the test.
- * @param threadId Optional thread id if not calling from thread that started the test method. May be null.
- */
- public void addFailure(Test test, AssertionFailedError e, Long threadId)
- {
- log.debug("public void addFailure(Test test, AssertionFailedError e, Long threadId): called");
-
- Result r =
- (threadId == null) ? threadLocalResults.get(Thread.currentThread().getId()) : threadLocalResults.get(threadId);
- r.failure = e;
- failures++;
- }
-
- /**
- * Notifies listeners of the start of a complete run of tests.
- */
- public void startBatch()
- {
- log.debug("public void startBatch(): called");
-
- // Reset all results counts.
- threadLocalResults = Collections.synchronizedMap(new HashMap<Long, Result>());
- errors = 0;
- failures = 0;
- runs = 0;
-
- // Write out the file header.
- try
- {
- writer.write("<?xml version=\"1.0\" ?>\n");
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to write the test results.", e);
- }
- }
-
- /**
- * Notifies listeners of the end of a complete run of tests.
- *
- * @param parameters The optional test parameters to log out with the batch results.
- */
- public void endBatch(Properties parameters)
- {
- log.debug("public void endBatch(Properties parameters = " + parameters + "): called");
-
- // Write out the results.
- try
- {
- // writer.write("<?xml version=\"1.0\" ?>\n");
- writer.write("<testsuite errors=\"" + errors + "\" failures=\"" + failures + "\" tests=\"" + runs + "\" name=\""
- + testClassName + "\">\n");
-
- for (Result result : results)
- {
- writer.write(" <testcase classname=\"" + result.testClass + "\" name=\"" + result.testName + "\">\n");
-
- if (result.error != null)
- {
- writer.write(" <error type=\"" + result.error.getClass() + "\">");
- result.error.printStackTrace(new PrintWriter(writer));
- writer.write(" </error>");
- }
- else if (result.failure != null)
- {
- writer.write(" <failure type=\"" + result.failure.getClass() + "\">");
- result.failure.printStackTrace(new PrintWriter(writer));
- writer.write(" </failure>");
- }
-
- writer.write(" </testcase>\n");
- }
-
- writer.write("</testsuite>\n");
- writer.flush();
- }
- catch (IOException e)
- {
- throw new RuntimeException("Unable to write the test results.", e);
- }
- }
-
- /**
- * Supplies the shutdown hook.
- *
- * @return The shut down hook.
- */
- public Thread getShutdownHook()
- {
- return new Thread(new Runnable()
- {
- public void run()
- {
- log.debug("XMLTestListener::ShutdownHook: called");
- }
- });
- }
-
- /**
- * Used to capture the results of a particular test run.
- */
- protected static class Result
- {
- /** Holds the name of the test class. */
- public String testClass;
-
- /** Holds the name of the test method. */
- public String testName;
-
- /** Holds the exception that caused error in this test. */
- public Throwable error;
-
- /** Holds the assertion exception that caused failure in this test. */
- public AssertionFailedError failure;
-
- /**
- * Creates a placeholder for the results of a test.
- *
- * @param testClass The test class.
- * @param testName The name of the test that was run.
- */
- public Result(String testClass, String testName)
- {
- this.testClass = testClass;
- this.testName = testName;
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalAMQPPublisherImpl.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalAMQPPublisherImpl.java
deleted file mode 100644
index 4388c7fbd8..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalAMQPPublisherImpl.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework.localcircuit;
-
-import org.apache.qpid.client.AMQNoConsumersException;
-import org.apache.qpid.client.AMQNoRouteException;
-import org.apache.qpid.test.framework.*;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-/**
- * LocalAMQPPublisherImpl is an extension of {@link LocalPublisherImpl} that adds AMQP specific features. Specifically
- * extra assertions for AMQP features not available through generic JMS.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </table>
- */
-public class LocalAMQPPublisherImpl extends LocalPublisherImpl implements AMQPPublisher
-{
- /**
- * Creates a circuit end point on the specified producer, consumer and controlSession. Monitors are also configured
- * for messages and exceptions received by the circuit end.
- *
- * @param producer The message producer for the circuit end point.
- * @param consumer The message consumer for the circuit end point.
- * @param session The controlSession for the circuit end point.
- * @param messageMonitor The monitor to notify of all messages received by the circuit end.
- * @param exceptionMonitor The monitor to notify of all exceptions received by the circuit end.
- */
- public LocalAMQPPublisherImpl(MessageProducer producer, MessageConsumer consumer, Session session,
- MessageMonitor messageMonitor, ExceptionMonitor exceptionMonitor)
- {
- super(producer, consumer, session, messageMonitor, exceptionMonitor);
- }
-
- /**
- * Creates a circuit end point from the producer, consumer and controlSession in a circuit end base implementation.
- *
- * @param end The circuit end base implementation to take producers and consumers from.
- */
- public LocalAMQPPublisherImpl(CircuitEndBase end)
- {
- super(end);
- }
-
- /**
- * Provides an assertion that the publisher got a no consumers exception on every message.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the publisher got a no consumers exception on every message.
- */
- public Assertion noConsumersAssertion(ParsedProperties testProps)
- {
- return new AssertionBase()
- {
- public boolean apply()
- {
- boolean passed = true;
- ExceptionMonitor connectionExceptionMonitor = circuit.getConnectionExceptionMonitor();
-
- if (!connectionExceptionMonitor.assertOneJMSExceptionWithLinkedCause(AMQNoConsumersException.class))
- {
- passed = false;
-
- addError("Was expecting linked exception type " + AMQNoConsumersException.class.getName()
- + " on the connection.\n");
- addError((connectionExceptionMonitor.size() > 0)
- ? ("Actually got the following exceptions on the connection, " + connectionExceptionMonitor)
- : "Got no exceptions on the connection.");
- }
-
- return passed;
- }
- };
- }
-
- /**
- * Provides an assertion that the publisher got a no rout exception on every message.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the publisher got a no rout exception on every message.
- */
- public Assertion noRouteAssertion(ParsedProperties testProps)
- {
- return new AssertionBase()
- {
- public boolean apply()
- {
- boolean passed = true;
- ExceptionMonitor connectionExceptionMonitor = circuit.getConnectionExceptionMonitor();
-
- if (!connectionExceptionMonitor.assertOneJMSExceptionWithLinkedCause(AMQNoRouteException.class))
- {
- passed = false;
-
- addError("Was expecting linked exception type " + AMQNoRouteException.class.getName()
- + " on the connection.\n");
- addError((connectionExceptionMonitor.size() > 0)
- ? ("Actually got the following exceptions on the connection, " + connectionExceptionMonitor)
- : "Got no exceptions on the connection.");
- }
-
- return passed;
- }
- };
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalCircuitImpl.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalCircuitImpl.java
deleted file mode 100644
index 391091266c..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalCircuitImpl.java
+++ /dev/null
@@ -1,306 +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.
- *
- */
-package org.apache.qpid.test.framework.localcircuit;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.*;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.*;
-
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * LocalCircuitImpl provides an implementation of the test circuit. This is a local only circuit implementation that
- * supports a single producer/consumer on each end of the circuit, with both ends of the circuit on the same JVM.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Supply the publishing and receiving ends of a test messaging circuit.
- * <td> {@link LocalPublisherImpl}, {@link LocalReceiverImpl}
- * <tr><td> Start the circuit running.
- * <tr><td> Close the circuit down.
- * <tr><td> Take a reading of the circuits state.
- * <tr><td> Apply assertions against the circuits state. <td> {@link Assertion}
- * <tr><td> Send test messages over the circuit.
- * <tr><td> Perform the default test procedure on the circuit.
- * <tr><td> Provide access to connection and controlSession exception monitors. <td> {@link ExceptionMonitor}
- * </table>
- */
-public class LocalCircuitImpl implements Circuit
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(LocalCircuitImpl.class);
-
- /** Holds the test configuration for the circuit. */
- private ParsedProperties testProps;
-
- /** Holds the publishing end of the circuit. */
- private LocalPublisherImpl publisher;
-
- /** Holds the receiving end of the circuit. */
- private LocalReceiverImpl receiver;
-
- /** Holds the connection for the publishing end of the circuit. */
- private Connection connection;
-
- /** Holds the exception listener for the connection on the publishing end of the circuit. */
- private ExceptionMonitor connectionExceptionMonitor;
-
- /** Holds the exception listener for the controlSession on the publishing end of the circuit. */
- private ExceptionMonitor exceptionMonitor;
-
- /**
- * Creates a test circuit using the specified test parameters. The publisher, receivers, connection and
- * connection monitor must already have been created, to assemble the circuit.
- *
- * @param testProps The test parameters.
- * @param publisher The test publisher.
- * @param receiver The test receivers.
- * @param connection The connection.
- * @param connectionExceptionMonitor The connection exception monitor.
- */
- public LocalCircuitImpl(ParsedProperties testProps, LocalPublisherImpl publisher, LocalReceiverImpl receiver,
- Connection connection, ExceptionMonitor connectionExceptionMonitor)
- {
- this.testProps = testProps;
- this.publisher = publisher;
- this.receiver = receiver;
- this.connection = connection;
- this.connectionExceptionMonitor = connectionExceptionMonitor;
- this.exceptionMonitor = new ExceptionMonitor();
-
- // Set this as the parent circuit on the publisher and receivers.
- publisher.setCircuit(this);
- receiver.setCircuit(this);
- }
-
- /**
- * Gets the interface on the publishing end of the circuit.
- *
- * @return The publishing end of the circuit.
- */
- public Publisher getPublisher()
- {
- return publisher;
- }
-
- /**
- * Gets the local publishing circuit end, for direct manipulation.
- *
- * @return The local publishing circuit end.
- */
- public CircuitEnd getLocalPublisherCircuitEnd()
- {
- return publisher;
- }
-
- /**
- * Gets the interface on the receiving end of the circuit.
- *
- * @return The receiving end of the circuit.
- */
- public Receiver getReceiver()
- {
- return receiver;
- }
-
- /**
- * Gets the local receiving circuit end, for direct manipulation.
- *
- * @return The local receiving circuit end.
- */
- public CircuitEnd getLocalReceiverCircuitEnd()
- {
- return receiver;
- }
-
- /**
- * Checks the test circuit. The effect of this is to gather the circuits state, for both ends of the circuit,
- * into a report, against which assertions may be checked.
- */
- public void check()
- { }
-
- /**
- * Applied a list of assertions against the test circuit. The {@link #check()} method should be called before doing
- * this, to ensure that the circuit has gathered its state into a report to assert against.
- *
- * @param assertions The list of assertions to apply.
- * @return Any assertions that failed.
- */
- public List<Assertion> applyAssertions(List<Assertion> assertions)
- {
- List<Assertion> failures = new LinkedList<Assertion>();
-
- for (Assertion assertion : assertions)
- {
- if (!assertion.apply())
- {
- failures.add(assertion);
- }
- }
-
- return failures;
- }
-
- /**
- * Connects and starts the circuit. After this method is called the circuit is ready to send messages.
- */
- public void start()
- { }
-
- /**
- * Closes the circuit. All associated resources are closed.
- */
- public void close()
- {
- try
- {
- publisher.close();
- receiver.close();
- connection.close();
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Got JMSException during close:" + e.getMessage(), e);
- }
- }
-
- /**
- * Sends a message on the test circuit. The exact nature of the message sent is controlled by the test parameters.
- */
- protected void send()
- {
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- boolean transactional = props.getPublisherTransacted();
- boolean rollback = props.getRollbackPublisher();
-
- // Send a message through the publisher and log any exceptions raised.
- try
- {
- CircuitEnd end = getLocalPublisherCircuitEnd();
-
- end.send(createTestMessage(end));
-
- if (rollback)
- {
- end.getSession().rollback();
- }
- else if (transactional)
- {
- end.getSession().commit();
- }
- }
- catch (JMSException e)
- {
- exceptionMonitor.onException(e);
- }
- }
-
- /**
- * Runs the default test procedure against the circuit, and checks that all of the specified assertions hold. The
- * outline of the default test procedure is:
- *
- * <p/><pre>
- * Start the circuit.
- * Send test messages.
- * Request a status report.
- * Assert conditions on the publishing end of the circuit.
- * Assert conditions on the receiving end of the circuit.
- * Close the circuit.
- * Pass with no failed assertions or fail with a list of failed assertions.
- * </pre>
- *
- * @param numMessages The number of messages to send using the default test procedure.
- * @param assertions The list of assertions to apply.
- * @return Any assertions that failed.
- */
- public List<Assertion> test(int numMessages, List<Assertion> assertions)
- {
- // Start the test circuit.
- start();
-
- // Send the requested number of test messages.
- for (int i = 0; i < numMessages; i++)
- {
- send();
- }
-
- // Inject a short pause to allow time for exceptions to come back asynchronously.
- TestUtils.pause(500L);
-
- // Request a status report.
- check();
-
- // Clean up the publisher/receivers/controlSession/connections.
- close();
-
- // Apply all of the requested assertions, keeping record of any that fail.
- List<Assertion> failures = applyAssertions(assertions);
-
- // Return any failed assertions to the caller.
- return failures;
- }
-
- /**
- * Creates a message with the properties defined as per the test parameters.
- *
- * @param client The circuit end to create the message on.
- *
- * @return The test message.
- *
- * @throws JMSException Any JMSException occurring during creation of the message is allowed to fall through.
- */
- private Message createTestMessage(CircuitEnd client) throws JMSException
- {
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- return TestUtils.createTestMessageOfSize(client.getSession(), props.getMessageSize());
- }
-
- /**
- * Gets the exception monitor for the publishing ends connection.
- *
- * @return The exception monitor for the publishing ends connection.
- */
- public ExceptionMonitor getConnectionExceptionMonitor()
- {
- return connectionExceptionMonitor;
- }
-
- /**
- * Gets the exception monitor for the publishing ends controlSession.
- *
- * @return The exception monitor for the publishing ends controlSession.
- */
- public ExceptionMonitor getExceptionMonitor()
- {
- return exceptionMonitor;
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalPublisherImpl.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalPublisherImpl.java
deleted file mode 100644
index 3ec3f62538..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalPublisherImpl.java
+++ /dev/null
@@ -1,170 +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.
- *
- */
-package org.apache.qpid.test.framework.localcircuit;
-
-import org.apache.qpid.test.framework.*;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-/**
- * Provides an implementation of the {@link Publisher} interface and wraps a single message producer and consumer on
- * a single controlSession, as a {@link CircuitEnd}. A local publisher also acts as a circuit end, because for a locally
- * located circuit the assertions may be applied directly, there does not need to be any inter-process messaging
- * between the publisher and its single circuit end, in order to ascertain its status.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide a message producer for sending messages.
- * <tr><td> Provide a message consumer for receiving messages.
- * <tr><td> Provide assertion that the publisher received no exceptions.
- * <tr><td> Provide assertion that the publisher received a no consumers error code.
- * <tr><td> Provide assertion that the publisher received a no route error code.
- * </table>
- */
-public class LocalPublisherImpl extends CircuitEndBase implements Publisher
-{
- /** Holds a reference to the containing circuit. */
- protected LocalCircuitImpl circuit;
-
- /**
- * Creates a circuit end point on the specified producer, consumer and controlSession. Monitors are also configured
- * for messages and exceptions received by the circuit end.
- *
- * @param producer The message producer for the circuit end point.
- * @param consumer The message consumer for the circuit end point.
- * @param session The controlSession for the circuit end point.
- * @param messageMonitor The monitor to notify of all messages received by the circuit end.
- * @param exceptionMonitor The monitor to notify of all exceptions received by the circuit end.
- */
- public LocalPublisherImpl(MessageProducer producer, MessageConsumer consumer, Session session,
- MessageMonitor messageMonitor, ExceptionMonitor exceptionMonitor)
- {
- super(producer, consumer, session, messageMonitor, exceptionMonitor);
- }
-
- /**
- * Creates a circuit end point from the producer, consumer and controlSession in a circuit end base implementation.
- *
- * @param end The circuit end base implementation to take producers and consumers from.
- */
- public LocalPublisherImpl(CircuitEndBase end)
- {
- super(end.getProducer(), end.getConsumer(), end.getSession(), end.getMessageMonitor(), end.getExceptionMonitor());
- }
-
- /**
- * Provides an assertion that the publisher encountered no exceptions.
- *
- * @param testProps
- *
- * @return An assertion that the publisher encountered no exceptions.
- */
- public Assertion noExceptionsAssertion(ParsedProperties testProps)
- {
- return new AssertionBase()
- {
- public boolean apply()
- {
- boolean passed = true;
- ExceptionMonitor sessionExceptionMonitor = circuit.getExceptionMonitor();
- ExceptionMonitor connectionExceptionMonitor = circuit.getConnectionExceptionMonitor();
-
- if (!connectionExceptionMonitor.assertNoExceptions())
- {
- passed = false;
-
- addError("Was expecting no exceptions.\n");
- addError("Got the following exceptions on the connection, "
- + circuit.getConnectionExceptionMonitor());
- }
-
- if (!sessionExceptionMonitor.assertNoExceptions())
- {
- passed = false;
-
- addError("Was expecting no exceptions.\n");
- addError("Got the following exceptions on the producer, " + circuit.getExceptionMonitor());
- }
-
- return passed;
- }
- };
- }
-
- /**
- * Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the AMQP channel was forcibly closed by an error condition.
- */
- public Assertion channelClosedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /**
- * Provides an assertion that the publisher got a given exception during the test.
- *
- * @param testProps The test configuration properties.
- * @param exceptionClass The exception class to check for.
- *
- * @return An assertion that the publisher got a given exception during the test.
- */
- public Assertion exceptionAssertion(ParsedProperties testProps, final Class<? extends Exception> exceptionClass)
- {
- return new AssertionBase()
- {
- public boolean apply()
- {
- boolean passed = true;
- ExceptionMonitor connectionExceptionMonitor = circuit.getConnectionExceptionMonitor();
-
- if (!connectionExceptionMonitor.assertExceptionOfType(exceptionClass))
- {
- passed = false;
-
- addError("Was expecting linked exception type " + exceptionClass.getName()
- + " on the connection.\n");
- addError((connectionExceptionMonitor.size() > 0)
- ? ("Actually got the following exceptions on the connection, " + connectionExceptionMonitor)
- : "Got no exceptions on the connection.");
- }
-
- return passed;
- }
- };
- }
-
- /**
- * Sets the contianing circuit.
- *
- * @param circuit The containing circuit.
- */
- public void setCircuit(LocalCircuitImpl circuit)
- {
- this.circuit = circuit;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalReceiverImpl.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalReceiverImpl.java
deleted file mode 100644
index 74f414c974..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalReceiverImpl.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework.localcircuit;
-
-import org.apache.qpid.test.framework.*;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-/**
- * Provides an implementation of the {@link Receiver} interface that wraps a single message producer and consumer on
- * a single controlSession, as a {@link CircuitEnd}. A local receiver also acts as a circuit end, because for a locally
- * located circuit the assertions may be applied directly, there does not need to be any inter process messaging
- * between the publisher and its single circuit end, in order to ascertain its status.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Provide a message producer for sending messages.
- * <tr><td> Provide a message consumer for receiving messages.
- * <tr><td> Provide assertion that the receivers received no exceptions.
- * <tr><td> Provide assertion that the receivers received all test messages sent to it.
- * </table>
- */
-public class LocalReceiverImpl extends CircuitEndBase implements Receiver
-{
- /** Holds a reference to the containing circuit. */
- private LocalCircuitImpl circuit;
-
- /**
- * Creates a circuit end point on the specified producer, consumer and controlSession. Monitors are also configured
- * for messages and exceptions received by the circuit end.
- *
- * @param producer The message producer for the circuit end point.
- * @param consumer The message consumer for the circuit end point.
- * @param session The controlSession for the circuit end point.
- * @param messageMonitor The monitor to notify of all messages received by the circuit end.
- * @param exceptionMonitor The monitor to notify of all exceptions received by the circuit end.
- */
- public LocalReceiverImpl(MessageProducer producer, MessageConsumer consumer, Session session,
- MessageMonitor messageMonitor, ExceptionMonitor exceptionMonitor)
- {
- super(producer, consumer, session, messageMonitor, exceptionMonitor);
- }
-
- /**
- * Creates a circuit end point from the producer, consumer and controlSession in a circuit end base implementation.
- *
- * @param end The circuit end base implementation to take producers and consumers from.
- */
- public LocalReceiverImpl(CircuitEndBase end)
- {
- super(end.getProducer(), end.getConsumer(), end.getSession(), end.getMessageMonitor(), end.getExceptionMonitor());
- }
-
- /**
- * Provides an assertion that the receivers encountered no exceptions.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the receivers encountered no exceptions.
- */
- public Assertion noExceptionsAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /**
- * Provides an assertion that the AMQP channel was forcibly closed by an error condition.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the AMQP channel was forcibly closed by an error condition.
- */
- public Assertion channelClosedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /**
- * Provides an assertion that the receivers got all messages that were sent to it.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the receivers got all messages that were sent to it.
- */
- public Assertion allMessagesReceivedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /**
- * Provides an assertion that the receivers got none of the messages that were sent to it.
- *
- * @param testProps The test configuration properties.
- *
- * @return An assertion that the receivers got none of the messages that were sent to it.
- */
- public Assertion noMessagesReceivedAssertion(ParsedProperties testProps)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /**
- * Provides an assertion that the receiver got a given exception during the test.
- *
- * @param testProps The test configuration properties.
- * @param exceptionClass The exception class to check for. @return An assertion that the receiver got a given exception during the test.
- */
- public Assertion exceptionAssertion(ParsedProperties testProps, Class<? extends Exception> exceptionClass)
- {
- return new NotApplicableAssertion(testProps);
- }
-
- /**
- * Sets the contianing circuit.
- *
- * @param circuit The containing circuit.
- */
- public void setCircuit(LocalCircuitImpl circuit)
- {
- this.circuit = circuit;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/package.html b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/package.html
deleted file mode 100644
index ac4e30d312..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/package.html
+++ /dev/null
@@ -1,43 +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.
-
--->
-
-<html>
-<body>
-<p/>A framework for testing Qpid, built around a standard 'test circuit' design. The idea behind this framework is the
-use of a test circuit which is configured by a set of test parameters, that may be projected onto a topology of
-test nodes, with tests scripted to run over test circuits, making as few assumptions as possible about the underlying
-topology. The standardization of the design, whilst limiting in some respectes, allows a large variety of test
-scenarios to be written with minimal amounts of coding.
-
-<p/>The standard consruction block for a test, is a test circuit. This consists of a publisher, and a receiver. The
-publisher and receiver may reside on the same machine, or may be distributed. Will use a standard set of properties to
-define the desired circuit topology.
-
-<p/>Tests are always to be controlled from the publishing side only. The receiving end of the circuit is to be exposed
-to the test code through an interface, that abstracts as much as possible the receiving end of the test. The interface
-exposes a set of 'assertions' that may be applied to the receiving end of the test circuit.
-
-<p/>In the case where the receiving end of the circuit resides on the same JVM, the assertions will call the receivers
-code locally. Where the receiving end is distributed accross one or more machines, the assertions will be applied to a
-test report gethered from all of the receivers. Test code will be written to the assertions making as few assumptions
-as possible about the exact test topology.
-</body>
-</html>
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/AMQPFeatureDecorator.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/AMQPFeatureDecorator.java
deleted file mode 100644
index c11f75e742..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/AMQPFeatureDecorator.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework.qpid;
-
-import junit.framework.Test;
-import junit.framework.TestResult;
-
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import org.apache.qpid.test.framework.LocalAMQPCircuitFactory;
-
-import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;
-
-/**
- * AMQPFeatureDecorator applies decorations to {@link FrameworkBaseCase} tests, so that they may use Qpid/AMQP specific
- * features, not available through JMS. For example, the immediate and mandatory flags. This decorator replaces the
- * standard test circuit factory on the base class with one that allows these features to be used.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Substitute the circuit factory with an AMQP/Qpid specific one.
- * </table>
- *
- * @todo This wrapper substitutes in a LocalAMQPCircuitFactory, which is fine for local tests. For distributed tests
- * the Fanout or Interop factories are substituted in by their decorators instead. These actually use
- * distributed circuit static create methods to build the circuits, which should actually be changed to a factory,
- * so that static methods do not need to be used. The distributed circuit creater delegates the circuit
- * construction to remote test nodes. This decorator should not be used with distributed tests, or should be made
- * aware of them, in which case it might ensure that an AMQP feature (implied already by other properties) flag
- * is passed out to the remote test nodes, and provide a mechansim for them to decorate their circuit creation
- * with AMQP features too. Add factory substituion/decoration mechansim for test clients, here or in a seperate
- * class.
- */
-public class AMQPFeatureDecorator extends WrappedSuiteTestDecorator
-{
- /** The test suite to run. */
- private Test test;
-
- /**
- * Creates a wrapped test test decorator from another one.
- *
- * @param test The test test.
- */
- public AMQPFeatureDecorator(WrappedSuiteTestDecorator test)
- {
- super(test);
- this.test = test;
- }
-
- /**
- * Runs the tests with a LocalAMQPCircuitFactory. Only tests that extend FrameworkBaseCase are decorated.
- *
- * @param testResult The the results object to monitor the test results with.
- */
- public void run(TestResult testResult)
- {
- for (Test test : getAllUnderlyingTests())
- {
- if (test instanceof FrameworkBaseCase)
- {
- FrameworkBaseCase frameworkTest = (FrameworkBaseCase) test;
- frameworkTest.setCircuitFactory(new LocalAMQPCircuitFactory());
- }
- }
-
- // Run the test.
- test.run(testResult);
- }
-
- /**
- * Prints the name of the test for debugging purposes.
- *
- * @return The name of the test.
- */
- public String toString()
- {
- return "AMQPFeatureDecorator: [test = \"" + test + "\"]";
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureDecorator.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureDecorator.java
deleted file mode 100644
index 2708253d86..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureDecorator.java
+++ /dev/null
@@ -1,95 +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.
- *
- */
-package org.apache.qpid.test.framework.qpid;
-
-import junit.framework.Test;
-import junit.framework.TestResult;
-
-import org.apache.qpid.test.framework.BrokerLifecycleAware;
-import org.apache.qpid.test.framework.CauseFailureUserPrompt;
-
-import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;
-
-/**
- * CauseFailureDecorator applies decorations to {@link BrokerLifecycleAware} tests, so that they may use different failure
- * mechanisms. It is capable of detecting when a test case uses in-vm brokers, and setting up an automatic failure
- * for those tests, so that the current live broker can be shut-down by test cases. For external brokers, automatic
- * failure could be implemented, for example by having a kill script. At the moment this sets up the failure to prompt
- * a user interactively to cause a failure, using {@link CauseFailureUserPrompt}.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Setup automatic failures for in-vm brokers. <td> {@link CauseFailureInVM}
- * <tr><td> Setup user generated failures for external brokers. <td> {@link CauseFailureUserPrompt}.
- * <tr><td>
- * </table>
- *
- * @todo Slight problem in that CauseFailureInVM is Qpid specific, whereas CauseFailureUserPrompt is not. Would like the
- * failure decorator to be non-qpid specific so that it can test failure of any JMS implementation too. Either pass
- * in class name of failure mechanism, set it up in the in-vm decorator instead of here but with prompt user as the
- * default for when the in-vm decorator is not used?
- */
-public class CauseFailureDecorator extends WrappedSuiteTestDecorator
-{
- /** The test suite to run. */
- private Test test;
-
- /**
- * Creates a wrapped test test decorator from another one.
- *
- * @param test The test test.
- */
- public CauseFailureDecorator(WrappedSuiteTestDecorator test)
- {
- super(test);
- this.test = test;
- }
-
- /**
- * Runs the tests with a LocalAMQPCircuitFactory. Only tests that extend FrameworkBaseCase are decorated.
- *
- * @param testResult The the results object to monitor the test results with.
- */
- public void run(TestResult testResult)
- {
- for (Test test : getAllUnderlyingTests())
- {
- if (test instanceof BrokerLifecycleAware)
- {
- BrokerLifecycleAware failureTest = (BrokerLifecycleAware) test;
- failureTest.setFailureMechanism(new CauseFailureUserPrompt());
- }
- }
-
- // Run the test.
- test.run(testResult);
- }
-
- /**
- * Prints the name of the test for debugging purposes.
- *
- * @return The name of the test.
- */
- public String toString()
- {
- return "CauseFailureDecorator: [test = \"" + test + "\"]";
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java
deleted file mode 100644
index 3e03ad0872..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/CauseFailureInVM.java
+++ /dev/null
@@ -1,70 +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.
- *
- */
-package org.apache.qpid.test.framework.qpid;
-
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.test.framework.CauseFailure;
-import org.apache.qpid.test.framework.BrokerLifecycleAware;
-
-/**
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Cause messaging broker failure on the active in-vm broker.
- * <td> {@link TransportConnection}, {@link ApplicationRegistry}
- * </table>
- */
-public class CauseFailureInVM implements CauseFailure
-{
- /** Holds the in-vm broker instrumented test case to create failures for. */
- private BrokerLifecycleAware inVMTest;
-
- /**
- * Creates an automated failure mechanism for testing against in-vm brokers. The test to create the mechanism
- * for is specified, and as this failure is for in-vm brokers, the test must be {@link org.apache.qpid.test.framework.BrokerLifecycleAware}. The test
- * must also report that it is currently being run against an in-vm broker, and it is a runtime error if it is not,
- * as the creator of this failure mechanism should already have checked that it is.
- *
- * @param inVMTest The test case to create an automated failure mechanism for.
- */
- public CauseFailureInVM(BrokerLifecycleAware inVMTest)
- {
- // Check that the test is really using in-vm brokers.
- if (!inVMTest.usingInVmBroker())
- {
- throw new RuntimeException(
- "Cannot create in-vm broker failure mechanism for a test that is not using in-vm brokers.");
- }
-
- this.inVMTest = inVMTest;
- }
-
- /**
- * Causes the active message broker to fail.
- */
- public void causeFailure()
- {
- int liveBroker = inVMTest.getLiveBroker();
-
- TransportConnection.killVMBroker(liveBroker);
- ApplicationRegistry.remove(liveBroker);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java
deleted file mode 100644
index e0fddb10b7..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/qpid/InVMBrokerDecorator.java
+++ /dev/null
@@ -1,135 +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.
- *
- */
-package org.apache.qpid.test.framework.qpid;
-
-import junit.framework.Test;
-import junit.framework.TestResult;
-
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.test.framework.BrokerLifecycleAware;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-
-import org.apache.qpid.junit.extensions.SetupTaskAware;
-import org.apache.qpid.junit.extensions.WrappedSuiteTestDecorator;
-
-/**
- * InVMBrokerDecorator is a test decorator, that is activated when running tests against an in-vm broker only. Its
- * purpose is to automatically create, and close and delete an in-vm broker, during the set-up and tear-down of
- * each test case. This decorator may only be used in conjunction with tests that extend {@link FrameworkBaseCase}.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create/Destroy an in-vm broker on every test run.
- * </table>
- *
- * @todo May need to add a more fine grained injection point for the in-vm broker management, as this acts at the
- * suite level, rather than the individual test level.
- *
- * @todo Management of in-vm brokers for failure testing. Failure test setups may need to set their connection url to
- * use multiple broker (vm://:1;vm://:2), with fail-over between them. There is round-robin fail-over, but also
- * retry? A test case using an in-vm broker needs to record which one it is using, so that it can be
- * killed/restarted.
- */
-public class InVMBrokerDecorator extends WrappedSuiteTestDecorator
-{
- /** The test suite to run. */
- private Test test;
-
- /**
- * Creates a wrapped test suite decorator from another one.
- *
- * @param test The test suite.
- */
- public InVMBrokerDecorator(WrappedSuiteTestDecorator test)
- {
- super(test);
- this.test = test;
- }
-
- /**
- * Runs the tests with in-vm broker creation and clean-up added to the tests task stack.
- *
- * @param testResult The the results object to monitor the test results with.
- */
- public void run(TestResult testResult)
- {
- for (Test test : getAllUnderlyingTests())
- {
- // Check that the test to have an in-vm broker setup/teardown task added to it, is actually a framework
- // test that can handle setup tasks.
- if ((test instanceof SetupTaskAware))
- {
- SetupTaskAware frameworkTest = (SetupTaskAware) test;
-
- frameworkTest.chainSetupTask(new Runnable()
- {
- public void run()
- {
- // Ensure that the in-vm broker is created.
- try
- {
- TransportConnection.createVMBroker(1);
- }
- catch (AMQVMBrokerCreationException e)
- {
- throw new RuntimeException("In-VM broker creation failed: " + e.getMessage(), e);
- }
- }
- });
-
- frameworkTest.chainTearDownTask(new Runnable()
- {
- public void run()
- {
- // Ensure that the in-vm broker is cleaned up so that the next test starts afresh.
- TransportConnection.killVMBroker(1);
- ApplicationRegistry.remove(1);
- }
- });
-
- // Check if the test is aware whether or not it can control the broker life cycle, and if so provide
- // additional instrumentation for it to control the in-vm broker through.
- if (test instanceof BrokerLifecycleAware)
- {
- BrokerLifecycleAware inVMTest = (BrokerLifecycleAware) test;
- inVMTest.setInVmBrokers();
- inVMTest.setLiveBroker(1);
- inVMTest.setFailureMechanism(new CauseFailureInVM(inVMTest));
- }
- }
- }
-
- // Run the test.
- test.run(testResult);
- }
-
- /**
- * Prints the name of the test for debugging purposes.
- *
- * @return The name of the test.
- */
- public String toString()
- {
- return "InVMBrokerDecorator: [test = " + test + "]";
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java
deleted file mode 100644
index bd27fc3d90..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java
+++ /dev/null
@@ -1,136 +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.
- *
- */
-package org.apache.qpid.test.framework.sequencers;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.Circuit;
-import org.apache.qpid.test.framework.TestClientDetails;
-import org.apache.qpid.test.utils.ConversationFactory;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * BaseCircuitFactory provides some functionality common to all {@link CircuitFactory}s, such as the details of
- * all {@link org.apache.qpid.test.framework.distributedtesting.TestClient}s that make up the end-points of
- * the circuits that the factory creates, and an active {@link ConversationFactory} that can be used to generate
- * control conversations with those circuit end-points.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Hold the details of the sending and receiving end-points to create circuits from.
- * <tr><td> Provide a conversation factory to create control conversations with the end-points.
- * </table>
- */
-public abstract class BaseCircuitFactory implements CircuitFactory
-{
-
- /** Used for debugging. */
- private final Logger log = Logger.getLogger(BaseCircuitFactory.class);
-
- /** Holds the contact details for the sending test client. */
- protected TestClientDetails sender;
-
- /** Holds the contact details for the receving test client. */
- protected List<TestClientDetails> receivers = new LinkedList<TestClientDetails>();
-
- /** Holds the conversation factory over which to coordinate the test. */
- protected ConversationFactory conversationFactory;
-
- /**
- * Creates a test circuit for the test, configered by the test parameters specified.
- *
- * @param testProperties The test parameters.
- * @return A test circuit.
- */
- public Circuit createCircuit(Properties testProperties)
- {
- throw new RuntimeException("Not implemented.");
- }
-
- /**
- * Sets the sender test client to coordinate the test with.
- *
- * @param sender The contact details of the sending client in the test.
- */
- public void setSender(TestClientDetails sender)
- {
- log.debug("public void setSender(TestClientDetails sender = " + sender + "): called");
-
- this.sender = sender;
- }
-
- /**
- * Sets the receiving test client to coordinate the test with.
- *
- * @param receiver The contact details of the sending client in the test.
- */
- public void setReceiver(TestClientDetails receiver)
- {
- log.debug("public void setReceiver(TestClientDetails receivers = " + receiver + "): called");
-
- this.receivers.add(receiver);
- }
-
- /**
- * Supplies the sending test client.
- *
- * @return The sending test client.
- */
- public TestClientDetails getSender()
- {
- return sender;
- }
-
- /**
- * Supplies the receiving test client.
- *
- * @return The receiving test client.
- */
- public List<TestClientDetails> getReceivers()
- {
- return receivers;
- }
-
- /**
- * Accepts the conversation factory over which to hold the test coordinating conversation.
- *
- * @param conversationFactory The conversation factory to coordinate the test over.
- */
- public void setConversationFactory(ConversationFactory conversationFactory)
- {
- this.conversationFactory = conversationFactory;
- }
-
- /**
- * Provides the conversation factory for providing the distributed test sequencing conversations over the test
- * connection.
- *
- * @return The conversation factory to create test sequencing conversations with.
- */
- public ConversationFactory getConversationFactory()
- {
- return conversationFactory;
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java
deleted file mode 100644
index e69952918d..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework.sequencers;
-
-import org.apache.qpid.test.framework.Assertion;
-import org.apache.qpid.test.framework.Circuit;
-import org.apache.qpid.test.framework.TestClientDetails;
-import org.apache.qpid.test.utils.ConversationFactory;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.Connection;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * A CircuitFactory is responsibile for creating test circuits appropriate to the context that a test case is
- * running in, and providing an implementation of a standard test procedure over a test circuit.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities
- * <tr><td> Provide a standard test procedure over a test circuit.
- * <tr><td> Construct test circuits appropriate to a tests context.
- * </table>
- */
-public interface CircuitFactory
-{
- /**
- * Holds a test coordinating conversation with the test clients. This should consist of assigning the test roles,
- * begining the test, gathering the test reports from the participants, and checking for assertion failures against
- * the test reports.
- *
- * @param testCircuit The test circuit.
- * @param assertions The list of assertions to apply to the test circuit.
- * @param testProperties The test case definition.
- *
- * @deprecated Use test circuits and Circuit.test instead.
- */
- public void sequenceTest(Circuit testCircuit, List<Assertion> assertions, Properties testProperties);
-
- /**
- * Creates a test circuit for the test, configered by the test parameters specified.
- *
- * @param testProperties The test parameters.
- *
- * @return A test circuit.
- */
- public Circuit createCircuit(Connection connection, ParsedProperties testProperties);
-
- /**
- * Sets the sender test client to coordinate the test with.
- *
- * @param sender The contact details of the sending client in the test.
- */
- public void setSender(TestClientDetails sender);
-
- /**
- * Sets the receiving test client to coordinate the test with.
- *
- * @param receiver The contact details of the sending client in the test.
- */
- public void setReceiver(TestClientDetails receiver);
-
- /**
- * Supplies the sending test client.
- *
- * @return The sending test client.
- */
- public TestClientDetails getSender();
-
- /**
- * Supplies the receiving test client.
- *
- * @return The receiving test client.
- */
- public List<TestClientDetails> getReceivers();
-
- /**
- * Accepts the conversation factory over which to hold the test coordinating conversation.
- *
- * @param conversationFactory The conversation factory to coordinate the test over.
- */
- public void setConversationFactory(ConversationFactory conversationFactory);
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java
deleted file mode 100644
index 8a9c48d8e7..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework.sequencers;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.Assertion;
-import org.apache.qpid.test.framework.Circuit;
-import org.apache.qpid.test.framework.TestClientDetails;
-import org.apache.qpid.test.framework.TestUtils;
-import org.apache.qpid.test.framework.distributedcircuit.DistributedCircuitImpl;
-import org.apache.qpid.test.utils.ConversationFactory;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.*;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * FanOutCircuitFactory is a circuit factory that creates distributed test circuits. Given a set of participating
- * test client nodes, it assigns one node to the SENDER role and the remainder to the RECEIVER role.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create distributed circuits from one to many test nodes, for fanout style testing.
- * </table>
- *
- * @todo Adapt this to be an n*m topology circuit factory. Need to add circuit topology definitions to the test
- * parameters. Place n senders onto the available test clients, and m receivers. Where n or m is larger than
- * the available nodes, start stacking multiple test clients on each node. There will also be an option that
- * indicates whether nodes can play both roles, and how many nodes out of all available may be assigned to
- * each role.
- *
- * @todo The createCircuit methods on this and InteropCircuitFactory are going to be identical. This is because the
- * partitioning into senders and receivers is already done by the test decorators. Either eliminate these factories
- * as unnesesary, or move the partitioning functionality into the factories, in which case the test decorators
- * can probably be merged or eliminated. There is confusion over the placement of responsibilities between the
- * factories and the test decorators... although the test decorators may well do more than just circuit creation
- * in the future. For example, there may have to be a special decorator for test repetition that does one circuit
- * creation, but the runs many tests over it, in which case the handling of responsibilities becomes clearer.
- */
-public class FanOutCircuitFactory extends BaseCircuitFactory
-{
- /** Used for debugging. */
- Logger log = Logger.getLogger(FanOutCircuitFactory.class);
-
- /**
- * Creates a test circuit for the test, configered by the test parameters specified.
- *
- * @param testProperties The test parameters.
- * @return A test circuit.
- */
- public Circuit createCircuit(Connection connection, ParsedProperties testProperties)
- {
- log.debug("public Circuit createCircuit(ParsedProperties testProperties): called");
-
- List<TestClientDetails> senders = new LinkedList<TestClientDetails>();
- senders.add(getSender());
- List<TestClientDetails> receivers = getReceivers();
- ConversationFactory conversationFactory = getConversationFactory();
-
- return DistributedCircuitImpl.createCircuit(testProperties, senders, receivers, conversationFactory);
- }
-
- /**
- * Holds a test coordinating conversation with the test clients. This should consist of assigning the test roles,
- * begining the test, gathering the test reports from the participants, and checking for assertion failures against
- * the test reports.
- *
- * @param testCircuit The test circuit.
- * @param assertions The list of assertions to apply to the test circuit.
- * @param testProperties The test case definition.
- *
- * @deprecated Scheduled for removal once existing tests converted over to use test circuits.
- */
- public void sequenceTest(Circuit testCircuit, List<Assertion> assertions, Properties testProperties)
- {
- log.debug("protected Message[] sequenceTest(Object... testProperties = " + testProperties + "): called");
-
- TestClientDetails sender = getSender();
- List<TestClientDetails> receivers = getReceivers();
- ConversationFactory conversationFactory = getConversationFactory();
-
- try
- {
- // Create a conversation on the sender clients private control route.
- Session session = conversationFactory.getSession();
- Destination senderControlTopic = session.createTopic(sender.privateControlKey);
- ConversationFactory.Conversation senderConversation = conversationFactory.startConversation();
-
- // Assign the sender role to the sending test client.
- Message assignSender = conversationFactory.getSession().createMessage();
- TestUtils.setPropertiesOnMessage(assignSender, testProperties);
- assignSender.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignSender.setStringProperty("ROLE", "SENDER");
- assignSender.setStringProperty("CLIENT_NAME", "Sustained_SENDER");
-
- senderConversation.send(senderControlTopic, assignSender);
-
- // Wait for the sender to confirm its role.
- senderConversation.receive();
-
- // Assign the receivers roles.
- for (TestClientDetails receiver : receivers)
- {
- assignReceiverRole(receiver, testProperties, true);
- }
-
- // Start the test on the sender.
- Message start = session.createMessage();
- start.setStringProperty("CONTROL_TYPE", "START");
-
- senderConversation.send(senderControlTopic, start);
-
- // Wait for the test sender to return its report.
- Message senderReport = senderConversation.receive();
- TestUtils.pause(500);
-
- // Ask the receivers for their reports.
- Message statusRequest = session.createMessage();
- statusRequest.setStringProperty("CONTROL_TYPE", "STATUS_REQUEST");
-
- // Gather the reports from all of the receiving clients.
-
- // Return all of the test reports, the senders report first.
- // return new Message[] { senderReport };
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Unhandled JMSException.");
- }
- }
-
- /**
- * Assigns the receivers role to the specified test client that is to act as a receivers during the test. This method
- * does not always wait for the receiving clients to confirm their role assignments. This is because this method
- * may be called from an 'onMessage' method, when a client is joining the test at a later point in time, and it
- * is not possible to do a synchronous receive during an 'onMessage' method. There is a flag to indicate whether
- * or not to wait for role confirmations.
- *
- * @param receiver The test client to assign the receivers role to.
- * @param testProperties The test parameters.
- * @param confirm Indicates whether role confirmation should be waited for.
- *
- * @throws JMSException Any JMSExceptions occurring during the conversation are allowed to fall through.
- *
- * @deprecated Scheduled for removal once existing tests converted over to use test circuits.
- */
- protected void assignReceiverRole(TestClientDetails receiver, Properties testProperties, boolean confirm)
- throws JMSException
- {
- log.info("assignReceiverRole(TestClientDetails receivers = " + receiver + ", Map<String, Object> testProperties = "
- + testProperties + "): called");
-
- ConversationFactory conversationFactory = getConversationFactory();
-
- // Create a conversation with the receiving test client.
- Session session = conversationFactory.getSession();
- Destination receiverControlTopic = session.createTopic(receiver.privateControlKey);
- ConversationFactory.Conversation receiverConversation = conversationFactory.startConversation();
-
- // Assign the receivers role to the receiving client.
- Message assignReceiver = session.createMessage();
- TestUtils.setPropertiesOnMessage(assignReceiver, testProperties);
- assignReceiver.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignReceiver.setStringProperty("ROLE", "RECEIVER");
- assignReceiver.setStringProperty("CLIENT_NAME", receiver.clientName);
-
- receiverConversation.send(receiverControlTopic, assignReceiver);
-
- // Wait for the role confirmation to come back.
- if (confirm)
- {
- receiverConversation.receive();
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java
deleted file mode 100644
index 7df80bbf10..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java
+++ /dev/null
@@ -1,152 +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.
- *
- */
-package org.apache.qpid.test.framework.sequencers;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.test.framework.Assertion;
-import org.apache.qpid.test.framework.Circuit;
-import org.apache.qpid.test.framework.TestClientDetails;
-import org.apache.qpid.test.framework.TestUtils;
-import org.apache.qpid.test.framework.distributedcircuit.DistributedCircuitImpl;
-import org.apache.qpid.test.utils.ConversationFactory;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-
-import javax.jms.*;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * InteropCircuitFactory is a circuit factory that creates distributed test circuits. Given a set of participating
- * test client nodes, it assigns one node to the SENDER role and one the RECEIVER role.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Create distributed circuits from pairs of test nodes, for interop style testing.
- * </table>
- *
- * @todo The partitioning of a set of nodes into sender and receiver roles is actually done by the interop test
- * decorator. See the todo comment in FanOutCircuitFactory about merging the factories with the decorators, or
- * more carefully dividing up responsibilities between them.
- *
- * @todo The squenceTest code is deprecated, but currently still used by the interop tests. It will be removed once it
- * have been fully replaced by the default test procedure.
- */
-public class InteropCircuitFactory extends BaseCircuitFactory
-{
- /** Used for debugging. */
- Logger log = Logger.getLogger(InteropCircuitFactory.class);
-
- /**
- * Creates a test circuit for the test, configered by the test parameters specified.
- *
- * @param testProperties The test parameters.
- * @return A test circuit.
- */
- public Circuit createCircuit(Connection connection, ParsedProperties testProperties)
- {
- log.debug("public Circuit createCircuit(ParsedProperties testProperties): called");
-
- List<TestClientDetails> senders = new LinkedList<TestClientDetails>();
- senders.add(getSender());
- List<TestClientDetails> receivers = getReceivers();
- ConversationFactory conversationFactory = getConversationFactory();
-
- return DistributedCircuitImpl.createCircuit(testProperties, senders, receivers, conversationFactory);
- }
-
- /**
- * Holds a test coordinating conversation with the test clients. This should consist of assigning the test roles,
- * begining the test, gathering the test reports from the participants, and checking for assertion failures against
- * the test reports.
- *
- * @param testCircuit The test circuit.
- * @param assertions The list of assertions to apply to the test circuit.
- * @param testProperties The test case definition.
- */
- public void sequenceTest(Circuit testCircuit, List<Assertion> assertions, Properties testProperties)
- {
- log.debug("protected Message[] sequenceTest(Object... testProperties = " + testProperties + "): called");
-
- TestClientDetails sender = getSender();
- List<TestClientDetails> receivers = getReceivers();
- ConversationFactory conversationFactory = getConversationFactory();
-
- try
- {
- Session session = conversationFactory.getSession();
- Destination senderControlTopic = session.createTopic(sender.privateControlKey);
- Destination receiverControlTopic = session.createTopic(receivers.get(0).privateControlKey);
-
- ConversationFactory.Conversation senderConversation = conversationFactory.startConversation();
- ConversationFactory.Conversation receiverConversation = conversationFactory.startConversation();
-
- Message assignSender = conversationFactory.getSession().createMessage();
- TestUtils.setPropertiesOnMessage(assignSender, testProperties);
- assignSender.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignSender.setStringProperty("ROLE", "SENDER");
-
- senderConversation.send(senderControlTopic, assignSender);
-
- // Assign the receivers role the receiving client.
- Message assignReceiver = session.createMessage();
- TestUtils.setPropertiesOnMessage(assignReceiver, testProperties);
- assignReceiver.setStringProperty("CONTROL_TYPE", "ASSIGN_ROLE");
- assignReceiver.setStringProperty("ROLE", "RECEIVER");
-
- receiverConversation.send(receiverControlTopic, assignReceiver);
-
- // Wait for the senders and receivers to confirm their roles.
- senderConversation.receive();
- receiverConversation.receive();
-
- // Start the test.
- Message start = session.createMessage();
- start.setStringProperty("CONTROL_TYPE", "START");
-
- senderConversation.send(senderControlTopic, start);
-
- // Wait for the test sender to return its report.
- Message senderReport = senderConversation.receive();
- TestUtils.pause(500);
-
- // Ask the receivers for its report.
- Message statusRequest = session.createMessage();
- statusRequest.setStringProperty("CONTROL_TYPE", "STATUS_REQUEST");
-
- receiverConversation.send(receiverControlTopic, statusRequest);
-
- // Wait for the receivers to send its report.
- Message receiverReport = receiverConversation.receive();
-
- // return new Message[] { senderReport, receiverReport };
-
- // Apply assertions.
- }
- catch (JMSException e)
- {
- throw new RuntimeException("JMSException not handled.");
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/FailoverTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/FailoverTest.java
deleted file mode 100644
index a0a8894874..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/FailoverTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.testcases;
-
-import org.apache.qpid.test.framework.*;
-import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*;
-import org.apache.qpid.test.framework.localcircuit.LocalCircuitImpl;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-
-import javax.jms.JMSException;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-/**
- * FailoverTest provides testing of fail-over over a local-circuit implementation. The circuit being tested may be
- * against an in-vm broker or against an external broker, with the failure mechanism abstracted out of the test case.
- * Automatic failures can be simulated against an in-vm broker. Currently the test must interact with the user to
- * simulate failures on an external broker.
- *
- * Things to test:
- * In tx, failure duing tx causes tx to error on subsequent sends/receives or commits/rollbacks.
- * Outside of tx, reconnection allows msg flow to continue but there may be loss.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </table>
- *
- * @todo This test is designed to be run over a local circuit only. For in-vm using automatic failures, for external
- * brokers by prompting the user (or maybe using a script). Enforce the local-circuit only nature of the tests as
- * well as thinking about how other local-circuit tests might be implemented. For example, could add a method
- * to the framework base case for local only tests to call, that allows them access to the local-circuit
- * implementation and so on.
- *
- * @todo More. Need to really expand the set of fail-over tests.
- */
-public class FailoverTest extends FrameworkBaseCase
-{
- /* Used for debugging purposes. */
- // private static final Logger log = Logger.getLogger(FailoverTest.class);
-
- /**
- * Creates a new test case with the specified name.
- *
- * @param name The test case name.
- */
- public FailoverTest(String name)
- {
- super(name);
- }
-
- /**
- * Checks that all messages sent within a transaction are receieved despite a fail-over occuring outside of
- * the transaction.
- *
- * @throws JMSException Allowed to fall through and fail test.
- */
- public void testTxP2PFailover() throws Exception
- {
- // Set up the test properties to match the test cases requirements.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(ACK_MODE_PROPNAME, Session.AUTO_ACKNOWLEDGE);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // MessagingTestConfigProperties props = this.getTestParameters();
-
- // Create the test circuit from the test configuration parameters.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- // Create an assertion that all messages are received.
- Assertion allMessagesReceived = testCircuit.getReceiver().allMessagesReceivedAssertion(testProps);
-
- // This test case assumes it is using a local circuit.
- LocalCircuitImpl localCircuit = (LocalCircuitImpl) testCircuit;
-
- Session producerSession = localCircuit.getLocalPublisherCircuitEnd().getSession();
- MessageProducer producer = localCircuit.getLocalPublisherCircuitEnd().getProducer();
- // MessageConsumer consumer = localCircuit.getLocalReceiverCircuitEnd().getConsumer();
-
- // Send some test messages.
- for (int i = 0; i < 100; i++)
- {
- producer.send(TestUtils.createTestMessageOfSize(producerSession, 10));
- producerSession.commit();
-
- // Cause a failover.
- if (i == 50)
- {
- failureMechanism.causeFailure();
- }
-
- // Wait for the reconnection to complete.
- }
-
- // Check that trying to send within the original transaction fails.
-
- // Check that all messages sent were received.
- assertTrue("All messages sent were not received back again.", allMessagesReceived.apply());
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/ImmediateMessageTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/ImmediateMessageTest.java
deleted file mode 100644
index 69aa6a52ae..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/ImmediateMessageTest.java
+++ /dev/null
@@ -1,303 +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.
- *
- */
-package org.apache.qpid.test.testcases;
-
-import org.apache.qpid.test.framework.AMQPPublisher;
-import org.apache.qpid.test.framework.Circuit;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import org.apache.qpid.test.framework.MessagingTestConfigProperties;
-import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-/**
- * ImmediateMessageTest tests for the desired behaviour of immediate messages. Immediate messages are a non-JMS
- * feature. A message may be marked with an immediate delivery flag, which means that a consumer must be connected
- * to receive the message, through a valid route, when it is sent, or when its transaction is committed in the case
- * of transactional messaging. If this is not the case, the broker should return the message with a NO_CONSUMERS code.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Check that an immediate message is sent succesfully not using transactions when a consumer is connected.
- * <tr><td> Check that an immediate message is committed succesfully in a transaction when a consumer is connected.
- * <tr><td> Check that an immediate message results in no consumers code, not using transactions, when a consumer is
- * disconnected.
- * <tr><td> Check that an immediate message results in no consumers code, in a transaction, when a consumer is
- * disconnected.
- * <tr><td> Check that an immediate message results in no route code, not using transactions, when no outgoing route is
- * connected.
- * <tr><td> Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is
- * connected.
- * <tr><td> Check that an immediate message is sent succesfully not using transactions when a consumer is connected.
- * <tr><td> Check that an immediate message is committed succesfully in a transaction when a consumer is connected.
- * <tr><td> Check that an immediate message results in no consumers code, not using transactions, when a consumer is
- * disconnected.
- * <tr><td> Check that an immediate message results in no consumers code, in a transaction, when a consumer is
- * disconnected.
- * <tr><td> Check that an immediate message results in no route code, not using transactions, when no outgoing route is
- * connected.
- * <tr><td> Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is
- * connected.
- * </table>
- *
- * @todo All of these test cases will be generated by a test generator that thoroughly tests all combinations of test
- * circuits.
- */
-public class ImmediateMessageTest extends FrameworkBaseCase
-{
- /**
- * Creates a new test case with the specified name.
- *
- * @param name The test case name.
- */
- public ImmediateMessageTest(String name)
- {
- super(name);
- }
-
- /** Check that an immediate message is sent succesfully not using transactions when a consumer is connected. */
- public void test_QPID_517_ImmediateOkNoTxP2P() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Run the default test sequence over the test circuit checking for no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion(testProps))));
- }
-
- /** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_517_ImmediateOkTxP2P() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Send one message with no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion(testProps))));
- }
-
- /** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxP2P() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- // Send one message and get a linked no consumers exception.
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(testProps))));
- }
-
- /** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxP2P() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- // Send one message and get a linked no consumers exception.
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(testProps))));
- }
-
- /** Check that an immediate message results in no route code, not using transactions, when no outgoing route is connected. */
- public void test_QPID_517_ImmediateFailsNoRouteNoTxP2P() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
- // collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
-
- // Send one message and get a linked no route exception.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
- }
-
- /** Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is connected. */
- public void test_QPID_517_ImmediateFailsNoRouteTxP2P() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
- // collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
-
- // Send one message and get a linked no route exception.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
- }
-
- /** Check that an immediate message is sent succesfully not using transactions when a consumer is connected. */
- public void test_QPID_517_ImmediateOkNoTxPubSub() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Send one message with no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
- }
-
- /** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_517_ImmediateOkTxPubSub() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Send one message with no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
- }
-
- /** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxPubSub() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Use durable subscriptions, so that the route remains open with no subscribers.
- testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- // Send one message and get a linked no consumers exception.
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(testProps))));
- }
-
- /** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxPubSub() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Use durable subscriptions, so that the route remains open with no subscribers.
- testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- // Send one message and get a linked no consumers exception.
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noConsumersAssertion(testProps))));
- }
-
- /** Check that an immediate message results in no route code, not using transactions, when no outgoing route is connected. */
- public void test_QPID_517_ImmediateFailsNoRouteNoTxPubSub() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
- // collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
-
- // Send one message and get a linked no route exception.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
- }
-
- /** Check that an immediate message results in no route code, upon transaction commit, when no outgoing route is connected. */
- public void test_QPID_517_ImmediateFailsNoRouteTxPubSub() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
- // collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
-
- // Send one message and get a linked no route exception.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- /** All these tests should have the immediate flag on. */
- testProps.setProperty(IMMEDIATE_PROPNAME, true);
- testProps.setProperty(MANDATORY_PROPNAME, false);
-
- /** Bind the receivers consumer by default. */
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true);
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, true);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/MandatoryMessageTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/MandatoryMessageTest.java
deleted file mode 100644
index b4c4eb91b4..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/MandatoryMessageTest.java
+++ /dev/null
@@ -1,321 +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.
- *
- */
-package org.apache.qpid.test.testcases;
-
-import org.apache.qpid.test.framework.AMQPPublisher;
-import org.apache.qpid.test.framework.Circuit;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import org.apache.qpid.test.framework.MessagingTestConfigProperties;
-import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-/**
- * MandatoryMessageTest tests for the desired behaviour of mandatory messages. Mandatory messages are a non-JMS
- * feature. A message may be marked with a mandatory delivery flag, which means that a valid route for the message
- * must exist, when it is sent, or when its transaction is committed in the case of transactional messaging. If this
- * is not the case, the broker should return the message with a NO_CONSUMERS code.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Check that an mandatory message is sent succesfully not using transactions when a consumer is connected.
- * <tr><td> Check that an mandatory message is committed succesfully in a transaction when a consumer is connected.
- * <tr><td> Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected
- * but the route exists.
- * <tr><td> Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but
- * the route exists.
- * <tr><td> Check that an mandatory message results in no route code, not using transactions, when no consumer is
- * connected.
- * <tr><td> Check that an mandatory message results in no route code, upon transaction commit, when a consumer is
- * connected.
- * <tr><td> Check that an mandatory message is sent succesfully not using transactions when a consumer is connected.
- * <tr><td> Check that an mandatory message is committed succesfully in a transaction when a consumer is connected.
- * <tr><td> Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected
- * but the route exists.
- * <tr><td> Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but
- * the route exists.
- * <tr><td> Check that an mandatory message results in no route code, not using transactions, when no consumer is
- * connected.
- * <tr><td> Check that an mandatory message results in no route code, upon transaction commit, when a consumer is
- * connected.
- * </table>
- *
- * @todo All of these test cases will be generated by a test generator that thoroughly tests all combinations of test
- * circuits.
- */
-public class MandatoryMessageTest extends FrameworkBaseCase
-{
- /** Used to read the tests configurable properties through. */
- ParsedProperties testProps;
-
- /**
- * Creates a new test case with the specified name.
- *
- * @param name The test case name.
- */
- public MandatoryMessageTest(String name)
- {
- super(name);
- }
-
- /** Check that an mandatory message is sent succesfully not using transactions when a consumer is connected. */
- public void test_QPID_508_MandatoryOkNoTxP2P() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Run the default test sequence over the test circuit checking for no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
- }
-
- /** Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_508_MandatoryOkTxP2P() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Run the default test sequence over the test circuit checking for no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
- }
-
- /**
- * Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected but
- * the route exists.
- */
- public void test_QPID_517_MandatoryOkConsumerDisconnectedNoTxP2P() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- // Send one message with no errors.
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
- }
-
- /**
- * Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but
- * the route exists.
- */
- public void test_QPID_517_MandatoryOkConsumerDisconnectedTxP2P() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- // Send one message with no errors.
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
- }
-
- /** Check that an mandatory message results in no route code, not using transactions, when no consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteNoTxP2P() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
- // collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
-
- // Send one message and get a linked no route exception.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
- }
-
- /** Check that an mandatory message results in no route code, upon transaction commit, when a consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteTxP2P() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
- // collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
-
- // Send one message and get a linked no route exception.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
- }
-
- /** Check that an mandatory message is sent succesfully not using transactions when a consumer is connected. */
- public void test_QPID_508_MandatoryOkNoTxPubSub() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Run the default test sequence over the test circuit checking for no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
- }
-
- /** Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_508_MandatoryOkTxPubSub() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Run the default test sequence over the test circuit checking for no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
- }
-
- /**
- * Check that a mandatory message is sent succesfully, not using transactions, when a consumer is disconnected but
- * the route exists.
- */
- public void test_QPID_517_MandatoryOkConsumerDisconnectedNoTxPubSub() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Use durable subscriptions, so that the route remains open with no subscribers.
- testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- // Send one message with no errors.
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
- }
-
- /**
- * Check that a mandatory message is sent succesfully, in a transaction, when a consumer is disconnected but
- * the route exists.
- */
- public void test_QPID_517_MandatoryOkConsumerDisconnectedTxPubSub() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Use durable subscriptions, so that the route remains open with no subscribers.
- testProps.setProperty(DURABLE_SUBSCRIPTION_PROPNAME, true);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- // Send one message with no errors.
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noExceptionsAssertion(testProps))));
- }
-
- /** Check that an mandatory message results in no route code, not using transactions, when no consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteNoTxPubSub() throws Exception
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
- // collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
-
- // Send one message and get a linked no route exception.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
- }
-
- /** Check that an mandatory message results in no route code, upon transaction commit, when a consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteTxPubSub() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Set up the messaging topology so that only the publishers producer is bound (do not set up the receivers to
- // collect its messages).
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, false);
-
- // Send one message and get a linked no route exception.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(((AMQPPublisher) testCircuit.getPublisher()).noRouteAssertion(testProps))));
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- /** All these tests should have the mandatory flag on. */
- testProps.setProperty(IMMEDIATE_PROPNAME, false);
- testProps.setProperty(MANDATORY_PROPNAME, true);
-
- /** Bind the receivers consumer by default. */
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true);
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, true);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/RollbackTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/RollbackTest.java
deleted file mode 100644
index 5c8012e700..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/RollbackTest.java
+++ /dev/null
@@ -1,132 +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.
- *
- */
-package org.apache.qpid.test.testcases;
-
-import org.apache.qpid.test.framework.Circuit;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import org.apache.qpid.test.framework.MessagingTestConfigProperties;
-import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-
-import org.apache.qpid.junit.extensions.util.ParsedProperties;
-import org.apache.qpid.junit.extensions.util.TestContextProperties;
-
-/**
- * RollbackTest tests the rollback ability of transactional messaging.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Check messages sent but rolled back are never received.
- * <tr><td> Check messages received but rolled back are redelivered on subsequent receives.
- * <tr><td> Attempting to rollback outside of a transaction results in an IllegalStateException.
- * </table>
- */
-public class RollbackTest extends FrameworkBaseCase
-{
- /** Used to read the tests configurable properties through. */
- ParsedProperties testProps;
-
- /**
- * Creates a new test case with the specified name.
- *
- * @param name The test case name.
- */
- public RollbackTest(String name)
- {
- super(name);
- }
-
- /** Check messages sent but rolled back are never received. */
- public void testRolledbackMessageNotDelivered() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, true);
- testProps.setProperty(ROLLBACK_PUBLISHER_PROPNAME, true);
-
- // Run the default test sequence over the test circuit checking for no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(testCircuit.getPublisher().noExceptionsAssertion(testProps),
- testCircuit.getReceiver().noMessagesReceivedAssertion(testProps))));
- }
-
- /** Check messages received but rolled back are redelivered on subsequent receives. */
- public void testRolledbackMessagesSubsequentlyReceived() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_RECEIVER_PROPNAME, true);
- testProps.setProperty(ROLLBACK_RECEIVER_PROPNAME, true);
-
- // Run the default test sequence over the test circuit checking for no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1,
- assertionList(testCircuit.getPublisher().noExceptionsAssertion(testProps),
- testCircuit.getReceiver().allMessagesReceivedAssertion(testProps))));
- }
-
- /** Attempting to rollback outside of a transaction results in an IllegalStateException. */
- public void testRollbackUnavailableOutsideTransactionPublisher() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PUBLISHER_PROPNAME, false);
- testProps.setProperty(ROLLBACK_PUBLISHER_PROPNAME, true);
-
- // Run the default test sequence over the test circuit checking for no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().channelClosedAssertion(testProps))));
- }
-
- /** Attempting to rollback outside of a transaction results in an IllegalStateException. */
- public void testRollbackUnavailableOutsideTransactionReceiver() throws Exception
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_RECEIVER_PROPNAME, false);
- testProps.setProperty(ROLLBACK_RECEIVER_PROPNAME, true);
-
- // Run the default test sequence over the test circuit checking for no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getReceiver().channelClosedAssertion(testProps))));
- }
-
- /**
- * Sets up all tests to have an active outward route and consumer by default.
- *
- * @throws Exception Any exceptions are allowed to fall through and fail the test.
- */
- protected void setUp() throws Exception
- {
- super.setUp();
-
- testProps = TestContextProperties.getInstance(MessagingTestConfigProperties.defaults);
-
- /** Bind the receivers consumer by default. */
- testProps.setProperty(RECEIVER_CONSUMER_BIND_PROPNAME, true);
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, true);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/TTLTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/TTLTest.java
deleted file mode 100644
index 384e3176f5..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/testcases/TTLTest.java
+++ /dev/null
@@ -1,151 +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.
- *
- */
-package org.apache.qpid.test.testcases;
-
-import org.apache.qpid.test.framework.Circuit;
-import org.apache.qpid.test.framework.FrameworkBaseCase;
-import static org.apache.qpid.test.framework.MessagingTestConfigProperties.ACK_MODE_PROPNAME;
-import static org.apache.qpid.test.framework.MessagingTestConfigProperties.PUBSUB_PROPNAME;
-import org.apache.qpid.test.framework.TestUtils;
-import org.apache.qpid.test.framework.localcircuit.LocalCircuitImpl;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-
-import javax.jms.*;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Random;
-
-/**
- * TTLTest checks that time-to-live is applied to messages. The test sends messages with a variety of TTL stamps on them
- * then after a pause attempts to receive those messages. Only messages with a large enough TTL to have survived the pause
- * should be receiveable. This test case also applies an additional assertion against the broker, that the message store
- * is empty at the end of the test.
- *
- * <p/>This test is designed to run over local circuits only, as it must control a timed pause between sending and receiving
- * messages to that TTL can be applied to purge some of the messages.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </table>
- *
- * @todo Use an interface or other method to mark this test as local only.
- *
- * @todo Implement the message store assertion for in-vm broker. Could also be done for external broker, for example
- * by using diagnostic exchange.
- *
- * @todo Implement and add a queue depth assertion too. This might already be in another test to copy from.
- *
- * @todo Create variations on test theme, for different ack mode and tx and message sizes etc.
- *
- * @todo Add an allowable margin of error to the test, as ttl may not be precise.
- */
-public class TTLTest extends FrameworkBaseCase
-{
- /**
- * Creates a new test case with the specified name.
- *
- * @param name The test case name.
- */
- public TTLTest(String name)
- {
- super(name);
- }
-
- /**
- * Checks that all messages sent with a TTL shorter than a pause between sending them and attempting to receive them
- * will fail to arrive. Once all messages have been purged by TTL or received, check that they no longer exist on
- * the broker.
- *
- * @throws javax.jms.JMSException Allowed to fall through and fail test.
- */
- public void testTTLP2P() throws Exception
- {
- String errorMessages = "";
- Random r = new Random();
-
- // Used to accumulate correctly received messages in.
- List<Message> receivedMessages = new LinkedList<Message>();
-
- // Set up the test properties to match the test case requirements.
- testProps.setProperty(ACK_MODE_PROPNAME, Session.AUTO_ACKNOWLEDGE);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Create the test circuit from the test configuration parameters.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(getConnection(), testProps);
-
- // This test case assumes it is using a local circuit.
- LocalCircuitImpl localCircuit = (LocalCircuitImpl) testCircuit;
-
- Session producerSession = localCircuit.getLocalPublisherCircuitEnd().getSession();
- MessageProducer producer = localCircuit.getLocalPublisherCircuitEnd().getProducer();
- MessageConsumer consumer = localCircuit.getLocalReceiverCircuitEnd().getConsumer();
-
- // Send some tests messages, with random TTLs, some shorter and some longer than the pause time.
- for (int i = 0; i < 100; i++)
- {
- Message testMessage = TestUtils.createTestMessageOfSize(producerSession, 10);
-
- // Set the TTL on the message and record its value in the message headers.
- long ttl = 500 + r.nextInt(1500);
- producer.setTimeToLive(ttl);
- testMessage.setLongProperty("testTTL", ttl);
-
- producer.send(testMessage);
- // producerSession.commit();
- }
-
- // Inject a pause to allow some messages to be purged by TTL.
- TestUtils.pause(1000);
-
- // Attempt to receive back all of the messages, confirming by the message time stamps and TTLs that only
- // those received should have avoided being purged by the TTL.
- boolean timedOut = false;
-
- while (!timedOut)
- {
- Message testMessage = consumer.receive(1000);
-
- long ttl = testMessage.getLongProperty("testTTL");
- long timeStamp = testMessage.getJMSTimestamp();
- long now = System.currentTimeMillis();
-
- if ((timeStamp + ttl) < now)
- {
- errorMessages +=
- "Received message [sent: " + timeStamp + ", ttl: " + ttl + ", received: " + now
- + "] which should have been purged by its TTL.\n";
- }
- /*else
- {
- receivedMessages.add(testMessage);
- }*/
- }
-
- // Check that the queue and message store on the broker are empty.
- // assertTrue("Message store is not empty.", messageStoreEmpty.apply());
- // assertTrue("Queue is not empty.", queueEmpty.apply());
-
- assertTrue(errorMessages, "".equals(errorMessages));
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java
deleted file mode 100644
index b63f990791..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/AcknowledgeTest.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package org.apache.qpid.test.unit.ack;
-
-/*
- *
- * 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 javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-public class AcknowledgeTest extends QpidTestCase
-{
- private static final int NUM_MESSAGES = 50;
- private Connection _con;
- private Queue _queue;
- private MessageProducer _producer;
- private Session _producerSession;
- private Session _consumerSession;
- private MessageConsumer _consumerA;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- _queue = (Queue) getInitialContext().lookup("queue");
-
- //Create Producer put some messages on the queue
- _con = getConnection();
- _con.start();
- }
-
- private void init(boolean transacted, int mode) throws JMSException {
- _producerSession = _con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- _consumerSession = _con.createSession(transacted, mode);
- _producer = _producerSession.createProducer(_queue);
- _consumerA = _consumerSession.createConsumer(_queue);
- }
-
-
-
- private void sendMessages(int totalMessages) throws JMSException
- {
- for (int i = 0; i < totalMessages; i++)
- {
- _producer.send(_producerSession.createTextMessage("message " + i));
- }
- }
-
- /**
- * Produces and consumes messages an either ack or commit the receipt of those messages
- *
- * @param transacted
- * @param mode
- * @throws Exception
- */
- private void testMessageAck(boolean transacted, int mode) throws Exception
- {
- init(transacted, mode);
- sendMessages(NUM_MESSAGES/2);
- Thread.sleep(1500);
- MessageConsumer consumerB = _consumerSession.createConsumer(_queue);
- sendMessages(NUM_MESSAGES/2);
- int count = 0;
- Message msg = consumerB.receive(1500);
- while (msg != null)
- {
- if (mode == Session.CLIENT_ACKNOWLEDGE)
- {
- msg.acknowledge();
- }
- count++;
- msg = consumerB.receive(1500);
- }
- if (transacted)
- {
- _consumerSession.commit();
- }
- _consumerA.close();
- consumerB.close();
- _consumerSession.close();
- assertEquals("Wrong number of messages on queue", NUM_MESSAGES - count,
- ((AMQSession) _producerSession).getQueueDepth((AMQDestination) _queue));
-
- // Clean up messages that may be left on the queue
- _consumerSession = _con.createSession(transacted, mode);
- _consumerA = _consumerSession.createConsumer(_queue);
- msg = _consumerA.receive(1500);
- while (msg != null)
- {
- if (mode == Session.CLIENT_ACKNOWLEDGE)
- {
- msg.acknowledge();
- }
- msg = _consumerA.receive(1500);
- }
- _consumerA.close();
- if (transacted)
- {
- _consumerSession.commit();
- }
- _consumerSession.close();
- }
-
- public void test2ConsumersAutoAck() throws Exception
- {
- testMessageAck(false, Session.AUTO_ACKNOWLEDGE);
- }
-
- public void test2ConsumersClientAck() throws Exception
- {
- testMessageAck(true, Session.CLIENT_ACKNOWLEDGE);
- }
-
- public void test2ConsumersTx() throws Exception
- {
- testMessageAck(true, Session.AUTO_ACKNOWLEDGE);
- }
-
- public void testIndividualAck() throws Exception
- {
- init(false, Session.CLIENT_ACKNOWLEDGE);
- sendMessages(3);
- Message msg = null;
- for (int i = 0; i < 2; i++)
- {
- msg = _consumerA.receive(RECEIVE_TIMEOUT);
- ((AbstractJMSMessage)msg).acknowledgeThis();
- }
- msg = _consumerA.receive(RECEIVE_TIMEOUT);
- msg.acknowledge();
- _con.close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java
deleted file mode 100644
index 7434fcbb30..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java
+++ /dev/null
@@ -1,331 +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.
- *
- */
-package org.apache.qpid.test.unit.ack;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.TextMessage;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-public class RecoverTest extends QpidTestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(RecoverTest.class);
-
- private Exception _error;
- private AtomicInteger count;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- _error = null;
- count = new AtomicInteger();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- count = null;
- }
-
- public void testRecoverResendsMsgs() throws Exception
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
-
- Session consumerSession = con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- Queue queue =
- new AMQQueue(consumerSession.getDefaultQueueExchangeName(), new AMQShortString("someQ"),
- new AMQShortString("someQ"), false, true);
- MessageConsumer consumer = consumerSession.createConsumer(queue);
- // force synch to ensure the consumer has resulted in a bound queue
- // ((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.DIRECT_EXCHANGE_NAME, ExchangeDefaults.DIRECT_EXCHANGE_CLASS);
- // This is the default now
-
- AMQConnection con2 = (AMQConnection) getConnection("guest", "guest");
- Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- MessageProducer producer = producerSession.createProducer(queue);
-
- _logger.info("Sending four messages");
- producer.send(producerSession.createTextMessage("msg1"));
- producer.send(producerSession.createTextMessage("msg2"));
- producer.send(producerSession.createTextMessage("msg3"));
- producer.send(producerSession.createTextMessage("msg4"));
-
- con2.close();
-
- _logger.info("Starting connection");
- con.start();
- TextMessage tm = (TextMessage) consumer.receive();
- tm.acknowledge();
- _logger.info("Received and acknowledged first message");
- consumer.receive();
- consumer.receive();
- consumer.receive();
- _logger.info("Received all four messages. Calling recover with three outstanding messages");
- // no ack for last three messages so when I call recover I expect to get three messages back
- consumerSession.recover();
- tm = (TextMessage) consumer.receive(3000);
- assertEquals("msg2", tm.getText());
-
- tm = (TextMessage) consumer.receive(3000);
- assertEquals("msg3", tm.getText());
-
- tm = (TextMessage) consumer.receive(3000);
- assertEquals("msg4", tm.getText());
-
- _logger.info("Received redelivery of three messages. Acknowledging last message");
- tm.acknowledge();
-
- _logger.info("Calling acknowledge with no outstanding messages");
- // all acked so no messages to be delivered
- consumerSession.recover();
-
- tm = (TextMessage) consumer.receiveNoWait();
- assertNull(tm);
- _logger.info("No messages redelivered as is expected");
-
- con.close();
- }
-
- public void testRecoverResendsMsgsAckOnEarlier() throws Exception
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
-
- Session consumerSession = con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- Queue queue =
- new AMQQueue(consumerSession.getDefaultQueueExchangeName(), new AMQShortString("someQ"),
- new AMQShortString("someQ"), false, true);
- MessageConsumer consumer = consumerSession.createConsumer(queue);
- // force synch to ensure the consumer has resulted in a bound queue
- // ((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.DIRECT_EXCHANGE_NAME, ExchangeDefaults.DIRECT_EXCHANGE_CLASS);
- // This is the default now
-
- AMQConnection con2 = (AMQConnection) getConnection("guest", "guest");
- Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- MessageProducer producer = producerSession.createProducer(queue);
-
- _logger.info("Sending four messages");
- producer.send(producerSession.createTextMessage("msg1"));
- producer.send(producerSession.createTextMessage("msg2"));
- producer.send(producerSession.createTextMessage("msg3"));
- producer.send(producerSession.createTextMessage("msg4"));
-
- con2.close();
-
- _logger.info("Starting connection");
- con.start();
- TextMessage tm = (TextMessage) consumer.receive();
- consumer.receive();
- tm.acknowledge();
- _logger.info("Received 2 messages, acknowledge() first message, should acknowledge both");
-
- consumer.receive();
- consumer.receive();
- _logger.info("Received all four messages. Calling recover with two outstanding messages");
- // no ack for last three messages so when I call recover I expect to get three messages back
- consumerSession.recover();
- TextMessage tm3 = (TextMessage) consumer.receive(3000);
- assertEquals("msg3", tm3.getText());
-
- TextMessage tm4 = (TextMessage) consumer.receive(3000);
- assertEquals("msg4", tm4.getText());
-
- _logger.info("Received redelivery of two messages. calling acknolwedgeThis() first of those message");
- ((org.apache.qpid.jms.Message) tm3).acknowledgeThis();
-
- _logger.info("Calling recover");
- // all acked so no messages to be delivered
- consumerSession.recover();
-
- tm4 = (TextMessage) consumer.receive(3000);
- assertEquals("msg4", tm4.getText());
- ((org.apache.qpid.jms.Message) tm4).acknowledgeThis();
-
- _logger.info("Calling recover");
- // all acked so no messages to be delivered
- consumerSession.recover();
-
- tm = (TextMessage) consumer.receiveNoWait();
- assertNull(tm);
- _logger.info("No messages redelivered as is expected");
-
- con.close();
- }
-
- public void testAcknowledgePerConsumer() throws Exception
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
-
- Session consumerSession = con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- Queue queue =
- new AMQQueue(consumerSession.getDefaultQueueExchangeName(), new AMQShortString("Q1"), new AMQShortString("Q1"),
- false, true);
- Queue queue2 =
- new AMQQueue(consumerSession.getDefaultQueueExchangeName(), new AMQShortString("Q2"), new AMQShortString("Q2"),
- false, true);
- MessageConsumer consumer = consumerSession.createConsumer(queue);
- MessageConsumer consumer2 = consumerSession.createConsumer(queue2);
-
- AMQConnection con2 = (AMQConnection) getConnection("guest", "guest");
- Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- MessageProducer producer = producerSession.createProducer(queue);
- MessageProducer producer2 = producerSession.createProducer(queue2);
-
- producer.send(producerSession.createTextMessage("msg1"));
- producer2.send(producerSession.createTextMessage("msg2"));
-
- con2.close();
-
- _logger.info("Starting connection");
- con.start();
-
- TextMessage tm2 = (TextMessage) consumer2.receive(2000);
- assertNotNull(tm2);
- assertEquals("msg2", tm2.getText());
-
- tm2.acknowledge();
-
- consumerSession.recover();
-
- TextMessage tm1 = (TextMessage) consumer.receive(2000);
- assertNotNull(tm1);
- assertEquals("msg1", tm1.getText());
-
- con.close();
-
- }
-
- public void testRecoverInAutoAckListener() throws Exception
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
-
- final Session consumerSession = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Queue queue =
- new AMQQueue(consumerSession.getDefaultQueueExchangeName(), new AMQShortString("Q3"), new AMQShortString("Q3"),
- false, true);
- MessageConsumer consumer = consumerSession.createConsumer(queue);
- MessageProducer producer = consumerSession.createProducer(queue);
- producer.send(consumerSession.createTextMessage("hello"));
-
- final Object lock = new Object();
-
- consumer.setMessageListener(new MessageListener()
- {
-
- public void onMessage(Message message)
- {
- try
- {
- count.incrementAndGet();
- if (count.get() == 1)
- {
- if (message.getJMSRedelivered())
- {
- setError(
- new Exception("Message marked as redilvered on what should be first delivery attempt"));
- }
-
- consumerSession.recover();
- }
- else if (count.get() == 2)
- {
- if (!message.getJMSRedelivered())
- {
- setError(
- new Exception(
- "Message not marked as redilvered on what should be second delivery attempt"));
- }
- }
- else
- {
- System.err.println(message);
- fail("Message delivered too many times!: " + count);
- }
- }
- catch (JMSException e)
- {
- _logger.error("Error recovering session: " + e, e);
- setError(e);
- }
-
- synchronized (lock)
- {
- lock.notify();
- }
- }
- });
-
- con.start();
-
- long waitTime = 30000L;
- long waitUntilTime = System.currentTimeMillis() + waitTime;
-
- synchronized (lock)
- {
- while ((count.get() <= 1) && (waitTime > 0))
- {
- lock.wait(waitTime);
- if (count.get() <= 1)
- {
- waitTime = waitUntilTime - System.currentTimeMillis();
- }
- }
- }
-
- Thread.sleep(1000);
-
- if (count.get() != 2)
- {
- System.err.println("Count != 2 : " + count);
- }
-
- assertTrue(count.get() == 2);
-
- con.close();
-
- if (_error != null)
- {
- throw _error;
- }
- }
-
- private void setError(Exception e)
- {
- _error = e;
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(RecoverTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/BytesMessageTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/BytesMessageTest.java
deleted file mode 100644
index 9a7fe7c039..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/BytesMessageTest.java
+++ /dev/null
@@ -1,282 +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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import junit.framework.Assert;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.message.JMSBytesMessage;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageNotReadableException;
-import javax.jms.MessageNotWriteableException;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-public class BytesMessageTest extends QpidTestCase implements MessageListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(BytesMessageTest.class);
-
- private Connection _connection;
- private Destination _destination;
- private Session _session;
- private final List<JMSBytesMessage> received = new ArrayList<JMSBytesMessage>();
- private final List<byte[]> messages = new ArrayList<byte[]>();
- private int _count = 100;
- public String _connectionString = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- init((AMQConnection) getConnection("guest", "guest"));
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- void init(AMQConnection connection) throws Exception
- {
- init(connection, new AMQQueue(connection, randomize("BytesMessageTest"), true));
- }
-
- void init(AMQConnection connection, AMQDestination destination) throws Exception
- {
- _connection = connection;
- _destination = destination;
- _session = connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
-
- // Set up a slow consumer.
- _session.createConsumer(destination).setMessageListener(this);
- connection.start();
- }
-
- public void test() throws Exception
- {
- try
- {
- send(_count);
- waitFor(_count);
- check();
- _logger.info("Completed without failure");
- }
- finally
- {
- _connection.close();
- }
- }
-
- void send(int count) throws JMSException
- {
- // create a publisher
- MessageProducer producer = _session.createProducer(_destination);
- for (int i = 0; i < count; i++)
- {
- BytesMessage msg = _session.createBytesMessage();
-
- try
- {
- msg.readFloat();
- Assert.fail("Message should not be readable");
- }
- catch (MessageNotReadableException mnwe)
- {
- // normal execution
- }
-
- byte[] data = ("Message " + i).getBytes();
- msg.writeBytes(data);
- messages.add(data);
- producer.send(msg);
- }
- }
-
- void waitFor(int count) throws InterruptedException
- {
- synchronized (received)
- {
- while (received.size() < count)
- {
- received.wait();
- }
- }
- }
-
- void check() throws JMSException
- {
- List<byte[]> actual = new ArrayList<byte[]>();
- for (JMSBytesMessage m : received)
- {
- ByteBuffer buffer = m.getData();
- byte[] data = new byte[buffer.remaining()];
- buffer.get(data);
- actual.add(data);
-
- // Check Body Write Status
- try
- {
- m.writeBoolean(true);
- Assert.fail("Message should not be writeable");
- }
- catch (MessageNotWriteableException mnwe)
- {
- // normal execution
- }
-
- m.clearBody();
-
- try
- {
- m.writeBoolean(true);
- }
- catch (MessageNotWriteableException mnwe)
- {
- Assert.fail("Message should be writeable");
- }
-
- // Check property write status
- try
- {
- m.setStringProperty("test", "test");
- Assert.fail("Message should not be writeable");
- }
- catch (MessageNotWriteableException mnwe)
- {
- // normal execution
- }
-
- m.clearProperties();
-
- try
- {
- m.setStringProperty("test", "test");
- }
- catch (MessageNotWriteableException mnwe)
- {
- Assert.fail("Message should be writeable");
- }
-
- }
-
- assertEqual(messages.iterator(), actual.iterator());
- }
-
- private static void assertEqual(Iterator expected, Iterator actual)
- {
- List<String> errors = new ArrayList<String>();
- while (expected.hasNext() && actual.hasNext())
- {
- try
- {
- assertEquivalent((byte[]) expected.next(), (byte[]) actual.next());
- }
- catch (Exception e)
- {
- errors.add(e.getMessage());
- }
- }
- while (expected.hasNext())
- {
- errors.add("Expected " + expected.next() + " but no more actual values.");
- }
- while (actual.hasNext())
- {
- errors.add("Found " + actual.next() + " but no more expected values.");
- }
-
- if (!errors.isEmpty())
- {
- throw new RuntimeException(errors.toString());
- }
- }
-
- private static void assertEquivalent(byte[] expected, byte[] actual)
- {
- if (expected.length != actual.length)
- {
- throw new RuntimeException("Expected length " + expected.length + " got " + actual.length);
- }
-
- for (int i = 0; i < expected.length; i++)
- {
- if (expected[i] != actual[i])
- {
- throw new RuntimeException("Failed on byte " + i + " of " + expected.length);
- }
- }
- }
-
- public void onMessage(Message message)
- {
- synchronized (received)
- {
- received.add((JMSBytesMessage) message);
- received.notify();
- }
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- public static void main(String[] argv) throws Exception
- {
- final String connectionString;
- final int count;
- if (argv.length == 0)
- {
- connectionString = "vm://:1";
- count = 100;
- }
- else
- {
- connectionString = argv[0];
- count = Integer.parseInt(argv[1]);
- }
-
- System.out.println("connectionString = " + connectionString);
- System.out.println("count = " + count);
-
- BytesMessageTest test = new BytesMessageTest();
- test._connectionString = connectionString;
- test._count = count;
- test.test();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/FieldTableMessageTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/FieldTableMessageTest.java
deleted file mode 100644
index 979023d4b6..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/FieldTableMessageTest.java
+++ /dev/null
@@ -1,163 +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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.message.JMSBytesMessage;
-import org.apache.qpid.framing.AMQFrameDecodingException;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.FieldTableFactory;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-public class FieldTableMessageTest extends QpidTestCase implements MessageListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(FieldTableMessageTest.class);
-
- private AMQConnection _connection;
- private AMQDestination _destination;
- private AMQSession _session;
- private final ArrayList<JMSBytesMessage> received = new ArrayList<JMSBytesMessage>();
- private FieldTable _expected;
- private int _count = 10;
- public String _connectionString = "vm://:1";
- private CountDownLatch _waitForCompletion;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- init( (AMQConnection) getConnection("guest", "guest"));
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- private void init(AMQConnection connection) throws Exception
- {
- init(connection, new AMQQueue(connection, randomize("FieldTableMessageTest"), true));
- }
-
- private void init(AMQConnection connection, AMQDestination destination) throws Exception
- {
- _connection = connection;
- _destination = destination;
- _session = (AMQSession) connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
-
- // set up a slow consumer
- _session.createConsumer(destination).setMessageListener(this);
- connection.start();
-
- // _expected = new FieldTableTest().load("FieldTableTest2.properties");
- _expected = load();
- }
-
- private FieldTable load() throws IOException
- {
- FieldTable result = FieldTableFactory.newFieldTable();
- result.setLong("one", 1L);
- result.setLong("two", 2L);
- result.setLong("three", 3L);
- result.setLong("four", 4L);
- result.setLong("five", 5L);
-
- return result;
- }
-
- public void test() throws Exception
- {
- int count = _count;
- _waitForCompletion = new CountDownLatch(_count);
- send(count);
- _waitForCompletion.await(20, TimeUnit.SECONDS);
- check();
- _logger.info("Completed without failure");
- _connection.close();
- }
-
- void send(int count) throws JMSException, IOException
- {
- // create a publisher
- MessageProducer producer = _session.createProducer(_destination);
- for (int i = 0; i < count; i++)
- {
- BytesMessage msg = _session.createBytesMessage();
- msg.writeBytes(_expected.getDataAsBytes());
- producer.send(msg);
- }
- }
-
-
- void check() throws JMSException, AMQFrameDecodingException
- {
- for (Object m : received)
- {
- ByteBuffer buffer = ((JMSBytesMessage) m).getData();
- FieldTable actual = FieldTableFactory.newFieldTable(buffer, buffer.remaining());
- for (String key : _expected.keys())
- {
- assertEquals("Values for " + key + " did not match", _expected.getObject(key), actual.getObject(key));
- }
- }
- }
-
- public void onMessage(Message message)
- {
- synchronized (received)
- {
- received.add((JMSBytesMessage) message);
- _waitForCompletion.countDown();
- }
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- public static void main(String[] argv) throws Exception
- {
- FieldTableMessageTest test = new FieldTableMessageTest();
- test._connectionString = (argv.length == 0) ? "vm://:1" : argv[0];
- test.setUp();
- test._count = (argv.length > 1) ? Integer.parseInt(argv[1]) : 5;
- test.test();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java
deleted file mode 100644
index 06f4a6464f..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java
+++ /dev/null
@@ -1,104 +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.
- *
- */
-
-package org.apache.qpid.test.unit.basic;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import javax.jms.Session;
-import javax.jms.QueueSession;
-import javax.jms.Queue;
-import javax.jms.QueueSender;
-import javax.jms.TextMessage;
-import javax.jms.InvalidDestinationException;
-
-public class InvalidDestinationTest extends QpidTestCase
-{
- private AMQConnection _connection;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- _connection = (AMQConnection) getConnection("guest", "guest");
- }
-
- protected void tearDown() throws Exception
- {
- _connection.close();
- super.tearDown();
- }
-
-
-
- public void testInvalidDestination() throws Exception
- {
- Queue invalidDestination = new AMQQueue("amq.direct","unknownQ");
- AMQQueue validDestination = new AMQQueue("amq.direct","knownQ");
- QueueSession queueSession = _connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // This is the only easy way to create and bind a queue from the API :-(
- queueSession.createConsumer(validDestination);
-
- QueueSender sender = queueSession.createSender(invalidDestination);
- TextMessage msg = queueSession.createTextMessage("Hello");
- try
- {
- sender.send(msg);
- fail("Expected InvalidDestinationException");
- }
- catch (InvalidDestinationException ex)
- {
- // pass
- }
- sender.close();
-
- sender = queueSession.createSender(null);
- invalidDestination = new AMQQueue("amq.direct","unknownQ");
-
- try
- {
- sender.send(invalidDestination,msg);
- fail("Expected InvalidDestinationException");
- }
- catch (InvalidDestinationException ex)
- {
- // pass
- }
- sender.send(validDestination,msg);
- sender.close();
- validDestination = new AMQQueue("amq.direct","knownQ");
- sender = queueSession.createSender(validDestination);
- sender.send(msg);
-
-
-
-
- }
-
-
- public static junit.framework.Test suite()
- {
-
- return new junit.framework.TestSuite(InvalidDestinationTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java
deleted file mode 100644
index e9aed4de01..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java
+++ /dev/null
@@ -1,184 +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.
- *
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-public class LargeMessageTest extends QpidTestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(LargeMessageTest.class);
-
- private Destination _destination;
- private AMQSession _session;
- private AMQConnection _connection;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- try
- {
- _connection = (AMQConnection) getConnection("guest", "guest");
- init( _connection );
- }
- catch (Exception e)
- {
- fail("Unable to initialilse connection: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- _connection.close();
- super.tearDown();
- }
-
- private void init(AMQConnection connection) throws Exception
- {
- Destination destination = new AMQQueue(connection, "LargeMessageTest", true);
- init(connection, destination);
- }
-
- private void init(AMQConnection connection, Destination destination) throws Exception
- {
- _destination = destination;
- _session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- connection.start();
- }
-
- // Test boundary of 1 packet to 2 packets
- public void test64kminus1()
- {
- checkLargeMessage((64 * 1024) - 1);
- }
-
- public void test64k()
- {
- checkLargeMessage(64 * 1024);
- }
-
- public void test64kplus1()
- {
- checkLargeMessage((64 * 1024) + 1);
- }
-
- // Test packet boundary of 3 packtes
- public void test128kminus1()
- {
- checkLargeMessage((128 * 1024) - 1);
- }
-
- public void test128k()
- {
- checkLargeMessage(128 * 1024);
- }
-
- public void test128kplus1()
- {
- checkLargeMessage((128 * 1024) + 1);
- }
-
- // Testing larger messages
-
- public void test256k()
- {
- checkLargeMessage(256 * 1024);
- }
-
- public void test512k()
- {
- checkLargeMessage(512 * 1024);
- }
-
- public void test1024k()
- {
- checkLargeMessage(1024 * 1024);
- }
-
- protected void checkLargeMessage(int messageSize)
- {
- try
- {
- MessageConsumer consumer = _session.createConsumer(_destination);
- MessageProducer producer = _session.createProducer(_destination);
- _logger.info("Testing message of size:" + messageSize);
-
- String _messageText = buildLargeMessage(messageSize);
-
- _logger.debug("Message built");
-
- producer.send(_session.createTextMessage(_messageText));
-
- TextMessage result = (TextMessage) consumer.receive(10000);
-
- assertNotNull("Null message recevied", result);
- assertEquals("Message Size", _messageText.length(), result.getText().length());
- assertEquals("Message content differes", _messageText, result.getText());
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("Excpetion occured:" + e.getCause());
- }
- }
-
- private String buildLargeMessage(int size)
- {
- StringBuilder builder = new StringBuilder(size);
-
- char ch = 'a';
-
- for (int i = 1; i <= size; i++)
- {
- builder.append(ch);
-
- if ((i % 1000) == 0)
- {
- ch++;
- if (ch == ('z' + 1))
- {
- ch = 'a';
- }
- }
- }
-
- return builder.toString();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(LargeMessageTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MapMessageTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
deleted file mode 100644
index 390850185c..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
+++ /dev/null
@@ -1,1271 +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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import junit.framework.Assert;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.message.JMSMapMessage;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageFormatException;
-import javax.jms.MessageListener;
-import javax.jms.MessageNotWriteableException;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-public class MapMessageTest extends QpidTestCase implements MessageListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(MapMessageTest.class);
-
- private AMQConnection _connection;
- private Destination _destination;
- private AMQSession _session;
- private final List<JMSMapMessage> received = new ArrayList<JMSMapMessage>();
-
- private static final String MESSAGE = "Message ";
- private int _count = 100;
- public String _connectionString = "vm://:1";
- private byte[] _bytes = { 99, 98, 97, 96, 95 };
- private static final float _smallfloat = 100.0f;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- try
- {
- init((AMQConnection) getConnection("guest", "guest"));
- }
- catch (Exception e)
- {
- fail("Unable to initialilse connection: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- _logger.info("Tearing Down unit.basic.MapMessageTest");
- super.tearDown();
- }
-
- private void init(AMQConnection connection) throws Exception
- {
- Destination destination = new AMQQueue(connection, randomize("MapMessageTest"), true);
- init(connection, destination);
- }
-
- private void init(AMQConnection connection, Destination destination) throws Exception
- {
- _connection = connection;
- _destination = destination;
- _session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // set up a slow consumer
- _session.createConsumer(destination).setMessageListener(this);
- connection.start();
- }
-
- public void test() throws Exception
- {
- int count = _count;
- send(count);
- waitFor(count);
- check();
- _connection.close();
- }
-
- void send(int count) throws JMSException
- {
- // create a publisher
- MessageProducer producer = _session.createProducer(_destination);
- for (int i = 0; i < count; i++)
- {
- MapMessage message = _session.createMapMessage();
-
- setMapValues(message, i);
-
- producer.send(message);
- }
- }
-
- private void setMapValues(MapMessage message, int i) throws JMSException
- {
- message.setBoolean("odd", (i / 2) == 0);
- message.setByte("byte",Byte.MAX_VALUE);
- message.setBytes("bytes", _bytes);
- message.setChar("char",'c');
- message.setDouble("double", Double.MAX_VALUE);
- message.setFloat("float", Float.MAX_VALUE);
- message.setFloat("smallfloat", 100);
- message.setInt("messageNumber", i);
- message.setInt("int", Integer.MAX_VALUE);
- message.setLong("long", Long.MAX_VALUE);
- message.setShort("short", Short.MAX_VALUE);
- message.setString("message", MESSAGE + i);
-
- // Test Setting Object Values
- message.setObject("object-bool", true);
- message.setObject("object-byte", Byte.MAX_VALUE);
- message.setObject("object-bytes", _bytes);
- message.setObject("object-char", 'c');
- message.setObject("object-double", Double.MAX_VALUE);
- message.setObject("object-float", Float.MAX_VALUE);
- message.setObject("object-int", Integer.MAX_VALUE);
- message.setObject("object-long", Long.MAX_VALUE);
- message.setObject("object-short", Short.MAX_VALUE);
-
- // Set a null String value
- message.setString("nullString", null);
- // Highlight protocol problem
- message.setString("emptyString", "");
-
- }
-
- void waitFor(int count) throws Exception
- {
- long waitTime = 30000L;
- long waitUntilTime = System.currentTimeMillis() + 30000L;
-
- synchronized (received)
- {
- while ((received.size() < count) && (waitTime > 0))
- {
- if (received.size() < count)
- {
- received.wait(waitTime);
- }
-
- if (received.size() < count)
- {
- waitTime = waitUntilTime - System.currentTimeMillis();
- }
- }
-
- if (received.size() < count)
- {
- throw new Exception("Timed-out. Waiting for " + count + " only got " + received.size());
- }
- }
- }
-
- void check() throws JMSException
- {
- int count = 0;
- for (JMSMapMessage m : received)
- {
- testMapValues(m, count);
-
- testCorrectExceptions(m);
-
- testMessageWriteStatus(m);
-
- testPropertyWriteStatus(m);
-
- count++;
- }
- }
-
- private void testCorrectExceptions(JMSMapMessage m) throws JMSException
- {
- testBoolean(m);
-
- testByte(m);
-
- testBytes(m);
-
- testChar(m);
-
- testDouble(m);
-
- testFloat(m);
-
- testInt(m);
-
- testLong(m);
-
- testShort(m);
-
- testString(m);
- }
-
- private void testString(JMSMapMessage m) throws JMSException
- {
-
- Assert.assertFalse(m.getBoolean("message"));
-
- try
- {
- m.getByte("message");
- fail("Exception Expected.");
- }
- catch (NumberFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getShort("message");
- fail("Exception Expected.");
- }
- catch (NumberFormatException nfe)
- {
- // normal execution
- }
-
- // Try bad reads
- try
- {
- m.getChar("message");
- fail("Exception Expected.");
- }
- catch (MessageFormatException npe)
- {
- // normal execution
- }
-
- try
- {
- m.getInt("message");
- fail("Exception Expected.");
- }
- catch (NumberFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getLong("message");
- fail("Exception Expected.");
- }
- catch (NumberFormatException nfe)
- {
- // normal execution
- }
-
- // Try bad reads
- try
- {
- m.getFloat("message");
- fail("Exception Expected.");
- }
- catch (NumberFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getDouble("message");
- fail("Exception Expected.");
- }
- catch (NumberFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getBytes("message");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals(MESSAGE + m.getInt("messageNumber"), m.getString("message"));
- }
-
- private void testShort(JMSMapMessage m) throws JMSException
- {
-
- // Try bad reads
- try
- {
- m.getBoolean("short");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getByte("short");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals(Short.MAX_VALUE, m.getShort("short"));
-
- // Try bad reads
- try
- {
- m.getChar("short");
- fail("Exception Expected.");
- }
- catch (MessageFormatException npe)
- {
- // normal execution
- }
-
- Assert.assertEquals(Short.MAX_VALUE, m.getInt("short"));
-
- Assert.assertEquals(Short.MAX_VALUE, m.getLong("short"));
-
- // Try bad reads
- try
- {
- m.getFloat("short");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getDouble("short");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getBytes("short");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals("" + Short.MAX_VALUE, m.getString("short"));
- }
-
- private void testLong(JMSMapMessage m) throws JMSException
- {
-
- // Try bad reads
- try
- {
- m.getBoolean("long");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getByte("long");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getShort("long");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- // Try bad reads
- try
- {
- m.getChar("long");
- fail("Exception Expected.");
- }
- catch (MessageFormatException npe)
- {
- // normal execution
- }
-
- try
- {
- m.getInt("long");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals(Long.MAX_VALUE, m.getLong("long"));
-
- // Try bad reads
- try
- {
- m.getFloat("long");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getDouble("long");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getBytes("long");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals("" + Long.MAX_VALUE, m.getString("long"));
- }
-
- private void testDouble(JMSMapMessage m) throws JMSException
- {
-
- // Try bad reads
- try
- {
- m.getBoolean("double");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getByte("double");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getShort("double");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- // Try bad reads
- try
- {
- m.getChar("double");
- fail("Exception Expected.");
- }
- catch (MessageFormatException npe)
- {
- // normal execution
- }
-
- try
- {
- m.getInt("double");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getLong("double");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- // Try bad reads
- try
- {
- m.getFloat("double");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals(Double.MAX_VALUE, m.getDouble("double"));
-
- // Try bad reads
- try
- {
- m.getBytes("double");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals("" + Double.MAX_VALUE, m.getString("double"));
- }
-
- private void testFloat(JMSMapMessage m) throws JMSException
- {
-
- // Try bad reads
- try
- {
- m.getBoolean("float");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getByte("float");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getShort("float");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- // Try bad reads
- try
- {
- m.getChar("float");
- fail("Exception Expected.");
- }
- catch (MessageFormatException npe)
- {
- // normal execution
- }
-
- try
- {
- m.getInt("float");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getLong("float");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals(Float.MAX_VALUE, m.getFloat("float"));
-
- Assert.assertEquals(_smallfloat, (float) m.getDouble("smallfloat"));
-
- // Try bad reads
- try
- {
- m.getBytes("float");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals("" + Float.MAX_VALUE, m.getString("float"));
- }
-
- private void testInt(JMSMapMessage m) throws JMSException
- {
-
- // Try bad reads
- try
- {
- m.getBoolean("int");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getByte("int");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getShort("int");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- // Try bad reads
- try
- {
- m.getChar("int");
- fail("Exception Expected.");
- }
- catch (MessageFormatException npe)
- {
- // normal execution
- }
-
- Assert.assertEquals(Integer.MAX_VALUE, m.getInt("int"));
-
- Assert.assertEquals(Integer.MAX_VALUE, (int) m.getLong("int"));
-
- // Try bad reads
- try
- {
- m.getFloat("int");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getDouble("int");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getBytes("int");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals("" + Integer.MAX_VALUE, m.getString("int"));
- }
-
- private void testChar(JMSMapMessage m) throws JMSException
- {
-
- // Try bad reads
- try
- {
- m.getBoolean("char");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getByte("char");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getShort("char");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals('c', m.getChar("char"));
-
- try
- {
- m.getInt("char");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getLong("char");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- // Try bad reads
- try
- {
- m.getFloat("char");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getDouble("char");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getBytes("char");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals("" + 'c', m.getString("char"));
- }
-
- private void testBytes(JMSMapMessage m) throws JMSException
- {
- // Try bad reads
- try
- {
- m.getBoolean("bytes");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getByte("bytes");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getShort("bytes");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- // Try bad reads
- try
- {
- m.getChar("bytes");
- fail("Exception Expected.");
- }
- catch (MessageFormatException npe)
- {
- // normal execution
- }
-
- try
- {
- m.getInt("bytes");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- try
- {
- m.getLong("bytes");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- // Try bad reads
- try
- {
- m.getFloat("bytes");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getDouble("bytes");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- assertBytesEqual(_bytes, m.getBytes("bytes"));
-
- try
- {
- m.getString("bytes");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- }
-
- private void testByte(JMSMapMessage m) throws JMSException
- {
- // Try bad reads
- try
- {
- m.getBoolean("byte");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals(Byte.MAX_VALUE, m.getByte("byte"));
-
- Assert.assertEquals((short) Byte.MAX_VALUE, m.getShort("byte"));
-
- // Try bad reads
- try
- {
- m.getChar("byte");
- fail("Exception Expected.");
- }
- catch (MessageFormatException npe)
- {
- // normal execution
- }
-
- // Reading a byte as an int is ok
- Assert.assertEquals((short) Byte.MAX_VALUE, m.getInt("byte"));
-
- Assert.assertEquals((short) Byte.MAX_VALUE, m.getLong("byte"));
-
- // Try bad reads
- try
- {
- m.getFloat("byte");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getDouble("byte");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getBytes("byte");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals("" + Byte.MAX_VALUE, m.getString("byte"));
-
- }
-
- private void testBoolean(JMSMapMessage m) throws JMSException
- {
-
- Assert.assertEquals((m.getInt("messageNumber") / 2) == 0, m.getBoolean("odd"));
-
- // Try bad reads
- try
- {
- m.getByte("odd");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- // Try bad reads
- try
- {
- m.getShort("odd");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getChar("odd");
- fail("Exception Expected.");
- }
- catch (MessageFormatException npe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getInt("odd");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getLong("odd");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getFloat("odd");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getDouble("odd");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
- // Try bad reads
- try
- {
- m.getBytes("odd");
- fail("Exception Expected.");
- }
- catch (MessageFormatException nfe)
- {
- // normal execution
- }
-
- Assert.assertEquals("" + ((m.getInt("messageNumber") / 2) == 0), m.getString("odd"));
- }
-
- private void testPropertyWriteStatus(JMSMapMessage m) throws JMSException
- {
- // Check property write status
- try
- {
- m.setStringProperty("test", "test");
- Assert.fail("Message should not be writeable");
- }
- catch (MessageNotWriteableException mnwe)
- {
- // normal execution
- }
-
- m.clearProperties();
-
- try
- {
- m.setStringProperty("test", "test");
- }
- catch (MessageNotWriteableException mnwe)
- {
- Assert.fail("Message should be writeable");
- }
- }
-
- private void testMessageWriteStatus(JMSMapMessage m) throws JMSException
- {
- try
- {
- m.setInt("testint", 3);
- fail("Message should not be writeable");
- }
- catch (MessageNotWriteableException mnwe)
- {
- // normal execution
- }
-
- m.clearBody();
-
- try
- {
- m.setInt("testint", 3);
- }
- catch (MessageNotWriteableException mnwe)
- {
- Assert.fail("Message should be writeable");
- }
- }
-
- private void testMapValues(JMSMapMessage m, int count) throws JMSException
- {
- // Test get<Primiative>
-
- // Boolean
- assertEqual((count / 2) == 0, m.getBoolean("odd"));
- assertEqual("" + ((count / 2) == 0), m.getString("odd"));
-
- // Byte
- assertEqual(Byte.MAX_VALUE, m.getByte("byte"));
- assertEqual("" + Byte.MAX_VALUE, m.getString("byte"));
-
- // Bytes
- assertBytesEqual(_bytes, m.getBytes("bytes"));
-
- // Char
- assertEqual('c', m.getChar("char"));
-
- // Double
- assertEqual(Double.MAX_VALUE, m.getDouble("double"));
- assertEqual("" + Double.MAX_VALUE, m.getString("double"));
-
- // Float
- assertEqual(Float.MAX_VALUE, m.getFloat("float"));
- assertEqual(_smallfloat, (float) m.getDouble("smallfloat"));
- assertEqual("" + Float.MAX_VALUE, m.getString("float"));
-
- // Integer
- assertEqual(Integer.MAX_VALUE, m.getInt("int"));
- assertEqual("" + Integer.MAX_VALUE, m.getString("int"));
- assertEqual(count, m.getInt("messageNumber"));
-
- // long
- assertEqual(Long.MAX_VALUE, m.getLong("long"));
- assertEqual("" + Long.MAX_VALUE, m.getString("long"));
-
- // Short
- assertEqual(Short.MAX_VALUE, m.getShort("short"));
- assertEqual("" + Short.MAX_VALUE, m.getString("short"));
- assertEqual((int) Short.MAX_VALUE, m.getInt("short"));
-
- // String
- assertEqual(MESSAGE + count, m.getString("message"));
-
- // Test getObjects
- assertEqual(true, m.getObject("object-bool"));
- assertEqual(Byte.MAX_VALUE, m.getObject("object-byte"));
- assertBytesEqual(_bytes, (byte[]) m.getObject("object-bytes"));
- assertEqual('c', m.getObject("object-char"));
- assertEqual(Double.MAX_VALUE, m.getObject("object-double"));
- assertEqual(Float.MAX_VALUE, m.getObject("object-float"));
- assertEqual(Integer.MAX_VALUE, m.getObject("object-int"));
- assertEqual(Long.MAX_VALUE, m.getObject("object-long"));
- assertEqual(Short.MAX_VALUE, m.getObject("object-short"));
-
- // Check Special values
- assertTrue(m.getString("nullString") == null);
- assertEqual("", m.getString("emptyString"));
- }
-
- private void assertBytesEqual(byte[] expected, byte[] actual)
- {
- Assert.assertEquals(expected.length, actual.length);
-
- for (int index = 0; index < expected.length; index++)
- {
- Assert.assertEquals(expected[index], actual[index]);
- }
- }
-
- private static void assertEqual(Iterator expected, Iterator actual)
- {
- List<String> errors = new ArrayList<String>();
- while (expected.hasNext() && actual.hasNext())
- {
- try
- {
- assertEqual(expected.next(), actual.next());
- }
- catch (Exception e)
- {
- errors.add(e.getMessage());
- }
- }
- while (expected.hasNext())
- {
- errors.add("Expected " + expected.next() + " but no more actual values.");
- }
- while (actual.hasNext())
- {
- errors.add("Found " + actual.next() + " but no more expected values.");
- }
-
- if (!errors.isEmpty())
- {
- throw new RuntimeException(errors.toString());
- }
- }
-
- private static void assertEqual(Object expected, Object actual)
- {
- if (!expected.equals(actual))
- {
- throw new RuntimeException("Expected '" + expected + "' found '" + actual + "'");
- }
- }
-
- public void onMessage(Message message)
- {
- synchronized (received)
- {
- _logger.info("****************** Recevied Messgage:" + message);
- received.add((JMSMapMessage) message);
- received.notify();
- }
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- public static void main(String[] argv) throws Exception
- {
- MapMessageTest test = new MapMessageTest();
- test._connectionString = (argv.length == 0) ? "vm://:1" : argv[0];
- test.setUp();
- if (argv.length > 1)
- {
- test._count = Integer.parseInt(argv[1]);
- }
-
- test.test();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(MapMessageTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java
deleted file mode 100644
index 658cf26135..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java
+++ /dev/null
@@ -1,230 +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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-public class MultipleConnectionTest extends QpidTestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(MultipleConnectionTest.class);
-
- public static final String _defaultBroker = "vm://:1";
- public String _connectionString = _defaultBroker;
-
- private class Receiver
- {
- private AMQConnection _connection;
- private Session[] _sessions;
- private MessageCounter[] _counters;
-
- Receiver(String broker, AMQDestination dest, int sessions) throws Exception
- {
- this((AMQConnection) getConnection("guest", "guest"), dest, sessions);
- }
-
- Receiver(AMQConnection connection, AMQDestination dest, int sessions) throws Exception
- {
- _connection = connection;
- _sessions = new AMQSession[sessions];
- _counters = new MessageCounter[sessions];
- for (int i = 0; i < sessions; i++)
- {
- _sessions[i] = _connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- _counters[i] = new MessageCounter(_sessions[i].toString());
- _sessions[i].createConsumer(dest).setMessageListener(_counters[i]);
- }
-
- _connection.start();
- }
-
- void close() throws JMSException
- {
- _connection.close();
- }
- }
-
- private class Publisher
- {
- private AMQConnection _connection;
- private Session _session;
- private MessageProducer _producer;
-
- Publisher(String broker, AMQDestination dest) throws Exception
- {
- this((AMQConnection) getConnection("guest", "guest"), dest);
- }
-
- Publisher(AMQConnection connection, AMQDestination dest) throws Exception
- {
- _connection = connection;
- _session = _connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- _producer = _session.createProducer(dest);
- }
-
- void send(String msg) throws JMSException
- {
- _producer.send(_session.createTextMessage(msg));
- }
-
- void close() throws JMSException
- {
- _connection.close();
- }
- }
-
- private static class MessageCounter implements MessageListener
- {
- private final String _name;
- private int _count;
-
- MessageCounter(String name)
- {
- _name = name;
- }
-
- public synchronized void onMessage(Message message)
- {
- _count++;
- notify();
- }
-
- synchronized boolean waitUntil(int expected, long maxWait) throws InterruptedException
- {
- long start = System.currentTimeMillis();
- while (expected > _count)
- {
- long timeLeft = maxWait - timeSince(start);
- if (timeLeft < 0)
- {
- break;
- }
-
- wait(timeLeft);
- }
-
- return expected <= _count;
- }
-
- private long timeSince(long start)
- {
- return System.currentTimeMillis() - start;
- }
-
- public synchronized String toString()
- {
- return _name + ": " + _count;
- }
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- private static void waitForCompletion(int expected, long wait, Receiver[] receivers) throws InterruptedException
- {
- for (int i = 0; i < receivers.length; i++)
- {
- waitForCompletion(expected, wait, receivers[i]._counters);
- }
- }
-
- private static void waitForCompletion(int expected, long wait, MessageCounter[] counters) throws InterruptedException
- {
- for (int i = 0; i < counters.length; i++)
- {
- if (!counters[i].waitUntil(expected, wait))
- {
- throw new RuntimeException("Expected: " + expected + " got " + counters[i]);
- }
- }
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- public static void main(String[] argv) throws Exception
- {
- String broker = (argv.length > 0) ? argv[0] : _defaultBroker;
-
- MultipleConnectionTest test = new MultipleConnectionTest();
- test._connectionString = broker;
- test.test();
- }
-
- public void test() throws Exception
- {
- String broker = _connectionString;
- int messages = 10;
-
- AMQTopic topic = new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME, "amq.topic");
-
- Receiver[] receivers = new Receiver[] { new Receiver(broker, topic, 2), new Receiver(broker, topic, 14) };
-
- Publisher publisher = new Publisher(broker, topic);
- for (int i = 0; i < messages; i++)
- {
- publisher.send("Message " + (i + 1));
- }
-
- try
- {
- waitForCompletion(messages, 5000, receivers);
- _logger.info("All receivers received all expected messages");
- }
- finally
- {
- publisher.close();
- for (int i = 0; i < receivers.length; i++)
- {
- receivers[i].close();
- }
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(MultipleConnectionTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.java
deleted file mode 100644
index d2965bd52a..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.java
+++ /dev/null
@@ -1,278 +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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import junit.framework.Assert;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.message.JMSObjectMessage;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageNotWriteableException;
-import javax.jms.MessageProducer;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-public class ObjectMessageTest extends QpidTestCase implements MessageListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(ObjectMessageTest.class);
-
- private AMQConnection _connection;
- private AMQDestination _destination;
- private AMQSession _session;
- private final List<JMSObjectMessage> received = new ArrayList<JMSObjectMessage>();
- private final List<Payload> messages = new ArrayList<Payload>();
- private int _count = 100;
- public String _connectionString = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- try
- {
- init( (AMQConnection) getConnection("guest", "guest"));
- }
- catch (Exception e)
- {
- fail("Uable to initialise: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- private void init(AMQConnection connection) throws Exception
- {
- init(connection, new AMQQueue(connection, randomize("ObjectMessageTest"), true));
- }
-
- private void init(AMQConnection connection, AMQDestination destination) throws Exception
- {
- _connection = connection;
- _destination = destination;
- _session = (AMQSession) connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
-
- // set up a slow consumer
- _session.createConsumer(destination).setMessageListener(this);
- connection.start();
- }
-
- public void test() throws Exception
- {
- int count = _count;
- send(count);
- waitFor(count);
- check();
- _logger.info("Completed without failure");
- _connection.close();
- }
-
- void send(int count) throws JMSException
- {
- // create a publisher
- MessageProducer producer = _session.createProducer(_destination);
- for (int i = 0; i < count; i++)
- {
- Payload payload = new Payload("Message " + i);
- messages.add(payload);
- producer.send(_session.createObjectMessage(payload));
- }
- }
-
- void waitFor(int count) throws InterruptedException
- {
- synchronized (received)
- {
- long endTime = System.currentTimeMillis() + 30000L;
- while (received.size() < count)
- {
- received.wait(30000);
- if(received.size() < count && System.currentTimeMillis() > endTime)
- {
- throw new RuntimeException("Only received " + received.size() + " messages, was expecting " + count);
- }
- }
- }
- }
-
- void check() throws JMSException
- {
- List<Object> actual = new ArrayList<Object>();
- for (JMSObjectMessage m : received)
- {
- actual.add(m.getObject());
-
- try
- {
- m.setObject("Test text");
- Assert.fail("Message should not be writeable");
- }
- catch (MessageNotWriteableException mnwe)
- {
- // normal execution
- }
-
- m.clearBody();
-
- try
- {
- m.setObject("Test text");
- }
- catch (MessageNotWriteableException mnwe)
- {
- Assert.fail("Message should be writeable");
- }
-
- // Check property write status
- try
- {
- m.setStringProperty("test", "test");
- Assert.fail("Message should not be writeable");
- }
- catch (MessageNotWriteableException mnwe)
- {
- // normal execution
- }
-
- m.clearProperties();
-
- try
- {
- m.setStringProperty("test", "test");
- }
- catch (MessageNotWriteableException mnwe)
- {
- Assert.fail("Message should be writeable");
- }
-
- }
-
- assertEqual(messages.iterator(), actual.iterator());
-
- }
-
- private static void assertEqual(Iterator expected, Iterator actual)
- {
- List<String> errors = new ArrayList<String>();
- while (expected.hasNext() && actual.hasNext())
- {
- try
- {
- assertEqual(expected.next(), actual.next());
- }
- catch (Exception e)
- {
- errors.add(e.getMessage());
- }
- }
- while (expected.hasNext())
- {
- errors.add("Expected " + expected.next() + " but no more actual values.");
- }
- while (actual.hasNext())
- {
- errors.add("Found " + actual.next() + " but no more expected values.");
- }
-
- if (!errors.isEmpty())
- {
- throw new RuntimeException(errors.toString());
- }
- }
-
- private static void assertEqual(Object expected, Object actual)
- {
- if (!expected.equals(actual))
- {
- throw new RuntimeException("Expected '" + expected + "' found '" + actual + "'");
- }
- }
-
- public void onMessage(Message message)
- {
- synchronized (received)
- {
- received.add((JMSObjectMessage) message);
- received.notify();
- }
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- private static class Payload implements Serializable
- {
- private final String data;
-
- Payload(String data)
- {
- this.data = data;
- }
-
- public int hashCode()
- {
- return data.hashCode();
- }
-
- public boolean equals(Object o)
- {
- return (o instanceof Payload) && ((Payload) o).data.equals(data);
- }
-
- public String toString()
- {
- return "Payload[" + data + "]";
- }
- }
-
- public static void main(String[] argv) throws Exception
- {
- ObjectMessageTest test = new ObjectMessageTest();
- test._connectionString = (argv.length == 0) ? "vm://:1" : argv[0];
- test.setUp();
- if (argv.length > 1)
- {
- test._count = Integer.parseInt(argv[1]);
- }
-
- test.test();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(ObjectMessageTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java
deleted file mode 100644
index 96a162dec3..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java
+++ /dev/null
@@ -1,408 +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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import junit.framework.Assert;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.message.JMSTextMessage;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.url.BindingURL;
-import org.apache.qpid.url.AMQBindingURL;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageFormatException;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.net.URISyntaxException;
-
-import java.lang.reflect.*;
-
-public class PropertyValueTest extends QpidTestCase implements MessageListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(PropertyValueTest.class);
-
- private int count = 0;
- private AMQConnection _connection;
- private Destination _destination;
- private AMQSession _session;
- private final List<JMSTextMessage> received = new ArrayList<JMSTextMessage>();
- private final List<String> messages = new ArrayList<String>();
- private int _count = 1;
- public String _connectionString = "vm://:1";
- private static final String USERNAME = "guest";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- private void init(AMQConnection connection) throws Exception
- {
- Destination destination = new AMQQueue(connection, randomize("PropertyValueTest"), true);
- init(connection, destination);
- }
-
- private void init(AMQConnection connection, Destination destination) throws Exception
- {
- _connection = connection;
- _destination = destination;
- _session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // set up a slow consumer
- _session.createConsumer(destination).setMessageListener(this);
- connection.start();
- }
-
- private Message getTestMessage() throws Exception
- {
- Connection conn = getConnection();
- Session ssn = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
- return ssn.createTextMessage();
- }
-
- public void testGetNonexistent() throws Exception
- {
- Message m = getTestMessage();
- String s = m.getStringProperty("nonexistent");
- assertNull(s);
- }
-
- private static final String[] NAMES = {
- "setBooleanProperty", "setByteProperty", "setShortProperty",
- "setIntProperty", "setLongProperty", "setFloatProperty",
- "setDoubleProperty", "setObjectProperty"
- };
-
- private static final Class[] TYPES = {
- boolean.class, byte.class, short.class, int.class, long.class,
- float.class, double.class, Object.class
- };
-
- private static final Object[] VALUES = {
- true, (byte) 0, (short) 0, 0, (long) 0, (float) 0, (double) 0,
- new Object()
- };
-
- public void testSetEmptyPropertyName() throws Exception
- {
- Message m = getTestMessage();
-
- for (int i = 0; i < NAMES.length; i++)
- {
- Method meth = m.getClass().getMethod(NAMES[i], String.class, TYPES[i]);
- try
- {
- meth.invoke(m, "", VALUES[i]);
- fail("expected illegal argument exception");
- }
- catch (InvocationTargetException e)
- {
- assertEquals(e.getCause().getClass(), IllegalArgumentException.class);
- }
- }
- }
-
- public void testSetDisallowedClass() throws Exception
- {
- Message m = getTestMessage();
- try
- {
- m.setObjectProperty("foo", new Object());
- fail("expected a MessageFormatException");
- }
- catch (MessageFormatException e)
- {
- // pass
- }
- }
-
- public void testOnce()
- {
- runBatch(1);
- }
-
- public void test50()
- {
- runBatch(50);
- }
-
- private void runBatch(int runSize)
- {
- try
- {
- int run = 0;
- while (run < runSize)
- {
- _logger.error("Run Number:" + run++);
- try
- {
- init( (AMQConnection) getConnection("guest", "guest"));
- }
- catch (Exception e)
- {
- _logger.error("exception:", e);
- fail("Unable to initialilse connection: " + e);
- }
-
- int count = _count;
- send(count);
- waitFor(count);
- check();
- _logger.info("Completed without failure");
-
- Thread.sleep(10);
- _connection.close();
-
- _logger.error("End Run Number:" + (run - 1));
- }
- }
- catch (Exception e)
- {
- _logger.error(e.getMessage(), e);
- e.printStackTrace();
- }
- }
-
- void send(int count) throws JMSException
- {
- // create a publisher
- MessageProducer producer = _session.createProducer(_destination);
- for (int i = 0; i < count; i++)
- {
- String text = "Message " + i;
- messages.add(text);
- Message m = _session.createTextMessage(text);
-
- m.setBooleanProperty("Bool", true);
-
- m.setByteProperty("Byte", (byte) Byte.MAX_VALUE);
- m.setDoubleProperty("Double", (double) Double.MAX_VALUE);
- m.setFloatProperty("Float", (float) Float.MAX_VALUE);
- m.setIntProperty("Int", (int) Integer.MAX_VALUE);
-
- m.setJMSCorrelationID("Correlation");
- // fixme the m.setJMSMessage has no effect
- producer.setPriority(8);
- m.setJMSPriority(3);
-
- // Queue
- Queue q;
-
- if ((i / 2) == 0)
- {
- q = _session.createTemporaryQueue();
- }
- else
- {
- q = new AMQQueue(_connection, "TestReply");
- }
-
- m.setJMSReplyTo(q);
- m.setStringProperty("TempQueue", q.toString());
-
- _logger.debug("Message:" + m);
-
- Assert.assertEquals("Check temp queue has been set correctly", m.getJMSReplyTo().toString(),
- m.getStringProperty("TempQueue"));
-
- m.setJMSType("Test");
- m.setLongProperty("UnsignedInt", (long) 4294967295L);
- m.setLongProperty("Long", (long) Long.MAX_VALUE);
-
- m.setShortProperty("Short", (short) Short.MAX_VALUE);
- m.setStringProperty("String", "Test");
-
- _logger.debug("Sending Msg:" + m);
- producer.send(m);
- }
- }
-
- void waitFor(int count) throws InterruptedException
- {
- synchronized (received)
- {
- while (received.size() < count)
- {
- received.wait();
- }
- }
- }
-
- void check() throws JMSException, URISyntaxException
- {
- List<String> actual = new ArrayList<String>();
- for (JMSTextMessage m : received)
- {
- actual.add(m.getText());
-
- // Check Properties
-
- Assert.assertEquals("Check Boolean properties are correctly transported", true, m.getBooleanProperty("Bool"));
- Assert.assertEquals("Check Byte properties are correctly transported", (byte) Byte.MAX_VALUE,
- m.getByteProperty("Byte"));
- Assert.assertEquals("Check Double properties are correctly transported", (double) Double.MAX_VALUE,
- m.getDoubleProperty("Double"));
- Assert.assertEquals("Check Float properties are correctly transported", (float) Float.MAX_VALUE,
- m.getFloatProperty("Float"));
- Assert.assertEquals("Check Int properties are correctly transported", (int) Integer.MAX_VALUE,
- m.getIntProperty("Int"));
- Assert.assertEquals("Check CorrelationID properties are correctly transported", "Correlation",
- m.getJMSCorrelationID());
- Assert.assertEquals("Check Priority properties are correctly transported", 8, m.getJMSPriority());
-
- // Queue
- Assert.assertEquals("Check ReplyTo properties are correctly transported", AMQDestination.createDestination(new AMQBindingURL(m.getStringProperty("TempQueue"))),
- m.getJMSReplyTo());
-
- Assert.assertEquals("Check Type properties are correctly transported", "Test", m.getJMSType());
-
- Assert.assertEquals("Check Short properties are correctly transported", (short) Short.MAX_VALUE,
- m.getShortProperty("Short"));
- Assert.assertEquals("Check UnsignedInt properties are correctly transported", (long) 4294967295L,
- m.getLongProperty("UnsignedInt"));
- Assert.assertEquals("Check Long properties are correctly transported", (long) Long.MAX_VALUE,
- m.getLongProperty("Long"));
- Assert.assertEquals("Check String properties are correctly transported", "Test", m.getStringProperty("String"));
-/*
- // AMQP Tests Specific values
-
- Assert.assertEquals("Check Timestamp properties are correctly transported", m.getStringProperty("time-str"),
- ((AMQMessage) m).getTimestampProperty(new AMQShortString("time")).toString());
-
- // Decimal
- BigDecimal bd = new BigDecimal(Integer.MAX_VALUE);
-
- Assert.assertEquals("Check decimal properties are correctly transported", bd.setScale(Byte.MAX_VALUE),
- ((AMQMessage) m).getDecimalProperty(new AMQShortString("decimal")));
-
- // Void
- ((AMQMessage) m).setVoidProperty(new AMQShortString("void"));
-
- Assert.assertTrue("Check void properties are correctly transported",
- ((AMQMessage) m).getPropertyHeaders().containsKey("void"));
-*/
- //JMSXUserID
- if (m.getStringProperty("JMSXUserID") != null)
- {
- Assert.assertEquals("Check 'JMSXUserID' is supported ", USERNAME,
- m.getStringProperty("JMSXUserID"));
- }
- }
-
- received.clear();
-
- assertEqual(messages.iterator(), actual.iterator());
-
- messages.clear();
- }
-
- private static void assertEqual(Iterator expected, Iterator actual)
- {
- List<String> errors = new ArrayList<String>();
- while (expected.hasNext() && actual.hasNext())
- {
- try
- {
- assertEqual(expected.next(), actual.next());
- }
- catch (Exception e)
- {
- errors.add(e.getMessage());
- }
- }
- while (expected.hasNext())
- {
- errors.add("Expected " + expected.next() + " but no more actual values.");
- }
- while (actual.hasNext())
- {
- errors.add("Found " + actual.next() + " but no more expected values.");
- }
-
- if (!errors.isEmpty())
- {
- throw new RuntimeException(errors.toString());
- }
- }
-
- private static void assertEqual(Object expected, Object actual)
- {
- if (!expected.equals(actual))
- {
- throw new RuntimeException("Expected '" + expected + "' found '" + actual + "'");
- }
- }
-
- public void onMessage(Message message)
- {
- synchronized (received)
- {
- received.add((JMSTextMessage) message);
- received.notify();
- }
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- public static void main(String[] argv) throws Exception
- {
- PropertyValueTest test = new PropertyValueTest();
- test._connectionString = (argv.length == 0) ? "vm://:1" : argv[0];
- test.setUp();
- if (argv.length > 1)
- {
- test._count = Integer.parseInt(argv[1]);
- }
-
- test.testOnce();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(PropertyValueTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PubSubTwoConnectionTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PubSubTwoConnectionTest.java
deleted file mode 100644
index 66c5a5b07e..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/PubSubTwoConnectionTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import javax.jms.Connection;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-/**
- * @author Apache Software Foundation
- */
-public class PubSubTwoConnectionTest extends QpidTestCase
-{
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- /**
- * This tests that a consumer is set up synchronously
- * @throws Exception
- */
- public void testTwoConnections() throws Exception
- {
-
- AMQConnection con1 = (AMQConnection) getConnection("guest", "guest");
-
- Topic topic = new AMQTopic(con1, "MyTopic");
-
- Session session1 = con1.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- MessageProducer producer = session1.createProducer(topic);
-
- Connection con2 = (AMQConnection) getConnection("guest", "guest") ;
- Session session2 = con2.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- MessageConsumer consumer = session2.createConsumer(topic);
- con2.start();
- producer.send(session1.createTextMessage("Hello"));
- TextMessage tm1 = (TextMessage) consumer.receive(2000);
- assertNotNull(tm1);
- assertEquals("Hello", tm1.getText());
- con1.close();
- con2.close();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ReceiveTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ReceiveTest.java
deleted file mode 100644
index eec3db8c5f..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/ReceiveTest.java
+++ /dev/null
@@ -1,82 +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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import javax.jms.MessageConsumer;
-import javax.jms.Message;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-public class ReceiveTest extends QpidTestCase
-{
- private AMQConnection _connection;
- private AMQDestination _destination;
- private AMQSession _session;
- private MessageConsumer _consumer;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- init((AMQConnection) getConnection("guest", "guest"));
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- private void init(AMQConnection connection) throws Exception
- {
- init(connection, new AMQQueue(connection,"ReceiveTest", true));
- }
-
- private void init(AMQConnection connection, AMQDestination destination) throws Exception
- {
- _connection = connection;
- _destination = destination;
- _session = (AMQSession) connection.createSession(true, AMQSession.NO_ACKNOWLEDGE);
- _consumer = _session.createConsumer(_destination);
- _connection.start();
- }
-
- public void test() throws Exception
- {
- Message m = _consumer.receive(5000);
- assertNull("should not have received a message", m);
- _connection.close();
- }
-
-
- public static junit.framework.Test suite()
- {
- // TODO: note that this test doesn't use the VMBrokerSetup
- // test helper class to create and tear down its
- // VMBroker. This is because the main() above seems to
- // indicate that it's also used outside of the surefire test
- // framework. If it isn't, then this test should also be
- // changed to use VMBrokerSetup here.
- return new junit.framework.TestSuite(ReceiveTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/SelectorTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/SelectorTest.java
deleted file mode 100644
index c42e4c7582..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/SelectorTest.java
+++ /dev/null
@@ -1,306 +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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.BasicMessageProducer;
-import org.apache.qpid.client.state.StateWaiter;
-import org.apache.qpid.url.URLSyntaxException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.InvalidSelectorException;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import java.util.concurrent.CountDownLatch;
-
-public class SelectorTest extends QpidTestCase implements MessageListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(SelectorTest.class);
-
- private AMQConnection _connection;
- private AMQDestination _destination;
- private AMQSession _session;
- private int count;
- public String _connectionString = "vm://:1";
- private static final String INVALID_SELECTOR = "Cost LIKE 5";
- CountDownLatch _responseLatch = new CountDownLatch(1);
-
- protected void setUp() throws Exception
- {
- super.setUp();
- init((AMQConnection) getConnection("guest", "guest"));
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- private void init(AMQConnection connection) throws JMSException
- {
- init(connection, new AMQQueue(connection, randomize("SessionStartTest"), true));
- }
-
- private void init(AMQConnection connection, AMQDestination destination) throws JMSException
- {
- _connection = connection;
- _destination = destination;
- connection.start();
-
- String selector = null;
- selector = "Cost = 2 AND \"property-with-hyphen\" = 'wibble'";
- // selector = "JMSType = Special AND Cost = 2 AND AMQMessageID > 0 AND JMSDeliveryMode=" + DeliveryMode.NON_PERSISTENT;
-
- _session = (AMQSession) connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- // _session.createConsumer(destination).setMessageListener(this);
- _session.createConsumer(destination, selector).setMessageListener(this);
- }
-
- public void test() throws Exception
- {
- try
- {
-
- init((AMQConnection) getConnection("guest", "guest", randomize("Client")));
-
- Message msg = _session.createTextMessage("Message");
- msg.setJMSPriority(1);
- msg.setIntProperty("Cost", 2);
- msg.setStringProperty("property-with-hyphen", "wibble");
- msg.setJMSType("Special");
-
- _logger.info("Sending Message:" + msg);
-
- ((BasicMessageProducer) _session.createProducer(_destination)).send(msg, DeliveryMode.NON_PERSISTENT);
- _logger.info("Message sent, waiting for response...");
-
- _responseLatch.await();
-
- if (count > 0)
- {
- _logger.info("Got message");
- }
-
- if (count == 0)
- {
- fail("Did not get message!");
- // throw new RuntimeException("Did not get message!");
- }
- }
- catch (JMSException e)
- {
- _logger.debug("JMS:" + e.getClass().getSimpleName() + ":" + e.getMessage());
- if (!(e instanceof InvalidSelectorException))
- {
- fail("Wrong exception:" + e.getMessage());
- }
- else
- {
- System.out.println("SUCCESS!!");
- }
- }
- catch (InterruptedException e)
- {
- _logger.debug("IE :" + e.getClass().getSimpleName() + ":" + e.getMessage());
- }
- catch (URLSyntaxException e)
- {
- _logger.debug("URL:" + e.getClass().getSimpleName() + ":" + e.getMessage());
- fail("Wrong exception");
- }
- catch (AMQException e)
- {
- _logger.debug("AMQ:" + e.getClass().getSimpleName() + ":" + e.getMessage());
- fail("Wrong exception");
- }
-
- finally
- {
- if (_session != null)
- {
- _session.close();
- }
- if (_connection != null)
- {
- _connection.close();
- }
- }
- }
-
-
- public void testInvalidSelectors() throws Exception
- {
- Connection connection = null;
-
- try
- {
- connection = getConnection("guest", "guest", randomize("Client"));
- _session = (AMQSession) connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- }
- catch (JMSException e)
- {
- fail(e.getMessage());
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
- catch (URLSyntaxException e)
- {
- fail("Error:" + e.getMessage());
- }
-
- //Try Creating a Browser
- try
- {
- _session.createBrowser(_session.createQueue("Ping"), INVALID_SELECTOR);
- }
- catch (JMSException e)
- {
- _logger.debug("JMS:" + e.getClass().getSimpleName() + ":" + e.getMessage());
- if (!(e instanceof InvalidSelectorException))
- {
- fail("Wrong exception:" + e.getMessage());
- }
- else
- {
- _logger.debug("SUCCESS!!");
- }
- }
-
- //Try Creating a Consumer
- try
- {
- _session.createConsumer(_session.createQueue("Ping"), INVALID_SELECTOR);
- }
- catch (JMSException e)
- {
- _logger.debug("JMS:" + e.getClass().getSimpleName() + ":" + e.getMessage());
- if (!(e instanceof InvalidSelectorException))
- {
- fail("Wrong exception:" + e.getMessage());
- }
- else
- {
- _logger.debug("SUCCESS!!");
- }
- }
-
- //Try Creating a Receiever
- try
- {
- _session.createReceiver(_session.createQueue("Ping"), INVALID_SELECTOR);
- }
- catch (JMSException e)
- {
- _logger.debug("JMS:" + e.getClass().getSimpleName() + ":" + e.getMessage());
- if (!(e instanceof InvalidSelectorException))
- {
- fail("Wrong exception:" + e.getMessage());
- }
- else
- {
- _logger.debug("SUCCESS!!");
- }
- }
-
- finally
- {
- if (_session != null)
- {
- try
- {
- _session.close();
- }
- catch (JMSException e)
- {
- fail("Error cleaning up:" + e.getMessage());
- }
- }
- if (_connection != null)
- {
- try
- {
- _connection.close();
- }
- catch (JMSException e)
- {
- fail("Error cleaning up:" + e.getMessage());
- }
- }
- }
- }
-
- public void onMessage(Message message)
- {
- count++;
- _logger.info("Got Message:" + message);
- _responseLatch.countDown();
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- public static void main(String[] argv) throws Exception
- {
- SelectorTest test = new SelectorTest();
- test._connectionString = (argv.length == 0) ? "localhost:3000" : argv[0];
-
- try
- {
- while (true)
- {
- if (test._connectionString.contains("vm://:1"))
- {
- test.setUp();
- }
- test.test();
-
- if (test._connectionString.contains("vm://:1"))
- {
- test.tearDown();
- }
- }
- }
- catch (Exception e)
- {
- System.err.println(e.getMessage());
- e.printStackTrace();
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(SelectorTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/SessionStartTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/SessionStartTest.java
deleted file mode 100644
index 10320914fe..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/SessionStartTest.java
+++ /dev/null
@@ -1,115 +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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-
-public class SessionStartTest extends QpidTestCase implements MessageListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(SessionStartTest.class);
-
- private AMQConnection _connection;
- private AMQDestination _destination;
- private AMQSession _session;
- private int count;
- public String _connectionString = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- init((AMQConnection) getConnection("guest", "guest"));
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- private void init(AMQConnection connection) throws Exception
- {
- init(connection,
- new AMQQueue(connection.getDefaultQueueExchangeName(), new AMQShortString(randomize("SessionStartTest")), true));
- }
-
- private void init(AMQConnection connection, AMQDestination destination) throws Exception
- {
- _connection = connection;
- _destination = destination;
- connection.start();
-
- _session = (AMQSession) connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- _session.createConsumer(destination).setMessageListener(this);
- }
-
- public synchronized void test() throws JMSException, InterruptedException
- {
- try
- {
- _session.createProducer(_destination).send(_session.createTextMessage("Message"));
- _logger.info("Message sent, waiting for response...");
- wait(1000);
- if (count > 0)
- {
- _logger.info("Got message");
- }
- else
- {
- throw new RuntimeException("Did not get message!");
- }
- }
- finally
- {
- _session.close();
- _connection.close();
- }
- }
-
- public synchronized void onMessage(Message message)
- {
- count++;
- notify();
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- public static void main(String[] argv) throws Exception
- {
- SessionStartTest test = new SessionStartTest();
- test._connectionString = (argv.length == 0) ? "localhost:5672" : argv[0];
- test.setUp();
- test.test();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/TextMessageTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/TextMessageTest.java
deleted file mode 100644
index 29943161d4..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/TextMessageTest.java
+++ /dev/null
@@ -1,248 +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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import junit.framework.Assert;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.message.JMSTextMessage;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageNotWriteableException;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-public class TextMessageTest extends QpidTestCase implements MessageListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(TextMessageTest.class);
-
- private AMQConnection _connection;
- private Destination _destination;
- private AMQSession _session;
- private final List<JMSTextMessage> received = new ArrayList<JMSTextMessage>();
- private final List<String> messages = new ArrayList<String>();
- private int _count = 100;
- public String _connectionString = "vm://:1";
- private CountDownLatch _waitForCompletion;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- try
- {
- init((AMQConnection) getConnection("guest", "guest"));
- }
- catch (Exception e)
- {
- fail("Unable to initialilse connection: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- private void init(AMQConnection connection) throws Exception
- {
- Destination destination =
- new AMQQueue(connection.getDefaultQueueExchangeName(), new AMQShortString(randomize("TextMessageTest")), true);
- init(connection, destination);
- }
-
- private void init(AMQConnection connection, Destination destination) throws Exception
- {
- _connection = connection;
- _destination = destination;
- _session = (AMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // set up a slow consumer
- try
- {
- _session.createConsumer(destination).setMessageListener(this);
- }
- catch (Throwable e)
- {
- e.printStackTrace();
- }
- connection.start();
- }
-
- public void test() throws Exception
- {
- int count = _count;
- _waitForCompletion = new CountDownLatch(_count);
- send(count);
- _waitForCompletion.await(20, TimeUnit.SECONDS);
- check();
- _logger.info("Completed without failure");
- _connection.close();
- }
-
- void send(int count) throws JMSException
- {
- // create a publisher
- MessageProducer producer = _session.createProducer(_destination);
- for (int i = 0; i < count; i++)
- {
- String text = "Message " + i;
- messages.add(text);
- Message m = _session.createTextMessage(text);
- //m.setStringProperty("String", "hello");
-
- _logger.info("Sending Msg:" + m);
- producer.send(m);
- }
- _logger.info("sent " + count + " mesages");
- }
-
-
- void check() throws JMSException
- {
- List<String> actual = new ArrayList<String>();
- for (JMSTextMessage m : received)
- {
- actual.add(m.getText());
-
- // Check body write status
- try
- {
- m.setText("Test text");
- Assert.fail("Message should not be writeable");
- }
- catch (MessageNotWriteableException mnwe)
- {
- // normal execution
- }
-
- m.clearBody();
-
- try
- {
- m.setText("Test text");
- }
- catch (MessageNotWriteableException mnwe)
- {
- Assert.fail("Message should be writeable");
- }
-
- // Check property write status
- try
- {
- m.setStringProperty("test", "test");
- Assert.fail("Message should not be writeable");
- }
- catch (MessageNotWriteableException mnwe)
- {
- // normal execution
- }
-
- m.clearProperties();
-
- try
- {
- m.setStringProperty("test", "test");
- }
- catch (MessageNotWriteableException mnwe)
- {
- Assert.fail("Message should be writeable");
- }
-
- }
-
- assertEqual(messages.iterator(), actual.iterator());
- }
-
- private static void assertEqual(Iterator expected, Iterator actual)
- {
- List<String> errors = new ArrayList<String>();
- while (expected.hasNext() && actual.hasNext())
- {
- try
- {
- assertEqual(expected.next(), actual.next());
- }
- catch (Exception e)
- {
- errors.add(e.getMessage());
- }
- }
- while (expected.hasNext())
- {
- errors.add("Expected " + expected.next() + " but no more actual values.");
- }
- while (actual.hasNext())
- {
- errors.add("Found " + actual.next() + " but no more expected values.");
- }
-
- if (!errors.isEmpty())
- {
- throw new RuntimeException(errors.toString());
- }
- }
-
- private static void assertEqual(Object expected, Object actual)
- {
- if (!expected.equals(actual))
- {
- throw new RuntimeException("Expected '" + expected + "' found '" + actual + "'");
- }
- }
-
- public void onMessage(Message message)
- {
- synchronized (received)
- {
- _logger.info("===== received one message");
- received.add((JMSTextMessage) message);
- _waitForCompletion.countDown();
- }
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
-
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TextMessageTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/close/CloseTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/close/CloseTest.java
deleted file mode 100644
index 21eaad6d5b..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/basic/close/CloseTest.java
+++ /dev/null
@@ -1,70 +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.
- *
- *
- */
-package org.apache.qpid.test.unit.basic.close;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.url.AMQBindingURL;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-public class CloseTest extends QpidTestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(CloseTest.class);
-
- private static final String BROKER = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.setUp();
- }
-
- public void testCloseQueueReceiver() throws Exception
- {
- AMQConnection connection = (AMQConnection) getConnection("guest", "guest");
-
- Session session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-
- AMQQueue queue = new AMQQueue(new AMQBindingURL("test-queue"));
- MessageConsumer consumer = session.createConsumer(queue);
-
- MessageProducer producer_not_used_but_created_for_testing = session.createProducer(queue);
-
- connection.start();
-
- _logger.info("About to close consumer");
-
- consumer.close();
-
- _logger.info("Closed Consumer");
- connection.close();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
deleted file mode 100644
index 55750dcafb..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.unit.client;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.TopicSession;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.configuration.ClientProperties;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-public class AMQConnectionTest extends QpidTestCase
-{
- private static AMQConnection _connection;
- private static AMQTopic _topic;
- private static AMQQueue _queue;
- private static QueueSession _queueSession;
- private static TopicSession _topicSession;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- _connection = (AMQConnection) getConnection("guest", "guest");
- _topic = new AMQTopic(_connection.getDefaultTopicExchangeName(), new AMQShortString("mytopic"));
- _queue = new AMQQueue(_connection.getDefaultQueueExchangeName(), new AMQShortString("myqueue"));
- }
-
- protected void tearDown() throws Exception
- {
- _connection.close();
- super.tearDown();
- }
-
- /**
- * Simple tests to check we can create TopicSession and QueueSession ok
- * And that they throw exceptions where appropriate as per JMS spec
- */
-
- public void testCreateQueueSession() throws JMSException
- {
- _queueSession = _connection.createQueueSession(false, AMQSession.NO_ACKNOWLEDGE);
- }
-
- public void testCreateTopicSession() throws JMSException
- {
- _topicSession = _connection.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
- }
-
- public void testTopicSessionCreateBrowser() throws JMSException
- {
- try
- {
- _topicSession.createBrowser(_queue);
- fail("expected exception did not occur");
- }
- catch (javax.jms.IllegalStateException s)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected javax.jms.IllegalStateException, got " + e);
- }
- }
-
- public void testTopicSessionCreateQueue() throws JMSException
- {
- try
- {
- _topicSession.createQueue("abc");
- fail("expected exception did not occur");
- }
- catch (javax.jms.IllegalStateException s)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected javax.jms.IllegalStateException, got " + e);
- }
- }
-
- public void testTopicSessionCreateTemporaryQueue() throws JMSException
- {
- try
- {
- _topicSession.createTemporaryQueue();
- fail("expected exception did not occur");
- }
- catch (javax.jms.IllegalStateException s)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected javax.jms.IllegalStateException, got " + e);
- }
- }
-
- public void testQueueSessionCreateTemporaryTopic() throws JMSException
- {
- try
- {
- _queueSession.createTemporaryTopic();
- fail("expected exception did not occur");
- }
- catch (javax.jms.IllegalStateException s)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected javax.jms.IllegalStateException, got " + e);
- }
- }
-
- public void testQueueSessionCreateTopic() throws JMSException
- {
- try
- {
- _queueSession.createTopic("abc");
- fail("expected exception did not occur");
- }
- catch (javax.jms.IllegalStateException s)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected javax.jms.IllegalStateException, got " + e);
- }
- }
-
- public void testQueueSessionDurableSubscriber() throws JMSException
- {
- try
- {
- _queueSession.createDurableSubscriber(_topic, "abc");
- fail("expected exception did not occur");
- }
- catch (javax.jms.IllegalStateException s)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected javax.jms.IllegalStateException, got " + e);
- }
- }
-
- public void testQueueSessionUnsubscribe() throws JMSException
- {
- try
- {
- _queueSession.unsubscribe("abc");
- fail("expected exception did not occur");
- }
- catch (javax.jms.IllegalStateException s)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected javax.jms.IllegalStateException, got " + e);
- }
- }
-
- public void testPrefetchSystemProperty() throws Exception
- {
- String oldPrefetch = System.getProperty(ClientProperties.MAX_PREFETCH_PROP_NAME);
- try
- {
- _connection.close();
- System.setProperty(ClientProperties.MAX_PREFETCH_PROP_NAME, new Integer(2).toString());
- _connection = (AMQConnection) getConnection();
- _connection.start();
- // Create two consumers on different sessions
- Session consSessA = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
- MessageConsumer consumerA = consSessA.createConsumer(_queue);
-
- Session producerSession = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageProducer producer = producerSession.createProducer(_queue);
-
- // Send 3 messages
- for (int i = 0; i < 3; i++)
- {
- producer.send(producerSession.createTextMessage(new Integer(i).toString()));
- }
- Session consSessB = _connection.createSession(true, Session.AUTO_ACKNOWLEDGE);
- MessageConsumer consumerB = consSessB.createConsumer(_queue);
-
- Message msg;
- // Check that one consumer has 2 messages
- for (int i = 0; i < 2; i++)
- {
- msg = consumerA.receive(1500);
- assertNotNull(msg);
- assertEquals(new Integer(i).toString(), ((TextMessage) msg).getText());
- }
-
- msg = consumerA.receive(1500);
- assertNull(msg);
-
- // Check that other consumer has last message
- msg = consumerB.receive(1500);
- assertNotNull(msg);
- assertEquals(new Integer(2).toString(), ((TextMessage) msg).getText());
- }
- finally
- {
- if (oldPrefetch == null)
- {
- oldPrefetch = ClientProperties.MAX_PREFETCH_DEFAULT;
- }
- System.setProperty(ClientProperties.MAX_PREFETCH_PROP_NAME, oldPrefetch);
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(AMQConnectionTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQSessionTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQSessionTest.java
deleted file mode 100644
index 7c0147b786..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQSessionTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.unit.client;
-
-import javax.jms.JMSException;
-import javax.jms.QueueReceiver;
-import javax.jms.TopicSubscriber;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-/**
- * Tests for QueueReceiver and TopicSubscriber creation methods on AMQSession
- */
-public class AMQSessionTest extends QpidTestCase
-{
-
- private static AMQSession _session;
- private static AMQTopic _topic;
- private static AMQQueue _queue;
- private static AMQConnection _connection;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- _connection = (AMQConnection) getConnection("guest", "guest");
- _topic = new AMQTopic(_connection,"mytopic");
- _queue = new AMQQueue(_connection,"myqueue");
- _session = (AMQSession) _connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- }
-
- protected void tearDown() throws Exception
- {
- try
- {
- _connection.close();
- }
- catch (JMSException e)
- {
- //just close
- }
- super.tearDown();
- }
-
- public void testCreateSubscriber() throws JMSException
- {
- TopicSubscriber subscriber = _session.createSubscriber(_topic);
- assertEquals("Topic names should match from TopicSubscriber", _topic.getTopicName(), subscriber.getTopic().getTopicName());
-
- subscriber = _session.createSubscriber(_topic, "abc", false);
- assertEquals("Topic names should match from TopicSubscriber with selector", _topic.getTopicName(), subscriber.getTopic().getTopicName());
- }
-
- public void testCreateDurableSubscriber() throws JMSException
- {
- TopicSubscriber subscriber = _session.createDurableSubscriber(_topic, "mysubname");
- assertEquals("Topic names should match from durable TopicSubscriber", _topic.getTopicName(), subscriber.getTopic().getTopicName());
-
- subscriber = _session.createDurableSubscriber(_topic, "mysubname2", "abc", false);
- assertEquals("Topic names should match from durable TopicSubscriber with selector", _topic.getTopicName(), subscriber.getTopic().getTopicName());
- _session.unsubscribe("mysubname");
- _session.unsubscribe("mysubname2");
- }
-
- public void testCreateQueueReceiver() throws JMSException
- {
- QueueReceiver receiver = _session.createQueueReceiver(_queue);
- assertEquals("Queue names should match from QueueReceiver", _queue.getQueueName(), receiver.getQueue().getQueueName());
-
- receiver = _session.createQueueReceiver(_queue, "abc");
- assertEquals("Queue names should match from QueueReceiver with selector", _queue.getQueueName(), receiver.getQueue().getQueueName());
- }
-
- public void testCreateReceiver() throws JMSException
- {
- QueueReceiver receiver = _session.createReceiver(_queue);
- assertEquals("Queue names should match from QueueReceiver", _queue.getQueueName(), receiver.getQueue().getQueueName());
-
- receiver = _session.createReceiver(_queue, "abc");
- assertEquals("Queue names should match from QueueReceiver with selector", _queue.getQueueName(), receiver.getQueue().getQueueName());
- }
-
- public static void stopVmBrokers()
- {
- _queue = null;
- _topic = null;
- _session = null;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java
deleted file mode 100644
index b843f7c9c0..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java
+++ /dev/null
@@ -1,241 +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.
- *
- */
-package org.apache.qpid.test.unit.client.channelclose;
-
-import junit.textui.TestRunner;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Destination;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Due to bizarre exception handling all sessions are closed if you get
- * a channel close request and no exception listener is registered.
- * <p/>
- * JIRA issue IBTBLZ-10.
- * <p/>
- * Simulate by:
- * <p/>
- * 0. Create two sessions with no exception listener.
- * 1. Publish message to queue/topic that does not exist (wrong routing key).
- * 2. This will cause a channel close.
- * 3. Since client does not have an exception listener, currently all sessions are
- * closed.
- */
-public class ChannelCloseOkTest extends QpidTestCase
-{
- private AMQConnection _connection;
- private Destination _destination1;
- private Destination _destination2;
- private Session _session1;
- private Session _session2;
- private final List<Message> _received1 = new ArrayList<Message>();
- private final List<Message> _received2 = new ArrayList<Message>();
-
- private static final Logger _log = LoggerFactory.getLogger(ChannelCloseOkTest.class);
- public String _connectionString = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- TransportConnection.createVMBroker(1);
- _connection = (AMQConnection) getConnection("guest", "guest");
-
- _destination1 = new AMQQueue(_connection, "q1", true);
- _destination2 = new AMQQueue(_connection, "q2", true);
- _session1 = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- _session1.createConsumer(_destination1).setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- _log.debug("consumer 1 got message [" + getTextMessage(message) + "]");
- synchronized (_received1)
- {
- _received1.add(message);
- _received1.notify();
- }
- }
- });
- _session2 = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- _session2.createConsumer(_destination2).setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- _log.debug("consumer 2 got message [" + getTextMessage(message) + "]");
- synchronized (_received2)
- {
- _received2.add(message);
- _received2.notify();
- }
- }
- });
-
- _connection.start();
- }
-
- private String getTextMessage(Message message)
- {
- TextMessage tm = (TextMessage) message;
- try
- {
- return tm.getText();
- }
- catch (JMSException e)
- {
- return "oops " + e;
- }
- }
-
- protected void tearDown() throws Exception
- {
- closeConnection();
- super.tearDown();
- }
-
- public void closeConnection() throws JMSException
- {
- if (_connection != null)
- {
- _log.info(">>>>>>>>>>>>>>.. closing");
- _connection.close();
- }
- }
-
- public void testWithoutExceptionListener() throws Exception
- {
- doTest();
- }
-
- public void testWithExceptionListener() throws Exception
- {
- _connection.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException jmsException)
- {
- _log.warn("onException - " + jmsException.getMessage());
- }
- });
-
- doTest();
- }
-
- public void doTest() throws Exception
- {
- // Check both sessions are ok.
- sendAndWait(_session1, _destination1, "first", _received1, 1);
- sendAndWait(_session2, _destination2, "second", _received2, 1);
- assertEquals(1, _received1.size());
- assertEquals(1, _received2.size());
-
- // Now send message to incorrect destination on session 1.
- Destination destination = new AMQQueue(_connection, "incorrect");
- send(_session1, destination, "third"); // no point waiting as message will never be received.
-
- // Ensure both sessions are still ok.
- // Send a bunch of messages as this give time for the sessions to be erroneously closed.
- final int num = 300;
- for (int i = 0; i < num; ++i)
- {
- send(_session1, _destination1, "" + i);
- send(_session2, _destination2, "" + i);
- }
-
- waitFor(_received1, num + 1);
- waitFor(_received2, num + 1);
-
- // Note that the third message is never received as it is sent to an incorrect destination.
- assertEquals(num + 1, _received1.size());
- assertEquals(num + 1, _received2.size());
- }
-
- private void sendAndWait(Session session, Destination destination, String message, List<Message> received, int count)
- throws JMSException, InterruptedException
- {
- send(session, destination, message);
- waitFor(received, count);
- }
-
- private void send(Session session, Destination destination, String message) throws JMSException
- {
- _log.debug("sending message " + message);
- MessageProducer producer1 = session.createProducer(destination);
- producer1.send(session.createTextMessage(message));
- }
-
- private void waitFor(List<Message> received, int count) throws InterruptedException
- {
- long timeout = 20000;
-
- synchronized (received)
- {
- long start = System.currentTimeMillis();
- while (received.size() < count)
- {
- if (System.currentTimeMillis() - start > timeout)
- {
- fail("timeout expired waiting for messages");
- }
- try
- {
- received.wait(timeout);
- }
- catch (InterruptedException e)
- {
- _log.info("Interrupted: " + e);
- throw e;
- }
-
- }
- }
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- public static void main(String[] args)
- {
- TestRunner.run(ChannelCloseOkTest.class);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(ChannelCloseOkTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java
deleted file mode 100644
index d210f5e1a1..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java
+++ /dev/null
@@ -1,418 +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.
- *
- *
- */
-package org.apache.qpid.test.unit.client.channelclose;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.failover.FailoverException;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.jms.ConnectionListener;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.url.URLSyntaxException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-public class ChannelCloseTest extends QpidTestCase implements ExceptionListener, ConnectionListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(ChannelCloseTest.class);
-
- Connection _connection;
- private String _brokerlist = "vm://:1";
- private Session _session;
- private static final long SYNC_TIMEOUT = 500;
- private int TEST = 0;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- /*
- close channel, use chanel with same id ensure error.
- */
- public void testReusingChannelAfterFullClosure() throws Exception
- {
- // this is testing an 0.8 conneciton
- if(isBroker08())
- {
- _connection=newConnection();
-
- // Create Producer
- try
- {
- _connection.start();
-
- createChannelAndTest(1);
-
- // Cause it to close
- try
- {
- _logger.info("Testing invalid exchange");
- declareExchange(1, "", "name_that_will_lookup_to_null", false);
- fail("Exchange name is empty so this should fail ");
- }
- catch (AMQException e)
- {
- assertEquals("Exchange should not be found", AMQConstant.NOT_FOUND, e.getErrorCode());
- }
-
- // Check that
- try
- {
- _logger.info("Testing valid exchange should fail");
- declareExchange(1, "topic", "amq.topic", false);
- fail("This should not succeed as the channel should be closed ");
- }
- catch (AMQException e)
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Exception occured was:" + e.getErrorCode());
- }
-
- assertEquals("Connection should be closed", AMQConstant.CHANNEL_ERROR, e.getErrorCode());
-
- _connection=newConnection();
- }
-
- checkSendingMessage();
-
- _session.close();
- _connection.close();
-
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
- }
-
- /*
- close channel and send guff then send ok no errors
- REMOVE TEST - The behaviour after server has sent close is undefined.
- the server should be free to fail as it may wish to reclaim its resources
- immediately after close.
- */
- /*public void testSendingMethodsAfterClose() throws Exception
- {
- // this is testing an 0.8 connection
- if(isBroker08())
- {
- try
- {
- _connection=new AMQConnection("amqp://guest:guest@CCTTest/test?brokerlist='" + _brokerlist + "'");
-
- ((AMQConnection) _connection).setConnectionListener(this);
-
- _connection.setExceptionListener(this);
-
- // Change the StateManager for one that doesn't respond with Close-OKs
- AMQStateManager oldStateManager=((AMQConnection) _connection).getProtocolHandler().getStateManager();
-
- _session=_connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- _connection.start();
-
- // Test connection
- checkSendingMessage();
-
- // Set StateManager to manager that ignores Close-oks
- AMQProtocolSession protocolSession=
- ((AMQConnection) _connection).getProtocolHandler().getProtocolSession();
-
- MethodDispatcher d = protocolSession.getMethodDispatcher();
-
- MethodDispatcher wrappedDispatcher = (MethodDispatcher)
- Proxy.newProxyInstance(d.getClass().getClassLoader(),
- d.getClass().getInterfaces(),
- new MethodDispatcherProxyHandler(
- (ClientMethodDispatcherImpl) d));
-
- protocolSession.setMethodDispatcher(wrappedDispatcher);
-
-
- AMQStateManager newStateManager=new NoCloseOKStateManager(protocolSession);
- newStateManager.changeState(oldStateManager.getCurrentState());
-
- ((AMQConnection) _connection).getProtocolHandler().setStateManager(newStateManager);
-
- final int TEST_CHANNEL=1;
- _logger.info("Testing Channel(" + TEST_CHANNEL + ") Creation");
-
- createChannelAndTest(TEST_CHANNEL);
-
- // Cause it to close
- try
- {
- _logger.info("Closing Channel - invalid exchange");
- declareExchange(TEST_CHANNEL, "", "name_that_will_lookup_to_null", false);
- fail("Exchange name is empty so this should fail ");
- }
- catch (AMQException e)
- {
- assertEquals("Exchange should not be found", AMQConstant.NOT_FOUND, e.getErrorCode());
- }
-
- try
- {
- // Send other methods that should be ignored
- // send them no wait as server will ignore them
- _logger.info("Tested known exchange - should ignore");
- declareExchange(TEST_CHANNEL, "topic", "amq.topic", true);
-
- _logger.info("Tested known invalid exchange - should ignore");
- declareExchange(TEST_CHANNEL, "", "name_that_will_lookup_to_null", true);
-
- _logger.info("Tested known invalid exchange - should ignore");
- declareExchange(TEST_CHANNEL, "", "name_that_will_lookup_to_null", true);
-
- // Send sync .. server will igore and timy oue
- _logger.info("Tested known invalid exchange - should ignore");
- declareExchange(TEST_CHANNEL, "", "name_that_will_lookup_to_null", false);
- }
- catch (AMQTimeoutException te)
- {
- assertEquals("Request should timeout", AMQConstant.REQUEST_TIMEOUT, te.getErrorCode());
- }
- catch (AMQException e)
- {
- fail("This should not fail as all requests should be ignored");
- }
-
- _logger.info("Sending Close");
- // Send Close-ok
- sendClose(TEST_CHANNEL);
-
- _logger.info("Re-opening channel");
-
- createChannelAndTest(TEST_CHANNEL);
-
- // Test connection is still ok
-
- checkSendingMessage();
-
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
-
- }
- catch (URLSyntaxException e)
- {
- fail(e.getMessage());
- }
- finally
- {
- try
- {
- _session.close();
- _connection.close();
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
- }
- }
-*/
- private void createChannelAndTest(int channel) throws FailoverException
- {
- // Create A channel
- try
- {
- createChannel(channel);
- }
- catch (AMQException e)
- {
- fail(e.getMessage());
- }
-
- // Test it is ok
- try
- {
- declareExchange(channel, "topic", "amq.topic", false);
- _logger.info("Tested known exchange");
- }
- catch (AMQException e)
- {
- fail("This should not fail as this is the default exchange details");
- }
- }
-
- private void sendClose(int channel)
- {
- ChannelCloseOkBody body =
- ((AMQConnection) _connection).getProtocolHandler().getMethodRegistry().createChannelCloseOkBody();
- AMQFrame frame = body.generateFrame(channel);
-
- ((AMQConnection) _connection).getProtocolHandler().writeFrame(frame);
- }
-
- private void checkSendingMessage() throws JMSException
- {
- TEST++;
- _logger.info("Test creating producer which will use channel id 1");
-
- Queue queue = _session.createQueue("CCT_test_validation_queue" + TEST);
-
- MessageConsumer consumer = _session.createConsumer(queue);
-
- MessageProducer producer = _session.createProducer(queue);
-
- final String MESSAGE = "CCT_Test_Message";
- producer.send(_session.createTextMessage(MESSAGE));
-
- Message msg = consumer.receive(2000);
-
- assertNotNull("Received messages should not be null.", msg);
- assertEquals("Message received not what we sent", MESSAGE, ((TextMessage) msg).getText());
- }
-
- private Connection newConnection()
- {
- AMQConnection connection = null;
- try
- {
- connection = new AMQConnection("amqp://guest:guest@CCTTest/test?brokerlist='" + _brokerlist + "'");
-
- connection.setConnectionListener(this);
-
- _session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- connection.start();
-
- }
- catch (JMSException e)
- {
- fail("Creating new connection when:" + e.getMessage());
- }
- catch (AMQException e)
- {
- fail("Creating new connection when:" + e.getMessage());
- }
- catch (URLSyntaxException e)
- {
- fail("Creating new connection when:" + e.getMessage());
- }
-
- return connection;
- }
-
- private void declareExchange(int channelId, String _type, String _name, boolean nowait)
- throws AMQException, FailoverException
- {
- ExchangeDeclareBody body =
- ((AMQConnection) _connection).getProtocolHandler()
- .getMethodRegistry()
- .createExchangeDeclareBody(0,
- new AMQShortString(_name),
- new AMQShortString(_type),
- true,
- false,
- false,
- false,
- nowait,
- null);
- AMQFrame exchangeDeclare = body.generateFrame(channelId);
- AMQProtocolHandler protocolHandler = ((AMQConnection) _connection).getProtocolHandler();
-
-
- if (nowait)
- {
- protocolHandler.writeFrame(exchangeDeclare);
- }
- else
- {
- protocolHandler.syncWrite(exchangeDeclare, ExchangeDeclareOkBody.class, SYNC_TIMEOUT);
- }
-
-// return null;
-// }
-// }, (AMQConnection)_connection).execute();
-
- }
-
- private void createChannel(int channelId) throws AMQException, FailoverException
- {
- ChannelOpenBody body =
- ((AMQConnection) _connection).getProtocolHandler().getMethodRegistry().createChannelOpenBody(null);
-
- ((AMQConnection) _connection).getProtocolHandler().syncWrite(body.generateFrame(channelId), // outOfBand
- ChannelOpenOkBody.class);
-
- }
-
- public void onException(JMSException jmsException)
- {
- // _logger.info("CCT" + jmsException);
- fail(jmsException.getMessage());
- }
-
- public void bytesSent(long count)
- { }
-
- public void bytesReceived(long count)
- { }
-
- public boolean preFailover(boolean redirect)
- {
- return false;
- }
-
- public boolean preResubscribe()
- {
- return false;
- }
-
- public void failoverComplete()
- { }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java
deleted file mode 100644
index d4d19a34ea..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java
+++ /dev/null
@@ -1,81 +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.
- *
- */
-package org.apache.qpid.test.unit.client.channelclose;
-
-import javax.jms.MessageConsumer;
-import javax.jms.Session;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-/**
- * @author Apache Software Foundation
- */
-public class CloseWithBlockingReceiveTest extends QpidTestCase
-{
-
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
-
- public void testReceiveReturnsNull() throws Exception
- {
- final AMQConnection connection = (AMQConnection) getConnection("guest", "guest");
- Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageConsumer consumer = session.createConsumer(new AMQTopic(connection, "banana"));
- connection.start();
-
- Runnable r = new Runnable()
- {
-
- public void run()
- {
- try
- {
- Thread.sleep(1000);
- connection.close();
- }
- catch (Exception e)
- {
- }
- }
- };
- long startTime = System.currentTimeMillis();
- new Thread(r).start();
- consumer.receive(10000);
- assertTrue(System.currentTimeMillis() - startTime < 10000);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(CloseWithBlockingReceiveTest.class);
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java
deleted file mode 100644
index b932b1d784..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionCloseTest.java
+++ /dev/null
@@ -1,108 +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.
- *
- */
-package org.apache.qpid.test.unit.client.connection;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.transport.util.Logger;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.jms.Connection;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-/**
- * ConnectionCloseTest
- *
- */
-
-public class ConnectionCloseTest extends QpidTestCase
-{
-
- private static final Logger log = Logger.get(ConnectionCloseTest.class);
-
- public void testSendReceiveClose() throws Exception
- {
- Map<Thread,StackTraceElement[]> before = Thread.getAllStackTraces();
-
- for (int i = 0; i < 500; i++)
- {
- if ((i % 10) == 0)
- {
- log.warn("%d messages sent and received", i);
- }
-
- Connection receiver = getConnection();
- receiver.start();
- Session rssn = receiver.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Queue queue = rssn.createQueue("connection-close-test-queue");
- MessageConsumer cons = rssn.createConsumer(queue);
-
- Connection sender = getConnection();
- sender.start();
- Session sssn = sender.createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageProducer prod = sssn.createProducer(queue);
- prod.send(sssn.createTextMessage("test"));
- sender.close();
-
- TextMessage m = (TextMessage) cons.receive(2000);
- assertNotNull("message was lost", m);
- assertEquals(m.getText(), "test");
- receiver.close();
- }
-
- // The finalizer is notifying connector thread waiting on a selector key.
- // This should leave the finalizer enough time to notify those threads
- synchronized (this)
- {
- this.wait(1000);
- }
-
- Map<Thread,StackTraceElement[]> after = Thread.getAllStackTraces();
-
- Map<Thread,StackTraceElement[]> delta = new HashMap<Thread,StackTraceElement[]>(after);
- for (Thread t : before.keySet())
- {
- delta.remove(t);
- }
-
- dumpStacks(delta);
-
- assertTrue("Spurious thread creation exceeded threshold, " +
- delta.size() + " threads created.",
- delta.size() < 10);
- }
-
- private void dumpStacks(Map<Thread,StackTraceElement[]> map)
- {
- for (Map.Entry<Thread,StackTraceElement[]> entry : map.entrySet())
- {
- Throwable t = new Throwable();
- t.setStackTrace(entry.getValue());
- log.warn(t, entry.getKey().toString());
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
deleted file mode 100644
index 72691f3543..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
+++ /dev/null
@@ -1,158 +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.
- *
- */
-package org.apache.qpid.test.unit.client.connection;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-public class ConnectionStartTest extends QpidTestCase
-{
-
- String _broker = "vm://:1";
-
- AMQConnection _connection;
- private Session _consumerSess;
- private MessageConsumer _consumer;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- try
- {
-
-
- AMQConnection pubCon = (AMQConnection) getConnection("guest", "guest");
-
- AMQQueue queue = new AMQQueue(pubCon,"ConnectionStartTest");
-
- Session pubSess = pubCon.createSession(false, AMQSession.AUTO_ACKNOWLEDGE);
-
- MessageProducer pub = pubSess.createProducer(queue);
-
- _connection = (AMQConnection) getConnection("guest", "guest");
-
- _consumerSess = _connection.createSession(false, AMQSession.AUTO_ACKNOWLEDGE);
-
- _consumer = _consumerSess.createConsumer(queue);
-
- //publish after queue is created to ensure it can be routed as expected
- pub.send(pubSess.createTextMessage("Initial Message"));
-
- pubCon.close();
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Connection to " + _broker + " should succeed. Reason: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- _connection.close();
- super.tearDown();
- }
-
- public void testSimpleReceiveConnection()
- {
- try
- {
- assertTrue("Connection should not be started", !_connection.started());
- //Note that this next line will start the dispatcher in the session
- // should really not be called before _connection start
- //assertTrue("There should not be messages waiting for the consumer", _consumer.receiveNoWait() == null);
- _connection.start();
- assertTrue("There should be messages waiting for the consumer", _consumer.receive(10*1000) != null);
- assertTrue("Connection should be started", _connection.started());
-
- }
- catch (JMSException e)
- {
- fail("An error occured during test because:" + e);
- }
-
- }
-
- public void testMessageListenerConnection()
- {
- final CountDownLatch _gotMessage = new CountDownLatch(1);
-
- try
- {
- assertTrue("Connection should not be started", !_connection.started());
- _consumer.setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- try
- {
- assertTrue("Connection should be started", _connection.started());
- assertEquals("Mesage Received", "Initial Message", ((TextMessage) message).getText());
- _gotMessage.countDown();
- }
- catch (JMSException e)
- {
- fail("Couldn't get message text because:" + e.getCause());
- }
- }
- });
-
- assertTrue("Connection should not be started", !_connection.started());
- _connection.start();
- assertTrue("Connection should be started", _connection.started());
-
- try
- {
- assertTrue("Listener was never called", _gotMessage.await(10 * 1000, TimeUnit.MILLISECONDS));
- }
- catch (InterruptedException e)
- {
- fail("Timed out awaiting message via onMessage");
- }
-
- }
- catch (JMSException e)
- {
- fail("Failed because:" + e.getCause());
- }
-
- }
-
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(ConnectionStartTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
deleted file mode 100644
index 5147d4a94d..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
+++ /dev/null
@@ -1,286 +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.
- *
- */
-package org.apache.qpid.test.unit.client.connection;
-
-import org.apache.qpid.AMQConnectionFailureException;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQUnresolvedAddressException;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.client.AMQAuthenticationException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.jms.Session;
-
-import javax.jms.Connection;
-import javax.jms.QueueSession;
-import javax.jms.TopicSession;
-import javax.naming.NamingException;
-
-public class ConnectionTest extends QpidTestCase
-{
-
- String _broker_NotRunning = "vm://:2";
- String _broker_BadDNS = "tcp://hg3sgaaw4lgihjs";
-
- public String getBroker()
- {
- try
- {
- if (getConnectionFactory().getConnectionURL().getBrokerCount() > 0)
- {
- return getConnectionFactory().getConnectionURL().getBrokerDetails(0).toString();
- }
- else
- {
- fail("No broker details are available.");
- }
- }
- catch (NamingException e)
- {
- fail(e.getMessage());
- }
-
- //keep compiler happy
- return null;
- }
-
- public void testSimpleConnection() throws Exception
- {
- AMQConnection conn = null;
- try
- {
- conn = new AMQConnection(getBroker(), "guest", "guest", "fred", "test");
- }
- catch (Exception e)
- {
- fail("Connection to " + getBroker() + " should succeed. Reason: " + e);
- }
- finally
- {
- conn.close();
- }
- }
-
- public void testDefaultExchanges() throws Exception
- {
- AMQConnection conn = null;
- try
- {
- conn = new AMQConnection("amqp://guest:guest@clientid/test?brokerlist='"
- + getBroker()
- + "?retries='1''&defaultQueueExchange='test.direct'"
- + "&defaultTopicExchange='test.topic'"
- + "&temporaryQueueExchange='tmp.direct'"
- + "&temporaryTopicExchange='tmp.topic'");
-
-
- AMQSession sess = (AMQSession) conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- sess.declareExchange(new AMQShortString("test.direct"),
- ExchangeDefaults.DIRECT_EXCHANGE_CLASS, false);
-
- sess.declareExchange(new AMQShortString("tmp.direct"),
- ExchangeDefaults.DIRECT_EXCHANGE_CLASS, false);
-
- sess.declareExchange(new AMQShortString("tmp.topic"),
- ExchangeDefaults.TOPIC_EXCHANGE_CLASS, false);
-
- sess.declareExchange(new AMQShortString("test.topic"),
- ExchangeDefaults.TOPIC_EXCHANGE_CLASS, false);
-
- QueueSession queueSession = conn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-
- AMQQueue queue = (AMQQueue) queueSession.createQueue("MyQueue");
-
- assertEquals(queue.getExchangeName().toString(), "test.direct");
-
- AMQQueue tempQueue = (AMQQueue) queueSession.createTemporaryQueue();
-
- assertEquals(tempQueue.getExchangeName().toString(), "tmp.direct");
-
- queueSession.close();
-
- TopicSession topicSession = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
-
- AMQTopic topic = (AMQTopic) topicSession.createTopic("silly.topic");
-
- assertEquals(topic.getExchangeName().toString(), "test.topic");
-
- AMQTopic tempTopic = (AMQTopic) topicSession.createTemporaryTopic();
-
- assertEquals(tempTopic.getExchangeName().toString(), "tmp.topic");
-
- topicSession.close();
-
- }
- catch (Exception e)
- {
- fail("Connection to " + getBroker() + " should succeed. Reason: " + e);
- }
- finally
- {
- conn.close();
- }
- }
-
- public void testPasswordFailureConnection() throws Exception
- {
- AMQConnection conn = null;
- try
- {
- conn = new AMQConnection("amqp://guest:rubbishpassword@clientid/test?brokerlist='" + getBroker() + "?retries='0''");
- fail("Connection should not be established password is wrong.");
- }
- catch (AMQConnectionFailureException amqe)
- {
- assertNotNull("No cause set:" + amqe.getMessage(), amqe.getCause());
- assertEquals("Exception was wrong type", AMQAuthenticationException.class, amqe.getCause().getClass());
- }
- finally
- {
- if (conn != null)
- {
- conn.close();
- }
- }
- }
-
- public void testConnectionFailure() throws Exception
- {
- AMQConnection conn = null;
- try
- {
- conn = new AMQConnection("amqp://guest:guest@clientid/testpath?brokerlist='" + _broker_NotRunning + "?retries='0''");
- fail("Connection should not be established");
- }
- catch (AMQException amqe)
- {
- if (!(amqe instanceof AMQConnectionFailureException))
- {
- fail("Correct exception not thrown. Excpected 'AMQConnectionException' got: " + amqe);
- }
- }
- finally
- {
- if (conn != null)
- {
- conn.close();
- }
- }
-
- }
-
- public void testUnresolvedHostFailure() throws Exception
- {
- AMQConnection conn = null;
- try
- {
- conn = new AMQConnection("amqp://guest:guest@clientid/testpath?brokerlist='" + _broker_BadDNS + "?retries='0''");
- fail("Connection should not be established");
- }
- catch (AMQException amqe)
- {
- if (!(amqe instanceof AMQUnresolvedAddressException))
- {
- fail("Correct exception not thrown. Excpected 'AMQUnresolvedAddressException' got: " + amqe);
- }
- }
- finally
- {
- if (conn != null)
- {
- conn.close();
- }
- }
-
- }
-
- public void testUnresolvedVirtualHostFailure() throws Exception
- {
- AMQConnection conn = null;
- try
- {
- conn = new AMQConnection("amqp://guest:guest@clientid/rubbishhost?brokerlist='" + getBroker() + "?retries='0''");
- fail("Connection should not be established");
- }
- catch (AMQException amqe)
- {
- if (!(amqe instanceof AMQConnectionFailureException))
- {
- fail("Correct exception not thrown. Excpected 'AMQConnectionFailureException' got: " + amqe);
- }
- }
- finally
- {
- if (conn != null)
- {
- conn.close();
- }
- }
- }
-
- public void testClientIdCannotBeChanged() throws Exception
- {
- Connection connection = new AMQConnection(getBroker(), "guest", "guest",
- "fred", "test");
- try
- {
- connection.setClientID("someClientId");
- fail("No IllegalStateException thrown when resetting clientid");
- }
- catch (javax.jms.IllegalStateException e)
- {
- // PASS
- }
- finally
- {
- if (connection != null)
- {
- connection.close();
- }
- }
- }
-
- public void testClientIdIsPopulatedAutomatically() throws Exception
- {
- Connection connection = new AMQConnection(getBroker(), "guest", "guest",
- null, "test");
- try
- {
- assertNotNull(connection.getClientID());
- }
- finally
- {
- connection.close();
- }
- connection.close();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(ConnectionTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ExceptionListenerTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ExceptionListenerTest.java
deleted file mode 100644
index 6f31f7bc65..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ExceptionListenerTest.java
+++ /dev/null
@@ -1,62 +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.
- *
- */
-package org.apache.qpid.test.unit.client.connection;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.apache.qpid.util.concurrent.Condition;
-
-import javax.jms.Connection;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-
-/**
- * ExceptionListenerTest
- *
- */
-
-public class ExceptionListenerTest extends QpidTestCase
-{
-
- public void testBrokerDeath() throws Exception
- {
- Connection conn = getConnection("guest", "guest");
-
- conn.start();
-
- final Condition fired = new Condition();
- conn.setExceptionListener(new ExceptionListener()
- {
- public void onException(JMSException e)
- {
- fired.set();
- }
- });
-
- stopBroker();
-
- if (!fired.get(3000))
- {
- fail("exception listener was not fired");
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/Client.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/Client.java
deleted file mode 100644
index 0be11011b4..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/Client.java
+++ /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.
- *
- */
-package org.apache.qpid.test.unit.client.forwardall;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-
-/**
- * Declare a private temporary response queue,
- * send a message to amq.direct with a well known routing key with the
- * private response queue as the reply-to destination
- * consume responses.
- */
-public class Client implements MessageListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(Client.class);
-
- private final AMQConnection _connection;
- private final AMQSession _session;
- private final int _expected;
- private int _count;
- private static QpidTestCase _qct;
-
- Client(String broker, int expected) throws Exception
- {
- this(connect(broker), expected);
- }
-
- public static void setQTC(QpidTestCase qtc)
- {
- _qct = qtc;
- }
- Client(AMQConnection connection, int expected) throws Exception
- {
- _connection = connection;
- _expected = expected;
- _session = (AMQSession) _connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- AMQQueue response =
- new AMQQueue(_connection.getDefaultQueueExchangeName(), new AMQShortString("ResponseQueue"), true);
- _session.createConsumer(response).setMessageListener(this);
- _connection.start();
- // AMQQueue service = new SpecialQueue(_connection, "ServiceQueue");
- AMQQueue service = (AMQQueue) _session.createQueue("ServiceQueue") ;
- Message request = _session.createTextMessage("Request!");
- request.setJMSReplyTo(response);
- MessageProducer prod = _session.createProducer(service);
- prod.send(request);
- }
-
- void shutdownWhenComplete() throws Exception
- {
- waitUntilComplete();
- _connection.close();
- }
-
- public synchronized void onMessage(Message response)
- {
-
- _logger.info("Received " + (++_count) + " of " + _expected + " responses.");
- if (_count == _expected)
- {
-
- notifyAll();
- }
-
- }
-
- synchronized void waitUntilComplete() throws Exception
- {
-
- if (_count < _expected)
- {
- wait(60000);
- }
-
- if (_count < _expected)
- {
- throw new Exception("Didn't receive all messages... got " + _count + " expected " + _expected);
- }
- }
-
- static AMQConnection connect(String broker) throws Exception
- {
- //return new AMQConnection(broker, "guest", "guest", "Client" + System.currentTimeMillis(), "test");
- return (AMQConnection) _qct.getConnection("guest", "guest") ;
- }
-
- public static void main(String[] argv) throws Exception
- {
- final String connectionString;
- final int expected;
- if (argv.length == 0)
- {
- connectionString = "localhost:5672";
- expected = 100;
- }
- else
- {
- connectionString = argv[0];
- expected = Integer.parseInt(argv[1]);
- }
-
- new Client(connect(connectionString), expected).shutdownWhenComplete();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java
deleted file mode 100644
index a1001a6f5d..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java
+++ /dev/null
@@ -1,69 +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.
- *
- */
-package org.apache.qpid.test.unit.client.forwardall;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Runs the Service's and Client parts of the test in the same process
- * as the broker
- */
-public class CombinedTest extends QpidTestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(CombinedTest.class);
- private int run = 0;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- Service.setQTC(this);
- Client.setQTC(this);
- }
-
- protected void tearDown() throws Exception
- {
- ServiceCreator.closeAll();
- super.tearDown();
- }
-
- public void testForwardAll() throws Exception
- {
- while (run < 10)
- {
- int services =1;
- ServiceCreator.start("vm://:1", services);
-
- _logger.info("Starting " + ++run + " client...");
-
- new Client("vm://:1", services).shutdownWhenComplete();
-
-
- _logger.info("Completed " + run + " successfully!");
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(CombinedTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/Service.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/Service.java
deleted file mode 100644
index 9cd8b183af..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/Service.java
+++ /dev/null
@@ -1,94 +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.
- *
- */
-package org.apache.qpid.test.unit.client.forwardall;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-/**
- * Declare a queue and bind it to amq.direct with a 'well known' routing key,
- * register a consumer for this queue and send a response to every message received.
- */
-public class Service implements MessageListener
-{
- private final AMQConnection _connection;
- private final AMQSession _session;
-
- private static QpidTestCase _qct;
-
-
- public static void setQTC(QpidTestCase qtc)
- {
- _qct = qtc;
- }
- Service(String broker) throws Exception
- {
- this(connect(broker));
- }
-
- Service(AMQConnection connection) throws Exception
- {
- _connection = connection;
- //AMQQueue queue = new SpecialQueue(connection, "ServiceQueue");
- _session = (AMQSession) _connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- AMQQueue queue = (AMQQueue) _session.createQueue("ServiceQueue") ;
- _session.createConsumer(queue).setMessageListener(this);
- _connection.start();
- }
-
- public void onMessage(Message request)
- {
- try
- {
- Message response = _session.createTextMessage("Response!");
- Destination replyTo = request.getJMSReplyTo();
- _session.createProducer(replyTo).send(response);
- }
- catch (Exception e)
- {
- e.printStackTrace(System.out);
- }
- }
-
- public void close() throws JMSException
- {
- _connection.close();
- }
-
- static AMQConnection connect(String broker) throws Exception
- {
- //return new AMQConnection(broker, "guest", "guest", "Client" + System.currentTimeMillis(), "test");
- return (AMQConnection) _qct.getConnection("guest", "guest") ;
- }
-
-// public static void main(String[] argv) throws Exception
-// {
-// String broker = argv.length == 0? "localhost:5672" : argv[0];
-// new Service(broker);
-// }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/ServiceCreator.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/ServiceCreator.java
deleted file mode 100644
index be16f6b7ae..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/ServiceCreator.java
+++ /dev/null
@@ -1,112 +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.
- *
- */
-package org.apache.qpid.test.unit.client.forwardall;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-
-public class ServiceCreator implements Runnable
-{
- private static final Logger _logger = LoggerFactory.getLogger(ServiceCreator.class);
-
- private static Thread[] threads;
- private static ServiceCreator[] _services;
-
- private final String broker;
- private Service service;
-
- ServiceCreator(String broker)
- {
- this.broker = broker;
- }
-
- public void run()
- {
- try
- {
- service = new Service(broker);
- }
- catch (Exception e)
- {
- e.printStackTrace(System.out);
- }
- }
-
- public void closeSC() throws JMSException
- {
- service.close();
- }
-
- static void closeAll()
- {
- for (int i = 0; i < _services.length; i++)
- {
- try
- {
- _services[i].closeSC();
- }
- catch (JMSException e)
- {
- // ignore
- }
- }
- }
-
- static void start(String broker, int services) throws InterruptedException
- {
- threads = new Thread[services];
- _services = new ServiceCreator[services];
- ServiceCreator runner = new ServiceCreator(broker);
- // start services
- _logger.info("Starting " + services + " services...");
- for (int i = 0; i < services; i++)
- {
- threads[i] = new Thread(runner);
- _services[i] = runner;
- threads[i].start();
- }
-
- for (int i = 0; i < threads.length; i++)
- {
- threads[i].join();
- }
- }
-
- public static void main(String[] argv) throws Exception
- {
- final String connectionString;
- final int services;
- if (argv.length == 0)
- {
- connectionString = "localhost:5672";
- services = 100;
- }
- else
- {
- connectionString = argv[0];
- services = Integer.parseInt(argv[1]);
- }
-
- start(connectionString, services);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/SpecialQueue.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/SpecialQueue.java
deleted file mode 100644
index 27371b0397..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/forwardall/SpecialQueue.java
+++ /dev/null
@@ -1,46 +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.
- *
- */
-package org.apache.qpid.test.unit.client.forwardall;
-
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.framing.AMQShortString;
-
-/**
- * Queue that allows several private queues to be registered and bound
- * to an exchange with the same routing key.
- *
- */
-class SpecialQueue extends AMQQueue
-{
- private final AMQShortString name;
-
- SpecialQueue(AMQConnection con, String name)
- {
- super(con, name, true);
- this.name = new AMQShortString(name);
- }
-
- public AMQShortString getRoutingKey()
- {
- return name;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java
deleted file mode 100644
index e67760a6c3..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java
+++ /dev/null
@@ -1,335 +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.
- *
- */
-package org.apache.qpid.test.unit.client.message;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-
-public class ObjectMessageTest extends QpidTestCase implements MessageListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(ObjectMessageTest.class);
-
- private AMQConnection connection;
- private AMQDestination destination;
- private AMQSession session;
- private MessageProducer producer;
- private Serializable[] data;
- private volatile boolean waiting;
- private int received;
- private final ArrayList items = new ArrayList();
-
- private String _broker = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- connection = (AMQConnection) getConnection("guest", "guest");
- destination = new AMQQueue(connection, randomize("LatencyTest"), true);
- session = (AMQSession) connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
-
- // set up a consumer
- session.createConsumer(destination).setMessageListener(this);
- connection.start();
-
- // create a publisher
- producer = session.createProducer(destination, false, false, true);
- A a1 = new A(1, "A");
- A a2 = new A(2, "a");
- B b = new B(1, "B");
- C c = new C();
- c.put("A1", a1);
- c.put("a2", a2);
- c.put("B", b);
- c.put("String", "String");
-
- data = new Serializable[] { a1, a2, b, c, "Hello World!", new Integer(1001) };
- }
-
- protected void tearDown() throws Exception
- {
- close();
- super.tearDown();
- }
-
- public ObjectMessageTest()
- { }
-
- ObjectMessageTest(String broker) throws Exception
- {
- _broker = broker;
- }
-
- public void testSendAndReceive() throws Exception
- {
- try
- {
- send();
- waitUntilReceived(data.length);
- check();
- _logger.info("All " + data.length + " items matched.");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("This Test should succeed but failed due to: " + e);
- }
- }
-
- public void testSetObjectPropertyForString() throws Exception
- {
- String testStringProperty = "TestStringProperty";
- ObjectMessage msg = session.createObjectMessage(data[0]);
- msg.setObjectProperty("TestStringProperty", testStringProperty);
- assertEquals(testStringProperty, msg.getObjectProperty("TestStringProperty"));
- }
-
- public void testSetObjectPropertyForBoolean() throws Exception
- {
- ObjectMessage msg = session.createObjectMessage(data[0]);
- msg.setObjectProperty("TestBooleanProperty", Boolean.TRUE);
- assertEquals(Boolean.TRUE, msg.getObjectProperty("TestBooleanProperty"));
- }
-
- public void testSetObjectPropertyForByte() throws Exception
- {
- ObjectMessage msg = session.createObjectMessage(data[0]);
- msg.setObjectProperty("TestByteProperty", Byte.MAX_VALUE);
- assertEquals(Byte.MAX_VALUE, msg.getObjectProperty("TestByteProperty"));
- }
-
- public void testSetObjectPropertyForShort() throws Exception
- {
- ObjectMessage msg = session.createObjectMessage(data[0]);
- msg.setObjectProperty("TestShortProperty", Short.MAX_VALUE);
- assertEquals(Short.MAX_VALUE, msg.getObjectProperty("TestShortProperty"));
- }
-
- public void testSetObjectPropertyForInteger() throws Exception
- {
- ObjectMessage msg = session.createObjectMessage(data[0]);
- msg.setObjectProperty("TestIntegerProperty", Integer.MAX_VALUE);
- assertEquals(Integer.MAX_VALUE, msg.getObjectProperty("TestIntegerProperty"));
- }
-
- public void testSetObjectPropertyForDouble() throws Exception
- {
- ObjectMessage msg = session.createObjectMessage(data[0]);
- msg.setObjectProperty("TestDoubleProperty", Double.MAX_VALUE);
- assertEquals(Double.MAX_VALUE, msg.getObjectProperty("TestDoubleProperty"));
- }
-
- public void testSetObjectPropertyForFloat() throws Exception
- {
- ObjectMessage msg = session.createObjectMessage(data[0]);
- msg.setObjectProperty("TestFloatProperty", Float.MAX_VALUE);
- assertEquals(Float.MAX_VALUE, msg.getObjectProperty("TestFloatProperty"));
- }
-
- public void testSetObjectPropertyForByteArray() throws Exception
- {
- byte[] array = { 1, 2, 3, 4, 5 };
- ObjectMessage msg = session.createObjectMessage(data[0]);
- msg.setObjectProperty("TestByteArrayProperty", array);
- assertTrue(Arrays.equals(array, (byte[]) msg.getObjectProperty("TestByteArrayProperty")));
- }
-
- public void testSetObjectForNull() throws Exception
- {
- ObjectMessage msg = session.createObjectMessage();
- msg.setObject(null);
- assertNull(msg.getObject());
- }
-
- private void send() throws Exception
- {
- for (int i = 0; i < data.length; i++)
- {
- ObjectMessage msg;
- if ((i % 2) == 0)
- {
- msg = session.createObjectMessage(data[i]);
- }
- else
- {
- msg = session.createObjectMessage();
- msg.setObject(data[i]);
- }
-
- producer.send(msg);
- }
- }
-
- public void check() throws Exception
- {
- Object[] actual = (Object[]) items.toArray();
- if (actual.length != data.length)
- {
- throw new Exception("Expected " + data.length + " objects, got " + actual.length);
- }
-
- for (int i = 0; i < data.length; i++)
- {
- if (actual[i] instanceof Exception)
- {
- throw new Exception("Error on receive of " + data[i], ((Exception) actual[i]));
- }
-
- if (actual[i] == null)
- {
- throw new Exception("Expected " + data[i] + " got null");
- }
-
- if (!data[i].equals(actual[i]))
- {
- throw new Exception("Expected " + data[i] + " got " + actual[i]);
- }
- }
- }
-
- private void close() throws Exception
- {
- session.close();
- connection.close();
- }
-
- private synchronized void waitUntilReceived(int count) throws InterruptedException
- {
- waiting = true;
- while (received < count)
- {
- wait();
- }
-
- waiting = false;
- }
-
- public void onMessage(Message message)
- {
-
- try
- {
- if (message instanceof ObjectMessage)
- {
- items.add(((ObjectMessage) message).getObject());
- }
- else
- {
- _logger.error("ERROR: Got " + message.getClass().getName() + " not ObjectMessage");
- items.add(message);
- }
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- items.add(e);
- }
-
- synchronized (this)
- {
- received++;
- notify();
- }
- }
-
- public static void main(String[] argv) throws Exception
- {
- String broker = (argv.length > 0) ? argv[0] : "vm://:1";
- if ("-help".equals(broker))
- {
- System.out.println("Usage: <broker>");
- }
-
- new ObjectMessageTest(broker).testSendAndReceive();
- }
-
- private static class A implements Serializable
- {
- private String sValue;
- private int iValue;
-
- A(int i, String s)
- {
- sValue = s;
- iValue = i;
- }
-
- public int hashCode()
- {
- return iValue;
- }
-
- public boolean equals(Object o)
- {
- return (o instanceof A) && equals((A) o);
- }
-
- protected boolean equals(A a)
- {
- return areEqual(a.sValue, sValue) && (a.iValue == iValue);
- }
- }
-
- private static class B extends A
- {
- private long time;
-
- B(int i, String s)
- {
- super(i, s);
- time = System.currentTimeMillis();
- }
-
- protected boolean equals(A a)
- {
- return super.equals(a) && (a instanceof B) && (time == ((B) a).time);
- }
- }
-
- private static class C extends HashMap implements Serializable
- { }
-
- private static boolean areEqual(Object a, Object b)
- {
- return (a == null) ? (b == null) : a.equals(b);
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/protocol/AMQProtocolSessionTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/protocol/AMQProtocolSessionTest.java
deleted file mode 100644
index 91cb37e455..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/protocol/AMQProtocolSessionTest.java
+++ /dev/null
@@ -1,120 +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.
- *
- */
-package org.apache.qpid.test.unit.client.protocol;
-
-import org.apache.mina.common.IoSession;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.test.utils.protocol.TestIoSession;
-
-public class AMQProtocolSessionTest extends QpidTestCase
-{
- private static class AMQProtSession extends AMQProtocolSession
- {
-
- public AMQProtSession(AMQProtocolHandler protocolHandler, IoSession protocolSession, AMQConnection connection)
- {
- super(protocolHandler,protocolSession,connection);
- }
-
- public TestIoSession getMinaProtocolSession()
- {
- return (TestIoSession) _minaProtocolSession;
- }
-
- public AMQShortString genQueueName()
- {
- return generateQueueName();
- }
- }
-
- //private Strings for test values and expected results
- private String _brokenAddress = "tcp://myAddress;:";;
- private String _generatedAddress;
- private String _emptyAddress;
- private String _generatedAddress_2;
- private String _validAddress;
- private String _generatedAddress_3;
- private int _port;
- private AMQProtSession _testSession;
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- //don't care about the values set here apart from the dummy IoSession
- _testSession = new AMQProtSession(null,new TestIoSession(), (AMQConnection) getConnection("guest", "guest"));
-
- //initialise addresses for test and expected results
- _port = 123;
- _brokenAddress = "tcp://myAddress;:";
- _generatedAddress = "tmp_tcpmyAddress123_1";
- _emptyAddress = "";
- _generatedAddress_2 = "tmp_localhost127.0.0.1123_2";
- _validAddress = "abc";
- _generatedAddress_3 = "tmp_abc123_3";
- }
-
- public void testGenerateQueueName()
- {
- AMQShortString testAddress;
-
- //test address with / and ; chars which generateQueueName should removeKey
- _testSession.getMinaProtocolSession().setStringLocalAddress(_brokenAddress);
- _testSession.getMinaProtocolSession().setLocalPort(_port);
-
- testAddress = _testSession.genQueueName();
- assertEquals("Failure when generating a queue exchange from an address with special chars",_generatedAddress,testAddress.toString());
-
- //test empty address
- _testSession.getMinaProtocolSession().setStringLocalAddress(_emptyAddress);
-
- testAddress = _testSession.genQueueName();
- assertEquals("Failure when generating a queue exchange from an empty address",_generatedAddress_2,testAddress.toString());
-
- //test address with no special chars
- _testSession.getMinaProtocolSession().setStringLocalAddress(_validAddress);
-
- testAddress = _testSession.genQueueName();
- assertEquals("Failure when generating a queue exchange from an address with no special chars",_generatedAddress_3,testAddress.toString());
-
- }
-
- protected void tearDown() throws Exception
- {
- _testSession = null;
- _brokenAddress = null;
- _generatedAddress = null;
- _emptyAddress = null;
- _generatedAddress_2 = null;
- _validAddress = null;
- _generatedAddress_3 = null;
- super.tearDown();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(AMQProtocolSessionTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java
deleted file mode 100644
index 1d48955461..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java
+++ /dev/null
@@ -1,258 +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.
- *
- */
-
-package org.apache.qpid.test.unit.client.temporaryqueue;
-
-import javax.jms.Connection;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TemporaryQueue;
-import javax.jms.TextMessage;
-import junit.framework.Assert;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.jms.ConnectionListener;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.LinkedList;
-
-public class TemporaryQueueTest extends QpidTestCase implements ExceptionListener
-{
- private List<Exception> _exceptions = new ArrayList<Exception>();
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- protected Connection createConnection() throws Exception
- {
- return getConnection("guest", "guest");
- }
-
- public void testTemporaryQueue() throws Exception
- {
- Connection conn = createConnection();
- Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
- TemporaryQueue queue = session.createTemporaryQueue();
- assertNotNull(queue);
- MessageProducer producer = session.createProducer(queue);
- MessageConsumer consumer = session.createConsumer(queue);
- conn.start();
- producer.send(session.createTextMessage("hello"));
- TextMessage tm = (TextMessage) consumer.receive(2000);
- assertNotNull(tm);
- assertEquals("hello", tm.getText());
-
- try
- {
- queue.delete();
- fail("Expected JMSException : should not be able to delete while there are active consumers");
- }
- catch (JMSException je)
- {
- ; //pass
- }
-
- consumer.close();
-
- try
- {
- queue.delete();
- }
- catch (JMSException je)
- {
- fail("Unexpected Exception: " + je.getMessage());
- }
-
- conn.close();
- }
-
- public void tUniqueness() throws Exception
- {
- int numProcs = Runtime.getRuntime().availableProcessors();
- final int threadsProc = 5;
-
- runUniqueness(1, 10);
- runUniqueness(numProcs * threadsProc, 10);
- runUniqueness(numProcs * threadsProc, 100);
- runUniqueness(numProcs * threadsProc, 500);
- }
-
- void runUniqueness(int makers, int queues) throws Exception
- {
- Connection connection = createConnection();
-
- Session session = connection.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- List<TempQueueMaker> tqList = new LinkedList<TempQueueMaker>();
-
- //Create Makers
- for (int m = 0; m < makers; m++)
- {
- tqList.add(new TempQueueMaker(session, queues));
- }
-
-
- List<Thread> threadList = new LinkedList<Thread>();
-
- //Create Makers
- for (TempQueueMaker maker : tqList)
- {
- threadList.add(new Thread(maker));
- }
-
- //Start threads
- for (Thread thread : threadList)
- {
- thread.start();
- }
-
- // Join Threads
- for (Thread thread : threadList)
- {
- try
- {
- thread.join();
- }
- catch (InterruptedException e)
- {
- fail("Couldn't correctly join threads");
- }
- }
-
-
- List<AMQQueue> list = new LinkedList<AMQQueue>();
-
- // Test values
- for (TempQueueMaker maker : tqList)
- {
- check(maker, list);
- }
-
- Assert.assertEquals("Not enough queues made.", makers * queues, list.size());
-
- connection.close();
- }
-
- private void check(TempQueueMaker tq, List<AMQQueue> list)
- {
- for (AMQQueue q : tq.getList())
- {
- if (list.contains(q))
- {
- fail(q + " already exists.");
- }
- else
- {
- list.add(q);
- }
- }
- }
-
-
- class TempQueueMaker implements Runnable
- {
- List<AMQQueue> _queues;
- Session _session;
- private int _count;
-
-
- TempQueueMaker(Session session, int queues) throws JMSException
- {
- _queues = new LinkedList<AMQQueue>();
-
- _count = queues;
-
- _session = session;
- }
-
- public void run()
- {
- int i = 0;
- try
- {
- for (; i < _count; i++)
- {
- _queues.add((AMQQueue) _session.createTemporaryQueue());
- }
- }
- catch (JMSException jmse)
- {
- //stop
- }
- }
-
- List<AMQQueue> getList()
- {
- return _queues;
- }
- }
-
- public void testQPID1217() throws Exception
- {
- Connection conA = getConnection();
- conA.setExceptionListener(this);
- Session sessA = conA.createSession(false, Session.AUTO_ACKNOWLEDGE);
- TemporaryQueue temp = sessA.createTemporaryQueue();
-
- MessageProducer prod = sessA.createProducer(temp);
- prod.send(sessA.createTextMessage("hi"));
-
- Thread.sleep(500);
- assertTrue("Exception received", _exceptions.isEmpty());
-
- Connection conB = getConnection();
- Session sessB = conB.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- JMSException ex = null;
- try
- {
- MessageConsumer consB = sessB.createConsumer(temp);
- }
- catch (JMSException e)
- {
- ex = e;
- }
- assertNotNull(ex);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TemporaryQueueTest.class);
- }
-
- public void onException(JMSException arg0)
- {
- _exceptions.add(arg0);
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java
deleted file mode 100644
index a61bcca049..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java
+++ /dev/null
@@ -1,142 +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.
- *
- */
-package org.apache.qpid.test.unit.close;
-
-import junit.framework.Assert;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.qpid.junit.concurrency.TestRunnable;
-import org.apache.qpid.junit.concurrency.ThreadTestCoordinator;
-
-import javax.jms.Connection;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.Session;
-
-/**
- * This test forces the situation where a session is closed whilst a message consumer is still in its onMessage method.
- * Running in AUTO_ACK mode, the close call ought to wait until the onMessage method completes, and the ack is sent
- * before closing the connection.
- *
- * <p><table id="crc"><caption>CRC Card</caption> <tr><th> Responsibilities <th> Collaborations <tr><td> Check that
- * closing a connection whilst handling a message, blocks till completion of the handler. </table>
- */
-public class CloseBeforeAckTest extends QpidTestCase
-{
- private static final Logger log = LoggerFactory.getLogger(CloseBeforeAckTest.class);
-
- Connection connection;
- Session session;
- public static final String TEST_QUEUE_NAME = "TestQueue";
- private int TEST_COUNT = 25;
-
- class TestThread1 extends TestRunnable implements MessageListener
- {
- public void runWithExceptions() throws Exception
- {
- // Set this up to listen for message on the test session.
- session.createConsumer(session.createQueue(TEST_QUEUE_NAME)).setMessageListener(this);
- }
-
- public void onMessage(Message message)
- {
- // Give thread 2 permission to close the session.
- allow(new int[] { 1 });
-
- // Wait until thread 2 has closed the connection, or is blocked waiting for this to complete.
- waitFor(new int[] { 1 }, true);
- }
- }
-
- TestThread1 testThread1 = new TestThread1();
-
- TestRunnable testThread2 =
- new TestRunnable()
- {
- public void runWithExceptions() throws Exception
- {
- // Send a message to be picked up by thread 1.
- session.createProducer(null).send(session.createQueue(TEST_QUEUE_NAME),
- session.createTextMessage("Hi there thread 1!"));
-
- // Wait for thread 1 to pick up the message and give permission to continue.
- waitFor(new int[] { 0 }, false);
-
- // Close the connection.
- session.close();
-
- // Allow thread 1 to continue to completion, if it is erronously still waiting.
- allow(new int[] { 1 });
- }
- };
-
- public void testCloseBeforeAutoAck_QPID_397() throws Exception
- {
- // Create a session in auto acknowledge mode. This problem shows up in auto acknowledge if the client acks
- // message at the end of the onMessage method, after a close has been sent.
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- ThreadTestCoordinator tt = new ThreadTestCoordinator(2);
-
- tt.addTestThread(testThread1, 0);
- tt.addTestThread(testThread2, 1);
- tt.setDeadlockTimeout(500);
- tt.run();
-
- String errorMessage = tt.joinAndRetrieveMessages();
-
- // Print any error messages or exceptions.
- log.debug(errorMessage);
-
- if (!tt.getExceptions().isEmpty())
- {
- for (Exception e : tt.getExceptions())
- {
- log.debug("Exception thrown during test thread: ", e);
- }
- }
-
- Assert.assertTrue(errorMessage, "".equals(errorMessage));
- }
-
- public void closeBeforeAutoAckManyTimes() throws Exception
- {
- for (int i = 0; i < TEST_COUNT; i++)
- {
- testCloseBeforeAutoAck_QPID_397();
- }
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- connection = getConnection("guest", "guest");
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
deleted file mode 100644
index ec23256f38..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
+++ /dev/null
@@ -1,372 +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.
- *
- *
- */
-package org.apache.qpid.test.unit.close;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.test.utils.QpidClientConnection;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-import org.apache.qpid.url.URLSyntaxException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.Queue;
-import javax.jms.Session;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-public class MessageRequeueTest extends QpidTestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(MessageRequeueTest.class);
-
- protected static AtomicInteger consumerIds = new AtomicInteger(0);
- protected final Integer numTestMessages = 150;
-
- protected final int consumeTimeout = 3000;
-
- protected final String queue = "direct://amq.direct//message-requeue-test-queue";
- protected String payload = "Message:";
-
- protected final String BROKER = "vm://:1";
- private boolean testReception = true;
-
- private long[] receieved = new long[numTestMessages + 1];
- private boolean passed = false;
- QpidClientConnection conn;
-
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- conn = new QpidClientConnection(BROKER);
-
- conn.connect();
- // clear queue
- conn.consume(queue, consumeTimeout);
- // load test data
- _logger.info("creating test data, " + numTestMessages + " messages");
- conn.put(queue, payload, numTestMessages);
- // close this connection
- conn.disconnect();
- }
-
- protected void tearDown() throws Exception
- {
-
- if (!passed) // clean up
- {
- QpidClientConnection conn = new QpidClientConnection(BROKER);
-
- conn.connect();
- // clear queue
- conn.consume(queue, consumeTimeout);
-
- conn.disconnect();
- }
-
- super.tearDown();
- }
-
- /**
- * multiple consumers
- *
- * @throws javax.jms.JMSException if a JMS problem occurs
- * @throws InterruptedException on timeout
- */
- public void testDrain() throws Exception
- {
- QpidClientConnection conn = new QpidClientConnection(BROKER);
-
- conn.connect();
-
- _logger.info("consuming queue " + queue);
- Queue q = conn.getSession().createQueue(queue);
-
- final MessageConsumer consumer = conn.getSession().createConsumer(q);
- int messagesReceived = 0;
-
- long[] messageLog = new long[numTestMessages + 1];
-
- _logger.info("consuming...");
- Message msg = consumer.receive(1000);
- while (msg != null)
- {
- messagesReceived++;
-
- long dt = ((AbstractJMSMessage) msg).getDeliveryTag();
-
- int msgindex = msg.getIntProperty("index");
- if (messageLog[msgindex] != 0)
- {
- _logger.error("Received Message(" + msgindex + ":" + ((AbstractJMSMessage) msg).getDeliveryTag()
- + ") more than once.");
- }
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("Received Message(" + System.identityHashCode(msgindex) + ") " + "DT:" + dt + "IN:" + msgindex);
- }
-
- if (dt == 0)
- {
- _logger.error("DT is zero for msg:" + msgindex);
- }
-
- messageLog[msgindex] = dt;
-
- // get Next message
- msg = consumer.receive(1000);
- }
-
- _logger.info("consuming done.");
- conn.getSession().commit();
- consumer.close();
-
- int index = 0;
- StringBuilder list = new StringBuilder();
- list.append("Failed to receive:");
- int failed = 0;
-
- _logger.info("consumed: " + messagesReceived);
-
- assertEquals("number of consumed messages does not match initial data", (int) numTestMessages, messagesReceived);
- // wit 0_10 we can have a delivery tag of 0
- if (conn.isBroker08())
- {
- for (long b : messageLog)
- {
- if ((b == 0) && (index != 0)) // delivery tag of zero shouldn't exist
- {
- _logger.error("Index: " + index + " was not received.");
- list.append(" ");
- list.append(index);
- list.append(":");
- list.append(b);
- failed++;
- }
-
- index++;
- }
-
- assertEquals(list.toString(), 0, failed);
- }
-
- conn.disconnect();
- passed = true;
- }
-
- /** multiple consumers
- * Based on code subbmitted by client FT-304
- */
- public void testTwoCompetingConsumers()
- {
- Consumer c1 = new Consumer();
- Consumer c2 = new Consumer();
- Consumer c3 = new Consumer();
- Consumer c4 = new Consumer();
-
- Thread t1 = new Thread(c1);
- Thread t2 = new Thread(c2);
- Thread t3 = new Thread(c3);
- Thread t4 = new Thread(c4);
-
- t1.start();
- t2.start();
- t3.start();
- // t4.start();
-
- try
- {
- t1.join();
- t2.join();
- t3.join();
- t4.join();
- }
- catch (InterruptedException e)
- {
- fail("Unable to join to Consumer theads");
- }
-
- _logger.info("consumer 1 count is " + c1.getCount());
- _logger.info("consumer 2 count is " + c2.getCount());
- _logger.info("consumer 3 count is " + c3.getCount());
- _logger.info("consumer 4 count is " + c4.getCount());
-
- Integer totalConsumed = c1.getCount() + c2.getCount() + c3.getCount() + c4.getCount();
-
- // Check all messages were correctly delivered
- int index = 0;
- StringBuilder list = new StringBuilder();
- list.append("Failed to receive:");
- int failed = 0;
- if (conn.isBroker08())
- {
- for (long b : receieved)
- {
- if ((b == 0) && (index != 0)) // delivery tag of zero shouldn't exist (and we don't have msg 0)
- {
- _logger.error("Index: " + index + " was not received.");
- list.append(" ");
- list.append(index);
- list.append(":");
- list.append(b);
- failed++;
- }
-
- index++;
- }
-
- assertEquals(list.toString() + "-" + numTestMessages + "-" + totalConsumed, 0, failed);
- }
- assertEquals("number of consumed messages does not match initial data", numTestMessages, totalConsumed);
- passed = true;
- }
-
- class Consumer implements Runnable
- {
- private Integer count = 0;
- private Integer id;
-
- public Consumer()
- {
- id = consumerIds.addAndGet(1);
- }
-
- public void run()
- {
- try
- {
- _logger.info("consumer-" + id + ": starting");
- QpidClientConnection conn = new QpidClientConnection(BROKER);
-
- conn.connect();
-
- _logger.info("consumer-" + id + ": connected, consuming...");
- Message result;
- do
- {
- result = conn.getNextMessage(queue, consumeTimeout);
- if (result != null)
- {
-
- long dt = ((AbstractJMSMessage) result).getDeliveryTag();
-
- if (testReception)
- {
- int msgindex = result.getIntProperty("index");
- if (receieved[msgindex] != 0)
- {
- _logger.error("Received Message(" + msgindex + ":"
- + ((AbstractJMSMessage) result).getDeliveryTag() + ") more than once.");
- }
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("Received Message(" + System.identityHashCode(msgindex) + ") " + "DT:" + dt
- + "IN:" + msgindex);
- }
-
- if (dt == 0)
- {
- _logger.error("DT is zero for msg:" + msgindex);
- }
-
- receieved[msgindex] = dt;
- }
-
- count++;
- if ((count % 100) == 0)
- {
- _logger.info("consumer-" + id + ": got " + result + ", new count is " + count);
- }
- }
- }
- while (result != null);
-
- _logger.info("consumer-" + id + ": complete");
- conn.disconnect();
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public Integer getCount()
- {
- return count;
- }
-
- public Integer getId()
- {
- return id;
- }
- }
-
- public void testRequeue() throws JMSException, AMQException, URLSyntaxException
- {
- int run = 0;
- // while (run < 10)
- {
- run++;
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("testRequeue run " + run);
- }
-
- String virtualHost = "/test";
- String brokerlist = BROKER;
- String brokerUrl = "amqp://guest:guest@" + virtualHost + "?brokerlist='" + brokerlist + "'";
- QpidClientConnection qpc = new QpidClientConnection(BROKER);
- qpc.connect();
- Connection conn = qpc. getConnection();
-
- Session session = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- Queue q = session.createQueue(queue);
-
- _logger.debug("Create Consumer");
- MessageConsumer consumer = session.createConsumer(q);
-
- conn.start();
-
- _logger.debug("Receiving msg");
- Message msg = consumer.receive(2000);
-
- assertNotNull("Message should not be null", msg);
-
- // As we have not ack'd message will be requeued.
- _logger.debug("Close Consumer");
- consumer.close();
-
- _logger.debug("Close Connection");
- conn.close();
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java
deleted file mode 100644
index da7642fb3c..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java
+++ /dev/null
@@ -1,69 +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.
- *
- */package org.apache.qpid.test.unit.close;
-
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-/**
- * @author Apache Software Foundation
- */
-public class TopicPublisherCloseTest extends QpidTestCase
-{
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testAllMethodsThrowAfterConnectionClose() throws Exception
- {
- // give external brokers a chance to start up
- Thread.sleep(3000);
-
- AMQConnection connection = (AMQConnection) getConnection("guest", "guest");
-
- Topic destination1 = new AMQTopic(connection, "t1");
- TopicSession session1 = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- TopicPublisher pub = session1.createPublisher(destination1);
- connection.close();
- try
- {
- pub.getDeliveryMode();
- fail("Expected exception not thrown");
- }
- catch (javax.jms.IllegalStateException e)
- {
- // PASS
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ct/DurableSubscriberTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ct/DurableSubscriberTest.java
deleted file mode 100644
index 19b73fcc7c..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ct/DurableSubscriberTest.java
+++ /dev/null
@@ -1,167 +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.
- */
-package org.apache.qpid.test.unit.ct;
-
-import javax.jms.*;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-
-/**
- * Crash Recovery tests for durable subscription
- *
- */
-public class DurableSubscriberTest extends QpidTestCase
-{
- private final String _topicName = "durableSubscriberTopic";
-
- /**
- * test strategy:
- * create and register a durable subscriber then close it
- * create a publisher and send a persistant message followed by a non persistant message
- * crash and restart the broker
- * recreate the durable subscriber and check that only the first message is received
- */
- public void testDurSubRestoredAfterNonPersistentMessageSent() throws Exception
- {
- if (!isBroker08())
- {
- TopicConnectionFactory factory = getConnectionFactory();
- Topic topic = (Topic) getInitialContext().lookup(_topicName);
- //create and register a durable subscriber then close it
- TopicConnection durConnection = factory.createTopicConnection("guest", "guest");
- TopicSession durSession = durConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- TopicSubscriber durSub1 = durSession.createDurableSubscriber(topic, "dursub");
- durConnection.start();
- durSub1.close();
- durSession.close();
- durConnection.stop();
-
- //create a publisher and send a persistant message followed by a non persistant message
- TopicConnection pubConnection = factory.createTopicConnection("guest", "guest");
- TopicSession pubSession = pubConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- TopicPublisher publisher = pubSession.createPublisher(topic);
- Message message = pubSession.createMessage();
- message.setIntProperty("count", 1);
- publisher.publish(message, javax.jms.DeliveryMode.PERSISTENT, javax.jms.Message.DEFAULT_PRIORITY,
- javax.jms.Message.DEFAULT_TIME_TO_LIVE);
- message.setIntProperty("count", 2);
- publisher.publish(message, javax.jms.DeliveryMode.NON_PERSISTENT, javax.jms.Message.DEFAULT_PRIORITY,
- javax.jms.Message.DEFAULT_TIME_TO_LIVE);
- publisher.close();
- pubSession.close();
- //now stop the server
- try
- {
- restartBroker();
- }
- catch (Exception e)
- {
- System.out.println("problems shutting down arjuna-ms");
- throw e;
- }
- //now recreate the durable subscriber and check the received messages
- factory = getConnectionFactory();
- topic = (Topic) getInitialContext().lookup(_topicName);
- TopicConnection durConnection2 = factory.createTopicConnection("guest", "guest");
- TopicSession durSession2 = durConnection2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- TopicSubscriber durSub2 = durSession2.createDurableSubscriber(topic, "dursub");
- durConnection2.start();
- Message m1 = durSub2.receive(1000);
- if (m1 == null)
- {
- assertTrue("testDurSubRestoredAfterNonPersistentMessageSent test failed. no message was returned",
- false);
- }
- assertTrue("testDurSubRestoredAfterNonPersistentMessageSent test failed. Wrong message was returned.",
- m1.getIntProperty("count") == 1);
- durSession2.unsubscribe("dursub");
- durConnection2.close();
- }
- }
-
- /**
- * create and register a durable subscriber with a message selector and then close it
- * crash the broker
- * create a publisher and send 5 right messages and 5 wrong messages
- * recreate the durable subscriber and check the received the 5 expected messages
- */
- public void testDurSubRestoresMessageSelector() throws Exception
- {
- if (!isBroker08())
- {
- TopicConnectionFactory factory = getConnectionFactory();
- Topic topic = (Topic) getInitialContext().lookup(_topicName);
- //create and register a durable subscriber with a message selector and then close it
- TopicConnection durConnection = factory.createTopicConnection("guest", "guest");
- TopicSession durSession = durConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- TopicSubscriber durSub1 = durSession.createDurableSubscriber(topic, "dursub", "testprop='true'", false);
- durConnection.start();
- durSub1.close();
- durSession.close();
- durConnection.stop();
- //now stop the server
- try
- {
- restartBroker();
- }
- catch (Exception e)
- {
- System.out.println("problems shutting down arjuna-ms");
- throw e;
- }
- topic = (Topic) getInitialContext().lookup(_topicName);
- factory = getConnectionFactory();
- TopicConnection pubConnection = factory.createTopicConnection("guest", "guest");
- TopicSession pubSession = pubConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- TopicPublisher publisher = pubSession.createPublisher(topic);
- for (int i = 0; i < 5; i++)
- {
- Message message = pubSession.createMessage();
- message.setStringProperty("testprop", "true");
- publisher.publish(message);
- message = pubSession.createMessage();
- message.setStringProperty("testprop", "false");
- publisher.publish(message);
- }
- publisher.close();
- pubSession.close();
-
- //now recreate the durable subscriber and check the received messages
- TopicConnection durConnection2 = factory.createTopicConnection("guest", "guest");
- TopicSession durSession2 = durConnection2.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- TopicSubscriber durSub2 = durSession2.createDurableSubscriber(topic, "dursub");
- durConnection2.start();
- for (int i = 0; i < 5; i++)
- {
- Message message = durSub2.receive(1000);
- if (message == null)
- {
- assertTrue("testDurSubRestoresMessageSelector test failed. no message was returned", false);
- }
- else
- {
- assertTrue("testDurSubRestoresMessageSelector test failed. message selector not reset",
- message.getStringProperty("testprop").equals("true"));
- }
- }
- durSession2.unsubscribe("dursub");
- durConnection2.close();
- }
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java
deleted file mode 100644
index b30e3c1c1c..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java
+++ /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.
- *
- */
-
-package org.apache.qpid.test.unit.message;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-/**
- * @author Apache Software Foundation
- */
-public class JMSDestinationTest extends QpidTestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(JMSDestinationTest.class);
-
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testJMSDestination() throws Exception
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
- AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- Queue queue =
- new AMQQueue(con.getDefaultQueueExchangeName(), new AMQShortString("someQ"), new AMQShortString("someQ"), false,
- true);
- MessageConsumer consumer = consumerSession.createConsumer(queue);
-
- Connection con2 = (AMQConnection) getConnection("guest", "guest");
- Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- MessageProducer producer = producerSession.createProducer(queue);
-
- TextMessage sentMsg = producerSession.createTextMessage("hello");
- assertNull(sentMsg.getJMSDestination());
-
- producer.send(sentMsg);
-
- assertEquals(sentMsg.getJMSDestination(), queue);
-
- con2.close();
-
- con.start();
-
- TextMessage rm = (TextMessage) consumer.receive();
- assertNotNull(rm);
-
- assertEquals(rm.getJMSDestination(), queue);
- con.close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
deleted file mode 100644
index 1f90f1e29f..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
+++ /dev/null
@@ -1,135 +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.
- *
- */
-package org.apache.qpid.test.unit.message;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.message.NonQpidObjectMessage;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Destination;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.Session;
-import java.util.Enumeration;
-
-/**
- * @author Apache Software Foundation
- */
-public class JMSPropertiesTest extends QpidTestCase
-{
-
- private static final Logger _logger = LoggerFactory.getLogger(JMSPropertiesTest.class);
-
- public String _connectionString = "vm://:1";
-
- public static final String JMS_CORR_ID = "QPIDID_01";
- public static final int JMS_DELIV_MODE = 1;
- public static final String JMS_TYPE = "test.jms.type";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testJMSProperties() throws Exception
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
- AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- Queue queue =
- new AMQQueue(con.getDefaultQueueExchangeName(), new AMQShortString("someQ"), new AMQShortString("someQ"), false,
- true);
- MessageConsumer consumer = consumerSession.createConsumer(queue);
-
- AMQConnection con2 = (AMQConnection) getConnection("guest", "guest");
- Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- MessageProducer producer = producerSession.createProducer(queue);
- Destination JMS_REPLY_TO = new AMQQueue(con2, "my.replyto");
- // create a test message to send
- ObjectMessage sentMsg = new NonQpidObjectMessage(producerSession);
- sentMsg.setJMSCorrelationID(JMS_CORR_ID);
- sentMsg.setJMSDeliveryMode(JMS_DELIV_MODE);
- sentMsg.setJMSType(JMS_TYPE);
- sentMsg.setJMSReplyTo(JMS_REPLY_TO);
-
- String JMSXGroupID_VALUE = "group";
- sentMsg.setStringProperty("JMSXGroupID", JMSXGroupID_VALUE);
-
- int JMSXGroupSeq_VALUE = 1;
- sentMsg.setIntProperty("JMSXGroupSeq", JMSXGroupSeq_VALUE);
-
- // send it
- producer.send(sentMsg);
-
- con2.close();
-
- con.start();
-
- // get message and check JMS properties
- ObjectMessage rm = (ObjectMessage) consumer.receive(2000);
- assertNotNull(rm);
-
- assertEquals("JMS Correlation ID mismatch", sentMsg.getJMSCorrelationID(), rm.getJMSCorrelationID());
- // TODO: Commented out as always overwritten by send delivery mode value - prob should not set in conversion
- // assertEquals("JMS Delivery Mode mismatch",sentMsg.getJMSDeliveryMode(),rm.getJMSDeliveryMode());
- assertEquals("JMS Type mismatch", sentMsg.getJMSType(), rm.getJMSType());
- assertEquals("JMS Reply To mismatch", sentMsg.getJMSReplyTo(), rm.getJMSReplyTo());
- assertTrue("JMSMessageID Does not start ID:", rm.getJMSMessageID().startsWith("ID:"));
-
- //Validate that the JMSX values are correct
- assertEquals("JMSXGroupID is not as expected:", JMSXGroupID_VALUE, rm.getStringProperty("JMSXGroupID"));
- assertEquals("JMSXGroupSeq is not as expected:", JMSXGroupSeq_VALUE, rm.getIntProperty("JMSXGroupSeq"));
-
- boolean JMSXGroupID_Available = false;
- boolean JMSXGroupSeq_Available = false;
- Enumeration props = con.getMetaData().getJMSXPropertyNames();
- while (props.hasMoreElements())
- {
- String name = (String) props.nextElement();
- if (name.equals("JMSXGroupID"))
- {
- JMSXGroupID_Available = true;
- }
- if (name.equals("JMSXGroupSeq"))
- {
- JMSXGroupSeq_Available = true;
- }
- }
-
- assertTrue("JMSXGroupID not available.",JMSXGroupID_Available);
- assertTrue("JMSXGroupSeq not available.",JMSXGroupSeq_Available);
-
- con.close();
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/StreamMessageTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/StreamMessageTest.java
deleted file mode 100644
index 7978e2c818..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/StreamMessageTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.unit.message;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQHeadersExchange;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.configuration.ClientProperties;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.qpid.url.BindingURL;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageEOFException;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.StreamMessage;
-
-/**
- * @author Apache Software Foundation
- */
-public class StreamMessageTest extends QpidTestCase
-{
-
- private static final Logger _logger = LoggerFactory.getLogger(StreamMessageTest.class);
-
- public String _connectionString = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testStreamMessageEOF() throws Exception
- {
- Connection con = (AMQConnection) getConnection("guest", "guest");
- AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- AMQHeadersExchange queue =
- new AMQHeadersExchange(new AMQBindingURL(
- ExchangeDefaults.HEADERS_EXCHANGE_CLASS + "://" + ExchangeDefaults.HEADERS_EXCHANGE_NAME
- + "/test/queue1?" + BindingURL.OPTION_ROUTING_KEY + "='F0000=1'"));
- FieldTable ft = new FieldTable();
- ft.setString("F1000", "1");
- MessageConsumer consumer =
- consumerSession.createConsumer(queue, Integer.parseInt(ClientProperties.MAX_PREFETCH_DEFAULT), Integer.parseInt(ClientProperties.MAX_PREFETCH_DEFAULT), false, false, (String) null, ft);
-
- // force synch to ensure the consumer has resulted in a bound queue
- // ((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.HEADERS_EXCHANGE_NAME, ExchangeDefaults.HEADERS_EXCHANGE_CLASS);
- // This is the default now
-
- Connection con2 = (AMQConnection) getConnection("guest", "guest");
-
- AMQSession producerSession = (AMQSession) con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
-
- // Need to start the "producer" connection in order to receive bounced messages
- _logger.info("Starting producer connection");
- con2.start();
-
- MessageProducer mandatoryProducer = producerSession.createProducer(queue);
-
- // Third test - should be routed
- _logger.info("Sending isBound message");
- StreamMessage msg = producerSession.createStreamMessage();
-
- msg.setStringProperty("F1000", "1");
-
- msg.writeByte((byte) 42);
-
- mandatoryProducer.send(msg);
-
- _logger.info("Starting consumer connection");
- con.start();
-
- StreamMessage msg2 = (StreamMessage) consumer.receive(2000);
- assertNotNull(msg2);
-
- msg2.readByte();
- try
- {
- msg2.readByte();
- }
- catch (Exception e)
- {
- assertTrue("Expected MessageEOFException: " + e, e instanceof MessageEOFException);
- }
- con.close();
- con2.close();
- }
-
- public void testModifyReceivedMessageExpandsBuffer() throws Exception
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
- AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- AMQQueue queue = new AMQQueue(con.getDefaultQueueExchangeName(), new AMQShortString("testQ"));
- MessageConsumer consumer = consumerSession.createConsumer(queue);
- consumer.setMessageListener(new MessageListener()
- {
-
- public void onMessage(Message message)
- {
- StreamMessage sm = (StreamMessage) message;
- try
- {
- sm.clearBody();
- sm.writeString("dfgjshfslfjshflsjfdlsjfhdsljkfhdsljkfhsd");
- }
- catch (JMSException e)
- {
- _logger.error("Error when writing large string to received msg: " + e, e);
- fail("Error when writing large string to received msg" + e);
- }
- }
- });
-
- Connection con2 = (AMQConnection) getConnection("guest", "guest");
- AMQSession producerSession = (AMQSession) con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- MessageProducer mandatoryProducer = producerSession.createProducer(queue);
- con.start();
- StreamMessage sm = producerSession.createStreamMessage();
- sm.writeInt(42);
- mandatoryProducer.send(sm);
- Thread.sleep(2000);
- con.close();
- con2.close();
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8En b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8En
deleted file mode 100644
index c9734b1988..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8En
+++ /dev/null
@@ -1,4 +0,0 @@
-exhangeName
-queueName
-routingkey
-data \ No newline at end of file
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Jp b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Jp
deleted file mode 100644
index ae10752dab..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Jp
+++ /dev/null
@@ -1,4 +0,0 @@
-設定ãŒãã®ã‚ˆã†ã«æ§‹æˆã•ã‚Œã¦ã„ãªã‘ã‚Œã°ãª
-çš„æŸäº›æ›´æ–°æ²¡æœ‰å‡ºçŽ°åœ¨è¿™ä¸ª README 中。你å¯ä»¥è®¿é—®ä¸‹é¢çš„
-çš„å‘行版本包括多张光盘,其中包括安装光盘和æºç å…‰ç›˜
-ç›®ã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ« CD ã¯ã€ã»ã¨ã‚“ã©ã®æœ€è¿‘ã®ã‚·ã‚¹ \ No newline at end of file
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java
deleted file mode 100644
index 39ecf0a209..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/message/UTF8Test.java
+++ /dev/null
@@ -1,122 +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.
- *
- */
-package org.apache.qpid.test.unit.message;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.transport.Connection;
-import org.apache.qpid.transport.Session;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.naming.InitialContext;
-import javax.jms.*;
-import java.util.Properties;
-import java.io.*;
-
-
-/**
- * @author Apache Software Foundation
- * This test makes sure that utf8 characters can be used for
- * specifying exchange, queue name and routing key.
- *
- * those tests are related to qpid-1384
- */
-public class UTF8Test extends QpidTestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(UTF8Test.class);
-
-
- public void testPlainEn() throws Exception
- {
- invoke("UTF8En");
- }
-
-
- public void testUTF8Jp() throws Exception
- {
- invoke("UTF8Jp");
- }
-
-
- private void invoke(String name) throws Exception
- {
- String path = System.getProperties().getProperty("QPID_HOME");
- path = path + "/../systests/src/main/java/org/apache/qpid/test/unit/message/" + name;
- BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(path), "UTF8"));
- runTest(in.readLine(), in.readLine(), in.readLine(), in.readLine());
- in.close();
- }
- private void runTest(String exchangeName, String queueName, String routingKey, String data) throws Exception
- {
- _logger.info("Running test for exchange: " + exchangeName
- + " queue Name: " + queueName
- + " routing key: " + routingKey);
- declareQueue(exchangeName, routingKey, queueName);
-
- javax.jms.Connection con = getConnection();
- javax.jms.Session sess = con.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
- Destination dest = getDestination(exchangeName, routingKey, queueName);
- // Send data
- MessageProducer msgProd = sess.createProducer(dest);
- TextMessage message = sess.createTextMessage(data);
- msgProd.send(message);
- // consume data
- MessageConsumer msgCons = sess.createConsumer(dest);
- con.start();
- TextMessage m = (TextMessage) msgCons.receive(RECEIVE_TIMEOUT);
- assertNotNull(m);
- assertEquals(m.getText(), data);
- }
-
- private void declareQueue(String exch, String routkey, String qname) throws Exception
- {
- Connection conn = new Connection();
- if (!_broker.equals(QpidTestCase.EXTERNAL) && !isBroker08())
- {
- conn.connect("localhost", 5672, "test", "guest", "guest",false);
- }
- else
- {
- throw new Exception("unsupported test " +
- "configuration. broker: " + _broker + " version > 0.10 "+ !isBroker08() + " This test must be run on a local broker using protocol 0.10 or higher.");
- }
- Session sess = conn.createSession(0);
- sess.exchangeDeclare(exch, "direct", null, null);
- sess.queueDeclare(qname, null, null);
- sess.exchangeBind(qname, exch, routkey, null);
- sess.sync();
- conn.close();
- }
-
- private Destination getDestination(String exch, String routkey, String qname)
- throws Exception
- {
- Properties props = new Properties();
- props.setProperty("destination.directUTF8Queue",
- "direct://" + exch + "//" + qname + "?autodelete='false'&durable='false'"
- + "&routingkey='" + routkey + "'");
-
- // Get our connection context
- InitialContext ctx = new InitialContext(props);
- return (Destination) ctx.lookup("directUTF8Queue");
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
deleted file mode 100644
index c6a953dbc2..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
+++ /dev/null
@@ -1,416 +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.
- *
- */
-package org.apache.qpid.test.unit.topic;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.InvalidDestinationException;
-import javax.jms.InvalidSelectorException;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.TopicSubscriber;
-
-/**
- * @todo Code to check that a consumer gets only one particular method could be factored into a re-usable method (as
- * a static on a base test helper class, e.g. TestUtils.
- *
- * @todo Code to create test end-points using session per connection, or all sessions on one connection, to be factored
- * out to make creating this test variation simpler. Want to make this variation available through LocalCircuit,
- * driven by the test model.
- */
-public class DurableSubscriptionTest extends QpidTestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(DurableSubscriptionTest.class);
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testUnsubscribe() throws Exception
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
- AMQTopic topic = new AMQTopic(con, "MyDurableSubscriptionTestTopic");
- _logger.info("Create Session 1");
- Session session1 = con.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- _logger.info("Create Consumer on Session 1");
- MessageConsumer consumer1 = session1.createConsumer(topic);
- _logger.info("Create Producer on Session 1");
- MessageProducer producer = session1.createProducer(topic);
-
- _logger.info("Create Session 2");
- Session session2 = con.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- _logger.info("Create Durable Subscriber on Session 2");
- TopicSubscriber consumer2 = session2.createDurableSubscriber(topic, "MySubscription");
-
- _logger.info("Starting connection");
- con.start();
-
- _logger.info("Producer sending message A");
- producer.send(session1.createTextMessage("A"));
-
- Message msg;
- _logger.info("Receive message on consumer 1:expecting A");
- msg = consumer1.receive();
- assertEquals("A", ((TextMessage) msg).getText());
- _logger.info("Receive message on consumer 1 :expecting null");
- msg = consumer1.receive(1000);
- assertEquals(null, msg);
-
- _logger.info("Receive message on consumer 1:expecting A");
- msg = consumer2.receive();
- assertEquals("A", ((TextMessage) msg).getText());
- msg = consumer2.receive(1000);
- _logger.info("Receive message on consumer 1 :expecting null");
- assertEquals(null, msg);
-
- _logger.info("Unsubscribe session2/consumer2");
- session2.unsubscribe("MySubscription");
-
- _logger.info("Producer sending message B");
- producer.send(session1.createTextMessage("B"));
-
- _logger.info("Receive message on consumer 1 :expecting B");
- msg = consumer1.receive();
- assertEquals("B", ((TextMessage) msg).getText());
- _logger.info("Receive message on consumer 1 :expecting null");
- msg = consumer1.receive(1000);
- assertEquals(null, msg);
-
- _logger.info("Receive message on consumer 2 :expecting null");
- msg = consumer2.receive(1000);
- assertEquals(null, msg);
-
- _logger.info("Close connection");
- con.close();
- }
-
- public void testDurabilityAUTOACK() throws Exception
- {
- durabilityImpl(Session.AUTO_ACKNOWLEDGE);
- }
-
- public void testDurabilityNOACKSessionPerConnection() throws Exception
- {
- durabilityImplSessionPerConnection(AMQSession.NO_ACKNOWLEDGE);
- }
-
- public void testDurabilityAUTOACKSessionPerConnection() throws Exception
- {
- durabilityImplSessionPerConnection(Session.AUTO_ACKNOWLEDGE);
- }
-
- private void durabilityImpl(int ackMode) throws Exception
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
- AMQTopic topic = new AMQTopic(con, "MyTopic");
- Session session1 = con.createSession(false, ackMode);
- MessageConsumer consumer1 = session1.createConsumer(topic);
-
- Session sessionProd = con.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- MessageProducer producer = sessionProd.createProducer(topic);
-
- Session session2 = con.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- TopicSubscriber consumer2 = session2.createDurableSubscriber(topic, "MySubscription");
-
- con.start();
-
- producer.send(session1.createTextMessage("A"));
-
- Message msg;
- msg = consumer1.receive();
- assertEquals("A", ((TextMessage) msg).getText());
- msg = consumer1.receive(1000);
- assertEquals(null, msg);
-
- msg = consumer2.receive();
- assertEquals("A", ((TextMessage) msg).getText());
- msg = consumer2.receive(1000);
- assertEquals(null, msg);
-
- consumer2.close();
-
- producer.send(session1.createTextMessage("B"));
-
- _logger.info("Receive message on consumer 1 :expecting B");
- msg = consumer1.receive(500);
- assertNotNull("Consumer 1 should get message 'B'.", msg);
- assertEquals("Incorrect Message recevied on consumer1.", "B", ((TextMessage) msg).getText());
- _logger.info("Receive message on consumer 1 :expecting null");
- msg = consumer1.receive(500);
- assertNull("There should be no more messages for consumption on consumer1.", msg);
-
- Session session3 = con.createSession(false, ackMode);
- MessageConsumer consumer3 = session3.createDurableSubscriber(topic, "MySubscription");
-
- _logger.info("Receive message on consumer 3 :expecting B");
- msg = consumer3.receive(500);
- assertNotNull("Consumer 3 should get message 'B'.", msg);
- assertEquals("Incorrect Message recevied on consumer4.", "B", ((TextMessage) msg).getText());
- _logger.info("Receive message on consumer 3 :expecting null");
- msg = consumer3.receive(500);
- assertNull("There should be no more messages for consumption on consumer3.", msg);
-
- consumer1.close();
- consumer3.close();
-
- session3.unsubscribe("MySubscription");
-
- con.close();
- }
-
- private void durabilityImplSessionPerConnection(int ackMode) throws Exception
- {
- Message msg;
- // Create producer.
- AMQConnection con0 = (AMQConnection) getConnection("guest", "guest");
- con0.start();
- Session session0 = con0.createSession(false, ackMode);
-
- AMQTopic topic = new AMQTopic(con0, "MyTopic");
-
- Session sessionProd = con0.createSession(false, ackMode);
- MessageProducer producer = sessionProd.createProducer(topic);
-
- // Create consumer 1.
- AMQConnection con1 = (AMQConnection) getConnection("guest", "guest");
- con1.start();
- Session session1 = con1.createSession(false, ackMode);
-
- MessageConsumer consumer1 = session0.createConsumer(topic);
-
- // Create consumer 2.
- AMQConnection con2 = (AMQConnection) getConnection("guest", "guest");
- con2.start();
- Session session2 = con2.createSession(false, ackMode);
-
- TopicSubscriber consumer2 = session2.createDurableSubscriber(topic, "MySubscription");
-
- // Send message and check that both consumers get it and only it.
- producer.send(session0.createTextMessage("A"));
-
- msg = consumer1.receive(500);
- assertNotNull("Message should be available", msg);
- assertEquals("Message Text doesn't match", "A", ((TextMessage) msg).getText());
- msg = consumer1.receive(500);
- assertNull("There should be no more messages for consumption on consumer1.", msg);
-
- msg = consumer2.receive();
- assertNotNull(msg);
- assertEquals("Consumer 2 should also received the first msg.", "A", ((TextMessage) msg).getText());
- msg = consumer2.receive(500);
- assertNull("There should be no more messages for consumption on consumer2.", msg);
-
- // Detach the durable subscriber.
- consumer2.close();
- session2.close();
- con2.close();
-
- // Send message and receive on open consumer.
- producer.send(session0.createTextMessage("B"));
-
- _logger.info("Receive message on consumer 1 :expecting B");
- msg = consumer1.receive(1000);
- assertEquals("B", ((TextMessage) msg).getText());
- _logger.info("Receive message on consumer 1 :expecting null");
- msg = consumer1.receive(1000);
- assertEquals(null, msg);
-
- // Re-attach a new consumer to the durable subscription, and check that it gets the message that it missed.
- AMQConnection con3 = (AMQConnection) getConnection("guest", "guest");
- con3.start();
- Session session3 = con3.createSession(false, ackMode);
-
- TopicSubscriber consumer3 = session3.createDurableSubscriber(topic, "MySubscription");
-
- _logger.info("Receive message on consumer 3 :expecting B");
- msg = consumer3.receive(500);
- assertNotNull("Consumer 3 should get message 'B'.", msg);
- assertEquals("Incorrect Message recevied on consumer4.", "B", ((TextMessage) msg).getText());
- _logger.info("Receive message on consumer 3 :expecting null");
- msg = consumer3.receive(500);
- assertNull("There should be no more messages for consumption on consumer3.", msg);
-
- consumer1.close();
- consumer3.close();
-
- session3.unsubscribe("MySubscription");
-
- con0.close();
- con1.close();
- con3.close();
- }
-
- /***
- * This tests the fix for QPID-1085
- * Creates a durable subscriber with an invalid selector, checks that the
- * exception is thrown correctly and that the subscription is not created.
- * @throws Exception
- */
- public void testDurableWithInvalidSelector() throws Exception
- {
- Connection conn = getConnection();
- conn.start();
- Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
- AMQTopic topic = new AMQTopic((AMQConnection) conn, "MyTestDurableWithInvalidSelectorTopic");
- MessageProducer producer = session.createProducer(topic);
- producer.send(session.createTextMessage("testDurableWithInvalidSelector1"));
- try
- {
- TopicSubscriber deadSubscriber = session.createDurableSubscriber(topic, "testDurableWithInvalidSelectorSub",
- "=TEST 'test", true);
- assertNull("Subscriber should not have been created", deadSubscriber);
- }
- catch (JMSException e)
- {
- assertTrue("Wrong type of exception thrown", e instanceof InvalidSelectorException);
- }
-
- TopicSubscriber liveSubscriber = session.createDurableSubscriber(topic, "testDurableWithInvalidSelectorSub");
- assertNotNull("Subscriber should have been created", liveSubscriber);
-
- producer.send(session.createTextMessage("testDurableWithInvalidSelector2"));
-
- Message msg = liveSubscriber.receive();
- assertNotNull ("Message should have been received", msg);
- assertEquals ("testDurableWithInvalidSelector2", ((TextMessage) msg).getText());
- assertNull("Should not receive subsequent message", liveSubscriber.receive(200));
- session.unsubscribe("testDurableWithInvalidSelectorSub");
- }
-
- /***
- * This tests the fix for QPID-1085
- * Creates a durable subscriber with an invalid destination, checks that the
- * exception is thrown correctly and that the subscription is not created.
- * @throws Exception
- */
- public void testDurableWithInvalidDestination() throws Exception
- {
- Connection conn = getConnection();
- conn.start();
- Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
- AMQTopic topic = new AMQTopic((AMQConnection) conn, "testDurableWithInvalidDestinationTopic");
- try
- {
- TopicSubscriber deadSubscriber = session.createDurableSubscriber(null, "testDurableWithInvalidDestinationsub");
- assertNull("Subscriber should not have been created", deadSubscriber);
- }
- catch (InvalidDestinationException e)
- {
- // This was expected
- }
- MessageProducer producer = session.createProducer(topic);
- producer.send(session.createTextMessage("testDurableWithInvalidSelector1"));
-
- TopicSubscriber liveSubscriber = session.createDurableSubscriber(topic, "testDurableWithInvalidDestinationsub");
- assertNotNull("Subscriber should have been created", liveSubscriber);
-
- producer.send(session.createTextMessage("testDurableWithInvalidSelector2"));
- Message msg = liveSubscriber.receive();
- assertNotNull ("Message should have been received", msg);
- assertEquals ("testDurableWithInvalidSelector2", ((TextMessage) msg).getText());
- assertNull("Should not receive subsequent message", liveSubscriber.receive(200));
-
- session.unsubscribe("testDurableWithInvalidDestinationsub");
- }
-
- /**
- * Tests QPID-1202
- * Creates a durable subscription with a selector, then changes that selector on resubscription
- * @throws Exception
- */
- public void testResubscribeWithChangedSelector() throws Exception
- {
- Connection conn = getConnection();
- conn.start();
- Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
- AMQTopic topic = new AMQTopic((AMQConnection) conn, "testResubscribeWithChangedSelector");
- MessageProducer producer = session.createProducer(topic);
-
- // Create durable subscriber that matches A
- TopicSubscriber subA = session.createDurableSubscriber(topic,
- "testResubscribeWithChangedSelector",
- "Match = True", false);
-
- // Send 1 matching message and 1 non-matching message
- sendMatchingAndNonMatchingMessage(session, producer);
-
- Message rMsg = subA.receive(1000);
- assertNotNull(rMsg);
- assertEquals("Content was wrong",
- "testResubscribeWithChangedSelector1",
- ((TextMessage) rMsg).getText());
-
- rMsg = subA.receive(1000);
- assertNull(rMsg);
-
- // Disconnect subscriber
- subA.close();
-
- // Reconnect with new selector that matches B
- TopicSubscriber subB = session.createDurableSubscriber(topic,
- "testResubscribeWithChangedSelector","Match = False", false);
-
-
- // Check messages are recieved properly
- sendMatchingAndNonMatchingMessage(session, producer);
- rMsg = subB.receive(1000);
- assertNotNull(rMsg);
- assertEquals("Content was wrong",
- "testResubscribeWithChangedSelector2",
- ((TextMessage) rMsg).getText());
-
- rMsg = subB.receive(1000);
- assertNull(rMsg);
- session.unsubscribe("testResubscribeWithChangedSelector");
- }
-
- private void sendMatchingAndNonMatchingMessage(Session session, MessageProducer producer) throws JMSException
- {
- TextMessage msg = session.createTextMessage("testResubscribeWithChangedSelector1");
- msg.setBooleanProperty("Match", true);
- producer.send(msg);
- msg = session.createTextMessage("testResubscribeWithChangedSelector2");
- msg.setBooleanProperty("Match", false);
- producer.send(msg);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(DurableSubscriptionTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java
deleted file mode 100644
index 6d115d1a2b..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.unit.topic;
-
-import javax.jms.MessageConsumer;
-import javax.jms.TextMessage;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-/**
- * @author Apache Software Foundation
- */
-public class TopicPublisherTest extends QpidTestCase
-{
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
- public void testUnidentifiedProducer() throws Exception
- {
-
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
- AMQTopic topic = new AMQTopic(con,"MyTopic");
- TopicSession session1 = con.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
- TopicPublisher publisher = session1.createPublisher(null);
- MessageConsumer consumer1 = session1.createConsumer(topic);
- con.start();
- publisher.publish(topic, session1.createTextMessage("Hello"));
- TextMessage m = (TextMessage) consumer1.receive(2000);
- assertNotNull(m);
- try
- {
- publisher.publish(session1.createTextMessage("Goodbye"));
- fail("Did not throw UnsupportedOperationException");
- }
- catch (UnsupportedOperationException e)
- {
- // PASS
- }
- con.close();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TopicPublisherTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
deleted file mode 100644
index 9f4c9e53aa..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
+++ /dev/null
@@ -1,419 +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.
- *
- */
-package org.apache.qpid.test.unit.topic;
-
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.Session;
-import javax.jms.TemporaryTopic;
-import javax.jms.TextMessage;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-import javax.jms.TopicSubscriber;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.AMQTopicSessionAdaptor;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-
-/** @author Apache Software Foundation */
-public class TopicSessionTest extends QpidTestCase
-{
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- }
-
-
- public void testTopicSubscriptionUnsubscription() throws Exception
- {
-
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
- AMQTopic topic = new AMQTopic(con.getDefaultTopicExchangeName(), "MyTopic");
- TopicSession session1 = con.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
- TopicSubscriber sub = session1.createDurableSubscriber(topic, "subscription0");
- TopicPublisher publisher = session1.createPublisher(topic);
-
- con.start();
-
- TextMessage tm = session1.createTextMessage("Hello");
- publisher.publish(tm);
-
- tm = (TextMessage) sub.receive(2000);
- assertNotNull(tm);
-
- session1.unsubscribe("subscription0");
-
- try
- {
- session1.unsubscribe("not a subscription");
- fail("expected InvalidDestinationException when unsubscribing from unknown subscription");
- }
- catch (InvalidDestinationException e)
- {
- ; // PASS
- }
- catch (Exception e)
- {
- fail("expected InvalidDestinationException when unsubscribing from unknown subscription, got: " + e);
- }
-
- con.close();
- }
-
- public void testSubscriptionNameReuseForDifferentTopicSingleConnection() throws Exception
- {
- subscriptionNameReuseForDifferentTopic(false);
- }
-
- public void testSubscriptionNameReuseForDifferentTopicTwoConnections() throws Exception
- {
- subscriptionNameReuseForDifferentTopic(true);
- }
-
- private void subscriptionNameReuseForDifferentTopic(boolean shutdown) throws Exception
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
- AMQTopic topic = new AMQTopic(con, "MyTopic1" + String.valueOf(shutdown));
- AMQTopic topic2 = new AMQTopic(con, "MyOtherTopic1" + String.valueOf(shutdown));
-
- TopicSession session1 = con.createTopicSession(false, AMQSession.AUTO_ACKNOWLEDGE);
- TopicSubscriber sub = session1.createDurableSubscriber(topic, "subscription0");
- TopicPublisher publisher = session1.createPublisher(null);
-
- con.start();
-
- publisher.publish(topic, session1.createTextMessage("hello"));
- TextMessage m = (TextMessage) sub.receive(2000);
- assertNotNull(m);
-
- if (shutdown)
- {
- session1.close();
- con.close();
- con = (AMQConnection) getConnection("guest", "guest");
- con.start();
- session1 = con.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
- publisher = session1.createPublisher(null);
- }
- TopicSubscriber sub2 = session1.createDurableSubscriber(topic2, "subscription0");
- publisher.publish(topic, session1.createTextMessage("hello"));
- if (!shutdown)
- {
- m = (TextMessage) sub.receive(2000);
- assertNull(m);
- }
- publisher.publish(topic2, session1.createTextMessage("goodbye"));
- m = (TextMessage) sub2.receive(2000);
- assertNotNull(m);
- assertEquals("goodbye", m.getText());
- session1.unsubscribe("subscription0");
- con.close();
- }
-
- public void testUnsubscriptionAfterConnectionClose() throws Exception
- {
- AMQConnection con1 = (AMQConnection) getConnection("guest", "guest", "clientid");
- AMQTopic topic = new AMQTopic(con1, "MyTopic3");
-
- TopicSession session1 = con1.createTopicSession(false, AMQSession.AUTO_ACKNOWLEDGE);
- TopicPublisher publisher = session1.createPublisher(topic);
-
- AMQConnection con2 = (AMQConnection) getConnection("guest", "guest", "clientid");
- TopicSession session2 = con2.createTopicSession(false, AMQSession.AUTO_ACKNOWLEDGE);
- TopicSubscriber sub = session2.createDurableSubscriber(topic, "subscription0");
-
- con2.start();
-
- publisher.publish(session1.createTextMessage("Hello"));
- TextMessage tm = (TextMessage) sub.receive(2000);
- assertNotNull(tm);
- con2.close();
- publisher.publish(session1.createTextMessage("Hello2"));
- con2 = (AMQConnection) getConnection("guest", "guest", "clientid");
- session2 = con2.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
- sub = session2.createDurableSubscriber(topic, "subscription0");
- con2.start();
- tm = (TextMessage) sub.receive(2000);
- assertNotNull(tm);
- assertEquals("Hello2", tm.getText());
- session2.unsubscribe("subscription0");
- con1.close();
- con2.close();
- }
-
- public void testTextMessageCreation() throws Exception
- {
-
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
- AMQTopic topic = new AMQTopic(con, "MyTopic4");
- TopicSession session1 = con.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
- TopicPublisher publisher = session1.createPublisher(topic);
- MessageConsumer consumer1 = session1.createConsumer(topic);
- con.start();
- TextMessage tm = session1.createTextMessage("Hello");
- publisher.publish(tm);
- tm = (TextMessage) consumer1.receive(10000L);
- assertNotNull(tm);
- String msgText = tm.getText();
- assertEquals("Hello", msgText);
- tm = session1.createTextMessage();
- msgText = tm.getText();
- assertNull(msgText);
- publisher.publish(tm);
- tm = (TextMessage) consumer1.receive(10000L);
- assertNotNull(tm);
- msgText = tm.getText();
- assertNull(msgText);
- tm.clearBody();
- tm.setText("Now we are not null");
- publisher.publish(tm);
- tm = (TextMessage) consumer1.receive(2000);
- assertNotNull(tm);
- msgText = tm.getText();
- assertEquals("Now we are not null", msgText);
-
- tm = session1.createTextMessage("");
- msgText = tm.getText();
- assertEquals("Empty string not returned", "", msgText);
- publisher.publish(tm);
- tm = (TextMessage) consumer1.receive(2000);
- assertNotNull(tm);
- assertEquals("Empty string not returned", "", msgText);
- con.close();
- }
-
- public void testSendingSameMessage() throws Exception
- {
- AMQConnection conn = (AMQConnection) getConnection("guest", "guest");
- TopicSession session = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- TemporaryTopic topic = session.createTemporaryTopic();
- assertNotNull(topic);
- TopicPublisher producer = session.createPublisher(topic);
- MessageConsumer consumer = session.createConsumer(topic);
- conn.start();
- TextMessage sentMessage = session.createTextMessage("Test Message");
- producer.send(sentMessage);
- TextMessage receivedMessage = (TextMessage) consumer.receive(2000);
- assertNotNull(receivedMessage);
- assertEquals(sentMessage.getText(), receivedMessage.getText());
- producer.send(sentMessage);
- receivedMessage = (TextMessage) consumer.receive(2000);
- assertNotNull(receivedMessage);
- assertEquals(sentMessage.getText(), receivedMessage.getText());
-
- conn.close();
-
- }
-
- public void testTemporaryTopic() throws Exception
- {
- AMQConnection conn = (AMQConnection) getConnection("guest", "guest");
- TopicSession session = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- TemporaryTopic topic = session.createTemporaryTopic();
- assertNotNull(topic);
- TopicPublisher producer = session.createPublisher(topic);
- MessageConsumer consumer = session.createConsumer(topic);
- conn.start();
- producer.send(session.createTextMessage("hello"));
- TextMessage tm = (TextMessage) consumer.receive(2000);
- assertNotNull(tm);
- assertEquals("hello", tm.getText());
-
- try
- {
- topic.delete();
- fail("Expected JMSException : should not be able to delete while there are active consumers");
- }
- catch (JMSException je)
- {
- ; //pass
- }
-
- consumer.close();
-
- try
- {
- topic.delete();
- }
- catch (JMSException je)
- {
- fail("Unexpected Exception: " + je.getMessage());
- }
-
- TopicSession session2 = conn.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- try
- {
- session2.createConsumer(topic);
- fail("Expected a JMSException when subscribing to a temporary topic created on adifferent session");
- }
- catch (JMSException je)
- {
- ; // pass
- }
-
-
- conn.close();
- }
-
-
- public void testNoLocal() throws Exception
- {
-
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
-
- AMQTopic topic = new AMQTopic(con, "testNoLocal");
-
- TopicSession session1 = con.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
- TopicSubscriber noLocal = session1.createSubscriber(topic, "", true);
- TopicSubscriber select = session1.createSubscriber(topic, "Selector = 'select'", false);
- TopicSubscriber normal = session1.createSubscriber(topic);
-
- TopicPublisher publisher = session1.createPublisher(topic);
-
- con.start();
- TextMessage m;
- TextMessage message;
-
- //send message to all consumers
- publisher.publish(session1.createTextMessage("hello-new2"));
-
- //test normal subscriber gets message
- m = (TextMessage) normal.receive(1000);
- assertNotNull(m);
-
- //test selector subscriber doesn't message
- m = (TextMessage) select.receive(1000);
- assertNull(m);
-
- //test nolocal subscriber doesn't message
- m = (TextMessage) noLocal.receive(1000);
- if (m != null)
- {
- System.out.println("Message:" + m.getText());
- }
- assertNull(m);
-
- //send message to all consumers
- message = session1.createTextMessage("hello2");
- message.setStringProperty("Selector", "select");
-
- publisher.publish(message);
-
- //test normal subscriber gets message
- m = (TextMessage) normal.receive(1000);
- assertNotNull(m);
-
- //test selector subscriber does get message
- m = (TextMessage) select.receive(1000);
- assertNotNull(m);
-
- //test nolocal subscriber doesn't message
- m = (TextMessage) noLocal.receive(100);
- assertNull(m);
-
- AMQConnection con2 = (AMQConnection) getConnection("guest", "guest", "foo");
- TopicSession session2 = con2.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
- TopicPublisher publisher2 = session2.createPublisher(topic);
-
-
- message = session2.createTextMessage("hello2");
- message.setStringProperty("Selector", "select");
-
- publisher2.publish(message);
-
- //test normal subscriber gets message
- m = (TextMessage) normal.receive(1000);
- assertNotNull(m);
-
- //test selector subscriber does get message
- m = (TextMessage) select.receive(1000);
- assertNotNull(m);
-
- //test nolocal subscriber does message
- m = (TextMessage) noLocal.receive(100);
- assertNotNull(m);
-
-
- con.close();
- con2.close();
- }
-
- /**
- * This tests QPID-1191, where messages which are sent to a topic but are not consumed by a subscriber
- * due to a selector can be leaked.
- * @throws Exception
- */
- public void testNonMatchingMessagesDoNotFillQueue() throws Exception
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
-
- // Setup Topic
- AMQTopic topic = new AMQTopic(con, "testNoLocal");
-
- TopicSession session = con.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
-
- // Setup subscriber with selector
- TopicSubscriber selector = session.createSubscriber(topic, "Selector = 'select'", false);
- TopicPublisher publisher = session.createPublisher(topic);
-
- con.start();
- TextMessage m;
- TextMessage message;
-
- // Send non-matching message
- message = session.createTextMessage("non-matching 1");
- publisher.publish(message);
-
- // Send and consume matching message
- message = session.createTextMessage("hello");
- message.setStringProperty("Selector", "select");
-
- publisher.publish(message);
-
- m = (TextMessage) selector.receive(1000);
- assertNotNull("should have received message", m);
- assertEquals("Message contents were wrong", "hello", m.getText());
-
- // Send non-matching message
- message = session.createTextMessage("non-matching 2");
- publisher.publish(message);
-
- // Assert queue count is 0
- long depth = ((AMQTopicSessionAdaptor) session).getSession().getQueueDepth(topic);
- assertEquals("Queue depth was wrong", 0, depth);
-
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TopicSessionTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
deleted file mode 100644
index 9c755fcb41..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
+++ /dev/null
@@ -1,572 +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.
- *
- *
- */
-package org.apache.qpid.test.unit.transacted;
-
-import org.apache.qpid.test.utils.QpidTestCase;
-import org.apache.qpid.client.AMQConnection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.*;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * This class tests a number of commits and roll back scenarios
- *
- * Assumptions; - Assumes empty Queue
- */
-public class CommitRollbackTest extends QpidTestCase
-{
- protected AMQConnection conn;
- protected String queue = "direct://amq.direct//Qpid.Client.Transacted.CommitRollback.queue";
- protected static int testMethod = 0;
- protected String payload = "xyzzy";
- private Session _session;
- private MessageProducer _publisher;
- private Session _pubSession;
- private MessageConsumer _consumer;
- Queue _jmsQueue;
-
- private static final Logger _logger = LoggerFactory.getLogger(CommitRollbackTest.class);
- private boolean _gotone = false;
- private boolean _gottwo = false;
- private boolean _gottwoRedelivered = false;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- testMethod++;
- queue += testMethod;
- newConnection();
- }
-
- private void newConnection() throws Exception
- {
- conn = (AMQConnection) getConnection("guest", "guest");
-
- _session = conn.createSession(true, Session.CLIENT_ACKNOWLEDGE);
-
- _jmsQueue = _session.createQueue(queue);
- _consumer = _session.createConsumer(_jmsQueue);
-
- _pubSession = conn.createSession(true, Session.CLIENT_ACKNOWLEDGE);
-
- _publisher = _pubSession.createProducer(_pubSession.createQueue(queue));
-
- conn.start();
- }
-
- protected void tearDown() throws Exception
- {
- conn.close();
- super.tearDown();
- }
-
- /**
- * PUT a text message, disconnect before commit, confirm it is gone.
- *
- * @throws Exception On error
- */
- public void testPutThenDisconnect() throws Exception
- {
- assertTrue("session is not transacted", _session.getTransacted());
- assertTrue("session is not transacted", _pubSession.getTransacted());
-
- _logger.info("sending test message");
- String MESSAGE_TEXT = "testPutThenDisconnect";
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
-
- _logger.info("reconnecting without commit");
- conn.close();
-
- newConnection();
-
- _logger.info("receiving result");
- Message result = _consumer.receive(1000);
-
- // commit to ensure message is removed from queue
- _session.commit();
-
- assertNull("test message was put and disconnected before commit, but is still present", result);
- }
-
- /**
- * PUT a text message, disconnect before commit, confirm it is gone.
- *
- * @throws Exception On error
- */
- public void testPutThenCloseDisconnect() throws Exception
- {
- assertTrue("session is not transacted", _session.getTransacted());
- assertTrue("session is not transacted", _pubSession.getTransacted());
-
- _logger.info("sending test message");
- String MESSAGE_TEXT = "testPutThenDisconnect";
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
-
- _logger.info("closing publisher without commit");
- _publisher.close();
-
- _logger.info("reconnecting without commit");
- conn.close();
-
- newConnection();
-
- _logger.info("receiving result");
- Message result = _consumer.receive(1000);
-
- // commit to ensure message is removed from queue
- _session.commit();
-
- assertNull("test message was put and disconnected before commit, but is still present", result);
- }
-
- /**
- * PUT a text message, rollback, confirm message is gone. The consumer is on the same connection but different
- * session as producer
- *
- * @throws Exception On error
- */
- public void testPutThenRollback() throws Exception
- {
- assertTrue("session is not transacted", _session.getTransacted());
- assertTrue("session is not transacted", _pubSession.getTransacted());
-
- _logger.info("sending test message");
- String MESSAGE_TEXT = "testPutThenRollback";
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
-
- _logger.info("rolling back");
- _pubSession.rollback();
-
- _logger.info("receiving result");
- Message result = _consumer.receive(1000);
-
- assertNull("test message was put and rolled back, but is still present", result);
- }
-
- /**
- * GET a text message, disconnect before commit, confirm it is still there. The consumer is on a new connection
- *
- * @throws Exception On error
- */
- public void testGetThenDisconnect() throws Exception
- {
- assertTrue("session is not transacted", _session.getTransacted());
- assertTrue("session is not transacted", _pubSession.getTransacted());
-
- _logger.info("sending test message");
- String MESSAGE_TEXT = "testGetThenDisconnect";
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
-
- _pubSession.commit();
-
- _logger.info("getting test message");
-
- Message msg = _consumer.receive(1000);
- assertNotNull("retrieved message is null", msg);
-
- _logger.info("closing connection");
- conn.close();
-
- newConnection();
-
- _logger.info("receiving result");
- Message result = _consumer.receive(1000);
-
- _session.commit();
-
- assertNotNull("test message was consumed and disconnected before commit, but is gone", result);
- assertEquals("test message was correct message", MESSAGE_TEXT, ((TextMessage) result).getText());
- }
-
- /**
- * GET a text message, close consumer, disconnect before commit, confirm it is still there. The consumer is on the
- * same connection but different session as producer
- *
- * @throws Exception On error
- */
- public void testGetThenCloseDisconnect() throws Exception
- {
- assertTrue("session is not transacted", _session.getTransacted());
- assertTrue("session is not transacted", _pubSession.getTransacted());
-
- _logger.info("sending test message");
- String MESSAGE_TEXT = "testGetThenCloseDisconnect";
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
-
- _pubSession.commit();
-
- _logger.info("getting test message");
-
- Message msg = _consumer.receive(1000);
- assertNotNull("retrieved message is null", msg);
- assertEquals("test message was correct message", MESSAGE_TEXT, ((TextMessage) msg).getText());
-
- _logger.info("reconnecting without commit");
- _consumer.close();
- conn.close();
-
- newConnection();
-
- _logger.info("receiving result");
- Message result = _consumer.receive(1000);
-
- _session.commit();
-
- assertNotNull("test message was consumed and disconnected before commit, but is gone", result);
- assertEquals("test message was correct message", MESSAGE_TEXT, ((TextMessage) result).getText());
- }
-
- /**
- * GET a text message, rollback, confirm it is still there. The consumer is on the same connection but differnt
- * session to the producer
- *
- * @throws Exception On error
- */
- public void testGetThenRollback() throws Exception
- {
- assertTrue("session is not transacted", _session.getTransacted());
- assertTrue("session is not transacted", _pubSession.getTransacted());
-
- _logger.info("sending test message");
- String MESSAGE_TEXT = "testGetThenRollback";
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
-
- _pubSession.commit();
-
- _logger.info("getting test message");
-
- Message msg = _consumer.receive(1000);
-
- assertNotNull("retrieved message is null", msg);
- assertEquals("test message was correct message", MESSAGE_TEXT, ((TextMessage) msg).getText());
-
- _logger.info("rolling back");
-
- _session.rollback();
-
- _logger.info("receiving result");
-
- Message result = _consumer.receive(1000);
-
- _session.commit();
- assertNotNull("test message was consumed and rolled back, but is gone", result);
- assertEquals("test message was correct message", MESSAGE_TEXT, ((TextMessage) result).getText());
- assertTrue("Message is not marked as redelivered", result.getJMSRedelivered());
- }
-
- /**
- * GET a text message, close message producer, rollback, confirm it is still there. The consumer is on the same
- * connection but different session as producer
- *
- * @throws Exception On error
- */
- public void testGetThenCloseRollback() throws Exception
- {
- assertTrue("session is not transacted", _session.getTransacted());
- assertTrue("session is not transacted", _pubSession.getTransacted());
-
- _logger.info("sending test message");
- String MESSAGE_TEXT = "testGetThenCloseRollback";
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
-
- _pubSession.commit();
-
- _logger.info("getting test message");
-
- Message msg = _consumer.receive(1000);
-
- assertNotNull("retrieved message is null", msg);
- assertEquals("test message was correct message", MESSAGE_TEXT, ((TextMessage) msg).getText());
-
- _logger.info("Closing consumer");
- _consumer.close();
-
- _logger.info("rolling back");
- _session.rollback();
-
- _logger.info("receiving result");
-
- _consumer = _session.createConsumer(_jmsQueue);
-
- Message result = _consumer.receive(1000);
-
- _session.commit();
- assertNotNull("test message was consumed and rolled back, but is gone", result);
- assertEquals("test message was correct message", MESSAGE_TEXT, ((TextMessage) result).getText());
- assertTrue("Message is not marked as redelivered", result.getJMSRedelivered());
- }
-
- /**
- * Test that rolling back a session purges the dispatcher queue, and the messages arrive in the correct order
- *
- * @throws Exception On error
- */
- public void testSend2ThenRollback() throws Exception
- {
- int run = 0;
- while (run < 10)
- {
- run++;
- _logger.info("Run:" + run);
- assertTrue("session is not transacted", _session.getTransacted());
- assertTrue("session is not transacted", _pubSession.getTransacted());
-
- _logger.info("sending two test messages");
- _publisher.send(_pubSession.createTextMessage("1"));
- _publisher.send(_pubSession.createTextMessage("2"));
- _pubSession.commit();
-
- _logger.info("getting test message");
- assertEquals("1", ((TextMessage) _consumer.receive(1000)).getText());
-
- _logger.info("rolling back");
- _session.rollback();
-
- _logger.info("receiving result");
- Message result = _consumer.receive(1000);
-
- assertNotNull("test message was consumed and rolled back, but is gone", result);
-
- // Message Order is:
-
- // Send 1 , 2
- // Retrieve 1 and then rollback
- // Receieve 1 (redelivered) , 2 (may or may not be redelivered??)
-
- verifyMessages(result);
-
- // Occassionally get message 2 first!
-// assertEquals("Should get message one first", "1", ((TextMessage) result).getText());
-// assertTrue("Message is not marked as redelivered", result.getJMSRedelivered());
-//
-// result = _consumer.receive(1000);
-// assertEquals("Second message should be message 2", "2", ((TextMessage) result).getText());
-// assertTrue("Message is not marked as redelivered", result.getJMSRedelivered());
-//
-// result = _consumer.receive(1000);
-// assertNull("There should be no more messages", result);
-
- _session.commit();
- }
- }
-
- private void verifyMessages(Message result) throws JMSException
- {
-
- if (result == null)
- {
- assertTrue("Didn't receive redelivered message one", _gotone);
- assertTrue("Didn't receive message two at all", _gottwo | _gottwoRedelivered);
- _gotone = false;
- _gottwo = false;
- _gottwoRedelivered = false;
- return;
- }
-
- if (((TextMessage) result).getText().equals("1"))
- {
- _logger.info("Got 1 redelivered");
- assertTrue("Message is not marked as redelivered", result.getJMSRedelivered());
- assertFalse("Already received message one", _gotone);
- _gotone = true;
-
- }
- else
- {
- assertEquals("2", ((TextMessage) result).getText());
-
- if (result.getJMSRedelivered())
- {
- _logger.info("Got 2 redelivered, message was prefetched");
- assertFalse("Already received message redelivered two", _gottwoRedelivered);
-
- _gottwoRedelivered = true;
- }
- else
- {
- _logger.warn("Got 2, message prefetched wasn't cleared or messages was in transit when rollback occured");
- assertFalse("Already received message two", _gottwo);
- assertFalse("Already received message redelivered two", _gottwoRedelivered);
- _gottwo = true;
- }
- }
-
- verifyMessages(_consumer.receive(1000));
- }
-
- /**
- * This test sends two messages receives on of them but doesn't ack it.
- * The consumer is then closed
- * the first message should be returned as redelivered.
- * the second message should be delivered normally.
- * @throws Exception
- */
- public void testSend2ThenCloseAfter1andTryAgain() throws Exception
- {
- assertTrue("session is not transacted", _session.getTransacted());
- assertTrue("session is not transacted", _pubSession.getTransacted());
-
- _logger.info("sending two test messages");
- _publisher.send(_pubSession.createTextMessage("1"));
- _publisher.send(_pubSession.createTextMessage("2"));
- _pubSession.commit();
-
- _logger.info("getting test message");
- Message result = _consumer.receive(5000);
-
- assertNotNull("Message received should not be null", result);
- assertEquals("1", ((TextMessage) result).getText());
- assertTrue("Messasge is marked as redelivered" + result, !result.getJMSRedelivered());
-
- _logger.info("Closing Consumer");
-
- _consumer.close();
-
- _logger.info("Creating New consumer");
- _consumer = _session.createConsumer(_jmsQueue);
-
- _logger.info("receiving result");
-
-
- // Message 2 may be marked as redelivered if it was prefetched.
- result = _consumer.receive(5000);
- assertNotNull("Second message was not consumed, but is gone", result);
-
- // The first message back will be 2, message 1 has been received but not committed
- // Closing the consumer does not commit the session.
-
- // if this is message 1 then it should be marked as redelivered
- if("1".equals(((TextMessage) result).getText()))
- {
- fail("First message was recieved again");
- }
-
- result = _consumer.receive(1000);
- assertNull("test message should be null:" + result, result);
-
- _session.commit();
- }
-
- public void testPutThenRollbackThenGet() throws Exception
- {
- assertTrue("session is not transacted", _session.getTransacted());
- assertTrue("session is not transacted", _pubSession.getTransacted());
-
- _logger.info("sending test message");
- String MESSAGE_TEXT = "testPutThenRollbackThenGet";
-
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
- _pubSession.commit();
-
- assertNotNull(_consumer.receive(100));
-
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
-
- _logger.info("rolling back");
- _pubSession.rollback();
-
- _logger.info("receiving result");
- Message result = _consumer.receive(1000);
- assertNull("test message was put and rolled back, but is still present", result);
-
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
-
- _pubSession.commit();
-
- assertNotNull(_consumer.receive(100));
-
- _session.commit();
- }
-
- /**
- * Qpid-1163
- * Check that when commt is called inside onMessage then
- * the last message is nor redelivered.
- *
- * @throws Exception
- */
- public void testCommitWhithinOnMessage() throws Exception
- {
- Queue queue = (Queue) getInitialContext().lookup("queue");
- // create a consumer
- MessageConsumer cons = _session.createConsumer(queue);
- MessageProducer prod = _session.createProducer(queue);
- Message message = _session.createTextMessage("Message");
- message.setJMSCorrelationID("m1");
- prod.send(message);
- _session.commit();
- _logger.info("Sent message to queue");
- CountDownLatch cd = new CountDownLatch(1);
- cons.setMessageListener(new CommitWhithinOnMessageListener(cd));
- conn.start();
- cd.await(30, TimeUnit.SECONDS);
- if( cd.getCount() > 0 )
- {
- fail("Did not received message");
- }
- // Check that the message has been dequeued
- _session.close();
- conn.close();
- conn = (AMQConnection) getConnection("guest", "guest");
- conn.start();
- Session session = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- cons = session.createConsumer(queue);
- message = cons.receiveNoWait();
- if(message != null)
- {
- if(message.getJMSCorrelationID().equals("m1"))
- {
- fail("received message twice");
- }
- else
- {
- fail("queue should have been empty, received message: " + message);
- }
- }
- }
-
- private class CommitWhithinOnMessageListener implements MessageListener
- {
- private CountDownLatch _cd;
- private CommitWhithinOnMessageListener(CountDownLatch cd)
- {
- _cd = cd;
- }
- public void onMessage(Message message)
- {
- try
- {
- _logger.info("received message " + message);
- assertEquals("Wrong message received", message.getJMSCorrelationID(), "m1");
- _logger.info("commit session");
- _session.commit();
- _cd.countDown();
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactedTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
deleted file mode 100644
index 1eec6dd17c..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
+++ /dev/null
@@ -1,348 +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.
- *
- */
-package org.apache.qpid.test.unit.transacted;
-
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.TextMessage;
-
-public class TransactedTest extends QpidTestCase
-{
- private AMQQueue queue1;
-
- private AMQConnection con;
- private Session session;
- private MessageConsumer consumer1;
- private MessageProducer producer2;
-
- private AMQConnection prepCon;
- private Session prepSession;
- private MessageProducer prepProducer1;
-
- private AMQConnection testCon;
- private Session testSession;
- private MessageConsumer testConsumer1;
- private MessageConsumer testConsumer2;
- private static final Logger _logger = LoggerFactory.getLogger(TransactedTest.class);
-
- protected void setUp() throws Exception
- {
- try
- {
- super.setUp();
- _logger.info("Create Connection");
- con = (AMQConnection) getConnection("guest", "guest");
- _logger.info("Create Session");
- session = con.createSession(true, Session.SESSION_TRANSACTED);
- _logger.info("Create Q1");
- queue1 = new AMQQueue(session.getDefaultQueueExchangeName(), new AMQShortString("Q1"),
- new AMQShortString("Q1"), false, true);
- _logger.info("Create Q2");
- AMQQueue queue2 = new AMQQueue(session.getDefaultQueueExchangeName(), new AMQShortString("Q2"), false);
-
- _logger.info("Create Consumer of Q1");
- consumer1 = session.createConsumer(queue1);
- // Dummy just to create the queue.
- _logger.info("Create Consumer of Q2");
- MessageConsumer consumer2 = session.createConsumer(queue2);
- _logger.info("Close Consumer of Q2");
- consumer2.close();
-
- _logger.info("Create producer to Q2");
- producer2 = session.createProducer(queue2);
-
- _logger.info("Start Connection");
- con.start();
-
- _logger.info("Create prep connection");
- prepCon = (AMQConnection) getConnection("guest", "guest");
-
- _logger.info("Create prep session");
- prepSession = prepCon.createSession(false, AMQSession.AUTO_ACKNOWLEDGE);
-
- _logger.info("Create prep producer to Q1");
- prepProducer1 = prepSession.createProducer(queue1);
-
- _logger.info("Create prep connection start");
- prepCon.start();
-
- _logger.info("Create test connection");
- testCon = (AMQConnection) getConnection("guest", "guest");
- _logger.info("Create test session");
- testSession = testCon.createSession(false, AMQSession.AUTO_ACKNOWLEDGE);
- _logger.info("Create test consumer of q2");
- testConsumer2 = testSession.createConsumer(queue2);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- stopBroker();
- throw e;
- }
- }
-
- protected void tearDown() throws Exception
- {
- try
- {
- _logger.info("Close connection");
- con.close();
- _logger.info("Close test connection");
- testCon.close();
- _logger.info("Close prep connection");
- prepCon.close();
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- super.tearDown();
- }
- }
-
- public void testCommit() throws Exception
- {
- try
- {
-// add some messages
- _logger.info("Send prep A");
- prepProducer1.send(prepSession.createTextMessage("A"));
- _logger.info("Send prep B");
- prepProducer1.send(prepSession.createTextMessage("B"));
- _logger.info("Send prep C");
- prepProducer1.send(prepSession.createTextMessage("C"));
-
- // send and receive some messages
- _logger.info("Send X to Q2");
- producer2.send(session.createTextMessage("X"));
- _logger.info("Send Y to Q2");
- producer2.send(session.createTextMessage("Y"));
- _logger.info("Send Z to Q2");
- producer2.send(session.createTextMessage("Z"));
-
- _logger.info("Read A from Q1");
- expect("A", consumer1.receive(1000));
- _logger.info("Read B from Q1");
- expect("B", consumer1.receive(1000));
- _logger.info("Read C from Q1");
- expect("C", consumer1.receive(1000));
-
- // commit
- _logger.info("session commit");
- session.commit();
- _logger.info("Start test Connection");
- testCon.start();
-
- // ensure sent messages can be received and received messages are gone
- _logger.info("Read X from Q2");
- expect("X", testConsumer2.receive(1000));
- _logger.info("Read Y from Q2");
- expect("Y", testConsumer2.receive(1000));
- _logger.info("Read Z from Q2");
- expect("Z", testConsumer2.receive(1000));
-
- _logger.info("create test session on Q1");
- testConsumer1 = testSession.createConsumer(queue1);
- _logger.info("Read null from Q1");
- assertTrue(null == testConsumer1.receive(1000));
- _logger.info("Read null from Q2");
- assertTrue(null == testConsumer2.receive(1000));
- }
- catch (Throwable e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
-
- public void testRollback() throws Exception
- {
- try
- {
-// add some messages
- _logger.info("Send prep RB_A");
- prepProducer1.send(prepSession.createTextMessage("RB_A"));
- _logger.info("Send prep RB_B");
- prepProducer1.send(prepSession.createTextMessage("RB_B"));
- _logger.info("Send prep RB_C");
- prepProducer1.send(prepSession.createTextMessage("RB_C"));
-
- _logger.info("Sending RB_X RB_Y RB_Z");
- producer2.send(session.createTextMessage("RB_X"));
- producer2.send(session.createTextMessage("RB_Y"));
- producer2.send(session.createTextMessage("RB_Z"));
- _logger.info("Receiving RB_A RB_B");
- expect("RB_A", consumer1.receive(1000));
- expect("RB_B", consumer1.receive(1000));
- // Don't consume 'RB_C' leave it in the prefetch cache to ensure rollback removes it.
- // Quick sleep to ensure 'RB_C' gets pre-fetched
- Thread.sleep(500);
-
- // rollback
- _logger.info("rollback");
- session.rollback();
-
- _logger.info("Receiving RB_A RB_B RB_C");
- // ensure sent messages are not visible and received messages are requeued
- expect("RB_A", consumer1.receive(1000), true);
- expect("RB_B", consumer1.receive(1000), true);
- expect("RB_C", consumer1.receive(1000), true);
- _logger.info("Starting new connection");
- testCon.start();
- testConsumer1 = testSession.createConsumer(queue1);
- _logger.info("Testing we have no messages left");
- assertTrue(null == testConsumer1.receive(1000));
- assertTrue(null == testConsumer2.receive(1000));
-
- session.commit();
-
- _logger.info("Testing we have no messages left after commit");
- assertTrue(null == testConsumer1.receive(1000));
- assertTrue(null == testConsumer2.receive(1000));
- }
- catch (Throwable e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
-
- public void testResendsMsgsAfterSessionClose() throws Exception
- {
- try
- {
- AMQConnection con = (AMQConnection) getConnection("guest", "guest");
-
- Session consumerSession = con.createSession(true, Session.SESSION_TRANSACTED);
- AMQQueue queue3 = new AMQQueue(consumerSession.getDefaultQueueExchangeName(), new AMQShortString("Q3"), false);
- MessageConsumer consumer = consumerSession.createConsumer(queue3);
-
- AMQConnection con2 = (AMQConnection) getConnection("guest", "guest");
- Session producerSession = con2.createSession(true, Session.SESSION_TRANSACTED);
- MessageProducer producer = producerSession.createProducer(queue3);
-
- _logger.info("Sending four messages");
- producer.send(producerSession.createTextMessage("msg1"));
- producer.send(producerSession.createTextMessage("msg2"));
- producer.send(producerSession.createTextMessage("msg3"));
- producer.send(producerSession.createTextMessage("msg4"));
-
- producerSession.commit();
-
- _logger.info("Starting connection");
- con.start();
- TextMessage tm = (TextMessage) consumer.receive();
- assertNotNull(tm);
- assertEquals("msg1", tm.getText());
-
- consumerSession.commit();
-
- _logger.info("Received and committed first message");
- tm = (TextMessage) consumer.receive(1000);
- assertNotNull(tm);
- assertEquals("msg2", tm.getText());
-
- tm = (TextMessage) consumer.receive(1000);
- assertNotNull(tm);
- assertEquals("msg3", tm.getText());
-
- tm = (TextMessage) consumer.receive(1000);
- assertNotNull(tm);
- assertEquals("msg4", tm.getText());
-
- _logger.info("Received all four messages. Closing connection with three outstanding messages");
-
- consumerSession.close();
-
- consumerSession = con.createSession(true, Session.SESSION_TRANSACTED);
-
- consumer = consumerSession.createConsumer(queue3);
-
- // no ack for last three messages so when I call recover I expect to get three messages back
- tm = (TextMessage) consumer.receive(3000);
- assertNotNull(tm);
- assertEquals("msg2", tm.getText());
- assertTrue("Message is not redelivered", tm.getJMSRedelivered());
-
- tm = (TextMessage) consumer.receive(3000);
- assertNotNull(tm);
- assertEquals("msg3", tm.getText());
- assertTrue("Message is not redelivered", tm.getJMSRedelivered());
-
- tm = (TextMessage) consumer.receive(3000);
- assertNotNull(tm);
- assertEquals("msg4", tm.getText());
- assertTrue("Message is not redelivered", tm.getJMSRedelivered());
-
- _logger.info("Received redelivery of three messages. Committing");
-
- consumerSession.commit();
-
- _logger.info("Called commit");
-
- tm = (TextMessage) consumer.receive(1000);
- assertNull(tm);
-
- _logger.info("No messages redelivered as is expected");
-
- con.close();
- con2.close();
- }
- catch (Throwable e)
- {
- e.printStackTrace();
- fail(e.getMessage());
- }
- }
-
- private void expect(String text, Message msg) throws JMSException
- {
- expect(text, msg, false);
- }
-
- private void expect(String text, Message msg, boolean requeued) throws JMSException
- {
- assertNotNull("Message should not be null", msg);
- assertTrue("Message should be a text message", msg instanceof TextMessage);
- assertEquals("Message content does not match expected", text, ((TextMessage) msg).getText());
- assertEquals("Message should " + (requeued ? "" : "not") + " be requeued", requeued, msg.getJMSRedelivered());
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TransactedTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/AbstractXATestCase.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/AbstractXATestCase.java
deleted file mode 100644
index 3906be2cc7..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/AbstractXATestCase.java
+++ /dev/null
@@ -1,132 +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.
- */
-package org.apache.qpid.test.unit.xa;
-
-import org.apache.qpid.dtx.XidImpl;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import javax.transaction.xa.Xid;
-import javax.transaction.xa.XAResource;
-import javax.jms.*;
-import java.util.Random;
-
-/**
- *
- *
- */
-public abstract class AbstractXATestCase extends QpidTestCase
-{
- protected static final String _sequenceNumberPropertyName = "seqNumber";
-
- /**
- * the xaResource associated with the standard session
- */
- protected static XAResource _xaResource = null;
-
- /**
- * producer registered with the standard session
- */
- protected static MessageProducer _producer = null;
-
- /**
- * consumer registered with the standard session
- */
- protected static MessageConsumer _consumer = null;
-
- /**
- * a standard message
- */
- protected static TextMessage _message = null;
-
- /**
- * xid counter
- */
- private static int _xidCounter = (new Random()).nextInt(1000000);
-
-
- protected void setUp() throws Exception
- {
- super.setUp();
- init();
- }
-
- public abstract void init() throws Exception;
-
-
-
- /**
- * construct a new Xid
- *
- * @return a new Xid
- */
- protected Xid getNewXid()
- {
- byte[] branchQualifier;
- byte[] globalTransactionID;
- int format = _xidCounter;
- String branchQualifierSt = "branchQualifier" + _xidCounter;
- String globalTransactionIDSt = "globalTransactionID" + _xidCounter;
- branchQualifier = branchQualifierSt.getBytes();
- globalTransactionID = globalTransactionIDSt.getBytes();
- _xidCounter++;
- return new XidImpl(branchQualifier, format, globalTransactionID);
- }
-
- public void init(XASession session, Destination destination)
- {
- // get the xaResource
- try
- {
- _xaResource = session.getXAResource();
- }
- catch (Exception e)
- {
- fail("cannot access the xa resource: " + e.getMessage());
- }
- // create standard producer
- try
- {
- _producer = session.createProducer(destination);
- _producer.setDeliveryMode(DeliveryMode.PERSISTENT);
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("cannot create message producer: " + e.getMessage());
- }
- // create standard consumer
- try
- {
- _consumer = session.createConsumer(destination);
- }
- catch (JMSException e)
- {
- fail("cannot create message consumer: " + e.getMessage());
- }
- // create a standard message
- try
- {
- _message = session.createTextMessage();
- _message.setText("test XA");
- }
- catch (JMSException e)
- {
- fail("cannot create standard message: " + e.getMessage());
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/FaultTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/FaultTest.java
deleted file mode 100644
index 1e5932b6db..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/FaultTest.java
+++ /dev/null
@@ -1,385 +0,0 @@
-package org.apache.qpid.test.unit.xa;
-/*
- *
- * 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 org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.*;
-import javax.transaction.xa.Xid;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.XAException;
-
-import junit.framework.TestSuite;
-
-
-public class FaultTest extends AbstractXATestCase
-{
- /* this clas logger */
- private static final Logger _logger = LoggerFactory.getLogger(FaultTest.class);
-
- /**
- * the queue use by all the tests
- */
- private static Queue _queue = null;
- /**
- * the queue connection factory used by all tests
- */
- private static XAQueueConnectionFactory _queueFactory = null;
-
- /**
- * standard xa queue connection
- */
- private static XAQueueConnection _xaqueueConnection = null;
-
- /**
- * standard xa queue connection
- */
- private static QueueConnection _queueConnection = null;
-
-
- /**
- * standard queue session created from the standard connection
- */
- private static QueueSession _nonXASession = null;
-
- /**
- * the queue name
- */
- private static final String QUEUENAME = "xaQueue";
-
- /** ----------------------------------------------------------------------------------- **/
- /**
- * ----------------------------- JUnit support ----------------------------------------- *
- */
-
- /**
- * Gets the test suite tests
- *
- * @return the test suite tests
- */
- public static TestSuite getSuite()
- {
- return new TestSuite(QueueTest.class);
- }
-
- /**
- * Run the test suite.
- *
- * @param args Any command line arguments specified to this class.
- */
- public static void main(String args[])
- {
- junit.textui.TestRunner.run(getSuite());
- }
-
- public void tearDown() throws Exception
- {
- if (!isBroker08())
- {
- _xaqueueConnection.close();
- _queueConnection.close();
- }
- super.tearDown();
- }
-
- /**
- * Initialize standard actors
- */
- public void init() throws Exception
- {
- if (!isBroker08())
- {
- _queue = (Queue) getInitialContext().lookup(QUEUENAME);
- _queueFactory = getConnectionFactory();
- _xaqueueConnection = _queueFactory.createXAQueueConnection("guest", "guest");
- XAQueueSession session = _xaqueueConnection.createXAQueueSession();
- _queueConnection = _queueFactory.createQueueConnection();
- _nonXASession = _queueConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
- init(session, _queue);
- }
- }
-
- /** -------------------------------------------------------------------------------------- **/
- /** ----------------------------- Test Suite -------------------------------------------- **/
- /** -------------------------------------------------------------------------------------- **/
-
- /**
- * Strategy:
- * Invoke start twice with the same xid on an XA resource.
- * Check that the second
- * invocation is throwing the expected XA exception.
- */
- public void testSameXID() throws Exception
- {
- Xid xid = getNewXid();
- _xaResource.start(xid, XAResource.TMNOFLAGS);
- // we now exepct this operation to fail
- try
- {
- _xaResource.start(xid, XAResource.TMNOFLAGS);
- fail("We managed to start a transaction with the same xid");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_DUPID, e.errorCode);
- }
- }
-
- /**
- * Strategy:
- * Invoke start on a XA resource with flag other than TMNOFLAGS, TMJOIN, or TMRESUME.
- * Check that a XA Exception is thrown.
- */
- public void testWrongStartFlag()
- {
- Xid xid = getNewXid();
- try
- {
- _xaResource.start(xid, XAResource.TMONEPHASE);
- fail("We managed to start a transaction with a wrong flag");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_INVAL, e.errorCode);
- }
- }
-
- /**
- * Strategy:
- * Check that a XA exception is thrown when:
- * A non started xid is ended
- */
- public void testEnd()
- {
- Xid xid = getNewXid();
- try
- {
- _xaResource.end(xid, XAResource.TMSUCCESS);
- fail("We managed to end a transaction before it is started");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_PROTO, e.errorCode);
- }
- }
-
-
- /**
- * Strategy:
- * Check that a XA exception is thrown when:
- * Call forget on an unknown xid
- * call forget on a started xid
- * A non started xid is prepared
- * A non ended xis is prepared
- */
- public void testForget()
- {
- Xid xid = getNewXid();
- try
- {
- _xaResource.forget(xid);
- fail("We managed to forget an unknown xid");
- }
- catch (XAException e)
- {
- // assertEquals("Wrong error code: ", XAException.XAER_NOTA, e.errorCode);
- }
- xid = getNewXid();
- try
- {
- _xaResource.start(xid, XAResource.TMNOFLAGS);
- _xaResource.forget(xid);
- fail("We managed to forget a started xid");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_PROTO, e.errorCode);
- }
- }
-
- /**
- * Strategy:
- * Check that a XA exception is thrown when:
- * A non started xid is prepared
- * A non ended xid is prepared
- */
- public void testPrepare()
- {
- Xid xid = getNewXid();
- try
- {
- _xaResource.prepare(xid);
- fail("We managed to prepare an unknown xid");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_NOTA, e.errorCode);
- }
- xid = getNewXid();
- try
- {
- _xaResource.start(xid, XAResource.TMNOFLAGS);
- _xaResource.prepare(xid);
- fail("We managed to prepare a started xid");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_PROTO, e.errorCode);
- }
- }
-
- /**
- * Strategy:
- * Check that the expected XA exception is thrown when:
- * A non started xid is committed
- * A non ended xid is committed
- * A non prepared xid is committed with one phase set to false.
- * A prepared xid is committed with one phase set to true.
- */
- public void testCommit() throws Exception
- {
- Xid xid = getNewXid();
- try
- {
- _xaResource.commit(xid, true);
- fail("We managed to commit an unknown xid");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_NOTA, e.errorCode);
- }
- xid = getNewXid();
- try
- {
- _xaResource.start(xid, XAResource.TMNOFLAGS);
- _xaResource.commit(xid, true);
- fail("We managed to commit a not ended xid");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_PROTO, e.errorCode);
- }
- xid = getNewXid();
- try
- {
- _xaResource.start(xid, XAResource.TMNOFLAGS);
- _xaResource.end(xid, XAResource.TMSUCCESS);
- _xaResource.commit(xid, false);
- fail("We managed to commit a not prepared xid");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_PROTO, e.errorCode);
- }
- xid = getNewXid();
- try
- {
- _xaResource.start(xid, XAResource.TMNOFLAGS);
- _xaResource.end(xid, XAResource.TMSUCCESS);
- _xaResource.prepare(xid);
- _xaResource.commit(xid, true);
- fail("We managed to commit a prepared xid");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_PROTO, e.errorCode);
- }
- finally
- {
- _xaResource.commit(xid, false);
- }
- }
-
- /**
- * Strategy:
- * Check that the expected XA exception is thrown when:
- * A non started xid is rolled back
- * A non ended xid is rolled back
- */
- public void testRollback()
- {
- Xid xid = getNewXid();
- try
- {
- _xaResource.rollback(xid);
- fail("We managed to rollback an unknown xid");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_NOTA, e.errorCode);
- }
- xid = getNewXid();
- try
- {
- _xaResource.start(xid, XAResource.TMNOFLAGS);
- _xaResource.rollback(xid);
- fail("We managed to rollback a not ended xid");
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XAER_PROTO, e.errorCode);
- }
- }
-
- /**
- * Strategy:
- * Check that the timeout is set correctly
- */
- public void testTransactionTimeoutvalue() throws Exception
- {
- Xid xid = getNewXid();
- _xaResource.start(xid, XAResource.TMNOFLAGS);
- assertEquals("Wrong timeout", _xaResource.getTransactionTimeout(), 0);
- _xaResource.setTransactionTimeout(1000);
- assertEquals("Wrong timeout", _xaResource.getTransactionTimeout(), 1000);
- _xaResource.end(xid, XAResource.TMSUCCESS);
- xid = getNewXid();
- _xaResource.start(xid, XAResource.TMNOFLAGS);
- assertEquals("Wrong timeout", _xaResource.getTransactionTimeout(), 0);
- }
-
- /**
- * Strategy:
- * Check that a transaction timeout as expected
- * - set timeout to 10ms
- * - sleep 1000ms
- * - call end and check that the expected exception is thrown
- */
- public void testTransactionTimeout() throws Exception
- {
- Xid xid = getNewXid();
- try
- {
- _xaResource.start(xid, XAResource.TMNOFLAGS);
- assertEquals("Wrong timeout", _xaResource.getTransactionTimeout(), 0);
- _xaResource.setTransactionTimeout(10);
- Thread.sleep(1000);
- _xaResource.end(xid, XAResource.TMSUCCESS);
- }
- catch (XAException e)
- {
- assertEquals("Wrong error code: ", XAException.XA_RBTIMEOUT, e.errorCode);
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/QueueTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/QueueTest.java
deleted file mode 100644
index d2abc0eac1..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/QueueTest.java
+++ /dev/null
@@ -1,657 +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.
- */
-package org.apache.qpid.test.unit.xa;
-
-import javax.jms.*;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import javax.transaction.xa.XAException;
-
-import junit.framework.TestSuite;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class QueueTest extends AbstractXATestCase
-{
- /* this clas logger */
- private static final Logger _logger = LoggerFactory.getLogger(QueueTest.class);
-
- /**
- * the queue use by all the tests
- */
- private static Queue _queue = null;
- /**
- * the queue connection factory used by all tests
- */
- private static XAQueueConnectionFactory _queueFactory = null;
-
- /**
- * standard xa queue connection
- */
- private static XAQueueConnection _xaqueueConnection= null;
-
- /**
- * standard xa queue connection
- */
- private static QueueConnection _queueConnection=null;
-
-
- /**
- * standard queue session created from the standard connection
- */
- private static QueueSession _nonXASession = null;
-
- /**
- * the queue name
- */
- private static final String QUEUENAME = "xaQueue";
-
- /** ----------------------------------------------------------------------------------- **/
- /**
- * ----------------------------- JUnit support ----------------------------------------- *
- */
-
- /**
- * Gets the test suite tests
- *
- * @return the test suite tests
- */
- public static TestSuite getSuite()
- {
- return new TestSuite(QueueTest.class);
- }
-
- /**
- * Run the test suite.
- *
- * @param args Any command line arguments specified to this class.
- */
- public static void main(String args[])
- {
- junit.textui.TestRunner.run(getSuite());
- }
-
- public void tearDown() throws Exception
- {
- if (!isBroker08())
- {
- try
- {
- _xaqueueConnection.close();
- _queueConnection.close();
- }
- catch (Exception e)
- {
- fail("Exception thrown when cleaning standard connection: " + e.getStackTrace());
- }
- }
- super.tearDown();
- }
-
- /**
- * Initialize standard actors
- */
- public void init()
- {
- if (!isBroker08())
- {
- // lookup test queue
- try
- {
- _queue = (Queue) getInitialContext().lookup(QUEUENAME);
- }
- catch (Exception e)
- {
- fail("cannot lookup test queue " + e.getMessage());
- }
-
- // lookup connection factory
- try
- {
- _queueFactory = getConnectionFactory();
- }
- catch (Exception e)
- {
- fail("enable to lookup connection factory ");
- }
- // create standard connection
- try
- {
- _xaqueueConnection= getNewQueueXAConnection();
- }
- catch (JMSException e)
- {
- fail("cannot create queue connection: " + e.getMessage());
- }
- // create xa session
- XAQueueSession session = null;
- try
- {
- session = _xaqueueConnection.createXAQueueSession();
- }
- catch (JMSException e)
- {
- fail("cannot create queue session: " + e.getMessage());
- }
- // create a standard session
- try
- {
- _queueConnection = _queueFactory.createQueueConnection();
- _nonXASession = _queueConnection.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
- }
- catch (JMSException e)
- {
- fail("cannot create queue session: " + e.getMessage());
- }
- init(session, _queue);
- }
- }
-
- /** -------------------------------------------------------------------------------------- **/
- /** ----------------------------- Test Suite -------------------------------------------- **/
- /** -------------------------------------------------------------------------------------- **/
-
- /**
- * Uses two transactions respectively with xid1 and xid2 that are used to send a message
- * within xid1 and xid2. xid2 is committed and xid1 is used to receive the message that was sent within xid2.
- * Xid is then committed and a standard transaction is used to receive the message that was sent within xid1.
- */
- public void testProducer()
- {
- if (!isBroker08())
- {
- _logger.debug("running testProducer");
- Xid xid1 = getNewXid();
- Xid xid2 = getNewXid();
- // start the xaResource for xid1
- try
- {
- _xaResource.start(xid1, XAResource.TMNOFLAGS);
- }
- catch (XAException e)
- {
- e.printStackTrace();
- fail("cannot start the transaction with xid1: " + e.getMessage());
- }
- try
- {
- // start the connection
- _xaqueueConnection.start();
- // produce a message with sequence number 1
- _message.setLongProperty(_sequenceNumberPropertyName, 1);
- _producer.send(_message);
- }
- catch (JMSException e)
- {
- fail(" cannot send persistent message: " + e.getMessage());
- }
- // suspend the transaction
- try
- {
- _xaResource.end(xid1, XAResource.TMSUSPEND);
- }
- catch (XAException e)
- {
- fail("Cannot end the transaction with xid1: " + e.getMessage());
- }
- // start the xaResource for xid2
- try
- {
- _xaResource.start(xid2, XAResource.TMNOFLAGS);
- }
- catch (XAException e)
- {
- fail("cannot start the transaction with xid2: " + e.getMessage());
- }
- try
- {
- // produce a message
- _message.setLongProperty(_sequenceNumberPropertyName, 2);
- _producer.send(_message);
- }
- catch (JMSException e)
- {
- fail(" cannot send second persistent message: " + e.getMessage());
- }
- // end xid2 and start xid1
- try
- {
- _xaResource.end(xid2, XAResource.TMSUCCESS);
- _xaResource.start(xid1, XAResource.TMRESUME);
- }
- catch (XAException e)
- {
- fail("Exception when ending and starting transactions: " + e.getMessage());
- }
- // two phases commit transaction with xid2
- try
- {
- int resPrepare = _xaResource.prepare(xid2);
- if (resPrepare != XAResource.XA_OK)
- {
- fail("prepare returned: " + resPrepare);
- }
- _xaResource.commit(xid2, false);
- }
- catch (XAException e)
- {
- fail("Exception thrown when preparing transaction with xid2: " + e.getMessage());
- }
- // receive a message from queue test we expect it to be the second one
- try
- {
- TextMessage message = (TextMessage) _consumer.receive(1000);
- if (message == null)
- {
- fail("did not receive second message as expected ");
- }
- else
- {
- if (message.getLongProperty(_sequenceNumberPropertyName) != 2)
- {
- fail("receive wrong message its sequence number is: " + message
- .getLongProperty(_sequenceNumberPropertyName));
- }
- }
- }
- catch (JMSException e)
- {
- fail("Exception when receiving second message: " + e.getMessage());
- }
- // end and one phase commit the first transaction
- try
- {
- _xaResource.end(xid1, XAResource.TMSUCCESS);
- _xaResource.commit(xid1, true);
- }
- catch (XAException e)
- {
- fail("Exception thrown when commiting transaction with xid1");
- }
- // We should now be able to receive the first message
- try
- {
- _xaqueueConnection.close();
- Session nonXASession = _nonXASession;
- MessageConsumer nonXAConsumer = nonXASession.createConsumer(_queue);
- _queueConnection.start();
- TextMessage message1 = (TextMessage) nonXAConsumer.receive(1000);
- if (message1 == null)
- {
- fail("did not receive first message as expected ");
- }
- else
- {
- if (message1.getLongProperty(_sequenceNumberPropertyName) != 1)
- {
- fail("receive wrong message its sequence number is: " + message1
- .getLongProperty(_sequenceNumberPropertyName));
- }
- }
- // commit that transacted session
- nonXASession.commit();
- // the queue should be now empty
- message1 = (TextMessage) nonXAConsumer.receive(1000);
- if (message1 != null)
- {
- fail("receive an unexpected message ");
- }
- }
- catch (JMSException e)
- {
- fail("Exception thrown when emptying the queue: " + e.getMessage());
- }
- }
- }
-
- /**
- * strategy: Produce a message within Tx1 and prepare tx1. crash the server then commit tx1 and consume the message
- */
- public void testSendAndRecover()
- {
- if (!isBroker08())
- {
- _logger.debug("running testSendAndRecover");
- Xid xid1 = getNewXid();
- // start the xaResource for xid1
- try
- {
- _xaResource.start(xid1, XAResource.TMNOFLAGS);
- }
- catch (XAException e)
- {
- fail("cannot start the transaction with xid1: " + e.getMessage());
- }
- try
- {
- // start the connection
- _xaqueueConnection.start();
- // produce a message with sequence number 1
- _message.setLongProperty(_sequenceNumberPropertyName, 1);
- _producer.send(_message);
- }
- catch (JMSException e)
- {
- fail(" cannot send persistent message: " + e.getMessage());
- }
- // suspend the transaction
- try
- {
- _xaResource.end(xid1, XAResource.TMSUCCESS);
- }
- catch (XAException e)
- {
- fail("Cannot end the transaction with xid1: " + e.getMessage());
- }
- // prepare the transaction with xid1
- try
- {
- _xaResource.prepare(xid1);
- }
- catch (XAException e)
- {
- fail("Exception when preparing xid1: " + e.getMessage());
- }
-
- /////// stop the server now !!
- try
- {
- _logger.debug("stopping broker");
- restartBroker();
- init();
- }
- catch (Exception e)
- {
- fail("Exception when stopping and restarting the server");
- }
-
- // get the list of in doubt transactions
- try
- {
- Xid[] inDoubt = _xaResource.recover(XAResource.TMSTARTRSCAN);
- if (inDoubt == null)
- {
- fail("the array of in doubt transactions should not be null ");
- }
- // At that point we expect only two indoubt transactions:
- if (inDoubt.length != 1)
- {
- fail("in doubt transaction size is diffenrent thatn 2, there are " + inDoubt.length + "in doubt transactions");
- }
-
- // commit them
- for (Xid anInDoubt : inDoubt)
- {
- if (anInDoubt.equals(xid1))
- {
- System.out.println("commit xid1 ");
- try
- {
- _xaResource.commit(anInDoubt, false);
- }
- catch (Exception e)
- {
- System.out.println("PB when aborted xid1");
- }
- }
- else
- {
- fail("did not receive right xid ");
- }
- }
- }
- catch (XAException e)
- {
- e.printStackTrace();
- fail("exception thrown when recovering transactions " + e.getMessage());
- }
- // the queue should contain the first message!
- try
- {
- _xaqueueConnection.close();
- Session nonXASession = _nonXASession;
- MessageConsumer nonXAConsumer = nonXASession.createConsumer(_queue);
- _queueConnection.start();
- TextMessage message1 = (TextMessage) nonXAConsumer.receive(1000);
-
- if (message1 == null)
- {
- fail("queue does not contain any message!");
- }
- if (message1.getLongProperty(_sequenceNumberPropertyName) != 1)
- {
- fail("Wrong message returned! Sequence number is " + message1
- .getLongProperty(_sequenceNumberPropertyName));
- }
- nonXASession.commit();
- }
- catch (JMSException e)
- {
- fail("Exception thrown when testin that queue test is not empty: " + e.getMessage());
- }
- }
- }
-
- /**
- * strategy: Produce a message within Tx1 and prepare tx1. Produce a standard message and consume
- * it within tx2 and prepare tx2. Shutdown the server and get the list of in doubt transactions:
- * we expect tx1 and tx2! Then, Tx1 is aborted and tx2 is committed so we expect the test's queue to be empty!
- */
- public void testRecover()
- {
- if (!isBroker08())
- {
- _logger.debug("running testRecover");
- Xid xid1 = getNewXid();
- Xid xid2 = getNewXid();
- // start the xaResource for xid1
- try
- {
- _xaResource.start(xid1, XAResource.TMNOFLAGS);
- }
- catch (XAException e)
- {
- fail("cannot start the transaction with xid1: " + e.getMessage());
- }
- try
- {
- // start the connection
- _xaqueueConnection.start();
- // produce a message with sequence number 1
- _message.setLongProperty(_sequenceNumberPropertyName, 1);
- _producer.send(_message);
- }
- catch (JMSException e)
- {
- fail(" cannot send persistent message: " + e.getMessage());
- }
- // suspend the transaction
- try
- {
- _xaResource.end(xid1, XAResource.TMSUCCESS);
- }
- catch (XAException e)
- {
- fail("Cannot end the transaction with xid1: " + e.getMessage());
- }
- // prepare the transaction with xid1
- try
- {
- _xaResource.prepare(xid1);
- }
- catch (XAException e)
- {
- fail("Exception when preparing xid1: " + e.getMessage());
- }
-
- // send a message using the standard session
- try
- {
- Session nonXASession = _nonXASession;
- MessageProducer nonXAProducer = nonXASession.createProducer(_queue);
- TextMessage message2 = nonXASession.createTextMessage();
- message2.setText("non XA ");
- message2.setLongProperty(_sequenceNumberPropertyName, 2);
- nonXAProducer.setDeliveryMode(DeliveryMode.PERSISTENT);
- nonXAProducer.send(message2);
- // commit that transacted session
- nonXASession.commit();
- }
- catch (Exception e)
- {
- fail("Exception thrown when emptying the queue: " + e.getMessage());
- }
- // start the xaResource for xid2
- try
- {
- _xaResource.start(xid2, XAResource.TMNOFLAGS);
- }
- catch (XAException e)
- {
- fail("cannot start the transaction with xid1: " + e.getMessage());
- }
- // receive a message from queue test we expect it to be the second one
- try
- {
- TextMessage message = (TextMessage) _consumer.receive(1000);
- if (message == null || message.getLongProperty(_sequenceNumberPropertyName) != 2)
- {
- fail("did not receive second message as expected ");
- }
- }
- catch (JMSException e)
- {
- fail("Exception when receiving second message: " + e.getMessage());
- }
- // suspend the transaction
- try
- {
- _xaResource.end(xid2, XAResource.TMSUCCESS);
- }
- catch (XAException e)
- {
- fail("Cannot end the transaction with xid2: " + e.getMessage());
- }
- // prepare the transaction with xid1
- try
- {
- _xaResource.prepare(xid2);
- }
- catch (XAException e)
- {
- fail("Exception when preparing xid2: " + e.getMessage());
- }
-
- /////// stop the server now !!
- try
- {
- _logger.debug("stopping broker");
- restartBroker();
- init();
- }
- catch (Exception e)
- {
- fail("Exception when stopping and restarting the server");
- }
-
- // get the list of in doubt transactions
- try
- {
- Xid[] inDoubt = _xaResource.recover(XAResource.TMSTARTRSCAN);
- if (inDoubt == null)
- {
- fail("the array of in doubt transactions should not be null ");
- }
- // At that point we expect only two indoubt transactions:
- if (inDoubt.length != 2)
- {
- fail("in doubt transaction size is diffenrent thatn 2, there are " + inDoubt.length + "in doubt transactions");
- }
-
- // commit them
- for (Xid anInDoubt : inDoubt)
- {
- if (anInDoubt.equals(xid1))
- {
- _logger.debug("rollback xid1 ");
- try
- {
- _xaResource.rollback(anInDoubt);
- }
- catch (Exception e)
- {
- System.out.println("PB when aborted xid1");
- }
- }
- else if (anInDoubt.equals(xid2))
- {
- _logger.debug("commit xid2 ");
- try
- {
- _xaResource.commit(anInDoubt, false);
- }
- catch (Exception e)
- {
- System.out.println("PB when commiting xid2");
- }
- }
- }
- }
- catch (XAException e)
- {
- e.printStackTrace();
- fail("exception thrown when recovering transactions " + e.getMessage());
- }
- // the queue should be empty
- try
- {
- _xaqueueConnection.close();
- Session nonXASession = _nonXASession;
- MessageConsumer nonXAConsumer = nonXASession.createConsumer(_queue);
- _queueConnection.start();
- TextMessage message1 = (TextMessage) nonXAConsumer.receive(1000);
- if (message1 != null)
- {
- fail("The queue is not empty! ");
- }
- }
- catch (JMSException e)
- {
- fail("Exception thrown when testin that queue test is empty: " + e.getMessage());
- }
- }
- }
-
- /** -------------------------------------------------------------------------------------- **/
- /** ----------------------------- Utility methods --------------------------------------- **/
- /** -------------------------------------------------------------------------------------- **/
-
- /**
- * get a new queue connection
- *
- * @return a new queue connection
- * @throws JMSException If the JMS provider fails to create the queue connection
- * due to some internal error or in case of authentication failure
- */
- private XAQueueConnection getNewQueueXAConnection() throws JMSException
- {
- return _queueFactory.createXAQueueConnection("guest", "guest");
- }
-
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/TopicTest.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/TopicTest.java
deleted file mode 100644
index 99d0f0a075..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/xa/TopicTest.java
+++ /dev/null
@@ -1,1711 +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.
- */
-package org.apache.qpid.test.unit.xa;
-
-import javax.jms.*;
-import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
-import javax.transaction.xa.XAException;
-
-import junit.framework.TestSuite;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- *
- *
- */
-public class TopicTest extends AbstractXATestCase
-{
- /* this clas logger */
- private static final Logger _logger = LoggerFactory.getLogger(TopicTest.class);
-
- /**
- * the topic use by all the tests
- */
- private static Topic _topic = null;
-
- /**
- * the topic connection factory used by all tests
- */
- private static XATopicConnectionFactory _topicFactory = null;
-
- /**
- * standard topic connection
- */
- private static XATopicConnection _topicConnection = null;
-
- /**
- * standard topic session created from the standard connection
- */
- private static XATopicSession _session = null;
-
- private static TopicSession _nonXASession = null;
-
- /**
- * the topic name
- */
- private static final String TOPICNAME = "xaTopic";
-
- /**
- * Indicate that a listenere has failed
- */
- private static boolean _failure = false;
-
- /** -------------------------------------------------------------------------------------- **/
- /** ----------------------------- JUnit support ----------------------------------------- **/
- /** -------------------------------------------------------------------------------------- **/
-
- /**
- * Gets the test suite tests
- *
- * @return the test suite tests
- */
- public static TestSuite getSuite()
- {
- return new TestSuite(TopicTest.class);
- }
-
- /**
- * Run the test suite.
- *
- * @param args Any command line arguments specified to this class.
- */
- public static void main(String args[])
- {
- junit.textui.TestRunner.run(getSuite());
- }
-
- public void tearDown() throws Exception
- {
- if (!isBroker08())
- {
- try
- {
- _topicConnection.stop();
- _topicConnection.close();
- }
- catch (Exception e)
- {
- fail("Exception thrown when cleaning standard connection: " + e.getStackTrace());
- }
- }
- super.tearDown();
- }
-
- /**
- * Initialize standard actors
- */
- public void init()
- {
- if (!isBroker08())
- {
- // lookup test queue
- try
- {
- _topic = (Topic) getInitialContext().lookup(TOPICNAME);
- }
- catch (Exception e)
- {
- fail("cannot lookup test topic " + e.getMessage());
- }
- // lookup connection factory
- try
- {
- _topicFactory = getConnectionFactory();
- }
- catch (Exception e)
- {
- fail("enable to lookup connection factory ");
- }
- // create standard connection
- try
- {
- _topicConnection = getNewTopicXAConnection();
- }
- catch (JMSException e)
- {
- fail("cannot create queue connection: " + e.getMessage());
- }
- // create standard session
- try
- {
- _session = _topicConnection.createXATopicSession();
- }
- catch (JMSException e)
- {
- fail("cannot create queue session: " + e.getMessage());
- }
- // create a standard session
- try
- {
- _nonXASession = _topicConnection.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
- }
- catch (JMSException e)
- {
- e.printStackTrace(); //To change body of catch statement use Options | File Templates.
- }
- init(_session, _topic);
- }
- }
-
- /** -------------------------------------------------------------------------------------- **/
- /** ----------------------------- Test Suite -------------------------------------------- **/
- /** -------------------------------------------------------------------------------------- **/
-
-
- /**
- * Uses two transactions respectively with xid1 and xid2 that are use to send a message
- * within xid1 and xid2. xid2 is committed and xid1 is used to receive the message that was sent within xid2.
- * Xid is then committed and a standard transaction is used to receive the message that was sent within xid1.
- */
- public void testProducer()
- {
- if (!isBroker08())
- {
- _logger.debug("testProducer");
- Xid xid1 = getNewXid();
- Xid xid2 = getNewXid();
- try
- {
- Session nonXASession = _nonXASession;
- MessageConsumer nonXAConsumer = nonXASession.createConsumer(_topic);
- _producer.setDeliveryMode(DeliveryMode.PERSISTENT);
- // start the xaResource for xid1
- try
- {
- _logger.debug("starting tx branch xid1");
- _xaResource.start(xid1, XAResource.TMNOFLAGS);
- }
- catch (XAException e)
- {
- e.printStackTrace();
- fail("cannot start the transaction with xid1: " + e.getMessage());
- }
- try
- {
- // start the connection
- _topicConnection.start();
- _logger.debug("produce a message with sequence number 1");
- _message.setLongProperty(_sequenceNumberPropertyName, 1);
- _producer.send(_message);
- }
- catch (JMSException e)
- {
- fail(" cannot send persistent message: " + e.getMessage());
- }
- _logger.debug("suspend the transaction branch xid1");
- try
- {
- _xaResource.end(xid1, XAResource.TMSUSPEND);
- }
- catch (XAException e)
- {
- fail("Cannot end the transaction with xid1: " + e.getMessage());
- }
- _logger.debug("start the xaResource for xid2");
- try
- {
- _xaResource.start(xid2, XAResource.TMNOFLAGS);
- }
- catch (XAException e)
- {
- fail("cannot start the transaction with xid2: " + e.getMessage());
- }
- try
- {
- _logger.debug("produce a message");
- _message.setLongProperty(_sequenceNumberPropertyName, 2);
- _producer.send(_message);
- }
- catch (JMSException e)
- {
- fail(" cannot send second persistent message: " + e.getMessage());
- }
- _logger.debug("end xid2 and start xid1");
- try
- {
- _xaResource.end(xid2, XAResource.TMSUCCESS);
- _xaResource.start(xid1, XAResource.TMRESUME);
- }
- catch (XAException e)
- {
- fail("Exception when ending and starting transactions: " + e.getMessage());
- }
- _logger.debug("two phases commit transaction with xid2");
- try
- {
- int resPrepare = _xaResource.prepare(xid2);
- if (resPrepare != XAResource.XA_OK)
- {
- fail("prepare returned: " + resPrepare);
- }
- _xaResource.commit(xid2, false);
- }
- catch (XAException e)
- {
- fail("Exception thrown when preparing transaction with xid2: " + e.getMessage());
- }
- _logger.debug("receiving a message from topic test we expect it to be the second one");
- try
- {
- TextMessage message = (TextMessage) _consumer.receive(1000);
- if (message == null)
- {
- fail("did not receive second message as expected ");
- }
- else
- {
- if (message.getLongProperty(_sequenceNumberPropertyName) != 2)
- {
- fail("receive wrong message its sequence number is: " + message
- .getLongProperty(_sequenceNumberPropertyName));
- }
- }
- }
- catch (JMSException e)
- {
- fail("Exception when receiving second message: " + e.getMessage());
- }
- _logger.debug("end and one phase commit the first transaction");
- try
- {
- _xaResource.end(xid1, XAResource.TMSUCCESS);
- _xaResource.commit(xid1, true);
- }
- catch (XAException e)
- {
- fail("Exception thrown when commiting transaction with xid1");
- }
- _logger.debug("We should now be able to receive the first and second message");
- try
- {
- TextMessage message1 = (TextMessage) nonXAConsumer.receive(1000);
- if (message1 == null)
- {
- fail("did not receive first message as expected ");
- }
- else
- {
- if (message1.getLongProperty(_sequenceNumberPropertyName) != 2)
- {
- fail("receive wrong message its sequence number is: " + message1
- .getLongProperty(_sequenceNumberPropertyName));
- }
- }
- message1 = (TextMessage) nonXAConsumer.receive(1000);
- if (message1 == null)
- {
- fail("did not receive first message as expected ");
- }
- else
- {
- if (message1.getLongProperty(_sequenceNumberPropertyName) != 1)
- {
- fail("receive wrong message its sequence number is: " + message1
- .getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _logger.debug("commit transacted session");
- nonXASession.commit();
- _logger.debug("Test that the topic is now empty");
- message1 = (TextMessage) nonXAConsumer.receive(1000);
- if (message1 != null)
- {
- fail("receive an unexpected message ");
- }
- }
- catch (JMSException e)
- {
- fail("Exception thrown when emptying the queue: " + e.getMessage());
- }
- }
- catch (JMSException e)
- {
- fail("cannot create standard consumer: " + e.getMessage());
- }
- }
- }
-
-
- /**
- * strategy: Produce a message within Tx1 and commit tx1. consume this message within tx2 and abort tx2.
- * Consume the same message within tx3 and commit it. Check that no more message is available.
- */
- public void testDurSub()
- {
- if (!isBroker08())
- {
- Xid xid1 = getNewXid();
- Xid xid2 = getNewXid();
- Xid xid3 = getNewXid();
- Xid xid4 = getNewXid();
- String durSubName = "xaSubDurable";
- try
- {
- TopicSubscriber xaDurSub = _session.createDurableSubscriber(_topic, durSubName);
- try
- {
- _topicConnection.start();
- _logger.debug("start xid1");
- _xaResource.start(xid1, XAResource.TMNOFLAGS);
- // start the connection
- _topicConnection.start();
- _logger.debug("produce a message with sequence number 1");
- _message.setLongProperty(_sequenceNumberPropertyName, 1);
- _producer.send(_message);
- _logger.debug("2 phases commit xid1");
- _xaResource.end(xid1, XAResource.TMSUCCESS);
- if (_xaResource.prepare(xid1) != XAResource.XA_OK)
- {
- fail("Problem when preparing tx1 ");
- }
- _xaResource.commit(xid1, false);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception when working with xid1: " + e.getMessage());
- }
- try
- {
- _logger.debug("start xid2");
- _xaResource.start(xid2, XAResource.TMNOFLAGS);
- _logger.debug("receive the previously produced message");
- TextMessage message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received ");
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != 1)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- _logger.debug("rollback xid2");
- boolean rollbackOnFailure = false;
- try
- {
- _xaResource.end(xid2, XAResource.TMFAIL);
- }
- catch (XAException e)
- {
- if (e.errorCode != XAException.XA_RBROLLBACK)
- {
- fail("Exception when working with xid2: " + e.getMessage());
- }
- rollbackOnFailure = true;
- }
- if (!rollbackOnFailure)
- {
- if (_xaResource.prepare(xid2) != XAResource.XA_OK)
- {
- fail("Problem when preparing tx2 ");
- }
- _xaResource.rollback(xid2);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception when working with xid2: " + e.getMessage());
- }
- try
- {
- _logger.debug("start xid3");
- _xaResource.start(xid3, XAResource.TMNOFLAGS);
- _logger.debug(" receive the previously aborted consumed message");
- TextMessage message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received ");
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != 1)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- _logger.debug("commit xid3");
- _xaResource.end(xid3, XAResource.TMSUCCESS);
- if (_xaResource.prepare(xid3) != XAResource.XA_OK)
- {
- fail("Problem when preparing tx3 ");
- }
- _xaResource.commit(xid3, false);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception when working with xid3: " + e.getMessage());
- }
- try
- {
- _logger.debug("start xid4");
- _xaResource.start(xid4, XAResource.TMNOFLAGS);
- _logger.debug("check that topic is empty");
- TextMessage message = (TextMessage) xaDurSub.receive(1000);
- if (message != null)
- {
- fail("An unexpected message was received ");
- }
- _logger.debug("commit xid4");
- _xaResource.end(xid4, XAResource.TMSUCCESS);
- _xaResource.commit(xid4, true);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception when working with xid4: " + e.getMessage());
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("problem when creating dur sub: " + e.getMessage());
- }
- finally
- {
- try
- {
- _session.unsubscribe(durSubName);
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("problem when unsubscribing dur sub: " + e.getMessage());
- }
- }
- }
- }
-
- /**
- * strategy: create a XA durable subscriber dusSub, produce 7 messages with the standard session,
- * consume 2 messages respectively with tx1, tx2 and tx3
- * abort tx2, we now expect to receive messages 3 and 4 first! Receive 3 messages within tx1 i.e. 34 and 7!
- * commit tx3
- * abort tx1: we now expect that only messages 5 and 6 are definitly consumed!
- * start tx4 and consume messages 1 - 4 and 7
- * commit tx4
- * Now the topic should be empty!
- */
- public void testMultiMessagesDurSub()
- {
- if (!isBroker08())
- {
- Xid xid1 = getNewXid();
- Xid xid2 = getNewXid();
- Xid xid3 = getNewXid();
- Xid xid4 = getNewXid();
- Xid xid6 = getNewXid();
- String durSubName = "xaSubDurable";
- TextMessage message;
- try
- {
- TopicSubscriber xaDurSub = _session.createDurableSubscriber(_topic, durSubName);
- try
- {
- Session txSession = _nonXASession;
- MessageProducer txProducer = txSession.createProducer(_topic);
- _logger.debug("produce 10 persistent messages");
- txProducer.setDeliveryMode(DeliveryMode.PERSISTENT);
- _topicConnection.start();
- for (int i = 1; i <= 7; i++)
- {
- _message.setLongProperty(_sequenceNumberPropertyName, i);
- txProducer.send(_message);
- }
- // commit txSession
- txSession.commit();
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("Exception thrown when producing messages: " + e.getMessage());
- }
-
- try
- {
- _logger.debug(" consume 2 messages respectively with tx1, tx2 and tx3");
- //----- start xid1
- _xaResource.start(xid1, XAResource.TMNOFLAGS);
- // receive the 2 first messages
- for (int i = 1; i <= 2; i++)
- {
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + i);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _xaResource.end(xid1, XAResource.TMSUSPEND);
- //----- start xid2
- _xaResource.start(xid2, XAResource.TMNOFLAGS);
- // receive the 2 first messages
- for (int i = 3; i <= 4; i++)
- {
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + i);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _xaResource.end(xid2, XAResource.TMSUSPEND);
- //----- start xid3
- _xaResource.start(xid3, XAResource.TMNOFLAGS);
- // receive the 2 first messages
- for (int i = 5; i <= 6; i++)
- {
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + i);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _xaResource.end(xid3, XAResource.TMSUCCESS);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception thrown when consumming 6 first messages: " + e.getMessage());
- }
- try
- {
- _logger.debug("abort tx2, we now expect to receive messages 3, 4 and 7");
- _xaResource.start(xid2, XAResource.TMRESUME);
- _xaResource.end(xid2, XAResource.TMSUCCESS);
- _xaResource.prepare(xid2);
- _xaResource.rollback(xid2);
- // receive 3 message within tx1: 3, 4 and 7
- _xaResource.start(xid1, XAResource.TMRESUME);
- _logger.debug(" 3, 4 and 7");
- for (int i = 1; i <= 3; i++)
- {
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + 3);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) <= 2 || 5 == message
- .getLongProperty(_sequenceNumberPropertyName) || message
- .getLongProperty(_sequenceNumberPropertyName) == 6)
- {
- fail("wrong sequence number: " + message
- .getLongProperty(_sequenceNumberPropertyName));
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception thrown when consumming message: 3, 4 and 7: " + e.getMessage());
- }
-
- try
- {
- _xaResource.end(xid1, XAResource.TMSUCCESS);
- _logger.debug(" commit tx3");
- _xaResource.commit(xid3, true);
- _logger.debug("abort tx1");
- _xaResource.prepare(xid1);
- _xaResource.rollback(xid1);
- }
- catch (XAException e)
- {
- e.printStackTrace();
- fail("XAException thrown when committing tx3 or aborting tx1: " + e.getMessage());
- }
-
- try
- {
- // consume messages 1 - 4 + 7
- //----- start xid1
- _xaResource.start(xid4, XAResource.TMNOFLAGS);
- for (int i = 1; i <= 5; i++)
- {
-
- message = (TextMessage) xaDurSub.receive(1000);
- _logger.debug(" received message: " + message.getLongProperty(_sequenceNumberPropertyName));
- if (message == null)
- {
- fail("no message received! expected: " + i);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) == 5 || message
- .getLongProperty(_sequenceNumberPropertyName) == 6)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _xaResource.end(xid4, XAResource.TMSUCCESS);
- _xaResource.prepare(xid4);
- _xaResource.commit(xid4, false);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception thrown in last phase: " + e.getMessage());
- }
- // now the topic should be empty!!
- try
- {
- // start xid6
- _xaResource.start(xid6, XAResource.TMNOFLAGS);
- // should now be empty
- message = (TextMessage) xaDurSub.receive(1000);
- if (message != null)
- {
- fail("An unexpected message was received " + message
- .getLongProperty(_sequenceNumberPropertyName));
- }
- // commit xid6
- _xaResource.end(xid6, XAResource.TMSUCCESS);
- _xaResource.commit(xid6, true);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception when working with xid6: " + e.getMessage());
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("problem when creating dur sub: " + e.getMessage());
- }
- finally
- {
- try
- {
- _session.unsubscribe(durSubName);
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("problem when unsubscribing dur sub: " + e.getMessage());
- }
- }
- }
- }
-
- /**
- * strategy: create a XA durable subscriber dusSub, produce 10 messages with the standard session,
- * consume 2 messages respectively with tx1, tx2 and tx3
- * prepare xid2 and xid3
- * crash the server
- * Redo the job for xid1 that has been aborted by server crash
- * abort tx2, we now expect to receive messages 3 and 4 first! Receive 3 messages within tx1 i.e. 34 and 7!
- * commit tx3
- * abort tx1: we now expect that only messages 5 and 6 are definitly consumed!
- * start tx4 and consume messages 1 - 4
- * start tx5 and consume messages 7 - 10
- * abort tx4
- * consume messages 1-4 with tx5
- * commit tx5
- * Now the topic should be empty!
- */
- public void testMultiMessagesDurSubCrash()
- {
- if (!isBroker08())
- {
- Xid xid1 = getNewXid();
- Xid xid2 = getNewXid();
- Xid xid3 = getNewXid();
- Xid xid4 = getNewXid();
- Xid xid5 = getNewXid();
- Xid xid6 = getNewXid();
- String durSubName = "xaSubDurable";
- TextMessage message;
- try
- {
- TopicSubscriber xaDurSub = _session.createDurableSubscriber(_topic, durSubName);
- try
- {
- Session txSession = _nonXASession;
- MessageProducer txProducer = txSession.createProducer(_topic);
- // produce 10 persistent messages
- txProducer.setDeliveryMode(DeliveryMode.PERSISTENT);
- _topicConnection.start();
- for (int i = 1; i <= 10; i++)
- {
- _message.setLongProperty(_sequenceNumberPropertyName, i);
- txProducer.send(_message);
- }
- // commit txSession
- txSession.commit();
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("Exception thrown when producing messages: " + e.getMessage());
- }
- try
- {
- // consume 2 messages respectively with tx1, tx2 and tx3
- //----- start xid1
- _xaResource.start(xid1, XAResource.TMNOFLAGS);
- // receive the 2 first messages
- for (int i = 1; i <= 2; i++)
- {
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + i);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _xaResource.end(xid1, XAResource.TMSUCCESS);
- //----- start xid2
- _xaResource.start(xid2, XAResource.TMNOFLAGS);
- // receive the 2 first messages
- for (int i = 3; i <= 4; i++)
- {
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + i);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _xaResource.end(xid2, XAResource.TMSUCCESS);
- //----- start xid3
- _xaResource.start(xid3, XAResource.TMNOFLAGS);
- // receive the 2 first messages
- for (int i = 5; i <= 6; i++)
- {
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + i);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _xaResource.end(xid3, XAResource.TMSUCCESS);
- // prepare tx2 and tx3
-
- _xaResource.prepare(xid2);
- _xaResource.prepare(xid3);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception thrown when consumming 6 first messages: " + e.getMessage());
- }
- /////// stop the broker now !!
- try
- {
- restartBroker();
- init();
- }
- catch (Exception e)
- {
- fail("Exception when stopping and restarting the server");
- }
- // get the list of in doubt transactions
- try
- {
- _topicConnection.start();
- // reconnect to dursub!
- xaDurSub = _session.createDurableSubscriber(_topic, durSubName);
- Xid[] inDoubt = _xaResource.recover(XAResource.TMSTARTRSCAN);
- if (inDoubt == null)
- {
- fail("the array of in doubt transactions should not be null ");
- }
- // At that point we expect only two indoubt transactions:
- if (inDoubt.length != 2)
- {
- fail("in doubt transaction size is diffenrent than 2, there are " + inDoubt.length + "in doubt transactions");
- }
- }
- catch (XAException e)
- {
- e.printStackTrace();
- fail("exception thrown when recovering transactions " + e.getMessage());
- }
- try
- {
- // xid1 has been aborted redo the job!
- // consume 2 messages with tx1
- //----- start xid1
- _xaResource.start(xid1, XAResource.TMNOFLAGS);
- // receive the 2 first messages
- for (int i = 1; i <= 2; i++)
- {
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + i);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _xaResource.end(xid1, XAResource.TMSUSPEND);
- // abort tx2, we now expect to receive messages 3 and 4 first!
- _xaResource.rollback(xid2);
-
- // receive 3 message within tx1: 3, 4 and 7
- _xaResource.start(xid1, XAResource.TMRESUME);
- // receive messages 3, 4 and 7
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + 3);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != 3)
- {
- fail("wrong sequence number: " + message
- .getLongProperty(_sequenceNumberPropertyName) + " 3 was expected");
- }
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + 4);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != 4)
- {
- fail("wrong sequence number: " + message
- .getLongProperty(_sequenceNumberPropertyName) + " 4 was expected");
- }
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + 7);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != 7)
- {
- fail("wrong sequence number: " + message
- .getLongProperty(_sequenceNumberPropertyName) + " 7 was expected");
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception thrown when consumming message: 3, 4 and 7: " + e.getMessage());
- }
-
- try
- {
- _xaResource.end(xid1, XAResource.TMSUSPEND);
- // commit tx3
- _xaResource.commit(xid3, false);
- // abort tx1
- _xaResource.prepare(xid1);
- _xaResource.rollback(xid1);
- }
- catch (XAException e)
- {
- e.printStackTrace();
- fail("XAException thrown when committing tx3 or aborting tx1: " + e.getMessage());
- }
-
- try
- {
- // consume messages 1 - 4
- //----- start xid1
- _xaResource.start(xid4, XAResource.TMNOFLAGS);
- for (int i = 1; i <= 4; i++)
- {
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + i);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _xaResource.end(xid4, XAResource.TMSUSPEND);
- // consume messages 8 - 10
- _xaResource.start(xid5, XAResource.TMNOFLAGS);
- for (int i = 7; i <= 10; i++)
- {
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + i);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _xaResource.end(xid5, XAResource.TMSUSPEND);
- // abort tx4
- _xaResource.prepare(xid4);
- _xaResource.rollback(xid4);
- // consume messages 1-4 with tx5
- _xaResource.start(xid5, XAResource.TMRESUME);
- for (int i = 1; i <= 4; i++)
- {
- message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received! expected: " + i);
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- }
- _xaResource.end(xid5, XAResource.TMSUSPEND);
- // commit tx5
- _xaResource.prepare(xid5);
- _xaResource.commit(xid5, false);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception thrown in last phase: " + e.getMessage());
- }
- // now the topic should be empty!!
- try
- {
- // start xid6
- _xaResource.start(xid6, XAResource.TMNOFLAGS);
- // should now be empty
- message = (TextMessage) xaDurSub.receive(1000);
- if (message != null)
- {
- fail("An unexpected message was received " + message
- .getLongProperty(_sequenceNumberPropertyName));
- }
- // commit xid6
- _xaResource.end(xid6, XAResource.TMSUSPEND);
- _xaResource.commit(xid6, true);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception when working with xid6: " + e.getMessage());
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("problem when creating dur sub: " + e.getMessage());
- }
- finally
- {
- try
- {
- _session.unsubscribe(durSubName);
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("problem when unsubscribing dur sub: " + e.getMessage());
- }
- }
- }
- }
-
-
- /**
- * strategy: Produce a message within Tx1 and commit tx1. a durable subscriber then receives that message within tx2
- * that is then prepared.
- * Shutdown the server and get the list of in doubt transactions:
- * we expect tx2, Tx2 is aborted and the message consumed within tx3 that is committed we then check that the topic is empty.
- */
- public void testDurSubCrash()
- {
- if (!isBroker08())
- {
- Xid xid1 = getNewXid();
- Xid xid2 = getNewXid();
- Xid xid3 = getNewXid();
- Xid xid4 = getNewXid();
- String durSubName = "xaSubDurable";
- try
- {
- TopicSubscriber xaDurSub = _session.createDurableSubscriber(_topic, durSubName);
- try
- {
- _topicConnection.start();
- //----- start xid1
- _xaResource.start(xid1, XAResource.TMNOFLAGS);
- // start the connection
- _topicConnection.start();
- // produce a message with sequence number 1
- _message.setLongProperty(_sequenceNumberPropertyName, 1);
- _producer.send(_message);
- // commit
- _xaResource.end(xid1, XAResource.TMSUCCESS);
- if (_xaResource.prepare(xid1) != XAResource.XA_OK)
- {
- fail("Problem when preparing tx1 ");
- }
- _xaResource.commit(xid1, false);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception when working with xid1: " + e.getMessage());
- }
- try
- {
- // start xid2
- _xaResource.start(xid2, XAResource.TMNOFLAGS);
- // receive the previously produced message
- TextMessage message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received ");
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != 1)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- // prepare xid2
- _xaResource.end(xid2, XAResource.TMSUCCESS);
- if (_xaResource.prepare(xid2) != XAResource.XA_OK)
- {
- fail("Problem when preparing tx2 ");
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception when working with xid2: " + e.getMessage());
- }
-
- /////// stop the server now !!
- try
- {
- restartBroker();
- init();
- }
- catch (Exception e)
- {
- fail("Exception when stopping and restarting the server");
- }
-
- // get the list of in doubt transactions
- try
- {
- _topicConnection.start();
- // reconnect to dursub!
- xaDurSub = _session.createDurableSubscriber(_topic, durSubName);
- Xid[] inDoubt = _xaResource.recover(XAResource.TMSTARTRSCAN);
- if (inDoubt == null)
- {
- fail("the array of in doubt transactions should not be null ");
- }
- // At that point we expect only two indoubt transactions:
- if (inDoubt.length != 1)
- {
- fail("in doubt transaction size is diffenrent than 2, there are " + inDoubt.length + "in doubt transactions");
- }
-
- // commit them
- for (Xid anInDoubt : inDoubt)
- {
- if (anInDoubt.equals(xid2))
- {
- System.out.println("aborting xid2 ");
- try
- {
- _xaResource.rollback(anInDoubt);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("exception when aborting xid2 ");
- }
- }
- else
- {
- System.out.println("XID2 is not in doubt ");
- }
- }
- }
- catch (XAException e)
- {
- e.printStackTrace();
- fail("exception thrown when recovering transactions " + e.getMessage());
- }
-
- try
- {
- // start xid3
- _xaResource.start(xid3, XAResource.TMNOFLAGS);
- // receive the previously produced message and aborted
- TextMessage message = (TextMessage) xaDurSub.receive(1000);
- if (message == null)
- {
- fail("no message received ");
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != 1)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- // commit xid3
- _xaResource.end(xid3, XAResource.TMSUCCESS);
- if (_xaResource.prepare(xid3) != XAResource.XA_OK)
- {
- fail("Problem when preparing tx3 ");
- }
- _xaResource.commit(xid3, false);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception when working with xid3: " + e.getMessage());
- }
- try
- {
- // start xid4
- _xaResource.start(xid4, XAResource.TMNOFLAGS);
- // should now be empty
- TextMessage message = (TextMessage) xaDurSub.receive(1000);
- if (message != null)
- {
- fail("An unexpected message was received " + message
- .getLongProperty(_sequenceNumberPropertyName));
- }
- // commit xid4
- _xaResource.end(xid4, XAResource.TMSUCCESS);
- _xaResource.commit(xid4, true);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception when working with xid4: " + e.getMessage());
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("problem when creating dur sub: " + e.getMessage());
- }
- finally
- {
- try
- {
- _session.unsubscribe(durSubName);
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("problem when unsubscribing dur sub: " + e.getMessage());
- }
- }
- }
- }
-
- /**
- * strategy: Produce a message within Tx1 and prepare tx1. Shutdown the server and get the list of indoubt transactions:
- * we expect tx1, Tx1 is committed so we expect the test topic not to be empty!
- */
- public void testRecover()
- {
- if (!isBroker08())
- {
- Xid xid1 = getNewXid();
- String durSubName = "test1";
- try
- {
- // create a dummy durable subscriber to be sure that messages are persisted!
- _nonXASession.createDurableSubscriber(_topic, durSubName);
- // start the xaResource for xid1
- try
- {
- _xaResource.start(xid1, XAResource.TMNOFLAGS);
- }
- catch (XAException e)
- {
- fail("cannot start the transaction with xid1: " + e.getMessage());
- }
- try
- {
- // start the connection
- _topicConnection.start();
- // produce a message with sequence number 1
- _message.setLongProperty(_sequenceNumberPropertyName, 1);
- _producer.send(_message);
- }
- catch (JMSException e)
- {
- fail(" cannot send persistent message: " + e.getMessage());
- }
- // suspend the transaction
- try
- {
- _xaResource.end(xid1, XAResource.TMSUCCESS);
- }
- catch (XAException e)
- {
- fail("Cannot end the transaction with xid1: " + e.getMessage());
- }
- // prepare the transaction with xid1
- try
- {
- _xaResource.prepare(xid1);
- }
- catch (XAException e)
- {
- fail("Exception when preparing xid1: " + e.getMessage());
- }
-
- /////// stop the server now !!
- try
- {
- restartBroker();
- init();
- }
- catch (Exception e)
- {
- fail("Exception when stopping and restarting the server");
- }
-
- try
- {
- MessageConsumer nonXAConsumer = _nonXASession.createDurableSubscriber(_topic, durSubName);
- _topicConnection.start();
- // get the list of in doubt transactions
- try
- {
- Xid[] inDoubt = _xaResource.recover(XAResource.TMSTARTRSCAN);
- if (inDoubt == null)
- {
- fail("the array of in doubt transactions should not be null ");
- }
- // At that point we expect only two indoubt transactions:
- if (inDoubt.length != 1)
- {
- fail("in doubt transaction size is diffenrent thatn 2, there are " + inDoubt.length + "in doubt transactions");
- }
- // commit them
- for (Xid anInDoubt : inDoubt)
- {
- if (anInDoubt.equals(xid1))
- {
- _logger.debug("committing xid1 ");
- try
- {
- _xaResource.commit(anInDoubt, false);
- }
- catch (Exception e)
- {
- _logger.debug("PB when aborted xid1");
- e.printStackTrace();
- fail("exception when committing xid1 ");
- }
- }
- else
- {
- _logger.debug("XID1 is not in doubt ");
- }
- }
- }
- catch (XAException e)
- {
- e.printStackTrace();
- fail("exception thrown when recovering transactions " + e.getMessage());
- }
- _logger.debug("the topic should not be empty");
- TextMessage message1 = (TextMessage) nonXAConsumer.receive(1000);
- if (message1 == null)
- {
- fail("The topic is empty! ");
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception thrown when testin that queue test is empty: " + e.getMessage());
- }
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("cannot create dummy durable subscriber: " + e.getMessage());
- }
- finally
- {
- try
- {
- // unsubscribe the dummy durable subscriber
- TopicSession nonXASession = _nonXASession;
- nonXASession.unsubscribe(durSubName);
- }
- catch (JMSException e)
- {
- fail("cannot unsubscribe durable subscriber: " + e.getMessage());
- }
- }
- }
- }
-
- /**
- * strategy:
- * create a standard durable subscriber
- * produce 3 messages
- * consume the first message with that durable subscriber
- * close the standard session that deactivates the durable subscriber
- * migrate the durable subscriber to an xa one
- * consume the second message with that xa durable subscriber
- * close the xa session that deactivates the durable subscriber
- * reconnect to the durable subscriber with a standard session
- * consume the two remaining messages and check that the topic is empty!
- */
- public void testMigrateDurableSubscriber()
- {
- if (!isBroker08())
- {
- Xid xid1 = getNewXid();
- Xid xid2 = getNewXid();
- String durSubName = "DurableSubscriberMigrate";
- try
- {
- Session stSession = _nonXASession;
- MessageProducer producer = stSession.createProducer(_topic);
- _logger.debug("Create a standard durable subscriber!");
- TopicSubscriber durSub = stSession.createDurableSubscriber(_topic, durSubName);
- TopicSubscriber durSub1 = stSession.createDurableSubscriber(_topic, durSubName + "_second");
- TextMessage message;
- producer.setDeliveryMode(DeliveryMode.PERSISTENT);
- _topicConnection.start();
- _logger.debug("produce 3 messages");
- for (int i = 1; i <= 3; i++)
- {
- _message.setLongProperty(_sequenceNumberPropertyName, i);
- //producer.send( _message );
- producer.send(_message, DeliveryMode.PERSISTENT, 9 - i, 0);
- stSession.commit();
- }
- _logger.debug("consume the first message with that durable subscriber");
- message = (TextMessage) durSub.receive(1000);
- if (message == null)
- {
- fail("no message received ");
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != 1)
- {
- fail("wrong sequence number: " + message.getLongProperty(_sequenceNumberPropertyName));
- }
- // commit the standard session
- stSession.commit();
- _logger.debug("first message consumed ");
- // close the session that deactivates the durable subscriber
- stSession.close();
- _logger.debug("migrate the durable subscriber to an xa one");
- _xaResource.start(xid1, XAResource.TMNOFLAGS);
- durSub = _session.createDurableSubscriber(_topic, durSubName);
- _logger.debug(" consume the second message with that xa durable subscriber and abort it");
- message = (TextMessage) durSub.receive(1000);
- if (message == null)
- {
- fail("no message received ");
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != 2)
- {
- System.out.println("wrong sequence number, 2 expected, received: " + message
- .getLongProperty(_sequenceNumberPropertyName));
- }
- _xaResource.end(xid1, XAResource.TMSUCCESS);
- _xaResource.prepare(xid1);
- _xaResource.rollback(xid1);
- _logger.debug("close the session that deactivates the durable subscriber");
- _session.close();
- _logger.debug("create a new standard session");
- stSession = _topicConnection.createTopicSession(true, 1);
- _logger.debug("reconnect to the durable subscriber");
- durSub = stSession.createDurableSubscriber(_topic, durSubName);
- durSub1 = stSession.createDurableSubscriber(_topic, durSubName + "_second");
- _logger.debug("Reconnected to durablse subscribers");
- _logger.debug(" consume the 2 remaining messages");
- message = (TextMessage) durSub.receive(1000);
- if (message == null)
- {
- fail("no message received ");
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != 2)
- {
- System.out.println("wrong sequence number, 2 expected, received: " + message
- .getLongProperty(_sequenceNumberPropertyName));
- }
- // consume the third message with that xa durable subscriber
- message = (TextMessage) durSub.receive(1000);
- if (message == null)
- {
- fail("no message received ");
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != 3)
- {
- System.out.println("wrong sequence number, 3 expected, received: " + message
- .getLongProperty(_sequenceNumberPropertyName));
- }
- stSession.commit();
- _logger.debug("the topic should be empty now");
- message = (TextMessage) durSub.receive(1000);
- if (message != null)
- {
- fail("Received unexpected message ");
- }
- stSession.commit();
- _logger.debug(" use dursub1 to receive all the 3 messages");
- for (int i = 1; i <= 3; i++)
- {
- message = (TextMessage) durSub1.receive(1000);
- if (message == null)
- {
- _logger.debug("no message received ");
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- fail("wrong sequence number, " + i + " expected, received: " + message
- .getLongProperty(_sequenceNumberPropertyName));
- }
- }
- stSession.commit();
- // send a non persistent message to check that all persistent messages are deleted
- producer = stSession.createProducer(_topic);
- producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
- producer.send(_message);
- stSession.commit();
- message = (TextMessage) durSub.receive(1000);
- if (message == null)
- {
- fail("message not received ");
- }
- message = (TextMessage) durSub1.receive(1000);
- if (message == null)
- {
- fail("message not received ");
- }
- stSession.commit();
- stSession.close();
- _logger.debug(" now create a standard non transacted session and reconnect to the durable xubscriber");
- TopicConnection stConnection =
- _topicConnection; //_topicFactory.createTopicConnection("guest", "guest");
- TopicSession autoAclSession = stConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
- TopicPublisher publisher = autoAclSession.createPublisher(_topic);
- durSub = autoAclSession.createDurableSubscriber(_topic, durSubName);
- stConnection.start();
- // produce 3 persistent messages
- for (int i = 1; i <= 3; i++)
- {
- _message.setLongProperty(_sequenceNumberPropertyName, i);
- //producer.send( _message );
- publisher.send(_message, DeliveryMode.PERSISTENT, 9 - i, 0);
- }
- _logger.debug(" use dursub to receive all the 3 messages");
- for (int i = 1; i <= 3; i++)
- {
- message = (TextMessage) durSub.receive(1000);
- if (message == null)
- {
- System.out.println("no message received ");
- }
- else if (message.getLongProperty(_sequenceNumberPropertyName) != i)
- {
- System.out.println("wrong sequence number, " + i + " expected, received: " + message
- .getLongProperty(_sequenceNumberPropertyName));
- }
- }
-
- _logger.debug("now set a message listener");
- AtomicBoolean lock = new AtomicBoolean(true);
- reset();
- stConnection.stop();
- durSub.setMessageListener(new TopicListener(1, 3, lock));
- _logger.debug(" produce 3 persistent messages");
- for (int i = 1; i <= 3; i++)
- {
- _message.setLongProperty(_sequenceNumberPropertyName, i);
- //producer.send( _message );
- publisher.send(_message, DeliveryMode.PERSISTENT, 9 - i, 0);
- }
- // start the connection
- stConnection.start();
- while (lock.get())
- {
- synchronized (lock)
- {
- lock.wait();
- }
- }
- if (getFailureStatus())
- {
- fail("problem with message listener");
- }
- stConnection.stop();
- durSub.setMessageListener(null);
- _logger.debug(" do the same with an xa session");
- // produce 3 persistent messages
- for (int i = 1; i <= 3; i++)
- {
- _message.setLongProperty(_sequenceNumberPropertyName, i);
- //producer.send( _message );
- publisher.send(_message, DeliveryMode.PERSISTENT, 9 - i, 0);
- }
- //stConnection.close();
- autoAclSession.close();
- _logger.debug(" migrate the durable subscriber to an xa one");
- _session = _topicConnection.createXATopicSession();
- _xaResource = _session.getXAResource();
- _xaResource.start(xid2, XAResource.TMNOFLAGS);
- durSub = _session.createDurableSubscriber(_topic, durSubName);
- lock = new AtomicBoolean();
- reset();
- _topicConnection.stop();
- durSub.setMessageListener(new TopicListener(1, 3, lock));
- // start the connection
- _topicConnection.start();
- while (lock.get())
- {
- synchronized (lock)
- {
- lock.wait();
- }
- }
- if (getFailureStatus())
- {
- fail("problem with XA message listener");
- }
- _xaResource.end(xid2, XAResource.TMSUCCESS);
- _xaResource.commit(xid2, true);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- fail("Exception thrown: " + e.getMessage());
- }
- finally
- {
- try
- {
- _topicConnection.createXASession().unsubscribe(durSubName);
- _topicConnection.createXASession().unsubscribe(durSubName + "_second");
- }
- catch (JMSException e)
- {
- fail("Exception thrown when unsubscribing durable subscriber " + e.getMessage());
- }
- }
- }
- }
-
- /** -------------------------------------------------------------------------------------- **/
- /** ----------------------------- Utility methods --------------------------------------- **/
- /** -------------------------------------------------------------------------------------- **/
-
- /**
- * get a new queue connection
- *
- * @return a new queue connection
- * @throws javax.jms.JMSException If the JMS provider fails to create the queue connection
- * due to some internal error or in case of authentication failure
- */
- private XATopicConnection getNewTopicXAConnection() throws JMSException
- {
- return _topicFactory.createXATopicConnection("guest", "guest");
- }
-
- public static void failure()
- {
- _failure = true;
- }
-
- public static void reset()
- {
- _failure = false;
- }
-
- public static boolean getFailureStatus()
- {
- return _failure;
- }
-
- private class TopicListener implements MessageListener
- {
- private long _counter;
- private long _end;
- private final AtomicBoolean _lock;
-
- public TopicListener(long init, long end, AtomicBoolean lock)
- {
- _counter = init;
- _end = end;
- _lock = lock;
- }
-
- public void onMessage(Message message)
- {
- long seq = 0;
- try
- {
- seq = message.getLongProperty(TopicTest._sequenceNumberPropertyName);
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- TopicTest.failure();
- _lock.set(false);
- synchronized (_lock)
- {
- _lock.notifyAll();
- }
- }
- if (seq != _counter)
- {
- System.out.println("received message " + seq + " expected " + _counter);
- TopicTest.failure();
- _lock.set(false);
- synchronized (_lock)
- {
- _lock.notifyAll();
- }
- }
- _counter++;
- if (_counter > _end)
- {
- _lock.set(false);
- synchronized (_lock)
- {
- _lock.notifyAll();
- }
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ConversationFactory.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ConversationFactory.java
deleted file mode 100644
index bc68320224..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ConversationFactory.java
+++ /dev/null
@@ -1,480 +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.
- *
- */
-package org.apache.qpid.test.utils;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.test.utils.ReflectionUtils;
-
-import javax.jms.*;
-
-import java.util.*;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * A conversation helper, uses a message correlation id pattern to match up sent and received messages as a conversation
- * over JMS messaging. Incoming message traffic is divided up by correlation id. Each id has a queue (behaviour dependant
- * on the queue implementation). Clients of this de-multiplexer can wait on messages, defined by message correlation ids.
- *
- * <p/>One use of this is as a conversation synchronizer where multiple threads are carrying out conversations over a
- * multiplexed messaging route. This can be usefull, as JMS sessions are not multi-threaded. Setting up the conversation
- * with synchronous queues will allow these threads to be written in a synchronous style, but with their execution order
- * governed by the asynchronous message flow. For example, something like the following code could run a multi-threaded
- * conversation (the conversation methods can be called many times in parallel):
- *
- * <p/><pre>
- * class Initiator
- * {
- * ConversationHelper conversation = new ConversationHelper(connection, null,
- * java.util.concurrent.LinkedBlockingQueue.class);
- *
- * initiateConversation()
- * {
- * try {
- * // Exchange greetings.
- * conversation.send(sendDestination, conversation.getSession().createTextMessage("Hello."));
- * Message greeting = conversation.receive();
- *
- * // Exchange goodbyes.
- * conversation.send(conversation.getSession().createTextMessage("Goodbye."));
- * Message goodbye = conversation.receive();
- * } finally {
- * conversation.end();
- * }
- * }
- * }
- *
- * class Responder
- * {
- * ConversationHelper conversation = new ConversationHelper(connection, receiveDestination,
- * java.util.concurrent.LinkedBlockingQueue.class);
- *
- * respondToConversation()
- * {
- * try {
- * // Exchange greetings.
- * Message greeting = conversation.receive();
- * conversation.send(conversation.getSession().createTextMessage("Hello."));
- *
- * // Exchange goodbyes.
- * Message goodbye = conversation.receive();
- * conversation.send(conversation.getSession().createTextMessage("Goodbye."));
- * } finally {
- * conversation.end();
- * }
- * }
- * }
- * </pre>
- *
- * <p/>Conversation correlation id's are generated on a per thread basis.
- *
- * <p/>The same controlSession is shared amongst all conversations. Calls to send are therefore synchronized because JMS
- * sessions are not multi-threaded.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Associate messages to an ongoing conversation using correlation ids.
- * <tr><td> Auto manage sessions for conversations.
- * <tr><td> Store messages not in a conversation in dead letter box.
- * </table>
- */
-public class ConversationFactory
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(ConversationFactory.class);
-
- /** Holds a map from correlation id's to queues. */
- private Map<Long, BlockingQueue<Message>> idsToQueues = new HashMap<Long, BlockingQueue<Message>>();
-
- /** Holds the connection over which the conversation is conducted. */
- private Connection connection;
-
- /** Holds the controlSession over which the conversation is conduxted. */
- private Session session;
-
- /** The message consumer for incoming messages. */
- MessageConsumer consumer;
-
- /** The message producer for outgoing messages. */
- MessageProducer producer;
-
- /** The well-known or temporary destination to receive replies on. */
- Destination receiveDestination;
-
- /** Holds the queue implementation class for the reply queue. */
- Class<? extends BlockingQueue> queueClass;
-
- /** Used to hold any replies that are received outside of the context of a conversation. */
- BlockingQueue<Message> deadLetterBox = new LinkedBlockingQueue<Message>();
-
- /* Used to hold conversation state on a per thread basis. */
- /*
- ThreadLocal<Conversation> threadLocals =
- new ThreadLocal<Conversation>()
- {
- protected Conversation initialValue()
- {
- Conversation settings = new Conversation();
- settings.conversationId = conversationIdGenerator.getAndIncrement();
-
- return settings;
- }
- };
- */
-
- /** Generates new coversation id's as needed. */
- AtomicLong conversationIdGenerator = new AtomicLong();
-
- /**
- * Creates a conversation helper on the specified connection with the default sending destination, and listening
- * to the specified receiving destination.
- *
- * @param connection The connection to build the conversation helper on.
- * @param receiveDestination The destination to listen to for incoming messages. This may be null to use a temporary
- * queue.
- * @param queueClass The queue implementation class.
- *
- * @throws JMSException All underlying JMSExceptions are allowed to fall through.
- */
- public ConversationFactory(Connection connection, Destination receiveDestination,
- Class<? extends BlockingQueue> queueClass) throws JMSException
- {
- log.debug("public ConversationFactory(Connection connection, Destination receiveDestination = " + receiveDestination
- + ", Class<? extends BlockingQueue> queueClass = " + queueClass + "): called");
-
- this.connection = connection;
- this.queueClass = queueClass;
-
- session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- // Check if a well-known receive destination has been provided, or use a temporary queue if not.
- this.receiveDestination = (receiveDestination != null) ? receiveDestination : session.createTemporaryQueue();
-
- consumer = session.createConsumer(receiveDestination);
- producer = session.createProducer(null);
-
- consumer.setMessageListener(new Receiver());
- }
-
- /**
- * Creates a new conversation context.
- *
- * @return A new conversation context.
- */
- public Conversation startConversation()
- {
- log.debug("public Conversation startConversation(): called");
-
- Conversation conversation = new Conversation();
- conversation.conversationId = conversationIdGenerator.getAndIncrement();
-
- return conversation;
- }
-
- /**
- * Ensures that the reply queue for a conversation exists.
- *
- * @param conversationId The conversation correlation id.
- */
- private void initQueueForId(long conversationId)
- {
- if (!idsToQueues.containsKey(conversationId))
- {
- idsToQueues.put(conversationId, ReflectionUtils.<BlockingQueue>newInstance(queueClass));
- }
- }
-
- /**
- * Clears the dead letter box, returning all messages that were in it.
- *
- * @return All messages in the dead letter box.
- */
- public Collection<Message> emptyDeadLetterBox()
- {
- log.debug("public Collection<Message> emptyDeadLetterBox(): called");
-
- Collection<Message> result = new ArrayList<Message>();
- deadLetterBox.drainTo(result);
-
- return result;
- }
-
- /**
- * Gets the controlSession over which the conversation is conducted.
- *
- * @return The controlSession over which the conversation is conducted.
- */
- public Session getSession()
- {
- // Conversation settings = threadLocals.get();
-
- return session;
- }
-
- /**
- * Used to hold a conversation context. This consists of a correlating id for the conversation, and a reply
- * destination automatically updated to the last received reply-to destination.
- */
- public class Conversation
- {
- /** Holds the correlation id for the context. */
- long conversationId;
-
- /**
- * Holds the send destination for the context. This will automatically be updated to the most recently received
- * reply-to destination.
- */
- Destination sendDestination;
-
- /**
- * Sends a message to the default sending location. The correlation id of the message will be assigned by this
- * method, overriding any previously set value.
- *
- * @param sendDestination The destination to send to. This may be null to use the last received reply-to
- * destination.
- * @param message The message to send.
- *
- * @throws JMSException All undelying JMSExceptions are allowed to fall through. This will also be thrown if no
- * send destination is specified and there is no most recent reply-to destination available
- * to use.
- */
- public void send(Destination sendDestination, Message message) throws JMSException
- {
- log.debug("public void send(Destination sendDestination = " + sendDestination + ", Message message = " + message
- + "): called");
-
- // Conversation settings = threadLocals.get();
- // long conversationId = conversationId;
- message.setJMSCorrelationID(Long.toString(conversationId));
- message.setJMSReplyTo(receiveDestination);
-
- // Ensure that the reply queue for this conversation exists.
- initQueueForId(conversationId);
-
- // Check if an overriding send to destination has been set or use the last reply-to if not.
- Destination sendTo = null;
-
- if (sendDestination != null)
- {
- sendTo = sendDestination;
- }
- else if (sendDestination != null)
- {
- sendTo = sendDestination;
- }
- else
- {
- throw new JMSException("The send destination was specified, and no most recent reply-to available to use.");
- }
-
- // Send the message.
- synchronized (this)
- {
- producer.send(sendTo, message);
- }
- }
-
- /**
- * Gets the next message in an ongoing conversation. This method may block until such a message is received.
- *
- * @return The next incoming message in the conversation.
- *
- * @throws JMSException All undelying JMSExceptions are allowed to fall through. Thrown if the received message
- * did not have its reply-to destination set up.
- */
- public Message receive() throws JMSException
- {
- log.debug("public Message receive(): called");
-
- // Conversation settings = threadLocals.get();
- // long conversationId = settings.conversationId;
-
- // Ensure that the reply queue for this conversation exists.
- initQueueForId(conversationId);
-
- BlockingQueue<Message> queue = idsToQueues.get(conversationId);
-
- try
- {
- Message result = queue.take();
-
- // Keep the reply-to destination to send replies to.
- sendDestination = result.getJMSReplyTo();
-
- return result;
- }
- catch (InterruptedException e)
- {
- return null;
- }
- }
-
- /**
- * Gets many messages in an ongoing conversation. If a limit is specified, then once that many messages are
- * received they will be returned. If a timeout is specified, then all messages up to the limit, received within
- * that timespan will be returned. At least one of the message count or timeout should be set to a value of
- * 1 or greater.
- *
- * @param num The number of messages to receive, or all if this is less than 1.
- * @param timeout The timeout in milliseconds to receive the messages in, or forever if this is less than 1.
- *
- * @return All messages received within the count limit and the timeout.
- *
- * @throws JMSException All undelying JMSExceptions are allowed to fall through.
- */
- public Collection<Message> receiveAll(int num, long timeout) throws JMSException
- {
- log.debug("public Collection<Message> receiveAll(int num = " + num + ", long timeout = " + timeout
- + "): called");
-
- // Check that a timeout or message count was set.
- if ((num < 1) && (timeout < 1))
- {
- throw new IllegalArgumentException("At least one of message count (num) or timeout must be set.");
- }
-
- // Ensure that the reply queue for this conversation exists.
- initQueueForId(conversationId);
- BlockingQueue<Message> queue = idsToQueues.get(conversationId);
-
- // Used to collect the received messages in.
- Collection<Message> result = new ArrayList<Message>();
-
- // Used to indicate when the timeout or message count has expired.
- boolean receiveMore = true;
-
- int messageCount = 0;
-
- // Receive messages until the timeout or message count expires.
- do
- {
- try
- {
- Message next = null;
-
- // Try to receive the message with a timeout if one has been set.
- if (timeout > 0)
- {
- next = queue.poll(timeout, TimeUnit.MILLISECONDS);
-
- // Check if the timeout expired, and stop receiving if so.
- if (next == null)
- {
- receiveMore = false;
- }
- }
- // Receive the message without a timeout.
- else
- {
- next = queue.take();
- }
-
- // Increment the message count if a message was received.
- messageCount += (next != null) ? 1 : 0;
-
- // Check if all the requested messages were received, and stop receiving if so.
- if ((num > 0) && (messageCount >= num))
- {
- receiveMore = false;
- }
-
- // Keep the reply-to destination to send replies to.
- sendDestination = (next != null) ? next.getJMSReplyTo() : sendDestination;
-
- if (next != null)
- {
- result.add(next);
- }
- }
- catch (InterruptedException e)
- {
- // Restore the threads interrupted status.
- Thread.currentThread().interrupt();
-
- // Stop receiving but return the messages received so far.
- receiveMore = false;
- }
- }
- while (receiveMore);
-
- return result;
- }
-
- /**
- * Completes the conversation. Any correlation id's pertaining to the conversation are no longer valid, and any
- * incoming messages using them will go to the dead letter box.
- */
- public void end()
- {
- log.debug("public void end(): called");
-
- // Ensure that the thread local for the current thread is cleaned up.
- // Conversation settings = threadLocals.get();
- // long conversationId = settings.conversationId;
- // threadLocals.remove();
-
- // Ensure that its queue is removed from the queue map.
- BlockingQueue<Message> queue = idsToQueues.remove(conversationId);
-
- // Move any outstanding messages on the threads conversation id into the dead letter box.
- queue.drainTo(deadLetterBox);
- }
- }
-
- /**
- * Implements the message listener for this conversation handler.
- */
- protected class Receiver implements MessageListener
- {
- /**
- * Handles all incoming messages in the ongoing conversations. These messages are split up by correaltion id
- * and placed into queues.
- *
- * @param message The incoming message.
- */
- public void onMessage(Message message)
- {
- log.debug("public void onMessage(Message message = " + message + "): called");
-
- try
- {
- Long conversationId = Long.parseLong(message.getJMSCorrelationID());
-
- // Find the converstaion queue to place the message on. If there is no conversation for the message id,
- // the the dead letter box queue is used.
- BlockingQueue<Message> queue = idsToQueues.get(conversationId);
- queue = (queue == null) ? deadLetterBox : queue;
-
- queue.put(message);
- }
- catch (JMSException e)
- {
- throw new RuntimeException(e);
- }
- catch (InterruptedException e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java
deleted file mode 100644
index 2a44c444e0..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/FailoverBaseCase.java
+++ /dev/null
@@ -1,93 +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.
- *
- */
-package org.apache.qpid.test.utils;
-
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-
-import javax.jms.Connection;
-
-public class FailoverBaseCase extends QpidTestCase
-{
-
- protected int FAILING_VM_PORT = 2;
- protected int FAILING_PORT = 5673;
-
- private boolean failedOver = false;
-
- private int getFailingPort()
- {
- if (_broker.equals(VM))
- {
- return FAILING_VM_PORT;
- }
- else
- {
- return FAILING_PORT;
- }
- }
-
- protected void setUp() throws java.lang.Exception
- {
- super.setUp();
- startBroker(getFailingPort());
- }
-
- /**
- * We are using failover factories
- *
- * @return a connection
- * @throws Exception
- */
- public Connection getConnection() throws Exception
- {
- Connection conn =
- getConnectionFactory("failover").createConnection("guest", "guest");
- _connections.add(conn);
- return conn;
- }
-
- public void tearDown() throws Exception
- {
- if (!failedOver)
- {
- stopBroker(getFailingPort());
- }
- super.tearDown();
- }
-
-
- /**
- * Only used of VM borker.
- */
- public void failBroker()
- {
- failedOver = true;
- try
- {
- stopBroker(getFailingPort());
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidClientConnection.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidClientConnection.java
deleted file mode 100644
index 35cab0fd33..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidClientConnection.java
+++ /dev/null
@@ -1,289 +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.
- *
- */
-
-package org.apache.qpid.test.utils;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.JMSAMQException;
-import org.apache.qpid.test.utils.QpidTestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Connection;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-public class QpidClientConnection extends QpidTestCase implements ExceptionListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(QpidClientConnection.class);
-
- private boolean transacted = true;
- private int ackMode = Session.CLIENT_ACKNOWLEDGE;
- private Connection connection;
-
- private String virtualHost;
- private String brokerlist;
- private int prefetch;
- protected Session session;
- protected boolean connected;
-
- public QpidClientConnection(String broker)
- {
- super();
- setVirtualHost("/test");
- setBrokerList(broker);
- setPrefetch(5000);
- }
-
-
- public Connection getConnection()
- {
- return connection;
- }
-
- public void connect() throws JMSException
- {
- if (!connected)
- {
- /*
- * amqp://[user:pass@][clientid]/virtualhost?
- * brokerlist='[transport://]host[:port][?option='value'[&option='value']];'
- * [&failover='method[?option='value'[&option='value']]']
- * [&option='value']"
- */
- String brokerUrl = "amqp://guest:guest@" + virtualHost + "?brokerlist='" + brokerlist + "'";
- try
- {
- _logger.info("connecting to Qpid :" + brokerUrl);
- connection = getConnection("guest", "guest") ;
- // register exception listener
- connection.setExceptionListener(this);
-
- session = ((AMQConnection) connection).createSession(transacted, ackMode, prefetch);
-
- _logger.info("starting connection");
- connection.start();
-
- connected = true;
- }
- catch (Exception e)
- {
- throw new JMSAMQException("URL syntax error in [" + brokerUrl + "]: " + e.getMessage(), e);
- }
- }
- }
-
- public void disconnect() throws Exception
- {
- if (connected)
- {
- session.commit();
- session.close();
- connection.close();
- connected = false;
- _logger.info("disconnected");
- }
- }
-
- public void disconnectWithoutCommit() throws JMSException
- {
- if (connected)
- {
- session.close();
- connection.close();
- connected = false;
- _logger.info("disconnected without commit");
- }
- }
-
- public String getBrokerList()
- {
- return brokerlist;
- }
-
- public void setBrokerList(String brokerlist)
- {
- this.brokerlist = brokerlist;
- }
-
- public String getVirtualHost()
- {
- return virtualHost;
- }
-
- public void setVirtualHost(String virtualHost)
- {
- this.virtualHost = virtualHost;
- }
-
- public void setPrefetch(int prefetch)
- {
- this.prefetch = prefetch;
- }
-
- /** override as necessary */
- public void onException(JMSException exception)
- {
- _logger.info("ExceptionListener event: error " + exception.getErrorCode() + ", message: " + exception.getMessage());
- }
-
- public boolean isConnected()
- {
- return connected;
- }
-
- public Session getSession()
- {
- return session;
- }
-
- /**
- * Put a String as a text messages, repeat n times. A null payload will result in a null message.
- *
- * @param queueName The queue name to put to
- * @param payload the content of the payload
- * @param copies the number of messages to put
- *
- * @throws javax.jms.JMSException any exception that occurs
- */
- public void put(String queueName, String payload, int copies) throws JMSException
- {
- if (!connected)
- {
- connect();
- }
-
- _logger.info("putting to queue " + queueName);
- Queue queue = session.createQueue(queueName);
-
- final MessageProducer sender = session.createProducer(queue);
-
- for (int i = 0; i < copies; i++)
- {
- Message m = session.createTextMessage(payload + i);
- m.setIntProperty("index", i + 1);
- sender.send(m);
- }
-
- session.commit();
- sender.close();
- _logger.info("put " + copies + " copies");
- }
-
- /**
- * GET the top message on a queue. Consumes the message. Accepts timeout value.
- *
- * @param queueName The quename to get from
- * @param readTimeout The timeout to use
- *
- * @return the content of the text message if any
- *
- * @throws javax.jms.JMSException any exception that occured
- */
- public Message getNextMessage(String queueName, long readTimeout) throws JMSException
- {
- if (!connected)
- {
- connect();
- }
-
- Queue queue = session.createQueue(queueName);
-
- final MessageConsumer consumer = session.createConsumer(queue);
-
- Message message = consumer.receive(readTimeout);
- session.commit();
- consumer.close();
-
- Message result;
-
- // all messages we consume should be TextMessages
- if (message instanceof TextMessage)
- {
- result = ((TextMessage) message);
- }
- else if (null == message)
- {
- result = null;
- }
- else
- {
- _logger.info("warning: received non-text message");
- result = message;
- }
-
- return result;
- }
-
- /**
- * GET the top message on a queue. Consumes the message.
- *
- * @param queueName The Queuename to get from
- *
- * @return The string content of the text message, if any received
- *
- * @throws javax.jms.JMSException any exception that occurs
- */
- public Message getNextMessage(String queueName) throws JMSException
- {
- return getNextMessage(queueName, 0);
- }
-
- /**
- * Completely clears a queue. For readTimeout behaviour see Javadocs for javax.jms.MessageConsumer.
- *
- * @param queueName The Queue name to consume from
- * @param readTimeout The timeout for each consume
- *
- * @throws javax.jms.JMSException Any exception that occurs during the consume
- * @throws InterruptedException If the consume thread was interrupted during a consume.
- */
- public void consume(String queueName, int readTimeout) throws JMSException, InterruptedException
- {
- if (!connected)
- {
- connect();
- }
-
- _logger.info("consuming queue " + queueName);
- Queue queue = session.createQueue(queueName);
-
- final MessageConsumer consumer = session.createConsumer(queue);
- int messagesReceived = 0;
-
- _logger.info("consuming...");
- while ((consumer.receive(readTimeout)) != null)
- {
- messagesReceived++;
- }
-
- session.commit();
- consumer.close();
- _logger.info("consumed: " + messagesReceived);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidClientConnectionHelper.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidClientConnectionHelper.java
deleted file mode 100644
index 72003ed7d7..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidClientConnectionHelper.java
+++ /dev/null
@@ -1,295 +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.
- *
- */
-
-package org.apache.qpid.test.utils;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.client.AMQConnectionURL;
-import org.apache.qpid.client.JMSAMQException;
-import org.apache.qpid.url.URLSyntaxException;
-
-import javax.jms.Connection;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-/**
- * @todo This was originally cut and paste from the client module leading to a duplicate class, then altered very
- * slightly. To avoid the duplicate class the name was altered slightly to have 'Helper' on the end in order
- * to distinguish it from the original. Delete this class and use the original instead, just upgrade it to
- * provide the new features needed.
- */
-public class QpidClientConnectionHelper implements ExceptionListener
-{
-
- private static final Logger _logger = Logger.getLogger(QpidClientConnectionHelper.class);
-
- private boolean transacted = true;
- private int ackMode = Session.CLIENT_ACKNOWLEDGE;
- private Connection connection;
-
- private String virtualHost;
- private String brokerlist;
- private int prefetch;
- protected Session session;
- protected boolean connected;
-
- public QpidClientConnectionHelper(String broker)
- {
- super();
- setVirtualHost("/test");
- setBrokerList(broker);
- setPrefetch(5000);
- }
-
- public void connect() throws JMSException
- {
- if (!connected)
- {
- /*
- * amqp://[user:pass@][clientid]/virtualhost?
- * brokerlist='[transport://]host[:port][?option='value'[&option='value']];'
- * [&failover='method[?option='value'[&option='value']]']
- * [&option='value']"
- */
- String brokerUrl = "amqp://guest:guest@" + virtualHost + "?brokerlist='" + brokerlist + "'";
- try
- {
- AMQConnectionFactory factory = new AMQConnectionFactory(new AMQConnectionURL(brokerUrl));
- _logger.info("connecting to Qpid :" + brokerUrl);
- connection = factory.createConnection();
-
- // register exception listener
- connection.setExceptionListener(this);
-
- session = ((AMQConnection) connection).createSession(transacted, ackMode, prefetch);
-
- _logger.info("starting connection");
- connection.start();
-
- connected = true;
- }
- catch (URLSyntaxException e)
- {
- throw new JMSAMQException("URL syntax error in [" + brokerUrl + "]: " + e.getMessage(), e);
- }
- }
- }
-
- public void disconnect() throws JMSException
- {
- if (connected)
- {
- session.commit();
- session.close();
- connection.close();
- connected = false;
- _logger.info("disconnected");
- }
- }
-
- public void disconnectWithoutCommit() throws JMSException
- {
- if (connected)
- {
- session.close();
- connection.close();
- connected = false;
- _logger.info("disconnected without commit");
- }
- }
-
- public String getBrokerList()
- {
- return brokerlist;
- }
-
- public void setBrokerList(String brokerlist)
- {
- this.brokerlist = brokerlist;
- }
-
- public String getVirtualHost()
- {
- return virtualHost;
- }
-
- public void setVirtualHost(String virtualHost)
- {
- this.virtualHost = virtualHost;
- }
-
- public void setPrefetch(int prefetch)
- {
- this.prefetch = prefetch;
- }
-
- /** override as necessary */
- public void onException(JMSException exception)
- {
- _logger.info("ExceptionListener event: error " + exception.getErrorCode() + ", message: " + exception.getMessage());
- }
-
- public boolean isConnected()
- {
- return connected;
- }
-
- public Session getSession()
- {
- return session;
- }
-
- /**
- * Put a String as a text messages, repeat n times. A null payload will result in a null message.
- *
- * @param queueName The queue name to put to
- * @param payload the content of the payload
- * @param copies the number of messages to put
- *
- * @throws javax.jms.JMSException any exception that occurs
- */
- public void put(String queueName, String payload, int copies, int deliveryMode) throws JMSException
- {
- if (!connected)
- {
- connect();
- }
-
- _logger.info("putting to queue " + queueName);
- Queue queue = session.createQueue(queueName);
-
- final MessageProducer sender = session.createProducer(queue);
-
- sender.setDeliveryMode(deliveryMode);
-
- for (int i = 0; i < copies; i++)
- {
- Message m = session.createTextMessage(payload + i);
- m.setIntProperty("index", i + 1);
- sender.send(m);
- }
-
- session.commit();
- sender.close();
- _logger.info("put " + copies + " copies");
- }
-
- /**
- * GET the top message on a queue. Consumes the message. Accepts timeout value.
- *
- * @param queueName The quename to get from
- * @param readTimeout The timeout to use
- *
- * @return the content of the text message if any
- *
- * @throws javax.jms.JMSException any exception that occured
- */
- public Message getNextMessage(String queueName, long readTimeout) throws JMSException
- {
- if (!connected)
- {
- connect();
- }
-
- Queue queue = session.createQueue(queueName);
-
- final MessageConsumer consumer = session.createConsumer(queue);
-
- Message message = consumer.receive(readTimeout);
- session.commit();
- consumer.close();
-
- Message result;
-
- // all messages we consume should be TextMessages
- if (message instanceof TextMessage)
- {
- result = ((TextMessage) message);
- }
- else if (null == message)
- {
- result = null;
- }
- else
- {
- _logger.info("warning: received non-text message");
- result = message;
- }
-
- return result;
- }
-
- /**
- * GET the top message on a queue. Consumes the message.
- *
- * @param queueName The Queuename to get from
- *
- * @return The string content of the text message, if any received
- *
- * @throws javax.jms.JMSException any exception that occurs
- */
- public Message getNextMessage(String queueName) throws JMSException
- {
- return getNextMessage(queueName, 0);
- }
-
- /**
- * Completely clears a queue. For readTimeout behaviour see Javadocs for javax.jms.MessageConsumer.
- *
- * @param queueName The Queue name to consume from
- * @param readTimeout The timeout for each consume
- *
- * @throws javax.jms.JMSException Any exception that occurs during the consume
- * @throws InterruptedException If the consume thread was interrupted during a consume.
- */
- public void consume(String queueName, int readTimeout) throws JMSException, InterruptedException
- {
- if (!connected)
- {
- connect();
- }
-
- _logger.info("consuming queue " + queueName);
- Queue queue = session.createQueue(queueName);
-
- final MessageConsumer consumer = session.createConsumer(queue);
- int messagesReceived = 0;
-
- _logger.info("consuming...");
- while ((consumer.receive(readTimeout)) != null)
- {
- messagesReceived++;
- }
-
- session.commit();
- consumer.close();
- _logger.info("consumed: " + messagesReceived);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
deleted file mode 100644
index 085578c13d..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
+++ /dev/null
@@ -1,597 +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.
- */
-package org.apache.qpid.test.utils;
-
-import junit.framework.TestCase;
-import junit.framework.TestResult;
-
-import javax.jms.Connection;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- *
- *
- */
-public class QpidTestCase extends TestCase
-{
-
- private static final Logger _logger = LoggerFactory.getLogger(QpidTestCase.class);
-
- protected long RECEIVE_TIMEOUT = 1000l;
-
- private Map<String, String> _setProperties = new HashMap<String, String>();
-
- /**
- * Some tests are excluded when the property test.excludes is set to true.
- * An exclusion list is either a file (prop test.excludesfile) which contains one test name
- * to be excluded per line or a String (prop test.excludeslist) where tests to be excluded are
- * separated by " ". Excluded tests are specified following the format:
- * className#testName where className is the class of the test to be
- * excluded and testName is the name of the test to be excluded.
- * className#* excludes all the tests of the specified class.
- */
- private static final String DEFAULT_INITIAL_CONTEXT = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
-
- static
- {
- if (Boolean.getBoolean("test.excludes"))
- {
- _logger.info("Some tests should be excluded, building the exclude list");
- String exclusionListURIs = System.getProperties().getProperty("test.excludesfile", "");
- String exclusionListString = System.getProperties().getProperty("test.excludeslist", "");
- List<String> exclusionList = new ArrayList<String>();
-
- for (String uri : exclusionListURIs.split("\\s+"))
- {
- File file = new File(uri);
- if (file.exists())
- {
- _logger.info("Using exclude file: " + uri);
- try
- {
- BufferedReader in = new BufferedReader(new FileReader(file));
- String excludedTest = in.readLine();
- do
- {
- exclusionList.add(excludedTest);
- excludedTest = in.readLine();
- }
- while (excludedTest != null);
- }
- catch (IOException e)
- {
- _logger.warn("Exception when reading exclusion list", e);
- }
- }
- }
-
- if (!exclusionListString.equals(""))
- {
- _logger.info("Using excludeslist: " + exclusionListString);
- for (String test : exclusionListString.split("\\s+"))
- {
- exclusionList.add(test);
- }
- }
-
- _exclusionList = exclusionList;
- }
-
- String initialContext = System.getProperty(InitialContext.INITIAL_CONTEXT_FACTORY);
-
- if (initialContext == null || initialContext.length() == 0)
- {
- System.setProperty(InitialContext.INITIAL_CONTEXT_FACTORY, DEFAULT_INITIAL_CONTEXT);
- }
- }
-
- private static List<String> _exclusionList;
-
- // system properties
- private static final String BROKER = "broker";
- private static final String BROKER_CLEAN = "broker.clean";
- private static final String BROKER_VERSION = "broker.version";
- private static final String BROKER_READY = "broker.ready";
- private static final String TEST_OUTPUT = "test.output";
-
- // values
- protected static final String VM = "vm";
- protected static final String EXTERNAL = "external";
- private static final String VERSION_08 = "0-8";
- private static final String VERSION_010 = "0-10";
-
- private static final String QPID_HOME = "QPID_HOME";
-
- protected int DEFAULT_VM_PORT = 1;
- protected int DEFAULT_PORT = 5672;
-
- protected String _broker = System.getProperty(BROKER, VM);
- private String _brokerClean = System.getProperty(BROKER_CLEAN, null);
- private String _brokerVersion = System.getProperty(BROKER_VERSION, VERSION_08);
- private String _output = System.getProperty(TEST_OUTPUT);
-
- private Map<Integer,Process> _brokers = new HashMap<Integer,Process>();
-
- private InitialContext _initialContext;
- private AMQConnectionFactory _connectionFactory;
-
- private String _testName;
-
- // the connections created for a given test
- protected List<Connection> _connections = new ArrayList<Connection>();
-
- public QpidTestCase(String name)
- {
- super(name);
- }
-
- public QpidTestCase()
- {
- super("QpidTestCase");
- }
-
- public void runBare() throws Throwable
- {
- _testName = getClass().getSimpleName() + "." + getName();
- String qname = getClass().getName() + "." + getName();
-
- PrintStream oldOut = System.out;
- PrintStream oldErr = System.err;
- PrintStream out = null;
- PrintStream err = null;
- boolean redirected = _output != null && _output.length() > 0;
- if (redirected)
- {
- out = new PrintStream(String.format("%s/TEST-%s.out", _output, qname));
- err = new PrintStream(String.format("%s/TEST-%s.err", _output, qname));
- System.setOut(out);
- System.setErr(err);
- }
-
- _logger.info("========== start " + _testName + " ==========");
- startBroker();
- try
- {
- super.runBare();
- }
- finally
- {
- try
- {
- stopBroker();
- }
- catch (Exception e)
- {
- _logger.error("exception stopping broker", e);
- }
- _logger.info("========== stop " + _testName + " ==========");
-
- if (redirected)
- {
- System.setErr(oldErr);
- System.setOut(oldOut);
- err.close();
- out.close();
- }
- }
- }
-
- public void run(TestResult testResult)
- {
- if (_exclusionList != null && (_exclusionList.contains(getClass().getName() + "#*") ||
- _exclusionList.contains(getClass().getName() + "#" + getName())))
- {
- _logger.info("Test: " + getName() + " is excluded");
- testResult.endTest(this);
- }
- else
- {
- super.run(testResult);
- }
- }
-
- private static final class Piper extends Thread
- {
-
- private LineNumberReader in;
- private String ready;
- private CountDownLatch latch;
-
- public Piper(InputStream in, String ready)
- {
- this.in = new LineNumberReader(new InputStreamReader(in));
- this.ready = ready;
- if (this.ready != null && !this.ready.equals(""))
- {
- this.latch = new CountDownLatch(1);
- }
- else
- {
- this.latch = null;
- }
- }
-
- public Piper(InputStream in)
- {
- this(in, null);
- }
-
- public boolean await(long timeout, TimeUnit unit) throws InterruptedException
- {
- if (latch == null)
- {
- return true;
- }
- else
- {
- return latch.await(timeout, unit);
- }
- }
-
- public void run()
- {
- try
- {
- String line;
- while ((line = in.readLine()) != null)
- {
- System.out.println(line);
- if (latch != null && line.contains(ready))
- {
- latch.countDown();
- }
- }
- }
- catch (IOException e)
- {
- // this seems to happen regularly even when
- // exits are normal
- }
- finally
- {
- if (latch != null)
- {
- latch.countDown();
- }
- }
- }
- }
-
- public void startBroker(int port, ConfigurationFileApplicationRegistry config) throws Exception
- {
- ApplicationRegistry.initialise(config, port);
- startBroker(port);
- }
-
- public void startBroker() throws Exception
- {
- startBroker(0);
- }
-
- private int getPort(int port)
- {
- if (_broker.equals(VM))
- {
- return port == 0 ? DEFAULT_VM_PORT : port;
- }
- else if (!_broker.equals(EXTERNAL))
- {
- return port == 0 ? DEFAULT_PORT : port;
- }
- else
- {
- return port;
- }
- }
-
- private String getBrokerCommand(int port)
- {
- return _broker
- .replace("@PORT", "" + port)
- .replace("@MPORT", "" + (port + (8999 - DEFAULT_PORT)));
- }
-
- public void startBroker(int port) throws Exception
- {
- port = getPort(port);
-
- Process process = null;
- if (_broker.equals(VM))
- {
- // create an in_VM broker
- TransportConnection.createVMBroker(port);
- }
- else if (!_broker.equals(EXTERNAL))
- {
- String cmd = getBrokerCommand(port);
- _logger.info("starting broker: " + cmd);
- ProcessBuilder pb = new ProcessBuilder(cmd.split("\\s+"));
- pb.redirectErrorStream(true);
-
- Map<String, String> env = pb.environment();
-
- String qpidHome = System.getProperty(QPID_HOME);
- env.put(QPID_HOME, qpidHome);
-
- //Augment Path with bin directory in QPID_HOME.
- env.put("PATH", env.get("PATH").concat(File.pathSeparator + qpidHome + "/bin"));
-
- //Add the test name to the broker run.
- env.put("QPID_PNAME", "-DPNAME=\"" + _testName + "\"");
-
- process = pb.start();
-
- Piper p = new Piper(process.getInputStream(),
- System.getProperty(BROKER_READY));
-
- p.start();
-
- if (!p.await(30, TimeUnit.SECONDS))
- {
- _logger.info("broker failed to become ready");
- cleanBroker();
- throw new RuntimeException("broker failed to become ready");
- }
-
- try
- {
- int exit = process.exitValue();
- _logger.info("broker aborted: " + exit);
- cleanBroker();
- throw new RuntimeException("broker aborted: " + exit);
- }
- catch (IllegalThreadStateException e)
- {
- // this is expect if the broker started succesfully
- }
- }
-
- _brokers.put(port, process);
- }
-
- public void cleanBroker()
- {
- if (_brokerClean != null)
- {
- _logger.info("clean: " + _brokerClean);
-
- try
- {
- ProcessBuilder pb = new ProcessBuilder(_brokerClean.split("\\s+"));
- pb.redirectErrorStream(true);
- Process clean = pb.start();
- new Piper(clean.getInputStream()).start();
-
- clean.waitFor();
-
- _logger.info("clean exited: " + clean.exitValue());
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- catch (InterruptedException e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-
- public void stopBroker() throws Exception
- {
- stopBroker(0);
- }
-
- public void stopBroker(int port) throws Exception
- {
- port = getPort(port);
-
- _logger.info("stopping broker: " + getBrokerCommand(port));
- Process process = _brokers.remove(port);
- if (process != null)
- {
- process.destroy();
- process.waitFor();
- _logger.info("broker exited: " + process.exitValue());
- }
- else if (_broker.equals(VM))
- {
- TransportConnection.killVMBroker(port);
- ApplicationRegistry.remove(port);
- }
- }
-
- protected void setSystemProperty(String property, String value)
- {
- if (!_setProperties.containsKey(property))
- {
- _setProperties.put(property, System.getProperty(property));
- }
-
- System.setProperty(property, value);
- }
-
- protected void revertSystemProperties()
- {
- for (String key : _setProperties.keySet())
- {
- String value = _setProperties.get(key);
- if (value != null)
- {
- System.setProperty(key, value);
- }
- else
- {
- System.clearProperty(key);
- }
- }
- }
-
- /**
- * Check whether the broker is an 0.8
- *
- * @return true if the broker is an 0_8 version, false otherwise.
- */
- public boolean isBroker08()
- {
- return _brokerVersion.equals(VERSION_08);
- }
-
- public boolean isBroker010()
- {
- return _brokerVersion.equals(VERSION_010);
- }
-
- public void restartBroker() throws Exception
- {
- restartBroker(0);
- }
-
- public void restartBroker(int port) throws Exception
- {
- stopBroker(port);
- startBroker(port);
- }
-
- /**
- * we assume that the environment is correctly set
- * i.e. -Djava.naming.provider.url="..//example010.properties"
- * TODO should be a way of setting that through maven
- *
- * @return an initial context
- *
- * @throws NamingException if there is an error getting the context
- */
- public InitialContext getInitialContext() throws NamingException
- {
- _logger.info("get InitialContext");
- if (_initialContext == null)
- {
- _initialContext = new InitialContext();
- }
- return _initialContext;
- }
-
- /**
- * Get the default connection factory for the currently used broker
- * Default factory is "local"
- *
- * @return A conection factory
- *
- * @throws Exception if there is an error getting the tactory
- */
- public AMQConnectionFactory getConnectionFactory() throws NamingException
- {
- _logger.info("get ConnectionFactory");
- if (_connectionFactory == null)
- {
- _connectionFactory = getConnectionFactory("default");
- }
- return _connectionFactory;
- }
-
- /**
- * Get a connection factory for the currently used broker
- *
- * @param factoryName The factory name
- *
- * @return A conection factory
- *
- * @throws Exception if there is an error getting the tactory
- */
- public AMQConnectionFactory getConnectionFactory(String factoryName) throws NamingException
- {
- if (_broker.equals(VM))
- {
- factoryName += ".vm";
- }
-
- return (AMQConnectionFactory) getInitialContext().lookup(factoryName);
- }
-
- public Connection getConnection() throws Exception
- {
- return getConnection("guest", "guest");
- }
-
- /**
- * Get a connection (remote or in-VM)
- *
- * @param username The user name
- * @param password The user password
- *
- * @return a newly created connection
- *
- * @throws Exception if there is an error getting the connection
- */
- public Connection getConnection(String username, String password) throws Exception
- {
- _logger.info("get Connection");
- Connection con = getConnectionFactory().createConnection(username, password);
- //add the connection in the lis of connections
- _connections.add(con);
- return con;
- }
-
- public Connection getConnection(String username, String password, String id) throws Exception
- {
- _logger.info("get Connection");
- Connection con;
- if (_broker.equals(VM))
- {
- con = new AMQConnection("vm://:1", username, password, id, "test");
- }
- else
- {
- con = getConnectionFactory().createConnection(username, password, id);
- }
- //add the connection in the lis of connections
- _connections.add(con);
- return con;
- }
-
- protected void tearDown() throws java.lang.Exception
- {
- // close all the connections used by this test.
- for (Connection c : _connections)
- {
- c.close();
- }
-
- revertSystemProperties();
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ReflectionUtils.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ReflectionUtils.java
deleted file mode 100644
index 7946c6a6d1..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ReflectionUtils.java
+++ /dev/null
@@ -1,228 +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.
- *
- */
-package org.apache.qpid.test.utils;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-/**
- * Provides helper methods for operating on classes and methods using reflection. Reflection methods tend to return
- * a lot of checked exception so writing code to use them can be tedious and harder to read, especially when such errors
- * are not expected to occur. This class always works with {@link ReflectionUtilsException}, which is a runtime exception,
- * to wrap the checked exceptions raised by the standard Java reflection methods. Code using it does not normally
- * expect these errors to occur, usually does not have a recovery mechanism for them when they do, but is cleaner,
- * quicker to write and easier to read in the majority of cases.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Look up Classes by name.
- * <tr><td> Instantiate Classes by no-arg constructor.
- * </table>
- */
-public class ReflectionUtils
-{
- /**
- * Gets the Class object for a named class.
- *
- * @param className The class to get the Class object for.
- *
- * @return The Class object for the named class.
- */
- public static Class<?> forName(String className)
- {
- try
- {
- return Class.forName(className);
- }
- catch (ClassNotFoundException e)
- {
- throw new ReflectionUtilsException("ClassNotFoundException whilst finding class.", e);
- }
- }
-
- /**
- * Creates an instance of a Class, instantiated through its no-args constructor.
- *
- * @param cls The Class to instantiate.
- * @param <T> The Class type.
- *
- * @return An instance of the class.
- */
- public static <T> T newInstance(Class<? extends T> cls)
- {
- try
- {
- return cls.newInstance();
- }
- catch (InstantiationException e)
- {
- throw new ReflectionUtilsException("InstantiationException whilst instantiating class.", e);
- }
- catch (IllegalAccessException e)
- {
- throw new ReflectionUtilsException("IllegalAccessException whilst instantiating class.", e);
- }
- }
-
- /**
- * Calls a named method on an object with a specified set of parameters, any Java access modifier are overridden.
- *
- * @param o The object to call.
- * @param method The method name to call.
- * @param params The parameters to pass.
- * @param paramClasses The argument types.
- *
- * @return The return value from the method call.
- */
- public static Object callMethodOverridingIllegalAccess(Object o, String method, Object[] params, Class[] paramClasses)
- {
- // Get the objects class.
- Class cls = o.getClass();
-
- // Get the classes of the parameters.
- /*Class[] paramClasses = new Class[params.length];
-
- for (int i = 0; i < params.length; i++)
- {
- paramClasses[i] = params[i].getClass();
- }*/
-
- try
- {
- // Try to find the matching method on the class.
- Method m = cls.getDeclaredMethod(method, paramClasses);
-
- // Make it accessible.
- m.setAccessible(true);
-
- // Invoke it with the parameters.
- return m.invoke(o, params);
- }
- catch (NoSuchMethodException e)
- {
- throw new ReflectionUtilsException("NoSuchMethodException.", e);
- }
- catch (IllegalAccessException e)
- {
- throw new ReflectionUtilsException("IllegalAccessException.", e);
- }
- catch (InvocationTargetException e)
- {
- throw new ReflectionUtilsException("InvocationTargetException", e);
- }
- }
-
- /**
- * Calls a named method on an object with a specified set of parameters.
- *
- * @param o The object to call.
- * @param method The method name to call.
- * @param params The parameters to pass.
- *
- * @return The return value from the method call.
- */
- public static Object callMethod(Object o, String method, Object[] params)
- {
- // Get the objects class.
- Class cls = o.getClass();
-
- // Get the classes of the parameters.
- Class[] paramClasses = new Class[params.length];
-
- for (int i = 0; i < params.length; i++)
- {
- paramClasses[i] = params[i].getClass();
- }
-
- try
- {
- // Try to find the matching method on the class.
- Method m = cls.getMethod(method, paramClasses);
-
- // Invoke it with the parameters.
- return m.invoke(o, params);
- }
- catch (NoSuchMethodException e)
- {
- throw new ReflectionUtilsException("NoSuchMethodException.", e);
- }
- catch (IllegalAccessException e)
- {
- throw new ReflectionUtilsException("IllegalAccessException", e);
- }
- catch (InvocationTargetException e)
- {
- throw new ReflectionUtilsException("InvocationTargetException", e);
- }
- }
-
- /**
- * Calls a constuctor witht the specified arguments.
- *
- * @param constructor The constructor.
- * @param args The arguments.
- * @param <T> The Class type.
- *
- * @return An instance of the class that the constructor is for.
- */
- public static <T> T newInstance(Constructor<T> constructor, Object[] args)
- {
- try
- {
- return constructor.newInstance(args);
- }
- catch (InstantiationException e)
- {
- throw new ReflectionUtilsException("InstantiationException", e);
- }
- catch (IllegalAccessException e)
- {
- throw new ReflectionUtilsException("IllegalAccessException", e);
- }
- catch (InvocationTargetException e)
- {
- throw new ReflectionUtilsException("InvocationTargetException", e);
- }
- }
-
- /**
- * Gets the constructor of a class that takes the specified set of arguments if any matches. If no matching
- * constructor is found then a runtime exception is raised.
- *
- * @param cls The class to get a constructor from.
- * @param args The arguments to match.
- * @param <T> The class type.
- *
- * @return The constructor.
- */
- public static <T> Constructor<T> getConstructor(Class<T> cls, Class[] args)
- {
- try
- {
- return cls.getConstructor(args);
- }
- catch (NoSuchMethodException e)
- {
- throw new ReflectionUtilsException("NoSuchMethodException", e);
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ReflectionUtilsException.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ReflectionUtilsException.java
deleted file mode 100644
index 838828598b..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/ReflectionUtilsException.java
+++ /dev/null
@@ -1,44 +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.
- *
- */
-package org.apache.qpid.test.utils;
-
-/**
- * Wraps a checked exception that occurs when {@link ReflectionUtils} encounters checked exceptions using standard
- * Java reflection methods.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Wrap a checked reflection exception.
- * </table>
- */
-public class ReflectionUtilsException extends RuntimeException
-{
- /**
- * Creates a runtime reflection exception, from a checked one.
- *
- * @param message The message.
- * @param cause The causing exception.
- */
- public ReflectionUtilsException(String message, Throwable cause)
- {
- super(message, cause);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/protocol/TestIoSession.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/protocol/TestIoSession.java
deleted file mode 100644
index f1eb8159b6..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/protocol/TestIoSession.java
+++ /dev/null
@@ -1,104 +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.
- *
- */
-package org.apache.qpid.test.utils.protocol;
-
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-
-import org.apache.mina.common.IoFilterChain;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoService;
-import org.apache.mina.common.IoServiceConfig;
-import org.apache.mina.common.IoSessionConfig;
-import org.apache.mina.common.TransportType;
-import org.apache.mina.common.support.BaseIoSession;
-
-public class TestIoSession extends BaseIoSession {
-
- private String _stringLocalAddress;
- private int _localPort;
-
- public SocketAddress getLocalAddress()
- {
- //create a new address for testing purposes using member variables
- return new InetSocketAddress(_stringLocalAddress,_localPort);
- }
-
- protected void updateTrafficMask() {
- //dummy
- }
-
- public IoService getService() {
- return null;
- }
-
- public IoServiceConfig getServiceConfig() {
- return null;
- }
-
- public IoHandler getHandler() {
- return null;
- }
-
- public IoSessionConfig getConfig() {
- return null;
- }
-
- public IoFilterChain getFilterChain() {
- return null;
- }
-
- public TransportType getTransportType() {
- return null;
- }
-
- public SocketAddress getRemoteAddress() {
- return null;
- }
-
- public SocketAddress getServiceAddress() {
- return null;
- }
-
- public int getScheduledWriteRequests() {
- return 0;
- }
-
- public int getScheduledWriteBytes() {
- return 0;
- }
-
- public String getStringLocalAddress() {
- return _stringLocalAddress;
- }
-
- public void setStringLocalAddress(String _stringLocalAddress) {
- this._stringLocalAddress = _stringLocalAddress;
- }
-
- public int getLocalPort() {
- return _localPort;
- }
-
- public void setLocalPort(int _localPort) {
- this._localPort = _localPort;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/util/ClasspathScanner.java b/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/util/ClasspathScanner.java
deleted file mode 100644
index 8cae846a39..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/org/apache/qpid/util/ClasspathScanner.java
+++ /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.
- *
- */
-package org.apache.qpid.util;
-
-import java.io.File;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.log4j.Logger;
-
-/**
- * An ClasspathScanner scans the classpath for classes that implement an interface or extend a base class and have names
- * that match a regular expression.
- *
- * <p/>In order to test whether a class implements an interface or extends a class, the class must be loaded (unless
- * the class files were to be scanned directly). Using this collector can cause problems when it scans the classpath,
- * because loading classes will initialize their statics, which in turn may cause undesired side effects. For this
- * reason, the collector should always be used with a regular expression, through which the class file names are
- * filtered, and only those that pass this filter will be tested. For example, if you define tests in classes that
- * end with the keyword "Test" then use the regular expression "Test$" to match this.
- *
- * <p><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Find all classes matching type and name pattern on the classpath.
- * </table>
- *
- * @todo Add logic to scan jars as well as directories.
- */
-public class ClasspathScanner
-{
- private static final Logger log = Logger.getLogger(ClasspathScanner.class);
-
- /**
- * Scans the classpath and returns all classes that extend a specified class and match a specified name.
- * There is an flag that can be used to indicate that only Java Beans will be matched (that is, only those classes
- * that have a default constructor).
- *
- * @param matchingClass The class or interface to match.
- * @param matchingRegexp The regular expression to match against the class name.
- * @param beanOnly Flag to indicate that onyl classes with default constructors should be matched.
- *
- * @return All the classes that match this collector.
- */
- public static <T> Collection<Class<? extends T>> getMatches(Class<T> matchingClass, String matchingRegexp,
- boolean beanOnly)
- {
- log.debug("public static <T> Collection<Class<? extends T>> getMatches(Class<T> matchingClass = " + matchingClass
- + ", String matchingRegexp = " + matchingRegexp + ", boolean beanOnly = " + beanOnly + "): called");
-
- // Build a compiled regular expression from the pattern to match.
- Pattern matchPattern = Pattern.compile(matchingRegexp);
-
- String classPath = System.getProperty("java.class.path");
- Map<String, Class<? extends T>> result = new HashMap<String, Class<? extends T>>();
-
- log.debug("classPath = " + classPath);
-
- // Find matching classes starting from all roots in the classpath.
- for (String path : splitClassPath(classPath))
- {
- gatherFiles(new File(path), "", result, matchPattern, matchingClass);
- }
-
- return result.values();
- }
-
- /**
- * Finds all matching classes rooted at a given location in the file system. If location is a directory it
- * is recursively examined.
- *
- * @param classRoot The root of the current point in the file system being examined.
- * @param classFileName The name of the current file or directory to examine.
- * @param result The accumulated mapping from class names to classes that match the scan.
- *
- * @todo Recursion ok as file system depth is not likely to exhaust the stack. Might be better to replace with
- * iteration.
- */
- private static <T> void gatherFiles(File classRoot, String classFileName, Map<String, Class<? extends T>> result,
- Pattern matchPattern, Class<? extends T> matchClass)
- {
- log.debug("private static <T> void gatherFiles(File classRoot = " + classRoot + ", String classFileName = "
- + classFileName + ", Map<String, Class<? extends T>> result, Pattern matchPattern = " + matchPattern
- + ", Class<? extends T> matchClass = " + matchClass + "): called");
-
- File thisRoot = new File(classRoot, classFileName);
-
- // If the current location is a file, check if it is a matching class.
- if (thisRoot.isFile())
- {
- // Check that the file has a matching name.
- if (matchesName(thisRoot.getName(), matchPattern))
- {
- String className = classNameFromFile(thisRoot.getName());
-
- // Check that the class has matching type.
- try
- {
- Class<?> candidateClass = Class.forName(className);
-
- Class matchedClass = matchesClass(candidateClass, matchClass);
-
- if (matchedClass != null)
- {
- result.put(className, matchedClass);
- }
- }
- catch (ClassNotFoundException e)
- {
- // Ignore this. The matching class could not be loaded.
- log.debug("Got ClassNotFoundException, ignoring.", e);
- }
- }
-
- return;
- }
- // Otherwise the current location is a directory, so examine all of its contents.
- else
- {
- String[] contents = thisRoot.list();
-
- if (contents != null)
- {
- for (String content : contents)
- {
- gatherFiles(classRoot, classFileName + File.separatorChar + content, result, matchPattern, matchClass);
- }
- }
- }
- }
-
- /**
- * Checks if the specified class file name corresponds to a class with name matching the specified regular expression.
- *
- * @param classFileName The class file name.
- * @param matchPattern The regular expression pattern to match.
- *
- * @return <tt>true</tt> if the class name matches, <tt>false</tt> otherwise.
- */
- private static boolean matchesName(String classFileName, Pattern matchPattern)
- {
- String className = classNameFromFile(classFileName);
- Matcher matcher = matchPattern.matcher(className);
-
- return matcher.matches();
- }
-
- /**
- * Checks if the specified class to compare extends the base class being scanned for.
- *
- * @param matchingClass The base class to match against.
- * @param toMatch The class to match against the base class.
- *
- * @return The class to check, cast as an instance of the class to match if the class extends the base class, or
- * <tt>null</tt> otherwise.
- */
- private static <T> Class<? extends T> matchesClass(Class<?> matchingClass, Class<? extends T> toMatch)
- {
- try
- {
- return matchingClass.asSubclass(toMatch);
- }
- catch (ClassCastException e)
- {
- return null;
- }
- }
-
- /**
- * Takes a classpath (which is a series of paths) and splits it into its component paths.
- *
- * @param classPath The classpath to split.
- *
- * @return A list of the component paths that make up the class path.
- */
- private static List<String> splitClassPath(String classPath)
- {
- List<String> result = new LinkedList<String>();
- String separator = System.getProperty("path.separator");
- StringTokenizer tokenizer = new StringTokenizer(classPath, separator);
-
- while (tokenizer.hasMoreTokens())
- {
- result.add(tokenizer.nextToken());
- }
-
- return result;
- }
-
- /**
- * Translates from the filename of a class to its fully qualified classname. Files are named using forward slash
- * seperators and end in ".class", whereas fully qualified class names use "." sperators and no ".class" ending.
- *
- * @param classFileName The filename of the class to translate to a class name.
- *
- * @return The fully qualified class name.
- */
- private static String classNameFromFile(String classFileName)
- {
- log.debug("private static String classNameFromFile(String classFileName = " + classFileName + "): called");
-
- // Remove the .class ending.
- String s = classFileName.substring(0, classFileName.length() - ".class".length());
-
- // Turn / seperators in . seperators.
- String s2 = s.replace(File.separatorChar, '.');
-
- // Knock off any leading . caused by a leading /.
- if (s2.startsWith("."))
- {
- return s2.substring(1);
- }
-
- return s2;
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/main/java/systests.log4j b/M4-RCs/qpid/java/systests/src/main/java/systests.log4j
deleted file mode 100644
index 6d596d1d19..0000000000
--- a/M4-RCs/qpid/java/systests/src/main/java/systests.log4j
+++ /dev/null
@@ -1,28 +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.
-#
-log4j.rootLogger=${root.logging.level}
-
-
-log4j.logger.org.apache.qpid=${amqj.logging.level}, console
-log4j.additivity.org.apache.qpid=false
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=all
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n
diff --git a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/exchange/HeadersExchangePerformanceTest.java b/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/exchange/HeadersExchangePerformanceTest.java
deleted file mode 100644
index ff0d58ad69..0000000000
--- a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/exchange/HeadersExchangePerformanceTest.java
+++ /dev/null
@@ -1,184 +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.
- *
- */
-package org.apache.qpid.server.exchange;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.NoConsumersException;
-import org.apache.qpid.server.util.TimedRun;
-import org.apache.qpid.server.util.AveragedRun;
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.ContentBody;
-
-import java.util.List;
-
-/**
- * Want to vary the number of regsitrations, messages and matches and measure
- * the corresponding variance in execution time.
- * <p/>
- * Each registration will contain the 'All' header, even registrations will
- * contain the 'Even' header and odd headers will contain the 'Odd' header.
- * In additions each regsitration will have a unique value for the 'Specific'
- * header as well.
- * <p/>
- * Messages can then be routed to all registrations, to even- or odd- registrations
- * or to a specific registration.
- *
- */
-public class HeadersExchangePerformanceTest extends AbstractHeadersExchangeTest
-{
- private static enum Mode {ALL, ODD_OR_EVEN, SPECIFIC}
-
- private final TestQueue[] queues;
- private final Mode mode;
-
- public HeadersExchangePerformanceTest(Mode mode, int registrations) throws AMQException
- {
- this.mode = mode;
- queues = new TestQueue[registrations];
- for (int i = 0; i < queues.length; i++)
- {
- switch(mode)
- {
- case ALL:
- queues[i] = bind(new FastQueue("Queue" + i), "All");
- break;
- case ODD_OR_EVEN:
- queues[i] = bind(new FastQueue("Queue" + i), "All", oddOrEven(i));
- break;
- case SPECIFIC:
- queues[i] = bind(new FastQueue("Queue" + i), "All", oddOrEven(i), "Specific"+ i);
- break;
- }
- }
- }
-
- void sendToAll(int count) throws AMQException
- {
- send(count, "All=True");
- }
-
- void sendToOdd(int count) throws AMQException
- {
- send(count, "All=True", "Odd=True");
- }
-
- void sendToEven(int count) throws AMQException
- {
- send(count, "All=True", "Even=True");
- }
-
- void sendToAllSpecifically(int count) throws AMQException
- {
- for (int i = 0; i < queues.length; i++)
- {
- sendToSpecific(count, i);
- }
- }
-
- void sendToSpecific(int count, int index) throws AMQException
- {
- send(count, "All=True", oddOrEven(index) + "=True", "Specific=" + index);
- }
-
- private void send(int count, String... headers) throws AMQException
- {
- for (int i = 0; i < count; i++)
- {
- route(new Message("Message" + i, headers));
- }
- }
-
- private static String oddOrEven(int i)
- {
- return (i % 2 == 0 ? "Even" : "Odd");
- }
-
- static class FastQueue extends TestQueue
- {
-
- public FastQueue(String name) throws AMQException
- {
- super(name);
- }
-
- public void deliver(BasicPublishBody publishBody, ContentHeaderBody contentHeaderBody, List<ContentBody> contentBodies) throws NoConsumersException
- {
- //just discard as we are not testing routing functionality here
- }
- }
-
- static class Test extends TimedRun
- {
- private final Mode mode;
- private final int registrations;
- private final int count;
- private HeadersExchangePerformanceTest test;
-
- Test(Mode mode, int registrations, int count)
- {
- super(mode + ", registrations=" + registrations + ", count=" + count);
- this.mode = mode;
- this.registrations = registrations;
- this.count = count;
- }
-
- protected void setup() throws Exception
- {
- test = new HeadersExchangePerformanceTest(mode, registrations);
- run(100); //do a warm up run before times start
- }
-
- protected void teardown() throws Exception
- {
- test = null;
- System.gc();
- }
-
- protected void run() throws Exception
- {
- run(count);
- }
-
- private void run(int count) throws Exception
- {
- switch(mode)
- {
- case ALL:
- test.sendToAll(count);
- break;
- default:
- System.out.println("Test for " + mode + " not yet implemented.");
- }
- }
- }
-
- public static void main(String[] argv) throws Exception
- {
- int registrations = Integer.parseInt(argv[0]);
- int messages = Integer.parseInt(argv[1]);
- int iterations = Integer.parseInt(argv[2]);
- TimedRun test = new Test(Mode.ALL, registrations, messages);
- AveragedRun tests = new AveragedRun(test, iterations);
- System.out.println(tests.call());
- }
-}
-
diff --git a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/protocol/TestProtocolInitiation.java b/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/protocol/TestProtocolInitiation.java
deleted file mode 100644
index e76c164f64..0000000000
--- a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/protocol/TestProtocolInitiation.java
+++ /dev/null
@@ -1,266 +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.
- *
- */
-package org.apache.qpid.server.protocol;
-
-import org.apache.qpid.codec.AMQDecoder;
-import org.apache.qpid.codec.AMQEncoder;
-import org.apache.qpid.framing.*;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.WriteFuture;
-import org.apache.mina.filter.codec.ProtocolDecoderOutput;
-import org.apache.mina.filter.codec.ProtocolEncoderOutput;
-import org.apache.mina.filter.codec.support.SimpleProtocolDecoderOutput;
-
-import junit.framework.TestCase;
-
-/**
- * This test suite tests the handling of protocol initiation frames and related issues.
- */
-public class TestProtocolInitiation extends TestCase implements ProtocolVersionList
-{
- private AMQPFastProtocolHandler _protocolHandler;
-
- private MockIoSession _mockIoSession;
-
- /**
- * We need to use the object encoder mechanism so to allow us to retrieve the
- * output (a bytebuffer) we define our own encoder output class. The encoder
- * writes the encoded data to this class, from where we can retrieve it during
- * the test run.
- */
- private class TestProtocolEncoderOutput implements ProtocolEncoderOutput
- {
- public ByteBuffer result;
-
- public void write(ByteBuffer buf)
- {
- result = buf;
- }
-
- public void mergeAll()
- {
- throw new UnsupportedOperationException();
- }
-
- public WriteFuture flush()
- {
- throw new UnsupportedOperationException();
- }
- }
-
- private class TestProtocolDecoderOutput implements ProtocolDecoderOutput
- {
- public Object result;
-
- public void write(Object buf)
- {
- result = buf;
- }
-
- public void flush()
- {
- throw new UnsupportedOperationException();
- }
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- _mockIoSession = new MockIoSession();
- _protocolHandler = new AMQPFastProtocolHandler(null, null);
- }
-
-
- /**
- * Tests that the AMQDecoder handles invalid protocol classes
- * @throws Exception
- */
- public void testDecoderValidateProtocolClass() throws Exception
- {
- try
- {
- ProtocolInitiation pi = createValidProtocolInitiation();
- pi.protocolClass = 2;
- decodePI(pi);
- fail("expected exception did not occur");
- }
- catch (AMQProtocolClassException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected AMQProtocolClassException, got " + e);
- }
- }
-
- /**
- * Tests that the AMQDecoder handles invalid protocol instance numbers
- * @throws Exception
- */
- public void testDecoderValidatesProtocolInstance() throws Exception
- {
- try
- {
- ProtocolInitiation pi = createValidProtocolInitiation();
- pi.protocolInstance = 2;
- decodePI(pi);
- fail("expected exception did not occur");
- }
- catch (AMQProtocolInstanceException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected AMQProtocolInstanceException, got " + e);
- }
- }
-
- /**
- * Tests that the AMQDecoder handles invalid protocol major
- * @throws Exception
- */
- public void testDecoderValidatesProtocolMajor() throws Exception
- {
- try
- {
- ProtocolInitiation pi = createValidProtocolInitiation();
- pi.protocolMajor = 2;
- decodePI(pi);
- fail("expected exception did not occur");
- }
- catch (AMQProtocolVersionException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected AMQProtocolVersionException, got " + e);
- }
- }
-
- /**
- * Tests that the AMQDecoder handles invalid protocol minor
- * @throws Exception
- */
- public void testDecoderValidatesProtocolMinor() throws Exception
- {
- try
- {
- ProtocolInitiation pi = createValidProtocolInitiation();
- pi.protocolMinor = 99;
- decodePI(pi);
- fail("expected exception did not occur");
- }
- catch (AMQProtocolVersionException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected AMQProtocolVersionException, got " + e);
- }
- }
-
- /**
- * Tests that the AMQDecoder accepts a valid PI
- * @throws Exception
- */
- public void testDecoderValidatesHeader() throws Exception
- {
- try
- {
- ProtocolInitiation pi = createValidProtocolInitiation();
- pi.header = new char[] {'P', 'Q', 'M', 'A' };
- decodePI(pi);
- fail("expected exception did not occur");
- }
- catch (AMQProtocolHeaderException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected AMQProtocolHeaderException, got " + e);
- }
- }
-
- /**
- * Test that a valid header is passed by the decoder.
- * @throws Exception
- */
- public void testDecoderAcceptsValidHeader() throws Exception
- {
- ProtocolInitiation pi = createValidProtocolInitiation();
- decodePI(pi);
- }
-
- /**
- * This test checks that an invalid protocol header results in the
- * connection being closed.
- */
- public void testInvalidProtocolHeaderClosesConnection() throws Exception
- {
- AMQProtocolHeaderException pe = new AMQProtocolHeaderException("Test");
- _protocolHandler.exceptionCaught(_mockIoSession, pe);
- assertNotNull(_mockIoSession.getLastWrittenObject());
- Object piResponse = _mockIoSession.getLastWrittenObject();
- assertEquals(piResponse.getClass(), ProtocolInitiation.class);
- ProtocolInitiation pi = (ProtocolInitiation) piResponse;
- assertEquals("Protocol Initiation sent out was not the broker's expected header", pi,
- createValidProtocolInitiation());
- assertTrue("Session has not been closed", _mockIoSession.isClosing());
- }
-
- private ProtocolInitiation createValidProtocolInitiation()
- {
- /* Find last protocol version in protocol version list. Make sure last protocol version
- listed in the build file (build-module.xml) is the latest version which will be used
- here. */
- int i = pv.length - 1;
- return new ProtocolInitiation(pv[i][PROTOCOL_MAJOR], pv[i][PROTOCOL_MINOR]);
- }
-
- /**
- * Helper that encodes a protocol initiation and attempts to decode it
- * @param pi
- * @throws Exception
- */
- private void decodePI(ProtocolInitiation pi) throws Exception
- {
- // we need to do this test at the level of the decoder since we initially only expect PI frames
- // so the protocol handler is not set up to know whether it should be expecting a PI frame or
- // a different type of frame
- AMQDecoder decoder = new AMQDecoder(true);
- AMQEncoder encoder = new AMQEncoder();
- TestProtocolEncoderOutput peo = new TestProtocolEncoderOutput();
- encoder.encode(_mockIoSession, pi, peo);
- TestProtocolDecoderOutput pdo = new TestProtocolDecoderOutput();
- decoder.decode(_mockIoSession, peo.result, pdo);
- ((ProtocolInitiation) pdo.result).checkVersion(this);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TestProtocolInitiation.class);
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueueConcurrentPerfTest.java b/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueueConcurrentPerfTest.java
deleted file mode 100644
index 11c0026455..0000000000
--- a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueueConcurrentPerfTest.java
+++ /dev/null
@@ -1,49 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.server.util.AveragedRun;
-import org.apache.qpid.server.util.ConcurrentTest;
-
-public class QueueConcurrentPerfTest extends QueuePerfTest
-{
- QueueConcurrentPerfTest(Factory factory, int queueCount, int messages)
- {
- super(factory, queueCount, messages);
- }
-
- public static void main(String[] argv) throws Exception
- {
- Factory[] factories = new Factory[]{SYNCHRONIZED, CONCURRENT};
- int iterations = 5;
- String label = argv.length > 0 ? argv[0]: null;
- System.out.println((label == null ? "" : "Label, ") + "Queue Type, No. of Queues, No. of Operations, Avg Time, Min Time, Max Time");
- //vary number of queues:
- for(Factory f : factories)
- {
- run(label, new AveragedRun(new ConcurrentTest(new QueuePerfTest(f, 100, 10000), iterations), 5));
- run(label, new AveragedRun(new ConcurrentTest(new QueuePerfTest(f, 1000, 10000), iterations), 5));
- run(label, new AveragedRun(new ConcurrentTest(new QueuePerfTest(f, 10000, 10000), iterations), 5));
- run(label, new AveragedRun(new ConcurrentTest(new QueuePerfTest(f, 1000, 1000), iterations), 5));
- run(label, new AveragedRun(new ConcurrentTest(new QueuePerfTest(f, 1000, 100000), iterations), 5));
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueuePerfTest.java b/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueuePerfTest.java
deleted file mode 100644
index 5b3857396d..0000000000
--- a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueuePerfTest.java
+++ /dev/null
@@ -1,258 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.server.util.AveragedRun;
-import org.apache.qpid.server.util.TimedRun;
-import org.apache.qpid.server.util.RunStats;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Queue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-public class QueuePerfTest extends TimedRun
-{
- private final Factory _factory;
- private final int _queueCount;
- private final int _messages;
- private final String _msg = "";
- private List<Queue<String>> _queues;
-
- QueuePerfTest(Factory factory, int queueCount, int messages)
- {
- super(factory + ", " + queueCount + ", " + messages);
- _factory = factory;
- _queueCount = queueCount;
- _messages = messages;
- }
-
- protected void setup() throws Exception
- {
- //init
- int count = Integer.getInteger("prepopulate", 0);
-// System.err.println("Prepopulating with " + count + " items");
- _queues = new ArrayList<Queue<String>>(_queueCount);
- for (int i = 0; i < _queueCount; i++)
- {
- Queue<String> q = _factory.create();
- for(int j = 0; j < count; ++j)
- {
- q.add("Item"+ j);
- }
- _queues.add(q);
- }
- System.gc();
- }
-
- protected void teardown() throws Exception
- {
- System.gc();
- }
-
- protected void run() throws Exception
- {
- //dispatch
- for (int i = 0; i < _messages; i++)
- {
- for (Queue<String> q : _queues)
- {
- q.offer(_msg);
- q.poll();
- }
- }
- }
-
- static interface Factory
- {
- Queue<String> create();
- }
-
- static Factory CONCURRENT = new Factory()
- {
- public Queue<String> create()
- {
- return new ConcurrentLinkedQueue<String>();
- }
-
- public String toString()
- {
- return "ConcurrentLinkedQueue";
- }
-
- };
-
- static Factory SYNCHRONIZED = new Factory()
- {
- public Queue<String> create()
- {
- return new SynchronizedQueue<String>(new LinkedList<String>());
- }
-
-
- public String toString()
- {
- return "Synchronized LinkedList";
- }
- };
-
- static Factory PLAIN = new Factory()
- {
- public Queue<String> create()
- {
- return new LinkedList<String>();
- }
-
- public String toString()
- {
- return "Plain LinkedList";
- }
- };
-
- static class SynchronizedQueue<E> implements Queue<E>
- {
- private final Queue<E> queue;
-
- SynchronizedQueue(Queue<E> queue)
- {
- this.queue = queue;
- }
-
- public synchronized E element()
- {
- return queue.element();
- }
-
- public synchronized boolean offer(E o)
- {
- return queue.offer(o);
- }
-
- public synchronized E peek()
- {
- return queue.peek();
- }
-
- public synchronized E poll()
- {
- return queue.poll();
- }
-
- public synchronized E remove()
- {
- return queue.remove();
- }
-
- public synchronized int size()
- {
- return queue.size();
- }
-
- public synchronized boolean isEmpty()
- {
- return queue.isEmpty();
- }
-
- public synchronized boolean contains(Object o)
- {
- return queue.contains(o);
- }
-
- public synchronized Iterator<E> iterator()
- {
- return queue.iterator();
- }
-
- public synchronized Object[] toArray()
- {
- return queue.toArray();
- }
-
- public synchronized <T>T[] toArray(T[] a)
- {
- return queue.toArray(a);
- }
-
- public synchronized boolean add(E o)
- {
- return queue.add(o);
- }
-
- public synchronized boolean remove(Object o)
- {
- return queue.remove(o);
- }
-
- public synchronized boolean containsAll(Collection<?> c)
- {
- return queue.containsAll(c);
- }
-
- public synchronized boolean addAll(Collection<? extends E> c)
- {
- return queue.addAll(c);
- }
-
- public synchronized boolean removeAll(Collection<?> c)
- {
- return queue.removeAll(c);
- }
-
- public synchronized boolean retainAll(Collection<?> c)
- {
- return queue.retainAll(c);
- }
-
- public synchronized void clear()
- {
- queue.clear();
- }
- }
-
- static void run(String label, AveragedRun test) throws Exception
- {
- RunStats stats = test.call();
- System.out.println((label == null ? "" : label + ", ") + test
- + ", " + stats.getAverage() + ", " + stats.getMax() + ", " + stats.getMin());
- }
-
- public static void main(String[] argv) throws Exception
- {
- Factory[] factories = new Factory[]{PLAIN, SYNCHRONIZED, CONCURRENT};
- int iterations = 5;
- String label = argv.length > 0 ? argv[0]: null;
- System.out.println((label == null ? "" : "Label, ") + "Queue Type, No. of Queues, No. of Operations, Avg Time, Min Time, Max Time");
- //vary number of queues:
-
- for(Factory f : factories)
- {
- run(label, new AveragedRun(new QueuePerfTest(f, 100, 10000), iterations));
- run(label, new AveragedRun(new QueuePerfTest(f, 1000, 10000), iterations));
- run(label, new AveragedRun(new QueuePerfTest(f, 10000, 10000), iterations));
- run(label, new AveragedRun(new QueuePerfTest(f, 1000, 1000), iterations));
- run(label, new AveragedRun(new QueuePerfTest(f, 1000, 100000), iterations));
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/SendPerfTest.java b/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/SendPerfTest.java
deleted file mode 100644
index 2c5712fd35..0000000000
--- a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/queue/SendPerfTest.java
+++ /dev/null
@@ -1,181 +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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.txn.TransactionalContext;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.server.exchange.AbstractExchange;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.handler.OnCurrentThreadExecutor;
-import org.apache.qpid.server.protocol.AMQMinaProtocolSession;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.protocol.MockIoSession;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.SkeletonMessageStore;
-import org.apache.qpid.server.util.AveragedRun;
-import org.apache.qpid.server.util.TestApplicationRegistry;
-import org.apache.qpid.server.util.TimedRun;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.LinkedList;
-
-public class SendPerfTest extends TimedRun
-{
- private int _messages = 1000;
- private int _clients = 10;
- private List<AMQQueue> _queues;
-
- public SendPerfTest(int clients, int messages)
- {
- super("SendPerfTest, msgs=" + messages + ", clients=" + clients);
- _messages = messages;
- _clients = clients;
- }
-
- protected void setup() throws Exception
- {
- _queues = initQueues(_clients);
- System.gc();
- }
-
- protected void teardown() throws Exception
- {
- System.gc();
- }
-
- protected void run() throws Exception
- {
- deliver(_messages, _queues);
- }
-
- //have a dummy AMQProtocolSession that does nothing on the writeFrame()
- //set up x number of queues
- //create necessary bits and pieces to deliver a message
- //deliver y messages to each queue
-
- public static void main(String[] argv) throws Exception
- {
- ApplicationRegistry.initialise(new TestApplicationRegistry());
- int clients = Integer.parseInt(argv[0]);
- int messages = Integer.parseInt(argv[1]);
- int iterations = Integer.parseInt(argv[2]);
- AveragedRun test = new AveragedRun(new SendPerfTest(clients, messages), iterations);
- test.run();
- }
-
- /**
- * Delivers messages to a number of queues.
- * @param count the number of messages to deliver
- * @param queues the list of queues
- * @throws NoConsumersException
- */
- static void deliver(int count, List<AMQQueue> queues) throws AMQException
- {
- BasicPublishBody publish = new BasicPublishBody();
- publish.exchange = new NullExchange().getName();
- ContentHeaderBody header = new ContentHeaderBody();
- List<ContentBody> body = new ArrayList<ContentBody>();
- MessageStore messageStore = new SkeletonMessageStore();
- // channel can be null since it is only used in ack processing which does not apply to this test
- TransactionalContext txContext = new NonTransactionalContext(messageStore, null,
- new LinkedList<RequiredDeliveryException>());
- body.add(new ContentBody());
- MessageHandleFactory factory = new MessageHandleFactory();
- for (int i = 0; i < count; i++)
- {
- // this routes and delivers the message
- AMQMessage msg = new AMQMessage(i, publish, txContext, header, queues, body, messageStore,
- factory);
- }
- }
-
- static List<AMQQueue> initQueues(int number) throws AMQException
- {
- Exchange exchange = new NullExchange();
- List<AMQQueue> queues = new ArrayList<AMQQueue>(number);
- for (int i = 0; i < number; i++)
- {
- AMQQueue q = createQueue("Queue" + (i + 1));
- q.bind("routingKey", exchange);
- try
- {
- q.registerProtocolSession(createSession(), 1, "1", false);
- }
- catch (Exception e)
- {
- throw new AMQException("Error creating protocol session: " + e, e);
- }
- queues.add(q);
- }
- return queues;
- }
-
- static AMQQueue createQueue(String name) throws AMQException
- {
- return new AMQQueue(name, false, null, false, ApplicationRegistry.getInstance().getQueueRegistry(),
- new OnCurrentThreadExecutor());
- }
-
- static AMQProtocolSession createSession() throws Exception
- {
- IApplicationRegistry reg = ApplicationRegistry.getInstance();
- AMQCodecFactory codecFactory = new AMQCodecFactory(true);
- AMQMinaProtocolSession result = new AMQMinaProtocolSession(new MockIoSession(), reg.getQueueRegistry(), reg.getExchangeRegistry(), codecFactory);
- result.addChannel(new AMQChannel(1, null, null));
- return result;
- }
-
- static class NullExchange extends AbstractExchange
- {
- public String getName()
- {
- return "NullExchange";
- }
-
- protected ExchangeMBean createMBean()
- {
- return null;
- }
-
- public void registerQueue(String routingKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- }
-
- public void deregisterQueue(String routingKey, AMQQueue queue) throws AMQException
- {
- }
-
- public void route(AMQMessage payload) throws AMQException
- {
- }
- }
-}
diff --git a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/util/ConcurrentTest.java b/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/util/ConcurrentTest.java
deleted file mode 100644
index 1ae8d3205d..0000000000
--- a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/server/util/ConcurrentTest.java
+++ /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.
- *
- */
-package org.apache.qpid.server.util;
-
-public class ConcurrentTest extends TimedRun
-{
- private final TimedRun _test;
- private final Thread[] _threads;
-
- public ConcurrentTest(TimedRun test, int threads)
- {
- super(test.toString());
- _test = test;
- _threads = new Thread[threads];
- }
-
- protected void setup() throws Exception
- {
- _test.setup();
- for(int i = 0; i < _threads.length; i++)
- {
- _threads[i] = new Thread(new Runner());
- }
- }
-
- protected void teardown() throws Exception
- {
- _test.teardown();
- }
-
- protected void run() throws Exception
- {
- for(Thread t : _threads)
- {
- t.start();
- }
- for(Thread t : _threads)
- {
- t.join();
- }
- }
-
- private class Runner implements Runnable
- {
- private Exception error;
-
- public void run()
- {
- try
- {
- _test.run();
- }
- catch(Exception e)
- {
- error = e;
- e.printStackTrace();
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/test/unit/ack/DisconnectAndRedeliverTest.java b/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/test/unit/ack/DisconnectAndRedeliverTest.java
deleted file mode 100644
index 3e35e3c85b..0000000000
--- a/M4-RCs/qpid/java/systests/src/old_test/java/org/apache/qpid/test/unit/ack/DisconnectAndRedeliverTest.java
+++ /dev/null
@@ -1,215 +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.
- *
- */
-package org.apache.qpid.test.unit.ack;
-
-import junit.framework.TestCase;
-import org.apache.log4j.Logger;
-import org.apache.log4j.xml.DOMConfigurator;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
-import org.apache.qpid.server.util.TestApplicationRegistry;
-
-import javax.jms.*;
-
-public class DisconnectAndRedeliverTest extends TestCase
-{
- private static final Logger _logger = Logger.getLogger(DisconnectAndRedeliverTest.class);
-
- static
- {
- String workdir = System.getProperty("QPID_WORK");
- if (workdir == null || workdir.equals(""))
- {
- String tempdir = System.getProperty("java.io.tmpdir");
- System.out.println("QPID_WORK not set using tmp directory: " + tempdir);
- System.setProperty("QPID_WORK", tempdir);
- }
- DOMConfigurator.configure("../broker/etc/log4j.xml");
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- ApplicationRegistry.initialise(new TestApplicationRegistry(), 1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- /**
- * This tests that when there are unacknowledged messages on a channel they are requeued for delivery when
- * the channel is closed.
- *
- * @throws Exception
- */
- public void testDisconnectRedeliversMessages() throws Exception
- {
- Connection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "/test");
-
- TestableMemoryMessageStore store = (TestableMemoryMessageStore) ApplicationRegistry.getInstance().getMessageStore();
-
- Session consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- AMQQueue queue = new AMQQueue("someQ", "someQ", false, false);
- MessageConsumer consumer = consumerSession.createConsumer(queue);
- //force synch to ensure the consumer has resulted in a bound queue
- ((AMQSession) consumerSession).declareExchangeSynch("amq.direct", "direct");
-
- Connection con2 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "/test");
-
-
- Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- MessageProducer producer = producerSession.createProducer(queue);
-
- _logger.info("Sending four messages");
- producer.send(producerSession.createTextMessage("msg1"));
- producer.send(producerSession.createTextMessage("msg2"));
- producer.send(producerSession.createTextMessage("msg3"));
- producer.send(producerSession.createTextMessage("msg4"));
-
- con2.close();
-
- _logger.info("Starting connection");
- con.start();
- TextMessage tm = (TextMessage) consumer.receive();
- tm.acknowledge();
- _logger.info("Received and acknowledged first message");
- consumer.receive();
- consumer.receive();
- consumer.receive();
- _logger.info("Received all four messages. About to disconnect and reconnect");
-
- con.close();
- con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "/test");
- consumerSession = con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- consumer = consumerSession.createConsumer(queue);
-
- _logger.info("Starting second consumer connection");
- con.start();
-
- tm = (TextMessage) consumer.receive(3000);
- assertEquals("msg2", tm.getText());
-
-
- tm = (TextMessage) consumer.receive(3000);
- assertEquals("msg3", tm.getText());
-
-
- tm = (TextMessage) consumer.receive(3000);
- assertEquals("msg4", tm.getText());
-
- _logger.info("Received redelivery of three messages. Acknowledging last message");
- tm.acknowledge();
-
- con.close();
-
- con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "/test");
- consumerSession = con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- consumer = consumerSession.createConsumer(queue);
- _logger.info("Starting third consumer connection");
- con.start();
- tm = (TextMessage) consumer.receiveNoWait();
- assertNull(tm);
- _logger.info("No messages redelivered as is expected");
- con.close();
-
- con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "/test");
- consumerSession = con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- consumer = consumerSession.createConsumer(queue);
- _logger.info("Starting fourth consumer connection");
- con.start();
- tm = (TextMessage) consumer.receive(3000);
- assertNull(tm);
- _logger.info("No messages redelivered as is expected");
- con.close();
-
- _logger.info("Actually:" + store.getMessageMetaDataMap().size());
- // assertTrue(store.getMessageMap().size() == 0);
- }
-
- /**
- * Tests that unacknowledged messages are thrown away when the channel is closed and they cannot be
- * requeued (due perhaps to the queue being deleted).
- *
- * @throws Exception
- */
- public void testDisconnectWithTransientQueueThrowsAwayMessages() throws Exception
- {
-
- Connection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "/test");
- TestableMemoryMessageStore store = (TestableMemoryMessageStore) ApplicationRegistry.getInstance().getMessageStore();
- Session consumerSession = con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- Queue queue = new AMQQueue("someQ", "someQ", false, true);
- MessageConsumer consumer = consumerSession.createConsumer(queue);
- //force synch to ensure the consumer has resulted in a bound queue
- ((AMQSession) consumerSession).declareExchangeSynch("amq.direct", "direct");
-
- Connection con2 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "/test");
- Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- MessageProducer producer = producerSession.createProducer(queue);
-
- _logger.info("Sending four messages");
- producer.send(producerSession.createTextMessage("msg1"));
- producer.send(producerSession.createTextMessage("msg2"));
- producer.send(producerSession.createTextMessage("msg3"));
- producer.send(producerSession.createTextMessage("msg4"));
-
- con2.close();
-
- _logger.info("Starting connection");
- con.start();
- TextMessage tm = (TextMessage) consumer.receive();
- tm.acknowledge();
- _logger.info("Received and acknowledged first message");
- consumer.receive();
- consumer.receive();
- consumer.receive();
- _logger.info("Received all four messages. About to disconnect and reconnect");
-
- con.close();
- con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "/test");
- consumerSession = con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- consumer = consumerSession.createConsumer(queue);
-
- _logger.info("Starting second consumer connection");
- con.start();
-
- tm = (TextMessage) consumer.receiveNoWait();
- assertNull(tm);
- _logger.info("No messages redelivered as is expected");
-
- _logger.info("Actually:" + store.getMessageMetaDataMap().size());
- assertTrue(store.getMessageMetaDataMap().size() == 0);
- con.close();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(DisconnectAndRedeliverTest.class);
- }
-}
diff --git a/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/BaseTask.java b/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/BaseTask.java
deleted file mode 100644
index be604b14cf..0000000000
--- a/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/BaseTask.java
+++ /dev/null
@@ -1,74 +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.
- *
- */
-package org.apache.qpid.tasks;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * BaseTask -- an abstract base task for blaze specific tasks.
- **/
-
-public abstract class BaseTask extends Task {
-
- private static Set EMPTY = new HashSet();
- {
- EMPTY.add(0);
- EMPTY.add("");
- }
-
- public static class Validator {
-
- private String name;
- private Object value;
-
- private Validator(String name, Object value) {
- this.name = name;
- this.value = value;
- }
-
- public Validator required() {
- if (value == null) {
- error("value is required");
- }
- return this;
- }
-
- public Validator nonempty() {
- if (EMPTY.contains(value)) {
- error("value is empty");
- }
- return this;
- }
-
- private void error(String msg) {
- throw new BuildException(name + ": " + msg);
- }
- }
-
- public Validator validate(String name, Object value) {
- return new Validator(name, value);
- }
-
-}
diff --git a/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Foreach.java b/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Foreach.java
deleted file mode 100644
index 91b8a25ce2..0000000000
--- a/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Foreach.java
+++ /dev/null
@@ -1,84 +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.
- *
- */
-package org.apache.qpid.tasks;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.TaskContainer;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Foreach -- an ant task that allows iteration.
- **/
-
-public class Foreach extends BaseTask implements TaskContainer {
-
- private String property;
- private String list;
- private String delim = "\\s+";
- private String stop;
- private List<Task> tasks = new ArrayList<Task>();
-
- public void setProperty(String p) {
- property = p;
- }
-
- public void setList(String l) {
- list = l;
- }
-
- public void setDelim(String d) {
- delim = d;
- }
-
- public void setStop(String s) {
- stop = s;
- }
-
- public void addTask(Task t) {
- tasks.add(t);
- }
-
- public void execute() {
- validate("property", property).required().nonempty();
- validate("list", property).required();
-
- if (list.length() == 0) {
- return;
- }
-
- String[] values = list.split(delim);
- for (int i = 0; i < values.length; i++) {
- String value = values[i];
- if (stop != null && stop.length() > 0 &&
- value.equals(stop)) {
- break;
- }
- getProject().setProperty(property, value);
- for (Task t : tasks) {
- t.perform();
- }
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Map.java b/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Map.java
deleted file mode 100644
index e456b9e6ab..0000000000
--- a/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Map.java
+++ /dev/null
@@ -1,94 +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.
- *
- */
-package org.apache.qpid.tasks;
-
-import org.apache.tools.ant.BuildException;
-
-import org.apache.tools.ant.util.ChainedMapper;
-import org.apache.tools.ant.util.FileNameMapper;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Map -- an ant task that allows arbitrary use of FileNameMappers
- **/
-
-public class Map extends BaseTask {
-
- private String property;
- private String value;
- private String split = "\\s+";
- private String join = " ";
- private boolean setonempty = true;
- private ChainedMapper mapper = new ChainedMapper();
-
- public void setProperty(String p) {
- property = p;
- }
-
- public void setValue(String v) {
- value = v;
- }
-
- public void setSplit(String s) {
- split = s;
- }
-
- public void setJoin(String j) {
- join = j;
- }
-
- public void setSetonempty(boolean b) {
- setonempty = b;
- }
-
- public void add(FileNameMapper m) {
- mapper.add(m);
- }
-
- public void execute() {
- validate("property", property).required().nonempty();
- validate("value", value).required();
-
- if (mapper.getMappers().size() == 0) {
- throw new BuildException("at least one mapper must is required");
- }
-
- String[] parts = value.split(split);
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < parts.length; i++) {
- if (parts[i].length() == 0) { continue; }
- String[] names = mapper.mapFileName(parts[i]);
- for (int j = 0; j < names.length; j++) {
- if (buf.length() > 0) {
- buf.append(join);
- }
- buf.append(names[j]);
- }
- }
-
- if (buf.length() > 0 || setonempty) {
- getProject().setNewProperty(property, buf.toString());
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Require.java b/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Require.java
deleted file mode 100644
index 84870c90e4..0000000000
--- a/M4-RCs/qpid/java/tasks/src/org/apache/qpid/tasks/Require.java
+++ /dev/null
@@ -1,80 +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.
- */
-package org.apache.qpid.tasks;
-
-import org.apache.tools.ant.taskdefs.Ant;
-
-import java.io.File;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * Require
- *
- * @author Rafael H. Schloming &lt;rhs@mit.edu&gt;
- **/
-
-public class Require extends BaseTask {
-
- private File file;
- private String target = "";
- private Ant ant = null;
- private String key = "";
-
- public void setFile(File f) {
- file = f;
- }
-
- public void setTarget(String t) {
- target = t;
- }
-
- public void setKey(String k) {
- key = k;
- }
-
- public void execute() {
- validate("file", file).required();
-
- String path = file.getAbsolutePath();
- String hash = Require.class.getName() + ":" +
- path + ":" + target + ":" + key;
-
- synchronized (System.class) {
- if (System.getProperty(hash) != null) {
- return;
- }
-
- Ant ant = (Ant) getProject().createTask("ant");
- ant.setInheritAll(false);
- ant.setOwningTarget(getOwningTarget());
- ant.setTaskName(getTaskName());
- ant.init();
- if (target.length() > 0) {
- ant.setTarget(target);
- }
- ant.setAntfile(path);
- ant.setDir(file.getParentFile());
- ant.execute();
-
- System.setProperty(hash, "done");
- }
- }
-
-}
diff --git a/M4-RCs/qpid/java/test-provider.properties b/M4-RCs/qpid/java/test-provider.properties
deleted file mode 100644
index 7c9622630c..0000000000
--- a/M4-RCs/qpid/java/test-provider.properties
+++ /dev/null
@@ -1,38 +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.
-#
-#
-
-connectionfactory.default = amqp://username:password@clientid/test?brokerlist='tcp://localhost:5672'
-connectionfactory.default.vm = amqp://username:password@clientid/test?brokerlist='vm://:1'
-
-connectionfactory.failover = amqp://username:password@clientid/test?brokerlist='tcp://localhost:5673;tcp://localhost:5672'
-connectionfactory.failover.vm = amqp://username:password@clientid/test?brokerlist='vm://:2;vm://:1'
-connectionfactory.connection1 = amqp://username:password@clientid/test?brokerlist='tcp://localhost:5672'
-connectionfactory.connection2 = amqp://username:password@clientid/test?brokerlist='tcp://localhost:5673'
-connectionfactory.connection1.vm = amqp://username:password@clientid/test?brokerlist='vm://:1'
-connectionfactory.connection2.vm = amqp://username:password@clientid/test?brokerlist='vm://:2'
-
-
-queue.MyQueue = example.MyQueue
-queue.queue = example.queue
-queue.xaQueue = xaQueue
-
-topic.xaTopic = xaTopic
-topic.durableSubscriberTopic = durableSubscriberTopic
diff --git a/M4-RCs/qpid/java/testkit/README b/M4-RCs/qpid/java/testkit/README
deleted file mode 100644
index fdde734027..0000000000
--- a/M4-RCs/qpid/java/testkit/README
+++ /dev/null
@@ -1,153 +0,0 @@
-Introduction
-============
-
-The Test kit for the java client consists of 2 components.
-
-1) A Simple Perf Test that can be used to,
- a) Run a predefined perf report consisting of 8 use cases (see below)
- b) Run a producer and a consumer with a number of different options
-
-2) Soak tests that can be run for longer durations (hours or days).
-
-I am planning to add some stress tests to this module as well.
-Please note this is not a replacement for the existing perf/systests etc.
-But rather a small test kit thats focused on providing a packaged set of tests that can be quickly deployed on an environment to do quick smoke testing or easily setup a soak test.
-
-Table of Contents
-=================
-1. Perf Kit
-2. Soak Kit
-3. Perf Test use cases
-4. Soak Test use cases
-5. Running the sample perf test report
-6. Running the sample soak test report
-
-1.0 Perf Kit
-------------
-1.1 The perf kit can be packaged as an RPM or a tar file and deploy on a target environment and run the perf report.
-Or else a perf report can be automated to run every day or so an record numbers to catch perf regressions.
-
-1.2 It calculates the following results in msg/sec.
-
- System throuhgput : no_of_msgs / (time_last_msg_rcvd - time_first_msg_send)
-
- Producer rate : no_of_msgs / (time_after_sending - time_before_sending)
-
- Producer rate : no_of_msgs / (time_last_msg_rcvd - time_first_msg_rcvd)
-
- Latency : time_msg_rcvd - time_msg_sent
-
-The test will print min, max and avg latency.
-
-1.3 The test assume that both producer and consumer are run on the same machine or different machines that are time synced.
-
-1.4 You can also use run_sub.sh and run_pub.sh to run different use cases with several options.
- Please look at TestParams.java for all the configurable options.
-
-1.5 You can also use the test kit to benchmark against any vendor.
-
-
-2.0 Soak tests
---------------
-2.0 This includes a set of soak tests that can be run for a longer duration.
-
-2.1 A typical test will send x-1 messages and the xth message will contain an "End" marker.
- The producer will print the timestamp as soon as it sends the xth message.
- The consumer will reply with an empty message to the replyTo destination given in the xth message.
- The consumer prints the throuhgput for the iteration and the latency for the xth message.
- A typical value for x is 100k
-
-2.2 The feedback loop prevents the producer from overrunning the consumer.
- And the printout for every xth message will let you know how many iterations been completed at any given time.
- (Ex a simple cat log | wc -l will give you the how many iterations have been completed so far).
-
-2.2 The following results can be calculated for these tests.
-
- Memory, CPU for each producer/consumer - look at testkit/bin/run_soak_client.sh for an example
-
- You can find the Avg, Min & Max for throughput, latency, CPU and memory for the entire test run.
- (look at testkit/bin/soak_report.sh) for an example).
-
- You could also graph throughput, latency, CPU and memory using the comma separated log files.
-
-2.2 If you use different machines for producer and consumer the machines have to be time synced to have meaningful latency samples.
-
-3.0 Perf Test report use cases
--------------------------------
-3.1 Please check testkit/bin/perf_report.sh for more details
-
-3.2 A typical test run will send 1000 msgs during warmup and 200k msgs for result calculation.
-
-Test 1 Trans Queue
-
-Test 2 Dura Queue
-
-Test 3 Dura Queue Sync
-
-Test 4 Topic
-
-Test 5 Durable Topic
-
-Test 6 Fanout
-
-Test 7 Small TX (about 2 msgs per tx)
-
-Test 8 Large TX (about 1000 msgs per tx)
-
-
-4.0 Soak tests use cases
--------------------------
-4.1 Following are the current tests available in the test kit.
-
-4.2 Please refer to the source to see the javadoc and options
-
-
-1. SimpleProducer/Consumer sends X messages at a time and will wait for confirmation from producer before proceeding with the next iteration. A no of options can be configured.
-
-2. MultiThreadedProducer/Consumer does the same thing as above but runs each session in a separate thread.
- It can also send messages transactionally. Again a no of options can be configured.
-
-3. ResourceLeakTest will setup consumer/producers sends x messages and then teard down everything and continue again.
-
-
-5.0 Running the sample perf test report
----------------------------------------
-The testkit/bin contains perf_report.sh.
-It runs the above 8 use cases against a broker and print the results in a tabular format.
-
-For example
-================================================================================================
-|Test |System throuput|Producer rate|Consumer Rate|Avg Latency|Min Latency|Max Latency|
-------------------------------------------------------------------------------------------------
-|Trans_Queue | xxxxx.xx| xxxxx.xx| xxxxx.xx| xx.xx| x| xx|
-
-
-5.1 running perf_report.sh
-
-5.1.1 set JAVA_HOME to point to Java 1.5 and above
-5.1.2 set QPID_TEST_HOME to point to the testkit dir
-5.1.3 set VENDOR_LIB to point to the Qpid (or other JMS providers) jar files.
-5.1.4 start a broker
-5.1.5 update the testkit/etc/jndi.properties to point to the correct broker
-5.1.6 execute perf_report.sh
-
-
-6.0 Running the sample soak test report
----------------------------------------
-The testkit/bin contains soak_report.sh
-It runs MultiThreadedProducer/Consumer for the duration specified and prints a report for the following stats.
-Avg, Min and Max for System Throughput, letency, CPU and memory.
-
-6.1 running soak_report.sh
-
-5.1.1 set JAVA_HOME to point to Java 1.5 and above
-5.1.2 set QPID_TEST_HOME to point to the testkit dir
-5.1.3 set JAR_PATH to point to the Qpid jars
-5.1.4 start a broker
-5.1.5 execute soak_report.sh with correct params.
- Ex sh soak_report.sh 1 36000 will run for 10 hours colllecting CPU, memory every second.
-
-5.1.6 Please note the total duration for the test is log_freq * log_iterations
- So if you want to run the test for 10 hours and collect 10 second samples then do the following
- sh soak_report.sh 10 3600
-
diff --git a/M4-RCs/qpid/java/testkit/bin/perf_report.sh b/M4-RCs/qpid/java/testkit/bin/perf_report.sh
deleted file mode 100644
index 9e574cad7a..0000000000
--- a/M4-RCs/qpid/java/testkit/bin/perf_report.sh
+++ /dev/null
@@ -1,100 +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.
-#
-
-# This will run the 8 use cases defined below and produce
-# a report in tabular format. Refer to the documentation
-# for more details.
-
-SUB_MEM=-Xmx1024M
-PUB_MEM=-Xmx1024M
-LOG_CONFIG=-Dlog4j.configuration="$QPID_TEST_HOME/etc/test.log4j"
-
-. setenv.sh
-
-waitfor() { until grep -a -l "$2" $1 >/dev/null 2>&1 ; do sleep 1 ; done ; }
-cleanup()
-{
- pids=`ps aux | grep java | grep Perf | awk '{print $2}'`
- if [ "$pids" != "" ]; then
- kill -3 $pids
- kill -9 $pids >/dev/null 2>&1
- fi
-}
-
-# $1 test name
-# $2 consumer options
-# $3 producer options
-run_testcase()
-{
- sh run_sub.sh $LOG_CONFIG $SUB_MEM $2 > sub.out &
- waitfor sub.out "Warming up"
- sh run_pub.sh $LOG_CONFIG $PUB_MEM $3 > pub.out &
- waitfor sub.out "Completed the test"
- waitfor pub.out "Consumer has completed the test"
- sleep 2 #give a grace period to shutdown
- print_result $1
-}
-
-print_result()
-{
- prod_rate=`cat pub.out | grep "Producer rate" | awk '{print $3}'`
- sys_rate=`cat sub.out | grep "System Throughput" | awk '{print $4}'`
- cons_rate=`cat sub.out | grep "Consumer rate" | awk '{print $4}'`
- avg_latency=`cat sub.out | grep "Avg Latency" | awk '{print $4}'`
- min_latency=`cat sub.out | grep "Min Latency" | awk '{print $4}'`
- max_latency=`cat sub.out | grep "Max Latency" | awk '{print $4}'`
-
- printf "|%-15s|%15.2f|%13.2f|%13.2f|%11.2f|%11d|%11d|\n" $1 $sys_rate $prod_rate $cons_rate $avg_latency $min_latency $max_latency
- echo "------------------------------------------------------------------------------------------------"
-}
-
-trap cleanup EXIT
-
-echo "Test report on " `date +%F`
-echo "================================================================================================"
-echo "|Test |System throuput|Producer rate|Consumer Rate|Avg Latency|Min Latency|Max Latency|"
-echo "------------------------------------------------------------------------------------------------"
-
-# Test 1 Trans Queue
-run_testcase "Trans_Queue" "" "-Dwarmup_count=1 -Dmsg_count=10"
-
-# Test 2 Dura Queue
-run_testcase "Dura_Queue" "-Ddurable=true" "-Ddurable=true -Dwarmup_count=1 -Dmsg_count=10"
-
-# Test 3 Dura Queue Sync
-run_testcase "Dura_Queue_Sync" "-Ddurable=true" "-Ddurable=true -Dwarmup_count=1 -Dmsg_count=10 -Dsync_persistence=true"
-
-# Test 4 Topic
-run_testcase "Topic" "-DtransDest=transientTopic" "-DtransDest=transientTopic -Dwarmup_count=1 -Dmsg_count=10"
-
-# Test 5 Durable Topic
-#run_testcase "Dura_Topic" "-Ddurable=true -DtransDest=durableTopic" "-Ddurable=true -DtransDest=durableTopic -Dwarmup_count=1 -Dmsg_count=10"
-
-# Test 6 Fanout
-run_testcase "Fanout" "-DtransDest=fanoutQueue" "-DtransDest=fanoutQueue -Dwarmup_count=1 -Dmsg_count=10"
-
-# Test 7 Small TX
-run_testcase "Small_Txs_2" "-Ddurable=true -Dtransacted=true -Dtrans_size=1" \
- "-Ddurable=true -Dwarmup_count=1 -Dmsg_count=10 -Dtransacted=true -Dtrans_size=1"
-
-# Test 8 Large TX
-run_testcase "Large_Txs_1000" "-Ddurable=true -Dtransacted=true -Dtrans_size=10" \
- "-Ddurable=true -Dwarmup_count=1 -Dmsg_count=10 -Dtransacted=true -Dtrans_size=10"
-
diff --git a/M4-RCs/qpid/java/testkit/bin/run_pub.sh b/M4-RCs/qpid/java/testkit/bin/run_pub.sh
deleted file mode 100644
index 0702a55de9..0000000000
--- a/M4-RCs/qpid/java/testkit/bin/run_pub.sh
+++ /dev/null
@@ -1,24 +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.
-#
-
-. $QPID_TEST_HOME/bin/setenv.sh
-
-echo "$@"
-$JAVA_HOME/bin/java -cp $CLASSPATH $@ org.apache.qpid.testkit.perf.PerfProducer
diff --git a/M4-RCs/qpid/java/testkit/bin/run_soak_client.sh b/M4-RCs/qpid/java/testkit/bin/run_soak_client.sh
deleted file mode 100644
index ea1721d988..0000000000
--- a/M4-RCs/qpid/java/testkit/bin/run_soak_client.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/bash
-#
-# 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 is a sample script for a soak test on
-# linux environment.
-# This will start n of Producers processors and record their CPU and memory stats.
-# Also the Producer out will be saved to a file as well.
-
-if [ "$JAR_PATH" = "" ] ; then
- echo "ERROR: Please set JAR_PATH to point to the Qpid libraries ...."
- exit 1
-fi
-
-#1 PID, $2 freq, $3 count
-calc_stats(){
-
-for (( i = 0 ; i <= $3; i++ ))
- do
- cpu=`ps auxw | grep $1 | grep -v 'grep' | awk '{print $3}'`
- mem=`pmap $1 | grep total | grep -v 'grep' | awk '{print substr($2,0,length($2)-1)}'`
- echo $i","$mem","$cpu
- sleep $2
- cpu="0.0"
- mem="0"
- done
- kill -9 $1
-}
-
-# Num of producer processors to start
-num=$1
-# Log frequency in seconds
-log_freq=$2
-# Num of iterations
-log_iter=$3
-
-class_name=$4
-log_file_name=`echo $class_name | cut -d. -f6`
-
-# The total time for the test is determined by the
-# log_freq * log_iter.
-
-shift 4
-CLASSPATH=`find $JAR_PATH -name '*.jar' | tr '\n' ":"`
-
-JVM_ARGS="-Xmx1500M $@"
-echo "Starting $log_file_name with the following params $JVM_ARGS"
-
-for (( c = 1 ; c <= $num; c++ ))
-do
- $JAVA_HOME/bin/java $JVM_ARGS -cp $CLASSPATH $class_name > ${log_file_name}_${c}.log &
- pid=`jobs -l %% | awk '{print $2}'`
- calc_stats $pid $log_freq $log_iter > ${log_file_name}_process_${c}.log &
-done
diff --git a/M4-RCs/qpid/java/testkit/bin/run_sub.sh b/M4-RCs/qpid/java/testkit/bin/run_sub.sh
deleted file mode 100644
index f7e687de38..0000000000
--- a/M4-RCs/qpid/java/testkit/bin/run_sub.sh
+++ /dev/null
@@ -1,25 +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.
-#
-
-. $QPID_TEST_HOME/bin/setenv.sh
-
-echo "$@"
-$JAVA_HOME/bin/java -cp $CLASSPATH $@ org.apache.qpid.testkit.perf.PerfConsumer
-
diff --git a/M4-RCs/qpid/java/testkit/bin/setenv.sh b/M4-RCs/qpid/java/testkit/bin/setenv.sh
deleted file mode 100644
index 24135e711b..0000000000
--- a/M4-RCs/qpid/java/testkit/bin/setenv.sh
+++ /dev/null
@@ -1,49 +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.
-#
-
-# Compiles the test classes and sets the CLASSPATH
-
-# check for QPID_TEST_HOME
-if [ "$QPID_TEST_HOME" = "" ] ; then
- echo "ERROR: Please set QPID_TEST_HOME ...."
- exit 1
-fi
-
-# check for JAVA_HOME
-if [ "$JAVA_HOME" = "" ] ; then
- echo "ERROR: Please set JAVA_HOME ...."
- exit 1
-fi
-
-# VENDOR_LIB path needs to be set
-# for Qpid set this to {qpid_checkout}/java/build/lib
-if [ "$VENDOR_LIB" = "" ] ; then
- echo "ERROR: Please set VENDOR_LIB path in the script ...."
- exit 1
-fi
-
-
-[ -d $QPID_TEST_HOME/classes ] || mkdir $QPID_TEST_HOME/classes
-
-CLASSPATH=`find $VENDOR_LIB -name *.jar* | tr '\n' ":"`
-$JAVA_HOME/bin/javac -cp $CLASSPATH -d $QPID_TEST_HOME/classes -sourcepath $QPID_TEST_HOME/src `find $QPID_TEST_HOME/src -name '*.java'`
-
-export CLASSPATH=$QPID_TEST_HOME/classes:$CLASSPATH
-
diff --git a/M4-RCs/qpid/java/testkit/bin/soak_report.sh b/M4-RCs/qpid/java/testkit/bin/soak_report.sh
deleted file mode 100644
index 9da8bfa234..0000000000
--- a/M4-RCs/qpid/java/testkit/bin/soak_report.sh
+++ /dev/null
@@ -1,161 +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.
-#
-
-# Sample script to run a soak test with MultiThreadedProducer/Consumer.
-# You need to provide the log freq and no of iterations
-# Ex to run 10 hours and collect 1 second samples
-# soak_report.sh 1 36000
-
-# This script assumes that a suitable broker instance is started.
-
-log_freq=$1
-log_iter=$2
-shift 2
-JVM_ARGS=$@
-
-if [ "$QPID_TEST_HOME" = "" ] ; then
- echo "ERROR: Please set QPID_TEST_HOME ...."
- exit 1
-fi
-
-print_rates()
-{
- cat $1 | awk '{
- FS = ",";
- count = 0;
- total_latency = 0;
- min_latency = 9223372036854775807;
- max_latency = 0;
-
- total_tp = 0;
- min_tp = 50000;
- max_tp = 0;
-
- while ((getline) == 1)
- {
- total_latency = total_latency + $3
- total_tp = total_tp + $2
-
- if ($3 > 0)
- {
- min_latency = (($3 < min_latency) ? $3 : min_latency);
- max_latency = (($3 > max_latency) ? $3 : max_latency);
- }
- if ($2 > 0)
- {
- min_tp = (($2 < min_tp) ? $2 : min_tp);
- max_tp = (($2 > max_tp) ? $2 : max_tp);
- }
-
- count = count + 1
- }
-
- print "Avg Latency (ms) : " total_latency/count
- print "Max Latency (ms) : " max_latency
- print "Min Latency (ms) : " min_latency
-
- print ""
- print "Avg Throughput (msg/sec) : " total_tp/count
- print "Max Throughput (msg/sec) : " max_tp
- print "Min Throughput (msg/sec) : " min_tp
-
- print ""
- print "Total Iteratons " count
-
- }'
-}
-
-print_system_stats()
-{
- cat $1 | awk '{
- FS = ",";
- count = 0;
- total_memory = 0;
- min_memory = 9223372036854775807;
- max_memory = 0;
-
- total_cp = 0;
- min_cp = 50000;
- max_cp = 0;
-
- while ((getline) == 1)
- {
- total_memory = total_memory + $2
- total_cp = total_cp + $3
-
- if ($2 > 0)
- {
- min_memory = (($2 < min_memory) ? $2 : min_memory);
- max_memory = (($2 > max_memory) ? $2 : max_memory);
- }
- if ($3 > 0)
- {
- min_cp = (($3 < min_cp) ? $3 : min_cp);
- max_cp = (($3 > max_cp) ? $3 : max_cp);
- }
-
- count = count + 1
- }
-
- print "Avg Memory (MB) : " total_memory/(count*1024)
- print "Max Memory (MB) : " max_memory/1024
- print "Min Memory (MB) : " min_memory/1024
-
- print ""
- print "Avg CPU : " total_cp/count
- print "Max CPU : " max_cp
- print "Min CPU : " min_cp
-
- print ""
- print "Total Iteratons " count
-
- }'
-}
-
-
-cleanup()
-{
- kill -9 `ps aux | grep java | grep soak | awk '{ print $2 }'`
-}
-
-print_results()
-{
- printf "\n======================================================= \n"
- print_rates MultiThreadedConsumer_1.log
- printf "\nConsumer process stats "
- printf "\n----------------------- \n"
- print_system_stats MultiThreadedConsumer_process_1.log
- printf "\nProducer process stats "
- printf "\n----------------------- \n"
- print_system_stats MultiThreadedProducer_process_1.log
- printf "\n------------------------------------------------------- \n"
-}
-
-trap cleanup EXIT
-
-# runs a single instance of the MultiThreadedConsumer and MultiThreadedProducer
-sh $QPID_TEST_HOME/bin/run_soak_client.sh 1 $log_freq $log_iter org.apache.qpid.testkit.soak.MultiThreadedConsumer $JVM_ARGS
-sh $QPID_TEST_HOME/bin/run_soak_client.sh 1 $log_freq $log_iter org.apache.qpid.testkit.soak.MultiThreadedProducer $JVM_ARGS
-
-sleep_time=$((log_freq * log_iter))
-echo "sleep time : " $sleep_time
-sleep $((log_freq * log_iter))
-
-print_results
diff --git a/M4-RCs/qpid/java/testkit/build.xml b/M4-RCs/qpid/java/testkit/build.xml
deleted file mode 100644
index 94b97d270d..0000000000
--- a/M4-RCs/qpid/java/testkit/build.xml
+++ /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.
- -
- -->
-<project name="Test Kit" default="build">
-
- <property name="module.depends" value="client broker common"/>
-
- <import file="../module.xml"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/testkit/etc/jndi.properties b/M4-RCs/qpid/java/testkit/etc/jndi.properties
deleted file mode 100644
index f535975844..0000000000
--- a/M4-RCs/qpid/java/testkit/etc/jndi.properties
+++ /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.
-#
-java.naming.factory.initial = org.apache.qpid.jndi.PropertiesFileInitialContextFactory
-
-# use the following property to configure the default connector
-#java.naming.provider.url - ignored.
-
-# register some connection factories
-# connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.connectionFactory = amqp://guest:guest@clientid/testpath?brokerlist='tcp://localhost:5672'
-
-# Register an AMQP destination in JNDI
-destination.transientQueue = direct://amq.direct//testQueueT
-destination.durableQueue = direct://amq.direct//testQueueD?durable='true'
-
-destination.transientTopic = topic://amq.topic//testTopicT
-#destination.durableTopic = topic://amq.topic//testTopicD?durable='true'
-
-destination.fanoutQueue = fanout://amq.fanout//fanoutQueue \ No newline at end of file
diff --git a/M4-RCs/qpid/java/testkit/etc/test.log4j b/M4-RCs/qpid/java/testkit/etc/test.log4j
deleted file mode 100644
index b574a7b5b7..0000000000
--- a/M4-RCs/qpid/java/testkit/etc/test.log4j
+++ /dev/null
@@ -1,28 +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.
-#
-log4j.rootLogger=${root.logging.level}
-
-log4j.logger.org.apache.qpid=ERROR, console
-log4j.additivity.org.apache.qpid=false
-
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-log4j.appender.console.Threshold=all
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n
-
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/MessageFactory.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/MessageFactory.java
deleted file mode 100644
index 8b7b7fa434..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/MessageFactory.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.apache.qpid.testkit;
-/*
- *
- * 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 javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-public class MessageFactory
-{
- public static Message createBytesMessage(Session ssn, int size) throws JMSException
- {
- BytesMessage msg = ssn.createBytesMessage();
- msg.writeBytes(createMessagePayload(size).getBytes());
- return msg;
- }
-
- public static Message createTextMessage(Session ssn, int size) throws JMSException
- {
- TextMessage msg = ssn.createTextMessage();
- msg.setText(createMessagePayload(size));
- return msg;
- }
-
- public static String createMessagePayload(int size)
- {
- String msgData = "Qpid Test Message";
-
- StringBuffer buf = new StringBuffer(size);
- int count = 0;
- while (count <= (size - msgData.length()))
- {
- buf.append(msgData);
- count += msgData.length();
- }
- if (count < size)
- {
- buf.append(msgData, 0, size - count);
- }
-
- return buf.toString();
- }
-}
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/LatencyTest.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/LatencyTest.java
deleted file mode 100644
index 35a2374fbc..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/LatencyTest.java
+++ /dev/null
@@ -1,332 +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.
- *
- */
-package org.apache.qpid.testkit.perf;
-
-import java.io.FileOutputStream;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import javax.jms.BytesMessage;
-import javax.jms.DeliveryMode;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.TextMessage;
-
-import org.apache.qpid.testkit.MessageFactory;
-
-/**
- * Latency test sends an x number of messages in warmup mode and wait for a confirmation
- * from the consumer that it has successfully consumed them and ready to start the
- * test. It will start sending y number of messages and each message will contain a time
- * stamp. This will be used at the receiving end to measure the latency.
- *
- * It is important to have a sufficiently large number for the warmup count to
- * ensure the system is in steady state before the test is started.
- *
- * If you plan to plot the latencies then msg_count should be a smaller number (ex 500 or 1000)
- * You also need to specify a file name using -Dfile=/home/rajith/latency.log.1
- *
- * The idea is to get a latency sample for the system once it achieves steady state.
- *
- */
-
-public class LatencyTest extends PerfBase implements MessageListener
-{
- MessageProducer producer;
- MessageConsumer consumer;
- Message msg;
- byte[] payload;
- long maxLatency = 0;
- long minLatency = Long.MAX_VALUE;
- long totalLatency = 0; // to calculate avg latency.
- int rcvdMsgCount = 0;
- double stdDev = 0;
- double avgLatency = 0;
- boolean warmup_mode = true;
- boolean transacted = false;
- int transSize = 0;
-
- final List<Long> latencies;
- final Lock lock = new ReentrantLock();
- final Condition warmedUp;
- final Condition testCompleted;
-
- public LatencyTest()
- {
- super();
- warmedUp = lock.newCondition();
- testCompleted = lock.newCondition();
- // Storing the following two for efficiency
- transacted = params.isTransacted();
- transSize = params.getTransactionSize();
- latencies = new ArrayList <Long>(params.getMsgCount());
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- consumer = session.createConsumer(dest);
- consumer.setMessageListener(this);
-
- // if message caching is enabled we pre create the message
- // else we pre create the payload
- if (params.isCacheMessage())
- {
- msg = MessageFactory.createBytesMessage(session, params.getMsgSize());
- msg.setJMSDeliveryMode(params.isDurable()?
- DeliveryMode.PERSISTENT :
- DeliveryMode.NON_PERSISTENT
- );
- }
- else
- {
- payload = MessageFactory.createMessagePayload(params.getMsgSize()).getBytes();
- }
-
- producer = session.createProducer(dest);
- producer.setDisableMessageID(params.isDisableMessageID());
- producer.setDisableMessageTimestamp(params.isDisableTimestamp());
- }
-
- protected Message getNextMessage() throws Exception
- {
- if (params.isCacheMessage())
- {
- return msg;
- }
- else
- {
- msg = session.createBytesMessage();
- ((BytesMessage)msg).writeBytes(payload);
- return msg;
- }
- }
-
- public void warmup()throws Exception
- {
- System.out.println("Warming up......");
- int count = params.getWarmupCount();
- for (int i=0; i < count; i++)
- {
- producer.send(getNextMessage());
- }
- Message msg = session.createTextMessage("End");
- producer.send(msg);
-
- if (params.isTransacted())
- {
- session.commit();
- }
-
- try
- {
- lock.lock();
- warmedUp.await();
- }
- finally
- {
- lock.unlock();
- }
- }
-
- public void onMessage(Message msg)
- {
- try
- {
- if (msg instanceof TextMessage && ((TextMessage)msg).getText().equals("End"))
- {
- if (warmup_mode)
- {
- warmup_mode = false;
- try
- {
- lock.lock();
- warmedUp.signal();
- }
- finally
- {
- lock.unlock();
- }
- }
- else
- {
- computeStats();
- }
- }
- else if (!warmup_mode)
- {
- long time = System.currentTimeMillis();
- rcvdMsgCount ++;
-
- if (transacted && (rcvdMsgCount % transSize == 0))
- {
- session.commit();
- }
-
- long latency = time - msg.getJMSTimestamp();
- latencies.add(latency);
- totalLatency = totalLatency + latency;
- }
-
- }
- catch(Exception e)
- {
- handleError(e,"Error when receiving messages");
- }
-
- }
-
- private void computeStats()
- {
- avgLatency = (double)totalLatency/(double)rcvdMsgCount;
- double sigma = 0;
-
- for (long latency: latencies)
- {
- maxLatency = Math.max(maxLatency, latency);
- minLatency = Math.min(minLatency, latency);
- sigma = sigma + Math.pow(latency - avgLatency,2);
- }
-
- stdDev = Math.sqrt(sigma/(rcvdMsgCount -1));
-
- try
- {
- lock.lock();
- testCompleted.signal();
- }
- finally
- {
- lock.unlock();
- }
- }
-
- public void writeToFile() throws Exception
- {
- String fileName = System.getProperty("file");
- PrintWriter writer = new PrintWriter(new FileOutputStream(fileName));
- for (long latency: latencies)
- {
- writer.println(String.valueOf(latency));
- }
- writer.flush();
- writer.close();
- }
-
- public void printToConsole()
- {
- System.out.println(new StringBuilder("Total Msgs Received : ").append(rcvdMsgCount).toString());
- System.out.println(new StringBuilder("Standard Deviation : ").
- append(df.format(stdDev)).
- append(" ms").toString());
- System.out.println(new StringBuilder("Avg Latency : ").
- append(df.format(avgLatency)).
- append(" ms").toString());
- System.out.println(new StringBuilder("Min Latency : ").
- append(minLatency).
- append(" ms").toString());
- System.out.println(new StringBuilder("Max Latency : ").
- append(maxLatency).
- append(" ms").toString());
- System.out.println("Completed the test......\n");
- }
-
- public void startTest() throws Exception
- {
- System.out.println("Starting test......");
- int count = params.getMsgCount();
-
- for(int i=0; i < count; i++ )
- {
- Message msg = getNextMessage();
- msg.setJMSTimestamp(System.currentTimeMillis());
- producer.send(msg);
- if ( transacted && ((i+1) % transSize == 0))
- {
- session.commit();
- }
- }
- Message msg = session.createTextMessage("End");
- producer.send(msg);
- if (params.isTransacted())
- {
- session.commit();
- }
- }
-
- public void tearDown() throws Exception
- {
- try
- {
- lock.lock();
- testCompleted.await();
- }
- finally
- {
- lock.unlock();
- }
-
- producer.close();
- consumer.close();
- session.close();
- con.close();
- }
-
- public void test()
- {
- try
- {
- setUp();
- warmup();
- startTest();
- tearDown();
- }
- catch(Exception e)
- {
- handleError(e,"Error when running test");
- }
- }
-
-
- public static void main(String[] args)
- {
- LatencyTest latencyTest = new LatencyTest();
- latencyTest.test();
- latencyTest.printToConsole();
- if (System.getProperty("file") != null)
- {
- try
- {
- latencyTest.writeToFile();
- }
- catch(Exception e)
- {
- e.printStackTrace();
- }
- }
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfBase.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfBase.java
deleted file mode 100644
index 95670f0507..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfBase.java
+++ /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.
- *
- */
-package org.apache.qpid.testkit.perf;
-
-import java.text.DecimalFormat;
-import java.util.Hashtable;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-
-public class PerfBase
-{
- TestParams params;
- Connection con;
- Session session;
- Destination dest;
- Destination feedbackDest;
- DecimalFormat df = new DecimalFormat("###.##");
-
- public PerfBase()
- {
- params = new TestParams();
- }
-
- public void setUp() throws Exception
- {
- Hashtable<String,String> env = new Hashtable<String,String>();
- env.put(Context.INITIAL_CONTEXT_FACTORY, params.getInitialContextFactory());
- env.put(Context.PROVIDER_URL, params.getProviderURL());
-
- Context ctx = null;
- try
- {
- ctx = new InitialContext(env);
- }
- catch(Exception e)
- {
- throw new Exception("Error initializing JNDI",e);
-
- }
-
- ConnectionFactory conFac = null;
- try
- {
- conFac = (ConnectionFactory)ctx.lookup(params.getConnectionFactory());
- }
- catch(Exception e)
- {
- throw new Exception("Error looking up connection factory",e);
- }
-
- con = conFac.createConnection();
- con.start();
- session = con.createSession(params.isTransacted(),
- params.isTransacted()? Session.SESSION_TRANSACTED:params.getAckMode());
-
- try
- {
- dest = (Destination)ctx.lookup( params.isDurable()?
- params.getDurableDestination():
- params.getTransientDestination()
- );
- }
- catch(Exception e)
- {
- throw new Exception("Error looking up destination",e);
- }
- }
-
- public void handleError(Exception e,String msg)
- {
- StringBuilder sb = new StringBuilder();
- sb.append(msg);
- sb.append(" ");
- sb.append(e.getMessage());
- System.err.println(sb.toString());
- e.printStackTrace();
- }
-}
-
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfConsumer.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfConsumer.java
deleted file mode 100644
index cd12c7010d..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfConsumer.java
+++ /dev/null
@@ -1,248 +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.
- *
- */
-package org.apache.qpid.testkit.perf;
-
-import javax.jms.Destination;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.TextMessage;
-
-/**
- * PerfConsumer will receive x no of messages in warmup mode.
- * Once it receives the Start message it will then signal the PerfProducer.
- * It will start recording stats from the first message it receives after
- * the warmup mode is done.
- *
- * The following calculations are done.
- * The important numbers to look at is
- * a) Avg Latency
- * b) System throughput.
- *
- * Latency.
- * =========
- * Currently this test is written with the assumption that either
- * a) The Perf Producer and Consumer are on the same machine
- * b) They are on separate machines that have their time synced via a Time Server
- *
- * In order to calculate latency the producer inserts a timestamp
- * hen the message is sent. The consumer will note the current time the message is
- * received and will calculate the latency as follows
- * latency = rcvdTime - msg.getJMSTimestamp()
- *
- * Through out the test it will keep track of the max and min latency to show the
- * variance in latencies.
- *
- * Avg latency is measured by adding all latencies and dividing by the total msgs.
- * You can also compute this by (rcvdTime - testStartTime)/rcvdMsgCount
- *
- * Throughput
- * ===========
- * System throughput is calculated as follows
- * rcvdMsgCount/(rcvdTime - testStartTime)
- *
- * Consumer rate is calculated as
- * rcvdMsgCount/(rcvdTime - startTime)
- *
- * Note that the testStartTime referes to when the producer sent the first message
- * and startTime is when the consumer first received a message.
- *
- * rcvdTime keeps track of when the last message is received.
- *
- * All throughput rates are given as msg/sec so the rates are multiplied by 1000.
- *
- */
-
-public class PerfConsumer extends PerfBase implements MessageListener
-{
- MessageConsumer consumer;
- long maxLatency = 0;
- long minLatency = Long.MAX_VALUE;
- long totalLatency = 0; // to calculate avg latency.
- int rcvdMsgCount = 0;
- long testStartTime = 0; // to measure system throughput
- long startTime = 0; // to measure consumer throughput
- long rcvdTime = 0;
- boolean transacted = false;
- int transSize = 0;
-
- final Object lock = new Object();
-
- public PerfConsumer()
- {
- super();
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- consumer = session.createConsumer(dest);
-
- // Storing the following two for efficiency
- transacted = params.isTransacted();
- transSize = params.getTransactionSize();
- }
-
- public void warmup()throws Exception
- {
- System.out.println("Warming up......");
-
- boolean start = false;
- while (!start)
- {
- Message msg = consumer.receive();
- if (msg instanceof TextMessage)
- {
- if (((TextMessage)msg).getText().equals("End"))
- {
- start = true;
- MessageProducer temp = session.createProducer(msg.getJMSReplyTo());
- temp.send(session.createMessage());
- if (params.isTransacted())
- {
- session.commit();
- }
- temp.close();
- }
- }
- }
- }
-
- public void startTest() throws Exception
- {
- System.out.println("Starting test......");
- consumer.setMessageListener(this);
- }
-
- public void printResults() throws Exception
- {
- synchronized (lock)
- {
- lock.wait();
- }
-
- double avgLatency = (double)totalLatency/(double)rcvdMsgCount;
- double throughput = ((double)rcvdMsgCount/(double)(rcvdTime - testStartTime))*1000;
- double consRate = ((double)rcvdMsgCount/(double)(rcvdTime - startTime))*1000;
- System.out.println(new StringBuilder("Total Msgs Received : ").append(rcvdMsgCount).toString());
- System.out.println(new StringBuilder("Consumer rate : ").
- append(df.format(consRate)).
- append(" msg/sec").toString());
- System.out.println(new StringBuilder("System Throughput : ").
- append(df.format(throughput)).
- append(" msg/sec").toString());
- System.out.println(new StringBuilder("Avg Latency : ").
- append(df.format(avgLatency)).
- append(" ms").toString());
- System.out.println(new StringBuilder("Min Latency : ").
- append(minLatency).
- append(" ms").toString());
- System.out.println(new StringBuilder("Max Latency : ").
- append(maxLatency).
- append(" ms").toString());
- System.out.println("Completed the test......\n");
- }
-
- public void notifyCompletion(Destination replyTo) throws Exception
- {
- MessageProducer tmp = session.createProducer(replyTo);
- Message endMsg = session.createMessage();
- tmp.send(endMsg);
- if (params.isTransacted())
- {
- session.commit();
- }
- tmp.close();
- }
-
- public void tearDown() throws Exception
- {
- consumer.close();
- session.close();
- con.close();
- }
-
- public void onMessage(Message msg)
- {
- try
- {
- if (msg instanceof TextMessage && ((TextMessage)msg).getText().equals("End"))
- {
- notifyCompletion(msg.getJMSReplyTo());
-
- synchronized (lock)
- {
- lock.notifyAll();
- }
- }
- else
- {
- rcvdTime = System.currentTimeMillis();
- rcvdMsgCount ++;
-
- if (rcvdMsgCount == 1)
- {
- startTime = rcvdTime;
- testStartTime = msg.getJMSTimestamp();
- }
-
- if (transacted && (rcvdMsgCount % transSize == 0))
- {
- session.commit();
- }
-
- long latency = rcvdTime - msg.getJMSTimestamp();
- maxLatency = Math.max(maxLatency, latency);
- minLatency = Math.min(minLatency, latency);
- totalLatency = totalLatency + latency;
- }
-
- }
- catch(Exception e)
- {
- handleError(e,"Error when receiving messages");
- }
-
- }
-
- public void test()
- {
- try
- {
- setUp();
- warmup();
- startTest();
- printResults();
- tearDown();
- }
- catch(Exception e)
- {
- handleError(e,"Error when running test");
- }
- }
-
- public static void main(String[] args)
- {
- PerfConsumer cons = new PerfConsumer();
- cons.test();
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfProducer.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfProducer.java
deleted file mode 100644
index 757b1bfcda..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/PerfProducer.java
+++ /dev/null
@@ -1,207 +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.
- *
- */
-package org.apache.qpid.testkit.perf;
-
-import javax.jms.BytesMessage;
-import javax.jms.DeliveryMode;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-
-import org.apache.qpid.testkit.MessageFactory;
-
-/**
- * PerfProducer sends an x no of messages in warmup mode and wait for a confirmation
- * from the consumer that it has successfully consumed them and ready to start the
- * test. It will start sending y no of messages and each message will contain a time
- * stamp. This will be used at the receiving end to measure the latency.
- *
- * This is done with the assumption that both consumer and producer are running on
- * the same machine or different machines which have time synced using a time server.
- *
- * This test also calculates the producer rate as follows.
- * rate = msg_count/(time_before_sending_msgs - time_after_sending_msgs)
- *
- * All throughput rates are given as msg/sec so the rates are multiplied by 1000.
- *
- * Rajith - Producer rate is not an accurate perf metric IMO.
- * It is heavily inlfuenced by any in memory buffering.
- * System throughput and latencies calculated by the PerfConsumer are more realistic
- * numbers.
- *
- */
-public class PerfProducer extends PerfBase
-{
- MessageProducer producer;
- Message msg;
- byte[] payload;
-
- public PerfProducer()
- {
- super();
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- feedbackDest = session.createTemporaryQueue();
-
- // if message caching is enabled we pre create the message
- // else we pre create the payload
- if (params.isCacheMessage())
- {
- msg = MessageFactory.createBytesMessage(session, params.getMsgSize());
- msg.setJMSDeliveryMode(params.isDurable()?
- DeliveryMode.PERSISTENT :
- DeliveryMode.NON_PERSISTENT
- );
- }
- else
- {
- payload = MessageFactory.createMessagePayload(params.getMsgSize()).getBytes();
- }
-
- producer = session.createProducer(dest);
- producer.setDisableMessageID(params.isDisableMessageID());
- producer.setDisableMessageTimestamp(params.isDisableTimestamp());
- }
-
- protected Message getNextMessage() throws Exception
- {
- if (params.isCacheMessage())
- {
- return msg;
- }
- else
- {
- msg = session.createBytesMessage();
- ((BytesMessage)msg).writeBytes(payload);
- return msg;
- }
- }
-
- public void warmup()throws Exception
- {
- System.out.println("Warming up......");
- MessageConsumer tmp = session.createConsumer(feedbackDest);
-
- for (int i=0; i < params.getWarmupCount() -1; i++)
- {
- producer.send(getNextMessage());
- }
- Message msg = session.createTextMessage("End");
- msg.setJMSReplyTo(feedbackDest);
- producer.send(msg);
-
- if (params.isTransacted())
- {
- session.commit();
- }
-
- tmp.receive();
-
- if (params.isTransacted())
- {
- session.commit();
- }
-
- tmp.close();
- }
-
- public void startTest() throws Exception
- {
- System.out.println("Starting test......");
- int count = params.getMsgCount();
- boolean transacted = params.isTransacted();
- int tranSize = params.getTransactionSize();
-
- long start = System.currentTimeMillis();
- for(int i=0; i < count; i++ )
- {
- Message msg = getNextMessage();
- msg.setJMSTimestamp(System.currentTimeMillis());
- producer.send(msg);
- if ( transacted && ((i+1) % tranSize == 0))
- {
- session.commit();
- }
- }
- long time = System.currentTimeMillis() - start;
- double rate = ((double)count/(double)time)*1000;
- System.out.println(new StringBuilder("Producer rate: ").
- append(df.format(rate)).
- append(" msg/sec").
- toString());
- }
-
- public void waitForCompletion() throws Exception
- {
- MessageConsumer tmp = session.createConsumer(feedbackDest);
- Message msg = session.createTextMessage("End");
- msg.setJMSReplyTo(feedbackDest);
- producer.send(msg);
-
- if (params.isTransacted())
- {
- session.commit();
- }
-
- tmp.receive();
-
- if (params.isTransacted())
- {
- session.commit();
- }
-
- tmp.close();
- System.out.println("Consumer has completed the test......");
- }
-
- public void tearDown() throws Exception
- {
- producer.close();
- session.close();
- con.close();
- }
-
- public void test()
- {
- try
- {
- setUp();
- warmup();
- startTest();
- waitForCompletion();
- tearDown();
- }
- catch(Exception e)
- {
- handleError(e,"Error when running test");
- }
- }
-
-
- public static void main(String[] args)
- {
- PerfProducer prod = new PerfProducer();
- prod.test();
- }
-} \ No newline at end of file
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/TestParams.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/TestParams.java
deleted file mode 100644
index 15142cfced..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/perf/TestParams.java
+++ /dev/null
@@ -1,160 +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.
- *
- */
-package org.apache.qpid.testkit.perf;
-
-import javax.jms.Session;
-
-public class TestParams
-{
- private String initialContextFactory = "org.apache.qpid.jndi.PropertiesFileInitialContextFactory";
-
- private String providerURL = System.getenv("QPID_TEST_HOME") + "/etc/jndi.properties";
-
- private String connectionFactory = "connectionFactory";
-
- private String transientDest = "transientQueue";
-
- private String durableDest = "durableQueue";
-
- private int msg_size = 512;
-
- private int msg_type = 1; // not used yet
-
- private boolean cacheMessage = true;
-
- private boolean disableMessageID = false;
-
- private boolean disableTimestamp = false;
-
- private boolean durable = false;
-
- private boolean transacted = false;
-
- private int transaction_size = 1000;
-
- private int ack_mode = Session.AUTO_ACKNOWLEDGE;
-
- private int msg_count = 10;
-
- private int warmup_count = 1;
-
- public TestParams()
- {
- initialContextFactory = System.getProperty("java.naming.factory.initial",initialContextFactory);
- providerURL = System.getProperty("java.naming.provider.url",providerURL);
-
- transientDest = System.getProperty("transDest",transientDest);
- durableDest = System.getProperty("durableDest",durableDest);
-
- msg_size = Integer.getInteger("msg_size", 512);
- msg_type = Integer.getInteger("msg_type",1);
- cacheMessage = Boolean.getBoolean("cache_msg");
- disableMessageID = Boolean.getBoolean("disableMessageID");
- disableTimestamp = Boolean.getBoolean("disableTimestamp");
- durable = Boolean.getBoolean("durable");
- transacted = Boolean.getBoolean("transacted");
- transaction_size = Integer.getInteger("trans_size",1000);
- ack_mode = Integer.getInteger("ack_mode",Session.AUTO_ACKNOWLEDGE);
- msg_count = Integer.getInteger("msg_count",msg_count);
- warmup_count = Integer.getInteger("warmup_count",warmup_count);
- }
-
- public int getAckMode()
- {
- return ack_mode;
- }
-
- public String getConnectionFactory()
- {
- return connectionFactory;
- }
-
- public String getTransientDestination()
- {
- return transientDest;
- }
-
- public String getDurableDestination()
- {
- return durableDest;
- }
-
- public String getInitialContextFactory()
- {
- return initialContextFactory;
- }
-
- public int getMsgCount()
- {
- return msg_count;
- }
-
- public int getMsgSize()
- {
- return msg_size;
- }
-
- public int getMsgType()
- {
- return msg_type;
- }
-
- public boolean isDurable()
- {
- return durable;
- }
-
- public String getProviderURL()
- {
- return providerURL;
- }
-
- public boolean isTransacted()
- {
- return transacted;
- }
-
- public int getTransactionSize()
- {
- return transaction_size;
- }
-
- public int getWarmupCount()
- {
- return warmup_count;
- }
-
- public boolean isCacheMessage()
- {
- return cacheMessage;
- }
-
- public boolean isDisableMessageID()
- {
- return disableMessageID;
- }
-
- public boolean isDisableTimestamp()
- {
- return disableTimestamp;
- }
-
-}
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/BaseTest.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/BaseTest.java
deleted file mode 100644
index 0c3a17b3d8..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/BaseTest.java
+++ /dev/null
@@ -1,152 +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.
- *
- */
-package org.apache.qpid.testkit.soak;
-
-
-import java.text.DateFormat;
-import java.text.DecimalFormat;
-import java.text.NumberFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.jms.DeliveryMode;
-import javax.jms.Destination;
-import javax.jms.Message;
-import javax.jms.Session;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.testkit.MessageFactory;
-
-public class BaseTest
-{
- protected String host = "127.0.0.1";
- protected int msg_size = 100;
- protected int msg_count = 10;
- protected int session_count = 1;
- protected boolean durable = false;
- protected String queue_name = "message_queue";
- protected String exchange_name = "amq.direct";
- protected String routing_key = "routing_key";
- protected String contentType = "application/octet-stream";
- protected int port = 5672;
- protected String url;
- protected Message[] msgArray;
-
- protected AMQConnection con;
- protected Destination dest = null;
- protected DateFormat df = new SimpleDateFormat("yyyy.MM.dd 'at' HH:mm:ss");
- protected NumberFormat nf = new DecimalFormat("##.00");
-
- public BaseTest()
- {
- host = System.getProperty("host", "127.0.0.1");
- port = Integer.getInteger("port", 5672);
- msg_size = Integer.getInteger("msg_size", 100);
- msg_count = Integer.getInteger("msg_count", 10);
- session_count = Integer.getInteger("session_count", 1);
- durable = Boolean.getBoolean("durable");
- queue_name = System.getProperty("queue_name", "message_queue");
- exchange_name = System.getProperty("exchange_name", "amq.direct");
- routing_key = System.getProperty("routing_key", "routing_key");
- contentType = System.getProperty("content_type","application/octet-stream");
-
-
-
- url = "amqp://username:password@topicClientid/test?brokerlist='tcp://" + host + ":" + port + "'";
- }
-
- public void setUp()
- {
- try
- {
- con = new AMQConnection(url);
- con.start();
-
-
- if (exchange_name.equals("amq.topic"))
- {
- dest = new AMQTopic(new AMQShortString(exchange_name),
- new AMQShortString(routing_key),
- false, //auto-delete
- null, //queue name
- durable);
- }
- else
- {
- dest = new AMQQueue(new AMQShortString(exchange_name),
- new AMQShortString(routing_key),
- new AMQShortString(queue_name),
- false, //exclusive
- false, //auto-delete
- durable);
- }
-
- // Create the session to setup the messages
- Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- if (msg_size == -1)
- {
- // This creates an array of 1000 messages from 500-1500 bytes
- // During the tests a message will be picked randomly
- msgArray = new Message[1000];
- for (int i = 0; i < 1000; i++)
- {
- Message msg = (contentType.equals("text/plain")) ?
- MessageFactory.createTextMessage(session,500 + i) :
- MessageFactory.createBytesMessage(session, 500 + i);
- msg.setJMSDeliveryMode((durable) ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
- msgArray[i] = msg;
- }
- }
- else
- {
- Message msg = (contentType.equals("text/plain")) ?
- MessageFactory.createTextMessage(session, msg_size):
- MessageFactory.createBytesMessage(session, msg_size);
- msg.setJMSDeliveryMode((durable) ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
- msgArray = new Message[]
- { msg };
- }
-
- session.close();
-
- }
- catch (Exception e)
- {
- handleError(e,"Error while setting up the test");
- }
- }
-
- public void handleError(Exception e,String msg)
- {
- StringBuilder sb = new StringBuilder();
- sb.append(msg);
- sb.append(" @ ");
- sb.append(df.format(new Date(System.currentTimeMillis())));
- sb.append(" ");
- sb.append(e.getMessage());
- System.err.println(sb.toString());
- e.printStackTrace();
- }
-}
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/MultiThreadedConsumer.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/MultiThreadedConsumer.java
deleted file mode 100644
index a91d9e7e85..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/MultiThreadedConsumer.java
+++ /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.
- *
- */
-package org.apache.qpid.testkit.soak;
-
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-/**
- * Test Description
- * ================
- * The difference between this test and the
- * LongDurationConsumer is that each Session runs
- * in it's own Thread and the ability to receive
- * messages transactionally.
- *
- * All consumers will still share the same destination.
- *
- */
-public class MultiThreadedConsumer extends BaseTest
-{
- protected final boolean transacted;
-
- public MultiThreadedConsumer()
- {
- super();
- transacted = Boolean.getBoolean("transacted");
- // needed only to calculate throughput.
- // If msg_count is different set it via -Dmsg_count
- msg_count = 10;
- }
-
- /**
- * Creates a Session and a consumer that runs in its
- * own thread.
- * It can also consume transactionally.
- *
- */
- public void test()
- {
- try
- {
- for (int i = 0; i < session_count; i++)
- {
-
- final Session session = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- Thread t = new Thread(new Runnable()
- {
- public void run()
- {
- try
- {
- MessageConsumer consumer = session.createConsumer(dest);
-
- consumer.setMessageListener(new MessageListener()
- {
-
- private boolean startIteration = true;
- private long startTime = 0;
- private long iterations = 0;
-
- public void onMessage(Message m)
- {
- try
- {
- long now = System.currentTimeMillis();
- if (startIteration)
- {
- startTime = m.getJMSTimestamp();
- startIteration = false;
- }
-
- if (m instanceof TextMessage && ((TextMessage) m).getText().equals("End"))
- {
- startIteration = true;
- long totalIterationTime = now - startTime;
- double throughput = ((double)msg_count/(double)totalIterationTime) * 1000;
- long latencySample = now - m.getJMSTimestamp();
- iterations++;
-
- StringBuilder sb = new StringBuilder();
- sb.append(iterations).append(",").
- append(nf.format(throughput)).append(",").append(latencySample);
-
- System.out.println(sb.toString());
-
- MessageProducer temp = session.createProducer(m.getJMSReplyTo());
- Message controlMsg = session.createTextMessage();
- temp.send(controlMsg);
- if (transacted)
- {
- session.commit();
- }
- temp.close();
- }
- }
- catch (JMSException e)
- {
- handleError(e,"Exception receiving messages");
- }
- }
- });
- }
- catch (Exception e)
- {
- handleError(e,"Exception creating a consumer");
- }
-
- }
-
- });
- t.setName("session-" + i);
- t.start();
- } // for loop
- }
- catch (Exception e)
- {
- handleError(e,"Exception while setting up the test");
- }
-
- }
-
- public static void main(String[] args)
- {
- MultiThreadedConsumer test = new MultiThreadedConsumer();
- test.setUp();
- test.test();
- }
-
-}
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/MultiThreadedProducer.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/MultiThreadedProducer.java
deleted file mode 100644
index 279e5ea0bf..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/MultiThreadedProducer.java
+++ /dev/null
@@ -1,166 +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.
- *
- */
-package org.apache.qpid.testkit.soak;
-
-
-import java.util.Random;
-import java.util.UUID;
-
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.framing.AMQShortString;
-
-/**
- * Test Description
- * ================
- *
- * This test creats x number of sessions, where each session
- * runs in it's own thread. Each session creates a producer
- * and it's own feedback queue.
- *
- * A producer will send n-1 messages, followed by the n-th
- * message which contains "End" in it's payload to signal
- * that this is the last message message in the sequence.
- * The end message has the feedback queue as it's replyTo.
- * It will then listen on the feedback queue waiting for the
- * confirmation and then sleeps for 1000 ms before proceeding
- * with the next n messages.
- *
- * This hand shaking mechanism ensures that all of the
- * messages sent are consumed by some consumer. This prevents
- * the producers from saturating the broker especially when
- * the consumers are slow.
- *
- * All producers send to a single destination
- * If using transactions it's best to use smaller message count
- * as the test only commits after sending all messages in a batch.
- *
- */
-
-public class MultiThreadedProducer extends SimpleProducer
-{
- protected final boolean transacted;
-
- public MultiThreadedProducer()
- {
- super();
- transacted = Boolean.getBoolean("transacted");
- }
-
- public void test()
- {
- try
- {
- final int msg_count_per_session = msg_count/session_count;
-
- for (int i = 0; i < session_count; i++)
- {
- final Session session = con.createSession(transacted, Session.AUTO_ACKNOWLEDGE);
- Thread t = new Thread(new Runnable()
- {
- private Random gen = new Random();
-
- private Message getNextMessage()
- {
- if (msg_size == -1)
- {
- int index = gen.nextInt(1000);
- return msgArray[index];
- }
- else
- {
- return msgArray[0];
- }
- }
-
- public void run()
- {
- try
- {
- MessageProducer prod = session.createProducer(dest);
- // this will ensure that the producer will not overun the consumer.
- feedbackQueue = new AMQQueue(new AMQShortString("amq.direct"), new AMQShortString(UUID
- .randomUUID().toString()), new AMQShortString("control"));
-
- MessageConsumer feedbackConsumer = session.createConsumer(feedbackQueue);
-
- while (true)
- {
- for (int i = 0; i < msg_count_per_session; i++)
- {
- Message msg = getNextMessage();
- msg.setJMSMessageID("ID:" + UUID.randomUUID());
- prod.send(msg);
- }
-
- TextMessage m = session.createTextMessage("End");
- m.setJMSReplyTo(feedbackQueue);
- prod.send(m);
-
- if (transacted)
- {
- session.commit();
- }
-
- System.out.println(df.format(System.currentTimeMillis()));
- feedbackConsumer.receive();
- if (transacted)
- {
- session.commit();
- }
- Thread.sleep(1000);
- }
-
- }
- catch (Exception e)
- {
- handleError(e,"Exception in producing message");
- }
-
- }
-
- });
- t.setName("session-" + i);
- t.start();
-
- }
-
- }
- catch (Exception e)
- {
- handleError(e,"Exception while setting up the test");
- }
-
- }
-
- public static void main(String[] args)
- {
- MultiThreadedProducer test = new MultiThreadedProducer();
- test.setUp();
- test.test();
- }
-
-}
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/ResourceLeakTest.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/ResourceLeakTest.java
deleted file mode 100644
index c33f9ffbf2..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/ResourceLeakTest.java
+++ /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.
- *
- */
-package org.apache.qpid.testkit.soak;
-
-
-import javax.jms.BytesMessage;
-import javax.jms.Destination;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.framing.AMQShortString;
-
-/**
- * Test Description
- * ================
- * This test will open x number of connections where each
- * connection will create a session and a producer/consumer pair,
- * and then send configurable no of messages.
- * It will them sleep for configurable time interval and
- * tear down the connections/sessions/consumers.
- * It will then repeat the process again until the test is stopped.
- *
- * Purpose of the test
- * ===================
- * To find if the broker has leaks when cleaning resources.
- * To find if the client has leaks with resources.
- */
-public class ResourceLeakTest extends BaseTest
-{
- protected int connection_count = 10;
- protected long connection_idle_time = 5000;
-
- public ResourceLeakTest()
- {
- super();
- connection_count = Integer.getInteger("con_count",10);
- connection_idle_time = Long.getLong("con_idle_time", 5000);
- }
-
- public void test()
- {
- try
- {
-
- AMQConnection[] cons = new AMQConnection[connection_count];
- Session[] sessions = new Session[connection_count];
- MessageConsumer[] msgCons = new MessageConsumer[connection_count];
- MessageProducer [] msgProds = new MessageProducer[connection_count];
- Destination dest = new AMQQueue(new AMQShortString(exchange_name),
- new AMQShortString(routing_key),
- new AMQShortString(queue_name),
- true, //exclusive
- true // auto delete
- );
-
- while (true)
- {
- for (int i = 0; i < connection_count; i++)
- {
- AMQConnection con = new AMQConnection(url);
- con.start();
- cons[i] = con;
- Session ssn = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- sessions[i] = ssn;
- MessageConsumer msgCon = ssn.createConsumer(dest);
- msgCons[i] = msgCon;
- MessageProducer msgProd = ssn.createProducer(dest);
- msgProds[i] = msgProd;
-
- BytesMessage msg = ssn.createBytesMessage();
- msg.writeBytes("Test Msg".getBytes());
-
- for (int j = 0; j < msg_count;j++)
- {
- msgProd.send(msg);
- }
-
- int j = 0;
- while (j < msg_count)
- {
- msgCon.receive();
- j++;
- }
- }
- System.out.println(df.format(System.currentTimeMillis()));
- Thread.sleep(connection_idle_time);
-
- try
- {
- for (int i = 0; i < connection_count; i++)
- {
- msgCons[i].close();
- msgProds[i].close();
- sessions[i].close();
- cons[i].close();
- }
- }
- catch (Exception e)
- {
- handleError(e,"Exception closing resources");
- }
- }
- }
- catch (Exception e)
- {
- handleError(e,"Exception in setting up the test");
- }
-
- }
-
- public static void main(String[] args)
- {
- ResourceLeakTest test = new ResourceLeakTest();
- test.test();
- }
-
-}
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/SimpleConsumer.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/SimpleConsumer.java
deleted file mode 100644
index b3eb97dafe..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/SimpleConsumer.java
+++ /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.
- *
- */
-package org.apache.qpid.testkit.soak;
-
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-/**
- * Test Description
- * ================
- * This test will create x number of sessions.
- * Each session will have it's own consumer.
- * Once a consumer receives the "End" message it
- * will send a message to the destination indicated
- * by the replyTo field in the End message.
- * This will signal the producer that all the previous
- * messages have been consumed. The producer will
- * then start sending messages again.
- *
- * This prevents the producer from overruning the
- * consumer.
- * *
- * All consumers share a single destination
- *
- */
-
-public class SimpleConsumer extends BaseTest
-{
- public SimpleConsumer()
- {
- super();
- //needed only to calculate throughput.
- // If msg_count is different set it via -Dmsg_count
- msg_count = 10;
- }
-
- public void test()
- {
- try
- {
- final Session[] sessions = new Session[session_count];
- MessageConsumer[] cons = new MessageConsumer[session_count];
-
- for (int i = 0; i < session_count; i++)
- {
- sessions[i] = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- cons[i] = sessions[i].createConsumer(dest);
- cons[i].setMessageListener(new MessageListener()
- {
-
- private boolean startIteration = true;
- private long startTime = 0;
- private long iterations = 0;
-
- public void onMessage(Message m)
- {
- try
- {
- long now = System.currentTimeMillis();
- if (startIteration)
- {
- startTime = m.getJMSTimestamp();
- startIteration = false;
- }
-
- if (m instanceof TextMessage && ((TextMessage) m).getText().equals("End"))
- {
-
- long totalIterationTime = now - startTime;
- startIteration = true;
- double throughput = ((double)msg_count/(double)totalIterationTime) * 1000;
- long latencySample = now - m.getJMSTimestamp();
- iterations++;
-
- StringBuilder sb = new StringBuilder();
- sb.append(iterations).append(",").
- append(nf.format(throughput)).append(",").append(latencySample);
-
- System.out.println(sb.toString());
-
- MessageProducer temp = sessions[0].createProducer(m.getJMSReplyTo());
- Message controlMsg = sessions[0].createTextMessage();
- temp.send(controlMsg);
- temp.close();
- }
- }
- catch (JMSException e)
- {
- handleError(e,"Exception when receiving the message");
- }
- }
- });
- }
-
- }
- catch (Exception e)
- {
- handleError(e,"Exception when setting up the consumers");
- }
-
- }
-
- public static void main(String[] args)
- {
- SimpleConsumer test = new SimpleConsumer();
- test.setUp();
- test.test();
- }
-
-}
diff --git a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/SimpleProducer.java b/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/SimpleProducer.java
deleted file mode 100644
index 1080092536..0000000000
--- a/M4-RCs/qpid/java/testkit/src/main/java/org/apache/qpid/testkit/soak/SimpleProducer.java
+++ /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.
- *
- */
-package org.apache.qpid.testkit.soak;
-
-
-import java.util.Random;
-import java.util.UUID;
-
-import javax.jms.Destination;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.framing.AMQShortString;
-
-/**
- * Test Description
- * ================
- * This test will send n-1 messages, followed by the n-th
- * message which contains "End" in it's payload to signal
- * that this is the last message message in the sequence.
- * The end message has the feedback queue as it's replyTo.
- * It will then listen on the feedback queue waiting for the
- * confirmation and then sleeps for 1000 ms before proceeding
- * with the next n messages.
- *
- * This hand shaking mechanism ensures that all of the
- * messages sent are consumed by some consumer. This prevents
- * the producers from saturating the broker especially when
- * the consumers are slow.
- *
- * It creates a producer per session.
- * If session_count is > 1 it will round robin the messages
- * btw the producers.
- *
- * All producers send to a single destination
- *
- */
-
-public class SimpleProducer extends BaseTest
-{
- protected Destination feedbackQueue;
- Random gen = new Random();
-
- public SimpleProducer()
- {
- super();
- }
-
- protected Message getNextMessage()
- {
- if (msg_size == -1)
- {
- int index = gen.nextInt(1000);
- return msgArray[index];
- }
- else
- {
- return msgArray[0];
- }
- }
-
- public void test()
- {
- try
- {
- Session[] sessions = new Session[session_count];
- MessageProducer[] prods = new MessageProducer[session_count];
-
- for (int i = 0; i < session_count; i++)
- {
- sessions[i] = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
- prods[i] = sessions[i].createProducer(dest);
- }
-
- // this will ensure that the producer will not overun the consumer.
- feedbackQueue = new AMQQueue(new AMQShortString("amq.direct"),
- new AMQShortString(UUID.randomUUID().toString()),
- new AMQShortString("control"));
-
- MessageConsumer feedbackConsumer = sessions[0].createConsumer(feedbackQueue);
-
- int prod_pointer = 0;
- boolean multi_session = session_count > 1 ? true : false;
-
- while (true)
- {
- for (int i = 0; i < msg_count - 1; i++)
- {
- Message msg = getNextMessage();
- msg.setJMSTimestamp(System.currentTimeMillis());
- prods[prod_pointer].send(msg);
- if (multi_session)
- {
- prod_pointer++;
- if (prod_pointer == session_count)
- {
- prod_pointer = 0;
- }
- }
- }
-
- TextMessage m = sessions[0].createTextMessage("End");
- m.setJMSReplyTo(feedbackQueue);
- prods[prod_pointer].send(m);
- System.out.println(df.format(System.currentTimeMillis()));
- feedbackConsumer.receive();
- Thread.sleep(1000);
- }
- }
- catch (Exception e)
- {
- handleError(e,"Exception while setting up the producer");
- }
-
- }
-
- public static void main(String[] args)
- {
- SimpleProducer test = new SimpleProducer();
- test.setUp();
- test.test();
- }
-
-}
diff --git a/M4-RCs/qpid/java/tools/bin/qpid-bench b/M4-RCs/qpid/java/tools/bin/qpid-bench
deleted file mode 100644
index c982e64efd..0000000000
--- a/M4-RCs/qpid/java/tools/bin/qpid-bench
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-#
-# 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.
-#
-
-if [ -z "$QPID_HOME" ]; then
- export QPID_HOME=$(dirname $(dirname $(readlink -f $0)))
- export PATH=${PATH}:${QPID_HOME}/bin
-fi
-
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-all.jar
-
-# Set other variables used by the qpid-run script before calling
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM=-Xmx1024m \
- QPID_CLASSPATH=$QPID_LIBS
-
-. qpid-run org.apache.qpid.tools.QpidBench "$@"
diff --git a/M4-RCs/qpid/java/tools/build.xml b/M4-RCs/qpid/java/tools/build.xml
deleted file mode 100644
index 7cd1b1172c..0000000000
--- a/M4-RCs/qpid/java/tools/build.xml
+++ /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.
- -
- -->
-<project name="Qpid Tools" default="build">
-
- <property name="module.depends" value="client common"/>
-
- <import file="../module.xml"/>
-
-</project>
diff --git a/M4-RCs/qpid/java/tools/src/main/java/org/apache/qpid/tools/JNDICheck.java b/M4-RCs/qpid/java/tools/src/main/java/org/apache/qpid/tools/JNDICheck.java
deleted file mode 100644
index 9ead0c19f2..0000000000
--- a/M4-RCs/qpid/java/tools/src/main/java/org/apache/qpid/tools/JNDICheck.java
+++ /dev/null
@@ -1,200 +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.
- *
- */
-
-package org.apache.qpid.tools;
-
-import org.apache.qpid.client.AMQDestination;
-import org.apache.qpid.client.AMQConnectionFactory;
-import org.apache.qpid.jms.FailoverPolicy;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.Properties;
-import java.util.Hashtable;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.LinkedList;
-import java.io.IOException;
-import java.io.File;
-import java.io.FileInputStream;
-
-public class JNDICheck
-{
- private static final String QUEUE = "queue.";
- private static final String TOPIC = "topic.";
- private static final String DESTINATION = "destination.";
- private static final String CONNECTION_FACTORY = "connectionfactory.";
-
- public static void main(String[] args)
- {
-
- if (args.length != 1)
- {
- usage();
- }
-
- String propertyFile = args[0];
-
- new JNDICheck(propertyFile);
- }
-
- private static void usage()
- {
- exit("Usage: JNDICheck <JNDI Config file>", 0);
- }
-
- private static void exit(String message, int exitCode)
- {
- System.err.println(message);
- System.exit(exitCode);
- }
-
- private static String JAVA_NAMING = "java.naming.factory.initial";
-
- Context _context = null;
- Hashtable _environment = null;
-
- public JNDICheck(String propertyFile)
- {
-
- // Load JNDI properties
- Properties properties = new Properties();
-
- try
- {
- properties.load(new FileInputStream(new File(propertyFile)));
- }
- catch (IOException e)
- {
- exit("Unable to open property file:" + propertyFile + ". Due to:" + e.getMessage(), 1);
- }
-
- //Create the initial context
- try
- {
-
- System.setProperty(JAVA_NAMING, properties.getProperty(JAVA_NAMING));
-
- _context = new InitialContext(properties);
-
- _environment = _context.getEnvironment();
-
- Enumeration keys = _environment.keys();
-
- List<String> queues = new LinkedList<String>();
- List<String> topics = new LinkedList<String>();
- List<String> destinations = new LinkedList<String>();
- List<String> connectionFactories = new LinkedList<String>();
-
- while (keys.hasMoreElements())
- {
- String key = keys.nextElement().toString();
-
- if (key.startsWith(QUEUE))
- {
- queues.add(key);
- }
- else if (key.startsWith(TOPIC))
- {
- topics.add(key);
- }
- else if (key.startsWith(DESTINATION))
- {
- destinations.add(key);
- }
- else if (key.startsWith(CONNECTION_FACTORY))
- {
- connectionFactories.add(key);
- }
- }
-
- printHeader(propertyFile);
- printEntries(QUEUE, queues);
- printEntries(TOPIC, topics);
- printEntries(DESTINATION, destinations);
- printEntries(CONNECTION_FACTORY, connectionFactories);
-
- }
- catch (NamingException e)
- {
- exit("Unable to load JNDI Context due to:" + e.getMessage(), 1);
- }
-
- }
-
- private void printHeader(String file)
- {
- print("JNDI file :" + file);
- }
-
- private void printEntries(String type, List<String> list)
- {
- if (list.size() > 0)
- {
- String name = type.substring(0, 1).toUpperCase() + type.substring(1, type.length() - 1);
- print(name + " elements in file:");
- printList(list);
- print("");
- }
- }
-
- private void printList(List<String> list)
- {
- for (String item : list)
- {
- String key = item.substring(item.indexOf('.') + 1);
-
- try
- {
- print(key, _context.lookup(key));
- }
- catch (NamingException e)
- {
- exit("Error: item " + key + " no longer in context.", 1);
- }
- }
- }
-
- private void print(String key, Object object)
- {
- if (object instanceof AMQDestination)
- {
- print(key + ":" + object);
- }
- else if (object instanceof AMQConnectionFactory)
- {
- AMQConnectionFactory factory = (AMQConnectionFactory) object;
- print(key + ":Connection");
- print("ConnectionURL:");
- print(factory.getConnectionURL().toString());
- print("FailoverPolicy");
- print(new FailoverPolicy(factory.getConnectionURL()).toString());
- print("");
- }
- }
-
- private void print(String msg)
- {
- System.out.println(msg);
- }
-
-}
diff --git a/M4-RCs/qpid/java/tools/src/main/java/org/apache/qpid/tools/QpidBench.java b/M4-RCs/qpid/java/tools/src/main/java/org/apache/qpid/tools/QpidBench.java
deleted file mode 100644
index 7411e81bd6..0000000000
--- a/M4-RCs/qpid/java/tools/src/main/java/org/apache/qpid/tools/QpidBench.java
+++ /dev/null
@@ -1,857 +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.
- *
- */
-package org.apache.qpid.tools;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-import javax.jms.*;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.transport.*;
-import org.apache.qpid.transport.network.io.IoTransport;
-import org.apache.qpid.util.UUIDGen;
-import org.apache.qpid.util.UUIDs;
-
-import static org.apache.qpid.tools.QpidBench.Mode.*;
-
-/**
- * QpidBench
- *
- */
-
-public class QpidBench
-{
-
- static enum Mode
- {
- PUBLISH, CONSUME, BOTH
- }
-
- private static class Options
- {
- private StringBuilder usage = new StringBuilder("qpid-bench <options>");
-
- void usage(String name, String description, Object def)
- {
- String defval = "";
- if (def != null)
- {
- defval = String.format(" (%s)", def);
- }
- usage.append(String.format("\n %-15s%-14s %s", name, defval, description));
- }
-
- public String broker = "localhost";
- public int port = 5672;
- public long count = 1000000;
- public long window = 100000;
- public long sample = window;
- public int size = 1024;
- public Mode mode = BOTH;
- public boolean timestamp = false;
- public boolean message_id = false;
- public boolean message_cache = false;
- public boolean persistent = false;
- public boolean jms_publish = false;
- public boolean jms_consume = false;
- public boolean help = false;
-
- {
- usage("-b, --broker", "the broker hostname", broker);
- }
-
- public void parse__broker(String b)
- {
- this.broker = b;
- }
-
- public void parse_b(String b)
- {
- parse__broker(b);
- }
-
- {
- usage("-p, --port", "the broker port", port);
- }
-
- public void parse__port(String p)
- {
- this.port = Integer.parseInt(p);
- }
-
- public void parse_p(String p)
- {
- parse__port(p);
- }
-
- {
- usage("-c, --count", "the number of messages to send/receive, 0 means no limit", count);
- }
-
- public void parse__count(String c)
- {
- this.count = Long.parseLong(c);
- }
-
- public void parse_c(String c)
- {
- parse__count(c);
- }
-
- {
- usage("-w, --window", "the number of messages to send before blocking, 0 disables", window);
- }
-
- public void parse__window(String w)
- {
- this.window = Long.parseLong(w);
- }
-
- public void parse_w(String w)
- {
- parse__window(w);
- }
-
- {
- usage("--sample", "print stats after this many messages, 0 disables", sample);
- }
-
- public void parse__sample(String s)
- {
- this.sample = Long.parseLong(s);
- }
-
- {
- usage("-i, --interval", "sets both --window and --sample", window);
- }
-
- public void parse__interval(String i)
- {
- this.window = Long.parseLong(i);
- this.sample = window;
- }
-
- public void parse_i(String i)
- {
- parse__interval(i);
- }
-
- {
- usage("-s, --size", "the message size", size);
- }
-
- public void parse__size(String s)
- {
- this.size = Integer.parseInt(s);
- }
-
- public void parse_s(String s)
- {
- parse__size(s);
- }
-
- {
- usage("-m, --mode", "one of publish, consume, or both", mode);
- }
-
- public void parse__mode(String m)
- {
- if (m.equalsIgnoreCase("publish"))
- {
- this.mode = PUBLISH;
- }
- else if (m.equalsIgnoreCase("consume"))
- {
- this.mode = CONSUME;
- }
- else if (m.equalsIgnoreCase("both"))
- {
- this.mode = BOTH;
- }
- else
- {
- throw new IllegalArgumentException
- ("must be one of 'publish', 'consume', or 'both'");
- }
- }
-
- public void parse_m(String m)
- {
- parse__mode(m);
- }
-
- {
- usage("--timestamp", "set timestamps on each message if true", timestamp);
- }
-
- public void parse__timestamp(String t)
- {
- this.timestamp = Boolean.parseBoolean(t);
- }
-
- {
- usage("--mesage-id", "set the message-id on each message if true", message_id);
- }
-
- public void parse__message_id(String m)
- {
- this.message_id = Boolean.parseBoolean(m);
- }
-
- {
- usage("--message-cache", "reuse the same message for each send if true", message_cache);
- }
-
- public void parse__message_cache(String c)
- {
- this.message_cache = Boolean.parseBoolean(c);
- }
-
- {
- usage("--persistent", "set the delivery-mode to persistent if true", persistent);
- }
-
- public void parse__persistent(String p)
- {
- this.persistent = Boolean.parseBoolean(p);
- }
-
- {
- usage("--jms-publish", "use the jms client for publish", jms_publish);
- }
-
- public void parse__jms_publish(String jp)
- {
- this.jms_publish = Boolean.parseBoolean(jp);
- }
-
- {
- usage("--jms-consume", "use the jms client for consume", jms_consume);
- }
-
- public void parse__jms_consume(String jc)
- {
- this.jms_consume = Boolean.parseBoolean(jc);
- }
-
- {
- usage("--jms", "sets both --jms-publish and --jms-consume", false);
- }
-
- public void parse__jms(String j)
- {
- this.jms_publish = this.jms_consume = Boolean.parseBoolean(j);
- }
-
- {
- usage("-h, --help", "prints this message", null);
- }
-
- public void parse__help()
- {
- this.help = true;
- }
-
- public void parse_h()
- {
- parse__help();
- }
-
- public String parse(String ... args)
- {
- Class klass = getClass();
- List<String> arguments = new ArrayList<String>();
- for (int i = 0; i < args.length; i++)
- {
- String option = args[i];
-
- if (!option.startsWith("-"))
- {
- arguments.add(option);
- continue;
- }
-
- String method = "parse" + option.replace('-', '_');
- try
- {
- try
- {
- Method parser = klass.getMethod(method);
- parser.invoke(this);
- }
- catch (NoSuchMethodException e)
- {
- try
- {
- Method parser = klass.getMethod(method, String.class);
-
- String value = null;
- if (i + 1 < args.length)
- {
- value = args[i+1];
- i++;
- }
- else
- {
- return option + " requires a value";
- }
-
- parser.invoke(this, value);
- }
- catch (NoSuchMethodException e2)
- {
- return "no such option: " + option;
- }
- }
- }
- catch (InvocationTargetException e)
- {
- Throwable t = e.getCause();
- return String.format
- ("error parsing %s: %s: %s", option, t.getClass().getName(),
- t.getMessage());
- }
- catch (IllegalAccessException e)
- {
- throw new RuntimeException
- ("unable to access parse method: " + option, e);
- }
- }
-
- return parseArguments(arguments);
- }
-
- public String parseArguments(List<String> arguments)
- {
- if (arguments.size() > 0)
- {
- String args = arguments.toString();
- return "unrecognized arguments: " + args.substring(1, args.length() - 1);
- }
- else
- {
- return null;
- }
- }
-
- public String toString()
- {
- Class klass = getClass();
- Field[] fields = klass.getFields();
- StringBuilder str = new StringBuilder();
- for (int i = 0; i < fields.length; i++)
- {
- if (i > 0)
- {
- str.append("\n");
- }
-
- String name = fields[i].getName();
- str.append(name);
- str.append(" = ");
- Object value;
- try
- {
- value = fields[i].get(this);
- }
- catch (IllegalAccessException e)
- {
- throw new RuntimeException
- ("unable to access field: " + name, e);
- }
- str.append(value);
- }
-
- return str.toString();
- }
- }
-
- public static final void main(String[] args) throws Exception
- {
- final Options opts = new Options();
- String error = opts.parse(args);
- if (error != null)
- {
- System.err.println(error);
- System.exit(-1);
- return;
- }
-
- if (opts.help)
- {
- System.out.println(opts.usage);
- return;
- }
-
- System.out.println(opts);
-
- switch (opts.mode)
- {
- case CONSUME:
- case BOTH:
- new Thread()
- {
- public void run()
- {
- try
- {
- if (opts.jms_consume)
- {
- jms_consumer(opts);
- }
- else
- {
- native_consumer(opts);
- }
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- }.start();
- break;
- }
-
- switch (opts.mode)
- {
- case PUBLISH:
- case BOTH:
- new Thread()
- {
- public void run()
- {
- try
- {
- if (opts.jms_publish)
- {
- jms_publisher(opts);
- }
- else
- {
- native_publisher(opts);
- }
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- }.start();
- break;
- }
- }
-
- private static enum Column
- {
- LEFT, RIGHT
- }
-
- private static final void sample(Options opts, Column col, String name, long count,
- long start, long time, long lastTime)
- {
- String pfx = "";
- String sfx = "";
- if (opts.mode == BOTH)
- {
- if (col == Column.RIGHT)
- {
- pfx = " -- ";
- }
- else
- {
- sfx = " --";
- }
- }
-
- if (count == 0)
- {
- String stats = String.format("%s: %tc", name, start);
- System.out.println(String.format("%s%-36s%s", pfx, stats, sfx));
- return;
- }
-
- double cumulative = 1000 * (double) count / (double) (time - start);
- double interval = 1000 * ((double) opts.sample / (double) (time - lastTime));
-
- String stats = String.format
- ("%s: %d %.2f %.2f", name, count, cumulative, interval);
- System.out.println(String.format("%s%-36s%s", pfx, stats, sfx));
- }
-
- private static final javax.jms.Connection getJMSConnection(Options opts) throws Exception
- {
- String url = String.format
- ("amqp://guest:guest@clientid/test?brokerlist='tcp://%s:%d'",
- opts.broker, opts.port);
- return new AMQConnection(url);
- }
-
- private static final void jms_publisher(Options opts) throws Exception
- {
- javax.jms.Connection conn = getJMSConnection(opts);
-
- javax.jms.Session ssn = conn.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
- Destination dest = ssn.createQueue("test-queue");
- Destination echo_dest = ssn.createQueue("echo-queue");
- MessageProducer prod = ssn.createProducer(dest);
- MessageConsumer cons = ssn.createConsumer(echo_dest);
- prod.setDisableMessageID(!opts.message_id);
- prod.setDisableMessageTimestamp(!opts.timestamp);
- prod.setDeliveryMode(opts.persistent ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
-
- StringBuilder str = new StringBuilder();
- for (int i = 0; i < opts.size; i++)
- {
- str.append((char) (i % 128));
- }
-
- String body = str.toString();
-
- TextMessage cached = ssn.createTextMessage();
- cached.setText(body);
-
- conn.start();
-
- long count = 0;
- long lastTime = 0;
- long start = System.currentTimeMillis();
- while (opts.count == 0 || count < opts.count)
- {
- if (opts.window > 0 && (count % opts.window) == 0 && count > 0)
- {
- Message echo = cons.receive();
- }
-
- if (opts.sample > 0 && (count % opts.sample) == 0)
- {
- long time = System.currentTimeMillis();
- sample(opts, Column.LEFT, "JP", count, start, time, lastTime);
- lastTime = time;
- }
-
- TextMessage m;
- if (opts.message_cache)
- {
- m = cached;
- }
- else
- {
- m = ssn.createTextMessage();
- m.setText(body);
- }
-
- prod.send(m);
- count++;
- }
-
- conn.close();
- }
-
- private static final void jms_consumer(final Options opts) throws Exception
- {
- final javax.jms.Connection conn = getJMSConnection(opts);
- javax.jms.Session ssn = conn.createSession(false, javax.jms.Session.AUTO_ACKNOWLEDGE);
- Destination dest = ssn.createQueue("test-queue");
- Destination echo_dest = ssn.createQueue("echo-queue");
- MessageConsumer cons = ssn.createConsumer(dest);
- final MessageProducer prod = ssn.createProducer(echo_dest);
- prod.setDisableMessageID(true);
- prod.setDisableMessageTimestamp(true);
- prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
- final TextMessage echo = ssn.createTextMessage();
- echo.setText("ECHO");
-
- final Object done = new Object();
- cons.setMessageListener(new MessageListener()
- {
- private long count = 0;
- private long lastTime = 0;
- private long start;
-
- public void onMessage(Message m)
- {
- if (count == 0)
- {
- start = System.currentTimeMillis();
- }
-
- try
- {
- boolean sample = opts.sample > 0 && (count % opts.sample) == 0;
- long time = sample ? System.currentTimeMillis() : 0;
-
- if (opts.window > 0 && (count % opts.window) == 0)
- {
- prod.send(echo);
- }
-
- if (sample)
- {
- sample(opts, Column.RIGHT, "JC", count, start, time, lastTime);
- lastTime = time;
- }
- }
- catch (JMSException e)
- {
- throw new RuntimeException(e);
- }
- count++;
-
- if (opts.count > 0 && count >= opts.count)
- {
- synchronized (done)
- {
- done.notify();
- }
- }
- }
- });
-
- conn.start();
- synchronized (done)
- {
- done.wait();
- }
- conn.close();
- }
-
- private static final org.apache.qpid.transport.Connection getConnection
- (Options opts)
- {
- org.apache.qpid.transport.Connection conn =
- new org.apache.qpid.transport.Connection();
- conn.connect(opts.broker, opts.port, null, "guest", "guest",false);
- return conn;
- }
-
- private static abstract class NativeListener implements SessionListener
- {
-
- public void opened(org.apache.qpid.transport.Session ssn) {}
-
- public void exception(org.apache.qpid.transport.Session ssn,
- SessionException exc)
- {
- exc.printStackTrace();
- }
-
- public void closed(org.apache.qpid.transport.Session ssn) {}
-
- }
-
- private static final void native_publisher(Options opts) throws Exception
- {
- final long[] echos = { 0 };
- org.apache.qpid.transport.Connection conn = getConnection(opts);
- org.apache.qpid.transport.Session ssn = conn.createSession();
- ssn.setSessionListener(new NativeListener()
- {
- public void message(org.apache.qpid.transport.Session ssn,
- MessageTransfer xfr)
- {
- synchronized (echos)
- {
- echos[0]++;
- echos.notify();
- }
- ssn.processed(xfr);
- }
- });
-
- ssn.invoke(new QueueDeclare().queue("test-queue").durable(false));
- ssn.invoke(new QueueDeclare().queue("echo-queue").durable(false));
- ssn.invoke(new ExchangeBind().exchange("amq.direct").queue("test-queue").bindingKey("test-queue"));
- ssn.invoke(new ExchangeBind().exchange("amq.direct").queue("echo-queue").bindingKey("echo-queue"));
-
- MessageProperties cached_mp = new MessageProperties();
- DeliveryProperties cached_dp = new DeliveryProperties();
- cached_dp.setRoutingKey("test-queue");
- cached_dp.setDeliveryMode
- (opts.persistent ? MessageDeliveryMode.PERSISTENT : MessageDeliveryMode.NON_PERSISTENT);
-
- int size = opts.size;
- ByteBuffer body = ByteBuffer.allocate(size);
- for (int i = 0; i < size; i++)
- {
- body.put((byte) i);
- }
- body.flip();
-
- ssn.invoke(new MessageSubscribe()
- .queue("echo-queue")
- .destination("echo-queue")
- .acceptMode(MessageAcceptMode.NONE)
- .acquireMode(MessageAcquireMode.PRE_ACQUIRED));
- ssn.messageSetFlowMode("echo-queue", MessageFlowMode.WINDOW);
- ssn.messageFlow("echo-queue", MessageCreditUnit.MESSAGE, 0xFFFFFFFF);
- ssn.messageFlow("echo-queue", MessageCreditUnit.BYTE, 0xFFFFFFFF);
-
- UUIDGen gen = UUIDs.newGenerator();
-
- long count = 0;
- long lastTime = 0;
- long start = System.currentTimeMillis();
- while (opts.count == 0 || count < opts.count)
- {
- if (opts.window > 0 && (count % opts.window) == 0 && count > 0)
- {
- synchronized (echos)
- {
- while (echos[0] < (count/opts.window))
- {
- echos.wait();
- }
- }
- }
-
- if (opts.sample > 0 && (count % opts.sample) == 0)
- {
- long time = System.currentTimeMillis();
- sample(opts, Column.LEFT, "NP", count, start, time, lastTime);
- lastTime = time;
- }
-
- MessageProperties mp;
- DeliveryProperties dp;
- if (opts.message_cache)
- {
- mp = cached_mp;
- dp = cached_dp;
- }
- else
- {
- mp = new MessageProperties();
- dp = new DeliveryProperties();
- dp.setRoutingKey("test-queue");
- dp.setDeliveryMode
- (opts.persistent ? MessageDeliveryMode.PERSISTENT : MessageDeliveryMode.NON_PERSISTENT);
-
- }
-
- if (opts.message_id)
- {
- mp.setMessageId(gen.generate());
- }
-
- if (opts.timestamp)
- {
- dp.setTimestamp(System.currentTimeMillis());
- }
-
- ssn.messageTransfer("amq.direct", MessageAcceptMode.NONE, MessageAcquireMode.PRE_ACQUIRED,
- new Header(dp, mp), body.slice());
- count++;
- }
-
- ssn.messageCancel("echo-queue");
-
- ssn.sync();
- ssn.close();
- conn.close();
- }
-
- private static final void native_consumer(final Options opts) throws Exception
- {
- final DeliveryProperties dp = new DeliveryProperties();
- final byte[] echo = new byte[0];
- dp.setRoutingKey("echo-queue");
- dp.setDeliveryMode(MessageDeliveryMode.NON_PERSISTENT);
- final MessageProperties mp = new MessageProperties();
- final Object done = new Object();
- org.apache.qpid.transport.Connection conn = getConnection(opts);
- org.apache.qpid.transport.Session ssn = conn.createSession();
- ssn.setSessionListener(new NativeListener()
- {
- private long count = 0;
- private long lastTime = 0;
- private long start;
-
- public void message(org.apache.qpid.transport.Session ssn,
- MessageTransfer xfr)
- {
- if (count == 0)
- {
- start = System.currentTimeMillis();
- }
-
- boolean sample = opts.sample > 0 && (count % opts.sample) == 0;
- long time = sample ? System.currentTimeMillis() : 0;
-
- if (opts.window > 0 && (count % opts.window) == 0)
- {
- ssn.messageTransfer("amq.direct",
- MessageAcceptMode.NONE,
- MessageAcquireMode.PRE_ACQUIRED,
- new Header(dp, mp),
- echo);
- }
-
- if (sample)
- {
- sample(opts, Column.RIGHT, "NC", count, start, time, lastTime);
- lastTime = time;
- }
- ssn.processed(xfr);
- count++;
-
- if (opts.count > 0 && count >= opts.count)
- {
- synchronized (done)
- {
- done.notify();
- }
- }
- }
- });
-
- ssn.invoke(new QueueDeclare().queue("test-queue").durable(false));
- ssn.invoke(new QueueDeclare().queue("echo-queue").durable(false));
- ssn.invoke(new ExchangeBind().exchange("amq.direct").queue("test-queue").bindingKey("test-queue"));
- ssn.invoke(new ExchangeBind().exchange("amq.direct").queue("echo-queue").bindingKey("echo-queue"));
-
- ssn.invoke(new MessageSubscribe()
- .queue("test-queue")
- .destination("test-queue")
- .acceptMode(MessageAcceptMode.NONE)
- .acquireMode(MessageAcquireMode.PRE_ACQUIRED));
- ssn.messageSetFlowMode("test-queue", MessageFlowMode.WINDOW);
- ssn.messageFlow("test-queue", MessageCreditUnit.MESSAGE, 0xFFFFFFFF);
- ssn.messageFlow("test-queue", MessageCreditUnit.BYTE, 0xFFFFFFFF);
-
- synchronized (done)
- {
- done.wait();
- }
-
- ssn.messageCancel("test-queue");
-
- ssn.sync();
- ssn.close();
- conn.close();
- }
-
-}
diff --git a/M4-RCs/qpid/python/LICENSE.txt b/M4-RCs/qpid/python/LICENSE.txt
deleted file mode 100755
index 6b0b1270ff..0000000000
--- a/M4-RCs/qpid/python/LICENSE.txt
+++ /dev/null
@@ -1,203 +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/M4-RCs/qpid/python/NOTICE.txt b/M4-RCs/qpid/python/NOTICE.txt
deleted file mode 100644
index 32ccdb70c4..0000000000
--- a/M4-RCs/qpid/python/NOTICE.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-=========================================================================
-== NOTICE file corresponding to the section 4 d of ==
-== the Apache License, Version 2.0, ==
-== in this case for the Apache Qpid distribution. ==
-=========================================================================
-
-This product includes software developed by the Apache Software Foundation
-(http://www.apache.org/).
-
-Please read the LICENSE.txt file present in the root directory of this
-distribution.
-
-
-Aside from contributions to the Apache Qpid project, this software also
-includes (binary only):
-
- - None at this time
-
-
-
diff --git a/M4-RCs/qpid/python/README.txt b/M4-RCs/qpid/python/README.txt
deleted file mode 100644
index bae9f6ab0b..0000000000
--- a/M4-RCs/qpid/python/README.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-= INSTALLATION =
-
-Extract the release archive into a directory of your choice and set
-your PYTHONPATH accordingly:
-
- tar -xzf qpid-python-<version>.tar.gz -C <install-prefix>
- export PYTHONPATH=<install-prefix>/qpid-<version>/python
-
-= GETTING STARTED =
-
-The python client includes a simple hello-world example that publishes
-and consumes a message:
-
- cp <install-prefix>/qpid-<version>/python/hello-world .
- ./hello-world
-
-= EXAMPLES =
-
-More comprehensive examples can be found here:
-
- cd <install-prefix>/qpid-<version>/python/examples
-
-= RUNNING THE TESTS =
-
-The "tests" directory contains a collection of unit tests for the
-python client. The "tests_0-10", "tests_0-9", and "tests_0-8"
-directories contain protocol level conformance tests for AMQP brokers
-of the specified version.
-
-Simplest way to run the tests:
-
- 1. Run a broker on the default port
-
- 2. ./run-tests -s <version>
-
-Where <version> is one of "0-8", "0-9", or "0-10-errata".
-
-See the run-tests usage for for additional options:
-
- ./run-tests -h
-
-== Expected failures ==
-
-Certain tests are expected to fail due to incomplete functionality or
-unresolved interop issues. To skip expected failures for the C++ or
-Java brokers:
-
- ./run-tests -I <file-name>
-
-Where <file-name> is one of the following files:
-
- * cpp_failing_0-10.txt
- * cpp_failing_0-9.txt
- * cpp_failing_0-8.txt
- * java_failing_0-9.txt
- * java_failing_0-8.txt
diff --git a/M4-RCs/qpid/python/RELEASE_NOTES b/M4-RCs/qpid/python/RELEASE_NOTES
deleted file mode 100644
index c0903df38e..0000000000
--- a/M4-RCs/qpid/python/RELEASE_NOTES
+++ /dev/null
@@ -1,17 +0,0 @@
-Apache Python M4 Release Notes
-------------------------------
-
-The Qpid M4 release of the python client contains support the for both
- 0-8 and 0-10 of the AMQP specification as well as support for the
-non-WIP portion of the 0-9 specification. You can access these
-specifications from:
-
-http://jira.amqp.org/confluence/display/AMQP/Download
-
-For full details of Qpid capabilities, as they currently stand, see our
-project page at:
-
-http://cwiki.apache.org/confluence/display/qpid/Index
-
-The README file provided contains some details on installing and using
-the python client that is included with this distribution.
diff --git a/M4-RCs/qpid/python/amqp-doc b/M4-RCs/qpid/python/amqp-doc
deleted file mode 100755
index 1f5910f942..0000000000
--- a/M4-RCs/qpid/python/amqp-doc
+++ /dev/null
@@ -1,80 +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 qpid.spec import load, pythonize
-from getopt import gnu_getopt as getopt, GetoptError
-from fnmatch import fnmatchcase as fnmatch
-
-def die(msg):
- print >> sys.stderr, msg
- sys.exit(1)
-
-def usage(msg = ""):
- return ("""%s
-
-Usage %s [<options>] [<pattern_1> ... <pattern_n>]
-
-Options:
- -e, --regexp use regex instead of glob when matching
- -s, --spec <url> location of amqp.xml
-""" % (msg, sys.argv[0])).strip()
-
-try:
- opts, args = getopt(sys.argv[1:], "s:ea:", ["regexp", "spec=", "additional="])
-except GetoptError, e:
- die(str(e))
-
-regexp = False
-spec = "../specs/amqp.0-9.xml"
-errata = []
-for k, v in opts:
- if k == "-e" or k == "--regexp": regexp = True
- if k == "-s" or k == "--spec": spec = v
- if k == "-a" or k == "--additional": errata.append(v)
-
-if regexp:
- def match(pattern, value):
- try:
- return re.match(pattern, value)
- except Exception, e:
- die("error: '%s': %s" % (pattern, e))
-else:
- def match(pattern, value):
- return fnmatch(value, pattern)
-
-spec = load(spec, *errata)
-methods = {}
-patterns = args
-for pattern in patterns:
- for c in spec.classes:
- for m in c.methods:
- name = pythonize("%s_%s" % (c.name, m.name))
- if match(pattern, name):
- methods[name] = m.define_method(name)
-
-if patterns:
- if methods:
- AMQP = type("AMQP[%s]" % ", ".join(patterns), (), methods)
- else:
- die("no matches")
-else:
- AMQP = spec.define_class("AMQP")
-
-help(AMQP)
diff --git a/M4-RCs/qpid/python/commands/qpid-config b/M4-RCs/qpid/python/commands/qpid-config
deleted file mode 100755
index 1b7b5171ed..0000000000
--- a/M4-RCs/qpid/python/commands/qpid-config
+++ /dev/null
@@ -1,391 +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 getopt
-import sys
-import locale
-from qmf.console import Session
-
-_recursive = False
-_host = "localhost"
-_durable = False
-_clusterDurable = False
-_fileCount = 8
-_fileSize = 24
-_maxQueueSize = None
-_maxQueueCount = None
-_policyType = None
-_lvq = False
-_msgSequence = False
-_ive = False
-
-FILECOUNT = "qpid.file_count"
-FILESIZE = "qpid.file_size"
-MAX_QUEUE_SIZE = "qpid.max_size"
-MAX_QUEUE_COUNT = "qpid.max_count"
-POLICY_TYPE = "qpid.policy_type"
-CLUSTER_DURABLE = "qpid.persist_last_node"
-LVQ = "qpid.last_value_queue"
-MSG_SEQUENCE = "qpid.msg_sequence"
-IVE = "qpid.ive"
-
-def Usage ():
- print "Usage: qpid-config [OPTIONS]"
- print " qpid-config [OPTIONS] exchanges [filter-string]"
- print " qpid-config [OPTIONS] queues [filter-string]"
- print " qpid-config [OPTIONS] add exchange <type> <name> [AddExchangeOptions]"
- print " qpid-config [OPTIONS] del exchange <name>"
- print " qpid-config [OPTIONS] add queue <name> [AddQueueOptions]"
- print " qpid-config [OPTIONS] del queue <name>"
- print " qpid-config [OPTIONS] bind <exchange-name> <queue-name> [binding-key]"
- print " qpid-config [OPTIONS] unbind <exchange-name> <queue-name> [binding-key]"
- print
- print "Options:"
- print " -b [ --bindings ] Show bindings in queue or exchange list"
- print " -a [ --broker-addr ] Address (localhost) Address of qpidd broker"
- print " broker-addr is in the form: [username/password@] hostname | ip-address [:<port>]"
- print " ex: localhost, 10.1.1.7:10000, broker-host:10000, guest/guest@localhost"
- print
- print "Add Queue Options:"
- print " --durable Queue is durable"
- print " --cluster-durable Queue becomes durable if there is only one functioning cluster node"
- print " --file-count N (8) Number of files in queue's persistence journal"
- print " --file-size N (24) File size in pages (64Kib/page)"
- print " --max-queue-size N Maximum in-memory queue size as bytes"
- print " --max-queue-count N Maximum in-memory queue size as a number of messages"
- print " --policy-type TYPE Action taken when queue limit is reached (reject, flow_to_disk, ring, ring_strict)"
- print " --last-value-queue Enable LVQ behavior on the queue"
- print
- print "Add Exchange Options:"
- print " --durable Exchange is durable"
- print " --sequence Exchange will insert a 'qpid.msg_sequence' field in the message header"
- print " with a value that increments for each message forwarded."
- print " --ive Exchange will behave as an 'initial-value-exchange', keeping a reference"
- print " to the last message forwarded and enqueuing that message to newly bound"
- print " queues."
- print
- sys.exit (1)
-
-class BrokerManager:
- def __init__ (self):
- self.brokerName = None
- self.qmf = None
- self.broker = None
-
- def SetBroker (self, brokerUrl):
- self.url = brokerUrl
- self.qmf = Session()
- self.broker = self.qmf.addBroker(brokerUrl)
- agents = self.qmf.getAgents()
- for a in agents:
- if a.getAgentBank() == 0:
- self.brokerAgent = a
-
- def Disconnect(self):
- self.qmf.delBroker(self.broker)
-
- def Overview (self):
- exchanges = self.qmf.getObjects(_class="exchange", _agent=self.brokerAgent)
- queues = self.qmf.getObjects(_class="queue", _agent=self.brokerAgent)
- print "Total Exchanges: %d" % len (exchanges)
- etype = {}
- for ex in exchanges:
- if ex.type not in etype:
- etype[ex.type] = 1
- else:
- etype[ex.type] = etype[ex.type] + 1
- for typ in etype:
- print "%15s: %d" % (typ, etype[typ])
-
- print
- print " Total Queues: %d" % len (queues)
- _durable = 0
- for queue in queues:
- if queue.durable:
- _durable = _durable + 1
- print " durable: %d" % _durable
- print " non-durable: %d" % (len (queues) - _durable)
-
- def ExchangeList (self, filter):
- exchanges = self.qmf.getObjects(_class="exchange", _agent=self.brokerAgent)
- caption1 = "Type "
- caption2 = "Exchange Name"
- maxNameLen = len(caption2)
- for ex in exchanges:
- if self.match(ex.name, filter):
- if len(ex.name) > maxNameLen: maxNameLen = len(ex.name)
- print "%s%-*s Attributes" % (caption1, maxNameLen, caption2)
- line = ""
- for i in range(((maxNameLen + len(caption1)) / 5) + 5):
- line += "====="
- print line
-
- for ex in exchanges:
- if self.match (ex.name, filter):
- print "%-10s%-*s " % (ex.type, maxNameLen, ex.name),
- args = ex.arguments
- if ex.durable: print "--durable",
- if MSG_SEQUENCE in args and args[MSG_SEQUENCE] == 1: print "--sequence",
- if IVE in args and args[IVE] == 1: print "--ive",
- print
-
- def ExchangeListRecurse (self, filter):
- exchanges = self.qmf.getObjects(_class="exchange", _agent=self.brokerAgent)
- bindings = self.qmf.getObjects(_class="binding", _agent=self.brokerAgent)
- queues = self.qmf.getObjects(_class="queue", _agent=self.brokerAgent)
- for ex in exchanges:
- if self.match (ex.name, filter):
- print "Exchange '%s' (%s)" % (ex.name, ex.type)
- for bind in bindings:
- if bind.exchangeRef == ex.getObjectId():
- qname = "<unknown>"
- queue = self.findById (queues, bind.queueRef)
- if queue != None:
- qname = queue.name
- print " bind [%s] => %s" % (bind.bindingKey, qname)
-
-
- def QueueList (self, filter):
- queues = self.qmf.getObjects(_class="queue", _agent=self.brokerAgent)
-
- caption = "Queue Name"
- maxNameLen = len(caption)
- for q in queues:
- if self.match (q.name, filter):
- if len(q.name) > maxNameLen: maxNameLen = len(q.name)
- print "%-*s Attributes" % (maxNameLen, caption)
- line = ""
- for i in range((maxNameLen / 5) + 5):
- line += "====="
- print line
-
- for q in queues:
- if self.match (q.name, filter):
- print "%-*s " % (maxNameLen, q.name),
- args = q.arguments
- if q.durable: print "--durable",
- if CLUSTER_DURABLE in args and args[CLUSTER_DURABLE] == 1: print "--cluster-durable",
- if q.autoDelete: print "auto-del",
- if q.exclusive: print "excl",
- if FILESIZE in args: print "--file-size=%d" % args[FILESIZE],
- if FILECOUNT in args: print "--file-count=%d" % args[FILECOUNT],
- if MAX_QUEUE_SIZE in args: print "--max-queue-size=%d" % args[MAX_QUEUE_SIZE],
- if MAX_QUEUE_COUNT in args: print "--max-queue-count=%d" % args[MAX_QUEUE_COUNT],
- if POLICY_TYPE in args: print "--policy-type=%s" % args[POLICY_TYPE],
- if LVQ in args and args[LVQ] == 1: print "--last-value-queue",
- print
-
- def QueueListRecurse (self, filter):
- exchanges = self.qmf.getObjects(_class="exchange", _agent=self.brokerAgent)
- bindings = self.qmf.getObjects(_class="binding", _agent=self.brokerAgent)
- queues = self.qmf.getObjects(_class="queue", _agent=self.brokerAgent)
- for queue in queues:
- if self.match (queue.name, filter):
- print "Queue '%s'" % queue.name
- for bind in bindings:
- if bind.queueRef == queue.getObjectId():
- ename = "<unknown>"
- ex = self.findById (exchanges, bind.exchangeRef)
- if ex != None:
- ename = ex.name
- if ename == "":
- ename = "''"
- print " bind [%s] => %s" % (bind.bindingKey, ename)
-
- def AddExchange (self, args):
- if len (args) < 2:
- Usage ()
- etype = args[0]
- ename = args[1]
- declArgs = {}
- if _msgSequence:
- declArgs[MSG_SEQUENCE] = 1
- if _ive:
- declArgs[IVE] = 1
- self.broker.getAmqpSession().exchange_declare (exchange=ename, type=etype, durable=_durable, arguments=declArgs)
-
- def DelExchange (self, args):
- if len (args) < 1:
- Usage ()
- ename = args[0]
- self.broker.getAmqpSession().exchange_delete (exchange=ename)
-
- def AddQueue (self, args):
- if len (args) < 1:
- Usage ()
- qname = args[0]
- declArgs = {}
- if _durable:
- declArgs[FILECOUNT] = _fileCount
- declArgs[FILESIZE] = _fileSize
-
- if _maxQueueSize:
- declArgs[MAX_QUEUE_SIZE] = _maxQueueSize
- if _maxQueueCount:
- declArgs[MAX_QUEUE_COUNT] = _maxQueueCount
- if _policyType:
- declArgs[POLICY_TYPE] = _policyType
- if _clusterDurable:
- declArgs[CLUSTER_DURABLE] = 1
- if _lvq:
- declArgs[LVQ] = 1
-
- self.broker.getAmqpSession().queue_declare (queue=qname, durable=_durable, arguments=declArgs)
-
- def DelQueue (self, args):
- if len (args) < 1:
- Usage ()
- qname = args[0]
- self.broker.getAmqpSession().queue_delete (queue=qname)
-
- def Bind (self, args):
- if len (args) < 2:
- Usage ()
- ename = args[0]
- qname = args[1]
- key = ""
- if len (args) > 2:
- key = args[2]
- self.broker.getAmqpSession().exchange_bind (queue=qname, exchange=ename, binding_key=key)
-
- def Unbind (self, args):
- if len (args) < 2:
- Usage ()
- ename = args[0]
- qname = args[1]
- key = ""
- if len (args) > 2:
- key = args[2]
- self.broker.getAmqpSession().exchange_unbind (queue=qname, exchange=ename, binding_key=key)
-
- def findById (self, items, id):
- for item in items:
- if item.getObjectId() == id:
- return item
- return None
-
- def match (self, name, filter):
- if filter == "":
- return True
- if name.find (filter) == -1:
- return False
- return True
-
-def YN (bool):
- if bool:
- return 'Y'
- return 'N'
-
-
-##
-## Main Program
-##
-
-try:
- longOpts = ("durable", "cluster-durable", "bindings", "broker-addr=", "file-count=",
- "file-size=", "max-queue-size=", "max-queue-count=", "policy-type=",
- "last-value-queue", "sequence", "ive")
- (optlist, encArgs) = getopt.gnu_getopt (sys.argv[1:], "a:b", longOpts)
-except:
- Usage ()
-
-try:
- encoding = locale.getpreferredencoding()
- cargs = [a.decode(encoding) for a in encArgs]
-except:
- cargs = encArgs
-
-for opt in optlist:
- if opt[0] == "-b" or opt[0] == "--bindings":
- _recursive = True
- if opt[0] == "-a" or opt[0] == "--broker-addr":
- _host = opt[1]
- if opt[0] == "--durable":
- _durable = True
- if opt[0] == "--cluster-durable":
- _clusterDurable = True
- if opt[0] == "--file-count":
- _fileCount = int (opt[1])
- if opt[0] == "--file-size":
- _fileSize = int (opt[1])
- if opt[0] == "--max-queue-size":
- _maxQueueSize = int (opt[1])
- if opt[0] == "--max-queue-count":
- _maxQueueCount = int (opt[1])
- if opt[0] == "--policy-type":
- _policyType = opt[1]
- if opt[0] == "--last-value-queue":
- _lvq = True
- if opt[0] == "--sequence":
- _msgSequence = True
- if opt[0] == "--ive":
- _ive = True
-
-nargs = len (cargs)
-bm = BrokerManager ()
-
-try:
- bm.SetBroker(_host)
- if nargs == 0:
- bm.Overview ()
- else:
- cmd = cargs[0]
- modifier = ""
- if nargs > 1:
- modifier = cargs[1]
- if cmd == "exchanges":
- if _recursive:
- bm.ExchangeListRecurse (modifier)
- else:
- bm.ExchangeList (modifier)
- elif cmd == "queues":
- if _recursive:
- bm.QueueListRecurse (modifier)
- else:
- bm.QueueList (modifier)
- elif cmd == "add":
- if modifier == "exchange":
- bm.AddExchange (cargs[2:])
- elif modifier == "queue":
- bm.AddQueue (cargs[2:])
- else:
- Usage ()
- elif cmd == "del":
- if modifier == "exchange":
- bm.DelExchange (cargs[2:])
- elif modifier == "queue":
- bm.DelQueue (cargs[2:])
- else:
- Usage ()
- elif cmd == "bind":
- bm.Bind (cargs[1:])
- elif cmd == "unbind":
- bm.Unbind (cargs[1:])
- else:
- Usage ()
-except KeyboardInterrupt:
- print
-except Exception,e:
- print "Failed:", e.args
- sys.exit(1)
-finally:
- bm.Disconnect()
diff --git a/M4-RCs/qpid/python/commands/qpid-printevents b/M4-RCs/qpid/python/commands/qpid-printevents
deleted file mode 100755
index 0c1b618a1f..0000000000
--- a/M4-RCs/qpid/python/commands/qpid-printevents
+++ /dev/null
@@ -1,74 +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 optparse
-import sys
-import socket
-from time import time, strftime, gmtime, sleep
-from qmf.console import Console, Session
-
-class EventConsole(Console):
- def event(self, broker, event):
- print event
-
- def brokerConnected(self, broker):
- print strftime("%c", gmtime(time())), "NOTIC qpid-printevents:brokerConnected broker=%s" % broker.getUrl()
-
- def brokerDisconnected(self, broker):
- print strftime("%c", gmtime(time())), "NOTIC qpid-printevents:brokerDisconnected broker=%s" % broker.getUrl()
-
-
-##
-## Main Program
-##
-def main():
- _usage = "%prog [options] [broker-addr]..."
- _description = \
-"""Collect and print events from one or more Qpid message brokers. If no broker-addr is
-supplied, %prog will connect to 'localhost:5672'.
-broker-addr is of the form: [username/password@] hostname | ip-address [:<port>]
-ex: localhost, 10.1.1.7:10000, broker-host:10000, guest/guest@localhost
-"""
- p = optparse.OptionParser(usage=_usage, description=_description)
-
- options, arguments = p.parse_args()
- if len(arguments) == 0:
- arguments.append("localhost")
-
- console = EventConsole()
- session = Session(console, rcvObjects=False, rcvHeartbeats=False, manageConnections=True)
- brokers = []
- for host in arguments:
- brokers.append(session.addBroker(host))
-
- try:
- while (True):
- sleep(10)
- except KeyboardInterrupt:
- for broker in brokers:
- session.delBroker(broker)
- print
- sys.exit(0)
-
-if __name__ == '__main__':
- main()
-
diff --git a/M4-RCs/qpid/python/commands/qpid-queue-stats b/M4-RCs/qpid/python/commands/qpid-queue-stats
deleted file mode 100755
index 356a1d2d8d..0000000000
--- a/M4-RCs/qpid/python/commands/qpid-queue-stats
+++ /dev/null
@@ -1,144 +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 optparse
-import sys
-import re
-import socket
-import qpid
-from threading import Condition
-from qmf.console import Session, Console
-from qpid.peer import Closed
-from qpid.connection import Connection, ConnectionFailed
-from time import sleep
-
-class BrokerManager(Console):
- def __init__(self, host):
- self.url = host
- self.objects = {}
- self.filter = None
- self.session = Session(self, rcvEvents=False, rcvHeartbeats=False,
- userBindings=True, manageConnections=True)
- self.broker = self.session.addBroker(self.url)
- self.firstError = True
-
- def setFilter(self,filter):
- self.filter = filter
-
- def brokerConnected(self, broker):
- if not self.firstError:
- print "*** Broker connected"
- self.firstError = False
-
- def brokerDisconnected(self, broker):
- print "*** Broker connection lost - %s, retrying..." % broker.getError()
- self.firstError = False
- self.objects.clear()
-
- def objectProps(self, broker, record):
- className = record.getClassKey().getClassName()
- if className != "queue":
- return
-
- id = record.getObjectId().__repr__()
- if id not in self.objects:
- self.objects[id] = (record.name, None, None)
-
- def objectStats(self, broker, record):
- className = record.getClassKey().getClassName()
- if className != "queue":
- return
-
- id = record.getObjectId().__repr__()
- if id not in self.objects:
- return
-
- (name, first, last) = self.objects[id]
- if first == None:
- self.objects[id] = (name, record, None)
- return
-
- if len(self.filter) > 0 :
- match = False
-
- for x in self.filter:
- if x.match(name):
- match = True
- break
- if match == False:
- return
-
- if last == None:
- lastSample = first
- else:
- lastSample = last
-
- self.objects[id] = (name, first, record)
-
- deltaTime = float (record.getTimestamps()[0] - lastSample.getTimestamps()[0])
- if deltaTime < 1000000000.0:
- return
- enqueueRate = float (record.msgTotalEnqueues - lastSample.msgTotalEnqueues) / \
- (deltaTime / 1000000000.0)
- dequeueRate = float (record.msgTotalDequeues - lastSample.msgTotalDequeues) / \
- (deltaTime / 1000000000.0)
- print "%-41s%10.2f%11d%13.2f%13.2f" % \
- (name, deltaTime / 1000000000, record.msgDepth, enqueueRate, dequeueRate)
-
-
- def Display (self):
- self.session.bindClass("org.apache.qpid.broker", "queue")
- print "Queue Name Sec Depth Enq Rate Deq Rate"
- print "========================================================================================"
- try:
- while True:
- sleep (1)
- if self.firstError and self.broker.getError():
- self.firstError = False
- print "*** Error: %s, retrying..." % self.broker.getError()
- except KeyboardInterrupt:
- print
- self.session.delBroker(self.broker)
-
-##
-## Main Program
-##
-def main():
- p = optparse.OptionParser()
- p.add_option('--broker-address','-a', default='localhost' , help='broker-addr is in the form: [username/password@] hostname | ip-address [:<port>] \n ex: localhost, 10.1.1.7:10000, broker-host:10000, guest/guest@localhost')
- p.add_option('--filter','-f' ,default=None ,help='a list of comma separated queue names (regex are accepted) to show')
-
- options, arguments = p.parse_args()
-
- host = options.broker_address
- filter = []
- if options.filter != None:
- for s in options.filter.split(","):
- filter.append(re.compile(s))
-
- bm = BrokerManager(host)
- bm.setFilter(filter)
- bm.Display()
-
-if __name__ == '__main__':
- main()
-
diff --git a/M4-RCs/qpid/python/commands/qpid-route b/M4-RCs/qpid/python/commands/qpid-route
deleted file mode 100755
index e0e655683a..0000000000
--- a/M4-RCs/qpid/python/commands/qpid-route
+++ /dev/null
@@ -1,514 +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 getopt
-import sys
-import socket
-import os
-import locale
-from qmf.console import Session, BrokerURL
-
-def Usage():
- print "Usage: qpid-route [OPTIONS] dynamic add <dest-broker> <src-broker> <exchange> [tag] [exclude-list]"
- print " qpid-route [OPTIONS] dynamic del <dest-broker> <src-broker> <exchange>"
- print
- print " qpid-route [OPTIONS] route add <dest-broker> <src-broker> <exchange> <routing-key> [tag] [exclude-list]"
- print " qpid-route [OPTIONS] route del <dest-broker> <src-broker> <exchange> <routing-key>"
- print " qpid-route [OPTIONS] queue add <dest-broker> <src-broker> <exchange> <queue>"
- print " qpid-route [OPTIONS] queue del <dest-broker> <src-broker> <exchange> <queue>"
- print " qpid-route [OPTIONS] route list [<dest-broker>]"
- print " qpid-route [OPTIONS] route flush [<dest-broker>]"
- print " qpid-route [OPTIONS] route map [<broker>]"
- print
- print " qpid-route [OPTIONS] link add <dest-broker> <src-broker>"
- print " qpid-route [OPTIONS] link del <dest-broker> <src-broker>"
- print " qpid-route [OPTIONS] link list [<dest-broker>]"
- print
- print "Options:"
- print " -v [ --verbose ] Verbose output"
- print " -q [ --quiet ] Quiet output, don't print duplicate warnings"
- print " -d [ --durable ] Added configuration shall be durable"
- print " -e [ --del-empty-link ] Delete link after deleting last route on the link"
- print " -s [ --src-local ] Make connection to source broker (push route)"
- print " -t <transport> [ --transport <transport>]"
- print " Specify transport to use for links, defaults to tcp"
- print
- print " dest-broker and src-broker are in the form: [username/password@] hostname | ip-address [:<port>]"
- print " ex: localhost, 10.1.1.7:10000, broker-host:10000, guest/guest@localhost"
- print
- sys.exit(1)
-
-_verbose = False
-_quiet = False
-_durable = False
-_dellink = False
-_srclocal = False
-_transport = "tcp"
-
-class RouteManager:
- def __init__(self, localBroker):
- self.local = BrokerURL(localBroker)
- self.remote = None
- self.qmf = Session()
- self.broker = self.qmf.addBroker(localBroker)
-
- def disconnect(self):
- self.qmf.delBroker(self.broker)
-
- def getLink(self):
- links = self.qmf.getObjects(_class="link")
- for link in links:
- if self.remote.match(link.host, link.port):
- return link
- return None
-
- def addLink(self, remoteBroker):
- self.remote = BrokerURL(remoteBroker)
- if self.local.match(self.remote.host, self.remote.port):
- raise Exception("Linking broker to itself is not permitted")
-
- brokers = self.qmf.getObjects(_class="broker")
- broker = brokers[0]
- link = self.getLink()
- if link == None:
- if self.remote.authName == "anonymous":
- mech = "ANONYMOUS"
- else:
- mech = "PLAIN"
- res = broker.connect(self.remote.host, self.remote.port, _durable,
- mech, self.remote.authName, self.remote.authPass,
- _transport)
- if _verbose:
- print "Connect method returned:", res.status, res.text
-
- def delLink(self, remoteBroker):
- self.remote = BrokerURL(remoteBroker)
- brokers = self.qmf.getObjects(_class="broker")
- broker = brokers[0]
- link = self.getLink()
- if link == None:
- raise Exception("Link not found")
-
- res = link.close()
- if _verbose:
- print "Close method returned:", res.status, res.text
-
- def listLinks(self):
- links = self.qmf.getObjects(_class="link")
- if len(links) == 0:
- print "No Links Found"
- else:
- print
- print "Host Port Transport Durable State Last Error"
- print "============================================================================="
- for link in links:
- print "%-16s%-8d%-13s%c %-18s%s" % \
- (link.host, link.port, link.transport, YN(link.durable), link.state, link.lastError)
-
- def mapRoutes(self):
- qmf = self.qmf
- print
- print "Finding Linked Brokers:"
-
- brokerList = {}
- brokerList[self.local.name()] = self.broker
- print " %s... Ok" % self.local
-
- added = True
- while added:
- added = False
- links = qmf.getObjects(_class="link")
- for link in links:
- url = BrokerURL("%s:%d" % (link.host, link.port))
- if url.name() not in brokerList:
- print " %s..." % url.name(),
- try:
- b = qmf.addBroker("%s:%d" % (link.host, link.port))
- brokerList[url.name()] = b
- added = True
- print "Ok"
- except Exception, e:
- print e
-
- print
- print "Dynamic Routes:"
- bridges = qmf.getObjects(_class="bridge", dynamic=True)
- fedExchanges = []
- for bridge in bridges:
- if bridge.src not in fedExchanges:
- fedExchanges.append(bridge.src)
- if len(fedExchanges) == 0:
- print " none found"
- print
-
- for ex in fedExchanges:
- print " Exchange %s:" % ex
- pairs = []
- for bridge in bridges:
- if bridge.src == ex:
- link = bridge._linkRef_
- fromUrl = "%s:%s" % (link.host, link.port)
- toUrl = bridge.getBroker().getUrl()
- found = False
- for pair in pairs:
- if pair.matches(fromUrl, toUrl):
- found = True
- if not found:
- pairs.append(RoutePair(fromUrl, toUrl))
- for pair in pairs:
- print " %s" % pair
- print
-
- print "Static Routes:"
- bridges = qmf.getObjects(_class="bridge", dynamic=False)
- if len(bridges) == 0:
- print " none found"
- print
-
- for bridge in bridges:
- link = bridge._linkRef_
- fromUrl = "%s:%s" % (link.host, link.port)
- toUrl = bridge.getBroker().getUrl()
- leftType = "ex"
- rightType = "ex"
- if bridge.srcIsLocal:
- arrow = "=>"
- left = bridge.src
- right = bridge.dest
- if bridge.srcIsQueue:
- leftType = "queue"
- else:
- arrow = "<="
- left = bridge.dest
- right = bridge.src
- if bridge.srcIsQueue:
- rightType = "queue"
-
- if bridge.srcIsQueue:
- print " %s(%s=%s) %s %s(%s=%s)" % \
- (toUrl, leftType, left, arrow, fromUrl, rightType, right)
- else:
- print " %s(%s=%s) %s %s(%s=%s) key=%s" % \
- (toUrl, leftType, left, arrow, fromUrl, rightType, right, bridge.key)
- print
-
- for broker in brokerList:
- if broker != self.local.name():
- qmf.delBroker(brokerList[broker])
-
-
- def addRoute(self, remoteBroker, exchange, routingKey, tag, excludes, dynamic=False):
- if dynamic and _srclocal:
- raise Exception("--src-local is not permitted on dynamic routes")
-
- self.addLink(remoteBroker)
- link = self.getLink()
- if link == None:
- raise Exception("Link failed to create")
-
- bridges = self.qmf.getObjects(_class="bridge")
- for bridge in bridges:
- if bridge.linkRef == link.getObjectId() and \
- bridge.dest == exchange and bridge.key == routingKey and not bridge.srcIsQueue:
- if not _quiet:
- raise Exception("Duplicate Route - ignoring: %s(%s)" % (exchange, routingKey))
- sys.exit(0)
-
- if _verbose:
- print "Creating inter-broker binding..."
- res = link.bridge(_durable, exchange, exchange, routingKey, tag, excludes, False, _srclocal, dynamic)
- if res.status != 0:
- raise Exception(res.text)
- if _verbose:
- print "Bridge method returned:", res.status, res.text
-
- def addQueueRoute(self, remoteBroker, exchange, queue):
- self.addLink(remoteBroker)
- link = self.getLink()
- if link == None:
- raise Exception("Link failed to create")
-
- bridges = self.qmf.getObjects(_class="bridge")
- for bridge in bridges:
- if bridge.linkRef == link.getObjectId() and \
- bridge.dest == exchange and bridge.src == queue and bridge.srcIsQueue:
- if not _quiet:
- raise Exception("Duplicate Route - ignoring: %s(%s)" % (exchange, queue))
- sys.exit(0)
-
- if _verbose:
- print "Creating inter-broker binding..."
- res = link.bridge(_durable, queue, exchange, "", "", "", True, _srclocal, False)
- if res.status != 0:
- raise Exception(res.text)
- if _verbose:
- print "Bridge method returned:", res.status, res.text
-
- def delQueueRoute(self, remoteBroker, exchange, queue):
- self.remote = BrokerURL(remoteBroker)
- link = self.getLink()
- if link == None:
- if not _quiet:
- raise Exception("No link found from %s to %s" % (self.remote.name(), self.local.name()))
- sys.exit(0)
-
- bridges = self.qmf.getObjects(_class="bridge")
- for bridge in bridges:
- if bridge.linkRef == link.getObjectId() and \
- bridge.dest == exchange and bridge.src == queue and bridge.srcIsQueue:
- if _verbose:
- print "Closing bridge..."
- res = bridge.close()
- if res.status != 0:
- raise Exception("Error closing bridge: %d - %s" % (res.status, res.text))
- if len(bridges) == 1 and _dellink:
- link = self.getLink()
- if link == None:
- sys.exit(0)
- if _verbose:
- print "Last bridge on link, closing link..."
- res = link.close()
- if res.status != 0:
- raise Exception("Error closing link: %d - %s" % (res.status, res.text))
- sys.exit(0)
- if not _quiet:
- raise Exception("Route not found")
-
- def delRoute(self, remoteBroker, exchange, routingKey, dynamic=False):
- self.remote = BrokerURL(remoteBroker)
- link = self.getLink()
- if link == None:
- if not _quiet:
- raise Exception("No link found from %s to %s" % (self.remote.name(), self.local.name()))
- sys.exit(0)
-
- bridges = self.qmf.getObjects(_class="bridge")
- for bridge in bridges:
- if bridge.linkRef == link.getObjectId() and bridge.dest == exchange and bridge.key == routingKey \
- and bridge.dynamic == dynamic:
- if _verbose:
- print "Closing bridge..."
- res = bridge.close()
- if res.status != 0:
- raise Exception("Error closing bridge: %d - %s" % (res.status, res.text))
- if len(bridges) == 1 and _dellink:
- link = self.getLink()
- if link == None:
- sys.exit(0)
- if _verbose:
- print "Last bridge on link, closing link..."
- res = link.close()
- if res.status != 0:
- raise Exception("Error closing link: %d - %s" % (res.status, res.text))
- sys.exit(0)
- if not _quiet:
- raise Exception("Route not found")
-
- def listRoutes(self):
- links = self.qmf.getObjects(_class="link")
- bridges = self.qmf.getObjects(_class="bridge")
-
- for bridge in bridges:
- myLink = None
- for link in links:
- if bridge.linkRef == link.getObjectId():
- myLink = link
- break
- if myLink != None:
- if bridge.dynamic:
- keyText = "<dynamic>"
- else:
- keyText = bridge.key
- print "%s %s:%d %s %s" % (self.local.name(), myLink.host, myLink.port, bridge.dest, keyText)
-
- def clearAllRoutes(self):
- links = self.qmf.getObjects(_class="link")
- bridges = self.qmf.getObjects(_class="bridge")
-
- for bridge in bridges:
- if _verbose:
- myLink = None
- for link in links:
- if bridge.linkRef == link.getObjectId():
- myLink = link
- break
- if myLink != None:
- print "Deleting Bridge: %s:%d %s %s... " % (myLink.host, myLink.port, bridge.dest, bridge.key),
- res = bridge.close()
- if res.status != 0:
- print "Error: %d - %s" % (res.status, res.text)
- elif _verbose:
- print "Ok"
-
- if _dellink:
- links = self.qmf.getObjects(_class="link")
- for link in links:
- if _verbose:
- print "Deleting Link: %s:%d... " % (link.host, link.port),
- res = link.close()
- if res.status != 0:
- print "Error: %d - %s" % (res.status, res.text)
- elif _verbose:
- print "Ok"
-
-class RoutePair:
- def __init__(self, fromUrl, toUrl):
- self.fromUrl = fromUrl
- self.toUrl = toUrl
- self.bidir = False
-
- def __repr__(self):
- if self.bidir:
- delimit = "<=>"
- else:
- delimit = " =>"
- return "%s %s %s" % (self.fromUrl, delimit, self.toUrl)
-
- def matches(self, fromUrl, toUrl):
- if fromUrl == self.fromUrl and toUrl == self.toUrl:
- return True
- if toUrl == self.fromUrl and fromUrl == self.toUrl:
- self.bidir = True
- return True
- return False
-
-
-def YN(val):
- if val == 1:
- return 'Y'
- return 'N'
-
-##
-## Main Program
-##
-
-try:
- longOpts = ("verbose", "quiet", "durable", "del-empty-link", "src-local", "transport=")
- (optlist, encArgs) = getopt.gnu_getopt(sys.argv[1:], "vqdest:", longOpts)
-except:
- Usage()
-
-try:
- encoding = locale.getpreferredencoding()
- cargs = [a.decode(encoding) for a in encArgs]
-except:
- cargs = encArgs
-
-for opt in optlist:
- if opt[0] == "-v" or opt[0] == "--verbose":
- _verbose = True
- if opt[0] == "-q" or opt[0] == "--quiet":
- _quiet = True
- if opt[0] == "-d" or opt[0] == "--durable":
- _durable = True
- if opt[0] == "-e" or opt[0] == "--del-empty-link":
- _dellink = True
- if opt[0] == "-s" or opt[0] == "--src-local":
- _srclocal = True
- if opt[0] == "-t" or opt[0] == "--transport":
- _transport = opt[1]
-
-nargs = len(cargs)
-if nargs < 2:
- Usage()
-if nargs == 2:
- localBroker = "localhost"
-else:
- if _srclocal:
- localBroker = cargs[3]
- remoteBroker = cargs[2]
- else:
- localBroker = cargs[2]
- if nargs > 3:
- remoteBroker = cargs[3]
-
-group = cargs[0]
-cmd = cargs[1]
-
-try:
- rm = RouteManager(localBroker)
- if group == "link":
- if cmd == "add":
- if nargs != 4:
- Usage()
- rm.addLink(remoteBroker)
- elif cmd == "del":
- if nargs != 4:
- Usage()
- rm.delLink(remoteBroker)
- elif cmd == "list":
- rm.listLinks()
-
- elif group == "dynamic":
- if cmd == "add":
- if nargs < 5 or nargs > 7:
- Usage()
-
- tag = ""
- excludes = ""
- if nargs > 5: tag = cargs[5]
- if nargs > 6: excludes = cargs[6]
- rm.addRoute(remoteBroker, cargs[4], "", tag, excludes, dynamic=True)
- elif cmd == "del":
- if nargs != 5:
- Usage()
- else:
- rm.delRoute(remoteBroker, cargs[4], "", dynamic=True)
-
- elif group == "route":
- if cmd == "add":
- if nargs < 6 or nargs > 8:
- Usage()
-
- tag = ""
- excludes = ""
- if nargs > 6: tag = cargs[6]
- if nargs > 7: excludes = cargs[7]
- rm.addRoute(remoteBroker, cargs[4], cargs[5], tag, excludes, dynamic=False)
- elif cmd == "del":
- if nargs != 6:
- Usage()
- rm.delRoute(remoteBroker, cargs[4], cargs[5], dynamic=False)
- elif cmd == "map":
- rm.mapRoutes()
- else:
- if cmd == "list":
- rm.listRoutes()
- elif cmd == "flush":
- rm.clearAllRoutes()
- else:
- Usage()
-
- elif group == "queue":
- if nargs != 6:
- Usage()
- if cmd == "add":
- rm.addQueueRoute(remoteBroker, exchange=cargs[4], queue=cargs[5])
- elif cmd == "del":
- rm.delQueueRoute(remoteBroker, exchange=cargs[4], queue=cargs[5])
- else:
- Usage()
-
-except Exception,e:
- print "Failed:", e.args
- sys.exit(1)
-
-rm.disconnect()
diff --git a/M4-RCs/qpid/python/commands/qpid-tool b/M4-RCs/qpid/python/commands/qpid-tool
deleted file mode 100755
index 14308f69fb..0000000000
--- a/M4-RCs/qpid/python/commands/qpid-tool
+++ /dev/null
@@ -1,195 +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 getopt
-import sys
-import socket
-from cmd import Cmd
-from qpid.connection import ConnectionFailed
-from qpid.managementdata import ManagementData
-from shlex import split
-from qpid.disp import Display
-from qpid.peer import Closed
-
-class Mcli (Cmd):
- """ Management Command Interpreter """
-
- def __init__ (self, dataObject, dispObject):
- Cmd.__init__ (self)
- self.dataObject = dataObject
- self.dispObject = dispObject
- self.dataObject.setCli (self)
- self.prompt = "qpid: "
-
- def emptyline (self):
- pass
-
- def setPromptMessage (self, p):
- if p == None:
- self.prompt = "qpid: "
- else:
- self.prompt = "qpid[%s]: " % p
-
- def do_help (self, data):
- print "Management Tool for QPID"
- print
- print "Commands:"
- print " list - Print summary of existing objects by class"
- print " list <className> - Print list of objects of the specified class"
- print " list <className> active - Print list of non-deleted objects of the specified class"
- print " show <className> - Print contents of all objects of specified class"
- print " show <className> active - Print contents of all non-deleted objects of specified class"
- print " show <list-of-IDs> - Print contents of one or more objects (infer className)"
- print " show <className> <list-of-IDs> - Print contents of one or more objects"
- print " list is space-separated, ranges may be specified (i.e. 1004-1010)"
- print " call <ID> <methodName> [<args>] - Invoke a method on an object"
- print " schema - Print summary of object classes seen on the target"
- print " schema <className> - Print details of an object class"
- print " set time-format short - Select short timestamp format (default)"
- print " set time-format long - Select long timestamp format"
- print " id [<ID>] - Display translations of display object ids"
- print " quit or ^D - Exit the program"
- print
-
- def complete_set (self, text, line, begidx, endidx):
- """ Command completion for the 'set' command """
- tokens = split (line)
- if len (tokens) < 2:
- return ["time-format "]
- elif tokens[1] == "time-format":
- if len (tokens) == 2:
- return ["long", "short"]
- elif len (tokens) == 3:
- if "long".find (text) == 0:
- return ["long"]
- elif "short".find (text) == 0:
- return ["short"]
- elif "time-format".find (text) == 0:
- return ["time-format "]
- return []
-
- def do_set (self, data):
- tokens = split (data)
- try:
- if tokens[0] == "time-format":
- self.dispObject.do_setTimeFormat (tokens[1])
- except:
- pass
-
- def do_id (self, data):
- self.dataObject.do_id(data)
-
- def complete_schema (self, text, line, begidx, endidx):
- tokens = split (line)
- if len (tokens) > 2:
- return []
- return self.dataObject.classCompletions (text)
-
- def do_schema (self, data):
- self.dataObject.do_schema (data)
-
- def complete_list (self, text, line, begidx, endidx):
- tokens = split (line)
- if len (tokens) > 2:
- return []
- return self.dataObject.classCompletions (text)
-
- def do_list (self, data):
- self.dataObject.do_list (data)
-
- def do_show (self, data):
- self.dataObject.do_show (data)
-
- def do_call (self, data):
- try:
- self.dataObject.do_call (data)
- except ValueError, e:
- print "ValueError:", e
-
- def do_EOF (self, data):
- print "quit"
- try:
- self.dataObject.do_exit ()
- except:
- pass
- return True
-
- def do_quit (self, data):
- try:
- self.dataObject.do_exit ()
- except:
- pass
- return True
-
- def postcmd (self, stop, line):
- return stop
-
- def postloop (self):
- print "Exiting..."
- self.dataObject.close ()
-
-def Usage ():
- print "Usage: qpid-tool [[<username>/<password>@]<target-host>[:<tcp-port>]]"
- print
- sys.exit (1)
-
-#=========================================================
-# Main Program
-#=========================================================
-
-# Get host name and port if specified on the command line
-cargs = sys.argv[1:]
-_host = "localhost"
-
-if len (cargs) > 0:
- _host = cargs[0]
-
-if _host[0] == '-':
- Usage()
-
-disp = Display ()
-
-# Attempt to make a connection to the target broker
-try:
- data = ManagementData (disp, _host)
-except socket.error, e:
- print "Socket Error (%s):" % _host, e[1]
- sys.exit (1)
-except IOError, e:
- print "IOError: %d - %s: %s" % (e.errno, e.strerror, e.filename)
- sys.exit (1)
-except ConnectionFailed, e:
- print "Connect Failed %d - %s" % (e[0], e[1])
- sys.exit(1)
-except Exception, e:
- if str(e).find ("Exchange not found") != -1:
- print "Management not enabled on broker: Use '-m yes' option on broker startup."
- sys.exit(1)
-
-# Instantiate the CLI interpreter and launch it.
-cli = Mcli (data, disp)
-print ("Management Tool for QPID")
-try:
- cli.cmdloop ()
-except Closed, e:
- print "Connection to Broker Lost:", e
- sys.exit (1)
diff --git a/M4-RCs/qpid/python/cpp_failing_0-10.txt b/M4-RCs/qpid/python/cpp_failing_0-10.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/M4-RCs/qpid/python/cpp_failing_0-10.txt
+++ /dev/null
diff --git a/M4-RCs/qpid/python/cpp_failing_0-8.txt b/M4-RCs/qpid/python/cpp_failing_0-8.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/M4-RCs/qpid/python/cpp_failing_0-8.txt
+++ /dev/null
diff --git a/M4-RCs/qpid/python/cpp_failing_0-9.txt b/M4-RCs/qpid/python/cpp_failing_0-9.txt
deleted file mode 100644
index 06c31080fb..0000000000
--- a/M4-RCs/qpid/python/cpp_failing_0-9.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-tests_0-9.message.MessageTests.test_checkpoint
-tests_0-9.message.MessageTests.test_reject
-tests_0-9.basic.BasicTests.test_get
-
diff --git a/M4-RCs/qpid/python/doc/test-requirements.txt b/M4-RCs/qpid/python/doc/test-requirements.txt
deleted file mode 100644
index 5089b49dbe..0000000000
--- a/M4-RCs/qpid/python/doc/test-requirements.txt
+++ /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.
-###############################################################################
-
- * start and stop server, possibly in different configurations, should
- at least be able to specify host and port
-
- * initiate multiple connections/server
-
- * initiate multiple channels/connection
-
- * enable positive and negative tests for any protocol interaction
-
- * test harness must be as robust as possible to spec changes
diff --git a/M4-RCs/qpid/python/examples/direct/declare_queues.py b/M4-RCs/qpid/python/examples/direct/declare_queues.py
deleted file mode 100755
index 13818ee9d7..0000000000
--- a/M4-RCs/qpid/python/examples/direct/declare_queues.py
+++ /dev/null
@@ -1,76 +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.
-#
-"""
- declare_queues.py
-
- Creates and binds a queue on an AMQP direct exchange.
-
- All messages using the routing key "routing_key" are
- sent to the queue named "message_queue".
-"""
-
-# Common includes
-
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-#----- Initialization -----------------------------------
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-#----- Create a queue -------------------------------------
-
-# queue_declare() creates an AMQP queue, which is held
-# on the broker. Published messages are sent to the AMQP queue,
-# from which messages are delivered to consumers.
-#
-# exchange_bind() determines which messages are routed to a queue.
-# Route all messages with the binding key "routing_key" to
-# the AMQP queue named "message_queue".
-
-session.queue_declare(queue="message_queue")
-session.exchange_bind(exchange="amq.direct", queue="message_queue", binding_key="routing_key")
-
-#----- Cleanup ---------------------------------------------
-
-session.close(timeout=10)
diff --git a/M4-RCs/qpid/python/examples/direct/direct_consumer.py b/M4-RCs/qpid/python/examples/direct/direct_consumer.py
deleted file mode 100755
index b07e53c5c7..0000000000
--- a/M4-RCs/qpid/python/examples/direct/direct_consumer.py
+++ /dev/null
@@ -1,94 +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.
-#
-"""
- direct_consumer.py
-
- This AMQP client reads messages from a message
- queue named "message_queue".
-"""
-
-import qpid
-import sys
-import os
-from random import randint
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-
-#----- Initialization --------------------------------------
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-#----- Read from queue --------------------------------------------
-
-# Now let's create a local client queue and tell it to read
-# incoming messages.
-
-# The consumer tag identifies the client-side queue.
-
-local_queue_name = "local_queue"
-queue = session.incoming(local_queue_name)
-
-# Call message_subscribe() to tell the broker to deliver messages
-# from the AMQP queue to this local client queue. The broker will
-# start delivering messages as soon as credit is allocated using
-# queue.start().
-
-session.message_subscribe(queue="message_queue", destination=local_queue_name)
-queue.start()
-
-# Initialize 'final' and 'content', variables used to identify the last message.
-
-final = "That's all, folks!" # In a message body, signals the last message
-content = "" # Content of the last message read
-
-message = None
-while content != final:
- message = queue.get(timeout=10)
- content = message.body
- session.message_accept(RangedSet(message.id))
- print content
-
-#----- Cleanup ------------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-#
-
-session.close(timeout=10)
diff --git a/M4-RCs/qpid/python/examples/direct/direct_producer.py b/M4-RCs/qpid/python/examples/direct/direct_producer.py
deleted file mode 100755
index fcbb4675e4..0000000000
--- a/M4-RCs/qpid/python/examples/direct/direct_producer.py
+++ /dev/null
@@ -1,73 +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.
-#
-"""
- direct_producer.py
-
- Publishes messages to an AMQP direct exchange, using
- the routing key "routing_key"
-"""
-
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message
-from qpid.datatypes import uuid4
-from qpid.queue import Empty
-
-
-#----- Initialization -----------------------------------
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-#----- Publish some messages ------------------------------
-
-# Create some messages and put them on the broker.
-props = session.delivery_properties(routing_key="routing_key")
-
-for i in range(10):
- session.message_transfer(destination="amq.direct", message=Message(props,"message " + str(i)))
-
-session.message_transfer(destination="amq.direct", message=Message(props,"That's all, folks!"))
-
-#----- Cleanup --------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-
-session.close(timeout=10)
diff --git a/M4-RCs/qpid/python/examples/direct/listener.py b/M4-RCs/qpid/python/examples/direct/listener.py
deleted file mode 100755
index 9d06bd3929..0000000000
--- a/M4-RCs/qpid/python/examples/direct/listener.py
+++ /dev/null
@@ -1,109 +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.
-#
-"""
- listener.py
-
- This AMQP client reads messages from a message
- queue named "message_queue". It is implemented
- as a message listener.
-"""
-
-# Common includes
-
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-# Includes specific to this example
-
-from time import sleep
-
-
-#----- Message Receive Handler -----------------------------
-class Receiver:
- def __init__ (self):
- self.finalReceived = False
-
- def isFinal (self):
- return self.finalReceived
-
- def Handler (self, message):
- content = message.body
- session.message_accept(RangedSet(message.id))
- print content
- if content == "That's all, folks!":
- self.finalReceived = True
-
-#----- Initialization --------------------------------------
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-#----- Read from queue --------------------------------------------
-
-# Now let's create a local client queue and tell it to read
-# incoming messages.
-
-# The local_queue_name identifies the client-side queue.
-
-local_queue_name = "local_queue"
-queue = session.incoming(local_queue_name)
-
-# Call message_subscribe() to tell the broker to deliver messages
-# from the AMQP queue to this local client queue. The broker will
-# start delivering messages as soon as message_subscribe() is called.
-
-session.message_subscribe(queue="message_queue", destination=local_queue_name)
-queue.start()
-
-receiver = Receiver()
-queue.listen (receiver.Handler)
-
-while not receiver.isFinal() :
- sleep (1)
-
-
-#----- Cleanup ------------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-#
-
-session.close(timeout=10)
diff --git a/M4-RCs/qpid/python/examples/direct/verify b/M4-RCs/qpid/python/examples/direct/verify
deleted file mode 100644
index 92f87bf827..0000000000
--- a/M4-RCs/qpid/python/examples/direct/verify
+++ /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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-clients ./declare_queues.py ./direct_producer.py ./direct_consumer.py
-outputs ./declare_queues.py.out ./direct_producer.py.out ./direct_consumer.py.out
diff --git a/M4-RCs/qpid/python/examples/direct/verify.in b/M4-RCs/qpid/python/examples/direct/verify.in
deleted file mode 100644
index 5e691619d9..0000000000
--- a/M4-RCs/qpid/python/examples/direct/verify.in
+++ /dev/null
@@ -1,14 +0,0 @@
-==== declare_queues.py.out
-==== direct_producer.py.out
-==== direct_consumer.py.out
-message 0
-message 1
-message 2
-message 3
-message 4
-message 5
-message 6
-message 7
-message 8
-message 9
-That's all, folks!
diff --git a/M4-RCs/qpid/python/examples/fanout/fanout_consumer.py b/M4-RCs/qpid/python/examples/fanout/fanout_consumer.py
deleted file mode 100755
index 0452baa8da..0000000000
--- a/M4-RCs/qpid/python/examples/fanout/fanout_consumer.py
+++ /dev/null
@@ -1,99 +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.
-#
-"""
- fanout_consumer.py
-
- This AMQP client reads messages from a message
- queue named "message_queue".
-"""
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-#----- Initialization --------------------------------------
-
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-
-#----- Main Body -------------------------------------------
-
-# Create a server-side queue and route messages to it.
-# The server-side queue must have a unique name. Use the
-# session id for that.
-server_queue_name = session.name
-session.queue_declare(queue=server_queue_name)
-session.exchange_bind(queue=server_queue_name, exchange="amq.fanout")
-
-# Create a local queue to receive messages from the server-side
-# queue.
-local_queue_name = "local_queue"
-local_queue = session.incoming(local_queue_name)
-
-# Call message_subscribe() to tell the server to deliver messages
-# from the AMQP queue to this local client queue.
-
-session.message_subscribe(queue=server_queue_name, destination=local_queue_name)
-local_queue.start()
-
-print "Subscribed to queue " + server_queue_name
-sys.stdout.flush()
-
-# Initialize 'final' and 'content', variables used to identify the last message.
-final = "That's all, folks!" # In a message body, signals the last message
-content = "" # Content of the last message read
-
-# Read the messages - acknowledge each one
-message = None
-while content != final:
- message = local_queue.get(timeout=10)
- content = message.body
- session.message_accept(RangedSet(message.id))
- print content
-
-
-#----- Cleanup ------------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-#
-
-session.close(timeout=10)
diff --git a/M4-RCs/qpid/python/examples/fanout/fanout_producer.py b/M4-RCs/qpid/python/examples/fanout/fanout_producer.py
deleted file mode 100755
index c4df252c70..0000000000
--- a/M4-RCs/qpid/python/examples/fanout/fanout_producer.py
+++ /dev/null
@@ -1,72 +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.
-#
-"""
- fanout_producer.py
-
- Publishes messages to an AMQP direct exchange, using
- the routing key "routing_key"
-"""
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, uuid4
-from qpid.queue import Empty
-
-#----- Initialization -----------------------------------
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-
-#----- Publish some messages ------------------------------
-
-# Create some messages and put them on the broker.
-
-delivery_properties = session.delivery_properties(routing_key="routing_key")
-
-for i in range(10):
- session.message_transfer(destination="amq.fanout", message=Message(delivery_properties,"message " + str(i)))
-
-session.message_transfer(destination="amq.fanout", message=Message(delivery_properties, "That's all, folks!"))
-
-#----- Cleanup --------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-
-session.close(timeout=10)
diff --git a/M4-RCs/qpid/python/examples/fanout/listener.py b/M4-RCs/qpid/python/examples/fanout/listener.py
deleted file mode 100755
index 29db402e9d..0000000000
--- a/M4-RCs/qpid/python/examples/fanout/listener.py
+++ /dev/null
@@ -1,117 +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.
-#
-"""
- listener.py
-
- This AMQP client reads messages from a message
- queue named "message_queue".
-"""
-
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-#
-
-from time import sleep
-
-#----- Message Receive Handler -----------------------------
-class Receiver:
- def __init__ (self):
- self.finalReceived = False
-
- def isFinal (self):
- return self.finalReceived
-
- def Handler (self, message):
- content = message.body
- session.message_accept(RangedSet(message.id))
- print content
- if content == "That's all, folks!":
- self.finalReceived = True
-
-
-#----- Initialization --------------------------------------
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-#----- Read from queue --------------------------------------------
-
-# Create a server-side queue and route messages to it.
-# The server-side queue must have a unique name. Use the
-# session id for that.
-
-server_queue_name = session.name
-session.queue_declare(queue=server_queue_name)
-session.exchange_bind(queue=server_queue_name, exchange="amq.fanout")
-
-# Create a local queue to receive messages from the server-side
-# queue.
-local_queue_name = "local_queue"
-local_queue = session.incoming(local_queue_name)
-
-
-# The local queue name identifies the client-side queue.
-
-local_queue_name = "local_queue"
-local_queue = session.incoming(local_queue_name)
-
-# Call message_subscribe() to tell the broker to deliver messages
-# from the AMQP queue to this local client queue. The broker will
-# start delivering messages as soon as local_queue.start() is called.
-
-session.message_subscribe(queue=server_queue_name, destination=local_queue_name)
-local_queue.start()
-
-receiver = Receiver ()
-local_queue.listen (receiver.Handler)
-
-while not receiver.isFinal ():
- sleep (1)
-
-
-#----- Cleanup ------------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-#
-
-session.close()
diff --git a/M4-RCs/qpid/python/examples/fanout/verify b/M4-RCs/qpid/python/examples/fanout/verify
deleted file mode 100644
index 9e5c364bfa..0000000000
--- a/M4-RCs/qpid/python/examples/fanout/verify
+++ /dev/null
@@ -1,24 +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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-background "Subscribed" ./fanout_consumer.py
-background "Subscribed" ./fanout_consumer.py
-clients ./fanout_producer.py
-outputs ./fanout_producer.py.out "./fanout_consumer.py.out | remove_uuid" "./fanout_consumer.pyX.out | remove_uuid"
diff --git a/M4-RCs/qpid/python/examples/fanout/verify.in b/M4-RCs/qpid/python/examples/fanout/verify.in
deleted file mode 100644
index d4b8670de9..0000000000
--- a/M4-RCs/qpid/python/examples/fanout/verify.in
+++ /dev/null
@@ -1,27 +0,0 @@
-==== fanout_producer.py.out
-==== fanout_consumer.py.out | remove_uuid
-Subscribed to queue
-message 0
-message 1
-message 2
-message 3
-message 4
-message 5
-message 6
-message 7
-message 8
-message 9
-That's all, folks!
-==== fanout_consumer.pyX.out | remove_uuid
-Subscribed to queue
-message 0
-message 1
-message 2
-message 3
-message 4
-message 5
-message 6
-message 7
-message 8
-message 9
-That's all, folks!
diff --git a/M4-RCs/qpid/python/examples/pubsub/topic_publisher.py b/M4-RCs/qpid/python/examples/pubsub/topic_publisher.py
deleted file mode 100755
index b50d5fa8ca..0000000000
--- a/M4-RCs/qpid/python/examples/pubsub/topic_publisher.py
+++ /dev/null
@@ -1,92 +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.
-#
-"""
- topic_publisher.py
-
- This is a simple AMQP publisher application that uses a
- Topic exchange. The publisher specifies the routing key
- and the exchange for each message.
-"""
-
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-#----- Functions ----------------------------------------
-
-def send_msg(routing_key):
- props = session.delivery_properties(routing_key=routing_key)
- for i in range(5):
- session.message_transfer(destination="amq.topic", message=Message(props,routing_key + " " + str(i)))
-
-#----- Initialization -----------------------------------
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket)
-connection.start()
-session = connection.session(str(uuid4()))
-
-#----- Publish some messages ------------------------------
-
-# Create some messages and put them on the broker. Use the
-# topic exchange. The routing keys are "usa.news", "usa.weather",
-# "europe.news", and "europe.weather".
-
-# usa.news
-send_msg("usa.news")
-
-# usa.weather
-send_msg("usa.weather")
-
-# europe.news
-send_msg("europe.news")
-
-# europe.weather
-send_msg("europe.weather")
-
-# Signal termination
-props = session.delivery_properties(routing_key="control")
-session.message_transfer(destination="amq.topic", message=Message(props,"That's all, folks!"))
-
-
-#----- Cleanup --------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-
-session.close(timeout=10)
diff --git a/M4-RCs/qpid/python/examples/pubsub/topic_subscriber.py b/M4-RCs/qpid/python/examples/pubsub/topic_subscriber.py
deleted file mode 100755
index 489c7cbb19..0000000000
--- a/M4-RCs/qpid/python/examples/pubsub/topic_subscriber.py
+++ /dev/null
@@ -1,154 +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.
-#
-"""
- topic_subscriber.py
-
- This subscriber creates private queues and binds them
- to the topics 'usa.#', 'europe.#', '#.news', and '#.weather'.
-"""
-
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-#----- Functions -------------------------------------------
-
-def dump_queue(queue):
-
- content = "" # Content of the last message read
- final = "That's all, folks!" # In a message body, signals the last message
- message = 0
-
- while content != final:
- try:
- message = queue.get(timeout=10)
- content = message.body
- session.message_accept(RangedSet(message.id))
- print content
- except Empty:
- print "No more messages!"
- return
-
-
-
-def subscribe_queue(server_queue_name, local_queue_name):
-
- print "Subscribing local queue '" + local_queue_name + "' to " + server_queue_name + "'"
-
- queue = session.incoming(local_queue_name)
-
- session.message_subscribe(queue=server_queue_name, destination=local_queue_name)
- queue.start()
-
- return queue
-
-#----- Initialization --------------------------------------
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-#----- Main Body -- ----------------------------------------
-
-# declare queues on the server
-
-news = "news-" + session.name
-weather = "weather-" + session.name
-usa = "usa-" + session.name
-europe = "europe-" + session.name
-
-session.queue_declare(queue=news, exclusive=True)
-session.queue_declare(queue=weather, exclusive=True)
-session.queue_declare(queue=usa, exclusive=True)
-session.queue_declare(queue=europe, exclusive=True)
-
-# Routing keys may be "usa.news", "usa.weather", "europe.news", or "europe.weather".
-
-# The '#' symbol matches one component of a multipart name, e.g. "#.news" matches
-# "europe.news" or "usa.news".
-
-session.exchange_bind(exchange="amq.topic", queue=news, binding_key="#.news")
-session.exchange_bind(exchange="amq.topic", queue=weather, binding_key="#.weather")
-session.exchange_bind(exchange="amq.topic", queue=usa, binding_key="usa.#")
-session.exchange_bind(exchange="amq.topic", queue=europe, binding_key="europe.#")
-
-# Bind each queue to the control queue so we know when to stop
-
-session.exchange_bind(exchange="amq.topic", queue=news, binding_key="control")
-session.exchange_bind(exchange="amq.topic", queue=weather, binding_key="control")
-session.exchange_bind(exchange="amq.topic", queue=usa, binding_key="control")
-session.exchange_bind(exchange="amq.topic", queue=europe, binding_key="control")
-
-# Remind the user to start the topic producer
-
-print "Queues created - please start the topic producer"
-sys.stdout.flush()
-
-# Subscribe local queues to server queues
-
-local_news = "local_news"
-local_weather = "local_weather"
-local_usa = "local_usa"
-local_europe = "local_europe"
-
-local_news_queue = subscribe_queue(news, local_news)
-local_weather_queue = subscribe_queue(weather, local_weather)
-local_usa_queue = subscribe_queue(usa, local_usa)
-local_europe_queue = subscribe_queue(europe, local_europe)
-
-# Call dump_queue to print messages from each queue
-
-print "Messages on 'news' queue:"
-dump_queue(local_news_queue)
-
-print "Messages on 'weather' queue:"
-dump_queue(local_weather_queue)
-
-print "Messages on 'usa' queue:"
-dump_queue(local_usa_queue)
-
-print "Messages on 'europe' queue:"
-dump_queue(local_europe_queue)
-
-#----- Cleanup ------------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-
-session.close(timeout=10)
diff --git a/M4-RCs/qpid/python/examples/pubsub/verify b/M4-RCs/qpid/python/examples/pubsub/verify
deleted file mode 100644
index cf1bade62e..0000000000
--- a/M4-RCs/qpid/python/examples/pubsub/verify
+++ /dev/null
@@ -1,23 +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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-background "Queues created" ./topic_subscriber.py
-clients ./topic_publisher.py
-outputs ./topic_publisher.py.out "topic_subscriber.py.out | remove_uuid | sort"
diff --git a/M4-RCs/qpid/python/examples/pubsub/verify.in b/M4-RCs/qpid/python/examples/pubsub/verify.in
deleted file mode 100644
index 1b74acd832..0000000000
--- a/M4-RCs/qpid/python/examples/pubsub/verify.in
+++ /dev/null
@@ -1,55 +0,0 @@
-==== topic_publisher.py.out
-==== topic_subscriber.py.out | remove_uuid | sort
-europe.news 0
-europe.news 0
-europe.news 1
-europe.news 1
-europe.news 2
-europe.news 2
-europe.news 3
-europe.news 3
-europe.news 4
-europe.news 4
-europe.weather 0
-europe.weather 0
-europe.weather 1
-europe.weather 1
-europe.weather 2
-europe.weather 2
-europe.weather 3
-europe.weather 3
-europe.weather 4
-europe.weather 4
-Messages on 'europe' queue:
-Messages on 'news' queue:
-Messages on 'usa' queue:
-Messages on 'weather' queue:
-Queues created - please start the topic producer
-Subscribing local queue 'local_europe' to europe-'
-Subscribing local queue 'local_news' to news-'
-Subscribing local queue 'local_usa' to usa-'
-Subscribing local queue 'local_weather' to weather-'
-That's all, folks!
-That's all, folks!
-That's all, folks!
-That's all, folks!
-usa.news 0
-usa.news 0
-usa.news 1
-usa.news 1
-usa.news 2
-usa.news 2
-usa.news 3
-usa.news 3
-usa.news 4
-usa.news 4
-usa.weather 0
-usa.weather 0
-usa.weather 1
-usa.weather 1
-usa.weather 2
-usa.weather 2
-usa.weather 3
-usa.weather 3
-usa.weather 4
-usa.weather 4
diff --git a/M4-RCs/qpid/python/examples/request-response/client.py b/M4-RCs/qpid/python/examples/request-response/client.py
deleted file mode 100755
index b29fcf3ea7..0000000000
--- a/M4-RCs/qpid/python/examples/request-response/client.py
+++ /dev/null
@@ -1,131 +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.
-#
-"""
- client.py
-
- Client for a client/server example
-
-"""
-
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-#----- Functions -------------------------------------------
-
-def dump_queue(queue_name):
-
- print "Messages on queue: " + queue_name
-
- message = 0
-
- while True:
- try:
- message = queue.get(timeout=10)
- content = message.body
- session.message_accept(RangedSet(message.id))
- print "Response: " + content
- except Empty:
- print "No more messages!"
- break
- except:
- print "Unexpected exception!"
- break
-
-
-#----- Initialization --------------------------------------
-
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-
-#----- Main Body -- ----------------------------------------
-
-# Create a response queue for the server to send responses to. Use the
-# same string as the name of the queue and the name of the routing
-# key.
-
-reply_to = "reply_to:" + session.name
-session.queue_declare(queue=reply_to, exclusive=True)
-session.exchange_bind(exchange="amq.direct", queue=reply_to, binding_key=reply_to)
-
-# Create a local queue and subscribe it to the response queue
-
-local_queue_name = "local_queue"
-queue = session.incoming(local_queue_name)
-
-# Call message_subscribe() to tell the broker to deliver messages from
-# the server's reply_to queue to our local client queue. The server
-# will start delivering messages as soon as message credit is
-# available.
-
-session.message_subscribe(queue=reply_to, destination=local_queue_name)
-queue.start()
-
-# Send some messages to the server's request queue
-
-lines = ["Twas brillig, and the slithy toves",
- "Did gyre and gimble in the wabe.",
- "All mimsy were the borogroves,",
- "And the mome raths outgrabe."]
-
-# We will use the same reply_to and routing key
-# for each message
-
-message_properties = session.message_properties()
-message_properties.reply_to = session.reply_to("amq.direct", reply_to)
-delivery_properties = session.delivery_properties(routing_key="request")
-
-for line in lines:
- print "Request: " + line
- session.message_transfer(destination="amq.direct", message=Message(message_properties, delivery_properties, line))
-
-# Now see what messages the server sent to our reply_to queue
-
-dump_queue(reply_to)
-
-
-#----- Cleanup ------------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-
-session.close(timeout=10)
diff --git a/M4-RCs/qpid/python/examples/request-response/server.py b/M4-RCs/qpid/python/examples/request-response/server.py
deleted file mode 100755
index a80c4541e4..0000000000
--- a/M4-RCs/qpid/python/examples/request-response/server.py
+++ /dev/null
@@ -1,110 +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.
-#
-"""
- server.py
-
- Server for a client/server example
-"""
-
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-#----- Functions -------------------------------------------
-def respond(session, request):
-
- # The routing key for the response is the request's reply-to
- # property. The body for the response is the request's body,
- # converted to upper case.
-
- message_properties = request.get("message_properties")
- reply_to = message_properties.reply_to
- if reply_to == None:
- raise Exception("This message is missing the 'reply_to' property, which is required")
-
- props = session.delivery_properties(routing_key=reply_to["routing_key"])
- session.message_transfer(destination=reply_to["exchange"], message=Message(props,request.body.upper()))
-
-#----- Initialization --------------------------------------
-
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-#----- Main Body -- ----------------------------------------
-
-# Create a request queue and subscribe to it
-
-session.queue_declare(queue="request", exclusive=True)
-session.exchange_bind(exchange="amq.direct", queue="request", binding_key="request")
-
-local_queue_name = "local_queue"
-
-session.message_subscribe(queue="request", destination=local_queue_name)
-
-queue = session.incoming(local_queue_name)
-queue.start()
-
-# Remind the user to start the client program
-
-print "Request server running - run your client now."
-print "(Times out after 100 seconds ...)"
-sys.stdout.flush()
-
-# Respond to each request
-
-# If we get a message, send it back to the user (as indicated in the
-# ReplyTo property)
-
-while True:
- try:
- request = queue.get(timeout=100)
- respond(session, request)
- session.message_accept(RangedSet(request.id))
- except Empty:
- print "No more messages!"
- break;
-
-
-#----- Cleanup ------------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-
-session.close(timeout=10)
diff --git a/M4-RCs/qpid/python/examples/request-response/verify b/M4-RCs/qpid/python/examples/request-response/verify
deleted file mode 100644
index 3c058febb2..0000000000
--- a/M4-RCs/qpid/python/examples/request-response/verify
+++ /dev/null
@@ -1,24 +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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-background "Request server running" ./server.py
-clients ./client.py
-kill %% # Must kill the server.
-outputs "./client.py.out | remove_uuid" " server.py.out | remove_uuid"
diff --git a/M4-RCs/qpid/python/examples/request-response/verify.in b/M4-RCs/qpid/python/examples/request-response/verify.in
deleted file mode 100644
index 4c31128975..0000000000
--- a/M4-RCs/qpid/python/examples/request-response/verify.in
+++ /dev/null
@@ -1,14 +0,0 @@
-==== client.py.out | remove_uuid
-Request: Twas brillig, and the slithy toves
-Request: Did gyre and gimble in the wabe.
-Request: All mimsy were the borogroves,
-Request: And the mome raths outgrabe.
-Messages on queue: reply_to:
-Response: TWAS BRILLIG, AND THE SLITHY TOVES
-Response: DID GYRE AND GIMBLE IN THE WABE.
-Response: ALL MIMSY WERE THE BOROGROVES,
-Response: AND THE MOME RATHS OUTGRABE.
-No more messages!
-==== server.py.out | remove_uuid
-Request server running - run your client now.
-(Times out after 100 seconds ...)
diff --git a/M4-RCs/qpid/python/examples/xml-exchange/declare_queues.py b/M4-RCs/qpid/python/examples/xml-exchange/declare_queues.py
deleted file mode 100755
index ca40af5dc5..0000000000
--- a/M4-RCs/qpid/python/examples/xml-exchange/declare_queues.py
+++ /dev/null
@@ -1,90 +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.
-#
-"""
- declare_queues.py
-
- Creates and binds a queue on an AMQP direct exchange.
-
- All messages using the routing key "routing_key" are
- sent to the queue named "message_queue".
-"""
-
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-#----- Initialization -----------------------------------
-
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-#----- Create a queue -------------------------------------
-
-# queue_declare() creates an AMQP queue, which is held
-# on the broker. Published messages are sent to the AMQP queue,
-# from which messages are delivered to consumers.
-#
-# queue_bind() determines which messages are routed to a queue.
-# Route all messages with the routing key "routing_key" to
-# the AMQP queue named "message_queue".
-
-session.exchange_declare(exchange="xml", type="xml")
-session.queue_declare(queue="message_queue")
-
-binding = {}
-binding["xquery"] = """
- let $w := ./weather
- return $w/station = 'Raleigh-Durham International Airport (KRDU)'
- and $w/temperature_f > 50
- and $w/temperature_f - $w/dewpoint > 5
- and $w/wind_speed_mph > 7
- and $w/wind_speed_mph < 20 """
-
-
-session.exchange_bind(exchange="xml", queue="message_queue", binding_key="weather", arguments=binding)
-
-
-#----- Cleanup ---------------------------------------------
-
-session.close()
-
-
diff --git a/M4-RCs/qpid/python/examples/xml-exchange/listener.py b/M4-RCs/qpid/python/examples/xml-exchange/listener.py
deleted file mode 100755
index a56f5d6018..0000000000
--- a/M4-RCs/qpid/python/examples/xml-exchange/listener.py
+++ /dev/null
@@ -1,105 +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.
-#
-"""
- listener.py
-
- This AMQP client reads messages from a message
- queue named "message_queue". It is implemented
- as a message listener.
-"""
-
-
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-#
-
-from time import sleep
-
-
-#----- Message Receive Handler -----------------------------
-class Receiver:
- def __init__ (self):
- self.finalReceived = False
-
- def isFinal (self):
- return self.finalReceived
-
- def Handler (self, message):
- content = message.body
- session.message_accept(RangedSet(message.id))
- print content
-
-#----- Initialization --------------------------------------
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-#----- Read from queue --------------------------------------------
-
-# Now let's create a local client queue and tell it to read
-# incoming messages.
-
-# The consumer tag identifies the client-side queue.
-
-local_queue_name = "local_queue"
-local_queue = session.incoming(local_queue_name)
-
-# Call message_subscribe() to tell the broker to deliver messages
-# from the AMQP queue to this local client queue. The broker will
-# start delivering messages as soon as local_queue.start() is called.
-
-session.message_subscribe(queue="message_queue", destination=local_queue_name)
-local_queue.start()
-
-receiver = Receiver ()
-local_queue.listen (receiver.Handler)
-
-sleep (10)
-
-
-#----- Cleanup ------------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-#
-
-session.close()
diff --git a/M4-RCs/qpid/python/examples/xml-exchange/verify b/M4-RCs/qpid/python/examples/xml-exchange/verify
deleted file mode 100644
index a93a32dc90..0000000000
--- a/M4-RCs/qpid/python/examples/xml-exchange/verify
+++ /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.
-#
-
-# See https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid/bin/verify
-clients ./declare_queues.py ./xml_producer.py ./xml_consumer.py
-outputs ./declare_queues.py.out ./xml_producer.py.out ./xml_consumer.py.out
diff --git a/M4-RCs/qpid/python/examples/xml-exchange/verify.in b/M4-RCs/qpid/python/examples/xml-exchange/verify.in
deleted file mode 100644
index e5b9909408..0000000000
--- a/M4-RCs/qpid/python/examples/xml-exchange/verify.in
+++ /dev/null
@@ -1,15 +0,0 @@
-==== declare_queues.py.out
-==== xml_producer.py.out
-<weather><station>Raleigh-Durham International Airport (KRDU)</station><wind_speed_mph>0</wind_speed_mph><temperature_f>30</temperature_f><dewpoint>35</dewpoint></weather>
-<weather><station>New Bern, Craven County Regional Airport (KEWN)</station><wind_speed_mph>2</wind_speed_mph><temperature_f>40</temperature_f><dewpoint>40</dewpoint></weather>
-<weather><station>Boone, Watauga County Hospital Heliport (KTNB)</station><wind_speed_mph>5</wind_speed_mph><temperature_f>50</temperature_f><dewpoint>45</dewpoint></weather>
-<weather><station>Hatteras, Mitchell Field (KHSE)</station><wind_speed_mph>10</wind_speed_mph><temperature_f>60</temperature_f><dewpoint>50</dewpoint></weather>
-<weather><station>Raleigh-Durham International Airport (KRDU)</station><wind_speed_mph>16</wind_speed_mph><temperature_f>70</temperature_f><dewpoint>35</dewpoint></weather>
-<weather><station>New Bern, Craven County Regional Airport (KEWN)</station><wind_speed_mph>22</wind_speed_mph><temperature_f>80</temperature_f><dewpoint>40</dewpoint></weather>
-<weather><station>Boone, Watauga County Hospital Heliport (KTNB)</station><wind_speed_mph>28</wind_speed_mph><temperature_f>90</temperature_f><dewpoint>45</dewpoint></weather>
-<weather><station>Hatteras, Mitchell Field (KHSE)</station><wind_speed_mph>35</wind_speed_mph><temperature_f>100</temperature_f><dewpoint>50</dewpoint></weather>
-<weather><station>Raleigh-Durham International Airport (KRDU)</station><wind_speed_mph>42</wind_speed_mph><temperature_f>30</temperature_f><dewpoint>35</dewpoint></weather>
-<weather><station>New Bern, Craven County Regional Airport (KEWN)</station><wind_speed_mph>51</wind_speed_mph><temperature_f>40</temperature_f><dewpoint>40</dewpoint></weather>
-==== xml_consumer.py.out
-<weather><station>Raleigh-Durham International Airport (KRDU)</station><wind_speed_mph>16</wind_speed_mph><temperature_f>70</temperature_f><dewpoint>35</dewpoint></weather>
-No more messages!
diff --git a/M4-RCs/qpid/python/examples/xml-exchange/xml_consumer.py b/M4-RCs/qpid/python/examples/xml-exchange/xml_consumer.py
deleted file mode 100755
index cd89110b05..0000000000
--- a/M4-RCs/qpid/python/examples/xml-exchange/xml_consumer.py
+++ /dev/null
@@ -1,96 +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.
-#
-"""
- direct_consumer.py
-
- This AMQP client reads messages from a message
- queue named "message_queue".
-"""
-
-import qpid
-import sys
-import os
-from random import randint
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-
-#----- Initialization --------------------------------------
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-
-#----- Read from queue --------------------------------------------
-
-# Now let's create a local client queue and tell it to read
-# incoming messages.
-
-# The consumer tag identifies the client-side queue.
-
-local_queue_name = "local_queue"
-local_queue = session.incoming(local_queue_name)
-
-# Call message_consume() to tell the broker to deliver messages
-# from the AMQP queue to this local client queue. The broker will
-# start delivering messages as soon as local_queue.start() is called.
-
-session.message_subscribe(queue="message_queue", destination=local_queue_name)
-local_queue.start()
-
-# Initialize 'final' and 'content', variables used to identify the last message.
-
-message = None
-while True:
- try:
- message = local_queue.get(timeout=10)
- session.message_accept(RangedSet(message.id))
- content = message.body
- print content
- except Empty:
- print "No more messages!"
- break
-
-
-#----- Cleanup ------------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-#
-
-session.close()
diff --git a/M4-RCs/qpid/python/examples/xml-exchange/xml_producer.py b/M4-RCs/qpid/python/examples/xml-exchange/xml_producer.py
deleted file mode 100755
index fa97cab4e1..0000000000
--- a/M4-RCs/qpid/python/examples/xml-exchange/xml_producer.py
+++ /dev/null
@@ -1,92 +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.
-#
-"""
- xml_producer.py
-
- Publishes messages to an XML exchange, using
- the routing key "weather"
-"""
-
-
-import qpid
-import sys
-import os
-from qpid.util import connect
-from qpid.connection import Connection
-from qpid.datatypes import Message, RangedSet, uuid4
-from qpid.queue import Empty
-
-#----- Functions ----------------------------------------
-
-# Data for weather reports
-
-station = ("Raleigh-Durham International Airport (KRDU)",
- "New Bern, Craven County Regional Airport (KEWN)",
- "Boone, Watauga County Hospital Heliport (KTNB)",
- "Hatteras, Mitchell Field (KHSE)")
-wind_speed_mph = ( 0, 2, 5, 10, 16, 22, 28, 35, 42, 51, 61, 70, 80 )
-temperature_f = ( 30, 40, 50, 60, 70, 80, 90, 100 )
-dewpoint = ( 35, 40, 45, 50 )
-
-def pick_one(list, i):
- return str( list [ i % len(list)] )
-
-def report(i):
- return "<weather>" + "<station>" + pick_one(station,i)+ "</station>" + "<wind_speed_mph>" + pick_one(wind_speed_mph,i) + "</wind_speed_mph>" + "<temperature_f>" + pick_one(temperature_f,i) + "</temperature_f>" + "<dewpoint>" + pick_one(dewpoint,i) + "</dewpoint>" + "</weather>"
-
-
-#----- Initialization -----------------------------------
-
-# Set parameters for login
-
-host="127.0.0.1"
-port=5672
-user="guest"
-password="guest"
-
-# If an alternate host or port has been specified, use that instead
-# (this is used in our unit tests)
-if len(sys.argv) > 1 :
- host=sys.argv[1]
-if len(sys.argv) > 2 :
- port=int(sys.argv[2])
-
-# Create a connection.
-socket = connect(host, port)
-connection = Connection (sock=socket, username=user, password=password)
-connection.start()
-session = connection.session(str(uuid4()))
-
-#----- Publish some messages ------------------------------
-
-# Create some messages and put them on the broker.
-
-props = session.delivery_properties(routing_key="weather")
-
-for i in range(10):
- print report(i)
- session.message_transfer(destination="xml", message=Message(props, report(i)))
-
-
-#----- Cleanup --------------------------------------------
-
-# Clean up before exiting so there are no open threads.
-
-session.close()
diff --git a/M4-RCs/qpid/python/hello-world b/M4-RCs/qpid/python/hello-world
deleted file mode 100755
index efee84059c..0000000000
--- a/M4-RCs/qpid/python/hello-world
+++ /dev/null
@@ -1,64 +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
-from qpid.connection import Connection
-from qpid.util import connect
-from qpid.datatypes import uuid4, Message
-
-broker = "127.0.0.1"
-port = 5672
-
-if len(sys.argv) > 1: broker = sys.argv[1]
-if len(sys.argv) > 2: port = int(sys.argv[2])
-
-if len(sys.argv) > 3:
- print >> sys.stderr, "usage: hello-world [ <broker> [ <port> ] ]"
- sys.exit(1)
-
-# connect to the server and start a session
-conn = Connection(connect(broker, port))
-conn.start()
-ssn = conn.session(str(uuid4()))
-
-# create a queue
-ssn.queue_declare("test-queue")
-
-# publish a message
-dp = ssn.delivery_properties(routing_key="test-queue")
-mp = ssn.message_properties(content_type="text/plain")
-msg = Message(dp, mp, "Hello World!")
-ssn.message_transfer(message=msg)
-
-# subscribe to a queue
-ssn.message_subscribe(destination="messages", queue="test-queue",
- accept_mode=ssn.accept_mode.none)
-incoming = ssn.incoming("messages")
-
-# start incoming message flow
-incoming.start()
-
-# grab a message from the queue
-
-print incoming.get(timeout=10)
-
-# cancel the subscription and close the session and connection
-ssn.message_cancel(destination="messages")
-ssn.close()
-conn.close()
diff --git a/M4-RCs/qpid/python/java_failing_0-8.txt b/M4-RCs/qpid/python/java_failing_0-8.txt
deleted file mode 100644
index c13b40a42c..0000000000
--- a/M4-RCs/qpid/python/java_failing_0-8.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-tests_0-8.exchange.RecommendedTypesRuleTests.testTopic
-tests_0-8.exchange.RequiredInstancesRuleTests.testAmqTopic
diff --git a/M4-RCs/qpid/python/java_failing_0-9.txt b/M4-RCs/qpid/python/java_failing_0-9.txt
deleted file mode 100644
index 7252d0f496..0000000000
--- a/M4-RCs/qpid/python/java_failing_0-9.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-ntests.basic.BasicTests.test_qos_prefetch_count
-tests.basic.BasicTests.test_ack
-tests.basic.BasicTests.test_cancel
-tests.basic.BasicTests.test_consume_exclusive
-tests.basic.BasicTests.test_consume_no_local
-tests.basic.BasicTests.test_consume_queue_errors
-tests.basic.BasicTests.test_consume_unique_consumers
-tests.basic.BasicTests.test_get
-tests.basic.BasicTests.test_qos_prefetch_size
-tests.basic.BasicTests.test_recover_requeue
-
-tests.exchange.RecommendedTypesRuleTests.testTopic
-tests.exchange.RequiredInstancesRuleTests.testAmqTopic
-
-tests.message.MessageTests.test_checkpoint
-tests.message.MessageTests.test_reject
-
-tests.broker.BrokerTests.test_ping_pong
diff --git a/M4-RCs/qpid/python/mllib/__init__.py b/M4-RCs/qpid/python/mllib/__init__.py
deleted file mode 100644
index 39e9363614..0000000000
--- a/M4-RCs/qpid/python/mllib/__init__.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.
-#
-
-"""
-This module provides document parsing and transformation utilities for
-both SGML and XML.
-"""
-
-import os, dom, transforms, parsers, sys
-import xml.sax, types
-from cStringIO import StringIO
-
-def transform(node, *args):
- result = node
- for t in args:
- if isinstance(t, types.ClassType):
- t = t()
- result = result.dispatch(t)
- return result
-
-def sgml_parse(source):
- if isinstance(source, basestring):
- source = StringIO(source)
- fname = "<string>"
- elif hasattr(source, "name"):
- fname = source.name
- p = parsers.SGMLParser()
- num = 1
- for line in source:
- p.feed(line)
- p.parser.line(fname, num, None)
- num += 1
- p.close()
- return p.parser.tree
-
-def xml_parse(filename):
- if sys.version_info[0:2] == (2,3):
- # XXX: this is for older versions of python
- source = "file://%s" % os.path.abspath(filename)
- else:
- source = filename
- p = parsers.XMLParser()
- xml.sax.parse(source, p)
- return p.parser.tree
-
-def sexp(node):
- s = transforms.Sexp()
- node.dispatch(s)
- return s.out
diff --git a/M4-RCs/qpid/python/mllib/dom.py b/M4-RCs/qpid/python/mllib/dom.py
deleted file mode 100644
index df2b88322a..0000000000
--- a/M4-RCs/qpid/python/mllib/dom.py
+++ /dev/null
@@ -1,295 +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.
-#
-
-"""
-Simple DOM for both SGML and XML documents.
-"""
-
-from __future__ import division
-from __future__ import generators
-from __future__ import nested_scopes
-
-import transforms
-
-class Container:
-
- def __init__(self):
- self.children = []
-
- def add(self, child):
- child.parent = self
- self.children.append(child)
-
- def extend(self, children):
- for child in children:
- child.parent = self
- self.children.append(child)
-
-class Component:
-
- def __init__(self):
- self.parent = None
-
- def index(self):
- if self.parent:
- return self.parent.children.index(self)
- else:
- return 0
-
- def _line(self, file, line, column):
- self.file = file
- self.line = line
- self.column = column
-
-class DispatchError(Exception):
-
- def __init__(self, scope, f):
- msg = "no such attribtue"
-
-class Dispatcher:
-
- def is_type(self, type):
- cls = self
- while cls != None:
- if cls.type == type:
- return True
- cls = cls.base
- return False
-
- def dispatch(self, f, attrs = ""):
- cls = self
- while cls != None:
- if hasattr(f, cls.type):
- return getattr(f, cls.type)(self)
- else:
- cls = cls.base
-
- cls = self
- while cls != None:
- if attrs:
- sep = ", "
- if cls.base == None:
- sep += "or "
- else:
- sep = ""
- attrs += "%s'%s'" % (sep, cls.type)
- cls = cls.base
-
- raise AttributeError("'%s' object has no attribute %s" %
- (f.__class__.__name__, attrs))
-
-class Node(Container, Component, Dispatcher):
-
- type = "node"
- base = None
-
- def __init__(self):
- Container.__init__(self)
- Component.__init__(self)
- self.query = Query([self])
-
- def __getitem__(self, name):
- for nd in self.query[name]:
- return nd
-
- def text(self):
- return self.dispatch(transforms.Text())
-
- def tag(self, name, *attrs, **kwargs):
- t = Tag(name, *attrs, **kwargs)
- self.add(t)
- return t
-
- def data(self, s):
- d = Data(s)
- self.add(d)
- return d
-
- def entity(self, s):
- e = Entity(s)
- self.add(e)
- return e
-
-class Tree(Node):
-
- type = "tree"
- base = Node
-
-class Tag(Node):
-
- type = "tag"
- base = Node
-
- def __init__(self, _name, *attrs, **kwargs):
- Node.__init__(self)
- self.name = _name
- self.attrs = list(attrs)
- self.attrs.extend(kwargs.items())
- self.singleton = False
-
- def get_attr(self, name):
- for k, v in self.attrs:
- if name == k:
- return v
-
- def dispatch(self, f):
- try:
- attr = "do_" + self.name
- method = getattr(f, attr)
- except AttributeError:
- return Dispatcher.dispatch(self, f, "'%s'" % attr)
- return method(self)
-
-class Leaf(Component, Dispatcher):
-
- type = "leaf"
- base = None
-
- def __init__(self, data):
- assert isinstance(data, basestring)
- self.data = data
-
-class Data(Leaf):
- type = "data"
- base = Leaf
-
-class Entity(Leaf):
- type = "entity"
- base = Leaf
-
-class Character(Leaf):
- type = "character"
- base = Leaf
-
-class Comment(Leaf):
- type = "comment"
- base = Leaf
-
-###################
-## Query Classes ##
-###########################################################################
-
-class Adder:
-
- def __add__(self, other):
- return Sum(self, other)
-
-class Sum(Adder):
-
- def __init__(self, left, right):
- self.left = left
- self.right = right
-
- def __iter__(self):
- for x in self.left:
- yield x
- for x in self.right:
- yield x
-
-class View(Adder):
-
- def __init__(self, source):
- self.source = source
-
-class Filter(View):
-
- def __init__(self, predicate, source):
- View.__init__(self, source)
- self.predicate = predicate
-
- def __iter__(self):
- for nd in self.source:
- if self.predicate(nd): yield nd
-
-class Flatten(View):
-
- def __iter__(self):
- sources = [iter(self.source)]
- while sources:
- try:
- nd = sources[-1].next()
- if isinstance(nd, Tree):
- sources.append(iter(nd.children))
- else:
- yield nd
- except StopIteration:
- sources.pop()
-
-class Children(View):
-
- def __iter__(self):
- for nd in self.source:
- for child in nd.children:
- yield child
-
-class Attributes(View):
-
- def __iter__(self):
- for nd in self.source:
- for a in nd.attrs:
- yield a
-
-class Values(View):
-
- def __iter__(self):
- for name, value in self.source:
- yield value
-
-def flatten_path(path):
- if isinstance(path, basestring):
- for part in path.split("/"):
- yield part
- elif callable(path):
- yield path
- else:
- for p in path:
- for fp in flatten_path(p):
- yield fp
-
-class Query(View):
-
- def __iter__(self):
- for nd in self.source:
- yield nd
-
- def __getitem__(self, path):
- query = self.source
- for p in flatten_path(path):
- if callable(p):
- select = Query
- pred = p
- source = query
- elif isinstance(p, basestring):
- if p[0] == "@":
- select = Values
- pred = lambda x, n=p[1:]: x[0] == n
- source = Attributes(query)
- elif p[0] == "#":
- select = Query
- pred = lambda x, t=p[1:]: x.is_type(t)
- source = Children(query)
- else:
- select = Query
- pred = lambda x, n=p: isinstance(x, Tag) and x.name == n
- source = Flatten(Children(query))
- else:
- raise ValueError(p)
- query = select(Filter(pred, source))
-
- return query
diff --git a/M4-RCs/qpid/python/mllib/parsers.py b/M4-RCs/qpid/python/mllib/parsers.py
deleted file mode 100644
index 3e7cc10dc2..0000000000
--- a/M4-RCs/qpid/python/mllib/parsers.py
+++ /dev/null
@@ -1,139 +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.
-#
-
-"""
-Parsers for SGML and XML to dom.
-"""
-
-import sgmllib, xml.sax.handler
-from dom import *
-
-class Parser:
-
- def __init__(self):
- self.tree = Tree()
- self.node = self.tree
- self.nodes = []
-
- def line(self, id, lineno, colno):
- while self.nodes:
- n = self.nodes.pop()
- n._line(id, lineno, colno)
-
- def add(self, node):
- self.node.add(node)
- self.nodes.append(node)
-
- def start(self, name, attrs):
- tag = Tag(name, *attrs)
- self.add(tag)
- self.node = tag
-
- def end(self, name):
- self.balance(name)
- self.node = self.node.parent
-
- def data(self, data):
- children = self.node.children
- if children and isinstance(children[-1], Data):
- children[-1].data += data
- else:
- self.add(Data(data))
-
- def comment(self, comment):
- self.add(Comment(comment))
-
- def entity(self, ref):
- self.add(Entity(ref))
-
- def character(self, ref):
- self.add(Character(ref))
-
- def balance(self, name = None):
- while self.node != self.tree and name != self.node.name:
- self.node.parent.extend(self.node.children)
- del self.node.children[:]
- self.node.singleton = True
- self.node = self.node.parent
-
-
-class SGMLParser(sgmllib.SGMLParser):
-
- def __init__(self, entitydefs = None):
- sgmllib.SGMLParser.__init__(self)
- if entitydefs == None:
- self.entitydefs = {}
- else:
- self.entitydefs = entitydefs
- self.parser = Parser()
-
- def unknown_starttag(self, name, attrs):
- self.parser.start(name, attrs)
-
- def handle_data(self, data):
- self.parser.data(data)
-
- def handle_comment(self, comment):
- self.parser.comment(comment)
-
- def unknown_entityref(self, ref):
- self.parser.entity(ref)
-
- def unknown_charref(self, ref):
- self.parser.character(ref)
-
- def unknown_endtag(self, name):
- self.parser.end(name)
-
- def close(self):
- sgmllib.SGMLParser.close(self)
- self.parser.balance()
- assert self.parser.node == self.parser.tree
-
-class XMLParser(xml.sax.handler.ContentHandler):
-
- def __init__(self):
- self.parser = Parser()
- self.locator = None
-
- def line(self):
- if self.locator != None:
- self.parser.line(self.locator.getSystemId(),
- self.locator.getLineNumber(),
- self.locator.getColumnNumber())
-
- def setDocumentLocator(self, locator):
- self.locator = locator
-
- def startElement(self, name, attrs):
- self.parser.start(name, attrs.items())
- self.line()
-
- def endElement(self, name):
- self.parser.end(name)
- self.line()
-
- def characters(self, content):
- self.parser.data(content)
- self.line()
-
- def skippedEntity(self, name):
- self.parser.entity(name)
- self.line()
-
diff --git a/M4-RCs/qpid/python/mllib/transforms.py b/M4-RCs/qpid/python/mllib/transforms.py
deleted file mode 100644
index 69d99125e3..0000000000
--- a/M4-RCs/qpid/python/mllib/transforms.py
+++ /dev/null
@@ -1,164 +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.
-#
-
-"""
-Useful transforms for dom objects.
-"""
-
-import dom
-from cStringIO import StringIO
-
-class Visitor:
-
- def descend(self, node):
- for child in node.children:
- child.dispatch(self)
-
- def node(self, node):
- self.descend(node)
-
- def leaf(self, leaf):
- pass
-
-class Identity:
-
- def descend(self, node):
- result = []
- for child in node.children:
- result.append(child.dispatch(self))
- return result
-
- def default(self, tag):
- result = dom.Tag(tag.name, *tag.attrs)
- result.extend(self.descend(tag))
- return result
-
- def tree(self, tree):
- result = dom.Tree()
- result.extend(self.descend(tree))
- return result
-
- def tag(self, tag):
- return self.default(tag)
-
- def leaf(self, leaf):
- return leaf.__class__(leaf.data)
-
-class Sexp(Identity):
-
- def __init__(self):
- self.stack = []
- self.level = 0
- self.out = ""
-
- def open(self, s):
- self.out += "(%s" % s
- self.level += len(s) + 1
- self.stack.append(s)
-
- def line(self, s = ""):
- self.out = self.out.rstrip()
- self.out += "\n" + " "*self.level + s
-
- def close(self):
- s = self.stack.pop()
- self.level -= len(s) + 1
- self.out = self.out.rstrip()
- self.out += ")"
-
- def tree(self, tree):
- self.open("+ ")
- for child in tree.children:
- self.line(); child.dispatch(self)
- self.close()
-
- def tag(self, tag):
- self.open("Node(%s) " % tag.name)
- for child in tag.children:
- self.line(); child.dispatch(self)
- self.close()
-
- def leaf(self, leaf):
- self.line("%s(%s)" % (leaf.__class__.__name__, leaf.data))
-
-class Output:
-
- def descend(self, node):
- out = StringIO()
- for child in node.children:
- out.write(child.dispatch(self))
- return out.getvalue()
-
- def default(self, tag):
- out = StringIO()
- out.write("<%s" % tag.name)
- for k, v in tag.attrs:
- out.write(' %s="%s"' % (k, v))
- out.write(">")
- out.write(self.descend(tag))
- if not tag.singleton:
- out.write("</%s>" % tag.name)
- return out.getvalue()
-
- def tree(self, tree):
- return self.descend(tree)
-
- def tag(self, tag):
- return self.default(tag)
-
- def data(self, leaf):
- return leaf.data
-
- def entity(self, leaf):
- return "&%s;" % leaf.data
-
- def character(self, leaf):
- raise Exception("TODO")
-
- def comment(self, leaf):
- return "<!-- %s -->" % leaf.data
-
-class Empty(Output):
-
- def tag(self, tag):
- return self.descend(tag)
-
- def data(self, leaf):
- return ""
-
- def entity(self, leaf):
- return ""
-
- def character(self, leaf):
- return ""
-
- def comment(self, leaf):
- return ""
-
-class Text(Empty):
-
- def data(self, leaf):
- return leaf.data
-
- def entity(self, leaf):
- return "&%s;" % leaf.data
-
- def character(self, leaf):
- # XXX: is this right?
- return "&#%s;" % leaf.data
diff --git a/M4-RCs/qpid/python/models/fedsim/__init__.py b/M4-RCs/qpid/python/models/fedsim/__init__.py
deleted file mode 100644
index 63a3f41f28..0000000000
--- a/M4-RCs/qpid/python/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/M4-RCs/qpid/python/models/fedsim/fedsim.py b/M4-RCs/qpid/python/models/fedsim/fedsim.py
deleted file mode 100644
index edb6c4c8ed..0000000000
--- a/M4-RCs/qpid/python/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/M4-RCs/qpid/python/models/fedsim/testBig.py b/M4-RCs/qpid/python/models/fedsim/testBig.py
deleted file mode 100644
index 416a086983..0000000000
--- a/M4-RCs/qpid/python/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/M4-RCs/qpid/python/models/fedsim/testRing.py b/M4-RCs/qpid/python/models/fedsim/testRing.py
deleted file mode 100644
index c883b54993..0000000000
--- a/M4-RCs/qpid/python/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/M4-RCs/qpid/python/models/fedsim/testStar.py b/M4-RCs/qpid/python/models/fedsim/testStar.py
deleted file mode 100644
index e6b801446f..0000000000
--- a/M4-RCs/qpid/python/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/M4-RCs/qpid/python/models/fedsim/testStarAdd.py b/M4-RCs/qpid/python/models/fedsim/testStarAdd.py
deleted file mode 100644
index e0eb44952a..0000000000
--- a/M4-RCs/qpid/python/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/M4-RCs/qpid/python/pal2py b/M4-RCs/qpid/python/pal2py
deleted file mode 100755
index 544151bf76..0000000000
--- a/M4-RCs/qpid/python/pal2py
+++ /dev/null
@@ -1,274 +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, os, xml
-
-from qpid.spec import load, pythonize
-from textwrap import TextWrapper
-from xml.sax.handler import ContentHandler
-
-class Block:
-
- def __init__(self, children):
- self.children = children
-
- def emit(self, out):
- for child in self.children:
- if not hasattr(child, "emit"):
- raise ValueError(child)
- child.emit(out)
-
- if not self.children:
- out.line("pass")
-
-class If:
-
- def __init__(self, expr, cons, alt = None):
- self.expr = expr
- self.cons = cons
- self.alt = alt
-
- def emit(self, out):
- out.line("if ")
- self.expr.emit(out)
- out.write(":")
- out.level += 1
- self.cons.emit(out)
- out.level -= 1
- if self.alt:
- out.line("else:")
- out.level += 1
- self.alt.emit(out)
- out.level -= 1
-
-class Stmt:
-
- def __init__(self, code):
- self.code = code
-
- def emit(self, out):
- out.line(self.code)
-
-class Expr:
-
- def __init__(self, code):
- self.code = code
-
- def emit(self, out):
- out.write(self.code)
-
-class Abort:
-
- def __init__(self, expr):
- self.expr = expr
-
- def emit(self, out):
- out.line("assert False, ")
- self.expr.emit(out)
-
-WRAPPER = TextWrapper()
-
-def wrap(text):
- return WRAPPER.wrap(" ".join(text.split()))
-
-class Doc:
-
- def __init__(self, text):
- self.text = text
-
- def emit(self, out):
- out.line('"""')
- for line in wrap(self.text):
- out.line(line)
- out.line('"""')
-
-class Frame:
-
- def __init__(self, attrs):
- self.attrs = attrs
- self.children = []
- self.text = None
-
- def __getattr__(self, attr):
- return self.attrs[attr]
-
-def isunicode(s):
- if isinstance(s, str):
- return False
- for ch in s:
- if ord(ch) > 127:
- return True
- return False
-
-def string_literal(s):
- if s == None:
- return None
- if isunicode(s):
- return "%r" % s
- else:
- return "%r" % str(s)
-
-TRUTH = {
- "1": True,
- "0": False,
- "true": True,
- "false": False
- }
-
-LITERAL = {
- "shortstr": string_literal,
- "longstr": string_literal,
- "bit": lambda s: TRUTH[s.lower()],
- "longlong": lambda s: "%r" % long(s)
- }
-
-def literal(s, field):
- return LITERAL[field.type](s)
-
-def palexpr(s, field):
- if s.startswith("$"):
- return "msg.%s" % s[1:]
- else:
- return literal(s, field)
-
-class Translator(ContentHandler):
-
- def __init__(self, spec):
- self.spec = spec
- self.stack = []
- self.content = None
- self.root = Frame(None)
- self.push(self.root)
-
- def emit(self, out):
- blk = Block(self.root.children)
- blk.emit(out)
- out.write("\n")
-
- def peek(self):
- return self.stack[-1]
-
- def pop(self):
- return self.stack.pop()
-
- def push(self, frame):
- self.stack.append(frame)
-
- def startElement(self, name, attrs):
- self.push(Frame(attrs))
-
- def endElement(self, name):
- frame = self.pop()
- if hasattr(self, name):
- child = getattr(self, name)(frame)
- else:
- child = self.handle(name, frame)
-
- if child:
- self.peek().children.append(child)
-
- def characters(self, text):
- frame = self.peek()
- if frame.text:
- frame.text += text
- else:
- frame.text = text
-
- def handle(self, name, frame):
- for klass in self.spec.classes:
- pyklass = pythonize(klass.name)
- if name.startswith(pyklass):
- name = name[len(pyklass) + 1:]
- break
- else:
- raise ValueError("unknown class: %s" % name)
-
- for method in klass.methods:
- pymethod = pythonize(method.name)
- if name == pymethod:
- break
- else:
- raise ValueError("unknown method: %s" % name)
-
- args = ["%s = %s" % (key, palexpr(val, method.fields.bypyname[key]))
- for key, val in frame.attrs.items()]
- if method.content and self.content:
- args.append("content = %r" % string_literal(self.content))
- code = "ssn.%s_%s(%s)" % (pyklass, pymethod, ", ".join(args))
- if pymethod == "consume":
- code = "consumer_tag = %s.consumer_tag" % code
- return Stmt(code)
-
- def pal(self, frame):
- return Block([Doc(frame.text)] + frame.children)
-
- def include(self, frame):
- base, ext = os.path.splitext(frame.filename)
- return Stmt("from %s import *" % base)
-
- def session(self, frame):
- return Block([Stmt("cli = open()"), Stmt("ssn = cli.channel(0)"),
- Stmt("ssn.channel_open()")] + frame.children)
-
- def empty(self, frame):
- return If(Expr("msg == None"), Block(frame.children))
-
- def abort(self, frame):
- return Abort(Expr(string_literal(frame.text)))
-
- def wait(self, frame):
- return Stmt("msg = ssn.queue(consumer_tag).get(timeout=%r)" %
- (int(frame.timeout)/1000))
-
- def basic_arrived(self, frame):
- if frame.children:
- return If(Expr("msg != None"), Block(frame.children))
-
- def basic_content(self, frame):
- self.content = frame.text
-
-class Emitter:
-
- def __init__(self, out):
- self.out = out
- self.level = 0
-
- def write(self, code):
- self.out.write(code)
-
- def line(self, code):
- self.write("\n%s%s" % (" "*self.level, code))
-
- def flush(self):
- self.out.flush()
-
- def close(self):
- self.out.close()
-
-
-for f in sys.argv[2:]:
- base, ext = os.path.splitext(f)
- spec = load(sys.argv[1])
- t = Translator(spec)
- xml.sax.parse(f, t)
-# out = Emitter(open("%s.py" % base))
- out = Emitter(sys.stdout)
- t.emit(out)
- out.close()
diff --git a/M4-RCs/qpid/python/perftest b/M4-RCs/qpid/python/perftest
deleted file mode 100755
index f4d3c95e96..0000000000
--- a/M4-RCs/qpid/python/perftest
+++ /dev/null
@@ -1,113 +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.
-#
-
-def publisher(n):
- import qpid
- import sys
- from qpid.client import Client
- from qpid.content import Content
- if len(sys.argv) >= 3:
- n = int(sys.argv[2])
- client = Client("127.0.0.1", 5672)
- client.start({"LOGIN": "guest", "PASSWORD": "guest"})
- channel = client.channel(1)
- channel.session_open()
- message = Content("message")
- message["routing_key"] = "message_queue"
- print "producing ", n, " messages"
- for i in range(n):
- channel.message_transfer(destination="amq.direct", content=message)
-
- print "producing final message"
- message = Content("That's done")
- message["routing_key"] = "message_queue"
- channel.message_transfer(destination="amq.direct", content=message)
-
- print "consuming sync message"
- consumer = "consumer"
- queue = client.queue(consumer)
- channel.message_subscribe(queue="sync_queue", destination=consumer)
- channel.message_flow(consumer, 0, 0xFFFFFFFF)
- channel.message_flow(consumer, 1, 0xFFFFFFFF)
- queue.get(block = True)
- print "done"
- channel.session_close()
-
-def consumer():
- import sys
- import qpid
- from qpid.client import Client
- from qpid.content import Content
- client = Client("127.0.0.1", 5672)
- client.start({"LOGIN": "guest", "PASSWORD": "guest"})
- channel = client.channel(1)
- channel.session_open()
- consumer = "consumer"
- queue = client.queue(consumer)
- channel.message_subscribe(queue="message_queue", destination=consumer)
- channel.message_flow(consumer, 0, 0xFFFFFFFF)
- channel.message_flow(consumer, 1, 0xFFFFFFFF)
- final = "That's done"
- content = ""
- message = None
- print "getting messages"
- while content != final:
- message = queue.get(block = True)
- content = message.content.body
- message.complete(cumulative=True)
-
- print "consumed all messages"
- message = Content("message")
- message["routing_key"] = "sync_queue"
- channel.message_transfer(destination="amq.direct", content=message)
- print "done"
- channel.session_close()
-
-if __name__=='__main__':
- import sys
- import qpid
- from timeit import Timer
- from qpid.client import Client
- from qpid.content import Content
- client = Client("127.0.0.1", 5672)
- client.start({"LOGIN": "guest", "PASSWORD": "guest"})
- channel = client.channel(1)
- channel.session_open()
- channel.queue_declare(queue="message_queue")
- channel.queue_bind(exchange="amq.direct", queue="message_queue", routing_key="message_queue")
- channel.queue_declare(queue="sync_queue")
- channel.queue_bind(exchange="amq.direct", queue="sync_queue", routing_key="sync_queue")
- channel.session_close()
-
- numMess = 100
- if len(sys.argv) >= 3:
- numMess = int(sys.argv[2])
- if len(sys.argv) == 1:
- print "error: please specify prod or cons"
- elif sys.argv[1] == 'prod':
- tprod = Timer("publisher(100)", "from __main__ import publisher")
- tp = tprod.timeit(1)
- print "produced and consumed" , numMess + 2 ,"messages in: ", tp
- elif sys.argv[1] == 'cons':
- tcons = Timer("consumer()", "from __main__ import consumer")
- tc = tcons.timeit(1)
- print "consumed " , numMess ," in: ", tc
- else:
- print "please specify prod or cons"
diff --git a/M4-RCs/qpid/python/qmf/__init__.py b/M4-RCs/qpid/python/qmf/__init__.py
deleted file mode 100644
index 31d5a2ef58..0000000000
--- a/M4-RCs/qpid/python/qmf/__init__.py
+++ /dev/null
@@ -1,18 +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/M4-RCs/qpid/python/qmf/console.py b/M4-RCs/qpid/python/qmf/console.py
deleted file mode 100644
index 0009726fe7..0000000000
--- a/M4-RCs/qpid/python/qmf/console.py
+++ /dev/null
@@ -1,1625 +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 API for Qpid Management Framework """
-
-import os
-import qpid
-import struct
-import socket
-import re
-from qpid.peer import Closed
-from qpid.connection import Connection, ConnectionFailed
-from qpid.datatypes import UUID, uuid4, Message, RangedSet
-from qpid.util import connect, ssl, URL
-from qpid.codec010 import StringCodec as Codec
-from threading import Lock, Condition, Thread
-from time import time, strftime, gmtime
-from cStringIO import StringIO
-
-class Console:
- """ To access the asynchronous operations, a class must be derived from
- Console with overrides of any combination of the available methods. """
-
- def brokerConnected(self, broker):
- """ Invoked when a connection is established to a broker """
- pass
-
- def brokerDisconnected(self, broker):
- """ Invoked when the connection to a broker is lost """
- pass
-
- def newPackage(self, name):
- """ Invoked when a QMF package is discovered. """
- pass
-
- def newClass(self, kind, classKey):
- """ Invoked when a new class is discovered. Session.getSchema can be
- used to obtain details about the class."""
- pass
-
- def newAgent(self, agent):
- """ Invoked when a QMF agent is discovered. """
- pass
-
- def delAgent(self, agent):
- """ Invoked when a QMF agent disconects. """
- pass
-
- def objectProps(self, broker, record):
- """ Invoked when an object is updated. """
- pass
-
- def objectStats(self, broker, record):
- """ Invoked when an object is updated. """
- pass
-
- def event(self, broker, event):
- """ Invoked when an event is raised. """
- pass
-
- def heartbeat(self, agent, timestamp):
- """ """
- pass
-
- def brokerInfo(self, broker):
- """ """
- pass
-
- def methodResponse(self, broker, seq, response):
- """ """
- pass
-
-class BrokerURL(URL):
- def __init__(self, text):
- URL.__init__(self, text)
- socket.gethostbyname(self.host)
- if self.port is None:
- if self.scheme == URL.AMQPS:
- self.port = 5671
- else:
- self.port = 5672
- self.authName = self.user or "guest"
- self.authPass = self.password or "guest"
- self.authMech = "PLAIN"
-
- def name(self):
- return self.host + ":" + str(self.port)
-
- def match(self, host, port):
- return socket.gethostbyname(self.host) == socket.gethostbyname(host) and self.port == port
-
-class Session:
- """
- An instance of the Session class represents a console session running
- against one or more QMF brokers. A single instance of Session is needed
- to interact with the management framework as a console.
- """
- _CONTEXT_SYNC = 1
- _CONTEXT_STARTUP = 2
- _CONTEXT_MULTIGET = 3
-
- GET_WAIT_TIME = 60
-
- def __init__(self, console=None, rcvObjects=True, rcvEvents=True, rcvHeartbeats=True,
- manageConnections=False, userBindings=False):
- """
- Initialize a session. If the console argument is provided, the
- more advanced asynchronous features are available. If console is
- defaulted, the session will operate in a simpler, synchronous manner.
-
- The rcvObjects, rcvEvents, and rcvHeartbeats arguments are meaningful only if 'console'
- is provided. They control whether object updates, events, and agent-heartbeats are
- subscribed to. If the console is not interested in receiving one or more of the above,
- setting the argument to False will reduce tha bandwidth used by the API.
-
- If manageConnections is set to True, the Session object will manage connections to
- the brokers. This means that if a broker is unreachable, it will retry until a connection
- can be established. If a connection is lost, the Session will attempt to reconnect.
-
- If manageConnections is set to False, the user is responsible for handing failures. In
- this case, an unreachable broker will cause addBroker to raise an exception.
-
- If userBindings is set to False (the default) and rcvObjects is True, the console will
- receive data for all object classes. If userBindings is set to True, the user must select
- which classes the console shall receive by invoking the bindPackage or bindClass methods.
- This allows the console to be configured to receive only information that is relavant to
- a particular application. If rcvObjects id False, userBindings has no meaning.
- """
- self.console = console
- self.brokers = []
- self.packages = {}
- self.seqMgr = SequenceManager()
- self.cv = Condition()
- self.syncSequenceList = []
- self.getResult = []
- self.getSelect = []
- self.error = None
- self.rcvObjects = rcvObjects
- self.rcvEvents = rcvEvents
- self.rcvHeartbeats = rcvHeartbeats
- self.userBindings = userBindings
- if self.console == None:
- self.rcvObjects = False
- self.rcvEvents = False
- self.rcvHeartbeats = False
- self.bindingKeyList = self._bindingKeys()
- self.manageConnections = manageConnections
-
- if self.userBindings and not self.rcvObjects:
- raise Exception("userBindings can't be set unless rcvObjects is set and a console is provided")
-
- def __repr__(self):
- return "QMF Console Session Manager (brokers: %d)" % len(self.brokers)
-
- def addBroker(self, target="localhost"):
- """ Connect to a Qpid broker. Returns an object of type Broker. """
- url = BrokerURL(target)
- broker = Broker(self, url.host, url.port, url.authMech, url.authName, url.authPass,
- ssl = url.scheme == URL.AMQPS)
-
- self.brokers.append(broker)
- if not self.manageConnections:
- self.getObjects(broker=broker, _class="agent")
- return broker
-
- def delBroker(self, broker):
- """ Disconnect from a broker. The 'broker' argument is the object
- returned from the addBroker call """
- broker._shutdown()
- self.brokers.remove(broker)
- del broker
-
- def getPackages(self):
- """ Get the list of known QMF packages """
- for broker in self.brokers:
- broker._waitForStable()
- list = []
- for package in self.packages:
- list.append(package)
- return list
-
- def getClasses(self, packageName):
- """ Get the list of known classes within a QMF package """
- for broker in self.brokers:
- broker._waitForStable()
- list = []
- if packageName in self.packages:
- for pkey in self.packages[packageName]:
- list.append(self.packages[packageName][pkey].getKey())
- return list
-
- def getSchema(self, classKey):
- """ Get the schema for a QMF class """
- for broker in self.brokers:
- broker._waitForStable()
- pname = classKey.getPackageName()
- pkey = classKey.getPackageKey()
- if pname in self.packages:
- if pkey in self.packages[pname]:
- return self.packages[pname][pkey]
-
- def bindPackage(self, packageName):
- """ Request object updates for all table classes within a package. """
- if not self.userBindings or not self.rcvObjects:
- raise Exception("userBindings option not set for Session")
- key = "console.obj.*.*.%s.#" % packageName
- self.bindingKeyList.append(key)
- for broker in self.brokers:
- if broker.isConnected():
- broker.amqpSession.exchange_bind(exchange="qpid.management", queue=broker.topicName,
- binding_key=key)
-
- def bindClass(self, pname, cname):
- """ Request object updates for a particular table class by package and class name. """
- if not self.userBindings or not self.rcvObjects:
- raise Exception("userBindings option not set for Session")
- key = "console.obj.*.*.%s.%s.#" % (pname, cname)
- self.bindingKeyList.append(key)
- for broker in self.brokers:
- if broker.isConnected():
- broker.amqpSession.exchange_bind(exchange="qpid.management", queue=broker.topicName,
- binding_key=key)
-
- def bindClassKey(self, classKey):
- """ Request object updates for a particular table class by class key. """
- pname = classKey.getPackageName()
- cname = classKey.getClassName()
- self.bindClass(pname, cname)
-
- def getAgents(self, broker=None):
- """ Get a list of currently known agents """
- brokerList = []
- if broker == None:
- for b in self.brokers:
- brokerList.append(b)
- else:
- brokerList.append(broker)
-
- for b in brokerList:
- b._waitForStable()
- agentList = []
- for b in brokerList:
- for a in b.getAgents():
- agentList.append(a)
- return agentList
-
- def getObjects(self, **kwargs):
- """ Get a list of objects from QMF agents.
- All arguments are passed by name(keyword).
-
- The class for queried objects may be specified in one of the following ways:
-
- _schema = <schema> - supply a schema object returned from getSchema.
- _key = <key> - supply a classKey from the list returned by getClasses.
- _class = <name> - supply a class name as a string. If the class name exists
- in multiple packages, a _package argument may also be supplied.
- _objectId = <id> - get the object referenced by the object-id
-
- If objects should be obtained from only one agent, use the following argument.
- Otherwise, the query will go to all agents.
-
- _agent = <agent> - supply an agent from the list returned by getAgents.
-
- If the get query is to be restricted to one broker (as opposed to all connected brokers),
- add the following argument:
-
- _broker = <broker> - supply a broker as returned by addBroker.
-
- If additional arguments are supplied, they are used as property selectors. For example,
- if the argument name="test" is supplied, only objects whose "name" property is "test"
- will be returned in the result.
- """
- if "_broker" in kwargs:
- brokerList = []
- brokerList.append(kwargs["_broker"])
- else:
- brokerList = self.brokers
- for broker in brokerList:
- broker._waitForStable()
-
- agentList = []
- if "_agent" in kwargs:
- agent = kwargs["_agent"]
- if agent.broker not in brokerList:
- raise Exception("Supplied agent is not accessible through the supplied broker")
- if agent.broker.isConnected():
- agentList.append(agent)
- else:
- if "_objectId" in kwargs:
- oid = kwargs["_objectId"]
- for broker in brokerList:
- for agent in broker.getAgents():
- if agent.getBrokerBank() == oid.getBrokerBank() and agent.getAgentBank() == oid.getAgentBank():
- agentList.append(agent)
- else:
- for broker in brokerList:
- for agent in broker.getAgents():
- if agent.broker.isConnected():
- agentList.append(agent)
-
- if len(agentList) == 0:
- return []
-
- pname = None
- cname = None
- hash = None
- classKey = None
- if "_schema" in kwargs: classKey = kwargs["_schema"].getKey()
- elif "_key" in kwargs: classKey = kwargs["_key"]
- elif "_class" in kwargs:
- cname = kwargs["_class"]
- if "_package" in kwargs:
- pname = kwargs["_package"]
- if cname == None and classKey == None and "_objectId" not in kwargs:
- raise Exception("No class supplied, use '_schema', '_key', '_class', or '_objectId' argument")
-
- map = {}
- self.getSelect = []
- if "_objectId" in kwargs:
- map["_objectid"] = kwargs["_objectId"].__repr__()
- else:
- if cname == None:
- cname = classKey.getClassName()
- pname = classKey.getPackageName()
- hash = classKey.getHash()
- map["_class"] = cname
- if pname != None: map["_package"] = pname
- if hash != None: map["_hash"] = hash
- for item in kwargs:
- if item[0] != '_':
- self.getSelect.append((item, kwargs[item]))
-
- self.getResult = []
- for agent in agentList:
- broker = agent.broker
- sendCodec = Codec(broker.conn.spec)
- try:
- self.cv.acquire()
- seq = self.seqMgr._reserve(self._CONTEXT_MULTIGET)
- self.syncSequenceList.append(seq)
- finally:
- self.cv.release()
- broker._setHeader(sendCodec, 'G', seq)
- sendCodec.write_map(map)
- smsg = broker._message(sendCodec.encoded, "agent.%d.%d" % (agent.brokerBank, agent.agentBank))
- broker._send(smsg)
-
- starttime = time()
- timeout = False
- try:
- self.cv.acquire()
- while len(self.syncSequenceList) > 0 and self.error == None:
- self.cv.wait(self.GET_WAIT_TIME)
- if time() - starttime > self.GET_WAIT_TIME:
- for pendingSeq in self.syncSequenceList:
- self.seqMgr._release(pendingSeq)
- self.syncSequenceList = []
- timeout = True
- finally:
- self.cv.release()
-
- if self.error:
- errorText = self.error
- self.error = None
- raise Exception(errorText)
-
- if len(self.getResult) == 0 and timeout:
- raise RuntimeError("No agent responded within timeout period")
- return self.getResult
-
- def setEventFilter(self, **kwargs):
- """ """
- pass
-
- def _bindingKeys(self):
- keyList = []
- keyList.append("schema.#")
- if self.rcvObjects and self.rcvEvents and self.rcvHeartbeats and not self.userBindings:
- keyList.append("console.#")
- else:
- if self.rcvObjects and not self.userBindings:
- keyList.append("console.obj.#")
- else:
- keyList.append("console.obj.*.*.org.apache.qpid.broker.agent")
- if self.rcvEvents:
- keyList.append("console.event.#")
- if self.rcvHeartbeats:
- keyList.append("console.heartbeat.#")
- return keyList
-
- def _handleBrokerConnect(self, broker):
- if self.console:
- self.console.brokerConnected(broker)
-
- def _handleBrokerDisconnect(self, broker):
- if self.console:
- self.console.brokerDisconnected(broker)
-
- def _handleBrokerResp(self, broker, codec, seq):
- broker.brokerId = UUID(codec.read_uuid())
- if self.console != None:
- self.console.brokerInfo(broker)
-
- # Send a package request
- # (effectively inc and dec outstanding by not doing anything)
- sendCodec = Codec(broker.conn.spec)
- seq = self.seqMgr._reserve(self._CONTEXT_STARTUP)
- broker._setHeader(sendCodec, 'P', seq)
- smsg = broker._message(sendCodec.encoded)
- broker._send(smsg)
-
- def _handlePackageInd(self, broker, codec, seq):
- pname = str(codec.read_str8())
- notify = False
- try:
- self.cv.acquire()
- if pname not in self.packages:
- self.packages[pname] = {}
- notify = True
- finally:
- self.cv.release()
- if notify and self.console != None:
- self.console.newPackage(pname)
-
- # Send a class request
- broker._incOutstanding()
- sendCodec = Codec(broker.conn.spec)
- seq = self.seqMgr._reserve(self._CONTEXT_STARTUP)
- broker._setHeader(sendCodec, 'Q', seq)
- sendCodec.write_str8(pname)
- smsg = broker._message(sendCodec.encoded)
- broker._send(smsg)
-
- def _handleCommandComplete(self, broker, codec, seq):
- code = codec.read_uint32()
- text = codec.read_str8()
- context = self.seqMgr._release(seq)
- if context == self._CONTEXT_STARTUP:
- broker._decOutstanding()
- elif context == self._CONTEXT_SYNC and seq == broker.syncSequence:
- try:
- broker.cv.acquire()
- broker.syncInFlight = False
- broker.cv.notify()
- finally:
- broker.cv.release()
- elif context == self._CONTEXT_MULTIGET and seq in self.syncSequenceList:
- try:
- self.cv.acquire()
- self.syncSequenceList.remove(seq)
- if len(self.syncSequenceList) == 0:
- self.cv.notify()
- finally:
- self.cv.release()
-
- def _handleClassInd(self, broker, codec, seq):
- kind = codec.read_uint8()
- classKey = ClassKey(codec)
- unknown = False
-
- try:
- self.cv.acquire()
- if classKey.getPackageName() in self.packages:
- if classKey.getPackageKey() not in self.packages[classKey.getPackageName()]:
- unknown = True
- finally:
- self.cv.release()
-
- if unknown:
- # Send a schema request for the unknown class
- broker._incOutstanding()
- sendCodec = Codec(broker.conn.spec)
- seq = self.seqMgr._reserve(self._CONTEXT_STARTUP)
- broker._setHeader(sendCodec, 'S', seq)
- classKey.encode(sendCodec)
- smsg = broker._message(sendCodec.encoded)
- broker._send(smsg)
-
- def _handleMethodResp(self, broker, codec, seq):
- code = codec.read_uint32()
- text = codec.read_str16()
- outArgs = {}
- method, synchronous = self.seqMgr._release(seq)
- if code == 0:
- for arg in method.arguments:
- if arg.dir.find("O") != -1:
- outArgs[arg.name] = self._decodeValue(codec, arg.type)
- result = MethodResult(code, text, outArgs)
- if synchronous:
- try:
- broker.cv.acquire()
- broker.syncResult = result
- broker.syncInFlight = False
- broker.cv.notify()
- finally:
- broker.cv.release()
- else:
- if self.console:
- self.console.methodResponse(broker, seq, result)
-
- def _handleHeartbeatInd(self, broker, codec, seq, msg):
- brokerBank = 1
- agentBank = 0
- dp = msg.get("delivery_properties")
- if dp:
- key = dp["routing_key"]
- keyElements = key.split(".")
- if len(keyElements) == 4:
- brokerBank = int(keyElements[2])
- agentBank = int(keyElements[3])
-
- agent = broker.getAgent(brokerBank, agentBank)
- timestamp = codec.read_uint64()
- if self.console != None and agent != None:
- self.console.heartbeat(agent, timestamp)
-
- def _handleEventInd(self, broker, codec, seq):
- if self.console != None:
- event = Event(self, broker, codec)
- self.console.event(broker, event)
-
- def _handleSchemaResp(self, broker, codec, seq):
- kind = codec.read_uint8()
- classKey = ClassKey(codec)
- _class = SchemaClass(kind, classKey, codec)
- try:
- self.cv.acquire()
- self.packages[classKey.getPackageName()][classKey.getPackageKey()] = _class
- finally:
- self.cv.release()
-
- self.seqMgr._release(seq)
- broker._decOutstanding()
- if self.console != None:
- self.console.newClass(kind, classKey)
-
- def _handleContentInd(self, broker, codec, seq, prop=False, stat=False):
- classKey = ClassKey(codec)
- try:
- self.cv.acquire()
- pname = classKey.getPackageName()
- if pname not in self.packages:
- return
- pkey = classKey.getPackageKey()
- if pkey not in self.packages[pname]:
- return
- schema = self.packages[pname][pkey]
- finally:
- self.cv.release()
-
- object = Object(self, broker, schema, codec, prop, stat)
- if pname == "org.apache.qpid.broker" and classKey.getClassName() == "agent" and prop:
- broker._updateAgent(object)
-
- try:
- self.cv.acquire()
- if seq in self.syncSequenceList:
- if object.getTimestamps()[2] == 0 and self._selectMatch(object):
- self.getResult.append(object)
- return
- finally:
- self.cv.release()
-
- if self.console and self.rcvObjects:
- if prop:
- self.console.objectProps(broker, object)
- if stat:
- self.console.objectStats(broker, object)
-
- def _handleError(self, error):
- self.error = error
- try:
- self.cv.acquire()
- self.syncSequenceList = []
- self.cv.notify()
- finally:
- self.cv.release()
-
- def _selectMatch(self, object):
- """ Check the object against self.getSelect to check for a match """
- for key, value in self.getSelect:
- for prop, propval in object.getProperties():
- if key == prop.name and value != propval:
- return False
- return True
-
- def _decodeValue(self, codec, typecode):
- """ Decode, from the codec, a value based on its typecode. """
- if typecode == 1: data = codec.read_uint8() # U8
- elif typecode == 2: data = codec.read_uint16() # U16
- elif typecode == 3: data = codec.read_uint32() # U32
- elif typecode == 4: data = codec.read_uint64() # U64
- elif typecode == 6: data = codec.read_str8() # SSTR
- elif typecode == 7: data = codec.read_str16() # LSTR
- elif typecode == 8: data = codec.read_int64() # ABSTIME
- elif typecode == 9: data = codec.read_uint64() # DELTATIME
- elif typecode == 10: data = ObjectId(codec) # REF
- elif typecode == 11: data = codec.read_uint8() != 0 # BOOL
- elif typecode == 12: data = codec.read_float() # FLOAT
- elif typecode == 13: data = codec.read_double() # DOUBLE
- elif typecode == 14: data = UUID(codec.read_uuid()) # UUID
- elif typecode == 15: data = codec.read_map() # FTABLE
- elif typecode == 16: data = codec.read_int8() # S8
- elif typecode == 17: data = codec.read_int16() # S16
- elif typecode == 18: data = codec.read_int32() # S32
- elif typecode == 19: data = codec.read_int64() # S63
- else:
- raise ValueError("Invalid type code: %d" % typecode)
- return data
-
- def _encodeValue(self, codec, value, typecode):
- """ Encode, into the codec, a value based on its typecode. """
- if typecode == 1: codec.write_uint8 (int(value)) # U8
- elif typecode == 2: codec.write_uint16 (int(value)) # U16
- elif typecode == 3: codec.write_uint32 (long(value)) # U32
- elif typecode == 4: codec.write_uint64 (long(value)) # U64
- elif typecode == 6: codec.write_str8 (value) # SSTR
- elif typecode == 7: codec.write_str16 (value) # LSTR
- elif typecode == 8: codec.write_int64 (long(value)) # ABSTIME
- elif typecode == 9: codec.write_uint64 (long(value)) # DELTATIME
- elif typecode == 10: value.encode (codec) # REF
- elif typecode == 11: codec.write_uint8 (int(value)) # BOOL
- elif typecode == 12: codec.write_float (float(value)) # FLOAT
- elif typecode == 13: codec.write_double (float(value)) # DOUBLE
- elif typecode == 14: codec.write_uuid (value.bytes) # UUID
- elif typecode == 15: codec.write_map (value) # FTABLE
- elif typecode == 16: codec.write_int8 (int(value)) # S8
- elif typecode == 17: codec.write_int16 (int(value)) # S16
- elif typecode == 18: codec.write_int32 (int(value)) # S32
- elif typecode == 19: codec.write_int64 (int(value)) # S64
- else:
- raise ValueError ("Invalid type code: %d" % typecode)
-
- def _displayValue(self, value, typecode):
- """ """
- if typecode == 1: return unicode(value)
- elif typecode == 2: return unicode(value)
- elif typecode == 3: return unicode(value)
- elif typecode == 4: return unicode(value)
- elif typecode == 6: return value
- elif typecode == 7: return value
- elif typecode == 8: return unicode(strftime("%c", gmtime(value / 1000000000)))
- elif typecode == 9: return unicode(value)
- elif typecode == 10: return unicode(value.__repr__())
- elif typecode == 11:
- if value: return u"T"
- else: return u"F"
- elif typecode == 12: return unicode(value)
- elif typecode == 13: return unicode(value)
- elif typecode == 14: return unicode(value.__repr__())
- elif typecode == 15: return unicode(value.__repr__())
- elif typecode == 16: return unicode(value)
- elif typecode == 17: return unicode(value)
- elif typecode == 18: return unicode(value)
- elif typecode == 19: return unicode(value)
- else:
- raise ValueError ("Invalid type code: %d" % typecode)
-
- def _sendMethodRequest(self, broker, schemaKey, objectId, name, argList):
- """ This function can be used to send a method request to an object given only the
- broker, schemaKey, and objectId. This is an uncommon usage pattern as methods are
- normally invoked on the object itself.
- """
- schema = self.getSchema(schemaKey)
- for method in schema.getMethods():
- if name == method.name:
- aIdx = 0
- sendCodec = Codec(broker.conn.spec)
- seq = self.seqMgr._reserve((method, False))
- broker._setHeader(sendCodec, 'M', seq)
- objectId.encode(sendCodec)
- schemaKey.encode(sendCodec)
- sendCodec.write_str8(name)
-
- count = 0
- for arg in method.arguments:
- if arg.dir.find("I") != -1:
- count += 1
- if count != len(argList):
- raise Exception("Incorrect number of arguments: expected %d, got %d" % (count, len(argList)))
-
- for arg in method.arguments:
- if arg.dir.find("I") != -1:
- self._encodeValue(sendCodec, argList[aIdx], arg.type)
- aIdx += 1
- smsg = broker._message(sendCodec.encoded, "agent.%d.%d" %
- (objectId.getBrokerBank(), objectId.getAgentBank()))
- broker._send(smsg)
- return seq
- return None
-
-class Package:
- """ """
- def __init__(self, name):
- self.name = name
-
-class ClassKey:
- """ A ClassKey uniquely identifies a class from the schema. """
- def __init__(self, constructor):
- if type(constructor) == str:
- # construct from __repr__ string
- try:
- self.pname, cls = constructor.split(":")
- self.cname, hsh = cls.split("(")
- hsh = hsh.strip(")")
- hexValues = hsh.split("-")
- h0 = int(hexValues[0], 16)
- h1 = int(hexValues[1], 16)
- h2 = int(hexValues[2], 16)
- h3 = int(hexValues[3], 16)
- self.hash = struct.pack("!LLLL", h0, h1, h2, h3)
- except:
- raise Exception("Invalid ClassKey format")
- else:
- # construct from codec
- codec = constructor
- self.pname = str(codec.read_str8())
- self.cname = str(codec.read_str8())
- self.hash = codec.read_bin128()
-
- def encode(self, codec):
- codec.write_str8(self.pname)
- codec.write_str8(self.cname)
- codec.write_bin128(self.hash)
-
- def getPackageName(self):
- return self.pname
-
- def getClassName(self):
- return self.cname
-
- def getHash(self):
- return self.hash
-
- def getHashString(self):
- return "%08x-%08x-%08x-%08x" % struct.unpack ("!LLLL", self.hash)
-
- def getPackageKey(self):
- return (self.cname, self.hash)
-
- def __repr__(self):
- return self.pname + ":" + self.cname + "(" + self.getHashString() + ")"
-
-class SchemaClass:
- """ """
- CLASS_KIND_TABLE = 1
- CLASS_KIND_EVENT = 2
-
- def __init__(self, kind, key, codec):
- self.kind = kind
- self.classKey = key
- self.properties = []
- self.statistics = []
- self.methods = []
- self.arguments = []
-
- if self.kind == self.CLASS_KIND_TABLE:
- propCount = codec.read_uint16()
- statCount = codec.read_uint16()
- methodCount = codec.read_uint16()
- for idx in range(propCount):
- self.properties.append(SchemaProperty(codec))
- for idx in range(statCount):
- self.statistics.append(SchemaStatistic(codec))
- for idx in range(methodCount):
- self.methods.append(SchemaMethod(codec))
-
- elif self.kind == self.CLASS_KIND_EVENT:
- argCount = codec.read_uint16()
- for idx in range(argCount):
- self.arguments.append(SchemaArgument(codec, methodArg=False))
-
- def __repr__(self):
- if self.kind == self.CLASS_KIND_TABLE:
- kindStr = "Table"
- elif self.kind == self.CLASS_KIND_EVENT:
- kindStr = "Event"
- else:
- kindStr = "Unsupported"
- result = "%s Class: %s " % (kindStr, self.classKey.__repr__())
- return result
-
- def getKey(self):
- """ Return the class-key for this class. """
- return self.classKey
-
- def getProperties(self):
- """ Return the list of properties for the class. """
- return self.properties
-
- def getStatistics(self):
- """ Return the list of statistics for the class. """
- return self.statistics
-
- def getMethods(self):
- """ Return the list of methods for the class. """
- return self.methods
-
- def getArguments(self):
- """ Return the list of events for the class. """
- return self.arguments
-
-class SchemaProperty:
- """ """
- def __init__(self, codec):
- map = codec.read_map()
- self.name = str(map["name"])
- self.type = map["type"]
- self.access = str(map["access"])
- self.index = map["index"] != 0
- self.optional = map["optional"] != 0
- self.unit = None
- self.min = None
- self.max = None
- self.maxlen = None
- self.desc = None
-
- for key, value in map.items():
- if key == "unit" : self.unit = value
- elif key == "min" : self.min = value
- elif key == "max" : self.max = value
- elif key == "maxlen" : self.maxlen = value
- elif key == "desc" : self.desc = value
-
- def __repr__(self):
- return self.name
-
-class SchemaStatistic:
- """ """
- def __init__(self, codec):
- map = codec.read_map()
- self.name = str(map["name"])
- self.type = map["type"]
- self.unit = None
- self.desc = None
-
- for key, value in map.items():
- if key == "unit" : self.unit = value
- elif key == "desc" : self.desc = value
-
- def __repr__(self):
- return self.name
-
-class SchemaMethod:
- """ """
- def __init__(self, codec):
- map = codec.read_map()
- self.name = str(map["name"])
- argCount = map["argCount"]
- if "desc" in map:
- self.desc = map["desc"]
- else:
- self.desc = None
- self.arguments = []
-
- for idx in range(argCount):
- self.arguments.append(SchemaArgument(codec, methodArg=True))
-
- def __repr__(self):
- result = self.name + "("
- first = True
- for arg in self.arguments:
- if arg.dir.find("I") != -1:
- if first:
- first = False
- else:
- result += ", "
- result += arg.name
- result += ")"
- return result
-
-class SchemaArgument:
- """ """
- def __init__(self, codec, methodArg):
- map = codec.read_map()
- self.name = str(map["name"])
- self.type = map["type"]
- if methodArg:
- self.dir = str(map["dir"]).upper()
- self.unit = None
- self.min = None
- self.max = None
- self.maxlen = None
- self.desc = None
- self.default = None
-
- for key, value in map.items():
- if key == "unit" : self.unit = value
- elif key == "min" : self.min = value
- elif key == "max" : self.max = value
- elif key == "maxlen" : self.maxlen = value
- elif key == "desc" : self.desc = value
- elif key == "default" : self.default = value
-
-class ObjectId:
- """ Object that represents QMF object identifiers """
- def __init__(self, codec, first=0, second=0):
- if codec:
- self.first = codec.read_uint64()
- self.second = codec.read_uint64()
- else:
- self.first = first
- self.second = second
-
- def __cmp__(self, other):
- if other == None or not isinstance(other, ObjectId) :
- return 1
- if self.first < other.first:
- return -1
- if self.first > other.first:
- return 1
- if self.second < other.second:
- return -1
- if self.second > other.second:
- return 1
- return 0
-
- def __repr__(self):
- return "%d-%d-%d-%d-%d" % (self.getFlags(), self.getSequence(),
- self.getBrokerBank(), self.getAgentBank(), self.getObject())
-
- def index(self):
- return (self.first, self.second)
-
- def getFlags(self):
- return (self.first & 0xF000000000000000) >> 60
-
- def getSequence(self):
- return (self.first & 0x0FFF000000000000) >> 48
-
- def getBrokerBank(self):
- return (self.first & 0x0000FFFFF0000000) >> 28
-
- def getAgentBank(self):
- return self.first & 0x000000000FFFFFFF
-
- def getObject(self):
- return self.second
-
- def isDurable(self):
- return self.getSequence() == 0
-
- def encode(self, codec):
- codec.write_uint64(self.first)
- codec.write_uint64(self.second)
-
- def __hash__(self):
- return (self.first, self.second).__hash__()
-
- def __eq__(self, other):
- return (self.first, self.second).__eq__(other)
-
-class Object(object):
- """ """
- def __init__(self, session, broker, schema, codec, prop, stat):
- """ """
- self._session = session
- self._broker = broker
- self._schema = schema
- self._currentTime = codec.read_uint64()
- self._createTime = codec.read_uint64()
- self._deleteTime = codec.read_uint64()
- self._objectId = ObjectId(codec)
- self._properties = []
- self._statistics = []
- if prop:
- notPresent = self._parsePresenceMasks(codec, schema)
- for property in schema.getProperties():
- if property.name in notPresent:
- self._properties.append((property, None))
- else:
- self._properties.append((property, self._session._decodeValue(codec, property.type)))
- if stat:
- for statistic in schema.getStatistics():
- self._statistics.append((statistic, self._session._decodeValue(codec, statistic.type)))
-
- def getBroker(self):
- """ Return the broker from which this object was sent """
- return self._broker
-
- def getObjectId(self):
- """ Return the object identifier for this object """
- return self._objectId
-
- def getClassKey(self):
- """ Return the class-key that references the schema describing this object. """
- return self._schema.getKey()
-
- def getSchema(self):
- """ Return the schema that describes this object. """
- return self._schema
-
- def getMethods(self):
- """ Return a list of methods available for this object. """
- return self._schema.getMethods()
-
- def getTimestamps(self):
- """ Return the current, creation, and deletion times for this object. """
- return self._currentTime, self._createTime, self._deleteTime
-
- def getIndex(self):
- """ Return a string describing this object's primary key. """
- result = u""
- for property, value in self._properties:
- if property.index:
- if result != u"":
- result += u":"
- try:
- valstr = unicode(self._session._displayValue(value, property.type))
- except:
- valstr = u"<undecodable>"
- result += valstr
- return result
-
- def getProperties(self):
- return self._properties
-
- def getStatistics(self):
- return self._statistics
-
- def mergeUpdate(self, newer):
- """ Replace properties and/or statistics with a newly received update """
- if self._objectId != newer._objectId:
- raise Exception("Objects with different object-ids")
- if len(newer.getProperties()) > 0:
- self.properties = newer.getProperties()
- if len(newer.getStatistics()) > 0:
- self.statistics = newer.getStatistics()
-
- def __repr__(self):
- key = self.getClassKey()
- return key.getPackageName() + ":" + key.getClassName() +\
- "[" + self.getObjectId().__repr__() + "] " + self.getIndex().encode("utf8")
-
- def __getattr__(self, name):
- for method in self._schema.getMethods():
- if name == method.name:
- return lambda *args, **kwargs : self._invoke(name, args, kwargs)
- for property, value in self._properties:
- if name == property.name:
- return value
- if name == "_" + property.name + "_" and property.type == 10: # Dereference references
- deref = self._session.getObjects(_objectId=value, _broker=self._broker)
- if len(deref) != 1:
- return None
- else:
- return deref[0]
- for statistic, value in self._statistics:
- if name == statistic.name:
- return value
- raise Exception("Type Object has no attribute '%s'" % name)
-
- def _sendMethodRequest(self, name, args, kwargs, synchronous=False):
- for method in self._schema.getMethods():
- if name == method.name:
- aIdx = 0
- sendCodec = Codec(self._broker.conn.spec)
- seq = self._session.seqMgr._reserve((method, synchronous))
- self._broker._setHeader(sendCodec, 'M', seq)
- self._objectId.encode(sendCodec)
- self._schema.getKey().encode(sendCodec)
- sendCodec.write_str8(name)
-
- count = 0
- for arg in method.arguments:
- if arg.dir.find("I") != -1:
- count += 1
- if count != len(args):
- raise Exception("Incorrect number of arguments: expected %d, got %d" % (count, len(args)))
-
- for arg in method.arguments:
- if arg.dir.find("I") != -1:
- self._session._encodeValue(sendCodec, args[aIdx], arg.type)
- aIdx += 1
- smsg = self._broker._message(sendCodec.encoded, "agent.%d.%d" %
- (self._objectId.getBrokerBank(), self._objectId.getAgentBank()))
- if synchronous:
- try:
- self._broker.cv.acquire()
- self._broker.syncInFlight = True
- finally:
- self._broker.cv.release()
- self._broker._send(smsg)
- return seq
- return None
-
- def _invoke(self, name, args, kwargs):
- if self._sendMethodRequest(name, args, kwargs, True):
- try:
- self._broker.cv.acquire()
- starttime = time()
- while self._broker.syncInFlight and self._broker.error == None:
- self._broker.cv.wait(self._broker.SYNC_TIME)
- if time() - starttime > self._broker.SYNC_TIME:
- self._session.seqMgr._release(seq)
- raise RuntimeError("Timed out waiting for method to respond")
- finally:
- self._broker.cv.release()
- if self._broker.error != None:
- errorText = self._broker.error
- self._broker.error = None
- raise Exception(errorText)
- return self._broker.syncResult
- raise Exception("Invalid Method (software defect) [%s]" % name)
-
- def _parsePresenceMasks(self, codec, schema):
- excludeList = []
- bit = 0
- for property in schema.getProperties():
- if property.optional:
- if bit == 0:
- mask = codec.read_uint8()
- bit = 1
- if (mask & bit) == 0:
- excludeList.append(property.name)
- bit *= 2
- if bit == 256:
- bit = 0
- return excludeList
-
-class MethodResult(object):
- """ """
- def __init__(self, status, text, outArgs):
- """ """
- self.status = status
- self.text = text
- self.outArgs = outArgs
-
- def __getattr__(self, name):
- if name in self.outArgs:
- return self.outArgs[name]
-
- def __repr__(self):
- return "%s (%d) - %s" % (self.text, self.status, self.outArgs)
-
-class ManagedConnection(Thread):
- """ Thread class for managing a connection. """
- DELAY_MIN = 1
- DELAY_MAX = 128
- DELAY_FACTOR = 2
-
- def __init__(self, broker):
- Thread.__init__(self)
- self.broker = broker
- self.cv = Condition()
- self.canceled = False
-
- def stop(self):
- """ Tell this thread to stop running and return. """
- try:
- self.cv.acquire()
- self.canceled = True
- self.cv.notify()
- finally:
- self.cv.release()
-
- def disconnected(self):
- """ Notify the thread that the connection was lost. """
- try:
- self.cv.acquire()
- self.cv.notify()
- finally:
- self.cv.release()
-
- def run(self):
- """ Main body of the running thread. """
- delay = self.DELAY_MIN
- while True:
- try:
- self.broker._tryToConnect()
- try:
- self.cv.acquire()
- while (not self.canceled) and self.broker.connected:
- self.cv.wait()
- if self.canceled:
- return
- delay = self.DELAY_MIN
- finally:
- self.cv.release()
- except socket.error:
- if delay < self.DELAY_MAX:
- delay *= self.DELAY_FACTOR
- except SessionDetached:
- if delay < self.DELAY_MAX:
- delay *= self.DELAY_FACTOR
- except Closed:
- if delay < self.DELAY_MAX:
- delay *= self.DELAY_FACTOR
-
- try:
- self.cv.acquire()
- self.cv.wait(delay)
- if self.canceled:
- return
- finally:
- self.cv.release()
-
-class Broker:
- """ This object represents a connection (or potential connection) to a QMF broker. """
- SYNC_TIME = 60
-
- def __init__(self, session, host, port, authMech, authUser, authPass, ssl=False):
- self.session = session
- self.host = host
- self.port = port
- self.ssl = ssl
- self.authUser = authUser
- self.authPass = authPass
- self.cv = Condition()
- self.error = None
- self.brokerId = None
- self.connected = False
- self.amqpSessionId = "%s.%d" % (os.uname()[1], os.getpid())
- if self.session.manageConnections:
- self.thread = ManagedConnection(self)
- self.thread.start()
- else:
- self.thread = None
- self._tryToConnect()
-
- def isConnected(self):
- """ Return True if there is an active connection to the broker. """
- return self.connected
-
- def getError(self):
- """ Return the last error message seen while trying to connect to the broker. """
- return self.error
-
- def getBrokerId(self):
- """ Get broker's unique identifier (UUID) """
- return self.brokerId
-
- def getBrokerBank(self):
- """ Return the broker-bank value. This is the value that the broker assigns to
- objects within its control. This value appears as a field in the ObjectId
- of objects created by agents controlled by this broker. """
- return 1
-
- def getAgent(self, brokerBank, agentBank):
- """ Return the agent object associated with a particular broker and agent bank value."""
- bankKey = (brokerBank, agentBank)
- if bankKey in self.agents:
- return self.agents[bankKey]
- return None
-
- def getSessionId(self):
- """ Get the identifier of the AMQP session to the broker """
- return self.amqpSessionId
-
- def getAgents(self):
- """ Get the list of agents reachable via this broker """
- return self.agents.values()
-
- def getAmqpSession(self):
- """ Get the AMQP session object for this connected broker. """
- return self.amqpSession
-
- def getUrl(self):
- """ """
- return "%s:%d" % (self.host, self.port)
-
- def getFullUrl(self, noAuthIfGuestDefault=True):
- """ """
- ssl = ""
- if self.ssl:
- ssl = "s"
- auth = "%s/%s@" % (self.authUser, self.authPass)
- if self.authUser == "" or \
- (noAuthIfGuestDefault and self.authUser == "guest" and self.authPass == "guest"):
- auth = ""
- return "amqp%s://%s%s:%d" % (ssl, auth, self.host, self.port or 5672)
-
- def __repr__(self):
- if self.connected:
- return "Broker connected at: %s" % self.getUrl()
- else:
- return "Disconnected Broker"
-
- def _tryToConnect(self):
- try:
- self.agents = {}
- self.agents[(1,0)] = Agent(self, 0, "BrokerAgent")
- self.topicBound = False
- self.syncInFlight = False
- self.syncRequest = 0
- self.syncResult = None
- self.reqsOutstanding = 1
-
- sock = connect(self.host, self.port)
- if self.ssl:
- sock = ssl(sock)
- self.conn = Connection(sock, username=self.authUser, password=self.authPass)
- self.conn.start()
- self.replyName = "reply-%s" % self.amqpSessionId
- self.amqpSession = self.conn.session(self.amqpSessionId)
- self.amqpSession.auto_sync = True
- self.amqpSession.queue_declare(queue=self.replyName, exclusive=True, auto_delete=True)
- self.amqpSession.exchange_bind(exchange="amq.direct",
- queue=self.replyName, binding_key=self.replyName)
- self.amqpSession.message_subscribe(queue=self.replyName, destination="rdest",
- accept_mode=self.amqpSession.accept_mode.none,
- acquire_mode=self.amqpSession.acquire_mode.pre_acquired)
- self.amqpSession.incoming("rdest").listen(self._replyCb, self._exceptionCb)
- self.amqpSession.message_set_flow_mode(destination="rdest", flow_mode=1)
- self.amqpSession.message_flow(destination="rdest", unit=0, value=0xFFFFFFFF)
- self.amqpSession.message_flow(destination="rdest", unit=1, value=0xFFFFFFFF)
-
- self.topicName = "topic-%s" % self.amqpSessionId
- self.amqpSession.queue_declare(queue=self.topicName, exclusive=True, auto_delete=True)
- self.amqpSession.message_subscribe(queue=self.topicName, destination="tdest",
- accept_mode=self.amqpSession.accept_mode.none,
- acquire_mode=self.amqpSession.acquire_mode.pre_acquired)
- self.amqpSession.incoming("tdest").listen(self._replyCb)
- self.amqpSession.message_set_flow_mode(destination="tdest", flow_mode=1)
- self.amqpSession.message_flow(destination="tdest", unit=0, value=0xFFFFFFFF)
- self.amqpSession.message_flow(destination="tdest", unit=1, value=0xFFFFFFFF)
-
- self.connected = True
- self.session._handleBrokerConnect(self)
-
- codec = Codec(self.conn.spec)
- self._setHeader(codec, 'B')
- msg = self._message(codec.encoded)
- self._send(msg)
-
- except socket.error, e:
- self.error = "Socket Error %s - %s" % (e[0], e[1])
- raise
- except Closed, e:
- self.error = "Connect Failed %d - %s" % (e[0], e[1])
- raise
- except ConnectionFailed, e:
- self.error = "Connect Failed %d - %s" % (e[0], e[1])
- raise
-
- def _updateAgent(self, obj):
- bankKey = (obj.brokerBank, obj.agentBank)
- if obj._deleteTime == 0:
- if bankKey not in self.agents:
- agent = Agent(self, obj.agentBank, obj.label)
- self.agents[bankKey] = agent
- if self.session.console != None:
- self.session.console.newAgent(agent)
- else:
- agent = self.agents.pop(bankKey, None)
- if agent != None and self.session.console != None:
- self.session.console.delAgent(agent)
-
- def _setHeader(self, codec, opcode, seq=0):
- """ Compose the header of a management message. """
- codec.write_uint8(ord('A'))
- codec.write_uint8(ord('M'))
- codec.write_uint8(ord('2'))
- codec.write_uint8(ord(opcode))
- codec.write_uint32(seq)
-
- def _checkHeader(self, codec):
- """ Check the header of a management message and extract the opcode and class. """
- try:
- octet = chr(codec.read_uint8())
- if octet != 'A':
- return None, None
- octet = chr(codec.read_uint8())
- if octet != 'M':
- return None, None
- octet = chr(codec.read_uint8())
- if octet != '2':
- return None, None
- opcode = chr(codec.read_uint8())
- seq = codec.read_uint32()
- return opcode, seq
- except:
- return None, None
-
- def _message (self, body, routing_key="broker"):
- dp = self.amqpSession.delivery_properties()
- dp.routing_key = routing_key
- mp = self.amqpSession.message_properties()
- mp.content_type = "x-application/qmf"
- mp.reply_to = self.amqpSession.reply_to("amq.direct", self.replyName)
- return Message(dp, mp, body)
-
- def _send(self, msg, dest="qpid.management"):
- self.amqpSession.message_transfer(destination=dest, message=msg)
-
- def _shutdown(self):
- if self.thread:
- self.thread.stop()
- self.thread.join()
- if self.connected:
- self.amqpSession.incoming("rdest").stop()
- if self.session.console != None:
- self.amqpSession.incoming("tdest").stop()
- self.amqpSession.close()
- self.conn.close()
- self.connected = False
-
- def _waitForStable(self):
- try:
- self.cv.acquire()
- if not self.connected:
- return
- if self.reqsOutstanding == 0:
- return
- self.syncInFlight = True
- starttime = time()
- while self.reqsOutstanding != 0:
- self.cv.wait(self.SYNC_TIME)
- if time() - starttime > self.SYNC_TIME:
- raise RuntimeError("Timed out waiting for broker to synchronize")
- finally:
- self.cv.release()
-
- def _incOutstanding(self):
- try:
- self.cv.acquire()
- self.reqsOutstanding += 1
- finally:
- self.cv.release()
-
- def _decOutstanding(self):
- try:
- self.cv.acquire()
- self.reqsOutstanding -= 1
- if self.reqsOutstanding == 0 and not self.topicBound:
- self.topicBound = True
- for key in self.session.bindingKeyList:
- self.amqpSession.exchange_bind(exchange="qpid.management",
- queue=self.topicName, binding_key=key)
- if self.reqsOutstanding == 0 and self.syncInFlight:
- self.syncInFlight = False
- self.cv.notify()
- finally:
- self.cv.release()
-
- def _replyCb(self, msg):
- codec = Codec(self.conn.spec, msg.body)
- while True:
- opcode, seq = self._checkHeader(codec)
- if opcode == None: return
- if opcode == 'b': self.session._handleBrokerResp (self, codec, seq)
- elif opcode == 'p': self.session._handlePackageInd (self, codec, seq)
- elif opcode == 'z': self.session._handleCommandComplete (self, codec, seq)
- elif opcode == 'q': self.session._handleClassInd (self, codec, seq)
- elif opcode == 'm': self.session._handleMethodResp (self, codec, seq)
- elif opcode == 'h': self.session._handleHeartbeatInd (self, codec, seq, msg)
- elif opcode == 'e': self.session._handleEventInd (self, codec, seq)
- elif opcode == 's': self.session._handleSchemaResp (self, codec, seq)
- elif opcode == 'c': self.session._handleContentInd (self, codec, seq, prop=True)
- elif opcode == 'i': self.session._handleContentInd (self, codec, seq, stat=True)
- elif opcode == 'g': self.session._handleContentInd (self, codec, seq, prop=True, stat=True)
-
- def _exceptionCb(self, data):
- self.connected = False
- self.error = data
- try:
- self.cv.acquire()
- if self.syncInFlight:
- self.cv.notify()
- finally:
- self.cv.release()
- self.session._handleError(self.error)
- self.session._handleBrokerDisconnect(self)
- if self.thread:
- self.thread.disconnected()
-
-class Agent:
- """ """
- def __init__(self, broker, agentBank, label):
- self.broker = broker
- self.brokerBank = broker.getBrokerBank()
- self.agentBank = agentBank
- self.label = label
-
- def __repr__(self):
- return "Agent at bank %d.%d (%s)" % (self.brokerBank, self.agentBank, self.label)
-
- def getBroker(self):
- return self.broker
-
- def getBrokerBank(self):
- return self.brokerBank
-
- def getAgentBank(self):
- return self.agentBank
-
-class Event:
- """ """
- def __init__(self, session, broker, codec):
- self.session = session
- self.broker = broker
- self.classKey = ClassKey(codec)
- self.timestamp = codec.read_int64()
- self.severity = codec.read_uint8()
- self.schema = None
- pname = self.classKey.getPackageName()
- pkey = self.classKey.getPackageKey()
- if pname in session.packages:
- if pkey in session.packages[pname]:
- self.schema = session.packages[pname][pkey]
- self.arguments = {}
- for arg in self.schema.arguments:
- self.arguments[arg.name] = session._decodeValue(codec, arg.type)
-
- def __repr__(self):
- if self.schema == None:
- return "<uninterpretable>"
- out = strftime("%c", gmtime(self.timestamp / 1000000000))
- out += " " + self._sevName() + " " + self.classKey.getPackageName() + ":" + self.classKey.getClassName()
- out += " broker=" + self.broker.getUrl()
- for arg in self.schema.arguments:
- disp = self.session._displayValue(self.arguments[arg.name], arg.type).encode("utf8")
- if " " in disp:
- disp = "\"" + disp + "\""
- out += " " + arg.name + "=" + disp
- return out
-
- def _sevName(self):
- if self.severity == 0 : return "EMER "
- if self.severity == 1 : return "ALERT"
- if self.severity == 2 : return "CRIT "
- if self.severity == 3 : return "ERROR"
- if self.severity == 4 : return "WARN "
- if self.severity == 5 : return "NOTIC"
- if self.severity == 6 : return "INFO "
- if self.severity == 7 : return "DEBUG"
- return "INV-%d" % self.severity
-
- def getClassKey(self):
- return self.classKey
-
- def getArguments(self):
- return self.arguments
-
- def getTimestamp(self):
- return self.timestamp
-
- def getName(self):
- return self.name
-
- def getSchema(self):
- return self.schema
-
-class SequenceManager:
- """ Manage sequence numbers for asynchronous method calls """
- def __init__(self):
- self.lock = Lock()
- self.sequence = 0
- self.pending = {}
-
- def _reserve(self, data):
- """ Reserve a unique sequence number """
- try:
- self.lock.acquire()
- result = self.sequence
- self.sequence = self.sequence + 1
- self.pending[result] = data
- finally:
- self.lock.release()
- return result
-
- def _release(self, seq):
- """ Release a reserved sequence number """
- data = None
- try:
- self.lock.acquire()
- if seq in self.pending:
- data = self.pending[seq]
- del self.pending[seq]
- finally:
- self.lock.release()
- return data
-
-
-class DebugConsole(Console):
- """ """
- def brokerConnected(self, broker):
- print "brokerConnected:", broker
-
- def brokerDisconnected(self, broker):
- print "brokerDisconnected:", broker
-
- def newPackage(self, name):
- print "newPackage:", name
-
- def newClass(self, kind, classKey):
- print "newClass:", kind, classKey
-
- def newAgent(self, agent):
- print "newAgent:", agent
-
- def delAgent(self, agent):
- print "delAgent:", agent
-
- def objectProps(self, broker, record):
- print "objectProps:", record
-
- def objectStats(self, broker, record):
- print "objectStats:", record
-
- def event(self, broker, event):
- print "event:", event
-
- def heartbeat(self, agent, timestamp):
- print "heartbeat:", agent
-
- def brokerInfo(self, broker):
- print "brokerInfo:", broker
-
diff --git a/M4-RCs/qpid/python/qpid/__init__.py b/M4-RCs/qpid/python/qpid/__init__.py
deleted file mode 100644
index ff9cc04df8..0000000000
--- a/M4-RCs/qpid/python/qpid/__init__.py
+++ /dev/null
@@ -1,84 +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.
-#
-
-import spec, codec, connection, content, peer, delegate, client
-
-class Struct:
-
- def __init__(self, type, *args, **kwargs):
- self.__dict__["type"] = type
- self.__dict__["_values"] = {}
-
- if len(args) > len(self.type.fields):
- raise TypeError("too many args")
-
- for a, f in zip(args, self.type.fields):
- self.set(f.name, a)
-
- for k, a in kwargs.items():
- self.set(k, a)
-
- def _check(self, attr):
- field = self.type.fields.byname.get(attr)
- if field == None:
- raise AttributeError(attr)
- return field
-
- def exists(self, attr):
- return self.type.fields.byname.has_key(attr)
-
- def has(self, attr):
- self._check(attr)
- return self._values.has_key(attr)
-
- def set(self, attr, value):
- self._check(attr)
- self._values[attr] = value
-
- def get(self, attr):
- field = self._check(attr)
- return self._values.get(attr, field.default())
-
- def clear(self, attr):
- self._check(attr)
- del self._values[attr]
-
- def __setattr__(self, attr, value):
- self.set(attr, value)
-
- def __getattr__(self, attr):
- return self.get(attr)
-
- def __delattr__(self, attr):
- self.clear(attr)
-
- def __setitem__(self, attr, value):
- self.set(attr, value)
-
- def __getitem__(self, attr):
- return self.get(attr)
-
- def __delitem__(self, attr):
- self.clear(attr)
-
- def __str__(self):
- return "%s %s" % (self.type, self._values)
-
- def __repr__(self):
- return str(self)
diff --git a/M4-RCs/qpid/python/qpid/assembler.py b/M4-RCs/qpid/python/qpid/assembler.py
deleted file mode 100644
index 92bb0aa0f8..0000000000
--- a/M4-RCs/qpid/python/qpid/assembler.py
+++ /dev/null
@@ -1,118 +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 codec010 import StringCodec
-from framer import *
-from logging import getLogger
-
-log = getLogger("qpid.io.seg")
-
-class Segment:
-
- def __init__(self, first, last, type, track, channel, payload):
- self.id = None
- self.offset = None
- self.first = first
- self.last = last
- self.type = type
- self.track = track
- self.channel = channel
- self.payload = payload
-
- def decode(self, spec):
- segs = spec["segment_type"]
- choice = segs.choices[self.type]
- return getattr(self, "decode_%s" % choice.name)(spec)
-
- def decode_control(self, spec):
- sc = StringCodec(spec, self.payload)
- return sc.read_control()
-
- def decode_command(self, spec):
- sc = StringCodec(spec, self.payload)
- hdr, cmd = sc.read_command()
- cmd.id = self.id
- return hdr, cmd
-
- def decode_header(self, spec):
- sc = StringCodec(spec, self.payload)
- values = []
- while len(sc.encoded) > 0:
- values.append(sc.read_struct32())
- return values
-
- def decode_body(self, spec):
- return self.payload
-
- def __str__(self):
- return "%s%s %s %s %s %r" % (int(self.first), int(self.last), self.type,
- self.track, self.channel, self.payload)
-
- def __repr__(self):
- return str(self)
-
-class Assembler(Framer):
-
- def __init__(self, sock, max_payload = Frame.MAX_PAYLOAD):
- Framer.__init__(self, sock)
- self.max_payload = max_payload
- self.fragments = {}
-
- def read_segment(self):
- while True:
- frame = self.read_frame()
-
- key = (frame.channel, frame.track)
- seg = self.fragments.get(key)
- if seg == None:
- seg = Segment(frame.isFirstSegment(), frame.isLastSegment(),
- frame.type, frame.track, frame.channel, "")
- self.fragments[key] = seg
-
- seg.payload += frame.payload
-
- if frame.isLastFrame():
- self.fragments.pop(key)
- log.debug("RECV %s", seg)
- return seg
-
- def write_segment(self, segment):
- remaining = segment.payload
-
- first = True
- while first or remaining:
- payload = remaining[:self.max_payload]
- remaining = remaining[self.max_payload:]
-
- flags = 0
- if first:
- flags |= FIRST_FRM
- first = False
- if not remaining:
- flags |= LAST_FRM
- if segment.first:
- flags |= FIRST_SEG
- if segment.last:
- flags |= LAST_SEG
-
- frame = Frame(flags, segment.type, segment.track, segment.channel,
- payload)
- self.write_frame(frame)
-
- log.debug("SENT %s", segment)
diff --git a/M4-RCs/qpid/python/qpid/client.py b/M4-RCs/qpid/python/qpid/client.py
deleted file mode 100644
index 4605710de8..0000000000
--- a/M4-RCs/qpid/python/qpid/client.py
+++ /dev/null
@@ -1,225 +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.
-#
-
-"""
-An AQMP client implementation that uses a custom delegate for
-interacting with the server.
-"""
-
-import os, threading
-from peer import Peer, Channel, Closed
-from delegate import Delegate
-from connection08 import Connection, Frame, connect
-from spec import load
-from queue import Queue
-from reference import ReferenceId, References
-
-
-class Client:
-
- def __init__(self, host, port, spec = None, vhost = None):
- self.host = host
- self.port = port
- if spec:
- self.spec = spec
- else:
- try:
- name = os.environ["AMQP_SPEC"]
- except KeyError:
- raise EnvironmentError("environment variable AMQP_SPEC must be set")
- self.spec = load(name)
- self.structs = StructFactory(self.spec)
- self.sessions = {}
-
- self.mechanism = None
- self.response = None
- self.locale = None
-
- self.vhost = vhost
- if self.vhost == None:
- self.vhost = "/"
-
- self.queues = {}
- self.lock = threading.Lock()
-
- self.closed = False
- self.reason = None
- self.started = threading.Event()
-
- def wait(self):
- self.started.wait()
- if self.closed:
- raise Closed(self.reason)
-
- def queue(self, key):
- self.lock.acquire()
- try:
- try:
- q = self.queues[key]
- except KeyError:
- q = Queue(0)
- self.queues[key] = q
- finally:
- self.lock.release()
- return q
-
- def start(self, response, mechanism="AMQPLAIN", locale="en_US", tune_params=None):
- self.mechanism = mechanism
- self.response = response
- self.locale = locale
- self.tune_params = tune_params
-
- self.socket = connect(self.host, self.port)
- self.conn = Connection(self.socket, self.spec)
- self.peer = Peer(self.conn, ClientDelegate(self), Session)
-
- self.conn.init()
- self.peer.start()
- self.wait()
- self.channel(0).connection_open(self.vhost)
-
- def channel(self, id):
- self.lock.acquire()
- try:
- ssn = self.peer.channel(id)
- ssn.client = self
- self.sessions[id] = ssn
- finally:
- self.lock.release()
- return ssn
-
- def session(self):
- self.lock.acquire()
- try:
- id = None
- for i in xrange(1, 64*1024):
- if not self.sessions.has_key(id):
- id = i
- break
- finally:
- self.lock.release()
- if id == None:
- raise RuntimeError("out of channels")
- else:
- return self.channel(id)
-
- def close(self):
- self.socket.close()
-
-class ClientDelegate(Delegate):
-
- def __init__(self, client):
- Delegate.__init__(self)
- self.client = client
-
- def connection_start(self, ch, msg):
- msg.start_ok(mechanism=self.client.mechanism,
- response=self.client.response,
- locale=self.client.locale)
-
- def connection_tune(self, ch, msg):
- if self.client.tune_params:
- #todo: just override the params, i.e. don't require them
- # all to be included in tune_params
- msg.tune_ok(**self.client.tune_params)
- else:
- msg.tune_ok(*msg.frame.args)
- self.client.started.set()
-
- def message_transfer(self, ch, msg):
- self.client.queue(msg.destination).put(msg)
-
- def message_open(self, ch, msg):
- ch.references.open(msg.reference)
-
- def message_close(self, ch, msg):
- ch.references.close(msg.reference)
-
- def message_append(self, ch, msg):
- ch.references.get(msg.reference).append(msg.bytes)
-
- def message_acquired(self, ch, msg):
- ch.control_queue.put(msg)
-
- def basic_deliver(self, ch, msg):
- self.client.queue(msg.consumer_tag).put(msg)
-
- def channel_pong(self, ch, msg):
- msg.ok()
-
- def channel_close(self, ch, msg):
- ch.closed(msg)
-
- def session_ack(self, ch, msg):
- pass
-
- def session_closed(self, ch, msg):
- ch.closed(msg)
-
- def connection_close(self, ch, msg):
- self.client.peer.closed(msg)
-
- def execution_complete(self, ch, msg):
- ch.completion.complete(msg.cumulative_execution_mark)
-
- def execution_result(self, ch, msg):
- future = ch.futures[msg.command_id]
- future.put_response(ch, msg.data)
-
- def closed(self, reason):
- self.client.closed = True
- self.client.reason = reason
- self.client.started.set()
-
-class StructFactory:
-
- def __init__(self, spec):
- self.spec = spec
- self.factories = {}
-
- def __getattr__(self, name):
- if self.factories.has_key(name):
- return self.factories[name]
- elif self.spec.domains.byname.has_key(name):
- f = lambda *args, **kwargs: self.struct(name, *args, **kwargs)
- self.factories[name] = f
- return f
- else:
- raise AttributeError(name)
-
- def struct(self, name, *args, **kwargs):
- return self.spec.struct(name, *args, **kwargs)
-
-class Session(Channel):
-
- def __init__(self, *args):
- Channel.__init__(self, *args)
- self.references = References()
- self.client = None
-
- def open(self):
- self.session_open()
-
- def close(self):
- self.session_close()
- self.client.lock.acquire()
- try:
- del self.client.sessions[self.id]
- finally:
- self.client.lock.release()
diff --git a/M4-RCs/qpid/python/qpid/codec.py b/M4-RCs/qpid/python/qpid/codec.py
deleted file mode 100644
index 8026b209dc..0000000000
--- a/M4-RCs/qpid/python/qpid/codec.py
+++ /dev/null
@@ -1,590 +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.
-#
-
-"""
-Utility code to translate between python objects and AMQP encoded data
-fields.
-
-The unit test for this module is located in tests/codec.py
-"""
-
-import re, qpid, spec08
-from cStringIO import StringIO
-from struct import *
-from reference import ReferenceId
-
-class EOF(Exception):
- pass
-
-TYPE_ALIASES = {
- "long_string": "longstr",
- "unsigned_int": "long"
- }
-
-class Codec:
-
- """
- class that handles encoding/decoding of AMQP primitives
- """
-
- def __init__(self, stream, spec):
- """
- initializing the stream/fields used
- """
- self.stream = stream
- self.spec = spec
- self.nwrote = 0
- self.nread = 0
- self.incoming_bits = []
- self.outgoing_bits = []
-
- self.types = {}
- self.codes = {}
- self.encodings = {
- basestring: "longstr",
- int: "long",
- long: "long",
- None.__class__:"void",
- list: "sequence",
- tuple: "sequence",
- dict: "table"
- }
-
- for constant in self.spec.constants:
- if constant.klass == "field-table-type":
- type = constant.name.replace("field_table_", "")
- self.typecode(constant.id, TYPE_ALIASES.get(type, type))
-
- if not self.types:
- self.typecode(ord('S'), "longstr")
- self.typecode(ord('I'), "long")
-
- def typecode(self, code, type):
- self.types[code] = type
- self.codes[type] = code
-
- def resolve(self, klass):
- if self.encodings.has_key(klass):
- return self.encodings[klass]
- for base in klass.__bases__:
- result = self.resolve(base)
- if result != None:
- return result
-
- def read(self, n):
- """
- reads in 'n' bytes from the stream. Can raise EOF exception
- """
- self.clearbits()
- data = self.stream.read(n)
- if n > 0 and len(data) == 0:
- raise EOF()
- self.nread += len(data)
- return data
-
- def write(self, s):
- """
- writes data 's' to the stream
- """
- self.flushbits()
- self.stream.write(s)
- self.nwrote += len(s)
-
- def flush(self):
- """
- flushes the bits and data present in the stream
- """
- self.flushbits()
- self.stream.flush()
-
- def flushbits(self):
- """
- flushes the bits(compressed into octets) onto the stream
- """
- if len(self.outgoing_bits) > 0:
- bytes = []
- index = 0
- for b in self.outgoing_bits:
- if index == 0: bytes.append(0)
- if b: bytes[-1] |= 1 << index
- index = (index + 1) % 8
- del self.outgoing_bits[:]
- for byte in bytes:
- self.encode_octet(byte)
-
- def clearbits(self):
- if self.incoming_bits:
- self.incoming_bits = []
-
- def pack(self, fmt, *args):
- """
- packs the data 'args' as per the format 'fmt' and writes it to the stream
- """
- self.write(pack(fmt, *args))
-
- def unpack(self, fmt):
- """
- reads data from the stream and unpacks it as per the format 'fmt'
- """
- size = calcsize(fmt)
- data = self.read(size)
- values = unpack(fmt, data)
- if len(values) == 1:
- return values[0]
- else:
- return values
-
- def encode(self, type, value):
- """
- calls the appropriate encode function e.g. encode_octet, encode_short etc.
- """
- if isinstance(type, spec08.Struct):
- self.encode_struct(type, value)
- else:
- getattr(self, "encode_" + type)(value)
-
- def decode(self, type):
- """
- calls the appropriate decode function e.g. decode_octet, decode_short etc.
- """
- if isinstance(type, spec08.Struct):
- return self.decode_struct(type)
- else:
- return getattr(self, "decode_" + type)()
-
- def encode_bit(self, o):
- """
- encodes a bit
- """
- if o:
- self.outgoing_bits.append(True)
- else:
- self.outgoing_bits.append(False)
-
- def decode_bit(self):
- """
- decodes a bit
- """
- if len(self.incoming_bits) == 0:
- bits = self.decode_octet()
- for i in range(8):
- self.incoming_bits.append(bits >> i & 1 != 0)
- return self.incoming_bits.pop(0)
-
- def encode_octet(self, o):
- """
- encodes octet (8 bits) data 'o' in network byte order
- """
-
- # octet's valid range is [0,255]
- if (o < 0 or o > 255):
- raise ValueError('Valid range of octet is [0,255]')
-
- self.pack("!B", int(o))
-
- def decode_octet(self):
- """
- decodes a octet (8 bits) encoded in network byte order
- """
- return self.unpack("!B")
-
- def encode_short(self, o):
- """
- encodes short (16 bits) data 'o' in network byte order
- """
-
- # short int's valid range is [0,65535]
- if (o < 0 or o > 65535):
- raise ValueError('Valid range of short int is [0,65535]: %s' % o)
-
- self.pack("!H", int(o))
-
- def decode_short(self):
- """
- decodes a short (16 bits) in network byte order
- """
- return self.unpack("!H")
-
- def encode_long(self, o):
- """
- encodes long (32 bits) data 'o' in network byte order
- """
-
- # we need to check both bounds because on 64 bit platforms
- # struct.pack won't raise an error if o is too large
- if (o < 0 or o > 4294967295):
- raise ValueError('Valid range of long int is [0,4294967295]')
-
- self.pack("!L", int(o))
-
- def decode_long(self):
- """
- decodes a long (32 bits) in network byte order
- """
- return self.unpack("!L")
-
- def encode_signed_long(self, o):
- self.pack("!q", o)
-
- def decode_signed_long(self):
- return self.unpack("!q")
-
- def encode_signed_int(self, o):
- self.pack("!l", o)
-
- def decode_signed_int(self):
- return self.unpack("!l")
-
- def encode_longlong(self, o):
- """
- encodes long long (64 bits) data 'o' in network byte order
- """
- self.pack("!Q", o)
-
- def decode_longlong(self):
- """
- decodes a long long (64 bits) in network byte order
- """
- return self.unpack("!Q")
-
- def encode_float(self, o):
- self.pack("!f", o)
-
- def decode_float(self):
- return self.unpack("!f")
-
- def encode_double(self, o):
- self.pack("!d", o)
-
- def decode_double(self):
- return self.unpack("!d")
-
- def encode_bin128(self, b):
- for idx in range (0,16):
- self.pack("!B", ord (b[idx]))
-
- def decode_bin128(self):
- result = ""
- for idx in range (0,16):
- result = result + chr (self.unpack("!B"))
- return result
-
- def encode_raw(self, len, b):
- for idx in range (0,len):
- self.pack("!B", b[idx])
-
- def decode_raw(self, len):
- result = ""
- for idx in range (0,len):
- result = result + chr (self.unpack("!B"))
- return result
-
- def enc_str(self, fmt, s):
- """
- encodes a string 's' in network byte order as per format 'fmt'
- """
- size = len(s)
- self.pack(fmt, size)
- self.write(s)
-
- def dec_str(self, fmt):
- """
- decodes a string in network byte order as per format 'fmt'
- """
- size = self.unpack(fmt)
- return self.read(size)
-
- def encode_shortstr(self, s):
- """
- encodes a short string 's' in network byte order
- """
-
- # short strings are limited to 255 octets
- if len(s) > 255:
- raise ValueError('Short strings are limited to 255 octets')
-
- self.enc_str("!B", s)
-
- def decode_shortstr(self):
- """
- decodes a short string in network byte order
- """
- return self.dec_str("!B")
-
- def encode_longstr(self, s):
- """
- encodes a long string 's' in network byte order
- """
- if isinstance(s, dict):
- self.encode_table(s)
- else:
- self.enc_str("!L", s)
-
- def decode_longstr(self):
- """
- decodes a long string 's' in network byte order
- """
- return self.dec_str("!L")
-
- def encode_table(self, tbl):
- """
- encodes a table data structure in network byte order
- """
- enc = StringIO()
- codec = Codec(enc, self.spec)
- if tbl:
- for key, value in tbl.items():
- if self.spec.major == 8 and self.spec.minor == 0 and len(key) > 128:
- raise ValueError("field table key too long: '%s'" % key)
- type = self.resolve(value.__class__)
- if type == None:
- raise ValueError("no encoding for: " + value.__class__)
- codec.encode_shortstr(key)
- codec.encode_octet(self.codes[type])
- codec.encode(type, value)
- s = enc.getvalue()
- self.encode_long(len(s))
- self.write(s)
-
- def decode_table(self):
- """
- decodes a table data structure in network byte order
- """
- size = self.decode_long()
- start = self.nread
- result = {}
- while self.nread - start < size:
- key = self.decode_shortstr()
- code = self.decode_octet()
- if self.types.has_key(code):
- value = self.decode(self.types[code])
- else:
- w = width(code)
- if fixed(code):
- value = self.read(w)
- else:
- value = self.read(self.dec_num(w))
- result[key] = value
- return result
-
- def encode_timestamp(self, t):
- """
- encodes a timestamp data structure in network byte order
- """
- self.encode_longlong(t)
-
- def decode_timestamp(self):
- """
- decodes a timestamp data structure in network byte order
- """
- return self.decode_longlong()
-
- def encode_content(self, s):
- """
- encodes a content data structure in network byte order
-
- content can be passed as a string in which case it is assumed to
- be inline data, or as an instance of ReferenceId indicating it is
- a reference id
- """
- if isinstance(s, ReferenceId):
- self.encode_octet(1)
- self.encode_longstr(s.id)
- else:
- self.encode_octet(0)
- self.encode_longstr(s)
-
- def decode_content(self):
- """
- decodes a content data structure in network byte order
-
- return a string for inline data and a ReferenceId instance for
- references
- """
- type = self.decode_octet()
- if type == 0:
- return self.decode_longstr()
- else:
- return ReferenceId(self.decode_longstr())
-
- # new domains for 0-10:
-
- def encode_rfc1982_long(self, s):
- self.encode_long(s)
-
- def decode_rfc1982_long(self):
- return self.decode_long()
-
- def encode_rfc1982_long_set(self, s):
- self.encode_short(len(s) * 4)
- for i in s:
- self.encode_long(i)
-
- def decode_rfc1982_long_set(self):
- count = self.decode_short() / 4
- set = []
- for i in range(0, count):
- set.append(self.decode_long())
- return set;
-
- def encode_uuid(self, s):
- self.pack("16s", s)
-
- def decode_uuid(self):
- return self.unpack("16s")
-
- def enc_num(self, width, n):
- if width == 1:
- self.encode_octet(n)
- elif width == 2:
- self.encode_short(n)
- elif width == 3:
- self.encode_long(n)
- else:
- raise ValueError("invalid width: %s" % width)
-
- def dec_num(self, width):
- if width == 1:
- return self.decode_octet()
- elif width == 2:
- return self.decode_short()
- elif width == 4:
- return self.decode_long()
- else:
- raise ValueError("invalid width: %s" % width)
-
- def encode_struct(self, type, s):
- if type.size:
- enc = StringIO()
- codec = Codec(enc, self.spec)
- codec.encode_struct_body(type, s)
- codec.flush()
- body = enc.getvalue()
- self.enc_num(type.size, len(body))
- self.write(body)
- else:
- self.encode_struct_body(type, s)
-
- def decode_struct(self, type):
- if type.size:
- size = self.dec_num(type.size)
- if size == 0:
- return None
- return self.decode_struct_body(type)
-
- def encode_struct_body(self, type, s):
- reserved = 8*type.pack - len(type.fields)
- assert reserved >= 0
-
- for f in type.fields:
- if s == None:
- self.encode_bit(False)
- elif f.type == "bit":
- self.encode_bit(s.get(f.name))
- else:
- self.encode_bit(s.has(f.name))
-
- for i in range(reserved):
- self.encode_bit(False)
-
- for f in type.fields:
- if f.type != "bit" and s != None and s.has(f.name):
- self.encode(f.type, s.get(f.name))
-
- self.flush()
-
- def decode_struct_body(self, type):
- reserved = 8*type.pack - len(type.fields)
- assert reserved >= 0
-
- s = qpid.Struct(type)
-
- for f in type.fields:
- if f.type == "bit":
- s.set(f.name, self.decode_bit())
- elif self.decode_bit():
- s.set(f.name, None)
-
- for i in range(reserved):
- if self.decode_bit():
- raise ValueError("expecting reserved flag")
-
- for f in type.fields:
- if f.type != "bit" and s.has(f.name):
- s.set(f.name, self.decode(f.type))
-
- self.clearbits()
-
- return s
-
- def encode_long_struct(self, s):
- enc = StringIO()
- codec = Codec(enc, self.spec)
- type = s.type
- codec.encode_short(type.type)
- codec.encode_struct_body(type, s)
- self.encode_longstr(enc.getvalue())
-
- def decode_long_struct(self):
- codec = Codec(StringIO(self.decode_longstr()), self.spec)
- type = self.spec.structs[codec.decode_short()]
- return codec.decode_struct_body(type)
-
- def decode_array(self):
- size = self.decode_long()
- code = self.decode_octet()
- count = self.decode_long()
- result = []
- for i in range(0, count):
- if self.types.has_key(code):
- value = self.decode(self.types[code])
- else:
- w = width(code)
- if fixed(code):
- value = self.read(w)
- else:
- value = self.read(self.dec_num(w))
- result.append(value)
- return result
-
-def fixed(code):
- return (code >> 6) != 2
-
-def width(code):
- # decimal
- if code >= 192:
- decsel = (code >> 4) & 3
- if decsel == 0:
- return 5
- elif decsel == 1:
- return 9
- elif decsel == 3:
- return 0
- else:
- raise ValueError(code)
- # variable width
- elif code < 192 and code >= 128:
- lenlen = (code >> 4) & 3
- if lenlen == 3: raise ValueError(code)
- return 2 ** lenlen
- # fixed width
- else:
- return (code >> 4) & 7
diff --git a/M4-RCs/qpid/python/qpid/codec010.py b/M4-RCs/qpid/python/qpid/codec010.py
deleted file mode 100644
index f34025ef17..0000000000
--- a/M4-RCs/qpid/python/qpid/codec010.py
+++ /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.
-#
-
-import datetime
-from packer import Packer
-from datatypes import serial, timestamp, RangedSet, Struct
-
-class CodecException(Exception): pass
-
-class Codec(Packer):
-
- def __init__(self, spec):
- self.spec = spec
-
- def write_void(self, v):
- assert v == None
- def read_void(self):
- return None
-
- def write_bit(self, b):
- if not b: raise ValueError(b)
- def read_bit(self):
- return True
-
- def read_uint8(self):
- return self.unpack("!B")
- def write_uint8(self, n):
- return self.pack("!B", n)
-
- def read_int8(self):
- return self.unpack("!b")
- def write_int8(self, n):
- self.pack("!b", n)
-
- def read_char(self):
- return self.unpack("!c")
- def write_char(self, c):
- self.pack("!c", c)
-
- def read_boolean(self):
- return self.read_uint8() != 0
- def write_boolean(self, b):
- if b: n = 1
- else: n = 0
- self.write_uint8(n)
-
-
- def read_uint16(self):
- return self.unpack("!H")
- def write_uint16(self, n):
- self.pack("!H", n)
-
- def read_int16(self):
- return self.unpack("!h")
- def write_int16(self, n):
- self.pack("!h", n)
-
-
- def read_uint32(self):
- return self.unpack("!L")
- def write_uint32(self, n):
- self.pack("!L", n)
-
- def read_int32(self):
- return self.unpack("!l")
- def write_int32(self, n):
- self.pack("!l", n)
-
- def read_float(self):
- return self.unpack("!f")
- def write_float(self, f):
- self.pack("!f", f)
-
- def read_sequence_no(self):
- return serial(self.read_uint32())
- def write_sequence_no(self, n):
- self.write_uint32(n.value)
-
-
- def read_uint64(self):
- return self.unpack("!Q")
- def write_uint64(self, n):
- self.pack("!Q", n)
-
- def read_int64(self):
- return self.unpack("!q")
- def write_int64(self, n):
- self.pack("!q", n)
-
- def read_datetime(self):
- return timestamp(self.read_uint64())
- def write_datetime(self, t):
- if isinstance(t, datetime.datetime):
- t = timestamp(t)
- self.write_uint64(t)
-
- def read_double(self):
- return self.unpack("!d")
- def write_double(self, d):
- self.pack("!d", d)
-
- def read_vbin8(self):
- return self.read(self.read_uint8())
- def write_vbin8(self, b):
- self.write_uint8(len(b))
- self.write(b)
-
- def read_str8(self):
- return self.read_vbin8().decode("utf8")
- def write_str8(self, s):
- self.write_vbin8(s.encode("utf8"))
-
- def read_str16(self):
- return self.read_vbin16().decode("utf8")
- def write_str16(self, s):
- self.write_vbin16(s.encode("utf8"))
-
-
- def read_vbin16(self):
- return self.read(self.read_uint16())
- def write_vbin16(self, b):
- self.write_uint16(len(b))
- self.write(b)
-
- def read_sequence_set(self):
- result = RangedSet()
- size = self.read_uint16()
- nranges = size/8
- while nranges > 0:
- lower = self.read_sequence_no()
- upper = self.read_sequence_no()
- result.add(lower, upper)
- nranges -= 1
- return result
- def write_sequence_set(self, ss):
- size = 8*len(ss.ranges)
- self.write_uint16(size)
- for range in ss.ranges:
- self.write_sequence_no(range.lower)
- self.write_sequence_no(range.upper)
-
- def read_vbin32(self):
- return self.read(self.read_uint32())
- def write_vbin32(self, b):
- self.write_uint32(len(b))
- self.write(b)
-
- def write_map(self, m):
- sc = StringCodec(self.spec)
- if m is not None:
- sc.write_uint32(len(m))
- for k, v in m.items():
- type = self.spec.encoding(v.__class__)
- if type == None:
- raise CodecException("no encoding for %s" % v.__class__)
- sc.write_str8(k)
- sc.write_uint8(type.code)
- type.encode(sc, v)
- self.write_vbin32(sc.encoded)
- def read_map(self):
- sc = StringCodec(self.spec, self.read_vbin32())
- if not sc.encoded:
- return None
- count = sc.read_uint32()
- result = {}
- while sc.encoded:
- k = sc.read_str8()
- code = sc.read_uint8()
- type = self.spec.types[code]
- v = type.decode(sc)
- result[k] = v
- return result
-
- def write_array(self, a):
- sc = StringCodec(self.spec)
- if a is not None:
- if len(a) > 0:
- type = self.spec.encoding(a[0].__class__)
- else:
- type = self.spec.encoding(None.__class__)
- sc.write_uint8(type.code)
- sc.write_uint32(len(a))
- for o in a:
- type.encode(sc, o)
- self.write_vbin32(sc.encoded)
- def read_array(self):
- sc = StringCodec(self.spec, self.read_vbin32())
- if not sc.encoded:
- return None
- type = self.spec.types[sc.read_uint8()]
- count = sc.read_uint32()
- result = []
- while count > 0:
- result.append(type.decode(sc))
- count -= 1
- return result
-
- def write_list(self, l):
- sc = StringCodec(self.spec)
- if l is not None:
- sc.write_uint32(len(l))
- for o in l:
- type = self.spec.encoding(o.__class__)
- sc.write_uint8(type.code)
- type.encode(sc, o)
- self.write_vbin32(sc.encoded)
- def read_list(self):
- sc = StringCodec(self.spec, self.read_vbin32())
- if not sc.encoded:
- return None
- count = sc.read_uint32()
- result = []
- while count > 0:
- type = self.spec.types[sc.read_uint8()]
- result.append(type.decode(sc))
- count -= 1
- return result
-
- def read_struct32(self):
- size = self.read_uint32()
- code = self.read_uint16()
- type = self.spec.structs[code]
- fields = type.decode_fields(self)
- return Struct(type, **fields)
- def write_struct32(self, value):
- sc = StringCodec(self.spec)
- sc.write_uint16(value._type.code)
- value._type.encode_fields(sc, value)
- self.write_vbin32(sc.encoded)
-
- def read_control(self):
- cntrl = self.spec.controls[self.read_uint16()]
- return Struct(cntrl, **cntrl.decode_fields(self))
- def write_control(self, ctrl):
- type = ctrl._type
- self.write_uint16(type.code)
- type.encode_fields(self, ctrl)
-
- def read_command(self):
- type = self.spec.commands[self.read_uint16()]
- hdr = self.spec["session.header"].decode(self)
- cmd = Struct(type, **type.decode_fields(self))
- return hdr, cmd
- def write_command(self, hdr, cmd):
- self.write_uint16(cmd._type.code)
- hdr._type.encode(self, hdr)
- cmd._type.encode_fields(self, cmd)
-
- def read_size(self, width):
- if width > 0:
- attr = "read_uint%d" % (width*8)
- return getattr(self, attr)()
-
- def write_size(self, width, n):
- if width > 0:
- attr = "write_uint%d" % (width*8)
- getattr(self, attr)(n)
-
- def read_uuid(self):
- return self.unpack("16s")
-
- def write_uuid(self, s):
- self.pack("16s", s)
-
- def read_bin128(self):
- return self.unpack("16s")
-
- def write_bin128(self, b):
- self.pack("16s", b)
-
-
-
-class StringCodec(Codec):
-
- def __init__(self, spec, encoded = ""):
- Codec.__init__(self, spec)
- self.encoded = encoded
-
- def write(self, s):
- self.encoded += s
-
- def read(self, n):
- result = self.encoded[:n]
- self.encoded = self.encoded[n:]
- return result
diff --git a/M4-RCs/qpid/python/qpid/compat.py b/M4-RCs/qpid/python/qpid/compat.py
deleted file mode 100644
index 26f60fb8aa..0000000000
--- a/M4-RCs/qpid/python/qpid/compat.py
+++ /dev/null
@@ -1,28 +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.
-#
-
-try:
- set = set
-except NameError:
- from sets import Set as set
-
-try:
- from socket import SHUT_RDWR
-except ImportError:
- SHUT_RDWR = 2
diff --git a/M4-RCs/qpid/python/qpid/connection.py b/M4-RCs/qpid/python/qpid/connection.py
deleted file mode 100644
index 4c9c02822a..0000000000
--- a/M4-RCs/qpid/python/qpid/connection.py
+++ /dev/null
@@ -1,218 +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.
-#
-
-import datatypes, session, socket
-from threading import Thread, Condition, RLock
-from util import wait, notify
-from assembler import Assembler, Segment
-from codec010 import StringCodec
-from session import Session
-from invoker import Invoker
-from spec010 import Control, Command, load
-from spec import default
-from exceptions import *
-from logging import getLogger
-import delegates
-
-class ChannelBusy(Exception): pass
-
-class ChannelsBusy(Exception): pass
-
-class SessionBusy(Exception): pass
-
-class ConnectionFailed(Exception): pass
-
-def client(*args, **kwargs):
- return delegates.Client(*args, **kwargs)
-
-def server(*args, **kwargs):
- return delegates.Server(*args, **kwargs)
-
-class SSLWrapper:
-
- def __init__(self, ssl):
- self.ssl = ssl
-
- def recv(self, n):
- return self.ssl.read(n)
-
- def send(self, s):
- return self.ssl.write(s)
-
-def sslwrap(sock):
- if isinstance(sock, socket.SSLType):
- return SSLWrapper(sock)
- else:
- return sock
-
-class Connection(Assembler):
-
- def __init__(self, sock, spec=None, delegate=client, **args):
- Assembler.__init__(self, sslwrap(sock))
- if spec == None:
- spec = load(default())
- self.spec = spec
- self.track = self.spec["track"]
-
- self.lock = RLock()
- self.attached = {}
- self.sessions = {}
-
- self.condition = Condition()
- self.opened = False
- self.failed = False
- self.close_code = (None, "connection aborted")
-
- self.thread = Thread(target=self.run)
- self.thread.setDaemon(True)
-
- self.channel_max = 65535
-
- self.delegate = delegate(self, **args)
-
- def attach(self, name, ch, delegate, force=False):
- self.lock.acquire()
- try:
- ssn = self.attached.get(ch.id)
- if ssn is not None:
- if ssn.name != name:
- raise ChannelBusy(ch, ssn)
- else:
- ssn = self.sessions.get(name)
- if ssn is None:
- ssn = Session(name, self.spec, delegate=delegate)
- self.sessions[name] = ssn
- elif ssn.channel is not None:
- if force:
- del self.attached[ssn.channel.id]
- ssn.channel = None
- else:
- raise SessionBusy(ssn)
- self.attached[ch.id] = ssn
- ssn.channel = ch
- ch.session = ssn
- return ssn
- finally:
- self.lock.release()
-
- def detach(self, name, ch):
- self.lock.acquire()
- try:
- self.attached.pop(ch.id, None)
- ssn = self.sessions.pop(name, None)
- if ssn is not None:
- ssn.channel = None
- ssn.closed()
- return ssn
- finally:
- self.lock.release()
-
- def __channel(self):
- # XXX: ch 0?
- for i in xrange(self.channel_max):
- if not self.attached.has_key(i):
- return i
- else:
- raise ChannelsBusy()
-
- def session(self, name, timeout=None, delegate=session.client):
- self.lock.acquire()
- try:
- ch = Channel(self, self.__channel())
- ssn = self.attach(name, ch, delegate)
- ssn.channel.session_attach(name)
- if wait(ssn.condition, lambda: ssn.channel is not None, timeout):
- return ssn
- else:
- self.detach(name, ch)
- raise Timeout()
- finally:
- self.lock.release()
-
- def detach_all(self):
- self.lock.acquire()
- try:
- for ssn in self.attached.values():
- if self.close_code[0] != 200:
- ssn.exceptions.append(self.close_code)
- self.detach(ssn.name, ssn.channel)
- finally:
- self.lock.release()
-
- def start(self, timeout=None):
- self.delegate.start()
- self.thread.start()
- if not wait(self.condition, lambda: self.opened or self.failed, timeout):
- raise Timeout()
- if self.failed:
- raise ConnectionFailed(*self.close_code)
-
- def run(self):
- # XXX: we don't really have a good way to exit this loop without
- # getting the other end to kill the socket
- while True:
- try:
- seg = self.read_segment()
- except Closed:
- self.detach_all()
- break
- self.delegate.received(seg)
-
- def close(self, timeout=None):
- if not self.opened: return
- Channel(self, 0).connection_close(200)
- if not wait(self.condition, lambda: not self.opened, timeout):
- raise Timeout()
- self.thread.join(timeout=timeout)
-
- def __str__(self):
- return "%s:%s" % self.sock.getsockname()
-
- def __repr__(self):
- return str(self)
-
-log = getLogger("qpid.io.ctl")
-
-class Channel(Invoker):
-
- def __init__(self, connection, id):
- self.connection = connection
- self.id = id
- self.session = None
-
- def resolve_method(self, name):
- inst = self.connection.spec.instructions.get(name)
- if inst is not None and isinstance(inst, Control):
- return self.METHOD, inst
- else:
- return self.ERROR, None
-
- def invoke(self, type, args, kwargs):
- ctl = type.new(args, kwargs)
- sc = StringCodec(self.connection.spec)
- sc.write_control(ctl)
- self.connection.write_segment(Segment(True, True, type.segment_type,
- type.track, self.id, sc.encoded))
- log.debug("SENT %s", ctl)
-
- def __str__(self):
- return "%s[%s]" % (self.connection, self.id)
-
- def __repr__(self):
- return str(self)
diff --git a/M4-RCs/qpid/python/qpid/connection08.py b/M4-RCs/qpid/python/qpid/connection08.py
deleted file mode 100644
index be94a792cb..0000000000
--- a/M4-RCs/qpid/python/qpid/connection08.py
+++ /dev/null
@@ -1,493 +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 Connection class containing socket code that uses the spec metadata
-to read and write Frame objects. This could be used by a client,
-server, or even a proxy implementation.
-"""
-
-import socket, codec, logging, qpid
-from cStringIO import StringIO
-from spec import load
-from codec import EOF
-from compat import SHUT_RDWR
-
-class SockIO:
-
- def __init__(self, sock):
- self.sock = sock
-
- def write(self, buf):
-# print "OUT: %r" % buf
- self.sock.sendall(buf)
-
- def read(self, n):
- data = ""
- while len(data) < n:
- try:
- s = self.sock.recv(n - len(data))
- except socket.error:
- break
- if len(s) == 0:
- break
-# print "IN: %r" % s
- data += s
- return data
-
- def flush(self):
- pass
-
- def close(self):
- self.sock.shutdown(SHUT_RDWR)
- self.sock.close()
-
-def connect(host, port):
- sock = socket.socket()
- sock.connect((host, port))
- sock.setblocking(1)
- return SockIO(sock)
-
-def listen(host, port, predicate = lambda: True):
- sock = socket.socket()
- sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
- sock.bind((host, port))
- sock.listen(5)
- while predicate():
- s, a = sock.accept()
- yield SockIO(s)
-
-class Connection:
-
- def __init__(self, io, spec):
- self.codec = codec.Codec(io, spec)
- self.spec = spec
- self.FRAME_END = self.spec.constants.byname["frame_end"].id
- self.write = getattr(self, "write_%s_%s" % (self.spec.major, self.spec.minor))
- self.read = getattr(self, "read_%s_%s" % (self.spec.major, self.spec.minor))
-
- def flush(self):
- self.codec.flush()
-
- INIT="!4s4B"
-
- def init(self):
- self.codec.pack(Connection.INIT, "AMQP", 1, 1, self.spec.major,
- self.spec.minor)
-
- def tini(self):
- self.codec.unpack(Connection.INIT)
-
- def write_8_0(self, frame):
- c = self.codec
- c.encode_octet(self.spec.constants.byname[frame.type].id)
- c.encode_short(frame.channel)
- body = StringIO()
- enc = codec.Codec(body, self.spec)
- frame.encode(enc)
- enc.flush()
- c.encode_longstr(body.getvalue())
- c.encode_octet(self.FRAME_END)
-
- def read_8_0(self):
- c = self.codec
- type = self.spec.constants.byid[c.decode_octet()].name
- channel = c.decode_short()
- body = c.decode_longstr()
- dec = codec.Codec(StringIO(body), self.spec)
- frame = Frame.DECODERS[type].decode(self.spec, dec, len(body))
- frame.channel = channel
- end = c.decode_octet()
- if end != self.FRAME_END:
- garbage = ""
- while end != self.FRAME_END:
- garbage += chr(end)
- end = c.decode_octet()
- raise "frame error: expected %r, got %r" % (self.FRAME_END, garbage)
- return frame
-
- def write_0_9(self, frame):
- self.write_8_0(frame)
-
- def read_0_9(self):
- return self.read_8_0()
-
- def write_0_10(self, frame):
- c = self.codec
- flags = 0
- if frame.bof: flags |= 0x08
- if frame.eof: flags |= 0x04
- if frame.bos: flags |= 0x02
- if frame.eos: flags |= 0x01
-
- c.encode_octet(flags) # TODO: currently fixed at ver=0, B=E=b=e=1
- c.encode_octet(self.spec.constants.byname[frame.type].id)
- body = StringIO()
- enc = codec.Codec(body, self.spec)
- frame.encode(enc)
- enc.flush()
- frame_size = len(body.getvalue()) + 12 # TODO: Magic number (frame header size)
- c.encode_short(frame_size)
- c.encode_octet(0) # Reserved
- c.encode_octet(frame.subchannel & 0x0f)
- c.encode_short(frame.channel)
- c.encode_long(0) # Reserved
- c.write(body.getvalue())
- c.encode_octet(self.FRAME_END)
-
- def read_0_10(self):
- c = self.codec
- flags = c.decode_octet() # TODO: currently ignoring flags
- framing_version = (flags & 0xc0) >> 6
- if framing_version != 0:
- raise "frame error: unknown framing version"
- type = self.spec.constants.byid[c.decode_octet()].name
- frame_size = c.decode_short()
- if frame_size < 12: # TODO: Magic number (frame header size)
- raise "frame error: frame size too small"
- reserved1 = c.decode_octet()
- field = c.decode_octet()
- subchannel = field & 0x0f
- channel = c.decode_short()
- reserved2 = c.decode_long() # TODO: reserved maybe need to ensure 0
- if (flags & 0x30) != 0 or reserved1 != 0 or (field & 0xf0) != 0:
- raise "frame error: reserved bits not all zero"
- body_size = frame_size - 12 # TODO: Magic number (frame header size)
- body = c.read(body_size)
- dec = codec.Codec(StringIO(body), self.spec)
- try:
- frame = Frame.DECODERS[type].decode(self.spec, dec, len(body))
- except EOF:
- raise "truncated frame body: %r" % body
- frame.channel = channel
- frame.subchannel = subchannel
- end = c.decode_octet()
- if end != self.FRAME_END:
- garbage = ""
- while end != self.FRAME_END:
- garbage += chr(end)
- end = c.decode_octet()
- raise "frame error: expected %r, got %r" % (self.FRAME_END, garbage)
- return frame
-
- def write_99_0(self, frame):
- self.write_0_10(frame)
-
- def read_99_0(self):
- return self.read_0_10()
-
-class Frame:
-
- DECODERS = {}
-
- class __metaclass__(type):
-
- def __new__(cls, name, bases, dict):
- for attr in ("encode", "decode", "type"):
- if not dict.has_key(attr):
- raise TypeError("%s must define %s" % (name, attr))
- dict["decode"] = staticmethod(dict["decode"])
- if dict.has_key("__init__"):
- __init__ = dict["__init__"]
- def init(self, *args, **kwargs):
- args = list(args)
- self.init(args, kwargs)
- __init__(self, *args, **kwargs)
- dict["__init__"] = init
- t = type.__new__(cls, name, bases, dict)
- if t.type != None:
- Frame.DECODERS[t.type] = t
- return t
-
- type = None
-
- def init(self, args, kwargs):
- self.channel = kwargs.pop("channel", 0)
- self.subchannel = kwargs.pop("subchannel", 0)
- self.bos = True
- self.eos = True
- self.bof = True
- self.eof = True
-
- def encode(self, enc): abstract
-
- def decode(spec, dec, size): abstract
-
-class Method(Frame):
-
- type = "frame_method"
-
- def __init__(self, method, args):
- if len(args) != len(method.fields):
- argspec = ["%s: %s" % (f.name, f.type)
- for f in method.fields]
- raise TypeError("%s.%s expecting (%s), got %s" %
- (method.klass.name, method.name, ", ".join(argspec),
- args))
- self.method = method
- self.method_type = method
- self.args = args
- self.eof = not method.content
-
- def encode(self, c):
- version = (c.spec.major, c.spec.minor)
- if version == (0, 10) or version == (99, 0):
- c.encode_octet(self.method.klass.id)
- c.encode_octet(self.method.id)
- else:
- c.encode_short(self.method.klass.id)
- c.encode_short(self.method.id)
- for field, arg in zip(self.method.fields, self.args):
- c.encode(field.type, arg)
-
- def decode(spec, c, size):
- version = (c.spec.major, c.spec.minor)
- if version == (0, 10) or version == (99, 0):
- klass = spec.classes.byid[c.decode_octet()]
- meth = klass.methods.byid[c.decode_octet()]
- else:
- klass = spec.classes.byid[c.decode_short()]
- meth = klass.methods.byid[c.decode_short()]
- args = tuple([c.decode(f.type) for f in meth.fields])
- return Method(meth, args)
-
- def __str__(self):
- return "[%s] %s %s" % (self.channel, self.method,
- ", ".join([str(a) for a in self.args]))
-
-class Request(Frame):
-
- type = "frame_request"
-
- def __init__(self, id, response_mark, method):
- self.id = id
- self.response_mark = response_mark
- self.method = method
- self.method_type = method.method_type
- self.args = method.args
-
- def encode(self, enc):
- enc.encode_longlong(self.id)
- enc.encode_longlong(self.response_mark)
- # reserved
- enc.encode_long(0)
- self.method.encode(enc)
-
- def decode(spec, dec, size):
- id = dec.decode_longlong()
- mark = dec.decode_longlong()
- # reserved
- dec.decode_long()
- method = Method.decode(spec, dec, size - 20)
- return Request(id, mark, method)
-
- def __str__(self):
- return "[%s] Request(%s) %s" % (self.channel, self.id, self.method)
-
-class Response(Frame):
-
- type = "frame_response"
-
- def __init__(self, id, request_id, batch_offset, method):
- self.id = id
- self.request_id = request_id
- self.batch_offset = batch_offset
- self.method = method
- self.method_type = method.method_type
- self.args = method.args
-
- def encode(self, enc):
- enc.encode_longlong(self.id)
- enc.encode_longlong(self.request_id)
- enc.encode_long(self.batch_offset)
- self.method.encode(enc)
-
- def decode(spec, dec, size):
- id = dec.decode_longlong()
- request_id = dec.decode_longlong()
- batch_offset = dec.decode_long()
- method = Method.decode(spec, dec, size - 20)
- return Response(id, request_id, batch_offset, method)
-
- def __str__(self):
- return "[%s] Response(%s,%s,%s) %s" % (self.channel, self.id, self.request_id, self.batch_offset, self.method)
-
-def uses_struct_encoding(spec):
- return (spec.major == 0 and spec.minor == 10) or (spec.major == 99 and spec.minor == 0)
-
-class Header(Frame):
-
- type = "frame_header"
-
- def __init__(self, klass, weight, size, properties):
- self.klass = klass
- self.weight = weight
- self.size = size
- self.properties = properties
- self.eof = size == 0
- self.bof = False
-
- def __getitem__(self, name):
- return self.properties[name]
-
- def __setitem__(self, name, value):
- self.properties[name] = value
-
- def __delitem__(self, name):
- del self.properties[name]
-
- def encode(self, c):
- if uses_struct_encoding(c.spec):
- self.encode_structs(c)
- else:
- self.encode_legacy(c)
-
- def encode_structs(self, c):
- # XXX
- structs = [qpid.Struct(c.spec.domains.byname["delivery_properties"].type),
- qpid.Struct(c.spec.domains.byname["message_properties"].type)]
-
- # XXX
- props = self.properties.copy()
- for k in self.properties:
- for s in structs:
- if s.exists(k):
- s.set(k, props.pop(k))
- if props:
- raise TypeError("no such property: %s" % (", ".join(props)))
-
- # message properties store the content-length now, and weight is
- # deprecated
- if self.size != None:
- structs[1].content_length = self.size
-
- for s in structs:
- c.encode_long_struct(s)
-
- def encode_legacy(self, c):
- c.encode_short(self.klass.id)
- c.encode_short(self.weight)
- c.encode_longlong(self.size)
-
- # property flags
- nprops = len(self.klass.fields)
- flags = 0
- for i in range(nprops):
- f = self.klass.fields.items[i]
- flags <<= 1
- if self.properties.get(f.name) != None:
- flags |= 1
- # the last bit indicates more flags
- if i > 0 and (i % 15) == 0:
- flags <<= 1
- if nprops > (i + 1):
- flags |= 1
- c.encode_short(flags)
- flags = 0
- flags <<= ((16 - (nprops % 15)) % 16)
- c.encode_short(flags)
-
- # properties
- for f in self.klass.fields:
- v = self.properties.get(f.name)
- if v != None:
- c.encode(f.type, v)
-
- def decode(spec, c, size):
- if uses_struct_encoding(spec):
- return Header.decode_structs(spec, c, size)
- else:
- return Header.decode_legacy(spec, c, size)
-
- def decode_structs(spec, c, size):
- structs = []
- start = c.nread
- while c.nread - start < size:
- structs.append(c.decode_long_struct())
-
- # XXX
- props = {}
- length = None
- for s in structs:
- for f in s.type.fields:
- if s.has(f.name):
- props[f.name] = s.get(f.name)
- if f.name == "content_length":
- length = s.get(f.name)
- return Header(None, 0, length, props)
-
- decode_structs = staticmethod(decode_structs)
-
- def decode_legacy(spec, c, size):
- klass = spec.classes.byid[c.decode_short()]
- weight = c.decode_short()
- size = c.decode_longlong()
-
- # property flags
- bits = []
- while True:
- flags = c.decode_short()
- for i in range(15, 0, -1):
- if flags >> i & 0x1 != 0:
- bits.append(True)
- else:
- bits.append(False)
- if flags & 0x1 == 0:
- break
-
- # properties
- properties = {}
- for b, f in zip(bits, klass.fields):
- if b:
- # Note: decode returns a unicode u'' string but only
- # plain '' strings can be used as keywords so we need to
- # stringify the names.
- properties[str(f.name)] = c.decode(f.type)
- return Header(klass, weight, size, properties)
-
- decode_legacy = staticmethod(decode_legacy)
-
- def __str__(self):
- return "%s %s %s %s" % (self.klass, self.weight, self.size,
- self.properties)
-
-class Body(Frame):
-
- type = "frame_body"
-
- def __init__(self, content):
- self.content = content
- self.eof = True
- self.bof = False
-
- def encode(self, enc):
- enc.write(self.content)
-
- def decode(spec, dec, size):
- return Body(dec.read(size))
-
- def __str__(self):
- return "Body(%r)" % self.content
-
-# TODO:
-# OOB_METHOD = "frame_oob_method"
-# OOB_HEADER = "frame_oob_header"
-# OOB_BODY = "frame_oob_body"
-# TRACE = "frame_trace"
-# HEARTBEAT = "frame_heartbeat"
diff --git a/M4-RCs/qpid/python/qpid/content.py b/M4-RCs/qpid/python/qpid/content.py
deleted file mode 100644
index 9391f4f1a8..0000000000
--- a/M4-RCs/qpid/python/qpid/content.py
+++ /dev/null
@@ -1,58 +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 python representation for AMQP content.
-"""
-
-def default(val, defval):
- if val == None:
- return defval
- else:
- return val
-
-class Content:
-
- def __init__(self, body = "", children = None, properties = None):
- self.body = body
- self.children = default(children, [])
- self.properties = default(properties, {})
-
- def size(self):
- return len(self.body)
-
- def weight(self):
- return len(self.children)
-
- def __getitem__(self, name):
- return self.properties[name]
-
- def __setitem__(self, name, value):
- self.properties[name] = value
-
- def __delitem__(self, name):
- del self.properties[name]
-
- def __str__(self):
- if self.children:
- return "%s [%s] %s" % (self.properties,
- ", ".join(map(str, self.children)),
- self.body)
- else:
- return "%s %s" % (self.properties, self.body)
diff --git a/M4-RCs/qpid/python/qpid/datatypes.py b/M4-RCs/qpid/python/qpid/datatypes.py
deleted file mode 100644
index eb1f86b0b0..0000000000
--- a/M4-RCs/qpid/python/qpid/datatypes.py
+++ /dev/null
@@ -1,349 +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.
-#
-
-import threading, struct, datetime, time
-
-class Struct:
-
- def __init__(self, _type, *args, **kwargs):
- if len(args) > len(_type.fields):
- raise TypeError("%s() takes at most %s arguments (%s given)" %
- (_type.name, len(_type.fields), len(args)))
-
- self._type = _type
-
- idx = 0
- for field in _type.fields:
- if idx < len(args):
- arg = args[idx]
- if kwargs.has_key(field.name):
- raise TypeError("%s() got multiple values for keyword argument '%s'" %
- (_type.name, field.name))
- elif kwargs.has_key(field.name):
- arg = kwargs.pop(field.name)
- else:
- arg = field.default()
- setattr(self, field.name, arg)
- idx += 1
-
- if kwargs:
- unexpected = kwargs.keys()[0]
- raise TypeError("%s() got an unexpected keyword argument '%s'" %
- (_type.name, unexpected))
-
- def __getitem__(self, name):
- return getattr(self, name)
-
- def __setitem__(self, name, value):
- if not hasattr(self, name):
- raise AttributeError("'%s' object has no attribute '%s'" %
- (self._type.name, name))
- setattr(self, name, value)
-
- def __repr__(self):
- fields = []
- for f in self._type.fields:
- v = self[f.name]
- if f.type.is_present(v):
- fields.append("%s=%r" % (f.name, v))
- return "%s(%s)" % (self._type.name, ", ".join(fields))
-
-class Message:
-
- def __init__(self, *args):
- if args:
- self.body = args[-1]
- else:
- self.body = None
- if len(args) > 1:
- self.headers = list(args[:-1])
- else:
- self.headers = None
- self.id = None
-
- def has(self, name):
- return self.get(name) != None
-
- def get(self, name):
- if self.headers:
- for h in self.headers:
- if h._type.name == name:
- return h
- return None
-
- def set(self, header):
- if self.headers is None:
- self.headers = []
- idx = 0
- while idx < len(self.headers):
- if self.headers[idx]._type == header._type:
- self.headers[idx] = header
- return
- idx += 1
- self.headers.append(header)
-
- def clear(self, name):
- idx = 0
- while idx < len(self.headers):
- if self.headers[idx]._type.name == name:
- del self.headers[idx]
- return
- idx += 1
-
- def __repr__(self):
- args = []
- if self.headers:
- args.extend(map(repr, self.headers))
- if self.body:
- args.append(repr(self.body))
- if self.id is not None:
- args.append("id=%s" % self.id)
- return "Message(%s)" % ", ".join(args)
-
-def serial(o):
- if isinstance(o, Serial):
- return o
- else:
- return Serial(o)
-
-class Serial:
-
- def __init__(self, value):
- self.value = value & 0xFFFFFFFF
-
- def __hash__(self):
- return hash(self.value)
-
- def __cmp__(self, other):
- if other is None:
- return 1
-
- other = serial(other)
-
- delta = (self.value - other.value) & 0xFFFFFFFF
- neg = delta & 0x80000000
- mag = delta & 0x7FFFFFFF
-
- if neg:
- return -mag
- else:
- return mag
-
- def __add__(self, other):
- return Serial(self.value + other)
-
- def __sub__(self, other):
- return Serial(self.value - other)
-
- def __repr__(self):
- return "serial(%s)" % self.value
-
- def __str__(self):
- return str(self.value)
-
-class Range:
-
- def __init__(self, lower, upper = None):
- self.lower = serial(lower)
- if upper is None:
- self.upper = self.lower
- else:
- self.upper = serial(upper)
-
- def __contains__(self, n):
- return self.lower <= n and n <= self.upper
-
- def __iter__(self):
- i = self.lower
- while i <= self.upper:
- yield i
- i += 1
-
- def touches(self, r):
- # XXX: are we doing more checks than we need?
- return (self.lower - 1 in r or
- self.upper + 1 in r or
- r.lower - 1 in self or
- r.upper + 1 in self or
- self.lower in r or
- self.upper in r or
- r.lower in self or
- r.upper in self)
-
- def span(self, r):
- return Range(min(self.lower, r.lower), max(self.upper, r.upper))
-
- def intersect(self, r):
- lower = max(self.lower, r.lower)
- upper = min(self.upper, r.upper)
- if lower > upper:
- return None
- else:
- return Range(lower, upper)
-
- def __repr__(self):
- return "%s-%s" % (self.lower, self.upper)
-
-class RangedSet:
-
- def __init__(self, *args):
- self.ranges = []
- for n in args:
- self.add(n)
-
- def __contains__(self, n):
- for r in self.ranges:
- if n in r:
- return True
- return False
-
- def add_range(self, range):
- idx = 0
- while idx < len(self.ranges):
- r = self.ranges[idx]
- if range.touches(r):
- del self.ranges[idx]
- range = range.span(r)
- elif range.upper < r.lower:
- self.ranges.insert(idx, range)
- return
- else:
- idx += 1
- self.ranges.append(range)
-
- def add(self, lower, upper = None):
- self.add_range(Range(lower, upper))
-
- def __iter__(self):
- return iter(self.ranges)
-
- def __repr__(self):
- return str(self.ranges)
-
-class Future:
- def __init__(self, initial=None, exception=Exception):
- self.value = initial
- self._error = None
- self._set = threading.Event()
- self.exception = exception
-
- def error(self, error):
- self._error = error
- self._set.set()
-
- def set(self, value):
- self.value = value
- self._set.set()
-
- def get(self, timeout=None):
- self._set.wait(timeout)
- if self._error != None:
- raise self.exception(self._error)
- return self.value
-
- def is_set(self):
- return self._set.isSet()
-
-try:
- import uuid
- def random_uuid():
- return uuid.uuid4().get_bytes()
-except ImportError:
- import random
- def random_uuid():
- bytes = [random.randint(0, 255) for i in xrange(16)]
-
- # From RFC4122, the version bits are set to 0100
- bytes[7] &= 0x0F
- bytes[7] |= 0x40
-
- # From RFC4122, the top two bits of byte 8 get set to 01
- bytes[8] &= 0x3F
- bytes[8] |= 0x80
- return "".join(map(chr, bytes))
-
-def uuid4():
- return UUID(random_uuid())
-
-class UUID:
-
- def __init__(self, bytes):
- self.bytes = bytes
-
- def __cmp__(self, other):
- if isinstance(other, UUID):
- return cmp(self.bytes, other.bytes)
- raise NotImplemented()
-
- def __str__(self):
- return "%08x-%04x-%04x-%04x-%04x%08x" % struct.unpack("!LHHHHL", self.bytes)
-
- def __repr__(self):
- return "UUID(%r)" % str(self)
-
- def __hash__(self):
- return self.bytes.__hash__()
-
-class timestamp(float):
-
- def __new__(cls, obj=None):
- if obj is None:
- obj = time.time()
- elif isinstance(obj, datetime.datetime):
- obj = time.mktime(obj.timetuple()) + 1e-6 * obj.microsecond
- return super(timestamp, cls).__new__(cls, obj)
-
- def datetime(self):
- return datetime.datetime.fromtimestamp(self)
-
- def __add__(self, other):
- if isinstance(other, datetime.timedelta):
- return timestamp(self.datetime() + other)
- else:
- return timestamp(float(self) + other)
-
- def __sub__(self, other):
- if isinstance(other, datetime.timedelta):
- return timestamp(self.datetime() - other)
- else:
- return timestamp(float(self) - other)
-
- def __radd__(self, other):
- if isinstance(other, datetime.timedelta):
- return timestamp(self.datetime() + other)
- else:
- return timestamp(other + float(self))
-
- def __rsub__(self, other):
- if isinstance(other, datetime.timedelta):
- return timestamp(self.datetime() - other)
- else:
- return timestamp(other - float(self))
-
- def __neg__(self):
- return timestamp(-float(self))
-
- def __pos__(self):
- return self
-
- def __abs__(self):
- return timestamp(abs(float(self)))
-
- def __repr__(self):
- return "timestamp(%r)" % float(self)
diff --git a/M4-RCs/qpid/python/qpid/delegate.py b/M4-RCs/qpid/python/qpid/delegate.py
deleted file mode 100644
index b447c4aa29..0000000000
--- a/M4-RCs/qpid/python/qpid/delegate.py
+++ /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.
-#
-
-"""
-Delegate implementation intended for use with the peer module.
-"""
-
-import threading, inspect, traceback, sys
-from connection08 import Method, Request, Response
-
-def _handler_name(method):
- return "%s_%s" % (method.klass.name, method.name)
-
-class Delegate:
-
- def __init__(self):
- self.handlers = {}
- self.invokers = {}
-
- def __call__(self, channel, frame):
- method = frame.method
-
- try:
- handler = self.handlers[method]
- except KeyError:
- name = _handler_name(method)
- handler = getattr(self, name)
- self.handlers[method] = handler
-
- try:
- return handler(channel, frame)
- except:
- print >> sys.stderr, "Error in handler: %s\n\n%s" % \
- (_handler_name(method), traceback.format_exc())
-
- def closed(self, reason):
- print "Connection closed: %s" % reason
diff --git a/M4-RCs/qpid/python/qpid/delegates.py b/M4-RCs/qpid/python/qpid/delegates.py
deleted file mode 100644
index bf26553dda..0000000000
--- a/M4-RCs/qpid/python/qpid/delegates.py
+++ /dev/null
@@ -1,162 +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.
-#
-
-import os, connection, session
-from util import notify
-from datatypes import RangedSet
-from logging import getLogger
-
-log = getLogger("qpid.io.ctl")
-
-class Delegate:
-
- def __init__(self, connection, delegate=session.client):
- self.connection = connection
- self.spec = connection.spec
- self.delegate = delegate
- self.control = self.spec["track.control"].value
-
- def received(self, seg):
- ssn = self.connection.attached.get(seg.channel)
- if ssn is None:
- ch = connection.Channel(self.connection, seg.channel)
- else:
- ch = ssn.channel
-
- if seg.track == self.control:
- ctl = seg.decode(self.spec)
- log.debug("RECV %s", ctl)
- attr = ctl._type.qname.replace(".", "_")
- getattr(self, attr)(ch, ctl)
- elif ssn is None:
- ch.session_detached()
- else:
- ssn.received(seg)
-
- def connection_close(self, ch, close):
- self.connection.close_code = (close.reply_code, close.reply_text)
- ch.connection_close_ok()
- self.connection.sock.close()
- if not self.connection.opened:
- self.connection.failed = True
- notify(self.connection.condition)
-
- def connection_close_ok(self, ch, close_ok):
- self.connection.opened = False
- notify(self.connection.condition)
-
- def session_attach(self, ch, a):
- try:
- self.connection.attach(a.name, ch, self.delegate, a.force)
- ch.session_attached(a.name)
- except connection.ChannelBusy:
- ch.session_detached(a.name)
- except connection.SessionBusy:
- ch.session_detached(a.name)
-
- def session_attached(self, ch, a):
- notify(ch.session.condition)
-
- def session_detach(self, ch, d):
- #send back the confirmation of detachment before removing the
- #channel from the attached set; this avoids needing to hold the
- #connection lock during the sending of this control and ensures
- #that if the channel is immediately reused for a new session the
- #attach request will follow the detached notification.
- ch.session_detached(d.name)
- ssn = self.connection.detach(d.name, ch)
-
- def session_detached(self, ch, d):
- self.connection.detach(d.name, ch)
-
- def session_request_timeout(self, ch, rt):
- ch.session_timeout(rt.timeout);
-
- def session_command_point(self, ch, cp):
- ssn = ch.session
- ssn.receiver.next_id = cp.command_id
- ssn.receiver.next_offset = cp.command_offset
-
- def session_completed(self, ch, cmp):
- ch.session.sender.completed(cmp.commands)
- if cmp.timely_reply:
- ch.session_known_completed(cmp.commands)
- notify(ch.session.condition)
-
- def session_known_completed(self, ch, kn_cmp):
- ch.session.receiver.known_completed(kn_cmp.commands)
-
- def session_flush(self, ch, f):
- rcv = ch.session.receiver
- if f.expected:
- if rcv.next_id == None:
- exp = None
- else:
- exp = RangedSet(rcv.next_id)
- ch.session_expected(exp)
- if f.confirmed:
- ch.session_confirmed(rcv._completed)
- if f.completed:
- ch.session_completed(rcv._completed)
-
-class Server(Delegate):
-
- def start(self):
- self.connection.read_header()
- self.connection.write_header(self.spec.major, self.spec.minor)
- connection.Channel(self.connection, 0).connection_start(mechanisms=["ANONYMOUS"])
-
- def connection_start_ok(self, ch, start_ok):
- ch.connection_tune(channel_max=65535)
-
- def connection_tune_ok(self, ch, tune_ok):
- pass
-
- def connection_open(self, ch, open):
- self.connection.opened = True
- ch.connection_open_ok()
- notify(self.connection.condition)
-
-class Client(Delegate):
-
- PROPERTIES = {"product": "qpid python client",
- "version": "development",
- "platform": os.name}
-
- def __init__(self, connection, username="guest", password="guest", mechanism="PLAIN"):
- Delegate.__init__(self, connection)
- self.username = username
- self.password = password
- self.mechanism = mechanism
-
- def start(self):
- self.connection.write_header(self.spec.major, self.spec.minor)
- self.connection.read_header()
-
- def connection_start(self, ch, start):
- r = "\0%s\0%s" % (self.username, self.password)
- ch.connection_start_ok(client_properties=Client.PROPERTIES, mechanism=self.mechanism, response=r)
-
- def connection_tune(self, ch, tune):
- ch.connection_tune_ok()
- ch.connection_open()
-
- def connection_open_ok(self, ch, open_ok):
- self.connection.opened = True
- notify(self.connection.condition)
diff --git a/M4-RCs/qpid/python/qpid/disp.py b/M4-RCs/qpid/python/qpid/disp.py
deleted file mode 100644
index e46cb33c60..0000000000
--- a/M4-RCs/qpid/python/qpid/disp.py
+++ /dev/null
@@ -1,79 +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.
-#
-
-from time import strftime, gmtime
-
-class Display:
- """ Display formatting for QPID Management CLI """
-
- def __init__ (self):
- self.tableSpacing = 2
- self.tablePrefix = " "
- self.timestampFormat = "%X"
-
- def table (self, title, heads, rows):
- """ Print a formatted table with autosized columns """
- print title
- if len (rows) == 0:
- return
- colWidth = []
- col = 0
- line = self.tablePrefix
- for head in heads:
- width = len (head)
- for row in rows:
- cellWidth = len (unicode (row[col]))
- if cellWidth > width:
- width = cellWidth
- colWidth.append (width + self.tableSpacing)
- line = line + head
- if col < len (heads) - 1:
- for i in range (colWidth[col] - len (head)):
- line = line + " "
- col = col + 1
- print line
- line = self.tablePrefix
- for width in colWidth:
- for i in range (width):
- line = line + "="
- print line
-
- for row in rows:
- line = self.tablePrefix
- col = 0
- for width in colWidth:
- line = line + unicode (row[col])
- if col < len (heads) - 1:
- for i in range (width - len (unicode (row[col]))):
- line = line + " "
- col = col + 1
- print line
-
- def do_setTimeFormat (self, fmt):
- """ Select timestamp format """
- if fmt == "long":
- self.timestampFormat = "%c"
- elif fmt == "short":
- self.timestampFormat = "%X"
-
- def timestamp (self, nsec):
- """ Format a nanosecond-since-the-epoch timestamp for printing """
- return strftime (self.timestampFormat, gmtime (nsec / 1000000000))
diff --git a/M4-RCs/qpid/python/qpid/exceptions.py b/M4-RCs/qpid/python/qpid/exceptions.py
deleted file mode 100644
index 7eaaf81ed4..0000000000
--- a/M4-RCs/qpid/python/qpid/exceptions.py
+++ /dev/null
@@ -1,21 +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 Closed(Exception): pass
-class Timeout(Exception): pass
diff --git a/M4-RCs/qpid/python/qpid/framer.py b/M4-RCs/qpid/python/qpid/framer.py
deleted file mode 100644
index f6363b2291..0000000000
--- a/M4-RCs/qpid/python/qpid/framer.py
+++ /dev/null
@@ -1,159 +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.
-#
-
-import struct, socket
-from exceptions import Closed
-from packer import Packer
-from threading import RLock
-from logging import getLogger
-
-raw = getLogger("qpid.io.raw")
-frm = getLogger("qpid.io.frm")
-
-FIRST_SEG = 0x08
-LAST_SEG = 0x04
-FIRST_FRM = 0x02
-LAST_FRM = 0x01
-
-class Frame:
-
- HEADER = "!2BHxBH4x"
- MAX_PAYLOAD = 65535 - struct.calcsize(HEADER)
-
- def __init__(self, flags, type, track, channel, payload):
- if len(payload) > Frame.MAX_PAYLOAD:
- raise ValueError("max payload size exceeded: %s" % len(payload))
- self.flags = flags
- self.type = type
- self.track = track
- self.channel = channel
- self.payload = payload
-
- def isFirstSegment(self):
- return bool(FIRST_SEG & self.flags)
-
- def isLastSegment(self):
- return bool(LAST_SEG & self.flags)
-
- def isFirstFrame(self):
- return bool(FIRST_FRM & self.flags)
-
- def isLastFrame(self):
- return bool(LAST_FRM & self.flags)
-
- def __str__(self):
- return "%s%s%s%s %s %s %s %r" % (int(self.isFirstSegment()),
- int(self.isLastSegment()),
- int(self.isFirstFrame()),
- int(self.isLastFrame()),
- self.type,
- self.track,
- self.channel,
- self.payload)
-
-class FramingError(Exception): pass
-
-class Framer(Packer):
-
- HEADER="!4s4B"
-
- def __init__(self, sock):
- self.sock = sock
- self.sock_lock = RLock()
- self._buf = ""
-
- def aborted(self):
- return False
-
- def write(self, buf):
- self._buf += buf
-
- def flush(self):
- self.sock_lock.acquire()
- try:
- self._write(self._buf)
- self._buf = ""
- frm.debug("FLUSHED")
- finally:
- self.sock_lock.release()
-
- def _write(self, buf):
- while buf:
- try:
- n = self.sock.send(buf)
- except socket.timeout:
- if self.aborted():
- raise Closed()
- else:
- continue
- raw.debug("SENT %r", buf[:n])
- buf = buf[n:]
-
- def read(self, n):
- data = ""
- while len(data) < n:
- try:
- s = self.sock.recv(n - len(data))
- except socket.timeout:
- if self.aborted():
- raise Closed()
- else:
- continue
- except socket.error, e:
- if data != "":
- raise e
- else:
- raise Closed()
- if len(s) == 0:
- raise Closed()
- data += s
- raw.debug("RECV %r", s)
- return data
-
- def read_header(self):
- return self.unpack(Framer.HEADER)
-
- def write_header(self, major, minor):
- self.sock_lock.acquire()
- try:
- self.pack(Framer.HEADER, "AMQP", 1, 1, major, minor)
- self.flush()
- finally:
- self.sock_lock.release()
-
- def write_frame(self, frame):
- self.sock_lock.acquire()
- try:
- size = len(frame.payload) + struct.calcsize(Frame.HEADER)
- track = frame.track & 0x0F
- self.pack(Frame.HEADER, frame.flags, frame.type, size, track, frame.channel)
- self.write(frame.payload)
- if frame.isLastSegment() and frame.isLastFrame():
- self.flush()
- frm.debug("SENT %s", frame)
- finally:
- self.sock_lock.release()
-
- def read_frame(self):
- flags, type, size, track, channel = self.unpack(Frame.HEADER)
- if flags & 0xF0: raise FramingError()
- payload = self.read(size - struct.calcsize(Frame.HEADER))
- frame = Frame(flags, type, track, channel, payload)
- frm.debug("RECV %s", frame)
- return frame
diff --git a/M4-RCs/qpid/python/qpid/invoker.py b/M4-RCs/qpid/python/qpid/invoker.py
deleted file mode 100644
index 635f3ee769..0000000000
--- a/M4-RCs/qpid/python/qpid/invoker.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.
-#
-
-import sys
-
-# TODO: need a better naming for this class now that it does the value
-# stuff
-class Invoker:
-
- def METHOD(self, name, resolved):
- method = lambda *args, **kwargs: self.invoke(resolved, args, kwargs)
- if sys.version_info[:2] > (2, 3):
- method.__name__ = resolved.pyname
- method.__doc__ = resolved.pydoc
- method.__module__ = self.__class__.__module__
- self.__dict__[name] = method
- return method
-
- def VALUE(self, name, resolved):
- self.__dict__[name] = resolved
- return resolved
-
- def ERROR(self, name, resolved):
- raise AttributeError("%s instance has no attribute '%s'" %
- (self.__class__.__name__, name))
-
- def resolve_method(self, name):
- return ERROR, None
-
- def __getattr__(self, name):
- disp, resolved = self.resolve_method(name)
- return disp(name, resolved)
diff --git a/M4-RCs/qpid/python/qpid/log.py b/M4-RCs/qpid/python/qpid/log.py
deleted file mode 100644
index 1fd7d74136..0000000000
--- a/M4-RCs/qpid/python/qpid/log.py
+++ /dev/null
@@ -1,28 +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 logging import getLogger, StreamHandler, Formatter
-from logging import DEBUG, INFO, WARN, ERROR, CRITICAL
-
-def enable(name=None, level=WARN, file=None):
- log = getLogger(name)
- handler = StreamHandler(file)
- handler.setFormatter(Formatter("%(asctime)s %(levelname)s %(message)s"))
- log.addHandler(handler)
- log.setLevel(level)
diff --git a/M4-RCs/qpid/python/qpid/management.py b/M4-RCs/qpid/python/qpid/management.py
deleted file mode 100644
index 477f3e8f2b..0000000000
--- a/M4-RCs/qpid/python/qpid/management.py
+++ /dev/null
@@ -1,913 +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 file is being obsoleted by qmf/console.py
-###############################################################################
-
-"""
-Management API for Qpid
-"""
-
-import qpid
-import struct
-import socket
-from threading import Thread
-from datatypes import Message, RangedSet
-from time import time
-from cStringIO import StringIO
-from codec010 import StringCodec as Codec
-from threading import Lock, Condition
-
-
-class SequenceManager:
- """ Manage sequence numbers for asynchronous method calls """
- def __init__ (self):
- self.lock = Lock ()
- self.sequence = 0
- self.pending = {}
-
- def reserve (self, data):
- """ Reserve a unique sequence number """
- self.lock.acquire ()
- result = self.sequence
- self.sequence = self.sequence + 1
- self.pending[result] = data
- self.lock.release ()
- return result
-
- def release (self, seq):
- """ Release a reserved sequence number """
- data = None
- self.lock.acquire ()
- if seq in self.pending:
- data = self.pending[seq]
- del self.pending[seq]
- self.lock.release ()
- return data
-
-
-class mgmtObject (object):
- """ Generic object that holds the contents of a management object with its
- attributes set as object attributes. """
-
- def __init__ (self, classKey, timestamps, row):
- self.classKey = classKey
- self.timestamps = timestamps
- for cell in row:
- setattr (self, cell[0], cell[1])
-
-class objectId(object):
- """ Object that represents QMF object identifiers """
-
- def __init__(self, codec, first=0, second=0):
- if codec:
- self.first = codec.read_uint64()
- self.second = codec.read_uint64()
- else:
- self.first = first
- self.second = second
-
- def __cmp__(self, other):
- if other == None:
- return 1
- if self.first < other.first:
- return -1
- if self.first > other.first:
- return 1
- if self.second < other.second:
- return -1
- if self.second > other.second:
- return 1
- return 0
-
-
- def index(self):
- return (self.first, self.second)
-
- def getFlags(self):
- return (self.first & 0xF000000000000000) >> 60
-
- def getSequence(self):
- return (self.first & 0x0FFF000000000000) >> 48
-
- def getBroker(self):
- return (self.first & 0x0000FFFFF0000000) >> 28
-
- def getBank(self):
- return self.first & 0x000000000FFFFFFF
-
- def getObject(self):
- return self.second
-
- def isDurable(self):
- return self.getSequence() == 0
-
- def encode(self, codec):
- codec.write_uint64(self.first)
- codec.write_uint64(self.second)
-
-
-class methodResult:
- """ Object that contains the result of a method call """
-
- def __init__ (self, status, sText, args):
- self.status = status
- self.statusText = sText
- for arg in args:
- setattr (self, arg, args[arg])
-
-class brokerInfo:
- """ Object that contains information about a broker and the session to it """
-
- def __init__ (self, brokerId, sessionId):
- self.brokerId = brokerId
- self.sessionId = sessionId
-
-class managementChannel:
- """ This class represents a connection to an AMQP broker. """
-
- def __init__ (self, ssn, topicCb, replyCb, exceptionCb, cbContext, _detlife=0):
- """ Given a channel on an established AMQP broker connection, this method
- opens a session and performs all of the declarations and bindings needed
- to participate in the management protocol. """
- self.enabled = True
- self.ssn = ssn
- self.sessionId = ssn.name
- self.topicName = "mgmt-%s" % self.sessionId
- self.replyName = "repl-%s" % self.sessionId
- self.qpidChannel = ssn
- self.tcb = topicCb
- self.rcb = replyCb
- self.ecb = exceptionCb
- self.context = cbContext
- self.reqsOutstanding = 0
- self.brokerInfo = None
-
- ssn.auto_sync = False
- ssn.queue_declare (queue=self.topicName, exclusive=True, auto_delete=True)
- ssn.queue_declare (queue=self.replyName, exclusive=True, auto_delete=True)
-
- ssn.exchange_bind (exchange="amq.direct",
- queue=self.replyName, binding_key=self.replyName)
- ssn.message_subscribe (queue=self.topicName, destination="tdest",
- accept_mode=ssn.accept_mode.none,
- acquire_mode=ssn.acquire_mode.pre_acquired)
- ssn.message_subscribe (queue=self.replyName, destination="rdest",
- accept_mode=ssn.accept_mode.none,
- acquire_mode=ssn.acquire_mode.pre_acquired)
-
- ssn.incoming ("tdest").listen (self.topicCb, self.exceptionCb)
- ssn.incoming ("rdest").listen (self.replyCb)
-
- ssn.message_set_flow_mode (destination="tdest", flow_mode=1)
- ssn.message_flow (destination="tdest", unit=0, value=0xFFFFFFFF)
- ssn.message_flow (destination="tdest", unit=1, value=0xFFFFFFFF)
-
- ssn.message_set_flow_mode (destination="rdest", flow_mode=1)
- ssn.message_flow (destination="rdest", unit=0, value=0xFFFFFFFF)
- ssn.message_flow (destination="rdest", unit=1, value=0xFFFFFFFF)
-
- def setBrokerInfo (self, data):
- self.brokerInfo = data
-
- def shutdown (self):
- self.enabled = False
- self.ssn.incoming("tdest").stop()
- self.ssn.incoming("rdest").stop()
-
- def topicCb (self, msg):
- """ Receive messages via the topic queue on this channel. """
- if self.enabled:
- self.tcb (self, msg)
-
- def replyCb (self, msg):
- """ Receive messages via the reply queue on this channel. """
- if self.enabled:
- self.rcb (self, msg)
-
- def exceptionCb (self, data):
- if self.ecb != None:
- self.ecb (self, data)
-
- def send (self, exchange, msg):
- if self.enabled:
- self.qpidChannel.message_transfer (destination=exchange, message=msg)
-
- def message (self, body, routing_key="broker"):
- dp = self.qpidChannel.delivery_properties()
- dp.routing_key = routing_key
- mp = self.qpidChannel.message_properties()
- mp.content_type = "application/octet-stream"
- mp.reply_to = self.qpidChannel.reply_to("amq.direct", self.replyName)
- return Message(dp, mp, body)
-
-
-class managementClient:
- """ This class provides an API for access to management data on the AMQP
- network. It implements the management protocol and manages the management
- schemas as advertised by the various management agents in the network. """
-
- CTRL_BROKER_INFO = 1
- CTRL_SCHEMA_LOADED = 2
- CTRL_USER = 3
- CTRL_HEARTBEAT = 4
-
- SYNC_TIME = 10.0
-
- #========================================================
- # User API - interacts with the class's user
- #========================================================
- def __init__ (self, amqpSpec, ctrlCb=None, configCb=None, instCb=None, methodCb=None, closeCb=None):
- self.spec = amqpSpec
- self.ctrlCb = ctrlCb
- self.configCb = configCb
- self.instCb = instCb
- self.methodCb = methodCb
- self.closeCb = closeCb
- self.schemaCb = None
- self.eventCb = None
- self.channels = []
- self.seqMgr = SequenceManager ()
- self.schema = {}
- self.packages = {}
- self.cv = Condition ()
- self.syncInFlight = False
- self.syncSequence = 0
- self.syncResult = None
-
- def schemaListener (self, schemaCb):
- """ Optionally register a callback to receive details of the schema of
- managed objects in the network. """
- self.schemaCb = schemaCb
-
- def eventListener (self, eventCb):
- """ Optionally register a callback to receive events from managed objects
- in the network. """
- self.eventCb = eventCb
-
- def addChannel (self, channel, cbContext=None):
- """ Register a new channel. """
- mch = managementChannel (channel, self.topicCb, self.replyCb, self.exceptCb, cbContext)
-
- self.channels.append (mch)
- self.incOutstanding (mch)
- codec = Codec (self.spec)
- self.setHeader (codec, ord ('B'))
- msg = mch.message(codec.encoded)
- mch.send ("qpid.management", msg)
- return mch
-
- def removeChannel (self, mch):
- """ Remove a previously added channel from management. """
- mch.shutdown ()
- self.channels.remove (mch)
-
- def callMethod (self, channel, userSequence, objId, className, methodName, args=None):
- """ Invoke a method on a managed object. """
- self.method (channel, userSequence, objId, className, methodName, args)
-
- def getObjects (self, channel, userSequence, className, bank=0):
- """ Request immediate content from broker """
- codec = Codec (self.spec)
- self.setHeader (codec, ord ('G'), userSequence)
- ft = {}
- ft["_class"] = className
- codec.write_map (ft)
- msg = channel.message(codec.encoded, routing_key="agent.1.%d" % bank)
- channel.send ("qpid.management", msg)
-
- def syncWaitForStable (self, channel):
- """ Synchronous (blocking) call to wait for schema stability on a channel """
- self.cv.acquire ()
- if channel.reqsOutstanding == 0:
- self.cv.release ()
- return channel.brokerInfo
-
- self.syncInFlight = True
- starttime = time ()
- while channel.reqsOutstanding != 0:
- self.cv.wait (self.SYNC_TIME)
- if time () - starttime > self.SYNC_TIME:
- self.cv.release ()
- raise RuntimeError ("Timed out waiting for response on channel")
- self.cv.release ()
- return channel.brokerInfo
-
- def syncCallMethod (self, channel, objId, className, methodName, args=None):
- """ Synchronous (blocking) method call """
- self.cv.acquire ()
- self.syncInFlight = True
- self.syncResult = None
- self.syncSequence = self.seqMgr.reserve ("sync")
- self.cv.release ()
- self.callMethod (channel, self.syncSequence, objId, className, methodName, args)
- self.cv.acquire ()
- starttime = time ()
- while self.syncInFlight:
- self.cv.wait (self.SYNC_TIME)
- if time () - starttime > self.SYNC_TIME:
- self.cv.release ()
- raise RuntimeError ("Timed out waiting for response on channel")
- result = self.syncResult
- self.cv.release ()
- return result
-
- def syncGetObjects (self, channel, className, bank=0):
- """ Synchronous (blocking) get call """
- self.cv.acquire ()
- self.syncInFlight = True
- self.syncResult = []
- self.syncSequence = self.seqMgr.reserve ("sync")
- self.cv.release ()
- self.getObjects (channel, self.syncSequence, className, bank)
- self.cv.acquire ()
- starttime = time ()
- while self.syncInFlight:
- self.cv.wait (self.SYNC_TIME)
- if time () - starttime > self.SYNC_TIME:
- self.cv.release ()
- raise RuntimeError ("Timed out waiting for response on channel")
- result = self.syncResult
- self.cv.release ()
- return result
-
- #========================================================
- # Channel API - interacts with registered channel objects
- #========================================================
- def topicCb (self, ch, msg):
- """ Receive messages via the topic queue of a particular channel. """
- codec = Codec (self.spec, msg.body)
- while True:
- hdr = self.checkHeader (codec)
- if hdr == None:
- return
-
- if hdr[0] == 'p':
- self.handlePackageInd (ch, codec)
- elif hdr[0] == 'q':
- self.handleClassInd (ch, codec)
- elif hdr[0] == 'h':
- self.handleHeartbeat (ch, codec)
- elif hdr[0] == 'e':
- self.handleEvent (ch, codec)
- else:
- self.parse (ch, codec, hdr[0], hdr[1])
-
- def replyCb (self, ch, msg):
- """ Receive messages via the reply queue of a particular channel. """
- codec = Codec (self.spec, msg.body)
- hdr = self.checkHeader (codec)
- if hdr == None:
- return
-
- if hdr[0] == 'm':
- self.handleMethodReply (ch, codec, hdr[1])
- elif hdr[0] == 'z':
- self.handleCommandComplete (ch, codec, hdr[1])
- elif hdr[0] == 'b':
- self.handleBrokerResponse (ch, codec)
- elif hdr[0] == 'p':
- self.handlePackageInd (ch, codec)
- elif hdr[0] == 'q':
- self.handleClassInd (ch, codec)
- else:
- self.parse (ch, codec, hdr[0], hdr[1])
-
- def exceptCb (self, ch, data):
- if self.closeCb != None:
- self.closeCb (ch.context, data)
-
- #========================================================
- # Internal Functions
- #========================================================
- def setHeader (self, codec, opcode, seq = 0):
- """ Compose the header of a management message. """
- codec.write_uint8 (ord ('A'))
- codec.write_uint8 (ord ('M'))
- codec.write_uint8 (ord ('2'))
- codec.write_uint8 (opcode)
- codec.write_uint32 (seq)
-
- def checkHeader (self, codec):
- """ Check the header of a management message and extract the opcode and class. """
- try:
- octet = chr (codec.read_uint8 ())
- if octet != 'A':
- return None
- octet = chr (codec.read_uint8 ())
- if octet != 'M':
- return None
- octet = chr (codec.read_uint8 ())
- if octet != '2':
- return None
- opcode = chr (codec.read_uint8 ())
- seq = codec.read_uint32 ()
- return (opcode, seq)
- except:
- return None
-
- def encodeValue (self, codec, value, typecode):
- """ Encode, into the codec, a value based on its typecode. """
- if typecode == 1:
- codec.write_uint8 (int (value))
- elif typecode == 2:
- codec.write_uint16 (int (value))
- elif typecode == 3:
- codec.write_uint32 (long (value))
- elif typecode == 4:
- codec.write_uint64 (long (value))
- elif typecode == 5:
- codec.write_uint8 (int (value))
- elif typecode == 6:
- codec.write_str8 (value)
- elif typecode == 7:
- codec.write_str16 (value)
- elif typecode == 8: # ABSTIME
- codec.write_uint64 (long (value))
- elif typecode == 9: # DELTATIME
- codec.write_uint64 (long (value))
- elif typecode == 10: # REF
- value.encode(codec)
- elif typecode == 11: # BOOL
- codec.write_uint8 (int (value))
- elif typecode == 12: # FLOAT
- codec.write_float (float (value))
- elif typecode == 13: # DOUBLE
- codec.write_double (float (value))
- elif typecode == 14: # UUID
- codec.write_uuid (value)
- elif typecode == 15: # FTABLE
- codec.write_map (value)
- elif typecode == 16:
- codec.write_int8 (int(value))
- elif typecode == 17:
- codec.write_int16 (int(value))
- elif typecode == 18:
- codec.write_int32 (int(value))
- elif typecode == 19:
- codec.write_int64 (int(value))
- else:
- raise ValueError ("Invalid type code: %d" % typecode)
-
- def decodeValue (self, codec, typecode):
- """ Decode, from the codec, a value based on its typecode. """
- if typecode == 1:
- data = codec.read_uint8 ()
- elif typecode == 2:
- data = codec.read_uint16 ()
- elif typecode == 3:
- data = codec.read_uint32 ()
- elif typecode == 4:
- data = codec.read_uint64 ()
- elif typecode == 5:
- data = codec.read_uint8 ()
- elif typecode == 6:
- data = codec.read_str8 ()
- elif typecode == 7:
- data = codec.read_str16 ()
- elif typecode == 8: # ABSTIME
- data = codec.read_uint64 ()
- elif typecode == 9: # DELTATIME
- data = codec.read_uint64 ()
- elif typecode == 10: # REF
- data = objectId(codec)
- elif typecode == 11: # BOOL
- data = codec.read_uint8 ()
- elif typecode == 12: # FLOAT
- data = codec.read_float ()
- elif typecode == 13: # DOUBLE
- data = codec.read_double ()
- elif typecode == 14: # UUID
- data = codec.read_uuid ()
- elif typecode == 15: # FTABLE
- data = codec.read_map ()
- elif typecode == 16:
- data = codec.read_int8 ()
- elif typecode == 17:
- data = codec.read_int16 ()
- elif typecode == 18:
- data = codec.read_int32 ()
- elif typecode == 19:
- data = codec.read_int64 ()
- else:
- raise ValueError ("Invalid type code: %d" % typecode)
- return data
-
- def incOutstanding (self, ch):
- self.cv.acquire ()
- ch.reqsOutstanding = ch.reqsOutstanding + 1
- self.cv.release ()
-
- def decOutstanding (self, ch):
- self.cv.acquire ()
- ch.reqsOutstanding = ch.reqsOutstanding - 1
- if ch.reqsOutstanding == 0 and self.syncInFlight:
- self.syncInFlight = False
- self.cv.notify ()
- self.cv.release ()
-
- if ch.reqsOutstanding == 0:
- if self.ctrlCb != None:
- self.ctrlCb (ch.context, self.CTRL_SCHEMA_LOADED, None)
- ch.ssn.exchange_bind (exchange="qpid.management",
- queue=ch.topicName, binding_key="console.#")
- ch.ssn.exchange_bind (exchange="qpid.management",
- queue=ch.topicName, binding_key="schema.#")
-
-
- def handleMethodReply (self, ch, codec, sequence):
- status = codec.read_uint32 ()
- sText = codec.read_str16 ()
-
- data = self.seqMgr.release (sequence)
- if data == None:
- return
-
- (userSequence, classId, methodName) = data
- args = {}
- context = self.seqMgr.release (userSequence)
-
- if status == 0:
- schemaClass = self.schema[classId]
- ms = schemaClass['M']
- arglist = None
- for mname in ms:
- (mdesc, margs) = ms[mname]
- if mname == methodName:
- arglist = margs
- if arglist == None:
- return
-
- for arg in arglist:
- if arg[2].find("O") != -1:
- args[arg[0]] = self.decodeValue (codec, arg[1])
-
- if context == "sync" and userSequence == self.syncSequence:
- self.cv.acquire ()
- self.syncInFlight = False
- self.syncResult = methodResult (status, sText, args)
- self.cv.notify ()
- self.cv.release ()
- elif self.methodCb != None:
- self.methodCb (ch.context, userSequence, status, sText, args)
-
- def handleCommandComplete (self, ch, codec, seq):
- code = codec.read_uint32 ()
- text = codec.read_str8 ()
- data = (seq, code, text)
- context = self.seqMgr.release (seq)
- if context == "outstanding":
- self.decOutstanding (ch)
- elif context == "sync" and seq == self.syncSequence:
- self.cv.acquire ()
- self.syncInFlight = False
- self.cv.notify ()
- self.cv.release ()
- elif self.ctrlCb != None:
- self.ctrlCb (ch.context, self.CTRL_USER, data)
-
- def handleBrokerResponse (self, ch, codec):
- uuid = codec.read_uuid ()
- ch.brokerInfo = brokerInfo (uuid, ch.sessionId)
- if self.ctrlCb != None:
- self.ctrlCb (ch.context, self.CTRL_BROKER_INFO, ch.brokerInfo)
-
- # Send a package request
- sendCodec = Codec (self.spec)
- seq = self.seqMgr.reserve ("outstanding")
- self.setHeader (sendCodec, ord ('P'), seq)
- smsg = ch.message(sendCodec.encoded)
- ch.send ("qpid.management", smsg)
-
- def handlePackageInd (self, ch, codec):
- pname = codec.read_str8 ()
- if pname not in self.packages:
- self.packages[pname] = {}
-
- # Send a class request
- sendCodec = Codec (self.spec)
- seq = self.seqMgr.reserve ("outstanding")
- self.setHeader (sendCodec, ord ('Q'), seq)
- self.incOutstanding (ch)
- sendCodec.write_str8 (pname)
- smsg = ch.message(sendCodec.encoded)
- ch.send ("qpid.management", smsg)
-
- def handleClassInd (self, ch, codec):
- kind = codec.read_uint8()
- if kind != 1: # This API doesn't handle new-style events
- return
- pname = codec.read_str8()
- cname = codec.read_str8()
- hash = codec.read_bin128()
- if pname not in self.packages:
- return
-
- if (cname, hash) not in self.packages[pname]:
- # Send a schema request
- sendCodec = Codec (self.spec)
- seq = self.seqMgr.reserve ("outstanding")
- self.setHeader (sendCodec, ord ('S'), seq)
- self.incOutstanding (ch)
- sendCodec.write_str8 (pname)
- sendCodec.write_str8 (cname)
- sendCodec.write_bin128 (hash)
- smsg = ch.message(sendCodec.encoded)
- ch.send ("qpid.management", smsg)
-
- def handleHeartbeat (self, ch, codec):
- timestamp = codec.read_uint64()
- if self.ctrlCb != None:
- self.ctrlCb (ch.context, self.CTRL_HEARTBEAT, timestamp)
-
- def handleEvent (self, ch, codec):
- if self.eventCb == None:
- return
- timestamp = codec.read_uint64()
- objId = objectId(codec)
- packageName = codec.read_str8()
- className = codec.read_str8()
- hash = codec.read_bin128()
- name = codec.read_str8()
- classKey = (packageName, className, hash)
- if classKey not in self.schema:
- return;
- schemaClass = self.schema[classKey]
- row = []
- es = schemaClass['E']
- arglist = None
- for ename in es:
- (edesc, eargs) = es[ename]
- if ename == name:
- arglist = eargs
- if arglist == None:
- return
- for arg in arglist:
- row.append((arg[0], self.decodeValue(codec, arg[1])))
- self.eventCb(ch.context, classKey, objId, name, row)
-
- def parseSchema (self, ch, codec):
- """ Parse a received schema-description message. """
- self.decOutstanding (ch)
- kind = codec.read_uint8()
- if kind != 1: # This API doesn't handle new-style events
- return
- packageName = codec.read_str8 ()
- className = codec.read_str8 ()
- hash = codec.read_bin128 ()
- configCount = codec.read_uint16 ()
- instCount = codec.read_uint16 ()
- methodCount = codec.read_uint16 ()
-
- if packageName not in self.packages:
- return
- if (className, hash) in self.packages[packageName]:
- return
-
- classKey = (packageName, className, hash)
- if classKey in self.schema:
- return
-
- configs = []
- insts = []
- methods = {}
-
- configs.append (("id", 4, "", "", 1, 1, None, None, None, None, None))
- insts.append (("id", 4, None, None))
-
- for idx in range (configCount):
- ft = codec.read_map ()
- name = str (ft["name"])
- type = ft["type"]
- access = ft["access"]
- index = ft["index"]
- optional = ft["optional"]
- unit = None
- min = None
- max = None
- maxlen = None
- desc = None
-
- for key, value in ft.items ():
- if key == "unit":
- unit = str (value)
- elif key == "min":
- min = value
- elif key == "max":
- max = value
- elif key == "maxlen":
- maxlen = value
- elif key == "desc":
- desc = str (value)
-
- config = (name, type, unit, desc, access, index, min, max, maxlen, optional)
- configs.append (config)
-
- for idx in range (instCount):
- ft = codec.read_map ()
- name = str (ft["name"])
- type = ft["type"]
- unit = None
- desc = None
-
- for key, value in ft.items ():
- if key == "unit":
- unit = str (value)
- elif key == "desc":
- desc = str (value)
-
- inst = (name, type, unit, desc)
- insts.append (inst)
-
- for idx in range (methodCount):
- ft = codec.read_map ()
- mname = str (ft["name"])
- argCount = ft["argCount"]
- if "desc" in ft:
- mdesc = str (ft["desc"])
- else:
- mdesc = None
-
- args = []
- for aidx in range (argCount):
- ft = codec.read_map ()
- name = str (ft["name"])
- type = ft["type"]
- dir = str (ft["dir"].upper ())
- unit = None
- min = None
- max = None
- maxlen = None
- desc = None
- default = None
-
- for key, value in ft.items ():
- if key == "unit":
- unit = str (value)
- elif key == "min":
- min = value
- elif key == "max":
- max = value
- elif key == "maxlen":
- maxlen = value
- elif key == "desc":
- desc = str (value)
- elif key == "default":
- default = str (value)
-
- arg = (name, type, dir, unit, desc, min, max, maxlen, default)
- args.append (arg)
- methods[mname] = (mdesc, args)
-
- schemaClass = {}
- schemaClass['C'] = configs
- schemaClass['I'] = insts
- schemaClass['M'] = methods
- self.schema[classKey] = schemaClass
-
- if self.schemaCb != None:
- self.schemaCb (ch.context, classKey, configs, insts, methods, {})
-
- def parsePresenceMasks(self, codec, schemaClass):
- """ Generate a list of not-present properties """
- excludeList = []
- bit = 0
- for element in schemaClass['C'][1:]:
- if element[9] == 1:
- if bit == 0:
- mask = codec.read_uint8()
- bit = 1
- if (mask & bit) == 0:
- excludeList.append(element[0])
- bit = bit * 2
- if bit == 256:
- bit = 0
- return excludeList
-
- def parseContent (self, ch, cls, codec, seq=0):
- """ Parse a received content message. """
- if (cls == 'C' or (cls == 'B' and seq == 0)) and self.configCb == None:
- return
- if cls == 'I' and self.instCb == None:
- return
-
- packageName = codec.read_str8 ()
- className = codec.read_str8 ()
- hash = codec.read_bin128 ()
- classKey = (packageName, className, hash)
-
- if classKey not in self.schema:
- return
-
- row = []
- timestamps = []
-
- timestamps.append (codec.read_uint64 ()) # Current Time
- timestamps.append (codec.read_uint64 ()) # Create Time
- timestamps.append (codec.read_uint64 ()) # Delete Time
- objId = objectId(codec)
- schemaClass = self.schema[classKey]
- if cls == 'C' or cls == 'B':
- notPresent = self.parsePresenceMasks(codec, schemaClass)
-
- if cls == 'C' or cls == 'B':
- row.append(("id", objId))
- for element in schemaClass['C'][1:]:
- tc = element[1]
- name = element[0]
- if name in notPresent:
- row.append((name, None))
- else:
- data = self.decodeValue(codec, tc)
- row.append((name, data))
-
- if cls == 'I' or cls == 'B':
- if cls == 'I':
- row.append(("id", objId))
- for element in schemaClass['I'][1:]:
- tc = element[1]
- name = element[0]
- data = self.decodeValue (codec, tc)
- row.append ((name, data))
-
- if cls == 'C' or (cls == 'B' and seq != self.syncSequence):
- self.configCb (ch.context, classKey, row, timestamps)
- elif cls == 'B' and seq == self.syncSequence:
- if timestamps[2] == 0:
- obj = mgmtObject (classKey, timestamps, row)
- self.syncResult.append (obj)
- elif cls == 'I':
- self.instCb (ch.context, classKey, row, timestamps)
-
- def parse (self, ch, codec, opcode, seq):
- """ Parse a message received from the topic queue. """
- if opcode == 's':
- self.parseSchema (ch, codec)
- elif opcode == 'c':
- self.parseContent (ch, 'C', codec)
- elif opcode == 'i':
- self.parseContent (ch, 'I', codec)
- elif opcode == 'g':
- self.parseContent (ch, 'B', codec, seq)
- else:
- raise ValueError ("Unknown opcode: %c" % opcode);
-
- def method (self, channel, userSequence, objId, classId, methodName, args):
- """ Invoke a method on an object """
- codec = Codec (self.spec)
- sequence = self.seqMgr.reserve ((userSequence, classId, methodName))
- self.setHeader (codec, ord ('M'), sequence)
- objId.encode(codec)
- codec.write_str8 (classId[0])
- codec.write_str8 (classId[1])
- codec.write_bin128 (classId[2])
- codec.write_str8 (methodName)
- bank = "%d.%d" % (objId.getBroker(), objId.getBank())
-
- # Encode args according to schema
- if classId not in self.schema:
- self.seqMgr.release (sequence)
- raise ValueError ("Unknown class name: %s" % classId)
-
- schemaClass = self.schema[classId]
- ms = schemaClass['M']
- arglist = None
- for mname in ms:
- (mdesc, margs) = ms[mname]
- if mname == methodName:
- arglist = margs
- if arglist == None:
- self.seqMgr.release (sequence)
- raise ValueError ("Unknown method name: %s" % methodName)
-
- for arg in arglist:
- if arg[2].find("I") != -1:
- value = arg[8] # default
- if arg[0] in args:
- value = args[arg[0]]
- if value == None:
- self.seqMgr.release (sequence)
- raise ValueError ("Missing non-defaulted argument: %s" % arg[0])
- self.encodeValue (codec, value, arg[1])
-
- packageName = classId[0]
- className = classId[1]
- msg = channel.message(codec.encoded, "agent." + bank)
- channel.send ("qpid.management", msg)
diff --git a/M4-RCs/qpid/python/qpid/managementdata.py b/M4-RCs/qpid/python/qpid/managementdata.py
deleted file mode 100644
index 46c746c0f9..0000000000
--- a/M4-RCs/qpid/python/qpid/managementdata.py
+++ /dev/null
@@ -1,753 +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.
-#
-
-
-###############################################################################
-## This file is being obsoleted by qmf/console.py
-###############################################################################
-
-import qpid
-import re
-import socket
-import struct
-import os
-import locale
-from qpid.management import managementChannel, managementClient
-from threading import Lock
-from disp import Display
-from shlex import split
-from qpid.connection import Connection
-from qpid.util import connect
-
-class Broker:
- def __init__ (self, text):
- rex = re.compile(r"""
- # [ <user> [ / <password> ] @] <host> [ :<port> ]
- ^ (?: ([^/]*) (?: / ([^@]*) )? @)? ([^:]+) (?: :([0-9]+))?$""", re.X)
- match = rex.match(text)
- if not match: raise ValueError("'%s' is not a valid broker url" % (text))
- user, password, host, port = match.groups()
-
- self.host = socket.gethostbyname (host)
- if port: self.port = int(port)
- else: self.port = 5672
- self.username = user or "guest"
- self.password = password or "guest"
-
- def name (self):
- return self.host + ":" + str (self.port)
-
-class ManagementData:
-
- #
- # Data Structure:
- #
- # Please note that this data structure holds only the most recent
- # configuration and instrumentation data for each object. It does
- # not hold the detailed historical data that is sent from the broker.
- # The only historical data it keeps are the high and low watermarks
- # for hi-lo statistics.
- #
- # tables :== {class-key}
- # {<obj-id>}
- # (timestamp, config-record, inst-record)
- # class-key :== (<package-name>, <class-name>, <class-hash>)
- # timestamp :== (<last-interval-time>, <create-time>, <delete-time>)
- # config-record :== [element]
- # inst-record :== [element]
- # element :== (<element-name>, <element-value>)
- #
-
- def registerObjId (self, objId):
- if not objId.index() in self.idBackMap:
- self.idBackMap[objId.index()] = self.nextId
- self.idMap[self.nextId] = objId
- self.nextId += 1
-
- def displayObjId (self, objIdIndex):
- if objIdIndex in self.idBackMap:
- return self.idBackMap[objIdIndex]
- else:
- return 0
-
- def rawObjId (self, displayId):
- if displayId in self.idMap:
- return self.idMap[displayId]
- else:
- return None
-
- def displayClassName (self, cls):
- (packageName, className, hash) = cls
- rev = self.schema[cls][4]
- if rev == 0:
- suffix = ""
- else:
- suffix = ".%d" % rev
- return packageName + ":" + className + suffix
-
- def dataHandler (self, context, className, list, timestamps):
- """ Callback for configuration and instrumentation data updates """
- self.lock.acquire ()
- try:
- # If this class has not been seen before, create an empty dictionary to
- # hold objects of this class
- if className not in self.tables:
- self.tables[className] = {}
-
- # Register the ID so a more friendly presentation can be displayed
- objId = list[0][1]
- oidx = objId.index()
- self.registerObjId (objId)
-
- # If this object hasn't been seen before, create a new object record with
- # the timestamps and empty lists for configuration and instrumentation data.
- if oidx not in self.tables[className]:
- self.tables[className][oidx] = (timestamps, [], [])
-
- (unused, oldConf, oldInst) = self.tables[className][oidx]
-
- # For config updates, simply replace old config list with the new one.
- if context == 0: #config
- self.tables[className][oidx] = (timestamps, list, oldInst)
-
- # For instrumentation updates, carry the minimum and maximum values for
- # "hi-lo" stats forward.
- elif context == 1: #inst
- if len (oldInst) == 0:
- newInst = list
- else:
- newInst = []
- for idx in range (len (list)):
- (key, value) = list[idx]
- if key.find ("High") == len (key) - 4:
- if oldInst[idx][1] > value:
- value = oldInst[idx][1]
- if key.find ("Low") == len (key) - 3:
- if oldInst[idx][1] < value:
- value = oldInst[idx][1]
- newInst.append ((key, value))
- self.tables[className][oidx] = (timestamps, oldConf, newInst)
-
- finally:
- self.lock.release ()
-
- def ctrlHandler (self, context, op, data):
- if op == self.mclient.CTRL_BROKER_INFO:
- pass
- elif op == self.mclient.CTRL_HEARTBEAT:
- pass
-
- def configHandler (self, context, className, list, timestamps):
- self.dataHandler (0, className, list, timestamps);
-
- def instHandler (self, context, className, list, timestamps):
- self.dataHandler (1, className, list, timestamps);
-
- def methodReply (self, broker, sequence, status, sText, args):
- """ Callback for method-reply messages """
- self.lock.acquire ()
- try:
- line = "Call Result: " + self.methodsPending[sequence] + \
- " " + str (status) + " (" + sText + ")"
- print line, args
- del self.methodsPending[sequence]
- finally:
- self.lock.release ()
-
- def closeHandler (self, context, reason):
- if self.operational:
- print "Connection to broker lost:", reason
- self.operational = False
- if self.cli != None:
- self.cli.setPromptMessage ("Broker Disconnected")
-
- def schemaHandler (self, context, classKey, configs, insts, methods, events):
- """ Callback for schema updates """
- if classKey not in self.schema:
- schemaRev = 0
- for key in self.schema:
- if classKey[0] == key[0] and classKey[1] == key[1]:
- schemaRev += 1
- self.schema[classKey] = (configs, insts, methods, events, schemaRev)
-
- def setCli (self, cliobj):
- self.cli = cliobj
-
- def __init__ (self, disp, host, username="guest", password="guest"):
- self.lock = Lock ()
- self.tables = {}
- self.schema = {}
- self.bootSequence = 0
- self.operational = False
- self.disp = disp
- self.cli = None
- self.lastUnit = None
- self.methodSeq = 1
- self.methodsPending = {}
- self.sessionId = "%s.%d" % (os.uname()[1], os.getpid())
-
- self.broker = Broker (host)
- self.conn = Connection (connect (self.broker.host, self.broker.port),
- username=self.broker.username, password=self.broker.password)
- self.spec = self.conn.spec
- self.conn.start ()
-
- self.mclient = managementClient (self.spec, self.ctrlHandler, self.configHandler,
- self.instHandler, self.methodReply, self.closeHandler)
- self.mclient.schemaListener (self.schemaHandler)
- self.mch = self.mclient.addChannel (self.conn.session(self.sessionId))
- self.operational = True
- self.idMap = {}
- self.idBackMap = {}
- self.nextId = 101
-
- def close (self):
- pass
-
- def refName (self, oid):
- if oid == None:
- return "NULL"
- return str (self.displayObjId (oid.index()))
-
- def valueDisplay (self, classKey, key, value):
- if value == None:
- return "<NULL>"
- for kind in range (2):
- schema = self.schema[classKey][kind]
- for item in schema:
- if item[0] == key:
- typecode = item[1]
- unit = item[2]
- if (typecode >= 1 and typecode <= 5) or typecode == 12 or typecode == 13 or \
- (typecode >= 16 and typecode <= 19):
- if unit == None or unit == self.lastUnit:
- return str (value)
- else:
- self.lastUnit = unit
- suffix = ""
- if value != 1:
- suffix = "s"
- return str (value) + " " + unit + suffix
- elif typecode == 6 or typecode == 7: # strings
- return value
- elif typecode == 8:
- if value == 0:
- return "--"
- return self.disp.timestamp (value)
- elif typecode == 9:
- return str (value)
- elif typecode == 10:
- return self.refName (value)
- elif typecode == 11:
- if value == 0:
- return "False"
- else:
- return "True"
- elif typecode == 14:
- return "%08x-%04x-%04x-%04x-%04x%08x" % struct.unpack ("!LHHHHL", value)
- elif typecode == 15:
- return str (value)
- return "*type-error*"
-
- def getObjIndex (self, classKey, config):
- """ Concatenate the values from index columns to form a unique object name """
- result = ""
- schemaConfig = self.schema[classKey][0]
- for item in schemaConfig:
- if item[5] == 1 and item[0] != "id":
- if result != "":
- result = result + "."
- for key,val in config:
- if key == item[0]:
- result = result + self.valueDisplay (classKey, key, val)
- return result
-
- def getClassKey (self, className):
- delimPos = className.find(":")
- if delimPos == -1:
- schemaRev = 0
- delim = className.find(".")
- if delim != -1:
- schemaRev = int(className[delim + 1:])
- name = className[0:delim]
- else:
- name = className
- for key in self.schema:
- if key[1] == name and self.schema[key][4] == schemaRev:
- return key
- else:
- package = className[0:delimPos]
- name = className[delimPos + 1:]
- schemaRev = 0
- delim = name.find(".")
- if delim != -1:
- schemaRev = int(name[delim + 1:])
- name = name[0:delim]
- for key in self.schema:
- if key[0] == package and key[1] == name:
- if self.schema[key][4] == schemaRev:
- return key
- return None
-
- def classCompletions (self, prefix):
- """ Provide a list of candidate class names for command completion """
- self.lock.acquire ()
- complist = []
- try:
- for name in self.tables:
- if name.find (prefix) == 0:
- complist.append (name)
- finally:
- self.lock.release ()
- return complist
-
- def typeName (self, typecode):
- """ Convert type-codes to printable strings """
- if typecode == 1:
- return "uint8"
- elif typecode == 2:
- return "uint16"
- elif typecode == 3:
- return "uint32"
- elif typecode == 4:
- return "uint64"
- elif typecode == 5:
- return "bool"
- elif typecode == 6:
- return "short-string"
- elif typecode == 7:
- return "long-string"
- elif typecode == 8:
- return "abs-time"
- elif typecode == 9:
- return "delta-time"
- elif typecode == 10:
- return "reference"
- elif typecode == 11:
- return "boolean"
- elif typecode == 12:
- return "float"
- elif typecode == 13:
- return "double"
- elif typecode == 14:
- return "uuid"
- elif typecode == 15:
- return "field-table"
- elif typecode == 16:
- return "int8"
- elif typecode == 17:
- return "int16"
- elif typecode == 18:
- return "int32"
- elif typecode == 19:
- return "int64"
- else:
- raise ValueError ("Invalid type code: %d" % typecode)
-
- def accessName (self, code):
- """ Convert element access codes to printable strings """
- if code == 1:
- return "ReadCreate"
- elif code == 2:
- return "ReadWrite"
- elif code == 3:
- return "ReadOnly"
- else:
- raise ValueError ("Invalid access code: %d" %code)
-
- def notNone (self, text):
- if text == None:
- return ""
- else:
- return text
-
- def isOid (self, id):
- for char in str (id):
- if not char.isdigit () and not char == '-':
- return False
- return True
-
- def listOfIds (self, classKey, tokens):
- """ Generate a tuple of object ids for a classname based on command tokens. """
- list = []
- if len(tokens) == 0 or tokens[0] == "all":
- for id in self.tables[classKey]:
- list.append (self.displayObjId (id))
-
- elif tokens[0] == "active":
- for id in self.tables[classKey]:
- if self.tables[classKey][id][0][2] == 0:
- list.append (self.displayObjId (id))
-
- else:
- for token in tokens:
- if self.isOid (token):
- if token.find ("-") != -1:
- ids = token.split("-", 2)
- for id in range (int (ids[0]), int (ids[1]) + 1):
- if self.getClassForId (self.rawObjId (long (id))) == classKey:
- list.append (id)
- else:
- list.append (int(token))
-
- list.sort ()
- result = ()
- for item in list:
- result = result + (item,)
- return result
-
- def listClasses (self):
- """ Generate a display of the list of classes """
- self.lock.acquire ()
- try:
- rows = []
- sorted = self.tables.keys ()
- sorted.sort ()
- for name in sorted:
- active = 0
- deleted = 0
- for record in self.tables[name]:
- isdel = False
- ts = self.tables[name][record][0]
- if ts[2] > 0:
- isdel = True
- if isdel:
- deleted = deleted + 1
- else:
- active = active + 1
- rows.append ((self.displayClassName (name), active, deleted))
- if len (rows) != 0:
- self.disp.table ("Management Object Types:",
- ("ObjectType", "Active", "Deleted"), rows)
- else:
- print "Waiting for next periodic update"
- finally:
- self.lock.release ()
-
- def listObjects (self, tokens):
- """ Generate a display of a list of objects in a class """
- if len(tokens) == 0:
- print "Error - No class name provided"
- return
-
- self.lock.acquire ()
- try:
- classKey = self.getClassKey (tokens[0])
- if classKey == None:
- print ("Object type %s not known" % tokens[0])
- else:
- rows = []
- if classKey in self.tables:
- ids = self.listOfIds(classKey, tokens[1:])
- for objId in ids:
- (ts, config, inst) = self.tables[classKey][self.rawObjId(objId).index()]
- createTime = self.disp.timestamp (ts[1])
- destroyTime = "-"
- if ts[2] > 0:
- destroyTime = self.disp.timestamp (ts[2])
- objIndex = self.getObjIndex (classKey, config)
- row = (objId, createTime, destroyTime, objIndex)
- rows.append (row)
- self.disp.table ("Objects of type %s" % self.displayClassName(classKey),
- ("ID", "Created", "Destroyed", "Index"),
- rows)
- finally:
- self.lock.release ()
-
- def showObjects (self, tokens):
- """ Generate a display of object data for a particular class """
- self.lock.acquire ()
- try:
- self.lastUnit = None
- if self.isOid (tokens[0]):
- if tokens[0].find ("-") != -1:
- rootId = int (tokens[0][0:tokens[0].find ("-")])
- else:
- rootId = int (tokens[0])
-
- classKey = self.getClassForId (self.rawObjId (rootId))
- remaining = tokens
- if classKey == None:
- print "Id not known: %d" % int (tokens[0])
- raise ValueError ()
- else:
- classKey = self.getClassKey (tokens[0])
- remaining = tokens[1:]
- if classKey not in self.tables:
- print "Class not known: %s" % tokens[0]
- raise ValueError ()
-
- userIds = self.listOfIds (classKey, remaining)
- if len (userIds) == 0:
- print "No object IDs supplied"
- raise ValueError ()
-
- ids = []
- for id in userIds:
- if self.getClassForId (self.rawObjId (long (id))) == classKey:
- ids.append (self.rawObjId (long (id)))
-
- rows = []
- timestamp = None
- config = self.tables[classKey][ids[0].index()][1]
- for eIdx in range (len (config)):
- key = config[eIdx][0]
- if key != "id":
- row = ("property", key)
- for id in ids:
- if timestamp == None or \
- timestamp < self.tables[classKey][id.index()][0][0]:
- timestamp = self.tables[classKey][id.index()][0][0]
- (key, value) = self.tables[classKey][id.index()][1][eIdx]
- row = row + (self.valueDisplay (classKey, key, value),)
- rows.append (row)
-
- inst = self.tables[classKey][ids[0].index()][2]
- for eIdx in range (len (inst)):
- key = inst[eIdx][0]
- if key != "id":
- row = ("statistic", key)
- for id in ids:
- (key, value) = self.tables[classKey][id.index()][2][eIdx]
- row = row + (self.valueDisplay (classKey, key, value),)
- rows.append (row)
-
- titleRow = ("Type", "Element")
- for id in ids:
- titleRow = titleRow + (self.refName(id),)
- caption = "Object of type %s:" % self.displayClassName(classKey)
- if timestamp != None:
- caption = caption + " (last sample time: " + self.disp.timestamp (timestamp) + ")"
- self.disp.table (caption, titleRow, rows)
-
- except:
- pass
- self.lock.release ()
-
- def schemaSummary (self):
- """ Generate a display of the list of classes in the schema """
- self.lock.acquire ()
- try:
- rows = []
- sorted = self.schema.keys ()
- sorted.sort ()
- for classKey in sorted:
- tuple = self.schema[classKey]
- row = (self.displayClassName(classKey), len (tuple[0]), len (tuple[1]),
- len (tuple[2]))
- rows.append (row)
- self.disp.table ("Classes in Schema:",
- ("Class", "Properties", "Statistics", "Methods"),
- rows)
- finally:
- self.lock.release ()
-
- def schemaTable (self, className):
- """ Generate a display of details of the schema of a particular class """
- self.lock.acquire ()
- try:
- classKey = self.getClassKey (className)
- if classKey == None:
- print ("Class name %s not known" % className)
- raise ValueError ()
-
- rows = []
- schemaRev = self.schema[classKey][4]
- for config in self.schema[classKey][0]:
- name = config[0]
- if name != "id":
- typename = self.typeName(config[1])
- unit = self.notNone (config[2])
- desc = self.notNone (config[3])
- access = self.accessName (config[4])
- extra = ""
- if config[5] == 1:
- extra += "index "
- if config[6] != None:
- extra += "Min: " + str(config[6]) + " "
- if config[7] != None:
- extra += "Max: " + str(config[7]) + " "
- if config[8] != None:
- extra += "MaxLen: " + str(config[8]) + " "
- if config[9] == 1:
- extra += "optional "
- rows.append ((name, typename, unit, access, extra, desc))
-
- for config in self.schema[classKey][1]:
- name = config[0]
- if name != "id":
- typename = self.typeName(config[1])
- unit = self.notNone (config[2])
- desc = self.notNone (config[3])
- rows.append ((name, typename, unit, "", "", desc))
-
- titles = ("Element", "Type", "Unit", "Access", "Notes", "Description")
- self.disp.table ("Schema for class '%s':" % self.displayClassName(classKey), titles, rows)
-
- for mname in self.schema[classKey][2]:
- (mdesc, args) = self.schema[classKey][2][mname]
- caption = "\nMethod '%s' %s" % (mname, self.notNone (mdesc))
- rows = []
- for arg in args:
- name = arg[0]
- typename = self.typeName (arg[1])
- dir = arg[2]
- unit = self.notNone (arg[3])
- desc = self.notNone (arg[4])
- extra = ""
- if arg[5] != None:
- extra = extra + "Min: " + str (arg[5])
- if arg[6] != None:
- extra = extra + "Max: " + str (arg[6])
- if arg[7] != None:
- extra = extra + "MaxLen: " + str (arg[7])
- if arg[8] != None:
- extra = extra + "Default: " + str (arg[8])
- rows.append ((name, typename, dir, unit, extra, desc))
- titles = ("Argument", "Type", "Direction", "Unit", "Notes", "Description")
- self.disp.table (caption, titles, rows)
-
- except Exception,e:
- pass
- self.lock.release ()
-
- def getClassForId (self, objId):
- """ Given an object ID, return the class key for the referenced object """
- for classKey in self.tables:
- if objId.index() in self.tables[classKey]:
- return classKey
- return None
-
- def callMethod (self, userOid, methodName, args):
- self.lock.acquire ()
- methodOk = True
- try:
- classKey = self.getClassForId (self.rawObjId (userOid))
- if classKey == None:
- raise ValueError ()
-
- if methodName not in self.schema[classKey][2]:
- print "Method '%s' not valid for class '%s'" % (methodName, self.displayClassName(classKey))
- raise ValueError ()
-
- schemaMethod = self.schema[classKey][2][methodName]
- count = 0
- for arg in range(len(schemaMethod[1])):
- if schemaMethod[1][arg][2].find("I") != -1:
- count += 1
- if len (args) != count:
- print "Wrong number of method args: Need %d, Got %d" % (count, len (args))
- raise ValueError ()
-
- namedArgs = {}
- idx = 0
- for arg in range(len(schemaMethod[1])):
- if schemaMethod[1][arg][2].find("I") != -1:
- namedArgs[schemaMethod[1][arg][0]] = args[idx]
- idx += 1
-
- self.methodSeq = self.methodSeq + 1
- self.methodsPending[self.methodSeq] = methodName
- except Exception, e:
- methodOk = False
- self.lock.release ()
- if methodOk:
-# try:
- self.mclient.callMethod (self.mch, self.methodSeq, self.rawObjId (userOid), classKey,
- methodName, namedArgs)
-# except ValueError, e:
-# print "Error invoking method:", e
-
- def makeIdRow (self, displayId):
- if displayId in self.idMap:
- objId = self.idMap[displayId]
- else:
- return None
- if objId.getFlags() == 0:
- flags = ""
- else:
- flags = str(objId.getFlags())
- seq = objId.getSequence()
- if seq == 0:
- seqText = "<durable>"
- else:
- seqText = str(seq)
- return (displayId, flags, seqText, objId.getBroker(), objId.getBank(), hex(objId.getObject()))
-
- def listIds (self, select):
- rows = []
- if select == 0:
- sorted = self.idMap.keys()
- sorted.sort()
- for displayId in sorted:
- row = self.makeIdRow (displayId)
- rows.append(row)
- else:
- row = self.makeIdRow (select)
- if row == None:
- print "Display Id %d not known" % select
- return
- rows.append(row)
- self.disp.table("Translation of Display IDs:",
- ("DisplayID", "Flags", "BootSequence", "Broker", "Bank", "Object"),
- rows)
-
- def do_list (self, data):
- tokens = data.split ()
- if len (tokens) == 0:
- self.listClasses ()
- else:
- self.listObjects (tokens)
-
- def do_show (self, data):
- tokens = data.split ()
- self.showObjects (tokens)
-
- def do_schema (self, data):
- if data == "":
- self.schemaSummary ()
- else:
- self.schemaTable (data)
-
- def do_call (self, data):
- encTokens = data.split ()
- try:
- tokens = [a.decode(locale.getpreferredencoding()) for a in encArgs]
- except:
- tokens = encTokens
- if len (tokens) < 2:
- print "Not enough arguments supplied"
- return
-
- displayId = long (tokens[0])
- methodName = tokens[1]
- args = tokens[2:]
- self.callMethod (displayId, methodName, args)
-
- def do_id (self, data):
- if data == "":
- select = 0
- else:
- select = int(data)
- self.listIds(select)
-
- def do_exit (self):
- self.mclient.removeChannel (self.mch)
diff --git a/M4-RCs/qpid/python/qpid/message.py b/M4-RCs/qpid/python/qpid/message.py
deleted file mode 100644
index eb3ef5c03c..0000000000
--- a/M4-RCs/qpid/python/qpid/message.py
+++ /dev/null
@@ -1,74 +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 connection08 import Method, Request
-from sets import Set
-
-class Message:
-
- def __init__(self, channel, frame, content = None):
- self.channel = channel
- self.frame = frame
- self.method = frame.method_type
- self.content = content
- if self.method.is_l4_command():
- self.command_id = self.channel.incoming_completion.sequence.next()
- #print "allocated: ", self.command_id, "to ", self.method.klass.name, "_", self.method.name
-
- def __len__(self):
- return len(self.frame.args)
-
- def _idx(self, idx):
- if idx < 0: idx += len(self)
- if idx < 0 or idx > len(self):
- raise IndexError(idx)
- return idx
-
- def __getitem__(self, idx):
- return self.frame.args[idx]
-
- def __getattr__(self, attr):
- fields = self.method.fields.byname
- if fields.has_key(attr):
- f = fields[attr]
- result = self[self.method.fields.index(f)]
- else:
- for r in self.method.responses:
- if attr == r.name:
- def respond(*args, **kwargs):
- batch=0
- if kwargs.has_key("batchoffset"):
- batch=kwargs.pop("batchoffset")
- self.channel.respond(Method(r, r.arguments(*args, **kwargs)), batch, self.frame)
- result = respond
- break
- else:
- raise AttributeError(attr)
- return result
-
- STR = "%s %s content = %s"
- REPR = STR.replace("%s", "%r")
-
- def __str__(self):
- return Message.STR % (self.method, self.frame.args, self.content)
-
- def __repr__(self):
- return Message.REPR % (self.method, self.frame.args, self.content)
-
- def complete(self, cumulative=True):
- self.channel.incoming_completion.complete(mark=self.command_id, cumulative=cumulative)
diff --git a/M4-RCs/qpid/python/qpid/packer.py b/M4-RCs/qpid/python/qpid/packer.py
deleted file mode 100644
index 22c16918dc..0000000000
--- a/M4-RCs/qpid/python/qpid/packer.py
+++ /dev/null
@@ -1,36 +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.
-#
-
-import struct
-
-class Packer:
-
- def read(self, n): abstract
-
- def write(self, s): abstract
-
- def unpack(self, fmt):
- values = struct.unpack(fmt, self.read(struct.calcsize(fmt)))
- if len(values) == 1:
- return values[0]
- else:
- return values
-
- def pack(self, fmt, *args):
- self.write(struct.pack(fmt, *args))
diff --git a/M4-RCs/qpid/python/qpid/peer.py b/M4-RCs/qpid/python/qpid/peer.py
deleted file mode 100644
index 648f32ceef..0000000000
--- a/M4-RCs/qpid/python/qpid/peer.py
+++ /dev/null
@@ -1,465 +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 contains a skeletal peer implementation useful for
-implementing an AMQP server, client, or proxy. The peer implementation
-sorts incoming frames to their intended channels, and dispatches
-incoming method frames to a delegate.
-"""
-
-import thread, threading, traceback, socket, sys, logging
-from connection08 import EOF, Method, Header, Body, Request, Response
-from message import Message
-from queue import Queue, Closed as QueueClosed
-from content import Content
-from cStringIO import StringIO
-from time import time
-
-class Sequence:
-
- def __init__(self, start, step = 1):
- # we should keep start for wrap around
- self._next = start
- self.step = step
- self.lock = thread.allocate_lock()
-
- def next(self):
- self.lock.acquire()
- try:
- result = self._next
- self._next += self.step
- return result
- finally:
- self.lock.release()
-
-class Peer:
-
- def __init__(self, conn, delegate, channel_factory=None):
- self.conn = conn
- self.delegate = delegate
- self.outgoing = Queue(0)
- self.work = Queue(0)
- self.channels = {}
- self.lock = thread.allocate_lock()
- if channel_factory:
- self.channel_factory = channel_factory
- else:
- self.channel_factory = Channel
-
- def channel(self, id):
- self.lock.acquire()
- try:
- try:
- ch = self.channels[id]
- except KeyError:
- ch = self.channel_factory(id, self.outgoing, self.conn.spec)
- self.channels[id] = ch
- finally:
- self.lock.release()
- return ch
-
- def start(self):
- thread.start_new_thread(self.writer, ())
- thread.start_new_thread(self.reader, ())
- thread.start_new_thread(self.worker, ())
-
- def fatal(self, message=None):
- """Call when an unexpected exception occurs that will kill a thread."""
- if message: print >> sys.stderr, message
- self.closed("Fatal error: %s\n%s" % (message or "", traceback.format_exc()))
-
- def reader(self):
- try:
- while True:
- try:
- frame = self.conn.read()
- except EOF, e:
- self.work.close()
- break
- ch = self.channel(frame.channel)
- ch.receive(frame, self.work)
- except:
- self.fatal()
-
- def closed(self, reason):
- # We must close the delegate first because closing channels
- # may wake up waiting threads and we don't want them to see
- # the delegate as open.
- self.delegate.closed(reason)
- for ch in self.channels.values():
- ch.closed(reason)
-
- def writer(self):
- try:
- while True:
- try:
- message = self.outgoing.get()
- self.conn.write(message)
- except socket.error, e:
- self.closed(e)
- break
- self.conn.flush()
- except:
- self.fatal()
-
- def worker(self):
- try:
- while True:
- queue = self.work.get()
- frame = queue.get()
- channel = self.channel(frame.channel)
- if frame.method_type.content:
- content = read_content(queue)
- else:
- content = None
-
- self.delegate(channel, Message(channel, frame, content))
- except QueueClosed:
- self.closed("worker closed")
- except:
- self.fatal()
-
-class Requester:
-
- def __init__(self, writer):
- self.write = writer
- self.sequence = Sequence(1)
- self.mark = 0
- # request_id -> listener
- self.outstanding = {}
-
- def request(self, method, listener, content = None):
- frame = Request(self.sequence.next(), self.mark, method)
- self.outstanding[frame.id] = listener
- self.write(frame, content)
-
- def receive(self, channel, frame):
- listener = self.outstanding.pop(frame.request_id)
- listener(channel, frame)
-
-class Responder:
-
- def __init__(self, writer):
- self.write = writer
- self.sequence = Sequence(1)
-
- def respond(self, method, batch, request):
- if isinstance(request, Method):
- self.write(method)
- else:
- # allow batching from frame at either end
- if batch<0:
- frame = Response(self.sequence.next(), request.id+batch, -batch, method)
- else:
- frame = Response(self.sequence.next(), request.id, batch, method)
- self.write(frame)
-
-class Closed(Exception): pass
-
-class Channel:
-
- def __init__(self, id, outgoing, spec):
- self.id = id
- self.outgoing = outgoing
- self.spec = spec
- self.incoming = Queue(0)
- self.responses = Queue(0)
- self.queue = None
- self._closed = False
- self.reason = None
-
- self.requester = Requester(self.write)
- self.responder = Responder(self.write)
-
- self.completion = OutgoingCompletion()
- self.incoming_completion = IncomingCompletion(self)
- self.futures = {}
- self.control_queue = Queue(0)#used for incoming methods that appas may want to handle themselves
-
- self.invoker = self.invoke_method
- self.use_execution_layer = (spec.major == 0 and spec.minor == 10) or (spec.major == 99 and spec.minor == 0)
- self.synchronous = True
-
- def closed(self, reason):
- if self._closed:
- return
- self._closed = True
- self.reason = reason
- self.incoming.close()
- self.responses.close()
- self.completion.close()
- self.incoming_completion.reset()
- for f in self.futures.values():
- f.put_response(self, reason)
-
- def write(self, frame, content = None):
- if self._closed:
- raise Closed(self.reason)
- frame.channel = self.id
- self.outgoing.put(frame)
- if (isinstance(frame, (Method, Request))
- and content == None
- and frame.method_type.content):
- content = Content()
- if content != None:
- self.write_content(frame.method_type.klass, content)
-
- def write_content(self, klass, content):
- header = Header(klass, content.weight(), content.size(), content.properties)
- self.write(header)
- for child in content.children:
- self.write_content(klass, child)
- # should split up if content.body exceeds max frame size
- if content.body:
- self.write(Body(content.body))
-
- def receive(self, frame, work):
- if isinstance(frame, Method):
- if frame.method.response:
- self.queue = self.responses
- else:
- self.queue = self.incoming
- work.put(self.incoming)
- elif isinstance(frame, Request):
- self.queue = self.incoming
- work.put(self.incoming)
- elif isinstance(frame, Response):
- self.requester.receive(self, frame)
- if frame.method_type.content:
- self.queue = self.responses
- return
- self.queue.put(frame)
-
- def queue_response(self, channel, frame):
- channel.responses.put(frame.method)
-
- def request(self, method, listener, content = None):
- self.requester.request(method, listener, content)
-
- def respond(self, method, batch, request):
- self.responder.respond(method, batch, request)
-
- def invoke(self, type, args, kwargs):
- if (type.klass.name in ["channel", "session"]) and (type.name in ["close", "open", "closed"]):
- self.completion.reset()
- self.incoming_completion.reset()
- self.completion.next_command(type)
-
- content = kwargs.pop("content", None)
- frame = Method(type, type.arguments(*args, **kwargs))
- return self.invoker(frame, content)
-
- # used for 0-9
- def invoke_reliable(self, frame, content = None):
- if not self.synchronous:
- future = Future()
- self.request(frame, future.put_response, content)
- if not frame.method.responses: return None
- else: return future
-
- self.request(frame, self.queue_response, content)
- if not frame.method.responses:
- if self.use_execution_layer and frame.method_type.is_l4_command():
- self.execution_sync()
- self.completion.wait()
- if self._closed:
- raise Closed(self.reason)
- return None
- try:
- resp = self.responses.get()
- if resp.method_type.content:
- return Message(self, resp, read_content(self.responses))
- else:
- return Message(self, resp)
- except QueueClosed, e:
- if self._closed:
- raise Closed(self.reason)
- else:
- raise e
-
- # used for 0-8 and 0-10
- def invoke_method(self, frame, content = None):
- if frame.method.result:
- cmd_id = self.completion.command_id
- future = Future()
- self.futures[cmd_id] = future
-
- self.write(frame, content)
-
- try:
- # here we depend on all nowait fields being named nowait
- f = frame.method.fields.byname["nowait"]
- nowait = frame.args[frame.method.fields.index(f)]
- except KeyError:
- nowait = False
-
- try:
- if not nowait and frame.method.responses:
- resp = self.responses.get()
- if resp.method.content:
- content = read_content(self.responses)
- else:
- content = None
- if resp.method in frame.method.responses:
- return Message(self, resp, content)
- else:
- raise ValueError(resp)
- elif frame.method.result:
- if self.synchronous:
- fr = future.get_response(timeout=10)
- if self._closed:
- raise Closed(self.reason)
- return fr
- else:
- return future
- elif self.synchronous and not frame.method.response \
- and self.use_execution_layer and frame.method.is_l4_command():
- self.execution_sync()
- completed = self.completion.wait(timeout=10)
- if self._closed:
- raise Closed(self.reason)
- if not completed:
- self.closed("Timed-out waiting for completion of %s" % frame)
- except QueueClosed, e:
- if self._closed:
- raise Closed(self.reason)
- else:
- raise e
-
- def __getattr__(self, name):
- type = self.spec.method(name)
- if type == None: raise AttributeError(name)
- method = lambda *args, **kwargs: self.invoke(type, args, kwargs)
- self.__dict__[name] = method
- return method
-
-def read_content(queue):
- header = queue.get()
- children = []
- for i in range(header.weight):
- children.append(read_content(queue))
- buf = StringIO()
- eof = header.eof
- while not eof:
- body = queue.get()
- eof = body.eof
- content = body.content
- buf.write(content)
- return Content(buf.getvalue(), children, header.properties.copy())
-
-class Future:
- def __init__(self):
- self.completed = threading.Event()
-
- def put_response(self, channel, response):
- self.response = response
- self.completed.set()
-
- def get_response(self, timeout=None):
- self.completed.wait(timeout)
- if self.completed.isSet():
- return self.response
- else:
- return None
-
- def is_complete(self):
- return self.completed.isSet()
-
-class OutgoingCompletion:
- """
- Manages completion of outgoing commands i.e. command sent by this peer
- """
-
- def __init__(self):
- self.condition = threading.Condition()
-
- #todo, implement proper wraparound
- self.sequence = Sequence(0) #issues ids for outgoing commands
- self.command_id = -1 #last issued id
- self.mark = -1 #commands up to this mark are known to be complete
- self._closed = False
-
- def next_command(self, method):
- #the following test is a hack until the track/sub-channel is available
- if method.is_l4_command():
- self.command_id = self.sequence.next()
-
- def reset(self):
- self.sequence = Sequence(0) #reset counter
-
- def close(self):
- self.reset()
- self.condition.acquire()
- try:
- self._closed = True
- self.condition.notifyAll()
- finally:
- self.condition.release()
-
- def complete(self, mark):
- self.condition.acquire()
- try:
- self.mark = mark
- #print "set mark to %s [%s] " % (self.mark, self)
- self.condition.notifyAll()
- finally:
- self.condition.release()
-
- def wait(self, point_of_interest=-1, timeout=None):
- if point_of_interest == -1: point_of_interest = self.command_id
- start_time = time()
- remaining = timeout
- self.condition.acquire()
- try:
- while not self._closed and point_of_interest > self.mark:
- #print "waiting for %s, mark = %s [%s]" % (point_of_interest, self.mark, self)
- self.condition.wait(remaining)
- if not self._closed and point_of_interest > self.mark and timeout:
- if (start_time + timeout) < time(): break
- else: remaining = timeout - (time() - start_time)
- finally:
- self.condition.release()
- return point_of_interest <= self.mark
-
-class IncomingCompletion:
- """
- Manages completion of incoming commands i.e. command received by this peer
- """
-
- def __init__(self, channel):
- self.sequence = Sequence(0) #issues ids for incoming commands
- self.mark = -1 #id of last command of whose completion notification was sent to the other peer
- self.channel = channel
-
- def reset(self):
- self.sequence = Sequence(0) #reset counter
-
- def complete(self, mark, cumulative=True):
- if cumulative:
- if mark > self.mark:
- self.mark = mark
- self.channel.execution_complete(cumulative_execution_mark=self.mark)
- else:
- #TODO: record and manage the ranges properly
- range = [mark, mark]
- if (self.mark == -1):#hack until wraparound is implemented
- self.channel.execution_complete(cumulative_execution_mark=0xFFFFFFFF, ranged_execution_set=range)
- else:
- self.channel.execution_complete(cumulative_execution_mark=self.mark, ranged_execution_set=range)
diff --git a/M4-RCs/qpid/python/qpid/queue.py b/M4-RCs/qpid/python/qpid/queue.py
deleted file mode 100644
index c9f4d1d1d0..0000000000
--- a/M4-RCs/qpid/python/qpid/queue.py
+++ /dev/null
@@ -1,86 +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 augments the standard python multithreaded Queue
-implementation to add a close() method so that threads blocking on the
-content of a queue can be notified if the queue is no longer in use.
-"""
-
-from Queue import Queue as BaseQueue, Empty, Full
-from threading import Thread
-from exceptions import Closed
-
-class Queue(BaseQueue):
-
- END = object()
- STOP = object()
-
- def __init__(self, *args, **kwargs):
- BaseQueue.__init__(self, *args, **kwargs)
- self.error = None
- self.listener = None
- self.exc_listener = None
- self.thread = None
-
- def close(self, error = None):
- self.error = error
- self.put(Queue.END)
- if self.thread is not None:
- self.thread.join()
- self.thread = None
-
- def get(self, block = True, timeout = None):
- result = BaseQueue.get(self, block, timeout)
- if result == Queue.END:
- # this guarantees that any other waiting threads or any future
- # calls to get will also result in a Closed exception
- self.put(Queue.END)
- raise Closed(self.error)
- else:
- return result
-
- def listen(self, listener, exc_listener = None):
- if listener is None and exc_listener is not None:
- raise ValueError("cannot set exception listener without setting listener")
-
- if listener is None:
- if self.thread is not None:
- self.put(Queue.STOP)
- self.thread.join()
- self.thread = None
-
- self.listener = listener
- self.exc_listener = exc_listener
-
- if listener is not None and self.thread is None:
- self.thread = Thread(target = self.run)
- self.thread.setDaemon(True)
- self.thread.start()
-
- def run(self):
- while True:
- try:
- o = self.get()
- if o == Queue.STOP: break
- self.listener(o)
- except Closed, e:
- if self.exc_listener is not None:
- self.exc_listener(e)
- break
diff --git a/M4-RCs/qpid/python/qpid/reference.py b/M4-RCs/qpid/python/qpid/reference.py
deleted file mode 100644
index 48ecb67656..0000000000
--- a/M4-RCs/qpid/python/qpid/reference.py
+++ /dev/null
@@ -1,117 +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.
-#
-
-"""
-Support for amqp 'reference' content (as opposed to inline content)
-"""
-
-import threading
-from queue import Queue, Closed
-
-class NotOpened(Exception): pass
-
-class AlreadyOpened(Exception): pass
-
-"""
-A representation of a reference id; can be passed wherever amqp
-content is required in place of inline data
-"""
-class ReferenceId:
-
- def __init__(self, id):
- self.id = id
-
-"""
-Holds content received through 'reference api'. Instances of this
-class will be placed in the consumers queue on receiving a transfer
-(assuming the reference has been opened). Data can be retrieved in
-chunks (as append calls are received) or in full (after reference has
-been closed signalling data s complete).
-"""
-
-class Reference:
-
- def __init__(self, id):
- self.id = id
- self.chunks = Queue(0)
-
- def close(self):
- self.chunks.close()
-
- def append(self, bytes):
- self.chunks.put(bytes)
-
- def get_chunk(self):
- return self.chunks.get()
-
- def get_complete(self):
- data = ""
- for chunk in self:
- data += chunk
- return data
-
- def next(self):
- try:
- return self.get_chunk()
- except Closed, e:
- raise StopIteration
-
- def __iter__(self):
- return self
-
-"""
-Manages a set of opened references. New references can be opened and
-existing references can be retrieved or closed.
-"""
-class References:
-
- def __init__(self):
- self.map = {}
- self.lock = threading.Lock()
-
- def get(self, id):
- self.lock.acquire()
- try:
- try:
- ref = self.map[id]
- except KeyError:
- raise NotOpened()
- finally:
- self.lock.release()
- return ref
-
- def open(self, id):
- self.lock.acquire()
- try:
- if id in self.map: raise AlreadyOpened()
- self.map[id] = Reference(id)
- finally:
- self.lock.release()
-
-
- def close(self, id):
- self.get(id).close()
- self.lock.acquire()
- try:
- self.map.pop(id)
- finally:
- self.lock.release()
-
diff --git a/M4-RCs/qpid/python/qpid/session.py b/M4-RCs/qpid/python/qpid/session.py
deleted file mode 100644
index 4a7ecbc28a..0000000000
--- a/M4-RCs/qpid/python/qpid/session.py
+++ /dev/null
@@ -1,379 +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 threading import Condition, RLock, Lock, currentThread
-from invoker import Invoker
-from datatypes import RangedSet, Struct, Future
-from codec010 import StringCodec
-from assembler import Segment
-from queue import Queue
-from datatypes import Message, serial
-from util import wait, notify
-from exceptions import *
-from logging import getLogger
-
-log = getLogger("qpid.io.cmd")
-msg = getLogger("qpid.io.msg")
-
-class SessionException(Exception): pass
-class SessionClosed(SessionException): pass
-class SessionDetached(SessionException): pass
-
-def client(*args):
- return Client(*args)
-
-def server(*args):
- return Server(*args)
-
-INCOMPLETE = object()
-
-class Session(Invoker):
-
- def __init__(self, name, spec, auto_sync=True, timeout=10, delegate=client):
- self.name = name
- self.spec = spec
- self.auto_sync = auto_sync
- self.timeout = timeout
- self.channel = None
- self.invoke_lock = Lock()
- self._closing = False
- self._closed = False
-
- self.condition = Condition()
-
- self.send_id = True
- self.receiver = Receiver(self)
- self.sender = Sender(self)
-
- self.lock = RLock()
- self._incoming = {}
- self.results = {}
- self.exceptions = []
-
- self.assembly = None
-
- self.delegate = delegate(self)
-
- def incoming(self, destination):
- self.lock.acquire()
- try:
- queue = self._incoming.get(destination)
- if queue == None:
- queue = Incoming(self, destination)
- self._incoming[destination] = queue
- return queue
- finally:
- self.lock.release()
-
- def error(self):
- exc = self.exceptions[:]
- if len(exc) == 0:
- return None
- elif len(exc) == 1:
- return exc[0]
- else:
- return tuple(exc)
-
- def sync(self, timeout=None):
- ch = self.channel
- if ch is not None and currentThread() == ch.connection.thread:
- raise SessionException("deadlock detected")
- if not self.auto_sync:
- self.execution_sync(sync=True)
- last = self.sender.next_id - 1
- if not wait(self.condition, lambda:
- last in self.sender._completed or self.exceptions,
- timeout):
- raise Timeout()
- if self.exceptions:
- raise SessionException(self.error())
-
- def close(self, timeout=None):
- self.invoke_lock.acquire()
- try:
- self._closing = True
- self.channel.session_detach(self.name)
- finally:
- self.invoke_lock.release()
- if not wait(self.condition, lambda: self._closed, timeout):
- raise Timeout()
-
- def closed(self):
- self.lock.acquire()
- try:
- if self._closed: return
-
- error = self.error()
- for id in self.results:
- f = self.results[id]
- f.error(error)
- self.results.clear()
-
- for q in self._incoming.values():
- q.close(error)
-
- self._closed = True
- notify(self.condition)
- finally:
- self.lock.release()
-
- def resolve_method(self, name):
- cmd = self.spec.instructions.get(name)
- if cmd is not None and cmd.track == self.spec["track.command"].value:
- return self.METHOD, cmd
- else:
- # XXX
- for st in self.spec.structs.values():
- if st.name == name:
- return self.METHOD, st
- if self.spec.structs_by_name.has_key(name):
- return self.METHOD, self.spec.structs_by_name[name]
- if self.spec.enums.has_key(name):
- return self.VALUE, self.spec.enums[name]
- return self.ERROR, None
-
- def invoke(self, type, args, kwargs):
- # XXX
- if not hasattr(type, "track"):
- return type.new(args, kwargs)
-
- self.invoke_lock.acquire()
- try:
- return self.do_invoke(type, args, kwargs)
- finally:
- self.invoke_lock.release()
-
- def do_invoke(self, type, args, kwargs):
- if self._closing:
- raise SessionClosed()
-
- if self.channel == None:
- raise SessionDetached()
-
- if type.segments:
- if len(args) == len(type.fields) + 1:
- message = args[-1]
- args = args[:-1]
- else:
- message = kwargs.pop("message", None)
- else:
- message = None
-
- hdr = Struct(self.spec["session.header"])
- hdr.sync = self.auto_sync or kwargs.pop("sync", False)
-
- cmd = type.new(args, kwargs)
- sc = StringCodec(self.spec)
- sc.write_command(hdr, cmd)
-
- seg = Segment(True, (message == None or
- (message.headers == None and message.body == None)),
- type.segment_type, type.track, self.channel.id, sc.encoded)
-
- if type.result:
- result = Future(exception=SessionException)
- self.results[self.sender.next_id] = result
-
- self.send(seg)
-
- log.debug("SENT %s %s %s", seg.id, hdr, cmd)
-
- if message != None:
- if message.headers != None:
- sc = StringCodec(self.spec)
- for st in message.headers:
- sc.write_struct32(st)
- seg = Segment(False, message.body == None, self.spec["segment_type.header"].value,
- type.track, self.channel.id, sc.encoded)
- self.send(seg)
- if message.body != None:
- seg = Segment(False, True, self.spec["segment_type.body"].value,
- type.track, self.channel.id, message.body)
- self.send(seg)
- msg.debug("SENT %s", message)
-
- if type.result:
- if self.auto_sync:
- return result.get(self.timeout)
- else:
- return result
- elif self.auto_sync:
- self.sync(self.timeout)
-
- def received(self, seg):
- self.receiver.received(seg)
- if seg.first:
- assert self.assembly == None
- self.assembly = []
- self.assembly.append(seg)
- if seg.last:
- self.dispatch(self.assembly)
- self.assembly = None
-
- def dispatch(self, assembly):
- segments = assembly[:]
-
- hdr, cmd = assembly.pop(0).decode(self.spec)
- log.debug("RECV %s %s %s", cmd.id, hdr, cmd)
-
- args = []
-
- for st in cmd._type.segments:
- if assembly:
- seg = assembly[0]
- if seg.type == st.segment_type:
- args.append(seg.decode(self.spec))
- assembly.pop(0)
- continue
- args.append(None)
-
- assert len(assembly) == 0
-
- attr = cmd._type.qname.replace(".", "_")
- result = getattr(self.delegate, attr)(cmd, *args)
-
- if cmd._type.result:
- self.execution_result(cmd.id, result)
-
- if result is not INCOMPLETE:
- for seg in segments:
- self.receiver.completed(seg)
- # XXX: don't forget to obey sync for manual completion as well
- if hdr.sync:
- self.channel.session_completed(self.receiver._completed)
-
- def send(self, seg):
- self.sender.send(seg)
-
- def __str__(self):
- return '<Session: %s, %s>' % (self.name, self.channel)
-
- def __repr__(self):
- return str(self)
-
-class Receiver:
-
- def __init__(self, session):
- self.session = session
- self.next_id = None
- self.next_offset = None
- self._completed = RangedSet()
-
- def received(self, seg):
- if self.next_id == None or self.next_offset == None:
- raise Exception("todo")
- seg.id = self.next_id
- seg.offset = self.next_offset
- if seg.last:
- self.next_id += 1
- self.next_offset = 0
- else:
- self.next_offset += len(seg.payload)
-
- def completed(self, seg):
- if seg.id == None:
- raise ValueError("cannot complete unidentified segment")
- if seg.last:
- self._completed.add(seg.id)
-
- def known_completed(self, commands):
- completed = RangedSet()
- for c in self._completed.ranges:
- for kc in commands.ranges:
- if c.lower in kc and c.upper in kc:
- break
- else:
- completed.add_range(c)
- self._completed = completed
-
-class Sender:
-
- def __init__(self, session):
- self.session = session
- self.next_id = serial(0)
- self.next_offset = 0
- self.segments = []
- self._completed = RangedSet()
-
- def send(self, seg):
- seg.id = self.next_id
- seg.offset = self.next_offset
- if seg.last:
- self.next_id += 1
- self.next_offset = 0
- else:
- self.next_offset += len(seg.payload)
- self.segments.append(seg)
- if self.session.send_id:
- self.session.send_id = False
- self.session.channel.session_command_point(seg.id, seg.offset)
- self.session.channel.connection.write_segment(seg)
-
- def completed(self, commands):
- idx = 0
- while idx < len(self.segments):
- seg = self.segments[idx]
- if seg.id in commands:
- del self.segments[idx]
- else:
- idx += 1
- for range in commands.ranges:
- self._completed.add(range.lower, range.upper)
-
-class Incoming(Queue):
-
- def __init__(self, session, destination):
- Queue.__init__(self)
- self.session = session
- self.destination = destination
-
- def start(self):
- self.session.message_set_flow_mode(self.destination, self.session.flow_mode.credit)
- for unit in self.session.credit_unit.values():
- self.session.message_flow(self.destination, unit, 0xFFFFFFFFL)
-
- def stop(self):
- self.session.message_cancel(self.destination)
- self.listen(None)
-
-class Delegate:
-
- def __init__(self, session):
- self.session = session
-
- #XXX: do something with incoming accepts
- def message_accept(self, ma): None
-
- def execution_result(self, er):
- future = self.session.results.pop(er.command_id)
- future.set(er.value)
-
- def execution_exception(self, ex):
- self.session.exceptions.append(ex)
-
-class Client(Delegate):
-
- def message_transfer(self, cmd, headers, body):
- m = Message(body)
- m.headers = headers
- m.id = cmd.id
- messages = self.session.incoming(cmd.destination)
- messages.put(m)
- msg.debug("RECV %s", m)
- return INCOMPLETE
diff --git a/M4-RCs/qpid/python/qpid/spec.py b/M4-RCs/qpid/python/qpid/spec.py
deleted file mode 100644
index e6d914044c..0000000000
--- a/M4-RCs/qpid/python/qpid/spec.py
+++ /dev/null
@@ -1,59 +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 loads protocol metadata into python objects. It provides
-access to spec metadata via a python object model, and can also
-dynamically creating python methods, classes, and modules based on the
-spec metadata. All the generated methods have proper signatures and
-doc strings based on the spec metadata so the python help system can
-be used to browse the spec documentation. The generated methods all
-dispatch to the self.invoke(meth, args) callback of the containing
-class so that the generated code can be reused in a variety of
-situations.
-"""
-
-import os, mllib, spec08, spec010
-
-def default():
- try:
- amqp_spec = os.environ["AMQP_SPEC"]
- return amqp_spec
- except KeyError:
- try:
- from qpid_config import amqp_spec
- return amqp_spec
- except ImportError:
- raise Exception("unable to locate the amqp specification, please set "
- "the AMQP_SPEC environment variable or supply "
- "qpid_config.py on the PYTHONPATH")
-
-def load(specfile, *errata):
- for name in (specfile,) + errata:
- if not os.path.exists(name):
- raise IOError("No such file or directory: '%s'" % name)
-
- doc = mllib.xml_parse(specfile)
- major = doc["amqp/@major"]
- minor = doc["amqp/@minor"]
-
- if major == "0" and minor == "10":
- return spec010.load(specfile, *errata)
- else:
- return spec08.load(specfile, *errata)
diff --git a/M4-RCs/qpid/python/qpid/spec010.py b/M4-RCs/qpid/python/qpid/spec010.py
deleted file mode 100644
index cbc85a5e8b..0000000000
--- a/M4-RCs/qpid/python/qpid/spec010.py
+++ /dev/null
@@ -1,693 +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.
-#
-
-import os, cPickle, datatypes, datetime
-from codec010 import StringCodec
-from util import mtime, fill
-
-class Node:
-
- def __init__(self, children):
- self.children = children
- self.named = {}
- self.docs = []
- self.rules = []
-
- def register(self):
- for ch in self.children:
- ch.register(self)
-
- def resolve(self):
- for ch in self.children:
- ch.resolve()
-
- def __getitem__(self, name):
- path = name.split(".", 1)
- nd = self.named
- for step in path:
- nd = nd[step]
- return nd
-
- def __iter__(self):
- return iter(self.children)
-
-class Anonymous:
-
- def __init__(self, children):
- self.children = children
-
- def register(self, node):
- for ch in self.children:
- ch.register(node)
-
- def resolve(self):
- for ch in self.children:
- ch.resolve()
-
-class Named:
-
- def __init__(self, name):
- self.name = name
- self.qname = None
-
- def register(self, node):
- self.spec = node.spec
- self.klass = node.klass
- node.named[self.name] = self
- if node.qname:
- self.qname = "%s.%s" % (node.qname, self.name)
- else:
- self.qname = self.name
-
- def __str__(self):
- return self.qname
-
- def __repr__(self):
- return str(self)
-
-class Lookup:
-
- def lookup(self, name):
- value = None
- if self.klass:
- try:
- value = self.klass[name]
- except KeyError:
- pass
- if not value:
- value = self.spec[name]
- return value
-
-class Coded:
-
- def __init__(self, code):
- self.code = code
-
-class Constant(Named, Node):
-
- def __init__(self, name, value, children):
- Named.__init__(self, name)
- Node.__init__(self, children)
- self.value = value
-
- def register(self, node):
- Named.register(self, node)
- node.constants.append(self)
- Node.register(self)
-
-class Type(Named, Node):
-
- def __init__(self, name, children):
- Named.__init__(self, name)
- Node.__init__(self, children)
-
- def is_present(self, value):
- return value != None
-
- def register(self, node):
- Named.register(self, node)
- Node.register(self)
-
-class Primitive(Coded, Type):
-
- def __init__(self, name, code, fixed, variable, children):
- Coded.__init__(self, code)
- Type.__init__(self, name, children)
- self.fixed = fixed
- self.variable = variable
-
- def register(self, node):
- Type.register(self, node)
- if self.code is not None:
- self.spec.types[self.code] = self
-
- def is_present(self, value):
- if self.fixed == 0:
- return value
- else:
- return Type.is_present(self, value)
-
- def encode(self, codec, value):
- getattr(codec, "write_%s" % self.name)(value)
-
- def decode(self, codec):
- return getattr(codec, "read_%s" % self.name)()
-
-class Domain(Type, Lookup):
-
- def __init__(self, name, type, children):
- Type.__init__(self, name, children)
- self.type = type
- self.choices = {}
-
- def resolve(self):
- self.type = self.lookup(self.type)
- Node.resolve(self)
-
- def encode(self, codec, value):
- self.type.encode(codec, value)
-
- def decode(self, codec):
- return self.type.decode(codec)
-
-class Enum:
-
- def __init__(self, name):
- self.name = name
- self._names = ()
- self._values = ()
-
- def values(self):
- return self._values
-
- def __repr__(self):
- return "%s(%s)" % (self.name, ", ".join(self._names))
-
-class Choice(Named, Node):
-
- def __init__(self, name, value, children):
- Named.__init__(self, name)
- Node.__init__(self, children)
- self.value = value
-
- def register(self, node):
- Named.register(self, node)
- node.choices[self.value] = self
- Node.register(self)
- try:
- enum = node.spec.enums[node.name]
- except KeyError:
- enum = Enum(node.name)
- node.spec.enums[node.name] = enum
- setattr(enum, self.name, self.value)
- enum._names += (self.name,)
- enum._values += (self.value,)
-
-class Composite(Type, Coded):
-
- def __init__(self, name, label, code, size, pack, children):
- Coded.__init__(self, code)
- Type.__init__(self, name, children)
- self.label = label
- self.fields = []
- self.size = size
- self.pack = pack
-
- def new(self, args, kwargs):
- return datatypes.Struct(self, *args, **kwargs)
-
- def decode(self, codec):
- codec.read_size(self.size)
- if self.code is not None:
- code = codec.read_uint16()
- assert self.code == code
- return datatypes.Struct(self, **self.decode_fields(codec))
-
- def decode_fields(self, codec):
- flags = 0
- for i in range(self.pack):
- flags |= (codec.read_uint8() << 8*i)
-
- result = {}
-
- for i in range(len(self.fields)):
- f = self.fields[i]
- if flags & (0x1 << i):
- result[f.name] = f.type.decode(codec)
- else:
- result[f.name] = None
- return result
-
- def encode(self, codec, value):
- sc = StringCodec(self.spec)
- if self.code is not None:
- sc.write_uint16(self.code)
- self.encode_fields(sc, value)
- codec.write_size(self.size, len(sc.encoded))
- codec.write(sc.encoded)
-
- def encode_fields(self, codec, values):
- flags = 0
- for i in range(len(self.fields)):
- f = self.fields[i]
- if f.type.is_present(values[f.name]):
- flags |= (0x1 << i)
- for i in range(self.pack):
- codec.write_uint8((flags >> 8*i) & 0xFF)
- for i in range(len(self.fields)):
- f = self.fields[i]
- if flags & (0x1 << i):
- f.type.encode(codec, values[f.name])
-
- def docstring(self):
- docs = []
- if self.label:
- docs.append(self.label)
- docs += [d.text for d in self.docs]
- s = "\n\n".join([fill(t, 2) for t in docs])
- for f in self.fields:
- fdocs = []
- if f.label:
- fdocs.append(f.label)
- else:
- fdocs.append("")
- fdocs += [d.text for d in f.docs]
- s += "\n\n" + "\n\n".join([fill(fdocs[0], 4, f.name)] +
- [fill(t, 4) for t in fdocs[1:]])
- return s
-
-
-class Field(Named, Node, Lookup):
-
- def __init__(self, name, label, type, children):
- Named.__init__(self, name)
- Node.__init__(self, children)
- self.label = label
- self.type = type
- self.exceptions = []
-
- def default(self):
- return None
-
- def register(self, node):
- Named.register(self, node)
- node.fields.append(self)
- Node.register(self)
-
- def resolve(self):
- self.type = self.lookup(self.type)
- Node.resolve(self)
-
- def __str__(self):
- return "%s: %s" % (self.qname, self.type.qname)
-
-class Struct(Composite):
-
- def register(self, node):
- Composite.register(self, node)
- if self.code is not None:
- self.spec.structs[self.code] = self
- self.spec.structs_by_name[self.name] = self
- self.pyname = self.name
- self.pydoc = self.docstring()
-
- def __str__(self):
- fields = ",\n ".join(["%s: %s" % (f.name, f.type.qname)
- for f in self.fields])
- return "%s {\n %s\n}" % (self.qname, fields)
-
-class Segment:
-
- def __init__(self):
- self.segment_type = None
-
- def register(self, node):
- self.spec = node.spec
- self.klass = node.klass
- node.segments.append(self)
- Node.register(self)
-
-class Instruction(Composite, Segment):
-
- def __init__(self, name, label, code, children):
- Composite.__init__(self, name, label, code, 0, 2, children)
- Segment.__init__(self)
- self.track = None
- self.handlers = []
-
- def __str__(self):
- return "%s(%s)" % (self.qname, ", ".join(["%s: %s" % (f.name, f.type.qname)
- for f in self.fields]))
-
- def register(self, node):
- Composite.register(self, node)
- self.pyname = self.qname.replace(".", "_")
- self.pydoc = self.docstring()
- self.spec.instructions[self.pyname] = self
-
-class Control(Instruction):
-
- def __init__(self, name, code, label, children):
- Instruction.__init__(self, name, code, label, children)
- self.response = None
-
- def register(self, node):
- Instruction.register(self, node)
- node.controls.append(self)
- self.spec.controls[self.code] = self
- self.segment_type = self.spec["segment_type.control"].value
- self.track = self.spec["track.control"].value
-
-class Command(Instruction):
-
- def __init__(self, name, label, code, children):
- Instruction.__init__(self, name, label, code, children)
- self.result = None
- self.exceptions = []
- self.segments = []
-
- def register(self, node):
- Instruction.register(self, node)
- node.commands.append(self)
- self.spec.commands[self.code] = self
- self.segment_type = self.spec["segment_type.command"].value
- self.track = self.spec["track.command"].value
-
-class Header(Segment, Node):
-
- def __init__(self, children):
- Segment.__init__(self)
- Node.__init__(self, children)
- self.entries = []
-
- def register(self, node):
- Segment.register(self, node)
- self.segment_type = self.spec["segment_type.header"].value
- Node.register(self)
-
-class Entry(Lookup):
-
- def __init__(self, type):
- self.type = type
-
- def register(self, node):
- self.spec = node.spec
- self.klass = node.klass
- node.entries.append(self)
-
- def resolve(self):
- self.type = self.lookup(self.type)
-
-class Body(Segment, Node):
-
- def __init__(self, children):
- Segment.__init__(self)
- Node.__init__(self, children)
-
- def register(self, node):
- Segment.register(self, node)
- self.segment_type = self.spec["segment_type.body"].value
- Node.register(self)
-
- def resolve(self): pass
-
-class Class(Named, Coded, Node):
-
- def __init__(self, name, code, children):
- Named.__init__(self, name)
- Coded.__init__(self, code)
- Node.__init__(self, children)
- self.controls = []
- self.commands = []
-
- def register(self, node):
- Named.register(self, node)
- self.klass = self
- node.classes.append(self)
- Node.register(self)
-
-class Doc:
-
- def __init__(self, type, title, text):
- self.type = type
- self.title = title
- self.text = text
-
- def register(self, node):
- node.docs.append(self)
-
- def resolve(self): pass
-
-class Role(Named, Node):
-
- def __init__(self, name, children):
- Named.__init__(self, name)
- Node.__init__(self, children)
-
- def register(self, node):
- Named.register(self, node)
- Node.register(self)
-
-class Rule(Named, Node):
-
- def __init__(self, name, children):
- Named.__init__(self, name)
- Node.__init__(self, children)
-
- def register(self, node):
- Named.register(self, node)
- node.rules.append(self)
- Node.register(self)
-
-class Exception(Named, Node):
-
- def __init__(self, name, error_code, children):
- Named.__init__(self, name)
- Node.__init__(self, children)
- self.error_code = error_code
-
- def register(self, node):
- Named.register(self, node)
- node.exceptions.append(self)
- Node.register(self)
-
-class Spec(Node):
-
- ENCODINGS = {
- basestring: "vbin16",
- int: "int64",
- long: "int64",
- float: "float",
- None.__class__: "void",
- list: "list",
- tuple: "list",
- dict: "map",
- datatypes.timestamp: "datetime",
- datetime.datetime: "datetime"
- }
-
- def __init__(self, major, minor, port, children):
- Node.__init__(self, children)
- self.major = major
- self.minor = minor
- self.port = port
- self.constants = []
- self.classes = []
- self.types = {}
- self.qname = None
- self.spec = self
- self.klass = None
- self.instructions = {}
- self.controls = {}
- self.commands = {}
- self.structs = {}
- self.structs_by_name = {}
- self.enums = {}
-
- def encoding(self, klass):
- if Spec.ENCODINGS.has_key(klass):
- return self.named[Spec.ENCODINGS[klass]]
- for base in klass.__bases__:
- result = self.encoding(base)
- if result != None:
- return result
-
-class Implement:
-
- def __init__(self, handle):
- self.handle = handle
-
- def register(self, node):
- node.handlers.append(self.handle)
-
- def resolve(self): pass
-
-class Response(Node):
-
- def __init__(self, name, children):
- Node.__init__(self, children)
- self.name = name
-
- def register(self, node):
- Node.register(self)
-
-class Result(Node, Lookup):
-
- def __init__(self, type, children):
- self.type = type
- Node.__init__(self, children)
-
- def register(self, node):
- node.result = self
- self.qname = node.qname
- self.klass = node.klass
- self.spec = node.spec
- Node.register(self)
-
- def resolve(self):
- self.type = self.lookup(self.type)
- Node.resolve(self)
-
-import mllib
-
-def num(s):
- if s: return int(s, 0)
-
-REPLACE = {" ": "_", "-": "_"}
-KEYWORDS = {"global": "global_",
- "return": "return_"}
-
-def id(name):
- name = str(name)
- for key, val in REPLACE.items():
- name = name.replace(key, val)
- try:
- name = KEYWORDS[name]
- except KeyError:
- pass
- return name
-
-class Loader:
-
- def __init__(self):
- self.class_code = 0
-
- def code(self, nd):
- c = num(nd["@code"])
- if c is None:
- return None
- else:
- return c | (self.class_code << 8)
-
- def list(self, q):
- result = []
- for nd in q:
- result.append(nd.dispatch(self))
- return result
-
- def children(self, n):
- return self.list(n.query["#tag"])
-
- def data(self, d):
- return d.data
-
- def do_amqp(self, a):
- return Spec(num(a["@major"]), num(a["@minor"]), num(a["@port"]),
- self.children(a))
-
- def do_type(self, t):
- return Primitive(id(t["@name"]), self.code(t), num(t["@fixed-width"]),
- num(t["@variable-width"]), self.children(t))
-
- def do_constant(self, c):
- return Constant(id(c["@name"]), num(c["@value"]), self.children(c))
-
- def do_domain(self, d):
- return Domain(id(d["@name"]), id(d["@type"]), self.children(d))
-
- def do_enum(self, e):
- return Anonymous(self.children(e))
-
- def do_choice(self, c):
- return Choice(id(c["@name"]), num(c["@value"]), self.children(c))
-
- def do_class(self, c):
- code = num(c["@code"])
- self.class_code = code
- children = self.children(c)
- children += self.list(c.query["command/result/struct"])
- self.class_code = 0
- return Class(id(c["@name"]), code, children)
-
- def do_doc(self, doc):
- text = reduce(lambda x, y: x + y, self.list(doc.children))
- return Doc(doc["@type"], doc["@title"], text)
-
- def do_xref(self, x):
- return x["@ref"]
-
- def do_role(self, r):
- return Role(id(r["@name"]), self.children(r))
-
- def do_control(self, c):
- return Control(id(c["@name"]), c["@label"], self.code(c), self.children(c))
-
- def do_rule(self, r):
- return Rule(id(r["@name"]), self.children(r))
-
- def do_implement(self, i):
- return Implement(id(i["@handle"]))
-
- def do_response(self, r):
- return Response(id(r["@name"]), self.children(r))
-
- def do_field(self, f):
- return Field(id(f["@name"]), f["@label"], id(f["@type"]), self.children(f))
-
- def do_struct(self, s):
- return Struct(id(s["@name"]), s["@label"], self.code(s), num(s["@size"]),
- num(s["@pack"]), self.children(s))
-
- def do_command(self, c):
- return Command(id(c["@name"]), c["@label"], self.code(c), self.children(c))
-
- def do_segments(self, s):
- return Anonymous(self.children(s))
-
- def do_header(self, h):
- return Header(self.children(h))
-
- def do_entry(self, e):
- return Entry(id(e["@type"]))
-
- def do_body(self, b):
- return Body(self.children(b))
-
- def do_result(self, r):
- type = r["@type"]
- if not type:
- type = r["struct/@name"]
- return Result(id(type), self.list(r.query["#tag", lambda x: x.name != "struct"]))
-
- def do_exception(self, e):
- return Exception(id(e["@name"]), id(e["@error-code"]), self.children(e))
-
-def load(xml):
- fname = xml + ".pcl"
-
- if os.path.exists(fname) and mtime(fname) > mtime(__file__):
- file = open(fname, "r")
- s = cPickle.load(file)
- file.close()
- else:
- doc = mllib.xml_parse(xml)
- s = doc["amqp"].dispatch(Loader())
- s.register()
- s.resolve()
-
- try:
- file = open(fname, "w")
- except IOError:
- file = None
-
- if file:
- cPickle.dump(s, file)
- file.close()
-
- return s
diff --git a/M4-RCs/qpid/python/qpid/spec08.py b/M4-RCs/qpid/python/qpid/spec08.py
deleted file mode 100644
index a0047e7107..0000000000
--- a/M4-RCs/qpid/python/qpid/spec08.py
+++ /dev/null
@@ -1,504 +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 loads protocol metadata into python objects. It provides
-access to spec metadata via a python object model, and can also
-dynamically creating python methods, classes, and modules based on the
-spec metadata. All the generated methods have proper signatures and
-doc strings based on the spec metadata so the python help system can
-be used to browse the spec documentation. The generated methods all
-dispatch to the self.invoke(meth, args) callback of the containing
-class so that the generated code can be reused in a variety of
-situations.
-"""
-
-import re, new, mllib, qpid
-from util import fill
-
-class SpecContainer:
-
- def __init__(self):
- self.items = []
- self.byname = {}
- self.byid = {}
- self.indexes = {}
-
- def add(self, item):
- if self.byname.has_key(item.name):
- raise ValueError("duplicate name: %s" % item)
- if item.id == None:
- item.id = len(self)
- elif self.byid.has_key(item.id):
- raise ValueError("duplicate id: %s" % item)
- self.indexes[item] = len(self.items)
- self.items.append(item)
- self.byname[item.name] = item
- self.byid[item.id] = item
-
- def index(self, item):
- try:
- return self.indexes[item]
- except KeyError:
- raise ValueError(item)
-
- def __iter__(self):
- return iter(self.items)
-
- def __len__(self):
- return len(self.items)
-
-class Metadata:
-
- PRINT = []
-
- def __init__(self):
- pass
-
- def __str__(self):
- args = map(lambda f: "%s=%s" % (f, getattr(self, f)), self.PRINT)
- return "%s(%s)" % (self.__class__.__name__, ", ".join(args))
-
- def __repr__(self):
- return str(self)
-
-class Spec(Metadata):
-
- PRINT=["major", "minor", "file"]
-
- def __init__(self, major, minor, file):
- Metadata.__init__(self)
- self.major = major
- self.minor = minor
- self.file = file
- self.constants = SpecContainer()
- self.domains = SpecContainer()
- self.classes = SpecContainer()
- # methods indexed by classname_methname
- self.methods = {}
- # structs by type code
- self.structs = {}
-
- def post_load(self):
- self.module = self.define_module("amqp%s%s" % (self.major, self.minor))
- self.klass = self.define_class("Amqp%s%s" % (self.major, self.minor))
-
- def method(self, name):
- if not self.methods.has_key(name):
- for cls in self.classes:
- clen = len(cls.name)
- if name.startswith(cls.name) and name[clen] == "_":
- end = name[clen + 1:]
- if cls.methods.byname.has_key(end):
- self.methods[name] = cls.methods.byname[end]
- return self.methods.get(name)
-
- def parse_method(self, name):
- parts = re.split(r"\s*\.\s*", name)
- if len(parts) != 2:
- raise ValueError(name)
- klass, meth = parts
- return self.classes.byname[klass].methods.byname[meth]
-
- def struct(self, name, *args, **kwargs):
- type = self.domains.byname[name].type
- return qpid.Struct(type, *args, **kwargs)
-
- def define_module(self, name, doc = None):
- module = new.module(name, doc)
- module.__file__ = self.file
- for c in self.classes:
- cls = c.define_class(c.name)
- cls.__module__ = module.__name__
- setattr(module, c.name, cls)
- return module
-
- def define_class(self, name):
- methods = {}
- for c in self.classes:
- for m in c.methods:
- meth = m.klass.name + "_" + m.name
- methods[meth] = m.define_method(meth)
- return type(name, (), methods)
-
-class Constant(Metadata):
-
- PRINT=["name", "id"]
-
- def __init__(self, spec, name, id, klass, docs):
- Metadata.__init__(self)
- self.spec = spec
- self.name = name
- self.id = id
- self.klass = klass
- self.docs = docs
-
-class Domain(Metadata):
-
- PRINT=["name", "type"]
-
- def __init__(self, spec, name, type, description, docs):
- Metadata.__init__(self)
- self.spec = spec
- self.id = None
- self.name = name
- self.type = type
- self.description = description
- self.docs = docs
-
-class Struct(Metadata):
-
- PRINT=["size", "type", "pack"]
-
- def __init__(self, size, type, pack):
- Metadata.__init__(self)
- self.size = size
- self.type = type
- self.pack = pack
- self.fields = SpecContainer()
-
-class Class(Metadata):
-
- PRINT=["name", "id"]
-
- def __init__(self, spec, name, id, handler, docs):
- Metadata.__init__(self)
- self.spec = spec
- self.name = name
- self.id = id
- self.handler = handler
- self.fields = SpecContainer()
- self.methods = SpecContainer()
- self.docs = docs
-
- def define_class(self, name):
- methods = {}
- for m in self.methods:
- methods[m.name] = m.define_method(m.name)
- return type(name, (), methods)
-
-class Method(Metadata):
-
- PRINT=["name", "id"]
-
- def __init__(self, klass, name, id, content, responses, result, synchronous,
- description, docs):
- Metadata.__init__(self)
- self.klass = klass
- self.name = name
- self.id = id
- self.content = content
- self.responses = responses
- self.result = result
- self.synchronous = synchronous
- self.fields = SpecContainer()
- self.description = description
- self.docs = docs
- self.response = False
-
- def is_l4_command(self):
- return self.klass.name not in ["execution", "channel", "connection", "session"]
-
- def arguments(self, *args, **kwargs):
- nargs = len(args) + len(kwargs)
- maxargs = len(self.fields)
- if nargs > maxargs:
- self._type_error("takes at most %s arguments (%s) given", maxargs, nargs)
- result = []
- for f in self.fields:
- idx = self.fields.index(f)
- if idx < len(args):
- result.append(args[idx])
- elif kwargs.has_key(f.name):
- result.append(kwargs.pop(f.name))
- else:
- result.append(Method.DEFAULTS[f.type])
- for key, value in kwargs.items():
- if self.fields.byname.has_key(key):
- self._type_error("got multiple values for keyword argument '%s'", key)
- else:
- self._type_error("got an unexpected keyword argument '%s'", key)
- return tuple(result)
-
- def _type_error(self, msg, *args):
- raise TypeError("%s %s" % (self.name, msg % args))
-
- def docstring(self):
- s = "\n\n".join([fill(d, 2) for d in [self.description] + self.docs])
- for f in self.fields:
- if f.docs:
- s += "\n\n" + "\n\n".join([fill(f.docs[0], 4, f.name)] +
- [fill(d, 4) for d in f.docs[1:]])
- if self.responses:
- s += "\n\nValid responses: "
- for r in self.responses:
- s += r.name + " "
- return s
-
- METHOD = "__method__"
- DEFAULTS = {"bit": False,
- "shortstr": "",
- "longstr": "",
- "table": {},
- "array": [],
- "octet": 0,
- "short": 0,
- "long": 0,
- "longlong": 0,
- "timestamp": 0,
- "content": None,
- "uuid": "",
- "rfc1982_long": 0,
- "rfc1982_long_set": [],
- "long_struct": None}
-
- def define_method(self, name):
- g = {Method.METHOD: self}
- l = {}
- args = [(f.name, Method.DEFAULTS[f.type]) for f in self.fields]
- methargs = args[:]
- if self.content:
- args += [("content", None)]
- code = "def %s(self, %s):\n" % \
- (name, ", ".join(["%s = %r" % a for a in args]))
- code += " %r\n" % self.docstring()
- argnames = ", ".join([a[0] for a in methargs])
- code += " return self.invoke(%s" % Method.METHOD
- if argnames:
- code += ", (%s,)" % argnames
- else:
- code += ", ()"
- if self.content:
- code += ", content"
- code += ")"
- exec code in g, l
- return l[name]
-
-class Field(Metadata):
-
- PRINT=["name", "id", "type"]
-
- def __init__(self, name, id, type, domain, description, docs):
- Metadata.__init__(self)
- self.name = name
- self.id = id
- self.type = type
- self.domain = domain
- self.description = description
- self.docs = docs
-
- def default(self):
- if isinstance(self.type, Struct):
- return None
- else:
- return Method.DEFAULTS[self.type]
-
-WIDTHS = {
- "octet": 1,
- "short": 2,
- "long": 4
- }
-
-def width(st, default=None):
- if st in (None, "none", ""):
- return default
- else:
- return WIDTHS[st]
-
-def get_result(nd, spec):
- result = nd["result"]
- if not result: return None
- name = result["@domain"]
- if name != None: return spec.domains.byname[name]
- st_nd = result["struct"]
- st = Struct(width(st_nd["@size"]), int(result.parent.parent["@index"])*256 +
- int(st_nd["@type"]), width(st_nd["@pack"], 2))
- spec.structs[st.type] = st
- load_fields(st_nd, st.fields, spec.domains.byname)
- return st
-
-def get_desc(nd):
- label = nd["@label"]
- if not label:
- label = nd.text()
- if label:
- label = label.strip()
- return label
-
-def get_docs(nd):
- return [n.text() for n in nd.query["doc"]]
-
-def load_fields(nd, l, domains):
- for f_nd in nd.query["field"]:
- type = f_nd["@domain"]
- if type == None:
- type = f_nd["@type"]
- type = pythonize(type)
- domain = None
- while domains.has_key(type) and domains[type].type != type:
- domain = domains[type]
- type = domain.type
- l.add(Field(pythonize(f_nd["@name"]), f_nd.index(), type, domain,
- get_desc(f_nd), get_docs(f_nd)))
-
-def load(specfile, *errata):
- doc = mllib.xml_parse(specfile)
- spec_root = doc["amqp"]
- spec = Spec(int(spec_root["@major"]), int(spec_root["@minor"]), specfile)
-
- for root in [spec_root] + map(lambda x: mllib.xml_parse(x)["amqp"], errata):
- # constants
- for nd in root.query["constant"]:
- val = nd["@value"]
- if val.startswith("0x"): val = int(val, 16)
- else: val = int(val)
- const = Constant(spec, pythonize(nd["@name"]), val, nd["@class"],
- get_docs(nd))
- try:
- spec.constants.add(const)
- except ValueError, e:
- pass
- #print "Warning:", e
-
- # domains are typedefs
- structs = []
- for nd in root.query["domain"]:
- type = nd["@type"]
- if type == None:
- st_nd = nd["struct"]
- code = st_nd["@type"]
- if code not in (None, "", "none"):
- code = int(code)
- type = Struct(width(st_nd["@size"]), code, width(st_nd["@pack"], 2))
- if type.type != None:
- spec.structs[type.type] = type
- structs.append((type, st_nd))
- else:
- type = pythonize(type)
- domain = Domain(spec, pythonize(nd["@name"]), type, get_desc(nd),
- get_docs(nd))
- spec.domains.add(domain)
-
- # structs
- for st, st_nd in structs:
- load_fields(st_nd, st.fields, spec.domains.byname)
-
- # classes
- for c_nd in root.query["class"]:
- cname = pythonize(c_nd["@name"])
- if spec.classes.byname.has_key(cname):
- klass = spec.classes.byname[cname]
- else:
- klass = Class(spec, cname, int(c_nd["@index"]), c_nd["@handler"],
- get_docs(c_nd))
- spec.classes.add(klass)
-
- added_methods = []
- load_fields(c_nd, klass.fields, spec.domains.byname)
- for m_nd in c_nd.query["method"]:
- mname = pythonize(m_nd["@name"])
- if klass.methods.byname.has_key(mname):
- meth = klass.methods.byname[mname]
- else:
- meth = Method(klass, mname,
- int(m_nd["@index"]),
- m_nd["@content"] == "1",
- [pythonize(nd["@name"]) for nd in m_nd.query["response"]],
- get_result(m_nd, spec),
- m_nd["@synchronous"] == "1",
- get_desc(m_nd),
- get_docs(m_nd))
- klass.methods.add(meth)
- added_methods.append(meth)
- load_fields(m_nd, meth.fields, spec.domains.byname)
- # resolve the responses
- for m in added_methods:
- m.responses = [klass.methods.byname[r] for r in m.responses]
- for resp in m.responses:
- resp.response = True
-
- spec.post_load()
- return spec
-
-REPLACE = {" ": "_", "-": "_"}
-KEYWORDS = {"global": "global_",
- "return": "return_"}
-
-def pythonize(name):
- name = str(name)
- for key, val in REPLACE.items():
- name = name.replace(key, val)
- try:
- name = KEYWORDS[name]
- except KeyError:
- pass
- return name
-
-class Rule(Metadata):
-
- PRINT = ["text", "implement", "tests"]
-
- def __init__(self, text, implement, tests, path):
- self.text = text
- self.implement = implement
- self.tests = tests
- self.path = path
-
-def find_rules(node, rules):
- if node.name == "rule":
- rules.append(Rule(node.text, node.get("@implement"),
- [ch.text for ch in node if ch.name == "test"],
- node.path()))
- if node.name == "doc" and node.get("@name") == "rule":
- tests = []
- if node.has("@test"):
- tests.append(node["@test"])
- rules.append(Rule(node.text, None, tests, node.path()))
- for child in node:
- find_rules(child, rules)
-
-def load_rules(specfile):
- rules = []
- find_rules(xmlutil.parse(specfile), rules)
- return rules
-
-def test_summary():
- template = """
- <html><head><title>AMQP Tests</title></head>
- <body>
- <table width="80%%" align="center">
- %s
- </table>
- </body>
- </html>
- """
- rows = []
- for rule in load_rules("amqp.org/specs/amqp7.xml"):
- if rule.tests:
- tests = ", ".join(rule.tests)
- else:
- tests = "&nbsp;"
- rows.append('<tr bgcolor="#EEEEEE"><td><b>Path:</b> %s</td>'
- '<td><b>Implement:</b> %s</td>'
- '<td><b>Tests:</b> %s</td></tr>' %
- (rule.path[len("/root/amqp"):], rule.implement, tests))
- rows.append('<tr><td colspan="3">%s</td></tr>' % rule.text)
- rows.append('<tr><td colspan="3">&nbsp;</td></tr>')
-
- print template % "\n".join(rows)
diff --git a/M4-RCs/qpid/python/qpid/testlib.py b/M4-RCs/qpid/python/qpid/testlib.py
deleted file mode 100644
index 31f52169ae..0000000000
--- a/M4-RCs/qpid/python/qpid/testlib.py
+++ /dev/null
@@ -1,392 +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.
-#
-
-#
-# Support library for qpid python tests.
-#
-
-import sys, re, unittest, os, random, logging, traceback
-import qpid.client, qpid.spec, qmf.console
-import Queue
-from fnmatch import fnmatch
-from getopt import getopt, GetoptError
-from qpid.content import Content
-from qpid.message import Message
-
-#0-10 support
-from qpid.connection import Connection
-from qpid.spec010 import load
-from qpid.util import connect, ssl, URL
-
-def findmodules(root):
- """Find potential python modules under directory root"""
- found = []
- for dirpath, subdirs, files in os.walk(root):
- modpath = dirpath.replace(os.sep, '.')
- if not re.match(r'\.svn$', dirpath): # Avoid SVN directories
- for f in files:
- match = re.match(r'(.+)\.py$', f)
- if match and f != '__init__.py':
- found.append('.'.join([modpath, match.group(1)]))
- return found
-
-def default(value, default):
- if (value == None): return default
- else: return value
-
-class TestRunner:
-
- SPEC_FOLDER = "../specs"
-
- """Runs unit tests.
-
- Parses command line arguments, provides utility functions for tests,
- runs the selected test suite.
- """
-
- def _die(self, message = None):
- if message: print message
- print """
-run-tests [options] [test*]
-The name of a test is package.module.ClassName.testMethod
-Options:
- -?/-h/--help : this message
- -s/--spec <spec.xml> : URL of AMQP XML specification or one of these abbreviations:
- 0-8 - use the default 0-8 specification.
- 0-9 - use the default 0-9 specification.
- 0-10-errata - use the 0-10 specification with qpid errata.
- -e/--errata <errata.xml> : file containing amqp XML errata
- -b/--broker [amqps://][<user>[/<password>]@]<host>[:<port>] : broker to connect to
- -v/--verbose : verbose - lists tests as they are run.
- -d/--debug : enable debug logging.
- -i/--ignore <test> : ignore the named test.
- -I/--ignore-file : file containing patterns to ignore.
- -S/--skip-self-test : skips the client self tests in the 'tests folder'
- -F/--spec-folder : folder that contains the specs to be loaded
- """
- sys.exit(1)
-
- def setBroker(self, broker):
- try:
- self.url = URL(broker)
- except ValueError:
- self._die("'%s' is not a valid broker" % (broker))
- self.user = default(self.url.user, "guest")
- self.password = default(self.url.password, "guest")
- self.host = self.url.host
- if self.url.scheme == URL.AMQPS:
- self.ssl = True
- default_port = 5671
- else:
- self.ssl = False
- default_port = 5672
- self.port = default(self.url.port, default_port)
-
- def ignoreFile(self, filename):
- f = file(filename)
- for line in f.readlines(): self.ignore.append(line.strip())
- f.close()
-
- def use08spec(self):
- "True if we are running with the old 0-8 spec."
- # NB: AMQP 0-8 identifies itself as 8-0 for historical reasons.
- return self.spec.major==8 and self.spec.minor==0
-
- def use09spec(self):
- "True if we are running with the 0-9 (non-wip) spec."
- return self.spec.major==0 and self.spec.minor==9
-
- def _parseargs(self, args):
- # Defaults
- self.setBroker("localhost")
- self.verbose = 1
- self.ignore = []
- self.specfile = "0-8"
- self.errata = []
- self.skip_self_test = False
-
- try:
- opts, self.tests = getopt(args, "s:e:b:h?dvSi:I:F:",
- ["help", "spec", "errata=", "broker=",
- "verbose", "skip-self-test", "ignore",
- "ignore-file", "spec-folder"])
- except GetoptError, e:
- self._die(str(e))
- for opt, value in opts:
- if opt in ("-?", "-h", "--help"): self._die()
- if opt in ("-s", "--spec"): self.specfile = value
- if opt in ("-e", "--errata"): self.errata.append(value)
- if opt in ("-b", "--broker"): self.setBroker(value)
- if opt in ("-v", "--verbose"): self.verbose = 2
- if opt in ("-d", "--debug"): logging.basicConfig(level=logging.DEBUG)
- if opt in ("-i", "--ignore"): self.ignore.append(value)
- if opt in ("-I", "--ignore-file"): self.ignoreFile(value)
- if opt in ("-S", "--skip-self-test"): self.skip_self_test = True
- if opt in ("-F", "--spec-folder"): TestRunner.SPEC_FOLDER = value
-
- # Abbreviations for default settings.
- if (self.specfile == "0-10"):
- self.spec = load(self.get_spec_file("amqp.0-10.xml"))
- elif (self.specfile == "0-10-errata"):
- self.spec = load(self.get_spec_file("amqp.0-10-qpid-errata.xml"))
- else:
- if (self.specfile == "0-8"):
- self.specfile = self.get_spec_file("amqp.0-8.xml")
- elif (self.specfile == "0-9"):
- self.specfile = self.get_spec_file("amqp.0-9.xml")
- self.errata.append(self.get_spec_file("amqp-errata.0-9.xml"))
-
- if (self.specfile == None):
- self._die("No XML specification provided")
- print "Using specification from:", self.specfile
-
- self.spec = qpid.spec.load(self.specfile, *self.errata)
-
- if len(self.tests) == 0:
- if not self.skip_self_test:
- self.tests=findmodules("tests")
- if self.use08spec() or self.use09spec():
- self.tests+=findmodules("tests_0-8")
- elif (self.spec.major == 99 and self.spec.minor == 0):
- self.tests+=findmodules("tests_0-10_preview")
- elif (self.spec.major == 0 and self.spec.minor == 10):
- self.tests+=findmodules("tests_0-10")
-
- def testSuite(self):
- class IgnoringTestSuite(unittest.TestSuite):
- def addTest(self, test):
- if isinstance(test, unittest.TestCase):
- for pattern in testrunner.ignore:
- if fnmatch(test.id(), pattern):
- return
- unittest.TestSuite.addTest(self, test)
-
- # Use our IgnoringTestSuite in the test loader.
- unittest.TestLoader.suiteClass = IgnoringTestSuite
- return unittest.defaultTestLoader.loadTestsFromNames(self.tests)
-
- def run(self, args=sys.argv[1:]):
- self._parseargs(args)
- runner = unittest.TextTestRunner(descriptions=False,
- verbosity=self.verbose)
- result = runner.run(self.testSuite())
-
- if (self.ignore):
- print "======================================="
- print "NOTE: the following tests were ignored:"
- for t in self.ignore: print t
- print "======================================="
-
- return result.wasSuccessful()
-
- def connect(self, host=None, port=None, spec=None, user=None, password=None, tune_params=None):
- """Connect to the broker, returns a qpid.client.Client"""
- host = host or self.host
- port = port or self.port
- spec = spec or self.spec
- user = user or self.user
- password = password or self.password
- client = qpid.client.Client(host, port, spec)
- if self.use08spec():
- client.start({"LOGIN": user, "PASSWORD": password}, tune_params=tune_params)
- else:
- client.start("\x00" + user + "\x00" + password, mechanism="PLAIN", tune_params=tune_params)
- return client
-
- def get_spec_file(self, fname):
- return TestRunner.SPEC_FOLDER + os.sep + fname
-
-# Global instance for tests to call connect.
-testrunner = TestRunner()
-
-
-class TestBase(unittest.TestCase):
- """Base class for Qpid test cases.
-
- self.client is automatically connected with channel 1 open before
- the test methods are run.
-
- Deletes queues and exchanges after. Tests call
- self.queue_declare(channel, ...) and self.exchange_declare(chanel,
- ...) which are wrappers for the Channel functions that note
- resources to clean up later.
- """
-
- def setUp(self):
- self.queues = []
- self.exchanges = []
- self.client = self.connect()
- self.channel = self.client.channel(1)
- self.version = (self.client.spec.major, self.client.spec.minor)
- if self.version == (8, 0) or self.version == (0, 9):
- self.channel.channel_open()
- else:
- self.channel.session_open()
-
- def tearDown(self):
- try:
- for ch, q in self.queues:
- ch.queue_delete(queue=q)
- for ch, ex in self.exchanges:
- ch.exchange_delete(exchange=ex)
- except:
- print "Error on tearDown:"
- print traceback.print_exc()
-
- if not self.client.closed:
- self.client.channel(0).connection_close(reply_code=200)
- else:
- self.client.close()
-
- def connect(self, *args, **keys):
- """Create a new connction, return the Client object"""
- return testrunner.connect(*args, **keys)
-
- def queue_declare(self, channel=None, *args, **keys):
- channel = channel or self.channel
- reply = channel.queue_declare(*args, **keys)
- self.queues.append((channel, keys["queue"]))
- return reply
-
- def exchange_declare(self, channel=None, ticket=0, exchange='',
- type='', passive=False, durable=False,
- auto_delete=False,
- arguments={}):
- channel = channel or self.channel
- reply = channel.exchange_declare(ticket=ticket, exchange=exchange, type=type, passive=passive,durable=durable, auto_delete=auto_delete, arguments=arguments)
- self.exchanges.append((channel,exchange))
- return reply
-
- def uniqueString(self):
- """Generate a unique string, unique for this TestBase instance"""
- if not "uniqueCounter" in dir(self): self.uniqueCounter = 1;
- return "Test Message " + str(self.uniqueCounter)
-
- def consume(self, queueName):
- """Consume from named queue returns the Queue object."""
- if testrunner.use08spec() or testrunner.use09spec():
- reply = self.channel.basic_consume(queue=queueName, no_ack=True)
- return self.client.queue(reply.consumer_tag)
- else:
- if not "uniqueTag" in dir(self): self.uniqueTag = 1
- else: self.uniqueTag += 1
- consumer_tag = "tag" + str(self.uniqueTag)
- self.channel.message_subscribe(queue=queueName, destination=consumer_tag)
- self.channel.message_flow(destination=consumer_tag, unit=0, value=0xFFFFFFFF)
- self.channel.message_flow(destination=consumer_tag, unit=1, value=0xFFFFFFFF)
- return self.client.queue(consumer_tag)
-
- def subscribe(self, channel=None, **keys):
- channel = channel or self.channel
- consumer_tag = keys["destination"]
- channel.message_subscribe(**keys)
- channel.message_flow(destination=consumer_tag, unit=0, value=0xFFFFFFFF)
- channel.message_flow(destination=consumer_tag, unit=1, value=0xFFFFFFFF)
-
- def assertEmpty(self, queue):
- """Assert that the queue is empty"""
- try:
- queue.get(timeout=1)
- self.fail("Queue is not empty.")
- except Queue.Empty: None # Ignore
-
- def assertPublishGet(self, queue, exchange="", routing_key="", properties=None):
- """
- Publish to exchange and assert queue.get() returns the same message.
- """
- body = self.uniqueString()
- if testrunner.use08spec() or testrunner.use09spec():
- self.channel.basic_publish(
- exchange=exchange,
- content=Content(body, properties=properties),
- routing_key=routing_key)
- else:
- self.channel.message_transfer(
- destination=exchange,
- content=Content(body, properties={'application_headers':properties,'routing_key':routing_key}))
- msg = queue.get(timeout=1)
- if testrunner.use08spec() or testrunner.use09spec():
- self.assertEqual(body, msg.content.body)
- if (properties):
- self.assertEqual(properties, msg.content.properties)
- else:
- self.assertEqual(body, msg.content.body)
- if (properties):
- self.assertEqual(properties, msg.content['application_headers'])
-
- def assertPublishConsume(self, queue="", exchange="", routing_key="", properties=None):
- """
- Publish a message and consume it, assert it comes back intact.
- Return the Queue object used to consume.
- """
- self.assertPublishGet(self.consume(queue), exchange, routing_key, properties)
-
- def assertChannelException(self, expectedCode, message):
- if self.version == (8, 0) or self.version == (0, 9):
- if not isinstance(message, Message): self.fail("expected channel_close method, got %s" % (message))
- self.assertEqual("channel", message.method.klass.name)
- self.assertEqual("close", message.method.name)
- else:
- if not isinstance(message, Message): self.fail("expected session_closed method, got %s" % (message))
- self.assertEqual("session", message.method.klass.name)
- self.assertEqual("closed", message.method.name)
- self.assertEqual(expectedCode, message.reply_code)
-
-
- def assertConnectionException(self, expectedCode, message):
- if not isinstance(message, Message): self.fail("expected connection_close method, got %s" % (message))
- self.assertEqual("connection", message.method.klass.name)
- self.assertEqual("close", message.method.name)
- self.assertEqual(expectedCode, message.reply_code)
-
-class TestBase010(unittest.TestCase):
- """
- Base class for Qpid test cases. using the final 0-10 spec
- """
-
- def setUp(self):
- self.conn = self.connect()
- self.session = self.conn.session("test-session", timeout=10)
- self.qmf = None
-
- def startQmf(self):
- self.qmf = qmf.console.Session()
- self.qmf_broker = self.qmf.addBroker(str(testrunner.url))
-
- def connect(self, host=None, port=None):
- sock = connect(host or testrunner.host, port or testrunner.port)
- if testrunner.url.scheme == URL.AMQPS:
- sock = ssl(sock)
- conn = Connection(sock, testrunner.spec, username=testrunner.user,
- password=testrunner.password)
- conn.start(timeout=10)
- return conn
-
- def tearDown(self):
- if not self.session.error(): self.session.close(timeout=10)
- self.conn.close(timeout=10)
- if self.qmf:
- self.qmf.delBroker(self.qmf_broker)
-
- def subscribe(self, session=None, **keys):
- session = session or self.session
- consumer_tag = keys["destination"]
- session.message_subscribe(**keys)
- session.message_flow(destination=consumer_tag, unit=0, value=0xFFFFFFFF)
- session.message_flow(destination=consumer_tag, unit=1, value=0xFFFFFFFF)
diff --git a/M4-RCs/qpid/python/qpid/util.py b/M4-RCs/qpid/python/qpid/util.py
deleted file mode 100644
index bb7f5090df..0000000000
--- a/M4-RCs/qpid/python/qpid/util.py
+++ /dev/null
@@ -1,117 +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.
-#
-
-import os, socket, time, textwrap, re
-
-ssl = socket.ssl
-
-def connect(host, port):
- sock = socket.socket()
- sock.connect((host, port))
- sock.setblocking(1)
- # XXX: we could use this on read, but we'd have to put write in a
- # loop as well
- # sock.settimeout(1)
- return sock
-
-def listen(host, port, predicate = lambda: True, bound = lambda: None):
- sock = socket.socket()
- sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
- sock.bind((host, port))
- sock.listen(5)
- bound()
- while predicate():
- s, a = sock.accept()
- yield s
-
-def mtime(filename):
- return os.stat(filename).st_mtime
-
-def wait(condition, predicate, timeout=None):
- condition.acquire()
- try:
- passed = 0
- start = time.time()
- while not predicate():
- if timeout is None:
- condition.wait()
- elif passed < timeout:
- condition.wait(timeout - passed)
- else:
- return False
- passed = time.time() - start
- return True
- finally:
- condition.release()
-
-def notify(condition, action=lambda: None):
- condition.acquire()
- try:
- action()
- condition.notifyAll()
- finally:
- condition.release()
-
-def fill(text, indent, heading = None):
- sub = indent * " "
- if heading:
- if not text:
- return (indent - 2) * " " + heading
- init = (indent - 2) * " " + heading + " -- "
- else:
- init = sub
- w = textwrap.TextWrapper(initial_indent = init, subsequent_indent = sub)
- return w.fill(" ".join(text.split()))
-
-class URL:
-
- RE = re.compile(r"""
- # [ <scheme>:// ] [ <user> [ / <password> ] @] <host> [ :<port> ]
- ^ (?: ([^:/@]+)://)? (?: ([^:/@]+) (?: / ([^:/@]+) )? @)? ([^@:/]+) (?: :([0-9]+))?$
-""", re.X)
-
- AMQPS = "amqps"
- AMQP = "amqp"
-
- def __init__(self, s):
- match = URL.RE.match(s)
- if match is None:
- raise ValueError(s)
- self.scheme, self.user, self.password, self.host, port = match.groups()
- if port is None:
- self.port = None
- else:
- self.port = int(port)
-
- def __repr__(self):
- return "URL(%r)" % str(self)
-
- def __str__(self):
- s = ""
- if self.scheme:
- s += "%s://" % self.scheme
- if self.user:
- s += self.user
- if self.password:
- s += "/%s" % self.password
- s += "@"
- s += self.host
- if self.port:
- s += ":%s" % self.port
- return s
diff --git a/M4-RCs/qpid/python/qpid_config.py b/M4-RCs/qpid/python/qpid_config.py
deleted file mode 100644
index 8f987e9962..0000000000
--- a/M4-RCs/qpid/python/qpid_config.py
+++ /dev/null
@@ -1,23 +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.
-#
-
-import os
-
-qpid_home = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
-amqp_spec = os.path.join(qpid_home, "specs", "amqp.0-10-qpid-errata.xml")
diff --git a/M4-RCs/qpid/python/rule2test b/M4-RCs/qpid/python/rule2test
deleted file mode 100755
index 10f151366e..0000000000
--- a/M4-RCs/qpid/python/rule2test
+++ /dev/null
@@ -1,108 +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.
-#
-
-#
-# Convert rules to tests
-#
-import sys, re, os.path
-from getopt import getopt, GetoptError
-from string import capitalize
-from xml import dom
-from xml.dom.minidom import parse
-
-def camelcase(s):
- """Convert 'string like this' to 'StringLikeThis'"""
- return "".join([capitalize(w) for w in re.split(re.compile("\W*"), s)])
-
-def uncapitalize(s): return s[0].lower()+s[1:]
-
-def ancestors(node):
- "Return iterator of ancestors from top-level element to node"
- def generator(node):
- while node and node.parentNode:
- yield node
- node = node.parentNode
- return reversed(list(generator(node)))
-
-def tagAndName(element):
- nameAttr = element.getAttribute("name");
- if (nameAttr) : return camelcase(nameAttr) + camelcase(element.tagName)
- else: return camelcase(element.tagName)
-
-def nodeText(n):
- """Recursively collect text from all text nodes under n"""
- if n.nodeType == dom.Node.TEXT_NODE:
- return n.data
- if n.childNodes:
- return reduce(lambda t, c: t + nodeText(c), n.childNodes, "")
- return ""
-
-def cleanup(docString, level=8):
- unindent = re.sub("\n[ \t]*", "\n", docString.strip())
- emptyLines = re.sub("\n\n\n", "\n\n", unindent)
- indented = re.sub("\n", "\n"+level*" ", emptyLines)
- return level*" " + indented
-
-def printTest(test, docstring):
- print "class %s(TestBase):" % test
- print ' """'
- print docstring
- print ' """'
- print
- print
-
-def printTests(doc, module):
- """Returns dictionary { classname : [ (methodname, docstring)* ] * }"""
- tests = {}
- rules = doc.getElementsByTagName("rule")
- for r in rules:
- path = list(ancestors(r))
- if module == path[1].getAttribute("name").lower():
- test = "".join(map(tagAndName, path[2:])) + "Tests"
- docstring = cleanup(nodeText(r), 4)
- printTest(test, docstring)
-
-def usage(message=None):
- if message: print >>sys.stderr, message
- print >>sys.stderr, """
-rule2test [options] <amqpclass>
-
-Print test classes for each rule for the amqpclass in amqp.xml.
-
-Options:
- -?/-h/--help : this message
- -s/--spec <spec.xml> : file containing amqp XML spec
-"""
- return 1
-
-def main(argv):
- try: opts, args = getopt(argv[1:], "h?s:", ["help", "spec="])
- except GetoptError, e: return usage(e)
- spec = "../specs/amqp.xml" # Default
- for opt, val in opts:
- if (opt in ("-h", "-?", "--help")): return usage()
- if (opt in ("-s", "--spec")): spec = val
- doc = parse(spec)
- if len(args) == 0: return usage()
- printTests(doc, args[0])
- return 0
-
-if (__name__ == "__main__"): sys.exit(main(sys.argv))
diff --git a/M4-RCs/qpid/python/run-tests b/M4-RCs/qpid/python/run-tests
deleted file mode 100755
index 84b76ebfc1..0000000000
--- a/M4-RCs/qpid/python/run-tests
+++ /dev/null
@@ -1,35 +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, logging
-from qpid.testlib import testrunner
-from qpid.log import enable, WARN, DEBUG
-
-if "-vv" in sys.argv:
- level = DEBUG
-else:
- level = WARN
-
-enable("qpid", level)
-
-if not testrunner.run(): sys.exit(1)
-
-
-
diff --git a/M4-RCs/qpid/python/server b/M4-RCs/qpid/python/server
deleted file mode 100755
index 56edd38490..0000000000
--- a/M4-RCs/qpid/python/server
+++ /dev/null
@@ -1,80 +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 qpid
-from qpid.connection import Connection, listen
-from qpid.delegate import Delegate
-from qpid.peer import Peer
-from qpid import Struct
-
-class Server(Delegate):
-
- def __init__(self):
- Delegate.__init__(self)
- self.queues = {}
- self.bindings = {}
-
- def connection_open(self, ch, msg):
- msg.open_ok()
-
- def session_open(self, ch, msg):
- print "session open on channel %s" % ch.id
- msg.attached()
-
- def execution_flush(self, ch, msg):
- pass
-
- def queue_declare(self, ch, msg):
- self.queues[msg.queue] = []
- print "queue declared: %s" % msg.queue
- msg.complete()
-
- def queue_bind(self, ch, msg):
- if self.bindings.has_key(msg.exchange):
- queues = self.bindings[msg.exchange]
- else:
- queues = set()
- self.bindings[msg.exchange] = queues
- queues.add((msg.routing_key, msg.queue))
- msg.complete()
-
- def queue_query(self, ch, msg):
- st = Struct(msg.method.result)
- ch.execution_result(msg.command_id, st)
- msg.complete()
-
- def message_subscribe(self, ch, msg):
- print msg
- msg.complete()
-
- def message_transfer(self, ch, msg):
- print msg.content
- msg.complete()
-
-
-spec = qpid.spec.load("../specs/amqp.0-10-preview.xml")
-
-for io in listen("0.0.0.0", 5672):
- c = Connection(io, spec)
- p = Peer(c, Server())
- c.tini()
- p.start()
- ch = p.channel(0)
- ch.connection_start()
- ch.connection_tune()
diff --git a/M4-RCs/qpid/python/server010 b/M4-RCs/qpid/python/server010
deleted file mode 100755
index 8dfcd7a585..0000000000
--- a/M4-RCs/qpid/python/server010
+++ /dev/null
@@ -1,72 +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.
-#
-
-from qpid import delegates
-from qpid.connection010 import Connection
-from qpid.util import connect, listen
-from qpid.spec010 import load
-from qpid.session import Client
-from qpid.datatypes import Message
-from qpid.log import enable, DEBUG, WARN
-
-import sys
-
-if "-v" in sys.argv:
- level = DEBUG
-else:
- level = WARN
-
-enable("qpid", level)
-
-spec = load("../specs/amqp.0-10.xml")
-
-class Server:
-
- def connection(self, connection):
- return delegates.Server(connection, self.session)
-
- def session(self, session):
- session.auto_sync = False
- return SessionDelegate(session)
-
-class SessionDelegate(Client):
-
- def __init__(self, session):
- self.session = session
-
- def queue_declare(self, qd):
- print "Queue %s declared..." % qd.queue
-
- def queue_query(self, qq):
- return qq._type.result.type.new((qq.queue,), {})
-
- def message_transfer(self, cmd, headers, body):
- m = Message(body)
- m.headers = headers
- self.session.message_transfer(cmd.destination, cmd.accept_mode, cmd.acquire_mode, m)
-
- def message_accept(self, messages):
- print "ACCEPT %s" % messages
-
-server = Server()
-
-for s in listen("0.0.0.0", spec.port):
- conn = Connection(s, spec, server.connection)
- conn.start(5)
diff --git a/M4-RCs/qpid/python/setup.py b/M4-RCs/qpid/python/setup.py
deleted file mode 100644
index a49fa6ca51..0000000000
--- a/M4-RCs/qpid/python/setup.py
+++ /dev/null
@@ -1,25 +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.
-#
-from distutils.core import setup
-
-setup(name="qpid", version="0.1", packages=["qpid"], scripts=["amqp-doc"],
- url="http://incubator.apache.org/qpid",
- license="Apache Software License",
- description="Python language client implementation for Apache Qpid")
diff --git a/M4-RCs/qpid/python/tests/__init__.py b/M4-RCs/qpid/python/tests/__init__.py
deleted file mode 100644
index 8ad514fc2f..0000000000
--- a/M4-RCs/qpid/python/tests/__init__.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Do not delete - marks this directory as a python package.
-
-#
-# 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 codec import *
-from queue import *
-from spec import *
-from framer import *
-from assembler import *
-from datatypes import *
-from connection import *
-from spec010 import *
-from codec010 import *
diff --git a/M4-RCs/qpid/python/tests/assembler.py b/M4-RCs/qpid/python/tests/assembler.py
deleted file mode 100644
index f4e37084b6..0000000000
--- a/M4-RCs/qpid/python/tests/assembler.py
+++ /dev/null
@@ -1,78 +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 threading import *
-from unittest import TestCase
-from qpid.util import connect, listen
-from qpid.assembler import *
-
-PORT = 1234
-
-class AssemblerTest(TestCase):
-
- def setUp(self):
- started = Event()
- self.running = True
-
- def run():
- running = True
- for s in listen("0.0.0.0", PORT, lambda: self.running, lambda: started.set()):
- asm = Assembler(s)
- try:
- asm.write_header(*asm.read_header()[-2:])
- while True:
- seg = asm.read_segment()
- asm.write_segment(seg)
- except Closed:
- pass
-
- self.server = Thread(target=run)
- self.server.setDaemon(True)
- self.server.start()
-
- started.wait(3)
- assert started.isSet()
-
- def tearDown(self):
- self.running = False
- self.server.join()
-
- def test(self):
- asm = Assembler(connect("0.0.0.0", PORT), max_payload = 1)
- asm.write_header(0, 10)
- asm.write_segment(Segment(True, False, 1, 2, 3, "TEST"))
- asm.write_segment(Segment(False, True, 1, 2, 3, "ING"))
-
- assert asm.read_header() == ("AMQP", 1, 1, 0, 10)
-
- seg = asm.read_segment()
- assert seg.first == True
- assert seg.last == False
- assert seg.type == 1
- assert seg.track == 2
- assert seg.channel == 3
- assert seg.payload == "TEST"
-
- seg = asm.read_segment()
- assert seg.first == False
- assert seg.last == True
- assert seg.type == 1
- assert seg.track == 2
- assert seg.channel == 3
- assert seg.payload == "ING"
diff --git a/M4-RCs/qpid/python/tests/codec.py b/M4-RCs/qpid/python/tests/codec.py
deleted file mode 100644
index 4bd3675af8..0000000000
--- a/M4-RCs/qpid/python/tests/codec.py
+++ /dev/null
@@ -1,607 +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 unittest
-from qpid.codec import Codec
-from qpid.spec import load
-from cStringIO import StringIO
-from qpid.reference import ReferenceId
-from qpid.testlib import testrunner
-
-__doc__ = """
-
- This is a unit test script for qpid/codec.py
-
- It can be run standalone or as part of the existing test framework.
-
- To run standalone:
- -------------------
-
- Place in the qpid/python/tests/ directory and type...
-
- python codec.py
-
- A brief output will be printed on screen. The verbose output will be placed inn a file called
- codec_unit_test_output.txt. [TODO: make this filename configurable]
-
- To run as part of the existing test framework:
- -----------------------------------------------
-
- python run-tests tests.codec
-
- Change History:
- -----------------
- Jimmy John 05/19/2007 Initial draft
- Jimmy John 05/22/2007 Implemented comments by Rafael Schloming
-
-
-"""
-
-SPEC = None
-
-def spec():
- global SPEC
- if SPEC == None:
- SPEC = load(testrunner.get_spec_file("amqp.0-8.xml"))
- return SPEC
-
-# --------------------------------------
-# --------------------------------------
-class BaseDataTypes(unittest.TestCase):
-
-
- """
- Base class containing common functions
- """
-
- # ---------------
- def setUp(self):
- """
- standard setUp for unitetest (refer unittest documentation for details)
- """
- self.codec = Codec(StringIO(), spec())
-
- # ------------------
- def tearDown(self):
- """
- standard tearDown for unitetest (refer unittest documentation for details)
- """
- self.codec.stream.flush()
- self.codec.stream.close()
-
- # ----------------------------------------
- def callFunc(self, functionName, *args):
- """
- helper function - given a function name and arguments, calls the function with the args and
- returns the contents of the stream
- """
- getattr(self.codec, functionName)(args[0])
- return self.codec.stream.getvalue()
-
- # ----------------------------------------
- def readFunc(self, functionName, *args):
- """
- helper function - creates a input stream and then calls the function with arguments as have been
- supplied
- """
- self.codec.stream = StringIO(args[0])
- return getattr(self.codec, functionName)()
-
-
-# ----------------------------------------
-# ----------------------------------------
-class IntegerTestCase(BaseDataTypes):
-
- """
- Handles octet, short, long, long long
-
- """
-
- # -------------------------
- def __init__(self, *args):
- """
- sets constants for use in tests
- """
-
- BaseDataTypes.__init__(self, *args)
- self.const_integer = 2
- self.const_integer_octet_encoded = '\x02'
- self.const_integer_short_encoded = '\x00\x02'
- self.const_integer_long_encoded = '\x00\x00\x00\x02'
- self.const_integer_long_long_encoded = '\x00\x00\x00\x00\x00\x00\x00\x02'
-
- # -------------------------- #
- # Unsigned Octect - 8 bits #
- # -------------------------- #
-
- # --------------------------
- def test_unsigned_octet(self):
- """
- ubyte format requires 0<=number<=255
- """
- self.failUnlessEqual(self.callFunc('encode_octet', self.const_integer), self.const_integer_octet_encoded, 'octect encoding FAILED...')
-
- # -------------------------------------------
- def test_octet_out_of_upper_range(self):
- """
- testing for input above acceptable range
- """
- self.failUnlessRaises(Exception, self.codec.encode_octet, 256)
-
- # -------------------------------------------
- def test_uoctet_out_of_lower_range(self):
- """
- testing for input below acceptable range
- """
- self.failUnlessRaises(Exception, self.codec.encode_octet, -1)
-
- # ---------------------------------
- def test_uoctet_with_fraction(self):
- """
- the fractional part should be ignored...
- """
- self.failUnlessEqual(self.callFunc('encode_octet', 2.5), self.const_integer_octet_encoded, 'octect encoding FAILED with fractions...')
-
- # ------------------------------------
- def test_unsigned_octet_decode(self):
- """
- octet decoding
- """
- self.failUnlessEqual(self.readFunc('decode_octet', self.const_integer_octet_encoded), self.const_integer, 'octect decoding FAILED...')
-
- # ----------------------------------- #
- # Unsigned Short Integers - 16 bits #
- # ----------------------------------- #
-
- # -----------------------
- def test_ushort_int(self):
- """
- testing unsigned short integer
- """
- self.failUnlessEqual(self.callFunc('encode_short', self.const_integer), self.const_integer_short_encoded, 'short encoding FAILED...')
-
- # -------------------------------------------
- def test_ushort_int_out_of_upper_range(self):
- """
- testing for input above acceptable range
- """
- self.failUnlessRaises(Exception, self.codec.encode_short, 65536)
-
- # -------------------------------------------
- def test_ushort_int_out_of_lower_range(self):
- """
- testing for input below acceptable range
- """
- self.failUnlessRaises(Exception, self.codec.encode_short, -1)
-
- # ---------------------------------
- def test_ushort_int_with_fraction(self):
- """
- the fractional part should be ignored...
- """
- self.failUnlessEqual(self.callFunc('encode_short', 2.5), self.const_integer_short_encoded, 'short encoding FAILED with fractions...')
-
- # ------------------------------------
- def test_ushort_int_decode(self):
- """
- unsigned short decoding
- """
- self.failUnlessEqual(self.readFunc('decode_short', self.const_integer_short_encoded), self.const_integer, 'unsigned short decoding FAILED...')
-
-
- # ---------------------------------- #
- # Unsigned Long Integers - 32 bits #
- # ---------------------------------- #
-
- # -----------------------
- def test_ulong_int(self):
- """
- testing unsigned long iteger
- """
- self.failUnlessEqual(self.callFunc('encode_long', self.const_integer), self.const_integer_long_encoded, 'long encoding FAILED...')
-
- # -------------------------------------------
- def test_ulong_int_out_of_upper_range(self):
- """
- testing for input above acceptable range
- """
- self.failUnlessRaises(Exception, self.codec.encode_long, 4294967296)
-
- # -------------------------------------------
- def test_ulong_int_out_of_lower_range(self):
- """
- testing for input below acceptable range
- """
- self.failUnlessRaises(Exception, self.codec.encode_long, -1)
-
- # ---------------------------------
- def test_ulong_int_with_fraction(self):
- """
- the fractional part should be ignored...
- """
- self.failUnlessEqual(self.callFunc('encode_long', 2.5), self.const_integer_long_encoded, 'long encoding FAILED with fractions...')
-
- # -------------------------------
- def test_ulong_int_decode(self):
- """
- unsigned long decoding
- """
- self.failUnlessEqual(self.readFunc('decode_long', self.const_integer_long_encoded), self.const_integer, 'unsigned long decoding FAILED...')
-
-
- # --------------------------------------- #
- # Unsigned Long Long Integers - 64 bits #
- # --------------------------------------- #
-
- # -----------------------
- def test_ulong_long_int(self):
- """
- testing unsinged long long integer
- """
- self.failUnlessEqual(self.callFunc('encode_longlong', self.const_integer), self.const_integer_long_long_encoded, 'long long encoding FAILED...')
-
- # -------------------------------------------
- def test_ulong_long_int_out_of_upper_range(self):
- """
- testing for input above acceptable range
- """
- self.failUnlessRaises(Exception, self.codec.encode_longlong, 18446744073709551616)
-
- # -------------------------------------------
- def test_ulong_long_int_out_of_lower_range(self):
- """
- testing for input below acceptable range
- """
- self.failUnlessRaises(Exception, self.codec.encode_longlong, -1)
-
- # ---------------------------------
- def test_ulong_long_int_with_fraction(self):
- """
- the fractional part should be ignored...
- """
- self.failUnlessEqual(self.callFunc('encode_longlong', 2.5), self.const_integer_long_long_encoded, 'long long encoding FAILED with fractions...')
-
- # ------------------------------------
- def test_ulong_long_int_decode(self):
- """
- unsigned long long decoding
- """
- self.failUnlessEqual(self.readFunc('decode_longlong', self.const_integer_long_long_encoded), self.const_integer, 'unsigned long long decoding FAILED...')
-
-# -----------------------------------
-# -----------------------------------
-class BitTestCase(BaseDataTypes):
-
- """
- Handles bits
- """
-
- # ----------------------------------------------
- def callFunc(self, functionName, *args):
- """
- helper function
- """
- for ele in args:
- getattr(self.codec, functionName)(ele)
-
- self.codec.flush()
- return self.codec.stream.getvalue()
-
- # -------------------
- def test_bit1(self):
- """
- sends in 11
- """
- self.failUnlessEqual(self.callFunc('encode_bit', 1, 1), '\x03', '11 bit encoding FAILED...')
-
- # -------------------
- def test_bit2(self):
- """
- sends in 10011
- """
- self.failUnlessEqual(self.callFunc('encode_bit', 1, 1, 0, 0, 1), '\x13', '10011 bit encoding FAILED...')
-
- # -------------------
- def test_bit3(self):
- """
- sends in 1110100111 [10 bits(right to left), should be compressed into two octets]
- """
- self.failUnlessEqual(self.callFunc('encode_bit', 1,1,1,0,0,1,0,1,1,1), '\xa7\x03', '1110100111(right to left) bit encoding FAILED...')
-
- # ------------------------------------
- def test_bit_decode_1(self):
- """
- decode bit 1
- """
- self.failUnlessEqual(self.readFunc('decode_bit', '\x01'), 1, 'decode bit 1 FAILED...')
-
- # ------------------------------------
- def test_bit_decode_0(self):
- """
- decode bit 0
- """
- self.failUnlessEqual(self.readFunc('decode_bit', '\x00'), 0, 'decode bit 0 FAILED...')
-
-# -----------------------------------
-# -----------------------------------
-class StringTestCase(BaseDataTypes):
-
- """
- Handles short strings, long strings
- """
-
- # ------------------------------------------------------------- #
- # Short Strings - 8 bit length followed by zero or more octets #
- # ------------------------------------------------------------- #
-
- # ---------------------------------------
- def test_short_string_zero_length(self):
- """
- 0 length short string
- """
- self.failUnlessEqual(self.callFunc('encode_shortstr', ''), '\x00', '0 length short string encoding FAILED...')
-
- # -------------------------------------------
- def test_short_string_positive_length(self):
- """
- positive length short string
- """
- self.failUnlessEqual(self.callFunc('encode_shortstr', 'hello world'), '\x0bhello world', 'positive length short string encoding FAILED...')
-
- # -------------------------------------------
- def test_short_string_out_of_upper_range(self):
- """
- string length > 255
- """
- self.failUnlessRaises(Exception, self.codec.encode_shortstr, 'x'*256)
-
- # ------------------------------------
- def test_short_string_decode(self):
- """
- short string decode
- """
- self.failUnlessEqual(self.readFunc('decode_shortstr', '\x0bhello world'), 'hello world', 'short string decode FAILED...')
-
-
- # ------------------------------------------------------------- #
- # Long Strings - 32 bit length followed by zero or more octets #
- # ------------------------------------------------------------- #
-
- # ---------------------------------------
- def test_long_string_zero_length(self):
- """
- 0 length long string
- """
- self.failUnlessEqual(self.callFunc('encode_longstr', ''), '\x00\x00\x00\x00', '0 length long string encoding FAILED...')
-
- # -------------------------------------------
- def test_long_string_positive_length(self):
- """
- positive length long string
- """
- self.failUnlessEqual(self.callFunc('encode_longstr', 'hello world'), '\x00\x00\x00\x0bhello world', 'positive length long string encoding FAILED...')
-
- # ------------------------------------
- def test_long_string_decode(self):
- """
- long string decode
- """
- self.failUnlessEqual(self.readFunc('decode_longstr', '\x00\x00\x00\x0bhello world'), 'hello world', 'long string decode FAILED...')
-
-
-# --------------------------------------
-# --------------------------------------
-class TimestampTestCase(BaseDataTypes):
-
- """
- No need of any test cases here as timestamps are implemented as long long which is tested above
- """
- pass
-
-# ---------------------------------------
-# ---------------------------------------
-class FieldTableTestCase(BaseDataTypes):
-
- """
- Handles Field Tables
-
- Only S/I type messages seem to be implemented currently
- """
-
- # -------------------------
- def __init__(self, *args):
- """
- sets constants for use in tests
- """
-
- BaseDataTypes.__init__(self, *args)
- self.const_field_table_dummy_dict = {'$key1':'value1','$key2':'value2'}
- self.const_field_table_dummy_dict_encoded = '\x00\x00\x00\x22\x05$key2S\x00\x00\x00\x06value2\x05$key1S\x00\x00\x00\x06value1'
-
- # -------------------------------------------
- def test_field_table_name_value_pair(self):
- """
- valid name value pair
- """
- self.failUnlessEqual(self.callFunc('encode_table', {'$key1':'value1'}), '\x00\x00\x00\x11\x05$key1S\x00\x00\x00\x06value1', 'valid name value pair encoding FAILED...')
-
- # ---------------------------------------------------
- def test_field_table_multiple_name_value_pair(self):
- """
- multiple name value pair
- """
- self.failUnlessEqual(self.callFunc('encode_table', self.const_field_table_dummy_dict), self.const_field_table_dummy_dict_encoded, 'multiple name value pair encoding FAILED...')
-
- # ------------------------------------
- def test_field_table_decode(self):
- """
- field table decode
- """
- self.failUnlessEqual(self.readFunc('decode_table', self.const_field_table_dummy_dict_encoded), self.const_field_table_dummy_dict, 'field table decode FAILED...')
-
-
-# ------------------------------------
-# ------------------------------------
-class ContentTestCase(BaseDataTypes):
-
- """
- Handles Content data types
- """
-
- # -----------------------------
- def test_content_inline(self):
- """
- inline content
- """
- self.failUnlessEqual(self.callFunc('encode_content', 'hello inline message'), '\x00\x00\x00\x00\x14hello inline message', 'inline content encoding FAILED...')
-
- # --------------------------------
- def test_content_reference(self):
- """
- reference content
- """
- self.failUnlessEqual(self.callFunc('encode_content', ReferenceId('dummyId')), '\x01\x00\x00\x00\x07dummyId', 'reference content encoding FAILED...')
-
- # ------------------------------------
- def test_content_inline_decode(self):
- """
- inline content decode
- """
- self.failUnlessEqual(self.readFunc('decode_content', '\x00\x00\x00\x00\x14hello inline message'), 'hello inline message', 'inline content decode FAILED...')
-
- # ------------------------------------
- def test_content_reference_decode(self):
- """
- reference content decode
- """
- self.failUnlessEqual(self.readFunc('decode_content', '\x01\x00\x00\x00\x07dummyId').id, 'dummyId', 'reference content decode FAILED...')
-
-# ------------------------ #
-# Pre - existing test code #
-# ------------------------ #
-
-# ---------------------
-def test(type, value):
- """
- old test function cut/copy/paste from qpid/codec.py
- """
- if isinstance(value, (list, tuple)):
- values = value
- else:
- values = [value]
- stream = StringIO()
- codec = Codec(stream, spec())
- for v in values:
- codec.encode(type, v)
- codec.flush()
- enc = stream.getvalue()
- stream.reset()
- dup = []
- for i in xrange(len(values)):
- dup.append(codec.decode(type))
- if values != dup:
- raise AssertionError("%r --> %r --> %r" % (values, enc, dup))
-
-# -----------------------
-def dotest(type, value):
- """
- old test function cut/copy/paste from qpid/codec.py
- """
- args = (type, value)
- test(*args)
-
-# -------------
-def oldtests():
- """
- old test function cut/copy/paste from qpid/codec.py
- """
- for value in ("1", "0", "110", "011", "11001", "10101", "10011"):
- for i in range(10):
- dotest("bit", map(lambda x: x == "1", value*i))
-
- for value in ({}, {"asdf": "fdsa", "fdsa": 1, "three": 3}, {"one": 1}):
- dotest("table", value)
-
- for type in ("octet", "short", "long", "longlong"):
- for value in range(0, 256):
- dotest(type, value)
-
- for type in ("shortstr", "longstr"):
- for value in ("", "a", "asdf"):
- dotest(type, value)
-
-# -----------------------------------------
-class oldTests(unittest.TestCase):
-
- """
- class to handle pre-existing test cases
- """
-
- # ---------------------------
- def test_oldtestcases(self):
- """
- call the old tests
- """
- return oldtests()
-
-# ---------------------------
-# ---------------------------
-if __name__ == '__main__':
-
- codec_test_suite = unittest.TestSuite()
-
- #adding all the test suites...
- codec_test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(IntegerTestCase))
- codec_test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(BitTestCase))
- codec_test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(StringTestCase))
- codec_test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TimestampTestCase))
- codec_test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(FieldTableTestCase))
- codec_test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(ContentTestCase))
-
- #loading pre-existing test case from qpid/codec.py
- codec_test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(oldTests))
-
- run_output_stream = StringIO()
- test_runner = unittest.TextTestRunner(run_output_stream, '', '')
- test_result = test_runner.run(codec_test_suite)
-
- print '\n%d test run...' % (test_result.testsRun)
-
- if test_result.wasSuccessful():
- print '\nAll tests successful\n'
-
- if test_result.failures:
- print '\n----------'
- print '%d FAILURES:' % (len(test_result.failures))
- print '----------\n'
- for failure in test_result.failures:
- print str(failure[0]) + ' ... FAIL'
-
- if test_result.errors:
- print '\n---------'
- print '%d ERRORS:' % (len(test_result.errors))
- print '---------\n'
-
- for error in test_result.errors:
- print str(error[0]) + ' ... ERROR'
-
- f = open('codec_unit_test_output.txt', 'w')
- f.write(str(run_output_stream.getvalue()))
- f.close()
diff --git a/M4-RCs/qpid/python/tests/codec010.py b/M4-RCs/qpid/python/tests/codec010.py
deleted file mode 100644
index 1912eac591..0000000000
--- a/M4-RCs/qpid/python/tests/codec010.py
+++ /dev/null
@@ -1,120 +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.
-#
-
-import time
-
-from unittest import TestCase
-from qpid.spec010 import load
-from qpid.codec010 import StringCodec
-from qpid.testlib import testrunner
-from qpid.datatypes import timestamp
-
-class CodecTest(TestCase):
-
- def setUp(self):
- self.spec = load(testrunner.get_spec_file("amqp.0-10.xml"))
-
- def check(self, type, value, compare=True):
- t = self.spec[type]
- sc = StringCodec(self.spec)
- t.encode(sc, value)
- decoded = t.decode(sc)
- if compare:
- assert decoded == value, "%s, %s" % (decoded, value)
- return decoded
-
- def testMapString(self):
- self.check("map", {"string": "this is a test"})
-
- def testMapInt(self):
- self.check("map", {"int": 3})
-
- def testMapLong(self):
- self.check("map", {"long": 2**32})
- self.check("map", {"long": 1 << 34})
- self.check("map", {"long": -(1 << 34)})
-
- def testMapTimestamp(self):
- decoded = self.check("map", {"timestamp": timestamp(0)})
- assert isinstance(decoded["timestamp"], timestamp)
-
- def testMapDatetime(self):
- decoded = self.check("map", {"datetime": timestamp(0).datetime()}, compare=False)
- assert isinstance(decoded["datetime"], timestamp)
- assert decoded["datetime"] == 0.0
-
- def testMapNone(self):
- self.check("map", {"none": None})
-
- def testMapNested(self):
- self.check("map", {"map": {"string": "nested test"}})
-
- def testMapList(self):
- self.check("map", {"list": [1, "two", 3.0, -4]})
-
- def testMapAll(self):
- decoded = self.check("map", {"string": "this is a test",
- "int": 3,
- "long": 2**32,
- "timestamp": timestamp(0),
- "none": None,
- "map": {"string": "nested map"},
- "list": [1, "two", 3.0, -4]})
- assert isinstance(decoded["timestamp"], timestamp)
-
- def testMapEmpty(self):
- self.check("map", {})
-
- def testMapNone(self):
- self.check("map", None)
-
- def testList(self):
- self.check("list", [1, "two", 3.0, -4])
-
- def testListEmpty(self):
- self.check("list", [])
-
- def testListNone(self):
- self.check("list", None)
-
- def testArrayInt(self):
- self.check("array", [1, 2, 3, 4])
-
- def testArrayString(self):
- self.check("array", ["one", "two", "three", "four"])
-
- def testArrayEmpty(self):
- self.check("array", [])
-
- def testArrayNone(self):
- self.check("array", None)
-
- def testInt16(self):
- self.check("int16", 3)
- self.check("int16", -3)
-
- def testInt64(self):
- self.check("int64", 3)
- self.check("int64", -3)
- self.check("int64", 1<<34)
- self.check("int64", -(1<<34))
-
- def testDatetime(self):
- self.check("datetime", timestamp(0))
- self.check("datetime", timestamp(long(time.time())))
diff --git a/M4-RCs/qpid/python/tests/connection.py b/M4-RCs/qpid/python/tests/connection.py
deleted file mode 100644
index 512fa62189..0000000000
--- a/M4-RCs/qpid/python/tests/connection.py
+++ /dev/null
@@ -1,215 +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 threading import *
-from unittest import TestCase
-from qpid.util import connect, listen
-from qpid.connection import *
-from qpid.datatypes import Message
-from qpid.testlib import testrunner
-from qpid.delegates import Server
-from qpid.queue import Queue
-from qpid.spec010 import load
-from qpid.session import Delegate
-
-PORT = 1234
-
-class TestServer:
-
- def __init__(self, queue):
- self.queue = queue
-
- def connection(self, connection):
- return Server(connection, delegate=self.session)
-
- def session(self, session):
- session.auto_sync = False
- return TestSession(session, self.queue)
-
-class TestSession(Delegate):
-
- def __init__(self, session, queue):
- self.session = session
- self.queue = queue
-
- def execution_sync(self, es):
- pass
-
- def queue_query(self, qq):
- return qq._type.result.type.new((qq.queue,), {})
-
- def message_transfer(self, cmd, headers, body):
- if cmd.destination == "echo":
- m = Message(body)
- m.headers = headers
- self.session.message_transfer(cmd.destination, cmd.accept_mode,
- cmd.acquire_mode, m)
- elif cmd.destination == "abort":
- self.session.channel.connection.sock.close()
- else:
- self.queue.put((cmd, headers, body))
-
-class ConnectionTest(TestCase):
-
- def setUp(self):
- self.spec = load(testrunner.get_spec_file("amqp.0-10.xml"))
- self.queue = Queue()
- self.running = True
- started = Event()
-
- def run():
- ts = TestServer(self.queue)
- for s in listen("0.0.0.0", PORT, lambda: self.running, lambda: started.set()):
- conn = Connection(s, self.spec, ts.connection)
- try:
- conn.start(5)
- except Closed:
- pass
-
- self.server = Thread(target=run)
- self.server.setDaemon(True)
- self.server.start()
-
- started.wait(3)
- assert started.isSet()
-
- def tearDown(self):
- self.running = False
- connect("0.0.0.0", PORT).close()
- self.server.join(3)
-
- def connect(self):
- return Connection(connect("0.0.0.0", PORT), self.spec)
-
- def test(self):
- c = self.connect()
- c.start(10)
-
- ssn1 = c.session("test1", timeout=10)
- ssn2 = c.session("test2", timeout=10)
-
- assert ssn1 == c.sessions["test1"]
- assert ssn2 == c.sessions["test2"]
- assert ssn1.channel != None
- assert ssn2.channel != None
- assert ssn1 in c.attached.values()
- assert ssn2 in c.attached.values()
-
- ssn1.close(5)
-
- assert ssn1.channel == None
- assert ssn1 not in c.attached.values()
- assert ssn2 in c.sessions.values()
-
- ssn2.close(5)
-
- assert ssn2.channel == None
- assert ssn2 not in c.attached.values()
- assert ssn2 not in c.sessions.values()
-
- ssn = c.session("session", timeout=10)
-
- assert ssn.channel != None
- assert ssn in c.sessions.values()
-
- destinations = ("one", "two", "three")
-
- for d in destinations:
- ssn.message_transfer(d)
-
- for d in destinations:
- cmd, header, body = self.queue.get(10)
- assert cmd.destination == d
- assert header == None
- assert body == None
-
- msg = Message("this is a test")
- ssn.message_transfer("four", message=msg)
- cmd, header, body = self.queue.get(10)
- assert cmd.destination == "four"
- assert header == None
- assert body == msg.body
-
- qq = ssn.queue_query("asdf")
- assert qq.queue == "asdf"
- c.close(5)
-
- def testCloseGet(self):
- c = self.connect()
- c.start(10)
- ssn = c.session("test", timeout=10)
- echos = ssn.incoming("echo")
-
- for i in range(10):
- ssn.message_transfer("echo", message=Message("test%d" % i))
-
- ssn.auto_sync=False
- ssn.message_transfer("abort")
-
- for i in range(10):
- m = echos.get(timeout=10)
- assert m.body == "test%d" % i
-
- try:
- m = echos.get(timeout=10)
- assert False
- except Closed, e:
- pass
-
- def testCloseListen(self):
- c = self.connect()
- c.start(10)
- ssn = c.session("test", timeout=10)
- echos = ssn.incoming("echo")
-
- messages = []
- exceptions = []
- condition = Condition()
- def listener(m): messages.append(m)
- def exc_listener(e):
- exceptions.append(e)
- condition.acquire()
- condition.notify()
- condition.release()
-
- echos.listen(listener, exc_listener)
-
- for i in range(10):
- ssn.message_transfer("echo", message=Message("test%d" % i))
-
- ssn.auto_sync=False
- ssn.message_transfer("abort")
-
- condition.acquire()
- condition.wait(10)
- condition.release()
-
- for i in range(10):
- m = messages.pop(0)
- assert m.body == "test%d" % i
-
- assert len(exceptions) == 1
-
- def testSync(self):
- c = self.connect()
- c.start(10)
- s = c.session("test")
- s.auto_sync = False
- s.message_transfer("echo", message=Message("test"))
- s.sync(10)
diff --git a/M4-RCs/qpid/python/tests/datatypes.py b/M4-RCs/qpid/python/tests/datatypes.py
deleted file mode 100644
index 4b9e1bcc78..0000000000
--- a/M4-RCs/qpid/python/tests/datatypes.py
+++ /dev/null
@@ -1,257 +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 unittest import TestCase
-from qpid.testlib import testrunner
-from qpid.spec010 import load
-from qpid.datatypes import *
-
-class SerialTest(TestCase):
-
- def test(self):
- for s in (serial(0), serial(0x8FFFFFFF), serial(0xFFFFFFFF)):
- assert s + 1 > s
- assert s - 1 < s
- assert s < s + 1
- assert s > s - 1
-
- assert serial(0xFFFFFFFF) + 1 == serial(0)
-
- assert min(serial(0xFFFFFFFF), serial(0x0)) == serial(0xFFFFFFFF)
- assert max(serial(0xFFFFFFFF), serial(0x0)) == serial(0x0)
-
- def testIncr(self):
- s = serial(0)
- s += 1
- assert s == serial(1)
-
- def testIn(self):
- l = [serial(1), serial(2), serial(3), serial(4)]
- assert serial(1) in l
- assert serial(0xFFFFFFFF + 2) in l
- assert 4 in l
-
- def testNone(self):
- assert serial(0) != None
-
- def testHash(self):
- d = {}
- d[serial(0)] = "zero"
- assert d[0] == "zero"
-
-class RangedSetTest(TestCase):
-
- def check(self, ranges):
- posts = []
- for range in ranges:
- posts.append(range.lower)
- posts.append(range.upper)
-
- sorted = posts[:]
- sorted.sort()
-
- assert posts == sorted
-
- idx = 1
- while idx + 1 < len(posts):
- assert posts[idx] + 1 != posts[idx+1]
- idx += 2
-
- def test(self):
- rs = RangedSet()
-
- self.check(rs.ranges)
-
- rs.add(1)
-
- assert 1 in rs
- assert 2 not in rs
- assert 0 not in rs
- self.check(rs.ranges)
-
- rs.add(2)
-
- assert 0 not in rs
- assert 1 in rs
- assert 2 in rs
- assert 3 not in rs
- self.check(rs.ranges)
-
- rs.add(0)
-
- assert -1 not in rs
- assert 0 in rs
- assert 1 in rs
- assert 2 in rs
- assert 3 not in rs
- self.check(rs.ranges)
-
- rs.add(37)
-
- assert -1 not in rs
- assert 0 in rs
- assert 1 in rs
- assert 2 in rs
- assert 3 not in rs
- assert 36 not in rs
- assert 37 in rs
- assert 38 not in rs
- self.check(rs.ranges)
-
- rs.add(-1)
- self.check(rs.ranges)
-
- rs.add(-3)
- self.check(rs.ranges)
-
- rs.add(1, 20)
- assert 21 not in rs
- assert 20 in rs
- self.check(rs.ranges)
-
- def testAddSelf(self):
- a = RangedSet()
- a.add(0, 8)
- self.check(a.ranges)
- a.add(0, 8)
- self.check(a.ranges)
- assert len(a.ranges) == 1
- range = a.ranges[0]
- assert range.lower == 0
- assert range.upper == 8
-
-class RangeTest(TestCase):
-
- def testIntersect1(self):
- a = Range(0, 10)
- b = Range(9, 20)
- i1 = a.intersect(b)
- i2 = b.intersect(a)
- assert i1.upper == 10
- assert i2.upper == 10
- assert i1.lower == 9
- assert i2.lower == 9
-
- def testIntersect2(self):
- a = Range(0, 10)
- b = Range(11, 20)
- assert a.intersect(b) == None
- assert b.intersect(a) == None
-
- def testIntersect3(self):
- a = Range(0, 10)
- b = Range(3, 5)
- i1 = a.intersect(b)
- i2 = b.intersect(a)
- assert i1.upper == 5
- assert i2.upper == 5
- assert i1.lower == 3
- assert i2.lower == 3
-
-class UUIDTest(TestCase):
-
- def test(self):
- # this test is kind of lame, but it does excercise the basic
- # functionality of the class
- u = uuid4()
- for i in xrange(1024):
- assert u != uuid4()
-
-class MessageTest(TestCase):
-
- def setUp(self):
- self.spec = load(testrunner.get_spec_file("amqp.0-10-qpid-errata.xml"))
- self.mp = Struct(self.spec["message.message_properties"])
- self.dp = Struct(self.spec["message.delivery_properties"])
- self.fp = Struct(self.spec["message.fragment_properties"])
-
- def testHas(self):
- m = Message(self.mp, self.dp, self.fp, "body")
- assert m.has("message_properties")
- assert m.has("delivery_properties")
- assert m.has("fragment_properties")
-
- def testGet(self):
- m = Message(self.mp, self.dp, self.fp, "body")
- assert m.get("message_properties") == self.mp
- assert m.get("delivery_properties") == self.dp
- assert m.get("fragment_properties") == self.fp
-
- def testSet(self):
- m = Message(self.mp, self.dp, "body")
- assert m.get("fragment_properties") is None
- m.set(self.fp)
- assert m.get("fragment_properties") == self.fp
-
- def testSetOnEmpty(self):
- m = Message("body")
- assert m.get("delivery_properties") is None
- m.set(self.dp)
- assert m.get("delivery_properties") == self.dp
-
- def testSetReplace(self):
- m = Message(self.mp, self.dp, self.fp, "body")
- dp = Struct(self.spec["message.delivery_properties"])
- assert m.get("delivery_properties") == self.dp
- assert m.get("delivery_properties") != dp
- m.set(dp)
- assert m.get("delivery_properties") != self.dp
- assert m.get("delivery_properties") == dp
-
- def testClear(self):
- m = Message(self.mp, self.dp, self.fp, "body")
- assert m.get("message_properties") == self.mp
- assert m.get("delivery_properties") == self.dp
- assert m.get("fragment_properties") == self.fp
- m.clear("fragment_properties")
- assert m.get("fragment_properties") is None
- assert m.get("message_properties") == self.mp
- assert m.get("delivery_properties") == self.dp
-
-class TimestampTest(TestCase):
-
- def check(self, expected, *values):
- for v in values:
- assert isinstance(v, timestamp)
- assert v == expected
- assert v == timestamp(expected)
-
- def testAdd(self):
- self.check(4.0,
- timestamp(2.0) + 2.0,
- 2.0 + timestamp(2.0))
-
- def testSub(self):
- self.check(2.0,
- timestamp(4.0) - 2.0,
- 4.0 - timestamp(2.0))
-
- def testNeg(self):
- self.check(-4.0, -timestamp(4.0))
-
- def testPos(self):
- self.check(+4.0, +timestamp(4.0))
-
- def testAbs(self):
- self.check(4.0, abs(timestamp(-4.0)))
-
- def testConversion(self):
- dt = timestamp(0).datetime()
- t = timestamp(dt)
- assert t == 0
diff --git a/M4-RCs/qpid/python/tests/framer.py b/M4-RCs/qpid/python/tests/framer.py
deleted file mode 100644
index e99166721c..0000000000
--- a/M4-RCs/qpid/python/tests/framer.py
+++ /dev/null
@@ -1,95 +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 threading import *
-from unittest import TestCase
-from qpid.util import connect, listen
-from qpid.framer import *
-
-PORT = 1234
-
-class FramerTest(TestCase):
-
- def setUp(self):
- self.running = True
- started = Event()
- def run():
- for s in listen("0.0.0.0", PORT, lambda: self.running, lambda: started.set()):
- conn = Framer(s)
- try:
- conn.write_header(*conn.read_header()[-2:])
- while True:
- frame = conn.read_frame()
- conn.write_frame(frame)
- conn.flush()
- except Closed:
- pass
-
- self.server = Thread(target=run)
- self.server.setDaemon(True)
- self.server.start()
-
- started.wait(3)
- assert started.isSet()
-
- def tearDown(self):
- self.running = False
- self.server.join(3)
-
- def test(self):
- c = Framer(connect("0.0.0.0", PORT))
-
- c.write_header(0, 10)
- assert c.read_header() == ("AMQP", 1, 1, 0, 10)
-
- c.write_frame(Frame(FIRST_FRM, 1, 2, 3, "THIS"))
- c.write_frame(Frame(0, 1, 2, 3, "IS"))
- c.write_frame(Frame(0, 1, 2, 3, "A"))
- c.write_frame(Frame(LAST_FRM, 1, 2, 3, "TEST"))
- c.flush()
-
- f = c.read_frame()
- assert f.flags & FIRST_FRM
- assert not (f.flags & LAST_FRM)
- assert f.type == 1
- assert f.track == 2
- assert f.channel == 3
- assert f.payload == "THIS"
-
- f = c.read_frame()
- assert f.flags == 0
- assert f.type == 1
- assert f.track == 2
- assert f.channel == 3
- assert f.payload == "IS"
-
- f = c.read_frame()
- assert f.flags == 0
- assert f.type == 1
- assert f.track == 2
- assert f.channel == 3
- assert f.payload == "A"
-
- f = c.read_frame()
- assert f.flags & LAST_FRM
- assert not (f.flags & FIRST_FRM)
- assert f.type == 1
- assert f.track == 2
- assert f.channel == 3
- assert f.payload == "TEST"
diff --git a/M4-RCs/qpid/python/tests/queue.py b/M4-RCs/qpid/python/tests/queue.py
deleted file mode 100644
index e12354eb43..0000000000
--- a/M4-RCs/qpid/python/tests/queue.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# Do not delete - marks this directory as a python package.
-
-#
-# 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 threading, time
-from unittest import TestCase
-from qpid.queue import Queue, Empty, Closed
-
-
-class QueueTest (TestCase):
-
- # The qpid queue class just provides sime simple extensions to
- # python's standard queue data structure, so we don't need to test
- # all the queue functionality.
-
- def test_listen(self):
- values = []
- heard = threading.Event()
- def listener(x):
- values.append(x)
- heard.set()
-
- q = Queue(0)
- q.listen(listener)
- heard.clear()
- q.put(1)
- heard.wait()
- assert values[-1] == 1
- heard.clear()
- q.put(2)
- heard.wait()
- assert values[-1] == 2
-
- q.listen(None)
- q.put(3)
- assert q.get(3) == 3
- q.listen(listener)
-
- heard.clear()
- q.put(4)
- heard.wait()
- assert values[-1] == 4
-
- def test_close(self):
- q = Queue(0)
- q.put(1); q.put(2); q.put(3); q.close()
- assert q.get() == 1
- assert q.get() == 2
- assert q.get() == 3
- for i in range(10):
- try:
- q.get()
- raise AssertionError("expected Closed")
- except Closed:
- pass
diff --git a/M4-RCs/qpid/python/tests/spec.py b/M4-RCs/qpid/python/tests/spec.py
deleted file mode 100644
index d5ea1d682a..0000000000
--- a/M4-RCs/qpid/python/tests/spec.py
+++ /dev/null
@@ -1,74 +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 unittest import TestCase
-from qpid.spec import load
-from qpid.testlib import testrunner
-
-class SpecTest(TestCase):
-
- def check_load(self, *urls):
- spec = load(*map(testrunner.get_spec_file, urls))
- qdecl = spec.method("queue_declare")
- assert qdecl != None
- assert not qdecl.content
-
- queue = qdecl.fields.byname["queue"]
- assert queue != None
- assert queue.domain.name == "queue_name"
- assert queue.type == "shortstr"
-
- qdecl_ok = spec.method("queue_declare_ok")
-
- # 0-8 is actually 8-0
- if (spec.major == 8 and spec.minor == 0 or
- spec.major == 0 and spec.minor == 9):
- assert qdecl_ok != None
-
- assert len(qdecl.responses) == 1
- assert qdecl_ok in qdecl.responses
-
- publish = spec.method("basic_publish")
- assert publish != None
- assert publish.content
-
- if (spec.major == 0 and spec.minor == 10):
- assert qdecl_ok == None
- reply_to = spec.domains.byname["reply_to"]
- assert reply_to.type.size == 2
- assert reply_to.type.pack == 2
- assert len(reply_to.type.fields) == 2
-
- qq = spec.method("queue_query")
- assert qq != None
- assert qq.result.size == 4
- assert qq.result.type != None
- args = qq.result.fields.byname["arguments"]
- assert args.type == "table"
-
- def test_load_0_8(self):
- self.check_load("amqp.0-8.xml")
-
- def test_load_0_9(self):
- self.check_load("amqp.0-9.xml")
-
- def test_load_0_9_errata(self):
- self.check_load("amqp.0-9.xml", "amqp-errata.0-9.xml")
-
- def test_load_0_10(self):
- self.check_load("amqp.0-10-preview.xml")
diff --git a/M4-RCs/qpid/python/tests/spec010.py b/M4-RCs/qpid/python/tests/spec010.py
deleted file mode 100644
index df9cb9590a..0000000000
--- a/M4-RCs/qpid/python/tests/spec010.py
+++ /dev/null
@@ -1,84 +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.
-#
-
-import os, tempfile, shutil, stat
-from unittest import TestCase
-from qpid.spec010 import load
-from qpid.codec010 import Codec, StringCodec
-from qpid.testlib import testrunner
-from qpid.datatypes import Struct
-
-class SpecTest(TestCase):
-
- def setUp(self):
- self.spec = load(testrunner.get_spec_file("amqp.0-10-qpid-errata.xml"))
-
- def testSessionHeader(self):
- hdr = self.spec["session.header"]
- sc = StringCodec(self.spec)
- hdr.encode(sc, Struct(hdr, sync=True))
- assert sc.encoded == "\x01\x01"
-
- sc = StringCodec(self.spec)
- hdr.encode(sc, Struct(hdr, sync=False))
- assert sc.encoded == "\x01\x00"
-
- def encdec(self, type, value):
- sc = StringCodec(self.spec)
- type.encode(sc, value)
- decoded = type.decode(sc)
- return decoded
-
- def testMessageProperties(self):
- mp = self.spec["message.message_properties"]
- rt = self.spec["message.reply_to"]
-
- props = Struct(mp, content_length=3735928559L,
- reply_to=Struct(rt, exchange="the exchange name",
- routing_key="the routing key"))
- dec = self.encdec(mp, props)
- assert props.content_length == dec.content_length
- assert props.reply_to.exchange == dec.reply_to.exchange
- assert props.reply_to.routing_key == dec.reply_to.routing_key
-
- def testMessageSubscribe(self):
- ms = self.spec["message.subscribe"]
- cmd = Struct(ms, exclusive=True, destination="this is a test")
- dec = self.encdec(self.spec["message.subscribe"], cmd)
- assert cmd.exclusive == dec.exclusive
- assert cmd.destination == dec.destination
-
- def testXid(self):
- xid = self.spec["dtx.xid"]
- sc = StringCodec(self.spec)
- st = Struct(xid, format=0, global_id="gid", branch_id="bid")
- xid.encode(sc, st)
- assert sc.encoded == '\x00\x00\x00\x10\x06\x04\x07\x00\x00\x00\x00\x00\x03gid\x03bid'
- assert xid.decode(sc).__dict__ == st.__dict__
-
- def testLoadReadOnly(self):
- spec = "amqp.0-10-qpid-errata.xml"
- f = testrunner.get_spec_file(spec)
- dest = tempfile.mkdtemp()
- shutil.copy(f, dest)
- shutil.copy(os.path.join(os.path.dirname(f), "amqp.0-10.dtd"), dest)
- os.chmod(dest, stat.S_IRUSR | stat.S_IXUSR)
- fname = os.path.join(dest, spec)
- load(fname)
- assert not os.path.exists("%s.pcl" % fname)
diff --git a/M4-RCs/qpid/python/tests_0-10/__init__.py b/M4-RCs/qpid/python/tests_0-10/__init__.py
deleted file mode 100644
index 1fd7f72357..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/__init__.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Do not delete - marks this directory as a python package.
-
-#
-# 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 alternate_exchange import *
-from broker import *
-from dtx import *
-from example import *
-from exchange import *
-from message import *
-from query import *
-from queue import *
-from tx import *
diff --git a/M4-RCs/qpid/python/tests_0-10/alternate_exchange.py b/M4-RCs/qpid/python/tests_0-10/alternate_exchange.py
deleted file mode 100644
index aac8a5e15b..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/alternate_exchange.py
+++ /dev/null
@@ -1,150 +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.
-#
-import traceback
-from qpid.queue import Empty
-from qpid.datatypes import Message
-from qpid.testlib import TestBase010
-from qpid.session import SessionException
-
-class AlternateExchangeTests(TestBase010):
- """
- Tests for the new mechanism for message returns introduced in 0-10
- and available in 0-9 for preview
- """
-
- def test_unroutable(self):
- """
- Test that unroutable messages are delivered to the alternate-exchange if specified
- """
- session = self.session
- #create an exchange with an alternate defined
- session.exchange_declare(exchange="secondary", type="fanout")
- session.exchange_declare(exchange="primary", type="direct", alternate_exchange="secondary")
-
- #declare, bind (to the alternate exchange) and consume from a queue for 'returned' messages
- session.queue_declare(queue="returns", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="returns", exchange="secondary")
- session.message_subscribe(destination="a", queue="returns")
- session.message_flow(destination="a", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="a", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- returned = session.incoming("a")
-
- #declare, bind (to the primary exchange) and consume from a queue for 'processed' messages
- session.queue_declare(queue="processed", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="processed", exchange="primary", binding_key="my-key")
- session.message_subscribe(destination="b", queue="processed")
- session.message_flow(destination="b", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="b", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- processed = session.incoming("b")
-
- #publish to the primary exchange
- #...one message that makes it to the 'processed' queue:
- dp=self.session.delivery_properties(routing_key="my-key")
- session.message_transfer(destination="primary", message=Message(dp, "Good"))
- #...and one that does not:
- dp=self.session.delivery_properties(routing_key="unused-key")
- session.message_transfer(destination="primary", message=Message(dp, "Bad"))
-
- #delete the exchanges
- session.exchange_delete(exchange="primary")
- session.exchange_delete(exchange="secondary")
-
- #verify behaviour
- self.assertEqual("Good", processed.get(timeout=1).body)
- self.assertEqual("Bad", returned.get(timeout=1).body)
- self.assertEmpty(processed)
- self.assertEmpty(returned)
-
- def test_queue_delete(self):
- """
- Test that messages in a queue being deleted are delivered to the alternate-exchange if specified
- """
- session = self.session
- #set up a 'dead letter queue':
- session.exchange_declare(exchange="dlq", type="fanout")
- session.queue_declare(queue="deleted", exclusive=True, auto_delete=True)
- session.exchange_bind(exchange="dlq", queue="deleted")
- session.message_subscribe(destination="dlq", queue="deleted")
- session.message_flow(destination="dlq", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="dlq", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- dlq = session.incoming("dlq")
-
- #create a queue using the dlq as its alternate exchange:
- session.queue_declare(queue="delete-me", alternate_exchange="dlq")
- #send it some messages:
- dp=self.session.delivery_properties(routing_key="delete-me")
- session.message_transfer(message=Message(dp, "One"))
- session.message_transfer(message=Message(dp, "Two"))
- session.message_transfer(message=Message(dp, "Three"))
- #delete it:
- session.queue_delete(queue="delete-me")
- #delete the dlq exchange:
- session.exchange_delete(exchange="dlq")
-
- #check the messages were delivered to the dlq:
- self.assertEqual("One", dlq.get(timeout=1).body)
- self.assertEqual("Two", dlq.get(timeout=1).body)
- self.assertEqual("Three", dlq.get(timeout=1).body)
- self.assertEmpty(dlq)
-
- def test_delete_while_used_by_queue(self):
- """
- Ensure an exchange still in use as an alternate-exchange for a
- queue can't be deleted
- """
- session = self.session
- session.exchange_declare(exchange="alternate", type="fanout")
-
- session2 = self.conn.session("alternate", 2)
- session2.queue_declare(queue="q", alternate_exchange="alternate")
- try:
- session2.exchange_delete(exchange="alternate")
- self.fail("Expected deletion of in-use alternate-exchange to fail")
- except SessionException, e:
- session = self.session
- session.queue_delete(queue="q")
- session.exchange_delete(exchange="alternate")
- self.assertEquals(530, e.args[0].error_code)
-
-
- def test_delete_while_used_by_exchange(self):
- """
- Ensure an exchange still in use as an alternate-exchange for
- another exchange can't be deleted
- """
- session = self.session
- session.exchange_declare(exchange="alternate", type="fanout")
-
- session = self.conn.session("alternate", 2)
- session.exchange_declare(exchange="e", type="fanout", alternate_exchange="alternate")
- try:
- session.exchange_delete(exchange="alternate")
- self.fail("Expected deletion of in-use alternate-exchange to fail")
- except SessionException, e:
- session = self.session
- session.exchange_delete(exchange="e")
- session.exchange_delete(exchange="alternate")
- self.assertEquals(530, e.args[0].error_code)
-
-
- def assertEmpty(self, queue):
- try:
- msg = queue.get(timeout=1)
- self.fail("Queue not empty: " + msg)
- except Empty: None
diff --git a/M4-RCs/qpid/python/tests_0-10/broker.py b/M4-RCs/qpid/python/tests_0-10/broker.py
deleted file mode 100644
index d4aa57765c..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/broker.py
+++ /dev/null
@@ -1,93 +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 qpid.client import Closed
-from qpid.queue import Empty
-from qpid.testlib import TestBase010
-from qpid.datatypes import Message, RangedSet
-
-class BrokerTests(TestBase010):
- """Tests for basic Broker functionality"""
-
- def test_ack_and_no_ack(self):
- """
- First, this test tries to receive a message with a no-ack
- consumer. Second, this test tries to explicitly receive and
- acknowledge a message with an acknowledging consumer.
- """
- session = self.session
- session.queue_declare(queue = "myqueue", exclusive=True, auto_delete=True)
-
- # No ack consumer
- ctag = "tag1"
- session.message_subscribe(queue = "myqueue", destination = ctag)
- session.message_flow(destination=ctag, unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination=ctag, unit=session.credit_unit.byte, value=0xFFFFFFFF)
- body = "test no-ack"
- session.message_transfer(message=Message(session.delivery_properties(routing_key="myqueue"), body))
- msg = session.incoming(ctag).get(timeout = 5)
- self.assert_(msg.body == body)
-
- # Acknowledging consumer
- session.queue_declare(queue = "otherqueue", exclusive=True, auto_delete=True)
- ctag = "tag2"
- session.message_subscribe(queue = "otherqueue", destination = ctag, accept_mode = 1)
- session.message_flow(destination=ctag, unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination=ctag, unit=session.credit_unit.byte, value=0xFFFFFFFF)
- body = "test ack"
- session.message_transfer(message=Message(session.delivery_properties(routing_key="otherqueue"), body))
- msg = session.incoming(ctag).get(timeout = 5)
- session.message_accept(RangedSet(msg.id))
- self.assert_(msg.body == body)
-
- def test_simple_delivery_immediate(self):
- """
- Test simple message delivery where consume is issued before publish
- """
- session = self.session
- session.queue_declare(queue="test-queue", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="test-queue", exchange="amq.fanout")
- consumer_tag = "tag1"
- session.message_subscribe(queue="test-queue", destination=consumer_tag)
- session.message_flow(unit = session.credit_unit.message, value = 0xFFFFFFFF, destination = consumer_tag)
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = consumer_tag)
- queue = session.incoming(consumer_tag)
-
- body = "Immediate Delivery"
- session.message_transfer("amq.fanout", None, None, Message(body))
- msg = queue.get(timeout=5)
- self.assert_(msg.body == body)
-
- def test_simple_delivery_queued(self):
- """
- Test basic message delivery where publish is issued before consume
- (i.e. requires queueing of the message)
- """
- session = self.session
- session.queue_declare(queue="test-queue", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="test-queue", exchange="amq.fanout")
- body = "Queued Delivery"
- session.message_transfer("amq.fanout", None, None, Message(body))
-
- consumer_tag = "tag1"
- session.message_subscribe(queue="test-queue", destination=consumer_tag)
- session.message_flow(unit = session.credit_unit.message, value = 0xFFFFFFFF, destination = consumer_tag)
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = consumer_tag)
- queue = session.incoming(consumer_tag)
- msg = queue.get(timeout=5)
- self.assert_(msg.body == body)
diff --git a/M4-RCs/qpid/python/tests_0-10/dtx.py b/M4-RCs/qpid/python/tests_0-10/dtx.py
deleted file mode 100644
index 25c2defd3b..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/dtx.py
+++ /dev/null
@@ -1,775 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.datatypes import Message, RangedSet
-from qpid.session import SessionException
-from qpid.testlib import TestBase010
-from qpid.compat import set
-from struct import pack, unpack
-from time import sleep
-
-class DtxTests(TestBase010):
- """
- Tests for the amqp dtx related classes.
-
- Tests of the form test_simple_xxx test the basic transactional
- behaviour. The approach here is to 'swap' a message from one queue
- to another by consuming and re-publishing in the same
- transaction. That transaction is then completed in different ways
- and the appropriate result verified.
-
- The other tests enforce more specific rules and behaviour on a
- per-method or per-field basis.
- """
-
- XA_RBROLLBACK = 1
- XA_RBTIMEOUT = 2
- XA_OK = 0
- tx_counter = 0
-
- def reset_channel(self):
- self.session.close()
- self.session = self.conn.session("dtx-session", 1)
-
- def test_simple_commit(self):
- """
- Test basic one-phase commit behaviour.
- """
- guard = self.keepQueuesAlive(["queue-a", "queue-b"])
- session = self.session
- tx = self.xid("my-xid")
- self.txswap(tx, "commit")
-
- #neither queue should have any messages accessible
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(0, "queue-b")
-
- #commit
- self.assertEqual(self.XA_OK, session.dtx_commit(xid=tx, one_phase=True).status)
-
- #should close and reopen session to ensure no unacked messages are held
- self.reset_channel()
-
- #check result
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(1, "queue-b")
- self.assertMessageId("commit", "queue-b")
-
- def test_simple_prepare_commit(self):
- """
- Test basic two-phase commit behaviour.
- """
- guard = self.keepQueuesAlive(["queue-a", "queue-b"])
- session = self.session
- tx = self.xid("my-xid")
- self.txswap(tx, "prepare-commit")
-
- #prepare
- self.assertEqual(self.XA_OK, session.dtx_prepare(xid=tx).status)
-
- #neither queue should have any messages accessible
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(0, "queue-b")
-
- #commit
- self.assertEqual(self.XA_OK, session.dtx_commit(xid=tx, one_phase=False).status)
-
- self.reset_channel()
-
- #check result
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(1, "queue-b")
- self.assertMessageId("prepare-commit", "queue-b")
-
-
- def test_simple_rollback(self):
- """
- Test basic rollback behaviour.
- """
- guard = self.keepQueuesAlive(["queue-a", "queue-b"])
- session = self.session
- tx = self.xid("my-xid")
- self.txswap(tx, "rollback")
-
- #neither queue should have any messages accessible
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(0, "queue-b")
-
- #rollback
- self.assertEqual(self.XA_OK, session.dtx_rollback(xid=tx).status)
-
- self.reset_channel()
-
- #check result
- self.assertMessageCount(1, "queue-a")
- self.assertMessageCount(0, "queue-b")
- self.assertMessageId("rollback", "queue-a")
-
- def test_simple_prepare_rollback(self):
- """
- Test basic rollback behaviour after the transaction has been prepared.
- """
- guard = self.keepQueuesAlive(["queue-a", "queue-b"])
- session = self.session
- tx = self.xid("my-xid")
- self.txswap(tx, "prepare-rollback")
-
- #prepare
- self.assertEqual(self.XA_OK, session.dtx_prepare(xid=tx).status)
-
- #neither queue should have any messages accessible
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(0, "queue-b")
-
- #rollback
- self.assertEqual(self.XA_OK, session.dtx_rollback(xid=tx).status)
-
- self.reset_channel()
-
- #check result
- self.assertMessageCount(1, "queue-a")
- self.assertMessageCount(0, "queue-b")
- self.assertMessageId("prepare-rollback", "queue-a")
-
- def test_select_required(self):
- """
- check that an error is flagged if select is not issued before
- start or end
- """
- session = self.session
- tx = self.xid("dummy")
- try:
- session.dtx_start(xid=tx)
-
- #if we get here we have failed, but need to do some cleanup:
- session.dtx_end(xid=tx)
- session.dtx_rollback(xid=tx)
- self.fail("Session not selected for use with dtx, expected exception!")
- except SessionException, e:
- self.assertEquals(503, e.args[0].error_code)
-
- def test_start_already_known(self):
- """
- Verify that an attempt to start an association with a
- transaction that is already known is not allowed (unless the
- join flag is set).
- """
- #create two sessions on different connection & select them for use with dtx:
- session1 = self.session
- session1.dtx_select()
-
- other = self.connect()
- session2 = other.session("other", 0)
- session2.dtx_select()
-
- #create a xid
- tx = self.xid("dummy")
- #start work on one session under that xid:
- session1.dtx_start(xid=tx)
- #then start on the other without the join set
- failed = False
- try:
- session2.dtx_start(xid=tx)
- except SessionException, e:
- failed = True
- error = e
-
- #cleanup:
- if not failed:
- session2.dtx_end(xid=tx)
- other.close()
- session1.dtx_end(xid=tx)
- session1.dtx_rollback(xid=tx)
-
- #verification:
- if failed: self.assertEquals(530, error.args[0].error_code)
- else: self.fail("Xid already known, expected exception!")
-
- def test_forget_xid_on_completion(self):
- """
- Verify that a xid is 'forgotten' - and can therefore be used
- again - once it is completed.
- """
- #do some transactional work & complete the transaction
- self.test_simple_commit()
- # session has been reset, so reselect for use with dtx
- self.session.dtx_select()
-
- #start association for the same xid as the previously completed txn
- tx = self.xid("my-xid")
- self.session.dtx_start(xid=tx)
- self.session.dtx_end(xid=tx)
- self.session.dtx_rollback(xid=tx)
-
- def test_start_join_and_resume(self):
- """
- Ensure the correct error is signalled when both the join and
- resume flags are set on starting an association between a
- session and a transcation.
- """
- session = self.session
- session.dtx_select()
- tx = self.xid("dummy")
- try:
- session.dtx_start(xid=tx, join=True, resume=True)
- #failed, but need some cleanup:
- session.dtx_end(xid=tx)
- session.dtx_rollback(xid=tx)
- self.fail("Join and resume both set, expected exception!")
- except SessionException, e:
- self.assertEquals(503, e.args[0].error_code)
-
- def test_start_join(self):
- """
- Verify 'join' behaviour, where a session is associated with a
- transaction that is already associated with another session.
- """
- guard = self.keepQueuesAlive(["one", "two"])
- #create two sessions & select them for use with dtx:
- session1 = self.session
- session1.dtx_select()
-
- session2 = self.conn.session("second", 2)
- session2.dtx_select()
-
- #setup
- session1.queue_declare(queue="one", auto_delete=True)
- session1.queue_declare(queue="two", auto_delete=True)
- session1.message_transfer(self.createMessage(session1, "one", "a", "DtxMessage"))
- session1.message_transfer(self.createMessage(session1, "two", "b", "DtxMessage"))
-
- #create a xid
- tx = self.xid("dummy")
- #start work on one session under that xid:
- session1.dtx_start(xid=tx)
- #then start on the other with the join flag set
- session2.dtx_start(xid=tx, join=True)
-
- #do work through each session
- self.swap(session1, "one", "two")#swap 'a' from 'one' to 'two'
- self.swap(session2, "two", "one")#swap 'b' from 'two' to 'one'
-
- #mark end on both sessions
- session1.dtx_end(xid=tx)
- session2.dtx_end(xid=tx)
-
- #commit and check
- session1.dtx_commit(xid=tx, one_phase=True)
- self.assertMessageCount(1, "one")
- self.assertMessageCount(1, "two")
- self.assertMessageId("a", "two")
- self.assertMessageId("b", "one")
-
-
- def test_suspend_resume(self):
- """
- Test suspension and resumption of an association
- """
- session = self.session
- session.dtx_select()
-
- #setup
- session.queue_declare(queue="one", exclusive=True, auto_delete=True)
- session.queue_declare(queue="two", exclusive=True, auto_delete=True)
- session.message_transfer(self.createMessage(session, "one", "a", "DtxMessage"))
- session.message_transfer(self.createMessage(session, "two", "b", "DtxMessage"))
-
- tx = self.xid("dummy")
-
- session.dtx_start(xid=tx)
- self.swap(session, "one", "two")#swap 'a' from 'one' to 'two'
- session.dtx_end(xid=tx, suspend=True)
-
- session.dtx_start(xid=tx, resume=True)
- self.swap(session, "two", "one")#swap 'b' from 'two' to 'one'
- session.dtx_end(xid=tx)
-
- #commit and check
- session.dtx_commit(xid=tx, one_phase=True)
- self.assertMessageCount(1, "one")
- self.assertMessageCount(1, "two")
- self.assertMessageId("a", "two")
- self.assertMessageId("b", "one")
-
- def test_suspend_start_end_resume(self):
- """
- Test suspension and resumption of an association with work
- done on another transaction when the first transaction is
- suspended
- """
- session = self.session
- session.dtx_select()
-
- #setup
- session.queue_declare(queue="one", exclusive=True, auto_delete=True)
- session.queue_declare(queue="two", exclusive=True, auto_delete=True)
- session.message_transfer(self.createMessage(session, "one", "a", "DtxMessage"))
- session.message_transfer(self.createMessage(session, "two", "b", "DtxMessage"))
-
- tx = self.xid("dummy")
-
- session.dtx_start(xid=tx)
- self.swap(session, "one", "two")#swap 'a' from 'one' to 'two'
- session.dtx_end(xid=tx, suspend=True)
-
- session.dtx_start(xid=tx, resume=True)
- self.swap(session, "two", "one")#swap 'b' from 'two' to 'one'
- session.dtx_end(xid=tx)
-
- #commit and check
- session.dtx_commit(xid=tx, one_phase=True)
- self.assertMessageCount(1, "one")
- self.assertMessageCount(1, "two")
- self.assertMessageId("a", "two")
- self.assertMessageId("b", "one")
-
- def test_end_suspend_and_fail(self):
- """
- Verify that the correct error is signalled if the suspend and
- fail flag are both set when disassociating a transaction from
- the session
- """
- session = self.session
- session.dtx_select()
- tx = self.xid("suspend_and_fail")
- session.dtx_start(xid=tx)
- try:
- session.dtx_end(xid=tx, suspend=True, fail=True)
- self.fail("Suspend and fail both set, expected exception!")
- except SessionException, e:
- self.assertEquals(503, e.args[0].error_code)
-
- #cleanup
- other = self.connect()
- session = other.session("cleanup", 1)
- session.dtx_rollback(xid=tx)
- session.close()
- other.close()
-
-
- def test_end_unknown_xid(self):
- """
- Verifies that the correct exception is thrown when an attempt
- is made to end the association for a xid not previously
- associated with the session
- """
- session = self.session
- session.dtx_select()
- tx = self.xid("unknown-xid")
- try:
- session.dtx_end(xid=tx)
- self.fail("Attempted to end association with unknown xid, expected exception!")
- except SessionException, e:
- self.assertEquals(409, e.args[0].error_code)
-
- def test_end(self):
- """
- Verify that the association is terminated by end and subsequent
- operations are non-transactional
- """
- guard = self.keepQueuesAlive(["tx-queue"])
- session = self.conn.session("alternate", 1)
- session.queue_declare(queue="tx-queue", exclusive=True, auto_delete=True)
-
- #publish a message under a transaction
- session.dtx_select()
- tx = self.xid("dummy")
- session.dtx_start(xid=tx)
- session.message_transfer(self.createMessage(session, "tx-queue", "one", "DtxMessage"))
- session.dtx_end(xid=tx)
-
- #now that association with txn is ended, publish another message
- session.message_transfer(self.createMessage(session, "tx-queue", "two", "DtxMessage"))
-
- #check the second message is available, but not the first
- self.assertMessageCount(1, "tx-queue")
- self.subscribe(session, queue="tx-queue", destination="results")
- msg = session.incoming("results").get(timeout=1)
- self.assertEqual("two", self.getMessageProperty(msg, 'correlation_id'))
- session.message_cancel(destination="results")
- #ack the message then close the session
- session.message_accept(RangedSet(msg.id))
- session.close()
-
- session = self.session
- #commit the transaction and check that the first message (and
- #only the first message) is then delivered
- session.dtx_commit(xid=tx, one_phase=True)
- self.assertMessageCount(1, "tx-queue")
- self.assertMessageId("one", "tx-queue")
-
- def test_invalid_commit_one_phase_true(self):
- """
- Test that a commit with one_phase = True is rejected if the
- transaction in question has already been prepared.
- """
- other = self.connect()
- tester = other.session("tester", 1)
- tester.queue_declare(queue="dummy", exclusive=True, auto_delete=True)
- tester.dtx_select()
- tx = self.xid("dummy")
- tester.dtx_start(xid=tx)
- tester.message_transfer(self.createMessage(tester, "dummy", "dummy", "whatever"))
- tester.dtx_end(xid=tx)
- tester.dtx_prepare(xid=tx)
- failed = False
- try:
- tester.dtx_commit(xid=tx, one_phase=True)
- except SessionException, e:
- failed = True
- error = e
-
- if failed:
- self.session.dtx_rollback(xid=tx)
- self.assertEquals(409, error.args[0].error_code)
- else:
- tester.close()
- other.close()
- self.fail("Invalid use of one_phase=True, expected exception!")
-
- def test_invalid_commit_one_phase_false(self):
- """
- Test that a commit with one_phase = False is rejected if the
- transaction in question has not yet been prepared.
- """
- other = self.connect()
- tester = other.session("tester", 1)
- tester.queue_declare(queue="dummy", exclusive=True, auto_delete=True)
- tester.dtx_select()
- tx = self.xid("dummy")
- tester.dtx_start(xid=tx)
- tester.message_transfer(self.createMessage(tester, "dummy", "dummy", "whatever"))
- tester.dtx_end(xid=tx)
- failed = False
- try:
- tester.dtx_commit(xid=tx, one_phase=False)
- except SessionException, e:
- failed = True
- error = e
-
- if failed:
- self.session.dtx_rollback(xid=tx)
- self.assertEquals(409, error.args[0].error_code)
- else:
- tester.close()
- other.close()
- self.fail("Invalid use of one_phase=False, expected exception!")
-
- def test_invalid_commit_not_ended(self):
- """
- Test that a commit fails if the xid is still associated with a session.
- """
- other = self.connect()
- tester = other.session("tester", 1)
- self.session.queue_declare(queue="dummy", exclusive=True, auto_delete=True)
- self.session.dtx_select()
- tx = self.xid("dummy")
- self.session.dtx_start(xid=tx)
- self.session.message_transfer(self.createMessage(tester, "dummy", "dummy", "whatever"))
-
- failed = False
- try:
- tester.dtx_commit(xid=tx, one_phase=False)
- except SessionException, e:
- failed = True
- error = e
-
- if failed:
- self.session.dtx_end(xid=tx)
- self.session.dtx_rollback(xid=tx)
- self.assertEquals(409, error.args[0].error_code)
- else:
- tester.close()
- other.close()
- self.fail("Commit should fail as xid is still associated!")
-
- def test_invalid_rollback_not_ended(self):
- """
- Test that a rollback fails if the xid is still associated with a session.
- """
- other = self.connect()
- tester = other.session("tester", 1)
- self.session.queue_declare(queue="dummy", exclusive=True, auto_delete=True)
- self.session.dtx_select()
- tx = self.xid("dummy")
- self.session.dtx_start(xid=tx)
- self.session.message_transfer(self.createMessage(tester, "dummy", "dummy", "whatever"))
-
- failed = False
- try:
- tester.dtx_rollback(xid=tx)
- except SessionException, e:
- failed = True
- error = e
-
- if failed:
- self.session.dtx_end(xid=tx)
- self.session.dtx_rollback(xid=tx)
- self.assertEquals(409, error.args[0].error_code)
- else:
- tester.close()
- other.close()
- self.fail("Rollback should fail as xid is still associated!")
-
-
- def test_invalid_prepare_not_ended(self):
- """
- Test that a prepare fails if the xid is still associated with a session.
- """
- other = self.connect()
- tester = other.session("tester", 1)
- self.session.queue_declare(queue="dummy", exclusive=True, auto_delete=True)
- self.session.dtx_select()
- tx = self.xid("dummy")
- self.session.dtx_start(xid=tx)
- self.session.message_transfer(self.createMessage(tester, "dummy", "dummy", "whatever"))
-
- failed = False
- try:
- tester.dtx_prepare(xid=tx)
- except SessionException, e:
- failed = True
- error = e
-
- if failed:
- self.session.dtx_end(xid=tx)
- self.session.dtx_rollback(xid=tx)
- self.assertEquals(409, error.args[0].error_code)
- else:
- tester.close()
- other.close()
- self.fail("Rollback should fail as xid is still associated!")
-
- def test_implicit_end(self):
- """
- Test that an association is implicitly ended when the session
- is closed (whether by exception or explicit client request)
- and the transaction in question is marked as rollback only.
- """
- session1 = self.session
- session2 = self.conn.session("other", 2)
-
- #setup:
- session2.queue_declare(queue="dummy", exclusive=True, auto_delete=True)
- session2.message_transfer(self.createMessage(session2, "dummy", "a", "whatever"))
- tx = self.xid("dummy")
-
- session2.dtx_select()
- session2.dtx_start(xid=tx)
- session2.message_subscribe(queue="dummy", destination="dummy")
- session2.message_flow(destination="dummy", unit=session2.credit_unit.message, value=1)
- session2.message_flow(destination="dummy", unit=session2.credit_unit.byte, value=0xFFFFFFFF)
- msg = session2.incoming("dummy").get(timeout=1)
- session2.message_accept(RangedSet(msg.id))
- session2.message_cancel(destination="dummy")
- session2.message_transfer(self.createMessage(session2, "dummy", "b", "whatever"))
- session2.close()
-
- self.assertEqual(self.XA_RBROLLBACK, session1.dtx_prepare(xid=tx).status)
- session1.dtx_rollback(xid=tx)
-
- def test_get_timeout(self):
- """
- Check that get-timeout returns the correct value, (and that a
- transaction with a timeout can complete normally)
- """
- session = self.session
- tx = self.xid("dummy")
-
- session.dtx_select()
- session.dtx_start(xid=tx)
- self.assertEqual(0, session.dtx_get_timeout(xid=tx).timeout)
- session.dtx_set_timeout(xid=tx, timeout=60)
- self.assertEqual(60, session.dtx_get_timeout(xid=tx).timeout)
- self.assertEqual(self.XA_OK, session.dtx_end(xid=tx).status)
- self.assertEqual(self.XA_OK, session.dtx_rollback(xid=tx).status)
-
- def test_set_timeout(self):
- """
- Test the timeout of a transaction results in the expected
- behaviour
- """
-
- guard = self.keepQueuesAlive(["queue-a", "queue-b"])
- #open new session to allow self.session to be used in checking the queue
- session = self.conn.session("worker", 1)
- #setup:
- tx = self.xid("dummy")
- session.queue_declare(queue="queue-a", auto_delete=True)
- session.queue_declare(queue="queue-b", auto_delete=True)
- session.message_transfer(self.createMessage(session, "queue-a", "timeout", "DtxMessage"))
-
- session.dtx_select()
- session.dtx_start(xid=tx)
- self.swap(session, "queue-a", "queue-b")
- session.dtx_set_timeout(xid=tx, timeout=2)
- sleep(3)
- #check that the work has been rolled back already
- self.assertMessageCount(1, "queue-a")
- self.assertMessageCount(0, "queue-b")
- self.assertMessageId("timeout", "queue-a")
- #check the correct codes are returned when we try to complete the txn
- self.assertEqual(self.XA_RBTIMEOUT, session.dtx_end(xid=tx).status)
- self.assertEqual(self.XA_RBTIMEOUT, session.dtx_rollback(xid=tx).status)
-
-
-
- def test_recover(self):
- """
- Test basic recover behaviour
- """
- session = self.session
-
- session.dtx_select()
- session.queue_declare(queue="dummy", exclusive=True, auto_delete=True)
-
- prepared = []
- for i in range(1, 10):
- tx = self.xid("tx%s" % (i))
- session.dtx_start(xid=tx)
- session.message_transfer(self.createMessage(session, "dummy", "message%s" % (i), "message%s" % (i)))
- session.dtx_end(xid=tx)
- if i in [2, 5, 6, 8]:
- session.dtx_prepare(xid=tx)
- prepared.append(tx)
- else:
- session.dtx_rollback(xid=tx)
-
- xids = session.dtx_recover().in_doubt
-
- #rollback the prepared transactions returned by recover
- for x in xids:
- session.dtx_rollback(xid=x)
-
- #validate against the expected list of prepared transactions
- actual = set([x.global_id for x in xids]) #TODO: come up with nicer way to test these
- expected = set([x.global_id for x in prepared])
- intersection = actual.intersection(expected)
-
- if intersection != expected:
- missing = expected.difference(actual)
- extra = actual.difference(expected)
- self.fail("Recovered xids not as expected. missing: %s; extra: %s" % (missing, extra))
-
- def test_bad_resume(self):
- """
- Test that a resume on a session not selected for use with dtx fails
- """
- session = self.session
- try:
- session.dtx_start(resume=True)
- except SessionException, e:
- self.assertEquals(503, e.args[0].error_code)
-
- def test_prepare_unknown(self):
- session = self.session
- try:
- session.dtx_prepare(xid=self.xid("unknown"))
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
- def test_commit_unknown(self):
- session = self.session
- try:
- session.dtx_commit(xid=self.xid("unknown"))
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
- def test_rollback_unknown(self):
- session = self.session
- try:
- session.dtx_rollback(xid=self.xid("unknown"))
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
- def test_get_timeout_unknown(self):
- session = self.session
- try:
- session.dtx_get_timeout(xid=self.xid("unknown"))
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
- def xid(self, txid):
- DtxTests.tx_counter += 1
- branchqual = "v%s" % DtxTests.tx_counter
- return self.session.xid(format=0, global_id=txid, branch_id=branchqual)
-
- def txswap(self, tx, id):
- session = self.session
- #declare two queues:
- session.queue_declare(queue="queue-a", auto_delete=True)
- session.queue_declare(queue="queue-b", auto_delete=True)
-
- #put message with specified id on one queue:
- dp=session.delivery_properties(routing_key="queue-a")
- mp=session.message_properties(correlation_id=id)
- session.message_transfer(message=Message(dp, mp, "DtxMessage"))
-
- #start the transaction:
- session.dtx_select()
- self.assertEqual(self.XA_OK, self.session.dtx_start(xid=tx).status)
-
- #'swap' the message from one queue to the other, under that transaction:
- self.swap(self.session, "queue-a", "queue-b")
-
- #mark the end of the transactional work:
- self.assertEqual(self.XA_OK, self.session.dtx_end(xid=tx).status)
-
- def swap(self, session, src, dest):
- #consume from src:
- session.message_subscribe(destination="temp-swap", queue=src)
- session.message_flow(destination="temp-swap", unit=session.credit_unit.message, value=1)
- session.message_flow(destination="temp-swap", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- msg = session.incoming("temp-swap").get(timeout=1)
- session.message_cancel(destination="temp-swap")
- session.message_accept(RangedSet(msg.id))
- #todo: also complete at this point?
-
- #re-publish to dest:
- dp=session.delivery_properties(routing_key=dest)
- mp=session.message_properties(correlation_id=self.getMessageProperty(msg, 'correlation_id'))
- session.message_transfer(message=Message(dp, mp, msg.body))
-
- def assertMessageCount(self, expected, queue):
- self.assertEqual(expected, self.session.queue_query(queue=queue).message_count)
-
- def assertMessageId(self, expected, queue):
- self.session.message_subscribe(queue=queue, destination="results")
- self.session.message_flow(destination="results", unit=self.session.credit_unit.message, value=1)
- self.session.message_flow(destination="results", unit=self.session.credit_unit.byte, value=0xFFFFFFFF)
- self.assertEqual(expected, self.getMessageProperty(self.session.incoming("results").get(timeout=1), 'correlation_id'))
- self.session.message_cancel(destination="results")
-
- def getMessageProperty(self, msg, prop):
- for h in msg.headers:
- if hasattr(h, prop): return getattr(h, prop)
- return None
-
- def keepQueuesAlive(self, names):
- session = self.conn.session("nasty", 99)
- for n in names:
- session.queue_declare(queue=n, auto_delete=True)
- session.message_subscribe(destination=n, queue=n)
- return session
-
- def createMessage(self, session, key, id, body):
- dp=session.delivery_properties(routing_key=key)
- mp=session.message_properties(correlation_id=id)
- session.message_transfer(message=Message(dp, mp, body))
diff --git a/M4-RCs/qpid/python/tests_0-10/example.py b/M4-RCs/qpid/python/tests_0-10/example.py
deleted file mode 100644
index 83d208192b..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/example.py
+++ /dev/null
@@ -1,95 +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 qpid.datatypes import Message, RangedSet
-from qpid.testlib import TestBase010
-
-class ExampleTest (TestBase010):
- """
- An example Qpid test, illustrating the unittest framework and the
- python Qpid client. The test class must inherit TestBase. The
- test code uses the Qpid client to interact with a qpid broker and
- verify it behaves as expected.
- """
-
- def test_example(self):
- """
- An example test. Note that test functions must start with 'test_'
- to be recognized by the test framework.
- """
-
- # By inheriting TestBase, self.client is automatically connected
- # and self.session is automatically opened as session(1)
- # Other session methods mimic the protocol.
- session = self.session
-
- # Now we can send regular commands. If you want to see what the method
- # arguments mean or what other commands are available, you can use the
- # python builtin help() method. For example:
- #help(chan)
- #help(chan.exchange_declare)
-
- # If you want browse the available protocol methods without being
- # connected to a live server you can use the amqp-doc utility:
- #
- # Usage amqp-doc [<options>] <spec> [<pattern_1> ... <pattern_n>]
- #
- # Options:
- # -e, --regexp use regex instead of glob when matching
-
- # Now that we know what commands are available we can use them to
- # interact with the server.
-
- # Here we use ordinal arguments.
- session.exchange_declare("test", "direct")
-
- # Here we use keyword arguments.
- session.queue_declare(queue="test-queue", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="test-queue", exchange="test", binding_key="key")
-
- # Call Session.subscribe to register as a consumer.
- # All the protocol methods return a message object. The message object
- # has fields corresponding to the reply method fields, plus a content
- # field that is filled if the reply includes content. In this case the
- # interesting field is the consumer_tag.
- session.message_subscribe(queue="test-queue", destination="consumer_tag")
- session.message_flow(destination="consumer_tag", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="consumer_tag", unit=session.credit_unit.byte, value=0xFFFFFFFF)
-
- # We can use the session.incoming(...) method to access the messages
- # delivered for our consumer_tag.
- queue = session.incoming("consumer_tag")
-
- # Now lets publish a message and see if our consumer gets it. To do
- # this we need to import the Message class.
- delivery_properties = session.delivery_properties(routing_key="key")
- sent = Message(delivery_properties, "Hello World!")
- session.message_transfer(destination="test", message=sent)
-
- # Now we'll wait for the message to arrive. We can use the timeout
- # argument in case the server hangs. By default queue.get() will wait
- # until a message arrives or the connection to the server dies.
- msg = queue.get(timeout=10)
-
- # And check that we got the right response with assertEqual
- self.assertEqual(sent.body, msg.body)
-
- # Now acknowledge the message.
- session.message_accept(RangedSet(msg.id))
-
diff --git a/M4-RCs/qpid/python/tests_0-10/exchange.py b/M4-RCs/qpid/python/tests_0-10/exchange.py
deleted file mode 100644
index 4b5dc78143..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/exchange.py
+++ /dev/null
@@ -1,416 +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.
-#
-
-"""
-Tests for exchange behaviour.
-
-Test classes ending in 'RuleTests' are derived from rules in amqp.xml.
-"""
-
-import Queue, logging, traceback
-from qpid.testlib import TestBase010
-from qpid.datatypes import Message
-from qpid.client import Closed
-from qpid.session import SessionException
-
-
-class TestHelper(TestBase010):
- def setUp(self):
- TestBase010.setUp(self)
- self.queues = []
- self.exchanges = []
-
- def tearDown(self):
- try:
- for ssn, q in self.queues:
- ssn.queue_delete(queue=q)
- for ssn, ex in self.exchanges:
- ssn.exchange_delete(exchange=ex)
- except:
- print "Error on tearDown:"
- print traceback.print_exc()
- TestBase010.tearDown(self)
-
- def createMessage(self, key="", body=""):
- return Message(self.session.delivery_properties(routing_key=key), body)
-
- def getApplicationHeaders(self, msg):
- for h in msg.headers:
- if hasattr(h, 'application_headers'): return getattr(h, 'application_headers')
- return None
-
- def assertPublishGet(self, queue, exchange="", routing_key="", properties=None):
- """
- Publish to exchange and assert queue.get() returns the same message.
- """
- body = self.uniqueString()
- dp=self.session.delivery_properties(routing_key=routing_key)
- mp=self.session.message_properties(application_headers=properties)
- self.session.message_transfer(destination=exchange, message=Message(dp, mp, body))
- msg = queue.get(timeout=1)
- self.assertEqual(body, msg.body)
- if (properties):
- self.assertEqual(properties, self.getApplicationHeaders(msg))
-
- def assertPublishConsume(self, queue="", exchange="", routing_key="", properties=None):
- """
- Publish a message and consume it, assert it comes back intact.
- Return the Queue object used to consume.
- """
- self.assertPublishGet(self.consume(queue), exchange, routing_key, properties)
-
- def assertEmpty(self, queue):
- """Assert that the queue is empty"""
- try:
- queue.get(timeout=1)
- self.fail("Queue is not empty.")
- except Queue.Empty: None # Ignore
-
- def queue_declare(self, session=None, *args, **keys):
- session = session or self.session
- reply = session.queue_declare(*args, **keys)
- self.queues.append((session, keys["queue"]))
- return reply
-
- def exchange_declare(self, session=None, ticket=0, exchange='',
- type='', passive=False, durable=False,
- auto_delete=False,
- arguments={}):
- session = session or self.session
- reply = session.exchange_declare(exchange=exchange, type=type, passive=passive,durable=durable, auto_delete=auto_delete, arguments=arguments)
- self.exchanges.append((session,exchange))
- return reply
-
- def uniqueString(self):
- """Generate a unique string, unique for this TestBase instance"""
- if not "uniqueCounter" in dir(self): self.uniqueCounter = 1;
- return "Test Message " + str(self.uniqueCounter)
-
- def consume(self, queueName):
- """Consume from named queue returns the Queue object."""
- if not "uniqueTag" in dir(self): self.uniqueTag = 1
- else: self.uniqueTag += 1
- consumer_tag = "tag" + str(self.uniqueTag)
- self.session.message_subscribe(queue=queueName, destination=consumer_tag)
- self.session.message_flow(destination=consumer_tag, unit=self.session.credit_unit.message, value=0xFFFFFFFF)
- self.session.message_flow(destination=consumer_tag, unit=self.session.credit_unit.byte, value=0xFFFFFFFF)
- return self.session.incoming(consumer_tag)
-
-
-class StandardExchangeVerifier:
- """Verifies standard exchange behavior.
-
- Used as base class for classes that test standard exchanges."""
-
- def verifyDirectExchange(self, ex):
- """Verify that ex behaves like a direct exchange."""
- self.queue_declare(queue="q")
- self.session.exchange_bind(queue="q", exchange=ex, binding_key="k")
- self.assertPublishConsume(exchange=ex, queue="q", routing_key="k")
- try:
- self.assertPublishConsume(exchange=ex, queue="q", routing_key="kk")
- self.fail("Expected Empty exception")
- except Queue.Empty: None # Expected
-
- def verifyFanOutExchange(self, ex):
- """Verify that ex behaves like a fanout exchange."""
- self.queue_declare(queue="q")
- self.session.exchange_bind(queue="q", exchange=ex)
- self.queue_declare(queue="p")
- self.session.exchange_bind(queue="p", exchange=ex)
- for qname in ["q", "p"]: self.assertPublishGet(self.consume(qname), ex)
-
- def verifyTopicExchange(self, ex):
- """Verify that ex behaves like a topic exchange"""
- self.queue_declare(queue="a")
- self.session.exchange_bind(queue="a", exchange=ex, binding_key="a.#.b.*")
- q = self.consume("a")
- self.assertPublishGet(q, ex, "a.b.x")
- self.assertPublishGet(q, ex, "a.x.b.x")
- self.assertPublishGet(q, ex, "a.x.x.b.x")
- # Shouldn't match
- self.session.message_transfer(destination=ex, message=self.createMessage("a.b"))
- self.session.message_transfer(destination=ex, message=self.createMessage("a.b.x.y"))
- self.session.message_transfer(destination=ex, message=self.createMessage("x.a.b.x"))
- self.session.message_transfer(destination=ex, message=self.createMessage("a.b"))
- self.assert_(q.empty())
-
- def verifyHeadersExchange(self, ex):
- """Verify that ex is a headers exchange"""
- self.queue_declare(queue="q")
- self.session.exchange_bind(queue="q", exchange=ex, arguments={ "x-match":"all", "name":"fred" , "age":3} )
- q = self.consume("q")
- headers = {"name":"fred", "age":3}
- self.assertPublishGet(q, exchange=ex, properties=headers)
- self.session.message_transfer(destination=ex) # No headers, won't deliver
- self.assertEmpty(q);
-
-
-class RecommendedTypesRuleTests(TestHelper, StandardExchangeVerifier):
- """
- The server SHOULD implement these standard exchange types: topic, headers.
-
- Client attempts to declare an exchange with each of these standard types.
- """
-
- def testDirect(self):
- """Declare and test a direct exchange"""
- self.exchange_declare(0, exchange="d", type="direct")
- self.verifyDirectExchange("d")
-
- def testFanout(self):
- """Declare and test a fanout exchange"""
- self.exchange_declare(0, exchange="f", type="fanout")
- self.verifyFanOutExchange("f")
-
- def testTopic(self):
- """Declare and test a topic exchange"""
- self.exchange_declare(0, exchange="t", type="topic")
- self.verifyTopicExchange("t")
-
- def testHeaders(self):
- """Declare and test a headers exchange"""
- self.exchange_declare(0, exchange="h", type="headers")
- self.verifyHeadersExchange("h")
-
-
-class RequiredInstancesRuleTests(TestHelper, StandardExchangeVerifier):
- """
- The server MUST, in each virtual host, pre-declare an exchange instance
- for each standard exchange type that it implements, where the name of the
- exchange instance is amq. followed by the exchange type name.
-
- Client creates a temporary queue and attempts to bind to each required
- exchange instance (amq.fanout, amq.direct, and amq.topic, amq.match if
- those types are defined).
- """
- def testAmqDirect(self): self.verifyDirectExchange("amq.direct")
-
- def testAmqFanOut(self): self.verifyFanOutExchange("amq.fanout")
-
- def testAmqTopic(self): self.verifyTopicExchange("amq.topic")
-
- def testAmqMatch(self): self.verifyHeadersExchange("amq.match")
-
-class DefaultExchangeRuleTests(TestHelper, StandardExchangeVerifier):
- """
- The server MUST predeclare a direct exchange to act as the default exchange
- for content Publish methods and for default queue bindings.
-
- Client checks that the default exchange is active by specifying a queue
- binding with no exchange name, and publishing a message with a suitable
- routing key but without specifying the exchange name, then ensuring that
- the message arrives in the queue correctly.
- """
- def testDefaultExchange(self):
- # Test automatic binding by queue name.
- self.queue_declare(queue="d")
- self.assertPublishConsume(queue="d", routing_key="d")
- # Test explicit bind to default queue
- self.verifyDirectExchange("")
-
-
-# TODO aconway 2006-09-27: Fill in empty tests:
-
-class DefaultAccessRuleTests(TestHelper):
- """
- The server MUST NOT allow clients to access the default exchange except
- by specifying an empty exchange name in the Queue.Bind and content Publish
- methods.
- """
-
-class ExtensionsRuleTests(TestHelper):
- """
- The server MAY implement other exchange types as wanted.
- """
-
-
-class DeclareMethodMinimumRuleTests(TestHelper):
- """
- The server SHOULD support a minimum of 16 exchanges per virtual host and
- ideally, impose no limit except as defined by available resources.
-
- The client creates as many exchanges as it can until the server reports
- an error; the number of exchanges successfuly created must be at least
- sixteen.
- """
-
-
-class DeclareMethodTicketFieldValidityRuleTests(TestHelper):
- """
- The client MUST provide a valid access ticket giving "active" access to
- the realm in which the exchange exists or will be created, or "passive"
- access if the if-exists flag is set.
-
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- """
-
-
-class DeclareMethodExchangeFieldReservedRuleTests(TestHelper):
- """
- Exchange names starting with "amq." are reserved for predeclared and
- standardised exchanges. The client MUST NOT attempt to create an exchange
- starting with "amq.".
-
-
- """
-
-
-class DeclareMethodTypeFieldTypedRuleTests(TestHelper):
- """
- Exchanges cannot be redeclared with different types. The client MUST not
- attempt to redeclare an existing exchange with a different type than used
- in the original Exchange.Declare method.
-
-
- """
-
-
-class DeclareMethodTypeFieldSupportRuleTests(TestHelper):
- """
- The client MUST NOT attempt to create an exchange with a type that the
- server does not support.
-
-
- """
-
-
-class DeclareMethodPassiveFieldNotFoundRuleTests(TestHelper):
- """
- If set, and the exchange does not already exist, the server MUST raise a
- channel exception with reply code 404 (not found).
- """
- def test(self):
- try:
- self.session.exchange_declare(exchange="humpty_dumpty", passive=True)
- self.fail("Expected 404 for passive declaration of unknown exchange.")
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
-
-class DeclareMethodDurableFieldSupportRuleTests(TestHelper):
- """
- The server MUST support both durable and transient exchanges.
-
-
- """
-
-
-class DeclareMethodDurableFieldStickyRuleTests(TestHelper):
- """
- The server MUST ignore the durable field if the exchange already exists.
-
-
- """
-
-
-class DeclareMethodAutoDeleteFieldStickyRuleTests(TestHelper):
- """
- The server MUST ignore the auto-delete field if the exchange already
- exists.
-
-
- """
-
-
-class DeleteMethodTicketFieldValidityRuleTests(TestHelper):
- """
- The client MUST provide a valid access ticket giving "active" access
- rights to the exchange's access realm.
-
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- """
-
-
-class DeleteMethodExchangeFieldExistsRuleTests(TestHelper):
- """
- The client MUST NOT attempt to delete an exchange that does not exist.
- """
-
-
-class HeadersExchangeTests(TestHelper):
- """
- Tests for headers exchange functionality.
- """
- def setUp(self):
- TestHelper.setUp(self)
- self.queue_declare(queue="q")
- self.q = self.consume("q")
-
- def myAssertPublishGet(self, headers):
- self.assertPublishGet(self.q, exchange="amq.match", properties=headers)
-
- def myBasicPublish(self, headers):
- mp=self.session.message_properties(application_headers=headers)
- self.session.message_transfer(destination="amq.match", message=Message(mp, "foobar"))
-
- def testMatchAll(self):
- self.session.exchange_bind(queue="q", exchange="amq.match", arguments={ 'x-match':'all', "name":"fred", "age":3})
- self.myAssertPublishGet({"name":"fred", "age":3})
- self.myAssertPublishGet({"name":"fred", "age":3, "extra":"ignoreme"})
-
- # None of these should match
- self.myBasicPublish({})
- self.myBasicPublish({"name":"barney"})
- self.myBasicPublish({"name":10})
- self.myBasicPublish({"name":"fred", "age":2})
- self.assertEmpty(self.q)
-
- def testMatchAny(self):
- self.session.exchange_bind(queue="q", exchange="amq.match", arguments={ 'x-match':'any', "name":"fred", "age":3})
- self.myAssertPublishGet({"name":"fred"})
- self.myAssertPublishGet({"name":"fred", "ignoreme":10})
- self.myAssertPublishGet({"ignoreme":10, "age":3})
-
- # Wont match
- self.myBasicPublish({})
- self.myBasicPublish({"irrelevant":0})
- self.assertEmpty(self.q)
-
-
-class MiscellaneousErrorsTests(TestHelper):
- """
- Test some miscellaneous error conditions
- """
- def testTypeNotKnown(self):
- try:
- self.session.exchange_declare(exchange="test_type_not_known_exchange", type="invalid_type")
- self.fail("Expected 503 for declaration of unknown exchange type.")
- except SessionException, e:
- self.assertEquals(503, e.args[0].error_code)
-
- def testDifferentDeclaredType(self):
- self.exchange_declare(exchange="test_different_declared_type_exchange", type="direct")
- try:
- session = self.conn.session("alternate", 2)
- session.exchange_declare(exchange="test_different_declared_type_exchange", type="topic")
- self.fail("Expected 530 for redeclaration of exchange with different type.")
- except SessionException, e:
- self.assertEquals(530, e.args[0].error_code)
-
-class ExchangeTests(TestHelper):
- def testHeadersBindNoMatchArg(self):
- self.session.queue_declare(queue="q", exclusive=True, auto_delete=True)
- try:
- self.session.exchange_bind(queue="q", exchange="amq.match", arguments={"name":"fred" , "age":3} )
- self.fail("Expected failure for missing x-match arg.")
- except SessionException, e:
- self.assertEquals(541, e.args[0].error_code)
diff --git a/M4-RCs/qpid/python/tests_0-10/management.py b/M4-RCs/qpid/python/tests_0-10/management.py
deleted file mode 100644
index 0632d85da4..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/management.py
+++ /dev/null
@@ -1,240 +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 qpid.datatypes import Message, RangedSet
-from qpid.testlib import TestBase010
-from qpid.management import managementChannel, managementClient
-
-class ManagementTest (TestBase010):
- """
- Tests for the management hooks
- """
-
- def test_broker_connectivity_oldAPI (self):
- """
- Call the "echo" method on the broker to verify it is alive and talking.
- """
- session = self.session
-
- mc = managementClient (session.spec)
- mch = mc.addChannel (session)
-
- mc.syncWaitForStable (mch)
- brokers = mc.syncGetObjects (mch, "broker")
- self.assertEqual (len (brokers), 1)
- broker = brokers[0]
- args = {}
- body = "Echo Message Body"
- args["body"] = body
-
- for seq in range (1, 5):
- args["sequence"] = seq
- res = mc.syncCallMethod (mch, broker.id, broker.classKey, "echo", args)
- self.assertEqual (res.status, 0)
- self.assertEqual (res.statusText, "OK")
- self.assertEqual (res.sequence, seq)
- self.assertEqual (res.body, body)
- mc.removeChannel (mch)
-
- def test_broker_connectivity (self):
- """
- Call the "echo" method on the broker to verify it is alive and talking.
- """
- session = self.session
- self.startQmf()
-
- brokers = self.qmf.getObjects(_class="broker")
- self.assertEqual (len(brokers), 1)
- broker = brokers[0]
-
- body = "Echo Message Body"
- for seq in range (1, 10):
- res = broker.echo(seq, body)
- self.assertEqual (res.status, 0)
- self.assertEqual (res.text, "OK")
- self.assertEqual (res.sequence, seq)
- self.assertEqual (res.body, body)
-
- def test_get_objects(self):
- self.startQmf()
-
- # get the package list, verify that the qpid broker package is there
- packages = self.qmf.getPackages()
- assert 'org.apache.qpid.broker' in packages
-
- # get the schema class keys for the broker, verify the broker table and link-down event
- keys = self.qmf.getClasses('org.apache.qpid.broker')
- broker = None
- linkDown = None
- for key in keys:
- if key.getClassName() == "broker": broker = key
- if key.getClassName() == "brokerLinkDown" : linkDown = key
- assert broker
- assert linkDown
-
- brokerObjs = self.qmf.getObjects(_class="broker")
- assert len(brokerObjs) == 1
- brokerObjs = self.qmf.getObjects(_key=broker)
- assert len(brokerObjs) == 1
-
- def test_self_session_id (self):
- self.startQmf()
- sessionId = self.qmf_broker.getSessionId()
- brokerSessions = self.qmf.getObjects(_class="session")
-
- found = False
- for bs in brokerSessions:
- if bs.name == sessionId:
- found = True
- self.assertEqual (found, True)
-
- def test_standard_exchanges (self):
- self.startQmf()
-
- exchanges = self.qmf.getObjects(_class="exchange")
- exchange = self.findExchange (exchanges, "")
- self.assertEqual (exchange.type, "direct")
- exchange = self.findExchange (exchanges, "amq.direct")
- self.assertEqual (exchange.type, "direct")
- exchange = self.findExchange (exchanges, "amq.topic")
- self.assertEqual (exchange.type, "topic")
- exchange = self.findExchange (exchanges, "amq.fanout")
- self.assertEqual (exchange.type, "fanout")
- exchange = self.findExchange (exchanges, "amq.match")
- self.assertEqual (exchange.type, "headers")
- exchange = self.findExchange (exchanges, "qpid.management")
- self.assertEqual (exchange.type, "topic")
-
- def findExchange (self, exchanges, name):
- for exchange in exchanges:
- if exchange.name == name:
- return exchange
- return None
-
- def test_move_queued_messages(self):
- """
- Test ability to move messages from the head of one queue to another.
- Need to test moveing all and N messages.
- """
- self.startQmf()
- session = self.session
- "Set up source queue"
- session.queue_declare(queue="src-queue", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="src-queue", exchange="amq.direct", binding_key="routing_key")
-
- twenty = range(1,21)
- props = session.delivery_properties(routing_key="routing_key")
- for count in twenty:
- body = "Move Message %d" % count
- src_msg = Message(props, body)
- session.message_transfer(destination="amq.direct", message=src_msg)
-
- "Set up destination queue"
- session.queue_declare(queue="dest-queue", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="dest-queue", exchange="amq.direct")
-
- queues = self.qmf.getObjects(_class="queue")
-
- "Move 10 messages from src-queue to dest-queue"
- result = self.qmf.getObjects(_class="broker")[0].queueMoveMessages("src-queue", "dest-queue", 10)
- self.assertEqual (result.status, 0)
-
- sq = self.qmf.getObjects(_class="queue", name="src-queue")[0]
- dq = self.qmf.getObjects(_class="queue", name="dest-queue")[0]
-
- self.assertEqual (sq.msgDepth,10)
- self.assertEqual (dq.msgDepth,10)
-
- "Move all remaining messages to destination"
- result = self.qmf.getObjects(_class="broker")[0].queueMoveMessages("src-queue", "dest-queue", 0)
- self.assertEqual (result.status,0)
-
- sq = self.qmf.getObjects(_class="queue", name="src-queue")[0]
- dq = self.qmf.getObjects(_class="queue", name="dest-queue")[0]
-
- self.assertEqual (sq.msgDepth,0)
- self.assertEqual (dq.msgDepth,20)
-
- "Use a bad source queue name"
- result = self.qmf.getObjects(_class="broker")[0].queueMoveMessages("bad-src-queue", "dest-queue", 0)
- self.assertEqual (result.status,4)
-
- "Use a bad destination queue name"
- result = self.qmf.getObjects(_class="broker")[0].queueMoveMessages("src-queue", "bad-dest-queue", 0)
- self.assertEqual (result.status,4)
-
- " Use a large qty (40) to move from dest-queue back to "
- " src-queue- should move all "
- result = self.qmf.getObjects(_class="broker")[0].queueMoveMessages("dest-queue", "src-queue", 40)
- self.assertEqual (result.status,0)
-
- sq = self.qmf.getObjects(_class="queue", name="src-queue")[0]
- dq = self.qmf.getObjects(_class="queue", name="dest-queue")[0]
-
- self.assertEqual (sq.msgDepth,20)
- self.assertEqual (dq.msgDepth,0)
-
- "Consume the messages of the queue and check they are all there in order"
- session.message_subscribe(queue="src-queue", destination="tag")
- session.message_flow(destination="tag", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="tag", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- queue = session.incoming("tag")
- for count in twenty:
- consumed_msg = queue.get(timeout=1)
- body = "Move Message %d" % count
- self.assertEqual(body, consumed_msg.body)
-
- def test_purge_queue(self):
- """
- Test ability to purge messages from the head of a queue.
- Need to test moveing all, 1 (top message) and N messages.
- """
- self.startQmf()
- session = self.session
- "Set up purge queue"
- session.queue_declare(queue="purge-queue", exclusive=True, auto_delete=True)
- session.exchange_bind(queue="purge-queue", exchange="amq.direct", binding_key="routing_key")
-
- twenty = range(1,21)
- props = session.delivery_properties(routing_key="routing_key")
- for count in twenty:
- body = "Purge Message %d" % count
- msg = Message(props, body)
- session.message_transfer(destination="amq.direct", message=msg)
-
- pq = self.qmf.getObjects(_class="queue", name="purge-queue")[0]
-
- "Purge top message from purge-queue"
- result = pq.purge(1)
- self.assertEqual (result.status, 0)
- pq = self.qmf.getObjects(_class="queue", name="purge-queue")[0]
- self.assertEqual (pq.msgDepth,19)
-
- "Purge top 9 messages from purge-queue"
- result = pq.purge(9)
- self.assertEqual (result.status, 0)
- pq = self.qmf.getObjects(_class="queue", name="purge-queue")[0]
- self.assertEqual (pq.msgDepth,10)
-
- "Purge all messages from purge-queue"
- result = pq.purge(0)
- self.assertEqual (result.status, 0)
- pq = self.qmf.getObjects(_class="queue", name="purge-queue")[0]
- self.assertEqual (pq.msgDepth,0)
-
diff --git a/M4-RCs/qpid/python/tests_0-10/message.py b/M4-RCs/qpid/python/tests_0-10/message.py
deleted file mode 100644
index cbcef5602f..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/message.py
+++ /dev/null
@@ -1,847 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.testlib import TestBase010
-from qpid.datatypes import Message, RangedSet
-from qpid.session import SessionException
-
-from qpid.content import Content
-from time import sleep
-
-class MessageTests(TestBase010):
- """Tests for 'methods' on the amqp message 'class'"""
-
- def test_no_local(self):
- """
- NOTE: this is a test of a QPID specific feature
-
- Test that the qpid specific no_local arg is honoured.
- """
- session = self.session
- #setup, declare two queues one of which excludes delivery of locally sent messages
- session.queue_declare(queue="test-queue-1a", exclusive=True, auto_delete=True)
- session.queue_declare(queue="test-queue-1b", exclusive=True, auto_delete=True, arguments={'no-local':'true'})
- #establish two consumers
- self.subscribe(destination="local_included", queue="test-queue-1a")
- self.subscribe(destination="local_excluded", queue="test-queue-1b")
-
- #send a message
- session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue-1a"), "deliver-me"))
- session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue-1b"), "dont-deliver-me"))
-
- #send a message from another session on the same connection to each queue
- session2 = self.conn.session("my-local-session")
- session2.message_transfer(message=Message(session2.delivery_properties(routing_key="test-queue-1a"), "deliver-me-as-well"))
- session2.message_transfer(message=Message(session2.delivery_properties(routing_key="test-queue-1b"), "dont-deliver-me-either"))
-
- #send a message from a session on another connection to each queue
- for q in ["test-queue-1a", "test-queue-1b"]:
- session.exchange_bind(queue=q, exchange="amq.fanout", binding_key="my-key")
- other = self.connect()
- session3 = other.session("my-other-session")
- session3.message_transfer(destination="amq.fanout", message=Message("i-am-not-local"))
- other.close()
-
- #check the queues of the two consumers
- excluded = session.incoming("local_excluded")
- included = session.incoming("local_included")
- for b in ["deliver-me", "deliver-me-as-well", "i-am-not-local"]:
- msg = included.get(timeout=1)
- self.assertEqual(b, msg.body)
- msg = excluded.get(timeout=1)
- self.assertEqual("i-am-not-local", msg.body)
- try:
- excluded.get(timeout=1)
- self.fail("Received locally published message though no_local=true")
- except Empty: None
-
- def test_no_local_awkward(self):
-
- """
- NOTE: this is a test of a QPID specific feature
-
- Check that messages which will be excluded through no-local
- processing will not block subsequent deliveries
- """
-
- session = self.session
- #setup:
- session.queue_declare(queue="test-queue", exclusive=True, auto_delete=True, arguments={'no-local':'true'})
- #establish consumer which excludes delivery of locally sent messages
- self.subscribe(destination="local_excluded", queue="test-queue")
-
- #send a 'local' message
- session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue"), "local"))
-
- #send a non local message
- other = self.connect()
- session2 = other.session("my-session", 1)
- session2.message_transfer(message=Message(session2.delivery_properties(routing_key="test-queue"), "foreign"))
- session2.close()
- other.close()
-
- #check that the second message only is delivered
- excluded = session.incoming("local_excluded")
- msg = excluded.get(timeout=1)
- self.assertEqual("foreign", msg.body)
- try:
- excluded.get(timeout=1)
- self.fail("Received extra message")
- except Empty: None
- #check queue is empty
- self.assertEqual(0, session.queue_query(queue="test-queue").message_count)
-
- def test_no_local_exclusive_subscribe(self):
- """
- NOTE: this is a test of a QPID specific feature
-
- Test that the no_local processing works on queues not declared
- as exclusive, but with an exclusive subscription
- """
- session = self.session
-
- #setup, declare two queues one of which excludes delivery of
- #locally sent messages but is not declared as exclusive
- session.queue_declare(queue="test-queue-1a", exclusive=True, auto_delete=True)
- session.queue_declare(queue="test-queue-1b", auto_delete=True, arguments={'no-local':'true'})
- #establish two consumers
- self.subscribe(destination="local_included", queue="test-queue-1a")
- self.subscribe(destination="local_excluded", queue="test-queue-1b", exclusive=True)
-
- #send a message from the same session to each queue
- session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue-1a"), "deliver-me"))
- session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue-1b"), "dont-deliver-me"))
-
- #send a message from another session on the same connection to each queue
- session2 = self.conn.session("my-session")
- session2.message_transfer(message=Message(session2.delivery_properties(routing_key="test-queue-1a"), "deliver-me-as-well"))
- session2.message_transfer(message=Message(session2.delivery_properties(routing_key="test-queue-1b"), "dont-deliver-me-either"))
-
- #send a message from a session on another connection to each queue
- for q in ["test-queue-1a", "test-queue-1b"]:
- session.exchange_bind(queue=q, exchange="amq.fanout", binding_key="my-key")
- other = self.connect()
- session3 = other.session("my-other-session")
- session3.message_transfer(destination="amq.fanout", message=Message("i-am-not-local"))
- other.close()
-
- #check the queues of the two consumers
- excluded = session.incoming("local_excluded")
- included = session.incoming("local_included")
- for b in ["deliver-me", "deliver-me-as-well", "i-am-not-local"]:
- msg = included.get(timeout=1)
- self.assertEqual(b, msg.body)
- msg = excluded.get(timeout=1)
- self.assertEqual("i-am-not-local", msg.body)
- try:
- excluded.get(timeout=1)
- self.fail("Received locally published message though no_local=true")
- except Empty: None
-
-
- def test_consume_exclusive(self):
- """
- Test an exclusive consumer prevents other consumer being created
- """
- session = self.session
- session.queue_declare(queue="test-queue-2", exclusive=True, auto_delete=True)
- session.message_subscribe(destination="first", queue="test-queue-2", exclusive=True)
- try:
- session.message_subscribe(destination="second", queue="test-queue-2")
- self.fail("Expected consume request to fail due to previous exclusive consumer")
- except SessionException, e:
- self.assertEquals(405, e.args[0].error_code)
-
- def test_consume_exclusive2(self):
- """
- Check that an exclusive consumer cannot be created if a consumer already exists:
- """
- session = self.session
- session.queue_declare(queue="test-queue-2", exclusive=True, auto_delete=True)
- session.message_subscribe(destination="first", queue="test-queue-2")
- try:
- session.message_subscribe(destination="second", queue="test-queue-2", exclusive=True)
- self.fail("Expected exclusive consume request to fail due to previous consumer")
- except SessionException, e:
- self.assertEquals(405, e.args[0].error_code)
-
- def test_consume_queue_not_found(self):
- """
- Test error conditions associated with the queue field of the consume method:
- """
- session = self.session
- try:
- #queue specified but doesn't exist:
- session.message_subscribe(queue="invalid-queue", destination="a")
- self.fail("Expected failure when consuming from non-existent queue")
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
- def test_consume_queue_not_specified(self):
- session = self.session
- try:
- #queue not specified and none previously declared for channel:
- session.message_subscribe(destination="a")
- self.fail("Expected failure when consuming from unspecified queue")
- except SessionException, e:
- self.assertEquals(531, e.args[0].error_code)
-
- def test_consume_unique_consumers(self):
- """
- Ensure unique consumer tags are enforced
- """
- session = self.session
- #setup, declare a queue:
- session.queue_declare(queue="test-queue-3", exclusive=True, auto_delete=True)
-
- #check that attempts to use duplicate tags are detected and prevented:
- session.message_subscribe(destination="first", queue="test-queue-3")
- try:
- session.message_subscribe(destination="first", queue="test-queue-3")
- self.fail("Expected consume request to fail due to non-unique tag")
- except SessionException, e:
- self.assertEquals(530, e.args[0].error_code)
-
- def test_cancel(self):
- """
- Test compliance of the basic.cancel method
- """
- session = self.session
- #setup, declare a queue:
- session.queue_declare(queue="test-queue-4", exclusive=True, auto_delete=True)
- session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue-4"), "One"))
-
- session.message_subscribe(destination="my-consumer", queue="test-queue-4")
- myqueue = session.incoming("my-consumer")
- session.message_flow(destination="my-consumer", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="my-consumer", unit=session.credit_unit.byte, value=0xFFFFFFFF)
-
- #should flush here
-
- #cancel should stop messages being delivered
- session.message_cancel(destination="my-consumer")
- session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue-4"), "Two"))
- msg = myqueue.get(timeout=1)
- self.assertEqual("One", msg.body)
- try:
- msg = myqueue.get(timeout=1)
- self.fail("Got message after cancellation: " + msg)
- except Empty: None
-
- #cancellation of non-existant consumers should be handled without error
- session.message_cancel(destination="my-consumer")
- session.message_cancel(destination="this-never-existed")
-
-
- def test_ack(self):
- """
- Test basic ack/recover behaviour
- """
- session = self.conn.session("alternate-session", timeout=10)
- session.queue_declare(queue="test-ack-queue", auto_delete=True)
-
- session.message_subscribe(queue = "test-ack-queue", destination = "consumer")
- session.message_flow(destination="consumer", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="consumer", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- queue = session.incoming("consumer")
-
- delivery_properties = session.delivery_properties(routing_key="test-ack-queue")
- for i in ["One", "Two", "Three", "Four", "Five"]:
- session.message_transfer(message=Message(delivery_properties, i))
-
- msg1 = queue.get(timeout=1)
- msg2 = queue.get(timeout=1)
- msg3 = queue.get(timeout=1)
- msg4 = queue.get(timeout=1)
- msg5 = queue.get(timeout=1)
-
- self.assertEqual("One", msg1.body)
- self.assertEqual("Two", msg2.body)
- self.assertEqual("Three", msg3.body)
- self.assertEqual("Four", msg4.body)
- self.assertEqual("Five", msg5.body)
-
- session.message_accept(RangedSet(msg1.id, msg2.id, msg4.id))#One, Two and Four
-
- #subscribe from second session here to ensure queue is not
- #auto-deleted when alternate session closes (no need to ack on these):
- self.session.message_subscribe(queue = "test-ack-queue", destination = "checker", accept_mode=1)
-
- #now close the session, and see that the unacked messages are
- #then redelivered to another subscriber:
- session.close(timeout=10)
-
- session = self.session
- session.message_flow(destination="checker", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="checker", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- queue = session.incoming("checker")
-
- msg3b = queue.get(timeout=1)
- msg5b = queue.get(timeout=1)
-
- self.assertEqual("Three", msg3b.body)
- self.assertEqual("Five", msg5b.body)
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- def test_reject(self):
- session = self.session
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True, alternate_exchange="amq.fanout")
- session.queue_declare(queue = "r", exclusive=True, auto_delete=True)
- session.exchange_bind(queue = "r", exchange = "amq.fanout")
-
- session.message_subscribe(queue = "q", destination = "consumer")
- session.message_flow(destination="consumer", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="consumer", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "blah, blah"))
- msg = session.incoming("consumer").get(timeout = 1)
- self.assertEquals(msg.body, "blah, blah")
- session.message_reject(RangedSet(msg.id))
-
- session.message_subscribe(queue = "r", destination = "checker")
- session.message_flow(destination="checker", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="checker", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- msg = session.incoming("checker").get(timeout = 1)
- self.assertEquals(msg.body, "blah, blah")
-
- def test_credit_flow_messages(self):
- """
- Test basic credit based flow control with unit = message
- """
- #declare an exclusive queue
- session = self.session
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
- #create consumer (for now that defaults to infinite credit)
- session.message_subscribe(queue = "q", destination = "c")
- session.message_set_flow_mode(flow_mode = 0, destination = "c")
- #send batch of messages to queue
- for i in range(1, 11):
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "Message %d" % i))
-
- #set message credit to finite amount (less than enough for all messages)
- session.message_flow(unit = session.credit_unit.message, value = 5, destination = "c")
- #set infinite byte credit
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "c")
- #check that expected number were received
- q = session.incoming("c")
- for i in range(1, 6):
- self.assertDataEquals(session, q.get(timeout = 1), "Message %d" % i)
- self.assertEmpty(q)
-
- #increase credit again and check more are received
- for i in range(6, 11):
- session.message_flow(unit = session.credit_unit.message, value = 1, destination = "c")
- self.assertDataEquals(session, q.get(timeout = 1), "Message %d" % i)
- self.assertEmpty(q)
-
- def test_credit_flow_bytes(self):
- """
- Test basic credit based flow control with unit = bytes
- """
- #declare an exclusive queue
- session = self.session
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
- #create consumer (for now that defaults to infinite credit)
- session.message_subscribe(queue = "q", destination = "c")
- session.message_set_flow_mode(flow_mode = 0, destination = "c")
- #send batch of messages to queue
- for i in range(10):
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "abcdefgh"))
-
- #each message is currently interpreted as requiring msg_size bytes of credit
- msg_size = 19
-
- #set byte credit to finite amount (less than enough for all messages)
- session.message_flow(unit = session.credit_unit.byte, value = msg_size*5, destination = "c")
- #set infinite message credit
- session.message_flow(unit = session.credit_unit.message, value = 0xFFFFFFFF, destination = "c")
- #check that expected number were received
- q = session.incoming("c")
- for i in range(5):
- self.assertDataEquals(session, q.get(timeout = 1), "abcdefgh")
- self.assertEmpty(q)
-
- #increase credit again and check more are received
- for i in range(5):
- session.message_flow(unit = session.credit_unit.byte, value = msg_size, destination = "c")
- self.assertDataEquals(session, q.get(timeout = 1), "abcdefgh")
- self.assertEmpty(q)
-
-
- def test_window_flow_messages(self):
- """
- Test basic window based flow control with unit = message
- """
- #declare an exclusive queue
- session = self.session
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
- #create consumer (for now that defaults to infinite credit)
- session.message_subscribe(queue = "q", destination = "c")
- session.message_set_flow_mode(flow_mode = 1, destination = "c")
- #send batch of messages to queue
- for i in range(1, 11):
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "Message %d" % i))
-
- #set message credit to finite amount (less than enough for all messages)
- session.message_flow(unit = session.credit_unit.message, value = 5, destination = "c")
- #set infinite byte credit
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "c")
- #check that expected number were received
- q = session.incoming("c")
- for i in range(1, 6):
- msg = q.get(timeout = 1)
- session.receiver._completed.add(msg.id)#TODO: this may be done automatically
- self.assertDataEquals(session, msg, "Message %d" % i)
- self.assertEmpty(q)
-
- #acknowledge messages and check more are received
- #TODO: there may be a nicer way of doing this
- session.channel.session_completed(session.receiver._completed)
-
- for i in range(6, 11):
- self.assertDataEquals(session, q.get(timeout = 1), "Message %d" % i)
- self.assertEmpty(q)
-
-
- def test_window_flow_bytes(self):
- """
- Test basic window based flow control with unit = bytes
- """
- #declare an exclusive queue
- session = self.session
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
- #create consumer (for now that defaults to infinite credit)
- session.message_subscribe(queue = "q", destination = "c")
- session.message_set_flow_mode(flow_mode = 1, destination = "c")
- #send batch of messages to queue
- for i in range(10):
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "abcdefgh"))
-
- #each message is currently interpreted as requiring msg_size bytes of credit
- msg_size = 19
-
- #set byte credit to finite amount (less than enough for all messages)
- session.message_flow(unit = session.credit_unit.byte, value = msg_size*5, destination = "c")
- #set infinite message credit
- session.message_flow(unit = session.credit_unit.message, value = 0xFFFFFFFF, destination = "c")
- #check that expected number were received
- q = session.incoming("c")
- msgs = []
- for i in range(5):
- msg = q.get(timeout = 1)
- msgs.append(msg)
- self.assertDataEquals(session, msg, "abcdefgh")
- self.assertEmpty(q)
-
- #ack each message individually and check more are received
- for i in range(5):
- msg = msgs.pop()
- #TODO: there may be a nicer way of doing this
- session.receiver._completed.add(msg.id)
- session.channel.session_completed(session.receiver._completed)
- self.assertDataEquals(session, q.get(timeout = 1), "abcdefgh")
- self.assertEmpty(q)
-
- def test_subscribe_not_acquired(self):
- """
- Test the not-acquired modes works as expected for a simple case
- """
- session = self.session
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
- for i in range(1, 6):
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "Message %s" % i))
-
- session.message_subscribe(queue = "q", destination = "a", acquire_mode = 1)
- session.message_flow(unit = session.credit_unit.message, value = 0xFFFFFFFF, destination = "a")
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "a")
- session.message_subscribe(queue = "q", destination = "b", acquire_mode = 1)
- session.message_flow(unit = session.credit_unit.message, value = 0xFFFFFFFF, destination = "b")
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "b")
-
- for i in range(6, 11):
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "Message %s" % i))
-
- #both subscribers should see all messages
- qA = session.incoming("a")
- qB = session.incoming("b")
- for i in range(1, 11):
- for q in [qA, qB]:
- msg = q.get(timeout = 1)
- self.assertEquals("Message %s" % i, msg.body)
- #TODO: tidy up completion
- session.receiver._completed.add(msg.id)
-
- #TODO: tidy up completion
- session.channel.session_completed(session.receiver._completed)
- #messages should still be on the queue:
- self.assertEquals(10, session.queue_query(queue = "q").message_count)
-
- def test_acquire_with_no_accept_and_credit_flow(self):
- """
- Test that messages recieved unacquired, with accept not
- required in windowing mode can be acquired.
- """
- session = self.session
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
-
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "acquire me"))
-
- session.message_subscribe(queue = "q", destination = "a", acquire_mode = 1, accept_mode = 1)
- session.message_set_flow_mode(flow_mode = session.flow_mode.credit, destination = "a")
- session.message_flow(unit = session.credit_unit.message, value = 0xFFFFFFFF, destination = "a")
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "a")
- msg = session.incoming("a").get(timeout = 1)
- self.assertEquals("acquire me", msg.body)
- #message should still be on the queue:
- self.assertEquals(1, session.queue_query(queue = "q").message_count)
-
- transfers = RangedSet(msg.id)
- response = session.message_acquire(transfers)
- #check that we get notification (i.e. message_acquired)
- self.assert_(msg.id in response.transfers)
- #message should have been removed from the queue:
- self.assertEquals(0, session.queue_query(queue = "q").message_count)
-
- def test_acquire(self):
- """
- Test explicit acquire function
- """
- session = self.session
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
-
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "acquire me"))
-
- session.message_subscribe(queue = "q", destination = "a", acquire_mode = 1)
- session.message_flow(destination="a", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="a", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- msg = session.incoming("a").get(timeout = 1)
- self.assertEquals("acquire me", msg.body)
- #message should still be on the queue:
- self.assertEquals(1, session.queue_query(queue = "q").message_count)
-
- transfers = RangedSet(msg.id)
- response = session.message_acquire(transfers)
- #check that we get notification (i.e. message_acquired)
- self.assert_(msg.id in response.transfers)
- #message should have been removed from the queue:
- self.assertEquals(0, session.queue_query(queue = "q").message_count)
- session.message_accept(transfers)
-
-
- def test_release(self):
- """
- Test explicit release function
- """
- session = self.session
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
-
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "release me"))
-
- session.message_subscribe(queue = "q", destination = "a")
- session.message_flow(destination="a", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="a", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- msg = session.incoming("a").get(timeout = 1)
- self.assertEquals("release me", msg.body)
- session.message_cancel(destination = "a")
- session.message_release(RangedSet(msg.id))
-
- #message should not have been removed from the queue:
- self.assertEquals(1, session.queue_query(queue = "q").message_count)
-
- def test_release_ordering(self):
- """
- Test order of released messages is as expected
- """
- session = self.session
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
- for i in range (1, 11):
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "released message %s" % (i)))
-
- session.message_subscribe(queue = "q", destination = "a")
- session.message_flow(unit = session.credit_unit.message, value = 10, destination = "a")
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "a")
- queue = session.incoming("a")
- first = queue.get(timeout = 1)
- for i in range(2, 10):
- msg = queue.get(timeout = 1)
- self.assertEquals("released message %s" % (i), msg.body)
-
- last = queue.get(timeout = 1)
- self.assertEmpty(queue)
- released = RangedSet()
- released.add(first.id, last.id)
- session.message_release(released)
-
- #TODO: may want to clean this up...
- session.receiver._completed.add(first.id, last.id)
- session.channel.session_completed(session.receiver._completed)
-
- for i in range(1, 11):
- self.assertEquals("released message %s" % (i), queue.get(timeout = 1).body)
-
- def test_ranged_ack(self):
- """
- Test acking of messages ranges
- """
- session = self.conn.session("alternate-session", timeout=10)
-
- session.queue_declare(queue = "q", auto_delete=True)
- delivery_properties = session.delivery_properties(routing_key="q")
- for i in range (1, 11):
- session.message_transfer(message=Message(delivery_properties, "message %s" % (i)))
-
- session.message_subscribe(queue = "q", destination = "a")
- session.message_flow(unit = session.credit_unit.message, value = 10, destination = "a")
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "a")
- queue = session.incoming("a")
- ids = []
- for i in range (1, 11):
- msg = queue.get(timeout = 1)
- self.assertEquals("message %s" % (i), msg.body)
- ids.append(msg.id)
-
- self.assertEmpty(queue)
-
- #ack all but the fourth message (command id 2)
- accepted = RangedSet()
- accepted.add(ids[0], ids[2])
- accepted.add(ids[4], ids[9])
- session.message_accept(accepted)
-
- #subscribe from second session here to ensure queue is not
- #auto-deleted when alternate session closes (no need to ack on these):
- self.session.message_subscribe(queue = "q", destination = "checker")
-
- #now close the session, and see that the unacked messages are
- #then redelivered to another subscriber:
- session.close(timeout=10)
-
- session = self.session
- session.message_flow(destination="checker", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="checker", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- queue = session.incoming("checker")
-
- self.assertEquals("message 4", queue.get(timeout = 1).body)
- self.assertEmpty(queue)
-
- def test_subscribe_not_acquired_2(self):
- session = self.session
-
- #publish some messages
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
- for i in range(1, 11):
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "message-%d" % (i)))
-
- #consume some of them
- session.message_subscribe(queue = "q", destination = "a")
- session.message_set_flow_mode(flow_mode = 0, destination = "a")
- session.message_flow(unit = session.credit_unit.message, value = 5, destination = "a")
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "a")
-
- queue = session.incoming("a")
- for i in range(1, 6):
- msg = queue.get(timeout = 1)
- self.assertEquals("message-%d" % (i), msg.body)
- #complete and accept
- session.message_accept(RangedSet(msg.id))
- #TODO: tidy up completion
- session.receiver._completed.add(msg.id)
- session.channel.session_completed(session.receiver._completed)
- self.assertEmpty(queue)
-
- #now create a not-acquired subscriber
- session.message_subscribe(queue = "q", destination = "b", acquire_mode=1)
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "b")
-
- #check it gets those not consumed
- queue = session.incoming("b")
- session.message_flow(unit = session.credit_unit.message, value = 1, destination = "b")
- for i in range(6, 11):
- msg = queue.get(timeout = 1)
- self.assertEquals("message-%d" % (i), msg.body)
- session.message_release(RangedSet(msg.id))
- #TODO: tidy up completion
- session.receiver._completed.add(msg.id)
- session.channel.session_completed(session.receiver._completed)
- session.message_flow(unit = session.credit_unit.message, value = 1, destination = "b")
- self.assertEmpty(queue)
-
- #check all 'browsed' messages are still on the queue
- self.assertEqual(5, session.queue_query(queue="q").message_count)
-
- def test_subscribe_not_acquired_3(self):
- session = self.session
-
- #publish some messages
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
- for i in range(1, 11):
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "message-%d" % (i)))
-
- #create a not-acquired subscriber
- session.message_subscribe(queue = "q", destination = "a", acquire_mode=1)
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "a")
- session.message_flow(unit = session.credit_unit.message, value = 10, destination = "a")
-
- #browse through messages
- queue = session.incoming("a")
- for i in range(1, 11):
- msg = queue.get(timeout = 1)
- self.assertEquals("message-%d" % (i), msg.body)
- if (i % 2):
- #try to acquire every second message
- response = session.message_acquire(RangedSet(msg.id))
- #check that acquire succeeds
- self.assert_(msg.id in response.transfers)
- session.message_accept(RangedSet(msg.id))
- else:
- session.message_release(RangedSet(msg.id))
- session.receiver._completed.add(msg.id)
- session.channel.session_completed(session.receiver._completed)
- self.assertEmpty(queue)
-
- #create a second not-acquired subscriber
- session.message_subscribe(queue = "q", destination = "b", acquire_mode=1)
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "b")
- session.message_flow(unit = session.credit_unit.message, value = 1, destination = "b")
- #check it gets those not consumed
- queue = session.incoming("b")
- for i in [2,4,6,8,10]:
- msg = queue.get(timeout = 1)
- self.assertEquals("message-%d" % (i), msg.body)
- session.message_release(RangedSet(msg.id))
- session.receiver._completed.add(msg.id)
- session.channel.session_completed(session.receiver._completed)
- session.message_flow(unit = session.credit_unit.message, value = 1, destination = "b")
- self.assertEmpty(queue)
-
- #check all 'browsed' messages are still on the queue
- self.assertEqual(5, session.queue_query(queue="q").message_count)
-
- def test_release_unacquired(self):
- session = self.session
-
- #create queue
- session.queue_declare(queue = "q", exclusive=True, auto_delete=True)
-
- #send message
- session.message_transfer(message=Message(session.delivery_properties(routing_key="q"), "my-message"))
-
- #create two 'browsers'
- session.message_subscribe(queue = "q", destination = "a", acquire_mode=1)
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "a")
- session.message_flow(unit = session.credit_unit.message, value = 10, destination = "a")
- queueA = session.incoming("a")
-
- session.message_subscribe(queue = "q", destination = "b", acquire_mode=1)
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "b")
- session.message_flow(unit = session.credit_unit.message, value = 10, destination = "b")
- queueB = session.incoming("b")
-
- #have each browser release the message
- msgA = queueA.get(timeout = 1)
- session.message_release(RangedSet(msgA.id))
-
- msgB = queueB.get(timeout = 1)
- session.message_release(RangedSet(msgB.id))
-
- #cancel browsers
- session.message_cancel(destination = "a")
- session.message_cancel(destination = "b")
-
- #create consumer
- session.message_subscribe(queue = "q", destination = "c")
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "c")
- session.message_flow(unit = session.credit_unit.message, value = 10, destination = "c")
- queueC = session.incoming("c")
- #consume the message then ack it
- msgC = queueC.get(timeout = 1)
- session.message_accept(RangedSet(msgC.id))
- #ensure there are no other messages
- self.assertEmpty(queueC)
-
- def test_empty_body(self):
- session = self.session
- session.queue_declare(queue="xyz", exclusive=True, auto_delete=True)
- props = session.delivery_properties(routing_key="xyz")
- session.message_transfer(message=Message(props, ""))
-
- consumer_tag = "tag1"
- session.message_subscribe(queue="xyz", destination=consumer_tag)
- session.message_flow(unit = session.credit_unit.message, value = 0xFFFFFFFF, destination = consumer_tag)
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = consumer_tag)
- queue = session.incoming(consumer_tag)
- msg = queue.get(timeout=1)
- self.assertEquals("", msg.body)
- session.message_accept(RangedSet(msg.id))
-
- def test_incoming_start(self):
- q = "test_incoming_start"
- session = self.session
-
- session.queue_declare(queue=q, exclusive=True, auto_delete=True)
- session.message_subscribe(queue=q, destination="msgs")
- messages = session.incoming("msgs")
- assert messages.destination == "msgs"
-
- dp = session.delivery_properties(routing_key=q)
- session.message_transfer(message=Message(dp, "test"))
-
- messages.start()
- msg = messages.get()
- assert msg.body == "test"
-
- def test_ttl(self):
- q = "test_ttl"
- session = self.session
-
- session.queue_declare(queue=q, exclusive=True, auto_delete=True)
-
- dp = session.delivery_properties(routing_key=q, ttl=500)#expire in half a second
- session.message_transfer(message=Message(dp, "first"))
-
- dp = session.delivery_properties(routing_key=q, ttl=300000)#expire in fives minutes
- session.message_transfer(message=Message(dp, "second"))
-
- d = "msgs"
- session.message_subscribe(queue=q, destination=d)
- messages = session.incoming(d)
- sleep(1)
- session.message_flow(unit = session.credit_unit.message, value=2, destination=d)
- session.message_flow(unit = session.credit_unit.byte, value=0xFFFFFFFF, destination=d)
- assert messages.get(timeout=1).body == "second"
- self.assertEmpty(messages)
-
-
- def assertDataEquals(self, session, msg, expected):
- self.assertEquals(expected, msg.body)
-
- def assertEmpty(self, queue):
- try:
- extra = queue.get(timeout=1)
- self.fail("Queue not empty, contains: " + extra.body)
- except Empty: None
-
-class SizelessContent(Content):
-
- def size(self):
- return None
diff --git a/M4-RCs/qpid/python/tests_0-10/persistence.py b/M4-RCs/qpid/python/tests_0-10/persistence.py
deleted file mode 100644
index 815ad1f3dc..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/persistence.py
+++ /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.
-#
-from qpid.datatypes import Message, RangedSet
-from qpid.testlib import testrunner, TestBase010
-
-class PersistenceTests(TestBase010):
- def test_delete_queue_after_publish(self):
- session = self.session
- session.auto_sync = False
-
- #create queue
- session.queue_declare(queue = "q", auto_delete=True, durable=True)
-
- #send message
- for i in range(1, 10):
- dp = session.delivery_properties(routing_key="q", delivery_mode=2)
- session.message_transfer(message=Message(dp, "my-message"))
-
- session.auto_sync = True
- #explicitly delete queue
- session.queue_delete(queue = "q")
-
- def test_ack_message_from_deleted_queue(self):
- session = self.session
- session.auto_sync = False
-
- #create queue
- session.queue_declare(queue = "q", auto_delete=True, durable=True)
-
- #send message
- dp = session.delivery_properties(routing_key="q", delivery_mode=2)
- session.message_transfer(message=Message(dp, "my-message"))
-
- #create consumer
- session.message_subscribe(queue = "q", destination = "a", accept_mode = 1, acquire_mode=0)
- session.message_flow(unit = session.credit_unit.byte, value = 0xFFFFFFFF, destination = "a")
- session.message_flow(unit = session.credit_unit.message, value = 10, destination = "a")
- queue = session.incoming("a")
-
- #consume the message, cancel subscription (triggering auto-delete), then ack it
- msg = queue.get(timeout = 5)
- session.message_cancel(destination = "a")
- session.message_accept(RangedSet(msg.id))
-
- def test_queue_deletion(self):
- session = self.session
- session.queue_declare(queue = "durable-subscriber-queue", exclusive=True, durable=True)
- session.exchange_bind(exchange="amq.topic", queue="durable-subscriber-queue", binding_key="xyz")
- dp = session.delivery_properties(routing_key="xyz", delivery_mode=2)
- session.message_transfer(destination="amq.topic", message=Message(dp, "my-message"))
- session.queue_delete(queue = "durable-subscriber-queue")
diff --git a/M4-RCs/qpid/python/tests_0-10/query.py b/M4-RCs/qpid/python/tests_0-10/query.py
deleted file mode 100644
index 311df84096..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/query.py
+++ /dev/null
@@ -1,235 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import TestBase010
-
-class QueryTests(TestBase010):
- """Tests for various query methods"""
-
- def test_queue_query(self):
- session = self.session
- session.queue_declare(queue="my-queue", exclusive=True)
- result = session.queue_query(queue="my-queue")
- self.assertEqual("my-queue", result.queue)
-
- def test_queue_query_unknown(self):
- session = self.session
- result = session.queue_query(queue="I don't exist")
- self.assert_(not result.queue)
-
- def test_exchange_query(self):
- """
- Test that the exchange_query method works as expected
- """
- session = self.session
- #check returned type for the standard exchanges
- self.assertEqual("direct", session.exchange_query(name="amq.direct").type)
- self.assertEqual("topic", session.exchange_query(name="amq.topic").type)
- self.assertEqual("fanout", session.exchange_query(name="amq.fanout").type)
- self.assertEqual("headers", session.exchange_query(name="amq.match").type)
- self.assertEqual("direct", session.exchange_query(name="").type)
- #declare an exchange
- session.exchange_declare(exchange="my-test-exchange", type= "direct", durable=False)
- #check that the result of a query is as expected
- response = session.exchange_query(name="my-test-exchange")
- self.assertEqual("direct", response.type)
- self.assert_(not response.durable)
- self.assert_(not response.not_found)
- #delete the exchange
- session.exchange_delete(exchange="my-test-exchange")
- #check that the query now reports not-found
- self.assert_(session.exchange_query(name="my-test-exchange").not_found)
-
- def test_exchange_bound_direct(self):
- """
- Test that the exchange_bound method works as expected with the direct exchange
- """
- self.exchange_bound_with_key("amq.direct")
-
- def test_exchange_bound_topic(self):
- """
- Test that the exchange_bound method works as expected with the direct exchange
- """
- self.exchange_bound_with_key("amq.topic")
-
- def exchange_bound_with_key(self, exchange_name):
- session = self.session
- #setup: create two queues
- session.queue_declare(queue="used-queue", exclusive=True, auto_delete=True)
- session.queue_declare(queue="unused-queue", exclusive=True, auto_delete=True)
-
- session.exchange_bind(exchange=exchange_name, queue="used-queue", binding_key="used-key")
-
- # test detection of any binding to specific queue
- response = session.exchange_bound(exchange=exchange_name, queue="used-queue")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assert_(not response.queue_not_matched)
-
- # test detection of specific binding to any queue
- response = session.exchange_bound(exchange=exchange_name, binding_key="used-key")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assert_(not response.key_not_matched)
-
- # test detection of specific binding to specific queue
- response = session.exchange_bound(exchange=exchange_name, queue="used-queue", binding_key="used-key")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assert_(not response.queue_not_matched)
- self.assert_(not response.key_not_matched)
-
- # test unmatched queue, unspecified binding
- response = session.exchange_bound(exchange=exchange_name, queue="unused-queue")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
-
- # test unspecified queue, unmatched binding
- response = session.exchange_bound(exchange=exchange_name, binding_key="unused-key")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assertEqual(True, response.key_not_matched)
-
- # test matched queue, unmatched binding
- response = session.exchange_bound(exchange=exchange_name, queue="used-queue", binding_key="unused-key")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assert_(not response.queue_not_matched)
- self.assertEqual(True, response.key_not_matched)
-
- # test unmatched queue, matched binding
- response = session.exchange_bound(exchange=exchange_name, queue="unused-queue", binding_key="used-key")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
- self.assert_(not response.key_not_matched)
-
- # test unmatched queue, unmatched binding
- response = session.exchange_bound(exchange=exchange_name, queue="unused-queue", binding_key="unused-key")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
- self.assertEqual(True, response.key_not_matched)
-
- #test exchange not found
- self.assertEqual(True, session.exchange_bound(exchange="unknown-exchange").exchange_not_found)
-
- #test queue not found
- self.assertEqual(True, session.exchange_bound(exchange=exchange_name, queue="unknown-queue").queue_not_found)
-
-
- def test_exchange_bound_fanout(self):
- """
- Test that the exchange_bound method works as expected with fanout exchange
- """
- session = self.session
- #setup
- session.queue_declare(queue="used-queue", exclusive=True, auto_delete=True)
- session.queue_declare(queue="unused-queue", exclusive=True, auto_delete=True)
- session.exchange_bind(exchange="amq.fanout", queue="used-queue")
-
- # test detection of any binding to specific queue
- response = session.exchange_bound(exchange="amq.fanout", queue="used-queue")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assert_(not response.queue_not_matched)
-
- # test unmatched queue, unspecified binding
- response = session.exchange_bound(exchange="amq.fanout", queue="unused-queue")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
-
- #test exchange not found
- self.assertEqual(True, session.exchange_bound(exchange="unknown-exchange").exchange_not_found)
-
- #test queue not found
- self.assertEqual(True, session.exchange_bound(exchange="amq.fanout", queue="unknown-queue").queue_not_found)
-
- def test_exchange_bound_header(self):
- """
- Test that the exchange_bound method works as expected with headers exchanges
- """
- session = self.session
- #setup
- session.queue_declare(queue="used-queue", exclusive=True, auto_delete=True)
- session.queue_declare(queue="unused-queue", exclusive=True, auto_delete=True)
- session.exchange_bind(exchange="amq.match", queue="used-queue", arguments={"x-match":"all", "a":"A"} )
-
- # test detection of any binding to specific queue
- response = session.exchange_bound(exchange="amq.match", queue="used-queue")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assert_(not response.queue_not_matched)
-
- # test detection of specific binding to any queue
- response = session.exchange_bound(exchange="amq.match", arguments={"x-match":"all", "a":"A"})
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assert_(not response.args_not_matched)
-
- # test detection of specific binding to specific queue
- response = session.exchange_bound(exchange="amq.match", queue="used-queue", arguments={"x-match":"all", "a":"A"})
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assert_(not response.queue_not_matched)
- self.assert_(not response.args_not_matched)
-
- # test unmatched queue, unspecified binding
- response = session.exchange_bound(exchange="amq.match", queue="unused-queue")
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
-
- # test unspecified queue, unmatched binding
- response = session.exchange_bound(exchange="amq.match", arguments={"x-match":"all", "b":"B"})
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assertEqual(True, response.args_not_matched)
-
- # test matched queue, unmatched binding
- response = session.exchange_bound(exchange="amq.match", queue="used-queue", arguments={"x-match":"all", "b":"B"})
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assert_(not response.queue_not_matched)
- self.assertEqual(True, response.args_not_matched)
-
- # test unmatched queue, matched binding
- response = session.exchange_bound(exchange="amq.match", queue="unused-queue", arguments={"x-match":"all", "a":"A"})
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
- self.assert_(not response.args_not_matched)
-
- # test unmatched queue, unmatched binding
- response = session.exchange_bound(exchange="amq.match", queue="unused-queue", arguments={"x-match":"all", "b":"B"})
- self.assert_(not response.exchange_not_found)
- self.assert_(not response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
- self.assertEqual(True, response.args_not_matched)
-
- #test exchange not found
- self.assertEqual(True, session.exchange_bound(exchange="unknown-exchange").exchange_not_found)
-
- #test queue not found
- self.assertEqual(True, session.exchange_bound(exchange="amq.match", queue="unknown-queue").queue_not_found)
-
diff --git a/M4-RCs/qpid/python/tests_0-10/queue.py b/M4-RCs/qpid/python/tests_0-10/queue.py
deleted file mode 100644
index 05e18081fa..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/queue.py
+++ /dev/null
@@ -1,366 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.testlib import TestBase010
-from qpid.datatypes import Message
-from qpid.session import SessionException
-
-class QueueTests(TestBase010):
- """Tests for 'methods' on the amqp queue 'class'"""
-
- def test_purge(self):
- """
- Test that the purge method removes messages from the queue
- """
- session = self.session
- #setup, declare a queue and add some messages to it:
- session.queue_declare(queue="test-queue", exclusive=True, auto_delete=True)
- session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue"), "one"))
- session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue"), "two"))
- session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue"), "three"))
-
- #check that the queue now reports 3 messages:
- session.queue_declare(queue="test-queue")
- reply = session.queue_query(queue="test-queue")
- self.assertEqual(3, reply.message_count)
-
- #now do the purge, then test that three messages are purged and the count drops to 0
- session.queue_purge(queue="test-queue");
- reply = session.queue_query(queue="test-queue")
- self.assertEqual(0, reply.message_count)
-
- #send a further message and consume it, ensuring that the other messages are really gone
- session.message_transfer(message=Message(session.delivery_properties(routing_key="test-queue"), "four"))
- session.message_subscribe(queue="test-queue", destination="tag")
- session.message_flow(destination="tag", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="tag", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- queue = session.incoming("tag")
- msg = queue.get(timeout=1)
- self.assertEqual("four", msg.body)
-
- def test_purge_queue_exists(self):
- """
- Test that the correct exception is thrown is no queue exists
- for the name specified in purge
- """
- session = self.session
- try:
- #queue specified but doesn't exist:
- session.queue_purge(queue="invalid-queue")
- self.fail("Expected failure when purging non-existent queue")
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code) #not-found
-
- def test_purge_empty_name(self):
- """
- Test that the correct exception is thrown is no queue name
- is specified for purge
- """
- session = self.session
- try:
- #queue not specified and none previously declared for channel:
- session.queue_purge()
- self.fail("Expected failure when purging unspecified queue")
- except SessionException, e:
- self.assertEquals(531, e.args[0].error_code) #illegal-argument
-
- def test_declare_exclusive(self):
- """
- Test that the exclusive field is honoured in queue.declare
- """
- # TestBase.setUp has already opened session(1)
- s1 = self.session
- # Here we open a second separate connection:
- s2 = self.conn.session("other")
-
- #declare an exclusive queue:
- s1.queue_declare(queue="exclusive-queue", exclusive=True, auto_delete=True)
- try:
- #other connection should not be allowed to declare this:
- s2.queue_declare(queue="exclusive-queue", exclusive=True, auto_delete=True)
- self.fail("Expected second exclusive queue_declare to raise a channel exception")
- except SessionException, e:
- self.assertEquals(405, e.args[0].error_code)
-
- s3 = self.conn.session("subscriber")
- try:
- #other connection should not be allowed to declare this:
- s3.message_subscribe(queue="exclusive-queue")
- self.fail("Expected message_subscribe on an exclusive queue to raise a channel exception")
- except SessionException, e:
- self.assertEquals(405, e.args[0].error_code)
-
- s4 = self.conn.session("deleter")
- try:
- #other connection should not be allowed to declare this:
- s4.queue_delete(queue="exclusive-queue")
- self.fail("Expected queue_delete on an exclusive queue to raise a channel exception")
- except SessionException, e:
- self.assertEquals(405, e.args[0].error_code)
-
-
- def test_declare_passive(self):
- """
- Test that the passive field is honoured in queue.declare
- """
- session = self.session
- #declare an exclusive queue:
- session.queue_declare(queue="passive-queue-1", exclusive=True, auto_delete=True)
- session.queue_declare(queue="passive-queue-1", passive=True)
- try:
- #other connection should not be allowed to declare this:
- session.queue_declare(queue="passive-queue-2", passive=True)
- self.fail("Expected passive declaration of non-existant queue to raise a channel exception")
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code) #not-found
-
-
- def test_bind(self):
- """
- Test various permutations of the queue.bind method
- """
- session = self.session
- session.queue_declare(queue="queue-1", exclusive=True, auto_delete=True)
-
- #straightforward case, both exchange & queue exist so no errors expected:
- session.exchange_bind(queue="queue-1", exchange="amq.direct", binding_key="key1")
-
- #use the queue name where the routing key is not specified:
- session.exchange_bind(queue="queue-1", exchange="amq.direct")
-
- #try and bind to non-existant exchange
- try:
- session.exchange_bind(queue="queue-1", exchange="an-invalid-exchange", binding_key="key1")
- self.fail("Expected bind to non-existant exchange to fail")
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
-
- def test_bind_queue_existence(self):
- session = self.session
- #try and bind non-existant queue:
- try:
- session.exchange_bind(queue="queue-2", exchange="amq.direct", binding_key="key1")
- self.fail("Expected bind of non-existant queue to fail")
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
- def test_unbind_direct(self):
- self.unbind_test(exchange="amq.direct", routing_key="key")
-
- def test_unbind_topic(self):
- self.unbind_test(exchange="amq.topic", routing_key="key")
-
- def test_unbind_fanout(self):
- self.unbind_test(exchange="amq.fanout")
-
- def test_unbind_headers(self):
- self.unbind_test(exchange="amq.match", args={ "x-match":"all", "a":"b"}, headers={"a":"b"})
-
- def unbind_test(self, exchange, routing_key="", args=None, headers=None):
- #bind two queues and consume from them
- session = self.session
-
- session.queue_declare(queue="queue-1", exclusive=True, auto_delete=True)
- session.queue_declare(queue="queue-2", exclusive=True, auto_delete=True)
-
- session.message_subscribe(queue="queue-1", destination="queue-1")
- session.message_flow(destination="queue-1", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="queue-1", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- session.message_subscribe(queue="queue-2", destination="queue-2")
- session.message_flow(destination="queue-2", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="queue-2", unit=session.credit_unit.byte, value=0xFFFFFFFF)
-
- queue1 = session.incoming("queue-1")
- queue2 = session.incoming("queue-2")
-
- session.exchange_bind(exchange=exchange, queue="queue-1", binding_key=routing_key, arguments=args)
- session.exchange_bind(exchange=exchange, queue="queue-2", binding_key=routing_key, arguments=args)
-
- dp = session.delivery_properties(routing_key=routing_key)
- if (headers):
- mp = session.message_properties(application_headers=headers)
- msg1 = Message(dp, mp, "one")
- msg2 = Message(dp, mp, "two")
- else:
- msg1 = Message(dp, "one")
- msg2 = Message(dp, "two")
-
- #send a message that will match both bindings
- session.message_transfer(destination=exchange, message=msg1)
-
- #unbind first queue
- session.exchange_unbind(exchange=exchange, queue="queue-1", binding_key=routing_key)
-
- #send another message
- session.message_transfer(destination=exchange, message=msg2)
-
- #check one queue has both messages and the other has only one
- self.assertEquals("one", queue1.get(timeout=1).body)
- try:
- msg = queue1.get(timeout=1)
- self.fail("Got extra message: %s" % msg.body)
- except Empty: pass
-
- self.assertEquals("one", queue2.get(timeout=1).body)
- self.assertEquals("two", queue2.get(timeout=1).body)
- try:
- msg = queue2.get(timeout=1)
- self.fail("Got extra message: " + msg)
- except Empty: pass
-
-
- def test_delete_simple(self):
- """
- Test core queue deletion behaviour
- """
- session = self.session
-
- #straight-forward case:
- session.queue_declare(queue="delete-me")
- session.message_transfer(message=Message(session.delivery_properties(routing_key="delete-me"), "a"))
- session.message_transfer(message=Message(session.delivery_properties(routing_key="delete-me"), "b"))
- session.message_transfer(message=Message(session.delivery_properties(routing_key="delete-me"), "c"))
- session.queue_delete(queue="delete-me")
- #check that it has gone by declaring passively
- try:
- session.queue_declare(queue="delete-me", passive=True)
- self.fail("Queue has not been deleted")
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
- def test_delete_queue_exists(self):
- """
- Test core queue deletion behaviour
- """
- #check attempted deletion of non-existant queue is handled correctly:
- session = self.session
- try:
- session.queue_delete(queue="i-dont-exist", if_empty=True)
- self.fail("Expected delete of non-existant queue to fail")
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
-
-
- def test_delete_ifempty(self):
- """
- Test that if_empty field of queue_delete is honoured
- """
- session = self.session
-
- #create a queue and add a message to it (use default binding):
- session.queue_declare(queue="delete-me-2")
- session.queue_declare(queue="delete-me-2", passive=True)
- session.message_transfer(message=Message(session.delivery_properties(routing_key="delete-me-2"), "message"))
-
- #try to delete, but only if empty:
- try:
- session.queue_delete(queue="delete-me-2", if_empty=True)
- self.fail("Expected delete if_empty to fail for non-empty queue")
- except SessionException, e:
- self.assertEquals(406, e.args[0].error_code)
-
- #need new session now:
- session = self.conn.session("replacement", 2)
-
- #empty queue:
- session.message_subscribe(destination="consumer_tag", queue="delete-me-2")
- session.message_flow(destination="consumer_tag", unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination="consumer_tag", unit=session.credit_unit.byte, value=0xFFFFFFFF)
- queue = session.incoming("consumer_tag")
- msg = queue.get(timeout=1)
- self.assertEqual("message", msg.body)
- session.message_cancel(destination="consumer_tag")
-
- #retry deletion on empty queue:
- session.queue_delete(queue="delete-me-2", if_empty=True)
-
- #check that it has gone by declaring passively:
- try:
- session.queue_declare(queue="delete-me-2", passive=True)
- self.fail("Queue has not been deleted")
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
- def test_delete_ifunused(self):
- """
- Test that if_unused field of queue_delete is honoured
- """
- session = self.session
-
- #create a queue and register a consumer:
- session.queue_declare(queue="delete-me-3")
- session.queue_declare(queue="delete-me-3", passive=True)
- session.message_subscribe(destination="consumer_tag", queue="delete-me-3")
-
- #need new session now:
- session2 = self.conn.session("replacement", 2)
-
- #try to delete, but only if empty:
- try:
- session2.queue_delete(queue="delete-me-3", if_unused=True)
- self.fail("Expected delete if_unused to fail for queue with existing consumer")
- except SessionException, e:
- self.assertEquals(406, e.args[0].error_code)
-
- session.message_cancel(destination="consumer_tag")
- session.queue_delete(queue="delete-me-3", if_unused=True)
- #check that it has gone by declaring passively:
- try:
- session.queue_declare(queue="delete-me-3", passive=True)
- self.fail("Queue has not been deleted")
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
-
- def test_autodelete_shared(self):
- """
- Test auto-deletion (of non-exclusive queues)
- """
- session = self.session
- session2 =self.conn.session("other", 1)
-
- session.queue_declare(queue="auto-delete-me", auto_delete=True)
-
- #consume from both sessions
- tag = "my-tag"
- session.message_subscribe(queue="auto-delete-me", destination=tag)
- session2.message_subscribe(queue="auto-delete-me", destination=tag)
-
- #implicit cancel
- session2.close()
-
- #check it is still there
- session.queue_declare(queue="auto-delete-me", passive=True)
-
- #explicit cancel => queue is now unused again:
- session.message_cancel(destination=tag)
-
- #NOTE: this assumes there is no timeout in use
-
- #check that it has gone by declaring it passively
- try:
- session.queue_declare(queue="auto-delete-me", passive=True)
- self.fail("Expected queue to have been deleted")
- except SessionException, e:
- self.assertEquals(404, e.args[0].error_code)
-
-
diff --git a/M4-RCs/qpid/python/tests_0-10/tx.py b/M4-RCs/qpid/python/tests_0-10/tx.py
deleted file mode 100644
index da162d54ec..0000000000
--- a/M4-RCs/qpid/python/tests_0-10/tx.py
+++ /dev/null
@@ -1,265 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.datatypes import Message, RangedSet
-from qpid.testlib import testrunner, TestBase010
-
-class TxTests(TestBase010):
- """
- Tests for 'methods' on the amqp tx 'class'
- """
-
- def test_commit(self):
- """
- Test that commited publishes are delivered and commited acks are not re-delivered
- """
- session = self.session
-
- #declare queues and create subscribers in the checking session
- #to ensure that the queues are not auto-deleted too early:
- self.declare_queues(["tx-commit-a", "tx-commit-b", "tx-commit-c"])
- session.message_subscribe(queue="tx-commit-a", destination="qa")
- session.message_subscribe(queue="tx-commit-b", destination="qb")
- session.message_subscribe(queue="tx-commit-c", destination="qc")
-
- #use a separate session for actual work
- session2 = self.conn.session("worker", 2)
- self.perform_txn_work(session2, "tx-commit-a", "tx-commit-b", "tx-commit-c")
- session2.tx_commit()
- session2.close()
-
- session.tx_select()
-
- self.enable_flow("qa")
- queue_a = session.incoming("qa")
-
- self.enable_flow("qb")
- queue_b = session.incoming("qb")
-
- self.enable_flow("qc")
- queue_c = session.incoming("qc")
-
- #check results
- for i in range(1, 5):
- msg = queue_c.get(timeout=1)
- self.assertEqual("TxMessage %d" % i, msg.body)
- session.message_accept(RangedSet(msg.id))
-
- msg = queue_b.get(timeout=1)
- self.assertEqual("TxMessage 6", msg.body)
- session.message_accept(RangedSet(msg.id))
-
- msg = queue_a.get(timeout=1)
- self.assertEqual("TxMessage 7", msg.body)
- session.message_accept(RangedSet(msg.id))
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- #cleanup
- session.tx_commit()
-
- def test_auto_rollback(self):
- """
- Test that a session closed with an open transaction is effectively rolled back
- """
- session = self.session
- self.declare_queues(["tx-autorollback-a", "tx-autorollback-b", "tx-autorollback-c"])
- session.message_subscribe(queue="tx-autorollback-a", destination="qa")
- session.message_subscribe(queue="tx-autorollback-b", destination="qb")
- session.message_subscribe(queue="tx-autorollback-c", destination="qc")
-
- session2 = self.conn.session("worker", 2)
- queue_a, queue_b, queue_c, ignore = self.perform_txn_work(session2, "tx-autorollback-a", "tx-autorollback-b", "tx-autorollback-c")
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- session2.close()
-
- session.tx_select()
-
- self.enable_flow("qa")
- queue_a = session.incoming("qa")
-
- self.enable_flow("qb")
- queue_b = session.incoming("qb")
-
- self.enable_flow("qc")
- queue_c = session.incoming("qc")
-
- #check results
- for i in range(1, 5):
- msg = queue_a.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.body)
- session.message_accept(RangedSet(msg.id))
-
- msg = queue_b.get(timeout=1)
- self.assertEqual("Message 6", msg.body)
- session.message_accept(RangedSet(msg.id))
-
- msg = queue_c.get(timeout=1)
- self.assertEqual("Message 7", msg.body)
- session.message_accept(RangedSet(msg.id))
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- #cleanup
- session.tx_commit()
-
- def test_rollback(self):
- """
- Test that rolled back publishes are not delivered and rolled back acks are re-delivered
- """
- session = self.session
- queue_a, queue_b, queue_c, consumed = self.perform_txn_work(session, "tx-rollback-a", "tx-rollback-b", "tx-rollback-c")
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- session.tx_rollback()
-
- #need to release messages to get them redelivered now:
- session.message_release(consumed)
-
- #check results
- for i in range(1, 5):
- msg = queue_a.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.body)
- session.message_accept(RangedSet(msg.id))
-
- msg = queue_b.get(timeout=1)
- self.assertEqual("Message 6", msg.body)
- session.message_accept(RangedSet(msg.id))
-
- msg = queue_c.get(timeout=1)
- self.assertEqual("Message 7", msg.body)
- session.message_accept(RangedSet(msg.id))
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- #cleanup
- session.tx_commit()
-
- def perform_txn_work(self, session, name_a, name_b, name_c):
- """
- Utility method that does some setup and some work under a transaction. Used for testing both
- commit and rollback
- """
- #setup:
- self.declare_queues([name_a, name_b, name_c])
-
- key = "my_key_" + name_b
- topic = "my_topic_" + name_c
-
- session.exchange_bind(queue=name_b, exchange="amq.direct", binding_key=key)
- session.exchange_bind(queue=name_c, exchange="amq.topic", binding_key=topic)
-
- dp = session.delivery_properties(routing_key=name_a)
- for i in range(1, 5):
- mp = session.message_properties(message_id="msg%d" % i)
- session.message_transfer(message=Message(dp, mp, "Message %d" % i))
-
- dp = session.delivery_properties(routing_key=key)
- mp = session.message_properties(message_id="msg6")
- session.message_transfer(destination="amq.direct", message=Message(dp, mp, "Message 6"))
-
- dp = session.delivery_properties(routing_key=topic)
- mp = session.message_properties(message_id="msg7")
- session.message_transfer(destination="amq.topic", message=Message(dp, mp, "Message 7"))
-
- session.tx_select()
-
- #consume and ack messages
- acked = RangedSet()
- self.subscribe(session, queue=name_a, destination="sub_a")
- queue_a = session.incoming("sub_a")
- for i in range(1, 5):
- msg = queue_a.get(timeout=1)
- acked.add(msg.id)
- self.assertEqual("Message %d" % i, msg.body)
-
- self.subscribe(session, queue=name_b, destination="sub_b")
- queue_b = session.incoming("sub_b")
- msg = queue_b.get(timeout=1)
- self.assertEqual("Message 6", msg.body)
- acked.add(msg.id)
-
- sub_c = self.subscribe(session, queue=name_c, destination="sub_c")
- queue_c = session.incoming("sub_c")
- msg = queue_c.get(timeout=1)
- self.assertEqual("Message 7", msg.body)
- acked.add(msg.id)
-
- session.message_accept(acked)
-
- dp = session.delivery_properties(routing_key=topic)
- #publish messages
- for i in range(1, 5):
- mp = session.message_properties(message_id="tx-msg%d" % i)
- session.message_transfer(destination="amq.topic", message=Message(dp, mp, "TxMessage %d" % i))
-
- dp = session.delivery_properties(routing_key=key)
- mp = session.message_properties(message_id="tx-msg6")
- session.message_transfer(destination="amq.direct", message=Message(dp, mp, "TxMessage 6"))
-
- dp = session.delivery_properties(routing_key=name_a)
- mp = session.message_properties(message_id="tx-msg7")
- session.message_transfer(message=Message(dp, mp, "TxMessage 7"))
- return queue_a, queue_b, queue_c, acked
-
- def declare_queues(self, names, session=None):
- session = session or self.session
- for n in names:
- session.queue_declare(queue=n, auto_delete=True)
-
- def subscribe(self, session=None, **keys):
- session = session or self.session
- consumer_tag = keys["destination"]
- session.message_subscribe(**keys)
- session.message_flow(destination=consumer_tag, unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination=consumer_tag, unit=session.credit_unit.byte, value=0xFFFFFFFF)
-
- def enable_flow(self, tag, session=None):
- session = session or self.session
- session.message_flow(destination=tag, unit=session.credit_unit.message, value=0xFFFFFFFF)
- session.message_flow(destination=tag, unit=session.credit_unit.byte, value=0xFFFFFFFF)
-
- def complete(self, session, msg):
- session.receiver._completed.add(msg.id)#TODO: this may be done automatically
- session.channel.session_completed(session.receiver._completed)
-
diff --git a/M4-RCs/qpid/python/tests_0-8/__init__.py b/M4-RCs/qpid/python/tests_0-8/__init__.py
deleted file mode 100644
index 9a09d2d04f..0000000000
--- a/M4-RCs/qpid/python/tests_0-8/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Do not delete - marks this directory as a python package.
-
-#
-# 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/M4-RCs/qpid/python/tests_0-8/basic.py b/M4-RCs/qpid/python/tests_0-8/basic.py
deleted file mode 100644
index 95ca0d7287..0000000000
--- a/M4-RCs/qpid/python/tests_0-8/basic.py
+++ /dev/null
@@ -1,395 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class BasicTests(TestBase):
- """Tests for 'methods' on the amqp basic 'class'"""
-
- def test_consume_no_local(self):
- """
- Test that the no_local flag is honoured in the consume method
- """
- channel = self.channel
- #setup, declare two queues:
- channel.queue_declare(queue="test-queue-1a", exclusive=True)
- channel.queue_declare(queue="test-queue-1b", exclusive=True)
- #establish two consumers one of which excludes delivery of locally sent messages
- channel.basic_consume(consumer_tag="local_included", queue="test-queue-1a")
- channel.basic_consume(consumer_tag="local_excluded", queue="test-queue-1b", no_local=True)
-
- #send a message
- channel.basic_publish(routing_key="test-queue-1a", content=Content("consume_no_local"))
- channel.basic_publish(routing_key="test-queue-1b", content=Content("consume_no_local"))
-
- #check the queues of the two consumers
- excluded = self.client.queue("local_excluded")
- included = self.client.queue("local_included")
- msg = included.get(timeout=1)
- self.assertEqual("consume_no_local", msg.content.body)
- try:
- excluded.get(timeout=1)
- self.fail("Received locally published message though no_local=true")
- except Empty: None
-
-
- def test_consume_exclusive(self):
- """
- Test that the exclusive flag is honoured in the consume method
- """
- channel = self.channel
- #setup, declare a queue:
- channel.queue_declare(queue="test-queue-2", exclusive=True)
-
- #check that an exclusive consumer prevents other consumer being created:
- channel.basic_consume(consumer_tag="first", queue="test-queue-2", exclusive=True)
- try:
- channel.basic_consume(consumer_tag="second", queue="test-queue-2")
- self.fail("Expected consume request to fail due to previous exclusive consumer")
- except Closed, e:
- self.assertChannelException(403, e.args[0])
-
- #open new channel and cleanup last consumer:
- channel = self.client.channel(2)
- channel.channel_open()
-
- #check that an exclusive consumer cannot be created if a consumer already exists:
- channel.basic_consume(consumer_tag="first", queue="test-queue-2")
- try:
- channel.basic_consume(consumer_tag="second", queue="test-queue-2", exclusive=True)
- self.fail("Expected exclusive consume request to fail due to previous consumer")
- except Closed, e:
- self.assertChannelException(403, e.args[0])
-
- def test_consume_queue_errors(self):
- """
- Test error conditions associated with the queue field of the consume method:
- """
- channel = self.channel
- try:
- #queue specified but doesn't exist:
- channel.basic_consume(queue="invalid-queue")
- self.fail("Expected failure when consuming from non-existent queue")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- channel = self.client.channel(2)
- channel.channel_open()
- try:
- #queue not specified and none previously declared for channel:
- channel.basic_consume(queue="")
- self.fail("Expected failure when consuming from unspecified queue")
- except Closed, e:
- self.assertConnectionException(530, e.args[0])
-
- def test_consume_unique_consumers(self):
- """
- Ensure unique consumer tags are enforced
- """
- channel = self.channel
- #setup, declare a queue:
- channel.queue_declare(queue="test-queue-3", exclusive=True)
-
- #check that attempts to use duplicate tags are detected and prevented:
- channel.basic_consume(consumer_tag="first", queue="test-queue-3")
- try:
- channel.basic_consume(consumer_tag="first", queue="test-queue-3")
- self.fail("Expected consume request to fail due to non-unique tag")
- except Closed, e:
- self.assertConnectionException(530, e.args[0])
-
- def test_cancel(self):
- """
- Test compliance of the basic.cancel method
- """
- channel = self.channel
- #setup, declare a queue:
- channel.queue_declare(queue="test-queue-4", exclusive=True)
- channel.basic_consume(consumer_tag="my-consumer", queue="test-queue-4")
- channel.basic_publish(routing_key="test-queue-4", content=Content("One"))
-
- myqueue = self.client.queue("my-consumer")
- msg = myqueue.get(timeout=1)
- self.assertEqual("One", msg.content.body)
-
- #cancel should stop messages being delivered
- channel.basic_cancel(consumer_tag="my-consumer")
- channel.basic_publish(routing_key="test-queue-4", content=Content("Two"))
- try:
- msg = myqueue.get(timeout=1)
- self.fail("Got message after cancellation: " + msg)
- except Empty: None
-
- #cancellation of non-existant consumers should be handled without error
- channel.basic_cancel(consumer_tag="my-consumer")
- channel.basic_cancel(consumer_tag="this-never-existed")
-
-
- def test_ack(self):
- """
- Test basic ack/recover behaviour
- """
- channel = self.channel
- channel.queue_declare(queue="test-ack-queue", exclusive=True)
-
- reply = channel.basic_consume(queue="test-ack-queue", no_ack=False)
- queue = self.client.queue(reply.consumer_tag)
-
- channel.basic_publish(routing_key="test-ack-queue", content=Content("One"))
- channel.basic_publish(routing_key="test-ack-queue", content=Content("Two"))
- channel.basic_publish(routing_key="test-ack-queue", content=Content("Three"))
- channel.basic_publish(routing_key="test-ack-queue", content=Content("Four"))
- channel.basic_publish(routing_key="test-ack-queue", content=Content("Five"))
-
- msg1 = queue.get(timeout=1)
- msg2 = queue.get(timeout=1)
- msg3 = queue.get(timeout=1)
- msg4 = queue.get(timeout=1)
- msg5 = queue.get(timeout=1)
-
- self.assertEqual("One", msg1.content.body)
- self.assertEqual("Two", msg2.content.body)
- self.assertEqual("Three", msg3.content.body)
- self.assertEqual("Four", msg4.content.body)
- self.assertEqual("Five", msg5.content.body)
-
- channel.basic_ack(delivery_tag=msg2.delivery_tag, multiple=True) #One & Two
- channel.basic_ack(delivery_tag=msg4.delivery_tag, multiple=False) #Four
-
- channel.basic_recover(requeue=False)
-
- msg3b = queue.get(timeout=1)
- msg5b = queue.get(timeout=1)
-
- self.assertEqual("Three", msg3b.content.body)
- self.assertEqual("Five", msg5b.content.body)
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message: " + extra.content.body)
- except Empty: None
-
- def test_recover_requeue(self):
- """
- Test requeing on recovery
- """
- channel = self.channel
- channel.queue_declare(queue="test-requeue", exclusive=True)
-
- subscription = channel.basic_consume(queue="test-requeue", no_ack=False)
- queue = self.client.queue(subscription.consumer_tag)
-
- channel.basic_publish(routing_key="test-requeue", content=Content("One"))
- channel.basic_publish(routing_key="test-requeue", content=Content("Two"))
- channel.basic_publish(routing_key="test-requeue", content=Content("Three"))
- channel.basic_publish(routing_key="test-requeue", content=Content("Four"))
- channel.basic_publish(routing_key="test-requeue", content=Content("Five"))
-
- msg1 = queue.get(timeout=1)
- msg2 = queue.get(timeout=1)
- msg3 = queue.get(timeout=1)
- msg4 = queue.get(timeout=1)
- msg5 = queue.get(timeout=1)
-
- self.assertEqual("One", msg1.content.body)
- self.assertEqual("Two", msg2.content.body)
- self.assertEqual("Three", msg3.content.body)
- self.assertEqual("Four", msg4.content.body)
- self.assertEqual("Five", msg5.content.body)
-
- channel.basic_ack(delivery_tag=msg2.delivery_tag, multiple=True) #One & Two
- channel.basic_ack(delivery_tag=msg4.delivery_tag, multiple=False) #Four
-
- channel.basic_cancel(consumer_tag=subscription.consumer_tag)
- subscription2 = channel.basic_consume(queue="test-requeue")
- queue2 = self.client.queue(subscription2.consumer_tag)
-
- channel.basic_recover(requeue=True)
-
- msg3b = queue2.get(timeout=1)
- msg5b = queue2.get(timeout=1)
-
- self.assertEqual("Three", msg3b.content.body)
- self.assertEqual("Five", msg5b.content.body)
-
- self.assertEqual(True, msg3b.redelivered)
- self.assertEqual(True, msg5b.redelivered)
-
- try:
- extra = queue2.get(timeout=1)
- self.fail("Got unexpected message in second queue: " + extra.content.body)
- except Empty: None
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message in original queue: " + extra.content.body)
- except Empty: None
-
-
- def test_qos_prefetch_count(self):
- """
- Test that the prefetch count specified is honoured
- """
- #setup: declare queue and subscribe
- channel = self.channel
- channel.queue_declare(queue="test-prefetch-count", exclusive=True)
- subscription = channel.basic_consume(queue="test-prefetch-count", no_ack=False)
- queue = self.client.queue(subscription.consumer_tag)
-
- #set prefetch to 5:
- channel.basic_qos(prefetch_count=5)
-
- #publish 10 messages:
- for i in range(1, 11):
- channel.basic_publish(routing_key="test-prefetch-count", content=Content("Message %d" % i))
-
- #only 5 messages should have been delivered:
- for i in range(1, 6):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 6th message in original queue: " + extra.content.body)
- except Empty: None
-
- #ack messages and check that the next set arrive ok:
- channel.basic_ack(delivery_tag=msg.delivery_tag, multiple=True)
-
- for i in range(6, 11):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
-
- channel.basic_ack(delivery_tag=msg.delivery_tag, multiple=True)
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 11th message in original queue: " + extra.content.body)
- except Empty: None
-
-
-
- def test_qos_prefetch_size(self):
- """
- Test that the prefetch size specified is honoured
- """
- #setup: declare queue and subscribe
- channel = self.channel
- channel.queue_declare(queue="test-prefetch-size", exclusive=True)
- subscription = channel.basic_consume(queue="test-prefetch-size", no_ack=False)
- queue = self.client.queue(subscription.consumer_tag)
-
- #set prefetch to 50 bytes (each message is 9 or 10 bytes):
- channel.basic_qos(prefetch_size=50)
-
- #publish 10 messages:
- for i in range(1, 11):
- channel.basic_publish(routing_key="test-prefetch-size", content=Content("Message %d" % i))
-
- #only 5 messages should have been delivered (i.e. 45 bytes worth):
- for i in range(1, 6):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 6th message in original queue: " + extra.content.body)
- except Empty: None
-
- #ack messages and check that the next set arrive ok:
- channel.basic_ack(delivery_tag=msg.delivery_tag, multiple=True)
-
- for i in range(6, 11):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
-
- channel.basic_ack(delivery_tag=msg.delivery_tag, multiple=True)
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 11th message in original queue: " + extra.content.body)
- except Empty: None
-
- #make sure that a single oversized message still gets delivered
- large = "abcdefghijklmnopqrstuvwxyz"
- large = large + "-" + large;
- channel.basic_publish(routing_key="test-prefetch-size", content=Content(large))
- msg = queue.get(timeout=1)
- self.assertEqual(large, msg.content.body)
-
- def test_get(self):
- """
- Test basic_get method
- """
- channel = self.channel
- channel.queue_declare(queue="test-get", exclusive=True)
-
- #publish some messages (no_ack=True)
- for i in range(1, 11):
- channel.basic_publish(routing_key="test-get", content=Content("Message %d" % i))
-
- #use basic_get to read back the messages, and check that we get an empty at the end
- for i in range(1, 11):
- reply = channel.basic_get(no_ack=True)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_ok")
- self.assertEqual("Message %d" % i, reply.content.body)
-
- reply = channel.basic_get(no_ack=True)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_empty")
-
- #repeat for no_ack=False
- for i in range(11, 21):
- channel.basic_publish(routing_key="test-get", content=Content("Message %d" % i))
-
- for i in range(11, 21):
- reply = channel.basic_get(no_ack=False)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_ok")
- self.assertEqual("Message %d" % i, reply.content.body)
- if(i == 13):
- channel.basic_ack(delivery_tag=reply.delivery_tag, multiple=True)
- if(i in [15, 17, 19]):
- channel.basic_ack(delivery_tag=reply.delivery_tag)
-
- reply = channel.basic_get(no_ack=True)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_empty")
-
- #recover(requeue=True)
- channel.basic_recover(requeue=True)
-
- #get the unacked messages again (14, 16, 18, 20)
- for i in [14, 16, 18, 20]:
- reply = channel.basic_get(no_ack=False)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_ok")
- self.assertEqual("Message %d" % i, reply.content.body)
- channel.basic_ack(delivery_tag=reply.delivery_tag)
-
- reply = channel.basic_get(no_ack=True)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_empty")
-
- channel.basic_recover(requeue=True)
-
- reply = channel.basic_get(no_ack=True)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_empty")
diff --git a/M4-RCs/qpid/python/tests_0-8/broker.py b/M4-RCs/qpid/python/tests_0-8/broker.py
deleted file mode 100644
index d9ac69c5e3..0000000000
--- a/M4-RCs/qpid/python/tests_0-8/broker.py
+++ /dev/null
@@ -1,104 +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 qpid.client import Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class BrokerTests(TestBase):
- """Tests for basic Broker functionality"""
-
- def test_amqp_basic_13(self):
- """
- First, this test tries to receive a message with a no-ack
- consumer. Second, this test tries to explicitely receive and
- acknowledge a message with an acknowledging consumer.
- """
- ch = self.channel
- self.queue_declare(ch, queue = "myqueue")
-
- # No ack consumer
- ctag = ch.basic_consume(queue = "myqueue", no_ack = True).consumer_tag
- body = "test no-ack"
- ch.basic_publish(routing_key = "myqueue", content = Content(body))
- msg = self.client.queue(ctag).get(timeout = 5)
- self.assert_(msg.content.body == body)
-
- # Acknowleding consumer
- self.queue_declare(ch, queue = "otherqueue")
- ctag = ch.basic_consume(queue = "otherqueue", no_ack = False).consumer_tag
- body = "test ack"
- ch.basic_publish(routing_key = "otherqueue", content = Content(body))
- msg = self.client.queue(ctag).get(timeout = 5)
- ch.basic_ack(delivery_tag = msg.delivery_tag)
- self.assert_(msg.content.body == body)
-
- def test_basic_delivery_immediate(self):
- """
- Test basic message delivery where consume is issued before publish
- """
- channel = self.channel
- self.exchange_declare(channel, exchange="test-exchange", type="direct")
- self.queue_declare(channel, queue="test-queue")
- channel.queue_bind(queue="test-queue", exchange="test-exchange", routing_key="key")
- reply = channel.basic_consume(queue="test-queue", no_ack=True)
- queue = self.client.queue(reply.consumer_tag)
-
- body = "Immediate Delivery"
- channel.basic_publish(exchange="test-exchange", routing_key="key", content=Content(body), immediate=True)
- msg = queue.get(timeout=5)
- self.assert_(msg.content.body == body)
-
- # TODO: Ensure we fail if immediate=True and there's no consumer.
-
-
- def test_basic_delivery_queued(self):
- """
- Test basic message delivery where publish is issued before consume
- (i.e. requires queueing of the message)
- """
- channel = self.channel
- self.exchange_declare(channel, exchange="test-exchange", type="direct")
- self.queue_declare(channel, queue="test-queue")
- channel.queue_bind(queue="test-queue", exchange="test-exchange", routing_key="key")
- body = "Queued Delivery"
- channel.basic_publish(exchange="test-exchange", routing_key="key", content=Content(body))
- reply = channel.basic_consume(queue="test-queue", no_ack=True)
- queue = self.client.queue(reply.consumer_tag)
- msg = queue.get(timeout=5)
- self.assert_(msg.content.body == body)
-
- def test_invalid_channel(self):
- channel = self.client.channel(200)
- try:
- channel.queue_declare(exclusive=True)
- self.fail("Expected error on queue_declare for invalid channel")
- except Closed, e:
- self.assertConnectionException(504, e.args[0])
-
- def test_closed_channel(self):
- channel = self.client.channel(200)
- channel.channel_open()
- channel.channel_close()
- try:
- channel.queue_declare(exclusive=True)
- self.fail("Expected error on queue_declare for closed channel")
- except Closed, e:
- self.assertConnectionException(504, e.args[0])
-
diff --git a/M4-RCs/qpid/python/tests_0-8/example.py b/M4-RCs/qpid/python/tests_0-8/example.py
deleted file mode 100644
index a1949ccb9f..0000000000
--- a/M4-RCs/qpid/python/tests_0-8/example.py
+++ /dev/null
@@ -1,94 +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 qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class ExampleTest (TestBase):
- """
- An example Qpid test, illustrating the unittest frameowkr and the
- python Qpid client. The test class must inherit TestCase. The
- test code uses the Qpid client to interact with a qpid broker and
- verify it behaves as expected.
- """
-
- def test_example(self):
- """
- An example test. Note that test functions must start with 'test_'
- to be recognized by the test framework.
- """
-
- # By inheriting TestBase, self.client is automatically connected
- # and self.channel is automatically opened as channel(1)
- # Other channel methods mimic the protocol.
- channel = self.channel
-
- # Now we can send regular commands. If you want to see what the method
- # arguments mean or what other commands are available, you can use the
- # python builtin help() method. For example:
- #help(chan)
- #help(chan.exchange_declare)
-
- # If you want browse the available protocol methods without being
- # connected to a live server you can use the amqp-doc utility:
- #
- # Usage amqp-doc [<options>] <spec> [<pattern_1> ... <pattern_n>]
- #
- # Options:
- # -e, --regexp use regex instead of glob when matching
-
- # Now that we know what commands are available we can use them to
- # interact with the server.
-
- # Here we use ordinal arguments.
- self.exchange_declare(channel, 0, "test", "direct")
-
- # Here we use keyword arguments.
- self.queue_declare(channel, queue="test-queue")
- channel.queue_bind(queue="test-queue", exchange="test", routing_key="key")
-
- # Call Channel.basic_consume to register as a consumer.
- # All the protocol methods return a message object. The message object
- # has fields corresponding to the reply method fields, plus a content
- # field that is filled if the reply includes content. In this case the
- # interesting field is the consumer_tag.
- reply = channel.basic_consume(queue="test-queue")
-
- # We can use the Client.queue(...) method to access the queue
- # corresponding to our consumer_tag.
- queue = self.client.queue(reply.consumer_tag)
-
- # Now lets publish a message and see if our consumer gets it. To do
- # this we need to import the Content class.
- body = "Hello World!"
- channel.basic_publish(exchange="test",
- routing_key="key",
- content=Content(body))
-
- # Now we'll wait for the message to arrive. We can use the timeout
- # argument in case the server hangs. By default queue.get() will wait
- # until a message arrives or the connection to the server dies.
- msg = queue.get(timeout=10)
-
- # And check that we got the right response with assertEqual
- self.assertEqual(body, msg.content.body)
-
- # Now acknowledge the message.
- channel.basic_ack(msg.delivery_tag, True)
-
diff --git a/M4-RCs/qpid/python/tests_0-8/exchange.py b/M4-RCs/qpid/python/tests_0-8/exchange.py
deleted file mode 100644
index 56d6fa82e4..0000000000
--- a/M4-RCs/qpid/python/tests_0-8/exchange.py
+++ /dev/null
@@ -1,327 +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.
-#
-
-"""
-Tests for exchange behaviour.
-
-Test classes ending in 'RuleTests' are derived from rules in amqp.xml.
-"""
-
-import Queue, logging
-from qpid.testlib import TestBase
-from qpid.content import Content
-from qpid.client import Closed
-
-
-class StandardExchangeVerifier:
- """Verifies standard exchange behavior.
-
- Used as base class for classes that test standard exchanges."""
-
- def verifyDirectExchange(self, ex):
- """Verify that ex behaves like a direct exchange."""
- self.queue_declare(queue="q")
- self.channel.queue_bind(queue="q", exchange=ex, routing_key="k")
- self.assertPublishConsume(exchange=ex, queue="q", routing_key="k")
- try:
- self.assertPublishConsume(exchange=ex, queue="q", routing_key="kk")
- self.fail("Expected Empty exception")
- except Queue.Empty: None # Expected
-
- def verifyFanOutExchange(self, ex):
- """Verify that ex behaves like a fanout exchange."""
- self.queue_declare(queue="q")
- self.channel.queue_bind(queue="q", exchange=ex)
- self.queue_declare(queue="p")
- self.channel.queue_bind(queue="p", exchange=ex)
- for qname in ["q", "p"]: self.assertPublishGet(self.consume(qname), ex)
-
- def verifyTopicExchange(self, ex):
- """Verify that ex behaves like a topic exchange"""
- self.queue_declare(queue="a")
- self.channel.queue_bind(queue="a", exchange=ex, routing_key="a.#.b.*")
- q = self.consume("a")
- self.assertPublishGet(q, ex, "a.b.x")
- self.assertPublishGet(q, ex, "a.x.b.x")
- self.assertPublishGet(q, ex, "a.x.x.b.x")
- # Shouldn't match
- self.channel.basic_publish(exchange=ex, routing_key="a.b")
- self.channel.basic_publish(exchange=ex, routing_key="a.b.x.y")
- self.channel.basic_publish(exchange=ex, routing_key="x.a.b.x")
- self.channel.basic_publish(exchange=ex, routing_key="a.b")
- self.assert_(q.empty())
-
- def verifyHeadersExchange(self, ex):
- """Verify that ex is a headers exchange"""
- self.queue_declare(queue="q")
- self.channel.queue_bind(queue="q", exchange=ex, arguments={ "x-match":"all", "name":"fred" , "age":3} )
- q = self.consume("q")
- headers = {"name":"fred", "age":3}
- self.assertPublishGet(q, exchange=ex, properties={'headers':headers})
- self.channel.basic_publish(exchange=ex) # No headers, won't deliver
- self.assertEmpty(q);
-
-
-class RecommendedTypesRuleTests(TestBase, StandardExchangeVerifier):
- """
- The server SHOULD implement these standard exchange types: topic, headers.
-
- Client attempts to declare an exchange with each of these standard types.
- """
-
- def testDirect(self):
- """Declare and test a direct exchange"""
- self.exchange_declare(0, exchange="d", type="direct")
- self.verifyDirectExchange("d")
-
- def testFanout(self):
- """Declare and test a fanout exchange"""
- self.exchange_declare(0, exchange="f", type="fanout")
- self.verifyFanOutExchange("f")
-
- def testTopic(self):
- """Declare and test a topic exchange"""
- self.exchange_declare(0, exchange="t", type="topic")
- self.verifyTopicExchange("t")
-
- def testHeaders(self):
- """Declare and test a headers exchange"""
- self.exchange_declare(0, exchange="h", type="headers")
- self.verifyHeadersExchange("h")
-
-
-class RequiredInstancesRuleTests(TestBase, StandardExchangeVerifier):
- """
- The server MUST, in each virtual host, pre-declare an exchange instance
- for each standard exchange type that it implements, where the name of the
- exchange instance is amq. followed by the exchange type name.
-
- Client creates a temporary queue and attempts to bind to each required
- exchange instance (amq.fanout, amq.direct, and amq.topic, amq.match if
- those types are defined).
- """
- def testAmqDirect(self): self.verifyDirectExchange("amq.direct")
-
- def testAmqFanOut(self): self.verifyFanOutExchange("amq.fanout")
-
- def testAmqTopic(self): self.verifyTopicExchange("amq.topic")
-
- def testAmqMatch(self): self.verifyHeadersExchange("amq.match")
-
-class DefaultExchangeRuleTests(TestBase, StandardExchangeVerifier):
- """
- The server MUST predeclare a direct exchange to act as the default exchange
- for content Publish methods and for default queue bindings.
-
- Client checks that the default exchange is active by specifying a queue
- binding with no exchange name, and publishing a message with a suitable
- routing key but without specifying the exchange name, then ensuring that
- the message arrives in the queue correctly.
- """
- def testDefaultExchange(self):
- # Test automatic binding by queue name.
- self.queue_declare(queue="d")
- self.assertPublishConsume(queue="d", routing_key="d")
- # Test explicit bind to default queue
- self.verifyDirectExchange("")
-
-
-# TODO aconway 2006-09-27: Fill in empty tests:
-
-class DefaultAccessRuleTests(TestBase):
- """
- The server MUST NOT allow clients to access the default exchange except
- by specifying an empty exchange name in the Queue.Bind and content Publish
- methods.
- """
-
-class ExtensionsRuleTests(TestBase):
- """
- The server MAY implement other exchange types as wanted.
- """
-
-
-class DeclareMethodMinimumRuleTests(TestBase):
- """
- The server SHOULD support a minimum of 16 exchanges per virtual host and
- ideally, impose no limit except as defined by available resources.
-
- The client creates as many exchanges as it can until the server reports
- an error; the number of exchanges successfuly created must be at least
- sixteen.
- """
-
-
-class DeclareMethodTicketFieldValidityRuleTests(TestBase):
- """
- The client MUST provide a valid access ticket giving "active" access to
- the realm in which the exchange exists or will be created, or "passive"
- access if the if-exists flag is set.
-
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- """
-
-
-class DeclareMethodExchangeFieldReservedRuleTests(TestBase):
- """
- Exchange names starting with "amq." are reserved for predeclared and
- standardised exchanges. The client MUST NOT attempt to create an exchange
- starting with "amq.".
-
-
- """
-
-
-class DeclareMethodTypeFieldTypedRuleTests(TestBase):
- """
- Exchanges cannot be redeclared with different types. The client MUST not
- attempt to redeclare an existing exchange with a different type than used
- in the original Exchange.Declare method.
-
-
- """
-
-
-class DeclareMethodTypeFieldSupportRuleTests(TestBase):
- """
- The client MUST NOT attempt to create an exchange with a type that the
- server does not support.
-
-
- """
-
-
-class DeclareMethodPassiveFieldNotFoundRuleTests(TestBase):
- """
- If set, and the exchange does not already exist, the server MUST raise a
- channel exception with reply code 404 (not found).
- """
- def test(self):
- try:
- self.channel.exchange_declare(exchange="humpty_dumpty", passive=True)
- self.fail("Expected 404 for passive declaration of unknown exchange.")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
-
-class DeclareMethodDurableFieldSupportRuleTests(TestBase):
- """
- The server MUST support both durable and transient exchanges.
-
-
- """
-
-
-class DeclareMethodDurableFieldStickyRuleTests(TestBase):
- """
- The server MUST ignore the durable field if the exchange already exists.
-
-
- """
-
-
-class DeclareMethodAutoDeleteFieldStickyRuleTests(TestBase):
- """
- The server MUST ignore the auto-delete field if the exchange already
- exists.
-
-
- """
-
-
-class DeleteMethodTicketFieldValidityRuleTests(TestBase):
- """
- The client MUST provide a valid access ticket giving "active" access
- rights to the exchange's access realm.
-
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- """
-
-
-class DeleteMethodExchangeFieldExistsRuleTests(TestBase):
- """
- The client MUST NOT attempt to delete an exchange that does not exist.
- """
-
-
-class HeadersExchangeTests(TestBase):
- """
- Tests for headers exchange functionality.
- """
- def setUp(self):
- TestBase.setUp(self)
- self.queue_declare(queue="q")
- self.q = self.consume("q")
-
- def myAssertPublishGet(self, headers):
- self.assertPublishGet(self.q, exchange="amq.match", properties={'headers':headers})
-
- def myBasicPublish(self, headers):
- self.channel.basic_publish(exchange="amq.match", content=Content("foobar", properties={'headers':headers}))
-
- def testMatchAll(self):
- self.channel.queue_bind(queue="q", exchange="amq.match", arguments={ 'x-match':'all', "name":"fred", "age":3})
- self.myAssertPublishGet({"name":"fred", "age":3})
- self.myAssertPublishGet({"name":"fred", "age":3, "extra":"ignoreme"})
-
- # None of these should match
- self.myBasicPublish({})
- self.myBasicPublish({"name":"barney"})
- self.myBasicPublish({"name":10})
- self.myBasicPublish({"name":"fred", "age":2})
- self.assertEmpty(self.q)
-
- def testMatchAny(self):
- self.channel.queue_bind(queue="q", exchange="amq.match", arguments={ 'x-match':'any', "name":"fred", "age":3})
- self.myAssertPublishGet({"name":"fred"})
- self.myAssertPublishGet({"name":"fred", "ignoreme":10})
- self.myAssertPublishGet({"ignoreme":10, "age":3})
-
- # Wont match
- self.myBasicPublish({})
- self.myBasicPublish({"irrelevant":0})
- self.assertEmpty(self.q)
-
-
-class MiscellaneousErrorsTests(TestBase):
- """
- Test some miscellaneous error conditions
- """
- def testTypeNotKnown(self):
- try:
- self.channel.exchange_declare(exchange="test_type_not_known_exchange", type="invalid_type")
- self.fail("Expected 503 for declaration of unknown exchange type.")
- except Closed, e:
- self.assertConnectionException(503, e.args[0])
-
- def testDifferentDeclaredType(self):
- self.channel.exchange_declare(exchange="test_different_declared_type_exchange", type="direct")
- try:
- self.channel.exchange_declare(exchange="test_different_declared_type_exchange", type="topic")
- self.fail("Expected 530 for redeclaration of exchange with different type.")
- except Closed, e:
- self.assertConnectionException(530, e.args[0])
- #cleanup
- other = self.connect()
- c2 = other.channel(1)
- c2.channel_open()
- c2.exchange_delete(exchange="test_different_declared_type_exchange")
-
diff --git a/M4-RCs/qpid/python/tests_0-8/queue.py b/M4-RCs/qpid/python/tests_0-8/queue.py
deleted file mode 100644
index 60ac4c3dfb..0000000000
--- a/M4-RCs/qpid/python/tests_0-8/queue.py
+++ /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.
-#
-from qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class QueueTests(TestBase):
- """Tests for 'methods' on the amqp queue 'class'"""
-
- def test_purge(self):
- """
- Test that the purge method removes messages from the queue
- """
- channel = self.channel
- #setup, declare a queue and add some messages to it:
- channel.exchange_declare(exchange="test-exchange", type="direct")
- channel.queue_declare(queue="test-queue", exclusive=True)
- channel.queue_bind(queue="test-queue", exchange="test-exchange", routing_key="key")
- channel.basic_publish(exchange="test-exchange", routing_key="key", content=Content("one"))
- channel.basic_publish(exchange="test-exchange", routing_key="key", content=Content("two"))
- channel.basic_publish(exchange="test-exchange", routing_key="key", content=Content("three"))
-
- #check that the queue now reports 3 messages:
- reply = channel.queue_declare(queue="test-queue")
- self.assertEqual(3, reply.message_count)
-
- #now do the purge, then test that three messages are purged and the count drops to 0
- reply = channel.queue_purge(queue="test-queue");
- self.assertEqual(3, reply.message_count)
- reply = channel.queue_declare(queue="test-queue")
- self.assertEqual(0, reply.message_count)
-
- #send a further message and consume it, ensuring that the other messages are really gone
- channel.basic_publish(exchange="test-exchange", routing_key="key", content=Content("four"))
- reply = channel.basic_consume(queue="test-queue", no_ack=True)
- queue = self.client.queue(reply.consumer_tag)
- msg = queue.get(timeout=1)
- self.assertEqual("four", msg.content.body)
-
- #check error conditions (use new channels):
- channel = self.client.channel(2)
- channel.channel_open()
- try:
- #queue specified but doesn't exist:
- channel.queue_purge(queue="invalid-queue")
- self.fail("Expected failure when purging non-existent queue")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- channel = self.client.channel(3)
- channel.channel_open()
- try:
- #queue not specified and none previously declared for channel:
- channel.queue_purge()
- self.fail("Expected failure when purging unspecified queue")
- except Closed, e:
- self.assertConnectionException(530, e.args[0])
-
- #cleanup
- other = self.connect()
- channel = other.channel(1)
- channel.channel_open()
- channel.exchange_delete(exchange="test-exchange")
-
- def test_declare_exclusive(self):
- """
- Test that the exclusive field is honoured in queue.declare
- """
- # TestBase.setUp has already opened channel(1)
- c1 = self.channel
- # Here we open a second separate connection:
- other = self.connect()
- c2 = other.channel(1)
- c2.channel_open()
-
- #declare an exclusive queue:
- c1.queue_declare(queue="exclusive-queue", exclusive="True")
- try:
- #other connection should not be allowed to declare this:
- c2.queue_declare(queue="exclusive-queue", exclusive="True")
- self.fail("Expected second exclusive queue_declare to raise a channel exception")
- except Closed, e:
- self.assertChannelException(405, e.args[0])
-
-
- def test_declare_passive(self):
- """
- Test that the passive field is honoured in queue.declare
- """
- channel = self.channel
- #declare an exclusive queue:
- channel.queue_declare(queue="passive-queue-1", exclusive="True")
- channel.queue_declare(queue="passive-queue-1", passive="True")
- try:
- #other connection should not be allowed to declare this:
- channel.queue_declare(queue="passive-queue-2", passive="True")
- self.fail("Expected passive declaration of non-existant queue to raise a channel exception")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
-
- def test_bind(self):
- """
- Test various permutations of the queue.bind method
- """
- channel = self.channel
- channel.queue_declare(queue="queue-1", exclusive="True")
-
- #straightforward case, both exchange & queue exist so no errors expected:
- channel.queue_bind(queue="queue-1", exchange="amq.direct", routing_key="key1")
-
- #bind the default queue for the channel (i.e. last one declared):
- channel.queue_bind(exchange="amq.direct", routing_key="key2")
-
- #use the queue name where neither routing key nor queue are specified:
- channel.queue_bind(exchange="amq.direct")
-
- #try and bind to non-existant exchange
- try:
- channel.queue_bind(queue="queue-1", exchange="an-invalid-exchange", routing_key="key1")
- self.fail("Expected bind to non-existant exchange to fail")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- #need to reopen a channel:
- channel = self.client.channel(2)
- channel.channel_open()
-
- #try and bind non-existant queue:
- try:
- channel.queue_bind(queue="queue-2", exchange="amq.direct", routing_key="key1")
- self.fail("Expected bind of non-existant queue to fail")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
-
- def test_delete_simple(self):
- """
- Test basic queue deletion
- """
- channel = self.channel
-
- #straight-forward case:
- channel.queue_declare(queue="delete-me")
- channel.basic_publish(routing_key="delete-me", content=Content("a"))
- channel.basic_publish(routing_key="delete-me", content=Content("b"))
- channel.basic_publish(routing_key="delete-me", content=Content("c"))
- reply = channel.queue_delete(queue="delete-me")
- self.assertEqual(3, reply.message_count)
- #check that it has gone be declaring passively
- try:
- channel.queue_declare(queue="delete-me", passive="True")
- self.fail("Queue has not been deleted")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- #check attempted deletion of non-existant queue is handled correctly:
- channel = self.client.channel(2)
- channel.channel_open()
- try:
- channel.queue_delete(queue="i-dont-exist", if_empty="True")
- self.fail("Expected delete of non-existant queue to fail")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
-
-
- def test_delete_ifempty(self):
- """
- Test that if_empty field of queue_delete is honoured
- """
- channel = self.channel
-
- #create a queue and add a message to it (use default binding):
- channel.queue_declare(queue="delete-me-2")
- channel.queue_declare(queue="delete-me-2", passive="True")
- channel.basic_publish(routing_key="delete-me-2", content=Content("message"))
-
- #try to delete, but only if empty:
- try:
- channel.queue_delete(queue="delete-me-2", if_empty="True")
- self.fail("Expected delete if_empty to fail for non-empty queue")
- except Closed, e:
- self.assertChannelException(406, e.args[0])
-
- #need new channel now:
- channel = self.client.channel(2)
- channel.channel_open()
-
- #empty queue:
- reply = channel.basic_consume(queue="delete-me-2", no_ack=True)
- queue = self.client.queue(reply.consumer_tag)
- msg = queue.get(timeout=1)
- self.assertEqual("message", msg.content.body)
- channel.basic_cancel(consumer_tag=reply.consumer_tag)
-
- #retry deletion on empty queue:
- channel.queue_delete(queue="delete-me-2", if_empty="True")
-
- #check that it has gone by declaring passively:
- try:
- channel.queue_declare(queue="delete-me-2", passive="True")
- self.fail("Queue has not been deleted")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- def test_delete_ifunused(self):
- """
- Test that if_unused field of queue_delete is honoured
- """
- channel = self.channel
-
- #create a queue and register a consumer:
- channel.queue_declare(queue="delete-me-3")
- channel.queue_declare(queue="delete-me-3", passive="True")
- reply = channel.basic_consume(queue="delete-me-3", no_ack=True)
-
- #need new channel now:
- channel2 = self.client.channel(2)
- channel2.channel_open()
- #try to delete, but only if empty:
- try:
- channel2.queue_delete(queue="delete-me-3", if_unused="True")
- self.fail("Expected delete if_unused to fail for queue with existing consumer")
- except Closed, e:
- self.assertChannelException(406, e.args[0])
-
-
- channel.basic_cancel(consumer_tag=reply.consumer_tag)
- channel.queue_delete(queue="delete-me-3", if_unused="True")
- #check that it has gone by declaring passively:
- try:
- channel.queue_declare(queue="delete-me-3", passive="True")
- self.fail("Queue has not been deleted")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
-
diff --git a/M4-RCs/qpid/python/tests_0-8/testlib.py b/M4-RCs/qpid/python/tests_0-8/testlib.py
deleted file mode 100644
index cab07cc4ac..0000000000
--- a/M4-RCs/qpid/python/tests_0-8/testlib.py
+++ /dev/null
@@ -1,66 +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.
-#
-
-#
-# Tests for the testlib itself.
-#
-
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-from Queue import Empty
-
-import sys
-from traceback import *
-
-def mytrace(frame, event, arg):
- print_stack(frame);
- print "===="
- return mytrace
-
-class TestBaseTest(TestBase):
- """Verify TestBase functions work as expected"""
-
- def testAssertEmptyPass(self):
- """Test assert empty works"""
- self.queue_declare(queue="empty")
- q = self.consume("empty")
- self.assertEmpty(q)
- try:
- q.get(timeout=1)
- self.fail("Queue is not empty.")
- except Empty: None # Ignore
-
- def testAssertEmptyFail(self):
- self.queue_declare(queue="full")
- q = self.consume("full")
- self.channel.basic_publish(routing_key="full")
- try:
- self.assertEmpty(q);
- self.fail("assertEmpty did not assert on non-empty queue")
- except AssertionError: None # Ignore
-
- def testMessageProperties(self):
- """Verify properties are passed with message"""
- props={"headers":{"x":1, "y":2}}
- self.queue_declare(queue="q")
- q = self.consume("q")
- self.assertPublishGet(q, routing_key="q", properties=props)
-
-
-
diff --git a/M4-RCs/qpid/python/tests_0-8/tx.py b/M4-RCs/qpid/python/tests_0-8/tx.py
deleted file mode 100644
index 054fb8d8b7..0000000000
--- a/M4-RCs/qpid/python/tests_0-8/tx.py
+++ /dev/null
@@ -1,209 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class TxTests(TestBase):
- """
- Tests for 'methods' on the amqp tx 'class'
- """
-
- def test_commit(self):
- """
- Test that commited publishes are delivered and commited acks are not re-delivered
- """
- channel = self.channel
- queue_a, queue_b, queue_c = self.perform_txn_work(channel, "tx-commit-a", "tx-commit-b", "tx-commit-c")
- channel.tx_commit()
-
- #check results
- for i in range(1, 5):
- msg = queue_c.get(timeout=1)
- self.assertEqual("TxMessage %d" % i, msg.content.body)
-
- msg = queue_b.get(timeout=1)
- self.assertEqual("TxMessage 6", msg.content.body)
-
- msg = queue_a.get(timeout=1)
- self.assertEqual("TxMessage 7", msg.content.body)
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.content.body)
- except Empty: None
-
- #cleanup
- channel.basic_ack(delivery_tag=0, multiple=True)
- channel.tx_commit()
-
- def test_auto_rollback(self):
- """
- Test that a channel closed with an open transaction is effectively rolled back
- """
- channel = self.channel
- queue_a, queue_b, queue_c = self.perform_txn_work(channel, "tx-autorollback-a", "tx-autorollback-b", "tx-autorollback-c")
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.content.body)
- except Empty: None
-
- channel.tx_rollback()
-
- #check results
- for i in range(1, 5):
- msg = queue_a.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
-
- msg = queue_b.get(timeout=1)
- self.assertEqual("Message 6", msg.content.body)
-
- msg = queue_c.get(timeout=1)
- self.assertEqual("Message 7", msg.content.body)
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.content.body)
- except Empty: None
-
- #cleanup
- channel.basic_ack(delivery_tag=0, multiple=True)
- channel.tx_commit()
-
- def test_rollback(self):
- """
- Test that rolled back publishes are not delivered and rolled back acks are re-delivered
- """
- channel = self.channel
- queue_a, queue_b, queue_c = self.perform_txn_work(channel, "tx-rollback-a", "tx-rollback-b", "tx-rollback-c")
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.content.body)
- except Empty: None
-
- channel.tx_rollback()
-
- #check results
- for i in range(1, 5):
- msg = queue_a.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
-
- msg = queue_b.get(timeout=1)
- self.assertEqual("Message 6", msg.content.body)
-
- msg = queue_c.get(timeout=1)
- self.assertEqual("Message 7", msg.content.body)
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.content.body)
- except Empty: None
-
- #cleanup
- channel.basic_ack(delivery_tag=0, multiple=True)
- channel.tx_commit()
-
- def perform_txn_work(self, channel, name_a, name_b, name_c):
- """
- Utility method that does some setup and some work under a transaction. Used for testing both
- commit and rollback
- """
- #setup:
- channel.queue_declare(queue=name_a, exclusive=True)
- channel.queue_declare(queue=name_b, exclusive=True)
- channel.queue_declare(queue=name_c, exclusive=True)
-
- key = "my_key_" + name_b
- topic = "my_topic_" + name_c
-
- channel.queue_bind(queue=name_b, exchange="amq.direct", routing_key=key)
- channel.queue_bind(queue=name_c, exchange="amq.topic", routing_key=topic)
-
- for i in range(1, 5):
- channel.basic_publish(routing_key=name_a, content=Content("Message %d" % i))
-
- channel.basic_publish(routing_key=key, exchange="amq.direct", content=Content("Message 6"))
- channel.basic_publish(routing_key=topic, exchange="amq.topic", content=Content("Message 7"))
-
- channel.tx_select()
-
- #consume and ack messages
- sub_a = channel.basic_consume(queue=name_a, no_ack=False)
- queue_a = self.client.queue(sub_a.consumer_tag)
- for i in range(1, 5):
- msg = queue_a.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
- channel.basic_ack(delivery_tag=msg.delivery_tag, multiple=True)
-
- sub_b = channel.basic_consume(queue=name_b, no_ack=False)
- queue_b = self.client.queue(sub_b.consumer_tag)
- msg = queue_b.get(timeout=1)
- self.assertEqual("Message 6", msg.content.body)
- channel.basic_ack(delivery_tag=msg.delivery_tag)
-
- sub_c = channel.basic_consume(queue=name_c, no_ack=False)
- queue_c = self.client.queue(sub_c.consumer_tag)
- msg = queue_c.get(timeout=1)
- self.assertEqual("Message 7", msg.content.body)
- channel.basic_ack(delivery_tag=msg.delivery_tag)
-
- #publish messages
- for i in range(1, 5):
- channel.basic_publish(routing_key=topic, exchange="amq.topic", content=Content("TxMessage %d" % i))
-
- channel.basic_publish(routing_key=key, exchange="amq.direct", content=Content("TxMessage 6"))
- channel.basic_publish(routing_key=name_a, content=Content("TxMessage 7"))
-
- return queue_a, queue_b, queue_c
-
- def test_commit_overlapping_acks(self):
- """
- Test that logically 'overlapping' acks do not cause errors on commit
- """
- channel = self.channel
- channel.queue_declare(queue="commit-overlapping", exclusive=True)
- for i in range(1, 10):
- channel.basic_publish(routing_key="commit-overlapping", content=Content("Message %d" % i))
-
-
- channel.tx_select()
-
- sub = channel.basic_consume(queue="commit-overlapping", no_ack=False)
- queue = self.client.queue(sub.consumer_tag)
- for i in range(1, 10):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
- if i in [3, 6, 10]:
- channel.basic_ack(delivery_tag=msg.delivery_tag)
-
- channel.tx_commit()
-
- #check all have been acked:
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message: " + extra.content.body)
- except Empty: None
diff --git a/M4-RCs/qpid/python/tests_0-9/__init__.py b/M4-RCs/qpid/python/tests_0-9/__init__.py
deleted file mode 100644
index 9a09d2d04f..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# Do not delete - marks this directory as a python package.
-
-#
-# 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/M4-RCs/qpid/python/tests_0-9/basic.py b/M4-RCs/qpid/python/tests_0-9/basic.py
deleted file mode 100644
index 607ba26343..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/basic.py
+++ /dev/null
@@ -1,396 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class BasicTests(TestBase):
- """Tests for 'methods' on the amqp basic 'class'"""
-
- def test_consume_no_local(self):
- """
- Test that the no_local flag is honoured in the consume method
- """
- channel = self.channel
- #setup, declare two queues:
- channel.queue_declare(queue="test-queue-1a", exclusive=True)
- channel.queue_declare(queue="test-queue-1b", exclusive=True)
- #establish two consumers one of which excludes delivery of locally sent messages
- channel.basic_consume(consumer_tag="local_included", queue="test-queue-1a")
- channel.basic_consume(consumer_tag="local_excluded", queue="test-queue-1b", no_local=True)
-
- #send a message
- channel.basic_publish(routing_key="test-queue-1a", content=Content("consume_no_local"))
- channel.basic_publish(routing_key="test-queue-1b", content=Content("consume_no_local"))
-
- #check the queues of the two consumers
- excluded = self.client.queue("local_excluded")
- included = self.client.queue("local_included")
- msg = included.get(timeout=1)
- self.assertEqual("consume_no_local", msg.content.body)
- try:
- excluded.get(timeout=1)
- self.fail("Received locally published message though no_local=true")
- except Empty: None
-
-
- def test_consume_exclusive(self):
- """
- Test that the exclusive flag is honoured in the consume method
- """
- channel = self.channel
- #setup, declare a queue:
- channel.queue_declare(queue="test-queue-2", exclusive=True)
-
- #check that an exclusive consumer prevents other consumer being created:
- channel.basic_consume(consumer_tag="first", queue="test-queue-2", exclusive=True)
- try:
- channel.basic_consume(consumer_tag="second", queue="test-queue-2")
- self.fail("Expected consume request to fail due to previous exclusive consumer")
- except Closed, e:
- self.assertChannelException(403, e.args[0])
-
- #open new channel and cleanup last consumer:
- channel = self.client.channel(2)
- channel.channel_open()
-
- #check that an exclusive consumer cannot be created if a consumer already exists:
- channel.basic_consume(consumer_tag="first", queue="test-queue-2")
- try:
- channel.basic_consume(consumer_tag="second", queue="test-queue-2", exclusive=True)
- self.fail("Expected exclusive consume request to fail due to previous consumer")
- except Closed, e:
- self.assertChannelException(403, e.args[0])
-
- def test_consume_queue_errors(self):
- """
- Test error conditions associated with the queue field of the consume method:
- """
- channel = self.channel
- try:
- #queue specified but doesn't exist:
- channel.basic_consume(queue="invalid-queue")
- self.fail("Expected failure when consuming from non-existent queue")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- channel = self.client.channel(2)
- channel.channel_open()
- try:
- #queue not specified and none previously declared for channel:
- channel.basic_consume(queue="")
- self.fail("Expected failure when consuming from unspecified queue")
- except Closed, e:
- self.assertConnectionException(530, e.args[0])
-
- def test_consume_unique_consumers(self):
- """
- Ensure unique consumer tags are enforced
- """
- channel = self.channel
- #setup, declare a queue:
- channel.queue_declare(queue="test-queue-3", exclusive=True)
-
- #check that attempts to use duplicate tags are detected and prevented:
- channel.basic_consume(consumer_tag="first", queue="test-queue-3")
- try:
- channel.basic_consume(consumer_tag="first", queue="test-queue-3")
- self.fail("Expected consume request to fail due to non-unique tag")
- except Closed, e:
- self.assertConnectionException(530, e.args[0])
-
- def test_cancel(self):
- """
- Test compliance of the basic.cancel method
- """
- channel = self.channel
- #setup, declare a queue:
- channel.queue_declare(queue="test-queue-4", exclusive=True)
- channel.basic_consume(consumer_tag="my-consumer", queue="test-queue-4")
- channel.basic_publish(routing_key="test-queue-4", content=Content("One"))
-
- myqueue = self.client.queue("my-consumer")
- msg = myqueue.get(timeout=1)
- self.assertEqual("One", msg.content.body)
-
- #cancel should stop messages being delivered
- channel.basic_cancel(consumer_tag="my-consumer")
- channel.basic_publish(routing_key="test-queue-4", content=Content("Two"))
- try:
- msg = myqueue.get(timeout=1)
- self.fail("Got message after cancellation: " + msg)
- except Empty: None
-
- #cancellation of non-existant consumers should be handled without error
- channel.basic_cancel(consumer_tag="my-consumer")
- channel.basic_cancel(consumer_tag="this-never-existed")
-
-
- def test_ack(self):
- """
- Test basic ack/recover behaviour
- """
- channel = self.channel
- channel.queue_declare(queue="test-ack-queue", exclusive=True)
-
- reply = channel.basic_consume(queue="test-ack-queue", no_ack=False)
- queue = self.client.queue(reply.consumer_tag)
-
- channel.basic_publish(routing_key="test-ack-queue", content=Content("One"))
- channel.basic_publish(routing_key="test-ack-queue", content=Content("Two"))
- channel.basic_publish(routing_key="test-ack-queue", content=Content("Three"))
- channel.basic_publish(routing_key="test-ack-queue", content=Content("Four"))
- channel.basic_publish(routing_key="test-ack-queue", content=Content("Five"))
-
- msg1 = queue.get(timeout=1)
- msg2 = queue.get(timeout=1)
- msg3 = queue.get(timeout=1)
- msg4 = queue.get(timeout=1)
- msg5 = queue.get(timeout=1)
-
- self.assertEqual("One", msg1.content.body)
- self.assertEqual("Two", msg2.content.body)
- self.assertEqual("Three", msg3.content.body)
- self.assertEqual("Four", msg4.content.body)
- self.assertEqual("Five", msg5.content.body)
-
- channel.basic_ack(delivery_tag=msg2.delivery_tag, multiple=True) #One & Two
- channel.basic_ack(delivery_tag=msg4.delivery_tag, multiple=False) #Four
-
- channel.basic_recover(requeue=False)
-
- msg3b = queue.get(timeout=1)
- msg5b = queue.get(timeout=1)
-
- self.assertEqual("Three", msg3b.content.body)
- self.assertEqual("Five", msg5b.content.body)
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message: " + extra.content.body)
- except Empty: None
-
- def test_recover_requeue(self):
- """
- Test requeing on recovery
- """
- channel = self.channel
- channel.queue_declare(queue="test-requeue", exclusive=True)
-
- subscription = channel.basic_consume(queue="test-requeue", no_ack=False)
- queue = self.client.queue(subscription.consumer_tag)
-
- channel.basic_publish(routing_key="test-requeue", content=Content("One"))
- channel.basic_publish(routing_key="test-requeue", content=Content("Two"))
- channel.basic_publish(routing_key="test-requeue", content=Content("Three"))
- channel.basic_publish(routing_key="test-requeue", content=Content("Four"))
- channel.basic_publish(routing_key="test-requeue", content=Content("Five"))
-
- msg1 = queue.get(timeout=1)
- msg2 = queue.get(timeout=1)
- msg3 = queue.get(timeout=1)
- msg4 = queue.get(timeout=1)
- msg5 = queue.get(timeout=1)
-
- self.assertEqual("One", msg1.content.body)
- self.assertEqual("Two", msg2.content.body)
- self.assertEqual("Three", msg3.content.body)
- self.assertEqual("Four", msg4.content.body)
- self.assertEqual("Five", msg5.content.body)
-
- channel.basic_ack(delivery_tag=msg2.delivery_tag, multiple=True) #One & Two
- channel.basic_ack(delivery_tag=msg4.delivery_tag, multiple=False) #Four
-
- channel.basic_cancel(consumer_tag=subscription.consumer_tag)
-
- channel.basic_recover(requeue=True)
-
- subscription2 = channel.basic_consume(queue="test-requeue")
- queue2 = self.client.queue(subscription2.consumer_tag)
-
- msg3b = queue2.get(timeout=1)
- msg5b = queue2.get(timeout=1)
-
- self.assertEqual("Three", msg3b.content.body)
- self.assertEqual("Five", msg5b.content.body)
-
- self.assertEqual(True, msg3b.redelivered)
- self.assertEqual(True, msg5b.redelivered)
-
- try:
- extra = queue2.get(timeout=1)
- self.fail("Got unexpected message in second queue: " + extra.content.body)
- except Empty: None
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message in original queue: " + extra.content.body)
- except Empty: None
-
-
- def test_qos_prefetch_count(self):
- """
- Test that the prefetch count specified is honoured
- """
- #setup: declare queue and subscribe
- channel = self.channel
- channel.queue_declare(queue="test-prefetch-count", exclusive=True)
- subscription = channel.basic_consume(queue="test-prefetch-count", no_ack=False)
- queue = self.client.queue(subscription.consumer_tag)
-
- #set prefetch to 5:
- channel.basic_qos(prefetch_count=5)
-
- #publish 10 messages:
- for i in range(1, 11):
- channel.basic_publish(routing_key="test-prefetch-count", content=Content("Message %d" % i))
-
- #only 5 messages should have been delivered:
- for i in range(1, 6):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 6th message in original queue: " + extra.content.body)
- except Empty: None
-
- #ack messages and check that the next set arrive ok:
- channel.basic_ack(delivery_tag=msg.delivery_tag, multiple=True)
-
- for i in range(6, 11):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
-
- channel.basic_ack(delivery_tag=msg.delivery_tag, multiple=True)
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 11th message in original queue: " + extra.content.body)
- except Empty: None
-
-
-
- def test_qos_prefetch_size(self):
- """
- Test that the prefetch size specified is honoured
- """
- #setup: declare queue and subscribe
- channel = self.channel
- channel.queue_declare(queue="test-prefetch-size", exclusive=True)
- subscription = channel.basic_consume(queue="test-prefetch-size", no_ack=False)
- queue = self.client.queue(subscription.consumer_tag)
-
- #set prefetch to 50 bytes (each message is 9 or 10 bytes):
- channel.basic_qos(prefetch_size=50)
-
- #publish 10 messages:
- for i in range(1, 11):
- channel.basic_publish(routing_key="test-prefetch-size", content=Content("Message %d" % i))
-
- #only 5 messages should have been delivered (i.e. 45 bytes worth):
- for i in range(1, 6):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 6th message in original queue: " + extra.content.body)
- except Empty: None
-
- #ack messages and check that the next set arrive ok:
- channel.basic_ack(delivery_tag=msg.delivery_tag, multiple=True)
-
- for i in range(6, 11):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.content.body)
-
- channel.basic_ack(delivery_tag=msg.delivery_tag, multiple=True)
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 11th message in original queue: " + extra.content.body)
- except Empty: None
-
- #make sure that a single oversized message still gets delivered
- large = "abcdefghijklmnopqrstuvwxyz"
- large = large + "-" + large;
- channel.basic_publish(routing_key="test-prefetch-size", content=Content(large))
- msg = queue.get(timeout=1)
- self.assertEqual(large, msg.content.body)
-
- def test_get(self):
- """
- Test basic_get method
- """
- channel = self.channel
- channel.queue_declare(queue="test-get", exclusive=True)
-
- #publish some messages (no_ack=True)
- for i in range(1, 11):
- channel.basic_publish(routing_key="test-get", content=Content("Message %d" % i))
-
- #use basic_get to read back the messages, and check that we get an empty at the end
- for i in range(1, 11):
- reply = channel.basic_get(no_ack=True)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_ok")
- self.assertEqual("Message %d" % i, reply.content.body)
-
- reply = channel.basic_get(no_ack=True)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_empty")
-
- #repeat for no_ack=False
- for i in range(11, 21):
- channel.basic_publish(routing_key="test-get", content=Content("Message %d" % i))
-
- for i in range(11, 21):
- reply = channel.basic_get(no_ack=False)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_ok")
- self.assertEqual("Message %d" % i, reply.content.body)
- if(i == 13):
- channel.basic_ack(delivery_tag=reply.delivery_tag, multiple=True)
- if(i in [15, 17, 19]):
- channel.basic_ack(delivery_tag=reply.delivery_tag)
-
- reply = channel.basic_get(no_ack=True)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_empty")
-
- #recover(requeue=True)
- channel.basic_recover(requeue=True)
-
- #get the unacked messages again (14, 16, 18, 20)
- for i in [14, 16, 18, 20]:
- reply = channel.basic_get(no_ack=False)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_ok")
- self.assertEqual("Message %d" % i, reply.content.body)
- channel.basic_ack(delivery_tag=reply.delivery_tag)
-
- reply = channel.basic_get(no_ack=True)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_empty")
-
- channel.basic_recover(requeue=True)
-
- reply = channel.basic_get(no_ack=True)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get_empty")
diff --git a/M4-RCs/qpid/python/tests_0-9/broker.py b/M4-RCs/qpid/python/tests_0-9/broker.py
deleted file mode 100644
index 03b4132d3e..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/broker.py
+++ /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.
-#
-from qpid.client import Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class BrokerTests(TestBase):
- """Tests for basic Broker functionality"""
-
- def test_ack_and_no_ack(self):
- """
- First, this test tries to receive a message with a no-ack
- consumer. Second, this test tries to explicitly receive and
- acknowledge a message with an acknowledging consumer.
- """
- ch = self.channel
- self.queue_declare(ch, queue = "myqueue")
-
- # No ack consumer
- ctag = "tag1"
- ch.message_consume(queue = "myqueue", destination = ctag, no_ack = True)
- body = "test no-ack"
- ch.message_transfer(routing_key = "myqueue", body = body)
- msg = self.client.queue(ctag).get(timeout = 5)
- self.assert_(msg.body == body)
-
- # Acknowledging consumer
- self.queue_declare(ch, queue = "otherqueue")
- ctag = "tag2"
- ch.message_consume(queue = "otherqueue", destination = ctag, no_ack = False)
- body = "test ack"
- ch.message_transfer(routing_key = "otherqueue", body = body)
- msg = self.client.queue(ctag).get(timeout = 5)
- msg.ok()
- self.assert_(msg.body == body)
-
- def test_simple_delivery_immediate(self):
- """
- Test simple message delivery where consume is issued before publish
- """
- channel = self.channel
- self.exchange_declare(channel, exchange="test-exchange", type="direct")
- self.queue_declare(channel, queue="test-queue")
- channel.queue_bind(queue="test-queue", exchange="test-exchange", routing_key="key")
- consumer_tag = "tag1"
- channel.message_consume(queue="test-queue", destination=consumer_tag, no_ack=True)
- queue = self.client.queue(consumer_tag)
-
- body = "Immediate Delivery"
- channel.message_transfer(destination="test-exchange", routing_key="key", body=body, immediate=True)
- msg = queue.get(timeout=5)
- self.assert_(msg.body == body)
-
- # TODO: Ensure we fail if immediate=True and there's no consumer.
-
-
- def test_simple_delivery_queued(self):
- """
- Test basic message delivery where publish is issued before consume
- (i.e. requires queueing of the message)
- """
- channel = self.channel
- self.exchange_declare(channel, exchange="test-exchange", type="direct")
- self.queue_declare(channel, queue="test-queue")
- channel.queue_bind(queue="test-queue", exchange="test-exchange", routing_key="key")
- body = "Queued Delivery"
- channel.message_transfer(destination="test-exchange", routing_key="key", body=body)
-
- consumer_tag = "tag1"
- channel.message_consume(queue="test-queue", destination=consumer_tag, no_ack=True)
- queue = self.client.queue(consumer_tag)
- msg = queue.get(timeout=5)
- self.assert_(msg.body == body)
-
- def test_invalid_channel(self):
- channel = self.client.channel(200)
- try:
- channel.queue_declare(exclusive=True)
- self.fail("Expected error on queue_declare for invalid channel")
- except Closed, e:
- self.assertConnectionException(504, e.args[0])
-
- def test_closed_channel(self):
- channel = self.client.channel(200)
- channel.channel_open()
- channel.channel_close()
- try:
- channel.queue_declare(exclusive=True)
- self.fail("Expected error on queue_declare for closed channel")
- except Closed, e:
- if isinstance(e.args[0], str): self.fail(e)
- self.assertConnectionException(504, e.args[0])
-
- def test_ping_pong(self):
- channel = self.channel
- reply = channel.channel_ping()
- self.assertEqual(reply.method.klass.name, "channel")
- self.assertEqual(reply.method.name, "ok")
- #todo: provide a way to get notified of incoming pongs...
-
- def test_channel_flow(self):
- channel = self.channel
- channel.queue_declare(queue="flow_test_queue", exclusive=True)
- channel.message_consume(destination="my-tag", queue="flow_test_queue")
- incoming = self.client.queue("my-tag")
-
- channel.channel_flow(active=False)
- channel.message_transfer(routing_key="flow_test_queue", body="abcdefghijklmnopqrstuvwxyz")
- try:
- incoming.get(timeout=1)
- self.fail("Received message when flow turned off.")
- except Empty: None
-
- channel.channel_flow(active=True)
- msg = incoming.get(timeout=1)
- self.assertEqual("abcdefghijklmnopqrstuvwxyz", msg.body)
diff --git a/M4-RCs/qpid/python/tests_0-9/dtx.py b/M4-RCs/qpid/python/tests_0-9/dtx.py
deleted file mode 100644
index bc268f4129..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/dtx.py
+++ /dev/null
@@ -1,587 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-from struct import pack, unpack
-from time import sleep
-
-class DtxTests(TestBase):
- """
- Tests for the amqp dtx related classes.
-
- Tests of the form test_simple_xxx test the basic transactional
- behaviour. The approach here is to 'swap' a message from one queue
- to another by consuming and re-publishing in the same
- transaction. That transaction is then completed in different ways
- and the appropriate result verified.
-
- The other tests enforce more specific rules and behaviour on a
- per-method or per-field basis.
- """
-
- XA_RBROLLBACK = 1
- XA_RBTIMEOUT = 2
- XA_OK = 8
-
- def test_simple_commit(self):
- """
- Test basic one-phase commit behaviour.
- """
- channel = self.channel
- tx = self.xid("my-xid")
- self.txswap(tx, "commit")
-
- #neither queue should have any messages accessible
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(0, "queue-b")
-
- #commit
- self.assertEqual(self.XA_OK, channel.dtx_coordination_commit(xid=tx, one_phase=True).flags)
-
- #check result
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(1, "queue-b")
- self.assertMessageId("commit", "queue-b")
-
- def test_simple_prepare_commit(self):
- """
- Test basic two-phase commit behaviour.
- """
- channel = self.channel
- tx = self.xid("my-xid")
- self.txswap(tx, "prepare-commit")
-
- #prepare
- self.assertEqual(self.XA_OK, channel.dtx_coordination_prepare(xid=tx).flags)
-
- #neither queue should have any messages accessible
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(0, "queue-b")
-
- #commit
- self.assertEqual(self.XA_OK, channel.dtx_coordination_commit(xid=tx, one_phase=False).flags)
-
- #check result
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(1, "queue-b")
- self.assertMessageId("prepare-commit", "queue-b")
-
-
- def test_simple_rollback(self):
- """
- Test basic rollback behaviour.
- """
- channel = self.channel
- tx = self.xid("my-xid")
- self.txswap(tx, "rollback")
-
- #neither queue should have any messages accessible
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(0, "queue-b")
-
- #rollback
- self.assertEqual(self.XA_OK, channel.dtx_coordination_rollback(xid=tx).flags)
-
- #check result
- self.assertMessageCount(1, "queue-a")
- self.assertMessageCount(0, "queue-b")
- self.assertMessageId("rollback", "queue-a")
-
- def test_simple_prepare_rollback(self):
- """
- Test basic rollback behaviour after the transaction has been prepared.
- """
- channel = self.channel
- tx = self.xid("my-xid")
- self.txswap(tx, "prepare-rollback")
-
- #prepare
- self.assertEqual(self.XA_OK, channel.dtx_coordination_prepare(xid=tx).flags)
-
- #neither queue should have any messages accessible
- self.assertMessageCount(0, "queue-a")
- self.assertMessageCount(0, "queue-b")
-
- #rollback
- self.assertEqual(self.XA_OK, channel.dtx_coordination_rollback(xid=tx).flags)
-
- #check result
- self.assertMessageCount(1, "queue-a")
- self.assertMessageCount(0, "queue-b")
- self.assertMessageId("prepare-rollback", "queue-a")
-
- def test_select_required(self):
- """
- check that an error is flagged if select is not issued before
- start or end
- """
- channel = self.channel
- tx = self.xid("dummy")
- try:
- channel.dtx_demarcation_start(xid=tx)
-
- #if we get here we have failed, but need to do some cleanup:
- channel.dtx_demarcation_end(xid=tx)
- channel.dtx_coordination_rollback(xid=tx)
- self.fail("Channel not selected for use with dtx, expected exception!")
- except Closed, e:
- self.assertConnectionException(503, e.args[0])
-
- def test_start_already_known(self):
- """
- Verify that an attempt to start an association with a
- transaction that is already known is not allowed (unless the
- join flag is set).
- """
- #create two channels on different connection & select them for use with dtx:
- channel1 = self.channel
- channel1.dtx_demarcation_select()
-
- other = self.connect()
- channel2 = other.channel(1)
- channel2.channel_open()
- channel2.dtx_demarcation_select()
-
- #create a xid
- tx = self.xid("dummy")
- #start work on one channel under that xid:
- channel1.dtx_demarcation_start(xid=tx)
- #then start on the other without the join set
- failed = False
- try:
- channel2.dtx_demarcation_start(xid=tx)
- except Closed, e:
- failed = True
- error = e
-
- #cleanup:
- if not failed:
- channel2.dtx_demarcation_end(xid=tx)
- other.close()
- channel1.dtx_demarcation_end(xid=tx)
- channel1.dtx_coordination_rollback(xid=tx)
-
- #verification:
- if failed: self.assertConnectionException(503, e.args[0])
- else: self.fail("Xid already known, expected exception!")
-
- def test_forget_xid_on_completion(self):
- """
- Verify that a xid is 'forgotten' - and can therefore be used
- again - once it is completed.
- """
- channel = self.channel
- #do some transactional work & complete the transaction
- self.test_simple_commit()
-
- #start association for the same xid as the previously completed txn
- tx = self.xid("my-xid")
- channel.dtx_demarcation_start(xid=tx)
- channel.dtx_demarcation_end(xid=tx)
- channel.dtx_coordination_rollback(xid=tx)
-
- def test_start_join_and_resume(self):
- """
- Ensure the correct error is signalled when both the join and
- resume flags are set on starting an association between a
- channel and a transcation.
- """
- channel = self.channel
- channel.dtx_demarcation_select()
- tx = self.xid("dummy")
- try:
- channel.dtx_demarcation_start(xid=tx, join=True, resume=True)
- #failed, but need some cleanup:
- channel.dtx_demarcation_end(xid=tx)
- channel.dtx_coordination_rollback(xid=tx)
- self.fail("Join and resume both set, expected exception!")
- except Closed, e:
- self.assertConnectionException(503, e.args[0])
-
- def test_start_join(self):
- """
- Verify 'join' behaviour, where a channel is associated with a
- transaction that is already associated with another channel.
- """
- #create two channels & select them for use with dtx:
- channel1 = self.channel
- channel1.dtx_demarcation_select()
-
- channel2 = self.client.channel(2)
- channel2.channel_open()
- channel2.dtx_demarcation_select()
-
- #setup
- channel1.queue_declare(queue="one", exclusive=True)
- channel1.queue_declare(queue="two", exclusive=True)
- channel1.message_transfer(routing_key="one", message_id="a", body="DtxMessage")
- channel1.message_transfer(routing_key="two", message_id="b", body="DtxMessage")
-
- #create a xid
- tx = self.xid("dummy")
- #start work on one channel under that xid:
- channel1.dtx_demarcation_start(xid=tx)
- #then start on the other with the join flag set
- channel2.dtx_demarcation_start(xid=tx, join=True)
-
- #do work through each channel
- self.swap(channel1, "one", "two")#swap 'a' from 'one' to 'two'
- self.swap(channel2, "two", "one")#swap 'b' from 'two' to 'one'
-
- #mark end on both channels
- channel1.dtx_demarcation_end(xid=tx)
- channel2.dtx_demarcation_end(xid=tx)
-
- #commit and check
- channel1.dtx_coordination_commit(xid=tx, one_phase=True)
- self.assertMessageCount(1, "one")
- self.assertMessageCount(1, "two")
- self.assertMessageId("a", "two")
- self.assertMessageId("b", "one")
-
-
- def test_suspend_resume(self):
- """
- Test suspension and resumption of an association
- """
- channel = self.channel
- channel.dtx_demarcation_select()
-
- #setup
- channel.queue_declare(queue="one", exclusive=True)
- channel.queue_declare(queue="two", exclusive=True)
- channel.message_transfer(routing_key="one", message_id="a", body="DtxMessage")
- channel.message_transfer(routing_key="two", message_id="b", body="DtxMessage")
-
- tx = self.xid("dummy")
-
- channel.dtx_demarcation_start(xid=tx)
- self.swap(channel, "one", "two")#swap 'a' from 'one' to 'two'
- channel.dtx_demarcation_end(xid=tx, suspend=True)
-
- channel.dtx_demarcation_start(xid=tx, resume=True)
- self.swap(channel, "two", "one")#swap 'b' from 'two' to 'one'
- channel.dtx_demarcation_end(xid=tx)
-
- #commit and check
- channel.dtx_coordination_commit(xid=tx, one_phase=True)
- self.assertMessageCount(1, "one")
- self.assertMessageCount(1, "two")
- self.assertMessageId("a", "two")
- self.assertMessageId("b", "one")
-
- def test_end_suspend_and_fail(self):
- """
- Verify that the correct error is signalled if the suspend and
- fail flag are both set when disassociating a transaction from
- the channel
- """
- channel = self.channel
- channel.dtx_demarcation_select()
- tx = self.xid("suspend_and_fail")
- channel.dtx_demarcation_start(xid=tx)
- try:
- channel.dtx_demarcation_end(xid=tx, suspend=True, fail=True)
- self.fail("Suspend and fail both set, expected exception!")
- except Closed, e:
- self.assertConnectionException(503, e.args[0])
-
- #cleanup
- other = self.connect()
- channel = other.channel(1)
- channel.channel_open()
- channel.dtx_coordination_rollback(xid=tx)
- channel.channel_close()
- other.close()
-
-
- def test_end_unknown_xid(self):
- """
- Verifies that the correct exception is thrown when an attempt
- is made to end the association for a xid not previously
- associated with the channel
- """
- channel = self.channel
- channel.dtx_demarcation_select()
- tx = self.xid("unknown-xid")
- try:
- channel.dtx_demarcation_end(xid=tx)
- self.fail("Attempted to end association with unknown xid, expected exception!")
- except Closed, e:
- #FYI: this is currently *not* the exception specified, but I think the spec is wrong! Confirming...
- self.assertConnectionException(503, e.args[0])
-
- def test_end(self):
- """
- Verify that the association is terminated by end and subsequent
- operations are non-transactional
- """
- channel = self.client.channel(2)
- channel.channel_open()
- channel.queue_declare(queue="tx-queue", exclusive=True)
-
- #publish a message under a transaction
- channel.dtx_demarcation_select()
- tx = self.xid("dummy")
- channel.dtx_demarcation_start(xid=tx)
- channel.message_transfer(routing_key="tx-queue", message_id="one", body="DtxMessage")
- channel.dtx_demarcation_end(xid=tx)
-
- #now that association with txn is ended, publish another message
- channel.message_transfer(routing_key="tx-queue", message_id="two", body="DtxMessage")
-
- #check the second message is available, but not the first
- self.assertMessageCount(1, "tx-queue")
- channel.message_consume(queue="tx-queue", destination="results", no_ack=False)
- msg = self.client.queue("results").get(timeout=1)
- self.assertEqual("two", msg.message_id)
- channel.message_cancel(destination="results")
- #ack the message then close the channel
- msg.ok()
- channel.channel_close()
-
- channel = self.channel
- #commit the transaction and check that the first message (and
- #only the first message) is then delivered
- channel.dtx_coordination_commit(xid=tx, one_phase=True)
- self.assertMessageCount(1, "tx-queue")
- self.assertMessageId("one", "tx-queue")
-
- def test_invalid_commit_one_phase_true(self):
- """
- Test that a commit with one_phase = True is rejected if the
- transaction in question has already been prepared.
- """
- other = self.connect()
- tester = other.channel(1)
- tester.channel_open()
- tester.queue_declare(queue="dummy", exclusive=True)
- tester.dtx_demarcation_select()
- tx = self.xid("dummy")
- tester.dtx_demarcation_start(xid=tx)
- tester.message_transfer(routing_key="dummy", body="whatever")
- tester.dtx_demarcation_end(xid=tx)
- tester.dtx_coordination_prepare(xid=tx)
- failed = False
- try:
- tester.dtx_coordination_commit(xid=tx, one_phase=True)
- except Closed, e:
- failed = True
- error = e
-
- if failed:
- self.channel.dtx_coordination_rollback(xid=tx)
- self.assertConnectionException(503, e.args[0])
- else:
- tester.channel_close()
- other.close()
- self.fail("Invalid use of one_phase=True, expected exception!")
-
- def test_invalid_commit_one_phase_false(self):
- """
- Test that a commit with one_phase = False is rejected if the
- transaction in question has not yet been prepared.
- """
- """
- Test that a commit with one_phase = True is rejected if the
- transaction in question has already been prepared.
- """
- other = self.connect()
- tester = other.channel(1)
- tester.channel_open()
- tester.queue_declare(queue="dummy", exclusive=True)
- tester.dtx_demarcation_select()
- tx = self.xid("dummy")
- tester.dtx_demarcation_start(xid=tx)
- tester.message_transfer(routing_key="dummy", body="whatever")
- tester.dtx_demarcation_end(xid=tx)
- failed = False
- try:
- tester.dtx_coordination_commit(xid=tx, one_phase=False)
- except Closed, e:
- failed = True
- error = e
-
- if failed:
- self.channel.dtx_coordination_rollback(xid=tx)
- self.assertConnectionException(503, e.args[0])
- else:
- tester.channel_close()
- other.close()
- self.fail("Invalid use of one_phase=False, expected exception!")
-
- def test_implicit_end(self):
- """
- Test that an association is implicitly ended when the channel
- is closed (whether by exception or explicit client request)
- and the transaction in question is marked as rollback only.
- """
- channel1 = self.channel
- channel2 = self.client.channel(2)
- channel2.channel_open()
-
- #setup:
- channel2.queue_declare(queue="dummy", exclusive=True)
- channel2.message_transfer(routing_key="dummy", body="whatever")
- tx = self.xid("dummy")
-
- channel2.dtx_demarcation_select()
- channel2.dtx_demarcation_start(xid=tx)
- channel2.message_get(queue="dummy", destination="dummy")
- self.client.queue("dummy").get(timeout=1).ok()
- channel2.message_transfer(routing_key="dummy", body="whatever")
- channel2.channel_close()
-
- self.assertEqual(self.XA_RBROLLBACK, channel1.dtx_coordination_prepare(xid=tx).flags)
- channel1.dtx_coordination_rollback(xid=tx)
-
- def test_get_timeout(self):
- """
- Check that get-timeout returns the correct value, (and that a
- transaction with a timeout can complete normally)
- """
- channel = self.channel
- tx = self.xid("dummy")
-
- channel.dtx_demarcation_select()
- channel.dtx_demarcation_start(xid=tx)
- self.assertEqual(0, channel.dtx_coordination_get_timeout(xid=tx).timeout)
- channel.dtx_coordination_set_timeout(xid=tx, timeout=60)
- self.assertEqual(60, channel.dtx_coordination_get_timeout(xid=tx).timeout)
- self.assertEqual(self.XA_OK, channel.dtx_demarcation_end(xid=tx).flags)
- self.assertEqual(self.XA_OK, channel.dtx_coordination_rollback(xid=tx).flags)
-
- def test_set_timeout(self):
- """
- Test the timeout of a transaction results in the expected
- behaviour
- """
- #open new channel to allow self.channel to be used in checking te queue
- channel = self.client.channel(2)
- channel.channel_open()
- #setup:
- tx = self.xid("dummy")
- channel.queue_declare(queue="queue-a", exclusive=True)
- channel.queue_declare(queue="queue-b", exclusive=True)
- channel.message_transfer(routing_key="queue-a", message_id="timeout", body="DtxMessage")
-
- channel.dtx_demarcation_select()
- channel.dtx_demarcation_start(xid=tx)
- self.swap(channel, "queue-a", "queue-b")
- channel.dtx_coordination_set_timeout(xid=tx, timeout=2)
- sleep(3)
- #check that the work has been rolled back already
- self.assertMessageCount(1, "queue-a")
- self.assertMessageCount(0, "queue-b")
- self.assertMessageId("timeout", "queue-a")
- #check the correct codes are returned when we try to complete the txn
- self.assertEqual(self.XA_RBTIMEOUT, channel.dtx_demarcation_end(xid=tx).flags)
- self.assertEqual(self.XA_RBTIMEOUT, channel.dtx_coordination_rollback(xid=tx).flags)
-
-
-
- def test_recover(self):
- """
- Test basic recover behaviour
- """
- channel = self.channel
-
- channel.dtx_demarcation_select()
- channel.queue_declare(queue="dummy", exclusive=True)
-
- prepared = []
- for i in range(1, 10):
- tx = self.xid("tx%s" % (i))
- channel.dtx_demarcation_start(xid=tx)
- channel.message_transfer(routing_key="dummy", body="message%s" % (i))
- channel.dtx_demarcation_end(xid=tx)
- if i in [2, 5, 6, 8]:
- channel.dtx_coordination_prepare(xid=tx)
- prepared.append(tx)
- else:
- channel.dtx_coordination_rollback(xid=tx)
-
- indoubt = channel.dtx_coordination_recover().xids
- #convert indoubt table to a list of xids (note: this will change for 0-10)
- data = indoubt["xids"]
- xids = []
- pos = 0
- while pos < len(data):
- size = unpack("!B", data[pos])[0]
- start = pos + 1
- end = start + size
- xid = data[start:end]
- xids.append(xid)
- pos = end
-
- #rollback the prepared transactions returned by recover
- for x in xids:
- channel.dtx_coordination_rollback(xid=x)
-
- #validate against the expected list of prepared transactions
- actual = set(xids)
- expected = set(prepared)
- intersection = actual.intersection(expected)
-
- if intersection != expected:
- missing = expected.difference(actual)
- extra = actual.difference(expected)
- for x in missing:
- channel.dtx_coordination_rollback(xid=x)
- self.fail("Recovered xids not as expected. missing: %s; extra: %s" % (missing, extra))
-
- def xid(self, txid, branchqual = ''):
- return pack('LBB', 0, len(txid), len(branchqual)) + txid + branchqual
-
- def txswap(self, tx, id):
- channel = self.channel
- #declare two queues:
- channel.queue_declare(queue="queue-a", exclusive=True)
- channel.queue_declare(queue="queue-b", exclusive=True)
- #put message with specified id on one queue:
- channel.message_transfer(routing_key="queue-a", message_id=id, body="DtxMessage")
-
- #start the transaction:
- channel.dtx_demarcation_select()
- self.assertEqual(self.XA_OK, self.channel.dtx_demarcation_start(xid=tx).flags)
-
- #'swap' the message from one queue to the other, under that transaction:
- self.swap(self.channel, "queue-a", "queue-b")
-
- #mark the end of the transactional work:
- self.assertEqual(self.XA_OK, self.channel.dtx_demarcation_end(xid=tx).flags)
-
- def swap(self, channel, src, dest):
- #consume from src:
- channel.message_get(destination="temp-swap", queue=src)
- msg = self.client.queue("temp-swap").get(timeout=1)
- msg.ok();
-
- #re-publish to dest
- channel.message_transfer(routing_key=dest, message_id=msg.message_id, body=msg.body)
-
- def assertMessageCount(self, expected, queue):
- self.assertEqual(expected, self.channel.queue_declare(queue=queue, passive=True).message_count)
-
- def assertMessageId(self, expected, queue):
- self.channel.message_consume(queue=queue, destination="results", no_ack=True)
- self.assertEqual(expected, self.client.queue("results").get(timeout=1).message_id)
- self.channel.message_cancel(destination="results")
diff --git a/M4-RCs/qpid/python/tests_0-9/example.py b/M4-RCs/qpid/python/tests_0-9/example.py
deleted file mode 100644
index 7ab4cc7d0a..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/example.py
+++ /dev/null
@@ -1,94 +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 qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class ExampleTest (TestBase):
- """
- An example Qpid test, illustrating the unittest frameowkr and the
- python Qpid client. The test class must inherit TestCase. The
- test code uses the Qpid client to interact with a qpid broker and
- verify it behaves as expected.
- """
-
- def test_example(self):
- """
- An example test. Note that test functions must start with 'test_'
- to be recognized by the test framework.
- """
-
- # By inheriting TestBase, self.client is automatically connected
- # and self.channel is automatically opened as channel(1)
- # Other channel methods mimic the protocol.
- channel = self.channel
-
- # Now we can send regular commands. If you want to see what the method
- # arguments mean or what other commands are available, you can use the
- # python builtin help() method. For example:
- #help(chan)
- #help(chan.exchange_declare)
-
- # If you want browse the available protocol methods without being
- # connected to a live server you can use the amqp-doc utility:
- #
- # Usage amqp-doc [<options>] <spec> [<pattern_1> ... <pattern_n>]
- #
- # Options:
- # -e, --regexp use regex instead of glob when matching
-
- # Now that we know what commands are available we can use them to
- # interact with the server.
-
- # Here we use ordinal arguments.
- self.exchange_declare(channel, 0, "test", "direct")
-
- # Here we use keyword arguments.
- self.queue_declare(channel, queue="test-queue")
- channel.queue_bind(queue="test-queue", exchange="test", routing_key="key")
-
- # Call Channel.basic_consume to register as a consumer.
- # All the protocol methods return a message object. The message object
- # has fields corresponding to the reply method fields, plus a content
- # field that is filled if the reply includes content. In this case the
- # interesting field is the consumer_tag.
- channel.message_consume(queue="test-queue", destination="consumer_tag")
-
- # We can use the Client.queue(...) method to access the queue
- # corresponding to our consumer_tag.
- queue = self.client.queue("consumer_tag")
-
- # Now lets publish a message and see if our consumer gets it. To do
- # this we need to import the Content class.
- body = "Hello World!"
- channel.message_transfer(destination="test",
- routing_key="key",
- body = body)
-
- # Now we'll wait for the message to arrive. We can use the timeout
- # argument in case the server hangs. By default queue.get() will wait
- # until a message arrives or the connection to the server dies.
- msg = queue.get(timeout=10)
-
- # And check that we got the right response with assertEqual
- self.assertEqual(body, msg.body)
-
- # Now acknowledge the message.
- msg.ok()
-
diff --git a/M4-RCs/qpid/python/tests_0-9/exchange.py b/M4-RCs/qpid/python/tests_0-9/exchange.py
deleted file mode 100644
index 3a47ffff8c..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/exchange.py
+++ /dev/null
@@ -1,327 +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.
-#
-
-"""
-Tests for exchange behaviour.
-
-Test classes ending in 'RuleTests' are derived from rules in amqp.xml.
-"""
-
-import Queue, logging
-from qpid.testlib import TestBase
-from qpid.content import Content
-from qpid.client import Closed
-
-
-class StandardExchangeVerifier:
- """Verifies standard exchange behavior.
-
- Used as base class for classes that test standard exchanges."""
-
- def verifyDirectExchange(self, ex):
- """Verify that ex behaves like a direct exchange."""
- self.queue_declare(queue="q")
- self.channel.queue_bind(queue="q", exchange=ex, routing_key="k")
- self.assertPublishConsume(exchange=ex, queue="q", routing_key="k")
- try:
- self.assertPublishConsume(exchange=ex, queue="q", routing_key="kk")
- self.fail("Expected Empty exception")
- except Queue.Empty: None # Expected
-
- def verifyFanOutExchange(self, ex):
- """Verify that ex behaves like a fanout exchange."""
- self.queue_declare(queue="q")
- self.channel.queue_bind(queue="q", exchange=ex)
- self.queue_declare(queue="p")
- self.channel.queue_bind(queue="p", exchange=ex)
- for qname in ["q", "p"]: self.assertPublishGet(self.consume(qname), ex)
-
- def verifyTopicExchange(self, ex):
- """Verify that ex behaves like a topic exchange"""
- self.queue_declare(queue="a")
- self.channel.queue_bind(queue="a", exchange=ex, routing_key="a.#.b.*")
- q = self.consume("a")
- self.assertPublishGet(q, ex, "a.b.x")
- self.assertPublishGet(q, ex, "a.x.b.x")
- self.assertPublishGet(q, ex, "a.x.x.b.x")
- # Shouldn't match
- self.channel.message_transfer(destination=ex, routing_key="a.b", body="")
- self.channel.message_transfer(destination=ex, routing_key="a.b.x.y", body="")
- self.channel.message_transfer(destination=ex, routing_key="x.a.b.x", body="")
- self.channel.message_transfer(destination=ex, routing_key="a.b", body="")
- self.assert_(q.empty())
-
- def verifyHeadersExchange(self, ex):
- """Verify that ex is a headers exchange"""
- self.queue_declare(queue="q")
- self.channel.queue_bind(queue="q", exchange=ex, arguments={ "x-match":"all", "name":"fred" , "age":3} )
- q = self.consume("q")
- headers = {"name":"fred", "age":3}
- self.assertPublishGet(q, exchange=ex, properties=headers)
- self.channel.message_transfer(destination=ex, body="") # No headers, won't deliver
- self.assertEmpty(q);
-
-
-class RecommendedTypesRuleTests(TestBase, StandardExchangeVerifier):
- """
- The server SHOULD implement these standard exchange types: topic, headers.
-
- Client attempts to declare an exchange with each of these standard types.
- """
-
- def testDirect(self):
- """Declare and test a direct exchange"""
- self.exchange_declare(0, exchange="d", type="direct")
- self.verifyDirectExchange("d")
-
- def testFanout(self):
- """Declare and test a fanout exchange"""
- self.exchange_declare(0, exchange="f", type="fanout")
- self.verifyFanOutExchange("f")
-
- def testTopic(self):
- """Declare and test a topic exchange"""
- self.exchange_declare(0, exchange="t", type="topic")
- self.verifyTopicExchange("t")
-
- def testHeaders(self):
- """Declare and test a headers exchange"""
- self.exchange_declare(0, exchange="h", type="headers")
- self.verifyHeadersExchange("h")
-
-
-class RequiredInstancesRuleTests(TestBase, StandardExchangeVerifier):
- """
- The server MUST, in each virtual host, pre-declare an exchange instance
- for each standard exchange type that it implements, where the name of the
- exchange instance is amq. followed by the exchange type name.
-
- Client creates a temporary queue and attempts to bind to each required
- exchange instance (amq.fanout, amq.direct, and amq.topic, amq.match if
- those types are defined).
- """
- def testAmqDirect(self): self.verifyDirectExchange("amq.direct")
-
- def testAmqFanOut(self): self.verifyFanOutExchange("amq.fanout")
-
- def testAmqTopic(self): self.verifyTopicExchange("amq.topic")
-
- def testAmqMatch(self): self.verifyHeadersExchange("amq.match")
-
-class DefaultExchangeRuleTests(TestBase, StandardExchangeVerifier):
- """
- The server MUST predeclare a direct exchange to act as the default exchange
- for content Publish methods and for default queue bindings.
-
- Client checks that the default exchange is active by specifying a queue
- binding with no exchange name, and publishing a message with a suitable
- routing key but without specifying the exchange name, then ensuring that
- the message arrives in the queue correctly.
- """
- def testDefaultExchange(self):
- # Test automatic binding by queue name.
- self.queue_declare(queue="d")
- self.assertPublishConsume(queue="d", routing_key="d")
- # Test explicit bind to default queue
- self.verifyDirectExchange("")
-
-
-# TODO aconway 2006-09-27: Fill in empty tests:
-
-class DefaultAccessRuleTests(TestBase):
- """
- The server MUST NOT allow clients to access the default exchange except
- by specifying an empty exchange name in the Queue.Bind and content Publish
- methods.
- """
-
-class ExtensionsRuleTests(TestBase):
- """
- The server MAY implement other exchange types as wanted.
- """
-
-
-class DeclareMethodMinimumRuleTests(TestBase):
- """
- The server SHOULD support a minimum of 16 exchanges per virtual host and
- ideally, impose no limit except as defined by available resources.
-
- The client creates as many exchanges as it can until the server reports
- an error; the number of exchanges successfuly created must be at least
- sixteen.
- """
-
-
-class DeclareMethodTicketFieldValidityRuleTests(TestBase):
- """
- The client MUST provide a valid access ticket giving "active" access to
- the realm in which the exchange exists or will be created, or "passive"
- access if the if-exists flag is set.
-
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- """
-
-
-class DeclareMethodExchangeFieldReservedRuleTests(TestBase):
- """
- Exchange names starting with "amq." are reserved for predeclared and
- standardised exchanges. The client MUST NOT attempt to create an exchange
- starting with "amq.".
-
-
- """
-
-
-class DeclareMethodTypeFieldTypedRuleTests(TestBase):
- """
- Exchanges cannot be redeclared with different types. The client MUST not
- attempt to redeclare an existing exchange with a different type than used
- in the original Exchange.Declare method.
-
-
- """
-
-
-class DeclareMethodTypeFieldSupportRuleTests(TestBase):
- """
- The client MUST NOT attempt to create an exchange with a type that the
- server does not support.
-
-
- """
-
-
-class DeclareMethodPassiveFieldNotFoundRuleTests(TestBase):
- """
- If set, and the exchange does not already exist, the server MUST raise a
- channel exception with reply code 404 (not found).
- """
- def test(self):
- try:
- self.channel.exchange_declare(exchange="humpty_dumpty", passive=True)
- self.fail("Expected 404 for passive declaration of unknown exchange.")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
-
-class DeclareMethodDurableFieldSupportRuleTests(TestBase):
- """
- The server MUST support both durable and transient exchanges.
-
-
- """
-
-
-class DeclareMethodDurableFieldStickyRuleTests(TestBase):
- """
- The server MUST ignore the durable field if the exchange already exists.
-
-
- """
-
-
-class DeclareMethodAutoDeleteFieldStickyRuleTests(TestBase):
- """
- The server MUST ignore the auto-delete field if the exchange already
- exists.
-
-
- """
-
-
-class DeleteMethodTicketFieldValidityRuleTests(TestBase):
- """
- The client MUST provide a valid access ticket giving "active" access
- rights to the exchange's access realm.
-
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- """
-
-
-class DeleteMethodExchangeFieldExistsRuleTests(TestBase):
- """
- The client MUST NOT attempt to delete an exchange that does not exist.
- """
-
-
-class HeadersExchangeTests(TestBase):
- """
- Tests for headers exchange functionality.
- """
- def setUp(self):
- TestBase.setUp(self)
- self.queue_declare(queue="q")
- self.q = self.consume("q")
-
- def myAssertPublishGet(self, headers):
- self.assertPublishGet(self.q, exchange="amq.match", properties=headers)
-
- def myBasicPublish(self, headers):
- self.channel.message_transfer(destination="amq.match", body="foobar", application_headers=headers)
-
- def testMatchAll(self):
- self.channel.queue_bind(queue="q", exchange="amq.match", arguments={ 'x-match':'all', "name":"fred", "age":3})
- self.myAssertPublishGet({"name":"fred", "age":3})
- self.myAssertPublishGet({"name":"fred", "age":3, "extra":"ignoreme"})
-
- # None of these should match
- self.myBasicPublish({})
- self.myBasicPublish({"name":"barney"})
- self.myBasicPublish({"name":10})
- self.myBasicPublish({"name":"fred", "age":2})
- self.assertEmpty(self.q)
-
- def testMatchAny(self):
- self.channel.queue_bind(queue="q", exchange="amq.match", arguments={ 'x-match':'any', "name":"fred", "age":3})
- self.myAssertPublishGet({"name":"fred"})
- self.myAssertPublishGet({"name":"fred", "ignoreme":10})
- self.myAssertPublishGet({"ignoreme":10, "age":3})
-
- # Wont match
- self.myBasicPublish({})
- self.myBasicPublish({"irrelevant":0})
- self.assertEmpty(self.q)
-
-
-class MiscellaneousErrorsTests(TestBase):
- """
- Test some miscellaneous error conditions
- """
- def testTypeNotKnown(self):
- try:
- self.channel.exchange_declare(exchange="test_type_not_known_exchange", type="invalid_type")
- self.fail("Expected 503 for declaration of unknown exchange type.")
- except Closed, e:
- self.assertConnectionException(503, e.args[0])
-
- def testDifferentDeclaredType(self):
- self.channel.exchange_declare(exchange="test_different_declared_type_exchange", type="direct")
- try:
- self.channel.exchange_declare(exchange="test_different_declared_type_exchange", type="topic")
- self.fail("Expected 530 for redeclaration of exchange with different type.")
- except Closed, e:
- self.assertConnectionException(530, e.args[0])
- #cleanup
- other = self.connect()
- c2 = other.channel(1)
- c2.channel_open()
- c2.exchange_delete(exchange="test_different_declared_type_exchange")
-
diff --git a/M4-RCs/qpid/python/tests_0-9/execution.py b/M4-RCs/qpid/python/tests_0-9/execution.py
deleted file mode 100644
index f2facfe42b..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/execution.py
+++ /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.
-#
-
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class ExecutionTests (TestBase):
- def test_flush(self):
- channel = self.channel
- for i in [1, 2, 3]:
- channel.basic_publish()
- channel.execution_flush()
- assert(channel.completion.wait(channel.completion.command_id, timeout=1))
diff --git a/M4-RCs/qpid/python/tests_0-9/message.py b/M4-RCs/qpid/python/tests_0-9/message.py
deleted file mode 100644
index b25016e680..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/message.py
+++ /dev/null
@@ -1,657 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-from qpid.reference import Reference, ReferenceId
-
-class MessageTests(TestBase):
- """Tests for 'methods' on the amqp message 'class'"""
-
- def test_consume_no_local(self):
- """
- Test that the no_local flag is honoured in the consume method
- """
- channel = self.channel
- #setup, declare two queues:
- channel.queue_declare(queue="test-queue-1a", exclusive=True)
- channel.queue_declare(queue="test-queue-1b", exclusive=True)
- #establish two consumers one of which excludes delivery of locally sent messages
- channel.message_consume(destination="local_included", queue="test-queue-1a")
- channel.message_consume(destination="local_excluded", queue="test-queue-1b", no_local=True)
-
- #send a message
- channel.message_transfer(routing_key="test-queue-1a", body="consume_no_local")
- channel.message_transfer(routing_key="test-queue-1b", body="consume_no_local")
-
- #check the queues of the two consumers
- excluded = self.client.queue("local_excluded")
- included = self.client.queue("local_included")
- msg = included.get(timeout=1)
- self.assertEqual("consume_no_local", msg.body)
- try:
- excluded.get(timeout=1)
- self.fail("Received locally published message though no_local=true")
- except Empty: None
-
-
- def test_consume_exclusive(self):
- """
- Test that the exclusive flag is honoured in the consume method
- """
- channel = self.channel
- #setup, declare a queue:
- channel.queue_declare(queue="test-queue-2", exclusive=True)
-
- #check that an exclusive consumer prevents other consumer being created:
- channel.message_consume(destination="first", queue="test-queue-2", exclusive=True)
- try:
- channel.message_consume(destination="second", queue="test-queue-2")
- self.fail("Expected consume request to fail due to previous exclusive consumer")
- except Closed, e:
- self.assertChannelException(403, e.args[0])
-
- #open new channel and cleanup last consumer:
- channel = self.client.channel(2)
- channel.channel_open()
-
- #check that an exclusive consumer cannot be created if a consumer already exists:
- channel.message_consume(destination="first", queue="test-queue-2")
- try:
- channel.message_consume(destination="second", queue="test-queue-2", exclusive=True)
- self.fail("Expected exclusive consume request to fail due to previous consumer")
- except Closed, e:
- self.assertChannelException(403, e.args[0])
-
- def test_consume_queue_errors(self):
- """
- Test error conditions associated with the queue field of the consume method:
- """
- channel = self.channel
- try:
- #queue specified but doesn't exist:
- channel.message_consume(queue="invalid-queue")
- self.fail("Expected failure when consuming from non-existent queue")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- channel = self.client.channel(2)
- channel.channel_open()
- try:
- #queue not specified and none previously declared for channel:
- channel.message_consume(queue="")
- self.fail("Expected failure when consuming from unspecified queue")
- except Closed, e:
- self.assertConnectionException(530, e.args[0])
-
- def test_consume_unique_consumers(self):
- """
- Ensure unique consumer tags are enforced
- """
- channel = self.channel
- #setup, declare a queue:
- channel.queue_declare(queue="test-queue-3", exclusive=True)
-
- #check that attempts to use duplicate tags are detected and prevented:
- channel.message_consume(destination="first", queue="test-queue-3")
- try:
- channel.message_consume(destination="first", queue="test-queue-3")
- self.fail("Expected consume request to fail due to non-unique tag")
- except Closed, e:
- self.assertConnectionException(530, e.args[0])
-
- def test_cancel(self):
- """
- Test compliance of the basic.cancel method
- """
- channel = self.channel
- #setup, declare a queue:
- channel.queue_declare(queue="test-queue-4", exclusive=True)
- channel.message_consume(destination="my-consumer", queue="test-queue-4")
- channel.message_transfer(routing_key="test-queue-4", body="One")
-
- #cancel should stop messages being delivered
- channel.message_cancel(destination="my-consumer")
- channel.message_transfer(routing_key="test-queue-4", body="Two")
- myqueue = self.client.queue("my-consumer")
- msg = myqueue.get(timeout=1)
- self.assertEqual("One", msg.body)
- try:
- msg = myqueue.get(timeout=1)
- self.fail("Got message after cancellation: " + msg)
- except Empty: None
-
- #cancellation of non-existant consumers should be handled without error
- channel.message_cancel(destination="my-consumer")
- channel.message_cancel(destination="this-never-existed")
-
-
- def test_ack(self):
- """
- Test basic ack/recover behaviour
- """
- channel = self.channel
- channel.queue_declare(queue="test-ack-queue", exclusive=True)
-
- channel.message_consume(queue="test-ack-queue", destination="consumer_tag", no_ack=False)
- queue = self.client.queue("consumer_tag")
-
- channel.message_transfer(routing_key="test-ack-queue", body="One")
- channel.message_transfer(routing_key="test-ack-queue", body="Two")
- channel.message_transfer(routing_key="test-ack-queue", body="Three")
- channel.message_transfer(routing_key="test-ack-queue", body="Four")
- channel.message_transfer(routing_key="test-ack-queue", body="Five")
-
- msg1 = queue.get(timeout=1)
- msg2 = queue.get(timeout=1)
- msg3 = queue.get(timeout=1)
- msg4 = queue.get(timeout=1)
- msg5 = queue.get(timeout=1)
-
- self.assertEqual("One", msg1.body)
- self.assertEqual("Two", msg2.body)
- self.assertEqual("Three", msg3.body)
- self.assertEqual("Four", msg4.body)
- self.assertEqual("Five", msg5.body)
-
- msg1.ok(batchoffset=1)#One and Two
- msg4.ok()
-
- channel.message_recover(requeue=False)
-
- msg3b = queue.get(timeout=1)
- msg5b = queue.get(timeout=1)
-
- self.assertEqual("Three", msg3b.body)
- self.assertEqual("Five", msg5b.body)
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- def test_recover_requeue(self):
- """
- Test requeing on recovery
- """
- channel = self.channel
- channel.queue_declare(queue="test-requeue", exclusive=True)
-
- channel.message_consume(queue="test-requeue", destination="consumer_tag", no_ack=False)
- queue = self.client.queue("consumer_tag")
-
- channel.message_transfer(routing_key="test-requeue", body="One")
- channel.message_transfer(routing_key="test-requeue", body="Two")
- channel.message_transfer(routing_key="test-requeue", body="Three")
- channel.message_transfer(routing_key="test-requeue", body="Four")
- channel.message_transfer(routing_key="test-requeue", body="Five")
-
- msg1 = queue.get(timeout=1)
- msg2 = queue.get(timeout=1)
- msg3 = queue.get(timeout=1)
- msg4 = queue.get(timeout=1)
- msg5 = queue.get(timeout=1)
-
- self.assertEqual("One", msg1.body)
- self.assertEqual("Two", msg2.body)
- self.assertEqual("Three", msg3.body)
- self.assertEqual("Four", msg4.body)
- self.assertEqual("Five", msg5.body)
-
- msg1.ok(batchoffset=1) #One and Two
- msg4.ok() #Four
-
- channel.message_cancel(destination="consumer_tag")
-
- #publish a new message
- channel.message_transfer(routing_key="test-requeue", body="Six")
- #requeue unacked messages (Three and Five)
- channel.message_recover(requeue=True)
-
- channel.message_consume(queue="test-requeue", destination="consumer_tag")
- queue2 = self.client.queue("consumer_tag")
-
- msg3b = queue2.get(timeout=1)
- msg5b = queue2.get(timeout=1)
-
- self.assertEqual("Three", msg3b.body)
- self.assertEqual("Five", msg5b.body)
-
- self.assertEqual(True, msg3b.redelivered)
- self.assertEqual(True, msg5b.redelivered)
-
- self.assertEqual("Six", queue2.get(timeout=1).body)
-
- try:
- extra = queue2.get(timeout=1)
- self.fail("Got unexpected message in second queue: " + extra.body)
- except Empty: None
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected message in original queue: " + extra.body)
- except Empty: None
-
-
- def test_qos_prefetch_count(self):
- """
- Test that the prefetch count specified is honoured
- """
- #setup: declare queue and subscribe
- channel = self.channel
- channel.queue_declare(queue="test-prefetch-count", exclusive=True)
- subscription = channel.message_consume(queue="test-prefetch-count", destination="consumer_tag", no_ack=False)
- queue = self.client.queue("consumer_tag")
-
- #set prefetch to 5:
- channel.message_qos(prefetch_count=5)
-
- #publish 10 messages:
- for i in range(1, 11):
- channel.message_transfer(routing_key="test-prefetch-count", body="Message %d" % i)
-
- #only 5 messages should have been delivered:
- for i in range(1, 6):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.body)
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 6th message in original queue: " + extra.body)
- except Empty: None
-
- #ack messages and check that the next set arrive ok:
- #todo: once batching is implmented, send a single response for all messages
- msg.ok(batchoffset=-4)#1-5
-
- for i in range(6, 11):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.body)
-
- msg.ok(batchoffset=-4)#6-10
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 11th message in original queue: " + extra.body)
- except Empty: None
-
-
-
- def test_qos_prefetch_size(self):
- """
- Test that the prefetch size specified is honoured
- """
- #setup: declare queue and subscribe
- channel = self.channel
- channel.queue_declare(queue="test-prefetch-size", exclusive=True)
- subscription = channel.message_consume(queue="test-prefetch-size", destination="consumer_tag", no_ack=False)
- queue = self.client.queue("consumer_tag")
-
- #set prefetch to 50 bytes (each message is 9 or 10 bytes):
- channel.message_qos(prefetch_size=50)
-
- #publish 10 messages:
- for i in range(1, 11):
- channel.message_transfer(routing_key="test-prefetch-size", body="Message %d" % i)
-
- #only 5 messages should have been delivered (i.e. 45 bytes worth):
- for i in range(1, 6):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.body)
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 6th message in original queue: " + extra.body)
- except Empty: None
-
- #ack messages and check that the next set arrive ok:
- msg.ok(batchoffset=-4)#1-5
-
- for i in range(6, 11):
- msg = queue.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.body)
-
- msg.ok(batchoffset=-4)#6-10
-
- try:
- extra = queue.get(timeout=1)
- self.fail("Got unexpected 11th message in original queue: " + extra.body)
- except Empty: None
-
- #make sure that a single oversized message still gets delivered
- large = "abcdefghijklmnopqrstuvwxyz"
- large = large + "-" + large;
- channel.message_transfer(routing_key="test-prefetch-size", body=large)
- msg = queue.get(timeout=1)
- self.assertEqual(large, msg.body)
-
- def test_get(self):
- """
- Test message_get method
- """
- channel = self.channel
- channel.queue_declare(queue="test-get", exclusive=True)
-
- #publish some messages (no_ack=True)
- for i in range(1, 11):
- channel.message_transfer(routing_key="test-get", body="Message %d" % i)
-
- #use message_get to read back the messages, and check that we get an empty at the end
- for i in range(1, 11):
- tag = "queue %d" % i
- reply = channel.message_get(no_ack=True, queue="test-get", destination=tag)
- self.assertEqual(reply.method.klass.name, "message")
- self.assertEqual(reply.method.name, "ok")
- self.assertEqual("Message %d" % i, self.client.queue(tag).get(timeout=1).body)
-
- reply = channel.message_get(no_ack=True, queue="test-get")
- self.assertEqual(reply.method.klass.name, "message")
- self.assertEqual(reply.method.name, "empty")
-
- #repeat for no_ack=False
- for i in range(11, 21):
- channel.message_transfer(routing_key="test-get", body="Message %d" % i)
-
- for i in range(11, 21):
- tag = "queue %d" % i
- reply = channel.message_get(no_ack=False, queue="test-get", destination=tag)
- self.assertEqual(reply.method.klass.name, "message")
- self.assertEqual(reply.method.name, "ok")
- msg = self.client.queue(tag).get(timeout=1)
- self.assertEqual("Message %d" % i, msg.body)
-
- if (i==13):
- msg.ok(batchoffset=-2)#11, 12 & 13
- if(i in [15, 17, 19]):
- msg.ok()
-
- reply = channel.message_get(no_ack=True, queue="test-get")
- self.assertEqual(reply.method.klass.name, "message")
- self.assertEqual(reply.method.name, "empty")
-
- #recover(requeue=True)
- channel.message_recover(requeue=True)
-
- #get the unacked messages again (14, 16, 18, 20)
- for i in [14, 16, 18, 20]:
- tag = "queue %d" % i
- reply = channel.message_get(no_ack=False, queue="test-get", destination=tag)
- self.assertEqual(reply.method.klass.name, "message")
- self.assertEqual(reply.method.name, "ok")
- msg = self.client.queue(tag).get(timeout=1)
- self.assertEqual("Message %d" % i, msg.body)
- msg.ok()
- #channel.message_ack(delivery_tag=reply.delivery_tag)
-
- reply = channel.message_get(no_ack=True, queue="test-get")
- self.assertEqual(reply.method.klass.name, "message")
- self.assertEqual(reply.method.name, "empty")
-
- channel.message_recover(requeue=True)
-
- reply = channel.message_get(no_ack=True, queue="test-get")
- self.assertEqual(reply.method.klass.name, "message")
- self.assertEqual(reply.method.name, "empty")
-
- def test_reference_simple(self):
- """
- Test basic ability to handle references
- """
- channel = self.channel
- channel.queue_declare(queue="ref_queue", exclusive=True)
- channel.message_consume(queue="ref_queue", destination="c1")
- queue = self.client.queue("c1")
-
- refId = "myref"
- channel.message_open(reference=refId)
- channel.message_append(reference=refId, bytes="abcd")
- channel.synchronous = False
- ack = channel.message_transfer(routing_key="ref_queue", body=ReferenceId(refId))
- channel.synchronous = True
-
- channel.message_append(reference=refId, bytes="efgh")
- channel.message_append(reference=refId, bytes="ijkl")
- channel.message_close(reference=refId)
-
- #first, wait for the ok for the transfer
- ack.get_response(timeout=1)
-
- self.assertDataEquals(channel, queue.get(timeout=1), "abcdefghijkl")
-
-
- def test_reference_large(self):
- """
- Test basic ability to handle references whose content exceeds max frame size
- """
- channel = self.channel
- self.queue_declare(queue="ref_queue")
-
- #generate a big data string (> max frame size of consumer):
- data = "0123456789"
- for i in range(0, 10):
- data += data
- #send it inline
- channel.synchronous = False
- ack = channel.message_transfer(routing_key="ref_queue", body=data)
- channel.synchronous = True
- #first, wait for the ok for the transfer
- ack.get_response(timeout=1)
-
- #create a new connection for consumer, with specific max frame size (< data)
- other = self.connect(tune_params={"channel_max":10, "frame_max":5120, "heartbeat":0})
- ch2 = other.channel(1)
- ch2.channel_open()
- ch2.message_consume(queue="ref_queue", destination="c1")
- queue = other.queue("c1")
-
- msg = queue.get(timeout=1)
- self.assertTrue(isinstance(msg.body, ReferenceId))
- self.assertTrue(msg.reference)
- self.assertEquals(data, msg.reference.get_complete())
-
- def test_reference_completion(self):
- """
- Test that reference transfer are not deemed complete until
- closed (therefore are not acked or routed until that point)
- """
- channel = self.channel
- channel.queue_declare(queue="ref_queue", exclusive=True)
- channel.message_consume(queue="ref_queue", destination="c1")
- queue = self.client.queue("c1")
-
- refId = "myref"
- channel.message_open(reference=refId)
- channel.message_append(reference=refId, bytes="abcd")
- channel.synchronous = False
- ack = channel.message_transfer(routing_key="ref_queue", body=ReferenceId(refId))
- channel.synchronous = True
-
- try:
- msg = queue.get(timeout=1)
- self.fail("Got unexpected message on queue: " + msg)
- except Empty: None
-
- self.assertTrue(not ack.is_complete())
-
- channel.message_close(reference=refId)
-
- #first, wait for the ok for the transfer
- ack.get_response(timeout=1)
-
- self.assertDataEquals(channel, queue.get(timeout=1), "abcd")
-
- def test_reference_multi_transfer(self):
- """
- Test that multiple transfer requests for the same reference are
- correctly handled.
- """
- channel = self.channel
- #declare and consume from two queues
- channel.queue_declare(queue="q-one", exclusive=True)
- channel.queue_declare(queue="q-two", exclusive=True)
- channel.message_consume(queue="q-one", destination="q-one")
- channel.message_consume(queue="q-two", destination="q-two")
- queue1 = self.client.queue("q-one")
- queue2 = self.client.queue("q-two")
-
- #transfer a single ref to both queues (in separate commands)
- channel.message_open(reference="my-ref")
- channel.synchronous = False
- ack1 = channel.message_transfer(routing_key="q-one", body=ReferenceId("my-ref"))
- channel.message_append(reference="my-ref", bytes="my data")
- ack2 = channel.message_transfer(routing_key="q-two", body=ReferenceId("my-ref"))
- channel.synchronous = True
- channel.message_close(reference="my-ref")
-
- #check that both queues have the message
- self.assertDataEquals(channel, queue1.get(timeout=1), "my data")
- self.assertDataEquals(channel, queue2.get(timeout=1), "my data")
- self.assertEmpty(queue1)
- self.assertEmpty(queue2)
-
- #transfer a single ref to the same queue twice (in separate commands)
- channel.message_open(reference="my-ref")
- channel.synchronous = False
- ack1 = channel.message_transfer(routing_key="q-one", message_id="abc", body=ReferenceId("my-ref"))
- channel.message_append(reference="my-ref", bytes="second message")
- ack2 = channel.message_transfer(routing_key="q-one", message_id="xyz", body=ReferenceId("my-ref"))
- channel.synchronous = True
- channel.message_close(reference="my-ref")
-
- msg1 = queue1.get(timeout=1)
- msg2 = queue1.get(timeout=1)
- #order is undefined
- if msg1.message_id == "abc":
- self.assertEquals(msg2.message_id, "xyz")
- else:
- self.assertEquals(msg1.message_id, "xyz")
- self.assertEquals(msg2.message_id, "abc")
-
- #would be legal for the incoming messages to be transfered
- #inline or by reference in any combination
-
- if isinstance(msg1.body, ReferenceId):
- self.assertEquals("second message", msg1.reference.get_complete())
- if isinstance(msg2.body, ReferenceId):
- if msg1.body != msg2.body:
- self.assertEquals("second message", msg2.reference.get_complete())
- #else ok, as same ref as msg1
- else:
- self.assertEquals("second message", msg1.body)
- if isinstance(msg2.body, ReferenceId):
- self.assertEquals("second message", msg2.reference.get_complete())
- else:
- self.assertEquals("second message", msg2.body)
-
- self.assertEmpty(queue1)
-
- def test_reference_unopened_on_append_error(self):
- channel = self.channel
- try:
- channel.message_append(reference="unopened")
- except Closed, e:
- self.assertConnectionException(503, e.args[0])
-
- def test_reference_unopened_on_close_error(self):
- channel = self.channel
- try:
- channel.message_close(reference="unopened")
- except Closed, e:
- self.assertConnectionException(503, e.args[0])
-
- def test_reference_unopened_on_transfer_error(self):
- channel = self.channel
- try:
- channel.message_transfer(body=ReferenceId("unopened"))
- except Closed, e:
- self.assertConnectionException(503, e.args[0])
-
- def test_reference_already_opened_error(self):
- channel = self.channel
- channel.message_open(reference="a")
- try:
- channel.message_open(reference="a")
- except Closed, e:
- self.assertConnectionException(503, e.args[0])
-
- def test_empty_reference(self):
- channel = self.channel
- channel.queue_declare(queue="ref_queue", exclusive=True)
- channel.message_consume(queue="ref_queue", destination="c1")
- queue = self.client.queue("c1")
-
- refId = "myref"
- channel.message_open(reference=refId)
- channel.synchronous = False
- ack = channel.message_transfer(routing_key="ref_queue", message_id="empty-msg", body=ReferenceId(refId))
- channel.synchronous = True
- channel.message_close(reference=refId)
-
- #first, wait for the ok for the transfer
- ack.get_response(timeout=1)
-
- msg = queue.get(timeout=1)
- self.assertEquals(msg.message_id, "empty-msg")
- self.assertDataEquals(channel, msg, "")
-
- def test_reject(self):
- channel = self.channel
- channel.queue_declare(queue = "q", exclusive=True)
-
- channel.message_consume(queue = "q", destination = "consumer")
- channel.message_transfer(routing_key = "q", body="blah, blah")
- msg = self.client.queue("consumer").get(timeout = 1)
- self.assertEquals(msg.body, "blah, blah")
- channel.message_cancel(destination = "consumer")
- msg.reject()
-
- channel.message_consume(queue = "q", destination = "checker")
- msg = self.client.queue("checker").get(timeout = 1)
- self.assertEquals(msg.body, "blah, blah")
-
- def test_checkpoint(self):
- channel = self.channel
- channel.queue_declare(queue = "q", exclusive=True)
-
- channel.message_open(reference="my-ref")
- channel.message_append(reference="my-ref", bytes="abcdefgh")
- channel.message_append(reference="my-ref", bytes="ijklmnop")
- channel.message_checkpoint(reference="my-ref", identifier="my-checkpoint")
- channel.channel_close()
-
- channel = self.client.channel(2)
- channel.channel_open()
- channel.message_consume(queue = "q", destination = "consumer")
- offset = channel.message_resume(reference="my-ref", identifier="my-checkpoint").value
- self.assertTrue(offset<=16)
- channel.message_append(reference="my-ref", bytes="qrstuvwxyz")
- channel.synchronous = False
- channel.message_transfer(routing_key="q-one", message_id="abcd", body=ReferenceId("my-ref"))
- channel.synchronous = True
- channel.message_close(reference="my-ref")
-
- self.assertDataEquals(channel, self.client.queue("consumer").get(timeout = 1), "abcdefghijklmnopqrstuvwxyz")
- self.assertEmpty(self.client.queue("consumer"))
-
-
- def assertDataEquals(self, channel, msg, expected):
- if isinstance(msg.body, ReferenceId):
- data = msg.reference.get_complete()
- else:
- data = msg.body
- self.assertEquals(expected, data)
diff --git a/M4-RCs/qpid/python/tests_0-9/query.py b/M4-RCs/qpid/python/tests_0-9/query.py
deleted file mode 100644
index c2e08c003c..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/query.py
+++ /dev/null
@@ -1,224 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class QueryTests(TestBase):
- """Tests for various query methods introduced in 0-10 and available in 0-9 for preview"""
-
- def test_exchange_query(self):
- """
- Test that the exchange_query method works as expected
- """
- channel = self.channel
- #check returned type for the standard exchanges
- self.assertEqual("direct", channel.exchange_query(name="amq.direct").type)
- self.assertEqual("topic", channel.exchange_query(name="amq.topic").type)
- self.assertEqual("fanout", channel.exchange_query(name="amq.fanout").type)
- self.assertEqual("headers", channel.exchange_query(name="amq.match").type)
- self.assertEqual("direct", channel.exchange_query(name="").type)
- #declare an exchange
- channel.exchange_declare(exchange="my-test-exchange", type= "direct", durable=False)
- #check that the result of a query is as expected
- response = channel.exchange_query(name="my-test-exchange")
- self.assertEqual("direct", response.type)
- self.assertEqual(False, response.durable)
- self.assertEqual(False, response.not_found)
- #delete the exchange
- channel.exchange_delete(exchange="my-test-exchange")
- #check that the query now reports not-found
- self.assertEqual(True, channel.exchange_query(name="my-test-exchange").not_found)
-
- def test_binding_query_direct(self):
- """
- Test that the binding_query method works as expected with the direct exchange
- """
- self.binding_query_with_key("amq.direct")
-
- def test_binding_query_topic(self):
- """
- Test that the binding_query method works as expected with the direct exchange
- """
- self.binding_query_with_key("amq.topic")
-
- def binding_query_with_key(self, exchange_name):
- channel = self.channel
- #setup: create two queues
- channel.queue_declare(queue="used-queue", exclusive=True)
- channel.queue_declare(queue="unused-queue", exclusive=True)
-
- channel.queue_bind(exchange=exchange_name, queue="used-queue", routing_key="used-key")
-
- # test detection of any binding to specific queue
- response = channel.binding_query(exchange=exchange_name, queue="used-queue")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(False, response.queue_not_matched)
-
- # test detection of specific binding to any queue
- response = channel.binding_query(exchange=exchange_name, routing_key="used-key")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(False, response.key_not_matched)
-
- # test detection of specific binding to specific queue
- response = channel.binding_query(exchange=exchange_name, queue="used-queue", routing_key="used-key")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(False, response.queue_not_matched)
- self.assertEqual(False, response.key_not_matched)
-
- # test unmatched queue, unspecified binding
- response = channel.binding_query(exchange=exchange_name, queue="unused-queue")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
-
- # test unspecified queue, unmatched binding
- response = channel.binding_query(exchange=exchange_name, routing_key="unused-key")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(True, response.key_not_matched)
-
- # test matched queue, unmatched binding
- response = channel.binding_query(exchange=exchange_name, queue="used-queue", routing_key="unused-key")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(False, response.queue_not_matched)
- self.assertEqual(True, response.key_not_matched)
-
- # test unmatched queue, matched binding
- response = channel.binding_query(exchange=exchange_name, queue="unused-queue", routing_key="used-key")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
- self.assertEqual(False, response.key_not_matched)
-
- # test unmatched queue, unmatched binding
- response = channel.binding_query(exchange=exchange_name, queue="unused-queue", routing_key="unused-key")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
- self.assertEqual(True, response.key_not_matched)
-
- #test exchange not found
- self.assertEqual(True, channel.binding_query(exchange="unknown-exchange").exchange_not_found)
-
- #test queue not found
- self.assertEqual(True, channel.binding_query(exchange=exchange_name, queue="unknown-queue").queue_not_found)
-
-
- def test_binding_query_fanout(self):
- """
- Test that the binding_query method works as expected with fanout exchange
- """
- channel = self.channel
- #setup
- channel.queue_declare(queue="used-queue", exclusive=True)
- channel.queue_declare(queue="unused-queue", exclusive=True)
- channel.queue_bind(exchange="amq.fanout", queue="used-queue")
-
- # test detection of any binding to specific queue
- response = channel.binding_query(exchange="amq.fanout", queue="used-queue")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(False, response.queue_not_matched)
-
- # test unmatched queue, unspecified binding
- response = channel.binding_query(exchange="amq.fanout", queue="unused-queue")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
-
- #test exchange not found
- self.assertEqual(True, channel.binding_query(exchange="unknown-exchange").exchange_not_found)
-
- #test queue not found
- self.assertEqual(True, channel.binding_query(exchange="amq.fanout", queue="unknown-queue").queue_not_found)
-
- def test_binding_query_header(self):
- """
- Test that the binding_query method works as expected with headers exchanges
- """
- channel = self.channel
- #setup
- channel.queue_declare(queue="used-queue", exclusive=True)
- channel.queue_declare(queue="unused-queue", exclusive=True)
- channel.queue_bind(exchange="amq.match", queue="used-queue", arguments={"x-match":"all", "a":"A"} )
-
- # test detection of any binding to specific queue
- response = channel.binding_query(exchange="amq.match", queue="used-queue")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(False, response.queue_not_matched)
-
- # test detection of specific binding to any queue
- response = channel.binding_query(exchange="amq.match", arguments={"x-match":"all", "a":"A"})
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(False, response.args_not_matched)
-
- # test detection of specific binding to specific queue
- response = channel.binding_query(exchange="amq.match", queue="used-queue", arguments={"x-match":"all", "a":"A"})
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(False, response.queue_not_matched)
- self.assertEqual(False, response.args_not_matched)
-
- # test unmatched queue, unspecified binding
- response = channel.binding_query(exchange="amq.match", queue="unused-queue")
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
-
- # test unspecified queue, unmatched binding
- response = channel.binding_query(exchange="amq.match", arguments={"x-match":"all", "b":"B"})
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(True, response.args_not_matched)
-
- # test matched queue, unmatched binding
- response = channel.binding_query(exchange="amq.match", queue="used-queue", arguments={"x-match":"all", "b":"B"})
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(False, response.queue_not_matched)
- self.assertEqual(True, response.args_not_matched)
-
- # test unmatched queue, matched binding
- response = channel.binding_query(exchange="amq.match", queue="unused-queue", arguments={"x-match":"all", "a":"A"})
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
- self.assertEqual(False, response.args_not_matched)
-
- # test unmatched queue, unmatched binding
- response = channel.binding_query(exchange="amq.match", queue="unused-queue", arguments={"x-match":"all", "b":"B"})
- self.assertEqual(False, response.exchange_not_found)
- self.assertEqual(False, response.queue_not_found)
- self.assertEqual(True, response.queue_not_matched)
- self.assertEqual(True, response.args_not_matched)
-
- #test exchange not found
- self.assertEqual(True, channel.binding_query(exchange="unknown-exchange").exchange_not_found)
-
- #test queue not found
- self.assertEqual(True, channel.binding_query(exchange="amq.match", queue="unknown-queue").queue_not_found)
-
diff --git a/M4-RCs/qpid/python/tests_0-9/queue.py b/M4-RCs/qpid/python/tests_0-9/queue.py
deleted file mode 100644
index e7fe0b3ed4..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/queue.py
+++ /dev/null
@@ -1,340 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class QueueTests(TestBase):
- """Tests for 'methods' on the amqp queue 'class'"""
-
- def test_purge(self):
- """
- Test that the purge method removes messages from the queue
- """
- channel = self.channel
- #setup, declare a queue and add some messages to it:
- channel.exchange_declare(exchange="test-exchange", type="direct")
- channel.queue_declare(queue="test-queue", exclusive=True)
- channel.queue_bind(queue="test-queue", exchange="test-exchange", routing_key="key")
- channel.message_transfer(destination="test-exchange", routing_key="key", body="one")
- channel.message_transfer(destination="test-exchange", routing_key="key", body="two")
- channel.message_transfer(destination="test-exchange", routing_key="key", body="three")
-
- #check that the queue now reports 3 messages:
- reply = channel.queue_declare(queue="test-queue")
- self.assertEqual(3, reply.message_count)
-
- #now do the purge, then test that three messages are purged and the count drops to 0
- reply = channel.queue_purge(queue="test-queue");
- self.assertEqual(3, reply.message_count)
- reply = channel.queue_declare(queue="test-queue")
- self.assertEqual(0, reply.message_count)
-
- #send a further message and consume it, ensuring that the other messages are really gone
- channel.message_transfer(destination="test-exchange", routing_key="key", body="four")
- channel.message_consume(queue="test-queue", destination="tag", no_ack=True)
- queue = self.client.queue("tag")
- msg = queue.get(timeout=1)
- self.assertEqual("four", msg.body)
-
- #check error conditions (use new channels):
- channel = self.client.channel(2)
- channel.channel_open()
- try:
- #queue specified but doesn't exist:
- channel.queue_purge(queue="invalid-queue")
- self.fail("Expected failure when purging non-existent queue")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- channel = self.client.channel(3)
- channel.channel_open()
- try:
- #queue not specified and none previously declared for channel:
- channel.queue_purge()
- self.fail("Expected failure when purging unspecified queue")
- except Closed, e:
- self.assertConnectionException(530, e.args[0])
-
- #cleanup
- other = self.connect()
- channel = other.channel(1)
- channel.channel_open()
- channel.exchange_delete(exchange="test-exchange")
-
- def test_declare_exclusive(self):
- """
- Test that the exclusive field is honoured in queue.declare
- """
- # TestBase.setUp has already opened channel(1)
- c1 = self.channel
- # Here we open a second separate connection:
- other = self.connect()
- c2 = other.channel(1)
- c2.channel_open()
-
- #declare an exclusive queue:
- c1.queue_declare(queue="exclusive-queue", exclusive="True")
- try:
- #other connection should not be allowed to declare this:
- c2.queue_declare(queue="exclusive-queue", exclusive="True")
- self.fail("Expected second exclusive queue_declare to raise a channel exception")
- except Closed, e:
- self.assertChannelException(405, e.args[0])
-
-
- def test_declare_passive(self):
- """
- Test that the passive field is honoured in queue.declare
- """
- channel = self.channel
- #declare an exclusive queue:
- channel.queue_declare(queue="passive-queue-1", exclusive="True")
- channel.queue_declare(queue="passive-queue-1", passive="True")
- try:
- #other connection should not be allowed to declare this:
- channel.queue_declare(queue="passive-queue-2", passive="True")
- self.fail("Expected passive declaration of non-existant queue to raise a channel exception")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
-
- def test_bind(self):
- """
- Test various permutations of the queue.bind method
- """
- channel = self.channel
- channel.queue_declare(queue="queue-1", exclusive="True")
-
- #straightforward case, both exchange & queue exist so no errors expected:
- channel.queue_bind(queue="queue-1", exchange="amq.direct", routing_key="key1")
-
- #bind the default queue for the channel (i.e. last one declared):
- channel.queue_bind(exchange="amq.direct", routing_key="key2")
-
- #use the queue name where neither routing key nor queue are specified:
- channel.queue_bind(exchange="amq.direct")
-
- #try and bind to non-existant exchange
- try:
- channel.queue_bind(queue="queue-1", exchange="an-invalid-exchange", routing_key="key1")
- self.fail("Expected bind to non-existant exchange to fail")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- #need to reopen a channel:
- channel = self.client.channel(2)
- channel.channel_open()
-
- #try and bind non-existant queue:
- try:
- channel.queue_bind(queue="queue-2", exchange="amq.direct", routing_key="key1")
- self.fail("Expected bind of non-existant queue to fail")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- def test_unbind_direct(self):
- self.unbind_test(exchange="amq.direct", routing_key="key")
-
- def test_unbind_topic(self):
- self.unbind_test(exchange="amq.topic", routing_key="key")
-
- def test_unbind_fanout(self):
- self.unbind_test(exchange="amq.fanout")
-
- def test_unbind_headers(self):
- self.unbind_test(exchange="amq.match", args={ "x-match":"all", "a":"b"}, headers={"a":"b"})
-
- def unbind_test(self, exchange, routing_key="", args=None, headers={}):
- #bind two queues and consume from them
- channel = self.channel
-
- channel.queue_declare(queue="queue-1", exclusive="True")
- channel.queue_declare(queue="queue-2", exclusive="True")
-
- channel.message_consume(queue="queue-1", destination="queue-1", no_ack=True)
- channel.message_consume(queue="queue-2", destination="queue-2", no_ack=True)
-
- queue1 = self.client.queue("queue-1")
- queue2 = self.client.queue("queue-2")
-
- channel.queue_bind(exchange=exchange, queue="queue-1", routing_key=routing_key, arguments=args)
- channel.queue_bind(exchange=exchange, queue="queue-2", routing_key=routing_key, arguments=args)
-
- #send a message that will match both bindings
- channel.message_transfer(destination=exchange, routing_key=routing_key, application_headers=headers, body="one")
-
- #unbind first queue
- channel.queue_unbind(exchange=exchange, queue="queue-1", routing_key=routing_key, arguments=args)
-
- #send another message
- channel.message_transfer(destination=exchange, routing_key=routing_key, application_headers=headers, body="two")
-
- #check one queue has both messages and the other has only one
- self.assertEquals("one", queue1.get(timeout=1).body)
- try:
- msg = queue1.get(timeout=1)
- self.fail("Got extra message: %s" % msg.body)
- except Empty: pass
-
- self.assertEquals("one", queue2.get(timeout=1).body)
- self.assertEquals("two", queue2.get(timeout=1).body)
- try:
- msg = queue2.get(timeout=1)
- self.fail("Got extra message: " + msg)
- except Empty: pass
-
-
- def test_delete_simple(self):
- """
- Test core queue deletion behaviour
- """
- channel = self.channel
-
- #straight-forward case:
- channel.queue_declare(queue="delete-me")
- channel.message_transfer(routing_key="delete-me", body="a")
- channel.message_transfer(routing_key="delete-me", body="b")
- channel.message_transfer(routing_key="delete-me", body="c")
- reply = channel.queue_delete(queue="delete-me")
- self.assertEqual(3, reply.message_count)
- #check that it has gone be declaring passively
- try:
- channel.queue_declare(queue="delete-me", passive="True")
- self.fail("Queue has not been deleted")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- #check attempted deletion of non-existant queue is handled correctly:
- channel = self.client.channel(2)
- channel.channel_open()
- try:
- channel.queue_delete(queue="i-dont-exist", if_empty="True")
- self.fail("Expected delete of non-existant queue to fail")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
-
-
- def test_delete_ifempty(self):
- """
- Test that if_empty field of queue_delete is honoured
- """
- channel = self.channel
-
- #create a queue and add a message to it (use default binding):
- channel.queue_declare(queue="delete-me-2")
- channel.queue_declare(queue="delete-me-2", passive="True")
- channel.message_transfer(routing_key="delete-me-2", body="message")
-
- #try to delete, but only if empty:
- try:
- channel.queue_delete(queue="delete-me-2", if_empty="True")
- self.fail("Expected delete if_empty to fail for non-empty queue")
- except Closed, e:
- self.assertChannelException(406, e.args[0])
-
- #need new channel now:
- channel = self.client.channel(2)
- channel.channel_open()
-
- #empty queue:
- channel.message_consume(destination="consumer_tag", queue="delete-me-2", no_ack=True)
- queue = self.client.queue("consumer_tag")
- msg = queue.get(timeout=1)
- self.assertEqual("message", msg.body)
- channel.message_cancel(destination="consumer_tag")
-
- #retry deletion on empty queue:
- channel.queue_delete(queue="delete-me-2", if_empty="True")
-
- #check that it has gone by declaring passively:
- try:
- channel.queue_declare(queue="delete-me-2", passive="True")
- self.fail("Queue has not been deleted")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
- def test_delete_ifunused(self):
- """
- Test that if_unused field of queue_delete is honoured
- """
- channel = self.channel
-
- #create a queue and register a consumer:
- channel.queue_declare(queue="delete-me-3")
- channel.queue_declare(queue="delete-me-3", passive="True")
- channel.message_consume(destination="consumer_tag", queue="delete-me-3", no_ack=True)
-
- #need new channel now:
- channel2 = self.client.channel(2)
- channel2.channel_open()
- #try to delete, but only if empty:
- try:
- channel2.queue_delete(queue="delete-me-3", if_unused="True")
- self.fail("Expected delete if_unused to fail for queue with existing consumer")
- except Closed, e:
- self.assertChannelException(406, e.args[0])
-
-
- channel.message_cancel(destination="consumer_tag")
- channel.queue_delete(queue="delete-me-3", if_unused="True")
- #check that it has gone by declaring passively:
- try:
- channel.queue_declare(queue="delete-me-3", passive="True")
- self.fail("Queue has not been deleted")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
-
- def test_autodelete_shared(self):
- """
- Test auto-deletion (of non-exclusive queues)
- """
- channel = self.channel
- other = self.connect()
- channel2 = other.channel(1)
- channel2.channel_open()
-
- channel.queue_declare(queue="auto-delete-me", auto_delete=True)
-
- #consume from both channels
- reply = channel.basic_consume(queue="auto-delete-me", no_ack=True)
- channel2.basic_consume(queue="auto-delete-me", no_ack=True)
-
- #implicit cancel
- channel2.channel_close()
-
- #check it is still there
- channel.queue_declare(queue="auto-delete-me", passive=True)
-
- #explicit cancel => queue is now unused again:
- channel.basic_cancel(consumer_tag=reply.consumer_tag)
-
- #NOTE: this assumes there is no timeout in use
-
- #check that it has gone be declaring passively
- try:
- channel.queue_declare(queue="auto-delete-me", passive=True)
- self.fail("Expected queue to have been deleted")
- except Closed, e:
- self.assertChannelException(404, e.args[0])
-
-
diff --git a/M4-RCs/qpid/python/tests_0-9/testlib.py b/M4-RCs/qpid/python/tests_0-9/testlib.py
deleted file mode 100644
index f345fbbd80..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/testlib.py
+++ /dev/null
@@ -1,66 +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.
-#
-
-#
-# Tests for the testlib itself.
-#
-
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-from Queue import Empty
-
-import sys
-from traceback import *
-
-def mytrace(frame, event, arg):
- print_stack(frame);
- print "===="
- return mytrace
-
-class TestBaseTest(TestBase):
- """Verify TestBase functions work as expected"""
-
- def testAssertEmptyPass(self):
- """Test assert empty works"""
- self.queue_declare(queue="empty")
- q = self.consume("empty")
- self.assertEmpty(q)
- try:
- q.get(timeout=1)
- self.fail("Queue is not empty.")
- except Empty: None # Ignore
-
- def testAssertEmptyFail(self):
- self.queue_declare(queue="full")
- q = self.consume("full")
- self.channel.message_transfer(routing_key="full", body="")
- try:
- self.assertEmpty(q);
- self.fail("assertEmpty did not assert on non-empty queue")
- except AssertionError: None # Ignore
-
- def testMessageProperties(self):
- """Verify properties are passed with message"""
- props={"x":1, "y":2}
- self.queue_declare(queue="q")
- q = self.consume("q")
- self.assertPublishGet(q, routing_key="q", properties=props)
-
-
-
diff --git a/M4-RCs/qpid/python/tests_0-9/tx.py b/M4-RCs/qpid/python/tests_0-9/tx.py
deleted file mode 100644
index 0f6b4f5cd1..0000000000
--- a/M4-RCs/qpid/python/tests_0-9/tx.py
+++ /dev/null
@@ -1,188 +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 qpid.client import Client, Closed
-from qpid.queue import Empty
-from qpid.content import Content
-from qpid.testlib import testrunner, TestBase
-
-class TxTests(TestBase):
- """
- Tests for 'methods' on the amqp tx 'class'
- """
-
- def test_commit(self):
- """
- Test that commited publishes are delivered and commited acks are not re-delivered
- """
- channel = self.channel
- queue_a, queue_b, queue_c = self.perform_txn_work(channel, "tx-commit-a", "tx-commit-b", "tx-commit-c")
- channel.tx_commit()
-
- #check results
- for i in range(1, 5):
- msg = queue_c.get(timeout=1)
- self.assertEqual("TxMessage %d" % i, msg.body)
- msg.ok()
-
- msg = queue_b.get(timeout=1)
- self.assertEqual("TxMessage 6", msg.body)
- msg.ok()
-
- msg = queue_a.get(timeout=1)
- self.assertEqual("TxMessage 7", msg.body)
- msg.ok()
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- #cleanup
- channel.tx_commit()
-
- def test_auto_rollback(self):
- """
- Test that a channel closed with an open transaction is effectively rolled back
- """
- channel = self.channel
- queue_a, queue_b, queue_c = self.perform_txn_work(channel, "tx-autorollback-a", "tx-autorollback-b", "tx-autorollback-c")
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- channel.tx_rollback()
-
- #check results
- for i in range(1, 5):
- msg = queue_a.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.body)
- msg.ok()
-
- msg = queue_b.get(timeout=1)
- self.assertEqual("Message 6", msg.body)
- msg.ok()
-
- msg = queue_c.get(timeout=1)
- self.assertEqual("Message 7", msg.body)
- msg.ok()
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- #cleanup
- channel.tx_commit()
-
- def test_rollback(self):
- """
- Test that rolled back publishes are not delivered and rolled back acks are re-delivered
- """
- channel = self.channel
- queue_a, queue_b, queue_c = self.perform_txn_work(channel, "tx-rollback-a", "tx-rollback-b", "tx-rollback-c")
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- channel.tx_rollback()
-
- #check results
- for i in range(1, 5):
- msg = queue_a.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.body)
- msg.ok()
-
- msg = queue_b.get(timeout=1)
- self.assertEqual("Message 6", msg.body)
- msg.ok()
-
- msg = queue_c.get(timeout=1)
- self.assertEqual("Message 7", msg.body)
- msg.ok()
-
- for q in [queue_a, queue_b, queue_c]:
- try:
- extra = q.get(timeout=1)
- self.fail("Got unexpected message: " + extra.body)
- except Empty: None
-
- #cleanup
- channel.tx_commit()
-
- def perform_txn_work(self, channel, name_a, name_b, name_c):
- """
- Utility method that does some setup and some work under a transaction. Used for testing both
- commit and rollback
- """
- #setup:
- channel.queue_declare(queue=name_a, exclusive=True)
- channel.queue_declare(queue=name_b, exclusive=True)
- channel.queue_declare(queue=name_c, exclusive=True)
-
- key = "my_key_" + name_b
- topic = "my_topic_" + name_c
-
- channel.queue_bind(queue=name_b, exchange="amq.direct", routing_key=key)
- channel.queue_bind(queue=name_c, exchange="amq.topic", routing_key=topic)
-
- for i in range(1, 5):
- channel.message_transfer(routing_key=name_a, body="Message %d" % i)
-
- channel.message_transfer(routing_key=key, destination="amq.direct", body="Message 6")
- channel.message_transfer(routing_key=topic, destination="amq.topic", body="Message 7")
-
- channel.tx_select()
-
- #consume and ack messages
- channel.message_consume(queue=name_a, destination="sub_a", no_ack=False)
- queue_a = self.client.queue("sub_a")
- for i in range(1, 5):
- msg = queue_a.get(timeout=1)
- self.assertEqual("Message %d" % i, msg.body)
-
- msg.ok(batchoffset=-3)
-
- channel.message_consume(queue=name_b, destination="sub_b", no_ack=False)
- queue_b = self.client.queue("sub_b")
- msg = queue_b.get(timeout=1)
- self.assertEqual("Message 6", msg.body)
- msg.ok()
-
- sub_c = channel.message_consume(queue=name_c, destination="sub_c", no_ack=False)
- queue_c = self.client.queue("sub_c")
- msg = queue_c.get(timeout=1)
- self.assertEqual("Message 7", msg.body)
- msg.ok()
-
- #publish messages
- for i in range(1, 5):
- channel.message_transfer(routing_key=topic, destination="amq.topic", body="TxMessage %d" % i)
-
- channel.message_transfer(routing_key=key, destination="amq.direct", body="TxMessage 6")
- channel.message_transfer(routing_key=name_a, body="TxMessage 7")
-
- return queue_a, queue_b, queue_c
diff --git a/M4-RCs/qpid/review/LICENSE b/M4-RCs/qpid/review/LICENSE
deleted file mode 100644
index bc46b77047..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/review/NOTICE b/M4-RCs/qpid/review/NOTICE
deleted file mode 100644
index 54c534c30b..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/review/agenda.py b/M4-RCs/qpid/review/agenda.py
deleted file mode 100755
index 22948e3ced..0000000000
--- a/M4-RCs/qpid/review/agenda.py
+++ /dev/null
@@ -1,65 +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
-
-prereqs = ["tr", "svn", "xsltproc", "sed", "grep", "wget"]
-
-svncmd = "svn log https://svn.apache.org/repos/asf/incubator/qpid --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 stdout.read()
-
-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/M4-RCs/qpid/review/jiraRSS2wiki.xsl b/M4-RCs/qpid/review/jiraRSS2wiki.xsl
deleted file mode 100644
index bd4933cfb4..0000000000
--- a/M4-RCs/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/M4-RCs/qpid/review/svnlog2wiki.xsl b/M4-RCs/qpid/review/svnlog2wiki.xsl
deleted file mode 100644
index b705115cfd..0000000000
--- a/M4-RCs/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 ||
-<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/M4-RCs/qpid/ruby/LICENSE.txt b/M4-RCs/qpid/ruby/LICENSE.txt
deleted file mode 100755
index 6b0b1270ff..0000000000
--- a/M4-RCs/qpid/ruby/LICENSE.txt
+++ /dev/null
@@ -1,203 +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/M4-RCs/qpid/ruby/NOTICE.txt b/M4-RCs/qpid/ruby/NOTICE.txt
deleted file mode 100644
index fff2bca45c..0000000000
--- a/M4-RCs/qpid/ruby/NOTICE.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-=========================================================================
-== NOTICE file corresponding to the section 4 d of ==
-== the Apache License, Version 2.0, ==
-== in this case for the Apache Qpid distribution. ==
-=========================================================================
-
-This product includes software developed by the Apache Software Foundation
-(http://www.apache.org/).
-
-Please read the LICENSE.txt file present in the root directory of this
-distribution.
-
-
-Aside from contributions to the Apache Qpid project, this software also
-includes (binary only):
-
- - None at this time.
-
-
diff --git a/M4-RCs/qpid/ruby/README.txt b/M4-RCs/qpid/ruby/README.txt
deleted file mode 100644
index b68a41b7b4..0000000000
--- a/M4-RCs/qpid/ruby/README.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-= INSTALLATION =
-
-Extract the release archive into a directory of your choice and set
-your RUBYLIB environment variable accordingly:
-
- tar -xzf qpid-ruby-<version>.tar.gz -C <install-prefix>
- export RUBYLIB=<install-prefix>/qpid-<version>/ruby/lib
-
-= GETTING STARTED =
-
-The ruby client includes a simple hello-world example that publishes
-and consumes a message:
-
- cp <install-prefix>/qpid-<version>/ruby/examples/hello-world.rb .
- ./hello-world.rb
-
-= RUNNING THE TESTS =
-
-The "tests" directory contains a collection of unit tests for the ruby
-client. These can be run with the Rakefile provided:
-
- ./rake test
diff --git a/M4-RCs/qpid/ruby/RELEASE_NOTES b/M4-RCs/qpid/ruby/RELEASE_NOTES
deleted file mode 100644
index 29760bd83a..0000000000
--- a/M4-RCs/qpid/ruby/RELEASE_NOTES
+++ /dev/null
@@ -1,15 +0,0 @@
-Apache Qpid Ruby M4 Release Notes
----------------------------------
-
-The Qpid M4 release of the ruby client contains support the for AMQP
-0-10 & 0-8 specifications. See:
-
-http://jira.amqp.org/confluence/display/AMQP/Download
-
-For full details of Qpid capabilities, as they currently stand, see
-our project page at:
-
-http://cwiki.apache.org/confluence/display/qpid/Index
-
-The README file provided contains some details on installing and using
-the ruby client that is included with this distribution.
diff --git a/M4-RCs/qpid/ruby/Rakefile b/M4-RCs/qpid/ruby/Rakefile
deleted file mode 100644
index 64044ca351..0000000000
--- a/M4-RCs/qpid/ruby/Rakefile
+++ /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.
-#
-
-# Rakefile for ruby-rpm -*- ruby -*-
-require 'rake/clean'
-require 'rake/testtask'
-require 'rake/gempackagetask'
-require 'pathname'
-
-PKG_NAME='ruby-qpid'
-PKG_VERSION='0.10.2'
-GEM_NAME='qpid'
-
-#
-# Additional files for clean/clobber
-#
-
-CLEAN.include [ "**/*~", "lib/*/spec_cache" ]
-
-Rake::TestTask.new(:test) do |t|
- t.test_files = FileList['tests/*.rb'].exclude("tests/util.rb")
- t.libs = [ 'lib' ]
-end
-
-Rake::TestTask.new(:"test_0-8") do |t|
- t.test_files = FileList["tests_0-8/*.rb"]
- t.libs = [ 'lib' ]
-end
-
-desc "Create cached versions of the AMQP specs"
-task :spec_cache do |t|
- AMQP_SPEC_FILES.each do |f|
- pid = fork do
- $: << "lib"
- require 'qpid'
- Qpid::Spec010::load(f)
- puts "Cached #{f}"
- end
- Process.wait(pid)
- end
-end
-
-#
-# Packaging
-#
-
-PKG_FILES = FileList[
- "DISCLAIMER", "LICENSE.txt", "NOTICE.txt",
- "Rakefile", "RELEASE_NOTES",
- "lib/**/*.rb", "lib/*/spec_cache/*.rb*", "tests/**/*", "examples/**"
-]
-
-DIST_FILES = FileList[
- "pkg/*.tgz", "pkg/*.gem"
-]
-
-SPEC = Gem::Specification.new do |s|
- s.name = GEM_NAME
- s.version = PKG_VERSION
- s.email = "qpid-dev@incubator.apache.org"
- s.homepage = "http://cwiki.apache.org/qpid/"
- s.summary = "Ruby client for Qpid"
- s.files = PKG_FILES
- s.required_ruby_version = '>= 1.8.1'
- s.description = "Ruby client for Qpid"
-end
-
-Rake::GemPackageTask.new(SPEC) do |pkg|
- task pkg.package_dir => [ :spec_cache ]
- pkg.need_tar = true
- pkg.need_zip = true
-end
diff --git a/M4-RCs/qpid/ruby/examples/hello-world.rb b/M4-RCs/qpid/ruby/examples/hello-world.rb
deleted file mode 100644
index 755d13bd54..0000000000
--- a/M4-RCs/qpid/ruby/examples/hello-world.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/ruby
-#
-# 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.
-#
-
-require "qpid"
-require "socket"
-
-broker = if ARGV.length > 0 then ARGV[0] else "localhost" end
-port = if ARGV.length > 1 then ARGV[1].to_i else 5672 end
-if ARGV.length > 2 then
- puts "usage: hello-world.rb [ <broker> [ <port> ] ]"
- exit 1
-end
-
-conn = Qpid::Connection.new(TCPSocket.new(broker, port))
-conn.start(10)
-
-ssn = conn.session("test")
-
-# create a queue
-ssn.queue_declare("test-queue")
-
-# publish a message
-dp = ssn.delivery_properties(:routing_key => "test-queue")
-mp = ssn.message_properties(:content_type => "text/plain")
-msg = Qpid::Message.new(dp, mp, "Hello World!")
-ssn.message_transfer(:message => msg)
-
-# subscribe to a queue
-ssn.message_subscribe(:destination => "messages", :queue => "test-queue",
- :accept_mode => ssn.message_accept_mode.none)
-incoming = ssn.incoming("messages")
-
-# start incoming message flow
-incoming.start()
-
-# grab a message from the queue
-p incoming.get(10)
-
-# cancel the subscription and close the session and connection
-ssn.message_cancel(:destination => "messages")
-ssn.close()
-conn.close()
diff --git a/M4-RCs/qpid/ruby/examples/qmf-libvirt.rb b/M4-RCs/qpid/ruby/examples/qmf-libvirt.rb
deleted file mode 100644
index 492f4fe8d6..0000000000
--- a/M4-RCs/qpid/ruby/examples/qmf-libvirt.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/ruby
-#
-# 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.
-#
-
-require "qpid"
-
-s = Qpid::Qmf::Session.new()
-b = s.add_broker("amqp://localhost:5672")
-
-while true:
- nodes = s.objects(:class => "node")
- nodes.each do |node|
- puts "node: #{node.hostname}"
- for (key, val) in node.properties
- puts " property: #{key}, #{val}"
- end
-
- # Find any domains that on the current node.
- domains = s.objects(:class => "domain", 'node' => node.object_id)
- domains.each do |domain|
- r = domain.getXMLDesc()
- puts "status: #{r.status}"
- if r.status == 0
- puts "xml description: #{r.description}"
- puts "length: #{r.description.length}"
- end
-
- puts " domain: #{domain.name}, state: #{domain.state}, id: #{domain.id}"
- for (key, val) in domain.properties
- puts " property: #{key}, #{val}"
- end
- end
-
- pools = s.objects(:class => "pool", 'node' => node.object_id)
- pools.each do |pool|
- puts " pool: #{pool.name}"
- for (key, val) in pool.properties
- puts " property: #{key}, #{val}"
- end
-
- r = pool.getXMLDesc()
- puts "status: #{r.status}"
- puts "text: #{r.text}"
- if r.status == 0
- puts "xml description: #{r.description}"
- puts "length: #{r.description.length}"
- end
-
- # Find volumes that are part of the pool.
- volumes = s.objects(:class => "volume", 'pool' => pool.object_id)
- volumes.each do |volume|
- puts " volume: #{volume.name}"
- for (key, val) in volume.properties
- puts " property: #{key}, #{val}"
- end
- end
- end
-
- end
-
- puts '----------------------------'
- sleep(5)
-
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid.rb b/M4-RCs/qpid/ruby/lib/qpid.rb
deleted file mode 100644
index 1c719e9b1d..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid.rb
+++ /dev/null
@@ -1,41 +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.
-#
-
-module Qpid
- def self.logger
- @logger ||= {}
- @logger
- end
-end
-
-require "qpid/util"
-require "qpid/queue"
-require "qpid/packer"
-require "qpid/framer"
-require "qpid/codec"
-require 'qpid/datatypes'
-require 'qpid/spec010'
-require 'qpid/delegates'
-require 'qpid/invoker'
-require "qpid/assembler"
-require 'qpid/session'
-require "qpid/connection"
-require "qpid/spec"
-require 'qpid/queue'
-require 'qpid/qmf'
diff --git a/M4-RCs/qpid/ruby/lib/qpid/assembler.rb b/M4-RCs/qpid/ruby/lib/qpid/assembler.rb
deleted file mode 100644
index b768c3f195..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/assembler.rb
+++ /dev/null
@@ -1,148 +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.
-#
-
-module Qpid
-
- class << self
- attr_accessor :asm_logger
- end
-
- class Segment
-
- attr_reader :type, :payload, :track, :channel
- attr_accessor :id, :offset
-
- def initialize(first, last, type, track, channel, payload)
- @id = nil
- @offset = nil
- @first = first
- @last = last
- @type = type
- @track = track
- @channel = channel
- @payload = payload
- end
-
- def first_segment? ; @first ; end
-
- def last_segment? ; @last ; end
-
- def decode(spec)
- segs = spec[:segment_type]
- choice = segs.enum.choices[type]
- return method("decode_#{choice.name}").call(spec)
- end
-
- def decode_control(spec)
- sc = StringCodec.new(spec, payload)
- return sc.read_control()
- end
-
- def decode_command(spec)
- sc = StringCodec.new(spec, payload)
- hdr, cmd = sc.read_command()
- cmd.id = id
- return hdr, cmd
- end
-
- def decode_header(spec)
- sc = StringCodec.new(spec, payload)
- values = []
- until sc.encoded.empty?
- values << sc.read_struct32()
- end
- return values
- end
-
- def decode_body(spec)
- payload
- end
-
- def append(frame)
- @payload += frame.payload
- end
-
- def to_s
- f = first_segment? ? 'F' : '.'
- l = last_segment? ? 'L' : '.'
- return "%s%s %s %s %s %s" % [f, l, @type,
- @track, @channel, @payload.inspect]
- end
-
- end
-
- class Assembler < Framer
-
- def logger; Qpid::asm_logger; end
-
- def initialize(sock, max_payload = Frame::MAX_PAYLOAD)
- super(sock)
- @max_payload = max_payload
- @fragments = {}
- end
-
- def read_segment
- loop do
- frame = read_frame
- key = [frame.channel, frame.track]
- seg = @fragments[key]
- unless seg
- seg = Segment.new(frame.first_segment?,
- frame.last_segment?,
- frame.type, frame.track,
- frame.channel, "")
- @fragments[key] = seg
- end
-
- seg.append(frame)
-
- if frame.last_frame?
- @fragments.delete(key)
- logger.debug("RECV #{seg}") if logger
- return seg
- end
- end
- end
-
- def write_segment(segment)
- remaining = segment.payload
-
- first = true
- while first or remaining
- payload = remaining[0, @max_payload]
- remaining = remaining[@max_payload, remaining.size]
-
- flags = 0
-
- flags |= FIRST_FRM if first
- flags |= LAST_FRM unless remaining
- flags |= FIRST_SEG if segment.first_segment?
- flags |= LAST_SEG if segment.last_segment?
-
- frame = Frame.new(flags, segment.type, segment.track,
- segment.channel, payload)
- write_frame(frame)
-
- first = false
- end
-
- logger.debug("SENT #{segment}") if logger
- end
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/client.rb b/M4-RCs/qpid/ruby/lib/qpid/client.rb
deleted file mode 100644
index ec3d100a9c..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/client.rb
+++ /dev/null
@@ -1,136 +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.
-#
-
-require "thread"
-require "qpid/peer"
-require "qpid/queue"
-
-module Qpid08
-
- class Client
- def initialize(host, port, spec, vhost = "/")
- @host = host
- @port = port
- @spec = spec
- @vhost = vhost
-
- @mechanism = nil
- @response = nil
- @locale = nil
-
- @queues = {}
- @mutex = Mutex.new()
-
- @closed = false
- @code = nil
- @started = ConditionVariable.new()
-
- @conn = Connection.new(@host, @port, @spec)
- @peer = Peer.new(@conn, ClientDelegate.new(self))
- end
-
- attr_reader :mechanism, :response, :locale
-
- def closed?; @closed end
- def closed=(value); @closed = value end
- def code; @code end
-
- def wait()
- @mutex.synchronize do
- @started.wait(@mutex)
- end
- raise EOFError.new() if closed?
- end
-
- def signal_start()
- @started.broadcast()
- end
-
- def queue(key)
- @mutex.synchronize do
- q = @queues[key]
- if q.nil?
- q = Queue.new()
- @queues[key] = q
- end
- return q
- end
- end
-
- def start(response, mechanism="AMQPLAIN", locale="en_US")
- @response = response
- @mechanism = mechanism
- @locale = locale
-
- @conn.connect()
- @conn.init()
- @peer.start()
- wait()
- channel(0).connection_open(@vhost)
- end
-
- def channel(id)
- return @peer.channel(id)
- end
-
- def close(msg = nil)
- @closed = true
- @code = msg
- @peer.close()
- end
- end
-
- class ClientDelegate
-
- include Delegate
-
- def initialize(client)
- @client = client
- end
-
- def connection_start(ch, msg)
- ch.connection_start_ok(:mechanism => @client.mechanism,
- :response => @client.response,
- :locale => @client.locale)
- end
-
- def connection_tune(ch, msg)
- ch.connection_tune_ok(*msg.fields)
- @client.signal_start()
- end
-
- def connection_close(ch, msg)
- puts "CONNECTION CLOSED: #{msg.args.join(", ")}"
- @client.close(msg)
- end
-
- def channel_close(ch, msg)
- puts "CHANNEL[#{ch.id}] CLOSED: #{msg.args.join(", ")}"
- ch.channel_close_ok()
- ch.close()
- end
-
- def basic_deliver(ch, msg)
- queue = @client.queue(msg.consumer_tag)
- queue << msg
- end
-
- end
-
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/codec.rb b/M4-RCs/qpid/ruby/lib/qpid/codec.rb
deleted file mode 100644
index 009b1eef53..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/codec.rb
+++ /dev/null
@@ -1,455 +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.
-#
-
-require 'qpid/packer.rb'
-require 'iconv'
-
-module Qpid
-
- class Codec
-
- include Qpid::Packer
-
- def initialize(spec = "")
- @spec = spec
- end
-
- def write_void(v)
- unless v.nil?
- raise Exception.new("void not nil: #{v}")
- end
- end
-
- def read_void
- return nil
- end
-
- def write_bit(b)
- unless b
- raise Exception.new("bit is nil: #{b}")
- end
- end
-
- def read_bit
- return true
- end
-
- def read_uint8
- return unpack("C", 1)
- end
-
- def write_uint8(n)
- return pack("C", n)
- end
-
- def read_int8
- return unpack("c", 1)
- end
-
- def write_int8(n)
- pack("c", n)
- end
-
- def read_char
- return unpack("c", 1)
- end
-
- def write_char(c)
- pack("c")
- end
-
- def read_boolean
- return read_uint8 != 0
- end
-
- def write_boolean(b)
- n = 0
- n = 1 if b != 0
- write_uint8(n)
- end
-
- def read_uint16
- return unpack("n", 2)
- end
-
- def write_uint16(n)
- pack("n", n)
- end
-
- def read_int16
- # XXX: holy moly.. pack/unpack doesn't have signed network byte order. Crazy hackery.
- val = unpack("n", 2)
- val -= 2 ** 16 if val >= 2 ** 15
- return val
- end
-
- def write_int16(n)
- # XXX: Magically this one works even though it's not signed.
- pack("n", n)
- end
-
- def read_uint32
- return unpack("N", 4)
- end
-
- def write_uint32(n)
- pack("N", n)
- end
-
- def read_int32
- # Again no pack/unpack for signed int
- return unpack("N", 4)
- end
-
- def write_int32(n)
- # FIXME
- pack("N", n)
- end
-
- def read_float
- return unpack("g", 4)
- end
-
- def write_float(n)
- pack("g", n)
- end
-
- def read_sequence_no
- return read_uint32.to_serial
- end
-
- def write_sequence_no(n)
- write_uint32(n.value)
- end
-
- def encode_64bit(num, signed = false)
- b = []
-
- if num < 0 && signed
- num += 2 ** 64
- end
-
- (0..7).each do |c|
- d = 7 - c
- b[c] = (num & (0xff << d * 8)) >> d * 8
- end
- pack('C8', *b)
- end
-
-
- def decode_64bit(signed = false)
- # Silly ruby pack/unpack does not implement 64 bit network byte order
- # encode/decode.
- a = unpack('C8', 8)
- num = 0
- (0..7).each do |c|
- d = 7 - c
- num |= a[c] << 8 * d
- end
-
- if signed && num >= 2 ** 63
- num -= 2 ** 64
- end
- return num
- end
-
- def read_uint64
- return decode_64bit
- end
-
- def write_uint64(n)
- encode_64bit(n)
- end
-
- def read_int64
- return decode_64bit(signed = true)
- end
-
- def write_int64(n)
- encode_64bit(n, signed = true)
- end
-
- def read_datetime
- return read_uint64
- end
-
- def write_datetime(n)
- write_uint64(n)
- end
-
- def read_double
- return unpack("G", 8)
- end
-
- def write_double(n)
- pack("G", n)
- end
-
- def read_vbin8
- # XXX
- return read(read_uint8)
- end
-
- def write_vbin8(b)
- # XXX
- write_uint8(b.length)
- write(b)
- end
-
- def read_str8
- # FIXME: Check iconv.. I think this will throw if there are odd characters.
- return Iconv.conv("ASCII", "UTF-8", read_vbin8)
- end
-
- def write_str8(s)
- write_vbin8(Iconv.conv("UTF-8", "ASCII", s))
- end
-
- def read_str16
- return Iconv.conv("ASCII", "UTF-8", read_vbin16)
- end
-
- def write_str16(s)
- write_vbin16(Iconv.conv("UTF-8", "ASCII", s))
- end
-
- def read_vbin16
- # XXX: Using read method?
- return read(read_uint16)
- end
-
- def write_vbin16(b)
- write_uint16(b.length)
- write(b)
- end
-
- def read_sequence_set
- # FIXME: Need datatypes
- result = RangedSet.new
- size = read_uint16
- nranges = size / 8
- nranges.times do |i|
- lower = read_sequence_no
- upper = read_sequence_no
- result.add(lower, upper)
- end
- return result
- end
-
- def write_sequence_set(ss)
- size = 8 * ss.ranges.length
- write_uint16(size)
- ss.ranges.each do |range|
- write_sequence_no(range.lower)
- write_sequence_no(range.upper)
- end
- end
-
- def read_vbin32
- return read(read_uint32)
- end
-
- def write_vbin32(b)
- write_uint32(b.length)
- write(b)
- end
-
- def write_map(m)
- sc = StringCodec.new(@spec)
- unless m.nil?
- sc.write_uint32(m.size)
- m.each do |k, v|
- unless type = @spec.encoding(v.class)
- raise Exception.new("no encoding for: #{v.class}")
- end
- sc.write_str8(k)
- sc.write_uint8(type.code)
- type.encode(sc, v)
- end
- end
- write_vbin32(sc.encoded)
- end
-
- def read_map
- sc = StringCodec.new(@spec, read_vbin32)
- return nil unless sc.encoded
- count = sc.read_uint32
- result = nil
- if count
- result = {}
- until sc.encoded.empty?
- k = sc.read_str8
- code = sc.read_uint8
- type = @spec.types[code]
- v = type.decode(sc)
- result[k] = v
- end
- end
- return result
- end
-
- def write_array(a)
- sc = StringCodec.new(@spec)
- unless a.nil?
- if a.length > 0
- type = @spec.encoding(a[0].class)
- else
- type = @spec.encoding(nil.class)
- end
- sc.write_uint8(type.code)
- sc.write_uint32(a.size)
- a.each { |o| type.encode(sc, o) }
- end
- write_vbin32(sc.encoded)
- end
-
- def read_array
- sc = StringCodec.new(@spec, read_vbin32)
- return nil if not sc.encoded
- type = @spec.types[sc.read_uint8]
- count = sc.read_uint32
- result = nil
- if count
- result = []
- count.times { |i| result << (type.decode(sc)) }
- end
- return result
- end
-
- def write_list(l)
- sc = StringCodec.new(@spec)
- unless l.nil?
- sc.write_uint32(l.length)
- l.each do |o|
- type = @spec.encoding(o.class)
- sc.write_uint8(type.code)
- type.encode(sc, o)
- end
- end
- write_vbin32(sc.encoded)
- end
-
- def read_list
- sc = StringCodec.new(@spec, read_vbin32)
- return nil if not sc.encoded
- count = sc.read_uint32
- result = nil
- if count
- result = []
- count.times do |i|
- type = @spec.types[sc.read_uint8]
- result << type.decode(sc)
- end
- end
- return result
- end
-
- def read_struct32
- size = read_uint32
- code = read_uint16
- type = @spec.structs[code]
- # XXX: BLEH!
- fields = type.decode_fields(self)
- return Qpid::struct(type, fields)
- end
-
- def write_struct32(value)
- type = value.type
- sc = StringCodec.new(@spec)
- sc.write_uint16(type.code)
- type.encode_fields(sc, value)
- write_vbin32(sc.encoded)
- end
-
- def read_control
- cntrl = @spec.controls[read_uint16]
- return Qpid::struct(cntrl, cntrl.decode_fields(self))
- end
-
- def write_control(ctrl)
- type = ctrl.type
- write_uint16(type.code)
- type.encode_fields(self, ctrl)
- end
-
- def read_command
- type = @spec.commands[read_uint16]
- hdr = @spec[:header].decode(self)
- cmd = Qpid::struct(type, type.decode_fields(self))
- return hdr, cmd
- end
-
- def write_command(hdr, cmd)
- type = cmd.type
- write_uint16(type.code)
- hdr.type.encode(self, hdr)
- type.encode_fields(self, cmd)
- end
-
- def read_size(width)
- if width > 0
- return send(:"read_uint#{width * 8}")
- end
- end
-
- def write_size(width, n)
- if width > 0
- send(:"write_uint#{width * 8}", n)
- end
- end
-
- def read_uuid
- return unpack("A16", 16)
- end
-
- def write_uuid(s)
- pack("A16", s)
- end
-
- def read_bin128
- return unpack("A16", 16)
- end
-
- def write_bin128(b)
- pack("A16", b)
- end
-
- end
-
- class StringCodec < Codec
-
- def initialize(spec, encoded = "")
- @spec = spec
- @encoded = encoded
- end
-
- attr_reader :encoded
-
- def write(s)
- @encoded += s
- end
-
- def read(n)
- return "" if n.nil?
- result = @encoded[0...n]
- @encoded = @encoded[n...@encoded.size] || ""
- return result
- end
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/codec08.rb b/M4-RCs/qpid/ruby/lib/qpid/codec08.rb
deleted file mode 100644
index 148dee07bb..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/codec08.rb
+++ /dev/null
@@ -1,265 +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.
-#
-
-module Qpid08
- # is there a better way to do this?
- class StringWriter
-
- def initialize(str = "")
- @str = str
- end
-
- def write(value)
- @str << value
- end
-
- def to_s()
- return @str
- end
-
- end
-
- class EOF < Exception; end
-
- class Encoder
-
- def initialize(out)
- @out = out
- @bits = []
- end
-
- attr_reader(:out)
-
- def encode(type, value)
- send(type, value)
- end
-
- def bit(b)
- @bits << b
- end
-
- def octet(o)
- pack("C", o)
- end
-
- def short(s)
- pack("n", s)
- end
-
- def long(l)
- pack("N", l)
- end
-
- def longlong(l)
- lower = l & 0xffffffff
- upper = (l & ~0xffffffff) >> 32
- long(upper)
- long(lower)
- end
-
- def timestamp(l)
- longlong(l)
- end
-
- def shortstr(s)
- # shortstr is actually octetstr
- octet(s.length)
- write(s)
- end
-
- def longstr(s)
- case s
- when Hash
- table(s)
- else
- long(s.length)
- write(s)
- end
- end
-
- def table(t)
- t = {} if t.nil?
- enc = Encoder.new(StringWriter.new())
- t.each {|key, value|
- enc.shortstr(key)
- # I offer this chicken to the gods of polymorphism. May they
- # choke on it.
- case value
- when String
- type = :longstr
- desc = "S"
- when Numeric
- type = :long
- desc = "I"
- else
- raise Exception.new("unknown table value: #{value.class}")
- end
- enc.write(desc)
- enc.encode(type, value)
- }
- longstr(enc.out.to_s())
- end
-
- def write(str)
- flushbits()
- @out.write(str)
- # puts "OUT #{str.inspect()}"
- end
-
- def pack(fmt, *args)
- write(args.pack(fmt))
- end
-
- def flush()
- flushbits()
- end
-
- private
-
- def flushbits()
- if @bits.empty? then return end
-
- bytes = []
- index = 0
- @bits.each {|b|
- bytes << 0 if index == 0
- if b then bytes[-1] |= 1 << index end
- index = (index + 1) % 8
- }
- @bits.clear()
- bytes.each {|b|
- octet(b)
- }
- end
-
- end
-
- class StringReader
-
- def initialize(str)
- @str = str
- @index = 0
- end
-
- def read(n)
- result = @str[@index, n]
- @index += result.length
- return result
- end
-
- end
-
- class Decoder
-
- def initialize(_in)
- @in = _in
- @bits = []
- end
-
- def decode(type)
- return send(type)
- end
-
- def bit()
- if @bits.empty?
- byte = octet()
- 7.downto(0) {|i|
- @bits << (byte[i] == 1)
- }
- end
- return @bits.pop()
- end
-
- def octet()
- return unpack("C", 1)
- end
-
- def short()
- return unpack("n", 2)
- end
-
- def long()
- return unpack("N", 4)
- end
-
- def longlong()
- upper = long()
- lower = long()
- return upper << 32 | lower
- end
-
- def timestamp()
- return longlong()
- end
-
- def shortstr()
- # shortstr is actually octetstr
- return read(octet())
- end
-
- def longstr()
- return read(long())
- end
-
- def table()
- dec = Decoder.new(StringReader.new(longstr()))
- result = {}
- while true
- begin
- key = dec.shortstr()
- rescue EOF
- break
- end
- desc = dec.read(1)
- case desc
- when "S"
- value = dec.longstr()
- when "I"
- value = dec.long()
- else
- raise Exception.new("unrecognized descriminator: #{desc.inspect()}")
- end
- result[key] = value
- end
- return result
- end
-
- def read(n)
- return "" if n == 0
- result = @in.read(n)
- if result.nil? or result.empty?
- raise EOF.new()
- else
- # puts " IN #{result.inspect()}"
- return result
- end
- end
-
- def unpack(fmt, size)
- result = read(size).unpack(fmt)
- if result.length == 1
- return result[0]
- else
- return result
- end
- end
-
- end
-
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/config.rb b/M4-RCs/qpid/ruby/lib/qpid/config.rb
deleted file mode 100644
index 1a0942d5d5..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/config.rb
+++ /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.
-#
-
-module Qpid
- module Config
-
- def self.amqp_spec
- dirs = [File::expand_path(File::join(File::dirname(__FILE__), "../../../specs")),
- "/usr/share/amqp"]
- dirs.each do |d|
- spec = File::join(d, "amqp.0-10-qpid-errata.xml")
- return spec if File::exists? spec
- end
- end
-
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/connection.rb b/M4-RCs/qpid/ruby/lib/qpid/connection.rb
deleted file mode 100644
index 59d88196a3..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/connection.rb
+++ /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.
-#
-
-require 'monitor'
-
-module Qpid
-
- class ChannelBusy< Exception ; end
-
- class ChannelsBusy < Exception ; end
-
- class SessionBusy < Exception ; end
-
- class ConnectionFailed < Exception ; end
-
- class Timeout < Exception ; end
-
- class Connection < Assembler
-
- include MonitorMixin
-
- attr_reader :spec, :attached, :sessions, :thread
- attr_accessor :opened, :failed, :close_code
-
- def initialize(sock, args={})
- super(sock)
-
- delegate = args[:delegate] || Qpid::Delegate::Client.method(:new)
- spec = args[:spec] || nil
-
- @spec = Qpid::Spec010::load(spec)
- @track = @spec["track"]
-
- @attached = {}
- @sessions = {}
-
- @condition = new_cond
- @opened = false
- @failed = false
- @close_code = [nil, "connection aborted"]
-
- @thread = nil
-
- @channel_max = 65535
-
- @delegate = delegate.call(self, args)
- end
-
- def attach(name, ch, delegate, force=false)
- synchronize do
- ssn = @attached[ch.id]
- if ssn
- raise ChannelBusy.new(ch, ssn) unless ssn.name == name
- else
- ssn = @sessions[name]
- if ssn.nil?
- ssn = Session.new(name, @spec, :delegate => delegate)
- @sessions[name] = ssn
- elsif ssn.channel
- if force
- @attached.delete(ssn.channel.id)
- ssn.channel = nil
- else
- raise SessionBusy.new(ssn)
- end
- end
- @attached[ch.id] = ssn
- ssn.channel = ch
- end
- ch.session = ssn
- return ssn
- end
- end
-
- def detach(name, ch)
- synchronize do
- @attached.delete(ch.id)
- ssn = @sessions.delete(name)
- if ssn
- ssn.channel = nil
- ssn.closed
- return ssn
- end
- end
- end
-
- def session(name, kwargs = {})
- timeout = kwargs[:timeout]
- delegate = kwargs[:delegate] || Qpid::Session::Client.method(:new)
-
- # FIXME: Python has cryptic comment about 'ch 0 ?'
- channel = (0..@channel_max).detect { |i| ! @attached.key?(i) }
- raise ChannelsBusy unless channel
-
- synchronize do
- ch = Channel.new(self, channel)
- ssn = attach(name, ch, delegate)
- ssn.channel.session_attach(name)
- if ssn.wait_for(timeout) { ssn.channel }
- return ssn
- else
- detach(name, ch)
- raise Timeout
- end
- end
- end
-
- def detach_all
- synchronize do
- attached.values.each do |ssn|
- ssn.exceptions << @close_code unless @close_code[0] == 200
- detach(ssn.name, ssn.channel)
- end
- end
- end
-
- def start(timeout=nil)
- @delegate.start
- @thread = Thread.new { run }
- @thread[:name] = 'conn'
- synchronize do
- unless @condition.wait_for(timeout) { @opened || @failed }
- raise Timeout
- end
- end
- if @failed
- raise ConnectionFailed.new(@close_code)
- end
- end
-
- def run
- # XXX: we don't really have a good way to exit this loop without
- # getting the other end to kill the socket
- loop do
- begin
- seg = read_segment
- rescue Qpid::Closed => e
- detach_all
- break
- end
- @delegate.received(seg)
- end
- end
-
- def close(timeout=nil)
- return unless @opened
- Channel.new(self, 0).connection_close(200)
- synchronize do
- unless @condition.wait_for(timeout) { ! @opened }
- raise Timeout
- end
- end
- @thread.join(timeout)
- @thread = nil
- end
-
- def signal
- synchronize { @condition.signal }
- end
-
- def to_s
- # FIXME: We'd like to report something like HOST:PORT
- return @sock.to_s
- end
-
- class Channel < Invoker
-
- attr_reader :id, :connection
- attr_accessor :session
-
- def initialize(connection, id)
- @connection = connection
- @id = id
- @session = nil
- end
-
- def resolve_method(name)
- inst = @connection.spec[name]
- if inst.is_a?(Qpid::Spec010::Control)
- return invocation(:method, inst)
- else
- return invocation(:error, nil)
- end
- end
-
- def invoke(type, args)
- ctl = type.create(*args)
- sc = StringCodec.new(@connection.spec)
- sc.write_control(ctl)
- @connection.write_segment(Segment.new(true, true, type.segment_type,
- type.track, self.id, sc.encoded))
-
- log = Qpid::logger["qpid.io.ctl"]
- log.debug("SENT %s", ctl) if log
- end
-
- def to_s
- return "#{@connection}[#{@id}]"
- end
-
- end
-
- end
-
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/connection08.rb b/M4-RCs/qpid/ruby/lib/qpid/connection08.rb
deleted file mode 100644
index 09a4888cc4..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/connection08.rb
+++ /dev/null
@@ -1,252 +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.
-#
-
-require "socket"
-require "qpid/codec08"
-
-module Qpid08
-
- class Connection
-
- def initialize(host, port, spec)
- @host = host
- @port = port
- @spec = spec
- end
-
- attr_reader(:host, :port, :spec)
-
- def connect()
- @sock = TCPSocket.open(@host, @port)
- @out = Encoder.new(@sock)
- @in = Decoder.new(@sock)
- end
-
- def init()
- @out.write("AMQP")
- [1, 1, @spec.major, @spec.minor].each {|o|
- @out.octet(o)
- }
- end
-
- def write(frame)
- # puts "OUT #{frame.inspect()}"
- @out.octet(@spec.constants[frame.payload.type].id)
- @out.short(frame.channel)
- frame.payload.encode(@out)
- @out.octet(frame_end)
- end
-
- def read()
- type = @spec.constants[@in.octet()].name
- channel = @in.short()
- payload = Payload.decode(type, @spec, @in)
- oct = @in.octet()
- if oct != frame_end
- raise Exception.new("framing error: expected #{frame_end}, got #{oct}")
- end
- frame = Frame.new(channel, payload)
- # puts " IN #{frame.inspect}"
- return frame
- end
-
- private
-
- def frame_end
- @spec.constants[:"frame_end"].id
- end
-
- end
-
- class Frame
-
- def initialize(channel, payload)
- @channel = channel
- @payload = payload
- end
-
- attr_reader(:channel, :payload)
-
- end
-
- class Payload
-
- TYPES = {}
-
- def Payload.singleton_method_added(name)
- if name == :type
- TYPES[type] = self
- end
- end
-
- def Payload.decode(type, spec, dec)
- klass = TYPES[type]
- klass.decode(spec, dec)
- end
-
- end
-
- class Method < Payload
-
- def initialize(method, args)
- if args.size != method.fields.size
- raise ArgumentError.new("argument mismatch #{method} #{args}")
- end
- @method = method
- @args = args
- end
-
- attr_reader(:method, :args)
-
- def Method.type; :frame_method end
-
- def type; Method.type end
-
- def encode(encoder)
- buf = StringWriter.new()
- enc = Encoder.new(buf)
- enc.short(@method.parent.id)
- enc.short(@method.id)
- @method.fields.zip(self.args).each {|f, a|
- if a.nil?; a = f.default end
- enc.encode(f.type, a)
- }
- enc.flush()
- encoder.longstr(buf.to_s)
- end
-
- def Method.decode(spec, decoder)
- buf = decoder.longstr()
- dec = Decoder.new(StringReader.new(buf))
- klass = spec.classes[dec.short()]
- meth = klass.methods[dec.short()]
- args = meth.fields.map {|f| dec.decode(f.type)}
- return Method.new(meth, args)
- end
-
- def inspect(); "#{method.qname}(#{args.join(", ")})" end
-
- end
-
- class Header < Payload
-
- def Header.type; :frame_header end
-
- def initialize(klass, weight, size, properties)
- @klass = klass
- @weight = weight
- @size = size
- @properties = properties
- end
-
- attr_reader :weight, :size, :properties
-
- def type; Header.type end
-
- def encode(encoder)
- buf = StringWriter.new()
- enc = Encoder.new(buf)
- enc.short(@klass.id)
- enc.short(@weight)
- enc.longlong(@size)
-
- # property flags
- nprops = @klass.fields.size
- flags = 0
- 0.upto(nprops - 1) do |i|
- f = @klass.fields[i]
- flags <<= 1
- flags |= 1 unless @properties[f.name].nil?
- # the last bit indicates more flags
- if i > 0 and (i % 15) == 0
- flags <<= 1
- if nprops > (i + 1)
- flags |= 1
- enc.short(flags)
- flags = 0
- end
- end
- end
- flags <<= ((16 - (nprops % 15)) % 16)
- enc.short(flags)
-
- # properties
- @klass.fields.each do |f|
- v = @properties[f.name]
- enc.encode(f.type, v) unless v.nil?
- end
- enc.flush()
- encoder.longstr(buf.to_s)
- end
-
- def Header.decode(spec, decoder)
- dec = Decoder.new(StringReader.new(decoder.longstr()))
- klass = spec.classes[dec.short()]
- weight = dec.short()
- size = dec.longlong()
-
- # property flags
- bits = []
- while true
- flags = dec.short()
- 15.downto(1) do |i|
- if flags >> i & 0x1 != 0
- bits << true
- else
- bits << false
- end
- end
- break if flags & 0x1 == 0
- end
-
- # properties
- properties = {}
- bits.zip(klass.fields).each do |b, f|
- properties[f.name] = dec.decode(f.type) if b
- end
- return Header.new(klass, weight, size, properties)
- end
-
- def inspect(); "#{@klass.name}(#{@properties.inspect()})" end
-
- end
-
- class Body < Payload
-
- def Body.type; :frame_body end
-
- def type; Body.type end
-
- def initialize(content)
- @content = content
- end
-
- attr_reader :content
-
- def encode(enc)
- enc.longstr(@content)
- end
-
- def Body.decode(spec, dec)
- return Body.new(dec.longstr())
- end
-
- end
-
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/datatypes.rb b/M4-RCs/qpid/ruby/lib/qpid/datatypes.rb
deleted file mode 100644
index 96afe58dee..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/datatypes.rb
+++ /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.
-#
-
-module Qpid
-
- def self.struct(type, *args)
- # FIXME: This is fragile; the last arg could be a hash,
- # without being hte keywords
- kwargs = {}
- kwargs = args.pop if args.any? && args[-1].is_a?(Hash)
-
- if args.size > type.fields.size
- raise TypeError,
- "%s() takes at most %d arguments (%d given)" %
- [type.name, type.fields.size, args.size]
- end
-
- attrs = type.fields.inject({}) do |attrs, field|
- if args.any?
- attrs[field.name] = args.shift
- if kwargs.key?(field.name)
- raise TypeError,
- "%s() got multiple values for keyword argument '%s'" %
- [type.name, field.name]
- end
- elsif kwargs.key?(field.name)
- attrs[field.name] = kwargs.delete(field.name)
- else
- attrs[field.name] = field.default
- end
- attrs
- end
-
- unless kwargs.empty?
- unexpected = kwargs.keys[0]
- raise TypeError,
- "%s() got an unexpected keyword argument '%s'" %
- [type.name, unexpected]
- end
-
- attrs[:type] = type
- attrs[:id] = nil
-
- name = "Qpid_" + type.name.to_s.capitalize
- unless ::Struct.const_defined?(name)
- vars = type.fields.collect { |f| f.name } << :type << :id
- ::Struct.new(name, *vars)
- end
- st = ::Struct.const_get(name)
-
- result = st.new
- attrs.each { |k, v| result[k] = v }
- return result
- end
-
- class Message
-
- attr_accessor :headers, :body, :id
-
- def initialize(*args)
- @body = nil
- @headers = nil
-
- @body = args.pop unless args.empty?
- @headers = args unless args.empty?
-
- @id = nil
- end
-
- def has(name)
- return ! get(name).nil?
- end
-
- def get(name)
- if @headers
- name = name.to_sym
- @headers.find { |h| h.type.name == name }
- end
- end
-
- def set(header)
- @headers ||= []
- if h = @headers.find { |h| h.type == header.type }
- ind = @headers.index(h)
- @headers[ind] = header
- else
- @headers << header
- end
- end
-
- def clear(name)
- if @headers
- name = name.to_sym
- @headers.delete_if { |h| h.type.name == name }
- end
- end
-
- # FIXME: Not sure what to do here
- # Ruby doesn't have a notion of a evaluable string representation
- # def __repr__(self):
- # args = []
- # if self.headers:
- # args.extend(map(repr, self.headers))
- # if self.body:
- # args.append(repr(self.body))
- # if self.id is not None:
- # args.append("id=%s" % self.id)
- # return "Message(%s)" % ", ".join(args)
- # end
- end
-
- class ::Object
-
- def to_serial
- Qpid::Serial.new(self)
- end
- end
-
- class Serial
-
- include Comparable
-
- attr_accessor :value
-
- def initialize(value)
- @value = value & 0xFFFFFFFF
- end
-
- def hash
- @value.hash
- end
-
- def to_serial
- self
- end
-
- def eql?(other)
- other = other.to_serial
- value.eql?(other.value)
- end
-
- def <=>(other)
- return 1 if other.nil?
-
- other = other.to_serial
-
- delta = (value - other.value) & 0xFFFFFFFF
- neg = delta & 0x80000000
- mag = delta & 0x7FFFFFFF
-
- return (neg>0) ? -mag : mag
- end
-
- def +(other)
- result = other.to_serial
- result.value += value
- return result
- end
-
- def -(other)
- result = other.to_serial
- result.value = value - result.value
- return result
- end
-
- def succ
- Serial.new(value + 1)
- end
-
- # FIXME: Not sure what to do here
- # Ruby doesn't have a notion of a evaluable string representation
- # def __repr__(self):
- # return "serial(%s)" % self.value
- # end
-
- def to_s
- value.to_s
- end
-
- end
-
- # The Python class datatypes.Range is emulated by the standard
- # Range class with a few additions
- class ::Range
-
- alias :lower :begin
- alias :upper :end
-
- def touches(r)
- # XXX: are we doing more checks than we need?
- return (r.include?(lower - 1) ||
- r.include?(upper + 1) ||
- include?(r.lower - 1) ||
- include?(r.upper + 1) ||
- r.include?(lower) ||
- r.include?(upper) ||
- include?(r.lower) ||
- include?(r.upper))
- end
-
- def span(r)
- Range.new([lower, r.lower].min, [upper, r.upper].max)
- end
-
- def intersect(r)
- l = [lower, r.lower].max
- u = [upper, r.upper].min
- return l > u ? nil : Range.new(l, u)
- end
-
- end
-
- class RangedSet
-
- include Enumerable
-
- attr_accessor :ranges
-
- def initialize(*args)
- @ranges = []
- args.each { |n| add(n) }
- end
-
- def each(&block)
- ranges.each { |r| yield(r) }
- end
-
- def include?(n)
- if (n.is_a?(Range))
- super(n)
- else
- ranges.find { |r| r.include?(n) }
- end
- end
-
- def add_range(range)
- ranges.delete_if do |r|
- if range.touches(r)
- range = range.span(r)
- true
- else
- false
- end
- end
- ranges << range
- end
-
- def add(lower, upper = nil)
- upper = lower if upper.nil?
- add_range(Range.new(lower, upper))
- end
-
- def to_s
- repr = ranges.sort { |a,b| b.lower <=> a.lower }.
- map { |r| r.to_s }.join(",")
- "<RangedSet: {#{repr}}"
- end
- end
-
- class Future
- def initialize(initial=nil, exception=Exception)
- @value = initial
- @error = nil
- @set = Util::Event.new
- @exception = exception
- end
-
- def error(error)
- @error = error
- @set.set
- end
-
- def set(value)
- @value = value
- @set.set
- end
-
- def get(timeout=nil)
- @set.wait(timeout)
- unless @error.nil?
- raise @exception.new(@error)
- end
- @value
- end
- end
-
- class UUID
- include Comparable
-
- attr_accessor :bytes
-
- def initialize(bytes)
- @bytes = bytes
- end
-
- def <=>(other)
- if other.respond_to?(:bytes)
- return bytes <=> other.bytes
- else
- raise NotImplementedError
- end
- end
-
- def to_s
- UUID::format(bytes)
- end
-
- # FIXME: Not sure what to do here
- # Ruby doesn't have a notion of a evaluable string representation
- # def __repr__(self):
- # return "UUID(%r)" % str(self)
- # end
-
- def self.random_uuid
- bytes = (1..16).collect { |i| rand(256) }
-
- # From RFC4122, the version bits are set to 0100
- bytes[7] &= 0x0F
- bytes[7] |= 0x40
-
- # From RFC4122, the top two bits of byte 8 get set to 01
- bytes[8] &= 0x3F
- bytes[8] |= 0x80
- return bytes.pack("C16")
- end
-
- def self.uuid4
- UUID.new(random_uuid)
- end
-
- def self.format(s)
- # Python format !LHHHHL
- # big-endian, ulong, ushort x 4, ulong
- "%08x-%04x-%04x-%04x-%04x%08x" % s.unpack("NnnnnN")
- end
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/delegates.rb b/M4-RCs/qpid/ruby/lib/qpid/delegates.rb
deleted file mode 100644
index 21513fc677..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/delegates.rb
+++ /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.
-#
-
-require 'rbconfig'
-
-module Qpid
-
- class Delegate
-
- def initialize(connection, args={})
- @connection = connection
- @spec = connection.spec
- @delegate = args[:delegate] || Qpid::Delegate::Client.method(:new)
- @control = @spec[:track].enum[:control].value
- end
-
- def log ; Qpid::logger["qpid.io.ctl"]; end
-
- def received(seg)
- ssn = @connection.attached[seg.channel]
- unless ssn
- ch = Qpid::Connection::Channel.new(@connection, seg.channel)
- else
- ch = ssn.channel
- end
-
- if seg.track == @control
- ctl = seg.decode(@spec)
- log.debug("RECV %s", ctl) if log
- attr = ctl.type.name
- method(attr).call(ch, ctl)
- elsif ssn.nil?
- ch.session_detached
- else
- ssn.received(seg)
- end
- end
-
- def connection_close(ch, close)
- @connection.close_code = [close.reply_code, close.reply_text]
- ch.connection_close_ok
- @connection.sock.close_write()
- unless @connection.opened
- @connection.failed = true
- @connection.signal
- end
- end
-
- def connection_close_ok(ch, close_ok)
- @connection.opened = false
- @connection.signal
- end
-
- def session_attach(ch, a)
- begin
- @connection.attach(a.name, ch, @delegate, a.force)
- ch.session_attached(a.name)
- rescue Qpid::ChannelBusy
- ch.session_detached(a.name)
- rescue Qpid::SessionBusy
- ch.session_detached(a.name)
- end
- end
-
- def session_attached(ch, a)
- ch.session.signal
- end
-
- def session_detach(ch, d)
- #send back the confirmation of detachment before removing the
- #channel from the attached set; this avoids needing to hold the
- #connection lock during the sending of this control and ensures
- #that if the channel is immediately reused for a new session the
- #attach request will follow the detached notification.
- ch.session_detached(d.name)
- ssn = @connection.detach(d.name, ch)
- end
-
- def session_detached(ch, d)
- @connection.detach(d.name, ch)
- end
-
- def session_request_timeout(ch, rt)
- ch.session_timeout(rt.timeout)
- end
-
- def session_command_point(ch, cp)
- ssn = ch.session
- ssn.receiver.next_id = cp.command_id
- ssn.receiver.next_offset = cp.command_offset
- end
-
- def session_completed(ch, cmp)
- ch.session.sender.has_completed(cmp.commands)
- if cmp.timely_reply
- ch.session_known_completed(cmp.commands)
- end
- ch.session.signal
- end
-
- def session_known_completed(ch, kn_cmp)
- ch.session.receiver.known_completed(kn_cmp.commands)
- end
-
- def session_flush(ch, f)
- rcv = ch.session.receiver
- if f.expected
- if rcv.next_id
- exp = Qpid::RangedSet.new(rcv.next_id)
- else
- exp = nil
- end
- ch.session_expected(exp)
- end
- if f.confirmed
- ch.session_confirmed(rcv.completed)
- end
- if f.completed
- ch.session_completed(rcv.completed)
- end
- end
-
- class Server < Delegate
-
- def start
- @connection.read_header()
- @connection.write_header(@spec.major, @spec.minor)
- ch = Qpid::Connection::Channel.new(@connection, 0)
- ch.connection_start(:mechanisms => ["ANONYMOUS"])
- ch
- end
-
- def connection_start_ok(ch, start_ok)
- ch.connection_tune(:channel_max => 65535)
- end
-
- def connection_tune_ok(ch, tune_ok)
- nil
- end
-
- def connection_open(ch, open)
- @connection.opened = true
- ch.connection_open_ok()
- @connection.signal
- end
- end
-
- class Client < Delegate
-
- # FIXME: Python uses os.name for platform - we don't have an exact
- # analog in Ruby
- PROPERTIES = {"product" => "qpid python client",
- "version" => "development",
- "platform" => Config::CONFIG["build_os"]}
-
-
- def initialize(connection, args)
- super(connection)
-
- @username = args[:username] || "guest"
- @password = args[:password] || "guest"
- @mechanism= args[:mechanism] || "PLAIN"
- end
-
- def start
- @connection.write_header(@spec.major, @spec.minor)
- @connection.read_header
- end
-
- def connection_start(ch, start)
- r = "\0%s\0%s" % [@username, @password]
- ch.connection_start_ok(:client_properties => PROPERTIES,
- :mechanism => @mechanism,
- :response => r)
- end
-
- def connection_tune(ch, tune)
- ch.connection_tune_ok()
- ch.connection_open()
- end
-
- def connection_open_ok(ch, open_ok)
- @connection.opened = true
- @connection.signal
- end
- end
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/fields.rb b/M4-RCs/qpid/ruby/lib/qpid/fields.rb
deleted file mode 100644
index cc87d07529..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/fields.rb
+++ /dev/null
@@ -1,49 +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 Class
- def fields(*fields)
- module_eval {
- def initialize(*args, &block)
- args = init_fields(*args)
-
- if respond_to? :init
- init(*args) {|*a| yield(*a)}
- elsif args.any?
- raise ArgumentError, "extra arguments: #{args.inspect}"
- end
- end
- }
-
- vars = fields.map {|f| :"@#{f.to_s().chomp("?")}"}
-
- define_method(:init_fields) {|*args|
- vars.each {|v|
- instance_variable_set(v, args.shift())
- }
- args
- }
-
- vars.each_index {|i|
- define_method(fields[i]) {
- instance_variable_get(vars[i])
- }
- }
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/framer.rb b/M4-RCs/qpid/ruby/lib/qpid/framer.rb
deleted file mode 100644
index 2a565a69a8..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/framer.rb
+++ /dev/null
@@ -1,195 +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.
-#
-
-require 'monitor'
-require 'logger'
-
-module Qpid
-
- FIRST_SEG = 0x08
- LAST_SEG = 0x04
- FIRST_FRM = 0x02
- LAST_FRM = 0x01
-
- class << self
- attr_accessor :raw_logger, :frm_logger
- end
-
- def self.packed_size(format)
- # FIXME: This is a total copout to simulate Python's
- # struct.calcsize
- ([0]*256).pack(format).size
- end
-
- class Frame
- attr_reader :payload, :track, :flags, :type, :channel
-
- # HEADER = "!2BHxBH4x"
- # Python Meaning Ruby
- # ! big endian (implied by format char)
- # 2B 2 uchar C2
- # H unsigned short n
- # x pad byte x
- # B uchar C
- # H unsigned short n
- # 4x pad byte x4
- HEADER = "C2nxCnx4"
- HEADER_SIZE = Qpid::packed_size(HEADER)
- MAX_PAYLOAD = 65535 - HEADER_SIZE
-
- def initialize(flags, type, track, channel, payload)
- if payload.size > MAX_PAYLOAD
- raise ArgumentError, "max payload size exceeded: #{payload.size}"
- end
-
- @flags = flags
- @type = type
- @track = track
- @channel = channel
- @payload = payload
- end
-
- def first_segment? ; FIRST_SEG & @flags > 0 ; end
-
- def last_segment? ; LAST_SEG & @flags > 0 ; end
-
- def first_frame? ; FIRST_FRM & @flags > 0 ; end
-
- def last_frame? ; LAST_FRM & @flags > 0 ; end
-
- def to_s
- fs = first_segment? ? 'S' : '.'
- ls = last_segment? ? 's' : '.'
- ff = first_frame? ? 'F' : '.'
- lf = last_frame? ? 'f' : '.'
-
- return "%s%s%s%s %s %s %s %s" % [fs, ls, ff, lf,
- @type,
- @track,
- @channel,
- @payload.inspect]
- end
- end
-
- class FramingError < Exception ; end
-
- class Closed < Exception ; end
-
- class Framer
- include Packer
-
- # Python: "!4s4B"
- HEADER = "a4C4"
- HEADER_SIZE = 8
-
- def raw
- Qpid::raw_logger
- end
-
- def frm
- Qpid::frm_logger
- end
-
- def initialize(sock)
- @sock = sock
- @sock.extend(MonitorMixin)
- @buf = ""
- end
-
- attr_reader :sock
-
- def aborted? ; false ; end
-
- def write(buf)
- @buf += buf
- end
-
- def flush
- @sock.synchronize do
- _write(@buf)
- @buf = ""
- frm.debug("FLUSHED") if frm
- end
- end
-
- def _write(buf)
- while buf && buf.size > 0
- # FIXME: Catch errors
- n = @sock.write(buf)
- raw.debug("SENT #{buf[0, n].inspect}") if raw
- buf[0,n] = ""
- @sock.flush
- end
- end
-
- def read(n)
- data = ""
- while data.size < n
- begin
- s = @sock.read(n - data.size)
- rescue IOError => e
- raise e if data != ""
- @sock.close unless @sock.closed?
- raise Closed
- end
- # FIXME: Catch errors
- if s.nil? or s.size == 0
- @sock.close unless @sock.closed?
- raise Closed
- end
- data += s
- raw.debug("RECV #{n}/#{data.size} #{s.inspect}") if raw
- end
- return data
- end
-
- def read_header
- unpack(Framer::HEADER, Framer::HEADER_SIZE)
- end
-
- def write_header(major, minor)
- @sock.synchronize do
- pack(Framer::HEADER, "AMQP", 1, 1, major, minor)
- flush()
- end
- end
-
- def write_frame(frame)
- @sock.synchronize do
- size = frame.payload.size + Frame::HEADER_SIZE
- track = frame.track & 0x0F
- pack(Frame::HEADER, frame.flags, frame.type, size, track, frame.channel)
- write(frame.payload)
- if frame.last_segment? and frame.last_frame?
- flush()
- frm.debug("SENT #{frame}") if frm
- end
- end
- end
-
- def read_frame
- flags, type, size, track, channel = unpack(Frame::HEADER, Frame::HEADER_SIZE)
- raise FramingError if (flags & 0xF0 > 0)
- payload = read(size - Frame::HEADER_SIZE)
- frame = Frame.new(flags, type, track, channel, payload)
- frm.debug("RECV #{frame}") if frm
- return frame
- end
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/invoker.rb b/M4-RCs/qpid/ruby/lib/qpid/invoker.rb
deleted file mode 100644
index 39716ac6c2..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/invoker.rb
+++ /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.
-#
-
-class Qpid::Invoker
-
- # Requires that client defines a invoke method and overrides
- # resolve_method
-
- # FIXME: Is it really worth defining methods in method_missing ? We
- # could just dispatch there directly
-
- def invc_method(name, resolved)
- define_singleton_method(name) { |*args| invoke(resolved, args) }
- # FIXME: the Python code also attaches docs from resolved.pydoc
- end
-
- def invc_value(name, resolved)
- define_singleton_method(name) { | | resolved }
- end
-
- def invc_error(name, resolved)
- msg = "%s instance has no attribute '%s'" % [self.class.name, name]
- if resolved
- msg += "\n%s" % resolved
- end
- raise NameError, msg
- end
-
- def resolve_method(name)
- invocation(:error, nil)
- end
-
- def method_missing(name, *args)
- disp, resolved = resolve_method(name)
- disp.call(name, resolved)
- send(name, *args)
- end
-
- def invocation(kind, name = nil)
- [ method("invc_#{kind}"), name ]
- end
-
- private
- def define_singleton_method(name, &body)
- singleton_class = class << self; self; end
- singleton_class.send(:define_method, name, &body)
- end
-
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/packer.rb b/M4-RCs/qpid/ruby/lib/qpid/packer.rb
deleted file mode 100644
index ae1be37faf..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/packer.rb
+++ /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.
-#
-
-module Qpid
- module Packer
- def unpack(fmt, len)
- raw = read(len)
- values = raw.unpack(fmt)
- values = values[0] if values.size == 1
- return values
- end
-
- def pack(fmt, *args)
- write(args.pack(fmt))
- end
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/peer.rb b/M4-RCs/qpid/ruby/lib/qpid/peer.rb
deleted file mode 100644
index cdb962169b..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/peer.rb
+++ /dev/null
@@ -1,289 +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.
-#
-
-require "thread"
-require "qpid/queue"
-require "qpid/connection08"
-require "qpid/fields"
-
-module Qpid08
-
- Queue = Qpid::Queue
-
- class Peer
-
- def initialize(conn, delegate)
- @conn = conn
- @delegate = delegate
- @outgoing = Queue.new()
- @work = Queue.new()
- @channels = {}
- @mutex = Mutex.new()
- end
-
- def channel(id)
- @mutex.synchronize do
- ch = @channels[id]
- if ch.nil?
- ch = Channel.new(id, self, @outgoing, @conn.spec)
- @channels[id] = ch
- end
- return ch
- end
- end
-
- def channel_delete(id)
- @channels.delete(id)
- end
-
- def start()
- spawn(:writer)
- spawn(:reader)
- spawn(:worker)
- end
-
- def close()
- @mutex.synchronize do
- @channels.each_value do |ch|
- ch.close()
- end
- @outgoing.close()
- @work.close()
- end
- end
-
- private
-
- def spawn(method, *args)
- Thread.new do
- begin
- send(method, *args)
- # is this the standard way to catch any exception?
- rescue Closed => e
- puts "#{method} #{e}"
- rescue Object => e
- print e
- e.backtrace.each do |line|
- print "\n ", line
- end
- print "\n"
- end
- end
- end
-
- def reader()
- while true
- frame = @conn.read()
- ch = channel(frame.channel)
- ch.dispatch(frame, @work)
- end
- end
-
- def writer()
- while true
- @conn.write(@outgoing.get())
- end
- end
-
- def worker()
- while true
- dispatch(@work.get())
- end
- end
-
- def dispatch(queue)
- frame = queue.get()
- ch = channel(frame.channel)
- payload = frame.payload
- if payload.method.content?
- content = Qpid08::read_content(queue)
- else
- content = nil
- end
-
- message = Message.new(payload.method, payload.args, content)
- @delegate.dispatch(ch, message)
- end
-
- end
-
- class Channel
- def initialize(id, peer, outgoing, spec)
- @id = id
- @peer = peer
- @outgoing = outgoing
- @spec = spec
- @incoming = Queue.new()
- @responses = Queue.new()
- @queue = nil
- @closed = false
- end
-
- attr_reader :id
-
- def closed?; @closed end
-
- def close()
- return if closed?
- @peer.channel_delete(@id)
- @closed = true
- @incoming.close()
- @responses.close()
- end
-
- def dispatch(frame, work)
- payload = frame.payload
- case payload
- when Method
- if payload.method.response?
- @queue = @responses
- else
- @queue = @incoming
- work << @incoming
- end
- end
- @queue << frame
- end
-
- def method_missing(name, *args)
- method = @spec.find_method(name)
- if method.nil?
- raise NoMethodError.new("undefined method '#{name}' for #{self}:#{self.class}")
- end
-
- if args.size == 1 and args[0].instance_of? Hash
- kwargs = args[0]
- invoke_args = method.fields.map do |f|
- kwargs[f.name]
- end
- content = kwargs[:content]
- else
- invoke_args = []
- method.fields.each do |f|
- if args.any?
- invoke_args << args.shift()
- else
- invoke_args << f.default
- end
- end
- if method.content? and args.any?
- content = args.shift()
- else
- content = nil
- end
- if args.any? then raise ArgumentError.new("#{args.size} extr arguments") end
- end
- return invoke(method, invoke_args, content)
- end
-
- def invoke(method, args, content = nil)
- raise Closed() if closed?
- frame = Frame.new(@id, Method.new(method, args))
- @outgoing << frame
-
- if method.content?
- content = Content.new() if content.nil?
- write_content(method.parent, content, @outgoing)
- end
-
- nowait = false
- f = method.fields[:"nowait"]
- nowait = args[method.fields.index(f)] unless f.nil?
-
- unless nowait or method.responses.empty?
- resp = @responses.get().payload
- if resp.method.content?
- content = read_content(@responses)
- else
- content = nil
- end
- if method.responses.include? resp.method
- return Message.new(resp.method, resp.args, content)
- else
- # XXX: ValueError doesn't actually exist
- raise ValueError.new(resp)
- end
- end
- end
-
- def write_content(klass, content, queue)
- size = content.size
- header = Frame.new(@id, Header.new(klass, content.weight, size, content.headers))
- queue << header
- content.children.each {|child| write_content(klass, child, queue)}
- queue << Frame.new(@id, Body.new(content.body)) if size > 0
- end
-
- end
-
- def Qpid08.read_content(queue)
- frame = queue.get()
- header = frame.payload
- children = []
- 1.upto(header.weight) { children << read_content(queue) }
- size = header.size
- read = 0
- buf = ""
- while read < size
- body = queue.get()
- content = body.payload.content
- buf << content
- read += content.size
- end
- buf.freeze()
- return Content.new(header.properties.clone(), buf, children)
- end
-
- class Content
- def initialize(headers = {}, body = "", children = [])
- @headers = headers
- @body = body
- @children = children
- end
-
- attr_reader :headers, :body, :children
-
- def size; body.size end
- def weight; children.size end
-
- def [](key); @headers[key] end
- def []=(key, value); @headers[key] = value end
- end
-
- class Message
- fields(:method, :args, :content)
-
- alias fields args
-
- def method_missing(name)
- return args[@method.fields[name].id]
- end
-
- def inspect()
- "#{method.qname}(#{args.join(", ")})"
- end
- end
-
- module Delegate
- def dispatch(ch, msg)
- send(msg.method.qname, ch, msg)
- end
- end
-
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/qmf.rb b/M4-RCs/qpid/ruby/lib/qpid/qmf.rb
deleted file mode 100644
index d2e2651653..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/qmf.rb
+++ /dev/null
@@ -1,1603 +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 API for Qpid Management Framework
-
-require 'socket'
-require 'monitor'
-require 'thread'
-require 'uri'
-require 'time'
-
-module Qpid::Qmf
-
- # To access the asynchronous operations, a class must be derived from
- # Console with overrides of any combination of the available methods.
- class Console
-
- # Invoked when a connection is established to a broker
- def broker_connected(broker); end
-
- # Invoked when the connection to a broker is lost
- def broker_disconnected(broker); end
-
- # Invoked when a QMF package is discovered
- def new_package(name); end
-
- # Invoked when a new class is discovered. Session.getSchema can be
- # used to obtain details about the class
- def new_class(kind, klass_key); end
-
- # Invoked when a QMF agent is discovered
- def new_agent(agent); end
-
- # Invoked when a QMF agent disconects
- def del_agent(agent); end
-
- # Invoked when an object is updated
- def object_props(broker, record); end
-
- # Invoked when an object is updated
- def object_stats(broker, record); end
-
- # Invoked when an event is raised
- def event(broker, event); end
-
- def heartbeat(agent, timestamp); end
-
- def broker_info(broker); end
- end
-
- class BrokerURL
-
- attr_reader :host, :port, :auth_name, :auth_pass, :auth_mech
-
- def initialize(text)
- uri = URI.parse(text)
-
- @host = uri.host
- @port = uri.port ? uri.port : 5672
- @auth_name = uri.user ? uri.user : "guest"
- @auth_pass = uri.password ? uri.password: "guest"
- @auth_mech = "PLAIN"
-
- return uri
- end
-
- def name
- "#{@host}:#{@port}"
- end
-
- def match(host, port)
- # FIXME: Unlcear what the Python code is actually checking for
- # here, especially since HOST can resolve to multiple IP's
- @port == port &&
- (host == @host || ipaddr(host, port) == ipaddr(@host, @port))
- end
-
- private
- def ipaddr(host, port)
- s = Socket::getaddrinfo(host, port,
- Socket::AF_INET, Socket::SOCK_STREAM)
- s[0][2]
- end
- end
-
- # An instance of the Session class represents a console session running
- # against one or more QMF brokers. A single instance of Session is
- # needed to interact with the management framework as a console.
- class Session
- CONTEXT_SYNC = 1
- CONTEXT_STARTUP = 2
- CONTEXT_MULTIGET = 3
-
- GET_WAIT_TIME = 60
-
- include MonitorMixin
-
- attr_reader :binding_key_list, :select, :seq_mgr, :console, :packages
-
- # Initialize a session. If the console argument is provided, the
- # more advanced asynchronous features are available. If console is
- # defaulted, the session will operate in a simpler, synchronous
- # manner. The rcvObjects, rcvEvents, and rcvHeartbeats arguments
- # are meaningful only if 'console' is provided. They control
- # whether object updates, events, and agent-heartbeats are
- # subscribed to. If the console is not interested in receiving one
- # or more of the above, setting the argument to False will reduce
- # tha bandwidth used by the API. If manageConnections is set to
- # True, the Session object will manage connections to the brokers.
- # This means that if a broker is unreachable, it will retry until a
- # connection can be established. If a connection is lost, the
- # Session will attempt to reconnect.
- #
- # If manageConnections is set to False, the user is responsible for
- # handing failures. In this case, an unreachable broker will cause
- # addBroker to raise an exception. If userBindings is set to False
- # (the default) and rcvObjects is True, the console will receive
- # data for all object classes. If userBindings is set to True, the
- # user must select which classes the console shall receive by
- # invoking the bindPackage or bindClass methods. This allows the
- # console to be configured to receive only information that is
- # relavant to a particular application. If rcvObjects id False,
- # userBindings has no meaning.
- #
- # Accept a hash of parameters, where keys can be :console,
- # :rcv_objects, :rcv_events, :rcv_heartbeats, :manage_connections,
- # and :user_bindings
- def initialize(kwargs = {})
- super()
- @console = kwargs[:console] || nil
- @brokers = []
- @packages = {}
- @seq_mgr = SequenceManager.new
- @cv = new_cond
- @sync_sequence_list = []
- @result = []
- @select = []
- @error = nil
- @rcv_objects = kwargs[:rcv_objects] == nil ? true : kwargs[:rcv_objects]
- @rcv_events = kwargs[:rcv_events] == nil ? true : kwargs[:rcv_events]
- @rcv_heartbeats = kwargs[:rcv_heartbeats] == nil ? true : kwargs[:rcv_heartbeats]
- @user_bindings = kwargs[:user_bindings] == nil ? false : kwargs[:user_bindings]
- unless @console
- @rcv_objects = false
- @rcv_events = false
- @rcv_heartbeats = false
- end
- @binding_key_list = binding_keys
- @manage_connections = kwargs[:manage_connections] || false
-
- if @user_bindings && ! @rcv_objects
- raise ArgumentError, "user_bindings can't be set unless rcv_objects is set and a console is provided"
- end
-
- end
-
- def to_s
- "QMF Console Session Manager (brokers: #{@brokers.size})"
- end
-
- def managedConnections?
- return @manage_connections
- end
-
- # Connect to a Qpid broker. Returns an object of type Broker
- def add_broker(target="amqp://localhost")
- url = BrokerURL.new(target)
- broker = Broker.new(self, url.host, url.port, url.auth_mech, url.auth_name, url.auth_pass)
- unless broker.connected? || @manage_connections
- raise broker.error
- end
-
- @brokers << broker
- objects(:broker => broker, :class => "agent") unless @manage_connections
- return broker
- end
-
- # Disconnect from a broker. The 'broker' argument is the object
- # returned from the addBroker call
- def del_broker(broker)
- broker.shutdown
- @brokers.delete(broker)
- end
-
- # Get the list of known classes within a QMF package
- def classes(package_name)
- @brokers.each { |broker| broker.wait_for_stable }
- if @packages.include?(package_name)
- # FIXME What's the actual structure of @packages[package_name]
- @packages[package_name].inject([]) do |list, cname, hash|
- list << [ package_name, cname, hash]
- end
- end
- end
-
- # Get the schema for a QMF class
- def schema(klass_key)
- @brokers.each { |broker| broker.wait_for_stable }
- pname, cname, hash = klass_key
- if @packages.include?(pname)
- @packages[pname][ [cname, hash] ]
- end
- end
-
- def bind_package(package_name)
- unless @user_bindings && @rcv_objects
- raise "userBindings option not set for Session"
- end
- @brokers.each do |broker|
- args = { :exchange => "qpid.management",
- :queue => broker.topic_name,
- :binding_key => "console.obj.*.*.#{package_name}.#" }
- broker.amqpSession.exchange_bind(args)
- end
- end
-
- def bind_class(package_name, class_name)
- unless @user_bindings && @rcv_objects
- raise "userBindings option not set for Session"
- end
- @brokers.each do |broker|
- args = { :exchange => "qpid.management",
- :queue => broker.topic_name,
- :binding_key=> "console.obj.*.*.#{package_name}.#{class_name}.#" }
- broker.amqpSession.exchange_bind(args)
- end
- end
-
- def bind_class_key(klass_key)
- unless @user_bindings && @rcv_objects
- raise "userBindings option not set for Session"
- end
- pname, cname, hash = klass_key
- @brokers.each do |broker|
- args = { :exchange => "qpid.management",
- :queue => broker.topic_name,
- :binding_key => "console.obj.*.*.#{pname}.#{cname}.#" }
- broker.amqpSession.exchange_bind(args)
- end
- end
-
- # Get a list of currently known agents
- def agents(broker=nil)
- broker_list = []
- if broker.nil?
- broker_list = @brokers.dup
- else
- broker_list << broker
- end
- broker_list.each { |b| b.wait_for_stable }
- agent_list = []
- broker_list.each { |b| agent_list += b.agents }
- return agent_list
- end
-
- # Get a list of objects from QMF agents.
- # All arguments are passed by name(keyword).
- #
- # The class for queried objects may be specified in one of the
- # following ways:
- # :schema => <schema> - supply a schema object returned from getSchema.
- # :key => <key> - supply a klass_key from the list returned by getClasses.
- # :class => <name> - supply a class name as a string. If the class name exists
- # in multiple packages, a _package argument may also be supplied.
- # :object_id = <id> - get the object referenced by the object-id
- #
- # If objects should be obtained from only one agent, use the following argument.
- # Otherwise, the query will go to all agents.
- #
- # :agent = <agent> - supply an agent from the list returned by getAgents.
- # If the get query is to be restricted to one broker (as opposed to
- # all connected brokers), add the following argument:
- #
- # :broker = <broker> - supply a broker as returned by addBroker.
- #
- # If additional arguments are supplied, they are used as property
- # selectors, as long as their keys are strings. For example, if
- # the argument "name" => "test" is supplied, only objects whose
- # "name" property is "test" will be returned in the result.
- def objects(kwargs)
- if kwargs.include?(:broker)
- broker_list = []
- broker_list << kwargs[:broker]
- else
- broker_list = @brokers
- end
- broker_list.each { |broker| broker.wait_for_stable }
-
- agent_list = []
- if kwargs.include?(:agent)
- agent = kwargs[:agent]
- unless broker_list.include?(agent.broker)
- raise ArgumentError, "Supplied agent is not accessible through the supplied broker"
- end
- agent_list << agent
- else
- if kwargs.include?(:object_id)
- oid = kwargs[:object_id]
- broker_list.each { |broker|
- broker.agents.each { |agent|
- if oid.broker_bank == agent.broker_bank && oid.agent_bank == agent.agent_bank
- agent_list << agent
- end
- }
- }
- else
- broker_list.each { |broker| agent_list += broker.agents }
- end
- end
-
- cname = nil
- if kwargs.include?(:schema)
- # FIXME: What kind of object is kwargs[:schema]
- pname, cname, hash = kwargs[:schema].getKey()
- elsif kwargs.include?(:key)
- pname, cname, hash = kwargs[:key]
- elsif kwargs.include?(:class)
- pname, cname, hash = [kwargs[:package], kwargs[:class], nil]
- end
- if cname.nil? && ! kwargs.include?(:object_id)
- raise ArgumentError,
- "No class supplied, use :schema, :key, :class, or :object_id' argument"
- end
-
- map = {}
- @select = []
- if kwargs.include?(:object_id)
- map["_objectid"] = kwargs[:object_id].to_s
- else
- map["_class"] = cname
- map["_package"] = pname if pname
- map["_hash"] = hash if hash
- kwargs.each do |k,v|
- @select << [k, v] if k.is_a?(String)
- end
- end
-
- @result = []
- agent_list.each do |agent|
- broker = agent.broker
- send_codec = Qpid::StringCodec.new(broker.conn.spec)
- seq = nil
- synchronize do
- seq = @seq_mgr.reserve(CONTEXT_MULTIGET)
- @sync_sequence_list << seq
- end
- broker.set_header(send_codec, ?G, seq)
- send_codec.write_map(map)
- bank_key = "%d.%d" % [broker.broker_bank, agent.agent_bank]
- smsg = broker.message(send_codec.encoded, "agent.#{bank_key}")
- broker.emit(smsg)
- end
-
- timeout = false
- synchronize do
- unless @cv.wait_for(GET_WAIT_TIME) {
- @sync_sequence_list.empty? || @error }
- @sync_sequence_list.each do |pending_seq|
- @seq_mgr.release(pending_seq)
- end
- @sync_sequence_list = []
- timeout = true
- end
- end
-
- if @error
- errorText = @error
- @error = nil
- raise errorText
- end
-
- if @result.empty? && timeout
- raise "No agent responded within timeout period"
- end
- @result
- end
-
- def set_event_filter(kwargs); end
-
- def handle_broker_connect(broker); end
-
- def handle_broker_resp(broker, codec, seq)
- broker.broker_id = codec.read_uuid
- @console.broker_info(broker) if @console
-
- # Send a package request
- # (effectively inc and dec outstanding by not doing anything)
- send_codec = Qpid::StringCodec.new(broker.conn.spec)
- seq = @seq_mgr.reserve(CONTEXT_STARTUP)
- broker.set_header(send_codec, ?P, seq)
- smsg = broker.message(send_codec.encoded)
- broker.emit(smsg)
- end
-
- def handle_package_ind(broker, codec, seq)
- pname = codec.read_str8
- new_package = false
- synchronize do
- new_package = ! @packages.include?(pname)
- @packages[pname] = {} if new_package
- end
- @console.new_package(pname) if @console
-
- # Send a class request
- broker.inc_outstanding
- send_codec = Qpid::StringCodec.new(broker.conn.spec)
- seq = @seq_mgr.reserve(CONTEXT_STARTUP)
- broker.set_header(send_codec, ?Q, seq)
- send_codec.write_str8(pname)
- smsg = broker.message(send_codec.encoded)
- broker.emit(smsg)
- end
-
- def handle_command_complete(broker, codec, seq)
- code = codec.read_uint32
- text = codec.read_str8
- context = @seq_mgr.release(seq)
- if context == CONTEXT_STARTUP
- broker.dec_outstanding
- elsif context == CONTEXT_SYNC && seq == broker.sync_sequence
- broker.sync_done
- elsif context == CONTEXT_MULTIGET && @sync_sequence_list.include?(seq)
- synchronize do
- @sync_sequence_list.delete(seq)
- @cv.signal if @sync_sequence_list.empty?
- end
- end
- end
-
- def handle_class_ind(broker, codec, seq)
- kind = codec.read_uint8
- pname = codec.read_str8
- cname = codec.read_str8
- hash = codec.read_bin128
- unknown = false
-
- synchronize do
- return unless @packages.include?(pname)
- unknown = true unless @packages[pname].include?([cname, hash])
- end
-
- if unknown
- # Send a schema request for the unknown class
- broker.inc_outstanding
- send_codec = Qpid::StringCodec.new(broker.conn.spec)
- seq = @seq_mgr.reserve(CONTEXT_STARTUP)
- broker.set_header(send_codec, ?S, seq)
- send_codec.write_str8(pname)
- send_codec.write_str8(cname)
- send_codec.write_bin128(hash)
- smsg = broker.message(send_codec.encoded)
- broker.emit(smsg)
- end
- end
-
- def handle_method_resp(broker, codec, seq)
- code = codec.read_uint32
-
- text = codec.read_str16
- out_args = {}
- method, synchronous = @seq_mgr.release(seq)
- if code == 0
- method.arguments.each do |arg|
- if arg.dir.index(?O)
- out_args[arg.name] = decode_value(codec, arg.type)
- end
- end
- end
- result = MethodResult.new(code, text, out_args)
- if synchronous:
- broker.synchronize do
- broker.sync_result = MethodResult.new(code, text, out_args)
- broker.sync_done
- end
- else
- @console.method_response(broker, seq, result) if @console
- end
- end
-
- def handle_heartbeat_ind(broker, codec, seq, msg)
- if @console
- broker_bank = 1
- agent_bank = 0
- dp = msg.get("delivery_properties")
- if dp
- key = dp["routing_key"]
- key_elements = key.split(".")
- if key_elements.length == 4
- broker_bank = key_elements[2].to_i
- agent_bank = key_elements[3].to_i
- end
- end
- agent = broker.agent(broker_bank, agent_bank)
- timestamp = codec.read_uint64
- @console.heartbeat(agent, timestamp) if agent
- end
- end
-
- def handle_event_ind(broker, codec, seq)
- if @console
- event = Event.new(self, broker, codec)
- @console.event(broker, event)
- end
- end
-
- def handle_schema_resp(broker, codec, seq)
- kind = codec.read_uint8
- pname = codec.read_str8
- cname = codec.read_str8
- hash = codec.read_bin128
- klass_key = [pname, cname, hash]
- klass = SchemaClass.new(kind, klass_key, codec)
- synchronize { @packages[pname][ [cname, hash] ] = klass }
-
- @seq_mgr.release(seq)
- broker.dec_outstanding
- @console.new_class(kind, klass_key) if @console
- end
-
- def handle_content_ind(broker, codec, seq, prop=false, stat=false)
- pname = codec.read_str8
- cname = codec.read_str8
- hash = codec.read_bin128
- klass_key = [pname, cname, hash]
-
- schema = nil
- synchronize do
- return unless @packages.include?(pname)
- return unless @packages[pname].include?([cname, hash])
- schema = @packages[pname][ [cname, hash] ]
- end
-
- object = Qpid::Qmf::Object.new(self, broker, schema, codec, prop, stat)
- if pname == "org.apache.qpid.broker" && cname == "agent" && prop
- broker.update_agent(object)
- end
-
- synchronize do
- if @sync_sequence_list.include?(seq)
- if object.timestamps()[2] == 0 && select_match(object)
- @result << object
- end
- return
- end
- end
-
- @console.object_props(broker, object) if @console && @rcv_objects && prop
- @console.object_stats(broker, object) if @console && @rcv_objects && stat
- end
-
- def handle_broker_disconnect(broker); end
-
- def handle_error(error)
- @error = error
- synchronize do
- @sync_sequence_list = []
- @cv.signal
- end
- end
-
- # Decode, from the codec, a value based on its typecode
- def decode_value(codec, typecode)
- case typecode
- when 1: data = codec.read_uint8 # U8
- when 2: data = codec.read_uint16 # U16
- when 3: data = codec.read_uint32 # U32
- when 4: data = codec.read_uint64 # U64
- when 6: data = codec.read_str8 # SSTR
- when 7: data = codec.read_str16 # LSTR
- when 8: data = codec.read_int64 # ABSTIME
- when 9: data = codec.read_uint64 # DELTATIME
- when 10: data = ObjectId.new(codec) # REF
- when 11: data = codec.read_uint8 != 0 # BOOL
- when 12: data = codec.read_float # FLOAT
- when 13: data = codec.read_double # DOUBLE
- when 14: data = codec.read_uuid # UUID
- when 15: data = codec.read_map # FTABLE
- when 16: data = codec.read_int8 # S8
- when 17: data = codec.read_int16 # S16
- when 18: data = codec.read_int32 # S32
- when 19: data = codec.read_int64 # S64
- else
- raise ArgumentError, "Invalid type code: #{typecode} - #{typecode.inspect}"
- end
- return data
- end
-
- # Encode, into the codec, a value based on its typecode
- def encode_value(codec, value, typecode)
- # FIXME: Python does a lot of magic type conversions
- # We just assume that value has the right type; this is safer
- # than coercing explicitly, since Array::pack will complain
- # loudly about various type errors
- case typecode
- when 1: codec.write_uint8(value) # U8
- when 2: codec.write_uint16(value) # U16
- when 3: codec.write_uint32(value) # U32
- when 4: codec.write_uint64(value) # U64
- when 6: codec.write_str8(value) # SSTR
- when 7: codec.write_str16(value) # LSTR
- when 8: codec.write_int64(value) # ABSTIME
- when 9: codec.write_uint64(value) # DELTATIME
- when 10: value.encode(codec) # REF
- when 11: codec.write_uint8(value ? 1 : 0) # BOOL
- when 12: codec.write_float(value) # FLOAT
- when 13: codec.write_double(value) # DOUBLE
- when 14: codec.write_uuid(value) # UUID
- when 15: codec.write_map(value) # FTABLE
- when 16: codec.write_int8(value) # S8
- when 17: codec.write_int16(value) # S16
- when 18: codec.write_int32(value) # S32
- when 19: codec.write_int64(value) # S64
- else
- raise ValueError, "Invalid type code: %d" % typecode
- end
- end
-
- def display_value(value, typecode)
- case typecode
- when 1: return value.to_s
- when 2: return value.to_s
- when 3: return value.to_s
- when 4: return value.to_s
- when 6: return value.to_s
- when 7: return value.to_s
- when 8: return strftime("%c", gmtime(value / 1000000000))
- when 9: return value.to_s
- when 10: return value.to_s
- when 11: return value ? 'T' : 'F'
- when 12: return value.to_s
- when 13: return value.to_s
- when 14: return Qpid::UUID::format(value)
- when 15: return value.to_s
- when 16: return value.to_s
- when 17: return value.to_s
- when 18: return value.to_s
- when 19: return value.to_s
- else
- raise ValueError, "Invalid type code: %d" % typecode
- end
- end
-
- private
-
- def binding_keys
- key_list = []
- key_list << "schema.#"
- if @rcv_objects && @rcv_events && @rcv_heartbeats &&
- ! @user_bindings
- key_list << "console.#"
- else
- if @rcv_objects && ! @user_bindings
- key_list << "console.obj.#"
- else
- key_list << "console.obj.*.*.org.apache.qpid.broker.agent"
- end
- key_list << "console.event.#" if @rcv_events
- key_list << "console.heartbeat.#" if @rcv_heartbeats
- end
- return key_list
- end
-
- # Check the object against select to check for a match
- def select_match(object)
- select.each do |key, value|
- object.properties.each do |prop, propval|
- return false if key == prop.name && value != propval
- end
- end
- return true
- end
-
- end
-
- class Package
- attr_reader :name
-
- def initialize(name)
- @name = name
- end
- end
-
- # A ClassKey uniquely identifies a class from the schema.
- class ClassKey
- attr_reader :package, :klass_name, :hash
-
- def initialize(package, klass_name, hash)
- @package = package
- @klass_name = klass_name
- @hash = hash
- end
- end
-
- class SchemaClass
-
- CLASS_KIND_TABLE = 1
- CLASS_KIND_EVENT = 2
-
- attr_reader :klass_key, :properties, :statistics, :methods, :arguments
-
- def initialize(kind, key, codec)
- @kind = kind
- @klass_key = key
- @properties = []
- @statistics = []
- @methods = []
- @arguments = []
-
- if @kind == CLASS_KIND_TABLE
- prop_count = codec.read_uint16
- stat_count = codec.read_uint16
- method_count = codec.read_uint16
- prop_count.times { |idx|
- @properties << SchemaProperty.new(codec) }
- stat_count.times { |idx|
- @statistics << SchemaStatistic.new(codec) }
- method_count.times { |idx|
- @methods<< SchemaMethod.new(codec) }
- elsif @kind == CLASS_KIND_EVENT
- arg_count = codec.read_uint16
- arg_count.times { |idx|
- sa = SchemaArgument.new(codec, false)
- @arguments << sa
- }
- end
- end
-
- def to_s
- pname, cname, hash = @klass_key
- if @kind == CLASS_KIND_TABLE
- kind_str = "Table"
- elsif @kind == CLASS_KIND_EVENT
- kind_str = "Event"
- else
- kind_str = "Unsupported"
- end
- result = "%s Class: %s:%s " % [kind_str, pname, cname]
- result += Qpid::UUID::format(hash)
- return result
- end
- end
-
- class SchemaProperty
-
- attr_reader :name, :type, :access, :index, :optional,
- :unit, :min, :max, :maxlan, :desc
-
- def initialize(codec)
- map = codec.read_map
- @name = map["name"]
- @type = map["type"]
- @access = map["access"]
- @index = map["index"] != 0
- @optional = map["optional"] != 0
- @unit = map["unit"]
- @min = map["min"]
- @max = map["max"]
- @maxlan = map["maxlen"]
- @desc = map["desc"]
- end
-
- def to_s
- @name
- end
- end
-
- class SchemaStatistic
-
- attr_reader :name, :type, :unit, :desc
-
- def initialize(codec)
- map = codec.read_map
- @name = map["name"]
- @type = map["type"]
- @unit = map["unit"]
- @desc = map["desc"]
- end
-
- def to_s
- @name
- end
- end
-
- class SchemaMethod
-
- attr_reader :name, :desc, :arguments
-
- def initialize(codec)
- map = codec.read_map
- @name = map["name"]
- arg_count = map["argCount"]
- @desc = map["desc"]
- @arguments = []
- arg_count.times { |idx|
- @arguments << SchemaArgument.new(codec, true)
- }
- end
-
- def to_s
- result = @name + "("
- first = true
- result += @arguments.select { |arg| arg.dir.index(?I) }.join(", ")
- result += ")"
- return result
- end
- end
-
- class SchemaArgument
-
- attr_reader :name, :type, :dir, :unit, :min, :max, :maxlen
- attr_reader :desc, :default
-
- def initialize(codec, method_arg)
- map = codec.read_map
- @name = map["name"]
- @type = map["type"]
- @dir = map["dir"].upcase if method_arg
- @unit = map["unit"]
- @min = map["min"]
- @max = map["max"]
- @maxlen = map["maxlen"]
- @desc = map["desc"]
- @default = map["default"]
- end
- end
-
- # Object that represents QMF object identifiers
- class ObjectId
-
- include Comparable
-
- attr_reader :first, :second
-
- def initialize(codec, first=0, second=0)
- if codec
- @first = codec.read_uint64
- @second = codec.read_uint64
- else
- @first = first
- @second = second
- end
- end
-
- def <=>(other)
- return 1 unless other.is_a?(ObjectId)
- return -1 if first < other.first
- return 1 if first > other.first
- return second <=> other.second
- end
-
- def to_s
- "%d-%d-%d-%d-%d" % [flags, sequence, broker_bank, agent_bank, object]
- end
-
- def index
- [first, second]
- end
-
- def flags
- (first & 0xF000000000000000) >> 60
- end
-
- def sequence
- (first & 0x0FFF000000000000) >> 48
- end
-
- def broker_bank
- (first & 0x0000FFFFF0000000) >> 28
- end
-
- def agent_bank
- first & 0x000000000FFFFFFF
- end
-
- def object
- second
- end
-
- def durable?
- sequence == 0
- end
-
- def encode(codec)
- codec.write_uint64(first)
- codec.write_uint64(second)
- end
- end
-
- class Object
-
- attr_reader :object_id, :schema, :properties, :statistics,
- :current_time, :create_time, :delete_time, :broker
-
- def initialize(session, broker, schema, codec, prop, stat)
- @session = session
- @broker = broker
- @schema = schema
- @current_time = codec.read_uint64
- @create_time = codec.read_uint64
- @delete_time = codec.read_uint64
- @object_id = ObjectId.new(codec)
- @properties = []
- @statistics = []
- if prop
- missing = parse_presence_masks(codec, schema)
- schema.properties.each do |property|
- v = nil
- unless missing.include?(property.name)
- v = @session.decode_value(codec, property.type)
- end
- @properties << [property, v]
- end
- end
-
- if stat
- schema.statistics.each do |statistic|
- s = @session.decode_value(codec, statistic.type)
- @statistics << [statistic, s]
- end
- end
- end
-
- def klass_key
- @schema.klass_key
- end
-
-
- def methods
- @schema.methods
- end
-
- # Return the current, creation, and deletion times for this object
- def timestamps
- return [@current_time, @create_time, @delete_time]
- end
-
- # Return a string describing this object's primary key
- def index
- @properties.select { |property, value|
- property.index
- }.collect { |property,value|
- @session.display_value(value, property.type) }.join(":")
- end
-
- # Replace properties and/or statistics with a newly received update
- def merge_update(newer)
- unless object_id == newer.object_id
- raise "Objects with different object-ids"
- end
- @properties = newer.getProperties unless newer.properties.empty?
- @statistics = newer.getStatistics unless newer.statistics.empty?
- end
-
- def to_s
- key = klass_key
- key[0] + ":" + key[1] + "[" + @object_id.to_s() + "] " + index
- end
-
- # This must be defined because ruby has this (deprecated) method built in.
- def id
- method_missing(:id)
- end
-
- # Same here..
- def type
- method_missing(:type)
- end
-
- def name
- method_missing(:name)
- end
-
- def method_missing(name, *args)
- name = name.to_s
-
- if method = @schema.methods.find { |method| name == method.name }
- return invoke(method, name, args)
- end
-
- @properties.each do |property, value|
- return value if name == property.name
- if name == "_#{property.name}_" && property.type == 10
- # Dereference references
- deref = @session.objects(:object_id => value, :broker => @broker)
- return nil unless deref.size == 1
- return deref[0]
- end
- end
- @statistics.each do |statistic, value|
- if name == statistic.name
- return value
- end
- end
- raise "Type Object has no attribute '#{name}'"
- end
-
- private
-
- def send_method_request(method, name, args, synchronous = false)
- @schema.methods.each do |schema_method|
- if name == schema_method.name
- send_codec = Qpid::StringCodec.new(@broker.conn.spec)
- seq = @session.seq_mgr.reserve([schema_method, synchronous])
- @broker.set_header(send_codec, ?M, seq)
- @object_id.encode(send_codec)
- pname, cname, hash = @schema.klass_key
- send_codec.write_str8(pname)
- send_codec.write_str8(cname)
- send_codec.write_bin128(hash)
- send_codec.write_str8(name)
-
- formals = method.arguments.select { |arg| arg.dir.index(?I) }
- count = method.arguments.select { |arg| arg.dir.index(?I) }.size
- unless formals.size == args.size
- raise "Incorrect number of arguments: expected #{formals.size}, got #{args.size}"
- end
-
- formals.zip(args).each do |formal, actual|
- @session.encode_value(send_codec, actual, formal.type)
- end
-
- smsg = @broker.message(send_codec.encoded,
- "agent.#{object_id.broker_bank}.#{object_id.agent_bank}")
-
- @broker.sync_start if synchronous
- @broker.emit(smsg)
-
- return seq
- end
- end
- end
-
- def invoke(method, name, args)
- if send_method_request(method, name, args, synchronous = true)
- unless @broker.wait_for_sync_done
- @session.seq_mgr.release(seq)
- raise "Timed out waiting for method to respond"
- end
-
- if @broker.error
- error_text = @broker.error
- @broker.error = nil
- raise error_text
- end
-
- return @broker.sync_result
- end
- raise "Invalid Method (software defect) [#{name}]"
- end
-
- def parse_presence_masks(codec, schema)
- exclude_list = []
- bit = 0
- schema.properties.each do |property|
- if property.optional
- if bit == 0
- mask = codec.read_uint8
- bit = 1
- end
- if (mask & bit) == 0
- exclude_list << property.name
- end
- bit *= 2
- bit = 0 if bit == 256
- end
- end
- return exclude_list
- end
- end
-
- class MethodResult
-
- attr_reader :status, :text
-
- def initialize(status, text, out_args)
- @status = status
- @text = text
- @out_args = out_args
- end
-
- def method_missing(name)
- name = name.to_s()
- if @out_args.include?(name)
- return @out_args[name]
- else
- raise "Unknown method result arg #{name}"
- end
- end
-
- def to_s
- "#{text} (#{status}) - #{out_args.inspect}"
- end
- end
-
- class ManagedConnection
-
- DELAY_MIN = 1
- DELAY_MAX = 128
- DELAY_FACTOR = 2
- include MonitorMixin
-
- def initialize(broker)
- super()
- @broker = broker
- @cv = new_cond
- @is_cancelled = false
- end
-
- # Main body of the running thread.
- def start
- @thread = Thread.new {
- delay = DELAY_MIN
- while true
- begin
- @broker.try_to_connect
- synchronize do
- while !@is_cancelled and @broker.connected?
- @cv.wait
- Thread.exit if @is_cancelled
- delay = DELAY_MIN
- end
- end
-
- rescue Qpid::Session::Closed, Qpid::Session::Detached, SystemCallError
- delay *= DELAY_FACTOR if delay < DELAY_MAX
- end
-
- synchronize do
- @cv.wait(delay)
- Thread.exit if @is_cancelled
- end
- end
- }
- end
-
- # Tell this thread to stop running and return.
- def stop
- synchronize do
- @is_cancelled = true
- @cv.signal
- end
- end
-
- # Notify the thread that the connection was lost.
- def disconnected
- synchronize do
- @cv.signal
- end
- end
-
- def join
- @thread.join
- end
- end
-
- class Broker
-
- SYNC_TIME = 60
-
- include MonitorMixin
-
- attr_accessor :error
-
- attr_reader :amqp_session_id, :amqp_session, :conn, :broker_bank, :topic_name
-
- attr_accessor :broker_id, :sync_result
-
- def initialize(session, host, port, auth_mech, auth_name, auth_pass)
- super()
-
- # For debugging..
- Thread.abort_on_exception = true
-
- @session = session
- @host = host
- @port = port
- @auth_name = auth_name
- @auth_pass = auth_pass
- @broker_bank = 1
- @agents = {}
- @agents["1.0"] = Agent.new(self, 0, "BrokerAgent")
- @topic_bound = false
- @cv = new_cond
- @sync_in_flight = false
- @sync_request = 0
- @sync_result = nil
- @reqs_outstanding = 1
- @error = nil
- @broker_id = nil
- @is_connected = false
- @conn = nil
- if @session.managedConnections?
- @thread = ManagedConnection.new(self)
- @thread.start
- else
- @thread = nil
- try_to_connect
- end
- end
-
- def connected?
- @is_connected
- end
-
- def agent(broker_bank, agent_bank)
- bank_key = "%d.%d" % [broker_bank, agent_bank]
- return @agents[bank_key]
- end
-
- # Get the list of agents reachable via this broker
- def agents
- @agents.values
- end
-
- def url
- "#{@host}:#{@port}"
- end
-
- def to_s
- if connected?
- "Broker connected at: #{url}"
- else
- "Disconnected Broker"
- end
- end
-
- def wait_for_sync_done
- synchronize do
- return @cv.wait_for(SYNC_TIME) { ! @sync_in_flight || @error }
- end
- end
-
- def wait_for_stable
- synchronize do
- return if @reqs_outstanding == 0
- @sync_in_flight = true
- unless @cv.wait_for(SYNC_TIME) { @reqs_outstanding == 0 }
- raise "Timed out waiting for broker to synchronize"
- end
- end
- end
-
- # Compose the header of a management message
- def set_header(codec, opcode, seq=0)
- codec.write_uint8(?A)
- codec.write_uint8(?M)
- codec.write_uint8(?2)
- codec.write_uint8(opcode)
- codec.write_uint32(seq)
- end
-
- def message(body, routing_key="broker")
- dp = @amqp_session.delivery_properties
- dp.routing_key = routing_key
- mp = @amqp_session.message_properties
- mp.content_type = "x-application/qmf"
- mp.reply_to = amqp_session.reply_to("amq.direct", @reply_name)
- return Qpid::Message.new(dp, mp, body)
- end
-
- def emit(msg, dest="qpid.management")
- @amqp_session.message_transfer(:destination => dest,
- :message => msg)
- end
-
- def inc_outstanding
- synchronize { @reqs_outstanding += 1 }
- end
-
- def dec_outstanding
- synchronize do
- @reqs_outstanding -= 1
- if @reqs_outstanding == 0 && ! @topic_bound
- @topic_bound = true
- @session.binding_key_list.each do |key|
- args = {
- :exchange => "qpid.management",
- :queue => @topic_name,
- :binding_key => key }
- @amqp_session.exchange_bind(args)
- end
- end
- if @reqs_outstanding == 0 && @sync_in_flight
- sync_done
- end
- end
- end
-
- def sync_start
- synchronize { @sync_in_flight = true }
- end
-
- def sync_done
- synchronize do
- @sync_in_flight = false
- @cv.signal
- end
- end
-
- def update_agent(obj)
- bank_key = "%d.%d" % [obj.brokerBank, obj.agentBank]
- if obj.delete_time == 0
- unless @agents.include?(bank_key)
- agent = Agent.new(self, obj.agentBank, obj.label)
- @agents[bank_key] = agent
- @session.console.new_agent(agent) if @session.console
- end
- else
- agent = @agents.delete(bank_key)
- @session.console.del_agent(agent) if agent && @session.console
- end
- end
-
- def shutdown
- if @thread
- @thread.stop
- @thread.join
- end
- if connected?
- @amqp_session.incoming("rdest").stop
- if @session.console
- @amqp_session.incoming("tdest").stop
- end
- @amqp_session.close
- @is_connected = false
- end
- end
-
- def try_to_connect
- #begin
- @amqp_session_id = "%s.%d" % [Socket.gethostname, Process::pid]
- # FIXME: Need sth for Qpid::Util::connect
-
- @conn = Qpid::Connection.new(TCPSocket.new(@host, @port),
- :username => @auth_name,
- :password => @auth_pass)
- @conn.start
- @reply_name = "reply-%s" % amqp_session_id
- @amqp_session = @conn.session(@amqp_session_id)
- @amqp_session.auto_sync = true
-
- @amqp_session.queue_declare(:queue => @reply_name,
- :exclusive => true,
- :auto_delete => true)
-
- @amqp_session.exchange_bind(:exchange => "amq.direct",
- :queue => @reply_name,
- :binding_key => @reply_name)
- @amqp_session.message_subscribe(:queue => @reply_name,
- :destination => "rdest",
- :accept_mode => @amqp_session.message_accept_mode.none,
- :acquire_mode => @amqp_session.message_acquire_mode.pre_acquired)
- q = @amqp_session.incoming("rdest")
- q.exc_listen(& method(:exception_cb))
- q.listen(& method(:reply_cb))
- @amqp_session.message_set_flow_mode(:destination => "rdest",
- :flow_mode => 1)
- @amqp_session.message_flow(:destination => "rdest",
- :unit => 0,
- :value => 0xFFFFFFFF)
- @amqp_session.message_flow(:destination => "rdest",
- :unit => 1,
- :value => 0xFFFFFFFF)
-
- @topic_name = "topic-#{@amqp_session_id}"
- @amqp_session.queue_declare(:queue => @topic_name,
- :exclusive => true,
- :auto_delete => true)
- @amqp_session.message_subscribe(:queue => @topic_name,
- :destination => "tdest",
- :accept_mode => @amqp_session.message_accept_mode.none,
- :acquire_mode => @amqp_session.message_acquire_mode.pre_acquired)
- @amqp_session.incoming("tdest").listen(& method(:reply_cb))
- @amqp_session.message_set_flow_mode(:destination => "tdest",
- :flow_mode => 1)
- @amqp_session.message_flow(:destination => "tdest",
- :unit => 0,
- :value => 0xFFFFFFFF)
- @amqp_session.message_flow(:destination => "tdest",
- :unit => 1,
- :value => 0xFFFFFFFF)
-
- @is_connected = true
- @session.handle_broker_connect(self)
-
- codec = Qpid::StringCodec.new(@conn.spec)
- set_header(codec, ?B)
- msg = message(codec.encoded)
- emit(msg)
- end
-
- private
-
- # Check the header of a management message and extract the opcode and
- # class
- def check_header(codec)
- begin
- return [nil, nil] unless codec.read_uint8 == ?A
- return [nil, nil] unless codec.read_uint8 == ?M
- return [nil, nil] unless codec.read_uint8 == ?2
- opcode = codec.read_uint8
- seq = codec.read_uint32
- return [opcode, seq]
- rescue
- return [nil, nil]
- end
- end
-
- def reply_cb(msg)
- codec = Qpid::StringCodec.new(@conn.spec, msg.body)
- loop do
- opcode, seq = check_header(codec)
- return unless opcode
- case opcode
- when ?b: @session.handle_broker_resp(self, codec, seq)
- when ?p: @session.handle_package_ind(self, codec, seq)
- when ?z: @session.handle_command_complete(self, codec, seq)
- when ?q: @session.handle_class_ind(self, codec, seq)
- when ?m: @session.handle_method_resp(self, codec, seq)
- when ?h: @session.handle_heartbeat_ind(self, codec, seq, msg)
- when ?e: @session.handle_event_ind(self, codec, seq)
- when ?s: @session.handle_schema_resp(self, codec, seq)
- when ?c: @session.handle_content_ind(self, codec, seq, true, false)
- when ?i: @session.handle_content_ind(self, codec, seq, false, true)
- when ?g: @session.handle_content_ind(self, codec, seq, true, true)
- else
- raise "Unexpected opcode #{opcode.inspect}"
- end
- end
- end
-
- def exception_cb(data)
- @is_connected = false
- @error = data
- synchronize { @cv.signal if @sync_in_flight }
- @session.handle_error(@error)
- @session.handle_broker_disconnect(self)
- @thread.disconnected if @thread
- end
- end
-
- class Agent
- attr_reader :broker, :agent_bank, :label
-
- def initialize(broker, agent_bank, label)
- @broker = broker
- @agent_bank = agent_bank
- @label = label
- end
-
- def broker_bank
- @broker.broker_bank
- end
-
- def to_s
- "Agent at bank %d.%d (%s)" % [@broker.broker_bank, @agent_bank, @label]
- end
- end
-
- class Event
-
- attr_reader :klass_key, :arguments, :timestamp, :name, :schema
-
- def initialize(session, broker, codec)
- @session = session
- @broker = broker
- pname = codec.read_str8
- cname = codec.read_str8
- hash = codec.read_bin128
- @klass_key = [pname, cname, hash]
- @timestamp = codec.read_int64
- @severity = codec.read_uint8
- @schema = nil
- session.packages.keys.each do |pname|
- k = [cname, hash]
- if session.packages[pname].include?(k)
- @schema = session.packages[pname][k]
- @arguments = {}
- @schema.arguments.each do |arg|
- v = session.decode_value(codec, arg.type)
- @arguments[arg.name] = v
- end
- end
- end
- end
-
- def to_s
- return "<uninterpretable>" unless @schema
- t = Time.at(self.timestamp / 1000000000)
- out = t.strftime("%c")
- out += " " + sev_name + " " + @klass_key[0] + ":" + klass_key[1]
- out += " broker=" + @broker.url
- @schema.arguments.each do |arg|
- out += " " + arg.name + "=" + @session.display_value(@arguments[arg.name], arg.type)
- end
- return out
- end
-
- def sev_name
- case @severity
- when 0 : return "EMER "
- when 1 : return "ALERT"
- when 2 : return "CRIT "
- when 3 : return "ERROR"
- when 4 : return "WARN "
- when 5 : return "NOTIC"
- when 6 : return "INFO "
- when 7 : return "DEBUG"
- else
- return "INV-%d" % @severity
- end
- end
-
- end
-
- # Manage sequence numbers for asynchronous method calls
- class SequenceManager
- include MonitorMixin
-
- def initialize
- super()
- @sequence = 0
- @pending = {}
- end
-
- # Reserve a unique sequence number
- def reserve (data)
- synchronize do
- result = @sequence
- @sequence += 1
- @pending[result] = data
- return result
- end
- end
-
- # Release a reserved sequence number
- def release (seq)
- synchronize { @pending.delete(seq) }
- end
- end
-
- class DebugConsole < Console
-
- def broker_connected(broker)
- puts "brokerConnected #{broker}"
- end
-
- def broker_disconnected(broker)
- puts "brokerDisconnected #{broker}"
- end
-
- def new_package(name)
- puts "newPackage #{name}"
- end
-
- def new_class(kind, klass_key)
- puts "newClass #{kind} #{klass_key}"
- end
-
- def new_agent(agent)
- puts "new_agent #{agent}"
- end
-
- def del_agent(agent)
- puts "delAgent #{agent}"
- end
-
- def object_props(broker, record)
- puts "objectProps #{record}"
- end
-
- def object_stats(broker, record)
- puts "objectStats #{record}"
- end
-
- def event(broker, event)
- puts "event #{event}"
- end
-
- def heartbeat(agent, timestamp)
- puts "heartbeat #{agent}"
- end
-
- def broker_info(broker)
- puts "brokerInfo #{broker}"
- end
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/queue.rb b/M4-RCs/qpid/ruby/lib/qpid/queue.rb
deleted file mode 100644
index 4150173b53..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/queue.rb
+++ /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.
-#
-
-# Augment the standard python multithreaded Queue implementation to add a
-# close() method so that threads blocking on the content of a queue can be
-# notified if the queue is no longer in use.
-
-require 'thread'
-
-# Python nominally uses a bounded queue, but the code never establishes
-# a maximum size; we therefore use Ruby's unbounded queue
-class Qpid::Queue < ::Queue
-
- DONE = Object.new
- STOP = Object.new
-
- def initialize
- super
- @error = nil
- @listener = nil
- @exc_listener = nil
- @exc_listener_lock = Monitor.new
- @thread = nil
- end
-
- def close(error = nil)
- @error = error
- put(DONE)
- unless @thread.nil?
- @thread.join()
- @thread = nil
- end
- end
-
- def get(block = true, timeout = nil)
- unless timeout.nil?
- raise NotImplementedError
- end
- result = pop(! block)
- if result == DONE
- # this guarantees that any other waiting threads or any future
- # calls to get will also result in a Qpid::Closed exception
- put(DONE)
- raise Qpid::Closed.new(@error)
- else
- return result
- end
- end
-
- alias :put :push
-
- def exc_listen(&block)
- @exc_listener_lock.synchronize do
- @exc_listener = block
- end
- end
-
- def listen(&block)
- if ! block_given? && @thread
- put(STOP)
- @thread.join()
- @thread = nil
- end
-
- # FIXME: There is a potential race since we could be changing one
- # non-nil listener to another
- @listener = block
-
- if block_given? && @thread.nil?
- @thread = Thread.new do
- loop do
- begin
- o = get()
- break if o == STOP
- @listener.call(o)
- rescue Qpid::Closed => e
- @exc_listener.call(e) if @exc_listener
- break
- end
- end
- end
- end
- end
-
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/session.rb b/M4-RCs/qpid/ruby/lib/qpid/session.rb
deleted file mode 100644
index 43a664d285..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/session.rb
+++ /dev/null
@@ -1,458 +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.
-#
-
-require 'monitor'
-
-module Qpid
-
- class Session < Invoker
-
- def log; Qpid::logger["qpid.io.cmd"]; end
- def msg; Qpid::logger["qpid.io.msg"]; end
-
-
- class Exception < RuntimeError; end
- class Closed < Qpid::Session::Exception; end
- class Detached < Qpid::Session::Exception; end
-
-
- INCOMPLETE = Object.new
-
- def self.client(*args)
- return Qpid::Client(*args)
- end
-
- def self.server(*args)
- return Server(*args)
- end
-
- attr_reader :name, :spec, :auto_sync, :timeout, :channel
- attr_reader :results, :exceptions
- attr_accessor :channel, :auto_sync, :send_id, :receiver, :sender
-
- # FIXME: Pass delegate through a block ?
- def initialize(name, spec, kwargs = {})
- auto_sync = true
- auto_sync = kwargs[:auto_sync] if kwargs.key?(:auto_sync)
- timeout = kwargs[:timeout] || 10
- delegate = kwargs[:delegate]
-
- @name = name
- @spec = spec
- @auto_sync = auto_sync
- @timeout = timeout
- @invoke_lock = Monitor.new
- @closing = false
- @closed = false
-
- @cond_lock = Monitor.new
- @condition = @cond_lock.new_cond
-
- @send_id = true
- @receiver = Receiver.new(self)
- @sender = Sender.new(self)
-
- @lock = Monitor.new
- @incoming = {}
- @results = {}
- @exceptions = []
-
- @assembly = nil
-
- @delegate = delegate.call(self) if delegate
-
- @ctl_seg = spec[:segment_type].enum[:control].value
- @cmd_seg = spec[:segment_type].enum[:command].value
- @hdr_seg = spec[:segment_type].enum[:header].value
- @body_seg = spec[:segment_type].enum[:body].value
- end
-
- def incoming(destination)
- @lock.synchronize do
- queue = @incoming[destination]
- unless queue
- queue = Incoming.new(self, destination)
- @incoming[destination] = queue
- end
- return queue
- end
- end
-
- def error?
- @exceptions.size > 0
- end
-
- def sync(timeout=nil)
- if channel && Thread.current == channel.connection.thread
- raise Qpid::Session::Exception, "deadlock detected"
- end
- unless @auto_sync
- execution_sync(:sync => true)
- end
- last = @sender.next_id - 1
- @cond_lock.synchronize do
- unless @condition.wait_for(timeout) {
- @sender.completed.include?(last) || error?
- }
- raise Qpid::Timeout
- end
- end
- if error?
- raise Qpid::Session::Exception, exceptions
- end
- end
-
- def close(timeout=nil)
- @invoke_lock.synchronize do
- @closing = true
- channel.session_detach(name)
- end
- @cond_lock.synchronize do
- unless @condition.wait_for(timeout) { @closed }
- raise Qpid::Timeout
- end
- end
- end
-
- def closed
- @lock.synchronize do
- return if @closed
-
- @results.each { |id, f| f.error(exceptions) }
- @results.clear
-
- @incoming.values.each { |q| q.close(exceptions) }
- @closed = true
- @cond_lock.synchronize { @condition.signal }
- end
- end
-
- def resolve_method(name)
- o = @spec.children[name]
- case o
- when Qpid::Spec010::Command
- return invocation(:method, o)
- when Qpid::Spec010::Struct
- return invocation(:method, o)
- when Qpid::Spec010::Domain
- return invocation(:value, o.enum) unless o.enum.nil?
- end
-
- matches = @spec.children.select { |x|
- x.name.to_s.include?(name.to_s)
- }.collect { |x| x.name.to_s }.sort
- if matches.size == 0
- msg = nil
- elsif matches.size == 1
- msg = "Did you mean #{matches[0]} ? "
- else
- msg = "Did you mean one of #{matches.join(",")} ? "
- end
- return invocation(:error, msg)
- end
-
- def invoke(type, args)
- # XXX
- unless type.respond_to?(:track)
- return type.create(*args)
- end
- @invoke_lock.synchronize do
- return do_invoke(type, args)
- end
- end
-
- def do_invoke(type, args)
- raise Qpid::Session::Closed if @closing
- raise Qpid::Session::Detached unless channel
-
- # Clumsy simulation of Python's keyword args
- kwargs = {}
- if args.size > 0 && args[-1].is_a?(Hash)
- if args.size > type.fields.size
- kwargs = args.pop
- elsif type.fields[args.size - 1].type != @spec[:map]
- kwargs = args.pop
- end
- end
-
- if type.payload
- if args.size == type.fields.size + 1
- message = args.pop
- else
- message = kwargs.delete(:message) # XXX Really ?
- end
- else
- message = nil
- end
-
- hdr = Qpid::struct(@spec[:header])
- hdr.sync = @auto_sync || kwargs.delete(:sync)
-
- cmd = type.create(*args.push(kwargs))
- sc = Qpid::StringCodec.new(@spec)
- sc.write_command(hdr, cmd)
-
- seg = Segment.new(true, (message.nil? ||
- (message.headers.nil? && message.body.nil?)),
- type.segment_type, type.track, @channel.id, sc.encoded)
-
- unless type.result.nil?
- result = Future.new(exception=Exception)
- @results[@sender.next_id] = result
- end
- emit(seg)
-
- log.debug("SENT %s %s %s" % [seg.id, hdr, cmd]) if log
-
- unless message.nil?
- unless message.headers.nil?
- sc = Qpid::StringCodec.new(@spec)
- message.headers.each { |st| sc.write_struct32(st) }
-
- seg = Segment.new(false, message.body.nil?, @hdr_seg,
- type.track, @channel.id, sc.encoded)
- emit(seg)
- end
- unless message.body.nil?
- seg = Segment.new(false, true, @body_seg, type.track,
- @channel.id, message.body)
- emit(seg)
- end
- msg.debug("SENT %s" % message) if msg
- end
-
- if !type.result.nil?
- return @auto_sync ? result.get(@timeout) : result
- elsif @auto_sync
- sync(@timeout)
- end
- end
-
- def received(seg)
- @receiver.received(seg)
- if seg.first_segment?
- raise Qpid::Session::Exception unless @assembly.nil?
- @assembly = []
- end
- @assembly << seg
- if seg.last_segment?
- dispatch(@assembly)
- @assembly = nil
- end
- end
-
- def dispatch(assembly)
- hdr = nil
- cmd = nil
- header = nil
- body = nil
- assembly.each do |seg|
- d = seg.decode(@spec)
- case seg.type
- when @cmd_seg
- hdr, cmd = d
- when @hdr_seg
- header = d
- when @body_seg
- body = d
- else
- raise Qpid::Session::Exception
- end
- end
- log.debug("RECV %s %s %s" % [cmd.id, hdr, cmd]) if log
-
- if cmd.type.payload
- result = @delegate.send(cmd.type.name, cmd, header, body)
- else
- result = @delegate.send(cmd.type.name, cmd)
- end
-
- unless cmd.type.result.nil?
- execution_result(cmd.id, result)
- end
-
- if result != INCOMPLETE
- assembly.each do |seg|
- @receiver.has_completed(seg)
- # XXX: don't forget to obey sync for manual completion as well
- if hdr.sync
- @channel.session_completed(@receiver.completed)
- end
- end
- end
- end
-
- # Python calls this 'send', but that has a special meaning
- # in Ruby, so we call it 'emit'
- def emit(seg)
- @sender.emit(seg)
- end
-
- def signal
- @cond_lock.synchronize { @condition.signal }
- end
-
- def wait_for(timeout = nil, &block)
- @cond_lock.synchronize { @condition.wait_for(timeout, &block) }
- end
-
- def to_s
- "<Session: #{name}, #{channel}>"
- end
-
- class Receiver
-
- attr_reader :completed
- attr_accessor :next_id, :next_offset
-
- def initialize(session)
- @session = session
- @next_id = nil
- @next_offset = nil
- @completed = Qpid::RangedSet.new()
- end
-
- def received(seg)
- if @next_id.nil? || @next_offset.nil?
- raise Exception, "todo"
- end
- seg.id = @next_id
- seg.offset = @next_offset
- if seg.last_segment?
- @next_id += 1
- @next_offset = 0
- else
- @next_offset += seg.payload.size
- end
- end
-
- def has_completed(seg)
- if seg.id.nil?
- raise ArgumentError, "cannot complete unidentified segment"
- end
- if seg.last_segment?
- @completed.add(seg.id)
- end
- end
-
- def known_completed(commands)
- completed = Qpid::RangedSet.new()
- @completed.ranges.each do |c|
- unless commands.ranges.find { |kc|
- kc.contains(c.lower) && kc.contains(c.upper)
- }
- completed.add_range(c)
- end
- end
- @completed = completed
- end
- end
-
- class Sender
-
- def initialize(session)
- @session = session
- @next_id = 0.to_serial
- @next_offset = 0
- @segments = []
- @completed = RangedSet.new()
- end
-
- attr_reader :next_id, :completed
-
- def emit(seg)
- seg.id = @next_id
- seg.offset = @next_offset
- if seg.last_segment?
- @next_id += 1
- @next_offset = 0
- else
- @next_offset += seg.payload.size
- end
- @segments << seg
- if @session.send_id
- @session.send_id = false
- @session.channel.session_command_point(seg.id, seg.offset)
- end
- @session.channel.connection.write_segment(seg)
- end
-
- def has_completed(commands)
- @segments = @segments.reject { |seg| commands.include?(seg.id) }
- commands.ranges.each do |range|
- @completed.add(range.lower, range.upper)
- end
- end
- end
-
- class Incoming < Qpid::Queue
-
- def initialize(session, destination)
- super()
- @session = session
- @destination = destination
- end
-
- def start
- @session.message_credit_unit.choices.each do |unit|
- @session.message_flow(@destination, unit.value, 0xFFFFFFFF)
- end
- end
-
- def stop
- @session.message_cancel(@destination)
- listen # Kill the listener
- end
- end
-
- class Delegate
-
- def initialize(session)
- @session = session
- end
-
- #XXX: do something with incoming accepts
- def message_accept(ma) nil; end
-
- def execution_result(er)
- future = @session.results.delete(er.command_id)
- future.set(er.value)
- end
-
- def execution_exception(ex)
- @session.exceptions.append(ex)
- end
- end
-
- class Client < Delegate
-
- def log ; Qpid::logger["qpid.io.msg"]; end
-
- def message_transfer(cmd, headers, body)
- m = Qpid::Message.new(body)
- m.headers = headers
- m.id = cmd.id
- messages = @session.incoming(cmd.destination)
- messages.put(m)
- log.debug("RECV %s" % m) if log
- return INCOMPLETE
- end
- end
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/spec.rb b/M4-RCs/qpid/ruby/lib/qpid/spec.rb
deleted file mode 100644
index b3d70d019d..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/spec.rb
+++ /dev/null
@@ -1,183 +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.
-#
-
-require "set"
-require "rexml/document"
-require "qpid/fields"
-require "qpid/traverse"
-
-module Qpid
- module Spec
-
- include REXML
-
- class Container < Array
-
- def initialize()
- @cache = {}
- end
-
- def [](key)
- return @cache[key] if @cache.include?(key)
- value = do_lookup(key)
- @cache[key] = value
- return value
- end
-
- def do_lookup(key)
- case key
- when String
- return find {|x| x.name == key.intern()}
- when Symbol
- return find {|x| x.name == key}
- else
- return slice(key)
- end
- end
-
- def +(other)
- copy = clone()
- copy.concat(other)
- return copy
- end
-
- end
-
- class Reference
-
- fields(:name)
-
- def init(&block)
- @resolver = block
- end
-
- def resolve(*args)
- @resolver.call(*args)
- end
-
- end
-
- class Loader
-
- def initialize()
- @stack = []
- end
-
- def container()
- return Container.new()
- end
-
- def load(obj)
- case obj
- when String
- elem = @stack[-1]
- result = container()
- elem.elements.each(obj) {|e|
- @index = result.size
- result << load(e)
- }
- @index = nil
- return result
- else
- elem = obj
- @stack << elem
- begin
- result = send(:"load_#{elem.name}")
- ensure
- @stack.pop()
- end
- return result
- end
- end
-
- def element
- @stack[-1]
- end
-
- def text
- element.text
- end
-
- def attr(name, type = :string, default = nil, path = nil)
- if path.nil?
- elem = element
- else
- elem = nil
- element.elements.each(path) {|elem|}
- if elem.nil?
- return default
- end
- end
-
- value = elem.attributes[name]
- value = value.strip() unless value.nil?
- if value.nil?
- default
- else
- send(:"parse_#{type}", value)
- end
- end
-
- def parse_int(value)
- if value.nil?
- return nil
- else
- value.to_i(0)
- end
- end
-
- TRUE = ["yes", "true", "1"].to_set
- FALSE = ["no", "false", "0", nil].to_set
-
- def parse_bool(value)
- if TRUE.include?(value)
- true
- elsif FALSE.include?(value)
- false
- else
- raise Exception.new("parse error, expecting boolean: #{value}")
- end
- end
-
- def parse_string(value)
- value.to_s
- end
-
- def parse_symbol(value)
- value.intern() unless value.nil?
- end
-
- REPLACE = {" " => "_", "-" => "_"}
- KEYWORDS = {"global" => "global_", "return" => "return_"}
-
- def parse_name(value)
- return if value.nil?
-
- REPLACE.each do |k, v|
- value = value.gsub(k, v)
- end
-
- value = KEYWORDS[value] if KEYWORDS.has_key? value
- return value.intern()
- end
-
- end
-
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/spec010.rb b/M4-RCs/qpid/ruby/lib/qpid/spec010.rb
deleted file mode 100644
index 4c1e46b910..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/spec010.rb
+++ /dev/null
@@ -1,485 +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.
-#
-
-require "qpid/spec"
-require 'pathname'
-require 'fileutils'
-
-module Qpid::Spec010
-
- include Qpid::Spec
-
- # XXX: workaround for ruby bug/missfeature
- Reference = Reference
- Loader = Loader
-
- class Spec
-
- ENCODINGS = {
- String => "vbin16",
- Fixnum => "int64",
- Bignum => "int64",
- Float => "float",
- NilClass => "void",
- Array => "list",
- Hash => "map"
- }
-
- fields(:major, :minor, :port, :children)
-
- def init()
- @controls = {}
- @commands = {}
- @structs = {}
- @types = {}
- children.each {|c|
- case c
- when Control
- @controls[c.code] = c
- when Command
- @commands[c.code] = c
- when Struct
- @structs[c.code] = c
- when Type
- @types[c.code] = c unless c.code.nil?
- end
- }
- end
-
- attr_reader :controls, :commands, :structs, :types
-
- def [](key)
- return @children[key]
- end
-
- def encoding(klass)
- if ENCODINGS.has_key?(klass)
- return self[ENCODINGS[klass]]
- end
- for base in klass.__bases__
- result = encoding(base)
- return result unless result.nil?
- end
- end
-
- def inspect; "spec"; end
- end
-
- class Constant
-
- fields(:name, :value)
-
- attr :parent, true
-
- end
-
- class Type
-
- fields(:name, :code, :fixed, :variable)
-
- attr :parent, true
-
- def present?(value)
- if @fixed == 0
- return value
- else
- return !value.nil?
- end
- end
-
- def encode(codec, value)
- codec.send("write_#{name}", value)
- end
-
- def decode(codec)
- return codec.send("read_#{name}")
- end
-
- def inspect; name; end
-
- end
-
- class Domain < Type
-
- fields(:name, :type, :enum)
-
- attr :parent, true
-
- def encode(codec, value)
- @type.encode(codec, value)
- end
-
- def decode(codec)
- return @type.decode(codec)
- end
-
- end
-
- class Enum
- fields(:choices)
-
- def [](choice)
- case choice
- when String
- choice = choice.to_sym
- return choices.find { |c| c.name == choice }
- when Symbol
- return choices.find { |c| c.name == choice }
- else
- return choices.find { |c| c.value == choice }
- end
- end
-
- def method_missing(name, *args)
- raise ArgumentError.new("wrong number of arguments") unless args.empty?
- return self[name].value
- end
-
- end
-
- class Choice
- fields(:name, :value)
- end
-
- class Composite
-
- fields(:name, :code, :size, :pack, :fields)
-
- attr :parent, true
-
- # Python calls this 'new', but that has special meaning in Ruby
- def create(*args)
- return Qpid::struct(self, *args)
- end
-
- def decode(codec)
- codec.read_size(@size)
- codec.read_uint16() unless @code.nil?
- return Qpid::struct(self, self.decode_fields(codec))
- end
-
- def decode_fields(codec)
- flags = 0
- pack.times {|i| flags |= (codec.read_uint8() << 8*i)}
-
- result = {}
-
- fields.each_index {|i|
- f = @fields[i]
- if flags & (0x1 << i) != 0
- result[f.name] = f.type.decode(codec)
- else
- result[f.name] = nil
- end
- }
-
- return result
- end
-
- def encode(codec, value)
- sc = Qpid::StringCodec.new(@spec)
- sc.write_uint16(@code) unless @code.nil?
- encode_fields(sc, value)
- codec.write_size(@size, sc.encoded.size)
- codec.write(sc.encoded)
- end
-
- def encode_fields(codec, values)
- # FIXME: This could be written cleaner using select
- # instead of flags
- flags = 0
- fields.each_index do |i|
- f = fields[i]
- flags |= (0x1 << i) if f.type.present?(values[f.name])
- end
-
- pack.times { |i| codec.write_uint8((flags >> 8*i) & 0xFF) }
-
- fields.each_index do |i|
- f = fields[i]
- f.type.encode(codec, values[f.name]) if flags & (0x1 << i) != 0
- end
- end
-
- def inspect; name; end
-
- end
-
- class Field
-
- fields(:name, :type, :exceptions)
-
- def default()
- return nil
- end
-
- end
-
- class Struct < Composite
-
- def present?(value)
- return !value.nil?
- end
-
- end
-
- class Action < Composite; end
-
- class Control < Action
-
- def segment_type
- @parent[:segment_type].enum[:control].value
- end
-
- def track
- @parent[:track].enum[:control].value
- end
-
- end
-
- class Command < Action
-
- attr_accessor :payload, :result
-
- def segment_type
- @parent["segment_type"].enum["command"].value
- end
-
- def track
- @parent["track"].enum["command"].value
- end
-
- end
-
- class Doc
- fields(:type, :title, :text)
- end
-
- class Loader010 < Loader
-
- def initialize()
- super()
- end
-
- def klass
- cls = element
- until cls.nil?
- break if cls.name == "class"
- cls = cls.parent
- end
- return cls
- end
-
- def scope
- if element.name == "struct"
- return nil
- else
- return class_name
- end
- end
-
- def class_name
- cls = klass
- if cls.nil?
- return nil
- else
- return parse_name(cls.attributes["name"].strip)
- end
- end
-
- def class_code
- cls = klass
- if cls.nil?
- return 0
- else
- return parse_int(cls.attributes["code"].strip)
- end
- end
-
- def parse_decl(value)
- name = parse_name(value)
-
- s = scope
- if s.nil?
- return name
- else
- return :"#{s}_#{name}"
- end
- end
-
- def parse_code(value)
- c = parse_int(value)
- if c.nil?
- return nil
- else
- return c | (class_code << 8)
- end
- end
-
- def parse_type(value)
- name = parse_name(value.sub(".", "_"))
- cls = class_name
- return Reference.new {|spec|
- candidates = [name]
- candidates << :"#{cls}_#{name}" unless cls.nil?
- for c in candidates
- child = spec[c]
- break unless child.nil?
- end
- if child.nil?
- raise Exception.new("unresolved type: #{name}")
- else
- child
- end
-}
- end
-
- def load_amqp()
- children = nil
-
- for s in ["constant", "type", "domain", "struct", "control",
- "command"]
- ch = load(s)
- if children.nil?
- children = ch
- else
- children += ch
- end
- children += load("class/#{s}")
- end
- children += load("class/command/result/struct")
- Spec.new(attr("major", :int), attr("minor", :int), attr("port", :int),
- children)
- end
-
- def load_constant()
- Constant.new(attr("name", :decl), attr("value", :int))
- end
-
- def load_type()
- Type.new(attr("name", :decl), attr("code", :code),
- attr("fixed-width", :int), attr("variable-width", :int))
- end
-
- def load_domain()
- Domain.new(attr("name", :decl), attr("type", :type), load("enum").first)
- end
-
- def load_enum()
- Enum.new(load("choice"))
- end
-
- def load_choice()
- Choice.new(attr("name", :name), attr("value", :int))
- end
-
- def load_field()
- Field.new(attr("name", :name), attr("type", :type))
- end
-
- def load_struct()
- Struct.new(attr("name", :decl), attr("code", :code), attr("size", :int),
- attr("pack", :int), load("field"))
- end
-
- def load_action(cls)
- cls.new(attr("name", :decl), attr("code", :code), 0, 2, load("field"))
- end
-
- def load_control()
- load_action(Control)
- end
-
- def load_command()
- result = attr("type", :type, nil, "result")
- result = attr("name", :type, nil, "result/struct") if result.nil?
- segs = load("segments")
- cmd = load_action(Command)
- cmd.result = result
- cmd.payload = !segs.empty?
- return cmd
- end
-
- def load_result()
- true
- end
-
- def load_segments()
- true
- end
-
- end
-
- def self.spec_cache(specfile)
- File::join(File::dirname(__FILE__), "spec_cache",
- File::basename(specfile, ".xml") + ".rb_marshal")
- end
-
- # XXX: could be shared
- def self.load(spec = nil)
- return spec if spec.is_a?(Qpid::Spec010::Spec)
- if spec.nil?
- # FIXME: Need to add a packaging setup in here so we know where
- # the installed spec is going to be.
- specfile = nil
- if ENV['AMQP_SPEC']
- specfile = ENV['AMQP_SPEC']
- else
- require "qpid/config"
- specfile = Qpid::Config.amqp_spec
- end
- else
- specfile = spec
- end
-
- specfile_cache = spec_cache(specfile)
- # FIXME: Check that cache is newer than specfile
- if File::exist?(specfile_cache)
- begin
- spec = File::open(specfile_cache, "r") do |f|
- Marshal::load(f)
- end
- return spec
- rescue
- # Ignore, will load from XML
- end
- end
-
- doc = File::open(specfile, "r") { |f| Document.new(f) }
- spec = Loader010.new().load(doc.root)
- spec.traverse! do |o|
- if o.is_a?(Reference)
- o.resolve(spec)
- else
- o
- end
- end
-
- spec.children.each { |c| c.parent = spec }
-
- begin
- FileUtils::mkdir_p(File::dirname(specfile_cache))
- File::open(specfile_cache, "w") { |f| Marshal::dump(spec, f) }
- rescue
- # Ignore, we are fine without the cached spec
- end
- return spec
- end
-
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/spec08.rb b/M4-RCs/qpid/ruby/lib/qpid/spec08.rb
deleted file mode 100644
index 902c05c297..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/spec08.rb
+++ /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.
-#
-
-require "qpid/spec"
-
-module Qpid08
-
- module Spec
-
- include Qpid::Spec
-
- # XXX: workaround for ruby bug/missfeature
- Reference = Reference
-
- class Root
- fields(:major, :minor, :classes, :constants, :domains)
-
- def find_method(name)
- classes.each do |c|
- c.methods.each do |m|
- if name == m.qname
- return m
- end
- end
- end
-
- return nil
- end
- end
-
- class Constant
- fields(:name, :id, :type, :docs)
- end
-
- class Domain
- fields(:name, :type)
- end
-
- class Class
- fields(:name, :id, :handler, :fields, :methods, :docs)
- end
-
- class Method
- fields(:name, :id, :content?, :responses, :synchronous?, :fields,
- :docs)
-
- def init()
- @response = false
- end
-
- attr :parent, true
-
- def response?; @response end
- def response=(b); @response = b end
-
- def qname
- :"#{parent.name}_#{name}"
- end
- end
-
- class Field
- fields(:name, :id, :type, :docs)
-
- def default
- case type
- when :bit then false
- when :octet, :short, :long, :longlong then 0
- when :shortstr, :longstr then ""
- when :table then {}
- end
- end
- end
-
- class Doc
- fields(:type, :text)
- end
-
- class Container08 < Container
- def do_lookup(key)
- case key
- when Integer
- return find {|x| x.id == key}
- else
- return super(key)
- end
- end
- end
-
- class Loader08 < Loader
-
- def container()
- return Container08.new()
- end
-
- def load_amqp()
- Root.new(attr("major", :int), attr("minor", :int), load("class"),
- load("constant"), load("domain"))
- end
-
- def load_class()
- Class.new(attr("name", :name), attr("index", :int), attr("handler", :name),
- load("field"), load("method"), load("doc"))
- end
-
- def load_method()
- Method.new(attr("name", :name), attr("index", :int),
- attr("content", :bool), load("response"),
- attr("synchronous", :bool), load("field"), load("docs"))
- end
-
- def load_response()
- name = attr("name", :name)
- Reference.new {|spec, klass|
- response = klass.methods[name]
- if response.nil?
- raise Exception.new("no such method: #{name}")
- end
- response
- }
- end
-
- def load_field()
- type = attr("type", :name)
- if type.nil?
- domain = attr("domain", :name)
- type = Reference.new {|spec, klass|
- spec.domains[domain].type
- }
- end
- Field.new(attr("name", :name), @index, type, load("docs"))
- end
-
- def load_constant()
- Constant.new(attr("name", :name), attr("value", :int), attr("class", :name),
- load("doc"))
- end
-
- def load_domain()
- Domain.new(attr("name", :name), attr("type", :name))
- end
-
- def load_doc()
- Doc.new(attr("type", :symbol), text)
- end
-
- end
-
- def self.load(spec)
- case spec
- when String
- spec = File.new(spec)
- end
- doc = Document.new(spec)
- spec = Loader08.new().load(doc.root)
- spec.classes.each do |klass|
- klass.traverse! do |o|
- case o
- when Reference
- o.resolve(spec, klass)
- else
- o
- end
- end
- klass.methods.each do |m|
- m.parent = klass
- m.responses.each do |r|
- r.response = true
- end
- end
- end
- return spec
- end
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/test.rb b/M4-RCs/qpid/ruby/lib/qpid/test.rb
deleted file mode 100644
index 2e643f4348..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/test.rb
+++ /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.
-#
-
-require "qpid/spec08"
-require "qpid/client"
-
-module Qpid08
-
- module Test
-
- def connect()
- spec = Spec.load("../specs/amqp.0-8.xml")
- c = Client.new("0.0.0.0", 5672, spec)
- c.start({"LOGIN" => "guest", "PASSWORD" => "guest"})
- return c
- end
-
- end
-
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/traverse.rb b/M4-RCs/qpid/ruby/lib/qpid/traverse.rb
deleted file mode 100644
index 67358a7eb1..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/traverse.rb
+++ /dev/null
@@ -1,64 +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 Object
-
- public
-
- def traverse()
- traverse! {|o| yield(o); o}
- end
-
- def traverse_children!()
- instance_variables.each {|v|
- value = instance_variable_get(v)
- replacement = yield(value)
- instance_variable_set(v, replacement) unless replacement.equal? value
- }
- end
-
- def traverse!(replacements = {})
- return replacements[__id__] if replacements.has_key? __id__
- replacement = yield(self)
- replacements[__id__] = replacement
- traverse_children! {|o| o.traverse!(replacements) {|c| yield(c)}}
- return replacement
- end
-
-end
-
-class Array
- def traverse_children!()
- map! {|o| yield(o)}
- end
-end
-
-class Hash
- def traverse_children!()
- mods = {}
- each_pair {|k, v|
- key = yield(k)
- value = yield(v)
- mods[key] = value unless key.equal? k and value.equal? v
- delete(k) unless key.equal? k
- }
-
- merge!(mods)
- end
-end
diff --git a/M4-RCs/qpid/ruby/lib/qpid/util.rb b/M4-RCs/qpid/ruby/lib/qpid/util.rb
deleted file mode 100644
index 2dbc37da09..0000000000
--- a/M4-RCs/qpid/ruby/lib/qpid/util.rb
+++ /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.
-#
-
-require 'thread'
-require 'monitor'
-
-# Monkeypatch
-class MonitorMixin::ConditionVariable
-
- # Wait until BLOCK returns TRUE or TIMEOUT seconds have passed
- # Return TRUE if BLOCK returned TRUE within the TIMEOUT, FALSE
- # otherswise
- def wait_for(timeout=nil, &block)
- start = Time.now
- passed = 0
- until yield
- if timeout.nil?
- wait
- elsif passed < timeout
- wait(timeout)
- else
- return false
- end
- passed = Time.now - start
- end
- return true
- end
-end
-
-module Qpid::Util
-
- # Similar to Python's threading.Event
- class Event
- def initialize
- @monitor = Monitor.new
- @cond = @monitor.new_cond
- @set = false
- end
-
- def set
- @monitor.synchronize do
- @set = true
- @cond.signal
- end
- end
-
- def clear
- @monitor.synchronize { @set = false }
- end
-
- def wait(timeout = nil)
- @monitor.synchronize do
- unless @set
- @cond.wait_for(timeout) { @set }
- end
- end
- end
- end
-end
diff --git a/M4-RCs/qpid/ruby/tests/assembler.rb b/M4-RCs/qpid/ruby/tests/assembler.rb
deleted file mode 100644
index 1181ece547..0000000000
--- a/M4-RCs/qpid/ruby/tests/assembler.rb
+++ /dev/null
@@ -1,78 +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.
-#
-
-require "test/unit"
-require "qpid"
-require 'tests/util'
-
-require 'logger'
-
-class TestAssembler< Test::Unit::TestCase
-
- Segment = Qpid::Segment
- Assembler = Qpid::Assembler
-
- def setup
- # Qpid::asm_logger = Logger.new(STDOUT)
-
- @server = Util::ServerThread.new do |socket|
- asm = Assembler.new(socket)
- begin
- header = asm.read_header
- asm.write_header(header[-2], header[-1])
- loop do
- seg = asm.read_segment
- asm.write_segment(seg)
- end
- rescue Qpid::Closed
- nil # Ignore
- end
- end
- end
-
- def teardown
- @server.finish
- @server.join
- end
-
- def test_assembler
- asm = Assembler.new(@server.client, max_payload = 1)
- asm.write_header(0, 10)
- asm.write_segment(Segment.new(true, false, 1, 2, 3, "TEST"))
- asm.write_segment(Segment.new(false, true, 1, 2, 3, "ING"))
-
- assert_equal( ["AMQP", 1, 1, 0, 10], asm.read_header)
-
- seg = asm.read_segment
- assert_equal(true, seg.first_segment?)
- assert_equal(false, seg.last_segment?)
- assert_equal(1, seg.type)
- assert_equal(2, seg.track)
- assert_equal(3, seg.channel)
- assert_equal("TEST", seg.payload)
-
- seg = asm.read_segment
- assert_equal(false, seg.first_segment?)
- assert_equal(true, seg.last_segment?)
- assert_equal(1, seg.type)
- assert_equal(2, seg.track)
- assert_equal(3, seg.channel)
- assert_equal("ING", seg.payload)
- end
-end
diff --git a/M4-RCs/qpid/ruby/tests/codec010.rb b/M4-RCs/qpid/ruby/tests/codec010.rb
deleted file mode 100644
index a9a5ca81e0..0000000000
--- a/M4-RCs/qpid/ruby/tests/codec010.rb
+++ /dev/null
@@ -1,122 +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.
-#
-
-require "test/unit"
-require "qpid"
-require "tests/util"
-require "socket"
-
-class CodecTest < Test::Unit::TestCase
-
- def setup
- @spec = Qpid::Spec010::load
- end
-
- def check(type, value)
- t = @spec[type]
- sc = Qpid::StringCodec.new(@spec)
- t.encode(sc, value)
- decoded = t.decode(sc)
- assert_equal(value, decoded)
- end
-
-
- def testMapString
- check("map", {"string" => "this is a test"})
- end
-
- def testMapInt
- check("map", {"int" => 3})
- end
-
- def testMapLong
- check("map", {"long" => 2**32})
- end
-
- def testMapNone
- check("map", {"none" => None})
- end
-
- def testMapNested
- check("map", {"map" => {"string" => "nested test"}})
- end
-
- def testMapList
- check("map", {"list" => [1, "two", 3.0, -4]})
- end
-
- def testMapAll
- check("map", {"string" => "this is a test",
- "int" => 3,
- "long" => 2**32,
- "nil" => nil,
- "map" => {"string" => "nested map"},
- "list" => [1, "two", 3.0, -4]})
- end
-
- def testMapEmpty
- check("map", {})
- end
-
- def testMapNone
- check("map", nil)
- end
-
- def testList
- check("list", [1, "two", 3.0, -4])
- end
-
- def testListEmpty
- check("list", [])
- end
-
- def testListNone
- check("list", nil)
- end
-
- def testArrayInt
- check("array", [1, 2, 3, 4])
- end
-
- def testArrayString
- check("array", ["one", "two", "three", "four"])
- end
-
- def testArrayEmpty
- check("array", [])
- end
-
- def testArrayNone
- check("array", nil)
- end
-
- def testInt64
- check("int64", 2 ** 40 * -1 + 43)
- end
-
- def testUint64
- check("int64", 2 ** 42)
- end
-
- def testReadNone
- sc = Qpid::StringCodec.new(@spec)
- # Python behaves this way
- assert_equal("", sc.read(nil))
- end
-end
diff --git a/M4-RCs/qpid/ruby/tests/connection.rb b/M4-RCs/qpid/ruby/tests/connection.rb
deleted file mode 100644
index ab892d8e53..0000000000
--- a/M4-RCs/qpid/ruby/tests/connection.rb
+++ /dev/null
@@ -1,235 +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.
-#
-
-require 'test/unit'
-require 'qpid'
-require 'tests/util'
-
-class MockServer
-
- def initialize(queue)
- @queue = queue
- end
-
- def connection(conn, args={})
- return Qpid::Delegate::Server.new(conn, :delegate => method(:session))
- end
-
- def session(ssn, args={})
- ssn.auto_sync = false
- return MockSession.new(ssn, @queue)
- end
-end
-
-class MockSession < Qpid::Session::Delegate
-
- def initialize(session, queue)
- @session = session
- @queue = queue
- end
-
- def execution_sync(es)
- nil
- end
-
- def queue_query(qq)
- return qq.type.result.create(qq.queue)
- end
-
- def message_transfer(cmd, headers, body)
- if cmd.destination == "echo"
- m = Qpid::Message.new(body)
- m.headers = headers
- @session.message_transfer(cmd.destination, cmd.accept_mode,
- cmd.acquire_mode, m)
- elsif cmd.destination == "abort"
- @session.channel.connection.sock.close()
- else
- @queue.put([cmd, headers, body])
- end
- end
-end
-
-class TestConnectionTest < Test::Unit::TestCase
-
- def setup
- # Make sure errors in threads lead to a noisy death of the test
- Thread.abort_on_exception = true
-
- @queue = Qpid::Queue.new
- @running = true
- ts = MockServer.new(@queue)
- @server = Util::ServerThread.new do |socket|
- conn = Qpid::Connection.new(socket, :delegate => ts.method(:connection))
- begin
- conn.start(5)
- rescue Qpid::Closed
- # Ignore
- end
- end
-
- class << @server
- def finish
- @running.lock
- client.close
- @sockets.each { |sock| sock.close unless sock.closed? }
- end
- end
-
- @server[:name] = 'server'
- Thread.current[:name] = 'test'
- end
-
- def teardown
- @server.finish
- @server.join
- end
-
- def connect
- sock = @server.client
- return Qpid::Connection.new(sock)
- end
-
- def test_basic
- c = connect
- c.start(10)
-
- ssn1 = c.session("test1", :timeout => 10)
- ssn2 = c.session("test2", :timeout => 10)
-
- assert_equal(c.sessions["test1"], ssn1)
- assert_equal(c.sessions["test2"], ssn2)
- assert_not_nil ssn1.channel
- assert_not_nil ssn2.channel
- assert(c.attached.values.include?(ssn1))
- assert(c.attached.values.include?(ssn2))
-
- ssn1.close(5)
-
- assert_nil(ssn1.channel)
- assert(! c.attached.values.include?(ssn1))
- assert(c.sessions.values.include?(ssn2))
-
- ssn2.close(5)
-
- assert_nil(ssn2.channel)
- assert(! c.attached.values.include?(ssn2))
- assert(! c.sessions.values.include?(ssn2))
-
- ssn = c.session("session", :timeout => 10)
-
- assert_not_nil(ssn.channel)
- assert(c.sessions.values.include?(ssn))
-
- destinations = ["one", "two", "three"]
-
- destinations.each { |d| ssn.message_transfer(d) }
-
- destinations.each do |d|
- cmd, header, body = @queue.get(10)
- assert_equal(d, cmd.destination)
- assert_nil(header)
- assert_nil(body)
- end
-
- msg = Qpid::Message.new("this is a test")
- ssn.message_transfer("four", :message => msg)
- cmd, header, body = @queue.get(10)
- assert_equal("four", cmd.destination)
- assert_nil(header)
- assert_equal(msg.body, body)
-
- qq = ssn.queue_query("asdf")
- assert_equal("asdf", qq.queue)
- c.close(5)
- end
-
- def test_close_get
- c = connect
- c.start(10)
- ssn = c.session("test", :timeout => 10)
- echos = ssn.incoming("echo")
-
- 10.times do |i|
- ssn.message_transfer("echo",
- :message => Qpid::Message.new("test#{i}"))
- end
-
- ssn.auto_sync=false
- ssn.message_transfer("abort")
-
- 10.times do |i|
- m = echos.get(timeout=10)
- assert_equal("test#{i}", m.body)
- end
-
- begin
- m = echos.get(timeout=10)
- flunk("Expected Closed")
- rescue Qpid::Closed
- # Ignore
- end
- end
-
- def test_close_listen
- c = connect
- c.start(10)
- ssn = c.session("test", :timeout => 10)
- echos = ssn.incoming("echo")
-
- messages = []
- exceptions = []
- lock = Monitor.new
- condition = lock.new_cond
-
- echos.exc_listen do |e|
- exceptions << e
- lock.synchronize { condition.signal }
- end
- echos.listen do |m|
- messages << m
- end
-
- 10.times do |i|
- ssn.message_transfer("echo",
- :message => Qpid::Message.new("test#{i}"))
- end
- ssn.auto_sync=false
- ssn.message_transfer("abort")
-
- lock.synchronize { condition.wait(10) }
-
- 10.times do |i|
- m = messages.shift
- assert_equal("test#{i}", m.body)
- end
-
- assert_equal(1, exceptions.size)
- end
-
- def test_sync
- c = connect
- c.start(10)
- s = c.session("test")
- s.auto_sync = false
- s.message_transfer("echo",
- :message => Qpid::Message.new("test"))
- s.sync(10)
- end
-end
diff --git a/M4-RCs/qpid/ruby/tests/datatypes.rb b/M4-RCs/qpid/ruby/tests/datatypes.rb
deleted file mode 100644
index 65b1f9e3f5..0000000000
--- a/M4-RCs/qpid/ruby/tests/datatypes.rb
+++ /dev/null
@@ -1,224 +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.
-#
-
-require 'test/unit'
-require 'qpid'
-require 'tests/util'
-
-class TestSerial < Test::Unit::TestCase
-
- def test_cmp
- [0, 0x8FFFFFFF, 0xFFFFFFFF].each do |s|
- s = s.to_serial
- assert(s + 1 > s)
- assert(s - 1 < s)
- assert(s < s + 1)
- assert(s > s - 1)
- end
- last = 0xFFFFFFFF.to_serial
- zero = 0.to_serial
- assert_equal(zero, last + 1)
-
- assert_equal(last, [last, zero].min)
- assert_equal(zero, [last, zero].max)
- end
-
- def test_incr
- s = 0.to_serial
- s += 1
- assert_equal(1.to_serial, s)
- end
-
- def test_in
- l = [1, 2, 3, 4].collect { |i| i.to_serial }
- assert(l.include?(1.to_serial))
- assert(l.include?((0xFFFFFFFF + 2).to_serial))
- assert(l.include?(4))
- end
-
- def test_none
- assert_not_equal(nil, 0.to_serial)
- end
-
- def test_hash
- zero = 0.to_serial
- d = { zero => :zero }
- # FIXME: this does not work, since Ruby looks up the key and does
- # a 0.eql?(zero), which bypasses the Qpid::Serial::eql?
- # assert_equal(:zero, d[0])
- end
-end
-
-class TestRangedSet < Test::Unit::TestCase
-
- def assert_contains(rset, elts, nonelts = [])
- assert_equal(elts, elts.select { |e| rset.include?(e) })
- assert_equal(nonelts, nonelts.select { |e| ! rset.include?(e) })
- end
-
- def assert_ranges(rs, *ranges)
- assert_equal(ranges.size, rs.ranges.size)
- assert( ranges.all? { |rng| rs.include?(rng) } )
- end
-
- def test_simple
- rs = Qpid::RangedSet.new
-
- assert(rs.ranges.empty?)
-
- rs.add(1)
- assert_contains(rs, [1], [0,2])
- assert_ranges(rs, 1..1)
-
- rs.add(2)
- assert_contains(rs, [1,2], [0,3])
- assert_ranges(rs, 1..2)
-
- rs.add(0)
- assert_contains(rs, [0,1,2], [-1, 3])
- assert_ranges(rs, 0..2)
-
- rs.add(37)
- assert_contains(rs, [0,1,2,37], [-1, 3, 36, 38])
- assert_ranges(rs, 0..2, 37..37)
-
- rs.add(-1)
- assert_ranges(rs, -1..2, 37..37)
-
- rs.add(-3)
- assert_ranges(rs, -1..2, 37..37, -3..-3)
-
- rs.add(1, 20)
- assert_contains(rs, [20], [21])
- assert_ranges(rs, -1..20, 37..37, -3..-3)
-
- rs.add(21,36)
- assert_ranges(rs, -1..37, -3..-3)
-
- rs.add(-3, 5)
- assert_ranges(rs, -3..37)
- end
-
- def test_add_self
- a = Qpid::RangedSet.new
- a.add(0, 8)
- assert_ranges(a, 0..8)
-
- a.add(0, 8)
- assert_ranges(a, 0..8)
- end
-end
-
-class TestRange < Test::Unit::TestCase
-
- def test_intersect1
- a = Range.new(0, 10)
- b = Range.new(9, 20)
- i1 = a.intersect(b)
- i2 = b.intersect(a)
- assert_equal(9..10, i1)
- assert_equal(9..10, i2)
- end
-
- def test_intersect2
- a = Range.new(0, 10)
- b = Range.new(11, 20)
- assert_equal(nil, a.intersect(b))
- assert_equal(nil, b.intersect(a))
- end
-
- def test_intersect3
- a = Range.new(0, 10)
- b = Range.new(3, 5)
- i1 = a.intersect(b)
- i2 = b.intersect(a)
- assert_equal(3..5, i1)
- assert_equal(3..5, i2)
- end
-end
-
-class TestUUIDTest < Test::Unit::TestCase
-
- def test_simple
- # this test is kind of lame, but it does excercise the basic
- # functionality of the class
- u = Qpid::UUID::uuid4
- 1024.times { |i| assert_not_equal(u, Qpid::UUID::uuid4) }
- assert_raise NotImplementedError do
- u == 0
- end
- end
-end
-
-class TestMessage < Test::Unit::TestCase
-
- def setup
- @@spec ||= Qpid::Spec010::load()
- @mp = Qpid::struct(@@spec["message_properties"])
- @dp = Qpid::struct(@@spec["delivery_properties"])
- @fp = Qpid::struct(@@spec["fragment_properties"])
- end
-
- def test_has
- m = Qpid::Message.new(@mp, @dp, @fp, "body")
- assert m.has("message_properties")
- assert m.has("delivery_properties")
- assert m.has("fragment_properties")
- end
-
- def test_get
- m = Qpid::Message.new(@mp, @dp, @fp, "body")
- assert_same(@mp, m.get("message_properties"))
- assert_same(@dp, m.get("delivery_properties"))
- assert_same(@fp, m.get("fragment_properties"))
- end
-
- def test_set
- m = Qpid::Message.new(@mp, @dp, "body")
- assert_nil m.get("fragment_properties")
- m.set(@fp)
- assert_same(@fp, m.get("fragment_properties"), "4")
- end
-
- def test_set_on_empty
- m = Qpid::Message.new("body")
- assert_nil m.get("delivery_properties")
- m.set(@dp)
- assert_same(@dp, m.get("delivery_properties"), "5")
- end
-
- def test_set_replace
- m = Qpid::Message.new(@mp, @dp, @fp, "body")
- dp = Qpid::struct(@@spec["delivery_properties"])
- assert_same(@dp, m.get("delivery_properties"), "6")
- m.set(dp)
- assert_same(dp, m.get("delivery_properties"), "7")
- end
-
- def test_clear
- m = Qpid::Message.new(@mp, @dp, @fp, "body")
- assert_same(@mp, m.get("message_properties"), "8")
- assert_same(@dp, m.get("delivery_properties"), "9")
- assert_same(@fp, m.get("fragment_properties"), "10")
- m.clear("fragment_properties")
- assert_nil m.get("fragment_properties")
- assert_same(@mp, m.get("message_properties"), "11")
- assert_same(@dp, m.get("delivery_properties"), "12")
- end
-end
diff --git a/M4-RCs/qpid/ruby/tests/framer.rb b/M4-RCs/qpid/ruby/tests/framer.rb
deleted file mode 100644
index 1d56f2faf1..0000000000
--- a/M4-RCs/qpid/ruby/tests/framer.rb
+++ /dev/null
@@ -1,99 +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.
-#
-
-require "test/unit"
-require "qpid"
-require 'tests/util'
-
-require 'logger'
-
-class TestFramer < Test::Unit::TestCase
-
- include Test
-
- def setup
- #Qpid::raw_logger = Logger.new(STDOUT)
- #Qpid::frm_logger = Logger.new(STDOUT)
-
- @server = Util::ServerThread.new do |socket|
- conn = Qpid::Framer.new(socket)
- begin
- h = conn.read_header
- conn.write_header(h[-2], h[-1])
- loop do
- frame = conn.read_frame
- conn.write_frame(frame)
- conn.flush
- end
- rescue Qpid::Closed
- nil # Ignore
- end
- end
- end
-
- def teardown
- @server.finish
- @server.join
- end
-
- Frame = Qpid::Frame
-
- def test_framer
- c = Qpid::Framer.new(@server.client)
-
- c.write_header(0, 10)
- assert_equal( ["AMQP", 1, 1, 0, 10], c.read_header())
-
- c.write_frame(Frame.new(Qpid::FIRST_FRM, 1, 2, 3, "THIS"))
- c.write_frame(Frame.new(0, 1, 2, 3, "IS"))
- c.write_frame(Frame.new(0, 1, 2, 3, "A"))
- c.write_frame(Frame.new(Qpid::LAST_FRM, 1, 2, 3, "TEST"))
- c.flush()
-
- f = c.read_frame
- assert(f.first_frame?)
- assert(! f.last_frame?)
- assert_equal(1, f.type)
- assert_equal(2, f.track)
- assert_equal(3, f.channel)
- assert_equal("THIS", f.payload)
-
- f = c.read_frame
- assert_equal(0, f.flags)
- assert_equal(1, f.type)
- assert_equal(2, f.track)
- assert_equal(3, f.channel)
- assert_equal("IS", f.payload)
-
- f = c.read_frame
- assert_equal(0, f.flags)
- assert_equal(1, f.type)
- assert_equal(2, f.track)
- assert_equal(3, f.channel)
- assert_equal("A", f.payload)
-
- f = c.read_frame
- assert(f.last_frame?)
- assert(! f.first_frame?)
- assert_equal(1, f.type)
- assert_equal(2, f.track)
- assert_equal(3, f.channel)
- assert_equal("TEST", f.payload)
- end
-end
diff --git a/M4-RCs/qpid/ruby/tests/qmf.rb b/M4-RCs/qpid/ruby/tests/qmf.rb
deleted file mode 100644
index 75250a7938..0000000000
--- a/M4-RCs/qpid/ruby/tests/qmf.rb
+++ /dev/null
@@ -1,187 +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.
-#
-
-require "test/unit"
-require "qpid"
-require "tests/util"
-require "socket"
-
-class QmfTest < Test::Unit::TestCase
-
- def setup()
- # Make sure errors in threads lead to a noisy death of the test
- Thread.abort_on_exception = true
-
- sock = TCPSocket.new('localhost', 5672)
-
- @conn = Qpid::Connection.new(sock)
- @conn.start()
-
- @session = @conn.session("test-session")
-
- # It's a bit odd that we're using two connections but that's the way
- # the python one works afaict.
- @qmf = Qpid::Qmf::Session.new()
- @qmf_broker = @qmf.add_broker("amqp://localhost:5672")
-
- brokers = @qmf.objects(:class => "broker")
- assert_equal(1, brokers.length)
- @broker = brokers[0]
- end
-
- def teardown
- unless @session.error?
- @session.close(10)
- end
- @conn.close(10)
- if @qmf
- @qmf.del_broker(@qmf_broker)
- end
- end
-
- def test_broker_connectivity()
- body = "Echo Message Body"
- for seq in 1..10
- res = @broker.echo(seq, body)
- assert_equal(0, res.status)
- assert_equal("OK", res.text)
- assert_equal(seq, res.sequence)
- assert_equal(body, res.body)
- end
- end
-
- def test_move_queued_messages()
- """
- Test ability to move messages from the head of one queue to another.
- Need to test moveing all and N messages.
- """
-
- "Set up source queue"
- @session.queue_declare(:queue => "src-queue", :exclusive => true, :auto_delete => true)
- @session.exchange_bind(:queue => "src-queue", :exchange => "amq.direct", :binding_key => "routing_key")
-
- props = @session.delivery_properties(:routing_key => "routing_key")
- for count in 1..20
- body = "Move Message %d" % count
- src_msg = Qpid::Message.new(props, body)
- @session.message_transfer(:destination => "amq.direct", :message => src_msg)
- end
-
- "Set up destination queue"
- @session.queue_declare(:queue => "dest-queue", :exclusive => true, :auto_delete => true)
- @session.exchange_bind(:queue => "dest-queue", :exchange => "amq.direct")
-
- queues = @qmf.objects(:class => "queue")
-
- "Move 10 messages from src-queue to dest-queue"
- result = @qmf.objects(:class => "broker")[0].queueMoveMessages("src-queue", "dest-queue", 10)
- assert_equal(0, result.status)
-
- sq = @qmf.objects(:class => "queue", "name" => "src-queue")[0]
- dq = @qmf.objects(:class => "queue", "name" => "dest-queue")[0]
-
- assert_equal(10, sq.msgDepth)
- assert_equal(10, dq.msgDepth)
-
- "Move all remaining messages to destination"
- result = @qmf.objects(:class => "broker")[0].queueMoveMessages("src-queue", "dest-queue", 0)
- assert_equal(0, result.status)
-
- sq = @qmf.objects(:class => "queue", 'name' => "src-queue")[0]
- dq = @qmf.objects(:class => "queue", 'name' => "dest-queue")[0]
-
- assert_equal(0, sq.msgDepth)
- assert_equal(20, dq.msgDepth)
-
- "Use a bad source queue name"
- result = @qmf.objects(:class => "broker")[0].queueMoveMessages("bad-src-queue", "dest-queue", 0)
- assert_equal(4, result.status)
-
- "Use a bad destination queue name"
- result = @qmf.objects(:class => "broker")[0].queueMoveMessages("src-queue", "bad-dest-queue", 0)
- assert_equal(4, result.status)
-
- " Use a large qty (40) to move from dest-queue back to "
- " src-queue- should move all "
- result = @qmf.objects(:class => "broker")[0].queueMoveMessages("dest-queue", "src-queue", 40)
- assert_equal(0, result.status)
-
- sq = @qmf.objects(:class => "queue", 'name' => "src-queue")[0]
- dq = @qmf.objects(:class => "queue", 'name' => "dest-queue")[0]
-
- assert_equal(20, sq.msgDepth)
- assert_equal(0, dq.msgDepth)
-
- "Consume the messages of the queue and check they are all there in order"
- @session.message_subscribe(:queue => "src-queue",
- :destination => "tag")
- @session.message_flow(:destination => "tag",
- :unit => @session.message_credit_unit.message,
- :value => 0xFFFFFFFF)
- @session.message_flow(:destination => "tag",
- :unit => @session.message_credit_unit.byte,
- :value => 0xFFFFFFFF)
- queue = @session.incoming("tag")
- for count in 1..20
- consumed_msg = queue.get(timeout=1)
- body = "Move Message %d" % count
- assert_equal(body, consumed_msg.body)
- end
- end
-
- # Test ability to purge messages from the head of a queue. Need to test
- # moveing all, 1 (top message) and N messages.
- def test_purge_queue
- # Set up purge queue"
- @session.queue_declare(:queue => "purge-queue",
- :exclusive => true,
- :auto_delete => true)
- @session.exchange_bind(:queue => "purge-queue",
- :exchange => "amq.direct",
- :binding_key => "routing_key")
-
- props = @session.delivery_properties(:routing_key => "routing_key")
- 20.times do |count|
- body = "Purge Message %d" % count
- msg = Qpid::Message.new(props, body)
- @session.message_transfer(:destination => "amq.direct",
- :message => msg)
- end
-
- pq = @qmf.objects(:class => "queue", 'name' => "purge-queue")[0]
-
- "Purge top message from purge-queue"
- result = pq.purge(1)
- assert_equal(0, result.status)
- pq = @qmf.objects(:class => "queue", 'name' => "purge-queue")[0]
- assert_equal(19, pq.msgDepth)
-
- "Purge top 9 messages from purge-queue"
- result = pq.purge(9)
- assert_equal(0, result.status)
- pq = @qmf.objects(:class => "queue", 'name' => "purge-queue")[0]
- assert_equal(10, pq.msgDepth)
-
- "Purge all messages from purge-queue"
- result = pq.purge(0)
- assert_equal(0, result.status)
- pq = @qmf.objects(:class => "queue", 'name' => "purge-queue")[0]
- assert_equal(0, pq.msgDepth)
- end
-end
diff --git a/M4-RCs/qpid/ruby/tests/queue.rb b/M4-RCs/qpid/ruby/tests/queue.rb
deleted file mode 100644
index 4ec0e07ffb..0000000000
--- a/M4-RCs/qpid/ruby/tests/queue.rb
+++ /dev/null
@@ -1,80 +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.
-#
-
-require 'test/unit'
-require 'qpid'
-
-class TestQueue < Test::Unit::TestCase
-
- # The qpid queue class just provides sime simple extensions to
- # python's standard queue data structure, so we don't need to test
- # all the queue functionality.
-
- def setup
- # Make sure errors in threads lead to a noisy death of the test
- Thread.abort_on_exception = true
- end
-
- def test_listen
- values = []
- heard = Qpid::Util::Event.new
-
- listener = Proc.new do |x|
- values << x
- heard.set
- end
-
- q = Qpid::Queue.new
- q.listen(&listener)
-
- heard.clear
- q.put(1)
- heard.wait
- assert_equal([1], values)
- heard.clear
- q.put(2)
- heard.wait
- assert_equal([1, 2], values)
-
- q.listen
- q.put(3)
- assert_equal(3, q.get)
-
- q.listen(&listener)
- heard.clear
- q.put(4)
- heard.wait
- assert_equal([1,2,4], values)
- end
-
- def test_close
- q = Qpid::Queue.new
- (1..3).each { |i| q.put(i) }
- q.close
- assert_equal(1, q.get)
- assert_equal(2, q.get)
- assert_equal(3, q.get)
- 10.times do |i|
- assert_raises(Qpid::Closed) do
- q.get
- end
- end
- end
-
-end
diff --git a/M4-RCs/qpid/ruby/tests/spec010.rb b/M4-RCs/qpid/ruby/tests/spec010.rb
deleted file mode 100644
index 6db1523455..0000000000
--- a/M4-RCs/qpid/ruby/tests/spec010.rb
+++ /dev/null
@@ -1,80 +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.
-#
-
-require "test/unit"
-require "qpid/test"
-require "qpid/spec010"
-
-class SpecTest < Test::Unit::TestCase
-
- def setup()
- @spec = Qpid::Spec010.load()
- end
-
- def testSessionHeader()
- hdr = @spec[:header]
- sc = Qpid::StringCodec.new(@spec)
- hdr.encode(sc, Qpid::struct(hdr, :sync=>true))
- assert sc.encoded == "\x01\x01"
-
- sc = Qpid::StringCodec.new(@spec)
- hdr.encode(sc, Qpid::struct(hdr, :sync=>false))
- assert sc.encoded == "\x01\x00"
- end
-
- def encdec(type, value)
- sc = Qpid::StringCodec.new(@spec)
- type.encode(sc, value)
- decoded = type.decode(sc)
- return decoded
- end
-
- def testMessageProperties()
- mp = @spec[:message_properties]
- rt = @spec[:reply_to]
-
- props = Qpid::struct(mp,
- :content_length=>3735928559,
- :reply_to=>Qpid::struct(rt,
- :exchange=>"the exchange name",
- :routing_key=>"the routing key"))
- dec = encdec(mp, props)
- assert props.content_length == dec.content_length
- assert props.reply_to.exchange == dec.reply_to.exchange
- assert props.reply_to.routing_key == dec.reply_to.routing_key
- end
-
- def testMessageSubscribe()
- ms = @spec[:message_subscribe]
- cmd = Qpid::struct(ms, :exclusive=>true, :destination=>"this is a test")
- dec = encdec(@spec[:message_subscribe], cmd)
- assert cmd.exclusive == dec.exclusive
- assert cmd.destination == dec.destination
- end
-
- def testXid()
- xid = @spec[:xid]
- sc = Qpid::StringCodec.new(@spec)
- st = Qpid::struct(xid, :format=>0, :global_id=>"gid", :branch_id=>"bid")
- xid.encode(sc, st)
- assert sc.encoded == "\x00\x00\x00\x10\x06\x04\x07\x00\x00\x00\x00\x00\x03gid\x03bid"
- assert xid.decode(sc) == st
- end
-
-end
diff --git a/M4-RCs/qpid/ruby/tests/util.rb b/M4-RCs/qpid/ruby/tests/util.rb
deleted file mode 100644
index b22a6bab2f..0000000000
--- a/M4-RCs/qpid/ruby/tests/util.rb
+++ /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.
-#
-
-require 'thread'
-require 'socket'
-
-module Util
-
- TOPDIR = File::dirname(File::dirname(File::expand_path(__FILE__)))
- SPEC = File::join(TOPDIR, "specs", "amqp.0-10-qpid-errata.xml")
-
- PORT = 1234
- HOST = "0.0.0.0"
-
- def self.connect(host = HOST, port = PORT)
- TCPSocket.new(host, port)
- end
-
- class ServerThread < Thread
- def initialize(&block)
- @sockets = []
- @running = Mutex.new
- started = Qpid::Util::Event.new
- super(started, @running) do |started, running|
- tcp_srv = TCPServer.new(HOST, PORT)
- begin
- started.set
- while ! running.locked? and (session = tcp_srv.accept)
- yield(session)
- end
- rescue Exception => e
- # Exceptions in the server thread are hard to see
- # Make sure they apear loudly on the console
- $stderr.puts "#{ "*" * 20} Server exception #{ "*" * 20}"
- $stderr.puts e.message
- $stderr.puts e.backtrace
- raise
- ensure
- tcp_srv.close
- end
- end
- started.wait
- end
-
- def finish
- @running.lock
- @sockets.each { |sock| sock.close unless sock.closed? }
- end
-
- def client(host = HOST, port = PORT)
- sock = Util::connect(host, port)
- @sockets << sock
- sock
- end
- end
-end
diff --git a/M4-RCs/qpid/ruby/tests_0-8/basic.rb b/M4-RCs/qpid/ruby/tests_0-8/basic.rb
deleted file mode 100644
index 10a43b1aab..0000000000
--- a/M4-RCs/qpid/ruby/tests_0-8/basic.rb
+++ /dev/null
@@ -1,69 +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.
-#
-
-require "test/unit"
-require "qpid/test"
-require "qpid"
-
-class Basic < Test::Unit::TestCase
-
- include Qpid08::Test
-
- def publish(body, headers = {})
- cli = connect()
- ch = cli.channel(1)
- ch.channel_open()
- content = Qpid08::Content.new(headers, body)
- ch.basic_publish(:content => content)
- msg = ch.channel_close()
- assert msg.method.qname == :channel_close_ok
- end
-
- def consume(body, headers = {})
- cli = connect()
- ch = cli.channel(1)
- ch.channel_open()
- ch.queue_declare(:queue => "test-queue")
- ch.queue_bind(:queue_name => "test-queue")
- ch.basic_consume(:queue => "test-queue", :consumer_tag => "ctag")
- content = Qpid08::Content.new(headers, body)
- ch.basic_publish(:routing_key => "test-queue", :content => content)
- queue = cli.queue("ctag")
- msg = queue.pop()
- assert content.headers == msg.content.headers
- assert content.body == msg.content.body
- assert content.children == msg.content.children
- ch.basic_ack(msg.delivery_tag)
- msg = ch.channel_close()
- assert msg.method.qname == :channel_close_ok
- end
-
- def test_publish(); publish("hello world") end
-
- def test_publish_empty(); publish("") end
-
- def test_publish_headers(); publish("hello world", :content_type => "text/plain") end
-
- def test_consume(); consume("hello world") end
-
- def test_consume_empty(); consume("") end
-
- def test_consume_headers(); consume("hello_world", :content_type => "text/plain") end
-
-end
diff --git a/M4-RCs/qpid/ruby/tests_0-8/channel.rb b/M4-RCs/qpid/ruby/tests_0-8/channel.rb
deleted file mode 100644
index 1eea8f18d9..0000000000
--- a/M4-RCs/qpid/ruby/tests_0-8/channel.rb
+++ /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.
-#
-
-require "test/unit"
-require "qpid/test"
-require "qpid"
-
-class Channel < Test::Unit::TestCase
-
- include Qpid08::Test
-
- def test_channel_open_close()
- c = connect()
- ch = c.channel(1)
- msg = ch.channel_open()
- assert msg.method.qname == :channel_open_ok
- msg = ch.channel_close()
- assert msg.method.qname == :channel_close_ok
- end
-
- def test_channel_close()
- c = connect()
- ch = c.channel(1)
- begin
- ch.channel_close()
- rescue Qpid::Closed => e
- assert c.code.method.qname == :connection_close
- assert c.code.reply_code == 504
- end
- end
-
-end
diff --git a/M4-RCs/qpid/specs/LICENSE b/M4-RCs/qpid/specs/LICENSE
deleted file mode 100644
index f8c0d5d1ba..0000000000
--- a/M4-RCs/qpid/specs/LICENSE
+++ /dev/null
@@ -1,325 +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.
-=========================================================================
-== AMQP License ==
-=========================================================================
-Copyright Notice
- ================
- (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc.,
- iMatix Corporation, IONA\ufffd Technologies, Red Hat, Inc.,
- TWIST Process Innovations, and 29West Inc. 2006. All rights reserved.
-
- License
- =======
- JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
- Corporation, IONA Technologies, Red Hat, Inc., TWIST Process Innovations, and
- 29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide,
- perpetual, royalty-free, nontransferable, nonexclusive license to
- (i) copy, display, distribute and implement the Advanced Messaging Queue Protocol
- ("AMQP") Specification and (ii) the Licensed Claims that are held by
- the Authors, all for the purpose of implementing the Advanced Messaging
- Queue Protocol Specification. Your license and any rights under this
- Agreement will terminate immediately without notice from
- any Author if you bring any claim, suit, demand, or action related to
- the Advanced Messaging Queue Protocol Specification against any Author.
- Upon termination, you shall destroy all copies of the Advanced Messaging
- Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or
- patent application, throughout the world, excluding design patents and
- design registrations, owned or controlled, or that can be sublicensed
- without fee and in compliance with the requirements of this
- Agreement, by an Author or its affiliates now or at any
- future time and which would necessarily be infringed by implementation
- of the Advanced Messaging Queue Protocol Specification. A claim is
- necessarily infringed hereunder only when it is not possible to avoid
- infringing it because there is no plausible non-infringing alternative
- for implementing the required portions of the Advanced Messaging Queue
- Protocol Specification. Notwithstanding the foregoing, Licensed Claims
- shall not include any claims other than as set forth above even if
- contained in the same patent as Licensed Claims; or that read solely
- on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging
- Queue Protocol Specification, or that, if licensed, would require a
- payment of royalties by the licensor to unaffiliated third parties.
- Moreover, Licensed Claims shall not include (i) any enabling technologies
- that may be necessary to make or use any Licensed Product but are not
- themselves expressly set forth in the Advanced Messaging Queue Protocol
- Specification (e.g., semiconductor manufacturing technology, compiler
- technology, object oriented technology, networking technology, operating
- system technology, and the like); or (ii) the implementation of other
- published standards developed elsewhere and merely referred to in the
- body of the Advanced Messaging Queue Protocol Specification, or
- (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced
- Messaging Queue Protocol Specification. For purposes of this definition,
- the Advanced Messaging Queue Protocol Specification shall be deemed to
- include both architectural and interconnection requirements essential
- for interoperability and may also include supporting source code artifacts
- where such architectural, interconnection requirements and source code
- artifacts are expressly identified as being required or documentation to
- achieve compliance with the Advanced Messaging Queue Protocol Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions
- of products (hardware, software or combinations thereof) that implement
- and are compliant with all relevant portions of the Advanced Messaging
- Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any
- use you may make of the Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS,"
- AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
- IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE
- CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE
- SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY
- PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
- USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE
- PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner,
- including advertising or publicity pertaining to the Advanced Messaging
- Queue Protocol Specification or its contents without specific, written
- prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you
- shall destroy all copies of the Advanced Messaging Queue Protocol
- Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the
- Octagon Symbol are trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA
- Technologies PLC and/or its subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered
- trademarks of Red Hat, Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of
- Sun Microsystems, Inc. in the United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service
- marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
diff --git a/M4-RCs/qpid/specs/NOTICE b/M4-RCs/qpid/specs/NOTICE
deleted file mode 100644
index 0e59eb3131..0000000000
--- a/M4-RCs/qpid/specs/NOTICE
+++ /dev/null
@@ -1,7 +0,0 @@
-// ------------------------------------------------------------------
-// NOTICE file corresponding to the section 4d of The Apache License,
-// Version 2.0,
-// ------------------------------------------------------------------
-
-Apache Qpid
-Copyright 2006-2008 Apache Software Foundation
diff --git a/M4-RCs/qpid/specs/amqp-dtx-preview.0-9.xml b/M4-RCs/qpid/specs/amqp-dtx-preview.0-9.xml
deleted file mode 100644
index dd70e91d1d..0000000000
--- a/M4-RCs/qpid/specs/amqp-dtx-preview.0-9.xml
+++ /dev/null
@@ -1,1077 +0,0 @@
-<?xml version = "1.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 major = "0" minor = "9" port = "5672" comment = "AMQ Protocol version 0-9">
-
- <!-- == DTX SUPPORT, 0-10 PREVIEW ========================================== -->
-
-
-<!--
- This xml describes the dtx classes: dtxDemarcation and dtxCoordination
- version: 1.6 by Arnaud Simon
--->
-
- <!--
- ======================================================
- == CONSTANTS
- ======================================================
- -->
-
- <!-- XA constants -->
-
- <constant name = "xa-rbrollback" value = "1">
- <doc>
- The rollback was caused by an unspecified reason.
- </doc>
- </constant>
- <constant name = "xa-rbtimeout" value = "2">
- <doc>
- A transaction branch took too long.
- </doc>
- </constant>
- <constant name = "xa-heurhaz" value = "3">
- <doc>
- The transaction branch may have been heuristically completed.
- </doc>
- </constant>
- <constant name = "xa-heurcom" value = "4">
- <doc>
- The transaction branch has been heuristically committed.
- </doc>
- </constant>
- <constant name = "xa-heurrb" value = "5">
- <doc>
- The transaction branch has been heuristically rolled back.
- </doc>
- </constant>
- <constant name = "xa-heurmix" value = "6">
- <doc>
- The transaction branch has been heuristically committed and rolled back.
- </doc>
- </constant>
- <constant name = "xa-rdonly" value = "7">
- <doc>
- The transaction branch was read-only and has been committed.
- </doc>
- </constant>
- <constant name = "xa-ok" value = "8">
- <doc>
- Normal execution.
- </doc>
- </constant>
-
-
- <!--
- ======================================================
- == DOMAIN TYPES
- ======================================================
- -->
-
- <domain name = "Xid" type = "longstr" label = "Transaction branch identifier">
- <doc>
- An Xid uniquely identifies a transaction branch.
- </doc>
- <rule name = "implementation">
- <doc>
- Xid contains a format identifier, two length fields and a data field:
- format_id long
- gtrid_length octet
- bqual_length octet
- data
-
- format_id is an implementation specific format identifier
- the data field is a sequence of octets of at most 128 bytes containing the txn id and the branch id
- gtrid_length field indicates how many bytes of this form the transaction id
- bqual_length field indicates how many bytes of this form the branch id
- The sum of the two lengths must equal the length of the data field
- </doc>
- </rule>
- </domain>
-
- <!-- == dtx-demarcation ========================================================== -->
-
-
- <class name = "dtx-demarcation" handler = "channel" index = "101" label = "demarcates distributed transaction branches">
- <doc>
- This class is part of the X-Open XA distributed transaction protocol support. It allows a channel to be
- selected for use with distributed transactions and the transactional boundaries for work on that channel
- to be demarcated.
- </doc>
- <doc type = "grammar">
- dtx-demarcation = C:SELECT S:SELECT-OK *demarcation
-
- demarcation = C:START S:START-OK C:END S:END-OK
- </doc>
-
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <rule name = "access-control">
- <doc>
- Access-tickets are propagated with XA association methods with the aim of
- restricting which users are allowed to control which transactions.
- The server MAY restrict transaction association to a particular identity.
- </doc>
- </rule>
-
- <rule name = "transactionality">
- <doc>
- Enabling XA transaction support on a channel implies that the server MUST manage transactions demarcated by start-end blocks. That is to say that on this XA-enabled channel, work undergone within transactional blocks is performed on behalf a transaction branch whereas work performed outside of transactional blocks is NOT transactional.
- </doc>
- </rule>
-
-
- <!-- - - - SELECT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "select" synchronous = "1" index = "10" label = "select distributed transaction mode">
- <doc>
- This method sets the channel to use distributed transactions. The client must use this method at least once on a channel before using XA demarcation operations.
- </doc>
- <chassis name = "server" implement = "MAY" />
- <response name = "select-ok" />
- </method>
-
- <!-- - - - SELECT-OK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "select-ok" synchronous = "1" index = "11" label = "confirm distributed transaction mode">
- <doc>
- This method confirms to the client that the channel was successfully set to use distributed transactions.
- </doc>
- <chassis name = "client" implement = "MAY" />
- </method>
-
- <!-- - - START - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "start" synchronous = "1" index = "20" label = "Start a transaction branch">
- <doc>
- This method is called when messages should be produced and consumed on behalf a transaction branch identified by xid.
- </doc>
- <chassis name = "server" implement = "MAY" />
- <response name = "start-ok" />
- <!-- rules -->
- <rule name = "commandInvalid ">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
- <rule name = "alreadyAssociated">
- <doc>
- If neither join nor resume is specified is specified and the transaction branch specified by xid has previously been seen then the server MUST raise a channel exception with reply code 530 (not allowed).
- </doc>
- </rule>
- <rule name = "joinAndresume">
- <doc>
- If join and resume are specified then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <field name = "ticket" domain = "access-ticket" label = "Access-ticket granted by the server for a specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "xid" domain = "Xid" label = "Start any work associated with transaction branch with Xid xid">
- <doc>
- Specifies the xid of the transaction branch to be started.
- </doc>
- <assert check = "notnull" />
- <!-- rules -->
- <rule name = "unknownXid">
- <doc>
- If Xid is already known by the broker then the server MUST raise a channel exception with reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "join" domain = "bit" label = "Indicate whether this is joining an already associated Xid">
- <doc>
- Indicate that the start applies to joining a transaction previously seen.
- </doc>
- <!-- rules -->
- <rule name = "unsupported">
- <doc>
- If the broker does not support join the server MUST raise a channel exception with reply code 540 (not implemented).
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
-
- <field name = "resume" domain = "bit" label = "Indicate whether this is resuming a suspended transaction branch">
- <doc>
- Indicate that the start applies to resuming a suspended transaction branch specified.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - - START-OK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "start-ok" synchronous = "1" index = "21" label = "confirm distributed transaction start">
- <doc>
- This method confirms to the client that the transaction branch is started or specify the error condition.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "flags" domain = "short" label = "xa-ok or xa-rbrollback">
- <doc>
- xa-ok: Normal execution.
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified reason.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
-
- <!-- - - END - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "end" synchronous = "1" index = "30" label = "End a transaction branch">
- <doc>
- This method is called when the work done on behalf a transaction branch finishes or needs to be suspended.
- </doc>
- <chassis name = "server" implement = "MAY" />
- <response name = "end-ok" />
-
- <rule name = "commandInvalid ">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <rule name = "suspendAndfail">
- <doc>
- If suspend and fail are specified then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <rule name = "internalError ">
- <doc>
- If an error occurs in ending the transaction branch then the server MUST raise a channel exception with reply code 541 (internal error)
- </doc>
- </rule>
-
- <rule name = "success ">
- <doc>
- If neither fail nor suspend are specified then the portion of work has completed successfully
- </doc>
- </rule>
-
- <field name = "ticket" domain = "access-ticket" label = "Access-ticket granted by the server for a specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "xid" domain = "Xid" label = "End any work associated with transaction branch with Xid xid">
- <doc>
- Specifies the xid of the transaction branch to be ended.
- </doc>
- <assert check = "notnull" />
- <!-- rules -->
- <rule name = "unknownXid">
- <doc>
- If Xid is unknown (the transaction branch has not been started or has already been ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
- </field>
-
- <field name = "fail" domain = "bit" label = "Indicate whether the portion of work has failed">
- <doc>
- Indicates that the portion of work has failed otherwise the portion of work has completed successfully.
- </doc>
- <rule name = "failure">
- <doc>
- If fail is specified then the transaction should be marked as rollback-only.
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
-
- <field name = "suspend" domain = "bit" label = "Indicate that the transaction branch is temporarily suspended in an incomplete state">
- <doc>
- Indicates that the transaction branch is temporarily suspended in an incomplete state.
- </doc>
- <rule name = "resume">
- <doc>
- The transaction context is in a suspended state and must be resumed via the start method with resume specified.
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
-
- </method>
-
- <!-- - - - END-OK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "end-ok" synchronous = "1" index = "31" label = "confirm distributed transaction end">
- <doc>
- This method confirms to the client that the transaction branch is ended or specify the error condition.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "flags" domain = "short" label = "xa-ok, xa-rbrollback, xa-rbtimeout">
- <doc>
- xa-ok: Normal execution.
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified reason.
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
- </class>
-
- <!-- == dtx-coordination ========================================================== -->
-
-
- <class name = "dtx-coordination" handler = "channel" index = "105" label = "coordinate transaction outcomes">
- <doc>
- This class is part of the X-Open XA distributed transaction protocol support.
- It allows the transaction manager to coordinate transaction outcomes.
- </doc>
-
- <doc type = "grammar">
-
- dtx-coordination = *coordination
-
- coordination = command
- / outcome
- / recovery
-
- command = C:SET-TIMEOUT S:SET-TIMEOUT-OK
- / C:GET-TIMEOUT S:GET-TIMEOUT-OK
-
- outcome = one-phase-commit
- / one-phase-rollback
- / two-phase-commit
- / two-phase-rollback
-
- one-phase-commit = C:COMMIT S:COMMIT-OK
-
- one-phase-rollback = C:ROLLBACK S:ROLLBACK-OK
-
- two-phase-commit = C:PREPARE S:PREPARE-OK C:COMMIT S:COMMIT-OK
-
- two-phase-rollback = C:PREPARE S:PREPARE-OK C:ROLLBACK S:ROLLBACK-OK
-
- recovery = C:RECOVER S:RECOVER-OK *recovery-outcome
-
- recovery-outcome = one-phase-commit
- / one-phase-rollback
- / C:FORGET S:FORGET-OK
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <rule name = "security">
- <doc>
- Access-tickets are propagated with XA demarcation methods with the aim of
- restricting which users are allowed to control which transactions.
- The server MAY restrict transaction coordination to a particular identity.
- </doc>
- <doc type = "scenario">
- </doc>
- </rule>
-
-
- <!-- - - COMMIT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "commit" synchronous = "1" index = "10" label = "Commit the work done on behalf a transaction branch ">
- <doc>
- This method commits the work associated with xid. Any produced messages are made available and any consumed messages are discarded.
- </doc>
- <chassis name = "server" implement = "MAY" />
- <response name = "commit-ok" />
-
- <rule name = "internalError">
- <doc>
- If an error occurs in committing the transaction branch then the server MUST raise a channel exception with reply code 541 (internal error)
- </doc>
- </rule>
-
- <rule name = "commandInvalid">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <field name = "ticket" domain = "access-ticket" label = "Access-ticket granted by the server for a specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "xid" domain = "Xid" label = "Commit the work associated with Xid xid">
- <doc>
- Specifies the Xid of the transaction branch to be committed.
- </doc>
- <assert check = "notnull" />
- <!-- rules -->
- <rule name = "unknownXid">
- <doc>
- If Xid is unknown (the transaction branch has not been started or has already been ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
- <rule name = "notdisassociated">
- <doc>
- If this method is called when Xid is still associated with a channel then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
- </field>
-
- <field name = "one-phase" domain = "bit" label = "Indicate that one-phase optimization must be used">
- <doc>
- When set then one-phase commit optimization is used.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - - COMMIT-OK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "commit-ok" synchronous = "1" index = "11" label = "confirm distributed transaction commit">
- <doc>
- This method confirms to the client that the transaction branch is committed or specify the error condition.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "flags" domain = "short" label = "xa-ok, xa-heurhaz, xa-heurcom, xa-heurrb, xa-heurmix, xa-rbrollback">
- <doc>
- xa-ok: Normal execution,
- xa-heurhaz: Due to some failure, the work done on behalf of the specified transaction branch may have been heuristically completed.
- xa-heurcom: Due to a heuristic decision, the work done on behalf of the specified transaction
- branch was committed.
- xa-heurrb: Due to a heuristic decision, the work done on behalf of the specified transaction
- branch was rolled back.
- xa-heurmix: Due to a heuristic decision, the work done on behalf of the specified transaction
- branch was partially committed and partially rolled back.
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified reason.
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
-
- <!-- - - FORGET - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "forget" synchronous = "1" index = "20" label = "Discard knowledge of a heuristically-completed transaction branch">
- <doc>
- This method is called to forget about a heuristically completed transaction branch.
- </doc>
- <chassis name = "server" implement = "MAY" />
- <response name = "forget-ok" />
-
- <rule name = "internalError ">
- <doc>
- If an error occurs in forgetting the transaction branch then the server MUST raise a channel exception with reply code 541 (internal error)
- </doc>
- </rule>
-
- <rule name = "commandInvalid ">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <field name = "ticket" domain = "access-ticket" label = "Access-ticket granted by the server for a specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "xid" domain = "Xid" label = "Erase RM its knowledge of Xid xid">
- <doc>
- Specifies the xid of the transaction branch to be forgotten.
- </doc>
- <assert check = "notnull" />
- <!-- rules -->
- <rule name = "unknownXid">
- <doc>
- If Xid is unknown (the transaction branch has not been started or has already been ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
- <rule name = "notdisassociated">
- <doc>
- If this method is called when Xid is still associated with a channel then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - FORGET-OK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "forget-ok" synchronous = "1" index = "21" label = "Confirm distributed transaction forget">
- <doc>
- This method confirms to the client that the transaction branch is forgotten or specify the error condition.
- </doc>
- <chassis name = "client" implement = "MAY" />
- </method>
-
- <!-- - - - get-Timeout - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "get-timeout" synchronous = "1" index = "30" label = "Obtain the transaction timeout value in seconds">
- <doc>
- This method obtains the current transaction timeout value in seconds.
- If setTimeout was not used prior to invoking this method, the return value is the default timeout; otherwise, the value used in the previous setTimeout call is returned.
- </doc>
- <chassis name = "server" implement = "MAY" />
- <response name = "get-timeout-ok" />
-
-
- <field name = "xid" domain = "Xid" label = "Xid of the branch to get the timeout value">
- <doc>
- Specifies the Xid of the transaction branch for getting the timeout.
- </doc>
- <assert check = "notnull" />
- <!-- rules -->
- <rule name = "unknownXid">
- <doc>
- If Xid is unknown (the transaction branch has not been started or has already been ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
- </field>
-
- <rule name = "internalError ">
- <doc>
- If an error occurs in setting the transaction timeout then the server MUST raise a channel exception with reply code 541 (internal error)
- </doc>
- </rule>
- </method>
-
- <!-- - - - get-Timeout-OK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "get-timeout-ok" synchronous = "1" index = "31" label = "Return transaction timeout">
- <doc>
- This method returns the current transaction timeout value in seconds.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "timeout" domain = "long" label = "The current transaction timeout value">
- <doc>
- The current transaction timeout value in seconds.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - PREPARE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "prepare" synchronous = "1" index = "40" label = "Ask to prepare a transaction branch">
- <doc>
- This method prepares for commitment any message produced or consumed on behalf of xid.
- </doc>
-
- <rule name = "internalError">
- <doc>
- If an error occurs in preparing the transaction branch then the server MUST raise a channel exception with reply code 541 (internal error). The specified Xid may or may not have been prepared.
- </doc>
- </rule>
-
- <rule name = "commandInvalid">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <rule name = "obligation1">
- <doc>
- Once this method successfully returns it is guaranteed that the transaction branch may be either
- committed or rolled back regardless of failures.
- </doc>
- </rule>
-
- <rule name = "obligation2">
- <doc>
- The knowledge of xid cannot be erased before commit or rollback complete the branch.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MAY" />
- <response name = "prepare-ok" />
-
- <field name = "ticket" domain = "access-ticket" label = "Access-ticket granted by the server for a specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "xid" domain = "Xid" label = "Prepare for commitment any work associated with Xid xid">
- <doc>
- Specifies the Xid of the transaction branch that can be prepared.
- </doc>
- <assert check = "notnull" />
- <!-- rules -->
- <rule name = "unknownXid">
- <doc>
- If Xid is unknown (the transaction branch has not been started or has already been ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
- <rule name = "notdisassociated">
- <doc>
- If this method is called when Xid is still associated with a channel then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
- </field>
- </method>
-
-
- <!-- - - - PREPARE-OK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "prepare-ok" synchronous = "1" index = "41" label = "confirm distributed transaction prepare">
- <doc>
- This method confirms to the client that the transaction branch is prepared or specify the error condition.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "flags" domain = "short" label = "xa-ok, xa-rdonly, xa-rbrollback, xa-rbtimeout">
- <doc>
- xa-ok: Normal execution.
- xa-rdonly: The transaction branch was read-only and has been committed.
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified reason.
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
-
- <!-- - - RECOVER - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "recover" synchronous = "1" index = "50" label = "Get a list of Xids the RM has prepared or heuristically completed">
- <doc>
- This method is called to obtain a list of transaction branches that are in a
- prepared or heuristically completed state.
- </doc>
-
- <rule name = "internalError ">
- <doc>
- If an error occurs in recovering then the server MUST raise a channel exception with reply code 541 (internal error)
- </doc>
- </rule>
-
- <rule name = "startEnd">
- <doc>
- If this endscan is used in conjunction with startscan then a single call starts and then ends a scan.
- </doc>
- </rule>
-
- <rule name = "mustBeStarted">
- <doc>
- If none of endscan and startscan are set then a recovery scan must already be started otherwise the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MAY" />
- <response name = "recover-ok" />
-
- <field name = "ticket" domain = "access-ticket" label = "Access-ticket granted by the server for a specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "startscan" domain = "bit" label = "Indicates that recovery scan should start">
- <doc>
- Indicates that recovery scan should start.
- </doc>
- <rule name = "recoveryAlreadyOpen">
- <doc>
- If a recovery scan is already open, the effect is as if the recovery scan were ended and then restarted.
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
-
- <field name = "endscan" domain = "long" label = "indicates that the recovery scan should end after returning the Xids">
- <doc>
- Indicates that the recovery scan should end after returning the Xids.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - RECOVER-OK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "recover-ok" synchronous = "1" index = "51" label = "list of Xids to be recovered">
- <doc>
- Returns to the client a table of transaction Xids that are in a prepared or heuristically completed state.
- </doc>
-
- <chassis name = "client" implement = "MAY" />
-
- <field name = "xids" domain = "table" label = "Table of xids to be recovered">
- <doc>
- table containing transaction Xids that are in a prepared or heuristically completed state.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - ROLLBACK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "rollback" synchronous = "1" index = "60" label = "Rollback a transaction branch">
- <doc>
- This method rolls back the work associated with xid. Any produced messages are discarded
- and any consumed messages are re-enqueued.
- </doc>
-
- <rule name = "internalError">
- <doc>
- If an error occurs in rolling back the transaction branch then the server MUST raise a channel exception with reply code 541 (internal error)
- </doc>
- </rule>
-
- <rule name = "commandInvalid">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MAY" />
- <response name = "rollback-ok" />
-
- <field name = "ticket" domain = "access-ticket" label = "Access-ticket granted by the server for a specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "xid" domain = "Xid" label = "Rollback any work associated with Xid xid">
- <doc>
- Specifies the Xid of the transaction branch that can be rolled back.
- </doc>
- <assert check = "notnull" />
- <!-- rules -->
- <rule name = "unknownXid">
- <doc>
- If Xid is unknown (the transaction branch has not been started or has already been ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
- <rule name = "notdisassociated">
- <doc>
- If this method is called when Xid is still associated with a channel then the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - ROLLBACK-OK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "rollback-ok" synchronous = "1" index = "61" label = "confirm distributed transaction rollback">
- <doc>
- This method confirms to the client that the transaction branch is rolled back or specify the error condition.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "flags" domain = "short" label = "xa-ok, xa-heurhaz, xa-heurcom, xa-heurrb, xa-heurmix, xa-rbrollback">
- <doc>
- xa-ok: Normal execution,
- xa-heurhaz: Due to some failure, the work done on behalf of the specified transaction branch may have been heuristically completed.
- xa-heurcom: Due to a heuristic decision, the work done on behalf of the specified transaction
- branch was committed.
- xa-heurrb: Due to a heuristic decision, the work done on behalf of the specified transaction
- branch was rolled back.
- xa-heurmix: Due to a heuristic decision, the work done on behalf of the specified transaction
- branch was partially committed and partially rolled back.
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified reason.
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
-
-
- <!-- - - SETTIMEOUT - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "set-timeout" synchronous = "1" index = "70" label = "Set the transaction timeout value">
- <doc>
- Sets the specified transaction branch timeout value in seconds.
- </doc>
-
- <rule name = "internalError ">
- <doc>
- If an error occurs in setting the transaction timeout then the server MUST raise a channel exception with reply code 541 (internal error)
- </doc>
- </rule>
-
- <rule name = "effective">
- <doc>
- Once set, this timeout value is effective until this method is reinvoked with a different value.
- </doc>
- </rule>
-
- <rule name = "reset">
- <doc>
- A value of zero resets the timeout value to the default value.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MAY" />
- <response name = "set-timeout-ok" />
-
- <field name = "ticket" domain = "access-ticket" label = "Access-ticket granted by the server for a specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "xid" domain = "Xid" label = "Xid of the branch to set the timeout value">
- <doc>
- Specifies the Xid of the transaction branch for setting the timeout.
- </doc>
- <assert check = "notnull" />
- <!-- rules -->
- <rule name = "unknownXid">
- <doc>
- If Xid is unknown (the transaction branch has not been started or has already been ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
- </field>
-
- <field name = "timeout" domain = "long" label = "The transaction timeout value in seconds">
- <doc>
- The transaction timeout value in seconds.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - - SETTIMEOUT-OK - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "set-timeout-ok" synchronous = "1" index = "71" label = "confirm timeout set">
- <doc>
- This method confirms that the timeout has been set.
- </doc>
- <chassis name = "client" implement = "MAY" />
- </method>
- </class>
-
-<!-- Some other 0-10 previews: -->
-
- <class name="binding" handler="binding" index="130"
- label="provides the ability to query bindings">
- <doc>
- This is a utility class for querying and exchange about its bindings to queues.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MAY" />
-
- <method name="query" synchronous="1" index="10"
- label="request information about bindings to an exchange">
- <doc>
- This method is used to request information on the bindings to a particular exchange. That
- information is conveyed in a query-ok method.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <response name="query-ok" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- A valid ticket should be provided.
- </doc>
- </rule>
- </field>
-
- <field name="exchange" domain="shortstr" label="the exchange name">
- <doc>
- The name of the exchange for which binding information is being requested. If not
- specified explicitly the default exchange is implied.
- </doc>
- </field>
-
- <field name="queue" domain="shortstr" label="a queue name">
- <doc>
- If populated then determine whether the given queue is bound to the exchange.
- </doc>
- </field>
-
- <field name="routing-key" domain="shortstr" label="a routing-key">
- <doc>
- If populated defines the routing key of the binding of interest, if not populated the
- request will ignore the routing key on bindings when searching for a match.
- </doc>
- </field>
-
- <field name="arguments" domain="table" label="a set of binding arguments">
- <doc>
- If populated defines the arguments of the binding of interest if not populated the request
- will ignore the arguments on bindings when searching for a match
- </doc>
- </field>
- </method>
-
- <method name="query-ok" synchronous="1" index="11"
- label="returns information about bindings to exchange">
- <doc>
- This method is used in response to a query and conveys information on the bindings to a
- particular exchange.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <field name="exchange-not-found" domain="bit" label="indicate an unknown exchange">
- <doc>
- If set, the exchange for which information was requested is not known.
- </doc>
- </field>
-
- <field name="queue-not-found" domain="bit" label="indicate an unknown queue">
- <doc>
- If set, the queue specified is not known.
- </doc>
- </field>
-
- <field name="queue-not-matched" domain="bit" label="indicate no matching queue">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange to the
- specified queue.
- </doc>
- </field>
-
- <field name="key-not-matched" domain="bit" label="indicate no matching routing key">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange with
- the specified routing key.
- </doc>
- </field>
-
- <field name="args-not-matched" domain="bit" label="indicate no matching args">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange with
- the specified arguments.
- </doc>
- </field>
- </method>
- </class>
-
-
-
- <class name="exchange" handler="channel" index="40" label="work with exchanges">
- <method name="query" synchronous="1" index="30" label="request information about an exchange">
- <doc>
- This method is used to request information on a particular exchange. That information is
- conveyed by an query-ok method.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <response name="query-ok" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- A valid ticket should be provided.
- </doc>
- </rule>
- </field>
-
- <field name="name" domain="shortstr" label="the exchange name">
- <doc>
- The name of the exchange for which information is requested. If not specified explicitly
- the default exchange is implied.
- </doc>
- </field>
- </method>
-
- <method name="query-ok" synchronous="1" index="31" label="return exchange information">
- <doc>
- This method is used in response to a query request and conveys information on a particular
- exchange.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <field name="type" domain="shortstr" label="indicate the exchange type">
- <doc>
- The type of the exchange. Will be empty if the exchange is not found.
- </doc>
- </field>
-
- <field name="durable" domain="bit" label="indicate the durability">
- <doc>
- The durability of the exchange, i.e. if set the exchange is durable. Will not be set if
- the exchange is not found.
- </doc>
- </field>
-
- <field name="not-found" domain="bit" label="indicate an unknown exchange">
- <doc>
- If set, the exchange for which information was requested is not known.
- </doc>
- </field>
-
- <field name="arguments" domain="table" label="other unspecified exchange properties">
- <doc>
- A set of properties of the exchange whose syntax and semantics depends on the server
- implementation. Will be empty if the exchange is not found.
- </doc>
- </field>
- </method>
- </class>
-
- <class name="execution" handler="execution" index="140">
- <doc>
- This class allows for efficiently communicating information
- about completion of processing.
- </doc>
-
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
-
- <method name="flush" index="10" label="request an execution.complete return method">
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- </method>
-
- <method name="complete" index="20">
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
-
-
- <field name="cumulative-execution-mark" domain="long" label="Low-water mark for command ids">
- <doc>
- The low-water mark for executed command-ids. All ids below this mark have been executed;
- above this mark, there are gaps containing unexecuted command ids (i.e. discontinuous). By
- definition, the first id above this mark (if it exists) is an unexecuted command-id.
- </doc>
- </field>
-
-
- <!-- The ranged mark on the complete method has been temporarily removed -->
- </method>
-
- </class>
-
-
-</amqp>
diff --git a/M4-RCs/qpid/specs/amqp-errata.0-9.xml b/M4-RCs/qpid/specs/amqp-errata.0-9.xml
deleted file mode 100644
index 8b9d818234..0000000000
--- a/M4-RCs/qpid/specs/amqp-errata.0-9.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version = "1.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 major = "0" minor = "9" port = "5672" comment = "AMQ Protocol version 0-9">
-
- <constant name = "frame-request" value = "9" />
- <constant name = "frame-response" value = "10" />
-
- <!-- == MESSAGE =========================================================== -->
-
- <class name = "message" index = "120">
- <method name = "transfer" index = "10">
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- <field name = "mandatory" type = "bit" label = "indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue. If this flag is set, the server will return an
- unroutable message with a Return method. If this flag is zero, the
- server silently drops the message.
- </doc>
- </field>
- </method>
- </class>
-
-</amqp>
diff --git a/M4-RCs/qpid/specs/amqp-nogen.0-9.xml b/M4-RCs/qpid/specs/amqp-nogen.0-9.xml
deleted file mode 100644
index bde9571540..0000000000
--- a/M4-RCs/qpid/specs/amqp-nogen.0-9.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version = "1.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 major = "0" minor = "9" port = "5672" comment = "AMQ Protocol version 0-9">
-
- <!-- == BASIC ============================================================ -->
-
- <class name = "basic" index = "60">
- <codegen value="no-gen" />
- </class>
-
- <!-- == FILE ============================================================= -->
-
- <class name = "file" index = "70">
- <codegen value="no-gen" />
- </class>
-
- <!-- == STREAM =========================================================== -->
-
- <class name = "stream" index = "80">
- <codegen value="no-gen" />
- </class>
-
-</amqp>
diff --git a/M4-RCs/qpid/specs/amqp.0-10-preview.xml b/M4-RCs/qpid/specs/amqp.0-10-preview.xml
deleted file mode 100644
index 5af956e75d..0000000000
--- a/M4-RCs/qpid/specs/amqp.0-10-preview.xml
+++ /dev/null
@@ -1,7170 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- EDITORS: (PH) Pieter Hintjens <ph@imatix.com>
- (KvdR) Kim van der Riet <kim.vdriet@redhat.com>
-
- These editors have been assigned by the AMQP working group. Please do not edit/commit this file
- without consulting with one of the above editors.
- ========================================================
-
- TODOs
- - see TODO comments in the text
--->
-
-<!--
- Copyright Notice
- ================
- (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
- Corporation, IONA\ufffd Technologies, Red Hat, Inc., TWIST Process Innovations, and 29West Inc.
- 2006. All rights reserved.
-
- License
- =======
- JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix Corporation, IONA
- Technologies, Red Hat, Inc., TWIST Process Innovations, and 29West Inc. (collectively, the
- "Authors") each hereby grants to you a worldwide, perpetual, royalty-free, nontransferable,
- nonexclusive license to (i) copy, display, distribute and implement the Advanced Messaging Queue
- Protocol ("AMQP") Specification and (ii) the Licensed Claims that are held by the Authors, all for
- the purpose of implementing the Advanced Messaging Queue Protocol Specification. Your license and
- any rights under this Agreement will terminate immediately without notice from any Author if you
- bring any claim, suit, demand, or action related to the Advanced Messaging Queue Protocol
- Specification against any Author. Upon termination, you shall destroy all copies of the Advanced
- Messaging Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or patent application,
- throughout the world, excluding design patents and design registrations, owned or controlled, or
- that can be sublicensed without fee and in compliance with the requirements of this Agreement, by
- an Author or its affiliates now or at any future time and which would necessarily be infringed by
- implementation of the Advanced Messaging Queue Protocol Specification. A claim is necessarily
- infringed hereunder only when it is not possible to avoid infringing it because there is no
- plausible non-infringing alternative for implementing the required portions of the Advanced
- Messaging Queue Protocol Specification. Notwithstanding the foregoing, Licensed Claims shall not
- include any claims other than as set forth above even if contained in the same patent as Licensed
- Claims; or that read solely on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging Queue Protocol
- Specification, or that, if licensed, would require a payment of royalties by the licensor to
- unaffiliated third parties. Moreover, Licensed Claims shall not include (i) any enabling
- technologies that may be necessary to make or use any Licensed Product but are not themselves
- expressly set forth in the Advanced Messaging Queue Protocol Specification (e.g., semiconductor
- manufacturing technology, compiler technology, object oriented technology, networking technology,
- operating system technology, and the like); or (ii) the implementation of other published
- standards developed elsewhere and merely referred to in the body of the Advanced Messaging Queue
- Protocol Specification, or (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced Messaging Queue Protocol
- Specification. For purposes of this definition, the Advanced Messaging Queue Protocol
- Specification shall be deemed to include both architectural and interconnection requirements
- essential for interoperability and may also include supporting source code artifacts where such
- architectural, interconnection requirements and source code artifacts are expressly identified as
- being required or documentation to achieve compliance with the Advanced Messaging Queue Protocol
- Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions of products (hardware,
- software or combinations thereof) that implement and are compliant with all relevant portions of
- the Advanced Messaging Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any use you may make of the
- Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS," AND THE AUTHORS MAKE NO
- REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS
- OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE
- IMPLEMENTATION OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD
- PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
- DAMAGES ARISING OUT OF OR RELATING TO ANY USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner, including advertising or
- publicity pertaining to the Advanced Messaging Queue Protocol Specification or its contents
- without specific, written prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you shall destroy all copies of
- the Advanced Messaging Queue Protocol Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the Octagon Symbol are
- trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA Technologies PLC and/or its
- subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered trademarks of Red Hat,
- Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of Sun Microsystems, Inc. in the
- United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
--->
-
-<!--
- XML Notes
- =========
-
- We use entities to indicate repetition; attributes to indicate properties.
-
- We use the "name" attribute as an identifier, usually within the context of the surrounding
- entities.
-
- We use hyphens (minus char '-') to seperate words in names.
-
- We do not enforce any particular validation mechanism but we support all mechanisms. The protocol
- definition conforms to a formal grammar that is published seperately in several technologies.
-
--->
-
-<!--
-
-<!DOCTYPE amqp SYSTEM "amqp.dtd">
-
--->
-
-<amqp xmlns="http://www.amqp.org/schema/amqp.xsd"
- major="99" minor="0" port="5672" comment="AMQ Protocol (Working version)">
-
- <!--
- ======================================================
- == CONSTANTS
- ======================================================
- -->
- <!-- Frame types -->
- <constant name="frame-method" value="1" />
- <constant name="frame-header" value="2" />
- <constant name="frame-body" value="3" />
- <constant name="frame-trace" value="7" />
- <constant name="frame-heartbeat" value="8" />
-
- <!-- Protocol constants -->
- <constant name="frame-min-size" value="4096" />
- <constant name="frame-end" value="206" />
-
- <!-- Reply codes -->
- <constant name="reply-success" value="200">
- <doc>
- Indicates that the method completed successfully. This reply code is reserved for future use -
- the current protocol design does not use positive confirmation and reply codes are sent only
- in case of an error.
- </doc>
- </constant>
-
- <constant name="not-delivered" value="310" class="soft-error">
- <doc>
- The client asked for a specific message that is no longer available. The message was delivered
- to another client, or was purged from the queue for some other reason.
- </doc>
- </constant>
-
- <constant name="content-too-large" value="311" class="soft-error">
- <doc>
- The client attempted to transfer content larger than the server could accept at the present
- time. The client may retry at a later time.
- </doc>
- </constant>
-
- <constant name="no-route" value="312" class="soft-error">
- <doc>
- When the exchange cannot route the result of a .Publish, most likely due to an invalid routing
- key. Only when the mandatory flag is set.
- </doc>
- </constant>
-
- <constant name="no-consumers" value="313" class="soft-error">
- <doc>
- When the exchange cannot deliver to a consumer when the immediate flag is set. As a result of
- pending data on the queue or the absence of any consumers of the queue.
- </doc>
- </constant>
-
- <constant name="connection-forced" value="320" class="hard-error">
- <doc>
- An operator intervened to close the connection for some reason. The client may retry at some
- later date.
- </doc>
- </constant>
-
- <constant name="invalid-path" value="402" class="hard-error">
- <doc>
- The client tried to work with an unknown virtual host.
- </doc>
- </constant>
-
- <constant name="access-refused" value="403" class="soft-error">
- <doc>
- The client attempted to work with a server entity to which it has no access due to security
- settings.
- </doc>
- </constant>
-
- <constant name="not-found" value="404" class="soft-error">
- <doc>
- The client attempted to work with a server entity that does not exist.
- </doc>
- </constant>
-
- <constant name="resource-locked" value="405" class="soft-error">
- <doc>
- The client attempted to work with a server entity to which it has no access because another
- client is working with it.
- </doc>
- </constant>
-
- <constant name="precondition-failed" value="406" class="soft-error">
- <doc>
- The client requested a method that was not allowed because some precondition failed.
- </doc>
- </constant>
-
- <constant name="session-busy" value="407" class="soft-error">
- <doc>
- A session.resume was attempted for a session already attached to another channel.
- </doc>
- </constant>
-
- <constant name="frame-error" value="501" class="hard-error">
- <doc>
- The client sent a malformed frame that the server could not decode. This strongly implies a
- programming error in the client.
- </doc>
- </constant>
-
- <constant name="syntax-error" value="502" class="hard-error">
- <doc>
- The client sent a frame that contained illegal values for one or more fields. This strongly
- implies a programming error in the client.
- </doc>
- </constant>
-
- <constant name="command-invalid" value="503" class="hard-error">
- <doc>
- The client sent an invalid sequence of frames, attempting to perform an operation that was
- considered invalid by the server. This usually implies a programming error in the client.
- </doc>
- </constant>
-
- <!-- TODO: Should this be renamed to "session-error" since class channel has been replaced by
- class session? -->
- <constant name="channel-error" value="504" class="hard-error">
- <doc>
- The client attempted to work with a channel that had not been correctly opened. This most
- likely indicates a fault in the client layer.
- </doc>
- </constant>
-
- <constant name="resource-error" value="506" class="hard-error">
- <doc>
- The server could not complete the method because it lacked sufficient resources. This may be
- due to the client creating too many of some type of entity.
- </doc>
- </constant>
-
- <constant name="not-allowed" value="530" class="hard-error">
- <doc>
- The client tried to work with some entity in a manner that is prohibited by the server, due to
- security settings or by some other criteria.
- </doc>
- </constant>
-
- <constant name="not-implemented" value="540" class="hard-error">
- <doc>
- The client tried to use functionality that is not implemented in the server.
- </doc>
- </constant>
-
- <constant name="internal-error" value="541" class="hard-error">
- <doc>
- The server could not complete the method because of an internal error. The server may require
- intervention by an operator in order to resume normal operations.
- </doc>
- </constant>
-
- <constant name="invalid-argument" value="542" class="hard-error">
- <doc>
- An invalid or illegal argument was passed to a method, and the operation could not proceed.
- </doc>
- </constant>
-
- <constant name="channel-busy" value="543" class="hard-error">
- <doc>
- A session.open was sent on a channel that was already attached to a session.
- </doc>
- </constant>
-
- <!-- XA constants -->
-
- <constant name="xa-ok" value="0">
- <doc>
- XA return code: Normal execution completion (no error).
- </doc>
- </constant>
-
- <constant name="xa-rbrollback" value="1">
- <doc>
- XA return code: The rollback was caused for an unspecified reason.
- </doc>
- </constant>
-
- <constant name="xa-rbtimeout" value="2">
- <doc>
- XA return code: A transaction branch took too long.
- </doc>
- </constant>
-
- <constant name="xa-heurhaz" value="3">
- <doc>
- XA return code: The transaction branch may have been heuristically completed.
- </doc>
- </constant>
-
- <constant name="xa-heurcom" value="4">
- <doc>
- XA return code: The transaction branch has been heuristically committed.
- </doc>
- </constant>
-
- <constant name="xa-heurrb" value="5">
- <doc>
- XA return code: The transaction branch has been heuristically rolled back.
- </doc>
- </constant>
-
- <constant name="xa-heurmix" value="6">
- <doc>
- XA return code: The transaction branch has been heuristically committed and rolled back.
- </doc>
- </constant>
-
- <constant name="xa-rdonly" value="7">
- <doc>
- XA return code: The transaction branch was read-only and has been committed.
- </doc>
- </constant>
-
- <!--
- ================================
- == Field Table type constants ==
- ================================
- -->
-
- <!--
- 0x00 - 0x0f: Fixed width, 1 octet
- -->
-
- <constant name="field-table-octet" value="0x00" width="1" datatype="binary"
- class="field-table-type">
- <doc>
- Octet of unspecified encoding
- </doc>
- </constant>
-
- <constant name="field-table-signed-byte" value="0x01" width="1" datatype="signed-integer"
- class="field-table-type">
- <doc>
- 8-bit signed integral value (-128 - 127)
- </doc>
- </constant>
-
- <constant name="field-table-unsigned-byte" value="0x02" width="1" datatype="unsigned-integer"
- class="field-table-type">
- <doc>
- 8-bit unsigned integral value (0 - 255)
- </doc>
- </constant>
-
- <constant name="field-table-char" value="0x04" width="1" datatype="char"
- class="field-table-type">
- <doc>
- 8-bit representation of single character in the iso-8859-15 character set
- </doc>
- </constant>
-
- <constant name="field-table-boolean" value="0x08" width="1" datatype="boolean"
- class="field-table-type">
- <doc>
- Boolean value (0 represents false, 1 represents true)
- </doc>
- </constant>
-
- <!--
- 0x10 - 0x1f: Fixed width, 2 octets
- -->
-
- <constant name="field-table-two-octets" value="0x10" width="2" datatype="binary"
- class="field-table-type">
- <doc>
- Two octets of unspecified binary encoding
- </doc>
- </constant>
-
- <constant name="field-table-signed-short" value="0x11" width="2" datatype="signed-integer"
- class="field-table-type">
- <doc>
- 16-bit signed integral value
- </doc>
- </constant>
-
- <constant name="field-table-unsigned-short" value="0x12" width="2" datatype="unsigned-integer"
- class="field-table-type">
- <doc>
- 16-bit unsigned integral value
- </doc>
- </constant>
-
- <!--
- 0x20 - 0x2f: Fixed width, 4 octets
- -->
-
- <constant name="field-table-four-octets" value="0x20" width="4" datatype="binary"
- class="field-table-type">
- <doc>
- Four octets of unspecified binary encoding
- </doc>
- </constant>
-
- <constant name="field-table-signed-int" value="0x21" width="4" datatype="signed-integer"
- class="field-table-type">
- <doc>
- 32-bit signed integral value
- </doc>
- </constant>
-
- <constant name="field-table-unsigned-int" value="0x22" width="4" datatype="unsigned-integer"
- class="field-table-type">
- <doc>
- 32-bit unsigned integral value
- </doc>
- </constant>
-
- <constant name="field-table-float" value="0x23" width="4" datatype="ieee-float"
- class="field-table-type">
- <doc>
- Single precision IEEE 754 32-bit floating point
- </doc>
- </constant>
-
- <constant name="field-table-utf32-char" value="0x27" width="4" datatype="char"
- class="field-table-type">
- <doc>
- Single unicode character in UTF-32 encoding
- </doc>
- </constant>
-
- <!--
- 0x30 - 0x3f: Fixed width types - 8 octets
- -->
-
- <constant name="field-table-eight-octets" value="0x30" width="8" datatype="binary"
- class="field-table-type">
- <doc>
- Eight octets of unspecified binary encoding
- </doc>
- </constant>
-
- <constant name="field-table-signed-long" value="0x31" width="8" datatype="signed-integer"
- class="field-table-type">
- <doc>
- 64-bit signed integral value
- </doc>
- </constant>
-
- <constant name="field-table-unsigned-long" value="0x32" width="8" datatype="unsigned-integer"
- class="field-table-type">
- <doc>
- 64-bit unsigned integral value
- </doc>
- </constant>
-
- <constant name="field-table-double" value="0x33" width="8" datatype="ieee-float"
- class="field-table-type">
- <doc>
- Double precision IEEE 754 floating point
- </doc>
- </constant>
-
- <constant name="field-table-datetime" value="0x38" width="8" datatype="special"
- class="field-table-type">
- <doc>
- Datetime in POSIX time_t format
- </doc>
- </constant>
-
- <!--
- 0x40 - 0x4f: Fixed width types - 16 octets
- -->
-
- <constant name="field-table-sixteen-octets" value="0x40" width="16" datatype="binary"
- class="field-table-type">
- <doc>
- Sixteen octets of unspecified binary encoding
- </doc>
- </constant>
-
- <constant name="field-table-uuid" value="0x48" width="16" datatype="special"
- class="field-table-type">
- <doc>
- UUID as defined by RFC4122
- </doc>
- </constant>
-
- <!--
- 0x50 - 0x5f: Fixed width types - 32 octets
- -->
-
- <constant name="field-table-thirty-two-octets" value="0x50" width="32" datatype="binary"
- class="field-table-type">
- <doc>
- Thirty two octets of unspecified binary encoding
- </doc>
- </constant>
-
- <!--
- 0x60 - 0x6f: Fixed width types - 64 octets
- -->
-
- <constant name="field-table-sixty-four-octets" value="0x60" width="64" datatype="binary"
- class="field-table-type">
- <doc>
- Sixty four octets of unspecified binary encoding
- </doc>
- </constant>
-
- <!--
- 0x70 - 0x7f: Fixed width types - 128 octets
- -->
-
- <constant name="field-table-128-octets" value="0x70" width="128" datatype="binary"
- class="field-table-type">
- <doc>
- One hundred and twenty eight octets of unspecified binary encoding
- </doc>
- </constant>
-
- <!--
- 0x80 - 0x8f: Variable length - one byte length field (up to 255 octets)
- -->
-
- <constant name="field-table-short-binary" value="0x80" lfwidth="1" datatype="binary"
- class="field-table-type">
- <doc>
- A sequence of up to 255 octets representing opaque binary data
- </doc>
- </constant>
-
- <constant name="field-table-short-string" value="0x84" lfwidth="1" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of up to 255 characters in the iso-8859-15 character set
- </doc>
- </constant>
-
- <constant name="field-table-short-utf8-string" value="0x85" lfwidth="1" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of unicode characters in the utf8 encoding which is able to be encoded in at most
- 255 bytes
- </doc>
- </constant>
-
- <constant name="field-table-short-utf16-string" value="0x86" lfwidth="1" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of unicode characters in the utf16 encoding which is able to be encoded in at most
- 255 bytes
- </doc>
- </constant>
-
- <constant name="field-table-short-utf32-string" value="0x87" lfwidth="1" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of unicode characters in the utf32 encoding which is able to be encoded in at most
- 255 bytes (i.e. of 0-63 utf32 characters)
- </doc>
- </constant>
-
- <!--
- 0x90 - 0x9f: Variable length types - two byte length field (up to 65535 octets)
- -->
-
- <constant name="field-table-binary" value="0x90" lfwidth="2" datatype="binary"
- class="field-table-type">
- <doc>
- A sequence of up to 65535 octets representing opaque binary data
- </doc>
- </constant>
-
- <constant name="field-table-string" value="0x94" lfwidth="2" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of up to 65535 characters in the iso-8859-15 character set
- </doc>
- </constant>
-
- <constant name="field-table-utf8-string" value="0x95" lfwidth="2" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of unicode characters in the utf8 encoding which is able to be encoded in at most
- 65535 bytes
- </doc>
- </constant>
-
- <constant name="field-table-utf16-string" value="0x96" lfwidth="2" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of unicode characters in the utf16 encoding which is able to be encoded in at most
- 65535 bytes
- </doc>
- </constant>
-
- <constant name="field-table-utf32-string" value="0x97" lfwidth="2" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of unicode characters in the utf32 encoding which is able to be encoded in at most
- 65535 bytes (i.e. of 0-16383 utf32 characters)
- </doc>
- </constant>
-
- <!--
- 0xa0 - 0xaf: Variable length types - four byte length field (up to 4294967295 octets)
- -->
-
- <constant name="field-table-long-binary" value="0xa0" lfwidth="4" datatype="binary"
- class="field-table-type">
- <doc>
- A sequence of up to 4294967295 octets representing opaque binary data
- </doc>
- </constant>
-
- <constant name="field-table-long-string" value="0xa4" lfwidth="4" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of up to 4294967295 characters in the iso-8859-15 character set
- </doc>
- </constant>
-
- <constant name="field-table-long-utf8-string" value="0xa5" lfwidth="4" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of unicode characters in the utf8 encoding which is able to be encoded in at most
- 4294967295 bytes
- </doc>
- </constant>
-
- <constant name="field-table-long-utf16-string" value="0xa6" lfwidth="4" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of unicode characters in the utf16 encoding which is able to be encoded in at most
- 4294967295 bytes
- </doc>
- </constant>
-
- <constant name="field-table-long-utf32-string" value="0xa7" lfwidth="4" datatype="string"
- class="field-table-type">
- <doc>
- A sequence of unicode characters in the utf32 encoding which is able to be encoded in at most
- 4294967295 bytes (i.e. of 0-1073741823 utf32 characters)
- </doc>
- </constant>
-
- <constant name="field-table-table" value="0xa8" lfwidth="4" datatype="field-table"
- class="field-table-type">
- <doc>
- A field table following the encoding specification given here
- </doc>
- </constant>
-
- <constant name="field-table-sequence" value="0xa9" lfwidth="4" datatype="sequence"
- class="field-table-type">
- <doc>
- A sequence is a series of consecutive type-value pairs; using the same type designators as the
- field table
- </doc>
- </constant>
-
- <constant name="field-table-array" value="0xaa" lfwidth="4" datatype="array"
- class="field-table-type">
- <doc>
- An array represents a collection of values of the same type. The array is encoded as a single
- octet type designator (using the same system as given here for the field table), followed by a
- four-octet unsigned integer which represents the number of elements in the collection,
- followed by the encoding of that number of values of the given type
- </doc>
- </constant>
-
- <!--
- 0xb0 - 0xbf: Reserved
- -->
-
- <!--
- 0xc0 - 0xcf:Fixed width types - 5 octets
- -->
-
- <constant name="field-table-five-octets" value="0xc0" width="5" datatype="binary"
- class="field-table-type">
- <doc>
- Five octets of unspecified binary encoding
- </doc>
- </constant>
-
- <constant name="field-table-decimal" value="0xc8" width="5" datatype="decimal"
- class="field-table-type">
- <doc>
- Encoded as an octet representing the number of decimal places followed by a signed 4 octet
- integer. The 'decimals' octet is not signed
- </doc>
- </constant>
-
- <!--
- 0xd0 - 0xdf: Fixed width types - 9 octets
- -->
-
- <constant name="field-table-nine-octets" value="0xd0" width="9" datatype="binary"
- class="field-table-type">
- <doc>
- Eight octets of unspecified binary encoding
- </doc>
- </constant>
-
- <constant name="field-table-long-decimal" value="0xd8" width="9" datatype="decimal"
- class="field-table-type">
- <doc>
- Encoded as an octet representing the number of decimal places followed by a signed 8 octet
- integer. The 'decimals' octet is not signed
- </doc>
- </constant>
-
- <!--
- 0xe0 - 0xef: Reserved
- -->
-
- <!--
- 0xf0 - 0xff: Zero-length types
- -->
-
- <constant name="field-table-void" value="0xf0" width="0" datatype="void"
- class="field-table-type">
- <doc>
- The void type
- </doc>
- </constant>
-
- <!--
- ======================================================
- == DOMAIN TYPES
- ======================================================
- -->
-
- <domain name="access-ticket" type="short" label="access ticket granted by server">
- <doc>
- An access ticket granted by the server for a certain set of access rights within a specific
- realm. Access tickets are valid within the session where they were created, and expire when
- the session closes.
- </doc>
- <assert check="ne" value="0" />
- </domain>
-
- <domain name="class-id" type="short">
- <doc>
- <!-- TODO: Description required for docs -->
- </doc>
- </domain>
-
- <domain name="method-id" type="short">
- <doc>
- <!-- TODO: Description required for docs -->
- </doc>
- </domain>
-
- <domain name="consumer-tag" type="shortstr" label="consumer tag">
- <doc>
- Identifier for the consumer, valid within the current connection.
- </doc>
- </domain>
-
- <domain name="delivery-tag" type="longlong" label="server-assigned delivery tag">
- <doc>
- The server-assigned and session-specific delivery tag
- </doc>
- <rule name="session-local">
- <doc>
- The delivery tag is valid only within the session from which the message was received. i.e.
- A client MUST NOT receive a message on one session and then acknowledge it on another.
- </doc>
- </rule>
- <rule name="non-zero">
- <doc>
- The server MUST NOT use a zero value for delivery tags. Zero is reserved for client use,
- meaning "all messages so far received".
- </doc>
- </rule>
- <assert check="ne" value="0" />
- </domain>
-
- <domain name="exchange-name" type="shortstr" label="exchange name">
- <doc>
- The exchange name is a client-selected string that identifies the exchange for publish
- methods. Exchange names may consist of any mixture of digits, letters, and underscores.
- Exchange names are scoped by the virtual host.
- </doc>
- <assert check="regexp" value="[a-zA-Z0-9_]{1,127}">
- <doc>
- This regular expression checks that all characters are one of a-z (lower case), A-Z (upper
- case), 0-9 (any digit) and the underscore character. There may be between 1 and 127 of these
- characters.
- </doc>
- </assert>
- </domain>
-
- <domain name="known-hosts" type="shortstr" label="list of known hosts">
- <doc>
- Specifies the list of equivalent or alternative hosts that the server knows about, which will
- normally include the current server itself. Clients can cache this information and use it when
- reconnecting to a server after a failure. This field may be empty.
- </doc>
- </domain>
-
- <domain name="message-id" type="uuid">
- <doc>
- Message-id is an optional property of UUID type which uniquly identifies a message within the
- message system. The message producer is usually responsible for setting the message-id. Note
- that the server may discard a message as a duplicate if the value of the message-id matches
- that of a previously received message.
- </doc>
- <rule name="unique">
- <doc>
- A message MUST be unique within a given server instance. A message SHOULD be globally unique
- (i.e. across different systems).
- </doc>
- </rule>
- <rule name="immutable">
- <doc>
- A message ID is immutable. Once set, a message-id MUST NOT be changed or reassigned, even if
- the message is replicated, resent or sent to multiple queues.
- </doc>
- </rule>
- </domain>
-
- <domain name="no-ack" type="bit" label="no acknowledgement needed">
- <doc>
- If this field is set the server does not expect acknowledgements for messages. That is, when a
- message is delivered to the client the server automatically and silently acknowledges it on
- behalf of the client. This functionality increases performance but at the cost of reliability.
- Messages can get lost if a client dies before it can deliver them to the application.
- </doc>
- </domain>
-
- <domain name="no-local" type="bit" label="do not deliver own messages">
- <doc>
- If the no-local field is set the server will not send messages to the connection that
- published them.
- </doc>
- </domain>
-
- <domain name="path" type="shortstr">
- <doc>
- Must start with a slash "/" and continue with path names separated by slashes. A path name
- consists of any combination of at least one of [A-Za-z0-9] plus zero or more of [.-_+!=:].
- </doc>
- <assert check="notnull" />
- <assert check="syntax" rule="path" />
- <assert check="length" value="127" />
- </domain>
-
- <domain name="peer-properties" type="table">
- <doc>
- This string provides a set of peer properties, used for identification, debugging, and general
- information.
- </doc>
- </domain>
-
- <domain name="queue-name" type="shortstr" label="queue name">
- <doc>
- The queue name identifies the queue within the vhost. Queue names must have a length of
- between 1 and 255 chatacters inclusive, must start with a digit, letter or underscores ('_')
- character, and must be otherwise encoded in UTF-8.
- </doc>
- <assert check="regexp" value="[a-zA-Z0-9_].{0,254}">
- <doc>
- This regular expression checks that the first character is one of a-z (lower case), A-Z
- (upper case), 0-9 (any digit) and the underscore character. Following may be between 0 and
- 254 characters of any value.
- </doc>
- </assert>
- </domain>
-
- <domain name="redelivered" type="bit" label="message is being redelivered">
- <doc>
- This indicates that the message has been previously delivered to this or another client.
- </doc>
- <rule name="implementation">
- <doc>
- The server SHOULD try to signal redelivered messages when it can. When redelivering a
- message that was not successfully acknowledged, the server SHOULD deliver it to the original
- client if possible.
- </doc>
- <doc type="scenario">
- Create a shared queue and publish a message to the queue. Consume the message using explicit
- acknowledgements, but do not acknowledge the message. Close the connection, reconnect, and
- consume from the queue again. The message should arrive with the redelivered flag set.
- </doc>
- </rule>
- <rule name="hinting">
- <doc>
- The client MUST NOT rely on the redelivered field but should take it as a hint that the
- message may already have been processed. A fully robust client must be able to track
- duplicate received messages on non-transacted, and locally-transacted sessions.
- </doc>
- </rule>
- </domain>
-
- <domain name="rfc1982-long" type="long" label="serial number with arithmetic per RFC1982">
- <doc>
- Serial number defined in RFC1982 which defines the arithmatic, operators and ranges of such
- numbers.
- </doc>
- </domain>
-
- <domain name="reply-code" type="short" label="reply code from server">
- <doc>
- The reply code. The AMQ reply codes are defined as constants at the start of this formal
- specification.
- </doc>
- <assert check="notnull" />
- </domain>
-
- <domain name="reply-text" type="shortstr" label="localised reply text">
- <doc>
- The localised reply text. This text can be logged as an aid to resolving issues.
- </doc>
- <assert check="notnull" />
- </domain>
-
- <!-- Domains for the message class -->
-
- <domain name="duration" type="longlong" label="duration in milliseconds">
- <doc>
- Duration of an event or process measured in milliseconds.
- </doc>
- </domain>
-
- <domain name="offset" type="longlong" label="offset into a message body">
- <doc>
- Offset in bytes into a message body.
- </doc>
- </domain>
-
- <domain name="reference" type="longstr" label="pointer to a message body">
- <doc>
- Identifier to be used as a reference to a message body.
- </doc>
- </domain>
-
- <domain name="destination" type="shortstr" label="destination for a message">
- <doc>
- Specifies the destination to which the message is to be transferred. The destination can be
- empty, meaning the default exchange or consumer.
- </doc>
- </domain>
-
- <domain name="reject-code" type="short" label="reject code for transfer">
- <doc>
- Code specifying the reason for a message reject.
- </doc>
- <rule name="allowed-values">
- <doc>
- The reject code must be one of 0 (generic) or 1 (immediate delivery was attempted but
- failed).
- </doc>
- </rule>
- </domain>
-
- <domain name="reject-text" type="shortstr" label="informational text for message reject">
- <doc>
- String describing the reason for a message transfer rejection.
- </doc>
- </domain>
-
- <domain name="security-token" type="longstr" label="security token">
- <doc>
- A security token used for authentication, replay prevention, and encrypted message bodies.
- </doc>
- </domain>
-
- <domain name="reply-to">
- <struct size="short" pack="short">
- <field name="exchange-name" domain="exchange-name" />
- <field name="routing-key" domain="shortstr" />
- </struct>
- </domain>
-
- <domain name="confirm-mode" type="octet" label="indicates a confirmation mode">
- <doc>
- Controls whether message transfer needs to be confirmed.
-
- One of:
- - off (0): confirmation is not required, once a message has been transferred in pre-acquire
- mode (or once acquire has been sent in no-acquire mode) the message is considered
- transferred
-
- - on (1): an acquired message (whether acquisition was implicit as in pre-acquire mode or
- explicit as in no-acquire mode) is not considered transferred until the original
- transfer is complete (signaled via execution.complete)
- </doc>
- </domain>
-
- <domain name="acquire-mode" type="octet" label="indicates the transfer mode">
- <doc>
- Indicates whether a transferred message can be considered as automatically acquired or whether
- an explicit request is necessary in order to acquire it.
-
- One of:
- - no-acquire (0): the message must be explicitly acquired
-
- - pre-acquire (1): the message is acquired when the transfer starts
- </doc>
- </domain>
-
- <!-- message header domains -->
-
- <domain name="delivery-properties">
- <struct size="long" pack="short" type="0">
- <field name="discard-unroutable" domain="bit" label="controls discard of unroutable messages">
- <doc>
- If set on a message that is not routable the broker can discard it. If not set unroutable
- should be handled by reject when confirmation is on or by routing to the
- alternate-exchange if defined when confirmation is off.
- </doc>
- </field>
-
- <field name="redelivered" domain="redelivered" label="redelivery flag">
- <doc>
- This boolean flag indicates that the message has been previously delivered to this or
- another client.
- </doc>
- </field>
-
- <field name="priority" domain="octet" label="message priority, 0 to 9">
- <doc>
- Message priority, which can be between 0 and 9. Messages with higher priorities may be
- delivered before those with lower priorities.
- </doc>
- </field>
-
- <field name="delivery-mode" domain="octet" label="message persistence">
- <doc>
- The delivery mode may be non-persistent (1) or persistent (2). A persistent message is one
- which must be stored on a persistent medium (usually hard drive) at every stage of
- delivery so that it will not be lost in event of failure (other than the medium itself).
- This is normally accomplished with some additional overhead. A persistent message may be
- delivered more than once if there is uncertainty about the state of its delivery after a
- failure and recovery.
-
- Conversely, a non-persistent message may be lost in event of a failure, but the nature of
- the communication is such that an occasional message loss is tolerable. This is the lowest
- overhead mode. Non-persistent messages are delivered at most once only.
- </doc>
- </field>
-
- <field name="ttl" domain="duration" label="time to live">
- <doc>
- If this is set to a non zero value then a message expiration time will be computed based
- on the current time plus this value. Messages that live longer than their expiration time
- will be discarded (or dead lettered).
- </doc>
- <rule name="ttl-decrement">
- <doc>
- If a message is transferred between brokers before delivery to a final consumer the ttl
- should be decremented before peer to peer transfer and both timestamp and expiration
- should be cleared.
- </doc>
- </rule>
- </field>
-
- <field name="timestamp" domain="timestamp" label="message timestamp">
- <doc>
- The timestamp is set by the broker on arrival of the message.
- </doc>
- </field>
-
- <field name="expiration" domain="timestamp" label="message expiration time">
- <doc>
- The expiration header assigned by the broker. After receiving the message the broker sets
- expiration to the sum of the ttl specified in the publish method and the current time.
- (ttl=expiration - timestamp)
- </doc>
- </field>
-
- <field name="exchange" domain="exchange-name" label="originating exchange">
- <doc>
- The exchange name is a client-selected string that identifies the exchange for transfer
- methods. Exchange names may consist of any mixture of digits, letters, and underscores.
- Exchange names are scoped by the virtual host.
- </doc>
- </field>
-
- <field name="routing-key" domain="shortstr" label="message routing key">
- <doc>
- The value of the key determines to which queue the exchange will send the message. The way
- in which keys are used to make this routing decision depends on the type of exchange to
- which the message is sent. For example, a direct exchange will route a message to a queue
- if that queue is bound to the exchange with an identical key to that of the message.
- </doc>
- </field>
- </struct>
- </domain>
-
- <domain name="message-properties">
- <struct size="long" pack="short" type="1">
- <field name="content-length" domain="longlong" label="length of content in bytes">
- <doc>
- The length of the message content in bytes.
- </doc>
- </field>
-
- <field name="message-id" domain="shortstr" label="application message identifier">
- <doc>
- This is a unique identifier for the message that is guaranteed to be unique across
- multiple instances, sessions and in time. This allows duplicate messages to be detected.
- This may be a UUID. Note that this is usually set by the server when it first receives a
- message.
-
- If a client wishes to identify a message, it should use the correlation-id instead.
- </doc>
- </field>
-
- <field name="correlation-id" domain="shortstr" label="application correlation identifier">
- <doc>
- This is a client-specific id that may be used to mark or identify messages between
- clients. The server ignores this field.
- </doc>
- </field>
-
- <field name="reply-to" domain="reply-to" label="destination to reply to">
- <doc>
- The destination of any message that is sent in reply to this message.
- </doc>
- </field>
-
- <field name="content-type" domain="shortstr" label="MIME content type">
- <doc>
- The RFC-2046 MIME type for the message content (such as "text/plain"). This is set by the
- originating client.
- </doc>
- </field>
-
- <field name="content-encoding" domain="shortstr" label="MIME content encoding">
- <doc>
- The encoding for character-based message content. This is set by the originating client.
- Examples include UTF-8 and ISO-8859-16.
- </doc>
- </field>
-
- <field name="type" domain="shortstr" label="message type name">
- <doc>
- The JMS message type.
- </doc>
- </field>
-
- <field name="user-id" domain="shortstr" label="creating user id">
- <doc>
- The identity of the user responsible for producing the message.
- </doc>
- </field>
-
- <field name="app-id" domain="shortstr" label="creating application id">
- <doc>
- The identity of the client application responsible for producing the message.
- </doc>
- </field>
-
- <field name="transaction-id" domain="shortstr" label="distributed transaction id">
- <doc>
- An identifier that links this message to a distributed transaction.
- </doc>
- </field>
-
- <field name="security-token" domain="security-token" label="security token">
- <doc>
- A security token used for authentication, replay prevention, and encrypted message bodies.
- </doc>
- </field>
-
- <field name="application-headers" domain="table" label="application specific headers table">
- <doc>
- This is a collection of user-defined headers or properties which may be set by the
- producing client and retrieved by the consuming client. Similar to JMS Properties.
- </doc>
- </field>
- </struct>
- </domain>
-
- <!-- Domians for DTX -->
-
- <domain name="xid" type="longstr" label="Dtx branch identifier">
- <doc>
- An xid uniquely identifies a transaction branch.
- </doc>
-
- <rule name="implementation">
- <doc>
- xid contains a format identifier, two length fields and a data field:
-
- format_id long
-
- gtrid_length octet
-
- bqual_length octet
-
- data gtrid_length + bqual_length
- </doc>
- <doc type="picture">
- 4 1 1 g b
- +---+---+---+---+---+---+---+- -+---+---+- -+---+
- | format_id | g | b | txn-id | br-id |
- +---+---+---+---+---+---+---+- -+---+---+- -+---+
- 0 4 5 6 6+g 6+g+b
- </doc>
- <doc>
- format_id: an implementation specific format identifier
-
- gtrid_length: how many bytes of this form the transaction id
-
- bqual_length: how many bytes of this form the branch id
-
- data: a sequence of octets of at most 128 bytes containing the txn id and the
- branch id
-
- Note - The sum of the two lengths must equal the length of the data field.
- </doc>
- </rule>
- </domain>
-
- <!-- Domains for session class -->
-
- <domain name="detached-lifetime" type="long" label="possibly unbounded duration in seconds">
- <doc>
- Detached-lifetime is an integer encoded as follows:
-
- * the maximum representable value means unbounded - the maximum length permitted by the peer
-
- * otherwise, any other value (including zero) is the number of seconds the session's state
- is retained during periods when no channel (or equivalent) is attached to the session
- (DetachedLifetimeFinite above).
- </doc>
- </domain>
-
- <domain name="session-id" type="uuid" label="session identifier" />
-
- <!-- Domains for the execution class -->
-
- <domain name="correlation" type="rfc1982-long-set">
- <doc>
- Identifies a set of commands inside the window of open conversations.
- </doc>
- </domain>
- <domain name="command-id" type="long"/>
- <domain name="long-struct" type="long-struct">
- <doc>
- Any typed struct whose size width is long.
- </doc>
- </domain>
-
- <domain name="execution-header">
- <doc>
- The execution header appears on commands after the class and method id, but prior to method
- arguments.
- </doc>
- <struct size="octet" pack="octet">
- <field name="sync" domain="bit" label="request notification of completion for a specific command">
- <doc>
- Indicates that the peer sending the request wants to be notified when this command is
- completed.
- </doc>
- </field>
- </struct>
- </domain>
-
- <!-- Elementary domains -->
- <domain name="bit" type="bit" label="single bit" />
- <domain name="octet" type="octet" label="single octet" />
- <domain name="short" type="short" label="16-bit integer" />
- <domain name="long" type="long" label="32-bit integer" />
- <domain name="longlong" type="longlong" label="64-bit integer" />
- <domain name="shortstr" type="shortstr" label="short string" />
- <domain name="longstr" type="longstr" label="long string" />
- <domain name="timestamp" type="timestamp" label="64-bit POSIX timestamp" />
- <domain name="table" type="table" label="field table" />
- <domain name="uuid" type="uuid" label="UUID (RFC4122 section 4.1.2) - 16 octets" />
- <domain name="array" type="array" label="array"/>
-
- <domain name="content" type="content" label="message content">
- <doc>
- Content of a message. It should be considered opaque binary data. The length of the message is
- determined from the context of this type (the message length field of the message.transfer
- method).
- </doc>
- </domain>
-
- <domain name="rfc1982-long-set" type="rfc1982-long-set" label="ranged set representation">
- <doc>
- Set of pairs of RFC-1982 numbers representing a discontinuous range. Each pair represents a
- closed interval within the list.
-
- For example, the set (1,3), (6,6), (8,9) represents the sequence 1,2,3,6,8,9.
- </doc>
- </domain>
-
- <!-- == Class: connection ==================================================================== -->
-
- <class name="connection" index="10" label="work with socket connections">
- <doc>
- The connection class provides methods for a client to establish a network connection to a
- server, and for both peers to operate the connection thereafter.
- </doc>
-
- <doc type="grammar">
- connection = open-connection
- *use-connection
- close-connection
- open-connection = C:protocol-header
- S:START C:START-OK
- *challenge
- S:TUNE C:TUNE-OK
- C:OPEN S:OPEN-OK | S:REDIRECT
- challenge = S:SECURE C:SECURE-OK
- use-connection = *channel
- close-connection = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <!-- - Method: connection.start - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="start" synchronous="1" index="10" label="start connection negotiation">
- <doc>
- This method starts the connection negotiation process by telling the client the protocol
- version that the server proposes, along with a list of security mechanisms which the client
- can use for authentication.
- </doc>
-
- <rule name="protocol-name">
- <doc>
- If the server cannot support the protocol specified in the protocol header, it MUST close
- the socket connection without sending any response method.
- </doc>
- <doc type="scenario">
- The client sends a protocol header containing an invalid protocol name. The server must
- respond by closing the connection.
- </doc>
- </rule>
-
- <rule name="server-support">
- <doc>
- The server MUST provide a protocol version that is lower than or equal to that requested
- by the client in the protocol header.
- </doc>
- <doc type="scenario">
- The client requests a protocol version that is higher than any valid implementation, e.g.
- 9.0. The server must respond with a current protocol version, e.g. 1.0.
- </doc>
- </rule>
-
- <rule name="client-support">
- <doc>
- If the client cannot handle the protocol version suggested by the server it MUST close the
- socket connection.
- </doc>
- <doc type="scenario">
- The server sends a protocol version that is lower than any valid implementation, e.g. 0.1.
- The client must respond by closing the connection.
- </doc>
- </rule>
-
- <chassis name="client" implement="MUST" />
-
- <response name="start-ok" />
-
- <field name="version-major" domain="octet" label="protocol major version">
- <doc>
- The protocol version, major component, as transmitted in the AMQP protocol header. This,
- combined with the protocol minor component fully describe the protocol version, which is
- written in the format major-minor. Hence, with major=1, minor=3, the protocol version
- would be "1-3".
- </doc>
- </field>
-
- <field name="version-minor" domain="octet" label="protocol minor version">
- <doc>
- The protocol version, minor component, as transmitted in the AMQP protocol header. This,
- combined with the protocol major component fully describe the protocol version, which is
- written in the format major-minor. Hence, with major=1, minor=3, the protocol version
- would be "1-3".
- </doc>
- </field>
-
- <field name="server-properties" domain="peer-properties" label="server properties">
- <rule name="required-fields">
- <doc>
- The properties SHOULD contain at least these fields: "host", specifying the server host
- name or address, "product", giving the name of the server product, "version", giving the
- name of the server version, "platform", giving the name of the operating system,
- "copyright", if appropriate, and "information", giving other general information.
- </doc>
- <doc type="scenario">
- Client connects to server and inspects the server properties. It checks for the presence
- of the required fields.
- </doc>
- </rule>
- </field>
-
- <field name="mechanisms" domain="longstr" label="available security mechanisms">
- <doc>
- A list of the security mechanisms that the server supports, delimited by spaces.
- </doc>
- <assert check="notnull" />
- </field>
-
- <field name="locales" domain="longstr" label="available message locales">
- <doc>
- A list of the message locales that the server supports, delimited by spaces. The locale
- defines the language in which the server will send reply texts.
- </doc>
-
- <rule name="required-support">
- <doc>
- The server MUST support at least the en_US locale.
- </doc>
- <doc type="scenario">
- Client connects to server and inspects the locales field. It checks for the presence of
- the required locale(s).
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
- </method>
-
- <!-- - Method: connection.start-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="start-ok" synchronous="1" index="11"
- label="select security mechanism and locale">
- <doc>
- This method selects a SASL security mechanism.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="client-properties" domain="peer-properties" label="client properties">
- <rule name="required-fields">
- <!-- This rule is not testable from the client side -->
- <doc>
- The properties SHOULD contain at least these fields: "product", giving the name of the
- client product, "version", giving the name of the client version, "platform", giving the
- name of the operating system, "copyright", if appropriate, and "information", giving
- other general information.
- </doc>
- </rule>
- </field>
-
- <field name="mechanism" domain="shortstr" label="selected security mechanism">
- <doc>
- A single security mechanisms selected by the client, which must be one of those specified
- by the server.
- </doc>
-
- <rule name="security">
- <doc>
- The client SHOULD authenticate using the highest-level security profile it can handle
- from the list provided by the server.
- </doc>
- </rule>
-
- <rule name="validity">
- <doc>
- If the mechanism field does not contain one of the security mechanisms proposed by the
- server in the Start method, the server MUST close the connection without sending any
- further data.
- </doc>
- <doc type="scenario">
- Client connects to server and sends an invalid security mechanism. The server must
- respond by closing the connection (a socket close, with no connection close
- negotiation).
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="response" domain="longstr" label="security response data">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this data are
- defined by the SASL security mechanism.
- </doc>
- <assert check="notnull" />
- </field>
-
- <field name="locale" domain="shortstr" label="selected message locale">
- <doc>
- A single message locale selected by the client, which must be one of those specified by
- the server.
- </doc>
- <assert check="notnull" />
- </field>
- </method>
-
- <!-- - Method: connection.secure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="secure" synchronous="1" index="20" label="security mechanism challenge">
- <doc>
- The SASL protocol works by exchanging challenges and responses until both peers have
- received sufficient information to authenticate each other. This method challenges the
- client to provide more information.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <response name="secure-ok" />
-
- <field name="challenge" domain="longstr" label="security challenge data">
- <doc>
- Challenge information, a block of opaque binary data passed to the security mechanism.
- </doc>
- </field>
- </method>
-
- <!-- - Method: connection.secure-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="secure-ok" synchronous="1" index="21" label="security mechanism response">
- <doc>
- This method attempts to authenticate, passing a block of SASL data for the security
- mechanism at the server side.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="response" domain="longstr" label="security response data">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this data are
- defined by the SASL security mechanism.
- </doc>
- <assert check="notnull" />
- </field>
- </method>
-
- <!-- - Method: connection.tune - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="tune" synchronous="1" index="30" label="propose connection tuning parameters">
- <doc>
- This method proposes a set of connection configuration values to the client. The client can
- accept and/or adjust these.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <response name="tune-ok" />
-
- <field name="channel-max" domain="short" label="proposed maximum channels">
- <doc>
- The maximum total number of channels that the server allows per connection. Zero means
- that the server does not impose a fixed limit, but the number of allowed channels may be
- limited by available server resources.
- </doc>
- </field>
-
- <field name="frame-max" domain="long" label="proposed maximum frame size">
- <doc>
- The largest frame size that the server proposes for the connection. The client can
- negotiate a lower value. Zero means that the server does not impose any specific limit but
- may reject very large frames if it cannot allocate resources for them.
- </doc>
-
- <rule name="minimum">
- <doc>
- Until the frame-max has been negotiated, both peers MUST accept frames of up to
- frame-min-size octets large, and the minimum negotiated value for frame-max is also
- frame-min-size.
- </doc>
- <doc type="scenario">
- Client connects to server and sends a large properties field, creating a frame of
- frame-min-size octets. The server must accept this frame.
- </doc>
- </rule>
- </field>
-
- <field name="heartbeat" domain="short" label="desired heartbeat delay">
- <!-- TODO 0.82 - the heartbeat negotiation mechanism was changed during implementation
- because the model documented here does not actually work properly. The best model we
- found is that the server proposes a heartbeat value to the client; the client can reply
- with zero, meaning 'do not use heartbeats (as documented here), or can propose its own
- heartbeat value, which the server should then accept. This is different from the model
- here which is disconnected - e.g. each side requests a heartbeat independently. Basically
- a connection is heartbeated in both ways, or not at all, depending on whether both peers
- support heartbeating or not, and the heartbeat value should itself be chosen by the client
- so that remote links can get a higher value. Also, the actual heartbeat mechanism needs
- documentation, and is as follows: so long as there is activity on a connection - in or out
- - both peers assume the connection is active. When there is no activity, each peer must
- send heartbeat frames. When no heartbeat frame is received after N cycles (where N is at
- least 2), the connection can be considered to have died. /PH 2006/07/19
- -->
- <doc>
- The delay, in seconds, of the connection heartbeat that the server wants. Zero means the
- server does not want a heartbeat.
- </doc>
- </field>
- </method>
-
- <!-- - Method: connection.tune-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="tune-ok" synchronous="1" index="31"
- label="negotiate connection tuning parameters">
- <doc>
- This method sends the client's connection tuning parameters to the server. Certain fields
- are negotiated, others provide capability information.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="channel-max" domain="short" label="negotiated maximum channels">
- <doc>
- The maximum total number of channels that the client will use per connection.
- </doc>
-
- <rule name="upper-limit">
- <doc>
- If the client specifies a channel max that is higher than the value provided by the
- server, the server MUST close the connection without attempting a negotiated close. The
- server may report the error in some fashion to assist implementors.
- </doc>
- </rule>
-
- <assert check="notnull" />
- <assert check="le" value="channel-max" />
- </field>
-
- <field name="frame-max" domain="long" label="negotiated maximum frame size">
- <doc>
- The largest frame size that the client and server will use for the connection. Zero means
- that the client does not impose any specific limit but may reject very large frames if it
- cannot allocate resources for them. Note that the frame-max limit applies principally to
- content frames, where large contents can be broken into frames of arbitrary size.
- </doc>
-
- <rule name="minimum">
- <doc>
- Until the frame-max has been negotiated, both peers MUST accept frames of up to
- frame-min-size octets large, and the minimum negotiated value for frame-max is also
- frame-min-size.
- </doc>
- </rule>
-
- <rule name="upper-limit">
- <doc>
- If the client specifies a frame max that is higher than the value provided by the
- server, the server MUST close the connection without attempting a negotiated close. The
- server may report the error in some fashion to assist implementors.
- </doc>
- </rule>
- </field>
-
- <field name="heartbeat" domain="short" label="desired heartbeat delay">
- <doc>
- The delay, in seconds, of the connection heartbeat that the client wants. Zero means the
- client does not want a heartbeat.
- </doc>
- </field>
- </method>
-
- <!-- - Method: connection.open - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="open" synchronous="1" index="40" label="open connection to virtual host">
- <doc>
- This method opens a connection to a virtual host, which is a collection of resources, and
- acts to separate multiple application domains within a server. The server may apply
- arbitrary limits per virtual host, such as the number of each type of entity that may be
- used, per connection and/or in total.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <response name="open-ok" />
- <response name="redirect" />
-
- <field name="virtual-host" domain="path" label="virtual host name">
- <!-- TODO 0.82 - the entire vhost model needs review. This concept was prompted by the HTTP
- vhost concept but does not fit very well into AMQP. Currently we use the vhost as a
- "cluster identifier" which is inaccurate usage. /PH 2006/07/19
- -->
- <doc>
- The name of the virtual host to work with.
- </doc>
-
- <rule name="separation">
- <doc>
- If the server supports multiple virtual hosts, it MUST enforce a full separation of
- exchanges, queues, and all associated entities per virtual host. An application,
- connected to a specific virtual host, MUST NOT be able to access resources of another
- virtual host.
- </doc>
- </rule>
-
- <rule name="security">
- <doc>
- The server SHOULD verify that the client has permission to access the specified virtual
- host.
- </doc>
- </rule>
- <assert check="regexp" value="^[a-zA-Z0-9/-_]+$" />
- </field>
-
- <field name="capabilities" domain="shortstr" label="required capabilities">
- <doc>
- The client can specify zero or more capability names, delimited by spaces. The server can
- use this string to how to process the client's connection request.
- </doc>
- </field>
-
- <field name="insist" domain="bit" label="insist on connecting to server">
- <doc>
- In a configuration with multiple collaborating servers, the server may respond to a
- Connection.Open method with a Connection.Redirect. The insist option tells the server that
- the client is insisting on a connection to the specified server.
- </doc>
- <rule name="behaviour">
- <doc>
- When the client uses the insist option, the server MUST NOT respond with a
- Connection.Redirect method. If it cannot accept the client's connection request it
- should respond by closing the connection with a suitable reply code.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: connection.open-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="open-ok" synchronous="1" index="41" label="signal that connection is ready">
- <doc>
- This method signals to the client that the connection is ready for use.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <field name="known-hosts" domain="known-hosts" />
- </method>
-
- <!-- - Method: connection.redirect - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="redirect" synchronous="1" index="42" label="redirects client to other server">
- <doc>
- This method redirects the client to another server, based on the requested virtual host
- and/or capabilities.
- </doc>
-
- <rule name="usage">
- <doc>
- When getting the Connection.Redirect method, the client SHOULD reconnect to the host
- specified, and if that host is not present, to any of the hosts specified in the
- known-hosts list.
- </doc>
- </rule>
-
- <chassis name="client" implement="MUST" />
-
- <field name="host" domain="shortstr" label="server to connect to">
- <doc>
- Specifies the server to connect to. This is an IP address or a DNS name, optionally
- followed by a colon and a port number. If no port number is specified, the client should
- use the default port number for the protocol.
- </doc>
- <assert check="notnull" />
- </field>
-
- <field name="known-hosts" domain="known-hosts" />
- </method>
-
- <!-- - Method: connection.close - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="close" synchronous="1" index="50" label="request a connection close">
- <doc>
- This method indicates that the sender wants to close the connection. This may be due to
- internal conditions (e.g. a forced shut-down) or due to an error handling a specific method,
- i.e. an exception. When a close is due to an exception, the sender provides the class and
- method id of the method which caused the exception.
- </doc>
- <!-- TODO: The connection close mechanism needs to be reviewed from the ODF documentation and
- better expressed as rules here. /PH 2006/07/20
- -->
-
- <rule name="stability">
- <doc>
- After sending this method any received method except the Close-OK method MUST be
- discarded.
- </doc>
- </rule>
-
- <chassis name="client" implement="MUST" />
- <chassis name="server" implement="MUST" />
-
- <response name="close-ok" />
-
- <field name="reply-code" domain="reply-code" />
- <field name="reply-text" domain="reply-text" />
-
- <field name="class-id" domain="class-id" label="failing method class">
- <doc>
- When the close is provoked by a method exception, this is the class of the method.
- </doc>
- </field>
-
- <field name="method-id" domain="method-id" label="failing method ID">
- <doc>
- When the close is provoked by a method exception, this is the ID of the method.
- </doc>
- </field>
- </method>
-
- <!-- - Method: connection.close-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="close-ok" synchronous="1" index="51" label="confirm a connection close">
- <doc>
- This method confirms a Connection.Close method and tells the recipient that it is safe to
- release resources for the connection and close the socket.
- </doc>
-
- <rule name="reporting">
- <doc>
- A peer that detects a socket closure without having received a Close-Ok handshake method
- SHOULD log the error.
- </doc>
- </rule>
-
- <chassis name="client" implement="MUST" />
- <chassis name="server" implement="MUST" />
- </method>
-
- </class>
-
- <!-- == Class: session ======================================================================= -->
-
- <class name="session" index="20" label="session control methods">
- <doc>
- The session class provides methods for a client to establish a session with a server and for
- both peers to operate the session thereafter.
- </doc>
-
- <doc type="grammar">
- session = open-session
- *use-session
- close-session
- open-session = C:OPEN S:ATTACHED
- / C:RESUME S:ATTACHED
- use-session = C:FLOW S:FLOW-OK
- / S:FLOW C:FLOW-OK
- / S:PING
- / C:PONG
- / C:PING
- / S:PONG
- close-session = C:SUSPEND S:DETACHED
- / C:CLOSE S:CLOSED
- / S:CLOSED
- / S:CLOSE C:CLOSED
- / C:CLOSED
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <!-- - Method: session.open - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="open" synchronous="1" index="10" label="open a session for use">
- <doc>
- This method opens a session with the server.
-
- When the responding peer creates the session, it MUST create a new, appropriately-unique
- name for the session and return this to the creator with the rest of the session details.
-
- Note that the timer controlling a session's automatic expiry, if any, counts down
- immediately from the moment of its creation, unless simultaneously with that moment a
- channel (or equivalent) is attached to the session. For this reason, it is recommended that
- network protocol mappings create sessions simultaneously with the creation and attachment of
- their channel-equivalents, since a zero lease time is perfectly valid and indicates that the
- session should be destroyed as soon as it first finds itself inactive.
-
- During the period that a channel (or equivalent) is attached to a session, the session has
- no deletion timer. Every time a channel is detached from a session such that the session is
- left without any attached network-level entities, the timer is created, set to its declared
- value and started.
-
- Note that if the peer decides that the requested detached-lifetime timeout is too long,
- either because the replying peer does not support sessions with non-zero requested timeouts,
- or because the requested timeout exceeds some peer-specific limitation, it may substitute an
- acceptable value for the detached-lifetime parameter in its reply to the creation request.
- An exception is not required.
- </doc>
-
- <rule name="expiration">
- <doc>
- Whether the detachment is explicit or implicit, as a result of application action or of
- application error, the channel (or equivalent) is detached from its session and the
- session timer MUST start counting down as defined in session.open.
- </doc>
- </rule>
-
- <rule name="channel-busy">
- <!-- TODO: Figure out how to make this error conditional to stateful network mappings with
- channels.
- -->
- <doc>
- The client MUST NOT send session.open on a channel that is already associated with a
- session. A "channel busy" connection exception will occur if the channel down which the
- open request was sent was already attached to a session.
- </doc>
- <doc type="scenario">
- Client sends session.open twice down the same channel.
- </doc>
- </rule>
-
- <!--
- <throws name="out-of-resources"/>
- -->
-
- <chassis name="server" implement="MUST" />
-
- <response name="attached" />
-
- <field name="detached-lifetime" domain="detached-lifetime">
- <doc>
- The number of seconds the session's state is retained during periods when no channel (or
- equivalent) is attached to the session.
- </doc>
- </field>
- </method>
-
- <!-- - Method: session.attached - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="attached" synchronous="1" index="11" label="signal that the session is ready">
- <doc>
- This method signals to the client that the session is ready for use.
-
- Once a session.attached is received by the client, everything is in place for normal
- transmission of frames. However, depending on the network protocol mapping in use, the
- frame-id be undefined until certain control frames have been sent. Please see the specific
- details for each protocol mapping.
-
- If the attached session was freshly created, the session-id here will be a freshly-generated
- UUID.
-
- Note that the actual session detached-lifetime value, as decided by the peer, is returned
- using this method. The value returned may not be the same as that requested in the
- corresponding session creation request. In particular, a request for an unbounded
- detached-lifetime of may be fulfilled by creation of a session with a bounded actual
- lifetime parameter. The requesting peer SHOULD take the lifetime value returned as
- authoritative for its own session-related record-keeping.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <field name="session-id" domain="session-id">
- <doc>
- The session identifier (a UUID) used to identify this session.
- </doc>
- </field>
-
- <field name="detached-lifetime" domain="detached-lifetime">
- <doc>
- The number of seconds the session's state is retained during periods when no channel (or
- equivalent) is attached to the session.
- </doc>
- </field>
- </method>
-
- <!-- - Method: session.flow - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="flow" synchronous="1" index="20" label="enable/disable flow from peer">
- <doc>
- This method asks the peer to pause or restart the flow of content data. This is a simple
- flow-control mechanism that a peer can use to avoid overflowing its queues or otherwise
- finding itself receiving more messages than it can process. Note that this method is not
- intended for window control. The peer that receives a disable flow method should finish
- sending the current content frame, if any, then pause.
- </doc>
-
- <rule name="initial-state">
- <doc>
- When a new session is opened, it is active (flow is active). Some applications assume that
- sessions are inactive until started. To emulate this behaviour a client MAY open the
- session, then pause it.
- </doc>
- </rule>
-
- <rule name="bidirectional">
- <doc>
- When sending content frames, a peer SHOULD monitor the session for incoming methods and
- respond to a Session.Flow as rapidly as possible.
- </doc>
- </rule>
-
- <rule name="throttling">
- <doc>
- A peer MAY use the Session.Flow method to throttle incoming content data for internal
- reasons, for example, when exchanging data over a slower connection.
- </doc>
- </rule>
-
- <rule name="expected-behaviour">
- <doc>
- The peer that requests a Session.Flow method MAY disconnect and/or ban a peer that does
- not respect the request. This is to prevent badly-behaved clients from overwhelming a
- broker.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <response name="flow-ok" />
-
- <field name="active" domain="bit" label="start/stop content frames">
- <doc>
- If true (1), the peer starts sending content frames. If false (0), the peer stops sending
- content frames.
- </doc>
- </field>
- </method>
-
- <!-- - Method: session.flow-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="flow-ok" index="21" label="confirm a flow method">
- <doc>
- Confirms to the peer that a flow command was received and processed.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="active" domain="bit" label="current flow setting">
- <doc>
- Confirms the setting of the processed flow method: true (1) means the peer will start
- sending or continue to send content frames; false (0) means it will not.
- </doc>
- </field>
- </method>
-
- <!-- - Method: session.close - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="close" index="40" label="request a session close">
- <doc>
- Requests that the receiving peer destroy a session, implicitly detaching any attached
- channels or channel-equivalents.
-
- Note that the reply, session.closed, is also used for asynchronous exception notifications.
- For normal closure, such as in response to a session.close request, reason code 200 ("ok")
- is to be used.
- </doc>
-
- <chassis name="client" implement="MUST" />
- <chassis name="server" implement="MUST" />
-
- <!--
- <response name="closed" />
- -->
- </method>
-
- <!-- - Method: session.closed - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="closed" index="41" label="notify of a session close">
- <doc>
- Notifies the receiver that not only has the current channel been detached from its
- underlying session, but that the session itself has been destroyed.
-
- This method confirms a session.close method and tells the recipient that it is safe to
- release resources for the channel.
-
- Note also that for normal closure, reason code 200 ("ok") is to be used.
- </doc>
-
- <chassis name="client" implement="MUST" />
- <chassis name="server" implement="MUST" />
-
- <field name="reply-code" domain="reply-code">
- <doc>
- The numeric reply code.
- </doc>
- </field>
-
- <field name="reply-text" domain="reply-text">
- <doc>
- The localised reply text.
- </doc>
- </field>
- </method>
-
- <!-- - Method: session.resume - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="resume" index="50" label="resume an interrupted session">
- <doc>
- Attaches to an already-existing session.
- </doc>
-
- <rule name="session-busy">
- <doc>
- A "session busy" exception is returned if the session exists, but is not in a condition
- where it can accept the requested attachment. Peers receiving this exception may wish to
- retain their session state and retry the session.resume operation after a delay.
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
-
- <response name="attached" />
-
- <field name="session-id" domain="session-id">
- <doc>
- The session identifier (a UUID) used to identify this session.
- </doc>
- </field>
- </method>
-
- <!-- - Method: session.suspend - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="suspend" index="90" label="suspend the session">
- <doc>
- Indicates the sending peer wishes to detach from this session, but not necessarily to
- destroy it.
- </doc>
-
- <!-- TODO: Ratify the inclusion of the chassis element in the XML. -->
- <chassis name="server" implement="MAY" />
-
- <response name="detached"/>
- </method>
-
- <!-- - Method: session.detached - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="detached" index="100" label="signal detachment of the session">
- <doc>
- Signal detachment from the session.
- </doc>
- <!-- TODO: Ratify the inclusion of the chassis element in the XML. -->
- <chassis name="client" implement="MAY" />
- </method>
-
- <!-- - Method: session.ack - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <!-- TODO: This method does not appear in any grammar as yet... -->
- <method name="ack" index="110" label="acknowledge receipt of frames">
- <doc>
- Signals receipt of all frames such that frame-id &lt;= cumulative-seen-mark, or frame-id is
- in the set defined by seen-frame-set. This can be sent spontaneously, or in response to
- either session.solicit-ack or session.high-water-mark.
-
- Note that an encoded acknowledgement frame carried over the TCP network mapping (in the
- absence of cross-protocol use of a session) will never have any entries in its
- seen-frame-set.
-
- <!-- TODO: See chapter (TBD here) for how frame ids are computed. -->
- </doc>
-
- <rule name="unique-encoding">
- <doc>
- In order to ensure a canonical wire representation, the value cumulative-seen-mark +
- 1 must not be covered by the seen-frame-set.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="cumulative-seen-mark" domain="rfc1982-long" label="Low-water mark for seen ids">
- <doc>
- The low-water mark for seen frame-ids. All ids below this mark have been seen; above this
- mark, there are gaps containing unseen ids (i.e. discontinuous). By definition, the first
- frame-id above this mark (if it exists) is an unseen id.
- </doc>
- </field>
-
- <field name="seen-frame-set" domain="rfc1982-long-set"
- label="Set of discontinuous seen ids above cumulative-seen-mark">
- <doc>
- This set contains a sequence of discontinuous seen-frame-ids above the low-water mark
- (i.e. above the first gap of unseen ids). In some transports where out-of-order delivery
- is not possible (such as TCP), this set will always be empty.
- </doc>
- </field>
- </method>
-
- <!-- - Method: session.high-water-mark - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="high-water-mark" index="120" label="Inform the peer of most recent sent frame-id">
- <doc>
- Carries information about the highest (most recent) frame-id number that the sending peer
- has sent through this session so far.
-
- The receiver should issue a session.ack at the earliest possible opportunity.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="last-sent-mark" domain="rfc1982-long" label="Frame-id of last sent frame">
- <doc>
- Highest frame-id sent by the sending peer through this session so far.
- </doc>
- </field>
- </method>
-
- <!-- - Method: session.solicit-ack - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="solicit-ack" index="130" label="request an ack">
- <doc>
- Requests a session.ack from the peer. The peer should issue one at the earliest possible
- opportunity.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
- </method>
-
- </class>
-
- <!-- == Class: access ======================================================================== -->
-
- <!-- TODO 0.82 - this class must be implemented by two teams before we can consider it matured.
- -->
-
- <class name="access" index="30" label="work with access tickets">
- <doc>
- The protocol control access to server resources using access tickets. A client must explicitly
- request access tickets before doing work. An access ticket grants a client the right to use a
- specific set of resources - called a "realm" - in specific ways.
- </doc>
-
- <doc type="grammar">
- access = C:REQUEST S:REQUEST-OK
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <!-- - Method: access.request - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="request" synchronous="1" index="10" label="request an access ticket">
- <doc>
- This method requests an access ticket for an access realm. The server responds by granting
- the access ticket. If the client does not have access rights to the requested realm this
- causes a connection exception. Access tickets are a per-session resource.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <response name="request-ok" />
-
- <field name="realm" domain="shortstr" label="name of requested realm">
- <doc>
- Specifies the name of the realm to which the client is requesting access. The realm is a
- configured server-side object that collects a set of resources (exchanges, queues, etc.).
- If the session has already requested an access ticket onto this realm, the previous ticket
- is destroyed and a new ticket is created with the requested access rights, if allowed.
- </doc>
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST specify a realm that is known to the server. The server makes an
- identical response for undefined realms as it does for realms that are defined but
- inaccessible to this client.
- </doc>
- <doc type="scenario">
- Client specifies an undefined realm.
- </doc>
- </rule>
- </field>
-
- <field name="exclusive" domain="bit" label="request exclusive access">
- <doc>
- Request exclusive access to the realm, meaning that this will be the only session that
- uses the realm's resources.
- </doc>
- <rule name="in-use" on-failure="access-refused">
- <doc>
- The client MUST NOT request exclusive access to a realm that has active access tickets,
- unless the same session already had the only access ticket onto that realm.
- </doc>
- <doc type="scenario">
- Client opens two sessions and requests exclusive access to the same realm.
- </doc>
- </rule>
- </field>
-
- <field name="passive" domain="bit" label="request passive access">
- <doc>
- Request message passive access to the specified access realm. Passive access lets a client
- get information about resources in the realm but not to make any changes to them.
- </doc>
- </field>
-
- <field name="active" domain="bit" label="request active access">
- <doc>
- Request message active access to the specified access realm. Active access lets a client
- get create and delete resources in the realm.
- </doc>
- </field>
-
- <field name="write" domain="bit" label="request write access">
- <doc>
- Request write access to the specified access realm. Write access lets a client publish
- messages to all exchanges in the realm.
- </doc>
- </field>
-
- <field name="read" domain="bit" label="request read access">
- <doc>
- Request read access to the specified access realm. Read access lets a client consume
- messages from queues in the realm.
- </doc>
- </field>
- </method>
-
- <!-- - Method: access.request-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="request-ok" synchronous="1" index="11" label="grant access to server resources">
- <doc>
- This method provides the client with an access ticket. The access ticket is valid within the
- current session and for the lifespan of the session.
- </doc>
-
- <rule name="per-session" on-failure="not-allowed">
- <doc>
- The client MUST NOT use access tickets except within the same session as originally
- granted.
- </doc>
- <doc type="scenario">
- Client opens two sessions, requests a ticket on one session and then tries to use that
- ticket in a second session.
- </doc>
- </rule>
-
- <chassis name="client" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <doc>
- A valid access ticket to be used for gaining access to the server.
- </doc>
- </field>
- </method>
-
- </class>
-
- <!-- == Class: exchange ====================================================================== -->
-
- <class name="exchange" index="40" label="work with exchanges">
- <doc>
- Exchanges match and distribute messages across queues. Exchanges can be configured in the
- server or created at runtime.
- </doc>
-
- <doc type="grammar">
- exchange = C:DECLARE
- / C:DELETE
- </doc>
-
- <rule name="required-types">
- <doc>
- The server MUST implement these standard exchange types: fanout, direct.
- </doc>
- <doc type="scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
-
- <rule name="recommended-types">
- <doc>
- The server SHOULD implement these standard exchange types: topic, headers.
- </doc>
- <doc type="scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
-
- <rule name="required-instances">
- <doc>
- The server MUST, in each virtual host, pre-declare an exchange instance for each standard
- exchange type that it implements, where the name of the exchange instance, if defined, is
- "amq." followed by the exchange type name.
-
- The server MUST, in each virtual host, pre-declare at least two direct exchange instances:
- one named "amq.direct", the other with no public name that serves as a default exchange for
- publish methods (such as message.transfer).
- </doc>
- <doc type="scenario">
- Client creates a temporary queue and attempts to bind to each required exchange instance
- ("amq.fanout", "amq.direct", "amq.topic", and "amq.headers" if those types are defined).
- </doc>
- </rule>
-
- <rule name="default-exchange">
- <doc>
- The server MUST pre-declare a direct exchange with no public name to act as the default
- exchange for content publish methods (such as message.transfer) and for default queue
- bindings.
- </doc>
- <doc type="scenario">
- Client checks that the default exchange is active by publishing a message with a suitable
- routing key but without specifying the exchange name, then ensuring that the message arrives
- in the queue correctly.
- </doc>
- </rule>
-
- <rule name="default-access">
- <doc>
- The default exchange MUST NOT be accessible to the client except by specifying an empty
- exchange name in a content publish method (such as message.transfer). That is, the server
- must not let clients explicitly bind, unbind, delete, or make any other reference to this
- exchange.
- </doc>
- </rule>
-
- <rule name="extensions">
- <doc>
- The server MAY implement other exchange types as wanted.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <!-- - Method: exchange.declare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="declare" synchronous="1" index="10"
- label="verify exchange exists, create if needed">
- <doc>
- This method creates an exchange if it does not already exist, and if the exchange exists,
- verifies that it is of the correct and expected class.
- </doc>
-
- <rule name="minimum">
- <doc>
- The server SHOULD support a minimum of 16 exchanges per virtual host and ideally, impose
- no limit except as defined by available resources.
- </doc>
- <doc type="scenario">
- The client creates as many exchanges as it can until the server reports an error; the
- number of exchanges successfully created must be at least sixteen.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <doc>
- When a client defines a new exchange, this belongs to the access realm of the ticket used.
- All further work done with that exchange must be done with an access ticket for the same
- realm.
- </doc>
-
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access to the realm in
- which the exchange exists or will be created, or "passive" access if the if-exists flag
- is set.
- </doc>
- <doc type="scenario">
- Client creates access ticket with wrong access rights and attempts to use in this
- method.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="exchange" domain="exchange-name">
- <rule name="reserved-names" on-failure="access-refused">
- <doc>
- Exchange names starting with "amq." are reserved for pre-declared and standardised
- exchanges. The client MUST NOT attempt to create an exchange starting with "amq.".
- </doc>
- </rule>
-
- <rule name="exchange-name-required" on-failure="not-allowed">
- <doc>
- The name of the exchange MUST NOT be a blank or empty string.
- </doc>
- </rule>
- </field>
-
- <field name="type" domain="shortstr" label="exchange type">
- <doc>
- Each exchange belongs to one of a set of exchange types implemented by the server. The
- exchange types define the functionality of the exchange - i.e. how messages are routed
- through it. It is not valid or meaningful to attempt to change the type of an existing
- exchange.
- </doc>
-
- <rule name="typed" on-failure="not-allowed">
- <doc>
- Exchanges cannot be redeclared with different types. The client MUST not attempt to
- redeclare an existing exchange with a different type than used in the original
- Exchange.Declare method.
- </doc>
- </rule>
-
- <rule name="support" on-failure="command-invalid">
- <doc>
- The client MUST NOT attempt to create an exchange with a type that the server does not
- support.
- </doc>
- </rule>
-
- <assert check="regexp" value="^[a-zA-Z0-9-_.:]+$" />
- </field>
-
- <field name="alternate-exchange" domain="exchange-name"
- label= "exchange-name for unroutable messages">
- <doc>
- In the event that a message cannot be routed, this is the name of the exchange to which
- the message will be sent.
- </doc>
-
- <rule name="empty-name">
- <doc>
- If alternate-exchange is not set (its name is an empty string), unroutable messages MUST
- be dropped silently.
- </doc>
- </rule>
-
- <rule name="pre-existing-exchange" on-failure="channel-error">
- <doc>
- If the alternate-exchange is not empty and if the exchange already exists with a
- different alternate-exchange, then the declaration MUST result in a channel error.
- </doc>
- </rule>
-
- <rule name="double-failure">
- <doc>
- A message which is being routed to a alternate exchange, MUST NOT be re-routed to a
- secondary alternate exchange if it fails to route in the primary alternate exchange.
- After such a failure, the message MUST be dropped. This prevents looping.
- </doc>
- </rule>
- </field>
-
- <field name="passive" domain="bit" label="do not create exchange">
- <doc>
- If set, the server will not create the exchange. The client can use this to check whether
- an exchange exists without modifying the server state.
- </doc>
- <rule name="not-found" on-failure="not-found">
- <doc>
- If set, and the exchange does not already exist, the server MUST raise a channel
- exception with reply code 404 (not found).
- </doc>
- </rule>
- </field>
-
- <field name="durable" domain="bit" label="request a durable exchange">
- <doc>
- If set when creating a new exchange, the exchange will be marked as durable. Durable
- exchanges remain active when a server restarts. Non-durable exchanges (transient
- exchanges) are purged if/when a server restarts.
- </doc>
-
- <rule name="support">
- <doc>
- The server MUST support both durable and transient exchanges.
- </doc>
- </rule>
-
- <rule name="sticky">
- <doc>
- The server MUST ignore the durable field if the exchange already exists.
- </doc>
- </rule>
- </field>
-
- <field name="auto-delete" domain="bit" label="auto-delete when unused">
- <doc>
- If set, the exchange is deleted when all queues have finished using it.
- </doc>
- <rule name="sticky">
- <doc>
- The server MUST ignore the auto-delete field if the exchange already exists.
- </doc>
- </rule>
- </field>
-
- <field name="arguments" domain="table" label="arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these arguments
- depends on the server implementation. This field is ignored if passive is 1.
- </doc>
- </field>
- </method>
-
- <!-- - Method: exchange.delete - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="delete" synchronous="1" index="20" label="delete an exchange">
- <doc>
- This method deletes an exchange. When an exchange is deleted all queue bindings on the
- exchange are cancelled.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access rights to the
- exchange's access realm.
- </doc>
- <doc type="scenario">
- Client creates access ticket with wrong access rights and attempts to use in this
- method.
- </doc>
- </rule>
- </field>
-
- <field name="exchange" domain="exchange-name">
- <rule name="exists" on-failure="not-found">
- <doc>
- The client MUST NOT attempt to delete an exchange that does not exist.
- </doc>
- </rule>
-
- <rule name="exchange-name-required" on-failure="not-allowed">
- <doc>
- The name of the exchange MUST NOT be a blank or empty string.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <!-- TODO 0.82 - discuss whether this option is useful or not. I don't have any real use case
- for it. /PH 2006-07-23.
- -->
- <field name="if-unused" domain="bit" label="delete only if unused">
- <doc>
- If set, the server will only delete the exchange if it has no queue bindings. If the
- exchange has queue bindings the server does not delete it but raises a channel exception
- instead.
- </doc>
- </field>
- </method>
-
- <!-- - Method: exchange.query - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="query" synchronous="1" index="30" label="request information about an exchange">
- <doc>
- This method is used to request information on a particular exchange.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "passive" access rights to the
- exchange's access realm.
- </doc>
- </rule>
- </field>
-
- <field name="name" domain="shortstr" label="the exchange name">
- <doc>
- The name of the exchange for which information is requested. If not specified explicitly
- the default exchange is implied.
- </doc>
- </field>
-
- <result>
- <struct size="long" type="31">
- <doc>
- This is sent in response to a query request and conveys information on a particular
- exchange.
- </doc>
-
- <field name="type" domain="shortstr" label="indicate the exchange type">
- <doc>
- The type of the exchange. Will be empty if the exchange is not found.
- </doc>
- </field>
-
- <field name="durable" domain="bit" label="indicate the durability">
- <doc>
- The durability of the exchange, i.e. if set the exchange is durable. Will not be set if
- the exchange is not found.
- </doc>
- </field>
-
- <field name="not-found" domain="bit" label="indicate an unknown exchange">
- <doc>
- If set, the exchange for which information was requested is not known.
- </doc>
- </field>
-
- <field name="arguments" domain="table" label="other unspecified exchange properties">
- <doc>
- A set of properties of the exchange whose syntax and semantics depends on the server
- implementation. Will be empty if the exchange is not found.
- </doc>
- </field>
- </struct>
- </result>
- </method>
-
- </class>
-
- <!-- == Class: queue ========================================================================= -->
-
- <class name="queue" index="50" label="work with queues">
- <doc>
- Queues store and forward messages. Queues can be configured in the server or created at
- runtime. Queues must be attached to at least one exchange in order to receive messages from
- publishers.
- </doc>
-
- <doc type="grammar">
- queue = C:DECLARE
- / C:BIND
- / C:PURGE
- / C:DELETE
- / C:QUERY
- / C:UNBIND
- </doc>
-
- <rule name="any-content">
- <doc>
- A server MUST allow any content class to be sent to any queue, in any mix, and queue and
- deliver these content classes independently. Note that all methods that fetch content off
- queues are specific to a given content class.
- </doc>
- <doc type="scenario">
- Client creates an exchange of each standard type and several queues that it binds to each
- exchange. It must then successfully send each of the standard content types to each of the
- available queues.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <!-- - Method: queue.declare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="declare" synchronous="1" index="10" label="declare queue, create if needed">
- <doc>
- This method creates or checks a queue. When creating a new queue the client can specify
- various properties that control the durability of the queue and its contents, and the level
- of sharing for the queue.
- </doc>
-
- <rule name="default-binding">
- <doc>
- The server MUST create a default binding for a newly-created queue to the default
- exchange, which is an exchange of type 'direct' and use the queue name as the routing key.
- </doc>
- <doc type="scenario">
- Client creates a new queue, and then without explicitly binding it to an exchange,
- attempts to send a message through the default exchange binding, i.e. publish a message to
- the empty exchange, with the queue name as routing key.
- </doc>
- </rule>
-
- <rule name="minimum-queues">
- <doc>
- The server SHOULD support a minimum of 256 queues per virtual host and ideally, impose no
- limit except as defined by available resources.
- </doc>
- <doc type="scenario">
- Client attempts to create as many queues as it can until the server reports an error. The
- resulting count must at least be 256.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <doc>
- When a client defines a new queue, this belongs to the access realm of the ticket used.
- All further work done with that queue must be done with an access ticket for the same
- realm.
- </doc>
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access to the realm in
- which the queue exists or will be created.
- </doc>
- <doc type="scenario">
- Client creates access ticket with wrong access rights and attempts to use in this
- method.
- </doc>
- </rule>
- </field>
-
- <field name="queue" domain="queue-name">
- <rule name="reserved-prefix" on-failure="not-allowed">
- <doc>
- Queue names starting with "amq." are reserved for pre-declared and standardised server
- queues. A client MUST NOT attempt to declare a queue with a name that starts with "amq."
- and the passive option set to zero.
- </doc>
- <doc type="scenario">
- A client attempts to create a queue with a name starting with "amq." and with the
- passive option set to zero.
- </doc>
- </rule>
- </field>
-
- <field name="alternate-exchange" domain="exchange-name"
- label= "exchange-name for messages with exceptions">
- <doc>
- If a message is rejected by a queue, then it is sent to the alternate-exchange. A message
- may be rejected by a queue for the following reasons:
- 1. The queue is deleted when it is not empty;
- 2. Immediate delivery of a message is requested, but there are no consumers connected to
- the queue.
- </doc>
-
- <rule name="empty">
- <doc>
- If alternate-exchange is not set (its name is an empty string), rejected messages MUST
- be dropped silently.
- </doc>
- </rule>
-
- <rule name="pre-existing-exchange" on-failure="channel-error">
- <doc>
- If the alternate-exchange is not empty and if the queue already exists with a different
- alternate-exchange, then the declaration MUST result in a channel error.
- </doc>
- </rule>
-
- <rule name="delete-exchange" on-failure="channel-error">
- <doc>
- The alternate-exchange MUST NOT be deleted while a queue bound to it still exists. Such
- an attempt MUST result in a channel exception.
- </doc>
- </rule>
- </field>
-
- <field name="passive" domain="bit" label="do not create queue">
- <doc>
- If set, the server will not create the queue. This field allows the client to assert the
- presence of a queue without modifying the server state.
- </doc>
-
- <rule name="passive" on-failure="not-found">
- <doc>
- The client MAY ask the server to assert that a queue exists without creating the queue
- if not. If the queue does not exist, the server treats this as a failure.
- </doc>
- <doc type="scenario">
- Client declares an existing queue with the passive option and expects the command to
- succeed. Client then attempts to declare a non-existent queue with the passive option,
- and the server must close the channel with the correct reply-code.
- </doc>
- </rule>
- </field>
-
- <field name="durable" domain="bit" label="request a durable queue">
- <doc>
- If set when creating a new queue, the queue will be marked as durable. Durable queues
- remain active when a server restarts. Non-durable queues (transient queues) are purged
- if/when a server restarts. Note that durable queues do not necessarily hold persistent
- messages, although it does not make sense to send persistent messages to a transient
- queue.
- </doc>
-
- <rule name="persistence">
- <doc>
- The server MUST recreate the durable queue after a restart.
- </doc>
- <doc type="scenario">
- Client creates a durable queue; server is then restarted. Client then attempts to send
- message to the queue. The message should be successfully delivered.
- </doc>
- </rule>
-
- <rule name="types">
- <doc>
- The server MUST support both durable and transient queues.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one durable and one transient.
- </doc>
- </rule>
-
- <rule name="pre-existence">
- <doc>
- The server MUST ignore the durable field if the queue already exists.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one durable and one transient. The client then
- attempts to declare the two queues using the same names again, but reversing the value
- of the durable flag in each case. Verify that the queues still exist with the original
- durable flag values.
- <!-- TODO: but how? -->
- </doc>
- </rule>
- </field>
-
- <field name="exclusive" domain="bit" label="request an exclusive queue">
- <doc>
- Exclusive queues can only be used from one connection at a time. Once a connection
- declares an exclusive queue, that queue cannot be used by any other connections until the
- declaring connection closes.
- </doc>
-
- <rule name="types">
- <doc>
- The server MUST support both exclusive (private) and non-exclusive (shared) queues.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one exclusive and one non-exclusive.
- </doc>
- </rule>
-
- <rule name="in-use" on-failure="resource-locked">
- <doc>
- If the server receives a declare, bind, consume or get request for a queue that has been
- declared as exclusive by an existing client connection, it MUST raise a channel
- exception.
- </doc>
- <doc type="scenario">
- A client declares an exclusive named queue. A second client on a different connection
- attempts to declare a queue of the same name.
- </doc>
- </rule>
- </field>
-
- <field name="auto-delete" domain="bit" label="auto-delete queue when unused">
- <doc>
- If this field is set and the exclusive field is also set, then the queue MUST be deleted
- when the connection closes.
-
- If this field is set and the exclusive field is not set the queue is deleted when all
- the consumers have finished using it. Last consumer can be cancelled either explicitly
- or because its channel is closed. If there was no consumer ever on the queue, it won't
- be deleted.
- </doc>
-
- <rule name="pre-existence">
- <doc>
- The server MUST ignore the auto-delete field if the queue already exists.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one as auto-delete and one explicit-delete. The
- client then attempts to declare the two queues using the same names again, but reversing
- the value of the auto-delete field in each case. Verify that the queues still exist with
- the original auto-delete flag values.
- <!-- TODO: but how? -->
- </doc>
- </rule>
- </field>
-
- <field name="arguments" domain="table" label="arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these arguments
- depends on the server implementation. This field is ignored if passive is 1.
- </doc>
- </field>
- </method>
-
- <!-- - Method: queue.bind - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="bind" synchronous="1" index="20" label="bind queue to an exchange">
- <doc>
- This method binds a queue to an exchange. Until a queue is bound it will not receive any
- messages. In a classic messaging model, store-and-forward queues are bound to a direct
- exchange and subscription queues are bound to a topic exchange.
- </doc>
-
- <rule name="duplicates">
- <doc>
- A server MUST allow ignore duplicate bindings - that is, two or more bind methods for a
- specific queue, with identical arguments - without treating these as an error.
- </doc>
- <doc type="scenario">
- A client binds a named queue to an exchange. The client then repeats the bind (with
- identical arguments).
- </doc>
- </rule>
-
- <rule name="failure">
- <!--
- TODO: Find correct on-failure code. The on-failure code returned should depend on why the
- bind failed. Assuming that failures owing to bad parameters are covered in the rules
- relating to those parameters, the only remaining reason for a failure would be the lack of
- server resorces or some internal error - such as too many queues open. Would these cases
- qualify as "resource error" 506 or "internal error" 541?
- -->
- <doc>
- If a bind fails, the server MUST raise a connection exception.
- </doc>
- </rule>
-
- <rule name="transient-exchange" on-failure="not-allowed">
- <doc>
- The server MUST NOT allow a durable queue to bind to a transient exchange.
- </doc>
- <doc type="scenario">
- A client creates a transient exchange. The client then declares a named durable queue and
- then attempts to bind the transient exchange to the durable queue.
- </doc>
- </rule>
-
- <rule name="durable-exchange">
- <doc>
- Bindings for durable queues are automatically durable and the server SHOULD restore such
- bindings after a server restart.
- </doc>
- <doc type="scenario">
- A server creates a named durable queue and binds it to a durable exchange. The server is
- restarted. The client then attempts to use the queue/exchange combination.
- </doc>
- </rule>
-
- <rule name="internal-exchange" on-failure="not-allowed">
- <doc>
- If the client attempts to bind to an exchange that was declared as internal, the server
- MUST raise a connection exception with reply code 530 (not allowed).
- </doc>
- <doc type="scenario">
- A client attempts to bind a named queue to an internal exchange.
- </doc>
- </rule>
-
- <rule name="binding-count">
- <doc>
- The server SHOULD support at least 4 bindings per queue, and ideally, impose no limit
- except as defined by available resources.
- </doc>
- <doc type="scenario">
- A client creates a named queue and attempts to bind it to 4 different non-internal
- exchanges.
- </doc>
- </rule>
-
- <rule name="multiple-bindings">
- <doc>
- Where more than one binding exists between a particular exchange instance and a particular
- queue instance any given message published to that exchange should be delivered to that
- queue at most once, regardless of how many distinct bindings match.
- </doc>
- <doc type="scenario">
- A client creates a named queue and binds it to the same topic exchange at least three
- times using intersecting routing keys (for example, "animals.*", "animals.dogs.*",
- "animal.dogs.chihuahua"). Verify that a message matching all the bindings (using previous
- example, routing key = "animal.dogs.chihuahua") is delivered once only.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client provides a valid access ticket giving "active" access rights to the queue's
- access realm.
- </doc>
- </rule>
- </field>
-
- <field name="queue" domain="queue-name">
- <doc>
- Specifies the name of the queue to bind. If the queue name is empty, refers to the current
- queue for the session, which is the last declared queue.
- </doc>
-
- <rule name="empty-queue" on-failure="not-allowed">
- <doc>
- A client MUST NOT be allowed to bind a non-existent and unnamed queue (i.e. empty queue
- name) to an exchange.
- </doc>
- <doc type="scenario">
- A client attempts to bind with an unnamed (empty) queue name to an exchange.
- </doc>
- </rule>
-
- <rule name="queue-existence" on-failure="not-found">
- <doc>
- A client MUST NOT be allowed to bind a non-existent queue (i.e. not previously declared)
- to an exchange.
- </doc>
- <doc type="scenario">
- A client attempts to bind an undeclared queue name to an exchange.
- </doc>
- </rule>
- </field>
-
- <field name="exchange" domain="exchange-name" label="name of the exchange to bind to">
- <rule name="exchange-existence" on-failure="not-found">
- <doc>
- A client MUST NOT be allowed to bind a queue to a non-existent exchange.
- </doc>
- <doc type="scenario">
- A client attempts to bind a named queue to a undeclared exchange.
- </doc>
- </rule>
-
- <rule name="exchange-name-required" on-failure="not-allowed">
- <doc>
- The name of the exchange MUST NOT be a blank or empty string.
- </doc>
- </rule>
- </field>
-
- <field name="routing-key" domain="shortstr" label="message routing key">
- <doc>
- Specifies the routing key for the binding. The routing key is used for routing messages
- depending on the exchange configuration. Not all exchanges use a routing key - refer to
- the specific exchange documentation. If the queue name is empty, the server uses the last
- queue declared on the session. If the routing key is also empty, the server uses this
- queue name for the routing key as well. If the queue name is provided but the routing key
- is empty, the server does the binding with that empty routing key. The meaning of empty
- routing keys depends on the exchange implementation.
- </doc>
- <rule name="direct-exchange-key-matching">
- <doc>
- If a message queue binds to a direct exchange using routing key K and a publisher sends
- the exchange a message with routing key R, then the message MUST be passed to the
- message queue if K = R.
- </doc>
- </rule>
- </field>
-
- <field name="arguments" domain="table" label="arguments for binding">
- <doc>
- A set of arguments for the binding. The syntax and semantics of these arguments depends on
- the exchange class.
- </doc>
- </field>
- </method>
-
- <!-- - Method: queue.unbind - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="unbind" synchronous="1" index="50" label="unbind a queue from an exchange">
- <doc>
- This method unbinds a queue from an exchange.
- </doc>
-
- <rule name="failure">
- <doc>
- If a unbind fails, the server MUST raise a connection exception.
- <!-- TODO: define failure code -->
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client provides a valid access ticket giving "active" access rights to the queue's
- access realm.
- </doc>
- </rule>
- </field>
-
- <field name="queue" domain="queue-name">
- <doc>
- Specifies the name of the queue to unbind.
- </doc>
- <rule name="non-existent-queue" on-failure="not-found">
- <doc>
- If the queue does not exist the server MUST raise a channel exception with reply code
- 404 (not found).
- </doc>
- </rule>
- </field>
-
- <field name="exchange" domain="exchange-name">
- <doc>
- The name of the exchange to unbind from.
- </doc>
-
- <rule name="non-existent-exchange" on-failure="not-found">
- <doc>
- If the exchange does not exist the server MUST raise a channel exception with reply code
- 404 (not found).
- </doc>
- </rule>
-
- <rule name="exchange-name-required" on-failure="not-allowed">
- <doc>
- The name of the exchange MUST NOT be a blank or empty string.
- </doc>
- </rule>
- </field>
-
- <field name="routing-key" domain="shortstr" label="routing key of binding">
- <doc>
- Specifies the routing key of the binding to unbind.
- </doc>
- </field>
-
- <field name="arguments" domain="table" label="arguments of binding">
- <doc>
- Specifies the arguments of the binding to unbind.
- </doc>
- </field>
- </method>
-
- <!-- - Method: queue.purge - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="purge" synchronous="1" index="30" label="purge a queue">
- <doc>
- This method removes all messages from a queue. It does not cancel consumers. Purged messages
- are deleted without any formal "undo" mechanism.
- </doc>
-
- <rule name="empty">
- <doc>
- A call to purge MUST result in an empty queue.
- </doc>
- </rule>
-
- <rule name="tx-exception">
- <doc>
- On transacted sessions the server MUST not purge messages that have already been sent to a
- client but not yet acknowledged.
- </doc>
- </rule>
-
- <rule name="purge-recovery">
- <doc>
- The server MAY implement a purge queue or log that allows system administrators to recover
- accidentally-purged messages. The server SHOULD NOT keep purged messages in the same
- storage spaces as the live messages since the volumes of purged messages may get very
- large.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to the queue's
- access realm. Note that purging a queue is equivalent to reading all messages and
- discarding them.
- </doc>
- </rule>
- </field>
-
- <field name="queue" domain="queue-name">
- <doc>
- Specifies the name of the queue to purge. If the queue name is empty, refers to the
- current queue for the session, which is the last declared queue.
- </doc>
-
- <rule name="empty-name" on-failure="not-allowed">
- <doc>
- If the client did not previously declare a queue, and the queue name in this method is
- empty, the server MUST raise a connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
-
- <rule name="queue-exists" on-failure="not-found">
- <doc>
- The queue MUST exist. Attempting to purge a non-existing queue MUST cause a channel
- exception with reply code 404 (not found).
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: queue.delete - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="delete" synchronous="1" index="40" label="delete a queue">
- <doc>
- This method deletes a queue. When a queue is deleted any pending messages are sent to a
- dead-letter queue if this is defined in the server configuration, and all consumers on the
- queue are cancelled.
- </doc>
-
- <rule name="dead-letter-queue">
- <doc>
- The server SHOULD use a dead-letter queue to hold messages that were pending on a deleted
- queue, and MAY provide facilities for a system administrator to move these messages back
- to an active queue.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client provides a valid access ticket giving "active" access rights to the queue's
- access realm.
- </doc>
- </rule>
- </field>
-
- <field name="queue" domain="queue-name">
- <doc>
- Specifies the name of the queue to delete. If the queue name is empty, refers to the
- current queue for the session, which is the last declared queue.
- </doc>
-
- <rule name="empty-name" on-failure="not-allowed">
- <doc>
- If the client did not previously declare a queue, and the queue name in this method is
- empty, the server MUST raise a connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
-
- <rule name="queue-exists" on-failure="not-found">
- <doc>
- The queue must exist. If the client attempts to delete a non-existing queue the server
- MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
- </field>
-
- <field name="if-unused" domain="bit" label="delete only if unused">
- <doc>
- If set, the server will only delete the queue if it has no consumers. If the queue has
- consumers the server does does not delete it but raises a channel exception instead.
- </doc>
-
- <rule name="if-unused-flag">
- <doc>
- The server MUST respect the if-unused flag when deleting a queue.
- </doc>
- </rule>
- </field>
-
- <field name="if-empty" domain="bit" label="delete only if empty">
- <doc>
- If set, the server will only delete the queue if it has no messages.
- </doc>
- <rule name="not-empty" on-failure="precondition-failed">
- <doc>
- If the queue is not empty the server MUST raise a channel exception with reply code 406
- (precondition failed).
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: queue.query - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="query" synchronous="1" index="60" label="request information about a queue">
- <doc>
- This method requests information about a queue.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
-
- <field name="queue" domain="queue-name" label="the queried queue">
- <assert check="notnull" />
- </field>
-
- <result>
- <struct size="long" type="61">
- <doc>
- This is sent in response to queue.query, and conveys the requested information about a
- queue.
- </doc>
-
- <field name="queue" domain="queue-name">
- <doc>
- Reports the name of the queue.
- </doc>
- <assert check="notnull" />
- </field>
-
- <field name="alternate-exchange" domain="exchange-name" />
-
- <field name="durable" domain="bit" />
-
- <field name="exclusive" domain="bit" />
-
- <field name="auto-delete" domain="bit" />
-
- <field name="arguments" domain="table" />
-
- <field name="message-count" domain="long" label="number of messages in queue">
- <doc>
- Reports the number of messages in the queue.
- </doc>
- </field>
-
- <field name="consumer-count" domain="long" label="number of consumers">
- <doc>
- Reports the number of active consumers for the queue. Note that consumers can suspend
- activity (Session.Flow) in which case they do not appear in this count.
- </doc>
- </field>
- </struct>
- </result>
- </method>
-
- </class>
-
- <!-- == Class: basic ========================================================================= -->
-
- <class name="basic" index="60" label="[DEPRECATED] work with basic content">
- <doc>
- [DEPRECATED: replaced by message class.] The Basic class provides methods that support an
- industry-standard messaging model.
- </doc>
-
- <doc type="grammar">
- basic = C:QOS
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL
- / C:PUBLISH content
- / S:RETURN content
- / S:DELIVER content
- / C:GET ( S:GET-OK content / S:GET-EMPTY )
- / C:ACK
- / C:REJECT
- </doc>
-
- <rule name="persistence">
- <doc>
- The server SHOULD respect the persistent property of basic messages and SHOULD make a
- best-effort to hold persistent basic messages on a reliable storage mechanism.
- </doc>
- <doc type="scenario">
- Send a persistent message to queue, stop server, restart server and then verify whether
- message is still present. Assumes that queues are durable. Persistence without durable
- queues makes no sense.
- </doc>
- </rule>
-
- <rule name="persistent-overflow">
- <doc>
- The server MUST NOT discard a persistent basic message in case of a queue overflow.
- </doc>
- <doc type="scenario">
- Create a queue overflow situation with persistent messages and verify that messages do not
- get lost (presumably the server will write them to disk).
- </doc>
- </rule>
-
- <rule name="throttling">
- <doc>
- The server MAY use the Session.Flow method to slow or stop a basic message publisher when
- necessary.
- </doc>
- <doc type="scenario">
- Create a queue overflow situation with non-persistent messages and verify whether the server
- responds with Session.Flow or not. Repeat with persistent messages.
- </doc>
- </rule>
-
- <rule name="non-persistent-overflow">
- <doc>
- The server MAY overflow non-persistent basic messages to persistent storage.
- </doc>
- <!-- Test scenario: untestable -->
- </rule>
-
- <rule name="dead-letter-overflow">
- <doc>
- The server MAY discard or dead-letter non-persistent basic messages on a priority basis if
- the queue size exceeds some configured limit.
- </doc>
- <!-- Test scenario: untestable -->
- </rule>
-
- <rule name="min-priority-levels">
- <doc>
- The server MUST implement at least 2 priority levels for basic messages, where priorities
- 0-4 and 5-9 are treated as two distinct levels.
- </doc>
- <doc type="scenario">
- Send a number of priority 0 messages to a queue. Send one priority 9 message. Consume
- messages from the queue and verify that the first message received was priority 9.
- </doc>
- </rule>
-
- <rule name="max-priority-levels">
- <doc>
- The server MAY implement up to 10 priority levels.
- </doc>
- <doc type="scenario">
- Send a number of messages with mixed priorities to a queue, so that all priority values from
- 0 to 9 are exercised. A good scenario would be ten messages in low-to-high priority. Consume
- from queue and verify how many priority levels emerge.
- </doc>
- </rule>
-
- <rule name="priority">
- <doc>
- The server MUST deliver messages of the same priority in order irrespective of their
- individual persistence.
- </doc>
- <doc type="scenario">
- Send a set of messages with the same priority but different persistence settings to a queue.
- Consume and verify that messages arrive in same order as originally published.
- </doc>
- </rule>
-
- <rule name="automatic-acknowledgement">
- <doc>
- The server MUST support automatic acknowledgements on Basic content, i.e. consumers with the
- no-ack field set to FALSE.
- </doc>
- <doc type="scenario">
- Create a queue and a consumer using automatic acknowledgements. Publish a set of messages to
- the queue. Consume the messages and verify that all messages are received.
- </doc>
- </rule>
-
- <rule name="explicit-acknowledgement">
- <doc>
- The server MUST support explicit acknowledgements on Basic content, i.e. consumers with the
- no-ack field set to TRUE.
- </doc>
- <doc type="scenario">
- Create a queue and a consumer using explicit acknowledgements. Publish a set of messages to
- the queue. Consume the messages but acknowledge only half of them. Disconnect and reconnect,
- and consume from the queue. Verify that the remaining messages are received.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MAY" />
-
- <!-- These are the properties for a Basic content -->
-
- <field name="content-type" domain="shortstr" label="MIME content type" />
- <field name="content-encoding" domain="shortstr" label="MIME content encoding" />
- <field name="headers" domain="table" label="message header field table" />
- <field name="delivery-mode" domain="octet" label="non-persistent (1) or persistent (2)" />
- <field name="priority" domain="octet" label="message priority, 0 to 9" />
- <field name="correlation-id" domain="shortstr" label="application correlation identifier" />
- <field name="reply-to" domain="shortstr" label="destination to reply to" />
- <field name="expiration" domain="shortstr" label="message expiration specification" />
- <field name="message-id" domain="shortstr" label="application message identifier" />
- <field name="timestamp" domain="timestamp" label="message timestamp" />
- <field name="type" domain="shortstr" label="message type name" />
- <field name="user-id" domain="shortstr" label="creating user id" />
- <field name="app-id" domain="shortstr" label="creating application id" />
-
- <!-- - Method: basic.qos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="qos" synchronous="1" index="10" label="[DEPRECATED] specify quality of service">
- <doc>
- [DEPRECATED: Basic replaced by message class.] This method requests a specific quality of
- service. The QoS can be specified for the current session or for all sessions on the
- connection. The particular properties and semantics of a qos method always depend on the
- content class semantics. Though the qos method could in principle apply to both peers, it is
- currently meaningful only for the server.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="prefetch-size" domain="long" label="prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client finishes
- processing a message, the following message is already held locally, rather than needing
- to be sent within the session. Prefetching gives a performance improvement. This field
- specifies the prefetch window size in octets. The server will send a message in advance if
- it is equal to or smaller in size than the available prefetch size (and also falls into
- other prefetch limits). May be set to zero, meaning "no specific limit", although other
- prefetch limits may still apply. The prefetch-size is ignored if the no-ack option is set.
- </doc>
-
- <rule name="ignore">
- <doc>
- The server MUST ignore this setting when the client is not processing any messages -
- i.e. the prefetch size does not limit the transfer of single messages to a client, only
- the sending in advance of more messages while the client still has one or more
- unacknowledged messages.
- </doc>
- <doc type="scenario">
- Define a QoS prefetch-size limit and send a single message that exceeds that limit.
- Verify that the message arrives correctly.
- </doc>
- </rule>
- </field>
-
- <field name="prefetch-count" domain="short" label="prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This field may be used in
- combination with the prefetch-size field; a message will only be sent in advance if both
- prefetch windows (and those at the session and connection level) allow it. The
- prefetch-count is ignored if the no-ack option is set.
- </doc>
-
- <rule name="prefetch">
- <doc>
- The server may send less data in advance than allowed by the client's specified prefetch
- windows but it MUST NOT send more.
- </doc>
- <doc type="scenario">
- Define a QoS prefetch-size limit and a prefetch-count limit greater than one. Send
- multiple messages that exceed the prefetch size. Verify that no more than one message
- arrives at once.
- </doc>
- </rule>
- </field>
-
- <field name="global" domain="bit" label="apply to entire connection">
- <doc>
- By default the QoS settings apply to the current session only. If this field is set, they
- are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <!-- - Method: basic.consume - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="consume" synchronous="1" index="20" label="[DEPRECATED] start a queue consumer">
- <doc>
- [DEPRECATED: Basic replaced by message class.] This method asks the server to start a
- "consumer", which is a transient request for messages from a specific queue. Consumers last
- as long as the session they were created on, or until the client cancels them.
- </doc>
-
- <rule name="min-consumers">
- <doc>
- The server SHOULD support at least 16 consumers per queue, and ideally, impose no limit
- except as defined by available resources.
- </doc>
- <doc type="scenario">
- Create a queue and create consumers on that queue until the server closes the connection.
- Verify that the number of consumers created was at least sixteen and report the total
- number.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <response name="consume-ok" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to the realm
- for the queue from which the message will be consumed.
- </doc>
- <doc type="scenario">
- Attempt to create a consumer with an invalid (non-zero) access ticket.
- </doc>
- </rule>
- </field>
-
- <field name="queue" domain="queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null, refers to the
- current queue for the session, which is the last declared queue.
- </doc>
- <rule name="queue-exists-if-empty" on-failure="not-allowed">
- <doc>
- If the queue name is empty the client MUST have previously declared a queue using this
- session.
- </doc>
- <doc type="scenario">
- Attempt to create a consumer with an empty queue name and no previously declared queue
- on the session.
- </doc>
- </rule>
- </field>
-
- <field name="consumer-tag" domain="consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a connection, so
- two clients can use the same consumer tags. If this field is empty the server will
- generate a unique tag.
- </doc>
-
- <rule name="not-existing-consumer" on-failure="not-allowed">
- <doc>
- The client MUST NOT specify a tag that refers to an existing consumer.
- </doc>
- <doc type="scenario">
- Attempt to create two consumers with the same non-empty tag.
- </doc>
- </rule>
-
- <rule name="session-bound" on-failure="not-allowed">
- <doc>
- The consumer tag is valid only within the session from which the consumer was created.
- i.e. A client MUST NOT create a consumer in one session and then use it in another.
- </doc>
- <doc type="scenario">
- Attempt to create a consumer in one session, then use in another session, in which
- consumers have also been created (to test that the server uses unique consumer tags).
- </doc>
- </rule>
- </field>
-
- <field name="no-local" domain="no-local" />
-
- <field name="no-ack" domain="no-ack" />
-
- <field name="exclusive" domain="bit" label="request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the queue.
- </doc>
-
- <rule name="in-use" on-failure="access-refused">
- <doc>
- The client MUST NOT gain exclusive access to a queue that already has active consumers.
- </doc>
- <doc type="scenario">
- Open two connections to a server, and in one connection create a shared (non-exclusive)
- queue and then consume from the queue. In the second connection attempt to consume from
- the same queue using the exclusive option.
- </doc>
- </rule>
- </field>
-
- <field name="nowait" domain="bit" label="do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait for a reply
- method. If the server could not complete the method it will raise a channel or connection
- exception.
- </doc>
- </field>
-
- <field name="arguments" domain="table" label="arguments for consuming">
- <doc>
- A set of arguments for the consume. The syntax and semantics of these arguments depends on
- the providers implementation.
- </doc>
- </field>
- </method>
-
- <!-- - Method: basic.consume-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="consume-ok" synchronous="1" index="21"
- label="[DEPRECATED] confirm a new consumer">
- <doc>
- [DEPRECATED: Basic replaced by message class.] The server provides the client with a
- consumer tag, which is used by the client for methods called on the consumer at a later
- stage.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <field name="consumer-tag" domain="consumer-tag">
- <doc>
- Holds the consumer tag specified by the client or provided by the server.
- </doc>
- </field>
- </method>
-
- <!-- - Method: basic.cancel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="cancel" synchronous="1" index="30" label="[DEPRECATED] end a queue consumer">
- <doc>
- [DEPRECATED: Basic replaced by message class.] This method cancels a consumer. This does not
- affect already delivered messages, but it does mean the server will not send any more
- messages for that consumer. The client may receive an arbitrary number of messages in
- between sending the cancel method and receiving notification of the completion of the cancel command.
- </doc>
-
- <rule name="non-existent">
- <doc>
- If the queue does not exist the server MUST ignore the cancel method, so long as the
- consumer tag is valid for that session.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="consumer-tag" domain="consumer-tag" />
- </method>
-
- <!-- - Method: basic.publish - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="publish" content="1" index="40" label="[DEPRECATED] publish a message">
- <doc>
- [DEPRECATED: Basic replaced by message class.] This method publishes a message to a specific
- exchange. The message will be routed to queues as defined by the exchange configuration and
- distributed to any active consumers when the transaction, if any, is committed.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "passive" access rights to the
- realm for the exchange and "write" access rights to the realm for the queue to which the
- message will be published.
- </doc>
- </rule>
- </field>
-
- <field name="exchange" domain="exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be empty, meaning
- the default exchange. If the exchange name is specified, and that exchange does not exist,
- the server will raise a channel exception.
- </doc>
-
- <rule name="default">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <rule name="internal" on-failure="access-refused">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST raise a channel
- exception with a reply code 403 (access refused).
- </doc>
- </rule>
-
- <rule name="refusal" on-failure="not-implemented">
- <doc>
- The exchange MAY refuse basic content in which case it MUST raise a channel exception
- with reply code 540 (not implemented).
- </doc>
- </rule>
- </field>
-
- <field name="routing-key" domain="shortstr" label="Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing messages
- depending on the exchange configuration.
- </doc>
- </field>
-
- <field name="reject-unroutable" domain="bit" label="reject message if unroutable flag">
- <doc>
- If the reject-unroutable flag is set, then at the time of publishing the broker
- determines if the message will be routed to any queues. If it will not be routed to any
- queue then the broker responds with a basic.reject.
- </doc>
- </field>
-
- <field name="immediate" domain="bit" label="Request immediate delivery">
- <doc>
- If this flag is set, and the resulting message is delivered to a queue with no
- consumers, the message will not be queued but will instead be routed to the
- alternate-exchange for that queue. If no such exchange is defined the message will be
- silently dropped.
- </doc>
- <rule name="implementation">
- <doc>
- The server SHOULD implement the immediate flag.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: basic.deliver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="deliver" content="1" index="60"
- label="[DEPRECATED] notify the client of a consumer message">
- <doc>
- [DEPRECATED: Basic replaced by message class.] This method delivers a message to the client,
- via a consumer. In the asynchronous message delivery model, the client starts a consumer
- using the Consume method, then the server responds with Deliver methods as and when messages
- arrive for that consumer.
- </doc>
-
- <rule name="redelivery-tracking">
- <doc>
- The server SHOULD track the number of times a message has been delivered to clients and
- when a message is redelivered a certain number of times - e.g. 5 times - without being
- acknowledged, the server SHOULD consider the message to be unprocessable (possibly causing
- client applications to abort), and move the message to a dead letter queue.
- </doc>
- </rule>
-
- <chassis name="client" implement="MUST" />
-
- <field name="consumer-tag" domain="consumer-tag" />
-
- <field name="delivery-tag" domain="delivery-tag" />
-
- <field name="redelivered" domain="redelivered" />
-
- <field name="exchange" domain="exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="routing-key" domain="shortstr" label="Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
- </method>
-
- <!-- - Method: basic.get - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="get" synchronous="1" index="70" label="[DEPRECATED] direct access to a queue">
- <doc>
- [DEPRECATED: Basic replaced by message class.] This method provides a direct access to the
- messages in a queue using a synchronous dialogue that is designed for specific types of
- application where synchronous functionality is more important than performance.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <response name="get-ok" />
- <response name="get-empty" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to the realm
- for the queue from which the message will be obtained.
- </doc>
- </rule>
- </field>
-
- <field name="queue" domain="queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null, refers to the
- current queue for the session, which is the last declared queue.
- </doc>
- <rule name="queue-exists-if-empty">
- <doc>
- If the client did not previously declare a queue, and the queue name in this method is
- empty, the server MUST raise a connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name="no-ack" domain="no-ack" />
- </method>
-
- <!-- - Method: basic.get-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="get-ok" synchronous="1" content="1" index="71"
- label="[DEPRECATED] provide client with a message">
- <doc>
- [DEPRECATED: Basic replaced by message class.] This method delivers a message to the client
- following a get method. A message delivered by 'get-ok' must be acknowledged unless the
- no-ack option was set in the get method.
- </doc>
-
- <chassis name="client" implement="MAY" />
-
- <field name="delivery-tag" domain="delivery-tag" />
-
- <field name="redelivered" domain="redelivered" />
-
- <field name="exchange" domain="exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to. If empty,
- the message was published to the default exchange.
- </doc>
- </field>
-
- <field name="routing-key" domain="shortstr" label="Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
-
- <field name="message-count" domain="long" label="number of messages pending">
- <doc>
- This field reports the number of messages pending on the queue, excluding the message
- being delivered. Note that this figure is indicative, not reliable, and can change
- arbitrarily as messages are added to the queue and removed by other clients.
- </doc>
- </field>
- </method>
-
- <!-- - Method: basic.get-empty - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="get-empty" synchronous="1" index="72"
- label="[DEPRECATED] indicate no messages available">
- <doc>
- [DEPRECATED: Basic replaced by message class.] This method tells the client that the queue
- has no messages available for the client.
- </doc>
-
- <chassis name="client" implement="MAY" />
-
- <!-- This field is deprecated pending review -->
- <field name="cluster-id" domain="shortstr" label="Cluster id">
- <doc>
- For use by cluster applications, should not be used by client applications.
- </doc>
- </field>
- </method>
-
- <!-- - Method: basic.ack - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="ack" index="80" label="[DEPRECATED] acknowledge one or more messages">
- <doc>
- [DEPRECATED: Basic replaced by message class.] This method acknowledges one or more messages
- delivered via the Deliver or Get-Ok methods. The client can ask to confirm a single message
- or a set of messages up to and including a specific message.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="delivery-tag" domain="delivery-tag" />
-
- <field name="multiple" domain="bit" label="acknowledge multiple messages">
- <doc>
- If set to 1, the delivery tag is treated as "up to and including", so that the client can
- acknowledge multiple messages with a single method. If set to zero, the delivery tag
- refers to a single message. If the multiple field is 1, and the delivery tag is zero,
- tells the server to acknowledge all outstanding messages.
- </doc>
-
- <rule name="validation">
- <doc>
- The server MUST validate that a non-zero delivery-tag refers to a delivered message, and
- raise a channel exception if this is not the case.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: basic.reject - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="reject" index="90" label="[DEPRECATED] reject an incoming message">
- <doc>
- [DEPRECATED: Basic replaced by message class.] This method allows a client to reject a
- message. It can be used to interrupt and cancel large incoming messages, or return
- untreatable messages to their original queue.
- </doc>
-
- <rule name="concurrent-processing">
- <doc>
- The server SHOULD be capable of accepting and processing the Reject method while sending
- message content with a Deliver or Get-Ok method. i.e. The server should read and process
- incoming methods while sending output frames. To cancel a partially-send content, the
- server sends a content body frame of size 1 (i.e. with no data except the frame-end
- octet).
- </doc>
- </rule>
-
- <rule name="server-interpretation">
- <doc>
- The server SHOULD interpret this method as meaning that the client is unable to process
- the message at this time.
- </doc>
- </rule>
-
- <rule name="not-selection">
- <doc>
- A client MUST NOT use this method as a means of selecting messages to process. A rejected
- message MAY be discarded or dead-lettered, not necessarily passed to another client.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="delivery-tag" domain="delivery-tag" />
-
- <field name="requeue" domain="bit" label="requeue the message">
- <doc>
- If this field is zero, the message will be discarded. If this bit is 1, the server will
- attempt to requeue the message.
- </doc>
-
- <rule name="requeue-strategy">
- <doc>
- The server MUST NOT deliver the message to the same client within the context of the
- current session. The recommended strategy is to attempt to deliver the message to an
- alternative consumer, and if that is not possible, to move the message to a dead-letter
- queue. The server MAY use more sophisticated tracking to hold the message on the queue
- and redeliver it to the same client at a later stage.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: basic.recover - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="recover" index="100" label="[DEPRECATED] redeliver unacknowledged messages">
- <doc>
- [DEPRECATED: Basic replaced by message class.] This method asks the broker to redeliver all
- unacknowledged messages on a specified session. Zero or more messages may be redelivered.
- This method is only allowed on non-transacted sessions.
- </doc>
-
- <rule name="redelivered-flag">
- <doc>
- The server MUST set the redelivered flag on all messages that are resent.
- </doc>
- </rule>
-
- <rule name="non-transacted-session">
- <doc>
- The server MUST raise a channel exception if this is called on a transacted session.
- <!-- TODO: define failure code -->
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="requeue" domain="bit" label="requeue the message">
- <doc>
- If this field is zero, the message will be redelivered to the original recipient. If this
- bit is 1, the server will attempt to requeue the message, potentially then delivering it
- to an alternative subscriber.
- </doc>
- </field>
- </method>
-
- </class>
-
- <!-- == Class: file ========================================================================== -->
-
- <class name="file" index="70" label="work with file content">
- <doc>
- The file class provides methods that support reliable file transfer. File messages have a
- specific set of properties that are required for interoperability with file transfer
- applications. File messages and acknowledgements are subject to session transactions. Note
- that the file class does not provide message browsing methods; these are not compatible with
- the staging model. Applications that need browsable file transfer should use Basic content and
- the Basic class.
- </doc>
-
- <doc type="grammar">
- file = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL
- / C:OPEN S:OPEN-OK C:STAGE content
- / S:OPEN C:OPEN-OK S:STAGE content
- / C:PUBLISH
- / S:DELIVER
- / S:RETURN
- / C:ACK
- / C:REJECT
- </doc>
-
- <rule name="reliable-storage">
- <doc>
- The server MUST make a best-effort to hold file messages on a reliable storage mechanism.
- </doc>
- </rule>
-
- <!-- TODO Rule implement attr inverse? -->
-
- <rule name="no-discard">
- <doc>
- The server MUST NOT discard a file message in case of a queue overflow. The server MUST use
- the Session.Flow method to slow or stop a file message publisher when necessary.
- </doc>
- </rule>
-
- <rule name="priority-levels">
- <doc>
- The server MUST implement at least 2 priority levels for file messages, where priorities 0-4
- and 5-9 are treated as two distinct levels. The server MAY implement up to 10 priority
- levels.
- </doc>
- </rule>
-
- <rule name="acknowledgement-support">
- <doc>
- The server MUST support both automatic and explicit acknowledgements on file content.
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
- <chassis name="client" implement="MAY" />
-
- <!-- These are the properties for a File content -->
-
- <field name="content-type" domain="shortstr" label="MIME content type" />
- <field name="content-encoding" domain="shortstr" label="MIME content encoding" />
- <field name="headers" domain="table" label="message header field table" />
- <field name="priority" domain="octet" label="message priority, 0 to 9" />
- <field name="reply-to" domain="shortstr" label="destination to reply to" />
- <field name="message-id" domain="shortstr" label="application message identifier" />
- <field name="filename" domain="shortstr" label="message filename" />
- <field name="timestamp" domain="timestamp" label="message timestamp" />
- <!-- This field is deprecated pending review -->
- <field name="cluster-id" domain="shortstr" label="intra-cluster routing identifier" />
-
- <!-- - Method: file.qos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="qos" synchronous="1" index="10" label="specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the current
- session or for all sessions on the connection. The particular properties and semantics of a
- qos method always depend on the content class semantics. Though the qos method could in
- principle apply to both peers, it is currently meaningful only for the server.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <response name="qos-ok" />
-
- <field name="prefetch-size" domain="long" label="prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client finishes
- processing a message, the following message is already held locally, rather than needing
- to be sent within the session. Prefetching gives a performance improvement. This field
- specifies the prefetch window size in octets. May be set to zero, meaning "no specific
- limit". Note that other prefetch limits may still apply. The prefetch-size is ignored if
- the no-ack option is set.
- </doc>
- </field>
-
- <field name="prefetch-count" domain="short" label="prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This is compatible with some file
- API implementations. This field may be used in combination with the prefetch-size field; a
- message will only be sent in advance if both prefetch windows (and those at the session
- and connection level) allow it. The prefetch-count is ignored if the no-ack option is set.
- </doc>
-
- <rule name="prefetch-discretion">
- <doc>
- The server MAY send less data in advance than allowed by the client's specified prefetch
- windows but it MUST NOT send more.
- </doc>
- </rule>
- </field>
-
- <field name="global" domain="bit" label="apply to entire connection">
- <doc>
- By default the QoS settings apply to the current session only. If this field is set, they
- are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <!-- - Method: file.qos-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="qos-ok" synchronous="1" index="11" label="confirm the requested qos">
- <doc>
- This method tells the client that the requested QoS levels could be handled by the server.
- The requested QoS applies to all active consumers until a new QoS is defined.
- </doc>
-
- <chassis name="client" implement="MUST" />
- </method>
-
- <!-- - Method: file.consume - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="consume" synchronous="1" index="20" label="start a queue consumer">
- <doc>
- This method asks the server to start a "consumer", which is a transient request for messages
- from a specific queue. Consumers last as long as the session they were created on, or until
- the client cancels them.
- </doc>
-
- <rule name="min-consumers">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was declared
- as private, and ideally, impose no limit except as defined by available resources.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <response name="consume-ok" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to the realm
- for the queue from which the message will be consumed.
- </doc>
- </rule>
- </field>
-
- <field name="queue" domain="queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null, refers to the
- current queue for the session, which is the last declared queue.
- </doc>
-
- <rule name="queue-exists-if-empty" on-failure="not-allowed">
- <doc>
- If the client did not previously declare a queue, and the queue name in this method is
- empty, the server MUST raise a connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name="consumer-tag" domain="consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a connection, so
- two clients can use the same consumer tags. If this field is empty the server will
- generate a unique tag.
- </doc>
-
- <rule name="not-existing-consumer" on-failure="not-allowed">
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to create two
- consumers with the same non-empty tag the server MUST raise a connection exception with
- reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name="no-local" domain="no-local" />
-
- <field name="no-ack" domain="no-ack" />
-
- <field name="exclusive" domain="bit" label="request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the queue.
- </doc>
-
- <rule name="in-use" on-failure="resource-locked">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, - because there are
- other consumers active - it MUST raise a channel exception with return code 405
- (resource locked).
- </doc>
- </rule>
- </field>
-
- <field name="nowait" domain="bit" label="do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait for a reply
- method. If the server could not complete the method it will raise a channel or connection
- exception.
- </doc>
- </field>
-
- <field name="filter" domain="table" label="arguments for consuming">
- <doc>
- A set of filters for the consume. The syntax and semantics of these filters depends on the
- providers implementation.
- </doc>
- </field>
- </method>
-
- <method name="consume-ok" synchronous="1" index="21" label="confirm a new consumer">
- <doc>
- This method provides the client with a consumer tag which it MUST use in methods that work
- with the consumer.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <field name="consumer-tag" domain="consumer-tag">
- <doc>
- Holds the consumer tag specified by the client or provided by the server.
- </doc>
- </field>
- </method>
-
- <!-- - Method: file.cancel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="cancel" synchronous="1" index="30" label="end a queue consumer">
- <doc>
- This method cancels a consumer. This does not affect already delivered messages, but it does
- mean the server will not send any more messages for that consumer.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="consumer-tag" domain="consumer-tag" />
- </method>
-
- <!-- - Method: file.open - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="open" synchronous="1" index="40" label="request to start staging">
- <doc>
- This method requests permission to start staging a message. Staging means sending the
- message into a temporary area at the recipient end and then delivering the message by
- referring to this temporary area. Staging is how the protocol handles partial file transfers
- - if a message is partially staged and the connection breaks, the next time the sender
- starts to stage it, it can restart from where it left off.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <response name="open-ok" />
-
- <field name="identifier" domain="shortstr" label="staging identifier">
- <doc>
- This is the staging identifier. This is an arbitrary string chosen by the sender. For
- staging to work correctly the sender must use the same staging identifier when staging the
- same message a second time after recovery from a failure. A good choice for the staging
- identifier would be the SHA1 hash of the message properties data (including the original
- filename, revised time, etc.).
- </doc>
- </field>
-
- <field name="content-size" domain="longlong" label="message content size">
- <doc>
- The size of the content in octets. The recipient may use this information to allocate or
- check available space in advance, to avoid "disk full" errors during staging of very large
- messages.
- </doc>
-
- <rule name="content-size">
- <doc>
- The sender MUST accurately fill the content-size field. Zero-length content is
- permitted.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: file.open-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="open-ok" synchronous="1" index="41" label="confirm staging ready">
- <doc>
- This method confirms that the recipient is ready to accept staged data. If the message was
- already partially-staged at a previous time the recipient will report the number of octets
- already staged.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <response name="stage" />
-
- <field name="staged-size" domain="longlong" label="already staged amount">
- <doc>
- The amount of previously-staged content in octets. For a new message this will be zero.
- </doc>
-
- <rule name="behaviour">
- <doc>
- The sender MUST start sending data from this octet offset in the message, counting from
- zero.
- <!-- TODO: review this text, it seems ambiguous or confusing... -->
- </doc>
- </rule>
-
- <rule name="staging">
- <doc>
- The recipient MAY decide how long to hold partially-staged content and MAY implement
- staging by always discarding partially-staged content. However if it uses the file
- content type it MUST support the staging methods.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: file.stage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="stage" content="1" index="50" label="stage message content">
- <doc>
- This method stages the message, sending the message content to the recipient from the octet
- offset specified in the Open-Ok method.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
- </method>
-
- <!-- - Method: file.publish - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="publish" index="60" label="publish a message">
- <doc>
- This method publishes a staged file message to a specific exchange. The file message will be
- routed to queues as defined by the exchange configuration and distributed to any active
- consumers when the transaction, if any, is committed.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "passive" access rights to the
- realm for the exchange and "write" access rights to the realm for the queue to which the
- message will be published.
- </doc>
- </rule>
- </field>
-
- <field name="exchange" domain="exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be empty, meaning
- the default exchange. If the exchange name is specified, and that exchange does not exist,
- the server will raise a channel exception.
- </doc>
-
- <rule name="default">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <rule name="internal" on-failure="access-refused">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST respond with a
- reply code 403 (access refused) and raise a channel exception.
- </doc>
- </rule>
-
- <rule name="refusal" on-failure="not-implemented">
- <doc>
- The exchange MAY refuse file content in which case it MUST respond with a reply code 540
- (not implemented) and raise a channel exception.
- </doc>
- </rule>
- </field>
-
- <field name="routing-key" domain="shortstr" label="Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing messages
- depending on the exchange configuration.
- </doc>
- </field>
-
- <field name="mandatory" domain="bit" label="indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue. If
- this flag is set, the server will return an unroutable message with a Return method. If
- this flag is zero, the server silently drops the message.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the mandatory flag.
- </doc>
- </rule>
- </field>
-
- <field name="immediate" domain="bit" label="request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue
- consumer immediately. If this flag is set, the server will return an undeliverable message
- with a Return method. If this flag is zero, the server will queue the message, but with no
- guarantee that it will ever be consumed.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the immediate flag.
- </doc>
- </rule>
- </field>
-
- <field name="identifier" domain="shortstr" label="staging identifier">
- <doc>
- This is the staging identifier of the message to publish. The message must have been
- staged. Note that a client can send the Publish method asynchronously without waiting for
- staging to finish.
- </doc>
- </field>
- </method>
-
- <!-- - Method: file.return - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="return" content="1" index="70" label="return a failed message">
- <doc>
- This method returns an undeliverable message that was published with the "immediate" flag
- set, or an unroutable message published with the "mandatory" flag set. The reply code and
- text provide information about the reason that the message was undeliverable.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <field name="reply-code" domain="reply-code" />
-
- <field name="reply-text" domain="reply-text" />
-
- <field name="exchange" domain="exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="routing-key" domain="shortstr" label="Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
- </method>
-
- <!-- - Method: file.deliver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="deliver" index="80" label="notify the client of a consumer message">
- <doc>
- This method delivers a staged file message to the client, via a consumer. In the
- asynchronous message delivery model, the client starts a consumer using the Consume method,
- then the server responds with Deliver methods as and when messages arrive for that consumer.
- </doc>
-
- <rule name="redelivery-tracking">
- <doc>
- The server SHOULD track the number of times a message has been delivered to clients and
- when a message is redelivered a certain number of times - e.g. 5 times - without being
- acknowledged, the server SHOULD consider the message to be unprocessable (possibly causing
- client applications to abort), and move the message to a dead letter queue.
- </doc>
- </rule>
-
- <chassis name="client" implement="MUST" />
-
- <field name="consumer-tag" domain="consumer-tag" />
-
- <field name="delivery-tag" domain="delivery-tag" />
-
- <field name="redelivered" domain="redelivered" />
-
- <field name="exchange" domain="exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="routing-key" domain="shortstr" label="Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
-
- <field name="identifier" domain="shortstr" label="staging identifier">
- <doc>
- This is the staging identifier of the message to deliver. The message must have been
- staged. Note that a server can send the Deliver method asynchronously without waiting for
- staging to finish.
- </doc>
- </field>
- </method>
-
- <!-- - Method: file.ack - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="ack" index="90" label="acknowledge one or more messages">
- <doc>
- This method acknowledges one or more messages delivered via the Deliver method. The client
- can ask to confirm a single message or a set of messages up to and including a specific
- message.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="delivery-tag" domain="delivery-tag" />
-
- <field name="multiple" domain="bit" label="acknowledge multiple messages">
- <doc>
- If set to 1, the delivery tag is treated as "up to and including", so that the client can
- acknowledge multiple messages with a single method. If set to zero, the delivery tag
- refers to a single message. If the multiple field is 1, and the delivery tag is zero,
- tells the server to acknowledge all outstanding messages.
- </doc>
-
- <rule name="validation">
- <doc>
- The server MUST validate that a non-zero delivery-tag refers to an delivered message,
- and raise a channel exception if this is not the case.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: file.reject - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="reject" index="100" label="reject an incoming message">
- <doc>
- This method allows a client to reject a message. It can be used to return untreatable
- messages to their original queue. Note that file content is staged before delivery, so the
- client will not use this method to interrupt delivery of a large message.
- </doc>
-
- <rule name="server-interpretation">
- <doc>
- The server SHOULD interpret this method as meaning that the client is unable to process
- the message at this time.
- </doc>
- </rule>
-
- <rule name="not-selection">
- <doc>
- A client MUST NOT use this method as a means of selecting messages to process. A rejected
- message MAY be discarded or dead-lettered, not necessarily passed to another client.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="delivery-tag" domain="delivery-tag" />
-
- <field name="requeue" domain="bit" label="requeue the message">
- <doc>
- If this field is zero, the message will be discarded. If this bit is 1, the server will
- attempt to requeue the message.
- </doc>
-
- <rule name="requeue-strategy">
- <doc>
- The server MUST NOT deliver the message to the same client within the context of the
- current session. The recommended strategy is to attempt to deliver the message to an
- alternative consumer, and if that is not possible, to move the message to a dead-letter
- queue. The server MAY use more sophisticated tracking to hold the message on the queue
- and redeliver it to the same client at a later stage.
- </doc>
- </rule>
- </field>
- </method>
-
- </class>
-
- <!-- == Class: stream ======================================================================== -->
-
- <class name="stream" index="80" label="work with streaming content">
- <doc>
- The stream class provides methods that support multimedia streaming. The stream class uses the
- following semantics: one message is one packet of data; delivery is unacknowledged and
- unreliable; the consumer can specify quality of service parameters that the server can try to
- adhere to; lower-priority messages may be discarded in favour of high priority messages.
- </doc>
-
- <doc type="grammar">
- stream = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL
- / C:PUBLISH content
- / S:RETURN
- / S:DELIVER content
- </doc>
-
- <rule name="overflow-discard">
- <doc>
- The server SHOULD discard stream messages on a priority basis if the queue size exceeds some
- configured limit.
- </doc>
- </rule>
-
- <rule name="priority-levels">
- <doc>
- The server MUST implement at least 2 priority levels for stream messages, where priorities
- 0-4 and 5-9 are treated as two distinct levels. The server MAY implement up to 10 priority
- levels.
- </doc>
- </rule>
-
- <rule name="acknowledgement-support">
- <doc>
- The server MUST implement automatic acknowledgements on stream content. That is, as soon as
- a message is delivered to a client via a Deliver method, the server must remove it from the
- queue.
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
- <chassis name="client" implement="MAY" />
-
- <!-- These are the properties for a Stream content -->
-
- <field name="content-type" domain="shortstr" label="MIME content type" />
- <field name="content-encoding" domain="shortstr" label="MIME content encoding" />
- <field name="headers" domain="table" label="message header field table" />
- <field name="priority" domain="octet" label="message priority, 0 to 9" />
- <field name="timestamp" domain="timestamp" label="message timestamp" />
-
- <!-- - Method: stream.qos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="qos" synchronous="1" index="10" label="specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the current
- session or for all sessions on the connection. The particular properties and semantics of a
- qos method always depend on the content class semantics. Though the qos method could in
- principle apply to both peers, it is currently meaningful only for the server.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <response name="qos-ok" />
-
- <field name="prefetch-size" domain="long" label="prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client finishes
- processing a message, the following message is already held locally, rather than needing
- to be sent within the session. Prefetching gives a performance improvement. This field
- specifies the prefetch window size in octets. May be set to zero, meaning "no specific
- limit". Note that other prefetch limits may still apply.
- </doc>
- </field>
-
- <field name="prefetch-count" domain="short" label="prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This field may be used in
- combination with the prefetch-size field; a message will only be sent in advance if both
- prefetch windows (and those at the session and connection level) allow it.
- </doc>
- </field>
-
- <field name="consume-rate" domain="long" label="transfer rate in octets/second">
- <doc>
- Specifies a desired transfer rate in octets per second. This is usually determined by the
- application that uses the streaming data. A value of zero means "no limit", i.e. as
- rapidly as possible.
- </doc>
-
- <rule name="ignore-prefetch">
- <doc>
- The server MAY ignore the prefetch values and consume rates, depending on the type of
- stream and the ability of the server to queue and/or reply it.
- </doc>
- </rule>
-
- <rule name="drop-by-priority">
- <doc>
- The server MAY drop low-priority messages in favour of high-priority messages.
- </doc>
- </rule>
- </field>
-
- <field name="global" domain="bit" label="apply to entire connection">
- <doc>
- By default the QoS settings apply to the current session only. If this field is set, they
- are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <!-- - Method: stream.qos-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="qos-ok" synchronous="1" index="11" label="confirm the requested qos">
- <doc>
- This method tells the client that the requested QoS levels could be handled by the server.
- The requested QoS applies to all active consumers until a new QoS is defined.
- </doc>
-
- <chassis name="client" implement="MUST" />
- </method>
-
- <!-- - Method: stream.consume - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="consume" synchronous="1" index="20" label="start a queue consumer">
- <doc>
- This method asks the server to start a "consumer", which is a transient request for messages
- from a specific queue. Consumers last as long as the session they were created on, or until
- the client cancels them.
- </doc>
-
- <rule name="min-consumers">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was declared
- as private, and ideally, impose no limit except as defined by available resources.
- </doc>
- </rule>
-
- <rule name="priority-based-delivery">
- <doc>
- Streaming applications SHOULD use different sessions to select different streaming
- resolutions. AMQP makes no provision for filtering and/or transforming streams except on
- the basis of priority-based selective delivery of individual messages.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <response name="consume-ok" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to the realm
- for the queue from which the message will be consumed.
- </doc>
- </rule>
- </field>
-
- <field name="queue" domain="queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null, refers to the
- current queue for the session, which is the last declared queue.
- </doc>
-
- <rule name="queue-exists-if-empty" on-failure="not-allowed">
- <doc>
- If the client did not previously declare a queue, and the queue name in this method is
- empty, the server MUST raise a connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name="consumer-tag" domain="consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a connection, so
- two clients can use the same consumer tags. If this field is empty the server will
- generate a unique tag.
- </doc>
-
- <rule name="not-existing-consumer" on-failure="not-allowed">
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to create two
- consumers with the same non-empty tag the server MUST raise a connection exception with
- reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name="no-local" domain="no-local" />
-
- <field name="exclusive" domain="bit" label="request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the queue.
- </doc>
-
- <rule name="in-use" on-failure="resource-locked">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, - because there are
- other consumers active - it MUST raise a channel exception with return code 405
- (resource locked).
- </doc>
- </rule>
- </field>
-
- <field name="nowait" domain="bit" label="do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait for a reply
- method. If the server could not complete the method it will raise a channel or connection
- exception.
- </doc>
- </field>
-
- <field name="filter" domain="table" label="arguments for consuming">
- <doc>
- A set of filters for the consume. The syntax and semantics of these filters depends on the
- providers implementation.
- </doc>
- </field>
- </method>
-
- <!-- - Method: stream.consume-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="consume-ok" synchronous="1" index="21" label="confirm a new consumer">
- <doc>
- This method provides the client with a consumer tag which it may use in methods that work
- with the consumer.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <field name="consumer-tag" domain="consumer-tag">
- <doc>
- Holds the consumer tag specified by the client or provided by the server.
- </doc>
- </field>
- </method>
-
- <!-- - Method: stream.cancel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="cancel" synchronous="1" index="30" label="end a queue consumer">
- <doc>
- This method cancels a consumer. Since message delivery is asynchronous the client may
- continue to receive messages for a short while after cancelling a consumer. It may process
- or discard these as appropriate.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="consumer-tag" domain="consumer-tag" />
- </method>
-
- <!-- - Method: stream.publish - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="publish" content="1" index="40" label="publish a message">
- <doc>
- This method publishes a message to a specific exchange. The message will be routed to queues
- as defined by the exchange configuration and distributed to any active consumers as
- appropriate.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "passive" access rights to the
- realm for the exchange and "write" access rights to the realm for the queue to which the
- message will be published.
- </doc>
- </rule>
- </field>
-
- <field name="exchange" domain="exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be empty, meaning
- the default exchange. If the exchange name is specified, and that exchange does not exist,
- the server will raise a channel exception.
- </doc>
-
- <rule name="default">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <rule name="internal" on-failure="access-refused">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST respond with a
- reply code 403 (access refused) and raise a channel exception.
- </doc>
- </rule>
-
- <rule name="refusal" on-failure="not-implemented">
- <doc>
- The exchange MAY refuse stream content in which case it MUST respond with a reply code
- 540 (not implemented) and raise a channel exception.
- </doc>
- </rule>
- </field>
-
- <field name="routing-key" domain="shortstr" label="Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing messages
- depending on the exchange configuration.
- </doc>
- </field>
-
- <field name="mandatory" domain="bit" label="indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue. If
- this flag is set, the server will return an unroutable message with a Return method. If
- this flag is zero, the server silently drops the message.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the mandatory flag.
- </doc>
- </rule>
- </field>
-
- <field name="immediate" domain="bit" label="request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue
- consumer immediately. If this flag is set, the server will return an undeliverable message
- with a Return method. If this flag is zero, the server will queue the message, but with no
- guarantee that it will ever be consumed.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the immediate flag.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: stream.return - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="return" content="1" index="50" label="return a failed message">
- <doc>
- This method returns an undeliverable message that was published with the "immediate" flag
- set, or an unroutable message published with the "mandatory" flag set. The reply code and
- text provide information about the reason that the message was undeliverable.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <field name="reply-code" domain="reply-code" />
-
- <field name="reply-text" domain="reply-text" />
-
- <field name="exchange" domain="exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="routing-key" domain="shortstr" label="Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
- </method>
-
- <!-- - Method: stream.deliver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="deliver" content="1" index="60" label="notify the client of a consumer message">
- <doc>
- This method delivers a message to the client, via a consumer. In the asynchronous message
- delivery model, the client starts a consumer using the Consume method, then the server
- responds with Deliver methods as and when messages arrive for that consumer.
- </doc>
-
- <chassis name="client" implement="MUST" />
-
- <field name="consumer-tag" domain="consumer-tag" />
-
- <field name="delivery-tag" domain="delivery-tag" />
-
- <field name="exchange" domain="exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="queue" domain="queue-name">
- <doc>
- Specifies the name of the queue that the message came from. Note that a single session can
- start many consumers on different queues.
- </doc>
- <assert check="notnull" />
- </field>
- </method>
-
- </class>
-
- <!-- == Class: tx ============================================================================ -->
-
- <class name="tx" index="90" label="work with standard transactions">
- <doc>
- Standard transactions provide so-called "1.5 phase commit". We can ensure that work is never
- lost, but there is a chance of confirmations being lost, so that messages may be resent.
- Applications that use standard transactions must be able to detect and ignore duplicate
- messages.
- </doc>
-
- <doc type="grammar">
- tx = C:SELECT
- / C:COMMIT
- / C:ROLLBACK
- </doc>
-
- <rule name="duplicate-tracking">
- <doc>
- An client using standard transactions SHOULD be able to track all messages received within a
- reasonable period, and thus detect and reject duplicates of the same message. It SHOULD NOT
- pass these to the application layer.
- </doc>
- </rule>
-
- <chassis name="server" implement="SHOULD" />
- <chassis name="client" implement="MAY" />
-
- <!-- - Method: tx.select - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="select" synchronous="1" index="10" label="select standard transaction mode">
- <doc>
- This method sets the session to use standard transactions. The client must use this method
- at least once on a session before using the Commit or Rollback methods.
- </doc>
- <chassis name="server" implement="MUST" />
- </method>
-
- <!-- - Method: tx.commit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="commit" synchronous="1" index="20" label="commit the current transaction">
- <doc>
- This method commits all messages published and acknowledged in the current transaction. A
- new transaction starts immediately after a commit.
- </doc>
- <chassis name="server" implement="MUST" />
- </method>
-
- <!-- - Method: tx.rollback - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="rollback" synchronous="1" index="30" label="abandon the current transaction">
- <doc>
- This method abandons all messages published and acknowledged in the current transaction. A
- new transaction starts immediately after a rollback.
- </doc>
- <chassis name="server" implement="MUST" />
- </method>
-
- </class>
-
- <!-- == Class: dtx-demarcation =============================================================== -->
-
- <!-- NOTE: (TODO) Comments on AMQP-4 JIRA made since the proposed XML was posted on June 1 have
- not yet been incorporated here.
- -->
-
- <class name="dtx-demarcation" index="100" label="Demarcates dtx branches">
- <doc>
- This class is part of the X-Open XA distributed transaction protocol support. It allows a
- session to be selected for use with distributed transactions and the transactional boundaries
- for work on that session to be demarcated.
- </doc>
-
- <doc type="grammar">
- dtx-demarcation = C:SELECT *demarcation
- demarcation = C:START C:END
- </doc>
-
- <rule name="access-control">
- <doc>
- Access-tickets are propagated with XA association methods with the aim of restricting which
- users are allowed to control which transactions. The server MAY restrict transaction
- association to a particular identity.
- </doc>
- </rule>
-
- <rule name="transactionality">
- <doc>
- Enabling XA transaction support on a session implies that the server MUST manage
- transactions demarcated by start-end blocks. That is to say that on this XA-enabled session,
- work undergone within transactional blocks is performed on behalf a transaction branch
- whereas work performed outside of transactional blocks is NOT transactional.
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
- <chassis name="client" implement="MAY" />
-
-
- <!-- - Method: dtx-demarcation.select - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="select" synchronous="1" index="10" label="Select dtx mode">
- <doc>
- This method sets the session to use distributed transactions. The client must use this
- method at least once on a session before using XA demarcation operations.
- </doc>
-
- <chassis name="server" implement="MAY" />
- </method>
-
- <!-- - Method: dtx-demarcation.start - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="start" synchronous="1" index="20" label="Start a dtx branch">
- <doc>
- This method is called when messages should be produced and consumed on behalf a transaction
- branch identified by xid.
- </doc>
-
- <rule name="command-invalid" on-failure="command-invalid">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST
- raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <rule name="already-known" on-failure="not-allowed">
- <doc>
- If neither join nor resume is specified is specified and the transaction branch specified
- by xid has previously been seen then the server MUST raise a channel exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
-
- <rule name="join-and-resume" on-failure="command-invalid">
- <doc>
- If join and resume are specified then the server MUST raise a channel exception with reply
- code 503 (command invalid).
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
-
- <field name="ticket" domain="access-ticket" label="Access-ticket for specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
-
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access rights to all the
- realms touched by this transaction.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="xid" domain="xid" label="Transaction xid">
- <doc>
- Specifies the xid of the transaction branch to be started.
- </doc>
-
- <rule name="unknown-xid" on-failure="not-allowed">
- <doc>
- If xid is already known by the broker then the server MUST raise a channel exception
- with reply code 530 (not allowed).
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="join" domain="bit" label="Join with existing xid flag">
- <doc>
- Indicate whether this is joining an already associated xid. Indicate that the start
- applies to joining a transaction previously seen.
- </doc>
-
- <rule name="unsupported" on-failure="not-implemented">
- <doc>
- If the broker does not support join the server MUST raise a channel exception with reply
- code 540 (not implemented).
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="resume" domain="bit" label="Resume flag">
- <doc>
- Indicate that the start applies to resuming a suspended transaction branch specified.
- </doc>
-
- <assert check="notnull" />
- </field>
-
- <result>
- <struct size="long" type="21">
- <doc>
- This confirms to the client that the transaction branch is started or specify the error
- condition.
- </doc>
-
- <field name="status" domain="short" label="Status code">
- <doc>
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
-
- <assert check="notnull" />
- </field>
- </struct>
- </result>
- </method>
-
- <!-- - Method: dtx-demarcation.end - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="end" synchronous="1" index="30" label="End a dtx branch">
- <doc>
- This method is called when the work done on behalf a transaction branch finishes or needs to
- be suspended.
- </doc>
-
- <rule name="command-invalid" on-failure="command-invalid">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST
- raise a channel exception with reply code 503 (command invalid).
- </doc>
- </rule>
-
- <rule name="suspend-and-fail" on-failure="command-invalid">
- <doc>
- If suspend and fail are specified then the server MUST raise a channel exception with
- reply code 503 (command invalid).
- </doc>
- </rule>
-
- <rule name="internal-error" on-failure="internal-error">
- <doc>
- If an error occurs in ending the transaction branch then the server MUST raise a channel
- exception with reply code 541 (internal error).
- </doc>
- </rule>
-
- <rule name="success">
- <doc>
- If neither fail nor suspend are specified then the portion of work has completed
- successfully.
- </doc>
- </rule>
-
- <rule name="session-closed">
- <doc>
- When a session is closed then the currently associated transaction branches MUST be marked
- rollback-only.
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
-
- <field name="ticket" domain="access-ticket" label="Access-ticket for specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
-
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access rights to all the
- realms touched by this transaction.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="xid" domain="xid" label="Transaction xid">
- <doc>
- Specifies the xid of the transaction branch to be ended.
- </doc>
-
- <rule name="not-associated" on-failure="command-invalid">
- <doc>
- The channel MUST be currently associated with the given xid (through an earlier start
- call with the same xid).
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="fail" domain="bit" label="Failure flag">
- <doc>
- If set, indicates that this portion of work has failed; otherwise this portion of work has
- completed successfully.
- </doc>
-
- <rule name="failure">
- <doc>
- An implementation MAY elect to roll a transaction back if this failure notification is
- recieved. Should an implementation elect to implement this behaviour, and this bit is
- set, then then the transaction branch SHOULD be marked as rollback-only and the end
- result SHOULD have the xa-rbrollback status set.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="suspend" domain="bit" label="Temporary suspension flag">
- <doc>
- Indicates that the transaction branch is temporarily suspended in an incomplete state.
- </doc>
-
- <rule name="resume">
- <doc>
- The transaction context is in a suspended state and must be resumed via the start method
- with resume specified.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <result>
- <struct size="long" type="31">
- <doc>
- This method confirms to the client that the transaction branch is ended or specify the
- error condition.
- </doc>
-
- <field name="status" domain="short" label="Status code">
- <doc>
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason. If an implementation chooses to implement rollback-on-failure behaviour, then
- this value should be selected if the dtx-demarcation.end.fail bit was set.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
-
- <assert check="notnull" />
- </field>
- </struct>
- </result>
- </method>
-
- </class>
-
-
- <!-- == Class: dtx-coordination ============================================================== -->
-
- <class name="dtx-coordination" index="105" label="Coordinate dtx outcomes">
- <doc>
- This class is part of the X-Open XA distributed transaction protocol support. It allows the
- transaction manager to coordinate transaction outcomes.
- </doc>
-
- <doc type="grammar">
- dtx-coordination = *coordination
- coordination = command
- / outcome
- / recovery
- command = C:SET-TIMEOUT
- / C:GET-TIMEOUT
- outcome = one-phase-commit
- / one-phase-rollback
- / two-phase-commit
- / two-phase-rollback
- one-phase-commit = C:COMMIT
- one-phase-rollback = C:ROLLBACK
- two-phase-commit = C:PREPARE C:COMMIT
- two-phase-rollback = C:PREPARE C:ROLLBACK
- recovery = C:RECOVER *recovery-outcome
- recovery-outcome = one-phase-commit
- / one-phase-rollback
- / C:FORGET
- </doc>
-
- <rule name="security">
- <doc>
- Access-tickets are propagated with XA demarcation methods with the aim of restricting which
- users are allowed to control which transactions. The server MAY restrict transaction
- coordination to a particular identity.
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
- <chassis name="client" implement="MAY" />
-
- <!-- - Method: dtx-coordination.commit - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="commit" synchronous="1" index="10" label="Commit work on dtx branch">
- <doc>
- Commit the work done on behalf a transaction branch. This method commits the work associated
- with xid. Any produced messages are made available and any consumed messages are discarded.
- </doc>
-
- <rule name="internal-error" on-failure="internal-error">
- <doc>
- If an error occurs in committing the transaction branch then the server MUST raise a
- channel exception with reply code 541 (internal error)
- </doc>
- </rule>
-
- <rule name="command-invalid" on-failure="command-invalid">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST
- raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
-
- <field name="ticket" domain="access-ticket" label="Access-ticket for specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
-
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access rights to all the
- realms touched by this transaction.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="xid" domain="xid" label="Transaction xid">
- <doc>
- Specifies the xid of the transaction branch to be committed.
- </doc>
-
- <rule name="unknown-xid" on-failure="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
-
- <rule name="not-disassociated" on-failure="command-invalid">
- <doc>
- If this method is called when xid is still associated with a session then the server
- MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="one-phase" domain="bit" label="One-phase optimization flag">
- <doc>
- When set then one-phase commit optimization is used.
- </doc>
-
- <rule name="prerequisite" on-failure="command-invalid">
- <doc>
- This bit MUST be set if a commit is sent without a preceding prepare.
- </doc>
- </rule>
-
- <rule name="validity" on-failure="command-invalid">
- <doc>
- This bit MUST NOT be set if a preceding prepare has been sent.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <result>
- <struct size="long" type="11">
- <doc>
- This confirms to the client that the transaction branch is committed or specify the
- error condition.
- </doc>
-
- <field name="status" domain="short" label="Status code">
- <doc>
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution
-
- xa-heurhaz: Due to some failure, the work done on behalf of the specified transaction
- branch may have been heuristically completed.
-
- xa-heurcom: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was committed.
-
- xa-heurrb: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was rolled back.
-
- xa-heurmix: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was partially committed and partially rolled back.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- <assert check="notnull" />
- </field>
- </struct>
- </result>
- </method>
-
- <!-- - Method: dtx-coordination.forget - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="forget" synchronous="1" index="20" label="Discard dtx branch">
- <doc>
- This method is called to forget about a heuristically completed transaction branch.
- </doc>
-
- <rule name="internal-error" on-failure="internal-error">
- <doc>
- If an error occurs in forgetting the transaction branch then the server MUST raise a
- channel exception with reply code 541 (internal error)
- </doc>
- </rule>
-
- <rule name="command-invalid" on-failure="command-invalid">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST
- raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
-
- <field name="ticket" domain="access-ticket" label="Access-ticket for specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
-
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access rights to all the
- realms touched by this transaction.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="xid" domain="xid" label="Transaction xid">
- <doc>
- Specifies the xid of the transaction branch to be forgotten.
- </doc>
-
- <rule name="unknown-xid" on-failure="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
-
- <rule name="not-disassociated" on-failure="command-invalid">
- <doc>
- If this method is called when xid is still associated with a session then the server
- MUST raise a channel exception with reply code 503 (command invalid).
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
- </method>
-
- <!-- - Method: dtx-coordination.get-timeout - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="get-timeout" synchronous="1" index="30" label="Obtain dtx timeout in seconds">
- <doc>
- This method obtains the current transaction timeout value in seconds. If set-timeout was not
- used prior to invoking this method, the return value is the default timeout; otherwise, the
- value used in the previous set-timeout call is returned.
- </doc>
-
- <rule name="internal-error" on-failure="internal-error">
- <doc>
- If an error occurs in setting the transaction timeout then the server MUST raise a channel
- exception with reply code 541 (internal error).
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
-
- <field name="xid" domain="xid" label="Transaction xid">
- <doc>
- Specifies the xid of the transaction branch for getting the timeout.
- </doc>
-
- <rule name="unknown-xid" on-failure="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <result>
- <struct size="long" type="31">
- <doc>
- Returns the value of the timeout last specified through set-timeout.
- </doc>
-
- <field name="timeout" domain="long" label="The current transaction timeout value">
- <doc>
- The current transaction timeout value in seconds.
- </doc>
- <assert check="notnull" />
- </field>
- </struct>
- </result>
- </method>
-
- <!-- - Method: dtx-coordination.prepare - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="prepare" synchronous="1" index="40" label="Prepare a dtx branch">
- <doc>
- This method prepares for commitment any message produced or consumed on behalf of xid.
- </doc>
-
- <rule name="internal-error" on-failure="internal-error">
- <doc>
- If an error occurs in preparing the transaction branch then the server MUST raise a
- channel exception with reply code 541 (internal error). The specified xid may or may not
- have been prepared.
- </doc>
- </rule>
-
- <rule name="command-invalid" on-failure="command-invalid">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST
- raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <rule name="obligation-1">
- <doc>
- Once this method successfully returns it is guaranteed that the transaction branch may be
- either committed or rolled back regardless of failures.
- </doc>
- </rule>
-
- <rule name="obligation-2">
- <doc>
- The knowledge of xid cannot be erased before commit or rollback complete the branch.
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
-
- <field name="ticket" domain="access-ticket" label="Access-ticket for specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
-
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access rights to all the
- realms touched by this transaction.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="xid" domain="xid" label="Transaction xid">
- <doc>
- Specifies the xid of the transaction branch that can be prepared.
- </doc>
-
- <rule name="unknown-xid" on-failure="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
-
- <rule name="not-disassociated" on-failure="command-invalid">
- <doc>
- If this method is called when xid is still associated with a session then the server
- MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <result>
- <struct size="long" type="41">
- <doc>
- This method confirms to the client that the transaction branch is prepared or specify the
- error condition.
- </doc>
-
- <field name="status" domain="short" label="Status code">
- <doc>
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution.
-
- xa-rdonly: The transaction branch was read-only and has been committed.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
-
- <assert check="notnull" />
- </field>
- </struct>
- </result>
- </method>
-
- <!-- - Method: dtx-coordination.recover - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="recover" synchronous="1" index="50" label="Get prepared or completed xids">
- <doc>
- This method is called to obtain a list of transaction branches that are in a prepared or
- heuristically completed state.
- </doc>
-
- <rule name="internal-error" on-failure="internal-error">
- <doc>
- If an error occurs in recovering then the server MUST raise a channel exception with reply
- code 541 (internal error)
- </doc>
- </rule>
-
- <rule name="start-end">
- <doc>
- If this endscan is used in conjunction with startscan then a single call starts and then
- ends a scan.
- </doc>
- </rule>
-
- <rule name="must-be-started" on-failure="command-invalid">
- <doc>
- If none of endscan and startscan are set then a recovery scan must already be started
- otherwise the server MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
-
- <field name="ticket" domain="access-ticket" label="Access-ticket for specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
-
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access rights to all the
- realms touched by this transaction.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="startscan" domain="bit" label="Start recovery scan flag">
- <doc>
- Indicates that recovery scan should start.
- </doc>
-
- <rule name="recovery-already-open">
- <doc>
- If a recovery scan is already open, the effect is as if the recovery scan were ended and
- then restarted.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="endscan" domain="bit" label="Flag indicating end scan on return of xids">
- <doc>
- Indicates that the recovery scan should end after returning the xids.
- </doc>
- <assert check="notnull" />
- </field>
-
- <result>
- <struct size="long" type="51">
- <doc>
- Returns to the client a table with single item that is a sequence of transaction xids that
- are in a prepared or heuristically completed state.
- </doc>
-
- <field name="in-doubt" domain="array" label="array of xids to be recovered">
- <doc>
- xids to be recovered (xids that are in a prepared or heuristically completed state).
- </doc>
- <assert check="notnull" />
- </field>
- </struct>
- </result>
- </method>
-
- <!-- - Method: dtx-coordination.rollback - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="rollback" synchronous="1" index="60" label="Rollback a dtx branch">
- <doc>
- This method rolls back the work associated with xid. Any produced messages are discarded and
- any consumed messages are re-enqueued.
- </doc>
-
- <rule name="internal-error" on-failure="internal-error">
- <doc>
- If an error occurs in rolling back the transaction branch then the server MUST raise a
- channel exception with reply code 541 (internal error)
- </doc>
- </rule>
-
- <rule name="command-invalid" on-failure="command-invalid">
- <doc>
- If the method is invoked in an improper context (see class grammar) then the server MUST
- raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
-
- <field name="ticket" domain="access-ticket" label="Access-ticket for specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
-
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access rights to all the
- realms touched by this transaction.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="xid" domain="xid" label="Transaction xid">
- <doc>
- Specifies the xid of the transaction branch that can be rolled back.
- </doc>
-
- <rule name="unknown-xid" on-failure="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
-
- <rule name="not-disassociated" on-failure="command-invalid">
- <doc>
- If this method is called when xid is still associated with a session then the server
- MUST raise a channel exception with reply code 503 (command invalid)
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <result>
- <struct size="long" type="61">
- <doc>
- This method confirms to the client that the transaction branch is rolled back or specify the
- error condition.
- </doc>
-
- <field name="status" domain="short" label="Status code">
- <doc>
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution
-
- xa-heurhaz: Due to some failure, the work done on behalf of the specified transaction
- branch may have been heuristically completed.
-
- xa-heurcom: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was committed.
-
- xa-heurrb: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was rolled back.
-
- xa-heurmix: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was partially committed and partially rolled back.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- <assert check="notnull" />
- </field>
- </struct>
- </result>
- </method>
-
- <!-- - Method: dtx-coordination.set-timeout - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="set-timeout" synchronous="1" index="70" label="Set dtx timeout value">
- <doc>
- Sets the specified transaction branch timeout value in seconds.
- </doc>
-
- <rule name="internal-error" on-failure="internal-error">
- <doc>
- If an error occurs in setting the transaction timeout then the server MUST raise a channel
- exception with reply code 541 (internal error)
- </doc>
- </rule>
-
- <rule name="effective">
- <doc>
- Once set, this timeout value is effective until this method is reinvoked with a different
- value.
- </doc>
- </rule>
-
- <rule name="reset">
- <doc>
- A value of zero resets the timeout value to the default value.
- </doc>
- </rule>
-
- <chassis name="server" implement="MAY" />
-
- <field name="ticket" domain="access-ticket" label="Access-ticket for specific realm">
- <doc>
- Access-ticket granted by the server for a specific realm.
- </doc>
-
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access rights to all the
- realms touched by this transaction.
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="xid" domain="xid" label="Transaction xid">
- <doc>
- Specifies the xid of the transaction branch for setting the timeout.
- </doc>
-
- <rule name="unknown-xid" on-failure="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
-
- <assert check="notnull" />
- </field>
-
- <field name="timeout" domain="long" label="Dtx timeout in seconds">
- <doc>
- The transaction timeout value in seconds.
- </doc>
- <assert check="notnull" />
- </field>
- </method>
-
- </class>
-
-
- <!-- == Class: tunnel ========================================================================= -->
-
- <class name="tunnel" index="110" label="methods for protocol tunnelling">
- <doc>
- The tunnel methods are used to send blocks of binary data - which can be serialised AMQP
- methods or other protocol frames - between AMQP peers.
- </doc>
-
- <doc type="grammar">
- tunnel = C:REQUEST
- / S:REQUEST
- </doc>
-
- <chassis name="server" implement="MAY" />
- <chassis name="client" implement="MAY" />
-
- <field name="headers" domain="table" label="message header field table" />
- <field name="proxy-name" domain="shortstr" label="identity of tunnelling proxy" />
- <field name="data-name" domain="shortstr" label="name or type of message being tunnelled" />
- <field name="durable" domain="octet" label="message durability indicator" />
- <field name="broadcast" domain="octet" label="message broadcast mode" />
-
- <!-- - Method: tunnel.request - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="request" content="1" index="10" label="sends a tunnelled method">
- <doc>
- This method tunnels a block of binary data, which can be an encoded AMQP method or other
- data. The binary data is sent as the content for the Tunnel.Request method.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="meta-data" domain="table" label="meta data for the tunnelled block">
- <doc>
- This field table holds arbitrary meta-data that the sender needs to pass to the recipient.
- </doc>
- </field>
- </method>
-
- </class>
-
- <!-- == Class: message ======================================================================= -->
-
- <class name="message" index="120" label="message transfer">
- <doc>
- The message class provides methods that support an industry-standard messaging model.
- </doc>
-
- <doc type="grammar">
- message = C:QOS
- / C:CONSUME
- / C:CANCEL
- / C:TRANSFER [ S:REJECT ]
- / S:TRANSFER [ C:REJECT ]
- / C:GET [ S:EMPTY ]
- / C:RECOVER
- / C:OPEN
- / S:OPEN
- / C:APPEND
- / S:APPEND
- / C:CLOSE
- / S:CLOSE
- / C:CHECKPOINT
- / S:CHECKPOINT
- / C:RESUME S:OFFSET
- / S:RESUME C:OFFSET
- </doc>
-
- <rule name="persistent-message">
- <doc>
- The server SHOULD respect the persistent property of messages and SHOULD make a best-effort
- to hold persistent mess ages on a reliable storage mechanism.
- </doc>
- <doc type="scenario">
- Send a persistent message to queue, stop server, restart server and then verify whether
- message is still present. Assumes that queues are durable. Persistence without durable
- queues makes no sense.
- </doc>
- </rule>
-
- <rule name="no-persistent-message-discard">
- <doc>
- The server MUST NOT discard a persistent message in case of a queue overflow.
- </doc>
- <doc type="scenario">
- Create a queue overflow situation with persistent messages and verify that messages do not
- get lost (presumably the server will write them to disk).
- </doc>
- </rule>
-
- <rule name="throttling">
- <doc>
- The server MAY use the Session.Flow method to slow or stop a message publisher when
- necessary.
- </doc>
- <doc type="scenario">
- Create a queue overflow situation with non-persistent messages and verify whether the server
- responds with Session.Flow or not. Repeat with persistent messages.
- </doc>
- </rule>
-
- <rule name="non-persistent-message-overflow">
- <doc>
- The server MAY overflow non-persistent messages to persistent storage.
- </doc>
- </rule>
-
- <rule name="non-persistent-message-discard">
- <doc>
- The server MAY discard or dead-letter non-persistent messages on a priority basis if the
- queue size exceeds some configured limit.
- </doc>
- </rule>
-
- <rule name="min-priority-levels">
- <doc>
- The server MUST implement at least 2 priority levels for messages, where priorities 0-4 and
- 5-9 are treated as two distinct levels.
- </doc>
- <doc type="scenario">
- Send a number of priority 0 messages to a queue. Send one priority 9 message. Consume
- messages from the queue and verify that the first message received was priority 9.
- </doc>
- </rule>
-
- <rule name="max-priority-levels">
- <doc>
- The server MAY implement up to 10 priority levels.
- </doc>
- <doc type="scenario">
- Send a number of messages with mixed priorities to a queue, so that all priority values from
- 0 to 9 are exercised. A good scenario would be ten messages in low-to-high priority. Consume
- from queue and verify how many priority levels emerge.
- </doc>
- </rule>
-
- <rule name="priority-delivery">
- <doc>
- The server MUST deliver messages of the same priority in order irrespective of their
- individual persistence.
- </doc>
- <doc type="scenario">
- Send a set of messages with the same priority but different persistence settings to a queue.
- Consume and verify that messages arrive in same order as originally published.
- </doc>
- </rule>
-
- <rule name="automatic-acknowledgements">
- <doc>
- The server MUST support automatic acknowledgements on messages, i.e. consumers with the
- no-ack field set to FALSE.
- </doc>
- <doc type="scenario">
- Create a queue and a consumer using automatic acknowledgements. Publish a set of messages to
- the queue. Consume the messages and verify that all messages are received.
- </doc>
- </rule>
-
- <rule name="explicit-acknowledgements">
- <doc>
- The server MUST support explicit acknowledgements on messages, i.e. consumers with the
- no-ack field set to TRUE.
- </doc>
- <doc type="scenario">
- Create a queue and a consumer using explicit acknowledgements. Publish a set of messages to
- the queue. Consume the messages but acknowledge only half of them. Disconnect and reconnect,
- and consume from the queue. Verify that the remaining messages are received.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <!-- - Method: message.transfer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="transfer" content="1" index="10" label="transfer a message">
- <doc>
- This method transfers a message between two peers. When a client uses this method to publish
- a message to a broker, the destination identifies a specific exchange. The message will then
- be routed to queues as defined by the exchange configuration and distributed to any active
- subscriptions when the transaction, if any, is committed.
-
- The client may initiate transfers from the broker by starting a subscription using the
- subscribe method and passing in a destination, then the broker responds with transfer
- methods to the specified destination as and when messages arrive in the subscribed queue.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="ticket" domain="access-ticket" label="access ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "passive" access rights to the
- realm for the exchange and "write" access rights to the realm for the queue to which the
- message will be published.
- </doc>
- </rule>
- </field>
-
- <field name="destination" domain="destination" label="message destination">
- <doc>
- Specifies the destination to which the message is to be transferred. The destination can
- be empty, meaning the default exchange or subscription. If the destination is specified,
- and that exchange or subscription does not exist, the peer must raise a channel exception.
- </doc>
-
- <rule name="blank-destination">
- <doc>
- The server MUST accept a blank destination to mean the default exchange.
- </doc>
- </rule>
-
- <rule name="internal-exchange">
- <doc>
- If the destination refers to an internal exchange, the server MUST raise a channel
- exception with a reply code 403 (access refused).
- </doc>
- </rule>
-
- <rule name="message-refusal">
- <doc>
- A destination MAY refuse message content in which case it MUST raise a channel exception
- with reply code 540 (not implemented).
- </doc>
- </rule>
- </field>
-
- <field name="confirm-mode" domain="confirm-mode" />
- <field name="acquire-mode" domain="acquire-mode" />
- </method>
-
- <!-- - Method: message.reject - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="reject" index="160" label="reject a message">
- <doc>
- Indicates that the message transfers are un-processable in some way. A message may be
- rejected for a number of reasons. A server may reject a message if it is unroutable. A
- client may reject a message if it is invalid.
- </doc>
-
- <rule name="alternate-exchange">
- <doc>
- When a client rejects a message, the server MUST deliver that message to the
- alternate-exchange on the queue from which it was delivered. If no alternate-exchange is
- defined for that queue the broker MAY discard the message.
- </doc>
- </rule>
-
- <rule name="acquisition">
- <doc>
- The recipient MUST have acquired a message in order to reject it. If the message is not
- acquired any reject MUST be ignored.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MAY" />
-
- <field name="transfers" domain="correlation" />
- <field name="code" domain="reject-code" />
- <field name="text" domain="reject-text" />
- </method>
-
- <!-- - Method: message.acquire - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="acquire" index="170" label="acquire messages for consumption">
- <doc>
- Acquires previously transferred messages for consumption. The acquired ids (if any) are
- sent via message.acquired.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="transfers" domain="correlation" />
- <!-- do we need this field? -->
- <field name="mode" domain="octet">
- <doc>
- One of:
- - any (0): acquire any available messages for consumption
- - all (1): only acquire messages if all are available for consumption
- </doc>
- </field>
- </method>
-
- <!-- - Method: message.acquired - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="acquired" index="180" label="indicates acquired messages">
- <doc>
- Identifies a set of previously transferred messages now available for consumption.
- </doc>
-
- <chassis name="client" implement="MAY" />
-
- <field name="transfers" domain="correlation" />
- </method>
-
- <!-- - Method: message.release - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="release" index="190" label="release a message">
- <doc>
- Release previously transferred messages that have been acquired for consumption (whether
- implicitly or explicitly). Released messages will be available for acquisition by other
- consumers. The order of released messages may be lost.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MAY" />
-
- <field name="transfers" domain="correlation" />
- </method>
-
- <!-- - Method: message.subscribe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="subscribe" index="20" label="start a queue subscription">
- <doc>
- This method asks the server to start a "subscription", which is a transient request for
- messages from a specific queue. Subscriptions last as long as the session they were created
- on, or until the client cancels them.
- </doc>
-
- <rule name="simultaneous-subscriptions">
- <doc>
- The server SHOULD support at least 16 subscriptions per queue, and ideally, impose no
- limit except as defined by available resources.
- </doc>
- <doc type="scenario">
- Create a queue and create subscriptions on that queue until the server closes the
- connection. Verify that the number of subscriptions created was at least sixteen and
- report the total number.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to the realm
- for the subscribed queue.
- </doc>
- <doc type="scenario">
- Attempt to create a subscription with an invalid (non-zero) access ticket.
- </doc>
- </rule>
- </field>
-
- <field name="queue" domain="queue-name">
- <doc>
- Specifies the name of the subscribed queue.
- </doc>
- </field>
-
- <field name="destination" domain="destination" label="incoming message destination">
- <doc>
- Specifies the destination for the subscription. The destination is local to a connection,
- so two clients can use the same destination.
- </doc>
-
- <rule name="destination-non-existing-subscription" on-failure="not-allowed">
- <doc>
- The client MUST NOT specify a destination that refers to an existing subscription.
- </doc>
- <doc type="scenario">
- Attempt to create two subscriptions with the same non-empty destination.
- </doc>
- </rule>
-
- <rule name="destination-session-bound" on-failure="not-allowed">
- <doc>
- The destination is valid only within the session from which the subscription was
- created. i.e. A client MUST NOT create a subscription in one session and then use it in
- another.
- </doc>
- <doc type="scenario">
- Attempt to create a subscription in one session, then use in another session, in which
- subscriptions have also been created (to test that the server uses unique destinations).
- </doc>
- </rule>
- </field>
-
- <field name="no-local" domain="no-local" label="messages not returned to publisher">
- <doc>
- If the no-local field is set the server will not send messages to the connection that
- published them.
- </doc>
- </field>
-
- <field name="confirm-mode" domain="confirm-mode">
- <doc>
- The default confirm-mode for this subscription.
- </doc>
- </field>
-
- <field name="acquire-mode" domain="acquire-mode">
- <doc>
- The default acquire-mode for this subscription.
- </doc>
- </field>
-
- <field name="exclusive" domain="bit" label="request exclusive access">
- <doc>
- Request exclusive subscription access, meaning only this subscription can access the queue.
- </doc>
-
- <rule name="in-use" on-failure="access-refused">
- <doc>
- The client MUST NOT gain exclusive access to a queue that already has active subscriptions.
- </doc>
- <doc type="scenario">
- Open two connections to a server, and in one connection create a shared (non-exclusive)
- queue and then subscribe to the queue. In the second connection attempt to subscribe to
- the same queue using the exclusive option.
- </doc>
- </rule>
- </field>
-
- <field name="filter" domain="table" label="arguments for filtering">
- <doc>
- A set of filters for the subscription. The syntax and semantics of these filters depends
- on the providers implementation.
- </doc>
- </field>
- </method>
-
- <!-- - Method: message.cancel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="cancel" index="30" label="end a queue consumer">
- <doc>
- This method cancels a consumer. This does not affect already delivered messages, but it does
- mean the server will not send any more messages for that consumer. The client may receive an
- arbitrary number of messages in between sending the cancel method and receiving the
- notification of completion of the cancel command.
- </doc>
-
- <rule name="ignore">
- <doc>
- If the queue does not exist the server MUST ignore the cancel method, so long as the
- consumer tag is valid for that session.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="destination" domain="destination" />
- </method>
-
- <!-- - Method: message.get - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="get" index="40" label="direct access to a queue">
- <doc>
- This method provides a direct access to the messages in a queue using a synchronous dialogue
- that is designed for specific types of application where synchronous functionality is more
- important than performance.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <response name="empty" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="ticket-required" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to the realm
- for the queue from which the message will be consumed.
- </doc>
- </rule>
- </field>
-
- <field name="queue" domain="queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null, refers to the
- current queue for the session, which is the last declared queue.
- </doc>
- <rule name="empty-name">
- <doc>
- If the client did not previously declare a queue, and the queue name in this method is
- empty, the server MUST raise a connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name="destination" domain="destination">
- <doc>
- On normal completion of the get request (i.e. a response of ok). A message will be
- transferred to the supplied destination.
- </doc>
- </field>
-
- <field name="no-ack" domain="no-ack" />
- </method>
-
- <!-- - Method: message.recover - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="recover" index="50" label="redeliver unacknowledged messages">
- <doc>
- This method asks the broker to redeliver all unacknowledged messages on a specified session.
- Zero or more messages may be redelivered. This method is only allowed on non-transacted
- sessions.
- </doc>
-
- <rule name="redelivered-flag">
- <doc>
- The server MUST set the redelivered flag on all messages that are resent.
- </doc>
- </rule>
-
- <rule name="transacted-session">
- <doc>
- The server MUST raise a channel exception if this is called on a transacted session.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
-
- <field name="requeue" domain="bit" label="requeue the message">
- <doc>
- If this field is zero, the message will be redelivered to the original recipient. If this
- bit is 1, the server will attempt to requeue the message, potentially then delivering it
- to an alternative subscriber.
- </doc>
- </field>
- </method>
-
- <!-- - Method: message.open - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="open" index="60" label="create a reference to an empty message body">
- <doc>
- This method creates a reference. A references provides a means to send a message body into a
- temporary area at the recipient end and then deliver the message by referring to this
- temporary area. This is how the protocol handles large message transfers.
-
- The scope of a ref is defined to be between calls to open (or resume) and close. Between
- these points it is valid for a ref to be used from any content data type, and so the
- receiver must hold onto its contents. Should the session be closed when a ref is still in
- scope, the receiver may discard its contents (unless it is checkpointed). A ref that is in
- scope is considered open.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="reference" domain="reference">
- <rule name="duplicate-reference">
- <doc>
- The recipient MUST generate an error if the reference is currently open (in scope).
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: message.close - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="close" index="70" label="close a reference">
- <doc>
- This method signals the recipient that no more data will be appended to the reference.
- </doc>
-
- <rule name="message-acknowledge-after-close">
- <doc>
- A recipient MUST NOT acknowledge a message until its reference is closed (not in scope).
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="reference" domain="reference" label="target reference">
- <rule name="non-existent-reference">
- <doc>
- The recipient MUST generate an error if the reference was not previously open (in
- scope).
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - Method: message.append - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="append" index="80" label="append to a reference">
- <doc>This method appends data to a reference.</doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="reference" domain="reference" label="target reference">
- <rule name="non-existent-reference">
- <doc>
- The recipient MUST generate an error if the reference is not open (not in scope).
- </doc>
- </rule>
- </field>
-
- <field name="bytes" domain="longstr" label="data to append" />
- </method>
-
- <!-- - Method: message.checkpoint - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="checkpoint" index="90" label="checkpoint a message body">
- <doc>
- This method provides a means to checkpoint large message transfer. The sender may ask the
- recipient to checkpoint the contents of a reference using the supplied identifier. The
- sender may then resume the transfer at a later point. It is at the discretion of the
- recipient how much data to save with the checkpoint, and the sender MUST honour the offset
- returned by the resume method.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="reference" domain="reference" label="target reference">
- <rule name="non-existent-reference">
- <doc>
- The recipient MUST generate an error if the reference is not open (not in scope).
- </doc>
- </rule>
- </field>
-
- <field name="identifier" domain="shortstr" label="checkpoint identifier">
- <doc>
- This is the checkpoint identifier. This is an arbitrary string chosen by the sender. For
- checkpointing to work correctly the sender must use the same checkpoint identifier when
- resuming the message. A good choice for the checkpoint identifier would be the SHA1 hash
- of the message properties data (including the original filename, revised time, etc.).
- </doc>
- </field>
- </method>
-
- <!-- - Method: message.resume - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="resume" index="100" label="open and resume a checkpointed message">
- <doc>
- This method resumes a reference from the last checkpoint. A reference is considered to be
- open (in scope) after a resume even though it will not have been opened via the open method
- during this session.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <response name="offset" />
-
- <field name="reference" domain="reference" label="target reference">
- <rule name="non-existent-reference">
- <doc>
- The recipient MUST generate an error if the reference is currently open (in scope).
- </doc>
- </rule>
- </field>
-
- <field name="identifier" domain="shortstr" label="checkpoint identifier" />
- </method>
-
- <!-- - Method: message.qos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="qos" index="110" label="specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the current
- session or for all sessions on the connection. The particular properties and semantics of a
- qos method always depend on the content class semantics. Though the qos method could in
- principle apply to both peers, it is currently meaningful only for the server.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="prefetch-size" domain="long" label="prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client finishes
- processing a message, the following message is already held locally, rather than needing
- to be sent within the session. Prefetching gives a performance improvement. This field
- specifies the prefetch window size in octets. The server will send a message in advance if
- it is equal to or smaller in size than the available prefetch size (and also falls into
- other prefetch limits). May be set to zero, meaning "no specific limit", although other
- prefetch limits may still apply. The prefetch-size is ignored if the no-ack option is set.
- </doc>
- <rule name="non-responsive-client">
- <doc>
- The server MUST ignore this setting when the client is not processing any messages -
- i.e. the prefetch size does not limit the transfer of single messages to a client, only
- the sending in advance of more messages while the client still has one or more
- unacknowledged messages.
- </doc>
- <doc type="scenario">
- Define a QoS prefetch-size limit and send a single message that exceeds that limit.
- Verify that the message arrives correctly.
- </doc>
- </rule>
- </field>
-
- <field name="prefetch-count" domain="short" label="prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This field may be used in
- combination with the prefetch-size field; a message will only be sent in advance if both
- prefetch windows (and those at the session and connection level) allow it. The
- prefetch-count is ignored if the no-ack option is set.
- </doc>
- <rule name="prefetch-maximum">
- <doc>
- The server may send less data in advance than allowed by the client's specified prefetch
- windows but it MUST NOT send more.
- </doc>
- <doc type="scenario">
- Define a QoS prefetch-size limit and a prefetch-count limit greater than one. Send
- multiple messages that exceed the prefetch size. Verify that no more than one message
- arrives at once.
- </doc>
- </rule>
- </field>
-
- <field name="global" domain="bit" label="apply to entire connection">
- <doc>
- By default the QoS settings apply to the current session only. If this field is set, they
- are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <!-- - Method: message.flow-mode - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="flow-mode" index="120" label="set the flow control mode">
- <doc>
- Sets the mode of flow control used for a given destination.
-
- With credit based flow control, the sender of messages continually maintains its current
- credit balance with the recipient. The credit balance consists of two values, a message
- count, and a byte count. Whenever message data is sent, both counts must be decremented.
- If either value reaches zero, the flow of message data must stop. Additional credit is
- received via the message.flow method.
-
- The sender MUST NOT send partial framesets. This means that if there is not enough byte
- credit available to send a complete message, the sender must either wait or use chunked
- transfer to send the first part of the message data in a complete frameset.
-
- Window based flow control is identical to credit based flow control, however message
- acknowledgment implicitly grants a single unit of message credit, and the size of the
- message in byte credits for each acknowledged message.
- </doc>
-
- <rule name="byte-accounting">
- <doc>
- The byte count is decremented by the payload size of each transmitted frame with
- segment type header or body appearing within a message.transfer command. Note that
- the payload size is the frame size less the frame header size (frame-size - 12).
- </doc>
- </rule>
-
- <rule name="mode-switching">
- <doc>
- Mode switching may only occur if both outstanding credit balances are zero. There are
- three ways for a recipient of messages to be sure that the sender 's credit balance is
- zero:
-
- 1) The recipient may send a message.stop command to the sender. When the recipient
- receives confirmation of completion for the message.stop command, it knows that the
- sender's credit is zero.
-
- 2) The recipient may perform the same steps described in (1) with the message.flush
- command substituted for the message.stop command.
-
- 3) Immediately after receiving a message.consume, the credit for that destination
- defaults to zero.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="destination" domain="destination" />
- <field name="mode" domain="octet">
- <doc>
- One of:
- - credit (0): choose credit based flow control
- - window (1): choose window based flow control
- </doc>
- </field>
- </method>
-
- <!-- - Method: message.flow - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="flow" index="130" label="control message flow">
- <doc>
- This method controls the flow of message data to a given destination. It is used by the
- recipient of messages to dynamically match the incoming rate of message flow to its
- processing or forwarding capacity. Upon receipt of this method, the sender must add "value"
- number of the specified unit to the available credit balance for the specified destination.
- A value of (0xFFFFFFFF) indicates an infinite amount of credit. This disables any limit for
- the given unit until the credit balance is zeroed with message.stop or message.flush.
- </doc>
-
- <!-- throws no-such-destination -->
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="destination" domain="destination"/>
- <field name="unit" domain="octet">
- <doc>
- Specifies the unit of credit balance.
-
- One of:
- - message (0)
- - byte (1)
- </doc>
- </field>
- <field name="value" domain="long">
- <doc>
- A value of (0xFFFFFFFF) indicates an infinite amount of credit.
- </doc>
- </field>
- </method>
-
- <!-- - Method: message.flush - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="flush" index="140">
- <doc>
- Forces the sender to exhaust his credit supply. The sender's credit will always be zero when
- this method completes. The message does not complete until all the message transfers occur.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="destination" domain="destination" />
- </method>
-
- <!-- - Method: message.stop - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="stop" index="150">
- <doc>
- On receipt of this method, a producer of messages MUST set his credit to zero for the given
- destination. This obeys the generic semantics of command completion, i.e. when confirmation
- is issued credit MUST be zero and no further messages will be sent until such a time as
- further credit is received.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="destination" domain="destination" />
- </method>
-
- <!-- - Method: message.empty - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="empty" index="200" label="empty queue">
- <doc>
- Signals that a queue does not contain any messages; usually sent in response to the get
- method.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
- </method>
-
- <!-- - Method: message.offset - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="offset" index="210" label="return an offset">
- <doc>
- Returns the data offset into a reference body; usually sent in response to resume method.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MUST" />
-
- <field name="value" domain="offset" label="offset into a reference body">
- <doc>
- Offset in bytes into message body data.
- </doc>
- </field>
- </method>
-
- </class>
-
- <!-- == Class: binding ======================================================================= -->
-
- <class name="binding" index="130"
- label="provides the ability to query bindings">
- <doc>
- This is a utility class for querying and exchange about its bindings to queues.
- </doc>
-
- <chassis name="server" implement="MUST" />
- <chassis name="client" implement="MAY" />
-
- <!-- - Method: binding.query - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="query" synchronous="1" index="10"
- label="request information about bindings to an exchange">
- <doc>
- This method is used to request information on the bindings to a particular exchange.
- </doc>
-
- <chassis name="server" implement="MUST" />
-
- <field name="ticket" domain="access-ticket">
- <rule name="validity" on-failure="access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "passive" access rights to the
- exchange's access realm.
- </doc>
- </rule>
- </field>
-
- <field name="exchange" domain="shortstr" label="the exchange name">
- <doc>
- The name of the exchange for which binding information is being requested. If not
- specified explicitly the default exchange is implied.
- </doc>
- </field>
-
- <field name="queue" domain="shortstr" label="a queue name">
- <doc>
- If populated then determine whether the given queue is bound to the exchange.
- </doc>
- </field>
-
- <field name="routing-key" domain="shortstr" label="a routing-key">
- <doc>
- If populated defines the routing key of the binding of interest, if not populated the
- request will ignore the routing key on bindings when searching for a match.
- </doc>
- </field>
-
- <field name="arguments" domain="table" label="a set of binding arguments">
- <doc>
- If populated defines the arguments of the binding of interest if not populated the request
- will ignore the arguments on bindings when searching for a match
- </doc>
- </field>
-
- <result>
- <struct size="long" type="11">
- <doc>
- This method is used in response to a query and conveys information on the bindings to a
- particular exchange.
- </doc>
-
- <field name="exchange-not-found" domain="bit" label="indicate an unknown exchange">
- <doc>
- If set, the exchange for which information was requested is not known.
- </doc>
- </field>
-
- <field name="queue-not-found" domain="bit" label="indicate an unknown queue">
- <doc>
- If set, the queue specified is not known.
- </doc>
- </field>
-
- <field name="queue-not-matched" domain="bit" label="indicate no matching queue">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange to the
- specified queue.
- </doc>
- </field>
-
- <field name="key-not-matched" domain="bit" label="indicate no matching routing key">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange with
- the specified routing key.
- </doc>
- </field>
-
- <field name="args-not-matched" domain="bit" label="indicate no matching args">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange with
- the specified arguments.
- </doc>
- </field>
- </struct>
- </result>
- </method>
-
- </class>
-
- <!-- == Class: execution ===================================================================== -->
-
- <class name="execution" index="140">
- <doc>
- This class allows for efficiently communicating information about completion of processing.
- </doc>
-
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
-
- <!-- - Method: execution.flush - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="flush" index="10" label="request an execution.complete return method">
- <doc>
- Requests notification of all currently complete commands. The server should issue an
- execution.complete at the earliest possible opportunity.
- </doc>
-
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- </method>
-
- <!-- - Method: execution.complete - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="complete" index="20">
- <doc>
- Signals completion of all commands such that command-id &lt;= cumulative-execution-mark, or
- command-id is in the set defined by ranged-execution-set. This can be sent spontaneously,
- in response to a execution.flush, or as requested by use of the sync bit.
-
- <!-- TODO: See chapter (TBD here) for how command ids are computed. -->
- </doc>
-
- <rule name="unique-encoding">
- <doc>
- In order to ensure a canonical wire representation, the value cumulative-execution-mark +
- 1 must not be covered by the ranged-execution-set.
- </doc>
- </rule>
-
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
-
- <field name="cumulative-execution-mark" domain="rfc1982-long"
- label="Low-water mark for command ids">
- <doc>
- The low-water mark for executed command-ids. All ids below this mark have been executed;
- above this mark, there are gaps containing unexecuted command ids (i.e. discontinuous). By
- definition, the first id above this mark (if it exists) is an unexecuted command-id.
- </doc>
- </field>
-
- <field name="ranged-execution-set" domain="rfc1982-long-set"
- label="Set of discontinuous command ids above cumulative-execution-mark">
- <doc>
- This set contains a sequence of discontinuous executed command-ids above the low-water
- mark (i.e. above the first gap of unexecuted command ids).
- </doc>
- </field>
- </method>
-
- <!-- - Method: execution.noop - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="noop" index="30" label="a command that does nothing">
- <doc>
- This command may be used when it is desirable to send a command that has no effect. This
- situation can occur after issuing a number of commands with sync=False. If, after issuing
- the commands, a peer wishes to receive confirmation of completion, the peer can do so by
- sending an execution.noop command with sync=True.
- </doc>
-
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- </method>
-
- <!-- - Method: execution.result - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="result" index="40" label="carries execution results">
- <doc>
- This method carries data resulting from the execution of a command.
- </doc>
-
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
-
- <field name="command-id" domain="command-id"/>
- <field name="data" domain="long-struct"/>
- </method>
-
- <!-- - Method: execution.sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name="sync" index="50" label="request notification of completion for issued commands">
- <doc>
- Requests notification (via execution.complete) when all commands issued prior to the sync
- control are complete. If the recipient of this control has already notified the
- sender that said commands are complete, it may safely ignore the control.
- </doc>
-
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- </method>
-
- </class>
-
-</amqp>
diff --git a/M4-RCs/qpid/specs/amqp.0-10-qpid-errata.xml b/M4-RCs/qpid/specs/amqp.0-10-qpid-errata.xml
deleted file mode 100644
index 1b15588a5e..0000000000
--- a/M4-RCs/qpid/specs/amqp.0-10-qpid-errata.xml
+++ /dev/null
@@ -1,6652 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright Notice
- ================
- (c) Copyright Cisco Systems, Credit Suisse, Deutsche Borse Systems, Envoy Technologies, Inc.,
- Goldman Sachs, IONA Technologies PLC, iMatix Corporation sprl.,JPMorgan Chase Bank Inc. N.A,
- Novell, Rabbit Technologies Ltd., Red Hat, Inc., TWIST Process Innovations ltd, and 29West Inc.
- 2006, 2007. All rights reserved.
-
- License
- =======
-
- Cisco Systems, Credit Suisse, Deutsche Borse Systems, Envoy Technologies, Inc.,Goldman Sachs,
- IONA Technologies PLC, iMatix Corporation sprl.,JPMorgan Chase Bank Inc. N.A, Novell, Rabbit
- Technologies Ltd., Red Hat, Inc., TWIST Process Innovations ltd, and 29West Inc. (collectively,
- the "Authors") each hereby grants to you a worldwide, perpetual, royalty-free, nontransferable,
- nonexclusive license to (i) copy, display, distribute and implement the Advanced Messaging Queue
- Protocol ("AMQP") Specification and (ii) the Licensed Claims that are held by the Authors, all for
- the purpose of implementing the Advanced Messaging Queue Protocol Specification. Your license and
- any rights under this Agreement will terminate immediately without notice from any Author if you
- bring any claim, suit, demand, or action related to the Advanced Messaging Queue Protocol
- Specification against any Author. Upon termination, you shall destroy all copies of the Advanced
- Messaging Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or patent application,
- throughout the world, excluding design patents and design registrations, owned or controlled, or
- that can be sublicensed without fee and in compliance with the requirements of this Agreement, by
- an Author or its affiliates now or at any future time and which would necessarily be infringed by
- implementation of the Advanced Messaging Queue Protocol Specification. A claim is necessarily
- infringed hereunder only when it is not possible to avoid infringing it because there is no
- plausible non-infringing alternative for implementing the required portions of the Advanced
- Messaging Queue Protocol Specification. Notwithstanding the foregoing, Licensed Claims shall not
- include any claims other than as set forth above even if contained in the same patent as Licensed
- Claims; or that read solely on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging Queue Protocol
- Specification, or that, if licensed, would require a payment of royalties by the licensor to
- unaffiliated third parties. Moreover, Licensed Claims shall not include (i) any enabling
- technologies that may be necessary to make or use any Licensed Product but are not themselves
- expressly set forth in the Advanced Messaging Queue Protocol Specification (e.g., semiconductor
- manufacturing technology, compiler technology, object oriented technology, networking technology,
- operating system technology, and the like); or (ii) the implementation of other published
- standards developed elsewhere and merely referred to in the body of the Advanced Messaging Queue
- Protocol Specification, or (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced Messaging Queue Protocol
- Specification. For purposes of this definition, the Advanced Messaging Queue Protocol
- Specification shall be deemed to include both architectural and interconnection requirements
- essential for interoperability and may also include supporting source code artifacts where such
- architectural, interconnection requirements and source code artifacts are expressly identified as
- being required or documentation to achieve compliance with the Advanced Messaging Queue Protocol
- Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions of products (hardware,
- software or combinations thereof) that implement and are compliant with all relevant portions of
- the Advanced Messaging Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any use you may make of the
- Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS," AND THE AUTHORS MAKE NO
- REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS
- OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE
- IMPLEMENTATION OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD
- PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
- DAMAGES ARISING OUT OF OR RELATING TO ANY USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner, including advertising or
- publicity pertaining to the Advanced Messaging Queue Protocol Specification or its contents
- without specific, written prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you shall destroy all copies of
- the Advanced Messaging Queue Protocol Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the Octagon Symbol are
- trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA Technologies PLC and/or its
- subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered trademarks of Red Hat,
- Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of Sun Microsystems, Inc. in the
- United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
--->
-
-<!--
- XML Notes
- =========
-
- We use entities to indicate repetition; attributes to indicate properties.
-
- We use the "name" attribute as an identifier, usually within the context of the surrounding
- entities.
-
- We use hyphens (minus char '-') to seperate words in names.
-
- We do not enforce any particular validation mechanism but we support all mechanisms. The protocol
- definition conforms to a formal grammar that is published seperately in several technologies.
-
--->
-
-<!DOCTYPE amqp SYSTEM "amqp.0-10.dtd">
-
-<amqp xmlns="http://www.amqp.org/schema/amqp.xsd"
- major="0" minor="10" port="5672">
-
- <!--
- ====================== == type definitions == ======================
- -->
-
- <!--
- 0x00 - 0x0f: Fixed width, 1 octet
- -->
-
- <type name="bin8" code="0x00" fixed-width="1" label="octet of unspecified encoding">
- <doc>
- The bin8 type consists of exactly one octet of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET
- +----------+
- | bin8 |
- +----------+
- </doc>
-
- <doc type="bnf">
- bin8 = OCTET
- </doc>
- </type>
-
- <type name="int8" code="0x01" fixed-width="1" label="8-bit signed integral value (-128 - 127)">
- <doc>
- The int8 type is a signed integral value encoded using an 8-bit two's complement
- representation.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET
- +----------+
- | int8 |
- +----------+
- </doc>
-
- <doc type="bnf">
- int8 = OCTET
- </doc>
- </type>
-
- <type name="uint8" code="0x02" fixed-width="1" label="8-bit unsigned integral value (0 - 255)">
- <doc>
- The uint8 type is an 8-bit unsigned integral value.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET
- +---------+
- | uint8 |
- +---------+
- </doc>
-
- <doc type="bnf">
- uint8 = OCTET
- </doc>
- </type>
-
- <type name="char" code="0x04" fixed-width="1" label="an iso-8859-15 character">
- <doc>
- The char type encodes a single character from the iso-8859-15 character set.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET
- +----------+
- | char |
- +----------+
- </doc>
-
- <doc type="bnf">
- char = OCTET
- </doc>
- </type>
-
- <type name="boolean" code="0x08" fixed-width="1"
- label="boolean value (zero represents false, nonzero represents true)">
- <doc>
- The boolean type is a single octet that encodes a true or false value. If the octet is zero,
- then the boolean is false. Any other value represents true.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET
- +---------+
- | boolean |
- +---------+
- </doc>
-
- <doc type="bnf">
- boolean = OCTET
- </doc>
- </type>
-
- <!--
- 0x10 - 0x1f: Fixed width, 2 octets
- -->
-
- <type name="bin16" code="0x10" fixed-width="2" label="two octets of unspecified binary encoding">
- <doc>
- The bin16 type consists of two consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET
- +-----------+-----------+
- | octet-one | octet-two |
- +-----------+-----------+
- </doc>
-
- <doc type="bnf">
- bin16 = 2 OCTET
- </doc>
- </type>
-
- <type name="int16" code="0x11" fixed-width="2" label="16-bit signed integral value">
- <doc>
- The int16 type is a signed integral value encoded using a 16-bit two's complement
- representation in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET
- +-----------+----------+
- | high-byte | low-byte |
- +-----------+----------+
- </doc>
-
- <doc type="bnf">
- int16 = high-byte low-byte
- high-byte = OCTET
- low-byte = OCTET
- </doc>
- </type>
-
- <type name="uint16" code="0x12" fixed-width="2" label="16-bit unsigned integer">
- <doc>
- The uint16 type is a 16-bit unsigned integral value encoded in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET
- +-----------+----------+
- | high-byte | low-byte |
- +-----------+----------+
- </doc>
-
- <doc type="bnf">
- uint16 = high-byte low-byte
- high-byte = OCTET
- low-byte = OCTET
- </doc>
- </type>
-
- <!--
- 0x20 - 0x2f: Fixed width, 4 octets
- -->
-
- <type name="bin32" code="0x20" fixed-width="4" label="four octets of unspecified binary encoding">
- <doc>
- The bin32 type consists of 4 consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-------------+------------+
- | octet-one | octet-two | octet-three | octet-four |
- +-----------+-----------+-------------+------------+
- </doc>
-
- <doc type="bnf">
- bin32 = 4 OCTET
- </doc>
- </type>
-
- <type name="int32" code="0x21" fixed-width="4" label="32-bit signed integral value">
- <doc>
- The int32 type is a signed integral value encoded using a 32-bit two's complement
- representation in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+------------+----------+----------+
- | byte-four | byte-three | byte-two | byte-one |
- +-----------+------------+----------+----------+
- MSB LSB
- </doc>
-
- <doc type="bnf">
- int32 = byte-four byte-three byte-two byte-one
- byte-four = OCTET ; most significant byte (MSB)
- byte-three = OCTET
- byte-two = OCTET
- byte-one = OCTET ; least significant byte (LSB)
- </doc>
- </type>
-
- <type name="uint32" code="0x22" fixed-width="4" label="32-bit unsigned integral value">
- <doc>
- The uint32 type is a 32-bit unsigned integral value encoded in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+------------+----------+----------+
- | byte-four | byte-three | byte-two | byte-one |
- +-----------+------------+----------+----------+
- MSB LSB
- </doc>
-
- <doc type="bnf">
- uint32 = byte-four byte-three byte-two byte-one
- byte-four = OCTET ; most significant byte (MSB)
- byte-three = OCTET
- byte-two = OCTET
- byte-one = OCTET ; least significant byte (LSB)
- </doc>
- </type>
-
- <type name="float" code="0x23" fixed-width="4"
- label="single precision IEEE 754 32-bit floating point">
- <doc>
- The float type encodes a single precision 32-bit floating point number. The format and
- operations are defined by the IEEE 754 standard for 32-bit floating point numbers.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs
- +-----------------------+
- | float |
- +-----------------------+
- IEEE 754 32-bit float
- </doc>
-
- <doc type="bnf">
- float = 4 OCTET ; IEEE 754 32-bit floating point number
- </doc>
- </type>
-
- <type name="char-utf32" code="0x27" fixed-width="4"
- label="single unicode character in UTF-32 encoding">
- <doc>
- The char-utf32 type consists of a single unicode character in the UTF-32 encoding.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs
- +------------------+
- | char-utf32 |
- +------------------+
- UTF-32 character
- </doc>
-
- <doc type="bnf">
- char-utf32 = 4 OCTET ; single UTF-32 character
- </doc>
- </type>
-
- <type name="sequence-no" fixed-width="4" label="serial number defined in RFC-1982">
- <doc>
- The sequence-no type encodes, in network byte order, a serial number as defined in RFC-1982.
- The arithmetic, operators, and ranges for numbers of this type are defined by RFC-1982.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs
- +------------------------+
- | sequence-no |
- +------------------------+
- RFC-1982 serial number
- </doc>
-
- <doc type="bnf">
- sequence-no = 4 OCTET ; RFC-1982 serial number
- </doc>
- </type>
-
- <!--
- 0x30 - 0x3f: Fixed width types - 8 octets
- -->
-
- <type name="bin64" code="0x30" fixed-width="8"
- label="eight octets of unspecified binary encoding">
- <doc>
- The bin64 type consists of eight consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+-------------+-------------+
- | octet-one | octet-two | ... | octet-seven | octet-eight |
- +-----------+-----------+-----+-------------+-------------+
- </doc>
-
- <doc type="bnf">
- bin64 = 8 OCTET
- </doc>
- </type>
-
- <type name="int64" code="0x31" fixed-width="8" label="64-bit signed integral value">
- <doc>
- The int64 type is a signed integral value encoded using a 64-bit two's complement
- representation in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +------------+------------+-----+----------+----------+
- | byte-eight | byte-seven | ... | byte-two | byte-one |
- +------------+------------+-----+----------+----------+
- MSB LSB
- </doc>
-
- <doc type="bnf">
- int64 = byte-eight byte-seven byte-six byte-five
- byte-four byte-three byte-two byte-one
- byte-eight = 1 OCTET ; most significant byte (MSB)
- byte-seven = 1 OCTET
- byte-six = 1 OCTET
- byte-five = 1 OCTET
- byte-four = 1 OCTET
- byte-three = 1 OCTET
- byte-two = 1 OCTET
- byte-one = 1 OCTET ; least significant byte (LSB)
- </doc>
- </type>
-
- <type name="uint64" code="0x32" fixed-width="8" label="64-bit unsigned integral value">
- <doc>
- The uint64 type is a 64-bit unsigned integral value encoded in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +------------+------------+-----+----------+----------+
- | byte-eight | byte-seven | ... | byte-two | byte-one |
- +------------+------------+-----+----------+----------+
- MSB LSB
- </doc>
-
- <doc type="bnf">
- uint64 = byte-eight byte-seven byte-six byte-five
- byte-four byte-three byte-two byte-one
- byte-eight = 1 OCTET ; most significant byte (MSB)
- byte-seven = 1 OCTET
- byte-six = 1 OCTET
- byte-five = 1 OCTET
- byte-four = 1 OCTET
- byte-three = 1 OCTET
- byte-two = 1 OCTET
- byte-one = 1 OCTET ; least significant byte (LSB)
- </doc>
- </type>
-
- <type name="double" code="0x33" fixed-width="8" label="double precision IEEE 754 floating point">
- <doc>
- The double type encodes a double precision 64-bit floating point number. The format and
- operations are defined by the IEEE 754 standard for 64-bit double precision floating point
- numbers.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 8 OCTETs
- +-----------------------+
- | double |
- +-----------------------+
- IEEE 754 64-bit float
- </doc>
-
- <doc type="bnf">
- double = 8 OCTET ; double precision IEEE 754 floating point number
- </doc>
- </type>
-
- <type name="datetime" code="0x38" fixed-width="8" label="datetime in 64 bit POSIX time_t format">
- <doc>
- The datetime type encodes a date and time using the 64 bit POSIX time_t format.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 8 OCTETs
- +---------------------+
- | datetime |
- +---------------------+
- posix time_t format
- </doc>
-
- <doc type="bnf">
- datetime = 8 OCTET ; 64 bit posix time_t format
- </doc>
- </type>
-
- <!--
- 0x40 - 0x4f: Fixed width types - 16 octets
- -->
-
- <type name="bin128" code="0x40" fixed-width="16"
- label="sixteen octets of unspecified binary encoding">
- <doc>
- The bin128 type consists of 16 consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+---------------+---------------+
- | octet-one | octet-two | ... | octet-fifteen | octet-sixteen |
- +-----------+-----------+-----+---------------+---------------+
- </doc>
-
- <doc type="bnf">
- bin128 = 16 OCTET
- </doc>
- </type>
-
- <type name="uuid" code="0x48" fixed-width="16" label="UUID (RFC-4122 section 4.1.2) - 16 octets">
- <doc>
- The uuid type encodes a universally unique id as defined by RFC-4122. The format and
- operations for this type can be found in section 4.1.2 of RFC-4122.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 16 OCTETs
- +---------------+
- | uuid |
- +---------------+
- RFC-4122 UUID
- </doc>
-
- <doc type="bnf">
- uuid = 16 OCTET ; RFC-4122 section 4.1.2
- </doc>
- </type>
-
- <!--
- 0x50 - 0x5f: Fixed width types - 32 octets
- -->
-
- <type name="bin256" code="0x50" fixed-width="32"
- label="thirty two octets of unspecified binary encoding">
- <doc>
- The bin256 type consists of thirty two consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+------------------+------------------+
- | octet-one | octet-two | ... | octet-thirty-one | octet-thirty-two |
- +-----------+-----------+-----+------------------+------------------+
- </doc>
-
- <doc type="bnf">
- bin256 = 32 OCTET
- </doc>
- </type>
-
- <!--
- 0x60 - 0x6f: Fixed width types - 64 octets
- -->
-
- <type name="bin512" code="0x60" fixed-width="64"
- label="sixty four octets of unspecified binary encoding">
- <doc>
- The bin512 type consists of sixty four consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+-------------------+------------------+
- | octet-one | octet-two | ... | octet-sixty-three | octet-sixty-four |
- +-----------+-----------+-----+-------------------+------------------+
- </doc>
-
- <doc type="bnf">
- bin512 = 64 OCTET
- </doc>
- </type>
-
- <!--
- 0x70 - 0x7f: Fixed width types - 128 octets
- -->
-
- <type name="bin1024" code="0x70" fixed-width="128"
- label="one hundred and twenty eight octets of unspecified binary encoding">
- <doc>
- The bin1024 type consists of one hundred and twenty eight octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+------------------------+------------------------+
- | octet-one | octet-two | ... | octet-one-twenty-seven | octet-one-twenty-eight |
- +-----------+-----------+-----+------------------------+------------------------+
- </doc>
-
- <doc type="bnf">
- bin1024 = 128 OCTET
- </doc>
- </type>
-
- <!--
- 0x80 - 0x8f: Variable length - one byte length field (up to 255 octets)
- -->
-
- <type name="vbin8" code="0x80" variable-width="1" label="up to 255 octets of opaque binary data">
- <doc>
- The vbin8 type encodes up to 255 octets of opaque binary data. The number of octets is first
- encoded as an 8-bit unsigned integral value. This is followed by the actual data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET size OCTETs
- +---------+-------------+
- | size | octets |
- +---------+-------------+
- uint8
- </doc>
-
- <doc type="bnf">
- vbin8 = size octets
- size = uint8
- octets = 0*255 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str8-latin" code="0x84" variable-width="1" label="up to 255 iso-8859-15 characters">
- <doc>
- The str8-latin type encodes up to 255 octets of iso-8859-15 characters. The number of octets
- is first encoded as an 8-bit unsigned integral value. This is followed by the actual
- characters.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET size OCTETs
- +---------+------------------------+
- | size | characters |
- +---------+------------------------+
- uint16 iso-8859-15 characters
- </doc>
-
- <doc type="bnf">
- str8-latin = size characters
- size = uint8
- characters = 0*255 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str8" code="0x85" variable-width="1" label="up to 255 octets worth of UTF-8 unicode">
- <doc>
- The str8 type encodes up to 255 octets worth of UTF-8 unicode. The number of octets of unicode
- is first encoded as an 8-bit unsigned integral value. This is followed by the actual UTF-8
- unicode. Note that the encoded size refers to the number of octets of unicode, not necessarily
- the number of characters since the UTF-8 unicode may include multi-byte character sequences.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET size OCTETs
- +---------+--------------+
- | size | utf8-unicode |
- +---------+--------------+
- uint8
- </doc>
-
- <doc type="bnf">
- str8 = size utf8-unicode
- size = uint8
- utf8-unicode = 0*255 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str8-utf16" code="0x86" variable-width="1"
- label="up to 255 octets worth of UTF-16 unicode">
- <doc>
- The str8-utf16 type encodes up to 255 octets worth of UTF-16 unicode. The number of octets of
- unicode is first encoded as an 8-bit unsigned integral value. This is followed by the actual
- UTF-16 unicode. Note that the encoded size refers to the number of octets of unicode, not the
- number of characters since the UTF-16 unicode will include at least two octets per unicode
- character.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET size OCTETs
- +---------+---------------+
- | size | utf16-unicode |
- +---------+---------------+
- uint8
- </doc>
-
- <doc type="bnf">
- str8-utf16 = size utf16-unicode
- size = uint8
- utf16-unicode = 0*255 OCTET ; size OCTETs
- </doc>
- </type>
-
- <!--
- 0x90 - 0x9f: Variable length types - two byte length field (up to 65535 octets)
- -->
-
- <type name="vbin16" code="0x90" variable-width="2"
- label="up to 65535 octets of opaque binary data">
- <doc>
- The vbin16 type encodes up to 65535 octets of opaque binary data. The number of octets is
- first encoded as a 16-bit unsigned integral value in network byte order. This is followed by
- the actual data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 2 OCTETs size OCTETs
- +----------+-------------+
- | size | octets |
- +----------+-------------+
- uint16
- </doc>
-
- <doc type="bnf">
- vbin16 = size octets
- size = uint16
- octets = 0*65535 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str16-latin" code="0x94" variable-width="2"
- label="up to 65535 iso-8859-15 characters">
- <doc>
- The str16-latin type encodes up to 65535 octets of is-8859-15 characters. The number of octets
- is first encoded as a 16-bit unsigned integral value in network byte order. This is followed
- by the actual characters.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 2 OCTETs size OCTETs
- +----------+------------------------+
- | size | characters |
- +----------+------------------------+
- uint16 iso-8859-15 characters
- </doc>
-
- <doc type="bnf">
- str16-latin = size characters
- size = uint16
- characters = 0*65535 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str16" code="0x95" variable-width="2"
- label="up to 65535 octets worth of UTF-8 unicode">
- <doc>
- The str16 type encodes up to 65535 octets worth of UTF-8 unicode. The number of octets is
- first encoded as a 16-bit unsigned integral value in network byte order. This is followed by
- the actual UTF-8 unicode. Note that the encoded size refers to the number of octets of
- unicode, not necessarily the number of unicode characters since the UTF-8 unicode may include
- multi-byte character sequences.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 2 OCTETs size OCTETs
- +----------+--------------+
- | size | utf8-unicode |
- +----------+--------------+
- uint16
- </doc>
-
- <doc type="bnf">
- str16 = size utf8-unicode
- size = uint16
- utf8-unicode = 0*65535 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str16-utf16" code="0x96" variable-width="2"
- label="up to 65535 octets worth of UTF-16 unicode">
- <doc>
- The str16-utf16 type encodes up to 65535 octets worth of UTF-16 unicode. The number of octets
- is first encoded as a 16-bit unsigned integral value in network byte order. This is followed
- by the actual UTF-16 unicode. Note that the encoded size refers to the number of octets of
- unicode, not the number of unicode characters since the UTF-16 unicode will include at least
- two octets per unicode character.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 2 OCTETs size OCTETs
- +----------+---------------+
- | size | utf16-unicode |
- +----------+---------------+
- uint16
- </doc>
-
- <doc type="bnf">
- str16-utf16 = size utf16-unicode
- size = uint16
- utf16-unicode = 0*65535 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="byte-ranges" variable-width="2" label="byte ranges within a 64-bit payload">
- <doc>
- The byte-ranges type encodes up to 65535 octets worth of non-overlapping, non-touching,
- ascending byte ranges within a 64-bit sequence of bytes. Each range is represented as an
- inclusive lower and upper bound that identifies all the byte offsets included within a given
- range.
- </doc>
-
- <doc>
- The number of octets of data is first encoded as a 16-bit unsigned integral value in network
- byte order. This is then followed by the encoded representation of the ranges included in the
- set. These MUST be encoded in ascending order, and any two ranges included in a given set MUST
- NOT include overlapping or touching byte offsets.
- </doc>
-
- <doc>
- Each range is encoded as a pair of 64-bit unsigned integral values in network byte order
- respectively representing the lower and upper bounds for that range. Note that because each
- range is exactly 16 octets, the size in octets of the encoded ranges will always be 16 times
- the number of ranges in the set.
- </doc>
-
- <doc type="picture" title="Wire Format">
- +----= size OCTETs =----+
- | |
- 2 OCTETs | 16 OCTETs |
- +----------+-----+-----------+-----+
- | size | .../| range |\... |
- +----------+---/ +-----------+ \---+
- uint16 / / \ \
- / / \ \
- / 8 OCTETs 8 OCTETs \
- +-----------+-----------+
- | lower | upper |
- +-----------+-----------+
- uint64 uint64
- </doc>
-
- <doc type="bnf">
- byte-ranges = size *range
- size = uint16
- range = lower upper
- lower = uint64
- upper = uint64
- </doc>
- </type>
-
- <type name="sequence-set" variable-width="2" label="ranged set representation">
- <doc>
- The sequence-set type is a set of pairs of RFC-1982 numbers representing a discontinuous range
- within an RFC-1982 sequence. Each pair represents a closed interval within the list.
- </doc>
-
- <doc>
- Sequence-sets can be represented as lists of pairs of positive 32-bit numbers, each pair
- representing a closed interval that does not overlap or touch with any other interval in the
- list. For example, a set containing words 0, 1, 2, 5, 6, and 15 can be represented:
- </doc>
-
- <doc type="picture">
- [(0, 2), (5, 6), (15, 15)]
- </doc>
-
- <doc>
- 1) The list-of-pairs representation is sorted ascending (as defined by RFC 1982
- (http://www.ietf.org/rfc/rfc1982.txt) ) by the first elements of each pair.
- </doc>
-
- <doc>
- 2) The list-of-pairs is flattened into a list-of-words.
- </doc>
-
- <doc>
- 3) Each word in the list is packed into ascending locations in memory with network byte
- ordering.
- </doc>
-
- <doc>
- 4) The size in bytes, represented as a 16-bit network-byte-order unsigned value, is prepended.
- </doc>
-
- <doc>
- For instance, the example from above would be encoded:
- </doc>
-
- <doc type="picture">
- [(0, 2), (5, 6), (15, 15)] -- already sorted.
- [0, 2, 5, 6, 15, 15] -- flattened.
- 000000000000000200000005000000060000000F0000000F -- bytes in hex
- 0018000000000000000200000005000000060000000F0000000F -- bytes in hex,
- length (24) prepended
- </doc>
-
- <doc type="picture" title="Wire Format">
- +----= size OCTETs =----+
- | |
- 2 OCTETs | 8 OCTETs |
- +----------+-----+-----------+-----+
- | size | .../| range |\... |
- +----------+---/ +-----------+ \---+
- uint16 / / \ \
- / / \ \
- / / \ \
- / / \ \
- / 4 OCTETs 4 OCTETs \
- +-------------+-------------+
- | lower | upper |
- +-------------+-------------+
- sequence-no sequence-no
- </doc>
-
- <doc type="bnf">
- sequence-set = size *range
- size = uint16 ; length of variable portion in bytes
-
- range = lower upper ; inclusive
- lower = sequence-no
- upper = sequence-no
- </doc>
- </type>
-
- <!--
- 0xa0 - 0xaf: Variable length types - four byte length field (up to 4294967295 octets)
- -->
-
- <type name="vbin32" code="0xa0" variable-width="4"
- label="up to 4294967295 octets of opaque binary data">
- <doc>
- The vbin32 type encodes up to 4294967295 octets of opaque binary data. The number of octets is
- first encoded as a 32-bit unsigned integral value in network byte order. This is followed by
- the actual data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs size OCTETs
- +----------+-------------+
- | size | octets |
- +----------+-------------+
- uint32
- </doc>
-
- <doc type="bnf">
- vbin32 = size octets
- size = uint32
- octets = 0*4294967295 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="map" code="0xa8" variable-width="4" label="a mapping of keys to typed values">
- <doc>
- A map is a set of distinct keys where each key has an associated (type,value) pair. The triple
- of the key, type, and value, form an entry within a map. Each entry within a given map MUST
- have a distinct key. A map is encoded as a size in octets, a count of the number of entries,
- followed by the encoded entries themselves.
- </doc>
-
- <doc>
- An encoded map may contain up to (4294967295 - 4) octets worth of encoded entries. The size is
- encoded as a 32-bit unsigned integral value in network byte order equal to the number of
- octets worth of encoded entries plus 4. (The extra 4 octets is added for the entry count.) The
- size is then followed by the number of entries encoded as a 32-bit unsigned integral value in
- network byte order. Finally the entries are encoded sequentially.
- </doc>
-
- <doc>
- An entry is encoded as the key, followed by the type, and then the value. The key is always a
- string encoded as a str8. The type is a single octet that may contain any valid AMQP type
- code. The value is encoded according to the rules defined by the type code for that entry.
- </doc>
-
- <doc type="picture" title="Wire Format">
- +------------= size OCTETs =-----------+
- | |
- 4 OCTETs | 4 OCTETs |
- +----------+----------+-----+---------------+-----+
- | size | count | .../| entry |\... |
- +----------+----------+---/ +---------------+ \---+
- uint32 uint32 / / \ \
- / / \ \
- / / \ \
- / / \ \
- / / \ \
- / k OCTETs 1 OCTET n OCTETs \
- +-----------+---------+-----------+
- | key | type | value |
- +-----------+---------+-----------+
- str8 *type*
- </doc>
-
- <doc type="bnf">
- map = size count *entry
-
- size = uint32 ; size of count and entries in octets
- count = uint32 ; number of entries in the map
-
- entry = key type value
- key = str8
- type = OCTET ; type code of the value
- value = *OCTET ; the encoded value
- </doc>
- </type>
-
- <type name="list" code="0xa9" variable-width="4" label="a series of consecutive type-value pairs">
- <doc>
- A list is an ordered sequence of (type, value) pairs. The (type, value) pair forms an item
- within the list. The list may contain items of many distinct types. A list is encoded as a
- size in octets, followed by a count of the number of items, followed by the items themselves
- encoded in their defined order.
- </doc>
-
- <doc>
- An encoded list may contain up to (4294967295 - 4) octets worth of encoded items. The size is
- encoded as a 32-bit unsigned integral value in network byte order equal to the number of
- octets worth of encoded items plus 4. (The extra 4 octets is added for the item count.) The
- size is then followed by the number of items encoded as a 32-bit unsigned integral value in
- network byte order. Finally the items are encoded sequentially in their defined order.
- </doc>
-
- <doc>
- An item is encoded as the type followed by the value. The type is a single octet that may
- contain any valid AMQP type code. The value is encoded according to the rules defined by the
- type code for that item.
- </doc>
-
- <doc type="picture" title="Wire Format">
- +---------= size OCTETs =---------+
- | |
- 4 OCTETs | 4 OCTETs |
- +----------+----------+-----+----------+-----+
- | size | count | .../| item |\... |
- +----------+----------+---/ +----------+ \---+
- uint32 uint32 / / \ \
- / / \ \
- / 1 OCTET n OCTETs \
- +----------+-----------+
- | type | value |
- +----------+-----------+
- *type*
- </doc>
-
- <doc type="bnf">
- list = size count *item
-
- size = uint32 ; size of count and items in octets
- count = uint32 ; number of items in the list
-
- item = type value
- type = OCTET ; type code of the value
- value = *OCTET ; the encoded value
- </doc>
- </type>
-
- <type name="array" code="0xaa" variable-width="4"
- label="a defined length collection of values of a single type">
- <doc>
- An array is an ordered sequence of values of the same type. The array is encoded in as a size
- in octets, followed by a type code, then a count of the number values in the array, and
- finally the values encoded in their defined order.
- </doc>
-
- <doc>
- An encoded array may contain up to (4294967295 - 5) octets worth of encoded values. The size
- is encoded as a 32-bit unsigned integral value in network byte order equal to the number of
- octets worth of encoded values plus 5. (The extra 5 octets consist of 4 octets for the count
- of the number of values, and one octet to hold the type code for the items in the array.) The
- size is then followed by a single octet that may contain any valid AMQP type code. The type
- code is then followed by the number of values encoded as a 32-bit unsigned integral value in
- network byte order. Finally the values are encoded sequentially in their defined order
- according to the rules defined by the type code for the array.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs 1 OCTET 4 OCTETs (size - 5) OCTETs
- +----------+---------+----------+-------------------------+
- | size | type | count | values |
- +----------+---------+----------+-------------------------+
- uint32 uint32 *count* encoded *types*
- </doc>
-
- <doc type="bnf">
- array = size type count values
-
- size = uint32 ; size of type, count, and values in octets
- type = OCTET ; the type of the encoded values
- count = uint32 ; number of items in the array
-
- values = 0*4294967290 OCTET ; (size - 5) OCTETs
- </doc>
- </type>
-
- <type name="struct32" code="0xab" variable-width="4" label="a coded struct with a 32-bit size">
- <doc>
- The struct32 type describes any coded struct with a 32-bit (4 octet) size. The type is
- restricted to be only coded structs with a 32-bit size, consequently the first six octets of
- any encoded value for this type MUST always contain the size, class-code, and struct-code in
- that order.
- </doc>
-
- <doc>
- The size is encoded as a 32-bit unsigned integral value in network byte order that is equal to
- the size of the encoded field-data, packing-flags, class-code, and struct-code. The class-code
- is a single octet that may be set to any valid class code. The struct-code is a single octet
- that may be set to any valid struct code within the given class-code.
- </doc>
-
- <doc>
- The first six octets are then followed by the packing flags and encoded field data. The
- presence and quantity of packing-flags, as well as the specific fields are determined by the
- struct definition identified with the encoded class-code and struct-code.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs 1 OCTET 1 OCTET pack-width OCTETs n OCTETs
- +----------+------------+-------------+-------------------+------------+
- | size | class-code | struct-code | packing-flags | field-data |
- +----------+------------+-------------+-------------------+------------+
- uint32
-
- n = (size - 2 - pack-width)
- </doc>
-
- <doc type="bnf">
- struct32 = size class-code struct-code packing-flags field-data
-
- size = uint32
-
- class-code = OCTET ; zero for top-level structs
- struct-code = OCTET ; together with class-code identifies the struct
- ; definition which determines the pack-width and
- ; fields
-
- packing-flags = 0*4 OCTET ; pack-width OCTETs
-
- field-data = *OCTET ; (size - 2 - pack-width) OCTETs
- </doc>
- </type>
-
- <!--
- 0xb0 - 0xbf: Reserved
- -->
-
- <!--
- 0xc0 - 0xcf:Fixed width types - 5 octets
- -->
-
- <type name="bin40" code="0xc0" fixed-width="5" label="five octets of unspecified binary encoding">
- <doc>
- The bin40 type consists of five consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-------------+------------+------------+
- | octet-one | octet-two | octet-three | octet-four | octet-five |
- +-----------+-----------+-------------+------------+------------+
- </doc>
-
- <doc type="bnf">
- bin40 = 5 OCTET
- </doc>
- </type>
-
- <type name="dec32" code="0xc8" fixed-width="5"
- label="32-bit decimal value (e.g. for use in financial values)">
- <doc>
- The dec32 type is decimal value with a variable number of digits following the decimal point.
- It is encoded as an 8-bit unsigned integral value representing the number of decimal places.
- This is followed by the signed integral value encoded using a 32-bit two's complement
- representation in network byte order.
- </doc>
-
- <doc>
- The former value is referred to as the exponent of the divisor. The latter value is the
- mantissa. The decimal value is given by: mantissa / 10^exponent.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 4 OCTETs
- +----------+----------+
- | exponent | mantissa |
- +----------+----------+
- uint8 int32
- </doc>
-
- <doc type="bnf">
- dec32 = exponent mantissa
- exponent = uint8
- mantissa = int32
- </doc>
- </type>
-
- <!--
- 0xd0 - 0xdf: Fixed width types - 9 octets
- -->
-
- <type name="bin72" code="0xd0" fixed-width="9"
- label="nine octets of unspecified binary encoding">
- <doc>
- The bin72 type consists of nine consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+-------------+------------+
- | octet-one | octet-two | ... | octet-eight | octet-nine |
- +-----------+-----------+-----+-------------+------------+
- </doc>
-
- <doc type="bnf">
- bin64 = 9 OCTET
- </doc>
- </type>
-
- <type name="dec64" code="0xd8" fixed-width="9"
- label="64-bit decimal value (e.g. for use in financial values)">
- <doc>
- The dec64 type is decimal value with a variable number of digits following the decimal point.
- It is encoded as an 8-bit unsigned integral value representing the number of decimal places.
- This is followed by the signed integral value encoded using a 64-bit two's complement
- representation in network byte order.
- </doc>
-
- <doc>
- The former value is referred to as the exponent of the divisor. The latter value is the
- mantissa. The decimal value is given by: mantissa / 10^exponent.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 8 OCTETs
- +----------+----------+
- | exponent | mantissa |
- +----------+----------+
- uint8 int64
- </doc>
-
- <doc type="bnf">
- dec64 = exponent mantissa
- exponent = uint8
- mantissa = int64
- </doc>
- </type>
-
- <!--
- 0xe0 - 0xef: Reserved
- -->
-
- <!--
- 0xf0 - 0xff: Zero-length types
- -->
-
- <type name="void" code="0xf0" fixed-width="0" label="the void type">
- <doc>
- The void type is used within tagged data structures such as maps and lists to indicate an
- empty value. The void type has no value and is encoded as an empty sequence of octets.
- </doc>
- </type>
-
- <type name="bit" code="0xf1" fixed-width="0" label="presence indicator">
- <doc>
- The bit type is used to indicate that a packing flag within a packed struct is being used to
- represent a boolean value based on the presence of an empty value. The bit type has no value
- and is encoded as an empty sequence of octets.
- </doc>
- </type>
-
- <!--
- ======================================================
- == CONSTANTS
- ======================================================
- -->
-
- <!-- Protocol constants -->
-
- <constant name="MIN-MAX-FRAME-SIZE" value="4096" label="The minimum size (in bytes) which can be
- agreed upon as the maximum frame size.">
- <doc>
- During the initial connection negotiation, the two peers must agree upon a maximum frame size.
- This constant defines the minimum value to which the maximum frame size can be set. By
- defining this value, the peers can guarantee that they can send frames of up to this size
- until they have agreed a definitive maximum frame size for that connection.
- </doc>
- </constant>
-
- <!--
- ======================================================
- == DOMAIN TYPES
- ======================================================
- -->
-
- <!-- Segment types -->
-
- <domain name="segment-type" type="uint8" label="valid values for the frame type indicator.">
- <doc>
- Segments are defined in <xref ref="specification.transport.assemblies_segments_and_frames"/>.
- The segment domain defines the valid values that may be used for the segment indicator within
- the frame header.
- </doc>
-
- <enum>
- <choice name="control" value="0">
- <doc>
- The frame type indicator for Control segments (see <xref
- ref="specification.formal_notation.controls"/>).
- </doc>
- </choice>
- <choice name="command" value="1">
- <doc>
- The frame type indicator for Command segments (see <xref
- ref="specification.formal_notation.commands"/>).
- </doc>
- </choice>
- <choice name="header" value="2" >
- <doc>
- The frame type indicator for Header segments (see <xref
- ref="specification.formal_notation.segments.header"/>).
- </doc>
- </choice>
- <choice name="body" value="3" >
- <doc>
- The frame type indicator for Body segments (see <xref
- ref="specification.formal_notation.segments.body"/>).
- </doc>
- </choice>
- </enum>
- </domain>
-
- <!-- Tracks -->
-
- <domain name="track" type="uint8" label="Valid values for transport level tracks">
- <doc> Tracks are defined in <xref ref="specification.transport.channels_and_tracks"/>. The
- track domain defines the valid values that may used for the track indicator within the frame
- header</doc>
- <enum>
- <choice name="control" value="0">
- <doc>
- The track used for all controls. All controls defined in this specification MUST be sent
- on track 0.
- </doc>
- </choice>
- <choice name="command" value="1">
- <doc>
- The track used for all commands. All commands defined in this specification MUST be sent
- on track 1.
- </doc>
- </choice>
- </enum>
- </domain>
-
-
- <domain name="str16-array" type="array" label="An array of values of type str16.">
- <doc>
- An array of values of type str16.
- </doc>
- </domain>
-
-
-
- <!-- == Class: connection ==================================================================== -->
-
- <class name="connection" code="0x1" label="work with connections">
- <doc>
- The connection class provides controls for a client to establish a network connection to a
- server, and for both peers to operate the connection thereafter.
- </doc>
-
- <doc type="grammar">
- connection = open-connection
- *use-connection
- close-connection
- open-connection = C:protocol-header
- S:START C:START-OK
- *challenge
- S:TUNE C:TUNE-OK
- C:OPEN S:OPEN-OK | S:REDIRECT
- challenge = S:SECURE C:SECURE-OK
- use-connection = *channel
- close-connection = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
- </doc>
-
- <role name="server" implement="MUST" />
- <role name="client" implement="MUST" />
-
- <domain name="close-code" type="uint16" label="code used in the connection.close control to
- indicate reason for closure">
- <enum>
- <choice name="normal" value="200">
- <doc>
- The connection closed normally.
- </doc>
- </choice>
-
- <choice name="connection-forced" value="320">
- <doc>
- An operator intervened to close the connection for some reason. The client may retry at
- some later date.
- </doc>
- </choice>
-
- <choice name="invalid-path" value="402">
- <doc>
- The client tried to work with an unknown virtual host.
- </doc>
- </choice>
-
- <choice name="framing-error" value="501">
- <doc>
- A valid frame header cannot be formed from the incoming byte stream.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="amqp-host-url" type="str16" label="URL for identifying an AMQP Server">
- <doc>
- The amqp-url domain defines a format for identifying an AMQP Server. It is used to provide
- alternate hosts in the case where a client has to reconnect because of failure, or because
- the server requests the client to do so upon initial connection.
- </doc>
- <doc type="bnf"><![CDATA[
- amqp_url = "amqp:" prot_addr_list
- prot_addr_list = [prot_addr ","]* prot_addr
- prot_addr = tcp_prot_addr | tls_prot_addr
-
- tcp_prot_addr = tcp_id tcp_addr
- tcp_id = "tcp:" | ""
- tcp_addr = [host [":" port] ]
- host = <as per http://www.ietf.org/rfc/rfc3986.txt>
- port = number]]>
- </doc>
- </domain>
-
- <domain name="amqp-host-array" type="array" label="An array of values of type amqp-host-url">
- <doc>
- Used to provide a list of alternate hosts.
- </doc>
- </domain>
-
- <!-- - Control: connection.start - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="start" code="0x1" label="start connection negotiation">
- <doc>
- This control starts the connection negotiation process by telling the client the supported
- security mechanisms and locales from which the client can choose.
- </doc>
-
- <rule name="protocol-name">
- <doc>
- If the server cannot support the protocol specified in the protocol header, it MUST close
- the socket connection without sending any response control.
- </doc>
- <doc type="scenario">
- The client sends a protocol header containing an invalid protocol name. The server must
- respond by closing the connection.
- </doc>
- </rule>
-
- <rule name="client-support">
- <doc>
- If the client cannot handle the protocol version suggested by the server it MUST close the
- socket connection.
- </doc>
- <doc type="scenario">
- The server sends a protocol version that is lower than any valid implementation, e.g. 0.1.
- The client must respond by closing the connection.
- </doc>
- </rule>
-
- <implement role="client" handle="MUST" />
-
- <response name="start-ok" />
-
- <field name="server-properties" type="map" label="server properties">
- <rule name="required-fields">
- <doc>
- The properties SHOULD contain at least these fields: "host", specifying the server host
- name or address, "product", giving the name of the server product, "version", giving the
- name of the server version, "platform", giving the name of the operating system,
- "copyright", if appropriate, and "information", giving other general information.
- </doc>
- <doc type="scenario">
- Client connects to server and inspects the server properties. It checks for the presence
- of the required fields.
- </doc>
- </rule>
- </field>
-
- <field name="mechanisms" type="str16-array" label="available security mechanisms"
- required="true">
- <doc>
- A list of the security mechanisms that the server supports.
- </doc>
- </field>
-
- <field name="locales" type="str16-array" label="available message locales" required="true">
- <doc>
- A list of the message locales that the server supports. The locale defines the language in
- which the server will send reply texts.
- </doc>
-
- <rule name="required-support">
- <doc>
- The server MUST support at least the en_US locale.
- </doc>
- <doc type="scenario">
- Client connects to server and inspects the locales field. It checks for the presence of
- the required locale(s).
- </doc>
- </rule>
- </field>
- </control>
-
- <!-- - Control: connection.start-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="start-ok" code="0x2" label="select security mechanism and locale">
- <doc>
- This control selects a SASL security mechanism.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="client-properties" type="map" label="client properties">
- <rule name="required-fields">
- <!-- This rule is not testable from the client side -->
- <doc>
- The properties SHOULD contain at least these fields: "product", giving the name of the
- client product, "version", giving the name of the client version, "platform", giving the
- name of the operating system, "copyright", if appropriate, and "information", giving
- other general information.
- </doc>
- </rule>
- </field>
-
- <field name="mechanism" type="str8" label="selected security mechanism" required="true">
- <doc>
- A single security mechanisms selected by the client, which must be one of those specified
- by the server.
- </doc>
-
- <rule name="security">
- <doc>
- The client SHOULD authenticate using the highest-level security profile it can handle
- from the list provided by the server.
- </doc>
- </rule>
-
- <rule name="validity">
- <doc>
- If the mechanism field does not contain one of the security mechanisms proposed by the
- server in the Start control, the server MUST close the connection without sending any
- further data.
- </doc>
- <doc type="scenario">
- Client connects to server and sends an invalid security mechanism. The server must
- respond by closing the connection (a socket close, with no connection close
- negotiation).
- </doc>
- </rule>
- </field>
-
- <field name="response" type="vbin32" label="security response data" required="true">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this data are
- defined by the SASL security mechanism.
- </doc>
- </field>
-
- <field name="locale" type="str8" label="selected message locale" required="true">
- <doc>
- A single message locale selected by the client, which must be one of those specified by
- the server.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.secure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="secure" code="0x3" label="security mechanism challenge">
- <doc>
- The SASL protocol works by exchanging challenges and responses until both peers have
- received sufficient information to authenticate each other. This control challenges the
- client to provide more information.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <response name="secure-ok" />
-
- <field name="challenge" type="vbin32" label="security challenge data" required="true">
- <doc>
- Challenge information, a block of opaque binary data passed to the security mechanism.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.secure-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="secure-ok" code="0x4" label="security mechanism response">
- <doc>
- This control attempts to authenticate, passing a block of SASL data for the security
- mechanism at the server side.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="response" type="vbin32" label="security response data" required="true">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this data are
- defined by the SASL security mechanism.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.tune - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="tune" code="0x5" label="propose connection tuning parameters">
- <doc>
- This control proposes a set of connection configuration values to the client. The client can
- accept and/or adjust these.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <response name="tune-ok" />
-
- <field name="channel-max" type="uint16" label="proposed maximum channels">
- <doc>
- The maximum total number of channels that the server allows per connection. If this is not
- set it means that the server does not impose a fixed limit, but the number of allowed
- channels may be limited by available server resources.
- </doc>
- </field>
-
- <field name="max-frame-size" type="uint16" label="proposed maximum frame size">
- <doc>
- The largest frame size that the server proposes for the connection. The client can
- negotiate a lower value. If this is not set means that the server does not impose any
- specific limit but may reject very large frames if it cannot allocate resources for them.
- </doc>
-
- <rule name="minimum">
- <doc>
- Until the max-frame-size has been negotiated, both peers MUST accept frames of up to
- MIN-MAX-FRAME-SIZE octets large, and the minimum negotiated value for max-frame-size is
- also MIN-MAX-FRAME-SIZE.
- </doc>
- <doc type="scenario">
- Client connects to server and sends a large properties field, creating a frame of
- MIN-MAX-FRAME-SIZE octets. The server must accept this frame.
- </doc>
- </rule>
- </field>
-
- <field name="heartbeat-min" type="uint16" label="the minimum supported heartbeat delay">
- <doc>
- The minimum delay, in seconds, of the connection heartbeat supported by the server. If
- this is not set it means the server does not support sending heartbeats.
- </doc>
- </field>
-
- <field name="heartbeat-max" type="uint16" label="the maximum supported heartbeat delay">
- <doc>
- The maximum delay, in seconds, of the connection heartbeat supported by the server. If
- this is not set it means the server has no maximum.
- </doc>
-
- <rule name="permitted-range">
- <doc>
- The heartbeat-max value must be greater than or equal to the value supplied in the
- heartbeat-min field.
- </doc>
- </rule>
-
- <rule name="no-heartbeat-min">
- <doc>
- If no heartbeat-min is supplied, then the heartbeat-max field MUST remain empty.
- </doc>
- </rule>
- </field>
- </control>
-
- <!-- - Control: connection.tune-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="tune-ok" code="0x6" label="negotiate connection tuning parameters">
- <doc>
- This control sends the client's connection tuning parameters to the server. Certain fields
- are negotiated, others provide capability information.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="channel-max" type="uint16" label="negotiated maximum channels" required="true">
- <doc>
- The maximum total number of channels that the client will use per connection.
- </doc>
-
- <rule name="upper-limit">
- <doc>
- If the client specifies a channel max that is higher than the value provided by the
- server, the server MUST close the connection without attempting a negotiated close. The
- server may report the error in some fashion to assist implementers.
- </doc>
-
- </rule>
-
- <rule name="available-channels">
- <doc>
- If the client agrees to a channel-max of N channels, then the channels available for
- communication between client and server are precisely the channels numbered 0 to (N-1).
- </doc>
- </rule>
- </field>
-
- <field name="max-frame-size" type="uint16" label="negotiated maximum frame size">
- <doc>
- The largest frame size that the client and server will use for the connection. If it is
- not set means that the client does not impose any specific limit but may reject very large
- frames if it cannot allocate resources for them. Note that the max-frame-size limit
- applies principally to content frames, where large contents can be broken into frames of
- arbitrary size.
- </doc>
-
- <rule name="minimum">
- <doc>
- Until the max-frame-size has been negotiated, both peers MUST accept frames of up to
- MIN-MAX-FRAME-SIZE octets large, and the minimum negotiated value for max-frame-size is
- also MIN-MAX-FRAME-SIZE.
- </doc>
- </rule>
-
- <rule name="upper-limit">
- <doc>
- If the client specifies a max-frame-size that is higher than the value provided by the
- server, the server MUST close the connection without attempting a negotiated close. The
- server may report the error in some fashion to assist implementers.
- </doc>
- </rule>
-
- <rule name="max-frame-size">
- <doc>
- A peer MUST NOT send frames larger than the agreed-upon size. A peer that receives an
- oversized frame MUST close the connection with the framing-error close-code.
- </doc>
- </rule>
- </field>
-
- <field name="heartbeat" type="uint16" label="negotiated heartbeat delay">
- <doc>
- The delay, in seconds, of the connection heartbeat chosen by the client. If it is not set
- it means the client does not want a heartbeat.
- </doc>
-
- <rule name="permitted-range">
- <doc>
- The chosen heartbeat MUST be in the range supplied by the heartbeat-min and
- heartbeat-max fields of connection.tune.
- </doc>
- </rule>
-
- <rule name="no-heartbeat-min">
- <doc>
- The heartbeat field MUST NOT be set if the heartbeat-min field of connection.tune was
- not set by the server.
- </doc>
- </rule>
- </field>
- </control>
-
- <!-- - Control: connection.open - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="open" code="0x7" label="open connection to virtual host">
- <doc>
- This control opens a connection to a virtual host, which is a collection of resources, and
- acts to separate multiple application domains within a server. The server may apply
- arbitrary limits per virtual host, such as the number of each type of entity that may be
- used, per connection and/or in total.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <response name="open-ok" />
- <response name="redirect" />
-
- <field name="virtual-host" type="str8" label="virtual host name" required="true">
- <doc>
- The name of the virtual host to work with.
- </doc>
-
- <rule name="separation">
- <doc>
- If the server supports multiple virtual hosts, it MUST enforce a full separation of
- exchanges, queues, and all associated entities per virtual host. An application,
- connected to a specific virtual host, MUST NOT be able to access resources of another
- virtual host.
- </doc>
- </rule>
-
- <rule name="security">
- <doc>
- The server SHOULD verify that the client has permission to access the specified virtual
- host.
- </doc>
- </rule>
- </field>
-
- <field name="capabilities" type="str16-array" label="required capabilities">
- <doc>
- The client can specify zero or more capability names. The server can use this to determine
- how to process the client's connection request.
- </doc>
- </field>
-
- <field name="insist" type="bit" label="insist on connecting to server">
- <doc>
- In a configuration with multiple collaborating servers, the server may respond to a
- connection.open control with a Connection.Redirect. The insist option tells the server
- that the client is insisting on a connection to the specified server.
- </doc>
- <rule name="behavior">
- <doc>
- When the client uses the insist option, the server MUST NOT respond with a
- Connection.Redirect control. If it cannot accept the client's connection request it
- should respond by closing the connection with a suitable reply code.
- </doc>
- </rule>
- </field>
- </control>
-
- <!-- - Control: connection.open-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="open-ok" code="0x8" label="signal that connection is ready">
- <doc>
- This control signals to the client that the connection is ready for use.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="known-hosts" type="amqp-host-array" label="alternate hosts which may be used in
- the case of failure">
- <doc>
- Specifies an array of equivalent or alternative hosts that the server knows about, which
- will normally include the current server itself. Each entry in the array will be in the
- form of an IP address or DNS name, optionally followed by a colon and a port number.
- Clients can cache this information and use it when reconnecting to a server after a
- failure. This field may be empty.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.redirect - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="redirect" code="0x9" label="redirects client to other server">
- <doc>
- This control redirects the client to another server, based on the requested virtual host
- and/or capabilities.
- </doc>
-
- <rule name="usage">
- <doc>
- When getting the connection.redirect control, the client SHOULD reconnect to the host
- specified, and if that host is not present, to any of the hosts specified in the
- known-hosts list.
- </doc>
- </rule>
-
- <implement role="client" handle="MUST" />
-
- <field name="host" type="amqp-host-url" label="server to connect to" required="true">
- <doc>
- Specifies the server to connect to.
- </doc>
- </field>
-
- <field name="known-hosts" type="amqp-host-array" label="alternate hosts to try in case of
- failure">
- <doc>
- An array of equivalent or alternative hosts that the server knows about.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.heartbeat - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="heartbeat" code="0xa" label="indicates connection is still alive">
- <doc>
- The heartbeat control may be used to generate artificial network traffic when a connection
- is idle. If a connection is idle for more than twice the negotiated heartbeat delay, the
- peers MAY be considered disconnected.
- </doc>
- </control>
-
- <!-- - Control: connection.close - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="close" code="0xb" label="request a connection close">
- <doc>
- This control indicates that the sender wants to close the connection. The reason for close
- is indicated with the reply-code and reply-text. The channel this control is sent on MAY be
- used to indicate which channel caused the connection to close.
- </doc>
-
- <implement role="client" handle="MUST" />
- <implement role="server" handle="MUST" />
-
- <response name="close-ok" />
-
- <field name="reply-code" type="close-code" label="the numeric reply code"
- required="true">
- <doc>
- Indicates the reason for connection closure.
- </doc>
- </field>
- <field name="reply-text" type="str8" label="the localized reply text">
- <doc>
- This text can be logged as an aid to resolving issues.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.close-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="close-ok" code="0xc" label="confirm a connection close">
- <doc>
- This control confirms a connection.close control and tells the recipient that it is safe to
- release resources for the connection and close the socket.
- </doc>
-
- <rule name="reporting">
- <doc>
- A peer that detects a socket closure without having received a Close-Ok handshake control
- SHOULD log the error.
- </doc>
- </rule>
-
- <implement role="client" handle="MUST" />
- <implement role="server" handle="MUST" />
- </control>
-
- </class>
-
- <!-- == Class: session ======================================================================= -->
-
- <class name="session" code="0x2" label="session controls">
- <doc>
- A session is a named interaction between two peers. Session names are chosen by the upper
- layers and may be used indefinitely. The model layer may associate long-lived or durable state
- with a given session name. The session layer provides transport of commands associated with
- this interaction.
- </doc>
-
- <doc>
- The controls defined within this class are specified in terms of the "sender" of commands and
- the "receiver" of commands. Since both client and server send and receive commands, the
- overall session dialog is symmetric, however the semantics of the session controls are defined
- in terms of a single sender/receiver pair, and it is assumed that the client and server will
- each contain both a sender and receiver implementation.
- </doc>
-
- <rule name="attachment">
- <doc>
- The transport MUST be attached in order to use any control other than "attach", "attached",
- "detach", or "detached". A peer receiving any other control on a detached transport MUST
- discard it and send a session.detached with the "not-attached" reason code.
- </doc>
- </rule>
-
- <role name="server" implement="MUST" />
- <role name="client" implement="MUST" />
-
- <role name="sender" implement="MUST">
- <doc>
- The sender of commands.
- </doc>
- </role>
- <role name="receiver" implement="MUST">
- <doc>
- The receiver of commands.
- </doc>
- </role>
-
- <domain name="name" type="vbin16" label="opaque session name">
- <doc>
- The session name uniquely identifies an interaction between two peers. It is scoped to a
- given authentication principal.
- </doc>
- </domain>
-
- <domain name="detach-code" type="uint8" label="reason for detach">
- <enum>
- <choice name="normal" value="0">
- <doc>
- The session was detached by request.
- </doc>
- </choice>
- <choice name="session-busy" value="1">
- <doc>
- The session is currently attached to another transport.
- </doc>
- </choice>
- <choice name="transport-busy" value="2">
- <doc>
- The transport is currently attached to another session.
- </doc>
- </choice>
- <choice name="not-attached" value="3">
- <doc>
- The transport is not currently attached to any session.
- </doc>
- </choice>
- <choice name="unknown-ids" value="4">
- <doc>
- Command data was received prior to any use of the command-point control.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="commands" type="sequence-set" label="identifies a set of commands">
- </domain>
-
- <struct name="header" size="1" pack="1">
- <doc>
- The session header appears on commands after the class and command id, but prior to command
- arguments.
- </doc>
-
- <field name="sync" type="bit" label="request notification of completion">
- <doc>
- Request notification of completion for this command.
- </doc>
- </field>
- </struct>
-
- <struct name="command-fragment" size="0" pack="0" label="byte-ranges within a set of commands">
-
- <field name="command-id" type="sequence-no" required="true">
-
- </field>
- <field name="byte-ranges" type="byte-ranges" required="true">
-
- </field>
- </struct>
-
- <domain name="command-fragments" type="array" label="an array of values of type
- command-fragment"/>
-
- <control name="attach" code="0x1" label="attach to the named session">
- <doc>
- Requests that the current transport be attached to the named session. Success or failure
- will be indicated with an attached or detached response. This control is idempotent.
- </doc>
-
- <rule name="one-transport-per-session">
- <doc>
- A session MUST NOT be attached to more than one transport at a time.
- </doc>
- </rule>
-
- <rule name="one-session-per-transport">
- <doc>
- A transport MUST NOT be attached to more than one session at a time.
- </doc>
- </rule>
-
- <rule name="idempotence">
- <doc>
- Attaching a session to its current transport MUST succeed and result in an attached
- response.
- </doc>
- </rule>
-
- <rule name="scoping">
- <doc>
- Attachment to the same session name from distinct authentication principals MUST succeed.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MAY" />
-
- <response name="attached"/>
- <response name="detached"/>
-
- <field name="name" type="name" label="the session name" required="true">
- <doc>
- Identifies the session to be attached to the current transport.
- </doc>
- </field>
-
- <field name="force" type="bit" label="force attachment to a busy session">
- <doc>
- If set then a busy session will be forcibly detached from its other transport and
- reattached to the current transport.
- </doc>
- </field>
- </control>
-
- <control name="attached" code="0x2" label="confirm attachment to the named session">
- <doc>
- Confirms successful attachment of the transport to the named session.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="name" type="name" label="the session name" required="true">
- <doc>
- Identifies the session now attached to the current transport.
- </doc>
- </field>
- </control>
-
- <control name="detach" code="0x3" label="detach from the named session">
- <doc>
- Detaches the current transport from the named session.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <response name="detached"/>
-
- <field name="name" type="name" label="the session name" required="true">
- <doc>
- Identifies the session to detach.
- </doc>
- </field>
- </control>
-
- <control name="detached" code="0x4" label="confirm detachment from the named session">
- <doc>
- Confirms detachment of the current transport from the named session.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="name" type="name" label="the session name" required="true">
- <doc>
- Identifies the detached session.
- </doc>
- </field>
- <field name="code" type="detach-code" label="the reason for detach" required="true">
- <doc>
- Identifies the reason for detaching from the named session.
- </doc>
- </field>
- </control>
-
- <!--
- Execution state is the set of confirmed, and completed incoming commands, as well as the set
- of outgoing in-doubt commands held for replay.
- -->
-
- <control name="request-timeout" code="0x5" label="requests the execution timeout be changed">
- <doc>
- This control may be sent by either the sender or receiver of commands. It requests that the
- execution timeout be changed. This is the minimum amount of time that a peer must preserve
- execution state for a detached session.
- </doc>
-
- <rule name="maximum-granted-timeout">
- <doc>
- The handler of this request MUST set his timeout to the maximum allowed value less than or
- equal to the requested timeout, and MUST convey the chosen timeout in the response.
- </doc>
- </rule>
-
- <implement role="sender" handle="MUST" />
- <implement role="receiver" handle="MUST" />
-
- <response name="timeout"/>
-
- <field name="timeout" type="uint32" label="the requested timeout">
- <doc>
- The requested timeout for execution state in seconds. If not set, this control requests
- that execution state is preserved indefinitely.
- </doc>
- </field>
- </control>
-
- <control name="timeout" code="0x6" label="the granted timeout">
- <doc>
- This control may be sent by the either the sender or receiver of commands. It is a
- one-to-one reply to the request-timeout control that indicates the granted timeout for
- execution state.
- </doc>
-
- <implement role="sender" handle="MUST" />
- <implement role="receiver" handle="MUST" />
-
- <field name="timeout" type="uint32" label="the execution timeout">
- <doc>
- The timeout for execution state. If not set, then execution state is preserved
- indefinitely.
- </doc>
- </field>
- </control>
-
- <control name="command-point" code="0x7"
- label="the command id and byte offset of subsequent data">
- <doc>
- This control is sent by the sender of commands and handled by the receiver of commands. This
- establishes the sequence numbers associated with all subsequent command data sent from the
- sender to the receiver. The subsequent command data will be numbered starting with the
- values supplied in this control and proceeding sequentially. This must be used at least once
- prior to sending any command data on newly attached transports.
- </doc>
-
- <rule name="newly-attached-transports">
- <doc>
- If command data is sent on a newly attached transport the session MUST be detached with an
- "unknown-id" reason-code.
- </doc>
- </rule>
-
- <rule name="zero-offset">
- <doc>
- If the offset is zero, the next data frame MUST have the first-frame and first-segment
- flags set. Violation of this is a framing error.
- </doc>
- </rule>
-
- <rule name="nonzero-offset">
- <doc>
- If the offset is nonzero, the next data frame MUST NOT have both the first-frame and
- first-segment flag set. Violation of this is a framing error.
- </doc>
- </rule>
-
- <implement role="receiver" handle="MUST" />
-
- <field name="command-id" type="sequence-no" label="the command-id of the next command"
- required="true"/>
- <field name="command-offset" type="uint64" label="the byte offset within the command"
- required="true"/>
- </control>
-
- <control name="expected" code="0x8" label="informs the peer of expected commands">
- <doc>
- This control is sent by the receiver of commands and handled by the sender of commands. It
- informs the sender of what commands and command fragments are expected at the receiver.
- This control is only sent in response to a flush control with the expected flag set. The
- expected control is never sent spontaneously.
- </doc>
-
- <rule name="include-next-command">
- <doc>
- The set of expected commands MUST include the next command after the highest seen command.
- </doc>
- </rule>
-
- <rule name="commands-empty-means-new-session">
- <doc>
- The set of expected commands MUST have zero elements if and only if the sender holds no
- execution state for the session (i.e. it is a new session).
- </doc>
- </rule>
-
- <rule name="no-overlaps">
- <doc>
- If a command-id appears in the commands field, it MUST NOT appear in the fragments field.
- </doc>
- </rule>
-
- <rule name="minimal-fragments">
- <doc>
- When choice is permitted, a command MUST appear in the commands field rather than the
- fragments field.
- </doc>
- </rule>
-
- <implement role="sender" handle="MUST" />
-
- <field name="commands" type="commands" label="expected commands" required="true"/>
- <field name="fragments" type="command-fragments" label="expected fragments" />
- </control>
-
- <control name="confirmed" code="0x9" label="notifies of confirmed commands">
- <doc>
- This control is sent by the receiver of commands and handled by the sender of commands. This
- sends the set of commands that will definitely be completed by this peer to the sender. This
- excludes commands known by the receiver to be considered confirmed or complete at the
- sender.
- </doc>
- <doc>
- This control must be sent if the partner requests the set of confirmed commands using the
- session.flush control with the confirmed flag set.
- </doc>
- <doc>
- This control may be sent spontaneously. One reason for separating confirmation from
- completion is for large persistent messages, where the receipt (and storage to a durable
- store) of part of the message will result in less data needing to be replayed in the case of
- transport failure during transmission.
- </doc>
- <doc>
- A simple implementation of an AMQP client or server may be implemented to take no action on
- receipt of session.confirmed controls, and take action only when receiving
- session.completed controls.
- </doc>
- <doc>
- A simple implementation of an AMQP client or server may be implemented such that it never
- spontaneously sends session.confirmed and that when requested for the set of confirmed
- commands (via the session.flush control) it responds with the same set of commands as it
- would to when the set of completed commands was requested (trivially all completed commands
- are confirmed).
- </doc>
-
- <rule name="durability">
- <doc>
- If a command has durable implications, it MUST NOT be confirmed until the fact of the
- command has been recorded on durable media.
- </doc>
- </rule>
-
- <rule name="no-overlaps">
- <doc>
- If a command-id appears in the commands field, it MUST NOT appear in the fragments field.
- </doc>
- </rule>
-
- <rule name="minimal-fragments">
- <doc>
- When choice is permitted, a command MUST appear in the commands field rather than the
- fragments field.
- </doc>
- </rule>
-
- <implement role="sender" handle="MUST" />
-
- <field name="commands" type="commands" label="entirely confirmed commands">
- <rule name="exclude-known-complete">
- <doc>
- Command-ids included in prior known-complete replies MUST be excluded from the set of
- all confirmed commands.
- </doc>
- </rule>
- </field>
- <field name="fragments" type="command-fragments" label="partially confirmed commands"/>
- </control>
-
- <control name="completed" code="0xa" label="notifies of command completion">
- <doc>
- This control is sent by the receiver of commands, and handled by the sender of commands. It
- informs the sender of all commands completed by the receiver. This excludes commands known
- by the receiver to be considered complete at the sender.
- </doc>
-
- <rule name="known-completed-reply">
- <doc>
- The sender MUST eventually reply with a known-completed set that covers the completed ids.
- </doc>
- </rule>
-
- <rule name="delayed-reply">
- <doc>
- The known-complete reply MAY be delayed at the senders discretion if the timely-reply
- field is not set.
- </doc>
- </rule>
-
- <rule name="merged-reply">
- <doc>
- Multiple replies may be merged by sending a single known-completed that includes the union
- of the merged command-id sets.
- </doc>
- </rule>
-
- <implement role="sender" handle="MUST" />
-
- <field name="commands" type="commands" label="completed commands">
- <doc>
- The ids of all completed commands. This excludes commands known by the receiver to be
- considered complete at the sender.
- </doc>
-
- <rule name="completed-implies-confirmed">
- <doc>
- The sender MUST consider any completed commands to also be confirmed.
- </doc>
- </rule>
-
- <rule name="exclude-known-complete">
- <doc>
- Command-ids included in prior known-complete replies MUST be excluded from the set of
- all completed commands.
- </doc>
- </rule>
- </field>
- <field name="timely-reply" type="bit">
- <doc>
- If set, the sender is no longer free to delay the known-completed reply.
- </doc>
- </field>
- </control>
-
- <control name="known-completed" code="0xb" label="Inform peer of which commands are known to be
- completed">
- <doc>
- This control is sent by the sender of commands, and handled by the receiver of commands. It
- is sent in reply to one or more completed controls from the receiver. It informs the
- receiver that commands are known to be completed by the sender.
- </doc>
-
- <rule name="stateless">
- <doc>
- The sender need not keep state to generate this reply. It is sufficient to reply to any
- completed control with an exact echo of the completed ids.
- </doc>
- </rule>
-
- <implement role="receiver" handle="MUST" />
-
- <field name="commands" type="commands" label="commands known to be complete">
- <doc>
- The set of completed commands for one or more session.completed controls.
- </doc>
-
- <rule name="known-completed-implies-known-confirmed">
- <doc>
- The receiver MUST treat any of the specified commands to be considered by the sender as
- confirmed as well as completed.
- </doc>
- </rule>
- </field>
- </control>
-
- <control name="flush" code="0xc" label="requests a session.completed">
- <doc>
- This control is sent by the sender of commands and handled by the receiver of commands. It
- requests that the receiver produce the indicated command sets. The receiver should issue the
- indicated sets at the earliest possible opportunity.
- </doc>
-
- <implement role="receiver" handle="MUST" />
-
- <field name="expected" type="bit" label="request notification of expected commands"/>
- <field name="confirmed" type="bit" label="request notification of confirmed commands"/>
- <field name="completed" type="bit" label="request notification of completed commands"/>
- </control>
-
- <control name="gap" code="0xd" label="indicates missing segments in the stream">
- <doc>
- This control is sent by the sender of commands and handled by the receiver of commands. It
- sends command ranges for which there will be no further data forthcoming. The receiver
- should proceed with the next available commands that arrive after the gap.
- </doc>
-
- <rule name="gap-confirmation-and-completion">
- <doc>
- The command-ids covered by a session.gap MUST be added to the completed and confirmed sets
- by the receiver.
- </doc>
- </rule>
-
- <rule name="aborted-commands">
- <doc>
- If a session.gap covers a partially received command, the receiving peer MUST treat the
- command as aborted.
- </doc>
- </rule>
-
- <rule name="completed-or-confirmed-commands">
- <doc>
- If a session.gap covers a completed or confirmed command, the receiving peer MUST continue
- to treat the command as completed or confirmed.
- </doc>
- </rule>
-
- <implement role="receiver" handle="MUST" />
-
- <field name="commands" type="commands">
- <doc>
- The set of command-ids that are contained in this gap.
- </doc>
- </field>
- </control>
-
- </class>
-
- <!-- == Class: execution ===================================================================== -->
-
- <class name="execution" code="0x3" label="execution commands">
- <doc>
- The execution class provides commands that carry execution information about other model level
- commands.
- </doc>
-
- <role name="server" implement="MUST"/>
- <role name="client" implement="MUST"/>
-
- <domain name="error-code" type="uint16">
- <enum>
- <choice name="unauthorized-access" value="403">
- <doc>
- The client attempted to work with a server entity to which it has no access due to
- security settings.
- </doc>
- </choice>
-
- <choice name="not-found" value="404">
- <doc>
- The client attempted to work with a server entity that does not exist.
- </doc>
- </choice>
-
- <choice name="resource-locked" value="405">
- <doc>
- The client attempted to work with a server entity to which it has no access because
- another client is working with it.
- </doc>
- </choice>
-
- <choice name="precondition-failed" value="406">
- <doc>
- The client requested a command that was not allowed because some precondition failed.
- </doc>
- </choice>
-
- <choice name="resource-deleted" value="408">
- <doc>
- A server entity the client is working with has been deleted.
- </doc>
- </choice>
-
- <choice name="illegal-state" value="409">
- <doc>
- The peer sent a command that is not permitted in the current state of the session.
- </doc>
- </choice>
-
- <choice name="command-invalid" value="503">
- <doc>
- The command segments could not be decoded.
- </doc>
- </choice>
-
- <choice name="resource-limit-exceeded" value="506">
- <doc>
- The client exceeded its resource allocation.
- </doc>
- </choice>
-
- <choice name="not-allowed" value="530">
- <doc>
- The peer tried to use a command a manner that is inconsistent with the rules described
- in the specification.
- </doc>
- </choice>
-
- <choice name="illegal-argument" value="531">
- <doc>
- The command argument is malformed, i.e. it does not fall within the specified domain.
- The illegal-argument exception can be raised on execution of any command which has
- domain valued fields.
- </doc>
- </choice>
-
- <choice name="not-implemented" value="540">
- <doc>
- The peer tried to use functionality that is not implemented in its partner.
- </doc>
- </choice>
-
- <choice name="internal-error" value="541">
- <doc>
- The peer could not complete the command because of an internal error. The peer may
- require intervention by an operator in order to resume normal operations.
- </doc>
- </choice>
-
- <choice name="invalid-argument" value="542">
- <doc>
- An invalid argument was passed to a command, and the operation could not
- proceed. An invalid argument is not illegal (see illegal-argument), i.e. it matches
- the domain definition; however the particular value is invalid in this context.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <!-- - Command: execution.sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="sync" code="0x1" label="request notification of completion for issued commands">
- <doc>
- This command is complete when all prior commands are completed.
- </doc>
-
- <implement role="server" handle="MUST"/>
- <implement role="client" handle="MUST"/>
- </command>
-
- <!-- - Command: execution.result - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="result" code="0x2" label="carries execution results">
- <doc>
- This command carries data resulting from the execution of a command.
- </doc>
-
- <implement role="server" handle="MUST"/>
- <implement role="client" handle="MUST"/>
-
- <field name="command-id" type="sequence-no" required="true"/>
- <field name="value" type="struct32"/>
- </command>
-
- <!-- - Command: execution.exception - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="exception" code="0x3" label="notifies a peer of an execution error">
- <doc>
- This command informs a peer of an execution exception. The command-id, when given,
- correlates the error to a specific command.
- </doc>
-
- <implement role="client" handle="MUST"/>
- <implement role="server" handle="MUST"/>
-
- <field name="error-code" type="error-code" required="true" label="error code indicating the
- type of error"/>
- <field name="command-id" type="sequence-no" label="exceptional command">
- <doc>
- The command-id of the command which caused the exception. If the exception was not caused
- by a specific command, this value is not set.
- </doc>
- </field>
- <field name="class-code" type="uint8" label="the class code of the command whose execution
- gave rise to the error (if appropriate)"/>
- <field name="command-code" type="uint8" label="the class code of the command whose execution
- gave rise to the error (if appropriate)"/>
- <field name="field-index" type="uint8" label="index of the exceptional field">
- <doc>
- The zero based index of the exceptional field within the arguments to the exceptional
- command. If the exception was not caused by a specific field, this value is not set.
- </doc>
- </field>
- <field name="description" type="str16" label="descriptive text on the exception">
- <doc>
- The description provided is implementation defined, but MUST be in the language
- appropriate for the selected locale. The intention is that this description is suitable
- for logging or alerting output.
- </doc>
- </field>
- <field name="error-info" type="map" label="map to carry additional information about the
- error"/>
-
- </command>
-
- </class>
-
- <!-- == Class: message ======================================================================= -->
-
- <class name="message" code="0x4" label="message transfer">
- <doc>
- The message class provides commands that support an industry-standard messaging model.
- </doc>
-
- <doc type="picture" title="Transfer States">
- START:
-
- The message has yet to be sent to the recipient.
-
- NOT-ACQUIRED:
-
- The message has been sent to the recipient, but is not
- acquired by the recipient.
-
- ACQUIRED:
-
- The message has been sent to and acquired by the recipient.
-
- END:
-
- The transfer is complete.
- </doc>
-
- <doc type="picture" title="State Transitions"><![CDATA[
- *:TRANSFER (accept-mode=none) *:TRANSFER (acquire-mode=pre-acquired)
- +---------------------------------START------------------------------------------+
- | | |
- | | *:TRANSFER (acquire-mode=not-acquired) |
- | | |
- | R:RELEASE \|/ |
- | +-------------NOT-ACQUIRED<--+ |
- | | | | | R:ACQUIRE (if unavailable) |
- | | | +-----+ |
- | | | |
- | | | R:ACQUIRE (if available) |
- | | | |
- | | \|/ |
- | | ACQUIRED<-------------------------------------------+
- | | |
- | | | R:ACCEPT / R:REJECT / R:RELEASE
- | | |
- | | \|/
- | +------------->END]]>
- | /|\
- | |
- +-------------------------------+
- </doc>
-
- <doc type="grammar">
- message = *:TRANSFER [ R:ACQUIRE ] [ R:ACCEPT / R:REJECT / R:RELEASE ]
- / *:RESUME
- / *:SET-FLOW-MODE
- / *:FLOW
- / *:STOP
- / C:SUBSCRIBE
- / C:CANCEL
- / C:FLUSH
- </doc>
-
- <rule name="persistent-message">
- <doc>
- The server SHOULD respect the delivery-mode property of messages and SHOULD make a
- best-effort to hold persistent messages on a reliable storage mechanism.
- </doc>
- <doc type="scenario">
- Send a persistent message to queue, stop server, restart server and then verify whether
- message is still present. Assumes that queues are durable. Persistence without durable
- queues makes no sense.
- </doc>
- </rule>
-
- <rule name="no-persistent-message-discard">
- <doc>
- The server MUST NOT discard a persistent message in case of a queue overflow.
- </doc>
- <doc type="scenario">
- Create a queue overflow situation with persistent messages and verify that messages do not
- get lost (presumably the server will write them to disk).
- </doc>
- </rule>
-
- <rule name="throttling">
- <doc>
- The server MAY use the message.flow command to slow or stop a message publisher when
- necessary.
- </doc>
- </rule>
-
- <rule name="non-persistent-message-overflow">
- <doc>
- The server MAY overflow non-persistent messages to persistent storage.
- </doc>
- </rule>
-
- <rule name="non-persistent-message-discard">
- <doc>
- The server MAY discard or dead-letter non-persistent messages on a priority basis if the
- queue size exceeds some configured limit.
- </doc>
- </rule>
-
- <rule name="min-priority-levels">
- <doc>
- The server MUST implement at least 2 priority levels for messages, where priorities 0 and
- 9 are treated as two distinct levels.
- </doc>
- </rule>
-
- <rule name="priority-level-implementation">
- <doc>
- The server SHOULD implement distinct priority levels in the following manner:
- </doc>
- <doc>
- If the server implements n distinct priorities then priorities 0 to 5 - ceiling(n/2) should
- be treated equivalently and should be the lowest effective priority. The priorities 4 +
- floor(n/2) should be treated equivalently and should be the highest effective priority. The
- priorities (5 - ceiling(n/2)) to (4 + floor(n/2)) inclusive must be treated as distinct
- priorities.
- </doc>
- <doc>
- Thus, for example, if 2 distinct priorities are implemented, then levels 0 to 4 are
- equivalent, and levels 5 to 9 are equivalent and levels 4 and 5 are distinct. If 3 distinct
- priorities are implements the 0 to 3 are equivalent, 5 to 9 are equivalent and 3, 4 and 5
- are distinct.
- </doc>
- <doc>
- This scheme ensures that if two priorities are distinct for a server which implements m
- separate priority levels they are also distinct for a server which implements n different
- priority levels where n > m.
- </doc>
- </rule>
-
- <rule name="priority-delivery">
- <doc>
- The server MUST deliver messages of the same priority in order irrespective of their
- individual persistence.
- </doc>
- <doc type="scenario">
- Send a set of messages with the same priority but different persistence settings to a queue.
- Subscribe and verify that messages arrive in same order as originally published.
- </doc>
- </rule>
-
- <role name="server" implement="MUST" />
- <role name="client" implement="MUST" />
-
- <domain name="destination" type="str8" label="destination for a message">
- <doc>
- Specifies the destination to which the message is to be transferred.
- </doc>
- </domain>
-
- <domain name="accept-mode" type="uint8" label="indicates a confirmation mode">
- <doc>
- Controls how the sender of messages is notified of successful transfer.
- </doc>
-
- <enum>
- <choice name="explicit" value="0">
- <doc>
- Successful transfer is signaled by message.accept. An acquired message (whether
- acquisition was implicit as in pre-acquired mode or explicit as in not-acquired mode) is
- not considered transferred until a message.accept that includes the transfer command is
- received.
- </doc>
- </choice>
-
- <choice name="none" value="1">
- <doc>
- Successful transfer is assumed when accept-mode is "pre-acquired". Messages transferred
- with an accept-mode of "not-acquired" cannot be acquired when accept-mode is "none".
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="acquire-mode" type="uint8" label="indicates the transfer mode">
- <doc>
- Indicates whether a transferred message can be considered as automatically acquired or
- whether an explicit request is necessary in order to acquire it.
- </doc>
-
- <enum>
- <choice name="pre-acquired" value="0">
- <doc>
- the message is acquired when the transfer starts
- </doc>
- </choice>
-
- <choice name="not-acquired" value="1">
- <doc>
- the message is not acquired when it arrives, and must be explicitly acquired by the
- recipient
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="reject-code" type="uint16" label="reject code for transfer">
- <doc>
- Code specifying the reason for a message reject.
- </doc>
- <enum>
- <choice name="unspecified" value="0">
- <doc>
- Rejected for an unspecified reason.
- </doc>
- </choice>
- <choice name="unroutable" value="1">
- <doc>
- Delivery was attempted but there were no queues which the message could be routed to.
- </doc>
- </choice>
- <choice name="immediate" value="2">
- <doc>
- The rejected message had the immediate flag set to true, but at the time of the transfer
- at least one of the queues to which it was to be routed did not have any subscriber able
- to take the message.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="resume-id" type="str16">
- <doc>
- A resume-id serves to identify partially transferred message content. The id is chosen by
- the sender, and must be unique to a given user. A resume-id is not expected to be unique
- across users.
- </doc>
- </domain>
-
- <domain name="delivery-mode" type="uint8"
- label="indicates whether a message should be treated as transient or durable">
- <doc>
-
- Used to set the reliability requirements for a message which is transferred to the server.
- </doc>
- <enum>
- <choice name="non-persistent" value="1">
- <doc>
- A non-persistent message may be lost in event of a failure, but the nature of the
- communication is such that an occasional message loss is tolerable. This is the lowest
- overhead mode. Non-persistent messages are delivered at most once only.
- </doc>
- </choice>
-
- <choice name="persistent" value="2">
- <doc>
- A persistent message is one which must be stored on a persistent medium (usually hard
- drive) at every stage of delivery so that it will not be lost in event of failure (other
- than of the medium itself). This is normally accomplished with some additional overhead.
- A persistent message may be delivered more than once if there is uncertainty about the
- state of its delivery after a failure and recovery.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="delivery-priority" type="uint8"
- label="indicates the desired priority to assign to a message transfer">
- <doc>
- Used to assign a priority to a message transfer. Priorities range from 0 (lowest) to 9
- (highest).
- </doc>
- <enum>
- <choice name="lowest" value="0">
- <doc>
- Lowest possible priority message.
- </doc>
- </choice>
-
- <choice name="lower" value="1">
- <doc>
- Very low priority message
- </doc>
- </choice>
-
- <choice name="low" value="2">
- <doc>
- Low priority message.
- </doc>
- </choice>
-
- <choice name="below-average" value="3">
- <doc>
- Below average priority message.
- </doc>
- </choice>
-
- <choice name="medium" value="4">
- <doc>
- Medium priority message.
- </doc>
- </choice>
-
-
- <choice name="above-average" value="5">
- <doc>
- Above average priority message
- </doc>
- </choice>
-
-
- <choice name="high" value="6">
- <doc>
- High priority message
- </doc>
- </choice>
-
- <choice name="higher" value="7">
- <doc>
- Higher priority message
- </doc>
- </choice>
-
- <choice name="very-high" value="8">
- <doc>
- Very high priority message.
- </doc>
- </choice>
-
- <choice name="highest" value="9">
- <doc>
- Highest possible priority message.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <struct name="delivery-properties" size="4" code="0x1" pack="2">
- <field name="discard-unroutable" type="bit" label="controls discard of unroutable messages">
- <doc>
- If set on a message that is not routable the broker can discard it. If not set, an
- unroutable message should be handled by reject when accept-mode is explicit; or by routing
- to the alternate-exchange if defined when accept-mode is none.
- </doc>
- </field>
-
- <field name="immediate" type="bit" label="Consider message unroutable if it cannot be
- processed immediately">
- <doc>
- If the immediate flag is set to true on a message transferred to a Server, then the
- message should be considered unroutable (and not delivered to any queues) if, for any
- queue that it is to be routed to according to the standard routing behavior, there is not
- a subscription on that queue able to receive the message. The treatment of unroutable
- messages is dependent on the value of the discard-unroutable flag.
- </doc>
- <doc>
- The immediate flag is ignored on transferred to a Client.
- </doc>
- </field>
-
- <field name="redelivered" type="bit" label="redelivery flag">
- <doc>
- This boolean flag indicates that the message may have been previously delivered to this
- or another client.
- </doc>
- <doc>
- If the redelivered flag is set on transfer to a Server, then any delivery of the message
- from that Server to a Client must also have the redelivered flag set to true.
- </doc>
- <rule name="implementation">
- <doc>
- The server MUST try to signal redelivered messages when it can. When redelivering a
- message that was not successfully accepted, the server SHOULD deliver it to the original
- client if possible.
- </doc>
- <doc type="scenario">
- Create a shared queue and publish a message to the queue. Subscribe using explicit
- accept-mode, but do not accept the message. Close the session, reconnect, and subscribe
- to the queue again. The message MUST arrive with the redelivered flag set.
- </doc>
- </rule>
- <rule name="hinting">
- <doc>
- The client should not rely on the redelivered field to detect duplicate messages where
- publishers may themselves produce duplicates. A fully robust client should be able to
- track duplicate received messages on non-transacted, and locally-transacted sessions.
- </doc>
- </rule>
- </field>
-
- <field name="priority" type="delivery-priority" label="message priority, 0 to 9"
- required="true">
- <doc> Message priority, which can be between 0 and 9. Messages with higher priorities may be
- delivered before those with lower priorities. </doc>
- </field>
-
- <field name="delivery-mode" type="delivery-mode" label="message persistence requirement"
- required="true">
- <doc> The delivery mode may be non-persistent or persistent. </doc>
- </field>
-
- <field name="ttl" type="uint64" label="time to live in ms">
- <doc> Duration in milliseconds for which the message should be considered "live". If this is
- set then a message expiration time will be computed based on the current time plus this
- value. Messages that live longer than their expiration time will be discarded (or dead
- lettered).</doc>
- <rule name="ttl-decrement">
- <doc>
- If a message is transferred between brokers before delivery to a final subscriber the
- ttl should be decremented before peer to peer transfer and both timestamp and expiration
- should be cleared.
- </doc>
- </rule>
- </field>
-
- <field name="timestamp" type="datetime" label="message timestamp">
- <doc>
- The timestamp is set by the broker on arrival of the message.
- </doc>
- </field>
-
- <field name="expiration" type="datetime" label="message expiration time">
- <doc>
- The expiration header assigned by the broker. After receiving the message the broker sets
- expiration to the sum of the ttl specified in the publish command and the current time.
- (ttl=expiration - timestamp)
- </doc>
- </field>
-
- <field name="exchange" type="exchange.name" label="originating exchange">
- <doc>
- Identifies the exchange specified in the destination field of the message.transfer used to
- publish the message. This MUST be set by the broker upon receipt of a message.
- </doc>
- </field>
-
- <field name="routing-key" type="str8" label="message routing key">
- <doc>
- The value of the key determines to which queue the exchange will send the message. The way
- in which keys are used to make this routing decision depends on the type of exchange to
- which the message is sent. For example, a direct exchange will route a message to a queue
- if that queue is bound to the exchange with a binding-key identical to the routing-key of
- the message.
- </doc>
- </field>
-
- <field name="resume-id" type="resume-id" label="global id for message transfer">
- <doc>
- When a resume-id is provided the recipient MAY use it to retain message data should the
- session expire while the message transfer is still incomplete.
- </doc>
- </field>
-
- <field name="resume-ttl" type="uint64" label="ttl in ms for interrupted message data">
- <doc>
- When a resume-ttl is provided the recipient MAY use it has a guideline for how long to
- retain the partially complete data when a resume-id is specified. If no resume-id is
- specified then this value should be ignored.
- </doc>
- </field>
- </struct>
-
- <struct name="fragment-properties" size="4" code="0x2" pack="2">
- <doc>
- These properties permit the transfer of message fragments. These may be used in conjunction
- with byte level flow control to limit the rate at which large messages are received. Only
- the first fragment carries the delivery-properties and message-properties.
-
- Syntactically each fragment appears as a complete message to the lower layers of the
- protocol, however the model layer is required to treat all the fragments as a single
- message. For example all fragments must be delivered to the same client. In pre-acquired
- mode, no message fragments can be delivered by the broker until the entire message has been
- received.
- </doc>
-
- <field name="first" type="bit" default="1">
- <doc>True if this fragment contains the start of the message, false otherwise.</doc>
- </field>
-
- <field name="last" type="bit" default="1">
- <doc>True if this fragment contains the end of the message, false otherwise.</doc>
- </field>
-
- <field name="fragment-size" type="uint64">
- <doc>This field may optionally contain the size of the fragment.</doc>
- </field>
- </struct>
-
- <struct name="reply-to" size="2" pack="2">
- <doc>The reply-to domain provides a simple address structure for replying to to a message to a
- destination within the same virtual-host.</doc>
- <field name="exchange" type="exchange.name" label="the name of the exchange to reply to"/>
- <field name="routing-key" type="str8" label="the routing-key to use when replying"/>
- </struct>
-
- <struct name="message-properties" size="4" code="0x3" pack="2">
- <field name="content-length" type="uint64" label="length of the body segment in bytes">
- <doc>
- The length of the body segment in bytes.
- </doc>
- </field>
-
- <field name="message-id" type="uuid" label="application message identifier">
- <doc>
- Message-id is an optional property of UUID type which uniquely identifies a message within
- the message system. The message producer is usually responsible for setting the
- message-id. The server MAY discard a message as a duplicate if the value of the message-id
- matches that of a previously received message. Duplicate messages MUST still be accepted
- if transferred with an accept-mode of "explicit".
- </doc>
-
- <rule name="unique">
- <doc>
- A message-id MUST be unique within a given server instance. A message-id SHOULD be
- globally unique (i.e. across different systems).
- </doc>
- </rule>
-
- <rule name="immutable">
- <doc>
- A message ID is immutable. Once set, a message-id MUST NOT be changed or reassigned,
- even if the message is replicated, resent or sent to multiple queues.
- </doc>
- </rule>
- </field>
-
- <field name="correlation-id" type="vbin16" label="application correlation identifier">
- <doc>
- This is a client-specific id that may be used to mark or identify messages between
- clients. The server ignores this field.
- </doc>
- </field>
-
- <field name="reply-to" type="reply-to" label="destination to reply to">
- <doc>
- The destination of any message that is sent in reply to this message.
- </doc>
- </field>
-
- <field name="content-type" type="str8" label="MIME content type">
- <doc>
- The RFC-2046 MIME type for the message content (such as "text/plain"). This is set by the
- originating client.
- </doc>
- </field>
-
- <field name="content-encoding" type="str8" label="MIME content encoding">
- <doc>
- The encoding for character-based message content. This is set by the originating client.
- Examples include UTF-8 and ISO-8859-15.
- </doc>
- </field>
-
- <field name="user-id" type="vbin16" label="creating user id">
- <doc>
- The identity of the user responsible for producing the message. The client sets this
- value, and it is authenticated by the broker.
- </doc>
-
- <rule name="authentication">
- <doc>
- The server MUST produce an unauthorized-access exception if the user-id field is set to
- a principle for which the client is not authenticated.
- </doc>
- </rule>
- </field>
-
- <field name="app-id" type="vbin16" label="creating application id">
- <doc>
- The identity of the client application responsible for producing the message.
- </doc>
- </field>
-
- <field name="application-headers" type="map" label="application specific headers table">
- <doc>
- This is a collection of user-defined headers or properties which may be set by the
- producing client and retrieved by the consuming client.
- </doc>
- </field>
- </struct>
-
- <domain name="flow-mode" type="uint8" label="the flow-mode for allocating flow credit">
- <enum>
- <choice name="credit" value="0">
- <doc>
- Credit based flow control.
- </doc>
- </choice>
-
- <choice name="window" value="1">
- <doc>
- Window based flow control.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="credit-unit" type="uint8" label="specifies the unit of credit balance">
- <enum>
- <choice name="message" value="0">
- <doc>Indicates a value specified in messages.</doc>
- </choice>
- <choice name="byte" value="1">
- <doc>Indicates a value specified in bytes.</doc>
- </choice>
- </enum>
- </domain>
-
- <!-- - Command: message.transfer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="transfer" code="0x1" label="transfer a message">
- <doc>
- This command transfers a message between two peers. When a client uses this command to
- publish a message to a broker, the destination identifies a specific exchange. The message
- will then be routed to queues as defined by the exchange configuration.
-
- The client may request a broker to transfer messages to it, from a particular queue, by
- issuing a subscribe command. The subscribe command specifies the destination that the broker
- should use for any resulting transfers.
- </doc>
-
- <rule name="transactional-publish">
- <doc>
- If a transfer to an exchange occurs within a transaction, then it is not available from
- the queue until the transaction commits. It is not specified whether routing takes place
- when the transfer is received or when the transaction commits.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
-
- <field name="destination" type="destination" label="message destination">
- <doc>
- Specifies the destination to which the message is to be transferred.
- </doc>
-
- <rule name="blank-destination">
- <doc>
- The server MUST accept a blank destination to mean the default exchange.
- </doc>
- </rule>
-
- <exception name="nonexistent-exchange" error-code="not-found">
- <doc>
- If the destination refers to an exchange that does not exist, the peer MUST raise a
- session exception.
- </doc>
- </exception>
- </field>
-
- <field name="accept-mode" type="accept-mode" required="true">
- <doc>
- Indicates whether message.accept, session.complete, or nothing at all is required to
- indicate successful transfer of the message.
- </doc>
- </field>
-
- <field name="acquire-mode" type="acquire-mode" required="true">
- <doc>
- Indicates whether or not the transferred message has been acquired.
- </doc>
- </field>
-
- <segments>
- <header>
- <entry type="delivery-properties"/>
- <entry type="fragment-properties"/>
- <entry type="message-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- <!-- - Command: message.accept - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="accept" code="0x2" label="reject a message">
- <doc>
- Accepts the message. Once a transfer is accepted, the command-id may no longer be referenced
- from other commands.
- </doc>
-
- <rule name="acquisition">
- <doc>
- The recipient MUST have acquired a message in order to accept it.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="transfers" type="session.commands" required="true">
- <doc>
- Identifies the messages previously transferred that should be accepted.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.reject - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="reject" code="0x3" label="reject a message">
- <doc>
- Indicates that the message transfers are unprocessable in some way. A server may reject a
- message if it is unroutable. A client may reject a message if it is invalid. A message may
- be rejected for other reasons as well. Once a transfer is rejected, the command-id may no
- longer be referenced from other commands.
- </doc>
-
- <rule name="alternate-exchange">
- <doc>
- When a client rejects a message, the server MUST deliver that message to the
- alternate-exchange on the queue from which it was delivered. If no alternate-exchange is
- defined for that queue the broker MAY discard the message.
- </doc>
- </rule>
-
- <rule name="acquisition">
- <doc>
- The recipient MUST have acquired a message in order to reject it. If the message is not
- acquired any reject MUST be ignored.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="transfers" type="session.commands" required="true">
- <doc>
- Identifies the messages previously transferred that should be rejected.
- </doc>
- </field>
- <field name="code" type="reject-code" required="true">
- <doc>
- Code describing the reason for rejection.
- </doc>
- </field>
- <field name="text" type="str8" label="informational text for message reject">
- <doc>
- Text describing the reason for rejection.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.release - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="release" code="0x4" label="release a message">
- <doc>
- Release previously transferred messages. When acquired messages are released, they become
- available for acquisition by any subscriber. Once a transfer is released, the command-id may
- no longer be referenced from other commands.
- </doc>
-
- <rule name="ordering">
- <doc>
- Acquired messages that have been released MAY subsequently be delivered out of order.
- Implementations SHOULD ensure that released messages keep their position with respect to
- undelivered messages of the same priority.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MAY" />
-
- <field name="transfers" type="session.commands" required="true">
- <doc>
- Indicates the messages to be released.
- </doc>
- </field>
- <field name="set-redelivered" type="bit" label="mark the released messages as redelivered">
- <doc>
- By setting set-redelivered to true, any acquired messages released to a queue with this
- command will be marked as redelivered on their next transfer from that queue. If this flag
- is not set, then an acquired message will retain its original redelivered status on the
- queue. Messages that are not acquired are unaffected by the value of this flag.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.acquire - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="acquire" code="0x5" label="acquire messages for consumption">
- <doc>
- Acquires previously transferred messages for consumption. The acquired ids (if any) are
- sent via message.acquired.
- </doc>
-
- <rule name="one-to-one">
- <doc>
- Each acquire MUST produce exactly one message.acquired even if it is empty.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="transfers" type="session.commands" required="true">
- <doc>
- Indicates the messages to be acquired.
- </doc>
- </field>
-
- <result>
- <struct name="acquired" size="4" code="0x4" pack="2" label="indicates acquired messages">
- <doc>
- Identifies a set of previously transferred messages that have now been acquired.
- </doc>
-
- <field name="transfers" type="session.commands" required="true">
- <doc>
- Indicates the acquired messages.
- </doc>
- </field>
- </struct>
- </result>
- </command>
-
- <!-- - Command: message.resume - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="resume" code="0x6" label="resume an interrupted message transfer">
- <doc>
- This command resumes an interrupted transfer. The recipient should return the amount of
- partially transferred data associated with the given resume-id, or zero if there is no data
- at all. If a non-zero result is returned, the recipient should expect to receive message
- fragment(s) containing the remainder of the interrupted message.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="destination" type="destination">
- <doc>
- The destination to which the remaining message fragments are transferred.
- </doc>
-
- <exception name="destination-not-found" error-code="not-found">
- <doc>If the destination does not exist, the recipient MUST close the session.</doc>
- </exception>
- </field>
-
- <field name="resume-id" type="resume-id" required="true">
- <doc>
- The name of the transfer being resumed.
- </doc>
-
- <rule name="unknown-resume-id">
- <doc>If the resume-id is not known, the recipient MUST return an offset of zero.</doc>
- </rule>
- </field>
-
- <result>
- <struct name="message-resume-result" size="4" code="0x5" pack="2">
- <field name="offset" type="uint64">
- <doc>
- Indicates the amount of data already transferred.
- </doc>
- </field>
- </struct>
- </result>
- </command>
-
- <!-- - Command: message.subscribe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="subscribe" code="0x7" label="start a queue subscription">
- <doc> This command asks the server to start a "subscription", which is a request for messages
- from a specific queue. Subscriptions last as long as the session they were created on, or
- until the client cancels them. </doc>
-
- <rule name="simultaneous-subscriptions">
- <doc> The server SHOULD support at least 16 subscriptions per queue, and ideally, impose no
- limit except as defined by available resources. </doc>
- <doc type="scenario"> Create a queue and create subscriptions on that queue until the server
- closes the connection. Verify that the number of subscriptions created was at least
- sixteen and report the total number. </doc>
- </rule>
-
- <rule name="default-flow-mode">
- <doc> The default flow mode for new subscriptions is window-mode. </doc>
- </rule>
-
- <exception name="queue-deletion" error-code="resource-deleted">
- <doc>
- If the queue for this subscription is deleted, any subscribing sessions MUST be closed.
- This exception may occur at any time after the subscription has been completed.
- </doc>
- </exception>
-
- <exception name="queue-not-found" error-code="not-found">
- <doc> If the queue for this subscription does not exist, then the subscribing session MUST
- be closed. </doc>
- </exception>
-
- <rule name="initial-credit">
- <doc>
- Immediately after a subscription is created, the initial byte and message credit for that
- destination is zero.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST"/>
-
- <field name="queue" type="queue.name" required="true">
- <doc> Specifies the name of the subscribed queue. </doc>
- </field>
-
- <field name="destination" type="destination" label="incoming message destination">
- <doc> The client specified name for the subscription. This is used as the destination for
- all messages transferred from this subscription. The destination is scoped to the session.
- </doc>
-
- <exception name="unique-subscriber-destination" error-code="not-allowed">
- <doc> The client MUST NOT specify a destination that refers to an existing subscription on
- the same session. </doc>
- <doc type="scenario"> Attempt to create two subscriptions on the same session with the
- same non-empty destination. </doc>
- </exception>
- </field>
-
- <field name="accept-mode" type="accept-mode" required="true">
- <doc> The accept-mode to use for messages transferred from this subscription. </doc>
- </field>
-
- <field name="acquire-mode" type="acquire-mode" required="true">
- <doc> The acquire-mode to use for messages transferred from this subscription. </doc>
- </field>
-
- <field name="exclusive" type="bit" label="request exclusive access">
- <doc> Request an exclusive subscription. This prevents other subscribers from subscribing to
- the queue. </doc>
-
- <exception name="in-use" error-code="resource-locked">
- <doc> The server MUST NOT grant an exclusive subscription to a queue that already has
- subscribers. </doc>
- <doc type="scenario"> Open two connections to a server, and in one connection create a
- shared (non-exclusive) queue and then subscribe to the queue. In the second connection
- attempt to subscribe to the same queue using the exclusive option. </doc>
- </exception>
- </field>
-
- <field name="resume-id" type="resume-id">
- <doc> Requests that the broker use the supplied resume-id when transferring messages for
- this subscription. </doc>
- </field>
-
- <field name="resume-ttl" type="uint64">
- <doc> Requested duration in milliseconds for the broker use as resume-ttl when transferring
- messages for this subscription. </doc>
- </field>
-
- <field name="arguments" type="map" label="arguments for vendor extensions">
- <doc> The syntax and semantics of these arguments depends on the providers implementation.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.cancel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="cancel" code="0x8" label="end a queue subscription">
- <doc>
- This command cancels a subscription. This does not affect already delivered messages, but it
- does mean the server will not send any more messages for that subscription. The client may
- receive an arbitrary number of messages in between sending the cancel command and receiving
- notification that the cancel command is complete.
- </doc>
-
- <rule name="post-cancel-transfer-resolution">
- <doc>
- Canceling a subscription MUST NOT affect pending transfers. A transfer made prior to
- canceling transfers to the destination MUST be able to be accepted, released, acquired, or
- rejected after the subscription is canceled.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="destination" type="destination" required="true">
- <exception name="subscription-not-found" error-code="not-found">
- <doc>
- If the subscription specified by the destination is not found, the server MUST close the
- session.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: message.set-flow-mode - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="set-flow-mode" code="0x9" label="set the flow control mode">
- <doc>
- Sets the mode of flow control used for a given destination to either window or credit based
- flow control.
-
- With credit based flow control, the sender of messages continually maintains its current
- credit balance with the recipient. The credit balance consists of two values, a message
- count, and a byte count. Whenever message data is sent, both counts must be decremented.
- If either value reaches zero, the flow of message data must stop. Additional credit is
- received via the message.flow command.
-
- The sender MUST NOT send partial assemblies. This means that if there is not enough byte
- credit available to send a complete message, the sender must either wait or use message
- fragmentation (see the fragment-properties header struct) to send the first part of the
- message data in a complete assembly.
-
- Window based flow control is identical to credit based flow control, however message
- transfer completion implicitly grants a single unit of message credit, and the size of the
- message in byte credits for each completed message transfer. Completion of the transfer
- command with session.completed is the only way credit is implicitly updated; message.accept,
- message.release, message.reject, tx.commit and tx.rollback have no effect on the outstanding
- credit balances.
- </doc>
-
- <rule name="byte-accounting">
- <doc>
- The byte count is decremented by the payload size of each transmitted frame with segment
- type header or body appearing within a message.transfer command. Note that the payload
- size is the frame size less the frame header size.
- </doc>
- </rule>
-
- <rule name="mode-switching">
- <doc>
- Mode switching may only occur if both the byte and message credit balance are zero. There
- are three ways for a recipient of messages to be sure that the sender's credit balances
- are zero:
-
- 1) The recipient may send a message.stop command to the sender. When the recipient
- receives notification of completion for the message.stop command, it knows that the
- sender's credit is zero.
-
- 2) The recipient may perform the same steps described in (1) with the message.flush
- command substituted for the message.stop command.
-
- 3) Immediately after a subscription is created with message.subscribe, the credit for
- that destination is zero.
- </doc>
- </rule>
-
- <rule name="default-flow-mode">
- <doc>
- Prior to receiving an explicit set-flow-mode command, a peer MUST consider the flow-mode
- to be window.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="destination" type="destination"/>
- <field name="flow-mode" type="flow-mode" required="true">
- <doc>
- The new flow control mode.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.flow - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="flow" code="0xa" label="control message flow">
- <doc>
- This command controls the flow of message data to a given destination. It is used by the
- recipient of messages to dynamically match the incoming rate of message flow to its
- processing or forwarding capacity. Upon receipt of this command, the sender must add "value"
- number of the specified unit to the available credit balance for the specified destination.
- A value of (0xFFFFFFFF) indicates an infinite amount of credit. This disables any limit for
- the given unit until the credit balance is zeroed with message.stop or message.flush.
- </doc>
-
- <!-- throws no-such-destination -->
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="destination" type="destination"/>
- <field name="unit" type="credit-unit" required="true">
- <doc>
- The unit of value.
- </doc>
- </field>
- <field name="value" type="uint32">
- <doc>
- If the value is not set then this indicates an infinite amount of credit.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.flush - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="flush" code="0xb" label="force the sending of available messages">
- <doc>
- Forces the sender to exhaust his credit supply. The sender's credit will always be zero when
- this command completes. The command completes when immediately available message data has
- been transferred, or when the credit supply is exhausted.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="destination" type="destination"/>
- </command>
-
- <!-- - Command: message.stop - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="stop" code="0xc" label="stop the sending of messages">
- <doc>
- On receipt of this command, a producer of messages MUST set his credit to zero for the given
- destination. When notifying of completion, credit MUST be zero and no further messages will
- be sent until such a time as further credit is received.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="destination" type="destination"/>
- </command>
-
- </class>
-
- <!-- == Class: tx ============================================================================ -->
-
- <class name="tx" code="0x5" label="work with standard transactions">
- <doc>
- Standard transactions provide so-called "1.5 phase commit". We can ensure that work is never
- lost, but there is a chance of confirmations being lost, so that messages may be resent.
- Applications that use standard transactions must be able to detect and ignore duplicate
- messages.
- </doc>
-
- <doc type="grammar">
- tx = C:SELECT
- / C:COMMIT
- / C:ROLLBACK
- </doc>
-
- <!-- XXX: this isn't really a rule, as stated there is no way for
- a client library to implement this -->
- <rule name="duplicate-tracking">
- <doc>
- An client using standard transactions SHOULD be able to track all messages received within a
- reasonable period, and thus detect and reject duplicates of the same message. It SHOULD NOT
- pass these to the application layer.
- </doc>
- </rule>
-
- <role name="server" implement="SHOULD" />
-
- <!-- - Command: tx.select - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="select" code="0x1" label="select standard transaction mode">
- <doc>
- This command sets the session to use standard transactions. The client must use this command
- exactly once on a session before using the Commit or Rollback commands.
- </doc>
-
- <exception name="exactly-once" error-code="illegal-state">
- <doc>
- A client MUST NOT select standard transactions on a session that is already transactional.
- </doc>
- </exception>
-
- <exception name="no-dtx" error-code="illegal-state">
- <doc>
- A client MUST NOT select standard transactions on a session that is already enlisted in a
- distributed transaction.
- </doc>
- </exception>
-
- <exception name="explicit-accepts" error-code="not-allowed">
- <doc>
- On a session on which tx.select has been issued, a client MUST NOT issue a
- message.subscribe command with the accept-mode property set to any value other than
- explicit. Similarly a tx.select MUST NOT be issued on a session on which a there is a non
- cancelled subscriber with accept-mode of none.
- </doc>
- </exception>
-
- <implement role="server" handle="MUST" />
- </command>
-
- <!-- - Command: tx.commit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="commit" code="0x2" label="commit the current transaction">
- <doc>
- This command commits all messages published and accepted in the current transaction. A
- new transaction starts immediately after a commit.
- </doc>
- <doc>
- In more detail, the commit acts on all messages which have been transferred from the Client
- to the Server, and on all acceptances of messages sent from Server to Client. Since the
- commit acts on commands sent in the same direction as the commit command itself, there is no
- ambiguity on the scope of the commands being committed. Further, the commit will not be
- completed until all preceding commands which it affects have been completed.
- </doc>
- <doc>
- Since transactions act on explicit accept commands, the only valid accept-mode for message
- subscribers is explicit. For transferring messages from Client to Server (publishing) all
- accept-modes are permitted.
- </doc>
-
- <exception name="select-required" error-code="illegal-state">
- <doc>
- A client MUST NOT issue tx.commit on a session that has not been selected for standard
- transactions with tx.select.
- </doc>
- </exception>
-
-
-
- <implement role="server" handle="MUST" />
- </command>
-
- <!-- - Command: tx.rollback - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="rollback" code="0x3" label="abandon the current transaction">
- <doc>
- This command abandons the current transaction. In particular the transfers from Client to
- Server (publishes) and accepts of transfers from Server to Client which occurred in the
- current transaction are discarded. A new transaction starts immediately after a rollback.
- </doc>
- <doc>
- In more detail, when a rollback is issued, any the effects of transfers which occurred from
- Client to Server are discarded. The Server will issue completion notification for all such
- transfers prior to the completion of the rollback. Similarly the effects of any
- message.accept issued from Client to Server prior to the issuance of the tx.rollback will be
- discarded; and notification of completion for all such commands will be issued before the
- issuance of the completion for the rollback.
- </doc>
- <doc>
- After the completion of the rollback, the client will still hold the messages which it has
- not yet accepted (including those for which accepts were previously issued within the
- transaction); i.e. the messages remain "acquired". If the Client wishes to release those
- messages back to the Server, then appropriate message.release commands must be issued.
- </doc>
-
- <exception name="select-required" error-code="illegal-state">
- <doc>
- A client MUST NOT issue tx.rollback on a session that has not been selected for standard
- transactions with tx.select.
- </doc>
- </exception>
-
- <implement role="server" handle="MUST" />
- </command>
-
- </class>
-
- <!-- == Class: dtx =========================================================================== -->
-
- <class name="dtx" code="0x6" label="Demarcates dtx branches">
- <doc>
- This provides the X-Open XA distributed transaction protocol support. It allows a session
- to be selected for use with distributed transactions, the transactional boundaries for work on
- that session to be demarcated and allows the transaction manager to coordinate transaction
- outcomes.
- </doc>
-
- <doc type="grammar">
- dtx-demarcation = C:SELECT *demarcation
- demarcation = C:START C:END
- </doc>
-
- <doc type="grammar">
- dtx-coordination = *coordination
- coordination = command
- / outcome
- / recovery
- command = C:SET-TIMEOUT
- / C:GET-TIMEOUT
- outcome = one-phase-commit
- / one-phase-rollback
- / two-phase-commit
- / two-phase-rollback
- one-phase-commit = C:COMMIT
- one-phase-rollback = C:ROLLBACK
- two-phase-commit = C:PREPARE C:COMMIT
- two-phase-rollback = C:PREPARE C:ROLLBACK
- recovery = C:RECOVER *recovery-outcome
- recovery-outcome = one-phase-commit
- / one-phase-rollback
- / C:FORGET
-
- </doc>
-
- <rule name="transactionality">
- <doc>
- Enabling XA transaction support on a session requires that the server MUST manage
- transactions demarcated by start-end blocks. That is to say that on this XA-enabled session,
- work undergone within transactional blocks is performed on behalf a transaction branch
- whereas work performed outside of transactional blocks is NOT transactional.
- </doc>
- </rule>
-
- <role name="server" implement="MAY" />
- <role name="client" implement="MAY" />
-
- <!-- XA domains -->
-
- <domain name="xa-status" type="uint16" label="XA return codes">
- <enum>
- <choice name="xa-ok" value="0">
- <doc>
- Normal execution completion (no error).
- </doc>
- </choice>
-
- <choice name="xa-rbrollback" value="1">
- <doc>
- The rollback was caused for an unspecified reason.
- </doc>
- </choice>
-
- <choice name="xa-rbtimeout" value="2">
- <doc>
- A transaction branch took too long.
- </doc>
- </choice>
-
- <choice name="xa-heurhaz" value="3">
- <doc>
- The transaction branch may have been heuristically completed.
- </doc>
- </choice>
-
- <choice name="xa-heurcom" value="4">
- <doc>
- The transaction branch has been heuristically committed.
- </doc>
- </choice>
-
- <choice name="xa-heurrb" value="5">
- <doc>
- The transaction branch has been heuristically rolled back.
- </doc>
- </choice>
-
- <choice name="xa-heurmix" value="6">
- <doc>
- The transaction branch has been heuristically committed and rolled back.
- </doc>
- </choice>
-
- <choice name="xa-rdonly" value="7">
- <doc>
- The transaction branch was read-only and has been committed.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <struct name="xa-result" size="4" code="0x1" pack="2">
- <field name="status" type="xa-status" required="true"/>
- </struct>
-
- <!-- Struct for xid -->
-
- <struct name="xid" size="4" code="0x4" pack="2" label="dtx branch identifier">
- <doc>
- An xid uniquely identifies a transaction branch.
- </doc>
-
- <field name="format" type="uint32" label="implementation specific format code"
- required="true"/>
- <field name="global-id" type="vbin8" label="global transaction id" required="true"/>
- <field name="branch-id" type="vbin8" label="branch qualifier" required="true"/>
- </struct>
-
- <!-- - Command: dtx.select - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="select" code="0x1" label="Select dtx mode">
- <doc>
- This command sets the session to use distributed transactions. The client must use this
- command at least once on a session before using XA demarcation operations.
- </doc>
-
- <implement role="server" handle="MAY" />
- </command>
-
- <!-- - Command: dtx.start - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="start" code="0x2" label="Start a dtx branch">
- <doc>
- This command is called when messages should be produced and consumed on behalf a transaction
- branch identified by xid.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- send a session exception.
- </doc>
- </exception>
-
- <exception name="already-known" error-code="not-allowed">
- <doc>
- If neither join nor resume is specified is specified and the transaction branch specified
- by xid has previously been seen then the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="join-and-resume" error-code="not-allowed">
- <doc>
- If join and resume are specified then the server MUST raise an exception.
- </doc>
- </exception>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch to be started.
- </doc>
-
- <exception name="unknown-xid" error-code="not-allowed">
- <doc>
- If xid is already known by the broker then the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="join" type="bit" label="Join with existing xid flag">
- <doc>
- Indicate whether this is joining an already associated xid. Indicate that the start
- applies to joining a transaction previously seen.
- </doc>
-
- <exception name="unsupported" error-code="not-implemented">
- <doc>
- If the broker does not support join the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="resume" type="bit" label="Resume flag">
- <doc>
- Indicate that the start applies to resuming a suspended transaction branch specified.
- </doc>
- </field>
-
- <result type="xa-result">
- <doc>
- This confirms to the client that the transaction branch is started or specify the error
- condition.
-
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- </result>
- </command>
-
- <!-- - Command: dtx.end - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="end" code="0x3" label="End a dtx branch">
- <doc>
- This command is called when the work done on behalf a transaction branch finishes or needs
- to be suspended.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- raise an exception.
- </doc>
- </exception>
-
- <exception name="suspend-and-fail" error-code="not-allowed">
- <doc>
- If suspend and fail are specified then the server MUST raise an exception.
- </doc>
- </exception>
-
- <rule name="success">
- <doc>
- If neither fail nor suspend are specified then the portion of work has completed
- successfully.
- </doc>
- </rule>
-
- <rule name="session-closed">
- <doc>
- When a session is closed then the currently associated transaction branches MUST be marked
- rollback-only.
- </doc>
- </rule>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch to be ended.
- </doc>
-
- <exception name="not-associated" error-code="illegal-state">
- <doc>
- The session MUST be currently associated with the given xid (through an earlier start
- call with the same xid).
- </doc>
- </exception>
- </field>
-
- <field name="fail" type="bit" label="Failure flag">
- <doc>
- If set, indicates that this portion of work has failed; otherwise this portion of work has
- completed successfully.
- </doc>
-
- <rule name="failure">
- <doc>
- An implementation MAY elect to roll a transaction back if this failure notification is
- received. Should an implementation elect to implement this behavior, and this bit is
- set, then then the transaction branch SHOULD be marked as rollback-only and the end
- result SHOULD have the xa-rbrollback status set.
- </doc>
- </rule>
- </field>
-
- <field name="suspend" type="bit" label="Temporary suspension flag">
- <doc>
- Indicates that the transaction branch is temporarily suspended in an incomplete state.
- </doc>
-
- <rule name="resume">
- <doc>
- The transaction context is in a suspended state and must be resumed via the start
- command with resume specified.
- </doc>
- </rule>
-
- </field>
-
- <result type="xa-result">
- <doc>
- This command confirms to the client that the transaction branch is ended or specify the
- error condition.
-
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason. If an implementation chooses to implement rollback-on-failure behavior, then
- this value should be selected if the dtx.end.fail bit was set.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- </result>
- </command>
-
- <!-- - Command: dtx.commit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="commit" code="0x4" label="Commit work on dtx branch">
- <doc>
- Commit the work done on behalf a transaction branch. This command commits the work
- associated with xid. Any produced messages are made available and any consumed messages are
- discarded.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- raise an exception.
- </doc>
- </exception>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch to be committed.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-disassociated" error-code="illegal-state">
- <doc>
- If this command is called when xid is still associated with a session then the server
- MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="one-phase" type="bit" label="One-phase optimization flag">
- <doc>
- Used to indicate whether one-phase or two-phase commit is used.
- </doc>
-
- <exception name="one-phase" error-code="illegal-state">
- <doc>
- The one-phase bit MUST be set if a commit is sent without a preceding prepare.
- </doc>
- </exception>
-
- <exception name="two-phase" error-code="illegal-state">
- <doc>
- The one-phase bit MUST NOT be set if the commit has been preceded by prepare.
- </doc>
- </exception>
- </field>
-
- <result type="xa-result">
- <doc>
- This confirms to the client that the transaction branch is committed or specify the
- error condition.
-
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution
-
- xa-heurhaz: Due to some failure, the work done on behalf of the specified transaction
- branch may have been heuristically completed.
-
- xa-heurcom: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was committed.
-
- xa-heurrb: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was rolled back.
-
- xa-heurmix: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was partially committed and partially rolled back.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- </result>
- </command>
-
- <!-- - Command: dtx.forget - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="forget" code="0x5" label="Discard dtx branch">
- <doc>
- This command is called to forget about a heuristically completed transaction branch.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- raise an exception.
- </doc>
- </exception>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch to be forgotten.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-disassociated" error-code="illegal-state">
- <doc>
- If this command is called when xid is still associated with a session then the server
- MUST raise an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: dtx.get-timeout - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="get-timeout" code="0x6" label="Obtain dtx timeout in seconds">
- <doc>
- This command obtains the current transaction timeout value in seconds. If set-timeout was
- not used prior to invoking this command, the return value is the default timeout; otherwise,
- the value used in the previous set-timeout call is returned.
- </doc>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch for getting the timeout.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <result>
- <struct name="get-timeout-result" size="4" code="0x2" pack="2">
- <doc> Returns the value of the timeout last specified through set-timeout. </doc>
-
- <field name="timeout" type="uint32" label="The current transaction timeout value"
- required="true">
- <doc> The current transaction timeout value in seconds. </doc>
- </field>
- </struct>
- </result>
- </command>
-
- <!-- - Command: dtx.prepare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="prepare" code="0x7" label="Prepare a dtx branch">
- <doc>
- This command prepares for commitment any message produced or consumed on behalf of xid.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- raise an exception.
- </doc>
- </exception>
-
- <rule name="obligation-1">
- <doc>
- Once this command successfully returns it is guaranteed that the transaction branch may be
- either committed or rolled back regardless of failures.
- </doc>
- </rule>
-
- <rule name="obligation-2">
- <doc>
- The knowledge of xid cannot be erased before commit or rollback complete the branch.
- </doc>
- </rule>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch that can be prepared.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-disassociated" error-code="illegal-state">
- <doc>
- If this command is called when xid is still associated with a session then the server
- MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <result type="xa-result">
- <doc>
- This command confirms to the client that the transaction branch is prepared or specify the
- error condition.
-
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution.
-
- xa-rdonly: The transaction branch was read-only and has been committed.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- </result>
- </command>
-
- <!-- - Command: dtx.recover - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="recover" code="0x8" label="Get prepared or completed xids">
- <doc>
- This command is called to obtain a list of transaction branches that are in a prepared or
- heuristically completed state.
- </doc>
-
- <implement role="server" handle="MAY" />
-
- <result>
- <struct name="recover-result" size="4" code="0x3" pack="2">
- <doc>
- Returns to the client a table with single item that is a sequence of transaction xids
- that are in a prepared or heuristically completed state.
- </doc>
-
- <field name="in-doubt" type="array" label="array of xids to be recovered" required="true">
- <doc> Array containing the xids to be recovered (xids that are in a prepared or
- heuristically completed state). </doc>
-
- </field>
- </struct>
- </result>
- </command>
-
- <!-- - Command: dtx.rollback - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="rollback" code="0x9" label="Rollback a dtx branch">
- <doc>
- This command rolls back the work associated with xid. Any produced messages are discarded
- and any consumed messages are re-enqueued.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- raise an exception.
- </doc>
- </exception>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch that can be rolled back.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-disassociated" error-code="illegal-state">
- <doc>
- If this command is called when xid is still associated with a session then the server
- MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <result type="xa-result">
- <doc>
- This command confirms to the client that the transaction branch is rolled back or specify
- the error condition.
-
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution
-
- xa-heurhaz: Due to some failure, the work done on behalf of the specified transaction
- branch may have been heuristically completed.
-
- xa-heurcom: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was committed.
-
- xa-heurrb: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was rolled back.
-
- xa-heurmix: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was partially committed and partially rolled back.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- </result>
- </command>
-
- <!-- - Command: dtx.set-timeout - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="set-timeout" code="0xa" label="Set dtx timeout value">
- <doc>
- Sets the specified transaction branch timeout value in seconds.
- </doc>
-
- <rule name="effective">
- <doc>
- Once set, this timeout value is effective until this command is reinvoked with a different
- value.
- </doc>
- </rule>
-
- <rule name="reset">
- <doc>
- A value of zero resets the timeout value to the default value.
- </doc>
- </rule>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch for setting the timeout.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
-
- </field>
-
- <field name="timeout" type="uint32" label="Dtx timeout in seconds" required="true">
- <doc>
- The transaction timeout value in seconds.
- </doc>
- </field>
- </command>
-
- </class>
-
- <!-- == Class: exchange ====================================================================== -->
-
- <class name="exchange" code="0x7" label="work with exchanges">
- <doc>
- Exchanges match and distribute messages across queues. Exchanges can be configured in the
- server or created at runtime.
- </doc>
-
- <doc type="grammar">
- exchange = C:DECLARE
- / C:DELETE
- / C:QUERY
- </doc>
-
- <rule name="required-types">
- <doc>
- The server MUST implement these standard exchange types: fanout, direct.
- </doc>
- <doc type="scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
-
- <rule name="recommended-types">
- <doc>
- The server SHOULD implement these standard exchange types: topic, headers.
- </doc>
- <doc type="scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
-
- <rule name="required-instances">
- <doc>
- The server MUST, in each virtual host, pre-declare an exchange instance for each standard
- exchange type that it implements, where the name of the exchange instance, if defined, is
- "amq." followed by the exchange type name.
-
- The server MUST, in each virtual host, pre-declare at least two direct exchange instances:
- one named "amq.direct", the other with no public name that serves as a default exchange for
- publish commands (such as message.transfer).
- </doc>
- <doc type="scenario">
- Client creates a temporary queue and attempts to bind to each required exchange instance
- ("amq.fanout", "amq.direct", "amq.topic", and "amq.headers" if those types are defined).
- </doc>
- </rule>
-
- <rule name="default-exchange">
- <doc>
- The server MUST pre-declare a direct exchange with no public name to act as the default
- exchange for content publish commands (such as message.transfer) and for default queue
- bindings.
- </doc>
- <doc type="scenario">
- Client checks that the default exchange is active by publishing a message with a suitable
- routing key but without specifying the exchange name, then ensuring that the message arrives
- in the queue correctly.
- </doc>
- </rule>
-
- <rule name="default-access">
- <doc>
- The default exchange MUST NOT be accessible to the client except by specifying an empty
- exchange name in a content publish command (such as message.transfer). That is, the server
- must not let clients explicitly bind, unbind, delete, or make any other reference to this
- exchange.
- </doc>
- </rule>
-
- <rule name="extensions">
- <doc>
- The server MAY implement other exchange types as wanted.
- </doc>
- </rule>
-
- <role name="server" implement="MUST" />
- <role name="client" implement="MUST" />
-
- <domain name="name" type="str8" label="exchange name">
- <doc>
- The exchange name is a client-selected string that identifies the exchange for publish
- commands. Exchange names may consist of any mixture of digits, letters, and underscores.
- Exchange names are scoped by the virtual host.
- </doc>
- </domain>
-
- <!-- - Command: exchange.declare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="declare" code="0x1" label="verify exchange exists, create if needed">
- <doc>
- This command creates an exchange if it does not already exist, and if the exchange exists,
- verifies that it is of the correct and expected class.
- </doc>
-
- <rule name="minimum">
- <doc>
- The server SHOULD support a minimum of 16 exchanges per virtual host and ideally, impose
- no limit except as defined by available resources.
- </doc>
- <doc type="scenario">
- The client creates as many exchanges as it can until the server reports an error; the
- number of exchanges successfully created must be at least sixteen.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="exchange" type="name" required="true">
- <exception name="reserved-names" error-code="not-allowed">
- <doc>
- Exchange names starting with "amq." are reserved for pre-declared and standardized
- exchanges. The client MUST NOT attempt to create an exchange starting with "amq.".
- </doc>
- </exception>
-
- <exception name="exchange-name-required" error-code="invalid-argument">
- <doc>
- The name of the exchange MUST NOT be a blank or empty string.
- </doc>
- </exception>
- </field>
-
- <field name="type" type="str8" label="exchange type" required="true">
- <doc>
- Each exchange belongs to one of a set of exchange types implemented by the server. The
- exchange types define the functionality of the exchange - i.e. how messages are routed
- through it. It is not valid or meaningful to attempt to change the type of an existing
- exchange.
- </doc>
-
- <exception name="typed" error-code="not-allowed">
- <doc>
- Exchanges cannot be redeclared with different types. The client MUST NOT attempt to
- redeclare an existing exchange with a different type than used in the original
- exchange.declare command.
- </doc>
- </exception>
-
- <exception name="exchange-type-not-found" error-code="not-found">
- <doc>
- If the client attempts to create an exchange which the server does not recognize, an
- exception MUST be sent.
- </doc>
- </exception>
- </field>
-
- <field name="alternate-exchange" type="name" label= "exchange name for unroutable messages">
- <doc>
- In the event that a message cannot be routed, this is the name of the exchange to which
- the message will be sent. Messages transferred using message.transfer will be routed to
- the alternate-exchange only if they are sent with the "none" accept-mode, and the
- discard-unroutable delivery property is set to false, and there is no queue to route to
- for the given message according to the bindings on this exchange.
- </doc>
-
- <rule name="empty-name">
- <doc>
- If alternate-exchange is not set (its name is an empty string), unroutable messages
- that would be sent to the alternate-exchange MUST be dropped silently.
- </doc>
- </rule>
-
- <exception name="pre-existing-exchange" error-code="not-allowed">
- <doc>
- If the alternate-exchange is not empty and if the exchange already exists with a
- different alternate-exchange, then the declaration MUST result in an exception.
- </doc>
- </exception>
-
- <rule name="double-failure">
- <doc>
- A message which is being routed to a alternate exchange, MUST NOT be re-routed to a
- secondary alternate exchange if it fails to route in the primary alternate exchange.
- After such a failure, the message MUST be dropped. This prevents looping.
- </doc>
- </rule>
- </field>
-
- <field name="passive" type="bit" label="do not create exchange">
- <doc>
- If set, the server will not create the exchange. The client can use this to check whether
- an exchange exists without modifying the server state.
- </doc>
- <exception name="not-found" error-code="not-found">
- <doc>
- If set, and the exchange does not already exist, the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="durable" type="bit" label="request a durable exchange">
- <doc>
- If set when creating a new exchange, the exchange will be marked as durable. Durable
- exchanges remain active when a server restarts. Non-durable exchanges (transient
- exchanges) are purged if/when a server restarts.
- </doc>
-
- <rule name="support">
- <doc>
- The server MUST support both durable and transient exchanges.
- </doc>
- </rule>
-
- <rule name="sticky">
- <doc>
- The server MUST ignore the durable field if the exchange already exists.
- </doc>
- </rule>
- </field>
-
- <field name="auto-delete" type="bit" label="auto-delete when unused">
- <doc>
- If set, the exchange is deleted automatically when there remain no bindings between the
- exchange and any queue. Such an exchange will not be automatically deleted until at least
- one binding has been made to prevent the immediate deletion of the exchange upon creation.
- </doc>
- <rule name="sticky">
- <doc>
- The server MUST ignore the auto-delete field if the exchange already exists.
- </doc>
- </rule>
- </field>
-
- <field name="arguments" type="map" label="arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these arguments
- depends on the server implementation. This field is ignored if passive is 1.
- </doc>
-
- <exception name="unknown-argument" error-code="not-implemented">
- <doc>
- If the arguments field contains arguments which are not understood by the server,
- it MUST raise an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: exchange.delete - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="delete" code="0x2" label="delete an exchange">
- <doc>
- This command deletes an exchange. When an exchange is deleted all queue bindings on the
- exchange are cancelled.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="exchange" type="name" required="true">
- <exception name="exists" error-code="not-found">
- <doc>
- The client MUST NOT attempt to delete an exchange that does not exist.
- </doc>
- </exception>
-
- <exception name="exchange-name-required" error-code="invalid-argument">
- <doc>
- The name of the exchange MUST NOT be a missing or empty string.
- </doc>
- </exception>
-
- <exception name="used-as-alternate" error-code="not-allowed">
- <doc>
- An exchange MUST NOT be deleted if it is in use as an alternate-exchange by a queue or
- by another exchange.
- </doc>
- </exception>
-
- </field>
-
- <field name="if-unused" type="bit" label="delete only if unused">
- <doc>
- If set, the server will only delete the exchange if it has no queue bindings. If the
- exchange has queue bindings the server does not delete it but raises an exception
- instead.
- </doc>
- <exception name="exchange-in-use" error-code="precondition-failed">
- <doc>
- If the exchange has queue bindings, and the if-unused flag is set, the server MUST NOT
- delete the exchange, but MUST raise and exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: exchange.query - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="query" code="0x3" label="request information about an exchange">
- <doc>
- This command is used to request information on a particular exchange.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="name" type="str8" label="the exchange name">
- <doc>
- The name of the exchange for which information is requested. If not specified explicitly
- the default exchange is implied.
- </doc>
- </field>
-
- <result>
- <struct name="exchange-query-result" size="4" code="0x1" pack="2">
- <doc>
- This is sent in response to a query request and conveys information on a particular
- exchange.
- </doc>
-
- <field name="type" type="str8" label="indicate the exchange type">
- <doc>
- The type of the exchange. Will be empty if the exchange is not found.
- </doc>
- </field>
-
- <field name="durable" type="bit" label="indicate the durability">
- <doc>
- The durability of the exchange, i.e. if set the exchange is durable. Will not be set
- if the exchange is not found.
- </doc>
- </field>
-
- <field name="not-found" type="bit" label="indicate an unknown exchange">
- <doc>
- If set, the exchange for which information was requested is not known.
- </doc>
- </field>
-
- <field name="arguments" type="map" label="other unspecified exchange properties">
- <doc>
- A set of properties of the exchange whose syntax and semantics depends on the server
- implementation. Will be empty if the exchange is not found.
- </doc>
- </field>
- </struct>
- </result>
- </command>
-
- <!-- - Command: exchange.bind - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="bind" code="0x4" label="bind queue to an exchange">
- <doc> This command binds a queue to an exchange. Until a queue is bound it will not receive
- any messages. In a classic messaging model, store-and-forward queues are bound to a direct
- exchange and subscription queues are bound to a topic exchange. </doc>
-
- <rule name="duplicates">
- <doc>
- A server MUST ignore duplicate bindings - that is, two or more bind commands with the
- same exchange, queue, and binding-key - without treating these as an error. The value of
- the arguments used for the binding MUST NOT be altered by subsequent binding requests.
- </doc>
- <doc type="scenario">
- A client binds a named queue to an exchange. The client then repeats the bind (with
- identical exchange, queue, and binding-key). The second binding should use a different
- value for the arguments field.
- </doc>
- </rule>
-
- <rule name="durable-exchange">
- <doc> Bindings between durable queues and durable exchanges are automatically durable and
- the server MUST restore such bindings after a server restart. </doc>
- <doc type="scenario"> A server creates a named durable queue and binds it to a durable
- exchange. The server is restarted. The client then attempts to use the queue/exchange
- combination. </doc>
- </rule>
-
- <rule name="binding-count">
- <doc> The server SHOULD support at least 4 bindings per queue, and ideally, impose no limit
- except as defined by available resources. </doc>
- <doc type="scenario"> A client creates a named queue and attempts to bind it to 4 different
- exchanges. </doc>
- </rule>
-
- <rule name="multiple-bindings">
- <doc> Where more than one binding exists between a particular exchange instance and a
- particular queue instance any given message published to that exchange should be delivered
- to that queue at most once, regardless of how many distinct bindings match. </doc>
- <doc type="scenario"> A client creates a named queue and binds it to the same topic exchange
- at least three times using intersecting binding-keys (for example, "animals.*",
- "animals.dogs.*", "animal.dogs.chihuahua"). Verify that a message matching all the
- bindings (using previous example, routing key = "animal.dogs.chihuahua") is delivered once
- only. </doc>
- </rule>
-
- <implement role="server" handle="MUST"/>
-
- <field name="queue" type="queue.name" required="true">
- <doc> Specifies the name of the queue to bind. </doc>
-
- <exception name="empty-queue" error-code="invalid-argument">
- <doc> A client MUST NOT be allowed to bind a non-existent and unnamed queue (i.e. empty
- queue name) to an exchange. </doc>
- <doc type="scenario"> A client attempts to bind with an unnamed (empty) queue name to an
- exchange. </doc>
- </exception>
-
- <exception name="queue-existence" error-code="not-found">
- <doc> A client MUST NOT be allowed to bind a non-existent queue (i.e. not previously
- declared) to an exchange. </doc>
- <doc type="scenario"> A client attempts to bind an undeclared queue name to an exchange.
- </doc>
- </exception>
- </field>
-
- <field name="exchange" type="name" label="name of the exchange to bind to" required="true">
- <exception name="exchange-existence" error-code="not-found">
- <doc> A client MUST NOT be allowed to bind a queue to a non-existent exchange. </doc>
- <doc type="scenario"> A client attempts to bind a named queue to a undeclared exchange.
- </doc>
- </exception>
-
- <exception name="exchange-name-required" error-code="invalid-argument">
- <doc> The name of the exchange MUST NOT be a blank or empty string. </doc>
- </exception>
- </field>
-
- <field name="binding-key" type="str8"
- label="identifies a binding between a given exchange and queue" required="true">
- <doc> The binding-key uniquely identifies a binding between a given (exchange, queue) pair.
- Depending on the exchange configuration, the binding key may be matched against the
- message routing key in order to make routing decisions. The match algorithm depends on the
- exchange type. Some exchange types may ignore the binding key when making routing
- decisions. Refer to the specific exchange type documentation. The meaning of an empty
- binding key depends on the exchange implementation. </doc>
- </field>
-
- <field name="arguments" type="map" label="arguments for binding">
- <doc> A set of arguments for the binding. The syntax and semantics of these arguments
- depends on the exchange class. </doc>
-
- <exception name="unknown-argument" error-code="not-implemented">
- <doc> If the arguments field contains arguments which are not understood by the server, it
- MUST raise an exception. </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: exchange.unbind - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="unbind" code="0x5" label="unbind a queue from an exchange">
- <doc>
- This command unbinds a queue from an exchange.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="queue" type="queue.name" required="true">
- <doc>
- Specifies the name of the queue to unbind.
- </doc>
- <exception name="non-existent-queue" error-code="not-found">
- <doc>
- If the queue does not exist the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="exchange" type="name" required="true">
- <doc>
- The name of the exchange to unbind from.
- </doc>
-
- <exception name="non-existent-exchange" error-code="not-found">
- <doc>
- If the exchange does not exist the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="exchange-name-required" error-code="invalid-argument">
- <doc>
- The name of the exchange MUST NOT be a blank or empty string.
- </doc>
- </exception>
- </field>
-
- <field name="binding-key" type="str8" label="the key of the binding" required="true">
- <doc>
- Specifies the binding-key of the binding to unbind.
- </doc>
-
- <exception name="non-existent-binding-key" error-code="not-found">
- <doc>
- If there is no matching binding-key the server MUST raise an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: exchange.bound - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="bound" code="0x6" label="request information about bindings to an exchange">
- <doc>
- This command is used to request information on the bindings to a particular exchange.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="exchange" type="str8" label="the exchange name">
- <doc>
- The name of the exchange for which binding information is being requested. If not
- specified explicitly the default exchange is implied.
- </doc>
- </field>
-
- <field name="queue" type="str8" label="a queue name" required="true">
- <doc>
- If populated then determine whether the given queue is bound to the exchange.
- </doc>
- </field>
-
- <field name="binding-key" type="str8" label="a binding-key">
- <doc>
- If populated defines the binding-key of the binding of interest, if not populated the
- request will ignore the binding-key on bindings when searching for a match.
- </doc>
- </field>
-
- <field name="arguments" type="map" label="a set of binding arguments">
- <doc>
- If populated defines the arguments of the binding of interest if not populated the request
- will ignore the arguments on bindings when searching for a match
- </doc>
- </field>
-
- <result>
- <struct name="exchange-bound-result" size="4" code="0x2" pack="2">
- <field name="exchange-not-found" type="bit" label="indicate an unknown exchange">
- <doc>
- If set, the exchange for which information was requested is not known.
- </doc>
- </field>
-
- <field name="queue-not-found" type="bit" label="indicate an unknown queue">
- <doc>
- If set, the queue specified is not known.
- </doc>
- </field>
-
- <field name="queue-not-matched" type="bit" label="indicate no matching queue">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange to
- the specified queue.
- </doc>
- </field>
-
- <field name="key-not-matched" type="bit" label="indicate no matching binding-key">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange
- with the specified binding-key.
- </doc>
- </field>
-
- <field name="args-not-matched" type="bit" label="indicate no matching arguments">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange
- with the specified arguments.
- </doc>
- </field>
- </struct>
- </result>
- </command>
-
- </class>
-
- <!-- == Class: queue ========================================================================= -->
-
- <class name="queue" code="0x8" label="work with queues">
- <doc>
- Queues store and forward messages. Queues can be configured in the server or created at
- runtime. Queues must be attached to at least one exchange in order to receive messages from
- publishers.
- </doc>
-
- <doc type="grammar">
- queue = C:DECLARE
- / C:BIND
- / C:PURGE
- / C:DELETE
- / C:QUERY
- / C:UNBIND
- </doc>
-
- <rule name="any-content">
- <doc>
- A server MUST allow any content class to be sent to any queue, in any mix, and queue and
- deliver these content classes independently. Note that all commands that fetch content off
- queues are specific to a given content class.
- </doc>
- <doc type="scenario">
- Client creates an exchange of each standard type and several queues that it binds to each
- exchange. It must then successfully send each of the standard content types to each of the
- available queues.
- </doc>
- </rule>
-
- <role name="server" implement="MUST" />
- <role name="client" implement="MUST" />
-
- <domain name="name" type="str8" label="queue name">
- <doc>
- The queue name identifies the queue within the virtual host. Queue names must have a length
- of between 1 and 255 characters inclusive, must start with a digit, letter or underscores
- ('_') character, and must be otherwise encoded in UTF-8.
- </doc>
- </domain>
-
- <!-- - Command: queue.declare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="declare" code="0x1" label="declare queue">
- <doc>
- This command creates or checks a queue. When creating a new queue the client can specify
- various properties that control the durability of the queue and its contents, and the level
- of sharing for the queue.
- </doc>
-
- <rule name="default-binding">
- <doc>
- The server MUST create a default binding for a newly-created queue to the default
- exchange, which is an exchange of type 'direct' and use the queue name as the binding-key.
- </doc>
- <doc type="scenario">
- Client creates a new queue, and then without explicitly binding it to an exchange,
- attempts to send a message through the default exchange binding, i.e. publish a message to
- the empty exchange, with the queue name as binding-key.
- </doc>
- </rule>
-
- <rule name="minimum-queues">
- <doc>
- The server SHOULD support a minimum of 256 queues per virtual host and ideally, impose no
- limit except as defined by available resources.
- </doc>
- <doc type="scenario">
- Client attempts to create as many queues as it can until the server reports an error. The
- resulting count must at least be 256.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="queue" type="name" required="true">
- <exception name="reserved-prefix" error-code="not-allowed">
- <doc>
- Queue names starting with "amq." are reserved for pre-declared and standardized server
- queues. A client MUST NOT attempt to declare a queue with a name that starts with "amq."
- and the passive option set to zero.
- </doc>
- <doc type="scenario">
- A client attempts to create a queue with a name starting with "amq." and with the
- passive option set to zero.
- </doc>
- </exception>
- </field>
-
- <field name="alternate-exchange" type="exchange.name"
- label= "exchange name for messages with exceptions">
- <doc>
- The alternate-exchange field specifies how messages on this queue should be treated when
- they are rejected by a subscriber, or when they are orphaned by queue deletion. When
- present, rejected or orphaned messages MUST be routed to the alternate-exchange. In all
- cases the messages MUST be removed from the queue.
- </doc>
-
- <exception name="pre-existing-exchange" error-code="not-allowed">
- <doc>
- If the alternate-exchange is not empty and if the queue already exists with a different
- alternate-exchange, then the declaration MUST result in an exception.
- </doc>
- </exception>
-
- <exception name="unknown-exchange" error-code="not-found">
- <doc>
- if the alternate-exchange does not match the name of any existing exchange on the
- server, then an exception must be raised.
- </doc>
- </exception>
- </field>
-
- <field name="passive" type="bit" label="do not create queue">
- <doc>
- If set, the server will not create the queue. This field allows the client to assert the
- presence of a queue without modifying the server state.
- </doc>
-
- <exception name="passive" error-code="not-found">
- <doc>
- The client MAY ask the server to assert that a queue exists without creating the queue
- if not. If the queue does not exist, the server treats this as a failure.
- </doc>
- <doc type="scenario">
- Client declares an existing queue with the passive option and expects the command to
- succeed. Client then attempts to declare a non-existent queue with the passive option,
- and the server must close the session with the correct exception.
- </doc>
- </exception>
- </field>
-
- <field name="durable" type="bit" label="request a durable queue">
- <doc>
- If set when creating a new queue, the queue will be marked as durable. Durable queues
- remain active when a server restarts. Non-durable queues (transient queues) are purged
- if/when a server restarts. Note that durable queues do not necessarily hold persistent
- messages, although it does not make sense to send persistent messages to a transient
- queue.
- </doc>
-
- <rule name="persistence">
- <doc>
- The queue definition MUST survive the server losing all transient memory, e.g. a
- machine restart.
- </doc>
- <doc type="scenario">
- Client creates a durable queue; server is then restarted. Client then attempts to send
- message to the queue. The message should be successfully delivered.
- </doc>
- </rule>
-
- <rule name="types">
- <doc>
- The server MUST support both durable and transient queues.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one durable and one transient.
- </doc>
- </rule>
-
- <rule name="pre-existence">
- <doc>
- The server MUST ignore the durable field if the queue already exists.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one durable and one transient. The client then
- attempts to declare the two queues using the same names again, but reversing the value
- of the durable flag in each case. Verify that the queues still exist with the original
- durable flag values.
- </doc>
- </rule>
- </field>
-
- <field name="exclusive" type="bit" label="request an exclusive queue">
- <doc>
- Exclusive queues can only be used from one session at a time. Once a session
- declares an exclusive queue, that queue cannot be used by any other session until the
- declaring session closes.
- </doc>
-
- <rule name="types">
- <doc>
- The server MUST support both exclusive (private) and non-exclusive (shared) queues.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one exclusive and one non-exclusive.
- </doc>
- </rule>
-
- <exception name="in-use" error-code="resource-locked">
- <doc>
- If the server receives a declare, bind, consume or get request for a queue that has been
- declared as exclusive by an existing client session, it MUST raise an exception.
- </doc>
- <doc type="scenario">
- A client declares an exclusive named queue. A second client on a different session
- attempts to declare a queue of the same name.
- </doc>
- </exception>
- </field>
-
- <field name="auto-delete" type="bit" label="auto-delete queue when unused">
- <doc>
- If this field is set and the exclusive field is also set, then the queue MUST be deleted
- when the session closes.
-
- If this field is set and the exclusive field is not set the queue is deleted when all
- the consumers have finished using it. Last consumer can be cancelled either explicitly
- or because its session is closed. If there was no consumer ever on the queue, it won't
- be deleted.
- </doc>
-
- <rule name="pre-existence">
- <doc>
- The server MUST ignore the auto-delete field if the queue already exists.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one as auto-delete and one explicit-delete. The
- client then attempts to declare the two queues using the same names again, but reversing
- the value of the auto-delete field in each case. Verify that the queues still exist with
- the original auto-delete flag values.
- </doc>
- </rule>
- </field>
-
- <field name="arguments" type="map" label="arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these arguments
- depends on the server implementation. This field is ignored if passive is 1.
- </doc>
-
- <exception name="unknown-argument" error-code="not-implemented">
- <doc>
- If the arguments field contains arguments which are not understood by the server,
- it MUST raise an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: queue.delete - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="delete" code="0x2" label="delete a queue">
- <doc>
- This command deletes a queue. When a queue is deleted any pending messages are sent to the
- alternate-exchange if defined, or discarded if it is not.
- </doc>
-
-
- <implement role="server" handle="MUST" />
-
- <field name="queue" type="name" required="true">
- <doc>
- Specifies the name of the queue to delete.
- </doc>
-
- <exception name="empty-name" error-code="invalid-argument">
- <doc>
- If the queue name in this command is empty, the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="queue-exists" error-code="not-found">
- <doc>
- The queue must exist. If the client attempts to delete a non-existing queue the server
- MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="if-unused" type="bit" label="delete only if unused">
- <doc>
- If set, the server will only delete the queue if it has no consumers. If the queue has
- consumers the server does does not delete it but raises an exception instead.
- </doc>
-
- <exception name="if-unused-flag" error-code="precondition-failed">
- <doc>
- The server MUST respect the if-unused flag when deleting a queue.
- </doc>
- </exception>
- </field>
-
- <field name="if-empty" type="bit" label="delete only if empty">
- <doc>
- If set, the server will only delete the queue if it has no messages.
- </doc>
- <exception name="not-empty" error-code="precondition-failed">
- <doc>
- If the queue is not empty the server MUST raise an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: queue.purge - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="purge" code="0x3" label="purge a queue">
- <doc>
- This command removes all messages from a queue. It does not cancel subscribers. Purged
- messages are deleted without any formal "undo" mechanism.
- </doc>
-
- <rule name="empty">
- <doc>
- A call to purge MUST result in an empty queue.
- </doc>
- </rule>
-
- <rule name="pending-messages">
- <doc>
- The server MUST NOT purge messages that have already been sent to a client but not yet
- accepted.
- </doc>
- </rule>
-
- <rule name="purge-recovery">
- <doc>
- The server MAY implement a purge queue or log that allows system administrators to recover
- accidentally-purged messages. The server SHOULD NOT keep purged messages in the same
- storage spaces as the live messages since the volumes of purged messages may get very
- large.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="queue" type="name" required="true">
- <doc>
- Specifies the name of the queue to purge.
- </doc>
-
- <exception name="empty-name" error-code="invalid-argument">
- <doc>
- If the the queue name in this command is empty, the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="queue-exists" error-code="not-found">
- <doc>
- The queue MUST exist. Attempting to purge a non-existing queue MUST cause an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: queue.query - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="query" code="0x4" label="request information about a queue">
- <doc>
- This command requests information about a queue.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="queue" type="name" label="the queried queue" required="true"/>
-
- <result>
- <struct name="queue-query-result" size="4" code="0x1" pack="2">
- <doc>
- This is sent in response to queue.query, and conveys the requested information about a
- queue. If no queue with the specified name exists then none of the fields within the
- returned result struct will be populated.
- </doc>
-
- <field name="queue" type="name" required="true">
- <doc>
- Reports the name of the queue.
- </doc>
- </field>
-
- <field name="alternate-exchange" type="exchange.name" />
-
- <field name="durable" type="bit" />
-
- <field name="exclusive" type="bit" />
-
- <field name="auto-delete" type="bit" />
-
- <field name="arguments" type="map" />
-
- <field name="message-count" type="uint32" label="number of messages in queue"
- required="true">
- <doc> Reports the number of messages in the queue. </doc>
- </field>
-
- <field name="subscriber-count" type="uint32" label="number of subscribers"
- required="true">
- <doc>
- Reports the number of subscribers for the queue.
- </doc>
- </field>
- </struct>
- </result>
- </command>
-
- </class>
-
- <!-- == Class: file ========================================================================== -->
-
- <class name="file" code="0x9" label="work with file content">
- <doc>
- The file class provides commands that support reliable file transfer. File messages have a
- specific set of properties that are required for interoperability with file transfer
- applications. File messages and acknowledgements are subject to session transactions. Note
- that the file class does not provide message browsing commands; these are not compatible with
- the staging model. Applications that need browsable file transfer should use Message content
- and the Message class.
- </doc>
-
- <doc type="grammar">
- file = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL
- / C:OPEN S:OPEN-OK C:STAGE content
- / S:OPEN C:OPEN-OK S:STAGE content
- / C:PUBLISH
- / S:DELIVER
- / S:RETURN
- / C:ACK
- / C:REJECT
- </doc>
-
- <rule name="reliable-storage">
- <doc>
- The server MUST make a best-effort to hold file messages on a reliable storage mechanism.
- </doc>
- </rule>
-
- <rule name="no-discard">
- <doc>
- The server MUST NOT discard a file message in case of a queue overflow. The server MUST use
- the Session.Flow command to slow or stop a file message publisher when necessary.
- </doc>
- </rule>
-
- <rule name="priority-levels">
- <doc>
- The server MUST implement at least 2 priority levels for file messages, where priorities 0-4
- and 5-9 are treated as two distinct levels. The server MAY implement up to 10 priority
- levels.
- </doc>
- </rule>
-
- <rule name="acknowledgement-support">
- <doc>
- The server MUST support both automatic and explicit acknowledgements on file content.
- </doc>
- </rule>
-
- <role name="server" implement="MAY" />
- <role name="client" implement="MAY" />
-
- <!-- These are the properties for a File content -->
- <struct name="file-properties" size="4" code="0x1" pack="2">
- <field name="content-type" type="str8" label="MIME content type" />
- <field name="content-encoding" type="str8" label="MIME content encoding" />
- <field name="headers" type="map" label="message header field table" />
- <field name="priority" type="uint8" label="message priority, 0 to 9" />
- <field name="reply-to" type="str8" label="destination to reply to" />
- <field name="message-id" type="str8" label="application message identifier" />
- <field name="filename" type="str8" label="message filename" />
- <field name="timestamp" type="datetime" label="message timestamp" />
- <!-- This field is deprecated pending review -->
- <field name="cluster-id" type="str8" label="intra-cluster routing identifier" />
- </struct>
-
- <domain name="return-code" type="uint16" label="return code from server">
- <doc>
- The return code. The AMQP return codes are defined by this enum.
- </doc>
- <enum>
- <choice name="content-too-large" value="311">
- <doc>
- The client attempted to transfer content larger than the server could accept.
- </doc>
- </choice>
-
- <choice name="no-route" value="312">
- <doc>
- The exchange cannot route a message, most likely due to an invalid routing key. Only
- when the mandatory flag is set.
- </doc>
- </choice>
-
- <choice name="no-consumers" value="313">
- <doc>
- The exchange cannot deliver to a consumer when the immediate flag is set. As a result of
- pending data on the queue or the absence of any consumers of the queue.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <!-- - Command: file.qos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="qos" code="0x1" label="specify quality of service">
- <doc>
- This command requests a specific quality of service. The QoS can be specified for the
- current session or for all sessions on the connection. The particular properties and
- semantics of a qos command always depend on the content class semantics. Though the qos
- command could in principle apply to both peers, it is currently meaningful only for the
- server.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <response name="qos-ok" />
-
- <field name="prefetch-size" type="uint32" label="pre-fetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client finishes
- processing a message, the following message is already held locally, rather than needing
- to be sent within the session. Pre-fetching gives a performance improvement. This field
- specifies the pre-fetch window size in octets. May be set to zero, meaning "no specific
- limit". Note that other pre-fetch limits may still apply. The prefetch-size is ignored if
- the no-ack option is set.
- </doc>
- </field>
-
- <field name="prefetch-count" type="uint16" label="pre-fetch window in messages">
- <doc>
- Specifies a pre-fetch window in terms of whole messages. This is compatible with some file
- API implementations. This field may be used in combination with the prefetch-size field; a
- message will only be sent in advance if both pre-fetch windows (and those at the session
- and connection level) allow it. The prefetch-count is ignored if the no-ack option is set.
- </doc>
-
- <rule name="prefetch-discretion">
- <doc>
- The server MAY send less data in advance than allowed by the client's specified
- pre-fetch windows but it MUST NOT send more.
- </doc>
- </rule>
- </field>
-
- <field name="global" type="bit" label="apply to entire connection">
- <doc>
- By default the QoS settings apply to the current session only. If this field is set, they
- are applied to the entire connection.
- </doc>
- </field>
- </command>
-
- <!-- - Command: file.qos-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="qos-ok" code="0x2" label="confirm the requested qos">
- <doc>
- This command tells the client that the requested QoS levels could be handled by the server.
- The requested QoS applies to all active consumers until a new QoS is defined.
- </doc>
-
- <implement role="client" handle="MUST" />
- </command>
-
- <!-- - Command: file.consume - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="consume" code="0x3" label="start a queue consumer">
- <doc>
- This command asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the session they were created on,
- or until the client cancels them.
- </doc>
-
- <rule name="min-consumers">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was declared
- as private, and ideally, impose no limit except as defined by available resources.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <response name="consume-ok" />
-
- <field name="queue" type="queue.name">
- <doc>
- Specifies the name of the queue to consume from.
- </doc>
-
- <exception name="queue-exists-if-empty" error-code="not-allowed">
- <doc>
- If the queue name in this command is empty, the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="consumer-tag" type="str8">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a connection, so
- two clients can use the same consumer tags.
- </doc>
-
- <exception name="not-existing-consumer" error-code="not-allowed">
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to create two
- consumers with the same non-empty tag the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-empty-consumer-tag" error-code="not-allowed">
- <doc>
- The client MUST NOT specify a tag that is empty or blank.
- </doc>
- <doc type="scenario">
- Attempt to create a consumers with an empty tag.
- </doc>
- </exception>
- </field>
-
- <field name="no-local" type="bit">
- <doc>If the no-local field is set the server will not send messages to the connection that
- published them.</doc>
- </field>
-
- <field name="no-ack" type="bit" label="no acknowledgement needed">
- <doc>
- If this field is set the server does not expect acknowledgements for messages. That is,
- when a message is delivered to the client the server automatically and silently
- acknowledges it on behalf of the client. This functionality increases performance but at
- the cost of reliability. Messages can get lost if a client dies before it can deliver them
- to the application.
- </doc>
- </field>
-
- <field name="exclusive" type="bit" label="request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the queue.
- </doc>
-
- <exception name="in-use" error-code="resource-locked">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, - because there are
- other consumers active - it MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="nowait" type="bit" label="do not send a reply command">
- <doc>
- If set, the server will not respond to the command. The client should not wait for a reply
- command. If the server could not complete the command it will raise an exception.
- </doc>
- </field>
-
- <field name="arguments" type="map" label="arguments for consuming">
- <doc>
- A set of arguments for the consume. The syntax and semantics of these arguments depends on
- the providers implementation.
- </doc>
- </field>
- </command>
-
- <command name="consume-ok" code="0x4" label="confirm a new consumer">
- <doc>
- This command provides the client with a consumer tag which it MUST use in commands that work
- with the consumer.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="consumer-tag" type="str8">
- <doc>
- Holds the consumer tag specified by the client or provided by the server.
- </doc>
- </field>
- </command>
-
- <!-- - Command: file.cancel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="cancel" code="0x5" label="end a queue consumer">
- <doc>
- This command cancels a consumer. This does not affect already delivered messages, but it
- does mean the server will not send any more messages for that consumer.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="consumer-tag" type="str8">
- <doc>
- the identifier of the consumer to be cancelled.
- </doc>
- </field>
- </command>
-
- <!-- - Command: file.open - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="open" code="0x6" label="request to start staging">
- <doc>
- This command requests permission to start staging a message. Staging means sending the
- message into a temporary area at the recipient end and then delivering the message by
- referring to this temporary area. Staging is how the protocol handles partial file transfers
- - if a message is partially staged and the connection breaks, the next time the sender
- starts to stage it, it can restart from where it left off.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <response name="open-ok" />
-
- <field name="identifier" type="str8" label="staging identifier">
- <doc>
- This is the staging identifier. This is an arbitrary string chosen by the sender. For
- staging to work correctly the sender must use the same staging identifier when staging the
- same message a second time after recovery from a failure. A good choice for the staging
- identifier would be the SHA1 hash of the message properties data (including the original
- filename, revised time, etc.).
- </doc>
- </field>
-
- <field name="content-size" type="uint64" label="message content size">
- <doc>
- The size of the content in octets. The recipient may use this information to allocate or
- check available space in advance, to avoid "disk full" errors during staging of very large
- messages.
- </doc>
-
- <rule name="content-size">
- <doc>
- The sender MUST accurately fill the content-size field. Zero-length content is
- permitted.
- </doc>
- </rule>
- </field>
- </command>
-
- <!-- - Command: file.open-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="open-ok" code="0x7" label="confirm staging ready">
- <doc>
- This command confirms that the recipient is ready to accept staged data. If the message was
- already partially-staged at a previous time the recipient will report the number of octets
- already staged.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <response name="stage" />
-
- <field name="staged-size" type="uint64" label="already staged amount">
- <doc>
- The amount of previously-staged content in octets. For a new message this will be zero.
- </doc>
-
- <rule name="behavior">
- <doc>
- The sender MUST start sending data from this octet offset in the message, counting from
- zero.
- </doc>
- </rule>
-
- <rule name="staging">
- <doc>
- The recipient MAY decide how long to hold partially-staged content and MAY implement
- staging by always discarding partially-staged content. However if it uses the file
- content type it MUST support the staging commands.
- </doc>
- </rule>
- </field>
- </command>
-
- <!-- - Command: file.stage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="stage" code="0x8" label="stage message content">
- <doc>
- This command stages the message, sending the message content to the recipient from the octet
- offset specified in the Open-Ok command.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <segments>
- <header required="true">
- <entry type="file-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- <!-- - Command: file.publish - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="publish" code="0x9" label="publish a message">
- <doc>
- This command publishes a staged file message to a specific exchange. The file message will
- be routed to queues as defined by the exchange configuration and distributed to any active
- consumers when the transaction, if any, is committed.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be empty, meaning
- the default exchange. If the exchange name is specified, and that exchange does not exist,
- the server will raise an exception.
- </doc>
-
- <rule name="default">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <exception name="refusal" error-code="not-implemented">
- <doc>
- The exchange MAY refuse file content in which case it MUST send an exception.
- </doc>
- </exception>
- </field>
-
- <field name="routing-key" type="str8" label="Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing messages
- depending on the exchange configuration.
- </doc>
- </field>
-
- <field name="mandatory" type="bit" label="indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue. If
- this flag is set, the server will return an unroutable message with a Return command. If
- this flag is zero, the server silently drops the message.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the mandatory flag.
- </doc>
- </rule>
- </field>
-
- <field name="immediate" type="bit" label="request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue
- consumer immediately. If this flag is set, the server will return an undeliverable message
- with a Return command. If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the immediate flag.
- </doc>
- </rule>
- </field>
-
- <field name="identifier" type="str8" label="staging identifier">
- <doc>
- This is the staging identifier of the message to publish. The message must have been
- staged. Note that a client can send the Publish command asynchronously without waiting for
- staging to finish.
- </doc>
- </field>
- </command>
-
- <!-- - Command: file.return - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="return" code="0xa" label="return a failed message">
- <doc>
- This command returns an undeliverable message that was published with the "immediate" flag
- set, or an unroutable message published with the "mandatory" flag set. The reply code and
- text provide information about the reason that the message was undeliverable.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="reply-code" type="return-code" />
-
- <field name="reply-text" type="str8" label="The localized reply text.">
- <doc>
- This text can be logged as an aid to resolving issues.
- </doc>
- </field>
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="routing-key" type="str8" label="Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
-
- <segments>
- <header required="true">
- <entry type="file-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- <!-- - Command: file.deliver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="deliver" code="0xb" label="notify the client of a consumer message">
- <doc>
- This command delivers a staged file message to the client, via a consumer. In the
- asynchronous message delivery model, the client starts a consumer using the consume command,
- then the server responds with Deliver commands as and when messages arrive for that
- consumer.
- </doc>
-
- <rule name="redelivery-tracking">
- <doc>
- The server SHOULD track the number of times a message has been delivered to clients and
- when a message is redelivered a certain number of times - e.g. 5 times - without being
- acknowledged, the server SHOULD consider the message to be non-processable (possibly
- causing client applications to abort), and move the message to a dead letter queue.
- </doc>
- </rule>
-
- <implement role="client" handle="MUST" />
-
- <field name="consumer-tag" type="str8" />
-
- <field name="delivery-tag" type="uint64" >
- <doc>
- The server-assigned and session-specific delivery tag
- </doc>
-
- <rule name="non-zero">
- <doc>
- The server MUST NOT use a zero value for delivery tags. Zero is reserved for client use,
- meaning "all messages so far received".
- </doc>
- </rule>
- </field>
-
- <field name="redelivered" type="bit" label="Indicate possible duplicate delivery">
- <doc>
- This boolean flag indicates that the message may have been previously delivered to this
- or another client.
- </doc>
- </field>
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="routing-key" type="str8" label="Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
-
- <field name="identifier" type="str8" label="staging identifier">
- <doc>
- This is the staging identifier of the message to deliver. The message must have been
- staged. Note that a server can send the Deliver command asynchronously without waiting for
- staging to finish.
- </doc>
- </field>
- </command>
-
- <!-- - Command: file.ack - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="ack" code="0xc" label="acknowledge one or more messages">
- <doc>
- This command acknowledges one or more messages delivered via the Deliver command. The client
- can ask to confirm a single message or a set of messages up to and including a specific
- message.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="delivery-tag" type="uint64" >
- <doc>
- The identifier of the message being acknowledged
- </doc>
- <rule name="session-local">
- <doc>
- The delivery tag is valid only within the session from which the message was received.
- i.e. A client MUST NOT receive a message on one session and then acknowledge it on
- another.
- </doc>
- </rule>
- </field>
-
- <field name="multiple" type="bit" label="acknowledge multiple messages">
- <doc>
- If set to 1, the delivery tag is treated as "up to and including", so that the client can
- acknowledge multiple messages with a single command. If set to zero, the delivery tag
- refers to a single message. If the multiple field is 1, and the delivery tag is zero,
- tells the server to acknowledge all outstanding messages.
- </doc>
-
- <rule name="validation">
- <doc>
- The server MUST validate that a non-zero delivery-tag refers to an delivered message,
- and raise an exception if this is not the case.
- </doc>
- </rule>
- </field>
- </command>
-
- <!-- - Command: file.reject - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="reject" code="0xd" label="reject an incoming message">
- <doc>
- This command allows a client to reject a message. It can be used to return untreatable
- messages to their original queue. Note that file content is staged before delivery, so the
- client will not use this command to interrupt delivery of a large message.
- </doc>
-
- <rule name="server-interpretation">
- <doc>
- The server SHOULD interpret this command as meaning that the client is unable to process
- the message at this time.
- </doc>
- </rule>
-
- <rule name="not-selection">
- <doc>
- A client MUST NOT use this command as a means of selecting messages to process. A rejected
- message MAY be discarded or dead-lettered, not necessarily passed to another client.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="delivery-tag" type="uint64">
- <doc>
- the identifier of the message to be rejected
- </doc>
- <rule name="session-local">
- <doc>
- The delivery tag is valid only within the session from which the message was received.
- i.e. A client MUST NOT receive a message on one session and then reject it on another.
- </doc>
- </rule>
- </field>
-
- <field name="requeue" type="bit" label="requeue the message">
- <doc>
- If this field is zero, the message will be discarded. If this bit is 1, the server will
- attempt to requeue the message.
- </doc>
-
- <rule name="requeue-strategy">
- <doc>
- The server MUST NOT deliver the message to the same client within the context of the
- current session. The recommended strategy is to attempt to deliver the message to an
- alternative consumer, and if that is not possible, to move the message to a dead-letter
- queue. The server MAY use more sophisticated tracking to hold the message on the queue
- and redeliver it to the same client at a later stage.
- </doc>
- </rule>
- </field>
- </command>
-
- </class>
-
- <!-- == Class: stream ======================================================================== -->
-
- <class name="stream" code="0xa" label="work with streaming content">
- <doc>
- The stream class provides commands that support multimedia streaming. The stream class uses
- the following semantics: one message is one packet of data; delivery is unacknowledged and
- unreliable; the consumer can specify quality of service parameters that the server can try to
- adhere to; lower-priority messages may be discarded in favor of high priority messages.
- </doc>
-
- <doc type="grammar">
- stream = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL
- / C:PUBLISH content
- / S:RETURN
- / S:DELIVER content
- </doc>
-
- <rule name="overflow-discard">
- <doc>
- The server SHOULD discard stream messages on a priority basis if the queue size exceeds some
- configured limit.
- </doc>
- </rule>
-
- <rule name="priority-levels">
- <doc>
- The server MUST implement at least 2 priority levels for stream messages, where priorities
- 0-4 and 5-9 are treated as two distinct levels. The server MAY implement up to 10 priority
- levels.
- </doc>
- </rule>
-
- <rule name="acknowledgement-support">
- <doc>
- The server MUST implement automatic acknowledgements on stream content. That is, as soon as
- a message is delivered to a client via a Deliver command, the server must remove it from the
- queue.
- </doc>
- </rule>
-
- <role name="server" implement="MAY" />
- <role name="client" implement="MAY" />
-
- <!-- These are the properties for a Stream content -->
- <struct name="stream-properties" size="4" code="0x1" pack="2">
- <field name="content-type" type="str8" label="MIME content type" />
- <field name="content-encoding" type="str8" label="MIME content encoding" />
- <field name="headers" type="map" label="message header field table" />
- <field name="priority" type="uint8" label="message priority, 0 to 9" />
- <field name="timestamp" type="datetime" label="message timestamp" />
- </struct>
-
- <domain name="return-code" type="uint16" label="return code from server">
- <doc>
- The return code. The AMQP return codes are defined by this enum.
- </doc>
- <enum>
- <choice name="content-too-large" value="311">
- <doc>
- The client attempted to transfer content larger than the server could accept.
- </doc>
- </choice>
-
- <choice name="no-route" value="312">
- <doc>
- The exchange cannot route a message, most likely due to an invalid routing key. Only
- when the mandatory flag is set.
- </doc>
- </choice>
-
- <choice name="no-consumers" value="313">
- <doc>
- The exchange cannot deliver to a consumer when the immediate flag is set. As a result of
- pending data on the queue or the absence of any consumers of the queue.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <!-- - Command: stream.qos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="qos" code="0x1" label="specify quality of service">
- <doc>
- This command requests a specific quality of service. The QoS can be specified for the
- current session or for all sessions on the connection. The particular properties and
- semantics of a qos command always depend on the content class semantics. Though the qos
- command could in principle apply to both peers, it is currently meaningful only for the
- server.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <response name="qos-ok" />
-
- <field name="prefetch-size" type="uint32" label="pre-fetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client finishes
- processing a message, the following message is already held locally, rather than needing
- to be sent within the session. Pre-fetching gives a performance improvement. This field
- specifies the pre-fetch window size in octets. May be set to zero, meaning "no specific
- limit". Note that other pre-fetch limits may still apply.
- </doc>
- </field>
-
- <field name="prefetch-count" type="uint16" label="pre-fetch window in messages">
- <doc>
- Specifies a pre-fetch window in terms of whole messages. This field may be used in
- combination with the prefetch-size field; a message will only be sent in advance if both
- pre-fetch windows (and those at the session and connection level) allow it.
- </doc>
- </field>
-
- <field name="consume-rate" type="uint32" label="transfer rate in octets/second">
- <doc>
- Specifies a desired transfer rate in octets per second. This is usually determined by the
- application that uses the streaming data. A value of zero means "no limit", i.e. as
- rapidly as possible.
- </doc>
-
- <rule name="ignore-prefetch">
- <doc>
- The server MAY ignore the pre-fetch values and consume rates, depending on the type of
- stream and the ability of the server to queue and/or reply it.
- </doc>
- </rule>
-
- <rule name="drop-by-priority">
- <doc>
- The server MAY drop low-priority messages in favor of high-priority messages.
- </doc>
- </rule>
- </field>
-
- <field name="global" type="bit" label="apply to entire connection">
- <doc>
- By default the QoS settings apply to the current session only. If this field is set, they
- are applied to the entire connection.
- </doc>
- </field>
- </command>
-
- <!-- - Command: stream.qos-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="qos-ok" code="0x2" label="confirm the requested qos">
- <doc>
- This command tells the client that the requested QoS levels could be handled by the server.
- The requested QoS applies to all active consumers until a new QoS is defined.
- </doc>
-
- <implement role="client" handle="MUST" />
- </command>
-
- <!-- - Command: stream.consume - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="consume" code="0x3" label="start a queue consumer">
- <doc>
- This command asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the session they were created on,
- or until the client cancels them.
- </doc>
-
- <rule name="min-consumers">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was declared
- as private, and ideally, impose no limit except as defined by available resources.
- </doc>
- </rule>
-
- <rule name="priority-based-delivery">
- <doc>
- Streaming applications SHOULD use different sessions to select different streaming
- resolutions. AMQP makes no provision for filtering and/or transforming streams except on
- the basis of priority-based selective delivery of individual messages.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <response name="consume-ok" />
-
- <field name="queue" type="queue.name">
- <doc>
- Specifies the name of the queue to consume from.
- </doc>
-
- <exception name="queue-exists-if-empty" error-code="not-allowed">
- <doc>
- If the queue name in this command is empty, the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="consumer-tag" type="str8">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a connection, so
- two clients can use the same consumer tags.
- </doc>
-
- <exception name="not-existing-consumer" error-code="not-allowed">
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to create two
- consumers with the same non-empty tag the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-empty-consumer-tag" error-code="not-allowed">
- <doc>
- The client MUST NOT specify a tag that is empty or blank.
- </doc>
- <doc type="scenario">
- Attempt to create a consumers with an empty tag.
- </doc>
- </exception>
- </field>
-
- <field name="no-local" type="bit">
- <doc>If the no-local field is set the server will not send messages to the connection that
- published them.</doc>
- </field>
-
- <field name="exclusive" type="bit" label="request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the queue.
- </doc>
-
- <exception name="in-use" error-code="resource-locked">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, - because there are
- other consumers active - it MUST raise an exception with return code 405
- (resource locked).
- </doc>
- </exception>
- </field>
-
- <field name="nowait" type="bit" label="do not send a reply command">
- <doc>
- If set, the server will not respond to the command. The client should not wait for a reply
- command. If the server could not complete the command it will raise an exception.
- </doc>
- </field>
-
- <field name="arguments" type="map" label="arguments for consuming">
- <doc>
- A set of arguments for the consume. The syntax and semantics of these arguments depends on
- the providers implementation.
- </doc>
- </field>
- </command>
-
- <!-- - Command: stream.consume-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="consume-ok" code="0x4" label="confirm a new consumer">
- <doc>
- This command provides the client with a consumer tag which it may use in commands that work
- with the consumer.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="consumer-tag" type="str8">
- <doc>
- Holds the consumer tag specified by the client or provided by the server.
- </doc>
- </field>
- </command>
-
- <!-- - Command: stream.cancel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="cancel" code="0x5" label="end a queue consumer">
- <doc>
- This command cancels a consumer. Since message delivery is asynchronous the client may
- continue to receive messages for a short while after cancelling a consumer. It may process
- or discard these as appropriate.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="consumer-tag" type="str8" />
- </command>
-
- <!-- - Command: stream.publish - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="publish" code="0x6" label="publish a message">
- <doc>
- This command publishes a message to a specific exchange. The message will be routed to
- queues as defined by the exchange configuration and distributed to any active consumers as
- appropriate.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be empty, meaning
- the default exchange. If the exchange name is specified, and that exchange does not exist,
- the server will raise an exception.
- </doc>
-
- <rule name="default">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <exception name="refusal" error-code="not-implemented">
- <doc>
- The exchange MAY refuse stream content in which case it MUST respond with an exception.
- </doc>
- </exception>
- </field>
-
- <field name="routing-key" type="str8" label="Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing messages
- depending on the exchange configuration.
- </doc>
- </field>
-
- <field name="mandatory" type="bit" label="indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue. If
- this flag is set, the server will return an unroutable message with a Return command. If
- this flag is zero, the server silently drops the message.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the mandatory flag.
- </doc>
- </rule>
- </field>
-
- <field name="immediate" type="bit" label="request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue
- consumer immediately. If this flag is set, the server will return an undeliverable message
- with a Return command. If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the immediate flag.
- </doc>
- </rule>
- </field>
-
- <segments>
- <header required="true">
- <entry type="stream-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- <!-- - Command: stream.return - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="return" code="0x7" label="return a failed message">
- <doc>
- This command returns an undeliverable message that was published with the "immediate" flag
- set, or an unroutable message published with the "mandatory" flag set. The reply code and
- text provide information about the reason that the message was undeliverable.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="reply-code" type="return-code" />
-
- <field name="reply-text" type="str8" label="The localized reply text.">
- <doc>
- The localized reply text. This text can be logged as an aid to resolving issues.
- </doc>
- </field>
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="routing-key" type="str8" label="Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
-
- <segments>
- <header required="true">
- <entry type="stream-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- <!-- - Command: stream.deliver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="deliver" code="0x8" label="notify the client of a consumer message">
- <doc>
- This command delivers a message to the client, via a consumer. In the asynchronous message
- delivery model, the client starts a consumer using the Consume command, then the server
- responds with Deliver commands as and when messages arrive for that consumer.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="consumer-tag" type="str8" />
-
- <field name="delivery-tag" type="uint64">
- <doc>
- The server-assigned and session-specific delivery tag
- </doc>
- <rule name="session-local">
- <doc>
- The delivery tag is valid only within the session from which the message was received.
- i.e. A client MUST NOT receive a message on one session and then acknowledge it on
- another.
- </doc>
- </rule>
- </field>
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="queue" type="queue.name" required="true">
- <doc>
- Specifies the name of the queue that the message came from. Note that a single session can
- start many consumers on different queues.
- </doc>
- </field>
-
- <segments>
- <header required="true">
- <entry type="stream-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- </class>
-
-</amqp>
diff --git a/M4-RCs/qpid/specs/amqp.0-10.dtd b/M4-RCs/qpid/specs/amqp.0-10.dtd
deleted file mode 100644
index 2be198525a..0000000000
--- a/M4-RCs/qpid/specs/amqp.0-10.dtd
+++ /dev/null
@@ -1,246 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright Notice
- ================
- (c) Copyright Cisco Systems, Credit Suisse, Deutsche Börse Systems, Envoy Technologies, Inc.,
- Goldman Sachs, IONA Technologies PLC, iMatix Corporation sprl.,JPMorgan Chase Bank Inc. N.A,
- Novell, Rabbit Technologies Ltd., Red Hat, Inc., TWIST Process Innovations ltd, and 29West Inc
- 2006, 2007. All rights reserved.
-
- License
- =======
- JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix Corporation, IONA
- Technologies, Red Hat, Inc., TWIST Process Innovations, and 29West Inc. (collectively, the
- "Authors") each hereby grants to you a worldwide, perpetual, royalty-free, nontransferable,
- nonexclusive license to (i) copy, display, distribute and implement the Advanced Messaging Queue
- Protocol ("AMQP") Specification and (ii) the Licensed Claims that are held by the Authors, all for
- the purpose of implementing the Advanced Messaging Queue Protocol Specification. Your license and
- any rights under this Agreement will terminate immediately without notice from any Author if you
- bring any claim, suit, demand, or action related to the Advanced Messaging Queue Protocol
- Specification against any Author. Upon termination, you shall destroy all copies of the Advanced
- Messaging Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or patent application,
- throughout the world, excluding design patents and design registrations, owned or controlled, or
- that can be sublicensed without fee and in compliance with the requirements of this Agreement, by
- an Author or its affiliates now or at any future time and which would necessarily be infringed by
- implementation of the Advanced Messaging Queue Protocol Specification. A claim is necessarily
- infringed hereunder only when it is not possible to avoid infringing it because there is no
- plausible non-infringing alternative for implementing the required portions of the Advanced
- Messaging Queue Protocol Specification. Notwithstanding the foregoing, Licensed Claims shall not
- include any claims other than as set forth above even if contained in the same patent as Licensed
- Claims; or that read solely on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging Queue Protocol
- Specification, or that, if licensed, would require a payment of royalties by the licensor to
- unaffiliated third parties. Moreover, Licensed Claims shall not include (i) any enabling
- technologies that may be necessary to make or use any Licensed Product but are not themselves
- expressly set forth in the Advanced Messaging Queue Protocol Specification (e.g., semiconductor
- manufacturing technology, compiler technology, object oriented technology, networking technology,
- operating system technology, and the like); or (ii) the implementation of other published
- standards developed elsewhere and merely referred to in the body of the Advanced Messaging Queue
- Protocol Specification, or (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced Messaging Queue Protocol
- Specification. For purposes of this definition, the Advanced Messaging Queue Protocol
- Specification shall be deemed to include both architectural and interconnection requirements
- essential for interoperability and may also include supporting source code artifacts where such
- architectural, interconnection requirements and source code artifacts are expressly identified as
- being required or documentation to achieve compliance with the Advanced Messaging Queue Protocol
- Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions of products (hardware,
- software or combinations thereof) that implement and are compliant with all relevant portions of
- the Advanced Messaging Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any use you may make of the
- Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS," AND THE AUTHORS MAKE NO
- REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS
- OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE
- IMPLEMENTATION OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD
- PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
- DAMAGES ARISING OUT OF OR RELATING TO ANY USE, IMPLEMENTATION OR OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner, including advertising or
- publicity pertaining to the Advanced Messaging Queue Protocol Specification or its contents
- without specific, written prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you shall destroy all copies of
- the Advanced Messaging Queue Protocol Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the Octagon Symbol are
- trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA Technologies PLC and/or its
- subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered trademarks of Red Hat,
- Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of Sun Microsystems, Inc. in the
- United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
--->
-
-<!ELEMENT amqp (doc|type|struct|domain|constant|class)*>
-<!ATTLIST amqp
- xmlns CDATA #IMPLIED
- major CDATA #REQUIRED
- minor CDATA #REQUIRED
- port CDATA #REQUIRED
- comment CDATA #IMPLIED
->
-
-<!ELEMENT constant (doc|rule)*>
-<!ATTLIST constant
- name CDATA #REQUIRED
- value CDATA #REQUIRED
- label CDATA #IMPLIED
->
-
-<!ELEMENT type (doc|rule)*>
-<!ATTLIST type
- name CDATA #REQUIRED
- label CDATA #IMPLIED
- code CDATA #IMPLIED
- fixed-width CDATA #IMPLIED
- variable-width CDATA #IMPLIED
->
-
-<!ELEMENT domain (doc|rule|enum)*>
-<!ATTLIST domain
- name CDATA #REQUIRED
- type CDATA #IMPLIED
- label CDATA #IMPLIED
->
-
-<!ELEMENT struct (field|doc|rule)*>
-<!ATTLIST struct
- name CDATA #REQUIRED
- label CDATA #IMPLIED
- size (0|1|2|4) #IMPLIED
- pack (0|1|2|4) #IMPLIED
- code CDATA #IMPLIED>
-
-<!ELEMENT enum (choice)*>
-
-<!ELEMENT choice (doc|rule)*>
-<!ATTLIST choice
- name CDATA #REQUIRED
- value CDATA #REQUIRED
->
-
-<!ELEMENT class (doc|role|rule|struct|domain|control|command)*>
-<!ATTLIST class
- name CDATA #REQUIRED
- code CDATA #REQUIRED
- label CDATA #IMPLIED
->
-
-<!ELEMENT role (doc|rule)*>
-<!ATTLIST role
- name CDATA #REQUIRED
- implement (MAY|SHOULD|MUST) #REQUIRED
->
-
-<!ELEMENT control (doc|implement|rule|field|response)*>
-<!ATTLIST control
- name CDATA #REQUIRED
- code CDATA #REQUIRED
- label CDATA #IMPLIED
->
-
-<!ELEMENT command ((doc|implement|rule|exception|field|response)*, result?, segments?)>
-<!ATTLIST command
- name CDATA #REQUIRED
- code CDATA #REQUIRED
- label CDATA #IMPLIED
->
-
-<!ELEMENT implement (doc|rule)*>
-<!ATTLIST implement
- role CDATA #REQUIRED
- handle (MAY|SHOULD|MUST) #REQUIRED
- send (MAY|SHOULD|MUST) #IMPLIED
->
-
-<!ELEMENT field (doc|rule|exception)*>
-<!ATTLIST field
- name CDATA #REQUIRED
- type CDATA #IMPLIED
- default CDATA #IMPLIED
- code CDATA #IMPLIED
- label CDATA #IMPLIED
- required CDATA #IMPLIED
->
-
-<!ELEMENT rule (doc*)>
-<!ATTLIST rule
- name CDATA #REQUIRED
- label CDATA #IMPLIED
->
-
-<!ELEMENT exception (doc*)>
-<!ATTLIST exception
- name CDATA #REQUIRED
- error-code CDATA #IMPLIED
- label CDATA #IMPLIED
->
-
-<!ELEMENT response (doc|rule)*>
-<!ATTLIST response
- name CDATA #IMPLIED
->
-
-<!ELEMENT result (doc|rule|struct)*>
-<!ATTLIST result
- type CDATA #IMPLIED
->
-
-<!ELEMENT segments (doc|rule|header|body)*>
-
-<!ELEMENT header (doc|rule|entry)*>
-<!ATTLIST header
- required (true|false) #IMPLIED
->
-
-<!ELEMENT entry (doc|rule)*>
-<!ATTLIST entry
- type CDATA #REQUIRED
->
-
-<!ELEMENT body (doc|rule)*>
-<!ATTLIST body
- required (true|false) #IMPLIED
->
-
-<!ELEMENT doc (#PCDATA|xref)*>
-<!ATTLIST doc
- type (grammar|scenario|picture|bnf|todo) #IMPLIED
- title CDATA #IMPLIED
->
-
-<!ELEMENT xref (#PCDATA)>
-<!ATTLIST xref
- ref CDATA #REQUIRED>
diff --git a/M4-RCs/qpid/specs/amqp.0-10.xml b/M4-RCs/qpid/specs/amqp.0-10.xml
deleted file mode 100644
index 454114c17a..0000000000
--- a/M4-RCs/qpid/specs/amqp.0-10.xml
+++ /dev/null
@@ -1,6652 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright Notice
- ================
- (c) Copyright Cisco Systems, Credit Suisse, Deutsche Borse Systems, Envoy Technologies, Inc.,
- Goldman Sachs, IONA Technologies PLC, iMatix Corporation sprl.,JPMorgan Chase Bank Inc. N.A,
- Novell, Rabbit Technologies Ltd., Red Hat, Inc., TWIST Process Innovations ltd, and 29West Inc.
- 2006, 2007. All rights reserved.
-
- License
- =======
-
- Cisco Systems, Credit Suisse, Deutsche Borse Systems, Envoy Technologies, Inc.,Goldman Sachs,
- IONA Technologies PLC, iMatix Corporation sprl.,JPMorgan Chase Bank Inc. N.A, Novell, Rabbit
- Technologies Ltd., Red Hat, Inc., TWIST Process Innovations ltd, and 29West Inc. (collectively,
- the "Authors") each hereby grants to you a worldwide, perpetual, royalty-free, nontransferable,
- nonexclusive license to (i) copy, display, distribute and implement the Advanced Messaging Queue
- Protocol ("AMQP") Specification and (ii) the Licensed Claims that are held by the Authors, all for
- the purpose of implementing the Advanced Messaging Queue Protocol Specification. Your license and
- any rights under this Agreement will terminate immediately without notice from any Author if you
- bring any claim, suit, demand, or action related to the Advanced Messaging Queue Protocol
- Specification against any Author. Upon termination, you shall destroy all copies of the Advanced
- Messaging Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or patent application,
- throughout the world, excluding design patents and design registrations, owned or controlled, or
- that can be sublicensed without fee and in compliance with the requirements of this Agreement, by
- an Author or its affiliates now or at any future time and which would necessarily be infringed by
- implementation of the Advanced Messaging Queue Protocol Specification. A claim is necessarily
- infringed hereunder only when it is not possible to avoid infringing it because there is no
- plausible non-infringing alternative for implementing the required portions of the Advanced
- Messaging Queue Protocol Specification. Notwithstanding the foregoing, Licensed Claims shall not
- include any claims other than as set forth above even if contained in the same patent as Licensed
- Claims; or that read solely on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging Queue Protocol
- Specification, or that, if licensed, would require a payment of royalties by the licensor to
- unaffiliated third parties. Moreover, Licensed Claims shall not include (i) any enabling
- technologies that may be necessary to make or use any Licensed Product but are not themselves
- expressly set forth in the Advanced Messaging Queue Protocol Specification (e.g., semiconductor
- manufacturing technology, compiler technology, object oriented technology, networking technology,
- operating system technology, and the like); or (ii) the implementation of other published
- standards developed elsewhere and merely referred to in the body of the Advanced Messaging Queue
- Protocol Specification, or (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced Messaging Queue Protocol
- Specification. For purposes of this definition, the Advanced Messaging Queue Protocol
- Specification shall be deemed to include both architectural and interconnection requirements
- essential for interoperability and may also include supporting source code artifacts where such
- architectural, interconnection requirements and source code artifacts are expressly identified as
- being required or documentation to achieve compliance with the Advanced Messaging Queue Protocol
- Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions of products (hardware,
- software or combinations thereof) that implement and are compliant with all relevant portions of
- the Advanced Messaging Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any use you may make of the
- Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS," AND THE AUTHORS MAKE NO
- REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS
- OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE
- IMPLEMENTATION OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD
- PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL
- DAMAGES ARISING OUT OF OR RELATING TO ANY USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner, including advertising or
- publicity pertaining to the Advanced Messaging Queue Protocol Specification or its contents
- without specific, written prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you shall destroy all copies of
- the Advanced Messaging Queue Protocol Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the Octagon Symbol are
- trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA Technologies PLC and/or its
- subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered trademarks of Red Hat,
- Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of Sun Microsystems, Inc. in the
- United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
--->
-
-<!--
- XML Notes
- =========
-
- We use entities to indicate repetition; attributes to indicate properties.
-
- We use the "name" attribute as an identifier, usually within the context of the surrounding
- entities.
-
- We use hyphens (minus char '-') to seperate words in names.
-
- We do not enforce any particular validation mechanism but we support all mechanisms. The protocol
- definition conforms to a formal grammar that is published seperately in several technologies.
-
--->
-
-<!DOCTYPE amqp SYSTEM "amqp.0-10.dtd">
-
-<amqp xmlns="http://www.amqp.org/schema/amqp.xsd"
- major="0" minor="10" port="5672">
-
- <!--
- ====================== == type definitions == ======================
- -->
-
- <!--
- 0x00 - 0x0f: Fixed width, 1 octet
- -->
-
- <type name="bin8" code="0x00" fixed-width="1" label="octet of unspecified encoding">
- <doc>
- The bin8 type consists of exactly one octet of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET
- +----------+
- | bin8 |
- +----------+
- </doc>
-
- <doc type="bnf">
- bin8 = OCTET
- </doc>
- </type>
-
- <type name="int8" code="0x01" fixed-width="1" label="8-bit signed integral value (-128 - 127)">
- <doc>
- The int8 type is a signed integral value encoded using an 8-bit two's complement
- representation.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET
- +----------+
- | int8 |
- +----------+
- </doc>
-
- <doc type="bnf">
- int8 = OCTET
- </doc>
- </type>
-
- <type name="uint8" code="0x02" fixed-width="1" label="8-bit unsigned integral value (0 - 255)">
- <doc>
- The uint8 type is an 8-bit unsigned integral value.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET
- +---------+
- | uint8 |
- +---------+
- </doc>
-
- <doc type="bnf">
- uint8 = OCTET
- </doc>
- </type>
-
- <type name="char" code="0x04" fixed-width="1" label="an iso-8859-15 character">
- <doc>
- The char type encodes a single character from the iso-8859-15 character set.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET
- +----------+
- | char |
- +----------+
- </doc>
-
- <doc type="bnf">
- char = OCTET
- </doc>
- </type>
-
- <type name="boolean" code="0x08" fixed-width="1"
- label="boolean value (zero represents false, nonzero represents true)">
- <doc>
- The boolean type is a single octet that encodes a true or false value. If the octet is zero,
- then the boolean is false. Any other value represents true.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET
- +---------+
- | boolean |
- +---------+
- </doc>
-
- <doc type="bnf">
- boolean = OCTET
- </doc>
- </type>
-
- <!--
- 0x10 - 0x1f: Fixed width, 2 octets
- -->
-
- <type name="bin16" code="0x10" fixed-width="2" label="two octets of unspecified binary encoding">
- <doc>
- The bin16 type consists of two consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET
- +-----------+-----------+
- | octet-one | octet-two |
- +-----------+-----------+
- </doc>
-
- <doc type="bnf">
- bin16 = 2 OCTET
- </doc>
- </type>
-
- <type name="int16" code="0x11" fixed-width="2" label="16-bit signed integral value">
- <doc>
- The int16 type is a signed integral value encoded using a 16-bit two's complement
- representation in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET
- +-----------+----------+
- | high-byte | low-byte |
- +-----------+----------+
- </doc>
-
- <doc type="bnf">
- int16 = high-byte low-byte
- high-byte = OCTET
- low-byte = OCTET
- </doc>
- </type>
-
- <type name="uint16" code="0x12" fixed-width="2" label="16-bit unsigned integer">
- <doc>
- The uint16 type is a 16-bit unsigned integral value encoded in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET
- +-----------+----------+
- | high-byte | low-byte |
- +-----------+----------+
- </doc>
-
- <doc type="bnf">
- uint16 = high-byte low-byte
- high-byte = OCTET
- low-byte = OCTET
- </doc>
- </type>
-
- <!--
- 0x20 - 0x2f: Fixed width, 4 octets
- -->
-
- <type name="bin32" code="0x20" fixed-width="4" label="four octets of unspecified binary encoding">
- <doc>
- The bin32 type consists of 4 consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-------------+------------+
- | octet-one | octet-two | octet-three | octet-four |
- +-----------+-----------+-------------+------------+
- </doc>
-
- <doc type="bnf">
- bin32 = 4 OCTET
- </doc>
- </type>
-
- <type name="int32" code="0x21" fixed-width="4" label="32-bit signed integral value">
- <doc>
- The int32 type is a signed integral value encoded using a 32-bit two's complement
- representation in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+------------+----------+----------+
- | byte-four | byte-three | byte-two | byte-one |
- +-----------+------------+----------+----------+
- MSB LSB
- </doc>
-
- <doc type="bnf">
- int32 = byte-four byte-three byte-two byte-one
- byte-four = OCTET ; most significant byte (MSB)
- byte-three = OCTET
- byte-two = OCTET
- byte-one = OCTET ; least significant byte (LSB)
- </doc>
- </type>
-
- <type name="uint32" code="0x22" fixed-width="4" label="32-bit unsigned integral value">
- <doc>
- The uint32 type is a 32-bit unsigned integral value encoded in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+------------+----------+----------+
- | byte-four | byte-three | byte-two | byte-one |
- +-----------+------------+----------+----------+
- MSB LSB
- </doc>
-
- <doc type="bnf">
- uint32 = byte-four byte-three byte-two byte-one
- byte-four = OCTET ; most significant byte (MSB)
- byte-three = OCTET
- byte-two = OCTET
- byte-one = OCTET ; least significant byte (LSB)
- </doc>
- </type>
-
- <type name="float" code="0x23" fixed-width="4"
- label="single precision IEEE 754 32-bit floating point">
- <doc>
- The float type encodes a single precision 32-bit floating point number. The format and
- operations are defined by the IEEE 754 standard for 32-bit floating point numbers.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs
- +-----------------------+
- | float |
- +-----------------------+
- IEEE 754 32-bit float
- </doc>
-
- <doc type="bnf">
- float = 4 OCTET ; IEEE 754 32-bit floating point number
- </doc>
- </type>
-
- <type name="char-utf32" code="0x27" fixed-width="4"
- label="single unicode character in UTF-32 encoding">
- <doc>
- The char-utf32 type consists of a single unicode character in the UTF-32 encoding.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs
- +------------------+
- | char-utf32 |
- +------------------+
- UTF-32 character
- </doc>
-
- <doc type="bnf">
- char-utf32 = 4 OCTET ; single UTF-32 character
- </doc>
- </type>
-
- <type name="sequence-no" fixed-width="4" label="serial number defined in RFC-1982">
- <doc>
- The sequence-no type encodes, in network byte order, a serial number as defined in RFC-1982.
- The arithmetic, operators, and ranges for numbers of this type are defined by RFC-1982.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs
- +------------------------+
- | sequence-no |
- +------------------------+
- RFC-1982 serial number
- </doc>
-
- <doc type="bnf">
- sequence-no = 4 OCTET ; RFC-1982 serial number
- </doc>
- </type>
-
- <!--
- 0x30 - 0x3f: Fixed width types - 8 octets
- -->
-
- <type name="bin64" code="0x30" fixed-width="8"
- label="eight octets of unspecified binary encoding">
- <doc>
- The bin64 type consists of eight consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+-------------+-------------+
- | octet-one | octet-two | ... | octet-seven | octet-eight |
- +-----------+-----------+-----+-------------+-------------+
- </doc>
-
- <doc type="bnf">
- bin64 = 8 OCTET
- </doc>
- </type>
-
- <type name="int64" code="0x31" fixed-width="8" label="64-bit signed integral value">
- <doc>
- The int64 type is a signed integral value encoded using a 64-bit two's complement
- representation in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +------------+------------+-----+----------+----------+
- | byte-eight | byte-seven | ... | byte-two | byte-one |
- +------------+------------+-----+----------+----------+
- MSB LSB
- </doc>
-
- <doc type="bnf">
- int64 = byte-eight byte-seven byte-six byte-five
- byte-four byte-three byte-two byte-one
- byte-eight = 1 OCTET ; most significant byte (MSB)
- byte-seven = 1 OCTET
- byte-six = 1 OCTET
- byte-five = 1 OCTET
- byte-four = 1 OCTET
- byte-three = 1 OCTET
- byte-two = 1 OCTET
- byte-one = 1 OCTET ; least significant byte (LSB)
- </doc>
- </type>
-
- <type name="uint64" code="0x32" fixed-width="8" label="64-bit unsigned integral value">
- <doc>
- The uint64 type is a 64-bit unsigned integral value encoded in network byte order.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +------------+------------+-----+----------+----------+
- | byte-eight | byte-seven | ... | byte-two | byte-one |
- +------------+------------+-----+----------+----------+
- MSB LSB
- </doc>
-
- <doc type="bnf">
- uint64 = byte-eight byte-seven byte-six byte-five
- byte-four byte-three byte-two byte-one
- byte-eight = 1 OCTET ; most significant byte (MSB)
- byte-seven = 1 OCTET
- byte-six = 1 OCTET
- byte-five = 1 OCTET
- byte-four = 1 OCTET
- byte-three = 1 OCTET
- byte-two = 1 OCTET
- byte-one = 1 OCTET ; least significant byte (LSB)
- </doc>
- </type>
-
- <type name="double" code="0x33" fixed-width="8" label="double precision IEEE 754 floating point">
- <doc>
- The double type encodes a double precision 64-bit floating point number. The format and
- operations are defined by the IEEE 754 standard for 64-bit double precision floating point
- numbers.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 8 OCTETs
- +-----------------------+
- | double |
- +-----------------------+
- IEEE 754 64-bit float
- </doc>
-
- <doc type="bnf">
- double = 8 OCTET ; double precision IEEE 754 floating point number
- </doc>
- </type>
-
- <type name="datetime" code="0x38" fixed-width="8" label="datetime in 64 bit POSIX time_t format">
- <doc>
- The datetime type encodes a date and time using the 64 bit POSIX time_t format.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 8 OCTETs
- +---------------------+
- | datetime |
- +---------------------+
- posix time_t format
- </doc>
-
- <doc type="bnf">
- datetime = 8 OCTET ; 64 bit posix time_t format
- </doc>
- </type>
-
- <!--
- 0x40 - 0x4f: Fixed width types - 16 octets
- -->
-
- <type name="bin128" code="0x40" fixed-width="16"
- label="sixteen octets of unspecified binary encoding">
- <doc>
- The bin128 type consists of 16 consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+---------------+---------------+
- | octet-one | octet-two | ... | octet-fifteen | octet-sixteen |
- +-----------+-----------+-----+---------------+---------------+
- </doc>
-
- <doc type="bnf">
- bin128 = 16 OCTET
- </doc>
- </type>
-
- <type name="uuid" code="0x48" fixed-width="16" label="UUID (RFC-4122 section 4.1.2) - 16 octets">
- <doc>
- The uuid type encodes a universally unique id as defined by RFC-4122. The format and
- operations for this type can be found in section 4.1.2 of RFC-4122.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 16 OCTETs
- +---------------+
- | uuid |
- +---------------+
- RFC-4122 UUID
- </doc>
-
- <doc type="bnf">
- uuid = 16 OCTET ; RFC-4122 section 4.1.2
- </doc>
- </type>
-
- <!--
- 0x50 - 0x5f: Fixed width types - 32 octets
- -->
-
- <type name="bin256" code="0x50" fixed-width="32"
- label="thirty two octets of unspecified binary encoding">
- <doc>
- The bin256 type consists of thirty two consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+------------------+------------------+
- | octet-one | octet-two | ... | octet-thirty-one | octet-thirty-two |
- +-----------+-----------+-----+------------------+------------------+
- </doc>
-
- <doc type="bnf">
- bin256 = 32 OCTET
- </doc>
- </type>
-
- <!--
- 0x60 - 0x6f: Fixed width types - 64 octets
- -->
-
- <type name="bin512" code="0x60" fixed-width="64"
- label="sixty four octets of unspecified binary encoding">
- <doc>
- The bin512 type consists of sixty four consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+-------------------+------------------+
- | octet-one | octet-two | ... | octet-sixty-three | octet-sixty-four |
- +-----------+-----------+-----+-------------------+------------------+
- </doc>
-
- <doc type="bnf">
- bin512 = 64 OCTET
- </doc>
- </type>
-
- <!--
- 0x70 - 0x7f: Fixed width types - 128 octets
- -->
-
- <type name="bin1024" code="0x70" fixed-width="128"
- label="one hundred and twenty eight octets of unspecified binary encoding">
- <doc>
- The bin1024 type consists of one hundred and twenty eight octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+------------------------+------------------------+
- | octet-one | octet-two | ... | octet-one-twenty-seven | octet-one-twenty-eight |
- +-----------+-----------+-----+------------------------+------------------------+
- </doc>
-
- <doc type="bnf">
- bin1024 = 128 OCTET
- </doc>
- </type>
-
- <!--
- 0x80 - 0x8f: Variable length - one byte length field (up to 255 octets)
- -->
-
- <type name="vbin8" code="0x80" variable-width="1" label="up to 255 octets of opaque binary data">
- <doc>
- The vbin8 type encodes up to 255 octets of opaque binary data. The number of octets is first
- encoded as an 8-bit unsigned integral value. This is followed by the actual data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET size OCTETs
- +---------+-------------+
- | size | octets |
- +---------+-------------+
- uint8
- </doc>
-
- <doc type="bnf">
- vbin8 = size octets
- size = uint8
- octets = 0*255 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str8-latin" code="0x84" variable-width="1" label="up to 255 iso-8859-15 characters">
- <doc>
- The str8-latin type encodes up to 255 octets of iso-8859-15 characters. The number of octets
- is first encoded as an 8-bit unsigned integral value. This is followed by the actual
- characters.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET size OCTETs
- +---------+------------------------+
- | size | characters |
- +---------+------------------------+
- uint16 iso-8859-15 characters
- </doc>
-
- <doc type="bnf">
- str8-latin = size characters
- size = uint8
- characters = 0*255 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str8" code="0x85" variable-width="1" label="up to 255 octets worth of UTF-8 unicode">
- <doc>
- The str8 type encodes up to 255 octets worth of UTF-8 unicode. The number of octets of unicode
- is first encoded as an 8-bit unsigned integral value. This is followed by the actual UTF-8
- unicode. Note that the encoded size refers to the number of octets of unicode, not necessarily
- the number of characters since the UTF-8 unicode may include multi-byte character sequences.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET size OCTETs
- +---------+--------------+
- | size | utf8-unicode |
- +---------+--------------+
- uint8
- </doc>
-
- <doc type="bnf">
- str8 = size utf8-unicode
- size = uint8
- utf8-unicode = 0*255 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str8-utf16" code="0x86" variable-width="1"
- label="up to 255 octets worth of UTF-16 unicode">
- <doc>
- The str8-utf16 type encodes up to 255 octets worth of UTF-16 unicode. The number of octets of
- unicode is first encoded as an 8-bit unsigned integral value. This is followed by the actual
- UTF-16 unicode. Note that the encoded size refers to the number of octets of unicode, not the
- number of characters since the UTF-16 unicode will include at least two octets per unicode
- character.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET size OCTETs
- +---------+---------------+
- | size | utf16-unicode |
- +---------+---------------+
- uint8
- </doc>
-
- <doc type="bnf">
- str8-utf16 = size utf16-unicode
- size = uint8
- utf16-unicode = 0*255 OCTET ; size OCTETs
- </doc>
- </type>
-
- <!--
- 0x90 - 0x9f: Variable length types - two byte length field (up to 65535 octets)
- -->
-
- <type name="vbin16" code="0x90" variable-width="2"
- label="up to 65535 octets of opaque binary data">
- <doc>
- The vbin16 type encodes up to 65535 octets of opaque binary data. The number of octets is
- first encoded as a 16-bit unsigned integral value in network byte order. This is followed by
- the actual data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 2 OCTETs size OCTETs
- +----------+-------------+
- | size | octets |
- +----------+-------------+
- uint16
- </doc>
-
- <doc type="bnf">
- vbin16 = size octets
- size = uint16
- octets = 0*65535 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str16-latin" code="0x94" variable-width="2"
- label="up to 65535 iso-8859-15 characters">
- <doc>
- The str16-latin type encodes up to 65535 octets of is-8859-15 characters. The number of octets
- is first encoded as a 16-bit unsigned integral value in network byte order. This is followed
- by the actual characters.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 2 OCTETs size OCTETs
- +----------+------------------------+
- | size | characters |
- +----------+------------------------+
- uint16 iso-8859-15 characters
- </doc>
-
- <doc type="bnf">
- str16-latin = size characters
- size = uint16
- characters = 0*65535 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str16" code="0x95" variable-width="2"
- label="up to 65535 octets worth of UTF-8 unicode">
- <doc>
- The str16 type encodes up to 65535 octets worth of UTF-8 unicode. The number of octets is
- first encoded as a 16-bit unsigned integral value in network byte order. This is followed by
- the actual UTF-8 unicode. Note that the encoded size refers to the number of octets of
- unicode, not necessarily the number of unicode characters since the UTF-8 unicode may include
- multi-byte character sequences.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 2 OCTETs size OCTETs
- +----------+--------------+
- | size | utf8-unicode |
- +----------+--------------+
- uint16
- </doc>
-
- <doc type="bnf">
- str16 = size utf8-unicode
- size = uint16
- utf8-unicode = 0*65535 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="str16-utf16" code="0x96" variable-width="2"
- label="up to 65535 octets worth of UTF-16 unicode">
- <doc>
- The str16-utf16 type encodes up to 65535 octets worth of UTF-16 unicode. The number of octets
- is first encoded as a 16-bit unsigned integral value in network byte order. This is followed
- by the actual UTF-16 unicode. Note that the encoded size refers to the number of octets of
- unicode, not the number of unicode characters since the UTF-16 unicode will include at least
- two octets per unicode character.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 2 OCTETs size OCTETs
- +----------+---------------+
- | size | utf16-unicode |
- +----------+---------------+
- uint16
- </doc>
-
- <doc type="bnf">
- str16-utf16 = size utf16-unicode
- size = uint16
- utf16-unicode = 0*65535 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="byte-ranges" variable-width="2" label="byte ranges within a 64-bit payload">
- <doc>
- The byte-ranges type encodes up to 65535 octets worth of non-overlapping, non-touching,
- ascending byte ranges within a 64-bit sequence of bytes. Each range is represented as an
- inclusive lower and upper bound that identifies all the byte offsets included within a given
- range.
- </doc>
-
- <doc>
- The number of octets of data is first encoded as a 16-bit unsigned integral value in network
- byte order. This is then followed by the encoded representation of the ranges included in the
- set. These MUST be encoded in ascending order, and any two ranges included in a given set MUST
- NOT include overlapping or touching byte offsets.
- </doc>
-
- <doc>
- Each range is encoded as a pair of 64-bit unsigned integral values in network byte order
- respectively representing the lower and upper bounds for that range. Note that because each
- range is exactly 16 octets, the size in octets of the encoded ranges will always be 16 times
- the number of ranges in the set.
- </doc>
-
- <doc type="picture" title="Wire Format">
- +----= size OCTETs =----+
- | |
- 2 OCTETs | 16 OCTETs |
- +----------+-----+-----------+-----+
- | size | .../| range |\... |
- +----------+---/ +-----------+ \---+
- uint16 / / \ \
- / / \ \
- / 8 OCTETs 8 OCTETs \
- +-----------+-----------+
- | lower | upper |
- +-----------+-----------+
- uint64 uint64
- </doc>
-
- <doc type="bnf">
- byte-ranges = size *range
- size = uint16
- range = lower upper
- lower = uint64
- upper = uint64
- </doc>
- </type>
-
- <type name="sequence-set" variable-width="2" label="ranged set representation">
- <doc>
- The sequence-set type is a set of pairs of RFC-1982 numbers representing a discontinuous range
- within an RFC-1982 sequence. Each pair represents a closed interval within the list.
- </doc>
-
- <doc>
- Sequence-sets can be represented as lists of pairs of positive 32-bit numbers, each pair
- representing a closed interval that does not overlap or touch with any other interval in the
- list. For example, a set containing words 0, 1, 2, 5, 6, and 15 can be represented:
- </doc>
-
- <doc type="picture">
- [(0, 2), (5, 6), (15, 15)]
- </doc>
-
- <doc>
- 1) The list-of-pairs representation is sorted ascending (as defined by RFC 1982
- (http://www.ietf.org/rfc/rfc1982.txt) ) by the first elements of each pair.
- </doc>
-
- <doc>
- 2) The list-of-pairs is flattened into a list-of-words.
- </doc>
-
- <doc>
- 3) Each word in the list is packed into ascending locations in memory with network byte
- ordering.
- </doc>
-
- <doc>
- 4) The size in bytes, represented as a 16-bit network-byte-order unsigned value, is prepended.
- </doc>
-
- <doc>
- For instance, the example from above would be encoded:
- </doc>
-
- <doc type="picture">
- [(0, 2), (5, 6), (15, 15)] -- already sorted.
- [0, 2, 5, 6, 15, 15] -- flattened.
- 000000000000000200000005000000060000000F0000000F -- bytes in hex
- 0018000000000000000200000005000000060000000F0000000F -- bytes in hex,
- length (24) prepended
- </doc>
-
- <doc type="picture" title="Wire Format">
- +----= size OCTETs =----+
- | |
- 2 OCTETs | 8 OCTETs |
- +----------+-----+-----------+-----+
- | size | .../| range |\... |
- +----------+---/ +-----------+ \---+
- uint16 / / \ \
- / / \ \
- / / \ \
- / / \ \
- / 4 OCTETs 4 OCTETs \
- +-------------+-------------+
- | lower | upper |
- +-------------+-------------+
- sequence-no sequence-no
- </doc>
-
- <doc type="bnf">
- sequence-set = size *range
- size = uint16 ; length of variable portion in bytes
-
- range = lower upper ; inclusive
- lower = sequence-no
- upper = sequence-no
- </doc>
- </type>
-
- <!--
- 0xa0 - 0xaf: Variable length types - four byte length field (up to 4294967295 octets)
- -->
-
- <type name="vbin32" code="0xa0" variable-width="4"
- label="up to 4294967295 octets of opaque binary data">
- <doc>
- The vbin32 type encodes up to 4294967295 octets of opaque binary data. The number of octets is
- first encoded as a 32-bit unsigned integral value in network byte order. This is followed by
- the actual data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs size OCTETs
- +----------+-------------+
- | size | octets |
- +----------+-------------+
- uint32
- </doc>
-
- <doc type="bnf">
- vbin32 = size octets
- size = uint32
- octets = 0*4294967295 OCTET ; size OCTETs
- </doc>
- </type>
-
- <type name="map" code="0xa8" variable-width="4" label="a mapping of keys to typed values">
- <doc>
- A map is a set of distinct keys where each key has an associated (type,value) pair. The triple
- of the key, type, and value, form an entry within a map. Each entry within a given map MUST
- have a distinct key. A map is encoded as a size in octets, a count of the number of entries,
- followed by the encoded entries themselves.
- </doc>
-
- <doc>
- An encoded map may contain up to (4294967295 - 4) octets worth of encoded entries. The size is
- encoded as a 32-bit unsigned integral value in network byte order equal to the number of
- octets worth of encoded entries plus 4. (The extra 4 octets is added for the entry count.) The
- size is then followed by the number of entries encoded as a 32-bit unsigned integral value in
- network byte order. Finally the entries are encoded sequentially.
- </doc>
-
- <doc>
- An entry is encoded as the key, followed by the type, and then the value. The key is always a
- string encoded as a str8. The type is a single octet that may contain any valid AMQP type
- code. The value is encoded according to the rules defined by the type code for that entry.
- </doc>
-
- <doc type="picture" title="Wire Format">
- +------------= size OCTETs =-----------+
- | |
- 4 OCTETs | 4 OCTETs |
- +----------+----------+-----+---------------+-----+
- | size | count | .../| entry |\... |
- +----------+----------+---/ +---------------+ \---+
- uint32 uint32 / / \ \
- / / \ \
- / / \ \
- / / \ \
- / / \ \
- / k OCTETs 1 OCTET n OCTETs \
- +-----------+---------+-----------+
- | key | type | value |
- +-----------+---------+-----------+
- str8 *type*
- </doc>
-
- <doc type="bnf">
- map = size count *entry
-
- size = uint32 ; size of count and entries in octets
- count = uint32 ; number of entries in the map
-
- entry = key type value
- key = str8
- type = OCTET ; type code of the value
- value = *OCTET ; the encoded value
- </doc>
- </type>
-
- <type name="list" code="0xa9" variable-width="4" label="a series of consecutive type-value pairs">
- <doc>
- A list is an ordered sequence of (type, value) pairs. The (type, value) pair forms an item
- within the list. The list may contain items of many distinct types. A list is encoded as a
- size in octets, followed by a count of the number of items, followed by the items themselves
- encoded in their defined order.
- </doc>
-
- <doc>
- An encoded list may contain up to (4294967295 - 4) octets worth of encoded items. The size is
- encoded as a 32-bit unsigned integral value in network byte order equal to the number of
- octets worth of encoded items plus 4. (The extra 4 octets is added for the item count.) The
- size is then followed by the number of items encoded as a 32-bit unsigned integral value in
- network byte order. Finally the items are encoded sequentially in their defined order.
- </doc>
-
- <doc>
- An item is encoded as the type followed by the value. The type is a single octet that may
- contain any valid AMQP type code. The value is encoded according to the rules defined by the
- type code for that item.
- </doc>
-
- <doc type="picture" title="Wire Format">
- +---------= size OCTETs =---------+
- | |
- 4 OCTETs | 4 OCTETs |
- +----------+----------+-----+----------+-----+
- | size | count | .../| item |\... |
- +----------+----------+---/ +----------+ \---+
- uint32 uint32 / / \ \
- / / \ \
- / 1 OCTET n OCTETs \
- +----------+-----------+
- | type | value |
- +----------+-----------+
- *type*
- </doc>
-
- <doc type="bnf">
- list = size count *item
-
- size = uint32 ; size of count and items in octets
- count = uint32 ; number of items in the list
-
- item = type value
- type = OCTET ; type code of the value
- value = *OCTET ; the encoded value
- </doc>
- </type>
-
- <type name="array" code="0xaa" variable-width="4"
- label="a defined length collection of values of a single type">
- <doc>
- An array is an ordered sequence of values of the same type. The array is encoded in as a size
- in octets, followed by a type code, then a count of the number values in the array, and
- finally the values encoded in their defined order.
- </doc>
-
- <doc>
- An encoded array may contain up to (4294967295 - 5) octets worth of encoded values. The size
- is encoded as a 32-bit unsigned integral value in network byte order equal to the number of
- octets worth of encoded values plus 5. (The extra 5 octets consist of 4 octets for the count
- of the number of values, and one octet to hold the type code for the items in the array.) The
- size is then followed by a single octet that may contain any valid AMQP type code. The type
- code is then followed by the number of values encoded as a 32-bit unsigned integral value in
- network byte order. Finally the values are encoded sequentially in their defined order
- according to the rules defined by the type code for the array.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs 1 OCTET 4 OCTETs (size - 5) OCTETs
- +----------+---------+----------+-------------------------+
- | size | type | count | values |
- +----------+---------+----------+-------------------------+
- uint32 uint32 *count* encoded *types*
- </doc>
-
- <doc type="bnf">
- array = size type count values
-
- size = uint32 ; size of type, count, and values in octets
- type = OCTET ; the type of the encoded values
- count = uint32 ; number of items in the array
-
- values = 0*4294967290 OCTET ; (size - 5) OCTETs
- </doc>
- </type>
-
- <type name="struct32" code="0xab" variable-width="4" label="a coded struct with a 32-bit size">
- <doc>
- The struct32 type describes any coded struct with a 32-bit (4 octet) size. The type is
- restricted to be only coded structs with a 32-bit size, consequently the first six octets of
- any encoded value for this type MUST always contain the size, class-code, and struct-code in
- that order.
- </doc>
-
- <doc>
- The size is encoded as a 32-bit unsigned integral value in network byte order that is equal to
- the size of the encoded field-data, packing-flags, class-code, and struct-code. The class-code
- is a single octet that may be set to any valid class code. The struct-code is a single octet
- that may be set to any valid struct code within the given class-code.
- </doc>
-
- <doc>
- The first six octets are then followed by the packing flags and encoded field data. The
- presence and quantity of packing-flags, as well as the specific fields are determined by the
- struct definition identified with the encoded class-code and struct-code.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 4 OCTETs 1 OCTET 1 OCTET pack-width OCTETs n OCTETs
- +----------+------------+-------------+-------------------+------------+
- | size | class-code | struct-code | packing-flags | field-data |
- +----------+------------+-------------+-------------------+------------+
- uint32
-
- n = (size - 2 - pack-width)
- </doc>
-
- <doc type="bnf">
- struct32 = size class-code struct-code packing-flags field-data
-
- size = uint32
-
- class-code = OCTET ; zero for top-level structs
- struct-code = OCTET ; together with class-code identifies the struct
- ; definition which determines the pack-width and
- ; fields
-
- packing-flags = 0*4 OCTET ; pack-width OCTETs
-
- field-data = *OCTET ; (size - 2 - pack-width) OCTETs
- </doc>
- </type>
-
- <!--
- 0xb0 - 0xbf: Reserved
- -->
-
- <!--
- 0xc0 - 0xcf:Fixed width types - 5 octets
- -->
-
- <type name="bin40" code="0xc0" fixed-width="5" label="five octets of unspecified binary encoding">
- <doc>
- The bin40 type consists of five consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-------------+------------+------------+
- | octet-one | octet-two | octet-three | octet-four | octet-five |
- +-----------+-----------+-------------+------------+------------+
- </doc>
-
- <doc type="bnf">
- bin40 = 5 OCTET
- </doc>
- </type>
-
- <type name="dec32" code="0xc8" fixed-width="5"
- label="32-bit decimal value (e.g. for use in financial values)">
- <doc>
- The dec32 type is decimal value with a variable number of digits following the decimal point.
- It is encoded as an 8-bit unsigned integral value representing the number of decimal places.
- This is followed by the signed integral value encoded using a 32-bit two's complement
- representation in network byte order.
- </doc>
-
- <doc>
- The former value is referred to as the exponent of the divisor. The latter value is the
- mantissa. The decimal value is given by: mantissa / 10^exponent.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 4 OCTETs
- +----------+----------+
- | exponent | mantissa |
- +----------+----------+
- uint8 int32
- </doc>
-
- <doc type="bnf">
- dec32 = exponent mantissa
- exponent = uint8
- mantissa = int32
- </doc>
- </type>
-
- <!--
- 0xd0 - 0xdf: Fixed width types - 9 octets
- -->
-
- <type name="bin72" code="0xd0" fixed-width="9"
- label="nine octets of unspecified binary encoding">
- <doc>
- The bin72 type consists of nine consecutive octets of opaque binary data.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 1 OCTET 1 OCTET 1 OCTET
- +-----------+-----------+-----+-------------+------------+
- | octet-one | octet-two | ... | octet-eight | octet-nine |
- +-----------+-----------+-----+-------------+------------+
- </doc>
-
- <doc type="bnf">
- bin64 = 9 OCTET
- </doc>
- </type>
-
- <type name="dec64" code="0xd8" fixed-width="9"
- label="64-bit decimal value (e.g. for use in financial values)">
- <doc>
- The dec64 type is decimal value with a variable number of digits following the decimal point.
- It is encoded as an 8-bit unsigned integral value representing the number of decimal places.
- This is followed by the signed integral value encoded using a 64-bit two's complement
- representation in network byte order.
- </doc>
-
- <doc>
- The former value is referred to as the exponent of the divisor. The latter value is the
- mantissa. The decimal value is given by: mantissa / 10^exponent.
- </doc>
-
- <doc type="picture" title="Wire Format">
- 1 OCTET 8 OCTETs
- +----------+----------+
- | exponent | mantissa |
- +----------+----------+
- uint8 int64
- </doc>
-
- <doc type="bnf">
- dec64 = exponent mantissa
- exponent = uint8
- mantissa = int64
- </doc>
- </type>
-
- <!--
- 0xe0 - 0xef: Reserved
- -->
-
- <!--
- 0xf0 - 0xff: Zero-length types
- -->
-
- <type name="void" code="0xf0" fixed-width="0" label="the void type">
- <doc>
- The void type is used within tagged data structures such as maps and lists to indicate an
- empty value. The void type has no value and is encoded as an empty sequence of octets.
- </doc>
- </type>
-
- <type name="bit" code="0xf1" fixed-width="0" label="presence indicator">
- <doc>
- The bit type is used to indicate that a packing flag within a packed struct is being used to
- represent a boolean value based on the presence of an empty value. The bit type has no value
- and is encoded as an empty sequence of octets.
- </doc>
- </type>
-
- <!--
- ======================================================
- == CONSTANTS
- ======================================================
- -->
-
- <!-- Protocol constants -->
-
- <constant name="MIN-MAX-FRAME-SIZE" value="4096" label="The minimum size (in bytes) which can be
- agreed upon as the maximum frame size.">
- <doc>
- During the initial connection negotiation, the two peers must agree upon a maximum frame size.
- This constant defines the minimum value to which the maximum frame size can be set. By
- defining this value, the peers can guarantee that they can send frames of up to this size
- until they have agreed a definitive maximum frame size for that connection.
- </doc>
- </constant>
-
- <!--
- ======================================================
- == DOMAIN TYPES
- ======================================================
- -->
-
- <!-- Segment types -->
-
- <domain name="segment-type" type="uint8" label="valid values for the frame type indicator.">
- <doc>
- Segments are defined in <xref ref="specification.transport.assemblies_segments_and_frames"/>.
- The segment domain defines the valid values that may be used for the segment indicator within
- the frame header.
- </doc>
-
- <enum>
- <choice name="control" value="0">
- <doc>
- The frame type indicator for Control segments (see <xref
- ref="specification.formal_notation.controls"/>).
- </doc>
- </choice>
- <choice name="command" value="1">
- <doc>
- The frame type indicator for Command segments (see <xref
- ref="specification.formal_notation.commands"/>).
- </doc>
- </choice>
- <choice name="header" value="2" >
- <doc>
- The frame type indicator for Header segments (see <xref
- ref="specification.formal_notation.segments.header"/>).
- </doc>
- </choice>
- <choice name="body" value="3" >
- <doc>
- The frame type indicator for Body segments (see <xref
- ref="specification.formal_notation.segments.body"/>).
- </doc>
- </choice>
- </enum>
- </domain>
-
- <!-- Tracks -->
-
- <domain name="track" type="uint8" label="Valid values for transport level tracks">
- <doc> Tracks are defined in <xref ref="specification.transport.channels_and_tracks"/>. The
- track domain defines the valid values that may used for the track indicator within the frame
- header</doc>
- <enum>
- <choice name="control" value="0">
- <doc>
- The track used for all controls. All controls defined in this specification MUST be sent
- on track 0.
- </doc>
- </choice>
- <choice name="command" value="1">
- <doc>
- The track used for all commands. All commands defined in this specification MUST be sent
- on track 1.
- </doc>
- </choice>
- </enum>
- </domain>
-
-
- <domain name="str16-array" type="array" label="An array of values of type str16.">
- <doc>
- An array of values of type str16.
- </doc>
- </domain>
-
-
-
- <!-- == Class: connection ==================================================================== -->
-
- <class name="connection" code="0x1" label="work with connections">
- <doc>
- The connection class provides controls for a client to establish a network connection to a
- server, and for both peers to operate the connection thereafter.
- </doc>
-
- <doc type="grammar">
- connection = open-connection
- *use-connection
- close-connection
- open-connection = C:protocol-header
- S:START C:START-OK
- *challenge
- S:TUNE C:TUNE-OK
- C:OPEN S:OPEN-OK | S:REDIRECT
- challenge = S:SECURE C:SECURE-OK
- use-connection = *channel
- close-connection = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
- </doc>
-
- <role name="server" implement="MUST" />
- <role name="client" implement="MUST" />
-
- <domain name="close-code" type="uint16" label="code used in the connection.close control to
- indicate reason for closure">
- <enum>
- <choice name="normal" value="200">
- <doc>
- The connection closed normally.
- </doc>
- </choice>
-
- <choice name="connection-forced" value="320">
- <doc>
- An operator intervened to close the connection for some reason. The client may retry at
- some later date.
- </doc>
- </choice>
-
- <choice name="invalid-path" value="402">
- <doc>
- The client tried to work with an unknown virtual host.
- </doc>
- </choice>
-
- <choice name="framing-error" value="501">
- <doc>
- A valid frame header cannot be formed from the incoming byte stream.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="amqp-host-url" type="str16" label="URL for identifying an AMQP Server">
- <doc>
- The amqp-url domain defines a format for identifying an AMQP Server. It is used to provide
- alternate hosts in the case where a client has to reconnect because of failure, or because
- the server requests the client to do so upon initial connection.
- </doc>
- <doc type="bnf"><![CDATA[
- amqp_url = "amqp:" prot_addr_list
- prot_addr_list = [prot_addr ","]* prot_addr
- prot_addr = tcp_prot_addr | tls_prot_addr
-
- tcp_prot_addr = tcp_id tcp_addr
- tcp_id = "tcp:" | ""
- tcp_addr = [host [":" port] ]
- host = <as per http://www.ietf.org/rfc/rfc3986.txt>
- port = number]]>
- </doc>
- </domain>
-
- <domain name="amqp-host-array" type="array" label="An array of values of type amqp-host-url">
- <doc>
- Used to provide a list of alternate hosts.
- </doc>
- </domain>
-
- <!-- - Control: connection.start - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="start" code="0x1" label="start connection negotiation">
- <doc>
- This control starts the connection negotiation process by telling the client the supported
- security mechanisms and locales from which the client can choose.
- </doc>
-
- <rule name="protocol-name">
- <doc>
- If the server cannot support the protocol specified in the protocol header, it MUST close
- the socket connection without sending any response control.
- </doc>
- <doc type="scenario">
- The client sends a protocol header containing an invalid protocol name. The server must
- respond by closing the connection.
- </doc>
- </rule>
-
- <rule name="client-support">
- <doc>
- If the client cannot handle the protocol version suggested by the server it MUST close the
- socket connection.
- </doc>
- <doc type="scenario">
- The server sends a protocol version that is lower than any valid implementation, e.g. 0.1.
- The client must respond by closing the connection.
- </doc>
- </rule>
-
- <implement role="client" handle="MUST" />
-
- <response name="start-ok" />
-
- <field name="server-properties" type="map" label="server properties">
- <rule name="required-fields">
- <doc>
- The properties SHOULD contain at least these fields: "host", specifying the server host
- name or address, "product", giving the name of the server product, "version", giving the
- name of the server version, "platform", giving the name of the operating system,
- "copyright", if appropriate, and "information", giving other general information.
- </doc>
- <doc type="scenario">
- Client connects to server and inspects the server properties. It checks for the presence
- of the required fields.
- </doc>
- </rule>
- </field>
-
- <field name="mechanisms" type="str16-array" label="available security mechanisms"
- required="true">
- <doc>
- A list of the security mechanisms that the server supports.
- </doc>
- </field>
-
- <field name="locales" type="str16-array" label="available message locales" required="true">
- <doc>
- A list of the message locales that the server supports. The locale defines the language in
- which the server will send reply texts.
- </doc>
-
- <rule name="required-support">
- <doc>
- The server MUST support at least the en_US locale.
- </doc>
- <doc type="scenario">
- Client connects to server and inspects the locales field. It checks for the presence of
- the required locale(s).
- </doc>
- </rule>
- </field>
- </control>
-
- <!-- - Control: connection.start-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="start-ok" code="0x2" label="select security mechanism and locale">
- <doc>
- This control selects a SASL security mechanism.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="client-properties" type="map" label="client properties">
- <rule name="required-fields">
- <!-- This rule is not testable from the client side -->
- <doc>
- The properties SHOULD contain at least these fields: "product", giving the name of the
- client product, "version", giving the name of the client version, "platform", giving the
- name of the operating system, "copyright", if appropriate, and "information", giving
- other general information.
- </doc>
- </rule>
- </field>
-
- <field name="mechanism" type="str8" label="selected security mechanism" required="true">
- <doc>
- A single security mechanisms selected by the client, which must be one of those specified
- by the server.
- </doc>
-
- <rule name="security">
- <doc>
- The client SHOULD authenticate using the highest-level security profile it can handle
- from the list provided by the server.
- </doc>
- </rule>
-
- <rule name="validity">
- <doc>
- If the mechanism field does not contain one of the security mechanisms proposed by the
- server in the Start control, the server MUST close the connection without sending any
- further data.
- </doc>
- <doc type="scenario">
- Client connects to server and sends an invalid security mechanism. The server must
- respond by closing the connection (a socket close, with no connection close
- negotiation).
- </doc>
- </rule>
- </field>
-
- <field name="response" type="vbin32" label="security response data" required="true">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this data are
- defined by the SASL security mechanism.
- </doc>
- </field>
-
- <field name="locale" type="str8" label="selected message locale" required="true">
- <doc>
- A single message locale selected by the client, which must be one of those specified by
- the server.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.secure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="secure" code="0x3" label="security mechanism challenge">
- <doc>
- The SASL protocol works by exchanging challenges and responses until both peers have
- received sufficient information to authenticate each other. This control challenges the
- client to provide more information.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <response name="secure-ok" />
-
- <field name="challenge" type="vbin32" label="security challenge data" required="true">
- <doc>
- Challenge information, a block of opaque binary data passed to the security mechanism.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.secure-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="secure-ok" code="0x4" label="security mechanism response">
- <doc>
- This control attempts to authenticate, passing a block of SASL data for the security
- mechanism at the server side.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="response" type="vbin32" label="security response data" required="true">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this data are
- defined by the SASL security mechanism.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.tune - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="tune" code="0x5" label="propose connection tuning parameters">
- <doc>
- This control proposes a set of connection configuration values to the client. The client can
- accept and/or adjust these.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <response name="tune-ok" />
-
- <field name="channel-max" type="uint16" label="proposed maximum channels">
- <doc>
- The maximum total number of channels that the server allows per connection. If this is not
- set it means that the server does not impose a fixed limit, but the number of allowed
- channels may be limited by available server resources.
- </doc>
- </field>
-
- <field name="max-frame-size" type="uint16" label="proposed maximum frame size">
- <doc>
- The largest frame size that the server proposes for the connection. The client can
- negotiate a lower value. If this is not set means that the server does not impose any
- specific limit but may reject very large frames if it cannot allocate resources for them.
- </doc>
-
- <rule name="minimum">
- <doc>
- Until the max-frame-size has been negotiated, both peers MUST accept frames of up to
- MIN-MAX-FRAME-SIZE octets large, and the minimum negotiated value for max-frame-size is
- also MIN-MAX-FRAME-SIZE.
- </doc>
- <doc type="scenario">
- Client connects to server and sends a large properties field, creating a frame of
- MIN-MAX-FRAME-SIZE octets. The server must accept this frame.
- </doc>
- </rule>
- </field>
-
- <field name="heartbeat-min" type="uint16" label="the minimum supported heartbeat delay">
- <doc>
- The minimum delay, in seconds, of the connection heartbeat supported by the server. If
- this is not set it means the server does not support sending heartbeats.
- </doc>
- </field>
-
- <field name="heartbeat-max" type="uint16" label="the maximum supported heartbeat delay">
- <doc>
- The maximum delay, in seconds, of the connection heartbeat supported by the server. If
- this is not set it means the server has no maximum.
- </doc>
-
- <rule name="permitted-range">
- <doc>
- The heartbeat-max value must be greater than or equal to the value supplied in the
- heartbeat-min field.
- </doc>
- </rule>
-
- <rule name="no-heartbeat-min">
- <doc>
- If no heartbeat-min is supplied, then the heartbeat-max field MUST remain empty.
- </doc>
- </rule>
- </field>
- </control>
-
- <!-- - Control: connection.tune-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="tune-ok" code="0x6" label="negotiate connection tuning parameters">
- <doc>
- This control sends the client's connection tuning parameters to the server. Certain fields
- are negotiated, others provide capability information.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="channel-max" type="uint16" label="negotiated maximum channels" required="true">
- <doc>
- The maximum total number of channels that the client will use per connection.
- </doc>
-
- <rule name="upper-limit">
- <doc>
- If the client specifies a channel max that is higher than the value provided by the
- server, the server MUST close the connection without attempting a negotiated close. The
- server may report the error in some fashion to assist implementers.
- </doc>
-
- </rule>
-
- <rule name="available-channels">
- <doc>
- If the client agrees to a channel-max of N channels, then the channels available for
- communication between client and server are precisely the channels numbered 0 to (N-1).
- </doc>
- </rule>
- </field>
-
- <field name="max-frame-size" type="uint16" label="negotiated maximum frame size">
- <doc>
- The largest frame size that the client and server will use for the connection. If it is
- not set means that the client does not impose any specific limit but may reject very large
- frames if it cannot allocate resources for them. Note that the max-frame-size limit
- applies principally to content frames, where large contents can be broken into frames of
- arbitrary size.
- </doc>
-
- <rule name="minimum">
- <doc>
- Until the max-frame-size has been negotiated, both peers MUST accept frames of up to
- MIN-MAX-FRAME-SIZE octets large, and the minimum negotiated value for max-frame-size is
- also MIN-MAX-FRAME-SIZE.
- </doc>
- </rule>
-
- <rule name="upper-limit">
- <doc>
- If the client specifies a max-frame-size that is higher than the value provided by the
- server, the server MUST close the connection without attempting a negotiated close. The
- server may report the error in some fashion to assist implementers.
- </doc>
- </rule>
-
- <rule name="max-frame-size">
- <doc>
- A peer MUST NOT send frames larger than the agreed-upon size. A peer that receives an
- oversized frame MUST close the connection with the framing-error close-code.
- </doc>
- </rule>
- </field>
-
- <field name="heartbeat" type="uint16" label="negotiated heartbeat delay">
- <doc>
- The delay, in seconds, of the connection heartbeat chosen by the client. If it is not set
- it means the client does not want a heartbeat.
- </doc>
-
- <rule name="permitted-range">
- <doc>
- The chosen heartbeat MUST be in the range supplied by the heartbeat-min and
- heartbeat-max fields of connection.tune.
- </doc>
- </rule>
-
- <rule name="no-heartbeat-min">
- <doc>
- The heartbeat field MUST NOT be set if the heartbeat-min field of connection.tune was
- not set by the server.
- </doc>
- </rule>
- </field>
- </control>
-
- <!-- - Control: connection.open - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="open" code="0x7" label="open connection to virtual host">
- <doc>
- This control opens a connection to a virtual host, which is a collection of resources, and
- acts to separate multiple application domains within a server. The server may apply
- arbitrary limits per virtual host, such as the number of each type of entity that may be
- used, per connection and/or in total.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <response name="open-ok" />
- <response name="redirect" />
-
- <field name="virtual-host" type="str8" label="virtual host name" required="true">
- <doc>
- The name of the virtual host to work with.
- </doc>
-
- <rule name="separation">
- <doc>
- If the server supports multiple virtual hosts, it MUST enforce a full separation of
- exchanges, queues, and all associated entities per virtual host. An application,
- connected to a specific virtual host, MUST NOT be able to access resources of another
- virtual host.
- </doc>
- </rule>
-
- <rule name="security">
- <doc>
- The server SHOULD verify that the client has permission to access the specified virtual
- host.
- </doc>
- </rule>
- </field>
-
- <field name="capabilities" type="str16-array" label="required capabilities">
- <doc>
- The client can specify zero or more capability names. The server can use this to determine
- how to process the client's connection request.
- </doc>
- </field>
-
- <field name="insist" type="bit" label="insist on connecting to server">
- <doc>
- In a configuration with multiple collaborating servers, the server may respond to a
- connection.open control with a Connection.Redirect. The insist option tells the server
- that the client is insisting on a connection to the specified server.
- </doc>
- <rule name="behavior">
- <doc>
- When the client uses the insist option, the server MUST NOT respond with a
- Connection.Redirect control. If it cannot accept the client's connection request it
- should respond by closing the connection with a suitable reply code.
- </doc>
- </rule>
- </field>
- </control>
-
- <!-- - Control: connection.open-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="open-ok" code="0x8" label="signal that connection is ready">
- <doc>
- This control signals to the client that the connection is ready for use.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="known-hosts" type="amqp-host-array" label="alternate hosts which may be used in
- the case of failure">
- <doc>
- Specifies an array of equivalent or alternative hosts that the server knows about, which
- will normally include the current server itself. Each entry in the array will be in the
- form of an IP address or DNS name, optionally followed by a colon and a port number.
- Clients can cache this information and use it when reconnecting to a server after a
- failure. This field may be empty.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.redirect - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="redirect" code="0x9" label="redirects client to other server">
- <doc>
- This control redirects the client to another server, based on the requested virtual host
- and/or capabilities.
- </doc>
-
- <rule name="usage">
- <doc>
- When getting the connection.redirect control, the client SHOULD reconnect to the host
- specified, and if that host is not present, to any of the hosts specified in the
- known-hosts list.
- </doc>
- </rule>
-
- <implement role="client" handle="MUST" />
-
- <field name="host" type="amqp-host-url" label="server to connect to" required="true">
- <doc>
- Specifies the server to connect to.
- </doc>
- </field>
-
- <field name="known-hosts" type="amqp-host-array" label="alternate hosts to try in case of
- failure">
- <doc>
- An array of equivalent or alternative hosts that the server knows about.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.heartbeat - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="heartbeat" code="0xa" label="indicates connection is still alive">
- <doc>
- The heartbeat control may be used to generate artificial network traffic when a connection
- is idle. If a connection is idle for more than twice the negotiated heartbeat delay, the
- peers MAY be considered disconnected.
- </doc>
- </control>
-
- <!-- - Control: connection.close - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="close" code="0xb" label="request a connection close">
- <doc>
- This control indicates that the sender wants to close the connection. The reason for close
- is indicated with the reply-code and reply-text. The channel this control is sent on MAY be
- used to indicate which channel caused the connection to close.
- </doc>
-
- <implement role="client" handle="MUST" />
- <implement role="server" handle="MUST" />
-
- <response name="close-ok" />
-
- <field name="reply-code" type="close-code" label="the numeric reply code"
- required="true">
- <doc>
- Indicates the reason for connection closure.
- </doc>
- </field>
- <field name="reply-text" type="str8" label="the localized reply text">
- <doc>
- This text can be logged as an aid to resolving issues.
- </doc>
- </field>
- </control>
-
- <!-- - Control: connection.close-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <control name="close-ok" code="0xc" label="confirm a connection close">
- <doc>
- This control confirms a connection.close control and tells the recipient that it is safe to
- release resources for the connection and close the socket.
- </doc>
-
- <rule name="reporting">
- <doc>
- A peer that detects a socket closure without having received a Close-Ok handshake control
- SHOULD log the error.
- </doc>
- </rule>
-
- <implement role="client" handle="MUST" />
- <implement role="server" handle="MUST" />
- </control>
-
- </class>
-
- <!-- == Class: session ======================================================================= -->
-
- <class name="session" code="0x2" label="session controls">
- <doc>
- A session is a named interaction between two peers. Session names are chosen by the upper
- layers and may be used indefinitely. The model layer may associate long-lived or durable state
- with a given session name. The session layer provides transport of commands associated with
- this interaction.
- </doc>
-
- <doc>
- The controls defined within this class are specified in terms of the "sender" of commands and
- the "receiver" of commands. Since both client and server send and receive commands, the
- overall session dialog is symmetric, however the semantics of the session controls are defined
- in terms of a single sender/receiver pair, and it is assumed that the client and server will
- each contain both a sender and receiver implementation.
- </doc>
-
- <rule name="attachment">
- <doc>
- The transport MUST be attached in order to use any control other than "attach", "attached",
- "detach", or "detached". A peer receiving any other control on a detached transport MUST
- discard it and send a session.detached with the "not-attached" reason code.
- </doc>
- </rule>
-
- <role name="server" implement="MUST" />
- <role name="client" implement="MUST" />
-
- <role name="sender" implement="MUST">
- <doc>
- The sender of commands.
- </doc>
- </role>
- <role name="receiver" implement="MUST">
- <doc>
- The receiver of commands.
- </doc>
- </role>
-
- <domain name="name" type="vbin16" label="opaque session name">
- <doc>
- The session name uniquely identifies an interaction between two peers. It is scoped to a
- given authentication principal.
- </doc>
- </domain>
-
- <domain name="detach-code" type="uint8" label="reason for detach">
- <enum>
- <choice name="normal" value="0">
- <doc>
- The session was detached by request.
- </doc>
- </choice>
- <choice name="session-busy" value="1">
- <doc>
- The session is currently attached to another transport.
- </doc>
- </choice>
- <choice name="transport-busy" value="2">
- <doc>
- The transport is currently attached to another session.
- </doc>
- </choice>
- <choice name="not-attached" value="3">
- <doc>
- The transport is not currently attached to any session.
- </doc>
- </choice>
- <choice name="unknown-ids" value="4">
- <doc>
- Command data was received prior to any use of the command-point control.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="commands" type="sequence-set" label="identifies a set of commands">
- </domain>
-
- <struct name="header" size="1" pack="1">
- <doc>
- The session header appears on commands after the class and command id, but prior to command
- arguments.
- </doc>
-
- <field name="sync" type="bit" label="request notification of completion">
- <doc>
- Request notification of completion for this command.
- </doc>
- </field>
- </struct>
-
- <struct name="command-fragment" size="0" pack="0" label="byte-ranges within a set of commands">
-
- <field name="command-id" type="sequence-no" required="true">
-
- </field>
- <field name="byte-ranges" type="byte-ranges" required="true">
-
- </field>
- </struct>
-
- <domain name="command-fragments" type="array" label="an array of values of type
- command-fragment"/>
-
- <control name="attach" code="0x1" label="attach to the named session">
- <doc>
- Requests that the current transport be attached to the named session. Success or failure
- will be indicated with an attached or detached response. This control is idempotent.
- </doc>
-
- <rule name="one-transport-per-session">
- <doc>
- A session MUST NOT be attached to more than one transport at a time.
- </doc>
- </rule>
-
- <rule name="one-session-per-transport">
- <doc>
- A transport MUST NOT be attached to more than one session at a time.
- </doc>
- </rule>
-
- <rule name="idempotence">
- <doc>
- Attaching a session to its current transport MUST succeed and result in an attached
- response.
- </doc>
- </rule>
-
- <rule name="scoping">
- <doc>
- Attachment to the same session name from distinct authentication principals MUST succeed.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MAY" />
-
- <response name="attached"/>
- <response name="detached"/>
-
- <field name="name" type="name" label="the session name" required="true">
- <doc>
- Identifies the session to be attached to the current transport.
- </doc>
- </field>
-
- <field name="force" type="bit" label="force attachment to a busy session">
- <doc>
- If set then a busy session will be forcibly detached from its other transport and
- reattached to the current transport.
- </doc>
- </field>
- </control>
-
- <control name="attached" code="0x2" label="confirm attachment to the named session">
- <doc>
- Confirms successful attachment of the transport to the named session.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="name" type="name" label="the session name" required="true">
- <doc>
- Identifies the session now attached to the current transport.
- </doc>
- </field>
- </control>
-
- <control name="detach" code="0x3" label="detach from the named session">
- <doc>
- Detaches the current transport from the named session.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <response name="detached"/>
-
- <field name="name" type="name" label="the session name" required="true">
- <doc>
- Identifies the session to detach.
- </doc>
- </field>
- </control>
-
- <control name="detached" code="0x4" label="confirm detachment from the named session">
- <doc>
- Confirms detachment of the current transport from the named session.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="name" type="name" label="the session name" required="true">
- <doc>
- Identifies the detached session.
- </doc>
- </field>
- <field name="code" type="detach-code" label="the reason for detach" required="true">
- <doc>
- Identifies the reason for detaching from the named session.
- </doc>
- </field>
- </control>
-
- <!--
- Execution state is the set of confirmed, and completed incoming commands, as well as the set
- of outgoing in-doubt commands held for replay.
- -->
-
- <control name="request-timeout" code="0x5" label="requests the execution timeout be changed">
- <doc>
- This control may be sent by either the sender or receiver of commands. It requests that the
- execution timeout be changed. This is the minimum amount of time that a peer must preserve
- execution state for a detached session.
- </doc>
-
- <rule name="maximum-granted-timeout">
- <doc>
- The handler of this request MUST set his timeout to the maximum allowed value less than or
- equal to the requested timeout, and MUST convey the chosen timeout in the response.
- </doc>
- </rule>
-
- <implement role="sender" handle="MUST" />
- <implement role="receiver" handle="MUST" />
-
- <response name="timeout"/>
-
- <field name="timeout" type="uint32" label="the requested timeout">
- <doc>
- The requested timeout for execution state in seconds. If not set, this control requests
- that execution state is preserved indefinitely.
- </doc>
- </field>
- </control>
-
- <control name="timeout" code="0x6" label="the granted timeout">
- <doc>
- This control may be sent by the either the sender or receiver of commands. It is a
- one-to-one reply to the request-timeout control that indicates the granted timeout for
- execution state.
- </doc>
-
- <implement role="sender" handle="MUST" />
- <implement role="receiver" handle="MUST" />
-
- <field name="timeout" type="uint32" label="the execution timeout">
- <doc>
- The timeout for execution state. If not set, then execution state is preserved
- indefinitely.
- </doc>
- </field>
- </control>
-
- <control name="command-point" code="0x7"
- label="the command id and byte offset of subsequent data">
- <doc>
- This control is sent by the sender of commands and handled by the receiver of commands. This
- establishes the sequence numbers associated with all subsequent command data sent from the
- sender to the receiver. The subsequent command data will be numbered starting with the
- values supplied in this control and proceeding sequentially. This must be used at least once
- prior to sending any command data on newly attached transports.
- </doc>
-
- <rule name="newly-attached-transports">
- <doc>
- If command data is sent on a newly attached transport the session MUST be detached with an
- "unknown-id" reason-code.
- </doc>
- </rule>
-
- <rule name="zero-offset">
- <doc>
- If the offset is zero, the next data frame MUST have the first-frame and first-segment
- flags set. Violation of this is a framing error.
- </doc>
- </rule>
-
- <rule name="nonzero-offset">
- <doc>
- If the offset is nonzero, the next data frame MUST NOT have both the first-frame and
- first-segment flag set. Violation of this is a framing error.
- </doc>
- </rule>
-
- <implement role="receiver" handle="MUST" />
-
- <field name="command-id" type="sequence-no" label="the command-id of the next command"
- required="true"/>
- <field name="command-offset" type="uint64" label="the byte offset within the command"
- required="true"/>
- </control>
-
- <control name="expected" code="0x8" label="informs the peer of expected commands">
- <doc>
- This control is sent by the receiver of commands and handled by the sender of commands. It
- informs the sender of what commands and command fragments are expected at the receiver.
- This control is only sent in response to a flush control with the expected flag set. The
- expected control is never sent spontaneously.
- </doc>
-
- <rule name="include-next-command">
- <doc>
- The set of expected commands MUST include the next command after the highest seen command.
- </doc>
- </rule>
-
- <rule name="commands-empty-means-new-session">
- <doc>
- The set of expected commands MUST have zero elements if and only if the sender holds no
- execution state for the session (i.e. it is a new session).
- </doc>
- </rule>
-
- <rule name="no-overlaps">
- <doc>
- If a command-id appears in the commands field, it MUST NOT appear in the fragments field.
- </doc>
- </rule>
-
- <rule name="minimal-fragments">
- <doc>
- When choice is permitted, a command MUST appear in the commands field rather than the
- fragments field.
- </doc>
- </rule>
-
- <implement role="sender" handle="MUST" />
-
- <field name="commands" type="commands" label="expected commands" required="true"/>
- <field name="fragments" type="command-fragments" label="expected fragments" />
- </control>
-
- <control name="confirmed" code="0x9" label="notifies of confirmed commands">
- <doc>
- This control is sent by the receiver of commands and handled by the sender of commands. This
- sends the set of commands that will definitely be completed by this peer to the sender. This
- excludes commands known by the receiver to be considered confirmed or complete at the
- sender.
- </doc>
- <doc>
- This control must be sent if the partner requests the set of confirmed commands using the
- session.flush control with the confirmed flag set.
- </doc>
- <doc>
- This control may be sent spontaneously. One reason for separating confirmation from
- completion is for large persistent messages, where the receipt (and storage to a durable
- store) of part of the message will result in less data needing to be replayed in the case of
- transport failure during transmission.
- </doc>
- <doc>
- A simple implementation of an AMQP client or server may be implemented to take no action on
- receipt of session.confirmed controls, and take action only when receiving
- session.completed controls.
- </doc>
- <doc>
- A simple implementation of an AMQP client or server may be implemented such that it never
- spontaneously sends session.confirmed and that when requested for the set of confirmed
- commands (via the session.flush control) it responds with the same set of commands as it
- would to when the set of completed commands was requested (trivially all completed commands
- are confirmed).
- </doc>
-
- <rule name="durability">
- <doc>
- If a command has durable implications, it MUST NOT be confirmed until the fact of the
- command has been recorded on durable media.
- </doc>
- </rule>
-
- <rule name="no-overlaps">
- <doc>
- If a command-id appears in the commands field, it MUST NOT appear in the fragments field.
- </doc>
- </rule>
-
- <rule name="minimal-fragments">
- <doc>
- When choice is permitted, a command MUST appear in the commands field rather than the
- fragments field.
- </doc>
- </rule>
-
- <implement role="sender" handle="MUST" />
-
- <field name="commands" type="commands" label="entirely confirmed commands">
- <rule name="exclude-known-complete">
- <doc>
- Command-ids included in prior known-complete replies MUST be excluded from the set of
- all confirmed commands.
- </doc>
- </rule>
- </field>
- <field name="fragments" type="command-fragments" label="partially confirmed commands"/>
- </control>
-
- <control name="completed" code="0xa" label="notifies of command completion">
- <doc>
- This control is sent by the receiver of commands, and handled by the sender of commands. It
- informs the sender of all commands completed by the receiver. This excludes commands known
- by the receiver to be considered complete at the sender.
- </doc>
-
- <rule name="known-completed-reply">
- <doc>
- The sender MUST eventually reply with a known-completed set that covers the completed ids.
- </doc>
- </rule>
-
- <rule name="delayed-reply">
- <doc>
- The known-complete reply MAY be delayed at the senders discretion if the timely-reply
- field is not set.
- </doc>
- </rule>
-
- <rule name="merged-reply">
- <doc>
- Multiple replies may be merged by sending a single known-completed that includes the union
- of the merged command-id sets.
- </doc>
- </rule>
-
- <implement role="sender" handle="MUST" />
-
- <field name="commands" type="commands" label="completed commands">
- <doc>
- The ids of all completed commands. This excludes commands known by the receiver to be
- considered complete at the sender.
- </doc>
-
- <rule name="completed-implies-confirmed">
- <doc>
- The sender MUST consider any completed commands to also be confirmed.
- </doc>
- </rule>
-
- <rule name="exclude-known-complete">
- <doc>
- Command-ids included in prior known-complete replies MUST be excluded from the set of
- all completed commands.
- </doc>
- </rule>
- </field>
- <field name="timely-reply" type="bit">
- <doc>
- If set, the sender is no longer free to delay the known-completed reply.
- </doc>
- </field>
- </control>
-
- <control name="known-completed" code="0xb" label="Inform peer of which commands are known to be
- completed">
- <doc>
- This control is sent by the sender of commands, and handled by the receiver of commands. It
- is sent in reply to one or more completed controls from the receiver. It informs the
- receiver that commands are known to be completed by the sender.
- </doc>
-
- <rule name="stateless">
- <doc>
- The sender need not keep state to generate this reply. It is sufficient to reply to any
- completed control with an exact echo of the completed ids.
- </doc>
- </rule>
-
- <implement role="receiver" handle="MUST" />
-
- <field name="commands" type="commands" label="commands known to be complete">
- <doc>
- The set of completed commands for one or more session.completed controls.
- </doc>
-
- <rule name="known-completed-implies-known-confirmed">
- <doc>
- The receiver MUST treat any of the specified commands to be considered by the sender as
- confirmed as well as completed.
- </doc>
- </rule>
- </field>
- </control>
-
- <control name="flush" code="0xc" label="requests a session.completed">
- <doc>
- This control is sent by the sender of commands and handled by the receiver of commands. It
- requests that the receiver produce the indicated command sets. The receiver should issue the
- indicated sets at the earliest possible opportunity.
- </doc>
-
- <implement role="receiver" handle="MUST" />
-
- <field name="expected" type="bit" label="request notification of expected commands"/>
- <field name="confirmed" type="bit" label="request notification of confirmed commands"/>
- <field name="completed" type="bit" label="request notification of completed commands"/>
- </control>
-
- <control name="gap" code="0xd" label="indicates missing segments in the stream">
- <doc>
- This control is sent by the sender of commands and handled by the receiver of commands. It
- sends command ranges for which there will be no further data forthcoming. The receiver
- should proceed with the next available commands that arrive after the gap.
- </doc>
-
- <rule name="gap-confirmation-and-completion">
- <doc>
- The command-ids covered by a session.gap MUST be added to the completed and confirmed sets
- by the receiver.
- </doc>
- </rule>
-
- <rule name="aborted-commands">
- <doc>
- If a session.gap covers a partially received command, the receiving peer MUST treat the
- command as aborted.
- </doc>
- </rule>
-
- <rule name="completed-or-confirmed-commands">
- <doc>
- If a session.gap covers a completed or confirmed command, the receiving peer MUST continue
- to treat the command as completed or confirmed.
- </doc>
- </rule>
-
- <implement role="receiver" handle="MUST" />
-
- <field name="commands" type="commands">
- <doc>
- The set of command-ids that are contained in this gap.
- </doc>
- </field>
- </control>
-
- </class>
-
- <!-- == Class: execution ===================================================================== -->
-
- <class name="execution" code="0x3" label="execution commands">
- <doc>
- The execution class provides commands that carry execution information about other model level
- commands.
- </doc>
-
- <role name="server" implement="MUST"/>
- <role name="client" implement="MUST"/>
-
- <domain name="error-code" type="uint16">
- <enum>
- <choice name="unauthorized-access" value="403">
- <doc>
- The client attempted to work with a server entity to which it has no access due to
- security settings.
- </doc>
- </choice>
-
- <choice name="not-found" value="404">
- <doc>
- The client attempted to work with a server entity that does not exist.
- </doc>
- </choice>
-
- <choice name="resource-locked" value="405">
- <doc>
- The client attempted to work with a server entity to which it has no access because
- another client is working with it.
- </doc>
- </choice>
-
- <choice name="precondition-failed" value="406">
- <doc>
- The client requested a command that was not allowed because some precondition failed.
- </doc>
- </choice>
-
- <choice name="resource-deleted" value="408">
- <doc>
- A server entity the client is working with has been deleted.
- </doc>
- </choice>
-
- <choice name="illegal-state" value="409">
- <doc>
- The peer sent a command that is not permitted in the current state of the session.
- </doc>
- </choice>
-
- <choice name="command-invalid" value="503">
- <doc>
- The command segments could not be decoded.
- </doc>
- </choice>
-
- <choice name="resource-limit-exceeded" value="506">
- <doc>
- The client exceeded its resource allocation.
- </doc>
- </choice>
-
- <choice name="not-allowed" value="530">
- <doc>
- The peer tried to use a command a manner that is inconsistent with the rules described
- in the specification.
- </doc>
- </choice>
-
- <choice name="illegal-argument" value="531">
- <doc>
- The command argument is malformed, i.e. it does not fall within the specified domain.
- The illegal-argument exception can be raised on execution of any command which has
- domain valued fields.
- </doc>
- </choice>
-
- <choice name="not-implemented" value="540">
- <doc>
- The peer tried to use functionality that is not implemented in its partner.
- </doc>
- </choice>
-
- <choice name="internal-error" value="541">
- <doc>
- The peer could not complete the command because of an internal error. The peer may
- require intervention by an operator in order to resume normal operations.
- </doc>
- </choice>
-
- <choice name="invalid-argument" value="542">
- <doc>
- An invalid argument was passed to a command, and the operation could not
- proceed. An invalid argument is not illegal (see illegal-argument), i.e. it matches
- the domain definition; however the particular value is invalid in this context.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <!-- - Command: execution.sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="sync" code="0x1" label="request notification of completion for issued commands">
- <doc>
- This command is complete when all prior commands are completed.
- </doc>
-
- <implement role="server" handle="MUST"/>
- <implement role="client" handle="MUST"/>
- </command>
-
- <!-- - Command: execution.result - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="result" code="0x2" label="carries execution results">
- <doc>
- This command carries data resulting from the execution of a command.
- </doc>
-
- <implement role="server" handle="MUST"/>
- <implement role="client" handle="MUST"/>
-
- <field name="command-id" type="sequence-no" required="true"/>
- <field name="value" type="struct32"/>
- </command>
-
- <!-- - Command: execution.exception - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="exception" code="0x3" label="notifies a peer of an execution error">
- <doc>
- This command informs a peer of an execution exception. The command-id, when given,
- correlates the error to a specific command.
- </doc>
-
- <implement role="client" handle="MUST"/>
- <implement role="server" handle="MUST"/>
-
- <field name="error-code" type="error-code" required="true" label="error code indicating the
- type of error"/>
- <field name="command-id" type="sequence-no" label="exceptional command">
- <doc>
- The command-id of the command which caused the exception. If the exception was not caused
- by a specific command, this value is not set.
- </doc>
- </field>
- <field name="class-code" type="uint8" label="the class code of the command whose execution
- gave rise to the error (if appropriate)"/>
- <field name="command-code" type="uint8" label="the class code of the command whose execution
- gave rise to the error (if appropriate)"/>
- <field name="field-index" type="uint8" label="index of the exceptional field">
- <doc>
- The zero based index of the exceptional field within the arguments to the exceptional
- command. If the exception was not caused by a specific field, this value is not set.
- </doc>
- </field>
- <field name="description" type="str16" label="descriptive text on the exception">
- <doc>
- The description provided is implementation defined, but MUST be in the language
- appropriate for the selected locale. The intention is that this description is suitable
- for logging or alerting output.
- </doc>
- </field>
- <field name="error-info" type="map" label="map to carry additional information about the
- error"/>
-
- </command>
-
- </class>
-
- <!-- == Class: message ======================================================================= -->
-
- <class name="message" code="0x4" label="message transfer">
- <doc>
- The message class provides commands that support an industry-standard messaging model.
- </doc>
-
- <doc type="picture" title="Transfer States">
- START:
-
- The message has yet to be sent to the recipient.
-
- NOT-ACQUIRED:
-
- The message has been sent to the recipient, but is not
- acquired by the recipient.
-
- ACQUIRED:
-
- The message has been sent to and acquired by the recipient.
-
- END:
-
- The transfer is complete.
- </doc>
-
- <doc type="picture" title="State Transitions"><![CDATA[
- *:TRANSFER (accept-mode=none) *:TRANSFER (acquire-mode=pre-acquired)
- +---------------------------------START------------------------------------------+
- | | |
- | | *:TRANSFER (acquire-mode=not-acquired) |
- | | |
- | R:RELEASE \|/ |
- | +-------------NOT-ACQUIRED<--+ |
- | | | | | R:ACQUIRE (if unavailable) |
- | | | +-----+ |
- | | | |
- | | | R:ACQUIRE (if available) |
- | | | |
- | | \|/ |
- | | ACQUIRED<-------------------------------------------+
- | | |
- | | | R:ACCEPT / R:REJECT / R:RELEASE
- | | |
- | | \|/
- | +------------->END]]>
- | /|\
- | |
- +-------------------------------+
- </doc>
-
- <doc type="grammar">
- message = *:TRANSFER [ R:ACQUIRE ] [ R:ACCEPT / R:REJECT / R:RELEASE ]
- / *:RESUME
- / *:SET-FLOW-MODE
- / *:FLOW
- / *:STOP
- / C:SUBSCRIBE
- / C:CANCEL
- / C:FLUSH
- </doc>
-
- <rule name="persistent-message">
- <doc>
- The server SHOULD respect the delivery-mode property of messages and SHOULD make a
- best-effort to hold persistent messages on a reliable storage mechanism.
- </doc>
- <doc type="scenario">
- Send a persistent message to queue, stop server, restart server and then verify whether
- message is still present. Assumes that queues are durable. Persistence without durable
- queues makes no sense.
- </doc>
- </rule>
-
- <rule name="no-persistent-message-discard">
- <doc>
- The server MUST NOT discard a persistent message in case of a queue overflow.
- </doc>
- <doc type="scenario">
- Create a queue overflow situation with persistent messages and verify that messages do not
- get lost (presumably the server will write them to disk).
- </doc>
- </rule>
-
- <rule name="throttling">
- <doc>
- The server MAY use the message.flow command to slow or stop a message publisher when
- necessary.
- </doc>
- </rule>
-
- <rule name="non-persistent-message-overflow">
- <doc>
- The server MAY overflow non-persistent messages to persistent storage.
- </doc>
- </rule>
-
- <rule name="non-persistent-message-discard">
- <doc>
- The server MAY discard or dead-letter non-persistent messages on a priority basis if the
- queue size exceeds some configured limit.
- </doc>
- </rule>
-
- <rule name="min-priority-levels">
- <doc>
- The server MUST implement at least 2 priority levels for messages, where priorities 0 and
- 9 are treated as two distinct levels.
- </doc>
- </rule>
-
- <rule name="priority-level-implementation">
- <doc>
- The server SHOULD implement distinct priority levels in the following manner:
- </doc>
- <doc>
- If the server implements n distinct priorities then priorities 0 to 5 - ceiling(n/2) should
- be treated equivalently and should be the lowest effective priority. The priorities 4 +
- floor(n/2) should be treated equivalently and should be the highest effective priority. The
- priorities (5 - ceiling(n/2)) to (4 + floor(n/2)) inclusive must be treated as distinct
- priorities.
- </doc>
- <doc>
- Thus, for example, if 2 distinct priorities are implemented, then levels 0 to 4 are
- equivalent, and levels 5 to 9 are equivalent and levels 4 and 5 are distinct. If 3 distinct
- priorities are implements the 0 to 3 are equivalent, 5 to 9 are equivalent and 3, 4 and 5
- are distinct.
- </doc>
- <doc>
- This scheme ensures that if two priorities are distinct for a server which implements m
- separate priority levels they are also distinct for a server which implements n different
- priority levels where n > m.
- </doc>
- </rule>
-
- <rule name="priority-delivery">
- <doc>
- The server MUST deliver messages of the same priority in order irrespective of their
- individual persistence.
- </doc>
- <doc type="scenario">
- Send a set of messages with the same priority but different persistence settings to a queue.
- Subscribe and verify that messages arrive in same order as originally published.
- </doc>
- </rule>
-
- <role name="server" implement="MUST" />
- <role name="client" implement="MUST" />
-
- <domain name="destination" type="str8" label="destination for a message">
- <doc>
- Specifies the destination to which the message is to be transferred.
- </doc>
- </domain>
-
- <domain name="accept-mode" type="uint8" label="indicates a confirmation mode">
- <doc>
- Controls how the sender of messages is notified of successful transfer.
- </doc>
-
- <enum>
- <choice name="explicit" value="0">
- <doc>
- Successful transfer is signaled by message.accept. An acquired message (whether
- acquisition was implicit as in pre-acquired mode or explicit as in not-acquired mode) is
- not considered transferred until a message.accept that includes the transfer command is
- received.
- </doc>
- </choice>
-
- <choice name="none" value="1">
- <doc>
- Successful transfer is assumed when accept-mode is "pre-acquired". Messages transferred
- with an accept-mode of "not-acquired" cannot be acquired when accept-mode is "none".
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="acquire-mode" type="uint8" label="indicates the transfer mode">
- <doc>
- Indicates whether a transferred message can be considered as automatically acquired or
- whether an explicit request is necessary in order to acquire it.
- </doc>
-
- <enum>
- <choice name="pre-acquired" value="0">
- <doc>
- the message is acquired when the transfer starts
- </doc>
- </choice>
-
- <choice name="not-acquired" value="1">
- <doc>
- the message is not acquired when it arrives, and must be explicitly acquired by the
- recipient
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="reject-code" type="uint16" label="reject code for transfer">
- <doc>
- Code specifying the reason for a message reject.
- </doc>
- <enum>
- <choice name="unspecified" value="0">
- <doc>
- Rejected for an unspecified reason.
- </doc>
- </choice>
- <choice name="unroutable" value="1">
- <doc>
- Delivery was attempted but there were no queues which the message could be routed to.
- </doc>
- </choice>
- <choice name="immediate" value="2">
- <doc>
- The rejected message had the immediate flag set to true, but at the time of the transfer
- at least one of the queues to which it was to be routed did not have any subscriber able
- to take the message.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="resume-id" type="str16">
- <doc>
- A resume-id serves to identify partially transferred message content. The id is chosen by
- the sender, and must be unique to a given user. A resume-id is not expected to be unique
- across users.
- </doc>
- </domain>
-
- <domain name="delivery-mode" type="uint8"
- label="indicates whether a message should be treated as transient or durable">
- <doc>
-
- Used to set the reliability requirements for a message which is transferred to the server.
- </doc>
- <enum>
- <choice name="non-persistent" value="1">
- <doc>
- A non-persistent message may be lost in event of a failure, but the nature of the
- communication is such that an occasional message loss is tolerable. This is the lowest
- overhead mode. Non-persistent messages are delivered at most once only.
- </doc>
- </choice>
-
- <choice name="persistent" value="2">
- <doc>
- A persistent message is one which must be stored on a persistent medium (usually hard
- drive) at every stage of delivery so that it will not be lost in event of failure (other
- than of the medium itself). This is normally accomplished with some additional overhead.
- A persistent message may be delivered more than once if there is uncertainty about the
- state of its delivery after a failure and recovery.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="delivery-priority" type="uint8"
- label="indicates the desired priority to assign to a message transfer">
- <doc>
- Used to assign a priority to a message transfer. Priorities range from 0 (lowest) to 9
- (highest).
- </doc>
- <enum>
- <choice name="lowest" value="0">
- <doc>
- Lowest possible priority message.
- </doc>
- </choice>
-
- <choice name="lower" value="1">
- <doc>
- Very low priority message
- </doc>
- </choice>
-
- <choice name="low" value="2">
- <doc>
- Low priority message.
- </doc>
- </choice>
-
- <choice name="below-average" value="3">
- <doc>
- Below average priority message.
- </doc>
- </choice>
-
- <choice name="medium" value="4">
- <doc>
- Medium priority message.
- </doc>
- </choice>
-
-
- <choice name="above-average" value="5">
- <doc>
- Above average priority message
- </doc>
- </choice>
-
-
- <choice name="high" value="6">
- <doc>
- High priority message
- </doc>
- </choice>
-
- <choice name="higher" value="7">
- <doc>
- Higher priority message
- </doc>
- </choice>
-
- <choice name="very-high" value="8">
- <doc>
- Very high priority message.
- </doc>
- </choice>
-
- <choice name="highest" value="9">
- <doc>
- Highest possible priority message.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <struct name="delivery-properties" size="4" code="0x1" pack="2">
- <field name="discard-unroutable" type="bit" label="controls discard of unroutable messages">
- <doc>
- If set on a message that is not routable the broker can discard it. If not set, an
- unroutable message should be handled by reject when accept-mode is explicit; or by routing
- to the alternate-exchange if defined when accept-mode is none.
- </doc>
- </field>
-
- <field name="immediate" type="bit" label="Consider message unroutable if it cannot be
- processed immediately">
- <doc>
- If the immediate flag is set to true on a message transferred to a Server, then the
- message should be considered unroutable (and not delivered to any queues) if, for any
- queue that it is to be routed to according to the standard routing behavior, there is not
- a subscription on that queue able to receive the message. The treatment of unroutable
- messages is dependent on the value of the discard-unroutable flag.
- </doc>
- <doc>
- The immediate flag is ignored on transferred to a Client.
- </doc>
- </field>
-
- <field name="redelivered" type="bit" label="redelivery flag">
- <doc>
- This boolean flag indicates that the message may have been previously delivered to this
- or another client.
- </doc>
- <doc>
- If the redelivered flag is set on transfer to a Server, then any delivery of the message
- from that Server to a Client must also have the redelivered flag set to true.
- </doc>
- <rule name="implementation">
- <doc>
- The server MUST try to signal redelivered messages when it can. When redelivering a
- message that was not successfully accepted, the server SHOULD deliver it to the original
- client if possible.
- </doc>
- <doc type="scenario">
- Create a shared queue and publish a message to the queue. Subscribe using explicit
- accept-mode, but do not accept the message. Close the session, reconnect, and subscribe
- to the queue again. The message MUST arrive with the redelivered flag set.
- </doc>
- </rule>
- <rule name="hinting">
- <doc>
- The client should not rely on the redelivered field to detect duplicate messages where
- publishers may themselves produce duplicates. A fully robust client should be able to
- track duplicate received messages on non-transacted, and locally-transacted sessions.
- </doc>
- </rule>
- </field>
-
- <field name="priority" type="delivery-priority" label="message priority, 0 to 9"
- required="true">
- <doc> Message priority, which can be between 0 and 9. Messages with higher priorities may be
- delivered before those with lower priorities. </doc>
- </field>
-
- <field name="delivery-mode" type="delivery-mode" label="message persistence requirement"
- required="true">
- <doc> The delivery mode may be non-persistent or persistent. </doc>
- </field>
-
- <field name="ttl" type="uint64" label="time to live in ms">
- <doc> Duration in milliseconds for which the message should be considered "live". If this is
- set then a message expiration time will be computed based on the current time plus this
- value. Messages that live longer than their expiration time will be discarded (or dead
- lettered).</doc>
- <rule name="ttl-decrement">
- <doc>
- If a message is transferred between brokers before delivery to a final subscriber the
- ttl should be decremented before peer to peer transfer and both timestamp and expiration
- should be cleared.
- </doc>
- </rule>
- </field>
-
- <field name="timestamp" type="datetime" label="message timestamp">
- <doc>
- The timestamp is set by the broker on arrival of the message.
- </doc>
- </field>
-
- <field name="expiration" type="datetime" label="message expiration time">
- <doc>
- The expiration header assigned by the broker. After receiving the message the broker sets
- expiration to the sum of the ttl specified in the publish command and the current time.
- (ttl=expiration - timestamp)
- </doc>
- </field>
-
- <field name="exchange" type="exchange.name" label="originating exchange">
- <doc>
- Identifies the exchange specified in the destination field of the message.transfer used to
- publish the message. This MUST be set by the broker upon receipt of a message.
- </doc>
- </field>
-
- <field name="routing-key" type="str8" label="message routing key">
- <doc>
- The value of the key determines to which queue the exchange will send the message. The way
- in which keys are used to make this routing decision depends on the type of exchange to
- which the message is sent. For example, a direct exchange will route a message to a queue
- if that queue is bound to the exchange with a binding-key identical to the routing-key of
- the message.
- </doc>
- </field>
-
- <field name="resume-id" type="resume-id" label="global id for message transfer">
- <doc>
- When a resume-id is provided the recipient MAY use it to retain message data should the
- session expire while the message transfer is still incomplete.
- </doc>
- </field>
-
- <field name="resume-ttl" type="uint64" label="ttl in ms for interrupted message data">
- <doc>
- When a resume-ttl is provided the recipient MAY use it has a guideline for how long to
- retain the partially complete data when a resume-id is specified. If no resume-id is
- specified then this value should be ignored.
- </doc>
- </field>
- </struct>
-
- <struct name="fragment-properties" size="4" code="0x2" pack="2">
- <doc>
- These properties permit the transfer of message fragments. These may be used in conjunction
- with byte level flow control to limit the rate at which large messages are received. Only
- the first fragment carries the delivery-properties and message-properties.
-
- Syntactically each fragment appears as a complete message to the lower layers of the
- protocol, however the model layer is required to treat all the fragments as a single
- message. For example all fragments must be delivered to the same client. In pre-acquired
- mode, no message fragments can be delivered by the broker until the entire message has been
- received.
- </doc>
-
- <field name="first" type="bit" default="1">
- <doc>True if this fragment contains the start of the message, false otherwise.</doc>
- </field>
-
- <field name="last" type="bit" default="1">
- <doc>True if this fragment contains the end of the message, false otherwise.</doc>
- </field>
-
- <field name="fragment-size" type="uint64">
- <doc>This field may optionally contain the size of the fragment.</doc>
- </field>
- </struct>
-
- <struct name="reply-to" size="2" pack="2">
- <doc>The reply-to domain provides a simple address structure for replying to to a message to a
- destination within the same virtual-host.</doc>
- <field name="exchange" type="exchange.name" label="the name of the exchange to reply to"/>
- <field name="routing-key" type="str8" label="the routing-key to use when replying"/>
- </struct>
-
- <struct name="message-properties" size="4" code="0x3" pack="2">
- <field name="content-length" type="uint64" label="length of the body segment in bytes">
- <doc>
- The length of the body segment in bytes.
- </doc>
- </field>
-
- <field name="message-id" type="uuid" label="application message identifier">
- <doc>
- Message-id is an optional property of UUID type which uniquely identifies a message within
- the message system. The message producer is usually responsible for setting the
- message-id. The server MAY discard a message as a duplicate if the value of the message-id
- matches that of a previously received message. Duplicate messages MUST still be accepted
- if transferred with an accept-mode of "explicit".
- </doc>
-
- <rule name="unique">
- <doc>
- A message-id MUST be unique within a given server instance. A message-id SHOULD be
- globally unique (i.e. across different systems).
- </doc>
- </rule>
-
- <rule name="immutable">
- <doc>
- A message ID is immutable. Once set, a message-id MUST NOT be changed or reassigned,
- even if the message is replicated, resent or sent to multiple queues.
- </doc>
- </rule>
- </field>
-
- <field name="correlation-id" type="vbin16" label="application correlation identifier">
- <doc>
- This is a client-specific id that may be used to mark or identify messages between
- clients. The server ignores this field.
- </doc>
- </field>
-
- <field name="reply-to" type="reply-to" label="destination to reply to">
- <doc>
- The destination of any message that is sent in reply to this message.
- </doc>
- </field>
-
- <field name="content-type" type="str8" label="MIME content type">
- <doc>
- The RFC-2046 MIME type for the message content (such as "text/plain"). This is set by the
- originating client.
- </doc>
- </field>
-
- <field name="content-encoding" type="str8" label="MIME content encoding">
- <doc>
- The encoding for character-based message content. This is set by the originating client.
- Examples include UTF-8 and ISO-8859-15.
- </doc>
- </field>
-
- <field name="user-id" type="vbin16" label="creating user id">
- <doc>
- The identity of the user responsible for producing the message. The client sets this
- value, and it is authenticated by the broker.
- </doc>
-
- <rule name="authentication">
- <doc>
- The server MUST produce an unauthorized-access exception if the user-id field is set to
- a principle for which the client is not authenticated.
- </doc>
- </rule>
- </field>
-
- <field name="app-id" type="vbin16" label="creating application id">
- <doc>
- The identity of the client application responsible for producing the message.
- </doc>
- </field>
-
- <field name="application-headers" type="map" label="application specific headers table">
- <doc>
- This is a collection of user-defined headers or properties which may be set by the
- producing client and retrieved by the consuming client.
- </doc>
- </field>
- </struct>
-
- <domain name="flow-mode" type="uint8" label="the flow-mode for allocating flow credit">
- <enum>
- <choice name="credit" value="0">
- <doc>
- Credit based flow control.
- </doc>
- </choice>
-
- <choice name="window" value="1">
- <doc>
- Window based flow control.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <domain name="credit-unit" type="uint8" label="specifies the unit of credit balance">
- <enum>
- <choice name="message" value="0">
- <doc>Indicates a value specified in messages.</doc>
- </choice>
- <choice name="byte" value="1">
- <doc>Indicates a value specified in bytes.</doc>
- </choice>
- </enum>
- </domain>
-
- <!-- - Command: message.transfer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="transfer" code="0x1" label="transfer a message">
- <doc>
- This command transfers a message between two peers. When a client uses this command to
- publish a message to a broker, the destination identifies a specific exchange. The message
- will then be routed to queues as defined by the exchange configuration.
-
- The client may request a broker to transfer messages to it, from a particular queue, by
- issuing a subscribe command. The subscribe command specifies the destination that the broker
- should use for any resulting transfers.
- </doc>
-
- <rule name="transactional-publish">
- <doc>
- If a transfer to an exchange occurs within a transaction, then it is not available from
- the queue until the transaction commits. It is not specified whether routing takes place
- when the transfer is received or when the transaction commits.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
-
- <field name="destination" type="destination" label="message destination">
- <doc>
- Specifies the destination to which the message is to be transferred.
- </doc>
-
- <rule name="blank-destination">
- <doc>
- The server MUST accept a blank destination to mean the default exchange.
- </doc>
- </rule>
-
- <exception name="nonexistent-exchange" error-code="not-found">
- <doc>
- If the destination refers to an exchange that does not exist, the peer MUST raise a
- session exception.
- </doc>
- </exception>
- </field>
-
- <field name="accept-mode" type="accept-mode" required="true">
- <doc>
- Indicates whether message.accept, session.complete, or nothing at all is required to
- indicate successful transfer of the message.
- </doc>
- </field>
-
- <field name="acquire-mode" type="acquire-mode" required="true">
- <doc>
- Indicates whether or not the transferred message has been acquired.
- </doc>
- </field>
-
- <segments>
- <header>
- <entry type="delivery-properties"/>
- <entry type="fragment-properties"/>
- <entry type="message-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- <!-- - Command: message.accept - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="accept" code="0x2" label="reject a message">
- <doc>
- Accepts the message. Once a transfer is accepted, the command-id may no longer be referenced
- from other commands.
- </doc>
-
- <rule name="acquisition">
- <doc>
- The recipient MUST have acquired a message in order to accept it.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="transfers" type="session.commands" required="true">
- <doc>
- Identifies the messages previously transferred that should be accepted.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.reject - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="reject" code="0x3" label="reject a message">
- <doc>
- Indicates that the message transfers are unprocessable in some way. A server may reject a
- message if it is unroutable. A client may reject a message if it is invalid. A message may
- be rejected for other reasons as well. Once a transfer is rejected, the command-id may no
- longer be referenced from other commands.
- </doc>
-
- <rule name="alternate-exchange">
- <doc>
- When a client rejects a message, the server MUST deliver that message to the
- alternate-exchange on the queue from which it was delivered. If no alternate-exchange is
- defined for that queue the broker MAY discard the message.
- </doc>
- </rule>
-
- <rule name="acquisition">
- <doc>
- The recipient MUST have acquired a message in order to reject it. If the message is not
- acquired any reject MUST be ignored.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="transfers" type="session.commands" required="true">
- <doc>
- Identifies the messages previously transferred that should be rejected.
- </doc>
- </field>
- <field name="code" type="reject-code" required="true">
- <doc>
- Code describing the reason for rejection.
- </doc>
- </field>
- <field name="text" type="str8" label="informational text for message reject">
- <doc>
- Text describing the reason for rejection.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.release - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="release" code="0x4" label="release a message">
- <doc>
- Release previously transferred messages. When acquired messages are released, they become
- available for acquisition by any subscriber. Once a transfer is released, the command-id may
- no longer be referenced from other commands.
- </doc>
-
- <rule name="ordering">
- <doc>
- Acquired messages that have been released MAY subsequently be delivered out of order.
- Implementations SHOULD ensure that released messages keep their position with respect to
- undelivered messages of the same priority.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MAY" />
-
- <field name="transfers" type="session.commands" required="true">
- <doc>
- Indicates the messages to be released.
- </doc>
- </field>
- <field name="set-redelivered" type="bit" label="mark the released messages as redelivered">
- <doc>
- By setting set-redelivered to true, any acquired messages released to a queue with this
- command will be marked as redelivered on their next transfer from that queue. If this flag
- is not set, then an acquired message will retain its original redelivered status on the
- queue. Messages that are not acquired are unaffected by the value of this flag.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.acquire - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="acquire" code="0x5" label="acquire messages for consumption">
- <doc>
- Acquires previously transferred messages for consumption. The acquired ids (if any) are
- sent via message.acquired.
- </doc>
-
- <rule name="one-to-one">
- <doc>
- Each acquire MUST produce exactly one message.acquired even if it is empty.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="transfers" type="session.commands" required="true">
- <doc>
- Indicates the messages to be acquired.
- </doc>
- </field>
-
- <result>
- <struct name="acquired" size="4" code="0x4" pack="2" label="indicates acquired messages">
- <doc>
- Identifies a set of previously transferred messages that have now been acquired.
- </doc>
-
- <field name="transfers" type="session.commands" required="true">
- <doc>
- Indicates the acquired messages.
- </doc>
- </field>
- </struct>
- </result>
- </command>
-
- <!-- - Command: message.resume - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="resume" code="0x6" label="resume an interrupted message transfer">
- <doc>
- This command resumes an interrupted transfer. The recipient should return the amount of
- partially transferred data associated with the given resume-id, or zero if there is no data
- at all. If a non-zero result is returned, the recipient should expect to receive message
- fragment(s) containing the remainder of the interrupted message.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="destination" type="destination">
- <doc>
- The destination to which the remaining message fragments are transferred.
- </doc>
-
- <exception name="destination-not-found" error-code="not-found">
- <doc>If the destination does not exist, the recipient MUST close the session.</doc>
- </exception>
- </field>
-
- <field name="resume-id" type="resume-id" required="true">
- <doc>
- The name of the transfer being resumed.
- </doc>
-
- <rule name="unknown-resume-id">
- <doc>If the resume-id is not known, the recipient MUST return an offset of zero.</doc>
- </rule>
- </field>
-
- <result>
- <struct name="message-resume-result" size="4" code="0x5" pack="2">
- <field name="offset" type="uint64">
- <doc>
- Indicates the amount of data already transferred.
- </doc>
- </field>
- </struct>
- </result>
- </command>
-
- <!-- - Command: message.subscribe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="subscribe" code="0x7" label="start a queue subscription">
- <doc> This command asks the server to start a "subscription", which is a request for messages
- from a specific queue. Subscriptions last as long as the session they were created on, or
- until the client cancels them. </doc>
-
- <rule name="simultaneous-subscriptions">
- <doc> The server SHOULD support at least 16 subscriptions per queue, and ideally, impose no
- limit except as defined by available resources. </doc>
- <doc type="scenario"> Create a queue and create subscriptions on that queue until the server
- closes the connection. Verify that the number of subscriptions created was at least
- sixteen and report the total number. </doc>
- </rule>
-
- <rule name="default-flow-mode">
- <doc> The default flow mode for new subscriptions is window-mode. </doc>
- </rule>
-
- <exception name="queue-deletion" error-code="resource-deleted">
- <doc>
- If the queue for this subscription is deleted, any subscribing sessions MUST be closed.
- This exception may occur at any time after the subscription has been completed.
- </doc>
- </exception>
-
- <exception name="queue-not-found" error-code="not-found">
- <doc> If the queue for this subscription does not exist, then the subscribing session MUST
- be closed. </doc>
- </exception>
-
- <rule name="initial-credit">
- <doc>
- Immediately after a subscription is created, the initial byte and message credit for that
- destination is zero.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST"/>
-
- <field name="queue" type="queue.name" required="true">
- <doc> Specifies the name of the subscribed queue. </doc>
- </field>
-
- <field name="destination" type="destination" label="incoming message destination">
- <doc> The client specified name for the subscription. This is used as the destination for
- all messages transferred from this subscription. The destination is scoped to the session.
- </doc>
-
- <exception name="unique-subscriber-destination" error-code="not-allowed">
- <doc> The client MUST NOT specify a destination that refers to an existing subscription on
- the same session. </doc>
- <doc type="scenario"> Attempt to create two subscriptions on the same session with the
- same non-empty destination. </doc>
- </exception>
- </field>
-
- <field name="accept-mode" type="accept-mode" required="true">
- <doc> The accept-mode to use for messages transferred from this subscription. </doc>
- </field>
-
- <field name="acquire-mode" type="acquire-mode" required="true">
- <doc> The acquire-mode to use for messages transferred from this subscription. </doc>
- </field>
-
- <field name="exclusive" type="bit" label="request exclusive access">
- <doc> Request an exclusive subscription. This prevents other subscribers from subscribing to
- the queue. </doc>
-
- <exception name="in-use" error-code="resource-locked">
- <doc> The server MUST NOT grant an exclusive subscription to a queue that already has
- subscribers. </doc>
- <doc type="scenario"> Open two connections to a server, and in one connection create a
- shared (non-exclusive) queue and then subscribe to the queue. In the second connection
- attempt to subscribe to the same queue using the exclusive option. </doc>
- </exception>
- </field>
-
- <field name="resume-id" type="resume-id">
- <doc> Requests that the broker use the supplied resume-id when transferring messages for
- this subscription. </doc>
- </field>
-
- <field name="resume-ttl" type="uint64">
- <doc> Requested duration in milliseconds for the broker use as resume-ttl when transferring
- messages for this subscription. </doc>
- </field>
-
- <field name="arguments" type="map" label="arguments for vendor extensions">
- <doc> The syntax and semantics of these arguments depends on the providers implementation.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.cancel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="cancel" code="0x8" label="end a queue subscription">
- <doc>
- This command cancels a subscription. This does not affect already delivered messages, but it
- does mean the server will not send any more messages for that subscription. The client may
- receive an arbitrary number of messages in between sending the cancel command and receiving
- notification that the cancel command is complete.
- </doc>
-
- <rule name="post-cancel-transfer-resolution">
- <doc>
- Canceling a subscription MUST NOT affect pending transfers. A transfer made prior to
- canceling transfers to the destination MUST be able to be accepted, released, acquired, or
- rejected after the subscription is canceled.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="destination" type="destination" required="true">
- <exception name="subscription-not-found" error-code="not-found">
- <doc>
- If the subscription specified by the destination is not found, the server MUST close the
- session.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: message.set-flow-mode - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="set-flow-mode" code="0x9" label="set the flow control mode">
- <doc>
- Sets the mode of flow control used for a given destination to either window or credit based
- flow control.
-
- With credit based flow control, the sender of messages continually maintains its current
- credit balance with the recipient. The credit balance consists of two values, a message
- count, and a byte count. Whenever message data is sent, both counts must be decremented.
- If either value reaches zero, the flow of message data must stop. Additional credit is
- received via the message.flow command.
-
- The sender MUST NOT send partial assemblies. This means that if there is not enough byte
- credit available to send a complete message, the sender must either wait or use message
- fragmentation (see the fragment-properties header struct) to send the first part of the
- message data in a complete assembly.
-
- Window based flow control is identical to credit based flow control, however message
- transfer completion implicitly grants a single unit of message credit, and the size of the
- message in byte credits for each completed message transfer. Completion of the transfer
- command with session.completed is the only way credit is implicitly updated; message.accept,
- message.release, message.reject, tx.commit and tx.rollback have no effect on the outstanding
- credit balances.
- </doc>
-
- <rule name="byte-accounting">
- <doc>
- The byte count is decremented by the payload size of each transmitted frame with segment
- type header or body appearing within a message.transfer command. Note that the payload
- size is the frame size less the frame header size.
- </doc>
- </rule>
-
- <rule name="mode-switching">
- <doc>
- Mode switching may only occur if both the byte and message credit balance are zero. There
- are three ways for a recipient of messages to be sure that the sender's credit balances
- are zero:
-
- 1) The recipient may send a message.stop command to the sender. When the recipient
- receives notification of completion for the message.stop command, it knows that the
- sender's credit is zero.
-
- 2) The recipient may perform the same steps described in (1) with the message.flush
- command substituted for the message.stop command.
-
- 3) Immediately after a subscription is created with message.subscribe, the credit for
- that destination is zero.
- </doc>
- </rule>
-
- <rule name="default-flow-mode">
- <doc>
- Prior to receiving an explicit set-flow-mode command, a peer MUST consider the flow-mode
- to be window.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="destination" type="destination"/>
- <field name="flow-mode" type="flow-mode" required="true">
- <doc>
- The new flow control mode.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.flow - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="flow" code="0xa" label="control message flow">
- <doc>
- This command controls the flow of message data to a given destination. It is used by the
- recipient of messages to dynamically match the incoming rate of message flow to its
- processing or forwarding capacity. Upon receipt of this command, the sender must add "value"
- number of the specified unit to the available credit balance for the specified destination.
- A value of (0xFFFFFFFF) indicates an infinite amount of credit. This disables any limit for
- the given unit until the credit balance is zeroed with message.stop or message.flush.
- </doc>
-
- <!-- throws no-such-destination -->
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="destination" type="destination"/>
- <field name="unit" type="credit-unit" required="true">
- <doc>
- The unit of value.
- </doc>
- </field>
- <field name="value" type="uint32">
- <doc>
- If the value is not set then this indicates an infinite amount of credit.
- </doc>
- </field>
- </command>
-
- <!-- - Command: message.flush - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="flush" code="0xb" label="force the sending of available messages">
- <doc>
- Forces the sender to exhaust his credit supply. The sender's credit will always be zero when
- this command completes. The command completes when immediately available message data has
- been transferred, or when the credit supply is exhausted.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="destination" type="destination"/>
- </command>
-
- <!-- - Command: message.stop - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="stop" code="0xc" label="stop the sending of messages">
- <doc>
- On receipt of this command, a producer of messages MUST set his credit to zero for the given
- destination. When notifying of completion, credit MUST be zero and no further messages will
- be sent until such a time as further credit is received.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <field name="destination" type="destination"/>
- </command>
-
- </class>
-
- <!-- == Class: tx ============================================================================ -->
-
- <class name="tx" code="0x5" label="work with standard transactions">
- <doc>
- Standard transactions provide so-called "1.5 phase commit". We can ensure that work is never
- lost, but there is a chance of confirmations being lost, so that messages may be resent.
- Applications that use standard transactions must be able to detect and ignore duplicate
- messages.
- </doc>
-
- <doc type="grammar">
- tx = C:SELECT
- / C:COMMIT
- / C:ROLLBACK
- </doc>
-
- <!-- XXX: this isn't really a rule, as stated there is no way for
- a client library to implement this -->
- <rule name="duplicate-tracking">
- <doc>
- An client using standard transactions SHOULD be able to track all messages received within a
- reasonable period, and thus detect and reject duplicates of the same message. It SHOULD NOT
- pass these to the application layer.
- </doc>
- </rule>
-
- <role name="server" implement="SHOULD" />
-
- <!-- - Command: tx.select - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="select" code="0x1" label="select standard transaction mode">
- <doc>
- This command sets the session to use standard transactions. The client must use this command
- exactly once on a session before using the Commit or Rollback commands.
- </doc>
-
- <exception name="exactly-once" error-code="illegal-state">
- <doc>
- A client MUST NOT select standard transactions on a session that is already transactional.
- </doc>
- </exception>
-
- <exception name="no-dtx" error-code="illegal-state">
- <doc>
- A client MUST NOT select standard transactions on a session that is already enlisted in a
- distributed transaction.
- </doc>
- </exception>
-
- <exception name="explicit-accepts" error-code="not-allowed">
- <doc>
- On a session on which tx.select has been issued, a client MUST NOT issue a
- message.subscribe command with the accept-mode property set to any value other than
- explicit. Similarly a tx.select MUST NOT be issued on a session on which a there is a non
- cancelled subscriber with accept-mode of none.
- </doc>
- </exception>
-
- <implement role="server" handle="MUST" />
- </command>
-
- <!-- - Command: tx.commit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="commit" code="0x2" label="commit the current transaction">
- <doc>
- This command commits all messages published and accepted in the current transaction. A
- new transaction starts immediately after a commit.
- </doc>
- <doc>
- In more detail, the commit acts on all messages which have been transferred from the Client
- to the Server, and on all acceptances of messages sent from Server to Client. Since the
- commit acts on commands sent in the same direction as the commit command itself, there is no
- ambiguity on the scope of the commands being committed. Further, the commit will not be
- completed until all preceding commands which it affects have been completed.
- </doc>
- <doc>
- Since transactions act on explicit accept commands, the only valid accept-mode for message
- subscribers is explicit. For transferring messages from Client to Server (publishing) all
- accept-modes are permitted.
- </doc>
-
- <exception name="select-required" error-code="illegal-state">
- <doc>
- A client MUST NOT issue tx.commit on a session that has not been selected for standard
- transactions with tx.select.
- </doc>
- </exception>
-
-
-
- <implement role="server" handle="MUST" />
- </command>
-
- <!-- - Command: tx.rollback - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="rollback" code="0x3" label="abandon the current transaction">
- <doc>
- This command abandons the current transaction. In particular the transfers from Client to
- Server (publishes) and accepts of transfers from Server to Client which occurred in the
- current transaction are discarded. A new transaction starts immediately after a rollback.
- </doc>
- <doc>
- In more detail, when a rollback is issued, any the effects of transfers which occurred from
- Client to Server are discarded. The Server will issue completion notification for all such
- transfers prior to the completion of the rollback. Similarly the effects of any
- message.accept issued from Client to Server prior to the issuance of the tx.rollback will be
- discarded; and notification of completion for all such commands will be issued before the
- issuance of the completion for the rollback.
- </doc>
- <doc>
- After the completion of the rollback, the client will still hold the messages which it has
- not yet accepted (including those for which accepts were previously issued within the
- transaction); i.e. the messages remain "acquired". If the Client wishes to release those
- messages back to the Server, then appropriate message.release commands must be issued.
- </doc>
-
- <exception name="select-required" error-code="illegal-state">
- <doc>
- A client MUST NOT issue tx.rollback on a session that has not been selected for standard
- transactions with tx.select.
- </doc>
- </exception>
-
- <implement role="server" handle="MUST" />
- </command>
-
- </class>
-
- <!-- == Class: dtx =========================================================================== -->
-
- <class name="dtx" code="0x6" label="Demarcates dtx branches">
- <doc>
- This provides the X-Open XA distributed transaction protocol support. It allows a session
- to be selected for use with distributed transactions, the transactional boundaries for work on
- that session to be demarcated and allows the transaction manager to coordinate transaction
- outcomes.
- </doc>
-
- <doc type="grammar">
- dtx-demarcation = C:SELECT *demarcation
- demarcation = C:START C:END
- </doc>
-
- <doc type="grammar">
- dtx-coordination = *coordination
- coordination = command
- / outcome
- / recovery
- command = C:SET-TIMEOUT
- / C:GET-TIMEOUT
- outcome = one-phase-commit
- / one-phase-rollback
- / two-phase-commit
- / two-phase-rollback
- one-phase-commit = C:COMMIT
- one-phase-rollback = C:ROLLBACK
- two-phase-commit = C:PREPARE C:COMMIT
- two-phase-rollback = C:PREPARE C:ROLLBACK
- recovery = C:RECOVER *recovery-outcome
- recovery-outcome = one-phase-commit
- / one-phase-rollback
- / C:FORGET
-
- </doc>
-
- <rule name="transactionality">
- <doc>
- Enabling XA transaction support on a session requires that the server MUST manage
- transactions demarcated by start-end blocks. That is to say that on this XA-enabled session,
- work undergone within transactional blocks is performed on behalf a transaction branch
- whereas work performed outside of transactional blocks is NOT transactional.
- </doc>
- </rule>
-
- <role name="server" implement="MAY" />
- <role name="client" implement="MAY" />
-
- <!-- XA domains -->
-
- <domain name="xa-status" type="uint16" label="XA return codes">
- <enum>
- <choice name="xa-ok" value="0">
- <doc>
- Normal execution completion (no error).
- </doc>
- </choice>
-
- <choice name="xa-rbrollback" value="1">
- <doc>
- The rollback was caused for an unspecified reason.
- </doc>
- </choice>
-
- <choice name="xa-rbtimeout" value="2">
- <doc>
- A transaction branch took too long.
- </doc>
- </choice>
-
- <choice name="xa-heurhaz" value="3">
- <doc>
- The transaction branch may have been heuristically completed.
- </doc>
- </choice>
-
- <choice name="xa-heurcom" value="4">
- <doc>
- The transaction branch has been heuristically committed.
- </doc>
- </choice>
-
- <choice name="xa-heurrb" value="5">
- <doc>
- The transaction branch has been heuristically rolled back.
- </doc>
- </choice>
-
- <choice name="xa-heurmix" value="6">
- <doc>
- The transaction branch has been heuristically committed and rolled back.
- </doc>
- </choice>
-
- <choice name="xa-rdonly" value="7">
- <doc>
- The transaction branch was read-only and has been committed.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <struct name="xa-result" size="4" code="0x1" pack="2">
- <field name="status" type="xa-status" required="true"/>
- </struct>
-
- <!-- Struct for xid -->
-
- <struct name="xid" size="2" pack="2" label="dtx branch identifier">
- <doc>
- An xid uniquely identifies a transaction branch.
- </doc>
-
- <field name="format" type="uint32" label="implementation specific format code"
- required="true"/>
- <field name="global-id" type="vbin8" label="global transaction id" required="true"/>
- <field name="branch-id" type="vbin8" label="branch qualifier" required="true"/>
- </struct>
-
- <!-- - Command: dtx.select - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="select" code="0x1" label="Select dtx mode">
- <doc>
- This command sets the session to use distributed transactions. The client must use this
- command at least once on a session before using XA demarcation operations.
- </doc>
-
- <implement role="server" handle="MAY" />
- </command>
-
- <!-- - Command: dtx.start - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="start" code="0x2" label="Start a dtx branch">
- <doc>
- This command is called when messages should be produced and consumed on behalf a transaction
- branch identified by xid.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- send a session exception.
- </doc>
- </exception>
-
- <exception name="already-known" error-code="not-allowed">
- <doc>
- If neither join nor resume is specified is specified and the transaction branch specified
- by xid has previously been seen then the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="join-and-resume" error-code="not-allowed">
- <doc>
- If join and resume are specified then the server MUST raise an exception.
- </doc>
- </exception>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch to be started.
- </doc>
-
- <exception name="unknown-xid" error-code="not-allowed">
- <doc>
- If xid is already known by the broker then the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="join" type="bit" label="Join with existing xid flag">
- <doc>
- Indicate whether this is joining an already associated xid. Indicate that the start
- applies to joining a transaction previously seen.
- </doc>
-
- <exception name="unsupported" error-code="not-implemented">
- <doc>
- If the broker does not support join the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="resume" type="bit" label="Resume flag">
- <doc>
- Indicate that the start applies to resuming a suspended transaction branch specified.
- </doc>
- </field>
-
- <result type="xa-result">
- <doc>
- This confirms to the client that the transaction branch is started or specify the error
- condition.
-
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- </result>
- </command>
-
- <!-- - Command: dtx.end - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="end" code="0x3" label="End a dtx branch">
- <doc>
- This command is called when the work done on behalf a transaction branch finishes or needs
- to be suspended.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- raise an exception.
- </doc>
- </exception>
-
- <exception name="suspend-and-fail" error-code="not-allowed">
- <doc>
- If suspend and fail are specified then the server MUST raise an exception.
- </doc>
- </exception>
-
- <rule name="success">
- <doc>
- If neither fail nor suspend are specified then the portion of work has completed
- successfully.
- </doc>
- </rule>
-
- <rule name="session-closed">
- <doc>
- When a session is closed then the currently associated transaction branches MUST be marked
- rollback-only.
- </doc>
- </rule>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch to be ended.
- </doc>
-
- <exception name="not-associated" error-code="illegal-state">
- <doc>
- The session MUST be currently associated with the given xid (through an earlier start
- call with the same xid).
- </doc>
- </exception>
- </field>
-
- <field name="fail" type="bit" label="Failure flag">
- <doc>
- If set, indicates that this portion of work has failed; otherwise this portion of work has
- completed successfully.
- </doc>
-
- <rule name="failure">
- <doc>
- An implementation MAY elect to roll a transaction back if this failure notification is
- received. Should an implementation elect to implement this behavior, and this bit is
- set, then then the transaction branch SHOULD be marked as rollback-only and the end
- result SHOULD have the xa-rbrollback status set.
- </doc>
- </rule>
- </field>
-
- <field name="suspend" type="bit" label="Temporary suspension flag">
- <doc>
- Indicates that the transaction branch is temporarily suspended in an incomplete state.
- </doc>
-
- <rule name="resume">
- <doc>
- The transaction context is in a suspended state and must be resumed via the start
- command with resume specified.
- </doc>
- </rule>
-
- </field>
-
- <result type="xa-result">
- <doc>
- This command confirms to the client that the transaction branch is ended or specify the
- error condition.
-
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason. If an implementation chooses to implement rollback-on-failure behavior, then
- this value should be selected if the dtx.end.fail bit was set.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- </result>
- </command>
-
- <!-- - Command: dtx.commit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="commit" code="0x4" label="Commit work on dtx branch">
- <doc>
- Commit the work done on behalf a transaction branch. This command commits the work
- associated with xid. Any produced messages are made available and any consumed messages are
- discarded.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- raise an exception.
- </doc>
- </exception>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch to be committed.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-disassociated" error-code="illegal-state">
- <doc>
- If this command is called when xid is still associated with a session then the server
- MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="one-phase" type="bit" label="One-phase optimization flag">
- <doc>
- Used to indicate whether one-phase or two-phase commit is used.
- </doc>
-
- <exception name="one-phase" error-code="illegal-state">
- <doc>
- The one-phase bit MUST be set if a commit is sent without a preceding prepare.
- </doc>
- </exception>
-
- <exception name="two-phase" error-code="illegal-state">
- <doc>
- The one-phase bit MUST NOT be set if the commit has been preceded by prepare.
- </doc>
- </exception>
- </field>
-
- <result type="xa-result">
- <doc>
- This confirms to the client that the transaction branch is committed or specify the
- error condition.
-
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution
-
- xa-heurhaz: Due to some failure, the work done on behalf of the specified transaction
- branch may have been heuristically completed.
-
- xa-heurcom: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was committed.
-
- xa-heurrb: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was rolled back.
-
- xa-heurmix: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was partially committed and partially rolled back.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- </result>
- </command>
-
- <!-- - Command: dtx.forget - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="forget" code="0x5" label="Discard dtx branch">
- <doc>
- This command is called to forget about a heuristically completed transaction branch.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- raise an exception.
- </doc>
- </exception>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch to be forgotten.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-disassociated" error-code="illegal-state">
- <doc>
- If this command is called when xid is still associated with a session then the server
- MUST raise an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: dtx.get-timeout - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="get-timeout" code="0x6" label="Obtain dtx timeout in seconds">
- <doc>
- This command obtains the current transaction timeout value in seconds. If set-timeout was
- not used prior to invoking this command, the return value is the default timeout; otherwise,
- the value used in the previous set-timeout call is returned.
- </doc>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch for getting the timeout.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <result>
- <struct name="get-timeout-result" size="4" code="0x2" pack="2">
- <doc> Returns the value of the timeout last specified through set-timeout. </doc>
-
- <field name="timeout" type="uint32" label="The current transaction timeout value"
- required="true">
- <doc> The current transaction timeout value in seconds. </doc>
- </field>
- </struct>
- </result>
- </command>
-
- <!-- - Command: dtx.prepare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="prepare" code="0x7" label="Prepare a dtx branch">
- <doc>
- This command prepares for commitment any message produced or consumed on behalf of xid.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- raise an exception.
- </doc>
- </exception>
-
- <rule name="obligation-1">
- <doc>
- Once this command successfully returns it is guaranteed that the transaction branch may be
- either committed or rolled back regardless of failures.
- </doc>
- </rule>
-
- <rule name="obligation-2">
- <doc>
- The knowledge of xid cannot be erased before commit or rollback complete the branch.
- </doc>
- </rule>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch that can be prepared.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-disassociated" error-code="illegal-state">
- <doc>
- If this command is called when xid is still associated with a session then the server
- MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <result type="xa-result">
- <doc>
- This command confirms to the client that the transaction branch is prepared or specify the
- error condition.
-
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution.
-
- xa-rdonly: The transaction branch was read-only and has been committed.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- </result>
- </command>
-
- <!-- - Command: dtx.recover - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="recover" code="0x8" label="Get prepared or completed xids">
- <doc>
- This command is called to obtain a list of transaction branches that are in a prepared or
- heuristically completed state.
- </doc>
-
- <implement role="server" handle="MAY" />
-
- <result>
- <struct name="recover-result" size="4" code="0x3" pack="2">
- <doc>
- Returns to the client a table with single item that is a sequence of transaction xids
- that are in a prepared or heuristically completed state.
- </doc>
-
- <field name="in-doubt" type="array" label="array of xids to be recovered" required="true">
- <doc> Array containing the xids to be recovered (xids that are in a prepared or
- heuristically completed state). </doc>
-
- </field>
- </struct>
- </result>
- </command>
-
- <!-- - Command: dtx.rollback - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="rollback" code="0x9" label="Rollback a dtx branch">
- <doc>
- This command rolls back the work associated with xid. Any produced messages are discarded
- and any consumed messages are re-enqueued.
- </doc>
-
- <exception name="illegal-state" error-code="illegal-state">
- <doc>
- If the command is invoked in an improper context (see class grammar) then the server MUST
- raise an exception.
- </doc>
- </exception>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch that can be rolled back.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-disassociated" error-code="illegal-state">
- <doc>
- If this command is called when xid is still associated with a session then the server
- MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <result type="xa-result">
- <doc>
- This command confirms to the client that the transaction branch is rolled back or specify
- the error condition.
-
- The value of this field may be one of the following constants:
-
- xa-ok: Normal execution
-
- xa-heurhaz: Due to some failure, the work done on behalf of the specified transaction
- branch may have been heuristically completed.
-
- xa-heurcom: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was committed.
-
- xa-heurrb: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was rolled back.
-
- xa-heurmix: Due to a heuristic decision, the work done on behalf of the specified
- transaction branch was partially committed and partially rolled back.
-
- xa-rbrollback: The broker marked the transaction branch rollback-only for an unspecified
- reason.
-
- xa-rbtimeout: The work represented by this transaction branch took too long.
- </doc>
- </result>
- </command>
-
- <!-- - Command: dtx.set-timeout - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="set-timeout" code="0xa" label="Set dtx timeout value">
- <doc>
- Sets the specified transaction branch timeout value in seconds.
- </doc>
-
- <rule name="effective">
- <doc>
- Once set, this timeout value is effective until this command is reinvoked with a different
- value.
- </doc>
- </rule>
-
- <rule name="reset">
- <doc>
- A value of zero resets the timeout value to the default value.
- </doc>
- </rule>
-
- <implement role="server" handle="MAY" />
-
- <field name="xid" type="xid" label="Transaction xid" required="true">
- <doc>
- Specifies the xid of the transaction branch for setting the timeout.
- </doc>
-
- <exception name="unknown-xid" error-code="not-found">
- <doc>
- If xid is unknown (the transaction branch has not been started or has already been
- ended) then the server MUST raise an exception.
- </doc>
- </exception>
-
- </field>
-
- <field name="timeout" type="uint32" label="Dtx timeout in seconds" required="true">
- <doc>
- The transaction timeout value in seconds.
- </doc>
- </field>
- </command>
-
- </class>
-
- <!-- == Class: exchange ====================================================================== -->
-
- <class name="exchange" code="0x7" label="work with exchanges">
- <doc>
- Exchanges match and distribute messages across queues. Exchanges can be configured in the
- server or created at runtime.
- </doc>
-
- <doc type="grammar">
- exchange = C:DECLARE
- / C:DELETE
- / C:QUERY
- </doc>
-
- <rule name="required-types">
- <doc>
- The server MUST implement these standard exchange types: fanout, direct.
- </doc>
- <doc type="scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
-
- <rule name="recommended-types">
- <doc>
- The server SHOULD implement these standard exchange types: topic, headers.
- </doc>
- <doc type="scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
-
- <rule name="required-instances">
- <doc>
- The server MUST, in each virtual host, pre-declare an exchange instance for each standard
- exchange type that it implements, where the name of the exchange instance, if defined, is
- "amq." followed by the exchange type name.
-
- The server MUST, in each virtual host, pre-declare at least two direct exchange instances:
- one named "amq.direct", the other with no public name that serves as a default exchange for
- publish commands (such as message.transfer).
- </doc>
- <doc type="scenario">
- Client creates a temporary queue and attempts to bind to each required exchange instance
- ("amq.fanout", "amq.direct", "amq.topic", and "amq.headers" if those types are defined).
- </doc>
- </rule>
-
- <rule name="default-exchange">
- <doc>
- The server MUST pre-declare a direct exchange with no public name to act as the default
- exchange for content publish commands (such as message.transfer) and for default queue
- bindings.
- </doc>
- <doc type="scenario">
- Client checks that the default exchange is active by publishing a message with a suitable
- routing key but without specifying the exchange name, then ensuring that the message arrives
- in the queue correctly.
- </doc>
- </rule>
-
- <rule name="default-access">
- <doc>
- The default exchange MUST NOT be accessible to the client except by specifying an empty
- exchange name in a content publish command (such as message.transfer). That is, the server
- must not let clients explicitly bind, unbind, delete, or make any other reference to this
- exchange.
- </doc>
- </rule>
-
- <rule name="extensions">
- <doc>
- The server MAY implement other exchange types as wanted.
- </doc>
- </rule>
-
- <role name="server" implement="MUST" />
- <role name="client" implement="MUST" />
-
- <domain name="name" type="str8" label="exchange name">
- <doc>
- The exchange name is a client-selected string that identifies the exchange for publish
- commands. Exchange names may consist of any mixture of digits, letters, and underscores.
- Exchange names are scoped by the virtual host.
- </doc>
- </domain>
-
- <!-- - Command: exchange.declare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="declare" code="0x1" label="verify exchange exists, create if needed">
- <doc>
- This command creates an exchange if it does not already exist, and if the exchange exists,
- verifies that it is of the correct and expected class.
- </doc>
-
- <rule name="minimum">
- <doc>
- The server SHOULD support a minimum of 16 exchanges per virtual host and ideally, impose
- no limit except as defined by available resources.
- </doc>
- <doc type="scenario">
- The client creates as many exchanges as it can until the server reports an error; the
- number of exchanges successfully created must be at least sixteen.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="exchange" type="name" required="true">
- <exception name="reserved-names" error-code="not-allowed">
- <doc>
- Exchange names starting with "amq." are reserved for pre-declared and standardized
- exchanges. The client MUST NOT attempt to create an exchange starting with "amq.".
- </doc>
- </exception>
-
- <exception name="exchange-name-required" error-code="invalid-argument">
- <doc>
- The name of the exchange MUST NOT be a blank or empty string.
- </doc>
- </exception>
- </field>
-
- <field name="type" type="str8" label="exchange type" required="true">
- <doc>
- Each exchange belongs to one of a set of exchange types implemented by the server. The
- exchange types define the functionality of the exchange - i.e. how messages are routed
- through it. It is not valid or meaningful to attempt to change the type of an existing
- exchange.
- </doc>
-
- <exception name="typed" error-code="not-allowed">
- <doc>
- Exchanges cannot be redeclared with different types. The client MUST NOT attempt to
- redeclare an existing exchange with a different type than used in the original
- exchange.declare command.
- </doc>
- </exception>
-
- <exception name="exchange-type-not-found" error-code="not-found">
- <doc>
- If the client attempts to create an exchange which the server does not recognize, an
- exception MUST be sent.
- </doc>
- </exception>
- </field>
-
- <field name="alternate-exchange" type="name" label= "exchange name for unroutable messages">
- <doc>
- In the event that a message cannot be routed, this is the name of the exchange to which
- the message will be sent. Messages transferred using message.transfer will be routed to
- the alternate-exchange only if they are sent with the "none" accept-mode, and the
- discard-unroutable delivery property is set to false, and there is no queue to route to
- for the given message according to the bindings on this exchange.
- </doc>
-
- <rule name="empty-name">
- <doc>
- If alternate-exchange is not set (its name is an empty string), unroutable messages
- that would be sent to the alternate-exchange MUST be dropped silently.
- </doc>
- </rule>
-
- <exception name="pre-existing-exchange" error-code="not-allowed">
- <doc>
- If the alternate-exchange is not empty and if the exchange already exists with a
- different alternate-exchange, then the declaration MUST result in an exception.
- </doc>
- </exception>
-
- <rule name="double-failure">
- <doc>
- A message which is being routed to a alternate exchange, MUST NOT be re-routed to a
- secondary alternate exchange if it fails to route in the primary alternate exchange.
- After such a failure, the message MUST be dropped. This prevents looping.
- </doc>
- </rule>
- </field>
-
- <field name="passive" type="bit" label="do not create exchange">
- <doc>
- If set, the server will not create the exchange. The client can use this to check whether
- an exchange exists without modifying the server state.
- </doc>
- <exception name="not-found" error-code="not-found">
- <doc>
- If set, and the exchange does not already exist, the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="durable" type="bit" label="request a durable exchange">
- <doc>
- If set when creating a new exchange, the exchange will be marked as durable. Durable
- exchanges remain active when a server restarts. Non-durable exchanges (transient
- exchanges) are purged if/when a server restarts.
- </doc>
-
- <rule name="support">
- <doc>
- The server MUST support both durable and transient exchanges.
- </doc>
- </rule>
-
- <rule name="sticky">
- <doc>
- The server MUST ignore the durable field if the exchange already exists.
- </doc>
- </rule>
- </field>
-
- <field name="auto-delete" type="bit" label="auto-delete when unused">
- <doc>
- If set, the exchange is deleted automatically when there remain no bindings between the
- exchange and any queue. Such an exchange will not be automatically deleted until at least
- one binding has been made to prevent the immediate deletion of the exchange upon creation.
- </doc>
- <rule name="sticky">
- <doc>
- The server MUST ignore the auto-delete field if the exchange already exists.
- </doc>
- </rule>
- </field>
-
- <field name="arguments" type="map" label="arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these arguments
- depends on the server implementation. This field is ignored if passive is 1.
- </doc>
-
- <exception name="unknown-argument" error-code="not-implemented">
- <doc>
- If the arguments field contains arguments which are not understood by the server,
- it MUST raise an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: exchange.delete - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="delete" code="0x2" label="delete an exchange">
- <doc>
- This command deletes an exchange. When an exchange is deleted all queue bindings on the
- exchange are cancelled.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="exchange" type="name" required="true">
- <exception name="exists" error-code="not-found">
- <doc>
- The client MUST NOT attempt to delete an exchange that does not exist.
- </doc>
- </exception>
-
- <exception name="exchange-name-required" error-code="invalid-argument">
- <doc>
- The name of the exchange MUST NOT be a missing or empty string.
- </doc>
- </exception>
-
- <exception name="used-as-alternate" error-code="not-allowed">
- <doc>
- An exchange MUST NOT be deleted if it is in use as an alternate-exchange by a queue or
- by another exchange.
- </doc>
- </exception>
-
- </field>
-
- <field name="if-unused" type="bit" label="delete only if unused">
- <doc>
- If set, the server will only delete the exchange if it has no queue bindings. If the
- exchange has queue bindings the server does not delete it but raises an exception
- instead.
- </doc>
- <exception name="exchange-in-use" error-code="precondition-failed">
- <doc>
- If the exchange has queue bindings, and the if-unused flag is set, the server MUST NOT
- delete the exchange, but MUST raise and exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: exchange.query - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="query" code="0x3" label="request information about an exchange">
- <doc>
- This command is used to request information on a particular exchange.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="name" type="str8" label="the exchange name">
- <doc>
- The name of the exchange for which information is requested. If not specified explicitly
- the default exchange is implied.
- </doc>
- </field>
-
- <result>
- <struct name="exchange-query-result" size="4" code="0x1" pack="2">
- <doc>
- This is sent in response to a query request and conveys information on a particular
- exchange.
- </doc>
-
- <field name="type" type="str8" label="indicate the exchange type">
- <doc>
- The type of the exchange. Will be empty if the exchange is not found.
- </doc>
- </field>
-
- <field name="durable" type="bit" label="indicate the durability">
- <doc>
- The durability of the exchange, i.e. if set the exchange is durable. Will not be set
- if the exchange is not found.
- </doc>
- </field>
-
- <field name="not-found" type="bit" label="indicate an unknown exchange">
- <doc>
- If set, the exchange for which information was requested is not known.
- </doc>
- </field>
-
- <field name="arguments" type="map" label="other unspecified exchange properties">
- <doc>
- A set of properties of the exchange whose syntax and semantics depends on the server
- implementation. Will be empty if the exchange is not found.
- </doc>
- </field>
- </struct>
- </result>
- </command>
-
- <!-- - Command: exchange.bind - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="bind" code="0x4" label="bind queue to an exchange">
- <doc> This command binds a queue to an exchange. Until a queue is bound it will not receive
- any messages. In a classic messaging model, store-and-forward queues are bound to a direct
- exchange and subscription queues are bound to a topic exchange. </doc>
-
- <rule name="duplicates">
- <doc>
- A server MUST ignore duplicate bindings - that is, two or more bind commands with the
- same exchange, queue, and binding-key - without treating these as an error. The value of
- the arguments used for the binding MUST NOT be altered by subsequent binding requests.
- </doc>
- <doc type="scenario">
- A client binds a named queue to an exchange. The client then repeats the bind (with
- identical exchange, queue, and binding-key). The second binding should use a different
- value for the arguments field.
- </doc>
- </rule>
-
- <rule name="durable-exchange">
- <doc> Bindings between durable queues and durable exchanges are automatically durable and
- the server MUST restore such bindings after a server restart. </doc>
- <doc type="scenario"> A server creates a named durable queue and binds it to a durable
- exchange. The server is restarted. The client then attempts to use the queue/exchange
- combination. </doc>
- </rule>
-
- <rule name="binding-count">
- <doc> The server SHOULD support at least 4 bindings per queue, and ideally, impose no limit
- except as defined by available resources. </doc>
- <doc type="scenario"> A client creates a named queue and attempts to bind it to 4 different
- exchanges. </doc>
- </rule>
-
- <rule name="multiple-bindings">
- <doc> Where more than one binding exists between a particular exchange instance and a
- particular queue instance any given message published to that exchange should be delivered
- to that queue at most once, regardless of how many distinct bindings match. </doc>
- <doc type="scenario"> A client creates a named queue and binds it to the same topic exchange
- at least three times using intersecting binding-keys (for example, "animals.*",
- "animals.dogs.*", "animal.dogs.chihuahua"). Verify that a message matching all the
- bindings (using previous example, routing key = "animal.dogs.chihuahua") is delivered once
- only. </doc>
- </rule>
-
- <implement role="server" handle="MUST"/>
-
- <field name="queue" type="queue.name" required="true">
- <doc> Specifies the name of the queue to bind. </doc>
-
- <exception name="empty-queue" error-code="invalid-argument">
- <doc> A client MUST NOT be allowed to bind a non-existent and unnamed queue (i.e. empty
- queue name) to an exchange. </doc>
- <doc type="scenario"> A client attempts to bind with an unnamed (empty) queue name to an
- exchange. </doc>
- </exception>
-
- <exception name="queue-existence" error-code="not-found">
- <doc> A client MUST NOT be allowed to bind a non-existent queue (i.e. not previously
- declared) to an exchange. </doc>
- <doc type="scenario"> A client attempts to bind an undeclared queue name to an exchange.
- </doc>
- </exception>
- </field>
-
- <field name="exchange" type="name" label="name of the exchange to bind to" required="true">
- <exception name="exchange-existence" error-code="not-found">
- <doc> A client MUST NOT be allowed to bind a queue to a non-existent exchange. </doc>
- <doc type="scenario"> A client attempts to bind a named queue to a undeclared exchange.
- </doc>
- </exception>
-
- <exception name="exchange-name-required" error-code="invalid-argument">
- <doc> The name of the exchange MUST NOT be a blank or empty string. </doc>
- </exception>
- </field>
-
- <field name="binding-key" type="str8"
- label="identifies a binding between a given exchange and queue" required="true">
- <doc> The binding-key uniquely identifies a binding between a given (exchange, queue) pair.
- Depending on the exchange configuration, the binding key may be matched against the
- message routing key in order to make routing decisions. The match algorithm depends on the
- exchange type. Some exchange types may ignore the binding key when making routing
- decisions. Refer to the specific exchange type documentation. The meaning of an empty
- binding key depends on the exchange implementation. </doc>
- </field>
-
- <field name="arguments" type="map" label="arguments for binding">
- <doc> A set of arguments for the binding. The syntax and semantics of these arguments
- depends on the exchange class. </doc>
-
- <exception name="unknown-argument" error-code="not-implemented">
- <doc> If the arguments field contains arguments which are not understood by the server, it
- MUST raise an exception. </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: exchange.unbind - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="unbind" code="0x5" label="unbind a queue from an exchange">
- <doc>
- This command unbinds a queue from an exchange.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="queue" type="queue.name" required="true">
- <doc>
- Specifies the name of the queue to unbind.
- </doc>
- <exception name="non-existent-queue" error-code="not-found">
- <doc>
- If the queue does not exist the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="exchange" type="name" required="true">
- <doc>
- The name of the exchange to unbind from.
- </doc>
-
- <exception name="non-existent-exchange" error-code="not-found">
- <doc>
- If the exchange does not exist the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="exchange-name-required" error-code="invalid-argument">
- <doc>
- The name of the exchange MUST NOT be a blank or empty string.
- </doc>
- </exception>
- </field>
-
- <field name="binding-key" type="str8" label="the key of the binding" required="true">
- <doc>
- Specifies the binding-key of the binding to unbind.
- </doc>
-
- <exception name="non-existent-binding-key" error-code="not-found">
- <doc>
- If there is no matching binding-key the server MUST raise an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: exchange.bound - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="bound" code="0x6" label="request information about bindings to an exchange">
- <doc>
- This command is used to request information on the bindings to a particular exchange.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="exchange" type="str8" label="the exchange name">
- <doc>
- The name of the exchange for which binding information is being requested. If not
- specified explicitly the default exchange is implied.
- </doc>
- </field>
-
- <field name="queue" type="str8" label="a queue name" required="true">
- <doc>
- If populated then determine whether the given queue is bound to the exchange.
- </doc>
- </field>
-
- <field name="binding-key" type="str8" label="a binding-key">
- <doc>
- If populated defines the binding-key of the binding of interest, if not populated the
- request will ignore the binding-key on bindings when searching for a match.
- </doc>
- </field>
-
- <field name="arguments" type="map" label="a set of binding arguments">
- <doc>
- If populated defines the arguments of the binding of interest if not populated the request
- will ignore the arguments on bindings when searching for a match
- </doc>
- </field>
-
- <result>
- <struct name="exchange-bound-result" size="4" code="0x2" pack="2">
- <field name="exchange-not-found" type="bit" label="indicate an unknown exchange">
- <doc>
- If set, the exchange for which information was requested is not known.
- </doc>
- </field>
-
- <field name="queue-not-found" type="bit" label="indicate an unknown queue">
- <doc>
- If set, the queue specified is not known.
- </doc>
- </field>
-
- <field name="queue-not-matched" type="bit" label="indicate no matching queue">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange to
- the specified queue.
- </doc>
- </field>
-
- <field name="key-not-matched" type="bit" label="indicate no matching binding-key">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange
- with the specified binding-key.
- </doc>
- </field>
-
- <field name="args-not-matched" type="bit" label="indicate no matching arguments">
- <doc>
- A bit which if set indicates that no binding was found from the specified exchange
- with the specified arguments.
- </doc>
- </field>
- </struct>
- </result>
- </command>
-
- </class>
-
- <!-- == Class: queue ========================================================================= -->
-
- <class name="queue" code="0x8" label="work with queues">
- <doc>
- Queues store and forward messages. Queues can be configured in the server or created at
- runtime. Queues must be attached to at least one exchange in order to receive messages from
- publishers.
- </doc>
-
- <doc type="grammar">
- queue = C:DECLARE
- / C:BIND
- / C:PURGE
- / C:DELETE
- / C:QUERY
- / C:UNBIND
- </doc>
-
- <rule name="any-content">
- <doc>
- A server MUST allow any content class to be sent to any queue, in any mix, and queue and
- deliver these content classes independently. Note that all commands that fetch content off
- queues are specific to a given content class.
- </doc>
- <doc type="scenario">
- Client creates an exchange of each standard type and several queues that it binds to each
- exchange. It must then successfully send each of the standard content types to each of the
- available queues.
- </doc>
- </rule>
-
- <role name="server" implement="MUST" />
- <role name="client" implement="MUST" />
-
- <domain name="name" type="str8" label="queue name">
- <doc>
- The queue name identifies the queue within the virtual host. Queue names must have a length
- of between 1 and 255 characters inclusive, must start with a digit, letter or underscores
- ('_') character, and must be otherwise encoded in UTF-8.
- </doc>
- </domain>
-
- <!-- - Command: queue.declare - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="declare" code="0x1" label="declare queue">
- <doc>
- This command creates or checks a queue. When creating a new queue the client can specify
- various properties that control the durability of the queue and its contents, and the level
- of sharing for the queue.
- </doc>
-
- <rule name="default-binding">
- <doc>
- The server MUST create a default binding for a newly-created queue to the default
- exchange, which is an exchange of type 'direct' and use the queue name as the binding-key.
- </doc>
- <doc type="scenario">
- Client creates a new queue, and then without explicitly binding it to an exchange,
- attempts to send a message through the default exchange binding, i.e. publish a message to
- the empty exchange, with the queue name as binding-key.
- </doc>
- </rule>
-
- <rule name="minimum-queues">
- <doc>
- The server SHOULD support a minimum of 256 queues per virtual host and ideally, impose no
- limit except as defined by available resources.
- </doc>
- <doc type="scenario">
- Client attempts to create as many queues as it can until the server reports an error. The
- resulting count must at least be 256.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="queue" type="name" required="true">
- <exception name="reserved-prefix" error-code="not-allowed">
- <doc>
- Queue names starting with "amq." are reserved for pre-declared and standardized server
- queues. A client MUST NOT attempt to declare a queue with a name that starts with "amq."
- and the passive option set to zero.
- </doc>
- <doc type="scenario">
- A client attempts to create a queue with a name starting with "amq." and with the
- passive option set to zero.
- </doc>
- </exception>
- </field>
-
- <field name="alternate-exchange" type="exchange.name"
- label= "exchange name for messages with exceptions">
- <doc>
- The alternate-exchange field specifies how messages on this queue should be treated when
- they are rejected by a subscriber, or when they are orphaned by queue deletion. When
- present, rejected or orphaned messages MUST be routed to the alternate-exchange. In all
- cases the messages MUST be removed from the queue.
- </doc>
-
- <exception name="pre-existing-exchange" error-code="not-allowed">
- <doc>
- If the alternate-exchange is not empty and if the queue already exists with a different
- alternate-exchange, then the declaration MUST result in an exception.
- </doc>
- </exception>
-
- <exception name="unknown-exchange" error-code="not-found">
- <doc>
- if the alternate-exchange does not match the name of any existing exchange on the
- server, then an exception must be raised.
- </doc>
- </exception>
- </field>
-
- <field name="passive" type="bit" label="do not create queue">
- <doc>
- If set, the server will not create the queue. This field allows the client to assert the
- presence of a queue without modifying the server state.
- </doc>
-
- <exception name="passive" error-code="not-found">
- <doc>
- The client MAY ask the server to assert that a queue exists without creating the queue
- if not. If the queue does not exist, the server treats this as a failure.
- </doc>
- <doc type="scenario">
- Client declares an existing queue with the passive option and expects the command to
- succeed. Client then attempts to declare a non-existent queue with the passive option,
- and the server must close the session with the correct exception.
- </doc>
- </exception>
- </field>
-
- <field name="durable" type="bit" label="request a durable queue">
- <doc>
- If set when creating a new queue, the queue will be marked as durable. Durable queues
- remain active when a server restarts. Non-durable queues (transient queues) are purged
- if/when a server restarts. Note that durable queues do not necessarily hold persistent
- messages, although it does not make sense to send persistent messages to a transient
- queue.
- </doc>
-
- <rule name="persistence">
- <doc>
- The queue definition MUST survive the server losing all transient memory, e.g. a
- machine restart.
- </doc>
- <doc type="scenario">
- Client creates a durable queue; server is then restarted. Client then attempts to send
- message to the queue. The message should be successfully delivered.
- </doc>
- </rule>
-
- <rule name="types">
- <doc>
- The server MUST support both durable and transient queues.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one durable and one transient.
- </doc>
- </rule>
-
- <rule name="pre-existence">
- <doc>
- The server MUST ignore the durable field if the queue already exists.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one durable and one transient. The client then
- attempts to declare the two queues using the same names again, but reversing the value
- of the durable flag in each case. Verify that the queues still exist with the original
- durable flag values.
- </doc>
- </rule>
- </field>
-
- <field name="exclusive" type="bit" label="request an exclusive queue">
- <doc>
- Exclusive queues can only be used from one session at a time. Once a session
- declares an exclusive queue, that queue cannot be used by any other session until the
- declaring session closes.
- </doc>
-
- <rule name="types">
- <doc>
- The server MUST support both exclusive (private) and non-exclusive (shared) queues.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one exclusive and one non-exclusive.
- </doc>
- </rule>
-
- <exception name="in-use" error-code="resource-locked">
- <doc>
- If the server receives a declare, bind, consume or get request for a queue that has been
- declared as exclusive by an existing client session, it MUST raise an exception.
- </doc>
- <doc type="scenario">
- A client declares an exclusive named queue. A second client on a different session
- attempts to declare a queue of the same name.
- </doc>
- </exception>
- </field>
-
- <field name="auto-delete" type="bit" label="auto-delete queue when unused">
- <doc>
- If this field is set and the exclusive field is also set, then the queue MUST be deleted
- when the session closes.
-
- If this field is set and the exclusive field is not set the queue is deleted when all
- the consumers have finished using it. Last consumer can be cancelled either explicitly
- or because its session is closed. If there was no consumer ever on the queue, it won't
- be deleted.
- </doc>
-
- <rule name="pre-existence">
- <doc>
- The server MUST ignore the auto-delete field if the queue already exists.
- </doc>
- <doc type="scenario">
- A client creates two named queues, one as auto-delete and one explicit-delete. The
- client then attempts to declare the two queues using the same names again, but reversing
- the value of the auto-delete field in each case. Verify that the queues still exist with
- the original auto-delete flag values.
- </doc>
- </rule>
- </field>
-
- <field name="arguments" type="map" label="arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these arguments
- depends on the server implementation. This field is ignored if passive is 1.
- </doc>
-
- <exception name="unknown-argument" error-code="not-implemented">
- <doc>
- If the arguments field contains arguments which are not understood by the server,
- it MUST raise an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: queue.delete - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="delete" code="0x2" label="delete a queue">
- <doc>
- This command deletes a queue. When a queue is deleted any pending messages are sent to the
- alternate-exchange if defined, or discarded if it is not.
- </doc>
-
-
- <implement role="server" handle="MUST" />
-
- <field name="queue" type="name" required="true">
- <doc>
- Specifies the name of the queue to delete.
- </doc>
-
- <exception name="empty-name" error-code="invalid-argument">
- <doc>
- If the queue name in this command is empty, the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="queue-exists" error-code="not-found">
- <doc>
- The queue must exist. If the client attempts to delete a non-existing queue the server
- MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="if-unused" type="bit" label="delete only if unused">
- <doc>
- If set, the server will only delete the queue if it has no consumers. If the queue has
- consumers the server does does not delete it but raises an exception instead.
- </doc>
-
- <exception name="if-unused-flag" error-code="precondition-failed">
- <doc>
- The server MUST respect the if-unused flag when deleting a queue.
- </doc>
- </exception>
- </field>
-
- <field name="if-empty" type="bit" label="delete only if empty">
- <doc>
- If set, the server will only delete the queue if it has no messages.
- </doc>
- <exception name="not-empty" error-code="precondition-failed">
- <doc>
- If the queue is not empty the server MUST raise an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: queue.purge - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="purge" code="0x3" label="purge a queue">
- <doc>
- This command removes all messages from a queue. It does not cancel subscribers. Purged
- messages are deleted without any formal "undo" mechanism.
- </doc>
-
- <rule name="empty">
- <doc>
- A call to purge MUST result in an empty queue.
- </doc>
- </rule>
-
- <rule name="pending-messages">
- <doc>
- The server MUST NOT purge messages that have already been sent to a client but not yet
- accepted.
- </doc>
- </rule>
-
- <rule name="purge-recovery">
- <doc>
- The server MAY implement a purge queue or log that allows system administrators to recover
- accidentally-purged messages. The server SHOULD NOT keep purged messages in the same
- storage spaces as the live messages since the volumes of purged messages may get very
- large.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="queue" type="name" required="true">
- <doc>
- Specifies the name of the queue to purge.
- </doc>
-
- <exception name="empty-name" error-code="invalid-argument">
- <doc>
- If the the queue name in this command is empty, the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="queue-exists" error-code="not-found">
- <doc>
- The queue MUST exist. Attempting to purge a non-existing queue MUST cause an exception.
- </doc>
- </exception>
- </field>
- </command>
-
- <!-- - Command: queue.query - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="query" code="0x4" label="request information about a queue">
- <doc>
- This command requests information about a queue.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="queue" type="name" label="the queried queue" required="true"/>
-
- <result>
- <struct name="queue-query-result" size="4" code="0x1" pack="2">
- <doc>
- This is sent in response to queue.query, and conveys the requested information about a
- queue. If no queue with the specified name exists then none of the fields within the
- returned result struct will be populated.
- </doc>
-
- <field name="queue" type="name" required="true">
- <doc>
- Reports the name of the queue.
- </doc>
- </field>
-
- <field name="alternate-exchange" type="exchange.name" />
-
- <field name="durable" type="bit" />
-
- <field name="exclusive" type="bit" />
-
- <field name="auto-delete" type="bit" />
-
- <field name="arguments" type="map" />
-
- <field name="message-count" type="uint32" label="number of messages in queue"
- required="true">
- <doc> Reports the number of messages in the queue. </doc>
- </field>
-
- <field name="subscriber-count" type="uint32" label="number of subscribers"
- required="true">
- <doc>
- Reports the number of subscribers for the queue.
- </doc>
- </field>
- </struct>
- </result>
- </command>
-
- </class>
-
- <!-- == Class: file ========================================================================== -->
-
- <class name="file" code="0x9" label="work with file content">
- <doc>
- The file class provides commands that support reliable file transfer. File messages have a
- specific set of properties that are required for interoperability with file transfer
- applications. File messages and acknowledgements are subject to session transactions. Note
- that the file class does not provide message browsing commands; these are not compatible with
- the staging model. Applications that need browsable file transfer should use Message content
- and the Message class.
- </doc>
-
- <doc type="grammar">
- file = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL
- / C:OPEN S:OPEN-OK C:STAGE content
- / S:OPEN C:OPEN-OK S:STAGE content
- / C:PUBLISH
- / S:DELIVER
- / S:RETURN
- / C:ACK
- / C:REJECT
- </doc>
-
- <rule name="reliable-storage">
- <doc>
- The server MUST make a best-effort to hold file messages on a reliable storage mechanism.
- </doc>
- </rule>
-
- <rule name="no-discard">
- <doc>
- The server MUST NOT discard a file message in case of a queue overflow. The server MUST use
- the Session.Flow command to slow or stop a file message publisher when necessary.
- </doc>
- </rule>
-
- <rule name="priority-levels">
- <doc>
- The server MUST implement at least 2 priority levels for file messages, where priorities 0-4
- and 5-9 are treated as two distinct levels. The server MAY implement up to 10 priority
- levels.
- </doc>
- </rule>
-
- <rule name="acknowledgement-support">
- <doc>
- The server MUST support both automatic and explicit acknowledgements on file content.
- </doc>
- </rule>
-
- <role name="server" implement="MAY" />
- <role name="client" implement="MAY" />
-
- <!-- These are the properties for a File content -->
- <struct name="file-properties" size="4" code="0x1" pack="2">
- <field name="content-type" type="str8" label="MIME content type" />
- <field name="content-encoding" type="str8" label="MIME content encoding" />
- <field name="headers" type="map" label="message header field table" />
- <field name="priority" type="uint8" label="message priority, 0 to 9" />
- <field name="reply-to" type="str8" label="destination to reply to" />
- <field name="message-id" type="str8" label="application message identifier" />
- <field name="filename" type="str8" label="message filename" />
- <field name="timestamp" type="datetime" label="message timestamp" />
- <!-- This field is deprecated pending review -->
- <field name="cluster-id" type="str8" label="intra-cluster routing identifier" />
- </struct>
-
- <domain name="return-code" type="uint16" label="return code from server">
- <doc>
- The return code. The AMQP return codes are defined by this enum.
- </doc>
- <enum>
- <choice name="content-too-large" value="311">
- <doc>
- The client attempted to transfer content larger than the server could accept.
- </doc>
- </choice>
-
- <choice name="no-route" value="312">
- <doc>
- The exchange cannot route a message, most likely due to an invalid routing key. Only
- when the mandatory flag is set.
- </doc>
- </choice>
-
- <choice name="no-consumers" value="313">
- <doc>
- The exchange cannot deliver to a consumer when the immediate flag is set. As a result of
- pending data on the queue or the absence of any consumers of the queue.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <!-- - Command: file.qos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="qos" code="0x1" label="specify quality of service">
- <doc>
- This command requests a specific quality of service. The QoS can be specified for the
- current session or for all sessions on the connection. The particular properties and
- semantics of a qos command always depend on the content class semantics. Though the qos
- command could in principle apply to both peers, it is currently meaningful only for the
- server.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <response name="qos-ok" />
-
- <field name="prefetch-size" type="uint32" label="pre-fetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client finishes
- processing a message, the following message is already held locally, rather than needing
- to be sent within the session. Pre-fetching gives a performance improvement. This field
- specifies the pre-fetch window size in octets. May be set to zero, meaning "no specific
- limit". Note that other pre-fetch limits may still apply. The prefetch-size is ignored if
- the no-ack option is set.
- </doc>
- </field>
-
- <field name="prefetch-count" type="uint16" label="pre-fetch window in messages">
- <doc>
- Specifies a pre-fetch window in terms of whole messages. This is compatible with some file
- API implementations. This field may be used in combination with the prefetch-size field; a
- message will only be sent in advance if both pre-fetch windows (and those at the session
- and connection level) allow it. The prefetch-count is ignored if the no-ack option is set.
- </doc>
-
- <rule name="prefetch-discretion">
- <doc>
- The server MAY send less data in advance than allowed by the client's specified
- pre-fetch windows but it MUST NOT send more.
- </doc>
- </rule>
- </field>
-
- <field name="global" type="bit" label="apply to entire connection">
- <doc>
- By default the QoS settings apply to the current session only. If this field is set, they
- are applied to the entire connection.
- </doc>
- </field>
- </command>
-
- <!-- - Command: file.qos-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="qos-ok" code="0x2" label="confirm the requested qos">
- <doc>
- This command tells the client that the requested QoS levels could be handled by the server.
- The requested QoS applies to all active consumers until a new QoS is defined.
- </doc>
-
- <implement role="client" handle="MUST" />
- </command>
-
- <!-- - Command: file.consume - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="consume" code="0x3" label="start a queue consumer">
- <doc>
- This command asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the session they were created on,
- or until the client cancels them.
- </doc>
-
- <rule name="min-consumers">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was declared
- as private, and ideally, impose no limit except as defined by available resources.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <response name="consume-ok" />
-
- <field name="queue" type="queue.name">
- <doc>
- Specifies the name of the queue to consume from.
- </doc>
-
- <exception name="queue-exists-if-empty" error-code="not-allowed">
- <doc>
- If the queue name in this command is empty, the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="consumer-tag" type="str8">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a connection, so
- two clients can use the same consumer tags.
- </doc>
-
- <exception name="not-existing-consumer" error-code="not-allowed">
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to create two
- consumers with the same non-empty tag the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-empty-consumer-tag" error-code="not-allowed">
- <doc>
- The client MUST NOT specify a tag that is empty or blank.
- </doc>
- <doc type="scenario">
- Attempt to create a consumers with an empty tag.
- </doc>
- </exception>
- </field>
-
- <field name="no-local" type="bit">
- <doc>If the no-local field is set the server will not send messages to the connection that
- published them.</doc>
- </field>
-
- <field name="no-ack" type="bit" label="no acknowledgement needed">
- <doc>
- If this field is set the server does not expect acknowledgements for messages. That is,
- when a message is delivered to the client the server automatically and silently
- acknowledges it on behalf of the client. This functionality increases performance but at
- the cost of reliability. Messages can get lost if a client dies before it can deliver them
- to the application.
- </doc>
- </field>
-
- <field name="exclusive" type="bit" label="request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the queue.
- </doc>
-
- <exception name="in-use" error-code="resource-locked">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, - because there are
- other consumers active - it MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="nowait" type="bit" label="do not send a reply command">
- <doc>
- If set, the server will not respond to the command. The client should not wait for a reply
- command. If the server could not complete the command it will raise an exception.
- </doc>
- </field>
-
- <field name="arguments" type="map" label="arguments for consuming">
- <doc>
- A set of arguments for the consume. The syntax and semantics of these arguments depends on
- the providers implementation.
- </doc>
- </field>
- </command>
-
- <command name="consume-ok" code="0x4" label="confirm a new consumer">
- <doc>
- This command provides the client with a consumer tag which it MUST use in commands that work
- with the consumer.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="consumer-tag" type="str8">
- <doc>
- Holds the consumer tag specified by the client or provided by the server.
- </doc>
- </field>
- </command>
-
- <!-- - Command: file.cancel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="cancel" code="0x5" label="end a queue consumer">
- <doc>
- This command cancels a consumer. This does not affect already delivered messages, but it
- does mean the server will not send any more messages for that consumer.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="consumer-tag" type="str8">
- <doc>
- the identifier of the consumer to be cancelled.
- </doc>
- </field>
- </command>
-
- <!-- - Command: file.open - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="open" code="0x6" label="request to start staging">
- <doc>
- This command requests permission to start staging a message. Staging means sending the
- message into a temporary area at the recipient end and then delivering the message by
- referring to this temporary area. Staging is how the protocol handles partial file transfers
- - if a message is partially staged and the connection breaks, the next time the sender
- starts to stage it, it can restart from where it left off.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <response name="open-ok" />
-
- <field name="identifier" type="str8" label="staging identifier">
- <doc>
- This is the staging identifier. This is an arbitrary string chosen by the sender. For
- staging to work correctly the sender must use the same staging identifier when staging the
- same message a second time after recovery from a failure. A good choice for the staging
- identifier would be the SHA1 hash of the message properties data (including the original
- filename, revised time, etc.).
- </doc>
- </field>
-
- <field name="content-size" type="uint64" label="message content size">
- <doc>
- The size of the content in octets. The recipient may use this information to allocate or
- check available space in advance, to avoid "disk full" errors during staging of very large
- messages.
- </doc>
-
- <rule name="content-size">
- <doc>
- The sender MUST accurately fill the content-size field. Zero-length content is
- permitted.
- </doc>
- </rule>
- </field>
- </command>
-
- <!-- - Command: file.open-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="open-ok" code="0x7" label="confirm staging ready">
- <doc>
- This command confirms that the recipient is ready to accept staged data. If the message was
- already partially-staged at a previous time the recipient will report the number of octets
- already staged.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <response name="stage" />
-
- <field name="staged-size" type="uint64" label="already staged amount">
- <doc>
- The amount of previously-staged content in octets. For a new message this will be zero.
- </doc>
-
- <rule name="behavior">
- <doc>
- The sender MUST start sending data from this octet offset in the message, counting from
- zero.
- </doc>
- </rule>
-
- <rule name="staging">
- <doc>
- The recipient MAY decide how long to hold partially-staged content and MAY implement
- staging by always discarding partially-staged content. However if it uses the file
- content type it MUST support the staging commands.
- </doc>
- </rule>
- </field>
- </command>
-
- <!-- - Command: file.stage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="stage" code="0x8" label="stage message content">
- <doc>
- This command stages the message, sending the message content to the recipient from the octet
- offset specified in the Open-Ok command.
- </doc>
-
- <implement role="server" handle="MUST" />
- <implement role="client" handle="MUST" />
-
- <segments>
- <header required="true">
- <entry type="file-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- <!-- - Command: file.publish - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="publish" code="0x9" label="publish a message">
- <doc>
- This command publishes a staged file message to a specific exchange. The file message will
- be routed to queues as defined by the exchange configuration and distributed to any active
- consumers when the transaction, if any, is committed.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be empty, meaning
- the default exchange. If the exchange name is specified, and that exchange does not exist,
- the server will raise an exception.
- </doc>
-
- <rule name="default">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <exception name="refusal" error-code="not-implemented">
- <doc>
- The exchange MAY refuse file content in which case it MUST send an exception.
- </doc>
- </exception>
- </field>
-
- <field name="routing-key" type="str8" label="Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing messages
- depending on the exchange configuration.
- </doc>
- </field>
-
- <field name="mandatory" type="bit" label="indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue. If
- this flag is set, the server will return an unroutable message with a Return command. If
- this flag is zero, the server silently drops the message.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the mandatory flag.
- </doc>
- </rule>
- </field>
-
- <field name="immediate" type="bit" label="request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue
- consumer immediately. If this flag is set, the server will return an undeliverable message
- with a Return command. If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the immediate flag.
- </doc>
- </rule>
- </field>
-
- <field name="identifier" type="str8" label="staging identifier">
- <doc>
- This is the staging identifier of the message to publish. The message must have been
- staged. Note that a client can send the Publish command asynchronously without waiting for
- staging to finish.
- </doc>
- </field>
- </command>
-
- <!-- - Command: file.return - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="return" code="0xa" label="return a failed message">
- <doc>
- This command returns an undeliverable message that was published with the "immediate" flag
- set, or an unroutable message published with the "mandatory" flag set. The reply code and
- text provide information about the reason that the message was undeliverable.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="reply-code" type="return-code" />
-
- <field name="reply-text" type="str8" label="The localized reply text.">
- <doc>
- This text can be logged as an aid to resolving issues.
- </doc>
- </field>
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="routing-key" type="str8" label="Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
-
- <segments>
- <header required="true">
- <entry type="file-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- <!-- - Command: file.deliver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="deliver" code="0xb" label="notify the client of a consumer message">
- <doc>
- This command delivers a staged file message to the client, via a consumer. In the
- asynchronous message delivery model, the client starts a consumer using the consume command,
- then the server responds with Deliver commands as and when messages arrive for that
- consumer.
- </doc>
-
- <rule name="redelivery-tracking">
- <doc>
- The server SHOULD track the number of times a message has been delivered to clients and
- when a message is redelivered a certain number of times - e.g. 5 times - without being
- acknowledged, the server SHOULD consider the message to be non-processable (possibly
- causing client applications to abort), and move the message to a dead letter queue.
- </doc>
- </rule>
-
- <implement role="client" handle="MUST" />
-
- <field name="consumer-tag" type="str8" />
-
- <field name="delivery-tag" type="uint64" >
- <doc>
- The server-assigned and session-specific delivery tag
- </doc>
-
- <rule name="non-zero">
- <doc>
- The server MUST NOT use a zero value for delivery tags. Zero is reserved for client use,
- meaning "all messages so far received".
- </doc>
- </rule>
- </field>
-
- <field name="redelivered" type="bit" label="Indicate possible duplicate delivery">
- <doc>
- This boolean flag indicates that the message may have been previously delivered to this
- or another client.
- </doc>
- </field>
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="routing-key" type="str8" label="Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
-
- <field name="identifier" type="str8" label="staging identifier">
- <doc>
- This is the staging identifier of the message to deliver. The message must have been
- staged. Note that a server can send the Deliver command asynchronously without waiting for
- staging to finish.
- </doc>
- </field>
- </command>
-
- <!-- - Command: file.ack - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="ack" code="0xc" label="acknowledge one or more messages">
- <doc>
- This command acknowledges one or more messages delivered via the Deliver command. The client
- can ask to confirm a single message or a set of messages up to and including a specific
- message.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="delivery-tag" type="uint64" >
- <doc>
- The identifier of the message being acknowledged
- </doc>
- <rule name="session-local">
- <doc>
- The delivery tag is valid only within the session from which the message was received.
- i.e. A client MUST NOT receive a message on one session and then acknowledge it on
- another.
- </doc>
- </rule>
- </field>
-
- <field name="multiple" type="bit" label="acknowledge multiple messages">
- <doc>
- If set to 1, the delivery tag is treated as "up to and including", so that the client can
- acknowledge multiple messages with a single command. If set to zero, the delivery tag
- refers to a single message. If the multiple field is 1, and the delivery tag is zero,
- tells the server to acknowledge all outstanding messages.
- </doc>
-
- <rule name="validation">
- <doc>
- The server MUST validate that a non-zero delivery-tag refers to an delivered message,
- and raise an exception if this is not the case.
- </doc>
- </rule>
- </field>
- </command>
-
- <!-- - Command: file.reject - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="reject" code="0xd" label="reject an incoming message">
- <doc>
- This command allows a client to reject a message. It can be used to return untreatable
- messages to their original queue. Note that file content is staged before delivery, so the
- client will not use this command to interrupt delivery of a large message.
- </doc>
-
- <rule name="server-interpretation">
- <doc>
- The server SHOULD interpret this command as meaning that the client is unable to process
- the message at this time.
- </doc>
- </rule>
-
- <rule name="not-selection">
- <doc>
- A client MUST NOT use this command as a means of selecting messages to process. A rejected
- message MAY be discarded or dead-lettered, not necessarily passed to another client.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <field name="delivery-tag" type="uint64">
- <doc>
- the identifier of the message to be rejected
- </doc>
- <rule name="session-local">
- <doc>
- The delivery tag is valid only within the session from which the message was received.
- i.e. A client MUST NOT receive a message on one session and then reject it on another.
- </doc>
- </rule>
- </field>
-
- <field name="requeue" type="bit" label="requeue the message">
- <doc>
- If this field is zero, the message will be discarded. If this bit is 1, the server will
- attempt to requeue the message.
- </doc>
-
- <rule name="requeue-strategy">
- <doc>
- The server MUST NOT deliver the message to the same client within the context of the
- current session. The recommended strategy is to attempt to deliver the message to an
- alternative consumer, and if that is not possible, to move the message to a dead-letter
- queue. The server MAY use more sophisticated tracking to hold the message on the queue
- and redeliver it to the same client at a later stage.
- </doc>
- </rule>
- </field>
- </command>
-
- </class>
-
- <!-- == Class: stream ======================================================================== -->
-
- <class name="stream" code="0xa" label="work with streaming content">
- <doc>
- The stream class provides commands that support multimedia streaming. The stream class uses
- the following semantics: one message is one packet of data; delivery is unacknowledged and
- unreliable; the consumer can specify quality of service parameters that the server can try to
- adhere to; lower-priority messages may be discarded in favor of high priority messages.
- </doc>
-
- <doc type="grammar">
- stream = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL
- / C:PUBLISH content
- / S:RETURN
- / S:DELIVER content
- </doc>
-
- <rule name="overflow-discard">
- <doc>
- The server SHOULD discard stream messages on a priority basis if the queue size exceeds some
- configured limit.
- </doc>
- </rule>
-
- <rule name="priority-levels">
- <doc>
- The server MUST implement at least 2 priority levels for stream messages, where priorities
- 0-4 and 5-9 are treated as two distinct levels. The server MAY implement up to 10 priority
- levels.
- </doc>
- </rule>
-
- <rule name="acknowledgement-support">
- <doc>
- The server MUST implement automatic acknowledgements on stream content. That is, as soon as
- a message is delivered to a client via a Deliver command, the server must remove it from the
- queue.
- </doc>
- </rule>
-
- <role name="server" implement="MAY" />
- <role name="client" implement="MAY" />
-
- <!-- These are the properties for a Stream content -->
- <struct name="stream-properties" size="4" code="0x1" pack="2">
- <field name="content-type" type="str8" label="MIME content type" />
- <field name="content-encoding" type="str8" label="MIME content encoding" />
- <field name="headers" type="map" label="message header field table" />
- <field name="priority" type="uint8" label="message priority, 0 to 9" />
- <field name="timestamp" type="datetime" label="message timestamp" />
- </struct>
-
- <domain name="return-code" type="uint16" label="return code from server">
- <doc>
- The return code. The AMQP return codes are defined by this enum.
- </doc>
- <enum>
- <choice name="content-too-large" value="311">
- <doc>
- The client attempted to transfer content larger than the server could accept.
- </doc>
- </choice>
-
- <choice name="no-route" value="312">
- <doc>
- The exchange cannot route a message, most likely due to an invalid routing key. Only
- when the mandatory flag is set.
- </doc>
- </choice>
-
- <choice name="no-consumers" value="313">
- <doc>
- The exchange cannot deliver to a consumer when the immediate flag is set. As a result of
- pending data on the queue or the absence of any consumers of the queue.
- </doc>
- </choice>
- </enum>
- </domain>
-
- <!-- - Command: stream.qos - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="qos" code="0x1" label="specify quality of service">
- <doc>
- This command requests a specific quality of service. The QoS can be specified for the
- current session or for all sessions on the connection. The particular properties and
- semantics of a qos command always depend on the content class semantics. Though the qos
- command could in principle apply to both peers, it is currently meaningful only for the
- server.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <response name="qos-ok" />
-
- <field name="prefetch-size" type="uint32" label="pre-fetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client finishes
- processing a message, the following message is already held locally, rather than needing
- to be sent within the session. Pre-fetching gives a performance improvement. This field
- specifies the pre-fetch window size in octets. May be set to zero, meaning "no specific
- limit". Note that other pre-fetch limits may still apply.
- </doc>
- </field>
-
- <field name="prefetch-count" type="uint16" label="pre-fetch window in messages">
- <doc>
- Specifies a pre-fetch window in terms of whole messages. This field may be used in
- combination with the prefetch-size field; a message will only be sent in advance if both
- pre-fetch windows (and those at the session and connection level) allow it.
- </doc>
- </field>
-
- <field name="consume-rate" type="uint32" label="transfer rate in octets/second">
- <doc>
- Specifies a desired transfer rate in octets per second. This is usually determined by the
- application that uses the streaming data. A value of zero means "no limit", i.e. as
- rapidly as possible.
- </doc>
-
- <rule name="ignore-prefetch">
- <doc>
- The server MAY ignore the pre-fetch values and consume rates, depending on the type of
- stream and the ability of the server to queue and/or reply it.
- </doc>
- </rule>
-
- <rule name="drop-by-priority">
- <doc>
- The server MAY drop low-priority messages in favor of high-priority messages.
- </doc>
- </rule>
- </field>
-
- <field name="global" type="bit" label="apply to entire connection">
- <doc>
- By default the QoS settings apply to the current session only. If this field is set, they
- are applied to the entire connection.
- </doc>
- </field>
- </command>
-
- <!-- - Command: stream.qos-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="qos-ok" code="0x2" label="confirm the requested qos">
- <doc>
- This command tells the client that the requested QoS levels could be handled by the server.
- The requested QoS applies to all active consumers until a new QoS is defined.
- </doc>
-
- <implement role="client" handle="MUST" />
- </command>
-
- <!-- - Command: stream.consume - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="consume" code="0x3" label="start a queue consumer">
- <doc>
- This command asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the session they were created on,
- or until the client cancels them.
- </doc>
-
- <rule name="min-consumers">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was declared
- as private, and ideally, impose no limit except as defined by available resources.
- </doc>
- </rule>
-
- <rule name="priority-based-delivery">
- <doc>
- Streaming applications SHOULD use different sessions to select different streaming
- resolutions. AMQP makes no provision for filtering and/or transforming streams except on
- the basis of priority-based selective delivery of individual messages.
- </doc>
- </rule>
-
- <implement role="server" handle="MUST" />
-
- <response name="consume-ok" />
-
- <field name="queue" type="queue.name">
- <doc>
- Specifies the name of the queue to consume from.
- </doc>
-
- <exception name="queue-exists-if-empty" error-code="not-allowed">
- <doc>
- If the queue name in this command is empty, the server MUST raise an exception.
- </doc>
- </exception>
- </field>
-
- <field name="consumer-tag" type="str8">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a connection, so
- two clients can use the same consumer tags.
- </doc>
-
- <exception name="not-existing-consumer" error-code="not-allowed">
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to create two
- consumers with the same non-empty tag the server MUST raise an exception.
- </doc>
- </exception>
-
- <exception name="not-empty-consumer-tag" error-code="not-allowed">
- <doc>
- The client MUST NOT specify a tag that is empty or blank.
- </doc>
- <doc type="scenario">
- Attempt to create a consumers with an empty tag.
- </doc>
- </exception>
- </field>
-
- <field name="no-local" type="bit">
- <doc>If the no-local field is set the server will not send messages to the connection that
- published them.</doc>
- </field>
-
- <field name="exclusive" type="bit" label="request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the queue.
- </doc>
-
- <exception name="in-use" error-code="resource-locked">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, - because there are
- other consumers active - it MUST raise an exception with return code 405
- (resource locked).
- </doc>
- </exception>
- </field>
-
- <field name="nowait" type="bit" label="do not send a reply command">
- <doc>
- If set, the server will not respond to the command. The client should not wait for a reply
- command. If the server could not complete the command it will raise an exception.
- </doc>
- </field>
-
- <field name="arguments" type="map" label="arguments for consuming">
- <doc>
- A set of arguments for the consume. The syntax and semantics of these arguments depends on
- the providers implementation.
- </doc>
- </field>
- </command>
-
- <!-- - Command: stream.consume-ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="consume-ok" code="0x4" label="confirm a new consumer">
- <doc>
- This command provides the client with a consumer tag which it may use in commands that work
- with the consumer.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="consumer-tag" type="str8">
- <doc>
- Holds the consumer tag specified by the client or provided by the server.
- </doc>
- </field>
- </command>
-
- <!-- - Command: stream.cancel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="cancel" code="0x5" label="end a queue consumer">
- <doc>
- This command cancels a consumer. Since message delivery is asynchronous the client may
- continue to receive messages for a short while after cancelling a consumer. It may process
- or discard these as appropriate.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="consumer-tag" type="str8" />
- </command>
-
- <!-- - Command: stream.publish - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="publish" code="0x6" label="publish a message">
- <doc>
- This command publishes a message to a specific exchange. The message will be routed to
- queues as defined by the exchange configuration and distributed to any active consumers as
- appropriate.
- </doc>
-
- <implement role="server" handle="MUST" />
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be empty, meaning
- the default exchange. If the exchange name is specified, and that exchange does not exist,
- the server will raise an exception.
- </doc>
-
- <rule name="default">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <exception name="refusal" error-code="not-implemented">
- <doc>
- The exchange MAY refuse stream content in which case it MUST respond with an exception.
- </doc>
- </exception>
- </field>
-
- <field name="routing-key" type="str8" label="Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing messages
- depending on the exchange configuration.
- </doc>
- </field>
-
- <field name="mandatory" type="bit" label="indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue. If
- this flag is set, the server will return an unroutable message with a Return command. If
- this flag is zero, the server silently drops the message.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the mandatory flag.
- </doc>
- </rule>
- </field>
-
- <field name="immediate" type="bit" label="request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a queue
- consumer immediately. If this flag is set, the server will return an undeliverable message
- with a Return command. If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
-
- <rule name="implementation">
- <doc>
- The server SHOULD implement the immediate flag.
- </doc>
- </rule>
- </field>
-
- <segments>
- <header required="true">
- <entry type="stream-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- <!-- - Command: stream.return - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="return" code="0x7" label="return a failed message">
- <doc>
- This command returns an undeliverable message that was published with the "immediate" flag
- set, or an unroutable message published with the "mandatory" flag set. The reply code and
- text provide information about the reason that the message was undeliverable.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="reply-code" type="return-code" />
-
- <field name="reply-text" type="str8" label="The localized reply text.">
- <doc>
- The localized reply text. This text can be logged as an aid to resolving issues.
- </doc>
- </field>
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="routing-key" type="str8" label="Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
-
- <segments>
- <header required="true">
- <entry type="stream-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- <!-- - Command: stream.deliver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <command name="deliver" code="0x8" label="notify the client of a consumer message">
- <doc>
- This command delivers a message to the client, via a consumer. In the asynchronous message
- delivery model, the client starts a consumer using the Consume command, then the server
- responds with Deliver commands as and when messages arrive for that consumer.
- </doc>
-
- <implement role="client" handle="MUST" />
-
- <field name="consumer-tag" type="str8" />
-
- <field name="delivery-tag" type="uint64">
- <doc>
- The server-assigned and session-specific delivery tag
- </doc>
- <rule name="session-local">
- <doc>
- The delivery tag is valid only within the session from which the message was received.
- i.e. A client MUST NOT receive a message on one session and then acknowledge it on
- another.
- </doc>
- </rule>
- </field>
-
- <field name="exchange" type="exchange.name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name="queue" type="queue.name" required="true">
- <doc>
- Specifies the name of the queue that the message came from. Note that a single session can
- start many consumers on different queues.
- </doc>
- </field>
-
- <segments>
- <header required="true">
- <entry type="stream-properties"/>
- </header>
- <body/>
- </segments>
- </command>
-
- </class>
-
-</amqp>
diff --git a/M4-RCs/qpid/specs/amqp.0-8.xml b/M4-RCs/qpid/specs/amqp.0-8.xml
deleted file mode 100644
index 0463f45fa9..0000000000
--- a/M4-RCs/qpid/specs/amqp.0-8.xml
+++ /dev/null
@@ -1,3998 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright Notice
- ================
- (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc.,
- iMatix Corporation, IONA\ufffd Technologies, Red Hat, Inc.,
- TWIST Process Innovations, and 29West Inc. 2006. All rights reserved.
-
- License
- =======
- JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
- Corporation, IONA Technologies, Red Hat, Inc., TWIST Process Innovations, and
- 29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide,
- perpetual, royalty-free, nontransferable, nonexclusive license to
- (i) copy, display, distribute and implement the Advanced Messaging Queue Protocol
- ("AMQP") Specification and (ii) the Licensed Claims that are held by
- the Authors, all for the purpose of implementing the Advanced Messaging
- Queue Protocol Specification. Your license and any rights under this
- Agreement will terminate immediately without notice from
- any Author if you bring any claim, suit, demand, or action related to
- the Advanced Messaging Queue Protocol Specification against any Author.
- Upon termination, you shall destroy all copies of the Advanced Messaging
- Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or
- patent application, throughout the world, excluding design patents and
- design registrations, owned or controlled, or that can be sublicensed
- without fee and in compliance with the requirements of this
- Agreement, by an Author or its affiliates now or at any
- future time and which would necessarily be infringed by implementation
- of the Advanced Messaging Queue Protocol Specification. A claim is
- necessarily infringed hereunder only when it is not possible to avoid
- infringing it because there is no plausible non-infringing alternative
- for implementing the required portions of the Advanced Messaging Queue
- Protocol Specification. Notwithstanding the foregoing, Licensed Claims
- shall not include any claims other than as set forth above even if
- contained in the same patent as Licensed Claims; or that read solely
- on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging
- Queue Protocol Specification, or that, if licensed, would require a
- payment of royalties by the licensor to unaffiliated third parties.
- Moreover, Licensed Claims shall not include (i) any enabling technologies
- that may be necessary to make or use any Licensed Product but are not
- themselves expressly set forth in the Advanced Messaging Queue Protocol
- Specification (e.g., semiconductor manufacturing technology, compiler
- technology, object oriented technology, networking technology, operating
- system technology, and the like); or (ii) the implementation of other
- published standards developed elsewhere and merely referred to in the
- body of the Advanced Messaging Queue Protocol Specification, or
- (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced
- Messaging Queue Protocol Specification. For purposes of this definition,
- the Advanced Messaging Queue Protocol Specification shall be deemed to
- include both architectural and interconnection requirements essential
- for interoperability and may also include supporting source code artifacts
- where such architectural, interconnection requirements and source code
- artifacts are expressly identified as being required or documentation to
- achieve compliance with the Advanced Messaging Queue Protocol Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions
- of products (hardware, software or combinations thereof) that implement
- and are compliant with all relevant portions of the Advanced Messaging
- Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any
- use you may make of the Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS,"
- AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
- IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE
- CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE
- SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY
- PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
- USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE
- PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner,
- including advertising or publicity pertaining to the Advanced Messaging
- Queue Protocol Specification or its contents without specific, written
- prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you
- shall destroy all copies of the Advanced Messaging Queue Protocol
- Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the
- Octagon Symbol are trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA
- Technologies PLC and/or its subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered
- trademarks of Red Hat, Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of
- Sun Microsystems, Inc. in the United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service
- marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
-
--->
-
-<!--
-========================================================
-EDITORS: (PH) Pieter Hintjens <ph@imatix.com>
- (KvdR) Kim van der Riet <kim.vdriet@redhat.com>
-
-NOTE: These editors have been assigned by the AMQP working group. Please do not
-edit/commit this file without consulting with one of the above editors.
-========================================================
-
-Revision history:
- 2006-06-07 (PH) - version number changed to 0.8 to conform to public
- release documentation.
-
- 2006-05-15 (PH) - fixed comments on queue name in basic.get to clarify
- use of current queue in this method.
-
- 2006-05-15 (PH) - fixed comments on routing key in queue.bind to clarify
- how routing key is filled when empty (to allow asynch queue.declare).
-
- 2006-05-11 (PH) - reset version to 0.70 so that putatitive standards
- group can release 2-3 major new versions before hitting 1.0 (again).
-
- 2006-05-11 (PH) - TODO in documentation: cycle field in frame header
- has been removed.
-
- 2006-05-11 (PH) - added nowait option to exchange.declare, delete,
- queue.declare, delete, bind, purge, basic.consume, cancel,
- file.consume, cancel, stream.consume and cancel methods.
-
- 2006-05-11 (PH) - removed notnull rule and added explanations on queue
- name in queue.bind, purge, delete, basic.consume, cancel, file.consume,
- cancel, stream.consume and cancel methods.
-
- 2006-05-11 (PH) - added basic.qos, file.qos, and stream.qos methods that
- regroup all prefetch options from the consume methods. Also removed the
- prefetch option from channel.open.
-
- 2006-05-11 (PH) - renumbered method indexes to show request-response
- nature of methods; requests are 10, 20, 30 while responses are 11, 21,
- etc.
-
- 2006-05-11 (PH) - removed OpenAMQ extension methods from this definition
- since these are maintained seperately.
-
- 2006-05-26 (RG) - added Basic.Recover method to allow replay of
- unacknowledged messages on a channel.
-
- 2006-07-03 (PH) - cosmetic clean-up of Basic.Recover comments.
--->
-
-<amqp major="8" minor="0" port="5672" comment="AMQ protocol 0.80">
- AMQ Protocol 0.80
-
-<!--
-======================================================
-== CONSTANTS
-======================================================
--->
- <constant name="frame method" value="1"/>
- <constant name="frame header" value="2"/>
- <constant name="frame body" value="3"/>
- <constant name="frame oob method" value="4"/>
- <constant name="frame oob header" value="5"/>
- <constant name="frame oob body" value="6"/>
- <constant name="frame trace" value="7"/>
- <constant name="frame heartbeat" value="8"/>
- <constant name="frame min size" value="4096"/>
- <constant name="frame end" value="206"/>
- <constant name="reply success" value="200">
- Indicates that the method completed successfully. This reply code is
- reserved for future use - the current protocol design does not use
- positive confirmation and reply codes are sent only in case of an
- error.
-</constant>
- <constant name="not delivered" value="310" class="soft error">
- The client asked for a specific message that is no longer available.
- The message was delivered to another client, or was purged from the
- queue for some other reason.
-</constant>
- <constant name="content too large" value="311" class="soft error">
- The client attempted to transfer content larger than the server
- could accept at the present time. The client may retry at a later
- time.
-</constant>
- <constant name="connection forced" value="320" class="hard error">
- An operator intervened to close the connection for some reason.
- The client may retry at some later date.
-</constant>
- <constant name="invalid path" value="402" class="hard error">
- The client tried to work with an unknown virtual host or cluster.
-</constant>
- <constant name="access refused" value="403" class="soft error">
- The client attempted to work with a server entity to which it has
- no due to security settings.
-</constant>
- <constant name="not found" value="404" class="soft error">
- The client attempted to work with a server entity that does not exist.
-</constant>
- <constant name="resource locked" value="405" class="soft error">
- The client attempted to work with a server entity to which it has
- no access because another client is working with it.
-</constant>
- <constant name="frame error" value="501" class="hard error">
- The client sent a malformed frame that the server could not decode.
- This strongly implies a programming error in the client.
-</constant>
- <constant name="syntax error" value="502" class="hard error">
- The client sent a frame that contained illegal values for one or more
- fields. This strongly implies a programming error in the client.
-</constant>
- <constant name="command invalid" value="503" class="hard error">
- The client sent an invalid sequence of frames, attempting to perform
- an operation that was considered invalid by the server. This usually
- implies a programming error in the client.
-</constant>
- <constant name="channel error" value="504" class="hard error">
- The client attempted to work with a channel that had not been
- correctly opened. This most likely indicates a fault in the client
- layer.
-</constant>
- <constant name="resource error" value="506" class="hard error">
- The server could not complete the method because it lacked sufficient
- resources. This may be due to the client creating too many of some
- type of entity.
-</constant>
- <constant name="not allowed" value="530" class="hard error">
- The client tried to work with some entity in a manner that is
- prohibited by the server, due to security settings or by some other
- criteria.
-</constant>
- <constant name="not implemented" value="540" class="hard error">
- The client tried to use functionality that is not implemented in the
- server.
-</constant>
- <constant name="internal error" value="541" class="hard error">
- The server could not complete the method because of an internal error.
- The server may require intervention by an operator in order to resume
- normal operations.
-</constant>
- <!--
-======================================================
-== DOMAIN TYPES
-======================================================
--->
- <domain name="access ticket" type="short">
- access ticket granted by server
- <doc>
- An access ticket granted by the server for a certain set of access
- rights within a specific realm. Access tickets are valid within the
- channel where they were created, and expire when the channel closes.
- </doc>
- <assert check="ne" value="0"/>
- </domain>
- <domain name="class id" type="short"/>
- <domain name="consumer tag" type="shortstr">
- consumer tag
- <doc>
- Identifier for the consumer, valid within the current connection.
- </doc>
- <rule implement="MUST">
- The consumer tag is valid only within the channel from which the
- consumer was created. I.e. a client MUST NOT create a consumer in
- one channel and then use it in another.
- </rule>
- </domain>
- <domain name="delivery tag" type="longlong">
- server-assigned delivery tag
- <doc>
- The server-assigned and channel-specific delivery tag
- </doc>
- <rule implement="MUST">
- The delivery tag is valid only within the channel from which the
- message was received. I.e. a client MUST NOT receive a message on
- one channel and then acknowledge it on another.
- </rule>
- <rule implement="MUST">
- The server MUST NOT use a zero value for delivery tags. Zero is
- reserved for client use, meaning "all messages so far received".
- </rule>
- </domain>
- <domain name="exchange name" type="shortstr">
- exchange name
- <doc>
- The exchange name is a client-selected string that identifies
- the exchange for publish methods. Exchange names may consist
- of any mixture of digits, letters, and underscores. Exchange
- names are scoped by the virtual host.
- </doc>
- <assert check="length" value="127"/>
- </domain>
- <domain name="known hosts" type="shortstr">
-list of known hosts
-<doc>
-Specifies the list of equivalent or alternative hosts that the server
-knows about, which will normally include the current server itself.
-Clients can cache this information and use it when reconnecting to a
-server after a failure.
-</doc>
- <rule implement="MAY">
-The server MAY leave this field empty if it knows of no other
-hosts than itself.
-</rule>
- </domain>
- <domain name="method id" type="short"/>
- <domain name="no ack" type="bit">
- no acknowledgement needed
- <doc>
- If this field is set the server does not expect acknowledgments
- for messages. That is, when a message is delivered to the client
- the server automatically and silently acknowledges it on behalf
- of the client. This functionality increases performance but at
- the cost of reliability. Messages can get lost if a client dies
- before it can deliver them to the application.
- </doc>
- </domain>
- <domain name="no local" type="bit">
- do not deliver own messages
- <doc>
- If the no-local field is set the server will not send messages to
- the client that published them.
- </doc>
- </domain>
- <domain name="path" type="shortstr">
- <doc>
- Must start with a slash "/" and continue with path names
- separated by slashes. A path name consists of any combination
- of at least one of [A-Za-z0-9] plus zero or more of [.-_+!=:].
-</doc>
- <assert check="notnull"/>
- <assert check="syntax" rule="path"/>
- <assert check="length" value="127"/>
- </domain>
- <domain name="peer properties" type="table">
- <doc>
-This string provides a set of peer properties, used for
-identification, debugging, and general information.
-</doc>
- <rule implement="SHOULD">
-The properties SHOULD contain these fields:
-"product", giving the name of the peer product, "version", giving
-the name of the peer version, "platform", giving the name of the
-operating system, "copyright", if appropriate, and "information",
-giving other general information.
-</rule>
- </domain>
- <domain name="queue name" type="shortstr">
- queue name
- <doc>
- The queue name identifies the queue within the vhost. Queue
- names may consist of any mixture of digits, letters, and
- underscores.
- </doc>
- <assert check="length" value="127"/>
- </domain>
- <domain name="redelivered" type="bit">
- message is being redelivered
- <doc>
- This indicates that the message has been previously delivered to
- this or another client.
- </doc>
- <rule implement="SHOULD">
- The server SHOULD try to signal redelivered messages when it can.
- When redelivering a message that was not successfully acknowledged,
- the server SHOULD deliver it to the original client if possible.
- </rule>
- <rule implement="MUST">
- The client MUST NOT rely on the redelivered field but MUST take it
- as a hint that the message may already have been processed. A
- fully robust client must be able to track duplicate received messages
- on non-transacted, and locally-transacted channels.
- </rule>
- </domain>
- <domain name="reply code" type="short">
-reply code from server
-<doc>
- The reply code. The AMQ reply codes are defined in AMQ RFC 011.
-</doc>
- <assert check="notnull"/>
- </domain>
- <domain name="reply text" type="shortstr">
-localised reply text
-<doc>
- The localised reply text. This text can be logged as an aid to
- resolving issues.
-</doc>
- <assert check="notnull"/>
- </domain>
- <class name="connection" handler="connection" index="10">
- <!--
-======================================================
-== CONNECTION
-======================================================
--->
- work with socket connections
-<doc>
- The connection class provides methods for a client to establish a
- network connection to a server, and for both peers to operate the
- connection thereafter.
-</doc>
- <doc name="grammar">
- connection = open-connection *use-connection close-connection
- open-connection = C:protocol-header
- S:START C:START-OK
- *challenge
- S:TUNE C:TUNE-OK
- C:OPEN S:OPEN-OK | S:REDIRECT
- challenge = S:SECURE C:SECURE-OK
- use-connection = *channel
- close-connection = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="start" synchronous="1" index="10">
- start connection negotiation
- <doc>
- This method starts the connection negotiation process by telling
- the client the protocol version that the server proposes, along
- with a list of security mechanisms which the client can use for
- authentication.
- </doc>
- <rule implement="MUST">
- If the client cannot handle the protocol version suggested by the
- server it MUST close the socket connection.
- </rule>
- <rule implement="MUST">
- The server MUST provide a protocol version that is lower than or
- equal to that requested by the client in the protocol header. If
- the server cannot support the specified protocol it MUST NOT send
- this method, but MUST close the socket connection.
- </rule>
- <chassis name="client" implement="MUST"/>
- <response name="start-ok"/>
- <field name="version major" type="octet">
- protocol major version
- <doc>
- The protocol major version that the server agrees to use, which
- cannot be higher than the client's major version.
- </doc>
- </field>
- <field name="version minor" type="octet">
- protocol major version
- <doc>
- The protocol minor version that the server agrees to use, which
- cannot be higher than the client's minor version.
- </doc>
- </field>
- <field name="server properties" domain="peer properties">
- server properties
- </field>
- <field name="mechanisms" type="longstr">
- available security mechanisms
- <doc>
- A list of the security mechanisms that the server supports, delimited
- by spaces. Currently ASL supports these mechanisms: PLAIN.
- </doc>
- <see name="security mechanisms"/>
- <assert check="notnull"/>
- </field>
- <field name="locales" type="longstr">
- available message locales
- <doc>
- A list of the message locales that the server supports, delimited
- by spaces. The locale defines the language in which the server
- will send reply texts.
- </doc>
- <rule implement="MUST">
- All servers MUST support at least the en_US locale.
- </rule>
- <assert check="notnull"/>
- </field>
- </method>
- <method name="start-ok" synchronous="1" index="11">
- select security mechanism and locale
- <doc>
- This method selects a SASL security mechanism. ASL uses SASL
- (RFC2222) to negotiate authentication and encryption.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="client properties" domain="peer properties">
- client properties
- </field>
- <field name="mechanism" type="shortstr">
- selected security mechanism
- <doc>
- A single security mechanisms selected by the client, which must be
- one of those specified by the server.
- </doc>
- <rule implement="SHOULD">
- The client SHOULD authenticate using the highest-level security
- profile it can handle from the list provided by the server.
- </rule>
- <rule implement="MUST">
- The mechanism field MUST contain one of the security mechanisms
- proposed by the server in the Start method. If it doesn't, the
- server MUST close the socket.
- </rule>
- <assert check="notnull"/>
- </field>
- <field name="response" type="longstr">
- security response data
- <doc>
- A block of opaque data passed to the security mechanism. The contents
- of this data are defined by the SASL security mechanism. For the
- PLAIN security mechanism this is defined as a field table holding
- two fields, LOGIN and PASSWORD.
- </doc>
- <assert check="notnull"/>
- </field>
- <field name="locale" type="shortstr">
- selected message locale
- <doc>
- A single message local selected by the client, which must be one
- of those specified by the server.
- </doc>
- <assert check="notnull"/>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="secure" synchronous="1" index="20">
- security mechanism challenge
- <doc>
- The SASL protocol works by exchanging challenges and responses until
- both peers have received sufficient information to authenticate each
- other. This method challenges the client to provide more information.
- </doc>
- <chassis name="client" implement="MUST"/>
- <response name="secure-ok"/>
- <field name="challenge" type="longstr">
- security challenge data
- <doc>
- Challenge information, a block of opaque binary data passed to
- the security mechanism.
- </doc>
- <see name="security mechanisms"/>
- </field>
- </method>
- <method name="secure-ok" synchronous="1" index="21">
- security mechanism response
- <doc>
- This method attempts to authenticate, passing a block of SASL data
- for the security mechanism at the server side.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="response" type="longstr">
- security response data
- <doc>
- A block of opaque data passed to the security mechanism. The contents
- of this data are defined by the SASL security mechanism.
- </doc>
- <assert check="notnull"/>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="tune" synchronous="1" index="30">
- propose connection tuning parameters
- <doc>
- This method proposes a set of connection configuration values
- to the client. The client can accept and/or adjust these.
- </doc>
- <chassis name="client" implement="MUST"/>
- <response name="tune-ok"/>
- <field name="channel max" type="short">
- proposed maximum channels
- <doc>
- The maximum total number of channels that the server allows
- per connection. Zero means that the server does not impose a
- fixed limit, but the number of allowed channels may be limited
- by available server resources.
- </doc>
- </field>
- <field name="frame max" type="long">
- proposed maximum frame size
- <doc>
- The largest frame size that the server proposes for the
- connection. The client can negotiate a lower value. Zero means
- that the server does not impose any specific limit but may reject
- very large frames if it cannot allocate resources for them.
- </doc>
- <rule implement="MUST">
- Until the frame-max has been negotiated, both peers MUST accept
- frames of up to 4096 octets large. The minimum non-zero value for
- the frame-max field is 4096.
- </rule>
- </field>
- <field name="heartbeat" type="short">
- desired heartbeat delay
- <doc>
- The delay, in seconds, of the connection heartbeat that the server
- wants. Zero means the server does not want a heartbeat.
- </doc>
- </field>
- </method>
- <method name="tune-ok" synchronous="1" index="31">
- negotiate connection tuning parameters
- <doc>
- This method sends the client's connection tuning parameters to the
- server. Certain fields are negotiated, others provide capability
- information.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="channel max" type="short">
- negotiated maximum channels
- <doc>
- The maximum total number of channels that the client will use
- per connection. May not be higher than the value specified by
- the server.
- </doc>
- <rule implement="MAY">
- The server MAY ignore the channel-max value or MAY use it for
- tuning its resource allocation.
- </rule>
- <assert check="notnull"/>
- <assert check="le" method="tune" field="channel max"/>
- </field>
- <field name="frame max" type="long">
- negotiated maximum frame size
- <doc>
- The largest frame size that the client and server will use for
- the connection. Zero means that the client does not impose any
- specific limit but may reject very large frames if it cannot
- allocate resources for them. Note that the frame-max limit
- applies principally to content frames, where large contents
- can be broken into frames of arbitrary size.
- </doc>
- <rule implement="MUST">
- Until the frame-max has been negotiated, both peers must accept
- frames of up to 4096 octets large. The minimum non-zero value for
- the frame-max field is 4096.
- </rule>
- </field>
- <field name="heartbeat" type="short">
- desired heartbeat delay
- <doc>
- The delay, in seconds, of the connection heartbeat that the client
- wants. Zero means the client does not want a heartbeat.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="open" synchronous="1" index="40">
- open connection to virtual host
- <doc>
- This method opens a connection to a virtual host, which is a
- collection of resources, and acts to separate multiple application
- domains within a server.
- </doc>
- <rule implement="MUST">
- The client MUST open the context before doing any work on the
- connection.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="open-ok"/>
- <response name="redirect"/>
- <field name="virtual host" domain="path">
- virtual host name
- <assert check="regexp" value="^[a-zA-Z0-9/-_]+$"/>
- <doc>
- The name of the virtual host to work with.
- </doc>
- <rule implement="MUST">
- If the server supports multiple virtual hosts, it MUST enforce a
- full separation of exchanges, queues, and all associated entities
- per virtual host. An application, connected to a specific virtual
- host, MUST NOT be able to access resources of another virtual host.
- </rule>
- <rule implement="SHOULD">
- The server SHOULD verify that the client has permission to access
- the specified virtual host.
- </rule>
- <rule implement="MAY">
- The server MAY configure arbitrary limits per virtual host, such
- as the number of each type of entity that may be used, per
- connection and/or in total.
- </rule>
- </field>
- <field name="capabilities" type="shortstr">
- required capabilities
- <doc>
- The client may specify a number of capability names, delimited by
- spaces. The server can use this string to how to process the
- client's connection request.
- </doc>
- </field>
- <field name="insist" type="bit">
- insist on connecting to server
- <doc>
- In a configuration with multiple load-sharing servers, the server
- may respond to a Connection.Open method with a Connection.Redirect.
- The insist option tells the server that the client is insisting on
- a connection to the specified server.
- </doc>
- <rule implement="SHOULD">
- When the client uses the insist option, the server SHOULD accept
- the client connection unless it is technically unable to do so.
- </rule>
- </field>
- </method>
- <method name="open-ok" synchronous="1" index="41">
- signal that the connection is ready
- <doc>
- This method signals to the client that the connection is ready for
- use.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="known hosts" domain="known hosts"/>
- </method>
- <method name="redirect" synchronous="1" index="50">
- asks the client to use a different server
- <doc>
- This method redirects the client to another server, based on the
- requested virtual host and/or capabilities.
- </doc>
- <rule implement="SHOULD">
- When getting the Connection.Redirect method, the client SHOULD
- reconnect to the host specified, and if that host is not present,
- to any of the hosts specified in the known-hosts list.
- </rule>
- <chassis name="client" implement="MAY"/>
- <field name="host" type="shortstr">
- server to connect to
- <doc>
- Specifies the server to connect to. This is an IP address or a
- DNS name, optionally followed by a colon and a port number. If
- no port number is specified, the client should use the default
- port number for the protocol.
- </doc>
- <assert check="notnull"/>
- </field>
- <field name="known hosts" domain="known hosts"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="close" synchronous="1" index="60">
- request a connection close
- <doc>
- This method indicates that the sender wants to close the connection.
- This may be due to internal conditions (e.g. a forced shut-down) or
- due to an error handling a specific method, i.e. an exception. When
- a close is due to an exception, the sender provides the class and
- method id of the method which caused the exception.
- </doc>
- <rule implement="MUST">
- After sending this method any received method except the Close-OK
- method MUST be discarded.
- </rule>
- <rule implement="MAY">
- The peer sending this method MAY use a counter or timeout to
- detect failure of the other peer to respond correctly with
- the Close-OK method.
- </rule>
- <rule implement="MUST">
- When a server receives the Close method from a client it MUST
- delete all server-side resources associated with the client's
- context. A client CANNOT reconnect to a context after sending
- or receiving a Close method.
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="close-ok"/>
- <field name="reply code" domain="reply code"/>
- <field name="reply text" domain="reply text"/>
- <field name="class id" domain="class id">
- failing method class
- <doc>
- When the close is provoked by a method exception, this is the
- class of the method.
- </doc>
- </field>
- <field name="method id" domain="method id">
- failing method ID
- <doc>
- When the close is provoked by a method exception, this is the
- ID of the method.
- </doc>
- </field>
- </method>
- <method name="close-ok" synchronous="1" index="61">
- confirm a connection close
- <doc>
- This method confirms a Connection.Close method and tells the
- recipient that it is safe to release resources for the connection
- and close the socket.
- </doc>
- <rule implement="SHOULD">
- A peer that detects a socket closure without having received a
- Close-Ok handshake method SHOULD log the error.
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- </method>
- </class>
- <class name="channel" handler="channel" index="20">
- <!--
-======================================================
-== CHANNEL
-======================================================
--->
- work with channels
-<doc>
- The channel class provides methods for a client to establish a virtual
- connection - a channel - to a server and for both peers to operate the
- virtual connection thereafter.
-</doc>
- <doc name="grammar">
- channel = open-channel *use-channel close-channel
- open-channel = C:OPEN S:OPEN-OK
- use-channel = C:FLOW S:FLOW-OK
- / S:FLOW C:FLOW-OK
- / S:ALERT
- / functional-class
- close-channel = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="open" synchronous="1" index="10">
- open a channel for use
- <doc>
- This method opens a virtual connection (a channel).
- </doc>
- <rule implement="MUST">
- This method MUST NOT be called when the channel is already open.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="open-ok"/>
- <field name="out of band" type="shortstr">
- out-of-band settings
- <doc>
- Configures out-of-band transfers on this channel. The syntax and
- meaning of this field will be formally defined at a later date.
- </doc>
- <assert check="null"/>
- </field>
- </method>
- <method name="open-ok" synchronous="1" index="11">
- signal that the channel is ready
- <doc>
- This method signals to the client that the channel is ready for use.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="flow" synchronous="1" index="20">
- enable/disable flow from peer
- <doc>
- This method asks the peer to pause or restart the flow of content
- data. This is a simple flow-control mechanism that a peer can use
- to avoid oveflowing its queues or otherwise finding itself receiving
- more messages than it can process. Note that this method is not
- intended for window control. The peer that receives a request to
- stop sending content should finish sending the current content, if
- any, and then wait until it receives a Flow restart method.
- </doc>
- <rule implement="MAY">
- When a new channel is opened, it is active. Some applications
- assume that channels are inactive until started. To emulate this
- behaviour a client MAY open the channel, then pause it.
- </rule>
- <rule implement="SHOULD">
- When sending content data in multiple frames, a peer SHOULD monitor
- the channel for incoming methods and respond to a Channel.Flow as
- rapidly as possible.
- </rule>
- <rule implement="MAY">
- A peer MAY use the Channel.Flow method to throttle incoming content
- data for internal reasons, for example, when exchangeing data over a
- slower connection.
- </rule>
- <rule implement="MAY">
- The peer that requests a Channel.Flow method MAY disconnect and/or
- ban a peer that does not respect the request.
- </rule>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <response name="flow-ok"/>
- <field name="active" type="bit">
- start/stop content frames
- <doc>
- If 1, the peer starts sending content frames. If 0, the peer
- stops sending content frames.
- </doc>
- </field>
- </method>
- <method name="flow-ok" index="21">
- confirm a flow method
- <doc>
- Confirms to the peer that a flow command was received and processed.
- </doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <field name="active" type="bit">
- current flow setting
- <doc>
- Confirms the setting of the processed flow method: 1 means the
- peer will start sending or continue to send content frames; 0
- means it will not.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="alert" index="30">
- send a non-fatal warning message
- <doc>
- This method allows the server to send a non-fatal warning to the
- client. This is used for methods that are normally asynchronous
- and thus do not have confirmations, and for which the server may
- detect errors that need to be reported. Fatal errors are handled
- as channel or connection exceptions; non-fatal errors are sent
- through this method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="reply code" domain="reply code"/>
- <field name="reply text" domain="reply text"/>
- <field name="details" type="table">
- detailed information for warning
- <doc>
- A set of fields that provide more information about the
- problem. The meaning of these fields are defined on a
- per-reply-code basis (TO BE DEFINED).
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="close" synchronous="1" index="40">
- request a channel close
- <doc>
- This method indicates that the sender wants to close the channel.
- This may be due to internal conditions (e.g. a forced shut-down) or
- due to an error handling a specific method, i.e. an exception. When
- a close is due to an exception, the sender provides the class and
- method id of the method which caused the exception.
- </doc>
- <rule implement="MUST">
- After sending this method any received method except
- Channel.Close-OK MUST be discarded.
- </rule>
- <rule implement="MAY">
- The peer sending this method MAY use a counter or timeout to detect
- failure of the other peer to respond correctly with Channel.Close-OK..
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="close-ok"/>
- <field name="reply code" domain="reply code"/>
- <field name="reply text" domain="reply text"/>
- <field name="class id" domain="class id">
- failing method class
- <doc>
- When the close is provoked by a method exception, this is the
- class of the method.
- </doc>
- </field>
- <field name="method id" domain="method id">
- failing method ID
- <doc>
- When the close is provoked by a method exception, this is the
- ID of the method.
- </doc>
- </field>
- </method>
- <method name="close-ok" synchronous="1" index="41">
- confirm a channel close
- <doc>
- This method confirms a Channel.Close method and tells the recipient
- that it is safe to release resources for the channel and close the
- socket.
- </doc>
- <rule implement="SHOULD">
- A peer that detects a socket closure without having received a
- Channel.Close-Ok handshake method SHOULD log the error.
- </rule>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- </method>
- </class>
- <class name="access" handler="connection" index="30">
- <!--
-======================================================
-== ACCESS CONTROL
-======================================================
--->
- work with access tickets
-<doc>
- The protocol control access to server resources using access tickets.
- A client must explicitly request access tickets before doing work.
- An access ticket grants a client the right to use a specific set of
- resources - called a "realm" - in specific ways.
-</doc>
- <doc name="grammar">
- access = C:REQUEST S:REQUEST-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="request" synchronous="1" index="10">
- request an access ticket
- <doc>
- This method requests an access ticket for an access realm.
- The server responds by granting the access ticket. If the
- client does not have access rights to the requested realm
- this causes a connection exception. Access tickets are a
- per-channel resource.
- </doc>
- <rule implement="MUST">
- The realm name MUST start with either "/data" (for application
- resources) or "/admin" (for server administration resources).
- If the realm starts with any other path, the server MUST raise
- a connection exception with reply code 403 (access refused).
- </rule>
- <rule implement="MUST">
- The server MUST implement the /data realm and MAY implement the
- /admin realm. The mapping of resources to realms is not
- defined in the protocol - this is a server-side configuration
- issue.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="request-ok"/>
- <field name="realm" domain="path">
- name of requested realm
- <rule implement="MUST">
- If the specified realm is not known to the server, the server
- must raise a channel exception with reply code 402 (invalid
- path).
- </rule>
- </field>
- <field name="exclusive" type="bit">
- request exclusive access
- <doc>
- Request exclusive access to the realm. If the server cannot grant
- this - because there are other active tickets for the realm - it
- raises a channel exception.
- </doc>
- </field>
- <field name="passive" type="bit">
- request passive access
- <doc>
- Request message passive access to the specified access realm.
- Passive access lets a client get information about resources in
- the realm but not to make any changes to them.
- </doc>
- </field>
- <field name="active" type="bit">
- request active access
- <doc>
- Request message active access to the specified access realm.
- Acvtive access lets a client get create and delete resources in
- the realm.
- </doc>
- </field>
- <field name="write" type="bit">
- request write access
- <doc>
- Request write access to the specified access realm. Write access
- lets a client publish messages to all exchanges in the realm.
- </doc>
- </field>
- <field name="read" type="bit">
- request read access
- <doc>
- Request read access to the specified access realm. Read access
- lets a client consume messages from queues in the realm.
- </doc>
- </field>
- </method>
- <method name="request-ok" synchronous="1" index="11">
- grant access to server resources
- <doc>
- This method provides the client with an access ticket. The access
- ticket is valid within the current channel and for the lifespan of
- the channel.
- </doc>
- <rule implement="MUST">
- The client MUST NOT use access tickets except within the same
- channel as originally granted.
- </rule>
- <rule implement="MUST">
- The server MUST isolate access tickets per channel and treat an
- attempt by a client to mix these as a connection exception.
- </rule>
- <chassis name="client" implement="MUST"/>
- <field name="ticket" domain="access ticket"/>
- </method>
- </class>
- <class name="exchange" handler="channel" index="40">
- <!--
-======================================================
-== EXCHANGES (or "routers", if you prefer)
-== (Or matchers, plugins, extensions, agents,... Routing is just one of
-== the many fun things an exchange can do.)
-======================================================
--->
- work with exchanges
-<doc>
- Exchanges match and distribute messages across queues. Exchanges can be
- configured in the server or created at runtime.
-</doc>
- <doc name="grammar">
- exchange = C:DECLARE S:DECLARE-OK
- / C:DELETE S:DELETE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <rule implement="MUST">
- <test>amq_exchange_19</test>
- The server MUST implement the direct and fanout exchange types, and
- predeclare the corresponding exchanges named amq.direct and amq.fanout
- in each virtual host. The server MUST also predeclare a direct
- exchange to act as the default exchange for content Publish methods
- and for default queue bindings.
-</rule>
- <rule implement="SHOULD">
- <test>amq_exchange_20</test>
- The server SHOULD implement the topic exchange type, and predeclare
- the corresponding exchange named amq.topic in each virtual host.
-</rule>
- <rule implement="MAY">
- <test>amq_exchange_21</test>
- The server MAY implement the system exchange type, and predeclare the
- corresponding exchanges named amq.system in each virtual host. If the
- client attempts to bind a queue to the system exchange, the server
- MUST raise a connection exception with reply code 507 (not allowed).
-</rule>
- <rule implement="MUST">
- <test>amq_exchange_22</test>
- The default exchange MUST be defined as internal, and be inaccessible
- to the client except by specifying an empty exchange name in a content
- Publish method. That is, the server MUST NOT let clients make explicit
- bindings to this exchange.
-</rule>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="declare" synchronous="1" index="10">
- declare exchange, create if needed
- <doc>
- This method creates an exchange if it does not already exist, and if the
- exchange exists, verifies that it is of the correct and expected class.
- </doc>
- <rule implement="SHOULD">
- <test>amq_exchange_23</test>
- The server SHOULD support a minimum of 16 exchanges per virtual host
- and ideally, impose no limit except as defined by available resources.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="declare-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- When a client defines a new exchange, this belongs to the access realm
- of the ticket used. All further work done with that exchange must be
- done with an access ticket for the same realm.
- </doc>
- <rule implement="MUST">
- The client MUST provide a valid access ticket giving "active" access
- to the realm in which the exchange exists or will be created, or
- "passive" access if the if-exists flag is set.
- </rule>
- </field>
- <field name="exchange" domain="exchange name">
- <rule implement="MUST">
- <test>amq_exchange_15</test>
- Exchange names starting with "amq." are reserved for predeclared
- and standardised exchanges. If the client attempts to create an
- exchange starting with "amq.", the server MUST raise a channel
- exception with reply code 403 (access refused).
- </rule>
- <assert check="regexp" value="^[a-zA-Z0-9-_.:]+$"/>
- </field>
- <field name="type" type="shortstr">
- exchange type
- <doc>
- Each exchange belongs to one of a set of exchange types implemented
- by the server. The exchange types define the functionality of the
- exchange - i.e. how messages are routed through it. It is not valid
- or meaningful to attempt to change the type of an existing exchange.
- </doc>
- <rule implement="MUST">
- <test>amq_exchange_16</test>
- If the exchange already exists with a different type, the server
- MUST raise a connection exception with a reply code 507 (not allowed).
- </rule>
- <rule implement="MUST">
- <test>amq_exchange_18</test>
- If the server does not support the requested exchange type it MUST
- raise a connection exception with a reply code 503 (command invalid).
- </rule>
- <assert check="regexp" value="^[a-zA-Z0-9-_.:]+$"/>
- </field>
- <field name="passive" type="bit">
- do not create exchange
- <doc>
- If set, the server will not create the exchange. The client can use
- this to check whether an exchange exists without modifying the server
- state.
- </doc>
- <rule implement="MUST">
- <test>amq_exchange_05</test>
- If set, and the exchange does not already exist, the server MUST
- raise a channel exception with reply code 404 (not found).
- </rule>
- </field>
- <field name="durable" type="bit">
- request a durable exchange
- <doc>
- If set when creating a new exchange, the exchange will be marked as
- durable. Durable exchanges remain active when a server restarts.
- Non-durable exchanges (transient exchanges) are purged if/when a
- server restarts.
- </doc>
- <rule implement="MUST">
- <test>amq_exchange_24</test>
- The server MUST support both durable and transient exchanges.
- </rule>
- <rule implement="MUST">
- The server MUST ignore the durable field if the exchange already
- exists.
- </rule>
- </field>
- <field name="auto delete" type="bit">
- auto-delete when unused
- <doc>
- If set, the exchange is deleted when all queues have finished
- using it.
- </doc>
- <rule implement="SHOULD">
- <test>amq_exchange_02</test>
- The server SHOULD allow for a reasonable delay between the point
- when it determines that an exchange is not being used (or no longer
- used), and the point when it deletes the exchange. At the least it
- must allow a client to create an exchange and then bind a queue to
- it, with a small but non-zero delay between these two actions.
- </rule>
- <rule implement="MUST">
- <test>amq_exchange_25</test>
- The server MUST ignore the auto-delete field if the exchange already
- exists.
- </rule>
- </field>
- <field name="internal" type="bit">
- create internal exchange
- <doc>
- If set, the exchange may not be used directly by publishers, but
- only when bound to other exchanges. Internal exchanges are used to
- construct wiring that is not visible to applications.
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- <field name="arguments" type="table">
- arguments for declaration
- <doc>
- A set of arguments for the declaration. The syntax and semantics
- of these arguments depends on the server implementation. This
- field is ignored if passive is 1.
- </doc>
- </field>
- </method>
- <method name="declare-ok" synchronous="1" index="11">
- confirms an exchange declaration
- <doc>
- This method confirms a Declare method and confirms the name of the
- exchange, essential for automatically-named exchanges.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="delete" synchronous="1" index="20">
- delete an exchange
- <doc>
- This method deletes an exchange. When an exchange is deleted all queue
- bindings on the exchange are cancelled.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="delete-ok"/>
- <field name="ticket" domain="access ticket">
- <rule implement="MUST">
- The client MUST provide a valid access ticket giving "active"
- access rights to the exchange's access realm.
- </rule>
- </field>
- <field name="exchange" domain="exchange name">
- <rule implement="MUST">
- <test>amq_exchange_11</test>
- The exchange MUST exist. Attempting to delete a non-existing exchange
- causes a channel exception.
- </rule>
- <assert check="notnull"/>
- </field>
- <field name="if unused" type="bit">
- delete only if unused
- <doc>
- If set, the server will only delete the exchange if it has no queue
- bindings. If the exchange has queue bindings the server does not
- delete it but raises a channel exception instead.
- </doc>
- <rule implement="SHOULD">
- <test>amq_exchange_12</test>
- If set, the server SHOULD delete the exchange but only if it has
- no queue bindings.
- </rule>
- <rule implement="SHOULD">
- <test>amq_exchange_13</test>
- If set, the server SHOULD raise a channel exception if the exchange is in
- use.
- </rule>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- </method>
- <method name="delete-ok" synchronous="1" index="21">
- confirm deletion of an exchange
- <doc>
- This method confirms the deletion of an exchange.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
-
- <method name="bound" synchronous="1" index="22">
- <chassis name="server" implement="SHOULD"/>
- <field name="exchange" domain="exchange name"/>
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key for the message. The routing key is
- used for routing messages depending on the exchange configuration.
- </doc>
- </field>
- <field name = "queue" domain = "queue name"/>
- </method>
-
- <method name="bound-ok" synchronous="1" index="23">
- <field name="reply code" domain="reply code"/>
- <field name="reply text" domain="reply text"/>
- <chassis name="client" implement="SHOULD"/>
- </method>
-
- </class>
-
-
- <class name="queue" handler="channel" index="50">
- <!--
-======================================================
-== QUEUES
-======================================================
--->
- work with queues
-
-<doc>
- Queues store and forward messages. Queues can be configured in the server
- or created at runtime. Queues must be attached to at least one exchange
- in order to receive messages from publishers.
-</doc>
- <doc name="grammar">
- queue = C:DECLARE S:DECLARE-OK
- / C:BIND S:BIND-OK
- / C:PURGE S:PURGE-OK
- / C:DELETE S:DELETE-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="MUST"/>
- <rule implement="MUST">
- <test>amq_queue_33</test>
- A server MUST allow any content class to be sent to any queue, in any
- mix, and queue and delivery these content classes independently. Note
- that all methods that fetch content off queues are specific to a given
- content class.
-</rule>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="declare" synchronous="1" index="10">
- declare queue, create if needed
- <doc>
- This method creates or checks a queue. When creating a new queue
- the client can specify various properties that control the durability
- of the queue and its contents, and the level of sharing for the queue.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_34</test>
- The server MUST create a default binding for a newly-created queue
- to the default exchange, which is an exchange of type 'direct'.
- </rule>
- <rule implement="SHOULD">
- <test>amq_queue_35</test>
- The server SHOULD support a minimum of 256 queues per virtual host
- and ideally, impose no limit except as defined by available resources.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="declare-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- When a client defines a new queue, this belongs to the access realm
- of the ticket used. All further work done with that queue must be
- done with an access ticket for the same realm.
- </doc>
- <doc>
- The client provides a valid access ticket giving "active" access
- to the realm in which the queue exists or will be created, or
- "passive" access if the if-exists flag is set.
- </doc>
- </field>
- <field name="queue" domain="queue name">
- <rule implement="MAY">
- <test>amq_queue_10</test>
- The queue name MAY be empty, in which case the server MUST create
- a new queue with a unique generated name and return this to the
- client in the Declare-Ok method.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_32</test>
- Queue names starting with "amq." are reserved for predeclared and
- standardised server queues. If the queue name starts with "amq."
- and the passive option is zero, the server MUST raise a connection
- exception with reply code 403 (access refused).
- </rule>
- <assert check="regexp" value="^[a-zA-Z0-9-_.:]*$"/>
- </field>
- <field name="passive" type="bit">
- do not create queue
- <doc>
- If set, the server will not create the queue. The client can use
- this to check whether a queue exists without modifying the server
- state.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_05</test>
- If set, and the queue does not already exist, the server MUST
- respond with a reply code 404 (not found) and raise a channel
- exception.
- </rule>
- </field>
- <field name="durable" type="bit">
- request a durable queue
- <doc>
- If set when creating a new queue, the queue will be marked as
- durable. Durable queues remain active when a server restarts.
- Non-durable queues (transient queues) are purged if/when a
- server restarts. Note that durable queues do not necessarily
- hold persistent messages, although it does not make sense to
- send persistent messages to a transient queue.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_03</test>
- The server MUST recreate the durable queue after a restart.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_36</test>
- The server MUST support both durable and transient queues.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_37</test>
- The server MUST ignore the durable field if the queue already
- exists.
- </rule>
- </field>
- <field name="exclusive" type="bit">
- request an exclusive queue
- <doc>
- Exclusive queues may only be consumed from by the current connection.
- Setting the 'exclusive' flag always implies 'auto-delete'.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_38</test>
- The server MUST support both exclusive (private) and non-exclusive
- (shared) queues.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_04</test>
- The server MUST raise a channel exception if 'exclusive' is specified
- and the queue already exists and is owned by a different connection.
- </rule>
- </field>
- <field name="auto delete" type="bit">
- auto-delete queue when unused
- <doc>
- If set, the queue is deleted when all consumers have finished
- using it. Last consumer can be cancelled either explicitly or because
- its channel is closed. If there was no consumer ever on the queue, it
- won't be deleted.
- </doc>
- <rule implement="SHOULD">
- <test>amq_queue_02</test>
- The server SHOULD allow for a reasonable delay between the point
- when it determines that a queue is not being used (or no longer
- used), and the point when it deletes the queue. At the least it
- must allow a client to create a queue and then create a consumer
- to read from it, with a small but non-zero delay between these
- two actions. The server should equally allow for clients that may
- be disconnected prematurely, and wish to re-consume from the same
- queue without losing messages. We would recommend a configurable
- timeout, with a suitable default value being one minute.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_31</test>
- The server MUST ignore the auto-delete field if the queue already
- exists.
- </rule>
- </field>
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- <field name="arguments" type="table">
- arguments for declaration
- <doc>
- A set of arguments for the declaration. The syntax and semantics
- of these arguments depends on the server implementation. This
- field is ignored if passive is 1.
- </doc>
- </field>
- </method>
- <method name="declare-ok" synchronous="1" index="11">
- confirms a queue definition
- <doc>
- This method confirms a Declare method and confirms the name of the
- queue, essential for automatically-named queues.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="queue" domain="queue name">
- <doc>
- Reports the name of the queue. If the server generated a queue
- name, this field contains that name.
- </doc>
- <assert check="notnull"/>
- </field>
- <field name="message count" type="long">
- number of messages in queue
- <doc>
- Reports the number of messages in the queue, which will be zero
- for newly-created queues.
- </doc>
- </field>
- <field name="consumer count" type="long">
- number of consumers
- <doc>
- Reports the number of active consumers for the queue. Note that
- consumers can suspend activity (Channel.Flow) in which case they
- do not appear in this count.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="bind" synchronous="1" index="20">
- bind queue to an exchange
- <doc>
- This method binds a queue to an exchange. Until a queue is
- bound it will not receive any messages. In a classic messaging
- model, store-and-forward queues are bound to a dest exchange
- and subscription queues are bound to a dest_wild exchange.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_25</test>
- A server MUST allow ignore duplicate bindings - that is, two or
- more bind methods for a specific queue, with identical arguments
- - without treating these as an error.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_39</test>
- If a bind fails, the server MUST raise a connection exception.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_12</test>
- The server MUST NOT allow a durable queue to bind to a transient
- exchange. If the client attempts this the server MUST raise a
- channel exception.
- </rule>
- <rule implement="SHOULD">
- <test>amq_queue_13</test>
- Bindings for durable queues are automatically durable and the
- server SHOULD restore such bindings after a server restart.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_17</test>
- If the client attempts to an exchange that was declared as internal,
- the server MUST raise a connection exception with reply code 530
- (not allowed).
- </rule>
- <rule implement="SHOULD">
- <test>amq_queue_40</test>
- The server SHOULD support at least 4 bindings per queue, and
- ideally, impose no limit except as defined by available resources.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="bind-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- The client provides a valid access ticket giving "active"
- access rights to the queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to bind. If the queue name is
- empty, refers to the current queue for the channel, which is
- the last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue
- name in this method is empty, the server MUST raise a connection
- exception with reply code 530 (not allowed).
- </doc>
- <doc name = "rule" test = "amq_queue_26">
- If the queue does not exist the server MUST raise a channel exception
- with reply code 404 (not found).
- </doc>
- </field>
-
- <field name="exchange" domain="exchange name">
- The name of the exchange to bind to.
- <rule implement="MUST">
- <test>amq_queue_14</test>
- If the exchange does not exist the server MUST raise a channel
- exception with reply code 404 (not found).
- </rule>
- </field>
- <field name="routing key" type="shortstr">
- message routing key
- <doc>
- Specifies the routing key for the binding. The routing key is
- used for routing messages depending on the exchange configuration.
- Not all exchanges use a routing key - refer to the specific
- exchange documentation. If the routing key is empty and the queue
- name is empty, the routing key will be the current queue for the
- channel, which is the last declared queue.
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- <field name="arguments" type="table">
- arguments for binding
- <doc>
- A set of arguments for the binding. The syntax and semantics of
- these arguments depends on the exchange class.
- </doc>
- </field>
- </method>
- <method name="bind-ok" synchronous="1" index="21">
- confirm bind successful
- <doc>
- This method confirms that the bind was successful.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="purge" synchronous="1" index="30">
- purge a queue
- <doc>
- This method removes all messages from a queue. It does not cancel
- consumers. Purged messages are deleted without any formal "undo"
- mechanism.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_15</test>
- A call to purge MUST result in an empty queue.
- </rule>
- <rule implement="MUST">
- <test>amq_queue_41</test>
- On transacted channels the server MUST not purge messages that have
- already been sent to a client but not yet acknowledged.
- </rule>
- <rule implement="MAY">
- <test>amq_queue_42</test>
- The server MAY implement a purge queue or log that allows system
- administrators to recover accidentally-purged messages. The server
- SHOULD NOT keep purged messages in the same storage spaces as the
- live messages since the volumes of purged messages may get very
- large.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="purge-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- The access ticket must be for the access realm that holds the
- queue.
- </doc>
- <rule implement="MUST">
- The client MUST provide a valid access ticket giving "read" access
- rights to the queue's access realm. Note that purging a queue is
- equivalent to reading all messages and discarding them.
- </rule>
- </field>
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to purge. If the queue name is
- empty, refers to the current queue for the channel, which is
- the last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue
- name in this method is empty, the server MUST raise a connection
- exception with reply code 530 (not allowed).
- </doc>
- <doc name = "rule" test = "amq_queue_16">
- The queue must exist. Attempting to purge a non-existing queue
- causes a channel exception.
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
- </method>
- <method name="purge-ok" synchronous="1" index="31">
- confirms a queue purge
- <doc>
- This method confirms the purge of a queue.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="message count" type="long">
- number of messages purged
- <doc>
- Reports the number of messages purged.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="delete" synchronous="1" index="40">
- delete a queue
- <doc>
- This method deletes a queue. When a queue is deleted any pending
- messages are sent to a dead-letter queue if this is defined in the
- server configuration, and all consumers on the queue are cancelled.
- </doc>
- <rule implement="SHOULD">
- <test>amq_queue_43</test>
- The server SHOULD use a dead-letter queue to hold messages that
- were pending on a deleted queue, and MAY provide facilities for
- a system administrator to move these messages back to an active
- queue.
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="delete-ok"/>
- <field name="ticket" domain="access ticket">
- <doc>
- The client provides a valid access ticket giving "active"
- access rights to the queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to delete. If the queue name is
- empty, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue
- name in this method is empty, the server MUST raise a connection
- exception with reply code 530 (not allowed).
- </doc>
- <doc name = "rule" test = "amq_queue_21">
- The queue must exist. Attempting to delete a non-existing queue
- causes a channel exception.
- </doc>
- </field>
-
- <field name="if unused" type="bit">
- delete only if unused
- <doc>
- If set, the server will only delete the queue if it has no
- consumers. If the queue has consumers the server does does not
- delete it but raises a channel exception instead.
- </doc>
- <rule implement="MUST">
- <test>amq_queue_29</test>
- <test>amq_queue_30</test>
- The server MUST respect the if-unused flag when deleting a queue.
- </rule>
- </field>
- <field name="if empty" type="bit">
- delete only if empty
- <test>amq_queue_27</test>
- <doc>
- If set, the server will only delete the queue if it has no
- messages. If the queue is not empty the server raises a channel
- exception.
- </doc>
- </field>
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name="delete-ok" synchronous="1" index="41">
- confirm deletion of a queue
- <doc>
- This method confirms the deletion of a queue.
- </doc>
- <chassis name="client" implement="MUST"/>
- <field name="message count" type="long">
- number of messages purged
- <doc>
- Reports the number of messages purged.
- </doc>
- </field>
- </method>
- </class>
- <class name="basic" handler="channel" index="60">
- <!--
-======================================================
-== BASIC MIDDLEWARE
-======================================================
--->
- work with basic content
-<doc>
- The Basic class provides methods that support an industry-standard
- messaging model.
-</doc>
-
-<doc name = "grammar">
- basic = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN content
- / S:DELIVER content
- / C:GET ( S:GET-OK content / S:GET-EMPTY )
- / C:ACK
- / C:REJECT
-</doc>
-
-<chassis name = "server" implement = "MUST" />
-<chassis name = "client" implement = "MAY" />
-
-<doc name = "rule" test = "amq_basic_08">
- The server SHOULD respect the persistent property of basic messages
- and SHOULD make a best-effort to hold persistent basic messages on a
- reliable storage mechanism.
-</doc>
-<doc name = "rule" test = "amq_basic_09">
- The server MUST NOT discard a persistent basic message in case of a
- queue overflow. The server MAY use the Channel.Flow method to slow
- or stop a basic message publisher when necessary.
-</doc>
-<doc name = "rule" test = "amq_basic_10">
- The server MAY overflow non-persistent basic messages to persistent
- storage and MAY discard or dead-letter non-persistent basic messages
- on a priority basis if the queue size exceeds some configured limit.
-</doc>
-<doc name = "rule" test = "amq_basic_11">
- The server MUST implement at least 2 priority levels for basic
- messages, where priorities 0-4 and 5-9 are treated as two distinct
- levels. The server MAY implement up to 10 priority levels.
-</doc>
-<doc name = "rule" test = "amq_basic_12">
- The server MUST deliver messages of the same priority in order
- irrespective of their individual persistence.
-</doc>
-<doc name = "rule" test = "amq_basic_13">
- The server MUST support both automatic and explicit acknowledgements
- on Basic content.
-</doc>
-
-<!-- These are the properties for a Basic content -->
-
-<field name = "content type" type = "shortstr">
- MIME content type
-</field>
-<field name = "content encoding" type = "shortstr">
- MIME content encoding
-</field>
-<field name = "headers" type = "table">
- Message header field table
-</field>
-<field name = "delivery mode" type = "octet">
- Non-persistent (1) or persistent (2)
-</field>
-<field name = "priority" type = "octet">
- The message priority, 0 to 9
-</field>
-<field name = "correlation id" type = "shortstr">
- The application correlation identifier
-</field>
-<field name = "reply to" type = "shortstr">
- The destination to reply to
-</field>
-<field name = "expiration" type = "shortstr">
- Message expiration specification
-</field>
-<field name = "message id" type = "shortstr">
- The application message identifier
-</field>
-<field name = "timestamp" type = "timestamp">
- The message timestamp
-</field>
-<field name = "type" type = "shortstr">
- The message type name
-</field>
-<field name = "user id" type = "shortstr">
- The creating user id
-</field>
-<field name = "app id" type = "shortstr">
- The creating application id
-</field>
-<field name = "cluster id" type = "shortstr">
- Intra-cluster routing identifier
-</field>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "qos" synchronous = "1" index = "10">
- specify quality of service
- <doc>
- This method requests a specific quality of service. The QoS can
- be specified for the current channel or for all channels on the
- connection. The particular properties and semantics of a qos method
- always depend on the content class semantics. Though the qos method
- could in principle apply to both peers, it is currently meaningful
- only for the server.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch size" type = "long">
- prefetch window in octets
- <doc>
- The client can request that messages be sent in advance so that
- when the client finishes processing a message, the following
- message is already held locally, rather than needing to be sent
- down the channel. Prefetching gives a performance improvement.
- This field specifies the prefetch window size in octets. The
- server will send a message in advance if it is equal to or
- smaller in size than the available prefetch size (and also falls
- into other prefetch limits). May be set to zero, meaning "no
- specific limit", although other prefetch limits may still apply.
- The prefetch-size is ignored if the no-ack option is set.
- </doc>
- <doc name = "rule" test = "amq_basic_17">
- The server MUST ignore this setting when the client is not
- processing any messages - i.e. the prefetch size does not limit
- the transfer of single messages to a client, only the sending in
- advance of more messages while the client still has one or more
- unacknowledged messages.
- </doc>
- </field>
-
- <field name = "prefetch count" type = "short">
- prefetch window in messages
- <doc>
- Specifies a prefetch window in terms of whole messages. This
- field may be used in combination with the prefetch-size field;
- a message will only be sent in advance if both prefetch windows
- (and those at the channel and connection level) allow it.
- The prefetch-count is ignored if the no-ack option is set.
- </doc>
- <doc name = "rule" test = "amq_basic_18">
- The server MAY send less data in advance than allowed by the
- client's specified prefetch windows but it MUST NOT send more.
- </doc>
- </field>
-
- <field name = "global" type = "bit">
- apply to entire connection
- <doc>
- By default the QoS settings apply to the current channel only. If
- this field is set, they are applied to the entire connection.
- </doc>
- </field>
-</method>
-
-<method name = "qos-ok" synchronous = "1" index = "11">
- confirm the requested qos
- <doc>
- This method tells the client that the requested QoS levels could
- be handled by the server. The requested QoS applies to all active
- consumers until a new QoS is defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "consume" synchronous = "1" index = "20">
- start a queue consumer
- <doc>
- This method asks the server to start a "consumer", which is a
- transient request for messages from a specific queue. Consumers
- last as long as the channel they were created on, or until the
- client cancels them.
- </doc>
- <doc name = "rule" test = "amq_basic_01">
- The server SHOULD support at least 16 consumers per queue, unless
- the queue was declared as private, and ideally, impose no limit
- except as defined by available resources.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read" access
- rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is
- local to a connection, so two clients can use the same consumer
- tags. If this field is empty the server will generate a unique
- tag.
- </doc>
- <doc name = "rule" test = "todo">
- The tag MUST NOT refer to an existing consumer. If the client
- attempts to create two consumers with the same non-empty tag
- the server MUST raise a connection exception with reply code
- 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no local" domain = "no local" />
-
- <field name = "no ack" domain = "no ack" />
-
- <field name = "exclusive" type = "bit">
- request exclusive access
- <doc>
- Request exclusive consumer access, meaning only this consumer can
- access the queue.
- </doc>
- <doc name = "rule" test = "amq_basic_02">
- If the server cannot grant exclusive access to the queue when asked,
- - because there are other consumers active - it MUST raise a channel
- exception with return code 403 (access refused).
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-
- <field name="arguments" type="table" label="arguments for consuming">
- <doc>
- A set of arguments for the consume. The syntax and semantics
- of these arguments depends on the server implementation. This
- field is ignored if passive is 1.
- </doc>
- </field>
-</method>
-
-<method name = "consume-ok" synchronous = "1" index = "21">
- confirm a new consumer
- <doc>
- The server provides the client with a consumer tag, which is used
- by the client for methods called on the consumer at a later stage.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Holds the consumer tag specified by the client or provided by
- the server.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "cancel" synchronous = "1" index = "30">
- end a queue consumer
- <doc test = "amq_basic_04">
- This method cancels a consumer. This does not affect already
- delivered messages, but it does mean the server will not send any
- more messages for that consumer. The client may receive an
- abitrary number of messages in between sending the cancel method
- and receiving the cancel-ok reply.
- </doc>
- <doc name = "rule" test = "todo">
- If the queue no longer exists when the client sends a cancel command,
- or the consumer has been cancelled for other reasons, this command
- has no effect.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "cancel-ok" synchronous = "1" index = "31">
- confirm a cancelled consumer
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "publish" content = "1" index = "40">
- publish a message
- <doc>
- This method publishes a message to a specific exchange. The message
- will be routed to queues as defined by the exchange configuration
- and distributed to any active consumers when the transaction, if any,
- is committed.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "write"
- access rights to the access realm for the exchange.
- </doc>
- </field>
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange
- name can be empty, meaning the default exchange. If the exchange
- name is specified, and that exchange does not exist, the server
- will raise a channel exception.
- </doc>
- <doc name = "rule" test = "amq_basic_06">
- The server MUST accept a blank exchange name to mean the default
- exchange.
- </doc>
- <doc name = "rule" test = "amq_basic_14">
- If the exchange was declared as an internal exchange, the server
- MUST raise a channel exception with a reply code 403 (access
- refused).
- </doc>
- <doc name = "rule" test = "amq_basic_15">
- The exchange MAY refuse basic content in which case it MUST raise
- a channel exception with reply code 540 (not implemented).
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key for the message. The routing key is
- used for routing messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" type = "bit">
- indicate mandatory routing
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue. If this flag is set, the server will return an
- unroutable message with a Return method. If this flag is zero, the
- server silently drops the message.
- </doc>
- <doc name = "rule" test = "amq_basic_07">
- The server SHOULD implement the mandatory flag.
- </doc>
- </field>
-
- <field name = "immediate" type = "bit">
- request immediate delivery
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue consumer immediately. If this flag is set, the
- server will return an undeliverable message with a Return method.
- If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
- <doc name = "rule" test = "amq_basic_16">
- The server SHOULD implement the immediate flag.
- </doc>
- </field>
-</method>
-
-<method name = "return" content = "1" index = "50">
- return a failed message
- <doc>
- This method returns an undeliverable message that was published
- with the "immediate" flag set, or an unroutable message published
- with the "mandatory" flag set. The reply code and text provide
- information about the reason that the message was undeliverable.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply code" domain = "reply code" />
- <field name = "reply text" domain = "reply text" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "deliver" content = "1" index = "60">
- notify the client of a consumer message
- <doc>
- This method delivers a message to the client, via a consumer. In
- the asynchronous message delivery model, the client starts a
- consumer using the Consume method, then the server responds with
- Deliver methods as and when messages arrive for that consumer.
- </doc>
- <doc name = "rule" test = "amq_basic_19">
- The server SHOULD track the number of times a message has been
- delivered to clients and when a message is redelivered a certain
- number of times - e.g. 5 times - without being acknowledged, the
- server SHOULD consider the message to be unprocessable (possibly
- causing client applications to abort), and move the message to a
- dead letter queue.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "get" synchronous = "1" index = "70">
- direct access to a queue
- <doc>
- This method provides a direct access to the messages in a queue
- using a synchronous dialogue that is designed for specific types of
- application where synchronous functionality is more important than
- performance.
- </doc>
- <response name = "get-ok" />
- <response name = "get-empty" />
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read"
- access rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no ack" domain = "no ack" />
-</method>
-
-<method name = "get-ok" synchronous = "1" content = "1" index = "71">
- provide client with a message
- <doc>
- This method delivers a message to the client following a get
- method. A message delivered by 'get-ok' must be acknowledged
- unless the no-ack option was set in the get method.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was originally
- published to. If empty, the message was published to the default
- exchange.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-
- <field name = "message count" type = "long" >
- number of messages pending
- <doc>
- This field reports the number of messages pending on the queue,
- excluding the message being delivered. Note that this figure is
- indicative, not reliable, and can change arbitrarily as messages
- are added to the queue and removed by other clients.
- </doc>
- </field>
-</method>
-
-
-<method name = "get-empty" synchronous = "1" index = "72">
- indicate no messages available
- <doc>
- This method tells the client that the queue has no messages
- available for the client.
- </doc>
- <chassis name = "client" implement = "MAY" />
-
- <field name = "cluster id" type = "shortstr">
- Cluster id
- <doc>
- For use by cluster applications, should not be used by
- client applications.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "ack" index = "80">
- acknowledge one or more messages
- <doc>
- This method acknowledges one or more messages delivered via the
- Deliver or Get-Ok methods. The client can ask to confirm a
- single message or a set of messages up to and including a specific
- message.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "multiple" type = "bit">
- acknowledge multiple messages
- <doc>
- If set to 1, the delivery tag is treated as "up to and including",
- so that the client can acknowledge multiple messages with a single
- method. If set to zero, the delivery tag refers to a single
- message. If the multiple field is 1, and the delivery tag is zero,
- tells the server to acknowledge all outstanding mesages.
- </doc>
- <doc name = "rule" test = "amq_basic_20">
- The server MUST validate that a non-zero delivery-tag refers to an
- delivered message, and raise a channel exception if this is not the
- case.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "reject" index = "90">
- reject an incoming message
- <doc>
- This method allows a client to reject a message. It can be used to
- interrupt and cancel large incoming messages, or return untreatable
- messages to their original queue.
- </doc>
- <doc name = "rule" test = "amq_basic_21">
- The server SHOULD be capable of accepting and process the Reject
- method while sending message content with a Deliver or Get-Ok
- method. I.e. the server should read and process incoming methods
- while sending output frames. To cancel a partially-send content,
- the server sends a content body frame of size 1 (i.e. with no data
- except the frame-end octet).
- </doc>
- <doc name = "rule" test = "amq_basic_22">
- The server SHOULD interpret this method as meaning that the client
- is unable to process the message at this time.
- </doc>
- <doc name = "rule">
- A client MUST NOT use this method as a means of selecting messages
- to process. A rejected message MAY be discarded or dead-lettered,
- not necessarily passed to another client.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "requeue" type = "bit">
- requeue the message
- <doc>
- If this field is zero, the message will be discarded. If this bit
- is 1, the server will attempt to requeue the message.
- </doc>
- <doc name = "rule" test = "amq_basic_23">
- The server MUST NOT deliver the message to the same client within
- the context of the current channel. The recommended strategy is
- to attempt to deliver the message to an alternative consumer, and
- if that is not possible, to move the message to a dead-letter
- queue. The server MAY use more sophisticated tracking to hold
- the message on the queue and redeliver it to the same client at
- a later stage.
- </doc>
- </field>
-</method>
-
-<method name = "recover" index = "100">
- redeliver unacknowledged messages
- <doc>
- This method asks the broker to redeliver all unacknowledged messages on a
- specified channel. Zero or more messages may be redelivered. This method
- is only allowed on non-transacted channels.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "requeue" type = "bit">
- requeue the message
- <doc>
- If this field is zero, the message will be redelivered to the original
- recipient. If this bit is 1, the server will attempt to requeue the
- message, potentially then delivering it to an alternative subscriber.
- </doc>
- </field>
- <doc name="rule">
- The server MUST set the redelivered flag on all messages that are resent.
- </doc>
- <doc name="rule">
- The server MUST raise a channel exception if this is called on a
- transacted channel.
- </doc>
- <response name="recover-ok"/>
- </method>
- <method name="recover-ok" synchronous="1" index="101">
- confirm a successful recover
- <doc>
- This method confirms to the client that the recover succeeded.
- Note that if an recover fails, the server raises a channel exception.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
-
-</class>
-
-
- <class name="file" handler="channel" index="70">
- <!--
-======================================================
-== FILE TRANSFER
-======================================================
--->
- work with file content
-<doc>
- The file class provides methods that support reliable file transfer.
- File messages have a specific set of properties that are required for
- interoperability with file transfer applications. File messages and
- acknowledgements are subject to channel transactions. Note that the
- file class does not provide message browsing methods; these are not
- compatible with the staging model. Applications that need browsable
- file transfer should use Basic content and the Basic class.
-</doc>
-
-<doc name = "grammar">
- file = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:OPEN S:OPEN-OK C:STAGE content
- / S:OPEN C:OPEN-OK S:STAGE content
- / C:PUBLISH
- / S:DELIVER
- / S:RETURN
- / C:ACK
- / C:REJECT
-</doc>
-
-<chassis name = "server" implement = "MAY" />
-<chassis name = "client" implement = "MAY" />
-
-<doc name = "rule">
- The server MUST make a best-effort to hold file messages on a
- reliable storage mechanism.
-</doc>
-<doc name = "rule">
- The server MUST NOT discard a file message in case of a queue
- overflow. The server MUST use the Channel.Flow method to slow or stop
- a file message publisher when necessary.
-</doc>
-<doc name = "rule">
- The server MUST implement at least 2 priority levels for file
- messages, where priorities 0-4 and 5-9 are treated as two distinct
- levels. The server MAY implement up to 10 priority levels.
-</doc>
-<doc name = "rule">
- The server MUST support both automatic and explicit acknowledgements
- on file content.
-</doc>
-
-<!-- These are the properties for a File content -->
-
-<field name = "content type" type = "shortstr">
- MIME content type
-</field>
-<field name = "content encoding" type = "shortstr">
- MIME content encoding
-</field>
-<field name = "headers" type = "table">
- Message header field table
-</field>
-<field name = "priority" type = "octet">
- The message priority, 0 to 9
-</field>
-<field name = "reply to" type = "shortstr">
- The destination to reply to
-</field>
-<field name = "message id" type = "shortstr">
- The application message identifier
-</field>
-<field name = "filename" type = "shortstr">
- The message filename
-</field>
-<field name = "timestamp" type = "timestamp">
- The message timestamp
-</field>
-<field name = "cluster id" type = "shortstr">
- Intra-cluster routing identifier
-</field>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "qos" synchronous = "1" index = "10">
- specify quality of service
- <doc>
- This method requests a specific quality of service. The QoS can
- be specified for the current channel or for all channels on the
- connection. The particular properties and semantics of a qos method
- always depend on the content class semantics. Though the qos method
- could in principle apply to both peers, it is currently meaningful
- only for the server.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch size" type = "long">
- prefetch window in octets
- <doc>
- The client can request that messages be sent in advance so that
- when the client finishes processing a message, the following
- message is already held locally, rather than needing to be sent
- down the channel. Prefetching gives a performance improvement.
- This field specifies the prefetch window size in octets. May be
- set to zero, meaning "no specific limit". Note that other
- prefetch limits may still apply. The prefetch-size is ignored
- if the no-ack option is set.
- </doc>
- </field>
-
- <field name = "prefetch count" type = "short">
- prefetch window in messages
- <doc>
- Specifies a prefetch window in terms of whole messages. This
- is compatible with some file API implementations. This field
- may be used in combination with the prefetch-size field; a
- message will only be sent in advance if both prefetch windows
- (and those at the channel and connection level) allow it.
- The prefetch-count is ignored if the no-ack option is set.
- </doc>
- <doc name = "rule">
- The server MAY send less data in advance than allowed by the
- client's specified prefetch windows but it MUST NOT send more.
- </doc>
- </field>
-
- <field name = "global" type = "bit">
- apply to entire connection
- <doc>
- By default the QoS settings apply to the current channel only. If
- this field is set, they are applied to the entire connection.
- </doc>
- </field>
-</method>
-
-<method name = "qos-ok" synchronous = "1" index = "11">
- confirm the requested qos
- <doc>
- This method tells the client that the requested QoS levels could
- be handled by the server. The requested QoS applies to all active
- consumers until a new QoS is defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "consume" synchronous = "1" index = "20">
- start a queue consumer
- <doc>
- This method asks the server to start a "consumer", which is a
- transient request for messages from a specific queue. Consumers
- last as long as the channel they were created on, or until the
- client cancels them.
- </doc>
- <doc name = "rule">
- The server SHOULD support at least 16 consumers per queue, unless
- the queue was declared as private, and ideally, impose no limit
- except as defined by available resources.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read" access
- rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is
- local to a connection, so two clients can use the same consumer
- tags. If this field is empty the server will generate a unique
- tag.
- </doc>
- <doc name = "rule" test = "todo">
- The tag MUST NOT refer to an existing consumer. If the client
- attempts to create two consumers with the same non-empty tag
- the server MUST raise a connection exception with reply code
- 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no local" domain = "no local" />
-
- <field name = "no ack" domain = "no ack" />
-
- <field name = "exclusive" type = "bit">
- request exclusive access
- <doc>
- Request exclusive consumer access, meaning only this consumer can
- access the queue.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- If the server cannot grant exclusive access to the queue when asked,
- - because there are other consumers active - it MUST raise a channel
- exception with return code 405 (resource locked).
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "consume-ok" synchronous = "1" index = "21">
- confirm a new consumer
- <doc>
- This method provides the client with a consumer tag which it MUST
- use in methods that work with the consumer.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Holds the consumer tag specified by the client or provided by
- the server.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "cancel" synchronous = "1" index = "30">
- end a queue consumer
- <doc>
- This method cancels a consumer. This does not affect already
- delivered messages, but it does mean the server will not send any
- more messages for that consumer.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "cancel-ok" synchronous = "1" index = "31">
- confirm a cancelled consumer
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "open" synchronous = "1" index = "40">
- request to start staging
- <doc>
- This method requests permission to start staging a message. Staging
- means sending the message into a temporary area at the recipient end
- and then delivering the message by referring to this temporary area.
- Staging is how the protocol handles partial file transfers - if a
- message is partially staged and the connection breaks, the next time
- the sender starts to stage it, it can restart from where it left off.
- </doc>
- <response name = "open-ok" />
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "identifier" type = "shortstr">
- staging identifier
- <doc>
- This is the staging identifier. This is an arbitrary string chosen
- by the sender. For staging to work correctly the sender must use
- the same staging identifier when staging the same message a second
- time after recovery from a failure. A good choice for the staging
- identifier would be the SHA1 hash of the message properties data
- (including the original filename, revised time, etc.).
- </doc>
- </field>
-
- <field name = "content size" type = "longlong">
- message content size
- <doc>
- The size of the content in octets. The recipient may use this
- information to allocate or check available space in advance, to
- avoid "disk full" errors during staging of very large messages.
- </doc>
- <doc name = "rule">
- The sender MUST accurately fill the content-size field.
- Zero-length content is permitted.
- </doc>
- </field>
-</method>
-
-<method name = "open-ok" synchronous = "1" index = "41">
- confirm staging ready
- <doc>
- This method confirms that the recipient is ready to accept staged
- data. If the message was already partially-staged at a previous
- time the recipient will report the number of octets already staged.
- </doc>
- <response name = "stage" />
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "staged size" type = "longlong">
- already staged amount
- <doc>
- The amount of previously-staged content in octets. For a new
- message this will be zero.
- </doc>
- <doc name = "rule">
- The sender MUST start sending data from this octet offset in the
- message, counting from zero.
- </doc>
- <doc name = "rule">
- The recipient MAY decide how long to hold partially-staged content
- and MAY implement staging by always discarding partially-staged
- content. However if it uses the file content type it MUST support
- the staging methods.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "stage" content = "1" index = "50">
- stage message content
- <doc>
- This method stages the message, sending the message content to the
- recipient from the octet offset specified in the Open-Ok method.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "publish" index = "60">
- publish a message
- <doc>
- This method publishes a staged file message to a specific exchange.
- The file message will be routed to queues as defined by the exchange
- configuration and distributed to any active consumers when the
- transaction, if any, is committed.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "write"
- access rights to the access realm for the exchange.
- </doc>
- </field>
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange
- name can be empty, meaning the default exchange. If the exchange
- name is specified, and that exchange does not exist, the server
- will raise a channel exception.
- </doc>
- <doc name = "rule">
- The server MUST accept a blank exchange name to mean the default
- exchange.
- </doc>
- <doc name = "rule">
- If the exchange was declared as an internal exchange, the server
- MUST respond with a reply code 403 (access refused) and raise a
- channel exception.
- </doc>
- <doc name = "rule">
- The exchange MAY refuse file content in which case it MUST respond
- with a reply code 540 (not implemented) and raise a channel
- exception.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key for the message. The routing key is
- used for routing messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" type = "bit">
- indicate mandatory routing
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue. If this flag is set, the server will return an
- unroutable message with a Return method. If this flag is zero, the
- server silently drops the message.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- The server SHOULD implement the mandatory flag.
- </doc>
- </field>
-
- <field name = "immediate" type = "bit">
- request immediate delivery
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue consumer immediately. If this flag is set, the
- server will return an undeliverable message with a Return method.
- If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- The server SHOULD implement the immediate flag.
- </doc>
- </field>
-
- <field name = "identifier" type = "shortstr">
- staging identifier
- <doc>
- This is the staging identifier of the message to publish. The
- message must have been staged. Note that a client can send the
- Publish method asynchronously without waiting for staging to
- finish.
- </doc>
- </field>
-</method>
-
-<method name = "return" content = "1" index = "70">
- return a failed message
- <doc>
- This method returns an undeliverable message that was published
- with the "immediate" flag set, or an unroutable message published
- with the "mandatory" flag set. The reply code and text provide
- information about the reason that the message was undeliverable.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply code" domain = "reply code" />
- <field name = "reply text" domain = "reply text" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "deliver" index = "80">
- notify the client of a consumer message
- <doc>
- This method delivers a staged file message to the client, via a
- consumer. In the asynchronous message delivery model, the client
- starts a consumer using the Consume method, then the server
- responds with Deliver methods as and when messages arrive for
- that consumer.
- </doc>
- <doc name = "rule">
- The server SHOULD track the number of times a message has been
- delivered to clients and when a message is redelivered a certain
- number of times - e.g. 5 times - without being acknowledged, the
- server SHOULD consider the message to be unprocessable (possibly
- causing client applications to abort), and move the message to a
- dead letter queue.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was originally
- published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-
- <field name = "identifier" type = "shortstr">
- staging identifier
- <doc>
- This is the staging identifier of the message to deliver. The
- message must have been staged. Note that a server can send the
- Deliver method asynchronously without waiting for staging to
- finish.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "ack" index = "90">
- acknowledge one or more messages
- <doc>
- This method acknowledges one or more messages delivered via the
- Deliver method. The client can ask to confirm a single message or
- a set of messages up to and including a specific message.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "multiple" type = "bit">
- acknowledge multiple messages
- <doc>
- If set to 1, the delivery tag is treated as "up to and including",
- so that the client can acknowledge multiple messages with a single
- method. If set to zero, the delivery tag refers to a single
- message. If the multiple field is 1, and the delivery tag is zero,
- tells the server to acknowledge all outstanding mesages.
- </doc>
- <doc name = "rule">
- The server MUST validate that a non-zero delivery-tag refers to an
- delivered message, and raise a channel exception if this is not the
- case.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "reject" index = "100">
- reject an incoming message
- <doc>
- This method allows a client to reject a message. It can be used to
- return untreatable messages to their original queue. Note that file
- content is staged before delivery, so the client will not use this
- method to interrupt delivery of a large message.
- </doc>
- <doc name = "rule">
- The server SHOULD interpret this method as meaning that the client
- is unable to process the message at this time.
- </doc>
- <doc name = "rule">
- A client MUST NOT use this method as a means of selecting messages
- to process. A rejected message MAY be discarded or dead-lettered,
- not necessarily passed to another client.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "requeue" type = "bit">
- requeue the message
- <doc>
- If this field is zero, the message will be discarded. If this bit
- is 1, the server will attempt to requeue the message.
- </doc>
- <doc name = "rule">
- The server MUST NOT deliver the message to the same client within
- the context of the current channel. The recommended strategy is
- to attempt to deliver the message to an alternative consumer, and
- if that is not possible, to move the message to a dead-letter
- queue. The server MAY use more sophisticated tracking to hold
- the message on the queue and redeliver it to the same client at
- a later stage.
- </doc>
- </field>
-</method>
-
-</class>
-
- <class name="stream" handler="channel" index="80">
- <!--
-======================================================
-== STREAMING
-======================================================
--->
- work with streaming content
-
-<doc>
- The stream class provides methods that support multimedia streaming.
- The stream class uses the following semantics: one message is one
- packet of data; delivery is unacknowleged and unreliable; the consumer
- can specify quality of service parameters that the server can try to
- adhere to; lower-priority messages may be discarded in favour of high
- priority messages.
-</doc>
-
-<doc name = "grammar">
- stream = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN
- / S:DELIVER content
-</doc>
-
-<chassis name = "server" implement = "MAY" />
-<chassis name = "client" implement = "MAY" />
-
-<doc name = "rule">
- The server SHOULD discard stream messages on a priority basis if
- the queue size exceeds some configured limit.
-</doc>
-<doc name = "rule">
- The server MUST implement at least 2 priority levels for stream
- messages, where priorities 0-4 and 5-9 are treated as two distinct
- levels. The server MAY implement up to 10 priority levels.
-</doc>
-<doc name = "rule">
- The server MUST implement automatic acknowledgements on stream
- content. That is, as soon as a message is delivered to a client
- via a Deliver method, the server must remove it from the queue.
-</doc>
-
-
-<!-- These are the properties for a Stream content -->
-
-<field name = "content type" type = "shortstr">
- MIME content type
-</field>
-<field name = "content encoding" type = "shortstr">
- MIME content encoding
-</field>
-<field name = "headers" type = "table">
- Message header field table
-</field>
-<field name = "priority" type = "octet">
- The message priority, 0 to 9
-</field>
-<field name = "timestamp" type = "timestamp">
- The message timestamp
-</field>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "qos" synchronous = "1" index = "10">
- specify quality of service
- <doc>
- This method requests a specific quality of service. The QoS can
- be specified for the current channel or for all channels on the
- connection. The particular properties and semantics of a qos method
- always depend on the content class semantics. Though the qos method
- could in principle apply to both peers, it is currently meaningful
- only for the server.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch size" type = "long">
- prefetch window in octets
- <doc>
- The client can request that messages be sent in advance so that
- when the client finishes processing a message, the following
- message is already held locally, rather than needing to be sent
- down the channel. Prefetching gives a performance improvement.
- This field specifies the prefetch window size in octets. May be
- set to zero, meaning "no specific limit". Note that other
- prefetch limits may still apply.
- </doc>
- </field>
-
- <field name = "prefetch count" type = "short">
- prefetch window in messages
- <doc>
- Specifies a prefetch window in terms of whole messages. This
- field may be used in combination with the prefetch-size field;
- a message will only be sent in advance if both prefetch windows
- (and those at the channel and connection level) allow it.
- </doc>
- </field>
-
- <field name = "consume rate" type = "long">
- transfer rate in octets/second
- <doc>
- Specifies a desired transfer rate in octets per second. This is
- usually determined by the application that uses the streaming
- data. A value of zero means "no limit", i.e. as rapidly as
- possible.
- </doc>
- <doc name = "rule">
- The server MAY ignore the prefetch values and consume rates,
- depending on the type of stream and the ability of the server
- to queue and/or reply it. The server MAY drop low-priority
- messages in favour of high-priority messages.
- </doc>
- </field>
-
- <field name = "global" type = "bit">
- apply to entire connection
- <doc>
- By default the QoS settings apply to the current channel only. If
- this field is set, they are applied to the entire connection.
- </doc>
- </field>
-</method>
-
-<method name = "qos-ok" synchronous = "1" index = "11">
- confirm the requested qos
- <doc>
- This method tells the client that the requested QoS levels could
- be handled by the server. The requested QoS applies to all active
- consumers until a new QoS is defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "consume" synchronous = "1" index = "20">
- start a queue consumer
- <doc>
- This method asks the server to start a "consumer", which is a
- transient request for messages from a specific queue. Consumers
- last as long as the channel they were created on, or until the
- client cancels them.
- </doc>
- <doc name = "rule">
- The server SHOULD support at least 16 consumers per queue, unless
- the queue was declared as private, and ideally, impose no limit
- except as defined by available resources.
- </doc>
- <doc name = "rule">
- Streaming applications SHOULD use different channels to select
- different streaming resolutions. AMQP makes no provision for
- filtering and/or transforming streams except on the basis of
- priority-based selective delivery of individual messages.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "read" access
- rights to the realm for the queue.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name
- is null, refers to the current queue for the channel, which is the
- last declared queue.
- </doc>
- <doc name = "rule">
- If the client did not previously declare a queue, and the queue name
- in this method is empty, the server MUST raise a connection exception
- with reply code 530 (not allowed).
- </doc>
- </field>
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is
- local to a connection, so two clients can use the same consumer
- tags. If this field is empty the server will generate a unique
- tag.
- </doc>
- <doc name = "rule" test = "todo">
- The tag MUST NOT refer to an existing consumer. If the client
- attempts to create two consumers with the same non-empty tag
- the server MUST raise a connection exception with reply code
- 530 (not allowed).
- </doc>
- </field>
-
- <field name = "no local" domain = "no local" />
-
- <field name = "exclusive" type = "bit">
- request exclusive access
- <doc>
- Request exclusive consumer access, meaning only this consumer can
- access the queue.
- </doc>
- <doc name = "rule" test = "amq_file_00">
- If the server cannot grant exclusive access to the queue when asked,
- - because there are other consumers active - it MUST raise a channel
- exception with return code 405 (resource locked).
- </doc>
- </field>
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-
-<method name = "consume-ok" synchronous = "1" index = "21">
- confirm a new consumer
- <doc>
- This method provides the client with a consumer tag which it may
- use in methods that work with the consumer.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag">
- <doc>
- Holds the consumer tag specified by the client or provided by
- the server.
- </doc>
- </field>
-</method>
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "cancel" synchronous = "1" index = "30">
- end a queue consumer
- <doc>
- This method cancels a consumer. Since message delivery is
- asynchronous the client may continue to receive messages for
- a short while after canceling a consumer. It may process or
- discard these as appropriate.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "nowait" type = "bit">
- do not send a reply method
- <doc>
- If set, the server will not respond to the method. The client should
- not wait for a reply method. If the server could not complete the
- method it will raise a channel or connection exception.
- </doc>
- </field>
-</method>
-
-<method name = "cancel-ok" synchronous = "1" index = "31">
- confirm a cancelled consumer
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "publish" content = "1" index = "40">
- publish a message
- <doc>
- This method publishes a message to a specific exchange. The message
- will be routed to queues as defined by the exchange configuration
- and distributed to any active consumers as appropriate.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access ticket">
- <doc name = "rule">
- The client MUST provide a valid access ticket giving "write"
- access rights to the access realm for the exchange.
- </doc>
- </field>
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange
- name can be empty, meaning the default exchange. If the exchange
- name is specified, and that exchange does not exist, the server
- will raise a channel exception.
- </doc>
- <doc name = "rule">
- The server MUST accept a blank exchange name to mean the default
- exchange.
- </doc>
- <doc name = "rule">
- If the exchange was declared as an internal exchange, the server
- MUST respond with a reply code 403 (access refused) and raise a
- channel exception.
- </doc>
- <doc name = "rule">
- The exchange MAY refuse stream content in which case it MUST
- respond with a reply code 540 (not implemented) and raise a
- channel exception.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key for the message. The routing key is
- used for routing messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" type = "bit">
- indicate mandatory routing
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue. If this flag is set, the server will return an
- unroutable message with a Return method. If this flag is zero, the
- server silently drops the message.
- </doc>
- <doc name = "rule" test = "amq_stream_00">
- The server SHOULD implement the mandatory flag.
- </doc>
- </field>
-
- <field name = "immediate" type = "bit">
- request immediate delivery
- <doc>
- This flag tells the server how to react if the message cannot be
- routed to a queue consumer immediately. If this flag is set, the
- server will return an undeliverable message with a Return method.
- If this flag is zero, the server will queue the message, but with
- no guarantee that it will ever be consumed.
- </doc>
- <doc name = "rule" test = "amq_stream_00">
- The server SHOULD implement the immediate flag.
- </doc>
- </field>
-</method>
-
-<method name = "return" content = "1" index = "50">
- return a failed message
- <doc>
- This method returns an undeliverable message that was published
- with the "immediate" flag set, or an unroutable message published
- with the "mandatory" flag set. The reply code and text provide
- information about the reason that the message was undeliverable.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply code" domain = "reply code" />
- <field name = "reply text" domain = "reply text" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was
- originally published to.
- </doc>
- </field>
-
- <field name = "routing key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key name specified when the message was
- published.
- </doc>
- </field>
-</method>
-
-
-<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
-<method name = "deliver" content = "1" index = "60">
- notify the client of a consumer message
- <doc>
- This method delivers a message to the client, via a consumer. In
- the asynchronous message delivery model, the client starts a
- consumer using the Consume method, then the server responds with
- Deliver methods as and when messages arrive for that consumer.
- </doc>
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer tag" domain = "consumer tag" />
-
- <field name = "delivery tag" domain = "delivery tag" />
-
- <field name = "exchange" domain = "exchange name">
- <doc>
- Specifies the name of the exchange that the message was originally
- published to.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue name">
- <doc>
- Specifies the name of the queue that the message came from. Note
- that a single channel can start many consumers on different
- queues.
- </doc>
- <assert check = "notnull" />
- </field>
-</method>
- </class>
-
- <class name="tx" handler="channel" index="90">
- <!--
-======================================================
-== TRANSACTIONS
-======================================================
--->
- work with standard transactions
-
-<doc>
- Standard transactions provide so-called "1.5 phase commit". We can
- ensure that work is never lost, but there is a chance of confirmations
- being lost, so that messages may be resent. Applications that use
- standard transactions must be able to detect and ignore duplicate
- messages.
-</doc>
- <rule implement="SHOULD">
- An client using standard transactions SHOULD be able to track all
- messages received within a reasonable period, and thus detect and
- reject duplicates of the same message. It SHOULD NOT pass these to
- the application layer.
-</rule>
- <doc name="grammar">
- tx = C:SELECT S:SELECT-OK
- / C:COMMIT S:COMMIT-OK
- / C:ROLLBACK S:ROLLBACK-OK
-</doc>
- <chassis name="server" implement="SHOULD"/>
- <chassis name="client" implement="MAY"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="select" synchronous="1" index="10">
-select standard transaction mode
- <doc>
- This method sets the channel to use standard transactions. The
- client must use this method at least once on a channel before
- using the Commit or Rollback methods.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="select-ok"/>
- </method>
- <method name="select-ok" synchronous="1" index="11">
-confirm transaction mode
- <doc>
- This method confirms to the client that the channel was successfully
- set to use standard transactions.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="commit" synchronous="1" index="20">
-commit the current transaction
- <doc>
- This method commits all messages published and acknowledged in
- the current transaction. A new transaction starts immediately
- after a commit.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="commit-ok"/>
- </method>
- <method name="commit-ok" synchronous="1" index="21">
-confirm a successful commit
- <doc>
- This method confirms to the client that the commit succeeded.
- Note that if a commit fails, the server raises a channel exception.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="rollback" synchronous="1" index="30">
-abandon the current transaction
- <doc>
- This method abandons all messages published and acknowledged in
- the current transaction. A new transaction starts immediately
- after a rollback.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="rollback-ok"/>
- </method>
- <method name="rollback-ok" synchronous="1" index="31">
-confirm a successful rollback
- <doc>
- This method confirms to the client that the rollback succeeded.
- Note that if an rollback fails, the server raises a channel exception.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- </class>
- <class name="dtx" handler="channel" index="100">
- <!--
-======================================================
-== DISTRIBUTED TRANSACTIONS
-======================================================
--->
- work with distributed transactions
-
-<doc>
- Distributed transactions provide so-called "2-phase commit". The
- AMQP distributed transaction model supports the X-Open XA
- architecture and other distributed transaction implementations.
- The Dtx class assumes that the server has a private communications
- channel (not AMQP) to a distributed transaction coordinator.
-</doc>
- <doc name="grammar">
- dtx = C:SELECT S:SELECT-OK
- C:START S:START-OK
-</doc>
- <chassis name="server" implement="MAY"/>
- <chassis name="client" implement="MAY"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="select" synchronous="1" index="10">
-select standard transaction mode
- <doc>
- This method sets the channel to use distributed transactions. The
- client must use this method at least once on a channel before
- using the Start method.
- </doc>
- <chassis name="server" implement="MUST"/>
- <response name="select-ok"/>
- </method>
- <method name="select-ok" synchronous="1" index="11">
-confirm transaction mode
- <doc>
- This method confirms to the client that the channel was successfully
- set to use distributed transactions.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="start" synchronous="1" index="20">
- start a new distributed transaction
- <doc>
- This method starts a new distributed transaction. This must be
- the first method on a new channel that uses the distributed
- transaction mode, before any methods that publish or consume
- messages.
- </doc>
- <chassis name="server" implement="MAY"/>
- <response name="start-ok"/>
- <field name="dtx identifier" type="shortstr">
- transaction identifier
- <doc>
- The distributed transaction key. This identifies the transaction
- so that the AMQP server can coordinate with the distributed
- transaction coordinator.
- </doc>
- <assert check="notnull"/>
- </field>
- </method>
- <method name="start-ok" synchronous="1" index="21">
- confirm the start of a new distributed transaction
- <doc>
- This method confirms to the client that the transaction started.
- Note that if a start fails, the server raises a channel exception.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
- </class>
- <class name="tunnel" handler="tunnel" index="110">
- <!--
-======================================================
-== TUNNEL
-======================================================
--->
- methods for protocol tunneling.
-
-<doc>
- The tunnel methods are used to send blocks of binary data - which
- can be serialised AMQP methods or other protocol frames - between
- AMQP peers.
-</doc>
- <doc name="grammar">
- tunnel = C:REQUEST
- / S:REQUEST
-</doc>
- <chassis name="server" implement="MAY"/>
- <chassis name="client" implement="MAY"/>
- <field name="headers" type="table">
- Message header field table
-</field>
- <field name="proxy name" type="shortstr">
- The identity of the tunnelling proxy
-</field>
- <field name="data name" type="shortstr">
- The name or type of the message being tunnelled
-</field>
- <field name="durable" type="octet">
- The message durability indicator
-</field>
- <field name="broadcast" type="octet">
- The message broadcast mode
-</field>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="request" content="1" index="10">
- sends a tunnelled method
- <doc>
- This method tunnels a block of binary data, which can be an
- encoded AMQP method or other data. The binary data is sent
- as the content for the Tunnel.Request method.
- </doc>
- <chassis name="server" implement="MUST"/>
- <field name="meta data" type="table">
- meta data for the tunnelled block
- <doc>
- This field table holds arbitrary meta-data that the sender needs
- to pass to the recipient.
- </doc>
- </field>
- </method>
- </class>
- <class name="test" handler="channel" index="120">
- <!--
-======================================================
-== TEST - CHECK FUNCTIONAL CAPABILITIES OF AN IMPLEMENTATION
-======================================================
--->
- test functional primitives of the implementation
-
-<doc>
- The test class provides methods for a peer to test the basic
- operational correctness of another peer. The test methods are
- intended to ensure that all peers respect at least the basic
- elements of the protocol, such as frame and content organisation
- and field types. We assume that a specially-designed peer, a
- "monitor client" would perform such tests.
-</doc>
- <doc name="grammar">
- test = C:INTEGER S:INTEGER-OK
- / S:INTEGER C:INTEGER-OK
- / C:STRING S:STRING-OK
- / S:STRING C:STRING-OK
- / C:TABLE S:TABLE-OK
- / S:TABLE C:TABLE-OK
- / C:CONTENT S:CONTENT-OK
- / S:CONTENT C:CONTENT-OK
-</doc>
- <chassis name="server" implement="MUST"/>
- <chassis name="client" implement="SHOULD"/>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="integer" synchronous="1" index="10">
- test integer handling
- <doc>
- This method tests the peer's capability to correctly marshal integer
- data.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="integer-ok"/>
- <field name="integer 1" type="octet">
- octet test value
- <doc>
- An octet integer test value.
- </doc>
- </field>
- <field name="integer 2" type="short">
- short test value
- <doc>
- A short integer test value.
- </doc>
- </field>
- <field name="integer 3" type="long">
- long test value
- <doc>
- A long integer test value.
- </doc>
- </field>
- <field name="integer 4" type="longlong">
- long-long test value
- <doc>
- A long long integer test value.
- </doc>
- </field>
- <field name="operation" type="octet">
- operation to test
- <doc>
- The client must execute this operation on the provided integer
- test fields and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return sum of test values</value>
- <value name="min">return lowest of test values</value>
- <value name="max">return highest of test values</value>
- </assert>
- </field>
- </method>
- <method name="integer-ok" synchronous="1" index="11">
- report integer test result
- <doc>
- This method reports the result of an Integer method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="result" type="longlong">
- result value
- <doc>
- The result of the tested operation.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="string" synchronous="1" index="20">
- test string handling
- <doc>
- This method tests the peer's capability to correctly marshal string
- data.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="string-ok"/>
- <field name="string 1" type="shortstr">
- short string test value
- <doc>
- An short string test value.
- </doc>
- </field>
- <field name="string 2" type="longstr">
- long string test value
- <doc>
- A long string test value.
- </doc>
- </field>
- <field name="operation" type="octet">
- operation to test
- <doc>
- The client must execute this operation on the provided string
- test fields and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return concatentation of test strings</value>
- <value name="min">return shortest of test strings</value>
- <value name="max">return longest of test strings</value>
- </assert>
- </field>
- </method>
- <method name="string-ok" synchronous="1" index="21">
- report string test result
- <doc>
- This method reports the result of a String method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="result" type="longstr">
- result value
- <doc>
- The result of the tested operation.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="table" synchronous="1" index="30">
- test field table handling
- <doc>
- This method tests the peer's capability to correctly marshal field
- table data.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="table-ok"/>
- <field name="table" type="table">
- field table of test values
- <doc>
- A field table of test values.
- </doc>
- </field>
- <field name="integer op" type="octet">
- operation to test on integers
- <doc>
- The client must execute this operation on the provided field
- table integer values and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return sum of numeric field values</value>
- <value name="min">return min of numeric field values</value>
- <value name="max">return max of numeric field values</value>
- </assert>
- </field>
- <field name="string op" type="octet">
- operation to test on strings
- <doc>
- The client must execute this operation on the provided field
- table string values and return the result.
- </doc>
- <assert check="enum">
- <value name="add">return concatenation of string field values</value>
- <value name="min">return shortest of string field values</value>
- <value name="max">return longest of string field values</value>
- </assert>
- </field>
- </method>
- <method name="table-ok" synchronous="1" index="31">
- report table test result
- <doc>
- This method reports the result of a Table method.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="integer result" type="longlong">
- integer result value
- <doc>
- The result of the tested integer operation.
- </doc>
- </field>
- <field name="string result" type="longstr">
- string result value
- <doc>
- The result of the tested string operation.
- </doc>
- </field>
- </method>
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <method name="content" synchronous="1" content="1" index="40">
- test content handling
- <doc>
- This method tests the peer's capability to correctly marshal content.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <response name="content-ok"/>
- </method>
- <method name="content-ok" synchronous="1" content="1" index="41">
- report content test result
- <doc>
- This method reports the result of a Content method. It contains the
- content checksum and echoes the original content as provided.
- </doc>
- <chassis name="client" implement="MUST"/>
- <chassis name="server" implement="MUST"/>
- <field name="content checksum" type="long">
- content hash
- <doc>
- The 32-bit checksum of the content, calculated by adding the
- content into a 32-bit accumulator.
- </doc>
- </field>
- </method>
- </class>
-</amqp>
diff --git a/M4-RCs/qpid/specs/amqp.0-9.xml b/M4-RCs/qpid/specs/amqp.0-9.xml
deleted file mode 100644
index 1615fea99d..0000000000
--- a/M4-RCs/qpid/specs/amqp.0-9.xml
+++ /dev/null
@@ -1,5249 +0,0 @@
-<?xml version = "1.0"?>
-
-<!--
- EDITORS: (PH) Pieter Hintjens <ph@imatix.com>
- (KvdR) Kim van der Riet <kim.vdriet@redhat.com>
-
- These editors have been assigned by the AMQP working group.
- Please do not edit/commit this file without consulting with
- one of the above editors.
- ========================================================
-
- TODOs
- - see TODO comments in the text
--->
-
-<!--
- Copyright Notice
- ================
- (c) Copyright JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc.,
- iMatix Corporation, IONA\ufffd Technologies, Red Hat, Inc.,
- TWIST Process Innovations, and 29West Inc. 2006. All rights reserved.
-
- License
- =======
- JPMorgan Chase Bank & Co., Cisco Systems, Inc., Envoy Technologies Inc., iMatix
- Corporation, IONA Technologies, Red Hat, Inc., TWIST Process Innovations, and
- 29West Inc. (collectively, the "Authors") each hereby grants to you a worldwide,
- perpetual, royalty-free, nontransferable, nonexclusive license to
- (i) copy, display, distribute and implement the Advanced Messaging Queue Protocol
- ("AMQP") Specification and (ii) the Licensed Claims that are held by
- the Authors, all for the purpose of implementing the Advanced Messaging
- Queue Protocol Specification. Your license and any rights under this
- Agreement will terminate immediately without notice from
- any Author if you bring any claim, suit, demand, or action related to
- the Advanced Messaging Queue Protocol Specification against any Author.
- Upon termination, you shall destroy all copies of the Advanced Messaging
- Queue Protocol Specification in your possession or control.
-
- As used hereunder, "Licensed Claims" means those claims of a patent or
- patent application, throughout the world, excluding design patents and
- design registrations, owned or controlled, or that can be sublicensed
- without fee and in compliance with the requirements of this
- Agreement, by an Author or its affiliates now or at any
- future time and which would necessarily be infringed by implementation
- of the Advanced Messaging Queue Protocol Specification. A claim is
- necessarily infringed hereunder only when it is not possible to avoid
- infringing it because there is no plausible non-infringing alternative
- for implementing the required portions of the Advanced Messaging Queue
- Protocol Specification. Notwithstanding the foregoing, Licensed Claims
- shall not include any claims other than as set forth above even if
- contained in the same patent as Licensed Claims; or that read solely
- on any implementations of any portion of the Advanced Messaging Queue
- Protocol Specification that are not required by the Advanced Messaging
- Queue Protocol Specification, or that, if licensed, would require a
- payment of royalties by the licensor to unaffiliated third parties.
- Moreover, Licensed Claims shall not include (i) any enabling technologies
- that may be necessary to make or use any Licensed Product but are not
- themselves expressly set forth in the Advanced Messaging Queue Protocol
- Specification (e.g., semiconductor manufacturing technology, compiler
- technology, object oriented technology, networking technology, operating
- system technology, and the like); or (ii) the implementation of other
- published standards developed elsewhere and merely referred to in the
- body of the Advanced Messaging Queue Protocol Specification, or
- (iii) any Licensed Product and any combinations thereof the purpose or
- function of which is not required for compliance with the Advanced
- Messaging Queue Protocol Specification. For purposes of this definition,
- the Advanced Messaging Queue Protocol Specification shall be deemed to
- include both architectural and interconnection requirements essential
- for interoperability and may also include supporting source code artifacts
- where such architectural, interconnection requirements and source code
- artifacts are expressly identified as being required or documentation to
- achieve compliance with the Advanced Messaging Queue Protocol Specification.
-
- As used hereunder, "Licensed Products" means only those specific portions
- of products (hardware, software or combinations thereof) that implement
- and are compliant with all relevant portions of the Advanced Messaging
- Queue Protocol Specification.
-
- The following disclaimers, which you hereby also acknowledge as to any
- use you may make of the Advanced Messaging Queue Protocol Specification:
-
- THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION IS PROVIDED "AS IS,"
- AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
- IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE
- CONTENTS OF THE ADVANCED MESSAGING QUEUE PROTOCOL SPECIFICATION ARE
- SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF THE ADVANCED
- MESSAGING QUEUE PROTOCOL SPECIFICATION WILL NOT INFRINGE ANY THIRD PARTY
- PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
- THE AUTHORS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL,
- INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO ANY
- USE, IMPLEMENTATION OR DISTRIBUTION OF THE ADVANCED MESSAGING QUEUE
- PROTOCOL SPECIFICATION.
-
- The name and trademarks of the Authors may NOT be used in any manner,
- including advertising or publicity pertaining to the Advanced Messaging
- Queue Protocol Specification or its contents without specific, written
- prior permission. Title to copyright in the Advanced Messaging Queue
- Protocol Specification will at all times remain with the Authors.
-
- No other rights are granted by implication, estoppel or otherwise.
-
- Upon termination of your license or rights under this Agreement, you
- shall destroy all copies of the Advanced Messaging Queue Protocol
- Specification in your possession or control.
-
- Trademarks
- ==========
- "JPMorgan", "JPMorgan Chase", "Chase", the JPMorgan Chase logo and the
- Octagon Symbol are trademarks of JPMorgan Chase & Co.
-
- IMATIX and the iMatix logo are trademarks of iMatix Corporation sprl.
-
- IONA, IONA Technologies, and the IONA logos are trademarks of IONA
- Technologies PLC and/or its subsidiaries.
-
- LINUX is a trademark of Linus Torvalds. RED HAT and JBOSS are registered
- trademarks of Red Hat, Inc. in the US and other countries.
-
- Java, all Java-based trademarks and OpenOffice.org are trademarks of
- Sun Microsystems, Inc. in the United States, other countries, or both.
-
- Other company, product, or service names may be trademarks or service
- marks of others.
-
- Links to full AMQP specification:
- =================================
- http://www.envoytech.org/spec/amq/
- http://www.iona.com/opensource/amqp/
- http://www.redhat.com/solutions/specifications/amqp/
- http://www.twiststandards.org/tiki-index.php?page=AMQ
- http://www.imatix.com/amqp
--->
-
-<!--
- <!DOCTYPE amqp SYSTEM "amqp.dtd">
--->
-
-<!-- XML Notes
-
- We use entities to indicate repetition; attributes to indicate properties.
-
- We use the 'name' attribute as an identifier, usually within the context
- of the surrounding entities.
-
- We use spaces to seperate words in names, so that we can print names in
- their natural form depending on the context - underlines for source code,
- hyphens for written text, etc.
-
- We do not enforce any particular validation mechanism but we support all
- mechanisms. The protocol definition conforms to a formal grammar that is
- published seperately in several technologies.
-
- -->
-
-<amqp major = "0" minor = "9" port = "5672" comment = "AMQ Protocol version 0-9">
- <!--
- ======================================================
- == CONSTANTS
- ======================================================
- -->
- <!-- Frame types -->
- <constant name = "frame-method" value = "1" />
- <constant name = "frame-header" value = "2" />
- <constant name = "frame-body" value = "3" />
- <constant name = "frame-oob-method" value = "4" />
- <constant name = "frame-oob-header" value = "5" />
- <constant name = "frame-oob-body" value = "6" />
- <constant name = "frame-trace" value = "7" />
- <constant name = "frame-heartbeat" value = "8" />
-
- <!-- Protocol constants -->
- <constant name = "frame-min-size" value = "4096" />
- <constant name = "frame-end" value = "206" />
-
- <!-- Reply codes -->
- <constant name = "reply-success" value = "200">
- <doc>
- Indicates that the method completed successfully. This reply code is
- reserved for future use - the current protocol design does not use positive
- confirmation and reply codes are sent only in case of an error.
- </doc>
- </constant>
-
- <constant name = "not-delivered" value = "310" class = "soft-error">
- <doc>
- The client asked for a specific message that is no longer available.
- The message was delivered to another client, or was purged from the queue
- for some other reason.
- </doc>
- </constant>
-
- <constant name = "content-too-large" value = "311" class = "soft-error">
- <doc>
- The client attempted to transfer content larger than the server could accept
- at the present time. The client may retry at a later time.
- </doc>
- </constant>
-
- <constant name = "no-route" value = "312" class = "soft-error">
- <doc>
- When the exchange cannot route the result of a .Publish, most likely due
- to an invalid routing key. Only when the mandatory flag is set.
- </doc>
- </constant>
-
- <constant name = "no-consumers" value = "313" class = "soft-error">
- <doc>
- When the exchange cannot deliver to a consumer when the immediate flag is
- set. As a result of pending data on the queue or the absence of any
- consumers of the queue.
- </doc>
- </constant>
-
- <constant name = "connection-forced" value = "320" class = "hard-error">
- <doc>
- An operator intervened to close the connection for some reason. The client
- may retry at some later date.
- </doc>
- </constant>
-
- <constant name = "invalid-path" value = "402" class = "hard-error">
- <doc>
- The client tried to work with an unknown virtual host.
- </doc>
- </constant>
-
- <constant name = "access-refused" value = "403" class = "soft-error">
- <doc>
- The client attempted to work with a server entity to which it has no
- access due to security settings.
- </doc>
- </constant>
-
- <constant name = "not-found" value = "404" class = "soft-error">
- <doc>The client attempted to work with a server entity that does not exist.</doc>
- </constant>
-
- <constant name = "resource-locked" value = "405" class = "soft-error">
- <doc>
- The client attempted to work with a server entity to which it has no
- access because another client is working with it.
- </doc>
- </constant>
-
- <constant name = "precondition-failed" value = "406" class = "soft-error">
- <doc>
- The client requested a method that was not allowed because some precondition
- failed.
- </doc>
- </constant>
-
- <constant name = "frame-error" value = "501" class = "hard-error">
- <doc>
- The client sent a malformed frame that the server could not decode. This
- strongly implies a programming error in the client.
- </doc>
- </constant>
-
- <constant name = "syntax-error" value = "502" class = "hard-error">
- <doc>
- The client sent a frame that contained illegal values for one or more
- fields. This strongly implies a programming error in the client.
- </doc>
- </constant>
-
- <constant name = "command-invalid" value = "503" class = "hard-error">
- <doc>
- The client sent an invalid sequence of frames, attempting to perform an
- operation that was considered invalid by the server. This usually implies
- a programming error in the client.
- </doc>
- </constant>
-
- <constant name = "channel-error" value = "504" class = "hard-error">
- <doc>
- The client attempted to work with a channel that had not been correctly
- opened. This most likely indicates a fault in the client layer.
- </doc>
- </constant>
-
- <constant name = "resource-error" value = "506" class = "hard-error">
- <doc>
- The server could not complete the method because it lacked sufficient
- resources. This may be due to the client creating too many of some type
- of entity.
- </doc>
- </constant>
-
- <constant name = "not-allowed" value = "530" class = "hard-error">
- <doc>
- The client tried to work with some entity in a manner that is prohibited
- by the server, due to security settings or by some other criteria.
- </doc>
- </constant>
-
- <constant name = "not-implemented" value = "540" class = "hard-error">
- <doc>
- The client tried to use functionality that is not implemented in the
- server.
- </doc>
- </constant>
-
- <constant name = "internal-error" value = "541" class = "hard-error">
- <doc>
- The server could not complete the method because of an internal error.
- The server may require intervention by an operator in order to resume
- normal operations.
- </doc>
- </constant>
-
- <!--
- ======================================================
- == DOMAIN TYPES
- ======================================================
- -->
-
- <domain name = "access-ticket" type = "short" label = "access ticket granted by server">
- <doc>
- An access ticket granted by the server for a certain set of access rights
- within a specific realm. Access tickets are valid within the channel where
- they were created, and expire when the channel closes.
- </doc>
- <assert check = "ne" value = "0" />
- </domain>
-
- <domain name = "class-id" type = "short" />
-
- <domain name = "consumer-tag" type = "shortstr" label = "consumer tag">
- <doc>
- Identifier for the consumer, valid within the current connection.
- </doc>
- </domain>
-
- <domain name = "delivery-tag" type = "longlong" label = "server-assigned delivery tag">
- <doc>
- The server-assigned and channel-specific delivery tag
- </doc>
- <rule name = "channel-local">
- <doc>
- The delivery tag is valid only within the channel from which the message was
- received. I.e. a client MUST NOT receive a message on one channel and then
- acknowledge it on another.
- </doc>
- </rule>
- <rule name = "non-zero">
- <doc>
- The server MUST NOT use a zero value for delivery tags. Zero is reserved
- for client use, meaning "all messages so far received".
- </doc>
- </rule>
- </domain>
-
- <domain name = "exchange-name" type = "shortstr" label = "exchange name">
- <doc>
- The exchange name is a client-selected string that identifies the exchange for publish
- methods. Exchange names may consist of any mixture of digits, letters, and underscores.
- Exchange names are scoped by the virtual host.
- </doc>
- <assert check = "length" value = "127" />
- </domain>
-
- <domain name = "known-hosts" type = "shortstr" label = "list of known hosts">
- <doc>
- Specifies the list of equivalent or alternative hosts that the server knows about,
- which will normally include the current server itself. Clients can cache this
- information and use it when reconnecting to a server after a failure. This field
- may be empty.
- </doc>
- </domain>
-
- <domain name = "method-id" type = "short" />
-
- <domain name = "no-ack" type = "bit" label = "no acknowledgement needed">
- <doc>
- If this field is set the server does not expect acknowledgements for
- messages. That is, when a message is delivered to the client the server
- automatically and silently acknowledges it on behalf of the client. This
- functionality increases performance but at the cost of reliability.
- Messages can get lost if a client dies before it can deliver them to the
- application.
- </doc>
- </domain>
-
- <domain name = "no-local" type = "bit" label = "do not deliver own messages">
- <doc>
- If the no-local field is set the server will not send messages to the connection that
- published them.
- </doc>
- </domain>
-
- <domain name = "path" type = "shortstr">
- <doc>
- Must start with a slash "/" and continue with path names separated by slashes. A path
- name consists of any combination of at least one of [A-Za-z0-9] plus zero or more of
- [.-_+!=:].
- </doc>
-
- <assert check = "notnull" />
- <assert check = "syntax" rule = "path" />
- <assert check = "length" value = "127" />
- </domain>
-
- <domain name = "peer-properties" type = "table">
- <doc>
- This string provides a set of peer properties, used for identification, debugging, and
- general information.
- </doc>
- </domain>
-
- <domain name = "queue-name" type = "shortstr" label = "queue name">
- <doc>
- The queue name identifies the queue within the vhost. Queue names may consist of any
- mixture of digits, letters, and underscores.
- </doc>
- <assert check = "length" value = "127" />
- </domain>
-
- <domain name = "redelivered" type = "bit" label = "message is being redelivered">
- <doc>
- This indicates that the message has been previously delivered to this or
- another client.
- </doc>
- <rule name = "implementation">
- <doc>
- The server SHOULD try to signal redelivered messages when it can. When
- redelivering a message that was not successfully acknowledged, the server
- SHOULD deliver it to the original client if possible.
- </doc>
- <doc type = "scenario">
- Create a shared queue and publish a message to the queue. Consume the
- message using explicit acknowledgements, but do not acknowledge the
- message. Close the connection, reconnect, and consume from the queue
- again. The message should arrive with the redelivered flag set.
- </doc>
- </rule>
- <rule name = "hinting">
- <doc>
- The client MUST NOT rely on the redelivered field but should take it as a
- hint that the message may already have been processed. A fully robust
- client must be able to track duplicate received messages on non-transacted,
- and locally-transacted channels.
- </doc>
- </rule>
- </domain>
-
- <domain name = "reply-code" type = "short" label = "reply code from server">
- <doc>
- The reply code. The AMQ reply codes are defined as constants at the start
- of this formal specification.
- </doc>
- <assert check = "notnull" />
- </domain>
-
- <domain name = "reply-text" type = "shortstr" label = "localised reply text">
- <doc>
- The localised reply text. This text can be logged as an aid to resolving
- issues.
- </doc>
- <assert check = "notnull" />
- </domain>
-
- <domain name = "channel-id" type = "longstr" label = "unique identifier for a channel" />
-
- <!-- Domains for the message class -->
- <domain name = "duration" type = "longlong" label = "duration in milliseconds" />
- <domain name = "offset" type = "longlong" label = "offset into a message body" />
- <domain name = "reference" type = "longstr" label = "pointer to a message body" />
- <domain name = "destination" type = "shortstr" label = "destination for a message">
- <doc>
- Specifies the destination to which the message is to be
- transferred. The destination can be empty, meaning the
- default exchange or consumer.
- </doc>
- </domain>
- <domain name = "reject-code" type = "short" label = "reject code for transfer">
- <rule name = "01">
- <doc>
- The reject code must be one of 0 (generic) or 1 (immediate
- delivery was attempted but failed).
- </doc>
- </rule>
- </domain>
- <domain name = "reject-text" type = "shortstr" label = "informational text for message reject"/>
- <domain name = "security-token" type = "longstr" label = "security token">
- <doc>
- Used for authentication, replay prevention, and encrypted bodies.
- </doc>
- </domain>
-
- <!-- Elementary domains -->
- <domain name = "bit" type = "bit" label = "single bit" />
- <domain name = "octet" type = "octet" label = "single octet" />
- <domain name = "short" type = "short" label = "16-bit integer" />
- <domain name = "long" type = "long" label = "32-bit integer" />
- <domain name = "longlong" type = "longlong" label = "64-bit integer" />
- <domain name = "shortstr" type = "shortstr" label = "short string" />
- <domain name = "longstr" type = "longstr" label = "long string" />
- <domain name = "timestamp" type = "timestamp" label = "64-bit timestamp" />
- <domain name = "table" type = "table" label = "field table" />
-
- <!-- == CONNECTION ======================================================= -->
-
- <!-- TODO 0.81 - the 'handler' attribute of methods needs to be reviewed, and if
- no current implementations use it, removed. /PH 2006/07/20
- -->
-
- <class name = "connection" handler = "connection" index = "10" label = "work with socket connections">
- <doc>
- The connection class provides methods for a client to establish a network connection to
- a server, and for both peers to operate the connection thereafter.
- </doc>
-
- <doc type = "grammar">
- connection = open-connection *use-connection close-connection
- open-connection = C:protocol-header
- S:START C:START-OK
- *challenge
- S:TUNE C:TUNE-OK
- C:OPEN S:OPEN-OK | S:REDIRECT
- challenge = S:SECURE C:SECURE-OK
- use-connection = *channel
- close-connection = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "start" synchronous = "1" index = "10" label = "start connection negotiation">
- <doc>
- This method starts the connection negotiation process by telling the client the
- protocol version that the server proposes, along with a list of security mechanisms
- which the client can use for authentication.
- </doc>
-
- <rule name = "protocol-name">
- <doc>
- If the server cannot support the protocol specified in the protocol header,
- it MUST close the socket connection without sending any response method.
- </doc>
- <doc type = "scenario">
- The client sends a protocol header containing an invalid protocol name.
- The server must respond by closing the connection.
- </doc>
- </rule>
- <rule name = "server-support">
- <doc>
- The server MUST provide a protocol version that is lower than or equal to
- that requested by the client in the protocol header.
- </doc>
- <doc type = "scenario">
- The client requests a protocol version that is higher than any valid
- implementation, e.g. 9.0. The server must respond with a current
- protocol version, e.g. 1.0.
- </doc>
- </rule>
- <rule name = "client-support">
- <doc>
- If the client cannot handle the protocol version suggested by the server
- it MUST close the socket connection.
- </doc>
- <doc type = "scenario">
- The server sends a protocol version that is lower than any valid
- implementation, e.g. 0.1. The client must respond by closing the
- connection.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
- <response name = "start-ok" />
-
- <field name = "version-major" domain = "octet" label = "protocol major version">
- <doc>
- The protocol version, major component, as transmitted in the AMQP protocol
- header. This, combined with the protocol minor component fully describe the
- protocol version, which is written in the format major-minor. Hence, with
- major=1, minor=3, the protocol version would be "1-3".
- </doc>
- </field>
-
- <field name = "version-minor" domain = "octet" label = "protocol minor version">
- <doc>
- The protocol version, minor component, as transmitted in the AMQP protocol
- header. This, combined with the protocol major component fully describe the
- protocol version, which is written in the format major-minor. Hence, with
- major=1, minor=3, the protocol version would be "1-3".
- </doc>
- </field>
-
- <field name = "server-properties" domain = "peer-properties" label = "server properties">
- <rule name = "required-fields">
- <doc>
- The properties SHOULD contain at least these fields: "host", specifying the
- server host name or address, "product", giving the name of the server product,
- "version", giving the name of the server version, "platform", giving the name
- of the operating system, "copyright", if appropriate, and "information", giving
- other general information.
- </doc>
- <doc type = "scenario">
- Client connects to server and inspects the server properties. It checks for
- the presence of the required fields.
- </doc>
- </rule>
- </field>
-
- <field name = "mechanisms" domain = "longstr" label = "available security mechanisms">
- <doc>
- A list of the security mechanisms that the server supports, delimited by spaces.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "locales" domain = "longstr" label = "available message locales">
- <doc>
- A list of the message locales that the server supports, delimited by spaces. The
- locale defines the language in which the server will send reply texts.
- </doc>
- <rule name = "required-support">
- <doc>
- The server MUST support at least the en_US locale.
- </doc>
- <doc type = "scenario">
- Client connects to server and inspects the locales field. It checks for
- the presence of the required locale(s).
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
- </method>
-
- <method name = "start-ok" synchronous = "1" index = "11"
- label = "select security mechanism and locale">
- <doc>
- This method selects a SASL security mechanism.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "client-properties" domain = "peer-properties" label = "client properties">
- <rule name = "required-fields">
- <!-- This rule is not testable from the client side -->
- <doc>
- The properties SHOULD contain at least these fields: "product", giving the name
- of the client product, "version", giving the name of the client version, "platform",
- giving the name of the operating system, "copyright", if appropriate, and
- "information", giving other general information.
- </doc>
- </rule>
- </field>
-
- <field name = "mechanism" domain = "shortstr" label = "selected security mechanism">
- <doc>
- A single security mechanisms selected by the client, which must be one of those
- specified by the server.
- </doc>
- <rule name = "security">
- <doc>
- The client SHOULD authenticate using the highest-level security profile it
- can handle from the list provided by the server.
- </doc>
- </rule>
- <rule name = "validity">
- <doc>
- If the mechanism field does not contain one of the security mechanisms
- proposed by the server in the Start method, the server MUST close the
- connection without sending any further data.
- </doc>
- <doc type = "scenario">
- Client connects to server and sends an invalid security mechanism. The
- server must respond by closing the connection (a socket close, with no
- connection close negotiation).
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
-
- <field name = "response" domain = "longstr" label = "security response data">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this
- data are defined by the SASL security mechanism.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "locale" domain = "shortstr" label = "selected message locale">
- <doc>
- A single message locale selected by the client, which must be one of those
- specified by the server.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "secure" synchronous = "1" index = "20" label = "security mechanism challenge">
- <doc>
- The SASL protocol works by exchanging challenges and responses until both peers have
- received sufficient information to authenticate each other. This method challenges
- the client to provide more information.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
- <response name = "secure-ok" />
-
- <field name = "challenge" domain = "longstr" label = "security challenge data">
- <doc>
- Challenge information, a block of opaque binary data passed to the security
- mechanism.
- </doc>
- </field>
- </method>
-
- <method name = "secure-ok" synchronous = "1" index = "21" label = "security mechanism response">
- <doc>
- This method attempts to authenticate, passing a block of SASL data for the security
- mechanism at the server side.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "response" domain = "longstr" label = "security response data">
- <doc>
- A block of opaque data passed to the security mechanism. The contents of this
- data are defined by the SASL security mechanism.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "tune" synchronous = "1" index = "30"
- label = "propose connection tuning parameters">
- <doc>
- This method proposes a set of connection configuration values to the client. The
- client can accept and/or adjust these.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <response name = "tune-ok" />
-
- <field name = "channel-max" domain = "short" label = "proposed maximum channels">
- <doc>
- The maximum total number of channels that the server allows per connection. Zero
- means that the server does not impose a fixed limit, but the number of allowed
- channels may be limited by available server resources.
- </doc>
- </field>
-
- <field name = "frame-max" domain = "long" label = "proposed maximum frame size">
- <doc>
- The largest frame size that the server proposes for the connection. The client
- can negotiate a lower value. Zero means that the server does not impose any
- specific limit but may reject very large frames if it cannot allocate resources
- for them.
- </doc>
- <rule name = "minimum">
- <doc>
- Until the frame-max has been negotiated, both peers MUST accept frames of up
- to frame-min-size octets large, and the minimum negotiated value for frame-max
- is also frame-min-size.
- </doc>
- <doc type = "scenario">
- Client connects to server and sends a large properties field, creating a frame
- of frame-min-size octets. The server must accept this frame.
- </doc>
- </rule>
- </field>
-
- <field name = "heartbeat" domain = "short" label = "desired heartbeat delay">
- <!-- TODO 0.82 - the heartbeat negotiation mechanism was changed during
- implementation because the model documented here does not actually
- work properly. The best model we found is that the server proposes
- a heartbeat value to the client; the client can reply with zero, meaning
- 'do not use heartbeats (as documented here), or can propose its own
- heartbeat value, which the server should then accept. This is different
- from the model here which is disconnected - e.g. each side requests a
- heartbeat independently. Basically a connection is heartbeated in
- both ways, or not at all, depending on whether both peers support
- heartbeating or not, and the heartbeat value should itself be chosen
- by the client so that remote links can get a higher value. Also, the
- actual heartbeat mechanism needs documentation, and is as follows: so
- long as there is activity on a connection - in or out - both peers
- assume the connection is active. When there is no activity, each peer
- must send heartbeat frames. When no heartbeat frame is received after
- N cycles (where N is at least 2), the connection can be considered to
- have died. /PH 2006/07/19
- -->
- <doc>
- The delay, in seconds, of the connection heartbeat that the server wants.
- Zero means the server does not want a heartbeat.
- </doc>
- </field>
- </method>
-
- <method name = "tune-ok" synchronous = "1" index = "31"
- label = "negotiate connection tuning parameters">
- <doc>
- This method sends the client's connection tuning parameters to the server.
- Certain fields are negotiated, others provide capability information.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "channel-max" domain = "short" label = "negotiated maximum channels">
- <doc>
- The maximum total number of channels that the client will use per connection.
- </doc>
- <rule name = "upper-limit">
- <doc>
- If the client specifies a channel max that is higher than the value provided
- by the server, the server MUST close the connection without attempting a
- negotiated close. The server may report the error in some fashion to assist
- implementors.
- </doc>
- </rule>
- <assert check = "notnull" />
- <assert check = "le" method = "tune" field = "channel-max" />
- </field>
-
- <field name = "frame-max" domain = "long" label = "negotiated maximum frame size">
- <doc>
- The largest frame size that the client and server will use for the connection.
- Zero means that the client does not impose any specific limit but may reject
- very large frames if it cannot allocate resources for them. Note that the
- frame-max limit applies principally to content frames, where large contents can
- be broken into frames of arbitrary size.
- </doc>
- <rule name = "minimum">
- <doc>
- Until the frame-max has been negotiated, both peers MUST accept frames of up
- to frame-min-size octets large, and the minimum negotiated value for frame-max
- is also frame-min-size.
- </doc>
- </rule>
- <rule name = "upper-limit">
- <doc>
- If the client specifies a frame max that is higher than the value provided
- by the server, the server MUST close the connection without attempting a
- negotiated close. The server may report the error in some fashion to assist
- implementors.
- </doc>
- </rule>
- </field>
-
- <field name = "heartbeat" domain = "short" label = "desired heartbeat delay">
- <doc>
- The delay, in seconds, of the connection heartbeat that the client wants. Zero
- means the client does not want a heartbeat.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "open" synchronous = "1" index = "40" label = "open connection to virtual host">
- <doc>
- This method opens a connection to a virtual host, which is a collection of
- resources, and acts to separate multiple application domains within a server.
- The server may apply arbitrary limits per virtual host, such as the number
- of each type of entity that may be used, per connection and/or in total.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "open-ok" />
- <response name = "redirect" />
-
- <field name = "virtual-host" domain = "path" label = "virtual host name">
- <!-- TODO 0.82 - the entire vhost model needs review. This concept was
- prompted by the HTTP vhost concept but does not fit very well into
- AMQP. Currently we use the vhost as a "cluster identifier" which is
- inaccurate usage. /PH 2006/07/19
- -->
- <assert check = "regexp" value = "^[a-zA-Z0-9/-_]+$" />
- <doc>
- The name of the virtual host to work with.
- </doc>
- <rule name = "separation">
- <doc>
- If the server supports multiple virtual hosts, it MUST enforce a full
- separation of exchanges, queues, and all associated entities per virtual
- host. An application, connected to a specific virtual host, MUST NOT be able
- to access resources of another virtual host.
- </doc>
- </rule>
- <rule name = "security">
- <doc>
- The server SHOULD verify that the client has permission to access the
- specified virtual host.
- </doc>
- </rule>
- </field>
-
- <field name = "capabilities" domain = "shortstr" label = "required capabilities">
- <doc>
- The client can specify zero or more capability names, delimited by spaces.
- The server can use this string to how to process the client's connection
- request.
- </doc>
- </field>
-
- <field name = "insist" domain = "bit" label = "insist on connecting to server">
- <doc>
- In a configuration with multiple collaborating servers, the server may respond
- to a Connection.Open method with a Connection.Redirect. The insist option tells
- the server that the client is insisting on a connection to the specified server.
- </doc>
- <rule name = "behaviour">
- <doc>
- When the client uses the insist option, the server MUST NOT respond with a
- Connection.Redirect method. If it cannot accept the client's connection
- request it should respond by closing the connection with a suitable reply
- code.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "open-ok" synchronous = "1" index = "41" label = "signal that connection is ready">
- <doc>
- This method signals to the client that the connection is ready for use.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "known-hosts" domain = "known-hosts" />
- </method>
-
- <method name = "redirect" synchronous = "1" index = "42" label = "redirects client to other server">
- <doc>
- This method redirects the client to another server, based on the requested virtual
- host and/or capabilities.
- </doc>
- <rule name = "usage">
- <doc>
- When getting the Connection.Redirect method, the client SHOULD reconnect to
- the host specified, and if that host is not present, to any of the hosts
- specified in the known-hosts list.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <field name = "host" domain = "shortstr" label = "server to connect to">
- <doc>
- Specifies the server to connect to. This is an IP address or a DNS name,
- optionally followed by a colon and a port number. If no port number is
- specified, the client should use the default port number for the protocol.
- </doc>
- <assert check = "notnull" />
- </field>
- <field name = "known-hosts" domain = "known-hosts" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "close" synchronous = "1" index = "50" label = "request a connection close">
- <doc>
- This method indicates that the sender wants to close the connection. This may be
- due to internal conditions (e.g. a forced shut-down) or due to an error handling
- a specific method, i.e. an exception. When a close is due to an exception, the
- sender provides the class and method id of the method which caused the exception.
- </doc>
- <!-- TODO: the connection close mechanism needs to be reviewed from the ODF
- documentation and better expressed as rules here. /PH 2006/07/20
- -->
- <rule name = "stability">
- <doc>
- After sending this method any received method except the Close-OK method MUST
- be discarded.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- <response name = "close-ok" />
-
- <field name = "reply-code" domain = "reply-code" />
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "class-id" domain = "class-id" label = "failing method class">
- <doc>
- When the close is provoked by a method exception, this is the class of the
- method.
- </doc>
- </field>
-
- <field name = "method-id" domain = "method-id" label = "failing method ID">
- <doc>
- When the close is provoked by a method exception, this is the ID of the method.
- </doc>
- </field>
- </method>
-
- <method name = "close-ok" synchronous = "1" index = "51" label = "confirm a connection close">
- <doc>
- This method confirms a Connection.Close method and tells the recipient that it is
- safe to release resources for the connection and close the socket.
- </doc>
- <rule name = "reporting">
- <doc>
- A peer that detects a socket closure without having received a Close-Ok
- handshake method SHOULD log the error.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- </method>
- </class>
-
- <!-- == CHANNEL ========================================================== -->
-
- <class name = "channel" handler = "channel" index = "20" label = "work with channels">
- <doc>
- The channel class provides methods for a client to establish a channel to a
- server and for both peers to operate the channel thereafter.
- </doc>
-
- <doc type = "grammar">
- channel = open-channel *use-channel close-channel
- open-channel = C:OPEN S:OPEN-OK
- / C:RESUME S:OK
- use-channel = C:FLOW S:FLOW-OK
- / S:FLOW C:FLOW-OK
- / S:PING C:OK
- / C:PONG S:OK
- / C:PING S:OK
- / S:PONG C:OK
- / functional-class
- close-channel = C:CLOSE S:CLOSE-OK
- / S:CLOSE C:CLOSE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "open" synchronous = "1" index = "10" label = "open a channel for use">
- <doc>
- This method opens a channel to the server.
- </doc>
- <rule name = "state" on-failure = "channel-error">
- <doc>
- The client MUST NOT use this method on an already-opened channel.
- </doc>
- <doc type = "scenario">
- Client opens a channel and then reopens the same channel.
- </doc>
- </rule>
- <chassis name = "server" implement = "MUST" />
- <response name = "open-ok" />
- <field name = "out-of-band" domain = "shortstr" label = "out-of-band settings">
- <doc>
- Configures out-of-band transfers on this channel. The syntax and meaning of this
- field will be formally defined at a later date.
- </doc>
- <assert check = "null" />
- </field>
- </method>
-
- <method name = "open-ok" synchronous = "1" index = "11" label = "signal that the channel is ready">
- <doc>
- This method signals to the client that the channel is ready for use.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "channel-id" domain = "channel-id" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "flow" synchronous = "1" index = "20" label = "enable/disable flow from peer">
- <doc>
- This method asks the peer to pause or restart the flow of content data. This is a
- simple flow-control mechanism that a peer can use to avoid overflowing its queues or
- otherwise finding itself receiving more messages than it can process. Note that this
- method is not intended for window control. The peer that receives a disable flow
- method should finish sending the current content frame, if any, then pause.
- </doc>
-
- <rule name = "initial-state">
- <doc>
- When a new channel is opened, it is active (flow is active). Some applications
- assume that channels are inactive until started. To emulate this behaviour a
- client MAY open the channel, then pause it.
- </doc>
- </rule>
-
- <rule name = "bidirectional">
- <doc>
- When sending content frames, a peer SHOULD monitor the channel for incoming
- methods and respond to a Channel.Flow as rapidly as possible.
- </doc>
- </rule>
-
- <rule name = "throttling">
- <doc>
- A peer MAY use the Channel.Flow method to throttle incoming content data for
- internal reasons, for example, when exchanging data over a slower connection.
- </doc>
- </rule>
-
- <rule name = "expected-behaviour">
- <doc>
- The peer that requests a Channel.Flow method MAY disconnect and/or ban a peer
- that does not respect the request. This is to prevent badly-behaved clients
- from overwhelming a broker.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <response name = "flow-ok" />
-
- <field name = "active" domain = "bit" label = "start/stop content frames">
- <doc>
- If 1, the peer starts sending content frames. If 0, the peer stops sending
- content frames.
- </doc>
- </field>
- </method>
-
- <method name = "flow-ok" index = "21" label = "confirm a flow method">
- <doc>
- Confirms to the peer that a flow command was received and processed.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- <field name = "active" domain = "bit" label = "current flow setting">
- <doc>
- Confirms the setting of the processed flow method: 1 means the peer will start
- sending or continue to send content frames; 0 means it will not.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "close" synchronous = "1" index = "40" label = "request a channel close">
- <doc>
- This method indicates that the sender wants to close the channel. This may be due to
- internal conditions (e.g. a forced shut-down) or due to an error handling a specific
- method, i.e. an exception. When a close is due to an exception, the sender provides
- the class and method id of the method which caused the exception.
- </doc>
-
- <!-- TODO: the channel close behaviour needs to be reviewed from the ODF
- documentation and better expressed as rules here. /PH 2006/07/20
- -->
- <rule name = "stability">
- <doc>
- After sending this method any received method except the Close-OK method MUST
- be discarded.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- <response name = "close-ok" />
-
- <field name = "reply-code" domain = "reply-code" />
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "class-id" domain = "class-id" label = "failing method class">
- <doc>
- When the close is provoked by a method exception, this is the class of the
- method.
- </doc>
- </field>
-
- <field name = "method-id" domain = "method-id" label = "failing method ID">
- <doc>
- When the close is provoked by a method exception, this is the ID of the method.
- </doc>
- </field>
- </method>
-
- <method name = "close-ok" synchronous = "1" index = "41" label = "confirm a channel close">
- <doc>
- This method confirms a Channel.Close method and tells the recipient that it is safe
- to release resources for the channel.
- </doc>
- <rule name = "reporting">
- <doc>
- A peer that detects a socket closure without having received a Channel.Close-Ok
- handshake method SHOULD log the error.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <chassis name = "server" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "resume" index = "50" label = "resume an interrupted channel">
- <doc>
- This method resume a previously interrupted channel.
- </doc>
- <response name = "ok" />
- <chassis name = "server" implement = "MAY" />
- <field name = "channel-id" domain = "channel-id" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "ping" index = "60" label = "[WORK IN PROGRESS] initiates a pong">
- <doc>
- [WORK IN PROGRESS] Request that the recipient issue a pong request.
- </doc>
- <response name = "ok" />
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <method name = "pong" index = "70" label = "[WORK IN PROGRESS] issued after receiving a ping">
- <doc>
- [WORK IN PROGRESS] Issued after a ping request is received. Note that this is a
- request issued after receiving a ping, not a response to
- receiving a ping.
- </doc>
- <response name = "ok" />
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <method name = "ok" index = "80" label = "[WORK IN PROGRESS] signals normal completion">
- <doc>
- [WORK IN PROGRESS] Signals normal completion of a method.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- </method>
- </class>
-
- <!-- == ACCESS =========================================================== -->
-
- <!-- TODO 0.82 - this class must be implemented by two teams before we can
- consider it matured.
- -->
-
- <class name = "access" handler = "connection" index = "30" label = "work with access tickets">
- <doc>
- The protocol control access to server resources using access tickets. A
- client must explicitly request access tickets before doing work. An access
- ticket grants a client the right to use a specific set of resources -
- called a "realm" - in specific ways.
- </doc>
-
- <doc type = "grammar">
- access = C:REQUEST S:REQUEST-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "request" synchronous = "1" index = "10" label = "request an access ticket">
- <doc>
- This method requests an access ticket for an access realm. The server
- responds by granting the access ticket. If the client does not have
- access rights to the requested realm this causes a connection exception.
- Access tickets are a per-channel resource.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "request-ok" />
-
- <field name = "realm" domain = "shortstr" label = "name of requested realm">
- <doc>
- Specifies the name of the realm to which the client is requesting access.
- The realm is a configured server-side object that collects a set of
- resources (exchanges, queues, etc.). If the channel has already requested
- an access ticket onto this realm, the previous ticket is destroyed and a
- new ticket is created with the requested access rights, if allowed.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST specify a realm that is known to the server. The server
- makes an identical response for undefined realms as it does for realms
- that are defined but inaccessible to this client.
- </doc>
- <doc type = "scenario">
- Client specifies an undefined realm.
- </doc>
- </rule>
- </field>
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive access to the realm, meaning that this will be the only
- channel that uses the realm's resources.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MAY NOT request exclusive access to a realm that has active
- access tickets, unless the same channel already had the only access
- ticket onto that realm.
- </doc>
- <doc type = "scenario">
- Client opens two channels and requests exclusive access to the same realm.
- </doc>
- </rule>
- </field>
- <field name = "passive" domain = "bit" label = "request passive access">
- <doc>
- Request message passive access to the specified access realm. Passive
- access lets a client get information about resources in the realm but
- not to make any changes to them.
- </doc>
- </field>
- <field name = "active" domain = "bit" label = "request active access">
- <doc>
- Request message active access to the specified access realm. Active access lets
- a client get create and delete resources in the realm.
- </doc>
- </field>
- <field name = "write" domain = "bit" label = "request write access">
- <doc>
- Request write access to the specified access realm. Write access lets a client
- publish messages to all exchanges in the realm.
- </doc>
- </field>
- <field name = "read" domain = "bit" label = "request read access">
- <doc>
- Request read access to the specified access realm. Read access lets a client
- consume messages from queues in the realm.
- </doc>
- </field>
- </method>
-
- <method name = "request-ok" synchronous = "1" index = "11" label = "grant access to server resources">
- <doc>
- This method provides the client with an access ticket. The access ticket is valid
- within the current channel and for the lifespan of the channel.
- </doc>
- <rule name = "per-channel" on-failure = "not-allowed">
- <doc>
- The client MUST NOT use access tickets except within the same channel as
- originally granted.
- </doc>
- <doc type = "scenario">
- Client opens two channels, requests a ticket on one channel, and then
- tries to use that ticket in a second channel.
- </doc>
- </rule>
- <chassis name = "client" implement = "MUST" />
- <field name = "ticket" domain = "access-ticket" />
- </method>
- </class>
-
- <!-- == EXCHANGE ========================================================= -->
-
- <class name = "exchange" handler = "channel" index = "40" label = "work with exchanges">
- <doc>
- Exchanges match and distribute messages across queues. Exchanges can be configured in
- the server or created at runtime.
- </doc>
-
- <doc type = "grammar">
- exchange = C:DECLARE S:DECLARE-OK
- / C:DELETE S:DELETE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <rule name = "required-types">
- <doc>
- The server MUST implement these standard exchange types: fanout, direct.
- </doc>
- <doc type = "scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
- <rule name = "recommended-types">
- <doc>
- The server SHOULD implement these standard exchange types: topic, headers.
- </doc>
- <doc type = "scenario">
- Client attempts to declare an exchange with each of these standard types.
- </doc>
- </rule>
- <rule name = "required-instances">
- <doc>
- The server MUST, in each virtual host, pre-declare an exchange instance
- for each standard exchange type that it implements, where the name of the
- exchange instance, if defined, is "amq." followed by the exchange type name.
- </doc>
- <doc>
- The server MUST, in each virtual host, pre-declare at least two direct
- exchange instances: one named "amq.direct", the other with no public name
- that serves as a default exchange for Publish methods.
- </doc>
- <doc type = "scenario">
- Client creates a temporary queue and attempts to bind to each required
- exchange instance ("amq.fanout", "amq.direct", "amq.topic", and "amq.headers"
- if those types are defined).
- </doc>
- </rule>
- <rule name = "default-exchange">
- <doc>
- The server MUST pre-declare a direct exchange with no public name to act as
- the default exchange for content Publish methods and for default queue bindings.
- </doc>
- <doc type = "scenario">
- Client checks that the default exchange is active by specifying a queue
- binding with no exchange name, and publishing a message with a suitable
- routing key but without specifying the exchange name, then ensuring that
- the message arrives in the queue correctly.
- </doc>
- </rule>
- <rule name = "default-access">
- <doc>
- The server MUST NOT allow clients to access the default exchange except
- by specifying an empty exchange name in the Queue.Bind and content Publish
- methods.
- </doc>
- </rule>
- <rule name = "extensions">
- <doc>
- The server MAY implement other exchange types as wanted.
- </doc>
- </rule>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "declare" synchronous = "1" index = "10" label = "verify exchange exists, create if needed">
- <doc>
- This method creates an exchange if it does not already exist, and if the exchange
- exists, verifies that it is of the correct and expected class.
- </doc>
- <rule name = "minimum">
- <doc>
- The server SHOULD support a minimum of 16 exchanges per virtual host and
- ideally, impose no limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- The client creates as many exchanges as it can until the server reports
- an error; the number of exchanges successfully created must be at least
- sixteen.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "declare-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- When a client defines a new exchange, this belongs to the access realm of the
- ticket used. All further work done with that exchange must be done with an
- access ticket for the same realm.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access to
- the realm in which the exchange exists or will be created, or "passive"
- access if the if-exists flag is set.
- </doc>
- <doc type = "scenario">
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <rule name = "reserved" on-failure = "access-refused">
- <doc>
- Exchange names starting with "amq." are reserved for pre-declared and
- standardised exchanges. The client MUST NOT attempt to create an exchange
- starting with "amq.".
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <assert check = "regexp" value = "^[a-zA-Z0-9-_.:]+$" />
- </field>
-
- <field name = "type" domain = "shortstr" label = "exchange type">
- <doc>
- Each exchange belongs to one of a set of exchange types implemented by the
- server. The exchange types define the functionality of the exchange - i.e. how
- messages are routed through it. It is not valid or meaningful to attempt to
- change the type of an existing exchange.
- </doc>
- <rule name = "typed" on-failure = "not-allowed">
- <doc>
- Exchanges cannot be redeclared with different types. The client MUST not
- attempt to redeclare an existing exchange with a different type than used
- in the original Exchange.Declare method.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <rule name = "support" on-failure = "command-invalid">
- <doc>
- The client MUST NOT attempt to create an exchange with a type that the
- server does not support.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <assert check = "regexp" value = "^[a-zA-Z0-9-_.:]+$" />
- </field>
-
- <field name = "passive" domain = "bit" label = "do not create exchange">
- <doc>
- If set, the server will not create the exchange. The client can use this to
- check whether an exchange exists without modifying the server state.
- </doc>
- <rule name = "not-found">
- <doc>
- If set, and the exchange does not already exist, the server MUST raise a
- channel exception with reply code 404 (not found).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "durable" domain = "bit" label = "request a durable exchange">
- <doc>
- If set when creating a new exchange, the exchange will be marked as durable.
- Durable exchanges remain active when a server restarts. Non-durable exchanges
- (transient exchanges) are purged if/when a server restarts.
- </doc>
- <rule name = "support">
- <doc>
- The server MUST support both durable and transient exchanges.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- <rule name = "sticky">
- <doc>
- The server MUST ignore the durable field if the exchange already exists.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <!-- TODO 0.82 - clarify how this works; there is no way to cancel a binding
- except by deleting a queue.
- -->
- <field name = "auto-delete" domain = "bit" label = "auto-delete when unused">
- <doc>
- If set, the exchange is deleted when all queues have finished using it.
- </doc>
- <rule name = "sticky">
- <doc>
- The server MUST ignore the auto-delete field if the exchange already
- exists.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "internal" domain = "bit" label = "create internal exchange">
- <doc>
- If set, the exchange may not be used directly by publishers, but only when bound
- to other exchanges. Internal exchanges are used to construct wiring that is not
- visible to applications.
- </doc>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
-
- <field name = "arguments" domain = "table" label = "arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these
- arguments depends on the server implementation. This field is ignored if passive
- is 1.
- </doc>
- </field>
- </method>
-
- <method name = "declare-ok" synchronous = "1" index = "11" label = "confirm exchange declaration">
- <doc>
- This method confirms a Declare method and confirms the name of the exchange,
- essential for automatically-named exchanges.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "delete" synchronous = "1" index = "20" label = "delete an exchange">
- <doc>
- This method deletes an exchange. When an exchange is deleted all queue bindings on
- the exchange are cancelled.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "delete-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access
- rights to the exchange's access realm.
- </doc>
- <doc type = "scenario">
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <rule name = "exists" on-failure = "not-found">
- <doc>
- The client MUST NOT attempt to delete an exchange that does not exist.
- </doc>
- </rule>
- <assert check = "notnull" />
- </field>
-
- <!-- TODO 0.82 - discuss whether this option is useful or not. I don't have
- any real use case for it. /PH 2006-07-23.
- -->
- <field name = "if-unused" domain = "bit" label = "delete only if unused">
- <doc>
- If set, the server will only delete the exchange if it has no queue bindings. If
- the exchange has queue bindings the server does not delete it but raises a
- channel exception instead.
- </doc>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "delete-ok" synchronous = "1" index = "21"
- label = "confirm deletion of an exchange">
- <doc>This method confirms the deletion of an exchange.</doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- RG : Added Exchange.bound and Exchange.bound-ok -->
- <method name="bound" synchronous="1" index="22">
- <chassis name="server" implement="SHOULD"/>
- <field name="exchange" domain="exchange-name"/>
- <field name = "routing-key" type = "shortstr">
- Message routing key
- <doc>
- Specifies the routing key for the message. The routing key is
- used for routing messages depending on the exchange configuration.
- </doc>
- </field>
- <field name = "queue" domain = "queue name"/>
- </method>
-
- <method name="bound-ok" synchronous="1" index="23">
- <field name="reply-code" domain="reply-code"/>
- <field name="reply-text" domain="reply-text"/>
- <chassis name="client" implement="SHOULD"/>
- </method>
-
-
-
- </class>
-
- <!-- == QUEUE ============================================================ -->
-
- <class name = "queue" handler = "channel" index = "50" label = "work with queues">
- <doc>
- Queues store and forward messages. Queues can be configured in the server or created at
- runtime. Queues must be attached to at least one exchange in order to receive messages
- from publishers.
- </doc>
-
- <doc type = "grammar">
- queue = C:DECLARE S:DECLARE-OK
- / C:BIND S:BIND-OK
- / C:PURGE S:PURGE-OK
- / C:DELETE S:DELETE-OK
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <rule name = "any-content">
- <doc>
- A server MUST allow any content class to be sent to any queue, in any mix, and
- queue and deliver these content classes independently. Note that all methods
- that fetch content off queues are specific to a given content class.
- </doc>
- <doc type = "scenario">
- Client creates an exchange of each standard type and several queues that
- it binds to each exchange. It must then successfully send each of the standard
- content types to each of the available queues.
- </doc>
- </rule>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "declare" synchronous = "1" index = "10" label = "declare queue, create if needed">
- <doc>
- This method creates or checks a queue. When creating a new queue the client can
- specify various properties that control the durability of the queue and its
- contents, and the level of sharing for the queue.
- </doc>
-
- <rule name = "default-binding">
- <doc>
- The server MUST create a default binding for a newly-created queue to the
- default exchange, which is an exchange of type 'direct' and use the queue
- name as the routing key.
- </doc>
- <doc type = "scenario">
- Client creates a new queue, and then without explicitly binding it to an
- exchange, attempts to send a message through the default exchange binding,
- i.e. publish a message to the empty exchange, with the queue name as routing
- key.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_35" -->
- <rule name = "minimum-queues">
- <doc>
- The server SHOULD support a minimum of 256 queues per virtual host and ideally,
- impose no limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- Client attempts to create as many queues as it can until the server reports
- an error. The resulting count must at least be 256.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "declare-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- When a client defines a new queue, this belongs to the access realm of the
- ticket used. All further work done with that queue must be done with an access
- ticket for the same realm.
- </doc>
- <rule name = "validity" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "active" access to
- the realm in which the queue exists or will be created.
- </doc>
- <doc type = "scenario">
- Client creates access ticket with wrong access rights and attempts to use
- in this method.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <rule name = "default-name">
- <doc>
- The queue name MAY be empty, in which case the server MUST create a new
- queue with a unique generated name and return this to the client in the
- Declare-Ok method.
- </doc>
- <doc type = "scenario">
- Client attempts to create several queues with an empty name. The client then
- verifies that the server-assigned names are unique and different.
- </doc>
- </rule>
- <rule name = "reserved-prefix" on-failure = "not-allowed">
- <doc>
- Queue names starting with "amq." are reserved for pre-declared and
- standardised server queues. A client MAY NOT attempt to declare a queue with a
- name that starts with "amq." and the passive option set to zero.
- </doc>
- <doc type = "scenario">
- A client attempts to create a queue with a name starting with "amq." and with
- the passive option set to zero.
- </doc>
- </rule>
- <assert check = "regexp" value = "^[a-zA-Z0-9-_.:]*$" />
- </field>
-
- <field name = "passive" domain = "bit" label = "do not create queue">
- <doc>
- If set, the server will not create the queue. This field allows the client
- to assert the presence of a queue without modifying the server state.
- </doc>
- <rule name = "passive" on-failure = "not-found">
- <doc>
- The client MAY ask the server to assert that a queue exists without
- creating the queue if not. If the queue does not exist, the server
- treats this as a failure.
- </doc>
- <doc type = "scenario">
- Client declares an existing queue with the passive option and expects
- the server to respond with a declare-ok. Client then attempts to declare
- a non-existent queue with the passive option, and the server must close
- the channel with the correct reply-code.
- </doc>
- </rule>
- </field>
-
- <field name = "durable" domain = "bit" label = "request a durable queue">
- <doc>
- If set when creating a new queue, the queue will be marked as durable. Durable
- queues remain active when a server restarts. Non-durable queues (transient
- queues) are purged if/when a server restarts. Note that durable queues do not
- necessarily hold persistent messages, although it does not make sense to send
- persistent messages to a transient queue.
- </doc>
- <!-- Rule test name: was "amq_queue_03" -->
- <rule name = "persistence">
- <doc>The server MUST recreate the durable queue after a restart.</doc>
-
- <!-- TODO: use 'client does something' rather than 'a client does something'. -->
- <doc type = "scenario">
- A client creates a durable queue. The server is then restarted. The client
- then attempts to send a message to the queue. The message should be successfully
- delivered.
- </doc>
- </rule>
- <!-- Rule test name: was "amq_queue_36" -->
- <rule name = "types">
- <doc>The server MUST support both durable and transient queues.</doc>
- <doc type = "scenario">
- A client creates two named queues, one durable and one transient.
- </doc>
- </rule>
- <!-- Rule test name: was "amq_queue_37" -->
- <rule name = "pre-existence">
- <doc>The server MUST ignore the durable field if the queue already exists.</doc>
- <doc type = "scenario">
- A client creates two named queues, one durable and one transient. The client
- then attempts to declare the two queues using the same names again, but reversing
- the value of the durable flag in each case. Verify that the queues still exist
- with the original durable flag values.
- <!-- TODO: but how? -->
- </doc>
- </rule>
- </field>
-
- <field name = "exclusive" domain = "bit" label = "request an exclusive queue">
- <doc>
- Exclusive queues may only be consumed from by the current connection. Setting
- the 'exclusive' flag always implies 'auto-delete'.
- </doc>
-
- <!-- Rule test name: was "amq_queue_38" -->
- <rule name = "types">
- <doc>
- The server MUST support both exclusive (private) and non-exclusive (shared)
- queues.
- </doc>
- <doc type = "scenario">
- A client creates two named queues, one exclusive and one non-exclusive.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_04" -->
- <rule name = "02" on-failure = "channel-error">
- <doc>
- The client MAY NOT attempt to declare any existing and exclusive queue
- on multiple connections.
- </doc>
- <doc type = "scenario">
- A client declares an exclusive named queue. A second client on a different
- connection attempts to declare a queue of the same name.
- </doc>
- </rule>
- </field>
-
- <field name = "auto-delete" domain = "bit" label = "auto-delete queue when unused">
- <doc>
- If set, the queue is deleted when all consumers have finished using it. Last
- consumer can be cancelled either explicitly or because its channel is closed. If
- there was no consumer ever on the queue, it won't be deleted.
- </doc>
-
- <!-- Rule test name: was "amq_queue_31" -->
- <rule name = "pre-existence">
- <doc>
- The server MUST ignore the auto-delete field if the queue already exists.
- </doc>
- <doc type = "scenario">
- A client creates two named queues, one as auto-delete and one explicit-delete.
- The client then attempts to declare the two queues using the same names again,
- but reversing the value of the auto-delete field in each case. Verify that the
- queues still exist with the original auto-delete flag values.
- <!-- TODO: but how? -->
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
-
- <field name = "arguments" domain = "table" label = "arguments for declaration">
- <doc>
- A set of arguments for the declaration. The syntax and semantics of these
- arguments depends on the server implementation. This field is ignored if passive
- is 1.
- </doc>
- </field>
- </method>
-
- <method name = "declare-ok" synchronous = "1" index = "11" label = "confirms a queue definition">
- <doc>
- This method confirms a Declare method and confirms the name of the queue, essential
- for automatically-named queues.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Reports the name of the queue. If the server generated a queue name, this field
- contains that name.
- </doc>
- <assert check = "notnull" />
- </field>
-
- <field name = "message-count" domain = "long" label = "number of messages in queue">
- <doc>
- Reports the number of messages in the queue, which will be zero for
- newly-created queues.
- </doc>
- </field>
-
- <field name = "consumer-count" domain = "long" label = "number of consumers">
- <doc>
- Reports the number of active consumers for the queue. Note that consumers can
- suspend activity (Channel.Flow) in which case they do not appear in this count.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "bind" synchronous = "1" index = "20" label = "bind queue to an exchange">
- <doc>
- This method binds a queue to an exchange. Until a queue is bound it will not receive
- any messages. In a classic messaging model, store-and-forward queues are bound to a
- direct exchange and subscription queues are bound to a topic exchange.
- </doc>
-
- <!-- Rule test name: was "amq_queue_25" -->
- <rule name = "duplicates">
- <doc>
- A server MUST allow ignore duplicate bindings - that is, two or more bind
- methods for a specific queue, with identical arguments - without treating these
- as an error.
- </doc>
- <doc type = "scenario">
- A client binds a named queue to an exchange. The client then repeats the bind
- (with identical arguments).
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_39" -->
- <rule name = "failure">
- <!--
- TODO: Find correct on-failure code. The on-failure code returned should depend on why the bind
- failed. Assuming that failures owing to bad parameters are covered in the rules relating
- to those parameters, the only remaining reason for a failure would be the lack of
- server resorces or some internal error - such as too many queues open. Would these
- cases qualify as "resource error" 506 or "internal error" 541?
- -->
- <doc>If a bind fails, the server MUST raise a connection exception.</doc>
- <doc type = "scenario">
- TODO
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_12" -->
- <rule name = "transient-exchange" on-failure = "not-allowed">
- <doc>
- The server MUST NOT allow a durable queue to bind to a transient exchange.
- </doc>
- <doc type = "scenario">
- A client creates a transient exchange. The client then declares a named durable
- queue and then attempts to bind the transient exchange to the durable queue.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_13" -->
- <rule name = "durable-exchange">
- <doc>
- Bindings for durable queues are automatically durable and the server SHOULD
- restore such bindings after a server restart.
- </doc>
- <doc type = "scenario">
- A server creates a named durable queue and binds it to a durable exchange. The
- server is restarted. The client then attempts to use the queue/exchange combination.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_17" -->
- <rule name = "internal-exchange">
- <doc>
- If the client attempts to bind to an exchange that was declared as internal, the server
- MUST raise a connection exception with reply code 530 (not allowed).
- </doc>
- <doc type = "scenario">
- A client attempts to bind a named queue to an internal exchange.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_40" -->
- <rule name = "binding-count">
- <doc>
- The server SHOULD support at least 4 bindings per queue, and ideally, impose no
- limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- A client creates a named queue and attempts to bind it to 4 different non-internal
- exchanges.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "bind-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- The client provides a valid access ticket giving "active" access rights to the
- queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to bind. If the queue name is empty, refers to
- the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "empty-queue" on-failure = "not-allowed">
- <doc>
- A client MUST NOT be allowed to bind a non-existent and unnamed queue (i.e.
- empty queue name) to an exchange.
- </doc>
- <doc type = "scenario">
- A client attempts to bind with an unnamed (empty) queue name to an exchange.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_26" -->
- <rule name = "queue-existence" on-failure = "not-found">
- <doc>
- A client MUST NOT be allowed to bind a non-existent queue (i.e. not previously
- declared) to an exchange.
- </doc>
- <doc type = "scenario">
- A client attempts to bind an undeclared queue name to an exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name" label = "name of the exchange to bind to">
- <!-- Rule test name: was "amq_queue_14" -->
- <rule name = "exchange-existence" on-failure = "not-found">
- <doc>
- A client MUST NOT be allowed to bind a queue to a non-existent exchange.
- </doc>
- <doc type = "scenario">
- A client attempts to bind an named queue to a undeclared exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "message routing key">
- <doc>
- Specifies the routing key for the binding. The routing key is used for routing
- messages depending on the exchange configuration. Not all exchanges use a
- routing key - refer to the specific exchange documentation. If the queue name
- is empty, the server uses the last queue declared on the channel. If the
- routing key is also empty, the server uses this queue name for the routing
- key as well. If the queue name is provided but the routing key is empty, the
- server does the binding with that empty routing key. The meaning of empty
- routing keys depends on the exchange implementation.
- </doc>
- <rule name = "direct-exchange-key-matching">
- <doc>
- If a message queue binds to a direct exchange using routing key K and a
- publisher sends the exchange a message with routing key R, then the message
- MUST be passed to the message queue if K = R.
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
-
- <field name = "arguments" domain = "table" label = "arguments for binding">
- <doc>
- A set of arguments for the binding. The syntax and semantics of these arguments
- depends on the exchange class.
- </doc>
- </field>
- </method>
-
- <method name = "bind-ok" synchronous = "1" index = "21" label = "confirm bind successful">
- <doc>This method confirms that the bind was successful.</doc>
-
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "unbind" synchronous = "1" index = "50" label = "unbind a queue from an exchange">
- <doc>This method unbinds a queue from an exchange.</doc>
- <rule name = "01">
- <doc>If a unbind fails, the server MUST raise a connection exception.</doc>
- </rule>
- <chassis name="server" implement="MUST"/>
- <response name="unbind-ok"/>
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- The client provides a valid access ticket giving "active"
- access rights to the queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>Specifies the name of the queue to unbind.</doc>
- <rule name = "02">
- <doc>
- If the queue does not exist the server MUST raise a channel exception
- with reply code 404 (not found).
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <doc>The name of the exchange to unbind from.</doc>
- <rule name = "03">
- <doc>
- If the exchange does not exist the server MUST raise a channel
- exception with reply code 404 (not found).
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "routing key of binding">
- <doc>Specifies the routing key of the binding to unbind.</doc>
- </field>
-
- <field name = "arguments" domain = "table" label = "arguments of binding">
- <doc>Specifies the arguments of the binding to unbind.</doc>
- </field>
- </method>
-
- <method name = "unbind-ok" synchronous = "1" index = "51" label = "confirm unbind successful">
- <doc>This method confirms that the unbind was successful.</doc>
- <chassis name = "client" implement = "MUST"/>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "purge" synchronous = "1" index = "30" label = "purge a queue">
- <doc>
- This method removes all messages from a queue. It does not cancel consumers. Purged
- messages are deleted without any formal "undo" mechanism.
- </doc>
-
- <!-- Rule test name: was "amq_queue_15" -->
- <rule name = "01">
- <doc>A call to purge MUST result in an empty queue.</doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_41" -->
- <rule name = "02">
- <doc>
- On transacted channels the server MUST not purge messages that have already been
- sent to a client but not yet acknowledged.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <!-- Rule test name: was "amq_queue_42" -->
- <rule name = "03">
- <doc>
- The server MAY implement a purge queue or log that allows system administrators
- to recover accidentally-purged messages. The server SHOULD NOT keep purged
- messages in the same storage spaces as the live messages since the volumes of
- purged messages may get very large.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "purge-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>The access ticket must be for the access realm that holds the queue.</doc>
-
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the queue's access realm. Note that purging a queue is equivalent to reading
- all messages and discarding them.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to purge. If the queue name is empty, refers to
- the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
-
- <!-- TODO Rule split? -->
-
- <!-- Rule test name: was "amq_queue_16" -->
- <rule name = "02">
- <doc>
- The queue MUST exist. Attempting to purge a non-existing queue MUST cause a
- channel exception.
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "purge-ok" synchronous = "1" index = "31" label = "confirms a queue purge">
- <doc>This method confirms the purge of a queue.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "message-count" domain = "long" label = "number of messages purged">
- <doc>Reports the number of messages purged.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "delete" synchronous = "1" index = "40" label = "delete a queue">
- <doc>
- This method deletes a queue. When a queue is deleted any pending messages are sent
- to a dead-letter queue if this is defined in the server configuration, and all
- consumers on the queue are cancelled.
- </doc>
-
- <!-- TODO: Rule split? -->
-
- <!-- Rule test name: was "amq_queue_43" -->
- <rule name = "01">
- <doc>
- The server SHOULD use a dead-letter queue to hold messages that were pending on
- a deleted queue, and MAY provide facilities for a system administrator to move
- these messages back to an active queue.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "delete-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <doc>
- The client provides a valid access ticket giving "active" access rights to the
- queue's access realm.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to delete. If the queue name is empty, refers to
- the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_queue_21" -->
- <rule name = "02">
- <doc>
- The queue must exist. If the client attempts to delete a non-existing queue
- the server MUST raise a channel exception with reply code 404 (not found).
- </doc>
- </rule>
- </field>
-
- <field name = "if-unused" domain = "bit" label = "delete only if unused">
- <doc>
- If set, the server will only delete the queue if it has no consumers. If the
- queue has consumers the server does does not delete it but raises a channel
- exception instead.
- </doc>
-
- <!-- Rule test name: was "amq_queue_29" and "amq_queue_30" -->
- <rule name = "01">
- <doc>The server MUST respect the if-unused flag when deleting a queue.</doc>
- </rule>
- </field>
-
- <field name = "if-empty" domain = "bit" label = "delete only if empty">
- <doc>
- If set, the server will only delete the queue if it has no messages.
- </doc>
- <rule name = "01">
- <doc>
- If the queue is not empty the server MUST raise a channel exception with
- reply code 406 (precondition failed).
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "delete-ok" synchronous = "1" index = "41" label = "confirm deletion of a queue">
- <doc>This method confirms the deletion of a queue.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "message-count" domain = "long" label = "number of messages purged">
- <doc>Reports the number of messages purged.</doc>
- </field>
- </method>
- </class>
-
- <!-- == BASIC ============================================================ -->
-
- <class name = "basic" handler = "channel" index = "60" label = "work with basic content">
- <doc>
- The Basic class provides methods that support an industry-standard messaging model.
- </doc>
-
- <doc type = "grammar">
- basic = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN content
- / S:DELIVER content
- / C:GET ( S:GET-OK content / S:GET-EMPTY )
- / C:ACK
- / C:REJECT
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MAY" />
-
- <!-- Rule test name: was "amq_basic_08" -->
- <rule name = "01">
- <doc>
- The server SHOULD respect the persistent property of basic messages and
- SHOULD make a best-effort to hold persistent basic messages on a reliable
- storage mechanism.
- </doc>
- <doc type = "scenario">
- Send a persistent message to queue, stop server, restart server and then
- verify whether message is still present. Assumes that queues are durable.
- Persistence without durable queues makes no sense.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_09" -->
- <rule name = "02">
- <doc>
- The server MUST NOT discard a persistent basic message in case of a queue
- overflow.
- </doc>
- <doc type = "scenario">
- Create a queue overflow situation with persistent messages and verify that
- messages do not get lost (presumably the server will write them to disk).
- </doc>
- </rule>
-
- <rule name = "03">
- <doc>
- The server MAY use the Channel.Flow method to slow or stop a basic message
- publisher when necessary.
- </doc>
- <doc type = "scenario">
- Create a queue overflow situation with non-persistent messages and verify
- whether the server responds with Channel.Flow or not. Repeat with persistent
- messages.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_10" -->
- <rule name = "04">
- <doc>
- The server MAY overflow non-persistent basic messages to persistent
- storage.
- </doc>
- <!-- Test scenario: untestable -->
- </rule>
-
- <rule name = "05">
- <doc>
- The server MAY discard or dead-letter non-persistent basic messages on a
- priority basis if the queue size exceeds some configured limit.
- </doc>
- <!-- Test scenario: untestable -->
- </rule>
-
- <!-- Rule test name: was "amq_basic_11" -->
- <rule name = "06">
- <doc>
- The server MUST implement at least 2 priority levels for basic messages,
- where priorities 0-4 and 5-9 are treated as two distinct levels.
- </doc>
- <doc type = "scenario">
- Send a number of priority 0 messages to a queue. Send one priority 9
- message. Consume messages from the queue and verify that the first message
- received was priority 9.
- </doc>
- </rule>
-
- <rule name = "07">
- <doc>
- The server MAY implement up to 10 priority levels.
- </doc>
- <doc type = "scenario">
- Send a number of messages with mixed priorities to a queue, so that all
- priority values from 0 to 9 are exercised. A good scenario would be ten
- messages in low-to-high priority. Consume from queue and verify how many
- priority levels emerge.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_12" -->
- <rule name = "08">
- <doc>
- The server MUST deliver messages of the same priority in order irrespective of
- their individual persistence.
- </doc>
- <doc type = "scenario">
- Send a set of messages with the same priority but different persistence
- settings to a queue. Consume and verify that messages arrive in same order
- as originally published.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_13" -->
- <rule name = "09">
- <doc>
- The server MUST support automatic acknowledgements on Basic content, i.e.
- consumers with the no-ack field set to FALSE.
- </doc>
- <doc type = "scenario">
- Create a queue and a consumer using automatic acknowledgements. Publish
- a set of messages to the queue. Consume the messages and verify that all
- messages are received.
- </doc>
- </rule>
-
- <rule name = "10">
- <doc>
- The server MUST support explicit acknowledgements on Basic content, i.e.
- consumers with the no-ack field set to TRUE.
- </doc>
- <doc type = "scenario">
- Create a queue and a consumer using explicit acknowledgements. Publish a
- set of messages to the queue. Consume the messages but acknowledge only
- half of them. Disconnect and reconnect, and consume from the queue.
- Verify that the remaining messages are received.
- </doc>
- </rule>
-
- <!-- These are the properties for a Basic content -->
-
- <field name = "content-type" domain = "shortstr" label = "MIME content type" />
- <field name = "content-encoding" domain = "shortstr" label = "MIME content encoding" />
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "delivery-mode" domain = "octet" label = "non-persistent (1) or persistent (2)" />
- <field name = "priority" domain = "octet" label = "message priority, 0 to 9" />
- <field name = "correlation-id" domain = "shortstr" label = "application correlation identifier" />
- <field name = "reply-to" domain = "shortstr" label = "destination to reply to" />
- <field name = "expiration" domain = "shortstr" label = "message expiration specification" />
- <field name = "message-id" domain = "shortstr" label = "application message identifier" />
- <field name = "timestamp" domain = "timestamp" label = "message timestamp" />
- <field name = "type" domain = "shortstr" label = "message type name" />
- <field name = "user-id" domain = "shortstr" label = "creating user id" />
- <field name = "app-id" domain = "shortstr" label = "creating application id" />
- <!-- This field is deprecated pending review -->
- <field name = "cluster-id" domain = "shortstr" label = "intra-cluster routing identifier" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "qos" synchronous = "1" index = "10" label = "specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the
- current channel or for all channels on the connection. The particular properties and
- semantics of a qos method always depend on the content class semantics. Though the
- qos method could in principle apply to both peers, it is currently meaningful only
- for the server.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "qos-ok" />
-
- <field name = "prefetch-size" domain = "long" label = "prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client
- finishes processing a message, the following message is already held locally,
- rather than needing to be sent down the channel. Prefetching gives a performance
- improvement. This field specifies the prefetch window size in octets. The server
- will send a message in advance if it is equal to or smaller in size than the
- available prefetch size (and also falls into other prefetch limits). May be set
- to zero, meaning "no specific limit", although other prefetch limits may still
- apply. The prefetch-size is ignored if the no-ack option is set.
- </doc>
- <!-- Rule test name: was "amq_basic_17" -->
- <rule name = "01">
- <doc>
- The server MUST ignore this setting when the client is not processing any
- messages - i.e. the prefetch size does not limit the transfer of single
- messages to a client, only the sending in advance of more messages while
- the client still has one or more unacknowledged messages.
- </doc>
- <doc type = "scenario">
- Define a QoS prefetch-size limit and send a single message that exceeds
- that limit. Verify that the message arrives correctly.
- </doc>
- </rule>
- </field>
-
- <field name = "prefetch-count" domain = "short" label = "prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This field may be used
- in combination with the prefetch-size field; a message will only be sent in
- advance if both prefetch windows (and those at the channel and connection level)
- allow it. The prefetch-count is ignored if the no-ack option is set.
- </doc>
- <!-- Rule test name: was "amq_basic_18" -->
- <rule name = "01">
- <doc>
- The server may send less data in advance than allowed by the client's
- specified prefetch windows but it MUST NOT send more.
- </doc>
- <doc type = "scenario">
- Define a QoS prefetch-size limit and a prefetch-count limit greater than
- one. Send multiple messages that exceed the prefetch size. Verify that
- no more than one message arrives at once.
- </doc>
- </rule>
- </field>
-
- <field name = "global" domain = "bit" label = "apply to entire connection">
- <doc>
- By default the QoS settings apply to the current channel only. If this field is
- set, they are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <method name = "qos-ok" synchronous = "1" index = "11" label = "confirm the requested qos">
- <doc>
- This method tells the client that the requested QoS levels could be handled by the
- server. The requested QoS applies to all active consumers until a new QoS is
- defined.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "consume" synchronous = "1" index = "20" label = "start a queue consumer">
- <doc>
- This method asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the channel they were
- created on, or until the client cancels them.
- </doc>
-
- <!-- Rule test name: was "amq_basic_01" -->
- <rule name = "01">
- <doc>
- The server SHOULD support at least 16 consumers per queue, and ideally, impose
- no limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- Create a queue and create consumers on that queue until the server closes the
- connection. Verify that the number of consumers created was at least sixteen
- and report the total number.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer with an invalid (non-zero) access ticket.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
- <rule name = "01" on-failure = "not-allowed">
- <doc>
- If the queue name is empty the client MUST have previously declared a
- queue using this channel.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer with an empty queue name and no previously
- declared queue on the channel.
- </doc>
- </rule>
- </field>
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a
- connection, so two clients can use the same consumer tags. If this field is
- empty the server will generate a unique tag.
- </doc>
- <rule name = "01" on-failure = "not-allowed">
- <doc>
- The client MUST NOT specify a tag that refers to an existing consumer.
- </doc>
- <doc type = "scenario">
- Attempt to create two consumers with the same non-empty tag.
- </doc>
- </rule>
- <rule name = "02" on-failure = "not-allowed">
- <doc>
- The consumer tag is valid only within the channel from which the
- consumer was created. I.e. a client MUST NOT create a consumer in one
- channel and then use it in another.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer in one channel, then use in another channel,
- in which consumers have also been created (to test that the server uses
- unique consumer tags).
- </doc>
- </rule>
- </field>
-
- <field name = "no-local" domain = "no-local" />
-
- <field name = "no-ack" domain = "no-ack" />
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the
- queue.
- </doc>
- <!-- Rule test name: was "amq_basic_02" -->
- <rule name = "01" on-failure = "access-refused">
- <doc>
- The client MAY NOT gain exclusive access to a queue that already has
- active consumers.
- </doc>
- <doc type = "scenario">
- Open two connections to a server, and in one connection create a shared
- (non-exclusive) queue and then consume from the queue. In the second
- connection attempt to consume from the same queue using the exclusive
- option.
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise
- a channel or connection exception.
- </doc>
- </field>
-
- <!-- RG changed name from filter to arguments on basic.consume: this is inline with qpid0-8 and 0-10 and has no effect on the wire level encoding
- <field name = "arguments" domain = "table" label = "arguments for consuming"> -->
- <field name = "arguments" domain = "table" label = "arguments for consuming">
- <doc>
- A set of filters for the consume. The syntax and semantics
- of these filters depends on the providers implementation.
- </doc>
- </field>
- </method>
-
- <method name = "consume-ok" synchronous = "1" index = "21" label = "confirm a new consumer">
- <doc>
- The server provides the client with a consumer tag, which is used by the client
- for methods called on the consumer at a later stage.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Holds the consumer tag specified by the client or provided by the server.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "cancel" synchronous = "1" index = "30" label = "end a queue consumer">
- <doc>
- This method cancels a consumer. This does not affect already delivered
- messages, but it does mean the server will not send any more messages for
- that consumer. The client may receive an arbitrary number of messages in
- between sending the cancel method and receiving the cancel-ok reply.
- </doc>
-
- <rule name = "01">
- <doc>
- If the queue does not exist the server MUST ignore the cancel method, so
- long as the consumer tag is valid for that channel.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "cancel-ok" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "cancel-ok" synchronous = "1" index = "31" label = "confirm a cancelled consumer">
- <doc>
- This method confirms that the cancellation was completed.
- </doc>
- <chassis name = "client" implement = "MUST" />
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "publish" content = "1" index = "40" label = "publish a message">
- <doc>
- This method publishes a message to a specific exchange. The message will be routed
- to queues as defined by the exchange configuration and distributed to any active
- consumers when the transaction, if any, is committed.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "write" access rights
- to the access realm for the exchange.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be
- empty, meaning the default exchange. If the exchange name is specified, and that
- exchange does not exist, the server will raise a channel exception.
- </doc>
-
- <!-- Rule test name: was "amq_basic_06" -->
- <rule name = "01">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_14" -->
- <rule name = "02">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST raise
- a channel exception with a reply code 403 (access refused).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_15" -->
- <rule name = "03">
- <doc>
- The exchange MAY refuse basic content in which case it MUST raise a channel
- exception with reply code 540 (not implemented).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing
- messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" domain = "bit" label = "indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue. If this flag is set, the server will return an unroutable message with a
- Return method. If this flag is zero, the server silently drops the message.
- </doc>
- <!-- Rule test name: was "amq_basic_07" -->
- <rule name = "01">
- <doc>
- The server SHOULD implement the mandatory flag.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "immediate" domain = "bit" label = "request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue consumer immediately. If this flag is set, the server will return an
- undeliverable message with a Return method. If this flag is zero, the server
- will queue the message, but with no guarantee that it will ever be consumed.
- </doc>
- <!-- Rule test name: was "amq_basic_16" -->
- <rule name = "01">
- <doc>
- The server SHOULD implement the immediate flag.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "return" content = "1" index = "50" label = "return a failed message">
- <doc>
- This method returns an undeliverable message that was published with the "immediate"
- flag set, or an unroutable message published with the "mandatory" flag set. The
- reply code and text provide information about the reason that the message was
- undeliverable.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply-code" domain = "reply-code" />
-
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key name specified when the message was published.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "deliver" content = "1" index = "60"
- label = "notify the client of a consumer message">
- <doc>
- This method delivers a message to the client, via a consumer. In the asynchronous
- message delivery model, the client starts a consumer using the Consume method, then
- the server responds with Deliver methods as and when messages arrive for that
- consumer.
- </doc>
-
- <!-- Rule test name: was "amq_basic_19" -->
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server SHOULD track the number of times a message has been delivered to
- clients and when a message is redelivered a certain number of times - e.g. 5
- times - without being acknowledged, the server SHOULD consider the message to be
- unprocessable (possibly causing client applications to abort), and move the
- message to a dead letter queue.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "get" synchronous = "1" index = "70" label = "direct access to a queue">
- <doc>
- This method provides a direct access to the messages in a queue using a synchronous
- dialogue that is designed for specific types of application where synchronous
- functionality is more important than performance.
- </doc>
-
- <response name = "get-ok" />
- <response name = "get-empty" />
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
-
- <field name = "no-ack" domain = "no-ack" />
- </method>
-
- <method name = "get-ok" synchronous = "1" content = "1" index = "71"
- label = "provide client with a message">
- <doc>
- This method delivers a message to the client following a get method. A message
- delivered by 'get-ok' must be acknowledged unless the no-ack option was set in the
- get method.
- </doc>
-
- <chassis name = "client" implement = "MAY" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- If empty, the message was published to the default exchange.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
-
- <field name = "message-count" domain = "long" label = "number of messages pending">
- <doc>
- This field reports the number of messages pending on the queue, excluding the
- message being delivered. Note that this figure is indicative, not reliable, and
- can change arbitrarily as messages are added to the queue and removed by other
- clients.
- </doc>
- </field>
- </method>
-
- <method name = "get-empty" synchronous = "1" index = "72"
- label = "indicate no messages available">
- <doc>
- This method tells the client that the queue has no messages available for the
- client.
- </doc>
-
- <chassis name = "client" implement = "MAY" />
-
- <!-- This field is deprecated pending review -->
- <field name = "cluster-id" domain = "shortstr" label = "Cluster id">
- <doc>
- For use by cluster applications, should not be used by client applications.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "ack" index = "80" label = "acknowledge one or more messages">
- <doc>
- This method acknowledges one or more messages delivered via the Deliver or Get-Ok
- methods. The client can ask to confirm a single message or a set of messages up to
- and including a specific message.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "multiple" domain = "bit" label = "acknowledge multiple messages">
- <doc>
- If set to 1, the delivery tag is treated as "up to and including", so that the
- client can acknowledge multiple messages with a single method. If set to zero,
- the delivery tag refers to a single message. If the multiple field is 1, and the
- delivery tag is zero, tells the server to acknowledge all outstanding messages.
- </doc>
-
- <!-- Rule test name: was "amq_basic_20" -->
- <rule name = "01">
- <doc>
- The server MUST validate that a non-zero delivery-tag refers to an delivered
- message, and raise a channel exception if this is not the case.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "reject" index = "90" label = "reject an incoming message">
- <doc>
- This method allows a client to reject a message. It can be used to interrupt and
- cancel large incoming messages, or return untreatable messages to their original
- queue.
- </doc>
-
- <!-- Rule test name: was "amq_basic_21" -->
- <rule name = "01">
- <doc>
- The server SHOULD be capable of accepting and process the Reject method while
- sending message content with a Deliver or Get-Ok method. I.e. the server should
- read and process incoming methods while sending output frames. To cancel a
- partially-send content, the server sends a content body frame of size 1 (i.e.
- with no data except the frame-end octet).
- </doc>
- </rule>
-
- <!-- Rule test name: was "amq_basic_22" -->
- <rule name = "02">
- <doc>
- The server SHOULD interpret this method as meaning that the client is unable to
- process the message at this time.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <rule name = "03">
- <!-- TODO: Rule split? -->
- <doc>
- A client MUST NOT use this method as a means of selecting messages to process. A
- rejected message MAY be discarded or dead-lettered, not necessarily passed to
- another client.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "requeue" domain = "bit" label = "requeue the message">
- <doc>
- If this field is zero, the message will be discarded. If this bit is 1, the
- server will attempt to requeue the message.
- </doc>
-
- <!-- Rule test name: was "amq_basic_23" -->
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MUST NOT deliver the message to the same client within the
- context of the current channel. The recommended strategy is to attempt to
- deliver the message to an alternative consumer, and if that is not possible,
- to move the message to a dead-letter queue. The server MAY use more
- sophisticated tracking to hold the message on the queue and redeliver it to
- the same client at a later stage.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "recover" index = "100" label = "redeliver unacknowledged messages">
- <doc>
- This method asks the broker to redeliver all unacknowledged messages on a specified
- channel. Zero or more messages may be redelivered. This method is only allowed on
- non-transacted channels.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST set the redelivered flag on all messages that are resent.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- The server MUST raise a channel exception if this is called on a transacted
- channel.
- </doc>
- <doc type = "scenario">
- TODO.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "requeue" domain = "bit" label = "requeue the message">
- <doc>
- If this field is zero, the message will be redelivered to the original
- recipient. If this bit is 1, the server will attempt to requeue the message,
- potentially then delivering it to an alternative subscriber.
- </doc>
- </field>
- </method>
-
-
- <!-- RG : Added recover-sync and recover-sync-ok to give a synchronous recover without interfering with the correct 0-9 recover method -->
- <method name = "recover-sync" index = "102">
- redeliver unacknowledged messages
- <doc>
- This method asks the broker to redeliver all unacknowledged messages on a
- specified channel. Zero or more messages may be redelivered. This method
- is only allowed on non-transacted channels.
- </doc>
- <chassis name = "server" implement = "MUST" />
-
- <field name = "requeue" type = "bit">
- requeue the message
- <doc>
- If this field is zero, the message will be redelivered to the original
- recipient. If this bit is 1, the server will attempt to requeue the
- message, potentially then delivering it to an alternative subscriber.
- </doc>
- </field>
- <doc name="rule">
- The server MUST set the redelivered flag on all messages that are resent.
- </doc>
- <doc name="rule">
- The server MUST raise a channel exception if this is called on a
- transacted channel.
- </doc>
- <response name="recover-sync-ok"/>
- </method>
- <method name="recover-sync-ok" synchronous="1" index="101">
- confirm a successful recover
- <doc>
- This method confirms to the client that the recover succeeded.
- Note that if an recover fails, the server raises a channel exception.
- </doc>
- <chassis name="client" implement="MUST"/>
- </method>
-
-
- </class>
-
- <!-- == FILE ============================================================= -->
-
- <class name = "file" handler = "channel" index = "70" label = "work with file content">
- <doc>
- The file class provides methods that support reliable file transfer. File
- messages have a specific set of properties that are required for interoperability
- with file transfer applications. File messages and acknowledgements are subject to
- channel transactions. Note that the file class does not provide message browsing
- methods; these are not compatible with the staging model. Applications that need
- browsable file transfer should use Basic content and the Basic class.
- </doc>
-
- <doc type = "grammar">
- file = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:OPEN S:OPEN-OK C:STAGE content
- / S:OPEN C:OPEN-OK S:STAGE content
- / C:PUBLISH
- / S:DELIVER
- / S:RETURN
- / C:ACK
- / C:REJECT
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <rule name = "01">
- <doc>
- The server MUST make a best-effort to hold file messages on a reliable storage
- mechanism.
- </doc>
- </rule>
-
- <!-- TODO Rule implement attr inverse? -->
-
- <!-- TODO: Rule split? -->
-
- <rule name = "02">
- <doc>
- The server MUST NOT discard a file message in case of a queue overflow. The server
- MUST use the Channel.Flow method to slow or stop a file message publisher when
- necessary.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "03">
- <doc>
- The server MUST implement at least 2 priority levels for file messages, where
- priorities 0-4 and 5-9 are treated as two distinct levels. The server MAY implement
- up to 10 priority levels.
- </doc>
- </rule>
-
- <rule name = "04">
- <doc>
- The server MUST support both automatic and explicit acknowledgements on file
- content.
- </doc>
- </rule>
-
- <!-- These are the properties for a File content -->
-
- <field name = "content-type" domain = "shortstr" label = "MIME content type" />
- <field name = "content-encoding" domain = "shortstr" label = "MIME content encoding" />
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "priority" domain = "octet" label = "message priority, 0 to 9" />
- <field name = "reply-to" domain = "shortstr" label = "destination to reply to" />
- <field name = "message-id" domain = "shortstr" label = "application message identifier" />
- <field name = "filename" domain = "shortstr" label = "message filename" />
- <field name = "timestamp" domain = "timestamp" label = "message timestamp" />
- <!-- This field is deprecated pending review -->
- <field name = "cluster-id" domain = "shortstr" label = "intra-cluster routing identifier" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "qos" synchronous = "1" index = "10" label = "specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the
- current channel or for all channels on the connection. The particular properties and
- semantics of a qos method always depend on the content class semantics. Though the
- qos method could in principle apply to both peers, it is currently meaningful only
- for the server.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "qos-ok" />
-
- <field name = "prefetch-size" domain = "long" label = "prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client
- finishes processing a message, the following message is already held locally,
- rather than needing to be sent down the channel. Prefetching gives a performance
- improvement. This field specifies the prefetch window size in octets. May be set
- to zero, meaning "no specific limit". Note that other prefetch limits may still
- apply. The prefetch-size is ignored if the no-ack option is set.
- </doc>
- </field>
-
- <field name = "prefetch-count" domain = "short" label = "prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This is compatible with
- some file API implementations. This field may be used in combination with the
- prefetch-size field; a message will only be sent in advance if both prefetch
- windows (and those at the channel and connection level) allow it. The
- prefetch-count is ignored if the no-ack option is set.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MAY send less data in advance than allowed by the client's
- specified prefetch windows but it MUST NOT send more.
- </doc>
- </rule>
- </field>
-
- <field name = "global" domain = "bit" label = "apply to entire connection">
- <doc>
- By default the QoS settings apply to the current channel only. If this field is
- set, they are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <method name = "qos-ok" synchronous = "1" index = "11" label = "confirm the requested qos">
- <doc>
- This method tells the client that the requested QoS levels could be handled by the
- server. The requested QoS applies to all active consumers until a new QoS is
- defined.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "consume" synchronous = "1" index = "20" label = "start a queue consumer">
- <doc>
- This method asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the channel they were
- created on, or until the client cancels them.
- </doc>
-
- <rule name = "01">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was
- declared as private, and ideally, impose no limit except as defined by available
- resources.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a
- connection, so two clients can use the same consumer tags. If this field is
- empty the server will generate a unique tag.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to
- create two consumers with the same non-empty tag the server MUST raise a
- connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "no-local" domain = "no-local" />
-
- <field name = "no-ack" domain = "no-ack" />
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the
- queue.
- </doc>
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, -
- because there are other consumers active - it MUST raise a channel exception
- with return code 405 (resource locked).
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
-
- <field name = "filter" domain = "table" label = "arguments for consuming">
- <doc>
- A set of filters for the consume. The syntax and semantics
- of these filters depends on the providers implementation.
- </doc>
- </field>
- </method>
-
- <method name = "consume-ok" synchronous = "1" index = "21" label = "confirm a new consumer">
- <doc>
- This method provides the client with a consumer tag which it MUST use in methods
- that work with the consumer.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>Holds the consumer tag specified by the client or provided by the server.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "cancel" synchronous = "1" index = "30" label = "end a queue consumer">
- <doc>
- This method cancels a consumer. This does not affect already delivered messages, but
- it does mean the server will not send any more messages for that consumer.
- </doc>
-
- <response name = "cancel-ok" />
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "cancel-ok" synchronous = "1" index = "31" label = "confirm a cancelled consumer">
- <doc>This method confirms that the cancellation was completed.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "open" synchronous = "1" index = "40" label = "request to start staging">
- <doc>
- This method requests permission to start staging a message. Staging means sending
- the message into a temporary area at the recipient end and then delivering the
- message by referring to this temporary area. Staging is how the protocol handles
- partial file transfers - if a message is partially staged and the connection breaks,
- the next time the sender starts to stage it, it can restart from where it left off.
- </doc>
-
- <response name = "open-ok" />
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "identifier" domain = "shortstr" label = "staging identifier">
- <doc>
- This is the staging identifier. This is an arbitrary string chosen by the
- sender. For staging to work correctly the sender must use the same staging
- identifier when staging the same message a second time after recovery from a
- failure. A good choice for the staging identifier would be the SHA1 hash of the
- message properties data (including the original filename, revised time, etc.).
- </doc>
- </field>
-
- <field name = "content-size" domain = "longlong" label = "message content size">
- <doc>
- The size of the content in octets. The recipient may use this information to
- allocate or check available space in advance, to avoid "disk full" errors during
- staging of very large messages.
- </doc>
-
- <rule name = "01">
- <doc>
- The sender MUST accurately fill the content-size field. Zero-length content
- is permitted.
- </doc>
- </rule>
- </field>
- </method>
-
- <method name = "open-ok" synchronous = "1" index = "41" label = "confirm staging ready">
- <doc>
- This method confirms that the recipient is ready to accept staged data. If the
- message was already partially-staged at a previous time the recipient will report
- the number of octets already staged.
- </doc>
-
- <response name = "stage" />
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <field name = "staged-size" domain = "longlong" label = "already staged amount">
- <doc>
- The amount of previously-staged content in octets. For a new message this will
- be zero.
- </doc>
-
- <rule name = "01">
- <doc>
- The sender MUST start sending data from this octet offset in the message,
- counting from zero.
- </doc>
- </rule>
-
- <rule name = "02">
- <!-- TODO: Rule split? -->
- <doc>
- The recipient MAY decide how long to hold partially-staged content and MAY
- implement staging by always discarding partially-staged content. However if
- it uses the file content type it MUST support the staging methods.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "stage" content = "1" index = "50" label = "stage message content">
- <doc>
- This method stages the message, sending the message content to the recipient from
- the octet offset specified in the Open-Ok method.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "publish" index = "60" label = "publish a message">
- <doc>
- This method publishes a staged file message to a specific exchange. The file message
- will be routed to queues as defined by the exchange configuration and distributed to
- any active consumers when the transaction, if any, is committed.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "write" access rights
- to the access realm for the exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be
- empty, meaning the default exchange. If the exchange name is specified, and that
- exchange does not exist, the server will raise a channel exception.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST
- respond with a reply code 403 (access refused) and raise a channel
- exception.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "03">
- <doc>
- The exchange MAY refuse file content in which case it MUST respond with a
- reply code 540 (not implemented) and raise a channel exception.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing
- messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" domain = "bit" label = "indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue. If this flag is set, the server will return an unroutable message with a
- Return method. If this flag is zero, the server silently drops the message.
- </doc>
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the mandatory flag.</doc>
- </rule>
- </field>
-
- <field name = "immediate" domain = "bit" label = "request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue consumer immediately. If this flag is set, the server will return an
- undeliverable message with a Return method. If this flag is zero, the server
- will queue the message, but with no guarantee that it will ever be consumed.
- </doc>
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the immediate flag.</doc>
- </rule>
- </field>
-
- <field name = "identifier" domain = "shortstr" label = "staging identifier">
- <doc>
- This is the staging identifier of the message to publish. The message must have
- been staged. Note that a client can send the Publish method asynchronously
- without waiting for staging to finish.
- </doc>
- </field>
- </method>
-
- <method name = "return" content = "1" index = "70" label = "return a failed message">
- <doc>
- This method returns an undeliverable message that was published with the "immediate"
- flag set, or an unroutable message published with the "mandatory" flag set. The
- reply code and text provide information about the reason that the message was
- undeliverable.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply-code" domain = "reply-code" />
-
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "deliver" index = "80" label = "notify the client of a consumer message">
- <doc>
- This method delivers a staged file message to the client, via a consumer. In the
- asynchronous message delivery model, the client starts a consumer using the Consume
- method, then the server responds with Deliver methods as and when messages arrive
- for that consumer.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server SHOULD track the number of times a message has been delivered to
- clients and when a message is redelivered a certain number of times - e.g. 5
- times - without being acknowledged, the server SHOULD consider the message to be
- unprocessable (possibly causing client applications to abort), and move the
- message to a dead letter queue.
- </doc>
- </rule>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
-
- <field name = "identifier" domain = "shortstr" label = "staging identifier">
- <doc>
- This is the staging identifier of the message to deliver. The message must have
- been staged. Note that a server can send the Deliver method asynchronously
- without waiting for staging to finish.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "ack" index = "90" label = "acknowledge one or more messages">
- <doc>
- This method acknowledges one or more messages delivered via the Deliver method. The
- client can ask to confirm a single message or a set of messages up to and including
- a specific message.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "multiple" domain = "bit" label = "acknowledge multiple messages">
- <doc>
- If set to 1, the delivery tag is treated as "up to and including", so that the
- client can acknowledge multiple messages with a single method. If set to zero,
- the delivery tag refers to a single message. If the multiple field is 1, and the
- delivery tag is zero, tells the server to acknowledge all outstanding messages.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST validate that a non-zero delivery-tag refers to an delivered
- message, and raise a channel exception if this is not the case.
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "reject" index = "100" label = "reject an incoming message">
- <doc>
- This method allows a client to reject a message. It can be used to return
- untreatable messages to their original queue. Note that file content is staged
- before delivery, so the client will not use this method to interrupt delivery of a
- large message.
- </doc>
-
- <rule name = "01">
- <doc>
- The server SHOULD interpret this method as meaning that the client is unable to
- process the message at this time.
- </doc>
- </rule>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "02">
- <doc>
- A client MUST NOT use this method as a means of selecting messages to process. A
- rejected message MAY be discarded or dead-lettered, not necessarily passed to
- another client.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "requeue" domain = "bit" label = "requeue the message">
- <doc>
- If this field is zero, the message will be discarded. If this bit is 1, the
- server will attempt to requeue the message.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MUST NOT deliver the message to the same client within the
- context of the current channel. The recommended strategy is to attempt to
- deliver the message to an alternative consumer, and if that is not possible,
- to move the message to a dead-letter queue. The server MAY use more
- sophisticated tracking to hold the message on the queue and redeliver it to
- the same client at a later stage.
- </doc>
- </rule>
- </field>
- </method>
- </class>
-
- <!-- == STREAM =========================================================== -->
-
- <class name = "stream" handler = "channel" index = "80" label = "work with streaming content">
- <doc>
- The stream class provides methods that support multimedia streaming. The stream class
- uses the following semantics: one message is one packet of data; delivery is
- unacknowledged and unreliable; the consumer can specify quality of service parameters
- that the server can try to adhere to; lower-priority messages may be discarded in favour
- of high priority messages.
- </doc>
-
- <doc type = "grammar">
- stream = C:QOS S:QOS-OK
- / C:CONSUME S:CONSUME-OK
- / C:CANCEL S:CANCEL-OK
- / C:PUBLISH content
- / S:RETURN
- / S:DELIVER content
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <rule name = "01">
- <doc>
- The server SHOULD discard stream messages on a priority basis if the queue size
- exceeds some configured limit.
- </doc>
- </rule>
-
- <rule name = "02">
- <!-- TODO: Rule split? -->
- <doc>
- The server MUST implement at least 2 priority levels for stream messages, where
- priorities 0-4 and 5-9 are treated as two distinct levels. The server MAY implement
- up to 10 priority levels.
- </doc>
- </rule>
-
- <rule name = "03">
- <doc>
- The server MUST implement automatic acknowledgements on stream content. That is, as
- soon as a message is delivered to a client via a Deliver method, the server must
- remove it from the queue.
- </doc>
- </rule>
-
- <!-- These are the properties for a Stream content -->
-
- <field name = "content-type" domain = "shortstr" label = "MIME content type" />
- <field name = "content-encoding" domain = "shortstr" label = "MIME content encoding" />
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "priority" domain = "octet" label = "message priority, 0 to 9" />
- <field name = "timestamp" domain = "timestamp" label = "message timestamp" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "qos" synchronous = "1" index = "10" label = "specify quality of service">
- <doc>
- This method requests a specific quality of service. The QoS can be specified for the
- current channel or for all channels on the connection. The particular properties and
- semantics of a qos method always depend on the content class semantics. Though the
- qos method could in principle apply to both peers, it is currently meaningful only
- for the server.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "qos-ok" />
-
- <field name = "prefetch-size" domain = "long" label = "prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client
- finishes processing a message, the following message is already held locally,
- rather than needing to be sent down the channel. Prefetching gives a performance
- improvement. This field specifies the prefetch window size in octets. May be set
- to zero, meaning "no specific limit". Note that other prefetch limits may still
- apply.
- </doc>
- </field>
-
- <field name = "prefetch-count" domain = "short" label = "prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This field may be used
- in combination with the prefetch-size field; a message will only be sent in
- advance if both prefetch windows (and those at the channel and connection level)
- allow it.
- </doc>
- </field>
-
- <field name = "consume-rate" domain = "long" label = "transfer rate in octets/second">
- <doc>
- Specifies a desired transfer rate in octets per second. This is usually
- determined by the application that uses the streaming data. A value of zero
- means "no limit", i.e. as rapidly as possible.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The server MAY ignore the prefetch values and consume rates, depending on
- the type of stream and the ability of the server to queue and/or reply it.
- The server MAY drop low-priority messages in favour of high-priority
- messages.
- </doc>
- </rule>
- </field>
-
- <field name = "global" domain = "bit" label = "apply to entire connection">
- <doc>
- By default the QoS settings apply to the current channel only. If this field is
- set, they are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <method name = "qos-ok" synchronous = "1" index = "11" label = "confirm the requested qos">
- <doc>
- This method tells the client that the requested QoS levels could be handled by the
- server. The requested QoS applies to all active consumers until a new QoS is
- defined.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "consume" synchronous = "1" index = "20" label = "start a queue consumer">
- <doc>
- This method asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the channel they were
- created on, or until the client cancels them.
- </doc>
-
- <rule name = "01">
- <doc>
- The server SHOULD support at least 16 consumers per queue, unless the queue was
- declared as private, and ideally, impose no limit except as defined by available
- resources.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- Streaming applications SHOULD use different channels to select different
- streaming resolutions. AMQP makes no provision for filtering and/or transforming
- streams except on the basis of priority-based selective delivery of individual
- messages.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "consume-ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
-
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>
- Specifies the identifier for the consumer. The consumer tag is local to a
- connection, so two clients can use the same consumer tags. If this field is
- empty the server will generate a unique tag.
- </doc>
-
- <rule name = "01">
- <!-- TODO: Rule split? -->
- <doc>
- The tag MUST NOT refer to an existing consumer. If the client attempts to
- create two consumers with the same non-empty tag the server MUST raise a
- connection exception with reply code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "no-local" domain = "no-local" />
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the
- queue.
- </doc>
-
-
- <!-- Rule test name: was "amq_file_00" -->
- <rule name = "01">
- <doc>
- If the server cannot grant exclusive access to the queue when asked, -
- because there are other consumers active - it MUST raise a channel exception
- with return code 405 (resource locked).
- </doc>
- </rule>
- </field>
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
-
- <field name = "filter" domain = "table" label = "arguments for consuming">
- <doc>
- A set of filters for the consume. The syntax and semantics
- of these filters depends on the providers implementation.
- </doc>
- </field>
- </method>
-
- <method name = "consume-ok" synchronous = "1" index = "21" label = "confirm a new consumer">
- <doc>
- This method provides the client with a consumer tag which it may use in methods that
- work with the consumer.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag">
- <doc>Holds the consumer tag specified by the client or provided by the server.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "cancel" synchronous = "1" index = "30" label = "end a queue consumer">
- <doc>
- This method cancels a consumer. Since message delivery is asynchronous the client
- may continue to receive messages for a short while after cancelling a consumer. It
- may process or discard these as appropriate.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <response name = "cancel-ok" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "nowait" domain = "bit" label = "do not send a reply method">
- <doc>
- If set, the server will not respond to the method. The client should not wait
- for a reply method. If the server could not complete the method it will raise a
- channel or connection exception.
- </doc>
- </field>
- </method>
-
- <method name = "cancel-ok" synchronous = "1" index = "31" label = "confirm a cancelled consumer">
- <doc>This method confirms that the cancellation was completed.</doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "publish" content = "1" index = "40" label = "publish a message">
- <doc>
- This method publishes a message to a specific exchange. The message will be routed
- to queues as defined by the exchange configuration and distributed to any active
- consumers as appropriate.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "write" access rights
- to the access realm for the exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange to publish to. The exchange name can be
- empty, meaning the default exchange. If the exchange name is specified, and that
- exchange does not exist, the server will raise a channel exception.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST accept a blank exchange name to mean the default exchange.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- If the exchange was declared as an internal exchange, the server MUST
- respond with a reply code 403 (access refused) and raise a channel
- exception.
- </doc>
- </rule>
-
- <rule name = "03">
- <doc>
- The exchange MAY refuse stream content in which case it MUST respond with a
- reply code 540 (not implemented) and raise a channel exception.
- </doc>
- </rule>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>
- Specifies the routing key for the message. The routing key is used for routing
- messages depending on the exchange configuration.
- </doc>
- </field>
-
- <field name = "mandatory" domain = "bit" label = "indicate mandatory routing">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue. If this flag is set, the server will return an unroutable message with a
- Return method. If this flag is zero, the server silently drops the message.
- </doc>
-
- <!-- Rule test name: was "amq_stream_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the mandatory flag.</doc>
- </rule>
- </field>
-
- <field name = "immediate" domain = "bit" label = "request immediate delivery">
- <doc>
- This flag tells the server how to react if the message cannot be routed to a
- queue consumer immediately. If this flag is set, the server will return an
- undeliverable message with a Return method. If this flag is zero, the server
- will queue the message, but with no guarantee that it will ever be consumed.
- </doc>
-
- <!-- Rule test name: was "amq_stream_00" -->
- <rule name = "01">
- <doc>The server SHOULD implement the immediate flag.</doc>
- </rule>
- </field>
- </method>
-
- <method name = "return" content = "1" index = "50" label = "return a failed message">
- <doc>
- This method returns an undeliverable message that was published with the "immediate"
- flag set, or an unroutable message published with the "mandatory" flag set. The
- reply code and text provide information about the reason that the message was
- undeliverable.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "reply-code" domain = "reply-code" />
-
- <field name = "reply-text" domain = "reply-text" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "routing-key" domain = "shortstr" label = "Message routing key">
- <doc>Specifies the routing key name specified when the message was published.</doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "deliver" content = "1" index = "60"
- label = "notify the client of a consumer message">
- <doc>
- This method delivers a message to the client, via a consumer. In the asynchronous
- message delivery model, the client starts a consumer using the Consume method, then
- the server responds with Deliver methods as and when messages arrive for that
- consumer.
- </doc>
-
- <chassis name = "client" implement = "MUST" />
-
- <field name = "consumer-tag" domain = "consumer-tag" />
-
- <field name = "delivery-tag" domain = "delivery-tag" />
-
- <field name = "exchange" domain = "exchange-name">
- <doc>
- Specifies the name of the exchange that the message was originally published to.
- </doc>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue that the message came from. Note that a single
- channel can start many consumers on different queues.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
- </class>
-
- <!-- == TX =============================================================== -->
-
- <class name = "tx" handler = "channel" index = "90" label = "work with standard transactions">
- <doc>
- Standard transactions provide so-called "1.5 phase commit". We can ensure that work is
- never lost, but there is a chance of confirmations being lost, so that messages may be
- resent. Applications that use standard transactions must be able to detect and ignore
- duplicate messages.
- </doc>
-
- <!-- TODO: Rule split? -->
-
- <rule name = "01">
- <doc>
- An client using standard transactions SHOULD be able to track all messages received
- within a reasonable period, and thus detect and reject duplicates of the same
- message. It SHOULD NOT pass these to the application layer.
- </doc>
- </rule>
-
- <doc type = "grammar">
- tx = C:SELECT S:SELECT-OK
- / C:COMMIT S:COMMIT-OK
- / C:ROLLBACK S:ROLLBACK-OK
- </doc>
-
- <chassis name = "server" implement = "SHOULD" />
- <chassis name = "client" implement = "MAY" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "select" synchronous = "1" index = "10" label = "select standard transaction mode">
- <doc>
- This method sets the channel to use standard transactions. The client must use this
- method at least once on a channel before using the Commit or Rollback methods.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "select-ok" />
- </method>
-
- <method name = "select-ok" synchronous = "1" index = "11" label = "confirm transaction mode">
- <doc>
- This method confirms to the client that the channel was successfully set to use
- standard transactions.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "commit" synchronous = "1" index = "20" label = "commit the current transaction">
- <doc>
- This method commits all messages published and acknowledged in the current
- transaction. A new transaction starts immediately after a commit.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "commit-ok" />
- </method>
-
- <method name = "commit-ok" synchronous = "1" index = "21" label = "confirm a successful commit">
- <doc>
- This method confirms to the client that the commit succeeded. Note that if a commit
- fails, the server raises a channel exception.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "rollback" synchronous = "1" index = "30"
- label = "abandon the current transaction">
- <doc>
- This method abandons all messages published and acknowledged in the current
- transaction. A new transaction starts immediately after a rollback.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "rollback-ok" />
- </method>
-
- <method name = "rollback-ok" synchronous = "1" index = "31" label = "confirm successful rollback">
- <doc>
- This method confirms to the client that the rollback succeeded. Note that if an
- rollback fails, the server raises a channel exception.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
- </class>
-
- <!-- == DTX ============================================================== -->
-
- <class name = "dtx" handler = "channel" index = "100" label = "work with distributed transactions">
- <doc>
- Distributed transactions provide so-called "2-phase commit". The AMQP distributed
- transaction model supports the X-Open XA architecture and other distributed transaction
- implementations. The Dtx class assumes that the server has a private communications
- channel (not AMQP) to a distributed transaction coordinator.
- </doc>
-
- <doc type = "grammar">
- dtx = C:SELECT S:SELECT-OK
- C:START S:START-OK
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "select" synchronous = "1" index = "10" label = "select standard transaction mode">
- <doc>
- This method sets the channel to use distributed transactions. The client must use
- this method at least once on a channel before using the Start method.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <response name = "select-ok" />
- </method>
-
- <method name = "select-ok" synchronous = "1" index = "11" label = "confirm transaction mode">
- <doc>
- This method confirms to the client that the channel was successfully set to use
- distributed transactions.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "start" synchronous = "1" index = "20"
- label = "start a new distributed transaction">
- <doc>
- This method starts a new distributed transaction. This must be the first method on a
- new channel that uses the distributed transaction mode, before any methods that
- publish or consume messages.
- </doc>
- <chassis name = "server" implement = "MAY" />
- <response name = "start-ok" />
- <field name = "dtx-identifier" domain = "shortstr" label = "transaction identifier">
- <doc>
- The distributed transaction key. This identifies the transaction so that the
- AMQP server can coordinate with the distributed transaction coordinator.
- </doc>
- <assert check = "notnull" />
- </field>
- </method>
-
- <method name = "start-ok" synchronous = "1" index = "21"
- label = "confirm the start of a new distributed transaction">
- <doc>
- This method confirms to the client that the transaction started. Note that if a
- start fails, the server raises a channel exception.
- </doc>
- <chassis name = "client" implement = "MUST" />
- </method>
- </class>
-
- <!-- == TUNNEL =========================================================== -->
-
- <class name = "tunnel" handler = "tunnel" index = "110" label = "methods for protocol tunnelling">
- <doc>
- The tunnel methods are used to send blocks of binary data - which can be serialised AMQP
- methods or other protocol frames - between AMQP peers.
- </doc>
-
- <doc type = "grammar">
- tunnel = C:REQUEST
- / S:REQUEST
- </doc>
-
- <chassis name = "server" implement = "MAY" />
- <chassis name = "client" implement = "MAY" />
-
- <field name = "headers" domain = "table" label = "message header field table" />
- <field name = "proxy-name" domain = "shortstr" label = "identity of tunnelling proxy" />
- <field name = "data-name" domain = "shortstr" label = "name or type of message being tunnelled" />
- <field name = "durable" domain = "octet" label = "message durability indicator" />
- <field name = "broadcast" domain = "octet" label = "message broadcast mode" />
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "request" content = "1" index = "10" label = "sends a tunnelled method">
- <doc>
- This method tunnels a block of binary data, which can be an encoded
- AMQP method or other data. The binary data is sent as the content for
- the Tunnel.Request method.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <field name = "meta-data" domain = "table" label = "meta data for the tunnelled block">
- <doc>
- This field table holds arbitrary meta-data that the sender needs to
- pass to the recipient.
- </doc>
- </field>
- </method>
- </class>
-
- <!-- == MESSAGE ============================================================ -->
-
- <class name = "message" index = "120" handler = "channel" label = "[WORK IN PROGRESS] message transfer">
- <doc>
- [WORK IN PROGRESS] The message class provides methods that support an industry-standard messaging model.
- </doc>
-
- <doc type = "grammar">
- message = C:QOS S:OK
- / C:CONSUME S:OK
- / C:CANCEL S:OK
- / C:TRANSFER ( S:OK / S:REJECT )
- / S:TRANSFER ( C:OK / C:REJECT )
- / C:GET ( S:OK / S:EMPTY )
- / C:RECOVER S:OK
- / C:OPEN S:OK
- / S:OPEN C:OK
- / C:APPEND S:OK
- / S:APPEND C:OK
- / C:CLOSE S:OK
- / S:CLOSE C:OK
- / C:CHECKPOINT S:OK
- / S:CHECKPOINT C:OK
- / C:RESUME S:OFFSET
- / S:RESUME C:OFFSET
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <rule name = "01">
- <doc>
- The server SHOULD respect the persistent property of messages
- and SHOULD make a best-effort to hold persistent mess ages on
- a reliable storage mechanism.
- </doc>
- <doc type = "scenario">
- Send a persistent message to queue, stop server, restart
- server and then verify whether message is still present.
- Assumes that queues are durable. Persistence without durable
- queues makes no sense.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- The server MUST NOT discard a persistent message in case of a
- queue overflow.
- </doc>
- <doc type = "scenario">
- Create a queue overflow situation with persistent messages and
- verify that messages do not get lost (presumably the server
- will write them to disk).
- </doc>
- </rule>
-
- <rule name = "03">
- <doc>
- The server MAY use the Channel.Flow method to slow or stop a
- message publisher when necessary.
- </doc>
- <doc type = "scenario">
- Create a queue overflow situation with non-persistent messages
- and verify whether the server responds with Channel.Flow or
- not. Repeat with persistent messages.
- </doc>
- </rule>
-
- <rule name = "04">
- <doc>
- The server MAY overflow non-persistent messages to persistent
- storage.
- </doc>
- </rule>
-
- <rule name = "05">
- <doc>
- The server MAY discard or dead-letter non-persistent messages
- on a priority basis if the queue size exceeds some configured
- limit.
- </doc>
- </rule>
-
- <rule name = "06">
- <doc>
- The server MUST implement at least 2 priority levels for
- messages, where priorities 0-4 and 5-9 are treated as two
- distinct levels.
- </doc>
- <doc type = "scenario">
- Send a number of priority 0 messages to a queue. Send one
- priority 9 message. Consume messages from the queue and verify
- that the first message received was priority 9.
- </doc>
- </rule>
-
- <rule name = "07">
- <doc>
- The server MAY implement up to 10 priority levels.
- </doc>
- <doc type = "scenario">
- Send a number of messages with mixed priorities to a queue, so
- that all priority values from 0 to 9 are exercised. A good
- scenario would be ten messages in low-to-high priority.
- Consume from queue and verify how many priority levels emerge.
- </doc>
- </rule>
-
- <rule name = "08">
- <doc>
- The server MUST deliver messages of the same priority in order
- irrespective of their individual persistence.
- </doc>
- <doc type = "scenario">
- Send a set of messages with the same priority but different
- persistence settings to a queue. Consume and verify that
- messages arrive in same order as originally published.
- </doc>
- </rule>
-
- <rule name = "09">
- <doc>
- The server MUST support automatic acknowledgements on
- messages, i.e. consumers with the no-ack field set to FALSE.
- </doc>
- <doc type = "scenario">
- Create a queue and a consumer using automatic
- acknowledgements. Publish a set of messages to the queue.
- Consume the messages and verify that all messages are
- received.
- </doc>
- </rule>
-
- <rule name = "10">
- <doc>
- The server MUST support explicit acknowledgements on messages,
- i.e. consumers with the no-ack field set to TRUE.
- </doc>
- <doc type = "scenario">
- Create a queue and a consumer using explicit acknowledgements.
- Publish a set of messages to the queue. Consume the messages
- but acknowledge only half of them. Disconnect and reconnect,
- and consume from the queue. Verify that the remaining messages
- are received.
- </doc>
- </rule>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "transfer" index = "10" label = "[WORK IN PROGRESS] transfer a message">
- <doc>
- [WORK IN PROGRESS] This method transfers a message between two peers. When a
- client uses this method to publish a message to a broker, the
- destination identifies a specific exchange. The message will
- then be routed to queues as defined by the exchange
- configuration and distributed to any active consumers when the
- transaction, if any, is committed.
-
- In the asynchronous message delivery model, the client starts
- a consumer using the Consume method and passing in a
- destination, then the broker responds with transfer methods to
- the specified destination as and when messages arrive for that
- consumer.
-
- If synchronous message delivery is required, the client may
- issue a get request which on success causes a single message
- to be transferred to the specified destination.
-
- Message acknowledgement is signalled by the return result of
- this method.
- </doc>
-
- <rule name = "01">
- <doc>
- The recipient MUST NOT return ok before the message has been
- processed as defined by the QoS settings.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- <response name = "ok" />
- <response name = "reject" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "write" access rights
- to the access realm for the exchange.
- </doc>
- </rule>
- </field>
-
- <field name = "destination" domain = "destination">
- <doc>
- Specifies the destination to which the message is to be
- transferred. The destination can be empty, meaning the
- default exchange or consumer. If the destination is
- specified, and that exchange or consumer does not exist, the
- peer must raise a channel exception.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST accept a blank destination to mean the
- default exchange.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- If the destination refers to an internal exchange, the
- server MUST raise a channel exception with a reply code
- 403 (access refused).
- </doc>
- </rule>
-
- <rule name = "03">
- <doc>
- A destination MAY refuse message content in which case it
- MUST raise a channel exception with reply code 540 (not
- implemented).
- </doc>
- </rule>
- </field>
-
- <field name = "redelivered" domain = "redelivered" />
-
- <field name = "immediate" domain = "bit" label = "request immediate delivery">
- <doc>
- This flag tells the server how to react if the message
- cannot be routed to a queue consumer immediately. If this
- flag is set, the server will reject the message. If this
- flag is zero, the server will queue the message, but with no
- guarantee that it will ever be consumed.
- </doc>
- <rule name = "01">
- <doc>
- The server SHOULD implement the immediate flag.
- </doc>
- </rule>
- </field>
-
- <field name = "ttl" domain = "duration" label = "time to live">
- <doc>
- If this is set to a non zero value then a message expiration
- time will be computed based on the current time plus this
- value. Messages that live longer than their expiration time
- will be discarded (or dead lettered).
- </doc>
- <rule name = "01">
- <doc>
- If a message is transfered between brokers before delivery
- to a final consumer the ttl should be decremented before
- peer to peer transfer and both timestamp and expiration
- should be cleared.
- </doc>
- </rule>
- </field>
-
- <!-- begin headers -->
- <field name = "priority" domain = "octet" label = "message priority, 0 to 9" />
- <field name = "timestamp" domain = "timestamp" label = "message timestamp">
- <doc>
- Set on arrival by the broker.
- </doc>
- </field>
- <field name = "delivery-mode" domain = "octet" label = "non-persistent (1) or persistent (2)" />
- <field name = "expiration" domain = "timestamp" label = "message expiration time">
- <doc>
- The expiration header assigned by the broker. After
- receiving the message the broker sets expiration to the sum
- of the ttl specified in the publish method and the current
- time. (ttl = expiration - timestamp)
- </doc>
- </field>
- <field name = "exchange" domain = "exchange-name" label = "originating exchange" />
- <field name = "routing-key" domain = "shortstr" label = "message routing key" />
- <field name = "message-id" domain = "shortstr" label = "application message identifier" />
- <field name = "correlation-id" domain = "shortstr" label = "application correlation identifier" />
- <field name = "reply-to" domain = "shortstr" label = "destination to reply to" />
- <field name = "content-type" domain = "shortstr" label = "MIME content type" />
- <field name = "content-encoding" domain = "shortstr" label = "MIME content encoding" />
- <field name = "user-id" domain = "shortstr" label = "creating user id" />
- <field name = "app-id" domain = "shortstr" label = "creating application id" />
- <field name = "transaction-id" domain = "shortstr" label = "distributed transaction id" />
- <field name = "security-token" domain = "security-token" />
- <field name = "application-headers" domain = "table" label = "application specific headers table" />
- <!-- end headers -->
-
- <field name = "body" domain = "content" label = "message body" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "consume" index = "20" label = "[WORK IN PROGRESS] start a queue consumer">
- <doc>
- [WORK IN PROGRESS] This method asks the server to start a "consumer", which is a transient request for
- messages from a specific queue. Consumers last as long as the channel they were
- created on, or until the client cancels them.
- </doc>
-
- <rule name = "01">
- <doc>
- The server SHOULD support at least 16 consumers per queue, and ideally, impose
- no limit except as defined by available resources.
- </doc>
- <doc type = "scenario">
- Create a queue and create consumers on that queue until the server closes the
- connection. Verify that the number of consumers created was at least sixteen
- and report the total number.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "ok" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01" on-failure = "access-refused">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer with an invalid (non-zero) access ticket.
- </doc>
- </rule>
- </field>
-
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
- <rule name = "01" on-failure = "not-allowed">
- <doc>
- If the queue name is empty the client MUST have previously declared a
- queue using this channel.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer with an empty queue name and no previously
- declared queue on the channel.
- </doc>
- </rule>
- </field>
-
- <field name = "destination" domain = "destination" label = "incoming message destination">
- <doc>
- Specifies the destination for the consumer. The destination is local to a
- connection, so two clients can use the same destination.
- </doc>
- <rule name = "01" on-failure = "not-allowed">
- <doc>
- The client MUST NOT specify a destination that refers to an existing consumer.
- </doc>
- <doc type = "scenario">
- Attempt to create two consumers with the same non-empty destination.
- </doc>
- </rule>
- <rule name = "02" on-failure = "not-allowed">
- <doc>
- The destination is valid only within the channel from which the
- consumer was created. I.e. a client MUST NOT create a consumer in one
- channel and then use it in another.
- </doc>
- <doc type = "scenario">
- Attempt to create a consumer in one channel, then use in another channel,
- in which consumers have also been created (to test that the server uses
- unique destinations).
- </doc>
- </rule>
- </field>
-
- <field name = "no-local" domain = "no-local" />
-
- <field name = "no-ack" domain = "no-ack" />
-
- <field name = "exclusive" domain = "bit" label = "request exclusive access">
- <doc>
- Request exclusive consumer access, meaning only this consumer can access the
- queue.
- </doc>
-
- <rule name = "01" on-failure = "access-refused">
- <doc>
- The client MAY NOT gain exclusive access to a queue that already has
- active consumers.
- </doc>
- <doc type = "scenario">
- Open two connections to a server, and in one connection create a shared
- (non-exclusive) queue and then consume from the queue. In the second
- connection attempt to consume from the same queue using the exclusive
- option.
- </doc>
- </rule>
- </field>
-
- <field name = "filter" domain = "table" label = "arguments for consuming">
- <doc>
- A set of filters for the consume. The syntax and semantics
- of these filters depends on the providers implementation.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "cancel" index = "30" label = "[WORK IN PROGRESS] end a queue consumer">
- <doc>
- [WORK IN PROGRESS] This method cancels a consumer. This does not affect already delivered
- messages, but it does mean the server will not send any more messages for
- that consumer. The client may receive an arbitrary number of messages in
- between sending the cancel method and receiving the cancel-ok reply.
- </doc>
-
- <rule name = "01">
- <doc>
- If the queue does not exist the server MUST ignore the cancel method, so
- long as the consumer tag is valid for that channel.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "ok" />
-
- <field name = "destination" domain = "destination"/>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "get" index = "40" label = "[WORK IN PROGRESS] direct access to a queue">
- <doc>
- [WORK IN PROGRESS] This method provides a direct access to the messages in a queue using a synchronous
- dialogue that is designed for specific types of application where synchronous
- functionality is more important than performance.
- </doc>
-
- <response name = "ok" />
- <response name = "empty" />
- <chassis name = "server" implement = "MUST" />
-
- <field name = "ticket" domain = "access-ticket">
- <rule name = "01">
- <doc>
- The client MUST provide a valid access ticket giving "read" access rights to
- the realm for the queue.
- </doc>
- </rule>
- </field>
- <field name = "queue" domain = "queue-name">
- <doc>
- Specifies the name of the queue to consume from. If the queue name is null,
- refers to the current queue for the channel, which is the last declared queue.
- </doc>
- <rule name = "01">
- <doc>
- If the client did not previously declare a queue, and the queue name in this
- method is empty, the server MUST raise a connection exception with reply
- code 530 (not allowed).
- </doc>
- </rule>
- </field>
-
- <field name = "destination" domain = "destination">
- <doc>
- On normal completion of the get request (i.e. a response of
- ok). A message will be transferred to the supplied destination.
- </doc>
- </field>
-
- <field name = "no-ack" domain = "no-ack" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "recover" index = "50" label = "[WORK IN PROGRESS] redeliver unacknowledged messages">
- <doc>
- [WORK IN PROGRESS] This method asks the broker to redeliver all unacknowledged
- messages on a specified channel. Zero or more messages may be
- redelivered. This method is only allowed on non-transacted
- channels.
- </doc>
-
- <rule name = "01">
- <doc>
- The server MUST set the redelivered flag on all messages
- that are resent.
- </doc>
- </rule>
-
- <rule name = "02">
- <doc>
- The server MUST raise a channel exception if this is called
- on a transacted channel.
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "ok" />
-
- <field name = "requeue" domain = "bit" label = "requeue the message">
- <doc>
- If this field is zero, the message will be redelivered to
- the original recipient. If this bit is 1, the server will
- attempt to requeue the message, potentially then delivering
- it to an alternative subscriber.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "open" index = "60" label = "[WORK IN PROGRESS] create a reference to an empty message body">
- <doc>
- [WORK IN PROGRESS] This method creates a reference. A references provides a means
- to send a message body into a temporary area at the recipient
- end and then deliver the message by referring to this
- temporary area. This is how the protocol handles large message
- transfers.
-
- The scope of a ref is defined to be between calls to
- open (or resume) and close. Between these points it is valid
- for a ref to be used from any content data type, and so the
- receiver must hold onto its contents. Should the channel be
- closed when a ref is still in scope, the receiver may discard
- its contents (unless it is checkpointed). A ref that is in
- scope is considered open.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- <response name = "ok" />
-
- <field name = "reference" domain = "reference">
- <rule name = "01">
- <doc>
- The recipient MUST generate an error if the reference is
- currently open (in scope).
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "close" index = "70" label = "[WORK IN PROGRESS] close a reference">
- <doc>
- [WORK IN PROGRESS] This method signals the recipient that no more data will be
- appended to the reference.
- </doc>
-
- <rule name = "01">
- <doc>
- A recipient CANNOT acknowledge a message until its reference
- is closed (not in scope).
- </doc>
- </rule>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
-
- <response name = "ok" />
- <field name = "reference" domain = "reference" label = "target reference">
- <rule name = "01">
- <doc>
- The recipient MUST generate an error if the reference was
- not previously open (in scope).
- </doc>
- </rule>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "append" index = "80" label = "[WORK IN PROGRESS] append to a reference">
- <doc>
- [WORK IN PROGRESS] This method appends data to a reference.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- <response name = "ok" />
-
- <field name = "reference" domain = "reference" label = "target reference">
- <rule name = "01">
- <doc>
- The recipient MUST generate an error if the reference is
- not open (not in scope).
- </doc>
- </rule>
- </field>
- <field name = "bytes" domain = "longstr" label = "data to append" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "checkpoint" index = "90" label = "[WORK IN PROGRESS] checkpoint a message body">
- <doc>
- [WORK IN PROGRESS] This method provides a means to checkpoint large message
- transfer. The sender may ask the recipient to checkpoint the
- contents of a reference using the supplied identifier. The
- sender may then resume the transfer at a later point. It is at
- the discretion of the recipient how much data to save with the
- checkpoint, and the sender MUST honour the offset returned by
- the resume method.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- <response name = "ok" />
-
- <field name = "reference" domain = "reference" label = "target reference">
- <rule name = "01">
- <doc>
- The recipient MUST generate an error if the reference is
- not open (not in scope).
- </doc>
- </rule>
- </field>
- <field name = "identifier" domain = "shortstr" label = "checkpoint identifier">
- <doc>
- This is the checkpoint identifier. This is an arbitrary
- string chosen by the sender. For checkpointing to work
- correctly the sender must use the same checkpoint identifier
- when resuming the message. A good choice for the checkpoint
- identifier would be the SHA1 hash of the message properties
- data (including the original filename, revised time, etc.).
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "resume" index = "100" label = "[WORK IN PROGRESS] open and resume a checkpointed message">
- <doc>
- [WORK IN PROGRESS] This method resumes a reference from the last checkpoint. A
- reference is considered to be open (in scope) after a resume
- even though it will not have been opened via the open method
- during this session.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- <response name = "offset" />
-
- <field name = "reference" domain = "reference" label = "target reference">
- <rule name = "01">
- <doc>
- The recipient MUST generate an error if the reference is
- currently open (in scope).
- </doc>
- </rule>
- </field>
- <field name = "identifier" domain = "shortstr" label = "checkpoint identifier" />
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <method name = "qos" index = "110" label = "[WORK IN PROGRESS] specify quality of service">
- <doc>
- [WORK IN PROGRESS] This method requests a specific quality of service. The QoS can be specified for the
- current channel or for all channels on the connection. The particular properties and
- semantics of a qos method always depend on the content class semantics. Though the
- qos method could in principle apply to both peers, it is currently meaningful only
- for the server.
- </doc>
-
- <chassis name = "server" implement = "MUST" />
- <response name = "ok" />
-
- <field name = "prefetch-size" domain = "long" label = "prefetch window in octets">
- <doc>
- The client can request that messages be sent in advance so that when the client
- finishes processing a message, the following message is already held locally,
- rather than needing to be sent down the channel. Prefetching gives a performance
- improvement. This field specifies the prefetch window size in octets. The server
- will send a message in advance if it is equal to or smaller in size than the
- available prefetch size (and also falls into other prefetch limits). May be set
- to zero, meaning "no specific limit", although other prefetch limits may still
- apply. The prefetch-size is ignored if the no-ack option is set.
- </doc>
- <rule name = "01">
- <doc>
- The server MUST ignore this setting when the client is not processing any
- messages - i.e. the prefetch size does not limit the transfer of single
- messages to a client, only the sending in advance of more messages while
- the client still has one or more unacknowledged messages.
- </doc>
- <doc type = "scenario">
- Define a QoS prefetch-size limit and send a single message that exceeds
- that limit. Verify that the message arrives correctly.
- </doc>
- </rule>
- </field>
-
- <field name = "prefetch-count" domain = "short" label = "prefetch window in messages">
- <doc>
- Specifies a prefetch window in terms of whole messages. This field may be used
- in combination with the prefetch-size field; a message will only be sent in
- advance if both prefetch windows (and those at the channel and connection level)
- allow it. The prefetch-count is ignored if the no-ack option is set.
- </doc>
- <rule name = "01">
- <doc>
- The server may send less data in advance than allowed by the client's
- specified prefetch windows but it MUST NOT send more.
- </doc>
- <doc type = "scenario">
- Define a QoS prefetch-size limit and a prefetch-count limit greater than
- one. Send multiple messages that exceed the prefetch size. Verify that
- no more than one message arrives at once.
- </doc>
- </rule>
- </field>
-
- <field name = "global" domain = "bit" label = "apply to entire connection">
- <doc>
- By default the QoS settings apply to the current channel only. If this field is
- set, they are applied to the entire connection.
- </doc>
- </field>
- </method>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- === Responses === -->
-
- <method name = "ok" index = "500" label = "[WORK IN PROGRESS] normal completion">
- <doc>
- [WORK IN PROGRESS] Signals the normal completion of a method.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <method name = "empty" index = "510" label = "[WORK IN PROGRESS] empty queue">
- <doc>
- [WORK IN PROGRESS] Signals that a queue does not contain any messages.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- </method>
-
- <method name = "reject" index = "520" label = "[WORK IN PROGRESS] reject a message">
- <doc>
- [WORK IN PROGRESS] This response rejects a message. A message may be rejected for
- a number of reasons.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- <field name = "code" domain = "reject-code" />
- <field name = "text" domain = "reject-text" />
- </method>
-
- <method name = "offset" index = "530" label = "[WORK IN PROGRESS] return an offset">
- <doc>
- [WORK IN PROGRESS] Returns the data offset into a reference body.
- </doc>
- <chassis name = "server" implement = "MUST" />
- <chassis name = "client" implement = "MUST" />
- <field name = "value" domain = "offset" label = "offset into a reference body" />
- </method>
-
- </class>
-
-</amqp>
diff --git a/M4-RCs/qpid/specs/cluster.0-8.xml b/M4-RCs/qpid/specs/cluster.0-8.xml
deleted file mode 100644
index d5b1e6cd5c..0000000000
--- a/M4-RCs/qpid/specs/cluster.0-8.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.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 major="10" minor="0" port="5672" comment="AMQ protocol 0-10">
-
- <class name = "cluster" code = "101">
-
- <doc>
- An extension that allows brokers to communicate in order to
- provide a clustered service to clients.
- </doc>
-
- <control name = "join" index="10">
- <field name = "broker" type = "str8" />
- </control>
-
- <control name = "membership" index="20">
- <field name = "members" type = "longstr" />
- </control>
-
- <control name = "synch" index="30">
- </control>
-
- <control name = "leave" index="40">
- <field name = "broker" type = "str8" />
- </control>
-
- <control name = "suspect" index="50">
- <field name = "broker" type = "str8" />
- </control>
-
- <control name = "ping" index="60">
- <field name = "broker" type = "str8" />
- <field name = "load" type = "long" />
- <field name = "response-required" type = "bit" />
- </control>
-
- </class>
-
-</amqp>
diff --git a/M4-RCs/qpid/specs/management-schema.xml b/M4-RCs/qpid/specs/management-schema.xml
deleted file mode 100644
index 054a515772..0000000000
--- a/M4-RCs/qpid/specs/management-schema.xml
+++ /dev/null
@@ -1,331 +0,0 @@
-<schema package="org.apache.qpid.broker">
-
-<!--
- 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.
--->
-
- <!-- Type information:
-
- Numeric types with "_wm" suffix are watermarked numbers. These are compound
- values containing a current value, and a low and high water mark for the reporting
- interval. The low and high water marks are set to the current value at the
- beginning of each interval and track the minimum and maximum values of the statistic
- over the interval respectively.
-
- Access rights for configuration elements:
-
- RO => Read Only
- RC => Read/Create, can be set at create time only, read-only thereafter
- RW => Read/Write
-
- If access rights are omitted for a property, they are assumed to be RO.
-
- -->
-
- <!-- Questions: Does C++ broker round-robin dests on queues? -->
-
- <!--
- ===============================================================
- System
- ===============================================================
- -->
- <class name="System">
- <property name="systemId" index="y" type="uuid" access="RC"/>
-
- <property name="osName" type="sstr" access="RO" desc="Operating System Name"/>
- <property name="nodeName" type="sstr" access="RO" desc="Node Name"/>
- <property name="release" type="sstr" access="RO"/>
- <property name="version" type="sstr" access="RO"/>
- <property name="machine" type="sstr" access="RO"/>
-
- </class>
-
- <!--
- ===============================================================
- Broker
- ===============================================================
- -->
- <class name="Broker">
- <property name="systemRef" type="objId" references="System" access="RC" index="y" desc="System ID" parentRef="y"/>
- <property name="port" type="uint16" access="RC" index="y" desc="TCP Port for AMQP Service"/>
- <property name="workerThreads" type="uint16" access="RO" desc="Thread pool size"/>
- <property name="maxConns" type="uint16" access="RO" desc="Maximum allowed connections"/>
- <property name="connBacklog" type="uint16" access="RO" desc="Connection backlog limit for listening socket"/>
- <property name="stagingThreshold" type="uint32" access="RO" desc="Broker stages messages over this size to disk"/>
- <property name="mgmtPubInterval" type="uint16" access="RW" unit="second" min="1" desc="Interval for management broadcasts"/>
- <property name="version" type="sstr" access="RO" desc="Running software version"/>
- <property name="dataDir" type="sstr" access="RO" optional="y" desc="Persistent configuration storage location"/>
-
- <method name="echo" desc="Request a response to test the path to the management broker">
- <arg name="sequence" dir="IO" type="uint32" default="0"/>
- <arg name="body" dir="IO" type="lstr" default=""/>
- </method>
-
- <method name="connect" desc="Establish a connection to another broker">
- <arg name="host" dir="I" type="sstr"/>
- <arg name="port" dir="I" type="uint32"/>
- <arg name="durable" dir="I" type="bool"/>
- <arg name="authMechanism" dir="I" type="sstr"/>
- <arg name="username" dir="I" type="sstr"/>
- <arg name="password" dir="I" type="sstr"/>
- <arg name="transport" dir="I" type="sstr"/>
- </method>
-
- <method name="queueMoveMessages" desc="Move messages from one queue to another">
- <arg name="srcQueue" dir="I" type="sstr" desc="Source queue"/>
- <arg name="destQueue" dir="I" type="sstr" desc="Destination queue"/>
- <arg name="qty" dir="I" type="uint32" desc="# of messages to move. 0 means all messages"/>
- </method>
-
- </class>
-
- <!--
- ===============================================================
- Management Agent
- ===============================================================
- -->
- <class name="Agent">
- <property name="connectionRef" type="objId" references="Connection" access="RO" index="y"/>
- <property name="label" type="sstr" access="RO" desc="Label for agent"/>
- <property name="registeredTo" type="objId" references="Broker" access="RO" desc="Broker agent is registered to"/>
- <property name="systemId" type="uuid" access="RO" desc="Identifier of system where agent resides"/>
- <property name="brokerBank" type="uint32" access="RO" desc="Assigned object-id broker bank"/>
- <property name="agentBank" type="uint32" access="RO" desc="Assigned object-id agent bank"/>
- </class>
-
- <!--
- ===============================================================
- Virtual Host
- ===============================================================
- -->
- <class name="Vhost">
- <property name="brokerRef" type="objId" references="Broker" access="RC" index="y" parentRef="y"/>
- <property name="name" type="sstr" access="RC" index="y"/>
- <property name="federationTag" type="sstr" access="RO"/>
- </class>
-
- <!--
- ===============================================================
- Queue
- ===============================================================
- -->
- <class name="Queue">
- <property name="vhostRef" type="objId" references="Vhost" access="RC" index="y" parentRef="y"/>
- <property name="name" type="sstr" access="RC" index="y"/>
-
- <property name="durable" type="bool" access="RC"/>
- <property name="autoDelete" type="bool" access="RC"/>
- <property name="exclusive" type="bool" access="RC"/>
- <property name="arguments" type="map" access="RO" desc="Arguments supplied in queue.declare"/>
-
- <statistic name="msgTotalEnqueues" type="count64" unit="message" desc="Total messages enqueued"/>
- <statistic name="msgTotalDequeues" type="count64" unit="message" desc="Total messages dequeued"/>
- <statistic name="msgTxnEnqueues" type="count64" unit="message" desc="Transactional messages enqueued"/>
- <statistic name="msgTxnDequeues" type="count64" unit="message" desc="Transactional messages dequeued"/>
- <statistic name="msgPersistEnqueues" type="count64" unit="message" desc="Persistent messages enqueued"/>
- <statistic name="msgPersistDequeues" type="count64" unit="message" desc="Persistent messages dequeued"/>
- <statistic name="msgDepth" type="count32" unit="message" desc="Current size of queue in messages" assign="msgTotalEnqueues - msgTotalDequeues"/>
- <statistic name="byteDepth" type="count32" unit="octet" desc="Current size of queue in bytes" assign="byteTotalEnqueues - byteTotalDequeues"/>
- <statistic name="byteTotalEnqueues" type="count64" unit="octet" desc="Total messages enqueued"/>
- <statistic name="byteTotalDequeues" type="count64" unit="octet" desc="Total messages dequeued"/>
- <statistic name="byteTxnEnqueues" type="count64" unit="octet" desc="Transactional messages enqueued"/>
- <statistic name="byteTxnDequeues" type="count64" unit="octet" desc="Transactional messages dequeued"/>
- <statistic name="bytePersistEnqueues" type="count64" unit="octet" desc="Persistent messages enqueued"/>
- <statistic name="bytePersistDequeues" type="count64" unit="octet" desc="Persistent messages dequeued"/>
- <statistic name="consumerCount" type="hilo32" unit="consumer" desc="Current consumers on queue"/>
- <statistic name="bindingCount" type="hilo32" unit="binding" desc="Current bindings"/>
- <statistic name="unackedMessages" type="hilo32" unit="message" desc="Messages consumed but not yet acked"/>
- <statistic name="messageLatency" type="mmaTime" unit="nanosecond" desc="Broker latency through this queue"/>
-
- <method name="purge" desc="Discard all or some messages on a queue">
- <arg name="request" dir="I" type="uint32" desc="0 for all messages or n>0 for n messages"/>
- </method>
- </class>
-
- <!--
- ===============================================================
- Exchange
- ===============================================================
- -->
- <class name="Exchange">
- <property name="vhostRef" type="objId" references="Vhost" access="RC" index="y" parentRef="y"/>
- <property name="name" type="sstr" access="RC" index="y"/>
- <property name="type" type="sstr" access="RO"/>
- <property name="durable" type="bool" access="RC"/>
- <property name="arguments" type="map" access="RO" desc="Arguments supplied in exchange.declare"/>
-
- <statistic name="producerCount" type="hilo32" desc="Current producers on exchange"/>
- <statistic name="bindingCount" type="hilo32" desc="Current bindings"/>
- <statistic name="msgReceives" type="count64" desc="Total messages received"/>
- <statistic name="msgDrops" type="count64" desc="Total messages dropped (no matching key)"/>
- <statistic name="msgRoutes" type="count64" desc="Total routed messages"/>
- <statistic name="byteReceives" type="count64" desc="Total bytes received"/>
- <statistic name="byteDrops" type="count64" desc="Total bytes dropped (no matching key)"/>
- <statistic name="byteRoutes" type="count64" desc="Total routed bytes"/>
- </class>
-
- <!--
- ===============================================================
- Binding
- ===============================================================
- -->
- <class name="Binding">
- <property name="exchangeRef" type="objId" references="Exchange" access="RC" index="y" parentRef="y"/>
- <property name="queueRef" type="objId" references="Queue" access="RC" index="y"/>
- <property name="bindingKey" type="sstr" access="RC" index="y"/>
- <property name="arguments" type="map" access="RC"/>
- <property name="origin" type="sstr" access="RO" optional="y"/>
-
- <statistic name="msgMatched" type="count64"/>
- </class>
-
- <!--
- ===============================================================
- Connection
- ===============================================================
- -->
- <class name="Connection">
- <property name="vhostRef" type="objId" references="Vhost" access="RC" index="y" parentRef="y"/>
- <property name="address" type="sstr" access="RC" index="y"/>
- <property name="incoming" type="bool" access="RC"/>
- <property name="SystemConnection" type="bool" access="RC" desc="Infrastucture/ Inter-system connection (Cluster, Federation, ...)"/>
- <property name="federationLink" type="bool" access="RO" desc="Is this a federation link"/>
- <property name="authIdentity" type="sstr" access="RO" desc="authId of connection if authentication enabled"/>
- <statistic name="closing" type="bool" desc="This client is closing by management request"/>
- <statistic name="framesFromClient" type="count64"/>
- <statistic name="framesToClient" type="count64"/>
- <statistic name="bytesFromClient" type="count64"/>
- <statistic name="bytesToClient" type="count64"/>
-
- <method name="close"/>
- </class>
-
- <!--
- ===============================================================
- Link
- ===============================================================
- -->
- <class name="Link">
-
- This class represents an inter-broker connection.
-
- <property name="vhostRef" type="objId" references="Vhost" access="RC" index="y" parentRef="y"/>
- <property name="host" type="sstr" access="RC" index="y"/>
- <property name="port" type="uint16" access="RC" index="y"/>
- <property name="transport" type="sstr" access="RC"/>
- <property name="durable" type="bool" access="RC"/>
-
- <statistic name="state" type="sstr" desc="Operational state of the link"/>
- <statistic name="lastError" type="sstr" desc="Reason link is not operational"/>
-
- <method name="close"/>
-
- <method name="bridge" desc="Bridge messages over the link">
- <arg name="durable" dir="I" type="bool"/>
- <arg name="src" dir="I" type="sstr"/>
- <arg name="dest" dir="I" type="sstr"/>
- <arg name="key" dir="I" type="sstr"/>
- <arg name="tag" dir="I" type="sstr"/>
- <arg name="excludes" dir="I" type="sstr"/>
- <arg name="srcIsQueue" dir="I" type="bool"/>
- <arg name="srcIsLocal" dir="I" type="bool"/>
- <arg name="dynamic" dir="I" type="bool"/>
- </method>
- </class>
-
-
- <!--
- ===============================================================
- Bridge
- ===============================================================
- -->
- <class name="Bridge">
- <property name="linkRef" type="objId" references="Link" access="RC" index="y" parentRef="y"/>
- <property name="channelId" type="uint16" access="RC" index="y"/>
- <property name="durable" type="bool" access="RC"/>
- <property name="src" type="sstr" access="RC"/>
- <property name="dest" type="sstr" access="RC"/>
- <property name="key" type="sstr" access="RC"/>
- <property name="srcIsQueue" type="bool" access="RC"/>
- <property name="srcIsLocal" type="bool" access="RC"/>
- <property name="tag" type="sstr" access="RC"/>
- <property name="excludes" type="sstr" access="RC"/>
- <property name="dynamic" type="bool" access="RC"/>
- <method name="close"/>
- </class>
-
-
- <!--
- ===============================================================
- Session
- ===============================================================
- -->
- <class name="Session">
- <property name="vhostRef" type="objId" references="Vhost" access="RC" index="y" parentRef="y"/>
- <property name="name" type="sstr" access="RC" index="y"/>
- <property name="channelId" type="uint16" access="RO"/>
- <property name="connectionRef" type="objId" references="Connection" access="RO"/>
- <property name="detachedLifespan" type="uint32" access="RO" unit="second"/>
- <property name="attached" type="bool" access="RO"/>
- <property name="expireTime" type="absTime" access="RO" optional="y"/>
-
- <statistic name="framesOutstanding" type="count32"/>
-
- <statistic name="TxnStarts" type="count64" unit="transaction" desc="Total transactions started "/>
- <statistic name="TxnCommits" type="count64" unit="transaction" desc="Total transactions committed"/>
- <statistic name="TxnRejects" type="count64" unit="transaction" desc="Total transactions rejected"/>
- <statistic name="TxnCount" type="count32" unit="transaction" desc="Current pending transactions"/>
-
- <method name="solicitAck"/>
- <method name="detach"/>
- <method name="resetLifespan"/>
- <method name="close"/>
- </class>
-
- <eventArguments>
- <arg name="altEx" type="sstr" desc="Name of the alternate exchange"/>
- <arg name="args" type="map" desc="Supplemental arguments or parameters supplied"/>
- <arg name="autoDel" type="bool" desc="Created object is automatically deleted when no longer in use"/>
- <arg name="dest" type="sstr" desc="Destination tag for a subscription"/>
- <arg name="disp" type="sstr" desc="Disposition of a declaration: 'created' if object was created, 'existing' if object already existed"/>
- <arg name="durable" type="bool" desc="Created object is durable"/>
- <arg name="exName" type="sstr" desc="Name of an exchange"/>
- <arg name="exType" type="sstr" desc="Type of an exchange"/>
- <arg name="excl" type="bool" desc="Created object is exclusive for the use of the owner only"/>
- <arg name="key" type="lstr" desc="Key text used for routing or binding"/>
- <arg name="qName" type="sstr" desc="Name of a queue"/>
- <arg name="reason" type="lstr" desc="Reason for a failure"/>
- <arg name="rhost" type="sstr" desc="Address (i.e. DNS name, IP address, etc.) of a remotely connected host"/>
- <arg name="user" type="sstr" desc="Authentication identity"/>
- </eventArguments>
-
- <event name="clientConnect" sev="inform" args="rhost, user"/>
- <event name="clientConnectFail" sev="warn" args="rhost, user, reason"/>
- <event name="clientDisconnect" sev="inform" args="rhost, user"/>
- <event name="brokerLinkUp" sev="inform" args="rhost"/>
- <event name="brokerLinkDown" sev="warn" args="rhost"/>
- <event name="queueDeclare" sev="inform" args="rhost, user, qName, durable, excl, autoDel, args, disp"/>
- <event name="queueDelete" sev="inform" args="rhost, user, qName"/>
- <event name="exchangeDeclare" sev="inform" args="rhost, user, exName, exType, altEx, durable, autoDel, args, disp"/>
- <event name="exchangeDelete" sev="inform" args="rhost, user, exName"/>
- <event name="bind" sev="inform" args="rhost, user, exName, qName, key, args"/>
- <event name="unbind" sev="inform" args="rhost, user, exName, qName, key"/>
- <event name="subscribe" sev="inform" args="rhost, user, qName, dest, excl, args"/>
- <event name="unsubscribe" sev="inform" args="rhost, user, dest"/>
-</schema>
-